summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--AUTHORS88
-rw-r--r--COPYING340
-rw-r--r--COPYING.LIB481
-rw-r--r--ChangeLog2846
-rw-r--r--ConfigureChecks.cmake27
-rw-r--r--Doxyfile274
-rw-r--r--Doxyfile.am186
-rw-r--r--Doxyfile_full.am215
-rw-r--r--HACKING9
-rw-r--r--HACKING.language12
-rw-r--r--INSTALL175
-rw-r--r--Makefile.am54
-rw-r--r--Makefile.cvs14
-rw-r--r--NEWS0
-rw-r--r--README25
-rw-r--r--TODO1
-rw-r--r--buildtools/Makefile.am48
-rw-r--r--buildtools/ada/Makefile.am18
-rw-r--r--buildtools/ada/README.dox17
-rw-r--r--buildtools/ada/adaglobaloptionsdlg.cpp129
-rw-r--r--buildtools/ada/adaglobaloptionsdlg.h50
-rw-r--r--buildtools/ada/adaproject_optionsdlgbase.ui472
-rw-r--r--buildtools/ada/adaproject_part.cpp465
-rw-r--r--buildtools/ada/adaproject_part.h93
-rw-r--r--buildtools/ada/adaproject_widget.cpp24
-rw-r--r--buildtools/ada/adaproject_widget.h21
-rw-r--r--buildtools/ada/adaprojectoptionsdlg.cpp208
-rw-r--r--buildtools/ada/adaprojectoptionsdlg.h57
-rw-r--r--buildtools/ada/kdevadaproject.desktop100
-rw-r--r--buildtools/ada/kdevadaproject.rc14
-rw-r--r--buildtools/ada/service.cpp75
-rw-r--r--buildtools/ada/service.h27
-rw-r--r--buildtools/ant/Makefile.am21
-rw-r--r--buildtools/ant/README.dox8
-rw-r--r--buildtools/ant/antoptionswidget.ui173
-rw-r--r--buildtools/ant/antprojectpart.cpp608
-rw-r--r--buildtools/ant/antprojectpart.h117
-rw-r--r--buildtools/ant/classpathwidget.ui39
-rw-r--r--buildtools/ant/kdevantproject.desktop96
-rw-r--r--buildtools/ant/kdevantproject.rc14
-rw-r--r--buildtools/autotools/Makefile.am38
-rw-r--r--buildtools/autotools/README1
-rw-r--r--buildtools/autotools/README.dox39
-rw-r--r--buildtools/autotools/addapplicationdlg.cpp207
-rw-r--r--buildtools/autotools/addapplicationdlg.h45
-rw-r--r--buildtools/autotools/addapplicationdlgbase.ui552
-rw-r--r--buildtools/autotools/addexistingdirectoriesdlg.cpp388
-rw-r--r--buildtools/autotools/addexistingdirectoriesdlg.h74
-rw-r--r--buildtools/autotools/addexistingdlgbase.ui459
-rw-r--r--buildtools/autotools/addexistingfilesdlg.cpp451
-rw-r--r--buildtools/autotools/addexistingfilesdlg.h77
-rw-r--r--buildtools/autotools/addfiledlg.cpp135
-rw-r--r--buildtools/autotools/addfiledlg.h47
-rw-r--r--buildtools/autotools/addfiledlgbase.ui289
-rw-r--r--buildtools/autotools/addicondlg.cpp115
-rw-r--r--buildtools/autotools/addicondlg.h44
-rw-r--r--buildtools/autotools/addicondlgbase.ui273
-rw-r--r--buildtools/autotools/addprefixdlg.cpp76
-rw-r--r--buildtools/autotools/addprefixdlg.h45
-rw-r--r--buildtools/autotools/addservicedlg.cpp233
-rw-r--r--buildtools/autotools/addservicedlg.h46
-rw-r--r--buildtools/autotools/addservicedlgbase.ui544
-rw-r--r--buildtools/autotools/addsubprojectdlg.cpp198
-rw-r--r--buildtools/autotools/addsubprojectdlg.h44
-rw-r--r--buildtools/autotools/addsubprojectdlgbase.ui198
-rw-r--r--buildtools/autotools/addtargetdlg.cpp226
-rw-r--r--buildtools/autotools/addtargetdlg.h43
-rw-r--r--buildtools/autotools/addtargetdlgbase.ui348
-rw-r--r--buildtools/autotools/addtranslationdlg.cpp109
-rw-r--r--buildtools/autotools/addtranslationdlg.h36
-rw-r--r--buildtools/autotools/autodetailsview.cpp728
-rw-r--r--buildtools/autotools/autodetailsview.h88
-rw-r--r--buildtools/autotools/autolistviewitems.cpp181
-rw-r--r--buildtools/autotools/autolistviewitems.h143
-rw-r--r--buildtools/autotools/autoprojectpart.cpp1474
-rw-r--r--buildtools/autotools/autoprojectpart.h153
-rw-r--r--buildtools/autotools/autoprojectviewbase.ui123
-rw-r--r--buildtools/autotools/autoprojectwidget.cpp748
-rw-r--r--buildtools/autotools/autoprojectwidget.h229
-rw-r--r--buildtools/autotools/autosubprojectview.cpp1137
-rw-r--r--buildtools/autotools/autosubprojectview.h130
-rw-r--r--buildtools/autotools/autotoolsaction.cpp156
-rw-r--r--buildtools/autotools/autotoolsaction.h70
-rw-r--r--buildtools/autotools/choosetargetdialog.cpp348
-rw-r--r--buildtools/autotools/choosetargetdialog.h57
-rw-r--r--buildtools/autotools/choosetargetdlgbase.ui222
-rw-r--r--buildtools/autotools/configureoptionswidget.cpp431
-rw-r--r--buildtools/autotools/configureoptionswidget.h69
-rw-r--r--buildtools/autotools/configureoptionswidgetbase.ui1040
-rw-r--r--buildtools/autotools/fileselectorwidget.cpp243
-rw-r--r--buildtools/autotools/fileselectorwidget.h96
-rw-r--r--buildtools/autotools/kdevautoproject.desktop97
-rw-r--r--buildtools/autotools/kdevautoproject.rc30
-rw-r--r--buildtools/autotools/kdevkdeautoproject.desktop92
-rw-r--r--buildtools/autotools/kfilednddetailview.cpp212
-rw-r--r--buildtools/autotools/kfilednddetailview.h136
-rw-r--r--buildtools/autotools/kfiledndiconview.cpp194
-rw-r--r--buildtools/autotools/kfiledndiconview.h128
-rw-r--r--buildtools/autotools/kimporticonview.cpp87
-rw-r--r--buildtools/autotools/kimporticonview.h44
-rw-r--r--buildtools/autotools/makefilehandler.cpp166
-rw-r--r--buildtools/autotools/makefilehandler.h76
-rw-r--r--buildtools/autotools/managecustomcommand.cpp49
-rw-r--r--buildtools/autotools/managecustomcommand.h37
-rw-r--r--buildtools/autotools/managecustomcommandsbase.ui125
-rw-r--r--buildtools/autotools/misc.cpp999
-rw-r--r--buildtools/autotools/misc.h65
-rw-r--r--buildtools/autotools/removefiledlg.cpp182
-rw-r--r--buildtools/autotools/removefiledlg.h51
-rw-r--r--buildtools/autotools/removefiledlgbase.ui233
-rw-r--r--buildtools/autotools/removetargetdlg.cpp279
-rw-r--r--buildtools/autotools/removetargetdlg.h55
-rw-r--r--buildtools/autotools/removetargetdlgbase.ui264
-rw-r--r--buildtools/autotools/subprojectoptionsdlg.cpp404
-rw-r--r--buildtools/autotools/subprojectoptionsdlg.h63
-rw-r--r--buildtools/autotools/subprojectoptionsdlgbase.ui989
-rw-r--r--buildtools/autotools/targetoptionsdlg.cpp357
-rw-r--r--buildtools/autotools/targetoptionsdlg.h49
-rw-r--r--buildtools/autotools/targetoptionsdlgbase.ui726
-rw-r--r--buildtools/custommakefiles/Makefile.am26
-rw-r--r--buildtools/custommakefiles/README.dox47
-rw-r--r--buildtools/custommakefiles/custombuildoptionswidget.cpp99
-rw-r--r--buildtools/custommakefiles/custombuildoptionswidget.h46
-rw-r--r--buildtools/custommakefiles/custombuildoptionswidgetbase.ui164
-rw-r--r--buildtools/custommakefiles/custommakeconfigwidget.cpp134
-rw-r--r--buildtools/custommakefiles/custommakeconfigwidget.h54
-rw-r--r--buildtools/custommakefiles/custommakeconfigwidgetbase.ui395
-rw-r--r--buildtools/custommakefiles/custommanagerwidget.cpp80
-rw-r--r--buildtools/custommakefiles/custommanagerwidget.h41
-rw-r--r--buildtools/custommakefiles/custommanagerwidgetbase.ui74
-rw-r--r--buildtools/custommakefiles/customotherconfigwidget.cpp125
-rw-r--r--buildtools/custommakefiles/customotherconfigwidget.h57
-rw-r--r--buildtools/custommakefiles/customotherconfigwidgetbase.ui288
-rw-r--r--buildtools/custommakefiles/customprojectpart.cpp1669
-rw-r--r--buildtools/custommakefiles/customprojectpart.h158
-rw-r--r--buildtools/custommakefiles/kdevcustomproject.desktop91
-rw-r--r--buildtools/custommakefiles/kdevcustomproject.rc30
-rw-r--r--buildtools/custommakefiles/selectnewfilesdialog.cpp131
-rw-r--r--buildtools/custommakefiles/selectnewfilesdialog.h53
-rw-r--r--buildtools/custommakefiles/selectnewfilesdialogbase.ui50
-rw-r--r--buildtools/lib/Makefile.am8
-rw-r--r--buildtools/lib/base/Mainpage.dox19
-rw-r--r--buildtools/lib/base/Makefile.am15
-rw-r--r--buildtools/lib/base/kdevbuildtool.cpp38
-rw-r--r--buildtools/lib/base/kdevbuildtool.h41
-rw-r--r--buildtools/lib/parsers/Makefile.am8
-rw-r--r--buildtools/lib/parsers/autotools/Mainpage.dox11
-rw-r--r--buildtools/lib/parsers/autotools/Makefile.am24
-rw-r--r--buildtools/lib/parsers/autotools/autotools.ll136
-rw-r--r--buildtools/lib/parsers/autotools/autotools.yy323
-rw-r--r--buildtools/lib/parsers/autotools/autotools_lex.cpp1894
-rw-r--r--buildtools/lib/parsers/autotools/autotools_yacc.cpp1631
-rw-r--r--buildtools/lib/parsers/autotools/autotools_yacc.h100
-rw-r--r--buildtools/lib/parsers/autotools/autotoolsast.cpp117
-rw-r--r--buildtools/lib/parsers/autotools/autotoolsast.h269
-rw-r--r--buildtools/lib/parsers/autotools/autotoolsdriver.cpp70
-rw-r--r--buildtools/lib/parsers/autotools/autotoolsdriver.h76
-rw-r--r--buildtools/lib/parsers/autotools/tests/Makefile.am21
-rw-r--r--buildtools/lib/parsers/autotools/tests/runner.cpp33
-rw-r--r--buildtools/lib/parsers/autotools/tests/viewer.cpp162
-rw-r--r--buildtools/lib/parsers/autotools/tests/viewer.h46
-rw-r--r--buildtools/lib/parsers/autotools/tests/viewer_main.cpp34
-rw-r--r--buildtools/lib/parsers/autotools/tests/viewerbase.ui220
-rw-r--r--buildtools/lib/parsers/qmake/FlexLexer.h205
-rw-r--r--buildtools/lib/parsers/qmake/Mainpage.dox16
-rw-r--r--buildtools/lib/parsers/qmake/Makefile.am31
-rw-r--r--buildtools/lib/parsers/qmake/location.hh145
-rw-r--r--buildtools/lib/parsers/qmake/position.hh142
-rw-r--r--buildtools/lib/parsers/qmake/qmake.ll237
-rw-r--r--buildtools/lib/parsers/qmake/qmake.yy430
-rw-r--r--buildtools/lib/parsers/qmake/qmake_lex.cpp2239
-rw-r--r--buildtools/lib/parsers/qmake/qmake_lex.h49
-rw-r--r--buildtools/lib/parsers/qmake/qmake_yacc.cpp1243
-rw-r--r--buildtools/lib/parsers/qmake/qmake_yacc.hpp418
-rw-r--r--buildtools/lib/parsers/qmake/qmakeast.cpp170
-rw-r--r--buildtools/lib/parsers/qmake/qmakeast.h236
-rw-r--r--buildtools/lib/parsers/qmake/qmakeastvisitor.cpp68
-rw-r--r--buildtools/lib/parsers/qmake/qmakeastvisitor.h46
-rw-r--r--buildtools/lib/parsers/qmake/qmakedriver.cpp113
-rw-r--r--buildtools/lib/parsers/qmake/qmakedriver.h55
-rw-r--r--buildtools/lib/parsers/qmake/stack.hh129
-rw-r--r--buildtools/lib/parsers/qmake/tests/Makefile.am21
-rw-r--r--buildtools/lib/parsers/qmake/tests/runner.cpp169
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer.cpp182
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer.h48
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewer_main.cpp33
-rw-r--r--buildtools/lib/parsers/qmake/tests/viewerbase.ui250
-rw-r--r--buildtools/lib/widgets/Mainpage.dox10
-rw-r--r--buildtools/lib/widgets/Makefile.am30
-rw-r--r--buildtools/lib/widgets/addenvvardlg.cpp84
-rw-r--r--buildtools/lib/widgets/addenvvardlg.h54
-rw-r--r--buildtools/lib/widgets/addfilesdialog.cpp78
-rw-r--r--buildtools/lib/widgets/addfilesdialog.h57
-rw-r--r--buildtools/lib/widgets/environmentdisplaydialog.cpp54
-rw-r--r--buildtools/lib/widgets/environmentdisplaydialog.h35
-rw-r--r--buildtools/lib/widgets/environmentdisplaydialogbase.ui111
-rw-r--r--buildtools/lib/widgets/environmentvariableswidget.cpp126
-rw-r--r--buildtools/lib/widgets/environmentvariableswidget.h59
-rw-r--r--buildtools/lib/widgets/environmentvariableswidgetbase.ui200
-rw-r--r--buildtools/lib/widgets/envvartools.cpp31
-rw-r--r--buildtools/lib/widgets/envvartools.h28
-rw-r--r--buildtools/lib/widgets/makeoptionswidget.cpp64
-rw-r--r--buildtools/lib/widgets/makeoptionswidget.h50
-rw-r--r--buildtools/lib/widgets/makeoptionswidgetbase.ui194
-rw-r--r--buildtools/lib/widgets/removesubprojectdialog.cpp52
-rw-r--r--buildtools/lib/widgets/removesubprojectdialog.h52
-rw-r--r--buildtools/lib/widgets/removesubprojectdlgbase.ui154
-rw-r--r--buildtools/lib/widgets/runoptionswidget.cpp138
-rw-r--r--buildtools/lib/widgets/runoptionswidget.h57
-rw-r--r--buildtools/lib/widgets/runoptionswidgetbase.ui257
-rw-r--r--buildtools/lib/widgets/subclassesdlg.cpp122
-rw-r--r--buildtools/lib/widgets/subclassesdlg.h58
-rw-r--r--buildtools/lib/widgets/subclassesdlgbase.ui224
-rw-r--r--buildtools/pascal/Makefile.am24
-rw-r--r--buildtools/pascal/README.dox13
-rw-r--r--buildtools/pascal/kdevpascalproject.desktop93
-rw-r--r--buildtools/pascal/kdevpascalproject.rc14
-rw-r--r--buildtools/pascal/pascalglobaloptionsdlg.cpp132
-rw-r--r--buildtools/pascal/pascalglobaloptionsdlg.h52
-rw-r--r--buildtools/pascal/pascalproject_optionsdlgbase.ui474
-rw-r--r--buildtools/pascal/pascalproject_part.cpp493
-rw-r--r--buildtools/pascal/pascalproject_part.h95
-rw-r--r--buildtools/pascal/pascalproject_widget.cpp26
-rw-r--r--buildtools/pascal/pascalproject_widget.h25
-rw-r--r--buildtools/pascal/pascalprojectoptionsdlg.cpp210
-rw-r--r--buildtools/pascal/pascalprojectoptionsdlg.h59
-rw-r--r--buildtools/pascal/service.cpp77
-rw-r--r--buildtools/pascal/service.h29
-rw-r--r--buildtools/qmake/Makefile.am34
-rw-r--r--buildtools/qmake/README1
-rw-r--r--buildtools/qmake/README.dox39
-rw-r--r--buildtools/qmake/choosesubprojectdlg.cpp114
-rw-r--r--buildtools/qmake/choosesubprojectdlg.h64
-rw-r--r--buildtools/qmake/choosesubprojectdlgbase.ui134
-rw-r--r--buildtools/qmake/createscopedlg.cpp100
-rw-r--r--buildtools/qmake/createscopedlg.h45
-rw-r--r--buildtools/qmake/createscopedlgbase.ui329
-rw-r--r--buildtools/qmake/disablesubprojectdlg.cpp50
-rw-r--r--buildtools/qmake/disablesubprojectdlg.h42
-rw-r--r--buildtools/qmake/disablesubprojectdlgbase.ui126
-rw-r--r--buildtools/qmake/kdevtmakeproject.desktop91
-rw-r--r--buildtools/qmake/kdevtrollproject.desktop95
-rw-r--r--buildtools/qmake/kdevtrollproject.rc33
-rw-r--r--buildtools/qmake/newwidgetdlg.cpp80
-rw-r--r--buildtools/qmake/newwidgetdlg.h38
-rw-r--r--buildtools/qmake/newwidgetdlgbase.ui229
-rw-r--r--buildtools/qmake/projectconfigurationdlg.cpp2174
-rw-r--r--buildtools/qmake/projectconfigurationdlg.h145
-rw-r--r--buildtools/qmake/projectconfigurationdlgbase.ui2897
-rw-r--r--buildtools/qmake/qmakedefaultopts.cpp91
-rw-r--r--buildtools/qmake/qmakedefaultopts.h49
-rw-r--r--buildtools/qmake/qmakeoptionswidget.cpp63
-rw-r--r--buildtools/qmake/qmakeoptionswidget.h39
-rw-r--r--buildtools/qmake/qmakeoptionswidgetbase.ui217
-rw-r--r--buildtools/qmake/qmakescopeitem.cpp928
-rw-r--r--buildtools/qmake/qmakescopeitem.h128
-rw-r--r--buildtools/qmake/scope.cpp1710
-rw-r--r--buildtools/qmake/scope.h308
-rw-r--r--buildtools/qmake/trolllistview.cpp38
-rw-r--r--buildtools/qmake/trolllistview.h41
-rw-r--r--buildtools/qmake/trollprojectpart.cpp931
-rw-r--r--buildtools/qmake/trollprojectpart.h105
-rw-r--r--buildtools/qmake/trollprojectwidget.cpp2547
-rw-r--r--buildtools/qmake/trollprojectwidget.h218
-rw-r--r--buildtools/script/Makefile.am26
-rw-r--r--buildtools/script/README.dox48
-rw-r--r--buildtools/script/kdevscriptproject.desktop87
-rw-r--r--buildtools/script/kdevscriptproject.rc12
-rw-r--r--buildtools/script/scriptnewfiledlg.cpp119
-rw-r--r--buildtools/script/scriptnewfiledlg.h39
-rw-r--r--buildtools/script/scriptoptionswidget.cpp69
-rw-r--r--buildtools/script/scriptoptionswidget.h35
-rw-r--r--buildtools/script/scriptoptionswidgetbase.ui155
-rw-r--r--buildtools/script/scriptprojectpart.cpp446
-rw-r--r--buildtools/script/scriptprojectpart.h69
-rw-r--r--config.h.cmake22
-rw-r--r--configure.in.bot24
-rw-r--r--configure.in.in127
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/api/Architecture.dox315
-rw-r--r--doc/api/Architecture.pngbin0 -> 71707 bytes
-rw-r--r--doc/api/Architecture.sxdbin0 -> 7581 bytes
-rw-r--r--doc/api/Development.pngbin0 -> 71400 bytes
-rw-r--r--doc/api/Development.sxdbin0 -> 8396 bytes
-rw-r--r--doc/api/EditorsSupportStatus.dox189
-rw-r--r--doc/api/FutureTasks.dox136
-rw-r--r--doc/api/HighPriTasks.dox36
-rw-r--r--doc/api/HowToAddApplicationTemplates.dox285
-rw-r--r--doc/api/HowToAddFileTemplates.dox30
-rw-r--r--doc/api/HowToAddGenericBuildTools.dox21
-rw-r--r--doc/api/HowToAddPlugins.dox204
-rw-r--r--doc/api/HowToAddProgrammingLanguages.dox252
-rw-r--r--doc/api/HowToDocument.dox39
-rw-r--r--doc/api/LangSupportStatus.dox330
-rw-r--r--doc/api/Mainpage.dox91
-rw-r--r--doc/api/PropEditor.dox108
-rw-r--r--doc/api/propeditor1.pngbin0 -> 3937 bytes
-rw-r--r--doc/api/propeditor2.pngbin0 -> 3697 bytes
-rw-r--r--doc/extras/Makefile.am8
-rw-r--r--doc/extras/opengl.toc267
-rw-r--r--doc/extras/sdl.toc219
-rw-r--r--doc/extras/w3c/Makefile.am3
-rw-r--r--doc/extras/w3c/w3c-dom-level2-html.toc70
-rw-r--r--doc/extras/w3c/w3c-svg.toc1446
-rw-r--r--doc/extras/w3c/w3c-uaag10.toc69
-rw-r--r--doc/kde_app_devel/Makefile.am3
-rw-r--r--doc/kde_app_devel/appwizard.pngbin0 -> 46091 bytes
-rw-r--r--doc/kde_app_devel/index.docbook1549
-rw-r--r--doc/kde_app_devel/kscribblefiles.pngbin0 -> 16708 bytes
-rw-r--r--doc/kdearch/Makefile.am2
-rw-r--r--doc/kdearch/affine-general.pngbin0 -> 3182 bytes
-rw-r--r--doc/kdearch/affine-rotate.pngbin0 -> 1941 bytes
-rw-r--r--doc/kdearch/affine-scale.pngbin0 -> 1419 bytes
-rw-r--r--doc/kdearch/affine-shear.pngbin0 -> 1422 bytes
-rw-r--r--doc/kdearch/affine-translate.pngbin0 -> 1444 bytes
-rw-r--r--doc/kdearch/brushstyles.pngbin0 -> 9874 bytes
-rw-r--r--doc/kdearch/canvas.pngbin0 -> 24979 bytes
-rw-r--r--doc/kdearch/capflat.pngbin0 -> 267 bytes
-rw-r--r--doc/kdearch/capround.pngbin0 -> 441 bytes
-rw-r--r--doc/kdearch/capsquare.pngbin0 -> 185 bytes
-rw-r--r--doc/kdearch/index.docbook3337
-rw-r--r--doc/kdearch/joinbevel.pngbin0 -> 529 bytes
-rw-r--r--doc/kdearch/joinmiter.pngbin0 -> 569 bytes
-rw-r--r--doc/kdearch/joinround.pngbin0 -> 597 bytes
-rw-r--r--doc/kdearch/konqi-mirrored.pngbin0 -> 27633 bytes
-rw-r--r--doc/kdearch/konqi-normal.pngbin0 -> 27757 bytes
-rw-r--r--doc/kdearch/konqi-rotated.pngbin0 -> 28953 bytes
-rw-r--r--doc/kdearch/konqi-sheared.pngbin0 -> 25644 bytes
-rw-r--r--doc/kdearch/kview-menu.pngbin0 -> 4204 bytes
-rw-r--r--doc/kdearch/opengl.pngbin0 -> 4818 bytes
-rw-r--r--doc/kdearch/penstyles.pngbin0 -> 2854 bytes
-rw-r--r--doc/kdearch/whatsthis.pngbin0 -> 3509 bytes
-rw-r--r--doc/kdevelop/Makefile.am3
-rw-r--r--doc/kdevelop/SF-general.pngbin0 -> 13488 bytes
-rw-r--r--doc/kdevelop/SF-indent.pngbin0 -> 19392 bytes
-rw-r--r--doc/kdevelop/SF-other.pngbin0 -> 15840 bytes
-rw-r--r--doc/kdevelop/adv-build-management.docbook128
-rw-r--r--doc/kdevelop/app-changelog.docbook69
-rw-r--r--doc/kdevelop/app-files.docbook425
-rw-r--r--doc/kdevelop/app-menu.docbook61
-rw-r--r--doc/kdevelop/app-misc-info.docbook24
-rw-r--r--doc/kdevelop/app-uimodes-examples.docbook125
-rw-r--r--doc/kdevelop/applicationwizard.docbook820
-rw-r--r--doc/kdevelop/automake-file-popup.pngbin0 -> 24236 bytes
-rw-r--r--doc/kdevelop/automake-manager.pngbin0 -> 18841 bytes
-rw-r--r--doc/kdevelop/automake-subproject-popup.pngbin0 -> 13626 bytes
-rw-r--r--doc/kdevelop/automake-target-popup.pngbin0 -> 21258 bytes
-rw-r--r--doc/kdevelop/automakemanager.pngbin0 -> 38739 bytes
-rw-r--r--doc/kdevelop/build-commands.pngbin0 -> 5263 bytes
-rw-r--r--doc/kdevelop/build-configurations.pngbin0 -> 28299 bytes
-rw-r--r--doc/kdevelop/build-menu-automake.pngbin0 -> 7307 bytes
-rw-r--r--doc/kdevelop/build-menu.pngbin0 -> 18774 bytes
-rw-r--r--doc/kdevelop/class-browsers.docbook90
-rw-r--r--doc/kdevelop/classview.pngbin0 -> 17523 bytes
-rw-r--r--doc/kdevelop/commands.docbook1989
-rw-r--r--doc/kdevelop/configure-adddialog-baselibs.pngbin0 -> 13434 bytes
-rw-r--r--doc/kdevelop/configure-adddialog-qt.pngbin0 -> 19096 bytes
-rw-r--r--doc/kdevelop/configure-adddialog.pngbin0 -> 19578 bytes
-rw-r--r--doc/kdevelop/configure-doctree-DevHelp.pngbin0 -> 58057 bytes
-rw-r--r--doc/kdevelop/configure-doctree-TOC.pngbin0 -> 76680 bytes
-rw-r--r--doc/kdevelop/configure-doctree-bookmark.pngbin0 -> 34257 bytes
-rw-r--r--doc/kdevelop/configure-doctree-general.pngbin0 -> 56208 bytes
-rw-r--r--doc/kdevelop/configure-doctree-textsearch.pngbin0 -> 42655 bytes
-rw-r--r--doc/kdevelop/configure-docu-chm.pngbin0 -> 26368 bytes
-rw-r--r--doc/kdevelop/configure-docu-custom.pngbin0 -> 28116 bytes
-rw-r--r--doc/kdevelop/configure-docu-devhelp.pngbin0 -> 41947 bytes
-rw-r--r--doc/kdevelop/configure-docu-dox.pngbin0 -> 31091 bytes
-rw-r--r--doc/kdevelop/configure-docu-edit.pngbin0 -> 12783 bytes
-rw-r--r--doc/kdevelop/configure-docu-general.pngbin0 -> 31183 bytes
-rw-r--r--doc/kdevelop/configure-docu-indexgen.pngbin0 -> 14162 bytes
-rw-r--r--doc/kdevelop/configure-docu-toc.pngbin0 -> 40144 bytes
-rw-r--r--doc/kdevelop/configure-editor.pngbin0 -> 8479 bytes
-rw-r--r--doc/kdevelop/configure-file-selector.pngbin0 -> 27872 bytes
-rw-r--r--doc/kdevelop/configure-file-templates.pngbin0 -> 43131 bytes
-rw-r--r--doc/kdevelop/configure-general.pngbin0 -> 36474 bytes
-rw-r--r--doc/kdevelop/configure-project-buildconfig.pngbin0 -> 4785 bytes
-rw-r--r--doc/kdevelop/configure-project-configure.pngbin0 -> 33246 bytes
-rw-r--r--doc/kdevelop/configure-project-cpp.pngbin0 -> 17444 bytes
-rw-r--r--doc/kdevelop/configure-project-cppoptions.pngbin0 -> 30254 bytes
-rw-r--r--doc/kdevelop/configure-project-doc.pngbin0 -> 69953 bytes
-rw-r--r--doc/kdevelop/configure-project-make.pngbin0 -> 24739 bytes
-rw-r--r--doc/kdevelop/configure-project-run.pngbin0 -> 33653 bytes
-rw-r--r--doc/kdevelop/configure-select.pngbin0 -> 34978 bytes
-rw-r--r--doc/kdevelop/configure-snippets.pngbin0 -> 19436 bytes
-rw-r--r--doc/kdevelop/create-new-project-cvs.pngbin0 -> 29197 bytes
-rw-r--r--doc/kdevelop/create-new-project.pngbin0 -> 44427 bytes
-rw-r--r--doc/kdevelop/createnewproject.pngbin0 -> 82772 bytes
-rw-r--r--doc/kdevelop/createnewprojectoptions.pngbin0 -> 20860 bytes
-rw-r--r--doc/kdevelop/credits.docbook24
-rw-r--r--doc/kdevelop/cvs.docbook139
-rw-r--r--doc/kdevelop/debugger.docbook242
-rw-r--r--doc/kdevelop/doctree-add-bookmark.pngbin0 -> 34194 bytes
-rw-r--r--doc/kdevelop/doctree-reduced.pngbin0 -> 24702 bytes
-rw-r--r--doc/kdevelop/doctree.pngbin0 -> 20086 bytes
-rw-r--r--doc/kdevelop/doctreeview.pngbin0 -> 10196 bytes
-rw-r--r--doc/kdevelop/documentation.docbook57
-rw-r--r--doc/kdevelop/documents-contents.pngbin0 -> 20872 bytes
-rw-r--r--doc/kdevelop/documents-search.pngbin0 -> 12259 bytes
-rw-r--r--doc/kdevelop/edit-doctree-TOC-entry.pngbin0 -> 23762 bytes
-rw-r--r--doc/kdevelop/editing.docbook401
-rw-r--r--doc/kdevelop/editor-ctags-lookup.pngbin0 -> 8557 bytes
-rw-r--r--doc/kdevelop/editor-ctags-menu.pngbin0 -> 10880 bytes
-rw-r--r--doc/kdevelop/editor-ctags-regenerate.pngbin0 -> 7758 bytes
-rw-r--r--doc/kdevelop/editor-find-menu.pngbin0 -> 5588 bytes
-rw-r--r--doc/kdevelop/editor-search-doc.pngbin0 -> 114190 bytes
-rw-r--r--doc/kdevelop/editor-switch-header.pngbin0 -> 22431 bytes
-rw-r--r--doc/kdevelop/empty-ide.pngbin0 -> 36414 bytes
-rw-r--r--doc/kdevelop/file-browsers.docbook79
-rw-r--r--doc/kdevelop/file-list-close-selected.pngbin0 -> 36603 bytes
-rw-r--r--doc/kdevelop/file-list-session-create.pngbin0 -> 35031 bytes
-rw-r--r--doc/kdevelop/file-list-session-default.pngbin0 -> 3879 bytes
-rw-r--r--doc/kdevelop/file-selector.pngbin0 -> 44050 bytes
-rw-r--r--doc/kdevelop/filetree.pngbin0 -> 10689 bytes
-rw-r--r--doc/kdevelop/find-in-files.pngbin0 -> 24609 bytes
-rw-r--r--doc/kdevelop/folded-tabs.pngbin0 -> 8287 bytes
-rw-r--r--doc/kdevelop/getting-started.docbook3221
-rw-r--r--doc/kdevelop/hello-world-app.pngbin0 -> 3548 bytes
-rw-r--r--doc/kdevelop/importdirectory.pngbin0 -> 12452 bytes
-rw-r--r--doc/kdevelop/index.docbook372
-rw-r--r--doc/kdevelop/kdcop_browsing.pngbin0 -> 37258 bytes
-rw-r--r--doc/kdevelop/kdevdesigner.pngbin0 -> 69839 bytes
-rw-r--r--doc/kdevelop/kdevelop-ideal-mode-0.pngbin0 -> 107904 bytes
-rw-r--r--doc/kdevelop/kdevelop-ideal-mode.pngbin0 -> 163776 bytes
-rw-r--r--doc/kdevelop/kdevelop-install.docbook754
-rw-r--r--doc/kdevelop/kdevelop-mdi-mode.pngbin0 -> 163219 bytes
-rw-r--r--doc/kdevelop/kdevelop-scripting.docbook56
-rw-r--r--doc/kdevelop/kdevelop-survey.docbook489
-rw-r--r--doc/kdevelop/kdevelop-tabbed-mode.pngbin0 -> 160823 bytes
-rw-r--r--doc/kdevelop/kdevelop-toplevel-mode.pngbin0 -> 173323 bytes
-rwxr-xr-xdoc/kdevelop/listplugins.sh43
-rw-r--r--doc/kdevelop/loading-progress-bar.pngbin0 -> 7813 bytes
-rw-r--r--doc/kdevelop/nutshell.docbook242
-rw-r--r--doc/kdevelop/open-project.pngbin0 -> 55212 bytes
-rw-r--r--doc/kdevelop/open-recent-project.pngbin0 -> 24043 bytes
-rw-r--r--doc/kdevelop/plugin-tools.docbook433
-rw-r--r--doc/kdevelop/problem-report-all-todos.pngbin0 -> 11407 bytes
-rw-r--r--doc/kdevelop/problem-report-marks.pngbin0 -> 9438 bytes
-rw-r--r--doc/kdevelop/problem-report-todo.pngbin0 -> 28006 bytes
-rw-r--r--doc/kdevelop/project-advanced.docbook83
-rw-r--r--doc/kdevelop/project-management.docbook751
-rw-r--r--doc/kdevelop/raw-project-warning.pngbin0 -> 17848 bytes
-rw-r--r--doc/kdevelop/run-button.pngbin0 -> 4867 bytes
-rw-r--r--doc/kdevelop/script_location.pngbin0 -> 33687 bytes
-rw-r--r--doc/kdevelop/select-user-interface-0.pngbin0 -> 40919 bytes
-rw-r--r--doc/kdevelop/select-user-interface.pngbin0 -> 64121 bytes
-rw-r--r--doc/kdevelop/setup.docbook1990
-rw-r--r--doc/kdevelop/split-source-header-navigate.pngbin0 -> 8696 bytes
-rw-r--r--doc/kdevelop/split-source-header.pngbin0 -> 11044 bytes
-rw-r--r--doc/kdevelop/split-windows.pngbin0 -> 15424 bytes
-rw-r--r--doc/kdevelop/split-workspace.pngbin0 -> 7382 bytes
-rw-r--r--doc/kdevelop/survey-manual.docbook228
-rw-r--r--doc/kdevelop/tutorial-debug-tree.pngbin0 -> 15622 bytes
-rw-r--r--doc/kdevelop/tutorial-hello-new.pngbin0 -> 221583 bytes
-rw-r--r--doc/kdevelop/tutorial-hello-options.pngbin0 -> 6818 bytes
-rw-r--r--doc/kdevelop/tutorial-new-project.pngbin0 -> 61543 bytes
-rw-r--r--doc/kdevelop/unixdev.docbook386
-rw-r--r--doc/kdevelop/wrong-project-location.pngbin0 -> 11847 bytes
-rw-r--r--doc/platform/Mainpage.dox148
-rw-r--r--doc/std/Makefile.am7
-rw-r--r--doc/std/kdev3api.toc45
-rw-r--r--doc/tools/Makefile.am4
-rw-r--r--doc/tools/index-python52
-rwxr-xr-xdoc/tools/index-texi60
-rw-r--r--doc/tools/index.xsl34
-rw-r--r--doc/tools/toc-docbook71
-rw-r--r--doc/tools/toc-gsdoc24
-rw-r--r--doc/tools/toc-python57
-rwxr-xr-xdoc/tools/toc-texi47
-rw-r--r--editors/Makefile.am1
-rw-r--r--editors/editor-chooser/Makefile.am13
-rw-r--r--editors/editor-chooser/README.dox8
-rw-r--r--editors/editor-chooser/editchooser.ui130
-rw-r--r--editors/editor-chooser/editorchooser_part.cpp42
-rw-r--r--editors/editor-chooser/editorchooser_part.h33
-rw-r--r--editors/editor-chooser/editorchooser_widget.cpp132
-rw-r--r--editors/editor-chooser/editorchooser_widget.h39
-rw-r--r--editors/editor-chooser/kdeveditorchooser.desktop91
-rw-r--r--embedded/Makefile.am13
-rw-r--r--embedded/visualboyadvance/Makefile.am17
-rw-r--r--embedded/visualboyadvance/kdevpart_visualboyadvance.rc11
-rw-r--r--embedded/visualboyadvance/kdevvisualboyadvance.desktop86
-rw-r--r--embedded/visualboyadvance/vbaconfigwidget.cpp144
-rw-r--r--embedded/visualboyadvance/vbaconfigwidget.h42
-rw-r--r--embedded/visualboyadvance/vbaconfigwidgetbase.ui249
-rw-r--r--embedded/visualboyadvance/visualboyadvance_part.cpp77
-rw-r--r--embedded/visualboyadvance/visualboyadvance_part.h29
-rw-r--r--kde-development-kdevelop.directory5
-rw-r--r--kdevassistant.desktop74
-rw-r--r--kdevdesigner/AUTHORS4
-rw-r--r--kdevdesigner/LICENSE.GPL340
-rw-r--r--kdevdesigner/Makefile.am4
-rw-r--r--kdevdesigner/NEWS1
-rw-r--r--kdevdesigner/README25
-rw-r--r--kdevdesigner/TODO1
-rw-r--r--kdevdesigner/designer/Makefile.am21
-rw-r--r--kdevdesigner/designer/about.ui219
-rw-r--r--kdevdesigner/designer/actiondnd.cpp726
-rw-r--r--kdevdesigner/designer/actiondnd.h247
-rw-r--r--kdevdesigner/designer/actioneditor.ui227
-rw-r--r--kdevdesigner/designer/actioneditorimpl.cpp320
-rw-r--r--kdevdesigner/designer/actioneditorimpl.h79
-rw-r--r--kdevdesigner/designer/actionlistview.cpp110
-rw-r--r--kdevdesigner/designer/actionlistview.h81
-rw-r--r--kdevdesigner/designer/asciivalidator.cpp94
-rw-r--r--kdevdesigner/designer/asciivalidator.h52
-rw-r--r--kdevdesigner/designer/command.cpp2473
-rw-r--r--kdevdesigner/designer/command.h1259
-rw-r--r--kdevdesigner/designer/configtoolboxdialog.ui326
-rw-r--r--kdevdesigner/designer/configtoolboxdialog.ui.h215
-rw-r--r--kdevdesigner/designer/connectiondialog.ui219
-rw-r--r--kdevdesigner/designer/connectiondialog.ui.h318
-rw-r--r--kdevdesigner/designer/connectionitems.cpp517
-rw-r--r--kdevdesigner/designer/connectionitems.h220
-rw-r--r--kdevdesigner/designer/connectiontable.cpp56
-rw-r--r--kdevdesigner/designer/connectiontable.h46
-rw-r--r--kdevdesigner/designer/createtemplate.ui195
-rw-r--r--kdevdesigner/designer/customwidgeteditor.ui1378
-rw-r--r--kdevdesigner/designer/customwidgeteditorimpl.cpp842
-rw-r--r--kdevdesigner/designer/customwidgeteditorimpl.h98
-rw-r--r--kdevdesigner/designer/database.cpp122
-rw-r--r--kdevdesigner/designer/database.h83
-rw-r--r--kdevdesigner/designer/dbconnection.ui222
-rw-r--r--kdevdesigner/designer/dbconnectioneditor.ui147
-rw-r--r--kdevdesigner/designer/dbconnectionimpl.cpp80
-rw-r--r--kdevdesigner/designer/dbconnectionimpl.h57
-rw-r--r--kdevdesigner/designer/dbconnections.ui321
-rw-r--r--kdevdesigner/designer/dbconnectionsimpl.cpp196
-rw-r--r--kdevdesigner/designer/dbconnectionsimpl.h60
-rw-r--r--kdevdesigner/designer/defs.cpp84
-rw-r--r--kdevdesigner/designer/defs.h42
-rw-r--r--kdevdesigner/designer/designer_pch.h44
-rw-r--r--kdevdesigner/designer/designeraction.cpp48
-rw-r--r--kdevdesigner/designer/designeraction.h54
-rw-r--r--kdevdesigner/designer/designerapp.cpp176
-rw-r--r--kdevdesigner/designer/designerapp.h58
-rw-r--r--kdevdesigner/designer/designerappiface.cpp1093
-rw-r--r--kdevdesigner/designer/designerappiface.h277
-rw-r--r--kdevdesigner/designer/editfunctions.ui714
-rw-r--r--kdevdesigner/designer/editfunctionsimpl.cpp534
-rw-r--r--kdevdesigner/designer/editfunctionsimpl.h94
-rw-r--r--kdevdesigner/designer/filechooser.cpp90
-rw-r--r--kdevdesigner/designer/filechooser.h68
-rw-r--r--kdevdesigner/designer/finddialog.ui274
-rw-r--r--kdevdesigner/designer/finddialog.ui.h61
-rw-r--r--kdevdesigner/designer/formfile.cpp905
-rw-r--r--kdevdesigner/designer/formfile.h145
-rw-r--r--kdevdesigner/designer/formsettings.ui549
-rw-r--r--kdevdesigner/designer/formsettingsimpl.cpp118
-rw-r--r--kdevdesigner/designer/formsettingsimpl.h49
-rw-r--r--kdevdesigner/designer/formwindow.cpp2775
-rw-r--r--kdevdesigner/designer/formwindow.h322
-rw-r--r--kdevdesigner/designer/gotolinedialog.ui169
-rw-r--r--kdevdesigner/designer/gotolinedialog.ui.h50
-rw-r--r--kdevdesigner/designer/hierarchyview.cpp1508
-rw-r--r--kdevdesigner/designer/hierarchyview.h249
-rw-r--r--kdevdesigner/designer/iconvieweditor.ui461
-rw-r--r--kdevdesigner/designer/iconvieweditorimpl.cpp165
-rw-r--r--kdevdesigner/designer/iconvieweditorimpl.h58
-rw-r--r--kdevdesigner/designer/kdevdesigner_part.cpp565
-rw-r--r--kdevdesigner/designer/kdevdesigner_part.desktop16
-rw-r--r--kdevdesigner/designer/kdevdesigner_part.h146
-rw-r--r--kdevdesigner/designer/kdevdesigner_part.rc121
-rw-r--r--kdevdesigner/designer/kdevdesigner_part_sh.rc116
-rw-r--r--kdevdesigner/designer/layout.cpp1017
-rw-r--r--kdevdesigner/designer/layout.h188
-rw-r--r--kdevdesigner/designer/listboxdnd.cpp305
-rw-r--r--kdevdesigner/designer/listboxdnd.h63
-rw-r--r--kdevdesigner/designer/listboxeditor.ui457
-rw-r--r--kdevdesigner/designer/listboxeditorimpl.cpp245
-rw-r--r--kdevdesigner/designer/listboxeditorimpl.h61
-rw-r--r--kdevdesigner/designer/listboxrename.cpp157
-rw-r--r--kdevdesigner/designer/listboxrename.h57
-rw-r--r--kdevdesigner/designer/listdnd.cpp142
-rw-r--r--kdevdesigner/designer/listdnd.h63
-rw-r--r--kdevdesigner/designer/listeditor.ui179
-rw-r--r--kdevdesigner/designer/listeditor.ui.h72
-rw-r--r--kdevdesigner/designer/listviewdnd.cpp432
-rw-r--r--kdevdesigner/designer/listviewdnd.h66
-rw-r--r--kdevdesigner/designer/listvieweditor.ui935
-rw-r--r--kdevdesigner/designer/listvieweditorimpl.cpp650
-rw-r--r--kdevdesigner/designer/listvieweditorimpl.h102
-rw-r--r--kdevdesigner/designer/mainwindow.cpp3784
-rw-r--r--kdevdesigner/designer/mainwindow.h511
-rw-r--r--kdevdesigner/designer/mainwindowactions.cpp2067
-rw-r--r--kdevdesigner/designer/menubareditor.cpp1129
-rw-r--r--kdevdesigner/designer/menubareditor.h198
-rw-r--r--kdevdesigner/designer/metadatabase.cpp1692
-rw-r--r--kdevdesigner/designer/metadatabase.h269
-rw-r--r--kdevdesigner/designer/multilineeditor.ui181
-rw-r--r--kdevdesigner/designer/multilineeditorimpl.cpp415
-rw-r--r--kdevdesigner/designer/multilineeditorimpl.h109
-rw-r--r--kdevdesigner/designer/myiconloader.cpp32
-rw-r--r--kdevdesigner/designer/myiconloader.h32
-rw-r--r--kdevdesigner/designer/newform.ui238
-rw-r--r--kdevdesigner/designer/newformimpl.cpp414
-rw-r--r--kdevdesigner/designer/newformimpl.h164
-rw-r--r--kdevdesigner/designer/orderindicator.cpp112
-rw-r--r--kdevdesigner/designer/orderindicator.h57
-rw-r--r--kdevdesigner/designer/outputwindow.cpp209
-rw-r--r--kdevdesigner/designer/outputwindow.h98
-rw-r--r--kdevdesigner/designer/paletteeditor.ui496
-rw-r--r--kdevdesigner/designer/paletteeditoradvanced.ui748
-rw-r--r--kdevdesigner/designer/paletteeditoradvancedimpl.cpp643
-rw-r--r--kdevdesigner/designer/paletteeditoradvancedimpl.h96
-rw-r--r--kdevdesigner/designer/paletteeditorimpl.cpp304
-rw-r--r--kdevdesigner/designer/paletteeditorimpl.h76
-rw-r--r--kdevdesigner/designer/pics/Makefile.am2
-rw-r--r--kdevdesigner/designer/pics/designer_adjustsize.pngbin0 -> 495 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_appicon.pngbin0 -> 2341 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_arrow.pngbin0 -> 217 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_background.pngbin0 -> 6724 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_book.pngbin0 -> 825 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_buttongroup.pngbin0 -> 648 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_checkbox.pngbin0 -> 817 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_combobox.pngbin0 -> 549 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_connecttool.pngbin0 -> 553 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_cross.pngbin0 -> 164 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_customwidget.pngbin0 -> 1133 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_adjustsize.pngbin0 -> 529 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_book.pngbin0 -> 561 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_buttongroup.pngbin0 -> 482 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_checkbox.pngbin0 -> 547 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_combobox.pngbin0 -> 420 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_connecttool.pngbin0 -> 450 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_customwidget.pngbin0 -> 629 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_databrowser.pngbin0 -> 603 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_datatable.pngbin0 -> 592 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_dataview.pngbin0 -> 663 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_dateedit.pngbin0 -> 452 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_datetimeedit.pngbin0 -> 669 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_dial.pngbin0 -> 706 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_down.pngbin0 -> 441 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editbreaklayout.pngbin0 -> 635 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editcopy.pngbin0 -> 517 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editcut.pngbin0 -> 800 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editdelete.pngbin0 -> 684 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editgrid.pngbin0 -> 425 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_edithlayout.pngbin0 -> 272 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_edithlayoutsplit.pngbin0 -> 328 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editlower.pngbin0 -> 453 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editpaste.pngbin0 -> 599 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editraise.pngbin0 -> 454 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editslots.pngbin0 -> 535 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editvlayout.pngbin0 -> 272 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_editvlayoutsplit.pngbin0 -> 333 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_filenew.pngbin0 -> 298 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_fileopen.pngbin0 -> 407 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_filesave.pngbin0 -> 267 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_folder.pngbin0 -> 841 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_form.pngbin0 -> 274 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_frame.pngbin0 -> 427 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_groupbox.pngbin0 -> 465 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_help.pngbin0 -> 786 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_home.pngbin0 -> 743 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_iconview.pngbin0 -> 548 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_image.pngbin0 -> 482 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_label.pngbin0 -> 670 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_layout.pngbin0 -> 497 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_lcdnumber.pngbin0 -> 452 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_left.pngbin0 -> 422 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_line.pngbin0 -> 327 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_lineedit.pngbin0 -> 445 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_listbox.pngbin0 -> 410 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_listview.pngbin0 -> 640 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_multilineedit.pngbin0 -> 482 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_newform.pngbin0 -> 443 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_ordertool.pngbin0 -> 533 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_pixlabel.pngbin0 -> 619 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_pointer.pngbin0 -> 476 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_print.pngbin0 -> 593 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_progress.pngbin0 -> 375 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_project.pngbin0 -> 915 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_pushbutton.pngbin0 -> 445 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_radiobutton.pngbin0 -> 605 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_redo.pngbin0 -> 465 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_richtextedit.pngbin0 -> 562 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_right.pngbin0 -> 425 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_scrollbar.pngbin0 -> 364 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_searchfind.pngbin0 -> 501 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_setbuddy.pngbin0 -> 427 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_slider.pngbin0 -> 548 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_spacer.pngbin0 -> 519 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_spinbox.pngbin0 -> 477 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_table.pngbin0 -> 512 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_tabwidget.pngbin0 -> 404 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textbold.pngbin0 -> 519 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textbrowser.pngbin0 -> 534 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textcenter.pngbin0 -> 453 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textedit.pngbin0 -> 526 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textfont.pngbin0 -> 412 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_texth1.pngbin0 -> 476 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_texth2.pngbin0 -> 537 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_texth3.pngbin0 -> 509 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textitalic.pngbin0 -> 454 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textjustify.pngbin0 -> 442 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textlarger.pngbin0 -> 537 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textleft.pngbin0 -> 443 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textlinebreak.pngbin0 -> 528 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textparagraph.pngbin0 -> 543 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textright.pngbin0 -> 445 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textsmaller.pngbin0 -> 513 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textteletext.pngbin0 -> 463 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textunderline.pngbin0 -> 498 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_textview.pngbin0 -> 529 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_timeedit.pngbin0 -> 827 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_toolbox.pngbin0 -> 465 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_toolbutton.pngbin0 -> 670 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_undo.pngbin0 -> 471 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_up.pngbin0 -> 444 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_widgetstack.pngbin0 -> 558 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_wizarddata.pngbin0 -> 294 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_wizarddialog.pngbin0 -> 421 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_d_wordwrap.pngbin0 -> 507 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_databrowser.pngbin0 -> 907 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_datatable.pngbin0 -> 923 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_dataview.pngbin0 -> 1039 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_dateedit.pngbin0 -> 505 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_datetimeedit.pngbin0 -> 1074 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_dial.pngbin0 -> 1024 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_down.pngbin0 -> 595 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editbreaklayout.pngbin0 -> 744 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editcopy.pngbin0 -> 485 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editcut.pngbin0 -> 649 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editdelete.pngbin0 -> 833 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editgrid.pngbin0 -> 520 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_edithlayout.pngbin0 -> 295 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_edithlayoutsplit.pngbin0 -> 344 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editlower.pngbin0 -> 609 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editpaste.pngbin0 -> 907 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editraise.pngbin0 -> 614 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editslots.pngbin0 -> 690 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editvlayout.pngbin0 -> 289 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_editvlayoutsplit.pngbin0 -> 355 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_filenew.pngbin0 -> 313 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_fileopen.pngbin0 -> 681 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_filesave.pngbin0 -> 328 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_folder.pngbin0 -> 1368 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_form.pngbin0 -> 301 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_frame.pngbin0 -> 400 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_groupbox.pngbin0 -> 439 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_hand.pngbin0 -> 198 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_help.pngbin0 -> 1561 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_home.pngbin0 -> 1083 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_hsplit.pngbin0 -> 203 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_ibeam.pngbin0 -> 162 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_iconview.pngbin0 -> 613 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_image.pngbin0 -> 769 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_label.pngbin0 -> 953 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_layout.pngbin0 -> 706 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_lcdnumber.pngbin0 -> 558 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_left.pngbin0 -> 678 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_line.pngbin0 -> 287 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_lineedit.pngbin0 -> 405 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_listbox.pngbin0 -> 386 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_listview.pngbin0 -> 759 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_multilineedit.pngbin0 -> 454 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_newform.pngbin0 -> 531 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_no.pngbin0 -> 230 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_object.pngbin0 -> 1065 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_ordertool.pngbin0 -> 587 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_pixlabel.pngbin0 -> 1229 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_pointer.pngbin0 -> 586 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_print.pngbin0 -> 742 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_progress.pngbin0 -> 559 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_project.pngbin0 -> 1275 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_pushbutton.pngbin0 -> 408 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_qtlogo.pngbin0 -> 12615 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_radiobutton.pngbin0 -> 586 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_redo.pngbin0 -> 592 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_resetproperty.pngbin0 -> 184 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_richtextedit.pngbin0 -> 834 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_right.pngbin0 -> 656 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_s_down.pngbin0 -> 574 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_s_editcut.pngbin0 -> 444 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_s_left.pngbin0 -> 564 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_s_right.pngbin0 -> 557 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_s_up.pngbin0 -> 586 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_scrollbar.pngbin0 -> 408 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_searchfind.pngbin0 -> 843 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_setbuddy.pngbin0 -> 428 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_sizeall.pngbin0 -> 208 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_sizeb.pngbin0 -> 203 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_sizef.pngbin0 -> 203 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_sizeh.pngbin0 -> 179 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_sizev.pngbin0 -> 177 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_slider.pngbin0 -> 729 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_spacer.pngbin0 -> 715 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_spinbox.pngbin0 -> 455 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_splash.pngbin0 -> 123917 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_table.pngbin0 -> 483 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_tabwidget.pngbin0 -> 572 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textbold.pngbin0 -> 498 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textbrowser.pngbin0 -> 514 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textcenter.pngbin0 -> 429 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textedit.pngbin0 -> 497 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textfont.pngbin0 -> 494 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_texth1.pngbin0 -> 462 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_texth2.pngbin0 -> 512 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_texth3.pngbin0 -> 486 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textitalic.pngbin0 -> 442 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textjustify.pngbin0 -> 409 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textlarger.pngbin0 -> 733 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textleft.pngbin0 -> 411 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textlinebreak.pngbin0 -> 509 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textparagraph.pngbin0 -> 527 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textright.pngbin0 -> 410 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textsmaller.pngbin0 -> 677 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textteletext.pngbin0 -> 445 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textunderline.pngbin0 -> 471 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_textview.pngbin0 -> 498 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_timeedit.pngbin0 -> 1520 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_toolbox.pngbin0 -> 783 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_toolbutton.pngbin0 -> 1262 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_undo.pngbin0 -> 572 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_up.pngbin0 -> 692 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_uparrow.pngbin0 -> 169 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_vsplit.pngbin0 -> 192 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_wait.pngbin0 -> 216 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_widgetstack.pngbin0 -> 831 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_wizarddata.pngbin0 -> 323 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_wizarddialog.pngbin0 -> 632 bytes
-rw-r--r--kdevdesigner/designer/pics/designer_wordwrap.pngbin0 -> 643 bytes
-rw-r--r--kdevdesigner/designer/pixmapchooser.cpp231
-rw-r--r--kdevdesigner/designer/pixmapchooser.h72
-rw-r--r--kdevdesigner/designer/pixmapcollection.cpp180
-rw-r--r--kdevdesigner/designer/pixmapcollection.h80
-rw-r--r--kdevdesigner/designer/pixmapcollectioneditor.ui218
-rw-r--r--kdevdesigner/designer/pixmapcollectioneditor.ui.h150
-rw-r--r--kdevdesigner/designer/pixmapfunction.ui976
-rw-r--r--kdevdesigner/designer/popupmenueditor.cpp1469
-rw-r--r--kdevdesigner/designer/popupmenueditor.h235
-rw-r--r--kdevdesigner/designer/preferences.ui648
-rw-r--r--kdevdesigner/designer/previewframe.cpp57
-rw-r--r--kdevdesigner/designer/previewframe.h59
-rw-r--r--kdevdesigner/designer/previewwidget.ui304
-rw-r--r--kdevdesigner/designer/previewwidgetimpl.cpp65
-rw-r--r--kdevdesigner/designer/previewwidgetimpl.h43
-rw-r--r--kdevdesigner/designer/project.cpp1558
-rw-r--r--kdevdesigner/designer/project.h273
-rw-r--r--kdevdesigner/designer/projectsettings.ui301
-rw-r--r--kdevdesigner/designer/projectsettingsimpl.cpp126
-rw-r--r--kdevdesigner/designer/projectsettingsimpl.h56
-rw-r--r--kdevdesigner/designer/propertyeditor.cpp4332
-rw-r--r--kdevdesigner/designer/propertyeditor.h867
-rw-r--r--kdevdesigner/designer/propertyobject.cpp158
-rw-r--r--kdevdesigner/designer/propertyobject.h43
-rw-r--r--kdevdesigner/designer/qcompletionedit.cpp210
-rw-r--r--kdevdesigner/designer/qcompletionedit.h79
-rw-r--r--kdevdesigner/designer/replacedialog.ui318
-rw-r--r--kdevdesigner/designer/replacedialog.ui.h75
-rw-r--r--kdevdesigner/designer/resource.cpp3327
-rw-r--r--kdevdesigner/designer/resource.h165
-rw-r--r--kdevdesigner/designer/richtextfontdialog.ui347
-rw-r--r--kdevdesigner/designer/richtextfontdialog.ui.h49
-rw-r--r--kdevdesigner/designer/sizehandle.cpp388
-rw-r--r--kdevdesigner/designer/sizehandle.h97
-rw-r--r--kdevdesigner/designer/sourceeditor.cpp320
-rw-r--r--kdevdesigner/designer/sourceeditor.h106
-rw-r--r--kdevdesigner/designer/sourcefile.cpp298
-rw-r--r--kdevdesigner/designer/sourcefile.h86
-rw-r--r--kdevdesigner/designer/startdialog.ui324
-rw-r--r--kdevdesigner/designer/startdialogimpl.cpp182
-rw-r--r--kdevdesigner/designer/startdialogimpl.h80
-rw-r--r--kdevdesigner/designer/styledbutton.cpp295
-rw-r--r--kdevdesigner/designer/styledbutton.h103
-rw-r--r--kdevdesigner/designer/syntaxhighlighter_html.cpp160
-rw-r--r--kdevdesigner/designer/syntaxhighlighter_html.h57
-rw-r--r--kdevdesigner/designer/tableeditor.ui828
-rw-r--r--kdevdesigner/designer/tableeditorimpl.cpp494
-rw-r--r--kdevdesigner/designer/tableeditorimpl.h82
-rw-r--r--kdevdesigner/designer/timestamp.cpp86
-rw-r--r--kdevdesigner/designer/timestamp.h63
-rw-r--r--kdevdesigner/designer/variabledialog.ui294
-rw-r--r--kdevdesigner/designer/variabledialogimpl.cpp180
-rw-r--r--kdevdesigner/designer/variabledialogimpl.h56
-rw-r--r--kdevdesigner/designer/widgetaction.cpp58
-rw-r--r--kdevdesigner/designer/widgetaction.h65
-rw-r--r--kdevdesigner/designer/widgetfactory.cpp1797
-rw-r--r--kdevdesigner/designer/widgetfactory.h501
-rw-r--r--kdevdesigner/designer/wizardeditor.ui342
-rw-r--r--kdevdesigner/designer/wizardeditorimpl.cpp253
-rw-r--r--kdevdesigner/designer/wizardeditorimpl.h74
-rw-r--r--kdevdesigner/designer/workspace.cpp711
-rw-r--r--kdevdesigner/designer/workspace.h151
-rw-r--r--kdevdesigner/interfaces/actioninterface.h78
-rw-r--r--kdevdesigner/interfaces/classbrowserinterface.h63
-rw-r--r--kdevdesigner/interfaces/designerinterface.h261
-rw-r--r--kdevdesigner/interfaces/editorinterface.h102
-rw-r--r--kdevdesigner/interfaces/filterinterface.h68
-rw-r--r--kdevdesigner/interfaces/interpreterinterface.h59
-rw-r--r--kdevdesigner/interfaces/languageinterface.h131
-rw-r--r--kdevdesigner/interfaces/preferenceinterface.h68
-rw-r--r--kdevdesigner/interfaces/projectsettingsiface.h69
-rw-r--r--kdevdesigner/interfaces/sourcetemplateiface.h65
-rw-r--r--kdevdesigner/interfaces/templatewizardiface.h60
-rw-r--r--kdevdesigner/interfaces/widgetinterface.h35
-rw-r--r--kdevdesigner/plugins/Makefile.am8
-rw-r--r--kdevdesigner/plugins/languageinterfaceimpl.cpp237
-rw-r--r--kdevdesigner/plugins/languageinterfaceimpl.h83
-rw-r--r--kdevdesigner/shared/Makefile.am6
-rw-r--r--kdevdesigner/shared/domtool.cpp453
-rw-r--r--kdevdesigner/shared/domtool.h53
-rw-r--r--kdevdesigner/shared/globaldefs.h62
-rw-r--r--kdevdesigner/shared/parser.cpp72
-rw-r--r--kdevdesigner/shared/parser.h39
-rw-r--r--kdevdesigner/shared/ui2uib.cpp893
-rw-r--r--kdevdesigner/shared/ui2uib.h35
-rw-r--r--kdevdesigner/shared/uib.cpp42
-rw-r--r--kdevdesigner/shared/uib.h152
-rw-r--r--kdevdesigner/shared/widgetdatabase.cpp960
-rw-r--r--kdevdesigner/shared/widgetdatabase.h96
-rw-r--r--kdevdesigner/src/Makefile.am47
-rw-r--r--kdevdesigner/src/kdevdesigner.cpp216
-rw-r--r--kdevdesigner/src/kdevdesigner.desktop96
-rw-r--r--kdevdesigner/src/kdevdesigner.h96
-rw-r--r--kdevdesigner/src/kdevdesigner_shell.rc37
-rw-r--r--kdevdesigner/src/main.cpp94
-rw-r--r--kdevdesigner/uilib/Makefile.am9
-rw-r--r--kdevdesigner/uilib/database.cpp122
-rw-r--r--kdevdesigner/uilib/database2.h88
-rw-r--r--kdevdesigner/uilib/qwidgetfactory.cpp2606
-rw-r--r--kdevdesigner/uilib/qwidgetfactory.h180
-rw-r--r--kdevelop.desktop52
-rw-r--r--kdevelop.lsm11
-rw-r--r--kdevelop.m4.in501
-rw-r--r--kdevelop_c_cpp.desktop49
-rw-r--r--kdevelop_kde_cpp.desktop48
-rw-r--r--kdevelop_ruby.desktop51
-rw-r--r--kdevelop_scripting.desktop69
-rwxr-xr-xkdevprj2kdevelop299
-rw-r--r--languages/Makefile.am74
-rw-r--r--languages/ada/AdaAST.hpp77
-rw-r--r--languages/ada/AdaLexer.cpp1507
-rw-r--r--languages/ada/AdaLexer.hpp86
-rw-r--r--languages/ada/AdaParser.cpp12283
-rw-r--r--languages/ada/AdaParser.hpp389
-rw-r--r--languages/ada/AdaStoreWalker.cpp9439
-rw-r--r--languages/ada/AdaStoreWalker.hpp350
-rw-r--r--languages/ada/AdaStoreWalkerTokenTypes.hpp307
-rw-r--r--languages/ada/AdaStoreWalkerTokenTypes.txt289
-rw-r--r--languages/ada/AdaTokenTypes.hpp306
-rw-r--r--languages/ada/AdaTokenTypes.txt288
-rw-r--r--languages/ada/AdaTreeParserSuper.cpp9050
-rw-r--r--languages/ada/AdaTreeParserSuper.hpp241
-rw-r--r--languages/ada/AdaTreeParserSuperTokenTypes.hpp307
-rw-r--r--languages/ada/AdaTreeParserSuperTokenTypes.txt289
-rw-r--r--languages/ada/Makefile.am41
-rw-r--r--languages/ada/README1
-rw-r--r--languages/ada/README.dox31
-rw-r--r--languages/ada/ada.g1982
-rw-r--r--languages/ada/ada.store.g610
-rw-r--r--languages/ada/ada.tree.g964
-rw-r--r--languages/ada/ada_utils.cpp69
-rw-r--r--languages/ada/ada_utils.hpp15
-rw-r--r--languages/ada/adasupport.cpp168
-rw-r--r--languages/ada/adasupport.hpp13
-rw-r--r--languages/ada/adasupportpart.cpp376
-rw-r--r--languages/ada/adasupportpart.h50
-rw-r--r--languages/ada/addclass.cpp351
-rw-r--r--languages/ada/addclass.h55
-rw-r--r--languages/ada/addclassdlg.ui434
-rw-r--r--languages/ada/app_templates/Makefile.am5
-rw-r--r--languages/ada/app_templates/ada.appwizard2
-rw-r--r--languages/ada/app_templates/adahello/.kdev_ignore0
-rw-r--r--languages/ada/app_templates/adahello/Makefile.am16
-rw-r--r--languages/ada/app_templates/adahello/ada-Makefile2
-rw-r--r--languages/ada/app_templates/adahello/ada-Makefile.am5
-rw-r--r--languages/ada/app_templates/adahello/ada-Makefile.cvs8
-rw-r--r--languages/ada/app_templates/adahello/adahello10
-rw-r--r--languages/ada/app_templates/adahello/adahello.kdevtemplate132
-rw-r--r--languages/ada/app_templates/adahello/adahello.pngbin0 -> 10118 bytes
-rw-r--r--languages/ada/app_templates/adahello/app.kdevelop84
-rw-r--r--languages/ada/app_templates/adahello/app.kdevelop.filelist1
-rw-r--r--languages/ada/app_templates/adahello/configure.in10
-rw-r--r--languages/ada/app_templates/adahello/main.adb8
-rw-r--r--languages/ada/app_templates/adahello/src-Makefile.am8
-rw-r--r--languages/ada/backgroundparser.cpp77
-rw-r--r--languages/ada/backgroundparser.h37
-rw-r--r--languages/ada/configproblemreporter.ui89
-rw-r--r--languages/ada/configproblemreporter.ui.h39
-rw-r--r--languages/ada/configure.in.in4
-rw-r--r--languages/ada/doc/Makefile.am6
-rw-r--r--languages/ada/doc/ada.toc130
-rw-r--r--languages/ada/doc/ada_bugs_gcc.toc7
-rw-r--r--languages/ada/file_templates/Makefile.am3
-rw-r--r--languages/ada/file_templates/adb12
-rw-r--r--languages/ada/file_templates/ads12
-rw-r--r--languages/ada/kdevadasupport.desktop87
-rw-r--r--languages/ada/kdevadasupport.rc11
-rw-r--r--languages/ada/preambles.h89
-rw-r--r--languages/ada/problemreporter.cpp282
-rw-r--r--languages/ada/problemreporter.h79
-rw-r--r--languages/bash/Makefile.am20
-rw-r--r--languages/bash/README.dox15
-rw-r--r--languages/bash/app_templates/Makefile.am3
-rw-r--r--languages/bash/app_templates/bash.appwizard2
-rw-r--r--languages/bash/app_templates/bashhello/.kdev_ignore0
-rw-r--r--languages/bash/app_templates/bashhello/Makefile.am16
-rw-r--r--languages/bash/app_templates/bashhello/app.kdevelop82
-rw-r--r--languages/bash/app_templates/bashhello/app.sh17
-rw-r--r--languages/bash/app_templates/bashhello/bashhello10
-rw-r--r--languages/bash/app_templates/bashhello/bashhello.kdevtemplate111
-rw-r--r--languages/bash/app_templates/bashhello/bashhello.pngbin0 -> 483 bytes
-rw-r--r--languages/bash/bashsupport_part.cpp442
-rw-r--r--languages/bash/bashsupport_part.h81
-rw-r--r--languages/bash/doc/Makefile.am6
-rw-r--r--languages/bash/doc/bash.toc80
-rw-r--r--languages/bash/doc/bash_bugs.toc7
-rw-r--r--languages/bash/kdevbashsupport.desktop85
-rw-r--r--languages/bash/kdevbashsupport.rc11
-rw-r--r--languages/cpp/KDevCppSupportIface.cpp24
-rw-r--r--languages/cpp/KDevCppSupportIface.h27
-rw-r--r--languages/cpp/Makefile.am59
-rw-r--r--languages/cpp/README.dox34
-rw-r--r--languages/cpp/addattributedialog.cpp265
-rw-r--r--languages/cpp/addattributedialog.h60
-rw-r--r--languages/cpp/addattributedialogbase.ui375
-rw-r--r--languages/cpp/addmethoddialog.cpp420
-rw-r--r--languages/cpp/addmethoddialog.h62
-rw-r--r--languages/cpp/addmethoddialogbase.ui459
-rw-r--r--languages/cpp/app_templates/Makefile.am10
-rw-r--r--languages/cpp/app_templates/automakeempty/Makefile.am17
-rw-r--r--languages/cpp/app_templates/automakeempty/app.kdevelop101
-rw-r--r--languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am1
-rw-r--r--languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate99
-rw-r--r--languages/cpp/app_templates/automakeempty/automakeempty.pngbin0 -> 8621 bytes
-rw-r--r--languages/cpp/app_templates/automakeempty/configure.in10
-rw-r--r--languages/cpp/app_templates/c.appwizard2
-rw-r--r--languages/cpp/app_templates/chello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/chello/Makefile.am18
-rw-r--r--languages/cpp/app_templates/chello/app.kdevelop107
-rw-r--r--languages/cpp/app_templates/chello/c-Makefile.am5
-rw-r--r--languages/cpp/app_templates/chello/c-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/chello/chello.kdevtemplate253
-rw-r--r--languages/cpp/app_templates/chello/chello.pngbin0 -> 10118 bytes
-rw-r--r--languages/cpp/app_templates/chello/configure.in10
-rw-r--r--languages/cpp/app_templates/chello/main.c15
-rw-r--r--languages/cpp/app_templates/chello/src-Makefile.am8
-rw-r--r--languages/cpp/app_templates/chello_gba/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/chello_gba/Makefile.am18
-rw-r--r--languages/cpp/app_templates/chello_gba/README.devel30
-rw-r--r--languages/cpp/app_templates/chello_gba/app.kdevelop100
-rw-r--r--languages/cpp/app_templates/chello_gba/c-Makefile.am5
-rw-r--r--languages/cpp/app_templates/chello_gba/c-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate173
-rw-r--r--languages/cpp/app_templates/chello_gba/chellogba.pngbin0 -> 5041 bytes
-rw-r--r--languages/cpp/app_templates/chello_gba/configure.in10
-rw-r--r--languages/cpp/app_templates/chello_gba/font.bmpbin0 -> 1026 bytes
-rw-r--r--languages/cpp/app_templates/chello_gba/font.raw.c123
-rw-r--r--languages/cpp/app_templates/chello_gba/gba.h204
-rw-r--r--languages/cpp/app_templates/chello_gba/main.c50
-rw-r--r--languages/cpp/app_templates/chello_gba/main.h12
-rw-r--r--languages/cpp/app_templates/chello_gba/master.pal.c35
-rw-r--r--languages/cpp/app_templates/chello_gba/src-Makefile.am13
-rw-r--r--languages/cpp/app_templates/clanlib/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/clanlib/Makefile.am17
-rw-r--r--languages/cpp/app_templates/clanlib/app-Makefile.am1
-rw-r--r--languages/cpp/app_templates/clanlib/app-autogen.sh2
-rw-r--r--languages/cpp/app_templates/clanlib/app-configure.in22
-rw-r--r--languages/cpp/app_templates/clanlib/app.kdevelop106
-rw-r--r--languages/cpp/app_templates/clanlib/clanlib.kdevtemplate138
-rw-r--r--languages/cpp/app_templates/clanlib/clanlib.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/clanlib/main.cpp29
-rw-r--r--languages/cpp/app_templates/clanlib/src-Makefile.am4
-rw-r--r--languages/cpp/app_templates/cmakelibc/CMakeLists.txt7
-rw-r--r--languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src19
-rw-r--r--languages/cpp/app_templates/cmakelibc/Makefile.am16
-rw-r--r--languages/cpp/app_templates/cmakelibc/cmakelibc7
-rw-r--r--languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate139
-rw-r--r--languages/cpp/app_templates/cmakelibc/cmakelibc.pngbin0 -> 10060 bytes
-rw-r--r--languages/cpp/app_templates/cmakelibc/lib.c13
-rw-r--r--languages/cpp/app_templates/cmakelibc/lib.h7
-rw-r--r--languages/cpp/app_templates/cmakelibc/test.c8
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt8
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src19
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/Makefile.am16
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/cmakelibcpp7
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate139
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.pngbin0 -> 10060 bytes
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/lib.cpp17
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/lib.h12
-rw-r--r--languages/cpp/app_templates/cmakelibcpp/test.cpp9
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt14
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src28
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/Makefile.am18
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/cmakeqt3app8
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp283
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h39
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate126
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.pngbin0 -> 5034 bytes
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/fileopen.xpm22
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/fileprint.xpm24
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/filesave.xpm22
-rw-r--r--languages/cpp/app_templates/cmakeqt3app/main.cpp13
-rw-r--r--languages/cpp/app_templates/cmakesimple/CMakeLists.txt15
-rw-r--r--languages/cpp/app_templates/cmakesimple/Makefile.am16
-rw-r--r--languages/cpp/app_templates/cmakesimple/README30
-rw-r--r--languages/cpp/app_templates/cmakesimple/cmakesimple7
-rw-r--r--languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate112
-rw-r--r--languages/cpp/app_templates/cmakesimple/cmakesimple.pngbin0 -> 12197 bytes
-rw-r--r--languages/cpp/app_templates/cmakesimple/main.cpp14
-rw-r--r--languages/cpp/app_templates/cmakesimplec/CMakeLists.txt14
-rw-r--r--languages/cpp/app_templates/cmakesimplec/Makefile.am16
-rw-r--r--languages/cpp/app_templates/cmakesimplec/cmakesimplec7
-rw-r--r--languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate115
-rw-r--r--languages/cpp/app_templates/cmakesimplec/cmakesimplec.pngbin0 -> 10060 bytes
-rw-r--r--languages/cpp/app_templates/cmakesimplec/main.c14
-rw-r--r--languages/cpp/app_templates/cpp.appwizard2
-rw-r--r--languages/cpp/app_templates/cppcurseshello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/cppcurseshello/Makefile.am17
-rw-r--r--languages/cpp/app_templates/cppcurseshello/app-configure.in21
-rw-r--r--languages/cpp/app_templates/cppcurseshello/app.kdevelop105
-rw-r--r--languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am5
-rw-r--r--languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs7
-rw-r--r--languages/cpp/app_templates/cppcurseshello/cppcurseshello10
-rw-r--r--languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate143
-rw-r--r--languages/cpp/app_templates/cppcurseshello/cppcurseshello.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/cppcurseshello/main.cpp49
-rw-r--r--languages/cpp/app_templates/cppcurseshello/src-Makefile.am8
-rw-r--r--languages/cpp/app_templates/cpphello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/cpphello/Makefile.am17
-rw-r--r--languages/cpp/app_templates/cpphello/app.kdevelop105
-rw-r--r--languages/cpp/app_templates/cpphello/configure.in10
-rw-r--r--languages/cpp/app_templates/cpphello/cpp-Makefile.am5
-rw-r--r--languages/cpp/app_templates/cpphello/cpp-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/cpphello/cpphello.kdevtemplate145
-rw-r--r--languages/cpp/app_templates/cpphello/cpphello.pngbin0 -> 8621 bytes
-rw-r--r--languages/cpp/app_templates/cpphello/main.cpp17
-rw-r--r--languages/cpp/app_templates/cpphello/src-Makefile.am8
-rw-r--r--languages/cpp/app_templates/cppsdlhello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/cppsdlhello/Makefile.am16
-rw-r--r--languages/cpp/app_templates/cppsdlhello/README11
-rw-r--r--languages/cpp/app_templates/cppsdlhello/acinclude.m4167
-rw-r--r--languages/cpp/app_templates/cppsdlhello/app.kdevelop103
-rw-r--r--languages/cpp/app_templates/cppsdlhello/configure.in90
-rw-r--r--languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am5
-rw-r--r--languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/cppsdlhello/cppsdlhello10
-rw-r--r--languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate150
-rw-r--r--languages/cpp/app_templates/cppsdlhello/cppsdlhello.pngbin0 -> 10118 bytes
-rw-r--r--languages/cpp/app_templates/cppsdlhello/main.cpp29
-rw-r--r--languages/cpp/app_templates/cppsdlhello/src-Makefile.am9
-rw-r--r--languages/cpp/app_templates/dcopservice/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/dcopservice/Makefile.am18
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice10
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.cpp49
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.desktop43
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.h35
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.kdevelop109
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate202
-rw-r--r--languages/cpp/app_templates/dcopservice/dcopservice.pngbin0 -> 23880 bytes
-rw-r--r--languages/cpp/app_templates/dcopservice/main.cpp47
-rw-r--r--languages/cpp/app_templates/dcopservice/src-Makefile.am17
-rw-r--r--languages/cpp/app_templates/dcopservice/subdirs3
-rw-r--r--languages/cpp/app_templates/generichello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/generichello/Makefile.am19
-rw-r--r--languages/cpp/app_templates/generichello/app.kdevelop61
-rw-r--r--languages/cpp/app_templates/generichello/app.prj8
-rw-r--r--languages/cpp/app_templates/generichello/cpphello.pngbin0 -> 10118 bytes
-rw-r--r--languages/cpp/app_templates/generichello/generichello.kdevtemplate92
-rw-r--r--languages/cpp/app_templates/generichello/main.cpp17
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/Makefile.am21
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/acconfig.h23
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/app-Makefile.am4
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/app.kdevelop69
-rwxr-xr-xlanguages/cpp/app_templates/gnome2mmapp/autogen.sh40
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/config.h0
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/configure.in57
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc22
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade24
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep8
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mmapp8
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate186
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.pngbin0 -> 2750 bytes
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/main_window.cc16
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/main_window.hh19
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc30
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh49
-rw-r--r--languages/cpp/app_templates/gnome2mmapp/src-Makefile.am14
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/Makefile.am21
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/acconfig.h10
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/app-Makefile.am4
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/app.kdevelop113
-rwxr-xr-xlanguages/cpp/app_templates/gtk2mmapp/autogen.sh33
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/config.h0
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/configure.in19
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc15
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade30
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep10
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate174
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.pngbin0 -> 2750 bytes
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/main_window.cc12
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/main_window.hh19
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc40
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh48
-rw-r--r--languages/cpp/app_templates/gtk2mmapp/src-Makefile.am14
-rw-r--r--languages/cpp/app_templates/kapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kapp/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kapp/README81
-rw-r--r--languages/cpp/app_templates/kapp/app.cpp247
-rw-r--r--languages/cpp/app_templates/kapp/app.desktop44
-rw-r--r--languages/cpp/app_templates/kapp/app.h89
-rw-r--r--languages/cpp/app_templates/kapp/app.kdevelop168
-rw-r--r--languages/cpp/app_templates/kapp/app.kdevses13
-rw-r--r--languages/cpp/app_templates/kapp/app_client.cpp26
-rw-r--r--languages/cpp/app_templates/kapp/appiface.h17
-rw-r--r--languages/cpp/app_templates/kapp/appui.rc8
-rw-r--r--languages/cpp/app_templates/kapp/appview.cpp107
-rw-r--r--languages/cpp/app_templates/kapp/appview.h77
-rw-r--r--languages/cpp/app_templates/kapp/kapp.kdevtemplate253
-rw-r--r--languages/cpp/app_templates/kapp/kapp.pngbin0 -> 6320 bytes
-rw-r--r--languages/cpp/app_templates/kapp/main.cpp61
-rw-r--r--languages/cpp/app_templates/kapp/pref.cpp42
-rw-r--r--languages/cpp/app_templates/kapp/pref.h37
-rw-r--r--languages/cpp/app_templates/kapp/src-Makefile.am43
-rw-r--r--languages/cpp/app_templates/kapp/subdirs3
-rw-r--r--languages/cpp/app_templates/kateplugin/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kateplugin/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kateplugin/hi16-action-plugin.pngbin0 -> 292 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin/hi22-action-plugin.pngbin0 -> 1151 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate213
-rw-r--r--languages/cpp/app_templates/kateplugin/kateplugin.pngbin0 -> 12901 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin/plugin.desktop76
-rw-r--r--languages/cpp/app_templates/kateplugin/plugin.kdevelop113
-rw-r--r--languages/cpp/app_templates/kateplugin/plugin_app.cpp89
-rw-r--r--languages/cpp/app_templates/kateplugin/plugin_app.h49
-rw-r--r--languages/cpp/app_templates/kateplugin/plugin_app.rc11
-rw-r--r--languages/cpp/app_templates/kateplugin/src-Makefile.am20
-rw-r--r--languages/cpp/app_templates/kateplugin/subdirs3
-rw-r--r--languages/cpp/app_templates/kateplugin2/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kateplugin2/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kateplugin2/hi16-action-plugin.pngbin0 -> 292 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin2/hi22-action-plugin.pngbin0 -> 1151 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate214
-rw-r--r--languages/cpp/app_templates/kateplugin2/kateplugin2.pngbin0 -> 12901 bytes
-rw-r--r--languages/cpp/app_templates/kateplugin2/plugin.desktop76
-rw-r--r--languages/cpp/app_templates/kateplugin2/plugin.kdevelop114
-rw-r--r--languages/cpp/app_templates/kateplugin2/plugin_app.cpp140
-rw-r--r--languages/cpp/app_templates/kateplugin2/plugin_app.h91
-rw-r--r--languages/cpp/app_templates/kateplugin2/plugin_app.rc11
-rw-r--r--languages/cpp/app_templates/kateplugin2/src-Makefile.am21
-rw-r--r--languages/cpp/app_templates/kateplugin2/subdirs3
-rw-r--r--languages/cpp/app_templates/kcmodule/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kcmodule/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate197
-rw-r--r--languages/cpp/app_templates/kcmodule/kcmodule.pngbin0 -> 16691 bytes
-rw-r--r--languages/cpp/app_templates/kcmodule/module.cpp66
-rw-r--r--languages/cpp/app_templates/kcmodule/module.desktop81
-rw-r--r--languages/cpp/app_templates/kcmodule/module.h32
-rw-r--r--languages/cpp/app_templates/kcmodule/module.kdevelop113
-rw-r--r--languages/cpp/app_templates/kcmodule/src-Makefile.am17
-rw-r--r--languages/cpp/app_templates/kcmodule/subdirs3
-rw-r--r--languages/cpp/app_templates/kconfig35/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kconfig35/README90
-rw-r--r--languages/cpp/app_templates/kconfig35/app.cpp105
-rw-r--r--languages/cpp/app_templates/kconfig35/app.desktop40
-rw-r--r--languages/cpp/app_templates/kconfig35/app.h60
-rw-r--r--languages/cpp/app_templates/kconfig35/app.kcfg21
-rw-r--r--languages/cpp/app_templates/kconfig35/app.kdevelop168
-rw-r--r--languages/cpp/app_templates/kconfig35/appui.rc8
-rw-r--r--languages/cpp/app_templates/kconfig35/appview.cpp41
-rw-r--r--languages/cpp/app_templates/kconfig35/appview.h52
-rw-r--r--languages/cpp/app_templates/kconfig35/appview_base.ui33
-rw-r--r--languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate245
-rw-r--r--languages/cpp/app_templates/kconfig35/kconfig35.pngbin0 -> 6975 bytes
-rw-r--r--languages/cpp/app_templates/kconfig35/kxt35.pngbin0 -> 6975 bytes
-rw-r--r--languages/cpp/app_templates/kconfig35/main.cpp57
-rw-r--r--languages/cpp/app_templates/kconfig35/prefs-base.ui127
-rw-r--r--languages/cpp/app_templates/kconfig35/prefs.cpp12
-rw-r--r--languages/cpp/app_templates/kconfig35/prefs.h11
-rw-r--r--languages/cpp/app_templates/kconfig35/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kconfig35/src-Makefile.am41
-rw-r--r--languages/cpp/app_templates/kconfig35/src-configure.in.in7
-rw-r--r--languages/cpp/app_templates/kconfig35/subdirs3
-rw-r--r--languages/cpp/app_templates/kde4app/CMakeLists.txt31
-rw-r--r--languages/cpp/app_templates/kde4app/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kde4app/README15
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4.cpp90
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4.desktop30
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4.h53
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4.kcfg21
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4view.cpp42
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4view.h55
-rw-r--r--languages/cpp/app_templates/kde4app/kapp4view_base.ui213
-rw-r--r--languages/cpp/app_templates/kde4app/kde4app.kdevelop205
-rw-r--r--languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist13
-rw-r--r--languages/cpp/app_templates/kde4app/kde4app.kdevtemplate155
-rw-r--r--languages/cpp/app_templates/kde4app/kde4app.pngbin0 -> 6320 bytes
-rw-r--r--languages/cpp/app_templates/kde4app/kde4appui.rc8
-rw-r--r--languages/cpp/app_templates/kde4app/main.cpp55
-rw-r--r--languages/cpp/app_templates/kde4app/prefs_base.ui155
-rw-r--r--languages/cpp/app_templates/kde4app/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kdecpp.appwizard2
-rw-r--r--languages/cpp/app_templates/kdedcop/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kdedcop/Makefile.am18
-rw-r--r--languages/cpp/app_templates/kdedcop/app.cpp21
-rw-r--r--languages/cpp/app_templates/kdedcop/app.h36
-rw-r--r--languages/cpp/app_templates/kdedcop/app.kdevelop116
-rw-r--r--languages/cpp/app_templates/kdedcop/app_iface.h19
-rw-r--r--languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate227
-rw-r--r--languages/cpp/app_templates/kdedcop/kdedcop.pngbin0 -> 2127 bytes
-rw-r--r--languages/cpp/app_templates/kdedcop/main.cpp52
-rw-r--r--languages/cpp/app_templates/kdedcop/mainclass.cpp31
-rw-r--r--languages/cpp/app_templates/kdedcop/mainclass.h32
-rw-r--r--languages/cpp/app_templates/kdedcop/src-Makefile.am23
-rw-r--r--languages/cpp/app_templates/kdedcop/subdirs3
-rw-r--r--languages/cpp/app_templates/kdevlang/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kdevlang/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kdevlang/README.dox55
-rw-r--r--languages/cpp/app_templates/kdevlang/app.kdevelop115
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in10
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang.desktop14
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate157
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang.rc11
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang_part.cpp154
-rw-r--r--languages/cpp/app_templates/kdevlang/kdevlang_part.h43
-rw-r--r--languages/cpp/app_templates/kdevlang/src-Makefile.am14
-rw-r--r--languages/cpp/app_templates/kdevpart/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kdevpart/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kdevpart/README.dox55
-rw-r--r--languages/cpp/app_templates/kdevpart/app.kdevelop116
-rw-r--r--languages/cpp/app_templates/kdevpart/globalconfig.cpp15
-rw-r--r--languages/cpp/app_templates/kdevpart/globalconfig.h22
-rw-r--r--languages/cpp/app_templates/kdevpart/globalconfigbase.ui20
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart.desktop83
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate242
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart_part.cpp183
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart_part.h45
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart_part.rc11
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp21
-rw-r--r--languages/cpp/app_templates/kdevpart/kdevpart_widget.h23
-rw-r--r--languages/cpp/app_templates/kdevpart/projectconfig.cpp15
-rw-r--r--languages/cpp/app_templates/kdevpart/projectconfig.h22
-rw-r--r--languages/cpp/app_templates/kdevpart/projectconfigbase.ui20
-rw-r--r--languages/cpp/app_templates/kdevpart/src-Makefile.am20
-rw-r--r--languages/cpp/app_templates/kdevpart2/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kdevpart2/Makefile.am21
-rw-r--r--languages/cpp/app_templates/kdevpart2/README.dox55
-rw-r--r--languages/cpp/app_templates/kdevpart2/app.kdevelop148
-rw-r--r--languages/cpp/app_templates/kdevpart2/globalconfig.cpp15
-rw-r--r--languages/cpp/app_templates/kdevpart2/globalconfig.h22
-rw-r--r--languages/cpp/app_templates/kdevpart2/globalconfigbase.ui20
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in10
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart.desktop83
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate276
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart2.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp183
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart_part.h45
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart_part.rc11
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp21
-rw-r--r--languages/cpp/app_templates/kdevpart2/kdevpart_widget.h23
-rw-r--r--languages/cpp/app_templates/kdevpart2/projectconfig.cpp15
-rw-r--r--languages/cpp/app_templates/kdevpart2/projectconfig.h22
-rw-r--r--languages/cpp/app_templates/kdevpart2/projectconfigbase.ui20
-rw-r--r--languages/cpp/app_templates/kdevpart2/src-Makefile.am17
-rw-r--r--languages/cpp/app_templates/kdevpart2/subdirs3
-rw-r--r--languages/cpp/app_templates/kfileplugin/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kfileplugin/Makefile.am18
-rw-r--r--languages/cpp/app_templates/kfileplugin/README.devel9
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp55
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop39
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfile_plugin.h24
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfileplugin8
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate166
-rw-r--r--languages/cpp/app_templates/kfileplugin/kfileplugin.pngbin0 -> 11953 bytes
-rw-r--r--languages/cpp/app_templates/kfileplugin/plugin.kdevelop114
-rw-r--r--languages/cpp/app_templates/kfileplugin/src-Makefile.am22
-rw-r--r--languages/cpp/app_templates/kfileplugin/subdirs3
-rw-r--r--languages/cpp/app_templates/khello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/khello/Makefile.am18
-rw-r--r--languages/cpp/app_templates/khello/app.cpp23
-rw-r--r--languages/cpp/app_templates/khello/app.desktop40
-rw-r--r--languages/cpp/app_templates/khello/app.h32
-rw-r--r--languages/cpp/app_templates/khello/app.kdevelop115
-rw-r--r--languages/cpp/app_templates/khello/appui.rc8
-rw-r--r--languages/cpp/app_templates/khello/khello.kdevtemplate220
-rw-r--r--languages/cpp/app_templates/khello/khello.pngbin0 -> 3573 bytes
-rw-r--r--languages/cpp/app_templates/khello/main.cpp51
-rw-r--r--languages/cpp/app_templates/khello/src-Makefile.am35
-rw-r--r--languages/cpp/app_templates/khello/subdirs3
-rw-r--r--languages/cpp/app_templates/khello2/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/khello2/Makefile.am18
-rw-r--r--languages/cpp/app_templates/khello2/app.cpp19
-rw-r--r--languages/cpp/app_templates/khello2/app.desktop40
-rw-r--r--languages/cpp/app_templates/khello2/app.h32
-rw-r--r--languages/cpp/app_templates/khello2/app.kdevelop115
-rw-r--r--languages/cpp/app_templates/khello2/appui.rc8
-rw-r--r--languages/cpp/app_templates/khello2/khello2.kdevtemplate230
-rw-r--r--languages/cpp/app_templates/khello2/khello2.pngbin0 -> 3155 bytes
-rw-r--r--languages/cpp/app_templates/khello2/main.cpp51
-rw-r--r--languages/cpp/app_templates/khello2/src-Makefile.am35
-rw-r--r--languages/cpp/app_templates/khello2/subdirs3
-rw-r--r--languages/cpp/app_templates/khello2/widget.cpp30
-rw-r--r--languages/cpp/app_templates/khello2/widget.h30
-rw-r--r--languages/cpp/app_templates/khello2/widgetbase.ui52
-rw-r--r--languages/cpp/app_templates/kicker/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kicker/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kicker/applet.cpp72
-rw-r--r--languages/cpp/app_templates/kicker/applet.desktop40
-rw-r--r--languages/cpp/app_templates/kicker/applet.h107
-rw-r--r--languages/cpp/app_templates/kicker/applet.kdevelop115
-rw-r--r--languages/cpp/app_templates/kicker/kicker.kdevtemplate194
-rw-r--r--languages/cpp/app_templates/kicker/kicker.pngbin0 -> 8356 bytes
-rw-r--r--languages/cpp/app_templates/kicker/src-Makefile.am15
-rw-r--r--languages/cpp/app_templates/kicker/subdirs3
-rw-r--r--languages/cpp/app_templates/kioslave/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kioslave/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kioslave/kioslave.kdevtemplate183
-rw-r--r--languages/cpp/app_templates/kioslave/kioslave.pngbin0 -> 9524 bytes
-rw-r--r--languages/cpp/app_templates/kioslave/slave.cpp88
-rw-r--r--languages/cpp/app_templates/kioslave/slave.h23
-rw-r--r--languages/cpp/app_templates/kioslave/slave.kdevelop113
-rw-r--r--languages/cpp/app_templates/kioslave/slave.protocol39
-rw-r--r--languages/cpp/app_templates/kioslave/src-Makefile.am14
-rw-r--r--languages/cpp/app_templates/kioslave/subdirs3
-rw-r--r--languages/cpp/app_templates/kmake/Makefile.am16
-rw-r--r--languages/cpp/app_templates/kmake/app.cpp33
-rw-r--r--languages/cpp/app_templates/kmake/app.desktop44
-rw-r--r--languages/cpp/app_templates/kmake/app.kdevelop111
-rw-r--r--languages/cpp/app_templates/kmake/app.pro7
-rw-r--r--languages/cpp/app_templates/kmake/appui.rc3
-rw-r--r--languages/cpp/app_templates/kmake/kmake.kdevtemplate148
-rw-r--r--languages/cpp/app_templates/kmake/kmake.pngbin0 -> 5063 bytes
-rw-r--r--languages/cpp/app_templates/kmake/mainview.ui76
-rw-r--r--languages/cpp/app_templates/kmake/mainviewimp.cpp23
-rw-r--r--languages/cpp/app_templates/kmake/mainviewimp.h19
-rw-r--r--languages/cpp/app_templates/kmake/src.pro29
-rw-r--r--languages/cpp/app_templates/kmod/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kmod/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kmod/kmod-driver.c22
-rw-r--r--languages/cpp/app_templates/kmod/kmod.kdevelop93
-rw-r--r--languages/cpp/app_templates/kmod/kmod.kdevtemplate89
-rw-r--r--languages/cpp/app_templates/kmod/kmod.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/kmod/src-Makefile30
-rw-r--r--languages/cpp/app_templates/kofficepart/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kofficepart/Makefile.am21
-rw-r--r--languages/cpp/app_templates/kofficepart/kde-configure.in.in42
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart.desktop9
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart.kdevelop113
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart.kdevtemplate231
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart.pngbin0 -> 10017 bytes
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart.rc10
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_aboutdata.h24
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_factory.cpp76
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_factory.h33
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_part.cpp69
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_part.h30
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_view.cpp52
-rw-r--r--languages/cpp/app_templates/kofficepart/kopart_view.h34
-rw-r--r--languages/cpp/app_templates/kofficepart/main.cpp33
-rw-r--r--languages/cpp/app_templates/kofficepart/src-Makefile.am41
-rw-r--r--languages/cpp/app_templates/kofficepart/subdirs3
-rw-r--r--languages/cpp/app_templates/kofficepart/x-kopart.desktop40
-rw-r--r--languages/cpp/app_templates/konqnavpanel/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/konqnavpanel/Makefile.am18
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp34
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop39
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.h43
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop115
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate192
-rw-r--r--languages/cpp/app_templates/konqnavpanel/konqnavpanel.pngbin0 -> 19783 bytes
-rw-r--r--languages/cpp/app_templates/konqnavpanel/src-Makefile.am11
-rw-r--r--languages/cpp/app_templates/konqnavpanel/subdirs3
-rw-r--r--languages/cpp/app_templates/kpartapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kpartapp/Makefile.am17
-rw-r--r--languages/cpp/app_templates/kpartapp/app.cpp209
-rw-r--r--languages/cpp/app_templates/kpartapp/app.desktop18
-rw-r--r--languages/cpp/app_templates/kpartapp/app.h76
-rw-r--r--languages/cpp/app_templates/kpartapp/app.kdevelop115
-rw-r--r--languages/cpp/app_templates/kpartapp/app_part.cpp201
-rw-r--r--languages/cpp/app_templates/kpartapp/app_part.h86
-rw-r--r--languages/cpp/app_templates/kpartapp/app_part.rc17
-rw-r--r--languages/cpp/app_templates/kpartapp/app_shell.rc28
-rw-r--r--languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate237
-rw-r--r--languages/cpp/app_templates/kpartapp/kpartapp.pngbin0 -> 5041 bytes
-rw-r--r--languages/cpp/app_templates/kpartapp/main.cpp57
-rw-r--r--languages/cpp/app_templates/kpartapp/src-Makefile.am53
-rw-r--r--languages/cpp/app_templates/kpartapp/subdirs3
-rw-r--r--languages/cpp/app_templates/kpartplugin/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kpartplugin/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kpartplugin/hi16-action-plugin.pngbin0 -> 292 bytes
-rw-r--r--languages/cpp/app_templates/kpartplugin/hi22-action-plugin.pngbin0 -> 1151 bytes
-rw-r--r--languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate204
-rw-r--r--languages/cpp/app_templates/kpartplugin/kpartplugin.pngbin0 -> 16772 bytes
-rw-r--r--languages/cpp/app_templates/kpartplugin/plugin.kdevelop114
-rw-r--r--languages/cpp/app_templates/kpartplugin/plugin_app.cpp109
-rw-r--r--languages/cpp/app_templates/kpartplugin/plugin_app.h34
-rw-r--r--languages/cpp/app_templates/kpartplugin/plugin_app.rc11
-rw-r--r--languages/cpp/app_templates/kpartplugin/src-Makefile.am22
-rw-r--r--languages/cpp/app_templates/kpartplugin/subdirs3
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/INSTALL83
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/Makefile.am21
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/QUICKSTART164
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/README111
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConscript-doc92
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConscript-src60
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/SConstruct112
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/VERSION1
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app.kcfg12
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app.kdevelop169
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.cpp159
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.h74
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_part.rc17
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/app_shell.rc33
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp394
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdi.h82
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp63
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/appkmdiView.h29
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp76
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h32
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate271
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.pngbin0 -> 13151 bytes
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/main.cpp60
-rwxr-xr-xlanguages/cpp/app_templates/kscons_kmdi/messages.sh60
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/prefs.ui30
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kscons_kmdi/tips6
-rw-r--r--languages/cpp/app_templates/kscons_kxt/INSTALL83
-rw-r--r--languages/cpp/app_templates/kscons_kxt/Makefile.am21
-rw-r--r--languages/cpp/app_templates/kscons_kxt/QUICKSTART164
-rw-r--r--languages/cpp/app_templates/kscons_kxt/README111
-rw-r--r--languages/cpp/app_templates/kscons_kxt/SConscript-doc92
-rw-r--r--languages/cpp/app_templates/kscons_kxt/SConscript-src72
-rw-r--r--languages/cpp/app_templates/kscons_kxt/SConstruct112
-rw-r--r--languages/cpp/app_templates/kscons_kxt/VERSION1
-rw-r--r--languages/cpp/app_templates/kscons_kxt/app.cpp177
-rw-r--r--languages/cpp/app_templates/kscons_kxt/app.h73
-rw-r--r--languages/cpp/app_templates/kscons_kxt/app.kcfg21
-rw-r--r--languages/cpp/app_templates/kscons_kxt/app.kdevelop169
-rw-r--r--languages/cpp/app_templates/kscons_kxt/appui.rc8
-rw-r--r--languages/cpp/app_templates/kscons_kxt/appview.cpp41
-rw-r--r--languages/cpp/app_templates/kscons_kxt/appview.h52
-rw-r--r--languages/cpp/app_templates/kscons_kxt/appview_base.ui35
-rw-r--r--languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate253
-rw-r--r--languages/cpp/app_templates/kscons_kxt/kscons_kxt.pngbin0 -> 13698 bytes
-rw-r--r--languages/cpp/app_templates/kscons_kxt/main.cpp57
-rwxr-xr-xlanguages/cpp/app_templates/kscons_kxt/messages.sh60
-rw-r--r--languages/cpp/app_templates/kscons_kxt/prefs-base.ui129
-rw-r--r--languages/cpp/app_templates/kscons_kxt/prefs.cpp12
-rw-r--r--languages/cpp/app_templates/kscons_kxt/prefs.h11
-rw-r--r--languages/cpp/app_templates/kscons_kxt/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kscons_kxt/tips6
-rw-r--r--languages/cpp/app_templates/kscreensaver/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kscreensaver/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.cpp107
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.desktop124
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.h35
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop113
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate203
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaver.pngbin0 -> 12032 bytes
-rw-r--r--languages/cpp/app_templates/kscreensaver/kscreensaverui.ui79
-rw-r--r--languages/cpp/app_templates/kscreensaver/src-Makefile.am24
-rw-r--r--languages/cpp/app_templates/kscreensaver/subdirs3
-rw-r--r--languages/cpp/app_templates/kxt/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/kxt/Makefile.am19
-rw-r--r--languages/cpp/app_templates/kxt/README86
-rw-r--r--languages/cpp/app_templates/kxt/app.cpp154
-rw-r--r--languages/cpp/app_templates/kxt/app.desktop40
-rw-r--r--languages/cpp/app_templates/kxt/app.h66
-rw-r--r--languages/cpp/app_templates/kxt/app.kcfg21
-rw-r--r--languages/cpp/app_templates/kxt/app.kdevelop169
-rw-r--r--languages/cpp/app_templates/kxt/appui.rc8
-rw-r--r--languages/cpp/app_templates/kxt/appview.cpp41
-rw-r--r--languages/cpp/app_templates/kxt/appview.h52
-rw-r--r--languages/cpp/app_templates/kxt/appview_base.ui33
-rw-r--r--languages/cpp/app_templates/kxt/kxt.kdevtemplate269
-rw-r--r--languages/cpp/app_templates/kxt/kxt.pngbin0 -> 3947 bytes
-rw-r--r--languages/cpp/app_templates/kxt/main.cpp57
-rw-r--r--languages/cpp/app_templates/kxt/prefs-base.ui127
-rw-r--r--languages/cpp/app_templates/kxt/prefs.cpp12
-rw-r--r--languages/cpp/app_templates/kxt/prefs.h11
-rw-r--r--languages/cpp/app_templates/kxt/preview.pngbin0 -> 7712 bytes
-rw-r--r--languages/cpp/app_templates/kxt/settings.kcfgc6
-rw-r--r--languages/cpp/app_templates/kxt/src-Makefile.am41
-rw-r--r--languages/cpp/app_templates/kxt/src-configure.in.in7
-rw-r--r--languages/cpp/app_templates/kxt/subdirs3
-rw-r--r--languages/cpp/app_templates/makefileempty/Makefile.am17
-rw-r--r--languages/cpp/app_templates/makefileempty/app.kdevelop101
-rw-r--r--languages/cpp/app_templates/makefileempty/makefileempty-Makefile0
-rw-r--r--languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate85
-rw-r--r--languages/cpp/app_templates/makefileempty/makefileempty.pngbin0 -> 8621 bytes
-rw-r--r--languages/cpp/app_templates/noatunui/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/noatunui/Makefile.am17
-rw-r--r--languages/cpp/app_templates/noatunui/noatunui8
-rw-r--r--languages/cpp/app_templates/noatunui/noatunui.kdevtemplate195
-rw-r--r--languages/cpp/app_templates/noatunui/noatunui.pngbin0 -> 5433 bytes
-rw-r--r--languages/cpp/app_templates/noatunui/plugin.kdevelop111
-rw-r--r--languages/cpp/app_templates/noatunui/plugin.plugin8
-rw-r--r--languages/cpp/app_templates/noatunui/plugin_app.cpp15
-rw-r--r--languages/cpp/app_templates/noatunui/plugin_impl.cpp301
-rw-r--r--languages/cpp/app_templates/noatunui/plugin_impl.h78
-rw-r--r--languages/cpp/app_templates/noatunui/src-Makefile.am24
-rw-r--r--languages/cpp/app_templates/noatunui/subdirs3
-rw-r--r--languages/cpp/app_templates/noatunvisual/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/noatunvisual/Makefile.am18
-rw-r--r--languages/cpp/app_templates/noatunvisual/noatunvisual8
-rw-r--r--languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in36
-rw-r--r--languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate205
-rw-r--r--languages/cpp/app_templates/noatunvisual/noatunvisual.pngbin0 -> 68585 bytes
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin.kdevelop118
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin.plugin8
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin_app.cpp58
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin_app.h36
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin_impl.cpp276
-rw-r--r--languages/cpp/app_templates/noatunvisual/plugin_impl.h77
-rw-r--r--languages/cpp/app_templates/noatunvisual/src-Makefile.am19
-rw-r--r--languages/cpp/app_templates/noatunvisual/subdirs3
-rw-r--r--languages/cpp/app_templates/opieapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opieapp/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opieapp/Makefile.am18
-rw-r--r--languages/cpp/app_templates/opieapp/app.kdevelop143
-rw-r--r--languages/cpp/app_templates/opieapp/app.pro38
-rw-r--r--languages/cpp/app_templates/opieapp/example.cpp32
-rw-r--r--languages/cpp/app_templates/opieapp/example.desktop37
-rw-r--r--languages/cpp/app_templates/opieapp/example.h20
-rw-r--r--languages/cpp/app_templates/opieapp/examplebase.ui49
-rw-r--r--languages/cpp/app_templates/opieapp/opieapp.kdevtemplate149
-rw-r--r--languages/cpp/app_templates/opieapp/opieapp.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/opieapplet/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opieapplet/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opieapplet/Makefile.am18
-rw-r--r--languages/cpp/app_templates/opieapplet/app.kdevelop158
-rw-r--r--languages/cpp/app_templates/opieapplet/app.pro38
-rw-r--r--languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate135
-rw-r--r--languages/cpp/app_templates/opieapplet/opieapplet.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/opieapplet/simpleimpl.cpp162
-rw-r--r--languages/cpp/app_templates/opieapplet/simpleimpl.h75
-rw-r--r--languages/cpp/app_templates/opieinput/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opieinput/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opieinput/Makefile.am17
-rw-r--r--languages/cpp/app_templates/opieinput/app.kdevelop159
-rw-r--r--languages/cpp/app_templates/opieinput/app.pro38
-rw-r--r--languages/cpp/app_templates/opieinput/opieinput.kdevtemplate129
-rw-r--r--languages/cpp/app_templates/opieinput/opieinput.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/opieinput/simpleimpl.cpp157
-rw-r--r--languages/cpp/app_templates/opieinput/simpleimpl.h50
-rw-r--r--languages/cpp/app_templates/opiemenu/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opiemenu/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opiemenu/Makefile.am18
-rw-r--r--languages/cpp/app_templates/opiemenu/app.kdevelop158
-rw-r--r--languages/cpp/app_templates/opiemenu/app.pro38
-rw-r--r--languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate132
-rw-r--r--languages/cpp/app_templates/opiemenu/opiemenu.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/opiemenu/simpleimpl.cpp78
-rw-r--r--languages/cpp/app_templates/opiemenu/simpleimpl.h32
-rw-r--r--languages/cpp/app_templates/opienet/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opienet/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opienet/Makefile.am19
-rw-r--r--languages/cpp/app_templates/opienet/app.kdevelop143
-rw-r--r--languages/cpp/app_templates/opienet/app.pro39
-rw-r--r--languages/cpp/app_templates/opienet/opienet.kdevtemplate142
-rw-r--r--languages/cpp/app_templates/opienet/opienet.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/opienet/simmplemodule.h36
-rw-r--r--languages/cpp/app_templates/opienet/simpleiface.cpp43
-rw-r--r--languages/cpp/app_templates/opienet/simpleiface.h22
-rw-r--r--languages/cpp/app_templates/opienet/simplemodule.cpp71
-rw-r--r--languages/cpp/app_templates/opienet/simplemodule.h36
-rw-r--r--languages/cpp/app_templates/opietoday/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/opietoday/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/opietoday/Makefile.am19
-rw-r--r--languages/cpp/app_templates/opietoday/app.kdevelop143
-rw-r--r--languages/cpp/app_templates/opietoday/app.pro38
-rw-r--r--languages/cpp/app_templates/opietoday/exampleplugin.cpp60
-rw-r--r--languages/cpp/app_templates/opietoday/exampleplugin.h34
-rw-r--r--languages/cpp/app_templates/opietoday/examplepluginimpl.cpp30
-rw-r--r--languages/cpp/app_templates/opietoday/examplepluginimpl.h23
-rw-r--r--languages/cpp/app_templates/opietoday/examplepluginwidget.cpp55
-rw-r--r--languages/cpp/app_templates/opietoday/examplepluginwidget.h28
-rw-r--r--languages/cpp/app_templates/opietoday/opietoday.kdevtemplate151
-rw-r--r--languages/cpp/app_templates/opietoday/opietoday.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/prc-tool/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/prc-tool/Makefile.am17
-rw-r--r--languages/cpp/app_templates/prc-tool/callback.h24
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.c117
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.pbitm32
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhello.rcp11
-rw-r--r--languages/cpp/app_templates/prc-tool/palmhelloRsc.h1
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool11
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool.kdevelop51
-rw-r--r--languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate136
-rw-r--r--languages/cpp/app_templates/prc-tool/src-Makefile63
-rw-r--r--languages/cpp/app_templates/qmakeapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/qmakeapp/Makefile.am18
-rw-r--r--languages/cpp/app_templates/qmakeapp/fileopen.xpm22
-rw-r--r--languages/cpp/app_templates/qmakeapp/fileprint.xpm24
-rw-r--r--languages/cpp/app_templates/qmakeapp/filesave.xpm22
-rw-r--r--languages/cpp/app_templates/qmakeapp/main.cpp13
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp11
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.cpp283
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.h39
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop112
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate182
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.pngbin0 -> 5034 bytes
-rw-r--r--languages/cpp/app_templates/qmakeapp/qmakeapp.pro6
-rw-r--r--languages/cpp/app_templates/qmakeapp/src.pro10
-rw-r--r--languages/cpp/app_templates/qmakeempty/Makefile.am18
-rw-r--r--languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop113
-rw-r--r--languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate131
-rw-r--r--languages/cpp/app_templates/qmakeempty/qmakeempty.pngbin0 -> 26767 bytes
-rw-r--r--languages/cpp/app_templates/qmakeempty/qmakeempty.pro0
-rw-r--r--languages/cpp/app_templates/qmakesimple/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/qmakesimple/Makefile.am16
-rw-r--r--languages/cpp/app_templates/qmakesimple/app.kdevelop100
-rw-r--r--languages/cpp/app_templates/qmakesimple/app.pro2
-rw-r--r--languages/cpp/app_templates/qmakesimple/main.cpp15
-rw-r--r--languages/cpp/app_templates/qmakesimple/qmakesimple11
-rw-r--r--languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate158
-rw-r--r--languages/cpp/app_templates/qmakesimple/qmakesimple.pngbin0 -> 12036 bytes
-rw-r--r--languages/cpp/app_templates/qmakesimple/src.pro4
-rw-r--r--languages/cpp/app_templates/qt4hello/Makefile.am18
-rw-r--r--languages/cpp/app_templates/qt4hello/ReadMe11
-rw-r--r--languages/cpp/app_templates/qt4hello/main.cpp11
-rw-r--r--languages/cpp/app_templates/qt4hello/qt4hello.kdevelop113
-rw-r--r--languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate160
-rw-r--r--languages/cpp/app_templates/qt4hello/qt4hello.pngbin0 -> 26767 bytes
-rw-r--r--languages/cpp/app_templates/qt4hello/qt4hello.pro5
-rw-r--r--languages/cpp/app_templates/qt4hello/src.pro8
-rw-r--r--languages/cpp/app_templates/qt4makeapp/Makefile.am19
-rw-r--r--languages/cpp/app_templates/qt4makeapp/ReadMe11
-rw-r--r--languages/cpp/app_templates/qt4makeapp/application.qrc10
-rw-r--r--languages/cpp/app_templates/qt4makeapp/editcopy.xpm193
-rw-r--r--languages/cpp/app_templates/qt4makeapp/editcut.xpm252
-rw-r--r--languages/cpp/app_templates/qt4makeapp/editpaste.xpm295
-rw-r--r--languages/cpp/app_templates/qt4makeapp/filenew.xpm216
-rw-r--r--languages/cpp/app_templates/qt4makeapp/fileopen.xpm295
-rw-r--r--languages/cpp/app_templates/qt4makeapp/filesave.xpm295
-rw-r--r--languages/cpp/app_templates/qt4makeapp/main.cpp14
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp11
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp285
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.h65
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop113
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate207
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.pngbin0 -> 16908 bytes
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro5
-rw-r--r--languages/cpp/app_templates/qt4makeapp/src.pro10
-rw-r--r--languages/cpp/app_templates/qtopia4app/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/qtopia4app/Makefile.am19
-rw-r--r--languages/cpp/app_templates/qtopia4app/app.kdevelop163
-rw-r--r--languages/cpp/app_templates/qtopia4app/app.pro31
-rw-r--r--languages/cpp/app_templates/qtopia4app/example.cpp40
-rw-r--r--languages/cpp/app_templates/qtopia4app/example.desktop37
-rw-r--r--languages/cpp/app_templates/qtopia4app/example.h24
-rw-r--r--languages/cpp/app_templates/qtopia4app/example.html15
-rw-r--r--languages/cpp/app_templates/qtopia4app/examplebase.ui44
-rw-r--r--languages/cpp/app_templates/qtopia4app/main.cpp7
-rw-r--r--languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate193
-rw-r--r--languages/cpp/app_templates/qtopia4app/qtopia4app.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/qtopiaapp/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/qtopiaapp/Example.pngbin0 -> 1262 bytes
-rw-r--r--languages/cpp/app_templates/qtopiaapp/Makefile.am19
-rw-r--r--languages/cpp/app_templates/qtopiaapp/app.kdevelop131
-rw-r--r--languages/cpp/app_templates/qtopiaapp/app.pro10
-rw-r--r--languages/cpp/app_templates/qtopiaapp/example.control11
-rw-r--r--languages/cpp/app_templates/qtopiaapp/example.cpp29
-rw-r--r--languages/cpp/app_templates/qtopiaapp/example.desktop37
-rw-r--r--languages/cpp/app_templates/qtopiaapp/example.h18
-rw-r--r--languages/cpp/app_templates/qtopiaapp/example.html15
-rw-r--r--languages/cpp/app_templates/qtopiaapp/examplebase.ui49
-rw-r--r--languages/cpp/app_templates/qtopiaapp/main.cpp13
-rw-r--r--languages/cpp/app_templates/qtopiaapp/qtopiaapp11
-rw-r--r--languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate153
-rw-r--r--languages/cpp/app_templates/qtopiaapp/qtopiaapp.pngbin0 -> 483 bytes
-rw-r--r--languages/cpp/app_templates/win32gui/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/win32gui/Makefile.am18
-rw-r--r--languages/cpp/app_templates/win32gui/app.cpp12
-rw-r--r--languages/cpp/app_templates/win32gui/app.kdevelop192
-rw-r--r--languages/cpp/app_templates/win32gui/src-Makefile.am8
-rw-r--r--languages/cpp/app_templates/win32gui/win32gui-Makefile.am5
-rw-r--r--languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/win32gui/win32gui-configure.in10
-rw-r--r--languages/cpp/app_templates/win32gui/win32gui.kdevtemplate137
-rw-r--r--languages/cpp/app_templates/win32gui/win32gui.pngbin0 -> 10082 bytes
-rw-r--r--languages/cpp/app_templates/win32hello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/win32hello/Makefile.am18
-rw-r--r--languages/cpp/app_templates/win32hello/app.cpp16
-rw-r--r--languages/cpp/app_templates/win32hello/app.kdevelop164
-rw-r--r--languages/cpp/app_templates/win32hello/src-Makefile.am8
-rw-r--r--languages/cpp/app_templates/win32hello/win32-Makefile.am5
-rw-r--r--languages/cpp/app_templates/win32hello/win32-Makefile.cvs8
-rw-r--r--languages/cpp/app_templates/win32hello/win32-configure.in10
-rw-r--r--languages/cpp/app_templates/win32hello/win32hello.kdevtemplate136
-rw-r--r--languages/cpp/app_templates/win32hello/win32hello.pngbin0 -> 4991 bytes
-rw-r--r--languages/cpp/app_templates/wxhello/.kdev_ignore0
-rw-r--r--languages/cpp/app_templates/wxhello/Makefile.am18
-rw-r--r--languages/cpp/app_templates/wxhello/app.cpp52
-rw-r--r--languages/cpp/app_templates/wxhello/app.desktop39
-rw-r--r--languages/cpp/app_templates/wxhello/app.h36
-rw-r--r--languages/cpp/app_templates/wxhello/app.kdevelop114
-rw-r--r--languages/cpp/app_templates/wxhello/src-Makefile.am14
-rw-r--r--languages/cpp/app_templates/wxhello/subdirs1
-rw-r--r--languages/cpp/app_templates/wxhello/wxhello105
-rw-r--r--languages/cpp/app_templates/wxhello/wxhello.kdevtemplate192
-rw-r--r--languages/cpp/app_templates/wxhello/wxhello.pngbin0 -> 3894 bytes
-rw-r--r--languages/cpp/ast_utils.cpp190
-rw-r--r--languages/cpp/ast_utils.h34
-rw-r--r--languages/cpp/backgroundparser.cpp552
-rw-r--r--languages/cpp/backgroundparser.h122
-rw-r--r--languages/cpp/bithelpers.h37
-rw-r--r--languages/cpp/ccconfigwidget.cpp590
-rw-r--r--languages/cpp/ccconfigwidget.h74
-rw-r--r--languages/cpp/ccconfigwidgetbase.ui1798
-rw-r--r--languages/cpp/classgeneratorconfig.cpp236
-rw-r--r--languages/cpp/classgeneratorconfig.h81
-rw-r--r--languages/cpp/classgeneratorconfigbase.ui261
-rw-r--r--languages/cpp/codecompletionentry.h57
-rw-r--r--languages/cpp/codeinformationrepository.cpp339
-rw-r--r--languages/cpp/codeinformationrepository.h58
-rw-r--r--languages/cpp/compiler/Makefile.am6
-rw-r--r--languages/cpp/compiler/gccoptions/Makefile.am20
-rw-r--r--languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp705
-rw-r--r--languages/cpp/compiler/gccoptions/gccoptionsplugin.h63
-rw-r--r--languages/cpp/compiler/gccoptions/kdevg77options.desktop56
-rw-r--r--languages/cpp/compiler/gccoptions/kdevgccoptions.desktop54
-rw-r--r--languages/cpp/compiler/gccoptions/kdevgppoptions.desktop56
-rw-r--r--languages/cpp/completiondebug.cpp56
-rw-r--r--languages/cpp/completiondebug.h221
-rw-r--r--languages/cpp/computerecoverypoints.h190
-rw-r--r--languages/cpp/configproblemreporter.ui189
-rw-r--r--languages/cpp/configproblemreporter.ui.h98
-rw-r--r--languages/cpp/configuration2
-rw-r--r--languages/cpp/cpp_tags.h432
-rw-r--r--languages/cpp/cppcodecompletion.cpp4492
-rw-r--r--languages/cpp/cppcodecompletion.h324
-rw-r--r--languages/cpp/cppcodecompletionconfig.cpp151
-rw-r--r--languages/cpp/cppcodecompletionconfig.h310
-rw-r--r--languages/cpp/cppevaluation.cpp483
-rw-r--r--languages/cpp/cppevaluation.h367
-rw-r--r--languages/cpp/cppimplementationwidget.cpp100
-rw-r--r--languages/cpp/cppimplementationwidget.h43
-rw-r--r--languages/cpp/cppnewclassdlg.cpp2242
-rw-r--r--languages/cpp/cppnewclassdlg.h292
-rw-r--r--languages/cpp/cppnewclassdlgbase.ui1290
-rw-r--r--languages/cpp/cppsplitheadersourceconfig.cpp82
-rw-r--r--languages/cpp/cppsplitheadersourceconfig.h74
-rw-r--r--languages/cpp/cppsupport_events.h75
-rw-r--r--languages/cpp/cppsupport_utils.cpp139
-rw-r--r--languages/cpp/cppsupport_utils.h28
-rw-r--r--languages/cpp/cppsupportfactory.cpp42
-rw-r--r--languages/cpp/cppsupportfactory.h33
-rw-r--r--languages/cpp/cppsupportpart.cpp3186
-rw-r--r--languages/cpp/cppsupportpart.h661
-rw-r--r--languages/cpp/cpptemplates22
-rw-r--r--languages/cpp/creategettersetter.ui232
-rw-r--r--languages/cpp/creategettersetterconfiguration.cpp62
-rw-r--r--languages/cpp/creategettersetterconfiguration.h117
-rw-r--r--languages/cpp/creategettersetterdialog.cpp122
-rw-r--r--languages/cpp/creategettersetterdialog.h41
-rw-r--r--languages/cpp/createpcsdialog.cpp358
-rw-r--r--languages/cpp/createpcsdialog.h59
-rw-r--r--languages/cpp/createpcsdialogbase.ui168
-rw-r--r--languages/cpp/debugger/DESIGN.txt113
-rw-r--r--languages/cpp/debugger/Makefile.am33
-rw-r--r--languages/cpp/debugger/TODO.txt218
-rw-r--r--languages/cpp/debugger/breakpoint.cpp719
-rw-r--r--languages/cpp/debugger/breakpoint.h313
-rw-r--r--languages/cpp/debugger/dbgcontroller.cpp40
-rw-r--r--languages/cpp/debugger/dbgcontroller.h128
-rw-r--r--languages/cpp/debugger/dbgpsdlg.cpp203
-rw-r--r--languages/cpp/debugger/dbgpsdlg.h59
-rw-r--r--languages/cpp/debugger/dbgtoolbar.cpp498
-rw-r--r--languages/cpp/debugger/dbgtoolbar.h85
-rw-r--r--languages/cpp/debugger/debuggerconfigwidget.cpp138
-rw-r--r--languages/cpp/debugger/debuggerconfigwidget.h43
-rw-r--r--languages/cpp/debugger/debuggerconfigwidgetbase.ui453
-rw-r--r--languages/cpp/debugger/debuggerdcopinterface.h29
-rw-r--r--languages/cpp/debugger/debuggerpart.cpp1272
-rw-r--r--languages/cpp/debugger/debuggerpart.h164
-rw-r--r--languages/cpp/debugger/debuggertracingdialog.cpp104
-rw-r--r--languages/cpp/debugger/debuggertracingdialog.h42
-rw-r--r--languages/cpp/debugger/debuggertracingdialogbase.ui141
-rw-r--r--languages/cpp/debugger/disassemblewidget.cpp173
-rw-r--r--languages/cpp/debugger/disassemblewidget.h69
-rw-r--r--languages/cpp/debugger/framestackwidget.cpp645
-rw-r--r--languages/cpp/debugger/framestackwidget.h183
-rw-r--r--languages/cpp/debugger/gdbbreakpointwidget.cpp1262
-rw-r--r--languages/cpp/debugger/gdbbreakpointwidget.h174
-rw-r--r--languages/cpp/debugger/gdbcommand.cpp142
-rw-r--r--languages/cpp/debugger/gdbcommand.h271
-rw-r--r--languages/cpp/debugger/gdbcontroller.cpp1860
-rw-r--r--languages/cpp/debugger/gdbcontroller.h358
-rw-r--r--languages/cpp/debugger/gdboutputwidget.cpp376
-rw-r--r--languages/cpp/debugger/gdboutputwidget.h137
-rw-r--r--languages/cpp/debugger/gdbparser.cpp432
-rw-r--r--languages/cpp/debugger/gdbparser.h59
-rw-r--r--languages/cpp/debugger/gdbtable.cpp55
-rw-r--r--languages/cpp/debugger/gdbtable.h39
-rw-r--r--languages/cpp/debugger/hi16-action-breakpoint_add.pngbin0 -> 225 bytes
-rw-r--r--languages/cpp/debugger/hi16-action-breakpoint_delete.pngbin0 -> 239 bytes
-rw-r--r--languages/cpp/debugger/hi16-action-breakpoint_delete_all.pngbin0 -> 239 bytes
-rw-r--r--languages/cpp/debugger/hi16-action-breakpoint_edit.pngbin0 -> 277 bytes
-rw-r--r--languages/cpp/debugger/kdevdebugger.desktop86
-rw-r--r--languages/cpp/debugger/kdevdebugger.rc93
-rw-r--r--languages/cpp/debugger/label_with_double_click.cpp14
-rw-r--r--languages/cpp/debugger/label_with_double_click.h20
-rw-r--r--languages/cpp/debugger/memviewdlg.cpp486
-rw-r--r--languages/cpp/debugger/memviewdlg.h118
-rw-r--r--languages/cpp/debugger/mi/Makefile.am12
-rw-r--r--languages/cpp/debugger/mi/gdbmi.cpp128
-rw-r--r--languages/cpp/debugger/mi/gdbmi.h221
-rw-r--r--languages/cpp/debugger/mi/milexer.cpp290
-rw-r--r--languages/cpp/debugger/mi/milexer.h147
-rw-r--r--languages/cpp/debugger/mi/miparser.cpp345
-rw-r--r--languages/cpp/debugger/mi/miparser.h82
-rw-r--r--languages/cpp/debugger/mi/tokens.h34
-rw-r--r--languages/cpp/debugger/stty.cpp386
-rw-r--r--languages/cpp/debugger/stty.h72
-rw-r--r--languages/cpp/debugger/tests/README.txt4
-rw-r--r--languages/cpp/debugger/tests/breakpoints/Makefile4
-rw-r--r--languages/cpp/debugger/tests/breakpoints/README.txt2
-rw-r--r--languages/cpp/debugger/tests/breakpoints/breakpoints.kdevelop163
-rw-r--r--languages/cpp/debugger/tests/breakpoints/foo.cpp10
-rw-r--r--languages/cpp/debugger/tests/breakpoints/main.cpp38
-rw-r--r--languages/cpp/debugger/tests/dll/Makefile8
-rw-r--r--languages/cpp/debugger/tests/dll/README.txt3
-rw-r--r--languages/cpp/debugger/tests/dll/dll.kdevelop158
-rw-r--r--languages/cpp/debugger/tests/dll/helper.cpp6
-rw-r--r--languages/cpp/debugger/tests/dll/main.cpp15
-rw-r--r--languages/cpp/debugger/tests/infinite_loop/Makefile4
-rw-r--r--languages/cpp/debugger/tests/infinite_loop/README.txt3
-rw-r--r--languages/cpp/debugger/tests/infinite_loop/infinite_loop.cpp17
-rw-r--r--languages/cpp/debugger/tests/infinite_loop/infinite_loop.kdevelop109
-rw-r--r--languages/cpp/debugger/tests/print_pointers/Makefile3
-rw-r--r--languages/cpp/debugger/tests/print_pointers/print_pointers.cpp95
-rw-r--r--languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop218
-rw-r--r--languages/cpp/debugger/tests/segfault/Makefile4
-rw-r--r--languages/cpp/debugger/tests/segfault/README.txt3
-rw-r--r--languages/cpp/debugger/tests/segfault/segfault.cpp7
-rw-r--r--languages/cpp/debugger/tests/segfault/segfault.kdevelop163
-rw-r--r--languages/cpp/debugger/tests/threads/Makefile4
-rw-r--r--languages/cpp/debugger/tests/threads/README.txt4
-rw-r--r--languages/cpp/debugger/tests/threads/threads.cpp26
-rw-r--r--languages/cpp/debugger/tests/threads/threads.kdevelop101
-rw-r--r--languages/cpp/debugger/tests/tracing/Makefile4
-rw-r--r--languages/cpp/debugger/tests/tracing/main.cpp15
-rw-r--r--languages/cpp/debugger/tests/tracing/tracing.kdevelop163
-rw-r--r--languages/cpp/debugger/tests/two_module/Makefile4
-rw-r--r--languages/cpp/debugger/tests/two_module/README.txt2
-rw-r--r--languages/cpp/debugger/tests/two_module/main.cpp8
-rw-r--r--languages/cpp/debugger/tests/two_module/src/foo.cpp12
-rw-r--r--languages/cpp/debugger/tests/two_module/two_module.kdevelop163
-rw-r--r--languages/cpp/debugger/variablewidget.cpp2002
-rw-r--r--languages/cpp/debugger/variablewidget.h466
-rw-r--r--languages/cpp/declarationinfo.h72
-rw-r--r--languages/cpp/doc/Makefile.am7
-rw-r--r--languages/cpp/doc/c++_bugs_gcc.toc7
-rw-r--r--languages/cpp/doc/clanlib.toc384
-rw-r--r--languages/cpp/doc/cppannotations.toc456
-rw-r--r--languages/cpp/doc/gnome1.toc424
-rw-r--r--languages/cpp/doc/gnustep.toc184
-rw-r--r--languages/cpp/doc/gtk_bugs.toc7
-rw-r--r--languages/cpp/doc/kde2book.toc2875
-rw-r--r--languages/cpp/doc/kdetemplates.toc9
-rw-r--r--languages/cpp/doc/libc.toc858
-rw-r--r--languages/cpp/doc/libstdc++.toc19
-rw-r--r--languages/cpp/doc/qt-kdev3.toc39
-rw-r--r--languages/cpp/doc/stl.toc487
-rw-r--r--languages/cpp/doc/wxwidgets_bugs.toc7
-rw-r--r--languages/cpp/doxydoc.cpp148
-rw-r--r--languages/cpp/doxydoc.h59
-rw-r--r--languages/cpp/expressioninfo.h99
-rw-r--r--languages/cpp/file_templates/Makefile.am3
-rw-r--r--languages/cpp/file_templates/c11
-rw-r--r--languages/cpp/file_templates/cpp11
-rw-r--r--languages/cpp/file_templates/h11
-rw-r--r--languages/cpp/file_templates/l35
-rw-r--r--languages/cpp/file_templates/ll42
-rw-r--r--languages/cpp/file_templates/y40
-rw-r--r--languages/cpp/file_templates/yy40
-rw-r--r--languages/cpp/includefiles.cpp2
-rw-r--r--languages/cpp/includefiles.h14
-rw-r--r--languages/cpp/includepathresolver.cpp577
-rw-r--r--languages/cpp/includepathresolver.h76
-rw-r--r--languages/cpp/kdevcppsupport.desktop86
-rw-r--r--languages/cpp/kdevcppsupport.rc30
-rw-r--r--languages/cpp/kdevcsupport.desktop85
-rw-r--r--languages/cpp/kdevdeepcopy.h14
-rw-r--r--languages/cpp/kdevdriver.cpp206
-rw-r--r--languages/cpp/kdevdriver.h58
-rw-r--r--languages/cpp/main.cpp283
-rw-r--r--languages/cpp/newclass_templates/Makefile.am4
-rw-r--r--languages/cpp/newclass_templates/cpp_header31
-rw-r--r--languages/cpp/newclass_templates/cpp_source9
-rw-r--r--languages/cpp/newclass_templates/gtk_header24
-rw-r--r--languages/cpp/newclass_templates/gtk_source35
-rw-r--r--languages/cpp/newclass_templates/objc_header11
-rw-r--r--languages/cpp/newclass_templates/objc_source4
-rw-r--r--languages/cpp/pcsimporter/Makefile.am3
-rw-r--r--languages/cpp/pcsimporter/customimporter/Makefile.am12
-rw-r--r--languages/cpp/pcsimporter/customimporter/kdevcustomimporter.cpp118
-rw-r--r--languages/cpp/pcsimporter/customimporter/kdevcustomimporter.h40
-rw-r--r--languages/cpp/pcsimporter/customimporter/kdevpcscustomimporter.desktop44
-rw-r--r--languages/cpp/pcsimporter/customimporter/settingsdialog.cpp107
-rw-r--r--languages/cpp/pcsimporter/customimporter/settingsdialog.h48
-rw-r--r--languages/cpp/pcsimporter/customimporter/settingsdialogbase.ui62
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/Makefile.am11
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.cpp119
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.desktop49
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.h40
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.cpp101
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.h44
-rw-r--r--languages/cpp/pcsimporter/kdelibsimporter/settingsdialogbase.ui131
-rw-r--r--languages/cpp/pcsimporter/qt4importer/Makefile.am11
-rw-r--r--languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp107
-rw-r--r--languages/cpp/pcsimporter/qt4importer/kdevqt4importer.desktop34
-rw-r--r--languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h39
-rw-r--r--languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp115
-rw-r--r--languages/cpp/pcsimporter/qt4importer/settingsdialog.h46
-rw-r--r--languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui79
-rw-r--r--languages/cpp/pcsimporter/qtimporter/Makefile.am11
-rw-r--r--languages/cpp/pcsimporter/qtimporter/kdevqtimporter.cpp73
-rw-r--r--languages/cpp/pcsimporter/qtimporter/kdevqtimporter.desktop37
-rw-r--r--languages/cpp/pcsimporter/qtimporter/kdevqtimporter.h37
-rw-r--r--languages/cpp/pcsimporter/qtimporter/settingsdialog.cpp122
-rw-r--r--languages/cpp/pcsimporter/qtimporter/settingsdialog.h46
-rw-r--r--languages/cpp/pcsimporter/qtimporter/settingsdialogbase.ui139
-rw-r--r--languages/cpp/problemreporter.cpp441
-rw-r--r--languages/cpp/problemreporter.h156
-rw-r--r--languages/cpp/qtbuildconfig.cpp216
-rw-r--r--languages/cpp/qtbuildconfig.h90
-rw-r--r--languages/cpp/qtdesignercppintegration.cpp218
-rw-r--r--languages/cpp/qtdesignercppintegration.h40
-rw-r--r--languages/cpp/safetycounter.h59
-rw-r--r--languages/cpp/setuphelper.cpp91
-rw-r--r--languages/cpp/setuphelper.h42
-rw-r--r--languages/cpp/simplecontext.cpp68
-rw-r--r--languages/cpp/simplecontext.h171
-rw-r--r--languages/cpp/simpletype.cpp1051
-rw-r--r--languages/cpp/simpletype.h819
-rw-r--r--languages/cpp/simpletypecachebinder.h348
-rw-r--r--languages/cpp/simpletypecatalog.cpp375
-rw-r--r--languages/cpp/simpletypecatalog.h119
-rw-r--r--languages/cpp/simpletypefunction.cpp726
-rw-r--r--languages/cpp/simpletypefunction.h341
-rw-r--r--languages/cpp/simpletypenamespace.cpp438
-rw-r--r--languages/cpp/simpletypenamespace.h165
-rw-r--r--languages/cpp/store_walker.cpp1081
-rw-r--r--languages/cpp/store_walker.h141
-rw-r--r--languages/cpp/storeconverter.cpp149
-rw-r--r--languages/cpp/storeconverter.h48
-rw-r--r--languages/cpp/stringhelpers.cpp299
-rw-r--r--languages/cpp/stringhelpers.h118
-rw-r--r--languages/cpp/subclassing_template/.kdev_ignore0
-rw-r--r--languages/cpp/subclassing_template/Makefile.am5
-rw-r--r--languages/cpp/subclassing_template/subclass_qt4_template.cpp16
-rw-r--r--languages/cpp/subclassing_template/subclass_qt4_template.h28
-rw-r--r--languages/cpp/subclassing_template/subclass_template.cpp15
-rw-r--r--languages/cpp/subclassing_template/subclass_template.h27
-rw-r--r--languages/cpp/subclassingdlg.cpp536
-rw-r--r--languages/cpp/subclassingdlg.h85
-rw-r--r--languages/cpp/subclassingdlgbase.ui244
-rw-r--r--languages/cpp/tag_creator.cpp884
-rw-r--r--languages/cpp/tag_creator.h131
-rw-r--r--languages/cpp/templates/Makefile.am2
-rw-r--r--languages/cpp/templates/default.cpp12
-rw-r--r--languages/cpp/templates/default.h12
-rw-r--r--languages/cpp/typedecoration.h119
-rw-r--r--languages/cpp/typedesc.cpp788
-rw-r--r--languages/cpp/typedesc.h403
-rw-r--r--languages/csharp/Makefile.am25
-rw-r--r--languages/csharp/README.dox46
-rw-r--r--languages/csharp/app_templates/Makefile.am3
-rw-r--r--languages/csharp/app_templates/csharp.appwizard2
-rw-r--r--languages/csharp/csharpconfigwidget.cpp38
-rw-r--r--languages/csharp/csharpconfigwidget.h34
-rw-r--r--languages/csharp/csharpconfigwidgetbase.ui101
-rw-r--r--languages/csharp/csharpdoc.cpp133
-rw-r--r--languages/csharp/csharpdoc.h25
-rw-r--r--languages/csharp/csharpdoc.protocol9
-rw-r--r--languages/csharp/csharpsupportpart.cpp331
-rw-r--r--languages/csharp/csharpsupportpart.h59
-rw-r--r--languages/csharp/doc/Makefile.am6
-rw-r--r--languages/csharp/file_templates/Makefile.am4
-rw-r--r--languages/csharp/kdevcsharpsupport.desktop57
-rw-r--r--languages/csharp/kdevcsharpsupport.rc14
-rw-r--r--languages/fortran/Makefile.am20
-rw-r--r--languages/fortran/README.dox48
-rw-r--r--languages/fortran/app_templates/Makefile.am3
-rw-r--r--languages/fortran/app_templates/fortran.appwizard2
-rw-r--r--languages/fortran/app_templates/fortranhello/.kdev_ignore0
-rw-r--r--languages/fortran/app_templates/fortranhello/Makefile.am17
-rw-r--r--languages/fortran/app_templates/fortranhello/app.kdevelop113
-rw-r--r--languages/fortran/app_templates/fortranhello/configure.in10
-rw-r--r--languages/fortran/app_templates/fortranhello/fortran-Makefile.am5
-rw-r--r--languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs8
-rw-r--r--languages/fortran/app_templates/fortranhello/fortranhello10
-rw-r--r--languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate140
-rw-r--r--languages/fortran/app_templates/fortranhello/fortranhello.pngbin0 -> 10118 bytes
-rw-r--r--languages/fortran/app_templates/fortranhello/main.f7
-rw-r--r--languages/fortran/app_templates/fortranhello/src-Makefile.am8
-rw-r--r--languages/fortran/compiler/Makefile.am6
-rw-r--r--languages/fortran/compiler/pgioptions/Makefile.am18
-rw-r--r--languages/fortran/compiler/pgioptions/kdevpgf77options.desktop53
-rw-r--r--languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop50
-rw-r--r--languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp69
-rw-r--r--languages/fortran/compiler/pgioptions/pgioptionsfactory.h34
-rw-r--r--languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp324
-rw-r--r--languages/fortran/compiler/pgioptions/pgioptionsplugin.h55
-rw-r--r--languages/fortran/doc/Makefile.am6
-rw-r--r--languages/fortran/doc/fortran_bugs_gcc.toc7
-rw-r--r--languages/fortran/file_templates/Makefile.am2
-rw-r--r--languages/fortran/file_templates/f11
-rw-r--r--languages/fortran/file_templates/f7711
-rw-r--r--languages/fortran/file_templates/f9011
-rw-r--r--languages/fortran/file_templates/f9511
-rw-r--r--languages/fortran/file_templates/for11
-rw-r--r--languages/fortran/file_templates/fpp11
-rw-r--r--languages/fortran/file_templates/ftn11
-rw-r--r--languages/fortran/fixedformparser.cpp94
-rw-r--r--languages/fortran/fixedformparser.h35
-rw-r--r--languages/fortran/fortransupportpart.cpp287
-rw-r--r--languages/fortran/fortransupportpart.h53
-rw-r--r--languages/fortran/ftnchekconfigwidget.cpp290
-rw-r--r--languages/fortran/ftnchekconfigwidget.h41
-rw-r--r--languages/fortran/ftnchekconfigwidgetbase.ui584
-rw-r--r--languages/fortran/kdevfortransupport.desktop80
-rw-r--r--languages/fortran/kdevfortransupport.rc9
-rw-r--r--languages/java/JavaAST.hpp77
-rw-r--r--languages/java/JavaLexer.cpp2183
-rw-r--r--languages/java/JavaLexer.hpp132
-rw-r--r--languages/java/JavaRecognizer.cpp6540
-rw-r--r--languages/java/JavaRecognizer.hpp423
-rw-r--r--languages/java/JavaStoreWalker.cpp3441
-rw-r--r--languages/java/JavaStoreWalker.hpp164
-rw-r--r--languages/java/JavaStoreWalkerTokenTypes.hpp169
-rw-r--r--languages/java/JavaStoreWalkerTokenTypes.txt151
-rw-r--r--languages/java/JavaTokenTypes.hpp168
-rw-r--r--languages/java/JavaTokenTypes.txt150
-rw-r--r--languages/java/KDevJavaSupportIface.cpp24
-rw-r--r--languages/java/KDevJavaSupportIface.h26
-rw-r--r--languages/java/Makefile.am37
-rw-r--r--languages/java/README.dox48
-rw-r--r--languages/java/app_templates/Makefile.am3
-rw-r--r--languages/java/app_templates/java.appwizard2
-rw-r--r--languages/java/app_templates/javahello/.kdev_ignore0
-rw-r--r--languages/java/app_templates/javahello/Main.java7
-rw-r--r--languages/java/app_templates/javahello/Makefile.am16
-rw-r--r--languages/java/app_templates/javahello/build.xml37
-rw-r--r--languages/java/app_templates/javahello/javahello11
-rw-r--r--languages/java/app_templates/javahello/javahello.filelist2
-rw-r--r--languages/java/app_templates/javahello/javahello.kdevelop69
-rw-r--r--languages/java/app_templates/javahello/javahello.kdevtemplate124
-rw-r--r--languages/java/app_templates/javahello/javahello.pngbin0 -> 483 bytes
-rw-r--r--languages/java/app_templates/kappjava/.kdev_ignore0
-rw-r--r--languages/java/app_templates/kappjava/Makefile.am17
-rw-r--r--languages/java/app_templates/kappjava/app.desktop41
-rw-r--r--languages/java/app_templates/kappjava/app.java281
-rw-r--r--languages/java/app_templates/kappjava/app.kdevelop88
-rw-r--r--languages/java/app_templates/kappjava/app_client.java28
-rw-r--r--languages/java/app_templates/kappjava/appui.rc8
-rw-r--r--languages/java/app_templates/kappjava/appview.java115
-rw-r--r--languages/java/app_templates/kappjava/kappjava10
-rw-r--r--languages/java/app_templates/kappjava/kappjava.kdevtemplate163
-rw-r--r--languages/java/app_templates/kappjava/kappjava.pngbin0 -> 5063 bytes
-rw-r--r--languages/java/app_templates/kappjava/pref.java52
-rw-r--r--languages/java/app_templates/kappjava/src-Makefile.am18
-rw-r--r--languages/java/app_templates/kappjava/subdirs3
-rw-r--r--languages/java/app_templates/superwaba/.kdev_ignore0
-rw-r--r--languages/java/app_templates/superwaba/Makefile.am16
-rw-r--r--languages/java/app_templates/superwaba/src-Makefile226
-rw-r--r--languages/java/app_templates/superwaba/superwaba54
-rw-r--r--languages/java/app_templates/superwaba/superwaba.kdevtemplate166
-rw-r--r--languages/java/app_templates/superwaba/superwaba.pngbin0 -> 1100 bytes
-rw-r--r--languages/java/app_templates/superwaba/sw.filelist1
-rw-r--r--languages/java/app_templates/superwaba/sw.java97
-rw-r--r--languages/java/app_templates/superwaba/sw.kdevelop94
-rw-r--r--languages/java/backgroundparser.cpp363
-rw-r--r--languages/java/backgroundparser.h86
-rw-r--r--languages/java/configproblemreporter.ui257
-rw-r--r--languages/java/configproblemreporter.ui.h74
-rw-r--r--languages/java/doc/Makefile.am6
-rw-r--r--languages/java/doc/java_bugs_gcc.toc7
-rw-r--r--languages/java/doc/java_bugs_sun.toc7
-rw-r--r--languages/java/doc/sw.toc146
-rw-r--r--languages/java/driver.cpp227
-rw-r--r--languages/java/driver.h139
-rw-r--r--languages/java/file_templates/Makefile.am4
-rw-r--r--languages/java/file_templates/java6
-rw-r--r--languages/java/java.g1318
-rw-r--r--languages/java/java.store.g521
-rw-r--r--languages/java/java.tree.g331
-rw-r--r--languages/java/javasupport_events.h60
-rw-r--r--languages/java/javasupport_utils.cpp52
-rw-r--r--languages/java/javasupport_utils.h21
-rw-r--r--languages/java/javasupportfactory.cpp39
-rw-r--r--languages/java/javasupportfactory.h31
-rw-r--r--languages/java/javasupportpart.cpp908
-rw-r--r--languages/java/javasupportpart.h165
-rw-r--r--languages/java/javatemplates3
-rw-r--r--languages/java/kdevdeepcopy.h12
-rw-r--r--languages/java/kdevdriver.cpp44
-rw-r--r--languages/java/kdevdriver.h30
-rw-r--r--languages/java/kdevjavasupport.desktop85
-rw-r--r--languages/java/kdevjavasupport.rc4
-rw-r--r--languages/java/newclass_templates/Makefile.am4
-rw-r--r--languages/java/newclass_templates/java_source9
-rw-r--r--languages/java/problemreporter.cpp299
-rw-r--r--languages/java/problemreporter.h74
-rw-r--r--languages/kjssupport/Makefile.am22
-rw-r--r--languages/kjssupport/jscodecompletion.cpp174
-rw-r--r--languages/kjssupport/jscodecompletion.h53
-rw-r--r--languages/kjssupport/kdevkjssupport.desktop54
-rw-r--r--languages/kjssupport/kdevkjssupport.rc11
-rw-r--r--languages/kjssupport/kjsproblems.cpp78
-rw-r--r--languages/kjssupport/kjsproblems.h43
-rw-r--r--languages/kjssupport/kjssupport_part.cpp448
-rw-r--r--languages/kjssupport/kjssupport_part.h85
-rw-r--r--languages/kjssupport/subclassing_template/Makefile.am3
-rw-r--r--languages/kjssupport/subclassing_template/subclass_template.js2
-rw-r--r--languages/kjssupport/subclassingdlg.cpp461
-rw-r--r--languages/kjssupport/subclassingdlg.h85
-rw-r--r--languages/kjssupport/subclassingdlgbase.ui253
-rw-r--r--languages/kjssupport/template/Makefile.am20
-rw-r--r--languages/kjssupport/template/app.js18
-rw-r--r--languages/kjssupport/template/app.kdevelop45
-rw-r--r--languages/kjssupport/template/jshello6
-rw-r--r--languages/kjssupport/template/script13
-rw-r--r--languages/kjssupport/x-javascript-source.desktop4
-rw-r--r--languages/lib/Makefile.am6
-rw-r--r--languages/lib/debugger/Mainpage.dox36
-rw-r--r--languages/lib/debugger/Makefile.am13
-rw-r--r--languages/lib/debugger/debugger.cpp209
-rw-r--r--languages/lib/debugger/debugger.h132
-rw-r--r--languages/lib/debugger/kdevdebugger.cpp182
-rw-r--r--languages/lib/debugger/kdevdebugger.h88
-rw-r--r--languages/lib/designer_integration/Mainpage.dox48
-rw-r--r--languages/lib/designer_integration/Makefile.am16
-rw-r--r--languages/lib/designer_integration/implementationwidget.cpp158
-rw-r--r--languages/lib/designer_integration/implementationwidget.h86
-rw-r--r--languages/lib/designer_integration/implementationwidgetbase.ui267
-rw-r--r--languages/lib/designer_integration/qtdesignerintegration.cpp195
-rw-r--r--languages/lib/designer_integration/qtdesignerintegration.h80
-rw-r--r--languages/lib/interfaces/Mainpage.dox10
-rw-r--r--languages/lib/interfaces/Makefile.am16
-rw-r--r--languages/lib/interfaces/kdeveloppcsimporter.desktop39
-rw-r--r--languages/lib/interfaces/kdevpcsimporter.cpp36
-rw-r--r--languages/lib/interfaces/kdevpcsimporter.h49
-rw-r--r--languages/pascal/Makefile.am33
-rw-r--r--languages/pascal/PascalAST.hpp51
-rw-r--r--languages/pascal/PascalLexer.cpp1309
-rw-r--r--languages/pascal/PascalLexer.hpp121
-rw-r--r--languages/pascal/PascalParser.cpp9744
-rw-r--r--languages/pascal/PascalParser.hpp422
-rw-r--r--languages/pascal/PascalStoreWalker.cpp3409
-rw-r--r--languages/pascal/PascalStoreWalker.hpp172
-rw-r--r--languages/pascal/PascalStoreWalkerTokenTypes.hpp206
-rw-r--r--languages/pascal/PascalStoreWalkerTokenTypes.txt188
-rw-r--r--languages/pascal/PascalTokenTypes.hpp206
-rw-r--r--languages/pascal/PascalTokenTypes.txt188
-rw-r--r--languages/pascal/README.dox26
-rw-r--r--languages/pascal/app_templates/Makefile.am3
-rw-r--r--languages/pascal/app_templates/fpcgtk/.kdev_ignore0
-rw-r--r--languages/pascal/app_templates/fpcgtk/Makefile.am16
-rw-r--r--languages/pascal/app_templates/fpcgtk/app.kdevelop86
-rw-r--r--languages/pascal/app_templates/fpcgtk/fpcgtk9
-rw-r--r--languages/pascal/app_templates/fpcgtk/fpcgtk.kdevtemplate114
-rw-r--r--languages/pascal/app_templates/fpcgtk/fpcgtk.pngbin0 -> 483 bytes
-rw-r--r--languages/pascal/app_templates/fpcgtk/main.pp84
-rw-r--r--languages/pascal/app_templates/fpchello/.kdev_ignore0
-rw-r--r--languages/pascal/app_templates/fpchello/Makefile.am16
-rw-r--r--languages/pascal/app_templates/fpchello/app.kdevelop86
-rw-r--r--languages/pascal/app_templates/fpchello/fpchello9
-rw-r--r--languages/pascal/app_templates/fpchello/fpchello.kdevtemplate115
-rw-r--r--languages/pascal/app_templates/fpchello/fpchello.pngbin0 -> 483 bytes
-rw-r--r--languages/pascal/app_templates/fpchello/main.pp5
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/.kdev_ignore0
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/Makefile.am16
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/app.kdevelop86
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/fpcsharedlib9
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.kdevtemplate115
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.pngbin0 -> 483 bytes
-rw-r--r--languages/pascal/app_templates/fpcsharedlib/main.pp11
-rw-r--r--languages/pascal/app_templates/pascal.appwizard2
-rw-r--r--languages/pascal/app_templates/pascalhello/.kdev_ignore0
-rw-r--r--languages/pascal/app_templates/pascalhello/Makefile.am16
-rw-r--r--languages/pascal/app_templates/pascalhello/app.kdevelop83
-rw-r--r--languages/pascal/app_templates/pascalhello/main.pp5
-rw-r--r--languages/pascal/app_templates/pascalhello/pascalhello10
-rw-r--r--languages/pascal/app_templates/pascalhello/pascalhello.kdevtemplate116
-rw-r--r--languages/pascal/app_templates/pascalhello/pascalhello.pngbin0 -> 10118 bytes
-rw-r--r--languages/pascal/backgroundparser.cpp95
-rw-r--r--languages/pascal/backgroundparser.h35
-rw-r--r--languages/pascal/compiler/Makefile.am6
-rw-r--r--languages/pascal/compiler/dccoptions/Makefile.am16
-rw-r--r--languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp114
-rw-r--r--languages/pascal/compiler/dccoptions/dccoptionsplugin.h56
-rw-r--r--languages/pascal/compiler/dccoptions/kdevdccoptions.desktop54
-rw-r--r--languages/pascal/compiler/dccoptions/optiontabs.cpp399
-rw-r--r--languages/pascal/compiler/dccoptions/optiontabs.h116
-rw-r--r--languages/pascal/compiler/fpcoptions/Makefile.am20
-rw-r--r--languages/pascal/compiler/fpcoptions/fpcoptionsplugin.cpp126
-rw-r--r--languages/pascal/compiler/fpcoptions/fpcoptionsplugin.h63
-rw-r--r--languages/pascal/compiler/fpcoptions/kdevfpcoptions.desktop55
-rw-r--r--languages/pascal/compiler/fpcoptions/optiontabs.cpp657
-rw-r--r--languages/pascal/compiler/fpcoptions/optiontabs.h161
-rw-r--r--languages/pascal/configproblemreporter.ui88
-rw-r--r--languages/pascal/doc/Makefile.am6
-rw-r--r--languages/pascal/doc/pascal_bugs_fp.toc7
-rw-r--r--languages/pascal/file_templates/Makefile.am2
-rw-r--r--languages/pascal/file_templates/dpr12
-rw-r--r--languages/pascal/file_templates/pas-program12
-rw-r--r--languages/pascal/file_templates/pas-unit19
-rw-r--r--languages/pascal/file_templates/pp-program12
-rw-r--r--languages/pascal/file_templates/pp-unit19
-rw-r--r--languages/pascal/kdevpascalsupport.desktop84
-rw-r--r--languages/pascal/kdevpascalsupport.rc3
-rw-r--r--languages/pascal/pascal.g1212
-rw-r--r--languages/pascal/pascal.tree.g468
-rw-r--r--languages/pascal/pascalsupport_part.cpp323
-rw-r--r--languages/pascal/pascalsupport_part.h62
-rw-r--r--languages/pascal/pascaltemplates30
-rw-r--r--languages/pascal/problemreporter.cpp289
-rw-r--r--languages/pascal/problemreporter.h78
-rw-r--r--languages/perl/Makefile.am25
-rw-r--r--languages/perl/README.dox46
-rw-r--r--languages/perl/app_templates/Makefile.am3
-rw-r--r--languages/perl/app_templates/perl.appwizard2
-rw-r--r--languages/perl/app_templates/perlhello/.kdev_ignore0
-rw-r--r--languages/perl/app_templates/perlhello/Makefile.am16
-rw-r--r--languages/perl/app_templates/perlhello/app.kdevelop77
-rwxr-xr-xlanguages/perl/app_templates/perlhello/app.pl43
-rw-r--r--languages/perl/app_templates/perlhello/perlhello10
-rw-r--r--languages/perl/app_templates/perlhello/perlhello.kdevtemplate108
-rw-r--r--languages/perl/app_templates/perlhello/perlhello.pngbin0 -> 17622 bytes
-rw-r--r--languages/perl/doc/Makefile.am6
-rw-r--r--languages/perl/doc/perl.toc54
-rw-r--r--languages/perl/doc/perl_bugs.toc7
-rw-r--r--languages/perl/file_templates/Makefile.am4
-rw-r--r--languages/perl/file_templates/pl43
-rw-r--r--languages/perl/file_templates/pm68
-rw-r--r--languages/perl/kdevperlsupport.desktop85
-rw-r--r--languages/perl/kdevperlsupport.rc14
-rw-r--r--languages/perl/perlconfigwidget.cpp38
-rw-r--r--languages/perl/perlconfigwidget.h34
-rw-r--r--languages/perl/perlconfigwidgetbase.ui101
-rw-r--r--languages/perl/perldoc.cpp133
-rw-r--r--languages/perl/perldoc.h25
-rw-r--r--languages/perl/perldoc.protocol9
-rw-r--r--languages/perl/perlparser.cpp494
-rw-r--r--languages/perl/perlparser.h87
-rw-r--r--languages/perl/perlsupportpart.cpp330
-rw-r--r--languages/perl/perlsupportpart.h59
-rw-r--r--languages/php/Makefile.am24
-rw-r--r--languages/php/README.dox32
-rw-r--r--languages/php/app_templates/Makefile.am3
-rw-r--r--languages/php/app_templates/php.appwizard2
-rw-r--r--languages/php/app_templates/phphello/.kdev_ignore0
-rw-r--r--languages/php/app_templates/phphello/Makefile.am16
-rw-r--r--languages/php/app_templates/phphello/app.kdevelop87
-rw-r--r--languages/php/app_templates/phphello/app.php28
-rw-r--r--languages/php/app_templates/phphello/phphello25
-rw-r--r--languages/php/app_templates/phphello/phphello.kdevtemplate108
-rw-r--r--languages/php/app_templates/phphello/phphello.pngbin0 -> 483 bytes
-rw-r--r--languages/php/data/Makefile.am6
-rw-r--r--languages/php/data/phpfunctions1657
-rw-r--r--languages/php/doc/Makefile.am6
-rw-r--r--languages/php/doc/php.toc7069
-rw-r--r--languages/php/doc/php_bugs.toc7
-rw-r--r--languages/php/file_templates/Makefile.am4
-rw-r--r--languages/php/file_templates/php12
-rw-r--r--languages/php/kdevphpsupport.desktop86
-rw-r--r--languages/php/kdevphpsupport.rc18
-rw-r--r--languages/php/phpcodecompletion.cpp712
-rw-r--r--languages/php/phpcodecompletion.h103
-rw-r--r--languages/php/phpconfigdata.cpp88
-rw-r--r--languages/php/phpconfigdata.h155
-rw-r--r--languages/php/phpconfigwidget.cpp161
-rw-r--r--languages/php/phpconfigwidget.h32
-rw-r--r--languages/php/phpconfigwidgetbase.ui561
-rw-r--r--languages/php/phperrorview.cpp422
-rw-r--r--languages/php/phperrorview.h104
-rw-r--r--languages/php/phpfile.cpp639
-rw-r--r--languages/php/phpfile.h119
-rw-r--r--languages/php/phphtmlview.cpp39
-rw-r--r--languages/php/phphtmlview.h42
-rw-r--r--languages/php/phpinfodlg.ui87
-rw-r--r--languages/php/phpnewclassdlg.cpp123
-rw-r--r--languages/php/phpnewclassdlg.h42
-rw-r--r--languages/php/phpnewclassdlgbase.ui201
-rw-r--r--languages/php/phpparser.cpp160
-rw-r--r--languages/php/phpparser.h73
-rw-r--r--languages/php/phpsupport_event.h110
-rw-r--r--languages/php/phpsupportpart.cpp751
-rw-r--r--languages/php/phpsupportpart.h133
-rw-r--r--languages/php/phptemplates4
-rw-r--r--languages/python/Makefile.am31
-rw-r--r--languages/python/README.dox48
-rw-r--r--languages/python/app_templates/Makefile.am3
-rw-r--r--languages/python/app_templates/pyqt/.kdev_ignore0
-rw-r--r--languages/python/app_templates/pyqt/Makefile.am20
-rw-r--r--languages/python/app_templates/pyqt/app-Makefile.am14
-rw-r--r--languages/python/app_templates/pyqt/app-autogen.sh10
-rw-r--r--languages/python/app_templates/pyqt/app-configure.ac32
-rw-r--r--languages/python/app_templates/pyqt/app.kdevelop81
-rw-r--r--languages/python/app_templates/pyqt/app.py271
-rw-r--r--languages/python/app_templates/pyqt/documentdetails.ui80
-rw-r--r--languages/python/app_templates/pyqt/fileopen.pyxpm19
-rw-r--r--languages/python/app_templates/pyqt/fileprint.pyxpm21
-rw-r--r--languages/python/app_templates/pyqt/filesave.pyxpm19
-rw-r--r--languages/python/app_templates/pyqt/install-sh0
-rw-r--r--languages/python/app_templates/pyqt/missing0
-rw-r--r--languages/python/app_templates/pyqt/mkinstalldirs0
-rw-r--r--languages/python/app_templates/pyqt/pyqt10
-rw-r--r--languages/python/app_templates/pyqt/pyqt-am-preproc.py85
-rw-r--r--languages/python/app_templates/pyqt/pyqt.kdevtemplate168
-rw-r--r--languages/python/app_templates/pyqt/pyqt.pngbin0 -> 8800 bytes
-rw-r--r--languages/python/app_templates/pyqt/templates-ui-dialog20
-rw-r--r--languages/python/app_templates/pyqt/templates-ui-mainwin436
-rw-r--r--languages/python/app_templates/python.appwizard2
-rw-r--r--languages/python/app_templates/pythonhello/.kdev_ignore0
-rw-r--r--languages/python/app_templates/pythonhello/Makefile.am15
-rw-r--r--languages/python/app_templates/pythonhello/app.kdevelop84
-rw-r--r--languages/python/app_templates/pythonhello/app.py7
-rw-r--r--languages/python/app_templates/pythonhello/pythonhello12
-rw-r--r--languages/python/app_templates/pythonhello/pythonhello.kdevtemplate107
-rw-r--r--languages/python/app_templates/pythonhello/pythonhello.pngbin0 -> 12443 bytes
-rw-r--r--languages/python/app_templates/pytk/.kdev_ignore0
-rw-r--r--languages/python/app_templates/pytk/Makefile.am15
-rw-r--r--languages/python/app_templates/pytk/app.kdevelop82
-rw-r--r--languages/python/app_templates/pytk/app.py4
-rw-r--r--languages/python/app_templates/pytk/pytk12
-rw-r--r--languages/python/app_templates/pytk/pytk.kdevtemplate107
-rw-r--r--languages/python/app_templates/pytk/pytk.pngbin0 -> 2420 bytes
-rw-r--r--languages/python/doc/Makefile.am6
-rw-r--r--languages/python/doc/python.toc1571
-rw-r--r--languages/python/doc/python_bugs.toc7
-rw-r--r--languages/python/file_templates/Makefile.am4
-rw-r--r--languages/python/file_templates/py7
-rwxr-xr-xlanguages/python/kde_pydoc.py131
-rw-r--r--languages/python/kdevpythonsupport.desktop85
-rw-r--r--languages/python/kdevpythonsupport.rc16
-rw-r--r--languages/python/pydoc.cpp113
-rw-r--r--languages/python/pydoc.h30
-rw-r--r--languages/python/pydoc.protocol9
-rw-r--r--languages/python/pythonconfigwidget.cpp38
-rw-r--r--languages/python/pythonconfigwidget.h34
-rw-r--r--languages/python/pythonconfigwidgetbase.ui121
-rw-r--r--languages/python/pythonimplementationwidget.cpp77
-rw-r--r--languages/python/pythonimplementationwidget.h37
-rw-r--r--languages/python/pythonsupportpart.cpp410
-rw-r--r--languages/python/pythonsupportpart.h66
-rw-r--r--languages/python/qtdesignerpythonintegration.cpp97
-rw-r--r--languages/python/qtdesignerpythonintegration.h37
-rw-r--r--languages/ruby/Makefile.am31
-rw-r--r--languages/ruby/README3
-rw-r--r--languages/ruby/README.dox43
-rw-r--r--languages/ruby/app_templates/Makefile.am3
-rw-r--r--languages/ruby/app_templates/dcopservice/Makefile.am18
-rw-r--r--languages/ruby/app_templates/dcopservice/app-configure.in.in51
-rw-r--r--languages/ruby/app_templates/dcopservice/app.cpp30
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopservice.desktop43
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopservice.kdevelop91
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopservice.rb37
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopserviceruby.kdevtemplate199
-rw-r--r--languages/ruby/app_templates/dcopservice/dcopserviceruby.pngbin0 -> 23880 bytes
-rw-r--r--languages/ruby/app_templates/dcopservice/main.rb30
-rw-r--r--languages/ruby/app_templates/dcopservice/src-Makefile.am15
-rw-r--r--languages/ruby/app_templates/dcopservice/subdirs3
-rw-r--r--languages/ruby/app_templates/kapp/Makefile.am19
-rw-r--r--languages/ruby/app_templates/kapp/README81
-rw-r--r--languages/ruby/app_templates/kapp/app-Makefile.am1
-rw-r--r--languages/ruby/app_templates/kapp/app-configure.in.in45
-rw-r--r--languages/ruby/app_templates/kapp/app.cpp30
-rw-r--r--languages/ruby/app_templates/kapp/app.desktop44
-rw-r--r--languages/ruby/app_templates/kapp/app.kdevelop90
-rw-r--r--languages/ruby/app_templates/kapp/app.rb216
-rw-r--r--languages/ruby/app_templates/kapp/app_client.rb18
-rw-r--r--languages/ruby/app_templates/kapp/appiface.rb14
-rw-r--r--languages/ruby/app_templates/kapp/appui.rc8
-rw-r--r--languages/ruby/app_templates/kapp/appview.rb103
-rw-r--r--languages/ruby/app_templates/kapp/kappruby.kdevtemplate238
-rw-r--r--languages/ruby/app_templates/kapp/kappruby.pngbin0 -> 5063 bytes
-rw-r--r--languages/ruby/app_templates/kapp/main.rb40
-rw-r--r--languages/ruby/app_templates/kapp/pref.rb38
-rw-r--r--languages/ruby/app_templates/kapp/src-Makefile.am43
-rw-r--r--languages/ruby/app_templates/kapp/subdirs3
-rw-r--r--languages/ruby/app_templates/kxt/Makefile.am20
-rw-r--r--languages/ruby/app_templates/kxt/README38
-rw-r--r--languages/ruby/app_templates/kxt/app-Makefile.am1
-rw-r--r--languages/ruby/app_templates/kxt/app-configure.in.in45
-rw-r--r--languages/ruby/app_templates/kxt/app.cpp30
-rw-r--r--languages/ruby/app_templates/kxt/app.desktop40
-rw-r--r--languages/ruby/app_templates/kxt/app.kcfg21
-rw-r--r--languages/ruby/app_templates/kxt/app.kdevelop90
-rw-r--r--languages/ruby/app_templates/kxt/app.rb94
-rw-r--r--languages/ruby/app_templates/kxt/appui.rc8
-rw-r--r--languages/ruby/app_templates/kxt/appview.rb55
-rw-r--r--languages/ruby/app_templates/kxt/appview_base.ui33
-rw-r--r--languages/ruby/app_templates/kxt/kxtruby.kdevtemplate251
-rw-r--r--languages/ruby/app_templates/kxt/kxtruby.pngbin0 -> 7841 bytes
-rw-r--r--languages/ruby/app_templates/kxt/main.rb41
-rw-r--r--languages/ruby/app_templates/kxt/prefs-base.ui127
-rw-r--r--languages/ruby/app_templates/kxt/prefs.rb7
-rw-r--r--languages/ruby/app_templates/kxt/previewruby.pngbin0 -> 7712 bytes
-rw-r--r--languages/ruby/app_templates/kxt/settings.kcfgc6
-rw-r--r--languages/ruby/app_templates/kxt/src-Makefile.am48
-rw-r--r--languages/ruby/app_templates/kxt/subdirs3
-rw-r--r--languages/ruby/app_templates/qtruby/.kdev_ignore0
-rw-r--r--languages/ruby/app_templates/qtruby/Makefile.am16
-rw-r--r--languages/ruby/app_templates/qtruby/README29
-rw-r--r--languages/ruby/app_templates/qtruby/app-Makefile7
-rw-r--r--languages/ruby/app_templates/qtruby/app.filelist2
-rw-r--r--languages/ruby/app_templates/qtruby/app.kdevelop85
-rwxr-xr-xlanguages/ruby/app_templates/qtruby/app.rb12
-rw-r--r--languages/ruby/app_templates/qtruby/qtruby.kdevtemplate114
-rw-r--r--languages/ruby/app_templates/qtruby/qtruby.pngbin0 -> 3435 bytes
-rw-r--r--languages/ruby/app_templates/qtruby4app/Makefile.am20
-rw-r--r--languages/ruby/app_templates/qtruby4app/ReadMe6
-rw-r--r--languages/ruby/app_templates/qtruby4app/app-Makefile18
-rw-r--r--languages/ruby/app_templates/qtruby4app/app.filelist3
-rw-r--r--languages/ruby/app_templates/qtruby4app/application.qrc10
-rw-r--r--languages/ruby/app_templates/qtruby4app/editcopy.xpm193
-rw-r--r--languages/ruby/app_templates/qtruby4app/editcut.xpm252
-rw-r--r--languages/ruby/app_templates/qtruby4app/editpaste.xpm295
-rw-r--r--languages/ruby/app_templates/qtruby4app/filenew.xpm216
-rw-r--r--languages/ruby/app_templates/qtruby4app/fileopen.xpm295
-rw-r--r--languages/ruby/app_templates/qtruby4app/filesave.xpm295
-rw-r--r--languages/ruby/app_templates/qtruby4app/main.rb10
-rw-r--r--languages/ruby/app_templates/qtruby4app/qrc_application.rb2281
-rw-r--r--languages/ruby/app_templates/qtruby4app/qtruby4app.kdevelop83
-rw-r--r--languages/ruby/app_templates/qtruby4app/qtruby4app.kdevtemplate166
-rw-r--r--languages/ruby/app_templates/qtruby4app/qtruby4app.pngbin0 -> 16908 bytes
-rw-r--r--languages/ruby/app_templates/qtruby4app/qtruby4app.rb263
-rw-r--r--languages/ruby/app_templates/qtrubyapp/Makefile.am18
-rw-r--r--languages/ruby/app_templates/qtrubyapp/README29
-rw-r--r--languages/ruby/app_templates/qtrubyapp/app-Makefile7
-rw-r--r--languages/ruby/app_templates/qtrubyapp/app.filelist3
-rw-r--r--languages/ruby/app_templates/qtrubyapp/fileopen.xpm22
-rw-r--r--languages/ruby/app_templates/qtrubyapp/fileprint.xpm24
-rw-r--r--languages/ruby/app_templates/qtrubyapp/filesave.xpm22
-rw-r--r--languages/ruby/app_templates/qtrubyapp/main.rb10
-rw-r--r--languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevelop83
-rw-r--r--languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate140
-rw-r--r--languages/ruby/app_templates/qtrubyapp/qtrubyapp.pngbin0 -> 5245 bytes
-rw-r--r--languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb253
-rw-r--r--languages/ruby/app_templates/rails/CMakeLists.txt20
-rw-r--r--languages/ruby/app_templates/rails/Makefile.am16
-rw-r--r--languages/ruby/app_templates/rails/app.kdevelop107
-rw-r--r--languages/ruby/app_templates/rails/rails.kdevtemplate72
-rw-r--r--languages/ruby/app_templates/rails/rails.pngbin0 -> 12062 bytes
-rw-r--r--languages/ruby/app_templates/ruby.appwizard2
-rw-r--r--languages/ruby/app_templates/rubyhello/.kdev_ignore0
-rw-r--r--languages/ruby/app_templates/rubyhello/Makefile.am16
-rw-r--r--languages/ruby/app_templates/rubyhello/app.kdevelop91
-rw-r--r--languages/ruby/app_templates/rubyhello/app.rb3
-rw-r--r--languages/ruby/app_templates/rubyhello/rubyhello9
-rw-r--r--languages/ruby/app_templates/rubyhello/rubyhello.kdevtemplate105
-rw-r--r--languages/ruby/app_templates/rubyhello/rubyhello.pngbin0 -> 483 bytes
-rw-r--r--languages/ruby/debugger/Makefile.am25
-rw-r--r--languages/ruby/debugger/breakpoint.cpp343
-rw-r--r--languages/ruby/debugger/breakpoint.h214
-rw-r--r--languages/ruby/debugger/dbgcommand.cpp47
-rw-r--r--languages/ruby/debugger/dbgcommand.h64
-rw-r--r--languages/ruby/debugger/dbgcontroller.cpp46
-rw-r--r--languages/ruby/debugger/dbgcontroller.h161
-rw-r--r--languages/ruby/debugger/dbgpsdlg.cpp170
-rw-r--r--languages/ruby/debugger/dbgpsdlg.h60
-rw-r--r--languages/ruby/debugger/dbgtoolbar.cpp483
-rw-r--r--languages/ruby/debugger/dbgtoolbar.h90
-rw-r--r--languages/ruby/debugger/debuggee.rb1214
-rw-r--r--languages/ruby/debugger/debuggerpart.cpp785
-rw-r--r--languages/ruby/debugger/debuggerpart.h110
-rw-r--r--languages/ruby/debugger/framestackwidget.cpp272
-rw-r--r--languages/ruby/debugger/framestackwidget.h115
-rw-r--r--languages/ruby/debugger/hi16-action-breakpoint_add.pngbin0 -> 225 bytes
-rw-r--r--languages/ruby/debugger/hi16-action-breakpoint_delete.pngbin0 -> 239 bytes
-rw-r--r--languages/ruby/debugger/hi16-action-breakpoint_delete_all.pngbin0 -> 239 bytes
-rw-r--r--languages/ruby/debugger/hi16-action-breakpoint_edit.pngbin0 -> 277 bytes
-rw-r--r--languages/ruby/debugger/kdevrbdebugger.desktop73
-rw-r--r--languages/ruby/debugger/kdevrbdebugger.rc68
-rw-r--r--languages/ruby/debugger/rdbbreakpointwidget.cpp921
-rw-r--r--languages/ruby/debugger/rdbbreakpointwidget.h120
-rw-r--r--languages/ruby/debugger/rdbcommand.cpp81
-rw-r--r--languages/ruby/debugger/rdbcommand.h99
-rw-r--r--languages/ruby/debugger/rdbcontroller.cpp1414
-rw-r--r--languages/ruby/debugger/rdbcontroller.h192
-rw-r--r--languages/ruby/debugger/rdboutputwidget.cpp171
-rw-r--r--languages/ruby/debugger/rdboutputwidget.h69
-rw-r--r--languages/ruby/debugger/rdbparser.cpp350
-rw-r--r--languages/ruby/debugger/rdbparser.h41
-rw-r--r--languages/ruby/debugger/rdbtable.cpp62
-rw-r--r--languages/ruby/debugger/rdbtable.h45
-rw-r--r--languages/ruby/debugger/stty.cpp370
-rw-r--r--languages/ruby/debugger/stty.h71
-rw-r--r--languages/ruby/debugger/variablewidget.cpp1018
-rw-r--r--languages/ruby/debugger/variablewidget.h348
-rw-r--r--languages/ruby/doc/Makefile.am6
-rw-r--r--languages/ruby/doc/qtruby.toc9
-rw-r--r--languages/ruby/doc/rails.toc9
-rw-r--r--languages/ruby/doc/ruby.toc1399
-rw-r--r--languages/ruby/doc/ruby_bugs.toc7
-rw-r--r--languages/ruby/file_templates/Makefile.am5
-rw-r--r--languages/ruby/file_templates/css11
-rw-r--r--languages/ruby/file_templates/html.erb4
-rw-r--r--languages/ruby/file_templates/js11
-rw-r--r--languages/ruby/file_templates/js.rjs7
-rw-r--r--languages/ruby/file_templates/rb7
-rw-r--r--languages/ruby/file_templates/rhtml4
-rw-r--r--languages/ruby/file_templates/rjs7
-rw-r--r--languages/ruby/file_templates/rxml7
-rw-r--r--languages/ruby/file_templates/xml.builder7
-rw-r--r--languages/ruby/kdevrubysupport.desktop84
-rw-r--r--languages/ruby/kdevrubysupport.rc20
-rw-r--r--languages/ruby/play_run.psdbin0 -> 58270 bytes
-rw-r--r--languages/ruby/qtdesignerrubyintegration.cpp93
-rw-r--r--languages/ruby/qtdesignerrubyintegration.h35
-rw-r--r--languages/ruby/ruby_config.pngbin0 -> 12433 bytes
-rw-r--r--languages/ruby/ruby_config.psdbin0 -> 55515 bytes
-rw-r--r--languages/ruby/ruby_run.pngbin0 -> 6986 bytes
-rw-r--r--languages/ruby/rubyconfigwidget.cpp53
-rw-r--r--languages/ruby/rubyconfigwidget.h27
-rw-r--r--languages/ruby/rubyconfigwidgetbase.ui363
-rw-r--r--languages/ruby/rubyimplementationwidget.cpp70
-rw-r--r--languages/ruby/rubyimplementationwidget.h35
-rw-r--r--languages/ruby/rubysupport_part.cpp908
-rw-r--r--languages/ruby/rubysupport_part.h74
-rw-r--r--languages/ruby/rubytemplates101
-rw-r--r--languages/sql/Makefile.am20
-rw-r--r--languages/sql/README.dox40
-rw-r--r--languages/sql/app_templates/Makefile.am3
-rw-r--r--languages/sql/app_templates/sql.appwizard2
-rw-r--r--languages/sql/app_templates/sqlsimple/.kdev_ignore0
-rw-r--r--languages/sql/app_templates/sqlsimple/Makefile.am16
-rw-r--r--languages/sql/app_templates/sqlsimple/app.kdevelop84
-rw-r--r--languages/sql/app_templates/sqlsimple/app.sql1
-rw-r--r--languages/sql/app_templates/sqlsimple/sqlsimple7
-rw-r--r--languages/sql/app_templates/sqlsimple/sqlsimple.kdevtemplate106
-rw-r--r--languages/sql/app_templates/sqlsimple/sqlsimple.pngbin0 -> 483 bytes
-rw-r--r--languages/sql/doc/Makefile.am6
-rw-r--r--languages/sql/kdevsqlsupport.desktop85
-rw-r--r--languages/sql/kdevsqlsupport.rc14
-rw-r--r--languages/sql/sqlactions.cpp103
-rw-r--r--languages/sql/sqlactions.h41
-rw-r--r--languages/sql/sqlconfigwidget.ui189
-rw-r--r--languages/sql/sqlconfigwidget.ui.h244
-rw-r--r--languages/sql/sqloutputwidget.cpp127
-rw-r--r--languages/sql/sqloutputwidget.h43
-rw-r--r--languages/sql/sqlsupport_part.cpp284
-rw-r--r--languages/sql/sqlsupport_part.h55
-rw-r--r--lib/Makefile.am23
-rw-r--r--lib/antlr/AUTHORS2
-rw-r--r--lib/antlr/COPYING32
-rw-r--r--lib/antlr/ChangeLog293
-rw-r--r--lib/antlr/INSTALL183
-rw-r--r--lib/antlr/Makefile.am1
-rw-r--r--lib/antlr/NEWS0
-rw-r--r--lib/antlr/README72
-rw-r--r--lib/antlr/TODO34
-rw-r--r--lib/antlr/antlr/ANTLRException.hpp59
-rw-r--r--lib/antlr/antlr/ANTLRUtil.hpp53
-rw-r--r--lib/antlr/antlr/AST.hpp166
-rw-r--r--lib/antlr/antlr/ASTArray.hpp45
-rw-r--r--lib/antlr/antlr/ASTFactory.hpp165
-rw-r--r--lib/antlr/antlr/ASTNULLType.hpp64
-rw-r--r--lib/antlr/antlr/ASTPair.hpp57
-rw-r--r--lib/antlr/antlr/ASTRefCount.hpp98
-rw-r--r--lib/antlr/antlr/BaseAST.hpp193
-rw-r--r--lib/antlr/antlr/BitSet.hpp60
-rw-r--r--lib/antlr/antlr/CharBuffer.hpp56
-rw-r--r--lib/antlr/antlr/CharInputBuffer.hpp77
-rw-r--r--lib/antlr/antlr/CharScanner.hpp575
-rw-r--r--lib/antlr/antlr/CharStreamException.hpp29
-rw-r--r--lib/antlr/antlr/CharStreamIOException.hpp31
-rw-r--r--lib/antlr/antlr/CircularQueue.hpp100
-rw-r--r--lib/antlr/antlr/CommonAST.hpp110
-rw-r--r--lib/antlr/antlr/CommonASTWithHiddenTokens.hpp60
-rw-r--r--lib/antlr/antlr/CommonHiddenStreamToken.hpp41
-rw-r--r--lib/antlr/antlr/CommonToken.hpp83
-rw-r--r--lib/antlr/antlr/IOException.hpp45
-rw-r--r--lib/antlr/antlr/InputBuffer.hpp146
-rw-r--r--lib/antlr/antlr/LLkParser.hpp67
-rw-r--r--lib/antlr/antlr/LexerSharedInputState.hpp156
-rw-r--r--lib/antlr/antlr/Makefile.am2
-rw-r--r--lib/antlr/antlr/MismatchedCharException.hpp102
-rw-r--r--lib/antlr/antlr/MismatchedTokenException.hpp144
-rw-r--r--lib/antlr/antlr/NoViableAltException.hpp40
-rw-r--r--lib/antlr/antlr/NoViableAltForCharException.hpp41
-rw-r--r--lib/antlr/antlr/Parser.hpp319
-rw-r--r--lib/antlr/antlr/ParserSharedInputState.hpp92
-rw-r--r--lib/antlr/antlr/RecognitionException.hpp66
-rw-r--r--lib/antlr/antlr/RefCount.hpp80
-rw-r--r--lib/antlr/antlr/SemanticException.hpp40
-rw-r--r--lib/antlr/antlr/String.hpp27
-rw-r--r--lib/antlr/antlr/Token.hpp108
-rw-r--r--lib/antlr/antlr/TokenBuffer.hpp121
-rw-r--r--lib/antlr/antlr/TokenRefCount.hpp98
-rw-r--r--lib/antlr/antlr/TokenStream.hpp34
-rw-r--r--lib/antlr/antlr/TokenStreamBasicFilter.hpp46
-rw-r--r--lib/antlr/antlr/TokenStreamException.hpp41
-rw-r--r--lib/antlr/antlr/TokenStreamHiddenTokenFilter.hpp95
-rw-r--r--lib/antlr/antlr/TokenStreamIOException.hpp40
-rw-r--r--lib/antlr/antlr/TokenStreamRecognitionException.hpp57
-rw-r--r--lib/antlr/antlr/TokenStreamRetryException.hpp28
-rw-r--r--lib/antlr/antlr/TokenStreamRewriteEngine.hpp439
-rw-r--r--lib/antlr/antlr/TokenStreamSelector.hpp87
-rw-r--r--lib/antlr/antlr/TokenWithIndex.hpp84
-rw-r--r--lib/antlr/antlr/TreeParser.hpp155
-rw-r--r--lib/antlr/antlr/TreeParserSharedInputState.hpp45
-rw-r--r--lib/antlr/antlr/config.hpp290
-rw-r--r--lib/antlr/src/ANTLRUtil.cpp163
-rw-r--r--lib/antlr/src/ASTFactory.cpp504
-rw-r--r--lib/antlr/src/ASTNULLType.cpp157
-rw-r--r--lib/antlr/src/ASTRefCount.cpp41
-rw-r--r--lib/antlr/src/BaseAST.cpp281
-rw-r--r--lib/antlr/src/BitSet.cpp62
-rw-r--r--lib/antlr/src/CharBuffer.cpp52
-rw-r--r--lib/antlr/src/CharScanner.cpp108
-rw-r--r--lib/antlr/src/CommonAST.cpp49
-rw-r--r--lib/antlr/src/CommonASTWithHiddenTokens.cpp64
-rw-r--r--lib/antlr/src/CommonHiddenStreamToken.cpp56
-rw-r--r--lib/antlr/src/CommonToken.cpp45
-rw-r--r--lib/antlr/src/InputBuffer.cpp81
-rw-r--r--lib/antlr/src/LLkParser.cpp85
-rw-r--r--lib/antlr/src/Makefile.am10
-rw-r--r--lib/antlr/src/MismatchedCharException.cpp120
-rw-r--r--lib/antlr/src/MismatchedTokenException.cpp196
-rw-r--r--lib/antlr/src/NoViableAltException.cpp52
-rw-r--r--lib/antlr/src/NoViableAltForCharException.cpp39
-rw-r--r--lib/antlr/src/Parser.cpp113
-rw-r--r--lib/antlr/src/RecognitionException.cpp71
-rw-r--r--lib/antlr/src/String.cpp90
-rw-r--r--lib/antlr/src/Token.cpp80
-rw-r--r--lib/antlr/src/TokenBuffer.cpp96
-rw-r--r--lib/antlr/src/TokenRefCount.cpp41
-rw-r--r--lib/antlr/src/TokenStreamBasicFilter.cpp44
-rw-r--r--lib/antlr/src/TokenStreamHiddenTokenFilter.cpp156
-rw-r--r--lib/antlr/src/TokenStreamRewriteEngine.cpp214
-rw-r--r--lib/antlr/src/TokenStreamSelector.cpp107
-rw-r--r--lib/antlr/src/TreeParser.cpp72
-rw-r--r--lib/astyle/ASBeautifier.cpp1933
-rw-r--r--lib/astyle/ASEnhancer.cpp483
-rw-r--r--lib/astyle/ASFormatter.cpp2197
-rw-r--r--lib/astyle/ASResource.cpp389
-rw-r--r--lib/astyle/Makefile.am4
-rw-r--r--lib/astyle/astyle.h497
-rw-r--r--lib/astyle/compiler_defines.h49
-rw-r--r--lib/catalog/Mainpage.dox10
-rw-r--r--lib/catalog/Makefile.am13
-rw-r--r--lib/catalog/catalog.cpp462
-rw-r--r--lib/catalog/catalog.h80
-rw-r--r--lib/catalog/tag.cpp127
-rw-r--r--lib/catalog/tag.h309
-rw-r--r--lib/cppparser/Makefile.am11
-rw-r--r--lib/cppparser/ast.cpp1262
-rw-r--r--lib/cppparser/ast.h1578
-rw-r--r--lib/cppparser/cachemanager.cpp89
-rw-r--r--lib/cppparser/cachemanager.h102
-rw-r--r--lib/cppparser/driver.cpp965
-rw-r--r--lib/cppparser/driver.h460
-rw-r--r--lib/cppparser/errors.cpp25
-rw-r--r--lib/cppparser/errors.h45
-rw-r--r--lib/cppparser/keywords.h95
-rw-r--r--lib/cppparser/lexer.cpp1032
-rw-r--r--lib/cppparser/lexer.h867
-rw-r--r--lib/cppparser/lexercache.cpp249
-rw-r--r--lib/cppparser/lexercache.h162
-rw-r--r--lib/cppparser/lookup.cpp42
-rw-r--r--lib/cppparser/lookup.h45
-rw-r--r--lib/cppparser/macro.h452
-rw-r--r--lib/cppparser/parser.cpp4330
-rw-r--r--lib/cppparser/parser.h459
-rw-r--r--lib/cppparser/tree_parser.cpp212
-rw-r--r--lib/cppparser/tree_parser.h60
-rw-r--r--lib/dummy.cpp1
-rw-r--r--lib/interfaces/KDevCoreIface.cpp59
-rw-r--r--lib/interfaces/KDevCoreIface.h51
-rw-r--r--lib/interfaces/KDevPartControllerIface.cpp95
-rw-r--r--lib/interfaces/KDevPartControllerIface.h63
-rw-r--r--lib/interfaces/Mainpage.dox10
-rw-r--r--lib/interfaces/Makefile.am40
-rw-r--r--lib/interfaces/codemodel.cpp1823
-rw-r--r--lib/interfaces/codemodel.h1612
-rw-r--r--lib/interfaces/codemodel_treeparser.cpp108
-rw-r--r--lib/interfaces/codemodel_treeparser.h85
-rw-r--r--lib/interfaces/codemodel_utils.cpp747
-rw-r--r--lib/interfaces/codemodel_utils.h570
-rw-r--r--lib/interfaces/extensions/Mainpage.dox61
-rw-r--r--lib/interfaces/extensions/Makefile.am23
-rw-r--r--lib/interfaces/extensions/codebrowserfrontend.h40
-rw-r--r--lib/interfaces/extensions/dcop/KDevAppFrontendIface.cpp76
-rw-r--r--lib/interfaces/extensions/dcop/KDevAppFrontendIface.h52
-rw-r--r--lib/interfaces/extensions/dcop/KDevMakeFrontendIface.cpp46
-rw-r--r--lib/interfaces/extensions/dcop/KDevMakeFrontendIface.h45
-rw-r--r--lib/interfaces/extensions/dcop/Makefile.am10
-rw-r--r--lib/interfaces/extensions/kdevappfrontend.cpp2
-rw-r--r--lib/interfaces/extensions/kdevappfrontend.h115
-rw-r--r--lib/interfaces/extensions/kdevcreatefile.h146
-rw-r--r--lib/interfaces/extensions/kdevdifffrontend.cpp33
-rw-r--r--lib/interfaces/extensions/kdevdifffrontend.h79
-rw-r--r--lib/interfaces/extensions/kdevelopappfrontend.desktop38
-rw-r--r--lib/interfaces/extensions/kdevelopcodebrowserfrontend.desktop28
-rw-r--r--lib/interfaces/extensions/kdevelopcreatefile.desktop38
-rw-r--r--lib/interfaces/extensions/kdevelopdifffrontend.desktop41
-rw-r--r--lib/interfaces/extensions/kdevelopmakefrontend.desktop41
-rw-r--r--lib/interfaces/extensions/kdevelopquickopen.desktop58
-rw-r--r--lib/interfaces/extensions/kdevelopsourceformatter.desktop39
-rw-r--r--lib/interfaces/extensions/kdevelopversioncontrol.desktop40
-rw-r--r--lib/interfaces/extensions/kdevmakefrontend.cpp2
-rw-r--r--lib/interfaces/extensions/kdevmakefrontend.h106
-rw-r--r--lib/interfaces/extensions/kdevquickopen.h130
-rw-r--r--lib/interfaces/extensions/kdevsourceformatter.h69
-rw-r--r--lib/interfaces/extensions/kdevversioncontrol.h237
-rw-r--r--lib/interfaces/external/Mainpage.dox57
-rw-r--r--lib/interfaces/external/Makefile.am15
-rw-r--r--lib/interfaces/external/designer.cpp30
-rw-r--r--lib/interfaces/external/designer.h98
-rw-r--r--lib/interfaces/extras/Mainpage.dox11
-rw-r--r--lib/interfaces/extras/Makefile.am18
-rw-r--r--lib/interfaces/extras/kdevcompileroptions.cpp6
-rw-r--r--lib/interfaces/extras/kdevcompileroptions.h90
-rw-r--r--lib/interfaces/extras/kdevelopcompileroptions.desktop48
-rw-r--r--lib/interfaces/extras/kdevelopvcsintegrator.desktop45
-rw-r--r--lib/interfaces/extras/kdevvcsintegrator.cpp26
-rw-r--r--lib/interfaces/extras/kdevvcsintegrator.h76
-rw-r--r--lib/interfaces/hashedstring.cpp362
-rw-r--r--lib/interfaces/hashedstring.h155
-rw-r--r--lib/interfaces/katedocumentmanagerinterface.cpp104
-rw-r--r--lib/interfaces/katedocumentmanagerinterface.h58
-rw-r--r--lib/interfaces/kdevapi.cpp93
-rw-r--r--lib/interfaces/kdevapi.h103
-rw-r--r--lib/interfaces/kdevcoderepository.cpp71
-rw-r--r--lib/interfaces/kdevcoderepository.h94
-rw-r--r--lib/interfaces/kdevcore.cpp298
-rw-r--r--lib/interfaces/kdevcore.h387
-rw-r--r--lib/interfaces/kdevdesignerintegration.cpp40
-rw-r--r--lib/interfaces/kdevdesignerintegration.h97
-rw-r--r--lib/interfaces/kdevdesignerintegrationiface.cpp63
-rw-r--r--lib/interfaces/kdevdesignerintegrationiface.h49
-rw-r--r--lib/interfaces/kdeveloplanguagesupport.desktop41
-rw-r--r--lib/interfaces/kdevelopplugin.desktop75
-rw-r--r--lib/interfaces/kdevelopproject.desktop40
-rw-r--r--lib/interfaces/kdevgenericfactory.h91
-rw-r--r--lib/interfaces/kdevlanguagesupport.cpp166
-rw-r--r--lib/interfaces/kdevlanguagesupport.h260
-rw-r--r--lib/interfaces/kdevmainwindow.cpp28
-rw-r--r--lib/interfaces/kdevmainwindow.h101
-rw-r--r--lib/interfaces/kdevpartcontroller.cpp30
-rw-r--r--lib/interfaces/kdevpartcontroller.h175
-rw-r--r--lib/interfaces/kdevplugin.cpp139
-rw-r--r--lib/interfaces/kdevplugin.h200
-rw-r--r--lib/interfaces/kdevplugincontroller.cpp49
-rw-r--r--lib/interfaces/kdevplugincontroller.h118
-rw-r--r--lib/interfaces/kdevplugininfo.cpp181
-rw-r--r--lib/interfaces/kdevplugininfo.h111
-rw-r--r--lib/interfaces/kdevproject.cpp164
-rw-r--r--lib/interfaces/kdevproject.h218
-rw-r--r--lib/interfaces/kdevprojectiface.cpp186
-rw-r--r--lib/interfaces/kdevprojectiface.h81
-rw-r--r--lib/util/Mainpage.dox10
-rw-r--r--lib/util/Makefile.am21
-rw-r--r--lib/util/blockingkprocess.cpp105
-rw-r--r--lib/util/blockingkprocess.h92
-rw-r--r--lib/util/configwidgetproxy.cpp105
-rw-r--r--lib/util/configwidgetproxy.h129
-rw-r--r--lib/util/domutil.cpp367
-rw-r--r--lib/util/domutil.h226
-rw-r--r--lib/util/execcommand.cpp101
-rw-r--r--lib/util/execcommand.h70
-rw-r--r--lib/util/filetemplate.cpp128
-rw-r--r--lib/util/filetemplate.h88
-rw-r--r--lib/util/kdeveditorutil.cpp89
-rw-r--r--lib/util/kdeveditorutil.h67
-rw-r--r--lib/util/kdevjobtimer.cpp39
-rw-r--r--lib/util/kdevjobtimer.h39
-rw-r--r--lib/util/kdevshellwidget.cpp125
-rw-r--r--lib/util/kdevshellwidget.h100
-rw-r--r--lib/util/kscriptactionmanager.cpp177
-rw-r--r--lib/util/kscriptactionmanager.h139
-rw-r--r--lib/util/rurl.cpp369
-rw-r--r--lib/util/rurl.h182
-rw-r--r--lib/util/settings.cpp63
-rw-r--r--lib/util/settings.h26
-rw-r--r--lib/util/urlutil.cpp319
-rw-r--r--lib/util/urlutil.h190
-rw-r--r--lib/widgets/Mainpage.dox10
-rw-r--r--lib/widgets/Makefile.am30
-rw-r--r--lib/widgets/fancylistviewitem.cpp203
-rw-r--r--lib/widgets/fancylistviewitem.h162
-rw-r--r--lib/widgets/flagboxes.cpp643
-rw-r--r--lib/widgets/flagboxes.h283
-rw-r--r--lib/widgets/kcomboview.cpp101
-rw-r--r--lib/widgets/kcomboview.h80
-rw-r--r--lib/widgets/kdevhtml_partui.rc18
-rw-r--r--lib/widgets/kdevhtmlpart.cpp512
-rw-r--r--lib/widgets/kdevhtmlpart.h111
-rw-r--r--lib/widgets/kdevtabwidget.cpp66
-rw-r--r--lib/widgets/klistviewaction.cpp86
-rw-r--r--lib/widgets/klistviewaction.h56
-rw-r--r--lib/widgets/ksavealldialog.cpp189
-rw-r--r--lib/widgets/ksavealldialog.h83
-rw-r--r--lib/widgets/processlinemaker.cpp93
-rw-r--r--lib/widgets/processlinemaker.h67
-rw-r--r--lib/widgets/processwidget.cpp283
-rw-r--r--lib/widgets/processwidget.h127
-rw-r--r--lib/widgets/propeditor/Mainpage.dox116
-rw-r--r--lib/widgets/propeditor/Makefile.am18
-rw-r--r--lib/widgets/propeditor/childproperty.cpp145
-rw-r--r--lib/widgets/propeditor/childproperty.h83
-rw-r--r--lib/widgets/propeditor/compat_tools.h6
-rw-r--r--lib/widgets/propeditor/multiproperty.cpp273
-rw-r--r--lib/widgets/propeditor/multiproperty.h126
-rw-r--r--lib/widgets/propeditor/pcheckbox.cpp76
-rw-r--r--lib/widgets/propeditor/pcheckbox.h54
-rw-r--r--lib/widgets/propeditor/pcolorbutton.cpp120
-rw-r--r--lib/widgets/propeditor/pcolorbutton.h62
-rw-r--r--lib/widgets/propeditor/pcolorcombo.cpp78
-rw-r--r--lib/widgets/propeditor/pcolorcombo.h54
-rw-r--r--lib/widgets/propeditor/pcombobox.cpp110
-rw-r--r--lib/widgets/propeditor/pcombobox.h72
-rw-r--r--lib/widgets/propeditor/pcursoredit.cpp41
-rw-r--r--lib/widgets/propeditor/pcursoredit.h42
-rw-r--r--lib/widgets/propeditor/pdateedit.cpp70
-rw-r--r--lib/widgets/propeditor/pdateedit.h51
-rw-r--r--lib/widgets/propeditor/pdatetimeedit.cpp69
-rw-r--r--lib/widgets/propeditor/pdatetimeedit.h52
-rw-r--r--lib/widgets/propeditor/pdoublenuminput.cpp94
-rw-r--r--lib/widgets/propeditor/pdoublenuminput.h64
-rw-r--r--lib/widgets/propeditor/pdummywidget.cpp54
-rw-r--r--lib/widgets/propeditor/pdummywidget.h60
-rw-r--r--lib/widgets/propeditor/pfontbutton.cpp86
-rw-r--r--lib/widgets/propeditor/pfontbutton.h52
-rw-r--r--lib/widgets/propeditor/pfontcombo.cpp86
-rw-r--r--lib/widgets/propeditor/pfontcombo.h56
-rw-r--r--lib/widgets/propeditor/plineedit.cpp61
-rw-r--r--lib/widgets/propeditor/plineedit.h52
-rw-r--r--lib/widgets/propeditor/plinestyleedit.cpp205
-rw-r--r--lib/widgets/propeditor/plinestyleedit.h50
-rw-r--r--lib/widgets/propeditor/ppixmapedit.cpp149
-rw-r--r--lib/widgets/propeditor/ppixmapedit.h57
-rw-r--r--lib/widgets/propeditor/ppointedit.cpp64
-rw-r--r--lib/widgets/propeditor/ppointedit.h50
-rw-r--r--lib/widgets/propeditor/prectedit.cpp64
-rw-r--r--lib/widgets/propeditor/prectedit.h50
-rw-r--r--lib/widgets/propeditor/property.cpp129
-rw-r--r--lib/widgets/propeditor/property.h181
-rw-r--r--lib/widgets/propeditor/propertyeditor.cpp480
-rw-r--r--lib/widgets/propeditor/propertyeditor.h129
-rw-r--r--lib/widgets/propeditor/propertyeditor.pro40
-rw-r--r--lib/widgets/propeditor/propertylist.cpp369
-rw-r--r--lib/widgets/propeditor/propertylist.h200
-rw-r--r--lib/widgets/propeditor/propertymachinefactory.cpp207
-rw-r--r--lib/widgets/propeditor/propertymachinefactory.h97
-rw-r--r--lib/widgets/propeditor/propertywidget.cpp64
-rw-r--r--lib/widgets/propeditor/propertywidget.h88
-rw-r--r--lib/widgets/propeditor/propertywidgetproxy.cpp106
-rw-r--r--lib/widgets/propeditor/propertywidgetproxy.h81
-rw-r--r--lib/widgets/propeditor/psizeedit.cpp65
-rw-r--r--lib/widgets/propeditor/psizeedit.h51
-rw-r--r--lib/widgets/propeditor/psizepolicyedit.cpp77
-rw-r--r--lib/widgets/propeditor/psizepolicyedit.h54
-rw-r--r--lib/widgets/propeditor/pspinbox.cpp73
-rw-r--r--lib/widgets/propeditor/pspinbox.h53
-rw-r--r--lib/widgets/propeditor/pstringlistedit.cpp121
-rw-r--r--lib/widgets/propeditor/pstringlistedit.h62
-rw-r--r--lib/widgets/propeditor/psymbolcombo.cpp131
-rw-r--r--lib/widgets/propeditor/psymbolcombo.h62
-rw-r--r--lib/widgets/propeditor/purledit.cpp97
-rw-r--r--lib/widgets/propeditor/purledit.h70
-rw-r--r--lib/widgets/propeditor/pyesnobutton.cpp76
-rw-r--r--lib/widgets/propeditor/pyesnobutton.h51
-rw-r--r--lib/widgets/propeditor/qeditlistbox.cpp401
-rw-r--r--lib/widgets/propeditor/qeditlistbox.h255
-rw-r--r--lib/widgets/propeditor/qfloatinput.cpp51
-rw-r--r--lib/widgets/propeditor/qfloatinput.h48
-rw-r--r--lib/widgets/propeditor/test.cpp86
-rwxr-xr-xlib/widgets/propeditor/test.pro40
-rw-r--r--lib/widgets/propeditor/undo.xpm44
-rw-r--r--lib/widgets/qcomboview.cpp1505
-rw-r--r--lib/widgets/qcomboview.h172
-rw-r--r--lib/widgets/resizablecombo.cpp98
-rw-r--r--lib/widgets/resizablecombo.h72
-rw-r--r--lib/widgets/sticky.xpm13
-rw-r--r--mimetypes/Makefile.am5
-rw-r--r--mimetypes/chm.desktop33
-rw-r--r--mimetypes/x-fortran.desktop46
-rw-r--r--parts/Makefile.am11
-rw-r--r--parts/abbrev/Makefile.am20
-rw-r--r--parts/abbrev/README.dox20
-rw-r--r--parts/abbrev/abbrevconfigwidget.cpp121
-rw-r--r--parts/abbrev/abbrevconfigwidget.h43
-rw-r--r--parts/abbrev/abbrevconfigwidgetbase.ui190
-rw-r--r--parts/abbrev/abbrevpart.cpp696
-rw-r--r--parts/abbrev/abbrevpart.h113
-rw-r--r--parts/abbrev/addtemplatedlg.cpp59
-rw-r--r--parts/abbrev/addtemplatedlg.h41
-rw-r--r--parts/abbrev/addtemplatedlgbase.ui176
-rw-r--r--parts/abbrev/cpp_keywords84
-rw-r--r--parts/abbrev/kdevabbrev.desktop83
-rw-r--r--parts/abbrev/kdevabbrev.rc10
-rw-r--r--parts/abbrev/qt_classes409
-rw-r--r--parts/appwizard/Makefile.am28
-rw-r--r--parts/appwizard/README1
-rw-r--r--parts/appwizard/README.dox80
-rw-r--r--parts/appwizard/appwizarddlg.cpp1374
-rw-r--r--parts/appwizard/appwizarddlg.h209
-rw-r--r--parts/appwizard/appwizarddlgbase.ui659
-rw-r--r--parts/appwizard/appwizardfactory.cpp41
-rw-r--r--parts/appwizard/appwizardfactory.h32
-rw-r--r--parts/appwizard/appwizardpart.cpp98
-rw-r--r--parts/appwizard/appwizardpart.h45
-rw-r--r--parts/appwizard/common/Artistic124
-rw-r--r--parts/appwizard/common/COPYING340
-rw-r--r--parts/appwizard/common/COPYING.LIB481
-rw-r--r--parts/appwizard/common/LICENSE.BSD20
-rw-r--r--parts/appwizard/common/LICENSE.QPL103
-rw-r--r--parts/appwizard/common/Makefile.am46
-rw-r--r--parts/appwizard/common/admin.kdevtemplate5
-rw-r--r--parts/appwizard/common/dockbook.kdevtemplate64
-rw-r--r--parts/appwizard/common/gnome-Makefile.am16
-rw-r--r--parts/appwizard/common/gnome-Makefile.cvs5
-rw-r--r--parts/appwizard/common/gnome-app.lsm15
-rw-r--r--parts/appwizard/common/gnome-app.pngbin0 -> 3388 bytes
-rw-r--r--parts/appwizard/common/gnome-pixmaps-Makefile.am8
-rw-r--r--parts/appwizard/common/gnome/macros/ChangeLog859
-rw-r--r--parts/appwizard/common/gnome/macros/aclocal-include.m416
-rw-r--r--parts/appwizard/common/gnome/macros/autogen.sh145
-rw-r--r--parts/appwizard/common/gnome/macros/compiler-flags.m4109
-rw-r--r--parts/appwizard/common/gnome/macros/curses.m4318
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-Makefile.am40
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-bonobo-check.m4150
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-common.m414
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-fileutils.m4414
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-gettext.m4336
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-ghttp-check.m414
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-gnorba-check.m435
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-guile-checks.m4119
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-libgtop-check.m4182
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-objc-checks.m479
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-orbit-check.m433
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-print-check.m4171
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-pthread-check.m416
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-support.m468
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-undelfs.m420
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-vfs.m4120
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-x-checks.m480
-rw-r--r--parts/appwizard/common/gnome/macros/gnome-xml-check.m430
-rw-r--r--parts/appwizard/common/gnome/macros/gnome.m4124
-rw-r--r--parts/appwizard/common/gnome/macros/linger.m428
-rw-r--r--parts/appwizard/common/gnome/macros/need-declaration.m442
-rw-r--r--parts/appwizard/common/gnome2.kdevtemplate5
-rw-r--r--parts/appwizard/common/gnome2/macros/aclocal-include.m416
-rwxr-xr-xparts/appwizard/common/gnome2/macros/autogen.sh384
-rw-r--r--parts/appwizard/common/gnome2/macros/compiler-flags.m4141
-rw-r--r--parts/appwizard/common/gnome2/macros/curses.m4318
-rw-r--r--parts/appwizard/common/gnome2/macros/gnome-common.m430
-rw-r--r--parts/appwizard/common/gnome2/macros/gnome-deprecated-macros.m432
-rw-r--r--parts/appwizard/common/gnome2/macros/gnome2-macros.dep1
-rw-r--r--parts/appwizard/common/gnu.kdevtemplate5
-rw-r--r--parts/appwizard/common/gnu/AUTHORS1
-rw-r--r--parts/appwizard/common/gnu/COPYING340
-rw-r--r--parts/appwizard/common/gnu/ChangeLog0
-rw-r--r--parts/appwizard/common/gnu/INSTALL167
-rw-r--r--parts/appwizard/common/gnu/NEWS0
-rw-r--r--parts/appwizard/common/gnu/README0
-rw-r--r--parts/appwizard/common/gnu/TODO0
-rw-r--r--parts/appwizard/common/hi16-app-app.pngbin0 -> 1033 bytes
-rw-r--r--parts/appwizard/common/hi32-app-app.pngbin0 -> 2749 bytes
-rw-r--r--parts/appwizard/common/incadmin.kdevtemplate5
-rwxr-xr-xparts/appwizard/common/incadmin/config.guess1363
-rwxr-xr-xparts/appwizard/common/incadmin/config.sub1470
-rwxr-xr-xparts/appwizard/common/incadmin/depcomp441
-rwxr-xr-xparts/appwizard/common/incadmin/install-sh276
-rw-r--r--parts/appwizard/common/incadmin/ltmain.sh6343
-rwxr-xr-xparts/appwizard/common/incadmin/missing336
-rwxr-xr-xparts/appwizard/common/incadmin/mkinstalldirs111
-rw-r--r--parts/appwizard/common/kde-Makefile.am22
-rw-r--r--parts/appwizard/common/kde-Makefile.cvs10
-rw-r--r--parts/appwizard/common/kde-app.desktop44
-rw-r--r--parts/appwizard/common/kde-app.lsm16
-rw-r--r--parts/appwizard/common/kde-configure.in.in6
-rw-r--r--parts/appwizard/common/kde-doc-Makefile.am6
-rw-r--r--parts/appwizard/common/kde-doc-en-Makefile.am2
-rw-r--r--parts/appwizard/common/kde-index.docbook555
-rw-r--r--parts/appwizard/common/kde-part.desktop18
-rw-r--r--parts/appwizard/common/kde-po-Makefile.am1
-rw-r--r--parts/appwizard/common/scons.kdevtemplate5
-rw-r--r--parts/appwizard/common/scons/admin/generic.py194
-rw-r--r--parts/appwizard/common/scons/admin/kde.py856
-rw-r--r--parts/appwizard/common/scons/admin/scons-mini.tar.bz2bin0 -> 58214 bytes
-rwxr-xr-xparts/appwizard/common/scons/configure87
-rw-r--r--parts/appwizard/common/wx-Makefile.am1
-rw-r--r--parts/appwizard/common/wx-Makefile.cvs5
-rw-r--r--parts/appwizard/common/wx-configure.in55
-rwxr-xr-xparts/appwizard/common/wx/macros/autogen.sh6
-rw-r--r--parts/appwizard/filepropspage.cpp88
-rw-r--r--parts/appwizard/filepropspage.h42
-rw-r--r--parts/appwizard/filepropspagebase.ui168
-rw-r--r--parts/appwizard/importdlg.cpp582
-rw-r--r--parts/appwizard/importdlg.h64
-rw-r--r--parts/appwizard/importdlgbase.ui365
-rw-r--r--parts/appwizard/imports/.kdev_ignore0
-rw-r--r--parts/appwizard/imports/Makefile.am7
-rw-r--r--parts/appwizard/imports/ada5
-rw-r--r--parts/appwizard/imports/ada.kdevelop73
-rw-r--r--parts/appwizard/imports/c4
-rw-r--r--parts/appwizard/imports/c-auto8
-rw-r--r--parts/appwizard/imports/c-auto.kdevelop96
-rw-r--r--parts/appwizard/imports/c.kdevelop76
-rw-r--r--parts/appwizard/imports/cpp4
-rw-r--r--parts/appwizard/imports/cpp-auto8
-rw-r--r--parts/appwizard/imports/cpp-auto.kdevelop93
-rw-r--r--parts/appwizard/imports/cpp.kdevelop75
-rw-r--r--parts/appwizard/imports/fortran4
-rw-r--r--parts/appwizard/imports/fortran-auto8
-rw-r--r--parts/appwizard/imports/fortran-auto.kdevelop71
-rw-r--r--parts/appwizard/imports/fortran.kdevelop75
-rw-r--r--parts/appwizard/imports/gnome4
-rw-r--r--parts/appwizard/imports/gnome.kdevelop100
-rw-r--r--parts/appwizard/imports/java4
-rw-r--r--parts/appwizard/imports/java-ant4
-rw-r--r--parts/appwizard/imports/java-ant.kdevelop68
-rw-r--r--parts/appwizard/imports/java-auto8
-rw-r--r--parts/appwizard/imports/java-auto.kdevelop63
-rw-r--r--parts/appwizard/imports/java.kdevelop63
-rw-r--r--parts/appwizard/imports/kde5
-rw-r--r--parts/appwizard/imports/kde.kdevelop73
-rw-r--r--parts/appwizard/imports/pascal4
-rw-r--r--parts/appwizard/imports/pascal.kdevelop75
-rw-r--r--parts/appwizard/imports/perl4
-rw-r--r--parts/appwizard/imports/perl.kdevelop69
-rw-r--r--parts/appwizard/imports/php4
-rw-r--r--parts/appwizard/imports/php.kdevelop84
-rw-r--r--parts/appwizard/imports/python4
-rw-r--r--parts/appwizard/imports/python.kdevelop69
-rw-r--r--parts/appwizard/imports/qt4
-rw-r--r--parts/appwizard/imports/qt-auto4
-rw-r--r--parts/appwizard/imports/qt-auto.kdevelop43
-rw-r--r--parts/appwizard/imports/qt.kdevelop38
-rw-r--r--parts/appwizard/imports/qt4qmake4
-rw-r--r--parts/appwizard/imports/qt4qmake.kdevelop80
-rw-r--r--parts/appwizard/imports/qtqmake9
-rw-r--r--parts/appwizard/imports/qtqmake.kdevelop79
-rw-r--r--parts/appwizard/imports/qttmake4
-rw-r--r--parts/appwizard/imports/qttmake.kdevelop74
-rw-r--r--parts/appwizard/imports/ruby4
-rw-r--r--parts/appwizard/imports/ruby.kdevelop82
-rw-r--r--parts/appwizard/kdevappwizard.desktop87
-rw-r--r--parts/appwizard/kdevappwizard.rc10
-rw-r--r--parts/appwizard/kdevfile.cpp59
-rw-r--r--parts/appwizard/kdevfile.h57
-rw-r--r--parts/appwizard/kdevlicense.cpp116
-rw-r--r--parts/appwizard/kdevlicense.h75
-rw-r--r--parts/appwizard/licenses/BSD22
-rw-r--r--parts/appwizard/licenses/GPL18
-rw-r--r--parts/appwizard/licenses/GPL+Qt-Exception29
-rw-r--r--parts/appwizard/licenses/LGPL18
-rw-r--r--parts/appwizard/licenses/MIT21
-rw-r--r--parts/appwizard/licenses/Makefile.am6
-rw-r--r--parts/appwizard/licenses/NCSA24
-rw-r--r--parts/appwizard/licenses/QPL11
-rw-r--r--parts/appwizard/misc.cpp56
-rw-r--r--parts/appwizard/misc.h23
-rw-r--r--parts/appwizard/profilesupport.cpp44
-rw-r--r--parts/appwizard/profilesupport.h34
-rw-r--r--parts/appwizard/vcs_form.ui84
-rw-r--r--parts/astyle/Makefile.am16
-rw-r--r--parts/astyle/README.dox10
-rw-r--r--parts/astyle/astyle_adaptor.cpp270
-rw-r--r--parts/astyle/astyle_adaptor.h55
-rw-r--r--parts/astyle/astyle_part.cpp541
-rw-r--r--parts/astyle/astyle_part.h76
-rw-r--r--parts/astyle/astyle_widget.cpp346
-rw-r--r--parts/astyle/astyle_widget.h36
-rw-r--r--parts/astyle/astyleconfig.ui1332
-rw-r--r--parts/astyle/kdevastyle.desktop82
-rw-r--r--parts/astyle/kdevpart_astyle.rc17
-rw-r--r--parts/bookmarks/Makefile.am14
-rw-r--r--parts/bookmarks/README1
-rw-r--r--parts/bookmarks/README.dox20
-rw-r--r--parts/bookmarks/bookmarks_config.cpp138
-rw-r--r--parts/bookmarks/bookmarks_config.h53
-rw-r--r--parts/bookmarks/bookmarks_part.cpp568
-rw-r--r--parts/bookmarks/bookmarks_part.h109
-rw-r--r--parts/bookmarks/bookmarks_settings.cpp66
-rw-r--r--parts/bookmarks/bookmarks_settings.h41
-rw-r--r--parts/bookmarks/bookmarks_settings_base.ui240
-rw-r--r--parts/bookmarks/bookmarks_widget.cpp336
-rw-r--r--parts/bookmarks/bookmarks_widget.h72
-rw-r--r--parts/bookmarks/kdevbookmarks.desktop85
-rw-r--r--parts/classview/Makefile.am27
-rw-r--r--parts/classview/README.dox53
-rw-r--r--parts/classview/classtooldlg.cpp373
-rw-r--r--parts/classview/classtooldlg.h98
-rw-r--r--parts/classview/classtoolwidget.cpp159
-rw-r--r--parts/classview/classtoolwidget.h41
-rw-r--r--parts/classview/classtreebase.cpp637
-rw-r--r--parts/classview/classtreebase.h242
-rw-r--r--parts/classview/classviewpart.cpp279
-rw-r--r--parts/classview/classviewpart.h99
-rw-r--r--parts/classview/classviewwidget.cpp1295
-rw-r--r--parts/classview/classviewwidget.h414
-rw-r--r--parts/classview/digraphview.cpp414
-rw-r--r--parts/classview/digraphview.h66
-rw-r--r--parts/classview/hierarchydlg.cpp276
-rw-r--r--parts/classview/hierarchydlg.h61
-rw-r--r--parts/classview/kdevclassview.desktop82
-rw-r--r--parts/classview/kdevclassview.rc20
-rw-r--r--parts/classview/navigator.cpp539
-rw-r--r--parts/classview/navigator.h91
-rw-r--r--parts/classview/viewcombos.cpp214
-rw-r--r--parts/classview/viewcombos.h84
-rw-r--r--parts/ctags2/Makefile.am22
-rw-r--r--parts/ctags2/README.dox16
-rw-r--r--parts/ctags2/ctags2_createtagfile.cpp53
-rw-r--r--parts/ctags2/ctags2_createtagfile.h36
-rw-r--r--parts/ctags2/ctags2_createtagfilebase.ui151
-rw-r--r--parts/ctags2/ctags2_part.cpp371
-rw-r--r--parts/ctags2/ctags2_part.h69
-rw-r--r--parts/ctags2/ctags2_selecttagfile.cpp47
-rw-r--r--parts/ctags2/ctags2_selecttagfile.h33
-rw-r--r--parts/ctags2/ctags2_selecttagfilebase.ui128
-rw-r--r--parts/ctags2/ctags2_settingswidget.cpp173
-rw-r--r--parts/ctags2/ctags2_settingswidget.h69
-rw-r--r--parts/ctags2/ctags2_settingswidgetbase.ui382
-rw-r--r--parts/ctags2/ctags2_widget.cpp199
-rw-r--r--parts/ctags2/ctags2_widget.h56
-rw-r--r--parts/ctags2/ctags2_widgetbase.ui181
-rw-r--r--parts/ctags2/ctagskinds.cpp306
-rw-r--r--parts/ctags2/ctagskinds.h24
-rw-r--r--parts/ctags2/kdevctags2.desktop82
-rw-r--r--parts/ctags2/kdevpart_ctags2.rc12
-rw-r--r--parts/ctags2/readtags.c960
-rw-r--r--parts/ctags2/readtags.h251
-rw-r--r--parts/ctags2/tagitem.cpp23
-rw-r--r--parts/ctags2/tagitem.h29
-rw-r--r--parts/ctags2/tags.cpp171
-rw-r--r--parts/ctags2/tags.h74
-rw-r--r--parts/diff/Makefile.am18
-rw-r--r--parts/diff/README3
-rw-r--r--parts/diff/README.dox20
-rw-r--r--parts/diff/diffdlg.cpp48
-rw-r--r--parts/diff/diffdlg.h41
-rw-r--r--parts/diff/diffpart.cpp248
-rw-r--r--parts/diff/diffpart.h59
-rw-r--r--parts/diff/diffwidget.cpp348
-rw-r--r--parts/diff/diffwidget.h107
-rw-r--r--parts/diff/kdevdiff.desktop84
-rw-r--r--parts/diff/kdevdiff.rc9
-rw-r--r--parts/distpart/Makefile.am16
-rw-r--r--parts/distpart/README3
-rw-r--r--parts/distpart/README.dox24
-rw-r--r--parts/distpart/distpart_part.cpp84
-rw-r--r--parts/distpart/distpart_part.h55
-rw-r--r--parts/distpart/distpart_ui.ui1243
-rw-r--r--parts/distpart/distpart_widget.cpp605
-rw-r--r--parts/distpart/distpart_widget.h210
-rw-r--r--parts/distpart/kdevdistpart.desktop70
-rw-r--r--parts/distpart/kdevpart_distpart.rc8
-rw-r--r--parts/distpart/lsmsupport.cpp32
-rw-r--r--parts/distpart/lsmsupport.h35
-rw-r--r--parts/distpart/packagebase.cpp117
-rw-r--r--parts/distpart/packagebase.h84
-rw-r--r--parts/distpart/specsupport.cpp315
-rw-r--r--parts/distpart/specsupport.h54
-rw-r--r--parts/documentation/KDevDocumentationIface.cpp83
-rw-r--r--parts/documentation/KDevDocumentationIface.h52
-rw-r--r--parts/documentation/Makefile.am32
-rw-r--r--parts/documentation/README.dox21
-rw-r--r--parts/documentation/addcatalogdlg.cpp112
-rw-r--r--parts/documentation/addcatalogdlg.h53
-rw-r--r--parts/documentation/addcatalogdlgbase.ui209
-rw-r--r--parts/documentation/bookmarkview.cpp285
-rw-r--r--parts/documentation/bookmarkview.h82
-rw-r--r--parts/documentation/contentsview.cpp92
-rw-r--r--parts/documentation/contentsview.h53
-rw-r--r--parts/documentation/data/Makefile.am6
-rw-r--r--parts/documentation/data/checked.xpm23
-rw-r--r--parts/documentation/data/htdig.pngbin0 -> 2857 bytes
-rw-r--r--parts/documentation/data/long.html6
-rw-r--r--parts/documentation/data/nomatch.html21
-rw-r--r--parts/documentation/data/short.html1
-rw-r--r--parts/documentation/data/star.pngbin0 -> 195 bytes
-rw-r--r--parts/documentation/data/star_blank.pngbin0 -> 151 bytes
-rw-r--r--parts/documentation/data/syntax.html19
-rw-r--r--parts/documentation/data/unchecked.xpm22
-rw-r--r--parts/documentation/data/wrapper.html16
-rw-r--r--parts/documentation/docconfiglistview.cpp72
-rw-r--r--parts/documentation/docconfiglistview.h36
-rw-r--r--parts/documentation/docglobalconfigwidget.cpp259
-rw-r--r--parts/documentation/docglobalconfigwidget.h67
-rw-r--r--parts/documentation/docglobalconfigwidgetbase.ui572
-rw-r--r--parts/documentation/docprojectconfigwidget.cpp146
-rw-r--r--parts/documentation/docprojectconfigwidget.h41
-rw-r--r--parts/documentation/docprojectconfigwidgetbase.ui152
-rw-r--r--parts/documentation/documentation_part.cpp766
-rw-r--r--parts/documentation/documentation_part.h121
-rw-r--r--parts/documentation/documentation_widget.cpp142
-rw-r--r--parts/documentation/documentation_widget.h75
-rw-r--r--parts/documentation/docutils.cpp100
-rw-r--r--parts/documentation/docutils.h51
-rw-r--r--parts/documentation/editbookmarkdlg.ui165
-rw-r--r--parts/documentation/editcatalogdlg.cpp79
-rw-r--r--parts/documentation/editcatalogdlg.h56
-rw-r--r--parts/documentation/editcatalogdlgbase.ui196
-rw-r--r--parts/documentation/find_documentation.cpp347
-rw-r--r--parts/documentation/find_documentation.h81
-rw-r--r--parts/documentation/find_documentation_options.cpp192
-rw-r--r--parts/documentation/find_documentation_options.h66
-rw-r--r--parts/documentation/find_documentation_optionsbase.ui218
-rw-r--r--parts/documentation/find_documentationbase.ui167
-rw-r--r--parts/documentation/indexview.cpp190
-rw-r--r--parts/documentation/indexview.h64
-rw-r--r--parts/documentation/interfaces/Mainpage.dox10
-rw-r--r--parts/documentation/interfaces/Makefile.am16
-rw-r--r--parts/documentation/interfaces/kdevdocumentationplugin.cpp721
-rw-r--r--parts/documentation/interfaces/kdevdocumentationplugin.h421
-rw-r--r--parts/documentation/interfaces/kdevelopdocumentationplugins.desktop36
-rw-r--r--parts/documentation/kdevdocumentation.desktop82
-rw-r--r--parts/documentation/kdevpart_documentation.rc19
-rw-r--r--parts/documentation/plugins/Makefile.am3
-rw-r--r--parts/documentation/plugins/chm/Makefile.am14
-rw-r--r--parts/documentation/plugins/chm/docchmplugin.cpp198
-rw-r--r--parts/documentation/plugins/chm/docchmplugin.desktop44
-rw-r--r--parts/documentation/plugins/chm/docchmplugin.h50
-rw-r--r--parts/documentation/plugins/custom/Makefile.am10
-rw-r--r--parts/documentation/plugins/custom/doccustomplugin.cpp106
-rw-r--r--parts/documentation/plugins/custom/doccustomplugin.desktop44
-rw-r--r--parts/documentation/plugins/custom/doccustomplugin.h50
-rw-r--r--parts/documentation/plugins/devhelp/Makefile.am14
-rw-r--r--parts/documentation/plugins/devhelp/docdevhelpplugin.cpp386
-rw-r--r--parts/documentation/plugins/devhelp/docdevhelpplugin.desktop44
-rw-r--r--parts/documentation/plugins/devhelp/docdevhelpplugin.h60
-rw-r--r--parts/documentation/plugins/djvu/Makefile.am8
-rw-r--r--parts/documentation/plugins/djvu/docdjvuplugin.cpp103
-rw-r--r--parts/documentation/plugins/djvu/docdjvuplugin.desktop44
-rw-r--r--parts/documentation/plugins/djvu/docdjvuplugin.h50
-rw-r--r--parts/documentation/plugins/doxygen/Makefile.am13
-rw-r--r--parts/documentation/plugins/doxygen/docdoxygenplugin.cpp529
-rw-r--r--parts/documentation/plugins/doxygen/docdoxygenplugin.desktop45
-rw-r--r--parts/documentation/plugins/doxygen/docdoxygenplugin.h75
-rw-r--r--parts/documentation/plugins/kdevtoc/Makefile.am10
-rw-r--r--parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp277
-rw-r--r--parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop43
-rw-r--r--parts/documentation/plugins/kdevtoc/dockdevtocplugin.h54
-rw-r--r--parts/documentation/plugins/pdb/Makefile.am8
-rw-r--r--parts/documentation/plugins/pdb/docpdbplugin.cpp103
-rw-r--r--parts/documentation/plugins/pdb/docpdbplugin.desktop43
-rw-r--r--parts/documentation/plugins/pdb/docpdbplugin.h50
-rw-r--r--parts/documentation/plugins/pdf/Makefile.am8
-rw-r--r--parts/documentation/plugins/pdf/docpdfplugin.cpp103
-rw-r--r--parts/documentation/plugins/pdf/docpdfplugin.desktop43
-rw-r--r--parts/documentation/plugins/pdf/docpdfplugin.h50
-rw-r--r--parts/documentation/plugins/qt/Makefile.am14
-rw-r--r--parts/documentation/plugins/qt/docqtplugin.cpp339
-rw-r--r--parts/documentation/plugins/qt/docqtplugin.desktop44
-rw-r--r--parts/documentation/plugins/qt/docqtplugin.h56
-rw-r--r--parts/documentation/protocols/Makefile.am4
-rw-r--r--parts/documentation/protocols/chm/Makefile.am21
-rw-r--r--parts/documentation/protocols/chm/chm.cpp362
-rw-r--r--parts/documentation/protocols/chm/chm.h47
-rw-r--r--parts/documentation/protocols/chm/chm.protocol36
-rw-r--r--parts/documentation/protocols/chm/chmfile.cpp197
-rw-r--r--parts/documentation/protocols/chm/chmfile.h53
-rw-r--r--parts/documentation/protocols/chm/decompress.cpp796
-rw-r--r--parts/documentation/protocols/chm/decompress.h43
-rw-r--r--parts/documentation/protocols/chm/kchmpart.cpp123
-rw-r--r--parts/documentation/protocols/chm/kchmpart.desktop46
-rw-r--r--parts/documentation/protocols/chm/kchmpart.h82
-rw-r--r--parts/documentation/searchview.cpp330
-rw-r--r--parts/documentation/searchview.h75
-rw-r--r--parts/documentation/selecttopic.cpp49
-rw-r--r--parts/documentation/selecttopic.h40
-rw-r--r--parts/documentation/selecttopicbase.ui142
-rw-r--r--parts/documentation/tools/Makefile.am3
-rw-r--r--parts/documentation/tools/htdig/Makefile.am6
-rw-r--r--parts/documentation/tools/htdig/htdigindex.cpp491
-rw-r--r--parts/documentation/tools/htdig/htdigindex.h68
-rw-r--r--parts/doxygen/Makefile.am19
-rw-r--r--parts/doxygen/README1
-rw-r--r--parts/doxygen/README.dox75
-rw-r--r--parts/doxygen/config.cpp5166
-rw-r--r--parts/doxygen/config.h579
-rw-r--r--parts/doxygen/doxygenconfigwidget.cpp275
-rw-r--r--parts/doxygen/doxygenconfigwidget.h54
-rw-r--r--parts/doxygen/doxygenpart.cpp564
-rw-r--r--parts/doxygen/doxygenpart.h113
-rw-r--r--parts/doxygen/input.cpp499
-rw-r--r--parts/doxygen/input.h173
-rw-r--r--parts/doxygen/kdevdoxygen.desktop81
-rw-r--r--parts/doxygen/kdevdoxygen.rc14
-rw-r--r--parts/doxygen/lang_cfg.h34
-rw-r--r--parts/doxygen/messages.cpp301
-rw-r--r--parts/doxygen/messages.h11
-rw-r--r--parts/doxygen/version.cpp1
-rw-r--r--parts/doxygen/version.h23
-rw-r--r--parts/filecreate/Makefile.am23
-rw-r--r--parts/filecreate/README3
-rw-r--r--parts/filecreate/README.dox76
-rw-r--r--parts/filecreate/addglobaldlg.cpp106
-rw-r--r--parts/filecreate/addglobaldlg.h44
-rw-r--r--parts/filecreate/fcconfigwidget.cpp709
-rw-r--r--parts/filecreate/fcconfigwidget.h72
-rw-r--r--parts/filecreate/fcconfigwidgetbase.ui540
-rw-r--r--parts/filecreate/fctemplateedit.cpp36
-rw-r--r--parts/filecreate/fctemplateedit.h30
-rw-r--r--parts/filecreate/fctemplateeditbase.ui193
-rw-r--r--parts/filecreate/fctemplateeditbase.ui.h26
-rw-r--r--parts/filecreate/fctypeedit.cpp40
-rw-r--r--parts/filecreate/fctypeedit.h30
-rw-r--r--parts/filecreate/fctypeeditbase.ui282
-rw-r--r--parts/filecreate/fctypeeditbase.ui.h26
-rw-r--r--parts/filecreate/file-templates/Makefile.am2
-rw-r--r--parts/filecreate/file-templates/dox22
-rw-r--r--parts/filecreate/file-templates/qrc5
-rw-r--r--parts/filecreate/file-templates/ts2
-rw-r--r--parts/filecreate/file-templates/ui20
-rw-r--r--parts/filecreate/file-templates/ui-confdialog165
-rw-r--r--parts/filecreate/file-templates/ui-dialog20
-rw-r--r--parts/filecreate/file-templates/ui-dialog-qt422
-rw-r--r--parts/filecreate/file-templates/ui-dialogb123
-rw-r--r--parts/filecreate/file-templates/ui-dialogb-qt4100
-rw-r--r--parts/filecreate/file-templates/ui-dialogr123
-rw-r--r--parts/filecreate/file-templates/ui-dialogr-qt4100
-rw-r--r--parts/filecreate/file-templates/ui-mainwin436
-rw-r--r--parts/filecreate/file-templates/ui-mainwin-qt434
-rw-r--r--parts/filecreate/file-templates/ui-tabdialog147
-rw-r--r--parts/filecreate/file-templates/ui-widget20
-rw-r--r--parts/filecreate/file-templates/ui-widget-qt422
-rw-r--r--parts/filecreate/file-templates/ui-wizard28
-rw-r--r--parts/filecreate/filecreate_filedialog.cpp65
-rw-r--r--parts/filecreate/filecreate_filedialog.h46
-rw-r--r--parts/filecreate/filecreate_filetype.cpp21
-rw-r--r--parts/filecreate/filecreate_filetype.h63
-rw-r--r--parts/filecreate/filecreate_listitem.cpp101
-rw-r--r--parts/filecreate/filecreate_listitem.h49
-rw-r--r--parts/filecreate/filecreate_newfile.cpp162
-rw-r--r--parts/filecreate/filecreate_newfile.h59
-rw-r--r--parts/filecreate/filecreate_part.cpp562
-rw-r--r--parts/filecreate/filecreate_part.h144
-rw-r--r--parts/filecreate/filecreate_typechooser.h47
-rw-r--r--parts/filecreate/filecreate_typechoosersig.h28
-rw-r--r--parts/filecreate/filecreate_widget2.cpp228
-rw-r--r--parts/filecreate/filecreate_widget2.h113
-rw-r--r--parts/filecreate/filecreate_widget3.cpp119
-rw-r--r--parts/filecreate/filecreate_widget3.h50
-rw-r--r--parts/filecreate/kdevfilecreate.desktop77
-rw-r--r--parts/filecreate/kdevpart_filecreate.rc11
-rw-r--r--parts/filecreate/template-info.xml181
-rw-r--r--parts/filelist/Makefile.am20
-rw-r--r--parts/filelist/README.dox13
-rw-r--r--parts/filelist/fileinfo.h37
-rw-r--r--parts/filelist/filelist_item.cpp104
-rw-r--r--parts/filelist/filelist_item.h53
-rw-r--r--parts/filelist/filelist_widget.cpp300
-rw-r--r--parts/filelist/filelist_widget.h72
-rw-r--r--parts/filelist/kdevfilelist.desktop76
-rw-r--r--parts/filelist/kdevfilelist.rc24
-rw-r--r--parts/filelist/projectviewconfig.cpp47
-rw-r--r--parts/filelist/projectviewconfig.h38
-rw-r--r--parts/filelist/projectviewconfigbase.ui93
-rw-r--r--parts/filelist/projectviewpart.cpp585
-rw-r--r--parts/filelist/projectviewpart.h169
-rw-r--r--parts/filelist/projectviewprojectconfig.cpp41
-rw-r--r--parts/filelist/projectviewprojectconfig.h41
-rw-r--r--parts/filelist/projectviewprojectconfigbase.ui94
-rw-r--r--parts/filelist/toolbarguibuilder.cpp59
-rw-r--r--parts/filelist/toolbarguibuilder.h58
-rw-r--r--parts/fileselector/Makefile.am18
-rw-r--r--parts/fileselector/README.dox13
-rw-r--r--parts/fileselector/fileselector_part.cpp108
-rw-r--r--parts/fileselector/fileselector_part.h40
-rw-r--r--parts/fileselector/fileselector_widget.cpp821
-rw-r--r--parts/fileselector/fileselector_widget.h203
-rw-r--r--parts/fileselector/kactionselector.cpp537
-rw-r--r--parts/fileselector/kactionselector.h399
-rw-r--r--parts/fileselector/kbookmarkhandler.cpp99
-rw-r--r--parts/fileselector/kbookmarkhandler.h70
-rw-r--r--parts/fileselector/kdevfileselector.desktop89
-rw-r--r--parts/fileselector/kdevpart_fileselector.rc8
-rw-r--r--parts/fileview/Makefile.am26
-rw-r--r--parts/fileview/README.dox53
-rw-r--r--parts/fileview/addfilegroupdlg.cpp73
-rw-r--r--parts/fileview/addfilegroupdlg.h39
-rw-r--r--parts/fileview/filegroupsconfigwidget.cpp133
-rw-r--r--parts/fileview/filegroupsconfigwidget.h44
-rw-r--r--parts/fileview/filegroupsconfigwidgetbase.ui229
-rw-r--r--parts/fileview/filegroupspart.cpp97
-rw-r--r--parts/fileview/filegroupspart.h43
-rw-r--r--parts/fileview/filegroupswidget.cpp442
-rw-r--r--parts/fileview/filegroupswidget.h54
-rw-r--r--parts/fileview/fileitemfactory.cpp145
-rw-r--r--parts/fileview/fileitemfactory.h89
-rw-r--r--parts/fileview/filetreeviewwidgetimpl.cpp169
-rw-r--r--parts/fileview/filetreeviewwidgetimpl.h105
-rw-r--r--parts/fileview/filetreewidget.cpp387
-rw-r--r--parts/fileview/filetreewidget.h111
-rw-r--r--parts/fileview/fileviewpart.cpp161
-rw-r--r--parts/fileview/fileviewpart.h49
-rw-r--r--parts/fileview/kdevfilegroups.desktop86
-rw-r--r--parts/fileview/kdevfileview.desktop85
-rw-r--r--parts/fileview/partwidget.cpp144
-rw-r--r--parts/fileview/partwidget.h45
-rw-r--r--parts/fileview/stdfiletreewidgetimpl.cpp95
-rw-r--r--parts/fileview/stdfiletreewidgetimpl.h36
-rw-r--r--parts/fileview/vcscolorsconfigwidget.cpp109
-rw-r--r--parts/fileview/vcscolorsconfigwidget.h68
-rw-r--r--parts/fileview/vcscolorsconfigwidgetbase.ui267
-rw-r--r--parts/fileview/vcsfiletreewidgetimpl.cpp353
-rw-r--r--parts/fileview/vcsfiletreewidgetimpl.h67
-rw-r--r--parts/filter/Makefile.am17
-rw-r--r--parts/filter/README.dox52
-rw-r--r--parts/filter/filterpart.cpp160
-rw-r--r--parts/filter/filterpart.h41
-rw-r--r--parts/filter/kdevfilter.desktop82
-rw-r--r--parts/filter/kdevfilter.rc10
-rw-r--r--parts/filter/kdevfilterIface.cpp35
-rw-r--r--parts/filter/kdevfilterIface.h26
-rw-r--r--parts/filter/shellfilterdlg.cpp128
-rw-r--r--parts/filter/shellfilterdlg.h52
-rw-r--r--parts/filter/shellinsertdlg.cpp125
-rw-r--r--parts/filter/shellinsertdlg.h49
-rw-r--r--parts/fullscreen/Makefile.am15
-rw-r--r--parts/fullscreen/README.dox10
-rw-r--r--parts/fullscreen/fullscreen_part.cpp72
-rw-r--r--parts/fullscreen/fullscreen_part.h36
-rw-r--r--parts/fullscreen/kdevfullscreen.desktop86
-rw-r--r--parts/fullscreen/kdevpart_fullscreen.rc12
-rw-r--r--parts/grepview/Makefile.am19
-rw-r--r--parts/grepview/README.dox12
-rw-r--r--parts/grepview/grepdlg.cpp381
-rw-r--r--parts/grepview/grepdlg.h104
-rw-r--r--parts/grepview/grepviewpart.cpp150
-rw-r--r--parts/grepview/grepviewpart.h50
-rw-r--r--parts/grepview/grepviewwidget.cpp535
-rw-r--r--parts/grepview/grepviewwidget.h111
-rw-r--r--parts/grepview/kdevgrepview.desktop86
-rw-r--r--parts/grepview/kdevgrepview.rc9
-rw-r--r--parts/konsole/Makefile.am16
-rw-r--r--parts/konsole/README.dox49
-rw-r--r--parts/konsole/kdevkonsoleview.desktop86
-rw-r--r--parts/konsole/konsoleviewpart.cpp69
-rw-r--r--parts/konsole/konsoleviewpart.h36
-rw-r--r--parts/konsole/konsoleviewwidget.cpp124
-rw-r--r--parts/konsole/konsoleviewwidget.h55
-rw-r--r--parts/openwith/Makefile.am15
-rw-r--r--parts/openwith/README.dox52
-rw-r--r--parts/openwith/kdevopenwith.desktop82
-rw-r--r--parts/openwith/openwithpart.cpp138
-rw-r--r--parts/openwith/openwithpart.h36
-rw-r--r--parts/outputviews/Makefile.am35
-rw-r--r--parts/outputviews/README.dox16
-rw-r--r--parts/outputviews/appoutputviewpart.cpp178
-rw-r--r--parts/outputviews/appoutputviewpart.h56
-rw-r--r--parts/outputviews/appoutputwidget.cpp355
-rw-r--r--parts/outputviews/appoutputwidget.h69
-rw-r--r--parts/outputviews/commandcontinuationfilter.cpp40
-rw-r--r--parts/outputviews/commandcontinuationfilter.h29
-rw-r--r--parts/outputviews/compileerrorfilter.cpp128
-rw-r--r--parts/outputviews/compileerrorfilter.h48
-rw-r--r--parts/outputviews/directorystatusmessagefilter.cpp187
-rw-r--r--parts/outputviews/directorystatusmessagefilter.h39
-rw-r--r--parts/outputviews/filterdlg.ui164
-rw-r--r--parts/outputviews/kdevappoutputview.desktop84
-rw-r--r--parts/outputviews/kdevmakeview.desktop87
-rw-r--r--parts/outputviews/kdevmakeview.rc9
-rw-r--r--parts/outputviews/makeactionfilter.cpp319
-rw-r--r--parts/outputviews/makeactionfilter.h62
-rw-r--r--parts/outputviews/makeitem.cpp166
-rw-r--r--parts/outputviews/makeitem.h164
-rw-r--r--parts/outputviews/makeviewpart.cpp105
-rw-r--r--parts/outputviews/makeviewpart.h46
-rw-r--r--parts/outputviews/makewidget.cpp847
-rw-r--r--parts/outputviews/makewidget.h129
-rw-r--r--parts/outputviews/otherfilter.cpp26
-rw-r--r--parts/outputviews/otherfilter.h34
-rw-r--r--parts/outputviews/outputfilter.cpp24
-rw-r--r--parts/outputviews/outputfilter.h29
-rw-r--r--parts/outputviews/outputviewsfactory.cpp21
-rw-r--r--parts/outputviews/outputviewsfactory.h27
-rw-r--r--parts/partexplorer/Makefile.am17
-rw-r--r--parts/partexplorer/README3
-rw-r--r--parts/partexplorer/README.dox24
-rw-r--r--parts/partexplorer/kdevpartexplorer.desktop76
-rw-r--r--parts/partexplorer/kdevpartexplorer.rc8
-rw-r--r--parts/partexplorer/partexplorer_plugin.cpp65
-rw-r--r--parts/partexplorer/partexplorer_plugin.h48
-rw-r--r--parts/partexplorer/partexplorerform.cpp231
-rw-r--r--parts/partexplorer/partexplorerform.h49
-rw-r--r--parts/partexplorer/partexplorerformbase.ui139
-rw-r--r--parts/quickopen/Makefile.am17
-rw-r--r--parts/quickopen/README.dox52
-rw-r--r--parts/quickopen/kdevpart_quickopen.rc15
-rw-r--r--parts/quickopen/kdevquickopen.desktop80
-rw-r--r--parts/quickopen/quickopen_part.cpp139
-rw-r--r--parts/quickopen/quickopen_part.h57
-rw-r--r--parts/quickopen/quickopenbase.ui178
-rw-r--r--parts/quickopen/quickopenclassdialog.cpp219
-rw-r--r--parts/quickopen/quickopenclassdialog.h56
-rw-r--r--parts/quickopen/quickopendialog.cpp155
-rw-r--r--parts/quickopen/quickopendialog.h63
-rw-r--r--parts/quickopen/quickopenfiledialog.cpp121
-rw-r--r--parts/quickopen/quickopenfiledialog.h49
-rw-r--r--parts/quickopen/quickopenfunctionchooseform.cpp56
-rw-r--r--parts/quickopen/quickopenfunctionchooseform.h48
-rw-r--r--parts/quickopen/quickopenfunctionchooseformbase.ui231
-rw-r--r--parts/quickopen/quickopenfunctiondialog.cpp229
-rw-r--r--parts/quickopen/quickopenfunctiondialog.h60
-rw-r--r--parts/regexptest/Makefile.am17
-rw-r--r--parts/regexptest/README.dox49
-rw-r--r--parts/regexptest/kdevregexptest.desktop82
-rw-r--r--parts/regexptest/kdevregexptest.rc9
-rw-r--r--parts/regexptest/regexptestdlg.cpp263
-rw-r--r--parts/regexptest/regexptestdlg.h46
-rw-r--r--parts/regexptest/regexptestdlgbase.ui352
-rw-r--r--parts/regexptest/regexptestpart.cpp63
-rw-r--r--parts/regexptest/regexptestpart.h37
-rw-r--r--parts/replace/Makefile.am16
-rw-r--r--parts/replace/README3
-rw-r--r--parts/replace/README.dox24
-rw-r--r--parts/replace/kdevpart_replace.rc8
-rw-r--r--parts/replace/kdevreplace.desktop80
-rw-r--r--parts/replace/replace_part.cpp110
-rw-r--r--parts/replace/replace_part.h46
-rw-r--r--parts/replace/replace_widget.cpp486
-rw-r--r--parts/replace/replace_widget.h81
-rw-r--r--parts/replace/replacedlg.ui385
-rw-r--r--parts/replace/replacedlgimpl.cpp188
-rw-r--r--parts/replace/replacedlgimpl.h38
-rw-r--r--parts/replace/replaceitem.cpp147
-rw-r--r--parts/replace/replaceitem.h113
-rw-r--r--parts/replace/replaceview.cpp141
-rw-r--r--parts/replace/replaceview.h54
-rw-r--r--parts/scripting/Makefile.am20
-rw-r--r--parts/scripting/README18
-rw-r--r--parts/scripting/kdevscripting.desktop77
-rw-r--r--parts/scripting/kdevscripting.rc8
-rw-r--r--parts/scripting/scriptingglobalconfig.cpp48
-rw-r--r--parts/scripting/scriptingglobalconfig.h41
-rw-r--r--parts/scripting/scriptingglobalconfigbase.ui51
-rw-r--r--parts/scripting/scriptingpart.cpp108
-rw-r--r--parts/scripting/scriptingpart.h57
-rw-r--r--parts/snippet/COPYING340
-rw-r--r--parts/snippet/Makefile.am17
-rw-r--r--parts/snippet/README3
-rw-r--r--parts/snippet/README.dox16
-rw-r--r--parts/snippet/kdevpart_snippet.rc8
-rw-r--r--parts/snippet/kdevsnippet.desktop102
-rw-r--r--parts/snippet/snippet_part.cpp155
-rw-r--r--parts/snippet/snippet_part.h50
-rw-r--r--parts/snippet/snippet_widget.cpp970
-rw-r--r--parts/snippet/snippet_widget.h90
-rw-r--r--parts/snippet/snippetconfig.cpp20
-rw-r--r--parts/snippet/snippetconfig.h56
-rw-r--r--parts/snippet/snippetdlg.ui214
-rw-r--r--parts/snippet/snippetdlg.ui.h21
-rw-r--r--parts/snippet/snippetitem.cpp127
-rw-r--r--parts/snippet/snippetitem.h70
-rw-r--r--parts/snippet/snippetsettings.cpp52
-rw-r--r--parts/snippet/snippetsettings.h41
-rw-r--r--parts/snippet/snippetsettingsbase.ui228
-rw-r--r--parts/texttools/Makefile.am18
-rw-r--r--parts/texttools/README.dox49
-rw-r--r--parts/texttools/kdevtexttools.desktop84
-rw-r--r--parts/texttools/texttoolspart.cpp99
-rw-r--r--parts/texttools/texttoolspart.h39
-rw-r--r--parts/texttools/texttoolswidget.cpp400
-rw-r--r--parts/texttools/texttoolswidget.h54
-rw-r--r--parts/tipofday/Makefile.am24
-rw-r--r--parts/tipofday/README.dox8
-rw-r--r--parts/tipofday/hi16-action-ktip.pngbin0 -> 496 bytes
-rw-r--r--parts/tipofday/hi32-action-ktip.pngbin0 -> 1300 bytes
-rw-r--r--parts/tipofday/hi48-action-ktip.pngbin0 -> 1825 bytes
-rw-r--r--parts/tipofday/kdevpart_tipofday.rc8
-rw-r--r--parts/tipofday/kdevtipofday.desktop94
-rw-r--r--parts/tipofday/lo16-action-kdevelop_tip.pngbin0 -> 273 bytes
-rw-r--r--parts/tipofday/lo32-action-kdevelop_tip.pngbin0 -> 372 bytes
-rw-r--r--parts/tipofday/tipofday_part.cpp67
-rw-r--r--parts/tipofday/tipofday_part.h33
-rw-r--r--parts/tipofday/tips203
-rw-r--r--parts/tools/Makefile.am16
-rw-r--r--parts/tools/README.dox12
-rw-r--r--parts/tools/addtooldlg.ui245
-rw-r--r--parts/tools/addtooldlg.ui.h31
-rw-r--r--parts/tools/kapplicationtree.cpp258
-rw-r--r--parts/tools/kapplicationtree.h102
-rw-r--r--parts/tools/kdevpart_tools.rc14
-rw-r--r--parts/tools/kdevtools.desktop82
-rw-r--r--parts/tools/tools_part.cpp272
-rw-r--r--parts/tools/tools_part.h55
-rw-r--r--parts/tools/toolsconfig.cpp169
-rw-r--r--parts/tools/toolsconfig.h71
-rw-r--r--parts/tools/toolsconfigwidget.cpp284
-rw-r--r--parts/tools/toolsconfigwidget.h60
-rw-r--r--parts/tools/toolsconfigwidgetbase.ui410
-rw-r--r--parts/uimode/Makefile.am13
-rw-r--r--parts/uimode/README.dox8
-rw-r--r--parts/uimode/kdevuichooser.desktop87
-rw-r--r--parts/uimode/uichooser.ui250
-rw-r--r--parts/uimode/uichooser_part.cpp52
-rw-r--r--parts/uimode/uichooser_part.h32
-rw-r--r--parts/uimode/uichooser_widget.cpp153
-rw-r--r--parts/uimode/uichooser_widget.h42
-rw-r--r--parts/valgrind/Makefile.am15
-rw-r--r--parts/valgrind/README.dox45
-rw-r--r--parts/valgrind/dialog_widget.ui360
-rw-r--r--parts/valgrind/dialog_widget.ui.h21
-rw-r--r--parts/valgrind/kdevpart_valgrind.rc9
-rw-r--r--parts/valgrind/kdevvalgrind.desktop74
-rw-r--r--parts/valgrind/valgrind_dialog.cpp206
-rw-r--r--parts/valgrind/valgrind_dialog.h62
-rw-r--r--parts/valgrind/valgrind_part.cpp366
-rw-r--r--parts/valgrind/valgrind_part.h62
-rw-r--r--parts/valgrind/valgrind_widget.cpp205
-rw-r--r--parts/valgrind/valgrind_widget.h44
-rw-r--r--parts/valgrind/valgrinditem.cpp71
-rw-r--r--parts/valgrind/valgrinditem.h50
-rw-r--r--parts/vcsmanager/Makefile.am19
-rw-r--r--parts/vcsmanager/README.dox55
-rw-r--r--parts/vcsmanager/kdevvcsmanager.desktop65
-rw-r--r--parts/vcsmanager/vcsmanagerpart.cpp115
-rw-r--r--parts/vcsmanager/vcsmanagerpart.h57
-rw-r--r--parts/vcsmanager/vcsmanagerprojectconfig.cpp69
-rw-r--r--parts/vcsmanager/vcsmanagerprojectconfig.h45
-rw-r--r--parts/vcsmanager/vcsmanagerprojectconfigbase.ui58
-rw-r--r--pics/Makefile.am2
-rw-r--r--pics/hi16-app-kdevassistant.pngbin0 -> 1285 bytes
-rw-r--r--pics/hi16-app-kdevdesigner.pngbin0 -> 1372 bytes
-rw-r--r--pics/hi16-app-kdevelop.pngbin0 -> 894 bytes
-rw-r--r--pics/hi32-app-kdevassistant.pngbin0 -> 1970 bytes
-rw-r--r--pics/hi32-app-kdevdesigner.pngbin0 -> 2060 bytes
-rw-r--r--pics/hi32-app-kdevelop.pngbin0 -> 2456 bytes
-rw-r--r--pics/hi48-app-kdevassistant.pngbin0 -> 2654 bytes
-rw-r--r--pics/hi48-app-kdevdesigner.pngbin0 -> 2853 bytes
-rw-r--r--pics/hi48-app-kdevelop.pngbin0 -> 4631 bytes
-rw-r--r--pics/mini/CTchildren.pngbin0 -> 276 bytes
-rw-r--r--pics/mini/CTclients.pngbin0 -> 295 bytes
-rw-r--r--pics/mini/CTparents.pngbin0 -> 281 bytes
-rw-r--r--pics/mini/CTsuppliers.pngbin0 -> 295 bytes
-rw-r--r--pics/mini/CTvirtuals.pngbin0 -> 319 bytes
-rw-r--r--pics/mini/CVclass.pngbin0 -> 367 bytes
-rw-r--r--pics/mini/CVglobal_meth.pngbin0 -> 342 bytes
-rw-r--r--pics/mini/CVglobal_var.pngbin0 -> 313 bytes
-rw-r--r--pics/mini/CVnamespace.pngbin0 -> 310 bytes
-rw-r--r--pics/mini/CVpackage_meth.pngbin0 -> 332 bytes
-rw-r--r--pics/mini/CVpackage_var.pngbin0 -> 295 bytes
-rw-r--r--pics/mini/CVprivate_meth.pngbin0 -> 347 bytes
-rw-r--r--pics/mini/CVprivate_signal.pngbin0 -> 354 bytes
-rw-r--r--pics/mini/CVprivate_slot.pngbin0 -> 356 bytes
-rw-r--r--pics/mini/CVprivate_var.pngbin0 -> 314 bytes
-rw-r--r--pics/mini/CVprotected_meth.pngbin0 -> 346 bytes
-rw-r--r--pics/mini/CVprotected_signal.pngbin0 -> 352 bytes
-rw-r--r--pics/mini/CVprotected_slot.pngbin0 -> 353 bytes
-rw-r--r--pics/mini/CVprotected_var.pngbin0 -> 321 bytes
-rw-r--r--pics/mini/CVpublic_meth.pngbin0 -> 320 bytes
-rw-r--r--pics/mini/CVpublic_signal.pngbin0 -> 327 bytes
-rw-r--r--pics/mini/CVpublic_slot.pngbin0 -> 329 bytes
-rw-r--r--pics/mini/CVpublic_var.pngbin0 -> 293 bytes
-rw-r--r--pics/mini/CVstruct.pngbin0 -> 355 bytes
-rw-r--r--pics/mini/CVtypedef.pngbin0 -> 287 bytes
-rw-r--r--pics/mini/Makefile.am8
-rw-r--r--pics/mini/indicator_connect.pngbin0 -> 244 bytes
-rw-r--r--pics/mini/indicator_noconnect.pngbin0 -> 157 bytes
-rw-r--r--pics/misc/Makefile.am3
-rw-r--r--pics/misc/kdevassistant-splash.pngbin0 -> 24776 bytes
-rw-r--r--pics/misc/kdevdesigner-splash.pngbin0 -> 22232 bytes
-rw-r--r--pics/misc/kdevelop-splash.pngbin0 -> 21003 bytes
-rw-r--r--pics/toolbar/Makefile.am14
-rw-r--r--pics/toolbar/hi16-action-classnew.pngbin0 -> 415 bytes
-rw-r--r--pics/toolbar/hi16-action-dbgwatchvar.pngbin0 -> 192 bytes
-rw-r--r--pics/toolbar/hi16-action-dirsynch.pngbin0 -> 653 bytes
-rw-r--r--pics/toolbar/hi16-action-make_kdevelop.pngbin0 -> 454 bytes
-rw-r--r--pics/toolbar/hi16-action-methodnew.pngbin0 -> 369 bytes
-rw-r--r--pics/toolbar/hi16-action-newwidget.pngbin0 -> 441 bytes
-rw-r--r--pics/toolbar/hi16-action-project_open.pngbin0 -> 574 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_app.pngbin0 -> 504 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_app_disabled.pngbin0 -> 564 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_func_scope.pngbin0 -> 299 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_inc_scope.pngbin0 -> 291 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_lib.pngbin0 -> 211 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_lib_disabled.pngbin0 -> 276 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_scope.pngbin0 -> 310 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_scopenew.pngbin0 -> 591 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_sub.pngbin0 -> 733 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_sub_disabled.pngbin0 -> 686 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_subclass.pngbin0 -> 259 bytes
-rw-r--r--pics/toolbar/hi16-action-qmake_ui_h.pngbin0 -> 194 bytes
-rw-r--r--pics/toolbar/hi16-action-qmakerun.pngbin0 -> 961 bytes
-rw-r--r--pics/toolbar/hi16-action-qtdesigner.pngbin0 -> 542 bytes
-rw-r--r--pics/toolbar/hi16-action-rebuild.pngbin0 -> 495 bytes
-rw-r--r--pics/toolbar/hi16-action-reload_page.pngbin0 -> 715 bytes
-rw-r--r--pics/toolbar/hi16-action-remove_subdir.pngbin0 -> 873 bytes
-rw-r--r--pics/toolbar/hi16-action-servicenew_kdevelop.pngbin0 -> 957 bytes
-rw-r--r--pics/toolbar/hi16-action-target_kdevelop.pngbin0 -> 266 bytes
-rw-r--r--pics/toolbar/hi16-action-targetnew_kdevelop.pngbin0 -> 393 bytes
-rw-r--r--pics/toolbar/hi16-action-variablenew.pngbin0 -> 343 bytes
-rw-r--r--pics/toolbar/hi22-action-classnew.pngbin0 -> 908 bytes
-rw-r--r--pics/toolbar/hi22-action-classwiz.pngbin0 -> 334 bytes
-rw-r--r--pics/toolbar/hi22-action-configure_file.pngbin0 -> 1353 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgjumpto.pngbin0 -> 353 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgmemview.pngbin0 -> 154 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgnext.pngbin0 -> 187 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgnextinst.pngbin0 -> 207 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgparam.pngbin0 -> 154 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgrestart.pngbin0 -> 222 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgrun.pngbin0 -> 244 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgrunto.pngbin0 -> 275 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgstep.pngbin0 -> 182 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgstepinst.pngbin0 -> 202 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgstepout.pngbin0 -> 204 bytes
-rw-r--r--pics/toolbar/hi22-action-dbgvar.pngbin0 -> 141 bytes
-rw-r--r--pics/toolbar/hi22-action-debugger.pngbin0 -> 1216 bytes
-rw-r--r--pics/toolbar/hi22-action-grep.pngbin0 -> 357 bytes
-rw-r--r--pics/toolbar/hi22-action-make_kdevelop.pngbin0 -> 425 bytes
-rw-r--r--pics/toolbar/hi22-action-newwidget.pngbin0 -> 525 bytes
-rw-r--r--pics/toolbar/hi22-action-output_win.pngbin0 -> 975 bytes
-rw-r--r--pics/toolbar/hi22-action-project_open.pngbin0 -> 814 bytes
-rw-r--r--pics/toolbar/hi22-action-qmake_scopenew.pngbin0 -> 821 bytes
-rw-r--r--pics/toolbar/hi22-action-qmakerun.pngbin0 -> 1553 bytes
-rw-r--r--pics/toolbar/hi22-action-rebuild.pngbin0 -> 851 bytes
-rw-r--r--pics/toolbar/hi22-action-reload_page.pngbin0 -> 1260 bytes
-rw-r--r--pics/toolbar/hi22-action-save_all.pngbin0 -> 436 bytes
-rw-r--r--pics/toolbar/hi22-action-tree_win.pngbin0 -> 575 bytes
-rw-r--r--pics/toolbar/hi32-action-classnew.pngbin0 -> 1266 bytes
-rw-r--r--pics/toolbar/hi32-mime-kdevelop_project.pngbin0 -> 687 bytes
-rw-r--r--src/Mainpage.dox118
-rw-r--r--src/Makefile.am57
-rw-r--r--src/api.cpp60
-rw-r--r--src/api.h41
-rw-r--r--src/core.cpp118
-rw-r--r--src/core.h71
-rw-r--r--src/documentationpart.cpp21
-rw-r--r--src/documentationpart.h25
-rw-r--r--src/editorproxy.cpp297
-rw-r--r--src/editorproxy.h67
-rw-r--r--src/eventsrc147
-rw-r--r--src/generalinfowidget.cpp292
-rw-r--r--src/generalinfowidget.h53
-rw-r--r--src/generalinfowidgetbase.ui245
-rw-r--r--src/kconf_update/Makefile.am18
-rw-r--r--src/kconf_update/kdev-gen-settings-kconf_update.cpp113
-rw-r--r--src/kconf_update/kdev-gen-settings.upd8
-rw-r--r--src/kdevassistantextension.cpp40
-rw-r--r--src/kdevassistantextension.h41
-rw-r--r--src/kdevassistantrc14
-rw-r--r--src/kdevassistantui.rc168
-rw-r--r--src/kdeveloprc70
-rw-r--r--src/kdevelopui.rc191
-rw-r--r--src/kdevideextension.cpp129
-rw-r--r--src/kdevideextension.h45
-rw-r--r--src/kdevpluginprofilerc52
-rw-r--r--src/languageselectwidget.cpp165
-rw-r--r--src/languageselectwidget.h51
-rw-r--r--src/main.cpp153
-rw-r--r--src/main_assistant.cpp115
-rw-r--r--src/mainwindowshare.cpp451
-rw-r--r--src/mainwindowshare.h88
-rw-r--r--src/mimewarningdialog.ui254
-rw-r--r--src/multibuffer.cpp303
-rw-r--r--src/multibuffer.h89
-rw-r--r--src/newui/Makefile.am14
-rw-r--r--src/newui/button.cpp350
-rw-r--r--src/newui/button.h108
-rw-r--r--src/newui/buttonbar.cpp346
-rw-r--r--src/newui/buttonbar.h112
-rw-r--r--src/newui/comdefs.h30
-rw-r--r--src/newui/ddockwindow.cpp413
-rw-r--r--src/newui/ddockwindow.h114
-rw-r--r--src/newui/dmainwindow.cpp309
-rw-r--r--src/newui/dmainwindow.h113
-rw-r--r--src/newui/docksplitter.cpp175
-rw-r--r--src/newui/docksplitter.h62
-rw-r--r--src/newui/dtabwidget.cpp106
-rw-r--r--src/newui/dtabwidget.h58
-rw-r--r--src/partcontroller.cpp1867
-rw-r--r--src/partcontroller.h232
-rw-r--r--src/plugincontroller.cpp391
-rw-r--r--src/plugincontroller.h96
-rw-r--r--src/pluginselectdialog.cpp181
-rw-r--r--src/pluginselectdialog.h42
-rw-r--r--src/pluginselectdialogbase.ui179
-rw-r--r--src/profileengine/Makefile.am3
-rw-r--r--src/profileengine/editor/Makefile.am22
-rw-r--r--src/profileengine/editor/addprofilewidget.ui121
-rw-r--r--src/profileengine/editor/main.cpp45
-rw-r--r--src/profileengine/editor/profileeditor.cpp400
-rw-r--r--src/profileengine/editor/profileeditor.h69
-rw-r--r--src/profileengine/editor/profileeditorbase.ui680
-rw-r--r--src/profileengine/lib/Mainpage.dox10
-rw-r--r--src/profileengine/lib/Makefile.am16
-rw-r--r--src/profileengine/lib/profile.cpp205
-rw-r--r--src/profileengine/lib/profile.h96
-rw-r--r--src/profileengine/lib/profileengine.cpp264
-rw-r--r--src/profileengine/lib/profileengine.h272
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/AdaIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/AdaIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/Makefile.am4
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/FortranIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/FortranIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/JavaIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/JavaIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/Makefile.am4
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/PascalIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/PascalIDE/profile.config12
-rw-r--r--src/profiles/IDE/CompiledLanguageIDE/profile.config12
-rw-r--r--src/profiles/IDE/DatabaseIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/DatabaseIDE/profile.config12
-rw-r--r--src/profiles/IDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/Makefile.am4
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/profile.config12
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/profile.config12
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/profile.config12
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/profile.config12
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/Makefile.am3
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/profile.config12
-rw-r--r--src/profiles/IDE/ScriptingLanguageIDE/profile.config12
-rw-r--r--src/profiles/IDE/profile.config12
-rw-r--r--src/profiles/KDevAssistant/Makefile.am3
-rw-r--r--src/profiles/KDevAssistant/profile.config12
-rw-r--r--src/profiles/Makefile.am3
-rw-r--r--src/profiles/profile.config3
-rw-r--r--src/projectmanager.cpp668
-rw-r--r--src/projectmanager.h111
-rw-r--r--src/projectprofiles39
-rw-r--r--src/projectsession.cpp450
-rw-r--r--src/projectsession.h89
-rw-r--r--src/settingswidget.ui528
-rw-r--r--src/shellextension.cpp26
-rw-r--r--src/shellextension.h62
-rw-r--r--src/simplemainwindow.cpp1011
-rw-r--r--src/simplemainwindow.h140
-rw-r--r--src/splashscreen.cpp85
-rw-r--r--src/splashscreen.h38
-rw-r--r--src/statusbar.cpp112
-rw-r--r--src/statusbar.h51
-rw-r--r--src/toplevel.cpp35
-rw-r--r--src/toplevel.h27
-rw-r--r--vcs/Makefile.am39
-rw-r--r--vcs/clearcase/Makefile.am18
-rw-r--r--vcs/clearcase/README3
-rw-r--r--vcs/clearcase/README.dox42
-rw-r--r--vcs/clearcase/clearcasefileinfoprovider.cpp66
-rw-r--r--vcs/clearcase/clearcasefileinfoprovider.h50
-rw-r--r--vcs/clearcase/clearcasemanipulator.cpp133
-rw-r--r--vcs/clearcase/clearcasemanipulator.h49
-rw-r--r--vcs/clearcase/clearcasepart.cpp363
-rw-r--r--vcs/clearcase/clearcasepart.h65
-rw-r--r--vcs/clearcase/commentdlg.cpp61
-rw-r--r--vcs/clearcase/commentdlg.h32
-rw-r--r--vcs/clearcase/integrator/Makefile.am13
-rw-r--r--vcs/clearcase/integrator/ccintegratordlg.cpp40
-rw-r--r--vcs/clearcase/integrator/ccintegratordlg.h36
-rw-r--r--vcs/clearcase/integrator/ccintegratordlgbase.ui47
-rw-r--r--vcs/clearcase/integrator/clearcaseintegrator.cpp54
-rw-r--r--vcs/clearcase/integrator/clearcaseintegrator.h39
-rw-r--r--vcs/clearcase/integrator/kdevclearcaseintegrator.desktop44
-rw-r--r--vcs/clearcase/kdevclearcase.desktop82
-rw-r--r--vcs/cvsservice/Makefile.am40
-rw-r--r--vcs/cvsservice/README1
-rw-r--r--vcs/cvsservice/README.dox82
-rw-r--r--vcs/cvsservice/annotatedialog.cpp68
-rw-r--r--vcs/cvsservice/annotatedialog.h65
-rw-r--r--vcs/cvsservice/annotatepage.cpp257
-rw-r--r--vcs/cvsservice/annotatepage.h125
-rw-r--r--vcs/cvsservice/annotateview.cpp221
-rw-r--r--vcs/cvsservice/annotateview.h55
-rw-r--r--vcs/cvsservice/bufferedstringreader.cpp47
-rw-r--r--vcs/cvsservice/bufferedstringreader.h44
-rw-r--r--vcs/cvsservice/buildcvs.sh25
-rw-r--r--vcs/cvsservice/changelog.cpp114
-rw-r--r--vcs/cvsservice/changelog.h45
-rw-r--r--vcs/cvsservice/checkoutdialog.cpp276
-rw-r--r--vcs/cvsservice/checkoutdialog.h90
-rw-r--r--vcs/cvsservice/checkoutdialogbase.ui312
-rw-r--r--vcs/cvsservice/commitdialogbase.ui161
-rw-r--r--vcs/cvsservice/commitdlg.cpp92
-rw-r--r--vcs/cvsservice/commitdlg.h45
-rw-r--r--vcs/cvsservice/cvsdiffpage.cpp134
-rw-r--r--vcs/cvsservice/cvsdiffpage.h55
-rw-r--r--vcs/cvsservice/cvsdir.cpp321
-rw-r--r--vcs/cvsservice/cvsdir.h103
-rw-r--r--vcs/cvsservice/cvsentry.cpp187
-rw-r--r--vcs/cvsservice/cvsentry.h56
-rw-r--r--vcs/cvsservice/cvsfileinfoprovider.cpp314
-rw-r--r--vcs/cvsservice/cvsfileinfoprovider.h79
-rw-r--r--vcs/cvsservice/cvsform.cpp83
-rw-r--r--vcs/cvsservice/cvsform.h37
-rw-r--r--vcs/cvsservice/cvsformbase.ui223
-rw-r--r--vcs/cvsservice/cvslogdialog.cpp113
-rw-r--r--vcs/cvsservice/cvslogdialog.h50
-rw-r--r--vcs/cvsservice/cvslogpage.cpp212
-rw-r--r--vcs/cvsservice/cvslogpage.h63
-rw-r--r--vcs/cvsservice/cvsoptions.cpp288
-rw-r--r--vcs/cvsservice/cvsoptions.h102
-rw-r--r--vcs/cvsservice/cvsoptionswidget.cpp190
-rw-r--r--vcs/cvsservice/cvsoptionswidget.h62
-rw-r--r--vcs/cvsservice/cvsoptionswidgetbase.ui230
-rw-r--r--vcs/cvsservice/cvspart.cpp780
-rw-r--r--vcs/cvsservice/cvspart.h173
-rw-r--r--vcs/cvsservice/cvspartimpl.cpp1012
-rw-r--r--vcs/cvsservice/cvspartimpl.h354
-rw-r--r--vcs/cvsservice/cvsprocesswidget.cpp288
-rw-r--r--vcs/cvsservice/cvsprocesswidget.h77
-rw-r--r--vcs/cvsservice/cvsservicedcopIface.h29
-rw-r--r--vcs/cvsservice/diffdialog.cpp89
-rw-r--r--vcs/cvsservice/diffdialog.h42
-rw-r--r--vcs/cvsservice/diffdialogbase.ui275
-rw-r--r--vcs/cvsservice/diffwidget.cpp331
-rw-r--r--vcs/cvsservice/diffwidget.h103
-rw-r--r--vcs/cvsservice/editorsdialog.cpp134
-rw-r--r--vcs/cvsservice/editorsdialog.h43
-rw-r--r--vcs/cvsservice/editorsdialogbase.ui88
-rw-r--r--vcs/cvsservice/integrator/Makefile.am12
-rw-r--r--vcs/cvsservice/integrator/cvsserviceintegrator.cpp52
-rw-r--r--vcs/cvsservice/integrator/cvsserviceintegrator.h38
-rw-r--r--vcs/cvsservice/integrator/fetcherdlgbase.ui153
-rw-r--r--vcs/cvsservice/integrator/initdlg.ui71
-rw-r--r--vcs/cvsservice/integrator/integratordlg.cpp191
-rw-r--r--vcs/cvsservice/integrator/integratordlg.h48
-rw-r--r--vcs/cvsservice/integrator/integratordlgbase.ui398
-rw-r--r--vcs/cvsservice/integrator/kdevcvsserviceintegrator.desktop45
-rw-r--r--vcs/cvsservice/jobscheduler.cpp55
-rw-r--r--vcs/cvsservice/jobscheduler.h51
-rw-r--r--vcs/cvsservice/kdev_cvs.pngbin0 -> 721 bytes
-rw-r--r--vcs/cvsservice/kdev_cvs.xcfbin0 -> 18033 bytes
-rw-r--r--vcs/cvsservice/kdevcvsservice.desktop77
-rw-r--r--vcs/cvsservice/kdevcvsservicepart.rc36
-rw-r--r--vcs/cvsservice/releaseinputdialog.cpp66
-rw-r--r--vcs/cvsservice/releaseinputdialog.h55
-rw-r--r--vcs/cvsservice/releaseinputdialogbase.ui246
-rw-r--r--vcs/cvsservice/tagdialog.cpp74
-rw-r--r--vcs/cvsservice/tagdialog.h51
-rw-r--r--vcs/cvsservice/tagdialogbase.ui159
-rw-r--r--vcs/perforce/Makefile.am19
-rw-r--r--vcs/perforce/README3
-rw-r--r--vcs/perforce/README.dox15
-rw-r--r--vcs/perforce/commitdlg.cpp161
-rw-r--r--vcs/perforce/commitdlg.h57
-rw-r--r--vcs/perforce/integrator/Makefile.am13
-rw-r--r--vcs/perforce/integrator/kdevperforceintegrator.desktop44
-rw-r--r--vcs/perforce/integrator/perforceintegrator.cpp54
-rw-r--r--vcs/perforce/integrator/perforceintegrator.h39
-rw-r--r--vcs/perforce/integrator/pfintegratordlg.cpp40
-rw-r--r--vcs/perforce/integrator/pfintegratordlg.h36
-rw-r--r--vcs/perforce/integrator/pfintegratordlgbase.ui47
-rw-r--r--vcs/perforce/kdevperforce.desktop82
-rw-r--r--vcs/perforce/kdevperforcepart.rc23
-rw-r--r--vcs/perforce/perforcepart.cpp364
-rw-r--r--vcs/perforce/perforcepart.h79
-rw-r--r--vcs/subversion/Makefile.am38
-rw-r--r--vcs/subversion/README.dox13
-rw-r--r--vcs/subversion/commitdlg.cpp47
-rw-r--r--vcs/subversion/commitdlg.h37
-rw-r--r--vcs/subversion/commitdlgbase.ui111
-rw-r--r--vcs/subversion/configure.in.bot9
-rw-r--r--vcs/subversion/configure.in.in134
-rw-r--r--vcs/subversion/integrator/Makefile.am14
-rw-r--r--vcs/subversion/integrator/kdevsubversionintegrator.desktop45
-rw-r--r--vcs/subversion/integrator/subversionintegrator.cpp54
-rw-r--r--vcs/subversion/integrator/subversionintegrator.h39
-rw-r--r--vcs/subversion/integrator/svnintegratordlg.cpp122
-rw-r--r--vcs/subversion/integrator/svnintegratordlg.h39
-rw-r--r--vcs/subversion/integrator/svnintegratordlgbase.ui190
-rw-r--r--vcs/subversion/kdevpart_subversion.rc31
-rw-r--r--vcs/subversion/kdevsubversion.desktop34
-rw-r--r--vcs/subversion/kdevsvn+file.protocol39
-rw-r--r--vcs/subversion/kdevsvn+http.protocol39
-rw-r--r--vcs/subversion/kdevsvn+https.protocol39
-rw-r--r--vcs/subversion/kdevsvn+ssh.protocol39
-rw-r--r--vcs/subversion/kdevsvn+svn.protocol39
-rw-r--r--vcs/subversion/kdevsvnd.cpp394
-rw-r--r--vcs/subversion/kdevsvnd.desktop31
-rw-r--r--vcs/subversion/kdevsvnd.h50
-rw-r--r--vcs/subversion/kdevsvnd_widgets.cpp70
-rw-r--r--vcs/subversion/kdevsvnd_widgets.h41
-rw-r--r--vcs/subversion/subversion_core.cpp738
-rw-r--r--vcs/subversion/subversion_core.h105
-rw-r--r--vcs/subversion/subversion_fileinfo.cpp507
-rw-r--r--vcs/subversion/subversion_fileinfo.h73
-rw-r--r--vcs/subversion/subversion_global.h56
-rw-r--r--vcs/subversion/subversion_part.cpp569
-rw-r--r--vcs/subversion/subversion_part.h119
-rw-r--r--vcs/subversion/subversion_widget.cpp136
-rw-r--r--vcs/subversion/subversion_widget.h95
-rw-r--r--vcs/subversion/subversiondiff.ui100
-rw-r--r--vcs/subversion/subversionprojectwidget.ui89
-rw-r--r--vcs/subversion/svn_blamewidget.cpp135
-rw-r--r--vcs/subversion/svn_blamewidget.h77
-rw-r--r--vcs/subversion/svn_co.ui335
-rw-r--r--vcs/subversion/svn_commitdlgbase.ui131
-rw-r--r--vcs/subversion/svn_copydlgwidget.ui238
-rw-r--r--vcs/subversion/svn_copywidget.cpp75
-rw-r--r--vcs/subversion/svn_copywidget.h32
-rw-r--r--vcs/subversion/svn_fileselectdlg_commit.cpp163
-rw-r--r--vcs/subversion/svn_fileselectdlg_commit.h52
-rw-r--r--vcs/subversion/svn_kio.cpp2155
-rw-r--r--vcs/subversion/svn_kio.h163
-rw-r--r--vcs/subversion/svn_logviewoptiondlgbase.ui156
-rw-r--r--vcs/subversion/svn_logviewwidget.cpp273
-rw-r--r--vcs/subversion/svn_logviewwidget.h93
-rw-r--r--vcs/subversion/svn_mergeoptiondlgbase.ui374
-rw-r--r--vcs/subversion/svn_mergewidget.cpp99
-rw-r--r--vcs/subversion/svn_mergewidget.h50
-rw-r--r--vcs/subversion/svn_switchdlgbase.ui213
-rw-r--r--vcs/subversion/svn_switchwidget.cpp60
-rw-r--r--vcs/subversion/svn_switchwidget.h31
-rw-r--r--vcs/subversion/svnssltrustpromptbase.ui116
-rw-r--r--x-kdevelop.desktop41
4114 files changed, 596955 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 00000000..b2a4a628
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,88 @@
+Bernd Gehrmann <bernd@physik.hu-berlin.de>
+
+Debugger frontend:
+ John Birch <jbb@kdevelop.org>
+
+C++ source parser:
+ Jonas Nordin <jonas.nordin@cenacle.se>
+
+Java support:
+ Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+Framework, dialogs, PHP support:
+ Sandy Meier <smeier@kdevelop.org>
+
+Several parts, htdig searching & indexing:
+ Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+
+Help with Automake manager:
+ Victor Roeder <victor_roeder@gmx.de>
+
+KDE application templates:
+ Kurth Granroth <kurt@granroth.org>
+
+editing component:
+ The KWrite authors <kwrite-devel@kde.org>
+
+QEditor part, help for code-completion, abbrev part:
+ Roberto Raggi <roberto@kdevelop.org>
+
+Qt 3 port, various patches:
+ Harald Fernengel <harry@kdevelop.org>
+
+Help with KParts, KGenericFactory and other KDE infrastructure:
+ Simon Hausmann <hausmann@kde.org>
+
+Subversion KPart:
+ Mickael Marchand <marchand@kde.org>
+
+Patches:
+ Dominic Seichter <domseichter@t-online.de>
+ Yann Hodique <Yann.Hodique@lifl.fr>
+ Heinz Hornung <Hornung-Heinz@t-online.de>
+
+SplashScreens:
+ Marion Klein <MarionKlein@wanadoo.fr>
+ Ram� Lamana Villar <ramon@alumnos.upm.es>
+
+KDevTabBar, bug fixes, Gideon Release:
+ Caleb Tennis <caleb@aei-tech.com>
+
+PartExplorer, (bugs for) CvsPart:
+ Mario Scalas <mario.scalas@libero.it>
+
+Pascal support and project parts, Filecreate GUI,
+Documentation viewer improvements
+ Alexander Dymo <cloudtemple@mksat.net>
+
+Application wizard improvementes, application templates, documentation, bug fixes:
+ Dominik Haumann <dhdev@gmx.de>
+
+DistPart, Bash Shell Support:
+ Ian Reinhart Geiser <geiseri@kde.org>
+
+API Documentation, Run Options, code reorganization. Fixes for project templates, autotools and doxygen.
+ Amilcar Lucas <a.lucas@tu-bs.de>
+
+Replace plugin, Bookmarks plugin, FileList plugin, CTags2 plugin, Overall improvements and patches
+ Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+SnippetPart, debugger and usability patches
+ Robert Gruber <rgruber@users.sourceforge.net>
+
+
+Other software included in the source package:
+
+* KDE 2.0 Development Book
+ David Sweet, et al.
+ Copyright notices see in doc/kde2book
+
+* GNU libc documentation
+ Sandra Loosemore, Richard M. Stallman, Roland McGrath,
+ Andrew Oram, and Ulrich Drepper
+ Copyright notices see in doc/libc
+
+* STL documentation
+ SGI, Inc.
+ Copyright notices see in doc/stl
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 00000000..5b6e7c66
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/COPYING.LIB b/COPYING.LIB
new file mode 100644
index 00000000..e38ffa83
--- /dev/null
+++ b/COPYING.LIB
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330
+ Boston, MA 02111-1307, USA.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 00000000..7f6393db
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,2846 @@
+2007-12-03 Richard Dale <rdale@foton.es>
+* Added a QtRuby4 project based on the C++ Qt4 one
+
+2007-10-16 Richard Dale <rdale@foton.es>
+* Added Rails 2.0 file type suffixes; .html.erb, .js.rjs and .xml.builder
+
+2006-12-13 Matt Rogers <mattr@kde.org>
+ * KDevelop 3.4 RC 2 (with many more things than listed here)
+
+2006-11-08 Matt Rogers <mattr@kde.org>
+ * KDevelop 3.4 RC 1 (with many more things than listed here)
+
+2006-08-06 Andreas Pakulat <apaku@gmx.de>
+* Implemented Support for Qt4 qmake in the qmake buildsystem
+ # Recognize the QT option
+ # Support RESOURCES variable
+ # cleanup the configuration
+ # provide an import configuration for Qt4 projects
+
+2006-04-26 Jens Dagerbo <jens.dagerbo@swipnet.se>
+* Made the ClassView restore it's state after a refresh. It will no
+ longer close up after each successful build.
+
+2006-04-24 Jens Dagerbo <jens.dagerbo@swipnet.se>
+* Added "Goto Last Edit Position" action. A regular menu/toolbar/shortcut
+ action to open the file and position the cursor at the point of the
+ last edit.
+
+2006-04-14 Jens Dagerbo <jens.dagerbo@swipnet.se>
+* Improved support for encodings
+ # KDevelop will now obey the selected encoding in the File Open dialog
+ # The OpenWith plugin now offers all available encodings in "Open As"
+ # The encoding for each open file is saved with the session, and will
+ be used to open that file the next time the project is loaded
+ # Default encoding can be set per project in the Project Options -
+ this will be the default when opening a file
+ # File Open encoding will default to the open project's default
+
+2006-04-07 Jens Dagerbo <jens.dagerbo@swipnet.se>
+* Added KDevShellWidget - a thin wrapper around konsolepart, aimed at
+ executing shell type applications.
+
+2006-03-25 Jens Dagerbo <jens.dagerbo@swipnet.se>
+* Added support for multiple tags files for Ctags2 plugin, enabling
+ it to optionally cover external libraries in addition to the active
+ project. Work based on patch by Etay Meiri.
+
+2006-03-15 Richard Dale <rdale@foton.es>
+* Added a 'sync terminal' option to the configuration settings to
+ disable the 'cd' commands in the konsole by default.
+
+2006-02-21 Richard Dale <rdale@foton.es>
+* Disable the new file sidetab by default
+
+2006-02-21 Richard Dale <rdale@foton.es>
+* Add the pid to the filename of the Unix domain socket used by the ruby
+ debugger so that more than one instance of KDevelop can be run on a
+ machine.
+
+2006-02-21 Richard Dale <rdale@foton.es>
+* The Full Screen mode menu option is under the Settings menu in both
+ Kate and Konqueror, and they arguably have it in the wrong place.
+ But it's probably better to make KDevelop consistent with other KDE
+ apps even if they're slighty wrong. So move the menu under settings
+
+2006-02-17 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* Removed the 'Type' column from the Ruby debugger as the C++
+ debugger no longer has one
+
+2006-01-30 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* Added a minimal C# language project type based on the perl one.
+
+2006-01-30 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* Added file templates for Rails projects; rhtml, rxml, css and js
+* Fixed documentation links for QtRuby/Korundum, added some
+ links for Rails
+
+2006-01-19 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* Added a Rails project template
+* Use the Run menu option to start WEBrick. If the Rails project doesn't
+ exist it will be created.
+* The script/console runs in the Terminal instead of irb
+
+2006-01-16 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* Added .ocl extension for Onboard Control Language sources used for
+ C files in some satellites
+
+2005-08-17 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+* The $SHELL environment variable is set to 'irb' for ruby projects.
+* Added a project option to customise the ruby shell
+* A 'def cd(dir) Dir.chdir dir end' line must be added to your
+ .irbrc file to prevent syntax errors when konsole changes directory
+
+2005-06-28 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+ * Fixed bug in 'run main program' project option where the .ui file was out of
+ sync with the code
+ * Add a 'show constants in debugger' project option. This is needed because there
+ are so many constants in the qtruby/korundum classes that it slows the debugger
+ right down and clutters the variables view.
+ * Added a 'Trace into Ruby' project option to show ruby code from installed libraries
+ in the debugger.
+ * The debugger can now expand instance variables nested within instance variables
+ using get_instance_variable().
+ * Improved the parsing of pretty printed items that are all on one line, as opposed to
+ one line per name=value pair.
+
+2005-06-25 Pieter Pareit <pieter.pareit@scarlet.be>
+ * Added ruby_{run,config} icons, the .png files are used by kdevelop,
+ the .psd files can be used by artists when icons need to be changed
+ Thanks Zoran Karavla for the artwork!
+
+2005-05-26 Tobias Erbsland <te@profzone.ch>
+ * Added new class QtBuildConfig. This class stores the configuration
+ about the used Qt library. Is Qt used, which major version and
+ where the Qt library path (QTDIR) for this project is.
+ In a later step, it's possible to use different qt installations
+ for each project. E.g. you develop on a KDE4.x programm under KDE3.x.
+ * Added a new tab in the C++ options dialog (CCConfigWidget).
+ The user can edit the configuration QtBuildConfig in this tab.
+ * New class wizard:
+ - Qt checkboxes are disabled (hide them?) on non-qt projects.
+ - Different code is generated for Qt3.x and Qt4.x projects.
+ - Includes of classes that starting with "Q" bypasses the
+ normal template settings. In Qt3.x the include file has always
+ a lowercase include name with a ".h" suffix, and Qt4.x has
+ a mixed case include name without any suffix.
+ - Added the email address to the author's name if it exists.
+
+2005-05-26 Tobias Erbsland <te@profzone.ch>
+ * Replaced static hash table in lexer by a QMap
+ I found no performance impacts by this replacement, but the code
+ was getting much smaller and cleaner.
+ * Added Q_DECLARE_FLAGS and Q_DECLARE_OPERATORS_FOR_FLAGS macros
+ that are used in Qt4 for the special QFlags template.
+ * Added the keyword (macro) "foreach" to the lexer and parser that
+ is introduced by Qt4.
+ In a later step I will add the correct parsing, that the initial
+ variable is identified by the parser that code completion works.
+
+2005-04-05 Robert Gruber <rgruber@users.sourceforge.net>
+ * Added support for CVS' annotate command
+
+2005-03-24 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+ * Added missing ruby debugger icons installation
+
+2005-03-01 Matt Rogers <mattr@kde.org>
+ * Fix bug 71926 by not using beautifyToolTip since it breaks i18n
+ * Fix bug 71708 by giving the environment variable dialogs a parent
+ so they can't get hidden behind other windows
+
+2005-02-23 Alexander Dymo <adymo@kdevelop.org>
+ * Fix compilation on KDE 3.2
+
+2005-02-22 Alexander Neundorf <neundorf@kde.org>
+ * Added partial support for building kdevelop with cmake
+
+2005-02-22 Alexander Dymo <adymo@kdevelop.org>
+ * Added a qmake parser to help implementing a much better qmake project
+ manager
+
+2005-02-17 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Add the 'Configure Toolbox' and 'Edit Custom Widget' menu items back to
+ the tools menu when designer intergration is activated.
+
+2005-02-07 Matt Rogers <mattr@kde.org>
+ * Pull information from the CVS/Entries file to populate version control
+ information in the file tree on first load. This eliminates the need to
+ use 'Sync with Repository' when KDevelop is first loaded, but it is needed
+ to update the version control info.
+
+2005-02-02 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+ * Fixed Java KDE app framework template so it compiles
+
+2005-02-01 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Implemented a fix for BR 91757 which also removes the silly runtime dependency we had on kdebase
+
+2005-01-28 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+ * Added a Ruby KConfig XT project template
+
+2005-01-25 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Reimplemented "Forward" for source navigation history
+
+2005-01-23 Amilcar Lucas <amilcar@kdevelop.org>
+ * Updated support for Doxygen up to 1.4.1
+
+2005-01-22 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Global scope plugins are once again optional.
+ * Fixed source navigation history (by reducing the ambition to something that can work).
+ * Added the Version Control Manager plugin. Now we can decide which VCS system to use again. :)
+
+2005-01-20 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Further cleanup of plugin handling in PluginController/ProjectManager.
+ * Removed the last traces of in-project language switching.
+
+2005-01-09 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Finished the new CTags frontend.
+
+2005-01-08 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Made it possible to finally remove Code Completion databases via the GUI
+ * Cleaned up the context menu mess (at least it's optional now, and the code
+ is cleaner).
+
+2005-01-03 Robert Gruber <rgruber@users.sourceforge.net>
+ * Added support for CVS commands edit, unedit and editors
+
+2004-12-19 Alexander Dymo <adymo@kdevelop.org>
+ * Made it possible to add custom build commands (like make install-exec)
+ for the subproject context menu in automake manager.
+
+2004-12-17 Alexander Dymo <adymo@kdevelop.org>
+ * Advanced subclassing option in C++ New Class Wizard can be used
+ for classes in the persistant class store. This means that if
+ the PCS for Qt library is built then advanced subclassing from
+ Qt classes is possible in the wizard.
+
+2004-12-15 Alexander Dymo <adymo@kdevelop.org>
+ * Finished the implementation of plugin profiles for KDevelop shell
+ and shell extension architecture.
+ This means that KDevelop IDE becomes a KDevelop Platform now. And
+ KDevelop IDE is now only a program built on KDevelop Platform.
+ * Made KDevelop Assistant to use KDevelop Platfrom.
+ * Implemented profile detection for projects. Now, for example, when you open
+ C++ language project KDevelop loads "CppIDE" profile. If a project file
+ has KDE keyword set then KDevelop loads "KDECppIDE" profile (profile defines
+ a list of plugins to be loaded and unloaded). kdevprofileeditor will show
+ all information related to the profile.
+
+2004-11-23 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Added some ruby project options which are used for both debugging and an
+ ordinary run.
+ - Main program (this is in addition to the automake project main program)
+ - Program arguments
+ - Run main program or run selected window options
+ * The '-K' character coding project option is now passed to the debugger too
+
+2004-11-22 Alexander Dymo <adymo@kdevelop.org>
+ * Implemented simple VCS integrators for Clearcase, Perforce and Subversion.
+ * Reenabled subversion support plugin.
+ * Imported svn kioslave from kdesdk HEAD into a compat library therefore svn
+ will work on KDE<3.3.90 too.
+
+2004-11-21 Alexander Dymo <adymo@kdevelop.org>
+ * Added KDevVCSIntegrator extra interface. VCS Integrator is a plugin which is used by
+ application wizard to select a version control and possibly import newly created project
+ into the VCS.
+ * Implemented VCS integrator for CVS (Cervisia).
+ * Patched ProjectManager to load selected VCS plugin.
+
+2004-11-20 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Ruby Source Code Debugger initial checkin
+ * Based on John Birch's gdb front end, the UI is very similar. There are no
+ assembly language step options or disassembly viewers, but pretty much
+ everything else is much the same in ruby as for gdb/C++.
+ * You can set breakpoints on file/line or file/method, watchpoints to break when
+ a ruby expression is valid and catchpoints to break when an exception is thrown.
+ * The Watch variable viewer allows ruby expressions to be watched, and they are
+ updated on program pause.
+ * A configuration option was added to enable/disable the debugger floating toolbar.
+ * The debugger backend is written in pure ruby using the code from the 'debug.rb',
+ source included with the ruby distribution. It is started via KProcess which handles
+ redirection of stdout and stderr. The idea came from the way Laurent Julliard
+ implemented the FreeRIDE ruby debugger - it uses Distributed Ruby (like DCOP)
+ for messaging. DRuby is ruby-specific and couldn't be used though.
+ * The debugger communicates with the backend via a Unix domain socket;
+ commands are sent, and the replies are parsed in KDevelop in much the same way
+ as the gdb debugger uses stdin and stdout to send and receive.
+
+2004-11-17 Alexander Dymo <adymo@kdevelop.org>
+ * KDevelop interfaces cleanup and enchancements. Interfaces are now smaller, additional, not so important
+ interfaces are available through extension mechanism (see KDevPlugin::extension() methods).
+ Also added a lot of API documentation.
+
+2004-10-30 Robert Gruber <rgruber@users.sourceforge.net>
+ * Implemented "grouping of snippets" feature for SnippetPart
+
+2004-10-30 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Fixed ruby class and instance variable type matching bugs
+ * Added error message if the ruby code to run can't be located by the top level C++ stub
+ * The default character coding for KDE ruby projects is UTF-8
+ * If a class is declared several times in a file, the line number of the first instance
+ is used in the class browser, and not the last one.
+
+2004-10-29 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Added the 'qmakeapp' project template translated to QtRuby
+
+2004-10-28 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Fixed Ruby KDE app and DCOP service templates so they work again.
+ * Implemented a 'Character Coding' ruby project option
+
+2004-10-27 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Implemented ruby class '@@' and '@' instance variables in the class browser.
+
+ * Ruby doesn't have declarations for class or instance variables, and so a variable is 'declared'
+ when it is first assigned to. So the first assignment encountered in the ruby source is used,
+ unless the variable is set in the iniitaiize() method when that is considered as the 'first'.
+
+ * The type of the variable is inferred from the type of the thing on the rhs of the assignment to it.
+
+2004-10-27 Amilcar Lucas <amilcar@kdevelop.org>
+ Exclude non API classes from the doxygen API documentation.
+ Please use the "doxygen doxyfile" command to test it.
+
+2004-10-27 Alexander Dymo <adymo@kdevelop.org>
+ The first step in creating RubyQt/Korundum RAD environment -
+ started to implement KDevDesigner integration for Ruby:
+ works: automatic and manual subclass creation;
+ doesn't work: function adding, editing and removing.
+
+2004-10-25 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Added a ruby DCOP service project template
+ * Improved the kapp Korundum application framework. It configures, builds and installs
+ a C++ top level stub, that starts the ruby app. The ruby scripts are located via the
+ KStandardDirs/KInstance mechanism, in directory ..share/apps/<appname>
+ * k_dcop and k_dcop_signals declarations are shown as slot and signal declarations in
+ the class parser.
+ * =begin to =end comments are ignored
+ * Added icons for Ruby configure and run options. The Run button now starts the main program
+ with the ruby '-C' option to switch to the main program's directory.
+ * Added missing scope attribute to the class parser methods
+
+
+2004-10-23 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Implemented ruby slots/signals declaration navigation in the class browser
+ * Atrr accessor and access control method lists can span multiple lines
+
+2004-10-23 Alexander Dymo <adymo@kdevelop.org>
+ * KDevelop documentation viewer and KDevAssistant:
+ - implemented font configuration options;
+ - disabled loading of KHTML plugins.
+
+2004-10-21 Alexander Dymo <adymo@kdevelop.org>
+ * KDevelop Platform:
+ - implemented profiles library and editor engine;
+ - implemented profiles editor (kdevprofileeditor application);
+ - set up X-KDevelop-Property properties in .desktop files of KDevelop parts.
+
+2004-10-21 Richard Dale <Richard_Dale@tipitina.demon.co.uk>
+
+ * Added a KDE Korundum Ruby application framework based on the languages/cpp/app_templates/kapp
+ C++ project template
+ * Improved the Ruby class parser
+ * Both classes and modules are shown in the class browser
+ * Class or 'singleton' methods supported and appear as 'static' methods
+ * Access types of 'public', 'protected' and 'private' supported
+ * attr_accessor, attr_reader and attr_writer method definitions supported. For attr_accessor or
+ attr_writer a 'foo=' method is shown.
+ * Operator methods are shown in the class browser too
+
+2004-10-13 Alexander Neundorf <neundorf@kde.org>
+ *buildtools/custommakefiles/:
+ -add two submenus "Object Files" and "Other Files" to the "Build Targets" menu
+ -add new tag <filelistdirectory> so that the filelist file can be
+ located outside the source directory. This is currently only written
+ by the cmake kdevelop3 project file generator
+
+2004-08-27 Amilcar Lucas <amilcar@kdevelop.org>
+ * Updated support for Doxygen 1.3.8
+
+2004-06-21 Robert Gruber <rgruber@users.sourceforge.net>
+ * Added drag and drop support to SnippetPart
+ * Added filter support to AppOutputView
+
+2004-06-17 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added optional automatic reload on external file modification. This is only available with katepart.
+ * Added CopyTo plugin. A small utility to do network transparent file copying using KIO.
+ * Disabled VCS repository creation in the appwizard (doesn't work and the implementation broke the
+ plugin handling) and import (to be reimplemented using KTrader).
+ * Added the simple basics of Plugin Profiles. Will finish this the coming days.
+
+2004-06-14 Alexander Dymo <adymo@mksat.net>
+ * Documentation plugin can show methods in index for Qt and Doxygen documentation catalogs.
+ * Implemented a dialog to run profiler (calltree + kcachegrind).
+
+2004-06-05 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Fixed several ToolView related issues. Among other things, they should now
+ automatically restore their last position after a restart.
+
+2004-05-31 Alexander Dymo <cloudtemple@mksat.net>
+ * KDevelop has made a large step towards being the RAD tool for KDE.
+ Qt Designer is ported to KParts and KXMLGUI technology and can now
+ be embedded into KDevelop and integrated with it. It consists of
+ KDevDesignerPart and KDevDesigner shell program. Part is embeddable
+ everywhere and shell can be launched as standalone designer (run kdevdesigner).
+ * The first step to integration between KDevDesigner and KDevelop is done.
+ CppSupport can now automatically create implementation files (subclasses) for forms
+ and automatically add slot implementations.
+
+2004-05-27 Sascha Cunz <scunz@ng-projekt.de>
+ * Change "New File" in the toolbar to popup a menu with all available file templates,
+ if one clicks on it.
+
+2004-05-26 Robert Gruber <rgruber@users.sourceforge.net>
+ * Added possibility to set the priority of the make-process
+ * Added possibility to search case insensitive
+
+2004-05-21 Sascha Cunz <scunz@ng-projekt.de>
+ * Added a ncurses template
+
+2004-05-10 Andras Mantia <amantia@kde.org>
+ * Add possibility to define environment variables for the configure stage.
+
+2004-05-08 Alexander Dymo <cloudtemple@mksat.net>
+ * Devhelp and KDevelopTOC documentation plugins are implemented. Indexes that exist
+ in devhelp and kdeveloptoc files are now taken into account.
+
+2004-05-04 Alexander Dymo <cloudtemple@mksat.net>
+ * Doxygen documentation plugin (toc and index) is implemented.
+ This means that kdevassistant can browse KDE API docs and has table of contents and index!
+ kdevassistant (and kdevelop itself) is now the first documentation browser where you can
+ look for Qt and KDE classes at the same time (using one index).
+
+2004-04-30 Sascha Cunz <scunz@ng-projekt.de>
+ * Added Paul Drummond's patch for having "favourites" in appwizard.
+
+2004-04-25 Sascha Cunz <scunz@ng-projekt.de>
+ * Added support for reading the licenses that appwizard uses dynamically. Install all current licenses
+ to $prefix/share/apps/kdevelop/licenses
+
+2004-04-22 Alexander Dymo <cloudtemple@mksat.net>
+ * Added brand new "Look in documentation" function that puts the term under the cursor into the
+ documentation index tab and looks up for this term in the index.
+ * Added "Search in Documentation" and "Look in Documentation" menu items into the "Help" menu
+ with shortcuts <Ctrl+Alt+S> and <Ctrl+Alt+I> respectively.
+ * Implemented "Goto manpage" and added "Goto infopage" function in the "Help" and editor context menus.
+ * Improved "Add bookmark" function - it now recognizes embedded html part and sets the bookmark title
+ to the title of an opened document.
+ * Use also a default KDE shortcut for popup menu to open editor context menu.
+
+2004-04-21 Alexander Dymo <cloudtemple@mksat.net>
+ * Added Gtk-- application template by Andrew Patterson.
+
+2004-04-20 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Wired up katepart's editor context menu - we now finally have copy/paste in the context menu.
+ * Added a keyboard shortcut to open the editor context menu. (CTRL+Return)
+
+2004-04-16 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added MimeWarningDialog - KDevelop will now ask the user what to do when an unknown mimetype is encountered.
+
+2004-04-15 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added Thomas Nagy's KConfig XT based apptemplate.
+
+2004-04-14 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Rewrote and documented the KDevPartController interface to reduce the duplication of a lot of common but
+ trivial code all over the codebase.
+ * Moved the documentation history out of the PartController and into the docviewer part.
+ * Moved source navigation history into the PartController and disabled the HistoryPart.
+
+2004-04-14 Alexander Dymo <cloudtemple@mksat.net>
+ * Here is my gift for all Qt Designer fans! A KDevelop Assistant program is now available (run kdevassistant
+ from a command line). KDevelop Assistant is a lightweight version of KDevelop with only documentation
+ and file selector parts enabled.
+
+2004-04-12 Alexander Dymo <cloudtemple@mksat.net>
+ * Full text search in new documentation part now functional. Search results are presented in html page
+ and in listview as well.
+
+2004-04-09 Alexander Dymo <cloudtemple@mksat.net>
+ * Commited new documentation part for KDevelop. It features documentation plugin system,
+ it's easy now to add support for a new documentation format by implementing DocumentationPlugin interface.
+ Index is now loading faster, index caching mechanism is used. Configuration dialog became more clean and convenient.
+
+2004-03-22 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Restructured CppSupportPart::parseProject()
+
+2004-03-17 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Extended diffpart to also handle FileContext and dirty files.
+ * Updated FileList. Now supports filestate feedback and has a context menu for file operations.
+ * More cleanups in Core. Filestate is now emitted from PartController for the receivers to implement.
+
+2004-03-15 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * NewMainWindow is now enabled by default
+ * Added settings in "User Interface" for TabWidget visibility and IDEAl mode button layout
+
+2004-03-12 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added NewMainWindow - a new MainWindow implementation - enable in toplevel.cpp to try it out.
+ * Major cleanup of PartController::editDocument()
+ * A few other minor improvements to the core.
+
+2004-03-05 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Reimplemented how FileTree finds selected items. Fixes crash when a file changes name from an external event.
+
+2004-02-24 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added FileList plugin
+ * Added CTags2 plugin
+
+2004-02-23 Alexander Dymo <cloudtemple@mksat.net>
+ * Added Opie application templates for C++/Embedded development. Templates by Holger Freyther.
+
+2004-02-19 jbb <jbb@kdevelop.org>
+ * Robert Gruber's patch
+ - fix printing member variable when a /x modifier is added
+
+2004-02-18 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added function lookup to QuickOpen plugin. Patch by Ahn, Duk J.
+
+2004-02-15 Amilcar Lucas <amilcar@kdevelop.org>
+ * Updated support for Doxygen 1.3.6
+
+2004-02-07 jbb <jbb@kdevelop.org>
+ * Robert Gruber's patch
+ - fix whatis when toggling to hex display
+ - fix refresh display setting global output radix.
+
+2004-02-07 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Moved all of the plugin loading logic to PluginController
+ * Moved FileCreatePart to the globally loaded "default parts"
+
+2004-02-06 jbb <jbb@kdevelop.org>
+ * Add (global) Output radix to debugger options.
+ * Robert Gruber's patch to add hex/dec toggle to watch window items
+
+2004-01-28 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Ported Doxygen plugin, autotools part, FileTree and FileGroups to demand loaded config page
+
+2004-01-26 Dominik Haumann <dhdev@gmx.de>
+ * src/projectmanager.cpp: ask if user tries to reload the already opened project
+
+2004-01-26 Alexander Dymo <cloudtemple@mksat.net>
+ * Added snippet part by Robert Gruber.
+
+2004-01-24 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Updated Bookmarks Plugin. Various improvements and fixes.
+
+2004-01-21 Andras Mantia <amantia@kde.org>
+ * Fix clear all breakpoints functionality
+
+2004-01-21 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added ConfigWidgetProxy class to lib/util and initially implemented demand loading of config pages for DocTreeViewPart.
+
+2004-01-09 Amilcar Lucas <a.lucas@tu-bs.de>
+ * Easy access to bug reports of every supported language in the documentation browser (except SQL)
+
+2004-01-07 Amilcar Lucas <amilcar@kdevelop.org>
+ * Updated support for Doxygen 1.3.5 cvs HEAD
+
+2003-11-28 F@lk Brettschneider <falkbr@kdevelop.org>
+ * old IDEAl look for toolview-buttons is back in IDEAl mode
+
+2003-11-20 F@lk Brettschneider <falkbr@kdevelop.org>
+ * latest sync with KMdi of kdelibs-cvsHead (fixes some crashes)
+ * enabled kmdiguiclient.h/cpp for KDE less version 3.2 too
+ (-> this introduces KDE-accels Ctrl+Shift+Alt+L/R/B/T for IDEAl-docks and Ctrl+Alt+CursorLeft/CursorRight for cycling IDEAl-toolviews)
+ * bugfix: proper names of View menu
+ * now save the docking state to another section of kdeveloprc (to let people (who tried KMdi alpha versions) escape a vicious cycle)
+
+2003-11-16 Mario Scalas <marioscalas@agilemovement.it>
+ * Version control color feedback for the file view (currently implemented
+ by vcs/cvsservice plugin only).
+
+2003-11-13 Amilcar Lucas <amilcar@kdevelop.org>
+ * Readded a even cleaner kdevelop.kdevelop file.
+ PLEASE do _not_ commit changes to this file.
+ We have until mid January 2004 to make the necessary code changes that create a more "cvs friendly" file by moving some of the options to the .kdevses file.
+ For info on how to do it, read:
+ http://developer.kde.org/documentation/library/cvs-api/kdevelop/html/howToAddPlugins.html
+ I think this is very important fo the success of KDevelop3 in for developer teams (no man is an island!).
+ Alexander and F@lk seam to agree with me on this one.
+
+2003-11-09 F@lk Brettschneider <falkbr@kdevelop.org>
+ * as planned and decided months ago, now I
+ removed KDevelop's own special implementation of IDEAl UI mode.
+ This has been replaced by KDE's IDEAl UI mode, globally implemented in kdelibs/kmdi.
+ Now we increase maintainance, KDE-comformity and can switch all KDevelop UI modes on the fly.
+
+2003-10-29 Alexander Dymo <cloudtemple@mksat.net>
+ * Imported updated pascal parser, it isn't restricted now to pascal-78.
+ Most object pascal/delphi extensions are supported.
+
+2003-10-17 Dominik Haumann <dhdev@gmx.de>
+ * new Application templates in cpp: kateplugin2, noatunvisual,
+ noatunui, kbearimportfilter, kbearplugin, kfileplugin
+ * fixed 53943, 64028
+ * parts/appwizard: Now you can add "ShowFilesAfterGeneration=file1,file2"
+ to the app_tamplate's information-file (example: khello/khello) so that
+ file1 and file2 are shown after project generation - usually a README.devel
+ and/or source code files the user has to modify.
+ ShowFilesAfterGeneration= takes a comma separated list of files regarding to
+ the project root directory wheras
+ - APPNAMEUC will be replaced with the projectname.upper()
+ - APPNAMELC will be replaced with the projectname.lower()
+ - APPNAME will be replaced with the projectname.
+ Function 'openMainFile()'is now deprecated and therefore removed.
+ * updated documentation for this stuff.
+ * new in New-Project-Dialog: Getting the Project location with "..." asks
+ if it should set tht directory to the DefaultProjectsDir.
+
+2003-10-13 Amilcar Lucas <amilcar@kdevelop.org>
+ * Moved the language specific documentation to the languages/xxx/doc directories
+
+2003-10-12 Mickael Marchand <marchand@kde.org>
+ * New subversion part added to replace the old svn one
+
+2003-10-11 F@lk Brettschneider <falkbr@kdevelop.org>
+ * now I've started again fixing the MDI user interfaces which are quite broken at present
+
+2003-10-08 Tilman Vogel <Tilman Vogel web de (dot at dot)>
+ - added auto completion to the namespace field
+ - added classes from all namespaces to the auto completion of the base
+ class field, add classes from specified namespace without qualifier
+ - lookup classes for parsing in the correct namespace, not only the global namespace
+ - fixed bug causing crash when changing inheritance mode
+
+2003-10-04 Alexander Dymo <cloudtemple@mksat.net>
+ * Reenabled Ada language support (ported it to code model and reenabled
+ background parsing).
+
+2003-10-04 Amilcar Lucas <amilcar@kdevelop.org>
+ * On-line, automaticaly updated every 24H, KDevelop API Documentation can be viewed with the doctreeview.
+
+2003-10-02 Amilcar Lucas <amilcar@kdevelop.org>
+ * Renamed KDevelop executable from gideon to kdevelop.
+ * This makes KDevelop3 OVERWRITE KDevelop 2.x instalations.
+ * Restructured the directories acording to the API documentation
+ buildtools -> has the old Project managers
+ languages -> language support (includes app_templates, file_templates, compilerplugin, pcsimporter and debugger)
+ editors -> editors support
+ vcs -> Version control systems (clearcase, cvs, perforce, svn, cvsservice and cervisia)
+
+2003-09-26 Amilcar Lucas <amilcar@kdevelop.org>
+ * Added per target run arguments to the automake manager.
+ These arguments are used when no Main program (Project Options...-> Run Options) is selected and the Program arguments (Project Options...-> Run Options) are left empty.
+
+2003-09-22 Alexander Dymo <cloudtemple@mksat.net>
+ * Finished GUI for enabling and disabling documentation topics in a project configuration
+ dialog. Thanks to Amilcar Lucas for original idea and implementation.
+ * Added popup menu for the documentation viewer. It contains "Open in New Window", "Reload",
+ "Stop" and "Set Encoding" actions.
+ * Created mimetypes directory in KDevelop source tree. Here we can put all mimetypes necessary
+ for KDevelop that are not available in kdelibs.
+ * Added x-fortran, x-pascal and chm (HTML Help) mime types.
+
+2003-09-10 Alexander Dymo <cloudtemple@mksat.net>
+ * Added the GUI to create custom code completion databases
+ based on user selected directories.
+ * Imported Kugar property editor library. Modified generic project manager
+ to use it for editing properties in build item configuration dialog.
+
+2003-09-09 Dominik Haumann <dhdev@gmx.de>
+ * parts/appwizard/appwizarddlg[base.ui,.cpp]: fixed bugs 45719, 63930, 63929
+
+2003-09-08 Roberto Raggi <roberto@kdevelop.org>
+ * Added the GUI for create the code completion databases for
+ external libraries like Qt and KDE
+
+2003-09-06 Bernd Pol <bernd.pol@online.de>
+ * Some updates on the "KDevelop 3.0 users's manual" (docbook)
+
+2003-08-29 Alexander Dymo <cloudtemple@mksat.net>
+ * Added the initial version of generic project manager.
+ It is the replacement of script/custom/pascal/ada/haskell/etc. project managers.
+ Extensible with plugins. Currently available project manager based on shell scripts.
+
+2003-08-28 Harald Fernengel <harry@kdevelop.org>
+ * SQL support now displays tables and fields in the classbrowser
+
+2003-08-27 Harald Fernengel <harry@kdevelop.org>
+ * Added language support on the fly - you can switch to
+ SQL mode from a CPP project, or to Perl if you have scripts
+
+2003-08-26 Harald Fernengel <harry@kdevelop.org>
+ * Added version information for plugins to prevent opening
+ binary incompatible plugins from old versions.
+
+2003-08-10 jbb <jbb@kdevelop.org>
+ * Roger Larsson's patch that adds remote debugging.
+
+2003-08-03 jbb <jbb@kdevelop.org>
+ * fixes for debugger startup problems
+ * fixes for debugger shutdown
+ A significant change in this patch is that we no longer attempt to
+ shutdown gdb from information that gdb supplies. This must now be done by
+ the user via the stop button.
+ A reproductable crash after the client program segfaulted and the user
+ tried to continue, shutdown and then restarted has been fixed.
+ I suspect that this was the major cause of the reported crashes judging
+ from the few backtraces supplied.
+
+2003-07-28 Mario Scalas <mario.scalas@libero.it>
+ * PartExplorer is now shown in the embedded SelectView because the dialog-based interface was hardly useful!
+ * Results list will now use tooltips to show available services' properties.
+ * Several bugfixes in GUI code
+
+2003-07-28 Amilcar Lucas <amilcar@kdevelop.org>
+ * Full support for Doxygen 1.3.3
+
+2003-07-25 Gael de Chalendar <Gael . de . Chalendat AT cea . fr>
+ * Added "Edit" buttons to the "Includions" and "Prefixes" tabs of the
+ automake subproject options dialog and to the "Libraries" tab of the
+ automake target options dialog.
+
+2003-07-25 Alexander Dymo <cloudtemple@mksat.net>
+ * Added "Force Reedit", "Install" and "Install (as root user)" actions into the subproject
+ menu for Automake Manager. Force Reedit is only available for KDE projects.
+ * Quote environment variables with double quotes to allow shell expansion when
+ launching make from the project manager.
+
+2003-07-19 Harald Fernengel <harry@kdevelop.org>
+ * QEdtior can now Reload files
+
+2003-07-19 Andras Mantia <amantia@freemail.hu>
+ * apply the editor settings to the opened files
+ * don't crash on exit [#60658]
+ * fasten documentation indexing
+
+2003-07-15 Andras Mantia <amantia@freemail.hu>
+ * resolve links before opening a local file
+ * add "-follow" as a switch for "find" to successfully grep even in symlinked directories
+
+2003-07-14 Amilcar Lucas <amilcar@kdevelop.org>
+ * If no Main Program was selected in Project Options...-> Run Options, then use the
+ currently selected active target. This is valid for execution and for debugging.
+ So no more need to goto the menu every time you want to debug a new target! Just
+ activate it and you're done! :)
+ Currently only in Automake based project because AFAIK it the only one that has
+ the concept of active targets. Correct me if I'm wrong.
+
+2003-07-13 Andras Mantia <amantia@freemail.hu>
+ * don't treat libtool link messages for modules as errors.
+ * recognize libtool warning messages.
+
+2003-07-12 F@lk Brettschneider <falkbr@kdevelop.org>
+ * compiles and runs on KDE-3.0.3/Qt-3.0.5 again
+
+2003-07-07 Mario Scalas <mario.scalas@libero.it>
+ * Added tag/branching feature to legacy CVS integration.
+
+2003-07-06 Alexander Dymo <cloudtemple@mksat.net>
+ * Implemented Delphi compiler plugin
+
+2003-07-04 Amilcar do Carmo Lucas <amilcar@kdevelop.org>
+ Added debug and optimized build configurations to all C and C++ autoproject based templates
+
+2003-07-04 Andras Mantia <amantia@freemail.hu>
+ * Restore search in documentation functionality
+
+2003-06-26 Alexander Dymo <cloudtemple@mksat.net>
+ * New QComboView widget is added to lib/widgets. It is the modified version
+ of QComboBox with QListView object in place of QListBox.
+ * Make classbrowser use comboviews (QComboView) in namespace, class and method
+ selectors on the toolbar.
+
+2003-06-23 Amilcar Lucas <amilcar@kdevelop.org>
+ * Replaced all TODO occurencies with @todo so that they show up in the
+ Doxygen generated documentation under "Related Pages > Todo List"
+ * Make Doxygen generate XML files for the codecompletion tooltips
+
+2003-06-18 Mario Scalas <mario.scalas@libero.it>
+ * (CvsPart) New features added:
+ - It is now possible to add to/remove files from .cvsignore file
+ - When adding/removing files to project, part will now ask for user action
+ * (CvsPart) Code has been restructured.
+ * (lib) Modified FileContext in kdevecore.{h,cpp} so it can handle KURL::List.
+ (This is just an addition: old code should work as before).
+ * (FileView) FileTreeWidget supports multiple files selections now. Removed
+ drag support because it needs to be fixed by TT (seems a bug from qt-3.1.2
+ onward).
+
+2003-06-15 Harald Fernengel <harry@kdevelop.org>
+ * Added notification if a file has been modified outside the IDE
+ (IDEAl mode only for now).
+
+2003-06-14 Harald Fernengel <harry@kdevelop.org>
+ * Added perforce to the main menu, also uses KActions now so you can
+ assign your favourite keybinding to the commands.
+
+2003-06-14 Hamish Rodda <rodda@kde.org>
+ * Warn if another process is running on execution and allow a restart.
+ * Make automake deal with METASOURCES=AUTO
+ * Remember position in document for compile warning/errors so that you can
+ edit the document and still be taken to the correct location
+ (work in progress, commented out, requires up-to-date katepart)
+ * Separate highlighting for errors and warnings (work in progress)
+
+2003-06-12 Alexander Dymo <cloudtemple@mksat.net>
+ * Trollproject:
+ - Existing files could be added to a project with a relative path or
+ they could be symlinked instead of just copying
+ - Implemented removing files from IMAGES and IDLS groups
+ - Set run environment variables and program arguments when launching
+ the executable (thanks to Mario Scalas for the patch)
+ - Correct "Link convenience library inside project" functionality (thanks to
+ Mario Scalas for the patch)
+
+2003-06-11 Hamish Rodda <rodda@kde.org>
+ * Implemented "Debug in KDevelop" hook into drkonqi (the KDE crash
+ handler). Press the button and kdevelop attaches to the process
+ and brings up the frame stack, as long as the binary name of the
+ process is the same as your binary. Requires an update to
+ kdebase/drkonqi to work (runtime dependency).
+
+2003-06-07 Mario Scalas <mario.scalas@libero.it>
+ * Stepped back from using Pimpl in part design since it does only complicate code without any of its
+ advantages in this case
+ * Added an option for adding the message for the commit operation to the master ChangeLog
+ (located in <projectDirectory>/ChangeLog): await for comments for further changes.
+ * CommitDlg now uses QTextEdit instead of (deprecated) QMultiLineEdit
+ * This log was written using the CvsPart! :)
+
+2003-05-27 F@lk Brettschneider <falkbr@kdevelop.org>
+ * compiles and runs on KDE-3.0 again
+
+2003-05-26 Roberto Raggi <roberto@kdevelop.org>
+ * New Java support
+
+2003-05-24 Roberto Raggi <roberto@kdevelop.org>
+ * Added full-screen mode
+
+2003-05-22 Mario Scalas <mario.scalas@libero.it>
+ * Added tooltips to the watch variable list view so no widget resize is needed
+ * Added a copy to clipboard feature for watched variables so their data is available
+ for other uses.
+
+2003-05-21 Roberto Raggi <roberto@kdevelop.org>
+ * implemented the support for profiles
+ * ported kate file selector to kdevelop
+ * added documentation hint to c++ support, patch provided
+ by Jonas B. Jacobi <jonas.jacobi@web.de>
+
+2003-05-18 Alexander Dymo <cloudtemple@mksat.net>
+ * Reformat source option is now available in the "Subclassing" wizard
+ * Trollproject:
+ - recognizes MAKEFILE option in qmake configuration files
+ - uses make options specified in project options dialog
+ - uses makefiles specified by MAKEFILE option to run make
+
+2003-05-18 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Updated BookmarksPart - now bookmarks are saved to session file.
+
+2003-05-17 F@lk Brettschneider <falkbr@kdevelop.org>
+ * renamed QextMdi classes and files to KMdi
+
+2003-05-16 Alexander Dymo <cloudtemple@mksat.net>
+ * Added sourceFormatter() method to KDevPlugin interface and corrected AStylePart to be
+ the default source formatter part. Astyle library is separated from the part.
+ * Added "Format Source" option to the "C++ New Class" wizard.
+ * Added an index system to the doctreeview - thanks to Marcel Turino <M.Turino@gmx.de>.
+
+2003-05-16 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Trollproject: Support for custom installation groups or qmake install objects
+ Each install object tells "make install" to copy user specified filesgroups to
+ a certain location.
+ example:
+ doxy.files += docs/*.html \
+ docs/*.css
+ doxy.path = /usr/doc/appname
+ INSTALLS += doxy
+
+2003-05-15 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Updated BookmarksPart - added tooltips && RMB actions
+
+2003-05-14 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Trollproject target.path reimplementation
+
+2003-05-14 Mario Scalas <mario.scalas@libero.it>
+ * (lib/interface) Merged KDevGlobalVersionControl in KDevGlobalVersionControl
+ * (lib/interface) removed KDevGlobalVersion
+ * (lib/interface) Updated Makefile.am
+ * (parts/appwizard) changed code for retrieving the available VCS (lookt at loadVCS())
+ * (parts/cvs) Merged GlobalCvs in CvsPart
+ * (parts/cvs) removed parts/cvs/globalcvs
+ * (parts/cvs) added common cvs options as #define in new cvs_commonoptions.h
+ * (parts/cvs) updated Makefile.am
+
+2003-05-14 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added BookmarksPart
+
+2003-05-12 Roberto Raggi <roberto@kdevelop.org>
+ * replaces KDevLanguageSupport::fileFilters() with
+ KDevLanguageSupport::mimeTypes()
+
+2003-05-11 Roberto Raggi <roberto@kdevelop.org>
+ * autoproject: don't write empty variables in Makefile.am
+ * autoproject: implemented the remove subproject feature
+ * autoproject: improved add subprojects
+ * autoproject: create a (default) noinst_HEADERS target
+
+2003-05-05 Alexander Dymo <cloudtemple@mksat.net>
+ * parts/trollproject
+ MOC_DIR, UI_DIR, OBJECTS_DIR variables support in configuration dialog is back again.
+ Fixed incorrect program path generation that prevented from running the application.
+ Put correct actions into the Build menu and the Build toolbar.
+ * parts/clearcase
+ Applied further modifications by Ajay Guleria <Ajay.Guleria@synopsys.com>.
+
+2003-04-18 Oliver Kellogg <okellogg@users.sourceforge.net>
+ * Implemented Ada language support including adasupport part, adaproject
+ part, filecreate templates, application wizard template, syntax
+ highlighting and indentation in qeditor.
+ Kudos to Alex Dymo (pascalsupport) and Robe Raggi (javasupport), on
+ whose work this is based.
+
+2003-05-01 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Changed closerpart to work on KURLs. Also moved it into Core scope.
+
+2003-04-30 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added "Core" scope plugins alternative
+ * Updated the plugin selection to be more userfriendly
+
+2003-04-29 Amilcar Lucas <amilcar@kdevelop.org>
+ * Made the Working Directory of the debugged executable configurable
+ (Finally you can run your application on it's directory, instead of $HOME)
+
+2003-04-27 Alexander Dymo <cloudtemple@mksat.net>
+ * Regexp tester now has "Edit" button that uses KRegExpEditor
+ * Added free pascal oriented templates - GTK+ application and shared library
+ * Implemented "Run options" (envvars, program arguments) for pascal project manager
+
+2003-04-26 Alexander Dymo <cloudtemple@mksat.net>
+ * Implemented all documented compiler options in free pascal compiler plugin.
+
+2003-04-25 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Added KTextEditor::ConfigInterface to QEditor
+ * Made changed editor settings apply to all open editors
+
+2003-04-23 Roberto Raggi <roberto@kdevelop.org>
+ * fixed the deadlock in the background parser
+
+2003-04-23 Harald Fernengel <harry@kdevelop.org>
+ * added SQL support part, including support for multiple connections,
+ sending queries and browsing their results
+
+2003-04-22 F@lk Brettschneider <falkbr@kdevelop.org>
+ * compiles and works on KDE-3.0 again
+
+2003-04-18 Alexander Dymo <cloudtemple@mksat.net>
+ * Implemented Pascal language support including
+ pascalsupport part, pascalproject part, filecreate templates,
+ application wizard template, syntax highlighting and indentation in qeditor,
+ compiler plugins for Free Pascal compiler and (very basic) for Borland Delphi Compiler.
+
+2003-04-18 Roberto Raggi <roberto@kdevelop.org>
+ * started to implement the recovery support, this is the first
+ step to implement the incremental parser
+
+2003-04-17 Roberto Raggi <roberto@kdevelop.org>
+ * Reduced the size of the generated pcs database(you must regenerate your
+ database using r++ to take advantage of it)
+ * Added the AST node for variable function arguments
+ * Added option "--fast" to the r++
+
+2003-04-16 Roberto Raggi <roberto@kdevelop.org>
+ * Implemented the support for class inheritance in the new pcs
+ * Moved the c++ parser into kdevelop/lib/cppparser, so other
+ projects like kate and umbrello can use it
+
+2003-04-15 Roberto Raggi <roberto@kdevelop.org>
+ * Added the new persistant class store
+
+2003-04-15 Harald Fernengel <harry@kdevelop.org>
+ * The stop-button is now able to stop single parts via drop-down menu.
+ If you grep, build, debug and valgrind at the same time, you can terminate
+ one part only. Single-clicking the stop-button will terminate all active
+ jobs as it did before.
+ * Switch syntax highlighting on/off on the fly in diff-part's raw output
+
+2003-04-14 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ * Replace part refinements and bugfixes
+ Tooltips, regexp validation feedback, colorization & gui redraw.
+ shortcut changed to alt-ctrl-R
+
+2003-04-14 Harald Fernengel <harry@kdevelop.org>
+ * Diff part is now able to use any kpart that can display 'text/x-diff'
+ * Diff part can display raw output on the fly (if the kpart is too silly to parse the diff)
+
+2003-04-14 Amilcar Lucas <amilcar@kdevelop.org>
+ * Updated integrated Doxywizard (Doxygen Configuration GUI) to 1.3 version.
+ This maintains full backward compatibility with previous Doxygen versions.
+
+2003-04-11 Alexander Dymo <cloudtemple@mksat.net>
+ * Applied rubysupport part, including application and filecreate templates
+ Ruby support is created by Marek Janukowicz <child@t17.ds.pwr.wroc.pl>.
+ * Implemented CPPFLAGS and LDFLAGS input fields in "Configure Options"
+ dialog for Automake Manager.
+ * plugins/gccoptions:
+ "Compiler Options" dialog now honors unrecognized user-defined options,
+ more predefined compiler warnings are available.
+
+2003-04-10 luc willems <Willems.luc@pandora.be>
+ * add support for perl filecreate templates
+ * make sure declaredinfile is set correctly after adding an item to classstore so removeWithReferences() will work correctly
+ * add parsing of "use" file after saveFile()
+
+2003-04-09 Harald Fernengel <harry@kdevelop.org>
+ * Applied ClearCase part from Ajay Guleria
+ * Goto error now works again
+
+2003-04-08 Caleb Tennis <caleb@aei-tech.com>
+ * Retag Alpha 4
+
+2003-04-05 Alexander Dymo <cloudtemple@mksat.net>
+ Applied patch from Luc Willems <Willems.luc@pandora.be>:
+ Classview:
+ - add support for scripts folder in classviewer
+ Pelrsupportpart:
+ - add support for namespaces and scripts in classviewer
+ - parsing of "use ...." libraries
+ - get list of INC path in local installed perl to allow parsing of perl
+ libraries outside the project directory
+
+2003-04-05 Amilcar Lucas <amilcar@kdevelop.org>
+ - Simplified the "Inteligent messages auto-hide" code a lot
+ - Now it also works for AutoMake&friends and configure
+
+2003-04-01 Alexander Dymo <cloudtemple@mksat.net>
+ * C/C++ "New class" dialog improvements:
+ - Nested namespace support
+
+2003-03-30 Julian Rockey <linux@jrockey.com>
+ * parts/appwizard
+ - added proposed replacement for highly broken dcopservice template
+
+2003-03-29 Alexander Dymo <cloudtemple@mksat.net>
+ * C/C++ "New class" dialog improvements:
+ - Editor for base class file names
+ - Base class include files can be set as global or local
+ - Customizable templates for c++, objective-c, gtk classes
+ - Various global generation options (uppercase and lowercase names, etc.)
+
+2003-03-29 F@lk Brettschneider <falkbr@kdevelop.org>
+ * applied patch of Luc Willems <Willems.luc@pandora.be>
+ that highly improves the class tool-view for Perl projects
+ (classes, global functions and variables support)
+
+2003-03-29 Amilcar Lucas <amilcar@kdevelop.org>
+ * Implemented intelegent bottom view autohide.
+
+2003-03-26 Roland Krause <roland@ca.wai.com>
+ * Renamed main.f77 to main.f and adopted the various files.
+ The simple hello world fortran application now works.
+
+2003-03-26 Roberto Raggi <roberto@kdevelop.org>
+ * added showPart() to KDevPlugin
+ * added KNotes plugin (ported from Kontact plugin)
+
+2003-03-25 Roberto Raggi <roberto@kdevelop.org>
+ * improved the plugin framework
+ * added DCOP interfaces for FilterPart and CppSupportPart
+
+2003-03-21 Roberto Raggi <roberto@kdevelop.org>
+ * better support for namespace and inner classes
+
+2003-03-21 jbb <jbb@kdevelop.org>
+ * src/debugger.*
+ - Finally, after many years, the "sliding" breakpoint problem
+ has been solved thanks to the initial efforts of
+ Andras Mantia (Mantia Andras <amantia@freemail.hu>)
+ See bug 48732.
+
+2003-03-20 Roberto Raggi <roberto@kdevelop.org>
+ * improved code completion
+
+2003-03-19 Caleb Tennis <caleb@aei-tech.com>
+ * Tagged Alpha 4
+
+2003-03-18 Caleb Tennis <caleb@aei-tech.com>
+ * Modified IDEAl panel layouts to be a little smarter (hopefully)
+ * Committed patches by Amilcar do Carmo Lucas
+
+2003-03-18 Roberto Raggi <roberto@kdevelop.org>
+ * added the new "Add Methods" wizard
+ * added the new "Add Attributes" wizard
+
+2003-03-15 F@lk Brettschneider <falkbr@kdevelop.org>
+ * applied patch of Jens Zurheide (jens.zurheide@gmx.de) that fixes some bugs
+
+2003-03-13 Alexander Dymo <cloudtemple@mksat.net>
+ * DevHelp documentation support for KDevelop.
+ All documentation collections for GNU/GNOME developers from
+ http://lidn.sourceforge.net/ are supported. Existing DevHelp
+ installation can also be scanned for documentation.
+
+2003-03-13 Julian Rockey <linux@jrockey.com>
+ * CTRL-/ does buffer switching, emacs-style
+
+2003-03-11 Julian Rockey <linux@jrockey.com>
+ * parts/filecreate
+ - finally got round to replacing file dialog with smaller, leaner widget
+
+2003-03-11 Caleb Tennis <caleb@aei-tech.com>
+ * added library version number support for QMake project
+
+2003-03-10 Caleb Tennis <caleb@aei-tech.com>
+ * added "staticlib" support for QMake projects
+
+2003-03-09 Roberto Raggi <roberto@kdevelop.org>
+ * added back/forward actions for the documentation browser
+
+2003-03-07 Alexander Dymo <cloudtemple@mksat.net>
+ * New configuration options for the documentation browser.
+ It is now capable of using any doxygen and kdoc documentation,
+ not only kdelibs documentation.
+
+2003-03-07 F@lk Brettschneider <falkbr@kdevelop.org>
+ * added third level called "Very short compiler output"
+ * now you can switch between the output versions without recompiling
+
+2003-03-06 Stephane ANCELOT <sancelot@free.fr>
+ * enhanced grepview, there is no need to display the filename in each line
+
+2003-03-06 Roberto Raggi <roberto@kdevelop.org>
+ * Added support for tmake projects
+ * Added template for QTopia 1.6
+
+2003-03-05 Alexander Dymo <cloudtemple@mksat.net>
+ * Documentation browser is now able to handle all Qt documentation including
+ custom *.xml documentation. Configuration options are also available.
+ * GTK tocs renamed to GNOME 1.0 API Reference. Incorrect links fixed, Bonobo
+ chapter included. More to come.
+ * Started adding W3C TR tocs to the documentation browser.
+
+2003-03-02 F@lk Brettschneider <falkbr@kdevelop.org>
+ * completed the new behaviour of the make-output view
+ (can be configured via contextmenu or Gideon settings dialog)
+
+2003-03-01 Roberto Raggi <roberto@kdevelop.org>
+ * added javahello template to appwizard
+
+2003-02-28 Roberto Raggi <roberto@kdevelop.org>
+ * reenabled java support
+ * removed obsolete kdevelop java plugin template
+
+2003-02-27 Victor Rder <victor_roeder@gmx.de>
+* Started to restructure the Autoproject part
+ -> Splitted AutoProjectWidget in
+ * AutoSubprojectView
+ * AutoDetailsView
+ * AutoListViewItems
+ * AutomakeManager (not finished)
+ -> More to come
+ -> However, an auto-tools expert would be nice now
+* Made the "C++ new class dialog" a little bit nicer
+
+2003-02-27 F@lk Brettschneider <falkbr@kdevelop.org>
+ * make-outputview: now context menu allows to disable line wrapping, to set a short and smart compiler output (good for novices) and to suppress directory navigation messages. (TODO: save this to KConfig)
+
+2003-02-26 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * parts/cppsupport: fix nasty inner class bug (part of bug 45998). Determine
+ whether we are at global scope, and then insert class/struct accordingly to
+ class store. This one goes for you Roberto ;)
+
+2003-02-26 jbb <jbb@kdevelop.org>
+ * parts/debugger
+ - Fix display of function parameters.
+
+2003-02-25 F@lk Brettschneider <falkbr@kdevelop.org>
+ * KDE-3.0 compile fixes
+ * some (runtime) warning output removed
+ * make-outputview: scrolling during compiling possible without immediate auto-scrolling to the bottom
+
+2003-02-24 Roberto Raggi <roberto@kdevelop.org>
+ * improved the background parser
+ * better syncronization between background parser and cppsupport part
+
+2003-02-23 Roberto Raggi <roberto@kdevelop.org>
+ * use the new c++ parser to fill the class browser
+ * remove ParsedStruct
+
+2003-02-23 Caleb Tennis <caleb@aei-tech.com>
+ * Bug and Compilation Fixes
+
+2003-02-21 Alexander Dymo <cloudtemple@mksat.net>
+ * Subclassing widgets based on ui-files is now available in automake project manager too.
+ * Iterative subclassing for existing subclasses is available too.
+ * Subclassing is moved to cppsupport.
+
+2003-02-20 Roberto Raggi <roberto@kdevelop.org>
+ * Added Make-member feature to c++ support.
+ * Added Realtime class browser
+
+2003-02-19 F@lk Brettschneider <falkbr@kdevelop.org>
+ * QEditor find dialog improved:
+ - don't stop at end of file but loop to begin (makes much sense when starting from cursor)
+ - use text selection as search string
+
+2003-02-17 Hamish Rodda <meddie@yoyo.its.monash.edu.au>
+ * parts/outputviews
+ - added detection of k_lineinfo output to application output view
+
+2003-02-13 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * lib/structure:
+ - fix: Trie_Impl apply() should apply only to non_empty
+ components
+ - update docs, planning to take over the world again
+
+2003-02-12 jbb <jbb@kdevelop.org>
+ * parts/debugger
+ - Sync source with thread patch in kdevelop2.1.x. Some bits were missed
+ from a previous merge. This should fix some thread issues.
+ - Fixed: In some situations locals were not displayed.
+ Note: Parameters may still be missing depending on the fn sig.
+ - Fixed: Can't find source problem due to QRegExp too greedy.
+ Note: The "finish" command can still have some odd behaviour
+ due to an extra line output (which may be gdb version dependent).
+
+2003-02-11 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * lib/structure:
+ - implemented take(), I wonder why I left it like that
+ - fix: size() returns number of components
+
+2003-02-11 Mickael Marchand <marchand@kde.org>
+ * parts/svn:
+ - added an output window for subversion (just like CVS)
+ - removed i18n("Subversion") so that translators does not translate it
+ anymore :)
+
+2003-02-11 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * lib/structure:
+ - Trie: implemented higher order application function
+ - KDict: implement setAutoDelete interface of QDict
+ - don't install test binary
+ * lib/qextmdi:
+ - use KDict instead of QDict, more to come ;)
+ * parts/filecreate:
+ - fix: Add cpp and h types by default when there is
+ no template directory in project
+
+2003-02-11 F@lk Brettschneider <falk@kdevelop.org>
+ * took the patch of Jens Zurheide (Thanks jens.zurheide@gmx.de!) and modified it a bit.
+ Additionally to the already existing ALT+Left/Right switching (which switches the views
+ in the order of they were opened), now there is also ALT+Up for switching between views
+ in the order of how they were last accessed, and ALT+Down for the opposite. Hold ALT
+ pressed and repeat Up or Down to cycle through the views.
+
+2003-02-11 Alexander Dymo <cloudtemple@mksat.net>
+ * parts/filecreate:
+ - GUI for both global and project level configuration added.
+
+2003-02-09 Jakob Simon-Gaarde <jsgaarde@simon-gaarde.dk>
+ * trollprojectpart: The dialog for subclassing widgets based on ui-files now works
+ iteratively, so you can update your subclasses according to the changes made in
+ the ui-files.
+
+2003-02-09 F@lk Brettschneider <falk@kdevelop.org>
+ * bugfix: classview now alphabetically sorted again
+ * KDevPlugin interface extended with 'KDevMakeFrontend* makeFrontend()' which made it
+ possible to raise the messages view on 'Build'
+
+2003-02-05 F@lk Brettschneider <falk@kdevelop.org>
+ * now it compiles and runs on KDE-3.0.x again
+
+2003-02-04 Mickael Marchand <marchand@kde.org>
+ * parts/svn:
+ - update to subversion 0.17, minor API changes
+
+2003-02-04 Roberto Raggi <roberto@kdevelop.org>
+ * added text hints support to qeditor
+
+2003-02-04 F@lk Brettschneider <falk@kdevelop.org>
+ * interface changed: KDevTopLevel renamed to KDevMainWindow, topLevel() renamed to mainWindow()
+ * bugfix: proper work of session restoring of maximized views in Childframe mode
+ * bugfix: avoid doubled menu entries for switch for showing/hiding of toolbars
+
+2003-02-03 F@lk Brettschneider <falk@kdevelop.org>
+ * bugfix: env vars now possible for URL of documentation views, means Qt docu works again
+ * bugfix: show full filename in view caption (Childframe UI mode)
+ * bugfix: use default icon for views in case that an icon wasn't assigned
+ * bugfix: use 16x16 size for view icons (Childframe UI mode)
+
+2003-02-01 Alexander Dymo <cloudtemple@mksat.net>
+ * parts/cppsupport:
+ - Advanced Inheritance feature in "New Class" dialog:
+ automated constructor creation, method overriding
+ and access modifiers upgrading using base class
+ descriptions from the project class store
+ - Class is O_OBJECT option in "New Class dialog"
+ - Generate GTK class option in "New Class dialog"
+
+2003-01-30 Julian Rockey <linux@jrockey.com>
+ * lib/interfaces, src:
+ - Make CreateFile interface available globally.
+ * parts/autoproject:
+ - Use CreateFile interface if available for creating new files
+
+2003-01-27 F@lk Brettschneider <falk@kdevelop.org>
+ * QEditor-Plugin: Ctrl+Left, Ctrl+Right, Ctrl+Del and Ctrl+Backspace much more better now
+
+2003-01-24 Harald Fernengel <harry@kdevelop.org>
+ * default keys to move to next/prev window are now
+ ALT-Right / ALT-Left (as in kate)
+
+2003-01-18 Alexander Dymo <cloudtemple@mksat.net>
+ * cppsupport:
+ - improve new class dialog
+ - support multiple inheritance for c++ classes
+ - cosmetic improvements
+
+2003-01-17 Harald Fernengel <harry@kdevelop.org>
+ * made CVS shell configurable, you can now use CVS via ssh.
+ Note that only password-less logins are supported,
+ so generate your public/private key today!
+
+2003-01-15 Mickael Marchand <marchand@kde.org>
+ * made "Close Others" (tabs) work
+
+2003-01-15 Julian Rockey <linux@jrockey.com>
+ * parts/filecreate
+ - added "New" option into Gideon's "File" menu
+
+2003-01-14 Mickael Marchand <marchand@kde.org>
+ * repaired subversion part
+ * added svn diff support (trough the diff viewer)
+
+2003-01-14 Harald Fernengel <harry@kdevelop.org>
+ * added KDE simple application template (khello)
+ * the copyright year for auto-generated files is now the current
+ year instead of the hard coded "2001".
+
+2003-01-12 Julian Rockey <linux@jrockey.com>
+ * parts/filecreate
+ - prettier file creation widget
+ - support for global file templates
+
+2003-01-11 F@lk Brettschneider <falk@kdevelop.org>
+ * parts/fileview (called 'view on the project directory'):
+ like used from KDevelop-2, directories now sorted above the files
+
+2003-01-10 Julian Rockey <linux@jrockey.com>
+ * parts/autoproject:
+ - be a bit smarter when adding files to directories that have only one target
+ - be a bit nicer to files in the project root directory
+ * parts/filecreate
+ - add some global file templates to be stored in $datadir/kdevfilecreate/file-templates
+ * lib/util/filetemplate
+ - look in global directory for templates if not found in project directory
+
+2003-01-09 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * revived lib/structure:
+ - has a working Trie class now (tested with g++-3.2)
+ - add an adaptor called KDict which is supposed to be
+ a drop-in replacement for QDict
+
+2003-01-08 Julian Rockey <linux@jrockey.com>
+ * parts:
+ - added new part to assist with creation of new files
+ * lib/interfaces:
+ - added interface for new file creation
+ * lib/util:
+ - added urlutil, general URL manipulation utilities
+
+2003-01-07 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Append to libpath in subproject configuration dialog
+
+2003-01-07 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * cppsupport:
+ - improve new class dialog
+ - refactor and improve class generation code
+ - support file templates
+ - cosmetic improvements
+ - layout improvements
+ - add option for objective-c
+ - add new file templates
+ * lib/util:
+ - enhance FileTemplate
+ - start a Locate facility
+ * doctreeview: improve library doc dialog
+
+2003-01-07 Julian Rockey <linux@jrockey.com>
+ * Added PyQT template (QT application framework for Python) to appwizard
+
+2003-01-06 Victor Rder <victor_roeder@gmx.de>
+ * Applied patch of Richard L�k�g for top source directory support (only in Autoprojectpart yet!)
+ * Applied patch of Hamish Rodda for a more stable PartController::editDocument(...)
+ * Minor changes to Autoprojectpart
+
+2003-01-05 F@lk Brettschneider <falk@kdevelop.org>
+ * MDI taskbar is back as Viewbar (TODO: read config if on/off on startup)
+ * switching the QextMDI user-interface modes now immediately and properly via Options dialog again (extended KDevTopLevel interface therefore), fixed names in the ui mode chooser dialog
+ * accept perl scripts for the loading in the text editor
+ * problem reporter accepts import/export macro in class declaration (patch by Roberto Raggi)
+
+2003-01-04 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * UI-subclassing finnished in qmake manager.
+ (activate by rightclicking on a ui-file)
+
+2003-01-04 Roberto Raggi <roberto@kdevelop.org>
+ * Added Auto Expand mode
+
+2003-01-01 Caleb Tennis <caleb@aei-tech.com>
+ * Add linebreaks for data being copied from make output window
+ to clipboard
+
+2002-12-31 Caleb Tennis <caleb@aei-tech.com>
+ * Fix keyboard accelerator keys for File menu..no conflicts
+ * Fix broken signal/slot connections in code
+ * Add RMB context menu to ideal mode tabs to allow file closing
+ * Add ability to configure output window fonts
+ * Make classview show struct information
+
+2002-12-29 Harald Fernengel <harry@kdevelop.org>
+ * Added valgrind part, requires installed valgrind
+ parses and displays valgrind's output in a listview,
+ tries to auto-guess the location of the memory leaks in
+ the project
+
+2002-12-18 Caleb Tennis <caleb@aei-tech.com>
+ * Hack to fix KTabZoomFrame from going smaller than the
+ sizeHint() of the part it is loading. This needs more work,
+ but is a start
+ * Close the KTabZoomFrame if the current loaded part is closed
+
+2002-12-26 Caleb Tennis <caleb@aei-tech.com>
+ * Get AppWizard name and email settings from KDE emaildefaults
+ file if it's available
+ * Applied fix to KTabZoomWidget to enable hide button when docked
+ and set minimum size to 175 (by Dominic Battre)
+ * Applied patch to fileselector to store filter history
+ (also by Dominic Battre)
+ * Added ability to select filename settings (lowercase,
+ uppercase, mixedcase) when using the Add Class dialog
+
+2002-12-23 Caleb Tennis <caleb@aei-tech.com>
+ * Fixed bugs with python support; patches by Julian Rockney
+ (linux@jrockney.com)
+
+2002-12-22 F@lk Brettschneider <falk@kdevelop.org>
+ * QEditor: double click selection improved
+ * renaming of main window classes, the names were confusing
+
+2002-12-18 F@lk Brettschneider <falk@kdevelop.org>
+ * QEditor: can now delete words via Ctrl+Backspace and Ctrl+Del
+ * new class TopLevelShare, moved doubled stuff to it from the 2 main widget classes
+ * implemented tool-/status-/view-bar on/off actions in 'Settings' menu
+
+2002-12-18 Victor Rder <victor_roeder@gmx.de>
+ * Added "Choose Target Dialog"
+ * Added SLOTS for removing/adding many files
+ to KDevProject
+ -> Now KDevProject handles files with relative
+ paths (to project directory)
+ * Replaced SIGNALS for removing/adding a single file
+ -> Adapted this to the other parts
+ * Fixed a "Add Subproject" bug
+ * Found other bugs to be fixed
+ * Minor improvments on Automake Manager
+ -> More to come
+
+2002-12-17 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Still working on extended DOM path/automatic subclassing from ui-templates in qmake-projects
+
+2002-12-17 F@lk Brettschneider <falk@kdevelop.org>
+ * Childframe UI mode (not maximized): opening of new views fixed concerning the positioning and resizing
+
+2002-12-16 Roberto Raggi <roberto@kdevelop.org>
+ * bugfix: useless "()" string is attached to the method declaration patch from Andreas Wuest <AndreasWuest@gmx.de>
+ * added emacs like wordwrap mode to qeditor
+ * added ocaml colorizer to qeditor
+
+2002-12-16 F@lk Brettschneider <falk@kdevelop.org>
+ * bugfix: now Partloader loads editor part exactly as set in common Gideon editor settings
+ * this makes the Kate editor now also availabe for the KDE-3.0.x-compiled Gideon.
+
+2002-12-15 Harald Fernengel <harry@kdevelop.org>
+ * added new RMB menu item for text documents: difference to saved file
+ that will show you the modifications since your last save.
+
+2002-12-15 F@lk Brettschneider <falk@kdevelop.org>
+ * breakpoint support in QEditor completed
+
+2002-12-13 F@lk Brettschneider <falk@kdevelop.org>
+ * added breakpoint support in QEditor (not yet finished)
+
+2002-12-12 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Added a new extended path ability to DomUtil so that the path can be qualified on attributes
+ and multiple matches can be addressed with a zero-based index
+
+2002-12-12 F@lk Brettschneider <falk@kdevelop.org>
+ * compiles/runs on KDE-3.0 as well again
+ * backported KWidgetAction and KTextEditor::MarkInterfaceExtension from KDE-3.1 to KDE-3.0-compiled Gideon
+
+2002-12-07 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * getActivedir() corrected in trollproject
+
+2002-12-07 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Altered the Appname/location confusion in appwizard
+
+2002-12-05 F@lk Brettschneider <falk@kdevelop.org>
+ * now also parts can load/save the project-related session by overriding the base class method in KDevPlugin
+ * as an example, I moved changed some c++-debugger stuff to write to .kdevses instead of .kdevelop
+ (since every user has its own settings and the .kdevelop file would conflict in CVS)
+
+2002-12-04 Caleb Tennis <caleb@aei-tech.com>
+ * Added ability to open ui.h files easily in QMake Manager with right click popupmenu.
+
+2002-12-03 F@lk Brettschneider <falk@kdevelop.org>
+ * now session saves/loads cursor position;
+ and view geometries in Childframe UI mode
+
+2002-12-02 Caleb Tennis <caleb@aei-tech.com>
+ * Added configuration option to set environment variables before
+ running "Automake & Friends". Patch provided by Hannes Mehnert
+ (hannes@gentoo.org).
+
+2002-12-01 Sebastian Kratzert <skratzert@gmx.de>
+ * New configuration for external documentation (toc docs)
+
+2002-12-01 F@lk Brettschneider <falk@kdevelop.org>
+ * ported KDevSession (.kdevses) over from KDevelop-2, now called ProjectSession.
+ Not finished but already does what removed ProjectWorkspace did. More to come...
+
+2002-11-28 Victor Rder <victor_roeder@gmx.de>
+ * Added "Remove target" to Automake Manager
+ * Minor fixes
+
+2002-11-28 F@lk Brettschneider <falk@kdevelop.org>
+ * QEditor defaults to KDevelop-2 syntax highlighting colours
+ * some bugfixes for the QextMDI-based UI modes
+ * properly installs and loads the toolbar icons also when compiling Gideon on KDE-3.0.x
+
+2002-11-26 Caleb Tennis <caleb@aei-tech.com
+ * Added documentation to KDevelop 3.0 Manual
+ * Reworked doc directories for doctreeviewpart - now external
+ documentation is remotely hosted by default
+
+2002-11-26 F@lk Brettschneider <falk@kdevelop.org>
+ * bugfixes in TopLevelMDI; Remove the docking section from gideonrc!
+ Then the state of tool-views should be properly restored when starting
+
+2002-11-24 Harald Fernengel <harry@kdevelop.org>
+ * Added QRegExp and KRegExp to RegExpTester
+
+2002-11-23 F@lk Brettschneider <falk@kdevelop.org>
+ * now QextMDI-based mainframe loads/saves its docking state, extended KDevTopLevel interface therefore
+
+2002-11-19 Caleb Tennis <caleb@aei-tech.com>
+ * Prepped for Alpha 2 Release - KDEVELOP_3_0_ALPHA_2
+
+2002-11-16 Harald Fernengel <harry@kdevelop.org>
+ * Added ability to raise the left/right/bottom toolviews in IDEAl mode
+ * Added tooltips for IDEAl buttons
+ * appwizard now handles special characters better
+
+2002-11-09 August Hrandl <august.hoerandl@gmx.at>
+ * cppsupport: addclassattributedlg, cppaddmethoddlg und cclonefunctiondlg use
+ the classstore (project and pre-parsed libraries) for completion of type names
+
+2002-11-08 Sebastian Kratzert <skratzert@gmx.de>
+ * Reenabled KDELibsKDoc folder and made it removable
+
+2002-11-07 F@lk Brettschneider <falk@kdevelop.org>
+ * extended interface class KDevTopLevel in a way that parts can specify view icons and tab-tooltips
+ * adapted all parts to use this feature, now KDevelop in one of the 3 MDI modes looks more like KDevelop-2
+
+2002-11-05 Yann Hodique <Yann.Hodique@lifl.fr>
+ * new interface for global vcs actions
+ * new page for appwizard : vcs system choice
+ * global cvs part
+
+2002-11-05 F@lk Brettschneider <falk@kdevelop.org>
+ * adaption to KDevelop-2 behaviour: only show c++-debugger views when debugging
+ * and applied new patch of Heinz Hornung <Hornung-Heinz@t-online.de>
+ that introduces View-->TreeToolViews and View-->OutputToolViews again
+
+2002-11-03 Sebastian Kratzert <skratzert@gmx.de>
+ * qt documentation-tree now is generated with informations from QT_DOCDIR/html/qt.xml
+ * disabled DocIndexDlg
+ * results.html of htdig now shows all pics
+ * made location of project documentation configurable
+
+2002-11-02 Sebastian Kratzert <skratzert@gmx.de>
+ * Merged DoctreeConfig widget into one.
+ * Removed KDoc folder
+ * Use KURLRequester instead of LineEdits
+
+2002-11-01 Sebastian Kratzert <skratzert@gmx.de>
+ * added "Search in documentation" to editor contextmenu
+ * index kdoc folder on selection
+
+2002-11-01 F@lk Brettschneider <falk@kdevelop.org>
+ * fix in parts/doctreeview: if the Qt docu isn't available via doxygen books,
+ fall back to the using of the Qt docu path set in the
+ Gideon options "Documentation tree I"
+
+2002-10-31 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Since khelpcenter/htmlsearch is no more, put htdig configuration
+ options in doctreeview config widget; ship html and pic files
+ for htdig
+
+2002-10-29 Victor Rder <victor_roeder@gmx.de>
+ * applied Sebastian Kratzert's search improvements
+ for the docViewPart
+
+2002-10-28 F@lk Brettschneider <falk@kdevelop.org>
+ * compiles with KDE-3.0.3 again
+
+2002-10-21 Harald Fernengel <harry@kdevelop.org>
+ * show modified flag in sdi-mode if a file has
+ been modified
+ * added KSaveAllDialog that is shown if more than
+ one file is modified and needs to be saved.
+ * Display a nice error message if gideon cannot
+ find its plugins.
+
+2002-10-14 Victor Rder <victor_roeder@gmx.de>
+ * beautified some dialogs
+ - cppsupport/cppaddmethoddlgbase.ui
+ - tools/addtooldlg.ui (again)
+ - autoproject/addaplicationdlgbase.ui
+ - autoproject/addservicedlgbase.ui
+ - autoproject/addsubprojectdlgbase.ui
+ * added README to autoproject directory
+
+2002-10-11 Caleb Tennis <caleb@aei-tech.com>
+ * modified the splashscreen to not stradle multiple screens
+ with Xinerama installed
+
+2002-10-11 Harald Fernengel <harry@kdevelop.org>
+ * added open recent files action
+ * beautified "add tool dialog"
+ * recognize "makefile" and "Makefile" as makefile
+
+2002-10-08 Harald Fernengel <harry@kdevelop.org>
+ * compile qEditor only if Qt >= 3.0.5
+ * don't build sourcenav since it is obsoleted by history part
+
+2002-10-07 F@lk Brettschneider <falk@kdevelop.org>
+ * applied patch of Heinz Hornung <Hornung-Heinz@t-online.de>
+ improved window menu, old windowmenu part removed
+
+2002-09-25 Yann Hodique <Yann.Hodique@lifl.fr>
+ * Implemented some features in distpart
+ * Fixed a few bugs
+
+2002-09-20 Roberto Raggi <raggi@cli.di.unipi.it>
+ * Added statement rules to c++ parser
+
+2002-09-19 Roberto Raggi <raggi@cli.di.unipi.it>
+ * Improved code completion
+
+2002-09-17 Roberto Raggi <raggi@cli.di.unipi.it>
+ * Added problem reporter to c++ support
+
+2002-09-05 Harald Fernengel <harry@kdevelop.org>
+ * Added notification configuration dialog and notifications
+ for finished processes (off by default)
+
+2002-08-31 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Connected the last toolbar buttons
+ * I hereby declare trollprojectpart ready for alpha release :)
+
+2002-08-31 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject - added compiler/linker flags, includepath
+
+2002-08-30 John Firebaugh <jfirebaugh@kde.org>
+ * Implemented dynamic loading/unloading of plugins.
+ Some project plugins need to be fixed; I guess they expect to
+ get a projectLoaded signal, but a project is already loaded.
+ Might want to eventually refactor plugin loading code in
+ projectmanager to plugincontroller.
+
+2002-08-30 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * removed trollproject runoptionwidget using common lib/project/runoptionswidget
+ * added browse button to common runoptionwidget
+
+2002-08-29 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Trollproject Part
+ * added new project run options widget
+
+2002-08-28 Mickael Marchand <marchand@kde.org>
+ * Subversion kpart:
+ * Added log window to display retrieved logs from repositery
+
+2002-08-27 Mickael Marchand <marchand@kde.org>
+ * Subversion kpart:
+ * Notifications displayed in 'Application' view
+ * Prompt dialog (login/pass) added (untested yet)
+ * New SVN functions support : Revert, Status
+ * Removed "SVN:" stuff from logs
+
+2002-08-27 Harald Fernengel <harry@kdevelop.org>
+ * Added ability to edit toolbars in SDI and MDI mode
+ * fixed crash on exit (windowmenu part)
+
+2002-08-26 Mickael Marchand <marchand@kde.org>
+ * Added commit dialog to subversion part
+ * Prepared notification system
+
+2002-08-26 Harald Fernengel <harry@kdevelop.org>
+ * Better syntax highlighting for "cvs log", added ability to show diffs between versions
+
+2002-08-25 Mickael Marchand <marchand@kde.org>
+ * Imported first version of Subversion kpart
+
+2002-08-24 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * Applied first simple QMake based project template in appwizard
+
+2002-08-22 Harald Fernengel <harry@kdevelop.org>
+ * applyed patches by Hornung-Heinz@t-online.de (Heinz Hornung):
+ don't crash on exit
+ * applyed patches by Yann Hodique (DocBrowser and FileTemplate updates)
+ * Since there is no right pane in MDI modes, add select views to the left
+ (Automake Manager and Documentation Browser are now available again in MDI mode)
+
+2002-08-19 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject:
+ * File exclusion on qmake-scope-level now working
+
+2002-08-18 Victor Rder <victor_roeder@gmx.de>
+ * Applied Yann Hodique's cvspart patch
+
+2002-08-09 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject:
+ * Added toolbar to file tree
+
+2002-08-13 Harald Fernengel <harry@kdevelop.org>
+ * Applied goto next / prev window patch by Yann Hodique
+
+2002-08-11 Victor Rder <victor_roeder@gmx.de>
+ * Applied Sebastian Kratzert's search-extension-diff<2>
+
+2002-08-09 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject:
+ * Done implementing projectconfiguration dialog
+ * Added toolbarbuttons in the project tree
+
+2002-08-06 Harald Fernengel <harry@kdevelop.org>
+ * AppWizard fix, KDevelop plugin template ported to new architecture
+
+2002-08-05 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * Removed kdevelop source, to prepare for an alpha release
+
+2002-08-04 Christian Couder <christian@kdevelop.org>
+ * Fix a few appwizard bugs.
+
+2002-08-03 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject:
+ * Projectconfiguration dialog has been added
+ * Fileproperty dialog added for excluding files in subscopes
+
+2002-08-02 Harald Fernengel <harry@kdevelop.org>
+ * Changed the diff part from a modal dialog to an outputview
+
+2002-07-30 Harald Fernengel <harry@kdevelop.org>
+ * Added a "diff frontend" to allow other plugins use the diff part.
+ * Implemented it for CVS, so you can now view the differences to the
+ repository.
+ * Applied patch by "Caleb Tennis" <caleb@aei-tech.com>:
+ ask whether a file should be removed from the recent project
+ list if it doesn't exist anymore
+
+2002-07-29 Harald Fernengel <harry@kdevelop.org>
+ * Added a part to show diffs either in the widget from Kompare (->KDESDK)
+ or in a QTextEdit if Kompare is not installed.
+
+2002-07-27 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * Added a part for ant based projects.
+
+2002-07-24 Roberto Raggi <raggi@cli.di.unipi.it>
+ * added a new java parser based on ANTLR
+
+2002-07-23 Roberto Raggi <raggi@cli.di.unipi.it>
+ * updated qeditor to qt 3.0.5
+
+2002-07-19 Daniel Engelschalt <daniel.engelschalt@gmx.net>
+ * changes concerning the classstore are taking effect without restarting
+ * parsing of project directory works again without having persistance :)
+ * fixed some annoying bugs in ccconfigwidget
+
+2002-07-17 Victor Rder <victor_roeder@gmx.de>
+ * added a simple search mechanism to the Documentation Browser
+ -> but not really efficient :-(
+ -> TODO: Toy with a few ideas...
+
+2002-07-15 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollproject:
+ * trollprojectwidget:
+ * The projectmanager now supports qmake scopes
+ ( very large step towards completion of the trollprojectpart )
+
+2002-07-15 Matthias Hlzer-Klpfel <mhk@kde.org>
+
+ * Exchanged old javasupport part with the beginnings of a new one,
+ * written entirely in C++.
+
+2002-07-07 Victor Rder <victor_roeder@gmx.de>
+ * repaired layouting of some Automake dialogs
+ * adapted the the look of all Automake dialogs
+ * add blue bullet to the make output view
+
+2002-07-01 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollprojectpart:
+ * trollprojectwidget:
+ * Can now insert files and subdirs (.pro files are altered dynamically)
+
+ * Simple qmake projects can now fully be created and maintained from kdevelop
+ Currently working on handling more complicated .pro files with scopes.
+
+2002-06-30 Victor Rder <victor_roeder@gmx.de>
+ * continued the import existing dialog
+ -> ONLY adding existing files works at the moment!
+ * add Bjrn Sahlstrm's drag 'n drop support to the FileSelector
+ -> see kfilednd*view.* for details
+ * added new bullets to the make outputview
+ * everything needs a little bit code clean-up, so don't worry :-)
+
+2002-06-29 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollprojectpart:
+ * FileBuffer:
+ * added FileBuffer::removeValues() removes all values for a variable
+ in the .pro buffer
+ * added FileBuffer::setValues() alter buffer set qmake variable values.
+ This enables files and subdirs to be added and removed.
+ * added FileBuffer::saveBuffer() save buffer to file.
+
+2002-06-28 Jakob Simon-Gaarde <jakob@simon-gaarde.dk>
+ * trollprojectpart:
+ * filebufferclass added to buffer .pro files
+ (+filebuffer.cpp, +filebuffer.h)
+ * Caret pointer for FileBuffer class
+ (+caret.h, +caret.cpp)
+ * FileBuffer:
+ * added FileBuffer::findInBuffer(), find substring return Caret-pointer
+ * added FileBuffer::getValues() gets values for a qmake variable
+ handles '=' and '+=' operators (still to add '-=', '*=' and '~=')
+ return QString of space separated values
+ * trollprojectwidget:
+ * .pro file parser rewritten ( trollprojectwidget::parse() )
+ * reads forms (.ui files)
+
+2002-06-28 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * save and restore the dock mode in IDEAl
+
+2002-06-27 F@lk Brettschneider <falk@kdevelop.org>
+ * avoid library version clash between qextmdi of Gideon and KDevelop-2.1
+
+2002-06-23 Matthias Hlzer-Klpfel <mhk@kde.org>
+
+ * Made doxygen config widget "human readable"
+ * Preset doxygen configuration so it works out of the box
+ * Added a custom layout manager to the IDEAl buttons
+ unfortunately, only the horizontal ones stack. Someone
+ forgot a "widthForHeight" in QLayoutItem...
+ * added sticky mode for IDEAl ui mode
+
+2002-06-23 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * jbb autoproject patch: Resolve $(VARIABLES) in SUBDIRS
+ declaration with the help of variables defined in Makefile.am
+ * Parse #kdevelop: lines in Makefile.am. This way, conditional
+ subdirs can be resolved. See parts/Makefile.am for an example
+ * Make documentation created with the configure option
+ --with-apidocs in kdelibs browsable
+
+2002-06-23 F@lk Brettschneider <falk@kdevelop.org>
+ * updated QextMDI copy with its upcoming version 3
+ - drops Qt2 support
+ - adds view closebutton for TabPage mode
+
+2002-06-20 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Ported my KDE architecture documentation to
+ docbook; it's now in doc/kdearch.
+ * New kdeapi ioslave. This allows it to hyperlink
+ to Qt and kdelibs doxygen documentation in
+ DocBook documents without having to care for the
+ location of the docs.
+ * Settings widget for qt/kdelibs doxygen docs
+ location (autodetected by configure if it exists).
+ * Restore documentation windows in html part
+ instead of editor part.
+
+2002-06-13 John Firebaugh <jfirebaugh@kde.org>
+ * Debugger: be very smart about libtool.
+
+2002-06-14 Roberto Raggi <raggi@cli.di.unipi.it>
+ * qeditor: added keyboard macro support
+
+2002-06-13 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * classview:
+ - fix hierarchical view (It showed only a single
+ level of directories)
+ - make hierarchical view default (a la 2.x)
+ - don't use sort(), as suggested by Bernd
+ - remove obsolete sortFolder() <-- won't work anymore
+ * cppsupport: add file templates for .cpp and .h
+ * hack old kwrite-part a little to bring it up to date
+ (not finished)
+ * Add TODO items suggested by Falk
+
+2002-06-12 Matthias Hlzer-Klpfel <mhk@kde.org>
+
+ * Improved buttons in IDEAl mode: added keyboard navigation
+ and styleability.
+
+2002-06-12 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Compiling of single files in auto and custom project parts
+ * Set waitCursor while ctags is running
+ * cvs log message quoting fix
+ * Bullets in make output view.
+ Based on a patch by Marcus Gruendler <lists@tamalin.de>
+
+2002-06-11 John Firebaugh <jfirebaugh@kde.org>
+ Debugger bugfixes:
+ * Use core stop button and signal
+ * Actually shut down gdb when stopping
+ * Do the right thing when the program exits
+ * Load the config settings correctly
+ * Don't show application output in external konsole by default
+ * Use same menu item for start/continue
+
+2002-06-10 John Firebaugh <jfirebaugh@kde.org>
+ * New breakpoints widget. Uses KListView.
+ * Breakpoints should sync with document much better now.
+
+2002-06-10 Bernd Gehrmann <bernd@linux.local>
+
+ * Made class display (flat list vs. directory hierarchy) configurable
+
+2002-06-09 John Firebaugh <jfirebaugh@kde.org>
+ * debugging breakpoints now work much more sensibly
+ * can use kate icon-border menu to enable/disable
+ * properly move execution point
+
+2002-06-09 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * partcontroller now compares inodes instead of URLs
+ when the files are local
+
+2002-06-09 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * autoproject: get rid of symlinks in project directory
+ * classview: consider source dirs at any level, rather than 2 levels deep
+ * classview: show source dir hierarchy
+
+2002-06-07 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * add default support to DomUtil
+ * doctreeview: add configuration for Qt/KDE libs
+ * cppsupport: add configuration for file templates
+
+2002-05-31 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * kdevprj2kdevelop for converting project files
+ and creating file lists
+
+2002-05-30 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * In class view, arrange classes in folders if they
+ are more than one level below the project directory
+
+2002-05-29 John Firebaugh <jfirebaugh@kde.org>
+ * Added ProjectWorkspace. Save and restore opened files with project.
+
+2002-05-29 Harald Fernengel <harry@kdevelop.org>
+ * perforce part: implemented edit and revert
+ * perforce part: added submit dialog
+
+2002-05-28 Roberto Raggi <raggi@cli.di.unipi.it>
+ * qeditor: added find/replace dialogs
+
+2002-05-27 Harald Fernengel <harry@kdevelop.org>
+ * added perforce VCS part
+
+2002-05-27 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Show namespaced classes and structs in category mode
+ of the class view
+
+2002-05-26 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Implemented Goto ctags declaration and Goto ctags definition
+
+2002-05-25 John Firebaugh <jfirebaugh@kde.org>
+ * Add stop button. Core emits signal when processes begin/end.
+ TopLevel* connects and enables/disables stop button.
+ * Move project actions to ProjectManager. Removes much code
+ code duplication in toplevel_*.cpp.
+ * Allow opening project via command line/konqueror.
+
+2002-05-25 Roberto Raggi <raggi@cli.di.unipi.it>
+ * qeditor: Added code folding support
+ * qeditor: Added emacs-style indent mode
+
+2002-05-25 Harald Fernengel <harry@kdevelop.org>
+ * use KApplicationTree in tools-part to avoid code duplication
+
+2002-05-21 Roberto Raggi <raggi@cli.di.unipi.it>
+ * qeditor: Implemented markinterface
+ * qeditor: Implemented searchinterface
+
+2002-05-20 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * Welcome in the 2000's: the Tools menu config
+ now uses ksycoca...
+
+2002-05-20 Harald Fernengel <harry@kdevelop.org>
+ * Outputviews: Uses bright font colors if widget background is dark
+ * Extended Tools Config: Show App-Tree to make it more comfortable
+
+2002-05-20 Roberto Raggi <raggi@cli.di.unipi.it>
+ * Ported qeditor to ktexteditor interface
+ * Fixed text insertion in abbreviation part
+
+2002-05-20 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Make sure headers are parsed before sources
+ * Big cleanup in cppcodecompletion. Generalized
+ some of the code and put it into classstore API.
+ More to come...
+
+2002-05-18 Bernd Gehrmann <bernd@mail.berlios.de>
+
+ * Ported "Expand text" into abbrev part
+
+2002-05-16 Richard Dale <duke@tipitina.demon.co.uk>
+
+ * Fixed KDevelop compilation error by adding missing
+ PartController::setServiceType() method.
+
+2002-05-15 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Big cleanup in class store, see my mail in kdevelop-devel
+ * Fixed persistant class store to not store
+ namespaced classes twice
+ * Fixed ClassStore::removeWithReferences() to delete
+ classes from all namespaces, not only the global one
+ * Class combo boxes can show global functions now
+ * Class combo boxes handle namespaced classes now
+2002-05-13 Richard Dale <duke@tipitina.demon.co.uk>
+ * Added .mm and .M source file extensions for Objective-C++
+2002-05-10 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Put grep into editor context menu
+ * Put 'Lookup in Index' and 'Goto manpage'
+ into editor context menu
+ * Put 'Lookup in Index' and 'Search in docs'
+ into documentation context menu
+ * Implemented 'Run to cursor' in debugger part
+ and put 'Watch: foo' into editor context menu
+ * Removed lots of code duplication in tools config
+ * Tools can be added by DnD from kicker menu
+ * Some preparations for loading files with a
+ prescribed encoding
+2002-05-06 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Fixed history part crashing
+ * StatusBar cleanup
+ * Fixed ever-growing popup menu in editor
+ * Tool menu and the file and directory context
+ menus can now be populated with any shell
+ command. Output can be sent to the app output
+ art. %S, %D, %T and %W magic works like
+ in old KDevelop (I hope :-)
+2002-05-03 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Structure view for HTML, Docbook and LaTeX
+ * Perl part can exec programs and code snippets now
+ * Moved duplicated code for executing programs in
+ an external konsole into the app output part
+2002-05-01 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Limit size of class and method combo boxes
+ * Offer to rerun configure only if configuration
+ has changed
+2002-04-30 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Implemented fileFilters() for cppsupport
+ * Methods and classes can now be added when no file is loaded
+ * Don't parse headers twice, now that they are included in
+ AutoProjectPart::allFiles()
+ * Allow adding and removing files from custom project
+ * Do nothing if an organizer item in the class view is clicked on
+ * Bug fix in trollproject by Ludovic LANGE <ludovic.lange@free.fr>
+ to handle continuation lines in .pro files
+ * In trollproject, distinguish executed() and selectionChanged()
+ signals properly, improved context menus, started Remove File
+ implementation; made it possible to run qmake on any project
+ file; polishing
+2002-04-29 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Display header files in automake manager
+ * Add Icon dialog
+ * Allow to build index.cache.bz2 by context menu
+ * Multiple build configurations
+2002-04-28 Sandy Meier <smeier@kdevelop.org>
+
+ * fixed some broken stuff (load project on startup,GBA support,php code completion)
+ * codeCompletion/realtimeparser is now configurable (GUI)
+ * readded gideonrc
+2002-04-28 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Renamed KDevProject::allSourceFiles() to allFiles(), as it isn't
+ restricted to sources. It doesn't contain duplicates anymore.
+ * Handle AUTODIRS
+ * Handle foo_ICON
+ * Handle KDE_DOCS
+2002-04-28 Matthias Hlzer-Klpfel <mhk@kde.org>
+
+ * Added a part providing a history, allowing you to go
+ back and forward
+ * Added splashscreen. Now we need an artist! :-)
+2002-04-28 Harald Fernengel <harry@kdevelop.org>
+ * SourceNavPart now uses KToolBarPopupAction to display nifty
+ Konqueror-like drop down menus for source code navigation
+2002-04-27 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Context menu actions in auto project act on context
+ item, not active target
+ * Use selectionChanged() instead of executed() signal
+ in overview widget, so that the shown targets are
+ always those in the selected subproject
+ * Disable toolbuttons when subproject empty
+ * Data groups cannot be 'built' and they have no target options
+ * Replaced all usages of QCString in auto project
+ by QString and saved 35783 latin1 conversions ;-)
+ * Create popup menus with parent widget
+ * Made is possible to edit .desktop files
+2002-04-26 Harald Fernengel <harry@kdevelop.org>
+ * Added first version of SourceNav Part which adds back/forward tool-buttons for code navigation.
+ * Allow user to open more than one file in KFileDialog
+2002-04-25 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * started support for debugger handling via the new
+ KTextEditor interfaces
+ * started with new documentation part handling
+ * added a workaround to open all text files with the
+ same editor plugin
+2002-04-24 Victor Rder <victor_roeder@gmx.de>
+ * renamed Project view to Automake Manager
+ * reorganized Automake Manager
+ * added lowerAllViews() to KDevTopLevel
+ -> only implemented for TopLevelSDI!
+ * added some pixmaps
+ * Some dialogs done with QT Designer
+ -> RemoveFileDlg
+ -> AddFileDlg
+ -> AddExistingDlg (does not work, yet)
+2002-04-24 F@lk Brettschneider <falk@kdevelop.org>
+ * bugfix for QFocusEvent::m_reason in QextMDI copy, it stabilizes the optimized focus mechanism
+2002-04-23 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Removed redundant loadparts property from project file
+ * Added isDirectory() to FileContext, so one can distinguish
+ between regular files and directories.
+ * Added "Insert quoted" button to regexp part
+2002-04-22 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Only program and library targets can be made active
+ * Sane resizeMode and allColumnsShowFocus settings for more list views
+2002-04-21 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Implemented setting active target in autoproject
+ part and set a default one in most app templates
+ * Set resize mode of some list views to LastColumn
+ * In auto project, open active directory at startup
+ * Implemented addFile in auto project
+2002-04-20 Bernd Gehrmann <bernd@mail.berlios.de>
+ * If no compiler is set explicitly by the user,
+ use the options widget of the default compiler
+ (Property X-KDevelop-Default in the .desktop file)
+2002-04-19 Bernd Gehrmann <bernd@mail.berlios.de>
+ * In script projects, scan the source file list
+ at loading time with configurable include
+ and exclude pattern lists
+ * New file dialog in script project
+ * Implemented KDevLanguageSupport::fileFilters()
+ for Python, Perl and PHP
+ * grep part shows the exit status of the sub process
+2002-04-19 Harald Fernengel <harry@kdevelop.org>
+ * make outputwidget now locale aware
+2002-04-18 Bernd Gehrmann <bernd@mail.berlios.de>
+ * filter plugin
+ * Added methods addFile() and removeFile()
+ to KDevProject interface, implemented
+ in script and custom project parts
+ * Add File dialog in auto project uses the
+ FileTemplate class now
+ * Fixed displayed symbol kinds in ctags
+ dialog when file name extension is unknown
+ * ctags result list is now updated when
+ any of the selected criteria is changed
+2002-04-17 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * introduced a facade to access the KTextEditor interfaces
+ * removed some code from PartController that is no longer
+ needed
+2002-04-17 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Populate Build->Build Target menu in CustomProject
+ with targets from Makefile, build.xml resp.
+ * Use kdDebug() more consequently
+2002-04-16 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * added a bit more context to the EditorContext
+2002-04-15 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Share code between project management parts by
+ moving stuff to lib/project
+ * Separated file tree from custom and scripting
+ project parts into file view part, so that the
+ project parts do not have widgets themselves.
+ Hierchical file tree is KDirWatch'ed
+ * Builddir and build tool can be configured in
+ custom project now
+ * Merged KDevProject::openProject() and setProjectName()
+ * Added the notion of an activeDirectory() in which
+ new files are stored
+ * cerr -> kdDebug
+2002-04-15 Matthias Hlzer-Klpfel <mhk@kde.org>
+
+ * moved window menu code from src to a plugin
+
+2002-04-15 Simon Hausmann <hausmann@kde.org>
+ * Completed transition to KDevPlugin and KGenericFactory.
+2002-04-14 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Support for multiple file templates in app wizard
+ * More work on new class dialog
+ * Extended DomUtil to lists and pair lists
+2992-94-14 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * Added a new part that provides a "Open with" file menu entry
+ * Fixes for saving project settings on shutdown
+ * Properly enable menu entries when loading "last project"
+2002-04-13 Daniel Engelschalt <daniel.engelschalt@gmx.net>
+ * classstore config now in cppsupport
+ * code hinting really works now with KTextEditor
+ * update project pcs-file at projectClose( )
+2002-04-13 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Import dialog rewritten with designer, added author
+ and email fields
+ * When directory is selected in the import dialog, make
+ some guess work based on legacy project files, AUTHORS
+ and configure.in files
+ * Set /general/author and /general/email variables in
+ project file when creating new projects
+ * More keywords in app wizard
+ * Load Java debugger only for JVM programs
+ (keyword to be set by app wizard)
+2002-04-10 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * implemented setting the execution point
+ * move execution point handling from core to part controller
+2002-04-10 Simon Hausmann <hausmann@kde.org>
+ * ported the appwizard to KDP/KGF
+2002-04-09 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * ask user to save modified files before quitting
+2002-04-09 Roberto Raggi <raggi@cli.di.unipi.it>
+ * fixed crash in KDevDocTree
+ * removed qextmdi from kdevelop directory
+2002-04-09 Simon Hausmann <hausmann@kde.org>
+ * cleanups in the servicetype definitions. Added proper inheritance
+ and multiple defined propertyies
+ * some std:: namespace cleanups
+ * added KDevPlugin as successor of KDevPart
+ * ported the konsole plugin to KDevPlugin
+ * ported the editor chooser plugin to KDevPlugin
+ * ported the code abbreviation plugin to KDevPlugin
+ * ported the astyle plugin to KDevPlugin
+ * ported the classview plugin to KDevPlugin
+ * ported the ctags plugin to KDevPlugin
+ * extended gideon to load global KDevPlugin components
+ * centralized the trader queries for KDevelop/Part (Plugin) with
+ the additional constraint for the plugin scope into a static
+ PluginController::pluginServices method
+ * moved the duplicated code for extracting the X-KDevelop-Args
+ property of a service into a QStringList into a static private
+ method of PluginController
+ * install kdevelop components as KDE modules, not as libraries
+ * PluginController: don't bail out of loading of a kdevpart failed
+ * load kdevpart as well as kdevplugin components at the project
+ scope
+2002-04-08 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * emit loadedFile and savedFile again
+ * added DCOP interface for kdevpartcontroller
+2002-04-08 Roberto Raggi <raggi@cli.di.unipi.it>
+ * Fixed text insertion in Multi-language code template
+2002-04-07 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Fixed existing and potential memory leaks in class store
+ with a more modern api. Big textual changes, no changes
+ in semantics
+ * New class dialog, to be finished
+ * Multi-language version of Roberto's code template stuff,
+ not tested much
+2002-04-06 jbb <jbb@kdevelop.org>
+ * Fixed some crashes, mainly to do with using .latin1() on
+ a null string.
+ * Replaced cout with kdDebug (in a lot of places - part of
+ the above fix for crashes)
+ * fixed gcc3.0 compiler clash with define of out() in dbg.h
+ * Added K_DCOP to tokenizer, which fixed one cause of the latin1()
+ crash.
+
+2002-04-06 Bernd Gehrmann <bernd@mail.berlios.de>
+ * Python part can execute scripts and strings now
+2002-04-06 Harald Fernengel <harry@kdevelop.org>
+ * ported editor-chooser to KTextEditor and re-enabled it
+ * PartController now loads user's favourite editor
+2002-04-06 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * moved all part handling functions from KDevCore to
+ KDevPartController
+ * enabled context sensitve popup menus in the text editor
+ * various fixes and workarounds for QextMdi modes
+2002-04-05 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * commited some patches by Bernd for fixing layout issues
+ * commited a patch by Bernd for reenabling the floating
+ debug toolbar
+ * reenabled context menu entries comming from parts
+ * added tiny part to select the UI mode
+2002-04-04 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * reenabled the RMB menu
+ * fixed the widget deletion when parts are closed
+ * mark the active document in the menu
+ * renamed the "Buffer" menu "Window"
+ * removed the MDI window menu
+
+2002-04-01 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * added qextmdi to gideon
+ * made UI model configurable
+ * smaller refactorings in lib/interfaces
+ * moved toplevel view handling out of KDevCore to KDevTopLevel
+2002-03-29 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * migrated all parts to KTextEditor
+ * removed all traces of KEditor
+ * reenabled Tip-of-the-day
+2002-03-26 Matthias Hlzer-Klpfel <mhk@kde.org>
+ * refactored the core source completely
+ * sneaked in a new UI concept
+ (which Harald probably will replace with QextMDI soon)
+2002-02-24 Roberto Raggi <ragi@cli.di.unipi.it>
+ * improved code completion
+ * added quick hack for configuring the fonts for qeditor
+2002-16-02 Daniel Engelschalt <daniel.engelschalt@gmx.net>
+ * added codecompletion-classstore
+ * added removeWidget( )
+ * added config-dialogues for codecompletion/classstores
+ * improved codecompletion
+ * added cc-stuff from roberto raggi
+2002-10-02 Harald Fernengel <harry@kdevelop.org>
+ * Fixed KWrite Part and reenabled it again
+ * Added the Qt Editor Part (Qt Designer's Editor)
+2002-02-03 Christian Couder <christian@kdevelop.org>
+ * Bugfix : crash in classviewpart.cpp because languageSupport()
+ was null.
+2002-01-16 Richard Dale <duke@tipitina.demon.co.uk>
+ * Java plugin api regenerated
+2001-12-22 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * generate docs in all source dirs in Doxyfile
+ and enable dot output
+ * kdevelop2 project:
+ - project type: normal
+ - don't modify Makefiles
+ - subdirs: lib src parts
+
+2001-12-20 Sandy Meier <smeier@kdevelop.org>
+ * added "new class" dialog to the PHP support
+ incl. Basename completion and persistent class template
+ TODO: add class to the project after generation, (at the moment
+ KDevProject doesn't support it :-( )
+
+2001-12-16 Roland Krause <rokrau@yahoo.com>
+ * Reenabled the kwrite-part,
+ works now under KDE-3 with the KTextEditor interface.
+2001-12-15 Victor Rder <victor_roeder@gmx.de>
+ * Added persistence functionality to the class store
+ - "cooperation" of Bernd, Daniel E. and me
+ - the class store is saved and loaded from a binary file
+ * In core.cpp projectClosed() is emitted first and then
+ store->wipeout() is called
+2001-12-15 Sandy Meier <smeier@kdevelop.org>
+ * added some new options to the Appwizard (see README) and make it more intuitive: name completion,
+ project loading after generation...
+ * added "void openProject(const QString& projectFileName)" to the KDevCore Interface, used by AppWizard
+ * fileselect part reacts now on signal KDevCore::projectOpen()
+2001-12-12 August Hrandl <august.hoerandl@gmx.at>
+ * Add method dialog rewritten using designer
+2001-12-07 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * Added a preliminary Trie code to structure lib
+2001-11-29 Sandy Meier <smeier@kdevelop.org>
+ * added Gameboy Advance support including a "Hello World" template and
+ an emulator frontend
+2001-11-21 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * Started lib/structure which will feature tree,
+ trie and graph structures
+ * Started a part called sourcebrowser which will facilitate
+ multiple UI's to browse source code
+2001-10-23 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Made sourceinfo serializing more modular by adding
+ stream operators to all relevant classes,
+ including ParsedItem, and using them in the higher
+ level ones
+2001-10-14 Victor Rder <victor_roeder@gmx.de>
+ * new version of Daniel Engelschalt's CppCCParser
+ * KDevArgHint adapts now the font size of the editor
+2001-10-13 Victor Rder <victor_roeder@gmx.de>
+ * added an additional signal textChanged with
+ + KEditor::Document*
+ + int line
+ + int col as params
+ * added a switch to (de)activate cc (done with #ifs)
+2001-10-01 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Smart error message box when parts cannot be
+ loaded
+ * QFile::encode() library name
+2001-09-26 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added insertStdoutLine() and insertStderrLine() to
+ AppFrontend interface. This is e.g. needed by the
+ debugger frontend which maintains the complete communication
+ with the debugger *and* the application
+ * Big cleanup in libsourceinfo: Made internal variables
+ private, made accessors const-correct, return QStrings
+ now instead of references to them
+ * Changed ClassStore API to always use QStringLists instead
+ of QStrList
+ * Compiles with QT_NO_ASCII_CAST and QT_CLEAN_NAMESPACE now
+2001-09-26 Victor Rder <victor_roeder@gmx.de>
+ * CppCCParser rewritten by Daniel Engelschalt
+ * The affected code for CC is saved in a temporary file now
+ * fixed some bugs in CppCodeCompletion
+ * This is still very very alpha
+2001-08-22 Sandy Meier <smeier@kdevelop.org>
+ * all 1500 php global functions are now available for code completion (incl. prototype)
+2001-08-10 Victor Rder <victor_roeder@gmx.de>
+ * reimplemented CppCodeCompletion::getEntryListForClass() and
+ getEntryListForClassOfNamespace()
+ both work with the two recursive functions getParent...ListForClass()
+ multiple inheritance works now
+2001-08-10 Harald Fernengel <harry@bnro.de>
+ * Polished the Grep Dialog. It now remembers the last searches and
+ search directories, search button is now default-button
+ * find now works on non-unix platforms, too
+2001-08-08 Sandy Meier <smeier@kdevelop.org>
+ * the code completion and arghint works now in many cases (PHP)
+ * added realtimeparser, so the classview is updated while you type :-) (PHP)
+ * fix some problems in arghintWidget
+ * added textChanged() signal to the editor interface
+ * phpsupport display the parsing progress in the statusbar (code from Matthias)
+2001-08-06 Victor Rder <victor_roeder@gmx.de>
+ * Implemented several methods in CppCodeCompletionParser
+ getNode...();
+ * Extended CppCodeCompletion
+ getEntryListFor...();
+2001-08-04 Victor Rder <victor_roeder@gmx.de>, Daniel Haberkorn <dhaberkorn@gmx.de>
+ * Added CppCodeCompletionParser.cpp + .h (contains only interface definition)
+2001-08-02 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Exposed the status bar through the kdevcore interface
+ * Made cppsupport display the parsing progress in the statusbar
+
+2001-08-02 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Distpart:
+ - Fixed all layouts in distpart
+ - The relevant signal for check boxes is toggled(bool), not released()
+ - Use QDialog instead of QWidget and create it only on demand
+ - Okay -> OK
+ - Referring to generated names like Layout36 is a bad idea
+ * Put default binary name for compilers in their desktop files
+ This default is used for the CC/CXX/F77 setting when the
+ compiler has been changed by the user
+2001-07-30 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * interfaces/keditor: moc files are compiled separately, #include's
+ removed from cpp files.
+ * fix: KEditor::Editor don't emit documentActivated when there
+ isn't one.
+
+2001-07-29 Victor Rder <victor_roeder@gmx.de>
+ * KDevArgHint improved, i.e. positioning, ui
+2001-07-26 Victor Rder <victor_roeder@gmx.de>
+ * KDevArgHint added to KWrite-part (widget that shows the function
+ and its needed arguments)
+ Try it and type in 'test(' at the beginning of an empty line in a C++ project!
+ * showArgHint() added to CodeCompletionDocument
+ * added some code to CppCodeCompletion (cppsupport), but only for testing
+2001-07-26 Sandy Meier <smeier@kdevelop.org>
+ * kwrite CodeCompletionbox is now useable, maybe someone who want make it more colorful?
+ * php code completion supports (global methods,$this->xxx and $test = new xxx) now,
+ more will follow
+2001-07-26 Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
+ * debian packaging for kdevelop-3.0 branch
+ * kwrite: add path kwriteeditor_part for locating syntax.xml
+2001-07-22 Sandy Meier <smeier@kdevelop.org>
+ * implemented initial codeCompletion interface for kwrite
+ * added codeCompletion parsing to the PHP supportpart
+ (everything is very alpha)
+
+2001-07-21 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Canonicalize target name in TargetOptionsDialog.
+ Thanks to Ludovic LANGE <ludovic.lange@free.fr> for a patch
+ * Wait cursor while index dialog loads index files
+ * Configurable full text search in toc'ed documentation
+2001-07-17 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added kdoc-generated Qt/KDE index to index dialog
+ * Destroy compiled-in factories at exit. Otherwise
+ their KConfig's don't get sync()ed
+2001-07-16 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Made doxygen config widget more KDE compliant, i.e.
+ KDE icons, KFileDialog instead of QFileDialog,
+ cleanup
+2001-07-15 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Elementary cvs support (add, remove, update, commit)
+ * doxygen plugin
+ * Added FileContext for context menus in the FileView.
+ This should be used for the project management widgets
+ later.
+2001-07-13 Richard Dale <duke@tipitina.demon.co.uk>
+ * Fixed bug causing 'precondition violated' messages in the C++
+ class parser
+2001-07-12 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Store relative instead of absolute file names in custom project
+ * Use gotoFile() instead of gotoSourceFile() in custom and
+ script project
+ * Added Doxyfile for libkdevelop api
+2001-07-12 Sandy Meier <smeier@kdevelop.org>
+ * implemented extended plugin loading as discussed on Linuxtag 2001
+ see HACKING how you can use it
+
+2001-07-11 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added CustomProject part for projects not based
+ on either automake or tmake/qmake
+ * Templates for C and C++ imports with custom Makefiles
+ * Fix in import dialog to substitute APPNAMELC correctly
+2001-07-10 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Extended the KEditor::EditIface a bit
+ * started to implement it in the editor parts
+2001-07-05 Richard Dale <duke@tipitina.demon.co.uk>
+ * Fixed crash in class tool attribute display. Method and attribute
+ icons now displayed correctly
+ * Regenerated sources for Java plugin api
+ * References in the class store are cleared, before a source file
+ is parsed
+2001-07-05 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Quick hack for a tmake/qmake project management
+2001-07-03 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Make file views work for arbitrary mime types
+ * Switch header fix
+2001-07-03 Richard Dale <duke@tipitina.demon.co.uk>
+ * Added package visibility to the class browser for Java - denoted by a
+ green rectangle against an instance variable or method.
+2001-07-03 Richard Dale <duke@tipitina.demon.co.uk>
+ * Added accessor methods to the Class store/parser sources, so that
+ instance variables should no longer need to be accessed directly.
+ Java plugin api sources regenerated to use the new accessor method names
+2001-07-02 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Doc index dialog remembers checked indices and
+ categories per project
+ * GNUstep autoconf check, fixed directory
+ * Show 'Goto declaration' only for languages
+ with declarations
+ * Small toc and index DTD change
+2001-07-01 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added TOCs for STL and Gtk libraries
+ * Removed General section in doc tree view,
+ as all its contents are covered elsewhere
+ * Added PHP identifier index
+ * Doc tree view configurable on a per-project basis,
+ currently preconfigured by the app wizard and
+ import dialog; no user interface
+2001-06-29 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * TOCs for KDE2 development book and libc
+ plus Claudiu Costins <claudiuc@work.ro> scripts
+2001-06-28 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added GNUStep documentation toc plus a script
+ for generating it from gsdoc files
+ * Full Python toc plus a script for generating it
+ * Full PHP toc made by Claudiu Costins script
+2001-06-27 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented modification of build order of subprojects
+ * Fixed update of prefixes list
+ * Fixed update of include directory list
+ * Switch header/implementation
+2001-06-26 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Perldoc support
+ * Finished builddir support
+2001-06-25 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented Add subproject
+ * Fix for autoproject: allow ldflags to be
+ added for programs, but disable libtool flags
+ * Popup menu contexts for classes, not yet used
+2001-06-19 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * let the user choose which editor part to load
+2001-06-17 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Separated project options widget in 4 separate widgets
+ instead of one tab widget and embedded them
+ into the general project options dialog. This is
+ more intuitive for the user and doesn't expose
+ KDevelop's internal structure so much
+ * App wizard fixes and improvements in the project file structure
+ * Configurable builddir (not used yet)
+ * Configurable environment variables for program run
+ * Implemented Execute program
+ * Implemented Make messages
+ * Menu structure cleanup
+ * Implemented Make install
+2001-06-15 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented Add translation
+ * Implemented Execute program
+ * lex fix
+2001-06-14 Sandy Meier <smeier@kdevelop.org>
+ * phpsupport: configuration handling now in PHPConfigData
+ * phpsupport: web and shell invocation works now
+2001-06-14 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented distclean
+ * Support for autogen.sh in addition to Makefile.cvs
+2001-06-13 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Rewritten Add target dialog. Supports additional
+ LDFLAGS now. Will add a context menu item 'Add KDE plugin'
+ later which will set KDE_PLUGIN stuff as default
+ * Added a special kde mode to autoproject part.
+2001-06-12 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * New part regexptest for testing regular expressions
+ * Fixed make frontend to recognize ftnchek messages
+ correctly
+ * Changed make frontend api again so that the dir is
+ given as parameter. Necessary for finding the
+ directory of an erroneous file when only one
+ directory is built
+ * Rerun configure when project options have changed.
+2001-06-11 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Allow several commands for the make frontend to be queued
+ * Project management automatically runs configures if no
+ Makefile exists and Makefile.cvs if no configure script
+ exists
+2001-06-10 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Don't show Fortran options for gcc
+ * Enabled class view fixes from 06-05 :-)
+ * More import project types
+2001-06-09 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Started to move the kwrite code from lib to the part.
+ * Added additional kwrite functions to the menues.
+2001-06-05 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Reenabled the signals when files are loaded and
+ saved, so Bernd can test ;)
+ (This was a hotfix, I will do the real one later)
+2001-06-05 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added Add application desktop file dialog
+ * Fixed Add service dialog
+ * Some fixes in class view that I can't test currently...
+2001-06-04 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Added DCOP bindings to the editor interfaces,
+ so they are accessible for scripting.
+2001-06-03 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * New add service dialog in project management
+ Not quite ready
+ * Bug fixes in sub project and target options dialog
+2001-06-02 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * New sub project and target options dialogs.
+ These are much more user-friend wrt convenience
+ libraries and include directories within the
+ project. Furthermore, the libtool options are
+ presented in documented check boxes
+ * Put compiler options widget into the project
+ options framework
+2001-06-01 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Reimplemented the modified-on-disk check with the new
+ editor-interface.
+ * Reimplemented the modified check before quitting.
+ * Added "Save all" and "Revert all"
+ * Added "Revert" to the editor interface.
+2001-05-31 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Made some dom writing code more robust by
+ creating non-existent nodes in the tree
+ * Rewrote the import dialog to allow the choice between
+ a number of import templates
+2001-05-31 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * switched to the new editor interface concept
+2001-05-31 Sandy Meier <smeier@kdevelop.org>
+ * added initial php webserver/shell preview and config dialog (phpsupport)
+ * added errormessage parser/view (phpsupport)
+
+2001-05-31 Richard Dale <duke@tipitina.demon.co.uk>
+ * Added a Java JNI based plugin api, and a corresponding
+ project template for building a plugin. Java parts are
+ not built if a --without-java flag is used for configuration,
+ or if no suitable versions of javac, jar etc are found.
+2001-05-31 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added a zillion other languages to ctags tag mappings
+ * Regular expression matching in ctags part
+ * Tell user about dot in configure
+2001-05-30 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added a ctags part
+2001-05-30 Thomas Fromm <tf@tfromm.com>
+ * Added basic Highlighting for PHP
+2001-05-29 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added a pydoc ioslave and a corresponding menu item to
+ the python support part
+ * Added a man page item to the help menu
+2001-05-28 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * New scripting layer based on DCOP
+2001-05-27 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added TOCs for perl, python and PHP to the
+ documentation tree
+ * Added python documentation index
+ * Made file view aware of files added to and
+ removed from the project
+ * Added 'subdirs' files to KDE app templates
+ * Fixed project management regexps for tabs
+ * Fixed project management to properly emit addedFile signals
+ * Fixed auto project behaviour for prefixes with underscores
+ * LIBADD is for libraries, LDADD for programs
+ * Implemented 'Add prefix' dialog
+ * Show progress dialog when parsing files
+ * Implemented Remove file dialog in project management.
+ Does not quite work yet :-(
+2001-05-25 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added FORTRAN 77 parser
+ * Added plugins for g77 and the Portland Group's
+ f77 compiler and High Performance Fortran
+ compiler driver
+2001-05-24 Sandy Meier <smeier@kdevelop.org>
+ * added option (load last project on startup)
+ * saved mainview configuration on exit
+2001-05-24 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added templates for GNOME app and simple automake-
+ based C and C++ programs
+2001-05-23 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Fixed file view and made it possible to add new
+ groups and change the order of matched patterns
+ * Added preliminary fortran support part with a
+ ftnchek configuration dialog. Parser follows later...
+2001-05-22 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added a new part 'FileView' which shows all files of
+ a project sorted in groups like 'Sources' and
+ 'User Interface'. The groups can be configured
+ by the user. A default setting is provided by the
+ application wizard.
+2001-05-20 Sandy Meier <smeier@kdevelop.org>
+ * added initial PHP support including a simple php parser
+ * added "hello world" PHP template to AppWizard
+2001-05-20 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Added a new editor interface for debugging
+ (breakpoints etc.)
+ * Added cast methods to the editor interfaces, so
+ you don't have to pass strings around any longer
+2001-05-19 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added kicker, kioslave and kcmodule templates
+ * Each template can define an icon which is
+ shown in the app wizard
+ * The Big KInstance Cleanup
+2001-05-19 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Added a plugin to provide and configure a
+ Tools menu.
+2001-05-17 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Categorized all parts into Global or Project,
+ so that they are either loaded at startup or
+ at project loading time
+ * Added part selector which allows to configure
+ the used parts both globally and on a per-
+ project basis
+2001-05-14 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Back to KDialogBase for configuration dialogs
+2001-05-13 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added a project options dialog to which any
+ plugin can add a tab.
+ * Debugger configuration dialog
+ * Temporarily gone back to QTabDialog for these
+ configuration dialogs instead of KDialogBase.
+ Not sure if this is right...
+2001-05-13 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+
+ * Added a status interface to the editor interfaces
+ * Implemented display of editor status in the main
+ statusbar
+2001-05-12 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Changed compiler frontend to use QTextView, instead of QListBox.
+ Now copy&paste are possible, and the view scrolls to the end of the
+ output (unless the user has clicked otherwise)
+ * Also fixed the shortcuts
+ * Fixed buffer menu for documentation parts
+2001-05-11 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Commited the new editor framework
+ Note that it is not yet active, as it is not yet
+ complete. But it is evolving...
+2001-05-10 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added Python Hello world template
+ * Fixed memory leaks
+ * Fixed project files in templates to include mainprogram variable
+ * Fixed script project to not show . and .. and to go to a source
+ file when it is clicked
+ * Implemented printing
+2001-05-09 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented proper comparing of file identities:
+ Instead of the file name, now devno/inode are compared.
+ Important for NFS systems, where file names may have
+ a prefix like /tmp_mnt in some occasions
+ This was already implemented in the HEAD branch
+ before the old one ;-)
+ * Implemented KDevCore::gotoFile() as a generic method
+ to "go" to a file. Works for arbitrary mime types.
+ * Implemented KDevCore::revertAllFiles()
+ * Warning dialogs when modified files are closed or when
+ saved/loaded files were modified outside.
+ * Implemented searching html widget
+2001-05-08 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Use flex instead of $(LEX)
+ * Made function prototypes in tokenizer.l static.
+ Not making them 'static' explicitly makes them
+ 'extern' and causes a conflict
+ * Removed tokenizer.cpp from cvs, so it gets
+ generated at build time
+2001-05-05 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+
+ * prepared the Tip-of-the-Day plugin to make use of the
+ KTipDialog class that will soon appear in kdelibs.
+2001-05-01 Richard Dale <duke@tipitina.demon.co.uk>
+ * Removed hard coded java classpaths, and classnames. They are derived
+ from the projectDirectory and mainProgram project attributes.
+ * Checked in jdb front end code from Oliver Strutynski. He comments:
+ 'I finished work on a first version of JDB Support. It is not at
+ all feature complete (setting breakpoints does not work yet, hangs
+ from time to time) but could serve as a starting point for further
+ development. The directory contains a README describing some of the
+ parsing in the jdbcontroller.'
+2001-04-29 Sandy Meier <smeier@kdevelop.org>
+ * some changes in appwizard gui (qtdesigner based),
+ templates can have a category property now
+2001-04-27 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Implemented a generic project part for scripting languages.
+ It essentially consists of a widget that displays all files
+ in all subdirectories.
+ * Changed the class view to respect the feature set of the used
+ language. I.e. for example for python the sections with
+ variables are not displayed, as in python variables are not
+ declared.
+ * Sanitized project loading: The user now chooses the project
+ file in a file dialog, not the directory. The kapp, kpart
+ and kpartplugin appwizard scripts install a project file now.
+ * Replaced the persistence stuff (which was not yet used) in the
+ classstore with serialization routines based on QDataStream.
+ In principle, we could now send them around via DCOP :-)
+ * Implemented a python support part with parser
+ * Implemented a perl support part with parser
+2001-04-22 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Made configure arguments configurable
+ Patch by Berndt Josef Wulf <wulf@dingo.ping.net.au>
+ * Don't link with libfl in cppsupport and javasupport
+ * Each part now uses its own instance and the corresponding
+ resource directory
+2001-04-18 Richard Dale <duke@tipitina.demon.co.uk>
+ * GDB debugger part sources copied to 'parts/javadebugger', and all names
+ changed to JDB ones. Ready to add jdb functionality.
+2001-04-17 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Moved the splitter widget to lib/util, so it can be shared with parts
+ * Moved the editor part to lib/kwrite, to allow parts to access it.
+ * Added astyle part, a source code reformatter.
+2001-04-13 Richard Dale <duke@tipitina.demon.co.uk>
+ * Applied patch from Oliver Strutynski to fix bug in the Java tokenizer
+ with non US-ASCII identifiers in source files.
+2001-04-11 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * Added a plugin that let's you select the parts to load
+ on startup
+ * Added some code to core to only load the plugins selected.
+2001-04-10 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Added memory view widget
+ * Fixed disassemble widget to act only when it is visible
+ * Added examine core file and attach to process
+ * Cleaning widget after the debugger has finished
+ * Added status bar text and whats this
+ * Clear execution point mark when debugger has finished
+2001-04-10 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ * added a part to display a "Tip of the day"
+ * moved over the tips from the previous HEAD branch,
+ which probably need a review
+2001-04-09 Bernd Gehrmann <bernd@physik.hu-berlin.de>
+ * Rewritten the icon border stuff from 1.x for use
+ with multiple views per document
+ * Ported the debugger frontend
+2001-04-06 Richard Dale <duke@tipitina.demon.co.uk>
+ * Added Java and Objective-C class browsing, and Java KDE project template and
+ automake support (ie the _JAVA primary). Fixed bug in class browser where a
+ method's arguments were not being displayed (was that a bug or a feature?).
+ Clicking on a class's instance variables in the class browser now works and
+ takes you to the source file.
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 00000000..c708db86
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,27 @@
+INCLUDE(CheckIncludeFiles)
+
+#check for libz using the cmake supplied FindZLIB.cmake
+INCLUDE(FindZLIB)
+
+IF(ZLIB_FOUND)
+ SET(HAVE_LIBZ 1)
+ELSE(ZLIB_FOUND)
+ SET(HAVE_LIBZ 0)
+ENDIF(ZLIB_FOUND)
+
+#check for png
+INCLUDE(FindPNG)
+IF(PNG_FOUND)
+ SET(HAVE_LIBPNG 1)
+ELSE(PNG_FOUND)
+ SET(HAVE_LIBPNG 0)
+ENDIF(PNG_FOUND)
+
+#now check for dlfcn.h using the cmake supplied CHECK_INCLUDE_FILE() macro
+
+CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
+
+SET(CONFIG_QT_DOCDIR "\"/usr/lib/qt/doc/html/\"")
+SET(CONFIG_KDELIBS_DOXYDIR "\"/tmp/\"")
+
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_SOURCE_DIR}/config.h)
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 00000000..603b4e0b
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,274 @@
+# Doxyfile 1.3.5-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = KDevelop
+PROJECT_NUMBER = "Version CVS"
+OUTPUT_DIRECTORY = ./apidocs
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+ALWAYS_DETAILED_SEC = YES
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = $(PWD)/
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 4
+ALIASES = obsolete=@deprecated \
+ "feature=\xrefitem features \"Feature(s)\" \"Features\"" \
+ "maintainer=\xrefitem maintainers \"Maintainer(s)\" \"Maintainers\"" \
+ "unmaintained=\xrefitem unmaintained \"Unmaintained\" \"Unmaintained\"" \
+ "requirement=\xrefitem requirements \"Requirement(s)\" \"Requirements\"" \
+ "faq=\xrefitem FAQ \"F.A.Q.\" \"F.A.Q.\"" \
+ "authors=\xrefitem authors \"Author(s)\" \"Authors\"" \
+ "FIXME=\xrefitem fixme \"Fixme\" \"Fixme\""
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = NO
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = YES
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_FORMAT =
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = doc/api \
+ lib \
+ buildtools/projectmanager/interfaces
+# src \
+# parts \
+# languages \
+# buildtools \
+# editors \
+# vcs
+FILE_PATTERNS = *.h \
+ *.cpp \
+ *.cc \
+ *.hpp \
+ *.dox \
+ *.c++ \
+ *.cxx \
+ *.h++ \
+ *.hh
+RECURSIVE = YES
+EXCLUDE = languages/ada/app_templates \
+ languages/cpp/app_templates \
+ languages/cpp/file_templates \
+ languages/cpp/subclassing_template \
+ languages/fortran/app_templates \
+ languages/haskell/app_templates \
+ languages/java/app_templates \
+ languages/pascal/app_templates \
+ languages/perl/app_templates \
+ languages/php/app_templates \
+ languages/python/app_templates \
+ languages/ruby/app_templates \
+ languages/sql/app_templates \
+ lib/qextmdi \
+ vcs/cvsclient
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS = *.moc.* \
+ moc* \
+ *.all_cpp.* \
+ *unload.* \
+ */test/* \
+ */tests/* \
+ *face_skel.cpp \
+ *.ui.h
+EXAMPLE_PATH = languages/cpp/app_templates/khello \
+ languages/cpp/app_templates/kdevpart
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH = ./doc/api
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 3
+IGNORE_PREFIX = K
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = ./html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER = apidocs/common/header.html
+HTML_FOOTER = apidocs/common/footer.html
+HTML_STYLESHEET = apidocs/common/doxygen.css
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = YES
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = ./latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = YES
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = YES
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = ./rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = ./man
+MAN_EXTENSION = .kde3
+MAN_LINKS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = NO
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = ANTLR_USE_NAMESPACE(_x_)=_x_::
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES = $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/dcop/dcop.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/dcop/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/interfaces/interfaces.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/interfaces/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdecore/kdecore.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdecore/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdefx/kdefx.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdefx/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdeui/kdeui.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kdeui/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/khtml/khtml.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/khtml/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kio/kio.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kio/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kjs/kjs.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kjs/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kparts/kparts.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kparts/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kmdi/kmdi.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kmdi/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kutils/kutils.tag=$(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/kutils/html/ \
+ $(KDEDIR)/share/doc/HTML/en/kdelibs-apidocs/qt/qt.tag=$(QTDIR)/doc/html
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = NO
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = NO
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 800
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/Doxyfile.am b/Doxyfile.am
new file mode 100644
index 00000000..e35e931a
--- /dev/null
+++ b/Doxyfile.am
@@ -0,0 +1,186 @@
+## generate API documentation with doxygen
+apidox-am-yes:
+ @if test -z "$(DOXYGEN_EMPTY)"; then \
+ if test "$(subdir)" != "."; then \
+ docdir="$(DOXYGEN_DOCDIRPREFIX)"`basename "$(subdir)"`; \
+ $(mkinstalldirs) $(top_builddir)/apidocs/$$docdir ;\
+ if test ! -x $(top_builddir)/apidocs/common; then \
+ if test -d $(top_srcdir)/doc/common; then \
+ common_dir=`cd $(top_srcdir)/doc/common && pwd` ;\
+ else \
+ common_dir=$(kde_libs_htmldir)/en/common ;\
+ fi ;\
+ $(LN_S) $$common_dir $(top_builddir)/apidocs/common; \
+ fi ;\
+ cp $(top_srcdir)/admin/Doxyfile.global Doxyfile; \
+ echo "PROJECT_NAME = \"$(DOXYGEN_PROJECTNAME)\"" >> Doxyfile; \
+ echo "PROJECT_NUMBER = \"Version $(VERSION)\"" >> Doxyfile; \
+ echo "INPUT = $(srcdir)" >> Doxyfile; \
+ echo "IMAGE_PATH = $(top_srcdir)/doc/api" >> Doxyfile ;\
+ echo "OUTPUT_DIRECTORY = $(top_builddir)/apidocs" >> Doxyfile; \
+ echo "HTML_OUTPUT = $$docdir/html" >> Doxyfile; \
+ echo "HTML_HEADER = $(top_builddir)/apidocs/common/header.html" >> Doxyfile;\
+ echo "HTML_FOOTER = $(top_builddir)/apidocs/common/footer.html" >> Doxyfile;\
+ echo "HTML_STYLESHEET = $(top_builddir)/apidocs/common/doxygen.css" >> Doxyfile;\
+ echo "LATEX_OUTPUT = $$docdir/latex" >> Doxyfile; \
+ echo "RTF_OUTPUT = $$docdir/rtf" >> Doxyfile; \
+ echo "MAN_OUTPUT = $$docdir/man" >> Doxyfile; \
+ echo "GENERATE_HTML = $(GENERATE_FLAG)" >> Doxyfile ;\
+ echo "GENERATE_MAN = NO" >> Doxyfile ;\
+ echo "GENERATE_LATEX = NO" >> Doxyfile ;\
+ echo "RECURSIVE = NO" >> Doxyfile ;\
+ if test -n "$(DOXYGEN_EXCLUDE)"; then \
+ patterns= ;\
+ dirs= ;\
+ for item in `echo "$(DOXYGEN_EXCLUDE)"`; do \
+ if test -d "$(srcdir)/$$item"; then \
+ dirs="$$dirs $(srcdir)/$$item/" ;\
+ else \
+ patterns="$$patterns $$item" ;\
+ fi ;\
+ done ;\
+ echo "EXCLUDE_PATTERNS += $$patterns" >> Doxyfile; \
+ echo "EXCLUDE += $$dirs" >> Doxyfile ;\
+ fi ;\
+ echo "TAGFILES = \\" >> Doxyfile; \
+ tags='$(DOXYGEN_REFERENCES) qt'; for tag in $$tags; do \
+ tagpath= ;\
+ path="../../$$tag" ;\
+ if test -f $(top_builddir)/apidocs/$$tag/$$tag.tag; then \
+ tagpath="$(top_builddir)/apidocs/$$tag/$$tag.tag" ;\
+ else \
+ tagpath=`ls -1 $(kde_htmldir)/en/*-apidocs/$$tag/$$tag.tag 2> /dev/null` ;\
+ if test -n "$$tagpath"; then \
+ path=`echo $$tagpath | sed -e "s,.*/\([^/]*-apidocs\)/$$tag/$$tag.tag,../../../\1/$$tag,"` ;\
+ fi ;\
+ fi ;\
+ if test "$$tag" = qt; then \
+ echo $$tagpath=$(QTDOCDIR) >> Doxyfile ;\
+ else if test -n "$$tagpath"; then \
+ echo "$$tagpath=$$path/html \\" >> Doxyfile ;\
+ fi ;\
+ fi ;\
+ done ;\
+ echo "GENERATE_TAGFILE = $(top_builddir)/apidocs/$$docdir/$$docdir.tag" >> Doxyfile ;\
+ echo "HAVE_DOT = $(KDE_HAVE_DOT)" >> Doxyfile ;\
+ $(DOXYGEN) Doxyfile ;\
+ fi ;\
+ fi
+
+apidox-am-no:
+
+install-data-local: install-apidox
+
+## install API documentation
+install-apidox:
+ @if test "$(subdir)" != "."; then \
+ $(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html ; \
+ if test -f $(top_builddir)/apidocs/$(subdir)/$(subdir).tag; then \
+ echo $(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/$(subdir).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+ $(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/$(subdir).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+ fi; \
+ if test -d $(top_builddir)/apidocs/$(subdir)/html; then \
+ list=`ls $(top_builddir)/apidocs/$(subdir)/html`; \
+ echo "installing $(top_builddir)/apidocs/$(subdir)/html" ;\
+ for file in $$list; do \
+ $(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/html/$$file $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html; \
+ done; \
+ fi; \
+ rm -f $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/common; \
+ $(LN_S) $(kde_libs_htmldir)/en/common $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/common; \
+ else\
+ if test -d $(top_builddir)/apidocs; then \
+ $(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs ;\
+ list=`cd $(top_builddir)/apidocs && ls -1`; \
+ echo "installing $(top_builddir)/apidocs/$$file" ;\
+ for file in $$list; do \
+ if test -f $(top_builddir)/apidocs/$$file; then \
+ $(INSTALL_DATA) $(top_builddir)/apidocs/$$file $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
+ fi; \
+ done ; fi; \
+ fi
+
+uninstall-local: uninstall-apidox
+
+## uninstall API documentation
+uninstall-apidox:
+ @if test "$(subdir)" != "."; then \
+ if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); then \
+ rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+ fi\
+ else\
+ if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; then \
+ rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
+ fi\
+ fi
+
+apidox:
+ @if test "$(subdir)" != "."; then \
+ $(MAKE) apidox-am-@KDE_HAS_DOXYGEN@ ;\
+ else \
+ $(MAKE) apidox-am-toplevel-@KDE_HAS_DOXYGEN@ ;\
+ fi
+ @set fnord $(MAKEFLAGS); amf=$$2; if test -n '$(SUBDIRS)'; then \
+ list='$(SUBDIRS)'; \
+ if test "$(GENERATE_FLAG)" = "no" -o "$(subdir)" = "."; then \
+ for subdir in $$list; do \
+ if grep '^include .*Doxyfile.am' $(srcdir)/$$subdir/Makefile.am; then \
+ echo "Making apidox (tag) in $$subdir"; \
+ if test "$$subdir" != "."; then \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) GENERATE_FLAG=no apidox) || exit 1; \
+ fi ; fi ;\
+ done; \
+ fi; \
+ if test "$(GENERATE_FLAG)" = "yes" -o "$(subdir)" = "."; then \
+ for subdir in $$list; do \
+ if grep '^include .*Doxyfile.am' $(srcdir)/$$subdir/Makefile.am; then \
+ echo "Making apidox (html) in $$subdir"; \
+ if test "$$subdir" != "."; then \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) GENERATE_FLAG=yes apidox) || exit 1; \
+ fi ; fi ;\
+ done; \
+ fi; \
+ fi
+
+apidox-am-toplevel-no:
+apidox-am-toplevel-yes:
+ @echo "*** Creating API documentation main page"; \
+ cp $(top_srcdir)/admin/Doxyfile.global Doxyfile; \
+ echo "PROJECT_NAME = \"$(DOXYGEN_PROJECT_NAME)\"" >> Doxyfile ; \
+ echo "PROJECT_NUMBER = \"$(DOXYGEN_PROJECT_NUMBER)\"" >> Doxyfile ; \
+ echo "INPUT = $(top_srcdir)/doc/platform" >> Doxyfile ; \
+ echo "OUTPUT_DIRECTORY = $(top_builddir)/apidocs" >> Doxyfile ; \
+ echo "FILE_PATTERNS = *.dox" >> Doxyfile ; \
+ echo "RECURSIVE = NO" >> Doxyfile ; \
+ echo "SOURCE_BROWSER = NO" >> Doxyfile ; \
+ echo "ALPHABETICAL_INDEX = NO" >> Doxyfile ; \
+ echo "HTML_OUTPUT = ." >> Doxyfile ; \
+ echo "HTML_HEADER = apidocs/common/mainheader.html" >> Doxyfile ; \
+ echo "HTML_FOOTER = apidocs/common/mainfooter.html" >> Doxyfile ; \
+ echo "HTML_STYLESHEET = apidocs/common/doxygen.css" >> Doxyfile ; \
+ echo "GENERATE_LATEX = NO" >> Doxyfile ; \
+ echo "GENERATE_RTF = NO" >> Doxyfile ; \
+ echo "GENERATE_MAN = NO" >> Doxyfile ; \
+ echo "GENERATE_XML = NO" >> Doxyfile ; \
+ echo "GENERATE_AUTOGEN_DEF = NO" >> Doxyfile ; \
+ echo "ENABLE_PREPROCESSING = NO" >> Doxyfile ; \
+ echo "CLASS_DIAGRAMS = NO" >> Doxyfile ; \
+ echo "HAVE_DOT = NO" >> Doxyfile ; \
+ echo "GENERATE_HTML = YES" >> Doxyfile ;\
+ $(mkinstalldirs) $(top_builddir)/apidocs ; \
+ rm -f $(top_builddir)/apidocs/common ; \
+ if test -d $(top_srcdir)/doc/common; then \
+ common_dir=`cd $(top_srcdir)/doc/common && pwd` ;\
+ else \
+ common_dir=$(kde_libs_htmldir)/en/common ;\
+ fi ;\
+ $(LN_S) $$common_dir $(top_builddir)/apidocs/common ;\
+ doxygen Doxyfile; \
+ rm -f Doxyfile
+
+.PHONY: apidox-am-yes apidox-am-no install-data-local install-apidox install-apidox uninstall-local uninstall-apidox uninstall-apidox apidox apidox-am-toplevel-no apidox-am-toplevel-yes
+
+
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/Doxyfile_full.am b/Doxyfile_full.am
new file mode 100644
index 00000000..9d0262f9
--- /dev/null
+++ b/Doxyfile_full.am
@@ -0,0 +1,215 @@
+## generate API documentation with doxygen
+apidox-am-yes:
+ @if test "$(subdir)" == "."; then \
+ $(mkinstalldirs) $(top_builddir)/apidocs/$(subdir) ;\
+ if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ if test ! -x $(top_builddir)/apidocs/common; then \
+ if test -d $(top_srcdir)/doc/common; then \
+ common_dir=`cd $(top_srcdir)/doc/common && pwd` ;\
+ else \
+ common_dir=$(kde_libs_htmldir)/en/common ;\
+ fi ;\
+ $(LN_S) $$common_dir $(top_builddir)/apidocs/common; \
+ fi ;\
+ fi ;\
+ cp $(top_srcdir)/admin/Doxyfile.global Doxyfile; \
+ echo "PROJECT_NAME = $(DOXYGEN_PROJECT_NAME)" >> Doxyfile; \
+ echo "PROJECT_NUMBER = \"Version $(VERSION)\"" >> Doxyfile; \
+ echo "OUTPUT_DIRECTORY = $(PWD)/apidocs/en" >> Doxyfile; \
+ echo "BRIEF_MEMBER_DESC = NO" >> Doxyfile; \
+ echo "FULL_PATH_NAMES = YES" >> Doxyfile; \
+ echo "STRIP_FROM_PATH = $(top_srcdir)/" >> Doxyfile; \
+ echo "ALIASES += \"feature=\xrefitem features \\\"Feature(s)\\\" \\\"Features\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"maintainer=\xrefitem maintainers \\\"Maintainer(s)\\\" \\\"Maintainers\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"unmaintained=\xrefitem unmaintained \\\"Unmaintained\\\" \\\"Unmaintained\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"requirement=\xrefitem requirements \\\"Requirement(s)\\\" \\\"Requirements\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"faq=\xrefitem FAQ \\\"F.A.Q.\\\" \\\"F.A.Q.\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"authors=\xrefitem authors \\\"Author(s)\\\" \\\"Authors\\\"\" " >> Doxyfile; \
+ echo "ALIASES += \"FIXME=\xrefitem fixme \\\"Fixme\\\" \\\"Fixme\\\"\" " >> Doxyfile; \
+ echo "EXTRACT_ALL = NO" >> Doxyfile; \
+ echo "EXTRACT_PRIVATE = NO" >> Doxyfile; \
+ echo "EXTRACT_LOCAL_CLASSES = YES" >> Doxyfile; \
+ echo "HIDE_UNDOC_CLASSES = NO" >> Doxyfile; \
+ echo "HIDE_UNDOC_MEMBERS = NO" >> Doxyfile; \
+ echo "SORT_MEMBER_DOCS = YES" >> Doxyfile; \
+ echo "GENERATE_TODOLIST = YES" >> Doxyfile; \
+ if test -n "$(DOXYGEN_INPUT)"; then \
+ patterns= ;\
+ dirs= ;\
+ include_items='$(DOXYGEN_INPUT) '; for item in $$include_items; do \
+ if test -d "$(top_srcdir)/$$item"; then \
+ dirs="$$dirs $$item" ;\
+ else \
+ patterns="$$patterns $$item" ;\
+ fi ;\
+ done ;\
+ echo "INPUT += $$dirs" >> Doxyfile ;\
+ echo "FILE_PATTERNS += $$patterns" >> Doxyfile; \
+ fi ;\
+ if test -n "$(DOXYGEN_EXCLUDE)"; then \
+ patterns= ;\
+ dirs= ;\
+ exclude_items='$(DOXYGEN_EXCLUDE) '; for item in $$exclude_items; do \
+ if test -d "$(top_srcdir)/$$item"; then \
+ dirs="$$dirs $$item" ;\
+ else \
+ patterns="$$patterns $$item" ;\
+ fi ;\
+ done ;\
+ echo "EXCLUDE += $$dirs" >> Doxyfile ;\
+ echo "EXCLUDE_PATTERNS += $$patterns" >> Doxyfile; \
+ fi ;\
+ echo "EXAMPLE_PATH = $(DOXYGEN_EXAMPLE_PATH)" >> Doxyfile; \
+ echo "IMAGE_PATH = $(top_srcdir)/doc/api" >> Doxyfile ;\
+ echo "VERBATIM_HEADERS = NO" >> Doxyfile ;\
+ echo "IGNORE_PREFIX = K" >> Doxyfile ;\
+ echo "GENERATE_HTML = $(GENERATE_FLAG)" >> Doxyfile ;\
+ echo "HTML_OUTPUT = html" >> Doxyfile; \
+ if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ if test "$(DOXYGEN_SEARCHENGINE)" == "YES"; then \
+ echo "HTML_HEADER = $(PWD)/apidocs/common/appheader.html" >> Doxyfile ;\
+ else \
+ echo "HTML_HEADER = $(PWD)/apidocs/common/header.html" >> Doxyfile ;\
+ fi ;\
+ echo "HTML_FOOTER = $(PWD)/apidocs/common/footer.html" >> Doxyfile ;\
+ echo "HTML_STYLESHEET = $(PWD)/apidocs/common/doxygen.css" >> Doxyfile ;\
+ else \
+ echo "HTML_HEADER = " >> Doxyfile ;\
+ echo "HTML_FOOTER = " >> Doxyfile ;\
+ echo "HTML_STYLESHEET = " >> Doxyfile ;\
+ echo "DISABLE_INDEX = NO" >> Doxyfile ;\
+ fi ;\
+ echo "GENERATE_LATEX = NO" >> Doxyfile ; \
+ echo "LATEX_OUTPUT = $(subdir)/latex" >> Doxyfile; \
+ echo "RTF_OUTPUT = $(subdir)/rtf" >> Doxyfile; \
+ echo "GENERATE_MAN = NO" >> Doxyfile ;\
+ echo "MAN_OUTPUT = $(subdir)/man" >> Doxyfile; \
+ echo "MACRO_EXPANSION = YES" >> Doxyfile ; \
+ echo "PREDEFINED = ANTLR_USE_NAMESPACE(_x_)=_x_::" >> Doxyfile ; \
+ if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ echo "TAGFILES = \\" >> Doxyfile; \
+ tags='$(DOXYGEN_REFERENCES) qt'; for tag in $$tags; do \
+ tagpath= ;\
+ path="../../$$tag" ;\
+ if test -f $(top_builddir)/apidocs/$$tag/$$tag.tag; then \
+ tagpath="$(top_builddir)/apidocs/$$tag/$$tag.tag" ;\
+ else \
+ tagpath=`ls -1 $(kde_htmldir)/en/*-apidocs/$$tag/$$tag.tag 2> /dev/null` ;\
+ if test -n "$$tagpath"; then \
+ path=`echo $$tagpath | sed -e "s,.*/\([^/]*-apidocs\)/$$tag/$$tag.tag,../../\1/$$tag,"` ;\
+ else \
+ tagpath=`ls -1 $(kdelibs_doxydir)/$$tag/$$tag.tag 2> /dev/null` ;\
+ if test -n "$$tagpath"; then \
+ path=`echo $$tagpath | sed -e "s,.*/\([^/]*-apidocs\)/$$tag/$$tag.tag,$(kdelibs_doxydir)/$$tag,"` ;\
+ else \
+ tagpath=/home/apidox/public/cvs-api/$$tag/$$tag.tag ;\
+ fi ;\
+ fi ;\
+ fi ;\
+ if test "$$tag" = qt; then \
+ echo $$tagpath=$(QTDOCDIR) >> Doxyfile ;\
+ else if test -n "$$tagpath"; then \
+ echo "$$tagpath=$$path/html \\" >> Doxyfile ;\
+ fi ;\
+ fi ;\
+ done ;\
+ fi ;\
+ echo "HAVE_DOT = $(KDE_HAVE_DOT)" >> Doxyfile ; \
+ echo "SEARCHENGINE = $(DOXYGEN_SEARCHENGINE)" >> Doxyfile ; \
+ if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ rm -f $(top_builddir)/apidocs/common ; \
+ if test -d $(top_srcdir)/doc/common; then \
+ common_dir=`cd $(top_srcdir)/doc/common && pwd` ;\
+ else \
+ common_dir=$(kde_libs_htmldir)/en/common ;\
+ fi ;\
+ $(LN_S) $$common_dir $(top_builddir)/apidocs/common ;\
+ fi ;\
+ $(DOXYGEN) -s -u Doxyfile ; \
+ cp Doxyfile Doxyfile.in ; \
+ path_to_doxyfile=$(PWD) ;\
+ cd $(top_srcdir) ;\
+ $(DOXYGEN) $$path_to_doxyfile/Doxyfile ; \
+ cd $$path_to_doxyfile ;\
+ rm -f Doxyfile; \
+ fi
+
+apidox-am-no:
+
+## Let's only install the API documentation if the user explicitly invokes it's instalation
+##install-data-local: install-apidox
+
+## install API documentation
+install-apidox:
+ $(mkinstalldirs) $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html
+ @if test -f $(top_builddir)/apidocs/$(DOXYGEN_PROJECT_NAME).tag; then \
+ echo $(INSTALL_DATA) $(top_builddir)/apidocs/$(DOXYGEN_PROJECT_NAME).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+ $(INSTALL_DATA) $(top_builddir)/apidocs/$(DOXYGEN_PROJECT_NAME).tag $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
+ fi;
+ @if test -d $(top_builddir)/apidocs/$(subdir)/html; then \
+ list=`ls $(top_builddir)/apidocs/$(subdir)/html`; \
+ echo "installing $(top_builddir)/apidocs/$(subdir)/html" ;\
+ for file in $$list; do \
+ $(INSTALL_DATA) $(top_builddir)/apidocs/$(subdir)/html/$$file $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir)/html; \
+ done; \
+ fi;
+ @if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ rm -f $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/common; \
+ $(LN_S) $(kde_libs_htmldir)/en/common $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/common; \
+ fi;
+ @echo ""
+ @echo ""
+ @echo "************************* Important ***************************"
+ @echo ""
+ @echo "The $(PACKAGE) API documentation was successfuly installed at:"
+ @echo " $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/html"
+ @echo ""
+
+uninstall-local: uninstall-apidox
+
+## uninstall API documentation
+uninstall-apidox:
+ @if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; then \
+ echo "*** Uninstaling $(PACKAGE) API documentation" ; \
+ echo "rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs" ; \
+ rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
+ fi
+
+apidox:
+ $(MAKE) apidox-am-@KDE_HAS_DOXYGEN@
+ @set fnord $(MAKEFLAGS); amf=$$2; if test -n '$(SUBDIRS)'; then \
+ list='$(SUBDIRS)'; \
+ for subdir in $$list; do \
+ if grep '^include .*Doxyfile.am' $(srcdir)/$$subdir/Makefile.am; then \
+ echo "Making apidox in $$subdir"; \
+ if test "$$subdir" != "."; then \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) GENERATE_FLAG=no apidox) || exit 1; \
+ fi ; fi ;\
+ done; \
+ for subdir in $$list; do \
+ if grep '^include .*Doxyfile.am' $(srcdir)/$$subdir/Makefile.am; then \
+ echo "Making apidox in $$subdir"; \
+ if test "$$subdir" != "."; then \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) GENERATE_FLAG=yes apidox) || exit 1; \
+ fi ; fi ;\
+ done; \
+ if test "$(DOXYGEN_LINK_WITH_KDE_QT_APIDOX)" == "YES"; then \
+ echo ""; \
+ echo ""; \
+ echo "******************* Important *********************"; \
+ echo ""; \
+ echo "Before you can browse the API documentation you MUST issue:"; \
+ echo " make install-apidox (as root)"; \
+ echo ""; \
+ echo "The API documentation will then be installed at:"; \
+ echo " $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/html"; \
+ echo ""; \
+ fi ;\
+ fi
+
+.PHONY: apidox-am-yes apidox-am-no install-data-local install-apidox install-apidox uninstall-local uninstall-apidox uninstall-apidox apidox
+
+
+# Local Variables:
+# mode: makefile
+# End:
diff --git a/HACKING b/HACKING
new file mode 100644
index 00000000..8727a4ac
--- /dev/null
+++ b/HACKING
@@ -0,0 +1,9 @@
+To change KDevelop's code please read the API documentation generated by doxygen at:
+
+http://www.kdevelop.org
+
+or generate it yourself:
+
+make apidox ( the generated documentation will be at apidocs/html )
+
+or read *.dox files in the doc/api/ directory.
diff --git a/HACKING.language b/HACKING.language
new file mode 100644
index 00000000..de80e530
--- /dev/null
+++ b/HACKING.language
@@ -0,0 +1,12 @@
+To find how to add support for a new programming language to KDevelop
+please read the API documentation generated by doxygen at:
+
+http://www.kdevelop.org
+
+or generate it yourself:
+
+make apidox ( the generated documentation will be at apidocs/html )
+
+or read the file:
+
+doc/api/HowToAddProgrammingLanguages.dox
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 00000000..68fda7fa
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,175 @@
+To compile your own KDevelop you should follow the instructions at:
+
+http://www.kdevelop.org/index.html?filename=branches_compiling.html (latest stable version)
+http://www.kdevelop.org/index.html?filename=HEAD/branches_compiling.html (latest development version)
+
+For more generic and not so detailed information, continue to read this file.
+
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 00000000..138c7692
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,54 @@
+COMPILE_FIRST = lib src parts
+
+EXTRA_DIST = AUTHORS COPYING COPYING.LIB NEWS ChangeLog INSTALL README TODO HACKING HACKING.language admin configure.in.bot
+
+xdg_apps_DATA = kdevelop.desktop kdevassistant.desktop kdevelop_ruby.desktop \
+ kdevelop_c_cpp.desktop kdevelop_kde_cpp.desktop kdevelop_scripting.desktop
+#appsdir = $(kde_appsdir)/Development
+
+xdg_directory_DATA = kde-development-kdevelop.directory
+
+mime_DATA = x-kdevelop.desktop
+mimedir = $(kde_mimedir)/application
+
+kde_bin_SCRIPTS = kdevprj2kdevelop
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/kdevelop.m4.in
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
+
+package-messages:
+ $(MAKE) -f $(top_srcdir)/admin/Makefile.common package-messages
+ $(MAKE) -C po merge
+
+dist-hook:
+ cd $(top_distdir) && perl admin/am_edit -padmin
+ cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+messages:
+ find . -type d | grep -v CVS | grep -v '\.svn' | sed -e 's,$$,/,' > dirs
+ mfs=`find . -name Makefile.am | xargs egrep -l '^messages:'` ;\
+ for dir in $$mfs; do \
+ if test ! "$$dir" = "./Makefile.am"; then \
+ dir=`dirname $$dir` ;\
+ egrep -v "^$$dir" dirs > dirs.new && mv dirs.new dirs ;\
+ fi ;\
+ done
+ dirs=`cat dirs` ;\
+ find $$dirs -maxdepth 1 -name "*.cpp" -print > files ;\
+ find $$dirs -maxdepth 1 -name "*.cc" -print >> files ;\
+ find $$dirs -maxdepth 1 -name "*.h" -print >> files ;\
+ $(EXTRACTRC) `find $$dirs -maxdepth 1 -name "*.rc"` > rc.cpp ;\
+ $(EXTRACTRC) `find $$dirs -maxdepth 1 -name "*.ui"` >> rc.cpp ;\
+ $(XGETTEXT) rc.cpp `cat files` -o $(podir)/kdevelop.pot
+ @rm -f rc.cpp dirs files
+
+$(top_srcdir)/Makefile.am.in: # faking
+include admin/deps.am
+
+DOXYGEN_SEARCHENGINE = YES
+DOXYGEN_EMPTY = YES
+DOXYGEN_PROJECTNAME = KDevelop Platform API
+include Doxyfile.am
+SUBDIRS=$(TOPSUBDIRS)
+#kdevelop: lib src parts buildtools doc editors embedded kdevdesigner languages mimetypes pics vcs
diff --git a/Makefile.cvs b/Makefile.cvs
new file mode 100644
index 00000000..be59a869
--- /dev/null
+++ b/Makefile.cvs
@@ -0,0 +1,14 @@
+all:
+ @echo "This Makefile is only for the CVS repository"
+ @echo "This will be deleted before making the distribution"
+ @echo ""
+ @if test ! -d admin; then \
+ echo "Please recheckout this module!" ;\
+ echo "for cvs: use checkout once and after that update again" ;\
+ echo "for cvsup: checkout kde-common from cvsup and" ;\
+ echo " link kde-common/admin to ./admin" ;\
+ exit 1 ;\
+ fi
+ $(MAKE) -f admin/Makefile.common cvs
+
+.SILENT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 00000000..7e78da87
--- /dev/null
+++ b/README
@@ -0,0 +1,25 @@
+KDE API Documentation
+---------------------------
+If the KDE API documentation does not exist, it can be created
+as follows:
+
+ Install doxygen and the kdelibs sources. Then
+
+ make apidox
+ make install-apidox
+
+After that you should follow the instructions at:
+
+http://www.kdevelop.org/index.html?filename=branches_compiling.html
+
+to compile KDevelop
+
+
+For the graphical classbrowser, you need the program 'dot'
+from the graphviz package which can be downloaded from
+www.graphviz.org. This is only a runtime dependency!
+
+If you are experiencing build problems related to .moc files, try
+ rm *.moc*
+ make force-reedit
+in the source directory where the build system complains.
diff --git a/TODO b/TODO
new file mode 100644
index 00000000..234753db
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Please read/update the doc/api/FutureTasks.dox file instead.
diff --git a/buildtools/Makefile.am b/buildtools/Makefile.am
new file mode 100644
index 00000000..1c61d027
--- /dev/null
+++ b/buildtools/Makefile.am
@@ -0,0 +1,48 @@
+##
+## Do NOT remove the comments that start with "kdevelop:"
+## They are actually directives to the kdevelop plugin system
+##
+## The include_xxxx variables are controlled by configure.in.in
+##
+
+#kdevelop: ADA_BUILDTOOL = ada
+if include_ada
+ADA_BUILDTOOL = ada
+endif
+
+#kdevelop: ANT_BUILDTOOL = ant
+if include_ant
+ANT_BUILDTOOL = ant
+endif
+
+#kdevelop: AUTOTOOLS_BUILDTOOL = autotools
+if include_autoproject
+AUTOTOOLS_BUILDTOOL = autotools
+endif
+
+#kdevelop: CUSTOMMAKEFILES_BUILDTOOL = custommakefiles
+if include_customproject
+CUSTOMMAKEFILES_BUILDTOOL = custommakefiles
+endif
+
+#kdevelop: PASCAL_BUILDTOOL = pascal
+if include_pascal
+PASCAL_BUILDTOOL = pascal
+endif
+
+#kdevelop: QMAKE_BUILDTOOL = qmake
+if include_trollproject
+QMAKE_BUILDTOOL = qmake
+endif
+
+#kdevelop: SCRIPT_BUILDTOOL = script
+if include_scriptproject
+SCRIPT_BUILDTOOL = script
+endif
+
+SUBDIRS = lib $(ADA_BUILDTOOL) $(ANT_BUILDTOOL) \
+ $(AUTOTOOLS_BUILDTOOL) $(CUSTOMMAKEFILES_BUILDTOOL) $(PASCAL_BUILDTOOL) \
+ $(QMAKE_BUILDTOOL) $(SCRIPT_BUILDTOOL)
+
+DOXYGEN_EMPTY = YES
+include ../Doxyfile.am
diff --git a/buildtools/ada/Makefile.am b/buildtools/ada/Makefile.am
new file mode 100644
index 00000000..2de845ca
--- /dev/null
+++ b/buildtools/ada/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevadaproject.la
+libkdevadaproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevadaproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la
+
+libkdevadaproject_la_SOURCES = adaproject_part.cpp adaproject_widget.cpp adaproject_optionsdlgbase.ui adaprojectoptionsdlg.cpp adaglobaloptionsdlg.cpp service.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevadaproject.desktop
+
+rcdir = $(kde_datadir)/kdevadaproject
+rc_DATA = kdevadaproject.rc
diff --git a/buildtools/ada/README.dox b/buildtools/ada/README.dox
new file mode 100644
index 00000000..24e0bd7e
--- /dev/null
+++ b/buildtools/ada/README.dox
@@ -0,0 +1,17 @@
+/** \class AdaProjectPart
+Ada Project: the common project part for all available ada
+compilers (currently only gnat).
+It holds the project file list and tries to abstract from their specifics.
+
+\authors <a href="mailto:okellogg AT users.sourceforge.net">Oliver Kellogg</a>
+
+\unmaintained This part is currently un-maintained
+
+\deprecated This class is deprecated, use GenericProjectPart (buildtools/generic) instead.
+
+\feature supports gnat compiler
+\feature Holds the project file list and tries to abstract from their specifics
+
+\requirement Ada gnat compiler
+
+*/
diff --git a/buildtools/ada/adaglobaloptionsdlg.cpp b/buildtools/ada/adaglobaloptionsdlg.cpp
new file mode 100644
index 00000000..a8171c81
--- /dev/null
+++ b/buildtools/ada/adaglobaloptionsdlg.cpp
@@ -0,0 +1,129 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <kconfig.h>
+
+#include "kdevcompileroptions.h"
+
+#include "service.h"
+#include "adaproject_part.h"
+#include "adaglobaloptionsdlg.h"
+
+AdaGlobalOptionsDlg::AdaGlobalOptionsDlg(AdaProjectPart *part, QWidget* parent, const char* name, WFlags fl)
+ :AdaProjectOptionsDlgBase(parent,name,fl), m_part(part)
+{
+ delete config_label;
+ delete config_combo;
+ delete addconfig_button;
+ delete removeconfig_button;
+ delete compiler_label;
+ delete configuration_layout;
+ delete configuration_line;
+ delete exec_label;
+ delete exec_edit;
+ delete mainSourceLabel;
+ delete mainSourceUrl;
+ delete defaultopts_button;
+
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'");
+
+ ServiceComboBox::insertStringList(compiler_box, offers, &service_names, &service_execs);
+
+ if (offers.isEmpty())
+ options_button->setEnabled(false);
+
+ currentCompiler = QString::null;
+
+ /*kdDebug() << ServiceComboBox::defaultCompiler() << endl;
+ kdDebug() << ServiceComboBox::itemForText(ServiceComboBox::defaultCompiler(), service_names) << endl;
+ kdDebug() << compiler_box->text(ServiceComboBox::itemForText(ServiceComboBox::defaultCompiler(), service_names)) << endl;
+*/
+ ServiceComboBox::setCurrentText(compiler_box, ServiceComboBox::defaultCompiler(), service_names);
+ compiler_box_activated(compiler_box->currentText());
+}
+
+AdaGlobalOptionsDlg::~AdaGlobalOptionsDlg()
+{
+}
+
+void AdaGlobalOptionsDlg::optionsButtonClicked()
+{
+ QString name = ServiceComboBox::currentText(compiler_box, service_names);
+ KDevCompilerOptions *plugin = m_part->createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, options_edit->text());
+ options_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+void AdaGlobalOptionsDlg::compiler_box_activated(const QString& text)
+{
+ kdDebug() << "text changed from " << currentCompiler << " to " << text << endl;
+ if (currentCompiler == text)
+ return;
+ if (!currentCompiler.isEmpty())
+ saveCompilerOpts(currentCompiler);
+ currentCompiler = text;
+ readCompilerOpts(currentCompiler);
+}
+
+void AdaGlobalOptionsDlg::accept()
+{
+ saveCompilerOpts(currentCompiler);
+
+ saveConfigCache();
+}
+
+void AdaGlobalOptionsDlg::saveCompilerOpts( QString compiler )
+{
+ configCache[compiler] = options_edit->text();
+}
+
+void AdaGlobalOptionsDlg::readCompilerOpts( QString compiler )
+{
+ QString settings = configCache[compiler];
+ if (settings.isEmpty())
+ {
+ KConfig *config = KGlobal::config();
+ config->setGroup("Ada Compiler");
+ settings = config->readPathEntry(compiler);
+ }
+
+ options_edit->setText(settings);
+}
+
+void AdaGlobalOptionsDlg::readConfigCache( )
+{
+/* KConfig *config = KGlobal::config();
+ config->setGroup("Ada Compiler");
+
+ QMap<QString, QString> settings = config->entryMap("Ada Compiler");
+*/
+}
+
+void AdaGlobalOptionsDlg::saveConfigCache( )
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup("Ada Compiler");
+
+ for (QMap<QString, QString>::iterator it = configCache.begin(); it != configCache.end(); ++it)
+ {
+ config->writeEntry(it.key(), it.data());
+ }
+}
+
+#include "adaglobaloptionsdlg.moc"
diff --git a/buildtools/ada/adaglobaloptionsdlg.h b/buildtools/ada/adaglobaloptionsdlg.h
new file mode 100644
index 00000000..92001a1b
--- /dev/null
+++ b/buildtools/ada/adaglobaloptionsdlg.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#ifndef ADAGLOBALOPTIONSDLG_H
+#define ADAGLOBALOPTIONSDLG_H
+
+#include <qmap.h>
+
+#include <ktrader.h>
+
+#include "adaproject_optionsdlgbase.h"
+
+class AdaProjectPart;
+
+class AdaGlobalOptionsDlg : public AdaProjectOptionsDlgBase
+{
+ Q_OBJECT
+
+public:
+ AdaGlobalOptionsDlg(AdaProjectPart *part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~AdaGlobalOptionsDlg();
+
+public slots:
+ virtual void accept();
+
+protected slots:
+ virtual void optionsButtonClicked();
+ virtual void compiler_box_activated(const QString& text);
+
+private:
+ AdaProjectPart *m_part;
+ KTrader::OfferList offers;
+ QString currentCompiler;
+ QStringList service_names;
+ QStringList service_execs;
+ QMap<QString, QString> configCache;
+
+ void saveCompilerOpts(QString compiler);
+ void readCompilerOpts(QString compiler);
+
+ void readConfigCache();
+ void saveConfigCache();
+};
+
+#endif
diff --git a/buildtools/ada/adaproject_optionsdlgbase.ui b/buildtools/ada/adaproject_optionsdlgbase.ui
new file mode 100644
index 00000000..72e99f74
--- /dev/null
+++ b/buildtools/ada/adaproject_optionsdlgbase.ui
@@ -0,0 +1,472 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AdaProjectOptionsDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AdaProjectOptionsDlgBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Ada Compiler</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="10" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>160</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>configuration_layout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>config_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Configuration:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>config_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer17_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer18_2</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>
+ <widget class="QPushButton" row="6" column="4">
+ <property name="name">
+ <cstring>options_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>options_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Compiler &amp;options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>compiler_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Ada &amp;compiler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>exec_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="6" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>options_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>exec_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Compiler co&amp;mmand:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>configuration_line</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="5" column="3">
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KURLRequester" row="9" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>mainSourceUrl</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>26</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="9" column="0">
+ <property name="name">
+ <cstring>mainSourceLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Main &amp;source file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <spacer row="8" column="2">
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="7" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>400</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="7" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>defaultopts_button</cstring>
+ </property>
+ <property name="text">
+ <string>Load Default Compiler Options</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>compiler_box_activated(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>removeconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>configRemoved()</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>configComboTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>configChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>addconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>configAdded()</slot>
+ </connection>
+ <connection>
+ <sender>options_button</sender>
+ <signal>clicked()</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>optionsButtonClicked()</slot>
+ </connection>
+ <connection>
+ <sender>exec_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>options_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>mainSourceUrl</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>mainSourceUrl</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>defaultopts_button</sender>
+ <signal>clicked()</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDefaultOptions()</slot>
+ </connection>
+ <connection>
+ <sender>defaultopts_button</sender>
+ <signal>clicked()</signal>
+ <receiver>AdaProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>compiler_box</tabstop>
+ <tabstop>exec_edit</tabstop>
+ <tabstop>options_edit</tabstop>
+ <tabstop>options_button</tabstop>
+ <tabstop>mainSourceUrl</tabstop>
+ <tabstop>config_combo</tabstop>
+ <tabstop>addconfig_button</tabstop>
+ <tabstop>removeconfig_button</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">compiler_box_activated(const QString&amp;)</slot>
+ <slot access="protected">addconfig_button_clicked()</slot>
+ <slot access="protected">configRemoved()</slot>
+ <slot access="protected">configComboTextChanged(const QString&amp;)</slot>
+ <slot access="protected">configChanged(const QString&amp;)</slot>
+ <slot access="protected">optionsButtonClicked()</slot>
+ <slot access="protected">configAdded()</slot>
+ <slot access="protected">setDirty()</slot>
+ <slot access="protected">setDefaultOptions()</slot>
+</slots>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>qwidget.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/ada/adaproject_part.cpp b/buildtools/ada/adaproject_part.cpp
new file mode 100644
index 00000000..33ba166b
--- /dev/null
+++ b/buildtools/ada/adaproject_part.cpp
@@ -0,0 +1,465 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#include "adaproject_part.h"
+
+#include <qdom.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qvaluestack.h>
+#include <qregexp.h>
+#include <qvbox.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kgenericfactory.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kmessagebox.h>
+#include <klibloader.h>
+#include <kprocess.h>
+#include <kservice.h>
+#include <kconfig.h>
+
+#include "domutil.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevmakefrontend.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "kdevlanguagesupport.h"
+#include "kdevcompileroptions.h"
+#include "kdevgenericfactory.h"
+#include <kdevplugininfo.h>
+
+#include "adaproject_widget.h"
+#include "adaprojectoptionsdlg.h"
+#include "adaglobaloptionsdlg.h"
+
+typedef KDevGenericFactory<AdaProjectPart> AdaProjectFactory;
+static const KDevPluginInfo data("kdevadaproject");
+K_EXPORT_COMPONENT_FACTORY( libkdevadaproject, AdaProjectFactory( data ) )
+
+AdaProjectPart::AdaProjectPart(QObject *parent, const char *name, const QStringList& )
+ :KDevBuildTool(&data, parent, name ? name : "AdaProjectPart" )
+{
+ setInstance(AdaProjectFactory::instance());
+ setXMLFile("kdevadaproject.rc");
+
+ KAction *action;
+ action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8,
+ this, SLOT(slotBuild()),
+ actionCollection(), "build_build" );
+ action = new KAction( i18n("Execute Program"), "exec", 0,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_execute" );
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ this, SLOT(configWidget(KDialogBase*)) );
+
+// m_widget = new AdaProjectWidget(this);
+
+// QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?"));
+
+ // now you decide what should happen to the widget. Take a look at kdevcore.h
+ // or at other plugins how to embed it.
+
+ // if you want to embed your widget as an outputview, simply uncomment
+ // the following line.
+
+ // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" );
+
+}
+
+AdaProjectPart::~AdaProjectPart()
+{
+// delete m_widget;
+}
+
+/**
+ * This should really be merged with FileTreeWidget::matchesHidePattern()
+ * and put in its own class. Currently this is repeated in scriptprojectpart.cpp, pascalproject_part.cpp, adaproject_part.cpp
+ */
+static bool matchesPattern(const QString &fileName, const QStringList &patternList)
+{
+ QStringList::ConstIterator it;
+ for (it = patternList.begin(); it != patternList.end(); ++it) {
+ QRegExp re(*it, true, true);
+ if (re.search(fileName) == 0 && re.matchedLength() == (int)fileName.length())
+ return true;
+ }
+
+ return false;
+}
+
+void AdaProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ m_buildDir = dirName;
+ m_projectDir = dirName;
+ m_projectName = projectName;
+
+ QDomDocument &dom = *projectDom();
+ // Set the default directory radio to "executable"
+ if (DomUtil::readEntry(dom, "/kdevadaproject/run/directoryradio") == "" ) {
+ DomUtil::writeEntry(dom, "/kdevadaproject/run/directoryradio", "executable");
+ }
+
+ loadProjectConfig();
+
+ // Put all files from all subdirectories into file list
+ QValueStack<QString> s;
+ int prefixlen = m_projectDir.length()+1;
+ s.push(m_projectDir);
+
+ QStringList includepatternList;
+
+ if ( languageSupport() )
+ {
+ KMimeType::List list = languageSupport()->mimeTypes();
+ KMimeType::List::Iterator it = list.begin();
+ while( it != list.end() ){
+ includepatternList += (*it)->patterns();
+ ++it;
+ }
+ }
+
+ QString excludepatterns = "*~";
+ QStringList excludepatternList = QStringList::split(",", excludepatterns);
+
+ QDir dir;
+ do {
+ dir.setPath(s.pop());
+ kdDebug() << "AdaProjectPart::openProject examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if( !dirEntries )
+ break;
+
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it) {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir()) {
+ kdDebug() << "AdaProjectPart::openProject pushing: " << path << endl;
+ s.push(path);
+ }
+ else {
+ if (matchesPattern(path, includepatternList)
+ && !matchesPattern(path, excludepatternList)) {
+ kdDebug() << "AdaProjectPart::openProject adding: " << path << endl;
+ m_sourceFiles.append(path.mid(prefixlen));
+ } else {
+ kdDebug() << "AdaProjectPart::openProject ignoring: " << path << endl;
+ }
+ }
+ }
+ } while (!s.isEmpty());
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+void AdaProjectPart::closeProject()
+{
+}
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList AdaProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevadaproject/run/envvars", "envvar", "name", "value");
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString AdaProjectPart::runDirectory() const
+{
+ QString cwd = defaultRunDirectory("kdevadaproject");
+ if (cwd.isEmpty())
+ cwd = buildDirectory();
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+QString AdaProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevadaproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+
+ return QString();
+}
+
+/** Retuns a QString with the run command line arguments */
+QString AdaProjectPart::debugArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevadaproject/run/globaldebugarguments");
+}
+
+
+/** Retuns a QString with the run command line arguments */
+QString AdaProjectPart::runArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevadaproject/run/programargs");
+}
+
+QString AdaProjectPart::mainSource() const
+{
+ return projectDirectory() + "/" + m_mainSource;
+}
+
+void AdaProjectPart::setMainSource(QString fullPath)
+{
+ QString olddir = activeDirectory();
+ m_mainSource = fullPath.replace(QRegExp(QString(projectDirectory() + QString("/"))),"");
+ emit activeDirectoryChanged( olddir, activeDirectory() );
+}
+
+QString AdaProjectPart::projectDirectory() const
+{
+ return m_projectDir;
+}
+
+QString AdaProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+QString AdaProjectPart::activeDirectory() const
+{
+ QFileInfo fi(mainSource());
+ return fi.dirPath(true).replace(QRegExp(projectDirectory()),"");
+}
+
+QString AdaProjectPart::buildDirectory() const
+{
+ QFileInfo fi(mainSource());
+ return fi.dirPath(true);
+}
+
+void AdaProjectPart::listOfFiles(QStringList &result, QString path) const
+{
+ QDir d(path);
+ if (!d.exists())
+ return;
+
+ const QFileInfoList *entries = d.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden);
+ if( !entries )
+ return;
+
+ QFileInfoListIterator it( *entries );
+ while( const QFileInfo* fileInfo = it.current() )
+ {
+ ++it;
+
+ if (fileInfo->isDir() && fileInfo->filePath() != path)
+ {
+ kdDebug() << "entering dir " << fileInfo->dirPath() << endl;
+ listOfFiles(result, fileInfo->dirPath());
+ }
+ else
+ {
+ kdDebug() << "adding to result: " << fileInfo->filePath() << endl;
+ result << fileInfo->filePath();
+ }
+ }
+}
+
+QStringList AdaProjectPart::allFiles() const
+{
+// QStringList files;
+
+// listOfFiles(files, projectDirectory());
+
+// return files;
+ return m_sourceFiles;
+}
+
+void AdaProjectPart::addFile(const QString& /*fileName*/)
+{
+}
+
+void AdaProjectPart::addFiles(const QStringList& /*fileList*/)
+{
+}
+
+void AdaProjectPart::removeFile(const QString& /*fileName*/)
+{
+}
+
+void AdaProjectPart::removeFiles(const QStringList& /*fileList*/)
+{
+}
+
+void AdaProjectPart::slotBuild()
+{
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ QString cmdline = m_compilerExec + " " + m_compilerOpts + " ";
+
+ if (cmdline.isEmpty())
+ {
+ KMessageBox::sorry(0, i18n("Could not find ada compiler.\nCheck if your compiler settings are correct."));
+ return;
+ }
+
+ QFileInfo fi(mainSource());
+ cmdline += fi.fileName();
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(buildDirectory());
+ dircmd += " && ";
+
+ makeFrontend()->queueCommand(buildDirectory(), dircmd + cmdline);
+}
+
+void AdaProjectPart::slotExecute()
+{
+ partController()->saveAllFiles();
+ QString program = "./";
+ appFrontend()->startAppCommand(buildDirectory(), mainProgram(), true);
+}
+
+void AdaProjectPart::changedFiles( const QStringList & fileList )
+{
+ KDevProject::changedFiles(fileList);
+}
+
+void AdaProjectPart::changedFile( const QString & fileName )
+{
+ KDevProject::changedFile(fileName);
+}
+
+void AdaProjectPart::projectConfigWidget( KDialogBase * dlg )
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Ada Compiler"));
+ AdaProjectOptionsDlg *w = new AdaProjectOptionsDlg(this, vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ connect( dlg, SIGNAL(okClicked()), this, SLOT(loadProjectConfig()) );
+}
+
+void AdaProjectPart::loadProjectConfig( )
+{
+ QDomDocument &dom = *(projectDom());
+
+ QString config = DomUtil::readEntry(dom, "/kdevadaproject/general/useconfiguration", "default");
+ m_mainSource = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/mainsource") );
+ m_compilerOpts = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/compileroptions"));
+ m_compilerExec = DomUtil::readEntry(dom, QString("/kdevadaproject/configurations/") + config + QString("/compilerexec"));
+
+ if (m_compilerExec.isEmpty())
+ {
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ m_compilerExec = (*it)->exec();
+ break;
+ }
+ }
+ }
+}
+
+void AdaProjectPart::configWidget( KDialogBase * dlg )
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Ada Compiler"));
+ AdaGlobalOptionsDlg *w = new AdaGlobalOptionsDlg(this, vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+KDevCompilerOptions *AdaProjectPart::createCompilerOptions(const QString &name)
+{
+ KService::Ptr service = KService::serviceByDesktopName(name);
+ if (!service) {
+ kdDebug() << "AdaProjectPart::createCompilerOptions can't find service " << name;
+ return 0;
+ }
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory) {
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ KMessageBox::error(0, i18n("There was an error loading the module %1.\n"
+ "The diagnostics are:\n%2").arg(service->name()).arg(errorMessage));
+ exit(1);
+ }
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(this, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions")) {
+ kdDebug() << "AdaProjectPart::createCompilerOptions: component does not inherit KDevCompilerOptions" << endl;
+ return 0;
+ }
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+
+ return dlg;
+}
+
+QString AdaProjectPart::defaultOptions( const QString compiler )
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup("Ada Compiler");
+ return config->readPathEntry(compiler);
+}
+
+#include "adaproject_part.moc"
+
+
+/*!
+ \fn AdaProjectPart::distFiles() const
+ */
+QStringList AdaProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir(projectDir);
+ QStringList files = dir.entryList( "Makefile");
+ return sourceList + files;
+}
diff --git a/buildtools/ada/adaproject_part.h b/buildtools/ada/adaproject_part.h
new file mode 100644
index 00000000..88966ae2
--- /dev/null
+++ b/buildtools/ada/adaproject_part.h
@@ -0,0 +1,93 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#ifndef __KDEVPART_ADAPROJECT_H__
+#define __KDEVPART_ADAPROJECT_H__
+
+#include <qguardedptr.h>
+
+#include "kdevbuildtool.h"
+
+class AdaProjectWidget;
+class KDialogBase;
+class KDevCompilerOptions;
+
+class AdaProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+public:
+ AdaProjectPart(QObject *parent, const char *name, const QStringList &);
+ ~AdaProjectPart();
+
+ virtual void openProject(const QString &dirName, const QString &projectName);
+ virtual void closeProject();
+
+ /**Returns the name of the main source file without extension.
+ We assume that all Ada compilers call the binary that way. */
+ virtual QString mainProgram() const;
+ /**Main source file (like src/main.adb)*/
+ virtual QString mainSource() const;
+ virtual void setMainSource(QString fullPath);
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString activeDirectory() const;
+ /**The location of the main source file*/
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+
+ /**Returns everything in the project directory*/
+ virtual QStringList allFiles() const;
+ /**This does absolutelly nothing*/
+ virtual void addFile(const QString &fileName);
+ /**This does absolutelly nothing*/
+ virtual void addFiles(const QStringList &fileList);
+ /**This does absolutelly nothing*/
+ virtual void removeFile(const QString &fileName);
+ /**This does absolutelly nothing*/
+ virtual void removeFiles(const QStringList &fileList);
+
+ virtual void changedFiles( const QStringList & fileList );
+ virtual void changedFile( const QString & fileName );
+
+ KDevCompilerOptions *createCompilerOptions(const QString &name);
+
+ virtual QString defaultOptions(const QString compiler);
+ QStringList distFiles() const;
+
+public slots:
+ /**loads config from project file*/
+ void loadProjectConfig();
+
+private slots:
+ void slotBuild();
+ void slotExecute();
+ void projectConfigWidget(KDialogBase *dlg);
+ void configWidget(KDialogBase *dlg);
+
+private:
+ QGuardedPtr<AdaProjectWidget> m_widget;
+
+ void listOfFiles(QStringList &result, QString path) const;
+
+ QString m_buildDir;
+ QString m_projectDir;
+ QString m_projectName;
+
+ QString m_mainProg;
+ QString m_mainSource;
+ QString m_compilerExec;
+ QString m_compilerOpts;
+
+ QStringList m_sourceFiles;
+};
+
+#endif
diff --git a/buildtools/ada/adaproject_widget.cpp b/buildtools/ada/adaproject_widget.cpp
new file mode 100644
index 00000000..d4bdf37b
--- /dev/null
+++ b/buildtools/ada/adaproject_widget.cpp
@@ -0,0 +1,24 @@
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+#include <kdevcore.h>
+
+#include "adaproject_part.h"
+#include "adaproject_widget.h"
+
+
+AdaProjectWidget::AdaProjectWidget(AdaProjectPart *part)
+ : QWidget(0, "AdaProject widget")
+{
+ Q_UNUSED( part );
+}
+
+
+AdaProjectWidget::~AdaProjectWidget()
+{
+}
+
+
+#include "adaproject_widget.moc"
diff --git a/buildtools/ada/adaproject_widget.h b/buildtools/ada/adaproject_widget.h
new file mode 100644
index 00000000..dc6b4ec4
--- /dev/null
+++ b/buildtools/ada/adaproject_widget.h
@@ -0,0 +1,21 @@
+#ifndef __ADAPROJECT_WIDGET_H__
+#define __ADAPROJECT_WIDGET_H__
+
+#include <qwidget.h>
+#include <qstring.h>
+
+class KDevProject;
+class AdaProjectPart;
+
+class AdaProjectWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ AdaProjectWidget(AdaProjectPart *part);
+ ~AdaProjectWidget();
+
+};
+
+#endif
diff --git a/buildtools/ada/adaprojectoptionsdlg.cpp b/buildtools/ada/adaprojectoptionsdlg.cpp
new file mode 100644
index 00000000..3eafb082
--- /dev/null
+++ b/buildtools/ada/adaprojectoptionsdlg.cpp
@@ -0,0 +1,208 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#include <kurlrequester.h>
+#include <kservice.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <qregexp.h>
+#include <qvalidator.h>
+
+#include "domutil.h"
+#include "kdevcompileroptions.h"
+
+#include "service.h"
+#include "adaproject_part.h"
+#include "adaprojectoptionsdlg.h"
+
+AdaProjectOptionsDlg::AdaProjectOptionsDlg(AdaProjectPart *part, QWidget* parent, const char* name, WFlags fl)
+ : AdaProjectOptionsDlgBase(parent,name, fl), m_part(part)
+{
+ config_combo->setValidator(new QRegExpValidator(QRegExp("^\\D.*"), this));
+
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'");
+
+ ServiceComboBox::insertStringList(compiler_box, offers, &service_names, &service_execs);
+
+ if (offers.isEmpty())
+ options_button->setEnabled(false);
+
+ allConfigs = allBuildConfigs();
+ config_combo->insertStringList(allConfigs);
+
+ dirty = false;
+
+ QDomDocument &dom = *(m_part->projectDom());
+ currentConfig = QString::null;
+ configChanged(DomUtil::readEntry(dom, "/kdevadaproject/general/useconfiguration", "default"));
+}
+
+AdaProjectOptionsDlg::~AdaProjectOptionsDlg()
+{
+}
+
+QStringList AdaProjectOptionsDlg::allBuildConfigs()
+{
+ QDomDocument &dom = *(m_part->projectDom());
+
+ QStringList allConfigs;
+ allConfigs.append("default");
+
+ QDomNode node = dom.documentElement().namedItem("kdevadaproject").namedItem("configurations");
+ QDomElement childEl = node.firstChild().toElement();
+ while (!childEl.isNull()) {
+ QString config = childEl.tagName();
+ kdDebug() << "Found config " << config << endl;
+ if (config != "default")
+ allConfigs.append(config);
+ childEl = childEl.nextSibling().toElement();
+ }
+
+ return allConfigs;
+}
+
+void AdaProjectOptionsDlg::accept()
+{
+ DomUtil::writeEntry(*m_part->projectDom(), "/kdevadaproject/general/useconfiguration", currentConfig);
+ if (dirty)
+ {
+ saveConfig(currentConfig);
+ }
+}
+
+void AdaProjectOptionsDlg::compiler_box_activated( const QString& /*s*/ )
+{
+ QString exec = ServiceComboBox::currentText(compiler_box, service_execs);
+ exec_edit->setText(exec);
+}
+
+void AdaProjectOptionsDlg::saveConfig( QString config )
+{
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevadaproject/configurations/" + config + "/";
+
+ DomUtil::writeEntry(dom, prefix + "compiler",
+ ServiceComboBox::currentText(compiler_box, service_names));
+ DomUtil::writeEntry(dom, prefix + "compileroptions", options_edit->text());
+ DomUtil::writeEntry(dom, prefix + "compilerexec", exec_edit->text());
+ DomUtil::writeEntry(dom, prefix + "mainsource", mainSourceUrl->url().replace(QRegExp(m_part->projectDirectory() + QString("/")),""));
+}
+
+void AdaProjectOptionsDlg::readConfig( QString config )
+{
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevadaproject/configurations/" + config + "/";
+
+ QString compiler = DomUtil::readEntry(dom, prefix + "compiler", "");
+
+ if (compiler.isEmpty())
+ {
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ compiler = (*it)->name();
+ kdDebug() << "compiler is " << compiler << endl;
+ break;
+ }
+ }
+ }
+ ServiceComboBox::setCurrentText(compiler_box, compiler, service_names);
+
+ QString exec = DomUtil::readEntry(dom, prefix + "compilerexec", "");
+ if (exec.isEmpty())
+ exec = ServiceComboBox::currentText(compiler_box, service_execs);
+ exec_edit->setText(exec);
+ options_edit->setText(DomUtil::readEntry(dom, prefix + "compileroptions"));
+ mainSourceUrl->setURL(m_part->projectDirectory() + "/" + DomUtil::readEntry(dom, prefix + "mainsource"));
+}
+
+void AdaProjectOptionsDlg::configComboTextChanged(const QString &config)
+{
+ bool canAdd = !allConfigs.contains(config) && !config.contains("/") && !config.isEmpty();
+ bool canRemove = allConfigs.contains(config) && config != "default";
+ addconfig_button->setEnabled(canAdd);
+ removeconfig_button->setEnabled(canRemove);
+}
+
+
+void AdaProjectOptionsDlg::configChanged(const QString &config)
+{
+ if (config == currentConfig || !allConfigs.contains(config))
+ return;
+
+ if (!currentConfig.isNull() && dirty)
+ saveConfig(currentConfig);
+
+ currentConfig = config;
+ readConfig(config);
+ dirty = false;
+
+ config_combo->blockSignals(true);
+ config_combo->setEditText(config);
+ config_combo->blockSignals(false);
+}
+
+
+void AdaProjectOptionsDlg::configAdded()
+{
+ QString config = config_combo->currentText();
+
+ allConfigs.append(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+ configChanged(config);
+ setDirty(); // force saving
+}
+
+
+void AdaProjectOptionsDlg::configRemoved()
+{
+ QString config = config_combo->currentText();
+
+ QDomDocument dom = *m_part->projectDom();
+ QDomNode node = dom.documentElement().namedItem("kdevadaproject").namedItem("configurations");
+ node.removeChild(node.namedItem(config));
+ allConfigs.remove(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+
+ currentConfig = QString::null;
+ configChanged("default");
+}
+
+void AdaProjectOptionsDlg::optionsButtonClicked( )
+{
+ QString name = ServiceComboBox::currentText(compiler_box, service_names);
+ KDevCompilerOptions *plugin = m_part->createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, options_edit->text());
+ options_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+void AdaProjectOptionsDlg::setDirty( )
+{
+ dirty = true;
+}
+
+void AdaProjectOptionsDlg::setDefaultOptions( )
+{
+ if (!compiler_box->currentText().isEmpty())
+ options_edit->setText(m_part->defaultOptions(compiler_box->currentText()));
+}
+
+#include "adaprojectoptionsdlg.moc"
diff --git a/buildtools/ada/adaprojectoptionsdlg.h b/buildtools/ada/adaprojectoptionsdlg.h
new file mode 100644
index 00000000..d91c5266
--- /dev/null
+++ b/buildtools/ada/adaprojectoptionsdlg.h
@@ -0,0 +1,57 @@
+/* Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#ifndef ADAPROJECTOPTIONSDLG_H
+#define ADAPROJECTOPTIONSDLG_H
+
+#include <ktrader.h>
+
+#include "adaproject_optionsdlgbase.h"
+
+class AdaProjectPart;
+class KDevCompilerOptions;
+
+class AdaProjectOptionsDlg : public AdaProjectOptionsDlgBase
+{
+ Q_OBJECT
+
+public:
+ AdaProjectOptionsDlg(AdaProjectPart *part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~AdaProjectOptionsDlg();
+
+public slots:
+ virtual void accept();
+
+protected slots:
+ virtual void compiler_box_activated(const QString &s);
+ void configComboTextChanged(const QString &config);
+ void configChanged(const QString &config);
+ void configAdded();
+ void configRemoved();
+ void optionsButtonClicked();
+ void setDirty();
+ void setDefaultOptions();
+
+private:
+ QStringList allConfigs;
+ QString currentConfig;
+ bool dirty;
+
+ KTrader::OfferList offers;
+ QStringList service_names;
+ QStringList service_execs;
+
+ AdaProjectPart *m_part;
+
+ void saveConfig(QString config);
+ void readConfig(QString config);
+ QStringList allBuildConfigs();
+};
+
+#endif
+
diff --git a/buildtools/ada/kdevadaproject.desktop b/buildtools/ada/kdevadaproject.desktop
new file mode 100644
index 00000000..0e306f4b
--- /dev/null
+++ b/buildtools/ada/kdevadaproject.desktop
@@ -0,0 +1,100 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Ada Project
+Comment[br]=Raktres Ada
+Comment[ca]=Projecte Ada
+Comment[cs]=Ada projekt
+Comment[da]=Ada-projekt
+Comment[de]=Ada-Projekt für KDevelop
+Comment[el]=Έργο Ada
+Comment[es]=Proyecto Ada
+Comment[et]=Ada projekt
+Comment[eu]=Ada proiektua
+Comment[fa]=پروژۀ آدا
+Comment[fr]=Projet en Ada
+Comment[ga]=Tionscadal Ada
+Comment[gl]=Proxecto Ada
+Comment[hi]=एडीए परियोजना
+Comment[hu]=Ada-projekt
+Comment[is]=Ada verkefni
+Comment[it]=Progetto Ada
+Comment[ja]=Ada プロジェクト
+Comment[ms]=Projek Ada
+Comment[nds]=Ada-Projekt
+Comment[ne]=एडा परियोजना
+Comment[nl]=Ada-project
+Comment[pa]=Ada ਪ੍ਰੋਜੈਕਟ
+Comment[pl]=Projekt: Ada
+Comment[pt]=Projecto Ada
+Comment[pt_BR]=Projeto Ada
+Comment[ro]=Proiect Ada
+Comment[ru]=Проект Ada
+Comment[sk]=Ada projekt
+Comment[sl]=Projekt Ada
+Comment[sr]=Ada пројекат
+Comment[sr@Latn]=Ada projekat
+Comment[sv]=Ada-projekt
+Comment[ta]=அடா பிராஜக்ட்
+Comment[tg]=Лоиҳаи Ada
+Comment[tr]=Ada Projesi
+Comment[uz]=Ada loyihasi
+Comment[uz@cyrillic]=Ada лойиҳаси
+Comment[zh_CN]=Ada 工程
+Comment[zh_TW]=Ada 專案
+Name=KDevAdaProject
+Name[da]=KDevelop Ada-projekt
+Name[de]=Ada-Projekt (KDevelop)
+Name[fr]=Projet Ada pour KDevelop
+Name[hi]=के-डेव-एडीए-परियोजना
+Name[nds]=Ada-Projekt (KDevelop)
+Name[ne]=केडीई विकास एडा परियोजना
+Name[pl]=KDevProjektAda
+Name[sk]=KDevAdaProjekt
+Name[sv]=KDevelop Ada-projekt
+Name[ta]=கெடெவ் அடா பிராஜக்ட்
+Name[tg]=Лоиҳаи KDevAda
+Name[zh_TW]=KDevelop Ada 專案
+GenericName=Ada Project
+GenericName[br]=Raktres Ada
+GenericName[ca]=Projecte Ada
+GenericName[da]=Ada-projekt
+GenericName[de]=Ada-Projekt
+GenericName[el]=Έργο Ada
+GenericName[es]=Proyecto Ada
+GenericName[et]=Ada projekt
+GenericName[eu]=Ada proiektua
+GenericName[fa]=پروژۀ آدا
+GenericName[fr]=Projet en Ada
+GenericName[ga]=Tionscadal Ada
+GenericName[gl]=Proxecto Ada
+GenericName[hi]=एडीए परियोजना
+GenericName[hu]=Ada-projekt
+GenericName[is]=Ada verkefni
+GenericName[it]=Project con Ada
+GenericName[ja]=Ada プロジェクト
+GenericName[ms]=Projek Ada
+GenericName[nds]=Ada-Projekt
+GenericName[ne]=एडा परियोजना
+GenericName[nl]=Ada-project
+GenericName[pa]=Ada ਪ੍ਰੋਜੈਕਟ
+GenericName[pl]=Projekt: Ada
+GenericName[pt]=Projecto Ada
+GenericName[pt_BR]=Projeto Ada
+GenericName[ru]=Проект Ada
+GenericName[sk]=Ada projekt
+GenericName[sl]=Projekt Ada
+GenericName[sr]=Ada пројекат
+GenericName[sr@Latn]=Ada projekat
+GenericName[sv]=Ada-projekt
+GenericName[ta]=அடா பிராஜக்ட்
+GenericName[tg]=Лоиҳаи Ada
+GenericName[tr]=Ada Projesi
+GenericName[uz]=Ada loyihasi
+GenericName[uz@cyrillic]=Ada лойиҳаси
+GenericName[zh_CN]=Ada 工程
+GenericName[zh_TW]=Ada 專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevadaproject
+X-KDevelop-Version=5
+X-KDevelop-Language=Ada
diff --git a/buildtools/ada/kdevadaproject.rc b/buildtools/ada/kdevadaproject.rc
new file mode 100644
index 00000000..d7f260e1
--- /dev/null
+++ b/buildtools/ada/kdevadaproject.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="KDevAdaProject" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_build" />
+ <Separator/>
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar" noMerge="1">
+ <Action name="build_build" group="build_operations" />
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartplugin>
diff --git a/buildtools/ada/service.cpp b/buildtools/ada/service.cpp
new file mode 100644
index 00000000..02081a58
--- /dev/null
+++ b/buildtools/ada/service.cpp
@@ -0,0 +1,75 @@
+/* Copyright (C) 2001-2002 by Bernd Gehrmann
+ * bernd@kdevelop.org
+ * Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#include <qcombobox.h>
+#include <qvaluelist.h>
+
+#include <kservice.h>
+#include <kdebug.h>
+
+#include "service.h"
+
+
+void ServiceComboBox::insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
+ QStringList *names, QStringList *execs)
+{
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ combo->insertItem((*it)->comment());
+ (*names) << (*it)->desktopEntryName();
+ (*execs) << (*it)->exec();
+ kdDebug() << "insertStringList item " << (*it)->name() << "," << (*it)->exec() << endl;
+ }
+}
+
+QString ServiceComboBox::currentText(QComboBox *combo, const QStringList &names)
+{
+ if (combo->currentItem() == -1)
+ return QString::null;
+ return names[combo->currentItem()];
+}
+
+void ServiceComboBox::setCurrentText(QComboBox *combo, const QString &str, const QStringList &names)
+{
+ QStringList::ConstIterator it;
+ int i = 0;
+ for (it = names.begin(); it != names.end(); ++it) {
+ if (*it == str) {
+ combo->setCurrentItem(i);
+ break;
+ }
+ ++i;
+ }
+}
+
+int ServiceComboBox::itemForText(const QString &str, const QStringList &names)
+{
+ QStringList::ConstIterator it;
+ int i = 0;
+ for (it = names.begin(); it != names.end(); ++it) {
+ if (*it == str) {
+ return i;
+ }
+ ++i;
+ }
+ return 0;
+}
+
+QString ServiceComboBox::defaultCompiler()
+{
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Ada'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ return (*it)->name();;
+ }
+ }
+ return "";
+}
diff --git a/buildtools/ada/service.h b/buildtools/ada/service.h
new file mode 100644
index 00000000..f9671d0a
--- /dev/null
+++ b/buildtools/ada/service.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2001-2002 by Bernd Gehrmann
+ * bernd@kdevelop.org
+ * Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+#ifndef SERVICE_H
+#define SERVICE_H
+
+#include <ktrader.h>
+
+class ServiceComboBox
+{
+public:
+ static void insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
+ QStringList *names, QStringList *execs);
+ static QString currentText(QComboBox *combo, const QStringList &names);
+ static void setCurrentText(QComboBox *combo, const QString &str, const QStringList &names);
+ static int itemForText(const QString &str, const QStringList &names);
+ static QString defaultCompiler();
+};
+
+#endif
diff --git a/buildtools/ant/Makefile.am b/buildtools/ant/Makefile.am
new file mode 100644
index 00000000..6a92a5b1
--- /dev/null
+++ b/buildtools/ant/Makefile.am
@@ -0,0 +1,21 @@
+# Here resides the ant project part.
+
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_builddir)/buildtools/lib/widgets \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevantproject.la
+libkdevantproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevantproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la
+
+libkdevantproject_la_SOURCES = antprojectpart.cpp antoptionswidget.ui classpathwidget.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevantproject.desktop
+
+rcdir = $(kde_datadir)/kdevantproject
+rc_DATA = kdevantproject.rc
diff --git a/buildtools/ant/README.dox b/buildtools/ant/README.dox
new file mode 100644
index 00000000..b4b8a7c9
--- /dev/null
+++ b/buildtools/ant/README.dox
@@ -0,0 +1,8 @@
+/** \class AntProjectPart
+ant build tool part.
+
+\authors <a href="mailto:mh AT caldera.de">Matthias Hoelzer-Kluepfel</a>
+
+\unmaintained This part is currently un-maintained
+
+*/
diff --git a/buildtools/ant/antoptionswidget.ui b/buildtools/ant/antoptionswidget.ui
new file mode 100644
index 00000000..fa78e97f
--- /dev/null
+++ b/buildtools/ant/antoptionswidget.ui
@@ -0,0 +1,173 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AntOptionsWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AntOptionsWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>410</width>
+ <height>266</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Quiet</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Verbose</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Debug</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>Verbosity</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>86</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="0">
+ <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>16</width>
+ <height>86</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Build file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>BuildXML</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Verbosity:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>Verbosity</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Properties:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>Properties</cstring>
+ </property>
+ </widget>
+ <widget class="QTable" row="2" column="1" rowspan="1" colspan="2">
+ <column>
+ <property name="text">
+ <string>Property</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>Properties</cstring>
+ </property>
+ <property name="numRows">
+ <number>0</number>
+ </property>
+ <property name="numCols">
+ <number>2</number>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <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>240</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KURLRequester" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>BuildXML</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>BuildXML</tabstop>
+ <tabstop>Verbosity</tabstop>
+ <tabstop>Properties</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/ant/antprojectpart.cpp b/buildtools/ant/antprojectpart.cpp
new file mode 100644
index 00000000..a7f0ea25
--- /dev/null
+++ b/buildtools/ant/antprojectpart.cpp
@@ -0,0 +1,608 @@
+#include "antprojectpart.h"
+
+#include <qapplication.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qvbox.h>
+#include <qtable.h>
+#include <qtextstream.h>
+#include <qvaluestack.h>
+#include <qdir.h>
+
+
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kpopupmenu.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <kcombobox.h>
+#include <keditlistbox.h>
+#include <kurlrequester.h>
+
+#include <kdevplugininfo.h>
+
+#include <kdevcore.h>
+#include <kdevmakefrontend.h>
+#include <urlutil.h>
+
+
+#include "antoptionswidget.h"
+#include "classpathwidget.h"
+
+
+
+
+typedef KDevGenericFactory<AntProjectPart> AntProjectFactory;
+static const KDevPluginInfo data("kdevantproject");
+K_EXPORT_COMPONENT_FACTORY(libkdevantproject, AntProjectFactory( data ))
+
+
+AntOptions::AntOptions()
+ : m_buildXML("build.xml"), m_verbosity(AntOptions::Quiet)
+{
+}
+
+
+AntProjectPart::AntProjectPart(QObject *parent, const char *name, const QStringList &)
+ : KDevBuildTool(&data, parent, name ? name : "AntProjectPart")
+{
+ setInstance(AntProjectFactory::instance());
+
+ setXMLFile("kdevantproject.rc");
+
+ m_buildProjectAction = new KAction(i18n("&Build Project"), "make_kdevelop", Key_F8,
+ this, SLOT(slotBuild()),
+ actionCollection(), "build_build" );
+ m_buildProjectAction->setToolTip(i18n("Build project"));
+ m_buildProjectAction->setWhatsThis(i18n("<b>Build project</b><p>Executes <b>ant dist</b> command to build the project."));
+
+ KActionMenu *menu = new KActionMenu(i18n("Build &Target"),
+ actionCollection(), "build_target" );
+ menu->setToolTip(i18n("Build target"));
+ menu->setWhatsThis(i18n("<b>Build target</b><p>Executes <b>ant target_name</b> command to build the specified target."));
+
+ m_targetMenu = menu->popupMenu();
+
+ connect(m_targetMenu, SIGNAL(activated(int)), this, SLOT(slotTargetMenuActivated(int)));
+ connect(core(), SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(projectConfigWidget(KDialogBase*)));
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+
+ m_antOptionsWidget = 0;
+}
+
+
+AntProjectPart::~AntProjectPart()
+{
+}
+
+
+void AntProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ m_projectDirectory = dirName;
+ m_projectName = projectName;
+
+ QDomDocument &dom = *projectDom();
+ // Set the default directory radio to "executable"
+ /// \FIXME there is no kdevantproject so this will not work !
+ if (DomUtil::readEntry(dom, "/kdevantproject/run/directoryradio") == "" ) {
+ DomUtil::writeEntry(dom, "/kdevantproject/run/directoryradio", "executable");
+ }
+
+ /// @todo read alternative build file from properties
+ m_antOptions.m_buildXML = "build.xml";
+
+ parseBuildXML();
+
+ fillMenu();
+
+ QFile f(dirName + "/" + projectName.lower() + ".kdevelop" + ".filelist");
+ if (f.open(IO_ReadOnly))
+ {
+ QTextStream stream(&f);
+ while (!stream.atEnd())
+ {
+ QString s = stream.readLine();
+ if (!s.startsWith("#"))
+ m_sourceFiles << s;
+ }
+ }
+ else
+ populateProject();
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+
+void AntProjectPart::populateProject()
+{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ QValueStack<QString> s;
+ int prefixlen = m_projectDirectory.length()+1;
+ s.push(m_projectDirectory);
+
+ QDir dir;
+ do
+ {
+ dir.setPath(s.pop());
+ kdDebug() << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it)
+ {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir())
+ {
+ kdDebug() << "Pushing: " << path << endl;
+ s.push(path);
+ }
+ else
+ {
+ kdDebug() << "Adding: " << path << endl;
+ m_sourceFiles.append(path.mid(prefixlen));
+ }
+ }
+ }
+ while (!s.isEmpty());
+
+ QApplication::restoreOverrideCursor();
+}
+
+
+void AntProjectPart::closeProject()
+{
+ m_projectDirectory = "";
+ m_projectName = "";
+ m_buildProjectAction->setEnabled(false);
+
+ m_targetMenu->clear();
+
+ m_antOptions = AntOptions();
+
+ QFile f(m_projectDirectory + "/" + m_projectName.lower() + ".kdevelop" + ".filelist");
+ if (!f.open(IO_WriteOnly))
+ return;
+
+ QTextStream stream(&f);
+ stream << "# KDevelop Ant Project File List" << endl;
+
+ QStringList::ConstIterator it;
+ for (it = m_sourceFiles.begin(); it != m_sourceFiles.end(); ++it)
+ stream << (*it) << endl;
+ f.close();
+}
+
+
+QString AntProjectPart::projectDirectory() const
+{
+ return m_projectDirectory;
+}
+
+
+QString AntProjectPart::buildDirectory() const
+{
+ return m_projectDirectory;
+}
+
+QString AntProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList AntProjectPart::runEnvironmentVars() const
+{
+ /// \FIXME there is no kdevantproject so this will not work !
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevantproject/run/envvars", "envvar", "name", "value");
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString AntProjectPart::runDirectory() const
+{
+ return buildDirectory();
+ /// \FIXME put the code below into use!
+
+ QDomDocument &dom = *projectDom();
+
+ /// \FIXME there is no kdevantproject so this will not work !
+ QString directoryRadioString = DomUtil::readEntry(dom, "/kdevantproject/run/directoryradio");
+ QString DomMainProgram = DomUtil::readEntry(dom, "/kdevantproject/run/mainprogram");
+
+ if ( directoryRadioString == "build" )
+ return buildDirectory();
+
+ if ( directoryRadioString == "custom" )
+ return DomUtil::readEntry(dom, "/kdevantproject/run/customdirectory");
+
+ int pos = DomMainProgram.findRev('/');
+ if (pos != -1)
+ return buildDirectory() + "/" + DomMainProgram.left(pos);
+
+ return buildDirectory() + "/" + DomMainProgram;
+
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+QString AntProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevantproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+
+ return QString();
+}
+
+
+QString AntProjectPart::debugArguments() const
+{
+ return QString("");
+}
+
+/** Retuns a QString with the run command line arguments */
+QString AntProjectPart::runArguments() const
+{
+ /// \FIXME there is no kdevantproject so this will not work !
+ return DomUtil::readEntry(*projectDom(), "/kdevantproject/run/programargs");
+}
+
+
+QString AntProjectPart::activeDirectory() const
+{
+ /// \FIXME
+
+// return m_projectDirectory;
+
+ // returning m_projectDirectory is wrong, the path returned should be _relative_ to the project dir
+ // returning an empty string until antproject supports the idea of an active directory
+ return QString("");
+}
+
+
+QStringList AntProjectPart::allFiles() const
+{
+/* QStringList res;
+
+ QStringList::ConstIterator it;
+ for (it = m_sourceFiles.begin(); it != m_sourceFiles.end(); ++it)
+ {
+ QString fileName = *it;
+ if (!fileName.startsWith("/"))
+ {
+ fileName.prepend("/");
+ fileName.prepend(m_projectDirectory);
+ }
+ res += fileName;
+ }
+
+ return res;*/
+
+ // return all files relative to the project directory!
+ return m_sourceFiles;
+}
+
+
+void AntProjectPart::addFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->addFiles ( fileList );
+}
+
+void AntProjectPart::addFiles ( const QStringList& fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ m_sourceFiles.append (*it );
+ }
+
+ kdDebug() << "Emitting addedFilesToProject" << endl;
+ emit addedFilesToProject(fileList);
+}
+
+void AntProjectPart::removeFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->removeFiles ( fileList );
+}
+
+void AntProjectPart::removeFiles ( const QStringList& fileList )
+{
+ kdDebug() << "Emitting removedFilesFromProject" << endl;
+ emit removedFilesFromProject(fileList);
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ m_sourceFiles.remove ( *it );
+ }
+}
+
+void AntProjectPart::parseBuildXML()
+{
+ m_antOptions.m_targets.clear();
+ m_antOptions.m_properties.clear();
+ m_antOptions.m_defineProperties.clear();
+
+ // open build file
+ QFile bf(m_projectDirectory + "/" + m_antOptions.m_buildXML);
+ if (!bf.open(IO_ReadOnly))
+ return;
+
+ // parse build file
+ QDomDocument dom;
+ if (!dom.setContent(&bf))
+ {
+ bf.close();
+ return;
+ }
+ bf.close();
+
+ m_projectName = dom.documentElement().attribute("name", m_projectName);
+ m_antOptions.m_defaultTarget = dom.documentElement().attribute("default", "");
+
+ QDomNode node = dom.documentElement().firstChild();
+ while (!node.isNull())
+ {
+ if (node.toElement().tagName() == "target")
+ {
+ if (m_antOptions.m_defaultTarget.isEmpty())
+ m_antOptions.m_defaultTarget = node.toElement().attribute("name");
+ m_antOptions.m_targets.append(node.toElement().attribute("name"));
+ }
+ else if (node.toElement().tagName() == "property")
+ {
+ m_antOptions.m_properties.insert(node.toElement().attribute("name"), node.toElement().attribute("value"));
+ m_antOptions.m_defineProperties.insert(node.toElement().attribute("name"), false);
+ }
+
+ /// @todo Handle property files
+ /// @todo evaluate properties' values
+
+ node = node.nextSibling();
+ }
+}
+
+
+void AntProjectPart::fillMenu()
+{
+ m_buildProjectAction->setEnabled(!m_antOptions.m_defaultTarget.isEmpty());
+
+ m_targetMenu->clear();
+ int id = 0;
+ QStringList::ConstIterator it;
+ for (it = m_antOptions.m_targets.begin(); it != m_antOptions.m_targets.end(); ++it)
+ m_targetMenu->insertItem(*it, id++);
+}
+
+
+void AntProjectPart::slotBuild()
+{
+ ant(m_antOptions.m_defaultTarget);
+}
+
+
+void AntProjectPart::slotTargetMenuActivated(int id)
+{
+ ant(m_antOptions.m_targets[id]);
+}
+
+
+void AntProjectPart::ant(const QString &target)
+{
+ QString cmd = "%0 cd %1 && ant %2 -buildfile %3 %4 %5";
+
+ QString verb = "";
+ switch (m_antOptions.m_verbosity)
+ {
+ case AntOptions::Quiet:
+ verb = "-quiet";
+ break;
+ case AntOptions::Verbose:
+ verb = "-verbose";
+ break;
+ default:
+ verb = "-debug";
+ break;
+ }
+
+ QString options = "";
+ QMap<QString,QString>::Iterator it;
+ for (it = m_antOptions.m_properties.begin(); it != m_antOptions.m_properties.end(); ++it)
+ if (m_antOptions.m_defineProperties[it.key()])
+ options += "-D" + it.key() + "=\"" + it.data() + "\" ";
+
+ QString cp;
+ if (!m_classPath.count() == 0)
+ cp = "CLASSPATH="+m_classPath.join(":");
+
+ makeFrontend()->queueCommand(m_projectDirectory, cmd.arg(cp).arg(m_projectDirectory).arg(target).arg(m_antOptions.m_buildXML).arg(verb).arg(options));
+}
+
+
+void AntProjectPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Ant Options"));
+ m_antOptionsWidget = new AntOptionsWidget(vbox);
+
+ m_antOptionsWidget->BuildXML->setURL(m_antOptions.m_buildXML);
+
+ switch (m_antOptions.m_verbosity)
+ {
+ case AntOptions::Quiet:
+ m_antOptionsWidget->Verbosity->setCurrentItem(0);
+ break;
+ case AntOptions::Verbose:
+ m_antOptionsWidget->Verbosity->setCurrentItem(1);
+ break;
+ default:
+ m_antOptionsWidget->Verbosity->setCurrentItem(2);
+ break;
+ }
+
+ m_antOptionsWidget->Properties->setNumRows(m_antOptions.m_properties.count());
+ m_antOptionsWidget->Properties->setNumCols(2);
+
+ QMap<QString,QString>::Iterator it;
+ int i=0;
+ for (it = m_antOptions.m_properties.begin(); it != m_antOptions.m_properties.end(); ++it)
+ {
+ QCheckTableItem *citem = new QCheckTableItem(m_antOptionsWidget->Properties, it.key());
+ citem->setChecked(m_antOptions.m_defineProperties[it.key()]);
+ m_antOptionsWidget->Properties->setItem(i,0, citem);
+ QTableItem *item = new QTableItem(m_antOptionsWidget->Properties, QTableItem::WhenCurrent, it.data());
+ m_antOptionsWidget->Properties->setItem(i,1, item);
+ ++i;
+ }
+
+ connect(dlg, SIGNAL(okClicked()), this, SLOT(optionsAccepted()));
+
+ vbox = dlg->addVBoxPage(i18n("Classpath"));
+ m_classPathWidget = new ClassPathWidget(vbox);
+
+ m_classPathWidget->ClassPath->insertStringList(m_classPath);
+}
+
+
+void AntProjectPart::optionsAccepted()
+{
+ if (!m_antOptionsWidget || !m_classPathWidget)
+ return;
+
+ m_antOptions.m_buildXML = m_antOptionsWidget->BuildXML->url();
+
+ switch (m_antOptionsWidget->Verbosity->currentItem())
+ {
+ case 1:
+ m_antOptions.m_verbosity = AntOptions::Verbose;
+ break;
+ case 2:
+ m_antOptions.m_verbosity = AntOptions::Debug;
+ break;
+ default:
+ m_antOptions.m_verbosity = AntOptions::Quiet;
+ break;
+ }
+
+ for (int i=0; i<m_antOptionsWidget->Properties->numRows(); ++i)
+ {
+ QString key = m_antOptionsWidget->Properties->text(i,0);
+ m_antOptions.m_properties.replace(key, m_antOptionsWidget->Properties->text(i,1));
+ kdDebug() << "PROP: " << key << " = " << m_antOptionsWidget->Properties->text(i,1);
+
+ QCheckTableItem *item =(QCheckTableItem*) m_antOptionsWidget->Properties->item(i,0);
+ m_antOptions.m_defineProperties.replace(key, item->isChecked());
+ }
+
+ m_classPath = m_classPathWidget->ClassPath->items();
+
+ m_antOptionsWidget = 0;
+ m_classPathWidget = 0;
+}
+
+
+void AntProjectPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::FileContext ))
+ return;
+
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+ KURL url = fcontext->urls().first();
+ if (URLUtil::isDirectory(url))
+ return;
+
+ m_contextFileName = url.fileName();
+ bool inProject = project()->allFiles().contains(m_contextFileName.mid ( project()->projectDirectory().length() + 1 ) );
+ QString popupstr = QFileInfo(m_contextFileName).fileName();
+ if (m_contextFileName.startsWith(projectDirectory()+ "/"))
+ m_contextFileName.remove(0, projectDirectory().length()+1);
+
+ popup->insertSeparator();
+ if (inProject)
+ {
+ int id = popup->insertItem( i18n("Remove %1 From Project").arg(popupstr),
+ this, SLOT(slotRemoveFromProject()) );
+ popup->setWhatsThis(id, i18n("<b>Remove from project</b><p>Removes current file from the project."));
+ }
+ else
+ {
+ int id = popup->insertItem( i18n("Add %1 to Project").arg(popupstr),
+ this, SLOT(slotAddToProject()) );
+ popup->setWhatsThis(id, i18n("<b>Add to project</b><p>Adds current file from the project."));
+ }
+}
+
+
+void AntProjectPart::slotAddToProject()
+{
+ QStringList fileList;
+ fileList.append ( m_contextFileName );
+ addFiles ( fileList );
+}
+
+
+void AntProjectPart::slotRemoveFromProject()
+{
+ QStringList fileList;
+ fileList.append ( m_contextFileName );
+ removeFiles ( fileList );
+}
+
+
+#include "antprojectpart.moc"
+
+
+/*!
+ \fn AntProjectPart::distFiles() const
+ */
+QStringList AntProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir(projectDir);
+ QStringList files = dir.entryList( "build.xml");
+ return sourceList + files;
+}
diff --git a/buildtools/ant/antprojectpart.h b/buildtools/ant/antprojectpart.h
new file mode 100644
index 00000000..d6540c48
--- /dev/null
+++ b/buildtools/ant/antprojectpart.h
@@ -0,0 +1,117 @@
+#ifndef _ANTPROJECTPART_H_
+#define _ANTPROJECTPART_H_
+
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+
+class QPopupMenu;
+
+
+class KAction;
+class KDialogBase;
+class Context;
+class ClassPathWidget;
+
+
+#include "kdevbuildtool.h"
+
+
+class AntOptionsWidget;
+
+
+class AntOptions
+{
+public:
+
+ AntOptions();
+
+ enum Verbosity { Quiet, Verbose, Debug };
+
+ QString m_buildXML;
+ QString m_defaultTarget;
+ QStringList m_targets;
+ QMap<QString,QString> m_properties;
+ QMap<QString,bool> m_defineProperties;
+ Verbosity m_verbosity;
+
+};
+
+
+class AntProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+
+public:
+
+ AntProjectPart(QObject *parent, const char *name, const QStringList &args);
+ ~AntProjectPart();
+ QStringList distFiles() const;
+
+
+protected:
+
+ virtual void openProject(const QString &dirName, const QString &projectName);
+ virtual void closeProject();
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString mainProgram() const;
+ virtual QString activeDirectory() const;
+ virtual QStringList allFiles() const;
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString runArguments() const;
+ virtual QString debugArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+
+ virtual void addFile(const QString &fileName);
+ virtual void addFiles ( const QStringList &fileList );
+ virtual void removeFile(const QString &fileName);
+ virtual void removeFiles ( const QStringList& fileList );
+
+
+private slots:
+
+ void slotBuild();
+ void slotTargetMenuActivated(int id);
+
+ void projectConfigWidget(KDialogBase *dlg);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+ void optionsAccepted();
+
+ void slotAddToProject();
+ void slotRemoveFromProject();
+
+
+private:
+
+ void parseBuildXML();
+ void fillMenu();
+ void populateProject();
+
+ void ant(const QString &target);
+
+ QString m_projectDirectory, m_projectName;
+ QStringList m_classPath;
+
+ QStringList m_sourceFiles;
+
+ AntOptions m_antOptions;
+
+ KAction *m_buildProjectAction;
+
+ QPopupMenu *m_targetMenu;
+
+ AntOptionsWidget *m_antOptionsWidget;
+ ClassPathWidget *m_classPathWidget;
+
+ QString m_contextFileName;
+
+};
+
+
+#endif
diff --git a/buildtools/ant/classpathwidget.ui b/buildtools/ant/classpathwidget.ui
new file mode 100644
index 00000000..8bfde971
--- /dev/null
+++ b/buildtools/ant/classpathwidget.ui
@@ -0,0 +1,39 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ClassPathWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ClassPathWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>471</width>
+ <height>288</height>
+ </rect>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KEditListBox">
+ <property name="name">
+ <cstring>ClassPath</cstring>
+ </property>
+ <property name="title">
+ <string>Class&amp;path</string>
+ </property>
+ </widget>
+ </hbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">keditlistbox.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/ant/kdevantproject.desktop b/buildtools/ant/kdevantproject.desktop
new file mode 100644
index 00000000..231339ea
--- /dev/null
+++ b/buildtools/ant/kdevantproject.desktop
@@ -0,0 +1,96 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Ant Project
+Comment[br]=Raktres Ant
+Comment[ca]=Projecte Ant
+Comment[cs]=Ant projekt
+Comment[da]=Ant-projekt
+Comment[de]=Ant-Projekt für KDevelop
+Comment[el]=Έργο Ant
+Comment[es]=Proyecto Ant
+Comment[et]=Ant projekt
+Comment[eu]=Ant proiektua
+Comment[fa]=پروژۀ Ant
+Comment[fr]=Projet avec Ant
+Comment[ga]=Comhad tionscadail Ant
+Comment[gl]=Proxecto Ant
+Comment[hi]=एएनटी परियोजना
+Comment[hu]=Ant-projekt
+Comment[is]=Ant verkefni
+Comment[it]=Progetto Ant
+Comment[ja]=Ant プロジェクト
+Comment[ms]=Projek Ant
+Comment[nds]=Ant-Projekt
+Comment[ne]=एन्ट परियोजना
+Comment[nl]=Ant-project
+Comment[pa]=Ant ਪ੍ਰੋਜੈਕਟ
+Comment[pl]=Projekt: Ant
+Comment[pt]=Projecto Ant
+Comment[pt_BR]=Projeto Ant
+Comment[ru]=Проект Ant
+Comment[sk]=Ant projekt
+Comment[sl]=Projekt Ant
+Comment[sr]=Ant пројекат
+Comment[sr@Latn]=Ant projekat
+Comment[sv]=Ant-projekt
+Comment[ta]=ஆன்ட்பிராஜக்ட்
+Comment[tg]=Лоиҳаи Ant
+Comment[tr]=Ant Projesi
+Comment[uz]=Ant loyihasi
+Comment[uz@cyrillic]=Ant лойиҳаси
+Comment[zh_CN]=Ant 工程
+Comment[zh_TW]=Ant 專案
+Name=KDevAntProject
+Name[da]=KDevelop Ant-projekt
+Name[de]=Ant-Projekt (KDevelop)
+Name[hi]=के-डेव-एएनटी-परियोजना
+Name[nds]=Ant-Projekt (KDevelop)
+Name[ne]=केडीई विकास एन्ट परियोजना
+Name[pl]=KDevProjektAnt
+Name[sk]=KDevAntProjekt
+Name[sv]=KDevelop Ant-projekt
+Name[ta]=கெடெவ்ஆன்ட் பிராஜக்ட்
+Name[tg]=Лоиҳаи KDevAnt
+Name[zh_TW]=KDevelop Ant 專案
+GenericName=Ant Project
+GenericName[br]=Raktres Ant
+GenericName[ca]=Projecte Ant
+GenericName[da]=Ant-projekt
+GenericName[de]=Ant-Projekt
+GenericName[el]=Έργο Ant
+GenericName[es]=Proyecto Ant
+GenericName[et]=Ant projekt
+GenericName[eu]=Ant proiektua
+GenericName[fa]=پروژۀ Ant
+GenericName[fr]=Projet avec Ant
+GenericName[ga]=Comhad tionscadail Ant
+GenericName[gl]=Proxecto Ant
+GenericName[hi]=एएनटी परियोजना
+GenericName[hu]=Ant-projekt
+GenericName[it]=Project con Ant
+GenericName[ja]=Ant プロジェクト
+GenericName[ms]=Projek Ant
+GenericName[nds]=Ant-Projekt
+GenericName[ne]=एन्ट परियोजना
+GenericName[nl]=Ant-project
+GenericName[pl]=Projekt: Ant
+GenericName[pt]=Projecto Ant
+GenericName[pt_BR]=Projeto Ant
+GenericName[ru]=Проект Ant
+GenericName[sk]=Ant projekt
+GenericName[sl]=Projekt Ant
+GenericName[sr]=Ant пројекат
+GenericName[sr@Latn]=Ant projekat
+GenericName[sv]=Ant-projekt
+GenericName[ta]=ஆன்ட்பிராஜக்ட்
+GenericName[tg]=Лоиҳаи Ant
+GenericName[tr]=Ant Projesi
+GenericName[uz]=Ant loyihasi
+GenericName[uz@cyrillic]=Ant лойиҳаси
+GenericName[zh_CN]=Ant 工程
+GenericName[zh_TW]=Ant 專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevantproject
+X-KDevelop-Version=5
+X-KDevelop-Args=
diff --git a/buildtools/ant/kdevantproject.rc b/buildtools/ant/kdevantproject.rc
new file mode 100644
index 00000000..df892b3c
--- /dev/null
+++ b/buildtools/ant/kdevantproject.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevAntProject" version="2">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_build" />
+<!-- <Action name="build_compilefile" /> -->
+ <Action name="build_target" />
+<!-- <Action name="build_clean" />
+ <Separator/>
+ <Action name="build_execute" /> -->
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/buildtools/autotools/Makefile.am b/buildtools/autotools/Makefile.am
new file mode 100644
index 00000000..5972b662
--- /dev/null
+++ b/buildtools/autotools/Makefile.am
@@ -0,0 +1,38 @@
+# Here resides the automake project part.
+
+INCLUDES = -I$(top_srcdir)/buildtools/lib -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/parsers/autotools -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util $(all_includes) \
+ -I$(top_builddir)/buildtools/lib/widgets
+
+
+kde_module_LTLIBRARIES = libkdevautoproject.la
+libkdevautoproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevautoproject_la_LIBADD = \
+ $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la \
+ $(top_builddir)/buildtools/lib/parsers/autotools/libkdevautotoolsparser.la $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la \
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(top_builddir)/lib/libkdevelop.la
+
+libkdevautoproject_la_SOURCES = autoprojectpart.cpp autoprojectwidget.cpp \
+ configureoptionswidget.cpp configureoptionswidgetbase.ui subprojectoptionsdlg.cpp \
+ subprojectoptionsdlgbase.ui targetoptionsdlg.cpp targetoptionsdlgbase.ui addservicedlg.cpp \
+ addservicedlgbase.ui addapplicationdlg.cpp addapplicationdlgbase.ui addtargetdlg.cpp \
+ addtargetdlgbase.ui addsubprojectdlg.cpp addfiledlgbase.ui addfiledlg.cpp \
+ removefiledlgbase.ui removefiledlg.cpp addicondlgbase.ui addicondlg.cpp \
+ addtranslationdlg.cpp addprefixdlg.cpp kfilednddetailview.cpp kfiledndiconview.cpp \
+ fileselectorwidget.cpp misc.cpp addsubprojectdlgbase.ui removetargetdlg.cpp \
+ removetargetdlgbase.ui choosetargetdialog.cpp choosetargetdlgbase.ui addexistingdlgbase.ui \
+ addexistingfilesdlg.cpp addexistingdirectoriesdlg.cpp kimporticonview.cpp \
+ autosubprojectview.cpp autodetailsview.cpp autolistviewitems.cpp managecustomcommandsbase.ui \
+ managecustomcommand.cpp autoprojectviewbase.ui autotoolsaction.cpp makefilehandler.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevautoproject.desktop kdevkdeautoproject.desktop
+
+rcdir = $(kde_datadir)/kdevautoproject
+rc_DATA = kdevautoproject.rc
+
+noinst_HEADERS = managecustomcommand.h autotoolsaction.h makefilehandler.h
diff --git a/buildtools/autotools/README b/buildtools/autotools/README
new file mode 100644
index 00000000..487cec41
--- /dev/null
+++ b/buildtools/autotools/README
@@ -0,0 +1 @@
+Please read the README.dox file
diff --git a/buildtools/autotools/README.dox b/buildtools/autotools/README.dox
new file mode 100644
index 00000000..acad3e64
--- /dev/null
+++ b/buildtools/autotools/README.dox
@@ -0,0 +1,39 @@
+/** \class AutoProjectPart
+Autoprojectpart is a projectmanager for Automake based projects.
+
+Loads and maintains Makefile.am files.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:victor_roeder AT gmx.de">Victor Rder</a>
+\maintainer <a href="mailto:a.lucas AT tu-bs.de">Amilcar do Carmo Lucas</a>
+
+\feature supports creating subprojects, targets, services (.desktop) and applications (.desktop).
+\feature Automake projects can be configured on subprojects, targets (except DATA and HEADER targets).
+\feature It will regenerate the projects Makefile.am files dynamically as you add or
+reconfigure subprojects**.
+\feature Unsupported automake features will be left unchanged
+(hopefully), no major testing has been run yet (at least not by myself).
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=autoproject&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number"> autoproject component at Bugzilla database</a>
+\bug Lower Automake Manager view does not update it's view when adding a subproject (and targets, etc to the new subproject)
+\bug If removing the Active Target, update the .kdevelop file, too!
+
+
+\note
+If you want to change the default implemention for running/starting the binary
+please add the following to your project file
+\verbatim
+<kdevautoproject>
+ <run>
+ <disable_default>true</disable_default>
+ </run>
+</kdevautoproject>
+\endverbatim
+with this configuration the "Automake Manager" doesn't insert the menuentry "execute program"
+and doesn't show the "Run Options" in the project configuration.<br>
+Now you can implement this features with your own special plugin.
+For an example please look at the projects generated for GBA using the VisualBoy Advance Plugin.
+This plugin starts a GBA binary with an emulator. -- <a href="mailto:smeier AT kdevelop.org">Sandy Meier</a>
+
+*/
diff --git a/buildtools/autotools/addapplicationdlg.cpp b/buildtools/autotools/addapplicationdlg.cpp
new file mode 100644
index 00000000..04e132dd
--- /dev/null
+++ b/buildtools/autotools/addapplicationdlg.cpp
@@ -0,0 +1,207 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addapplicationdlg.h"
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qfile.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qtextstream.h>
+#include <qapplication.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <kicondialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kmimetype.h>
+
+#include "autolistviewitems.h"
+
+#include "misc.h"
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+
+
+AddApplicationDialog::AddApplicationDialog(AutoProjectWidget *widget, SubprojectItem *spitem,
+ QWidget *parent, const char *name)
+ : AddApplicationDialogBase(parent, name, true)
+{
+ filename_edit->setText(".desktop");
+ filename_edit->home(false);
+ filename_edit->setFocus();
+ chosentypes_listview->header()->hide();
+ availtypes_listview->header()->hide();
+ QString addApplication = add_button->text();
+ QString removeApplication = remove_button->text();
+
+ add_button->setText( QApplication::reverseLayout() ? removeApplication : addApplication );
+ remove_button->setText( QApplication::reverseLayout() ? addApplication : removeApplication );
+
+ m_widget = widget;
+ subProject = spitem;
+
+ // Fill the combo box with program names in the directory
+ QPtrListIterator<TargetItem> tit(spitem->targets);
+ for (; tit.current(); ++tit) {
+ if ((*tit)->primary == "PROGRAMS")
+ executable_combo->insertItem(QString((*tit)->name));
+ }
+
+ // Fill the list of available mime types
+ KMimeType::List l = KMimeType::allMimeTypes();
+ KMimeType::List::Iterator it;
+ for (it = l.begin(); it != l.end(); ++it)
+ new QListViewItem(availtypes_listview, (*it)->name());
+
+ setIcon ( SmallIcon ( "window_new" ) );
+}
+
+
+AddApplicationDialog::~AddApplicationDialog()
+{}
+
+
+void AddApplicationDialog::iconClicked()
+{
+ KIconLoader *loader = AutoProjectFactory::instance()->iconLoader();
+ QString name = KIconDialog::getIcon(KIcon::Desktop);
+ if (!name.isNull()) {
+ iconName = name;
+ icon_button->setPixmap(loader->loadIcon(name, KIcon::Desktop));
+ }
+}
+
+
+void AddApplicationDialog::addTypeClicked()
+{
+ QListViewItem *selitem = availtypes_listview->selectedItem();
+ if (!selitem)
+ return;
+
+ QListViewItem *olditem = chosentypes_listview->firstChild();
+ while (olditem) {
+ if (selitem->text(0) == olditem->text(0))
+ return;
+ olditem = olditem->nextSibling();
+ }
+ new QListViewItem(chosentypes_listview, selitem->text(0));
+}
+
+
+void AddApplicationDialog::removeTypeClicked()
+{
+ delete chosentypes_listview->currentItem();
+}
+
+
+void AddApplicationDialog::accept()
+{
+ // Create list of mime types
+ QStringList mimeTypes;
+ QListViewItem *item = chosentypes_listview->firstChild();
+ while (item) {
+ mimeTypes.append(item->text(0));
+ item = item->nextSibling();
+ }
+
+ // Some plausibility tests
+ QString fileName = filename_edit->text();
+ if (fileName.isEmpty() || fileName == ".desktop") {
+ KMessageBox::sorry(this, i18n("You have to enter a file name."));
+ filename_edit->setFocus();
+ return;
+ }
+
+ QString executable = executable_combo->currentText();
+ if (executable.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to enter the file name of an executable program."));
+ executable_combo->setFocus();
+ return;
+ }
+
+ QString name = name_edit->text();
+ if (name.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to enter an application name."));
+ name_edit->setFocus();
+ return;
+ }
+
+ QFile f(subProject->path + "/" + fileName);
+ if (f.exists()) {
+ KMessageBox::sorry(this, i18n("A file with this name exists already."));
+ filename_edit->setFocus();
+ return;
+ }
+ if (!f.open(IO_WriteOnly)) {
+ KMessageBox::sorry(this, i18n("Could not open file for writing."));
+ return;
+ }
+
+ QTextStream stream(&f);
+ stream << "[Desktop Entry]" << endl;
+ stream << "Type=Application" << endl;
+ stream << "Name=" << name << endl;
+ stream << "Exec=" << (executable + " -caption \"%c\" %i %m %u") << endl;
+ stream << "Comment=" << comment_edit->text() << endl;
+ if (!iconName.isNull())
+ stream << "Icon=" << iconName << endl;
+ stream << "MimeTypes=" << mimeTypes.join(";") << endl;
+ stream << "Terminal=" << (terminal_box->isChecked()? "true" : "false") << endl;
+ f.close();
+
+ // Find a prefix that points to the applnk directory.
+ // If there is none, use appslnksection
+ QString section = section_combo->currentText();
+ QString appsdir = "$(kde_appsdir)/" + section;
+ QMap<QString,QString>::ConstIterator it;
+ for (it = subProject->prefixes.begin(); it != subProject->prefixes.end(); ++it)
+ if (it.data() == appsdir)
+ break;
+
+ QMap<QString, QString> replaceMap;
+ QString prefix;
+ if (it == subProject->prefixes.end()) {
+ prefix = "applnk" + section;
+ replaceMap.insert(prefix + "dir", appsdir);
+ subProject->prefixes.insert(prefix, appsdir);
+ } else {
+ prefix = it.key();
+ }
+ QString varname = prefix + "_DATA";
+
+ // Look if a list view item for this prefix exists already.
+ // Create a new one otherwise
+ TargetItem *titem = 0;
+ for (uint i=0; i < subProject->targets.count(); ++i) {
+ TargetItem *tmptitem = subProject->targets.at(i);
+ if ("DATA" == tmptitem->primary && prefix == tmptitem->prefix) {
+ titem = tmptitem;
+ break;
+ }
+ }
+ if (!titem) {
+ titem = m_widget->createTargetItem("", prefix, "DATA", false);
+ subProject->targets.append(titem);
+ }
+ // Add this file to the target
+ FileItem *fitem = m_widget->createFileItem(fileName, subProject);
+ titem->sources.append(fitem);
+
+ subProject->variables[varname] += (" " + fileName);
+ replaceMap.insert(varname, subProject->variables[varname]);
+ AutoProjectTool::addToMakefileam(subProject->path + "/Makefile.am", replaceMap);
+
+ QDialog::accept();
+}
+
+#include "addapplicationdlg.moc"
diff --git a/buildtools/autotools/addapplicationdlg.h b/buildtools/autotools/addapplicationdlg.h
new file mode 100644
index 00000000..d9f8e6fc
--- /dev/null
+++ b/buildtools/autotools/addapplicationdlg.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDAPPLICATIONDLG_H_
+#define _ADDAPPLICATIONDLG_H_
+
+#include "addapplicationdlgbase.h"
+
+class AutoProjectWidget;
+class SubprojectItem;
+class TargetItem;
+
+
+class AddApplicationDialog : public AddApplicationDialogBase
+{
+ Q_OBJECT
+
+public:
+ AddApplicationDialog( AutoProjectWidget *widget, SubprojectItem *spitem,
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddApplicationDialog();
+
+protected:
+ virtual void iconClicked();
+ virtual void addTypeClicked();
+ virtual void removeTypeClicked();
+ virtual void accept();
+
+private:
+ AutoProjectWidget *m_widget;
+ SubprojectItem *subProject;
+ QString iconName;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/addapplicationdlgbase.ui b/buildtools/autotools/addapplicationdlgbase.ui
new file mode 100644
index 00000000..5e6def81
--- /dev/null
+++ b/buildtools/autotools/addapplicationdlgbase.ui
@@ -0,0 +1,552 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddApplicationDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>add_application_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>586</width>
+ <height>425</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add New Application .desktop File</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox7</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Application File</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>terminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>Start in t&amp;erminal</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>comment_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="3">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>icon_button</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QComboBox" row="0" column="3">
+ <property name="name">
+ <cstring>executable_combo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>Application</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Games</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Development</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Editors</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Graphics</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Internet</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Multimedia</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Office</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>System</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Toys</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Utilities</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>WordProcessing</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>section_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>name_label_2</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>E&amp;xecutable:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>executable_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>icon_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Icon:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>icon_button</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>section_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Section:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>section_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>filename_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;File name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>name_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>comment_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Co&amp;mment:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comment_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox6</cstring>
+ </property>
+ <property name="title">
+ <string>Mime &amp;Types</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>chosentypes_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>add_button</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;-</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>remove_button</cstring>
+ </property>
+ <property name="text">
+ <string>-&gt;</string>
+ </property>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>availtypes_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_application_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_application_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>icon_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_application_dialog</receiver>
+ <slot>iconClicked()</slot>
+ </connection>
+ <connection>
+ <sender>add_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_application_dialog</receiver>
+ <slot>addTypeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>remove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_application_dialog</receiver>
+ <slot>removeTypeClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>filename_edit</tabstop>
+ <tabstop>executable_combo</tabstop>
+ <tabstop>name_edit</tabstop>
+ <tabstop>icon_button</tabstop>
+ <tabstop>terminal_box</tabstop>
+ <tabstop>section_combo</tabstop>
+ <tabstop>comment_edit</tabstop>
+ <tabstop>chosentypes_listview</tabstop>
+ <tabstop>add_button</tabstop>
+ <tabstop>remove_button</tabstop>
+ <tabstop>availtypes_listview</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">addTypeClicked()</slot>
+ <slot access="protected">iconClicked()</slot>
+ <slot access="protected">removeTypeClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/autotools/addexistingdirectoriesdlg.cpp b/buildtools/autotools/addexistingdirectoriesdlg.cpp
new file mode 100644
index 00000000..625d6af1
--- /dev/null
+++ b/buildtools/autotools/addexistingdirectoriesdlg.cpp
@@ -0,0 +1,388 @@
+/***************************************************************************
+ -------------------
+ begin : 12/21/2002
+ copyright : (C) 2002 by Victor R�er
+ email : victor_roeder@gmx.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 <qgroupbox.h>
+#include <qlayout.h>
+
+#include <kprogress.h>
+#include <klocale.h>
+#include <kio/netaccess.h>
+#include <kprocess.h>
+
+#include "autolistviewitems.h"
+#include "autosubprojectview.h"
+
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+
+#include "kimporticonview.h"
+
+#include "urlutil.h"
+
+#include "addexistingdirectoriesdlg.h"
+
+AddExistingDirectoriesDialog::AddExistingDirectoriesDialog ( AutoProjectPart* part, AutoProjectWidget *widget, SubprojectItem* spitem, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : AddExistingDlgBase ( parent, name, modal, fl )
+{
+ setIcon ( SmallIcon ( "fileimport.png" ) );
+
+ m_spitem = spitem;
+
+ m_part = part;
+ m_widget = widget;
+
+ KFile::Mode mode = KFile::Directory;
+
+// if ( spitem && spitem->type() == ProjectItem::Subproject )
+// {
+// destStaticLabel->setText ( i18n ( "Subproject:" ) );
+// destLabel->setText ( spitem->subdir );
+// targetLabel->setText ( i18n ( "none" ) );
+// directoryLabel->setText ( i18n ( spitem->path ) );
+// }
+
+ sourceSelector = new FileSelectorWidget ( part, mode, sourceGroupBox, "source file selector" );
+ sourceGroupBoxLayout->addWidget ( sourceSelector );
+
+ importView = new KImportIconView ( i18n("Drag one or more directories with an existing Makefile.am from the left view and drop it here."), destGroupBox, "destination icon view" );
+ destGroupBoxLayout->addWidget ( importView );
+
+ setIcon ( SmallIcon ( "fileimport.png" ) );
+
+ QWidget::setTabOrder(sourceSelector, addAllButton);
+ QWidget::setTabOrder(addAllButton, addSelectedButton);
+ QWidget::setTabOrder(addSelectedButton, importView);
+ QWidget::setTabOrder(importView, removeAllButton);
+ QWidget::setTabOrder(removeAllButton, removeSelectedButton);
+ QWidget::setTabOrder(removeSelectedButton, okButton);
+ QWidget::setTabOrder(okButton, cancelButton);
+
+ sourceSelector->setFocus();
+
+ init();
+}
+
+
+AddExistingDirectoriesDialog::~AddExistingDirectoriesDialog()
+{
+}
+
+void AddExistingDirectoriesDialog::init()
+{
+ progressBar->hide();
+
+ importView->setMode ( KIconView::Select );
+ importView->setItemsMovable ( false );
+
+ connect ( okButton, SIGNAL ( clicked () ), this, SLOT ( slotOk () ) );
+
+ connect ( addSelectedButton, SIGNAL ( clicked () ), this, SLOT ( slotAddSelected() ) );
+ connect ( addAllButton, SIGNAL ( clicked () ), this, SLOT ( slotAddAll() ) );
+ connect ( removeSelectedButton, SIGNAL ( clicked () ), this, SLOT ( slotRemoveSelected() ) );
+ connect ( removeAllButton, SIGNAL ( clicked () ), this, SLOT ( slotRemoveAll() ) );
+
+ connect ( importView, SIGNAL ( dropped( QDropEvent* ) ), this, SLOT ( slotDropped ( QDropEvent* ) ) );
+
+ importView->setSelectionMode ( KFile::Multi );
+
+ sourceSelector->setDir ( m_spitem->path );
+}
+
+void AddExistingDirectoriesDialog::importItems()
+{
+ if( !importView->items() )
+ return;
+
+ // items added via button or drag 'n drop
+ KFileItemListIterator itemList ( m_importList );
+
+ // items already added to the importView
+ KFileItemListIterator importedList ( *importView->items() );
+
+ QStringList duplicateList;
+
+ importedList.toFirst();
+
+ for ( ; importedList.current(); ++importedList )
+ {
+ itemList.toFirst();
+
+ for ( ; itemList.current(); ++itemList )
+ {
+ if ( ( *importedList )->name() == ( *itemList )->name() )
+ {
+ m_importList.remove ( ( *itemList ) );
+
+ // to avoid that a item is added twice
+ if ( !duplicateList.remove ( ( *importedList )->name() ) )
+ {
+ duplicateList.append ( ( *importedList )->name() );
+ }
+ }
+ }
+ }
+
+ itemList.toFirst();
+
+ for ( ; itemList.current(); ++itemList )
+ {
+ KURL amURL = itemList.current()->url();
+ amURL.addPath("Makefile.am");
+ if (KIO::NetAccess::exists(amURL))
+ {
+ importView->insertItem ( ( *itemList ) );
+ }
+ }
+
+ importView->somethingDropped ( true );
+
+ m_importList.clear();
+
+ importView->update ();
+}
+
+void AddExistingDirectoriesDialog::slotOk()
+{
+ if ( importView->items()->count() == 0 ) QDialog::reject();
+
+ KFileItemListIterator items ( *importView->items() );
+
+ QStringList dirs;
+
+ for ( ; items.current(); ++items )
+ {
+ //if the directory is outside the project directory
+// kdDebug( 9020 ) << "dir to add " << items.current()->url().path() << " subproject " << m_spitem->path << endl;
+ if (items.current()->url().path() != m_spitem->path)
+ {
+ //copy
+ //FIXME: check this after 3.0 release and add a possibility to link, not just copy
+ KProcess proc;
+
+ proc << "cp";
+ proc << "-r";
+ proc << items.current()->url().path();
+ proc << m_spitem->path;
+ proc.start(KProcess::Block);
+ }
+ dirs << items.current()->name();
+ }
+
+ for (QStringList::const_iterator it = dirs.begin(); it != dirs.end(); ++it)
+ {
+ QString name = *it;
+
+ // Adjust SUBDIRS variable in containing Makefile.am
+ if (m_spitem->variables["SUBDIRS"].find("$(TOPSUBDIRS)") != -1)
+ {
+ QFile subdirsfile( m_spitem->path + "/subdirs" );
+ if ( subdirsfile.open( IO_WriteOnly | IO_Append ) )
+ {
+ QTextStream subdirsstream( &subdirsfile );
+ subdirsstream << name << endl;
+ subdirsfile.close();
+ }
+ }
+ else if (m_spitem->variables["SUBDIRS"].find("$(AUTODIRS)") != -1)
+ {
+ }
+ else
+ {
+ m_spitem->variables["SUBDIRS"] += (" " + name);
+ QMap<QString,QString> replaceMap;
+ replaceMap.insert("SUBDIRS", m_spitem->variables["SUBDIRS"]);
+ AutoProjectTool::addToMakefileam(m_spitem->path + "/Makefile.am", replaceMap);
+ }
+
+ // Create new item in tree view
+ SubprojectItem *newitem = new SubprojectItem(m_spitem, name);
+ newitem->subdir = name;
+ newitem->path = m_spitem->path + "/" + name;
+ newitem->variables["INCLUDES"] = m_spitem->variables["INCLUDES"];
+ newitem->setOpen(true);
+
+ // Move to the bottom of the list
+ QListViewItem *lastItem = m_spitem->firstChild();
+ while (lastItem->nextSibling())
+ lastItem = lastItem->nextSibling();
+ if (lastItem != newitem)
+ newitem->moveItem(lastItem);
+
+ // Create a Makefile in the new subdirectory
+
+ QDir dir( m_spitem->path + "/" + name );
+ QFile f( dir.filePath("Makefile.am") );
+ if (f.exists()) {
+ m_widget->getSubprojectView()->parse( newitem );
+ } else {
+ if (!f.open(IO_WriteOnly)) {
+// KMessageBox::sorry(this, i18n("Could not create Makefile.am in subdirectory %1.").arg(name));
+ continue;
+ }
+ QTextStream stream(&f);
+ stream << "INCLUDES = " << newitem->variables["INCLUDES"] << endl << "METASOURCES = AUTO" << endl;
+ f.close();
+ }
+
+
+
+ // if !isKDE: add the new sub-proj to configure.in or configure.ac
+ if ( !m_part->isKDE() ) {
+ QString projroot = m_part->projectDirectory() + "/";
+ QString subdirectory = dir.path();
+ QString relpath = subdirectory.replace(0, projroot.length(),"");
+
+ QString configureFile = m_part->getAutoConfFile(projroot);
+
+ QStringList list = AutoProjectTool::configureinLoadMakefiles(configureFile);
+ if ( !list.isEmpty() )
+ {
+ list.push_back( relpath + "/Makefile" );
+ AutoProjectTool::configureinSaveMakefiles(configureFile, list);
+ }
+ }
+
+ m_part->needMakefileCvs();
+
+ }
+ QDialog::accept();
+}
+
+void AddExistingDirectoriesDialog::slotAddSelected()
+{
+ KFileItemListIterator it ( *sourceSelector->dirOperator()->selectedItems() );
+
+ for ( ; it.current(); ++it )
+ {
+ QString relPath = URLUtil::extractPathNameRelative(m_part->projectDirectory(), ( *it )->url());
+ if (relPath[relPath.length()-1] == '/')
+ relPath = relPath.left(relPath.length()-1);
+ if ( (relPath.isEmpty()) || (! m_widget->allSubprojects().contains( relPath )) )
+ {
+ m_importList.append ( ( *it ) );
+ }
+ }
+
+ importItems();
+}
+
+void AddExistingDirectoriesDialog::slotAddAll()
+{
+ KFileItemListIterator it ( *sourceSelector->dirOperator()->view()->items() );
+
+ for ( ; it.current(); ++it )
+ {
+ QString relPath = URLUtil::extractPathNameRelative(m_part->projectDirectory(), ( *it )->url());
+ if (relPath[relPath.length()-1] == '/')
+ relPath = relPath.left(relPath.length()-1);
+ if ( (relPath.isEmpty()) || ( ! m_widget->allSubprojects().contains( relPath )) )
+ {
+ m_importList.append ( ( *it ) );
+ }
+ }
+
+ importItems();
+}
+
+void AddExistingDirectoriesDialog::slotRemoveAll()
+{
+ KURL::List deletedFiles;
+ KFileItemListIterator it ( *importView->items() );
+
+ for ( ; it.current(); ++it )
+ {
+ kdDebug ( 9020 ) << "AddExistingDirectoriesDialog::slotRemoveAll()" << endl;
+ //deletedFiles.append ( ( *it )->url() );
+ if ( (*it ) ) importView->removeItem ( *it );
+ }
+
+ importView->somethingDropped ( false );
+
+ importView->viewport()->update();
+}
+
+void AddExistingDirectoriesDialog::slotRemoveSelected()
+{
+ KFileItemListIterator items ( *importView->items() );
+
+ KFileItemList* selectedList = (KFileItemList*) importView->selectedItems();
+
+ KFileItem * deleteItem = 0L;
+
+ for ( ; items.current(); ++items )
+ {
+ deleteItem = selectedList->first();
+
+ while ( deleteItem )
+ {
+ if ( deleteItem == ( *items ) )
+ {
+ importView->removeItem ( deleteItem );
+ deleteItem = selectedList->current();
+ }
+ else
+ {
+ deleteItem = selectedList->next();
+ }
+ }
+ }
+
+ if ( importView->items()->count() == 0 ) importView->somethingDropped ( false );
+
+ importView->viewport()->update();
+}
+
+void AddExistingDirectoriesDialog::slotDropped ( QDropEvent* ev )
+{
+ kdDebug ( 9020 ) << "AddExistingDirectoriesDialog::dropped()" << endl;
+
+ KURL::List urls;
+
+ KURLDrag::decode( ev, urls );
+
+ KFileItem* item = 0L;
+ KMimeType::Ptr type = 0L;
+
+
+ for ( KURL::List::Iterator it = urls.begin(); it != urls.end(); ++it )
+ {
+ //check if this subproject is already in project
+ QString relPath = URLUtil::extractPathNameRelative(m_part->projectDirectory(), *it);
+ if (relPath[relPath.length()-1] == '/')
+ relPath = relPath.left(relPath.length()-1);
+ if ( (relPath.isEmpty()) || ( ! m_widget->allSubprojects().contains( relPath )) )
+ {
+ type = KMimeType::findByURL ( ( *it ) );
+
+ if ( type->name() != KMimeType::defaultMimeType() )
+ {
+ item = new KFileItem ( ( *it ) , type->name(), 0 );
+ }
+ else
+ {
+ item = new KFileItem ( ( *it ), "inode/directory", 0 );
+ }
+
+ m_importList.append ( item );
+ }
+ }
+
+ importItems();
+}
+
+#include "addexistingdirectoriesdlg.moc"
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/buildtools/autotools/addexistingdirectoriesdlg.h b/buildtools/autotools/addexistingdirectoriesdlg.h
new file mode 100644
index 00000000..c4dd048e
--- /dev/null
+++ b/buildtools/autotools/addexistingdirectoriesdlg.h
@@ -0,0 +1,74 @@
+/***************************************************************************
+ -------------------
+ begin : 12/21/2002
+ copyright : (C) 2002 by Victor R�er
+ email : victor_roeder@gmx.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 _ADDEXISTINGDIRECTORIESDLG_H_
+#define _ADDEXISTINGDIRECTORIESDLG_H_
+
+#include "addexistingdlgbase.h"
+
+#include <qdialog.h>
+#include <kfile.h>
+
+#include "misc.h"
+#include "fileselectorwidget.h"
+
+class FileSelectorWidget;
+class AutoProjectWidget;
+class AutoProjectPart;
+class SubprojectItem;
+class TargetItem;
+class KFileItem;
+class KImportIconView;
+
+class AddExistingDirectoriesDialog : public AddExistingDlgBase
+{
+ Q_OBJECT
+
+public:
+ AddExistingDirectoriesDialog ( AutoProjectPart* part, AutoProjectWidget *widget,
+ SubprojectItem* spitem, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~AddExistingDirectoriesDialog();
+
+private:
+ FileSelectorWidget* sourceSelector;
+ KImportIconView* importView;
+
+ AutoProjectPart* m_part;
+ AutoProjectWidget* m_widget;
+
+ TargetItem* m_titem;
+ SubprojectItem* m_spitem;
+
+ KFileItemList m_importList;
+
+protected:
+ void init();
+ void importItems ();
+
+protected slots:
+ void slotAddSelected();
+ void slotAddAll();
+ void slotRemoveAll();
+ void slotRemoveSelected();
+ void slotDropped ( QDropEvent* ev );
+
+ void slotOk();
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/addexistingdlgbase.ui b/buildtools/autotools/addexistingdlgbase.ui
new file mode 100644
index 00000000..cf73ee21
--- /dev/null
+++ b/buildtools/autotools/addexistingdlgbase.ui
@@ -0,0 +1,459 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AddExistingDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddExistingDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>592</width>
+ <height>445</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>ImportExistingDlgBase</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>317</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KProgress" row="2" column="0">
+ <property name="name">
+ <cstring>progressBar</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>infoGroupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Subproject Information</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>infoLayout1</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>directoryStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>targetStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>infoLayout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KSqueezedTextLabel">
+ <property name="name">
+ <cstring>directoryLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>[DIRECTORY]</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>targetLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[TARGET]</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QSplitter" row="1" column="0">
+ <property name="name">
+ <cstring>splitter2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>arrowSpacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>84</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addAllButton</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;dd All</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Import by creating symbolic links (recommended)</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addSelectedButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Selected</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Import by copying (not recommended)</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>arrowSpacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>84</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>sourceGroupBox</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>240</width>
+ <height>250</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>&amp;Source Directory</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>arrowSpacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeAllButton</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;emove All</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Removes all added files.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeSelectedButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove Selected</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Removes the selected files.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>arrowSpacer2_2</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>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>destGroupBox</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Add &amp;Following</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddExistingDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>addAllButton</tabstop>
+ <tabstop>addSelectedButton</tabstop>
+ <tabstop>removeAllButton</tabstop>
+ <tabstop>removeSelectedButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">ksqueezedtextlabel.h</include>
+ <include location="global" impldecl="in implementation">kprogress.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kprogress.h</includehint>
+ <includehint>ksqueezedtextlabel.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/addexistingfilesdlg.cpp b/buildtools/autotools/addexistingfilesdlg.cpp
new file mode 100644
index 00000000..00f3e61b
--- /dev/null
+++ b/buildtools/autotools/addexistingfilesdlg.cpp
@@ -0,0 +1,451 @@
+/***************************************************************************
+ -------------------
+ begin : Frag' mich was leichteres
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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. *
+ * *
+ ***************************************************************************/
+
+/** Here resides the Import-existing-files-dialog of the Automake Manager (a KDevelop build tool part) **/
+
+#include <qapplication.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+//#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qpixmap.h>
+
+#include <kdebug.h>
+#include <kfileview.h>
+#include <kguiitem.h>
+#include <kprogress.h>
+#include <kprocess.h>
+#include <kurldrag.h>
+#include <kmessagebox.h>
+#include <kmimetype.h>
+#include <kiconview.h>
+#include <ksqueezedtextlabel.h>
+
+#include "urlutil.h"
+
+#include "autolistviewitems.h"
+
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+
+#include "kimporticonview.h"
+
+#include "addexistingfilesdlg.h"
+
+/*
+ * Constructs a AddExistingFilesDialog which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+
+AddExistingFilesDialog::AddExistingFilesDialog ( AutoProjectPart* part, AutoProjectWidget *widget, SubprojectItem* spitem, TargetItem* titem, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : AddExistingDlgBase ( parent, name, modal, fl )
+{
+ m_spitem = spitem;
+ m_titem = titem;
+
+ m_part = part;
+ m_widget = widget;
+
+ KFile::Mode mode = KFile::Files;
+
+ if ( titem && spitem && titem->type() == ProjectItem::Target && spitem->type() == ProjectItem::Subproject )
+ {
+
+ if ( titem->name.isEmpty() )
+ {
+ QString target = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix );
+ targetLabel->setText ( target );
+ }
+ else
+ {
+ targetLabel->setText ( titem->name );
+ }
+ directoryLabel->setText ( spitem->path );
+ }
+
+ sourceSelector = new FileSelectorWidget ( m_part, mode, sourceGroupBox, "source file selector" );
+ sourceGroupBoxLayout->addWidget ( sourceSelector );
+
+ importView = new KImportIconView ( i18n ( "Drag one or more files from the left view and drop it here." ), destGroupBox, "destination icon view" );
+ destGroupBoxLayout->addWidget ( importView );
+ //destGroupBoxLayout->setStretchFactor(dir, 2);
+
+ QWidget::setTabOrder(sourceSelector, addAllButton);
+ QWidget::setTabOrder(addAllButton, addSelectedButton);
+ QWidget::setTabOrder(addSelectedButton, importView);
+ QWidget::setTabOrder(importView, removeAllButton);
+ QWidget::setTabOrder(removeAllButton, removeSelectedButton);
+ QWidget::setTabOrder(removeSelectedButton, okButton);
+ QWidget::setTabOrder(okButton, cancelButton);
+
+ sourceSelector->setFocus();
+
+ setIcon ( SmallIcon ( "fileimport.png" ) );
+
+ init();
+}
+
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+AddExistingFilesDialog::~AddExistingFilesDialog()
+{
+ // no need to delete child widgets, Qt does it all for me
+}
+
+
+// void AddExistingFilesDialog::resizeEvent ( QResizeEvent* ev )
+// {
+// AddExistingDlgBase::resizeEvent ( ev );
+// //importView->update();
+// }
+
+
+void AddExistingFilesDialog::init()
+{
+ progressBar->hide();
+
+ importView->setMode ( KIconView::Select );
+ importView->setItemsMovable ( false );
+
+ connect ( okButton, SIGNAL ( clicked () ), this, SLOT ( slotOk () ) );
+
+ connect ( addSelectedButton, SIGNAL ( clicked () ), this, SLOT ( slotAddSelected() ) );
+ connect ( addAllButton, SIGNAL ( clicked () ), this, SLOT ( slotAddAll() ) );
+ connect ( removeSelectedButton, SIGNAL ( clicked () ), this, SLOT ( slotRemoveSelected() ) );
+ connect ( removeAllButton, SIGNAL ( clicked () ), this, SLOT ( slotRemoveAll() ) );
+
+ connect ( importView, SIGNAL ( dropped( QDropEvent* ) ), this, SLOT ( slotDropped ( QDropEvent* ) ) );
+
+ importView->setSelectionMode ( KFile::Multi );
+
+ Q_ASSERT( m_spitem );
+ sourceSelector->setDir ( m_spitem->path );
+}
+
+void AddExistingFilesDialog::importItems()
+{
+ if( !importView->items() )
+ return;
+
+ // items added via button or drag 'n drop
+ KFileItemListIterator itemList ( m_importList );
+
+ // items already added to the importView
+ KFileItemListIterator importedList ( *importView->items() );
+
+ QListViewItem* child = m_titem->firstChild();
+
+ QStringList duplicateList;
+
+ while ( child )
+ {
+ FileItem* curItem = static_cast<FileItem*> ( child );
+
+ itemList.toFirst();
+
+ for ( ; itemList.current(); ++itemList )
+ {
+ if ( ( *itemList )->name() == curItem->name )
+ {
+ duplicateList.append ( ( *itemList )->name() );
+ m_importList.remove ( ( *itemList ) );
+ }
+ }
+
+ child = child->nextSibling();
+ }
+
+ importedList.toFirst();
+
+ for ( ; importedList.current(); ++importedList )
+ {
+ itemList.toFirst();
+
+ for ( ; itemList.current(); ++itemList )
+ {
+ if ( ( *importedList )->name() == ( *itemList )->name() )
+ {
+ m_importList.remove ( ( *itemList ) );
+
+ // to avoid that a item is added twice
+ if ( !duplicateList.remove ( ( *importedList )->name() ) )
+ {
+ duplicateList.append ( ( *importedList )->name() );
+ }
+ }
+ }
+ }
+
+ if ( duplicateList.count() > 0 )
+ {
+ if ( KMessageBox::warningContinueCancelList ( this, i18n (
+ "The following file(s) already exist(s) in the target!\n"
+ "Press Continue to import only the new files.\n"
+ "Press Cancel to abort the complete import." ),
+ duplicateList, "Warning", KGuiItem ( i18n ( "Continue" ) ) ) == KMessageBox::Cancel )
+ {
+ m_importList.clear();
+ return;
+ }
+ }
+
+ itemList.toFirst();
+
+ for ( ; itemList.current(); ++itemList )
+ {
+ if ( !( *itemList )->isDir() )
+ {
+ importView->insertItem ( ( *itemList ) );
+ }
+ }
+
+ importView->somethingDropped ( true );
+
+ m_importList.clear();
+
+ importView->update ();
+}
+
+void AddExistingFilesDialog::slotOk()
+{
+ if ( importView->items()->count() == 0 ) QDialog::reject();
+
+ progressBar->show();
+ progressBar->setFormat ( i18n ( "Importing... %p%" ) );
+
+ qApp->processEvents();
+
+ KFileItemListIterator items ( *importView->items() );
+
+ // contains at the end only the imported files outside the subproject directory
+ KFileItemList outsideList;
+
+ QStringList stringList;
+
+ for ( ; items.current(); ++items )
+ {
+ // kdDebug ( 9020 ) << " **** " << ( *items )->url().directory() << "***** " << m_spitem->path << endl;
+ if ( ( *items )->url().directory() != m_spitem->path )
+ {
+ stringList.append ( ( *items )->name() );
+ outsideList.append ( ( *items ) );
+ }
+ }
+
+ progressBar->setTotalSteps ( outsideList.count() + importView->items()->count() );
+
+ if ( outsideList.count() > 0 )
+ {
+ if ( KMessageBox::questionYesNoList ( this, i18n (
+ "The following file(s) are not in the Subproject directory.\n"
+ "Press Link to add the files by creating symbolic links.\n"
+ "Press Copy to copy the files into the directory." ),
+ stringList, i18n("Warning"), KGuiItem ( i18n ( "Link (recommended)" ) ), KGuiItem ( i18n ( "Copy (not recommended)" ) ) ) == KMessageBox::No )
+ {
+ // Copy files into the Subproject directory
+ KFileItemListIterator it ( outsideList ) ;
+
+ for ( ; it.current(); ++it )
+ {
+ KProcess proc;
+
+ proc << "cp";
+ proc << ( *it )->url().path();
+ proc << m_spitem->path;
+ proc.start(KProcess::DontCare);
+
+ progressBar->setValue ( progressBar->value() + 1 );
+ }
+ }
+ else
+ {
+ // Link them into the Subproject directory
+ KFileItemListIterator it ( outsideList ) ;
+
+ for ( ; it.current(); ++it )
+ {
+ KProcess proc;
+
+ proc << "ln";
+ proc << "-s";
+ proc << URLUtil::relativePathToFile( m_spitem->path, ( *it )->url().path() );
+ proc << m_spitem->path;
+ proc.start(KProcess::DontCare);
+
+ progressBar->setValue ( progressBar->value() + 1 );
+ }
+ }
+ }
+
+ items.toFirst();
+
+ QString canontargetname = AutoProjectTool::canonicalize ( m_titem->name );
+ QString varname;
+ if( m_titem->primary == "PROGRAMS" || m_titem->primary == "LIBRARIES" || m_titem->primary == "LTLIBRARIES" )
+ varname = canontargetname + "_SOURCES";
+ else
+ varname = m_titem->prefix + "_" + m_titem->primary;
+
+ QMap<QString,QString> replaceMap;
+ FileItem* fitem = 0L;
+ QStringList fileList;
+
+ for ( ; items.current(); ++items )
+ {
+ m_spitem->variables [ varname ] += ( " " + ( *items )->name() );
+ replaceMap.insert ( varname, m_spitem->variables [ varname ] );
+
+ fitem = m_widget->createFileItem ( ( *items )->name(), m_spitem );
+ m_titem->sources.append ( fitem );
+ m_titem->insertItem ( fitem );
+
+ fileList.append ( m_spitem->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + ( *items )->name() );
+
+ progressBar->setValue ( progressBar->value() + 1 );
+ }
+
+ m_widget->emitAddedFiles ( fileList );
+
+ AutoProjectTool::addToMakefileam ( m_spitem->path + "/Makefile.am", replaceMap );
+
+ QDialog::accept();
+
+}
+
+void AddExistingFilesDialog::slotAddSelected()
+{
+ KFileItemListIterator it ( *sourceSelector->dirOperator()->selectedItems() );
+
+ for ( ; it.current(); ++it )
+ {
+ if ( ( *it )->url().isLocalFile() ) // maybe unnecessary
+ {
+ m_importList.append ( ( *it ) );
+ }
+ }
+
+ importItems();
+}
+
+
+void AddExistingFilesDialog::slotAddAll()
+{
+ KFileItemListIterator it ( *sourceSelector->dirOperator()->view()->items() );
+
+ for ( ; it.current(); ++it )
+ {
+ if ( ( *it )->url().isLocalFile() ) // maybe unnecessary
+ {
+ m_importList.append ( ( *it ) );
+ }
+ }
+
+ importItems();
+}
+
+void AddExistingFilesDialog::slotRemoveAll()
+{
+ KURL::List deletedFiles;
+ KFileItemListIterator it ( *importView->items() );
+
+ for ( ; it.current(); ++it )
+ {
+ kdDebug ( 9020 ) << "AddExistingFilesDialog::slotRemoveAll()" << endl;
+ //deletedFiles.append ( ( *it )->url() );
+ if ( (*it ) ) importView->removeItem ( *it );
+ }
+
+ importView->somethingDropped ( false );
+
+ importView->viewport()->update();
+}
+
+void AddExistingFilesDialog::slotRemoveSelected()
+{
+ KFileItemListIterator items ( *importView->items() );
+
+ KFileItemList* selectedList = (KFileItemList*) importView->selectedItems();
+
+ KFileItem * deleteItem = 0L;
+
+ for ( ; items.current(); ++items )
+ {
+ deleteItem = selectedList->first();
+
+ while ( deleteItem )
+ {
+ if ( deleteItem == ( *items ) )
+ {
+ importView->removeItem ( deleteItem );
+ deleteItem = selectedList->current();
+ }
+ else
+ {
+ deleteItem = selectedList->next();
+ }
+ }
+ }
+
+ if ( importView->items()->count() == 0 ) importView->somethingDropped ( false );
+
+ importView->viewport()->update();
+}
+
+
+void AddExistingFilesDialog::slotDropped ( QDropEvent* ev )
+{
+ kdDebug ( 9020 ) << "AddExistingFilesDialog::dropped()" << endl;
+
+ KURL::List urls;
+
+ KURLDrag::decode( ev, urls );
+
+ KFileItem* item = 0L;
+ KMimeType::Ptr type = 0L;
+
+
+ for ( KURL::List::Iterator it = urls.begin(); it != urls.end(); ++it )
+ {
+ if ( ( *it ).isLocalFile() ) // maybe unnecessary
+ {
+ type = KMimeType::findByURL ( ( *it ) );
+
+ if ( type->name() != KMimeType::defaultMimeType() )
+ {
+ item = new KFileItem ( ( *it ) , type->name(), 0 );
+ }
+ else
+ {
+ // take a text-file-icon instead of the ugly question-mark-icon
+ item = new KFileItem ( ( *it ), "text/plain", 0 );
+ }
+
+ m_importList.append ( item );
+ }
+ }
+
+ importItems();
+}
+
+#include "addexistingfilesdlg.moc"
diff --git a/buildtools/autotools/addexistingfilesdlg.h b/buildtools/autotools/addexistingfilesdlg.h
new file mode 100644
index 00000000..5bee18b6
--- /dev/null
+++ b/buildtools/autotools/addexistingfilesdlg.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ -------------------
+ begin : Frag' mich was leichteres
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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. *
+ * *
+ ***************************************************************************/
+
+/** Here resides the Import-existing-files-dialog of the Automake Manager **/
+/** (a KDevelop build tool part) **/
+
+#ifndef ADDEXISTINGFILESDLG_H
+#define ADDEXISTINGFILESDLG_H
+
+#include <qdialog.h>
+#include <kfile.h>
+
+#include "addexistingdlgbase.h"
+#include "fileselectorwidget.h"
+
+#include "misc.h"
+
+class KImportIconView;
+class FileSelectorWidget;
+class AutoProjectWidget;
+class AutoProjectPart;
+class SubprojectItem;
+class TargetItem;
+class KFileItem;
+
+class AddExistingFilesDialog : public AddExistingDlgBase
+{
+ Q_OBJECT
+
+public:
+ AddExistingFilesDialog( AutoProjectPart* part, AutoProjectWidget *widget,
+ SubprojectItem* spitem, TargetItem* titem, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~AddExistingFilesDialog();
+
+private:
+ FileSelectorWidget* sourceSelector;
+ KImportIconView* importView;
+
+ AutoProjectPart* m_part;
+ AutoProjectWidget* m_widget;
+
+ TargetItem* m_titem;
+ SubprojectItem* m_spitem;
+
+ KFileItemList m_importList;
+
+protected:
+ // virtual void resizeEvent ( QResizeEvent* ev );
+ void init();
+ void importItems ();
+
+protected slots:
+ void slotAddSelected();
+ void slotAddAll();
+ void slotRemoveAll();
+ void slotRemoveSelected();
+ void slotDropped ( QDropEvent* ev );
+
+ void slotOk();
+};
+
+#endif // ADDEXISTINGFILESDLG_H
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/addfiledlg.cpp b/buildtools/autotools/addfiledlg.cpp
new file mode 100644
index 00000000..46529086
--- /dev/null
+++ b/buildtools/autotools/addfiledlg.cpp
@@ -0,0 +1,135 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addfiledlg.h"
+
+#include <qcheckbox.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qtextstream.h>
+
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <ksqueezedtextlabel.h>
+#include <kurl.h>
+
+#include "autolistviewitems.h"
+
+#include "filetemplate.h"
+#include "misc.h"
+#include "urlutil.h"
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+
+#include "kdevpartcontroller.h"
+
+AddFileDialog::AddFileDialog(AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *spitem, TargetItem *item,
+ QWidget *parent, const char *name)
+ : AddFileDlgBase(parent, name, true)
+{
+ connect ( createButton, SIGNAL ( clicked() ), this, SLOT ( accept() ) );
+ connect ( cancelButton, SIGNAL ( clicked() ), this, SLOT ( reject() ) );
+
+ directoryLabel->setText ( spitem->path );
+ if ( item->name.isEmpty() )
+ targetLabel->setText ( i18n ( "%1 in %2" ).arg ( item->primary ).arg ( item->prefix ) );
+ else
+ targetLabel->setText ( item->name );
+
+ setIcon ( SmallIcon ( "filenew.png" ) );
+
+ m_part = part;
+ m_widget = widget;
+ subProject = spitem;
+ target = item;
+}
+
+
+AddFileDialog::~AddFileDialog()
+{}
+
+
+void AddFileDialog::accept()
+{
+ QString name = fileEdit->text();
+ if (name.find('/') != -1) {
+ KMessageBox::sorry(this, i18n("Please enter the file name without '/' and so on."));
+ return;
+ }
+
+ QListViewItem *child = target->firstChild();
+ while (child) {
+ FileItem *item = static_cast<FileItem*>(child);
+ if (name == item->name) {
+ KMessageBox::sorry(this, i18n("This file is already in the target."));
+ return;
+ }
+ child = child->nextSibling();
+ }
+
+ if (templateCheckBox->isChecked()) {
+ QString srcdir = m_part->projectDirectory();
+ QString destdir = subProject->path;
+ QString destpath = destdir + "/" + name;
+ if (QFileInfo(destpath).exists()) {
+ KMessageBox::sorry(this, i18n("<b>A file with this name already exists.</b><br><br>Please use the \"Add existing file\" dialog."));
+ return;
+ }
+ if( !FileTemplate::copy(m_part, QFileInfo(name).extension(), destpath) )
+ kdDebug(9020) << "cannot create file " << destpath << endl;
+ } else {
+ // create an empty file
+ QString srcdir = m_part->projectDirectory();
+ QString destdir = subProject->path;
+ QString destpath = destdir + "/" + name;
+
+ if (QFileInfo(destpath).exists()) {
+ KMessageBox::sorry(this, i18n("<b>A file with this name already exists.</b><br><br>Please use the \"Add existing file\" dialog."));
+ return;
+ }
+
+ QFile f( destpath );
+ if( f.open(IO_WriteOnly) )
+ f.close();
+ }
+
+ FileItem *fitem = m_widget->createFileItem(name, subProject);
+ target->sources.append(fitem);
+ target->insertItem(fitem);
+
+ QString canontargetname = AutoProjectTool::canonicalize(target->name);
+ QString varname;
+ if( target->primary == "PROGRAMS" || target->primary == "LIBRARIES" || target->primary == "LTLIBRARIES" )
+ varname = canontargetname + "_SOURCES";
+ else
+ varname = target->prefix + "_" + target->primary;
+ subProject->variables[varname] += (" " + name);
+
+ QMap<QString,QString> replaceMap;
+ replaceMap.insert(varname, subProject->variables[varname]);
+
+ AutoProjectTool::addToMakefileam(subProject->path + "/Makefile.am", replaceMap);
+
+ m_widget->emitAddedFile( subProject->path.mid ( m_part->project()->projectDirectory().length() + 1 ) + "/" + name );
+ m_part->partController()->editDocument ( KURL ( subProject->path + "/" + name ) );
+
+ QDialog::accept();
+}
+
+#include "addfiledlg.moc"
diff --git a/buildtools/autotools/addfiledlg.h b/buildtools/autotools/addfiledlg.h
new file mode 100644
index 00000000..328e3593
--- /dev/null
+++ b/buildtools/autotools/addfiledlg.h
@@ -0,0 +1,47 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDFILEDLG_H_
+#define _ADDFILEDLG_H_
+
+#include <qdialog.h>
+
+#include "addfiledlgbase.h"
+
+class QCheckBox;
+class QLineEdit;
+class AutoProjectPart;
+class AutoProjectWidget;
+class SubprojectItem;
+class TargetItem;
+
+
+class AddFileDialog : public AddFileDlgBase
+{
+ Q_OBJECT
+
+public:
+ AddFileDialog( AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *spitem, TargetItem *item,
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddFileDialog();
+
+protected:
+ virtual void accept();
+
+private:
+ AutoProjectPart *m_part;
+ AutoProjectWidget *m_widget;
+ SubprojectItem *subProject;
+ TargetItem *target;
+};
+
+#endif
diff --git a/buildtools/autotools/addfiledlgbase.ui b/buildtools/autotools/addfiledlgbase.ui
new file mode 100644
index 00000000..dc8e38b2
--- /dev/null
+++ b/buildtools/autotools/addfiledlgbase.ui
@@ -0,0 +1,289 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddFileDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddFileDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>521</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Add New Created File to Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>targetBox</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Subproject Information</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>targetLayout</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KSqueezedTextLabel" row="0" column="1">
+ <property name="name">
+ <cstring>directoryLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[TARGET DIRECTORY]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>targetLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[TARGET NAME]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>directoryStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>targetStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>fileGroupBox</cstring>
+ </property>
+ <property name="title">
+ <string>File Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>fileEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>templateCheckBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Use file template</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>fileStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>New file &amp;name (with extension):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="2" column="0">
+ <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>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>buttonLayout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>createButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">ksqueezedtextlabel.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>ksqueezedtextlabel.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/addicondlg.cpp b/buildtools/autotools/addicondlg.cpp
new file mode 100644
index 00000000..251601f7
--- /dev/null
+++ b/buildtools/autotools/addicondlg.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addicondlg.h"
+
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <kicontheme.h>
+#include <kdeversion.h> // fix me!
+
+#include "autolistviewitems.h"
+
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+
+
+const char *type_map[] = {
+ "app", "action", "device", "filesys", "mime"
+};
+
+
+const char *size_map[] = {
+ "hi16", "hi22", "hi32", "hi48", "hi64", "hi128"
+};
+
+
+AddIconDialog::AddIconDialog(AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *spitem, TargetItem *titem,
+ QWidget *parent, const char *name)
+ : AddIconDialogBase(parent, name, true)
+{
+ type_combo->insertItem(i18n("Application"));
+ type_combo->insertItem(i18n("Action"));
+ type_combo->insertItem(i18n("Device"));
+ type_combo->insertItem(i18n("File System"));
+ type_combo->insertItem(i18n("MIME Type"));
+
+ size_combo->insertItem("16");
+ size_combo->insertItem("22");
+ size_combo->insertItem("32");
+ size_combo->insertItem("48");
+ size_combo->insertItem("64");
+ size_combo->insertItem("128");
+
+ somethingChanged();
+
+ setIcon ( SmallIcon ( "iconadd_kdevelop" ) );
+
+ m_part = part;
+ m_widget = widget;
+ m_subProject = spitem;
+ m_target = titem;
+}
+
+
+AddIconDialog::~AddIconDialog()
+{}
+
+
+void AddIconDialog::somethingChanged()
+{
+ QString size = size_map[size_combo->currentItem()];
+ QString type = type_map[type_combo->currentItem()];
+ QString name = name_edit->text();
+
+ filename_edit->setText(size + "-" + type + "-" + name + ".png");
+}
+
+
+void AddIconDialog::accept()
+{
+ QString name = filename_edit->text();
+
+ QString destdir = m_subProject->subdir;
+ QString destpath = destdir + "/" + name;
+
+ QString size = size_combo->currentText();
+ QString unknown = KIconTheme::defaultThemeName()+ "/" + size + "x" + size + "/mimetypes/unknown.png";
+
+ QString templateFileName = locate("icon", unknown);
+ kdDebug(9020) << "Unknown: " << unknown << ", template: " << templateFileName << endl;
+
+ if (!templateFileName.isEmpty()) {
+ KProcess proc;
+ proc << "cp";
+ proc << templateFileName;
+ proc << destpath;
+ proc.start(KProcess::DontCare);
+ }
+
+ FileItem *fitem = m_widget->createFileItem(name, m_subProject);
+ m_target->sources.append(fitem);
+ m_target->insertItem(fitem);
+
+ m_part->startMakeCommand(destdir, QString::fromLatin1("force-reedit"));
+
+ m_widget->emitAddedFile(destpath);
+
+ QDialog::accept();
+}
+
+#include "addicondlg.moc"
diff --git a/buildtools/autotools/addicondlg.h b/buildtools/autotools/addicondlg.h
new file mode 100644
index 00000000..64fac0a5
--- /dev/null
+++ b/buildtools/autotools/addicondlg.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+* Copyright (C) 2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDICONDLG_H_
+#define _ADDICONDLG_H_
+
+#include "addicondlgbase.h"
+
+class AutoProjectPart;
+class AutoProjectWidget;
+class SubprojectItem;
+class TargetItem;
+
+
+class AddIconDialog : public AddIconDialogBase
+{
+ Q_OBJECT
+
+public:
+ AddIconDialog( AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *spitem, TargetItem *titem,
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddIconDialog();
+
+
+private:
+ virtual void somethingChanged();
+ virtual void accept();
+
+ AutoProjectPart *m_part;
+ AutoProjectWidget *m_widget;
+ SubprojectItem *m_subProject;
+ TargetItem *m_target;
+};
+
+#endif
diff --git a/buildtools/autotools/addicondlgbase.ui b/buildtools/autotools/addicondlgbase.ui
new file mode 100644
index 00000000..7fec5097
--- /dev/null
+++ b/buildtools/autotools/addicondlgbase.ui
@@ -0,0 +1,273 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddIconDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>add_icon_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>301</width>
+ <height>218</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add New Icon</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>type_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>type_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>size_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Size:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>size_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>size_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>filename_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>File name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>name_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="Line" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>name_edit</cstring>
+ </property>
+ <property name="text">
+ <string>unknown</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>type_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="1">
+ <property name="name">
+ <cstring>filename_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer22</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_icon_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_icon_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>name_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>add_icon_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+ <connection>
+ <sender>type_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>add_icon_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+ <connection>
+ <sender>size_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>add_icon_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>type_combo</tabstop>
+ <tabstop>size_combo</tabstop>
+ <tabstop>name_edit</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<slots>
+ <slot>somethingChanged()</slot>
+</slots>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+
+</UI>
+
diff --git a/buildtools/autotools/addprefixdlg.cpp b/buildtools/autotools/addprefixdlg.cpp
new file mode 100644
index 00000000..d1557114
--- /dev/null
+++ b/buildtools/autotools/addprefixdlg.cpp
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addprefixdlg.h"
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <kbuttonbox.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+AddPrefixDialog::AddPrefixDialog( const QString& nameEdit, const QString& pathEdit,
+ QWidget *parent, const char *name)
+ : QDialog(parent, name, true)
+{
+ setCaption(i18n("Add Prefix"));
+
+ QLabel *name_label = new QLabel(i18n("&Name:"), this);
+ name_edit = new KLineEdit(nameEdit, this);
+ name_edit->setFocus();
+ name_label->setBuddy(name_edit);
+ connect( name_edit, SIGNAL( textChanged ( const QString & ) ), SLOT( slotPrefixChanged() ) );
+
+ QLabel *path_label = new QLabel(i18n("&Path:"), this);
+ path_edit = new KLineEdit(pathEdit, this);
+ path_label->setBuddy(path_edit);
+ QFontMetrics fm(path_edit->fontMetrics());
+ path_edit->setMinimumWidth(fm.width('X')*35);
+ connect( path_edit, SIGNAL( textChanged ( const QString & ) ), SLOT( slotPrefixChanged() ) );
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 10);
+
+ QGridLayout *grid = new QGridLayout(2, 2);
+ layout->addLayout(grid);
+ grid->addWidget(name_label, 0, 0);
+ grid->addWidget(name_edit, 0, 1);
+ grid->addWidget(path_label, 1, 0);
+ grid->addWidget(path_edit, 1, 1);
+
+ QFrame *frame = new QFrame(this);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addWidget(frame, 0);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ m_pOk = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+ m_pOk->setDefault(true);
+ connect( m_pOk, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
+ buttonbox->layout();
+ layout->addWidget(buttonbox, 0);
+ slotPrefixChanged();
+}
+
+
+AddPrefixDialog::~AddPrefixDialog()
+{}
+
+void AddPrefixDialog::slotPrefixChanged()
+{
+ m_pOk->setEnabled( !name_edit->text().isEmpty() && !path_edit->text().isEmpty() );
+}
+
+#include "addprefixdlg.moc"
diff --git a/buildtools/autotools/addprefixdlg.h b/buildtools/autotools/addprefixdlg.h
new file mode 100644
index 00000000..a20bc63a
--- /dev/null
+++ b/buildtools/autotools/addprefixdlg.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDPREFIXDLG_H_
+#define _ADDPREFIXDLG_H_
+
+#include <qdialog.h>
+#include <klineedit.h>
+class QPushButton;
+
+class AddPrefixDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AddPrefixDialog( const QString& nameEdit = "", const QString& pathEdit = "",
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddPrefixDialog();
+
+ QString name() const
+ {
+ return name_edit->text();
+ }
+ QString path() const
+ {
+ return path_edit->text();
+ }
+private slots:
+ void slotPrefixChanged();
+
+private:
+ KLineEdit *name_edit;
+ KLineEdit *path_edit;
+ QPushButton *m_pOk;
+};
+
+#endif
diff --git a/buildtools/autotools/addservicedlg.cpp b/buildtools/autotools/addservicedlg.cpp
new file mode 100644
index 00000000..2dc76e5e
--- /dev/null
+++ b/buildtools/autotools/addservicedlg.cpp
@@ -0,0 +1,233 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addservicedlg.h"
+
+#include <qcombobox.h>
+#include <qfile.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qtextstream.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <kicondialog.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kservicetype.h>
+
+#include "autolistviewitems.h"
+
+#include "misc.h"
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+
+
+AddServiceDialog::AddServiceDialog(AutoProjectWidget *widget, SubprojectItem *spitem,
+ QWidget *parent, const char *name)
+ : AddServiceDialogBase(parent, name, true)
+{
+ filename_edit->setText(".desktop");
+ filename_edit->home(false);
+ filename_edit->setFocus();
+ chosentypes_listview->header()->hide();
+ availtypes_listview->header()->hide();
+
+ m_widget = widget;
+ subProject = spitem;
+
+ // Fill the combo box with library names in the directory
+ QPtrListIterator<TargetItem> tit(spitem->targets);
+ for (; tit.current(); ++tit) {
+ if ((*tit)->primary == "LTLIBRARIES")
+ library_combo->insertItem(QString((*tit)->name));
+ }
+
+ // Fill the list of available service types
+ KServiceType::List l = KServiceType::allServiceTypes();
+ KServiceType::List::Iterator it;
+ for (it = l.begin(); it != l.end(); ++it)
+ if (!(*it)->isType(KST_KMimeType))
+ new QListViewItem(availtypes_listview, (*it)->name());
+
+ setIcon ( SmallIcon ( "servicenew_kdevelop.png" ) );
+}
+
+
+AddServiceDialog::~AddServiceDialog()
+{}
+
+
+void AddServiceDialog::updateProperties()
+{
+ QStringList props;
+
+ QListViewItem *item = static_cast<QCheckListItem*>(chosentypes_listview->firstChild());
+ while (item) {
+ KServiceType::Ptr type = KServiceType::serviceType(item->text(0));
+ if (type) {
+ QStringList stprops = type->propertyDefNames();
+ QStringList::ConstIterator stit;
+ for (stit = stprops.begin(); stit != stprops.end(); ++stit)
+ if (props.find(*stit) == props.end() && (*stit) != "Name" && (*stit) != "Comment"
+ && (*stit) != "Icon")
+ props.append(*stit);
+ }
+ item = item->nextSibling();
+ }
+
+ properties_listview->clear();
+ QStringList::ConstIterator it;
+ for (it = props.begin(); it != props.end(); ++it)
+ new QListViewItem(properties_listview, *it);
+}
+
+
+void AddServiceDialog::iconClicked()
+{
+ KIconLoader *loader = AutoProjectFactory::instance()->iconLoader();
+ QString name = KIconDialog::getIcon(KIcon::Desktop);
+ if (!name.isNull()) {
+ iconName = name;
+ icon_button->setPixmap(loader->loadIcon(name, KIcon::Desktop));
+ }
+}
+
+
+void AddServiceDialog::addTypeClicked()
+{
+ QListViewItem *selitem = availtypes_listview->selectedItem();
+ if (!selitem)
+ return;
+
+ QListViewItem *olditem = chosentypes_listview->firstChild();
+ while (olditem) {
+ if (selitem->text(0) == olditem->text(0))
+ return;
+ olditem = olditem->nextSibling();
+ }
+ new QListViewItem(chosentypes_listview, selitem->text(0));
+
+ updateProperties();
+}
+
+
+void AddServiceDialog::removeTypeClicked()
+{
+ delete chosentypes_listview->currentItem();
+
+ updateProperties();
+}
+
+
+void AddServiceDialog::propertyExecuted(QListViewItem *item)
+{
+ if (!item)
+ return;
+
+ QString prop = item->text(0);
+ QString value = item->text(1);
+ bool ok;
+ value = KInputDialog::getText(i18n("Enter Value"), i18n("Property %1:").arg(prop), value, &ok, this);
+ if (!ok)
+ return;
+
+ item->setText(1, value);
+}
+
+
+void AddServiceDialog::accept()
+{
+ // Create list of service types
+ QStringList serviceTypes;
+ QListViewItem *item = chosentypes_listview->firstChild();
+ while (item) {
+ serviceTypes.append(item->text(0));
+ item = item->nextSibling();
+ }
+
+ // Some plausibility tests
+ QString fileName = filename_edit->text();
+ if (fileName.isEmpty() || fileName == ".desktop") {
+ KMessageBox::sorry(this, i18n("You have to enter a file name."));
+ filename_edit->setFocus();
+ return;
+ }
+
+ QString name = name_edit->text();
+ if (name.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to enter a service name."));
+ name_edit->setFocus();
+ return;
+ }
+
+ QFile f(subProject->path + "/" + fileName);
+ if (f.exists()) {
+ KMessageBox::sorry(this, i18n("A file with this name exists already."));
+ filename_edit->setFocus();
+ return;
+ }
+ if (!f.open(IO_WriteOnly)) {
+ KMessageBox::sorry(this, i18n("Could not open file for writing."));
+ return;
+ }
+
+ QTextStream stream(&f);
+ stream << "[Desktop Entry]" << endl;
+ stream << "Type=Service" << endl;
+ stream << "Name=" << name << endl;
+ stream << "Comment=" << comment_edit->text() << endl;
+ if (!iconName.isNull())
+ stream << "Icon=" << iconName << endl;
+ stream << "ServiceTypes=" << serviceTypes.join(",") << endl;
+ item = properties_listview->firstChild();
+ while (item) {
+ stream << item->text(0) << "=" << item->text(1) << endl;
+ item = item->nextSibling();
+ }
+ f.close();
+
+ // Find a prefix that points to the services directory.
+ // If there is none, use kde_services
+ QMap<QString,QString>::ConstIterator it;
+ for (it = subProject->prefixes.begin(); it != subProject->prefixes.end(); ++it)
+ if (it.data() == "$(kde_servicesdir)")
+ break;
+ QString prefix = (it == subProject->prefixes.end())? QString("kde_services") : it.key();
+ QString varname = prefix + "_DATA";
+
+ // Look if a list view item for this prefix exists already.
+ // Create a new one otherwise
+ TargetItem *titem = 0;
+ for (uint i=0; i < subProject->targets.count(); ++i) {
+ TargetItem *tmptitem = subProject->targets.at(i);
+ if ("DATA" == tmptitem->primary && prefix == tmptitem->prefix) {
+ titem = tmptitem;
+ break;
+ }
+ }
+ if (!titem) {
+ titem = m_widget->createTargetItem("", prefix, "DATA", false);
+ subProject->targets.append(titem);
+ }
+ // Add this file to the target
+ FileItem *fitem = m_widget->createFileItem(fileName, subProject);
+ titem->sources.append(fitem);
+
+ subProject->variables[varname] += (" " + fileName);
+ QMap<QString, QString> replaceMap;
+ replaceMap.insert(varname, subProject->variables[varname]);
+ AutoProjectTool::addToMakefileam(subProject->path + "/Makefile.am", replaceMap);
+
+ QDialog::accept();
+}
+
+#include "addservicedlg.moc"
diff --git a/buildtools/autotools/addservicedlg.h b/buildtools/autotools/addservicedlg.h
new file mode 100644
index 00000000..c8b694a5
--- /dev/null
+++ b/buildtools/autotools/addservicedlg.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDSERVICEDLG_H_
+#define _ADDSERVICEDLG_H_
+
+#include "addservicedlgbase.h"
+
+class AutoProjectWidget;
+class SubprojectItem;
+class TargetItem;
+
+
+class AddServiceDialog : public AddServiceDialogBase
+{
+ Q_OBJECT
+
+public:
+ AddServiceDialog( AutoProjectWidget *widget, SubprojectItem *spitem,
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddServiceDialog();
+
+protected:
+ virtual void iconClicked();
+ virtual void addTypeClicked();
+ virtual void removeTypeClicked();
+ virtual void propertyExecuted( QListViewItem *item );
+ virtual void accept();
+
+private:
+ void updateProperties();
+
+ AutoProjectWidget *m_widget;
+ SubprojectItem *subProject;
+ QString iconName;
+};
+
+#endif
diff --git a/buildtools/autotools/addservicedlgbase.ui b/buildtools/autotools/addservicedlgbase.ui
new file mode 100644
index 00000000..050f8066
--- /dev/null
+++ b/buildtools/autotools/addservicedlgbase.ui
@@ -0,0 +1,544 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddServiceDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>add_service_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>602</width>
+ <height>422</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add New Service</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Service File</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>filename_edit</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>icon_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Icon:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>icon_button</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="3">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>icon_button</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>comment_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="3">
+ <property name="name">
+ <cstring>library_combo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>library_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Library:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>library_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>filename_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;File name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>name_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>comment_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Co&amp;mment:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comment_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Service &amp;Types</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>chosentypes_listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>add_button</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;-</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>remove_button</cstring>
+ </property>
+ <property name="text">
+ <string>-&gt;</string>
+ </property>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>availtypes_listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QListView" row="1" column="1">
+ <column>
+ <property name="text">
+ <string>Property</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>properties_listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>properties_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Properties:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>properties_listview</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>remove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>removeTypeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>properties_listview</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>propertyExecuted(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>properties_listview</sender>
+ <signal>returnPressed(QListViewItem*)</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>propertyExecuted(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>icon_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>iconClicked()</slot>
+ </connection>
+ <connection>
+ <sender>add_button</sender>
+ <signal>clicked()</signal>
+ <receiver>add_service_dialog</receiver>
+ <slot>addTypeClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>filename_edit</tabstop>
+ <tabstop>library_combo</tabstop>
+ <tabstop>name_edit</tabstop>
+ <tabstop>icon_button</tabstop>
+ <tabstop>comment_edit</tabstop>
+ <tabstop>chosentypes_listview</tabstop>
+ <tabstop>add_button</tabstop>
+ <tabstop>remove_button</tabstop>
+ <tabstop>availtypes_listview</tabstop>
+ <tabstop>properties_listview</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">iconClicked()</slot>
+ <slot access="protected">addTypeClicked()</slot>
+ <slot access="protected">propertyExecuted(QListViewItem*)</slot>
+ <slot access="protected">removeTypeClicked()</slot>
+</slots>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/autotools/addsubprojectdlg.cpp b/buildtools/autotools/addsubprojectdlg.cpp
new file mode 100644
index 00000000..8011886b
--- /dev/null
+++ b/buildtools/autotools/addsubprojectdlg.cpp
@@ -0,0 +1,198 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addsubprojectdlg.h"
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <kiconloader.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+
+#include "autolistviewitems.h"
+
+#include "kdevmakefrontend.h"
+#include "misc.h"
+#include "autoprojectpart.h"
+#include "autosubprojectview.h"
+
+
+AddSubprojectDialog::AddSubprojectDialog(AutoProjectPart *part, AutoSubprojectView *view,
+ SubprojectItem *item, QWidget *parent, const char *name)
+ : AddSubprojectDlgBase(parent, name, true)
+{
+ setIcon(SmallIcon("folder_new.png"));
+
+ connect( createButton, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
+
+ m_subProject = item;
+ m_subprojectView = view;
+ m_part = part;
+}
+
+
+AddSubprojectDialog::~AddSubprojectDialog()
+{}
+
+
+void AddSubprojectDialog::accept()
+{
+ QString name = spEdit->text().stripWhiteSpace();
+
+ if (name.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to give the subproject a name."));
+ return;
+ }
+
+ QListViewItem *childItem = m_subProject->firstChild();
+ while (childItem) {
+ if (name == static_cast<SubprojectItem*>(childItem)->subdir) {
+ KMessageBox::sorry(this, i18n("A subproject with this name already exists."));
+ return;
+ }
+ childItem = childItem->nextSibling();
+ }
+
+
+#if 0
+ // check for config.status
+ if( !QFileInfo(m_part->projectDirectory(), "config.status").exists() ){
+ KMessageBox::sorry(this, i18n("There is no config.status in the project root directory. Run 'Configure' first"));
+ QDialog::accept();
+ return;
+ }
+#endif
+
+ QDir dir( m_subProject->path );
+ QFileInfo file( dir, name );
+
+ if( file.exists() && !file.isDir() ) {
+ KMessageBox::sorry(this, i18n("A file named %1 already exists.").arg(name));
+ QDialog::accept();
+ return;
+ } else if( file.isDir() ) {
+ if( KMessageBox::warningContinueCancel(this,
+ i18n("A subdirectory %1 already exists. "
+ "Do you wish to add it as a subproject?").arg(name))
+ == KMessageBox::Cancel ){
+ QDialog::accept();
+ return;
+ }
+ } else if (!dir.mkdir(name)) {
+ KMessageBox::sorry(this, i18n("Could not create subdirectory %1.").arg(name));
+ QDialog::accept();
+ return;
+ }
+
+ if(!dir.cd(name)) {
+ KMessageBox::sorry(this, i18n("Could not access the subdirectory %1.").arg(name));
+ QDialog::accept();
+ return;
+ }
+
+ // Adjust SUBDIRS variable in containing Makefile.am
+ if (m_subProject->variables["SUBDIRS"].find("$(TOPSUBDIRS)") != -1)
+ {
+ QFile subdirsfile( m_subProject->path + "/subdirs" );
+ if ( subdirsfile.open( IO_WriteOnly | IO_Append ) )
+ {
+ QTextStream subdirsstream( &subdirsfile );
+ subdirsstream << name << endl;
+ subdirsfile.close();
+ }
+ }
+ else if (m_subProject->variables["SUBDIRS"].find("$(AUTODIRS)") != -1)
+ {
+ }
+ else
+ {
+ m_subProject->variables["SUBDIRS"] += (" " + name);
+ QMap<QString,QString> replaceMap;
+ replaceMap.insert("SUBDIRS", m_subProject->variables["SUBDIRS"]);
+ AutoProjectTool::addToMakefileam(m_subProject->path + "/Makefile.am", replaceMap);
+ }
+
+ // Create new item in tree view
+ SubprojectItem *newitem = new SubprojectItem(m_subProject, name);
+ newitem->subdir = name;
+ newitem->path = m_subProject->path + "/" + name;
+ newitem->variables["INCLUDES"] = m_subProject->variables["INCLUDES"];
+ newitem->setOpen(true);
+
+ // Move to the bottom of the list
+ QListViewItem *lastItem = m_subProject->firstChild();
+ while (lastItem->nextSibling())
+ lastItem = lastItem->nextSibling();
+ if (lastItem != newitem)
+ newitem->moveItem(lastItem);
+
+ // Create a Makefile in the new subdirectory
+
+ QFile f( dir.filePath("Makefile.am") );
+ if (f.exists()) {
+ m_subprojectView->parse( newitem );
+ } else {
+ if (!f.open(IO_WriteOnly)) {
+ KMessageBox::sorry(this, i18n("Could not create Makefile.am in subdirectory %1.").arg(name));
+ return;
+ }
+ QTextStream stream(&f);
+ stream << "INCLUDES = " << newitem->variables["INCLUDES"] << endl << "METASOURCES = AUTO" << endl;
+ f.close();
+ }
+
+
+
+ // if !isKDE: add the new sub-proj to configure.in
+ if ( !m_part->isKDE() ) {
+ QString projroot = m_part->projectDirectory() + "/";
+ QString subdirectory = dir.path();
+ QString relpath = subdirectory.replace(0, projroot.length(),"");
+
+ QString configureFile = m_part->getAutoConfFile(projroot);
+
+ QStringList list = AutoProjectTool::configureinLoadMakefiles(configureFile);
+ if ( !list.isEmpty() )
+ {
+ list.push_back( relpath + "/Makefile" );
+ AutoProjectTool::configureinSaveMakefiles(configureFile, list);
+ }
+ }
+
+#if 0
+ QString relmakefile = (m_subProject->path + "/" + name + "/Makefile").mid(m_part->projectDirectory().length()+1);
+ kdDebug(9020) << "Relative makefile path: " << relmakefile << endl;
+
+ QString cmdline = "cd ";
+ cmdline += KProcess::quote(m_part->projectDirectory());
+ cmdline += " && automake ";
+ cmdline += KProcess::quote(relmakefile);
+ cmdline += " && CONFIG_HEADERS=config.h CONFIG_FILES=";
+ cmdline += KProcess::quote(relmakefile);
+ cmdline += " ./config.status";
+
+ m_part->makeFrontend()->queueCommand( m_part->projectDirectory(), cmdline );
+ m_part->makeFrontend()->queueCommand( m_part->projectDirectory(), m_part->configureCommand() );
+#endif
+
+ m_part->needMakefileCvs();
+
+ QDialog::accept();
+}
+
+#include "addsubprojectdlg.moc"
diff --git a/buildtools/autotools/addsubprojectdlg.h b/buildtools/autotools/addsubprojectdlg.h
new file mode 100644
index 00000000..eabfc0e1
--- /dev/null
+++ b/buildtools/autotools/addsubprojectdlg.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDSUBPROJECTDLG_H_
+#define _ADDSUBPROJECTDLG_H_
+
+#include <qdialog.h>
+#include <klineedit.h>
+
+#include "addsubprojectdlgbase.h"
+
+class AutoProjectPart;
+class AutoSubprojectView;
+class SubprojectItem;
+
+
+class AddSubprojectDialog : public AddSubprojectDlgBase
+{
+ Q_OBJECT
+
+public:
+ AddSubprojectDialog( AutoProjectPart *part, AutoSubprojectView *widget,
+ SubprojectItem *item, QWidget *parent = 0, const char *name = 0 );
+ ~AddSubprojectDialog();
+
+private:
+ virtual void accept();
+
+ KLineEdit *name_edit;
+
+ SubprojectItem *m_subProject;
+ AutoSubprojectView *m_subprojectView;
+ AutoProjectPart *m_part;
+};
+
+#endif
diff --git a/buildtools/autotools/addsubprojectdlgbase.ui b/buildtools/autotools/addsubprojectdlgbase.ui
new file mode 100644
index 00000000..b4c762b1
--- /dev/null
+++ b/buildtools/autotools/addsubprojectdlgbase.ui
@@ -0,0 +1,198 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddSubprojectDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddSubprojectDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>445</width>
+ <height>126</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Add New Subproject</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>fileGroupBox</cstring>
+ </property>
+ <property name="title">
+ <string>Subproject</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>spStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Subproject &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>spEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="1" column="0">
+ <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>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>buttonLayout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>createButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>spEdit</tabstop>
+ <tabstop>createButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/addtargetdlg.cpp b/buildtools/autotools/addtargetdlg.cpp
new file mode 100644
index 00000000..b01b5b82
--- /dev/null
+++ b/buildtools/autotools/addtargetdlg.cpp
@@ -0,0 +1,226 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addtargetdlg.h"
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qvalidator.h>
+
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <ksqueezedtextlabel.h>
+
+#include "autolistviewitems.h"
+
+#include "misc.h"
+#include "autodetailsview.h"
+#include "autoprojectwidget.h"
+
+
+AddTargetDialog::AddTargetDialog(AutoProjectWidget *widget, SubprojectItem *item,
+ QWidget *parent, const char *name)
+ : AddTargetDialogBase(parent, name, true)
+{
+ m_subproject = item;
+ m_widget = widget;
+// m_detailsView = view;
+
+ primary_combo->setFocus();
+ primary_combo->insertItem(i18n("Program"));
+ primary_combo->insertItem(i18n("Library"));
+ primary_combo->insertItem(i18n("Libtool Library"));
+ primary_combo->insertItem(i18n("Script"));
+ primary_combo->insertItem(i18n("Header"));
+ primary_combo->insertItem(i18n("Data File"));
+ primary_combo->insertItem(i18n("Java"));
+
+ primaryChanged(); // updates prefix combo
+
+ if (widget->kdeMode())
+ ldflagsother_edit->setText("$(all_libraries)");
+
+ connect( filename_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileNameChanged (const QString&) ) );
+
+ setIcon ( SmallIcon ( "targetnew_kdevelop.png" ) );
+
+ canonicalLabel->setText ( QString::null );
+}
+
+
+AddTargetDialog::~AddTargetDialog()
+{}
+
+
+void AddTargetDialog::primaryChanged()
+{
+ QStringList list;
+ switch (primary_combo->currentItem()) {
+ case 0: // Program
+ list.append("bin");
+ list.append("sbin");
+ list.append("libexec");
+ list.append("pkglib");
+ list.append("noinst");
+ break;
+ case 1: // Library
+ case 2: // Libtool library
+ list.append("lib");
+ list.append("pkglib");
+ list.append("noinst");
+ if (m_widget->kdeMode())
+ list.append("kde_module");
+ break;
+ case 3: // Script
+ list.append("bin");
+ list.append("sbin");
+ list.append("libexec");
+ list.append("pkgdata");
+ list.append("noinst");
+ break;
+ case 4: // Header
+ list.append("include");
+ list.append("oldinclude");
+ list.append("pkginclude");
+ list.append("noinst");
+ break;
+ case 5: // Data
+ list.append("bin");
+ list.append("sbin");
+ list.append("noinst");
+ break;
+ case 6: // Java
+ list.append("java");
+ list.append("noinst");
+ break;
+ }
+
+ prefix_combo->clear();
+
+ prefix_combo->insertStringList(list);
+ QStringList prefixes;
+ QMap<QString,QString>::ConstIterator it;
+ for (it = m_subproject->prefixes.begin(); it != m_subproject->prefixes.end(); ++it)
+ prefix_combo->insertItem(it.key());
+
+ // Only enable ldflags stuff for libtool libraries
+ bool lt = primary_combo->currentItem() == 2;
+ bool prog = primary_combo->currentItem() == 0;
+ allstatic_box->setEnabled(lt);
+ avoidversion_box->setEnabled(lt);
+ module_box->setEnabled(lt);
+ noundefined_box->setEnabled(lt);
+ ldflagsother_edit->setEnabled(lt || prog);
+}
+
+
+void AddTargetDialog::accept()
+{
+ QString name = filename_edit->text().stripWhiteSpace();
+ QString prefix = prefix_combo->currentText();
+
+ QString primary;
+ switch (primary_combo->currentItem()) {
+ case 0: primary = "PROGRAMS"; break;
+ case 1: primary = "LIBRARIES"; break;
+ case 2: primary = "LTLIBRARIES"; break;
+ case 3: primary = "SCRIPTS"; break;
+ case 4: primary = "HEADERS"; break;
+ case 5: primary = "DATA"; break;
+ case 6: primary = "JAVA"; break;
+ default: ;
+ }
+
+ if (name.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to give the target a name"));
+ return;
+ }
+
+#if 0
+ if (primary == "LIBRARIES" && !name.startsWith("lib")) {
+ KMessageBox::sorry(this, i18n("Libraries must have a lib prefix."));
+ return;
+ }
+
+ if (primary == "LTLIBRARIES" && !name.startsWith("lib")) {
+ KMessageBox::sorry(this, i18n("Libtool libraries must have a lib prefix."));
+ return;
+ }
+
+ if (primary == "LTLIBRARIES" && name.right(3) != ".la") {
+ KMessageBox::sorry(this, i18n("Libtool libraries must have a .la suffix."));
+ return;
+ }
+
+#endif
+
+ if( primary.endsWith("LIBRARIES") && !name.startsWith("lib") && !module_box->isChecked() )
+ name.prepend( QString::fromLatin1("lib") );
+
+ if( primary == "LTLIBRARIES" && !name.endsWith(".la") )
+ name.append( QString::fromLatin1(".la") );
+
+ if ( primary == "LIBRARIES" && !name.endsWith(".a") )
+ name.append ( QString::fromLatin1(".a") );
+
+ QPtrListIterator<TargetItem> it(m_subproject->targets);
+ for (; it.current(); ++it)
+ if (name == (*it)->name) {
+ KMessageBox::sorry(this, i18n("A target with this name already exists."));
+ return;
+ }
+
+ QStringList flagslist;
+ if (primary == "LTLIBRARIES") {
+ if (allstatic_box->isChecked())
+ flagslist.append("-all-static");
+ if (avoidversion_box->isChecked())
+ flagslist.append("-avoid-version");
+ if (module_box->isChecked())
+ flagslist.append("-module");
+ if (noundefined_box->isChecked())
+ flagslist.append("-no-undefined");
+ }
+ flagslist.append(ldflagsother_edit->text());
+ QString ldflags = flagslist.join( " " );
+
+ TargetItem *titem = m_widget->createTargetItem(name, prefix, primary, false);
+ // m_detailsView->insertItem ( titem );
+ m_subproject->targets.append(titem);
+
+ QString canonname = AutoProjectTool::canonicalize(name);
+
+ QMap<QString,QString> replaceMap;
+
+ if( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" || primary == "DATA" ){
+ QString varname = prefix + "_" + primary;
+ m_subproject->variables[varname] += (" " + name);
+ replaceMap.insert(varname, m_subproject->variables[varname]);
+ if ( primary != "DATA" ){
+ replaceMap.insert(canonname + "_SOURCES", "");
+ }
+ }
+ if (primary == "LTLIBRARIES" || primary == "PROGRAMS")
+ replaceMap.insert(canonname + "_LDFLAGS", ldflags);
+
+ AutoProjectTool::addToMakefileam(m_subproject->path + "/Makefile.am", replaceMap);
+
+ QDialog::accept();
+}
+
+void AddTargetDialog::slotFileNameChanged ( const QString& text )
+{
+ canonicalLabel->setText ( AutoProjectTool::canonicalize ( text ) );
+}
+
+#include "addtargetdlg.moc"
diff --git a/buildtools/autotools/addtargetdlg.h b/buildtools/autotools/addtargetdlg.h
new file mode 100644
index 00000000..98708531
--- /dev/null
+++ b/buildtools/autotools/addtargetdlg.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDTARGETDLG_H_
+#define _ADDTARGETDLG_H_
+
+#include "addtargetdlgbase.h"
+
+class AutoDetailsView;
+class AutoProjectWidget;
+class SubprojectItem;
+
+
+class AddTargetDialog : public AddTargetDialogBase
+{
+ Q_OBJECT
+
+public:
+ AddTargetDialog( AutoProjectWidget *widget, SubprojectItem *item,
+ QWidget *parent = 0, const char *name = 0 );
+ ~AddTargetDialog();
+
+protected slots:
+ virtual void slotFileNameChanged ( const QString& );
+
+private:
+ virtual void primaryChanged();
+ virtual void accept();
+
+ SubprojectItem *m_subproject;
+ AutoProjectWidget *m_widget;
+ AutoDetailsView* m_detailsView;
+};
+
+#endif
diff --git a/buildtools/autotools/addtargetdlgbase.ui b/buildtools/autotools/addtargetdlgbase.ui
new file mode 100644
index 00000000..25687563
--- /dev/null
+++ b/buildtools/autotools/addtargetdlgbase.ui
@@ -0,0 +1,348 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddTargetDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>add_target_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>585</width>
+ <height>356</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add New Target</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>primary_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Primary:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>primary_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>primary_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>prefix_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Pre&amp;fix:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>prefix_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>prefix_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>filename_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>File &amp;name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer21</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>246</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KSqueezedTextLabel" row="2" column="3">
+ <property name="name">
+ <cstring>canonicalLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[CANONICALIZED NAME]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer22</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>ldflags_group</cstring>
+ </property>
+ <property name="title">
+ <string>Linker Flags (&amp;LDFLAGS)</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>allstatic_box</cstring>
+ </property>
+ <property name="text">
+ <string>Do not link against shared libraries (-all-static)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>avoidversion_box</cstring>
+ </property>
+ <property name="text">
+ <string>Do not assign version numbers to libraries (-avoid-version)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>module_box</cstring>
+ </property>
+ <property name="text">
+ <string>Create a library that can be dynamically loaded (-module)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>noundefined_box</cstring>
+ </property>
+ <property name="text">
+ <string>Library does not depend on external symbols (-no-undefined)</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout11_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>ldflagsother_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Ot&amp;her:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ldflagsother_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>ldflagsother_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="394">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022230543251d2e253d856405bffcbc54105b19c856360003b0141ac02ba68c4d4c199b98323631656c62cad8c494891423ce0ee2dc4c6418208bd55a7301009c7f45ef</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_target_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_target_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>primary_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>add_target_dialog</receiver>
+ <slot>primaryChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>primary_combo</tabstop>
+ <tabstop>prefix_combo</tabstop>
+ <tabstop>filename_edit</tabstop>
+ <tabstop>allstatic_box</tabstop>
+ <tabstop>avoidversion_box</tabstop>
+ <tabstop>module_box</tabstop>
+ <tabstop>noundefined_box</tabstop>
+ <tabstop>ldflagsother_edit</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">primaryChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>ksqueezedtextlabel.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/addtranslationdlg.cpp b/buildtools/autotools/addtranslationdlg.cpp
new file mode 100644
index 00000000..993dee7d
--- /dev/null
+++ b/buildtools/autotools/addtranslationdlg.cpp
@@ -0,0 +1,109 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "addtranslationdlg.h"
+
+#include <qcombobox.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qstrlist.h>
+#include <kbuttonbox.h>
+#include <kdialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "misc.h"
+#include "autoprojectpart.h"
+
+
+AddTranslationDialog::AddTranslationDialog(AutoProjectPart *part, QWidget *parent, const char *name)
+ : QDialog(parent, name, true)
+{
+ setCaption(i18n("Add Translation"));
+
+ m_part = part;
+
+ QHBox *hbox = new QHBox(this);
+ (void) new QLabel(i18n("Language:"), hbox);
+ lang_combo = new QComboBox(hbox);
+
+ QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->addWidget(hbox);
+
+ QFrame *frame = new QFrame(this);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addWidget(frame, 0);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ QPushButton *ok_button = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel_button = buttonbox->addButton(KStdGuiItem::cancel());
+ ok_button->setDefault(true);
+ connect( ok_button, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancel_button, SIGNAL(clicked()), this, SLOT(reject()) );
+ buttonbox->layout();
+ layout->addWidget(buttonbox, 0);
+
+ QStringList rawlist, list;
+ rawlist << "af" << "ar" << "bg" << "bo" << "br" << "bs" << "ca" << "cs" << "cy" << "da"
+ << "de" << "el" << "en_GB" << "eo" << "es" << "et" << "eu" << "fi" << "fr";
+ rawlist << "ga" << "gl" << "gu" << "he" << "hi" << "hu" << "id" << "is" << "it" << "ja"
+ << "km" << "ko" << "lt" << "lv" << "mi" << "mk" << "mr" << "nl" << "no" << "no_NY";
+ rawlist << "oc" << "pl" << "pt" << "pt_BR" << "ro" << "ru" << "sk" << "sl" << "sr" << "sv"
+ << "ta" << "th" << "tr" << "uk" << "wa" << "zh_CN.GB2312" << "zh_TW.Big5";
+
+ // Remove already added languages
+ QStringList::ConstIterator it;
+ for (it = rawlist.begin(); it != rawlist.end(); ++it) {
+ QFileInfo fi(m_part->projectDirectory() + "/po/" + (*it) + ".po");
+ if (!fi.exists())
+ list.append(*it);
+ }
+
+ if (list.isEmpty()) {
+ KMessageBox::information(this, i18n("Your sourcecode is already translated to all supported languages."));
+ ok_button->setEnabled(false);
+ }
+ lang_combo->insertStringList(list);
+}
+
+
+AddTranslationDialog::~AddTranslationDialog()
+{}
+
+
+void AddTranslationDialog::accept()
+{
+ QString dir = m_part->projectDirectory() + "/po";
+ QString fileName = dir + "/" + lang_combo->currentText() + ".po";
+
+ QFile f(fileName);
+ if (f.exists()) {
+ KMessageBox::information(this, i18n("A translation file for the language %1 exists already."));
+ return;
+ }
+ f.open(IO_WriteOnly);
+ f.close();
+
+ dir = m_part->buildDirectory() + "/po";
+ m_part->startMakeCommand(dir, QString::fromLatin1("force-reedit"));
+
+ QDialog::accept();
+}
+
+#include "addtranslationdlg.moc"
diff --git a/buildtools/autotools/addtranslationdlg.h b/buildtools/autotools/addtranslationdlg.h
new file mode 100644
index 00000000..cd14ddf2
--- /dev/null
+++ b/buildtools/autotools/addtranslationdlg.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+* Copyright (C) 1999 by Sandy Meier *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _ADDTRANSLATIONDLG_H_
+#define _ADDTRANSLATIONDLG_H_
+
+#include <qdialog.h>
+
+class QComboBox;
+class AutoProjectPart;
+
+
+class AddTranslationDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AddTranslationDialog( AutoProjectPart *part, QWidget *parent = 0, const char *name = 0 );
+ ~AddTranslationDialog();
+
+private:
+ virtual void accept();
+
+ QComboBox *lang_combo;
+ AutoProjectPart *m_part;
+};
+
+#endif
diff --git a/buildtools/autotools/autodetailsview.cpp b/buildtools/autotools/autodetailsview.cpp
new file mode 100644
index 00000000..26255fd3
--- /dev/null
+++ b/buildtools/autotools/autodetailsview.cpp
@@ -0,0 +1,728 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************
+*/
+
+#include "autodetailsview.h"
+
+/** Qt */
+#include <qregexp.h>
+#include <qlistview.h>
+#include <qwidget.h>
+#include <qheader.h>
+#include <qlayout.h>
+
+ /** KDE Libs */
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kpopupmenu.h>
+
+/** KDevelop */
+#include "kdevappfrontend.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "kdevcreatefile.h"
+#include "kdevlanguagesupport.h"
+#include "kdevmakefrontend.h"
+#include "urlutil.h"
+
+#include "domutil.h"
+
+#include "targetoptionsdlg.h"
+#include "addfiledlg.h"
+#include "addicondlg.h"
+#include "addexistingfilesdlg.h"
+#include "removefiledlg.h"
+#include "removetargetdlg.h"
+
+#include "autolistviewitems.h"
+#include "autotoolsaction.h"
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+
+#include "subclassesdlg.h"
+
+AutoDetailsView::AutoDetailsView(AutoProjectWidget* widget, AutoProjectPart* part, QWidget *parent, const char *name)
+ : AutoProjectViewBase(parent, name)
+{
+ m_widget = widget;
+ m_part = part;
+
+ initActions();
+ QDomDocument dom = *(m_part->projectDom());
+ m_subclasslist = DomUtil::readPairListEntry(dom, "/kdevautoproject/subclassing",
+ "subclass","sourcefile", "uifile");
+
+ m_listView->setAllColumnsShowFocus( true );
+ m_listView->setRootIsDecorated( true );
+ m_listView->setResizeMode( QListView::LastColumn );
+ m_listView->addColumn( QString::null );
+ m_listView->header()->hide();
+ targetOptionsAction->setEnabled( false );
+ addNewFileAction->setEnabled( false );
+ addExistingFileAction->setEnabled( false );
+ buildTargetAction->setEnabled( false );
+ executeTargetAction->setEnabled( false );
+ removeDetailAction->setEnabled(false);
+ connect( m_listView, SIGNAL( selectionChanged( QListViewItem* ) ),
+ this, SLOT( slotSelectionChanged( QListViewItem* ) ) );
+ connect( m_listView, SIGNAL( selectionChanged() ),
+ this, SLOT( slotSelectionChanged( ) ) );
+}
+
+
+AutoDetailsView::~AutoDetailsView()
+{
+}
+
+/**
+ * If nothing selected, disable all the icons.
+ */
+void AutoDetailsView::slotSelectionChanged( ){
+
+ if ( m_listView->selectedItems().isEmpty()){
+ targetOptionsAction->setEnabled( false );
+ addNewFileAction->setEnabled( false );
+ addExistingFileAction->setEnabled( false );
+ buildTargetAction->setEnabled( false );
+ executeTargetAction->setEnabled( false );
+ removeDetailAction->setEnabled(false);
+ }
+}
+
+/**
+ * Change the enabled icons depending on what is selected.
+ * This is never called if nothing is selected..
+ * @param item
+ */
+void AutoDetailsView::slotSelectionChanged( QListViewItem* item )
+{
+ bool isTarget = false;
+ bool isRegularTarget = false;
+ bool isFile = false;
+ bool isProgram = false;
+
+ if ( item )
+ {
+ // We assume here that ALL items in the detail list view
+ // are ProjectItem's
+ ProjectItem * pvitem = static_cast<ProjectItem*>( item );
+ TargetItem* titem = 0;
+
+ if ( pvitem->type() == ProjectItem::File )
+ {
+ titem = static_cast <TargetItem*> ( pvitem->parent() );
+
+ QString primary = titem->primary;
+ if ( primary == "PROGRAMS" || primary == "LIBRARIES" ||
+ primary == "LTLIBRARIES" || primary == "JAVA" )
+ {
+ isRegularTarget = true; // not a data group
+ isFile = true;
+ }
+ }
+ else
+ {
+ titem = static_cast <TargetItem*> ( pvitem );
+ isTarget = true;
+ }
+
+ QString primary = titem->primary;
+ if ( primary == "PROGRAMS" || primary == "LIBRARIES" ||
+ primary == "LTLIBRARIES" || primary == "JAVA" )
+ {
+ isRegularTarget = true; // not a data group
+ }
+
+ if ( primary == "PROGRAMS" )
+ isProgram = true;
+ }
+
+ targetOptionsAction->setEnabled( isRegularTarget && !isFile );
+ addNewFileAction->setEnabled( isTarget );
+ addExistingFileAction->setEnabled( isTarget );
+ removeDetailAction->setEnabled ( true );
+
+ if ( isRegularTarget && isFile || isRegularTarget )
+ {
+ buildTargetAction->setEnabled ( true );
+ if( isProgram )
+ executeTargetAction->setEnabled ( true );
+ }
+ else
+ {
+ buildTargetAction->setEnabled ( false );
+ executeTargetAction->setEnabled ( false );
+ }
+ emit selectionChanged( item );
+}
+
+void AutoDetailsView::initActions()
+{
+ KActionCollection * actions = new KActionCollection( this );
+
+ targetOptionsAction = new AutoToolsAction( i18n( "Options..." ), "configure", 0,
+ this, SLOT( slotTargetOptions() ), actions,
+ "target options" );
+ targetOptionsAction->setWhatsThis(i18n("<b>Options</b><p>Target options dialog that "
+ "provides settings for linker flags and lists "
+ "of dependencies and external libraries that "
+ "are used when compiling the target."));
+ targetOptionsAction->plug( m_optionsButton );
+ targetOptionsAction->setEnabled( false );
+
+ QToolTip::add( m_button1, tr2i18n( "Create New File..." ) );
+ addNewFileAction = new AutoToolsAction( i18n( "Create New File..." ), "filenew", 0,
+ this, SLOT( slotAddNewFile() ), actions,
+ "add new file" );
+ addNewFileAction->setWhatsThis(i18n("<b>Create new file</b><p>Creates a new file and "
+ "adds it to a currently selected target."));
+ addNewFileAction->plug( m_button1 );
+ addNewFileAction->setEnabled( false );
+
+ QToolTip::add( m_button2, tr2i18n( "Add Existing Files..." ) );
+ addExistingFileAction = new AutoToolsAction( i18n( "Add Existing Files..." ), "fileimport", 0,
+ this, SLOT( slotAddExistingFile() ), actions,
+ "add existing file" );
+ addExistingFileAction->setWhatsThis(i18n("<b>Add existing files</b><p>Adds existing "
+ "file to a currently selected target. Header "
+ "files will not be included in SOURCES list "
+ "of a target. They will be added to "
+ "noinst_HEADERS instead."));
+ addExistingFileAction->plug( m_button2 );
+ addExistingFileAction->setEnabled( false );
+
+ addIconAction = new KAction( i18n( "Add Icon..." ), "iconadd_kdevelop", 0,
+ this, SLOT( slotAddIcon() ), actions, "add icon" );
+ addIconAction->setWhatsThis(i18n("<b>Add icon</b><p>Adds an icon to a KDEICON target."));
+
+ QToolTip::add( m_button4, tr2i18n( "Build Target"));
+ buildTargetAction = new AutoToolsAction( i18n( "Build Target..." ), "launch", 0,
+ this, SLOT( slotBuildTarget() ), actions,
+ "build target" );
+ buildTargetAction->setWhatsThis(i18n("<b>Build target</b><p>Constructs a series of "
+ "make commands to build the selected target. "
+ "Also builds dependent targets."));
+ buildTargetAction->plug( m_button4 );
+ buildTargetAction->setEnabled( false );
+
+ QToolTip::add( m_button5, tr2i18n( "Execute Target..."));
+ executeTargetAction = new AutoToolsAction( i18n( "Execute Target..." ), "exec", 0,
+ this, SLOT( slotExecuteTarget() ), actions,
+ "execute target" );
+ executeTargetAction->setWhatsThis(i18n("<b>Execute target</b><p>Executes the target "
+ "and tries to build in case it is not built."));
+ executeTargetAction->plug( m_button5 );
+ executeTargetAction->setEnabled( false );
+
+ setActiveTargetAction = new KAction( i18n( "Make Target Active" ), "", 0,
+ this, SLOT( slotSetActiveTarget() ), actions,
+ "set active target" );
+ setActiveTargetAction->setWhatsThis(i18n("<b>Make target active</b><p>Marks the "
+ "currently selected target as 'active'. New "
+ "files and classes by default go to an active "
+ "target. "
+ "Using the <b>Build Active Target</b> menu "
+ "command builds it."));
+
+ QToolTip::add( m_button3, tr2i18n( "Remove"));
+ removeDetailAction = new AutoToolsAction( i18n( "Remove" ), "editdelete", 0, this,
+ SLOT( slotRemoveDetail() ), actions,
+ "remove detail" );
+ removeDetailAction->setWhatsThis(i18n("<b>Remove</b><p>Shows a list of targets "
+ "dependent on the selected target or file and "
+ "asks for removal. Also asks if the target or "
+ "file should be removed from disk."));
+ removeDetailAction->plug( m_button3 );
+ removeDetailAction->setEnabled( false );
+
+ connect( m_listView, SIGNAL( executed( QListViewItem* ) ),
+ this, SLOT( slotDetailsExecuted( QListViewItem* ) ) );
+ connect( m_listView, SIGNAL( returnPressed( QListViewItem* ) ),
+ this, SLOT( slotDetailsExecuted( QListViewItem* ) ) );
+ connect( m_listView, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
+ this, SLOT( slotDetailsContextMenu( KListView*, QListViewItem*, const QPoint& ) ) );
+}
+
+QString AutoDetailsView::getUiFileLink(const QString& relpath, const QString& filename)
+{
+ DomUtil::PairList::iterator it;
+
+ for (it=m_subclasslist.begin(); it != m_subclasslist.end(); ++it)
+ {
+ if ((*it).first == QString("/")+relpath+filename)
+ return (*it).second;
+ }
+
+ return QString::null;
+}
+
+void AutoDetailsView::slotTargetOptions()
+{
+ kdDebug( 9020 ) << "AutoDetailsView::slotTargetOptions()" << endl;
+ TargetItem *titem = dynamic_cast <TargetItem*> ( m_listView->selectedItem() );
+
+ if ( !titem )
+ return;
+
+ TargetOptionsDialog dlg( m_widget, titem, this, "target options dialog" );
+
+ dlg.setCaption ( i18n ( "Target Options for '%1'" ).arg ( titem->name ) );
+
+ dlg.exec();
+}
+
+
+void AutoDetailsView::slotAddNewFile()
+{
+ TargetItem * titem = dynamic_cast <TargetItem*> ( m_listView->selectedItem() );
+ if ( !titem )
+ return;
+
+ KDevCreateFile * createFileSupport = m_part->extension<KDevCreateFile>("KDevelop/CreateFile");
+ if (createFileSupport)
+ {
+ KDevCreateFile::CreatedFile crFile =
+ createFileSupport->createNewFile(QString::null,
+ m_widget->selectedSubproject()->path);
+/* if (crFile.status == KDevCreateFile::CreatedFile::STATUS_OK)
+ {
+ FileItem *fitem = m_widget->createFileItem(crFile.filename, m_widget->selectedSubproject());
+ titem->sources.append(fitem);
+ titem->insertItem(fitem);
+ emit selectionChanged( titem ); // update list view
+ }*/
+ } else {
+ AddFileDialog dlg( m_part, m_widget, m_widget->selectedSubproject(), titem,
+ this, "add file dialog" );
+ QString caption;
+ if ( titem->name.isEmpty() )
+ caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix );
+ else
+ caption = titem->name;
+
+ dlg.setCaption ( i18n ( "Add New File to '%1'" ).arg ( caption ) );
+
+ if ( dlg.exec() )
+ emit selectionChanged( titem ); // update list view
+ }
+}
+
+
+void AutoDetailsView::slotAddExistingFile()
+{
+ TargetItem * titem = dynamic_cast <TargetItem*> ( m_listView->selectedItem() );
+ if ( !titem )
+ return;
+
+ AddExistingFilesDialog dlg( m_part, m_widget, m_widget->selectedSubproject(), titem,
+ this, "add existing files" );
+ QString caption;
+ if ( titem->name.isEmpty() )
+ caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix );
+ else
+ caption = titem->name;
+
+ dlg.setCaption( i18n( "Add Existing Files to '%1'" ).arg ( caption ) );
+
+ dlg.exec();
+}
+
+
+void AutoDetailsView::slotAddIcon()
+{
+ TargetItem * titem = dynamic_cast <TargetItem*> ( m_listView->selectedItem() );
+ if ( !titem )
+ return ;
+
+ AddIconDialog dlg( m_part, m_widget, m_widget->selectedSubproject(), titem,
+ this, "add icon" );
+ dlg.exec();
+}
+
+
+void AutoDetailsView::slotBuildTarget()
+{
+ ProjectItem * pvitem = dynamic_cast<ProjectItem*>( m_listView->selectedItem() );
+ if ( !pvitem )
+ return;
+
+ TargetItem* titem = 0;
+
+ if ( pvitem->type() == ProjectItem::File )
+ titem = static_cast <TargetItem*> ( pvitem->parent() );
+ else
+ titem = static_cast <TargetItem*> ( m_listView->selectedItem() );
+
+ QString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_widget->selectedSubproject()->relativePath();
+
+ m_part->buildTarget(relpath, titem);
+}
+
+void AutoDetailsView::slotExecuteTarget()
+{
+ ProjectItem * pvitem = dynamic_cast<ProjectItem*>( m_listView->selectedItem() );
+ if ( !pvitem )
+ return;
+
+ TargetItem* titem = 0;
+
+ if ( pvitem->type() == ProjectItem::File )
+ titem = static_cast <TargetItem*> ( pvitem->parent() );
+ else
+ titem = static_cast <TargetItem*> ( m_listView->selectedItem() );
+
+ QString relpath = URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + m_part->activeDirectory();
+ m_part->executeTarget(QDir( DomUtil::readEntry( *m_part->projectDom(), "/kdevautoproject/run/cwd/"+titem->name )), titem);
+}
+
+void AutoDetailsView::slotRemoveDetail()
+{
+ ProjectItem * pvitem = dynamic_cast<ProjectItem*>( m_listView->selectedItem() );
+
+ if ( pvitem && ( pvitem->type() == ProjectItem::File ) )
+ {
+ FileItem * fitem = static_cast <FileItem*> ( m_listView->selectedItem() );
+ if(fitem && fitem->is_subst)
+ {
+ fitem->changeMakefileEntry("");
+ return;
+ }
+
+ QListViewItem* sibling = fitem->nextSibling();
+
+ if ( !fitem )
+ return;
+
+ TargetItem *titem = static_cast<TargetItem*>( fitem->parent() );
+
+ RemoveFileDialog dlg( m_widget, m_part, m_widget->selectedSubproject(),
+ titem, fitem->text( 0 ), this, "remove file dialog" );
+
+ QString caption;
+ if ( titem->name.isEmpty() )
+ caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix );
+ else
+ caption = titem->name;
+
+ dlg.setCaption ( i18n ( "Remove File From '%1'" ).arg ( caption ) );
+
+ if ( dlg.exec() )
+ {
+ emit selectionChanged( titem );
+
+ if ( sibling)
+ {
+ m_listView->setSelected ( sibling, true );
+ m_listView->ensureItemVisible ( sibling );
+ }
+ }
+
+ return;
+ }
+
+ if ( pvitem && ( pvitem->type() == ProjectItem::Target ) )
+ {
+ TargetItem* titem = static_cast <TargetItem*> ( m_listView->selectedItem() );
+ QListViewItem* sibling = titem->nextSibling();
+
+ if ( !titem ) return;
+
+ bool isactive = ( titem == m_widget->activeTarget() );
+ RemoveTargetDialog dlg ( m_widget, m_part, m_widget->selectedSubproject(),
+ titem, this, "remove target dialog" );
+
+ dlg.setCaption ( i18n ( "Remove Target From '%1'" ).arg ( m_widget->selectedSubproject()->subdir ) );
+
+ if ( dlg.exec() )
+ {
+ //details->takeItem ( titem );
+
+ m_widget->slotOverviewSelectionChanged ( m_widget->selectedSubproject() );
+
+ if( isactive )
+ m_widget->setActiveTarget("");
+ if ( sibling)
+ {
+ m_listView->setSelected ( sibling, true );
+ m_listView->ensureItemVisible ( sibling );
+ }
+ }
+
+ return;
+ }
+}
+
+
+void AutoDetailsView::slotDetailsContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ if ( !item )
+ return;
+
+ ProjectItem *pvitem = dynamic_cast<ProjectItem*>( item );
+ if ( !pvitem )
+ {
+ kdDebug(9020) << k_funcinfo << "Cast to type of ProjectItem* failed."
+ << "Details context menu will be empty!";
+ return;
+ }
+
+ if ( pvitem->type() == ProjectItem::Target )
+ {
+
+ TargetItem * titem = dynamic_cast<TargetItem*>( pvitem );
+ if ( !titem )
+ {
+ kdDebug(9020) << k_funcinfo << "Unable to populate target item menu"
+ << " due to failed cast. " << endl;
+ return;
+ }
+
+ QString caption;
+ if ( titem->name.isEmpty() )
+ caption = i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix );
+ else
+ caption = titem->name;
+
+ KPopupMenu popup( i18n( "Target: %1" ).arg( caption ), this );
+
+ if ( titem->primary == "PROGRAMS" || titem->primary == "LIBRARIES"
+ || titem->primary == "LTLIBRARIES" || titem->primary == "JAVA" )
+ {
+ targetOptionsAction->plug( &popup );
+ popup.insertSeparator();
+ addNewFileAction->plug( &popup );
+ addExistingFileAction->plug( &popup );
+ popup.insertSeparator();
+ removeDetailAction->plug( &popup );
+ popup.insertSeparator();
+ setActiveTargetAction->plug( &popup );
+ popup.insertSeparator();
+ buildTargetAction->plug( &popup );
+ if( titem->primary == "PROGRAMS")
+ executeTargetAction->plug( &popup );
+ }
+ else if ( titem->primary == "KDEDOCS" )
+ {
+ addNewFileAction->plug( &popup );
+ addExistingFileAction->plug( &popup );
+ popup.insertSeparator();
+ removeDetailAction->plug( &popup );
+ popup.insertSeparator();
+ buildTargetAction->plug( &popup );
+ }
+ else if ( titem->primary == "KDEICON" )
+ {
+ addIconAction->plug( &popup );
+ popup.insertSeparator();
+ removeDetailAction->plug( &popup );
+ }
+ else
+ {
+ addNewFileAction->plug( &popup );
+ addExistingFileAction->plug( &popup );
+ popup.insertSeparator();
+ removeDetailAction->plug( &popup );
+ }
+
+ popup.exec( p );
+
+ }
+ else if ( pvitem->type() == ProjectItem::File )
+ {
+
+ FileItem * fitem = dynamic_cast<FileItem*>( pvitem );
+ if ( !fitem )
+ {
+ kdDebug(9020) << k_funcinfo << "Unable to populate file item menu"
+ << " due to failed cast. " << endl;
+ return;
+ }
+
+ KPopupMenu popup( i18n( "File: %1" ).arg( fitem->name ), this );
+
+ removeDetailAction->plug( &popup );
+ KURL::List urls;
+ urls.append(m_widget->selectedSubproject()->path + "/" + fitem->name);
+ FileContext context(urls);
+
+ int idSubclassWidget = popup.insertItem(SmallIconSet("qmake_subclass"),
+ i18n("Subclassing Wizard...") );
+ popup.setWhatsThis(idSubclassWidget, i18n("<b>Subclass widget</b><p>Launches "
+ "<b>Subclassing</b> wizard. "
+ "It allows to create a subclass from the "
+ "class defined in .ui file. "
+ "There is also possibility to implement "
+ "slots and functions defined in the base "
+ "class."));
+ int idUISubclasses = popup.insertItem(SmallIconSet("qmake_subclass"),
+ i18n("List of Subclasses..."));
+ popup.setWhatsThis(idUISubclasses, i18n("<b>List of subclasses</b><p>Shows "
+ "subclasses list editor. "
+ "There is possibility to add or remove "
+ "subclasses from the list."));
+ int idUpdateWidgetclass = popup.insertItem(SmallIconSet("qmake_subclass"),
+ i18n("Edit ui-Subclass..."));
+ popup.setWhatsThis(idUpdateWidgetclass, i18n("<b>Edit ui-subclass</b><p>Launches "
+ "<b>Subclassing</b> wizard and prompts "
+ "to implement missing in childclass "
+ "slots and functions."));
+ int idViewUIH = popup.insertItem(SmallIconSet("qmake_ui_h"),
+ i18n("Open ui.h File"));
+ popup.setWhatsThis(idViewUIH, i18n("<b>Open ui.h file</b><p>Opens .ui.h file "
+ "associated with the selected .ui."));
+
+ if (!fitem->name.contains(QRegExp("ui$")) || fitem->is_subst == true)
+ {
+ popup.removeItem(idUISubclasses);
+ popup.removeItem(idViewUIH);
+ popup.removeItem(idSubclassWidget);
+ }
+
+ if (fitem->uiFileLink.isEmpty())
+ popup.removeItem(idUpdateWidgetclass);
+
+ if(fitem->is_subst == false)
+ m_part->core()->fillContextMenu( &popup, &context );
+
+ int r = popup.exec( p );
+
+ if(r == idViewUIH)
+ {
+ m_part->partController()->editDocument(KURL(m_widget->selectedSubproject()->path
+ + "/" + QString(fitem->name + ".h")));
+ }
+ else if (r == idSubclassWidget)
+ {
+ QStringList newFileNames;
+ newFileNames = m_part->languageSupport()->subclassWidget(m_widget->selectedSubproject()->path + "/" + fitem->name);
+ if (!newFileNames.empty())
+ {
+ QDomDocument &dom = *(m_part->projectDom());
+ for (uint i=0; i<newFileNames.count(); i++)
+ {
+ QString srcfile_relpath = newFileNames[i];
+ srcfile_relpath.remove(0,m_part->projectDirectory().length());
+ QString uifile_relpath = QString(m_widget->selectedSubproject()->path + "/" + fitem->name).remove(0,m_part->projectDirectory().length());
+ DomUtil::PairList list = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing",
+ "subclass","sourcefile", "uifile");
+
+ list << DomUtil::Pair(srcfile_relpath,uifile_relpath);
+ DomUtil::writePairListEntry(dom, "/kdevautoproject/subclassing",
+ "subclass", "sourcefile", "uifile", list);
+ newFileNames[i] = newFileNames[i].replace(QRegExp(m_part->projectDirectory()+"/"),"");
+ }
+ m_subclasslist = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing",
+ "subclass","sourcefile", "uifile");
+ m_part->addFiles(newFileNames);
+ }
+ }
+ else if (r == idUpdateWidgetclass)
+ {
+ QString noext = m_widget->selectedSubproject()->path + "/" + fitem->name;
+
+ if (noext.findRev('.')>-1)
+ noext = noext.left(noext.findRev('.'));
+
+ QStringList dummy;
+ QString uifile = fitem->uiFileLink;
+
+ if (uifile.findRev('/')>-1)
+ {
+ QStringList uisplit = QStringList::split('/',uifile);
+ uifile=uisplit[uisplit.count()-1];
+ }
+
+ m_part->languageSupport()->updateWidget(m_widget->selectedSubproject()->path
+ + "/" + uifile, noext);
+ }
+ else if (r == idUISubclasses)
+ {
+ QDomDocument &dom = *(m_part->projectDom());
+ DomUtil::PairList list = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing",
+ "subclass","sourcefile", "uifile");
+ SubclassesDlg *sbdlg = new SubclassesDlg( QString(m_widget->selectedSubproject()->path + "/" +fitem->name).remove(0,m_part->projectDirectory().length()),
+ list, m_part->projectDirectory());
+
+ if (sbdlg->exec())
+ {
+ QDomElement el = DomUtil::elementByPath( dom, "/kdevautoproject");
+ QDomElement el2 = DomUtil::elementByPath( dom, "/kdevautoproject/subclassing");
+ if ( (!el.isNull()) && (!el2.isNull()) )
+ {
+ el.removeChild(el2);
+ }
+
+ DomUtil::writePairListEntry(dom, "/kdevautoproject/subclassing", "subclass",
+ "sourcefile", "uifile", list);
+
+ m_subclasslist = DomUtil::readPairListEntry(dom,"/kdevautoproject/subclassing",
+ "subclass","sourcefile", "uifile");
+ }
+ }
+ }
+}
+
+
+void AutoDetailsView::slotDetailsExecuted( QListViewItem *item )
+{
+ if ( !item )
+ return ;
+
+ ProjectItem *pvitem = static_cast<ProjectItem*>( item );
+ if ( pvitem->type() != ProjectItem::File )
+ return ;
+
+ if ( !m_widget->selectedSubproject() )
+ return;
+
+ QString dirName = m_widget->selectedSubproject()->path;
+ FileItem *fitem = static_cast<FileItem*>( item );
+ if(fitem->is_subst)
+ {
+ fitem->changeSubstitution();
+ return;
+ }
+
+ m_part->partController()->editDocument( KURL( dirName + "/" + fitem->name ) );
+}
+
+void AutoDetailsView::slotSetActiveTarget()
+{
+ TargetItem * titem = static_cast<TargetItem*>( m_listView->selectedItem() );
+ if ( !titem ) return ;
+
+ SubprojectItem * subpitem = m_widget->selectedSubproject();
+ if ( !subpitem ) return;
+
+ QString targetPath = subpitem->path + "/" + titem->name;
+ targetPath = targetPath.mid( m_part->projectDirectory().length() + 1 );
+ kdDebug( 9020 ) << "Setting active " << targetPath << endl;
+ m_widget->setActiveTarget( targetPath );
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::writeEntry( dom, "/kdevautoproject/general/activetarget", targetPath );
+}
+
+void AutoDetailsView::focusOutEvent(QFocusEvent */*e*/)
+{
+ m_widget->setLastFocusedView(AutoProjectWidget::DetailsView);
+}
+
+#include "autodetailsview.moc"
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/buildtools/autotools/autodetailsview.h b/buildtools/autotools/autodetailsview.h
new file mode 100644
index 00000000..ee67558d
--- /dev/null
+++ b/buildtools/autotools/autodetailsview.h
@@ -0,0 +1,88 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+
+#ifndef AUTODETAILSVIEW_H
+#define AUTODETAILSVIEW_H
+
+#include "autoprojectviewbase.h"
+
+#include "domutil.h"
+#include "autolistviewitems.h"
+
+class KAction;
+
+class AutoProjectPart;
+class AutoProjectWidget;
+class AutoToolsAction;
+
+class AutoDetailsView : protected AutoProjectViewBase
+{
+ friend class RemoveFileDialog;
+ friend class FileItem;
+ Q_OBJECT
+
+public:
+ AutoDetailsView( AutoProjectWidget* widget, AutoProjectPart* part, QWidget *parent, const char *name );
+ virtual ~AutoDetailsView();
+
+ QString getUiFileLink( const QString &path, const QString& filename );
+ KListView* listView()
+ {
+ return m_listView;
+ }
+
+public slots:
+ void slotSelectionChanged( QListViewItem* item );
+ void slotSelectionChanged();
+
+signals:
+ void selectionChanged( QListViewItem* );
+
+protected:
+ void initActions ();
+ virtual void focusOutEvent( QFocusEvent *e );
+
+private slots:
+ void slotDetailsExecuted( QListViewItem *item );
+ void slotDetailsContextMenu( KListView *, QListViewItem *item, const QPoint &p );
+
+ void slotTargetOptions ();
+ void slotAddNewFile();
+ void slotAddExistingFile();
+ void slotAddIcon();
+ void slotBuildTarget();
+ void slotExecuteTarget();
+ void slotRemoveDetail();
+ void slotSetActiveTarget();
+
+private:
+ AutoProjectWidget* m_widget;
+ AutoProjectPart* m_part;
+
+ DomUtil::PairList m_subclasslist;
+
+ AutoToolsAction* targetOptionsAction;
+ AutoToolsAction* addNewFileAction;
+ AutoToolsAction* addExistingFileAction;
+ KAction* addIconAction;
+ AutoToolsAction* buildTargetAction;
+ AutoToolsAction* executeTargetAction;
+ KAction* setActiveTargetAction;
+ AutoToolsAction* removeDetailAction;
+
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/autolistviewitems.cpp b/buildtools/autotools/autolistviewitems.cpp
new file mode 100644
index 00000000..454d12f5
--- /dev/null
+++ b/buildtools/autotools/autolistviewitems.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* Copyright (C) 2002 by Victor Rder *
+* victor_roeder@gmx.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 <qpainter.h>
+#include <qinputdialog.h>
+#include <qregexp.h>
+
+#include <kiconloader.h>
+#include "misc.h"
+#include "autolistviewitems.h"
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+#include "autodetailsview.h"
+
+/**
+* Class ProjectItem
+*/
+
+ProjectItem::ProjectItem( Type type, QListView *parent, const QString &text )
+ : QListViewItem( parent, text ), typ( type )
+{
+ bld = false;
+}
+
+
+ProjectItem::ProjectItem( Type type, ProjectItem *parent, const QString &text )
+ : QListViewItem( parent, text ), typ( type )
+{
+ bld = false;
+}
+
+
+void ProjectItem::paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment )
+{
+ if ( isBold() )
+ {
+ QFont font( p->font() );
+ font.setBold( true );
+ p->setFont( font );
+ }
+ QListViewItem::paintCell( p, cg, column, width, alignment );
+}
+
+
+/**
+* Class SubprojectItem
+*/
+
+SubprojectItem::SubprojectItem( QListView *parent, const QString &text )
+ : ProjectItem( Subproject, parent, text )
+{
+ init();
+}
+
+
+SubprojectItem::SubprojectItem( SubprojectItem *parent, const QString &text )
+ : ProjectItem( Subproject, parent, text )
+{
+ init();
+}
+
+
+void SubprojectItem::init()
+{
+ targets.setAutoDelete( true );
+ setPixmap( 0, SmallIcon( "folder" ) );
+}
+
+
+QString SubprojectItem::relativePath()
+{
+ QString relpath = subdir;
+
+ SubprojectItem *it = this;
+ while ( (it= dynamic_cast<SubprojectItem*>(it->parent())) )
+ {
+ relpath.prepend(it->subdir + "/");
+ }
+ relpath.remove(0, 2);
+
+ return relpath;
+}
+
+
+/**
+* Class TargetItem
+*/
+
+TargetItem::TargetItem( QListView *lv, bool group, const QString &text )
+ : ProjectItem( Target, lv, text )
+{
+ sources.setAutoDelete( true );
+ setPixmap( 0, group ? SmallIcon( "tar" ) : SmallIcon( "binary" ) );
+}
+
+
+/**
+* Class FileItem
+*/
+
+FileItem::FileItem( QListView *lv, const QString &text, bool set_is_subst )
+ : ProjectItem( File, lv, text ) , is_subst(set_is_subst)
+{
+ if(!is_subst)
+ {
+ setPixmap( 0, SmallIcon( "document" ) );
+ }
+ else
+ {
+ setPixmap( 0, SmallIcon( "variablenew" ) );
+ }
+}
+
+
+void FileItem::changeSubstitution()
+{
+if(!is_subst)
+return;
+
+ bool ok;
+ QString text = QInputDialog::getText(
+ i18n("Edit Substitution"), i18n("Substitution:"), QLineEdit::Normal,
+ name, &ok );
+ if ( ok && !text.isEmpty() )
+ {
+ // user entered something and pressed OK
+ QString new_name = text;
+ if(new_name == name)
+ return;
+ setText(0,new_name);
+ changeMakefileEntry(new_name);
+ name = new_name;
+ }
+ else
+ {
+ // user entered nothing or pressed Cancel
+
+ }
+}
+
+void FileItem::changeMakefileEntry(const QString& new_name)
+{
+ TargetItem* target = dynamic_cast<TargetItem*>(parent());
+
+ QMap<QString,QString> replaceMap;
+
+ QString canontargetname = AutoProjectTool::canonicalize(target->name);
+ QString varname;
+ if( target->primary == "PROGRAMS" || target->primary == "LIBRARIES" || target->primary == "LTLIBRARIES" )
+ varname = canontargetname + "_SOURCES";
+ else
+ varname = target->prefix + "_" + target->primary;
+ if( AutoDetailsView* lv = dynamic_cast<AutoDetailsView*>(listView()) )
+ {
+ if ( SubprojectItem* subProject = lv->m_part->m_widget->selectedSubproject() )
+ {
+ QStringList sources = QStringList::split(QRegExp("[ \t\n]"), subProject->variables[varname]);
+ QStringList::iterator it = sources.find(name);
+ (*it) = new_name;
+ subProject->variables[varname] = sources.join(" ");
+ replaceMap.insert(varname, subProject->variables[varname]);
+
+ AutoProjectTool::addToMakefileam(subProject->path + "/Makefile.am", replaceMap);
+
+ if(new_name == "")
+ target->sources.remove(this);
+ }
+ }
+}
diff --git a/buildtools/autotools/autolistviewitems.h b/buildtools/autotools/autolistviewitems.h
new file mode 100644
index 00000000..0dece2a2
--- /dev/null
+++ b/buildtools/autotools/autolistviewitems.h
@@ -0,0 +1,143 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* Copyright (C) 2002 by Victor Rder *
+* victor_roeder@gmx.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 AUTOLISTVIEWITEMS_H
+#define AUTOLISTVIEWITEMS_H
+
+#include <qptrlist.h>
+
+#include <qlistview.h>
+
+class TargetItem;
+class FileItem;
+class AutoProjectPart;
+
+/**
+* Base class for all items appearing in ProjectOverview and ProjectDetails.
+*/
+class ProjectItem : public QListViewItem
+{
+public:
+ enum Type { Subproject, Target, File };
+
+ ProjectItem( Type type, QListView *parent, const QString &text );
+ ProjectItem( Type type, ProjectItem *parent, const QString &text );
+
+ void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment );
+ void setBold( bool b )
+ {
+ bld = b;
+ }
+ bool isBold() const
+ {
+ return bld;
+ }
+ Type type()
+ {
+ return typ;
+ }
+
+private:
+ Type typ;
+ bool bld;
+
+};
+
+
+/**
+* Stores the content of one Makefile.am
+*/
+class SubprojectItem : public ProjectItem
+{
+public:
+ SubprojectItem( QListView *parent, const QString &text );
+ SubprojectItem( SubprojectItem *parent, const QString &text );
+
+ /** name of the directory */
+ QString subdir;
+ /** absolute path */
+ QString path;
+ /** mapping from prefix to path */
+ QMap<QString, QString> prefixes;
+ /** mapping from variable name to value */
+ QMap<QString, QString> variables;
+ /** list of targets */
+ QPtrList<TargetItem> targets;
+
+ QString relativePath();
+
+private:
+ void init();
+};
+
+
+/**
+* Stores one target
+* For e.g. the line
+* bin_LTLIBRARIES = foo.la
+* generates a target with name 'foo.la', primary LTLIBRARIES and prefix 'bin'
+* In order to make things not too simple ;-) headers and data are handled
+* a bit different from programs, libraries and scripts: All headers for a
+* certain prefix (analogously for data) are put in _one_ TargetItem object,
+* and the names of the files are put in the sources variable. This avoids
+* cluttering the list view with lots of header items.
+*/
+class TargetItem : public ProjectItem
+{
+public:
+ //enum TargetKind { Program, Library, DataGroup, IconGroup, DocGroup };
+
+ TargetItem( QListView *lv, bool group, const QString &text );
+
+ // Target kind - not used currently
+ //TargetKind kind;
+ //! Name of target, e.g. foo
+ QString name;
+ //! One of PROGRAMS, LIBRARIES, LTLIBRARIES, SCRIPTS, HEADERS, DATA, JAVA
+ //! In addition to these automake primaries, we use KDEICON and KDEDOCS
+ //! for am_edit magic
+ QString primary;
+ //! May be bin, pkglib, noinst, check, sbin, pkgdata, java...
+ QString prefix;
+ //! Content of foo_SOURCES (or java_JAVA) assignment
+ QPtrList<FileItem> sources;
+ //! Content of foo_LDFLAGS assignment
+ QString ldflags;
+ //! Content of foo_LDADD assignment
+ QString ldadd;
+ //! Content of foo_LIBADD assignment
+ QString libadd;
+ //! Content of foo_DEPENDENCIES assignment
+ QString dependencies;
+};
+
+
+// Not sure if this complexity is really necessary...
+class FileItem : public ProjectItem
+{
+
+public:
+ FileItem( QListView *lv, const QString &text, bool set_is_subst = false );
+ void changeSubstitution();
+ void changeMakefileEntry( const QString& );
+
+ QString name;
+ QString uiFileLink;
+ const bool is_subst;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/autoprojectpart.cpp b/buildtools/autotools/autoprojectpart.cpp
new file mode 100644
index 00000000..ea0b6896
--- /dev/null
+++ b/buildtools/autotools/autoprojectpart.cpp
@@ -0,0 +1,1474 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * Copyright (C) 2002 by Victor Roeder *
+ * victor_roeder@gmx.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 <config.h>
+
+#include "autoprojectpart.h"
+#include "autolistviewitems.h"
+#include "configureoptionswidget.h"
+#include "addtranslationdlg.h"
+#include "addicondlg.h"
+#include "autoprojectwidget.h"
+
+#include <qdom.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qwhatsthis.h>
+#include <qregexp.h>
+#include <qgroupbox.h>
+
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kparts/part.h>
+#include <kdeversion.h>
+#include <kprocess.h>
+
+#include <domutil.h>
+#include <kdevcore.h>
+#include <kdevmakefrontend.h>
+#include <kdevappfrontend.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <makeoptionswidget.h>
+#include <runoptionswidget.h>
+#include <envvartools.h>
+
+#include <configwidgetproxy.h>
+#include <kdevplugininfo.h>
+#include <urlutil.h>
+
+#define CONFIGURE_OPTIONS 1
+#define RUN_OPTIONS 2
+#define MAKE_OPTIONS 3
+
+static const KDevPluginInfo data("kdevautoproject");
+
+K_EXPORT_COMPONENT_FACTORY( libkdevautoproject, AutoProjectFactory( data ) )
+
+AutoProjectPart::AutoProjectPart(QObject *parent, const char *name, const QStringList &args)
+ : KDevBuildTool(&data, parent, name ? name : "AutoProjectPart")
+ , m_lastCompilationFailed(false)
+{
+ setInstance(AutoProjectFactory::instance());
+
+ setXMLFile("kdevautoproject.rc");
+
+ m_executeAfterBuild = false;
+ m_isKDE = (args[0] == "kde");
+ m_needMakefileCvs = false;
+
+ m_widget = new AutoProjectWidget(this, m_isKDE);
+ m_widget->setIcon(SmallIcon( info()->icon() ));
+ m_widget->setCaption(i18n("Automake Manager"));
+ QWhatsThis::add(m_widget, i18n("<b>Automake manager</b><p>"
+ "The project tree consists of two parts. The 'overview' "
+ "in the upper half shows the subprojects, each one having a "
+ "Makefile.am. The 'details' view in the lower half shows the "
+ "targets and files for the subproject selected in the overview."));
+
+ mainWindow()->embedSelectViewRight(m_widget, i18n("Automake Manager"), i18n("Automake manager"));
+ KAction *action;
+
+ action = new KAction( i18n("Add Translation..."), 0,
+ this, SLOT(slotAddTranslation()),
+ actionCollection(), "project_addtranslation" );
+ action->setToolTip(i18n("Add translation"));
+ action->setWhatsThis(i18n("<b>Add translation</b><p>Creates .po file for the selected language."));
+ action->setGroup("autotools");
+
+
+ if (!m_isKDE)
+ action->setEnabled(false);
+
+ action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8,
+ this, SLOT(slotBuild()),
+ actionCollection(), "build_build" );
+ action->setToolTip(i18n("Build project"));
+ action->setWhatsThis(i18n("<b>Build project</b><p>Runs <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Build &Active Target"), "make_kdevelop", Key_F7,
+ this, SLOT(slotBuildActiveTarget()),
+ actionCollection(), "build_buildactivetarget" );
+ action->setToolTip(i18n("Build active target"));
+ action->setWhatsThis(i18n("<b>Build active target</b><p>Constructs a series of make commands to build an active target. "
+ "Also builds dependent targets.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Compile &File"), "make_kdevelop",
+ this, SLOT(slotCompileFile()),
+ actionCollection(), "build_compilefile" );
+ action->setToolTip(i18n("Compile file"));
+ action->setWhatsThis(i18n("<b>Compile file</b><p>Runs <b>make filename.o</b> command from the directory where 'filename' is the name of currently opened file.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Run Configure"), 0,
+ this, SLOT(slotConfigure()),
+ actionCollection(), "build_configure" );
+ action->setToolTip(i18n("Run configure"));
+ action->setWhatsThis(i18n("<b>Run configure</b><p>Executes <b>configure</b> with flags, arguments "
+ "and environment variables specified in the project settings dialog, "
+ "<b>Configure Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Run automake && friends"), 0,
+ this, SLOT(slotMakefilecvs()),
+ actionCollection(), "build_makefilecvs" );
+ action->setToolTip(i18n("Run automake && friends"));
+ action->setWhatsThis(i18n("<b>Run automake && friends</b><p>Executes<br><b>make -f Makefile.cvs</b><br><b>./configure</b><br>commands from the project directory."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Install"), 0,
+ this, SLOT(slotInstall()),
+ actionCollection(), "build_install" );
+ action->setToolTip(i18n("Install"));
+ action->setWhatsThis(i18n("<b>Install</b><p>Runs <b>make install</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Install (as root user)"), 0,
+ this, SLOT(slotInstallWithKdesu()),
+ actionCollection(), "build_install_kdesu" );
+ action->setToolTip(i18n("Install as root user"));
+ action->setWhatsThis(i18n("<b>Install</b><p>Runs <b>make install</b> command from the project directory with root privileges.<br>"
+ "It is executed via kdesu command.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("&Clean Project"), 0,
+ this, SLOT(slotClean()),
+ actionCollection(), "build_clean" );
+ action->setToolTip(i18n("Clean project"));
+ action->setWhatsThis(i18n("<b>Clean project</b><p>Runs <b>make clean</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("&Distclean"), 0,
+ this, SLOT(slotDistClean()),
+ actionCollection(), "build_distclean" );
+ action->setToolTip(i18n("Distclean"));
+ action->setWhatsThis(i18n("<b>Distclean</b><p>Runs <b>make distclean</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ action = new KAction( i18n("Make Messages && Merge"), 0,
+ this, SLOT(slotMakeMessages()),
+ actionCollection(), "build_messages" );
+ action->setToolTip(i18n("Make messages && merge"));
+ action->setWhatsThis(i18n("<b>Make messages && merge</b><p>Runs <b>make package-messages</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+ action->setGroup("autotools");
+
+ if (!m_isKDE)
+ action->setEnabled(false);
+
+ buildConfigAction = new KSelectAction( i18n("Build Configuration"), 0,
+ actionCollection(), "project_configuration" );
+ buildConfigAction->setToolTip(i18n("Build configuration menu"));
+ buildConfigAction->setWhatsThis(i18n("<b>Build configuration menu</b><p>Allows to switch between project build configurations.<br>"
+ "Build configuration is a set of build and top source directory settings, "
+ "configure flags and arguments, compiler flags, etc.<br>"
+ "Modify build configurations in project settings dialog, <b>Configure Options</b> tab."));
+ buildConfigAction->setGroup("autotools");
+
+ QDomDocument &dom = *projectDom();
+ if (!DomUtil::readBoolEntry(dom, "/kdevautoproject/run/disable_default")) {
+ //ok we handle the execute in this kpart
+ action = new KAction( i18n("Execute Program"), "exec", SHIFT+Key_F9,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Execute program"));
+ action->setWhatsThis(i18n("<b>Execute program</b><p>Executes the currently active target or the main program specified in project settings, <b>Run Options</b> tab."));
+ action->setGroup("autotools");
+ }
+
+ connect( buildConfigAction, SIGNAL(activated(const QString&)),
+ this, SLOT(slotBuildConfigChanged(const QString&)) );
+ connect( buildConfigAction->popupMenu(), SIGNAL(aboutToShow()),
+ this, SLOT(slotBuildConfigAboutToShow()) );
+
+// connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("Configure Options"), CONFIGURE_OPTIONS, info()->icon() );
+ _configProxy->createProjectConfigPage( i18n("Run Options"), RUN_OPTIONS, info()->icon() );
+ _configProxy->createProjectConfigPage( i18n("Make Options"), MAKE_OPTIONS, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+
+ connect( makeFrontend(), SIGNAL(commandFinished(const QString&)),
+ this, SLOT(slotCommandFinished(const QString&)) );
+ connect( makeFrontend(), SIGNAL(commandFailed(const QString&)),
+ this, SLOT(slotCommandFailed(const QString&)) );
+
+ setWantautotools();
+
+
+}
+
+
+AutoProjectPart::~AutoProjectPart()
+{
+ if (m_widget)
+ {
+ mainWindow()->removeView(m_widget);
+ }
+ delete m_widget;
+ delete _configProxy;
+}
+
+
+void AutoProjectPart::insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int pagenumber )
+{
+ switch ( pagenumber )
+ {
+ case CONFIGURE_OPTIONS:
+ {
+ ConfigureOptionsWidget *w2 = new ConfigureOptionsWidget(this, page );
+ connect( dlg, SIGNAL(okClicked()), w2, SLOT(accept()) );
+ }
+ break;
+
+ case RUN_OPTIONS:
+ {
+ QDomDocument &dom = *projectDom();
+ if (!DomUtil::readBoolEntry(dom, "/kdevautoproject/run/disable_default"))
+ {
+ //ok we handle the execute in this kpart
+ RunOptionsWidget *w3 = new RunOptionsWidget(*projectDom(), "/kdevautoproject", buildDirectory(), page );
+ connect( dlg, SIGNAL(okClicked()), w3, SLOT(accept()) );
+ }
+ }
+ break;
+
+ case MAKE_OPTIONS:
+ {
+ MakeOptionsWidget *w4 = new MakeOptionsWidget(*projectDom(), "/kdevautoproject", page );
+ connect( dlg, SIGNAL(okClicked()), w4, SLOT(accept()) );
+ }
+ break;
+ }
+}
+
+void AutoProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ m_projectName = projectName;
+ m_projectPath =dirName;
+
+ m_widget->openProject(dirName);
+
+ QDomDocument &dom = *projectDom();
+ QString activeTarget = DomUtil::readEntry(dom, "/kdevautoproject/general/activetarget");
+ kdDebug(9020) << k_funcinfo << "activeTarget " << activeTarget << endl;
+ if (!activeTarget.isEmpty())
+ m_widget->setActiveTarget(activeTarget);
+ else
+ {
+ KMessageBox::information( m_widget, i18n("No active target specified, running the application will\n"
+ "not work until you make a target active in the Automake Manager\n"
+ "on the right side or use the Main Program options under\n"
+ "Project -> Project Options -> Run Options"), i18n("No active target specified"), "kdevelop_open_project_no_active_target");
+ }
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+
+void AutoProjectPart::closeProject()
+{
+ m_widget->closeProject();
+}
+
+
+QString AutoProjectPart::projectDirectory() const
+{
+ return m_projectPath;
+}
+
+
+QString AutoProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList AutoProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevautoproject/run/envvars", "envvar", "name", "value");
+}
+
+
+/** Retuns the currently selected run directory
+ * If no main Program was selected in the Run Options dialog
+ * use the currently active target instead to calculate it.
+ * The returned string can be:
+ * if /kdevautoproject/run/directoryradio == executable
+ * The directory where the executable is
+ * if /kdevautoproject/run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if /kdevautoproject/run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString AutoProjectPart::runDirectory() const
+{
+
+ QDomDocument &dom = *projectDom();
+
+ QString cwd;
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/useglobalprogram", false) || !m_widget->activeTarget() )
+ {
+ cwd = defaultRunDirectory("kdevautoproject");
+ }else
+ {
+ cwd = DomUtil::readEntry( dom, "/kdevautoproject/run/cwd/"+m_widget->activeTarget()->name );
+ }
+ if( cwd.isEmpty() )
+ cwd = buildDirectory() +"/"+ URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() ) +"/"+m_widget->activeDirectory();
+
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * If no main Program was selected in the Run Options dialog
+ * use the currently active target instead.
+ * The returned string can be:
+ * if /kdevautoproject/run/directoryradio == executable
+ * The executable name
+ * if /kdevautoproject/run/directoryradio == build
+ * The path to executable relative to build directory
+ * if /kdevautoproject/run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+
+QString AutoProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ if( DomUtil::readBoolEntry(*dom, "/kdevautoproject/run/useglobalprogram", false) )
+ {
+ QString DomMainProgram = DomUtil::readEntry(*dom, "/kdevautoproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume builddir relative path
+ {
+ QString relprojectpath = URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() );
+ if( !relprojectpath.isEmpty() )
+ relprojectpath = "/" + relprojectpath;
+ return buildDirectory() + relprojectpath + "/" + DomMainProgram;
+ }
+
+ }
+ else // If no Main Program was specified, return the active target
+ {
+ TargetItem* titem = m_widget->activeTarget();
+
+ if ( !titem ) {
+ KMessageBox::error( m_widget, i18n("There is no active target.\n"
+ "Unable to determine the main program."), i18n("No active target found") );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : There's no active target! -> Unable to determine the main program in AutoProjectPart::mainProgram()" << endl;
+ return QString::null;
+ }
+
+ if ( titem->primary != "PROGRAMS" ) {
+ KMessageBox::error( m_widget, i18n("Active target \"%1\" is not binary ( %2 ).\n"
+ "Unable to determine the main program. If you want this\n"
+ "to be the active target, set a main program under\n"
+ "Project -> Project Options -> Run Options").arg(titem->name).arg(titem->primary), i18n("Active target is not a library") );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : Active target isn't binary (" << titem->primary << ") ! -> Unable to determine the main program in AutoProjectPart::mainProgram()" << endl;
+ return QString::null;
+ }
+
+ QString relprojectpath = URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() );
+ if( !relprojectpath.isEmpty() )
+ relprojectpath = "/" + relprojectpath;
+ return buildDirectory() + relprojectpath + "/" + activeDirectory() + "/" + titem->name;
+ }
+}
+
+
+/** Retuns a QString with the debug command line arguments */
+QString AutoProjectPart::debugArguments() const
+{
+ QDomDocument &dom = *projectDom();
+
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/useglobalprogram", false) || !m_widget->activeTarget() )
+ {
+ return DomUtil::readEntry(dom, "/kdevautoproject/run/globaldebugarguments");
+ }else
+ {
+ return DomUtil::readEntry(dom, "/kdevautoproject/run/debugarguments/" + m_widget->activeTarget()->name);
+ }
+}
+
+
+/** Retuns a QString with the run command line arguments */
+QString AutoProjectPart::runArguments() const
+{
+ QDomDocument &dom = *projectDom();
+
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/useglobalprogram", false) || !m_widget->activeTarget() )
+ {
+ return DomUtil::readEntry(dom, "/kdevautoproject/run/programargs");
+ }else
+ {
+ return DomUtil::readEntry(dom, "/kdevautoproject/run/runarguments/" + m_widget->activeTarget()->name);
+ }
+}
+
+
+QString AutoProjectPart::activeDirectory() const
+{
+ return m_widget->activeDirectory();
+}
+
+
+QStringList AutoProjectPart::allFiles() const
+{
+ return m_widget->allFiles();
+}
+
+
+void AutoProjectPart::setWantautotools()
+{
+ QDomDocument &dom = *projectDom();
+ QDomElement el = DomUtil::elementByPath(dom, "/kdevautoproject/make");
+ if ( el.namedItem("envvars").isNull() ) {
+ DomUtil::PairList list;
+ list << DomUtil::Pair("WANT_AUTOCONF_2_5", "1");
+ list << DomUtil::Pair("WANT_AUTOMAKE_1_6", "1");
+ DomUtil::writePairListEntry(dom, "/kdevautoproject/make/envvars", "envvar", "name", "value", list);
+ }
+}
+
+
+QString AutoProjectPart::makeEnvironment() const
+{
+ // Get the make environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE"
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry(*projectDom(), "/kdevautoproject/make/envvars", "envvar", "name", "value");
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for (it = envvars.begin(); it != envvars.end(); ++it)
+ {
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote((*it).second);
+ environstr += " ";
+ }
+
+ KConfigGroup grp( kapp->config(), "MakeOutputView" );
+ if( grp.readBoolEntry( "ForceCLocale", true ) )
+ environstr += "LC_MESSAGES="+EnvVarTools::quote("C")+" "+"LC_CTYPE="+EnvVarTools::quote("C")+" ";
+
+ return environstr;
+}
+
+
+void AutoProjectPart::addFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->addFiles ( fileList );
+}
+
+void AutoProjectPart::addFiles ( const QStringList& fileList )
+{
+ QString directory, name;
+ QStringList::ConstIterator it;
+ bool messageBoxShown = false;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ int pos = ( *it ).findRev('/');
+ if (pos != -1)
+ {
+ directory = ( *it ).left(pos);
+ name = ( *it ).mid(pos+1);
+ }
+ else
+ {
+ directory = "";
+ name = ( *it );
+ }
+
+ if (directory != m_widget->activeDirectory() ||
+ directory.isEmpty())
+ {
+ if ( !messageBoxShown )
+ {
+ KMessageBox::information(m_widget, i18n("The directory you selected is not the active directory.\n"
+ "You should 'activate' the target you're currently working on in Automake Manager.\n"
+ "Just right-click a target and choose 'Make Target Active'."),
+ i18n ( "No Active Target Found" ), "No automake manager active target warning" );
+ messageBoxShown = true;
+ }
+ }
+ }
+
+ m_widget->addFiles(fileList);
+}
+
+void AutoProjectPart::removeFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->removeFiles ( fileList );
+}
+
+void AutoProjectPart::removeFiles ( const QStringList& fileList )
+{
+ /// \FIXME m_widget->removeFiles does nothing!
+ m_widget->removeFiles ( fileList );
+
+ emit removedFilesFromProject ( fileList );
+}
+
+QStringList AutoProjectPart::allBuildConfigs() const
+{
+ QDomDocument &dom = *projectDom();
+
+ QStringList allConfigs;
+ allConfigs.append("default");
+
+ QDomNode node = dom.documentElement().namedItem("kdevautoproject").namedItem("configurations");
+ QDomElement childEl = node.firstChild().toElement();
+ while (!childEl.isNull())
+ {
+ QString config = childEl.tagName();
+ kdDebug(9020) << k_funcinfo << "Found config " << config << endl;
+ if (config != "default")
+ allConfigs.append(config);
+ childEl = childEl.nextSibling().toElement();
+ }
+
+ return allConfigs;
+}
+
+
+QString AutoProjectPart::currentBuildConfig() const
+{
+ QDomDocument &dom = *projectDom();
+
+ QString config = DomUtil::readEntry(dom, "/kdevautoproject/general/useconfiguration");
+ if (config.isEmpty() || !allBuildConfigs().contains(config))
+ config = "default";
+
+ return config;
+}
+
+
+QString AutoProjectPart::buildDirectory() const
+{
+ QString prefix = "/kdevautoproject/configurations/" + currentBuildConfig() + "/";
+
+ QString builddir = DomUtil::readEntry(*projectDom(), prefix + "builddir");
+ if (builddir.isEmpty())
+ return topsourceDirectory();
+ else if (builddir.startsWith("/"))
+ return builddir;
+ else
+ return projectDirectory() + "/" + builddir;
+}
+
+QString AutoProjectPart::topsourceDirectory() const
+{
+ QString prefix = "/kdevautoproject/configurations/" + currentBuildConfig() + "/";
+
+ QString topsourcedir = DomUtil::readEntry(*projectDom(), prefix + "topsourcedir");
+ if (topsourcedir.isEmpty())
+ return projectDirectory();
+ else if (topsourcedir.startsWith("/"))
+ return topsourcedir;
+ else
+ return projectDirectory() + "/" + topsourcedir;
+}
+
+QString AutoProjectPart::constructMakeCommandLine(const QString &dir, const QString &target) const
+{
+
+ QString preCommand;
+ QFileInfo fi1();
+ kdDebug(9020) << k_funcinfo << "Looking for Makefile in " << dir << endl;
+ if ( !QFile::exists(dir + "/GNUmakefile") && !QFile::exists(dir + "/makefile")
+ && ! QFile::exists(dir + "/Makefile") )
+ {
+ if (!QFile::exists(buildDirectory() + "/configure"))
+ {
+ int r = KMessageBox::questionYesNo(m_widget, i18n("%1\nThere is no Makefile in this directory\n"
+ "and no configure script for this project.\n"
+ "Run automake & friends and configure first?").arg(buildDirectory()), QString::null, i18n("Run Them"), i18n("Do Not Run"));
+ if (r == KMessageBox::No)
+ return QString::null;
+ preCommand = makefileCvsCommand();
+ if (preCommand.isNull())
+ return QString::null;
+ preCommand += " && ";
+ preCommand += configureCommand() + " && ";
+ }
+ else
+ {
+ int r = KMessageBox::questionYesNo(m_widget, i18n("%1\nThere is no Makefile in this directory. Run 'configure' first?").arg(dir), QString::null, i18n("Run configure"), i18n("Do Not Run"));
+ if (r == KMessageBox::No)
+ return QString::null;
+ preCommand = configureCommand() + " && ";
+ }
+ }
+ QDomDocument &dom = *projectDom();
+
+ QString cmdline = DomUtil::readEntry(dom, "/kdevautoproject/make/makebin");
+ int prio = DomUtil::readIntEntry(dom, "/kdevautoproject/make/prio");
+ QString nice;
+ kdDebug(9020) << k_funcinfo << "nice = " << prio<< endl;
+ if (prio != 0)
+ {
+ nice = QString("nice -n%1 ").arg(prio);
+ }
+
+ if (cmdline.isEmpty())
+ cmdline = MAKE_COMMAND;
+ if (!DomUtil::readBoolEntry(dom, "/kdevautoproject/make/abortonerror"))
+ cmdline += " -k";
+ bool runmultiple = DomUtil::readBoolEntry(dom, "/kdevautoproject/make/runmultiplejobs");
+ int jobs = DomUtil::readIntEntry(dom, "/kdevautoproject/make/numberofjobs");
+ if (runmultiple && jobs != 0)
+ {
+ cmdline += " -j";
+ cmdline += QString::number(jobs);
+ }
+ if (DomUtil::readBoolEntry(dom, "/kdevautoproject/make/dontact"))
+ cmdline += " -n";
+
+ cmdline += " ";
+ cmdline += target;
+ cmdline.prepend(nice);
+ cmdline.prepend(makeEnvironment());
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(dir);
+ dircmd += " && ";
+
+ return preCommand + dircmd + cmdline;
+}
+
+
+void AutoProjectPart::startMakeCommand(const QString &dir, const QString &target, bool withKdesu)
+{
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+ kdDebug(9020) << "startMakeCommand:" << dir << ": "<< target << endl;
+ m_buildCommand = constructMakeCommandLine(dir, target);
+
+ if (withKdesu)
+ m_buildCommand = "kdesu -t -c '" + m_buildCommand + "'";
+
+ if (!m_buildCommand.isNull())
+ makeFrontend()->queueCommand(dir, m_buildCommand);
+}
+
+
+/** Adds the make command for the libraries that the target depends on
+ * to the make frontend queue (this is a recursive function) */
+bool AutoProjectPart::queueInternalLibDependenciesBuild(TargetItem* titem, QStringList& alreadyScheduledDeps)
+{
+
+ QString addstr = (titem->primary == "PROGRAMS")? titem->ldadd : titem->libadd;
+ QStringList l2 = QStringList::split(QRegExp("[ \t]"), addstr); // list of dependencies
+ QString tdir; // temp target directory
+ QString tname; // temp target name
+ QString tcmd; // temp command line
+ QStringList::Iterator l2it;
+ for (l2it = l2.begin(); l2it != l2.end(); ++l2it)
+ {
+ QString dependency = *l2it;
+ if (dependency.startsWith("$(top_builddir)/"))
+ {
+ // These are the internal libraries
+ dependency.remove("$(top_builddir)/");
+
+ if( !alreadyScheduledDeps.contains(*l2it) )
+ {
+ alreadyScheduledDeps << *l2it;
+ tdir = buildDirectory();
+ if (!tdir.endsWith("/") && !tdir.isEmpty())
+ tdir += "/";
+ int pos = dependency.findRev('/');
+ if (pos == -1)
+ {
+ tname = dependency;
+ }
+ else
+ {
+ tdir += dependency.left(pos+1);
+ tname = dependency.mid(pos+1);
+ }
+ kdDebug(9020) << "Scheduling : <" << tdir << "> target <" << tname << ">" << endl;
+ // Recursively queue the dependencies for building
+ SubprojectItem *spi = m_widget->subprojectItemForPath( dependency.left(pos) );
+ if (spi)
+ {
+ QPtrList< TargetItem > tl = spi->targets;
+ // Cycle through the list of targets to find the one we're looking for
+ TargetItem *ti = tl.first();
+ do
+ {
+ if (ti->name == tname)
+ {
+ // found it: queue it and stop looking
+ if( !queueInternalLibDependenciesBuild(ti, alreadyScheduledDeps) )
+ return false;
+ break;
+ }
+ ti = tl.next();
+ }
+ while (ti);
+ }
+
+ kdDebug(9020) << "queueInternalLibDependenciesBuild:" << tdir << ": "<< tname << endl;
+ tcmd = constructMakeCommandLine(tdir, tname);
+ if (!tcmd.isNull())
+ {
+ makeFrontend()->queueCommand( tdir, tcmd);
+ }
+ }else
+ {
+ //Message box about circular deps.
+ tdir = buildDirectory();
+ if (!tdir.endsWith("/") && !tdir.isEmpty())
+ tdir += "/";
+ int pos = dependency.findRev('/');
+ if (pos == -1)
+ {
+ tname = dependency;
+ }
+ else
+ {
+ tdir += dependency.left(pos+1);
+ tname = dependency.mid(pos+1);
+ }
+ KMessageBox::error( 0, i18n("Found a circular dependency in the project, between this target and %1.\nCannot build this project until this is resolved.").arg(tname), i18n("Circular Dependency found") );
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+
+void AutoProjectPart::slotBuild()
+{
+ //m_lastCompilationFailed = false;
+
+ if( m_needMakefileCvs )
+ {
+ slotMakefilecvs();
+ slotConfigure();
+ m_needMakefileCvs = false;
+ }
+
+ startMakeCommand(buildDirectory(), QString::fromLatin1(""));
+}
+
+
+void AutoProjectPart::buildTarget(QString relpath, TargetItem* titem)
+{
+
+ if ( !titem )
+ return;
+
+ //m_lastCompilationFailed = false;
+
+ // Calculate the complete name of the target and store it in name
+ QString name = titem->name;
+ if ( titem->primary == "KDEDOCS" )
+ name = "index.cache.bz2";
+
+ // Calculate the full path of the target and store it in path
+ QString path = buildDirectory();
+ if (!path.endsWith("/") && !path.isEmpty())
+ path += "/";
+ if (relpath.at(0) == '/')
+ path += relpath.mid(1);
+ else
+ path += relpath;
+
+ // Save all files once
+ partController()->saveAllFiles();
+
+ // Add the make command for the libraries that the target depends on to the make frontend queue
+ // if this recursive behavour is un-wanted comment the next line
+ QStringList deps;
+ if( !queueInternalLibDependenciesBuild(titem, deps) )
+ return;
+
+ // Calculate the "make" command line for the target
+ //QString relpath = dir.path().mid( projectDirectory().length() );
+ m_runProg=buildDirectory() + "/" + relpath+"/"+name;
+ kdDebug(9020) << "buildTarget:" << buildDirectory()<< endl;
+ kdDebug(9020) << "buildTarget:" << relpath << " " << path << ": "<< name << " : " << m_runProg << endl;
+ QString tcmd = constructMakeCommandLine( path, name );
+
+ // Call make
+ if (!tcmd.isNull())
+ {
+ m_buildCommand = tcmd;
+ makeFrontend()->queueCommand( path, tcmd);
+ }
+}
+
+
+void AutoProjectPart::slotBuildActiveTarget()
+{
+ // Get a pointer to the active target
+ TargetItem* titem = m_widget->activeTarget();
+
+ if ( !titem )
+ return;
+
+ // build it
+ buildTarget( URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() ) + "/" + activeDirectory(), titem);
+}
+
+
+void AutoProjectPart::slotCompileFile()
+{
+ KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ if (!part || !part->url().isLocalFile())
+ return;
+
+ QString fileName = part->url().path();
+ QFileInfo fi(fileName);
+ QString sourceDir = fi.dirPath();
+ QString baseName = fi.baseName(true);
+ kdDebug(9020) << "Compiling " << fileName
+ << " in dir " << sourceDir
+ << " with baseName " << baseName << endl;
+
+ QString projectDir = projectDirectory();
+ if (!sourceDir.startsWith(projectDir)) {
+ KMessageBox::sorry(m_widget, i18n("Can only compile files in directories which belong to the project."));
+ return;
+ }
+
+ QString buildDir = buildDirectory() + sourceDir.mid(projectDir.length());
+ QString target = baseName + ".lo";
+ kdDebug(9020) << "builddir " << buildDir << ", target " << target << endl;
+
+ startMakeCommand(buildDir, target);
+}
+
+QString AutoProjectPart::configureCommand() const
+{
+ QDomDocument &dom = *projectDom();
+ QString prefix = "/kdevautoproject/configurations/" + currentBuildConfig() + "/";
+
+ QString cmdline = "\"" + topsourceDirectory();
+ cmdline += "/configure\"";
+ QString cc = DomUtil::readEntry(dom, prefix + "ccompilerbinary");
+ if (!cc.isEmpty())
+ cmdline.prepend(QString("CC=%1 ").arg(cc));
+ QString cflags = DomUtil::readEntry(dom, prefix + "cflags");
+ if (!cflags.isEmpty())
+ cmdline.prepend(QString("CFLAGS=\"%1\" ").arg(cflags));
+ QString cxx = DomUtil::readEntry(dom, prefix + "cxxcompilerbinary");
+ if (!cxx.isEmpty())
+ cmdline.prepend(QString("CXX=%1 ").arg(cxx));
+ QString cxxflags = DomUtil::readEntry(dom, prefix + "cxxflags");
+ if (!cxxflags.isEmpty())
+ cmdline.prepend(QString("CXXFLAGS=\"%1\" ").arg(cxxflags));
+ QString f77 = DomUtil::readEntry(dom, prefix + "f77compilerbinary");
+ if (!f77.isEmpty())
+ cmdline.prepend(QString("F77=%1 ").arg(f77));
+ QString fflags = DomUtil::readEntry(dom, prefix + "f77flags");
+ if (!fflags.isEmpty())
+ cmdline.prepend(QString("FFLAGS=\"%1\" ").arg(fflags));
+ QString cppflags = DomUtil::readEntry(dom, prefix + "cppflags");
+ if (!cppflags.isEmpty())
+ cmdline.prepend(QString("CPPFLAGS=\"%1\" ").arg(cppflags));
+ QString ldflags = DomUtil::readEntry(dom, prefix + "ldflags");
+ if (!ldflags.isEmpty())
+ cmdline.prepend(QString("LDFLAGS=\"%1\" ").arg(ldflags));
+
+ QString configargs = DomUtil::readEntry(dom, prefix + "configargs");
+ if (!configargs.isEmpty()) {
+ cmdline += " ";
+ cmdline += configargs;
+ }
+
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry(*projectDom(), prefix + "envvars", "envvar", "name", "value");
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for (it = envvars.begin(); it != envvars.end(); ++it) {
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote((*it).second);
+ environstr += " ";
+ }
+ cmdline.prepend(environstr);
+
+ QString builddir = buildDirectory();
+ QString dircmd;
+
+ // if the build directory doesn't exist, add it's creation to the configureCommand
+ if ( !QFile::exists(builddir)) {
+ dircmd = "mkdir ";
+ dircmd += KProcess::quote(builddir);
+ dircmd += " && ";
+ }
+
+ // add "cd into the build directory" to the configureCommand
+ dircmd += "cd ";
+ dircmd += KProcess::quote(builddir);
+ dircmd += " && ";
+
+ return dircmd + cmdline;
+}
+
+void AutoProjectPart::slotConfigure()
+{
+ QString cmdline = configureCommand();
+ if (cmdline.isNull())
+ return;
+
+ makeFrontend()->queueCommand(buildDirectory(), cmdline);
+}
+
+QString AutoProjectPart::makefileCvsCommand() const
+{
+ kdDebug(9020) << "makefileCvsCommand: runDirectory :" << runDirectory() << ":" <<endl;
+ kdDebug(9020) << "makefileCvsCommand: topsourceDirectory :" << topsourceDirectory() << ":" <<endl;
+ kdDebug(9020) << "makefileCvsCommand: makeEnvironment :" << makeEnvironment() << ":" <<endl;
+ kdDebug(9020) << "makefileCvsCommand: currentBuildConfig :" << currentBuildConfig() << ":" <<endl;
+
+
+ QString cmdline = DomUtil::readEntry(*projectDom(), "/kdevautoproject/make/makebin");
+ if (cmdline.isEmpty())
+ cmdline = MAKE_COMMAND;
+
+ int prio = DomUtil::readIntEntry(*projectDom(), "/kdevautoproject/make/prio");
+ QString nice;
+ kdDebug(9020) << "makefileCvsCommand() nice = " << prio<< endl;
+ if (prio != 0) {
+ nice = QString("nice -n%1 ").arg(prio);
+ }
+
+ if (QFile::exists(topsourceDirectory() + "/Makefile.cvs"))
+ cmdline += " -f Makefile.cvs";
+ else if (QFile::exists(topsourceDirectory() + "/Makefile.dist"))
+ cmdline += " -f Makefile.dist";
+ else if (QFile::exists(topsourceDirectory() + "/autogen.sh"))
+ cmdline = "./autogen.sh";
+ else {
+ KMessageBox::sorry(m_widget, i18n("There is neither a Makefile.cvs file nor an "
+ "autogen.sh script in the project directory."));
+ return QString::null;
+ }
+
+ cmdline.prepend(nice);
+ cmdline.prepend(makeEnvironment());
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(topsourceDirectory());
+ dircmd += " && ";
+
+ return dircmd + cmdline;
+}
+
+void AutoProjectPart::slotMakefilecvs()
+{
+ QString cmdline = makefileCvsCommand();
+ if ( cmdline.isNull() )
+ return;
+
+ makeFrontend()->queueCommand(projectDirectory(), cmdline);
+}
+
+
+void AutoProjectPart::slotInstall()
+{
+ startMakeCommand(buildDirectory(), QString::fromLatin1("install"));
+}
+
+
+void AutoProjectPart::slotInstallWithKdesu()
+{
+ // First issue "make" to build the entire project with the current user
+ // This way we make sure all files are up to date before we do the "make install"
+ slotBuild();
+
+ // After that issue "make install" with the root user
+ startMakeCommand(buildDirectory(), QString::fromLatin1("install"), true);
+}
+
+
+void AutoProjectPart::slotClean()
+{
+ startMakeCommand(buildDirectory(), QString::fromLatin1("clean"));
+}
+
+
+void AutoProjectPart::slotDistClean()
+{
+ startMakeCommand(buildDirectory(), QString::fromLatin1("distclean"));
+}
+
+
+void AutoProjectPart::slotMakeMessages()
+{
+ startMakeCommand(buildDirectory(), QString::fromLatin1("package-messages"));
+}
+
+
+/** Checks if the currently selected main program or,
+ * if no main Program was selected in the Run Options dialog,
+ * the currently active target is up-to-date and builds it if necessary.
+ * In the end checks if the program is already running and if not calls the
+ * slotExecute2() function to execute it or asks the user what to do.
+ */
+void AutoProjectPart::slotExecute()
+{
+ partController()->saveAllFiles();
+ QDomDocument &dom = *projectDom();
+
+ m_runProg=m_runProg.isEmpty()?mainProgram():m_runProg;
+
+ bool _auto = false;
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/autocompile", true) && isDirty() ){
+ m_executeAfterBuild = true;
+ if ( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/useglobalprogram", false) ){
+ // A Main Program was specified, build all targets because we don't know which is it
+ kdDebug(9020) << "slotExecute: before slotBuild" << endl;
+ slotBuild();
+
+ }
+ else{
+ // If no Main Program was specified, build the active target
+ kdDebug(9020) << "slotExecute: before slotBuildActiveTarget" << endl;
+ slotBuildActiveTarget();
+ }
+ _auto = true;
+ }
+
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/autoinstall", false) && isDirty() ){
+ m_executeAfterBuild = true;
+ // Use kdesu??
+ if( DomUtil::readBoolEntry(dom, "/kdevautoproject/run/autokdesu", false) ){
+ //slotInstallWithKdesu assumes that it hasn't just been build...
+ kdDebug(9020) << "slotExecute: before startMakeCommand" << endl;
+ _auto ? slotInstallWithKdesu() : startMakeCommand(buildDirectory(), QString::fromLatin1("install"), true);
+ }
+ else{
+ kdDebug(9020) << "slotExecute: before slotInstall" << endl;
+ slotInstall();
+ }
+ _auto = true;
+ }
+
+ if ( _auto ){
+ m_runProg.truncate(0);
+ return;
+ }
+
+ if (appFrontend()->isRunning()) {
+ if (KMessageBox::questionYesNo(m_widget, i18n("Your application is currently running. Do you want to restart it?"), i18n("Application Already Running"), i18n("&Restart Application"), i18n("Do &Nothing")) == KMessageBox::No)
+ return;
+ connect(appFrontend(), SIGNAL(processExited()), SLOT(slotExecute2()));
+ appFrontend()->stopApplication();
+ return;
+ }
+ kdDebug(9020) << "slotExecute: before slotExecute2" << endl;
+ slotExecute2();
+}
+
+void AutoProjectPart::executeTarget(const QDir& dir, const TargetItem* titem)
+{
+ m_executeAfterBuild=true;
+ partController()->saveAllFiles();
+
+ bool is_dirty = false;
+ QDateTime t = QFileInfo(dir , titem->name ).lastModified();
+ QPtrListIterator<FileItem> it( titem->sources );
+ for( ; it.current() ; ++it )
+ {
+ if( t < QFileInfo(dir , (*it)->name).lastModified())
+ is_dirty = true;
+ }
+
+ if( DomUtil::readBoolEntry(*projectDom(), "/kdevautoproject/run/autocompile", true) && is_dirty )
+ {
+ connect( makeFrontend(), SIGNAL(commandFinished(const QString&)), this, SLOT(slotExecuteTargetAfterBuild(const QString&)) );
+ connect( makeFrontend(), SIGNAL(commandFailed(const QString&)), this, SLOT(slotNotExecuteTargetAfterBuildFailed(const QString&)) );
+
+ m_runProg=titem->name;
+ m_executeTargetAfterBuild.first = dir;
+ m_executeTargetAfterBuild.second = const_cast<TargetItem*>(titem);
+
+ QString relpath = "/" + URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() ) + "/" + m_widget->selectedSubproject()->subdir;
+ kdDebug(9020) << "executeTarget: before buildTarget " << relpath << endl;
+ buildTarget(relpath, const_cast<TargetItem*>(titem));
+ return;
+ }
+
+
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevautoproject/run/terminal");
+
+ QString program = environString();
+
+ if ( !titem ) {
+ KMessageBox::error( m_widget, i18n("There is no active target.\n"
+ "Unable to determine the main program"), i18n("No active target found") );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : There's no active target! -> Unable to determine the main program in AutoProjectPart::mainProgram()" << endl;
+ program += titem->name;
+ }else if ( titem->primary != "PROGRAMS" ) {
+ KMessageBox::error( m_widget, i18n("Active target \"%1\" is not binary ( %2 ).\n"
+ "Unable to determine the main program. If you want this\n"
+ "to be the active target, set a main program under\n"
+ "Project -> Project Options -> Run Options").arg(titem->name).arg(titem->primary), i18n("Active target is not a library") );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : Active target isn't binary (" << titem->primary << ") ! -> Unable to determine the main program in AutoProjectPart::mainProgram()" << endl;
+ program += titem->name;
+ }else
+ program += buildDirectory() + "/" + URLUtil::getRelativePath( topsourceDirectory(), projectDirectory() ) + "/" + m_widget->selectedSubproject()->relativePath()+ "/" + titem->name;
+
+ QString args = DomUtil::readEntry(*projectDom(), "/kdevautoproject/run/runarguments/" + titem->name);
+
+ program += " " + args;
+ kdDebug(9020) << "executeTarget:cmd=" << dir.path() << " " << program << endl;
+ appFrontend()->startAppCommand(dir.path(), program ,inTerminal);
+ m_executeAfterBuild=false;
+
+}
+
+void AutoProjectPart::slotExecuteTargetAfterBuild(const QString& command)
+{
+ kdDebug(9020) << "slotExecuteTargetAfterBuild " << command << endl;
+ if ( m_executeAfterBuild && constructMakeCommandLine(m_executeTargetAfterBuild.first.path(), m_executeTargetAfterBuild.second->name) == command )
+ {
+ disconnect( makeFrontend(), SIGNAL(commandFinished(const QString&)), this, SLOT(slotExecuteAfterTargetBuild()) );
+ disconnect( makeFrontend(), SIGNAL(commandFailed(const QString&)), this, SLOT(slotExecuteAfterTargetBuildFailed()) );
+ kdDebug(9020) << "slotExecuteTargetAfterBuild " << endl;
+ executeTarget(m_executeTargetAfterBuild.first, m_executeTargetAfterBuild.second);
+ }
+
+}
+
+void AutoProjectPart::slotNotExecuteTargetAfterBuildFailed(const QString& command)
+{
+ kdDebug(9020) << "executeTargetAfterBuildFailed" << endl;
+ if ( constructMakeCommandLine(m_executeTargetAfterBuild.first.path(), m_executeTargetAfterBuild.second->name) == command )
+ {
+ m_executeAfterBuild=false;
+ disconnect( makeFrontend(), SIGNAL(commandFinished(const QString&)), this, SLOT(slotExecuteTargetAfterBuild()) );
+ disconnect( makeFrontend(), SIGNAL(commandFailed(const QString&)), this, SLOT(slotNotExecuteTargetAfterBuildFailed()) );
+ }
+}
+
+
+/* Get the run environment variables pairs into the environstr string
+ * in the form of: "ENV_VARIABLE=ENV_VALUE"
+ * Note that we quote the variable value due to the possibility of
+ * embedded spaces. */
+QString AutoProjectPart::environString() const
+{
+ DomUtil::PairList envvars = runEnvironmentVars();
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for (it = envvars.begin(); it != envvars.end(); ++it) {
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote((*it).second);
+ environstr += " ";
+ }
+ return environstr;
+}
+
+/** Executes the currently selected main program.
+ * If no main Program was selected in the Run Options dialog
+ * the currently active target is executed instead.
+ */
+void AutoProjectPart::slotExecute2()
+{
+ disconnect(appFrontend(), SIGNAL(processExited()), this, SLOT(slotExecute2()));
+
+ if (m_runProg.isEmpty()){
+ // Do not execute non executable targets
+ return;
+ }
+
+ QString program = environString();
+ // Adds the ./ that is necessary to execute the program in bash shells
+ if (!m_runProg.startsWith("/")){
+ program += "./";
+ }
+ program += m_runProg;
+ program += " " + runArguments();
+
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevautoproject/run/terminal");
+
+ kdDebug(9020) << "slotExecute2: runDirectory: <" << runDirectory() << ">" <<endl;
+ kdDebug(9020) << "slotExecute2: environstr : <" << environString() << ">" <<endl;
+ kdDebug(9020) << "slotExecute2: mainProgram : <" << mainProgram() << ">" <<endl;
+ kdDebug(9020) << "slotExecute2: runArguments: <" << runArguments() << ">" <<endl;
+ kdDebug(9020) << "slotExecute2: program : <" << program << ">" <<endl;
+
+ appFrontend()->startAppCommand(runDirectory(), program, inTerminal);
+ m_executeAfterBuild=false;
+ m_runProg.truncate(0);
+}
+
+
+void AutoProjectPart::slotAddTranslation()
+{
+ AddTranslationDialog dlg(this, m_widget);
+ dlg.exec();
+}
+
+
+void AutoProjectPart::slotBuildConfigChanged(const QString &config)
+{
+ DomUtil::writeEntry(*projectDom(), "/kdevautoproject/general/useconfiguration", config);
+ kdDebug(9020) << "Changed used configuration to " << config << endl;
+}
+
+
+void AutoProjectPart::slotBuildConfigAboutToShow()
+{
+ QStringList l = allBuildConfigs();
+ buildConfigAction->setItems(l);
+ buildConfigAction->setCurrentItem(l.findIndex(currentBuildConfig()));
+}
+
+void AutoProjectPart::restorePartialProjectSession ( const QDomElement* el )
+{
+ m_widget->restoreSession ( el );
+}
+
+void AutoProjectPart::savePartialProjectSession ( QDomElement* el )
+{
+ QDomDocument domDoc = el->ownerDocument();
+
+ KMessageBox::information ( 0, "Hallo, Welt!" );
+
+ kdDebug ( 9020 ) << k_funcinfo << "1" << endl;
+
+ if ( domDoc.isNull() )
+ {
+ kdDebug ( 9020 ) << k_funcinfo << "2" << endl;
+ return;
+ }
+
+ kdDebug ( 9020 ) << k_funcinfo << "3" << endl;
+
+ m_widget->saveSession ( el );
+}
+
+void AutoProjectPart::slotCommandFinished( const QString& command )
+{
+ kdDebug(9020) << k_funcinfo << endl;
+
+ if( m_buildCommand != command )
+ return;
+
+ m_buildCommand = QString::null;
+
+ m_timestamp.clear();
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QString fileName = *it;
+ ++it;
+
+ m_timestamp[ fileName ] = QFileInfo( projectDirectory(), fileName ).lastModified();
+ }
+
+ emit projectCompiled();
+
+ // reset the "last compilation has failed" flag
+ m_lastCompilationFailed = false;
+
+ if( m_executeAfterBuild ){
+ slotExecute();
+ }
+}
+
+void AutoProjectPart::slotCommandFailed( const QString& /*command*/ )
+{
+ kdDebug(9020) << "slotCommandFinished " << k_funcinfo << endl;
+
+ m_lastCompilationFailed = true;
+ m_executeAfterBuild=false;
+}
+
+bool AutoProjectPart::isDirty()
+{
+ if (m_lastCompilationFailed) return true;
+
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QString fileName = *it;
+ ++it;
+
+ QMap<QString, QDateTime>::Iterator it = m_timestamp.find( fileName );
+ QDateTime t = QFileInfo( projectDirectory(), fileName ).lastModified();
+ if( it == m_timestamp.end() || *it != t ){
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void AutoProjectPart::needMakefileCvs( )
+{
+ m_needMakefileCvs = true;
+}
+
+bool AutoProjectPart::isKDE() const
+{
+ return m_isKDE;
+}
+
+KDevProject::Options AutoProjectPart::options() const
+{
+ return UsesAutotoolsBuildSystem;
+}
+
+QStringList recursiveATFind( const QString &currDir, const QString &baseDir )
+{
+ kdDebug(9020) << "Dir " << currDir << endl;
+ QStringList fileList;
+
+ if( !currDir.contains( "/..") && !currDir.contains("/.") )
+ {
+ QDir dir(currDir);
+ QStringList dirList = dir.entryList(QDir::Dirs );
+ QStringList::Iterator idx = dirList.begin();
+ for( ; idx != dirList.end(); ++idx )
+ {
+ fileList += recursiveATFind( currDir + "/" + (*idx),baseDir );
+ }
+ QStringList newFiles = dir.entryList("*.am *.in");
+ idx = newFiles.begin();
+ for( ; idx != newFiles.end(); ++idx )
+ {
+ QString file = currDir + "/" + (*idx);
+ fileList.append( file.remove( baseDir ) );
+ }
+ }
+
+
+ return fileList;
+}
+
+/*!
+ \fn AutoProjectPart::distFiles() const
+ */
+QStringList AutoProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir(projectDir);
+ QDir admin(projectDir +"/admin");
+ QStringList files = dir.entryList( "Makefile.cvs Makefile.am configure* INSTALL README NEWS TODO ChangeLog COPYING AUTHORS stamp-h.in acinclude.m4 config.h.in Makefile.in install-sh config.sub config.guess mkinstalldirs missing ltmain.sh depcomp");
+ QStringList adminFiles = admin.entryList(QDir::Files);
+ QStringList::Iterator idx = adminFiles.begin();
+ for( ; idx != adminFiles.end(); ++idx)
+ {
+ files.append( "admin/" + (*idx) );
+ }
+ QStringList srcDirs = dir.entryList(QDir::Dirs);
+ idx = srcDirs.begin();
+ for(; idx != srcDirs.end(); ++idx)
+ {
+ sourceList += recursiveATFind( projectDirectory() + "/" + (*idx), projectDirectory());
+ }
+ return sourceList + files;
+}
+
+void AutoProjectPart::startSimpleMakeCommand( const QString & dir, const QString & command, bool withKdesu )
+{
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ // m_buildCommand = constructMakeCommandLine(dir, target);
+
+ QString cmdline = command;
+ cmdline.prepend(makeEnvironment());
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(dir);
+ dircmd += " && ";
+
+ m_buildCommand = dircmd + cmdline;
+
+ if (withKdesu)
+ m_buildCommand = "kdesu -t -c '" + m_buildCommand + "'";
+
+ if (!m_buildCommand.isNull())
+ makeFrontend()->queueCommand(dir, m_buildCommand);
+}
+
+QString AutoProjectPart::getAutoConfFile(const QString& dir){
+
+ QFile inFile(dir + "/configure.in");
+ QFile acFile(dir + "/configure.ac");
+ if ( inFile.exists()){
+ return inFile.name();
+ }else if (acFile.exists()){
+ return acFile.name();
+ }
+ return acFile.name();;
+}
+
+#include "autoprojectpart.moc"
+
+// kate: space-indent on; indent-width 4;
diff --git a/buildtools/autotools/autoprojectpart.h b/buildtools/autotools/autoprojectpart.h
new file mode 100644
index 00000000..d0862cc3
--- /dev/null
+++ b/buildtools/autotools/autoprojectpart.h
@@ -0,0 +1,153 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* Copyright (C) 2002 by Victor R�er *
+* victor_roeder@gmx.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 _AUTOPROJECTPART_H_
+#define _AUTOPROJECTPART_H_
+
+#include <qdict.h>
+#include <qguardedptr.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qdir.h>
+#include <kdevgenericfactory.h>
+#include "kdevbuildtool.h"
+
+class QDomElement;
+class QStringList;
+class KDialogBase;
+class AutoProjectWidget;
+class KSelectAction;
+class TargetItem;
+class ConfigWidgetProxy;
+
+class AutoProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+
+public:
+ AutoProjectPart( QObject *parent, const char *name, const QStringList &args );
+ virtual ~AutoProjectPart();
+
+ /**
+ * Implementation of the KDevProject interface.
+ */
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+ virtual QString runDirectory() const;
+ virtual QString mainProgram() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual QString environString() const;
+ virtual QString activeDirectory() const;
+ virtual QStringList allFiles() const;
+ virtual void addFile( const QString &fileName );
+ virtual void addFiles ( const QStringList& fileList );
+ virtual void removeFile( const QString &fileName );
+ virtual void removeFiles ( const QStringList& fileList );
+ virtual QString buildDirectory() const;
+ virtual Options options() const;
+
+ /**
+ * Implementation of the KDevPlugin interface.
+ */
+ virtual void restorePartialProjectSession ( const QDomElement* el );
+ virtual void savePartialProjectSession ( QDomElement* el );
+
+ /**
+ * automake specific methods.
+ */
+ QStringList allBuildConfigs() const;
+ QString currentBuildConfig() const;
+ QString topsourceDirectory() const;
+ void startMakeCommand( const QString &dir, const QString &target, bool withKdesu = false );
+ void startSimpleMakeCommand( const QString &dir, const QString &command, bool withKdesu = false );
+ void buildTarget( QString relpath, TargetItem* titem );
+ void executeTarget( const QDir& dir, const TargetItem* titem );
+
+ void needMakefileCvs();
+ bool isDirty();
+ bool isKDE() const;
+ QStringList distFiles() const;
+ QString getAutoConfFile(const QString& dir);
+
+protected:
+ /**
+ * Reimplemented from KDevProject. These methods are only
+ * for use by the application core.
+ */
+ virtual void openProject( const QString &dirName, const QString &projectName );
+ virtual void closeProject();
+
+private slots:
+ // void projectConfigWidget(KDialogBase *dlg);
+ void slotAddTranslation();
+ void slotBuild();
+ void slotBuildActiveTarget();
+ void slotCompileFile();
+ void slotClean();
+ void slotDistClean();
+ void slotInstall();
+ void slotInstallWithKdesu();
+ void slotMakefilecvs();
+ void slotMakeMessages();
+ void slotConfigure();
+ void slotExecute();
+ void slotExecute2();
+ void slotExecuteTargetAfterBuild( const QString& command );
+ void slotNotExecuteTargetAfterBuildFailed( const QString& command );
+ void slotBuildConfigChanged( const QString &config );
+ void slotBuildConfigAboutToShow();
+ void slotCommandFinished( const QString& command );
+ void slotCommandFailed( const QString& command );
+ //void slotImportExisting();
+ void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
+
+
+private:
+ QGuardedPtr<AutoProjectWidget> m_widget;
+ QString m_projectName;
+ QString m_projectPath;
+ KSelectAction *buildConfigAction;
+
+ QString makeEnvironment() const;
+ void setWantautotools();
+ QString makefileCvsCommand() const;
+ QString configureCommand() const;
+
+ QMap<QString, QDateTime> m_timestamp;
+ bool m_executeAfterBuild;
+ QString m_buildCommand;
+ bool m_needMakefileCvs;
+ bool m_lastCompilationFailed;
+ bool m_isKDE;
+ QPair<QDir, TargetItem*> m_executeTargetAfterBuild;
+ QString m_runProg;
+
+ ConfigWidgetProxy * _configProxy;
+
+ // Enble AutoProjectWidget to emit our signals
+ friend class AutoProjectWidget;
+ friend class AddSubprojectDialog;
+ friend class FileItem;
+
+ // For make commands queuing
+ QString constructMakeCommandLine( const QString &dir, const QString &target ) const;
+ bool queueInternalLibDependenciesBuild( TargetItem* titem, QStringList& list );
+};
+
+typedef KDevGenericFactory<AutoProjectPart> AutoProjectFactory;
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/autoprojectviewbase.ui b/buildtools/autotools/autoprojectviewbase.ui
new file mode 100644
index 00000000..ad5142ba
--- /dev/null
+++ b/buildtools/autotools/autoprojectviewbase.ui
@@ -0,0 +1,123 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AutoProjectViewBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AutoProjectViewBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>245</width>
+ <height>334</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_button1</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_button2</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_button3</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_button4</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_button5</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>m_optionsButton</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Options</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KListView" row="1" column="0">
+ <property name="name">
+ <cstring>m_listView</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/autoprojectwidget.cpp b/buildtools/autotools/autoprojectwidget.cpp
new file mode 100644
index 00000000..c3248504
--- /dev/null
+++ b/buildtools/autotools/autoprojectwidget.cpp
@@ -0,0 +1,748 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2001-2002 by Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************
+*/
+
+
+#include "autoprojectwidget.h"
+
+#include <qcheckbox.h>
+#include <qdom.h>
+#include <qfile.h>
+#include <qheader.h>
+#include <qpainter.h>
+#include <qptrstack.h>
+#include <qregexp.h>
+#include <qsplitter.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qtimer.h>
+
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <klistview.h>
+#include <kmessagebox.h>
+#include <kregexp.h>
+#include <kurl.h>
+#include <kfile.h>
+#include <kxmlguiclient.h>
+#include <kaction.h>
+
+#include "kdevcore.h"
+#include "domutil.h"
+#include "misc.h"
+#include "choosetargetdialog.h"
+
+#include "autolistviewitems.h"
+
+#include "autoprojectpart.h"
+#include "autosubprojectview.h"
+#include "autodetailsview.h"
+#include "urlutil.h"
+#include "makefilehandler.h"
+
+static QString nicePrimary( const QString &primary )
+{
+ if ( primary == "PROGRAMS" )
+ return i18n( "Program" );
+ else if ( primary == "LIBRARIES" )
+ return i18n( "Library" );
+ else if ( primary == "LTLIBRARIES" )
+ return i18n( "Libtool Library" );
+ else if ( primary == "SCRIPTS" )
+ return i18n( "Script" );
+ else if ( primary == "HEADERS" )
+ return i18n( "Header" );
+ else if ( primary == "DATA" )
+ return i18n( "Data" );
+ else if ( primary == "JAVA" )
+ return i18n( "Java" );
+ else
+ return QString::null;
+}
+
+
+AutoProjectWidget::AutoProjectWidget( AutoProjectPart *part, bool kde )
+ : QVBox( 0, "auto project widget" )
+{
+ m_part = part;
+ m_kdeMode = kde;
+ m_activeSubproject = 0;
+ m_activeTarget = 0;
+ m_shownSubproject = 0;
+ m_choosenTarget = 0;
+ m_makefileHandler = new MakefileHandler();
+
+ QSplitter *splitter = new QSplitter(Vertical, this);
+
+ initOverview ( splitter );
+ initDetailview ( splitter );
+
+ initActions ();
+}
+
+
+AutoProjectWidget::~AutoProjectWidget()
+{
+ delete m_makefileHandler;
+}
+
+void AutoProjectWidget::initOverview ( QWidget* parent )
+{
+ m_subprojectView = new AutoSubprojectView( this, m_part, parent, "project overview widget" );
+}
+
+void AutoProjectWidget::initDetailview ( QWidget* parent )
+{
+ m_detailView = new AutoDetailsView( this, m_part, parent, "project details widget" );
+}
+
+void AutoProjectWidget::initActions()
+{
+ connect( m_subprojectView, SIGNAL( selectionChanged( QListViewItem* ) ),
+ this, SLOT( slotOverviewSelectionChanged( QListViewItem* ) ) );
+}
+
+AutoSubprojectView* AutoProjectWidget::getSubprojectView ()
+{
+ return m_subprojectView;
+}
+
+AutoDetailsView* AutoProjectWidget::getDetailsView ()
+{
+ return m_detailView;
+}
+
+void AutoProjectWidget::openProject( const QString &dirName )
+{
+ m_subprojectView->loadMakefileams ( dirName );
+ MakefileHandler mfh;
+ mfh.parse( m_part->projectDirectory(), true );
+
+}
+
+
+void AutoProjectWidget::closeProject()
+{
+ m_shownSubproject = 0;
+ m_subprojectView->listView()->clear();
+ m_detailView->listView()->clear();
+}
+
+SubprojectItem* AutoProjectWidget::activeSubproject ()
+{
+ return m_activeSubproject;
+}
+
+TargetItem* AutoProjectWidget::activeTarget ()
+{
+ return m_activeTarget;
+}
+
+QStringList AutoProjectWidget::allSubprojects()
+{
+ int prefixlen = m_part->projectDirectory().length() + 1;
+ QStringList res;
+
+ QListViewItemIterator it( m_subprojectView->listView() );
+ for ( ; it.current(); ++it )
+ {
+ // Skip root subproject
+ // if ( it.current() == m_subprojectView->firstChild() )
+ // continue;
+ QString path = static_cast<SubprojectItem*>( it.current() ) ->path;
+ res.append( path.mid( prefixlen ) );
+ }
+
+ return res;
+}
+
+QPtrList <SubprojectItem> AutoProjectWidget::allSubprojectItems()
+{
+ QPtrList <SubprojectItem> res;
+
+ QListViewItemIterator it ( m_subprojectView->listView() );
+
+ for ( ; it.current(); ++it )
+ {
+ // Skip root subproject
+ // if ( it.current() == m_subprojectView->firstChild() )
+ // continue;
+
+ SubprojectItem* spitem = static_cast <SubprojectItem*> ( it.current() );
+ res.append ( spitem );
+ }
+
+ return res;
+}
+
+SubprojectItem* AutoProjectWidget::subprojectItemForPath(const QString & path, bool pathIsAbsolute)
+{
+ kdDebug(9020) << "Looking for path " << path << endl;
+
+ int prefixLen = m_part->projectDirectory().length() + 1;
+ QListViewItemIterator it( m_subprojectView->listView() );
+ for(; it.current(); ++it)
+ {
+ SubprojectItem* spitem = static_cast<SubprojectItem*>(it.current() );
+ QString relpath = (spitem->path).mid(prefixLen);
+ kdDebug(9020) << " ... checking -" << spitem->path << "-" << endl;
+ kdDebug(9020) << " ... (tailored: -" << relpath << "- against -" << (pathIsAbsolute ? path.mid(prefixLen) : path) << "- )" << endl;
+ if ( relpath == (pathIsAbsolute ? path.mid(prefixLen) : path))
+ {
+ kdDebug(9020) << "Found it!" << endl;
+ return spitem;
+ }
+ }
+ kdDebug(9020) << "Not found" << endl;
+ return NULL;
+}
+
+QString AutoProjectWidget::pathForTarget(const TargetItem *titem) const
+{
+
+ if (!titem)
+ return QString::null;
+
+ kdDebug(9020) << "Looking for target " << titem->name << endl;
+ int prefixLen = m_part->projectDirectory().length() + 1;
+ QListViewItemIterator it( m_subprojectView->listView() );
+ for(; it.current(); ++it)
+ {
+ SubprojectItem* spitem = static_cast<SubprojectItem*>(it.current() );
+ kdDebug(9020) << "Checking: " << spitem->path << endl;
+ if (spitem->targets.containsRef(titem))
+ {
+ kdDebug(9020) << "Found it!" << endl;
+ QString relpath = (spitem->path).mid(prefixLen);
+ return relpath;
+ }
+ }
+ kdDebug(9020) << "Not found" << endl;
+ return QString::null;
+}
+
+QStringList AutoProjectWidget::allLibraries()
+{
+ int prefixlen = m_part->projectDirectory().length() + 1;
+ QStringList res;
+
+ QListViewItemIterator it( m_subprojectView->listView() );
+ for ( ; it.current(); ++it )
+ {
+ SubprojectItem *spitem = static_cast<SubprojectItem*>( it.current() );
+ QString path = spitem->path;
+ QPtrListIterator<TargetItem> tit( spitem->targets );
+ for ( ; tit.current(); ++tit )
+ {
+ QString primary = ( *tit ) ->primary;
+ if ( primary == "LIBRARIES" || primary == "LTLIBRARIES" )
+ {
+ QString fullname = path + "/" + ( *tit ) ->name;
+ res.append( fullname.mid( prefixlen ) );
+ }
+ }
+ }
+
+ return res;
+}
+
+
+QStringList AutoProjectWidget::allFiles()
+{
+ QPtrStack<QListViewItem> s;
+ QMap<QString, bool> dict;
+
+ for ( QListViewItem * item = m_subprojectView->listView()->firstChild(); item;
+ item = item->nextSibling() ? item->nextSibling() : s.pop() )
+ {
+ if ( item->firstChild() )
+ s.push( item->firstChild() );
+
+ SubprojectItem *spitem = static_cast<SubprojectItem*>( item );
+ // use URLUtil so paths in root project dir are worked out correctly
+ QString relPath = URLUtil::relativePath(m_part->projectDirectory(), spitem->path, URLUtil::SLASH_SUFFIX);
+ QPtrListIterator<TargetItem> tit( spitem->targets );
+ for ( ; tit.current(); ++tit )
+ {
+ QPtrListIterator<FileItem> fit( tit.current() ->sources );
+ for ( ; fit.current(); ++fit )
+ {
+
+ if((*fit)->is_subst)
+ continue;
+
+ QFileInfo fileInfo( (*fit)->name );
+ if( fileInfo.extension() == "ui" )
+ {
+ dict.insert( relPath + fileInfo.baseName() + ".h", true );
+ dict.insert( relPath + fileInfo.baseName() + ".cpp", true );
+ }
+
+ dict.insert( relPath + ( *fit ) ->name, true );
+ }
+ }
+ }
+
+ // Files may be in multiple targets, so we have to remove
+ // duplicates
+ QStringList res;
+ QMap<QString, bool>::Iterator it = dict.begin();
+ while( it != dict.end() ){
+ res << it.key();
+ ++it;
+ }
+
+ return res;
+}
+
+
+QString AutoProjectWidget::subprojectDirectory()
+{
+ if ( !selectedSubproject() )
+ return QString::null;
+
+ return selectedSubproject()->path;
+}
+
+
+void AutoProjectWidget::setActiveTarget( const QString &targetPath )
+{
+ int prefixlen = m_part->projectDirectory().length() + 1;
+ QString olddir = m_part->activeDirectory();
+ m_activeSubproject = 0;
+ m_activeTarget = 0;
+
+ QListViewItemIterator it( m_subprojectView->listView() );
+ for ( ; it.current(); ++it )
+ {
+ SubprojectItem *spitem = static_cast<SubprojectItem*>( it.current() );
+ QString path = spitem->path;
+ QPtrListIterator<TargetItem> tit( spitem->targets );
+ for ( ; tit.current(); ++tit )
+ {
+ QString primary = ( *tit ) ->primary;
+ if ( primary != "PROGRAMS" && primary != "LIBRARIES"
+ && primary != "LTLIBRARIES" && primary != "JAVA" )
+ continue;
+
+ QString currentTargetPath = ( path + "/" + ( *tit ) ->name ).mid( prefixlen );
+
+ bool hasTarget = ( targetPath == currentTargetPath );
+ ( *tit )->setBold( hasTarget );
+ if ( hasTarget )
+ {
+ spitem->setBold( true );
+ m_activeSubproject = spitem;
+ m_activeTarget = ( *tit );
+ m_subprojectView->listView()->setSelected( m_activeSubproject, true );
+ m_subprojectView->listView()->ensureItemVisible ( m_activeSubproject );
+ m_subprojectView->listView()->viewport()->update();
+ m_detailView->listView()->setSelected ( m_activeTarget, true );
+ m_detailView->listView()->ensureItemVisible ( m_activeTarget );
+ m_detailView->listView()->viewport()->update();
+ }
+ else
+ {
+ // to avoid a setBold ( false ) if there's another target in the current Subproject (i.e. spitem) ...
+ spitem->setBold ( ( m_activeSubproject == spitem ) );
+ m_detailView->listView()->viewport()->update();
+ }
+ }
+ }
+ if( olddir != m_part->activeDirectory() )
+ {
+ emit m_part->activeDirectoryChanged( olddir, m_part->activeDirectory() );
+ }
+
+ if ( m_activeSubproject == 0 && m_activeTarget == 0 )
+ {
+ m_subprojectView->listView()->setSelected ( m_subprojectView->listView()->firstChild(), true );
+ m_subprojectView->listView()->ensureItemVisible ( m_subprojectView->listView()->firstChild() );
+ m_subprojectView->listView()->viewport()->update();
+ }
+}
+
+
+QString AutoProjectWidget::activeDirectory()
+{
+ if ( m_activeSubproject )
+ return m_activeSubproject->path.mid( m_part->projectDirectory().length() + 1 );
+ else
+ {
+/* if ( selectedSubproject() )
+ return selectedSubproject()->path;
+ else*/
+ return QString::null;
+ }
+}
+
+
+void AutoProjectWidget::addFiles( const QStringList &list )
+{
+ QDomDocument &dom = *m_part->projectDom();
+ QStringList fileList = list;
+
+ if ( DomUtil::readBoolEntry( dom, "/kdevautoproject/general/useactivetarget" ) )
+ {
+ QStringList::iterator it;
+
+ QString fileName;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ int pos = ( *it ).findRev('/');
+ if (pos != -1)
+ fileName = ( *it ).mid(pos+1);
+ else
+ fileName = ( *it );
+
+ //FileItem * fitem = createFileItem( fileName,m_activeSubproject );
+ //m_activeTarget->sources.append( fitem );
+ //m_activeTarget->insertItem( fitem );
+
+ /// @todo Merge with code in addfiledlg.cpp
+ // Check wether a selected subproject+target exists and matches this file
+ // If so use that as target.
+ if( m_detailView->listView()->selectedItem() && m_subprojectView->listView()->selectedItem() )
+ {
+ TargetItem *titem = dynamic_cast <TargetItem*> ( m_detailView->listView()->selectedItem() );
+ SubprojectItem * subitem = dynamic_cast <SubprojectItem*> ( m_subprojectView->listView()->selectedItem() );
+ QString relativeDir = URLUtil::directory(*it);
+ SubprojectItem* spitem = subprojectItemForPath(relativeDir);
+
+ if( titem && subitem && subitem == spitem )
+ {
+ addToTarget(fileName, subitem, titem);
+ }else
+ {
+ addToTarget(fileName, m_activeSubproject, m_activeTarget);
+ }
+ }else
+ {
+ addToTarget(fileName, m_activeSubproject, m_activeTarget);
+ }
+
+// QString canontargetname = AutoProjectTool::canonicalize( m_activeTarget->name );
+// QString varname = canontargetname + "_SOURCES";
+// m_activeSubproject->variables[ varname ] += ( " " + fileName );
+//
+// QMap<QString, QString> replaceMap;
+// replaceMap.insert( varname, m_activeSubproject->variables[ varname ] );
+//
+// AutoProjectTool::addToMakefileam( m_activeSubproject->path + "/Makefile.am", replaceMap );
+ }
+
+ emitAddedFiles ( list );
+ }
+ else
+ {
+ QStringList doManually, doneAutomatically;
+ // First check wether the detail view has a selected target and the subproject
+ // view selected subproject matches the path of the new file. Then
+ // we can assume the user used the right-click option on the target
+ for( QStringList::iterator it = fileList.begin(); it != fileList.end(); ++it)
+ {
+ bool autoAdded = false;
+ if( m_detailView->listView()->selectedItem() && m_subprojectView->listView()->selectedItem() )
+ {
+ TargetItem *titem = dynamic_cast <TargetItem*> ( m_detailView->listView()->selectedItem() );
+ SubprojectItem * subitem = dynamic_cast <SubprojectItem*> ( m_subprojectView->listView()->selectedItem() );
+ QString relativeDir = URLUtil::directory(*it);
+ SubprojectItem* spitem = subprojectItemForPath(relativeDir);
+ if( titem && subitem && subitem == spitem )
+ {
+ addToTarget(URLUtil::filename(*it), subitem, titem);
+ autoAdded = true;
+ doneAutomatically << *it;
+ }
+ }
+ if(!autoAdded) doManually << *it;
+ }
+
+ // See if we can figure out the target for each file without asking the user
+ // I think it's a valid assumption that if a directory contains only one target
+ // the file can be added to that target (Julian Rockey linux at jrockey.com)
+ QStringList temp = doManually;
+ doManually.clear();
+ for(QStringList::iterator it = temp.begin();it!=temp.end();++it)
+ {
+ bool autoAdded = false;
+ QString relativeDir = URLUtil::directory(*it);
+ SubprojectItem* spitem = subprojectItemForPath(relativeDir);
+ if (spitem)
+ {
+ QPtrList<TargetItem> titemList = spitem->targets;
+ if (titemList.count()==1) {
+ addToTarget( URLUtil::filename(*it), spitem, titemList.first() );
+ doneAutomatically.append(*it);
+ autoAdded = true;
+ }
+ }
+
+ // add to manual list if this file wasn't auto-added
+ if (!autoAdded) doManually.append(*it);
+ }
+ if (doneAutomatically.count()>0) emitAddedFiles(doneAutomatically);
+
+ // raise dialog for any files that weren't added automatically
+ if (doManually.count()>0) {
+ ChooseTargetDialog chooseTargetDlg ( this, m_part, doManually, this, "choose target dialog" );
+
+ //chooseTargetDlg = new ChooseTargetDialog ( this, this, "choose target dialog" );
+
+ if ( chooseTargetDlg.exec() && chooseTargetDlg.alwaysUseActiveTarget() )
+ DomUtil::writeBoolEntry( dom, "/kdevautoproject/general/useactivetarget", true );
+ }
+ }
+}
+
+void AutoProjectWidget::addToTarget(const QString & fileName, SubprojectItem* spitem, TargetItem* titem)
+{
+ QString varname;
+ /// \FIXME a quick hack to prevent adding header files to _SOURCES and display them in noinst_HEADERS
+ if (AutoProjectPrivate::isHeader(fileName) &&
+ ( titem->primary == "PROGRAMS" || titem->primary == "LIBRARIES" || titem->primary == "LTLIBRARIES" ) )
+ {
+ kdDebug ( 9020 ) << "Ignoring header file and adding it to noinst_HEADERS: " << fileName << endl;
+ TargetItem* noinst_HEADERS_item = getSubprojectView()->findNoinstHeaders(spitem);
+ FileItem *fitem = createFileItem( fileName, spitem );
+ noinst_HEADERS_item->sources.append( fitem );
+ noinst_HEADERS_item->insertItem( fitem );
+ varname = "noinst_HEADERS";
+ }
+ else
+ {
+ FileItem * fitem = createFileItem( fileName, spitem );
+ titem->sources.append( fitem );
+ titem->insertItem( fitem );
+
+ QString canontargetname = AutoProjectTool::canonicalize( titem->name );
+ varname = canontargetname + "_SOURCES";
+ }
+ spitem->variables[ varname ] += ( " " + fileName );
+
+ QMap<QString, QString> replaceMap;
+ replaceMap.insert( varname, spitem->variables[ varname ] );
+
+ AutoProjectTool::addToMakefileam( spitem->path + "/Makefile.am", replaceMap );
+
+ m_detailView->slotSelectionChanged( spitem );
+}
+
+void AutoProjectWidget::removeFiles( const QStringList &list )
+{
+ Q_UNUSED( list )
+}
+
+void AutoProjectWidget::slotOverviewSelectionChanged( QListViewItem *item )
+{
+ if ( !item )
+ return;
+
+ // Delete the items from the details view first.
+ if ( m_shownSubproject )
+ {
+ // Remove all TargetItems and all of their children from the view
+ kdDebug ( 9020 ) << "m_shownSubproject (before takeItem()): " << m_shownSubproject->subdir << endl;
+
+ QListViewItem* i = m_detailView->listView()->firstChild();
+ while( i )
+ {
+ QListViewItem* o = i;
+ i = i->nextSibling();
+ m_detailView->listView()->takeItem(o);
+ }
+ }
+
+ // We assume here that ALL items in the over list view
+ // are SubprojectItem's
+ m_shownSubproject = dynamic_cast<SubprojectItem*>( item );
+ if ( !m_shownSubproject) return;
+ kdDebug ( 9020 ) << "m_shownSubproject (after takeItem()): " << selectedSubproject()->subdir << endl;
+
+ // Insert all TargetItems and all of their children into the view
+ QPtrListIterator<TargetItem> it2( selectedSubproject()->targets );
+ for ( ; it2.current(); ++it2 )
+ {
+ kdDebug ( 9020 ) << "insertItem in detail " << ( *it2 )->name << endl;
+ m_detailView->listView()->insertItem( *it2 );
+ QPtrListIterator<FileItem> it3( ( *it2 ) ->sources );
+ for ( ; it3.current(); ++it3 )
+ ( *it2 )->insertItem( *it3 );
+ QString primary = ( *it2 ) ->primary;
+ if ( primary == "PROGRAMS" || primary == "LIBRARIES" ||
+ primary == "LTLIBRARIES" || primary == "JAVA" )
+ ( *it2 ) ->setOpen( true );
+ }
+}
+
+TargetItem *AutoProjectWidget::selectedTarget()
+{
+ ProjectItem * pvitem = static_cast<ProjectItem*>( m_detailView->listView()->selectedItem() );
+ if ( !pvitem || ( pvitem->type() != ProjectItem::Target ) )
+ return 0;
+
+ return static_cast<TargetItem*>( pvitem );
+}
+
+
+FileItem *AutoProjectWidget::selectedFile()
+{
+ ProjectItem * pvitem = static_cast<ProjectItem*>( m_detailView->listView()->selectedItem() );
+ if ( !pvitem || ( pvitem->type() != ProjectItem::File ) )
+ return 0;
+
+ return static_cast<FileItem*>( pvitem );
+}
+
+SubprojectItem* AutoProjectWidget::selectedSubproject()
+{
+ ProjectItem * pvitem = static_cast <SubprojectItem*> ( m_subprojectView->listView()->selectedItem() );
+
+ if ( !pvitem || ( pvitem->type() != ProjectItem::Subproject ) )
+ return 0;
+
+ return static_cast <SubprojectItem*> ( pvitem );
+}
+
+TargetItem *AutoProjectWidget::createTargetItem( const QString &name,
+ const QString &prefix, const QString &primary,
+ bool take )
+{
+ bool docgroup = ( primary == "KDEDOCS" );
+ bool icongroup = ( primary == "KDEICON" );
+ bool group = !(docgroup || icongroup);
+
+ QString text;
+ if ( docgroup )
+ text = i18n( "Documentation data" );
+ else if ( icongroup )
+ text = i18n( "KDE Icon data" ).arg( prefix );
+ else
+ text = i18n( "%1 (%2 in %3)" ).arg( name ).arg( nicePrimary( primary ) ).arg( prefix );
+
+ // Workaround because of QListView not being able to create
+ // items without actually inserting them
+ TargetItem *titem = new TargetItem( m_detailView->listView(), group, text );
+ titem->name = name;
+ titem->prefix = prefix;
+ titem->primary = primary;
+ if( take )
+ m_detailView->listView()->takeItem( titem );
+
+ return titem;
+}
+
+
+FileItem *AutoProjectWidget::createFileItem( const QString &name, SubprojectItem *subproject )
+{
+ bool is_subst;
+ if(name.find("$(") == 0 || name.find("${") == 0)
+ is_subst = true;
+ else
+ is_subst = false;
+
+ FileItem * fitem = new FileItem( m_subprojectView->listView(), name, is_subst );
+ fitem->uiFileLink = m_detailView->getUiFileLink(subproject->relativePath()+"/", name );
+ m_subprojectView->listView()->takeItem( fitem );
+ fitem->name = name;
+
+ return fitem;
+}
+
+
+void AutoProjectWidget::emitAddedFiles( const QStringList &fileList )
+{
+ emit m_part->addedFilesToProject( fileList );
+}
+
+void AutoProjectWidget::emitAddedFile( const QString &name )
+{
+ QStringList fileList;
+ fileList.append ( name );
+ emit m_part->addedFilesToProject( fileList );
+}
+
+void AutoProjectWidget::emitRemovedFiles( const QStringList &fileList )
+{
+ emit m_part->removedFilesFromProject( fileList );
+}
+
+void AutoProjectWidget::emitRemovedFile( const QString &name )
+{
+ QStringList fileList;
+ fileList.append ( name );
+ emit m_part->removedFilesFromProject( fileList );
+}
+
+void AutoProjectWidget::restoreSession ( const QDomElement* el )
+{
+ Q_UNUSED( el );
+}
+
+void AutoProjectWidget::saveSession ( QDomElement* el )
+{
+ if ( m_activeTarget && m_activeSubproject )
+ {
+ QDomDocument domDoc = el->ownerDocument();
+
+ QString activeTargetPath = m_activeSubproject->path.mid ( m_part->project()->projectDirectory().length() + 1 );
+ activeTargetPath = activeTargetPath + "/" + m_activeTarget->name;
+
+ QDomElement generalEl = domDoc.createElement("general");
+
+ kdDebug ( 9020 ) << k_funcinfo << "Saving session data of AutoProjectWidget: " << activeTargetPath << endl;
+
+ generalEl.setAttribute("activetarget", activeTargetPath);
+ el->appendChild(generalEl);
+ }
+}
+
+void AutoProjectWidget::setActiveSubproject( SubprojectItem * spitem )
+{
+ QString olddir = m_part->activeDirectory();
+ m_activeSubproject = spitem;
+ emit m_part->activeDirectoryChanged( olddir, m_part->activeDirectory() );
+}
+
+void AutoProjectWidget::focusInEvent( QFocusEvent */*e*/ )
+{
+ switch (m_lastFocusedView)
+ {
+ case DetailsView:
+ m_detailView->listView()->setFocus();
+ break;
+ case SubprojectView:
+ default:
+ m_subprojectView->listView()->setFocus();
+ }
+}
+
+void AutoProjectWidget::setLastFocusedView( AutoProjectView view )
+{
+ m_lastFocusedView = view;
+}
+
+#include "autoprojectwidget.moc"
+
+MakefileHandler* AutoProjectWidget::makefileHandler()
+{
+ return m_makefileHandler;
+}
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
diff --git a/buildtools/autotools/autoprojectwidget.h b/buildtools/autotools/autoprojectwidget.h
new file mode 100644
index 00000000..0f4a8b13
--- /dev/null
+++ b/buildtools/autotools/autoprojectwidget.h
@@ -0,0 +1,229 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2001-2002 by Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+
+#ifndef _AUTOPROJECTWIDGET_H_
+#define _AUTOPROJECTWIDGET_H_
+
+#include <qdict.h>
+#include <qlistview.h>
+#include <qmap.h>
+#include <qvbox.h>
+#include <qhbox.h>
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "domutil.h"
+#include "makefilehandler.h"
+
+class AutoProjectPart;
+class AutoSubprojectView;
+class AutoDetailsView;
+class SubprojectItem;
+class TargetItem;
+class FileItem;
+class KAction;
+class QDomElement;
+class QToolButton;
+class QStringList;
+class QFocusEvent;
+class KListViewItem;
+class QListViewItem;
+class MakefileHandler;
+
+class AutoProjectWidget : public QVBox
+{
+ Q_OBJECT
+ friend class RemoveFileDialog;
+ friend class TargetOptionsDialog; // to access projectDom() via m_part->projectDom()
+public:
+ AutoProjectWidget( AutoProjectPart *part, bool kde );
+ ~AutoProjectWidget();
+
+ void openProject( const QString &dirName );
+ void closeProject();
+
+ /**
+ * A list of the (relative) names of all subprojects (== subdirectories)
+ */
+ QStringList allSubprojects();
+ /**
+ * A list of all Subproject items in the overview KListView
+ */
+ QPtrList <SubprojectItem> allSubprojectItems();
+ /**
+ * A list of the (relative) names of all libraries
+ */
+ QStringList allLibraries();
+ /**
+ * A list of all files that belong to the project
+ **/
+ QStringList allFiles();
+ /**
+ * The top level directory of the project.
+ **/
+ QString projectDirectory() const;
+ /**
+ * The directory of the currently shown subproject.
+ */
+ QString subprojectDirectory();
+ /**
+ * Are we in KDE mode?
+ */
+ bool kdeMode() const
+ {
+ return m_kdeMode;
+ }
+
+ /**
+ * Sets the given target active. The argument is given
+ * relative to the project directory.
+ */
+ void setActiveTarget( const QString &targetPath );
+ /**
+ * Returns the active target as path relative to
+ * the project directory.
+ */
+ QString activeDirectory();
+
+ /**
+ * Adds a file to the active target.
+ * If the file does not contain a "/" character, it is added
+ * to the active target.
+ * If it does contain "/" character(s), ... @todo .. add to appropriate target
+ */
+ void addFiles( const QStringList &list );
+ /**
+ * Removes the file fileName from the directory directory.
+ * (not implemented currently)
+ */
+ void removeFiles( const QStringList &list );
+
+ /**
+ * Returns the currently selected target. Returns 0 if
+ * no target is selected.
+ */
+ TargetItem *selectedTarget();
+
+ /**
+ * Returns the currently selected file. Returns 0 if
+ * no file is selected.
+ */
+ FileItem *selectedFile();
+
+ /**
+ * Returns the currently selected subproject (directory with Makefile.am). Returns 0 if
+ * no subproject is selected.
+ */
+ SubprojectItem* selectedSubproject();
+
+ /**
+ * Creates a TargetItem instance without a parent item.
+ */
+ TargetItem *createTargetItem( const QString &name,
+ const QString &prefix, const QString &primary,
+ bool take = true );
+ /**
+ * Creates a FileItem instance without a parent item.
+ */
+ FileItem *createFileItem( const QString &name, SubprojectItem *subproject );
+
+ /**
+ * Returns the Subproject that contains the Active Target. The Active Target is a special target
+ * to which e.g. all files are added to.
+ */
+ SubprojectItem* activeSubproject ();
+ void setActiveSubproject( SubprojectItem* spitem );
+
+ /**
+ * Returns the Active Target. The Active Target is a special target
+ * to which e.g. all files are added to.
+ */
+ TargetItem* activeTarget();
+
+ /**
+ * Returns the sub project item, if any, for a given path. The path supplied can be either
+ * absolute, or relative to the project directory. If no subproject item is found for the
+ * path, null is returned.
+ */
+ SubprojectItem* subprojectItemForPath( const QString & path, bool pathIsAbsolute = false );
+
+ /**
+ * Returns the projectdir-relative path for a target item
+ */
+ QString pathForTarget( const TargetItem *item ) const;
+
+ /**
+ * Adds file fileName to target titem in subproject spitem
+ */
+ void addToTarget( const QString & fileName, SubprojectItem* spitem, TargetItem* titem );
+
+ /**
+ * Restores the last settings of the AutoProjectWidget
+ */
+ void restoreSession ( const QDomElement* el );
+
+ /**
+ * Saves the latest changes of the AutoProjectWidget to the session file.
+ */
+ void saveSession ( QDomElement* el );
+
+ AutoSubprojectView* getSubprojectView ();
+ AutoDetailsView* getDetailsView ();
+
+
+ void emitAddedFile ( const QString& name );
+ void emitAddedFiles( const QStringList &fileList );
+ void emitRemovedFile ( const QString& name );
+ void emitRemovedFiles( const QStringList &fileList );
+
+ void parse( SubprojectItem *item );
+
+ enum AutoProjectView { SubprojectView, DetailsView };
+ void setLastFocusedView( AutoProjectView view );
+
+ MakefileHandler* makefileHandler();
+
+public slots:
+ void slotOverviewSelectionChanged( QListViewItem *item );
+
+protected:
+ void initOverview ( QWidget* parent );
+ void initDetailview ( QWidget* parent );
+ void initActions ();
+
+ virtual void focusInEvent( QFocusEvent *e );
+
+private:
+
+ AutoSubprojectView* m_subprojectView;
+ AutoDetailsView* m_detailView;
+
+ bool m_kdeMode;
+ AutoProjectPart *m_part;
+ SubprojectItem *m_activeSubproject;
+ TargetItem *m_activeTarget;
+ TargetItem *m_choosenTarget;
+ SubprojectItem *m_shownSubproject;
+
+ AutoProjectView m_lastFocusedView;
+
+ MakefileHandler *m_makefileHandler;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/autosubprojectview.cpp b/buildtools/autotools/autosubprojectview.cpp
new file mode 100644
index 00000000..efa3a358
--- /dev/null
+++ b/buildtools/autotools/autosubprojectview.cpp
@@ -0,0 +1,1137 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************
+*/
+
+/** Qt */
+#include <qregexp.h>
+#include <qcheckbox.h>
+#include <qstringlist.h>
+#include <qtable.h>
+#include <qlayout.h>
+
+/** KDE Libs */
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <kprocess.h>
+#include <ksqueezedtextlabel.h>
+#include <kdialogbase.h>
+#include <klistview.h>
+
+/** KDevelop */
+#include <kdevmainwindow.h>
+#include <kdevmakefrontend.h>
+#include <kdevappfrontend.h>
+#include <kdevcore.h>
+#include <urlutil.h>
+
+/** AutoProject */
+#include "subprojectoptionsdlg.h"
+#include "addsubprojectdlg.h"
+#include "addtargetdlg.h"
+#include "addservicedlg.h"
+#include "addapplicationdlg.h"
+#include "addexistingdirectoriesdlg.h"
+#include "autolistviewitems.h"
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+#include "autosubprojectview.h"
+#include "autotoolsaction.h"
+#include "removesubprojectdialog.h"
+#include "managecustomcommand.h"
+
+namespace AutoProjectPrivate
+{
+
+bool isHeader( const QString& fileName )
+{
+ return QStringList::split( ";", "h;H;hh;hxx;hpp;tcc;h++" ).contains( QFileInfo(fileName).extension(false) );
+}
+
+static QString cleanWhitespace( const QString &str )
+{
+ QString res;
+
+ QStringList l = QStringList::split( QRegExp( "[ \t]" ), str );
+ QStringList::ConstIterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ {
+ res += *it;
+ res += " ";
+ }
+
+ return res.left( res.length() - 1 );
+}
+
+static void removeDir( const QString& dirName )
+{
+ QDir d( dirName );
+ const QFileInfoList* fileList = d.entryInfoList();
+ if( !fileList )
+ return;
+
+ QFileInfoListIterator it( *fileList );
+ while( it.current() ){
+ const QFileInfo* fileInfo = it.current();
+ ++it;
+
+ if( fileInfo->fileName() == "." || fileInfo->fileName() == ".." )
+ continue;
+
+ if( fileInfo->isDir() && !fileInfo->isSymLink() )
+ removeDir( fileInfo->absFilePath() );
+
+ kdDebug(9020) << "remove " << fileInfo->absFilePath() << endl;
+ d.remove( fileInfo->fileName(), false );
+ }
+
+ kdDebug(9020) << "remove dir " << dirName << endl;
+ d.rmdir( d.absPath(), true );
+}
+
+}
+
+
+AutoSubprojectView::AutoSubprojectView(AutoProjectWidget* widget, AutoProjectPart* part, QWidget *parent, const char *name)
+: AutoProjectViewBase(parent, name)
+{
+
+ m_widget = widget;
+ m_part = part;
+
+ m_listView->setSorting(-1);
+ m_listView->header()->hide();
+ m_listView->addColumn( QString::null );
+
+ connect( m_listView, SIGNAL( selectionChanged( QListViewItem* ) ),
+ this, SLOT( slotSelectionChanged( QListViewItem* ) ) );
+
+ initActions();
+}
+
+
+AutoSubprojectView::~AutoSubprojectView()
+{
+}
+
+void AutoSubprojectView::slotSelectionChanged( QListViewItem* item )
+{
+ if ( m_listView->selectedItems().count() <= 0 )
+ {
+ subProjectOptionsAction->setEnabled( false );
+ addSubprojectAction->setEnabled( false );
+ addTargetAction->setEnabled( false );
+ addServiceAction->setEnabled( false );
+ addApplicationAction->setEnabled( false );
+ buildSubprojectAction->setEnabled( false );
+ }
+ else
+ {
+ subProjectOptionsAction->setEnabled( true );
+ addSubprojectAction->setEnabled( true );
+ addTargetAction->setEnabled( true );
+ addServiceAction->setEnabled( true );
+ addApplicationAction->setEnabled( true );
+ buildSubprojectAction->setEnabled( true );
+ }
+
+ emit selectionChanged( item );
+}
+
+void AutoSubprojectView::loadMakefileams ( const QString& dir )
+{
+ SubprojectItem * item = new SubprojectItem( m_listView, m_part->projectName() );
+ item->setPixmap ( 0, SmallIcon ( "kdevelop" ) );
+ item->subdir = "/";
+ item->path = dir;
+ parse( item );
+ item->setOpen( true );
+
+ //setSelected( item, true );
+
+ expandCollapseFirst( m_listView->firstChild(), false );
+}
+
+
+void AutoSubprojectView::initActions()
+{
+ KActionCollection * actions = new KActionCollection( this );
+
+ subProjectOptionsAction = new AutoToolsAction( i18n( "Options..." ), "configure", 0,
+ this, SLOT( slotSubprojectOptions() ), actions, "subproject options" );
+ subProjectOptionsAction->setWhatsThis(i18n("<qt><b>Options</b><p>Shows subproject options dialog "
+ "that provides settings for compiler, include paths, "
+ "prefixes and build order.</qt>"));
+ subProjectOptionsAction->plug( m_optionsButton );
+
+ QToolTip::add( m_button1, tr2i18n( "Add new subproject..."));
+ addSubprojectAction = new AutoToolsAction( i18n( "Add new subproject..." ), "folder_new", 0,
+ this, SLOT( slotAddSubproject() ), actions, "add subproject" );
+ addSubprojectAction->setWhatsThis(i18n("<qt><b>Add new subproject</b><p>Creates a new "
+ "subproject in currently selected subproject.</qt>"));
+ addSubprojectAction->plug( m_button1 );
+
+ removeSubprojectAction = new KAction( i18n( "Remove Subproject..." ), "remove_subdir", 0,
+ this, SLOT( slotRemoveSubproject() ), actions, "remove subproject" );
+ removeSubprojectAction->setWhatsThis(i18n("<qt><b>Remove subproject</b><p>Removes the subproject. Asks if the "
+ "subproject should be also removed from disk. Only subprojects "
+ "which do not hold other subprojects can be removed.</qt>"));
+ addExistingSubprojectAction = new KAction( i18n( "Add Existing Subprojects..." ), "fileimport", 0,
+ this, SLOT( slotAddExistingSubproject() ), actions, "add existing subproject" );
+ addExistingSubprojectAction->setWhatsThis(i18n("<qt><b>Add existing subprojects</b><p>Imports existing "
+ "subprojects containing Makefile.am.</qt>"));
+
+ QToolTip::add( m_button2, tr2i18n( "Add Target..."));
+ addTargetAction = new AutoToolsAction( i18n( "Add Target..." ), "targetnew_kdevelop", 0,
+ this, SLOT( slotAddTarget() ), actions, "add target" );
+ addTargetAction->setWhatsThis(i18n( "<qt><b>Add target</b><p>Adds a new target to "
+ "the currently selected subproject. Target can be a "
+ "binary program, library, script, also a collection of "
+ "data or header files.</qt>"));
+ addTargetAction->plug( m_button2 );
+
+ QToolTip::add( m_button3, tr2i18n( "Add Service..."));
+ addServiceAction = new AutoToolsAction( i18n( "Add Service..." ), "servicenew_kdevelop", 0, this,
+ SLOT( slotAddService() ), actions, "add service" );
+ addServiceAction->setWhatsThis(i18n("<qt><b>Add service</b><p>Creates a .desktop file describing the service.</qt>"));
+ addServiceAction->plug( m_button3 );
+
+ QToolTip::add( m_button4, tr2i18n( "Add Application..."));
+ addApplicationAction = new AutoToolsAction( i18n( "Add Application..." ), "window_new", 0, this,
+ SLOT( slotAddApplication() ), actions, "add application" );
+ addApplicationAction->setWhatsThis(i18n("<qt><b>Add application</b><p>Creates an application .desktop file.</qt>"));
+ addApplicationAction->plug( m_button4 );
+
+ QToolTip::add( m_button5, tr2i18n( "Build"));
+ buildSubprojectAction = new AutoToolsAction( i18n( "Build" ), "launch", 0, this,
+ SLOT( slotBuildSubproject() ), actions, "build subproject" );
+ buildSubprojectAction->setWhatsThis(i18n("<qt><b>Build</b><p>Runs <b>make</b> from the directory of "
+ "the selected subproject.<br> Environment variables and "
+ "make arguments can be specified in the project settings "
+ "dialog, <b>Make Options</b> tab.</qt>"));
+ buildSubprojectAction->plug( m_button5 );
+
+ forceReeditSubprojectAction = new KAction( i18n( "Force Reedit" ), 0, 0, this,
+ SLOT( slotForceReeditSubproject() ), actions, "force-reedit subproject" );
+ forceReeditSubprojectAction->setWhatsThis(i18n("<qt><b>Force Reedit</b><p>Runs <b>make force-reedit</b> "
+ "from the directory of the selected subproject.<br>This "
+ "recreates makefile (tip: and solves most of .moc related "
+ "problems)<br>Environment variables and make arguments can "
+ "be specified in the project settings dialog, "
+ "<b>Make Options</b> tab.</qt>"));
+
+ if (!m_part->isKDE())
+ forceReeditSubprojectAction->setEnabled(false);
+
+ cleanSubprojectAction = new KAction( i18n( "Clean" ), 0, 0, this,
+ SLOT( slotCleanSubproject() ), actions, "clean subproject" );
+ cleanSubprojectAction->setWhatsThis(i18n("<qt><b>Clean</b><p>Runs <b>make clean</b> from the directory of "
+ "the selected subproject.<br> Environment variables and make "
+ "arguments can be specified in the project settings dialog, "
+ "<b>Make Options</b> tab.</qt>"));
+
+ installSubprojectAction = new KAction( i18n( "Install" ), 0, 0, this,
+ SLOT( slotInstallSubproject() ), actions, "install subproject" );
+ installSubprojectAction->setWhatsThis(i18n("<qt><b>Install</b><p>Runs <b>make install</b> from the directory "
+ "of the selected subproject.<br> Environment variables and "
+ "make arguments can be specified in the project settings "
+ "dialog, <b>Make Options</b> tab.</qt>"));
+ installSuSubprojectAction = new KAction( i18n( "Install (as root user)" ), 0, 0,
+ this, SLOT( slotInstallSuSubproject() ), actions, "install subproject as root" );
+ installSuSubprojectAction->setWhatsThis(i18n("<qt><b>Install as root user</b><p>Runs <b>make install</b> "
+ "command from the directory of the selected subproject "
+ "with root privileges.<br> It is executed via kdesu "
+ "command.<br> Environment variables and make arguments "
+ "can be specified in the project settings dialog, "
+ "<b>Make Options</b> tab.</qt>"));
+
+ expandAction = new KAction( i18n( "Expand Subtree" ), 0, 0, this,
+ SLOT(slotExpandTree()), actions, "expandAction" );
+ collapseAction = new KAction( i18n( "Collapse Subtree" ), 0, 0, this,
+ SLOT(slotCollapseTree()), actions, "collapseAction" );
+
+ otherAction = new KAction( i18n( "Manage Custom Commands..." ), 0, 0, this,
+ SLOT( slotManageBuildCommands() ), actions, "manage custom commands" );
+ otherAction->setWhatsThis(i18n("<qt><b>Manage custom commands</b><p>Allows to create, edit and "
+ "delete custom build commands which appears in the subproject "
+ "context menu.<br></qt>"));
+
+ connect( m_listView, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
+ this, SLOT( slotContextMenu( KListView*, QListViewItem*, const QPoint& ) ) );
+}
+
+void AutoSubprojectView::slotContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ if ( !item )
+ return ;
+
+ KPopupMenu popup( i18n( "Subproject: %1" ).arg( item->text( 0 ) ), this );
+
+ subProjectOptionsAction->plug( &popup );
+ popup.insertSeparator();
+ addSubprojectAction->plug( &popup );
+ addTargetAction->plug( &popup );
+ addServiceAction->plug( &popup );
+ addApplicationAction->plug( &popup );
+ popup.insertSeparator();
+ addExistingSubprojectAction->plug( &popup );
+ popup.insertSeparator();
+ removeSubprojectAction->plug( &popup );
+ popup.insertSeparator();
+ buildSubprojectAction->plug( &popup );
+ popup.insertSeparator();
+ forceReeditSubprojectAction->plug( &popup );
+ cleanSubprojectAction->plug( &popup );
+ popup.insertSeparator();
+ installSubprojectAction->plug( &popup );
+ installSuSubprojectAction->plug( &popup );
+ popup.insertSeparator();
+ collapseAction->plug( &popup );
+ expandAction->plug( &popup );
+
+ KConfig *config = m_part->instance()->config();
+ bool separate = true;
+ QMap<QString,QString> customBuildCommands = config->entryMap("CustomCommands");
+ for (QMap<QString,QString>::const_iterator it = customBuildCommands.constBegin();
+ it != customBuildCommands.constEnd(); ++it)
+ {
+ if (separate)
+ {
+ popup.insertSeparator();
+ separate = false;
+ }
+ int id = popup.insertItem(it.key(), this, SLOT(slotCustomBuildCommand(int)));
+ m_commandList.append(it.data());
+ popup.setItemParameter(id, m_commandList.findIndex(it.data()));
+ }
+
+ popup.insertSeparator();
+ otherAction->plug( &popup );
+
+ KURL::List urls;
+ urls.append(m_widget->selectedSubproject()->path);
+ FileContext context(urls);
+ m_part->core()->fillContextMenu( &popup, &context );
+
+ popup.exec( p );
+}
+
+void AutoSubprojectView::slotSubprojectOptions()
+{
+ kdDebug( 9020 ) << "AutoSubprojectView::slotSubprojectOptions()" << endl;
+
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ SubprojectOptionsDialog dlg( m_part, m_widget, spitem, this, "subproject options dialog" );
+ dlg.exec();
+}
+
+
+void AutoSubprojectView::slotAddSubproject()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ AddSubprojectDialog dlg( m_part, this, spitem, this, "add subproject dialog" );
+
+ dlg.setCaption ( i18n ( "Add New Subproject to '%1'" ).arg ( spitem->subdir ) );
+ dlg.exec();
+}
+
+
+void AutoSubprojectView::slotAddExistingSubproject()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ AddExistingDirectoriesDialog dlg ( m_part, m_widget, spitem, this, "add existing subprojects" );
+
+ dlg.setCaption ( i18n ( "Add Existing Subproject to '%1'" ).arg ( spitem->subdir ) );
+ dlg.targetLabel->setText("");
+ dlg.directoryLabel->setText(spitem->path);
+
+ if ( dlg.exec() )
+ emit selectionChanged ( spitem );
+}
+
+void AutoSubprojectView::slotAddTarget()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ AddTargetDialog dlg( m_widget, spitem, this, "add target dialog" );
+
+ dlg.setCaption ( i18n ( "Add New Target to '%1'" ).arg ( spitem->subdir ) );
+
+ // Update the details view if a target was added
+ if ( dlg.exec() )
+ emit selectionChanged( spitem );
+}
+
+
+void AutoSubprojectView::slotAddService()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ AddServiceDialog dlg( m_widget, spitem, this, "add service dialog" );
+
+ dlg.setCaption ( i18n ( "Add New Service to '%1'" ).arg ( spitem->subdir ) );
+
+ // Update the details view if a service was added
+ if ( dlg.exec() )
+ emit selectionChanged( spitem );
+}
+
+
+void AutoSubprojectView::slotAddApplication()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ AddApplicationDialog dlg( m_widget, spitem, this, "add application dialog" );
+
+ dlg.setCaption ( i18n ( "Add New Application to '%1'" ).arg ( spitem->subdir ) );
+
+ // Update the details view if an application was added
+ if ( dlg.exec() )
+ emit selectionChanged( spitem );
+}
+
+
+void AutoSubprojectView::slotBuildSubproject()
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, QString::fromLatin1( "" ) );
+}
+
+void AutoSubprojectView::slotRemoveSubproject()
+{
+ kdDebug(9020) << "AutoSubprojectView::slotRemoveSubproject()" << endl;
+
+ SubprojectItem* spitem = static_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if( !spitem )
+ return;
+
+ SubprojectItem* parent = static_cast<SubprojectItem*>( spitem->parent() );
+ if( !parent || !parent->listView() || spitem->childCount() != 0 ){
+ KMessageBox::error( 0, i18n("This item cannot be removed"), i18n("Automake Manager") );
+ return;
+ }
+
+ QStringList list = QStringList::split( QRegExp("[ \t]"), parent->variables["SUBDIRS"] );
+ QStringList::Iterator it = list.find( spitem->subdir );
+ QString subdirToRemove = spitem->subdir;
+ bool topsubdirs = true;
+ if ((parent->variables["SUBDIRS"].find("$(TOPSUBDIRS)") == -1)
+ && (parent->variables["SUBDIRS"].find("$(AUTODIRS)") == -1))
+ {
+ topsubdirs = false;
+ if( it == list.end() ){
+ KMessageBox::sorry(this, i18n("There is no subproject %1 in SUBDIRS").arg(spitem->subdir));
+ return;
+ }
+ }
+
+ RemoveSubprojectDialog dlg(i18n("Remove Subproject %1").arg(spitem->text(0)),
+ i18n("Do you really want to remove subproject %1 with all targets and files?").arg(spitem->text(0)));
+ if( dlg.exec() ){
+
+ bool removeSources = dlg.removeFromDisk();
+
+ if (!topsubdirs)
+ {
+ list.remove( it );
+ parent->variables[ "SUBDIRS" ] = list.join( " " );
+ }
+
+ parent->listView()->setSelected( parent, true );
+ kapp->processEvents( 500 );
+
+
+ if( removeSources ){
+ kdDebug(9020) << "remove dir " << spitem->path << endl;
+ AutoProjectPrivate::removeDir( spitem->path );
+ }
+
+ if( m_widget->activeSubproject() == spitem ){
+ m_widget->setActiveSubproject( 0 );
+ }
+
+ // Adjust AC_OUTPUT in configure.in
+ if ( !m_part->isKDE() ) {
+
+ QString projroot = m_part->projectDirectory() + "/";
+ QString subdirectory = spitem->path;
+ QString relpath = subdirectory.replace(0, projroot.length(),"");
+
+ QString configureFile = m_part->getAutoConfFile(projroot);
+
+ QStringList list = AutoProjectTool::configureinLoadMakefiles(configureFile);
+
+ QStringList::iterator it;
+
+ for ( it = list.begin(); it != list.end(); it++ ) {
+ QString current = (QString) (*it);
+ QRegExp path_regex(relpath);
+ if ( path_regex.search(current) >= 0) {
+ list.remove(it);
+ break;
+ }
+ }
+ AutoProjectTool::configureinSaveMakefiles(configureFile, list);
+
+ }
+
+ // remove all targets
+ spitem->targets.setAutoDelete( true );
+ spitem->targets.clear();
+ delete( spitem );
+ spitem = 0;
+
+ // Adjust SUBDIRS variable in containing Makefile.am
+
+ if (parent->variables["SUBDIRS"].find("$(TOPSUBDIRS)") != -1)
+ {
+ QFile subdirsfile( parent->path + "/subdirs" );
+ QStringList topdirs;
+ if ( subdirsfile.open( IO_ReadOnly ) )
+ {
+ QTextStream subdirsstream( &subdirsfile );
+ while (!subdirsstream.atEnd())
+ topdirs.append(subdirsstream.readLine());
+ subdirsfile.close();
+ }
+ topdirs.remove(subdirToRemove);
+ if ( subdirsfile.open( IO_WriteOnly | IO_Truncate ) )
+ {
+ QTextStream subdirsstream( &subdirsfile );
+ for (QStringList::const_iterator it = topdirs.begin(); it != topdirs.end(); ++it)
+ subdirsstream << *it << endl;
+ subdirsfile.close();
+ }
+ }
+
+ QMap<QString,QString> replaceMap;
+ replaceMap.insert( "SUBDIRS", subdirToRemove );
+ AutoProjectTool::removeFromMakefileam( parent->path + "/Makefile.am", replaceMap );
+
+ QString relmakefile = ( parent->path + "/Makefile" ).mid( m_part->projectDirectory().length()+1 );
+ kdDebug(9020) << "Relative makefile path: " << relmakefile << endl;
+
+ // check for config.status
+ if( !QFileInfo(m_part->buildDirectory(), "config.status").exists() ){
+ return;
+ }
+
+ QString cmdline = "cd ";
+ cmdline += KProcess::quote(m_part->projectDirectory());
+ cmdline += " && automake ";
+ cmdline += KProcess::quote(relmakefile);
+ cmdline += " && cd ";
+ cmdline += KProcess::quote(m_part->buildDirectory());
+ cmdline += " && CONFIG_HEADERS=config.h CONFIG_FILES=";
+ cmdline += KProcess::quote(relmakefile);
+ cmdline += " ./config.status";
+ m_part->makeFrontend()->queueCommand( m_part->projectDirectory(), cmdline );
+ }
+}
+
+
+void AutoSubprojectView::parsePrimary( SubprojectItem *item,
+ const QString &lhs, const QString &rhs )
+{
+ // Parse line foo_bar = bla bla
+
+ int pos = lhs.findRev( '_' );
+ QString prefix = lhs.left( pos );
+ QString primary = lhs.right( lhs.length() - pos - 1 );
+ // kdDebug(9020) << "Prefix:" << prefix << ",Primary:" << primary << endl;
+
+
+#if 0
+
+ QStrList prefixes;
+ prefixes.append( "bin" );
+ prefixes.append( "pkglib" );
+ prefixes.append( "pkgdata" );
+ prefixes.append( "noinst" );
+ prefixes.append( "check" );
+ prefixes.append( "sbin" );
+ QStrList primaries;
+ primaries.append( "PROGRAMS" );
+ primaries.append( "LIBRARIES" );
+ primaries.append( "LTLIBRARIES" );
+ primaries.append( "SCRIPTS" );
+ primaries.append( "HEADERS" );
+ primaries.append( "DATA" );
+#endif
+
+ // Not all combinations prefix/primary are possible, so this
+ // could also be checked... not trivial because the list of
+ // possible prefixes can be extended dynamically (see below)
+ if ( primary == "PROGRAMS" || primary == "LIBRARIES" || primary == "LTLIBRARIES" )
+ {
+ QStringList l = QStringList::split( QRegExp( "[ \t\n]" ), rhs );
+ QStringList::Iterator it1;
+ for ( it1 = l.begin(); it1 != l.end(); ++it1 )
+ {
+ TargetItem *titem = m_widget->createTargetItem( *it1, prefix, primary );
+ item->targets.append( titem );
+
+ QString canonname = AutoProjectTool::canonicalize( *it1 );
+ titem->ldflags = AutoProjectPrivate::cleanWhitespace( item->variables[ canonname + "_LDFLAGS" ] );
+ titem->ldadd = AutoProjectPrivate::cleanWhitespace( item->variables[ canonname + "_LDADD" ] );
+ titem->libadd = AutoProjectPrivate::cleanWhitespace( item->variables[ canonname + "_LIBADD" ] );
+ titem->dependencies = AutoProjectPrivate::cleanWhitespace( item->variables[ canonname + "_DEPENDENCIES" ] );
+
+ QString sources = item->variables[ canonname + "_SOURCES" ];
+ QStringList sourceList = QStringList::split( QRegExp( "[ \t\n]" ), sources );
+ QMap<QString, bool> dict;
+ QStringList::Iterator it = sourceList.begin();
+ while( it != sourceList.end() ){
+ dict.insert( *it, true );
+ ++it;
+ }
+
+ QMap<QString, bool>::Iterator dictIt = dict.begin();
+ while( dictIt != dict.end() ){
+ QString fname = dictIt.key();
+ ++dictIt;
+
+ FileItem *fitem = m_widget->createFileItem( fname, item );
+ titem->sources.append( fitem );
+
+ if( AutoProjectPrivate::isHeader(fname) )
+ headers += fname;
+ }
+ }
+ }
+ else if ( primary == "SCRIPTS" || primary == "HEADERS" || primary == "DATA" )
+ {
+ // See if we have already such a group
+ for ( uint i = 0; i < item->targets.count(); ++i )
+ {
+ TargetItem *titem = item->targets.at( i );
+ if ( primary == titem->primary && prefix == titem->prefix )
+ {
+ item->targets.remove( i );
+ break;
+ }
+ }
+ // Create a new one
+ TargetItem *titem = m_widget->createTargetItem( "", prefix, primary );
+ item->targets.append( titem );
+
+ QStringList l = QStringList::split( QRegExp( "[ \t]" ), rhs );
+ QStringList::Iterator it3;
+ for ( it3 = l.begin(); it3 != l.end(); ++it3 )
+ {
+ QString fname = *it3;
+ FileItem *fitem = m_widget->createFileItem( fname, item );
+ titem->sources.append( fitem );
+
+ if( AutoProjectPrivate::isHeader(fname) )
+ headers += fname;
+
+ }
+ }
+ else if ( primary == "JAVA" )
+ {
+ QStringList l = QStringList::split( QRegExp( "[ \t\n]" ), rhs );
+ QStringList::Iterator it1;
+ TargetItem *titem = m_widget->createTargetItem( "", prefix, primary );
+ item->targets.append( titem );
+
+ for ( it1 = l.begin(); it1 != l.end(); ++it1 )
+ {
+ FileItem *fitem = m_widget->createFileItem( *it1, item );
+ titem->sources.append( fitem );
+ }
+ }
+}
+
+
+void AutoSubprojectView::parseKDEDOCS( SubprojectItem *item,
+ const QString & /*lhs*/, const QString & /*rhs*/ )
+{
+ // Handle the line KDE_ICON =
+ // (actually, no parsing is involved here)
+
+ QString prefix = "kde_docs";
+ QString primary = "KDEDOCS";
+
+ TargetItem *titem = m_widget->createTargetItem( "", prefix, primary );
+ item->targets.append( titem );
+
+ QDir d( item->path );
+ QStringList l = d.entryList( QDir::Files );
+
+ QRegExp re( "Makefile.*|\\..*|.*~|index.cache.bz2" );
+
+ QStringList::ConstIterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ {
+ if ( !re.exactMatch( *it ) )
+ {
+ QString fname = *it;
+ FileItem * fitem = m_widget->createFileItem( fname, item );
+ titem->sources.append( fitem );
+ }
+ }
+}
+
+
+void AutoSubprojectView::parseKDEICON( SubprojectItem *item,
+ const QString &lhs, const QString &rhs )
+{
+ // Parse a line foo_ICON = bla bla
+
+ int pos = lhs.find( "_ICON" );
+ QString prefix = lhs.left( pos );
+ if ( prefix == "KDE" )
+ prefix = "kde_icon";
+
+ QString primary = "KDEICON";
+
+ TargetItem *titem = m_widget->createTargetItem( "", prefix, primary );
+ item->targets.append( titem );
+
+ QDir d( item->path );
+ QStringList l = d.entryList( QDir::Files );
+
+ QString regexp;
+
+ if ( rhs == "AUTO" )
+ {
+ regexp = ".*\\.(png|mng|xpm)";
+ }
+ else
+ {
+ QStringList appNames = QStringList::split( QRegExp( "[ \t\n]" ), rhs );
+ regexp = ".*(-" + appNames.join( "|-" ) + ")\\.(png|mng|xpm)";
+ }
+
+ QRegExp re( regexp );
+
+ QStringList::ConstIterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ {
+ if ( re.exactMatch( *it ) )
+ {
+ FileItem * fitem = m_widget->createFileItem( *it, item );
+ titem->sources.append( fitem );
+ }
+ }
+}
+
+
+void AutoSubprojectView::parsePrefix( SubprojectItem *item,
+ const QString &lhs, const QString &rhs )
+{
+ // Parse a line foodir = bla bla
+ QString name = lhs.left( lhs.length() - 3 );
+ QString dir = rhs;
+ item->prefixes.insert( name, dir );
+}
+
+
+void AutoSubprojectView::parseSUBDIRS( SubprojectItem *item,
+ const QString & /*lhs*/, const QString &rhs )
+{
+ // Parse a line SUBDIRS = bla bla
+ QString subdirs = rhs;
+ kdDebug( 9020 ) << "subdirs are " << subdirs << endl;
+
+ // Take care of KDE hacks:
+ // TOPSUBDIRS is an alias for all directories
+ // listed in the subdirs file
+ if ( subdirs.find( "$(TOPSUBDIRS)" ) != -1 )
+ {
+ QStringList dirs;
+ QFile subdirsfile( item->path + "/subdirs" );
+ if( subdirsfile.exists() )
+ {
+ if ( subdirsfile.open( IO_ReadOnly ) )
+ {
+ QTextStream subdirsstream( &subdirsfile );
+ while ( !subdirsstream.atEnd() )
+ dirs.append( subdirsstream.readLine() );
+ subdirsfile.close();
+ }
+ } else
+ {
+ QDir d( item->path );
+ QStringList l = d.entryList( QDir::Dirs );
+ for( QStringList::const_iterator it = l.begin(); it != l.end(); ++it )
+ {
+ if( (*it) != "CVS" && (*it) != "admin" && (*it) != ".svn" && (*it) != "." && (*it) != ".." )
+ {
+ QDir subdir = d;
+ subdir.cd( *it, false );
+ if( subdir.exists( "Makefile.am" ) )
+ dirs.append( *it );
+ }
+ }
+
+ }
+ subdirs.replace( QRegExp( "\\$\\(TOPSUBDIRS\\)" ), dirs.join( " " ) );
+ }
+
+ // AUTODIRS is an alias for all subdirectories
+ if ( subdirs.find( "$(AUTODIRS)" ) != -1 )
+ {
+ QDir d( item->path );
+ QStringList dirs = d.entryList( QDir::Dirs );
+ dirs.remove( "." );
+ dirs.remove( ".." );
+ dirs.remove( "CVS" );
+ subdirs.replace( QRegExp( "\\$\\(AUTODIRS\\)" ), dirs.join( " " ) );
+ }
+
+ // If there are any variables in the subdirs line then search
+ // the Makefile(.am?) for its definition. Unfortunately, it may be
+ // defined outside this file in which case those dirs won't be added.
+ QRegExp varre( "\\$\\(\\s*(.*)\\s*\\)" );
+ varre.setMinimal( true );
+ while ( varre.search( subdirs ) != -1 )
+ {
+ QString varname = varre.cap( 1 );
+ QString varvalue;
+
+ // Search the whole Makefile(.am?)
+ // Note that if the variable isn't found it just disappears
+ // (Perhaps we should add it back in this case?)
+ QMap<QString, QString>::ConstIterator varit = item->variables.find( varname );
+ if ( varit != item->variables.end() )
+ {
+ kdDebug( 9020 ) << "Found Makefile var " << varname << ", adding dirs <" << varit.data() << ">" << endl;
+ varvalue = varit.data();
+ }
+ else
+ {
+ kdDebug( 9020 ) << "Not found Makefile var " << varname << endl;
+ }
+ subdirs.replace( QRegExp( "\\$\\(\\s*" + varname + "\\s*\\)" ), varvalue );
+ }
+
+ //search for AC_SUBST variables and try to replace them with variables
+ //that have been already defined e.g. in a "kdevelop hint"
+ varre = QRegExp( "\\@(.*)\\@" );
+ varre.setMinimal( true );
+ while ( varre.search( subdirs ) != -1 )
+ {
+ QString varname = varre.cap( 1 );
+ QString varvalue;
+
+ // Search the whole Makefile(.am?)
+ // Note that if the variable isn't found it just disappears
+ // (Perhaps we should add it back in this case?)
+ QMap<QString, QString>::ConstIterator varit = item->variables.find( varname );
+ if ( varit != item->variables.end() )
+ {
+ kdDebug( 9020 ) << "Found Makefile var " << varname << ", adding dirs <" << varit.data() << ">" << endl;
+ varvalue = varit.data();
+ }
+ else
+ {
+ kdDebug( 9020 ) << "Not found Makefile var " << varname << endl;
+ }
+ subdirs.replace( QRegExp( "\\@" + varname + "\\@" ), varvalue );
+ }
+
+ QStringList l = QStringList::split( QRegExp( "[ \t]" ), subdirs );
+ l.sort();
+ QStringList::Iterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ {
+ if ( *it == "." )
+ continue;
+ SubprojectItem *newitem = new SubprojectItem( item, ( *it ) );
+ newitem->subdir = ( *it );
+ newitem->path = item->path + "/" + ( *it );
+ parse( newitem );
+ // Experience tells me this :-)
+ bool open = true;
+ if ( newitem->subdir == "doc" )
+ open = false;
+ if ( newitem->subdir == "po" )
+ open = false;
+ if ( newitem->subdir == "pics" )
+ open = false;
+ if ( newitem && static_cast<SubprojectItem*>( newitem->parent() )
+ ->subdir == "doc" )
+ open = false;
+ if ( newitem && static_cast<SubprojectItem*>
+ ( newitem->parent() ) ->subdir == "po" )
+ open = false;
+ if ( newitem && static_cast<SubprojectItem*>
+ ( newitem->parent() ) ->subdir == "pics" )
+ open = false;
+ newitem->setOpen( open );
+
+ // Move to the bottom of the list
+ QListViewItem *lastItem = item->firstChild();
+ while ( lastItem->nextSibling()
+ )
+ lastItem = lastItem->nextSibling();
+ if ( lastItem != newitem )
+ newitem->moveItem( lastItem );
+ }
+}
+
+void AutoSubprojectView::parse( SubprojectItem *item )
+{
+ headers.clear();
+ AutoProjectTool::parseMakefileam( item->path + "/Makefile.am", &item->variables );
+
+ QMap<QString, QString>::ConstIterator it;
+ for ( it = item->variables.begin(); it != item->variables.end(); ++it )
+ {
+ QString lhs = it.key();
+ QString rhs = it.data();
+ if ( lhs == "KDE_DOCS" )
+ parseKDEDOCS( item, lhs, rhs );
+ else if ( lhs.right( 5 ) == "_ICON" )
+ parseKDEICON( item, lhs, rhs );
+ else if ( lhs.find( '_' ) > 0 )
+ parsePrimary( item, lhs, rhs );
+ else if ( lhs.right( 3 ) == "dir" )
+ parsePrefix( item, lhs, rhs );
+ else if ( lhs == "SUBDIRS" )
+ parseSUBDIRS( item, lhs, rhs );
+ }
+
+ /// @todo only if in a c++ project
+ TargetItem* noinst_HEADERS_item = findNoinstHeaders(item);
+
+ QDir dir( item->path );
+ QStringList headersList = QStringList::split( QRegExp("[ \t]"), item->variables[ "noinst_HEADERS" ] );
+
+ headersList += dir.entryList( "*.h;*.H;*.hh;*.hxx;*.hpp;*.tcc", QDir::Files );
+ headersList.sort();
+ headersList = QStringList::split(QRegExp("[ \t]"), headersList.join( " " ));
+
+ QStringList::Iterator fileIt = headersList.begin();
+ while( fileIt != headersList.end() ){
+ QString fname = *fileIt;
+ ++fileIt;
+
+ if( AutoProjectPrivate::isHeader(fname) && !headers.contains(fname) ){
+ FileItem *fitem = m_widget->createFileItem( fname, item );
+ noinst_HEADERS_item->sources.append( fitem );
+ }
+ }
+}
+
+void AutoSubprojectView::slotForceReeditSubproject( )
+{
+ SubprojectItem* spitem = dynamic_cast <SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, "force-reedit" );
+}
+
+void AutoSubprojectView::slotInstallSubproject( )
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, "install" );
+}
+
+void AutoSubprojectView::slotInstallSuSubproject( )
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, "install", true );
+}
+
+TargetItem * AutoSubprojectView::findNoinstHeaders( SubprojectItem *item )
+{
+ TargetItem* noinst_HEADERS_item = 0;
+ QPtrListIterator<TargetItem> itemIt( item->targets );
+ while( itemIt.current() ){
+ TargetItem* titem = itemIt.current();
+ ++itemIt;
+
+ if( titem->prefix == "noinst" && titem->primary == "HEADERS" ){
+ noinst_HEADERS_item = titem;
+ break;
+ }
+ }
+
+ if( !noinst_HEADERS_item ){
+ noinst_HEADERS_item = m_widget->createTargetItem( "", "noinst", "HEADERS" );
+ item->targets.append( noinst_HEADERS_item );
+ }
+
+ return noinst_HEADERS_item;
+}
+
+void AutoSubprojectView::slotCleanSubproject( )
+{
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, "clean" );
+}
+
+void AutoSubprojectView::focusOutEvent( QFocusEvent */* e*/ )
+{
+ m_widget->setLastFocusedView(AutoProjectWidget::SubprojectView);
+}
+
+void AutoSubprojectView::slotManageBuildCommands( )
+{
+ KConfig *config = m_part->instance()->config();
+ //menu item name <-> command
+ QMap<QString, QString> customBuildCommands = config->entryMap("CustomCommands");
+
+ KDialogBase dlg(KDialogBase::Plain, i18n("Manage Custom Commands"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok);
+ dlg.plainPage()->setMargin(0);
+ (new QVBoxLayout(dlg.plainPage(), 0, 0))->setAutoAdd(true);
+
+ ManageCustomCommand *widget = new ManageCustomCommand(dlg.plainPage());
+
+ for (QMap<QString,QString>::const_iterator it = customBuildCommands.constBegin();
+ it != customBuildCommands.constEnd(); ++it)
+ {
+ widget->commandsTable->insertRows(widget->commandsTable->numRows());
+ widget->setRowProperties(widget->commandsTable->numRows()-1);
+ widget->commandsTable->setText(widget->commandsTable->numRows() - 1, 0, it.key());
+ widget->commandsTable->setText(widget->commandsTable->numRows() - 1, 1,
+ it.data().section(":::", 0, 0));
+ static_cast<QComboTableItem*>(widget->commandsTable->
+ item(widget->commandsTable->numRows() - 1, 2))->
+ setCurrentItem(it.data().section(":::", 1, 1).toInt());
+ }
+
+ widget->commandsTable->setFocus();
+ if (dlg.exec() == QDialog::Accepted)
+ {
+ config->deleteGroup("CustomCommands");
+ config->setGroup("CustomCommands");
+ for (int i = 0; i < widget->commandsTable->numRows(); ++i)
+ {
+ config->writeEntry(widget->commandsTable->text(i, 0),
+ widget->commandsTable->text(i, 1)+":::"+
+ QString("%1").arg(static_cast<QComboTableItem*>(widget->
+ commandsTable->item(i, 2))->currentItem()));
+ }
+ config->sync();
+ }
+
+}
+
+void AutoSubprojectView::slotCustomBuildCommand(int val)
+{
+ QString cmd = m_commandList[val].section(":::", 0, 0);
+ int type = m_commandList[val].section(":::", 1, 1).toInt();
+
+ SubprojectItem* spitem = dynamic_cast<SubprojectItem*>( m_listView->selectedItem() );
+ if ( !spitem ) return;
+
+ QString relpath = "/" + URLUtil::getRelativePath( m_part->topsourceDirectory(), m_part->projectDirectory() ) + "/" + spitem->path.mid( m_part->projectDirectory().length() );
+ switch (type)
+ {
+ case 0: //make target
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, cmd );
+ break;
+ case 1: //make target as root
+ m_part->startMakeCommand( m_part->buildDirectory() + relpath, cmd, true );
+ break;
+ case 2: //make command
+ m_part->startSimpleMakeCommand( m_part->buildDirectory() + relpath, cmd );
+ break;
+ case 3: //make command as root
+ m_part->startSimpleMakeCommand( m_part->buildDirectory() + relpath, cmd, true );
+ break;
+ case 4: //command
+ m_part->appFrontend()->startAppCommand(m_part->buildDirectory() + relpath,
+ cmd, false);
+ break;
+ case 5: //command as root
+ m_part->appFrontend()->startAppCommand(m_part->buildDirectory() + relpath,
+ "kdesu -t -c ' cd " +
+ KProcess::quote(m_part->buildDirectory() + relpath) + " && "
+ + cmd + "'", false);
+ break;
+ }
+}
+
+void AutoSubprojectView::slotExpandTree()
+{
+ expandCollapseFirst( m_listView->currentItem(), true );
+}
+
+void AutoSubprojectView::slotCollapseTree()
+{
+ expandCollapseFirst( m_listView->currentItem(), false );
+}
+
+void AutoSubprojectView::expandCollapseFirst( QListViewItem * item, bool expand )
+{
+ if ( !item ) return;
+
+ if ( item == m_listView->firstChild() ) // special case for root node
+ {
+ item = item->firstChild();
+ while ( item )
+ {
+ expandCollapse( item, expand );
+ item = item->nextSibling();
+ }
+ }
+ else
+ {
+ expandCollapse( item, expand );
+ }
+}
+
+void AutoSubprojectView::expandCollapse( QListViewItem * item, bool expand )
+{
+ if ( !item ) return;
+
+ item->setOpen( expand );
+
+ item = item->firstChild();
+ while ( item )
+ {
+ expandCollapse( item, expand );
+ item = item->nextSibling();
+ }
+}
+
+#include "autosubprojectview.moc"
+
+// kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/buildtools/autotools/autosubprojectview.h b/buildtools/autotools/autosubprojectview.h
new file mode 100644
index 00000000..e49caddd
--- /dev/null
+++ b/buildtools/autotools/autosubprojectview.h
@@ -0,0 +1,130 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2002 by Victor Roeder <victor_roeder@gmx.de>
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+
+#ifndef AUTOSUBPROJECTVIEW_H
+#define AUTOSUBPROJECTVIEW_H
+
+#include <qwidget.h>
+#include "autoprojectviewbase.h"
+
+
+class KAction;
+class AutoToolsAction;
+class AutoProjectWidget;
+class AutoProjectPart;
+class TargetItem;
+class SubprojectItem;
+class KListViewItem;
+class KListView;
+
+namespace AutoProjectPrivate
+{
+ bool isHeader( const QString& fileName );
+}
+
+
+//with protected inheritance gcc 3.2.3 complains in autoprojectwidget.cpp, line 116
+//that it cannot access the base class QObject (for the connect() call),
+//so in order to be able to compile this file I made the inheritance public again, Alex
+class AutoSubprojectView : public AutoProjectViewBase
+{
+ Q_OBJECT
+
+public:
+ AutoSubprojectView( AutoProjectWidget* widget, AutoProjectPart* part, QWidget *parent, const char *name );
+ virtual ~AutoSubprojectView();
+
+public:
+ void loadMakefileams ( const QString& dir );
+
+ void parse( SubprojectItem *item );
+ KListView* listView() const
+ {
+ return m_listView;
+ }
+
+ TargetItem *findNoinstHeaders( SubprojectItem *item );
+
+signals:
+ void selectionChanged( QListViewItem* );
+
+protected:
+ void initActions ();
+
+ void parseKDEDOCS( SubprojectItem *item,
+ const QString &lhs, const QString &rhs );
+ void parseKDEICON( SubprojectItem *item,
+ const QString &lhs, const QString &rhs );
+ void parsePrimary( SubprojectItem *item,
+ const QString &lhs, const QString &rhs );
+ void parsePrefix( SubprojectItem *item,
+ const QString &lhs, const QString &rhs );
+ void parseSUBDIRS( SubprojectItem *item,
+ const QString &lhs, const QString &rhs );
+ virtual void focusOutEvent( QFocusEvent *e );
+ void expandCollapse( QListViewItem * item, bool expand );
+ void expandCollapseFirst( QListViewItem * item, bool expand );
+
+private:
+ AutoProjectWidget* m_widget;
+ AutoProjectPart* m_part;
+ QStringList headers;
+
+ bool m_kdeMode;
+
+ AutoToolsAction* addApplicationAction;
+ AutoToolsAction* subProjectOptionsAction;
+ AutoToolsAction* addSubprojectAction;
+ KAction* addExistingSubprojectAction;
+ AutoToolsAction* addTargetAction;
+ AutoToolsAction* addServiceAction;
+ AutoToolsAction* buildSubprojectAction;
+ KAction* removeSubprojectAction;
+ KAction* cleanSubprojectAction;
+ KAction* forceReeditSubprojectAction;
+ KAction* installSubprojectAction;
+ KAction* installSuSubprojectAction;
+ KAction* otherAction;
+ KAction* expandAction;
+ KAction* collapseAction;
+
+ QStringList m_commandList;
+ QValueList<int> m_commandTypeList;
+
+private slots:
+ void slotContextMenu( KListView *, QListViewItem *item, const QPoint &p );
+ //void slotSubprojectExecuted(QListViewItem* item);
+ void slotSelectionChanged( QListViewItem* item );
+ void slotAddApplication();
+ void slotSubprojectOptions();
+ void slotAddSubproject();
+ void slotAddExistingSubproject();
+ void slotAddTarget();
+ void slotAddService();
+ void slotBuildSubproject();
+ void slotRemoveSubproject();
+ void slotForceReeditSubproject();
+ void slotInstallSubproject();
+ void slotInstallSuSubproject();
+ void slotCleanSubproject();
+ void slotManageBuildCommands();
+ void slotCustomBuildCommand( int );
+ void slotExpandTree();
+ void slotCollapseTree();
+};
+
+#endif
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/autotoolsaction.cpp b/buildtools/autotools/autotoolsaction.cpp
new file mode 100644
index 00000000..63b38762
--- /dev/null
+++ b/buildtools/autotools/autotoolsaction.cpp
@@ -0,0 +1,156 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+ ***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************
+*/
+#include "autotoolsaction.h"
+
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+
+AutoToolsAction::~AutoToolsAction()
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name )
+: KAction( text, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name )
+: KAction( text, pix, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name )
+: KAction( text, pix, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const KGuiItem& item, const KShortcut & cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name )
+: KAction( item, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut,
+ QObject* parent, const char* name )
+: KAction( text, cut, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ QObject* parent, const char* name )
+: KAction( text, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix,
+ const KShortcut& cut, QObject* parent, const char* name )
+: KAction( text, pix, cut, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix,
+ const KShortcut& cut, QObject* parent, const char* name )
+: KAction( text, pix, cut, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QIconSet& pix,
+ const KShortcut& cut, const QObject* receiver,
+ const char* slot, QObject* parent, const char * name )
+: KAction( text, pix, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( const QString& text, const QString& pix,
+ const KShortcut & cut, const QObject* receiver,
+ const char* slot, QObject* parent, const char * name )
+: KAction( text, pix, cut, receiver, slot, parent, name )
+{
+}
+
+AutoToolsAction::AutoToolsAction( QObject * parent, const char * name )
+: KAction( parent, name )
+{
+}
+
+int AutoToolsAction::plug( QWidget* w, int index )
+{
+ if ( !w ) {
+ kdWarning(129) << "KAction::plug called with 0 argument\n";
+ return -1;
+ }
+
+ // Check if action is permitted
+ if (kapp && !kapp->authorizeKAction(name()))
+ return -1;
+
+ if ( ::qt_cast<QToolButton*>( w ) )
+ {
+ QToolButton* tb = static_cast<QToolButton*>( w );
+ connect( tb, SIGNAL( clicked() ), this, SLOT( activate() ) );
+ int id = getToolButtonID();
+
+ if ( !icon().isEmpty() )
+ tb->setPixmap( SmallIcon( icon() ) );
+ else
+ tb->setText( text() );
+
+ if ( !isEnabled() )
+ tb->setEnabled( false );
+
+ if ( !whatsThis().isEmpty() )
+ {
+ QWhatsThis::remove( tb );
+ QWhatsThis::add( tb, whatsThisWithIcon() );
+ }
+
+ if ( !toolTip().isEmpty() )
+ {
+ QToolTip::remove( tb );
+ QToolTip::add( tb, toolTip() );
+ }
+
+ addContainer( tb, id );
+
+ return containerCount() - 1;
+ }
+
+ return KAction::plug( w, index );
+}
+
+void AutoToolsAction::updateEnabled( int i )
+{
+ QWidget* w = container( i );
+
+ if ( ::qt_cast<QToolButton*>( w ) )
+ static_cast<QToolButton*>( w )->setEnabled( isEnabled() );
+ else
+ KAction::updateEnabled( i ) ;
+}
+
+
+
+//kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/autotoolsaction.h b/buildtools/autotools/autotoolsaction.h
new file mode 100644
index 00000000..97c8e79e
--- /dev/null
+++ b/buildtools/autotools/autotoolsaction.h
@@ -0,0 +1,70 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+#ifndef AUTOTOOLSACTION_H
+#define AUTOTOOLSACTION_H
+
+#include <kxmlguiclient.h>
+#include <kaction.h>
+
+class QObject;
+class KActionCollection;
+
+/**
+ * A KAction derivative that will work with the QToolButtons used in
+ * the Automake Manager
+ * @author Matt Rogers
+ */
+class AutoToolsAction : public KAction
+{
+public:
+ virtual ~AutoToolsAction();
+
+ AutoToolsAction( const QString& text, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name );
+
+ AutoToolsAction( const QString& text, const QIconSet& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name );
+
+ AutoToolsAction( const QString& text, const QString& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name );
+
+ AutoToolsAction( const KGuiItem& item, const KShortcut& cut,
+ const QObject* receiver, const char* slot,
+ KActionCollection* parent, const char* name );
+
+ AutoToolsAction( const QString& text, const KShortcut& cut = KShortcut(), QObject* parent = 0, const char* name = 0 );
+ AutoToolsAction( const QString& text, const KShortcut& cut,
+ const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
+ AutoToolsAction( const QString& text, const QIconSet& pix, const KShortcut& cut = KShortcut(),
+ QObject* parent = 0, const char* name = 0 );
+ AutoToolsAction( const QString& text, const QString& pix, const KShortcut& cut = KShortcut(),
+ QObject* parent = 0, const char* name = 0 );
+ AutoToolsAction( const QString& text, const QIconSet& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
+ AutoToolsAction( const QString& text, const QString& pix, const KShortcut& cut,
+ const QObject* receiver, const char* slot, QObject* parent,
+ const char* name = 0 );
+ AutoToolsAction( QObject* parent = 0, const char* name = 0 );
+
+ virtual int plug( QWidget *widget, int index = -1 );
+
+ virtual void updateEnabled( int i );
+};
+
+#endif
+
+//kate: indent-mode csands; tab-width 4; auto-insert-doxygen on;
diff --git a/buildtools/autotools/choosetargetdialog.cpp b/buildtools/autotools/choosetargetdialog.cpp
new file mode 100644
index 00000000..b35c5c75
--- /dev/null
+++ b/buildtools/autotools/choosetargetdialog.cpp
@@ -0,0 +1,348 @@
+/***************************************************************************
+ -------------------
+ begin : 29.11.2002
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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 "choosetargetdialog.h"
+
+#include <qcheckbox.h>
+#include <qwidget.h>
+#include <qgroupbox.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qptrlist.h>
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+
+#include <kcombobox.h>
+#include <kdialog.h>
+#include <kdebug.h>
+#include <klistview.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <ksqueezedtextlabel.h>
+#include <kurl.h>
+
+#include "choosetargetdlgbase.h"
+#include "autodetailsview.h"
+#include "autolistviewitems.h"
+#include "autosubprojectview.h"
+#include "misc.h"
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+
+#include "kdevpartcontroller.h"
+
+class ChooseTargetDialog::Private
+{
+public:
+ AutoProjectWidget* widget;
+ AutoProjectPart* part;
+ QStringList fileList;
+ QPtrList<SubprojectItem> subprojectList;
+ SubprojectItem* chosenSubproject;
+ TargetItem* chosenTarget;
+ ChooseTargetDlgBase* baseUI;
+};
+
+ChooseTargetDialog::ChooseTargetDialog ( AutoProjectWidget* widget, AutoProjectPart* part,
+ QStringList fileList, QWidget* parent, const char* name )
+: KDialogBase( parent, name, false, i18n("Automake Manager - Choose Target"),
+ Ok | Cancel, KDialogBase::Ok, true /* seperator */ )
+
+{
+ Q_UNUSED( parent );
+ Q_UNUSED( name );
+ d = new ChooseTargetDialog::Private;
+ d->widget = widget;
+ d->part = part;
+ d->fileList = fileList;
+ d->subprojectList = widget->allSubprojectItems();
+ d->baseUI = new ChooseTargetDlgBase( this, "base ui" );
+ setMainWidget( d->baseUI );
+
+ d->baseUI->subprojectComboBox->setAutoCompletion( true );
+ d->baseUI->targetComboBox->setAutoCompletion( true );
+ d->baseUI->newFileList->header()->hide();
+ d->baseUI->newFileList->addColumn( QString::null );
+ d->baseUI->newFileList->setSorting(-1);
+
+ setIcon ( SmallIcon ( "target_kdevelop" ) );
+
+
+ QPtrListIterator<SubprojectItem> sit(d->subprojectList);
+ for ( ; (*sit); ++sit )
+ {
+ QPtrList<TargetItem> targetList = (*sit)->targets;
+ QPtrListIterator<TargetItem> targetIt(targetList);
+
+ // Only insert Subproject which have a "regular" target
+ for ( ; (*targetIt); ++targetIt )
+ {
+ QString titemPrimary = (*targetIt)->primary;
+ if ( titemPrimary == "PROGRAMS" || titemPrimary == "LIBRARIES" ||
+ titemPrimary == "LTLIBRARIES" || titemPrimary == "JAVA" )
+ {
+ d->baseUI->subprojectComboBox->insertItem ( SmallIcon ( "folder" ), (*sit)->subdir );
+ }
+ }
+ }
+
+ if ( d->widget->activeTarget() && d->widget->activeSubproject() )
+ {
+ d->chosenTarget = d->widget->activeTarget();
+ //kdDebug ( 9020 ) << "1) Chosen target is " << d->chosenTarget->name << endl;
+ d->chosenSubproject = widget->activeSubproject();
+ d->baseUI->chosenTargetLabel->setText( ( widget->activeSubproject()->path + "/<b>" +
+ d->widget->activeTarget()->name + "</b>" )
+ .mid( d->part->projectDirectory().length() + 1 ) );
+ d->baseUI->subprojectComboBox->setEnabled( false );
+ d->baseUI->targetComboBox->setEnabled( false );
+
+ d->baseUI->subprojectComboBox->setCurrentItem( widget->activeSubproject()->subdir );
+ slotSubprojectChanged( widget->activeSubproject()->subdir );
+ }
+ else
+ {
+ d->baseUI->activeTargetRadioButton->toggle();
+ d->baseUI->activeTargetRadioButton->setEnabled ( false );
+ d->baseUI->neverAskAgainCheckbox->setEnabled ( false );
+
+ slotSubprojectChanged ( d->baseUI->subprojectComboBox->text(0) );
+ }
+
+ QStringList::iterator it;
+ QString fileName;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ int pos = ( *it ).findRev('/');
+ if (pos != -1)
+ fileName = ( *it ).mid(pos+1);
+ else
+ fileName = ( *it );
+
+
+ d->baseUI->newFileList->insertItem( new QListViewItem( d->baseUI->newFileList, fileName ) );
+ }
+
+ connect ( d->baseUI->subprojectComboBox, SIGNAL ( activated ( const QString& ) ),
+ this, SLOT( slotSubprojectChanged ( const QString& ) ) );
+ connect ( d->baseUI->targetComboBox, SIGNAL ( activated ( const QString& ) ),
+ this, SLOT( slotTargetChanged ( const QString& ) ) );
+}
+
+
+ChooseTargetDialog::~ChooseTargetDialog()
+{
+}
+
+void ChooseTargetDialog::slotSubprojectChanged ( const QString& name )
+{
+ d->chosenTarget = 0;
+ SubprojectItem* spitem = d->subprojectList.first();
+
+ for ( ; spitem; spitem = d->subprojectList.next() )
+ {
+ if ( spitem->subdir == name )
+ {
+ QPtrList <TargetItem> targetList = spitem->targets;
+ TargetItem* titem = targetList.first();
+
+ d->baseUI->targetComboBox->clear();
+
+/* choosenSubprojectLabel->setText ( ( spitem->path + "<b>" + ->name + "</b>" ).mid ( d->widget->projectDirectory().length() + 1 ) );*/
+
+ d->chosenSubproject = spitem;
+
+ for ( ; titem; titem = targetList.next() )
+ {
+ if ( titem->primary == "PROGRAMS" || titem->primary == "LIBRARIES" ||
+ titem->primary == "LTLIBRARIES" || titem->primary == "JAVA" )
+ {
+ d->baseUI->targetComboBox->insertItem ( SmallIcon ( "target_kdevelop" ), titem->name );
+
+ //d->baseUI->targetComboBox->addToHistory ( titem->name );
+
+ // if the Active Target is in the currently selected Subproject
+ if ( d->widget->activeTarget() &&
+ titem->name == d->widget->activeTarget()->name )
+ {
+ d->baseUI->targetComboBox->setCurrentItem( titem->name );
+ d->baseUI->chosenTargetLabel->setText( ( spitem->path + "/<b>" + titem->name + "</b>" ).mid( d->part->projectDirectory().length() + 1 ) );
+ d->chosenTarget = titem;
+ //kdDebug ( 9020 ) << "2) Chosen target is " << d->chosenTarget->name << endl;
+ }
+ else
+ {
+ //d->baseUI->targetComboBox->setCurrentItem ( 0 );
+ if ( !d->chosenTarget )
+ {
+ d->baseUI->chosenTargetLabel->setText( ( spitem->path + "/<b>" + titem->name + "</b>")
+ .mid( d->part->projectDirectory().length() + 1 ) );
+ //choosenSubprojectLabel->setText ( ( spitem->path + "<b>" + titem->name + "</b>" ).mid ( d->widget->projectDirectory().length() + 1 ) );
+
+ d->chosenTarget = titem;
+ }
+ //kdDebug ( 9020 ) << "2a) Chosen target is " << d->chosenTarget->name << endl;
+ }
+ }
+ }
+
+ break;
+ }
+ }
+}
+
+void ChooseTargetDialog::slotTargetChanged( const QString& name )
+{
+ d->baseUI->chosenTargetLabel->setText( ( d->chosenSubproject->path + "/<b>" + name + "</b>" )
+ .mid( d->part->projectDirectory().length() + 1 ) );
+
+ QPtrList <TargetItem> targetList = d->chosenSubproject->targets;
+ TargetItem* titem = targetList.first();
+
+ for ( ; titem; titem = targetList.next() )
+ {
+ if ( titem->name == name )
+ {
+ d->chosenTarget = titem;
+ //kdDebug ( 9020 ) << "4) Chosen target is " << d->chosenTarget->name << endl;
+
+ break;
+ }
+ }
+}
+
+void ChooseTargetDialog::slotOk()
+{
+ if ( d->baseUI->activeTargetRadioButton->isChecked() )
+ {
+ d->chosenTarget = d->widget->activeTarget();
+ d->chosenSubproject = d->widget->activeSubproject();
+ }
+ if ( !d->chosenSubproject || !d->chosenTarget )
+ return;
+
+ //kdDebug ( 9020 ) << "3) Chosen target is " << d->chosenTarget->name << endl;
+
+ QStringList newFileList;
+ QStringList::iterator it;
+ QString directory, fileName;
+
+ for ( it = d->fileList.begin(); it != d->fileList.end(); ++it )
+ {
+ bool found = false;
+
+ int pos = ( *it ).findRev('/');
+ if (pos != -1)
+ {
+ directory = ( *it ).left(pos);
+ fileName = ( *it ).mid(pos+1);
+ }
+ else
+ {
+ fileName = ( *it );
+ }
+
+ FileItem * fitem = d->chosenTarget->sources.first();
+ for ( ; fitem; fitem = d->chosenTarget->sources.next() )
+ {
+ if ( fitem->name == fileName )
+ {
+ KMessageBox::error ( this, i18n ( "The file %1 already exists in the chosen target.\nThe file will be created but will not be added to the target.\n"
+ "Rename the file and select 'Add Existing Files' from the Automake Manager." ).arg ( fitem->name ),
+ i18n ( "Error While Adding Files" ) );
+ found = true;
+ }
+ }
+
+ if ( !found )
+ {
+ /// \FIXME a quick hack to prevent adding header files to _SOURCES
+ /// and display them in noinst_HEADERS
+ if (AutoProjectPrivate::isHeader(fileName) &&
+ ( d->chosenTarget->primary == "PROGRAMS" || d->chosenTarget->primary == "LIBRARIES" || d->chosenTarget->primary == "LTLIBRARIES" ) )
+ {
+ kdDebug ( 9020 ) << "Ignoring header file and adding it to noinst_HEADERS: " << fileName << endl;
+ TargetItem* noinst_HEADERS_item = d->widget->getSubprojectView()->findNoinstHeaders(d->chosenSubproject);
+ FileItem *fitem = d->widget->createFileItem( fileName, d->chosenSubproject );
+ noinst_HEADERS_item->sources.append( fitem );
+ noinst_HEADERS_item->insertItem( fitem );
+
+ QString varname = "noinst_HEADERS";
+ d->chosenSubproject->variables[ varname ] += ( " " + fileName );
+
+ QMap<QString, QString> replaceMap;
+ replaceMap.insert( varname, d->chosenSubproject->variables[ varname ] );
+
+ AutoProjectTool::addToMakefileam( d->chosenSubproject->path + "/Makefile.am", replaceMap );
+ }
+ else
+ {
+ fitem = d->widget->createFileItem( fileName,d->chosenSubproject );
+ d->chosenTarget->sources.append( fitem );
+ d->chosenTarget->insertItem( fitem );
+
+ QString canontargetname = AutoProjectTool::canonicalize( d->chosenTarget->name );
+ QString varname = canontargetname + "_SOURCES";
+ d->chosenSubproject->variables[ varname ] += ( " " + fileName );
+
+ QMap<QString, QString> replaceMap;
+ replaceMap.insert( varname, d->chosenSubproject->variables[ varname ] );
+
+ AutoProjectTool::addToMakefileam( d->chosenSubproject->path + "/Makefile.am", replaceMap );
+ }
+ newFileList.append ( d->chosenSubproject->path.mid ( d->part->projectDirectory().length() + 1 ) + "/" + fileName );
+ }
+
+ if ( directory.isEmpty() || directory != d->chosenSubproject->subdir )
+ {
+ KShellProcess proc("/bin/sh");
+
+ proc << "mv";
+ proc << KShellProcess::quote( d->part->projectDirectory() + "/" + directory + "/" + fileName );
+ proc << KShellProcess::quote( d->chosenSubproject->path + "/" + fileName );
+ proc.start(KProcess::DontCare);
+ }
+
+ // why open the files?!
+// d->part->partController()->editDocument ( KURL ( d->chosenSubproject->path + "/" + fileName ) );
+
+ found = false;
+ }
+
+ d->widget->emitAddedFiles( newFileList );
+ KDialogBase::slotOk();
+}
+
+TargetItem* ChooseTargetDialog::chosenTarget()
+{
+ return d->chosenTarget;
+}
+
+SubprojectItem* ChooseTargetDialog::chosenSubproject()
+{
+ return d->chosenSubproject;
+}
+
+bool ChooseTargetDialog::alwaysUseActiveTarget() const
+{
+ return d->baseUI->neverAskAgainCheckbox->isChecked();
+}
+
+
+#include "choosetargetdialog.moc"
+//kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/choosetargetdialog.h b/buildtools/autotools/choosetargetdialog.h
new file mode 100644
index 00000000..44825ce5
--- /dev/null
+++ b/buildtools/autotools/choosetargetdialog.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ -------------------
+ begin : 29.11.2002
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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 _CHOOSETARGETDIALOG_H_
+#define _CHOOSETARGETDIALOG_H_
+
+#include <kdialogbase.h>
+
+class AutoProjectWidget;
+class AutoProjectPart;
+class SubprojectItem;
+class TargetItem;
+class QStringList;
+class QWidget;
+
+class ChooseTargetDialog : public KDialogBase
+{
+Q_OBJECT
+public:
+ ChooseTargetDialog( AutoProjectWidget* widget, AutoProjectPart* part,
+ QStringList fileList, QWidget* parent = 0,
+ const char* name = 0 );
+ ~ChooseTargetDialog();
+
+public:
+ TargetItem* chosenTarget();
+ SubprojectItem* chosenSubproject();
+
+ bool alwaysUseActiveTarget() const;
+
+public slots:
+ void slotSubprojectChanged ( const QString& );
+ void slotTargetChanged ( const QString& );
+
+protected:
+ virtual void slotOk();
+
+private:
+ class Private;
+ ChooseTargetDialog::Private* d;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/choosetargetdlgbase.ui b/buildtools/autotools/choosetargetdlgbase.ui
new file mode 100644
index 00000000..3581e595
--- /dev/null
+++ b/buildtools/autotools/choosetargetdlgbase.ui
@@ -0,0 +1,222 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ChooseTargetDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ChooseTargetDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>444</width>
+ <height>306</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>444</width>
+ <height>306</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Automake Manager - Choose Target</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>activeTargetRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>Add new files to m&amp;y active target</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>chooseTargetRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>Choose &amp;another target</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>chosenTargetGroupBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Choose &amp;Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KHistoryCombo" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>subprojectComboBox</cstring>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KHistoryCombo" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>targetComboBox</cstring>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>targetStaticLabel</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>chosenTargetLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>[TARGET]</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;New Files</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <property name="name">
+ <cstring>newFileList</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>cancelNoticeLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;&lt;b&gt;Note:&lt;/b&gt; If you cancel, your files will be created but will &lt;b&gt;not&lt;/b&gt; be added to the project.&lt;/qt&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>neverAskAgainCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>Do &amp;not ask me again and use always my active target</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>activeTargetRadioButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>chosenTargetGroupBox</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>activeTargetRadioButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>subprojectComboBox</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>activeTargetRadioButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>targetComboBox</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>activeTargetRadioButton</tabstop>
+ <tabstop>chooseTargetRadioButton</tabstop>
+ <tabstop>subprojectComboBox</tabstop>
+ <tabstop>targetComboBox</tabstop>
+ <tabstop>newFileList</tabstop>
+ <tabstop>neverAskAgainCheckbox</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">slotActiveTargetToggled(bool)</slot>
+ <slot access="protected">slotChooseTargetToggled(bool)</slot>
+ <slot access="private">slotSubprojectChanged(const QString&amp;)</slot>
+ <slot access="private">slotTargetChanged(const QString&amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/configureoptionswidget.cpp b/buildtools/autotools/configureoptionswidget.cpp
new file mode 100644
index 00000000..7e2db214
--- /dev/null
+++ b/buildtools/autotools/configureoptionswidget.cpp
@@ -0,0 +1,431 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "configureoptionswidget.h"
+
+#include <qcombobox.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qtimer.h>
+#include <qvalidator.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <klibloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kservice.h>
+#include <ktrader.h>
+
+#include "kdevcompileroptions.h"
+#include "autoprojectpart.h"
+#include "environmentvariableswidget.h"
+
+
+class ServiceComboBox
+{
+public:
+ static void insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
+ QStringList *names, QStringList *execs)
+ {
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ combo->insertItem((*it)->comment());
+ (*names) << (*it)->desktopEntryName();
+ (*execs) << (*it)->exec();
+ kdDebug(9020) << "insertStringList item " << (*it)->name() << "," << (*it)->exec() << endl;
+ }
+ }
+ static QString currentText(QComboBox *combo, const QStringList &names)
+ {
+ if (combo->currentItem() == -1)
+ return QString::null;
+ return names[combo->currentItem()];
+ }
+ static void setCurrentText(QComboBox *combo, const QString &str, const QStringList &names)
+ {
+ QStringList::ConstIterator it;
+ int i = 0;
+ for (it = names.begin(); it != names.end(); ++it) {
+ if (*it == str) {
+ combo->setCurrentItem(i);
+ break;
+ }
+ ++i;
+ }
+ }
+};
+
+
+ConfigureOptionsWidget::ConfigureOptionsWidget(AutoProjectPart *part, QWidget *parent, const char *name)
+ : ConfigureOptionsWidgetBase(parent, name)
+{
+ config_combo->setValidator(new QRegExpValidator(QRegExp("^\\D.*"), this));
+
+ m_part = part;
+ env_groupBox->setColumnLayout( 1, Qt::Vertical );
+ QDomDocument &dom = *part->projectDom();
+ m_environmentVariablesWidget = new EnvironmentVariablesWidget(dom, "/kdevautoproject/general/envvars", env_groupBox);
+
+ coffers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'C'");
+ cxxoffers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'C++'");
+ f77offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Fortran'");
+
+ ServiceComboBox::insertStringList(cservice_combo, coffers, &cservice_names, &cservice_execs);
+ ServiceComboBox::insertStringList(cxxservice_combo, cxxoffers, &cxxservice_names, &cxxservice_execs);
+ ServiceComboBox::insertStringList(f77service_combo, f77offers, &f77service_names, &f77service_execs);
+
+ if (coffers.isEmpty())
+ cflags_button->setEnabled(false);
+ if (cxxoffers.isEmpty())
+ cxxflags_button->setEnabled(false);
+ if (f77offers.isEmpty())
+ f77flags_button->setEnabled(false);
+
+ allConfigs = part->allBuildConfigs();
+ config_combo->insertStringList(allConfigs);
+
+ dirty = false;
+ currentConfig = QString::null;
+ configChanged(part->currentBuildConfig());
+
+ fixLayout();
+}
+
+
+ConfigureOptionsWidget::~ConfigureOptionsWidget()
+{}
+
+
+void ConfigureOptionsWidget::fixLayout()
+{
+ int w1 = ccompiler_label->sizeHint().width();
+ int w2 = cbinary_label->sizeHint().width();
+ int w3 = cflags_label->sizeHint().width();
+ int w4 = cxxcompiler_label->sizeHint().width();
+ int w5 = cxxbinary_label->sizeHint().width();
+ int w6 = cxxflags_label->sizeHint().width();
+ int w7 = f77compiler_label->sizeHint().width();
+ int w8 = f77binary_label->sizeHint().width();
+ int w9 = f77flags_label->sizeHint().width();
+
+ int w = QMAX(w1, QMAX(w2, w3));
+ w = QMAX(w, QMAX(w4, w5));
+ w = QMAX(w, QMAX(w6, w7));
+ w = QMAX(w, QMAX(w8, w9));
+
+ ccompiler_label->setMinimumWidth(w);
+ cxxcompiler_label->setMinimumWidth(w);
+ f77compiler_label->setMinimumWidth(w);
+}
+
+
+void ConfigureOptionsWidget::readSettings(const QString &config)
+{
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevautoproject/configurations/" + config + "/";
+ kdDebug(9020) << "Reading config from " << prefix << endl;
+
+ configargs_edit->setText(DomUtil::readEntry(dom, prefix + "configargs"));
+ QString builddir = DomUtil::readEntry(dom, prefix + "builddir");
+ if (builddir.isEmpty() && config != "default")
+ builddir = config;
+ builddir_edit->setText(builddir);
+
+ topsourcedir_edit->setText(DomUtil::readEntry(dom, prefix + "topsourcedir"));
+
+ cppflags_edit->setText(DomUtil::readEntry(dom, prefix + "cppflags"));
+ ldflags_edit->setText(DomUtil::readEntry(dom, prefix + "ldflags"));
+
+ QString ccompiler = DomUtil::readEntry(dom, prefix + "ccompiler");
+ QString cxxcompiler = DomUtil::readEntry(dom, prefix + "cxxcompiler");
+ QString f77compiler = DomUtil::readEntry(dom, prefix + "f77compiler");
+
+ if (ccompiler.isEmpty()) {
+ kdDebug(9020) << "No c compiler set" << endl;
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = coffers.begin(); it != coffers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ kdDebug(9020) << "Found default " << (*it)->name() << endl;
+ ccompiler = (*it)->name();
+ break;
+ }
+ }
+ }
+ if (cxxcompiler.isEmpty()) {
+ kdDebug(9020) << "No cxx compiler set" << endl;
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = cxxoffers.begin(); it != cxxoffers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ kdDebug(9020) << "Found default " << (*it)->name() << endl;
+ cxxcompiler = (*it)->name();
+ break;
+ }
+ }
+ }
+ if (f77compiler.isEmpty()) {
+ kdDebug(9020) << "No c compiler set" << endl;
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = f77offers.begin(); it != f77offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ kdDebug(9020) << "Found default " << (*it)->name() << endl;
+ f77compiler = (*it)->name();
+ break;
+ }
+ }
+ }
+
+ ServiceComboBox::setCurrentText(cservice_combo, ccompiler, cservice_names);
+ ServiceComboBox::setCurrentText(cxxservice_combo, cxxcompiler, cxxservice_names);
+ ServiceComboBox::setCurrentText(f77service_combo, f77compiler, f77service_names);
+
+ cbinary_edit->setText(DomUtil::readEntry(dom, prefix + "ccompilerbinary"));
+ cxxbinary_edit->setText(DomUtil::readEntry(dom, prefix + "cxxcompilerbinary"));
+ f77binary_edit->setText(DomUtil::readEntry(dom, prefix + "f77compilerbinary"));
+
+ cflags_edit->setText(DomUtil::readEntry(dom, prefix + "cflags"));
+ cxxflags_edit->setText(DomUtil::readEntry(dom, prefix + "cxxflags"));
+ f77flags_edit->setText(DomUtil::readEntry(dom, prefix + "f77flags"));
+
+ m_environmentVariablesWidget->readEnvironment(dom, prefix + "envvars");
+}
+
+
+void ConfigureOptionsWidget::saveSettings(const QString &config)
+{
+ m_environmentVariablesWidget->accept();
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevautoproject/configurations/" + config + "/";
+ kdDebug(9020) << "Saving config under " << prefix << endl;
+
+ DomUtil::writeEntry(dom, prefix + "configargs", configargs_edit->text());
+ DomUtil::writeEntry(dom, prefix + "builddir", builddir_edit->text());
+ DomUtil::writeEntry(dom, prefix + "topsourcedir", topsourcedir_edit->text());
+
+ DomUtil::writeEntry(dom, prefix + "cppflags", cppflags_edit->text());
+ DomUtil::writeEntry(dom, prefix + "ldflags", ldflags_edit->text());
+
+ QFileInfo fi(m_part->buildDirectory());
+ QDir dir(fi.dir());
+ dir.mkdir(fi.fileName());
+
+ DomUtil::writeEntry(dom, prefix + "ccompiler",
+ ServiceComboBox::currentText(cservice_combo, cservice_names));
+ DomUtil::writeEntry(dom, prefix + "cxxcompiler",
+ ServiceComboBox::currentText(cxxservice_combo, cxxservice_names));
+ DomUtil::writeEntry(dom, prefix + "f77compiler",
+ ServiceComboBox::currentText(f77service_combo, f77service_names));
+
+ DomUtil::writeEntry(dom, prefix + "ccompilerbinary", cbinary_edit->text());
+ DomUtil::writeEntry(dom, prefix + "cxxcompilerbinary", cxxbinary_edit->text());
+ DomUtil::writeEntry(dom, prefix + "f77compilerbinary", f77binary_edit->text());
+
+ DomUtil::writeEntry(dom, prefix + "cflags", cflags_edit->text());
+ DomUtil::writeEntry(dom, prefix + "cxxflags", cxxflags_edit->text());
+ DomUtil::writeEntry(dom, prefix + "f77flags", f77flags_edit->text());
+
+ if (KMessageBox::questionYesNo(this, i18n("Re-run configure for %1 now?").arg(config), QString::null, i18n("Rerun"), i18n("Do Not Run")) == KMessageBox::Yes)
+ QTimer::singleShot(0, m_part, SLOT(slotConfigure()));
+
+}
+
+
+void ConfigureOptionsWidget::setDirty()
+{
+ kdDebug(9020) << "config dirty" << endl;
+ dirty = true;
+}
+
+
+void ConfigureOptionsWidget::builddirClicked()
+{
+ QString dir = builddir_edit->text();
+ dir = KFileDialog::getExistingDirectory(dir, this);
+ if (!dir.isNull())
+ builddir_edit->setText(dir);
+}
+
+void ConfigureOptionsWidget::topsourcedirClicked()
+{
+ QString dir = topsourcedir_edit->text();
+ dir = KFileDialog::getExistingDirectory(dir, this);
+ if (!dir.isNull())
+ topsourcedir_edit->setText(dir);
+}
+
+void ConfigureOptionsWidget::configComboTextChanged(const QString &config)
+{
+ bool canAdd = !allConfigs.contains(config) && !config.contains("/") && !config.isEmpty();
+ bool canRemove = allConfigs.contains(config) && config != "default";
+ addconfig_button->setEnabled(canAdd);
+ removeconfig_button->setEnabled(canRemove);
+}
+
+
+void ConfigureOptionsWidget::configChanged(const QString &config)
+{
+ if (config == currentConfig || !allConfigs.contains(config))
+ return;
+
+ if (!currentConfig.isNull() && dirty)
+ saveSettings(currentConfig);
+
+ currentConfig = config;
+ readSettings(config);
+ dirty = false;
+
+ config_combo->blockSignals(true);
+ config_combo->setEditText(config);
+ config_combo->blockSignals(false);
+}
+
+
+void ConfigureOptionsWidget::configAdded()
+{
+ QString config = config_combo->currentText();
+
+ allConfigs.append(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+ configChanged(config);
+ setDirty(); // force saving
+}
+
+
+void ConfigureOptionsWidget::configRemoved()
+{
+ QString config = config_combo->currentText();
+
+ QDomDocument dom = *m_part->projectDom();
+ QDomNode node = dom.documentElement().namedItem("kdevautoproject").namedItem("configurations");
+ node.removeChild(node.namedItem(config));
+ allConfigs.remove(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+
+ currentConfig = QString::null;
+ configChanged("default");
+}
+
+
+void ConfigureOptionsWidget::cserviceChanged()
+{
+ QString exec = ServiceComboBox::currentText(cservice_combo, cservice_execs);
+ cbinary_edit->setText(exec);
+ kdDebug(9020) << "exec: " << exec << endl;
+}
+
+
+void ConfigureOptionsWidget::cxxserviceChanged()
+{
+ QString exec = ServiceComboBox::currentText(cxxservice_combo, cxxservice_execs);
+ cxxbinary_edit->setText(exec);
+}
+
+
+void ConfigureOptionsWidget::f77serviceChanged()
+{
+ QString exec = ServiceComboBox::currentText(f77service_combo, f77service_execs);
+ f77binary_edit->setText(exec);
+ kdDebug(9020) << "exec: " << exec << endl;
+}
+
+
+void ConfigureOptionsWidget::cflagsClicked()
+{
+ QString name = ServiceComboBox::currentText(cservice_combo, cservice_names);
+ KDevCompilerOptions *plugin = createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, cflags_edit->text());
+ cflags_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+
+void ConfigureOptionsWidget::cxxflagsClicked()
+{
+ QString name = ServiceComboBox::currentText(cxxservice_combo, cxxservice_names);
+ KDevCompilerOptions *plugin = createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, cxxflags_edit->text());
+ cxxflags_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+
+void ConfigureOptionsWidget::f77flagsClicked()
+{
+ QString name = ServiceComboBox::currentText(f77service_combo, f77service_names);
+ KDevCompilerOptions *plugin = createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, f77flags_edit->text());
+ f77flags_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+
+KDevCompilerOptions *ConfigureOptionsWidget::createCompilerOptions(const QString &name)
+{
+ KService::Ptr service = KService::serviceByDesktopName(name);
+ if (!service) {
+ kdDebug(9020) << "Can't find service " << name;
+ return 0;
+ }
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory) {
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ KMessageBox::error(0, i18n("There was an error loading the module %1.\n"
+ "The diagnostics is:\n%2").arg(service->name()).arg(errorMessage));
+ exit(1);
+ }
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(this, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions")) {
+ kdDebug(9020) << "Component does not inherit KDevCompilerOptions" << endl;
+ return 0;
+ }
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+
+ return dlg;
+}
+
+
+void ConfigureOptionsWidget::accept()
+{
+ DomUtil::writeEntry(*m_part->projectDom(), "/kdevautoproject/general/useconfiguration", currentConfig);
+ m_environmentVariablesWidget->accept();
+ if (dirty)
+ {
+ saveSettings(currentConfig);
+ }
+}
+
+#include "configureoptionswidget.moc"
diff --git a/buildtools/autotools/configureoptionswidget.h b/buildtools/autotools/configureoptionswidget.h
new file mode 100644
index 00000000..a973ce7d
--- /dev/null
+++ b/buildtools/autotools/configureoptionswidget.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _CONFIGUREOPTIONSWIDGET_H_
+#define _CONFIGUREOPTIONSWIDGET_H_
+
+#include "configureoptionswidgetbase.h"
+
+#include <ktrader.h>
+#include "domutil.h"
+
+
+class KDevCompilerOptions;
+class AutoProjectPart;
+class EnvironmentVariablesWidget;
+
+class ConfigureOptionsWidget : public ConfigureOptionsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ ConfigureOptionsWidget( AutoProjectPart *part, QWidget *parent = 0, const char *name = 0 );
+ ~ConfigureOptionsWidget();
+
+public slots:
+ void accept();
+
+private:
+ virtual void builddirClicked();
+ virtual void topsourcedirClicked();
+ virtual void setDirty();
+ virtual void configChanged( const QString &config );
+ virtual void configComboTextChanged( const QString &config );
+ virtual void configAdded();
+ virtual void configRemoved();
+ virtual void cflagsClicked();
+ virtual void cxxflagsClicked();
+ virtual void f77flagsClicked();
+ virtual void cserviceChanged();
+ virtual void cxxserviceChanged();
+ virtual void f77serviceChanged();
+
+ void fixLayout();
+ void readSettings( const QString &config );
+ void saveSettings( const QString &config );
+
+ KDevCompilerOptions *createCompilerOptions( const QString &lang );
+ KTrader::OfferList coffers, cxxoffers, f77offers;
+ QStringList cservice_names, cservice_execs;
+ QStringList cxxservice_names, cxxservice_execs;
+ QStringList f77service_names, f77service_execs;
+ QStringList allConfigs;
+ QString currentConfig;
+ bool dirty;
+
+ AutoProjectPart *m_part;
+ EnvironmentVariablesWidget* m_environmentVariablesWidget;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/configureoptionswidgetbase.ui b/buildtools/autotools/configureoptionswidgetbase.ui
new file mode 100644
index 00000000..0eb47ac7
--- /dev/null
+++ b/buildtools/autotools/configureoptionswidgetbase.ui
@@ -0,0 +1,1040 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ConfigureOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>configure_options_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>628</width>
+ <height>607</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>config_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Configuration:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>config_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>config_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Different build profiles</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>profiles</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer17_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer18_2</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>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabwidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>general_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>configargs_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Options to pass to configure, e.g. --prefix=&lt;install dir&gt;</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Options to pass to configure, e.g. --prefix=&lt;install dir&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>builddir_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Build directory (must be different for every different configuration):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>builddir_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer23</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="QLabel" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>topsourcedir_label</cstring>
+ </property>
+ <property name="text">
+ <string>Top source &amp;directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>topsourcedir_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>builddir_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The build process will place the object
+files and binary in this directory.
+
+If the name does not have a leading /
+then it is relative to the project directory.
+(in the General page)
+
+The build process also checks here for
+a Makefile and a configure script.
+
+If you have imported a project and you were
+building in the project directory, you
+probably want this to be blank.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The build process will place the object
+files and binary in this directory.
+
+If the name does not have a leading /
+then it is relative to the project directory.
+(in the General page)
+
+The build process also checks here for
+a Makefile and a configure script.
+
+If you have imported a project and you were
+building in the project directory, you
+probably want this to be blank.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="4">
+ <property name="name">
+ <cstring>builddir_button</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer24</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="QPushButton" row="6" column="4">
+ <property name="name">
+ <cstring>topsourcedir_button</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>topsourcedir_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Where to start looking for the src files.
+If the name does not have a leading /
+then it is relative to the project directory.
+(in the General page)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Where to start looking for the src files.
+If the name does not have a leading /
+then it is relative to the project directory.
+(in the General page)</string>
+ </property>
+ </widget>
+ <spacer row="6" column="0">
+ <property name="name">
+ <cstring>spacer17</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="QLabel" row="10" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>ldflags_label</cstring>
+ </property>
+ <property name="text">
+ <string>Li&amp;nker flags (LDFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ldflags_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Linker flags, e.g. -L&lt;lib dir&gt; if you have libraries in a
+nonstandard directory &lt;lib dir&gt;</string>
+ </property>
+ </widget>
+ <spacer row="11" column="0">
+ <property name="name">
+ <cstring>spacer17_2_2</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="KLineEdit" row="11" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>ldflags_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Linker flags, e.g. -L&lt;lib dir&gt; if you have libraries in a
+nonstandard directory &lt;lib dir&gt;</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Linker flags, e.g. -L&lt;lib dir&gt; if you have libraries in a
+nonstandard directory &lt;lib dir&gt;</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="9" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>cppflags_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>C/C++ preprocessor flags, e.g. -I&lt;include dir&gt; if you have
+headers in a nonstandard directory &lt;include dir&gt;</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>C/C++ preprocessor flags, e.g. -I&lt;include dir&gt; if you have
+headers in a nonstandard directory &lt;include dir&gt;</string>
+ </property>
+ </widget>
+ <spacer row="9" column="0">
+ <property name="name">
+ <cstring>spacer17_2</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="QLabel" row="8" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>cppflags_label</cstring>
+ </property>
+ <property name="text">
+ <string>C/C++ &amp;preprocessor flags (CPPFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cppflags_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>C/C++ preprocessor flags, e.g. -I&lt;include dir&gt; if you have
+headers in a nonstandard directory &lt;include dir&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>configargs_label</cstring>
+ </property>
+ <property name="text">
+ <string>Configure argu&amp;ments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>configargs_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="12" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>env_groupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Environment &amp;Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>c_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>C</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>ccompiler_label</cstring>
+ </property>
+ <property name="text">
+ <string>C com&amp;piler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cservice_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>cservice_combo</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>cflags_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler f&amp;lags (CFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>cflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>cflags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>Spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>168</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>cbinary_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler co&amp;mmand (CC):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cbinary_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>cbinary_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>cxx_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>C++</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>cxxcompiler_label</cstring>
+ </property>
+ <property name="text">
+ <string>C++ com&amp;piler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cxxservice_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>cxxservice_combo</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>cxxbinary_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler co&amp;mmand (CXX):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cxxbinary_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>cxxbinary_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer13_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>cxxflags_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler flags (C&amp;XXFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cxxflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>cxxflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>cxxflags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer row="5" 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>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>fortran_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>F&amp;ortran</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>f77compiler_label</cstring>
+ </property>
+ <property name="text">
+ <string>Fortra&amp;n compiler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>f77service_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>f77service_combo</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer16_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>f77binary_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler co&amp;mmand (F77):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>f77binary_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>f77binary_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>f77flags_label</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler f&amp;lags (FFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>f77flags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>f77flags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="2">
+ <property name="name">
+ <cstring>f77flags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>Spacer18</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>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cflags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>cflagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>f77flags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>f77flagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>cservice_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>cserviceChanged()</slot>
+ </connection>
+ <connection>
+ <sender>f77service_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>f77serviceChanged()</slot>
+ </connection>
+ <connection>
+ <sender>cxxflags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>cxxflagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>cxxservice_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>cxxserviceChanged()</slot>
+ </connection>
+ <connection>
+ <sender>addconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>configAdded()</slot>
+ </connection>
+ <connection>
+ <sender>removeconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>configRemoved()</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>configChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>configComboTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>builddir_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>builddirClicked()</slot>
+ </connection>
+ <connection>
+ <sender>configargs_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>builddir_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>cbinary_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>cflags_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>cxxbinary_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>cxxflags_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>f77binary_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>f77flags_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>topsourcedir_button</sender>
+ <signal>clicked()</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>topsourcedirClicked()</slot>
+ </connection>
+ <connection>
+ <sender>topsourcedir_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>cppflags_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>ldflags_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>configure_options_widget</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>configargs_edit</tabstop>
+ <tabstop>builddir_edit</tabstop>
+ <tabstop>builddir_button</tabstop>
+ <tabstop>topsourcedir_edit</tabstop>
+ <tabstop>topsourcedir_button</tabstop>
+ <tabstop>cppflags_edit</tabstop>
+ <tabstop>ldflags_edit</tabstop>
+ <tabstop>tabwidget</tabstop>
+ <tabstop>config_combo</tabstop>
+ <tabstop>addconfig_button</tabstop>
+ <tabstop>removeconfig_button</tabstop>
+ <tabstop>cservice_combo</tabstop>
+ <tabstop>cbinary_edit</tabstop>
+ <tabstop>cflags_edit</tabstop>
+ <tabstop>cflags_button</tabstop>
+ <tabstop>cxxservice_combo</tabstop>
+ <tabstop>cxxbinary_edit</tabstop>
+ <tabstop>cxxflags_edit</tabstop>
+ <tabstop>cxxflags_button</tabstop>
+ <tabstop>f77service_combo</tabstop>
+ <tabstop>f77binary_edit</tabstop>
+ <tabstop>f77flags_edit</tabstop>
+ <tabstop>f77flags_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">builddirClicked()</slot>
+ <slot access="protected">cflagsClicked()</slot>
+ <slot access="protected">configAdded()</slot>
+ <slot access="protected">configChanged(const QString&amp;)</slot>
+ <slot access="protected">configComboTextChanged(const QString&amp;)</slot>
+ <slot access="protected">configRemoved()</slot>
+ <slot access="protected">cserviceChanged()</slot>
+ <slot access="protected">cxxflagsClicked()</slot>
+ <slot access="protected">cxxserviceChanged()</slot>
+ <slot access="protected">f77flagsClicked()</slot>
+ <slot access="protected">f77serviceChanged()</slot>
+ <slot access="protected">setDirty()</slot>
+ <slot access="protected">topsourcedirClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/fileselectorwidget.cpp b/buildtools/autotools/fileselectorwidget.cpp
new file mode 100644
index 00000000..65b87bf7
--- /dev/null
+++ b/buildtools/autotools/fileselectorwidget.cpp
@@ -0,0 +1,243 @@
+/****************************************************************************
+ * Copyright (C) 2001 by Hugo Varotto *
+ * hugo@varotto-usa.com *
+ * *
+ * Based on Kate's fileselector widget by *
+ * Matt Newell *
+ * (C) 2001 by Matt Newell *
+ * newellm@proaxis.com *
+ * *
+ * 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 <qlayout.h>
+#include <qpushbutton.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qstrlist.h>
+#include <qtooltip.h>
+#include <qregexp.h>
+
+#include <kxmlguiclient.h>
+#include <kiconloader.h>
+#include <kurlcombobox.h>
+#include <kurlcompletion.h>
+#include <kprotocolinfo.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kcombobox.h>
+
+#include <kdebug.h>
+
+#include "fileselectorwidget.h"
+#include <kdiroperator.h>
+#include <kcombiview.h>
+#include <kfilepreview.h>
+#include <kfileview.h>
+#include <kfileitem.h>
+#include <kimagefilepreview.h>
+
+#include "autoprojectwidget.h"
+#include "autoprojectpart.h"
+#include "kdevlanguagesupport.h"
+
+#include "kfilednddetailview.h"
+#include "kfiledndiconview.h"
+
+KDnDDirOperator::KDnDDirOperator ( const KURL &urlName, QWidget* parent, const char* name ) : KDirOperator ( urlName, parent, name )
+{
+
+}
+
+KFileView* KDnDDirOperator::createView( QWidget* parent, KFile::FileView view )
+{
+ KFileView* new_view = 0L;
+
+ if( (view & KFile::Detail) == KFile::Detail ) {
+ new_view = new KFileDnDDetailView( parent, "detail view");
+ }
+ else if ((view & KFile::Simple) == KFile::Simple ) {
+ new_view = new KFileDnDIconView( parent, "simple view");
+ new_view->setViewName( i18n("Short View") );
+ }
+
+ return new_view;
+}
+
+
+FileSelectorWidget::FileSelectorWidget(AutoProjectPart* part, KFile::Mode mode, QWidget* parent, const char* name ) : QWidget(parent, name)
+{
+ m_part = part;
+
+ // widgets and layout
+ QVBoxLayout* lo = new QVBoxLayout(this);
+
+ QHBox *hlow = new QHBox (this);
+ lo->addWidget(hlow);
+
+ home = new QPushButton( hlow );
+ home->setPixmap(SmallIcon("gohome"));
+ QToolTip::add(home, i18n("Home directory"));
+ up = new QPushButton( /*i18n("&Up"),*/ hlow );
+ up->setPixmap(SmallIcon("up"));
+ QToolTip::add(up, i18n("Up one level"));
+ back = new QPushButton( /*i18n("&Back"),*/ hlow );
+ back->setPixmap(SmallIcon("back"));
+ QToolTip::add(back, i18n("Previous directory"));
+ forward = new QPushButton( /*i18n("&Next"),*/ hlow );
+ forward->setPixmap(SmallIcon("forward"));
+ QToolTip::add(forward, i18n("Next directory"));
+
+ // HACK
+ QWidget* spacer = new QWidget(hlow);
+ hlow->setStretchFactor(spacer, 1);
+ hlow->setMaximumHeight(up->height());
+
+ cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" );
+ cmbPath->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ KURLCompletion* cmpl = new KURLCompletion();
+ cmbPath->setCompletionObject( cmpl );
+ lo->addWidget(cmbPath);
+
+ dir = new KDnDDirOperator(KURL(), this, "operator");
+ dir->setView(KFile::Simple);
+ dir->setMode(mode);
+
+ lo->addWidget(dir);
+ lo->setStretchFactor(dir, 2);
+
+ QHBox* filterBox = new QHBox(this);
+ filterIcon = new QLabel(filterBox);
+ filterIcon->setPixmap( BarIcon("filter") );
+ filter = new KHistoryCombo(filterBox, "filter");
+ filter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ filterBox->setStretchFactor(filter, 2);
+ lo->addWidget(filterBox);
+
+ // slots and signals
+ connect( filter, SIGNAL( textChanged(const QString&) ), SLOT( slotFilterChanged(const QString&) ) );
+ connect( filter, SIGNAL( activated(const QString&) ), SLOT( slotFilterChanged(const QString&) ) );
+ connect( filter, SIGNAL( returnPressed(const QString&) ), SLOT( filterReturnPressed(const QString&) ) );
+
+ connect( home, SIGNAL( clicked() ), dir, SLOT( home() ) );
+ connect( up, SIGNAL( clicked() ), dir, SLOT( cdUp() ) );
+ connect( back, SIGNAL( clicked() ), dir, SLOT( back() ) );
+ connect( forward, SIGNAL( clicked() ), dir, SLOT( forward() ) );
+
+ 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&)) );
+
+ connect( dir, SIGNAL(finishedLoading()), this, SLOT(dirFinishedLoading()) );
+
+// dirUrlEntered( dir->url() );
+
+ QStringList list;
+
+ /* read the file patterns from the project DOM */
+ QDomElement docEl = m_part->projectDom()->documentElement();
+ QDomElement fileviewEl = docEl.namedItem("kdevfileview").toElement();
+ QDomElement groupsEl = fileviewEl.namedItem("groups").toElement();
+ QDomElement groupEl = groupsEl.firstChild().toElement();
+
+ while ( !groupEl.isNull() )
+ {
+ if (groupEl.tagName() == "group")
+ {
+ list << groupEl.attribute("pattern").replace ( QRegExp ( ";" ), " " ) + " (" + groupEl.attribute("name") + ")";
+ }
+ groupEl = groupEl.nextSibling().toElement();
+ }
+
+ filter->setHistoryItems ( list );
+
+}
+
+
+FileSelectorWidget::~FileSelectorWidget()
+{
+}
+
+void FileSelectorWidget::dragEnterEvent ( QDragEnterEvent* /*ev*/ )
+{
+}
+
+void FileSelectorWidget::dropEvent ( QDropEvent* /*ev*/ )
+{
+ kdDebug ( 9020 ) << "Dropped" << endl;
+
+ QString path = "Something was dropped in the Destination directory file-selector";
+
+ emit dropped ( path );
+
+}
+
+void FileSelectorWidget::filterReturnPressed ( const QString& nf )
+{
+ // KURL u ( m_part->project()->projectDirectory() );
+ setDir ( nf );
+}
+
+void FileSelectorWidget::slotFilterChanged( const QString & nf )
+{
+ dir->setNameFilter( nf );
+ dir->updateDir();
+}
+
+void FileSelectorWidget::cmbPathActivated( const KURL& u )
+{
+ dir->setURL( u, true );
+}
+
+void FileSelectorWidget::cmbPathReturnPressed( const QString& u )
+{
+ dir->setFocus();
+ dir->setURL( KURL(u), true );
+}
+
+
+void FileSelectorWidget::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 FileSelectorWidget::dirFinishedLoading()
+{
+ // HACK - enable the nav buttons
+ // have to wait for diroperator...
+ up->setEnabled( dir->actionCollection()->action( "up" )->isEnabled() );
+ back->setEnabled( dir->actionCollection()->action( "back" )->isEnabled() );
+ forward->setEnabled( dir->actionCollection()->action( "forward" )->isEnabled() );
+ home->setEnabled( dir->actionCollection()->action( "home" )->isEnabled() );
+}
+
+
+void FileSelectorWidget::focusInEvent(QFocusEvent*)
+{
+ dir->setFocus();
+}
+
+void FileSelectorWidget::setDir( KURL u )
+{
+ dir->setURL(u, true);
+}
+
+void FileSelectorWidget::setDir(const QString& path)
+{
+ KURL u ( path );
+ dir->setURL ( u, true );
+}
+
+
+#include "fileselectorwidget.moc"
+
diff --git a/buildtools/autotools/fileselectorwidget.h b/buildtools/autotools/fileselectorwidget.h
new file mode 100644
index 00000000..7a981194
--- /dev/null
+++ b/buildtools/autotools/fileselectorwidget.h
@@ -0,0 +1,96 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _FILESELECTORWIDGET_H_
+#define _FILESELECTORWIDGET_H_
+
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qstrlist.h>
+#include <qtooltip.h>
+
+#include <klistview.h>
+#include <qvbox.h>
+#include <qwidget.h>
+#include <kfile.h>
+#include <kurlcombobox.h>
+#include <kurlcompletion.h>
+#include <kcombobox.h>
+#include <kprotocolinfo.h>
+
+#include <kfileview.h>
+#include <kfileitem.h>
+
+#include <kdiroperator.h>
+
+class AutoProjectPart;
+class SubprojectItem;
+class KFile;
+
+class KDnDDirOperator : public KDirOperator
+{
+ Q_OBJECT
+
+public:
+ KDnDDirOperator ( const KURL& urlName = KURL(), QWidget *parent = 0, const char* name = 0 );
+
+protected:
+ virtual KFileView* createView( QWidget* parent, KFile::FileView view );
+};
+
+class FileSelectorWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ FileSelectorWidget( AutoProjectPart* part, KFile::Mode, QWidget* parent = 0, const char* name = 0 );
+ ~FileSelectorWidget();
+
+ KDnDDirOperator * dirOperator()
+ {
+ return dir;
+ }
+
+public slots:
+ void slotFilterChanged( const QString& );
+ void setDir( KURL );
+ void setDir( const QString& );
+
+private slots:
+ void cmbPathActivated( const KURL& u );
+ void cmbPathReturnPressed( const QString& u );
+ void dirUrlEntered( const KURL& u );
+ void dirFinishedLoading();
+ void filterReturnPressed( const QString& nf );
+
+protected:
+ void focusInEvent( QFocusEvent* );
+ void dragEnterEvent ( QDragEnterEvent* ev );
+ void dropEvent ( QDropEvent* ev );
+
+private:
+ KURLComboBox *cmbPath;
+ KHistoryCombo * filter;
+ QLabel* filterIcon;
+ KDnDDirOperator * dir;
+ QPushButton *home, *up, *back, *forward;
+ AutoProjectPart* m_part;
+
+signals:
+ void dropped ( const QString& );
+
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/kdevautoproject.desktop b/buildtools/autotools/kdevautoproject.desktop
new file mode 100644
index 00000000..bc366556
--- /dev/null
+++ b/buildtools/autotools/kdevautoproject.desktop
@@ -0,0 +1,97 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Automake Project
+Comment[br]=Raktres Automake
+Comment[ca]=Projecte Automake
+Comment[da]=Automake-projekt
+Comment[de]=Automake-Projekt für KDevelop
+Comment[el]=Έργο Automake
+Comment[es]=Proyecto de Automake
+Comment[et]=Automake'i project
+Comment[eu]=Automake proiektua
+Comment[fa]=پروژۀ Automake
+Comment[fr]=Projet avec Automake
+Comment[ga]=Comhad tionscadail Automake
+Comment[gl]=Proxecto Automake
+Comment[hi]=ऑटोमेक परियोजना
+Comment[hu]=Automake-projekt
+Comment[is]=Automake verkefni
+Comment[it]=Progetto per automake
+Comment[ja]=Automake プロジェクト
+Comment[ms]=Projek Automake
+Comment[nds]=Automake-Projekt
+Comment[ne]=स्वत: निर्माण परियोजना
+Comment[nl]=Automake-project
+Comment[pa]=ਆਟੋਮੈਕ ਪ੍ਰੋਜੈਕਟ
+Comment[pl]=Projekt: Automake
+Comment[pt]=Projecto Automake
+Comment[pt_BR]=Projeto Automake
+Comment[ru]=Проект Automake
+Comment[sk]=Automake projekt
+Comment[sl]=Projekt automake
+Comment[sr]=Automake пројекат
+Comment[sr@Latn]=Automake projekat
+Comment[sv]=Automake-projekt
+Comment[ta]=ஆட்டோமேக் பிராஜக்ட்
+Comment[tg]=Лоиҳаи Automake
+Comment[tr]=Automake Projesi
+Comment[uz]=Automake loyihasi
+Comment[uz@cyrillic]=Automake лойиҳаси
+Comment[zh_CN]=Automake 工程
+Comment[zh_TW]=Automake 專案
+Name=KDevAutoProject
+Name[da]=KDevelop Automake-projekt
+Name[de]=Automake-Projekt (KDevelop)
+Name[hi]=के-डेव-ऑटो-परियोजना
+Name[nds]=Automake-Projekt (KDevelop)
+Name[ne]=केडीई विकास स्वत: परियोजना
+Name[pl]=KDevProjektAuto
+Name[pt_BR]=KDevAutoProjeto
+Name[sk]=KDevAutoProjekt
+Name[sv]=KDevelop autoprojekt
+Name[ta]=கெடெவ்ஆட்டோ பிராஜக்ட்
+Name[tg]=Лоиҳаи KDevAuto
+Name[zh_TW]=KDevelop Automake 專案
+GenericName=Automake Project
+GenericName[br]=Raktres Automake
+GenericName[ca]=Projecte Automake
+GenericName[da]=Automake-projekt
+GenericName[de]=Automake-Projekt
+GenericName[el]=Έργο Automake
+GenericName[es]=Proyecto de Automake
+GenericName[et]=Automake'i projekt
+GenericName[eu]=Automake proiektua
+GenericName[fa]=پروژۀ Automake
+GenericName[fr]=Projet avec Automake
+GenericName[ga]=Comhad tionscadail Automake
+GenericName[gl]=Proxecto Automake
+GenericName[hi]=ऑटोमेक परियोजना
+GenericName[hu]=Automake-projekt
+GenericName[it]=Progetto Automake
+GenericName[ja]=Automake プロジェクト
+GenericName[ms]=Projek Automake
+GenericName[nds]=Automake-Projekt
+GenericName[ne]=स्वत: निर्माण परियोजना
+GenericName[nl]=Automake-project
+GenericName[pl]=Projekt: Automake
+GenericName[pt]=Projecto de Automake
+GenericName[pt_BR]=Projeto Automake
+GenericName[ru]=Проект Automake
+GenericName[sk]=Automake projekt
+GenericName[sl]=Projekt automake
+GenericName[sr]=Automake пројекат
+GenericName[sr@Latn]=Automake projekat
+GenericName[sv]=Automake-projekt
+GenericName[ta]=ஆட்டோமேக் பிராஜக்ட்
+GenericName[tg]=Лоиҳаи Automake
+GenericName[tr]=Automake Projesi
+GenericName[uz]=Automake loyihasi
+GenericName[uz@cyrillic]=Automake лойиҳаси
+GenericName[zh_CN]=Automake 工程
+GenericName[zh_TW]=Automake 專案
+ServiceTypes=KDevelop/Project
+Icon=make
+X-KDE-Library=libkdevautoproject
+X-KDevelop-Version=5
+X-KDevelop-Args=
diff --git a/buildtools/autotools/kdevautoproject.rc b/buildtools/autotools/kdevautoproject.rc
new file mode 100644
index 00000000..89571c11
--- /dev/null
+++ b/buildtools/autotools/kdevautoproject.rc
@@ -0,0 +1,30 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevAutoProject" version="2">
+<MenuBar>
+ <Menu name="project" >
+ <Action name="project_addtranslation" />
+ <Action name="project_configuration" />
+ </Menu>
+ <Menu name="build" >
+ <Action name="build_build" />
+ <Action name="build_buildactivetarget" />
+ <Action name="build_compilefile" />
+ <Action name="build_configure" />
+ <Action name="build_makefilecvs" />
+ <Action name="build_install" />
+ <Action name="build_install_kdesu" />
+ <Separator/>
+ <Action name="build_clean" />
+ <Action name="build_distclean" />
+ <Action name="build_messages" />
+ <Separator/>
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar" noMerge="1">
+ <Action name="build_build" group="build_operations" />
+ <Action name="build_buildactivetarget" group="build_operations" />
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
+
diff --git a/buildtools/autotools/kdevkdeautoproject.desktop b/buildtools/autotools/kdevkdeautoproject.desktop
new file mode 100644
index 00000000..235f3071
--- /dev/null
+++ b/buildtools/autotools/kdevkdeautoproject.desktop
@@ -0,0 +1,92 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=KDE Automake Project
+Comment[br]=Raktres KDE Automake
+Comment[ca]=Projecte Automake per al KDE
+Comment[da]=KDE Automake-projekt
+Comment[de]=KDE-Automake-Projekt für KDevelop
+Comment[el]=Έργο KDE Automake
+Comment[es]=Proyecto de Automake de KDE
+Comment[et]=KDE automake'i projekt
+Comment[eu]=KDE automake proiektua
+Comment[fa]=پروژۀ KDE Automake
+Comment[fr]=Projet Automake pour KDE
+Comment[ga]=Tionscadal Automake KDE
+Comment[gl]=Proxecto Automake de KDE
+Comment[hi]=केडीई ऑटोमेक परियोजना
+Comment[hu]=KDE Automake-projekt
+Comment[is]=KDE Automake verkefni
+Comment[it]=Progetto KDE per automake
+Comment[ja]=KDE Automake プロジェクト
+Comment[ms]=Projek Automake KDE
+Comment[nds]=Automake-Projekt vun KDE
+Comment[ne]=केडीई स्वत: निर्माण परियोजना
+Comment[nl]=KDE Automake-project
+Comment[pt]=Projecto Automake do KDE
+Comment[pt_BR]=Projeto Automake do KDE
+Comment[ru]=Проект KDE Automake
+Comment[sk]=KDE Automake projekt
+Comment[sl]=Projekt KDE Automake
+Comment[sr]=KDE-ов Automake пројекат
+Comment[sr@Latn]=KDE-ov Automake projekat
+Comment[sv]=KDE Automake-projekt
+Comment[ta]=KDE ஆட்டோமேக் பிராஜக்ட்
+Comment[tg]=Лоиҳаи KDE Automake
+Comment[tr]=KDE Automake Projesi
+Comment[zh_CN]=KDE Automake 工程
+Comment[zh_TW]=KDE Automake 專案
+Name=KDevKDEAutoProject
+Name[da]=KDevelop KDE Automake-projekt
+Name[de]=KDE-Automake-Projekt (KDevelop)
+Name[hi]=के-डेव-केडीई-ऑटो-परियोजना
+Name[nds]=Automake-Projekt (KDE/KDevelop)
+Name[ne]=केडीई विकास केडीई स्वत: परियोजना
+Name[pl]=KDevProjektKDEAuto
+Name[pt_BR]=KDevKDEAutoProjeto
+Name[sk]=KDevAutoProjekt
+Name[sv]=KDevelop KDE-autoprojekt
+Name[ta]=கெடெவ்ஆட்டோ பிராஜக்ட்
+Name[tg]=Лоиҳаи худкори KDevKDEAuto
+Name[zh_TW]=KDevelop KDE Automake 專案
+GenericName=KDE Automake Project
+GenericName[br]=Raktres KDE Automake
+GenericName[ca]=Projecte Automake per al KDE
+GenericName[cs]=KDE Automake projekt
+GenericName[da]=KDE Automake-projekt
+GenericName[de]=KDE-Automake-Projekt
+GenericName[el]=Έργο KDE Automake
+GenericName[es]=Proyecto de Automake de KDE
+GenericName[et]=KDE automake'i projekt
+GenericName[eu]=KDE automake proiektua
+GenericName[fa]=پروژۀ KDE Automake
+GenericName[fr]=Projet avec Automake pour KDE
+GenericName[ga]=Tionscadal Automake KDE
+GenericName[gl]=Proxecto Automake de KDE
+GenericName[hi]=केडीई ऑटोमेक परियोजना
+GenericName[hu]=KDE Automake-projekt
+GenericName[it]=Progetto KDE Automake
+GenericName[ja]=KDE Automake プロジェクト
+GenericName[ms]=Projek Automake KDE
+GenericName[nds]=Automake-Projekt vun KDE
+GenericName[ne]=केडीई स्वत: निर्माण परियोजना
+GenericName[nl]=KDE Automake-project
+GenericName[pl]=Projekt: KDE Automake
+GenericName[pt]=Projecto KDE com Automake
+GenericName[pt_BR]=Projeto Automake do KDE
+GenericName[ru]=Проект KDE Automake
+GenericName[sk]=KDE Automake projekt
+GenericName[sl]=Projekt KDE Automake
+GenericName[sr]=KDE-ов Automake пројекат
+GenericName[sr@Latn]=KDE-ov Automake projekat
+GenericName[sv]=KDE Automake-projekt
+GenericName[ta]=KDE ஆட்டோமேக் பிராஜக்ட்
+GenericName[tg]=Лоиҳаи KDE Automake
+GenericName[tr]=KDE Automake Projesi
+GenericName[zh_CN]=KDE Automake 工程
+GenericName[zh_TW]=KDE Automake 專案
+ServiceTypes=KDevelop/Project
+Icon=make
+X-KDE-Library=libkdevautoproject
+X-KDevelop-Version=5
+X-KDevelop-Args=kde
diff --git a/buildtools/autotools/kfilednddetailview.cpp b/buildtools/autotools/kfilednddetailview.cpp
new file mode 100644
index 00000000..c75022fb
--- /dev/null
+++ b/buildtools/autotools/kfilednddetailview.cpp
@@ -0,0 +1,212 @@
+/***************************************************************************
+* kfilednddetailview.cpp - description
+* -------------------
+* begin : Wed Nov 1 2000
+* copyright : (C) 2000 by Bj�n Sahlstr�
+* email : kbjorn@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. *
+* *
+***************************************************************************/
+
+//////////////////////////////////////////////////////
+// Qt specific includes
+#include <qptrlist.h>
+#include <qapplication.h>
+//////////////////////////////////////////////////////
+// KDE specific includes
+#include <kfileitem.h>
+#include <kiconloader.h>
+#include <kdebug.h>
+//////////////////////////////////////////////////////
+// Application specific includes
+#include "kfilednddetailview.h"
+
+#ifndef AUTO_OPEN_TIME
+#define AUTO_OPEN_TIME
+ static int autoOpenTime = 750;
+#endif
+//-----------------------------------------------
+KFileDnDDetailView::KFileDnDDetailView(QWidget *parent, const char *name )
+ : KFileDetailView(parent,name), m_autoOpenTimer( this ),
+ m_autoOpenTime( autoOpenTime ), m_useAutoOpenTimer( true ),
+ m_dropItem(0), m_dndEnabled( true )
+{
+ setAutoUpdate( true );
+ setDnDEnabled( true );
+ useAutoOpenTimer( true );
+}
+//-----------------------------------------------
+KFileDnDDetailView::~KFileDnDDetailView(){
+}
+//-----------------------------------------------
+void KFileDnDDetailView::readConfig( KConfig* config, const QString& group ) {
+ KConfigGroupSaver cs( config, group );
+ bool dnd = config->readBoolEntry("DragAndDrop", true );
+ setDnDEnabled( dnd );
+ KFileDetailView::readConfig( config, group );
+}
+//-----------------------------------------------
+void KFileDnDDetailView::writeConfig( KConfig* config, const QString& group ) {
+ KConfigGroupSaver cs( config, group );
+ config->writeEntry("DragAndDrop", m_dndEnabled );
+ KFileDetailView::writeConfig( config, group );
+}
+//-----------------------------------------------
+void KFileDnDDetailView::slotOpenFolder(){
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ if( !m_dropItem )
+ return;
+ }
+ KFileItemListIterator it( * KFileView::items() );
+ for( ; it.current() ;++it ){
+ if( (*it)->name() == m_dropItem->text(0) ) {
+ if( (*it)->isFile() )
+ return;
+ else if( (*it)->isDir() || (*it)->isLink()) {
+ sig->activate( (*it) );
+ return;
+ }
+ }
+ }
+}
+//-----------------------------------------------
+void KFileDnDDetailView::contentsDragEnterEvent( QDragEnterEvent *e ) {
+
+ kdDebug (9020) << "KFileDnDDetailView::contentsDragEnterEvent" << endl;
+
+ if ( ! acceptDrag( e ) ) {
+ e->accept( false );
+ return;
+ }
+ e->acceptAction();
+ QListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if ( i && m_useAutoOpenTimer ) {
+ m_dropItem = i;
+ m_autoOpenTimer.start( m_autoOpenTime );
+ }
+}
+//-----------------------------------------------
+void KFileDnDDetailView::contentsDragMoveEvent( QDragMoveEvent *e ) {
+
+ kdDebug (9020) << "KFileDnDDetailView::contentsDragMoveEvent" << endl;
+
+ if ( ! acceptDrag( e ) ) {
+ e->accept( false );
+ return;
+ }
+ e->acceptAction();
+ QListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if( ! m_useAutoOpenTimer )
+ return;
+ if ( i ) {
+ if ( i != m_dropItem ) {
+ m_autoOpenTimer.stop();
+ m_dropItem = i;
+ m_autoOpenTimer.start( m_autoOpenTime );
+ }
+ }
+ else
+ m_autoOpenTimer.stop();
+}
+//-----------------------------------------------
+void KFileDnDDetailView::contentsDragLeaveEvent( QDragLeaveEvent* ) {
+
+ kdDebug (9020) << "KFileDnDDetailView::contentsDragLeaveEvent" << endl;
+
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ m_dropItem = 0L;
+ }
+}
+//-----------------------------------------------
+void KFileDnDDetailView::contentsDropEvent( QDropEvent* e ) {
+
+ kdDebug (9020) << "KFileDndDetailView::contentsDropEvent" << endl;
+
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ m_dropItem = 0L;
+ }
+ if( ! acceptDrag( e ) ) {
+ e->acceptAction( false );
+ return;
+ }
+ e->acceptAction();
+ // the drop was accepted so lets emit this to the outside world
+ KURL::List urls;
+ KURLDrag::decode( e, urls );
+ emit dropped( e );
+ emit dropped( this, e );
+ emit dropped( this, urls );
+}
+//-----------------------------------------------
+void KFileDnDDetailView::startDrag(){
+
+ kdDebug (9020) << "KFileDnDDetailView::startDrag()" << endl;
+
+ // create a list of the URL:s that we want to drag
+ KURL::List urls;
+ KFileItemListIterator it( * KFileView::selectedItems() );
+ for ( ; it.current(); ++it ){
+ urls.append( (*it)->url() );
+ }
+ QPixmap pixmap;
+ if( urls.count() > 1 ){
+ pixmap = DesktopIcon( "kmultiple", 16 );
+ }
+ if( pixmap.isNull() )
+ pixmap = currentFileItem()->pixmap( 16 );
+ QPoint hotspot;
+ hotspot.setX( pixmap.width() / 2 );
+ hotspot.setY( pixmap.height() / 2 );
+ m_dragObject = KURLDrag::newDrag( urls, widget() );
+ m_dragObject->setPixmap( pixmap, hotspot );
+ m_dragObject->drag(); // start the drag
+}
+//-----------------------------------------------
+QDragObject* KFileDnDDetailView::dragObject() const {
+ return m_dragObject;
+}
+//-----------------------------------------------
+bool KFileDnDDetailView::acceptDrag(QDropEvent* e ) const {
+ return KURLDrag::canDecode( e ) &&
+ ( e->action() == QDropEvent::Copy
+ || e->action() == QDropEvent::Move
+ || e->action() == QDropEvent::Link );
+}
+//-----------------------------------------------
+void KFileDnDDetailView::setAutoOpenTime( const int& time ){
+ m_autoOpenTime = time;
+ useAutoOpenTimer();
+}
+//-----------------------------------------------
+void KFileDnDDetailView::useAutoOpenTimer( bool use ){
+ m_useAutoOpenTimer = use;
+ if( use )
+ connect( &m_autoOpenTimer, SIGNAL( timeout() ),this, SLOT( slotOpenFolder() ) );
+ else {
+ disconnect( &m_autoOpenTimer, SIGNAL( timeout() ),this, SLOT( slotOpenFolder() ) );
+ m_dropItem = 0L;
+ m_autoOpenTimer.stop();
+ }
+}
+//-----------------------------------------------
+void KFileDnDDetailView::setDnDEnabled( bool useDnD ){
+ m_dndEnabled = useDnD;
+ setDragEnabled( useDnD );
+ setDropVisualizer( useDnD );
+ setAcceptDrops( useDnD );
+ viewport()->setAcceptDrops( useDnD );
+}
+//-----------------------------------------------
+#ifndef NO_INCLUDE_MOCFILES
+#include "kfilednddetailview.moc"
+#endif
diff --git a/buildtools/autotools/kfilednddetailview.h b/buildtools/autotools/kfilednddetailview.h
new file mode 100644
index 00000000..ecb232c6
--- /dev/null
+++ b/buildtools/autotools/kfilednddetailview.h
@@ -0,0 +1,136 @@
+/***************************************************************************
+* kfilednddetailview.h - description
+* -------------------
+* begin : Wed Nov 1 2000
+* copyright : (C) 2000 by Bjrn Sahlstrm
+* email : kbjorn@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. *
+* *
+**************************************************************************/
+
+#ifndef KFILEDNDDETAILVIEW_H
+#define KFILEDNDDETAILVIEW_H
+
+//////////////////////////////////////////////////////////////////////
+// Qt specific include files
+#include <qwidget.h>
+#include <qtimer.h>
+//////////////////////////////////////////////////////////////////////
+// KDE specific include files
+#include <kfiledetailview.h>
+#include <kurldrag.h>
+
+
+/**
+ *This is a fileview inherited from @ref KFileDetailView.
+ *It adds "drag and drop" handling to the view suitable for a @ref KFileDetailView.
+ * No special setup is needed, just connect to the @ref dropped signals
+ * and the view will take care of the rest.
+ *@short "Drag and drop" aware @ref KFileDetailView
+ *@author Bjrn Sahlstrm
+ */
+
+class KFileDnDDetailView : public KFileDetailView
+{
+ Q_OBJECT
+public:
+ /** */
+ KFileDnDDetailView( QWidget *parent = 0, const char *name = 0 );
+ /** */
+ virtual ~KFileDnDDetailView();
+ /**
+ * Set this to true if Drag'n drop should be enabled or not, default is enabled
+ */
+ void setDnDEnabled( bool );
+ /**
+ * @returns wether DnD is enabled or not.
+ */
+ bool isDnDEnabled() const
+ {
+ return m_dndEnabled;
+ }
+ /**
+ *Sets the auto open time, which means the time that will
+ *elapse before a directory is automatically opened after entered by DnD.
+ *Only need to call this if you want to change the predefined time that is 750 ms.
+ *This also calls @ref #useAutoOpenTimer so no need to call this to.
+ */
+ void setAutoOpenTime( const int& time );
+ /**
+ *Set this to true if you want the view to use it's auto open functionallity otherwhise set it to false.
+ *By default this is turned ON.
+ */
+ void useAutoOpenTimer( bool on = true );
+ /**
+ *@returns true if auto open functionallity is turned ON (default), otherwhise false
+ *@see #useAutoOpenTimer
+ *@see #setAutoOpenTime
+ */
+ bool isAutoOpening() const
+ {
+ return m_useAutoOpenTimer;
+ }
+ /** */
+ virtual void readConfig( KConfig*, const QString& group = QString::null );
+ /** */
+ virtual void writeConfig( KConfig*, const QString& group = QString::null );
+signals: // Signals
+ /**
+ * Emitted whenever an decodable item is dropped in the view.
+ * Note: The @ref QDropEvent contains a @ref KURLDrag object.
+ */
+ void dropped( QDropEvent* );
+ /**
+ * Emitted whenever an decodable item is dropped in the view
+ * Note: The @ref QDropEvent contains a @ref KURLDrag object.
+ */
+ void dropped( KFileView*, QDropEvent* );
+ /**
+ * Emitted whenever an decodable item is dropped in the view.
+ *@param urls contains a list of all dropped @ref KURL
+ */
+ void dropped( KFileView*, KURL::List& urls );
+protected slots: // Protected slots
+ /**
+ * Called when the auto timer times out. Open the current folder.
+ */
+ void slotOpenFolder();
+protected: //Protected Methods
+ /** */
+ virtual void contentsDragEnterEvent( QDragEnterEvent *e );
+ /** */
+ virtual void contentsDragMoveEvent( QDragMoveEvent *e );
+ /** */
+ virtual void contentsDragLeaveEvent( QDragLeaveEvent *e );
+ /** */
+ virtual void contentsDropEvent( QDropEvent* e );
+ /**
+ * Create dragobject encoding the current selection and starts the drag
+ */
+ virtual void startDrag();
+ /**
+ * @returns the dragObject
+ */
+ virtual QDragObject* dragObject() const;
+ /**
+ * @returns true if we can decode the drag and support the action
+ */
+ virtual bool acceptDrag( QDropEvent* event ) const;
+protected: // Private attributes
+ QTimer m_autoOpenTimer;
+ int m_autoOpenTime;
+ bool m_useAutoOpenTimer;
+ QListViewItem* m_dropItem;
+ KURLDrag* m_dragObject;
+ bool m_dndEnabled;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/kfiledndiconview.cpp b/buildtools/autotools/kfiledndiconview.cpp
new file mode 100644
index 00000000..47bb32a9
--- /dev/null
+++ b/buildtools/autotools/kfiledndiconview.cpp
@@ -0,0 +1,194 @@
+/***************************************************************************
+* kfiledndiconview.cpp - description
+* -------------------
+* begin : Wed Nov 1 2000
+* copyright : (C) 2000 by Bjrn Sahlstrm
+* email : kbjorn@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. *
+* *
+***************************************************************************/
+
+//////////////////////////////////////////////////////
+// Qt specific includes
+#include <qptrlist.h>
+#include <qapplication.h>
+//////////////////////////////////////////////////////
+// KDE specific includes
+#include <kfileitem.h>
+#include <kiconloader.h>
+#include <kdebug.h>
+//////////////////////////////////////////////////////
+// Application specific includes
+#include "kfiledndiconview.h"
+
+#ifndef AUTO_OPEN_TIME
+#define AUTO_OPEN_TIME
+ static int autoOpenTime = 750;
+#endif
+//-----------------------------------------------
+KFileDnDIconView::KFileDnDIconView( QWidget *parent, const char *name )
+ : KFileIconView(parent,name), m_autoOpenTimer( this ),
+ m_autoOpenTime( autoOpenTime ), m_useAutoOpenTimer( true ),
+ m_dropItem(0), m_dndEnabled( true )
+{
+ setDnDEnabled( true );
+ setAutoUpdate( true );
+ useAutoOpenTimer( true );
+}
+//-----------------------------------------------
+KFileDnDIconView::~KFileDnDIconView(){
+}
+//-----------------------------------------------
+void KFileDnDIconView::readConfig( KConfig* config, const QString& group ) {
+ KConfigGroupSaver cs( config, group );
+ bool dnd = config->readBoolEntry("EnableDND", true );
+ setDnDEnabled( dnd );
+ KFileIconView::readConfig( config, group );
+}
+//-----------------------------------------------
+void KFileDnDIconView::writeConfig( KConfig* config, const QString& group ) {
+ KConfigGroupSaver cs( config, group );
+ config->writeEntry("EnableDND", m_dndEnabled );
+ KFileIconView::writeConfig( config, group );
+}
+//-----------------------------------------------
+void KFileDnDIconView::slotOpenFolder(){
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ if( !m_dropItem )
+ return;
+ }
+ KFileItemListIterator it( * KFileView::items() );
+ for( ; it.current() ;++it ){
+ if( (*it)->name() == m_dropItem->text() ) {
+ if( (*it)->isFile() )
+ return;
+ else if( (*it)->isDir() || (*it)->isLink()) {
+ sig->activate( (*it) );
+ return;
+ }
+ }
+ }
+}
+//-----------------------------------------------
+void KFileDnDIconView::contentsDragEnterEvent( QDragEnterEvent *e ) {
+ if ( ! acceptDrag( e ) ) { // can we decode this ?
+ e->accept( false ); // No
+ return;
+ }
+ e->acceptAction(); // Yes
+ QIconViewItem *i = findItem( contentsToViewport( e->pos() ) );
+ if ( i && m_useAutoOpenTimer) { // are we over an item ?
+ m_dropItem = i; // set new m_dropItem
+ m_autoOpenTimer.start( m_autoOpenTime ); // restart timer
+ }
+}
+//-----------------------------------------------
+void KFileDnDIconView::contentsDragMoveEvent( QDragMoveEvent *e ) {
+ if ( ! acceptDrag( e ) ) { // can we decode this ?
+ e->accept( false ); // No
+ return;
+ }
+ e->acceptAction(); // Yes
+ QIconViewItem *i = findItem( contentsToViewport( e->pos() ) );
+ if( ! m_useAutoOpenTimer )
+ return;
+ if ( i ) { // are we over an item ?
+ if ( i != m_dropItem ) { // if so, is it a new one ?
+ m_autoOpenTimer.stop(); // stop timer
+ m_dropItem = i; // set new m_dropItem
+ m_autoOpenTimer.start( m_autoOpenTime ); // restart timer
+ }
+ }
+ else
+ m_autoOpenTimer.stop(); // stop timer
+}
+//-----------------------------------------------
+void KFileDnDIconView::contentsDragLeaveEvent( QDragLeaveEvent* ) {
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ m_dropItem = 0L;
+ }
+}
+//-----------------------------------------------
+void KFileDnDIconView::contentsDropEvent( QDropEvent* e ) {
+ if( m_useAutoOpenTimer ) {
+ m_autoOpenTimer.stop();
+ m_dropItem = 0L;
+ }
+ if( ! acceptDrag( e ) ) {
+ e->acceptAction( false );
+ return;
+ }
+ e->acceptAction();
+ // the drop was accepted so lets emit this
+ KURL::List urls;
+ KURLDrag::decode( e, urls );
+ emit dropped( e );
+}
+//-----------------------------------------------
+void KFileDnDIconView::startDrag(){
+ if ( ! currentItem() ) // is there any selected items ?
+ return; // nope
+ dragObject()->dragCopy(); // start the drag
+}
+//-----------------------------------------------
+QDragObject* KFileDnDIconView::dragObject() {
+ // create a list of the URL:s that we want to drag
+ KURL::List urls;
+ KFileItemListIterator it( * KFileView::selectedItems() );
+ for ( ; it.current(); ++it ){
+ urls.append( (*it)->url() );
+ }
+ QPixmap pixmap;
+ if( urls.count() > 1 )
+ pixmap = DesktopIcon( "kmultiple", iconSize() );
+ if( pixmap.isNull() )
+ pixmap = currentFileItem()->pixmap( iconSize() );
+ QPoint hotspot;
+ hotspot.setX( pixmap.width() / 2 );
+ hotspot.setY( pixmap.height() / 2 );
+ QDragObject* myDragObject = KURLDrag::newDrag( urls, widget() );
+ myDragObject->setPixmap( pixmap, hotspot );
+ return myDragObject;
+}
+//-----------------------------------------------
+void KFileDnDIconView::setAutoOpenTime( const int& time ){
+ m_autoOpenTime = time;
+ useAutoOpenTimer();
+}
+//-----------------------------------------------
+void KFileDnDIconView::useAutoOpenTimer( bool use ){
+ m_useAutoOpenTimer = use;
+ if ( use )
+ connect( &m_autoOpenTimer, SIGNAL( timeout() ),this, SLOT( slotOpenFolder() ) );
+ else {
+ disconnect( &m_autoOpenTimer, SIGNAL( timeout() ),this, SLOT( slotOpenFolder() ) );
+ m_dropItem = 0L;
+ m_autoOpenTimer.stop();
+ }
+}
+//-----------------------------------------------
+void KFileDnDIconView::setDnDEnabled( bool useDnD ){
+ m_dndEnabled = useDnD;
+ setAcceptDrops( useDnD );
+ viewport()->setAcceptDrops( useDnD );
+}
+//-----------------------------------------------
+bool KFileDnDIconView::acceptDrag(QDropEvent* e ) const {
+ return KURLDrag::canDecode( e ) &&
+ ( e->action() == QDropEvent::Copy
+ || e->action() == QDropEvent::Move
+ || e->action() == QDropEvent::Link );
+}
+//-----------------------------------------------
+#ifndef NO_INCLUDE_MOCFILES
+#include "kfiledndiconview.moc"
+#endif
diff --git a/buildtools/autotools/kfiledndiconview.h b/buildtools/autotools/kfiledndiconview.h
new file mode 100644
index 00000000..65edd91a
--- /dev/null
+++ b/buildtools/autotools/kfiledndiconview.h
@@ -0,0 +1,128 @@
+/**************************************************************************
+* kfiledndiconview.h - description
+* -------------------
+* begin : Wed Nov 1 2000
+* copyright : (C) 2000 by Bjrn Sahlstrm
+* email : kbjorn@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. *
+* *
+**************************************************************************/
+
+#ifndef KFILEDNDICONVIEW_H
+#define KFILEDNDICONVIEW_H
+
+#include <qwidget.h>
+#include <qtimer.h>
+#include <kfileiconview.h>
+#include <kurldrag.h>
+
+/**
+ * This is a fileview inherited from @ref KFileIconView.
+ * It adds "drag and drop" suitable for a @ref KFileIconView
+ * No special setup is needed, just connect to the @ref dropped signals
+ * and the view will take care of the rest.
+ * @short Drag and drop" aware @ref KFileIconView
+ * @author Bjrn Sahlstrm
+*/
+
+class KFileDnDIconView : public KFileIconView
+{
+ Q_OBJECT
+public: // Public methods
+
+ KFileDnDIconView( QWidget *parent = 0, const char *name = 0 );
+ virtual ~KFileDnDIconView();
+
+ /**
+ * Set if Drag'n drop should be enabled or not, default is enabled.
+ */
+ void setDnDEnabled( bool );
+
+ /**
+ * @returns wether DnD is enabled or not.
+ */
+ bool isDnDEnabled() const
+ {
+ return m_dndEnabled;
+ }
+
+ /**
+ * Sets the auto open time, which means the time that will
+ * elapse before a directory is automatically opened after entered by DnD.
+ * Only need to call this if you want to change the predefined time that is 750 ms.
+ * This also calls @ref #useAutoOpenTimer so no need to call this to.
+ */
+ void setAutoOpenTime( const int& time );
+
+ /**
+ * Set this to true if you want the view to use it's auto open functionallity otherwhise set it to false.
+ * By default this is turned ON.
+ */
+ void useAutoOpenTimer( bool on = true );
+
+ /**
+ * @returns true if auto open functionallity is turned ON (default), otherwhise false
+ * @see #useAutoOpenTimer
+ * @see #setAutoOpenTime
+ */
+ bool isAutoOpening() const
+ {
+ return m_useAutoOpenTimer;
+ }
+
+ virtual void readConfig( KConfig*, const QString& group = QString::null );
+ virtual void writeConfig( KConfig*, const QString& group = QString::null );
+signals:
+
+ /**
+ * Emitted whenever an decodable item is dropped in the view.
+ * Note: The @ref QDropEvent contains a @ref KURLDrag object.
+ */
+ void dropped( QDropEvent* );
+
+protected slots:
+ /**
+ * Called when the auto timer times out. Open the current folder.
+ */
+ void slotOpenFolder();
+
+protected:
+ virtual void contentsDragEnterEvent( QDragEnterEvent *e );
+ virtual void contentsDragMoveEvent( QDragMoveEvent *e );
+ virtual void contentsDragLeaveEvent( QDragLeaveEvent *e );
+ virtual void contentsDropEvent( QDropEvent* e );
+
+ /**
+ * Creates a @ref QDragObject containing all urls of the selected @ref KFileItem of the view,
+ * @returns the @ref QDragObject
+ */
+ virtual QDragObject* dragObject();
+
+ /**
+ *Creates the drag item and starts the drag
+ */
+ virtual void startDrag();
+
+ /**
+ *@returns true if we can decode the drag and support the action
+ */
+ virtual bool acceptDrag( QDropEvent* event ) const;
+
+protected:
+
+ QTimer m_autoOpenTimer;
+ int m_autoOpenTime;
+ bool m_useAutoOpenTimer;
+ QIconViewItem* m_dropItem;
+ bool m_dndEnabled;
+};
+#endif
+// kate: indent-mode csands; tab-width 4; auto-insert-doxygen on;
+
diff --git a/buildtools/autotools/kimporticonview.cpp b/buildtools/autotools/kimporticonview.cpp
new file mode 100644
index 00000000..9b64d3ee
--- /dev/null
+++ b/buildtools/autotools/kimporticonview.cpp
@@ -0,0 +1,87 @@
+/***************************************************************************
+ -------------------
+ begin : 19.01.2003
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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 <qfontmetrics.h>
+#include <qpainter.h>
+#include <qrect.h>
+#include <qwidget.h>
+
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kwordwrap.h>
+
+#include "kimporticonview.h"
+
+
+KImportIconView::KImportIconView(const QString& strIntro, QWidget *parent, const char *name)
+ : KFileDnDIconView(parent, name)
+{
+ m_strIntro = strIntro;
+ m_bDropped = false;
+
+ setAcceptDrops ( true );
+}
+
+
+KImportIconView::~KImportIconView()
+{
+}
+
+void KImportIconView::drawContents ( QPainter *p, int cx, int cy, int cw, int ch )
+{
+ if ( !m_bDropped)
+ {
+ QIconView::drawContents ( p, cx, cy, cw, ch );
+
+ p->save();
+ QFont font ( p->font() );
+ font.setBold ( true );
+ font.setFamily ( "Helvetica [Adobe]" );
+ font.setPointSize ( 10 );
+ p->setFont ( font );
+ p->setPen ( QPen ( KGlobalSettings::highlightColor() ) );
+
+ QRect rect = frameRect();
+ QFontMetrics fm ( p->font() );
+ rect.setLeft ( rect.left() + 30 );
+ rect.setRight ( rect.right() - 30 );
+
+ resizeContents ( contentsWidth(), contentsHeight() );
+
+ // word-wrap the string
+ KWordWrap* wordWrap1 = KWordWrap::formatText( fm, rect, AlignHCenter | WordBreak, m_strIntro );
+ KWordWrap* wordWrap2 = KWordWrap::formatText( fm, rect, AlignHCenter | WordBreak, i18n("Or just use the buttons.") );
+
+ QRect introRect1 = wordWrap1->boundingRect();
+ QRect introRect2 = wordWrap2->boundingRect();
+
+ wordWrap1->drawText ( p, ( ( frameRect().right() - introRect1.right() ) / 2 ), ( ( frameRect().bottom() - introRect1.bottom() ) / 2 ) - 20, AlignHCenter | AlignVCenter );
+ wordWrap2->drawText ( p, ( ( frameRect().right() - introRect2.right() ) / 2 ), ( ( frameRect().bottom() - introRect2.bottom() ) / 2 ) + introRect1.bottom(), AlignHCenter | AlignVCenter );
+
+ p->restore();
+ }
+ else
+ {
+ QIconView::drawContents ( p, cx, cy, cw, ch );
+ }
+}
+
+void KImportIconView::somethingDropped ( bool dropped )
+{
+ m_bDropped = dropped;
+}
+
+#include "kimporticonview.moc"
diff --git a/buildtools/autotools/kimporticonview.h b/buildtools/autotools/kimporticonview.h
new file mode 100644
index 00000000..100fc33e
--- /dev/null
+++ b/buildtools/autotools/kimporticonview.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ -------------------
+ begin : 19.01.2003
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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 KIMPORTICONVIEW_H
+#define KIMPORTICONVIEW_H
+
+#include <qwidget.h>
+
+#include "kfiledndiconview.h"
+
+class KImportIconView : public KFileDnDIconView
+{
+ Q_OBJECT
+
+public:
+ KImportIconView( const QString& strIntro, QWidget *parent, const char *name );
+ virtual ~KImportIconView();
+
+ void somethingDropped ( bool dropped );
+
+protected:
+ void drawContents ( QPainter *p, int cx, int cy, int cw, int ch );
+
+private:
+ QString m_strIntro;
+ bool m_bDropped;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/makefilehandler.cpp b/buildtools/autotools/makefilehandler.cpp
new file mode 100644
index 00000000..03ad5277
--- /dev/null
+++ b/buildtools/autotools/makefilehandler.cpp
@@ -0,0 +1,166 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+
+#include <qdir.h>
+#include <qglobal.h>
+#include <qmap.h>
+#include <qregexp.h>
+#include <qstring.h>
+#include <qvaluelist.h>
+
+#include <kdebug.h>
+
+#include <autotoolsast.h>
+#include <autotoolsdriver.h>
+
+#include "makefilehandler.h"
+
+typedef QValueList<AutoTools::AST*> ASTList;
+
+class MakefileHandler::Private
+{
+public:
+ QMap<QString, AutoTools::ProjectAST*> projects;
+ QMap<QString, QString> folderToFileMap;
+};
+
+MakefileHandler::MakefileHandler()
+{
+ d = new MakefileHandler::Private;
+}
+
+MakefileHandler::~MakefileHandler()
+{
+ delete d;
+}
+
+void MakefileHandler::parse( const QString& folder, bool recursive )
+{
+ //look for either Makefile.am.in, Makefile.am, or Makefile.in, in that order
+ AutoTools::ProjectAST* ast;
+ int ret = -1;
+ QString filePath = folder + "/Makefile.am.in";
+ if ( QFile::exists( filePath ) )
+ ret = AutoTools::Driver::parseFile( filePath, &ast );
+ else
+ {
+ filePath = folder + "/Makefile.am";
+ if ( QFile::exists( filePath ) )
+ ret = AutoTools::Driver::parseFile( filePath, &ast );
+ else
+ {
+ filePath = folder + "/Makefile.in";
+ if ( QFile::exists( filePath ) )
+ ret = AutoTools::Driver::parseFile( filePath, &ast );
+ else
+ kdDebug(9020) << k_funcinfo << "no appropriate file to parse in "
+ << folder << endl;
+ }
+ }
+
+ if ( ret != 0 )
+ {
+ return;
+ }
+
+ kdDebug(9020) << k_funcinfo << filePath << " was parsed correctly. Adding information" << endl;
+ Q_ASSERT( ast != 0 );
+ d->projects[filePath] = ast;
+ d->folderToFileMap[folder] = filePath;
+
+ if ( recursive && ast && ast->hasChildren() )
+ {
+ QValueList<AutoTools::AST*> astChildList = ast->children();
+ QValueList<AutoTools::AST*>::iterator it(astChildList.begin()), clEnd(astChildList.end());
+ for ( ; it != clEnd; ++it )
+ {
+ if ( (*it)->nodeType() == AutoTools::AST::AssignmentAST )
+ {
+ AutoTools::AssignmentAST* assignment = static_cast<AutoTools::AssignmentAST*>( (*it) );
+ if ( assignment->scopedID == "SUBDIRS" )
+ {
+ QString list = assignment->values.join( QString::null );
+ list.simplifyWhiteSpace();
+ kdDebug(9020) << k_funcinfo << "subdirs is " << list << endl;
+ QStringList subdirList = QStringList::split( " ", list );
+ QStringList::iterator vit = subdirList.begin();
+ for ( ; vit != subdirList.end(); ++vit )
+ {
+ QString realDir = ( *vit );
+ if ( realDir.startsWith( "\\" ) )
+ realDir.remove( 0, 1 );
+
+ realDir = realDir.stripWhiteSpace();
+ if ( realDir != "." && realDir != ".." && !realDir.isEmpty() )
+ {
+ if ( isVariable( realDir ) )
+ {
+ kdDebug(9020) << k_funcinfo << "'" << realDir << "' is a variable" << endl;
+ realDir = resolveVariable( realDir, ast );
+ }
+
+ kdDebug(9020) << k_funcinfo << "Beginning parsing of '" << realDir << "'" << endl;
+ parse( folder + '/' + realDir, recursive );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+AutoTools::ProjectAST* MakefileHandler::astForFolder( const QString& folderPath )
+{
+ if ( d->folderToFileMap.contains( folderPath ) )
+ {
+ QString filePath = d->folderToFileMap[folderPath];
+ return d->projects[filePath];
+ }
+ else
+ return 0;
+}
+
+bool MakefileHandler::isVariable( const QString& item ) const
+{
+ if ( item.contains( QRegExp( "(\\$\\([a-zA-Z0-9_-]*\\)|@[a-zA-Z0-9_-]*@)" ) ) )
+ return true;
+ else
+ return false;
+}
+
+QString MakefileHandler::resolveVariable( const QString& variable, AutoTools::ProjectAST* ast )
+{
+ if ( !ast )
+ return variable;
+
+ kdDebug(9020) << k_funcinfo << "attempting to resolve '" << variable << "'"<< endl;
+ ASTList childList = ast->children();
+ ASTList::iterator it( childList.begin() ), clEnd( childList.end() );
+ for ( ; it != clEnd; ++it )
+ {
+ if ( ( *it )->nodeType() == AutoTools::AST::AssignmentAST )
+ {
+ AutoTools::AssignmentAST* assignment = static_cast<AutoTools::AssignmentAST*>( ( *it ) );
+ if ( variable.find( assignment->scopedID ) != -1 )
+ {
+ kdDebug(9020) << k_funcinfo << "Resolving variable '" << variable << "' to '"
+ << assignment->values.join( QString::null ).stripWhiteSpace() << "'" << endl;
+ return assignment->values.join( QString::null ).stripWhiteSpace();
+ }
+ }
+ }
+
+ return variable;
+}
+//kate: space-indent on; indent-width 4;
diff --git a/buildtools/autotools/makefilehandler.h b/buildtools/autotools/makefilehandler.h
new file mode 100644
index 00000000..77045fe9
--- /dev/null
+++ b/buildtools/autotools/makefilehandler.h
@@ -0,0 +1,76 @@
+/*
+ KDevelop Autotools Support
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+
+***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************
+*/
+#ifndef MAKEFILEHANDLER_H
+#define MAKEFILEHANDLER_H
+
+/**
+ * This class is responsible for taking the data from the Makefile.am parser
+ * and providing various data list view items can use in the automake manager
+ * widget
+ * @author Matt Rogers
+ */
+namespace AutoTools {
+class ProjectAST;
+}
+
+class MakefileHandler
+{
+public:
+ MakefileHandler();
+ ~MakefileHandler();
+
+ /**
+ * Parse a folder that has supported makefiles in it. The following files
+ * will be looked for in the following order:
+ * \li Makefile.am.in
+ * \li Makefile.am
+ * \li Makefile.in
+ *
+ * \param folder, the folder to parse
+ * \param recursive if true, subfolders will be parsed - defaults to true
+ */
+ void parse( const QString& folder, bool recursive = true );
+
+ /**
+ * Get the AST for a certain path
+ * \param folderPath the path of the folder to get an AST for
+ * \return the AST that represents a particular folder
+ */
+ AutoTools::ProjectAST* astForFolder( const QString& folderPath );
+
+ /**
+ * Check if a string is an automake variable
+ * \return true if it is an automake variable, false otherwise
+ */
+ bool isVariable( const QString& item ) const;
+
+ /**
+ * Find the value for the variable specified by \p variable
+ * \param variable The name of the variable to look for
+ * \param ast the AST to use to look for the variable in
+ * \return the value to substitute for the variable
+ */
+ QString resolveVariable( const QString& variable,
+ AutoTools::ProjectAST* ast );
+
+
+private:
+ class Private;
+ Private* d;
+};
+
+#endif
+
+//kate: space-indent on; indent-width 4;
+
diff --git a/buildtools/autotools/managecustomcommand.cpp b/buildtools/autotools/managecustomcommand.cpp
new file mode 100644
index 00000000..7d111965
--- /dev/null
+++ b/buildtools/autotools/managecustomcommand.cpp
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "managecustomcommand.h"
+
+#include <qtable.h>
+
+#include <klocale.h>
+
+ManageCustomCommand::ManageCustomCommand(QWidget *parent, const char *name)
+ :ManageCustomBuildCommandsBase(parent, name)
+{
+}
+
+void ManageCustomCommand::addButton_clicked()
+{
+ commandsTable->setNumRows(commandsTable->numRows() + 1);
+ setRowProperties(commandsTable->numRows()-1);
+}
+
+void ManageCustomCommand::removeButton_clicked()
+{
+ commandsTable->removeRow(commandsTable->currentRow());
+}
+
+void ManageCustomCommand::setRowProperties(int row)
+{
+ commandsTable->setItem(row, 2,
+ new QComboTableItem(commandsTable, QStringList::split(",",
+ i18n("this is a list of items in the combobox",
+ "Make target,Make target (as root),Make command,Make command (as root),Command,Command (as root)"))));
+}
+
+#include "managecustomcommand.moc"
diff --git a/buildtools/autotools/managecustomcommand.h b/buildtools/autotools/managecustomcommand.h
new file mode 100644
index 00000000..cda5e54a
--- /dev/null
+++ b/buildtools/autotools/managecustomcommand.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+* Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU Library General Public License as *
+* published by the Free Software Foundation; either version 2 of the *
+* License, or (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU Library General Public *
+* License along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#ifndef MANAGECUSTOMCOMMAND_H
+#define MANAGECUSTOMCOMMAND_H
+
+#include "managecustomcommandsbase.h"
+
+class ManageCustomCommand: public ManageCustomBuildCommandsBase
+{
+ Q_OBJECT
+public:
+ ManageCustomCommand( QWidget *parent = 0, const char *name = 0 );
+
+ void setRowProperties( int row );
+public slots:
+ virtual void addButton_clicked();
+ virtual void removeButton_clicked();
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/managecustomcommandsbase.ui b/buildtools/autotools/managecustomcommandsbase.ui
new file mode 100644
index 00000000..43164ef5
--- /dev/null
+++ b/buildtools/autotools/managecustomcommandsbase.ui
@@ -0,0 +1,125 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ManageCustomBuildCommandsBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ManageCustomBuildCommandsBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>435</width>
+ <height>218</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QTable" row="0" column="0" rowspan="3" colspan="1">
+ <column>
+ <property name="text">
+ <string>Menu Text</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Command</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Command Type</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>commandsTable</cstring>
+ </property>
+ <property name="numRows">
+ <number>0</number>
+ </property>
+ <property name="numCols">
+ <number>3</number>
+ </property>
+ <property name="rowMovingEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="selectionMode">
+ <enum>SingleRow</enum>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer4</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>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>addButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ManageCustomBuildCommandsBase</receiver>
+ <slot>addButton_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>removeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ManageCustomBuildCommandsBase</receiver>
+ <slot>removeButton_clicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>commandsTable</tabstop>
+ <tabstop>addButton</tabstop>
+ <tabstop>removeButton</tabstop>
+</tabstops>
+<slots>
+ <slot>addButton_clicked()</slot>
+ <slot>removeButton_clicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/buildtools/autotools/misc.cpp b/buildtools/autotools/misc.cpp
new file mode 100644
index 00000000..97c449e7
--- /dev/null
+++ b/buildtools/autotools/misc.cpp
@@ -0,0 +1,999 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include <qdict.h>
+
+#include <kdebug.h>
+#include <kparts/componentfactory.h>
+#include <kservice.h>
+
+#include "misc.h"
+
+#include "kdevcompileroptions.h"
+
+
+static KDevCompilerOptions *createCompilerOptions( const QString &name, QObject *parent )
+{
+ KService::Ptr service = KService::serviceByDesktopName( name );
+ if ( !service )
+ {
+ kdDebug( 9020 ) << "Can't find service " << name << endl;
+ return 0;
+ }
+
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory) {
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ kdDebug(9020) << "There was an error loading the module " << service->name() << endl <<
+ "The diagnostics is:" << endl << errorMessage << endl;
+ exit(1);
+ }
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(parent, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions")) {
+ kdDebug(9020) << "Component does not inherit KDevCompilerOptions" << endl;
+ return 0;
+ }
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+
+ return dlg;
+
+/*
+ QStringList args;
+ QVariant prop = service->property( "X-KDevelop-Args" );
+ if ( prop.isValid() )
+ args = QStringList::split( " ", prop.toString() );
+
+ return KParts::ComponentFactory
+ ::createInstanceFromService<KDevCompilerOptions>( service, parent,
+ service->name().latin1(), args );*/
+}
+
+
+QString AutoProjectTool::execFlagsDialog( const QString &compiler, const QString &flags, QWidget *parent )
+{
+ KDevCompilerOptions * plugin = createCompilerOptions( compiler, parent );
+
+ if ( plugin )
+ {
+ QString newflags = plugin->exec( parent, flags );
+ delete plugin;
+ return newflags;
+ }
+ return QString::null;
+}
+
+
+QString AutoProjectTool::canonicalize( const QString &str )
+{
+ QString res;
+ for ( uint i = 0; i < str.length(); ++i )
+ res += ( str[ i ].isLetterOrNumber() || str[ i ] == '@' ) ? str[ i ] : QChar( '_' );
+
+ kdDebug(9020) << k_funcinfo << "normalized '" << str << "' to '" << res << "'" << endl;
+ return res;
+}
+
+
+/**
+ * Read the Makefile.am and return a map of all the variables.
+ * Will take notice of backslash and += constructs.
+ * @param fileName
+ * @param variables
+ */
+void AutoProjectTool::parseMakefileam(const QString &fileName, QMap<QString, QString> *variables)
+{
+ QFile f(fileName);
+ if (!f.open(IO_ReadOnly))
+ {
+ return ;
+ }
+ QTextStream stream(&f);
+
+ QRegExp re("^(#kdevelop:[ \t]*)?([A-Za-z][@A-Za-z0-9_]*)[ \t]*([:\\+]?=)[ \t]*(.*)$");
+
+ QString last;
+ bool multiLine = false;
+ while (!stream.atEnd())
+ {
+ QString s = stream.readLine().stripWhiteSpace();
+ if (re.exactMatch(s))
+ {
+ QString lhs = re.cap(2);
+ QString rhs = re.cap(4);
+ if (rhs[ rhs.length() - 1 ] == '\\')
+ {
+ multiLine = true;
+ last = lhs;
+ rhs[rhs.length() - 1] = ' ';
+ }
+
+ // The need for stripWhiteSpace seems to be a Qt bug.
+ // make our list nice and neat.
+ QStringList bits = QStringList::split(" ", rhs);
+ rhs = bits.join(" ");
+ if (re.cap(3) == "+=")
+ {
+ ((*variables)[lhs] += ' ') += rhs;
+ }
+ else
+ {
+ variables->insert(lhs, rhs);
+ }
+ }
+ else if (multiLine)
+ {
+ if (s[s.length()-1] == '\\')
+ {
+ s[s.length()-1] = ' ';
+ }
+ else
+ {
+ multiLine = false;
+ }
+ QStringList bits = QStringList::split(" ", s);
+ ((*variables)[last] += ' ') += bits.join(" ");
+ }
+ }
+ f.close();
+
+ QMap<QString, QString> list;
+
+ for (QMap<QString, QString>::iterator iter = variables->begin();iter != variables->end();iter++)
+ {
+ QStringList items = QStringList::split(" ", iter.data());
+ QMap<QString, QString> unique;
+ for (uint i = 0;i < items.size();i++)
+ {
+ unique.insert(items[i], "");
+ }
+ QString line;
+ for (QMap<QString, QString>::iterator it = unique.begin();it != unique.end();it++)
+ {
+ line += it.key() + ' ';
+ }
+ if (line.length() > 1)
+ {
+ line.setLength(line.length() - 1);
+ }
+
+ list.insert(iter.key(), line);
+ }
+ *variables = list;
+}
+
+/**
+ * Add entries to a variable. Will just add the variables to the existing line, removing duplicates
+ * Will preserve += constructs and make sure that the variable only has one copy of the value across
+ * all += constructs
+ * @param fileName
+ * @param variables key=value string of entries to add
+ */
+void AutoProjectTool::addToMakefileam(const QString &fileName, QMap<QString, QString> variables)
+{
+ AutoProjectTool::addRemoveMakefileam(fileName, variables, true);
+}
+
+/**
+ * Set entries to a variable. Will set the variables to the existing line, removing duplicates
+ * Will preserve += constructs and make sure that the variable only has one copy of the value across
+ * all += constructs
+ * Adds line if it does not exist.
+ * @param fileName
+ * @param variables key=value string of entries to add
+ */
+void AutoProjectTool::setMakefileam ( const QString &fileName, QMap<QString, QString> variables )
+{
+ for ( QMap<QString, QString>::Iterator it0 = variables.begin(); it0 != variables.end(); ++it0 )
+ {
+ kdDebug ( 9020 ) << "key (set): " << it0.key() << "=" << it0.data() << endl;
+ }
+
+ // input file reading
+ QFile fin ( fileName );
+ if ( !fin.open ( IO_ReadOnly ) )
+ {
+ return ;
+ }
+ QTextStream ins ( &fin );
+
+ // output file writing.
+ QFile fout ( fileName + "#" );
+ if ( !fout.open ( IO_WriteOnly ) )
+ {
+ fin.close();
+ return ;
+ }
+ QTextStream outs ( &fout );
+
+ // variables
+ QRegExp re ( "^(#kdevelop:[ \t]*)?([A-Za-z][@A-Za-z0-9_]*)[ \t]*([:\\+]?=)[ \t]*(.*)$" );
+
+ bool multiLine = false;
+ QString lastLhs;
+ QMap<QString, QString> seenLhs;
+ while ( !fin.atEnd() )
+ {
+ QString s = ins.readLine();
+ if ( re.exactMatch ( s ) )
+ {
+ QString lhs = re.cap ( 2 );
+ bool notFound = ( variables.find ( lhs ) == variables.end() );
+
+ if ( notFound )
+ {
+ if ( seenLhs.find ( lhs ) == seenLhs.end() )
+ {
+ // not interested in this line at all
+ // write it out as is..
+ outs << s << endl;
+ }
+ // we have seen this variable, but since we are setting the
+ // whole line - we skip this as it will be a += line.
+ }
+ else
+ {
+ // we are interested in this line..
+ QString rhs = re.cap ( 4 ).stripWhiteSpace();
+ if ( rhs[ rhs.length() - 1 ] == '\\' )
+ {
+ // save it for when we have the whole line..
+ multiLine = true;
+ lastLhs = lhs;
+ }
+ else
+ {
+ // deal with it now - a single line
+ // we are adding our interested values to this line and writing it
+ // now write the line out if it is not going to be empty.
+ QString newLine ( lhs );
+ newLine += " = ";
+ bool added = false;
+ int len = newLine.length();
+ QStringList variableList = QStringList::split ( ' ', variables[lhs] );
+ for ( uint count = 0; count < variableList.size(); count++ )
+ {
+ len += variableList[count].length() + 1;
+ if ( len > 80 )
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += variableList[count];
+ newLine += ' ';
+ added = true;
+
+ }
+ // only print it out if there was a value to add..
+ if ( added )
+ {
+ newLine.setLength ( newLine.length() - 1 );
+ outs << newLine << endl;
+ }
+ seenLhs[lhs] = "done";
+ variables.erase ( lhs );
+ }
+ }
+ }
+ else if ( multiLine )
+ {
+ s = s.stripWhiteSpace();
+ // we are only here if were interested in this line..
+ if ( s[s.length()-1] == '\\' )
+ {
+ s.setLength ( s.length() - 1 );
+ // still more multi line we wait for..
+ }
+ else
+ {
+ // end of the multi line..
+ multiLine = false;
+ }
+
+ if ( !multiLine )
+ {
+ // we are adding our interested values to this line and writing it
+ // now write the line out if it is not going to be empty.
+ QString newLine ( lastLhs );
+ newLine += " = ";
+ bool added = false;
+ int len = newLine.length();
+ QStringList variableList = QStringList::split ( ' ', variables[lastLhs] );
+ for ( uint count = 0; count < variableList.size(); count++ )
+ {
+ len += variableList[count].length() + 1;
+ if ( len > 80 )
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += variableList[count];
+ newLine += ' ';
+ added = true;
+ }
+ // only print it out if there was a value to add..
+ if ( added )
+ {
+ newLine.setLength ( newLine.length() - 1 );
+ outs << newLine << endl;
+ }
+ seenLhs[lastLhs] = "done";
+ variables.erase ( lastLhs );
+ lastLhs.setLength ( 0 );
+ }
+ }
+ else
+ {
+ // can write this line out..
+ // not a match, not a multi line,
+ outs << s << endl;
+ }
+ }
+
+ for ( QMap<QString, QString>::Iterator it0 = variables.begin(); it0 != variables.end(); ++it0 )
+ {
+ QString newLine ( it0.key() );
+ newLine += " = ";
+ bool added = false;
+ int len = newLine.length();
+ QStringList variableList = QStringList::split ( ' ', it0.data() );
+ for ( uint count = 0; count < variableList.size(); count++ )
+ {
+ len += variableList[count].length() + 1;
+ if ( len > 80 )
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += variableList[count];
+ newLine += ' ';
+ added = true;
+
+ }
+ // only print it out if there was a value to add..
+ if ( added )
+ {
+ newLine.setLength ( newLine.length() - 1 );
+ outs << newLine << endl;
+ }
+ }
+
+ fin.close();
+ fout.close();
+
+ QDir().rename ( fileName + "#", fileName );
+}
+
+
+/**
+ * Add entries to a variable. Will just add the variables to the existing line, removing duplicates
+ * Will preserve += constructs and make sure that the variable only has one copy of the value across
+ * all += constructs
+ * @param fileName
+ * @param variables key=value string of entries to add
+ * @param add true= add these key,value pairs, false = remove. You can have empty values for an add - the whole line is
+ * removed. For adding, we will not add an empty line.
+ */
+void AutoProjectTool::addRemoveMakefileam(const QString &fileName, QMap<QString, QString> variables, bool add)
+{
+ // input file reading
+ QFile fin(fileName);
+ if (!fin.open(IO_ReadOnly))
+ {
+ return ;
+ }
+ QTextStream ins(&fin);
+
+ // output file writing.
+ QFile fout(fileName + "#");
+ if (!fout.open(IO_WriteOnly))
+ {
+ fin.close();
+ return ;
+ }
+ QTextStream outs(&fout);
+
+ // variables
+ QRegExp re("^(#kdevelop:[ \t]*)?([A-Za-z][@A-Za-z0-9_]*)[ \t]*([:\\+]?=)[ \t]*(.*)$");
+
+ // build key=map of values to add
+ // map can be empty.we never add an empty key, but do remove empty keys from the file..
+ QDict< QMap<QString, bool> > interest;
+ for (QMap<QString, QString>::Iterator it0 = variables.begin(); it0 != variables.end(); ++it0)
+ {
+ kdDebug(9020) << "key (" << add<<"): " << it0.key() << "="<< it0.data() << endl;
+
+ QMap<QString, bool>* set = new QMap<QString, bool>();
+ if (!it0.data().stripWhiteSpace().isEmpty())
+ {
+ QStringList variableList = QStringList::split(' ', it0.data());
+
+ for (uint i = 0; i < variableList.count(); i++)
+ {
+ set->insert(variableList[i], true);
+ }
+ }
+ interest.insert(it0.key(), set);
+ }
+
+ bool multiLine = false;
+ QString lastLhs;
+ QStringList lastRhs;
+ QMap<QString, QString> seenLhs;
+ while (!fin.atEnd())
+ {
+ QString s = ins.readLine();
+ if (re.exactMatch(s))
+ {
+ QString lhs = re.cap(2);
+ QMap<QString, bool>* ourRhs = interest.find(lhs);
+
+ if (!ourRhs)
+ {
+ // not interested in this line at all
+ // write it out as is..
+ outs << s << endl;
+ }
+ else
+ {
+ // we are interested in this line..
+ QString rhs = re.cap(4).stripWhiteSpace();
+ if (rhs[ rhs.length() - 1 ] == '\\')
+ {
+ // save it for when we have the whole line..
+ multiLine = true;
+ lastLhs = lhs;
+ rhs.setLength(rhs.length() - 1);
+ lastRhs += QStringList::split(" ", rhs);
+ }
+ else
+ {
+ // deal with it now.
+
+ QStringList bits = QStringList::split(" ", rhs);
+ if (add)
+ {
+ // we are adding our interested values to this line and writing it
+
+ // add this line to we we want to add to remove duplicates.
+ for (uint index = 0; index < bits.size(); index++)
+ {
+ QMap<QString, bool>::iterator findEntry = ourRhs->find(bits[index]);
+ if (findEntry == ourRhs->end())
+ {
+ // we haven't seen it, so add it, so we don't add it again later..
+ ourRhs->insert(bits[index], true);
+ }
+ // else we have this value in our 'to add list' , it is either already been
+ // added, so we don't want to add it again, or it hasn't been added, in which
+ // case we will do so soon. so we can ignore this now..
+ }
+ // now write the line out if it is not going to be empty.
+ QString newLine(lhs);
+ if (seenLhs.find(lhs) == seenLhs.end())
+ {
+ newLine += " = ";
+ seenLhs[lhs] = "";
+ }
+ else
+ {
+ newLine += " += ";
+ }
+
+ int len = newLine.length();
+ bool added = false;
+ QValueList<QString> keys = ourRhs->keys();
+ for (uint count = 0; count < keys.size(); count++)
+ {
+ // if out entry is true, add it..
+ if ((*ourRhs)[keys[count]])
+ {
+ added = true;
+ len += keys[count].length() + 1;
+ if (len > 80)
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += keys[count];
+ newLine += ' ';
+ // set our value so we don't add it again.
+ (*ourRhs)[keys[count]] = false;
+ }
+ }
+ // only print it out if there was a value to add..
+ if (added)
+ {
+ newLine.setLength(newLine.length() - 1);
+ outs << newLine << endl;
+ }
+ }
+ else
+ {
+ // we are removing our interested values from this line
+
+ // special case - no values, remove the line..
+ if (!ourRhs->empty())
+ {
+ // check if any of these values are down to remove.
+ QString newLine(lhs);
+ if (seenLhs.find(lhs) == seenLhs.end())
+ {
+ newLine += " = ";
+ seenLhs[lhs] = "";
+ }
+ else
+ {
+ newLine += " += ";
+ }
+
+ int len = newLine.length();
+ bool added = false;
+ for (QStringList::Iterator posIter = bits.begin(); posIter != bits.end();posIter++)
+ {
+ QMap<QString, bool>::iterator findEntry = ourRhs->find(*posIter);
+ if (findEntry == ourRhs->end())
+ {
+ // we do not want to remove it..
+ added = true;
+ len += (*posIter).length() + 1;
+ if (len > 80)
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += (*posIter);
+ newLine += ' ';
+ }
+ // else we have this value in our 'to remove list', so don't add it.
+ }
+ // only print it out if there was a value on it..
+ if (added)
+ {
+ newLine.setLength(newLine.length() - 1);
+ outs << newLine << endl;
+ }
+ }
+ }//if (add)
+ }//if ( rhs[ rhs.length() - 1 ] == '\\' )
+ }//if ( found == interest.end())
+ }
+ else if (multiLine)
+ {
+ s = s.stripWhiteSpace();
+ // we are only here if were interested in this line..
+ if (s[s.length()-1] == '\\')
+ {
+ s.setLength(s.length() - 1);
+ // still more multi line we wait for..
+ }
+ else
+ {
+ // end of the multi line..
+ multiLine = false;
+ }
+ lastRhs += QStringList::split(" ", s);
+
+ if (!multiLine)
+ {
+ // now we have to deal with this multiLine value..
+ // ourRhs will always be a value, as we only get multiLine if we're interested in it..
+ QMap<QString, bool>* ourRhs = interest.find(lastLhs);
+
+ if (add)
+ {
+ // we are adding our interested values to this line and writing it
+
+ // add this line to we we want to add to remove duplicates.
+ for (uint index = 0; index < lastRhs.size(); index++)
+ {
+ QMap<QString, bool>::iterator findEntry = ourRhs->find(lastRhs[index]);
+ if (findEntry == ourRhs->end())
+ {
+ // we haven't seen it, so add it, so we don't add it again later..
+ ourRhs->insert(lastRhs[index], true);
+ }
+ // else we have this value in our 'to add list' , it is either already been
+ // added, so we don't want to add it again, or it hasn't been added, in which
+ // case we will do so soon. so we can ignore this now..
+ }
+ // now write the line out if it is not going to be empty.
+ QString newLine(lastLhs);
+ if (seenLhs.find(lastLhs) == seenLhs.end())
+ {
+ newLine += " = ";
+ seenLhs[lastLhs] = "";
+ }
+ else
+ {
+ newLine += " += ";
+ }
+
+ int len = newLine.length();
+ bool added = false;
+ QValueList<QString> keys = ourRhs->keys();
+ for (uint count = 0; count < keys.size(); count++)
+ {
+ // if out entry is true, add it..
+ if ((*ourRhs)[keys[count]])
+ {
+ added = true;
+ len += keys[count].length() + 1;
+ if (len > 80)
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += keys[count];
+ newLine += ' ';
+ // set our value so we don't add it again.
+ (*ourRhs)[keys[count]] = false;
+ }
+ }
+ // only print it out if there was a value to add..
+ if (added)
+ {
+ newLine.setLength(newLine.length() - 1);
+ outs << newLine << endl;
+ }
+ }
+ else
+ {
+ // we are removing our interested values from this line
+ // special case - no values, remove the line..
+ if (!ourRhs->empty())
+ {
+ // check if any of these values are down to remove.
+ QString newLine(lastLhs);
+ if (seenLhs.find(lastLhs) == seenLhs.end())
+ {
+ newLine += " = ";
+ seenLhs[lastLhs] = "";
+ }
+ else
+ {
+ newLine += " += ";
+ }
+ int len = newLine.length();
+ bool added = false;
+ for (QStringList::Iterator posIter = lastRhs.begin(); posIter != lastRhs.end();posIter++)
+ {
+ QMap<QString, bool>::iterator findEntry = ourRhs->find(*posIter);
+ if (findEntry == ourRhs->end())
+ {
+ // we do not want to remove it..
+ added = true;
+ len += (*posIter).length() + 1;
+ if (len > 80)
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += (*posIter);
+ newLine += ' ';
+ }
+ // else we have this value in our 'to remove list', so don't add it.
+ }
+ // only print it out if there was a value on it..
+ if (added)
+ {
+ newLine.setLength(newLine.length() - 1);
+ outs << newLine << endl;
+ }
+ }
+ }
+
+ lastLhs.setLength(0);
+ lastRhs.clear();
+ }
+ }
+ else
+ {
+ // can write this line out..
+ // not a match, not a multi line,
+ outs << s << endl;
+ }
+ }
+
+ if (add)
+ {
+ QDictIterator<QMap<QString, bool> > it(interest);
+ for (; it.current(); ++it)
+ {
+ QString lhs = it.currentKey();
+ QMap<QString, bool>* ourRhs = it.current();
+
+ QString newLine(lhs);
+ if (seenLhs.find(lhs) == seenLhs.end())
+ {
+ newLine += " = ";
+ seenLhs[lastLhs] = "";
+ }
+ else
+ {
+ newLine += " += ";
+ }
+ int len = newLine.length();
+ bool added = false;
+ QValueList<QString> keys = ourRhs->keys();
+ for (uint count = 0; count < keys.size(); count++)
+ {
+ if ((*ourRhs)[keys[count]])
+ {
+ added = true;
+ len += keys[count].length() + 1;
+ if (len > 80)
+ {
+ newLine += "\\\n\t";
+ len = 8;
+ }
+ newLine += keys[count];
+ newLine += ' ';
+ // set our value so we don't add it again.
+ (*ourRhs)[keys[count]] = false;
+ }
+ }
+ // only print it out if there was a value to add..
+ if (added)
+ {
+ newLine.setLength(newLine.length() - 1);
+ outs << newLine << endl;
+ }
+ }
+ }
+ interest.setAutoDelete(true);
+ interest.clear();
+
+ fin.close();
+ fout.close();
+
+ QDir().rename(fileName + "#", fileName);
+}
+
+/**
+ * Any items in the map will be removed from the Makefile.am
+ * Empty lines are removed. eg. foo_LDDADD if empty is removed.
+ * @param fileName full path to Makefile.am
+ * @param variables lines to remove items from.
+ */
+void AutoProjectTool::removeFromMakefileam(const QString &fileName, QMap <QString, QString> variables)
+{
+ AutoProjectTool::addRemoveMakefileam(fileName, variables, false);
+}
+
+
+/**
+ * Open the file and parse out the AC_OUTPUT line. following backslash continue lines..
+ * @param configureinpath
+ * @return list of all the values
+ */
+QStringList AutoProjectTool::configureinLoadMakefiles(QString configureinpath)
+{
+ QFile configurein(configureinpath);
+
+ if (!configurein.open(IO_ReadOnly))
+ {
+ kdDebug(9020) << k_funcinfo << " - couldn't open file: " << configureinpath << endl;
+ return QStringList();
+ }
+
+ QTextStream stream(&configurein);
+ QStringList list;
+
+ QString ac_match("^AC_OUTPUT");
+
+ QRegExp ac_regex(ac_match);
+ bool multiLine = false;
+ QChar cont('\\');
+ QRegExp close("\\)");
+ QRegExp open("\\(");
+ while (!stream.eof())
+ {
+ QString line = stream.readLine().stripWhiteSpace();
+ if (multiLine)
+ {
+ if (close.search(line) >= 0)
+ {
+ line = line.replace(close.search(line), 1, "");
+ list += QStringList::split(" ", line);
+ break;
+ }
+ else
+ {
+ if (line.endsWith(cont))
+ {
+ line.setLength(line.length() - 1);
+ }
+ list += QStringList::split(" ", line);
+ }
+ }
+ else if (ac_regex.search(line) >= 0)
+ {
+ line = line.replace(ac_regex.search(line), ac_match.length() - 1, "");
+
+ if (open.search(line) >= 0)
+ {
+ line = line.replace(open.search(line), 1, "");
+ }
+
+ if (line.endsWith(cont))
+ {
+ line.setLength(line.length() - 1);
+ multiLine = true;
+ }
+ else
+ {
+ if (close.search(line) >= 0)
+ {
+ line = line.replace(close.search(line), 1, "");
+ }
+ }
+
+ list = QStringList::split(" ", line);
+
+ if (!multiLine)
+ {
+ break;
+ }
+ }
+ }
+
+ configurein.close();
+
+ // make a new object on the heap
+ return list;
+
+}
+
+/**
+ * Write the items to the AC_OUTPUT line. This replaces the exiting line.
+ * @param configureinpath
+ * @param makefiles
+ */
+void AutoProjectTool::configureinSaveMakefiles(QString fileName, QStringList makefiles)
+{
+ // input file reading
+ QFile fin(fileName);
+ if (!fin.open(IO_ReadOnly))
+ {
+ return ;
+ }
+ QTextStream ins(&fin);
+
+ // output file writing.
+ QFile fout(fileName + "#");
+ if (!fout.open(IO_WriteOnly))
+ {
+ fin.close();
+ return ;
+ }
+ QTextStream outs(&fout);
+
+ // remove duplicates if any..
+ QMap<QString, QString> toAdd;
+ for (uint i = 0; i < makefiles.size();i++)
+ {
+ toAdd.insert(makefiles[i].stripWhiteSpace(), "");
+ }
+
+ QString ac_match("^AC_OUTPUT");
+ QRegExp ac_regex(ac_match);
+ bool multiLine = false;
+ QChar cont('\\');
+ QRegExp close("\\)");
+ QRegExp open("\\(");
+ bool done = false;
+ while (!fin.atEnd())
+ {
+ QString line = ins.readLine();
+ if (done)
+ {
+ outs << line << endl;
+ }
+ else
+ {
+ if (multiLine)
+ {
+ line = line.stripWhiteSpace();
+ if (close.search(line) >= 0)
+ {
+ int len = 10;
+ QString acline("AC_OUTPUT(");
+ for (QMap<QString, QString>::iterator iter = toAdd.begin();iter != toAdd.end();iter++)
+ {
+ len += iter.key().length();
+ if (len > 80)
+ {
+ acline += "\\\n\t";
+ len = 8;
+ }
+ acline += iter.key();
+ acline += ' ';
+ }
+ acline.setLength(acline.length() - 1);
+ acline = acline.append(")");
+ outs << acline << endl;
+ done = true;
+ }
+ else
+ {
+ if (line.endsWith(cont))
+ {
+ line.setLength(line.length() - 1);
+ }
+ }
+ }
+ else if (ac_regex.search(line) >= 0)
+ {
+ line = line.stripWhiteSpace();
+ line = line.replace(ac_regex.search(line), ac_match.length() - 1, "");
+ if (line.endsWith(cont))
+ {
+ line.setLength(line.length() - 1);
+ multiLine = true;
+ }
+ if (open.search(line) >= 0)
+ {
+ line = line.replace(open.search(line), 1, "");
+ }
+ if (close.search(line) >= 0)
+ {
+ line = line.replace(close.search(line), 1, "");
+ }
+
+ if (!multiLine)
+ {
+ int len = 10;
+ QString acline("AC_OUTPUT(");
+ for (QMap<QString, QString>::iterator iter = toAdd.begin();iter != toAdd.end();iter++)
+ {
+ len += iter.key().length();
+ if (len > 80)
+ {
+ acline += "\\\n\t";
+ len = 8;
+ }
+ acline += iter.key();
+ acline += ' ';
+ }
+ acline.setLength(acline.length() - 1);
+ acline = acline.append(")");
+ outs << acline << endl;
+ done = true;
+ }
+ }
+ else
+ {
+ outs << line << endl;
+ }
+ }
+ }
+
+ fin.close();
+ fout.close();
+
+ QDir().rename(fileName + "#", fileName);
+
+}
+
+//kate: indent-mode csands; space-indent off; tab-width 4;
diff --git a/buildtools/autotools/misc.h b/buildtools/autotools/misc.h
new file mode 100644
index 00000000..9db9919e
--- /dev/null
+++ b/buildtools/autotools/misc.h
@@ -0,0 +1,65 @@
+/***************************************************************************
+* Copyright (C) 2001-2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _MISC_H_
+#define _MISC_H_
+
+#include <qcstring.h>
+#include <qmap.h>
+#include <qwidget.h>
+
+/**
+ * Very small helper class. It has just static methods.
+ */
+class AutoProjectTool
+{
+public:
+
+ /**
+ * Loads the compiler options plugin for the given compiler, executes the dialog
+ * with some initial flags, and returns the new flags.
+ */
+ static QString execFlagsDialog( const QString &compiler, const QString &flags, QWidget *parent );
+
+ /**
+ * Returns the canonicalized version of a file name, i.e.
+ * the file name with special characters replaced by underscores
+ */
+ static QString canonicalize( const QString &str );
+
+ /**
+ * Parses a Makefile.am and stores its variable assignments
+ * in a map.
+ */
+ static void parseMakefileam( const QString &filename, QMap<QString, QString> *variables );
+
+ static void addToMakefileam( const QString &filename, QMap<QString, QString> variables );
+ static void removeFromMakefileam( const QString &filename, QMap<QString, QString> variables );
+ static void setMakefileam ( const QString &fileName, QMap<QString, QString> variables );
+
+ static void addRemoveMakefileam(const QString &fileName, QMap<QString, QString> variables, bool add);
+
+ /**
+ * Parses configure.in and splits AC_OUTPUT into a QStringList
+ */
+ static QStringList configureinLoadMakefiles( QString configureinpath );
+
+ /**
+ * Receives a QStringList and puts it into
+ * configure.in as arguments to AC_OUTPUT
+ */
+ static void configureinSaveMakefiles( QString configureinpath, QStringList makefiles );
+
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/removefiledlg.cpp b/buildtools/autotools/removefiledlg.cpp
new file mode 100644
index 00000000..2c3bc37f
--- /dev/null
+++ b/buildtools/autotools/removefiledlg.cpp
@@ -0,0 +1,182 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "removefiledlg.h"
+
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qfile.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <ksqueezedtextlabel.h>
+
+#include "autolistviewitems.h"
+
+#include "misc.h"
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+#include "autodetailsview.h"
+
+static bool fileListContains(const QPtrList<FileItem> &list, const QString &name)
+{
+ QPtrListIterator<FileItem> it(list);
+ for (; it.current(); ++it)
+ if ((*it)->text(0) == name)
+ return true;
+ return false;
+}
+
+
+RemoveFileDialog::RemoveFileDialog(AutoProjectWidget *widget, AutoProjectPart* part, SubprojectItem *spitem,
+ TargetItem *item, const QString &filename,
+ QWidget *parent, const char *name)
+ : RemoveFileDlgBase(parent, name, true)
+{
+ removeFromTargetsCheckBox = 0;
+
+ QStringList targets;
+
+ QPtrListIterator<TargetItem> it(spitem->targets);
+ for (; it.current(); ++it)
+ if (fileListContains((*it)->sources, filename))
+ targets.append((*it)->name);
+
+ if (targets.count() > 1)
+ {
+ removeFromTargetsCheckBox = new QCheckBox( fileGroupBox, "removeFromTargetsCheckBox" );
+ removeFromTargetsCheckBox->setMinimumSize( QSize( 0, 45 ) );
+ fileLayout->addWidget( removeFromTargetsCheckBox );
+
+ QString joinedtargets = " *" + targets.join("\n *");
+ removeFromTargetsCheckBox->setText ( i18n ( "The file %1 is still used by the following targets:\n%2\n"
+ "Remove it from all of them?").arg(filename).arg(joinedtargets) );
+ setMinimumSize(QSize(size().width(), size().height() + removeFromTargetsCheckBox->size().height()*2) );
+ }
+
+ removeLabel->setText ( i18n ( "Do you really want to remove <b>%1</b>?" ).arg ( filename ) );
+
+ directoryLabel->setText ( spitem->path );
+ if ( item->name.isEmpty() )
+ targetLabel->setText ( i18n ( "%1 in %2" ).arg ( item->primary ).arg ( item->prefix ) );
+ else
+ targetLabel->setText ( item->name );
+
+ connect ( removeButton, SIGNAL ( clicked() ), this, SLOT ( accept() ) );
+ connect ( cancelButton, SIGNAL ( clicked() ), this, SLOT ( reject() ) );
+
+ setIcon ( SmallIcon ( "editdelete.png" ) );
+
+ m_widget = widget;
+ m_part = part;
+ subProject = spitem;
+ target = item;
+ fileName = filename;
+}
+
+
+RemoveFileDialog::~RemoveFileDialog()
+{}
+
+
+void RemoveFileDialog::accept()
+{
+ m_widget->emitRemovedFile ( subProject->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + fileName );
+
+ QMap<QString,QString> replaceMap;
+
+ if (removeFromTargetsCheckBox && removeFromTargetsCheckBox->isChecked()) {
+ QPtrListIterator<TargetItem> it(subProject->targets);
+ for (; it.current(); ++it) {
+ if ((*it) != target && fileListContains((*it)->sources, fileName)) {
+ FileItem *fitem = static_cast<FileItem*>((*it)->firstChild());
+ while (fitem) {
+ FileItem *nextitem = static_cast<FileItem*>(fitem->nextSibling());
+ if (fitem->text(0) == fileName) {
+ QListView *lv = fitem->listView();
+ lv->setSelected(fitem, false);
+ (*it)->sources.remove(fitem);
+ }
+ fitem = nextitem;
+ }
+ QString canontargetname = AutoProjectTool::canonicalize((*it)->name);
+ QString varname;
+ if( (*it)->primary == "PROGRAMS" || (*it)->primary == "LIBRARIES" || (*it)->primary == "LTLIBRARIES" )
+ varname = canontargetname + "_SOURCES";
+ else
+ varname = (*it)->prefix + "_" + (*it)->primary;
+ QStringList sources = QStringList::split(QRegExp("[ \t\n]"), subProject->variables[varname]);
+ sources.remove(fileName);
+ subProject->variables[varname] = sources.join(" ");
+ replaceMap.insert(varname, fileName);
+ }
+ }
+ }
+
+ QString fileItemName;
+ FileItem *fitem = static_cast<FileItem*>(target->firstChild());
+ while (fitem) {
+ if (fitem->text(0) == fileName) {
+ QListView *lv = fitem->listView();
+ lv->setSelected(fitem, false);
+ fileItemName = fitem->name;
+ target->sources.remove(fitem);
+ break;
+ }
+ fitem = static_cast<FileItem*>(fitem->nextSibling());
+ }
+ QString canontargetname = AutoProjectTool::canonicalize(target->name);
+ QString varname;
+ if( target->primary == "PROGRAMS" || target->primary == "LIBRARIES" || target->primary == "LTLIBRARIES" )
+ varname = canontargetname + "_SOURCES";
+ else
+ varname = target->prefix + "_" + target->primary;
+ QStringList sources = QStringList::split(QRegExp("[ \t\n]"), subProject->variables[varname]);
+ sources.remove(fileName);
+ subProject->variables[varname] = sources.join(" ");
+ replaceMap.insert(varname, fileName);
+
+ AutoProjectTool::removeFromMakefileam(subProject->path + "/Makefile.am", replaceMap);
+
+// review configuration cleanup in the project file after removing subclassing related source
+ QDomDocument &dom = *(m_part->projectDom());
+
+ QDomElement el = dom.documentElement();
+ QDomNode el2 = el.namedItem("kdevautoproject");
+ QDomNode el3 = el2.namedItem("subclassing");
+
+ QDomNode n = el3.firstChild();
+ QValueList<QDomNode> nodesToRemove;
+ while ( !n.isNull() ) {
+ QDomNamedNodeMap attr = n.attributes();
+ QString fpath = subProject->path + QString("/") + fileItemName;
+ QString relpath = fpath.remove(0, m_part->projectDirectory().length());
+ if ((attr.item(0).nodeValue() == relpath)
+ || (attr.item(1).nodeValue() == relpath) )
+ nodesToRemove.append(n);
+ n = n.nextSibling();
+ }
+ QValueList<QDomNode>::iterator it;
+ for ( it = nodesToRemove.begin(); it != nodesToRemove.end(); ++it )
+ el3.removeChild(*it);
+
+ if (removeCheckBox->isChecked())
+ QFile::remove(subProject->path + "/" + fileName);
+
+ QDialog::accept();
+}
+
+#include "removefiledlg.moc"
diff --git a/buildtools/autotools/removefiledlg.h b/buildtools/autotools/removefiledlg.h
new file mode 100644
index 00000000..ab843dda
--- /dev/null
+++ b/buildtools/autotools/removefiledlg.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _REMOVEFILEDLG_H_
+#define _REMOVEFILEDLG_H_
+
+#include <qdialog.h>
+
+#include "removefiledlgbase.h"
+
+class QCheckBox;
+class AutoProjectWidget;
+class AutoProjectPart;
+class SubprojectItem;
+class TargetItem;
+
+
+class RemoveFileDialog : public RemoveFileDlgBase
+{
+ Q_OBJECT
+
+public:
+ RemoveFileDialog( AutoProjectWidget *widget, AutoProjectPart* part, SubprojectItem *spitem,
+ TargetItem *item, const QString &filename,
+ QWidget *parent = 0, const char *name = 0 );
+ ~RemoveFileDialog();
+
+protected:
+ virtual void accept();
+
+private:
+ QCheckBox *removeFromTargetsCheckBox;
+ //QCheckBox *removefromdisk_box;
+
+ AutoProjectWidget* m_widget;
+ AutoProjectPart *m_part;
+ SubprojectItem *subProject;
+ TargetItem *target;
+ QString fileName;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/removefiledlgbase.ui b/buildtools/autotools/removefiledlgbase.ui
new file mode 100644
index 00000000..d7b66011
--- /dev/null
+++ b/buildtools/autotools/removefiledlgbase.ui
@@ -0,0 +1,233 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>RemoveFileDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>RemoveFileDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>447</width>
+ <height>284</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Remove File From This Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>247</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>fileGroupBox</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>&amp;File Information</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>fileLayout</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>removeLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[REMOVE QUESTION]</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>removeCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Also &amp;remove it from disk</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>noticeLabel</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Note:&lt;/b&gt; You will not be able to undelete the file.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>targetBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Subproject Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>targetLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>[TARGET NAME]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>directoryStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>targetStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>directoryLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>[DIRECTORY NAME]</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>removeCheckBox</tabstop>
+ <tabstop>removeButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">ksqueezedtextlabel.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/autotools/removetargetdlg.cpp b/buildtools/autotools/removetargetdlg.cpp
new file mode 100644
index 00000000..6104e404
--- /dev/null
+++ b/buildtools/autotools/removetargetdlg.cpp
@@ -0,0 +1,279 @@
+/***************************************************************************
+ -------------------
+ begin : 21.11.2002
+ copyright : (C) 2002 by Victor R�er
+ email : victor_roeder@gmx.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 "removetargetdlg.h"
+
+#include <qapplication.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qfile.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <klistbox.h>
+#include <kprogress.h>
+#include <ksqueezedtextlabel.h>
+#include <klocale.h>
+
+#include "autolistviewitems.h"
+
+#include "misc.h"
+
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+
+
+RemoveTargetDialog::RemoveTargetDialog( AutoProjectWidget *widget, AutoProjectPart* part, SubprojectItem *spitem,
+ TargetItem *titem, QWidget* parent, const char* name )
+ : RemoveTargetDlgBase ( parent, name, true, 0 )
+{
+ removeLabel->setText ( i18n ( "Do you really want to remove <b>%1</b><br>with <b>all files</b> that are attached to it<br>and <b>all dependencies</b>?" ).arg ( titem->name ) );
+ directoryLabel->setText ( spitem->path );
+
+ if ( titem->name.isEmpty() )
+ targetLabel->setText ( i18n ( "%1 in %2" ).arg ( titem->primary ).arg ( titem->prefix ) );
+ else
+ targetLabel->setText ( titem->name );
+
+ connect ( removeButton, SIGNAL ( clicked() ), this, SLOT ( accept() ) );
+ connect ( cancelButton, SIGNAL ( clicked() ), this, SLOT ( reject() ) );
+
+ setIcon ( SmallIcon ( "editdelete" ) );
+
+ progressBar->hide();
+
+ m_spitem = spitem;
+ m_titem = titem;
+ m_widget = widget;
+ m_part = part;
+
+ //kdDebug ( 9020 ) << "+++++ " << titem->primary << " " << titem->prefix << " " << titem->name << endl;
+
+ init();
+}
+
+
+RemoveTargetDialog::~RemoveTargetDialog()
+{
+}
+
+void RemoveTargetDialog::init()
+{
+ QPtrList <SubprojectItem> subprojectItems = m_widget->allSubprojectItems();
+
+ TargetItem* titem = 0;
+
+ for ( SubprojectItem* spitem = subprojectItems.first(); spitem; spitem = subprojectItems.next() )
+ {
+ if ( m_titem->name.isEmpty() )
+ break;
+
+ for ( titem = spitem->targets.first(); titem; titem = spitem->targets.next() )
+ {
+ if ( m_titem->name == titem->name )
+ continue;
+
+ if ( titem->primary == "LTLIBRARIES" || titem->primary == "PROGRAMS"
+ || titem->primary == "LIBRARIES" || titem->primary == "JAVA" )
+ {
+ QString canonname = AutoProjectTool::canonicalize ( titem->name );
+
+ if ( spitem->variables[canonname + "_LIBADD"].contains ( m_titem->name ) > 0 ||
+ spitem->variables[canonname + "_LDADD"].contains ( m_titem->name ) > 0 )
+ {
+ dependencyListBox->insertItem ( SmallIcon ( "target_kdevelop" ), spitem->path + " (" + titem->name + ")" );
+
+ dependentSubprojects.append ( spitem );
+ }
+ }
+ }
+ }
+
+ if ( dependencyListBox->count() == 0 )
+ dependencyListBox->insertItem ( i18n("no dependency", "<none>") );
+}
+
+void RemoveTargetDialog::accept ()
+{
+ progressBar->show();
+ progressBar->setFormat ( i18n ( "Removing Target... %p%" ) );
+
+ qApp->processEvents();
+
+ QString canonname = AutoProjectTool::canonicalize ( m_titem->name );
+ QString varname = m_titem->prefix + "_" + m_titem->primary;
+
+ SubprojectItem* spitem = 0;
+ TargetItem* titem = 0;
+
+ QMap <QString, QString> removeMap;
+ QMap <QString, QString> replaceMap;
+
+ // Remove dependencies to other targets first (stored by init() in 'dependentTargets')
+ for ( spitem = dependentSubprojects.first(); spitem; spitem = dependentSubprojects.next() )
+ {
+ for ( titem = spitem->targets.first(); titem; titem = spitem->targets.next() )
+ {
+ QString curVarname;
+ QString curCanonname = AutoProjectTool::canonicalize ( titem->name );
+ QStringList dependencies;
+
+ if ( spitem->variables[curCanonname + "_LIBADD"].contains ( m_titem->name ) )
+ curVarname = curCanonname + "_LIBADD";
+ else
+ curVarname = curCanonname + "_LDADD";
+
+ dependencies = QStringList::split(QRegExp("[ \t\n]"), spitem->variables[curVarname]);
+
+ //QStringList::Iterator it = dependencies.begin();
+
+ for ( uint i = 0; i < dependencies.size(); ++i )
+ {
+ QString s = dependencies[i];
+ if ( s.contains ( m_titem->name ) > 0 )
+ dependencies.remove ( s );
+ }
+
+ // if we removed the last entry of "blabla_LDADD" or "blabla_LIBADD", remove the complete line
+ if ( dependencies.count() == 0 )
+ {
+ removeMap.insert ( curVarname, "" );
+ AutoProjectTool::removeFromMakefileam ( spitem->path + "/Makefile.am", removeMap );
+ removeMap.clear();
+ }
+ else
+ {
+ spitem->variables[curVarname] = dependencies.join ( " " );
+ replaceMap.insert ( curVarname, spitem->variables[curVarname] );
+ AutoProjectTool::addToMakefileam ( spitem->path + "/Makefile.am", replaceMap );
+ replaceMap.clear();
+ }
+ }
+ }
+
+ // handling am_edit stuff
+ if ( m_titem->primary == "KDEICON" )
+ removeMap.insert ( "KDE_ICON", "" );
+ else if ( m_titem->primary == "KDEDOCS" )
+ removeMap.insert ( "KDE_DOCS", "" );
+ else
+ {
+ // if we have bin_PROGRAMS = [target to be deleted] [other target]
+ // delete only the [target to be deleted], not the whole line!
+ QStringList targets = QStringList::split(QRegExp("[ \t\n]"), m_spitem->variables[varname]);
+
+ if ( targets.count() > 1 )
+ {
+ targets.remove ( m_titem->name );
+ m_spitem->variables[varname] = targets.join ( " " );
+ replaceMap.insert ( varname, m_spitem->variables[varname] );
+ AutoProjectTool::addToMakefileam ( m_spitem->path + "/Makefile.am", replaceMap );
+ replaceMap.clear();
+ }
+ else
+ {
+ removeMap.insert ( varname, m_titem->name );
+ }
+ }
+
+ // if we have no such line containing blabla_SOURCES, blabla_LDFLAGS, etc.
+ // they are ignored
+ removeMap.insert ( canonname + "_SOURCES", "" );
+
+ // remove from our internal list
+ m_spitem->variables.erase(canonname+"_SOURCES");
+
+ if ( m_titem->primary == "PROGRAMS" || m_titem->primary == "LTLIBRARIES" )
+ {
+ removeMap.insert ( canonname + "_LDFLAGS", "" );
+ removeMap.insert ( canonname + "_DEPENDENCIES", "" );
+ removeMap.insert ( canonname + "_LDADD", "" );
+ removeMap.insert ( canonname + "_LIBADD", "" );
+ }
+
+ AutoProjectTool::removeFromMakefileam ( m_spitem->path + "/Makefile.am", removeMap );
+
+ removeMap.clear();
+
+ // if we have another "blabla_PROGRAMS" or "blabla_LTLIBRARIES" target in the same subproject
+ // check if it has an empty "blabla_LIBADD"-entry
+ if ( m_titem->primary == "PROGRAMS" || m_titem->primary == "LTLIBRARIES" )
+ {
+ for ( titem = m_spitem->targets.first(); titem; titem = m_spitem->targets.next() )
+ {
+ //kdDebug (9020) << "******** " << m_spitem->subdir << endl;
+ if ( titem->primary == "PROGRAMS" || titem->primary == "LTLIBRARIES" )
+ {
+ QString curCanonname = AutoProjectTool::canonicalize ( titem->name );
+
+ if ( m_spitem->variables[curCanonname + "_LIBADD"].isEmpty() )
+ {
+ removeMap.insert ( curCanonname + "_LIBADD", "" );
+
+ //kdDebug (9020) << "Removing from " << m_spitem->subdir << " " << curCanonname << "_LIBADD" << endl;
+
+ AutoProjectTool::removeFromMakefileam ( m_spitem->path + "/Makefile.am", removeMap );
+
+ removeMap.clear();
+ }
+ }
+ }
+ }
+
+
+ progressBar->setTotalSteps ( m_titem->sources.count() );
+
+ QStringList fileList;
+
+ for ( FileItem* fitem = m_titem->sources.first(); fitem; fitem = m_titem->sources.next() )
+ {
+ if (removeCheckBox->isChecked())
+ {
+ // before removing the files, check if they are mentioned in "noinst_HEADERS = blabla1.h blabla2.h"
+ QStringList noInstHeaders = QStringList::split ( QRegExp ( "[ \t\n]" ), m_spitem->variables["noinst_HEADERS"] );
+
+ if ( noInstHeaders.contains ( fitem->name ) )
+ {
+ noInstHeaders.remove ( fitem->name );
+
+ m_spitem->variables["noinst_HEADERS"] = noInstHeaders.join ( " " );
+ replaceMap.insert ( "noinst_HEADERS", m_spitem->variables["noinst_HEADERS"] );
+ AutoProjectTool::addToMakefileam ( m_spitem->path + "/Makefile.am", replaceMap );
+ replaceMap.clear();
+ }
+
+ QFile::remove(m_spitem->path + "/" + fitem->name);
+ }
+
+ fileList.append ( m_spitem->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + fitem->name );
+
+ qApp->processEvents();
+
+ progressBar->setValue ( progressBar->value() + 1 );
+ }
+
+ m_widget->emitRemovedFiles ( fileList );
+
+ m_spitem->targets.remove ( m_titem );
+
+
+ QDialog::accept();
+}
diff --git a/buildtools/autotools/removetargetdlg.h b/buildtools/autotools/removetargetdlg.h
new file mode 100644
index 00000000..6953d2bf
--- /dev/null
+++ b/buildtools/autotools/removetargetdlg.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ -------------------
+ begin : 21.11.2002
+ copyright : (C) 2002 by Victor Rder
+ email : victor_roeder@gmx.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 _REMOVETARGETDLG_H_
+#define _REMOVETARGETDLG_H_
+
+#include "removetargetdlgbase.h"
+
+#include <qptrlist.h>
+
+class AutoProjectWidget;
+class AutoProjectPart;
+class SubprojectItem;
+class TargetItem;
+
+/**
+ *
+ * KDevelop Authors
+ **/
+class RemoveTargetDialog : public RemoveTargetDlgBase
+{
+
+public:
+ RemoveTargetDialog( AutoProjectWidget *widget, AutoProjectPart* part, SubprojectItem *spitem,
+ TargetItem *titem, QWidget* parent = 0, const char* name = 0 );
+ ~RemoveTargetDialog();
+
+private:
+ SubprojectItem* m_spitem;
+ TargetItem* m_titem;
+ AutoProjectWidget* m_widget;
+ AutoProjectPart* m_part;
+
+ QPtrList <SubprojectItem> dependentSubprojects;
+
+protected:
+ void init ();
+ virtual void accept();
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/buildtools/autotools/removetargetdlgbase.ui b/buildtools/autotools/removetargetdlgbase.ui
new file mode 100644
index 00000000..8e3660d3
--- /dev/null
+++ b/buildtools/autotools/removetargetdlgbase.ui
@@ -0,0 +1,264 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>RemoveTargetDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>RemoveTargetDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>472</width>
+ <height>477</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Remove Target From [SUBPROJECT]</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>targetBox</cstring>
+ </property>
+ <property name="title">
+ <string>Subproject Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KSqueezedTextLabel" row="0" column="1">
+ <property name="name">
+ <cstring>directoryLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>[TARGET DIRECTORY]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>targetLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[TARGET NAME]</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>directoryStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>targetStaticLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>fileGroupBox</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>&amp;Target Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>removeLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[REMOVE QUESTION]</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>removeCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Also &amp;remove it from disk</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Note:&lt;/b&gt; You will not be able to undo this operation. Please check your Makefile.am afterwards.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Dependencies to Other Subprojects</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListBox" row="0" column="0">
+ <property name="name">
+ <cstring>dependencyListBox</cstring>
+ </property>
+ <property name="dragAutoScroll">
+ <bool>false</bool>
+ </property>
+ <property name="selectionMode">
+ <enum>NoSelection</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="KProgress" row="3" column="0">
+ <property name="name">
+ <cstring>progressBar</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="5" column="0">
+ <property name="name">
+ <cstring>buttonLayout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>ksqueezedtextlabel.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>kprogress.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/autotools/subprojectoptionsdlg.cpp b/buildtools/autotools/subprojectoptionsdlg.cpp
new file mode 100644
index 00000000..5ad6bf10
--- /dev/null
+++ b/buildtools/autotools/subprojectoptionsdlg.cpp
@@ -0,0 +1,404 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "subprojectoptionsdlg.h"
+
+#include <qdom.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qregexp.h>
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <keditlistbox.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <knotifyclient.h>
+#include <kservice.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kfiledialog.h>
+#include "domutil.h"
+#include "misc.h"
+#include "addprefixdlg.h"
+
+#include "autolistviewitems.h"
+
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+
+
+SubprojectOptionsDialog::SubprojectOptionsDialog(AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *item, QWidget *parent, const char *name)
+ : SubprojectOptionsDialogBase(parent, name, true)
+{
+ setCaption(i18n("Subproject Options for '%1'").arg(item->subdir));
+
+ subProject = item;
+ m_part = part;
+
+ QFontMetrics fm(cflags_edit->fontMetrics());
+ int wid = fm.width('X')*35;
+ cflags_edit->setMinimumWidth(wid);
+ cxxflags_edit->setMinimumWidth(wid);
+ fflags_edit->setMinimumWidth(wid);
+
+ QDomDocument &dom = *part->projectDom();
+ QString prefix = "/kdevautoproject/configurations/" + m_part->currentBuildConfig() + "/";
+
+ ccompiler = DomUtil::readEntry(dom, prefix + "ccompiler", "kdevgccoptions");
+ cxxcompiler = DomUtil::readEntry(dom, prefix + "cxxcompiler", "kdevgppoptions");
+ f77compiler = DomUtil::readEntry(dom, prefix + "f77compiler", "kdevg77options");
+
+ if (!KService::serviceByDesktopName(ccompiler))
+ cflags_button->setEnabled(false);
+ if (!KService::serviceByDesktopName(cxxcompiler))
+ cxxflags_button->setEnabled(false);
+ if (!KService::serviceByDesktopName(f77compiler))
+ fflags_button->setEnabled(false);
+
+ insideinc_listview->header()->hide();
+ outsideinc_listview->header()->hide();
+ buildorder_listview->header()->hide();
+
+ insideinc_listview->setSorting(-1);
+ outsideinc_listview->setSorting(-1);
+ prefix_listview->setSorting(-1);
+ buildorder_listview->setSorting(-1);
+
+ connect( prefix_listview, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), this, SLOT( editPrefixClicked() ) );
+
+ // Insert all subdirectories as possible include directories
+ QStringList l = widget->allSubprojects();
+ QCheckListItem *lastItem = 0;
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it) {
+ kdDebug(9020) << "----------> subproject = " << (*it) << endl;
+ QString subProjectName = *it;
+
+ if( subProjectName.isEmpty() ){
+ subProjectName = QString::fromLatin1( "." );
+ }
+ QCheckListItem *clitem = new QCheckListItem(insideinc_listview, subProjectName, QCheckListItem::CheckBox);
+ if (lastItem)
+ clitem->moveItem(lastItem);
+ lastItem = clitem;
+ }
+
+ setIcon ( SmallIcon ( "configure" ) );
+
+ readConfig();
+}
+
+
+SubprojectOptionsDialog::~SubprojectOptionsDialog()
+{}
+
+
+void SubprojectOptionsDialog::readConfig()
+{
+
+ cflags_edit->setText(subProject->variables["AM_CFLAGS"]);
+ cxxflags_edit->setText(subProject->variables["AM_CXXFLAGS"]);
+ fflags_edit->setText(subProject->variables["AM_FFLAGS"]);
+
+ metasources_checkbox->setChecked(subProject->variables["METASOURCES"].stripWhiteSpace() == "AUTO");
+
+ QString includes = subProject->variables["INCLUDES"];
+ QStringList includeslist = QStringList::split(QRegExp("[ \t]"), QString(includes));
+
+ QListViewItem *lastItem = 0;
+ QStringList::Iterator it;
+ for (it = includeslist.begin(); it != includeslist.end(); ++it) {
+ QCheckListItem *clitem = static_cast<QCheckListItem*>(insideinc_listview->firstChild());
+ while (clitem) {
+ if (*it == ("-I$(top_srcdir)/" + clitem->text())) {
+ clitem->setOn(true);
+ break;
+ }
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ if (!clitem) {
+ QListViewItem *item = new QListViewItem(outsideinc_listview, *it);
+ if (lastItem)
+ item->moveItem(lastItem);
+ lastItem = item;
+ }
+ }
+
+ QMap<QString, QString>::ConstIterator it2;
+ for (it2 = subProject->prefixes.begin(); it2 != subProject->prefixes.end(); ++it2)
+ new QListViewItem(prefix_listview, it2.key(), it2.data());
+
+ QString subdirs = subProject->variables["SUBDIRS"];
+ kdDebug(9020) << "Subdirs variable: " << subdirs << endl;
+ QStringList subdirslist = QStringList::split(QRegExp("[ \t]"), QString(subdirs));
+ lastItem = 0;
+ for (it = subdirslist.begin(); it != subdirslist.end(); ++it) {
+ QListViewItem *item = new QListViewItem(buildorder_listview, *it);
+ if (lastItem)
+ item->moveItem(lastItem);
+ lastItem = item;
+ }
+}
+
+
+void SubprojectOptionsDialog::storeConfig()
+{
+ QMap<QString, QString> replaceMap;
+
+ QString old_cflags = subProject->variables["AM_CFLAGS"];
+ QString new_cflags = cflags_edit->text();
+ if (new_cflags != old_cflags) {
+ subProject->variables["AM_CFLAGS"] = new_cflags;
+ replaceMap.insert("AM_CFLAGS", new_cflags);
+ }
+
+ QString old_cxxflags = subProject->variables["AM_CXXFLAGS"];
+ QString new_cxxflags = cxxflags_edit->text();
+ if (new_cxxflags != old_cxxflags) {
+ subProject->variables["AM_CXXFLAGS"] = new_cxxflags;
+ replaceMap.insert("AM_CXXFLAGS", new_cxxflags);
+ }
+
+ QString old_fflags = subProject->variables["AM_FFLAGS"];
+ QString new_fflags = fflags_edit->text();
+ if (new_fflags != old_fflags) {
+ subProject->variables["AM_FFLAGS"] = new_fflags;
+ replaceMap.insert("AM_FFLAGS", new_fflags);
+ }
+
+ QString old_metasources = subProject->variables["METASOURCES"];
+ QString new_metasources = metasources_checkbox->isChecked() ? QString::fromLatin1("AUTO") : QString::null;
+ if (new_metasources != old_metasources) {
+ subProject->variables["METASOURCES"] = new_metasources;
+ replaceMap.insert("METASOURCES", new_metasources);
+ }
+
+ QStringList includeslist;
+ QCheckListItem *clitem = static_cast<QCheckListItem*>(insideinc_listview->firstChild());
+ while (clitem) {
+ if (clitem->isOn())
+ includeslist.append("-I$(top_srcdir)/" + clitem->text());
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ clitem = static_cast<QCheckListItem*>(outsideinc_listview->firstChild());
+ while (clitem) {
+ includeslist.append(clitem->text());
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ QString includes = includeslist.join(" ");
+ subProject->variables["INCLUDES"] = includes;
+ replaceMap.insert("INCLUDES", includes);
+
+ subProject->prefixes.clear();
+ for (QListViewItem *item = prefix_listview->firstChild();
+ item; item = item->nextSibling()) {
+ QString key = item->text(0);
+ QString data = item->text(1);
+ subProject->prefixes[key] = data;
+ replaceMap.insert(key + "dir", data);
+ }
+ /// \FIXME take removed prefixes into account
+
+ QStringList subdirslist;
+ for (QListViewItem *item = buildorder_listview->firstChild();
+ item; item = item->nextSibling())
+ subdirslist.append(item->text(0));
+ QString subdirs = subdirslist.join(" ");
+ kdDebug() << "New subdirs variable: " << subdirs << endl;
+ subProject->variables["SUBDIRS"] = subdirs;
+ replaceMap.insert("SUBDIRS", subdirs);
+
+ AutoProjectTool::setMakefileam(subProject->path + "/Makefile.am", replaceMap);
+}
+
+
+void SubprojectOptionsDialog::cflagsClicked()
+{
+ QString new_cflags = AutoProjectTool::execFlagsDialog(ccompiler, cflags_edit->text(), this);
+// if (!new_cflags.isNull())
+ cflags_edit->setText(new_cflags);
+}
+
+
+void SubprojectOptionsDialog::cxxFlagsClicked()
+{
+ QString new_cxxflags = AutoProjectTool::execFlagsDialog(cxxcompiler, cxxflags_edit->text(), this);
+// if (!new_cxxflags.isNull())
+ cxxflags_edit->setText(new_cxxflags);
+}
+
+
+void SubprojectOptionsDialog::fflagsClicked()
+{
+ QString new_fflags = AutoProjectTool::execFlagsDialog(f77compiler, fflags_edit->text(), this);
+// if (!new_fflags.isNull())
+ fflags_edit->setText(new_fflags);
+}
+
+
+void SubprojectOptionsDialog::insideMoveUpClicked()
+{
+ if (insideinc_listview->currentItem() == insideinc_listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = insideinc_listview->firstChild();
+ while (item->nextSibling() != insideinc_listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(insideinc_listview->currentItem());
+}
+
+
+void SubprojectOptionsDialog::insideMoveDownClicked()
+{
+ if (insideinc_listview->currentItem() == 0 || insideinc_listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ insideinc_listview->currentItem()->moveItem(insideinc_listview->currentItem()->nextSibling());
+}
+
+
+void SubprojectOptionsDialog::outsideMoveUpClicked()
+{
+ if (outsideinc_listview->currentItem() == outsideinc_listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = outsideinc_listview->firstChild();
+ while (item->nextSibling() != outsideinc_listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(outsideinc_listview->currentItem());
+}
+
+
+void SubprojectOptionsDialog::outsideMoveDownClicked()
+{
+ if (outsideinc_listview->currentItem() == 0 || outsideinc_listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ outsideinc_listview->currentItem()->moveItem(outsideinc_listview->currentItem()->nextSibling());
+}
+
+void SubprojectOptionsDialog::outsideAddClicked()
+{
+ KURLRequesterDlg dialog( "", i18n( "Add Include directory: Choose directory, give -Idirectory or use a variable with -I$(FOOBAR)" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ dialog.urlRequester() ->setURL( QString::null );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString file = dialog.urlRequester() ->url();
+ if ( !file.isEmpty() )
+ {
+ if ( !file.isEmpty() )
+ {
+ if( file.startsWith("-I") )
+ new QListViewItem( outsideinc_listview, file );
+ else
+ {
+ new QListViewItem( outsideinc_listview, "-I"+file );
+ }
+ }
+ }
+}
+
+
+void SubprojectOptionsDialog::outsideEditClicked()
+{
+ if ( (outsideinc_listview->childCount()==0) || (outsideinc_listview->currentItem() == 0) )
+ return;
+ bool ok;
+ QString dir = KInputDialog::getText(i18n("Edit Include Directory"), i18n("Edit include directory:"),
+ outsideinc_listview->currentItem()-> text(0), &ok, 0);
+ if (ok && !dir.isEmpty())
+ outsideinc_listview->currentItem()-> setText(0, dir);
+}
+
+
+void SubprojectOptionsDialog::outsideRemoveClicked()
+{
+ delete outsideinc_listview->currentItem();
+}
+
+
+void SubprojectOptionsDialog::addPrefixClicked()
+{
+ AddPrefixDialog dlg;
+ if (!dlg.exec() || dlg.name().isEmpty() || dlg.path().isEmpty() )
+ return;
+
+ new QListViewItem(prefix_listview, dlg.name(), dlg.path());
+}
+
+
+void SubprojectOptionsDialog::editPrefixClicked()
+{
+ QListViewItem* lvItem = prefix_listview->currentItem();
+ if ( (prefix_listview->childCount()==0) || (lvItem == 0) )
+ return;
+ AddPrefixDialog dlg(lvItem-> text(0), lvItem-> text(1));
+ dlg.setCaption(i18n("Edit Prefix"));
+ if (!dlg.exec() || dlg.name().isEmpty() || dlg.path().isEmpty() )
+ return;
+ lvItem-> setText(0, dlg.name());
+ lvItem-> setText(1, dlg.path());
+}
+
+void SubprojectOptionsDialog::removePrefixClicked()
+{
+ delete prefix_listview->currentItem();
+}
+
+
+void SubprojectOptionsDialog::buildorderMoveUpClicked()
+{
+ if (buildorder_listview->currentItem() == buildorder_listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = buildorder_listview->firstChild();
+ while (item->nextSibling() != buildorder_listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(buildorder_listview->currentItem());
+}
+
+
+void SubprojectOptionsDialog::buildorderMoveDownClicked()
+{
+ if (buildorder_listview->currentItem() == 0 || buildorder_listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ buildorder_listview->currentItem()->moveItem(buildorder_listview->currentItem()->nextSibling());
+}
+
+
+void SubprojectOptionsDialog::accept()
+{
+ storeConfig();
+ QDialog::accept();
+}
+
+#include "subprojectoptionsdlg.moc"
diff --git a/buildtools/autotools/subprojectoptionsdlg.h b/buildtools/autotools/subprojectoptionsdlg.h
new file mode 100644
index 00000000..7ec1fbf0
--- /dev/null
+++ b/buildtools/autotools/subprojectoptionsdlg.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _SUBPROJECTOPTIONSDLG_H_
+#define _SUBPROJECTOPTIONSDLG_H_
+
+#include "subprojectoptionsdlgbase.h"
+
+class AutoProjectPart;
+class AutoProjectWidget;
+class SubprojectItem;
+
+
+class SubprojectOptionsDialog : public SubprojectOptionsDialogBase
+{
+ Q_OBJECT
+
+public:
+ SubprojectOptionsDialog( AutoProjectPart *part, AutoProjectWidget *widget,
+ SubprojectItem *item, QWidget *parent = 0, const char *name = 0 );
+ ~SubprojectOptionsDialog();
+
+private:
+ virtual void cflagsClicked();
+ virtual void cxxFlagsClicked();
+ virtual void fflagsClicked();
+ virtual void insideMoveUpClicked();
+ virtual void insideMoveDownClicked();
+ virtual void outsideMoveUpClicked();
+ virtual void outsideMoveDownClicked();
+ virtual void outsideAddClicked();
+ virtual void outsideRemoveClicked();
+ virtual void outsideEditClicked();
+ virtual void addPrefixClicked();
+ virtual void editPrefixClicked();
+ virtual void removePrefixClicked();
+ virtual void buildorderMoveUpClicked();
+ virtual void buildorderMoveDownClicked();
+ virtual void accept();
+
+ void readConfig();
+ void storeConfig();
+
+ SubprojectItem *subProject;
+ AutoProjectWidget *m_widget;
+ AutoProjectPart *m_part;
+
+ QString ccompiler;
+ QString cxxcompiler;
+ QString f77compiler;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/subprojectoptionsdlgbase.ui b/buildtools/autotools/subprojectoptionsdlgbase.ui
new file mode 100644
index 00000000..f2723e5a
--- /dev/null
+++ b/buildtools/autotools/subprojectoptionsdlgbase.ui
@@ -0,0 +1,989 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>SubprojectOptionsDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>sub project options widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>442</width>
+ <height>437</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subproject Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>subprojectoptions_tabwidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Co&amp;mpiler</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>cflags_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Compiler flags for C compiler (CFLA&amp;GS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>cflags_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cflags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>cxxflags_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Compiler flags for C++ compiler (C&amp;XXFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cxxflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>cxxflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cxxflags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>fflags_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Compiler flags for Fortran compiler (&amp;FFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>fflags_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>fflags_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</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>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Includes</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>metasources_checkbox</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically &amp;generate metasources</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_3</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="QPushButton">
+ <property name="name">
+ <cstring>insidemoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>insidemovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2</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>
+ </vbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>insideinc_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directories in&amp;side project:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>insideinc_listview</cstring>
+ </property>
+ </widget>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>insideinc_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideadd_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideedit_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideremove_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsidemoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move U&amp;p</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsidemovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Dow&amp;n</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_2</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>
+ </vbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Directories ou&amp;tside project:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>outsideinc_listview</cstring>
+ </property>
+ </widget>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>outsideinc_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Prefixes</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Path</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>prefix_listview</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>prefixes_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>C&amp;ustom prefixes:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>prefix_listview</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addprefix_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>editprefix_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeprefix_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Build Order</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout9_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_3_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buildmoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buildmovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2_2</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>
+ </vbox>
+ </widget>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>buildorder_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buildorder_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>O&amp;rder in which sub projects are built:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buildorder_listview</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cflags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>cflagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>cxxflags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>cxxFlagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>removeprefix_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>removePrefixClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insidemoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>insideMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insidemovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>insideMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideadd_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>outsideAddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideedit_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>outsideEditClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsidemovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>outsideMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsidemoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>outsideMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideremove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>outsideRemoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>fflags_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>fflagsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buildmovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>buildorderMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buildmoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>buildorderMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>addprefix_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>addPrefixClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editprefix_button</sender>
+ <signal>clicked()</signal>
+ <receiver>sub project options widget</receiver>
+ <slot>editPrefixClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>cflags_edit</tabstop>
+ <tabstop>cflags_button</tabstop>
+ <tabstop>cxxflags_edit</tabstop>
+ <tabstop>cxxflags_button</tabstop>
+ <tabstop>fflags_edit</tabstop>
+ <tabstop>fflags_button</tabstop>
+ <tabstop>subprojectoptions_tabwidget</tabstop>
+ <tabstop>metasources_checkbox</tabstop>
+ <tabstop>insideinc_listview</tabstop>
+ <tabstop>insidemoveup_button</tabstop>
+ <tabstop>insidemovedown_button</tabstop>
+ <tabstop>outsideinc_listview</tabstop>
+ <tabstop>outsideadd_button</tabstop>
+ <tabstop>outsideedit_button</tabstop>
+ <tabstop>outsideremove_button</tabstop>
+ <tabstop>outsidemoveup_button</tabstop>
+ <tabstop>outsidemovedown_button</tabstop>
+ <tabstop>prefix_listview</tabstop>
+ <tabstop>addprefix_button</tabstop>
+ <tabstop>editprefix_button</tabstop>
+ <tabstop>removeprefix_button</tabstop>
+ <tabstop>buildorder_listview</tabstop>
+ <tabstop>buildmoveup_button</tabstop>
+ <tabstop>buildmovedown_button</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">buildorderMoveDownClicked()</slot>
+ <slot access="protected">cflagsClicked()</slot>
+ <slot access="protected">cxxFlagsClicked()</slot>
+ <slot access="protected">fflagsClicked()</slot>
+ <slot access="protected">insideMoveDownClicked()</slot>
+ <slot access="protected">insideMoveUpClicked()</slot>
+ <slot access="protected">buildorderMoveUpClicked()</slot>
+ <slot access="protected">outsideAddClicked()</slot>
+ <slot access="protected">outsideEditClicked()</slot>
+ <slot access="protected">outsideMoveDownClicked()</slot>
+ <slot access="protected">outsideMoveUpClicked()</slot>
+ <slot access="protected">outsideRemoveClicked()</slot>
+ <slot access="protected">removePrefixClicked()</slot>
+ <slot access="private">addPrefixClicked()</slot>
+ <slot access="private">editPrefixClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/autotools/targetoptionsdlg.cpp b/buildtools/autotools/targetoptionsdlg.cpp
new file mode 100644
index 00000000..c8d49c55
--- /dev/null
+++ b/buildtools/autotools/targetoptionsdlg.cpp
@@ -0,0 +1,357 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "targetoptionsdlg.h"
+
+#include <qcheckbox.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <klineedit.h>
+#include <kbuttonbox.h>
+#include <kdialog.h>
+#include <kinputdialog.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <klocale.h>
+#include <knotifyclient.h>
+#include <kfiledialog.h>
+#include "autolistviewitems.h"
+
+#include "misc.h"
+#include "autoprojectpart.h"
+#include "autoprojectwidget.h"
+#include "urlutil.h"
+
+TargetOptionsDialog::TargetOptionsDialog(AutoProjectWidget *widget, TargetItem *item,
+ QWidget *parent, const char *name)
+ : TargetOptionsDialogBase(parent, name, true)
+{
+ setCaption( i18n("Target Options for '%1'").arg(item->name) );
+ setIcon( SmallIcon("configure") );
+
+ target = item;
+ m_widget = widget;
+
+ if (item->primary == "PROGRAMS") {
+ insidelib_label->setText(i18n("Link convenience libraries inside project (LDADD)"));
+ outsidelib_label->setText(i18n("Link libraries outside project (LDADD)"));
+ }
+ else
+ argumentBox->setEnabled( false );
+// run_arguments_edit->setEnabled(false);
+
+ insidelib_listview->header()->hide();
+ outsidelib_listview->header()->hide();
+ insidelib_listview->setSorting(-1);
+ outsidelib_listview->setSorting(-1);
+
+
+ m_cwdEdit->completionObject()->setMode(KURLCompletion::DirCompletion);
+ m_cwdEdit->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ // Insert all convenience libraries as possible linked libraries
+ QStringList l = widget->allLibraries();
+ QStringList::ConstIterator it;
+ QString fulltargetname = m_widget->subprojectDirectory() + "/" + item->name;
+ for (it = l.begin(); it != l.end(); ++it)
+ // Do not list the target itself (a target can not link with itself)
+ if ( !fulltargetname.endsWith(*it) )
+ (void) new QCheckListItem(insidelib_listview, *it, QCheckListItem::CheckBox);
+ readConfig();
+}
+
+
+TargetOptionsDialog::~TargetOptionsDialog()
+{}
+
+
+void TargetOptionsDialog::readConfig()
+{
+ QString flagsstr = target->ldflags;
+ flagsstr.replace(QRegExp("$(KDE_PLUGIN)"), "-avoid-version -module -no-undefined $(KDE_RPATH)");
+ QStringList l1 = QStringList::split(QRegExp("[ \t]"), flagsstr);
+ QStringList::Iterator l1it;
+
+ l1it = l1.find("-all-static");
+ if (l1it != l1.end()) {
+ allstatic_box->setChecked(true);
+ l1.remove(l1it);
+ }
+ l1it = l1.find("-avoid-version");
+ if (l1it != l1.end()) {
+ avoidversion_box->setChecked(true);
+ l1.remove(l1it);
+ }
+ l1it = l1.find("-module");
+ if (l1it != l1.end()) {
+ module_box->setChecked(true);
+ l1.remove(l1it);
+ }
+ l1it = l1.find("-no-undefined");
+ if (l1it != l1.end()) {
+ noundefined_box->setChecked(true);
+ l1.remove(l1it);
+ }
+ ldflagsother_edit->setText(l1.join(" "));
+ dependencies_edit->setText(target->dependencies);
+
+ QString addstr = (target->primary == "PROGRAMS")? target->ldadd : target->libadd;
+ QStringList l2 = QStringList::split(QRegExp("[ \t]"), addstr);
+
+ kdDebug(9020) << "ls=: " << addstr << endl;
+
+ bool inlistItem;
+ QListViewItem *lastItem = 0;
+ QStringList::Iterator l2it;
+ QCheckListItem *flitem = static_cast<QCheckListItem*>(insidelib_listview->firstChild());
+ for (l2it = l2.begin(); l2it != l2.end(); ++l2it) {
+ inlistItem = false;
+ QCheckListItem *clitem = static_cast<QCheckListItem*>(insidelib_listview->firstChild());
+ if (flitem) {
+ while (clitem) {
+ if (*l2it == ("$(top_builddir)/" + clitem->text())) {
+ clitem->setOn(true);
+ // move this item to the "top of the list"
+ if (flitem != clitem)
+ clitem->moveItem(flitem);
+ // move the "top of the list" one item down
+ flitem = static_cast<QCheckListItem*>(flitem->nextSibling());
+ inlistItem = true;
+ break;
+ }
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ }
+ if ( inlistItem == false ) {
+ QListViewItem *item = new QListViewItem(outsidelib_listview, *l2it);
+ if (lastItem)
+ item->moveItem(lastItem);
+ lastItem = item;
+ }
+ }
+
+ if (target->primary == "PROGRAMS")
+ {
+ run_arguments_edit->setText(DomUtil::readEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/runarguments/" + target->name));
+ if( DomUtil::readEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/cwd/" + target->name).isEmpty() )
+ {
+ m_cwdEdit->setURL( m_widget->m_part->buildDirectory()+"/"+URLUtil::getRelativePath(m_widget->m_part->topsourceDirectory(), m_widget->m_part->projectDirectory())+"/"+m_widget->activeDirectory() );
+ m_cwdEdit->fileDialog()->setURL( KURL::fromPathOrURL( m_widget->m_part->buildDirectory()+"/"+URLUtil::getRelativePath(m_widget->m_part->topsourceDirectory(), m_widget->m_part->projectDirectory())+"/"+m_widget->activeDirectory() ) );
+ }else
+ {
+ m_cwdEdit->setURL( DomUtil::readEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/cwd/" + target->name) );
+ m_cwdEdit->fileDialog()->setURL( KURL::fromPathOrURL( DomUtil::readEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/cwd/" + target->name) ) );
+ }
+ debug_arguments_edit->setText(DomUtil::readEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/debugarguments/" + target->name));
+ }
+}
+
+
+void TargetOptionsDialog::storeConfig()
+{
+ QStringList flagslist;
+ if (allstatic_box->isChecked())
+ flagslist.append("-all-static");
+ if (avoidversion_box->isChecked())
+ flagslist.append("-avoid-version");
+ if (module_box->isChecked())
+ flagslist.append("-module");
+ if (noundefined_box->isChecked())
+ flagslist.append("-no-undefined");
+ flagslist.append(ldflagsother_edit->text());
+ QString new_ldflags = flagslist.join(" ");
+
+ QStringList liblist;
+ QCheckListItem *clitem = static_cast<QCheckListItem*>(insidelib_listview->firstChild());
+ while (clitem) {
+ if( clitem->isOn() )
+ liblist.append("$(top_builddir)/" + clitem->text());
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ clitem = static_cast<QCheckListItem*>(outsidelib_listview->firstChild());
+ while (clitem) {
+ liblist.append(clitem->text());
+ clitem = static_cast<QCheckListItem*>(clitem->nextSibling());
+ }
+ QString new_addstr = liblist.join(" ");
+
+ QString canonname = AutoProjectTool::canonicalize(target->name);
+ QMap<QString, QString> replaceMap;
+
+ if (target->primary == "PROGRAMS") {
+ QString old_ldadd = target->ldadd;
+ if (new_addstr != old_ldadd) {
+ target->ldadd = new_addstr;
+ replaceMap.insert(canonname + "_LDADD", new_addstr);
+ }
+ }
+
+ if (target->primary == "LIBRARIES" || target->primary == "LTLIBRARIES") {
+ QString old_libadd = target->libadd;
+ if (new_addstr != old_libadd) {
+ target->libadd = new_addstr;
+ replaceMap.insert(canonname + "_LIBADD", new_addstr);
+ }
+ }
+
+ QString old_ldflags = target->ldflags;
+ if (new_ldflags != old_ldflags) {
+ target->ldflags = new_ldflags;
+ replaceMap.insert(canonname + "_LDFLAGS", new_ldflags);
+ }
+
+ QString new_dependencies = dependencies_edit->text();
+ QString old_dependencies = target->dependencies;
+ if (new_dependencies != old_dependencies) {
+ target->dependencies = new_dependencies;
+ if (!new_dependencies.isEmpty())
+ replaceMap.insert(canonname + "_DEPENDENCIES", new_dependencies);
+ }
+
+ // We can safely assume that this target is in the active sub project
+ AutoProjectTool::setMakefileam(m_widget->subprojectDirectory() + "/Makefile.am", replaceMap);
+
+ if (target->primary == "PROGRAMS")
+ {
+ DomUtil::writeEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/runarguments/" + target->name, run_arguments_edit->text());
+ DomUtil::writeEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/debugarguments/" + target->name, debug_arguments_edit->text());
+ DomUtil::writeEntry(*m_widget->m_part->projectDom(), "/kdevautoproject/run/cwd/" + target->name, m_cwdEdit->url());
+ }
+}
+
+
+void TargetOptionsDialog::insideMoveUpClicked()
+{
+ if (!insidelib_listview->currentItem())
+ return;
+ if (insidelib_listview->currentItem() == insidelib_listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = insidelib_listview->firstChild();
+ while (item->nextSibling() != insidelib_listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(insidelib_listview->currentItem());
+}
+
+
+void TargetOptionsDialog::insideMoveDownClicked()
+{
+ if (!insidelib_listview->currentItem())
+ return;
+
+ if (insidelib_listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ insidelib_listview->currentItem()->moveItem(insidelib_listview->currentItem()->nextSibling());
+}
+
+
+void TargetOptionsDialog::outsideMoveUpClicked()
+{
+ if (!outsidelib_listview->currentItem())
+ return;
+ if (outsidelib_listview->currentItem() == outsidelib_listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = outsidelib_listview->firstChild();
+ while (item->nextSibling() != outsidelib_listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(outsidelib_listview->currentItem());
+}
+
+
+void TargetOptionsDialog::outsideMoveDownClicked()
+{
+ if (!outsidelib_listview->currentItem())
+ return;
+ if (outsidelib_listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ outsidelib_listview->currentItem()->moveItem(outsidelib_listview->currentItem()->nextSibling());
+}
+
+
+void TargetOptionsDialog::outsideAddClicked()
+{
+ KURLRequesterDlg dialog( "", i18n( "Add Library: Choose the .a/.so file, give -l<libname> or use a variable with $(FOOBAR)" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ dialog.urlRequester() ->setFilter( "*.so|"+i18n("Shared Library (*.so)")+"\n*.a|"+i18n("Static Library (*.a)") );
+ dialog.urlRequester() ->setURL( QString::null );
+ dialog.urlRequester() ->completionObject() ->setDir( m_widget->selectedSubproject()->path );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL::fromPathOrURL( m_widget->selectedSubproject()->path ) );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString file = dialog.urlRequester() ->url();
+ if ( !file.isEmpty() )
+ {
+ if ( !file.isEmpty() )
+ {
+ if( file.startsWith("-l") )
+ new QListViewItem( outsidelib_listview, file );
+ else
+ {
+ QFileInfo fi(file);
+ if( !fi.exists() )
+ new QListViewItem( outsidelib_listview, file );
+ if( fi.extension(false) == "a" )
+ {
+ new QListViewItem( outsidelib_listview, file );
+ }else if ( fi.extension(false) == "so" )
+ {
+ QString name = fi.fileName();
+ if( name.startsWith( "lib" ) )
+ name = name.mid(3);
+ name = "-l"+name.left( name.length() - 3 );
+ new QListViewItem( outsidelib_listview, name );
+ }
+ }
+ }
+ }
+}
+
+
+void TargetOptionsDialog::outsideEditClicked()
+{
+ if ( (outsidelib_listview->childCount()==0) || (outsidelib_listview->currentItem() == 0) )
+ return;
+ bool ok;
+ QString dir = KInputDialog::getText(i18n("Edit External Library"), i18n("Edit external library:"),
+ outsidelib_listview->currentItem()-> text(0), &ok, 0);
+ if (ok && !dir.isEmpty())
+ outsidelib_listview->currentItem()-> setText(0, dir);
+}
+
+
+void TargetOptionsDialog::outsideRemoveClicked()
+{
+ delete outsidelib_listview->currentItem();
+}
+
+
+void TargetOptionsDialog::accept()
+{
+ storeConfig();
+ QDialog::accept();
+}
+
+#include "targetoptionsdlg.moc"
+// kate: indent-mode csands; space-indent on; indent-width 4; replace-tabs on;
diff --git a/buildtools/autotools/targetoptionsdlg.h b/buildtools/autotools/targetoptionsdlg.h
new file mode 100644
index 00000000..c1dea20a
--- /dev/null
+++ b/buildtools/autotools/targetoptionsdlg.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _TARGETOPTIONSDLG_
+#define _TARGETOPTIONSDLG_
+
+#include "targetoptionsdlgbase.h"
+
+class AutoProjectWidget;
+class TargetItem;
+
+
+class TargetOptionsDialog : public TargetOptionsDialogBase
+{
+ Q_OBJECT
+
+public:
+ TargetOptionsDialog( AutoProjectWidget *widget, TargetItem *item,
+ QWidget *parent = 0, const char *name = 0 );
+ ~TargetOptionsDialog();
+
+private:
+ virtual void insideMoveUpClicked();
+ virtual void insideMoveDownClicked();
+ virtual void outsideMoveUpClicked();
+ virtual void outsideMoveDownClicked();
+ virtual void outsideAddClicked();
+ virtual void outsideEditClicked();
+ virtual void outsideRemoveClicked();
+ virtual void accept();
+
+ void readConfig();
+ void storeConfig();
+
+ TargetItem *target;
+ AutoProjectWidget *m_widget;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/buildtools/autotools/targetoptionsdlgbase.ui b/buildtools/autotools/targetoptionsdlgbase.ui
new file mode 100644
index 00000000..07487ac2
--- /dev/null
+++ b/buildtools/autotools/targetoptionsdlgbase.ui
@@ -0,0 +1,726 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>TargetOptionsDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>target_options_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>627</width>
+ <height>474</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Target Options</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget5</cstring>
+ </property>
+ <attribute name="title">
+ <string>Fl&amp;ags</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Li&amp;nker flags (LDFLAGS):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>allstatic_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>allstatic_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do not link against shared libraries (-all-static)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>avoidversion_box</cstring>
+ </property>
+ <property name="text">
+ <string>Do not &amp;assign version numbers to libraries (-avoid-version)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>module_box</cstring>
+ </property>
+ <property name="text">
+ <string>Create a library that can &amp;be dynamically loaded (-module)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>noundefined_box</cstring>
+ </property>
+ <property name="text">
+ <string>Library does not depend on external symbols (-no-&amp;undefined)</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>ldflagsother_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>O&amp;ther:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ldflagsother_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>ldflagsother_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer2</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="KLineEdit" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>dependencies_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>dependencies_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>E&amp;xplicit dependencies (DEPENDENCIES):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>dependencies_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>Spacer3</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>
+ <spacer row="5" column="2">
+ <property name="name">
+ <cstring>Spacer4</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>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget6</cstring>
+ </property>
+ <attribute name="title">
+ <string>Li&amp;braries</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>insidelib_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Lin&amp;k convenience libraries inside project (LIBADD):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>insidelib_listview</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>7</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QListView" row="4" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>outsidelib_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>outsidelib_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Link libraries ou&amp;tside project (LIBADD):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>outsidelib_listview</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout9_3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>insidemoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>insidemovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>insidelib_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="1">
+ <property name="name">
+ <cstring>Layout10_4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer7</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideadd_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideedit_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsideremove_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsidemoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Mo&amp;ve Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>outsidemovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Dow&amp;n</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8</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>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>arguments_page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Ar&amp;guments</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>argumentBox</cstring>
+ </property>
+ <property name="title">
+ <string>Program Arguments (only valid for executable targets)</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>run_arguments_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>arguments_label_1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Run arguments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>run_arguments_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="3" column="1">
+ <property name="name">
+ <cstring>m_cwdEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Working Directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>arguments_label_2</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>&amp;Debug arguments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>run_arguments_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>debug_arguments_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>120</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer10</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>okbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>insidemoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>insideMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsidemoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>outsideMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsidemovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>outsideMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideadd_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>outsideAddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideedit_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>outsideEditClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideremove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>outsideRemoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insidemovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>target_options_dialog</receiver>
+ <slot>insideMoveDownClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>allstatic_box</tabstop>
+ <tabstop>avoidversion_box</tabstop>
+ <tabstop>module_box</tabstop>
+ <tabstop>noundefined_box</tabstop>
+ <tabstop>ldflagsother_edit</tabstop>
+ <tabstop>dependencies_edit</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>insidelib_listview</tabstop>
+ <tabstop>insidemoveup_button</tabstop>
+ <tabstop>insidemovedown_button</tabstop>
+ <tabstop>outsidelib_listview</tabstop>
+ <tabstop>outsideadd_button</tabstop>
+ <tabstop>outsideedit_button</tabstop>
+ <tabstop>outsideremove_button</tabstop>
+ <tabstop>outsidemoveup_button</tabstop>
+ <tabstop>outsidemovedown_button</tabstop>
+ <tabstop>okbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">insideMoveDownClicked()</slot>
+ <slot access="protected">insideMoveUpClicked()</slot>
+ <slot access="protected">outsideAddClicked()</slot>
+ <slot access="protected">outsideEditClicked()</slot>
+ <slot access="protected">outsideMoveDownClicked()</slot>
+ <slot access="protected">outsideMoveUpClicked()</slot>
+ <slot access="protected">outsideRemoveClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/custommakefiles/Makefile.am b/buildtools/custommakefiles/Makefile.am
new file mode 100644
index 00000000..fab92b8b
--- /dev/null
+++ b/buildtools/custommakefiles/Makefile.am
@@ -0,0 +1,26 @@
+# Here resides the custom project part.
+
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes) \
+ -I$(top_builddir)/buildtools/lib/widgets
+
+kde_module_LTLIBRARIES = libkdevcustomproject.la
+libkdevcustomproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevcustomproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la
+
+libkdevcustomproject_la_SOURCES = selectnewfilesdialog.cpp selectnewfilesdialogbase.ui \
+ custombuildoptionswidget.cpp custombuildoptionswidgetbase.ui custommakeconfigwidget.cpp \
+ custommakeconfigwidgetbase.ui custommanagerwidget.cpp custommanagerwidgetbase.ui \
+ customotherconfigwidget.cpp customotherconfigwidgetbase.ui customprojectpart.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevcustomproject.desktop
+
+rcdir = $(kde_datadir)/kdevcustomproject
+rc_DATA = kdevcustomproject.rc
+noinst_HEADERS = selectnewfilesdialog.h custommanagerwidget.h \
+ customotherconfigwidget.h
diff --git a/buildtools/custommakefiles/README.dox b/buildtools/custommakefiles/README.dox
new file mode 100644
index 00000000..28762d87
--- /dev/null
+++ b/buildtools/custommakefiles/README.dox
@@ -0,0 +1,47 @@
+/** \class CustomProjectPart
+This is the custom build tools part.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\unmaintained This part is currently un-maintained
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=customproject&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">customproject component at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/buildtools/custommakefiles/custombuildoptionswidget.cpp b/buildtools/custommakefiles/custombuildoptionswidget.cpp
new file mode 100644
index 00000000..37b087b2
--- /dev/null
+++ b/buildtools/custommakefiles/custombuildoptionswidget.cpp
@@ -0,0 +1,99 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "custombuildoptionswidget.h"
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kfiledialog.h>
+#include <qradiobutton.h>
+#include <qtabwidget.h>
+#include "domutil.h"
+
+
+CustomBuildOptionsWidget::CustomBuildOptionsWidget(QDomDocument &dom,
+ QWidget *parent, const char *name)
+ : CustomBuildOptionsWidgetBase(parent, name),
+ m_dom(dom)
+{
+ ant_button->setChecked(DomUtil::readEntry(dom, "/kdevcustomproject/build/buildtool") == "ant");
+ other_button->setChecked(DomUtil::readEntry(dom, "/kdevcustomproject/build/buildtool") == "other");
+ if( !DomUtil::readEntry(dom, "/kdevcustomproject/build/builddir").isEmpty()
+ && QFileInfo( DomUtil::readEntry(dom, "/kdevcustomproject/build/builddir") ).exists() )
+ {
+ builddir_edit->setURL(DomUtil::readEntry(dom, "/kdevcustomproject/build/builddir"));
+ builddir_edit->fileDialog()->setURL( DomUtil::readEntry(dom, "/kdevcustomproject/build/builddir") );
+ }
+ else
+ {
+ builddir_edit->setURL( QString() );
+ builddir_edit->fileDialog()->setURL( QString() );
+ }
+ builddir_edit->completionObject()->setMode(KURLCompletion::DirCompletion);
+ builddir_edit->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ // This connection must not be made before the ant->setChecked() line,
+ // because at this time makeToggled() would crash
+ connect( make_button, SIGNAL(toggled(bool)),
+ this, SLOT(makeToggled(bool)) );
+ connect( other_button, SIGNAL(toggled(bool)),
+ this, SLOT(otherToggled(bool)) );
+}
+
+
+CustomBuildOptionsWidget::~CustomBuildOptionsWidget()
+{}
+
+
+void CustomBuildOptionsWidget::accept()
+{
+ QString buildtool;
+ if (ant_button->isChecked())
+ {
+ buildtool = "ant";
+ }
+ else if (other_button->isChecked())
+ {
+ buildtool = "other";
+ }
+ else
+ {
+ buildtool = "make";
+ }
+ DomUtil::writeEntry(m_dom, "/kdevcustomproject/build/buildtool", buildtool);
+ DomUtil::writeEntry(m_dom, "/kdevcustomproject/build/builddir", builddir_edit->url());
+}
+
+
+void CustomBuildOptionsWidget::setMakeOptionsWidget(QTabWidget *tw, QWidget *mow, QWidget* oow)
+{
+ m_tabWidget = tw;
+ m_makeOptions = mow;
+ m_otherOptions = oow;
+ makeToggled(make_button->isChecked());
+ otherToggled(other_button->isChecked());
+}
+
+void CustomBuildOptionsWidget::otherToggled(bool b)
+{
+ m_tabWidget->setTabEnabled(m_otherOptions, b);
+}
+
+void CustomBuildOptionsWidget::makeToggled(bool b)
+{
+ m_tabWidget->setTabEnabled(m_makeOptions, b);
+}
+
+#include "custombuildoptionswidget.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/custombuildoptionswidget.h b/buildtools/custommakefiles/custombuildoptionswidget.h
new file mode 100644
index 00000000..1b049574
--- /dev/null
+++ b/buildtools/custommakefiles/custombuildoptionswidget.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CUSTOMBUILDOPTIONSWIDGET_H_
+#define _CUSTOMBUILDOPTIONSWIDGET_H_
+
+#include "custombuildoptionswidgetbase.h"
+#include <qdom.h>
+
+class QTabWidget;
+
+
+class CustomBuildOptionsWidget : public CustomBuildOptionsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CustomBuildOptionsWidget( QDomDocument &dom, QWidget *parent=0, const char *name=0 );
+ ~CustomBuildOptionsWidget();
+
+ void setMakeOptionsWidget(QTabWidget *tw, QWidget *mow, QWidget *oow);
+
+public slots:
+ void accept();
+
+private:
+ virtual void makeToggled(bool b);
+ virtual void otherToggled(bool b);
+
+ QDomDocument &m_dom;
+ QTabWidget *m_tabWidget;
+ QWidget *m_makeOptions;
+ QWidget *m_otherOptions;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/custombuildoptionswidgetbase.ui b/buildtools/custommakefiles/custombuildoptionswidgetbase.ui
new file mode 100644
index 00000000..59ca9ba2
--- /dev/null
+++ b/buildtools/custommakefiles/custombuildoptionswidgetbase.ui
@@ -0,0 +1,164 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CustomBuildOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>configure_options_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>592</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Custom Build Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buildtool_group</cstring>
+ </property>
+ <property name="title">
+ <string>Build Tool</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>make_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Make</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>ant_button</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;nt</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>other_button</cstring>
+ </property>
+ <property name="text">
+ <string>Other</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>other custom build tool, e.g. script</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>There are myriads of buildtools out there that are not ant or make. If you use one of them (or have your own scripts), select this option.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer19</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>builddir_label</cstring>
+ </property>
+ <property name="text">
+ <string>Run &amp;the build tool in the following directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>builddir_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer38</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="KURLRequester">
+ <property name="name">
+ <cstring>builddir_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer39</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>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">makeToggled(bool)</slot>
+ <slot access="protected">otherToggled(bool)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/custommakefiles/custommakeconfigwidget.cpp b/buildtools/custommakefiles/custommakeconfigwidget.cpp
new file mode 100644
index 00000000..2af0d137
--- /dev/null
+++ b/buildtools/custommakefiles/custommakeconfigwidget.cpp
@@ -0,0 +1,134 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Hendrik Kueck *
+ * kueck@cs.ubc.ca *
+ * *
+ * 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 "custommakeconfigwidget.h"
+#include <custombuildoptionswidgetbase.h>
+#include <customprojectpart.h>
+#include <qcombobox.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qlistview.h>
+#include <qgroupbox.h>
+#include <qvalidator.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include <environmentvariableswidget.h>
+
+CustomMakeConfigWidget::CustomMakeConfigWidget(CustomProjectPart* part, const QString& configGroup, QWidget* parent)
+ : CustomMakeConfigWidgetBase(parent),
+ m_part(part), m_configGroup(configGroup), m_dom( *part->projectDom() )
+{
+ abort_box->setChecked(DomUtil::readBoolEntry(m_dom, m_configGroup + "/make/abortonerror"));
+ int numjobs = DomUtil::readIntEntry(m_dom, m_configGroup + "/make/numberofjobs");
+ jobs_box->setValue(numjobs);
+ runMultiJobs->setChecked( (numjobs > 0 ) );
+
+ prio_box->setValue(DomUtil::readIntEntry(m_dom, m_configGroup + "/make/prio"));
+ dontact_box->setChecked(DomUtil::readBoolEntry(m_dom, m_configGroup + "/make/dontact"));
+ makebin_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/make/makebin"));
+ defaultTarget_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/make/defaulttarget"));
+ makeoptions_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/make/makeoptions"));
+
+ envs_combo->setValidator(new QRegExpValidator(QRegExp("^\\D[^\\s]*"), this));
+ m_allEnvironments = m_part->allMakeEnvironments();
+ m_currentEnvironment = m_part->currentMakeEnvironment();
+ env_var_group->setColumnLayout( 1, Qt::Vertical );
+ m_envWidget = new EnvironmentVariablesWidget(m_dom, m_configGroup + "/make/environments/" + m_currentEnvironment, env_var_group);
+ envs_combo->insertStringList(m_allEnvironments);
+ envs_combo->setEditText(m_currentEnvironment);
+}
+
+
+CustomMakeConfigWidget::~CustomMakeConfigWidget()
+{
+
+}
+
+void CustomMakeConfigWidget::envNameChanged(const QString& envName)
+{
+ QStringList allEnvNames = m_part->allMakeEnvironments();
+ bool canAdd = !allEnvNames.contains(envName) && !envName.contains("/") && !envName.isEmpty();
+ bool canRemove = allEnvNames.contains(envName) && allEnvNames.count() > 1;
+ addenvs_button->setEnabled(canAdd);
+ copyenvs_button->setEnabled(canAdd);
+ removeenvs_button->setEnabled(canRemove);
+}
+
+void CustomMakeConfigWidget::envChanged(const QString& envName)
+{
+ if (envName == m_currentEnvironment || !m_allEnvironments.contains(envName))
+ return;
+
+ // save settings of previously active environment
+ if (!m_currentEnvironment.isNull() )
+ m_envWidget->accept();
+
+ m_currentEnvironment = envName;
+ m_envWidget->readEnvironment(m_dom, m_configGroup + "/make/environments/" + envName);
+ envs_combo->setEditText(envName);
+}
+
+void CustomMakeConfigWidget::envAdded()
+{
+ QString env = envs_combo->currentText();
+ m_allEnvironments.append(env);
+
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ envChanged(env);
+}
+
+void CustomMakeConfigWidget::envRemoved()
+{
+ QString env = envs_combo->currentText();
+ QDomNode node = DomUtil::elementByPath(m_dom, m_configGroup + "/make/environments");
+ node.removeChild(node.namedItem(env));
+ m_allEnvironments.remove(env);
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ m_currentEnvironment = QString::null;
+ envChanged( m_allEnvironments[0] );
+}
+
+void CustomMakeConfigWidget::envCopied()
+{
+ QString env = envs_combo->currentText();
+ m_allEnvironments.append(env);
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ m_currentEnvironment = env;
+ m_envWidget->changeConfigGroup(m_configGroup + "/make/environments/" + env);
+ envs_combo->setEditText(env);
+}
+
+void CustomMakeConfigWidget::accept()
+{
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/make/abortonerror", abort_box->isChecked());
+ if( runMultiJobs->isChecked() )
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/make/numberofjobs", jobs_box->value());
+ else
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/make/numberofjobs", 0);
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/make/prio", prio_box->value());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/make/dontact", dontact_box->isChecked());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/make/makebin", makebin_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/make/defaulttarget", defaultTarget_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/make/makeoptions", makeoptions_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/make/selectedenvironment", m_currentEnvironment);
+ m_envWidget->accept();
+}
+
+#include "custommakeconfigwidget.moc"
diff --git a/buildtools/custommakefiles/custommakeconfigwidget.h b/buildtools/custommakefiles/custommakeconfigwidget.h
new file mode 100644
index 00000000..ae8376c1
--- /dev/null
+++ b/buildtools/custommakefiles/custommakeconfigwidget.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Hendrik Kueck *
+ * kueck@cs.ubc.ca *
+ * *
+ * 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 CUSTOMMAKECONFIGWIDGET_H
+#define CUSTOMMAKECONFIGWIDGET_H
+
+#include "domutil.h"
+
+#include <custommakeconfigwidgetbase.h>
+
+class CustomProjectPart;
+class EnvironmentVariablesWidget;
+
+/**
+@author KDevelop Authors
+*/
+class CustomMakeConfigWidget : public CustomMakeConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CustomMakeConfigWidget(CustomProjectPart* part, const QString& configGroup, QWidget* parent);
+
+ ~CustomMakeConfigWidget();
+
+public slots:
+ void accept();
+
+protected:
+ CustomProjectPart* m_part;
+ QString m_configGroup;
+ QDomDocument& m_dom;
+
+ QStringList m_allEnvironments;
+ QString m_currentEnvironment;
+
+ EnvironmentVariablesWidget* m_envWidget;
+
+ virtual void envNameChanged(const QString& envName);
+ virtual void envChanged(const QString& envName);
+ virtual void envAdded();
+ virtual void envRemoved();
+ virtual void envCopied();
+
+};
+
+#endif
diff --git a/buildtools/custommakefiles/custommakeconfigwidgetbase.ui b/buildtools/custommakefiles/custommakeconfigwidgetbase.ui
new file mode 100644
index 00000000..b864a18f
--- /dev/null
+++ b/buildtools/custommakefiles/custommakeconfigwidgetbase.ui
@@ -0,0 +1,395 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CustomMakeConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CustomMakeConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>659</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Make Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>abort_box</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;bort on first error</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>dontact_box</cstring>
+ </property>
+ <property name="text">
+ <string>Only di&amp;splay commands without actually executing them</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>defaultTarget_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>makeoptions_label</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;dditional make options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>makeoptions_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>makeoptions_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>makebin_label</cstring>
+ </property>
+ <property name="text">
+ <string>Name of make e&amp;xecutable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>defTarget_label</cstring>
+ </property>
+ <property name="text">
+ <string>Default make &amp;target:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>defaultTarget_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>runMultiJobs</cstring>
+ </property>
+ <property name="text">
+ <string>Run multiple jobs</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>jobs_label</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Number of simultaneous &amp;jobs:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>jobs_box</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>jobs_box</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>30</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <spacer>
+ <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>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>prio_label</cstring>
+ </property>
+ <property name="text">
+ <string>Make &amp;priority:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>jobs_box</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>prio_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>19</number>
+ </property>
+ <property name="minValue">
+ <number>-20</number>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </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>192</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>envs_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>E&amp;nvironment:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>envs_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>envs_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>copyenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;py</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;move</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>env_var_group</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Environment &amp;Variables</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>envs_combo</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomMakeConfigWidgetBase</receiver>
+ <slot>envNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>envs_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomMakeConfigWidgetBase</receiver>
+ <slot>envChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>copyenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomMakeConfigWidgetBase</receiver>
+ <slot>envCopied()</slot>
+ </connection>
+ <connection>
+ <sender>addenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomMakeConfigWidgetBase</receiver>
+ <slot>envAdded()</slot>
+ </connection>
+ <connection>
+ <sender>removeenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomMakeConfigWidgetBase</receiver>
+ <slot>envRemoved()</slot>
+ </connection>
+ <connection>
+ <sender>runMultiJobs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>jobs_label</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>runMultiJobs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>jobs_box</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>abort_box</tabstop>
+ <tabstop>dontact_box</tabstop>
+ <tabstop>makebin_edit</tabstop>
+ <tabstop>makeoptions_edit</tabstop>
+ <tabstop>jobs_box</tabstop>
+ <tabstop>envs_combo</tabstop>
+ <tabstop>addenvs_button</tabstop>
+ <tabstop>copyenvs_button</tabstop>
+ <tabstop>removeenvs_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">envNameChanged(const QString &amp;)</slot>
+ <slot access="protected">envChanged(const QString&amp;)</slot>
+ <slot access="protected">envAdded()</slot>
+ <slot access="protected">envRemoved()</slot>
+ <slot access="protected">envCopied()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/custommakefiles/custommanagerwidget.cpp b/buildtools/custommakefiles/custommanagerwidget.cpp
new file mode 100644
index 00000000..9001480e
--- /dev/null
+++ b/buildtools/custommakefiles/custommanagerwidget.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 "custommanagerwidget.h"
+
+#include <qstringlist.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qwhatsthis.h>
+#include <qtooltip.h>
+
+#include <ktextedit.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kfiledialog.h>
+#include <keditlistbox.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include "customprojectpart.h"
+#include "domutil.h"
+
+CustomManagerWidget::CustomManagerWidget( CustomProjectPart* part, QWidget* parent )
+ : CustomManagerWidgetBase( parent ), m_part( part), m_dom( *part->projectDom() )
+{
+ m_filetypes->insertStringList( DomUtil::readListEntry( m_dom, "kdevcustomproject/filetypes", "filetype" ) );
+ KURLRequester* urlselector = new KURLRequester( );
+ urlselector->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ urlselector->setURL( QString::null );
+ urlselector->completionObject() ->setDir( part->projectDirectory() );
+ urlselector->fileDialog() ->setURL( KURL( part->projectDirectory() ) );
+ m_blacklistBox = new KEditListBox( i18n("blacklisted files and directories are not"
+ " considered part of the project, even if they fit one of "
+ "the wildcard patterns in the project file list",
+ "Blacklisted files/dirs"), urlselector->customEditor(), this);
+ m_blacklistBox->setButtons( KEditListBox::Add | KEditListBox::Remove );
+ m_blacklistBox->insertStringList( DomUtil::readListEntry( m_dom, "kdevcustomproject/blacklist","path") );
+ grid->addWidget( m_blacklistBox, 0, 1 );
+ connect(m_blacklistBox, SIGNAL(added(const QString&)), this, SLOT(checkUrl(const QString&)));
+}
+
+void CustomManagerWidget::checkUrl(const QString& url)
+{
+ kdDebug(9025) << "got file:" << url << endl;
+ if( !QFileInfo(url).isRelative() )
+ {
+ kdDebug(9025) << "seems to be non-relative" << endl;
+ QString relpath = m_part->relativeToProject( url );
+ QListBoxItem* item = m_blacklistBox->listBox()->findItem( url );
+ m_blacklistBox->listBox()->takeItem( item );
+ kdDebug(9025) << "relative path:" << relpath << endl;
+ if( !relpath.isEmpty() )
+ m_blacklistBox->insertItem( relpath );
+ }
+}
+
+CustomManagerWidget::~CustomManagerWidget()
+{
+}
+
+void CustomManagerWidget::accept()
+{
+ DomUtil::writeListEntry( m_dom, "kdevcustomproject/filetypes", "filetype",
+ m_filetypes->items() );
+ DomUtil::writeListEntry( m_dom, "kdevcustomproject/blacklist", "path",
+ m_blacklistBox->items() );
+}
+
+
+#include "custommanagerwidget.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/custommanagerwidget.h b/buildtools/custommakefiles/custommanagerwidget.h
new file mode 100644
index 00000000..4f15f156
--- /dev/null
+++ b/buildtools/custommakefiles/custommanagerwidget.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 CUSTOMMANAGERWIDGET_H
+#define CUSTOMMANAGERWIDGET_H
+
+#include "custommanagerwidgetbase.h"
+
+
+#include <qdom.h>
+
+class CustomProjectPart;
+class KEditListBox;
+
+class CustomManagerWidget : public CustomManagerWidgetBase
+{
+Q_OBJECT
+
+public:
+ CustomManagerWidget( CustomProjectPart* part, QWidget* parent );
+ ~CustomManagerWidget();
+public slots:
+ void checkUrl(const QString& url);
+ void accept();
+private:
+ CustomProjectPart* m_part;
+ QDomDocument& m_dom;
+ KEditListBox* m_blacklistBox;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/custommanagerwidgetbase.ui b/buildtools/custommakefiles/custommanagerwidgetbase.ui
new file mode 100644
index 00000000..a388b288
--- /dev/null
+++ b/buildtools/custommakefiles/custommanagerwidgetbase.ui
@@ -0,0 +1,74 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CustomManagerWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CustomManagerWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>467</width>
+ <height>393</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Custom Manager Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>grid</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KEditListBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_filetypes</cstring>
+ </property>
+ <property name="title">
+ <string>Filetypes used in Project</string>
+ </property>
+ <property name="buttons">
+ <set>Remove|Add</set>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add filetypes to be used in Projects, can be full filenames or shell wildcards</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Each entry contains a filetype used in the project in the form of a filename or a filename wildcard (using shell wildcards).
+This will be used when adding/removing files in directories and re-populating the project</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <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>108</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/custommakefiles/customotherconfigwidget.cpp b/buildtools/custommakefiles/customotherconfigwidget.cpp
new file mode 100644
index 00000000..47fe4b4d
--- /dev/null
+++ b/buildtools/custommakefiles/customotherconfigwidget.cpp
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Achim Herwig *
+ * achim.herwig@wodca.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 "customotherconfigwidget.h"
+#include <custombuildoptionswidgetbase.h>
+#include <customprojectpart.h>
+#include <qcombobox.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qlistview.h>
+#include <qgroupbox.h>
+#include <qvalidator.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include <environmentvariableswidget.h>
+
+CustomOtherConfigWidget::CustomOtherConfigWidget(CustomProjectPart* part, const QString& configGroup, QWidget* parent)
+ : CustomOtherConfigWidgetBase(parent),
+ m_part(part), m_configGroup(configGroup), m_dom( *part->projectDom() )
+{
+ prio_box->setValue(DomUtil::readIntEntry(m_dom, m_configGroup + "/other/prio"));
+ makebin_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/other/otherbin"));
+ defaultTarget_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/other/defaulttarget"));
+ makeoptions_edit->setText(DomUtil::readEntry(m_dom, m_configGroup + "/other/otheroptions"));
+
+ envs_combo->setValidator(new QRegExpValidator(QRegExp("^\\D.*"), this));
+ m_allEnvironments = m_part->allMakeEnvironments();
+ m_currentEnvironment = m_part->currentMakeEnvironment();
+ env_var_group->setColumnLayout( 1, Qt::Vertical );
+ m_envWidget = new EnvironmentVariablesWidget(m_dom, m_configGroup + "/other/environments/" + m_currentEnvironment, env_var_group);
+ envs_combo->insertStringList(m_allEnvironments);
+ envs_combo->setEditText(m_currentEnvironment);
+}
+
+
+CustomOtherConfigWidget::~CustomOtherConfigWidget()
+{
+
+}
+
+void CustomOtherConfigWidget::envNameChanged(const QString& envName)
+{
+ QStringList allEnvNames = m_part->allMakeEnvironments();
+ bool canAdd = !allEnvNames.contains(envName) && !envName.contains("/") && !envName.isEmpty();
+ bool canRemove = allEnvNames.contains(envName) && allEnvNames.count() > 1;
+ addenvs_button->setEnabled(canAdd);
+ copyenvs_button->setEnabled(canAdd);
+ removeenvs_button->setEnabled(canRemove);
+}
+
+void CustomOtherConfigWidget::envChanged(const QString& envName)
+{
+ if (envName == m_currentEnvironment || !m_allEnvironments.contains(envName))
+ return;
+
+ // save settings of previously active environment
+ if (!m_currentEnvironment.isNull() )
+ m_envWidget->accept();
+
+ m_currentEnvironment = envName;
+ m_envWidget->readEnvironment(m_dom, m_configGroup + "/other/environments/" + envName);
+ envs_combo->setEditText(envName);
+}
+
+void CustomOtherConfigWidget::envAdded()
+{
+ QString env = envs_combo->currentText();
+ m_allEnvironments.append(env);
+
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ envChanged(env);
+}
+
+void CustomOtherConfigWidget::envRemoved()
+{
+ QString env = envs_combo->currentText();
+ QDomNode node = DomUtil::elementByPath(m_dom, m_configGroup + "/other/environments");
+ node.removeChild(node.namedItem(env));
+ m_allEnvironments.remove(env);
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ m_currentEnvironment = QString::null;
+ envChanged( m_allEnvironments[0] );
+}
+
+void CustomOtherConfigWidget::envCopied()
+{
+ QString env = envs_combo->currentText();
+ m_allEnvironments.append(env);
+ envs_combo->clear();
+ envs_combo->insertStringList(m_allEnvironments);
+ m_currentEnvironment = env;
+ m_envWidget->changeConfigGroup(m_configGroup + "/other/environments/" + env);
+ envs_combo->setEditText(env);
+}
+
+void CustomOtherConfigWidget::accept()
+{
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/other/prio", prio_box->value());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/other/otherbin", makebin_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/other/defaulttarget", defaultTarget_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/other/otheroptions", makeoptions_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/other/selectedenvironment", m_currentEnvironment);
+ m_envWidget->accept();
+}
+
+#include "customotherconfigwidget.moc"
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/custommakefiles/customotherconfigwidget.h b/buildtools/custommakefiles/customotherconfigwidget.h
new file mode 100644
index 00000000..755df98b
--- /dev/null
+++ b/buildtools/custommakefiles/customotherconfigwidget.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Achim Herwig *
+ * achim.herwig@wodca.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 CUSTOMOTHERCONFIGWIDGET_H
+#define CUSTOMOTHERCONFIGWIDGET_H
+
+#include "domutil.h"
+
+#include <customotherconfigwidgetbase.h>
+
+class CustomProjectPart;
+class EnvironmentVariablesWidget;
+
+/**
+@author KDevelop Authors
+*/
+class CustomOtherConfigWidget : public CustomOtherConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CustomOtherConfigWidget(CustomProjectPart* part, const QString& configGroup, QWidget* parent);
+
+ ~CustomOtherConfigWidget();
+
+public slots:
+ void accept();
+
+protected:
+ CustomProjectPart* m_part;
+ QString m_configGroup;
+ QDomDocument& m_dom;
+
+ QStringList m_allEnvironments;
+ QString m_currentEnvironment;
+
+ EnvironmentVariablesWidget* m_envWidget;
+
+ virtual void envNameChanged(const QString& envName);
+ virtual void envChanged(const QString& envName);
+ virtual void envAdded();
+ virtual void envRemoved();
+ virtual void envCopied();
+
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/custommakefiles/customotherconfigwidgetbase.ui b/buildtools/custommakefiles/customotherconfigwidgetbase.ui
new file mode 100644
index 00000000..174391ae
--- /dev/null
+++ b/buildtools/custommakefiles/customotherconfigwidgetbase.ui
@@ -0,0 +1,288 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CustomOtherConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CustomOtherConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>659</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Make Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>defaultTarget_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>makeoptions_label</cstring>
+ </property>
+ <property name="text">
+ <string>Add&amp;itional options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>makeoptions_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>makeoptions_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>makebin_label</cstring>
+ </property>
+ <property name="text">
+ <string>Name of build &amp;script</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>defTarget_label</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;target:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>defaultTarget_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </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>prio_label</cstring>
+ </property>
+ <property name="text">
+ <string>Run with priority:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>jobs_box</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>prio_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>19</number>
+ </property>
+ <property name="minValue">
+ <number>-20</number>
+ </property>
+ <property name="value">
+ <number>0</number>
+ </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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>envs_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>E&amp;nvironment:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>envs_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>envs_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>copyenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Copy</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeenvs_button</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;move</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>env_var_group</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Environment &amp;Variables</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>envs_combo</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomOtherConfigWidgetBase</receiver>
+ <slot>envNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>envs_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomOtherConfigWidgetBase</receiver>
+ <slot>envChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>copyenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomOtherConfigWidgetBase</receiver>
+ <slot>envCopied()</slot>
+ </connection>
+ <connection>
+ <sender>addenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomOtherConfigWidgetBase</receiver>
+ <slot>envAdded()</slot>
+ </connection>
+ <connection>
+ <sender>removeenvs_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomOtherConfigWidgetBase</receiver>
+ <slot>envRemoved()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>makebin_edit</tabstop>
+ <tabstop>makeoptions_edit</tabstop>
+ <tabstop>envs_combo</tabstop>
+ <tabstop>addenvs_button</tabstop>
+ <tabstop>copyenvs_button</tabstop>
+ <tabstop>removeenvs_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">envNameChanged(const QString &amp;)</slot>
+ <slot access="protected">envChanged(const QString&amp;)</slot>
+ <slot access="protected">envAdded()</slot>
+ <slot access="protected">envRemoved()</slot>
+ <slot access="protected">envCopied()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/custommakefiles/customprojectpart.cpp b/buildtools/custommakefiles/customprojectpart.cpp
new file mode 100644
index 00000000..f061dadc
--- /dev/null
+++ b/buildtools/custommakefiles/customprojectpart.cpp
@@ -0,0 +1,1669 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 "customprojectpart.h"
+
+#include <qapplication.h>
+#include <kapplication.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include <qvaluestack.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <qdom.h>
+
+#include <kaction.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <keditlistbox.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kmessagebox.h>
+#include <kparts/part.h>
+#include <kpopupmenu.h>
+#include <kdeversion.h>
+#include <kprocess.h>
+
+#include "domutil.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevmakefrontend.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "runoptionswidget.h"
+#include "makeoptionswidget.h"
+#include "custombuildoptionswidget.h"
+#include "custommakeconfigwidget.h"
+#include "customotherconfigwidget.h"
+#include "custommanagerwidget.h"
+#include "config.h"
+#include "envvartools.h"
+#include "urlutil.h"
+
+#include "selectnewfilesdialog.h"
+
+#include <kdevplugininfo.h>
+
+typedef KDevGenericFactory<CustomProjectPart> CustomProjectFactory;
+static const KDevPluginInfo data( "kdevcustomproject" );
+K_EXPORT_COMPONENT_FACTORY( libkdevcustomproject, CustomProjectFactory( data ) )
+
+CustomProjectPart::CustomProjectPart( QObject *parent, const char *name, const QStringList & )
+ : KDevBuildTool( &data, parent, name ? name : "CustomProjectPart" )
+ , m_lastCompilationFailed( false ), m_recursive( false ), m_first_recursive( false )
+{
+ setInstance( CustomProjectFactory::instance() );
+ setXMLFile( "kdevcustomproject.rc" );
+
+ m_executeAfterBuild = false;
+
+ KAction *action;
+
+ action = new KAction( i18n( "Re-Populate Project" ), 0, this, SLOT( populateProject() ), actionCollection(), "repopulate_project" );
+ action->setToolTip( i18n( "Re-Populate Project" ) );
+ action->setWhatsThis( i18n( "<b>Re-Populate Project</b><p>Re-Populates the project, searching through the project directory and adding all files that match one of the wildcards set in the custom manager options of the project filelist." ) );
+
+ action = new KAction( i18n( "&Build Project" ), "make_kdevelop", Key_F8,
+ this, SLOT( slotBuild() ),
+ actionCollection(), "build_build" );
+ action->setToolTip( i18n( "Build project" ) );
+ action->setWhatsThis( i18n( "<b>Build project</b><p>Runs <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Build Options</b> tab." ) );
+
+ action = new KAction( i18n( "&Build Active Directory" ), "make_kdevelop", Key_F7,
+ this, SLOT( slotBuildActiveDir() ),
+ actionCollection(), "build_buildactivetarget" );
+ action->setToolTip( i18n( "Build active directory" ) );
+ action->setWhatsThis( i18n( "<b>Build active directory</b><p>Constructs a series of make commands to build the active directory. "
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ action = new KAction( i18n( "Compile &File" ), "make_kdevelop",
+ this, SLOT( slotCompileFile() ),
+ actionCollection(), "build_compilefile" );
+ action->setToolTip( i18n( "Compile file" ) );
+ action->setWhatsThis( i18n( "<b>Compile file</b><p>Runs <b>make filename.o</b> command from the directory where 'filename' is the name of currently opened file.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Build Options</b> tab." ) );
+
+ action = new KAction( i18n( "Install" ), 0,
+ this, SLOT( slotInstall() ),
+ actionCollection(), "build_install" );
+ action->setToolTip( i18n( "Install" ) );
+ action->setWhatsThis( i18n( "<b>Install</b><p>Runs <b>make install</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ action = new KAction( i18n( "Install Active Directory" ), 0,
+ this, SLOT( slotInstallActiveDir() ),
+ actionCollection(), "build_installactivetarget" );
+ action->setToolTip( i18n( "Install active directory" ) );
+ action->setWhatsThis( i18n( "<b>Install active directory</b><p>Runs <b>make install</b> command from the active directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ action = new KAction( i18n( "Install (as root user)" ), 0,
+ this, SLOT( slotInstallWithKdesu() ),
+ actionCollection(), "build_install_kdesu" );
+ action->setToolTip( i18n( "Install as root user" ) );
+ action->setWhatsThis( i18n( "<b>Install</b><p>Runs <b>make install</b> command from the project directory with root privileges.<br>"
+ "It is executed via kdesu command.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ action = new KAction( i18n( "&Clean Project" ), 0,
+ this, SLOT( slotClean() ),
+ actionCollection(), "build_clean" );
+ action->setToolTip( i18n( "Clean project" ) );
+ action->setWhatsThis( i18n( "<b>Clean project</b><p>Runs <b>make clean</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Build Options</b> tab." ) );
+
+ action = new KAction( i18n( "Execute Program" ), "exec", 0,
+ this, SLOT( slotExecute() ),
+ actionCollection(), "build_execute" );
+ action->setToolTip( i18n( "Execute program" ) );
+ action->setWhatsThis( i18n( "<b>Execute program</b><p>Executes the main program specified in project settings, <b>Run Options</b> tab. "
+ "If it is not specified then the active target is used to determine the application to run." ) );
+
+ KActionMenu *menu = new KActionMenu( i18n( "Build &Target" ),
+ actionCollection(), "build_target" );
+ m_targetMenu = menu->popupMenu();
+ menu->setToolTip( i18n( "Build target" ) );
+ menu->setWhatsThis( i18n( "<b>Build target</b><p>Runs <b>make targetname</b> from the project directory (targetname is the name of the target selected).<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Build Options</b> tab." ) );
+
+ m_targetObjectFilesMenu = new QPopupMenu();
+ m_targetOtherFilesMenu = new QPopupMenu();
+
+ m_makeEnvironmentsSelector = new KSelectAction( i18n( "Make &Environment" ), 0,
+ actionCollection(), "build_make_environment" );
+ m_makeEnvironmentsSelector->setToolTip( i18n( "Make environment" ) );
+ m_makeEnvironmentsSelector->setWhatsThis( i18n( "<b>Make Environment</b><p> Choose the set of environment variables to be passed on to make.<br>"
+ "Environment variables can be specified in the project "
+ "settings dialog, <b>Build Options</b> tab." ) );
+
+ connect( m_targetMenu, SIGNAL( aboutToShow() ),
+ this, SLOT( updateTargetMenu() ) );
+ connect( m_targetMenu, SIGNAL( activated( int ) ),
+ this, SLOT( targetMenuActivated( int ) ) );
+ connect( m_targetObjectFilesMenu, SIGNAL( activated( int ) ),
+ this, SLOT( targetObjectFilesMenuActivated( int ) ) );
+ connect( m_targetOtherFilesMenu, SIGNAL( activated( int ) ),
+ this, SLOT( targetOtherFilesMenuActivated( int ) ) );
+ connect( m_makeEnvironmentsSelector->popupMenu(), SIGNAL( aboutToShow() ),
+ this, SLOT( updateMakeEnvironmentsMenu() ) );
+ connect( m_makeEnvironmentsSelector->popupMenu(), SIGNAL( activated( int ) ),
+ this, SLOT( makeEnvironmentsMenuActivated( int ) ) );
+ connect( core(), SIGNAL( projectConfigWidget( KDialogBase* ) ),
+ this, SLOT( projectConfigWidget( KDialogBase* ) ) );
+ connect( core(), SIGNAL( contextMenu( QPopupMenu *, const Context * ) ),
+ this, SLOT( contextMenu( QPopupMenu *, const Context * ) ) );
+
+ connect( makeFrontend(), SIGNAL( commandFinished( const QString& ) ),
+ this, SLOT( slotCommandFinished( const QString& ) ) );
+ connect( makeFrontend(), SIGNAL( commandFailed( const QString& ) ),
+ this, SLOT( slotCommandFailed( const QString& ) ) );
+}
+
+
+CustomProjectPart::~CustomProjectPart()
+{}
+
+
+void CustomProjectPart::projectConfigWidget( KDialogBase *dlg )
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage( i18n( "Custom Manager" ), i18n( "Custom Manager" ), BarIcon( "make", KIcon::SizeMedium ) );
+ CustomManagerWidget *w0 = new CustomManagerWidget( this, vbox );
+ connect( dlg, SIGNAL( okClicked() ), w0, SLOT( accept() ) );
+
+ vbox = dlg->addVBoxPage( i18n( "Run Options" ), i18n( "Run Options" ), BarIcon( "make", KIcon::SizeMedium ) );
+ RunOptionsWidget *w1 = new RunOptionsWidget( *projectDom(), "/kdevcustomproject", buildDirectory(), vbox );
+ connect( dlg, SIGNAL( okClicked() ), w1, SLOT( accept() ) );
+ vbox = dlg->addVBoxPage( i18n( "Build Options" ), i18n( "Build Options" ), BarIcon( "make", KIcon::SizeMedium ) );
+ QTabWidget *buildtab = new QTabWidget( vbox );
+
+ CustomBuildOptionsWidget *w2 = new CustomBuildOptionsWidget( *projectDom(), buildtab );
+ connect( dlg, SIGNAL( okClicked() ), w2, SLOT( accept() ) );
+ buildtab->addTab( w2, i18n( "&Build" ) );
+
+ CustomOtherConfigWidget *w4 = new CustomOtherConfigWidget( this, "/kdevcustomproject", buildtab );
+ connect( dlg, SIGNAL( okClicked() ), w4, SLOT( accept() ) );
+ buildtab->addTab( w4, i18n( "&Other" ) );
+
+ CustomMakeConfigWidget *w3 = new CustomMakeConfigWidget( this, "/kdevcustomproject", buildtab );
+ buildtab->addTab( w3, i18n( "Ma&ke" ) );
+ w2->setMakeOptionsWidget( buildtab, w3, w4 );
+ connect( dlg, SIGNAL( okClicked() ), w3, SLOT( accept() ) );
+
+}
+
+
+void CustomProjectPart::contextMenu( QPopupMenu *popup, const Context *context )
+{
+ if ( !context->hasType( Context::FileContext ) )
+ return;
+
+ const FileContext *fcontext = static_cast<const FileContext*>( context );
+
+ m_contextAddFiles.clear();
+ m_contextRemoveFiles.clear();
+
+ QString popupstr = fcontext->urls().first().fileName();
+
+ if ( popupstr == QString::null )
+ popupstr = ".";
+
+ if ( fcontext->urls().size() == 1 && URLUtil::isDirectory( fcontext->urls().first() ) && !isInBlacklist( fcontext->urls().first().path() ) )
+ {
+ popup->insertSeparator();
+ // remember the name of the directory
+ m_contextDirName = fcontext->urls().first().path();
+ m_contextDirName = m_contextDirName.mid( project()->projectDirectory().length() + 1 );
+ int id = popup->insertItem( i18n( "Make Active Directory" ),
+ this, SLOT( slotChooseActiveDirectory() ) );
+ popup->setWhatsThis( id, i18n( "<b>Make active directory</b><p>"
+ "Chooses this directory as the destination for new files created using wizards "
+ "like the <i>New Class</i> wizard." ) );
+ }
+
+ kdDebug( 9025 ) << "context urls: " << fcontext->urls() << endl;
+ if ( fcontext->urls().size() == 1 && ( isProjectFileType( fcontext->urls().first().path() ) || URLUtil::isDirectory( fcontext->urls().first() ) ) )
+ {
+ popup->insertSeparator();
+ m_contextDirName = fcontext->urls().first().path();
+ m_contextDirName = m_contextDirName.mid( project()->projectDirectory().length() + 1 );
+ int id;
+ if ( isInBlacklist( m_contextDirName ) )
+ {
+ id = popup->insertItem( i18n( "Remove from blacklist" ),
+ this, SLOT( slotChangeBlacklist() ) );
+ popup->setWhatsThis( id, i18n( "<b>Remove from blacklist</b><p>"
+ "Removes the given file or directory from the "
+ "blacklist if it is already in it.<br>The blacklist contains files and"
+ " directories that should be ignored even if they match a project filetype "
+ "pattern" ) );
+ }
+ else
+ {
+ id = popup->insertItem( i18n( "Add to blacklist" ),
+ this, SLOT( slotChangeBlacklist() ) );
+ popup->setWhatsThis( id, i18n( "<b>Add to blacklist</b><p>"
+ "Adds the given file or directory to the blacklist.<br>The blacklist contains files and"
+ " directories that should be ignored even if they match a project filetype "
+ "pattern" ) );
+ }
+ }
+
+ const KURL::List urls = fcontext->urls();
+
+ bool dirAddRecursive = false;
+ bool dirDelRecursive = false;
+
+ for ( KURL::List::ConstIterator it = urls.begin(); it != urls.end(); ++it )
+ {
+ kdDebug( 9025 ) << "Checking URL: " << *it << endl;
+ QString canPath( URLUtil::canonicalPath(( *it ).path() ) );
+ QString relPath = relativeToProject( canPath );
+ kdDebug( 9025 ) << "relpath: " << relPath << "|canpath: " << canPath << endl;
+ if ( isInBlacklist( relPath ) )
+ continue;
+ if ((( *it ).isLocalFile() && isProjectFileType(( *it ).fileName() ) ) )
+ {
+ if ( project()->isProjectFile( canPath ) )
+ m_contextRemoveFiles << relPath;
+ if ( !project()->isProjectFile( canPath ) )
+ m_contextAddFiles << relPath;
+ }
+ if ( QFileInfo(( *it ).path() ).isDir() )
+ {
+ if ( containsProjectFiles( canPath ) || project()->isProjectFile( canPath ) )
+ {
+ if ( containsProjectFiles( canPath ) )
+ dirDelRecursive = true;
+ m_contextRemoveFiles << relPath;
+ }
+ if ( containsNonProjectFiles( canPath ) || !project()->isProjectFile( canPath ) )
+ {
+ if ( containsNonProjectFiles( canPath ) )
+ dirAddRecursive = true;
+ m_contextAddFiles << relPath;
+ }
+ }
+ }
+
+ if ( m_contextAddFiles.size() > 0 || m_contextRemoveFiles.size() > 0 )
+ popup->insertSeparator();
+ if ( m_contextAddFiles.size() > 0 )
+ {
+ int id = popup->insertItem( i18n( "Add Selected File/Dir(s) to Project" ),
+ this, SLOT( slotAddToProject() ) );
+ popup->setWhatsThis( id, i18n( "<b>Add to project</b><p>Adds selected file/dir(s) to the list of files in the project. "
+ "Note that the files should be manually added to the corresponding makefile or build.xml." ) );
+ if ( dirAddRecursive )
+ {
+ int id = popup->insertItem( i18n( "Add Selected Dir(s) to Project (recursive)" ),
+ this, SLOT( slotAddToProjectRecursive() ) );
+ popup->setWhatsThis( id, i18n( "<b>Add to project</b><p>Recursively adds selected dir(s) to the list of files in the project. "
+ "Note that the files should be manually added to the corresponding makefile or build.xml." ) );
+ }
+ }
+
+ if ( m_contextRemoveFiles.size() > 0 )
+ {
+ int id = popup->insertItem( i18n( "Remove Selected File/Dir(s) From Project" ),
+ this, SLOT( slotRemoveFromProject() ) );
+ popup->setWhatsThis( id, i18n( "<b>Remove from project</b><p>Removes selected file/dir(s) from the list of files in the project. "
+ "Note that the files should be manually excluded from the corresponding makefile or build.xml." ) );
+
+ if ( dirDelRecursive )
+ {
+ int id = popup->insertItem( i18n( "Remove Selected Dir(s) From Project (recursive)" ),
+ this, SLOT( slotRemoveFromProjectRecursive() ) );
+ popup->setWhatsThis( id, i18n( "<b>Remove from project</b><p>Recursively removes selected dir(s) from the list of files in the project. "
+ "Note that the files should be manually excluded from the corresponding makefile or build.xml." ) );
+ }
+ }
+}
+
+
+void CustomProjectPart::slotAddToProject()
+{
+ m_recursive = false;
+ m_first_recursive = true;
+ addFiles( m_contextAddFiles );
+}
+
+
+void CustomProjectPart::slotRemoveFromProject()
+{
+ m_recursive = false;
+ m_first_recursive = true;
+ removeFiles( m_contextRemoveFiles );
+}
+
+
+void CustomProjectPart::slotAddToProjectRecursive()
+{
+ m_recursive = true;
+ addFiles( m_contextAddFiles );
+ m_recursive = false;
+}
+
+
+void CustomProjectPart::slotRemoveFromProjectRecursive()
+{
+ m_recursive = true;
+ removeFiles( m_contextRemoveFiles );
+ m_recursive = false;
+}
+
+void CustomProjectPart::slotChangeBlacklist()
+{
+ switchBlacklistEntry( m_contextDirName );
+}
+
+void CustomProjectPart::slotChooseActiveDirectory()
+{
+ QString olddir = activeDirectory();
+ QDomDocument &dom = *projectDom();
+ DomUtil::writeEntry( dom, "/kdevcustomproject/general/activedir", m_contextDirName );
+ emit activeDirectoryChanged( olddir, activeDirectory() );
+}
+
+
+void CustomProjectPart::openProject( const QString &dirName, const QString &projectName )
+{
+ m_projectDirectory = dirName;
+ m_projectName = projectName;
+
+ QDomDocument &dom = *projectDom();
+ // Set the default directory radio to "executable"
+ if ( DomUtil::readEntry( dom, "/kdevcustomproject/run/directoryradio" ) == "" )
+ {
+ DomUtil::writeEntry( dom, "/kdevcustomproject/run/directoryradio", "executable" );
+ }
+
+ if ( filetypes().isEmpty() )
+ {
+ QStringList types;
+ types << "*.java" << "*.h" << "*.H" << "*.hh" << "*.hxx" << "*.hpp" << "*.c" << "*.C"
+ << "*.cc" << "*.cpp" << "*.c++" << "*.cxx" << "Makefile" << "CMakeLists.txt";
+ DomUtil::writeListEntry( dom, "/kdevcustomproject/filetypes", "filetype", types );
+ }
+
+ /*this entry is currently only created by the cmake kdevelop3 project generator
+ in order to support completely-out-of-source builds, where nothing, not
+ even the kdevelop project files are created in the source directory, Alex <neundorf@kde.org>
+ */
+ m_filelistDir = DomUtil::readEntry( dom, "/kdevcustomproject/filelistdirectory" );
+ if ( m_filelistDir.isEmpty() )
+ m_filelistDir = dirName;
+
+ if ( QFileInfo( m_filelistDir + "/" + projectName.lower() +
+ ".kdevelop.filelist" ).exists() )
+ {
+ QDir( m_filelistDir ).rename(
+ projectName.lower() + ".kdevelop.filelist",
+ projectName + ".kdevelop.filelist" );
+ }
+
+ QFile f( m_filelistDir + "/" + projectName + ".kdevelop.filelist" );
+ if ( f.open( IO_ReadOnly ) )
+ {
+ QTextStream stream( &f );
+ while ( !stream.atEnd() )
+ {
+ QString s = stream.readLine();
+ // Skip comments.
+ if ( s.isEmpty() || s.startsWith( "#" ) )
+ continue;
+ // Skip non-existent files.
+ if ( ! QFileInfo( projectDirectory() + "/" + s ).exists() )
+ continue;
+ // Do not bother with files already in project or on blacklist.
+ if ( isInProject( s ) || isInBlacklist( s ) )
+ continue;
+ addToProject( s );
+ }
+ QStringList newfiles;
+ findNewFiles( dirName, newfiles );
+
+ if ( newfiles.count() > 0 )
+ {
+ addNewFilesToProject( newfiles );
+ }
+
+ }
+ else
+ {
+ int r = KMessageBox::questionYesNo( mainWindow()->main(),
+ i18n( "This project does not contain any files yet.\n"
+ "Populate it with all C/C++/Java files below "
+ "the project directory?" ), QString::null, i18n( "Populate" ), i18n( "Do Not Populate" ) );
+ if ( r == KMessageBox::Yes )
+ populateProject();
+ }
+
+
+ // check if there is an old envvars entry (from old project file with single make environment)
+ QString buildtool = DomUtil::readEntry( dom , "/kdevcustomproject/build/buildtool" );
+ QDomElement el =
+ DomUtil::elementByPath( dom , "/kdevcustomproject/" + buildtool + "/envvars" );
+ if ( !el.isNull() )
+ {
+ QDomElement envs = DomUtil::createElementByPath( dom , "/kdevcustomproject/" + buildtool + "/environments" );
+ DomUtil::makeEmpty( envs );
+ el.setTagName( "default" );
+ envs.appendChild( el );
+ }
+ KDevProject::openProject( dirName, projectName );
+}
+
+
+/**
+ * @brief Recursively search given directory searching for files which may be part of this project.
+ *
+ * The files found not in a black list,
+ * and not being already part of our project are gathered.
+ *
+ * @param dir directory to scan (and recurse) for potential project files.
+ * @param[out] fileList the list of files found.
+ */
+void CustomProjectPart::findNewFiles( const QString& dir, QStringList& filelist ) const
+{
+ if ( dir.isEmpty() )
+ return;
+ QStringList fileentries = QDir( dir ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( dir ).entryList( QDir::Dirs );
+ QStringList entries = fileentries + dirs;
+ QString relpath = relativeToProject( dir );
+ if ( !relpath.isEmpty() )
+ relpath += "/";
+ for ( QStringList::const_iterator it = entries.begin(); it != entries.end(); ++it )
+ {
+ // Only process genuine entries - files and directories.
+ if (( *it == "." ) || ( *it == ".." ) )
+ continue;
+ // If the entry (be it a file or a directory) is already part of this project, proceed to next one.
+ const QString relativeEntry( relpath + *it );
+ if ( isInProject( relativeEntry ) )
+ continue;
+ // If the entry is blacklisted, proceed to next one.
+ // Note that by using generic isInBlacklist(),
+ // we are actually wasting resources,
+ // because it also tests whether any parent directory of relativeEntry is blacklisted.
+ // But by the order we are traversing and processing the directories,
+ // we know it is not the case, ever.
+ if ( isInBlacklist( relativeEntry ) )
+ continue;
+ // We have a new, non-blacklisted entry.
+ // Recurse into it (a directory) or add it to the potential list of new project files.
+ const QString absoluteEntry( dir + "/" + *it );
+ if ( QFileInfo( absoluteEntry ).isFile() )
+ {
+ filelist << relativeEntry;
+ }
+ else if ( QFileInfo( absoluteEntry ).isDir() )
+ {
+ bool searchRecursive = true;
+ QFileInfo fi( absoluteEntry );
+ if( fi.isSymLink() )
+ {
+ QString realDir = fi.readLink();
+ if( QFileInfo( realDir ).exists() )
+ {
+ for( QStringList::const_iterator it = filelist.constBegin(); it != filelist.constEnd(); ++it )
+ {
+
+ if( QFileInfo(projectDirectory()+"/"+*it).absFilePath().startsWith( realDir ) )
+ {
+ searchRecursive = false;
+ }
+ }
+ } else {
+ searchRecursive = false;
+ }
+ }
+ if( searchRecursive )
+ {
+ findNewFiles( absoluteEntry, filelist );
+ }
+ }
+ }
+}
+
+
+void CustomProjectPart::populateProject()
+{
+
+ KDialogBase* dlg = new KDialogBase( mainWindow()->main(), "typeselector", true,
+ "Select filetypes of project", KDialogBase::Ok | KDialogBase::Cancel );
+ QVBox* box = dlg->makeVBoxMainWidget();
+ KEditListBox* lb = new KEditListBox( "Filetypes in the project", box, "selecttypes",
+ false, KEditListBox::Add | KEditListBox::Remove );
+ lb->setItems( filetypes() );
+ if ( dlg->exec() == QDialog::Accepted )
+ {
+ setFiletypes( lb->items() );
+ }
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ removeFiles( allFiles() );
+ updateBlacklist( QStringList() );
+
+ QStringList newlist;
+
+ findNewFiles( projectDirectory(), newlist );
+
+ QApplication::restoreOverrideCursor();
+ addNewFilesToProject( newlist );
+}
+
+
+void CustomProjectPart::closeProject()
+{
+ saveProject();
+}
+
+void CustomProjectPart::saveProject()
+{
+ QFile f( m_filelistDir + "/" + m_projectName + ".kdevelop.filelist" );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+
+ QTextStream stream( &f );
+ stream << "# KDevelop Custom Project File List" << endl;
+
+ ProjectFilesSet::ConstIterator it;
+ for ( it = m_sourceFilesSet.constBegin(); it != m_sourceFilesSet.constEnd(); ++it )
+ stream << it.key() << endl;
+ f.close();
+}
+
+
+QString CustomProjectPart::projectDirectory() const
+{
+ return m_projectDirectory;
+}
+
+
+QString CustomProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList CustomProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry( *projectDom(), "/kdevcustomproject/run/envvars", "envvar", "name", "value" );
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString CustomProjectPart::runDirectory() const
+{
+ QString cwd = defaultRunDirectory( "kdevcustomproject" );
+ if ( cwd.isEmpty() )
+ cwd = buildDirectory();
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+QString CustomProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevcustomproject/run/mainprogram" );
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith( "/" ) ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+
+ return QString();
+}
+
+/** Retuns a QString with the debug command line arguments */
+QString CustomProjectPart::debugArguments() const
+{
+ return DomUtil::readEntry( *projectDom(), "/kdevcustomproject/run/globaldebugarguments" );
+}
+
+
+/** Retuns a QString with the run command line arguments */
+QString CustomProjectPart::runArguments() const
+{
+ return DomUtil::readEntry( *projectDom(), "/kdevcustomproject/run/programargs" );
+}
+
+QString CustomProjectPart::activeDirectory() const
+{
+ QDomDocument &dom = *projectDom();
+ return DomUtil::readEntry( dom, "/kdevcustomproject/general/activedir", "." );
+}
+
+
+QStringList CustomProjectPart::allFiles() const
+{
+ return m_sourceFilesSet.keys();
+}
+
+
+void CustomProjectPart::addFile( const QString &fileName )
+{
+ QStringList fileList;
+ fileList.append( fileName );
+
+ this->addFiles( fileList );
+}
+
+void CustomProjectPart::addFiles( const QStringList& fileList )
+{
+ QStringList::ConstIterator it;
+ QStringList addedFiles;
+ QStringList myfileList = fileList;
+ kdDebug( 9025 ) << "Adding files: " << myfileList << endl;
+ myfileList.remove( "." );
+ myfileList.remove( "" );
+ myfileList.remove( ".." );
+ for ( it = myfileList.begin(); it != myfileList.end(); ++it )
+ {
+ if ( isInBlacklist( *it ) )
+ continue;
+ QString relpath;
+ kdDebug( 9025 ) << "Checking path: " << *it << endl;
+ if ( QDir::isRelativePath( *it ) )
+ {
+ kdDebug( 9025 ) << *it << " is relative" << endl;
+ relpath = *it;
+ }
+ else
+ {
+ kdDebug( 9025 ) << *it << " is not relative" << endl;
+ relpath = relativeToProject( *it );
+ }
+
+ if ( !QFileInfo( projectDirectory() + "/" + relpath ).exists() )
+ continue;
+
+ if ( QFileInfo( projectDirectory() + "/" + relpath ).isDir() && ( m_recursive || m_first_recursive ) )
+ {
+ kdDebug( 9025 ) << "is a dir and " << m_recursive << "|" << m_first_recursive << endl;
+ m_first_recursive = false;
+ QStringList fileentries = QDir( projectDirectory() + "/" + relpath ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( projectDirectory() + "/" + relpath ).entryList( QDir::Dirs );
+ QStringList subentries = fileentries + dirs;
+ for ( QStringList::iterator subit = subentries.begin(); subit != subentries.end(); ++subit )
+ {
+ if ( *subit != "." && *subit != ".." )
+ *subit = relpath + "/" + ( *subit );
+ if (( *subit ).startsWith( "/" ) )
+ *subit = ( *subit ).mid( 1, ( *subit ).length() );
+ }
+ addFiles( subentries );
+ addedFiles << relpath;
+ addToProject( relpath );
+ m_first_recursive = true;
+ }
+ else if ( isProjectFileType( QFileInfo( relpath ).fileName() ) && ( ! isInProject( relpath ) ) )
+ {
+ QStringList paths = QStringList::split( "/", relpath );
+ paths.pop_back();
+ QString path;
+ for ( QStringList::const_iterator it = paths.begin(); it != paths.end(); ++it )
+ {
+ path += *it;
+ if ( ! isInProject( path ) )
+ {
+ addedFiles << path;
+ addToProject( path );
+ }
+ path += "/";
+ }
+ addedFiles << relpath;
+ addToProject( relpath );
+ }
+ else
+ {
+ kdDebug( 9025 ) << "not adding " << relpath << endl;
+ }
+ }
+ m_first_recursive = false;
+ saveProject();
+
+ kdDebug( 9025 ) << "Emitting addedFilesToProject" << addedFiles << endl;
+ emit addedFilesToProject( addedFiles );
+}
+
+void CustomProjectPart::removeFile( const QString &fileName )
+{
+ QStringList fileList;
+ fileList.append( fileName );
+
+ this->removeFiles( fileList );
+}
+
+void CustomProjectPart::removeFiles( const QStringList& fileList )
+{
+ kdDebug( 9025 ) << "Emitting removedFilesFromProject" << fileList << endl;
+ QStringList removedFiles;
+ QStringList myfileList = fileList;
+ QStringList::ConstIterator it;
+ myfileList.remove( "." );
+ myfileList.remove( ".." );
+ myfileList.remove( "" );
+
+ for ( it = myfileList.begin(); it != myfileList.end(); ++it )
+ {
+ QString relpath;
+ if ( QDir::isRelativePath( *it ) )
+ relpath = *it;
+ else
+ relpath = relativeToProject( *it );
+
+ if ( QFileInfo( projectDirectory() + "/" + relpath ).isDir() && ( m_recursive || m_first_recursive ) )
+ {
+ m_first_recursive = false;
+ QStringList fileentries = QDir( projectDirectory() + "/" + relpath ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( projectDirectory() + "/" + relpath ).entryList( QDir::Dirs );
+ QStringList subentries = fileentries + dirs;
+ for ( QStringList::iterator subit = subentries.begin(); subit != subentries.end(); ++subit )
+ if ( *subit != "." && *subit != ".." )
+ *subit = relpath + "/" + ( *subit );
+ removeFiles( subentries );
+ if ( !containsProjectFiles( relpath ) )
+ {
+ removedFiles << relpath;
+ removeFromProject( relpath );
+ }
+ m_first_recursive = true;
+ }
+ else if ( isInProject( relpath ) )
+ {
+ removedFiles << relpath;
+ removeFromProject( relpath );
+ QStringList paths = QStringList::split( "/", relpath );
+ QString lastsubentry = paths[paths.size()-1];
+ paths.pop_back();
+ while ( paths.size() > 0 )
+ {
+ QString dir = paths.join( "/" );
+ QStringList projectentries = projectFilesInDir( dir );
+ if ( projectentries.size() == 0 )
+ {
+ removedFiles << dir;
+ removeFromProject( dir );
+ }
+ else
+ break;
+ lastsubentry = paths[paths.size()-1];
+ paths.pop_back();
+ }
+ }
+ }
+
+ saveProject();
+ emit removedFilesFromProject( removedFiles );
+}
+
+QString CustomProjectPart::buildDirectory() const
+{
+ QString dir = DomUtil::readEntry( *projectDom(), "/kdevcustomproject/build/builddir" );
+ if ( dir.isEmpty() )
+ return projectDirectory();
+ if ( QFileInfo( dir ).isRelative() )
+ return QDir::cleanDirPath( projectDirectory() + "/" + dir );
+ return dir;
+}
+
+
+QString CustomProjectPart::makeEnvironment() const
+{
+ // Get the make environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE"
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ QString buildtool = DomUtil::readEntry( *projectDom(), "/kdevcustomproject/build/buildtool" );
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry( *projectDom(), "/kdevcustomproject/" + buildtool + "/environments/" + currentMakeEnvironment(), "envvar", "name", "value" );
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for ( it = envvars.begin(); it != envvars.end(); ++it )
+ {
+ environstr += ( *it ).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote(( *it ).second );
+ environstr += " ";
+ }
+
+ KConfigGroup grp( kapp->config(), "MakeOutputView" );
+ if( grp.readBoolEntry( "ForceCLocale", true ) )
+ environstr += "LC_MESSAGES=" + EnvVarTools::quote( "C" )+" "+" "+"LC_CTYPE="+EnvVarTools::quote("C")+" ";
+
+ return environstr;
+}
+
+
+void CustomProjectPart::startMakeCommand( const QString &dir, const QString &target, bool withKdesu )
+{
+ if ( partController()->saveAllFiles() == false )
+ return; //user cancelled
+
+ QDomDocument &dom = *projectDom();
+ QString buildtool = DomUtil::readEntry( dom, "/kdevcustomproject/build/buildtool" );
+
+ QString cmdline;
+ if ( buildtool == "ant" )
+ {
+ cmdline = "ant";
+ }
+ else if ( buildtool == "other" )
+ {
+ cmdline = DomUtil::readEntry( dom, "/kdevcustomproject/other/otherbin" );
+ if ( cmdline.isEmpty() )
+ cmdline = "echo";
+ else if ( cmdline.find( "/" ) == -1 )
+ cmdline = "./" + cmdline;
+ cmdline += " " + DomUtil::readEntry( dom, "/kdevcustomproject/other/otheroptions" );
+ }
+ else
+ {
+ cmdline = DomUtil::readEntry( dom, "/kdevcustomproject/make/makebin" );
+ if ( cmdline.isEmpty() )
+ cmdline = MAKE_COMMAND;
+ if ( !DomUtil::readBoolEntry( dom, "/kdevcustomproject/make/abortonerror" ) )
+ cmdline += " -k";
+ int jobs = DomUtil::readIntEntry( dom, "/kdevcustomproject/make/numberofjobs" );
+ if ( jobs != 0 )
+ {
+ cmdline += " -j";
+ cmdline += QString::number( jobs );
+ }
+ if ( DomUtil::readBoolEntry( dom, "/kdevcustomproject/make/dontact" ) )
+ cmdline += " -n";
+ cmdline += " " + DomUtil::readEntry( dom, "/kdevcustomproject/make/makeoptions" );
+ }
+
+ cmdline += " ";
+ if ( !target.isEmpty() )
+ cmdline += KProcess::quote( target );
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote( dir );
+ dircmd += " && ";
+
+ int prio = DomUtil::readIntEntry( dom, "/kdevcustomproject/" + buildtool + "/prio" );
+ QString nice;
+ if ( prio != 0 )
+ {
+ nice = QString( "nice -n%1 " ).arg( prio );
+ }
+
+ cmdline.prepend( nice );
+ cmdline.prepend( makeEnvironment() );
+
+ if ( withKdesu )
+ cmdline = "kdesu -t -c '" + cmdline + "'";
+
+ m_buildCommand = dircmd + cmdline;
+
+
+ makeFrontend()->queueCommand( dir, dircmd + cmdline );
+}
+
+
+void CustomProjectPart::slotBuild()
+{
+ m_lastCompilationFailed = false;
+ QString buildtool = DomUtil::readEntry( *projectDom(), "/kdevcustomproject/build/buildtool" );
+ startMakeCommand( buildDirectory(), DomUtil::readEntry( *projectDom(),
+ "/kdevcustomproject/" + buildtool + "/defaulttarget" ) );
+}
+
+void CustomProjectPart::slotBuildActiveDir()
+{
+ m_lastCompilationFailed = false;
+ QString buildtool = DomUtil::readEntry( *projectDom(), "/kdevcustomproject/build/buildtool" );
+ startMakeCommand( buildDirectory() + "/" + activeDirectory(), DomUtil::readEntry( *projectDom(),
+ "/kdevcustomproject/" + buildtool + "/defaulttarget" ) );
+}
+
+
+void CustomProjectPart::slotCompileFile()
+{
+ KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>( partController()->activePart() );
+ if ( !part || !part->url().isLocalFile() )
+ return;
+
+ QString fileName = part->url().path();
+ QFileInfo fi( fileName );
+ QString sourceDir = fi.dirPath();
+ QString baseName = fi.baseName( true );
+ kdDebug( 9025 ) << "Compiling " << fileName
+ << "in dir " << sourceDir
+ << " with baseName " << baseName << endl;
+
+ // What would be nice: In case of non-recursive build system, climb up from
+ // the source dir until a Makefile is found
+
+ QString buildDir = sourceDir;
+ QString target = baseName + ".o";
+
+ QString buildtool = DomUtil::readEntry( *projectDom(), "/kdevcustomproject/build/buildtool" );
+
+ //if there is no Makefile in the directory of the source file
+ //try to build it from the main build dir
+ //this works e.g. for non-recursive cmake Makefiles, Alex
+ if ( buildtool == "make" && ( QFile::exists( sourceDir + "/Makefile" ) == false )
+ && ( QFile::exists( sourceDir + "/makefile" ) == false ) )
+ {
+ buildDir = buildDirectory();
+ }
+
+ startMakeCommand( buildDir, target );
+}
+
+void CustomProjectPart::slotInstallActiveDir()
+{
+ startMakeCommand( buildDirectory() + "/" + activeDirectory(), QString::fromLatin1( "install" ) );
+}
+
+void CustomProjectPart::slotInstall()
+{
+ startMakeCommand( buildDirectory(), QString::fromLatin1( "install" ) );
+}
+
+
+void CustomProjectPart::slotInstallWithKdesu()
+{
+ // First issue "make" to build the entire project with the current user
+ // This way we make sure all files are up to date before we do the "make install"
+ slotBuild();
+
+ // After that issue "make install" with the root user
+ startMakeCommand( buildDirectory(), QString::fromLatin1( "install" ), true );
+}
+
+void CustomProjectPart::slotClean()
+{
+ startMakeCommand( buildDirectory(), QString::fromLatin1( "clean" ) );
+}
+
+
+void CustomProjectPart::slotExecute()
+{
+ partController()->saveAllFiles();
+
+ bool _auto = false;
+ if ( DomUtil::readBoolEntry( *projectDom(), "/kdevcustomproject/run/autocompile", true ) && ( isDirty() || !QFileInfo( mainProgram() ).exists() ) )
+ {
+ m_executeAfterBuild = true;
+ slotBuild();
+ _auto = true;
+ }
+
+ if ( DomUtil::readBoolEntry( *projectDom(), "/kdevcustomproject/run/autoinstall", false ) && ( isDirty() || !QFileInfo( mainProgram() ).exists() ) )
+ {
+ m_executeAfterBuild = true;
+ // Use kdesu??
+ if ( DomUtil::readBoolEntry( *projectDom(), "/kdevcustomproject/run/autokdesu", false ) )
+ //slotInstallWithKdesu assumes that it hasn't just been build...
+ _auto ? slotInstallWithKdesu() : startMakeCommand( buildDirectory(), QString::fromLatin1( "install" ), true );
+ else
+ slotInstall();
+ _auto = true;
+ }
+
+ if ( _auto )
+ return;
+
+ // Get the run environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE"
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ DomUtil::PairList envvars = runEnvironmentVars();
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for ( it = envvars.begin(); it != envvars.end(); ++it )
+ {
+ environstr += ( *it ).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote(( *it ).second );
+ environstr += " ";
+ }
+
+ if ( mainProgram().isEmpty() )
+ // Do not execute non executable targets
+ return;
+
+ QString program = environstr;
+ program += mainProgram();
+ program += " " + runArguments();
+
+ bool inTerminal = DomUtil::readBoolEntry( *projectDom(), "/kdevcustomproject/run/terminal" );
+
+ kdDebug( 9025 ) << "runDirectory: <" << runDirectory() << ">" << endl;
+ kdDebug( 9025 ) << "environstr : <" << environstr << ">" << endl;
+ kdDebug( 9025 ) << "mainProgram : <" << mainProgram() << ">" << endl;
+ kdDebug( 9025 ) << "runArguments: <" << runArguments() << ">" << endl;
+
+ appFrontend()->startAppCommand( runDirectory(), program, inTerminal );
+}
+
+void CustomProjectPart::updateTargetMenu()
+{
+ m_targets.clear();
+ m_targetsObjectFiles.clear();
+ m_targetsOtherFiles.clear();
+ m_targetMenu->clear();
+ m_targetObjectFilesMenu->clear();
+ m_targetOtherFilesMenu->clear();
+
+ QDomDocument &dom = *projectDom();
+ bool ant = DomUtil::readEntry( dom, "/kdevcustomproject/build/buildtool" ) == "ant";
+
+ if ( ant )
+ {
+ QFile f( buildDirectory() + "/build.xml" );
+ if ( !f.open( IO_ReadOnly ) )
+ {
+ kdDebug( 9025 ) << "No build file" << endl;
+ return;
+ }
+ QDomDocument dom;
+ if ( !dom.setContent( &f ) )
+ {
+ kdDebug( 9025 ) << "Build script not valid xml" << endl;
+ f.close();
+ return;
+ }
+ f.close();
+
+ QDomNode node = dom.documentElement().firstChild();
+ while ( !node.isNull() )
+ {
+ if ( node.toElement().tagName() == "target" )
+ m_targets.append( node.toElement().attribute( "name" ) );
+ node = node.nextSibling();
+ }
+ }
+ else
+ {
+ kdDebug( 9025 ) << "Trying to load a makefile... " << endl;
+
+ m_makefileVars.clear();
+ m_parsedMakefiles.clear();
+ m_makefilesToParse.clear();
+ m_makefilesToParse.push( "Makefile" );
+ m_makefilesToParse.push( "makefile" );
+ putEnvVarsInVarMap();
+ while ( !m_makefilesToParse.isEmpty() )
+ parseMakefile( m_makefilesToParse.pop() );
+
+ //free the memory again
+ m_makefileVars.clear();
+ m_parsedMakefiles.clear();
+
+ m_targets.sort();
+ m_targetsObjectFiles.sort();
+ m_targetsOtherFiles.sort();
+
+ }
+
+ m_targetMenu->insertItem( i18n( "Object Files" ), m_targetObjectFilesMenu );
+ m_targetMenu->insertItem( i18n( "Other Files" ), m_targetOtherFilesMenu );
+
+ int id = 0;
+ QStringList::ConstIterator it;
+ for ( it = m_targets.begin(); it != m_targets.end(); ++it )
+ m_targetMenu->insertItem( *it, id++ );
+
+ id = 0;
+ for ( it = m_targetsObjectFiles.begin(); it != m_targetsObjectFiles.end(); ++it )
+ m_targetObjectFilesMenu->insertItem( *it, id++ );
+
+ id = 0;
+ for ( it = m_targetsOtherFiles.begin(); it != m_targetsOtherFiles.end(); ++it )
+ m_targetOtherFilesMenu->insertItem( *it, id++ );
+}
+
+void CustomProjectPart::putEnvVarsInVarMap()
+{
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry( *projectDom(), "/kdevcustomproject/make/environments/" + currentMakeEnvironment(), "envvar", "name", "value" );
+
+ for ( DomUtil::PairList::ConstIterator it = envvars.begin(); it != envvars.end(); ++it )
+ m_makefileVars[( *it ).first] = ( *it ).second; //is qouting here required as in makeEnvironment() ??
+}
+
+void CustomProjectPart::parseMakefile( const QString& filename )
+{
+ if ( m_parsedMakefiles.contains( filename ) )
+ return;
+
+ m_parsedMakefiles.insert( filename, 1 );
+
+ QString absFilename = filename;
+ if ( !filename.startsWith( "/" ) )
+ absFilename = buildDirectory() + "/" + filename;
+
+ QFile f( absFilename );
+ if ( !f.open( IO_ReadOnly ) )
+ {
+ kdDebug( 9025 ) << "could not open " << absFilename << endl;
+ return;
+ }
+ QRegExp targetRe( "^ *([^\\t$.#]\\S+) *:.*$" );
+ targetRe.setMinimal( true );
+
+ QRegExp variablesRe( "\\$\\(\\s*([^\\)\\s]+)\\s*\\)" );
+ QRegExp assignmentRe( "^\\s*(\\S+)\\s*[:\\?]?=\\s*(\\S+)\\s*(#.*)?$" );
+
+ QRegExp includedMakefilesRe( "^include\\s+(\\S+)" );
+ QString str = "";
+ while ( !f.atEnd() )
+ {
+ f.readLine( str, 200 );
+
+ // Replace any variables in the current line
+ int offset = -1;
+ while (( offset = variablesRe.search( str, offset + 1 ) ) != -1 )
+ {
+ QString variableName = variablesRe.cap( 1 ).simplifyWhiteSpace();
+ if ( m_makefileVars.contains( variableName ) )
+ {
+ str.replace( variablesRe.cap( 0 ), m_makefileVars[variableName] );
+ }
+ }
+
+ // Read all continuation lines
+ // kdDebug(9025) << "Trying: " << str.simplifyWhiteSpace() << endl;
+ //while (str.right(1) == "\\" && !stream.atEnd()) {
+ // str.remove(str.length()-1, 1);
+ // str += stream.readLine();
+ //}
+ // Find any variables
+ if ( assignmentRe.search( str ) != -1 )
+ {
+ m_makefileVars[assignmentRe.cap( 1 ).simplifyWhiteSpace()] = assignmentRe.cap( 2 ).simplifyWhiteSpace();
+ }
+ else if ( includedMakefilesRe.search( str ) != -1 )
+ {
+ QString includedMakefile = includedMakefilesRe.cap( 1 ).simplifyWhiteSpace();
+ m_makefilesToParse.push( includedMakefile );
+ }
+ else if ( targetRe.search( str ) != -1 )
+ {
+ QString tmpTarget = targetRe.cap( 1 ).simplifyWhiteSpace();
+ if ( tmpTarget.endsWith( ".o" ) )
+ {
+ if ( m_targetsObjectFiles.find( tmpTarget ) == m_targetsObjectFiles.end() )
+ m_targetsObjectFiles += tmpTarget;
+ }
+ else if ( tmpTarget.contains( '.' ) )
+ {
+ if ( m_targetsOtherFiles.find( tmpTarget ) == m_targetsOtherFiles.end() )
+ m_targetsOtherFiles += tmpTarget;
+ }
+ else
+ {
+ if ( m_targets.find( tmpTarget ) == m_targets.end() )
+ m_targets += tmpTarget;
+ }
+ }
+ }
+ f.close();
+}
+
+void CustomProjectPart::targetMenuActivated( int id )
+{
+ QString target = m_targets[id];
+ startMakeCommand( buildDirectory(), target );
+}
+
+void CustomProjectPart::targetObjectFilesMenuActivated( int id )
+{
+ QString target = m_targetsObjectFiles[id];
+ startMakeCommand( buildDirectory(), target );
+}
+
+void CustomProjectPart::targetOtherFilesMenuActivated( int id )
+{
+ QString target = m_targetsOtherFiles[id];
+ startMakeCommand( buildDirectory(), target );
+}
+
+void CustomProjectPart::updateMakeEnvironmentsMenu()
+{
+ QDomDocument &dom = *projectDom();
+ bool makeUsed = ( DomUtil::readEntry( dom, "/kdevcustomproject/build/buildtool" ) == "make" );
+ if ( makeUsed )
+ {
+ QStringList l = allMakeEnvironments();
+ m_makeEnvironmentsSelector->setItems( l );
+ m_makeEnvironmentsSelector->setCurrentItem( l.findIndex( currentMakeEnvironment() ) );
+ }
+ else
+ {
+ m_makeEnvironmentsSelector->clear();
+ }
+ /*
+ m_makeEnvironmentsMenu->clear();
+ QDomDocument &dom = *projectDom();
+
+ QStringList environments = allMakeEnvironments();
+ QStringList::ConstIterator it;
+ int id = 0;
+ for (it = environments.begin(); it != environments.end(); ++it)
+ m_makeEnvironmentsMenu->insertItem(*it, id++);
+ }
+ */
+}
+
+void CustomProjectPart::makeEnvironmentsMenuActivated( int id )
+{
+ QDomDocument &dom = *projectDom();
+ QString environment = allMakeEnvironments()[id];
+ DomUtil::writeEntry( dom, "/kdevcustomproject/make/selectedenvironment", environment );
+}
+
+void CustomProjectPart::slotCommandFinished( const QString& command )
+{
+ kdDebug( 9025 ) << "CustomProjectPart::slotProcessFinished()" << endl;
+
+ if ( m_buildCommand != command )
+ return;
+
+ m_buildCommand = QString::null;
+
+ m_timestamp.clear();
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ QString fileName = *it;
+ ++it;
+
+ m_timestamp[ fileName ] = QFileInfo( projectDirectory(), fileName ).lastModified();
+ }
+
+ emit projectCompiled();
+
+ if ( m_executeAfterBuild )
+ {
+ slotExecute();
+ m_executeAfterBuild = false;
+ }
+}
+
+void CustomProjectPart::slotCommandFailed( const QString& /*command*/ )
+{
+ m_lastCompilationFailed = true;
+ m_executeAfterBuild = false;
+}
+
+bool CustomProjectPart::isDirty()
+{
+ if ( m_lastCompilationFailed ) return true;
+
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ QString fileName = *it;
+ ++it;
+
+ QMap<QString, QDateTime>::Iterator it = m_timestamp.find( fileName );
+ QDateTime t = QFileInfo( projectDirectory(), fileName ).lastModified();
+ if ( it == m_timestamp.end() || *it != t )
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+QStringList CustomProjectPart::allMakeEnvironments() const
+{
+ QDomDocument &dom = *projectDom();
+
+ QStringList allConfigs;
+
+ QDomNode node =
+ DomUtil::elementByPath( dom , "/kdevcustomproject/make/environments" );
+ // extract the names of the different make environments
+ QDomElement childEl = node.firstChild().toElement();
+ while ( !childEl.isNull() )
+ {
+ QString config = childEl.tagName();
+ allConfigs.append( config );
+ childEl = childEl.nextSibling().toElement();
+ }
+ if ( allConfigs.isEmpty() )
+ allConfigs.append( "default" );
+
+ return allConfigs;
+}
+
+
+QString CustomProjectPart::currentMakeEnvironment() const
+{
+ QStringList allEnvs = allMakeEnvironments();
+ QDomDocument &dom = *projectDom();
+ QString environment = DomUtil::readEntry( dom, "/kdevcustomproject/make/selectedenvironment" );
+ if ( environment.isEmpty() || !allEnvs.contains( environment ) )
+ environment = allEnvs[0];
+ return environment;
+}
+
+/*!
+ \fn CustomProjectPart::distFiles() const
+ */
+QStringList CustomProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir( projectDir );
+ QStringList files = dir.entryList( "*README*" );
+ return sourceList + files;
+}
+
+bool CustomProjectPart::containsNonProjectFiles( const QString& dir )
+{
+ if ( isInBlacklist( dir ) )
+ return false;
+ QStringList fileentries = QDir( dir ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( dir ).entryList( QDir::Dirs );
+ QStringList subentries = fileentries + dirs;
+ subentries.remove( "." );
+ subentries.remove( ".." );
+ for ( QStringList::const_iterator it = subentries.begin(); it != subentries.end(); ++it )
+ {
+ if ( isInBlacklist( *it ) )
+ continue;
+ if ( QFileInfo( dir + "/" + *it ).isDir() && !isInBlacklist( *it ) )
+ {
+ if ( containsNonProjectFiles( dir + "/" + *it ) )
+ {
+ return true;
+ }
+ }
+ else if ( !project()->isProjectFile( URLUtil::canonicalPath( dir + "/" + *it ) )
+ && !isInBlacklist( *it ) )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool CustomProjectPart::containsProjectFiles( const QString& dir )
+{
+ if ( isInBlacklist( dir ) )
+ return false;
+
+ QStringList fileentries = QDir( dir ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( dir ).entryList( QDir::Dirs );
+ QStringList subentries = fileentries + dirs;
+ subentries.remove( "." );
+ subentries.remove( ".." );
+ for ( QStringList::const_iterator it = subentries.begin(); it != subentries.end(); ++it )
+ {
+ if ( isInBlacklist( *it ) )
+ continue;
+
+ if ( QFileInfo( dir + "/" + *it ).isDir() && !isInBlacklist( *it ) )
+ {
+ if ( containsProjectFiles( dir + "/" + *it ) )
+ {
+ return true;
+ }
+ }
+ else if ( project()->isProjectFile( URLUtil::canonicalPath( dir + "/" + *it ) ) && !isInBlacklist( *it ) )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+QStringList CustomProjectPart::projectFilesInDir( const QString& dir )
+{
+ QStringList result;
+ QStringList fileentries = QDir( projectDirectory() + "/" + dir ).entryList( filetypes().join( ";" ) );
+ QStringList dirs = QDir( projectDirectory() + "/" + dir ).entryList( QDir::Dirs );
+ QStringList subentries = fileentries + dirs;
+ subentries.remove( "." );
+ subentries.remove( ".." );
+ for ( QStringList::const_iterator it = subentries.begin(); it != subentries.end(); ++it )
+ {
+ if ( isInProject( dir + "/" + *it ) )
+ {
+ result << ( *it );
+ }
+ }
+ return result;
+}
+
+QStringList CustomProjectPart::filetypes( ) const
+{
+ return DomUtil::readListEntry( *projectDom(), "/kdevcustomproject/filetypes", "filetype" );
+}
+
+bool CustomProjectPart::isProjectFileType( const QString& filename ) const
+{
+ QStringList types = filetypes();
+ QRegExp re( "", true, true );
+ for ( QStringList::const_iterator it = types.begin(); it != types.end(); ++it )
+ {
+ re.setPattern( *it );
+ int pos = re.search( filename );
+ uint len = re.matchedLength();
+ if ((( *it ).find( "*" ) != -1 || ( *it ).find( "?" ) != -1 ) && pos + len == filename.length() )
+ return true;
+ else if ( filename.find( "/" ) != -1 && filename.find( *it ) != -1 )
+ return true;
+ else if ( filename.find( "/" ) == -1 && filename == *it )
+ return true;
+ }
+ return false;
+}
+
+void CustomProjectPart::switchBlacklistEntry( const QString& path )
+{
+ QStringList blacklist = this->blacklist();
+ kdDebug( 9025 ) << "Switching path " << path << endl;
+ if ( !isInBlacklist( path ) )
+ {
+ blacklist << path;
+ m_recursive = true;
+ removeFile( path );
+ m_recursive = false;
+ }
+ else
+ {
+ blacklist.remove( path );
+ }
+ updateBlacklist( blacklist );
+}
+
+QString CustomProjectPart::relativeToProject( const QString& abspath ) const
+{
+ QString path = abspath.mid( projectDirectory().length() + 1 );
+ kdDebug( 9025 ) << "abspath: " << "|project dir: " << projectDirectory() << "|path: " << path << endl;
+ if ( path.endsWith( "/" ) )
+ path = path.mid( 0, path.length() - 1 );
+ if ( path.startsWith( "/" ) )
+ path = path.mid( 1, path.length() );
+ return path;
+}
+
+bool CustomProjectPart::isInBlacklist( const QString& path ) const
+{
+ QString relpath = path;
+ QStringList blacklist = this->blacklist();
+ if ( !QFileInfo( relpath ).isRelative() )
+ relpath = relativeToProject( path );
+ if ( blacklist.find( relpath ) != blacklist.end() )
+ return true;
+ QStringList paths = QStringList::split( "/", relpath );
+ QString parentpath;
+ for ( QStringList::const_iterator it = paths.begin(); it != paths.end(); ++it )
+ {
+ parentpath += *it;
+ if ( blacklist.find( parentpath ) != blacklist.end() )
+ return true;
+ parentpath = parentpath + "/";
+ }
+ return false;
+}
+
+void CustomProjectPart::updateBlacklist( const QStringList& l )
+{
+ DomUtil::writeListEntry( *projectDom(), "kdevcustomproject/blacklist", "path", l );
+}
+
+QStringList CustomProjectPart::blacklist() const
+{
+ return DomUtil::readListEntry( *projectDom(), "kdevcustomproject/blacklist", "path" );
+}
+
+void CustomProjectPart::addNewFilesToProject( const QStringList& filelist )
+{
+ QStringList addfiles;
+ for ( QStringList::const_iterator it = filelist.begin(); it != filelist.end(); ++it )
+ {
+ if (( ! isInProject( *it ) ) && ( isProjectFileType( *it ) || QFileInfo( projectDirectory() + "/" + *it ).isDir() ) && !isInBlacklist( *it ) )
+ {
+ addfiles << *it;
+ }
+ }
+
+ if ( addfiles.isEmpty() )
+ return;
+
+ SelectNewFilesDialog *dlg = new SelectNewFilesDialog( addfiles, mainWindow()->main() );
+ if ( dlg->exec() == KDialog::Accepted )
+ {
+ m_first_recursive = false;
+ m_recursive = false;
+ QStringList blacklist = this->blacklist();
+ QStringList excludelist = dlg->excludedPaths();
+ QStringList removeFromExcludes;
+ for ( QStringList::const_iterator it = excludelist.begin(); it != excludelist.end(); ++it )
+ {
+ if ( QFileInfo( projectDirectory() + "/" + *it ).isDir() )
+ {
+ for ( ProjectFilesSet::ConstIterator it2 = m_sourceFilesSet.constBegin(); it2 != m_sourceFilesSet.constEnd(); ++it2 )
+ {
+ if ( it2.key().find( *it ) != -1 )
+ {
+ removeFromExcludes << *it;
+ }
+ }
+ }
+ }
+ for ( QStringList::const_iterator it = removeFromExcludes.begin(); it != removeFromExcludes.end(); ++it )
+ {
+ excludelist.remove( *it );
+ }
+ blacklist += excludelist;
+ updateBlacklist( blacklist );
+ addFiles( dlg->includedPaths() );
+ }
+}
+
+void CustomProjectPart::setFiletypes( const QStringList& l )
+{
+ DomUtil::writeListEntry( *projectDom(), "kdevcustomproject/filetypes", "filetype", l );
+}
+
+
+/**
+ * @brief Is a given file (or a directory) part of this project?
+ *
+ * @param fileName
+ */
+bool CustomProjectPart::isInProject( const QString& fileName ) const
+{
+ return m_sourceFilesSet.contains( fileName );
+}
+
+
+/**
+ * @brief Add a file (or a directory) to this project.
+ *
+ * @param fileName
+ *
+ * @see removeFromProject()
+ */
+void CustomProjectPart::addToProject( const QString& fileName )
+{
+ m_sourceFilesSet.insert( fileName, false );
+}
+
+
+/**
+ * @brief Remove a file (or a directory) from this project.
+ *
+ * @param fileName
+ */
+void CustomProjectPart::removeFromProject( const QString& fileName )
+{
+ m_sourceFilesSet.remove( fileName );
+}
+
+
+#include "customprojectpart.moc"
+
diff --git a/buildtools/custommakefiles/customprojectpart.h b/buildtools/custommakefiles/customprojectpart.h
new file mode 100644
index 00000000..f3fb9ec4
--- /dev/null
+++ b/buildtools/custommakefiles/customprojectpart.h
@@ -0,0 +1,158 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 _CUSTOMPROJECTPART_H_
+#define _CUSTOMPROJECTPART_H_
+
+#include <qdict.h>
+#include <qguardedptr.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qvaluestack.h>
+
+#include <kdevbuildtool.h>
+
+class QListViewItem;
+class QPopupMenu;
+class QStringList;
+class KDialogBase;
+class CustomProjectWidget;
+class Context;
+class KSelectAction;
+
+class CustomProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+
+public:
+ CustomProjectPart( QObject *parent, const char *name, const QStringList & );
+ ~CustomProjectPart();
+
+ QStringList allMakeEnvironments() const;
+ QString currentMakeEnvironment() const;
+
+ bool isDirty();
+ QStringList distFiles() const;
+
+ virtual void openProject( const QString &dirName, const QString &projectName );
+ virtual void closeProject();
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString mainProgram() const;
+ virtual QString activeDirectory() const;
+ virtual QStringList allFiles() const;
+ virtual void addFile( const QString &fileName );
+ virtual void addFiles( const QStringList& fileList );
+ virtual void removeFile( const QString &fileName );
+ virtual void removeFiles( const QStringList &fileList );
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+ QString relativeToProject( const QString& ) const;
+
+
+private slots:
+ void populateProject();
+ void projectConfigWidget( KDialogBase *dlg );
+ void contextMenu( QPopupMenu *popup, const Context *context );
+ void slotAddToProject();
+ void slotRemoveFromProject();
+ void slotAddToProjectRecursive();
+ void slotRemoveFromProjectRecursive();
+ void addNewFilesToProject( const QStringList& );
+ void slotChangeBlacklist();
+ void slotChooseActiveDirectory();
+ void slotBuild();
+ void slotBuildActiveDir();
+ void slotCompileFile();
+ void slotInstall();
+ void slotInstallActiveDir();
+ void slotInstallWithKdesu();
+ void slotClean();
+ void slotExecute();
+ void updateTargetMenu();
+ void targetMenuActivated( int id );
+ void targetObjectFilesMenuActivated( int id );
+ void targetOtherFilesMenuActivated( int id );
+ void updateMakeEnvironmentsMenu();
+ void makeEnvironmentsMenuActivated( int id );
+ void slotCommandFinished( const QString& command );
+ void slotCommandFailed( const QString& command );
+
+private:
+ bool containsNonProjectFiles( const QString& url );
+ QStringList projectFilesInDir( const QString& dir );
+ bool containsProjectFiles( const QString& url );
+ bool isProjectFileType( const QString& absFile ) const;
+ bool isInBlacklist( const QString& ) const;
+ void cleanFileList();
+ void setFiletypes( const QStringList& );
+ void findNewFiles( const QString& dir, QStringList& list) const;
+
+ QStringList filetypes() const;
+ QStringList blacklist() const;
+ void updateBlacklist( const QStringList& );
+ void saveProject();
+ void startMakeCommand( const QString &dir, const QString &target, bool withKdesu = false );
+ void parseMakefile( const QString& file );
+ QString makeEnvironment() const;
+ void putEnvVarsInVarMap();
+ void switchBlacklistEntry(const QString& );
+
+ bool isInProject( const QString& fileName ) const;
+ void addToProject( const QString& fileName );
+ void removeFromProject( const QString& fileName );
+
+ /**
+ * @brief Set of all the project's files.
+ *
+ * @bug
+ * Due to deficiency in QT3,
+ * we have to use a map with next-to-useless element value,
+ * keyed by the file name,
+ * as a set-container replacement.
+ */
+ typedef QMap<QString, bool> ProjectFilesSet;
+
+ QString m_projectDirectory;
+ QString m_projectName;
+ QString m_filelistDir;
+ /** All the sources (files and directories) of this project. */
+ ProjectFilesSet m_sourceFilesSet;
+ QPopupMenu *m_targetMenu;
+ QPopupMenu *m_targetObjectFilesMenu;
+ QPopupMenu *m_targetOtherFilesMenu;
+ KSelectAction *m_makeEnvironmentsSelector;
+ QStringList m_targets;
+ QStringList m_targetsObjectFiles;
+ QStringList m_targetsOtherFiles;
+ QStringList m_contextAddFiles;
+ QStringList m_contextRemoveFiles;
+ QString m_contextDirName;
+
+ QMap<QString, QDateTime> m_timestamp;
+ bool m_executeAfterBuild;
+ QString m_buildCommand;
+ bool m_lastCompilationFailed;
+ QMap<QString, int> m_parsedMakefiles;
+ QValueStack<QString> m_makefilesToParse;
+ QMap<QString, QString> m_makefileVars;
+ bool m_recursive;
+ bool m_first_recursive;
+};
+
+#endif
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/kdevcustomproject.desktop b/buildtools/custommakefiles/kdevcustomproject.desktop
new file mode 100644
index 00000000..276f4c1a
--- /dev/null
+++ b/buildtools/custommakefiles/kdevcustomproject.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Custom Project
+Comment[br]=Raktres diouzhoc'h
+Comment[ca]=Projecte a mida
+Comment[cs]=Vlastní projekt
+Comment[da]=Brugerdefineret projekt
+Comment[de]=Benutzerdefiniertes Projekt für KDevelop
+Comment[el]=Προσαρμοσμένo έργο
+Comment[es]=Proyecto personalizado
+Comment[et]=Kohandatav projekt
+Comment[eu]=Proiektu pertsonalizatua
+Comment[fa]=پروژۀ سفارشی
+Comment[fr]=Projet personnalisé
+Comment[ga]=Tionscadal Saincheaptha
+Comment[gl]=Proxecto persoalizado
+Comment[hi]=कस्टम परियोजना
+Comment[hu]=Egyedi projekt
+Comment[is]=Sérsniðið verkefni
+Comment[it]=Progetto personalizzato
+Comment[ja]=カスタムプロジェクト
+Comment[ms]=Projek Tersendiri
+Comment[nds]=Egen Projekt
+Comment[ne]=अनुकूल परियोजना
+Comment[nl]=Aangepast project
+Comment[pl]=Własny projekt
+Comment[pt]=Projecto Personalizado
+Comment[pt_BR]=Projeto Personalizado
+Comment[ru]=Особый проект
+Comment[sk]=Vlastný projekt
+Comment[sl]=Poljuben projekt
+Comment[sr]=Произвољан пројекат
+Comment[sr@Latn]=Proizvoljan projekat
+Comment[sv]=Eget projekt
+Comment[ta]=தனிப்பயன் பிராஜக்ட்
+Comment[tg]=Лоиҳаи оддӣ
+Comment[tr]=Özel Proje
+Comment[zh_CN]=自定义工程
+Comment[zh_TW]=自訂專案
+Name=KDevCustomProject
+Name[da]=KDevelop brugerdefineret projekt
+Name[de]=Benutzerdefiniertes Projekt (KDevelop)
+Name[hi]=के-डेव-कस्टम-परियोजना
+Name[nds]=Egen Projekt (KDevelop)
+Name[ne]=केडीई विकास अनुकूल परियोजना
+Name[pl]=KDevWłasnyProjekt
+Name[sk]=KDevVlastnýProjekt
+Name[sv]=KDevelop eget projekt
+Name[ta]=கெடெவ் தனிப்பயன் பிராஜக்ட்
+Name[tg]=Лоиҳаи оддӣKDev
+Name[zh_TW]=KDevelop 自訂專案
+GenericName=Custom Project
+GenericName[br]=Raktres diouzhoc'h
+GenericName[ca]=Projecte a mida
+GenericName[da]=Brugerdefineret projekt
+GenericName[de]=Benutzerdefiniertes Projekt
+GenericName[el]=Προσαρμοσμένο έργο
+GenericName[es]=Proyecto personalizado
+GenericName[et]=Kohandatav projekt
+GenericName[eu]=Proiektu pertsonalizatua
+GenericName[fa]=پروژۀ سفارشی
+GenericName[fr]=Projet personnalisé
+GenericName[ga]=Tionscadal Saincheaptha
+GenericName[gl]=Proxecto persoalizado
+GenericName[hi]=कस्टम परियोजना
+GenericName[hu]=Egyedi projekt
+GenericName[it]=Progetto personalizzato
+GenericName[ja]=カスタムプロジェクト
+GenericName[ms]=Projek Tersendiri
+GenericName[nds]=Egen Projekt
+GenericName[ne]=अनुकूल परियोजना
+GenericName[nl]=Aangepast project
+GenericName[pl]=Projekt: własny
+GenericName[pt]=Projecto Personalizado
+GenericName[pt_BR]=Projeto Personalizado
+GenericName[ru]=Особый проект
+GenericName[sk]=Vlastný projekt
+GenericName[sl]=Poljuben projekt
+GenericName[sr]=Произвољан пројекат
+GenericName[sr@Latn]=Proizvoljan projekat
+GenericName[sv]=Eget projekt
+GenericName[ta]=தனிப்பயன் பிராஜக்ட்
+GenericName[tg]=Лоиҳаи оддӣ
+GenericName[tr]=Özel Proje
+GenericName[zh_CN]=自定义工程
+GenericName[zh_TW]=自訂專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevcustomproject
+X-KDevelop-Version=5
+X-KDevelop-Args=
diff --git a/buildtools/custommakefiles/kdevcustomproject.rc b/buildtools/custommakefiles/kdevcustomproject.rc
new file mode 100644
index 00000000..c744b4be
--- /dev/null
+++ b/buildtools/custommakefiles/kdevcustomproject.rc
@@ -0,0 +1,30 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevCustomProject" version="7">
+<MenuBar>
+ <Menu name="project" >
+ <Action name="repopulate_project" />
+ <Action name="addnewfiles_project" />
+ </Menu>
+ <Menu name="build" >
+ <Action name="build_build" />
+ <Action name="build_buildactivetarget" />
+ <Action name="build_compilefile" />
+ <Action name="build_target" />
+ <Action name="build_install" />
+ <Action name="build_installactivetarget" />
+ <Action name="build_make_environment" />
+ <Action name="build_clean" />
+ <Separator/>
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar" noMerge="1">
+ <Action name="build_build" group="build_operations" />
+ <Action name="build_buildactivetarget" group="build_operations" />
+ <Action name="build_compilefile" group="build_operations" />
+ <Separator group="build_operations"/>
+ <Action name="build_install" group="build_operations" />
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
+
diff --git a/buildtools/custommakefiles/selectnewfilesdialog.cpp b/buildtools/custommakefiles/selectnewfilesdialog.cpp
new file mode 100644
index 00000000..cfcb84e6
--- /dev/null
+++ b/buildtools/custommakefiles/selectnewfilesdialog.cpp
@@ -0,0 +1,131 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 "selectnewfilesdialog.h"
+
+#include <qlistview.h>
+#include <klistview.h>
+#include <qheader.h>
+#include <qstringlist.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include "selectnewfilesdialogbase.h"
+
+SelectNewFilesDialog::SelectNewFilesDialog( QStringList paths, QWidget* parent, const char* name )
+ : KDialogBase( parent, name, true, i18n("Add newly created files to project"), KDialogBase::Ok|KDialogBase::Cancel )
+{
+ m_widget = new SelectNewFilesDialogBase(this);
+ m_widget->fileView->header()->hide();
+ m_widget->fileView->addColumn(i18n("Path") );
+ for( QStringList::const_iterator it = paths.begin(); it != paths.end(); ++it)
+ {
+ addPath(0, *it);
+ }
+ setMainWidget( m_widget );
+ resize( 300,400 );
+}
+
+SelectNewFilesDialog::~SelectNewFilesDialog()
+{}
+
+void SelectNewFilesDialog::slotCancel()
+{
+ excludePaths.clear();
+ includePaths.clear();
+ KDialogBase::slotCancel();
+}
+
+void SelectNewFilesDialog::checkItem( QCheckListItem* item, const QString& curpath )
+{
+ if( !item )
+ return;
+
+ QString path = curpath + item->text();
+ if( item->state() != QCheckListItem::Off )
+ includePaths << path;
+ else
+ excludePaths << path;
+ if( item->firstChild() )
+ {
+ checkItem( static_cast<QCheckListItem*>(item->firstChild()), path+"/" );
+ }
+ if( item->nextSibling() )
+ {
+ checkItem( static_cast<QCheckListItem*>(item->nextSibling()), curpath );
+ }
+}
+
+void SelectNewFilesDialog::slotOk()
+{
+ QCheckListItem* item = static_cast<QCheckListItem*> (m_widget->fileView->firstChild());
+ checkItem( item, "" );
+ kdDebug(9025) << "Inc List:" << includePaths << endl;
+ kdDebug(9025) << "Exc List:" << excludePaths << endl;
+ KDialogBase::slotOk();
+}
+
+void SelectNewFilesDialog::addPath( QCheckListItem* item, const QString& path )
+{
+ if( path.isEmpty() )
+ return;
+
+ QStringList parts = QStringList::split("/", path );
+ QString name = parts.first();
+ parts.pop_front();
+ QCheckListItem* i = createItem( item, name, parts.size() );
+ i->setState( QCheckListItem::On );
+ i->setTristate( true );
+ addPath(i, parts.join("/") );
+}
+
+QCheckListItem* SelectNewFilesDialog::createItem( QCheckListItem* parent, const QString& name, int count )
+{
+ QCheckListItem::Type t = QCheckListItem::CheckBox;
+ if( count > 0 )
+ t = QCheckListItem::CheckBoxController;
+
+ if( parent == 0 )
+ {
+ QListViewItem* item = m_widget->fileView->firstChild();
+ while( item )
+ {
+ if( item->text( 0 ) == name )
+ return static_cast<QCheckListItem*>(item);
+ item = item->nextSibling();
+ }
+ return new QCheckListItem( m_widget->fileView, name, t );
+ }else
+ {
+ QListViewItem* item = parent->firstChild();
+ while( item )
+ {
+ if( item->text( 0 ) == name )
+ return static_cast<QCheckListItem*>(item);
+ item = item->nextSibling();
+ }
+ return new QCheckListItem( parent, name, t );
+ }
+}
+
+QStringList SelectNewFilesDialog::excludedPaths() const
+{
+ return excludePaths;
+}
+
+QStringList SelectNewFilesDialog::includedPaths() const
+{
+ return includePaths;
+}
+
+#include "selectnewfilesdialog.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/selectnewfilesdialog.h b/buildtools/custommakefiles/selectnewfilesdialog.h
new file mode 100644
index 00000000..b970dc7d
--- /dev/null
+++ b/buildtools/custommakefiles/selectnewfilesdialog.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Andreas Pakulat *
+ * apaku@gmx.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 SELECTNEWFILESDIALOG_H
+#define SELECTNEWFILESDIALOG_H
+
+#include "kdialogbase.h"
+
+class QCheckListItem;
+class QStringList;
+class SelectNewFilesDialogBase;
+
+class SelectNewFilesDialog : public KDialogBase
+{
+Q_OBJECT
+
+public:
+ SelectNewFilesDialog( QStringList paths, QWidget* parent = 0, const char* name = 0 );
+ ~SelectNewFilesDialog();
+
+ QStringList excludedPaths() const;
+ QStringList includedPaths() const;
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void slotCancel();
+ virtual void slotOk();
+private:
+ void addPath( QCheckListItem* , const QString& );
+ void checkItem( QCheckListItem* item, const QString& curpath );
+ QCheckListItem* createItem( QCheckListItem*, const QString&, int );
+ SelectNewFilesDialogBase* m_widget;
+ QStringList excludePaths;
+ QStringList includePaths;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/custommakefiles/selectnewfilesdialogbase.ui b/buildtools/custommakefiles/selectnewfilesdialogbase.ui
new file mode 100644
index 00000000..fbd5b5ec
--- /dev/null
+++ b/buildtools/custommakefiles/selectnewfilesdialogbase.ui
@@ -0,0 +1,50 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SelectNewFilesDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SelectNewFilesDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>532</width>
+ <height>324</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Files to add to the Project:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <property name="name">
+ <cstring>fileView</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select the files to add to the project</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select the files and directories that should be added to the list of project files. All other files and directories will be put into the blacklist.</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/lib/Makefile.am b/buildtools/lib/Makefile.am
new file mode 100644
index 00000000..c772e395
--- /dev/null
+++ b/buildtools/lib/Makefile.am
@@ -0,0 +1,8 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+SUBDIRS = parsers widgets base
+
+DOXYGEN_EMPTY = YES
+include ../../Doxyfile.am
diff --git a/buildtools/lib/base/Mainpage.dox b/buildtools/lib/base/Mainpage.dox
new file mode 100644
index 00000000..dbf199a5
--- /dev/null
+++ b/buildtools/lib/base/Mainpage.dox
@@ -0,0 +1,19 @@
+/**
+@mainpage The KDevelop Buildtool Base Library
+
+This library contains base classes for KDevelop builtool support plugins.
+
+<b>Link with</b>: -lkdevbuildbase
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/buildtools/base
+
+\section btbaseoverview Overview
+This library is created to provide KDevBuildTool compat class which can be used
+as drop-in replacement of KDevProject class for buildtool support plugins
+written for old KDevelop architecture (before version 3.2).
+
+Nevertheless, it can be useful for new buildtool plugins as well because it provides
+useful methods to get application and make frontend extensions.
+
+*/
+
diff --git a/buildtools/lib/base/Makefile.am b/buildtools/lib/base/Makefile.am
new file mode 100644
index 00000000..6c9f6df6
--- /dev/null
+++ b/buildtools/lib/base/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets/propeditor \
+ $(all_includes)
+METASOURCES = AUTO
+lib_LTLIBRARIES = libkdevbuildbase.la
+libkdevbuildbase_la_LDFLAGS = $(all_libraries)
+libkdevbuildbase_la_LIBADD = $(top_builddir)/lib/interfaces/libkdevinterfaces.la $(LIB_QT) $(LIB_KDEUI)
+libkdevbuildbase_la_SOURCES = kdevbuildtool.cpp
+kdevelopbuildtoolsincludedir = $(includedir)/kdevelop/buildtools/base
+kdevelopbuildtoolsinclude_HEADERS = kdevbuildtool.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces kdevextensions
+DOXYGEN_PROJECTNAME = KDevelop Buildtool Base Library
+DOXYGEN_DOCDIRPREFIX = kdevbt
+include ../../../Doxyfile.am
diff --git a/buildtools/lib/base/kdevbuildtool.cpp b/buildtools/lib/base/kdevbuildtool.cpp
new file mode 100644
index 00000000..a8b7de3a
--- /dev/null
+++ b/buildtools/lib/base/kdevbuildtool.cpp
@@ -0,0 +1,38 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevbuildtool.h"
+
+#include <kdevmakefrontend.h>
+#include <kdevappfrontend.h>
+
+KDevBuildTool::KDevBuildTool(const KDevPluginInfo* info, QObject* parent, const char* name)
+ :KDevProject(info, parent, name)
+{
+}
+
+KDevMakeFrontend * KDevBuildTool::makeFrontend()
+{
+ return extension<KDevMakeFrontend>("KDevelop/MakeFrontend");
+}
+
+KDevAppFrontend * KDevBuildTool::appFrontend()
+{
+ return extension<KDevAppFrontend>("KDevelop/AppFrontend");
+}
+
diff --git a/buildtools/lib/base/kdevbuildtool.h b/buildtools/lib/base/kdevbuildtool.h
new file mode 100644
index 00000000..95ed8d37
--- /dev/null
+++ b/buildtools/lib/base/kdevbuildtool.h
@@ -0,0 +1,41 @@
+/* This file is part of the KDE project
+ Copyright (C) 1999-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVBUILDTOOL_H
+#define KDEVBUILDTOOL_H
+
+#include <kdevproject.h>
+
+class KDevMakeFrontend;
+class KDevAppFrontend;
+
+/**Base class for KDevelop build tool support plugins.*/
+class KDevBuildTool: public KDevProject
+{
+public:
+ KDevBuildTool(const KDevPluginInfo* info, QObject* parent, const char* name);
+
+ /**@return The make frontend.*/
+ KDevMakeFrontend *makeFrontend();
+ /**@return The application frontend.*/
+ KDevAppFrontend *appFrontend();
+
+};
+
+#endif
diff --git a/buildtools/lib/parsers/Makefile.am b/buildtools/lib/parsers/Makefile.am
new file mode 100644
index 00000000..a1c9f256
--- /dev/null
+++ b/buildtools/lib/parsers/Makefile.am
@@ -0,0 +1,8 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+SUBDIRS = qmake autotools
+
+DOXYGEN_EMPTY = YES
+include ../../../Doxyfile.am
diff --git a/buildtools/lib/parsers/autotools/Mainpage.dox b/buildtools/lib/parsers/autotools/Mainpage.dox
new file mode 100644
index 00000000..99d200d9
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/Mainpage.dox
@@ -0,0 +1,11 @@
+/**
+@mainpage The KDevelop Makefile.am Parser
+
+This library contains a parser that handles Makefile.am.
+
+<b>Link with</b>: -lkdevautotoolsparser
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/buildtools/parsers/autotools
+
+*/
+
diff --git a/buildtools/lib/parsers/autotools/Makefile.am b/buildtools/lib/parsers/autotools/Makefile.am
new file mode 100644
index 00000000..c0776c2f
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/Makefile.am
@@ -0,0 +1,24 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+SUBDIRS = . tests
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets/propeditor \
+ $(all_includes)
+METASOURCES = AUTO
+noinst_LTLIBRARIES = libkdevautotoolsparser.la
+libkdevautotoolsparser_la_LDFLAGS = $(all_libraries) $(LIB_KIO)
+libkdevautotoolsparser_la_SOURCES = autotoolsast.cpp autotoolsdriver.cpp autotools_yacc.cpp
+
+parser:
+ cd $(srcdir) ; \
+ bison -d autotools.yy -o autotools_yacc.cpp ; \
+ mv -f autotools_yacc.hpp autotools_yacc.h ; \
+ flex -oautotools_lex.cpp autotools.ll
+
+EXTRA_DIST = autotools.yy autotools.ll
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils
+DOXYGEN_PROJECTNAME = KDevelop AutoTools Parser
+DOXYGEN_DOCDIRPREFIX = kdevparser
+include ../../../../Doxyfile.am
diff --git a/buildtools/lib/parsers/autotools/autotools.ll b/buildtools/lib/parsers/autotools/autotools.ll
new file mode 100644
index 00000000..ae646edb
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotools.ll
@@ -0,0 +1,136 @@
+%{
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <autotools_yacc.h>
+#include <stdlib.h>
+
+/**
+@file autotools.ll
+Autotools Lexer
+
+There are 3 types of identifiers recognized by this lexer:
+-id_simple: examples of such identifiers are qmake variables and scoped variables
+at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp goo.cpp");
+-id_list: those are "value list identifiers" at the right side in assignments
+(like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp");
+-id_args: function arguments recognized as one identifier
+(example: ""${QMAKE_FILE} is intended only for Windows!""
+in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements).
+.
+
+To recognize those identifiers two additional start conditions are used: list and funcargs.
+
+@note "Not" operator (!) is recognized as a part of an identifier. Linefeeds passed to
+the parser as NEWLINE tokens to preserve file structure but whitespaces are stripped
+so no indentation is preserved by this lexer (and parser).
+
+To debug this lexer, put the line below into the next flex file section.
+%option debug
+*/
+%}
+%option noyywrap
+
+%x list
+%x funcargs
+%x conditional
+
+delim [ \t]
+ws {delim}+
+letter [A-Za-z]
+digit [0-9]
+id_simple ({digit}|{letter}|\!|-|_|\*|\$|@)({letter}|{digit}|\||\!|-|_|\*|\$|\(|\.|\+|\-|\)|\/)*
+id_list [^\n]*\\{ws}*
+id_args [^\n]*\)
+number {digit}+
+comment #.*
+comment_cont {ws}*#.*\n
+id_list_single [^\n]*
+cont \\{ws}*\n
+keywords (if|else|endif|include)
+rule [\t]+[^\n]*
+
+%%
+
+<list,INITIAL>{ws} {}
+<list,INITIAL>{cont} { BEGIN(list); return CONT; }
+{keywords} {
+ yylval.value = yytext;
+ if ( yylval.value == "if" )
+ return IF_KEYWORD;
+
+ if ( yylval.value == "else" )
+ return ELSE_KEYWORD;
+
+ if ( yylval.value == "endif" )
+ return ENDIF_KEYWORD;
+
+ return KEYWORD;
+}
+
+
+{id_simple} { yylval.value = yytext; return (ID_SIMPLE); }
+
+<INITIAL>{rule} {
+ yylval.value = yytext;
+ return RULE;
+}
+
+<list>{id_list} {
+ yylval.value = yytext;
+ yylval.value = yylval.value.mid(0, yylval.value.findRev("\\"));
+ unput('\\');
+ BEGIN(INITIAL);
+ return (ID_LIST);
+ }
+
+<list>{comment_cont} {
+ yylval.value = yytext;
+ BEGIN(list);
+ return (LIST_COMMENT);
+ }
+
+<list>{id_list_single} {
+ yylval.value = yytext;
+ BEGIN(INITIAL);
+ return (ID_LIST_SINGLE);
+ }
+
+<funcargs>{id_args} {
+ yylval.value = yytext;
+ yylval.value = yylval.value.mid(0, yylval.value.length()-1);
+ unput(')');
+ BEGIN(INITIAL);
+ return (ID_ARGS);
+ }
+
+"=" { BEGIN(list); yylval.value = yytext; return EQ; }
+"+=" { BEGIN(list); yylval.value = yytext; return PLUSEQ; }
+"{" { return LCURLY; }
+"}" { return RCURLY; }
+":" { BEGIN(list); yylval.value = yytext; return COLON; }
+<list,INITIAL>"\n" { BEGIN(INITIAL); return NEWLINE; }
+{comment} { yylval.value = yytext; return (COMMENT); }
+
+%%
+
diff --git a/buildtools/lib/parsers/autotools/autotools.yy b/buildtools/lib/parsers/autotools/autotools.yy
new file mode 100644
index 00000000..e124ee85
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotools.yy
@@ -0,0 +1,323 @@
+%{
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+/**
+@file qmake.yy
+Autotools Parser
+
+Simple LALR parser which builds the syntax tree (see @ref Autotools::AST).
+
+@todo Recognize comments after statements like:
+noinst_HEADERS = foo.h #regognize me
+
+@fixme Parser fails on files that do not end with a newline
+@fixme 1 shift/reduce conflict in "line_body" rule
+*/
+
+#include <qvaluestack.h>
+#include "autotoolsast.h"
+
+#define YYSTYPE_IS_DECLARED
+
+using namespace AutoTools;
+
+/**
+The yylval type.
+*/
+struct Result {
+ Result(): node(0) {}
+
+ /**Type of semantic value for simple grammar rules.*/
+ QString value;
+ /**Type of semantic value for grammar rules which are parts of AST.*/
+ AST *node;
+ /**Type of semantic value for "multiline_values" grammar rule.
+ Each line of multiline value is stored as a string in the list.
+
+ For example we have in Makefile.am file:
+ @code
+ foo_SOURCES = foo1.cpp \
+ foo2.cpp \
+ foo3.cpp foo4.cpp
+ @endcode
+ The string list will be populated with three strings:
+ <pre>
+ foo1.cpp
+ foo2.cpp
+ foo3.cpp foo4.cpp
+ </pre>
+ */
+ QStringList values;
+};
+
+typedef Result YYSTYPE;
+
+void yyerror(const char *str) {
+ printf("bison error: %s\n", str);
+}
+
+int yylex();
+
+/**
+The stack to store ProjectAST pointers when a new child
+ProjectAST is created and filled with statements.
+
+Parser creates root ProjectAST for a .pro file, pushes it onto the stack and starts
+adding statements. Each statement is added as a child StatementAST to the ProjectAST
+currently on the top in the stack.
+
+When a scope or function scope statement is parsed, the child ProjectAST is created
+and pushed onto the stack. Therefore all statements which belong to the scope
+or function scope are added as childs to their direct parent (scope or function scope).
+*/
+QValueStack<ProjectAST*> projects;
+
+/**
+The current depth of AST node is stored here.
+AST depth is important to know because automatic indentation can
+be easily implemented (the parser itself looses all information
+about indentation).
+*/
+int depth = 0;
+
+/*
+To debug this parser, put the line below into the next bison file section.
+Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
+%debug
+*/
+%}
+
+%token ID_SIMPLE
+%token ID_LIST
+%token LBRACE
+%token EQ
+%token PLUSEQ
+%token MINUSQE
+%token STAREQ
+%token TILDEEQ
+%token LBRACE
+%token RBRACE
+%token COLON
+%token NUMSIGN
+%token NEWLINE
+%token NUMBER
+%token COMMENT
+%token CONT
+%token DOT
+%token RCURLY
+%token LCURLY
+%token ID_ARGS
+%token LIST_COMMENT
+%token ID_LIST_SINGLE
+%token IF_KEYWORD
+%token ELSE_KEYWORD
+%token ENDIF_KEYWORD
+%token KEYWORD
+%token RULE
+
+%%
+
+project :
+{
+ ProjectAST *projectAST = new ProjectAST();
+ projects.push(projectAST);
+}
+statements
+;
+
+statements : statements statement
+{
+ projects.top()->addChildAST($<node>2);
+
+ if ( $<node>2->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( $<node>2 )->scopedID == "if" )
+ {
+ $<node>2->setDepth(depth);
+ depth++;
+ }
+ else if ( $<node>2->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( $<node>2 )->scopedID == "else" )
+ {
+ --depth;
+ $<node>2->setDepth(depth);
+ ++depth;
+ }
+ else if ( $<node>2->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( $<node>2 )->scopedID == "endif" )
+ {
+ --depth;
+ $<node>2->setDepth(depth);
+ }
+ else
+ $<node>2->setDepth(depth);
+}
+|
+;
+
+statement : variable_assignment
+{
+ $<node>$ = $<node>1;
+}
+| automake_if
+{
+ $<node>$ = $<node>1;
+}
+| else_statement
+{
+ $<node>$ = $<node>1;
+}
+| endif_statement
+{
+ $<node>$ = $<node>1;
+}
+| target
+{
+ $<node>$ = $<node>1;
+}
+| am_rule
+{
+ $<node>$ = $<node>1;
+}
+| include_directive
+{
+ $<node>$ = $<node>1;
+}
+| comment
+{
+ $<node>$ = $<node>1;
+}
+| emptyline
+{
+ $<node>$ = new NewLineAST();
+}
+;
+
+automake_if: IF_KEYWORD scoped_identifier
+{
+ ConditionAST* projectAST = new ConditionAST();
+ projectAST->type = "if";
+ projectAST->conditionName = $<value>2;
+ $<node>$ = projectAST;
+};
+
+endif_statement: ENDIF_KEYWORD
+{
+ ConditionAST* past = new ConditionAST();
+ past->type= "endif";
+ $<node>$ = past;
+}
+| ENDIF_KEYWORD scoped_identifier
+{
+ ConditionAST* past = new ConditionAST();
+ past->type= "endif";
+ past->conditionName = $<value>2;
+ $<node>$ = past;
+}
+;
+
+else_statement: ELSE_KEYWORD
+{
+ ConditionAST* past = new ConditionAST();
+ past->type = "else";
+ $<node>$ = past;
+}
+| ELSE_KEYWORD scoped_identifier
+{
+ ConditionAST* past = new ConditionAST();
+ past->type = "else";
+ past->conditionName = $<value>2;
+ $<node>$ = past;
+}
+;
+
+variable_assignment : scoped_identifier operator multiline_values
+{
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3;
+ $<node>$ = node;
+}
+;
+
+scoped_identifier : ID_SIMPLE scoped_identifier
+{ $<value>$ = $<value>1 + $<value>2; }
+| ID_SIMPLE
+;
+
+multiline_values : multiline_values line_body
+{
+ $<values>$.append($<value>2);
+}
+| { $<values>$.clear(); }
+ ;
+
+line_body : ID_LIST CONT { $<value>$ = $<value>1 + " \\\n"; }
+ | ID_LIST_SINGLE NEWLINE { $<value>$ = $<value>1 + "\n"; }
+ | CONT { $<value>$ = "\\\n"; }
+ | LIST_COMMENT
+ ;
+
+target: scoped_identifier COLON multiline_values
+{
+ AutomakeTargetAST *node = new AutomakeTargetAST();
+ node->target = $<value>1;
+ node->deps = $<values>3;
+ $<node>$ = node;
+}
+;
+
+am_rule: RULE
+{
+ ProjectAST* node = new ProjectAST(ProjectAST::Rule);
+ node->scopedID = $<value>1;
+ $<node>$ = node;
+}
+;
+
+include_directive: KEYWORD scoped_identifier
+{
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->values = QStringList($<value>2);
+ $<node>$ = node;
+}
+;
+
+operator : EQ | PLUSEQ
+;
+
+comment : COMMENT NEWLINE
+{
+ CommentAST *node = new CommentAST();
+ node->comment = $<value>1 + "\n";
+ $<node>$ = node;
+}
+;
+
+emptyline : NEWLINE
+;
+%%
+
+#include "autotools_lex.cpp"
diff --git a/buildtools/lib/parsers/autotools/autotools_lex.cpp b/buildtools/lib/parsers/autotools/autotools_lex.cpp
new file mode 100644
index 00000000..ac307240
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotools_lex.cpp
@@ -0,0 +1,1894 @@
+#line 2 "autotools_lex.cpp"
+
+#line 4 "autotools_lex.cpp"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart(yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int yyleng;
+
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr) )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart (FILE *input_file );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
+void yy_delete_buffer (YY_BUFFER_STATE b );
+void yy_flush_buffer (YY_BUFFER_STATE b );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+
+void *yyalloc (yy_size_t );
+void *yyrealloc (void *,yy_size_t );
+void yyfree (void * );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define yywrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ (yytext_ptr) = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 17
+#define YY_END_OF_BUFFER 18
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[64] =
+ { 0,
+ 0, 0, 8, 8, 0, 0, 0, 0, 18, 17,
+ 1, 15, 1, 4, 16, 17, 14, 10, 17, 4,
+ 4, 12, 13, 8, 1, 8, 6, 17, 9, 5,
+ 1, 1, 1, 4, 4, 16, 11, 0, 2, 4,
+ 4, 3, 4, 8, 6, 1, 8, 8, 7, 6,
+ 6, 0, 9, 4, 4, 4, 6, 6, 4, 4,
+ 4, 4, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 4, 5, 1, 6, 7, 1, 1, 1, 8,
+ 9, 10, 11, 1, 12, 13, 14, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 16, 1, 1,
+ 17, 1, 1, 18, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 1, 20, 1, 1, 21, 1, 19, 19, 22, 23,
+
+ 24, 25, 19, 19, 26, 19, 19, 27, 19, 28,
+ 19, 19, 19, 19, 29, 19, 30, 19, 19, 19,
+ 19, 19, 31, 32, 33, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[34] =
+ { 0,
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1
+ } ;
+
+static yyconst flex_int16_t yy_base[72] =
+ { 0,
+ 0, 0, 32, 51, 34, 36, 0, 0, 155, 156,
+ 38, 156, 42, 67, 0, 137, 156, 156, 45, 23,
+ 31, 156, 156, 133, 63, 38, 98, 134, 133, 0,
+ 58, 59, 62, 0, 0, 0, 156, 101, 156, 112,
+ 117, 0, 117, 118, 104, 105, 65, 67, 156, 110,
+ 113, 127, 126, 110, 106, 104, 117, 124, 104, 93,
+ 99, 96, 156, 144, 146, 148, 109, 97, 83, 150,
+ 72
+ } ;
+
+static yyconst flex_int16_t yy_def[72] =
+ { 0,
+ 63, 1, 64, 64, 65, 65, 66, 66, 63, 63,
+ 67, 63, 63, 63, 68, 63, 63, 63, 63, 14,
+ 14, 63, 63, 69, 69, 70, 69, 71, 71, 67,
+ 67, 67, 63, 14, 14, 68, 63, 63, 63, 14,
+ 14, 14, 14, 69, 69, 69, 70, 70, 63, 70,
+ 69, 71, 71, 14, 14, 14, 69, 70, 14, 14,
+ 14, 14, 0, 63, 63, 63, 63, 63, 63, 63,
+ 63
+ } ;
+
+static yyconst flex_int16_t yy_nxt[190] =
+ { 0,
+ 10, 11, 12, 13, 14, 15, 14, 10, 10, 14,
+ 16, 14, 10, 10, 14, 17, 18, 14, 14, 19,
+ 14, 14, 14, 20, 14, 21, 14, 14, 14, 14,
+ 22, 10, 23, 25, 12, 25, 10, 26, 10, 31,
+ 49, 32, 29, 33, 29, 33, 38, 39, 38, 40,
+ 41, 27, 25, 12, 25, 42, 26, 50, 43, 31,
+ 32, 32, 32, 33, 46, 33, 46, 49, 47, 49,
+ 27, 34, 52, 34, 34, 34, 34, 34, 35, 34,
+ 34, 34, 45, 44, 50, 34, 50, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 36, 34, 51,
+
+ 39, 51, 38, 39, 38, 57, 46, 57, 46, 30,
+ 47, 58, 49, 58, 51, 39, 51, 45, 57, 42,
+ 57, 62, 61, 45, 45, 58, 49, 58, 42, 50,
+ 60, 59, 45, 42, 53, 53, 45, 45, 56, 55,
+ 54, 53, 53, 50, 24, 24, 28, 28, 10, 10,
+ 48, 48, 45, 37, 63, 9, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63
+ } ;
+
+static yyconst flex_int16_t yy_chk[190] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 3, 5, 3, 6, 11,
+ 26, 11, 5, 13, 6, 13, 19, 19, 19, 20,
+ 20, 3, 4, 4, 4, 21, 4, 26, 21, 31,
+ 32, 31, 32, 33, 25, 33, 25, 47, 25, 48,
+ 4, 14, 71, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 25, 69, 47, 14, 48, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 68, 14, 27,
+
+ 27, 27, 38, 38, 38, 45, 46, 45, 46, 67,
+ 46, 50, 50, 50, 51, 51, 51, 27, 57, 62,
+ 57, 61, 60, 45, 46, 58, 58, 58, 59, 50,
+ 56, 55, 51, 54, 53, 52, 57, 44, 43, 41,
+ 40, 29, 28, 58, 64, 64, 65, 65, 66, 66,
+ 70, 70, 24, 16, 9, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "autotools.ll"
+#line 2 "autotools.ll"
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <autotools_yacc.h>
+#include <stdlib.h>
+
+/**
+@file autotools.ll
+Autotools Lexer
+
+There are 3 types of identifiers recognized by this lexer:
+-id_simple: examples of such identifiers are qmake variables and scoped variables
+at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp goo.cpp");
+-id_list: those are "value list identifiers" at the right side in assignments
+(like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp");
+-id_args: function arguments recognized as one identifier
+(example: ""${QMAKE_FILE} is intended only for Windows!""
+in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements).
+.
+
+To recognize those identifiers two additional start conditions are used: list and funcargs.
+
+@note "Not" operator (!) is recognized as a part of an identifier. Linefeeds passed to
+the parser as NEWLINE tokens to preserve file structure but whitespaces are stripped
+so no indentation is preserved by this lexer (and parser).
+
+To debug this lexer, put the line below into the next flex file section.
+%option debug
+*/
+
+
+
+#line 559 "autotools_lex.cpp"
+
+#define INITIAL 0
+#define list 1
+#define funcargs 2
+#define conditional 3
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (void );
+#else
+extern int yywrap (void );
+#endif
+#endif
+
+ static void yyunput (int c,char *buf_ptr );
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 73 "autotools.ll"
+
+
+#line 716 "autotools_lex.cpp"
+
+ if ( (yy_init) )
+ {
+ (yy_init) = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
+
+ /* Support of yytext. */
+ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = (yy_start);
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 64 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 156 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 75 "autotools.ll"
+{}
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+#line 76 "autotools.ll"
+{ BEGIN(list); return CONT; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 77 "autotools.ll"
+{
+ yylval.value = yytext;
+ if ( yylval.value == "if" )
+ return IF_KEYWORD;
+
+ if ( yylval.value == "else" )
+ return ELSE_KEYWORD;
+
+ if ( yylval.value == "endif" )
+ return ENDIF_KEYWORD;
+
+ return KEYWORD;
+}
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 92 "autotools.ll"
+{ yylval.value = yytext; return (ID_SIMPLE); }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 94 "autotools.ll"
+{
+ yylval.value = yytext;
+ return RULE;
+}
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 99 "autotools.ll"
+{
+ yylval.value = yytext;
+ yylval.value = yylval.value.mid(0, yylval.value.findRev("\\"));
+ unput('\\');
+ BEGIN(INITIAL);
+ return (ID_LIST);
+ }
+ YY_BREAK
+case 7:
+/* rule 7 can match eol */
+YY_RULE_SETUP
+#line 107 "autotools.ll"
+{
+ yylval.value = yytext;
+ BEGIN(list);
+ return (LIST_COMMENT);
+ }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 113 "autotools.ll"
+{
+ yylval.value = yytext;
+ BEGIN(INITIAL);
+ return (ID_LIST_SINGLE);
+ }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 119 "autotools.ll"
+{
+ yylval.value = yytext;
+ yylval.value = yylval.value.mid(0, yylval.value.length()-1);
+ unput(')');
+ BEGIN(INITIAL);
+ return (ID_ARGS);
+ }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 127 "autotools.ll"
+{ BEGIN(list); yylval.value = yytext; return EQ; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 128 "autotools.ll"
+{ BEGIN(list); yylval.value = yytext; return PLUSEQ; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 129 "autotools.ll"
+{ return LCURLY; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 130 "autotools.ll"
+{ return RCURLY; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 131 "autotools.ll"
+{ BEGIN(list); yylval.value = yytext; return COLON; }
+ YY_BREAK
+case 15:
+/* rule 15 can match eol */
+YY_RULE_SETUP
+#line 132 "autotools.ll"
+{ BEGIN(INITIAL); return NEWLINE; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 133 "autotools.ll"
+{ yylval.value = yytext; return (COMMENT); }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 135 "autotools.ll"
+ECHO;
+ YY_BREAK
+#line 922 "autotools_lex.cpp"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(list):
+case YY_STATE_EOF(funcargs):
+case YY_STATE_EOF(conditional):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ size_t num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart(yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (void)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 64 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 64 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 63);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yytext */
+ *yy_cp = (yy_hold_char);
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (void)
+#else
+ static int input (void)
+#endif
+
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart(yyin );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ (yy_hold_char) = *++(yy_c_buf_p);
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void yyrestart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+ yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
+ */
+ yyensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy_load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer(b,file );
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ *
+ */
+ void yy_delete_buffer (YY_BUFFER_STATE b )
+{
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yyfree((void *) b->yy_ch_buf );
+
+ yyfree((void *) b );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+
+{
+ int oerrno = errno;
+
+ yy_flush_buffer(b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void yy_flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack();
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void yypop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer(b );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
+{
+
+ return yy_scan_bytes(yy_str,strlen(yy_str) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yyalloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ *
+ */
+int yyget_lineno (void)
+{
+
+ return yylineno;
+}
+
+/** Get the input stream.
+ *
+ */
+FILE *yyget_in (void)
+{
+ return yyin;
+}
+
+/** Get the output stream.
+ *
+ */
+FILE *yyget_out (void)
+{
+ return yyout;
+}
+
+/** Get the length of the current token.
+ *
+ */
+int yyget_leng (void)
+{
+ return yyleng;
+}
+
+/** Get the current token.
+ *
+ */
+
+char *yyget_text (void)
+{
+ return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void yyset_lineno (int line_number )
+{
+
+ yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE * in_str )
+{
+ yyin = in_str ;
+}
+
+void yyset_out (FILE * out_str )
+{
+ yyout = out_str ;
+}
+
+int yyget_debug (void)
+{
+ return yy_flex_debug;
+}
+
+void yyset_debug (int bdebug )
+{
+ yy_flex_debug = bdebug ;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ yyfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yyalloc (yy_size_t size )
+{
+ return (void *) malloc( size );
+}
+
+void *yyrealloc (void * ptr, yy_size_t size )
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr )
+{
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef yytext_ptr
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+#line 135 "autotools.ll"
+
+
+
+
diff --git a/buildtools/lib/parsers/autotools/autotools_yacc.cpp b/buildtools/lib/parsers/autotools/autotools_yacc.cpp
new file mode 100644
index 00000000..f4a3892c
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotools_yacc.cpp
@@ -0,0 +1,1631 @@
+/* A Bison parser, made by GNU Bison 1.875d. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Written by Richard Stallman by simplifying the original so called
+ ``semantic'' parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 0
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ ID_SIMPLE = 258,
+ ID_LIST = 259,
+ LBRACE = 260,
+ EQ = 261,
+ PLUSEQ = 262,
+ MINUSQE = 263,
+ STAREQ = 264,
+ TILDEEQ = 265,
+ RBRACE = 266,
+ COLON = 267,
+ NUMSIGN = 268,
+ NEWLINE = 269,
+ NUMBER = 270,
+ COMMENT = 271,
+ CONT = 272,
+ DOT = 273,
+ RCURLY = 274,
+ LCURLY = 275,
+ ID_ARGS = 276,
+ LIST_COMMENT = 277,
+ ID_LIST_SINGLE = 278,
+ IF_KEYWORD = 279,
+ ELSE_KEYWORD = 280,
+ ENDIF_KEYWORD = 281,
+ KEYWORD = 282,
+ RULE = 283
+ };
+#endif
+#define ID_SIMPLE 258
+#define ID_LIST 259
+#define LBRACE 260
+#define EQ 261
+#define PLUSEQ 262
+#define MINUSQE 263
+#define STAREQ 264
+#define TILDEEQ 265
+#define RBRACE 266
+#define COLON 267
+#define NUMSIGN 268
+#define NEWLINE 269
+#define NUMBER 270
+#define COMMENT 271
+#define CONT 272
+#define DOT 273
+#define RCURLY 274
+#define LCURLY 275
+#define ID_ARGS 276
+#define LIST_COMMENT 277
+#define ID_LIST_SINGLE 278
+#define IF_KEYWORD 279
+#define ELSE_KEYWORD 280
+#define ENDIF_KEYWORD 281
+#define KEYWORD 282
+#define RULE 283
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 1 "autotools.yy"
+
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+/**
+@file qmake.yy
+Autotools Parser
+
+Simple LALR parser which builds the syntax tree (see @ref Autotools::AST).
+
+@todo Recognize comments after statements like:
+noinst_HEADERS = foo.h #regognize me
+
+@fixme Parser fails on files that do not end with a newline
+@fixme 1 shift/reduce conflict in "line_body" rule
+*/
+
+#include <qvaluestack.h>
+#include "autotoolsast.h"
+
+#define YYSTYPE_IS_DECLARED
+
+using namespace AutoTools;
+
+/**
+The yylval type.
+*/
+struct Result {
+ Result(): node(0) {}
+
+ /**Type of semantic value for simple grammar rules.*/
+ QString value;
+ /**Type of semantic value for grammar rules which are parts of AST.*/
+ AST *node;
+ /**Type of semantic value for "multiline_values" grammar rule.
+ Each line of multiline value is stored as a string in the list.
+
+ For example we have in Makefile.am file:
+ @code
+ foo_SOURCES = foo1.cpp \
+ foo2.cpp \
+ foo3.cpp foo4.cpp
+ @endcode
+ The string list will be populated with three strings:
+ <pre>
+ foo1.cpp
+ foo2.cpp
+ foo3.cpp foo4.cpp
+ </pre>
+ */
+ QStringList values;
+};
+
+typedef Result YYSTYPE;
+
+void yyerror(const char *str) {
+ printf("bison error: %s\n", str);
+}
+
+int yylex();
+
+/**
+The stack to store ProjectAST pointers when a new child
+ProjectAST is created and filled with statements.
+
+Parser creates root ProjectAST for a .pro file, pushes it onto the stack and starts
+adding statements. Each statement is added as a child StatementAST to the ProjectAST
+currently on the top in the stack.
+
+When a scope or function scope statement is parsed, the child ProjectAST is created
+and pushed onto the stack. Therefore all statements which belong to the scope
+or function scope are added as childs to their direct parent (scope or function scope).
+*/
+QValueStack<ProjectAST*> projects;
+
+/**
+The current depth of AST node is stored here.
+AST depth is important to know because automatic indentation can
+be easily implemented (the parser itself looses all information
+about indentation).
+*/
+int depth = 0;
+
+/*
+To debug this parser, put the line below into the next bison file section.
+Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
+%debug
+*/
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+typedef int YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations. */
+
+
+/* Line 214 of yacc.c. */
+#line 253 "autotools_yacc.cpp"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+# ifndef YYFREE
+# define YYFREE free
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# endif
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# endif
+# else
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short int yyss;
+ YYSTYPE yyvs;
+ };
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined (__GNUC__) && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+ typedef signed char yysigned_char;
+#else
+ typedef short int yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 3
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 33
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 29
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 18
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 35
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 43
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 283
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const unsigned char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const unsigned char yyprhs[] =
+{
+ 0, 0, 3, 4, 7, 10, 11, 13, 15, 17,
+ 19, 21, 23, 25, 27, 29, 32, 34, 37, 39,
+ 42, 46, 49, 51, 54, 55, 58, 61, 63, 65,
+ 69, 71, 74, 76, 78, 81
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yysigned_char yyrhs[] =
+{
+ 30, 0, -1, -1, 31, 32, -1, 32, 33, -1,
+ -1, 37, -1, 34, -1, 36, -1, 35, -1, 41,
+ -1, 42, -1, 43, -1, 45, -1, 46, -1, 24,
+ 38, -1, 26, -1, 26, 38, -1, 25, -1, 25,
+ 38, -1, 38, 44, 39, -1, 3, 38, -1, 3,
+ -1, 39, 40, -1, -1, 4, 17, -1, 23, 14,
+ -1, 17, -1, 22, -1, 38, 12, 39, -1, 28,
+ -1, 27, 38, -1, 6, -1, 7, -1, 16, 14,
+ -1, 14, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const unsigned short int yyrline[] =
+{
+ 0, 142, 142, 142, 149, 175, 178, 182, 186, 190,
+ 194, 198, 202, 206, 210, 216, 224, 230, 239, 245,
+ 254, 264, 266, 269, 273, 276, 277, 278, 279, 282,
+ 291, 299, 308, 308, 311, 319
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "ID_SIMPLE", "ID_LIST", "LBRACE", "EQ",
+ "PLUSEQ", "MINUSQE", "STAREQ", "TILDEEQ", "RBRACE", "COLON", "NUMSIGN",
+ "NEWLINE", "NUMBER", "COMMENT", "CONT", "DOT", "RCURLY", "LCURLY",
+ "ID_ARGS", "LIST_COMMENT", "ID_LIST_SINGLE", "IF_KEYWORD",
+ "ELSE_KEYWORD", "ENDIF_KEYWORD", "KEYWORD", "RULE", "$accept", "project",
+ "@1", "statements", "statement", "automake_if", "endif_statement",
+ "else_statement", "variable_assignment", "scoped_identifier",
+ "multiline_values", "line_body", "target", "am_rule",
+ "include_directive", "operator", "comment", "emptyline", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const unsigned short int yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const unsigned char yyr1[] =
+{
+ 0, 29, 31, 30, 32, 32, 33, 33, 33, 33,
+ 33, 33, 33, 33, 33, 34, 35, 35, 36, 36,
+ 37, 38, 38, 39, 39, 40, 40, 40, 40, 41,
+ 42, 43, 44, 44, 45, 46
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const unsigned char yyr2[] =
+{
+ 0, 2, 0, 2, 2, 0, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 2, 1, 2, 1, 2,
+ 3, 2, 1, 2, 0, 2, 2, 1, 1, 3,
+ 1, 2, 1, 1, 2, 1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const unsigned char yydefact[] =
+{
+ 2, 0, 5, 1, 3, 22, 35, 0, 0, 18,
+ 16, 0, 30, 4, 7, 9, 8, 6, 0, 10,
+ 11, 12, 13, 14, 21, 34, 15, 19, 17, 31,
+ 32, 33, 24, 24, 29, 20, 0, 27, 28, 0,
+ 23, 25, 26
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yysigned_char yydefgoto[] =
+{
+ -1, 1, 2, 4, 13, 14, 15, 16, 17, 18,
+ 34, 40, 19, 20, 21, 33, 22, 23
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -18
+static const yysigned_char yypact[] =
+{
+ -18, 2, -18, -18, -3, 0, -18, -6, 0, 0,
+ 0, 0, -18, -18, -18, -18, -18, -18, 3, -18,
+ -18, -18, -18, -18, -18, -18, -18, -18, -18, -18,
+ -18, -18, -18, -18, 10, 10, -5, -18, -18, 4,
+ -18, -18, -18
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const yysigned_char yypgoto[] =
+{
+ -18, -18, -18, -18, -18, -18, -18, -18, -18, -4,
+ -17, -18, -18, -18, -18, -18, -18, -18
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+ 5, 24, 3, 5, 26, 27, 28, 29, 25, 30,
+ 31, 6, 41, 7, 36, 32, 35, 0, 42, 0,
+ 0, 8, 9, 10, 11, 12, 0, 37, 0, 0,
+ 0, 0, 38, 39
+};
+
+static const yysigned_char yycheck[] =
+{
+ 3, 5, 0, 3, 8, 9, 10, 11, 14, 6,
+ 7, 14, 17, 16, 4, 12, 33, -1, 14, -1,
+ -1, 24, 25, 26, 27, 28, -1, 17, -1, -1,
+ -1, -1, 22, 23
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const unsigned char yystos[] =
+{
+ 0, 30, 31, 0, 32, 3, 14, 16, 24, 25,
+ 26, 27, 28, 33, 34, 35, 36, 37, 38, 41,
+ 42, 43, 45, 46, 38, 14, 38, 38, 38, 38,
+ 6, 7, 12, 44, 39, 39, 4, 17, 22, 23,
+ 40, 17, 14
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+
+#define YYFAIL goto yyerrlab
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror ("syntax error: cannot back up");\
+ YYERROR; \
+ } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ ((Current).first_line = (Rhs)[1].first_line, \
+ (Current).first_column = (Rhs)[1].first_column, \
+ (Current).last_line = (Rhs)[N].last_line, \
+ (Current).last_column = (Rhs)[N].last_column)
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+# define YYDSYMPRINT(Args) \
+do { \
+ if (yydebug) \
+ yysymprint Args; \
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yysymprint (stderr, \
+ Token, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short int *bottom, short int *top)
+#else
+static void
+yy_stack_print (bottom, top)
+ short int *bottom;
+ short int *top;
+#endif
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (/* Nothing. */; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+ int yyrule;
+#endif
+{
+ int yyi;
+ unsigned int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+ yyrule - 1, yylno);
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (Rule); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ if (yytype < YYNTOKENS)
+ {
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ }
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+}
+
+
+/* Prevent warnings from -Wmissing-prototypes. */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far. */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short int yyssa[YYINITDEPTH];
+ short int *yyss = yyssa;
+ register short int *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK (yyvsp--, yyssp--)
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+
+
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short int *yyss1 = yyss;
+
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short int *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 2:
+#line 142 "autotools.yy"
+ {
+ ProjectAST *projectAST = new ProjectAST();
+ projects.push(projectAST);
+;}
+ break;
+
+ case 4:
+#line 150 "autotools.yy"
+ {
+ projects.top()->addChildAST(yyvsp[0].node);
+
+ if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "if" )
+ {
+ yyvsp[0].node->setDepth(depth);
+ depth++;
+ }
+ else if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "else" )
+ {
+ --depth;
+ yyvsp[0].node->setDepth(depth);
+ ++depth;
+ }
+ else if ( yyvsp[0].node->nodeType() == AST::ProjectAST &&
+ static_cast<ProjectAST*>( yyvsp[0].node )->scopedID == "endif" )
+ {
+ --depth;
+ yyvsp[0].node->setDepth(depth);
+ }
+ else
+ yyvsp[0].node->setDepth(depth);
+;}
+ break;
+
+ case 6:
+#line 179 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 7:
+#line 183 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 8:
+#line 187 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 9:
+#line 191 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 10:
+#line 195 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 11:
+#line 199 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 12:
+#line 203 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 13:
+#line 207 "autotools.yy"
+ {
+ yyval.node = yyvsp[0].node;
+;}
+ break;
+
+ case 14:
+#line 211 "autotools.yy"
+ {
+ yyval.node = new NewLineAST();
+;}
+ break;
+
+ case 15:
+#line 217 "autotools.yy"
+ {
+ ConditionAST* projectAST = new ConditionAST();
+ projectAST->type = "if";
+ projectAST->conditionName = yyvsp[0].value;
+ yyval.node = projectAST;
+;}
+ break;
+
+ case 16:
+#line 225 "autotools.yy"
+ {
+ ConditionAST* past = new ConditionAST();
+ past->type= "endif";
+ yyval.node = past;
+;}
+ break;
+
+ case 17:
+#line 231 "autotools.yy"
+ {
+ ConditionAST* past = new ConditionAST();
+ past->type= "endif";
+ past->conditionName = yyvsp[0].value;
+ yyval.node = past;
+;}
+ break;
+
+ case 18:
+#line 240 "autotools.yy"
+ {
+ ConditionAST* past = new ConditionAST();
+ past->type = "else";
+ yyval.node = past;
+;}
+ break;
+
+ case 19:
+#line 246 "autotools.yy"
+ {
+ ConditionAST* past = new ConditionAST();
+ past->type = "else";
+ past->conditionName = yyvsp[0].value;
+ yyval.node = past;
+;}
+ break;
+
+ case 20:
+#line 255 "autotools.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = yyvsp[-2].value;
+ node->op = yyvsp[-1].value;
+ node->values = yyvsp[0].values;
+ yyval.node = node;
+;}
+ break;
+
+ case 21:
+#line 265 "autotools.yy"
+ { yyval.value = yyvsp[-1].value + yyvsp[0].value; ;}
+ break;
+
+ case 23:
+#line 270 "autotools.yy"
+ {
+ yyval.values.append(yyvsp[0].value);
+;}
+ break;
+
+ case 24:
+#line 273 "autotools.yy"
+ { yyval.values.clear(); ;}
+ break;
+
+ case 25:
+#line 276 "autotools.yy"
+ { yyval.value = yyvsp[-1].value + " \\\n"; ;}
+ break;
+
+ case 26:
+#line 277 "autotools.yy"
+ { yyval.value = yyvsp[-1].value + "\n"; ;}
+ break;
+
+ case 27:
+#line 278 "autotools.yy"
+ { yyval.value = "\\\n"; ;}
+ break;
+
+ case 29:
+#line 283 "autotools.yy"
+ {
+ AutomakeTargetAST *node = new AutomakeTargetAST();
+ node->target = yyvsp[-2].value;
+ node->deps = yyvsp[0].values;
+ yyval.node = node;
+;}
+ break;
+
+ case 30:
+#line 292 "autotools.yy"
+ {
+ ProjectAST* node = new ProjectAST(ProjectAST::Rule);
+ node->scopedID = yyvsp[0].value;
+ yyval.node = node;
+;}
+ break;
+
+ case 31:
+#line 300 "autotools.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = yyvsp[-1].value;
+ node->values = QStringList(yyvsp[0].value);
+ yyval.node = node;
+;}
+ break;
+
+ case 34:
+#line 312 "autotools.yy"
+ {
+ CommentAST *node = new CommentAST();
+ node->comment = yyvsp[-1].value + "\n";
+ yyval.node = node;
+;}
+ break;
+
+
+ }
+
+/* Line 1010 of yacc.c. */
+#line 1403 "autotools_yacc.cpp"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+
+
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ int yytype = YYTRANSLATE (yychar);
+ const char* yyprefix;
+ char *yymsg;
+ int yyx;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 0;
+
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
+ yycount += 1;
+ if (yycount == 5)
+ {
+ yysize = 0;
+ break;
+ }
+ }
+ yysize += (sizeof ("syntax error, unexpected ")
+ + yystrlen (yytname[yytype]));
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[yytype]);
+
+ if (yycount < 5)
+ {
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yyp = yystpcpy (yyp, yyprefix);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yyprefix = " or ";
+ }
+ }
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror ("syntax error; also virtual memory exhausted");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror ("syntax error");
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* If at end of input, pop the error token,
+ then the rest of the stack, then return failure. */
+ if (yychar == YYEOF)
+ for (;;)
+ {
+ YYPOPSTACK;
+ if (yyssp == yyss)
+ YYABORT;
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[*yyssp], yyvsp);
+ }
+ }
+ else
+ {
+ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+ yydestruct (yytoken, &yylval);
+ yychar = YYEMPTY;
+
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+#ifdef __GNUC__
+ /* Pacify GCC when the user code never invokes YYERROR and the label
+ yyerrorlab therefore never appears in user code. */
+ if (0)
+ goto yyerrorlab;
+#endif
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[yystate], yyvsp);
+ YYPOPSTACK;
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here. |
+`----------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+
+
+#line 321 "autotools.yy"
+
+
+#include "autotools_lex.cpp"
+
diff --git a/buildtools/lib/parsers/autotools/autotools_yacc.h b/buildtools/lib/parsers/autotools/autotools_yacc.h
new file mode 100644
index 00000000..b8becb4a
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotools_yacc.h
@@ -0,0 +1,100 @@
+/* A Bison parser, made by GNU Bison 1.875d. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ ID_SIMPLE = 258,
+ ID_LIST = 259,
+ LBRACE = 260,
+ EQ = 261,
+ PLUSEQ = 262,
+ MINUSQE = 263,
+ STAREQ = 264,
+ TILDEEQ = 265,
+ RBRACE = 266,
+ COLON = 267,
+ NUMSIGN = 268,
+ NEWLINE = 269,
+ NUMBER = 270,
+ COMMENT = 271,
+ CONT = 272,
+ DOT = 273,
+ RCURLY = 274,
+ LCURLY = 275,
+ ID_ARGS = 276,
+ LIST_COMMENT = 277,
+ ID_LIST_SINGLE = 278,
+ IF_KEYWORD = 279,
+ ELSE_KEYWORD = 280,
+ ENDIF_KEYWORD = 281,
+ KEYWORD = 282,
+ RULE = 283
+ };
+#endif
+#define ID_SIMPLE 258
+#define ID_LIST 259
+#define LBRACE 260
+#define EQ 261
+#define PLUSEQ 262
+#define MINUSQE 263
+#define STAREQ 264
+#define TILDEEQ 265
+#define RBRACE 266
+#define COLON 267
+#define NUMSIGN 268
+#define NEWLINE 269
+#define NUMBER 270
+#define COMMENT 271
+#define CONT 272
+#define DOT 273
+#define RCURLY 274
+#define LCURLY 275
+#define ID_ARGS 276
+#define LIST_COMMENT 277
+#define ID_LIST_SINGLE 278
+#define IF_KEYWORD 279
+#define ELSE_KEYWORD 280
+#define ENDIF_KEYWORD 281
+#define KEYWORD 282
+#define RULE 283
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+typedef int YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
+
+
diff --git a/buildtools/lib/parsers/autotools/autotoolsast.cpp b/buildtools/lib/parsers/autotools/autotoolsast.cpp
new file mode 100644
index 00000000..71596e3d
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotoolsast.cpp
@@ -0,0 +1,117 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "autotoolsast.h"
+
+namespace AutoTools {
+
+//AST
+
+AST::~AST()
+{
+ for (QValueList<AST*>::iterator it = m_children.begin(); it != m_children.end(); ++it)
+ {
+ AST *node = *it;
+ delete node;
+ }
+}
+
+void AST::addChildAST(AST *node)
+{
+ m_children.append(node);
+}
+
+void AST::writeBack(QString &buffer)
+{
+ for (QValueList<AST*>::const_iterator it = m_children.constBegin();
+ it != m_children.constEnd(); ++it)
+ {
+ if (*it)
+ (*it)->writeBack(buffer);
+ }
+}
+
+QString AST::indentation()
+{
+ QString result;
+ for (int i = 0; i < depth(); i++)
+ result += '\t';
+ return result;
+}
+
+bool AST::hasChildren() const
+{
+ return !m_children.isEmpty();
+}
+
+QValueList<AST*> AST::children() const
+{
+ return m_children;
+}
+
+//ProjectAST
+
+void ProjectAST::writeBack(QString &buffer)
+{
+ if ( isRule() )
+ buffer += scopedID;
+ else
+ buffer += indentation();
+
+ AST::writeBack(buffer);
+
+}
+
+void ProjectAST::addChildAST(AST *node)
+{
+ statements.append(node);
+ AST::addChildAST(node);
+}
+
+void AssignmentAST::writeBack(QString &buffer)
+{
+ buffer += indentation() + scopedID + " " + op + values.join("");
+}
+
+void AutomakeTargetAST::writeBack( QString& buffer )
+{
+ buffer += target + ":" + deps.join("");
+}
+
+void ConditionAST::writeBack( QString& buffer )
+{
+ buffer += indentation() + type + " " + conditionName;
+}
+
+void NewLineAST::writeBack(QString &buffer)
+{
+ buffer += "\n";
+}
+
+void CommentAST::writeBack(QString &buffer)
+{
+ buffer += indentation() + comment;
+}
+
+}
+
+// kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/buildtools/lib/parsers/autotools/autotoolsast.h b/buildtools/lib/parsers/autotools/autotoolsast.h
new file mode 100644
index 00000000..c92c17c7
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotoolsast.h
@@ -0,0 +1,269 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef AUTOTOOLSAST_H
+#define AUTOTOOLSAST_H
+
+#include <qstringlist.h>
+
+/**
+@file autotools.h
+Abstract Syntax Tree (AST) class declarations.
+*/
+
+namespace AutoTools
+{
+
+/**
+ * AST node.
+ * This is the base class. Objects of this type are not created by the parser.
+ *
+ * Each AST node holds the list of its children which are always deleted in the
+ * destructor. This way, it's possible call delete for only root AST node and
+ * others will be deleted automatically.
+ *
+ * Each AST node also knows how to write the information back into .pro file.
+ */
+class AST
+{
+public:
+ /**Type of AST node.*/
+ enum NodeType {
+ ProjectAST, ///< Project, scope or function scope.
+ AssignmentAST, ///< Variable assignment.
+ TargetAST, ///< Automake target
+ MakefileConditionalAST, ///< Makefile.am conditional
+ NewLineAST, ///< Line feed.
+ CommentAST ///< Comment.
+ };
+
+ /** Constructs AST with given node type.*/
+ AST(NodeType nodeType): m_nodeType(nodeType), m_depth(0) {}
+ virtual ~AST();
+
+ /**
+ * Adds child AST node to this node. Despite this function is virtual,
+ * reimplementations should call it to make automatic destruction of
+ * AST tree possible.*/
+ virtual void addChildAST(AST *node);
+
+ /**
+ * Writes information stored in the AST into the @p buffer.
+ * This is a default implementation which iterates over child nodes
+ * and calls writeBack for each child node.
+ */
+ virtual void writeBack(QString &buffer);
+
+ /** @return The type of the node.*/
+ virtual NodeType nodeType() const { return m_nodeType; }
+
+ /** Sets the depth of the node in AST.*/
+ void setDepth(int depth) { m_depth = depth; }
+
+ /** @return The depth of the node in AST.*/
+ int depth() const { return m_depth; }
+
+ /** @return The indentation string based on node depth.*/
+ virtual QString indentation();
+
+ //! \return true if this AST has children
+ bool hasChildren() const;
+
+ /**
+ * Get the children of this ast
+ * \return the list of this ast's childre
+ */
+ QValueList<AST*> children() const;
+
+
+
+protected:
+ NodeType m_nodeType;
+ QValueList<AST*> m_children;
+
+private:
+ int m_depth;
+
+};
+
+
+/**
+ * Project AST node.
+ * Represents complete projects, scopes and function scopes.
+ * Examples:
+ * @code
+ * scopename{
+ * var=value
+ * }
+ * function(args){
+ * var=value
+ * }
+ * @endcode
+ */
+class ProjectAST: public AST
+{
+public:
+ /**The kind of a project node.*/
+ enum Kind
+ {
+ Project, ///< Project
+ Target, ///< Custom Automake Target
+ ConditionalScope, ///< Automake Conditional
+ Rule, ///< Automake Rule
+ Empty ///< Project does not exist. the AST is empty
+ };
+
+ /** Constructs a project node of given @p kind. */
+ ProjectAST(Kind kind = Project): AST(AST::ProjectAST), m_kind(kind) {}
+
+ virtual void writeBack(QString &buffer);
+ virtual void addChildAST(AST *node);
+
+ /** @return true if this node is a project.*/
+ bool isProject() const { return m_kind == Project; }
+
+ bool isRule() const { return m_kind == Rule; }
+
+ /** @return true if this node is an automake conditional */
+ bool isConditionalScope() const { return m_kind == ConditionalScope; }
+
+ /** @return true if this node is empty.*/
+ bool isEmpty() const { return m_kind == Empty; }
+
+ /**Scoped identifier (scope name or rule).*/
+ QString scopedID;
+
+ /**Function arguments. Empty for other kinds of projects.*/
+ QString args;
+
+ /** The automake conditional has an else attached */
+ bool hasElse;
+
+ /**List of statements.*/
+ QValueList<AutoTools::AST*> statements;
+
+private:
+ Kind m_kind;
+
+};
+
+
+/**
+ * Assignment AST node.
+ * Represents assignments, for example:
+ * \code
+ * var=value
+ * \endcode
+ *
+ * Values can be specified on several lines and
+ * each line is stored as a string in the list of values.@n
+ * For example, if we have in .pro:
+ * \code
+ * SOURCES=a.cpp \
+ * b.cpp c.cpp
+ * \endcode
+ * then values will be stored as a two elements list:
+ * \code
+ * a.cpp
+ * b.cpp c.cpp
+ * \endcode
+ */
+class AssignmentAST: public AST
+{
+public:
+ AssignmentAST(): AST(AST::AssignmentAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+ /**Scoped name of the variable.*/
+ QString scopedID;
+
+ /**Operator.*/
+ QString op;
+
+ /**List of values.*/
+ QStringList values;
+};
+
+class AutomakeTargetAST : public AST
+{
+public:
+ AutomakeTargetAST() : AST(AST::TargetAST) {}
+
+ virtual void writeBack( QString& buffer );
+
+ /// The name of the target
+ QString target;
+
+ /// The dependencies for the target, if any
+ QStringList deps;
+};
+
+class ConditionAST : public AST
+{
+public:
+ ConditionAST() : AST( AST::MakefileConditionalAST ) {}
+
+ virtual void writeBack( QString& buffer );
+
+ /// The keyword for the condition (if, else, endif)
+ QString type;
+
+ /// The name of the condition
+ QString conditionName;
+};
+
+/**
+ * New line AST node.
+ * Represents line feeds in files.
+ */
+class NewLineAST: public AST
+{
+public:
+ NewLineAST(): AST(AST::NewLineAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+};
+
+
+/**
+ * Comment AST node.
+ * Represents comments.
+ */
+class CommentAST: public AST
+{
+public:
+ CommentAST(): AST(AST::CommentAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+ /**Comment text.*/
+ QString comment;
+
+};
+
+}
+
+#endif
+
+// kate: indent-mode csands; space-indent off; tab-width 4; auto-insert-doxygen on;
diff --git a/buildtools/lib/parsers/autotools/autotoolsdriver.cpp b/buildtools/lib/parsers/autotools/autotoolsdriver.cpp
new file mode 100644
index 00000000..8ec643ab
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotoolsdriver.cpp
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "autotoolsdriver.h"
+#include "autotoolsast.h"
+
+#include <stdio.h>
+#include <qvaluestack.h>
+#include <kio/netaccess.h>
+
+extern FILE *yyin, *yyout;
+extern int yyparse();
+//extern int yydebug;
+extern QValueStack<AutoTools::ProjectAST *> projects;
+
+namespace AutoTools {
+
+int Driver::parseFile(const char *fileName, ProjectAST **ast)
+{
+ //yydebug = 1;
+ yyin = fopen(fileName, "r");
+ if (yyin == 0)
+ {
+ ast = 0;
+ return 1;
+ }
+ int ret = yyparse();
+ *ast = projects.top();
+ fclose(yyin);
+ return ret;
+}
+
+int Driver::parseFile(QString fileName, ProjectAST **ast)
+{
+ return parseFile(fileName.ascii(), ast);
+}
+
+int Driver::parseFile(KURL fileName, ProjectAST **ast)
+{
+ QString tmpFile;
+ int ret = 0;
+ if (KIO::NetAccess::download(fileName, tmpFile, 0))
+ ret = parseFile(tmpFile, ast);
+ KIO::NetAccess::removeTempFile(tmpFile);
+ return ret;
+}
+
+}
+
+//kate: indent-mode csands; space-indent off; tab-width 4;
+
diff --git a/buildtools/lib/parsers/autotools/autotoolsdriver.h b/buildtools/lib/parsers/autotools/autotoolsdriver.h
new file mode 100644
index 00000000..eba0a823
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/autotoolsdriver.h
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * Copyright (c) 2005 by Matt Rogers *
+ * mattr@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QMAKEQMAKEDRIVER_H
+#define QMAKEQMAKEDRIVER_H
+
+#include <qvaluelist.h>
+#include <kurl.h>
+
+namespace AutoTools {
+
+/**
+@file autotoolsdriver.h
+Driver for a qmake parser.
+*/
+
+class ProjectAST;
+
+/**
+ * Driver.
+ * Use methods of this class to lauch parsing and build the AST.
+ */
+class Driver
+{
+public:
+ /**
+ * Parses the file @p fileName and stores the resulting ProjectAST root
+ * into @p ast. @p ast should not be initialized before. Driver will
+ * initialize it on its own.
+ * @return The result of parsing. Result is 0 on success and <> 0 on failure.
+ */
+ static int parseFile(const char *fileName, ProjectAST **ast);
+ static int parseFile(QString fileName, ProjectAST **ast);
+ static int parseFile(KURL fileName, ProjectAST **ast);
+
+/* template<class Op>
+ static void walkAST(Op &op, const ProjectAST *ast)
+ {
+// op(ast);
+ for (QValueList<QMake::AST*>::const_iterator it = ast->statements.constBegin();
+ it != ast->statements.constEnd(); ++it)
+ {
+ const AST *child = *it;
+ if (child->nodeType() == AST::ProjectAST)
+ walkAST<Op>(op, static_cast<const QMake::ProjectAST*>(child));
+ else
+ op(child);
+ }
+ }
+*/
+};
+
+}
+
+#endif
+
+// kate: indent-mode csands; tab-width 4; space-indent off; auto-insert-doxygen on;
diff --git a/buildtools/lib/parsers/autotools/tests/Makefile.am b/buildtools/lib/parsers/autotools/tests/Makefile.am
new file mode 100644
index 00000000..222a0482
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/Makefile.am
@@ -0,0 +1,21 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets/propeditor \
+ -I$(top_srcdir)/buildtools/lib/parsers/autotools \
+ -I$(top_builddir)/buildtools/lib/parsers/autotools/tests \
+ $(all_includes)
+
+METASOURCES = AUTO
+
+check_PROGRAMS = runner viewer
+
+runner_LDFLAGS = $(all_libraries) $(LIB_KDECORE) $(KDE_RPATH)
+runner_LDADD = $(top_builddir)/buildtools/lib/parsers/autotools/libkdevautotoolsparser.la
+runner_SOURCES = runner.cpp
+
+viewer_LDFLAGS = $(all_libraries) $(LIB_KDECORE) $(KDE_RPATH)
+viewer_LDADD = $(top_builddir)/buildtools/lib/parsers/autotools/libkdevautotoolsparser.la
+viewer_SOURCES = viewer.cpp viewer_main.cpp viewerbase.ui
diff --git a/buildtools/lib/parsers/autotools/tests/runner.cpp b/buildtools/lib/parsers/autotools/tests/runner.cpp
new file mode 100644
index 00000000..cf9f68d1
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/runner.cpp
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <autotoolsast.h>
+#include <autotoolsdriver.h>
+
+using namespace AutoTools;
+
+int main(int argc, char *argv[])
+{
+ ProjectAST *projectAST;
+ if (argc > 1)
+ return Driver::parseFile(argv[1], &projectAST);
+ else
+ return 0;
+}
+
diff --git a/buildtools/lib/parsers/autotools/tests/viewer.cpp b/buildtools/lib/parsers/autotools/tests/viewer.cpp
new file mode 100644
index 00000000..047e6b28
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/viewer.cpp
@@ -0,0 +1,162 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "viewer.h"
+
+#include <qdir.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qfiledialog.h>
+#include <qtextedit.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qlistview.h>
+#include <qtabwidget.h>
+
+#include <autotoolsast.h>
+#include <autotoolsdriver.h>
+
+using namespace AutoTools;
+
+Viewer::Viewer(QWidget *parent, const char *name)
+ :ViewerBase(parent, name)
+{
+ if (QFile::exists(QDir::currentDirPath() + "/" + "qtlist"))
+ {
+ QFile f(QDir::currentDirPath() + "/" + "qtlist");
+ f.open(IO_ReadOnly);
+ QTextStream str(&f);
+ while (!str.eof())
+ files->insertItem(str.readLine());
+ }
+ ast->setSorting(-1);
+ parentProject.push((QListViewItem*)0);
+}
+
+void Viewer::addAll_clicked()
+{
+ if (allLocation->text().isEmpty())
+ return;
+ QDir d(allLocation->text());
+ QStringList l = d.entryList("*.am");
+ for (QStringList::iterator it = l.begin(); it != l.end(); ++it)
+ (*it) = QDir::cleanDirPath(allLocation->text() + "/" + (*it));
+ files->insertStringList(l);
+}
+
+void Viewer::choose_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName(QDir::currentDirPath(), "*.am", this);
+ if (!fileName.isEmpty())
+ files->insertItem(fileName);
+}
+
+void Viewer::files_currentChanged(QListBoxItem* item)
+{
+ ast->clear();
+
+ QFile f(item->text());
+ f.open(IO_ReadOnly);
+ QTextStream str(&f);
+ source->setText(str.read());
+ f.close();
+
+ int result = Driver::parseFile(item->text().ascii(), &projectAST);
+ if (projectAST && (result == 0))
+ {
+ processAST(projectAST);
+ }
+ if (tabWidget2->currentPageIndex() == 1)
+ tabWidget2_selected("Source to be written back");
+}
+
+void Viewer::tabWidget2_selected(const QString& text)
+{
+ if ((text == "Source to be written back") && projectAST)
+ {
+ QString buffer;
+ projectAST->writeBack(buffer);
+ writeBack->setText(buffer);
+ }
+}
+
+void Viewer::processAST(ProjectAST *projectAST, QListViewItem *globAfter)
+{
+ QListViewItem *projectIt;
+ if (!parentProject.top())
+ projectIt = new QListViewItem(ast, "Project");
+ else
+ {
+ if ( projectAST->isConditionalScope() || projectAST->isRule() )
+ projectIt = new QListViewItem(parentProject.top(), globAfter, projectAST->scopedID);
+ }
+ projectIt->setOpen(true);
+
+ QListViewItem *after = 0;
+ for (QValueList<AST*>::const_iterator it = projectAST->statements.constBegin();
+ it != projectAST->statements.constEnd(); ++it)
+ {
+ AST *ast = *it;
+ if (ast == 0)
+ continue;
+ switch (ast->nodeType()) {
+ case AST::AssignmentAST: {
+ AssignmentAST *assignmentAST = static_cast<AssignmentAST*>(ast);
+ QListViewItem *item = new QListViewItem(projectIt, after,
+ assignmentAST->scopedID, assignmentAST->op, assignmentAST->values.join(""));
+ item->setMultiLinesEnabled(true);
+ after = item; }
+ break;
+
+ case AST::TargetAST:
+ {
+ AutomakeTargetAST* ata = static_cast<AutomakeTargetAST*>(ast);
+ QListViewItem* item = new QListViewItem(projectIt, after,
+ ata->target, QString::null, ata->deps.join(""));
+ after = item;
+ }
+ break;
+
+ case AST::NewLineAST:
+// after = new QListViewItem(projectIt, after, "<newline>");
+ break;
+
+ case AST::CommentAST:
+// after = new QListViewItem(projectIt, after, "<comment>");
+ break;
+
+ case AST::MakefileConditionalAST:
+ {
+ ConditionAST* ata = static_cast<ConditionAST*>(ast);
+ QListViewItem* item = new QListViewItem(projectIt, after,
+ ata->type, ata->conditionName, QString::null );
+ after = item;
+ }
+ case AST::ProjectAST: {
+ ProjectAST *projectAST = static_cast<ProjectAST*>(ast);
+ parentProject.push(projectIt);
+ processAST(projectAST, after);
+ parentProject.pop(); }
+ break;
+ }
+ }
+}
+
+#include "viewer.moc"
+
diff --git a/buildtools/lib/parsers/autotools/tests/viewer.h b/buildtools/lib/parsers/autotools/tests/viewer.h
new file mode 100644
index 00000000..46698483
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/viewer.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef VIEWER_H
+#define VIEWER_H
+
+#include <qvaluestack.h>
+
+#include "viewerbase.h"
+
+namespace AutoTools { class ProjectAST; }
+
+class QListViewItem;
+
+class Viewer: public ViewerBase {
+Q_OBJECT
+public:
+ Viewer(QWidget *parent = 0, const char *name = 0);
+ void processAST(AutoTools::ProjectAST *projectAST, QListViewItem *globAfter = 0);
+public slots:
+ virtual void tabWidget2_selected(const QString&);
+ virtual void files_currentChanged(QListBoxItem*);
+ virtual void choose_clicked();
+ virtual void addAll_clicked();
+private:
+ AutoTools::ProjectAST *projectAST;
+ QValueStack<QListViewItem *> parentProject;
+};
+
+#endif
diff --git a/buildtools/lib/parsers/autotools/tests/viewer_main.cpp b/buildtools/lib/parsers/autotools/tests/viewer_main.cpp
new file mode 100644
index 00000000..32641eff
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/viewer_main.cpp
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <qapplication.h>
+#include "viewer.h"
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ Viewer viewer;
+ app.setMainWidget(&viewer);
+ viewer.show();
+ viewer.resize(800, 600);
+ //viewer.setWindowState(viewer.windowState() | Qt::WindowMaximized);
+
+ return app.exec();
+}
diff --git a/buildtools/lib/parsers/autotools/tests/viewerbase.ui b/buildtools/lib/parsers/autotools/tests/viewerbase.ui
new file mode 100644
index 00000000..7c228299
--- /dev/null
+++ b/buildtools/lib/parsers/autotools/tests/viewerbase.ui
@@ -0,0 +1,220 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ViewerBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ViewerBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Viewer</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="1" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>source</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>2</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Parse Tree</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value 2</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>ast</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Source to Be Written Back</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit" row="0" column="0">
+ <property name="name">
+ <cstring>writeBack</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLineEdit" row="0" column="0">
+ <property name="name">
+ <cstring>allLocation</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>32767</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>addAll</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Add All From Directory</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>choose</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Choose File to Add...</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="3" column="0">
+ <property name="name">
+ <cstring>files</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>150</width>
+ <height>32767</height>
+ </size>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>addAll</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>addAll_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>choose</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>choose_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>files</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>files_currentChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>tabWidget2</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>tabWidget2_selected(const QString&amp;)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>addAll_clicked()</slot>
+ <slot>choose_clicked()</slot>
+ <slot>files_currentChanged(QListBoxItem*)</slot>
+ <slot>tabWidget2_selected(const QString&amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/buildtools/lib/parsers/qmake/FlexLexer.h b/buildtools/lib/parsers/qmake/FlexLexer.h
new file mode 100644
index 00000000..1db844da
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/FlexLexer.h
@@ -0,0 +1,205 @@
+
+// -*-C++-*-
+// FlexLexer.h -- define interfaces for lexical analyzer classes generated
+// by flex
+
+// Copyright (c) 1993 The Regents of the University of California.
+// All rights reserved.
+//
+// This code is derived from software contributed to Berkeley by
+// Kent Williams and Tom Epperly.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+
+// Neither the name of the University nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+
+// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE.
+
+// This file defines FlexLexer, an abstract class which specifies the
+// external interface provided to flex C++ lexer objects, and yyFlexLexer,
+// which defines a particular lexer class.
+//
+// If you want to create multiple lexer classes, you use the -P flag
+// to rename each yyFlexLexer to some other xxFlexLexer. You then
+// include <FlexLexer.h> in your other sources once per lexer class:
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer xxFlexLexer
+// #include <FlexLexer.h>
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer zzFlexLexer
+// #include <FlexLexer.h>
+// ...
+
+#ifndef __FLEX_LEXER_H
+// Never included before - need to define base class.
+#define __FLEX_LEXER_H
+
+#include <iostream>
+# ifndef FLEX_STD
+# define FLEX_STD std::
+# endif
+
+extern "C++" {
+
+struct yy_buffer_state;
+typedef int yy_state_type;
+
+class FlexLexer {
+public:
+ virtual ~FlexLexer() { }
+
+ const char* YYText() const { return yytext; }
+ int YYLeng() const { return yyleng; }
+
+ virtual void
+ yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
+ virtual struct yy_buffer_state*
+ yy_create_buffer( FLEX_STD istream* s, int size ) = 0;
+ virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
+ virtual void yyrestart( FLEX_STD istream* s ) = 0;
+
+ virtual int yylex() = 0;
+
+ // Call yylex with new input/output sources.
+ int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 )
+ {
+ switch_streams( new_in, new_out );
+ return yylex();
+ }
+
+ // Switch to new input/output streams. A nil stream pointer
+ // indicates "keep the current one".
+ virtual void switch_streams( FLEX_STD istream* new_in = 0,
+ FLEX_STD ostream* new_out = 0 ) = 0;
+
+ int lineno() const { return yylineno; }
+
+ int debug() const { return yy_flex_debug; }
+ void set_debug( int flag ) { yy_flex_debug = flag; }
+
+protected:
+ char* yytext;
+ int yyleng;
+ int yylineno; // only maintained if you use %option yylineno
+ int yy_flex_debug; // only has effect with -d or "%option debug"
+};
+
+}
+#endif
+
+#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
+// Either this is the first time through (yyFlexLexerOnce not defined),
+// or this is a repeated include to define a different flavor of
+// yyFlexLexer, as discussed in the flex man page.
+#define yyFlexLexerOnce
+
+extern "C++" {
+
+class yyFlexLexer : public FlexLexer {
+public:
+ // arg_yyin and arg_yyout default to the cin and cout, but we
+ // only make that assignment when initializing in yylex().
+ yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 );
+
+ virtual ~yyFlexLexer();
+
+ void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
+ struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size );
+ void yy_delete_buffer( struct yy_buffer_state* b );
+ void yyrestart( FLEX_STD istream* s );
+
+ void yypush_buffer_state( struct yy_buffer_state* new_buffer );
+ void yypop_buffer_state(void);
+
+ virtual int yylex();
+ virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out );
+
+protected:
+ virtual int LexerInput( char* buf, int max_size );
+ virtual void LexerOutput( const char* buf, int size );
+ virtual void LexerError( const char* msg );
+
+ void yyunput( int c, char* buf_ptr );
+ int yyinput();
+
+ void yy_load_buffer_state();
+ void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream* s );
+ void yy_flush_buffer( struct yy_buffer_state* b );
+
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int* yy_start_stack;
+
+ void yy_push_state( int new_state );
+ void yy_pop_state();
+ int yy_top_state();
+
+ yy_state_type yy_get_previous_state();
+ yy_state_type yy_try_NUL_trans( yy_state_type current_state );
+ int yy_get_next_buffer();
+
+ FLEX_STD istream* yyin; // input source for default LexerInput
+ FLEX_STD ostream* yyout; // output sink for default LexerOutput
+
+ // yy_hold_char holds the character lost when yytext is formed.
+ char yy_hold_char;
+
+ // Number of characters read into yy_ch_buf.
+ int yy_n_chars;
+
+ // Points to current character in buffer.
+ char* yy_c_buf_p;
+
+ int yy_init; // whether we need to initialize
+ int yy_start; // start state number
+
+ // Flag which is used to allow yywrap()'s to do buffer switches
+ // instead of setting up a fresh yyin. A bit of a hack ...
+ int yy_did_buffer_switch_on_eof;
+
+
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */
+ void yyensure_buffer_stack(void);
+
+ // The following are not always needed, but may be depending
+ // on use of certain flex features (like REJECT or yymore()).
+
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ yy_state_type* yy_state_buf;
+ yy_state_type* yy_state_ptr;
+
+ char* yy_full_match;
+ int* yy_full_state;
+ int yy_full_lp;
+
+ int yy_lp;
+ int yy_looking_for_trail_begin;
+
+ int yy_more_flag;
+ int yy_more_len;
+ int yy_more_offset;
+ int yy_prev_more_offset;
+};
+
+}
+
+#endif
diff --git a/buildtools/lib/parsers/qmake/Mainpage.dox b/buildtools/lib/parsers/qmake/Mainpage.dox
new file mode 100644
index 00000000..7b2e2682
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/Mainpage.dox
@@ -0,0 +1,16 @@
+/**
+@mainpage The KDevelop QMake Parser
+
+This library contains qmake parser.
+
+<b>Link with</b>: -lkdevqmakeparser
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/buildtools/parsers/qmake
+
+\section qmakeparseroverview Overview
+Here resides a parser for qmake .pro (.pri) files. This parser
+reads project files, builds an AST which then can be written
+back to the project file.
+
+*/
+
diff --git a/buildtools/lib/parsers/qmake/Makefile.am b/buildtools/lib/parsers/qmake/Makefile.am
new file mode 100644
index 00000000..fd80170c
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/Makefile.am
@@ -0,0 +1,31 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+#SUBDIRS = tests
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets/propeditor \
+ $(all_includes)
+METASOURCES = AUTO
+lib_LTLIBRARIES = libkdevqmakeparser.la
+libkdevqmakeparser_la_LDFLAGS = -no-undefined $(all_libraries) $(LIB_KIO)
+libkdevqmakeparser_la_SOURCES = qmake_lex.cpp qmake_yacc.cpp qmakeast.cpp \
+ qmakeastvisitor.cpp qmakedriver.cpp
+
+kdevelopbuildtoolsincludedir = $(includedir)/kdevelop/buildtools/parsers/qmake
+kdevelopbuildtoolsinclude_HEADERS = qmakeast.h qmakedriver.h qmakeastvisitor.h
+
+parser:
+ cd $(srcdir) ; \
+ bison -d qmake.yy -r all -k -t -oqmake_yacc.cpp ; \
+ flex -d -oqmake_lex.cpp qmake.ll
+
+EXTRA_DIST = qmake.yy qmake.ll
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils
+DOXYGEN_PROJECTNAME = KDevelop QMake parser
+DOXYGEN_DOCDIRPREFIX = kdevparser
+include ../../../../Doxyfile.am
+
+noinst_HEADERS = qmake.ll qmake.yy qmake_lex.h
diff --git a/buildtools/lib/parsers/qmake/location.hh b/buildtools/lib/parsers/qmake/location.hh
new file mode 100644
index 00000000..4da36b8a
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/location.hh
@@ -0,0 +1,145 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Locations for Bison parsers in C++
+
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/**
+ ** \file location.hh
+ ** Define the QMake::location class.
+ */
+
+#ifndef BISON_LOCATION_HH
+# define BISON_LOCATION_HH
+
+# include <iostream>
+# include <string>
+# include "position.hh"
+
+namespace QMake
+{
+
+ /// Abstract a location.
+ class location
+ {
+ public:
+
+ /// Construct a location.
+ location ()
+ : begin (), end ()
+ {
+ }
+
+
+ /// Initialization.
+ inline void initialize (std::string* fn)
+ {
+ begin.initialize (fn);
+ end = begin;
+ }
+
+ /** \name Line and Column related manipulators
+ ** \{ */
+ public:
+ /// Reset initial location to final location.
+ inline void step ()
+ {
+ begin = end;
+ }
+
+ /// Extend the current location to the COUNT next columns.
+ inline void columns (unsigned int count = 1)
+ {
+ end += count;
+ }
+
+ /// Extend the current location to the COUNT next lines.
+ inline void lines (unsigned int count = 1)
+ {
+ end.lines (count);
+ }
+ /** \} */
+
+
+ public:
+ /// Beginning of the located region.
+ position begin;
+ /// End of the located region.
+ position end;
+ };
+
+ /// Join two location objects to create a location.
+ inline const location operator+ (const location& begin, const location& end)
+ {
+ location res = begin;
+ res.end = end.end;
+ return res;
+ }
+
+ /// Add two location objects.
+ inline const location operator+ (const location& begin, unsigned int width)
+ {
+ location res = begin;
+ res.columns (width);
+ return res;
+ }
+
+ /// Add and assign a location.
+ inline location& operator+= (location& res, unsigned int width)
+ {
+ res.columns (width);
+ return res;
+ }
+
+ /** \brief Intercept output stream redirection.
+ ** \param ostr the destination output stream
+ ** \param loc a reference to the location to redirect
+ **
+ ** Avoid duplicate information.
+ */
+ inline std::ostream& operator<< (std::ostream& ostr, const location& loc)
+ {
+ position last = loc.end - 1;
+ ostr << loc.begin;
+ if (last.filename
+ && (!loc.begin.filename
+ || *loc.begin.filename != *last.filename))
+ ostr << '-' << last;
+ else if (loc.begin.line != last.line)
+ ostr << '-' << last.line << '.' << last.column;
+ else if (loc.begin.column != last.column)
+ ostr << '-' << last.column;
+ return ostr;
+ }
+
+}
+
+#endif // not BISON_LOCATION_HH
diff --git a/buildtools/lib/parsers/qmake/position.hh b/buildtools/lib/parsers/qmake/position.hh
new file mode 100644
index 00000000..704f0df4
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/position.hh
@@ -0,0 +1,142 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Positions for Bison parsers in C++
+
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/**
+ ** \file position.hh
+ ** Define the QMake::position class.
+ */
+
+#ifndef BISON_POSITION_HH
+# define BISON_POSITION_HH
+
+# include <iostream>
+# include <string>
+
+namespace QMake
+{
+ /// Abstract a position.
+ class position
+ {
+ public:
+
+ /// Construct a position.
+ position ()
+ : filename (0), line (1), column (0)
+ {
+ }
+
+
+ /// Initialization.
+ inline void initialize (std::string* fn)
+ {
+ filename = fn;
+ line = 1;
+ column = 0;
+ }
+
+ /** \name Line and Column related manipulators
+ ** \{ */
+ public:
+ /// (line related) Advance to the COUNT next lines.
+ inline void lines (int count = 1)
+ {
+ column = 0;
+ line += count;
+ }
+
+ /// (column related) Advance to the COUNT next columns.
+ inline void columns (int count = 1)
+ {
+ int leftmost = 0;
+ int current = column;
+ if (leftmost <= current + count)
+ column += count;
+ else
+ column = 0;
+ }
+ /** \} */
+
+ public:
+ /// File name to which this position refers.
+ std::string* filename;
+ /// Current line number.
+ unsigned int line;
+ /// Current column number.
+ unsigned int column;
+ };
+
+ /// Add and assign a position.
+ inline const position&
+ operator+= (position& res, const int width)
+ {
+ res.columns (width);
+ return res;
+ }
+
+ /// Add two position objects.
+ inline const position
+ operator+ (const position& begin, const int width)
+ {
+ position res = begin;
+ return res += width;
+ }
+
+ /// Add and assign a position.
+ inline const position&
+ operator-= (position& res, const int width)
+ {
+ return res += -width;
+ }
+
+ /// Add two position objects.
+ inline const position
+ operator- (const position& begin, const int width)
+ {
+ return begin + -width;
+ }
+
+ /** \brief Intercept output stream redirection.
+ ** \param ostr the destination output stream
+ ** \param pos a reference to the position to redirect
+ */
+ inline std::ostream&
+ operator<< (std::ostream& ostr, const position& pos)
+ {
+ if (pos.filename)
+ ostr << *pos.filename << ':';
+ return ostr << pos.line << '.' << pos.column;
+ }
+
+}
+#endif // not BISON_POSITION_HH
diff --git a/buildtools/lib/parsers/qmake/qmake.ll b/buildtools/lib/parsers/qmake/qmake.ll
new file mode 100644
index 00000000..715d60b3
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake.ll
@@ -0,0 +1,237 @@
+%{
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <stdlib.h>
+
+#define DONT_INCLUDE_FLEXLEXER
+
+#include "qmake_lex.h"
+
+/**
+@file qmake.ll
+QMake Lexer
+
+There are 3 types of identifiers recognized by this lexer:
+-id_simple: examples of such identifiers are qmake variables and scoped variables
+at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp goo.cpp");
+-id_list: those are "value list identifiers" at the right side in assignments
+(like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp");
+-id_args: function arguments recognized as one identifier
+(example: ""${QMAKE_FILE} is intended only for Windows!""
+in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements).
+.
+
+To recognize those identifiers two additional start conditions are used: list and funcargs.
+
+@note "Not" operator (!) is recognized as a part of an identifier. Linefeeds passed to
+the parser as NEWLINE tokens to preserve file structure but whitespaces are stripped
+so no indentation is preserved by this lexer (and parser).
+
+To debug this lexer, put the line below into the next flex file section.
+%option debug
+*/
+%}
+
+%option noyywrap
+%option yylineno
+%option c++
+%option yyclass="QMake::Lexer"
+
+%x vallist
+%x funcargs
+
+delim [ \t]
+ws {delim}+
+newline (\n|\r|\r\n)
+quote "\""
+var_value [^#\r\n\t ]*[^\r\n\t \\]
+quoted_var_value {quote}({var_value}|[\t ])({var_value}|[\t ])*{quote}
+letter [A-Za-z]
+digit [0-9]
+id_simple ({digit}|{letter}|\!|-|_|\*|\$)({letter}|{digit}|\||\!|-|_|\*|\$|\.|\+)*
+id_args [^\r\n]*\)
+number {digit}+
+comment #[^\r\n]*{newline}
+comment_cont (\\{ws}*#[^\r\n]*{newline}|#[^\r\n]*\\{newline})
+cont \\{ws}*{newline}
+
+%%
+<vallist><<EOF>> {
+ BEGIN(INITIAL);
+ return Parser::token::token::ENDOFFILE;
+}
+<INITIAL>{ws} {}
+
+<vallist>{ws} {
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::LIST_WS;
+}
+
+<vallist,INITIAL>{cont} {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::CONT;
+}
+
+<vallist,INITIAL>{comment_cont} {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::COMMENT_CONT;
+}
+
+{id_simple} {
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return (Parser::token::token::ID_SIMPLE);
+}
+
+<funcargs>{id_args} {
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ mylval->value = mylval->value.mid(0, mylval->value.length()-1);
+ unput(')');
+ BEGIN(INITIAL);
+ return (Parser::token::token::ID_ARGS);
+ }
+
+<vallist>{var_value} {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::VARIABLE_VALUE;
+}
+
+<vallist>{quoted_var_value} {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::QUOTED_VARIABLE_VALUE;
+}
+
+"=" {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::EQ;
+}
+
+"+=" {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::PLUSEQ;
+}
+
+"-=" {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::MINUSEQ;
+}
+
+"*=" {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::STAREQ;
+}
+
+"~=" {
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::TILDEEQ;
+}
+
+"{" {
+ return Parser::token::token::LCURLY;
+}
+
+":"{delim}*"{" {
+ return Parser::token::token::LCURLY;
+}
+
+"}" {
+ return Parser::token::token::RCURLY;
+}
+
+"(" {
+ BEGIN(funcargs);
+ return Parser::token::token::LBRACE;
+}
+
+<funcargs,INITIAL>")" {
+ BEGIN(INITIAL);
+ return Parser::token::token::RBRACE;
+}
+
+":" {
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::COLON;
+}
+
+
+<vallist>{ws}{newline} {
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ setLineEndingFromString( mylval->value );
+ return Parser::token::token::NEWLINE;
+}
+
+<vallist,INITIAL>{newline} {
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ setLineEndingFromString( mylval->value );
+ return Parser::token::token::NEWLINE;
+}
+
+<vallist,INITIAL>{comment} {
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return (Parser::token::token::COMMENT);
+}
+
+%%
+namespace QMake
+{
+ Lexer::Lexer( std::istream* argin, std::ostream* argout )
+ : yyFlexLexer(argin, argout), mylval(0), m_lineEnding(None)
+ {
+ }
+
+ int Lexer::yylex( QMake::Parser::semantic_type* yylval )
+ {
+ mylval = yylval;
+ return yylex();
+ }
+
+ void Lexer::setLineEndingFromString( const QString& str )
+ {
+ if( str.endsWith("\r\n") && m_lineEnding == None )
+ m_lineEnding = Windows;
+ else if ( str.endsWith("\r") && m_lineEnding == None )
+ m_lineEnding = MacOS;
+ else if ( m_lineEnding == None )
+ m_lineEnding = Unix;
+ }
+
+ Lexer::LineEnding Lexer::lineending()
+ {
+ return m_lineEnding;
+ }
+}
+
+int QMakelex( QMake::Parser::semantic_type* yylval, QMake::Lexer* lexer)
+{
+ return lexer->yylex( yylval );
+}
+
diff --git a/buildtools/lib/parsers/qmake/qmake.yy b/buildtools/lib/parsers/qmake/qmake.yy
new file mode 100644
index 00000000..9e6d378a
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake.yy
@@ -0,0 +1,430 @@
+%{
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * Copyright (C) 2006 by Andreas Pakulat *
+ * apaku@gmx.de *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+/**
+@file qmake.yy
+QMake Parser
+
+Simple LALR parser which builds the syntax tree (see @ref QMake::AST).
+
+@todo Recognize comments after statements like:
+SOURCES = foo #regognize me
+
+@fixme Parser fails on files that do not end with a newline
+@fixme 1 shift/reduce conflict in "line_body" rule
+*/
+
+#include <qvaluestack.h>
+#include "qmakeast.h"
+#include <qregexp.h>
+
+#define YYSTYPE_IS_DECLARED
+
+namespace QMake
+{
+ class Lexer;
+
+/**
+The yylval type.
+*/
+struct Result {
+ Result(): node(0) {}
+
+ /**Type of semantic value for simple grammar rules.*/
+ QString value;
+ /**Type of semantic value for grammar rules which are parts of AST.*/
+ AST *node;
+ /**Type of semantic value for "multiline_values" grammar rule.
+ Each line of multiline value is stored as a string in the list.
+
+ For example we have in .pro file:
+ @code
+ SOURCE = foo1.cpp \
+ foo2.cpp \
+ foo3.cpp foo4.cpp
+ @endcode
+ The string list will be populated with three strings:
+ <pre>
+ foo1.cpp
+ foo2.cpp
+ foo3.cpp foo4.cpp
+ </pre>
+ */
+ QStringList values;
+ QString indent;
+};
+
+#define YYSTYPE Result
+typedef Result YYSTYPE;
+}
+
+extern int QMakelex( QMake::Result* yylval, QMake::Lexer* lexer );
+
+/**
+The stack to store ProjectAST pointers when a new child
+ProjectAST is created and filled with statements.
+
+Parser creates root ProjectAST for a .pro file, pushes it onto the stack and starts
+adding statements. Each statement is added as a child StatementAST to the ProjectAST
+currently on the top in the stack.
+
+When a scope or function scope statement is parsed, the child ProjectAST is created
+and pushed onto the stack. Therefore all statements which belong to the scope
+or function scope are added as childs to their direct parent (scope or function scope).
+*/
+//QValueStack<ProjectAST*> projects;
+
+/**
+The current depth of AST node is stored here.
+AST depth is important to know because automatic indentation can
+be easily implemented (the parser itself looses all information
+about indentation).
+*/
+// int depth = 0;
+
+/*
+To debug this parser, put the line below into the next bison file section.
+Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
+%debug
+*/
+%}
+
+%skeleton "lalr1.cc"
+%define "parser_class_name" "Parser"
+%name-prefix="QMake"
+%parse-param { QMake::Lexer* lexer }
+%parse-param { QValueStack<ProjectAST*>& projects }
+%parse-param { int depth }
+%lex-param { QMake::Lexer* lexer }
+%start project
+
+%token ID_SIMPLE
+%token EQ
+%token PLUSEQ
+%token MINUSEQ
+%token STAREQ
+%token TILDEEQ
+%token LBRACE
+%token RBRACE
+%token COLON
+%token NEWLINE
+%token COMMENT
+%token CONT
+%token COMMENT_CONT
+%token RCURLY
+%token LCURLY
+%token ID_ARGS
+%token QUOTED_VARIABLE_VALUE
+%token VARIABLE_VALUE
+%token LIST_WS
+%token ENDOFFILE
+%%
+
+project :
+ {
+ ProjectAST *projectAST = new ProjectAST();
+ projects.push(projectAST);
+ }
+ statements
+ ;
+
+statements : statements statement
+ {
+ projects.top()->addChildAST($<node>2);
+ $<node>2->setDepth(depth);
+ }
+ |
+ ;
+
+statement : variable_assignment
+ {
+ $<node>$ = $<node>1;
+ }
+ | scope
+ {
+ $<node>$ = $<node>1;
+ }
+ | function_call
+ {
+ $<node>$ = $<node>1;
+ }
+ | comment
+ {
+ $<node>$ = $<node>1;
+ }
+ | emptyline
+ {
+ $<node>$ = new NewLineAST();
+ }
+ ;
+
+variable_assignment : ID_SIMPLE operator multiline_values listws NEWLINE
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3 ;
+ node->values.append( $<value>4 );
+ node->values.append( $<value>5 );
+ node->indent = $<indent>3;
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator multiline_values listws ENDOFFILE
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3 ;
+ node->values.append( $<value>4 );
+ node->indent = $<indent>3;
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator multiline_values listws CONT
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3 ;
+ node->values.append( $<value>4 );
+ node->values.append( $<value>5 );
+ node->indent = $<indent>3;
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator multiline_values listws COMMENT_CONT
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3 ;
+ node->values.append( $<value>4 );
+ node->values.append( $<value>5 );
+ node->indent = $<indent>3;
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator listws NEWLINE
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values.append( $<value>3 );
+ node->values.append( $<value>4 );
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator listws ENDOFFILE
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values.append( $<value>3 );
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator listws COMMENT
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values.append( $<value>3 );
+ node->values.append( $<value>4 );
+ $<node>$ = node;
+ }
+ | ID_SIMPLE operator multiline_values listws COMMENT
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = $<value>1;
+ node->op = $<value>2;
+ node->values = $<values>3;
+ node->values.append( $<value>4 );
+ node->values.append( $<value>5 );
+ node->indent = $<indent>3;
+ $<node>$ = node;
+ }
+ ;
+
+possible_value : variable_value | COMMENT_CONT | CONT
+
+multiline_values : multiline_values LIST_WS possible_value
+ {
+ $<values>$.append( $<value>2 );
+ $<values>$.append( $<value>3 );
+ }
+ | multiline_values variable_value
+ {
+ $<values>$.append( $<value>2 );
+ }
+ | multiline_values listws CONT listws possible_value
+ {
+ $<values>$.append( $<value>2 );
+ $<values>$.append( $<value>3 );
+ $<values>$.append( $<value>4 );
+ $<values>$.append( $<value>5 );
+ if( $<indent>4 != "" && $<indent>$ == "" )
+ $<indent>$ = $<indent>4;
+ }
+ | multiline_values listws COMMENT_CONT listws possible_value
+ {
+ $<values>$.append( $<value>2 );
+ $<values>$.append( $<value>3 );
+ $<values>$.append( $<value>4 );
+ $<values>$.append( $<value>5 );
+ if( $<indent>4 != "" && $<indent>$ == "" )
+ $<indent>$ = $<indent>4;
+ }
+ | listws possible_value
+ {
+ $<values>$ = QStringList();
+ $<values>$.append( $<value>1 );
+ $<values>$.append( $<value>2 );
+ }
+ ;
+
+
+variable_value : VARIABLE_VALUE { $<value>$ = $<value>1; }
+ | QUOTED_VARIABLE_VALUE { $<value>$ = $<value>1; }
+ ;
+
+
+listws: LIST_WS
+ {
+ $<value>$ = $<value>1;
+ $<indent>$ = $<value>1;
+ }
+ |
+ {
+ $<value>$ = QString();
+ $<indent>$ = QString();
+ }
+ ;
+operator : EQ
+ {
+ $<value>$ = $<value>1;
+ }
+ | PLUSEQ
+ {
+ $<value>$ = $<value>1;
+ }
+ | MINUSEQ
+ {
+ $<value>$ = $<value>1;
+ }
+ | STAREQ
+ {
+ $<value>$ = $<value>1;
+ }
+ | TILDEEQ
+ {
+ $<value>$ = $<value>1;
+ }
+ ;
+
+scope : ID_SIMPLE
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::Scope);
+ projects.push(projectAST);
+ projects.top()->scopedID = $<value>1;
+ depth++;
+ }
+ scope_body
+ {
+ $<node>$ = projects.pop();
+ depth--;
+ }
+ ;
+
+function_call : ID_SIMPLE LBRACE function_args RBRACE
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope);
+ projects.push(projectAST);
+ projects.top()->scopedID = $<value>1;
+ projects.top()->args = $<value>3;
+ depth++;
+
+ //qWarning("%s", $<value>1.ascii());
+ if ($<value>1.contains("include"))
+ {
+ IncludeAST *includeAST = new IncludeAST();
+ includeAST->projectName = $<value>3;
+ projects.top()->addChildAST(includeAST);
+ includeAST->setDepth(depth);
+ }
+ }
+ scope_body
+ else_statement
+ {
+ $<node>$ = projects.pop();
+ depth--;
+ }
+ ;
+
+function_args : ID_ARGS { $<value>$ = $<value>1; }
+ | { $<value>$ = ""; }
+ ;
+
+scope_body : LCURLY statements RCURLY
+ | COLON statement
+ {
+ projects.top()->addChildAST($<node>2);
+ $<node>2->setDepth(depth);
+ }
+ |
+ ;
+
+else_statement : "else" LCURLY
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope);
+ projects.push(projectAST);
+ projects.top()->scopedID = "else";
+ projects.top()->args = "";
+ depth++;
+ }
+ scope_body RCURLY
+ {
+ $<node>$ = projects.pop();
+ depth--;
+ }
+ |
+ {
+ $<node>$ = new ProjectAST();
+ }
+ ;
+
+comment : COMMENT
+ {
+ CommentAST *node = new CommentAST();
+ node->comment = $<value>1;
+ $<node>$ = node;
+ }
+ ;
+
+emptyline : NEWLINE
+ ;
+
+%%
+
+
+namespace QMake
+{
+ void Parser::error(const location_type& /*l*/, const std::string& m)
+ {
+ std::cerr << m << std::endl;
+ }
+}
diff --git a/buildtools/lib/parsers/qmake/qmake_lex.cpp b/buildtools/lib/parsers/qmake/qmake_lex.cpp
new file mode 100644
index 00000000..b49677fe
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake_lex.cpp
@@ -0,0 +1,2239 @@
+#line 2 "qmake_lex.cpp"
+
+#line 4 "qmake_lex.cpp"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* %if-c++-only */
+ /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
+ * following macro. This is required in order to pass the c++-multiple-scanners
+ * test in the regression suite. We get reports that it breaks inheritance.
+ * We will address this in a future release of flex, or omit the C++ scanner
+ * altogether.
+ */
+ #define yyFlexLexer yyFlexLexer
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+/* %if-c-only */
+/* %endif */
+
+/* %if-tables-serialization */
+/* %endif */
+/* end standard C headers. */
+
+/* %if-c-or-c++ */
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+/* %endif */
+
+/* %if-c++-only */
+/* begin standard C++ headers. */
+#include <iostream>
+#include <errno.h>
+#include <cstdlib>
+#include <cstring>
+/* end standard C++ headers. */
+/* %endif */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* %not-for-header */
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+/* %ok-for-header */
+
+/* %not-for-header */
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+/* %ok-for-header */
+
+/* %if-reentrant */
+/* %endif */
+
+/* %if-not-reentrant */
+
+/* %endif */
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+/* %if-not-reentrant */
+extern int yyleng;
+/* %endif */
+
+/* %if-c-only */
+/* %if-not-reentrant */
+/* %endif */
+/* %endif */
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
+ * access to the local variable yy_act. Since yyless() is a macro, it would break
+ * existing scanners that call yyless() from OUTSIDE yylex.
+ * One obvious solution it to make yy_act a global. I tried that, and saw
+ * a 5% performance hit in a non-yylineno scanner, because yy_act is
+ * normally declared as a register variable-- so it is not worth it.
+ */
+ #define YY_LESS_LINENO(n) \
+ do { \
+ int yyl;\
+ for ( yyl = n; yyl < yyleng; ++yyl )\
+ if ( yytext[yyl] == '\n' )\
+ --yylineno;\
+ }while(0)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr) )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+/* %if-c-only */
+/* %endif */
+
+/* %if-c++-only */
+ std::istream* yy_input_file;
+/* %endif */
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* %if-c-only Standard (non-C++) definition */
+/* %not-for-header */
+
+/* %if-not-reentrant */
+/* %endif */
+/* %ok-for-header */
+
+/* %endif */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* %if-c-only Standard (non-C++) definition */
+/* %if-not-reentrant */
+/* %not-for-header */
+
+/* %ok-for-header */
+
+/* %endif */
+/* %endif */
+
+void *yyalloc (yy_size_t );
+void *yyrealloc (void *,yy_size_t );
+void yyfree (void * );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
+/* Begin user sect3 */
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+
+#define FLEX_DEBUG
+
+typedef unsigned char YY_CHAR;
+
+#define yytext_ptr yytext
+#define YY_INTERACTIVE
+
+#include <FlexLexer.h>
+int yyFlexLexer::yylex()
+ {
+ LexerError( "yyFlexLexer::yylex invoked but %option yyclass used" );
+ return 0;
+ }
+
+#define YY_DECL int QMake::Lexer::yylex()
+
+/* %if-c-only Standard (non-C++) definition */
+/* %endif */
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ (yytext_ptr) = yy_bp; \
+/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
+ (yy_c_buf_p) = yy_cp;
+
+/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
+#define YY_NUM_RULES 23
+#define YY_END_OF_BUFFER 24
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[76] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 24, 23, 1, 21,
+ 21, 5, 23, 17, 18, 5, 23, 5, 19, 9,
+ 23, 14, 16, 23, 7, 2, 7, 7, 23, 23,
+ 6, 1, 21, 5, 0, 22, 22, 0, 12, 10,
+ 11, 0, 15, 0, 3, 3, 0, 13, 7, 7,
+ 0, 2, 20, 20, 7, 0, 7, 0, 7, 0,
+ 6, 4, 4, 0, 4, 4, 7, 0, 7, 7,
+ 0, 0, 8, 0, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 5, 6, 7, 8, 1, 1, 1, 9,
+ 10, 11, 12, 1, 13, 14, 1, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 16, 1, 1,
+ 17, 1, 1, 1, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 1, 19, 1, 1, 20, 1, 18, 18, 18, 18,
+
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 21, 22, 23, 24, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[25] =
+ { 0,
+ 1, 2, 3, 3, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int16_t yy_base[85] =
+ { 0,
+ 0, 0, 23, 41, 28, 30, 132, 289, 126, 289,
+ 123, 56, 32, 289, 289, 106, 105, 104, 35, 289,
+ 77, 289, 289, 103, 34, 55, 47, 69, 87, 108,
+ 106, 111, 289, 0, 79, 289, 96, 82, 289, 289,
+ 289, 44, 289, 0, 289, 90, 59, 289, 68, 289,
+ 85, 93, 289, 74, 105, 123, 141, 98, 99, 45,
+ 42, 289, 47, 105, 289, 36, 159, 177, 195, 213,
+ 108, 231, 249, 112, 289, 268, 271, 274, 27, 277,
+ 279, 281, 284, 286
+ } ;
+
+static yyconst flex_int16_t yy_def[85] =
+ { 0,
+ 75, 1, 76, 76, 77, 77, 75, 75, 75, 75,
+ 75, 75, 78, 75, 75, 12, 75, 12, 75, 75,
+ 75, 75, 75, 75, 79, 75, 80, 78, 79, 81,
+ 81, 75, 75, 12, 78, 75, 75, 78, 75, 75,
+ 75, 75, 75, 21, 75, 75, 82, 75, 79, 75,
+ 79, 75, 75, 75, 83, 84, 84, 80, 82, 81,
+ 81, 75, 75, 82, 75, 75, 83, 84, 83, 84,
+ 83, 84, 84, 84, 0, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75
+ } ;
+
+static yyconst flex_int16_t yy_nxt[314] =
+ { 0,
+ 8, 9, 10, 11, 12, 8, 13, 12, 14, 15,
+ 16, 17, 18, 8, 12, 19, 20, 12, 21, 12,
+ 22, 8, 23, 24, 26, 10, 11, 49, 27, 28,
+ 8, 8, 8, 8, 36, 37, 42, 31, 65, 31,
+ 50, 29, 26, 10, 11, 42, 27, 28, 56, 62,
+ 38, 61, 51, 57, 61, 43, 52, 53, 54, 29,
+ 34, 65, 66, 34, 43, 58, 34, 34, 34, 34,
+ 34, 36, 37, 34, 50, 34, 53, 34, 44, 45,
+ 46, 36, 37, 47, 62, 63, 51, 38, 44, 45,
+ 46, 50, 45, 59, 52, 53, 54, 38, 36, 75,
+
+ 38, 65, 66, 51, 57, 51, 68, 65, 66, 75,
+ 69, 70, 32, 75, 70, 61, 58, 61, 68, 48,
+ 41, 40, 39, 71, 68, 33, 71, 32, 73, 68,
+ 74, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 74, 68, 75, 75, 75, 73, 68, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 74,
+ 68, 75, 75, 75, 69, 70, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 71, 68, 75,
+ 75, 75, 73, 68, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 74, 68, 75, 75, 75,
+
+ 69, 70, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75, 71, 68, 75, 75, 75, 73, 68,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 74, 68, 75, 75, 75, 73, 68, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 74,
+ 68, 75, 75, 75, 73, 68, 75, 75, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 74, 25, 25,
+ 25, 30, 30, 30, 35, 35, 35, 55, 55, 60,
+ 60, 64, 64, 64, 67, 67, 72, 72, 7, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75
+ } ;
+
+static yyconst flex_int16_t yy_chk[314] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 3, 3, 3, 79, 3, 3,
+ 5, 5, 6, 6, 13, 13, 19, 5, 66, 6,
+ 25, 3, 4, 4, 4, 42, 4, 4, 27, 63,
+ 13, 61, 25, 27, 60, 19, 26, 26, 26, 4,
+ 12, 47, 47, 12, 42, 27, 12, 12, 12, 12,
+ 12, 28, 28, 12, 49, 12, 54, 12, 21, 21,
+ 21, 35, 35, 21, 38, 38, 49, 28, 29, 29,
+ 29, 51, 46, 29, 52, 52, 52, 35, 37, 58,
+
+ 38, 59, 59, 51, 58, 29, 55, 64, 64, 71,
+ 55, 55, 32, 74, 71, 31, 58, 30, 74, 24,
+ 18, 17, 16, 55, 56, 11, 71, 9, 56, 56,
+ 74, 7, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 56, 57, 0, 0, 0, 57, 57, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 57,
+ 67, 0, 0, 0, 67, 67, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 67, 68, 0,
+ 0, 0, 68, 68, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 68, 69, 0, 0, 0,
+
+ 69, 69, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 69, 70, 0, 0, 0, 70, 70,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 70, 72, 0, 0, 0, 72, 72, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,
+ 73, 0, 0, 0, 73, 73, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 73, 76, 76,
+ 76, 77, 77, 77, 78, 78, 78, 80, 80, 81,
+ 81, 82, 82, 82, 83, 83, 84, 84, 75, 75,
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75, 75
+ } ;
+
+/* Table of booleans, true if rule could match eol. */
+static yyconst flex_int32_t yy_rule_can_match_eol[24] =
+ { 0,
+0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 0, };
+
+static yyconst flex_int16_t yy_rule_linenum[23] =
+ { 0,
+ 81, 83, 88, 94, 100, 105, 113, 119, 125, 131,
+ 137, 143, 149, 155, 159, 163, 167, 172, 177, 183,
+ 190, 197
+ } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "qmake.ll"
+#line 2 "qmake.ll"
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <stdlib.h>
+
+#define DONT_INCLUDE_FLEXLEXER
+
+#include "qmake_lex.h"
+
+/**
+@file qmake.ll
+QMake Lexer
+
+There are 3 types of identifiers recognized by this lexer:
+-id_simple: examples of such identifiers are qmake variables and scoped variables
+at the left of the operator in assignments (like "SOURCES" in "SOURCES+=foo.cpp goo.cpp");
+-id_list: those are "value list identifiers" at the right side in assignments
+(like "foo.cpp goo.cpp" in "SOURCES+=foo.cpp goo.cpp");
+-id_args: function arguments recognized as one identifier
+(example: ""${QMAKE_FILE} is intended only for Windows!""
+in "!win32-*:!wince-*:error("${QMAKE_FILE} is intended only for Windows!")" statements).
+.
+
+To recognize those identifiers two additional start conditions are used: list and funcargs.
+
+@note "Not" operator (!) is recognized as a part of an identifier. Linefeeds passed to
+the parser as NEWLINE tokens to preserve file structure but whitespaces are stripped
+so no indentation is preserved by this lexer (and parser).
+
+To debug this lexer, put the line below into the next flex file section.
+%option debug
+*/
+
+
+#line 657 "qmake_lex.cpp"
+
+#define INITIAL 0
+#define vallist 1
+#define funcargs 2
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+#include <unistd.h>
+/* %endif */
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* %if-c-only Reentrant structure and macros (non-C++). */
+/* %if-reentrant */
+/* %if-c-only */
+/* %endif */
+/* %if-reentrant */
+/* %endif */
+/* %if-bison-bridge */
+/* %endif */
+/* %endif End reentrant structures and macros. */
+/* %not-for-header */
+
+/* %ok-for-header */
+
+/* %endif */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+/* %if-c-only Standard (non-C++) definition */
+/* %not-for-header */
+
+/* %ok-for-header */
+
+/* %endif */
+#endif
+
+/* %if-c-only */
+/* %endif */
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* %if-c-only Standard (non-C++) definition */
+/* %endif */
+/* %if-c++-only C++ definition */
+#define ECHO LexerOutput( yytext, yyleng )
+/* %endif */
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
+\
+/* %if-c++-only C++ definition \ */\
+ if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+/* %endif */
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+#define YY_FATAL_ERROR(msg) LexerError( msg )
+/* %endif */
+#endif
+
+/* %if-tables-serialization structures and prototypes */
+/* %not-for-header */
+
+/* %ok-for-header */
+
+/* %not-for-header */
+
+/* %tables-yydmap generated elements */
+/* %endif */
+/* end tables serialization structures and prototypes */
+
+/* %ok-for-header */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+/* %if-c-only Standard (non-C++) definition */
+/* %endif */
+/* %if-c++-only C++ definition */
+#define YY_DECL int yyFlexLexer::yylex()
+/* %endif */
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+/* %% [6.0] YY_RULE_SETUP definition goes here */
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+/* %not-for-header */
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+/* %% [7.0] user's declarations go here */
+#line 76 "qmake.ll"
+
+#line 818 "qmake_lex.cpp"
+
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ yyin = & std::cin;
+/* %endif */
+
+ if ( ! yyout )
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ yyout = & std::cout;
+/* %endif */
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+ }
+
+ yy_load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+/* %% [8.0] yymore()-related code goes here */
+ yy_cp = (yy_c_buf_p);
+
+ /* Support of yytext. */
+ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+/* %% [9.0] code to set up and find next match goes here */
+ yy_current_state = (yy_start);
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 76 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 289 );
+
+yy_find_action:
+/* %% [10.0] code to find the action number goes here */
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+/* %% [11.0] code for yylineno update goes here */
+
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
+ {
+ int yyl;
+ for ( yyl = 0; yyl < yyleng; ++yyl )
+ if ( yytext[yyl] == '\n' )
+
+ yylineno++;
+;
+ }
+
+do_action: /* This label is used only to access EOF actions. */
+
+/* %% [12.0] debug code goes here */
+ if ( yy_flex_debug )
+ {
+ if ( yy_act == 0 )
+ std::cerr << "--scanner backing up\n";
+ else if ( yy_act < 23 )
+ std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] <<
+ "(\"" << yytext << "\")\n";
+ else if ( yy_act == 23 )
+ std::cerr << "--accepting default rule (\"" << yytext << "\")\n";
+ else if ( yy_act == 24 )
+ std::cerr << "--(end of buffer or a NUL)\n";
+ else
+ std::cerr << "--EOF (start condition " << YY_START << ")\n";
+ }
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+/* %% [13.0] actions go here */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+case YY_STATE_EOF(vallist):
+#line 77 "qmake.ll"
+{
+ BEGIN(INITIAL);
+ return Parser::token::token::ENDOFFILE;
+}
+ YY_BREAK
+case 1:
+YY_RULE_SETUP
+#line 81 "qmake.ll"
+{}
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 83 "qmake.ll"
+{
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::LIST_WS;
+}
+ YY_BREAK
+case 3:
+/* rule 3 can match eol */
+YY_RULE_SETUP
+#line 88 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::CONT;
+}
+ YY_BREAK
+case 4:
+/* rule 4 can match eol */
+YY_RULE_SETUP
+#line 94 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::COMMENT_CONT;
+}
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 100 "qmake.ll"
+{
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return (Parser::token::token::ID_SIMPLE);
+}
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 105 "qmake.ll"
+{
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ mylval->value = mylval->value.mid(0, mylval->value.length()-1);
+ unput(')');
+ BEGIN(INITIAL);
+ return (Parser::token::token::ID_ARGS);
+ }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 113 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::VARIABLE_VALUE;
+}
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 119 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::QUOTED_VARIABLE_VALUE;
+}
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 125 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::EQ;
+}
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 131 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::PLUSEQ;
+}
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 137 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::MINUSEQ;
+}
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 143 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::STAREQ;
+}
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 149 "qmake.ll"
+{
+ BEGIN(vallist);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::TILDEEQ;
+}
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 155 "qmake.ll"
+{
+ return Parser::token::token::LCURLY;
+}
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 159 "qmake.ll"
+{
+ return Parser::token::token::LCURLY;
+}
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 163 "qmake.ll"
+{
+ return Parser::token::token::RCURLY;
+}
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 167 "qmake.ll"
+{
+ BEGIN(funcargs);
+ return Parser::token::token::LBRACE;
+}
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 172 "qmake.ll"
+{
+ BEGIN(INITIAL);
+ return Parser::token::token::RBRACE;
+}
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 177 "qmake.ll"
+{
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return Parser::token::token::COLON;
+}
+ YY_BREAK
+case 20:
+/* rule 20 can match eol */
+YY_RULE_SETUP
+#line 183 "qmake.ll"
+{
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ setLineEndingFromString( mylval->value );
+ return Parser::token::token::NEWLINE;
+}
+ YY_BREAK
+case 21:
+/* rule 21 can match eol */
+YY_RULE_SETUP
+#line 190 "qmake.ll"
+{
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ setLineEndingFromString( mylval->value );
+ return Parser::token::token::NEWLINE;
+}
+ YY_BREAK
+case 22:
+/* rule 22 can match eol */
+YY_RULE_SETUP
+#line 197 "qmake.ll"
+{
+ BEGIN(INITIAL);
+ mylval->value = QString::fromLocal8Bit( YYText(), YYLeng() );
+ return (Parser::token::token::COMMENT);
+}
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 203 "qmake.ll"
+ECHO;
+ YY_BREAK
+#line 1145 "qmake_lex.cpp"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(funcargs):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of yylex */
+/* %ok-for-header */
+
+/* %if-c++-only */
+/* %not-for-header */
+
+yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
+{
+ yyin = arg_yyin;
+ yyout = arg_yyout;
+ yy_c_buf_p = 0;
+ yy_init = 0;
+ yy_start = 0;
+ yy_flex_debug = 0;
+ yylineno = 1; // this will only get updated if %option yylineno
+
+ yy_did_buffer_switch_on_eof = 0;
+
+ yy_looking_for_trail_begin = 0;
+ yy_more_flag = 0;
+ yy_more_len = 0;
+ yy_more_offset = yy_prev_more_offset = 0;
+
+ yy_start_stack_ptr = yy_start_stack_depth = 0;
+ yy_start_stack = NULL;
+
+ (yy_buffer_stack) = 0;
+ (yy_buffer_stack_top) = 0;
+ (yy_buffer_stack_max) = 0;
+
+ yy_state_buf = 0;
+
+}
+
+void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
+{
+ if ( new_in )
+ {
+ yy_delete_buffer( YY_CURRENT_BUFFER );
+ yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
+ }
+
+ if ( new_out )
+ yyout = new_out;
+}
+
+#ifdef YY_INTERACTIVE
+int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
+#else
+int yyFlexLexer::LexerInput( char* buf, int max_size )
+#endif
+{
+ if ( yyin->eof() || yyin->fail() )
+ return 0;
+
+#ifdef YY_INTERACTIVE
+ yyin->get( buf[0] );
+
+ if ( yyin->eof() )
+ return 0;
+
+ if ( yyin->bad() )
+ return -1;
+
+ return 1;
+
+#else
+ (void) yyin->read( buf, max_size );
+
+ if ( yyin->bad() )
+ return -1;
+ else
+ return yyin->gcount();
+#endif
+}
+
+void yyFlexLexer::LexerOutput( const char* buf, int size )
+{
+ (void) yyout->write( buf, size );
+}
+/* %ok-for-header */
+
+/* %endif */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+int yyFlexLexer::yy_get_next_buffer()
+/* %endif */
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+/* %if-c-only */
+/* %not-for-header */
+
+/* %endif */
+/* %if-c++-only */
+ yy_state_type yyFlexLexer::yy_get_previous_state()
+/* %endif */
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+/* %% [15.0] code to get the start state into yy_current_state goes here */
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+/* %% [16.0] code to find the next state goes here */
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 76 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
+/* %endif */
+{
+ register int yy_is_jam;
+ /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 76 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 75);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yyunput( int c, register char* yy_bp)
+/* %endif */
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yytext */
+ *yy_cp = (yy_hold_char);
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+/* %% [18.0] update yylineno here */
+
+ if ( c == '\n' ){
+ --yylineno;
+ }
+
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ int yyFlexLexer::yyinput()
+/* %endif */
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ (yy_hold_char) = *++(yy_c_buf_p);
+
+/* %% [19.0] update BOL and yylineno */
+ if ( c == '\n' )
+
+ yylineno++;
+;
+
+ return c;
+}
+/* %if-c-only */
+/* %endif */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yyrestart( std::istream* input_file )
+/* %endif */
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+ }
+
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file );
+ yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+/* %endif */
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
+ */
+ yyensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_load_buffer_state()
+/* %endif */
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
+/* %endif */
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ *
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
+/* %endif */
+{
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yyfree((void *) b->yy_ch_buf );
+
+ yyfree((void *) b );
+}
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c++-only */
+
+extern "C" int isatty (int );
+
+/* %endif */
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
+/* %endif */
+
+{
+ int oerrno = errno;
+
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ b->yy_is_interactive = 0;
+/* %endif */
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
+/* %endif */
+{
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( );
+}
+
+/* %if-c-or-c++ */
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
+/* %endif */
+{
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack();
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+/* %endif */
+
+/* %if-c-or-c++ */
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+void yyFlexLexer::yypop_buffer_state (void)
+/* %endif */
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
+}
+/* %endif */
+
+/* %if-c-or-c++ */
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+void yyFlexLexer::yyensure_buffer_stack(void)
+/* %endif */
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_push_state( int new_state )
+/* %endif */
+{
+ if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
+ {
+ yy_size_t new_size;
+
+ (yy_start_stack_depth) += YY_START_STACK_INCR;
+ new_size = (yy_start_stack_depth) * sizeof( int );
+
+ if ( ! (yy_start_stack) )
+ (yy_start_stack) = (int *) yyalloc(new_size );
+
+ else
+ (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size );
+
+ if ( ! (yy_start_stack) )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
+
+ BEGIN(new_state);
+}
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ void yyFlexLexer::yy_pop_state()
+/* %endif */
+{
+ if ( --(yy_start_stack_ptr) < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
+}
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+ int yyFlexLexer::yy_top_state()
+/* %endif */
+{
+ return (yy_start_stack)[(yy_start_stack_ptr) - 1];
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+void yyFlexLexer::LexerError( yyconst char msg[] )
+{
+ std::cerr << msg << std::endl;
+ exit( YY_EXIT_FAILURE );
+}
+/* %endif */
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/* %if-c-only */
+/* %if-reentrant */
+/* %endif */
+/* %if-reentrant */
+/* %endif */
+/* %endif */
+
+/* %if-reentrant */
+/* %if-bison-bridge */
+/* %endif */
+/* %endif */
+
+/* %if-c-only */
+/* %endif */
+
+/* %if-c-or-c++ */
+/* %if-c-only */
+/* %endif */
+/* %if-c++-only */
+yyFlexLexer::~yyFlexLexer()
+/* %endif */
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer( YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ yyfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+/* %if-c++-only */
+ delete [] (yy_state_buf);
+ yyfree((yy_start_stack) );
+/* %endif */
+
+/* %if-c-only */
+/* %if-reentrant */
+/* %endif */
+/* %endif */
+}
+/* %endif */
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yyalloc (yy_size_t size )
+{
+ return (void *) malloc( size );
+}
+
+void *yyrealloc (void * ptr, yy_size_t size )
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr )
+{
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+
+/* %if-tables-serialization definitions */
+/* %define-yytables The name for this specific scanner's tables. */
+#define YYTABLES_NAME "yytables"
+/* %endif */
+
+/* %ok-for-header */
+
+#line 203 "qmake.ll"
+
+
+namespace QMake
+{
+ Lexer::Lexer( std::istream* argin, std::ostream* argout )
+ : yyFlexLexer(argin, argout), mylval(0), m_lineEnding(None)
+ {
+ }
+
+ int Lexer::yylex( QMake::Parser::semantic_type* yylval )
+ {
+ mylval = yylval;
+ return yylex();
+ }
+
+ void Lexer::setLineEndingFromString( const QString& str )
+ {
+ if( str.endsWith("\r\n") && m_lineEnding == None )
+ m_lineEnding = Windows;
+ else if ( str.endsWith("\r") && m_lineEnding == None )
+ m_lineEnding = MacOS;
+ else if ( m_lineEnding == None )
+ m_lineEnding = Unix;
+ }
+
+ Lexer::LineEnding Lexer::lineending()
+ {
+ return m_lineEnding;
+ }
+}
+
+int QMakelex( QMake::Parser::semantic_type* yylval, QMake::Lexer* lexer)
+{
+ return lexer->yylex( yylval );
+}
+
+
diff --git a/buildtools/lib/parsers/qmake/qmake_lex.h b/buildtools/lib/parsers/qmake/qmake_lex.h
new file mode 100644
index 00000000..1b91e747
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake_lex.h
@@ -0,0 +1,49 @@
+/* KDevelop QMake Support
+ *
+ * Copyright 2007 Andreas Pakulat <apaku@gmx.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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+#ifndef QMAKE_LEX_H
+#define QMAKE_LEX_H
+
+#include "qmake_yacc.hpp"
+#include <iostream>
+
+#ifndef DONT_INCLUDE_FLEXLEXER
+#include "FlexLexer.h"
+#endif
+
+namespace QMake
+{
+ class Lexer : public yyFlexLexer
+ {
+ public:
+ enum LineEnding{ None, Unix, MacOS, Windows };
+ Lexer( std::istream* argin = 0, std::ostream* argout = 0 );
+ int yylex( QMake::Parser::semantic_type* yylval );
+ int yylex();
+ void setLineEndingFromString( const QString& );
+ LineEnding lineending();
+ private:
+ QMake::Parser::semantic_type* mylval;
+ LineEnding m_lineEnding;
+ };
+}
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width: 4; replace-tabs on; auto-insert-doxygen on
diff --git a/buildtools/lib/parsers/qmake/qmake_yacc.cpp b/buildtools/lib/parsers/qmake/qmake_yacc.cpp
new file mode 100644
index 00000000..9cd09ebe
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake_yacc.cpp
@@ -0,0 +1,1243 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton implementation for Bison LALR(1) parsers in C++
+
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+// Take the name prefix into account.
+#define yylex QMakelex
+
+#include "qmake_yacc.hpp"
+
+/* User implementation prologue. */
+
+
+/* Line 317 of lalr1.cc. */
+#line 45 "qmake_yacc.cpp"
+
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#define YYUSE(e) ((void) (e))
+
+/* A pseudo ostream that takes yydebug_ into account. */
+# define YYCDEBUG \
+ for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \
+ (*yycdebug_)
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug_) \
+ { \
+ *yycdebug_ << Title << ' '; \
+ yy_symbol_print_ ((Type), (Value), (Location)); \
+ *yycdebug_ << std::endl; \
+ } \
+} while (false)
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug_) \
+ yy_reduce_print_ (Rule); \
+} while (false)
+
+# define YY_STACK_PRINT() \
+do { \
+ if (yydebug_) \
+ yystack_print_ (); \
+} while (false)
+
+#else /* !YYDEBUG */
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_REDUCE_PRINT(Rule)
+# define YY_STACK_PRINT()
+
+#endif /* !YYDEBUG */
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+namespace QMake
+{
+#if YYERROR_VERBOSE
+
+ /* Return YYSTR after stripping away unnecessary quotes and
+ backslashes, so that it's suitable for yyerror. The heuristic is
+ that double-quoting is unnecessary unless the string contains an
+ apostrophe, a comma, or backslash (other than backslash-backslash).
+ YYSTR is taken from yytname. */
+ std::string
+ Parser::yytnamerr_ (const char *yystr)
+ {
+ if (*yystr == '"')
+ {
+ std::string yyr = "";
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ yyr += *yyp;
+ break;
+
+ case '"':
+ return yyr;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ return yystr;
+ }
+
+#endif
+
+ /// Build a parser object.
+ Parser::Parser (QMake::Lexer* lexer_yyarg, QValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg)
+ : yydebug_ (false),
+ yycdebug_ (&std::cerr),
+ lexer (lexer_yyarg),
+ projects (projects_yyarg),
+ depth (depth_yyarg)
+ {
+ }
+
+ Parser::~Parser ()
+ {
+ }
+
+#if YYDEBUG
+ /*--------------------------------.
+ | Print this symbol on YYOUTPUT. |
+ `--------------------------------*/
+
+ inline void
+ Parser::yy_symbol_value_print_ (int yytype,
+ const semantic_type* yyvaluep, const location_type* yylocationp)
+ {
+ YYUSE (yylocationp);
+ YYUSE (yyvaluep);
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ }
+
+
+ void
+ Parser::yy_symbol_print_ (int yytype,
+ const semantic_type* yyvaluep, const location_type* yylocationp)
+ {
+ *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
+ << ' ' << yytname_[yytype] << " ("
+ << *yylocationp << ": ";
+ yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
+ *yycdebug_ << ')';
+ }
+#endif /* ! YYDEBUG */
+
+ void
+ Parser::yydestruct_ (const char* yymsg,
+ int yytype, semantic_type* yyvaluep, location_type* yylocationp)
+ {
+ YYUSE (yylocationp);
+ YYUSE (yymsg);
+ YYUSE (yyvaluep);
+
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+ }
+
+ void
+ Parser::yypop_ (unsigned int n)
+ {
+ yystate_stack_.pop (n);
+ yysemantic_stack_.pop (n);
+ yylocation_stack_.pop (n);
+ }
+
+ std::ostream&
+ Parser::debug_stream () const
+ {
+ return *yycdebug_;
+ }
+
+ void
+ Parser::set_debug_stream (std::ostream& o)
+ {
+ yycdebug_ = &o;
+ }
+
+
+ Parser::debug_level_type
+ Parser::debug_level () const
+ {
+ return yydebug_;
+ }
+
+ void
+ Parser::set_debug_level (debug_level_type l)
+ {
+ yydebug_ = l;
+ }
+
+
+ int
+ Parser::parse ()
+ {
+ /// Look-ahead and look-ahead in internal form.
+ int yychar = yyempty_;
+ int yytoken = 0;
+
+ /* State. */
+ int yyn;
+ int yylen = 0;
+ int yystate = 0;
+
+ /* Error handling. */
+ int yynerrs_ = 0;
+ int yyerrstatus_ = 0;
+
+ /// Semantic value of the look-ahead.
+ semantic_type yylval;
+ /// Location of the look-ahead.
+ location_type yylloc;
+ /// The locations where the error started and ended.
+ location yyerror_range[2];
+
+ /// $$.
+ semantic_type yyval;
+ /// @$.
+ location_type yyloc;
+
+ int yyresult;
+
+ YYCDEBUG << "Starting parse" << std::endl;
+
+
+ /* Initialize the stacks. The initial state will be pushed in
+ yynewstate, since the latter expects the semantical and the
+ location values to have been already stored, initialize these
+ stacks with a primary value. */
+ yystate_stack_ = state_stack_type (0);
+ yysemantic_stack_ = semantic_stack_type (0);
+ yylocation_stack_ = location_stack_type (0);
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yylloc);
+
+ /* New state. */
+ yynewstate:
+ yystate_stack_.push (yystate);
+ YYCDEBUG << "Entering state " << yystate << std::endl;
+ goto yybackup;
+
+ /* Backup. */
+ yybackup:
+
+ /* Try to take a decision without look-ahead. */
+ yyn = yypact_[yystate];
+ if (yyn == yypact_ninf_)
+ goto yydefault;
+
+ /* Read a look-ahead token. */
+ if (yychar == yyempty_)
+ {
+ YYCDEBUG << "Reading a token: ";
+ yychar = yylex (&yylval, lexer);
+ }
+
+
+ /* Convert token to internal form. */
+ if (yychar <= yyeof_)
+ {
+ yychar = yytoken = yyeof_;
+ YYCDEBUG << "Now at end of input." << std::endl;
+ }
+ else
+ {
+ yytoken = yytranslate_ (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
+ goto yydefault;
+
+ /* Reduce or error. */
+ yyn = yytable_[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == yytable_ninf_)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Accept? */
+ if (yyn == yyfinal_)
+ goto yyacceptlab;
+
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != yyeof_)
+ yychar = yyempty_;
+
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yylloc);
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus_)
+ --yyerrstatus_;
+
+ yystate = yyn;
+ goto yynewstate;
+
+ /*-----------------------------------------------------------.
+ | yydefault -- do the default action for the current state. |
+ `-----------------------------------------------------------*/
+ yydefault:
+ yyn = yydefact_[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+ /*-----------------------------.
+ | yyreduce -- Do a reduction. |
+ `-----------------------------*/
+ yyreduce:
+ yylen = yyr2_[yyn];
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'. Otherwise, use the top of the stack.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. */
+ if (yylen)
+ yyval = yysemantic_stack_[yylen - 1];
+ else
+ yyval = yysemantic_stack_[0];
+
+ {
+ slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
+ YYLLOC_DEFAULT (yyloc, slice, yylen);
+ }
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 2:
+#line 144 "qmake.yy"
+ {
+ ProjectAST *projectAST = new ProjectAST();
+ projects.push(projectAST);
+ ;}
+ break;
+
+ case 4:
+#line 152 "qmake.yy"
+ {
+ projects.top()->addChildAST((yysemantic_stack_[(2) - (2)].node));
+ (yysemantic_stack_[(2) - (2)].node)->setDepth(depth);
+ ;}
+ break;
+
+ case 6:
+#line 160 "qmake.yy"
+ {
+ (yyval.node) = (yysemantic_stack_[(1) - (1)].node);
+ ;}
+ break;
+
+ case 7:
+#line 164 "qmake.yy"
+ {
+ (yyval.node) = (yysemantic_stack_[(1) - (1)].node);
+ ;}
+ break;
+
+ case 8:
+#line 168 "qmake.yy"
+ {
+ (yyval.node) = (yysemantic_stack_[(1) - (1)].node);
+ ;}
+ break;
+
+ case 9:
+#line 172 "qmake.yy"
+ {
+ (yyval.node) = (yysemantic_stack_[(1) - (1)].node);
+ ;}
+ break;
+
+ case 10:
+#line 176 "qmake.yy"
+ {
+ (yyval.node) = new NewLineAST();
+ ;}
+ break;
+
+ case 11:
+#line 182 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(5) - (1)].value);
+ node->op = (yysemantic_stack_[(5) - (2)].value);
+ node->values = (yysemantic_stack_[(5) - (3)].values) ;
+ node->values.append( (yysemantic_stack_[(5) - (4)].value) );
+ node->values.append( (yysemantic_stack_[(5) - (5)].value) );
+ node->indent = (yysemantic_stack_[(5) - (3)].indent);
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 12:
+#line 193 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(5) - (1)].value);
+ node->op = (yysemantic_stack_[(5) - (2)].value);
+ node->values = (yysemantic_stack_[(5) - (3)].values) ;
+ node->values.append( (yysemantic_stack_[(5) - (4)].value) );
+ node->indent = (yysemantic_stack_[(5) - (3)].indent);
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 13:
+#line 203 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(5) - (1)].value);
+ node->op = (yysemantic_stack_[(5) - (2)].value);
+ node->values = (yysemantic_stack_[(5) - (3)].values) ;
+ node->values.append( (yysemantic_stack_[(5) - (4)].value) );
+ node->values.append( (yysemantic_stack_[(5) - (5)].value) );
+ node->indent = (yysemantic_stack_[(5) - (3)].indent);
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 14:
+#line 214 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(5) - (1)].value);
+ node->op = (yysemantic_stack_[(5) - (2)].value);
+ node->values = (yysemantic_stack_[(5) - (3)].values) ;
+ node->values.append( (yysemantic_stack_[(5) - (4)].value) );
+ node->values.append( (yysemantic_stack_[(5) - (5)].value) );
+ node->indent = (yysemantic_stack_[(5) - (3)].indent);
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 15:
+#line 225 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(4) - (1)].value);
+ node->op = (yysemantic_stack_[(4) - (2)].value);
+ node->values.append( (yysemantic_stack_[(4) - (3)].value) );
+ node->values.append( (yysemantic_stack_[(4) - (4)].value) );
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 16:
+#line 234 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(4) - (1)].value);
+ node->op = (yysemantic_stack_[(4) - (2)].value);
+ node->values.append( (yysemantic_stack_[(4) - (3)].value) );
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 17:
+#line 242 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(4) - (1)].value);
+ node->op = (yysemantic_stack_[(4) - (2)].value);
+ node->values.append( (yysemantic_stack_[(4) - (3)].value) );
+ node->values.append( (yysemantic_stack_[(4) - (4)].value) );
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 18:
+#line 251 "qmake.yy"
+ {
+ AssignmentAST *node = new AssignmentAST();
+ node->scopedID = (yysemantic_stack_[(5) - (1)].value);
+ node->op = (yysemantic_stack_[(5) - (2)].value);
+ node->values = (yysemantic_stack_[(5) - (3)].values);
+ node->values.append( (yysemantic_stack_[(5) - (4)].value) );
+ node->values.append( (yysemantic_stack_[(5) - (5)].value) );
+ node->indent = (yysemantic_stack_[(5) - (3)].indent);
+ (yyval.node) = node;
+ ;}
+ break;
+
+ case 22:
+#line 266 "qmake.yy"
+ {
+ (yyval.values).append( (yysemantic_stack_[(3) - (2)].value) );
+ (yyval.values).append( (yysemantic_stack_[(3) - (3)].value) );
+ ;}
+ break;
+
+ case 23:
+#line 271 "qmake.yy"
+ {
+ (yyval.values).append( (yysemantic_stack_[(2) - (2)].value) );
+ ;}
+ break;
+
+ case 24:
+#line 275 "qmake.yy"
+ {
+ (yyval.values).append( (yysemantic_stack_[(5) - (2)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (3)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (4)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (5)].value) );
+ if( (yysemantic_stack_[(5) - (4)].indent) != "" && (yyval.indent) == "" )
+ (yyval.indent) = (yysemantic_stack_[(5) - (4)].indent);
+ ;}
+ break;
+
+ case 25:
+#line 284 "qmake.yy"
+ {
+ (yyval.values).append( (yysemantic_stack_[(5) - (2)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (3)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (4)].value) );
+ (yyval.values).append( (yysemantic_stack_[(5) - (5)].value) );
+ if( (yysemantic_stack_[(5) - (4)].indent) != "" && (yyval.indent) == "" )
+ (yyval.indent) = (yysemantic_stack_[(5) - (4)].indent);
+ ;}
+ break;
+
+ case 26:
+#line 293 "qmake.yy"
+ {
+ (yyval.values) = QStringList();
+ (yyval.values).append( (yysemantic_stack_[(2) - (1)].value) );
+ (yyval.values).append( (yysemantic_stack_[(2) - (2)].value) );
+ ;}
+ break;
+
+ case 27:
+#line 301 "qmake.yy"
+ { (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;}
+ break;
+
+ case 28:
+#line 302 "qmake.yy"
+ { (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;}
+ break;
+
+ case 29:
+#line 307 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ (yyval.indent) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 30:
+#line 312 "qmake.yy"
+ {
+ (yyval.value) = QString();
+ (yyval.indent) = QString();
+ ;}
+ break;
+
+ case 31:
+#line 318 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 32:
+#line 322 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 33:
+#line 326 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 34:
+#line 330 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 35:
+#line 334 "qmake.yy"
+ {
+ (yyval.value) = (yysemantic_stack_[(1) - (1)].value);
+ ;}
+ break;
+
+ case 36:
+#line 340 "qmake.yy"
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::Scope);
+ projects.push(projectAST);
+ projects.top()->scopedID = (yysemantic_stack_[(1) - (1)].value);
+ depth++;
+ ;}
+ break;
+
+ case 37:
+#line 347 "qmake.yy"
+ {
+ (yyval.node) = projects.pop();
+ depth--;
+ ;}
+ break;
+
+ case 38:
+#line 354 "qmake.yy"
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope);
+ projects.push(projectAST);
+ projects.top()->scopedID = (yysemantic_stack_[(4) - (1)].value);
+ projects.top()->args = (yysemantic_stack_[(4) - (3)].value);
+ depth++;
+
+ //qWarning("%s", $<value>1.ascii());
+ if ((yysemantic_stack_[(4) - (1)].value).contains("include"))
+ {
+ IncludeAST *includeAST = new IncludeAST();
+ includeAST->projectName = (yysemantic_stack_[(4) - (3)].value);
+ projects.top()->addChildAST(includeAST);
+ includeAST->setDepth(depth);
+ }
+ ;}
+ break;
+
+ case 39:
+#line 372 "qmake.yy"
+ {
+ (yyval.node) = projects.pop();
+ depth--;
+ ;}
+ break;
+
+ case 40:
+#line 378 "qmake.yy"
+ { (yyval.value) = (yysemantic_stack_[(1) - (1)].value); ;}
+ break;
+
+ case 41:
+#line 379 "qmake.yy"
+ { (yyval.value) = ""; ;}
+ break;
+
+ case 43:
+#line 384 "qmake.yy"
+ {
+ projects.top()->addChildAST((yysemantic_stack_[(2) - (2)].node));
+ (yysemantic_stack_[(2) - (2)].node)->setDepth(depth);
+ ;}
+ break;
+
+ case 45:
+#line 392 "qmake.yy"
+ {
+ ProjectAST *projectAST = new ProjectAST(ProjectAST::FunctionScope);
+ projects.push(projectAST);
+ projects.top()->scopedID = "else";
+ projects.top()->args = "";
+ depth++;
+ ;}
+ break;
+
+ case 46:
+#line 400 "qmake.yy"
+ {
+ (yyval.node) = projects.pop();
+ depth--;
+ ;}
+ break;
+
+ case 47:
+#line 405 "qmake.yy"
+ {
+ (yyval.node) = new ProjectAST();
+ ;}
+ break;
+
+ case 48:
+#line 411 "qmake.yy"
+ {
+ CommentAST *node = new CommentAST();
+ node->comment = (yysemantic_stack_[(1) - (1)].value);
+ (yyval.node) = node;
+ ;}
+ break;
+
+
+ /* Line 675 of lalr1.cc. */
+#line 756 "qmake_yacc.cpp"
+ default: break;
+ }
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
+
+ yypop_ (yylen);
+ yylen = 0;
+ YY_STACK_PRINT ();
+
+ yysemantic_stack_.push (yyval);
+ yylocation_stack_.push (yyloc);
+
+ /* Shift the result of the reduction. */
+ yyn = yyr1_[yyn];
+ yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
+ if (0 <= yystate && yystate <= yylast_
+ && yycheck_[yystate] == yystate_stack_[0])
+ yystate = yytable_[yystate];
+ else
+ yystate = yydefgoto_[yyn - yyntokens_];
+ goto yynewstate;
+
+ /*------------------------------------.
+ | yyerrlab -- here on detecting error |
+ `------------------------------------*/
+ yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus_)
+ {
+ ++yynerrs_;
+ error (yylloc, yysyntax_error_ (yystate));
+ }
+
+ yyerror_range[0] = yylloc;
+ if (yyerrstatus_ == 3)
+ {
+ /* If just tried and failed to reuse look-ahead token after an
+ error, discard it. */
+
+ if (yychar <= yyeof_)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == yyeof_)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
+ yychar = yyempty_;
+ }
+ }
+
+ /* Else will try to reuse look-ahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+ /*---------------------------------------------------.
+ | yyerrorlab -- error raised explicitly by YYERROR. |
+ `---------------------------------------------------*/
+ yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (false)
+ goto yyerrorlab;
+
+ yyerror_range[0] = yylocation_stack_[yylen - 1];
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ yypop_ (yylen);
+ yylen = 0;
+ yystate = yystate_stack_[0];
+ goto yyerrlab1;
+
+ /*-------------------------------------------------------------.
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
+ `-------------------------------------------------------------*/
+ yyerrlab1:
+ yyerrstatus_ = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact_[yystate];
+ if (yyn != yypact_ninf_)
+ {
+ yyn += yyterror_;
+ if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
+ {
+ yyn = yytable_[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yystate_stack_.height () == 1)
+ YYABORT;
+
+ yyerror_range[0] = yylocation_stack_[0];
+ yydestruct_ ("Error: popping",
+ yystos_[yystate],
+ &yysemantic_stack_[0], &yylocation_stack_[0]);
+ yypop_ ();
+ yystate = yystate_stack_[0];
+ YY_STACK_PRINT ();
+ }
+
+ if (yyn == yyfinal_)
+ goto yyacceptlab;
+
+ yyerror_range[1] = yylloc;
+ // Using YYLLOC is tempting, but would change the location of
+ // the look-ahead. YYLOC is available though.
+ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
+ yysemantic_stack_.push (yylval);
+ yylocation_stack_.push (yyloc);
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
+ &yysemantic_stack_[0], &yylocation_stack_[0]);
+
+ yystate = yyn;
+ goto yynewstate;
+
+ /* Accept. */
+ yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+ /* Abort. */
+ yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+ yyreturn:
+ if (yychar != yyeof_ && yychar != yyempty_)
+ yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
+
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ yypop_ (yylen);
+ while (yystate_stack_.height () != 1)
+ {
+ yydestruct_ ("Cleanup: popping",
+ yystos_[yystate_stack_[0]],
+ &yysemantic_stack_[0],
+ &yylocation_stack_[0]);
+ yypop_ ();
+ }
+
+ return yyresult;
+ }
+
+ // Generate an error message.
+ std::string
+ Parser::yysyntax_error_ (int yystate)
+ {
+ std::string res;
+ YYUSE (yystate);
+#if YYERROR_VERBOSE
+ int yyn = yypact_[yystate];
+ if (yypact_ninf_ < yyn && yyn <= yylast_)
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = yylast_ - yyn + 1;
+ int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
+ int count = 0;
+ for (int x = yyxbegin; x < yyxend; ++x)
+ if (yycheck_[x + yyn] == x && x != yyterror_)
+ ++count;
+
+ // FIXME: This method of building the message is not compatible
+ // with internationalization. It should work like yacc.c does it.
+ // That is, first build a string that looks like this:
+ // "syntax error, unexpected %s or %s or %s"
+ // Then, invoke YY_ on this string.
+ // Finally, use the string as a format to output
+ // yytname_[tok], etc.
+ // Until this gets fixed, this message appears in English only.
+ res = "syntax error, unexpected ";
+ res += yytnamerr_ (yytname_[tok]);
+ if (count < 5)
+ {
+ count = 0;
+ for (int x = yyxbegin; x < yyxend; ++x)
+ if (yycheck_[x + yyn] == x && x != yyterror_)
+ {
+ res += (!count++) ? ", expecting " : " or ";
+ res += yytnamerr_ (yytname_[x]);
+ }
+ }
+ }
+ else
+#endif
+ res = YY_("syntax error");
+ return res;
+ }
+
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+ const signed char Parser::yypact_ninf_ = -44;
+ const signed char
+ Parser::yypact_[] =
+ {
+ -44, 19, -44, -44, 8, 45, -44, -44, -44, -44,
+ -44, -44, -44, -44, -44, -44, -44, -44, -44, 12,
+ 10, 31, -44, 24, -44, -15, -5, 8, -44, -44,
+ -44, -44, -44, 26, -44, 14, -44, -44, -44, -44,
+ -44, -44, -44, -44, 0, 31, -44, -44, -44, 18,
+ 18, -44, -44, 20, 26, 26, 27, -44, -44, -44,
+ -44, 31, 39, -44
+ };
+
+ /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
+ doesn't specify something else to do. Zero means the default is an
+ error. */
+ const unsigned char
+ Parser::yydefact_[] =
+ {
+ 2, 0, 5, 1, 3, 36, 49, 48, 4, 6,
+ 7, 8, 9, 10, 31, 32, 33, 34, 35, 41,
+ 30, 44, 40, 0, 29, 30, 0, 0, 5, 37,
+ 38, 28, 27, 29, 23, 0, 15, 17, 21, 20,
+ 16, 26, 19, 43, 0, 44, 22, 11, 18, 13,
+ 14, 12, 42, 47, 0, 0, 0, 39, 24, 25,
+ 45, 44, 0, 46
+ };
+
+ /* YYPGOTO[NTERM-NUM]. */
+ const signed char
+ Parser::yypgoto_[] =
+ {
+ -44, -44, -44, 7, 29, -44, -32, -44, 22, -25,
+ -44, -44, -44, -44, -44, -44, -43, -44, -44, -44,
+ -44
+ };
+
+ /* YYDEFGOTO[NTERM-NUM]. */
+ const signed char
+ Parser::yydefgoto_[] =
+ {
+ -1, 1, 2, 4, 8, 9, 41, 25, 42, 26,
+ 20, 10, 21, 11, 45, 23, 29, 57, 61, 12,
+ 13
+ };
+
+ /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says. */
+ const signed char Parser::yytable_ninf_ = -31;
+ const signed char
+ Parser::yytable_[] =
+ {
+ 35, 46, 53, 5, 31, 32, 33, 36, 37, 38,
+ 39, 5, 6, 7, 31, 32, 52, 40, 62, 3,
+ 6, 7, 58, 59, 54, 55, 47, 48, 49, 50,
+ 22, 24, -30, -30, 30, 44, 51, -30, -30, 24,
+ 38, 39, 27, 56, 60, 31, 32, 34, 28, 14,
+ 15, 16, 17, 18, 19, 63, 43
+ };
+
+ /* YYCHECK. */
+ const unsigned char
+ Parser::yycheck_[] =
+ {
+ 25, 33, 45, 3, 19, 20, 21, 12, 13, 14,
+ 15, 3, 12, 13, 19, 20, 16, 22, 61, 0,
+ 12, 13, 54, 55, 49, 50, 12, 13, 14, 15,
+ 18, 21, 14, 15, 10, 28, 22, 19, 20, 21,
+ 14, 15, 11, 23, 17, 19, 20, 25, 17, 4,
+ 5, 6, 7, 8, 9, 16, 27
+ };
+
+ /* STOS_[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+ const unsigned char
+ Parser::yystos_[] =
+ {
+ 0, 25, 26, 0, 27, 3, 12, 13, 28, 29,
+ 35, 37, 43, 44, 4, 5, 6, 7, 8, 9,
+ 34, 36, 18, 39, 21, 31, 33, 11, 17, 40,
+ 10, 19, 20, 21, 32, 33, 12, 13, 14, 15,
+ 22, 30, 32, 28, 27, 38, 30, 12, 13, 14,
+ 15, 22, 16, 40, 33, 33, 23, 41, 30, 30,
+ 17, 42, 40, 16
+ };
+
+#if YYDEBUG
+ /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
+ to YYLEX-NUM. */
+ const unsigned short int
+ Parser::yytoken_number_[] =
+ {
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278
+ };
+#endif
+
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+ const unsigned char
+ Parser::yyr1_[] =
+ {
+ 0, 24, 26, 25, 27, 27, 28, 28, 28, 28,
+ 28, 29, 29, 29, 29, 29, 29, 29, 29, 30,
+ 30, 30, 31, 31, 31, 31, 31, 32, 32, 33,
+ 33, 34, 34, 34, 34, 34, 36, 35, 38, 37,
+ 39, 39, 40, 40, 40, 42, 41, 41, 43, 44
+ };
+
+ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+ const unsigned char
+ Parser::yyr2_[] =
+ {
+ 0, 2, 0, 2, 2, 0, 1, 1, 1, 1,
+ 1, 5, 5, 5, 5, 4, 4, 4, 5, 1,
+ 1, 1, 3, 2, 5, 5, 2, 1, 1, 1,
+ 0, 1, 1, 1, 1, 1, 0, 3, 0, 7,
+ 1, 0, 3, 2, 0, 0, 5, 0, 1, 1
+ };
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at \a yyntokens_, nonterminals. */
+ const char*
+ const Parser::yytname_[] =
+ {
+ "$end", "error", "$undefined", "ID_SIMPLE", "EQ", "PLUSEQ", "MINUSEQ",
+ "STAREQ", "TILDEEQ", "LBRACE", "RBRACE", "COLON", "NEWLINE", "COMMENT",
+ "CONT", "COMMENT_CONT", "RCURLY", "LCURLY", "ID_ARGS",
+ "QUOTED_VARIABLE_VALUE", "VARIABLE_VALUE", "LIST_WS", "ENDOFFILE",
+ "\"else\"", "$accept", "project", "@1", "statements", "statement",
+ "variable_assignment", "possible_value", "multiline_values",
+ "variable_value", "listws", "operator", "scope", "@2", "function_call",
+ "@3", "function_args", "scope_body", "else_statement", "@4", "comment",
+ "emptyline", 0
+ };
+#endif
+
+#if YYDEBUG
+ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
+ const Parser::rhs_number_type
+ Parser::yyrhs_[] =
+ {
+ 25, 0, -1, -1, 26, 27, -1, 27, 28, -1,
+ -1, 29, -1, 35, -1, 37, -1, 43, -1, 44,
+ -1, 3, 34, 31, 33, 12, -1, 3, 34, 31,
+ 33, 22, -1, 3, 34, 31, 33, 14, -1, 3,
+ 34, 31, 33, 15, -1, 3, 34, 33, 12, -1,
+ 3, 34, 33, 22, -1, 3, 34, 33, 13, -1,
+ 3, 34, 31, 33, 13, -1, 32, -1, 15, -1,
+ 14, -1, 31, 21, 30, -1, 31, 32, -1, 31,
+ 33, 14, 33, 30, -1, 31, 33, 15, 33, 30,
+ -1, 33, 30, -1, 20, -1, 19, -1, 21, -1,
+ -1, 4, -1, 5, -1, 6, -1, 7, -1, 8,
+ -1, -1, 3, 36, 40, -1, -1, 3, 9, 39,
+ 10, 38, 40, 41, -1, 18, -1, -1, 17, 27,
+ 16, -1, 11, 28, -1, -1, -1, 23, 17, 42,
+ 40, 16, -1, -1, 13, -1, 12, -1
+ };
+
+ /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+ const unsigned char
+ Parser::yyprhs_[] =
+ {
+ 0, 0, 3, 4, 7, 10, 11, 13, 15, 17,
+ 19, 21, 27, 33, 39, 45, 50, 55, 60, 66,
+ 68, 70, 72, 76, 79, 85, 91, 94, 96, 98,
+ 100, 101, 103, 105, 107, 109, 111, 112, 116, 117,
+ 125, 127, 128, 132, 135, 136, 137, 143, 144, 146
+ };
+
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+ const unsigned short int
+ Parser::yyrline_[] =
+ {
+ 0, 144, 144, 144, 151, 156, 159, 163, 167, 171,
+ 175, 181, 192, 202, 213, 224, 233, 241, 250, 263,
+ 263, 263, 265, 270, 274, 283, 292, 301, 302, 306,
+ 312, 317, 321, 325, 329, 333, 340, 339, 354, 353,
+ 378, 379, 382, 383, 388, 392, 391, 405, 410, 418
+ };
+
+ // Print the state stack on the debug stream.
+ void
+ Parser::yystack_print_ ()
+ {
+ *yycdebug_ << "Stack now";
+ for (state_stack_type::const_iterator i = yystate_stack_.begin ();
+ i != yystate_stack_.end (); ++i)
+ *yycdebug_ << ' ' << *i;
+ *yycdebug_ << std::endl;
+ }
+
+ // Report on the debug stream that the rule \a yyrule is going to be reduced.
+ void
+ Parser::yy_reduce_print_ (int yyrule)
+ {
+ unsigned int yylno = yyrline_[yyrule];
+ int yynrhs = yyr2_[yyrule];
+ /* Print the symbols being reduced, and their result. */
+ *yycdebug_ << "Reducing stack by rule " << yyrule - 1
+ << " (line " << yylno << "), ";
+ /* The symbols being reduced. */
+ for (int yyi = 0; yyi < yynrhs; yyi++)
+ YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
+ yyrhs_[yyprhs_[yyrule] + yyi],
+ &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
+ &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
+ }
+#endif // YYDEBUG
+
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+ Parser::token_number_type
+ Parser::yytranslate_ (int t)
+ {
+ static
+ const token_number_type
+ translate_table[] =
+ {
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23
+ };
+ if ((unsigned int) t <= yyuser_token_number_max_)
+ return translate_table[t];
+ else
+ return yyundef_token_;
+ }
+
+ const int Parser::yyeof_ = 0;
+ const int Parser::yylast_ = 56;
+ const int Parser::yynnts_ = 21;
+ const int Parser::yyempty_ = -2;
+ const int Parser::yyfinal_ = 3;
+ const int Parser::yyterror_ = 1;
+ const int Parser::yyerrcode_ = 256;
+ const int Parser::yyntokens_ = 24;
+
+ const unsigned int Parser::yyuser_token_number_max_ = 278;
+ const Parser::token_number_type Parser::yyundef_token_ = 2;
+
+} // namespace QMake
+
+#line 421 "qmake.yy"
+
+
+
+namespace QMake
+{
+ void Parser::error(const location_type& /*l*/, const std::string& m)
+ {
+ std::cerr << m << std::endl;
+ }
+}
+
diff --git a/buildtools/lib/parsers/qmake/qmake_yacc.hpp b/buildtools/lib/parsers/qmake/qmake_yacc.hpp
new file mode 100644
index 00000000..69b8a035
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmake_yacc.hpp
@@ -0,0 +1,418 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton interface for Bison LALR(1) parsers in C++
+
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* C++ LALR(1) parser skeleton written by Akim Demaille. */
+
+#ifndef PARSER_HEADER_H
+# define PARSER_HEADER_H
+
+#include <string>
+#include <iostream>
+#include "stack.hh"
+
+namespace QMake
+{
+ class position;
+ class location;
+}
+
+/* First part of user declarations. */
+#line 1 "qmake.yy"
+
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * Copyright (C) 2006 by Andreas Pakulat *
+ * apaku@gmx.de *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+/**
+@file qmake.yy
+QMake Parser
+
+Simple LALR parser which builds the syntax tree (see @ref QMake::AST).
+
+@todo Recognize comments after statements like:
+SOURCES = foo #regognize me
+
+@fixme Parser fails on files that do not end with a newline
+@fixme 1 shift/reduce conflict in "line_body" rule
+*/
+
+#include <qvaluestack.h>
+#include "qmakeast.h"
+#include <qregexp.h>
+
+#define YYSTYPE_IS_DECLARED
+
+namespace QMake
+{
+ class Lexer;
+
+/**
+The yylval type.
+*/
+struct Result {
+ Result(): node(0) {}
+
+ /**Type of semantic value for simple grammar rules.*/
+ QString value;
+ /**Type of semantic value for grammar rules which are parts of AST.*/
+ AST *node;
+ /**Type of semantic value for "multiline_values" grammar rule.
+ Each line of multiline value is stored as a string in the list.
+
+ For example we have in .pro file:
+ @code
+ SOURCE = foo1.cpp \
+ foo2.cpp \
+ foo3.cpp foo4.cpp
+ @endcode
+ The string list will be populated with three strings:
+ <pre>
+ foo1.cpp
+ foo2.cpp
+ foo3.cpp foo4.cpp
+ </pre>
+ */
+ QStringList values;
+ QString indent;
+};
+
+#define YYSTYPE Result
+typedef Result YYSTYPE;
+}
+
+extern int QMakelex( QMake::Result* yylval, QMake::Lexer* lexer );
+
+/**
+The stack to store ProjectAST pointers when a new child
+ProjectAST is created and filled with statements.
+
+Parser creates root ProjectAST for a .pro file, pushes it onto the stack and starts
+adding statements. Each statement is added as a child StatementAST to the ProjectAST
+currently on the top in the stack.
+
+When a scope or function scope statement is parsed, the child ProjectAST is created
+and pushed onto the stack. Therefore all statements which belong to the scope
+or function scope are added as childs to their direct parent (scope or function scope).
+*/
+//QValueStack<ProjectAST*> projects;
+
+/**
+The current depth of AST node is stored here.
+AST depth is important to know because automatic indentation can
+be easily implemented (the parser itself looses all information
+about indentation).
+*/
+// int depth = 0;
+
+/*
+To debug this parser, put the line below into the next bison file section.
+Don't forget to uncomment "yydebug = 1" line in qmakedriver.cpp.
+%debug
+*/
+
+
+/* Line 35 of lalr1.cc. */
+#line 165 "qmake_yacc.hpp"
+
+#include "location.hh"
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 1
+#endif
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+do { \
+ if (N) \
+ { \
+ (Current).begin = (Rhs)[1].begin; \
+ (Current).end = (Rhs)[N].end; \
+ } \
+ else \
+ { \
+ (Current).begin = (Current).end = (Rhs)[0].end; \
+ } \
+} while (false)
+#endif
+
+namespace QMake
+{
+
+ /// A Bison parser.
+ class Parser
+ {
+ public:
+ /// Symbol semantic values.
+#ifndef YYSTYPE
+ typedef int semantic_type;
+#else
+ typedef YYSTYPE semantic_type;
+#endif
+ /// Symbol locations.
+ typedef location location_type;
+ /// Tokens.
+ struct token
+ {
+ /* Tokens. */
+ enum yytokentype {
+ ID_SIMPLE = 258,
+ EQ = 259,
+ PLUSEQ = 260,
+ MINUSEQ = 261,
+ STAREQ = 262,
+ TILDEEQ = 263,
+ LBRACE = 264,
+ RBRACE = 265,
+ COLON = 266,
+ NEWLINE = 267,
+ COMMENT = 268,
+ CONT = 269,
+ COMMENT_CONT = 270,
+ RCURLY = 271,
+ LCURLY = 272,
+ ID_ARGS = 273,
+ QUOTED_VARIABLE_VALUE = 274,
+ VARIABLE_VALUE = 275,
+ LIST_WS = 276,
+ ENDOFFILE = 277
+ };
+
+ };
+ /// Token type.
+ typedef token::yytokentype token_type;
+
+ /// Build a parser object.
+ Parser (QMake::Lexer* lexer_yyarg, QValueStack<ProjectAST*>& projects_yyarg, int depth_yyarg);
+ virtual ~Parser ();
+
+ /// Parse.
+ /// \returns 0 iff parsing succeeded.
+ virtual int parse ();
+
+ /// The current debugging stream.
+ std::ostream& debug_stream () const;
+ /// Set the current debugging stream.
+ void set_debug_stream (std::ostream &);
+
+ /// Type for debugging levels.
+ typedef int debug_level_type;
+ /// The current debugging level.
+ debug_level_type debug_level () const;
+ /// Set the current debugging level.
+ void set_debug_level (debug_level_type l);
+
+ private:
+ /// Report a syntax error.
+ /// \param loc where the syntax error is found.
+ /// \param msg a description of the syntax error.
+ virtual void error (const location_type& loc, const std::string& msg);
+
+ /// Generate an error message.
+ /// \param state the state where the error occurred.
+ /// \param tok the look-ahead token.
+ virtual std::string yysyntax_error_ (int yystate);
+
+#if YYDEBUG
+ /// \brief Report a symbol value on the debug stream.
+ /// \param yytype The token type.
+ /// \param yyvaluep Its semantic value.
+ /// \param yylocationp Its location.
+ virtual void yy_symbol_value_print_ (int yytype,
+ const semantic_type* yyvaluep,
+ const location_type* yylocationp);
+ /// \brief Report a symbol on the debug stream.
+ /// \param yytype The token type.
+ /// \param yyvaluep Its semantic value.
+ /// \param yylocationp Its location.
+ virtual void yy_symbol_print_ (int yytype,
+ const semantic_type* yyvaluep,
+ const location_type* yylocationp);
+#endif /* ! YYDEBUG */
+
+
+ /// State numbers.
+ typedef int state_type;
+ /// State stack type.
+ typedef stack<state_type> state_stack_type;
+ /// Semantic value stack type.
+ typedef stack<semantic_type> semantic_stack_type;
+ /// location stack type.
+ typedef stack<location_type> location_stack_type;
+
+ /// The state stack.
+ state_stack_type yystate_stack_;
+ /// The semantic value stack.
+ semantic_stack_type yysemantic_stack_;
+ /// The location stack.
+ location_stack_type yylocation_stack_;
+
+ /// Internal symbol numbers.
+ typedef unsigned char token_number_type;
+ /* Tables. */
+ /// For a state, the index in \a yytable_ of its portion.
+ static const signed char yypact_[];
+ static const signed char yypact_ninf_;
+
+ /// For a state, default rule to reduce.
+ /// Unless\a yytable_ specifies something else to do.
+ /// Zero means the default is an error.
+ static const unsigned char yydefact_[];
+
+ static const signed char yypgoto_[];
+ static const signed char yydefgoto_[];
+
+ /// What to do in a state.
+ /// \a yytable_[yypact_[s]]: what to do in state \a s.
+ /// - if positive, shift that token.
+ /// - if negative, reduce the rule which number is the opposite.
+ /// - if zero, do what YYDEFACT says.
+ static const signed char yytable_[];
+ static const signed char yytable_ninf_;
+
+ static const unsigned char yycheck_[];
+
+ /// For a state, its accessing symbol.
+ static const unsigned char yystos_[];
+
+ /// For a rule, its LHS.
+ static const unsigned char yyr1_[];
+ /// For a rule, its RHS length.
+ static const unsigned char yyr2_[];
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+ /// For a symbol, its name in clear.
+ static const char* const yytname_[];
+#endif
+
+#if YYERROR_VERBOSE
+ /// Convert the symbol name \a n to a form suitable for a diagnostic.
+ virtual std::string yytnamerr_ (const char *n);
+#endif
+
+#if YYDEBUG
+ /// A type to store symbol numbers and -1.
+ typedef signed char rhs_number_type;
+ /// A `-1'-separated list of the rules' RHS.
+ static const rhs_number_type yyrhs_[];
+ /// For each rule, the index of the first RHS symbol in \a yyrhs_.
+ static const unsigned char yyprhs_[];
+ /// For each rule, its source line number.
+ static const unsigned short int yyrline_[];
+ /// For each scanner token number, its symbol number.
+ static const unsigned short int yytoken_number_[];
+ /// Report on the debug stream that the rule \a r is going to be reduced.
+ virtual void yy_reduce_print_ (int r);
+ /// Print the state stack on the debug stream.
+ virtual void yystack_print_ ();
+#endif
+
+ /// Convert a scanner token number \a t to a symbol number.
+ token_number_type yytranslate_ (int t);
+
+ /// \brief Reclaim the memory associated to a symbol.
+ /// \param yymsg Why this token is reclaimed.
+ /// \param yytype The symbol type.
+ /// \param yyvaluep Its semantic value.
+ /// \param yylocationp Its location.
+ inline void yydestruct_ (const char* yymsg,
+ int yytype,
+ semantic_type* yyvaluep,
+ location_type* yylocationp);
+
+ /// Pop \a n symbols the three stacks.
+ inline void yypop_ (unsigned int n = 1);
+
+ /* Constants. */
+ static const int yyeof_;
+ /* LAST_ -- Last index in TABLE_. */
+ static const int yylast_;
+ static const int yynnts_;
+ static const int yyempty_;
+ static const int yyfinal_;
+ static const int yyterror_;
+ static const int yyerrcode_;
+ static const int yyntokens_;
+ static const unsigned int yyuser_token_number_max_;
+ static const token_number_type yyundef_token_;
+
+ /* Debugging. */
+ int yydebug_;
+ std::ostream* yycdebug_;
+
+
+ /* User arguments. */
+ QMake::Lexer* lexer;
+ QValueStack<ProjectAST*>& projects;
+ int depth;
+ };
+}
+
+
+#endif /* ! defined PARSER_HEADER_H */
diff --git a/buildtools/lib/parsers/qmake/qmakeast.cpp b/buildtools/lib/parsers/qmake/qmakeast.cpp
new file mode 100644
index 00000000..e6283e28
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakeast.cpp
@@ -0,0 +1,170 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qmakeast.h"
+
+#include <kdebug.h>
+
+namespace QMake {
+
+//AST
+
+AST::~AST()
+{
+ for (QValueList<AST*>::iterator it = m_children.begin(); it != m_children.end(); ++it)
+ {
+ AST *node = *it;
+ delete node;
+ }
+ m_children.clear();
+}
+
+void AST::addChildAST(AST *node)
+{
+ m_children.append(node);
+}
+
+void AST::removeChildAST(AST *node)
+{
+ m_children.remove(node);
+}
+
+void AST::writeBack(QString &buffer)
+{
+ for (QValueList<AST*>::const_iterator it = m_children.constBegin();
+ it != m_children.constEnd(); ++it)
+ {
+ if (*it)
+ {
+ (*it)->writeBack(buffer);
+ }
+ }
+}
+
+QString AST::indentation()
+{
+ QString result;
+ for (int i = 0; i < depth(); i++)
+ result += " ";
+ return result;
+}
+
+//ProjectAST
+
+void ProjectAST::writeBack(QString &buffer)
+{
+ bool hasActualStatements = false;
+ for (QValueList<QMake::AST*>::const_iterator it = m_children.begin(); it != m_children.end(); ++it)
+ {
+ if ((*it)->nodeType() != AST::IncludeAST)
+ {
+ hasActualStatements = true;
+ break;
+ }
+ }
+
+ if (isScope())
+ {
+ if( !buffer.endsWith(": ") )
+ buffer += indentation();
+ buffer += scopedID;
+ if( m_children.count() == 1 )
+ buffer += " : ";
+ else
+ buffer += " {";
+ }
+ else if (isFunctionScope())
+ {
+ if( !buffer.endsWith(": ") )
+ buffer += indentation();
+ buffer += scopedID + "(" + args + ")";
+ if( m_children.count() == 1 && hasActualStatements )
+ buffer += ": ";
+ else if( (m_children.count() > 0 && hasActualStatements) )
+ buffer += "{";
+ else
+ buffer += "";
+ }
+ else if( !buffer.endsWith(": ") )
+ buffer += indentation();
+ AST::writeBack(buffer);
+ if (isScope() && m_children.count() > 1 )
+ buffer += indentation() + "}";
+
+ if (isFunctionScope() && (hasActualStatements) && m_children.count() > 1)
+ buffer += indentation() + "}";
+}
+
+
+void ProjectAST::setLineEnding( ProjectAST::LineEnding l )
+{
+ m_lineEnding = l;
+}
+
+ProjectAST::LineEnding ProjectAST::lineEnding()
+{
+ return m_lineEnding;
+}
+
+//AssignmentAST
+
+AssignmentAST::~AssignmentAST()
+{
+}
+
+void AssignmentAST::writeBack(QString &buffer)
+{
+ if( !buffer.endsWith(": ") )
+ buffer += indentation();
+ buffer += scopedID + " " + op;
+ if( values.first().stripWhiteSpace() != "" )
+ buffer += " ";
+ buffer += values.join("");
+}
+
+
+//NewLineAST
+
+void NewLineAST::writeBack(QString &buffer)
+{
+ buffer += "\n";
+}
+
+
+//CommentAST
+
+void CommentAST::writeBack(QString &buffer)
+{
+ if( !buffer.endsWith(": ") )
+ buffer += indentation();
+ buffer += comment;
+}
+
+
+//IncludeAST
+
+void IncludeAST::writeBack(QString &/*buffer*/)
+{
+}
+
+}
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
+
diff --git a/buildtools/lib/parsers/qmake/qmakeast.h b/buildtools/lib/parsers/qmake/qmakeast.h
new file mode 100644
index 00000000..b8486433
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakeast.h
@@ -0,0 +1,236 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QMAKEQMAKEAST_H
+#define QMAKEQMAKEAST_H
+
+#include <qstringlist.h>
+
+/**
+@file qmakeast.h
+Abstract Syntax Tree (AST) class declarations.
+*/
+
+namespace QMake {
+
+/**
+AST node.
+This is the base class. Objects of this type are not created by the parser.
+
+Each AST node holds the list of its children which are always deleted in the
+destructor. This way, it's possible call delete for only root AST node and
+others will be deleted automatically.
+
+Each AST node also knows how to write the information back into .pro file.
+*/
+class AST {
+public:
+ /**Type of AST node.*/
+ enum NodeType {
+ ProjectAST /**<Project, scope or function scope.*/,
+ AssignmentAST /**<Variable assignment.*/,
+ NewLineAST /**<Line feed.*/,
+ CommentAST /**<Comment.*/,
+ IncludeAST /**<.pri include.*/,
+ OrOperatorAST /* | */
+ };
+
+ /**Constructs AST with given node type.*/
+ AST(NodeType nodeType): m_nodeType(nodeType), m_depth(0) {}
+ virtual ~AST();
+
+ /**Adds child AST node to this node. Despite this function is virtual,
+ reimplementations should call it to make automatic destruction of
+ AST tree possible.*/
+ virtual void addChildAST(AST *node);
+ /**Removes child AST node from this node. Despite this function is virtual,
+ reimplementations should call it to make automatic destruction of
+ AST tree possible.*/
+ virtual void removeChildAST(AST *node);
+ /**Writes information stored in the AST into the @p buffer.
+ This is a default implementation which iterates over child nodes
+ and calls writeBack for each child node.*/
+ virtual void writeBack(QString &buffer);
+
+ /**@return The type of the node.*/
+ virtual NodeType nodeType() const { return m_nodeType; }
+
+ /**Sets the depth of the node in AST.*/
+ void setDepth(int depth) { m_depth = depth; }
+ /**@return The depth of the node in AST.*/
+ int depth() const { return m_depth; }
+ /**@return The indentation string based on node depth.*/
+ virtual QString indentation();
+
+ /**The list of child AST nodes.*/
+ QValueList<AST*> m_children;
+
+protected:
+ NodeType m_nodeType;
+
+private:
+ int m_depth;
+
+};
+
+
+/**
+Project AST node.
+Represents complete projects, scopes and function scopes.
+Examples:
+@code
+scopename{
+var=value
+}
+function(args){
+var=value
+}
+@endcode
+*/
+class ProjectAST: public AST {
+public:
+ /**The kind of a project node.*/
+ enum Kind {
+ Project /**<Project*/,
+ Scope /**<Scope*/,
+ FunctionScope /**<FunctionScope*/,
+ Empty /**<Project does not exist, the AST is empty*/
+ };
+
+ enum LineEnding {
+ Unix,
+ MacOS,
+ Windows
+ };
+
+ /**Constructs a project node of given @p kind.*/
+ ProjectAST(Kind kind = Project): AST(AST::ProjectAST), m_kind(kind) {}
+
+ virtual void writeBack(QString &buffer);
+
+ /**@return true if this node is a project.*/
+ bool isProject() const { return m_kind == Project; }
+ /**@return true if this node is a scope.*/
+ bool isScope() const { return m_kind == Scope; }
+ /**@return true if this node is a function scope.*/
+ bool isFunctionScope() const { return m_kind == FunctionScope; }
+ /**@return true if this node is empty.*/
+ bool isEmpty() const { return m_kind == Empty; }
+
+ void setFileName(const QString& fileName) { m_fileName = fileName; }
+ QString fileName() const { return m_fileName; }
+
+ void setLineEnding( LineEnding );
+ LineEnding lineEnding();
+
+ /**Scoped identifier (scope name or function name).*/
+ QString scopedID;
+ /**Function arguments. Empty for other kinds of projects.*/
+ QString args;
+
+private:
+ Kind m_kind;
+ QString m_fileName;
+ LineEnding m_lineEnding;
+};
+
+
+/**
+Assignment AST node.
+Represents assignments, for example:
+<pre>
+var=value
+</pre>
+
+Values can be specified on several lines and
+each line is stored as a string in the list of values.@n
+For example, if we have in .pro:
+<pre>
+SOURCES=a.cpp \
+ b.cpp c.cpp
+</pre>
+then values will be stored as a two elements list:
+<pre>
+a.cpp
+ b.cpp c.cpp
+</pre>
+*/
+class AssignmentAST: public AST {
+public:
+ AssignmentAST(): AST(AST::AssignmentAST){}
+ ~AssignmentAST();
+
+ virtual void writeBack(QString &buffer);
+
+ /**Scoped name of the variable.*/
+ QString scopedID;
+ /**Operator.*/
+ QString op;
+ /**List of values.*/
+ QStringList values;
+ /**Indentation of multiline values*/
+ QString indent;
+};
+
+
+/**
+New line AST node.
+Represents line feeds in files.
+*/
+class NewLineAST: public AST {
+public:
+ NewLineAST(): AST(AST::NewLineAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+};
+
+
+/**
+Comment AST node.
+Represents comments.
+*/
+class CommentAST: public AST {
+public:
+ CommentAST(): AST(AST::CommentAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+ /**Comment text.*/
+ QString comment;
+
+};
+
+
+/**
+Include AST node.
+Represents pri include.
+ */
+class IncludeAST: public AST {
+public:
+ IncludeAST(): AST(AST::IncludeAST) {}
+
+ virtual void writeBack(QString &buffer);
+
+ QString projectName;
+};
+
+}
+
+#endif
diff --git a/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp b/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp
new file mode 100644
index 00000000..d8dd7751
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakeastvisitor.cpp
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qmakeastvisitor.h"
+
+namespace QMake {
+
+void ASTVisitor::processProject(ProjectAST *project)
+{
+ if (project->isProject())
+ enterRealProject(project);
+ else if (project->isScope())
+ enterScope(project);
+ else if (project->isFunctionScope())
+ enterFunctionScope(project);
+ for (QValueList<QMake::AST*>::const_iterator it = project->m_children.constBegin();
+ it != project->m_children.constEnd(); ++it)
+ {
+ AST *ast = *it;
+ if (ast == 0)
+ continue;
+ switch (ast->nodeType()) {
+ case AST::AssignmentAST:
+ processAssignment(static_cast<QMake::AssignmentAST*>(ast));
+ break;
+
+ case AST::NewLineAST:
+ processNewLine(static_cast<QMake::NewLineAST*>(ast));
+ break;
+
+ case AST::CommentAST:
+ processComment(static_cast<QMake::CommentAST*>(ast));
+ break;
+
+ case AST::ProjectAST:
+ processProject(static_cast<QMake::ProjectAST*>(ast));
+ break;
+
+ case AST::IncludeAST:
+ processInclude(static_cast<QMake::IncludeAST*>(ast));
+ break;
+ }
+ }
+ if (project->isProject())
+ leaveRealProject(project);
+ else if (project->isScope())
+ leaveScope(project);
+ else if (project->isFunctionScope())
+ leaveFunctionScope(project);
+}
+
+}
diff --git a/buildtools/lib/parsers/qmake/qmakeastvisitor.h b/buildtools/lib/parsers/qmake/qmakeastvisitor.h
new file mode 100644
index 00000000..006d1de3
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakeastvisitor.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QMAKEQMAKEASTVISITOR_H
+#define QMAKEQMAKEASTVISITOR_H
+
+#include "qmakeast.h"
+
+namespace QMake {
+
+class ASTVisitor{
+public:
+ ASTVisitor() {}
+
+ virtual void processProject(ProjectAST *);
+ virtual void enterRealProject(ProjectAST *) {}
+ virtual void leaveRealProject(ProjectAST *) {}
+ virtual void enterScope(ProjectAST *) {}
+ virtual void leaveScope(ProjectAST *) {}
+ virtual void enterFunctionScope(ProjectAST *) {}
+ virtual void leaveFunctionScope(ProjectAST *) {}
+ virtual void processAssignment(AssignmentAST *) {}
+ virtual void processNewLine(NewLineAST *) {}
+ virtual void processComment(CommentAST *) {}
+ virtual void processInclude(IncludeAST *) {}
+};
+
+}
+
+#endif
diff --git a/buildtools/lib/parsers/qmake/qmakedriver.cpp b/buildtools/lib/parsers/qmake/qmakedriver.cpp
new file mode 100644
index 00000000..3e385c7a
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakedriver.cpp
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qmakedriver.h"
+#include "qmakeast.h"
+
+#include <qvaluestack.h>
+#include <kio/netaccess.h>
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+#include "qmake_lex.h"
+#include "qmake_yacc.hpp"
+
+namespace QMake {
+
+int Driver::parseFile(const char *fileName, ProjectAST **ast, int debug)
+{
+ std::ifstream inf( fileName, std::ios::in );
+ if ( !inf.is_open() )
+ {
+ *ast = 0;
+ return 1;
+ }
+// yydebug = 1;
+ Lexer l(&inf);
+ l.set_debug(debug);
+ int depth = 0;
+ QValueStack<ProjectAST*> stack;
+ Parser p(&l, stack, depth);
+ p.set_debug_level(debug);
+ int ret = p.parse();
+ *ast = stack.top();
+ (*ast)->setFileName(fileName);
+ switch( l.lineending() )
+ {
+ case QMake::Lexer::Windows:
+ (*ast)->setLineEnding(QMake::ProjectAST::Windows);
+ break;
+ case QMake::Lexer::MacOS:
+ (*ast)->setLineEnding(QMake::ProjectAST::MacOS);
+ break;
+ case QMake::Lexer::Unix:
+ default:
+ (*ast)->setLineEnding(QMake::ProjectAST::Unix);
+ break;
+ }
+ return ret;
+}
+
+int Driver::parseFile(QString fileName, ProjectAST **ast, int debug)
+{
+ return parseFile(fileName.ascii(), ast, debug);
+}
+
+int Driver::parseFile(KURL fileName, ProjectAST **ast, int debug)
+{
+ QString tmpFile;
+ int ret = 0;
+ if (KIO::NetAccess::download(fileName, tmpFile, 0))
+ ret = parseFile(tmpFile, ast, debug);
+ KIO::NetAccess::removeTempFile(tmpFile);
+ return ret;
+}
+
+int Driver::parseString( const char* string, ProjectAST **ast, int debug )
+{
+ std::istringstream ins;
+ ins.str(string);
+ Lexer l(&ins);
+ l.set_debug(debug);
+ int depth = 0;
+ QValueStack<ProjectAST*> stack;
+ Parser p(&l, stack, depth);
+ p.set_debug_level(debug);
+ int ret = p.parse();
+ *ast = stack.top();
+ (*ast)->setFileName("");
+ switch( l.lineending() )
+ {
+ case QMake::Lexer::Windows:
+ (*ast)->setLineEnding(QMake::ProjectAST::Windows);
+ break;
+ case QMake::Lexer::MacOS:
+ (*ast)->setLineEnding(QMake::ProjectAST::MacOS);
+ break;
+ case QMake::Lexer::Unix:
+ default:
+ (*ast)->setLineEnding(QMake::ProjectAST::Unix);
+ break;
+ }
+ return ret;
+}
+
+}
diff --git a/buildtools/lib/parsers/qmake/qmakedriver.h b/buildtools/lib/parsers/qmake/qmakedriver.h
new file mode 100644
index 00000000..a1cdc9d9
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/qmakedriver.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QMAKEQMAKEDRIVER_H
+#define QMAKEQMAKEDRIVER_H
+
+class QString;
+class KURL;
+
+namespace QMake {
+
+/**
+@file qmakedriver.h
+Driver for a qmake parser.
+*/
+
+class ProjectAST;
+
+/**
+Driver.
+Use methods of this class to lauch parsing and build the AST.
+*/
+class Driver{
+public:
+ /**Parses the file @p fileName and stores the resulting ProjectAST root
+ into @p ast. @p ast should not be initialized before. Driver will
+ initialize it on its own.
+ @return The result of parsing. Result is 0 on success and <> 0 on failure.
+ */
+ static int parseFile(const char *fileName, ProjectAST **ast, int debug);
+ static int parseFile(QString fileName, ProjectAST **ast, int debug);
+ static int parseFile(KURL fileName, ProjectAST **ast, int debug);
+ static int parseString(const char* string, ProjectAST **ast, int debug);
+
+};
+
+}
+
+#endif
diff --git a/buildtools/lib/parsers/qmake/stack.hh b/buildtools/lib/parsers/qmake/stack.hh
new file mode 100644
index 00000000..b81e4a28
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/stack.hh
@@ -0,0 +1,129 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Stack handling for Bison parsers in C++
+
+ Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+#ifndef BISON_STACK_HH
+# define BISON_STACK_HH
+
+#include <deque>
+
+namespace QMake
+{
+ template <class T, class S = std::deque<T> >
+ class stack
+ {
+ public:
+
+ // Hide our reversed order.
+ typedef typename S::reverse_iterator iterator;
+ typedef typename S::const_reverse_iterator const_iterator;
+
+ stack () : seq_ ()
+ {
+ }
+
+ stack (unsigned int n) : seq_ (n)
+ {
+ }
+
+ inline
+ T&
+ operator [] (unsigned int i)
+ {
+ return seq_[i];
+ }
+
+ inline
+ const T&
+ operator [] (unsigned int i) const
+ {
+ return seq_[i];
+ }
+
+ inline
+ void
+ push (const T& t)
+ {
+ seq_.push_front (t);
+ }
+
+ inline
+ void
+ pop (unsigned int n = 1)
+ {
+ for (; n; --n)
+ seq_.pop_front ();
+ }
+
+ inline
+ unsigned int
+ height () const
+ {
+ return seq_.size ();
+ }
+
+ inline const_iterator begin () const { return seq_.rbegin (); }
+ inline const_iterator end () const { return seq_.rend (); }
+
+ private:
+
+ S seq_;
+ };
+
+ /// Present a slice of the top of a stack.
+ template <class T, class S = stack<T> >
+ class slice
+ {
+ public:
+
+ slice (const S& stack,
+ unsigned int range) : stack_ (stack),
+ range_ (range)
+ {
+ }
+
+ inline
+ const T&
+ operator [] (unsigned int i) const
+ {
+ return stack_[range_ - i];
+ }
+
+ private:
+
+ const S& stack_;
+ unsigned int range_;
+ };
+}
+
+#endif // not BISON_STACK_HH
diff --git a/buildtools/lib/parsers/qmake/tests/Makefile.am b/buildtools/lib/parsers/qmake/tests/Makefile.am
new file mode 100644
index 00000000..a73f8f4e
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/Makefile.am
@@ -0,0 +1,21 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets/propeditor \
+ -I$(top_srcdir)/buildtools/lib/parsers/qmake \
+ -I$(top_builddir)/buildtools/lib/parsers/qmake/tests \
+ $(all_includes)
+
+METASOURCES = AUTO
+
+noinst_PROGRAMS = runner viewer
+
+runner_LDFLAGS = $(all_libraries) $(LIB_KDECORE) $(KDE_RPATH)
+runner_LDADD = $(top_builddir)/buildtools/lib/parsers/qmake/libkdevqmakeparser.la
+runner_SOURCES = runner.cpp
+
+viewer_LDFLAGS = --no-undefined $(all_libraries) $(LIB_KDECORE) $(KDE_RPATH)
+viewer_LDADD = $(top_builddir)/buildtools/lib/parsers/qmake/libkdevqmakeparser.la
+viewer_SOURCES = viewer.cpp viewer_main.cpp viewerbase.ui
diff --git a/buildtools/lib/parsers/qmake/tests/runner.cpp b/buildtools/lib/parsers/qmake/tests/runner.cpp
new file mode 100644
index 00000000..b01284f1
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/runner.cpp
@@ -0,0 +1,169 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <cstdlib>
+#include <iostream>
+#include <stdio.h>
+#include "qmakedriver.h"
+#include "qmakeastvisitor.h"
+
+#include <qstring.h>
+
+#include <kdebug.h>
+#include <kcmdlineargs.h>
+#include <kurl.h>
+
+static const KCmdLineOptions options[] =
+{
+ {"silent", "Enable Parser debug output", 0},
+ {"!debug", "Disable output of the generated AST", 0},
+ {"!+files", "QMake project files", 0}
+};
+
+
+class PrintAST : QMake::ASTVisitor
+{
+public:
+ PrintAST() : QMake::ASTVisitor()
+ {
+ indent = 0;
+ }
+
+ virtual void processProject( QMake::ProjectAST* p )
+ {
+ QMake::ASTVisitor::processProject(p);
+ }
+private:
+ virtual void enterRealProject( QMake::ProjectAST* p )
+ {
+ kdDebug(9024) << getIndent() << "--------- Entering Project: " << replaceWs(p->fileName()) << "| LineEnding:" << p->lineEnding() << " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterRealProject(p);
+ }
+
+ virtual void leaveRealProject( QMake::ProjectAST* p )
+ {
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving Project: " << replaceWs(p->fileName()) << " --------------" << endl;
+ QMake::ASTVisitor::leaveRealProject(p);
+ }
+
+ virtual void enterScope( QMake::ProjectAST* p )
+ {
+ kdDebug(9024) << getIndent() << "--------- Entering Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterScope(p);
+ }
+
+ virtual void leaveScope( QMake::ProjectAST* p )
+ {
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
+ QMake::ASTVisitor::leaveScope(p);
+ }
+
+ virtual void enterFunctionScope( QMake::ProjectAST* p )
+ {
+ kdDebug(9024) << getIndent() << "--------- Entering FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterFunctionScope(p);
+ }
+
+ virtual void leaveFunctionScope( QMake::ProjectAST* p )
+ {
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
+ QMake::ASTVisitor::leaveFunctionScope(p);
+ }
+
+ QString replaceWs(QString s)
+ {
+ return s.replace("\n", "%nl").replace("\t", "%tab").replace(" ", "%spc");
+ }
+
+ virtual void processAssignment( QMake::AssignmentAST* a)
+ {
+ kdDebug(9024) << getIndent() << "Assignment(" << replaceWs(a->indent) << "):" << replaceWs(a->scopedID) << " " << replaceWs(a->op) << " " << replaceWs(a->values.join("|")) << endl;
+ QMake::ASTVisitor::processAssignment(a);
+ }
+
+ virtual void processNewLine( QMake::NewLineAST* n)
+ {
+ kdDebug(9024) << getIndent() << "Newline " << endl;
+ QMake::ASTVisitor::processNewLine(n);
+ }
+
+ virtual void processComment( QMake::CommentAST* a)
+ {
+ kdDebug(9024) << getIndent() << "Comment: " << replaceWs(a->comment) << endl;
+ QMake::ASTVisitor::processComment(a);
+ }
+
+ virtual void processInclude( QMake::IncludeAST* a)
+ {
+ kdDebug(9024) << getIndent() << "Include: " << replaceWs(a->projectName) << endl;
+ QMake::ASTVisitor::processInclude(a);
+ }
+
+ QString getIndent()
+ {
+ QString ind;
+ for( int i = 0 ; i < indent ; i++)
+ ind += " ";
+ return ind;
+ }
+ int indent;
+};
+int main(int argc, char *argv[])
+{
+ KCmdLineArgs::init( argc, argv, "QMake Parser", "qmake-parser", "Parse QMake project files", "1.0.0");
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if( args->count() < 1 )
+ {
+ KCmdLineArgs::usage(0);
+ }
+
+ int debug = 0;
+ bool silent = false;
+
+ if( args->isSet("silent") )
+ silent = true;
+ if( args->isSet("debug") )
+ debug = 1;
+ for( int i = 0 ; i < args->count() ; i++ )
+ {
+ QMake::ProjectAST *projectAST;
+ int ret = QMake::Driver::parseFile(args->url(i).path(), &projectAST, debug);
+ PrintAST pa;
+ if ( ret == 0 )
+ if ( !silent )
+ {
+ pa.processProject(projectAST);
+ QString profile;
+ projectAST->writeBack(profile);
+ kdDebug(9024) << "QMake file written back:\n" << profile << endl;
+ }
+ return ret;
+ }
+ return 0;
+}
diff --git a/buildtools/lib/parsers/qmake/tests/viewer.cpp b/buildtools/lib/parsers/qmake/tests/viewer.cpp
new file mode 100644
index 00000000..dba2b7fb
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/viewer.cpp
@@ -0,0 +1,182 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "viewer.h"
+
+#include <qdir.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qfiledialog.h>
+#include <qtextedit.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qlistview.h>
+#include <qtabwidget.h>
+
+#include <qmakeast.h>
+#include <qmakedriver.h>
+#include <qmakeastvisitor.h>
+
+using namespace QMake;
+
+Viewer::Viewer(QWidget *parent, const char *name)
+ :ViewerBase(parent, name), projectAST(0)
+{
+ if (QFile::exists(QDir::currentDirPath() + "/" + "qtlist"))
+ {
+ QFile f(QDir::currentDirPath() + "/" + "qtlist");
+ f.open(IO_ReadOnly);
+ QTextStream str(&f);
+ while (!str.eof())
+ files->insertItem(str.readLine());
+ }
+ ast->setSorting(-1);
+// parentProject.push((QListViewItem*)0);
+}
+
+void Viewer::addAll_clicked()
+{
+ if (allLocation->text().isEmpty())
+ return;
+ QDir d(allLocation->text());
+ QStringList l = d.entryList("*.pro *.pri");
+ for (QStringList::iterator it = l.begin(); it != l.end(); ++it)
+ (*it) = QDir::cleanDirPath(allLocation->text() + "/" + (*it));
+ files->insertStringList(l);
+}
+
+void Viewer::choose_clicked()
+{
+ QString fileName = QFileDialog::getOpenFileName(QDir::currentDirPath(), "*.pro *.pri", this);
+ if (!fileName.isEmpty())
+ files->insertItem(fileName);
+}
+
+void Viewer::files_currentChanged(QListBoxItem* item)
+{
+ ast->clear();
+
+ QFile f(item->text());
+ f.open(IO_ReadOnly);
+ QTextStream str(&f);
+ source->setText(str.read());
+ f.close();
+
+ int result = QMake::Driver::parseFile(item->text().ascii(), &projectAST, 0);
+ if (projectAST && (result == 0))
+ {
+ processAST(projectAST);
+ }
+ if (tabWidget2->currentPageIndex() == 1)
+ tabWidget2_selected("Source to be written back");
+}
+
+void Viewer::tabWidget2_selected(const QString& text)
+{
+ if ((text == "Source to Be Written Back") && projectAST)
+ {
+ QString buffer;
+ projectAST->writeBack(buffer);
+ writeBack->setText(buffer);
+ }
+}
+
+class ViewerVisitor: public ASTVisitor {
+public:
+ ViewerVisitor(Viewer *v): ASTVisitor()
+ {
+ this->v = v;
+ parentProject.push((QListViewItem*)0);
+ }
+
+ virtual void processProject(ProjectAST *project)
+ {
+ ASTVisitor::processProject(project);
+ }
+
+ virtual void enterRealProject(ProjectAST *project)
+ {
+ QListViewItem *projectIt;
+ if (!parentProject.top())
+ {
+ projectIt = new QListViewItem(v->ast, "Project");
+ projectIt->setOpen(true);
+ parentProject.push(projectIt);
+ }
+
+ ASTVisitor::enterRealProject(project);
+ }
+ virtual void enterScope(ProjectAST *scope)
+ {
+ QListViewItem *projectIt = new QListViewItem(parentProject.top(), scope->scopedID, "scope");
+ parentProject.push(projectIt);
+ ASTVisitor::enterScope(scope);
+ }
+ virtual void leaveScope(ProjectAST *scope)
+ {
+ parentProject.pop();
+ }
+ virtual void enterFunctionScope(ProjectAST *fscope)
+ {
+ QListViewItem *projectIt = new QListViewItem(parentProject.top(),
+ fscope->scopedID + "(" + fscope->args + ")", "function scope");
+ parentProject.push(projectIt);
+ ASTVisitor::enterFunctionScope(fscope);
+ }
+ virtual void leaveFunctionScope(ProjectAST *fscope)
+ {
+ parentProject.pop();
+ }
+ virtual void processAssignment(AssignmentAST *assignment)
+ {
+ QListViewItem *item = new QListViewItem(parentProject.top(),
+ assignment->scopedID, assignment->op, assignment->values.join("|"),
+ "assignment");
+ item->setMultiLinesEnabled(true);
+
+ ASTVisitor::processAssignment(assignment);
+ }
+ virtual void processNewLine(NewLineAST *newline)
+ {
+ new QListViewItem(parentProject.top(), "<newline>");
+ ASTVisitor::processNewLine(newline);
+ }
+ virtual void processComment(CommentAST *comment)
+ {
+ new QListViewItem(parentProject.top(), "<comment>");
+ ASTVisitor::processComment(comment);
+ }
+ virtual void processInclude(IncludeAST *include)
+ {
+ new QListViewItem(parentProject.top(), "<include>", include->projectName);
+ QMake::ASTVisitor::processInclude(include);
+ }
+
+ Viewer *v;
+ QValueStack<QListViewItem *> parentProject;
+};
+
+
+void Viewer::processAST(QMake::ProjectAST *projectAST, QListViewItem *globAfter)
+{
+ ViewerVisitor visitor(this);
+ visitor.processProject(projectAST);
+}
+
+#include "viewer.moc"
diff --git a/buildtools/lib/parsers/qmake/tests/viewer.h b/buildtools/lib/parsers/qmake/tests/viewer.h
new file mode 100644
index 00000000..8d0da49f
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/viewer.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef VIEWER_H
+#define VIEWER_H
+
+#include <qvaluestack.h>
+
+#include "viewerbase.h"
+
+namespace QMake {
+class ProjectAST;
+}
+
+class QListViewItem;
+
+class Viewer: public ViewerBase {
+Q_OBJECT
+public:
+ Viewer(QWidget *parent = 0, const char *name = 0);
+ void processAST(QMake::ProjectAST *projectAST, QListViewItem *globAfter = 0);
+public slots:
+ virtual void tabWidget2_selected(const QString&);
+ virtual void files_currentChanged(QListBoxItem*);
+ virtual void choose_clicked();
+ virtual void addAll_clicked();
+private:
+ QMake::ProjectAST *projectAST;
+ friend class ViewerVisitor;
+};
+
+#endif
diff --git a/buildtools/lib/parsers/qmake/tests/viewer_main.cpp b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp
new file mode 100644
index 00000000..8fdbc910
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/viewer_main.cpp
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <qapplication.h>
+#include "viewer.h"
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ Viewer viewer;
+ app.setMainWidget(&viewer);
+ viewer.show();
+ viewer.setWindowState(viewer.windowState() | Qt::WindowMaximized);
+
+ return app.exec();
+}
diff --git a/buildtools/lib/parsers/qmake/tests/viewerbase.ui b/buildtools/lib/parsers/qmake/tests/viewerbase.ui
new file mode 100644
index 00000000..976d4d0f
--- /dev/null
+++ b/buildtools/lib/parsers/qmake/tests/viewerbase.ui
@@ -0,0 +1,250 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ViewerBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ViewerBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Viewer</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter" row="0" column="0">
+ <property name="name">
+ <cstring>splitter5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>allLocation</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addAll</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Add All From Directory</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>choose</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Choose File to Add...</string>
+ </property>
+ </widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>files</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="hScrollBarMode">
+ <enum>Auto</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QSplitter">
+ <property name="name">
+ <cstring>splitter2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>source</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>2</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Parse Tree</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value 2</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value 3</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>ast</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Source to Be Written Back</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit" row="0" column="0">
+ <property name="name">
+ <cstring>writeBack</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>addAll</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>addAll_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>choose</sender>
+ <signal>clicked()</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>choose_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>files</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>files_currentChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>tabWidget2</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>ViewerBase</receiver>
+ <slot>tabWidget2_selected(const QString&amp;)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>addAll_clicked()</slot>
+ <slot>choose_clicked()</slot>
+ <slot>files_currentChanged( QListBoxItem * )</slot>
+ <slot>tabWidget2_selected( const QString &amp; )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/buildtools/lib/widgets/Mainpage.dox b/buildtools/lib/widgets/Mainpage.dox
new file mode 100644
index 00000000..56884c97
--- /dev/null
+++ b/buildtools/lib/widgets/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Buildtool Widgets Library
+
+This library contains widgets commonly used in buildtool support plugins.
+
+<b>Link with</b>: -lkdevbuildtoolswidgets
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/buildtools/widgets
+*/
+
diff --git a/buildtools/lib/widgets/Makefile.am b/buildtools/lib/widgets/Makefile.am
new file mode 100644
index 00000000..2277d9d0
--- /dev/null
+++ b/buildtools/lib/widgets/Makefile.am
@@ -0,0 +1,30 @@
+# This directory collects some classes related to
+# project management for the sole purpose that they
+# can be shared between parts.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets/propeditor $(all_includes)
+
+lib_LTLIBRARIES = libkdevbuildtoolswidgets.la
+libkdevbuildtoolswidgets_la_LDFLAGS = $(all_libraries)
+libkdevbuildtoolswidgets_la_LIBADD = $(top_builddir)/lib/interfaces/libkdevinterfaces.la \
+ $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) -lktexteditor
+libkdevbuildtoolswidgets_la_SOURCES = addenvvardlg.cpp addfilesdialog.cpp \
+ environmentdisplaydialog.cpp environmentdisplaydialogbase.ui environmentvariableswidget.cpp \
+ environmentvariableswidgetbase.ui envvartools.cpp makeoptionswidget.cpp makeoptionswidgetbase.ui \
+ removesubprojectdialog.cpp removesubprojectdlgbase.ui runoptionswidget.cpp runoptionswidgetbase.ui \
+ subclassesdlg.cpp subclassesdlgbase.ui
+
+METASOURCES = AUTO
+
+kdevelopbuildtoolsincludedir = $(includedir)/kdevelop/buildtools/widgets
+kdevelopbuildtoolsinclude_HEADERS = addenvvardlg.h addfilesdialog.h \
+ environmentvariableswidget.h environmentvariableswidgetbase.h envvartools.h makeoptionswidget.h \
+ makeoptionswidgetbase.h removesubprojectdialog.h removesubprojectdlgbase.h runoptionswidget.h \
+ runoptionswidgetbase.h subclassesdlg.h subclassesdlgbase.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces kdevutil
+DOXYGEN_PROJECTNAME = KDevelop Buildtool Widgets Library
+DOXYGEN_DOCDIRPREFIX = kdevbt
+include ../../../Doxyfile.am
+noinst_HEADERS = environmentdisplaydialog.h
diff --git a/buildtools/lib/widgets/addenvvardlg.cpp b/buildtools/lib/widgets/addenvvardlg.cpp
new file mode 100644
index 00000000..aaf82774
--- /dev/null
+++ b/buildtools/lib/widgets/addenvvardlg.cpp
@@ -0,0 +1,84 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <kbuttonbox.h>
+#include <klocale.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "addenvvardlg.h"
+
+
+AddEnvvarDialog::AddEnvvarDialog(QWidget *parent, const char *name)
+ : QDialog(parent, name, true)
+{
+ setCaption(i18n("Add Environment Variable"));
+
+ QLabel *varname_label = new QLabel(i18n("&Name:"), this);
+ varname_edit = new KLineEdit(this);
+ varname_edit->setFocus();
+ varname_label->setBuddy(varname_edit);
+
+ connect( varname_edit, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotTextChanged() ) );
+ QLabel *value_label = new QLabel(i18n("&Value:"), this);
+ value_edit = new KLineEdit(this);
+ value_label->setBuddy(value_edit);
+ QFontMetrics fm(value_edit->fontMetrics());
+ value_edit->setMinimumWidth(fm.width('X')*35);
+ connect( value_edit, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotTextChanged() ) );
+
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 10);
+
+ QGridLayout *grid = new QGridLayout(2, 2);
+ layout->addLayout(grid);
+ grid->addWidget(varname_label, 0, 0);
+ grid->addWidget(varname_edit, 0, 1);
+ grid->addWidget(value_label, 1, 0);
+ grid->addWidget(value_edit, 1, 1);
+
+ QFrame *frame = new QFrame(this);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addWidget(frame, 0);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ m_pOk = buttonbox->addButton( KStdGuiItem::ok());
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+ m_pOk->setDefault(true);
+ connect( m_pOk, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
+ buttonbox->layout();
+ layout->addWidget(buttonbox, 0);
+ slotTextChanged();
+}
+
+
+AddEnvvarDialog::~AddEnvvarDialog()
+{}
+
+void AddEnvvarDialog::slotTextChanged()
+{
+ m_pOk->setEnabled( !varname_edit->text().isEmpty() && !value_edit->text().isEmpty() );
+}
+
+#include "addenvvardlg.moc"
diff --git a/buildtools/lib/widgets/addenvvardlg.h b/buildtools/lib/widgets/addenvvardlg.h
new file mode 100644
index 00000000..0ffdbde1
--- /dev/null
+++ b/buildtools/lib/widgets/addenvvardlg.h
@@ -0,0 +1,54 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _ADDENVVARDLG_H_
+#define _ADDENVVARDLG_H_
+
+#include <qdialog.h>
+#include <klineedit.h>
+class QPushButton;
+
+/**
+Dialog to add environment variables.
+*/
+class AddEnvvarDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AddEnvvarDialog( QWidget *parent=0, const char *name=0 );
+ ~AddEnvvarDialog();
+
+ QString varname() const
+ { return varname_edit->text(); }
+ QString value() const
+ { return value_edit->text(); }
+ void setvarname(const QString name) const
+ { varname_edit->setText(name); }
+ void setvalue(const QString value) const
+ { value_edit->setText(value); }
+ private slots:
+ void slotTextChanged();
+private:
+ KLineEdit *varname_edit;
+ KLineEdit *value_edit;
+ QPushButton *m_pOk;
+};
+
+#endif
diff --git a/buildtools/lib/widgets/addfilesdialog.cpp b/buildtools/lib/widgets/addfilesdialog.cpp
new file mode 100644
index 00000000..8ba14539
--- /dev/null
+++ b/buildtools/lib/widgets/addfilesdialog.cpp
@@ -0,0 +1,78 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <klocale.h>
+#include <kapplication.h>
+
+#include <qcombobox.h>
+
+#include "addfilesdialog.h"
+#include "addfilesdialog.moc"
+
+AddFilesDialog::AddFilesDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name, bool modal):
+ KFileDialog(startDir, filter, parent, name, modal)
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Add Files Dialog");
+
+ m_extraWidget = new QComboBox(false, this);
+ m_extraWidget->insertItem(i18n("Copy File(s)"), 0);
+ m_extraWidget->insertItem(i18n("Create Symbolic Link(s)"), 1);
+ m_extraWidget->insertItem(i18n("Add Relative Path(s)"), 2);
+ m_extraWidget->setCurrentItem(config->readNumEntry("Mode"));
+ connect(m_extraWidget, SIGNAL(activated(int)), this, SLOT(storePreferred(int)));
+
+ setPreviewWidget(m_extraWidget);
+
+ setOperationMode(Opening);
+}
+
+
+AddFilesDialog::AddFilesDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name, bool modal, QComboBox *extraWidget):
+ KFileDialog(startDir, filter, parent, name, modal, extraWidget), m_extraWidget(extraWidget)
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Add Files Dialog");
+
+ m_extraWidget->insertItem(i18n("Copy File(s)"), 0);
+ m_extraWidget->insertItem(i18n("Create Symbolic Link(s)"), 1);
+ m_extraWidget->insertItem(i18n("Add Relative Path(s)"), 2);
+ m_extraWidget->setCurrentItem(config->readNumEntry("Mode"));
+ connect(m_extraWidget, SIGNAL(activated(int)), this, SLOT(storePreferred(int)));
+
+ setOperationMode(Opening);
+}
+
+
+AddFilesDialog::~AddFilesDialog()
+{
+}
+
+AddFilesDialog::Mode AddFilesDialog::mode( )
+{
+ return (AddFilesDialog::Mode)m_extraWidget->currentItem();
+}
+
+void AddFilesDialog::storePreferred( int index )
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Add Files Dialog");
+ config->writeEntry("Mode", index);
+}
diff --git a/buildtools/lib/widgets/addfilesdialog.h b/buildtools/lib/widgets/addfilesdialog.h
new file mode 100644
index 00000000..00b238a7
--- /dev/null
+++ b/buildtools/lib/widgets/addfilesdialog.h
@@ -0,0 +1,57 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef ADDFILESDIALOG_H
+#define ADDFILESDIALOG_H
+
+#include <kdeversion.h>
+#include <kfiledialog.h>
+
+class QComboBox;
+
+/**
+This class allows you to choose additional modes when adding
+files to the project.
+Currently available modes are Copy, Link and Relative.
+Relative means that file should be not copied but added
+with the relative path (e.g. ../../dir/filename)
+*/
+class AddFilesDialog : public KFileDialog
+{
+ Q_OBJECT
+public:
+ enum Mode { Copy, Link, Relative };
+
+ AddFilesDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name, bool modal);
+
+ AddFilesDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name, bool modal, QComboBox *extraWidget);
+
+ virtual ~AddFilesDialog();
+
+ virtual AddFilesDialog::Mode mode();
+
+private:
+ QComboBox * m_extraWidget;
+
+private slots:
+ void storePreferred(int index);
+};
+
+#endif
diff --git a/buildtools/lib/widgets/environmentdisplaydialog.cpp b/buildtools/lib/widgets/environmentdisplaydialog.cpp
new file mode 100644
index 00000000..7d01b031
--- /dev/null
+++ b/buildtools/lib/widgets/environmentdisplaydialog.cpp
@@ -0,0 +1,54 @@
+/* This file is part of the KDE project
+ Copyright (C) 2007 Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <unistd.h>
+#include <klistview.h>
+#include <qstringlist.h>
+
+#include "environmentdisplaydialog.h"
+
+extern char **environ;
+
+EnvironmentDisplayDialog::EnvironmentDisplayDialog(QWidget* parent, const char* name, bool modal, WFlags fl)
+: EnvironmentDisplayDialogBase(parent,name, modal,fl)
+{
+ QStringList environment;
+ char ** e = ::environ;
+
+ while ( *e )
+ {
+ environment << *e;
+ e++;
+ }
+
+ QStringList::ConstIterator it = environment.begin();
+ while( it !=environment.end() )
+ {
+ QStringList pair = QStringList::split( QChar('='), *it );
+ if ( pair.count() == 2 )
+ {
+ new QListViewItem( environmentListView, pair.first(), pair.last() );
+ }
+ ++it;
+ }
+}
+
+
+#include "environmentdisplaydialog.moc"
+
diff --git a/buildtools/lib/widgets/environmentdisplaydialog.h b/buildtools/lib/widgets/environmentdisplaydialog.h
new file mode 100644
index 00000000..af284a3b
--- /dev/null
+++ b/buildtools/lib/widgets/environmentdisplaydialog.h
@@ -0,0 +1,35 @@
+/* This file is part of the KDE project
+ Copyright (C) 2007 Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef ENVIRONMENTDISPLAYDIALOG_H
+#define ENVIRONMENTDISPLAYDIALOG_H
+
+
+#include "environmentdisplaydialogbase.h"
+
+class EnvironmentDisplayDialog : public EnvironmentDisplayDialogBase
+{
+Q_OBJECT
+
+public:
+ EnvironmentDisplayDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+};
+
+#endif
+
diff --git a/buildtools/lib/widgets/environmentdisplaydialogbase.ui b/buildtools/lib/widgets/environmentdisplaydialogbase.ui
new file mode 100644
index 00000000..8b41862f
--- /dev/null
+++ b/buildtools/lib/widgets/environmentdisplaydialogbase.ui
@@ -0,0 +1,111 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EnvironmentDisplayDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EnvironmentDisplayDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>583</width>
+ <height>523</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Environment</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Current Environment</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Variable</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>environmentListView</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>321</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>closeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>closeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EnvironmentDisplayDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/lib/widgets/environmentvariableswidget.cpp b/buildtools/lib/widgets/environmentvariableswidget.cpp
new file mode 100644
index 00000000..7ba08427
--- /dev/null
+++ b/buildtools/lib/widgets/environmentvariableswidget.cpp
@@ -0,0 +1,126 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "environmentvariableswidget.h"
+#include "environmentdisplaydialog.h"
+
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qlistview.h>
+#include "domutil.h"
+#include "addenvvardlg.h"
+
+
+void EnvironmentVariablesWidget::addVarClicked()
+{
+ AddEnvvarDialog dlg( this, "add env dialog" ) ;
+ if (QListViewItem *Item = listview->selectedItem())
+ {
+ dlg.setvarname(Item->text(0));
+ dlg.setvalue(Item->text(1));
+ }
+ if (!dlg.exec())
+ return;
+
+ (void) new QListViewItem(listview, dlg.varname(), dlg.value());
+}
+
+
+void EnvironmentVariablesWidget::editVarClicked()
+{
+ AddEnvvarDialog dlg( this, "edit env dialog" );
+ QListViewItem *item = listview->selectedItem();
+ if ( !item )
+ return;
+ dlg.setvarname(item->text(0));
+ dlg.setvalue(item->text(1));
+ if (!dlg.exec())
+ return;
+
+ item->setText(0,dlg.varname());
+ item->setText(1,dlg.value());
+}
+
+
+void EnvironmentVariablesWidget::removeVarClicked()
+{
+ delete listview->selectedItem();
+}
+
+
+EnvironmentVariablesWidget::EnvironmentVariablesWidget(QDomDocument &dom, const QString &configGroup,
+ QWidget *parent, const char *name)
+ : EnvironmentVariablesWidgetBase(parent, name),
+ m_dom(dom), m_configGroup(configGroup)
+{
+ readEnvironment(dom, configGroup);
+ connect( listview, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), this, SLOT( editVarClicked() ) );
+}
+
+
+EnvironmentVariablesWidget::~EnvironmentVariablesWidget()
+{}
+
+void EnvironmentVariablesWidget::readEnvironment(QDomDocument &dom, const QString &configGroup)
+{
+ m_dom = dom;
+ m_configGroup = configGroup;
+
+ listview->clear();
+
+ DomUtil::PairList list =
+ DomUtil::readPairListEntry(dom, m_configGroup, "envvar", "name", "value");
+
+ QListViewItem *lastItem = 0;
+
+ DomUtil::PairList::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ QListViewItem *newItem = new QListViewItem(listview, (*it).first, (*it).second);
+ if (lastItem)
+ newItem->moveItem(lastItem);
+ lastItem = newItem;
+ }
+}
+
+void EnvironmentVariablesWidget::changeConfigGroup( const QString &configGroup)
+{
+ m_configGroup = configGroup;
+}
+
+void EnvironmentVariablesWidget::accept()
+{
+ DomUtil::PairList list;
+ QListViewItem *item = listview->firstChild();
+ while (item) {
+ list << DomUtil::Pair(item->text(0), item->text(1));
+ item = item->nextSibling();
+ }
+
+ DomUtil::writePairListEntry(m_dom, m_configGroup, "envvar", "name", "value", list);
+}
+
+void EnvironmentVariablesWidget::environmentClicked()
+{
+ EnvironmentDisplayDialog dlg;
+ dlg.exec();
+}
+
+#include "environmentvariableswidget.moc"
diff --git a/buildtools/lib/widgets/environmentvariableswidget.h b/buildtools/lib/widgets/environmentvariableswidget.h
new file mode 100644
index 00000000..9f2d472e
--- /dev/null
+++ b/buildtools/lib/widgets/environmentvariableswidget.h
@@ -0,0 +1,59 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _ENVIRONMENTVARIABLESWIDGET_H_
+#define _ENVIRONMENTVARIABLESWIDGET_H_
+
+#include "environmentvariableswidgetbase.h"
+
+#include <qdom.h>
+
+/**
+Environment variables widget.
+*/
+class EnvironmentVariablesWidget : public EnvironmentVariablesWidgetBase
+{
+ Q_OBJECT
+
+public:
+ EnvironmentVariablesWidget( QDomDocument &dom, const QString &configGroup,
+ QWidget *parent=0, const char *name=0 );
+ ~EnvironmentVariablesWidget();
+
+ /// read in a set of environment variables from the DOM document
+ void readEnvironment(QDomDocument &dom, const QString &configGroup);
+
+ /// changes the path in the DOM structure where the environment variables are stored
+ void changeConfigGroup( const QString &configGroup);
+
+public slots:
+ void accept();
+
+private:
+ virtual void addVarClicked();
+ virtual void removeVarClicked();
+ virtual void editVarClicked();
+ virtual void environmentClicked();
+
+ QDomDocument &m_dom;
+ QString m_configGroup;
+};
+
+#endif
diff --git a/buildtools/lib/widgets/environmentvariableswidgetbase.ui b/buildtools/lib/widgets/environmentvariableswidgetbase.ui
new file mode 100644
index 00000000..d16cc613
--- /dev/null
+++ b/buildtools/lib/widgets/environmentvariableswidgetbase.ui
@@ -0,0 +1,200 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EnvironmentVariablesWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EnvironmentVariablesWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>566</width>
+ <height>451</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Environment Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="6" colspan="1">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>removevar_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>editvar_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Edit</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>addvar_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>A&amp;dd / Copy</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>60</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>environmentButton</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;nvironment</string>
+ </property>
+ </widget>
+ <spacer row="5" 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>171</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>addvar_button</sender>
+ <signal>clicked()</signal>
+ <receiver>EnvironmentVariablesWidgetBase</receiver>
+ <slot>addVarClicked()</slot>
+ </connection>
+ <connection>
+ <sender>removevar_button</sender>
+ <signal>clicked()</signal>
+ <receiver>EnvironmentVariablesWidgetBase</receiver>
+ <slot>removeVarClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editvar_button</sender>
+ <signal>clicked()</signal>
+ <receiver>EnvironmentVariablesWidgetBase</receiver>
+ <slot>editVarClicked()</slot>
+ </connection>
+ <connection>
+ <sender>environmentButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EnvironmentVariablesWidgetBase</receiver>
+ <slot>environmentClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>listview</tabstop>
+ <tabstop>addvar_button</tabstop>
+ <tabstop>removevar_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>addVarClicked()</slot>
+ <slot>removeVarClicked()</slot>
+ <slot>editVarClicked()</slot>
+ <slot>environmentClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/lib/widgets/envvartools.cpp b/buildtools/lib/widgets/envvartools.cpp
new file mode 100644
index 00000000..bc8eaf51
--- /dev/null
+++ b/buildtools/lib/widgets/envvartools.cpp
@@ -0,0 +1,31 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "envvartools.h"
+
+#include <qregexp.h>
+
+QString EnvVarTools::quote( const QString & arg )
+{
+ QString res = arg;
+ res.replace(QRegExp(QString::fromLatin1("'")), QString::fromLatin1("'\\''"));
+ res.prepend("\"");
+ res.append("\"");
+ return res;
+}
+
diff --git a/buildtools/lib/widgets/envvartools.h b/buildtools/lib/widgets/envvartools.h
new file mode 100644
index 00000000..65db1b8d
--- /dev/null
+++ b/buildtools/lib/widgets/envvartools.h
@@ -0,0 +1,28 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <qstring.h>
+
+/**Environment support functions.*/
+namespace EnvVarTools{
+
+ /**Quotes the argument using double quotes ("). Created as a replacement
+ for KShellProcess::quote.*/
+ QString quote(const QString &arg);
+
+}
diff --git a/buildtools/lib/widgets/makeoptionswidget.cpp b/buildtools/lib/widgets/makeoptionswidget.cpp
new file mode 100644
index 00000000..c720de8b
--- /dev/null
+++ b/buildtools/lib/widgets/makeoptionswidget.cpp
@@ -0,0 +1,64 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "makeoptionswidget.h"
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <qspinbox.h>
+#include <qlistview.h>
+#include <qgroupbox.h>
+
+#include "domutil.h"
+#include "environmentvariableswidget.h"
+
+MakeOptionsWidget::MakeOptionsWidget(QDomDocument &dom, const QString &configGroup,
+ QWidget *parent, const char *name)
+ : MakeOptionsWidgetBase(parent, name),
+ m_dom(dom), m_configGroup(configGroup)
+{
+ env_var_group->setColumnLayout( 1, Qt::Vertical );
+ m_environmentVariablesWidget = new EnvironmentVariablesWidget( dom, configGroup + "/make/envvars", env_var_group );
+
+ abort_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/make/abortonerror", true ));
+ jobs_box->setValue(DomUtil::readIntEntry(dom, configGroup + "/make/numberofjobs"));
+ runMultiJobs->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/make/runmultiplejobs"));
+ dontact_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/make/dontact"));
+ makebin_edit->setText(DomUtil::readEntry(dom, configGroup + "/make/makebin"));
+ prio_box->setValue(DomUtil::readIntEntry(dom, configGroup + "/make/prio"));
+}
+
+
+MakeOptionsWidget::~MakeOptionsWidget()
+{}
+
+
+void MakeOptionsWidget::accept()
+{
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/make/abortonerror", abort_box->isChecked());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/make/runmultiplejobs", runMultiJobs->isChecked());
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/make/numberofjobs", jobs_box->value());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/make/dontact", dontact_box->isChecked());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/make/makebin", makebin_edit->text());
+ DomUtil::writeIntEntry(m_dom, m_configGroup + "/make/prio", prio_box->value());
+
+ m_environmentVariablesWidget->accept();
+}
+
+#include "makeoptionswidget.moc"
diff --git a/buildtools/lib/widgets/makeoptionswidget.h b/buildtools/lib/widgets/makeoptionswidget.h
new file mode 100644
index 00000000..b6deeb05
--- /dev/null
+++ b/buildtools/lib/widgets/makeoptionswidget.h
@@ -0,0 +1,50 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _MAKEOPTIONSWIDGET_H_
+#define _MAKEOPTIONSWIDGET_H_
+
+#include "makeoptionswidgetbase.h"
+
+#include <qdom.h>
+
+class EnvironmentVariablesWidget;
+
+/**
+Make options widget.
+*/
+class MakeOptionsWidget : public MakeOptionsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ MakeOptionsWidget( QDomDocument &dom, const QString &configGroup,
+ QWidget *parent=0, const char *name=0 );
+ ~MakeOptionsWidget();
+
+public slots:
+ void accept();
+
+private:
+ QDomDocument &m_dom;
+ QString m_configGroup;
+ EnvironmentVariablesWidget* m_environmentVariablesWidget;
+};
+
+#endif
diff --git a/buildtools/lib/widgets/makeoptionswidgetbase.ui b/buildtools/lib/widgets/makeoptionswidgetbase.ui
new file mode 100644
index 00000000..4bddebd1
--- /dev/null
+++ b/buildtools/lib/widgets/makeoptionswidgetbase.ui
@@ -0,0 +1,194 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>MakeOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>make_options_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>507</width>
+ <height>366</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Make Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="6">
+ <property name="name">
+ <cstring>abort_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Abort on first error</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="6">
+ <property name="name">
+ <cstring>dontact_box</cstring>
+ </property>
+ <property name="text">
+ <string>Onl&amp;y display commands without actually executing them</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="6" column="0" rowspan="1" colspan="6">
+ <property name="name">
+ <cstring>env_var_group</cstring>
+ </property>
+ <property name="title">
+ <string>Environment &amp;Variables</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>makebin_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name of make executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="3" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>makebin_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="4" column="4">
+ <property name="name">
+ <cstring>jobs_box</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>30</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Num&amp;ber of jobs to run simultaneously:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>jobs_box</cstring>
+ </property>
+ </widget>
+ <spacer row="4" column="5">
+ <property name="name">
+ <cstring>spacer33</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>121</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="4" column="0">
+ <property name="name">
+ <cstring>spacer2</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="QCheckBox" row="3" column="0" rowspan="1" colspan="6">
+ <property name="name">
+ <cstring>runMultiJobs</cstring>
+ </property>
+ <property name="text">
+ <string>Run more than one &amp;job at a time</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>prio_label</cstring>
+ </property>
+ <property name="text">
+ <string>Make priority:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="2">
+ <property name="name">
+ <cstring>prio_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>19</number>
+ </property>
+ <property name="minValue">
+ <number>-20</number>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>runMultiJobs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>runMultiJobs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>jobs_box</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>abort_box</tabstop>
+ <tabstop>dontact_box</tabstop>
+ <tabstop>makebin_edit</tabstop>
+ <tabstop>jobs_box</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/lib/widgets/removesubprojectdialog.cpp b/buildtools/lib/widgets/removesubprojectdialog.cpp
new file mode 100644
index 00000000..37f9aaf8
--- /dev/null
+++ b/buildtools/lib/widgets/removesubprojectdialog.cpp
@@ -0,0 +1,52 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include "removesubprojectdialog.h"
+
+RemoveSubprojectDialog::RemoveSubprojectDialog(QString caption, QString question, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : RemoveSubprojectDlgBase(parent,name, modal,fl)
+{
+ setCaption(caption);
+ removeLabel->setText(question);
+}
+
+RemoveSubprojectDialog::~RemoveSubprojectDialog()
+{
+}
+
+/*$SPECIALIZATION$*/
+void RemoveSubprojectDialog::reject()
+{
+ QDialog::reject();
+}
+
+void RemoveSubprojectDialog::accept()
+{
+ QDialog::accept();
+}
+
+bool RemoveSubprojectDialog::removeFromDisk( )
+{
+ return removeCheckBox->isChecked();
+}
+
+
+#include "removesubprojectdialog.moc"
+
diff --git a/buildtools/lib/widgets/removesubprojectdialog.h b/buildtools/lib/widgets/removesubprojectdialog.h
new file mode 100644
index 00000000..89487511
--- /dev/null
+++ b/buildtools/lib/widgets/removesubprojectdialog.h
@@ -0,0 +1,52 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef REMOVESUBPROJECTDIALOG_H
+#define REMOVESUBPROJECTDIALOG_H
+
+#include "removesubprojectdlgbase.h"
+
+/**
+Subproject removal dialog.
+*/
+class RemoveSubprojectDialog : public RemoveSubprojectDlgBase
+{
+ Q_OBJECT
+
+public:
+ RemoveSubprojectDialog(QString caption, QString question, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~RemoveSubprojectDialog();
+ /*$PUBLIC_FUNCTIONS$*/
+ bool removeFromDisk();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void reject();
+ virtual void accept();
+
+};
+
+#endif
+
diff --git a/buildtools/lib/widgets/removesubprojectdlgbase.ui b/buildtools/lib/widgets/removesubprojectdlgbase.ui
new file mode 100644
index 00000000..cd36b6ff
--- /dev/null
+++ b/buildtools/lib/widgets/removesubprojectdlgbase.ui
@@ -0,0 +1,154 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>RemoveSubprojectDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>RemoveSubprojectDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>378</width>
+ <height>147</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>[REMOVE SUBPROJECT]</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>fileGroupBox</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>&amp;Information</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>removeLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[REMOVE QUESTION]</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>removeCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Also &amp;remove it from disk</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>noticeLabel</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Note:&lt;/b&gt; You will not be able to undo this operation.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>buttonLayout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>buttonSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>removeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RemoveSubprojectDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RemoveSubprojectDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/lib/widgets/runoptionswidget.cpp b/buildtools/lib/widgets/runoptionswidget.cpp
new file mode 100644
index 00000000..95fe4529
--- /dev/null
+++ b/buildtools/lib/widgets/runoptionswidget.cpp
@@ -0,0 +1,138 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "runoptionswidget.h"
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <klineedit.h>
+#include <urlutil.h>
+
+#include <qlistview.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qbuttongroup.h>
+#include <qlabel.h>
+
+#include "domutil.h"
+#include "environmentvariableswidget.h"
+
+
+RunOptionsWidget::RunOptionsWidget(QDomDocument &dom, const QString &configGroup,
+ const QString &buildDirectory, QWidget *parent, const char *name)
+ : RunOptionsWidgetBase(parent, name),
+ m_dom(dom), m_configGroup(configGroup)
+{
+ // Create the "Environment Variables" GUI
+ env_var_group->setColumnLayout( 1, Qt::Vertical );
+ m_environmentVariablesWidget = new EnvironmentVariablesWidget( dom, configGroup + "/run/envvars", env_var_group );
+
+ mainprogram_edit->completionObject()->setMode(KURLCompletion::FileCompletion);
+ mainprogram_edit->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ if( DomUtil::readEntry(dom, configGroup + "/run/mainprogram").isEmpty() && QFileInfo( buildDirectory ).exists() )
+ {
+ mainprogram_edit->setURL( buildDirectory );
+ mainprogram_edit->fileDialog()->setURL( KURL::fromPathOrURL(buildDirectory) );
+ }else if ( QFileInfo( DomUtil::readEntry(dom, configGroup + "/run/mainprogram") ).exists() )
+ {
+ QString program = DomUtil::readEntry(dom, configGroup + "/run/mainprogram");
+ if( QDir::isRelativePath(program) )
+ program = buildDirectory + "/" + program;
+ mainprogram_edit->setURL(program);
+ mainprogram_edit->fileDialog()->setURL( program );
+ }else
+ {
+ mainprogram_edit->setURL(QString());
+ mainprogram_edit->fileDialog()->setURL(QString());
+ }
+
+ cwd_edit->completionObject()->setMode(KURLCompletion::DirCompletion);
+ cwd_edit->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ if( DomUtil::readEntry(dom, configGroup + "/run/globalcwd").isEmpty() && QFileInfo( buildDirectory ).exists() )
+ {
+ cwd_edit->setURL( buildDirectory );
+ cwd_edit->fileDialog()->setURL( KURL::fromPathOrURL(buildDirectory) );
+ }else if( QFileInfo( DomUtil::readEntry(dom, configGroup + "/run/globalcwd") ).exists() )
+ {
+ cwd_edit->setURL(DomUtil::readEntry(dom, configGroup + "/run/globalcwd"));
+ cwd_edit->fileDialog()->setURL( KURL::fromPathOrURL( DomUtil::readEntry(dom, configGroup + "/run/globalcwd") ) );
+ }else
+ {
+ cwd_edit->setURL(QString());
+ cwd_edit->fileDialog()->setURL(QString());
+ }
+
+ if( configGroup == "/kdevautoproject" || configGroup == "/kdevtrollproject" )
+ {
+ mainProgramGroupBox->setCheckable(true);
+ mainProgramGroupBox->setChecked( DomUtil::readBoolEntry(dom, configGroup+"/run/useglobalprogram", false ) );
+ }else
+ {
+ delete notelabel;
+ }
+
+ // Read the main program command line arguments and store them in the edit box
+
+ runargs_edit->setText(DomUtil::readEntry(dom, configGroup + "/run/programargs"));
+ debugargs_edit->setText(DomUtil::readEntry(dom, configGroup + "/run/globaldebugarguments"));
+
+ startinterminal_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/run/terminal"));
+ autocompile_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/run/autocompile", false));
+ autoinstall_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/run/autoinstall", false));
+ autokdesu_box->setChecked(DomUtil::readBoolEntry(dom, configGroup + "/run/autokdesu", false));
+}
+
+
+RunOptionsWidget::~RunOptionsWidget()
+{}
+
+
+void RunOptionsWidget::accept()
+{
+ DomUtil::writeEntry(m_dom, m_configGroup + "/run/mainprogram", mainprogram_edit->url());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/run/programargs", runargs_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/run/globaldebugarguments", debugargs_edit->text());
+ DomUtil::writeEntry(m_dom, m_configGroup + "/run/globalcwd", cwd_edit->url());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/run/useglobalprogram", mainProgramGroupBox->isChecked());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/run/terminal", startinterminal_box->isChecked());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/run/autocompile", autocompile_box->isChecked());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/run/autoinstall", autoinstall_box->isChecked());
+ DomUtil::writeBoolEntry(m_dom, m_configGroup + "/run/autokdesu", autokdesu_box->isChecked());
+
+ m_environmentVariablesWidget->accept();
+}
+
+void RunOptionsWidget::mainProgramChanged( )
+{
+
+ if( mainProgramGroupBox->isChecked() && mainprogram_edit->url().isEmpty() )
+ {
+ mainprogram_label->setPaletteForegroundColor(QColor("#ff0000"));
+ }
+ else
+ {
+ mainprogram_label->unsetPalette();
+ }
+}
+
+#include "runoptionswidget.moc"
diff --git a/buildtools/lib/widgets/runoptionswidget.h b/buildtools/lib/widgets/runoptionswidget.h
new file mode 100644
index 00000000..758ef4b1
--- /dev/null
+++ b/buildtools/lib/widgets/runoptionswidget.h
@@ -0,0 +1,57 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _RUNOPTIONSWIDGET_H_
+#define _RUNOPTIONSWIDGET_H_
+
+#include "runoptionswidgetbase.h"
+
+#include <qdom.h>
+#include <kurl.h>
+
+class EnvironmentVariablesWidget;
+
+/**
+Run options widget.
+*/
+class RunOptionsWidget : public RunOptionsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ RunOptionsWidget( QDomDocument &dom, //!< document DOM
+ const QString &configGroup, //!< configuration group
+ const QString &buildDirectory, //!< project build directory
+ QWidget *parent=0, //!< parent widget
+ const char *name=0 //!< widget's name
+ );
+ ~RunOptionsWidget();
+
+public slots:
+ void accept();
+
+private:
+ virtual void mainProgramChanged( );
+
+ QDomDocument &m_dom;
+ QString m_configGroup;
+ EnvironmentVariablesWidget* m_environmentVariablesWidget;
+};
+
+#endif
diff --git a/buildtools/lib/widgets/runoptionswidgetbase.ui b/buildtools/lib/widgets/runoptionswidgetbase.ui
new file mode 100644
index 00000000..1163484c
--- /dev/null
+++ b/buildtools/lib/widgets/runoptionswidgetbase.ui
@@ -0,0 +1,257 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>RunOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>run_options_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>506</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Run Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>mainProgramGroupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Main Program</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>notelabel</cstring>
+ </property>
+ <property name="text">
+ <string>Note: These options override target specific settings.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>For Automake and QMake type projects, the proper way to set these options are per target in the &lt;b&gt;Automake Manager&lt;/b&gt; and &lt;b&gt;QMake Manager&lt;/b&gt;, respectively.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>runargs_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The command line arguments passed to the main program when run</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>mainprogram_label_2</cstring>
+ </property>
+ <property name="text">
+ <string>Run Arg&amp;uments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mainprogram_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>mainprogram_label</cstring>
+ </property>
+ <property name="text">
+ <string>Executa&amp;ble:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mainprogram_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="1">
+ <property name="name">
+ <cstring>mainprogram_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Full path to the executable</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>mainprogram_label_3</cstring>
+ </property>
+ <property name="text">
+ <string>Debug Ar&amp;guments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mainprogram_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>debugargs_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The command line arguments passed to the main program when debugged</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>mainprogram_label_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Working &amp;Directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mainprogram_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="4" column="1">
+ <property name="name">
+ <cstring>cwd_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Sets the current working directory for the launched process</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>autocompile_box</cstring>
+ </property>
+ <property name="text">
+ <string>Automaticall&amp;y compile before execution</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>If the program is not up-to-date with the source code, compile it before starting its execution</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>autoinstall_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Automatically install before execution</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>autokdesu_box</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;kdesu when installing</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>startinterminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>Start in e&amp;xternal terminal</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start the main program in an external terminal</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>env_var_group</cstring>
+ </property>
+ <property name="title">
+ <string>Environment &amp;Variables</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>mainprogram_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>run_options_widget</receiver>
+ <slot>mainProgramChanged()</slot>
+ </connection>
+ <connection>
+ <sender>mainprogram_edit</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>run_options_widget</receiver>
+ <slot>mainProgramChanged()</slot>
+ </connection>
+ <connection>
+ <sender>mainProgramGroupBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>run_options_widget</receiver>
+ <slot>mainProgramChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>startinterminal_box</tabstop>
+ <tabstop>autocompile_box</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in declaration">ksqueezedtextlabel.h</include>
+</includes>
+<slots>
+ <slot>mainProgramChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/lib/widgets/subclassesdlg.cpp b/buildtools/lib/widgets/subclassesdlg.cpp
new file mode 100644
index 00000000..5c3a0fef
--- /dev/null
+++ b/buildtools/lib/widgets/subclassesdlg.cpp
@@ -0,0 +1,122 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <qlistbox.h>
+#include <kurlrequester.h>
+
+#include "subclassesdlg.h"
+#include "subclassesdlg.moc"
+SubclassesDlg::SubclassesDlg(QString form, DomUtil::PairList &config, QString projectDir, QWidget* parent, const char* name, bool modal, WFlags fl)
+: SubclassesDlgBase(parent,name, modal,fl), m_form(form), m_config(config), m_projectDir(projectDir)
+{
+ subclass_url->setEnabled(false);
+
+ DomUtil::PairList::iterator it;
+ for ( it = config.begin(); it != config.end(); ++it )
+ {
+ if ((*it).second == form)
+ subclasses_box->insertItem(projectDir + (*it).first);
+ }
+}
+
+SubclassesDlg::~SubclassesDlg()
+{
+}
+
+/*$SPECIALIZATION$*/
+void SubclassesDlg::accept()
+{
+ QPtrList<DomUtil::Pair> pairsToRemove;
+
+ DomUtil::PairList::iterator it;
+ for ( it = m_config.begin(); it != m_config.end(); ++it )
+ {
+ if ((*it).second == m_form)
+ {
+ pairsToRemove.append(&(*it));
+ }
+ }
+
+ DomUtil::Pair *pair;
+ for ( pair = pairsToRemove.first(); pair; pair = pairsToRemove.next() )
+ {
+ m_config.remove(*pair);
+ }
+
+ for (int i = 0; i < (int)subclasses_box->count(); ++i)
+ {
+ m_config << DomUtil::Pair(subclasses_box->text(i).remove(0,m_projectDir.length()), m_form);
+ }
+
+ SubclassesDlgBase::accept();
+}
+
+
+void SubclassesDlg::newRelation()
+{
+ subclasses_box->setFocus();
+ subclasses_box->insertItem("");
+ subclasses_box->setCurrentItem(subclasses_box->count()-1);
+ subclass_url->setEnabled(true);
+ subclass_url->setURL("");
+ subclass_url->setFocus();
+}
+
+void SubclassesDlg::removeRelation()
+{
+ if (subclasses_box->currentItem() > -1)
+ {
+ QListBoxItem *item = subclasses_box->item(subclasses_box->currentItem());
+ int itemIdx = subclasses_box->currentItem();
+
+ if (item->prev())
+ {
+ subclasses_box->setCurrentItem(item->prev());
+ subclass_url->setURL(item->prev()->text());
+ }
+ else if (item->next())
+ {
+ subclasses_box->setCurrentItem(item->next());
+ subclass_url->setURL(item->next()->text());
+ }
+ else
+ {
+ subclass_url->setEnabled(false);
+ subclass_url->setURL("");
+ }
+ subclasses_box->removeItem(itemIdx);
+ }
+}
+
+void SubclassesDlg::changeCurrentURL(const QString &str)
+{
+ if ( subclasses_box->currentItem() > -1 )
+ {
+ subclasses_box->changeItem(str, subclasses_box->currentItem());
+ }
+}
+
+void SubclassesDlg::currentRelationChanged( QListBoxItem * item )
+{
+ if (item)
+ {
+ subclass_url->setEnabled(true);
+ subclass_url->setURL(item->text());
+ }
+}
+
diff --git a/buildtools/lib/widgets/subclassesdlg.h b/buildtools/lib/widgets/subclassesdlg.h
new file mode 100644
index 00000000..46b07b31
--- /dev/null
+++ b/buildtools/lib/widgets/subclassesdlg.h
@@ -0,0 +1,58 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef SUBCLASSESDLG_H
+#define SUBCLASSESDLG_H
+#include "domutil.h"
+#include "subclassesdlgbase.h"
+
+/**
+Subclass creation dialog.
+*/
+class SubclassesDlg : public SubclassesDlgBase
+{
+ Q_OBJECT
+
+public:
+ SubclassesDlg(QString form, DomUtil::PairList &config, QString projectDir, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~SubclassesDlg();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void accept();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void newRelation();
+ virtual void removeRelation();
+ virtual void changeCurrentURL(const QString &str);
+ virtual void currentRelationChanged(QListBoxItem *item);
+
+private:
+ QString m_form;
+ DomUtil::PairList &m_config;
+ QString m_projectDir;
+};
+
+#endif
+
diff --git a/buildtools/lib/widgets/subclassesdlgbase.ui b/buildtools/lib/widgets/subclassesdlgbase.ui
new file mode 100644
index 00000000..026ab2ca
--- /dev/null
+++ b/buildtools/lib/widgets/subclassesdlgbase.ui
@@ -0,0 +1,224 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>SubclassesDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SubclassesDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>514</width>
+ <height>278</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Related Subclasses</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>add_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Relation</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>remove_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove Relation</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QListBox" row="1" column="1" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>subclasses_box</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>subclass_url</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <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>90</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Related subclass &amp;location:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>subclass_url</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>310</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>subclass_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>changeCurrentURL(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>remove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>removeRelation()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>add_button</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>newRelation()</slot>
+ </connection>
+ <connection>
+ <sender>subclasses_box</sender>
+ <signal>clicked(QListBoxItem*)</signal>
+ <receiver>SubclassesDlgBase</receiver>
+ <slot>currentRelationChanged(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>subclasses_box</tabstop>
+ <tabstop>add_button</tabstop>
+ <tabstop>subclass_url</tabstop>
+ <tabstop>remove_button</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">changeCurrentURL(const QString &amp;str)</slot>
+ <slot access="protected">removeRelation()</slot>
+ <slot access="protected">newRelation()</slot>
+ <slot access="protected">currentRelationChanged(QListBoxItem *item)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/pascal/Makefile.am b/buildtools/pascal/Makefile.am
new file mode 100644
index 00000000..d975575a
--- /dev/null
+++ b/buildtools/pascal/Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util -I$(top_builddir)/buildtools/lib/widgets \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevpascalproject.la
+libkdevpascalproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevpascalproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la
+
+libkdevpascalproject_la_SOURCES = pascalproject_part.cpp pascalproject_widget.cpp pascalproject_optionsdlgbase.ui pascalprojectoptionsdlg.cpp pascalglobaloptionsdlg.cpp service.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevpascalproject.desktop
+
+rcdir = $(kde_datadir)/kdevpascalproject
+rc_DATA = kdevpascalproject.rc
+
+
+
+
diff --git a/buildtools/pascal/README.dox b/buildtools/pascal/README.dox
new file mode 100644
index 00000000..4f3b9897
--- /dev/null
+++ b/buildtools/pascal/README.dox
@@ -0,0 +1,13 @@
+/** \class PascalProjectPart
+This is the Pascal build tool part.
+
+Common build tool part part for all available pascal compilers (gpc, fpc, dcc).
+It holds no project file list and tries to abstract from their specifics.
+
+\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\maintainer <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\deprecated This class is deprecated, use GenericProjectPart (buildtools/generic) instead.
+
+*/
diff --git a/buildtools/pascal/kdevpascalproject.desktop b/buildtools/pascal/kdevpascalproject.desktop
new file mode 100644
index 00000000..05b7e507
--- /dev/null
+++ b/buildtools/pascal/kdevpascalproject.desktop
@@ -0,0 +1,93 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Pascal Project
+Comment[br]=Raktres Pascal
+Comment[ca]=Projecte Pascal
+Comment[da]=Pascal projekt
+Comment[de]=Pascal-Projekt für KDevelop
+Comment[el]=Έργο Pascal
+Comment[es]=Proyecto de Pascal
+Comment[et]=Pascali projekt
+Comment[eu]=Pascal proiektua
+Comment[fa]=پروژۀ پاسکال
+Comment[fr]=Projet en langage PASCAL
+Comment[ga]=Tionscadal Pascal
+Comment[gl]=Proxecto Pascal
+Comment[hi]=पास्कल परियोजना
+Comment[hu]=Pascal-projekt
+Comment[is]=Pascal verkefni
+Comment[it]=Progetto per Pascal
+Comment[ja]=Pascal プロジェクト
+Comment[ms]=Projek Pascal
+Comment[nds]=Pascal-Projekt
+Comment[ne]=पास्कल परियोजना
+Comment[nl]=Pascal-project
+Comment[pa]=ਪਾਸਕਲ ਪ੍ਰੋਜੈਕਟ
+Comment[pl]=Projekt: Pascal
+Comment[pt]=Projecto de Pascal
+Comment[pt_BR]=Projeto Pascal
+Comment[ru]=Проект Pascal
+Comment[sk]=Pascal projekt
+Comment[sl]=Projekt Pascal
+Comment[sr]=Pascal пројекат
+Comment[sr@Latn]=Pascal projekat
+Comment[sv]=Pascal-projekt
+Comment[ta]=பாஸ்கல் பிராஜக்ட்
+Comment[tg]=Лоиҳаи Pascal
+Comment[tr]=Pascal Projesi
+Comment[uz]=Pascal loyihasi
+Comment[uz@cyrillic]=Pascal лойиҳаси
+Comment[zh_CN]=Pascal 工程
+Comment[zh_TW]=Pascal 專案
+Name=KDevPascalProject
+Name[da]=KDevelop Pascal-projekt
+Name[de]=Pascal-Projekt (KDevelop)
+Name[hi]=के-डेव-पास्कल-परियोजना
+Name[nds]=Pascal-Projekt (KDevelop)
+Name[ne]=केडीई विकास पास्कल परियोजना
+Name[pl]=KDevProjektPascal
+Name[sk]=KDevPascalProjekt
+Name[sv]=KDevelop Pascal-projekt
+Name[ta]=கெடெவ் பாஸ்கல் பிராஜக்ட்
+Name[tg]=Лоиҳаи ПаскалKDev
+Name[zh_TW]=KDevelop Pascal 專案
+GenericName=Pascal Project
+GenericName[br]=Raktres Pascal
+GenericName[ca]=Projecte Pascal
+GenericName[da]=Pascal projekt
+GenericName[de]=Pascal-Projekt
+GenericName[el]=Έργο Pascal
+GenericName[es]=Proyecto de Pascal
+GenericName[et]=Pascali projekt
+GenericName[eu]=Pascal proiektua
+GenericName[fa]=پروژۀ پاسکال
+GenericName[fr]=Projet en langage PASCAL
+GenericName[ga]=Tionscadal Pascal
+GenericName[gl]=Proxecto Pascal
+GenericName[hi]=पास्कल परियोजना
+GenericName[hu]=Pascal-projekt
+GenericName[it]=Progetto in Pascal
+GenericName[ja]=Pascal プロジェクト
+GenericName[ms]=Projek Pascal
+GenericName[nds]=Pascal-Projekt
+GenericName[ne]=पास्कल परियोजना
+GenericName[nl]=Pascal-project
+GenericName[pl]=Projekt: Pascal
+GenericName[pt]=Projecto de Pascal
+GenericName[pt_BR]=Projeto Pascal
+GenericName[ru]=Проект Pascal
+GenericName[sk]=Pascal projekt
+GenericName[sl]=Projekt Pascal
+GenericName[sr]=Pascal пројекат
+GenericName[sr@Latn]=Pascal projekat
+GenericName[sv]=Pascal-projekt
+GenericName[ta]=பாஸ்கல் பிராஜக்ட்
+GenericName[tr]=Pascal Projesi
+GenericName[uz]=Pascal loyihasi
+GenericName[uz@cyrillic]=Pascal лойиҳаси
+GenericName[zh_CN]=Pascal 工程
+GenericName[zh_TW]=Pascal 專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevpascalproject
+X-KDevelop-Version=5
diff --git a/buildtools/pascal/kdevpascalproject.rc b/buildtools/pascal/kdevpascalproject.rc
new file mode 100644
index 00000000..9e7f46fd
--- /dev/null
+++ b/buildtools/pascal/kdevpascalproject.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="KDevPascalProject" version="2">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_build" />
+ <Separator/>
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar" noMerge="1">
+ <Action name="build_build" group="build_operations" />
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartplugin>
diff --git a/buildtools/pascal/pascalglobaloptionsdlg.cpp b/buildtools/pascal/pascalglobaloptionsdlg.cpp
new file mode 100644
index 00000000..a710db19
--- /dev/null
+++ b/buildtools/pascal/pascalglobaloptionsdlg.cpp
@@ -0,0 +1,132 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <qlayout.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <kconfig.h>
+
+#include "kdevcompileroptions.h"
+
+#include "service.h"
+#include "pascalproject_part.h"
+#include "pascalglobaloptionsdlg.h"
+
+PascalGlobalOptionsDlg::PascalGlobalOptionsDlg(PascalProjectPart *part, QWidget* parent, const char* name, WFlags fl)
+ :PascalProjectOptionsDlgBase(parent,name,fl), m_part(part)
+{
+ delete config_label;
+ delete config_combo;
+ delete addconfig_button;
+ delete removeconfig_button;
+ delete compiler_label;
+ delete configuration_layout;
+ delete configuration_line;
+ delete exec_label;
+ delete exec_edit;
+ delete mainSourceLabel;
+ delete mainSourceUrl;
+ delete defaultopts_button;
+
+
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Pascal'");
+
+ ServiceComboBox::insertStringList(compiler_box, offers, &service_names, &service_execs);
+
+ if (offers.isEmpty())
+ options_button->setEnabled(false);
+
+ currentCompiler = QString::null;
+
+ /*kdDebug() << ServiceComboBox::defaultCompiler() << endl;
+ kdDebug() << ServiceComboBox::itemForText(ServiceComboBox::defaultCompiler(), service_names) << endl;
+ kdDebug() << compiler_box->text(ServiceComboBox::itemForText(ServiceComboBox::defaultCompiler(), service_names)) << endl;
+*/
+ ServiceComboBox::setCurrentText(compiler_box, ServiceComboBox::defaultCompiler(), service_names);
+ compiler_box_activated(compiler_box->currentText());
+}
+
+PascalGlobalOptionsDlg::~PascalGlobalOptionsDlg()
+{
+}
+
+void PascalGlobalOptionsDlg::optionsButtonClicked()
+{
+ QString name = ServiceComboBox::currentText(compiler_box, service_names);
+ KDevCompilerOptions *plugin = m_part->createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, options_edit->text());
+ options_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+void PascalGlobalOptionsDlg::compiler_box_activated(const QString& text)
+{
+ kdDebug() << "text changed from " << currentCompiler << " to " << text << endl;
+ if (currentCompiler == text)
+ return;
+ if (!currentCompiler.isEmpty())
+ saveCompilerOpts(currentCompiler);
+ currentCompiler = text;
+ readCompilerOpts(currentCompiler);
+}
+
+void PascalGlobalOptionsDlg::accept()
+{
+ saveCompilerOpts(currentCompiler);
+
+ saveConfigCache();
+}
+
+void PascalGlobalOptionsDlg::saveCompilerOpts( QString compiler )
+{
+ configCache[compiler] = options_edit->text();
+}
+
+void PascalGlobalOptionsDlg::readCompilerOpts( QString compiler )
+{
+ QString settings = configCache[compiler];
+ if (settings.isEmpty())
+ {
+ KConfig *config = KGlobal::config();
+ config->setGroup("Pascal Compiler");
+ settings = config->readPathEntry(compiler);
+ }
+
+ options_edit->setText(settings);
+}
+
+void PascalGlobalOptionsDlg::readConfigCache( )
+{
+/* KConfig *config = KGlobal::config();
+ config->setGroup("Pascal Compiler");
+
+ QMap<QString, QString> settings = config->entryMap("Pascal Compiler");
+*/
+}
+
+void PascalGlobalOptionsDlg::saveConfigCache( )
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup("Pascal Compiler");
+
+ for (QMap<QString, QString>::iterator it = configCache.begin(); it != configCache.end(); ++it)
+ {
+ config->writeEntry(it.key(), it.data());
+ }
+}
+
+#include "pascalglobaloptionsdlg.moc"
diff --git a/buildtools/pascal/pascalglobaloptionsdlg.h b/buildtools/pascal/pascalglobaloptionsdlg.h
new file mode 100644
index 00000000..14da2221
--- /dev/null
+++ b/buildtools/pascal/pascalglobaloptionsdlg.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 PASCALGLOBALOPTIONSDLG_H
+#define PASCALGLOBALOPTIONSDLG_H
+
+#include <qmap.h>
+
+#include <ktrader.h>
+
+#include "pascalproject_optionsdlgbase.h"
+
+class PascalProjectPart;
+
+class PascalGlobalOptionsDlg : public PascalProjectOptionsDlgBase
+{
+ Q_OBJECT
+
+public:
+ PascalGlobalOptionsDlg(PascalProjectPart *part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~PascalGlobalOptionsDlg();
+
+public slots:
+ virtual void accept();
+
+protected slots:
+ virtual void optionsButtonClicked();
+ virtual void compiler_box_activated(const QString& text);
+
+private:
+ PascalProjectPart *m_part;
+ KTrader::OfferList offers;
+ QString currentCompiler;
+ QStringList service_names;
+ QStringList service_execs;
+ QMap<QString, QString> configCache;
+
+ void saveCompilerOpts(QString compiler);
+ void readCompilerOpts(QString compiler);
+
+ void readConfigCache();
+ void saveConfigCache();
+};
+
+#endif
diff --git a/buildtools/pascal/pascalproject_optionsdlgbase.ui b/buildtools/pascal/pascalproject_optionsdlgbase.ui
new file mode 100644
index 00000000..0f0b2324
--- /dev/null
+++ b/buildtools/pascal/pascalproject_optionsdlgbase.ui
@@ -0,0 +1,474 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>PascalProjectOptionsDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PascalProjectOptionsDlgBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Pascal Compiler</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>configuration_layout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>config_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Con&amp;figuration:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>config_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>config_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer17_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>8</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeconfig_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer18_2</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>
+ <widget class="QPushButton" row="6" column="4">
+ <property name="name">
+ <cstring>options_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>options_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Compiler op&amp;tions:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>compiler_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Pascal compiler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>exec_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="6" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>options_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>exec_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Compiler co&amp;mmand:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>configuration_line</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="5" column="3">
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="8" column="2">
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="7" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>400</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="7" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>defaultopts_button</cstring>
+ </property>
+ <property name="text">
+ <string>Load &amp;Default Compiler Options</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="9" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>mainSourceUrl</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>26</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="9" column="0">
+ <property name="name">
+ <cstring>mainSourceLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Main &amp;source file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compiler_box</cstring>
+ </property>
+ </widget>
+ <spacer row="12" column="1">
+ <property name="name">
+ <cstring>spacer1</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>
+<connections>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>compiler_box_activated(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>removeconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>configRemoved()</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>configComboTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>config_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>configChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>addconfig_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>configAdded()</slot>
+ </connection>
+ <connection>
+ <sender>options_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>optionsButtonClicked()</slot>
+ </connection>
+ <connection>
+ <sender>exec_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>options_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>mainSourceUrl</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>mainSourceUrl</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>compiler_box</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+ <connection>
+ <sender>defaultopts_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDefaultOptions()</slot>
+ </connection>
+ <connection>
+ <sender>defaultopts_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PascalProjectOptionsDlgBase</receiver>
+ <slot>setDirty()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>compiler_box</tabstop>
+ <tabstop>exec_edit</tabstop>
+ <tabstop>options_edit</tabstop>
+ <tabstop>options_button</tabstop>
+ <tabstop>defaultopts_button</tabstop>
+ <tabstop>mainSourceUrl</tabstop>
+ <tabstop>config_combo</tabstop>
+ <tabstop>addconfig_button</tabstop>
+ <tabstop>removeconfig_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">compiler_box_activated(const QString&amp;)</slot>
+ <slot access="protected">addconfig_button_clicked()</slot>
+ <slot access="protected">configRemoved()</slot>
+ <slot access="protected">configComboTextChanged(const QString&amp;)</slot>
+ <slot access="protected">configChanged(const QString&amp;)</slot>
+ <slot access="protected">optionsButtonClicked()</slot>
+ <slot access="protected">configAdded()</slot>
+ <slot access="protected">setDirty()</slot>
+ <slot access="protected">setDefaultOptions()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/pascal/pascalproject_part.cpp b/buildtools/pascal/pascalproject_part.cpp
new file mode 100644
index 00000000..3fe09420
--- /dev/null
+++ b/buildtools/pascal/pascalproject_part.cpp
@@ -0,0 +1,493 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 "pascalproject_part.h"
+
+#include <qdom.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qvaluestack.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qlabel.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kmessagebox.h>
+#include <klibloader.h>
+#include <kservice.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kprocess.h>
+
+#include "domutil.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevmakefrontend.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "kdevlanguagesupport.h"
+#include "kdevcompileroptions.h"
+#include "runoptionswidget.h"
+#include "envvartools.h"
+
+#include "pascalproject_widget.h"
+#include "pascalprojectoptionsdlg.h"
+#include "pascalglobaloptionsdlg.h"
+
+#include <kdevplugininfo.h>
+
+typedef KDevGenericFactory<PascalProjectPart> PascalProjectFactory;
+static const KDevPluginInfo data("kdevpascalproject");
+K_EXPORT_COMPONENT_FACTORY( libkdevpascalproject, PascalProjectFactory( data ) )
+
+PascalProjectPart::PascalProjectPart(QObject *parent, const char *name, const QStringList& )
+ :KDevBuildTool(&data, parent, name ? name : "PascalProjectPart" )
+{
+ setInstance(PascalProjectFactory::instance());
+ setXMLFile("kdevpascalproject.rc");
+
+ KAction *action;
+ action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8,
+ this, SLOT(slotBuild()),
+ actionCollection(), "build_build" );
+ action->setToolTip(i18n("Build project"));
+ action->setWhatsThis(i18n("<b>Build project</b><p>Runs the compiler on a main source file of the project. "
+ "The compiler and the main source file can be set in project settings, <b>Pascal Compiler</b> tab."));
+ action = new KAction( i18n("Execute Program"), "exec", 0,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Execute program"));
+ action->setWhatsThis(i18n("<b>Execute program</b><p>Executes the main program specified in project settings, <b>Run options</b> tab. "
+ "If nothing is set, the binary file with the same name as the main source file name is executed."));
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ this, SLOT(configWidget(KDialogBase*)) );
+
+// m_widget = new PascalProjectWidget(this);
+
+// QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?"));
+
+ // now you decide what should happen to the widget. Take a look at kdevcore.h
+ // or at other plugins how to embed it.
+
+ // if you want to embed your widget as an outputview, simply uncomment
+ // the following line.
+
+ // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" );
+
+}
+
+PascalProjectPart::~PascalProjectPart()
+{
+// delete m_widget;
+}
+
+/**
+ * @todo This should really be merged with FileTreeWidget::matchesHidePattern()
+ * and put in its own class. Currently this is repeated in scriptprojectpart.cpp, pascalproject_part.cpp, adaproject_part.cpp
+ */
+static bool matchesPattern(const QString &fileName, const QStringList &patternList)
+{
+ QStringList::ConstIterator it;
+ for (it = patternList.begin(); it != patternList.end(); ++it) {
+ QRegExp re(*it, true, true);
+ if (re.search(fileName) == 0 && re.matchedLength() == (int)fileName.length())
+ return true;
+ }
+
+ return false;
+}
+
+void PascalProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ m_buildDir = dirName;
+ m_projectDir = dirName;
+ m_projectName = projectName;
+
+ QDomDocument &dom = *projectDom();
+ // Set the default directory radio to "executable"
+ if (DomUtil::readEntry(dom, "/kdevpascalproject/run/directoryradio") == "" ) {
+ DomUtil::writeEntry(dom, "/kdevpascalproject/run/directoryradio", "executable");
+ }
+
+ loadProjectConfig();
+
+ // Put all files from all subdirectories into file list
+ QValueStack<QString> s;
+ int prefixlen = m_projectDir.length()+1;
+ s.push(m_projectDir);
+
+ QStringList includepatternList;
+ if ( languageSupport() )
+ {
+ KMimeType::List list = languageSupport()->mimeTypes();
+ KMimeType::List::Iterator it = list.begin();
+ while( it != list.end() ){
+ includepatternList += (*it)->patterns();
+ ++it;
+ }
+ }
+ QString excludepatterns = "*~";
+ QStringList excludepatternList = QStringList::split(",", excludepatterns);
+
+ QDir dir;
+ do {
+ dir.setPath(s.pop());
+ kdDebug(9033) << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it) {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir()) {
+ kdDebug(9033) << "Pushing: " << path << endl;
+ s.push(path);
+ }
+ else {
+ if (matchesPattern(path, includepatternList)
+ && !matchesPattern(path, excludepatternList)) {
+ kdDebug(9033) << "Adding: " << path << endl;
+ m_sourceFiles.append(path.mid(prefixlen));
+ } else {
+ kdDebug(9033) << "Ignoring: " << path << endl;
+ }
+ }
+ }
+ } while (!s.isEmpty());
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+void PascalProjectPart::closeProject()
+{
+}
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList PascalProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevpascalproject/run/envvars", "envvar", "name", "value");
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString PascalProjectPart::runDirectory() const
+{
+ QString cwd = defaultRunDirectory("kdevpascalproject");
+ if (cwd.isEmpty())
+ cwd = buildDirectory();
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+QString PascalProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevpascalproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+
+ return QString();
+}
+
+/** Retuns a QString with the debug command line arguments */
+QString PascalProjectPart::debugArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevpascalproject/run/globaldebugarguments");
+}
+
+
+/** Retuns a QString with the run command line arguments */
+QString PascalProjectPart::runArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevpascalproject/run/programargs");
+}
+
+QString PascalProjectPart::mainSource() const
+{
+ return projectDirectory() + "/" + m_mainSource;
+}
+
+void PascalProjectPart::setMainSource(QString fullPath)
+{
+ QString olddir = activeDirectory();
+ m_mainSource = fullPath.replace(QRegExp(QString(projectDirectory() + QString("/"))),"");
+ emit activeDirectoryChanged( olddir, activeDirectory() );
+}
+
+QString PascalProjectPart::projectDirectory() const
+{
+ return m_projectDir;
+}
+
+QString PascalProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+QString PascalProjectPart::activeDirectory() const
+{
+ QFileInfo fi(mainSource());
+ return fi.dirPath(true).replace(QRegExp(projectDirectory()),"");
+}
+
+QString PascalProjectPart::buildDirectory() const
+{
+ QFileInfo fi(mainSource());
+ return fi.dirPath(true);
+}
+
+void PascalProjectPart::listOfFiles(QStringList &result, QString path) const
+{
+ QDir d(path);
+ if (!d.exists())
+ return;
+ QFileInfoList *entries = const_cast<QFileInfoList*>(d.entryInfoList(QDir::Dirs | QDir::Files | QDir::Hidden));
+ for (QFileInfo *it = entries->first(); it; it = entries->next())
+ {
+ if ((it->isDir()) && (it->filePath() != path))
+ {
+// qWarning("entering dir %s", it->dirPath().latin1());
+ listOfFiles(result, it->dirPath());
+ }
+ else
+ {
+// qWarning("adding to result: %s", it->filePath().latin1());
+ result << it->filePath();
+ }
+ }
+}
+
+QStringList PascalProjectPart::allFiles() const
+{
+// QStringList files;
+
+// listOfFiles(files, projectDirectory());
+
+// return files;
+ return m_sourceFiles;
+}
+
+void PascalProjectPart::addFile(const QString& /*fileName*/)
+{
+}
+
+void PascalProjectPart::addFiles(const QStringList& /*fileList*/)
+{
+}
+
+void PascalProjectPart::removeFile(const QString& /*fileName*/)
+{
+}
+
+void PascalProjectPart::removeFiles(const QStringList& /*fileList*/)
+{
+}
+
+void PascalProjectPart::slotBuild()
+{
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ QString cmdline = m_compilerExec + " " + m_compilerOpts + " ";
+
+ if (cmdline.isEmpty())
+ {
+ KMessageBox::sorry(0, i18n("Could not find pascal compiler.\nCheck if your compiler settings are correct."));
+ return;
+ }
+
+ QFileInfo fi(mainSource());
+ cmdline += fi.fileName();
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(buildDirectory());
+ dircmd += " && ";
+
+ makeFrontend()->queueCommand(buildDirectory(), dircmd + cmdline);
+}
+
+void PascalProjectPart::slotExecute()
+{
+ partController()->saveAllFiles();
+
+ QDomDocument &dom = *(projectDom());
+ bool runInTerminal = DomUtil::readBoolEntry(dom, "/kdevpascalproject/run/terminal", true);
+
+ // Get the run environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE"
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry(*projectDom(), "/kdevpascalproject/run/envvars", "envvar", "name", "value");
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for (it = envvars.begin(); it != envvars.end(); ++it) {
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote((*it).second);
+ environstr += " ";
+ }
+
+ QString program = mainProgram();
+ program.prepend(environstr);
+ program += " " + DomUtil::readEntry(*projectDom(), "/kdevpascalproject/run/programargs");
+
+ appFrontend()->startAppCommand(buildDirectory(), program, runInTerminal);
+}
+
+void PascalProjectPart::changedFiles( const QStringList & fileList )
+{
+ KDevProject::changedFiles(fileList);
+}
+
+void PascalProjectPart::changedFile( const QString & fileName )
+{
+ KDevProject::changedFile(fileName);
+}
+
+void PascalProjectPart::projectConfigWidget( KDialogBase * dlg )
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Pascal Compiler"));
+ PascalProjectOptionsDlg *w = new PascalProjectOptionsDlg(this, vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ connect( dlg, SIGNAL(okClicked()), this, SLOT(loadProjectConfig()) );
+
+ vbox = dlg->addVBoxPage(i18n("Run Options"), i18n("Run Options"), BarIcon( "make", KIcon::SizeMedium ));
+ RunOptionsWidget *w3 = new RunOptionsWidget(*projectDom(), "/kdevpascalproject", buildDirectory(), vbox);
+ connect( dlg, SIGNAL(okClicked()), w3, SLOT(accept()) );
+
+}
+
+void PascalProjectPart::loadProjectConfig( )
+{
+ QDomDocument &dom = *(projectDom());
+
+ QString config = DomUtil::readEntry(dom, "/kdevpascalproject/general/useconfiguration", "default");
+ m_mainSource = DomUtil::readEntry(dom, QString("/kdevpascalproject/configurations/") + config + QString("/mainsource") );
+ m_compilerOpts = DomUtil::readEntry(dom, QString("/kdevpascalproject/configurations/") + config + QString("/compileroptions"));
+ m_compilerExec = DomUtil::readEntry(dom, QString("/kdevpascalproject/configurations/") + config + QString("/compilerexec"));
+
+ if (m_compilerExec.isEmpty())
+ {
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Pascal'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ m_compilerExec = (*it)->exec();
+ break;
+ }
+ }
+ }
+}
+
+void PascalProjectPart::configWidget( KDialogBase * dlg )
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Pascal Compiler"));
+ PascalGlobalOptionsDlg *w = new PascalGlobalOptionsDlg(this, vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+KDevCompilerOptions *PascalProjectPart::createCompilerOptions(const QString &name)
+{
+ KService::Ptr service = KService::serviceByDesktopName(name);
+ if (!service) {
+ kdDebug() << "Can't find service " << name;
+ return 0;
+ }
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory) {
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ KMessageBox::error(0, i18n("There was an error loading the module %1.\n"
+ "The diagnostics is:\n%2").arg(service->name()).arg(errorMessage));
+ exit(1);
+ }
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(this, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions")) {
+ kdDebug() << "Component does not inherit KDevCompilerOptions" << endl;
+ return 0;
+ }
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+
+ return dlg;
+}
+
+QString PascalProjectPart::defaultOptions( const QString compiler ) const
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup("Pascal Compiler");
+ return config->readPathEntry(compiler);
+}
+
+#include "pascalproject_part.moc"
+
+
+/*!
+ \fn PascalProjectPart::distFiles() const
+ */
+QStringList PascalProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir(projectDir);
+ QStringList files = dir.entryList( "Makefile");
+ return sourceList + files;
+}
diff --git a/buildtools/pascal/pascalproject_part.h b/buildtools/pascal/pascalproject_part.h
new file mode 100644
index 00000000..3273011d
--- /dev/null
+++ b/buildtools/pascal/pascalproject_part.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 __KDEVPART_PASCALPROJECT_H__
+#define __KDEVPART_PASCALPROJECT_H__
+
+#include <qguardedptr.h>
+
+#include "kdevbuildtool.h"
+
+class PascalProjectWidget;
+class KDialogBase;
+class KDevCompilerOptions;
+
+class PascalProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+public:
+ PascalProjectPart(QObject *parent, const char *name, const QStringList &);
+ ~PascalProjectPart();
+
+ virtual void openProject(const QString &dirName, const QString &projectName);
+ virtual void closeProject();
+
+ /**Returns the name of the main source file without extension.
+ All pascal compilers call the binary by that way*/
+ virtual QString mainProgram() const;
+ /**Main source file (like src/main.pp)*/
+ virtual QString mainSource() const;
+ virtual void setMainSource(QString fullPath);
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString activeDirectory() const;
+ /**The location of the main source file*/
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+
+ /**Returns everything in the project directory*/
+ virtual QStringList allFiles() const;
+ /**This does absolutelly nothing*/
+ virtual void addFile(const QString &fileName);
+ /**This does absolutelly nothing*/
+ virtual void addFiles(const QStringList &fileList);
+ /**This does absolutelly nothing*/
+ virtual void removeFile(const QString &fileName);
+ /**This does absolutelly nothing*/
+ virtual void removeFiles(const QStringList &fileList);
+
+ virtual void changedFiles( const QStringList & fileList );
+ virtual void changedFile( const QString & fileName );
+
+ KDevCompilerOptions *createCompilerOptions(const QString &name);
+
+ virtual QString defaultOptions(const QString compiler) const;
+ QStringList distFiles() const;
+
+public slots:
+ /**loads config from project file*/
+ void loadProjectConfig();
+
+private slots:
+ void slotBuild();
+ void slotExecute();
+ void projectConfigWidget(KDialogBase *dlg);
+ void configWidget(KDialogBase *dlg);
+
+private:
+ QGuardedPtr<PascalProjectWidget> m_widget;
+
+ void listOfFiles(QStringList &result, QString path) const;
+
+ QString m_buildDir;
+ QString m_projectDir;
+ QString m_projectName;
+
+ QString m_mainProg;
+ QString m_mainSource;
+ QString m_compilerExec;
+ QString m_compilerOpts;
+
+ QStringList m_sourceFiles;
+};
+
+#endif
diff --git a/buildtools/pascal/pascalproject_widget.cpp b/buildtools/pascal/pascalproject_widget.cpp
new file mode 100644
index 00000000..039c97e6
--- /dev/null
+++ b/buildtools/pascal/pascalproject_widget.cpp
@@ -0,0 +1,26 @@
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+
+#include <kdevcore.h>
+
+
+#include "pascalproject_part.h"
+#include "pascalproject_widget.h"
+
+
+PascalProjectWidget::PascalProjectWidget(PascalProjectPart *part)
+ : QWidget(0, "PascalProject widget")
+{
+ Q_UNUSED( part );
+}
+
+
+PascalProjectWidget::~PascalProjectWidget()
+{
+}
+
+
+#include "pascalproject_widget.moc"
diff --git a/buildtools/pascal/pascalproject_widget.h b/buildtools/pascal/pascalproject_widget.h
new file mode 100644
index 00000000..198cf794
--- /dev/null
+++ b/buildtools/pascal/pascalproject_widget.h
@@ -0,0 +1,25 @@
+#ifndef __PASCALPROJECT_WIDGET_H__
+#define __PASCALPROJECT_WIDGET_H__
+
+
+#include <qwidget.h>
+#include <qstring.h>
+
+
+class KDevProject;
+class PascalProjectPart;
+
+
+class PascalProjectWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+
+ PascalProjectWidget(PascalProjectPart *part);
+ ~PascalProjectWidget();
+
+};
+
+
+#endif
diff --git a/buildtools/pascal/pascalprojectoptionsdlg.cpp b/buildtools/pascal/pascalprojectoptionsdlg.cpp
new file mode 100644
index 00000000..7a97cea3
--- /dev/null
+++ b/buildtools/pascal/pascalprojectoptionsdlg.cpp
@@ -0,0 +1,210 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <kurlrequester.h>
+#include <kservice.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <qregexp.h>
+#include <qvalidator.h>
+
+#include "domutil.h"
+#include "kdevcompileroptions.h"
+
+#include "service.h"
+#include "pascalproject_part.h"
+#include "pascalprojectoptionsdlg.h"
+
+PascalProjectOptionsDlg::PascalProjectOptionsDlg(PascalProjectPart *part, QWidget* parent, const char* name, WFlags fl)
+ : PascalProjectOptionsDlgBase(parent,name, fl), m_part(part)
+{
+ config_combo->setValidator(new QRegExpValidator(QRegExp("^\\D.*"), this));
+
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Pascal'");
+
+ ServiceComboBox::insertStringList(compiler_box, offers, &service_names, &service_execs);
+
+ if (offers.isEmpty())
+ options_button->setEnabled(false);
+
+ allConfigs = allBuildConfigs();
+ config_combo->insertStringList(allConfigs);
+
+ dirty = false;
+
+ QDomDocument &dom = *(m_part->projectDom());
+ currentConfig = QString::null;
+ configChanged(DomUtil::readEntry(dom, "/kdevpascalproject/general/useconfiguration", "default"));
+}
+
+PascalProjectOptionsDlg::~PascalProjectOptionsDlg()
+{
+}
+
+QStringList PascalProjectOptionsDlg::allBuildConfigs()
+{
+ QDomDocument &dom = *(m_part->projectDom());
+
+ QStringList allConfigs;
+ allConfigs.append("default");
+
+ QDomNode node = dom.documentElement().namedItem("kdevpascalproject").namedItem("configurations");
+ QDomElement childEl = node.firstChild().toElement();
+ while (!childEl.isNull()) {
+ QString config = childEl.tagName();
+ kdDebug() << "Found config " << config << endl;
+ if (config != "default")
+ allConfigs.append(config);
+ childEl = childEl.nextSibling().toElement();
+ }
+
+ return allConfigs;
+}
+
+void PascalProjectOptionsDlg::accept()
+{
+ DomUtil::writeEntry(*m_part->projectDom(), "/kdevpascalproject/general/useconfiguration", currentConfig);
+ if (dirty)
+ {
+ saveConfig(currentConfig);
+ }
+}
+
+void PascalProjectOptionsDlg::compiler_box_activated( const QString& /*s*/ )
+{
+ QString exec = ServiceComboBox::currentText(compiler_box, service_execs);
+ exec_edit->setText(exec);
+}
+
+void PascalProjectOptionsDlg::saveConfig( QString config )
+{
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevpascalproject/configurations/" + config + "/";
+
+ DomUtil::writeEntry(dom, prefix + "compiler",
+ ServiceComboBox::currentText(compiler_box, service_names));
+ DomUtil::writeEntry(dom, prefix + "compileroptions", options_edit->text());
+ DomUtil::writeEntry(dom, prefix + "compilerexec", exec_edit->text());
+ DomUtil::writeEntry(dom, prefix + "mainsource", mainSourceUrl->url().replace(QRegExp(m_part->projectDirectory() + QString("/")),""));
+}
+
+void PascalProjectOptionsDlg::readConfig( QString config )
+{
+ QDomDocument dom = *m_part->projectDom();
+ QString prefix = "/kdevpascalproject/configurations/" + config + "/";
+
+ QString compiler = DomUtil::readEntry(dom, prefix + "compiler", "");
+
+ if (compiler.isEmpty())
+ {
+ offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Pascal'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ compiler = (*it)->name();
+ kdDebug() << "compiler is " << compiler << endl;
+ break;
+ }
+ }
+ }
+ ServiceComboBox::setCurrentText(compiler_box, compiler, service_names);
+
+ QString exec = DomUtil::readEntry(dom, prefix + "compilerexec", "");
+ if (exec.isEmpty())
+ exec = ServiceComboBox::currentText(compiler_box, service_execs);
+ exec_edit->setText(exec);
+ options_edit->setText(DomUtil::readEntry(dom, prefix + "compileroptions"));
+ mainSourceUrl->setURL(m_part->projectDirectory() + "/" + DomUtil::readEntry(dom, prefix + "mainsource"));
+}
+
+void PascalProjectOptionsDlg::configComboTextChanged(const QString &config)
+{
+ bool canAdd = !allConfigs.contains(config) && !config.contains("/") && !config.isEmpty();
+ bool canRemove = allConfigs.contains(config) && config != "default";
+ addconfig_button->setEnabled(canAdd);
+ removeconfig_button->setEnabled(canRemove);
+}
+
+
+void PascalProjectOptionsDlg::configChanged(const QString &config)
+{
+ if (config == currentConfig || !allConfigs.contains(config))
+ return;
+
+ if (!currentConfig.isNull() && dirty)
+ saveConfig(currentConfig);
+
+ currentConfig = config;
+ readConfig(config);
+ dirty = false;
+
+ config_combo->blockSignals(true);
+ config_combo->setEditText(config);
+ config_combo->blockSignals(false);
+}
+
+
+void PascalProjectOptionsDlg::configAdded()
+{
+ QString config = config_combo->currentText();
+
+ allConfigs.append(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+ configChanged(config);
+ setDirty(); // force saving
+}
+
+
+void PascalProjectOptionsDlg::configRemoved()
+{
+ QString config = config_combo->currentText();
+
+ QDomDocument dom = *m_part->projectDom();
+ QDomNode node = dom.documentElement().namedItem("kdevpascalproject").namedItem("configurations");
+ node.removeChild(node.namedItem(config));
+ allConfigs.remove(config);
+
+ config_combo->clear();
+ config_combo->insertStringList(allConfigs);
+
+ currentConfig = QString::null;
+ configChanged("default");
+}
+
+void PascalProjectOptionsDlg::optionsButtonClicked( )
+{
+ QString name = ServiceComboBox::currentText(compiler_box, service_names);
+ KDevCompilerOptions *plugin = m_part->createCompilerOptions(name);
+
+ if (plugin) {
+ QString flags = plugin->exec(this, options_edit->text());
+ options_edit->setText(flags);
+ delete plugin;
+ }
+}
+
+void PascalProjectOptionsDlg::setDirty( )
+{
+ dirty = true;
+}
+
+void PascalProjectOptionsDlg::setDefaultOptions( )
+{
+ if (!compiler_box->currentText().isEmpty())
+ options_edit->setText(m_part->defaultOptions(compiler_box->currentText()));
+}
+
+#include "pascalprojectoptionsdlg.moc"
diff --git a/buildtools/pascal/pascalprojectoptionsdlg.h b/buildtools/pascal/pascalprojectoptionsdlg.h
new file mode 100644
index 00000000..70e911de
--- /dev/null
+++ b/buildtools/pascal/pascalprojectoptionsdlg.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 PASCALPROJECTOPTIONSDLG_H
+#define PASCALPROJECTOPTIONSDLG_H
+
+#include <ktrader.h>
+
+#include "pascalproject_optionsdlgbase.h"
+
+class PascalProjectPart;
+class KDevCompilerOptions;
+
+class PascalProjectOptionsDlg : public PascalProjectOptionsDlgBase
+{
+ Q_OBJECT
+
+public:
+ PascalProjectOptionsDlg(PascalProjectPart *part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~PascalProjectOptionsDlg();
+
+public slots:
+ virtual void accept();
+
+protected slots:
+ virtual void compiler_box_activated(const QString &s);
+ void configComboTextChanged(const QString &config);
+ void configChanged(const QString &config);
+ void configAdded();
+ void configRemoved();
+ void optionsButtonClicked();
+ void setDirty();
+ void setDefaultOptions();
+
+private:
+ QStringList allConfigs;
+ QString currentConfig;
+ bool dirty;
+
+ KTrader::OfferList offers;
+ QStringList service_names;
+ QStringList service_execs;
+
+ PascalProjectPart *m_part;
+
+ void saveConfig(QString config);
+ void readConfig(QString config);
+ QStringList allBuildConfigs();
+};
+
+#endif
+
diff --git a/buildtools/pascal/service.cpp b/buildtools/pascal/service.cpp
new file mode 100644
index 00000000..c678f916
--- /dev/null
+++ b/buildtools/pascal/service.cpp
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <qcombobox.h>
+#include <qvaluelist.h>
+
+#include <kservice.h>
+#include <kdebug.h>
+
+#include "service.h"
+
+
+void ServiceComboBox::insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
+ QStringList *names, QStringList *execs)
+{
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ combo->insertItem((*it)->comment());
+ (*names) << (*it)->desktopEntryName();
+ (*execs) << (*it)->exec();
+ kdDebug() << "insertStringList item " << (*it)->name() << "," << (*it)->exec() << endl;
+ }
+}
+
+QString ServiceComboBox::currentText(QComboBox *combo, const QStringList &names)
+{
+ if (combo->currentItem() == -1)
+ return QString::null;
+ return names[combo->currentItem()];
+}
+
+void ServiceComboBox::setCurrentText(QComboBox *combo, const QString &str, const QStringList &names)
+{
+ QStringList::ConstIterator it;
+ int i = 0;
+ for (it = names.begin(); it != names.end(); ++it) {
+ if (*it == str) {
+ combo->setCurrentItem(i);
+ break;
+ }
+ ++i;
+ }
+}
+
+int ServiceComboBox::itemForText(const QString &str, const QStringList &names)
+{
+ QStringList::ConstIterator it;
+ int i = 0;
+ for (it = names.begin(); it != names.end(); ++it) {
+ if (*it == str) {
+ return i;
+ }
+ ++i;
+ }
+ return 0;
+}
+
+QString ServiceComboBox::defaultCompiler()
+{
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'Pascal'");
+ QValueList<KService::Ptr>::ConstIterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->property("X-KDevelop-Default").toBool()) {
+ return (*it)->name();;
+ }
+ }
+ return "";
+}
diff --git a/buildtools/pascal/service.h b/buildtools/pascal/service.h
new file mode 100644
index 00000000..30bb142b
--- /dev/null
+++ b/buildtools/pascal/service.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 SERVICE_H
+#define SERVICE_H
+
+#include <ktrader.h>
+
+class ServiceComboBox
+{
+public:
+ static void insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
+ QStringList *names, QStringList *execs);
+ static QString currentText(QComboBox *combo, const QStringList &names);
+ static void setCurrentText(QComboBox *combo, const QString &str, const QStringList &names);
+ static int itemForText(const QString &str, const QStringList &names);
+ static QString defaultCompiler();
+};
+
+#endif
diff --git a/buildtools/qmake/Makefile.am b/buildtools/qmake/Makefile.am
new file mode 100644
index 00000000..6b65901a
--- /dev/null
+++ b/buildtools/qmake/Makefile.am
@@ -0,0 +1,34 @@
+# Here resides the troll project part for tmake or qmake
+
+
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/buildtools/lib/parsers/qmake \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ -I$(top_builddir)/buildtools/lib/widgets $(all_includes)
+
+
+kde_module_LTLIBRARIES = libkdevtrollproject.la
+libkdevtrollproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevtrollproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/util/libkdevutil.la $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la \
+ $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la \
+ $(top_builddir)/buildtools/lib/parsers/qmake/libkdevqmakeparser.la
+
+libkdevtrollproject_la_SOURCES = choosesubprojectdlg.cpp \
+ choosesubprojectdlgbase.ui createscopedlg.cpp createscopedlgbase.ui disablesubprojectdlg.cpp \
+ disablesubprojectdlgbase.ui newwidgetdlg.cpp newwidgetdlgbase.ui \
+ projectconfigurationdlg.cpp projectconfigurationdlgbase.ui qmakedefaultopts.cpp \
+ qmakeoptionswidget.cpp qmakeoptionswidgetbase.ui qmakescopeitem.cpp scope.cpp \
+ trolllistview.cpp trollprojectpart.cpp trollprojectwidget.cpp
+
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevtrollproject.desktop kdevtmakeproject.desktop
+
+rcdir = $(kde_datadir)/kdevtrollproject
+rc_DATA = kdevtrollproject.rc
+noinst_HEADERS = createscopedlg.h disablesubprojectdlg.h qmakedefaultopts.h \
+ qmakeoptionswidget.h qmakescopeitem.h trolllistview.h
diff --git a/buildtools/qmake/README b/buildtools/qmake/README
new file mode 100644
index 00000000..0146b60f
--- /dev/null
+++ b/buildtools/qmake/README
@@ -0,0 +1 @@
+Please read the README.dox file. \ No newline at end of file
diff --git a/buildtools/qmake/README.dox b/buildtools/qmake/README.dox
new file mode 100644
index 00000000..6f0a4027
--- /dev/null
+++ b/buildtools/qmake/README.dox
@@ -0,0 +1,39 @@
+/** \class TrollProjectPart
+A projectmanager for qmake based projects.
+
+Loads and maintains .pro files (qmake project files). The trollprojectpart
+supports subprojects and qmake scopes. Qmake projects can be configured on
+project, subproject and file level.
+It will regenerate a projects .pro files dynamically as you add,remove or
+reconfigure (sub)projects. Unsupported qmake features will be left unchanged
+(hopefully) no major testing has been run yet.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+\authors <a href="mailto:thasart AT gmx.de">Thomas Hasart</a>
+
+\maintainer <a href="mailto:jsgaarde AT tdcspace.dk">Jakob Simon-Gaarde </a>
+
+\feature Loads and maintains .pro files (qmake project files).
+\feature Supports subprojects and qmake scopes.
+\feature Qmake projects can be configured on project, subproject and file level.
+\feature Regenerates a projects .pro files dynamically as you add,
+remove or reconfigure (sub)projects.
+\feature Unsupported qmake features will be left unchanged (hopefully)
+ no major testing has been run yet.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=trollproject&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">trollproject component at Bugzilla database</a>
+
+\requirement <a href="http://www.trolltech.com">QMake</a> >= 3.0.3
+
+\todo <b>Relative directories (priority 1)</b>
+ By default a qmake projects created with kdevelop must be distributable,
+ therefore all directory-selections must be relative the subproject where
+ it is used (user can override this ofcourse). So when a select-directory
+ dialog is opened getRelativeDirectory() (#include pathutil.h) should be
+ called.
+\todo <b>Ignore shell-expressions and qmake-functions (priority 2-3)</b>
+ FileBuffer should recognize and ignore shell-expressions and qmake-functions.
+ (Jakob Simon-Gaarde says: I'm on this one)
+
+
+*/
diff --git a/buildtools/qmake/choosesubprojectdlg.cpp b/buildtools/qmake/choosesubprojectdlg.cpp
new file mode 100644
index 00000000..20264144
--- /dev/null
+++ b/buildtools/qmake/choosesubprojectdlg.cpp
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 <kpushbutton.h>
+
+#include "trollprojectwidget.h"
+
+#include "choosesubprojectdlg.h"
+#include "scope.h"
+
+ChooseSubprojectDlg::ChooseSubprojectDlg(TrollProjectWidget *widget, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : ChooseSubprojectDlgBase(parent,name, modal,fl), m_widget(widget)
+{
+ connect(subprojects_view, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(itemSelected(QListViewItem *)));
+ if( m_widget->m_rootSubproject)
+ {
+ ChooseItem *it = new ChooseItem(m_widget->m_rootSubproject, subprojects_view, m_widget->m_rootSubproject->text(0));
+ it->setPixmap(0, *(m_widget->m_rootSubproject->pixmap(0)));
+ it->setOpen(true);
+ fillSubprojectsView(it);
+ subprojects_view->setSelected(it, true);
+ }
+}
+
+ChooseSubprojectDlg::~ChooseSubprojectDlg()
+{
+}
+
+/*$SPECIALIZATION$*/
+void ChooseSubprojectDlg::accept()
+{
+ if (!subprojects_view->currentItem())
+ return;
+ ChooseItem *item = dynamic_cast<ChooseItem*>(subprojects_view->currentItem());
+ if (!item)
+ return;
+ if ( item->subproject()->scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ return;
+
+ QDialog::accept();
+}
+
+ChooseItem::ChooseItem( QMakeScopeItem * spitem, QListViewItem * parent, QString text )
+ :KListViewItem(parent, text), m_spitem(spitem)
+{
+}
+
+ChooseItem::ChooseItem( QMakeScopeItem * spitem, QListView * parent, QString text )
+ :KListViewItem(parent, text), m_spitem(spitem)
+{
+}
+
+QMakeScopeItem * ChooseItem::subproject( )
+{
+ return m_spitem;
+}
+
+void ChooseSubprojectDlg::fillSubprojectsView( ChooseItem *item )
+{
+ if (!item->subproject())
+ return;
+
+ QListViewItem * sub_spitem = item->subproject()->firstChild();
+ while( sub_spitem ) {
+ QMakeScopeItem *spitem = dynamic_cast<QMakeScopeItem *>(sub_spitem);
+ if ( spitem && spitem->scope->scopeType() == Scope::ProjectScope )
+ {
+ ChooseItem *child_item = new ChooseItem(spitem, item, spitem->text(0));
+ child_item->setPixmap(0, *(spitem->pixmap(0)));
+ child_item->setOpen(true);
+ fillSubprojectsView(child_item);
+ }
+
+ sub_spitem = sub_spitem->nextSibling();
+ }
+}
+
+void ChooseSubprojectDlg::itemSelected( QListViewItem * it )
+{
+ if (!it)
+ return;
+ ChooseItem *item = dynamic_cast<ChooseItem*>(it);
+ if (!item)
+ return;
+ if ( item->subproject()->scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ buttonOk->setEnabled(false);
+ else
+ buttonOk->setEnabled(true);
+}
+
+QMakeScopeItem * ChooseSubprojectDlg::selectedSubproject( )
+{
+ if (subprojects_view->currentItem())
+ {
+ ChooseItem *item = dynamic_cast<ChooseItem*>(subprojects_view->currentItem());
+ if (item)
+ return item->subproject();
+ }
+
+ return 0;
+}
+
+
+#include "choosesubprojectdlg.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/qmake/choosesubprojectdlg.h b/buildtools/qmake/choosesubprojectdlg.h
new file mode 100644
index 00000000..689fe8b3
--- /dev/null
+++ b/buildtools/qmake/choosesubprojectdlg.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 CHOOSESUBPROJECTDLG_H
+#define CHOOSESUBPROJECTDLG_H
+
+#include <klistview.h>
+
+#include "choosesubprojectdlgbase.h"
+
+class QMakeScopeItem;
+class TrollProjectWidget;
+
+class ChooseItem: public KListViewItem
+{
+public:
+ ChooseItem(QMakeScopeItem *spitem, QListViewItem *parent, QString text);
+ ChooseItem(QMakeScopeItem *spitem, QListView *parent, QString text);
+
+ QMakeScopeItem *subproject();
+
+private:
+ QMakeScopeItem *m_spitem;
+};
+
+class ChooseSubprojectDlg : public ChooseSubprojectDlgBase
+{
+ Q_OBJECT
+
+public:
+ ChooseSubprojectDlg(TrollProjectWidget *widget, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ChooseSubprojectDlg();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ QMakeScopeItem *selectedSubproject();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ TrollProjectWidget *m_widget;
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void accept();
+ virtual void itemSelected(QListViewItem *it);
+
+private:
+ void fillSubprojectsView(ChooseItem *item);
+
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/choosesubprojectdlgbase.ui b/buildtools/qmake/choosesubprojectdlgbase.ui
new file mode 100644
index 00000000..12db29e2
--- /dev/null
+++ b/buildtools/qmake/choosesubprojectdlgbase.ui
@@ -0,0 +1,134 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ChooseSubprojectDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ChooseSubprojectDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Select Subproject</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Subprojects</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>subprojects_view</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ChooseSubprojectDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ChooseSubprojectDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>subprojects_view</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/qmake/createscopedlg.cpp b/buildtools/qmake/createscopedlg.cpp
new file mode 100644
index 00000000..439ddd70
--- /dev/null
+++ b/buildtools/qmake/createscopedlg.cpp
@@ -0,0 +1,100 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "createscopedlg.h"
+
+#include <klineedit.h>
+#include <kurlrequester.h>
+#include <qcheckbox.h>
+#include <kfile.h>
+#include <kcombobox.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kurlcompletion.h>
+
+#include "urlutil.h"
+#include "qmakescopeitem.h"
+#include "scope.h"
+#include "trollprojectwidget.h"
+
+CreateScopeDlg::CreateScopeDlg( QMakeScopeItem* item, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : CreateScopeDlgBase( parent, name, modal, fl ), m_item( item )
+{
+ incUrl->setMode( KFile::File | KFile::LocalOnly );
+ incUrl->setCaption( i18n( "Choose existing .pri file or give a new filename for creation" ) );
+ incUrl->setURL( QString("") );
+ incUrl->completionObject() ->setDir( item->scope->projectDir() );
+ incUrl->fileDialog()->setURL( KURL::fromPathOrURL( item->scope->projectDir() ) );
+}
+
+CreateScopeDlg::~CreateScopeDlg()
+{}
+
+void CreateScopeDlg::accept()
+{
+ Scope * s = 0;
+ switch ( comboScopeType->currentItem() )
+ {
+ case 0:
+ if ( !editScopeName->text().isEmpty() )
+ s = m_item->scope->createSimpleScope( editScopeName->text() );
+ break;
+ case 1:
+ if ( !editFunction->text().isEmpty() && !editArguments->text().isEmpty() )
+ s = m_item->scope->createFunctionScope( editFunction->text(), editArguments->text() );
+ break;
+ case 2:
+ if ( !incUrl->url().isEmpty() )
+ {
+ QString file = incUrl->url();
+ if ( !incUrl->url().endsWith( ".pri" ) )
+ file += ".pri";
+ if( file.find("/") == -1 )
+ file = m_item->scope->projectDir()+"/"+file;
+ // We need to create the file, because getRelativePath checks for existent paths
+ if( !QFile::exists(file) )
+ {
+ QFile temp(file);
+ if( temp.open(IO_WriteOnly) )
+ temp.close();
+ }
+ file = URLUtil::getRelativePath( m_item->scope->projectDir(), file );
+ s = m_item->scope->createIncludeScope( file );
+ }
+ break;
+ }
+ if ( s )
+ {
+ if ( !m_item->firstChild() )
+ new QMakeScopeItem( m_item, s->scopeName(), s );
+ else
+ {
+ QListViewItem* item = m_item->firstChild();
+ while( item->nextSibling() )
+ item = item->nextSibling();
+ QMakeScopeItem* newitem = new QMakeScopeItem( m_item, s->scopeName(), s );
+ newitem->moveItem( item );
+ }
+ QDialog::accept();
+ }
+ else
+ {
+ if ( KMessageBox::warningYesNo( this, i18n( "You did not specify all needed information. "
+ "The scope will not be created.<br>Do you want to abort the scope creation?" ),
+ i18n( "Missing information" ) ) == KMessageBox:: Yes )
+ QDialog::reject();
+ }
+}
+
+#include "createscopedlg.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/createscopedlg.h b/buildtools/qmake/createscopedlg.h
new file mode 100644
index 00000000..c8ed86ef
--- /dev/null
+++ b/buildtools/qmake/createscopedlg.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 CREATESCOPEDLG_H
+#define CREATESCOPEDLG_H
+
+#include "createscopedlgbase.h"
+
+class QMakeScopeItem;
+class TrollProjectWigdet;
+
+class CreateScopeDlg : public CreateScopeDlgBase
+{
+ Q_OBJECT
+
+public:
+ CreateScopeDlg( QMakeScopeItem* item, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~CreateScopeDlg();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void accept();
+private:
+ QMakeScopeItem* m_item;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/qmake/createscopedlgbase.ui b/buildtools/qmake/createscopedlgbase.ui
new file mode 100644
index 00000000..244589cd
--- /dev/null
+++ b/buildtools/qmake/createscopedlgbase.ui
@@ -0,0 +1,329 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CreateScopeDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CreateScopeDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>348</width>
+ <height>208</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create Scope</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Scopetype:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <item>
+ <property name="text">
+ <string>Simple Scope</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Function Scope</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Include File</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboScopeType</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose between the different types of new scopes</string>
+ </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>95</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Scope Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QWidgetStack" row="0" column="0">
+ <property name="name">
+ <cstring>widgetStack1</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>simplePage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editScopeName</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify the new scope name</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Scopename:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editScopeName</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>funcPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editFunction</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Function:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editFunction</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify the function name</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Arguments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editArguments</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify the list of function arguments, delimited by a comma</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>editArguments</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>incPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>2</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>incUrl</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="filter">
+ <string>*.pri</string>
+ </property>
+ <property name="mode">
+ <number>25</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose the .pri file to include</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Include File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>incUrl</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkNotInc</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;use !include instead of include</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use !include instead of include for the function scope</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>150</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;K</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>Ca&amp;ncel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>comboScopeType</sender>
+ <signal>activated(int)</signal>
+ <receiver>widgetStack1</receiver>
+ <slot>raiseWidget(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateScopeDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateScopeDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>editFunction</tabstop>
+ <tabstop>editArguments</tabstop>
+ <tabstop>comboScopeType</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>editScopeName</tabstop>
+ <tabstop>incUrl</tabstop>
+ <tabstop>checkNotInc</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/qmake/disablesubprojectdlg.cpp b/buildtools/qmake/disablesubprojectdlg.cpp
new file mode 100644
index 00000000..335bf33f
--- /dev/null
+++ b/buildtools/qmake/disablesubprojectdlg.cpp
@@ -0,0 +1,50 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "disablesubprojectdlg.h"
+#include <klistview.h>
+#include <qstringlist.h>
+#include "scope.h"
+#include "qmakescopeitem.h"
+
+DisableSubprojectDlg::DisableSubprojectDlg( const QStringList& projects, QWidget* parent, const char* name, WFlags fl )
+ : DisableSubprojectDlgBase( parent, name, fl )
+{
+ for( QStringList::const_iterator it = projects.begin(); it != projects.end(); ++it )
+ {
+ new QCheckListItem(subprojects_view, *it, QCheckListItem::CheckBox);
+ }
+}
+
+DisableSubprojectDlg::~DisableSubprojectDlg()
+{
+}
+
+QStringList DisableSubprojectDlg::selectedProjects()
+{
+ QStringList result;
+ QListViewItem* item = subprojects_view->firstChild();
+ while( item )
+ {
+ QCheckListItem* ci = dynamic_cast<QCheckListItem*>(item);
+ if( ci && ci->isOn() )
+ {
+ result << ci->text(0);
+ }
+ item = item->nextSibling();
+ }
+ return result;
+}
+
+#include "disablesubprojectdlg.moc"
+
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/disablesubprojectdlg.h b/buildtools/qmake/disablesubprojectdlg.h
new file mode 100644
index 00000000..13a27468
--- /dev/null
+++ b/buildtools/qmake/disablesubprojectdlg.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 DISABLESUBPROJECTDLG_H
+#define DISABLESUBPROJECTDLG_H
+
+#include "disablesubprojectdlgbase.h"
+
+class DisableSubprojectDlg : public DisableSubprojectDlgBase
+{
+ Q_OBJECT
+
+public:
+ DisableSubprojectDlg( const QStringList& projects, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~DisableSubprojectDlg();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ QStringList selectedProjects();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+};
+
+#endif
+
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/disablesubprojectdlgbase.ui b/buildtools/qmake/disablesubprojectdlgbase.ui
new file mode 100644
index 00000000..ffcc1d32
--- /dev/null
+++ b/buildtools/qmake/disablesubprojectdlgbase.ui
@@ -0,0 +1,126 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DisableSubprojectDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>DisableSubprojectDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>512</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Select Subprojects to disable</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Subprojects</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>subprojects_view</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;K</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>DisableSubprojectDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>DisableSubprojectDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/qmake/kdevtmakeproject.desktop b/buildtools/qmake/kdevtmakeproject.desktop
new file mode 100644
index 00000000..f1921523
--- /dev/null
+++ b/buildtools/qmake/kdevtmakeproject.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=TMake Project
+Comment[br]=Rektras TMake
+Comment[ca]=Projecte TMake
+Comment[da]=TMake-projekt
+Comment[de]=TMake-Projekt für KDevelop
+Comment[el]=Έργο TMake
+Comment[es]=Proyecto TMake
+Comment[et]=TMake projekt
+Comment[eu]=TMake proiektua
+Comment[fa]=پروژۀ TMake
+Comment[fr]=Projet avec TMake
+Comment[ga]=Comhad tionscadail TMake
+Comment[gl]=Proxecto TMake
+Comment[hi]=टी-मेक परियोजना
+Comment[hu]=TMake-projekt
+Comment[is]=TMake verkefni
+Comment[it]=Progetto per TMake
+Comment[ja]=TMake プロジェクト
+Comment[ms]=Projek TMake
+Comment[nds]=TMake-Projekt
+Comment[ne]=TMake परियोजना
+Comment[nl]=TMake-project
+Comment[pl]=Projekt: TMake
+Comment[pt]=Projecto TMake
+Comment[pt_BR]=Projeto TMake
+Comment[ru]=Проект TMake
+Comment[sk]=TMake projekt
+Comment[sl]=Projekt TMake
+Comment[sr]=TMake пројекат
+Comment[sr@Latn]=TMake projekat
+Comment[sv]=Tmake-projekt
+Comment[ta]=டிமேக் பிராஜக்ட்
+Comment[tg]=Лоиҳаи TMake
+Comment[tr]=TMake Projesi
+Comment[zh_CN]=TMake 工程
+Comment[zh_TW]=TMake 專案
+Name=KDevTMakeProject
+Name[da]=KDevelop TMake-projekt
+Name[de]=TMake-Projekt (KDevelop)
+Name[hi]=के-डेव-टी-मेक-परियोजना
+Name[nds]=TMake-Projekt (KDevelop)
+Name[ne]=KDevTMake परियोजना
+Name[pl]=KDevProjektTMake
+Name[sk]=KDevTMakeProjekt
+Name[sv]=KDevelop Tmake-projekt
+Name[ta]=கெடெவ் டிமேக் பிராஜக்ட்
+Name[tg]=KDevTСохтани лоиҳа
+Name[zh_TW]=KDevelop TMake 專案
+GenericName=TMake Project
+GenericName[br]=Raktres TMake
+GenericName[ca]=Projecte TMake
+GenericName[da]=TMake-projekt
+GenericName[de]=TMake-Projekt
+GenericName[el]=Έργο TMake
+GenericName[es]=Proyecto TMake
+GenericName[et]=TMake projekt
+GenericName[eu]=TMake proiektua
+GenericName[fa]=پروژۀ TMake
+GenericName[fr]=Projet avec TMake
+GenericName[ga]=Tionscadal TMake
+GenericName[gl]=Proxecto TMake
+GenericName[hi]=टी-मेक परियोजना
+GenericName[hu]=TMake-projekt
+GenericName[it]=Progetto per TMake
+GenericName[ja]=TMake プロジェクト
+GenericName[ms]=Projek TMake
+GenericName[nds]=TMake-Projekt
+GenericName[ne]=TMake परियोजना
+GenericName[nl]=TMake-project
+GenericName[pl]=Projekt: TMake
+GenericName[pt]=Projecto TMake
+GenericName[pt_BR]=Projeto TMake
+GenericName[ru]=Проект TMake
+GenericName[sk]=TMake projekt
+GenericName[sl]=Projekt TMake
+GenericName[sr]=TMake пројекат
+GenericName[sr@Latn]=TMake projekat
+GenericName[sv]=Tmake-projekt
+GenericName[ta]=டிமேக் பிராஜக்ட்
+GenericName[tg]=Лоиҳаи TMake
+GenericName[tr]=TMake Projesi
+GenericName[zh_CN]=TMake 工程
+GenericName[zh_TW]=TMake 專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevtrollproject
+X-KDevelop-Version=5
+X-KDevelop-Args=TMake
+
diff --git a/buildtools/qmake/kdevtrollproject.desktop b/buildtools/qmake/kdevtrollproject.desktop
new file mode 100644
index 00000000..5debaf34
--- /dev/null
+++ b/buildtools/qmake/kdevtrollproject.desktop
@@ -0,0 +1,95 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=QMake Project
+Comment[br]=Raktres QMake
+Comment[ca]=Projecte QMake
+Comment[da]=QMake-projekt
+Comment[de]=QMake-Projekt für KDevelop
+Comment[el]=Έργο QMake
+Comment[es]=Proyecto QMake
+Comment[et]=QMake projekt
+Comment[eu]=QMake proiektua
+Comment[fa]=پروژۀ QMake
+Comment[fr]=Projet avec QMake
+Comment[ga]=Tionscadal QMake
+Comment[gl]=Proxecto QMake
+Comment[hi]=क्यू-मेक परियोजना
+Comment[hu]=QMake-projekt
+Comment[is]=QMake verkefni
+Comment[it]=Progetto per QMake
+Comment[ja]=QMake プロジェクト
+Comment[ms]=Projek QMake
+Comment[nds]=QMake-Projekt
+Comment[ne]=QMake परियोजना
+Comment[nl]=QMake-project
+Comment[pa]=QMake ਪ੍ਰੋਜੈਕਟ
+Comment[pl]=Projekt: QMake
+Comment[pt]=Projecto QMake
+Comment[pt_BR]=Projeto QMake
+Comment[ru]=Проект QMake
+Comment[sk]=QMake projekt
+Comment[sl]=Projekt QMake
+Comment[sr]=QMake пројекат
+Comment[sr@Latn]=QMake projekat
+Comment[sv]=Qmake-projekt
+Comment[ta]=க்யுமேக் பிராஜக்ட்
+Comment[tg]=Лоиҳаи QMake
+Comment[tr]=QMake Projesi
+Comment[uz]=QMake loyihasi
+Comment[uz@cyrillic]=QMake лойиҳаси
+Comment[zh_CN]=QMake 工程
+Comment[zh_TW]=QMake 專案
+Name=KDevTrollProject
+Name[da]=KDevelop Troll-projekt
+Name[de]=QMake-Projekt (KDevelop)
+Name[hi]=के-डेव-ट्रॉल-परियोजना
+Name[nds]=QMake-Projekt (KDevelop)
+Name[ne]=KDevTroll परियोजना
+Name[pl]=KDevProjektTroll
+Name[sk]=KDevTrollProjekt
+Name[sv]=KDevelop Troll-projekt
+Name[ta]=கெடெவ் டிரால் பிராஜக்ட்
+Name[zh_TW]=KDevelop Troll 專案
+GenericName=QMake Project
+GenericName[br]=Raktres QMake
+GenericName[ca]=Projecte QMake
+GenericName[da]=QMake-projekt
+GenericName[de]=QMake-Projekt
+GenericName[el]=Έργο QMake
+GenericName[es]=Proyecto QMake
+GenericName[et]=QMake projekt
+GenericName[eu]=QMake proiektua
+GenericName[fa]=پروژۀ QMake
+GenericName[fr]=Projet avec QMake
+GenericName[ga]=Tionscadal QMake
+GenericName[gl]=Proxecto QMake
+GenericName[hi]=क्यू-मेक परियोजना
+GenericName[hu]=QMake-projekt
+GenericName[it]=Progetto per QMake
+GenericName[ja]=QMake プロジェクト
+GenericName[ms]=Projek QMake
+GenericName[nds]=QMake-Projekt
+GenericName[ne]=QMake परियोजना
+GenericName[nl]=QMake-project
+GenericName[pa]=QMake ਪ੍ਰੋਜੈਕਟ
+GenericName[pl]=Projekt: QMake
+GenericName[pt]=Projecto QMake
+GenericName[pt_BR]=Projeto QMake
+GenericName[ru]=Проект QMake
+GenericName[sk]=QMake projekt
+GenericName[sl]=Projekt QMake
+GenericName[sr]=QMake пројекат
+GenericName[sr@Latn]=QMake projekat
+GenericName[sv]=Qmake-projekt
+GenericName[ta]=க்யுமேக் பிராஜக்ட்
+GenericName[tg]=Лоиҳаи QMake
+GenericName[tr]=QMake Projesi
+GenericName[uz]=QMake loyihasi
+GenericName[uz@cyrillic]=QMake лойиҳаси
+GenericName[zh_CN]=QMake 工程
+GenericName[zh_TW]=QMake 專案
+ServiceTypes=KDevelop/Project
+X-KDE-Library=libkdevtrollproject
+X-KDevelop-Version=5
+X-KDevelop-Args=
diff --git a/buildtools/qmake/kdevtrollproject.rc b/buildtools/qmake/kdevtrollproject.rc
new file mode 100644
index 00000000..8f6e0048
--- /dev/null
+++ b/buildtools/qmake/kdevtrollproject.rc
@@ -0,0 +1,33 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevTrollProject" version="3">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_build_project" />
+ <Action name="build_install_project" />
+ <Action name="build_rebuild_project" />
+ <Action name="build_execute_project" />
+ <Action name="build_clean_project" />
+ <Action name="build_distclean_project" />
+ <Separator/>
+ <Action name="build_build_target" />
+ <Action name="build_install_target" />
+ <Action name="build_rebuild_target" />
+ <Action name="build_execute_target" />
+ <Action name="build_clean_target" />
+ <Action name="build_distclean_target" />
+ <Separator/>
+ <Action name="build_compilefile" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar" noMerge="1">
+ <Action name="build_build_project" group="build_operations" />
+ <Action name="build_rebuild_project" group="build_operations" />
+ <Action name="build_execute_project" group="build_operations" />
+ <Separator group="build_operations"/>
+ <Action name="build_build_target" group="build_operations" />
+ <Action name="build_rebuild_target" group="build_operations" />
+ <Action name="build_execute_target" group="build_operations" />
+ <Separator group="build_operations"/>
+ <Action name="build_compilefile" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/buildtools/qmake/newwidgetdlg.cpp b/buildtools/qmake/newwidgetdlg.cpp
new file mode 100644
index 00000000..7be62acd
--- /dev/null
+++ b/buildtools/qmake/newwidgetdlg.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * *
+ * 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 "newwidgetdlg.h"
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <kfiledialog.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <domutil.h>
+#include <qdom.h>
+#include <kstdguiitem.h>
+
+#define WIDGET_CAPTION_NAME "widget/property|name=caption/string"
+#define WIDGET_CLASS_NAME "class"
+#define WIDGET_SLOTS "slots"
+
+NewWidgetDlg::NewWidgetDlg(QStringList &newFileNames,QWidget* parent, const char* name, bool modal, WFlags fl)
+: NewWidgetDlgBase(parent,name,modal,fl),
+m_newFileNames(newFileNames)
+//=================================================
+{
+// Remove in kde 3.4 support
+ okayButton->setGuiItem(KStdGuiItem::ok());
+ cancelButton->setGuiItem(KStdGuiItem::cancel());
+}
+
+
+NewWidgetDlg::~NewWidgetDlg()
+//==============================================
+{
+}
+
+
+void NewWidgetDlg::subclassingPressed()
+//=====================================
+{
+ QMessageBox::information(0,"subclassing","");
+}
+
+
+void NewWidgetDlg::templateSelChanged()
+//=====================================
+{
+ QMessageBox::information(0,"template","");
+}
+
+void NewWidgetDlg::accept()
+//=========================
+{
+ QDomDocument doc;
+ DomUtil::openDOMFile(doc,"/home/jsgaarde/programming/kdevelop/domapp/clean_dialog.ui");
+ DomUtil::replaceText(doc,WIDGET_CLASS_NAME,"TestClass");
+ DomUtil::replaceText(doc,WIDGET_CAPTION_NAME,"Test Dialog");
+ QDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS);
+ QDomNodeList slotnodes = slotsElem.childNodes();
+ for (unsigned int i=0; i<slotnodes.count();i++)
+ {
+ QString msg;
+ QDomElement slotelem = slotnodes.item(i).toElement();
+ msg.sprintf("Slotname: %s\nReturns: %s\nAccess: %s",
+ slotelem.text().ascii(),
+ slotelem.attributeNode("returnType").value().ascii(),
+ slotelem.attributeNode("access").value().ascii());
+ QMessageBox::information(0,"Slots",msg);
+ }
+ DomUtil::saveDOMFile(doc,"/home/jsgaarde/programming/kdevelop/domapp/clean_dialog2.ui");
+ NewWidgetDlgBase::accept();
+}
+
diff --git a/buildtools/qmake/newwidgetdlg.h b/buildtools/qmake/newwidgetdlg.h
new file mode 100644
index 00000000..e8420df2
--- /dev/null
+++ b/buildtools/qmake/newwidgetdlg.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * *
+ * 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 NEWWIDGETDLG_H
+#define NEWWIDGETDLG_H
+
+#include "newwidgetdlgbase.h"
+#include "trollprojectwidget.h"
+
+class QStringList;
+class QDomDocument;
+
+class NewWidgetDlg : public NewWidgetDlgBase
+{
+public:
+ NewWidgetDlg(QStringList &newFileNames,QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~NewWidgetDlg();
+
+
+public slots:
+ virtual void subclassingPressed();
+ virtual void templateSelChanged();
+ virtual void accept();
+
+protected:
+ QStringList &m_newFileNames;
+};
+
+#endif
+
diff --git a/buildtools/qmake/newwidgetdlgbase.ui b/buildtools/qmake/newwidgetdlgbase.ui
new file mode 100644
index 00000000..7c3730ca
--- /dev/null
+++ b/buildtools/qmake/newwidgetdlgbase.ui
@@ -0,0 +1,229 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>NewWidgetDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>NewWidgetDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>650</width>
+ <height>474</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>New Widget</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Widget Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>subclassingCb</cstring>
+ </property>
+ <property name="text">
+ <string>Subclassing</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>captionLb</cstring>
+ </property>
+ <property name="text">
+ <string>Caption:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>subclassnameEd</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Subclass name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>captionEd</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>ui_classnameEd</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>classnameLb</cstring>
+ </property>
+ <property name="text">
+ <string>Class name:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>previewLb</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>0</width>
+ <height>160</height>
+ </size>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="2" colspan="1">
+ <item>
+ <property name="text">
+ <string>New Item</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>templateList</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="0">
+ <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>310</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>okayButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="27539">789cdd5c577362cb767e3fbf62eaf6db2d571ba148b9fc80028a244584cb0f9d480221b22497ffbb57afd06c103aa399a3721dfb72f7814f9bdddd2b876ee65ffff9a3512bfff8e7bffe31999a69d7fd701d33fef14f3f1b0cdefee33ffffdbffef8c7562ef7235e3b3bdb3ff2fff8973ffea1fc0ff743e5f07f88e7091f20ae09dec2fba69530dd778c77f8f959c274ff40303f7f9730ddb78c0fe879f39e30de770bc1fc7c89b1a3efbb7dc25bbc7ef7ca98d7632e111f24fa7209d3fc8f8279fce384e9fe94b1d0d74c98ee5705f3f36f09d3fd0963a64fd513a6fb05c1f4bced254cf49f09ced3f8278c997e7396307edf68c1349e3b4f18ef7b599fa3f15485b0f0cfdb84697d5b8c857ec398e9f13cdf16afc7aa88b792fcfc8031dff71709d37a5f05d37a7d8fb0ac271405337fde13a6e7f705333d0dc6bcde6004f3f3e78c451e0bc6c2cf36e13ccf6f4e190bfd63c4895e1308cbf77583317f5f3f30e6f9f43d637e3ee0f7f369fc304f98f897eeb37e2d18f378e13061d297316359df3de16dd1ffc098e7f3c78c793c37445c90efeb47c6f2fd66c2a41f79c662bf3dc6629ffcfd1d9127fa8bed2d19cf6e3116fedc3196f5ef254cf21e1296f1743361bc6feb8c793c8bf6b55d90e75d8fb03cefa709e3fdd0144cfc56fb8c65bdc58489fe9160febe622cf39f254ceb97fbc29f838469fd4f11ef6cc9f7435e30db8762cccfabd78489bea260d6774d7857f8759b307e5fe704f3fa5b8c77993faf82e97ea8332e307d57888d3c6f04f3f36e37615a9f15ccfee892318fa7b712267ed404f3fccf09d3fd05e1bd2d9e1fe5b79bdff5ccbf53c1ccbf47c1f902dedf26bcb7c5f33505f37c0f09d3fd57c1e46f429931f3c7dd33e6f92deaf36e5a5f7817bcbd85f79f19f3f3ea21615aff93609acf0e19337f5459303daf6f12a6f90f04f37a2d63e1cf96605eff7bc224afb9607ade05c2fbcc2f7f2698d77f9d30e9fbae607ade9f3016f923fd7bf9bdc236cac37518f3fcbe2d989f2f0ba6efab6dc269be5bc1fcfdd384697ccf98f96dca09d3f345c1fcfc3861d2971a63d6573f17ccfc7a13ccfc427ddb03fa49defe29615a4f9d31cfe74e13a6fb53c1ac2f8631cfa7af05f3f38384f179db15ccf3df244cfc6b3366f99bf384899e1dc1cc8f56c2f8bc1f09e6f12b840f581e6120989f47feed6fcbfabc134ccf872a6399af9330f1e34a30cf774758e6332f82e9799d4f98e84df7e979374a18ef9b29639647d009d3fc15c1f4bc318c999e702298e9a1f1ac3caf3463be6f1e1833bd6a2f6192df9b601eef967081e9f58782e9fbe646308f8ff67fb09dee3f0b667dba60ccf4eaba60e6cf56c2f4fc2363a6576f0be6f9761226f91e1136ec1f2c7fdfb0fd595cff8195f94c25617ade08dea1fb5dc6a2cfa58489ff82995fba9030c9ef52308d175a848df0e74930d37f9c303d9f632cfa712598e5f39830c90ff5adb023e3bb13c6c25f9d30cd5f154cebf3216183fad1616c985fdb09d3f81782e979f79c303e1f468c03eb575e30ebc37ec234dead601acf5608db3cc7f707c1cc8f90303d9f17ccf2d863bcc7cf1f254cfe662698e3a560c3f9ce5dc2a4ffbb82397ea1fc0a4ef8158e19337fc2a560a6679e307edf5e33667ea8ab84493e1dc1fc7c59f02ed6d3a14d38d1bb9330d94b4d30ebf375c224df73c6c28f8260e6877c7f8ffde34c30cf779a30f99b1bc1349fea33667e9a79c2c44f998ff9a95f13a67ce25230fb8b9260e6cf11e3c0f9dc4bc214af268279fc69c2e4bf9d60ce777612267dcd1176ac7fba97308d3f13ccf9c861c2c4cf3bc6ac7ff621618a571dc1fc3cf3d3317f1cd263923d98026191a71a264cfad4174cfae1cf198bfc1e0433ff6a82d97e0f13c6f15c5b308d675b8c595ebe9830c96b2c98f3839b84491f4f04b37e9e0966faea09937ebe09667af619b3bc552f61e29711ccfcdc4998d61704f3faaa09d37a8e05337f6682993f9384717d8671d28f61c2a41f5dc1ac7f8384e9fe5830eb773161f2670dc1ec2f4f13a678f52298d7779d30ae4f5718b3fee99030cdaf04f3fa5cc2747f2498ede32461b28f92608e47321edbbb6e254ce379c13c5f3f61aa2f647cd61f9f672cf23e4a98ec47e86779dbbd8449de587f1827faecbb8c59ffecbd60bedf17ccfa564f98eeef31667d315b8299fe8b84697c2798e4a30f1226fdc90966fb9a12167db1ed84899e8960d697fd84495fb605b37fde4d98d63b12ccf6964f98ec2d7d9fe3cb59c214dfee188b3fab264ceb3b16ccf2b50993fc851ed627bd4898d63716cceb3f4c98ecf34830f3f33c61f27f8f8279fd3b8c25fe0c12a6f518c1b4defa3461badf11ccf9727a9efd455930e7478d84291ebe0be6f55e244cfc147a257ebd254cf3cf05b33f3b4b98ee3f09667ebe274cf9475f30e717c584e93eebbf677fa58e05f37ca58449be0dc15c4fa13ddbe46ffc4430f1df29c62c4feb1326fb1809e6fca693308db710ccf6789030c5a71a6396573817ccfe232798f35f9730e99bac87e5a39e13267d9a09e6f9ab09d3fab6184b3e712198e5514d98e81d0866fdbe4a98f4e55630d70b9384c93e9f088b7cec4dc2a40fcf8239be9513267afb82591ebb09d3fc5dc15c0fdc274cf4ee30667bf55782391e61fcb3deeded917edf3066fe865ec2743f2798edb59230cd772d787f1bf16dc216d77fc458fcef2261a2e75e30fbdb43c1ac9f7b09d37aba82f768bf8ae4e9855fae9430f9dbbe60e6d776c2147f2f05337daf0993fef27c9efda1b18239ff6a0966fd7b4f98d6eb190b7fd17fb85d170e905fe188b08ca72e05f37a860993bedf326679d4a75a69a3d5efbe6bab1d5cebef3fbbe8d9ccf557d781b250dffe725fb8e2cbeb00d737cd4a71eb2ff32464aef477bc677f22d36f92497cff16b904dd42fe662ffafbf74bfc2772f90e9e2439988f57f63ecb6a69376dedbe63fe6fb417a757ed407d90d167df779967be412e7f992719dff4996cf8fa60577f3b7bd9eca33ef29be4d45ab3af6f92cab7d98b179f559fc2a70e6a4e37da027eb6681378c5bfc37b37ce4deff8c4dfc95e94eec1baba280b79efc01c4fbacf36d1d503b82ce027f8348814216dddbf99bd3cc30a15ad0e71570fd10e228543fd827fa35547bf35826ba0c748d184a8fa5bd98b42ad899ae6d1b2e96f434d31e625ca0aa530d05378454a46ac8933d2b7ef92cb5fcec786b0e239fade177c714e86abb7ac631d58fd026818eb57944b9449179f7bfb2e5ff62d7269c18a5ab8a2b8ea77586f115e87f03ad2c7fa4497e03ad567f03ad717fa12fe7ea5cb2897397ab46ff265df622f735dc1f53ce92aacf210565cd3757dad6ff4adbed3f7fa4137e07ad08fbaa9737a4be7f5b6ded1bbf0dd77a067ef7f35be50ec96f8ed327f979831048dd9072a0e74016e28fda88cb2cae1e594cf5cf16f16ee06d5526dd5d147aa8bd633c071b373b8b555ace3dfb21798a105974ffe9572a8aeea69a39e541f3e0dd4b31aaa1735526358ed04d7ecd494df676a0e97c76b4951bc16ea555fab37f5ae8aea500fd5913ad6bd7af40e237502144eb453a54c5da4b2b9c56fd80bc66a758a3c136ac06ed5997e51e7f07ea12ed5952a832c2ab07aafaab0f21a5c73f89cbd3cbed3ab0674d5912aa047dfab6b75a36e61ed33f0e271960efa3c075aabd49dfe4a4ef1557b11b91035f4a4c1d870a5ee754d3de83bd56019444a1ee16ac24aa749361ea98cef39a4845ed524a32d9557604340cf15f839a00238a550fa1d9827238fbf682f3e632f74b540ee4a81f5aa5db5a7f6515f68e5f58c1cdc868b6473c0b4cc819aa62ac0522245c6c4ffdf186b1c7aeb18a7ba20abea4fedf957eca59fb90c7ad117bd301e2ce4c104584513d65480ff3679b5510659b988bd084573a48234112ed382ff16a27c4c5bdf980e8c3c80b9233506e4d2f92cf7fecdf8229ae5c1fbb6c0daabfac874f52de846e428ad26aeb09ef15bcbd52fed67796f96b19d1a3e7f007f07eb313df3a4774d1f5608be0566ec26ddf8495efd257b8916cf323103786f0325cf60eb16f95e4f3cf688a34ce6c96eaa19fba8a17ce691dd20078fa8c074d5f01dbd81199a17333231631b9a81996caa797ed35ec47f88ddb4f5a199ea06f2b7ce16d084753493ad08bfe76bafa52dcdf8bdc0eb772b76e654de1833839cc7821e543ef412c287f57ddd5e3af8fd9656660ee31fe96bb3483e09a831af448179636da921752ef9ae498a9ae01dcc3b0cb9a46f66ded3f78803e4a9c7a6680ed5c01c61be36446d33baa7fa7fd15e623c8959e00bdac9543fe0cc05d40db2802893a8f7c7a0f5d5f4576b4e4c4955c0a21be61424b98008e4e465ced86666186b2cda5a93e509583f9a73b09b0ba026ad247a6af4d6bf6f2f1db0bfa8e451bb9e99921c4ac59b4bd2fb2893a585030d01d67265caa662aaa6069eb66eaee1d38dce9b5b88250b96d3ccdcb1dd57d97eaa38ce0ca9bd370f10bfc65cd57563bc9118b3eedbbe6c2f2fe622d685a6611ec1e21dc77689e59ef9db645dafc01a9ae6d9e44047ee81b35b90332fe055d665d3006ee4cdb6d931bb660f640663997d8c3873b623d2bc038aa1face1ca84ba0c6a5573753ef848f72f999bd809540fe67c6a600c1d7a24c222dde2ab08418556aaa091a833aa5e03fd65a67bddeb7c1b66cbb3e351758c9c42aba873ce9ab5bdb3155db85fc6d413edbf630428907885a3781d1ac7db27dc859c758c175b026edacf7a27fc95ebc99db813eb7cf104f7c8aed31168a078655989259d8a17db1233bb690dfd8b6eeda295a2de5d301fb2f2dc403e38cb7333bb70b8cb61ec79de1b8758eb41e680129db5733b2548f8e309f7ecaf8ae95fedb57ec45c50cefd9bee1ac53f24b682739b217fb1ee7b5457b08741c45dbb2c7f569bc8083167522d4a75c41f771051e32ae437b624bf6d474ec993d477a482ef5943fd4316b58d80b5db6037b895569ac0f36f4e13eb117b782806e73a42e4c07f2aee82b27c94a3cdbc80429b9b265a037d88aad9a23886f437b8cba1d3b16432db943acef6325ed319ebfe8be3a01ddedd81ada8e63bbab27df1865ee6cdd5eeb2b1b50cf62b5bdb63eb19bacbde085392970f5065710b32f63dbf6d6de61e6b8cc5222d7c06ea24c40f3b6ed3dc49d05ca213b16d51d31cf7e025feae0d3dc3ec46aa13ee5ee6bd736ccd83e4234016ae0a1038e4d8e3d74f435d63675940a4818a59d1ddf6fb017d23b8ef178778833e7e0d3425dd92dcce76b1cd5a6999aa4a2ae6d5e455f35415e0f3ff898168cd243b94ce0d55103bb6d77ec2ef0b96ff7e089992eda7d7b80d167b692b771be600b40b882da2f44fdd5215e5a313756ec654d2e0e31d002fc9beba133ea5e95a13e89d1718e71708a7491079e386beaaa68636745adea70b2b73398fd06fe0b3ecc393373def45cd067e09f5ec9c3aa43d7726d18a994ea50d1308cbcf6dc75c01681578e7b6ff529cba5bfc15e967ae770fc1e7e07b206e0770da3ca947936656e45adb6aee79eec295684d421f2cc896c8f1fb20f5582bf4f5ddfe4dc007b010b5384eaa7ab5fcd857d80e7c6fadc3ddbb3186739cecc967251ce0ddd0b649bedfa34c517d6a13f970b522b18aa093742e94f52fd4eb92fe8b11bebbaedb07605f6bea2bfcbdc760e79c80b54f0b76ee2a61851a21731a66867ceb959e401e459afaea5eb6e8c5c9bb3ddd01575a1a25e6ccc36bba05fd9fd9bfea7f642f4ced07b7a908983ec2e0f114d6ac6097b9b98cd3bd08832483ea0a70afa0dac62c8fd61b7d6cf1feaa9eaaa5d37c78a07b2140714b957f7a6cf80db90ed458b5210c3dc3b663712ff4536e0715cd11d02e547988f59b615b936ca85fd4bbf4e7de10e3c7d8cdebf4039125a7d0db2afc8ab7d77e24a9015185809d59b5d8864129703d43a1419a3b4ae6025a75126e6dd9d012de7902958fde006e0c3c6ea10b40c9eb6bbeec2f4909a6ab219cf9e6dec2e21beb6d0fa891aaa799de4672bf145ecc5215fa3d779b7a74ae3c833b5eca550d7a1628d812801f16480eb35dc4319f058ad5883f298637de6aec04e809254db78d6b45b88ff25eca70757d627aec2fd03a973a4d6713aaf9ed5ce8a0f53eb72f910473ba8fd91f6a23e5731ebaaa5de8a64e5608d9076555d6d59f7896fc15a7daedfa25c30aa94ad737594ee2ce5f9527581a69aa2bbb6bb205f18c1dda837f43413c964f81df233b56f3b9019058cc24eabac5c32f6e256628cc34c307e2eba5b1c59b2f959e2a9354dc82027c8a5a5cfa2712287ef7485ec07e27accf31729bf2e485586b137f2bbe1eedd036827f0cf9e981964012798c32efb3971e65803d420cfab6204eb7e2e17d171de59205db4aea1ebe841973279441979a8fb9eadb76d57dbb00719fbcb6ff08a9ea06c46ee1129b1189fb836e14c32c60f882aaee9727680dcacea63b765dae899e7ecc3880b1efcf8237832ca5497e706d6ed45e4d2c2cfb1c3463a79e8de507b853f73aeb840c34c4eef6b6b8f5132ab7b906f6829b11b78a58fcd0b7af45449732e2c7950acdcdacebb3ce8738c155db76deadc1759e6169eba346ec78cd1b2b2f6dd5f938b9c4f21deb6317f0bb1dfa26f60d4a9f229bb8f72c9c1a8bb6e0fbc31ed3d9a9578425e00bc30d46e79b7c3da2575499573e13952073c77fb3aaf4b9003d09eda8b5ec0c89a39982a3ea86f7ccccb20da19b67ee911adc797a55c025acb13e87afc74e40e567af52417c88bc102ee5dc192e7cec679b29b2ec8f6ca4dd4b6a75535590acb6a8b2cda99606ecdcc34ec896ec7c8015135f6fab6d7e432a728e09519a99db59d34af3fb117b81cd6d74394cbb1becb7458a72c97b939f1062aa4367ccbe28e6ad259b4b70e585c19f2ae9d4889b7cc893a6b19ad0ef32c13bc53bb503d2bee21473f02551a58e916e7c9443dd16255de7b1b2be6e8cb643ebfa17e71593f06fcf130fe09772a66ab7251151fa08e076b513de45236fe3a3d76db6ee25bd16b002533b68dd57e7ff44b25df062dbc01bbf290cf4d584307ae01d592e1e82fcf92958e4ddd62ee9ff1639bea4a976229f9ee21c8e5047b7a32a678e48969aba12e9a0bb63ec87780a78677ec604ac856a6c8598b598fc4a41c5b402d5a8a3df71ddf059b8b73cf40effb3cce047cd519cc40f34e1217d17bdb7b4b3eac8d6b0d1fea1791c720c9867cc408c63c5dd55bf29240e10dcc083516e4b8f1bb3daa3fd1c38cad4bf1a4c97ce52e385102763cf73dffe4fbd6c72e2b6618919a58c9f8a8a160416db6fda5adc24b3720c2ecc78a2cee3669c5be73935c9856cedae3b98953d0319f6a71910bd062eae01da98e8f7ade5367aa046b993807d94a9dfb11d2eb9fb34ca2a6e648f7fdc03ffb2154d52dacf97a2897aeba437e2efc4b461fa48e454f01fab0bf2e97157b913c4ce412efcfa2de03171ed2484bb9007fa0a629933470155023c49d39756b6a7e04d98a8508a839ffc8fa2ea9150be065cfcd2de49b55f0b10fee0e2ae7125bcd087c1ae918d9a97468638c825a0a79a878adad757b497d40b297c05d4e17f516339855eb8fef0b53055a869c27807d41a93e55b76ad78f31efaa638ccfc17f0b240b5e158d95c34eba530d73eba3249dcd410c883b54313fef40d6b38d3a3a632d937c3946e83acbc57e622fe27f5cb2178be7572093d2cd157ba1cfb13779631aa0539427f8b8df672c545a735a037ad079eafdcf33cf4b4f7f869da910a95183a8a52ce5ae1e012d076e1f75f380b9d8241efa29d2a230eb77595b59938b4bb4aad8b7859834864a2ec7d5572ee3cbea31ff8648dd055aa29697f42cfa2edb454f1af763a8435e55d2bb8fcf7b257bcbe4639be8e3c6beed67fa1d32cbd8f5807c01e63df473ec95d7388f957cc1aa57bf203f96d9b3db54bf2ce5d283911d8c39d597fe1533d65477630c7e0769cf416633ac5c14f8b227338378829516f7ed675c7bc8cab3fb6213b5dc9d9840ce3f056acae89762ded086d85ec6fe127d676975d6d6a0d619a7b82f76bea9aeb4c98f7571cf6504b9658533a31af590e30c71af543f9a0e64b65849838694637a01df3bf0a45d13f663a4a1d10b8b9cbc92be175dd3989199b27f37635fc4a8d6f11eabfe264b257579210bac9811d475d9b3b59beb7d95b117dec5370d7fc815fa9c77e864d7c5e80258cc007939f347fe1869a69dbc3ad252672df7ecd10a5c8165f7cea4ba5c78a85b629f052365b47c9faa64e9ca38b5e54bd82757985d66fa79abf165ad37d68fbd4b90cec274cc3dcc55e5fdf819f7c8c0e7fa53fb0879ba43af5cf4d18b5ab770e7e47ba09aaf2baa4fd063f91ef277861ca11a556a22f2070bc843176029e7766421073497ac9753e482f717e8c56a2eeabecde8d1267bc9d6d0333c21721673567bea2f15755f97fb8f3eee50983d53852c30d23ef390139b629420dcc18cd8bcb32c3cf2f3c997d5183fcf9092b5fd7fcc3f17a6acdeec0c62ce38555fcd94c94d807f2d88ad7472216b2b7f2e173af91575b7afaf7c85b3f60c35d1fa4dc9767d15e25a0fabb743fbe8c76e1f4fee5074e1fa04f2d09aaffb6b778a6733ea6acedae3d2fe3ff9280bdfbcf1b7306a0f635153e5403a3945f5ce1434e1cef5d50eee1e28aeb33ef6c7a4672972910aab027173e04ed28e025123bbd94e8ddcb32d61efdee9577f6f67a608b907f5b7a4660cfed43f580f1cbd872c6dbc127165af9fb516e4d3f08fbe99bc9dec20e25826b8139f3373bf855c0f18fb47ebf125d593cb33c60ebf1d6bdd01d4eb45b665ca3eb0978275dec22eec29ea63ec09bd9a0664fa1df4159eec4437dc95c9c7fa13f2ae7d3f416a265ca72e7725a29c9b98a7d18eed257cbe54d48bcbb10c27ae683bd8513219b98c3ef493b3bde4e5157c5e57dc91dfc61e9d679b218ecfd4818d7ad68ef991df8138d7d3cf1eaa2afb087562097d53ec16c5ac660faac581df77c6397fe0db2b75aaf4bf3c7a851a72c82305cb1c90bc4705c6b5be907691e39a1dca65a3bd6cdaa385cf45df076bb460d51287a38c649f64df5c9b317ab3987fcf6c09a939053a4e2137385303b641f2a06575032a20fb46b27b2e14496e3157d96c36f62d9c3d33dbfa8af2dfd87f3383a0b006b61ffa637ff61ad911d4df9518f34c4bc9ee1b65215e356c0d328078926dae8e22352e6ada996bfa337d6a77b587ac2066bf3d7c3d417c3f058f07194230187bce56f270c9da9aca67fe6e4d2958882cf184739f7bfbcb9ee807b9fcc97ea573ce1442e464016879645bacb24638a8fddb66dbb5f448f56186b9ee061f426885b67a072f17f78efba1837add03aade4d2374d53558955dd1b666e6dd73dca12bd60f3d7762fa7a6873d807b52b7af32bfbfb56ed849eebe06e528deb7df169b4021b9e5c5b9feb29f66e8399eb4ee81bdac7a65346b1fa2d01277b71efc296628726c656eee8adcb6599937b1e7f003986d395a0300288bffd8dfd7d48f316eec53ee1e892472d3d74ecdb6d8567f71c86601d5d9b8b7d0fdc05838ad3de70b61ac20b5013772fe229bab25fb837f47805ecb77d944d73498b5761e4ca3617c6d80b5dd62ebfb1bf6f0620994998a6ae9d64f39c5721b925b0ce1b90cd15eebf2bac46e26cb1e3d3b20f61861d6a1f6bae1819c0aa0edd34cc39be6f7a516fd341fd59c55c89f60dfccafece87fae567fbfb71d7322cfc83bee13d2d393122d56f3c6b143b9063a804aafac46dc7332c51abc182700737bc207506e51269ecba6a780d6fe11d7de2267bf1d83b77a1180e5ddb35a422c8d84bf8757bb1c7e6c81e83648ec2b1ca533ce6bd07c731146b4d3c256155de55dca18995da3e584bcc32bafa055780792078b436bc16fa085638f5cd0d5e4c2ca5c99fc7e1c4e4819a57aca0973dcb0fbf79fada79fefad419b5e35c28b95e92cc9ce79af0994ad2711b4fe4d82664e707e61032971148097f07a3069081348c371ee27f379cbab18f63e592947dfaafc85cec06e26438d347317fc02cd1a6b812b01a345fb7173d08e71a7b4ce1c2bcd8ad14e99aa2d3c98e6a8c2aba0114695336cfe152efc433fd1025afd49e3f0b6588bc8bf48cf8c58f92c99c35376dd0de9cba05afd1036f223d23957ee7f4e5f8a2db76e26a16f2533bb00e1ea29caac95926adbea9e8ac6e15abcae86d21c241846fd873a0ab611670058c2a48059fa799731ebcecb5f81599905c22c716fe1434f72ae58bcbdfff855f892f404bc0bd6890ae19c77cd70d71451395faf56ad9095cefb92cdfe97301655a4b75e33473afce1ab62a971966070b3f3723dc7fa475498cd9b8bfffd97bb4563c41751cadc6fa5009d598a1a909cc5150cb7d78b9aadcb958e2033eed963d554a19249ddb5ada4a7d835ca0c28b72d60fa16643e63c8c59cd1fbf622fbea0abdac63d1c1bfbfa166c7864e2b9f7e52f0f64cf57e423a73f2406656a5296256a156ada261ff6e1cc39686bcccaeae17a997fadc8e78bf1054f3a44c9c41dbdaaaea8beb90837e600328106dacd2347cfa95a9e4f4ebb79c0d333aa4fb07eab738f46f6da72fc3dde6d0ac58ced64fb01b182e8855bc84d2799fdea5f8e2f7ecbcce17501686826e12edcfb7d888697e63a3c70cd99958bec98644fc4bb957bcb6e77532dbb802ec6f8d0c05f9dacf93188fd25736f20fbd0639685cbd8cb86f3639fdacbeac57b9aaeaa77adb317b68eddc0cc09a9150f2bbb0e2233cab267a95e21ff57c7ce8e3255d78645d1ce4d3afd0bf50664cae1112829c61c2fb3ae95fdeb2f9ee75f3bb31d3bd8e011c67637f4f5692887a69273e475ae1357f6053299bd74a57cc68791fe0cc248175dd5e4cd2e7640cf3cd1037edc28f3a48ff0345c2fed0f7df8bdf3577f2fb67275b1af3982ace215f4f730e440e01d88a10d96411dfbbf55dbb33d3cb79cdd89aae2abee2fc06e2698f954ec59d882faa4e1cab1ea750d7fe0e65177e33da2d31d87219eefefc73317ebb5ef2fc497e52b5b2fe0af0ce31948b8dad1b3854b370879888713deadcdca65dd57f1efc6ccc215a1a2ded6875069c53dd29843bfaa779373733c2361ddbeb977c7fa08aba1e5997197f55f59b9fc3c1f5bf5e37cde78807a06f117a24e0fdeafcca1effb921b28981f4f867ffcf51bfdf22dfef62def2fcd7968d98ebdc53a7e0895d638e0ef4d6d50b790cd9debfb28135d473b19f3391b857d9895dfa4ff4a7cf9c003fa55ee047f6535897591adaa1ee44a4520cb9b43db3135f3e876c2b65790378f3187092083b19faa575bd3795f32b53051b73ea776207ab958c105e5f331b7c21ed54e3c7b126a104f6ea3ef021c6532e49330ebbf25fc157bc9fc1b23743682cf823fc51e22f5055dd75cd8b63ab72d88a9f177ad0b33365e1f796fef21eba9411d5030757de01776663bfad06d836ec62a349e4119d4a7bc52ac47f1f30034f8125e033c011fcf1078f63a935f389fbc49266b1756c05ddd8ffa1b730acbfbfc985f809784881aebad98f18ce115a096d9078ddfc773f121ee52c15ab903c17b5c74ce93cf7ae289e22e563df48bc13ef646e3aed984bbf7abbeecebf165eddf7ff9d4c7595a199f5791735eddcc6f2357ff7d98ecef2557ffeed6f462e5b9cfd6f90bf6b27e65e20ef256f1ea48a387994ba8fbf09e7af6ab7b29ab7d96e59ccbb37c1bedf8977e8fbc41362bbd10e19d4bab240da2dfec679fcbc66b3997b9cc29f8df27d9a013cbded81afe727c59fa8a55b9acc6dde5bdd57f2bc1613f7ef0e1391977d9835cf65696673eb3e76c5c668c0d31e68bf9585897cd8a5c3ef9379236c5e71519b613ffc3fa3cebb12d53e367f1cab85f944b6b03ffb3325bb7a3d51c61f5dcdf92c724afd1da5c9ffd8e72b34c7eadde8fef2dfd718f66c913f99d325db28718dfe9372fd95f00f3fd956bdd6fd17cab72cdcc9be402df0b3be157ed6595a7eb79c0f2f7ca2ef1dcf1af76567fcfbc49861ffd53d66e3eca7e2927f85e50ab72f96a8efc2b79dbbace7ff5fe67f36db4a1aceffb7a7cf93ff1faa67f7fec6ff1feff4a2efffd6f7ffc0f54dd11fd</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>okayButton</sender>
+ <signal>pressed()</signal>
+ <receiver>NewWidgetDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>pressed()</signal>
+ <receiver>NewWidgetDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>templateList</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>NewWidgetDlgBase</receiver>
+ <slot>templateSelChanged()</slot>
+ </connection>
+ <connection>
+ <sender>subclassingCb</sender>
+ <signal>pressed()</signal>
+ <receiver>NewWidgetDlgBase</receiver>
+ <slot>subclassingPressed()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>templateList</tabstop>
+ <tabstop>subclassingCb</tabstop>
+ <tabstop>ui_classnameEd</tabstop>
+ <tabstop>captionEd</tabstop>
+ <tabstop>subclassnameEd</tabstop>
+ <tabstop>okayButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+</includes>
+<slots>
+ <slot>subclassingPressed()</slot>
+ <slot>templateSelChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/qmake/projectconfigurationdlg.cpp b/buildtools/qmake/projectconfigurationdlg.cpp
new file mode 100644
index 00000000..b76fc3a5
--- /dev/null
+++ b/buildtools/qmake/projectconfigurationdlg.cpp
@@ -0,0 +1,2174 @@
+/***************************************************************************
+* Copyright (C) 2002 by Jakob Simon-Gaarde *
+* jsgaarde@tdcspace.dk *
+* Copyright (C) 2002-2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* Copyright (C) 2003 by Thomas Hasart *
+* thasart@gmx.de *
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "projectconfigurationdlg.h"
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <kfiledialog.h>
+#include <knotifyclient.h>
+#include <klineedit.h>
+#include <kinputdialog.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <ktextedit.h>
+
+#include <qdialog.h>
+#include <qpushbutton.h>
+#include <qbuttongroup.h>
+#include <qlistview.h>
+#include <qlabel.h>
+#include <iostream>
+#include <qregexp.h>
+#include <qvalidator.h>
+#include <qtabwidget.h>
+#include <kpushbutton.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "trollprojectwidget.h"
+#include "trollprojectpart.h"
+#include "qmakescopeitem.h"
+#include "scope.h"
+#include "urlutil.h"
+
+InsideCheckListItem::InsideCheckListItem( QListView *parent, QMakeScopeItem *item, ProjectConfigurationDlg *config ) :
+ QCheckListItem( parent, item->relativePath().endsWith("/") ? item->relativePath().right( item->relativePath().length() - 1 ) : item->relativePath(), QCheckListItem::CheckBox )
+{
+ prjItem = item;
+ m_config = config;
+}
+
+InsideCheckListItem::InsideCheckListItem( QListView *parent, QListViewItem *after, QMakeScopeItem *item, ProjectConfigurationDlg *config ) :
+ QCheckListItem( parent,
+ after,
+ item->relativePath(), QCheckListItem::CheckBox )
+{
+ prjItem = item;
+ m_config = config;
+}
+
+//check or uncheck dependency to currently checked or unchecked library
+void InsideCheckListItem::stateChange( bool state )
+{
+ if ( listView() == m_config->insidelib_listview )
+ {
+ QListViewItemIterator it( m_config->intDeps_view );
+ while ( it.current() )
+ {
+ InsideCheckListItem * chi = dynamic_cast<InsideCheckListItem*>( it.current() );
+ if ( chi )
+ if ( chi->prjItem == prjItem )
+ chi->setOn( state );
+ ++it;
+ }
+ }
+}
+
+CustomVarListItem::CustomVarListItem(QListView* parent, unsigned int id, QMap<QString, QString> var)
+ : KListViewItem(parent), m_key(id)
+{
+ setText(0, var["var"]);
+ setText(1, var["op"]);
+ setText(2, var["values"]);
+}
+
+QString CustomVarListItem::key(int column, bool ascending) const
+{
+ if( column == 0)
+ return QString::number(m_key);
+ return KListViewItem::key(column, ascending);
+}
+
+ProjectConfigurationDlg::ProjectConfigurationDlg( QListView *_prjList, TrollProjectWidget* _prjWidget, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : ProjectConfigurationDlgBase( parent, name, modal, fl | Qt::WStyle_Tool ), myProjectItem(0)
+{
+ prjList = _prjList;
+ prjWidget = _prjWidget;
+ // m_projectConfiguration = conf;
+ m_targetLibraryVersion->setValidator( new QRegExpValidator(
+ QRegExp( "\\d+(\\.\\d+)?(\\.\\d+)" ), this ) );
+ customVariables->setSortColumn(0);
+ customVariables->setSortOrder(Qt::Ascending);
+ mocdir_url->completionObject()->setMode(KURLCompletion::DirCompletion);
+ mocdir_url->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ objdir_url->completionObject()->setMode(KURLCompletion::DirCompletion);
+ objdir_url->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ rccdir_url->completionObject()->setMode(KURLCompletion::DirCompletion);
+ rccdir_url->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ uidir_url->completionObject()->setMode(KURLCompletion::DirCompletion);
+ uidir_url->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ m_CWDEdit->completionObject()->setMode(KURLCompletion::DirCompletion);
+ m_CWDEdit->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ m_targetPath->completionObject()->setMode(KURLCompletion::DirCompletion);
+ m_targetPath->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+}
+
+void ProjectConfigurationDlg::updateSubproject( QMakeScopeItem* _item )
+{
+ if ( myProjectItem && myProjectItem->scope )
+ {
+ switch ( prjWidget->dialogSaveBehaviour() )
+ {
+ case TrollProjectWidget::AlwaysSave:
+ apply();
+ break;
+ case TrollProjectWidget::NeverSave:
+ break;
+ case TrollProjectWidget::Ask:
+ if ( !buttonApply->isEnabled() )
+ break;
+ if ( KMessageBox::questionYesNo( 0, i18n( "Save the current subproject's configuration?" ),
+ i18n( "Save Configuration?" ) ) == KMessageBox::Yes )
+ apply();
+ break;
+ }
+ }
+ myProjectItem = _item;
+ updateControls();
+ buttonApply->setEnabled( false );
+}
+
+ProjectConfigurationDlg::~ProjectConfigurationDlg()
+{}
+
+void ProjectConfigurationDlg::updateProjectConfiguration()
+{
+ // Template
+ if ( myProjectItem->scope->scopeType() == Scope::ProjectScope )
+ {
+ if ( radioApplication->isChecked() )
+ {
+ if( myProjectItem->scope->variableValues("TEMPLATE").findIndex("app") == -1 )
+ {
+ addAppDeps();
+ removeSharedLibDeps();
+ removeStaticLibDeps();
+ }
+ myProjectItem->scope->setEqualOp( "TEMPLATE", "app" );
+ if( myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1 )
+ myProjectItem->scope->removeFromPlusOp( "CONFIG", "staticlib" );
+ if( myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ myProjectItem->scope->removeFromPlusOp( "CONFIG", "dll" );
+ myProjectItem->setPixmap( 0, SmallIcon( "qmake_app" ) );
+ QString targetname = prjWidget->getCurrentOutputFilename();
+ if( targetname.findRev("/") != -1 )
+ targetname = targetname.right( targetname.length() - targetname.findRev("/") - 1 );
+ DomUtil::writeEntry( *prjWidget->m_part->projectDom(),
+ "/kdevtrollproject/run/runarguments/"+targetname, m_editRunArguments->text() );
+ DomUtil::writeEntry( *prjWidget->m_part->projectDom(),
+ "/kdevtrollproject/run/cwd/"+targetname, m_CWDEdit->url() );
+ DomUtil::writeEntry( *prjWidget->m_part->projectDom(),
+ "/kdevtrollproject/run/debugarguments/"+targetname, m_editDebugArguments->text() );
+
+ }
+ else if ( radioLibrary->isChecked() )
+ {
+ myProjectItem->scope->setEqualOp( "TEMPLATE", "lib" );
+ if ( staticRadio->isOn() )
+ {
+ if( myProjectItem->scope->variableValues("CONFIG").findIndex("dll") != -1 )
+ {
+ addStaticLibDeps();
+ removeSharedLibDeps();
+ }
+ myProjectItem->addValue( "CONFIG", "staticlib" );
+ myProjectItem->removeValue( "CONFIG", "dll" );
+ if ( !myProjectItem->scope->listIsEmpty( myProjectItem->scope->variableValues( "VERSION" ) ) )
+ {
+ myProjectItem->scope->removeVariable( "VERSION", "=" );
+ myProjectItem->scope->removeVariable( "VERSION", "+=" );
+ myProjectItem->scope->removeVariable( "VERSION", "-=" );
+ }
+ }
+ if ( sharedRadio->isOn() )
+ {
+ kdDebug(9024) << "Activating debug lib:" << myProjectItem->scope->variableValues("CONFIG") << endl;
+ if( myProjectItem->scope->variableValues("CONFIG").findIndex("dll") == -1 )
+ {
+ addSharedLibDeps();
+ removeStaticLibDeps();
+ }
+ myProjectItem->addValue( "CONFIG", "dll" );
+ myProjectItem->scope->setEqualOp( "VERSION", m_targetLibraryVersion->text() );
+ if ( myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1 )
+ myProjectItem->removeValue( "CONFIG", "staticlib" );
+ }
+ if ( checkPlugin->isOn() )
+ myProjectItem->addValue( "CONFIG", "plugin" );
+ else
+ myProjectItem->removeValue( "CONFIG", "plugin" );
+ if ( checkDesigner->isChecked() )
+ myProjectItem->addValue( "CONFIG", "designer" );
+ else
+ myProjectItem->removeValue( "CONFIG", "designer" );
+
+ myProjectItem->setPixmap( 0, SmallIcon( "qmake_lib" ) );
+ removeAppDeps();
+ }
+ else if ( radioSubdirs->isChecked() )
+ {
+ if( myProjectItem->scope->variableValues("TEMPLATE").findIndex("subdirs") == -1 )
+ {
+ removeSharedLibDeps();
+ removeStaticLibDeps();
+ removeAppDeps();
+ }
+ if( myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ myProjectItem->scope->removeFromPlusOp( "CONFIG", "dll" );
+ if( myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1 )
+ myProjectItem->scope->removeFromPlusOp( "CONFIG", "staticlib" );
+ myProjectItem->scope->setEqualOp( "TEMPLATE", "subdirs" );
+ myProjectItem->setPixmap( 0, SmallIcon( "folder" ) );
+ }
+ }
+
+ // Buildmode
+ int releaseidx = myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "release" );
+ int debugidx = myProjectItem->scope->variableValues( "CONFIG" ).findIndex( "debug" );
+ if ( radioReleaseMode->isChecked() )
+ {
+ if( releaseidx != -1 && releaseidx < debugidx )
+ myProjectItem->removeValue( "CONFIG", "debug" );
+ else if( debugidx != -1 )
+ myProjectItem->removeValue( "CONFIG", "debug" );
+ myProjectItem->addValue( "CONFIG", "release" );
+ }else if( !checkDebugReleaseMode->isChecked() )
+ myProjectItem->removeValue( "CONFIG", "release" );
+
+ if ( radioDebugMode->isChecked() )
+ {
+ if( debugidx != -1 && debugidx < releaseidx )
+ myProjectItem->removeValue( "CONFIG", "release" );
+ else if( releaseidx != -1 )
+ myProjectItem->removeValue( "CONFIG", "release" );
+ myProjectItem->addValue( "CONFIG", "debug" );
+ }else if( !checkDebugReleaseMode->isChecked() )
+ myProjectItem->removeValue( "CONFIG", "debug" );
+
+ // requirements
+ if ( exceptionCheck->isChecked() )
+ myProjectItem->addValue( "CONFIG", "exceptions" );
+ else
+ myProjectItem->removeValue( "CONFIG", "exceptions" );
+ if ( stlCheck->isChecked() )
+ myProjectItem->addValue( "CONFIG", "stl" );
+ else
+ myProjectItem->removeValue( "CONFIG", "stl" );
+ if ( rttiCheck->isChecked() )
+ myProjectItem->addValue( "CONFIG", "rtti" );
+ else
+ myProjectItem->removeValue( "CONFIG", "rtti" );
+ if ( checkQt->isChecked() )
+ myProjectItem->addValue( "CONFIG", "qt" );
+ else
+ myProjectItem->removeValue( "CONFIG", "qt" );
+ if ( checkOpenGL->isChecked() )
+ myProjectItem->addValue( "CONFIG", "opengl" );
+ else
+ myProjectItem->removeValue( "CONFIG", "opengl" );
+ if ( checkThread->isChecked() )
+ myProjectItem->addValue( "CONFIG", "thread" );
+ else
+ myProjectItem->removeValue( "CONFIG", "thread" );
+ if ( checkX11->isChecked() )
+ myProjectItem->addValue( "CONFIG", "x11" );
+ else
+ myProjectItem->removeValue( "CONFIG", "x11" );
+ if ( checkOrdered->isChecked() )
+ myProjectItem->addValue( "CONFIG", "ordered" );
+ else
+ myProjectItem->removeValue( "CONFIG", "ordered" );
+ if ( checkLibtool->isChecked() )
+ myProjectItem->addValue( "CONFIG", "compile_libtool" );
+ else
+ myProjectItem->removeValue( "CONFIG", "compile_libtool" );
+
+ if ( checkConsole->isChecked() )
+ myProjectItem->addValue( "CONFIG", "console" );
+ else
+ myProjectItem->removeValue( "CONFIG", "console" );
+ if ( checkPCH->isChecked() )
+ myProjectItem->addValue( "CONFIG", "precompile_header" );
+ else
+ myProjectItem->removeValue( "CONFIG", "precompile_header" );
+ // Warnings
+ if ( checkWarning->isChecked() )
+ {
+ myProjectItem->addValue( "CONFIG", "warn_on" );
+ myProjectItem->removeValue( "CONFIG", "warn_off" );
+ }
+ else
+ {
+ myProjectItem->addValue( "CONFIG", "warn_off" );
+ myProjectItem->removeValue( "CONFIG", "warn_on" );
+ }
+ if ( checkWindows->isChecked() )
+ myProjectItem->addValue( "CONFIG", "windows" );
+ else
+ myProjectItem->removeValue( "CONFIG", "windows" );
+
+ //Qt4 libs
+ if ( prjWidget->m_part->isQt4Project() )
+ {
+ if ( checkDebugReleaseMode->isChecked() )
+ myProjectItem->addValue( "CONFIG", "debug_and_release" );
+ else
+ myProjectItem->removeValue( "CONFIG", "debug_and_release" );
+
+ if ( checkTestlib->isChecked() )
+ myProjectItem->addValue( "CONFIG", "qtestlib" );
+ else
+ myProjectItem->removeValue( "CONFIG", "qtestlib" );
+ if ( checkAssistant->isChecked() )
+ myProjectItem->addValue( "CONFIG", "assistant" );
+ else
+ myProjectItem->removeValue( "CONFIG", "assistant" );
+ if ( checkUiTools->isChecked() )
+ myProjectItem->addValue( "CONFIG", "uitools" );
+ else
+ myProjectItem->removeValue( "CONFIG", "uitools" );
+ if ( checkQDBus->isChecked() )
+ myProjectItem->addValue( "CONFIG", "dbus" );
+ else
+ myProjectItem->removeValue( "CONFIG", "dbus" );
+ if ( checkBuildAll->isChecked() )
+ myProjectItem->addValue( "CONFIG", "build_all" );
+ else
+ myProjectItem->removeValue( "CONFIG", "build_all" );
+ if ( checkQtHelp->isChecked() )
+ myProjectItem->addValue( "CONFIG", "help" );
+ else
+ myProjectItem->removeValue( "CONFIG", "help" );
+
+ if ( checkQt4Core->isChecked() )
+ myProjectItem->addValue( "QT", "core" );
+ else
+ myProjectItem->removeValue( "QT", "core" );
+ if ( checkQt4Gui->isChecked() )
+ myProjectItem->addValue( "QT", "gui" );
+ else
+ myProjectItem->removeValue( "QT", "gui" );
+ if ( checkQt4SQL->isChecked() )
+ myProjectItem->addValue( "QT", "sql" );
+ else
+ myProjectItem->removeValue( "QT", "sql" );
+ if ( checkQt4SVG->isChecked() )
+ myProjectItem->addValue( "QT", "svg" );
+ else
+ myProjectItem->removeValue( "QT", "svg" );
+ if ( checkQt4XML->isChecked() )
+ myProjectItem->addValue( "QT", "xml" );
+ else
+ myProjectItem->removeValue( "QT", "xml" );
+ if ( checkQt4Network->isChecked() )
+ myProjectItem->addValue( "QT", "network" );
+ else
+ myProjectItem->removeValue( "QT", "network" );
+ if ( checkQt3Support->isChecked() )
+ myProjectItem->addValue( "QT", "qt3support" );
+ else
+ myProjectItem->removeValue( "QT", "qt3support" );
+ if ( checkQt4OpenGL->isChecked() )
+ myProjectItem->addValue( "QT", "opengl" );
+ else
+ myProjectItem->removeValue( "QT", "opengl" );
+ if ( checkQtScript->isChecked() )
+ myProjectItem->addValue( "QT", "script" );
+ else
+ myProjectItem->removeValue( "QT", "script" );
+ if ( checkQtWebKit->isChecked() )
+ myProjectItem->addValue( "QT", "webkit" );
+ else
+ myProjectItem->removeValue( "QT", "webkit" );
+ if ( checkQtXmlPatterns->isChecked() )
+ myProjectItem->addValue( "QT", "xmlpatterns" );
+ else
+ myProjectItem->removeValue( "QT", "xmlpatterns" );
+ if ( checkPhonon->isChecked() )
+ myProjectItem->addValue( "QT", "phonon" );
+ else
+ myProjectItem->removeValue( "QT", "phonon" );
+ }
+
+ QStringList confValues = myProjectItem->scope->variableValues( "CONFIG" );
+ QStringList extraValues = QStringList::split( " ", editConfigExtra->text() );
+ for ( QStringList::iterator it = confValues.begin() ; it != confValues.end() ; ++it )
+ {
+ if ( Scope::KnownConfigValues.findIndex( *it ) == -1 && extraValues.findIndex( *it ) == -1 )
+ {
+ myProjectItem->scope->removeFromPlusOp( "CONFIG", *it );
+ }
+ }
+
+ for ( QStringList::iterator it = extraValues.begin() ; it != extraValues.end() ; ++it )
+ {
+ if ( confValues.findIndex( *it ) == -1 )
+ myProjectItem->scope->addToPlusOp( "CONFIG", *it );
+ }
+
+ QString targetpath = m_targetPath->url();
+// if( !QFileInfo( targetpath ).isRelative() )
+// targetpath = URLUtil::getRelativePath( myProjectItem->scope->projectDir(), targetpath );
+ if( myProjectItem->scope->scopeType() == Scope::FunctionScope || myProjectItem->scope->scopeType() == Scope::SimpleScope )
+ {
+ if( myProjectItem->scope->variableValues("TARGET").findIndex( m_targetOutputFile->text() ) == -1 )
+ myProjectItem->scope->setEqualOp( "TARGET", QStringList( m_targetOutputFile->text() ) );
+ if( myProjectItem->scope->variableValues("DESTDIR").findIndex( targetpath ) == -1 )
+ myProjectItem->scope->setEqualOp( "DESTDIR", QStringList( targetpath ) );
+ }else
+ {
+ myProjectItem->scope->setEqualOp( "TARGET", QStringList( m_targetOutputFile->text() ) );
+ myProjectItem->scope->setEqualOp( "DESTDIR", QStringList( targetpath ) );
+ }
+
+ myProjectItem->updateValues( "DEFINES", QStringList::split( " ", m_defines->text() ) );
+ myProjectItem->updateValues( "QMAKE_CXXFLAGS_DEBUG", QStringList::split( " ", m_debugFlags->text() ) );
+ myProjectItem->updateValues( "QMAKE_CXXFLAGS_RELEASE", QStringList::split( " ", m_releaseFlags->text() ) );
+
+ //add selected includes
+ QStringList values;
+ InsideCheckListItem *insideItem = ( InsideCheckListItem * ) insideinc_listview->firstChild();
+ while ( insideItem )
+ {
+ if ( insideItem->isOn() )
+ {
+ QString tmpInc = insideItem->prjItem->getIncAddPath( myProjectItem->scope->projectDir() );
+ tmpInc = QDir::cleanDirPath( tmpInc );
+ values << tmpInc;
+
+ }
+ insideItem = ( InsideCheckListItem* ) insideItem->itemBelow();
+ }
+
+ QCheckListItem *outsideItem = ( QCheckListItem * ) outsideinc_listview->firstChild();
+ while ( outsideItem )
+ {
+ values << outsideItem->text( 0 );
+ outsideItem = ( QCheckListItem* ) outsideItem->itemBelow();
+ }
+// myProjectItem->removeValues( "INCLUDEPATH", values );
+ myProjectItem->updateValues( "INCLUDEPATH", values );
+
+ //target.install
+ if ( checkInstallTarget->isChecked() == true )
+ {
+ myProjectItem->addValue( "INSTALLS", "target" );
+ myProjectItem->scope->setEqualOp( "target.path", QStringList( m_InstallTargetPath->text() ) );
+ }
+ else
+ {
+ myProjectItem->removeValue( "INSTALLS", "target" );
+ myProjectItem->scope->removeVariable( "target.path", "=" );
+ }
+
+ //makefile
+ myProjectItem->scope->setEqualOp( "MAKEFILE", QStringList( makefile_url->url() ) );
+
+ //add libs to link
+
+ values.clear();
+ QStringList libPaths;
+
+ //inside libs to link
+ insideItem = ( InsideCheckListItem * ) insidelib_listview->firstChild();
+ while ( insideItem )
+ {
+ if ( insideItem->isOn() )
+ {
+
+ QString tmpLib = insideItem->prjItem->getLibAddObject( myProjectItem->scope->projectDir() );
+ if ( insideItem->prjItem->scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ {
+ //add path if shared lib is linked
+ QString tmpPath = insideItem->prjItem->getLibAddPath(
+ myProjectItem->scope->projectDir() );
+ if ( tmpPath != "" )
+ {
+ values << ("-L"+tmpPath) ;
+ }
+ }
+ values << tmpLib ;
+
+ }
+ insideItem = ( InsideCheckListItem* ) insideItem->itemBelow();
+ }
+
+ //extra lib paths
+ QListViewItem *lvItem = outsidelibdir_listview->firstChild();
+ while ( lvItem )
+ {
+ values << ( "-L"+lvItem->text( 0 ) );
+ lvItem = lvItem->itemBelow();
+ }
+
+
+ //outside libs to link
+ outsideItem = ( QCheckListItem * ) outsidelib_listview->firstChild();
+ while ( outsideItem )
+ {
+ values << outsideItem->text( 0 );
+ outsideItem = ( QCheckListItem* ) outsideItem->itemBelow();
+ }
+
+
+// myProjectItem->removeValues( "LIBS", values );
+ myProjectItem->updateValues( "LIBS", values );
+
+ values.clear();
+
+ //external project dependencies
+ QListViewItem *depItem = extDeps_view->firstChild();
+ while ( depItem )
+ {
+ values << depItem->text( 0 );
+ depItem = depItem->itemBelow();
+ }
+
+ //internal project dependencies
+ insideItem = dynamic_cast<InsideCheckListItem *>( intDeps_view->firstChild() );
+ while ( insideItem )
+ {
+ if ( insideItem->isOn() )
+ {
+ if ( insideItem->prjItem->scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1
+ || ( insideItem->prjItem->scope->variableValues( "CONFIG" ).findIndex("dll") == -1
+ && insideItem->prjItem->scope->variableValues( "TEMPLATE" ).findIndex("lib") != -1 ) )
+ {
+ values << insideItem->prjItem->getLibAddObject(
+ myProjectItem->scope->projectDir() );
+ }
+ else if ( insideItem->prjItem->scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ {
+ values << insideItem->prjItem->getSharedLibAddObject(
+ myProjectItem->scope->projectDir() );
+ }
+ else
+ {
+ values << insideItem->prjItem->getApplicationObject(
+ myProjectItem->scope->projectDir() );
+ }
+ }
+ insideItem = dynamic_cast<InsideCheckListItem *>( insideItem->itemBelow() );
+ }
+// myProjectItem->removeValues( "TARGETDEPS", values );
+ myProjectItem->updateValues( "TARGETDEPS", values );
+
+ values.clear();
+ //change build order
+ lvItem = buildorder_listview->firstChild();
+ if ( lvItem && lvItem->itemBelow() && myProjectItem->scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ {
+
+ while ( lvItem )
+ {
+ values << lvItem->text( 0 );
+ lvItem = lvItem->itemBelow();
+ }
+
+ if( values != myProjectItem->scope->variableValues("SUBDIRS") )
+ {
+ if ( myProjectItem->scope->isVariableReset( "SUBDIRS" ) )
+ {
+ myProjectItem->scope->removeVariable( "SUBDIRS", "=" );
+ myProjectItem->scope->setEqualOp( "SUBDIRS", values );
+ }
+ else
+ {
+ myProjectItem->scope->removeVariable( "SUBDIRS", "+=" );
+ myProjectItem->scope->setPlusOp( "SUBDIRS", values );
+ }
+ }
+ }
+
+ // intermediate locations
+ myProjectItem->scope->setEqualOp( "OBJECTS_DIR", QStringList( objdir_url->url() ) );
+ myProjectItem->scope->setEqualOp( "UI_DIR", QStringList( uidir_url->url() ) );
+ myProjectItem->scope->setEqualOp( "MOC_DIR", QStringList( mocdir_url->url() ) );
+ myProjectItem->scope->setEqualOp( "RCC_DIR", QStringList( rccdir_url->url() ) );
+
+ //CORBA
+ myProjectItem->scope->setEqualOp( "IDL_COMPILER", QStringList( idlCmdEdit->url() ) );
+ myProjectItem->updateValues( "IDL_OPTIONS", QStringList::split( " ", idlCmdOptionsEdit->text() ) );
+
+ QListViewItemIterator iter(customVariables);
+ for( ; iter.current() ; iter++ )
+ {
+ QListViewItem* item = iter.current();
+ myProjectItem->scope->updateCustomVariable( item->key(0, true).toUInt(), item->text(0), item->text(1), item->text(2) );
+ }
+}
+
+void ProjectConfigurationDlg::accept()
+{
+ if( buttonApply->isEnabled() )
+ apply();
+ myProjectItem = 0;
+ QDialog::accept();
+}
+
+void ProjectConfigurationDlg::reject()
+{
+ myProjectItem = 0;
+ QDialog::reject();
+}
+
+
+
+void ProjectConfigurationDlg::updateControls()
+{
+ // Project template
+ groupLibraries->setEnabled( false );
+ if( myProjectItem->scope->scopeType() != Scope::ProjectScope )
+ groupTemplate->setEnabled( false );
+ else
+ groupTemplate->setEnabled( true );
+
+ //cache the value of the some variables
+ QStringList configValues = myProjectItem->scope->variableValues( "CONFIG" );
+ QStringList templateValues = myProjectItem->scope->variableValues( "TEMPLATE" );
+ //if( !myProjectItem->isScope )
+ //{
+ if ( templateValues.findIndex( "lib" ) != -1 )
+ {
+ groupLibraries->setEnabled( true );
+
+ radioLibrary->setChecked( true );
+ staticRadio->setChecked( true ); //default
+
+ if ( configValues.findIndex( "staticlib" ) != -1 )
+ {
+ staticRadio->setChecked( true );
+ checkPlugin->setEnabled( false );
+ checkDesigner->setEnabled( false );
+ }
+ else
+ staticRadio->setChecked( false );
+ if ( configValues.findIndex( "dll" ) != -1 )
+ {
+ sharedRadio->setChecked( true );
+ checkPlugin->setEnabled( true );
+ if( prjWidget->m_part->isQt4Project() )
+ checkDesigner->setEnabled( true );
+ m_targetLibraryVersion->setText( myProjectItem->scope->variableValues( "VERSION" ).front() );
+ }
+ else
+ {
+ sharedRadio->setChecked( false );
+ m_targetLibraryVersion->setText( "" );
+ }
+
+ if( !staticRadio->isChecked() && !sharedRadio->isChecked() )
+ {
+ staticRadio->setChecked( true );
+ checkPlugin->setEnabled( false );
+ checkDesigner->setEnabled( false );
+ }
+
+ if ( configValues.findIndex( "plugin" ) != -1 )
+ checkPlugin->setChecked( true );
+ else
+ checkPlugin->setChecked( false );
+ if ( configValues.findIndex( "designer" ) != -1 )
+ checkDesigner->setChecked( true );
+ else
+ checkDesigner->setChecked( false );
+ if ( configValues.findIndex( "compile_libtool" ) != -1 )
+ checkLibtool->setChecked( true );
+ else
+ checkLibtool->setChecked( false );
+ }
+ else if ( templateValues.findIndex( "subdirs" ) != -1 )
+ {
+ radioSubdirs->setChecked( true );
+ }else
+ {
+ //Default is app mode
+ radioApplication->setChecked( true );
+ if ( configValues.findIndex( "console" ) != -1 )
+ {
+ checkConsole->setChecked( true );
+ }
+ QString targetname = prjWidget->getCurrentOutputFilename();
+ if( targetname.findRev("/") != -1 )
+ targetname = targetname.right( targetname.length() - targetname.findRev("/") - 1 );
+ m_editRunArguments->setText( DomUtil::readEntry( *prjWidget->m_part->projectDom(), "/kdevtrollproject/run/runarguments/"+targetname, "" ) );
+
+ QString dir = DomUtil::readEntry( *prjWidget->m_part->projectDom(), "/kdevtrollproject/run/cwd/"+targetname, "" );
+ if( QFileInfo(dir).isRelative() )
+ {
+ m_CWDEdit->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ m_CWDEdit->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+
+ m_CWDEdit->completionObject()->setDir( dir);
+ m_CWDEdit->fileDialog()->setURL( KURL( dir ) );
+ }
+ m_CWDEdit->setURL( dir );
+
+ if( m_CWDEdit->url().isEmpty() )
+ {
+ QString destdir = myProjectItem->m_widget->getCurrentDestDir();
+ if( !destdir.startsWith( "/" ) )
+ destdir = myProjectItem->m_widget->projectDirectory()+"/"+destdir;
+ m_CWDEdit->setURL( destdir.left( destdir.findRev("/") ) );
+ m_CWDEdit->fileDialog()->setURL( KURL::fromPathOrURL( destdir.left( destdir.findRev("/") ) ) );
+ }
+ m_editDebugArguments->setText( DomUtil::readEntry( *prjWidget->m_part->projectDom(), "/kdevtrollproject/run/debugarguments/"+targetname, "" ) );
+ }
+
+ // Buildmode
+ int debugidx = configValues.findIndex( "debug" );
+ int releaseidx = configValues.findIndex( "release" );
+ if ( debugidx != -1 && debugidx > releaseidx )
+ {
+ radioDebugMode->setChecked( true );
+ }
+ if ( releaseidx != -1 && releaseidx > debugidx )
+ {
+ radioReleaseMode->setChecked( true );
+ }
+ if ( configValues.findIndex( "debug_and_release" ) != -1 )
+ {
+ checkDebugReleaseMode->setChecked( true );
+ }
+
+ // Requirements
+ if ( configValues.findIndex( "qt" ) != -1 )
+ checkQt->setChecked( true );
+ else
+ checkQt->setChecked( false );
+ if ( configValues.findIndex( "opengl" ) != -1 )
+ checkOpenGL->setChecked( true );
+ else
+ checkOpenGL->setChecked( false );
+ if ( configValues.findIndex( "thread" ) != -1 )
+ checkThread->setChecked( true );
+ else
+ checkThread->setChecked( false );
+ if ( configValues.findIndex( "x11" ) != -1 )
+ checkX11->setChecked( true );
+ else
+ checkX11->setChecked( false );
+ if ( configValues.findIndex( "ordered" ) != -1 )
+ checkOrdered->setChecked( true );
+ else
+ checkOrdered->setChecked( false );
+ if ( configValues.findIndex( "exceptions" ) != -1 )
+ exceptionCheck->setChecked( true );
+ else
+ exceptionCheck->setChecked( false );
+ if ( configValues.findIndex( "stl" ) != -1 )
+ stlCheck->setChecked( true );
+ else
+ stlCheck->setChecked( false );
+ if ( configValues.findIndex( "rtti" ) != -1 )
+ rttiCheck->setChecked( true );
+ else
+ rttiCheck->setChecked( false );
+ if ( configValues.findIndex( "precompile_header" ) != -1 )
+ checkPCH->setChecked( true );
+ else
+ checkPCH->setChecked( false );
+ // Warnings
+ if ( configValues.findIndex( "warn_on" ) != -1 )
+ {
+ checkWarning->setChecked( true );
+ }
+ if ( configValues.findIndex( "warn_off" ) != -1 )
+ {
+ checkWarning->setChecked( false );
+ }
+
+ if ( configValues.findIndex( "windows" ) != -1 )
+ checkWindows->setChecked( true );
+ else
+ checkWindows->setChecked( false );
+
+ //Qt4 libs
+ if ( prjWidget->m_part->isQt4Project() )
+ {
+
+ if ( configValues.findIndex( "assistant" ) != -1 )
+ checkAssistant->setChecked( true );
+ else
+ checkAssistant->setChecked( false );
+ if ( configValues.findIndex( "qtestlib" ) != -1 )
+ checkTestlib->setChecked( true );
+ else
+ checkTestlib->setChecked( false );
+ if ( configValues.findIndex( "uitools" ) != -1 )
+ checkUiTools->setChecked( true );
+ else
+ checkUiTools->setChecked( false );
+ if ( configValues.findIndex( "dbus" ) != -1 )
+ checkQDBus->setChecked( true );
+ else
+ checkQDBus->setChecked( false );
+ if ( configValues.findIndex( "build_all" ) != -1 )
+ checkBuildAll->setChecked( true );
+ else
+ checkBuildAll->setChecked( false );
+ if ( configValues.findIndex( "help" ) != -1 )
+ checkQtHelp->setChecked( true );
+ else
+ checkQtHelp->setChecked( false );
+
+ QStringList qtLibs = myProjectItem->scope->variableValues( "QT" );
+ if ( qtLibs.findIndex( "core" ) != -1 )
+ checkQt4Core->setChecked( true );
+ else
+ checkQt4Core->setChecked( false );
+ if ( qtLibs.findIndex( "gui" ) != -1 )
+ checkQt4Gui->setChecked( true );
+ else
+ checkQt4Gui->setChecked( false );
+ if ( qtLibs.findIndex( "sql" ) != -1 )
+ checkQt4SQL->setChecked( true );
+ else
+ checkQt4SQL->setChecked( false );
+ if ( qtLibs.findIndex( "xml" ) != -1 )
+ checkQt4XML->setChecked( true );
+ else
+ checkQt4XML->setChecked( false );
+ if ( qtLibs.findIndex( "network" ) != -1 )
+ checkQt4Network->setChecked( true );
+ else
+ checkQt4Network->setChecked( false );
+ if ( qtLibs.findIndex( "svg" ) != -1 )
+ checkQt4SVG->setChecked( true );
+ else
+ checkQt4SVG->setChecked( false );
+ if ( qtLibs.findIndex( "opengl" ) != -1 )
+ checkQt4OpenGL->setChecked( true );
+ else
+ checkQt4OpenGL->setChecked( false );
+ if ( qtLibs.findIndex( "qt3support" ) != -1 )
+ checkQt3Support->setChecked( true );
+ else
+ checkQt3Support->setChecked( false );
+ if ( qtLibs.findIndex( "script" ) != -1 )
+ checkQtScript->setChecked( true );
+ else
+ checkQtScript->setChecked( false );
+ if ( qtLibs.findIndex( "phonon" ) != -1 )
+ checkPhonon->setChecked( true );
+ else
+ checkPhonon->setChecked( false );
+ if ( qtLibs.findIndex( "webkit" ) != -1 )
+ checkQtWebKit->setChecked( true );
+ else
+ checkQtWebKit->setChecked( false );
+ if ( qtLibs.findIndex( "xmlpatterns" ) != -1 )
+ checkQtXmlPatterns->setChecked( true );
+ else
+ checkQtXmlPatterns->setChecked( false );
+
+ checkDebugReleaseMode->setEnabled( true );
+ checkBuildAll->setEnabled( true );
+ groupQt4Libs->setEnabled( checkQt->isChecked() );
+ rccdir_url->setEnabled( true );
+ rccdir_label->setEnabled( true );
+ }
+
+ //fill the custom config edit
+ QStringList extraValues;
+ for ( QStringList::const_iterator it = configValues.begin() ; it != configValues.end() ; ++it )
+ {
+ if ( Scope::KnownConfigValues.findIndex( *it ) == -1 )
+ {
+ extraValues << *it;
+ }
+ }
+ editConfigExtra->setText( extraValues.join( " " ) );
+
+ QString dir = myProjectItem->scope->variableValues( "MAKEFILE" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ makefile_url->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ makefile_url->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ makefile_url->completionObject()->setDir( dir );
+ makefile_url->fileDialog()->setURL( KURL( dir ) );
+ }
+ makefile_url->setURL( dir );
+
+ if ( myProjectItem->scope->variableValues( "INSTALLS" ).findIndex( "target" ) != -1 )
+ {
+ checkInstallTarget->setChecked( true );
+ m_InstallTargetPath->setEnabled( true );
+ }
+ else
+ {
+ checkInstallTarget->setChecked( false );
+ m_InstallTargetPath->setEnabled( false );
+ }
+ m_InstallTargetPath->setText( myProjectItem->scope->variableValues( "target.path" ).front() );
+
+ m_targetOutputFile->setText( myProjectItem->scope->variableValues( "TARGET" ).front() );
+
+ dir = myProjectItem->scope->variableValues( "DESTDIR" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ m_targetPath->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ m_targetPath->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ m_targetPath->completionObject()->setDir( dir );
+ m_targetPath->fileDialog()->setURL( KURL( dir ) );
+ }
+ m_targetPath->setURL( dir );
+
+ m_defines->setText( myProjectItem->scope->variableValues( "DEFINES" ).join( " " ) );
+ m_debugFlags->setText( myProjectItem->scope->variableValues( "QMAKE_CXXFLAGS_DEBUG" ).join( " " ) );
+ m_releaseFlags->setText( myProjectItem->scope->variableValues( "QMAKE_CXXFLAGS_RELEASE" ).join( " " ) );
+
+ updateIncludeControl();
+ updateLibControls();
+ updateBuildOrderControl();
+ updateDependenciesControl();
+
+ dir = myProjectItem->scope->variableValues( "OBJECTS_DIR" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ objdir_url->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ objdir_url->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ objdir_url->completionObject()->setDir( dir );
+ objdir_url->fileDialog()->setURL( KURL( dir ) );
+ }
+ objdir_url->setURL( dir );
+ dir = myProjectItem->scope->variableValues( "UI_DIR" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ uidir_url->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ uidir_url->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ uidir_url->completionObject()->setDir( dir );
+ uidir_url->fileDialog()->setURL( KURL( dir ) );
+ }
+ uidir_url->setURL( dir );
+ dir = myProjectItem->scope->variableValues( "MOC_DIR" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ mocdir_url->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ mocdir_url->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ mocdir_url->completionObject()->setDir( dir );
+ mocdir_url->fileDialog()->setURL( KURL( dir ) );
+ }
+ mocdir_url->setURL( dir );
+ dir = myProjectItem->scope->variableValues( "RC_DIR" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ rccdir_url->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ rccdir_url->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ rccdir_url->completionObject()->setDir( dir );
+ rccdir_url->fileDialog()->setURL( KURL( dir ) );
+ }
+ rccdir_url->setURL( dir );
+
+
+ dir = myProjectItem->scope->variableValues( "IDL_COMPILER" ).front();
+ if( QFileInfo(dir).isRelative() )
+ {
+ idlCmdEdit->completionObject()->setDir( myProjectItem->scope->projectDir() );
+ idlCmdEdit->fileDialog()->setURL( KURL( myProjectItem->scope->projectDir()+"/"+dir ) );
+ }else
+ {
+ idlCmdEdit->completionObject()->setDir( dir );
+ idlCmdEdit->fileDialog()->setURL( KURL( dir ) );
+ }
+ idlCmdEdit->setURL( dir );
+ idlCmdOptionsEdit->setText( myProjectItem->scope->variableValues( "IDL_OPTIONS" ).join( " " ) );
+
+ customVariables->clear();
+ customVariableName->setText("");
+ customVariableData->setText("");
+ customVariableOp->setCurrentItem( 0 );
+ QMap<unsigned int, QMap<QString, QString> > customvars = myProjectItem->scope->customVariables();
+ QMap<unsigned int, QMap<QString, QString> >::iterator idx = customvars.begin();
+ for ( ; idx != customvars.end(); ++idx )
+ {
+ CustomVarListItem* item = new CustomVarListItem( customVariables, idx.key(), idx.data() );
+ item->setMultiLinesEnabled(true);
+ }
+
+ groupTemplateChanged(0);
+}
+
+QPtrList<QMakeScopeItem> ProjectConfigurationDlg::getAllProjects()
+{
+ QPtrList <QMakeScopeItem> tmpPrjList;
+ QMakeScopeItem *item = static_cast<QMakeScopeItem*>( prjList->firstChild() );
+ while ( item )
+ {
+ if ( item->scope->scopeType() == Scope::ProjectScope )
+ {
+ if( item != myProjectItem )
+ tmpPrjList.append( item );
+ getAllSubProjects( item, &tmpPrjList );
+ }
+ item = static_cast<QMakeScopeItem*>( item->nextSibling() );
+ }
+ return ( tmpPrjList );
+}
+
+void ProjectConfigurationDlg::getAllSubProjects( QMakeScopeItem *item, QPtrList <QMakeScopeItem> *itemList )
+{
+
+ QMakeScopeItem * subItem = static_cast<QMakeScopeItem*>( item->firstChild() );
+ while ( subItem )
+ {
+ if ( subItem->scope->scopeType() == Scope::ProjectScope )
+ {
+ if ( subItem != myProjectItem )
+ itemList->append( subItem );
+ getAllSubProjects( subItem, itemList );
+ }
+ subItem = static_cast<QMakeScopeItem*>( subItem->nextSibling() );
+ }
+}
+
+void ProjectConfigurationDlg::updateIncludeControl()
+{
+ insideinc_listview->setSorting( -1, false );
+ outsideinc_listview->setSorting( -1, false );
+ insideinc_listview->clear();
+ outsideinc_listview->clear();
+
+ QStringList incList = myProjectItem->scope->variableValues( "INCLUDEPATH" );
+ QStringList intIncList = incList;
+ QMap<QString, InsideCheckListItem*> items;
+ QPtrList <QMakeScopeItem> itemList = getAllProjects();
+ QMakeScopeItem *item = itemList.first();
+ while ( item )
+ {
+ if ( item->scope->variableValues( "TEMPLATE" ).findIndex( "lib" ) != -1 ||
+ item->scope->variableValues( "TEMPLATE" ).findIndex( "app" ) != -1 )
+ {
+ QString tmpInc = item->getIncAddPath( myProjectItem->scope->projectDir() );
+ tmpInc = QDir::cleanDirPath( tmpInc );
+ InsideCheckListItem *newItem = new InsideCheckListItem( insideinc_listview,
+ insideinc_listview->lastItem(), item, this );
+
+ items[tmpInc] = newItem;
+ if ( incList.findIndex( tmpInc ) != -1 )
+ {
+ incList.remove( tmpInc );
+ newItem->setOn( true );
+ }
+ }
+ // item=(ProjectItem*)item->itemBelow();
+ item = itemList.next();
+ }
+
+
+ //all other in incList are outside incs
+ outsideinc_listview->clear();
+ QStringList::Iterator it1 = incList.begin();
+ for ( ;it1 != incList.end();++it1 )
+ {
+ intIncList.remove(*it1);
+ new QListViewItem( outsideinc_listview, outsideinc_listview->lastItem(), ( *it1 ) );
+ }
+ for( QStringList::const_iterator it = intIncList.begin(); it != intIncList.end(); ++it )
+ {
+ insideinc_listview->insertItem( items[*it] );
+ items.remove(*it);
+ }
+ for( QMap<QString,InsideCheckListItem*>::ConstIterator it3 = items.begin(); it3 != items.end(); it3++ )
+ {
+ insideinc_listview->insertItem( it3.data() );
+ }
+}
+
+void ProjectConfigurationDlg::updateLibControls()
+{
+
+ QPtrList <QMakeScopeItem> itemList = getAllProjects();
+
+ insidelib_listview->setSorting( -1, false );
+ outsidelib_listview->setSorting( -1, false );
+ outsidelibdir_listview->setSorting( -1, false );
+ insidelib_listview->clear();
+ outsidelib_listview->clear();
+ outsidelibdir_listview->clear();
+ //update librarys
+ //temp strlist
+ QStringList libList = myProjectItem->scope->variableValues( "LIBS" );
+ QStringList intLibList = libList;
+ QMap<QString, InsideCheckListItem*> items;
+ QMakeScopeItem* item = itemList.first();
+ while ( item )
+ {
+ if ( item->scope->variableValues( "TEMPLATE" ).findIndex( "lib" ) != -1 )
+ {
+ if ( item != myProjectItem )
+ {
+ // create lib string
+ QString tmpLib = item->getLibAddObject( myProjectItem->scope->projectDir() );
+
+ InsideCheckListItem * newItem = new InsideCheckListItem( insidelib_listview,
+ insidelib_listview->lastItem(), item, this );
+ insidelib_listview->takeItem( newItem );
+ items[tmpLib] = newItem;
+ QString tmpLibDir = item->getLibAddPath( myProjectItem->scope->projectDir() );
+ kdDebug(9024) << "lib:" << tmpLib << " dir:" << tmpLibDir << "|" << libList << endl;
+ if ( libList.findIndex( "-L" + tmpLibDir ) != -1 )
+ {
+ libList.remove( "-L" + tmpLibDir );
+ }
+ if ( libList.findIndex( tmpLib ) != -1 )
+ {
+ libList.remove( tmpLib );
+ newItem->setOn( true );
+ }
+ }
+ }
+ item = itemList.next();
+ }
+
+ //all other in libList are outside libs
+ QStringList::Iterator it1 = libList.begin();
+ for ( ;it1 != libList.end();++it1 )
+ {
+ intLibList.remove( *it1 );
+ if ( ( *it1 ).startsWith( "-L" ) )
+ new QListViewItem( outsidelibdir_listview, outsidelibdir_listview->lastItem(), ( *it1 ).mid( 2 ) );
+ else
+ {
+ new QListViewItem( outsidelib_listview, outsidelib_listview->lastItem(), ( *it1 ) );
+ }
+ }
+
+ for( QStringList::const_iterator it = intLibList.begin(); it != intLibList.end(); ++it )
+ {
+ QString lib = *it;
+ if( !lib.startsWith( "-L" ) )
+ {
+ insidelib_listview->insertItem( items[lib] );
+ items.remove(lib);
+ }
+ }
+ for( QMap<QString,InsideCheckListItem*>::ConstIterator it3 = items.begin(); it3 != items.end(); it3++ )
+ {
+ insidelib_listview->insertItem( it3.data() );
+ }
+}
+
+void ProjectConfigurationDlg::updateDependenciesControl( )
+{
+ QPtrList <QMakeScopeItem> itemList = getAllProjects();
+
+ intDeps_view->setSorting( -1, false );
+ extDeps_view->setSorting( -1, false );
+ intDeps_view->clear();
+ extDeps_view->clear();
+
+ QStringList depsList = myProjectItem->scope->variableValues( "TARGETDEPS" );
+ QStringList intDepList = depsList;
+ QMap<QString,InsideCheckListItem*> items;
+ QMakeScopeItem *item = itemList.first();
+ while ( item )
+ {
+ QStringList templateval = item->scope->variableValues( "TEMPLATE" );
+ if ( templateval.findIndex( "lib" ) != -1
+ || templateval.findIndex( "app" ) != -1 )
+ {
+ QString tmpLib;
+ QStringList values = item->scope->variableValues( "CONFIG" );
+ if ( templateval.findIndex( "lib" ) != -1 && values.findIndex( "dll" ) != -1 )
+ tmpLib = item->getSharedLibAddObject( myProjectItem->scope->projectDir() );
+ else if ( templateval.findIndex( "lib" ) != -1 )
+ tmpLib = item->getLibAddObject( myProjectItem->scope->projectDir() );
+ else
+ tmpLib = item->getApplicationObject( myProjectItem->scope->projectDir() );
+ InsideCheckListItem * newItem = new InsideCheckListItem( intDeps_view, intDeps_view->lastItem(), item, this );
+ items[tmpLib] = newItem;
+ if ( depsList.findIndex( tmpLib ) != -1 )
+ {
+ depsList.remove( tmpLib );
+ newItem->setOn( true );
+ }
+
+ }
+ item = itemList.next();
+ }
+
+ //add all other prj in itemList unchecked
+
+ extDeps_view->clear();
+ for ( QStringList::Iterator it1 = depsList.begin();it1 != depsList.end();++it1 )
+ {
+ intDepList << *it1;
+ new QListViewItem( extDeps_view, extDeps_view->lastItem(), ( *it1 ) );
+ }
+
+
+ for( QStringList::const_iterator it = intDepList.begin(); it != intDepList.end(); ++it )
+ {
+ intDeps_view->insertItem( items[*it] );
+ items.remove(*it);
+ }
+
+ for( QMap<QString,InsideCheckListItem*>::ConstIterator it2 = items.begin(); it2 != items.end(); it2++ )
+ {
+ intDeps_view->insertItem( it2.data() );
+ }
+}
+
+
+void ProjectConfigurationDlg::updateBuildOrderControl()
+{
+ //sort build order only if subdirs
+ if ( myProjectItem->scope->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) != -1 )
+ {
+
+ QPtrList <QMakeScopeItem> itemList;
+
+ QMakeScopeItem *item = static_cast<QMakeScopeItem*>( myProjectItem->firstChild() );
+ while ( item )
+ {
+ itemList.append( item );
+ item = static_cast<QMakeScopeItem*>( item->nextSibling() );
+ }
+
+ incaddTab->setEnabled( false );
+ buildorder_listview->setSorting( -1, false );
+ buildorder_listview->clear();
+ QStringList buildList = myProjectItem->scope->variableValues( "SUBDIRS" );
+ QStringList::Iterator it1 = buildList.begin();
+ for ( ;it1 != buildList.end();++it1 )
+ {
+ item = itemList.first();
+ while ( item )
+ {
+ if ( item->scope->scopeType() == Scope::ProjectScope )
+ {
+ if ( item->text( 0 ) == ( *it1 ) )
+ {
+ new QListViewItem( buildorder_listview, buildorder_listview->lastItem(), item->text( 0 ) );
+ itemList.take();
+ break;
+ }
+ }
+ item = itemList.next();;
+ }
+ }
+ }else
+ buildorder_listview->clear();
+}
+
+//build order buttons
+void ProjectConfigurationDlg::buildorderMoveUpClicked()
+{
+ if ( buildorder_listview->currentItem() == buildorder_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = buildorder_listview->firstChild();
+ while ( item->nextSibling() != buildorder_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( buildorder_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::buildorderMoveDownClicked()
+{
+ if ( buildorder_listview->currentItem() == 0 || buildorder_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ buildorder_listview->currentItem() ->moveItem( buildorder_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+//Include dir buttons
+void ProjectConfigurationDlg::insideIncMoveUpClicked()
+{
+ if ( insideinc_listview->currentItem() == insideinc_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = insideinc_listview->firstChild();
+ while ( item->nextSibling() != insideinc_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( insideinc_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::insideIncMoveDownClicked()
+{
+ if ( insideinc_listview->currentItem() == 0 || insideinc_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ insideinc_listview->currentItem() ->moveItem( insideinc_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideIncMoveUpClicked()
+{
+ if ( outsideinc_listview->currentItem() == outsideinc_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = outsideinc_listview->firstChild();
+ while ( item->nextSibling() != outsideinc_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( outsideinc_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideIncMoveDownClicked()
+{
+ if ( outsideinc_listview->currentItem() == 0 || outsideinc_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ outsideinc_listview->currentItem() ->moveItem( outsideinc_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideIncAddClicked()
+{
+ KURLRequesterDlg dialog( "", i18n( "Add include directory:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+ dialog.urlRequester() ->setURL( QString::null );
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir() ) );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString dir = dialog.urlRequester() ->url();
+ if ( !dir.isEmpty() )
+ {
+ new QListViewItem( outsideinc_listview, dir );
+ activateApply( 0 );
+ }
+}
+
+
+void ProjectConfigurationDlg::outsideIncRemoveClicked()
+{
+ delete outsideinc_listview->currentItem();
+ activateApply( 0 );
+}
+
+//libadd buttons
+void ProjectConfigurationDlg::insideLibMoveUpClicked()
+{
+ if ( insidelib_listview->currentItem() == insidelib_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = insidelib_listview->firstChild();
+ while ( item->nextSibling() != insidelib_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( insidelib_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::insideLibMoveDownClicked()
+{
+ if ( insidelib_listview->currentItem() == 0 || insidelib_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ insidelib_listview->currentItem() ->moveItem( insidelib_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideLibMoveUpClicked()
+{
+ if ( outsidelib_listview->currentItem() == outsidelib_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = outsidelib_listview->firstChild();
+ while ( item->nextSibling() != outsidelib_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( outsidelib_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideLibMoveDownClicked()
+{
+ if ( outsidelib_listview->currentItem() == 0 || outsidelib_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ outsidelib_listview->currentItem() ->moveItem( outsidelib_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideLibAddClicked()
+{
+ KURLRequesterDlg dialog( "", i18n( "Add Library: Either choose the .a/.so file or give -l<libname>" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ dialog.urlRequester() ->setFilter( "*.so|"+i18n("Shared Library (*.so)")+"\n*.a|"+i18n("Static Library (*.a)") );
+ dialog.urlRequester() ->setURL( QString::null );
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir() ) );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString file = dialog.urlRequester() ->url();
+ if ( !file.isEmpty() )
+ {
+ if( file.startsWith("-l") )
+ {
+ new QListViewItem( outsidelib_listview, file );
+ activateApply( 0 );
+ }
+ else
+ {
+ QFileInfo fi(file);
+ if( !fi.exists() )
+ {
+ new QListViewItem( outsidelib_listview, file );;
+ activateApply( 0 );
+ }
+ if( fi.extension(false) == "a" )
+ {
+ new QListViewItem( outsidelib_listview, file );
+ activateApply( 0 );
+ }else if ( fi.extension(false) == "so" )
+ {
+ QString path = fi.dirPath( true );
+ QString name = fi.fileName();
+ if( name.startsWith( "lib" ) )
+ name = name.mid(3);
+ name = "-l"+name.left( name.length() - 3 );
+ new QListViewItem( outsidelib_listview, name );
+ new QListViewItem( outsidelibdir_listview, path );
+ activateApply( 0 );
+ }else
+ return;
+ }
+
+ }
+}
+
+
+void ProjectConfigurationDlg::outsideLibRemoveClicked()
+{
+ delete outsidelib_listview->currentItem();
+ activateApply( 0 );
+}
+
+//lib paths buttons
+void ProjectConfigurationDlg::outsideLibDirMoveUpClicked()
+{
+ if ( outsidelibdir_listview->currentItem() == outsidelibdir_listview->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = outsidelibdir_listview->firstChild();
+ while ( item->nextSibling() != outsidelibdir_listview->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( outsidelibdir_listview->currentItem() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideLibDirMoveDownClicked()
+{
+ if ( outsidelibdir_listview->currentItem() == 0 || outsidelibdir_listview->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ outsidelibdir_listview->currentItem() ->moveItem( outsidelibdir_listview->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+
+void ProjectConfigurationDlg::outsideLibDirAddClicked()
+{
+ KURLRequesterDlg dialog( "", i18n( "Add library directory:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+ dialog.urlRequester() ->setURL( QString::null );
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir() ) );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString dir = dialog.urlRequester() ->url();
+ if ( !dir.isEmpty() )
+ {
+ new QListViewItem( outsidelibdir_listview, dir );
+ activateApply( 0 );
+ }
+}
+
+
+void ProjectConfigurationDlg::outsideLibDirRemoveClicked()
+{
+ delete outsidelibdir_listview->currentItem();
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::outsideIncEditClicked()
+{
+ QListViewItem * item = outsideinc_listview->currentItem();
+ if ( item == NULL ) return ;
+ QString text = item->text( 0 );
+
+ KURLRequesterDlg dialog( text, i18n( "Change include directory:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+ if( QFileInfo(text).isRelative() )
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir()+"/"+text ) );
+ }
+ else
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( text );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( text ) );
+ }
+ dialog.urlRequester() ->setURL( text );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString dir = dialog.urlRequester() ->url();
+ if ( !dir.isEmpty() )
+ {
+ item->setText( 0, dir );
+ activateApply( 0 );
+ }
+}
+
+void ProjectConfigurationDlg::outsideLibEditClicked()
+{
+ QListViewItem *item = outsidelib_listview->currentItem();
+ if ( item == NULL ) return ;
+ QString text = item->text( 0 );
+
+ KURLRequesterDlg dialog( text, i18n( "Change Library:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ if( QFileInfo(text).isRelative() )
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir()+"/"+text ) );
+ }else
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( text );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( text ) );
+ }
+ dialog.urlRequester() ->setURL( text );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString file = dialog.urlRequester() ->url();
+ if ( !file.isEmpty() )
+ {
+ if( file.startsWith("-l") )
+ {
+ item->setText( 0, file );
+ activateApply( 0 );
+ }
+ else
+ {
+ QFileInfo fi(file);
+ if( !fi.exists() )
+ {
+ item->setText( 0, file );
+ activateApply( 0 );
+ }
+ if( fi.extension(false) == "a" )
+ {
+ item->setText( 0, file );
+ activateApply( 0 );
+ }else if ( fi.extension(false) == "so" )
+ {
+ QString path = fi.dirPath( true );
+ QString name = fi.fileName();
+ if( name.startsWith( "lib" ) )
+ name = name.mid(3);
+ name = "-l"+name.left( name.length() - 3 );
+ item->setText( 0, name );
+ new QListViewItem( outsidelibdir_listview, path );
+ activateApply( 0 );
+ }else
+ return;
+ }
+ }
+}
+
+void ProjectConfigurationDlg::outsideLibDirEditClicked()
+{
+ QListViewItem * item = outsidelibdir_listview->currentItem();
+ if ( item == NULL ) return ;
+ QString text = item->text( 0 );
+
+ KURLRequesterDlg dialog( text, i18n( "Change library directory:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+
+ if( QFileInfo(text).isRelative() )
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir()+"/"+text ) );
+ }
+ else
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( text );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( text ) );
+ }
+ dialog.urlRequester() ->setURL( text );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString dir = dialog.urlRequester() ->url();
+ if ( !dir.isEmpty() )
+ {
+ item->setText( 0, dir );
+ activateApply( 0 );
+ }
+}
+
+
+void ProjectConfigurationDlg::extAdd_button_clicked( )
+{
+ KURLRequesterDlg dialog( "", i18n( "Add target:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::File | KFile::LocalOnly );
+ dialog.urlRequester() ->setURL( QString::null );
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir() ) );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString path = dialog.urlRequester() ->url();
+ if ( !path.isEmpty() )
+ {
+ new QListViewItem( extDeps_view, path );
+ activateApply( 0 );
+ }
+}
+
+void ProjectConfigurationDlg::extEdit_button_clicked( )
+{
+ QListViewItem * item = extDeps_view->currentItem();
+ if ( item == NULL ) return ;
+ QString text = item->text( 0 );
+
+ KURLRequesterDlg dialog( text, i18n( "Change target:" ), 0, 0 );
+ dialog.urlRequester() ->setMode( KFile::File | KFile::LocalOnly );
+ if( QFileInfo(text).isRelative() )
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( myProjectItem->scope->projectDir() );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( myProjectItem->scope->projectDir()+"/"+text ) );
+ }
+ else
+ {
+ dialog.urlRequester() ->completionObject() ->setDir( text );
+ dialog.urlRequester() ->fileDialog() ->setURL( KURL( text ) );
+ }
+ dialog.urlRequester() ->setURL( text );
+ if ( dialog.exec() != QDialog::Accepted )
+ return ;
+ QString path = dialog.urlRequester() ->url();
+ if ( !path.isEmpty() )
+ {
+ item->setText( 0, path );
+ activateApply( 0 );
+ }
+}
+
+void ProjectConfigurationDlg::extMoveDown_button_clicked( )
+{
+ if ( extDeps_view->currentItem() == 0 || extDeps_view->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ extDeps_view->currentItem() ->moveItem( extDeps_view->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::extMoveUp_button_clicked( )
+{
+ if ( extDeps_view->currentItem() == extDeps_view->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = extDeps_view->firstChild();
+ while ( item->nextSibling() != extDeps_view->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( extDeps_view->currentItem() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::extRemove_button_clicked( )
+{
+ delete extDeps_view->currentItem();
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::intMoveDown_button_clicked( )
+{
+ if ( intDeps_view->currentItem() == 0 || intDeps_view->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ intDeps_view->currentItem() ->moveItem( intDeps_view->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::intMoveUp_button_clicked( )
+{
+ if ( intDeps_view->currentItem() == intDeps_view->firstChild() )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+
+ QListViewItem *item = intDeps_view->firstChild();
+ while ( item->nextSibling() != intDeps_view->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( intDeps_view->currentItem() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::addCustomValueClicked()
+{
+ QMap<QString, QString> customvar;
+ customvar["var"] = i18n("Name");
+ customvar["op"] = "=";
+ customvar["values"] = i18n("Value");
+ unsigned int key = myProjectItem->scope->addCustomVariable( customvar["var"], customvar["op"], customvar["values"] );
+ CustomVarListItem* item = new CustomVarListItem( customVariables, key, customvar );
+ item->setMultiLinesEnabled(true);
+ customVariables->setSelected( item, true );
+ newCustomVariableActive();
+ customVariables->sort();
+ activateApply( 0 );
+}
+void ProjectConfigurationDlg::removeCustomValueClicked()
+{
+ QListViewItem * item = customVariables->currentItem();
+ if ( item )
+ {
+ myProjectItem->scope->removeCustomVariable( item->key(0, true).toUInt() );
+ delete item;
+ }
+ if( customVariables->firstChild() )
+ {
+ customVariables->setSelected( customVariables->firstChild(), true );
+ newCustomVariableActive();
+ }else
+ {
+ customVariableName->setText( "" );
+ customVariableData->setText( "" );
+ customVariableOp->setCurrentItem( 0 );
+ customVariableName->setFocus();
+ }
+ customVariables->sort();
+
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::upCustomValueClicked()
+{
+ // custom vars
+ QListViewItem * item = customVariables->firstChild();
+ if ( customVariables->currentItem() == item )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+ while ( item->nextSibling() != customVariables->currentItem() )
+ item = item->nextSibling();
+ item->moveItem( customVariables->currentItem() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::downCustomValueClicked()
+{
+ if ( customVariables->currentItem() == 0 || customVariables->currentItem() ->nextSibling() == 0 )
+ {
+ KNotifyClient::beep();
+ return ;
+ }
+ customVariables->currentItem() ->moveItem( customVariables->currentItem() ->nextSibling() );
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::newCustomVariableActive( )
+{
+ customVariableOp->blockSignals(true);
+ customVariableName->blockSignals(true);
+ customVariableData->blockSignals(true);
+ QListViewItem * item = customVariables->currentItem();
+ if ( item )
+ {
+ customVariableName->setText( item->text( 0 ) );
+ customVariableData->setText( item->text( 2 ) );
+ customVariableOp->setCurrentText( item->text( 1 ) );
+ customVariableName->setFocus();
+ }
+ customVariableOp->blockSignals(false);
+ customVariableName->blockSignals(false);
+ customVariableData->blockSignals(false);
+}
+
+void ProjectConfigurationDlg::groupLibrariesChanged( int )
+{
+ if ( staticRadio->isChecked() )
+ {
+ checkPlugin->setEnabled( false );
+ checkDesigner->setEnabled( false );
+ }
+ else if ( sharedRadio->isChecked() )
+ {
+ checkPlugin->setEnabled( true );
+ checkDesigner->setEnabled( checkPlugin->isChecked() );
+ }
+ else if ( checkPlugin->isChecked() && prjWidget->m_part->isQt4Project() )
+ {
+ checkDesigner->setEnabled( true );
+ }
+ else
+ {
+ checkDesigner->setEnabled( false );
+ }
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::groupTemplateChanged( int )
+{
+
+ if ( radioSubdirs->isChecked() )
+ {
+ TabBuild->setTabEnabled( custVarsTab, true );
+ TabBuild->setTabEnabled( libAddTab, false );
+ TabBuild->setTabEnabled( incaddTab, false );
+ TabBuild->setTabEnabled( buildOptsTab, false );
+ TabBuild->setTabEnabled( configTab, false );
+ TabBuild->setTabEnabled( depTab, true );
+ intDeps_view->setEnabled( false );
+ intMoveUp_button->setEnabled( false );
+ intMoveDown_button->setEnabled( false );
+ extAdd_button->setEnabled( false );
+ extRemove_button->setEnabled( false );
+ extEdit_button->setEnabled( false );
+ extMoveUp_button->setEnabled( false );
+ extMoveDown_button->setEnabled( false );
+ extDeps_view->setEnabled( false );
+ buildorder_listview->setEnabled( checkOrdered->isOn() );
+ buildmoveup_button->setEnabled( checkOrdered->isOn() );
+ buildmovedown_button->setEnabled( checkOrdered->isOn() );
+ targetGroupbox->setEnabled( false );
+ targetInstGroupbox->setEnabled( false );
+ checkOrdered->setEnabled( true );
+ }
+ else if ( radioLibrary->isChecked() )
+ {
+ // staticRadio->setChecked(true);
+ TabBuild->setTabEnabled( custVarsTab, true );
+ TabBuild->setTabEnabled( depTab, true );
+ TabBuild->setTabEnabled( libAddTab, true );
+ TabBuild->setTabEnabled( incaddTab, true );
+ TabBuild->setTabEnabled( buildOptsTab, true );
+ TabBuild->setTabEnabled( configTab, true );
+ intDeps_view->setEnabled( true );
+ intMoveUp_button->setEnabled( true );
+ intMoveDown_button->setEnabled( true );
+ extAdd_button->setEnabled( true );
+ extRemove_button->setEnabled( true );
+ extEdit_button->setEnabled( true );
+ extMoveUp_button->setEnabled( true );
+ extMoveDown_button->setEnabled( true );
+ extDeps_view->setEnabled( true );
+ buildorder_listview->setEnabled( false );
+ buildmoveup_button->setEnabled( false );
+ buildmovedown_button->setEnabled( false );
+ groupLibraries->setEnabled( true );
+ targetGroupbox->setEnabled( true );
+ targetInstGroupbox->setEnabled( true );
+ checkOrdered->setEnabled( false );
+ }
+ else if ( radioApplication->isChecked() )
+ {
+ TabBuild->setTabEnabled( custVarsTab, true );
+ TabBuild->setTabEnabled( depTab, true );
+ TabBuild->setTabEnabled( libAddTab, true );
+ TabBuild->setTabEnabled( incaddTab, true );
+ TabBuild->setTabEnabled( buildOptsTab, true );
+ TabBuild->setTabEnabled( configTab, true );
+ intDeps_view->setEnabled( true );
+ intMoveUp_button->setEnabled( true );
+ intMoveDown_button->setEnabled( true );
+ extAdd_button->setEnabled( true );
+ extRemove_button->setEnabled( true );
+ extEdit_button->setEnabled( true );
+ extMoveUp_button->setEnabled( true );
+ extMoveDown_button->setEnabled( true );
+ extDeps_view->setEnabled( true );
+ buildorder_listview->setEnabled( false );
+ buildmoveup_button->setEnabled( false );
+ buildmovedown_button->setEnabled( false );
+ groupLibraries->setEnabled( false );
+ targetGroupbox->setEnabled( true );
+ targetInstGroupbox->setEnabled( true );
+ checkConsole->setEnabled( true );
+ checkWindows->setEnabled( true );
+ checkOrdered->setEnabled( false );
+ }
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::groupRequirementsChanged( int )
+{
+ if ( checkQt->isChecked() && prjWidget->m_part->isQt4Project() )
+ {
+ groupQt4Libs->setEnabled( true );
+ }
+ else
+ {
+ groupQt4Libs->setEnabled( false );
+ }
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::targetInstallChanged( bool checked )
+{
+ if ( checked )
+ {
+ m_InstallTargetPath->setEnabled( true );
+ }
+ else
+ {
+ m_InstallTargetPath->setEnabled( false );
+ }
+ activateApply( 0 );
+}
+
+void ProjectConfigurationDlg::apply()
+{
+// if( buttonApply->isEnabled() )
+ if( !myProjectItem || !myProjectItem->scope )
+ {
+ buttonApply->setEnabled( false );
+ return;
+ }
+ updateProjectConfiguration();
+ myProjectItem->scope->saveToFile();
+ // prjWidget->updateProjectConfiguration( myProjectItem );
+ prjWidget->setupContext();
+ buttonApply->setEnabled( false );
+}
+
+void ProjectConfigurationDlg::activateApply( int )
+{
+ buttonApply->setEnabled( true );
+}
+void ProjectConfigurationDlg::activateApply( const QString& )
+{
+ buttonApply->setEnabled( true );
+}
+
+void ProjectConfigurationDlg::activateApply( QListViewItem* )
+{
+ buttonApply->setEnabled( true );
+}
+
+void ProjectConfigurationDlg::removeSharedLibDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+
+ if( prjItem->scope->variableValues("LIBS").findIndex(infos["shared_lib"]) != -1 )
+ prjItem->scope->removeFromPlusOp("LIBS", infos["shared_lib"]);
+ if( prjItem->scope->variableValues("LIBS").findIndex(infos["shared_libdir"]) != -1 )
+ prjItem->scope->removeFromPlusOp("LIBS", infos["shared_libdir"]);
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["shared_depend"]) != -1 )
+ {
+ prjItem->scope->removeFromPlusOp("TARGETDEPS", infos["shared_depend"]);
+
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::addStaticLibDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["app_depend"]) != -1
+ || prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["shared_depend"]) != -1 )
+ {
+ prjItem->scope->addToPlusOp("LIBS", infos["static_lib"]);
+ prjItem->scope->addToPlusOp("TARGETDEPS", infos["static_depend"]);
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::removeStaticLibDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+
+ if( prjItem->scope->variableValues("LIBS").findIndex(infos["static_lib"]) != -1 )
+ prjItem->scope->removeFromPlusOp("LIBS", infos["static_lib"]);
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["static_depend"]) != -1 )
+ {
+ prjItem->scope->removeFromPlusOp("TARGETDEPS", infos["static_depend"]);
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::addSharedLibDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["app_depend"]) != -1
+ || prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["static_depend"]) != -1 )
+ {
+ prjItem->scope->addToPlusOp("LIBS", infos["shared_lib"]);
+ prjItem->scope->addToPlusOp("LIBS", infos["shared_libdir"]);
+ prjItem->scope->addToPlusOp("TARGETDEPS", infos["shared_depend"]);
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::removeAppDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["app_depend"]) != -1 )
+ {
+ prjItem->scope->removeFromPlusOp("TARGETDEPS", infos["app_depend"]);
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::addAppDeps()
+{
+ QListViewItemIterator it(myProjectItem->listView());
+ for( ; it.current() ; ++it )
+ {
+ QMakeScopeItem* prjItem = static_cast<QMakeScopeItem*>( it.current() );
+ if( prjItem == myProjectItem || !prjItem->isEnabled() )
+ continue;
+
+ QMap<QString, QString> infos = myProjectItem->getLibInfos(prjItem->scope->projectDir());
+
+ if( prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["shared_depend"]) != -1
+ || prjItem->scope->variableValues("TARGETDEPS").findIndex(infos["static_depend"]) != -1 )
+ {
+ prjItem->scope->addToPlusOp("TARGETDEPS", infos["app_depend"]);
+
+ prjItem->scope->saveToFile();
+ }
+ }
+}
+
+void ProjectConfigurationDlg::customVarChanged()
+{
+ QListViewItem * item = customVariables->currentItem();
+ if ( item )
+ {
+ item->setText( 0, customVariableName->text() );
+ item->setText( 1, customVariableOp->currentText() );
+ item->setText( 2, customVariableData->text() );
+ }
+ activateApply( 0 );
+}
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/projectconfigurationdlg.h b/buildtools/qmake/projectconfigurationdlg.h
new file mode 100644
index 00000000..246fb388
--- /dev/null
+++ b/buildtools/qmake/projectconfigurationdlg.h
@@ -0,0 +1,145 @@
+/***************************************************************************
+* Copyright (C) 2002 by Jakob Simon-Gaarde *
+* jsgaarde@tdcspace.dk *
+* Copyright (C) 2002-2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* Copyright (C) 2003 by Thomas Hasart *
+* thasart@gmx.de *
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 PROJECTCONFIGURATIONDLG_H
+#define PROJECTCONFIGURATIONDLG_H
+
+#include "projectconfigurationdlgbase.h"
+//#include "trollprojectwidget.h"
+#include <kdeversion.h>
+#include <qlistview.h>
+#include <klistview.h>
+#include <qmap.h>
+
+class QMakeScopeItem;
+class KListViewItem;
+class qProjectItem;
+class ProjectConfigurationDlg;
+class TrollProjectWidget;
+
+class InsideCheckListItem : public QCheckListItem
+{
+public:
+ InsideCheckListItem( QListView *parent, QMakeScopeItem *item, ProjectConfigurationDlg *config );
+
+ InsideCheckListItem( QListView *parent, QListViewItem *after, QMakeScopeItem *item, ProjectConfigurationDlg *config );
+ QMakeScopeItem *prjItem;
+ ProjectConfigurationDlg *m_config;
+
+protected:
+ virtual void stateChange ( bool state );
+};
+
+class CustomVarListItem : public KListViewItem
+{
+ public:
+ CustomVarListItem( QListView*, unsigned int, QMap<QString, QString> );
+ QString key(int column, bool ascending) const;
+ private:
+ unsigned int m_key;
+};
+
+class ProjectConfigurationDlg : public ProjectConfigurationDlgBase
+{
+public:
+ ProjectConfigurationDlg( QListView *_prjList, TrollProjectWidget* _prjWidget, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ProjectConfigurationDlg();
+ void updateControls();
+ void updateSubproject( QMakeScopeItem* _item );
+ QMakeScopeItem* currentProjectItem() { return myProjectItem; }
+
+public slots:
+ // virtual void radioLibrarytoggled(bool);
+ virtual void updateProjectConfiguration();
+
+ virtual void buildorderMoveUpClicked();
+ virtual void buildorderMoveDownClicked();
+
+ virtual void insideIncMoveUpClicked();
+ virtual void insideIncMoveDownClicked();
+ virtual void outsideIncMoveUpClicked();
+ virtual void outsideIncMoveDownClicked();
+ virtual void outsideIncAddClicked();
+ virtual void outsideIncRemoveClicked();
+ virtual void outsideIncEditClicked();
+
+ virtual void insideLibMoveUpClicked();
+ virtual void insideLibMoveDownClicked();
+ virtual void outsideLibMoveUpClicked();
+ virtual void outsideLibMoveDownClicked();
+ virtual void outsideLibAddClicked();
+ virtual void outsideLibRemoveClicked();
+ virtual void outsideLibEditClicked();
+
+ virtual void outsideLibDirMoveUpClicked();
+ virtual void outsideLibDirMoveDownClicked();
+ virtual void outsideLibDirAddClicked();
+ virtual void outsideLibDirRemoveClicked();
+ virtual void outsideLibDirEditClicked();
+
+ virtual void extAdd_button_clicked();
+ virtual void extEdit_button_clicked();
+ virtual void extMoveDown_button_clicked();
+ virtual void extMoveUp_button_clicked();
+ virtual void extRemove_button_clicked();
+ virtual void intMoveDown_button_clicked();
+ virtual void intMoveUp_button_clicked();
+
+ virtual void addCustomValueClicked();
+ virtual void removeCustomValueClicked();
+ virtual void upCustomValueClicked();
+ virtual void downCustomValueClicked();
+
+ virtual void newCustomVariableActive();
+
+ virtual void groupLibrariesChanged( int );
+ virtual void groupRequirementsChanged( int );
+ virtual void groupTemplateChanged( int );
+ virtual void targetInstallChanged( bool );
+ virtual void accept();
+ virtual void reject();
+ virtual void apply();
+ virtual void activateApply( int );
+ virtual void activateApply( const QString& );
+
+
+ void updateIncludeControl();
+ void updateLibControls();
+ void updateBuildOrderControl();
+ void updateDependenciesControl();
+ virtual void activateApply(QListViewItem*);
+ virtual void customVarChanged();
+
+protected:
+ QListView *prjList;
+ QMakeScopeItem *myProjectItem;
+ QPtrList <QMakeScopeItem> getAllProjects();
+ TrollProjectWidget* prjWidget;
+ void getAllSubProjects( QMakeScopeItem *item, QPtrList<QMakeScopeItem> *itemList );
+
+private:
+ void removeSharedLibDeps();
+ void removeStaticLibDeps();
+ void addSharedLibDeps();
+ void addStaticLibDeps();
+ void removeAppDeps();
+ void addAppDeps();
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/projectconfigurationdlgbase.ui b/buildtools/qmake/projectconfigurationdlgbase.ui
new file mode 100644
index 00000000..d447210d
--- /dev/null
+++ b/buildtools/qmake/projectconfigurationdlgbase.ui
@@ -0,0 +1,2897 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ProjectConfigurationDlgBase</class>
+<author>Jakob Simon-Gaarde</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ProjectConfigurationDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>746</width>
+ <height>694</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>QMake Subproject Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>260</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ <widget class="QTabWidget" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>TabBuild</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>buildTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Basics</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupTemplate</cstring>
+ </property>
+ <property name="title">
+ <string>Template</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>radioLibrary</cstring>
+ </property>
+ <property name="text">
+ <string>Librar&amp;y</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create a library</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>radioSubdirs</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Subdirectories</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This project holds subdirectories</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>checkOrdered</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Ordered</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Build the subprojects in the order they are listed in the .pro file</string>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>101</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>radioApplication</cstring>
+ </property>
+ <property name="backgroundOrigin">
+ <enum>WidgetOrigin</enum>
+ </property>
+ <property name="text">
+ <string>A&amp;pplication</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create an application</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>targetGroupbox</cstring>
+ </property>
+ <property name="title">
+ <string>Target</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Path:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_targetPath</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Output file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_targetOutputFile</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_targetOutputFile</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>m_targetPath</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>targetInstGroupbox</cstring>
+ </property>
+ <property name="title">
+ <string>Target Installation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>m_InstallTargetPath</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkInstallTarget</cstring>
+ </property>
+ <property name="text">
+ <string>I&amp;nstall</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Installation path:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_InstallTargetPath</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox6</cstring>
+ </property>
+ <property name="title">
+ <string>Makefile</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="0" column="0">
+ <property name="name">
+ <cstring>makefile_url</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>argumentsGroupBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Arguments</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_6</cstring>
+ </property>
+ <property name="text">
+ <string>Run arguments:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_editRunArguments</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_editDebugArguments</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Debug Arguments:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Working Directory:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="1">
+ <property name="name">
+ <cstring>m_CWDEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>120</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>configTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Configuration</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupBuildMode</cstring>
+ </property>
+ <property name="title">
+ <string>Build Mode</string>
+ </property>
+ <property name="selectedId" stdset="0">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set project to be built in release mode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout147</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioDebugMode</cstring>
+ </property>
+ <property name="text">
+ <string>Debug</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set project to be built in debug mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioReleaseMode</cstring>
+ </property>
+ <property name="text">
+ <string>Release</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set project to be built in release mode</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkDebugReleaseMode</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Debug &amp;&amp; Release</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set project to be built in debug_and_release mode</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout30</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkWarning</cstring>
+ </property>
+ <property name="text">
+ <string>Enable warnings</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Show compiler warnings</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBuildAll</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Build All</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Builds Debug and Release version if Debug&amp;Release is configured</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupRequirements</cstring>
+ </property>
+ <property name="title">
+ <string>Requirements</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkOpenGL</cstring>
+ </property>
+ <property name="text">
+ <string>OpenGL</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Requires the OpenGL (or Mesa) headers/libraries</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>stlCheck</cstring>
+ </property>
+ <property name="text">
+ <string>STL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkThread</cstring>
+ </property>
+ <property name="text">
+ <string>Thread</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Requires support for multi-threaded application or library.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkQt</cstring>
+ </property>
+ <property name="text">
+ <string>Qt</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Requires the Qt header files/library</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkX11</cstring>
+ </property>
+ <property name="text">
+ <string>X11</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Support required for X11 application or library</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="2">
+ <property name="name">
+ <cstring>checkPCH</cstring>
+ </property>
+ <property name="text">
+ <string>Precompiled headers</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>rttiCheck</cstring>
+ </property>
+ <property name="text">
+ <string>RTTI</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>checkWindows</cstring>
+ </property>
+ <property name="text">
+ <string>Windows</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>Custom Configuration</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>exceptionCheck</cstring>
+ </property>
+ <property name="text">
+ <string>Exceptions </string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>editConfigExtra</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>checkConsole</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Console</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check to build a win32 console app</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupQt4Libs</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Qt4 Libraries</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>checkQt4Gui</cstring>
+ </property>
+ <property name="text">
+ <string>Gui</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>checkQt4XML</cstring>
+ </property>
+ <property name="text">
+ <string>XML</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>checkQt4Network</cstring>
+ </property>
+ <property name="text">
+ <string>Network</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkQt4Core</cstring>
+ </property>
+ <property name="text">
+ <string>Core</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>checkQt4OpenGL</cstring>
+ </property>
+ <property name="text">
+ <string>OpenGL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>checkUiTools</cstring>
+ </property>
+ <property name="text">
+ <string>QtUiTools</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="1">
+ <property name="name">
+ <cstring>checkQt4SQL</cstring>
+ </property>
+ <property name="text">
+ <string>SQL</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>checkQt4SVG</cstring>
+ </property>
+ <property name="text">
+ <string>SVG</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>checkTestlib</cstring>
+ </property>
+ <property name="text">
+ <string>QtTest</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>checkQt3Support</cstring>
+ </property>
+ <property name="text">
+ <string>Qt3 Support</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="2">
+ <property name="name">
+ <cstring>checkQDBus</cstring>
+ </property>
+ <property name="text">
+ <string>QDBus (Qt4.2)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="2">
+ <property name="name">
+ <cstring>checkAssistant</cstring>
+ </property>
+ <property name="text">
+ <string>QtAssistant</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="3">
+ <property name="name">
+ <cstring>checkQtScript</cstring>
+ </property>
+ <property name="text">
+ <string>QtScript (Qt4.3)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>checkQtWebKit</cstring>
+ </property>
+ <property name="text">
+ <string>QtWebKit (Qt4.4)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="3">
+ <property name="name">
+ <cstring>checkQtXmlPatterns</cstring>
+ </property>
+ <property name="text">
+ <string>QtXmlPatterns (Qt4.4)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="3">
+ <property name="name">
+ <cstring>checkPhonon</cstring>
+ </property>
+ <property name="text">
+ <string>Phonon (Qt4.4)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="4">
+ <property name="name">
+ <cstring>checkQtHelp</cstring>
+ </property>
+ <property name="text">
+ <string>QtHelp (Qt4.4)</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupLibraries</cstring>
+ </property>
+ <property name="title">
+ <string>Library Options</string>
+ </property>
+ <property name="exclusive">
+ <bool>false</bool>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout69</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>staticRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Build as static library</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkPlugin</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Plugin</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkLibtool</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Make libtool archive</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Support required for X11 application or library</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer34</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout68</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>sharedRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Build as shared library</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkDesigner</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Designer Plugin</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout67</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Library version:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_targetLibraryVersion</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>m_targetLibraryVersion</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <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>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>incaddTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Includes</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>insideIncMoveUpBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>insideIncMoveDownBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2</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>
+ </vbox>
+ </widget>
+ <widget class="QListView" row="3" column="0">
+ <column>
+ <property name="text">
+ <string>Directories Outside Project</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>outsideinc_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string>Directories Inside Project</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>insideinc_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="1">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideIncAddBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Add...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideIncRemoveBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideIncEditBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideIncMoveUpBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideIncMoveDownBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_2</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>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>libAddTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Libraries</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>External Library Dirs</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>outsidelibdir_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibDirAddBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Add...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibDirRemoveBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibDirEditBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibDirMoveUpBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibDirMoveDownBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_2_2</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>External Libraries</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>outsidelib_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibAddBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Add...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibRemoveBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibEditBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibMoveUpBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>outsideLibMoveDownBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>64</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Link Convenience Libraries Inside Project</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>insidelib_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9_3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>insideLibMoveUpBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>insideLibMoveDownBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6_2_2</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>depTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Dependencies</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout26</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Targets in Project</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>intDeps_view</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9_3_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>intMoveUp_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>intMoveDown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6_2_2_2</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout27</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Miscellaneous Targets</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>extDeps_view</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>extAdd_button</cstring>
+ </property>
+ <property name="text">
+ <string>Add...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>extRemove_button</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>extEdit_button</cstring>
+ </property>
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>extMoveUp_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>extMoveDown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>64</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout28_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Order in Which Sub Projects Are Built</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>buildorder_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout9_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buildmoveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buildmovedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3_2_2</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>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>buildOptsTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Build Options</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Compiler Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout26</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout23</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Debug flags:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_debugFlags</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Release flags:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_releaseFlags</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Defines:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout24</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>m_debugFlags</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>m_releaseFlags</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>m_defines</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox8</cstring>
+ </property>
+ <property name="title">
+ <string>Intermediate File Directories</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout84</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>mocdir_label</cstring>
+ </property>
+ <property name="text">
+ <string>MOC files:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mocdir_url</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>uidir_label</cstring>
+ </property>
+ <property name="text">
+ <string>UI files:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>uidir_url</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>objdir_label</cstring>
+ </property>
+ <property name="text">
+ <string>Object files:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>objdir_url</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>rccdir_label</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>RCC files:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout85</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>mocdir_url</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>uidir_url</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>objdir_url</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>rccdir_url</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>idlGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Corba</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Compiler options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>idlCmdOptionsEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>idlCmdOptionsEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>idlCmdEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>IDL compiler:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>idlCmdEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer29</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>custVarsTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Custom Variables</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout24</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Operator</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>customVariables</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>6</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="defaultRenameAction">
+ <enum>Accept</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout23</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout22</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>varAdd_button</cstring>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>varRemove_button</cstring>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>varMoveUp_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Up</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>varMoveDown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move Down</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8_2_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>106</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout33</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>customVariableName</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>3</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout32</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_5</cstring>
+ </property>
+ <property name="text">
+ <string>Operator</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <item>
+ <property name="text">
+ <string>+=</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-=</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>=</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>*=</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>~=</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>customVariableOp</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentItem">
+ <number>0</number>
+ </property>
+ <property name="duplicatesEnabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer17</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>250</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout34</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Value:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>customVariableData</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>2</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>idlCmdEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>idlCmdEdit</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>idlCmdOptionsEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>makefile_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>makefile_url</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_debugFlags</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_defines</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_InstallTargetPath</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>mocdir_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>mocdir_url</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_releaseFlags</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_targetLibraryVersion</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_targetOutputFile</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>objdir_url</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>objdir_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>rccdir_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>rccdir_url</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>uidir_url</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>editConfigExtra</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_editRunArguments</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_editDebugArguments</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>groupBuildMode</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(int)</slot>
+ </connection>
+ <connection>
+ <sender>groupQt4Libs</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(int)</slot>
+ </connection>
+ <connection>
+ <sender>insideinc_listview</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>insideinc_listview</sender>
+ <signal>spacePressed(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>insidelib_listview</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>insidelib_listview</sender>
+ <signal>spacePressed(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>intDeps_view</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>intDeps_view</sender>
+ <signal>spacePressed(QListViewItem*)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>varAdd_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>addCustomValueClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>apply()</slot>
+ </connection>
+ <connection>
+ <sender>buildmovedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>buildorderMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buildmoveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>buildorderMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>customVariableName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>customVarChanged()</slot>
+ </connection>
+ <connection>
+ <sender>customVariableOp</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>customVarChanged()</slot>
+ </connection>
+ <connection>
+ <sender>customVariableData</sender>
+ <signal>textChanged()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>customVarChanged()</slot>
+ </connection>
+ <connection>
+ <sender>varMoveUp_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>downCustomValueClicked()</slot>
+ </connection>
+ <connection>
+ <sender>extAdd_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>extAdd_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>extEdit_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>extEdit_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>extMoveDown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>extMoveDown_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>extMoveUp_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>extMoveUp_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>extRemove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>extRemove_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>groupLibraries</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>groupLibrariesChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>groupRequirements</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>groupRequirementsChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>groupTemplate</sender>
+ <signal>clicked(int)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>groupTemplateChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>insideIncMoveDownBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>insideIncMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insideIncMoveUpBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>insideIncMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insideLibMoveDownBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>insideLibMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>insideLibMoveUpBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>insideLibMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>intMoveDown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>intMoveDown_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>intMoveUp_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>intMoveUp_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>customVariables</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>newCustomVariableActive()</slot>
+ </connection>
+ <connection>
+ <sender>outsideIncAddBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideIncAddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideIncEditBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideIncEditClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideIncMoveDownBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideIncMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideIncMoveUpBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideIncMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideIncRemoveBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideIncRemoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibAddBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibAddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibDirAddBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibDirAddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibDirEditBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibDirEditClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibDirMoveDownBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibDirMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibDirMoveUpBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibDirMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibDirRemoveBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibDirRemoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibEditBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibEditClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibMoveDownBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibMoveDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibMoveUpBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibMoveUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>outsideLibRemoveBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>outsideLibRemoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>varRemove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>removeCustomValueClicked()</slot>
+ </connection>
+ <connection>
+ <sender>checkOrdered</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buildmovedown_button</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkOrdered</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buildmoveup_button</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkOrdered</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buildorder_listview</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>radioApplication</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>argumentsGroupBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkInstallTarget</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>targetInstallChanged(bool)</slot>
+ </connection>
+ <connection>
+ <sender>varMoveDown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>upCustomValueClicked()</slot>
+ </connection>
+ <connection>
+ <sender>m_targetPath</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_targetPath</sender>
+ <signal>returnPressed(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_targetPath</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>uidir_url</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_CWDEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_CWDEdit</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>ProjectConfigurationDlgBase</receiver>
+ <slot>activateApply(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>TabBuild</tabstop>
+ <tabstop>radioApplication</tabstop>
+ <tabstop>radioLibrary</tabstop>
+ <tabstop>radioSubdirs</tabstop>
+ <tabstop>checkOrdered</tabstop>
+ <tabstop>m_targetOutputFile</tabstop>
+ <tabstop>checkInstallTarget</tabstop>
+ <tabstop>m_InstallTargetPath</tabstop>
+ <tabstop>makefile_url</tabstop>
+ <tabstop>radioDebugMode</tabstop>
+ <tabstop>radioReleaseMode</tabstop>
+ <tabstop>checkDebugReleaseMode</tabstop>
+ <tabstop>checkWarning</tabstop>
+ <tabstop>checkBuildAll</tabstop>
+ <tabstop>checkQt</tabstop>
+ <tabstop>checkOpenGL</tabstop>
+ <tabstop>stlCheck</tabstop>
+ <tabstop>checkWindows</tabstop>
+ <tabstop>checkThread</tabstop>
+ <tabstop>checkX11</tabstop>
+ <tabstop>rttiCheck</tabstop>
+ <tabstop>exceptionCheck</tabstop>
+ <tabstop>checkConsole</tabstop>
+ <tabstop>checkPCH</tabstop>
+ <tabstop>editConfigExtra</tabstop>
+ <tabstop>checkQt4Core</tabstop>
+ <tabstop>checkQt4Gui</tabstop>
+ <tabstop>checkQt4XML</tabstop>
+ <tabstop>checkQt4Network</tabstop>
+ <tabstop>checkQt4OpenGL</tabstop>
+ <tabstop>checkUiTools</tabstop>
+ <tabstop>checkQt4SQL</tabstop>
+ <tabstop>checkQt4SVG</tabstop>
+ <tabstop>checkTestlib</tabstop>
+ <tabstop>checkQt3Support</tabstop>
+ <tabstop>checkQDBus</tabstop>
+ <tabstop>checkAssistant</tabstop>
+ <tabstop>checkQtScript</tabstop>
+ <tabstop>checkQtWebKit</tabstop>
+ <tabstop>checkQtXmlPatterns</tabstop>
+ <tabstop>checkPhonon</tabstop>
+ <tabstop>checkQtHelp</tabstop>
+ <tabstop>staticRadio</tabstop>
+ <tabstop>checkPlugin</tabstop>
+ <tabstop>checkLibtool</tabstop>
+ <tabstop>sharedRadio</tabstop>
+ <tabstop>checkDesigner</tabstop>
+ <tabstop>m_targetLibraryVersion</tabstop>
+ <tabstop>insideinc_listview</tabstop>
+ <tabstop>insideIncMoveUpBtn</tabstop>
+ <tabstop>insideIncMoveDownBtn</tabstop>
+ <tabstop>outsideinc_listview</tabstop>
+ <tabstop>outsideIncAddBtn</tabstop>
+ <tabstop>outsideIncRemoveBtn</tabstop>
+ <tabstop>outsideIncEditBtn</tabstop>
+ <tabstop>outsideIncMoveUpBtn</tabstop>
+ <tabstop>outsideIncMoveDownBtn</tabstop>
+ <tabstop>insidelib_listview</tabstop>
+ <tabstop>insideLibMoveUpBtn</tabstop>
+ <tabstop>insideLibMoveDownBtn</tabstop>
+ <tabstop>outsidelibdir_listview</tabstop>
+ <tabstop>outsideLibDirAddBtn</tabstop>
+ <tabstop>outsideLibDirRemoveBtn</tabstop>
+ <tabstop>outsideLibDirEditBtn</tabstop>
+ <tabstop>outsideLibDirMoveUpBtn</tabstop>
+ <tabstop>outsideLibDirMoveDownBtn</tabstop>
+ <tabstop>outsidelib_listview</tabstop>
+ <tabstop>outsideLibAddBtn</tabstop>
+ <tabstop>outsideLibRemoveBtn</tabstop>
+ <tabstop>outsideLibEditBtn</tabstop>
+ <tabstop>outsideLibMoveUpBtn</tabstop>
+ <tabstop>outsideLibMoveDownBtn</tabstop>
+ <tabstop>intDeps_view</tabstop>
+ <tabstop>intMoveUp_button</tabstop>
+ <tabstop>intMoveDown_button</tabstop>
+ <tabstop>extDeps_view</tabstop>
+ <tabstop>extAdd_button</tabstop>
+ <tabstop>extRemove_button</tabstop>
+ <tabstop>extEdit_button</tabstop>
+ <tabstop>extMoveUp_button</tabstop>
+ <tabstop>extMoveDown_button</tabstop>
+ <tabstop>buildorder_listview</tabstop>
+ <tabstop>buildmoveup_button</tabstop>
+ <tabstop>buildmovedown_button</tabstop>
+ <tabstop>m_debugFlags</tabstop>
+ <tabstop>m_releaseFlags</tabstop>
+ <tabstop>m_defines</tabstop>
+ <tabstop>mocdir_url</tabstop>
+ <tabstop>uidir_url</tabstop>
+ <tabstop>objdir_url</tabstop>
+ <tabstop>rccdir_url</tabstop>
+ <tabstop>idlCmdEdit</tabstop>
+ <tabstop>idlCmdOptionsEdit</tabstop>
+ <tabstop>customVariables</tabstop>
+ <tabstop>varAdd_button</tabstop>
+ <tabstop>varRemove_button</tabstop>
+ <tabstop>varMoveUp_button</tabstop>
+ <tabstop>varMoveDown_button</tabstop>
+ <tabstop>customVariableName</tabstop>
+ <tabstop>customVariableOp</tabstop>
+ <tabstop>customVariableData</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonApply</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+</includes>
+<slots>
+ <slot>updateProjectConfiguration()</slot>
+ <slot>buildorderMoveUpClicked()</slot>
+ <slot>buildorderMoveDownClicked()</slot>
+ <slot>outsideIncMoveUpClicked()</slot>
+ <slot>outsideIncMoveDownClicked()</slot>
+ <slot>insideIncMoveUpClicked()</slot>
+ <slot>insideIncMoveDownClicked()</slot>
+ <slot>outsideLibMoveUpClicked()</slot>
+ <slot>outsideLibMoveDownClicked()</slot>
+ <slot>insideLibMoveUpClicked()</slot>
+ <slot>insideLibMoveDownClicked()</slot>
+ <slot>outsideIncAddClicked()</slot>
+ <slot>outsideIncRemoveClicked()</slot>
+ <slot>outsideLibAddClicked()</slot>
+ <slot>outsideLibRemoveClicked()</slot>
+ <slot>outsideLibDirMoveDownClicked()</slot>
+ <slot>outsideLibDirMoveUpClicked()</slot>
+ <slot>outsideLibDirAddClicked()</slot>
+ <slot>outsideLibDirRemoveClicked()</slot>
+ <slot>outsideLibDirEditClicked()</slot>
+ <slot>outsideLibEditClicked()</slot>
+ <slot>outsideIncEditClicked()</slot>
+ <slot>intMoveUp_button_clicked()</slot>
+ <slot>intMoveDown_button_clicked()</slot>
+ <slot>extAdd_button_clicked()</slot>
+ <slot>extRemove_button_clicked()</slot>
+ <slot>extEdit_button_clicked()</slot>
+ <slot>extMoveUp_button_clicked()</slot>
+ <slot>extMoveDown_button_clicked()</slot>
+ <slot>removeCustomValueClicked()</slot>
+ <slot>upCustomValueClicked()</slot>
+ <slot>downCustomValueClicked()</slot>
+ <slot>newCustomVariableActive()</slot>
+ <slot>addCustomValueClicked()</slot>
+ <slot>groupRequirementsChanged( int )</slot>
+ <slot>groupLibrariesChanged( int )</slot>
+ <slot>groupTemplateChanged( int )</slot>
+ <slot>targetInstallChanged( bool )</slot>
+ <slot>apply()</slot>
+ <slot>activateApply( int )</slot>
+ <slot>activateApply( const QString &amp; )</slot>
+ <slot>activateApply( QListViewItem * )</slot>
+ <slot>customVarChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>ktextedit.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/qmake/qmakedefaultopts.cpp b/buildtools/qmake/qmakedefaultopts.cpp
new file mode 100644
index 00000000..14ca7aa0
--- /dev/null
+++ b/buildtools/qmake/qmakedefaultopts.cpp
@@ -0,0 +1,91 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "qmakedefaultopts.h"
+
+#include <kdebug.h>
+#include <ktempfile.h>
+#include <qregexp.h>
+#include <kprocess.h>
+
+#include <blockingkprocess.h>
+
+QMakeDefaultOpts::QMakeDefaultOpts()
+{
+
+}
+
+void QMakeDefaultOpts::readVariables( const QString& qmake, const QString& projdir )
+{
+ KTempFile makefile (projdir+"/", ".mf");
+ KTempFile qmakefile(projdir+"/", ".pro");
+ if ( makefile.status() == 0 && qmakefile.status() == 0 )
+ {
+ makefile.close();
+ qmakefile.close();
+
+ BlockingKProcess proc;
+ kdDebug(9024) << "KProc Working dir:" << projdir << endl;
+ proc.setWorkingDirectory( projdir );
+ proc << qmake;
+ proc << "-d";
+ proc << "-o";
+ proc << makefile.name();
+ proc << qmakefile.name();
+ kdDebug(9024) << "Executing:" << proc.args() << endl;
+ proc.start( KProcess::NotifyOnExit, KProcess::Stderr );
+ if( !proc.isRunning() && !proc.normalExit() )
+ {
+ kdDebug(9024) << "Couldn't execute qmake: " << proc.args() << endl;
+ makefile.unlink();
+ qmakefile.unlink();
+ m_variables.clear();
+ m_keys.clear();
+ }else
+ {
+ makefile.unlink();
+ qmakefile.unlink();
+ QStringList lines = QStringList::split( "\n", proc.stdErr() );
+ kdDebug(9024) << "Got " << lines.count() << " lines" << endl;
+ for ( QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it)
+ {
+ QString line = *it;
+ QRegExp re( "DEBUG 1: ([^ =:]+) === (.*)" );
+ if ( re.exactMatch( line ) )
+ {
+ QString var = re.cap( 1 );
+ QStringList values = QStringList::split( " :: ", re.cap( 2 ) );
+ m_variables[var] = values;
+ m_keys.append( var );
+ }
+ }
+ }
+ }
+}
+
+QMakeDefaultOpts::~QMakeDefaultOpts()
+{
+}
+
+const QStringList QMakeDefaultOpts::variableValues( const QString& var ) const
+{
+// QStringList result;
+ if ( m_variables.contains(var) )
+ return m_variables[var];
+ return QStringList();
+}
+
+const QStringList& QMakeDefaultOpts::variables() const
+{
+ return m_keys;
+}
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/qmakedefaultopts.h b/buildtools/qmake/qmakedefaultopts.h
new file mode 100644
index 00000000..63bab54b
--- /dev/null
+++ b/buildtools/qmake/qmakedefaultopts.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 QMAKEDEFAULTOPTS_H
+#define QMAKEDEFAULTOPTS_H
+
+#include <qmap.h>
+#include <qstringlist.h>
+// #include <qobject.h>
+
+// class KTempFile;
+// class BlockingKProcess;
+
+class QMakeDefaultOpts
+{
+public:
+ QMakeDefaultOpts( );
+
+ ~QMakeDefaultOpts();
+
+ void readVariables( const QString& qtdir, const QString& projdir );
+
+ const QStringList variableValues( const QString& ) const;
+ const QStringList& variables() const;
+
+// signals:
+// void variablesRead();
+
+// private slots:
+// void slotReadStderr( KProcess*, char*, int );
+// void slotFinished( KProcess* );
+
+private:
+ QMap<QString, QStringList> m_variables;
+ QStringList m_keys;
+};
+
+#endif
+
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/qmakeoptionswidget.cpp b/buildtools/qmake/qmakeoptionswidget.cpp
new file mode 100644
index 00000000..89f63c1e
--- /dev/null
+++ b/buildtools/qmake/qmakeoptionswidget.cpp
@@ -0,0 +1,63 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "qmakeoptionswidget.h"
+
+#include <qcheckbox.h>
+#include <kcombobox.h>
+#include <qbuttongroup.h>
+#include <kurlrequester.h>
+
+#include <domutil.h>
+#include <kdebug.h>
+
+QMakeOptionsWidget::QMakeOptionsWidget( const QString& projectdir, QDomDocument &dom, const QString &configGroup,
+ QWidget *parent, const char *name )
+ : QMakeOptionsWidgetBase( parent, name ),
+ m_dom( dom ), m_configGroup( configGroup ), m_projectDir( projectdir )
+{
+ groupBehaviour->setButton( DomUtil::readIntEntry( dom, configGroup+"/qmake/savebehaviour", 2) );
+ checkReplacePaths->setChecked( DomUtil::readBoolEntry( dom, configGroup+"/qmake/replacePaths", false ) );
+ checkDisableDefaultOpts->setChecked( DomUtil::readBoolEntry( dom, configGroup+"/qmake/disableDefaultOpts", true ) );
+ checkFilenamesOnly->setChecked( DomUtil::readBoolEntry( dom, configGroup+"/qmake/enableFilenamesOnly", false ) );
+ showVariablesInTree->setChecked( DomUtil::readBoolEntry( dom, configGroup+"/qmake/showVariablesInTree", true ) );
+ checkShowParseErrors->setChecked( DomUtil::readBoolEntry( dom,
+ configGroup+"/qmake/showParseErrors", true ) );
+ qmakeProjectFile->setURL( DomUtil::readEntry( dom, configGroup+"/qmake/projectfile", "" ) );
+ qmakeProjectFile->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ qmakeProjectFile->setFilter( "*.pro *.pri" );
+ if( qmakeProjectFile->url().isEmpty() )
+ {
+ qmakeProjectFile->setURL( projectdir );
+ }
+}
+
+
+QMakeOptionsWidget::~QMakeOptionsWidget()
+{}
+
+
+void QMakeOptionsWidget::accept()
+{
+ DomUtil::writeIntEntry( m_dom, m_configGroup + "/qmake/savebehaviour", groupBehaviour->selectedId() );
+ DomUtil::writeBoolEntry( m_dom, m_configGroup + "/qmake/replacePaths", checkReplacePaths->isChecked() );
+ DomUtil::writeBoolEntry( m_dom, m_configGroup + "/qmake/disableDefaultOpts", checkDisableDefaultOpts->isChecked() );
+ DomUtil::writeBoolEntry( m_dom, m_configGroup + "/qmake/enableFilenamesOnly", checkFilenamesOnly->isChecked() );
+ DomUtil::writeBoolEntry( m_dom, m_configGroup + "/qmake/showVariablesInTree", showVariablesInTree->isChecked() );
+ DomUtil::writeBoolEntry( m_dom, m_configGroup + "/qmake/showParseErrors", checkShowParseErrors->isChecked() );
+ QString projfile = qmakeProjectFile->url();
+ if( projfile != m_projectDir && QFileInfo( projfile ).isFile() && ( projfile.endsWith( ".pro" ) || projfile.endsWith( ".pri" ) ) )
+ DomUtil::writeEntry( m_dom, m_configGroup + "/qmake/projectfile", projfile );
+}
+
+#include "qmakeoptionswidget.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/qmakeoptionswidget.h b/buildtools/qmake/qmakeoptionswidget.h
new file mode 100644
index 00000000..c50e4b44
--- /dev/null
+++ b/buildtools/qmake/qmakeoptionswidget.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 QMAKEOPTIONSWIDGET_H
+#define QMAKEOPTIONSWIDGET_H
+
+#include "qmakeoptionswidgetbase.h"
+
+#include <qdom.h>
+
+class QMakeOptionsWidget : public QMakeOptionsWidgetBase
+{
+ Q_OBJECT
+public:
+ QMakeOptionsWidget( const QString& projectdir, QDomDocument &dom, const QString &configGroup,
+ QWidget *parent = 0, const char *name = 0 );
+ ~QMakeOptionsWidget();
+
+public slots:
+ void accept();
+private:
+ QDomDocument &m_dom;
+ QString m_configGroup;
+ QString m_projectDir;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
+
diff --git a/buildtools/qmake/qmakeoptionswidgetbase.ui b/buildtools/qmake/qmakeoptionswidgetbase.ui
new file mode 100644
index 00000000..0ad833d1
--- /dev/null
+++ b/buildtools/qmake/qmakeoptionswidgetbase.ui
@@ -0,0 +1,217 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>QMakeOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>QMakeOptionsWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>738</width>
+ <height>523</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>QMake Manager Options</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>- Also look into C++/Qt to define the QMake, Qt and Designer paths.
+- Environment variables that should be resolved during parsing can be set on the Make Options page.
+- For changes on this page to take effect the project needs to be reloaded.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>QMake Project File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>qmakeProjectFile</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>qmakeProjectFile</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This is the top level qmake project file, from which the project manager will be populated.
+Leave this empty to automatically search for a .pro file in the project directory.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>groupBehaviour</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="title">
+ <string>Behaviour on Subproject Change</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>The following settings determine what the project configuration dialog should do when another subproject is selected while the dialog is still open.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioAlwaysSave</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Always Save</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Always save the configuration when changing the project.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Always save the project configuration when selecting a another sub project.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioNeverSave</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Never Save (Warning: This can lead to loss of setting changes)</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Never save the configuration when changing the project.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Never save the project configuration when selecting a another sub project.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioAsk</cstring>
+ </property>
+ <property name="text">
+ <string>As&amp;k</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Ask whether the configuration should be saved when switching the project.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Always ask whether the configuration should be saved when selecting another subproject.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkReplacePaths</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Repla&amp;ce File Paths with matching Variables when adding files</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This replaces the relative paths of added files with existing custom variables if the value assigned to it is the same as the path.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showVariablesInTree</cstring>
+ </property>
+ <property name="text">
+ <string>Show variables in filenames in the QMake projectmanager view.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkFilenamesOnly</cstring>
+ </property>
+ <property name="text">
+ <string>Display only filenames in the QMake Manager (Project reload is needed after changing this setting)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkDisableDefaultOpts</cstring>
+ </property>
+ <property name="text">
+ <string>Do not use the QMake Default Options
+This disables the reading of any .qmake.cache files or mkspecs.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkShowParseErrors</cstring>
+ </property>
+ <property name="text">
+ <string>Show parse error in message box</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/buildtools/qmake/qmakescopeitem.cpp b/buildtools/qmake/qmakescopeitem.cpp
new file mode 100644
index 00000000..66fa3c3f
--- /dev/null
+++ b/buildtools/qmake/qmakescopeitem.cpp
@@ -0,0 +1,928 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.de *
+* *
+* Part of this file is taken from Qt Designer. *
+* *
+* 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 "qmakescopeitem.h"
+
+#include <qdir.h>
+#include <qregexp.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kdirwatch.h>
+
+#include "scope.h"
+#include "urlutil.h"
+#include "trollprojectwidget.h"
+/*
+ * Class qProjectItem
+ */
+
+qProjectItem::qProjectItem( Type type, QListView *parent, const QString &text )
+ : QListViewItem( parent, text ), typ( type )
+{}
+
+
+qProjectItem::qProjectItem( Type type, qProjectItem *parent, const QString &text )
+ : QListViewItem( parent, text ), typ( type )
+{}
+
+
+
+/*
+ * Class GroupItem
+ */
+
+GroupItem::GroupItem( QListView *lv, GroupType type, const QString &text, QMakeScopeItem* spitem )
+ : qProjectItem( Group, lv, text )
+{
+ this->owner = spitem;
+ groupType = type;
+// files.setAutoDelete( true );
+ setPixmap( 0, SmallIcon( "tar" ) );
+}
+
+GroupItem::GroupType GroupItem::groupTypeForExtension( const QString &ext )
+{
+ if ( ext == "cpp" || ext == "cc" || ext == "c" || ext == "C" || ext == "c++" || ext == "cxx" || ext == "ocl" )
+ return Sources;
+ else if ( ext == "hpp" || ext == "h" || ext == "hxx" || ext == "hh" || ext == "h++" || ext == "H" )
+ return Headers;
+ else if ( ext == "ui" )
+ return Forms;
+ else if ( ext == "jpg" || ext == "jpeg" || ext == "png" || ext == "xpm" || ext == "gif" || ext == "bmp" )
+ return Images;
+ else if ( ext == "idl" )
+ return IDLs;
+ else if ( ext == "l" || ext == "ll" || ext == "lxx" || ext == "l++" )
+ return Lexsources;
+ else if ( ext == "y" || ext == "yy" || ext == "yxx" || ext == "y++" )
+ return Yaccsources;
+ else if ( ext == "ts" )
+ return Translations;
+ else if ( ext == "qrc" )
+ return Resources;
+ else
+ return Distfiles;
+}
+
+void GroupItem::groupTypeMeanings( GroupItem::GroupType type, QString& title, QString& ext )
+{
+ switch ( type )
+ {
+ case GroupItem::Sources:
+ title = i18n( "Sources" );
+ ext = "*.cpp *.c";
+ break;
+ case GroupItem::Headers:
+ title = i18n( "Headers" );
+ ext = "*.h *.hpp";
+ break;
+ case GroupItem::Forms:
+ title = i18n( "Forms" );
+ ext = "*.ui";
+ break;
+ case GroupItem::IDLs:
+ title = i18n( "Corba IDLs" );
+ ext = "*.idl *.kidl";
+ break;
+ case GroupItem::Lexsources:
+ title = i18n( "Lexsources" );
+ ext = "*.l *.ll *.lxx *.l++";
+ break;
+ case GroupItem::Yaccsources:
+ title = i18n( "Yaccsources" );
+ ext = "*.y *.yy *.yxx *.y++";
+ break;
+ case GroupItem::Images:
+ title = i18n( "Images" );
+ ext = "*.jpg *.jpeg *.png *.xpm *.gif *.bmp";
+ break;
+ case GroupItem::Resources:
+ title = i18n( "Resources" );
+ ext = "*.qrc";
+ break;
+ case GroupItem::Distfiles:
+ title = i18n( "Distfiles" );
+ ext = "*";
+ break;
+ case GroupItem::Translations:
+ title = i18n( "Translations" );
+ ext = "*.ts";
+ break;
+ case GroupItem::InstallRoot:
+ title = i18n( "Installs" );
+ ext = "*";
+ break;
+ case GroupItem::InstallObject:
+ title = i18n( "Install object" );
+ ext = "*";
+ break;
+
+ default: // just give back source files, et all
+ title = i18n( "Source Files" );
+ ext = "*.cpp *.cc *.ocl *.c *.hpp *.h *.ui";
+ }
+}
+
+void GroupItem::paintCell( QPainter* p, const QColorGroup& c, int column, int width, int align )
+{
+ QColorGroup cg( c );
+ if ( !firstChild() )
+ {
+ cg.setColor( QColorGroup::Text, cg.mid() );
+ }
+
+ qProjectItem::paintCell( p, cg, column, width, align );
+}
+
+void GroupItem::addFileToScope( const QString& filename )
+{
+ QString file = filename;
+
+ QPtrListIterator<FileItem> it( files );
+ while ( it.current() != 0 )
+ {
+ if ( it.current() ->text( 0 ) == file ) //File already exists in this subproject
+ return ;
+ ++it;
+ }
+
+ FileItem *fitem = owner->createFileItem( file );
+
+ fitem->uiFileLink = owner->m_widget->getUiFileLink( owner->relativePath() + QString( QChar( QDir::separator() ) ), owner->scope->resolveVariables( filename ) );
+ files.append( fitem );
+ switch ( groupType )
+ {
+ case GroupItem::Sources:
+ owner->addValue( "SOURCES", file );
+ break;
+ case GroupItem::Headers:
+ owner->addValue( "HEADERS", file );
+ break;
+ case GroupItem::Forms:
+ if( owner->m_widget->isTMakeProject() )
+ owner->addValue( "INTERFACES", file );
+ else
+ owner->addValue( "FORMS", file );
+ break;
+ case GroupItem::IDLs:
+ owner->addValue( "IDLS", file );
+ break;
+ case GroupItem::Lexsources:
+ owner->addValue( "LEXSOURCES", file );
+ break;
+ case GroupItem::Yaccsources:
+ owner->addValue( "YACCSOURCES", file );
+ break;
+ case GroupItem::Images:
+ owner->addValue( "IMAGES", file );
+ break;
+ case GroupItem::Resources:
+ owner->addValue( "RESOURCES", file );
+ break;
+ case GroupItem::Distfiles:
+ owner->addValue( "DISTFILES", file );
+ break;
+ case GroupItem::Translations:
+ owner->addValue( "TRANSLATIONS", file );
+ break;
+ case GroupItem::InstallObject:
+ owner->addValue( text( 0 ) + ".files", file );
+ break;
+ default:
+ break;
+ }
+ owner->scope->saveToFile();
+}
+
+void GroupItem::removeFileFromScope( const QString& filename )
+{
+ QString filePath;
+
+ QPtrListIterator<FileItem> it( files );
+ while ( it.current() != 0 )
+ {
+ if ( it.current() ->text( 0 ) == filename ) //File already exists in this subproject
+ {
+ FileItem * fitem = it.current();
+ filePath = fitem->localFilePath;
+ files.remove( it );
+ delete fitem;
+ break;
+ }
+ ++it;
+ }
+
+ if ( groupType == GroupItem::Sources )
+ {
+ owner->removeValue( "SOURCES", filePath );
+ }
+ else if ( groupType == GroupItem::Headers )
+ {
+ owner->removeValue( "HEADERS", filePath );
+ }
+ else if ( groupType == GroupItem::Forms )
+ {
+ owner->removeValue( "FORMS", filePath );
+ }
+ else if ( groupType == GroupItem::Images )
+ {
+ owner->removeValue( "IMAGES", filePath );
+ }
+ else if ( groupType == GroupItem::Resources )
+ {
+ owner->removeValue( "RESOURCES", filePath );
+ }
+ else if ( groupType == GroupItem::Lexsources )
+ {
+ owner->removeValue( "LEXSOURCES", filePath );
+ }
+ else if ( groupType == GroupItem::Yaccsources )
+ {
+ owner->removeValue( "YACCSOURCES", filePath );
+ }
+ else if ( groupType == GroupItem::Translations )
+ {
+ owner->removeValue( "TRANSLATIONS", filePath );
+ }
+ else if ( groupType == GroupItem::IDLs )
+ {
+ owner->removeValue( "IDL", filePath );
+ }
+ else if ( groupType == GroupItem::Distfiles )
+ {
+ owner->removeValue( "DISTFILES", filePath );
+ }
+ else if ( groupType == GroupItem::InstallObject )
+ {
+ owner->removeValue( text( 0 ) + ".files", filePath );
+ }
+ owner->scope->saveToFile();
+}
+
+void GroupItem::addInstallObject( const QString& objectname )
+{
+ GroupItem * objitem = owner->createGroupItem( GroupItem::InstallObject, objectname, owner );
+ owner->addValue( "INSTALLS", objectname );
+ owner->scope->saveToFile();
+ installs.append( objitem );
+}
+
+void GroupItem::removeInstallObject( GroupItem* item )
+{
+ owner->removeValue( "INSTALLS", item->text(0) );
+ owner->scope->saveToFile();
+ installs.remove( item );
+ delete item;
+}
+
+/*
+ * Class FileItem
+ */
+
+FileItem::FileItem( QListView *lv, const QString &text )
+ : qProjectItem( File, lv, text ), uiFileLink( "" )
+{
+ // if excluded is set the file is excluded in the subproject/project.
+ // by default excluded is set to false, thus file is included
+ // excluded = exclude;
+ setPixmap( 0, SmallIcon( "document" ) );
+}
+
+
+/*
+ * Class QMakeScopeItem
+ */
+
+QMakeScopeItem::QMakeScopeItem( QListView *parent, const QString &text, Scope* s, TrollProjectWidget* widget )
+ : qProjectItem( Subproject, parent, text ), scope( s ), m_widget( widget )
+{
+ // configuration.m_template = QTMP_APPLICATION;
+ init();
+}
+
+
+QMakeScopeItem::QMakeScopeItem( QMakeScopeItem *parent, const QString &text, Scope* s )
+ : qProjectItem( Subproject, parent, text ), scope( s ), m_widget( parent->m_widget )
+{
+ init();
+}
+
+QMakeScopeItem::~QMakeScopeItem()
+{
+ QMap<GroupItem::GroupType, GroupItem*>::iterator it;
+ for ( it = groups.begin() ; it != groups.end() ; ++it )
+ {
+ GroupItem* s = it.data();
+ delete s;
+ }
+ groups.clear();
+
+}
+
+QString QMakeScopeItem::relativePath()
+{
+ if( !scope || !scope->parent() )
+ return "";
+ if( scope->scopeType() == Scope::ProjectScope )
+ {
+ if( scope->parent() && scope->parent()->variableValues("SUBDIRS").contains( URLUtil::relativePathToFile( scope->parent()->projectDir(), scope->projectDir()+"/"+scope->fileName() ) ) )
+ {
+ return URLUtil::relativePathToFile( scope->parent()->projectDir(), scope->projectDir()+"/"+scope->fileName() );
+ }else
+ {
+ return URLUtil::getRelativePath( m_widget->projectDirectory(), scope->projectDir() );
+ }
+ }else
+ return static_cast<QMakeScopeItem*>( parent() ) ->relativePath();
+// if( !scope->parent() )
+// return "";
+// else if ( !scope->parent()->parent() || scope->scopeType() != Scope::ProjectScope )
+// return scope->scopeName();
+// else if ( scope->scopeType() == Scope::ProjectScope )
+// return ( static_cast<QMakeScopeItem*>( parent() ) ->relativePath()
+// + QString( QChar( QDir::separator() ) ) + scope->scopeName() );
+// else
+// return ( static_cast<QMakeScopeItem*>( parent() ) ->relativePath() );
+}
+
+QString QMakeScopeItem::getSharedLibAddObject( QString basePath )
+{
+ if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ {
+ QString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() );
+ if ( !scope->variableValues( "DESTDIR" ).front().isEmpty() )
+ {
+ if ( QDir::isRelativePath( scope->variableValues( "DESTDIR" ).front() ) )
+ tmpPath += QString( QChar( QDir::separator() ) ) + scope->variableValues( "DESTDIR" ).front();
+ else
+ tmpPath = scope->variableValues( "DESTDIR" ).front();
+ }
+ else
+ {
+ tmpPath += QString( QChar( QDir::separator() ) );
+ }
+
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ QString libString;
+ if ( !scope->variableValues( "TARGET" ).front().isEmpty() )
+ {
+ libString = tmpPath + QString( QChar( QDir::separator() ) ) + "lib" + scope->variableValues( "TARGET" ).front() + ".so";
+
+ }
+ else
+ {
+ libString = tmpPath + QString( QChar( QDir::separator() ) ) + "lib" + scope->projectName() + ".so";
+
+ }
+ return ( libString );
+ }
+ return "";
+}
+
+QString QMakeScopeItem::getApplicationObject( QString basePath )
+{
+ QString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() );
+ QString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() );
+
+ if ( !destdir.isEmpty() )
+ {
+ if ( QDir::isRelativePath( destdir ) )
+ tmpPath += QString( QChar( QDir::separator() ) ) + destdir;
+ else
+ tmpPath = destdir;
+ }
+ else
+ {
+ tmpPath += QString( QChar( QDir::separator() ) );
+ }
+
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ QString target = scope->resolveVariables( scope->variableValues( "TARGET" ).front() );
+
+ if ( target.isEmpty() )
+ return tmpPath + QString( QChar( QDir::separator() ) ) + scope->projectName();
+ else
+ return tmpPath + QString( QChar( QDir::separator() ) ) + target;
+}
+
+QString QMakeScopeItem::getLibAddObject( QString basePath )
+{
+ if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 )
+ {
+ QString target = scope->resolveVariables( scope->variableValues( "TARGET" ).front() );
+ if ( !target.isEmpty() )
+ {
+ return ( "-l" + target );
+ }
+ else
+ {
+ return ( "-l" + scope->projectName() );
+ }
+ }
+ else if ( scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1
+ || scope->variableValues("TEMPLATE").findIndex("lib") != -1 )
+ {
+ QString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() );
+ QString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() );
+ if ( !destdir.isEmpty() )
+ {
+ if ( QDir::isRelativePath( destdir ) )
+ tmpPath += QString( QChar( QDir::separator() ) ) + destdir;
+ else
+ tmpPath = destdir;
+ }
+ else
+ {
+ tmpPath += QString( QChar( QDir::separator() ) );
+ }
+
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ QString libString;
+ QString target = scope->resolveVariables( scope->variableValues( "TARGET" ).front() );
+ if ( !target.isEmpty() )
+ {
+ libString = tmpPath + QString( QChar( QDir::separator() ) ) + "lib" + target + ".a";
+
+ }
+ else
+ {
+ libString = tmpPath + QString( QChar( QDir::separator() ) ) + "lib" + scope->projectName() + ".a";
+
+ }
+ return ( libString );
+ }
+
+ return ( "" );
+}
+QString QMakeScopeItem::getLibAddPath( QString basePath )
+{
+
+ //PATH only add if shared lib
+ if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) == -1 ) return ( "" );
+
+ QString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() );
+ QString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() );
+ if ( !destdir.isEmpty() )
+ {
+ if ( QDir::isRelativePath( destdir ) )
+ tmpPath += QString( QChar( QDir::separator() ) ) + destdir;
+ else
+ tmpPath = destdir;
+ }
+ else
+ {
+ tmpPath += QString( QChar( QDir::separator() ) );
+ }
+
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ return ( tmpPath );
+
+}
+
+QString QMakeScopeItem::getIncAddPath( QString basePath )
+{
+ QString tmpPath = URLUtil::getRelativePath( basePath, scope->projectDir() );
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ return ( tmpPath );
+}
+
+void QMakeScopeItem::buildSubTree()
+{
+ QValueList<Scope*>::const_iterator it;
+
+ sortChildItems( 0, false );
+
+ QValueList<Scope*> scopes = scope->scopesInOrder();
+
+ for ( it = scopes.begin(); it != scopes.end(); ++it )
+ {
+ if( (*it)->scopeType() != Scope::InvalidScope )
+ new QMakeScopeItem( this, ( *it )->scopeName(), ( *it ) );
+ else
+ kdDebug( 9024 ) << "No QMakeScopeItem created" << endl;
+ }
+}
+
+
+void QMakeScopeItem::init()
+{
+ if ( scope->scopeType() == Scope::SimpleScope )
+ {
+ setPixmap( 0, SmallIcon( "qmake_scope" ) );
+ }
+ else if ( scope->scopeType() == Scope::FunctionScope )
+ {
+ setPixmap( 0, SmallIcon( "qmake_func_scope" ) );
+ }
+ else if ( scope->scopeType() == Scope::IncludeScope )
+ {
+ setPixmap( 0, SmallIcon( "qmake_inc_scope" ) );
+ }
+ else
+ {
+ QStringList tmp = scope->variableValues( "TEMPLATE" );
+ if( scope->isEnabled() )
+ {
+ if ( tmp.findIndex( "subdirs" ) != -1 )
+ setPixmap( 0, SmallIcon( "folder" ) );
+ else if ( tmp.findIndex( "lib" ) != -1 )
+ setPixmap( 0, SmallIcon( "qmake_lib" ) );
+ else
+ setPixmap( 0, SmallIcon( "qmake_app" ) );
+ }else
+ {
+ if ( tmp.findIndex( "subdirs" ) != -1 )
+ setPixmap( 0, SmallIcon( "folder_grey" ) );
+ else if ( tmp.findIndex( "lib" ) != -1 )
+ setPixmap( 0, SmallIcon( "qmake_lib_disabled" ) );
+ else
+ setPixmap( 0, SmallIcon( "qmake_app_disabled" ) );
+ }
+ }
+
+ setEnabled( scope->isEnabled() );
+ if( scope->isEnabled() )
+ {
+ buildGroups();
+ buildSubTree();
+ }
+}
+
+GroupItem* QMakeScopeItem::createGroupItem( GroupItem::GroupType type, const QString& label, QMakeScopeItem* scopeitem )
+{
+ GroupItem * item = new GroupItem( scopeitem->listView(), type, label, scopeitem );
+ scopeitem->listView() ->takeItem( item );
+ return item;
+}
+
+FileItem* QMakeScopeItem::createFileItem( const QString& name )
+{
+ QString display = name;
+ if( m_widget->showFilenamesOnly() )
+ {
+ int dirSepPos = name.findRev( QChar( QDir::separator() ) );
+ if ( dirSepPos != - 1 )
+ display = name.mid( dirSepPos + 1 );
+ }
+ if( !m_widget->showVariablesInTree() )
+ {
+ display = scope->resolveVariables( display );
+ }
+ FileItem * fitem = new FileItem( listView(), display );
+ listView() ->takeItem( fitem );
+
+ fitem->localFilePath = name;
+
+ return fitem;
+}
+
+void QMakeScopeItem::buildGroups()
+{
+ if( scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ return;
+ QStringList values;
+
+ GroupItem* item;
+ QStringList::iterator it;
+
+ values = scope->variableValues( "INSTALLS" );
+ item = createGroupItem( GroupItem::InstallRoot, "INSTALLS", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ if ( ( *it ) == "target" )
+ continue;
+
+ QString path = scope->variableValues( *it + ".path" ).front();
+ GroupItem* installitem = createGroupItem( GroupItem::InstallObject, *it, this );
+ item->installs.append( installitem );
+ QStringList files = scope -> variableValues( *it + ".files" );
+ if ( !files.isEmpty() )
+ {
+ QStringList::iterator filesit = files.begin();
+ for ( ;filesit != files.end(); ++filesit )
+ {
+ installitem->files.append( createFileItem( *filesit ) );
+ }
+ }
+ }
+
+ values = scope->variableValues( "LEXSOURCES" );
+ item = createGroupItem( GroupItem::Lexsources, "LEXSOURCES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ values = scope->variableValues( "YACCSOURCES" );
+ item = createGroupItem( GroupItem::Yaccsources, "YACCSOURCES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ values = scope->variableValues( "DISTFILES" );
+ item = createGroupItem( GroupItem::Distfiles, "DISTFILES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ if ( scope->isQt4Project() )
+ {
+ values = scope->variableValues( "RESOURCES" );
+ item = createGroupItem( GroupItem::Resources, "RESOURCES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+ }
+ values = scope->variableValues( "IMAGES" );
+ item = createGroupItem( GroupItem::Images, "IMAGES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ values = scope->variableValues( "TRANSLATIONS" );
+ item = createGroupItem( GroupItem::Translations, "TRANSLATIONS", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ values = scope->variableValues( "IDLS" );
+ item = createGroupItem( GroupItem::IDLs, "Corba IDL", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ if ( m_widget->isTMakeProject() )
+ {
+ values = scope->variableValues( "INTERFACES" );
+ item = createGroupItem( GroupItem::Forms, "INTERFACES", this );
+ }
+ else
+ {
+ values = scope->variableValues( "FORMS" );
+ item = createGroupItem( GroupItem::Forms, "FORMS", this );
+ }
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ item->files.append( createFileItem( *it ) );
+ }
+
+ values = scope->variableValues( "SOURCES" );
+ item = createGroupItem( GroupItem::Sources, "SOURCES", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ FileItem* fitem = createFileItem( *it );
+ fitem->uiFileLink = m_widget->getUiFileLink( relativePath() + QString( QChar( QDir::separator() ) ), scope->resolveVariables( *it ) );
+ item->files.append( fitem );
+ }
+
+ values = scope->variableValues( "HEADERS" );
+ item = createGroupItem( GroupItem::Headers, "HEADERS", this );
+ groups.insert( item->groupType, item );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ FileItem* fitem = createFileItem( *it );
+ fitem->uiFileLink = m_widget->getUiFileLink( relativePath() + QString( QChar( QDir::separator() ) ), scope->resolveVariables( *it ) );
+ item->files.append( fitem );
+ }
+
+}
+
+void QMakeScopeItem::removeValues( const QString& var, const QStringList& values )
+{
+ for( QStringList::const_iterator it = values.begin() ; it != values.end(); ++it )
+ {
+ removeValue( var, *it );
+ }
+}
+
+void QMakeScopeItem::addValues( const QString& var, const QStringList& values )
+{
+ for( QStringList::const_iterator it = values.begin() ; it != values.end(); ++it )
+ {
+ addValue( var, *it );
+ }
+}
+
+void QMakeScopeItem::removeValue( const QString& var, const QString& value )
+{
+ if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).findIndex( value ) != -1 )
+ {
+ if( scope->variableValuesForOp( var, "+=" ).findIndex(value) != -1 )
+ {
+ scope->removeFromPlusOp( var, QStringList( value ) );
+ if( scope->variableValues( var ).findIndex( value ) != -1 )
+ {
+ scope->addToMinusOp( var, QStringList( value ) );
+ }
+ }else
+ scope->addToMinusOp( var, QStringList( value ) );
+ }else if( scope->scopeType() == Scope::IncludeScope )
+ {
+ scope->addToMinusOp( var, QStringList( value ) );
+ }
+}
+
+void QMakeScopeItem::addValue( const QString& var, const QString& value )
+{
+ if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).findIndex( value ) == -1 )
+ {
+ if( scope->variableValuesForOp( var, "-=" ).findIndex(value) != -1 )
+ scope->removeFromMinusOp( var, QStringList( value ) );
+ else
+ scope->addToPlusOp( var, QStringList( value ) );
+ }else if( scope->scopeType() == Scope::IncludeScope )
+ {
+ scope->addToPlusOp( var, QStringList( value ) );
+ }
+}
+
+void QMakeScopeItem::updateValues( const QString& var, const QStringList& values )
+{
+ QStringList curValues = scope->variableValues( var, (scope->scopeType() != Scope::IncludeScope) );
+ QStringList scopeValues = scope->variableValuesForOp( var, "+=" );
+ for( QStringList::const_iterator it = curValues.begin(); it != curValues.end(); ++it )
+ {
+ if ( values.findIndex( *it ) == -1 )
+ {
+ if( scopeValues.findIndex( *it ) != -1 )
+ {
+ scope->removeFromPlusOp( var, QStringList( *it ) );
+ scopeValues.remove( *it );
+ }else
+ scope->addToMinusOp( var, QStringList( *it ) );
+ }
+ }
+ for( QStringList::const_iterator it = values.begin(); it != values.end(); ++it )
+ {
+ if ( scopeValues.findIndex( *it ) != -1 )
+ {
+ scopeValues.remove(*it);
+ }
+ }
+// kdDebug(9024) << "--------------" << var << "------------------" << endl;
+// kdDebug(9024) << "values: " << values << "| scope:" << scopeValues << endl;
+ scopeValues += values;
+// kdDebug(9024) << "values: " << values << "| scope:" << scopeValues << endl;
+ scope->setPlusOp( var, scopeValues );
+// QStringList tmp = scope->variableValuesForOp( var, "+=" );
+// kdDebug(9024) << "result:" << tmp << endl;
+// kdDebug(9024) << "---------------------------------------" << endl;
+}
+
+QMakeScopeItem* QMakeScopeItem::projectFileItem()
+{
+ if( scope->scopeType() != Scope::ProjectScope )
+ {
+ QMakeScopeItem* parentitem = dynamic_cast<QMakeScopeItem*>(parent());
+ if( parentitem )
+ return parentitem->projectFileItem();
+ }
+ return this;
+}
+
+void QMakeScopeItem::reloadProject()
+{
+ kdDebug(9024) << "Reloading Project" << endl;
+ QListViewItem* item = firstChild();
+ while( item )
+ {
+ QListViewItem* olditem = item;
+ item = olditem->nextSibling();
+ delete olditem;
+ }
+ QMap<GroupItem::GroupType, GroupItem*>::iterator it;
+ for ( it = groups.begin() ; it != groups.end() ; ++it )
+ {
+ GroupItem* s = it.data();
+ QListView* l = s->listView();
+ if(l)
+ l->removeItem(s);
+ delete s;
+ }
+ groups.clear();
+ scope->reloadProject();
+ init();
+}
+
+void QMakeScopeItem::disableSubprojects( const QStringList& dirs )
+{
+ QStringList::const_iterator it = dirs.begin();
+ for( ; it != dirs.end() ; ++it)
+ {
+ if( scope->variableValues("SUBDIRS").findIndex(*it) != -1 )
+ {
+ Scope* s = scope->disableSubproject(*it);
+ if( !s )
+ return;
+ else
+ {
+ QMakeScopeItem* newitem = new QMakeScopeItem( this, s->scopeName(), s );
+ QListViewItem* lastitem = firstChild();
+ while( lastitem && lastitem->nextSibling() )
+ lastitem = lastitem->nextSibling();
+ if( lastitem )
+ newitem->moveItem(lastitem);
+ }
+ }
+ }
+
+}
+
+int QMakeScopeItem::compare( QListViewItem* i, int , bool ) const
+{
+ QMakeScopeItem* other = dynamic_cast<QMakeScopeItem*>(i);
+ if( !i )
+ return -1;
+ if( other->scope->getNum() < scope->getNum() )
+ return 1;
+ else if ( other->scope->getNum() > scope->getNum() )
+ return -1;
+ else
+ return 0;
+}
+
+QMap<QString, QString> QMakeScopeItem::getLibInfos( QString basePath )
+{
+
+ QMap<QString, QString> result;
+ if ( scope->variableValues( "TARGET" ).front().isEmpty() )
+ result["shared_lib"] = "-l"+scope->projectName();
+ else
+ result["shared_lib"] = "-l"+scope->variableValues( "TARGET" ).front();
+
+ QString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() );
+ if ( !scope->variableValues( "DESTDIR" ).front().isEmpty() )
+ {
+ if ( QDir::isRelativePath( scope->variableValues( "DESTDIR" ).front() ) )
+ tmpPath += QString( QChar( QDir::separator() ) ) + scope->variableValues( "DESTDIR" ).front();
+ else
+ tmpPath = scope->variableValues( "DESTDIR" ).front();
+ }
+ else
+ {
+ tmpPath += QString( QChar( QDir::separator() ) );
+ }
+
+ tmpPath = QDir::cleanDirPath( tmpPath );
+
+ result["shared_libdir"] = "-L"+tmpPath;
+
+ if ( scope->variableValues( "TARGET" ).front().isEmpty() )
+ result["shared_depend"] = tmpPath+QString(QChar(QDir::separator()))+"lib"+scope->projectName()+".so";
+ else
+ result["shared_depend"] = tmpPath+QString(QChar(QDir::separator()))+"lib"+scope->variableValues( "TARGET" ).front()+".so";
+
+
+ if ( scope->variableValues( "TARGET" ).front().isEmpty() )
+ result["static_lib"] = tmpPath+QString(QChar(QDir::separator()))+"lib"+scope->projectName()+".a";
+ else
+ result["static_lib"] = tmpPath+QString(QChar(QDir::separator()))+"lib"+scope->variableValues( "TARGET" ).front()+".a";
+
+ result["static_depend"] = result["static_lib"];
+
+ if ( scope->variableValues( "TARGET" ).front().isEmpty() )
+ result["app_depend"] = tmpPath + QString( QChar( QDir::separator() ) ) + scope->projectName();
+ else
+ result["app_depend"] = tmpPath + QString( QChar( QDir::separator() ) ) + scope->variableValues( "TARGET" ).front();
+
+ QString map;
+ for( QMap<QString, QString>::const_iterator it = result.begin(); it != result.end(); ++it )
+ map += "["+it.key() + "=>" +it.data() + "],";
+ kdDebug(9024) << "Running getLibInfo for" << scope->projectName() << "|" << map << endl;
+ return result;
+}
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/qmakescopeitem.h b/buildtools/qmake/qmakescopeitem.h
new file mode 100644
index 00000000..b2c84345
--- /dev/null
+++ b/buildtools/qmake/qmakescopeitem.h
@@ -0,0 +1,128 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 _QMAKESCOPEITEM_H_
+#define _QMAKESCOPEITEM_H_
+
+#include <qlistview.h>
+#include <qstring.h>
+
+class Scope;
+class QMakeScopeItem;
+class FileItem;
+class TrollProjectWidget;
+
+/**
+ * Base class for all items appearing in ProjectOverview and ProjectDetails.
+ */
+class qProjectItem : public QListViewItem
+{
+public:
+ enum Type { Subproject, Group, File };
+
+ qProjectItem( Type type, QListView *parent, const QString &text );
+ qProjectItem( Type type, qProjectItem *parent, const QString &text );
+
+ QString scopeString;
+ Type type()
+ { return typ; }
+
+private:
+ Type typ;
+ void init();
+
+};
+
+
+class GroupItem : public qProjectItem
+{
+public:
+ enum GroupType {NoType, Sources, Headers, Forms, Distfiles, Images, Resources, Lexsources, Yaccsources, Translations, IDLs, InstallRoot, InstallObject, MaxTypeEnum };
+
+ static GroupType groupTypeForExtension( const QString &ext );
+ static void groupTypeMeanings( GroupItem::GroupType type, QString& title, QString& ext );
+
+ GroupItem( QListView *lv, GroupType type, const QString &text, QMakeScopeItem* spitem );
+
+ void removeFileFromScope( const QString& filename);
+ void addFileToScope( const QString& filename);
+ void addInstallObject( const QString& objectname);
+ void removeInstallObject( GroupItem* item );
+
+ // qmake INSTALLS support
+ QPtrList<GroupItem> installs;
+ QPtrList<FileItem> files;
+
+// QStringList str_files;
+// QStringList str_files_exclude;
+ // end qmake INSTALLS support
+ GroupType groupType;
+ QMakeScopeItem* owner;
+
+protected:
+ void paintCell( QPainter* p, const QColorGroup& cg, int column, int width, int align );
+};
+
+
+// Not sure if this complexity is really necessary...
+class FileItem : public qProjectItem
+{
+public:
+ FileItem( QListView *lv, const QString &text );
+
+ QString uiFileLink;
+ QString localFilePath;
+};
+
+/**
+ * Stores one Scope
+ */
+class QMakeScopeItem : public qProjectItem
+{
+public:
+ QMakeScopeItem( QListView *parent, const QString &text, Scope *s, TrollProjectWidget* widget );
+ QMakeScopeItem( QMakeScopeItem *parent, const QString &text, Scope* );
+ void updateValues( const QString& var, const QStringList& values );
+ void addValue( const QString& var, const QString& value );
+ void removeValue( const QString& var, const QString& value );
+ void addValues( const QString& var, const QStringList& values );
+ void removeValues( const QString& var, const QStringList& values );
+ void disableSubprojects( const QStringList& );
+ void reloadProject();
+ int compare( QListViewItem* i, int col, bool ascending ) const;
+ ~QMakeScopeItem();
+
+ QMap<GroupItem::GroupType, GroupItem*> groups;
+
+ Scope* scope;
+ QString relativePath();
+ QString getLibAddPath( QString );
+ QString getLibAddObject( QString );
+ QString getSharedLibAddObject( QString );
+ QString getApplicationObject( QString );
+ QString getIncAddPath( QString downDirs );
+ FileItem* createFileItem(const QString& file);
+ GroupItem* createGroupItem(GroupItem::GroupType type, const QString& name, QMakeScopeItem* scopeitem);
+ QMap<QString, QString> getLibInfos( QString );
+
+ QMakeScopeItem* projectFileItem();
+
+ TrollProjectWidget* m_widget;
+private:
+ void init();
+ void buildSubTree();
+ void buildGroups();
+};
+
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/scope.cpp b/buildtools/qmake/scope.cpp
new file mode 100644
index 00000000..c090861b
--- /dev/null
+++ b/buildtools/qmake/scope.cpp
@@ -0,0 +1,1710 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 "scope.h"
+
+#include <kdebug.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qpair.h>
+#include <qmakedriver.h>
+#include <qregexp.h>
+#include <qtimer.h>
+
+#include <kdirwatch.h>
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <stdlib.h>
+
+#include "urlutil.h"
+#include "trollprojectpart.h"
+#include "qmakedefaultopts.h"
+
+const QStringList Scope::KnownVariables = QStringList() << "QT" << "CONFIG" << "TEMPLATE" << "SUBDIRS" << "VERSION" << "LIBS" << "target.path" << "INSTALLS" << "MAKEFILE" << "TARGETDEPS" << "INCLUDEPATH" << "TARGET" << "DESTDIR" << "DEFINES" << "QMAKE_CXXFLAGS_DEBUG" << "QMAKE_CXXFLAGS_RELEASE" << "OBJECTS_DIR" << "UI_DIR" << "MOC_DIR" << "IDL_COMPILER" << "IDL_OPTIONS" << "RCC_DIR" << "IDLS" << "RESOURCES" << "IMAGES" << "LEXSOURCES" << "DISTFILES" << "YACCSOURCES" << "TRANSLATIONS" << "HEADERS" << "SOURCES" << "INTERFACES" << "FORMS" ;
+
+const QStringList Scope::KnownConfigValues = QStringList() << "debug" << "release" << "debug_and_release" << "warn_on" << "warn_off" << "staticlib" << "dll" << "plugin" << "designer" << "create_pkgconf" << "create_libtool" << "qt" << "console" << "windows" << "x11" << "thread" << "exceptions" << "stl" << "rtti" << "opengl" << "thread" << "ordered" << "precompile_header" << "qtestlib" << "uitools" << "dbus" << "assistant" << "build_all" << "help";
+
+Scope::Scope( const QMap<QString, QString>& env, const QString &filename, TrollProjectPart* part )
+ : m_root( 0 ), m_incast( 0 ), m_parent( 0 ), m_num(0), m_isEnabled( true ), m_part(part), m_defaultopts(0), m_environment( env )
+{
+ if ( !loadFromFile( filename ) )
+ {
+ if( !QFileInfo( filename ).exists() )
+ {
+ m_root = new QMake::ProjectAST();
+ m_root->setFileName( filename );
+ }else
+ {
+ delete m_root;
+ m_root = 0;
+ }
+ }
+ loadDefaultOpts();
+ if( m_root )
+ {
+ m_part->dirWatch()->addFile(filename);
+ }
+ init();
+}
+
+Scope::~Scope()
+{
+ QMap<unsigned int, Scope*>::iterator it;
+ for ( it = m_scopes.begin() ; it != m_scopes.end() ; ++it )
+ {
+ Scope* s = it.data();
+ delete s;
+ }
+ m_scopes.clear();
+
+ m_customVariables.clear();
+ if ( m_root && m_root->isProject() && !m_incast )
+ {
+ delete m_root;
+ m_root = 0;
+ delete m_defaultopts;
+ m_defaultopts = 0;
+ }
+
+}
+
+// Simple/Function Scopes
+Scope::Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, QMake::ProjectAST* scope,
+ QMakeDefaultOpts* defaultopts, TrollProjectPart* part )
+ : m_root( scope ), m_incast( 0 ), m_parent( parent ), m_num(num), m_isEnabled( true ),
+ m_part(part), m_defaultopts(defaultopts), m_environment( env )
+{
+ init();
+}
+
+//Subdirs
+Scope::Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, const QString& filename,
+ TrollProjectPart* part, bool isEnabled )
+ : m_root( 0 ), m_incast( 0 ), m_parent( parent ), m_num(num), m_isEnabled( isEnabled ),
+ m_part(part), m_defaultopts(0), m_environment( env )
+{
+ if ( !loadFromFile( filename ) )
+ {
+ if( !QFileInfo( filename ).exists() && QFileInfo( QFileInfo( filename ).dirPath( true ) ).exists() )
+ {
+ m_root = new QMake::ProjectAST();
+ m_root->setFileName( filename );
+ }else
+ {
+ delete m_root;
+ m_root = 0;
+ m_isEnabled = false;
+ }
+ }
+ loadDefaultOpts();
+ if( m_root )
+ m_part->dirWatch()->addFile(filename);
+ init();
+}
+
+//Include Scope
+Scope::Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, QMake::IncludeAST* incast, const QString& path,
+ const QString& incfile, QMakeDefaultOpts* defaultopts, TrollProjectPart* part )
+ : m_root( 0 ), m_incast( incast ), m_parent( parent ), m_num(num), m_isEnabled( true ),
+ m_part(part), m_defaultopts(defaultopts), m_environment( env )
+{
+ QString absfilename;
+ QString tmp = incfile.stripWhiteSpace();
+ if( tmp.contains(")" ) )
+ tmp = tmp.mid(0, tmp.find(")") );
+
+ if( tmp.startsWith( "\"" ) )
+ tmp = tmp.mid( 1, tmp.length()-2 );
+
+ if( QFileInfo(tmp).isRelative() )
+ {
+ absfilename = QDir::cleanDirPath( path + QString( QChar( QDir::separator() ) ) + tmp );
+ }else
+ absfilename = QDir::cleanDirPath( tmp );
+ if ( !loadFromFile( absfilename ) )
+ {
+ if( !QFileInfo( absfilename ).exists() && QFileInfo( QFileInfo( absfilename ).dirPath( true ) ).exists() )
+ {
+ m_root = new QMake::ProjectAST();
+ m_root->setFileName( absfilename );
+ }else
+ {
+ delete m_root;
+ m_root = 0;
+ m_isEnabled = false;
+ }
+ }
+ if( m_root )
+ m_part->dirWatch()->addFile( m_root->fileName() );
+ init();
+}
+
+bool Scope::loadFromFile( const QString& filename )
+{
+ if ( !QFileInfo(filename).exists() || QMake::Driver::parseFile( filename, &m_root, 0 ) != 0 )
+ {
+ kdDebug( 9024 ) << "Couldn't parse project: " << filename << endl;
+ if( DomUtil::readBoolEntry( *m_part->projectDom(),
+ "/kdevtrollproject/qmake/showParseErrors", true ) )
+ {
+ KMessageBox::error( 0, i18n( "Could not parse project file: %1" ).arg( filename ),
+ i18n( "Could not parse project file" ) );
+ }
+ m_root = 0;
+ return false;
+ }
+// init();
+ return true;
+}
+
+void Scope::saveToFile() const
+{
+ if ( !m_root )
+ return ;
+
+ if ( scopeType() != ProjectScope && scopeType() != IncludeScope )
+ {
+ m_parent->saveToFile();
+ return;
+ }
+
+ QString filename;
+ if ( scopeType() == ProjectScope )
+ filename = m_root->fileName() ;
+ else if ( scopeType() == IncludeScope )
+ filename = m_parent->projectDir() + QString( QChar( QDir::separator() ) ) + m_incast->projectName;
+ if ( filename.isEmpty() )
+ return ;
+ m_part->dirWatch()->stopScan();
+ QFile file( filename );
+ if ( file.open( IO_WriteOnly ) )
+ {
+
+ QTextStream out( &file );
+ QString astbuffer;
+ m_root->writeBack( astbuffer );
+ out << astbuffer;
+ file.close();
+ }else
+ {
+ KMessageBox::error( 0, i18n( "Could not write project file: %1" ).arg( filename ),
+ i18n( "Could not write project file" ) );
+ }
+#ifdef DEBUG
+ Scope::PrintAST pa;
+ pa.processProject(m_root);
+#endif
+ m_part->dirWatch()->startScan();
+}
+
+void Scope::addToPlusOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "+=", values, false );
+}
+
+void Scope::removeFromPlusOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "+=", values, true );
+}
+
+
+void Scope::addToMinusOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "-=", values, false );
+}
+
+void Scope::removeFromMinusOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "-=", values, true );
+}
+
+void Scope::addToEqualOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "=", values, false );
+}
+
+void Scope::removeFromEqualOp( const QString& variable, const QStringList& values )
+{
+ if ( !m_root )
+ return ;
+
+ updateVariable( variable, "=", values, true );
+}
+
+void Scope::setPlusOp( const QString& variable, const QStringList& values )
+{
+ if( !m_root || Scope::listsEqual(values, variableValuesForOp(variable, "+=") ) )
+ return;
+
+ updateVariable( variable, "+=", variableValuesForOp( variable, "+=" ), true );
+ updateVariable( variable, "+=", values, false );
+}
+
+void Scope::setEqualOp( const QString& variable, const QStringList& values )
+{
+ if( !m_root || Scope::listsEqual(values, variableValuesForOp(variable, "=") ) )
+ return;
+
+ updateVariable( variable, "=", variableValuesForOp( variable, "=" ), true );
+ updateVariable( variable, "=", values, false );
+}
+
+void Scope::setMinusOp( const QString& variable, const QStringList& values )
+{
+ if( !m_root || Scope::listsEqual(values, variableValuesForOp(variable, "-=") ) )
+ return;
+
+ updateVariable( variable, "-=", variableValuesForOp( variable, "-=" ), true );
+ updateVariable( variable, "-=", values, false );
+}
+
+QStringList Scope::variableValuesForOp( const QString& variable , const QString& op ) const
+{
+ QStringList result;
+
+ if( !m_root )
+ return result;
+
+ QValueList<QMake::AST*>::const_iterator it;
+ for ( it = m_root->m_children.begin(); it != m_root->m_children.end(); ++it )
+ {
+ QMake::AST* ast = *it;
+ if ( ast->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * assign = static_cast<QMake::AssignmentAST*>( ast );
+ if ( assign->scopedID == variable && assign->op == op )
+ {
+ result += assign->values;
+ }
+ }
+ }
+ result = cleanStringList(result);
+ return result;
+}
+
+QStringList Scope::variableValues( const QString& variable, bool checkIncParent, bool fetchFromParent, bool evaluateSubScopes )
+{
+ QStringList result;
+
+ if ( !m_root )
+ return result;
+
+ if( m_varCache.contains( variable ) && fetchFromParent && ( checkIncParent || scopeType() != Scope::IncludeScope ) )
+ {
+ return m_varCache[variable];
+ }
+
+ calcValuesFromStatements( variable, result, checkIncParent, 0, fetchFromParent, true, evaluateSubScopes );
+ result = cleanStringList(result);
+ if( ( scopeType() != Scope::IncludeScope || checkIncParent ) && fetchFromParent )
+ {
+ m_varCache[ variable ] = result;
+ }
+ return result;
+}
+
+void Scope::calcValuesFromStatements( const QString& variable, QStringList& result, bool checkIncParent, QMake::AST* stopHere, bool fetchFromParent, bool setDefault, bool evaluateSubScopes ) const
+{
+ if( !m_root )
+ return;
+
+ /* For variables that we don't know and which are not QT/CONFIG find the default value */
+ if( setDefault && m_defaultopts
+ && m_defaultopts->variables().findIndex(variable) != -1
+ && ( variable == "TEMPLATE" || variable == "QT" || KnownVariables.findIndex(variable) == -1 || variable == "CONFIG" ) )
+ {
+ result = m_defaultopts->variableValues(variable);
+ }
+
+ if ( ( scopeType() == FunctionScope || scopeType() == SimpleScope ) && fetchFromParent )
+ {
+ m_parent->calcValuesFromStatements( variable, result, checkIncParent, this->m_root, fetchFromParent, setDefault, evaluateSubScopes );
+ }
+ else if ( scopeType() == IncludeScope && checkIncParent && fetchFromParent )
+ {
+ m_parent->calcValuesFromStatements( variable, result, true, this->m_incast, fetchFromParent, setDefault, evaluateSubScopes );
+ }
+
+ QValueList<QMake::AST*>::const_iterator it;
+ for ( it = m_root->m_children.begin(); it != m_root->m_children.end(); ++it )
+ {
+ if ( stopHere && *it == stopHere )
+ return ;
+ QMake::AST* ast = *it;
+ if ( ast->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * assign = static_cast<QMake::AssignmentAST*>( ast );
+ if ( assign->scopedID == variable )
+ {
+ if ( assign->op == "=" )
+ {
+ result = assign->values;
+ }
+ else if ( assign->op == "+=" )
+ {
+ for ( QStringList::const_iterator sit = assign->values.begin(); sit != assign->values.end() ; ++sit )
+ {
+ if ( result.findIndex( *sit ) == -1 )
+ result.append( *sit );
+ }
+ }
+ else if ( assign->op == "-=" )
+ {
+ for ( QStringList::const_iterator sit = assign->values.begin(); sit != assign->values.end() ; ++sit )
+ {
+ if ( result.findIndex( *sit ) != -1 )
+ result.remove( *sit );
+ }
+ }
+ }
+ }else if( evaluateSubScopes )
+ {
+ if( ast->nodeType() == QMake::AST::IncludeAST )
+ {
+ QMake::IncludeAST* iast = static_cast<QMake::IncludeAST*>(ast);
+ QValueList<unsigned int> l = m_scopes.keys();
+ for( unsigned int i = 0; i < l.count(); ++i )
+ {
+ int num = l[ i ];
+ if( m_scopes.contains( num ) )
+ {
+ Scope* s = m_scopes[num];
+ if( s && s->scopeType() == IncludeScope && s->m_incast == iast )
+ {
+ s->calcValuesFromStatements( variable, result, false, 0, false, false, evaluateSubScopes );
+ }
+ }
+ }
+
+ }
+ else if( ast->nodeType() == QMake::AST::ProjectAST )
+ {
+ QMake::ProjectAST* past = static_cast<QMake::ProjectAST*>(ast);
+ if( past->isFunctionScope() || past->isScope() )
+ {
+ QValueList<unsigned int> l = m_scopes.keys();
+ for( unsigned int i = 0; i < l.count(); ++i )
+ {
+ int num = l[ i ];
+ if( m_scopes.contains( num ) )
+ {
+ Scope* s = m_scopes[num];
+ if( s && s->m_root == past && s->m_root->scopedID == past->scopedID )
+ {
+ s->calcValuesFromStatements( variable, result, false, 0, false, false, evaluateSubScopes );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ result = cleanStringList( result );
+ return ;
+}
+
+Scope::ScopeType Scope::scopeType() const
+{
+ if ( !m_root )
+ return InvalidScope;
+ else if ( m_incast )
+ return IncludeScope;
+ else if ( m_root->isProject() )
+ return ProjectScope;
+ else if ( m_root->isScope() )
+ return SimpleScope;
+ else if ( m_root->isFunctionScope() )
+ return FunctionScope;
+ return InvalidScope;
+}
+
+QString Scope::scopeName() const
+{
+ if ( !m_root )
+ return "";
+ if ( m_incast )
+ return "include<" + m_incast->projectName + ">";
+ else if ( m_root->isFunctionScope() )
+ return funcScopeKey( m_root );
+ else if ( m_root->isScope() )
+ return m_root->scopedID;
+ else if ( m_root->isProject() )
+ {
+ if( m_parent && QDir::cleanDirPath( m_parent->projectDir() ) != QDir::cleanDirPath( projectDir() ) )
+ {
+ return URLUtil::getRelativePath( m_parent->projectDir(), projectDir() );
+ }else if ( m_parent && QDir::cleanDirPath( m_parent->projectDir() ) == QDir::cleanDirPath( projectDir() ) )
+ {
+ return fileName();
+ }else
+ return QFileInfo( projectDir() ).fileName() ;
+ }
+ return QString();
+}
+
+QString Scope::fileName() const
+{
+ if( !m_root )
+ return "";
+ if ( m_incast )
+ return m_incast->projectName;
+ else if ( m_root->isProject() )
+ return QFileInfo( m_root->fileName() ).fileName();
+ else
+ return m_parent->fileName();
+}
+
+Scope* Scope::createFunctionScope( const QString& funcName, const QString& args )
+{
+ if ( !m_root )
+ return 0;
+
+ QMake::ProjectAST* ast = new QMake::ProjectAST( QMake::ProjectAST::FunctionScope );
+ ast->scopedID = funcName;
+ ast->args = args;
+ ast->setDepth( m_root->depth() );
+ ast->addChildAST( new QMake::NewLineAST() );
+ m_root->addChildAST( ast );
+ m_root->addChildAST( new QMake::NewLineAST() );
+ Scope* funcScope = new Scope( m_environment, getNextScopeNum(), this, ast, m_defaultopts, m_part );
+ if( funcScope->scopeType() != Scope::InvalidScope )
+ {
+ m_scopes.insert( getNextScopeNum(), funcScope );
+ return funcScope;
+ }else
+ delete funcScope;
+ return 0;
+}
+
+Scope* Scope::createSimpleScope( const QString& scopename )
+{
+ if ( !m_root )
+ return 0;
+
+ QMake::ProjectAST* ast = new QMake::ProjectAST( QMake::ProjectAST::Scope );
+ ast->scopedID = scopename;
+ ast->addChildAST( new QMake::NewLineAST() );
+ ast->setDepth( m_root->depth() );
+ m_root->addChildAST( ast );
+ m_root->addChildAST( new QMake::NewLineAST() );
+ /* We can't unconditionally add the scope name to CONFIG, scope might be win32 which may only be in CONFIG under windows.
+ if ( m_part->isQt4Project() )
+ addToPlusOp( "CONFIG", QStringList( scopename ) );
+ */
+ Scope* simpleScope = new Scope( m_environment, getNextScopeNum(), this, ast, m_defaultopts, m_part );
+
+ if( simpleScope->scopeType() != Scope::InvalidScope )
+ {
+ m_scopes.insert( getNextScopeNum(), simpleScope );
+ return simpleScope;
+ }else
+ delete simpleScope;
+ return 0;
+
+}
+
+Scope* Scope::createIncludeScope( const QString& includeFile, bool negate )
+{
+ if ( !m_root )
+ return 0;
+
+ Scope* funcScope;
+ if ( negate )
+ {
+ funcScope = createFunctionScope( "!include", includeFile );
+ }
+ else
+ {
+ funcScope = createFunctionScope( "include", includeFile );
+ }
+ if( funcScope == 0 )
+ return 0;
+
+ QMake::IncludeAST* ast = new QMake::IncludeAST();
+ ast->setDepth( m_root->depth() );
+ ast->projectName = includeFile;
+ Scope* incScope = new Scope( m_environment, funcScope->getNextScopeNum(), funcScope, ast, projectDir(), resolveVariables( ast->projectName ), m_defaultopts, m_part );
+ if ( incScope->scopeType() != InvalidScope )
+ {
+ funcScope->m_root->addChildAST( ast );
+ funcScope->m_scopes.insert( funcScope->getNextScopeNum(), incScope );
+ return funcScope;
+ }
+ else
+ {
+ deleteFunctionScope( m_scopes.keys().last() );
+ delete incScope;
+ }
+ return 0;
+
+}
+
+Scope* Scope::createSubProject( const QString& projname )
+{
+ if( !m_root )
+ return 0;
+
+ if( variableValuesForOp( "SUBDIRS", "-=").findIndex( projname ) != -1 )
+ removeFromMinusOp( "SUBDIRS", projname );
+
+ QString realprojname = resolveVariables(projname);
+
+ if( variableValuesForOp( "SUBDIRS", "-=").findIndex( realprojname ) != -1 )
+ removeFromMinusOp( "SUBDIRS", realprojname );
+
+ QDir curdir( projectDir() );
+
+ if ( variableValues("TEMPLATE").findIndex( "subdirs" ) != -1 )
+ {
+ QString filename;
+ if( !realprojname.endsWith(".pro") )
+ {
+ if ( !curdir.exists( realprojname ) )
+ if ( !curdir.mkdir( realprojname ) )
+ return 0;
+ curdir.cd( realprojname );
+ QStringList entries = curdir.entryList("*.pro", QDir::Files);
+
+ if ( !entries.isEmpty() && entries.findIndex( curdir.dirName()+".pro" ) == -1 )
+ filename = curdir.absPath() + QString(QChar(QDir::separator()))+entries.first();
+ else
+ filename = curdir.absPath() + QString(QChar(QDir::separator()))+curdir.dirName()+".pro";
+ }else
+ filename = curdir.absPath() + QString(QChar(QDir::separator())) + realprojname;
+
+ kdDebug( 9024 ) << "Creating subproject with filename:" << filename << endl;
+
+ Scope* s = new Scope( m_environment, getNextScopeNum(), this, filename, m_part );
+ s->loadDefaultOpts();
+ if ( s->scopeType() != InvalidScope )
+ {
+ if( s->variableValues("TEMPLATE").isEmpty() )
+ s->setEqualOp("TEMPLATE", QStringList("app"));
+ s->saveToFile();
+ addToPlusOp( "SUBDIRS", QStringList( realprojname ) );
+ m_scopes.insert( getNextScopeNum(), s );
+ return s;
+ } else
+ {
+ delete s;
+ }
+ }
+
+ return 0;
+}
+
+bool Scope::deleteFunctionScope( unsigned int num )
+{
+ if ( !m_root || !m_scopes.contains( num ) )
+ return false;
+
+ Scope* funcScope = m_scopes[ num ];
+ if ( funcScope )
+ {
+ QMake::AST* ast = m_root->m_children[ m_root->m_children.findIndex( funcScope->m_root ) ];
+ if( !ast )
+ return false;
+ m_scopes.remove( num );
+ m_root->removeChildAST( funcScope->m_root );
+ delete funcScope;
+ delete ast;
+ return true;
+ }
+ return false;
+}
+
+bool Scope::deleteSimpleScope( unsigned int num )
+{
+ if ( !m_root || !m_scopes.contains( num ) )
+ return false;
+
+ Scope* simpleScope = m_scopes[ num ];
+ if ( simpleScope )
+ {
+ QMake::AST* ast = m_root->m_children[ m_root->m_children.findIndex( simpleScope->m_root ) ];
+ if( !ast )
+ return false;
+ m_scopes.remove( num );
+ removeFromPlusOp( "CONFIG", simpleScope->m_root->scopedID );
+ m_root->removeChildAST( simpleScope->m_root );
+ delete simpleScope;
+ delete ast;
+ return true;
+ }
+ return false;
+}
+
+bool Scope::deleteIncludeScope( unsigned int num )
+{
+ if ( !m_root || !m_scopes.contains( num ) )
+ return false;
+
+ Scope * incScope = m_scopes[ num ];
+ if( !incScope )
+ return false;
+ QMake::AST* ast = incScope->m_incast;
+ if( !ast )
+ return false;
+ m_scopes.remove( num );
+ m_root->removeChildAST( incScope->m_incast);
+ delete incScope;
+ delete ast;
+
+ return m_parent->deleteFunctionScope( getNum() );
+}
+
+bool Scope::deleteSubProject( unsigned int num, bool deleteSubdir )
+{
+ if ( !m_root || !m_scopes.contains( num ) )
+ return false;
+
+ QValueList<QMake::AST*>::iterator it = findExistingVariable( "TEMPLATE" );
+ if ( it != m_root->m_children.end() )
+ {
+ QMake::AssignmentAST * tempast = static_cast<QMake::AssignmentAST*>( *it );
+ if ( tempast->values.findIndex( "subdirs" ) != -1 || findExistingVariable( "TEMPLATE" ) != m_root->m_children.end() )
+ {
+ Scope* project = m_scopes[ num ];
+ if( !project )
+ return false;
+
+ QString projdir = project->scopeName();
+ if ( deleteSubdir )
+ {
+ QDir projdir = QDir( projectDir() );
+ QString dir = project->scopeName();
+ if( !dir.endsWith(".pro") )
+ {
+ QDir subdir = QDir( projectDir() + QString( QChar( QDir::separator() ) ) + dir );
+ if ( subdir.exists() )
+ {
+ QStringList entries = subdir.entryList();
+ for ( QStringList::iterator eit = entries.begin() ; eit != entries.end() ; ++eit )
+ {
+ if( *eit == "." || *eit == ".." )
+ continue;
+ if( !subdir.remove( *eit ) )
+ kdDebug( 9024 ) << "Couldn't delete " << *eit << " from " << subdir.absPath() << endl;
+ }
+ if( !projdir.rmdir( dir ) )
+ kdDebug( 9024 ) << "Couldn't delete " << dir << " from " << projdir.absPath() << endl;
+ }
+ }else
+ {
+ QDir d( project->projectDir() );
+ kdDebug(9024) << "removed subproject?:" << d.remove( dir ) << endl;
+ }
+ }
+ QValueList<QMake::AST*>::iterator foundit = findExistingVariable( "SUBDIRS" );
+ if ( foundit != m_root->m_children.end() )
+ {
+ QMake::AssignmentAST * ast = static_cast<QMake::AssignmentAST*>( *foundit );
+ updateValues( ast->values, QStringList( projdir ), true, ast->indent );
+ if( m_varCache.contains( "SUBDIRS" ) )
+ m_varCache.erase( "SUBDIRS" );
+ }else
+ return false;
+ m_scopes.remove( num );
+ delete project;
+ return true;
+ }
+ }
+ return false;
+}
+
+void Scope::updateValues( QStringList& origValues, const QStringList& newValues, bool remove, QString indent )
+{
+ if( !m_root )
+ return;
+
+ for ( QStringList::const_iterator it = newValues.begin(); it != newValues.end() ; ++it )
+ {
+ if ( origValues.findIndex( *it ) == -1 && !remove )
+ {
+ while ( !origValues.isEmpty() && origValues.last() == getLineEndingString() )
+ origValues.pop_back();
+ if ( origValues.count() > 0 && !containsContinue( origValues.last() ) && !isComment( origValues.last() ) )
+ {
+ origValues.append( " " );
+ origValues.append( "\\"+getLineEndingString() );
+ if( indent != "" )
+ origValues.append( indent );
+ }else if ( !origValues.isEmpty() && containsContinue( origValues.last() ) && !isComment( origValues.last() ) )
+ {
+ if( indent != "" )
+ origValues.append( indent );
+ }else if ( !origValues.isEmpty() && isComment( origValues.last() ) )
+ {
+ origValues[origValues.count()-1] = "\\ "+origValues[origValues.count()-1];
+ if( indent != "" )
+ origValues.append( indent );
+ }else if ( origValues.isEmpty() )
+ origValues.append(" ");
+ QString newval = *it;
+ QRegExp re("([^$])\\$([^$\\(\\)\\{\\} /]*)( |\\)|/)");
+ newval.replace(re, "\\1$(\\2)\\3");
+ if( (newval).contains(" ") || (newval).contains("\t") || (newval).contains( getLineEndingString() ) || (newval).contains("#") )
+ origValues.append( "\""+newval+"\"" );
+ else
+ origValues.append( newval );
+ origValues.append( getLineEndingString() );
+ } else if ( origValues.findIndex( *it ) != -1 && remove )
+ {
+ QStringList::iterator posit = origValues.find( *it );
+ posit = origValues.remove( posit );
+ while( posit != origValues.end() && ( (*posit).find( QRegExp("\\\\[\\s]*"+getLineEndingString() ) ) != -1
+ || (*posit).stripWhiteSpace() == "" ) )
+ {
+ posit = origValues.remove( posit );
+ }
+ }
+ }
+ while( !origValues.isEmpty() && (origValues.last() == "\\"+getLineEndingString()
+ || origValues.last() == getLineEndingString()
+ || origValues.last().stripWhiteSpace() == "" ) && !origValues.isEmpty() )
+ origValues.pop_back();
+ if( !origValues.isEmpty() && origValues.last().find( QRegExp("\\\\[ \t]*#") ) != -1 )
+ origValues[origValues.count()-1] = origValues[origValues.count()-1].mid(origValues[origValues.count()-1].find( "#") );
+ if( !origValues.isEmpty() && origValues.last().find( getLineEndingString() ) == -1 )
+ origValues.append(getLineEndingString());
+}
+
+void Scope::updateVariable( const QString& variable, const QString& op, const QStringList& values, bool removeFromOp )
+{
+ if ( !m_root || listIsEmpty( values ) )
+ return ;
+
+ if( m_varCache.contains( variable ) )
+ m_varCache.erase( variable );
+
+ for ( int i = m_root->m_children.count() - 1; i >= 0; --i )
+ {
+ if ( m_root->m_children[ i ] ->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * assignment = static_cast<QMake::AssignmentAST*>( m_root->m_children[ i ] );
+ if ( assignment->scopedID == variable && Scope::isCompatible( assignment->op, op ) )
+ {
+ updateValues( assignment->values, values, removeFromOp, assignment->indent );
+ if ( removeFromOp && listIsEmpty( assignment->values ) )
+ {
+ m_root->removeChildAST( assignment );
+ delete assignment;
+ }
+ return ;
+ }
+ else if ( assignment->scopedID == variable && !Scope::isCompatible( assignment->op, op ) )
+ {
+ for ( QStringList::const_iterator it = values.begin() ; it != values.end() ; ++it )
+ {
+ if ( op == "+=" && !removeFromOp && assignment->values.findIndex( *it ) != -1 )
+ {
+ if ( assignment->op == "=" )
+ {
+ updateValues( assignment->values, values, false, assignment->indent );
+ return ;
+ }
+ else if ( assignment->op == "-=" )
+ {
+ updateValues( assignment->values, QStringList( *it ), true, assignment->indent );
+ if ( listIsEmpty( assignment->values ) )
+ {
+ m_root->removeChildAST( assignment );
+ delete assignment;
+ break;
+ }
+ }
+ }
+ else if ( op == "-=" && !removeFromOp && assignment->values.findIndex( *it ) != -1 )
+ {
+ updateValues( assignment->values, QStringList( *it ), true, assignment->indent );
+ if ( listIsEmpty( assignment->values ) )
+ {
+ m_root->removeChildAST( assignment );
+ delete assignment;
+ break;
+ }
+ }
+ else if ( op == "=" )
+ {
+ if ( !removeFromOp )
+ {
+ m_root->removeChildAST( assignment );
+ delete assignment;
+ }
+ else if ( assignment->op == "+=" && assignment->values.findIndex( *it ) != -1 )
+ {
+ updateValues( assignment->values, QStringList( *it ), true, assignment->indent );
+ if ( listIsEmpty( assignment->values ) )
+ {
+ m_root->removeChildAST( assignment );
+ delete assignment;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if ( !removeFromOp )
+ {
+ QMake::AssignmentAST * ast = new QMake::AssignmentAST();
+ ast->scopedID = variable;
+ ast->op = op;
+ updateValues( ast->values, values );
+ if( scopeType() == ProjectScope )
+ ast->setDepth( m_root->depth() );
+ else
+ ast->setDepth( m_root->depth()+1 );
+ m_root->addChildAST( ast );
+ if ( values.findIndex( getLineEndingString() ) == -1 )
+ {
+ ast->values.append( getLineEndingString() );
+ }
+ }
+}
+
+QValueList<QMake::AST*>::iterator Scope::findExistingVariable( const QString& variable )
+{
+ QValueList<QMake::AST*>::iterator it;
+ QStringList ops;
+ ops << "=" << "+=";
+
+ for ( it = m_root->m_children.begin(); it != m_root->m_children.end() ; ++it )
+ {
+ if ( ( *it ) ->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * assignment = static_cast<QMake::AssignmentAST*>( *it );
+ if ( assignment->scopedID == variable && ops.findIndex( assignment->op ) != -1 )
+ {
+ return it;
+ }
+ }
+ }
+ return m_root->m_children.end();
+}
+
+void Scope::init()
+{
+ if( !m_root )
+ return;
+
+ kdDebug(9024) << "Initializing Scope: " << scopeName() << this << endl;
+ m_maxCustomVarNum = 1;
+
+ QValueList<QMake::AST*>::const_iterator it;
+ for ( it = m_root->m_children.begin(); it != m_root->m_children.end(); ++it )
+ {
+ if ( ( *it ) ->nodeType() == QMake::AST::ProjectAST )
+ {
+ QMake::ProjectAST * p = static_cast<QMake::ProjectAST*>( *it );
+ m_scopes.insert( getNextScopeNum(), new Scope( m_environment, getNextScopeNum(), this, p, m_defaultopts, m_part ) );
+ }
+ else if ( ( *it ) ->nodeType() == QMake::AST::IncludeAST )
+ {
+ QMake::IncludeAST * i = static_cast<QMake::IncludeAST*>( *it );
+ QString filename = i->projectName;
+ if( i->projectName.stripWhiteSpace().startsWith("$") )
+ {
+ filename = resolveVariables(i->projectName, *it);
+ }
+ m_scopes.insert( getNextScopeNum(), new Scope( m_environment, getNextScopeNum(), this, i, projectDir(), filename, m_defaultopts, m_part ) );
+ }
+ else if ( ( *it ) ->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * m = static_cast<QMake::AssignmentAST*>( *it );
+ // Check wether TEMPLATE==subdirs here too!
+ if ( m->scopedID == "SUBDIRS" && variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ {
+ for ( QStringList::const_iterator sit = m->values.begin() ; sit != m->values.end(); ++sit )
+ {
+ QString str = *sit;
+ if ( containsContinue( str ) || isComment( str ) || str == getLineEndingString() || str == "." || str == "./" || (str).stripWhiteSpace() == "" )
+ continue;
+ QDir subproject;
+ QString projectfile;
+ kdDebug(9024) << "reading subproject: " << str << endl;
+ if( str.startsWith("$") )
+ str = resolveVariables(str, *it);
+ if( str.endsWith(".pro") )
+ {
+ subproject = QDir( projectDir(), "*.pro", QDir::Name | QDir::IgnoreCase, QDir::Files );
+ projectfile = str;
+ }else
+ {
+ QString dir = str;
+ if( QFileInfo( dir ).isRelative() )
+ dir = projectDir() + QString( QChar( QDir::separator() ) ) + dir;
+ subproject = QDir( dir,
+ "*.pro", QDir::Name | QDir::IgnoreCase, QDir::Files );
+ if( !subproject.exists() )
+ {
+ kdDebug(9024) << "Project Dir doesn't exist, trying to find name.subdir variable:" << str << endl;
+ if( !variableValues(str+".subdir").isEmpty() )
+ {
+ kdDebug(9024) << "Found name.subdir variable for " << str << endl;
+ subproject = QDir( projectDir() + QString( QChar( QDir::separator() ) )
+ + variableValues(str+".subdir").first(),
+ "*.pro", QDir::Name | QDir::IgnoreCase, QDir::Files );
+ }else
+ continue;
+ }
+ if ( subproject.entryList().isEmpty() || subproject.entryList().findIndex( str + ".pro" ) != -1 )
+ projectfile = (str) + ".pro";
+ else
+ projectfile = subproject.entryList().first();
+
+ }
+ kdDebug( 9024 ) << "Parsing subproject: " << projectfile << endl;
+ m_scopes.insert( getNextScopeNum(), new Scope( m_environment, getNextScopeNum(), this,
+ subproject.absFilePath( projectfile ),
+ m_part, ( m->op != "-=" )) );
+ }
+ }
+ else
+ {
+ if ( !(
+ KnownVariables.findIndex( m->scopedID ) != -1
+ && ( m->op == "=" || m->op == "+=" || m->op == "-=")
+ )
+ && !(
+ ( m->scopedID.contains( ".files" ) || m->scopedID.contains( ".path" ) )
+ && variableValues("INSTALLS").findIndex(m->scopedID.left( m->scopedID.findRev(".") != -1 ) )
+ )
+ && !(
+ ( m->scopedID.contains( ".subdir" ) )
+ && variableValues("SUBDIRS").findIndex(m->scopedID.left( m->scopedID.findRev(".") != -1 ) )
+ )
+ )
+ {
+ m_customVariables[ m_maxCustomVarNum++ ] = m;
+ }
+ }
+ }
+ }
+}
+
+QString Scope::projectName() const
+{
+ if( !m_root )
+ return "";
+
+ return QFileInfo( projectDir() ).fileName();
+}
+
+QString Scope::projectDir() const
+{
+ if( !m_root )
+ return "";
+ if ( m_root->isProject() )
+ {
+ return QFileInfo( m_root->fileName() ).dirPath( true );
+ }
+ else
+ {
+ return m_parent->projectDir();
+ }
+}
+
+const QMap<unsigned int, QMap<QString, QString> > Scope::customVariables() const
+{
+ QMap<unsigned int, QMap<QString, QString> > result;
+ if( !m_root )
+ return result;
+
+ QMap<unsigned int, QMake::AssignmentAST*>::const_iterator it = m_customVariables.begin();
+ for ( ; it != m_customVariables.end(); ++it )
+ {
+ QMap<QString,QString> temp;
+ temp[ "var" ] = it.data()->scopedID;
+ temp[ "op" ] = it.data()->op;
+ temp[ "values" ] = it.data()->values.join("").stripWhiteSpace();
+ result[ it.key() ] = temp;
+ }
+ return result;
+}
+
+void Scope::updateCustomVariable( unsigned int id, const QString& name, const QString& newop, const QString& newvalues )
+{
+ if( !m_root )
+ return;
+ if ( id > 0 && m_customVariables.contains( id ) )
+ {
+ m_customVariables[ id ] ->values.clear();
+ updateValues( m_customVariables[ id ] ->values, newvalues.stripWhiteSpace() );
+ if( m_varCache.contains( m_customVariables[ id ]->scopedID ) )
+ m_varCache.erase( m_customVariables[ id ]->scopedID );
+ m_customVariables[ id ] ->op = newop;
+ m_customVariables[ id ] ->scopedID = name;
+ }
+}
+
+unsigned int Scope::addCustomVariable( const QString& var, const QString& op, const QString& values )
+{
+ QMake::AssignmentAST* newast = new QMake::AssignmentAST();
+ newast->scopedID = var;
+ newast->op = op;
+ newast->values.append(values.stripWhiteSpace());
+ if( scopeType() == ProjectScope )
+ newast->setDepth( m_root->depth() );
+ else
+ newast->setDepth( m_root->depth()+1 );
+ m_root->addChildAST( newast );
+ m_customVariables[ m_maxCustomVarNum++ ] = newast;
+ return (m_maxCustomVarNum-1);
+}
+
+void Scope::removeCustomVariable( unsigned int id )
+{
+ if( m_customVariables.contains(id) )
+ {
+ QMake::AssignmentAST* m = m_customVariables[id];
+ m_customVariables.remove(id);
+ m_root->m_children.remove( m );
+ }
+}
+
+bool Scope::isVariableReset( const QString& var )
+{
+ bool result = false;
+ if( !m_root )
+ return result;
+ QValueList<QMake::AST*>::const_iterator it = m_root->m_children.begin();
+ for ( ; it != m_root->m_children.end(); ++it )
+ {
+ if ( ( *it ) ->nodeType() == QMake::AST::AssignmentAST )
+ {
+ QMake::AssignmentAST * ast = static_cast<QMake::AssignmentAST*>( *it );
+ if ( ast->scopedID == var && ast->op == "=" )
+ {
+ result = true;
+ break;
+ }
+ }
+ }
+ return result;
+}
+
+void Scope::removeVariable( const QString& var, const QString& op )
+{
+ if ( !m_root )
+ return ;
+
+ QMake::AssignmentAST* ast = 0;
+
+ QValueList<QMake::AST*>::iterator it = m_root->m_children.begin();
+ for ( ; it != m_root->m_children.end(); ++it )
+ {
+ if ( ( *it ) ->nodeType() == QMake::AST::AssignmentAST )
+ {
+ ast = static_cast<QMake::AssignmentAST*>( *it );
+ if ( ast->scopedID == var && ast->op == op )
+ {
+ m_root->m_children.remove( ast );
+ it = m_root->m_children.begin();
+ }
+ }
+ }
+}
+
+bool Scope::listIsEmpty( const QStringList& values )
+{
+ if ( values.size() < 1 )
+ return true;
+ for ( QStringList::const_iterator it = values.begin(); it != values.end(); ++it )
+ {
+ if ( ( *it ).stripWhiteSpace() != "" && ( *it ).stripWhiteSpace() != "\\" )
+ return false;
+ }
+ return true;
+}
+
+bool Scope::isCompatible( const QString& op1, const QString& op2)
+{
+ if( op1 == "+=" )
+ return ( op2 == "+=" || op2 == "=" );
+ else if ( op1 == "-=" )
+ return ( op2 == "-=" );
+ else if ( op1 == "=" )
+ return ( op2 == "=" || op2 == "+=" );
+ return false;
+}
+
+bool Scope::listsEqual(const QStringList& l1, const QStringList& l2)
+{
+ QStringList left = l1;
+ QStringList right = l2;
+// left.sort();
+// right.sort();
+ return (left == right);
+}
+
+QStringList Scope::cleanStringList(const QStringList& list) const
+{
+ QStringList result;
+ for( QStringList::const_iterator it = list.begin(); it != list.end(); ++it )
+ {
+ QString s = *it;
+ if( s.stripWhiteSpace() != ""
+ && !containsContinue(s)
+ && s.stripWhiteSpace() != getLineEndingString()
+ && !isComment(s) )
+ result.append(s);
+ }
+ return result;
+}
+
+bool Scope::isQt4Project() const
+{
+ return m_part->isQt4Project();
+}
+
+void Scope::reloadProject()
+{
+ if ( !m_root || !m_root->isProject() )
+ return;
+
+ QString filename = m_root->fileName();
+ QMap<unsigned int, Scope*>::iterator it;
+ for ( it = m_scopes.begin() ; it != m_scopes.end() ; ++it )
+ {
+ Scope* s = it.data();
+ delete s;
+ }
+ m_scopes.clear();
+
+ m_customVariables.clear();
+
+ m_varCache.clear();
+
+ if ( m_root->isProject() )
+ delete m_root;
+ if ( !loadFromFile( filename ) && !QFileInfo( filename ).exists() )
+ {
+ m_root = new QMake::ProjectAST();
+ m_root->setFileName( filename );
+ }
+ init();
+}
+
+Scope* Scope::disableSubproject( const QString& dir)
+{
+ if( !m_root || ( m_root->isProject() && !m_incast ) )
+ return 0;
+
+ if( scopeType() != Scope::IncludeScope && variableValuesForOp( "SUBDIRS", "+=").findIndex( dir ) != -1 )
+ removeFromPlusOp( "SUBDIRS", dir );
+ else if( scopeType() != Scope::IncludeScope )
+ removeFromPlusOp( "SUBDIRS", dir );
+
+ QDir curdir( projectDir() );
+
+ if ( variableValues("TEMPLATE").findIndex( "subdirs" ) != -1 )
+ {
+ curdir.cd(dir);
+ QString filename;
+ QStringList entries = curdir.entryList("*.pro", QDir::Files);
+
+ if ( !entries.isEmpty() && entries.findIndex( curdir.dirName()+".pro" ) != -1 )
+ filename = curdir.absPath() + QString(QChar(QDir::separator()))+entries.first();
+ else
+ filename = curdir.absPath() + QString(QChar(QDir::separator()))+curdir.dirName()+".pro";
+
+ kdDebug( 9024 ) << "Disabling subproject with filename:" << filename << endl;
+
+ Scope* s = new Scope( m_environment, getNextScopeNum(), this, filename, m_part, false );
+ addToMinusOp( "SUBDIRS", QStringList( dir ) );
+ m_scopes.insert( getNextScopeNum(), s );
+ return s;
+ }
+
+ return 0;
+}
+
+QString Scope::resolveVariables( const QString& value ) const
+{
+ return resolveVariables(QStringList(value), 0).front();
+}
+
+
+QString Scope::resolveVariables( const QString& value, QMake::AST* stopHere ) const
+{
+ return resolveVariables(QStringList(value), stopHere).front();
+}
+
+QStringList Scope::variableValues( const QString& variable, QMake::AST* stopHere, bool fetchFromParent ) const
+{
+ QStringList result;
+
+ if ( !m_root )
+ return result;
+
+ calcValuesFromStatements( variable, result, true, stopHere, fetchFromParent );
+ result = cleanStringList(result);
+ return result;
+}
+
+QStringList Scope::resolveVariables( const QStringList& values, QMake::AST* stopHere ) const
+{
+ QStringList result = values;
+ QMap<QString, QStringList> variables;
+ for( QStringList::iterator it = result.begin(); it != result.end(); ++it )
+ {
+ QRegExp re("\\$\\$([^{}\\) /]*)( |\\)|/|$)");
+ int pos = 0;
+ while( pos >= 0 )
+ {
+ pos = re.search( (*it), pos );
+ if( pos > -1 )
+ {
+ if( !variables.contains( re.cap(1) ) )
+ {
+ variables[re.cap(1)] = resolveVariables( variableValues( re.cap(1), stopHere ) );
+ if( variables[re.cap(1)].isEmpty() && re.cap(1) == "TARGET" )
+ {
+ variables[re.cap(1)] = QFileInfo( fileName() ).baseName();
+ }
+ }
+ pos += re.matchedLength();
+ }
+ }
+ re = QRegExp("\\$\\$\\{([^\\)\\}]*)\\}");
+ pos = 0;
+ while( pos >= 0 )
+ {
+ pos = re.search( (*it), pos );
+ if( pos > -1 )
+ {
+ if( !variables.contains( re.cap(1) ) )
+ {
+ variables[re.cap(1)] = resolveVariables( variableValues( re.cap(1), stopHere ) );
+ if( variables[re.cap(1)].isEmpty() && re.cap(1) == "TARGET" )
+ {
+ variables[re.cap(1)] = QFileInfo( fileName() ).baseName();
+ }
+ }
+ pos += re.matchedLength();
+ }
+ }
+ re = QRegExp("\\$\\$\\(([^\\)\\}]*)\\)");
+ pos = 0;
+ QMap<QString, QString> envvars;
+ while( pos >= 0 )
+ {
+ pos = re.search( (*it), pos );
+ if( pos > -1 )
+ {
+ if( !envvars.contains( re.cap(1) ) )
+ if( m_environment.contains( re.cap(1) ) != -1 )
+ envvars[re.cap(1)] = m_environment[ re.cap(1) ];
+ else if ( ::getenv( re.cap(1).local8Bit() ) != 0 )
+ envvars[re.cap(1)] = QString::fromLocal8Bit( ::getenv( re.cap(1).local8Bit() ) );
+ pos += re.matchedLength();
+ }
+ }
+ for( QMap<QString, QString>::const_iterator it2 = envvars.begin(); it2 != envvars.end(); ++it2 )
+ {
+ (*it).replace("$$("+it2.key()+")", it2.data() );
+ }
+ for( QMap<QString, QStringList>::const_iterator it2 = variables.begin(); it2 != variables.end(); ++it2 )
+ {
+ for( QStringList::const_iterator it3 = it2.data().begin(); it3 != it2.data().end(); ++it3 )
+ {
+ (*it).replace("$$"+it2.key(), *it3 );
+ (*it).replace("$${"+it2.key()+"}", *it3 );
+ }
+ }
+ }
+ return result;
+}
+
+void Scope::allFiles( const QString& projectDirectory, std::set<QString>& res )
+{
+
+ QString myRelPath = URLUtil::getRelativePath( projectDirectory, projectDir() );
+ QString file;
+ QStringList values;
+ QString header = "";
+ if( variableValues("TEMPLATE",false ).findIndex("subdirs") == -1 )
+ {
+ values = variableValues( "INSTALLS" ,false, false );
+ QStringList::const_iterator it;
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ if ( ( *it ) == "target" )
+ continue;
+
+ QStringList files = variableValues( *it + ".files" ,false, false );
+ QStringList::iterator filesit = files.begin();
+ for ( ;filesit != files.end(); ++filesit )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *filesit;
+ file = resolveVariables( file );
+ if( file.contains("*") )
+ {
+ QFileInfo fi( projectDirectory + QString( QChar( QDir::separator() ) ) + file );
+ QDir absDir = fi.dir( true );
+ absDir.setNameFilter( fi.fileName() );
+ absDir.setFilter( QDir::Files | QDir::Readable | QDir::NoSymLinks );
+ QStringList list = absDir.entryList();
+ for( QStringList::const_iterator it = list.begin(); it != list.end(); ++it )
+ {
+ res.insert( QDir::cleanDirPath( URLUtil::getRelativePath( projectDirectory, absDir.path()+QString( QChar( QDir::separator() ) )+*it ) ) );
+ }
+ }
+ else
+ {
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+ }
+ }
+
+ values = variableValues( "LEXSOURCES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ values = variableValues( "YACCSOURCES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ values = variableValues( "DISTFILES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ if( file.contains("*") )
+ {
+ QFileInfo fi( projectDirectory + QString( QChar( QDir::separator() ) ) + file );
+ QDir absDir = fi.dir( true );
+ absDir.setNameFilter( fi.fileName() );
+ absDir.setFilter( QDir::Files | QDir::Readable | QDir::NoSymLinks );
+ QStringList list = absDir.entryList();
+ for( QStringList::const_iterator it = list.begin(); it != list.end(); ++it )
+ {
+ res.insert( QDir::cleanDirPath( URLUtil::getRelativePath( projectDirectory, absDir.path()+QString( QChar( QDir::separator() ) )+*it ) ) );
+ }
+ }
+ else
+ {
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+ }
+
+ if ( isQt4Project() )
+ {
+ values = variableValues( "RESOURCES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+ }
+ values = variableValues( "IMAGES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ values = variableValues( "TRANSLATIONS" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ values = variableValues( "IDLS" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ if ( m_part->isTMakeProject() )
+ {
+ values = variableValues( "INTERFACES" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ if( QFileInfo(projectDir()+QString(QChar(QDir::separator())) + *it+".h").exists() )
+ res.insert( QDir::cleanDirPath( file+".h" ) );
+ }
+ }
+ else
+ {
+ values = variableValues( "FORMS" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+
+ if( !m_part->isQt4Project())
+ {
+ header = projectDir()+QString(QChar(QDir::separator())) + *it+".h";
+ if( QFileInfo(header).exists() )
+ res.insert( QDir::cleanDirPath( header ) );
+ header = projectDir()+QString(QChar(QDir::separator())) + *it+".cpp";
+ if( QFileInfo(header).exists() )
+ res.insert( QDir::cleanDirPath( header ) );
+ }
+ else
+ {
+ header = projectDir()+QString(QChar(QDir::separator())) + "ui_" +*it;
+ header.replace(QRegExp("\\.ui$"),".h");
+ if( QFileInfo(header).exists() )
+ res.insert( QDir::cleanDirPath( header ) );
+ }
+ }
+ }
+
+ values = variableValues( "SOURCES" ,false, false );
+ kdDebug(9024) << "scope:" << scopeType() << " found values: " << values << endl;
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+
+ values = variableValues( "HEADERS" ,false, false );
+ for ( it = values.begin(); it != values.end(); ++it )
+ {
+ file = myRelPath + QString(QChar(QDir::separator())) + *it;
+ file = resolveVariables( file );
+ res.insert( QDir::cleanDirPath( file ) );
+ }
+ }
+ QMap<unsigned int, Scope*>::const_iterator it = m_scopes.begin();
+ for( ; it != m_scopes.end(); ++it )
+ {
+ it.data()->allFiles( projectDirectory, res );
+ }
+}
+
+QStringList Scope::allFiles( const QString& projectDir )
+{
+ QStringList result;
+ std::set<QString> files;
+ allFiles( projectDir, files );
+ for( std::set<QString>::const_iterator it = files.begin(); it != files.end() ; ++it )
+ result.append( *it );
+ kdDebug(9024) << "all files: " << result << endl;
+ return result;
+}
+
+QString Scope::findCustomVarForPath( const QString& path )
+{
+ QString result;
+ if( !m_root )
+ return result;
+
+ QMap<unsigned int, QMake::AssignmentAST*>::const_iterator it = m_customVariables.begin();
+ for( ; it != m_customVariables.end(); ++it )
+ {
+ kdDebug(9024) << "Checking " << path << " against " << cleanStringList(it.data()->values) << endl;
+ if( !it.data()->values.isEmpty() && cleanStringList(it.data()->values).front() == path )
+ {
+ return it.data()->scopedID;
+ }
+ }
+ if( scopeType() != ProjectScope )
+ {
+ return parent()->findCustomVarForPath( path );
+ }
+ return result;
+}
+
+void Scope::loadDefaultOpts()
+{
+ if( !m_defaultopts && m_root )
+ {
+ m_defaultopts = new QMakeDefaultOpts();
+ if( DomUtil::readBoolEntry( *m_part->projectDom(), "/kdevtrollproject/qmake/disableDefaultOpts", true ) )
+ {
+ m_defaultopts->readVariables( m_part->qmakePath(), QFileInfo( m_root->fileName() ).dirPath( true ) );
+ }
+ }
+}
+
+QString Scope::getLineEndingString() const
+{
+
+ if( scopeType() == ProjectScope )
+ {
+ switch( m_root->lineEnding() )
+ {
+ case QMake::ProjectAST::Windows:
+ return QString("\r\n");
+ break;
+ case QMake::ProjectAST::MacOS:
+ return QString("\r");
+ break;
+ case QMake::ProjectAST::Unix:
+ return QString("\n");
+ break;
+ }
+ }else if( m_parent )
+ {
+ return m_parent->getLineEndingString();
+ }
+ return "\n";
+}
+
+QString Scope::replaceWs(QString s)
+{
+ return s.replace( getLineEndingString(), "%nl").replace("\t", "%tab").replace(" ", "%spc");
+}
+
+bool Scope::containsContinue(const QString& s ) const
+{
+ return( s.find( QRegExp( "\\\\\\s*"+getLineEndingString() ) ) != -1
+ || s.find( QRegExp( "\\\\\\s*#" ) ) != -1 );
+}
+
+bool Scope::isComment( const QString& s) const
+{
+ return s.startsWith("#");
+}
+
+#ifdef DEBUG
+void Scope::printTree()
+{
+ PrintAST p;
+ p.processProject(m_root);
+}
+
+Scope::PrintAST::PrintAST() : QMake::ASTVisitor()
+{
+ indent = 0;
+}
+
+void Scope::PrintAST::processProject( QMake::ProjectAST* p )
+{
+ QMake::ASTVisitor::processProject(p);
+}
+
+void Scope::PrintAST::enterRealProject( QMake::ProjectAST* p )
+{
+ kdDebug(9024) << getIndent() << "--------- Entering Project: " << replaceWs(p->fileName()) << " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterRealProject(p);
+}
+
+void Scope::PrintAST::leaveRealProject( QMake::ProjectAST* p )
+{
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving Project: " << replaceWs(p->fileName()) << " --------------" << endl;
+ QMake::ASTVisitor::leaveRealProject(p);
+}
+
+void Scope::PrintAST::enterScope( QMake::ProjectAST* p )
+{
+ kdDebug(9024) << getIndent() << "--------- Entering Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterScope(p);
+}
+
+void Scope::PrintAST::leaveScope( QMake::ProjectAST* p )
+{
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving Scope: " << replaceWs(p->scopedID) << " --------------" << endl;
+ QMake::ASTVisitor::leaveScope(p);
+}
+
+void Scope::PrintAST::enterFunctionScope( QMake::ProjectAST* p )
+{
+ kdDebug(9024) << getIndent() << "--------- Entering FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
+ indent += 4;
+ QMake::ASTVisitor::enterFunctionScope(p);
+}
+
+void Scope::PrintAST::leaveFunctionScope( QMake::ProjectAST* p )
+{
+ indent -= 4;
+ kdDebug(9024) << getIndent() << "--------- Leaving FunctionScope: " << replaceWs(p->scopedID) << "(" << replaceWs(p->args) << ")"<< " --------------" << endl;
+ QMake::ASTVisitor::leaveFunctionScope(p);
+}
+
+QString Scope::PrintAST::replaceWs(QString s)
+{
+ return s.replace("\n", "%nl").replace("\t", "%tab").replace(" ", "%spc");
+}
+
+void Scope::PrintAST::processAssignment( QMake::AssignmentAST* a)
+{
+ kdDebug(9024) << getIndent() << "Assignment: " << replaceWs(a->scopedID) << " " << replaceWs(a->op) << " "
+ << replaceWs(a->values.join("|"))<< endl;
+ QMake::ASTVisitor::processAssignment(a);
+}
+
+void Scope::PrintAST::processNewLine( QMake::NewLineAST* n)
+{
+ kdDebug(9024) << getIndent() << "Newline " << endl;
+ QMake::ASTVisitor::processNewLine(n);
+}
+
+void Scope::PrintAST::processComment( QMake::CommentAST* a)
+{
+ kdDebug(9024) << getIndent() << "Comment: " << replaceWs(a->comment) << endl;
+ QMake::ASTVisitor::processComment(a);
+}
+
+void Scope::PrintAST::processInclude( QMake::IncludeAST* a)
+{
+ kdDebug(9024) << getIndent() << "Include: " << replaceWs(a->projectName) << endl;
+ QMake::ASTVisitor::processInclude(a);
+}
+
+QString Scope::PrintAST::getIndent()
+{
+ QString ind;
+ for( int i = 0 ; i < indent ; i++)
+ ind += " ";
+ return ind;
+}
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/qmake/scope.h b/buildtools/qmake/scope.h
new file mode 100644
index 00000000..e8f40eb9
--- /dev/null
+++ b/buildtools/qmake/scope.h
@@ -0,0 +1,308 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 _SCOPE_H_
+#define _SCOPE_H_
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include <set>
+
+#include "qmakeast.h"
+#include "qmakedefaultopts.h"
+
+#ifdef DEBUG
+#include "qmakeastvisitor.h"
+#endif
+
+class Scope;
+class TrollProjectPart;
+
+class Scope
+{
+public:
+
+ enum ScopeType {
+ ProjectScope,
+ FunctionScope,
+ SimpleScope,
+ IncludeScope,
+ InvalidScope
+ };
+ static const QStringList KnownVariables;
+ static const QStringList KnownConfigValues;
+
+ Scope( const QMap<QString, QString>& env, const QString &filename, TrollProjectPart* part );
+ ~Scope();
+
+ void saveToFile() const;
+
+ // Changing variable values
+ void addToPlusOp( const QString& variable, const QStringList& values );
+ void removeFromPlusOp( const QString& variable, const QStringList& values );
+ void addToMinusOp( const QString& variable, const QStringList& values );
+ void removeFromMinusOp( const QString& variable, const QStringList& values );
+ void addToEqualOp( const QString& variable, const QStringList& values );
+ void removeFromEqualOp( const QString& variable, const QStringList& values );
+ void setPlusOp( const QString& variable, const QStringList& values );
+ void setEqualOp( const QString& variable, const QStringList& values );
+ void setMinusOp( const QString& variable, const QStringList& values );
+
+ // Checks wether a line like VAR = exists in this subscope
+ bool isVariableReset( const QString& var );
+
+ // Fetch the valuelist for the variable op combination inside this scope
+ QStringList variableValuesForOp( const QString& variable, const QString& op ) const;
+
+ // Fetch the variable values by running over the statements and adding/removing/setting
+ // as the encountered op's say, begin with the parent projects variableValues list
+ QStringList variableValues( const QString& variable, bool checkIncParent = true, bool fetchFromParent = true, bool evaluateSubScopes = false );
+
+ // Remove a variable+Op combination from the scope, if existant
+ void removeVariable( const QString& var, const QString& op );
+
+ // Getting to know what type of scope this is
+ ScopeType scopeType() const;
+
+ // This returns the function+args, the scopename or the pro/pri file
+ // depending on the type of scope
+ QString scopeName() const;
+
+ // Returns the projectName for this scope, this is equal to the last part of the projectDir()
+ QString projectName() const;
+
+ // Returns just the filename of this project's .pro file
+ QString fileName() const;
+
+ // Returns the absolute path of the dir containing the .pro file
+ QString projectDir() const;
+
+ // get the parent Scope
+ Scope* parent() const { return m_parent; }
+
+ // Fetching sub-scopes
+ const QValueList<Scope*> scopesInOrder() const { return m_scopes.values(); }
+ // Working on SubScopes
+ /*
+ * creates a new function scope at the end of this (Sub-)AST and returns the Scope wrapping it
+ */
+ Scope* createFunctionScope( const QString& funcName, const QString& args );
+ /*
+ * creates a new simple scope at the end of this (Sub-)AST and returns the Scope wrapping it
+ */
+ Scope* createSimpleScope( const QString& scopename );
+
+ /*
+ * creates a new function scope at the end of this (Sub-)AST
+ * and a new include scope inside the new function scope.
+ * It returns the Scope wrapping the include-AST, the function scope AST
+ * can be accessed easily using the parent() method.
+ */
+ Scope* createIncludeScope( const QString& includeFile, bool negate = false );
+
+ /*
+ * creates a new subproject in dir (create's dir if necessary)
+ * If this scope is not a project scope the subproject will be added to this
+ * Scope only, i.e. it is not seen in the project-files list of subdirs
+ */
+ Scope* createSubProject( const QString& dir );
+
+ /* delete the given function scope */
+ bool deleteFunctionScope( unsigned int );
+ /* delete the given simple scope */
+ bool deleteSimpleScope( unsigned int );
+ /* delete the given include scope */
+ bool deleteIncludeScope( unsigned int );
+ /* deletes the subproject (including the subdir if deleteSubdir is true) */
+ bool deleteSubProject( unsigned int, bool deleteSubdir );
+
+ /* find out wether the project is Qt4 or Qt3 */
+ bool isQt4Project() const ;
+
+ /* Provide a Map of Custom variables */
+ const QMap<unsigned int, QMap<QString, QString> > customVariables() const;
+
+ unsigned int addCustomVariable( const QString& var, const QString& op, const QString& values );
+
+ /* Removes the variable with the given id if it exists */
+ void removeCustomVariable( unsigned int );
+
+ /* Update the values of the variable/operation combo var+op to values */
+ void updateCustomVariable( unsigned int, const QString&, const QString& , const QString& );
+
+ // Checks wether a QStringList contains any values that are not whitespace or \\n
+ static bool listIsEmpty( const QStringList& values );
+
+ /* returns wether this is an enabled subproject or a disabled one */
+ bool isEnabled() { return m_isEnabled; }
+
+ QStringList cleanStringList(const QStringList& list) const;
+
+ /* Reload a project scope */
+ void reloadProject();
+
+ /* creates a new disabled Scope child and add SUBDIRS -= dir to this scope */
+ Scope* disableSubproject( const QString& );
+
+ /* return the "position" of this scope in the list of scopes */
+ unsigned int getNum() { return m_num; }
+
+ QStringList allFiles( const QString& );
+
+ QString resolveVariables( const QString& ) const;
+
+ QString findCustomVarForPath( const QString& );
+
+#ifdef DEBUG
+ void printTree();
+#endif
+
+private:
+
+ // Builds the scope-lists and the customVariables list
+ void init();
+
+ /*
+ * Updates the given Variable+op with the values, if removeFromOp is true it removes the values, else it adds them
+ * this works it's way back through the current scope and changes the last occurence of op to
+ * include all new values.
+ *
+ * Depending on "op" it might end the search earlier (if op is += it also stops at =)
+ *
+ * This also removes the values from other assignments if the operation is not op, i.e.
+ * if op is += removes values from any occurence of -=
+ * if op is -= removes values from any occurence of = and +=
+ * if op is = removes values frmo any occurence of -=
+ */
+ void updateVariable( const QString& variable, const QString& op, const QStringList& values, bool removeFromOp );
+
+ /*
+ * Helper Function to change the origValues list with the values from newValues
+ * depending on the state of "remove" either adds or removes all entries from newValues
+ * to origValues if they didn't exist there yet
+ */
+ void updateValues( QStringList& origValues, const QStringList& newValues, bool remove = false, QString indent = " " );
+
+ /*
+ * Finds an existing variable, returns the end() of the statemenst if it is not found
+ */
+ QValueList<QMake::AST*>::iterator findExistingVariable( const QString& variable );
+
+ // Private constructors for easier subscope creation
+ /*
+ * just initializes the lists from the scope
+ */
+ Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, QMake::ProjectAST* root, QMakeDefaultOpts*, TrollProjectPart* part );
+ /*
+ * reads the given filename and parses it. If it doesn't exist creates an empty
+ * ProjectAST with the given filename
+ */
+ Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, const QString& filename, TrollProjectPart* part, bool isEnabled = true );
+ /*
+ * Creates a scope for an include statement, parses the file and initializes the Scope
+ * Create an empty ProjectAST if the file cannot be found or parsed.
+ */
+ Scope( const QMap<QString, QString>& env, unsigned int num, Scope* parent, QMake::IncludeAST* incast, const QString& path, const QString& incfile, QMakeDefaultOpts*, TrollProjectPart* part );
+
+
+ // runs through the statements until stopHere is found (or the end is reached, if stopHere is 0),
+ // using the given list as startvalue
+ // Changes the list using the +=, -=, = operations accordingly
+ void calcValuesFromStatements( const QString& variable, QStringList& result, bool, QMake::AST* stopHere = 0, bool fetchFromParent = true, bool setDefault = true, bool evaluateSubScopes = false ) const;
+
+ // Check wether the two operators are compatible
+ static bool isCompatible( const QString& op1, const QString& op2);
+
+ // Check wether the 2 lists are equal, regardless of element order.
+ static bool listsEqual(const QStringList& , const QStringList& );
+
+ // Load and Save project files, these only work on ProjectScope's
+ bool loadFromFile( const QString& filename );
+
+ QString funcScopeKey( QMake::ProjectAST* funcast ) const { return funcast->scopedID + "(" + funcast->args + ")"; }
+
+ unsigned int getNextScopeNum() { if( m_scopes.isEmpty() ) return 0; else return (m_scopes.keys().last()+1); }
+
+ QStringList lookupVariable( const QString& var );
+
+ QStringList resolveVariables( const QStringList&, QMake::AST* = 0 ) const;
+ QStringList variableValues( const QString& variable, QMake::AST*, bool fetchFromParent = true ) const;
+ QString resolveVariables( const QString& , QMake::AST* ) const;
+
+ // This function determines the currently used String for fileending, it can be \n, \r or \r\n
+ QString getLineEndingString() const;
+ bool isComment( const QString& ) const;
+ bool containsContinue( const QString& ) const;
+ void allFiles( const QString&, std::set<QString>& );
+
+ void loadDefaultOpts();
+
+ QMake::ProjectAST* m_root;
+ QMake::IncludeAST* m_incast;
+ QMap<unsigned int, QMake::AssignmentAST*> m_customVariables;
+ QMap<unsigned int, Scope*> m_scopes;
+ Scope* m_parent;
+ unsigned int m_maxCustomVarNum;
+
+ QString replaceWs(QString);
+
+
+ // The "position" inside the parent scope that this scope starts at
+ unsigned int m_num;
+ bool m_isEnabled;
+ TrollProjectPart* m_part;
+ QMakeDefaultOpts* m_defaultopts;
+ QMap<QString, QStringList> m_varCache;
+ QMap<QString,QString> m_environment;
+
+#ifdef DEBUG
+ class PrintAST : QMake::ASTVisitor
+ {
+
+ public:
+ PrintAST();
+ virtual void processProject( QMake::ProjectAST* p );
+ virtual void enterRealProject( QMake::ProjectAST* p );
+
+ virtual void leaveRealProject( QMake::ProjectAST* p );
+
+ virtual void enterScope( QMake::ProjectAST* p );
+
+ virtual void leaveScope( QMake::ProjectAST* p );
+
+ virtual void enterFunctionScope( QMake::ProjectAST* p );
+
+ virtual void leaveFunctionScope( QMake::ProjectAST* p );
+
+ virtual void processAssignment( QMake::AssignmentAST* a);
+
+ virtual void processNewLine( QMake::NewLineAST* n);
+
+ virtual void processComment( QMake::CommentAST* a);
+
+ virtual void processInclude( QMake::IncludeAST* a);
+
+ QString replaceWs(QString);
+
+ private:
+ QString getIndent();
+ int indent;
+
+ };
+#endif
+
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/qmake/trolllistview.cpp b/buildtools/qmake/trolllistview.cpp
new file mode 100644
index 00000000..531bb3e8
--- /dev/null
+++ b/buildtools/qmake/trolllistview.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "trolllistview.h"
+
+
+TrollListView::TrollListView(TrollProjectWidget *widget, QWidget *parent,
+ TrollProjectWidget::TrollProjectView view, const char *name)
+ :KListView(parent, name), m_widget(widget), m_view(view)
+{
+}
+
+TrollListView::~TrollListView()
+{
+}
+
+void TrollListView::focusOutEvent( QFocusEvent */* e*/ )
+{
+ m_widget->setLastFocusedView(m_view);
+}
+
+#include "trolllistview.moc"
diff --git a/buildtools/qmake/trolllistview.h b/buildtools/qmake/trolllistview.h
new file mode 100644
index 00000000..0ee86abb
--- /dev/null
+++ b/buildtools/qmake/trolllistview.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef TROLLLISTVIEW_H
+#define TROLLLISTVIEW_H
+
+#include <klistview.h>
+
+#include "trollprojectwidget.h"
+
+class TrollListView : public KListView
+{
+Q_OBJECT
+public:
+ TrollListView(TrollProjectWidget *widget, QWidget *parent, TrollProjectWidget::TrollProjectView view, const char *name = 0);
+ ~TrollListView();
+protected:
+ virtual void focusOutEvent(QFocusEvent *e);
+
+private:
+ TrollProjectWidget *m_widget;
+ TrollProjectWidget::TrollProjectView m_view;
+};
+
+#endif
diff --git a/buildtools/qmake/trollprojectpart.cpp b/buildtools/qmake/trollprojectpart.cpp
new file mode 100644
index 00000000..6d2f5b3a
--- /dev/null
+++ b/buildtools/qmake/trollprojectpart.cpp
@@ -0,0 +1,931 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Thomas Hasart *
+ * thasart@gmx.de *
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jakob@jsg.dk *
+ * *
+ * 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 "trollprojectpart.h"
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qwhatsthis.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdirwatch.h>
+#include <kstatusbar.h>
+#include <qmessagebox.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kprocess.h>
+#include <kconfig.h>
+#include <kapplication.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kfile.h>
+#include <makeoptionswidget.h>
+
+
+#include "domutil.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevmakefrontend.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "trollprojectwidget.h"
+#include "runoptionswidget.h"
+#include "config.h"
+#include "envvartools.h"
+#include "qmakeoptionswidget.h"
+#include "scope.h"
+
+#include <kdevplugininfo.h>
+#include <urlutil.h>
+
+typedef KDevGenericFactory<TrollProjectPart> TrollProjectFactory;
+static const KDevPluginInfo data("kdevtrollproject");
+K_EXPORT_COMPONENT_FACTORY( libkdevtrollproject, TrollProjectFactory( data ) )
+
+TrollProjectPart::TrollProjectPart(QObject *parent, const char *name, const QStringList& args )
+ : KDevBuildTool(&data, parent, name ? name : "TrollProjectPart")
+{
+ setInstance(TrollProjectFactory::instance());
+
+ if ( args.count() == 1 && args[0] == "TMake" )
+ m_tmakeProject = true;
+ else
+ m_tmakeProject = false;
+
+ setXMLFile("kdevtrollproject.rc");
+
+ m_executeProjectAfterBuild = false;
+ m_executeTargetAfterBuild = false;
+
+ m_dirWatch = new KDirWatch(this);
+
+ m_widget = new TrollProjectWidget(this);
+ m_widget->setIcon(SmallIcon("qmakerun"));
+ m_widget->setCaption(i18n("QMake Manager"));
+ QWhatsThis::add(m_widget, i18n("<b>QMake manager</b><p>"
+ "The QMake manager project tree consists of two parts. The 'overview' "
+ "in the upper half shows the subprojects, each one having a "
+ ".pro file. The 'details' view in the lower half shows the "
+ "list of files for the active subproject selected in the overview."));
+
+ mainWindow()->embedSelectViewRight(m_widget, i18n("QMake Manager"), i18n("QMake manager"));
+
+ KAction *action;
+
+ const QIconSet icon(SmallIcon("compfile"));
+ action = new KAction( i18n("Compile &File"), "compfile", 0,
+ m_widget, SLOT(slotBuildOpenFile()),
+ actionCollection(),"build_compilefile" );
+ action->setToolTip(i18n("Compile file"));
+ action->setWhatsThis(i18n("<b>Compile file</b><p>Runs <b>make filename.o</b> command from the directory where 'filename' is the name of currently opened file.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+
+ action = new KAction( i18n("&Build Project"), "make_kdevelop", Key_F8,
+ m_widget, SLOT(slotBuildProject()),
+ actionCollection(), "build_build_project" );
+ action->setToolTip(i18n("Build project"));
+ action->setWhatsThis(i18n("<b>Build project</b><p>Runs <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Rebuild Project"),"rebuild" , 0,
+ m_widget, SLOT(slotRebuildProject()),
+ actionCollection(),"build_rebuild_project" );
+ action->setToolTip(i18n("Rebuild project"));
+ action->setWhatsThis(i18n("<b>Rebuild project</b><p>Runs <b>make clean</b> and then <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Install Project"),"install" , 0,
+ m_widget, SLOT(slotInstallProject()),
+ actionCollection(),"build_install_project" );
+ action->setToolTip(i18n("Install project"));
+ action->setWhatsThis(i18n("<b>Install project</b><p>Runs <b>make install</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Clean Project"), 0,
+ m_widget, SLOT(slotCleanProject()),
+ actionCollection(), "build_clean_project" );
+ action->setToolTip(i18n("Clean project"));
+ action->setWhatsThis(i18n("<b>Clean project</b><p>Runs <b>make clean</b> command from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Dist-Clean Project"), 0,
+ m_widget, SLOT(slotDistCleanProject()),
+ actionCollection(), "build_distclean_project" );
+ action->setToolTip(i18n("Dist-Clean project"));
+ action->setWhatsThis(i18n("<b>Dist-Clean project</b><p>Runs <b>make distclean</b> command from the "
+ "project directory.<br>Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("Execute Main Program"), "exec", SHIFT+Key_F9,
+ this, SLOT(slotBuildAndExecuteProject()),
+ actionCollection(), "build_execute_project" );
+ action->setToolTip(i18n("Execute main program"));
+ action->setWhatsThis(i18n("<b>Execute program</b><p>Executes the currently selected subproject if it is an application or the program specified in project settings, <b>Run Options</b> tab."));
+
+ action = new KAction( i18n("&Build Subproject"), "make_kdevelop", Key_F7,
+ m_widget, SLOT(slotBuildTarget()),
+ actionCollection(), "build_build_target" );
+ action->setToolTip(i18n("Build subproject"));
+ action->setWhatsThis(i18n("<b>Build subproject</b><p>Runs <b>make</b> from the current subproject directory. "
+ "Current subproject is a subproject selected in <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Rebuild Subproject"), "rebuild", 0,
+ m_widget, SLOT(slotRebuildTarget()),
+ actionCollection(),"build_rebuild_target" );
+ action->setToolTip(i18n("Rebuild subproject"));
+ action->setWhatsThis(i18n("<b>Rebuild subproject</b><p>Runs <b>make clean</b> and then <b>make</b> from the current subproject directory. "
+ "Current subproject is a subproject selected in <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Install Subproject"), "install", 0,
+ m_widget, SLOT(slotInstallTarget()),
+ actionCollection(),"build_install_target" );
+ action->setToolTip(i18n("Install subproject"));
+ action->setWhatsThis(i18n("<b>Install subproject</b><p>Runs <b>make install</b> from the current subproject directory. "
+ "The current subproject is the subproject selected in the <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Clean Subproject"), 0,
+ m_widget, SLOT(slotCleanTarget()),
+ actionCollection(), "build_clean_target" );
+ action->setToolTip(i18n("Clean subproject"));
+ action->setWhatsThis(i18n("<b>Clean subproject</b><p>Runs <b>make clean</b> from the current subproject directory. "
+ "The current subproject is the subproject selected in the <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("&Dist-Clean Subproject"), 0,
+ m_widget, SLOT(slotDistCleanTarget()),
+ actionCollection(), "build_distclean_target" );
+ action->setToolTip(i18n("Dist-Clean subproject"));
+ action->setWhatsThis(i18n("<b>Dist-Clean subproject</b><p>Runs <b>make distclean</b> from the current"
+ " subproject directory. The current subproject is the subproject selected in the <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab."));
+
+ action = new KAction( i18n("Execute Subproject"), "exec", 0,
+ this, SLOT(slotBuildAndExecuteTarget()),
+ actionCollection(), "build_execute_target" );
+ action->setToolTip(i18n("Execute subproject"));
+ action->setWhatsThis(i18n("<b>Execute subproject</b><p>Executes the target program for the currently selected subproject. "
+ "This action is allowed only if a type of the subproject is 'application'. The type of the subproject can be "
+ "defined in <b>Subproject Settings</b> dialog (open it from the subproject context menu)."));
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ connect( makeFrontend(), SIGNAL(commandFinished(const QString&)),
+ this, SLOT(slotCommandFinished(const QString&)) );
+
+ QString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "");
+ QString m_qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", "");
+ QString qtversion = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/version", "3");
+
+ if( m_defaultQtDir.isEmpty() || !isValidQtDir( m_defaultQtDir ) )
+ {
+ m_defaultQtDir = findQtDir();
+ kdDebug(9024) << "Setting default dir to: " << m_defaultQtDir << endl;
+ DomUtil::writeEntry(*projectDom(), "/kdevcppsupport/qt/root", m_defaultQtDir );
+ }
+ if( m_qmakePath.isEmpty() || !isExecutable( m_qmakePath ) )
+ {
+ m_qmakePath = findExecutable( "qmake-qt"+qtversion );
+ if( m_qmakePath.isEmpty() || !isExecutable( m_qmakePath ) )
+ m_qmakePath = findExecutable( "qmake" );
+ kdDebug(9024) << "Setting qmake binary to: " << m_qmakePath << endl;
+ DomUtil::writeEntry(*projectDom(), "/kdevcppsupport/qt/qmake", m_qmakePath );
+ }
+}
+
+
+TrollProjectPart::~TrollProjectPart()
+{
+ if (m_widget)
+ mainWindow()->removeView(m_widget);
+ delete m_widget;
+}
+
+QString TrollProjectPart::makeEnvironment()
+{
+ // Get the make environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE"
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry(*projectDom(), "/kdevtrollproject/make/envvars", "envvar", "name", "value");
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ bool hasQtDir = false;
+ for (it = envvars.begin(); it != envvars.end(); ++it) {
+ if( (*it).first == "QTDIR" )
+ hasQtDir = true;
+
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += EnvVarTools::quote((*it).second);
+ environstr += " ";
+ }
+
+ if( !hasQtDir && !isQt4Project() && !DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "").isEmpty() )
+ {
+ environstr += QString( "QTDIR=" ) + EnvVarTools::quote( DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "") ) + QString( " PATH=$QTDIR/bin:$PATH " );
+ }
+
+ KConfigGroup grp( kapp->config(), "MakeOutputView" );
+ if( grp.readBoolEntry( "ForceCLocale", true ) )
+ environstr += "LC_MESSAGES="+EnvVarTools::quote("C")+" "+" "+"LC_CTYPE="+EnvVarTools::quote("C")+" ";
+
+ return environstr;
+}
+
+void TrollProjectPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Run Options"), i18n("Run Options"), BarIcon( "make", KIcon::SizeMedium ));
+ RunOptionsWidget *optdlg = new RunOptionsWidget(*projectDom(), "/kdevtrollproject", buildDirectory(), vbox);
+
+ vbox = dlg->addVBoxPage(i18n("Make Options"), i18n("Make Options"), BarIcon( "make", KIcon::SizeMedium ));
+ MakeOptionsWidget *w4 = new MakeOptionsWidget(*projectDom(), "/kdevtrollproject", vbox);
+
+ vbox = dlg->addVBoxPage(i18n("QMake Manager"), i18n("QMake Manager"), BarIcon( "make", KIcon::SizeMedium ));
+ QMakeOptionsWidget *qm = new QMakeOptionsWidget( projectDirectory(), *projectDom(), "/kdevtrollproject", vbox);
+
+
+ connect( dlg, SIGNAL(okClicked()), w4, SLOT(accept()) );
+ connect( dlg, SIGNAL(okClicked()), qm, SLOT(accept()) );
+ connect( dlg, SIGNAL(okClicked()), optdlg, SLOT(accept()) );
+}
+
+
+void TrollProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ mainWindow()->statusBar()->message( i18n("Loading Project...") );
+
+ QString defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "");
+ if( !isQt4Project() && ( defaultQtDir.isEmpty() || !isValidQtDir( defaultQtDir ) ) )
+ {
+ bool doask = true;
+ while( doask )
+ {
+ KURLRequesterDlg dlg( i18n("Choose Qt3 directory"),
+ i18n("Choose the Qt3 directory to use. This directory needs to have an include directory containing qt.h.")
+ , m_widget, 0);
+ dlg.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+ dlg.urlRequester() ->setURL( QString::null );
+ dlg.urlRequester() ->completionObject() ->setDir( "/" );
+
+ if ( dlg.exec() == QDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() )
+ {
+ QString qtdir = dlg.urlRequester()->url();
+ if( !isValidQtDir( qtdir ) )
+ {
+ if( KMessageBox::warningYesNo( m_widget,
+ i18n("The directory you gave is not a proper Qt directory, the "
+ "project might not work properly without one.\nPlease make "
+ "sure you give a directory that contains a bin with the "
+ "qmake binary in it and for Qt3 project also contains an "
+ "include directory with qt.h in it.\nDo you want to try "
+ "setting a Qt directory again?"),
+ i18n("Wrong Qt directory given"))
+ == KMessageBox::Yes
+ )
+ doask = true;
+ else
+ doask = false;
+ }else
+ {
+ defaultQtDir = qtdir;
+ doask = false;
+ }
+
+ }else
+ {
+ if( KMessageBox::warningYesNo( m_widget,
+ i18n("You did not specify a Qt directory, and the project might not "
+ "work properly without one.\nDo you want to try setting a Qt"
+ " directory again?"),
+ i18n("No Qt directory given"))
+ == KMessageBox::Yes
+ )
+ doask = true;
+ else
+ doask = false;
+ }
+ }
+ }
+ QString qmakePath = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", "");
+ if( qmakePath.isEmpty() || !isExecutable( qmakePath ) )
+ {
+ bool doask = true;
+ while( doask )
+ {
+ KURLRequesterDlg dlg( i18n("Choose QMake executable"),
+ i18n("Choose the QMake binary to use. QMake is used to generate Makefiles from the project files."), m_widget, 0);
+ dlg.urlRequester() ->setMode( KFile::Directory | KFile::LocalOnly );
+ dlg.urlRequester() ->setURL( QString::null );
+ dlg.urlRequester() ->completionObject() ->setDir( "/" );
+
+ if ( dlg.exec() == QDialog::Accepted && !dlg.urlRequester() ->url().isEmpty() )
+ {
+ QString qmake = dlg.urlRequester()->url();
+ if( !isExecutable( qmake ) )
+ {
+ if( KMessageBox::warningYesNo( m_widget,
+ i18n("The binary you gave is not executable, the "
+ "project might not work properly.\nPlease make "
+ "sure you give a qmake binary that is executable.\nDo you want to try "
+ "setting the QMake binary again?"),
+ i18n("Wrong QMake binary given"))
+ == KMessageBox::Yes
+ )
+ doask = true;
+ else
+ doask = false;
+ }else
+ {
+ qmakePath = qmake;
+ doask = false;
+ }
+
+ }else
+ {
+ if( KMessageBox::warningYesNo( m_widget,
+ i18n("You did not specify a QMake binary, and the project might not "
+ "work properly without one.\nDo you want to try setting a QMake"
+ " binary again?"),
+ i18n("No QMake binary given"))
+ == KMessageBox::Yes
+ )
+ doask = true;
+ else
+ doask = false;
+ }
+ }
+ }
+ DomUtil::writeEntry( *projectDom(), "/kdevcppsupport/qt/root", defaultQtDir );
+ DomUtil::writeEntry( *projectDom(), "/kdevcppsupport/qt/qmake", qmakePath );
+
+ m_projectName = projectName;
+
+ m_widget->openProject(dirName);
+
+
+ QDomDocument &dom = *projectDom();
+ // Set the default directory radio to "executable"
+ if (DomUtil::readEntry(dom, "/kdevtrollproject/run/directoryradio") == "" ) {
+ DomUtil::writeEntry(dom, "/kdevtrollproject/run/directoryradio", "executable");
+ }
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+
+void TrollProjectPart::closeProject()
+{
+ m_widget->closeProject();
+}
+
+
+QString TrollProjectPart::projectDirectory() const
+{
+ return m_widget->projectDirectory();
+}
+
+
+QString TrollProjectPart::buildDirectory() const
+{
+ return m_widget->projectDirectory();
+}
+
+QString TrollProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList TrollProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevtrollproject/run/envvars", "envvar", "name", "value");
+}
+
+void TrollProjectPart::slotBuildAndExecuteProject()
+{
+ partController()->saveAllFiles();
+ if (isDirty()) {
+ m_executeProjectAfterBuild = true;
+ m_widget->slotBuildProject();
+ } else
+ m_widget->slotExecuteProject();
+}
+
+void TrollProjectPart::slotBuildAndExecuteTarget()
+{
+ partController()->saveAllFiles();
+ if (isDirty()) {
+ m_executeTargetAfterBuild = true;
+ m_widget->slotBuildTarget();
+ } else
+ m_widget->slotExecuteTarget();
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString TrollProjectPart::runDirectory() const
+{
+ QDomDocument &dom = *projectDom();
+
+ QString cwd;
+ if( DomUtil::readBoolEntry(dom, "/kdevtrollproject/run/useglobalprogram", true) )
+ {
+ cwd = defaultRunDirectory("kdevtrollproject");
+ }else
+ {
+ QString name = m_widget->getCurrentOutputFilename();
+ if( name.findRev("/") != -1 )
+ name = name.right( name.length()-name.findRev("/")-1 );
+ cwd = DomUtil::readEntry( dom, "/kdevtrollproject/run/cwd/" + name );
+ }
+ if( cwd.isEmpty() )
+ {
+ QString destpath = m_widget->getCurrentTarget();
+ if( QDir::isRelativePath( destpath ) )
+ {
+ destpath = m_widget->subprojectDirectory() + QString( QChar( QDir::separator() ) ) + destpath;
+ }
+ destpath = destpath.left( destpath.findRev("/") );
+ cwd = destpath;
+ }
+
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+
+
+QString TrollProjectPart::mainProgram() const
+{
+
+ QDomDocument &dom = *projectDom();
+
+ if( DomUtil::readBoolEntry(dom, "/kdevtrollproject/run/useglobalprogram", false) )
+ {
+ QString DomMainProgram = DomUtil::readEntry(dom, "/kdevtrollproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+ }else
+ {
+ if( !m_widget->currentSubproject())
+ {
+ KMessageBox::error( m_widget, "There's no selected subproject!\n"
+ "Unable to determine the main program", "No selected subproject found" );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : There's no active target! -> Unable to determine the main program in TrollProjectPart::mainProgram()" << endl;
+ return QString::null;
+ }
+
+ if ( m_widget->currentSubproject()->scope->variableValues("TEMPLATE").findIndex("app") == -1 )
+ {
+ KMessageBox::error( m_widget, "Selected Subproject \""+m_widget->currentSubproject()->scope->projectName()+"\"isn't binary ( " + m_widget->currentSubproject()->scope->variableValues("TEMPLATE").join(" ") + " ) !\n"
+ "Unable to determine the main program. If you want this\n"
+ "to be the selected subproject, set a main program under\n"
+ "Project -> Project Options -> Run Options", "Selected subproject is not a library" );
+ kdDebug ( 9020 ) << k_funcinfo << "Error! : Active target isn't binary (" << m_widget->currentSubproject()->scope->variableValues("TEMPLATE").join(" ") << ") ! -> Unable to determine the main program in TrollProjectPart::mainProgram()" << endl;
+ return QString::null;
+ }
+
+ QString destpath = m_widget->getCurrentTarget();
+ if( QDir::isRelativePath( destpath ) )
+ {
+ destpath = m_widget->subprojectDirectory() + QString( QChar( QDir::separator() ) ) + destpath;
+ }
+ return destpath;
+ }
+}
+
+QString TrollProjectPart::debugArguments() const
+{
+ if( DomUtil::readBoolEntry(*projectDom(), "/kdevtrollproject/run/useglobalprogram", true ) )
+ {
+ return DomUtil::readEntry(*projectDom(), "/kdevtrollproject/run/globaldebugarguments");
+ }else
+ {
+ return DomUtil::readEntry(*projectDom(), "/kdevtrollproject/run/debugarguments/"+m_widget->getCurrentOutputFilename() );
+ }
+}
+
+/** Retuns a QString with the run command line arguments */
+QString TrollProjectPart::runArguments() const
+{
+ if( DomUtil::readBoolEntry(*projectDom(), "/kdevtrollproject/run/useglobalprogram", true) )
+ {
+ return DomUtil::readEntry(*projectDom(), "/kdevtrollproject/run/programargs");
+ }else
+ {
+ return DomUtil::readEntry(*projectDom(), "/kdevtrollproject/run/runarguments/"+m_widget->getCurrentOutputFilename() );
+ }
+}
+
+
+QString TrollProjectPart::activeDirectory() const
+{
+ QDomDocument &dom = *projectDom();
+
+ return DomUtil::readEntry(dom, "/kdevtrollproject/general/activedir");
+}
+
+
+QStringList TrollProjectPart::allFiles() const
+{
+ return m_widget->allFiles();
+}
+
+
+void TrollProjectPart::addFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->addFiles ( QStringList( fileName ) );
+}
+
+void TrollProjectPart::addFiles ( const QStringList &fileList )
+{
+ QStringList files = fileList;
+ for (QStringList::iterator it = files.begin(); it != files.end(); ++it)
+ {
+ if( !QFileInfo( *it ).isRelative() )
+ {
+ *it = URLUtil::relativePathToFile( projectDirectory(), *it );
+ }
+ }
+ m_widget->addFiles(files);
+
+}
+
+void TrollProjectPart::removeFile(const QString & /* fileName */)
+{
+ /// \FIXME
+/* QStringList fileList;
+ fileList.append ( fileName );
+
+ this->removeFiles ( fileList );*/
+}
+
+void TrollProjectPart::removeFiles ( const QStringList& fileList )
+{
+/// \FIXME missing remove files functionality
+// QStringList::ConstIterator it;
+//
+// it = fileList.begin();
+//
+// for ( ; it != fileList.end(); ++it )
+// {
+// FIXME
+// }
+
+ emit removedFilesFromProject ( fileList );
+}
+/*
+void TrollProjectPart::startMakeCommand(const QString &dir, const QString &target)
+{
+ partController()->saveAllFiles();
+
+ QFileInfo fi(dir + "/Makefile");
+ if (!fi.exists()) {
+ int r = KMessageBox::questionYesNo(m_widget, i18n("There is no Makefile in this directory. Run qmake first?"), QString::null, i18n("Run qmake"), i18n("Do Not Run"));
+ if (r == KMessageBox::No)
+ return;
+ startQMakeCommand(dir);
+ }
+ QDomDocument &dom = *projectDom();
+
+ if (target=="clean")
+ {
+ QString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin");
+ if (cmdline.isEmpty())
+ cmdline = MAKE_COMMAND;
+ cmdline += " clean";
+ QString dircmd = "cd ";
+ dircmd += dir;
+ dircmd += " && ";
+ cmdline.prepend(makeEnvironment());
+ makeFrontend()->queueCommand(dir, dircmd + cmdline);
+ }
+
+ QString cmdline = DomUtil::readEntry(dom, "/kdevtrollproject/make/makebin");
+ if (cmdline.isEmpty())
+ cmdline = MAKE_COMMAND;
+ if (!DomUtil::readBoolEntry(dom, "/kdevtrollproject/make/abortonerror"))
+ cmdline += " -k";
+ int jobs = DomUtil::readIntEntry(dom, "/kdevtrollproject/make/numberofjobs");
+ if (jobs != 0) {
+ cmdline += " -j";
+ cmdline += QString::number(jobs);
+ }
+ if (DomUtil::readBoolEntry(dom, "/kdevtrollproject/make/dontact"))
+ cmdline += " -n";
+
+ cmdline += " ";
+ cmdline += target;
+
+ QString dircmd = "cd ";
+ dircmd += dir;
+ dircmd += " && ";
+
+ cmdline.prepend(makeEnvironment());
+ makeFrontend()->queueCommand(dir, dircmd + cmdline);
+}
+*/
+
+void TrollProjectPart::startQMakeCommand(const QString &dir, bool recursive)
+{
+ QFileInfo fi(dir);
+ QString cmdline;
+
+ if ( isTMakeProject() )
+ {
+ cmdline = "tmake ";
+ }else
+ {
+ cmdline = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", "")+" ";
+ }
+
+ if(isQt4Project() && recursive)
+ {
+ cmdline += " -recursive ";
+ }
+
+ //QString cmdline = QString::fromLatin1( isTMakeProject() ? "tmake " : "qmake " );
+// cmdline += fi.baseName() + ".pro";
+ QDir d(dir);
+ QStringList l = d.entryList("*.pro");
+
+ if( l.isEmpty() || ( l.count() && l.findIndex( projectName() + ".pro" ) != -1 ) )
+ cmdline += projectName()+".pro";
+ else if( l.isEmpty() || (l.count() && l.findIndex( fi.baseName() + ".pro" ) != -1 ) )
+ cmdline += fi.baseName() + ".pro";
+ else
+ cmdline += l[0];
+
+// cmdline += QString::fromLatin1( " -o Makefile" );
+
+ QString dircmd = "cd ";
+ dircmd += KProcess::quote(dir);
+ dircmd += " && ";
+
+ cmdline.prepend(makeEnvironment());
+ makeFrontend()->queueCommand(dir, dircmd + cmdline);
+}
+
+void TrollProjectPart::queueCmd(const QString &dir, const QString &cmd)
+{
+ makeFrontend()->queueCommand(dir, cmd);
+}
+
+void TrollProjectPart::slotCommandFinished( const QString& command )
+{
+ Q_UNUSED( command );
+
+// if( m_buildCommand != command )
+// return;
+//
+// m_buildCommand = QString::null;
+
+ m_timestamp.clear();
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QString fileName = *it;
+ ++it;
+
+ m_timestamp[ fileName ] = QFileInfo( projectDirectory(), fileName ).lastModified();
+ }
+
+ emit projectCompiled();
+
+ if( m_executeProjectAfterBuild )
+ {
+ m_widget->slotExecuteProject();
+ m_executeProjectAfterBuild = false;
+ }else if( m_executeTargetAfterBuild )
+ {
+ m_widget->slotExecuteTarget();
+ m_executeTargetAfterBuild = false;
+ }
+
+}
+
+bool TrollProjectPart::isDirty()
+{
+ QStringList fileList = allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QString fileName = *it;
+ ++it;
+
+ QMap<QString, QDateTime>::Iterator it = m_timestamp.find( fileName );
+ QDateTime t = QFileInfo( projectDirectory(), fileName ).lastModified();
+ if( it == m_timestamp.end() || *it != t ){
+ return true;
+ }
+ }
+
+ return false;
+}
+
+KDevProject::Options TrollProjectPart::options( ) const
+{
+ return UsesQMakeBuildSystem;
+}
+
+bool TrollProjectPart::isValidQtDir( const QString& path ) const
+{
+ QFileInfo inc( path + QString( QChar( QDir::separator() ) )+
+ "include"+QString( QChar( QDir::separator() ) )+
+ "qt.h" );
+ return ( isQt4Project() || ( !isQt4Project() && inc.exists() ) );
+}
+
+void TrollProjectPart::buildBinDirs( QStringList & dirs ) const
+{
+ if( !isQt4Project() )
+ {
+ QString m_defaultQtDir = DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/root", "");
+ if( !m_defaultQtDir.isEmpty() )
+ dirs << (m_defaultQtDir + QString( QChar( QDir::separator() ) ) + "bin" );
+ dirs << ( ::getenv("QTDIR") + QString( QChar( QDir::separator() ) ) + "bin" );
+ }
+ QStringList paths = QStringList::split(":",::getenv("PATH"));
+ dirs += paths;
+ QString binpath = QDir::rootDirPath() + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+
+ binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+ binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "local" + QString( QChar( QDir::separator() ) ) + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+}
+
+
+QString TrollProjectPart::findExecutable( const QString& execname ) const
+{
+ QStringList dirs;
+ buildBinDirs( dirs );
+
+ for( QStringList::Iterator it=dirs.begin(); it!=dirs.end(); ++it )
+ {
+ QString designer = *it + QString( QChar( QDir::separator() ) ) + execname;
+ if( !designer.isEmpty() && isExecutable( designer ) )
+ {
+ return designer;
+ }
+ }
+ return "";
+}
+
+bool TrollProjectPart::isExecutable( const QString& path ) const
+{
+ QFileInfo fi(path);
+ return( fi.exists() && fi.isExecutable() );
+}
+
+QString TrollProjectPart::findQtDir()
+{
+ QStringList qtdirs;
+ if( !isQt4Project() )
+ qtdirs.push_back( ::getenv("QTDIR") );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString( QChar( QDir::separator() ) )+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"share"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( DomUtil::readEntry( *projectDom(), "/kdevcppsupport/qt/version", "3") ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr" );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt" );
+
+ for( QStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it )
+ {
+ QString qtdir = *it;
+ if( !qtdir.isEmpty() && isValidQtDir(qtdir) )
+ {
+ return qtdir;
+ }
+ }
+ return "";
+}
+
+
+QStringList recursiveProFind( const QString &currDir, const QString &baseDir )
+{
+ QStringList fileList;
+
+ if( !currDir.contains( QString( QChar ( QDir::separator() ) ) +".." )
+ && !currDir.contains( QString( QChar( QDir::separator() ) )+".") )
+ {
+ QDir dir(currDir);
+ QStringList dirList = dir.entryList(QDir::Dirs );
+ QStringList::Iterator idx = dirList.begin();
+ for( ; idx != dirList.end(); ++idx )
+ {
+ fileList += recursiveProFind( currDir + QString( QChar( QDir::separator() ) ) + (*idx),baseDir );
+ }
+ QStringList newFiles = dir.entryList("*.pro *.PRO");
+ idx = newFiles.begin();
+ for( ; idx != newFiles.end(); ++idx )
+ {
+ QString file = currDir + QString( QChar( QDir::separator() ) ) + (*idx);
+ fileList.append( file.remove( baseDir ) );
+ }
+ }
+
+
+ return fileList;
+}
+
+/*!
+ \fn TrollProjectPart::distFiles() const
+ */
+QStringList TrollProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QStringList files = recursiveProFind( projectDir, projectDir + QString( QChar( QDir::separator() ) ) );
+ return sourceList + files;
+}
+
+bool TrollProjectPart::isQt4Project() const
+{
+ return ( DomUtil::readIntEntry( *projectDom(), "kdevcppsupport/qt/version", 3 ) == 4 );
+}
+
+KDirWatch* TrollProjectPart::dirWatch()
+{
+ return m_dirWatch;
+}
+
+void TrollProjectPart::slotBuild()
+{
+ m_widget->slotBuildProject();
+}
+
+#include "trollprojectpart.moc"
+
+//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
+
diff --git a/buildtools/qmake/trollprojectpart.h b/buildtools/qmake/trollprojectpart.h
new file mode 100644
index 00000000..3e571e85
--- /dev/null
+++ b/buildtools/qmake/trollprojectpart.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Thomas Hasart *
+ * thasart@gmx.de *
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jakob@jsg.dk *
+ * *
+ * 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 _TROLLPROJECTPART_H_
+#define _TROLLPROJECTPART_H_
+
+#include <qdict.h>
+#include <qguardedptr.h>
+#include <qmap.h>
+#include <qdatetime.h>
+
+#include "kdevbuildtool.h"
+
+class KDialogBase;
+class TrollProjectWidget;
+class KDirWatch;
+class QMakeDefaultOpts;
+
+class TrollProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+
+public:
+ TrollProjectPart( QObject *parent, const char *name, const QStringList &args );
+ ~TrollProjectPart();
+
+ bool isTMakeProject() const { return m_tmakeProject; }
+ bool isQt4Project() const;
+ bool isDirty();
+ KDirWatch* dirWatch();
+ virtual Options options() const;
+ QStringList distFiles() const;
+ inline QString qmakePath() const { return DomUtil::readEntry(*projectDom(), "/kdevcppsupport/qt/qmake", "");; }
+
+protected:
+ virtual void openProject(const QString &dirName, const QString &projectName);
+ virtual void closeProject();
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString mainProgram() const;
+ virtual QString activeDirectory() const;
+ virtual QStringList allFiles() const;
+ virtual void addFile(const QString &fileName);
+ virtual void addFiles ( const QStringList &fileList );
+ virtual void removeFile(const QString &fileName);
+ virtual void removeFiles ( const QStringList &fileList );
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+
+private slots:
+ void projectConfigWidget(KDialogBase *dlg);
+ void slotBuild();
+// void slotClean();
+// void slotExecute();
+ void slotCommandFinished( const QString& command );
+ void slotBuildAndExecuteProject();
+ void slotBuildAndExecuteTarget();
+
+private:
+// void startMakeCommand(const QString &dir, const QString &target);
+ void startQMakeCommand(const QString &dir, bool recursive = false );
+// void execute(const QString &directory, const QString &command);
+ void queueCmd(const QString &dir, const QString &cmd);
+ QString makeEnvironment();
+
+ QString findQtDir();
+ QString findExecutable( const QString& path ) const;
+ void buildBinDirs( QStringList& ) const;
+ bool isValidQtDir( const QString& path ) const;
+ bool isExecutable( const QString& path ) const;
+
+ QGuardedPtr<TrollProjectWidget> m_widget;
+ QString m_projectName;
+ bool m_tmakeProject;
+
+ QMap<QString, QDateTime> m_timestamp;
+ bool m_executeProjectAfterBuild;
+ bool m_executeTargetAfterBuild;
+ QString m_buildCommand;
+
+ KDirWatch* m_dirWatch;
+
+ friend class TrollProjectWidget;
+ friend class ProjectRunOptionsDlg;
+ friend class QMakeDefaultOpts;
+};
+
+#endif
+
diff --git a/buildtools/qmake/trollprojectwidget.cpp b/buildtools/qmake/trollprojectwidget.cpp
new file mode 100644
index 00000000..7668dbd7
--- /dev/null
+++ b/buildtools/qmake/trollprojectwidget.cpp
@@ -0,0 +1,2547 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2000-2001 by Trolltech AS. *
+* info@trolltech.com *
+* Copyright (C) 2002 by Jakob Simon-Gaarde *
+* jakob@jsg.dk *
+* Copyright (C) 2002-2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* Copyright (C) 2003 by Thomas Hasart *
+* thasart@gmx.de *
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.de *
+* *
+* Part of this file is taken from Qt Designer. *
+* *
+* 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 "trollprojectwidget.h"
+
+#include <config.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qheader.h>
+#include <qsplitter.h>
+#include <qptrstack.h>
+#include <qtextstream.h>
+#include <qcombobox.h>
+#include <kprocess.h>
+#include <qtimer.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <qinputdialog.h>
+#include <qwhatsthis.h>
+#include <qvaluestack.h>
+#include <kfiledialog.h>
+#include <qtooltip.h>
+#include <kdebug.h>
+#include <klistview.h>
+#include <kmessagebox.h>
+#include <kpopupmenu.h>
+#include <kregexp.h>
+#include <kurl.h>
+#include <qmessagebox.h>
+#include <iostream>
+#include <kparts/part.h>
+#include <kaction.h>
+#include <kprocess.h>
+#include <kinputdialog.h>
+#include <kdeversion.h>
+#include <kdirwatch.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kio/netaccess.h>
+#include <kurlcompletion.h>
+
+#include "kdevcore.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "trollprojectpart.h"
+#include "kdevappfrontend.h"
+#include "kdevmakefrontend.h"
+#include "kdevlanguagesupport.h"
+#include "kdevcreatefile.h"
+#include "subclassesdlg.h"
+#include "addfilesdialog.h"
+#include "urlutil.h"
+#include "trolllistview.h"
+#include "projectconfigurationdlg.h"
+#include "qmakescopeitem.h"
+#include "scope.h"
+#include "createscopedlg.h"
+#include "disablesubprojectdlg.h"
+#include <kapplication.h>
+
+TrollProjectWidget::TrollProjectWidget( TrollProjectPart *part )
+ : QVBox( 0, "troll project widget" ), m_shownSubproject( 0 ), m_rootSubproject( 0 ),
+ m_rootScope ( 0 ), m_part ( part ), m_configDlg( 0 ), m_filesCached(false)
+{
+
+ QSplitter * splitter = new QSplitter( Vertical, this );
+
+ //////////////////
+ // PROJECT VIEW //
+ //////////////////
+
+ overviewContainer = new QVBox( splitter, "Projects" );
+ overviewContainer->setMargin ( 2 );
+ overviewContainer->setSpacing ( 2 );
+ // overviewContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
+ // splitter->setResizeMode(overviewContainer, QSplitter::FollowSizeHint);
+
+ projectTools = new QHBox( overviewContainer, "Project buttons" );
+ projectTools->setMargin ( 2 );
+ projectTools->setSpacing ( 2 );
+ // Add subdir
+ addSubdirButton = new QToolButton ( projectTools, "Add subproject button" );
+ addSubdirButton->setPixmap ( SmallIcon ( "folder_new" ) );
+ addSubdirButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, addSubdirButton->sizePolicy().hasHeightForWidth() ) );
+ addSubdirButton->setEnabled ( true );
+ QToolTip::add( addSubdirButton, i18n( "Add subproject" ) );
+ QWhatsThis::add( addSubdirButton, i18n( "<b>Add subproject</b><p>Creates a <i>new</i> or adds an <i>existing</i> subproject to a currently selected subproject. "
+ "This action is allowed only if a type of the subproject is 'subdirectories'. The type of the subproject can be "
+ "defined in <b>Subproject Settings</b> dialog (open it from the subproject context menu)." ) );
+ // Create scope
+ createScopeButton = new QToolButton ( projectTools, "Create scope button" );
+ createScopeButton->setPixmap ( SmallIcon ( "qmake_scopenew" ) );
+ createScopeButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, createScopeButton->sizePolicy().hasHeightForWidth() ) );
+ createScopeButton->setEnabled ( true );
+ QToolTip::add( createScopeButton, i18n( "Create scope" ) );
+ QWhatsThis::add( createScopeButton, i18n( "<b>Create scope</b><p>Creates QMake scope in the project file in case the subproject is selected or creates nested scope in case the scope is selected." ) );
+
+ // build
+ buildProjectButton = new QToolButton ( projectTools, "Make button" );
+ buildProjectButton->setPixmap ( SmallIcon ( "make_kdevelop" ) );
+ buildProjectButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, buildProjectButton->sizePolicy().hasHeightForWidth() ) );
+ buildProjectButton->setEnabled ( true );
+ QToolTip::add( buildProjectButton, i18n( "Build project" ) );
+ QWhatsThis::add( buildProjectButton, i18n( "<b>Build project</b><p>Runs <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+ // rebuild
+ rebuildProjectButton = new QToolButton ( projectTools, "Rebuild button" );
+ rebuildProjectButton->setPixmap ( SmallIcon ( "rebuild" ) );
+ rebuildProjectButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, rebuildProjectButton->sizePolicy().hasHeightForWidth() ) );
+ rebuildProjectButton->setEnabled ( true );
+ QToolTip::add( rebuildProjectButton, i18n( "Rebuild project" ) );
+ QWhatsThis::add( rebuildProjectButton, i18n( "<b>Rebuild project</b><p>Runs <b>make clean</b> and then <b>make</b> from the project directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ // run
+ executeProjectButton = new QToolButton ( projectTools, "Run button" );
+ executeProjectButton->setPixmap ( SmallIcon ( "exec" ) );
+ executeProjectButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, executeProjectButton->sizePolicy().hasHeightForWidth() ) );
+ executeProjectButton->setEnabled ( true );
+ QToolTip::add( executeProjectButton, i18n( "Execute main program" ) );
+ QWhatsThis::add( executeProjectButton, i18n( "<b>Execute main program</b><p>Executes the main program specified in project settings, <b>Run Options</b> tab." ) );
+ // spacer
+ QWidget *spacer = new QWidget( projectTools );
+ projectTools->setStretchFactor( spacer, 1 );
+ // Project configuration
+ projectconfButton = new QToolButton ( projectTools, "Project configuration button" );
+ projectconfButton->setPixmap ( SmallIcon ( "configure" ) );
+ projectconfButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, projectconfButton->sizePolicy().hasHeightForWidth() ) );
+ projectconfButton->setEnabled ( true );
+ QToolTip::add( projectconfButton, i18n( "Subproject settings" ) );
+ QWhatsThis::add( projectconfButton, i18n( "<b>Subproject settings</b><p>Opens <b>QMake Subproject Configuration</b> dialog for the currently selected subproject. "
+ "It provides settings for:<br>subproject type and configuration,<br>include and library paths,<br>lists of dependencies and "
+ "external libraries,<br>build order,<br>intermediate files locations,<br>compiler options." ) );
+
+ // Project button connections
+ connect ( addSubdirButton, SIGNAL ( clicked () ), this, SLOT ( slotAddSubproject () ) );
+ connect ( createScopeButton, SIGNAL ( clicked () ), this, SLOT ( slotCreateScope () ) );
+
+
+ connect ( buildProjectButton, SIGNAL ( clicked () ), this, SLOT ( slotBuildProject () ) );
+ connect ( rebuildProjectButton, SIGNAL ( clicked () ), this, SLOT ( slotRebuildProject () ) );
+ connect ( executeProjectButton, SIGNAL ( clicked () ), m_part, SLOT ( slotBuildAndExecuteProject () ) );
+
+
+ connect ( projectconfButton, SIGNAL ( clicked () ), this, SLOT ( slotConfigureProject () ) );
+
+ // Project tree
+ overview = new TrollListView( this, overviewContainer, SubprojectView, "project overview widget" );
+// overview->setResizeMode( QListView::LastColumn );
+ overview->setSorting( -1 );
+ overview->header() ->hide();
+ overview->addColumn( QString::null );
+
+ // Project tree connections
+ connect( overview, SIGNAL( selectionChanged( QListViewItem* ) ),
+ this, SLOT( slotOverviewSelectionChanged( QListViewItem* ) ) );
+ connect( overview, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
+ this, SLOT( slotOverviewContextMenu( KListView*, QListViewItem*, const QPoint& ) ) );
+
+
+ /////////////////
+ // DETAIL VIEW //
+ /////////////////
+
+ // Details tree
+ detailContainer = new QVBox( splitter, "Details" );
+ detailContainer->setMargin ( 2 );
+ detailContainer->setSpacing ( 2 );
+ // detailContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
+
+ // Details Toolbar
+ fileTools = new QHBox( detailContainer, "Detail buttons" );
+ fileTools->setMargin ( 2 );
+ fileTools->setSpacing ( 2 );
+
+ // Add new file button
+ newfileButton = new QToolButton ( fileTools, "Create new file" );
+ newfileButton->setPixmap ( SmallIcon ( "filenew" ) );
+ newfileButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, newfileButton->sizePolicy().hasHeightForWidth() ) );
+ newfileButton->setEnabled ( true );
+ QToolTip::add( newfileButton, i18n( "Create new file" ) );
+ QWhatsThis::add( newfileButton, i18n( "<b>Create new file</b><p>Creates a new file and adds it to a currently selected group." ) );
+
+ // Add existing files button
+ addfilesButton = new QToolButton ( fileTools, "Add existing files" );
+ addfilesButton->setPixmap ( SmallIcon ( "fileimport" ) );
+ addfilesButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, addfilesButton->sizePolicy().hasHeightForWidth() ) );
+ addfilesButton->setEnabled ( true );
+ QToolTip::add( addfilesButton, i18n( "Add existing files" ) );
+ QWhatsThis::add( addfilesButton, i18n( "<b>Add existing files</b><p>Adds existing files to a currently selected group. It is "
+ "possible to copy files to a current subproject directory, create symbolic links or "
+ "add them with the relative path." ) );
+
+ // remove file button
+ removefileButton = new QToolButton ( fileTools, "Remove file" );
+ removefileButton->setPixmap ( SmallIcon ( "button_cancel" ) );
+ removefileButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, removefileButton->sizePolicy().hasHeightForWidth() ) );
+ removefileButton->setEnabled ( true );
+ QToolTip::add( removefileButton, i18n( "Remove file" ) );
+ QWhatsThis::add( removefileButton, i18n( "<b>Remove file</b><p>Removes file from a current group. Does not remove file from disk." ) );
+
+ // build selected file
+ buildFileButton = new QToolButton ( fileTools, "Make file button" );
+ buildFileButton->setPixmap ( SmallIcon ( "compfile" ) );
+ buildFileButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, buildFileButton->sizePolicy().hasHeightForWidth() ) );
+ buildFileButton->setEnabled ( true );
+ QToolTip::add( buildFileButton, i18n( "Compile file" ) );
+ QWhatsThis::add( buildFileButton, i18n( "<b>Compile file</b><p>Runs <b>make filename.o</b> command from the directory where 'filename' is the name of currently opened file.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ // build
+ buildTargetButton = new QToolButton ( fileTools, "Make sp button" );
+ buildTargetButton->setPixmap ( SmallIcon ( "make_kdevelop" ) );
+ buildTargetButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, buildTargetButton->sizePolicy().hasHeightForWidth() ) );
+ buildTargetButton->setEnabled ( true );
+ QToolTip::add( buildTargetButton, i18n( "Build subproject" ) );
+ QWhatsThis::add( buildTargetButton, i18n( "<b>Build subproject</b><p>Runs <b>make</b> from the current subproject directory. "
+ "Current subproject is a subproject selected in <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+ // rebuild
+ rebuildTargetButton = new QToolButton ( fileTools, "Rebuild sp button" );
+ rebuildTargetButton->setPixmap ( SmallIcon ( "rebuild" ) );
+ rebuildTargetButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, rebuildTargetButton->sizePolicy().hasHeightForWidth() ) );
+ rebuildTargetButton->setEnabled ( true );
+ QToolTip::add( rebuildTargetButton, i18n( "Rebuild subproject" ) );
+ QWhatsThis::add( rebuildTargetButton, i18n( "<b>Rebuild subproject</b><p>Runs <b>make clean</b> and then <b>make</b> from the current subproject directory. "
+ "Current subproject is a subproject selected in <b>QMake manager</b> 'overview' window.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ // run
+ executeTargetButton = new QToolButton ( fileTools, "Run sp button" );
+ executeTargetButton->setPixmap ( SmallIcon ( "exec" ) );
+ executeTargetButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, executeTargetButton->sizePolicy().hasHeightForWidth() ) );
+ executeTargetButton->setEnabled ( true );
+ QToolTip::add( executeTargetButton, i18n( "Execute subproject" ) );
+ QWhatsThis::add( executeTargetButton, i18n( "<b>Execute subproject</b><p>Executes the target program for the currently selected subproject. "
+ "This action is allowed only if a type of the subproject is 'application'. The type of the subproject can be "
+ "defined in <b>Subproject Settings</b> dialog (open it from the subproject context menu)." ) );
+
+
+ // spacer
+ spacer = new QWidget( fileTools );
+ projectTools->setStretchFactor( spacer, 1 );
+
+ // Configure file button
+ excludeFileFromScopeButton = new QToolButton ( fileTools, "Exclude file" );
+ excludeFileFromScopeButton->setPixmap ( SmallIcon ( "configure_file" ) );
+ excludeFileFromScopeButton->setSizePolicy ( QSizePolicy ( ( QSizePolicy::SizeType ) 0, ( QSizePolicy::SizeType ) 0, 0, 0, excludeFileFromScopeButton->sizePolicy().hasHeightForWidth() ) );
+ excludeFileFromScopeButton->setEnabled ( true );
+ QToolTip::add( excludeFileFromScopeButton , i18n( "Exclude file" ) );
+ QWhatsThis::add( excludeFileFromScopeButton , i18n( "<b>Exclude file</b><p>Exclude the selected file from this scope." ) );
+
+ // detail tree
+ details = new TrollListView( this, detailContainer, DetailsView, "details widget" );
+ details->setRootIsDecorated( true );
+ details->setResizeMode( QListView::LastColumn );
+ details->setSorting( -1 );
+ details->header() ->hide();
+ details->addColumn( QString::null );
+ // Detail button connections
+ connect ( addfilesButton, SIGNAL ( clicked () ), this, SLOT ( slotAddFiles () ) );
+ connect ( newfileButton, SIGNAL ( clicked () ), this, SLOT ( slotNewFile () ) );
+ connect ( removefileButton, SIGNAL ( clicked () ), this, SLOT ( slotRemoveFile () ) );
+ connect ( buildFileButton, SIGNAL ( clicked () ), this, SLOT ( slotBuildSelectedFile () ) );
+ connect ( excludeFileFromScopeButton, SIGNAL ( clicked () ), this, SLOT ( slotExcludeFileFromScopeButton() ) );
+
+ // Detail tree connections
+ connect( details, SIGNAL( selectionChanged( QListViewItem* ) ),
+ this, SLOT( slotDetailsSelectionChanged( QListViewItem* ) ) );
+ connect( details, SIGNAL( executed( QListViewItem* ) ),
+ this, SLOT( slotDetailsExecuted( QListViewItem* ) ) );
+ connect( details, SIGNAL( contextMenu( KListView*, QListViewItem*, const QPoint& ) ),
+ this, SLOT( slotDetailsContextMenu( KListView*, QListViewItem*, const QPoint& ) ) );
+
+ connect ( buildTargetButton, SIGNAL ( clicked () ), this, SLOT ( slotBuildTarget () ) );
+ connect ( rebuildTargetButton, SIGNAL ( clicked () ), this, SLOT ( slotRebuildTarget () ) );
+ connect ( executeTargetButton, SIGNAL ( clicked () ), m_part, SLOT ( slotBuildAndExecuteTarget () ) );
+ buildTargetButton->setEnabled( false );
+ rebuildTargetButton->setEnabled( false );
+ executeTargetButton->setEnabled( false );
+
+ m_configDlg = new ProjectConfigurationDlg( overview, this, this );
+
+ connect( m_part->dirWatch(), SIGNAL( dirty(const QString&) ), this, SLOT( slotProjectDirty(const QString&) ) );
+}
+
+
+TrollProjectWidget::~TrollProjectWidget()
+{
+ delete m_configDlg;
+}
+
+
+void TrollProjectWidget::openProject( const QString &dirName )
+{
+ QDomDocument & dom = *( m_part->projectDom() );
+ m_subclasslist = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+
+ QString projectfile = DomUtil::readEntry( dom, "/kdevtrollproject/qmake/projectfile", "" );
+
+ m_showFilenamesOnly = DomUtil::readBoolEntry( *m_part->projectDom(), "/kdevtrollproject/qmake/enableFilenamesOnly", false );
+ m_showVariablesInTree = DomUtil::readBoolEntry( *m_part->projectDom(), "/kdevtrollproject/qmake/showVariablesInTree", true );
+
+ QString proname;
+
+ if( projectfile.isEmpty() )
+ {
+ QFileInfo fi( dirName );
+ QDir dir( dirName );
+ // QString proname = item->path + "/" + fi.baseName() + ".pro";
+
+ QStringList l = dir.entryList( "*.pro" );
+
+ QString profile;
+ if( l.count() && l.findIndex( m_part->projectName() + ".pro") != -1 )
+ profile = m_part->projectName()+".pro";
+ else if( l.isEmpty() || ( l.count() && l.findIndex( fi.baseName() + ".pro") != -1 ) )
+ profile = fi.baseName()+".pro";
+ else
+ profile = l[0];
+
+ proname = dirName + QString( QChar( QDir::separator() ) ) + profile;
+ } else
+ {
+ proname = projectfile;
+ }
+
+ kdDebug( 9024 ) << "Parsing " << proname << endl;
+
+ m_rootScope = new Scope( qmakeEnvironment(), proname, m_part );
+ if( m_rootScope->scopeType() != Scope::InvalidScope )
+ {
+
+ m_rootSubproject = new QMakeScopeItem( overview, m_rootScope->scopeName(), m_rootScope, this );
+
+
+ m_rootSubproject->setOpen( true );
+ if ( m_rootSubproject->firstChild() && m_rootSubproject->scope->variableValues( "TEMPLATE" ).findIndex("subdirs") != -1 )
+ {
+ overview->setSelected( m_rootSubproject->firstChild(), true );
+ }
+ else
+ {
+ overview->setSelected( m_rootSubproject, true );
+ }
+ }else
+ {
+ delete m_rootScope;
+ m_rootScope = 0;
+ }
+// kdDebug(9024) << "Adding " << allFiles().count() << " Files" << endl;
+// kdDebug(9024) << allFiles() << endl;
+
+}
+
+void TrollProjectWidget::createQMakeScopeItems()
+{
+
+}
+
+void TrollProjectWidget::closeProject()
+{
+ m_rootSubproject = 0;
+ overview->clear();
+ details->clear();
+ delete m_rootScope;
+}
+
+QStringList TrollProjectWidget::allFiles()
+{
+ if( !m_rootScope )
+ return QStringList();
+ if( m_filesCached )
+ return m_allFilesCache;
+ m_allFilesCache = m_rootScope->allFiles( m_rootScope->projectDir() );
+ m_filesCached = true;
+ return m_allFilesCache;
+}
+
+QString TrollProjectWidget::projectDirectory()
+{
+ if ( !m_rootScope )
+ return QString::null; //confused
+
+ return m_rootScope->projectDir();
+}
+
+
+QString TrollProjectWidget::subprojectDirectory()
+{
+ if ( !m_shownSubproject )
+ return QString::null;
+
+ return m_shownSubproject->scope->projectDir();
+}
+
+void TrollProjectWidget::setupContext()
+{
+ if ( !m_shownSubproject )
+ return ;
+ bool buildable = true;
+ bool runable = true;
+ bool fileconfigurable = true;
+ bool hasSourceFiles = true;
+ bool hasSubdirs = false;
+
+ QStringList tmpl = m_shownSubproject->scope->variableValues( "TEMPLATE" );
+
+ if ( tmpl.findIndex( "lib" ) != -1 )
+ {
+ runable = false;
+ }
+ else if ( tmpl.findIndex( "subdirs" ) != -1 )
+ {
+ hasSubdirs = true;
+ runable = false;
+ hasSourceFiles = false;
+ fileconfigurable = false;
+ }
+ if ( m_shownSubproject->scope->scopeType() != Scope::ProjectScope )
+ {
+ runable = false;
+ buildable = false;
+ }
+
+
+ // Setup toolbars according to context
+ addSubdirButton->setEnabled( hasSubdirs );
+ buildTargetButton->setEnabled( buildable );
+ m_part->actionCollection() ->action( "build_build_target" ) ->setEnabled( buildable );
+
+ rebuildTargetButton->setEnabled( buildable );
+ m_part->actionCollection() ->action( "build_rebuild_target" ) ->setEnabled( buildable );
+
+ executeTargetButton->setEnabled( runable );
+ m_part->actionCollection() ->action( "build_execute_target" ) ->setEnabled( runable );
+
+ excludeFileFromScopeButton->setEnabled( !hasSubdirs );
+ newfileButton->setEnabled( !hasSubdirs );
+ removefileButton->setEnabled( !hasSubdirs );
+ addfilesButton->setEnabled( !hasSubdirs );
+ buildFileButton->setEnabled( !hasSubdirs );
+
+ details->setEnabled( hasSourceFiles );
+}
+
+void TrollProjectWidget::slotOverviewSelectionChanged( QListViewItem *item )
+{
+ QString olddir = m_part->activeDirectory();
+ if ( !item )
+ {
+ kdDebug(9024) << "Trying to select a non-existing item" << endl;
+ return ;
+ }
+ cleanDetailView( m_shownSubproject );
+ m_shownSubproject = static_cast<QMakeScopeItem*>( item );
+ setupContext();
+ buildProjectDetailTree( m_shownSubproject, details );
+
+ QDomDocument &dom = *( m_part->projectDom() );
+ DomUtil::writeEntry( dom, "/kdevtrollproject/general/activedir", m_shownSubproject->relativePath() );
+ if ( m_configDlg && m_configDlg->isShown() )
+ {
+ m_configDlg->updateSubproject( m_shownSubproject );
+ }
+ emit m_part->activeDirectoryChanged( olddir, m_part->activeDirectory() );
+}
+
+QString TrollProjectWidget::getCurrentTarget()
+{
+ if ( !m_shownSubproject )
+ return "";
+ QString destdir = getCurrentDestDir();
+ if ( destdir.isEmpty() )
+ return getCurrentOutputFilename();
+ else
+ return destdir + QString( QChar( QDir::separator() ) ) + getCurrentOutputFilename();
+}
+
+QString TrollProjectWidget::getCurrentDestDir()
+{
+ if ( !m_shownSubproject )
+ return "";
+ QStringList destdir = m_shownSubproject->scope->variableValues( "DESTDIR", true, true, true );
+ return m_shownSubproject->scope->resolveVariables(m_shownSubproject->scope->variableValues( "DESTDIR", true, true, true ).front());
+}
+
+QString TrollProjectWidget::getCurrentOutputFilename()
+{
+ if ( !m_shownSubproject )
+ return "";
+ if ( m_shownSubproject->scope->variableValues( "TARGET", true, true, true ).isEmpty() )
+ {
+ QString exe = m_shownSubproject->scope->resolveVariables(m_shownSubproject->scope->fileName());
+ return exe.replace( QRegExp( "\\.pro$" ), "" );
+ }
+ else
+ {
+ return m_shownSubproject->scope->resolveVariables(m_shownSubproject->scope->variableValues( "TARGET", true, true, true ).front());
+ }
+}
+
+void TrollProjectWidget::cleanDetailView( QMakeScopeItem *item )
+{
+ // If no children in detailview
+ // it is a subdir template
+ if ( item && details->childCount() )
+ {
+ QListViewItem* i = details->firstChild();
+ while( i )
+ {
+ QListViewItem* old = i;
+ i = i->nextSibling();
+ details->takeItem(old);
+ }
+// QMapIterator<GroupItem::GroupType, GroupItem*> it1 = item->groups.begin() ;
+// for ( ; it1 != item->groups.end(); ++it1 )
+// {
+// // After AddTargetDialog, it can happen that an
+// // item is not yet in the list view, so better check...
+// if ( it1.data() ->parent() )
+// while ( it1.data() ->firstChild() )
+// it1.data() ->takeItem( it1.data() ->firstChild() );
+// details->takeItem( it1.data() );
+// }
+ }
+}
+
+void TrollProjectWidget::buildProjectDetailTree( QMakeScopeItem *item, KListView *listviewControl )
+{
+
+ // Insert all GroupItems and all of their children into the view
+ if ( !listviewControl || item->scope->variableValues( "TEMPLATE" ).findIndex("subdirs") != -1 )
+ return ;
+
+ QMapIterator<GroupItem::GroupType, GroupItem*> it2 = item->groups.begin();
+ QListViewItem* lastItem = 0;
+ for ( ; it2 != item->groups.end(); ++it2 )
+ {
+ listviewControl->insertItem( it2.data() );
+ if(lastItem)
+ it2.data()->moveItem(lastItem);
+ lastItem = it2.data();
+ if ( it2.key() == GroupItem::InstallRoot )
+ {
+ QListViewItem* lastinstallitem = 0;
+ QPtrListIterator<GroupItem> it3( it2.data() ->installs );
+ for ( ; it3.current(); ++it3 )
+ {
+ it2.data() ->insertItem( *it3 );
+ if ( lastinstallitem )
+ it3.current()->moveItem(lastinstallitem);
+ lastinstallitem = it3.current();
+ QPtrListIterator<FileItem> it4( ( *it3 ) ->files );
+ QListViewItem* lastfileitem = 0;
+ for ( ; it4.current(); ++it4 )
+ {
+ ( *it3 ) ->insertItem( *it4 );
+ if ( lastfileitem )
+ it4.current()->moveItem(lastfileitem);
+ lastfileitem = it4.current();
+ }
+ ( *it3 ) ->setOpen( true );
+ ( *it3 ) ->sortChildItems( 0, true );
+ }
+ it2.data() ->setOpen( true );
+ it2.data() ->sortChildItems( 0, true );
+ }
+ else
+ {
+ QPtrListIterator<FileItem> it3( it2.data() ->files );
+ QListViewItem* lastfileitem = 0;
+ for ( ; it3.current(); ++it3 )
+ {
+ it2.data() ->insertItem( *it3 );
+ if ( lastfileitem )
+ it3.current()->moveItem(lastfileitem);
+ lastfileitem = it3.current();
+ }
+ it2.data() ->setOpen( true );
+ it2.data() ->sortChildItems( 0, true );
+ }
+ }
+ listviewControl->setSelected( listviewControl->selectedItem(), false );
+ listviewControl->setCurrentItem( 0 );
+}
+
+void TrollProjectWidget::slotDetailsExecuted( QListViewItem *item )
+{
+ if ( !item )
+ return ;
+
+ // We assume here that ALL items in both list views
+ // are qProjectItem's
+ qProjectItem *pvitem = static_cast<qProjectItem*>( item );
+ if ( pvitem->type() != qProjectItem::File )
+ return ;
+
+ FileItem *fitem = static_cast<FileItem*>( pvitem );
+
+ QString filePath;
+ if( m_shownSubproject->scope->scopeType() == Scope::IncludeScope )
+ {
+ filePath = m_shownSubproject->scope->parent()->projectDir();
+ }else
+ {
+ filePath = m_shownSubproject->scope->projectDir();
+ }
+ filePath += QChar( QDir::separator() ) + m_shownSubproject->scope->resolveVariables( fitem->localFilePath );
+
+ bool isUiFile = QFileInfo( fitem->text( 0 ) ).extension() == "ui";
+ kdDebug(9024) << "Opening file: " << filePath << endl;
+ if ( isTMakeProject() && isUiFile )
+ {
+ // start designer in your PATH
+ KShellProcess proc;
+ proc << "designer" << filePath;
+ proc.start( KProcess::DontCare, KProcess::NoCommunication );
+ }
+ else
+ m_part->partController() ->editDocument( KURL( filePath ) );
+}
+
+
+void TrollProjectWidget::slotConfigureProject()
+{
+ m_configDlg->updateSubproject( m_shownSubproject );
+ m_configDlg->show();
+}
+
+void TrollProjectWidget::slotExecuteTarget()
+{
+ //m_part->slotExecute();
+ // no subproject selected
+ if ( !m_shownSubproject )
+ return ;
+
+ // can't build from scope
+ if ( m_shownSubproject->scope->scopeType() != Scope::ProjectScope )
+ return ;
+
+
+
+ // Only run application projects
+ if ( !m_shownSubproject->scope->variableValues( "TEMPLATE" ).isEmpty() && m_shownSubproject->scope->variableValues( "TEMPLATE" ).findIndex( "app" ) == -1 )
+ return ;
+
+ //only run once
+ if (m_part->appFrontend()->isRunning())
+ {
+ if (KMessageBox::questionYesNo(this, i18n("Your application is currently running. Do you want to restart it?"), i18n("Application Already Running"), i18n("&Restart Application"), i18n("Do &Nothing")) == KMessageBox::No)
+ return;
+ m_part->appFrontend()->stopApplication();
+ while(m_part->appFrontend()->isRunning())
+ {
+ KApplication::kApplication()->processEvents();
+ usleep(100);
+ }
+ }
+
+
+ QString program = KProcess::quote( "." + QString( QChar( QDir::separator() ) ) + getCurrentOutputFilename() );
+
+ // Build environment variables to prepend to the executable path
+ QString runEnvVars = QString::null;
+ DomUtil::PairList list =
+ DomUtil::readPairListEntry( *( m_part->projectDom() ), "/kdevtrollproject/run/envvars", "envvar", "name", "value" );
+
+ DomUtil::PairList::ConstIterator it;
+ for ( it = list.begin(); it != list.end(); ++it )
+ {
+ const DomUtil::Pair &pair = ( *it );
+ if ( ( !pair.first.isEmpty() ) && ( !pair.second.isEmpty() ) )
+ runEnvVars += pair.first + "=" + pair.second + " ";
+ }
+ program.prepend( runEnvVars );
+
+ program.append( " " + m_part->runArguments() + " " );
+ // std::cerr<<dircmd + "./"+program<<std::endl;
+ // m_part->execute(dircmd + "./"+program);
+ // m_part->appFrontend()->startAppCommand(dircmd +"./"+program,true);
+
+ bool inTerminal = DomUtil::readBoolEntry( *m_part->projectDom(), "/kdevtrollproject/run/terminal" );
+
+ m_part->appFrontend() ->startAppCommand( subprojectDirectory() + QString( QChar( QDir::separator() ) ) + getCurrentDestDir(), program, inTerminal );
+
+}
+
+void TrollProjectWidget::slotBuildProject()
+{
+ if ( m_part->partController() ->saveAllFiles() == false )
+ return ; //user cancelled
+
+ QString dir = projectDirectory();
+
+ if ( !m_rootSubproject )
+ return ;
+
+ createMakefileIfMissing( dir, m_rootSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString buildcmd = constructMakeCommandLine( m_rootSubproject->scope );
+ m_part->queueCmd( dir, dircmd + buildcmd );
+}
+
+void TrollProjectWidget::slotInstallProject()
+{
+ if ( m_part->partController() ->saveAllFiles() == false )
+ return ; //user cancelled
+
+ QString dir = projectDirectory();
+
+ if ( !m_rootSubproject )
+ return ;
+
+ createMakefileIfMissing( dir, m_rootSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString buildcmd = constructMakeCommandLine( m_rootSubproject->scope ) + " install";
+ m_part->queueCmd( dir, dircmd + buildcmd );
+}
+
+void TrollProjectWidget::slotBuildTarget()
+{
+ // no subproject selected
+ m_part->partController() ->saveAllFiles();
+ if ( !m_shownSubproject )
+ return ;
+ // can't build from scope
+ if ( m_shownSubproject->scope->scopeType() != Scope::ProjectScope )
+ return ;
+ QString dir = subprojectDirectory();
+ createMakefileIfMissing( dir, m_shownSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString buildcmd = constructMakeCommandLine( m_shownSubproject->scope );
+ m_part->queueCmd( dir, dircmd + buildcmd );
+}
+
+void TrollProjectWidget::slotInstallTarget()
+{
+ // no subproject selected
+ m_part->partController() ->saveAllFiles();
+ if ( !m_shownSubproject )
+ return ;
+ // can't build from scope
+ if ( m_shownSubproject->scope->scopeType() != Scope::ProjectScope )
+ return ;
+ QString dir = subprojectDirectory();
+ createMakefileIfMissing( dir, m_shownSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString buildcmd = constructMakeCommandLine( m_shownSubproject->scope ) + " install";
+ m_part->queueCmd( dir, dircmd + buildcmd );
+}
+
+void TrollProjectWidget::slotRebuildProject()
+{
+ m_part->partController() ->saveAllFiles();
+ QString dir = this-> projectDirectory();
+
+ if ( !m_rootSubproject )
+ return ;
+
+ createMakefileIfMissing( dir, m_rootSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString rebuildcmd = constructMakeCommandLine( m_rootSubproject->scope ) + " clean && " + constructMakeCommandLine( m_rootSubproject->scope );
+ m_part->queueCmd( dir, dircmd + rebuildcmd );
+}
+
+void TrollProjectWidget::slotRebuildTarget()
+{
+ // no subproject selected
+ m_part->partController() ->saveAllFiles();
+ if ( !m_shownSubproject )
+ return ;
+ // can't build from scope
+ if ( m_shownSubproject->scope->scopeType() != Scope::ProjectScope )
+ return ;
+
+ QString dir = subprojectDirectory();
+ createMakefileIfMissing( dir, m_shownSubproject );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString rebuildcmd = constructMakeCommandLine( m_shownSubproject->scope ) + " clean && " + constructMakeCommandLine( m_shownSubproject->scope );
+ m_part->queueCmd( dir, dircmd + rebuildcmd );
+}
+
+void TrollProjectWidget::slotCreateScope( QMakeScopeItem *spitem )
+{
+ if ( spitem == 0 && m_shownSubproject == 0 )
+ return ;
+ else
+ spitem = m_shownSubproject;
+ CreateScopeDlg dlg( spitem, this );
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ spitem->scope->saveToFile( );
+ spitem->sortChildItems( 0, true );
+ }
+ return ;
+}
+
+void TrollProjectWidget::slotAddSubproject( QMakeScopeItem *spitem )
+{
+ if ( spitem == 0 && m_shownSubproject == 0 )
+ return ;
+ else
+ spitem = m_shownSubproject;
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ QString projectdir = spitem->scope->projectDir();
+
+ KURLRequesterDlg dialog( i18n( "Add Subproject" ), i18n( "Please enter a name for the subproject: " ), this, 0 );
+ KURLRequester* req = dialog.urlRequester();
+ req->setMode( KFile::Directory | KFile::File | KFile::LocalOnly );
+ req->setFilter( "*.pro|QMake Project Files (*.pro)" );
+ req->setURL( QString() );
+ req->fileDialog()->setURL( KURL::fromPathOrURL( projectdir ) );
+ req->completionObject() ->setDir( projectdir );
+
+ if ( dialog.exec() == QDialog::Accepted && !dialog.urlRequester() ->url().isEmpty() )
+ {
+ QString subdirname;
+ if ( !QDir::isRelativePath( dialog.urlRequester() ->url() ) )
+ subdirname = URLUtil::getRelativePath( projectdir, dialog.urlRequester()->url() );
+ else
+ subdirname = dialog.urlRequester()->url();
+
+ while( subdirname.endsWith( QString(QChar(QDir::separator())) ) )
+ subdirname = subdirname.left(subdirname.length()-1);
+ if( !subdirname.endsWith(".pro") )
+ {
+ kdDebug(9024) << "Cleaned subdirname: " << subdirname << endl;
+ QDir dir( projectdir );
+ QString realdir = spitem->scope->resolveVariables( subdirname );
+ if ( !dir.exists( realdir ) )
+ {
+ if ( !dir.mkdir( realdir ) )
+ {
+ KMessageBox::error( this, i18n( "Failed to create subdirectory. "
+ "Do you have write permission "
+ "in the project folder?" ) );
+ return ;
+ }else
+ {
+ QFile f( dir.absPath()+"/"+realdir+"/"+realdir+".pro" );
+ f.open( IO_WriteOnly );
+ f.close();
+ }
+ }
+ }else
+ {
+ QString realdir = spitem->scope->resolveVariables( subdirname );
+ QFile f( projectdir+"/"+realdir );
+ f.open( IO_WriteOnly );
+ f.close();
+ }
+
+ addSubprojectToItem( spitem, subdirname );
+
+ }
+}
+
+void TrollProjectWidget::addSubprojectToItem( QMakeScopeItem* spitem, const QString& subdirname )
+{
+ QListViewItem* item = spitem->firstChild();
+ while( item )
+ {
+ QMakeScopeItem* sitem = static_cast<QMakeScopeItem*>(item);
+ if( sitem->scope->scopeName() == subdirname )
+ {
+ if( sitem->scope->isEnabled() )
+ {
+ return;
+ }else
+ {
+ spitem->scope->removeFromMinusOp( "SUBDIRS", subdirname );
+ delete item;
+ if( spitem->scope->variableValues( "SUBDIRS" ).findIndex( subdirname ) != -1 )
+ return;
+ }
+ }
+ item = item->nextSibling();
+ }
+
+ Scope* subproject = spitem->scope->createSubProject( subdirname );
+ if( subproject )
+ {
+ new QMakeScopeItem( spitem, subproject->scopeName(), subproject );
+// QListViewItem* lastitem = spitem->firstChild();
+// while( lastitem->nextSibling() != 0 )
+// lastitem = lastitem->nextSibling();
+// newitem->moveItem( lastitem );
+ }else
+ {
+ KMessageBox::error(this, i18n("Could not create subproject. This means that either the project you wanted"
+ " to add a subproject to is not parsed correctly, or it is not a"
+ " subdirs-project."), i18n("Subproject creation failed") );
+ }
+ spitem->scope->saveToFile();
+ spitem->sortChildItems( 0, true );
+}
+
+void TrollProjectWidget::slotRemoveSubproject( QMakeScopeItem *spitem )
+{
+ if ( spitem == 0 && m_shownSubproject == 0 )
+ return ;
+ else if ( ( spitem = dynamic_cast<QMakeScopeItem *>( m_shownSubproject->parent() ) ) != NULL )
+ {
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ bool delsubdir = false;
+ if ( KMessageBox::warningYesNo( this, i18n( "Delete the file/directory of the subproject from disk?" ), i18n( "Delete subdir?" ) ) == KMessageBox::Yes )
+ delsubdir = true;
+ if( !spitem->scope->deleteSubProject( m_shownSubproject->scope->getNum(), delsubdir ) )
+ {
+ KMessageBox::error(this, i18n("Could not delete subproject.\nThis is an internal error, please write a"
+ " bug report to bugs.kde.org and include the output of kdevelop when run"
+ "from a shell."),i18n("Subproject Deletion failed"));
+ return;
+ }
+ delete m_shownSubproject;
+ m_shownSubproject = spitem;
+ spitem->scope->saveToFile( );
+ overview->setCurrentItem( m_shownSubproject );
+ overview->setSelected( m_shownSubproject, true );
+ }
+}
+
+void TrollProjectWidget::slotOverviewContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ if ( !item )
+ return ;
+
+ QMakeScopeItem *spitem = static_cast<QMakeScopeItem*>( item );
+
+ KPopupMenu popup( this );
+ popup.insertTitle( i18n( "Subproject %1" ).arg( item->text( 0 ) ) );
+
+ int idBuild = -2;
+ int idRebuild = -2;
+ int idClean = -2;
+ int idInstall = -2;
+ int idDistClean = -2;
+ int idQmake = -2;
+ int idQmakeRecursive = -2;
+ int idProjectConfiguration = -2;
+ int idAddSubproject = -2;
+ int idRemoveSubproject = -2;
+ int idDisableSubproject = -2;
+ int idRemoveScope = -2;
+ int idAddScope = -2;
+
+
+ if ( spitem->scope->scopeType() == Scope::ProjectScope && ( !spitem->scope->parent() || spitem->scope->parent()->scopeType() == Scope::ProjectScope ) )
+ {
+ idBuild = popup.insertItem( SmallIcon( "make_kdevelop" ), i18n( "Build" ) );
+ popup.setWhatsThis( idBuild, i18n( "<b>Build</b><p>Runs <b>make</b> from the selected subproject directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+ idInstall = popup.insertItem( i18n( "Install" ) );
+ popup.setWhatsThis( idBuild, i18n( "<b>Install</b><p>Runs <b>make install</b> from the selected subproject directory.<br>"
+ "Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+ idClean = popup.insertItem( i18n( "Clean" ) );
+ popup.setWhatsThis( idBuild, i18n( "<b>Clean project</b><p>Runs <b>make clean</b> command from the project "
+ "directory.<br> Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+ idDistClean = popup.insertItem( i18n( "Dist-Clean" ) );
+ popup.setWhatsThis( idBuild, i18n( "<b>Dist-Clean project</b><p>Runs <b>make distclean</b> command from the project "
+ "directory.<br> Environment variables and make arguments can be specified "
+ "in the project settings dialog, <b>Make Options</b> tab." ) );
+
+ idRebuild = popup.insertItem( SmallIcon( "rebuild" ), i18n( "Rebuild" ) );
+ popup.setWhatsThis( idRebuild, i18n( "<b>Rebuild project</b><p>Runs <b>make clean</b> and then <b>make</b> from "
+ "the project directory.<br>Environment variables and make arguments can be "
+ "specified in the project settings dialog, <b>Make Options</b> tab." ) );
+ idQmake = popup.insertItem( SmallIcon( "qmakerun" ), i18n( "Run qmake" ) );
+ popup.setWhatsThis( idQmake, i18n( "<b>Run qmake</b><p>Runs <b>qmake</b> from the selected subproject directory. This creates or regenerates Makefile." ) );
+ idQmakeRecursive = popup.insertItem( SmallIcon( "qmakerun" ), i18n( "Run qmake recursively" ) );
+ popup.setWhatsThis( idQmakeRecursive, i18n( "<b>Run qmake recursively</b><p>Runs <b>qmake</b> from the selected "
+ "subproject directory and recurses into all subproject directories. "
+ "This creates or regenerates Makefile." ) );
+
+ popup.insertSeparator();
+ idAddSubproject = popup.insertItem( SmallIcon( "folder_new" ), i18n( "Add Subproject..." ) );
+ popup.setWhatsThis( idAddSubproject, i18n( "<b>Add subproject</b><p>Creates a <i>new</i> or adds an <i>existing</i> subproject to a currently selected subproject. "
+ "This action is allowed only if a type of the subproject is 'subdirectories'. The type of the subproject can be "
+ "defined in <b>Subproject Settings</b> dialog (open it from the subproject context menu)." ) );
+ if ( spitem->scope->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) == -1 )
+ popup.setItemEnabled( idAddSubproject, false );
+ idRemoveSubproject = popup.insertItem( SmallIcon( "remove_subdir" ), i18n( "Remove Subproject..." ) );
+ popup.setWhatsThis( idRemoveSubproject, i18n( "<b>Remove subproject</b><p>Removes currently selected subproject. Does not delete any file from disk. Deleted subproject can be later added by calling 'Add Subproject' action." ) );
+ if ( spitem->parent() == NULL )
+ popup.setItemEnabled( idRemoveSubproject, false );
+ idAddScope = popup.insertItem( SmallIcon( "qmake_scopenew" ), i18n( "Create Scope..." ) );
+ popup.setWhatsThis( idAddScope, i18n( "<b>Create scope</b><p>Creates QMake scope in the project file of the currently selected subproject." ) );
+ popup.insertSeparator();
+ idProjectConfiguration = popup.insertItem( SmallIcon( "configure" ), i18n( "Subproject Settings" ) );
+ popup.setWhatsThis( idProjectConfiguration, i18n( "<b>Subproject settings</b><p>Opens <b>QMake Subproject Configuration</b> dialog. "
+ "It provides settings for:<br>subproject type and configuration,<br>include and library paths,<br>lists of dependencies and "
+ "external libraries,<br>build order,<br>intermediate files locations,<br>compiler options." ) );
+ }
+ else
+ {
+ idAddScope = popup.insertItem( SmallIcon( "qmake_scopenew" ), i18n( "Create Scope..." ) );
+ popup.setWhatsThis( idAddScope, i18n( "<b>Create Scope</b><p>Creates QMake scope in the currently selected scope." ) );
+ idRemoveScope = popup.insertItem( SmallIcon( "editdelete" ), i18n( "Remove Scope" ) );
+ popup.setWhatsThis( idRemoveScope, i18n( "<b>Remove Scope</b><p>Removes currently selected scope." ) );
+ popup.insertSeparator();
+ idAddSubproject = popup.insertItem( SmallIcon( "folder_new" ), i18n( "Add Subproject..." ) );
+ popup.setWhatsThis( idAddSubproject, i18n( "<b>Add subproject</b><p>Creates a <i>new</i> or adds an <i>existing</i> subproject to the currently selected scope. "
+ "This action is allowed only if the type of the subproject is 'subdirectories'. The type of the subproject can be "
+ "defined in the <b>Subproject Settings</b> dialog (open it from the subproject context menu)." ) );
+ if ( spitem->scope->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) == -1 )
+ popup.setItemEnabled( idAddSubproject, false );
+ idDisableSubproject = popup.insertItem( SmallIcon( "remove_subdir" ), i18n( "Disable Subproject..." ) );
+ popup.setWhatsThis( idRemoveSubproject, i18n( "<b>Disable subproject</b><p>Disables the currently selected subproject when this scope is active. Does not delete the directory from disk. The deleted subproject can be later added by using the 'Add Subproject' action." ) );
+ if( spitem->scope->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) == -1 && spitem->scope->parent()->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) == -1 )
+ popup.setItemEnabled( idDisableSubproject, false );
+ popup.insertSeparator();
+ idProjectConfiguration = popup.insertItem( SmallIcon( "configure" ), i18n( "Scope Settings" ) );
+ popup.setWhatsThis( idProjectConfiguration, i18n( "<b>Scope settings</b><p>Opens <b>QMake Subproject Configuration</b> dialog. "
+ "It provides settings for:<br>subproject type and configuration,<br>include and library paths,<br>lists of dependencies and "
+ "external libraries,<br>build order,<br>intermediate files locations,<br>compiler options." ) );
+ }
+
+ int r = popup.exec( p );
+
+ QString relpath = spitem->relativePath();
+ if ( r == idAddSubproject )
+ {
+ slotAddSubproject( spitem );
+ }
+ if ( r == idRemoveSubproject )
+ {
+ slotRemoveSubproject( spitem );
+ }
+ if ( r == idDisableSubproject )
+ {
+ slotDisableSubproject( spitem );
+ }
+ if ( r == idAddScope )
+ {
+ slotCreateScope( spitem );
+ }
+ else if ( r == idRemoveScope )
+ {
+ slotRemoveScope( spitem );
+ }
+ else if ( r == idBuild )
+ {
+ slotBuildTarget();
+ // m_part->startMakeCommand(projectDirectory() + relpath, QString::fromLatin1(""));
+ }
+ else if ( r == idInstall )
+ {
+ slotInstallTarget();
+ // m_part->startMakeCommand(projectDirectory() + relpath, QString::fromLatin1(""));
+ }
+ else if ( r == idRebuild )
+ {
+ slotRebuildTarget();
+ }
+ else if ( r == idClean )
+ {
+ slotCleanTarget();
+ }
+ else if ( r == idDistClean )
+ {
+ slotDistCleanTarget();
+ }
+
+ else if ( r == idQmake )
+ {
+ m_part->startQMakeCommand( projectDirectory() + QString(QChar(QDir::separator())) + relpath );
+ }
+ else if ( r == idQmakeRecursive )
+ {
+ runQMakeRecursive( spitem );
+ }
+
+ else if ( r == idProjectConfiguration )
+ {
+ m_configDlg->updateSubproject( spitem );
+ m_configDlg->show();
+ }
+}
+
+void TrollProjectWidget::addFileToCurrentSubProject( GroupItem *titem, const QString &filename )
+{
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+ titem->addFileToScope( filename );
+}
+
+void TrollProjectWidget::addFileToCurrentSubProject( GroupItem::GroupType gtype, const QString &filename )
+{
+ if ( !m_shownSubproject )
+ return ;
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ GroupItem *gitem = 0;
+
+ if ( m_shownSubproject->groups.contains( gtype ) )
+ gitem = m_shownSubproject->groups[ gtype ];
+
+ if ( !gitem )
+ return ;
+
+ gitem->addFileToScope( filename );
+}
+
+/**
+* Method adds a file to the current project by grouped
+* by file extension
+*/
+void TrollProjectWidget::addFiles( QStringList &files, bool relativeToProjectRoot )
+{
+ if ( !m_shownSubproject )
+ return ;
+ kdDebug(9024) << "Files to add:"<<files << " " << relativeToProjectRoot <<endl;
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString fileName = *it;
+ kdDebug(9024) << "Adding file:" << fileName << " " << relativeToProjectRoot << endl;
+
+ if ( m_shownSubproject->scope->variableValues( "TEMPLATE" ).findIndex( "subdirs" ) != -1 && !fileName.endsWith(".pro") )
+ {
+ ChooseSubprojectDlg dlg( this, false );
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ if ( dlg.selectedSubproject() && dlg.selectedSubproject()->scope->variableValues("TEMPLATE").findIndex( "subdirs" ) != -1 )
+ {
+ fileName = URLUtil::getRelativePath( dlg.selectedSubproject()->scope->projectDir() ,
+ QDir::cleanDirPath(
+ m_shownSubproject->scope->projectDir()+
+ QString(QChar(QDir::separator()))+
+ fileName ) );
+ overview->setCurrentItem( dlg.selectedSubproject() );
+
+ }
+ }
+ else
+ {
+ KMessageBox::error( this, i18n("You did not select a subproject to add the file to, or select a subproject that has subdirs."), i18n( "File adding aborted" ) );
+ }
+ }
+
+ QFileInfo info( fileName );
+ QString ext = info.extension( false ).simplifyWhiteSpace();
+
+ QString noPathFileName;
+ if( relativeToProjectRoot )
+ noPathFileName = URLUtil::getRelativePath( m_shownSubproject->scope->projectDir(), QDir::cleanDirPath(projectDirectory()+QString(QChar(QDir::separator()))+fileName ) );
+ else
+ noPathFileName = URLUtil::getRelativePath( m_shownSubproject->scope->projectDir(), QDir::cleanDirPath(m_shownSubproject->scope->projectDir()+QString(QChar(QDir::separator()))+fileName ) );
+
+ if( DomUtil::readBoolEntry( *m_part->projectDom(), "/kdevtrollproject/qmake/replacePaths", false ) )
+ {
+ QString var = m_shownSubproject->scope->findCustomVarForPath( QFileInfo( noPathFileName ).dirPath() );
+ if( !var.isEmpty() )
+ {
+ noPathFileName = "$${"+var+"}"+QString( QChar( QDir::separator() ) )+QFileInfo( noPathFileName ).fileName();
+ }
+ }
+
+ kdDebug(9024) << "calc filename:" << noPathFileName << endl;
+// GroupItem *gitem = 0;
+// GroupItem::GroupType gtype = GroupItem::groupTypeForExtension( ext );
+// if ( m_shownSubproject->groups.contains( gtype ) )
+// gitem = m_shownSubproject->groups[ gtype ];
+
+
+ if( ext == "pro" )
+ {
+ addSubprojectToItem( findSubprojectForPath( QFileInfo( fileName ).dirPath() ), QFileInfo( fileName ).fileName() );
+ }else
+ {
+ addFileToCurrentSubProject( GroupItem::groupTypeForExtension( ext ), noPathFileName );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ kdDebug(9024) << "emitting" << relativeToProjectRoot << " " << fileName << endl;
+ if( relativeToProjectRoot )
+ emitAddedFile ( projectDirectory()+QString( QChar( QDir::separator() ) ) + fileName );
+ else
+ emitAddedFile ( m_shownSubproject->scope->projectDir()+QString( QChar( QDir::separator() ) ) + fileName );
+ }
+ }
+
+}
+
+
+void TrollProjectWidget::slotAddFiles()
+{
+ static KURL lastVisited;
+ QString cleanSubprojectDir = QDir::cleanDirPath( m_shownSubproject->scope->projectDir() );
+ QString title, filter;
+ QString otherTitle, otherFilter;
+
+ GroupItem* item = dynamic_cast<GroupItem*>( details->selectedItem() );
+ GroupItem::GroupType type = item ? item->groupType : GroupItem::NoType;
+ GroupItem::groupTypeMeanings( type, title, filter );
+ filter += "|" + title;
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ for ( int i = GroupItem::NoType + 1; i < GroupItem::MaxTypeEnum; ++i )
+ {
+ if ( type != i )
+ {
+ GroupItem::groupTypeMeanings( static_cast<GroupItem::GroupType>( i ), otherTitle, otherFilter );
+ filter += "\n" + otherFilter + "|" + otherTitle;
+ }
+ }
+
+ filter += "\n*|" + i18n( "All Files" );
+
+ AddFilesDialog *dialog = new AddFilesDialog( cleanSubprojectDir,
+ filter,
+ this,
+ "Insert existing files",
+ true, new QComboBox( false ) );
+
+ dialog->setMode( KFile::Files | KFile::ExistingOnly | KFile::LocalOnly );
+
+ if ( !lastVisited.isEmpty() )
+ {
+ dialog->setURL( lastVisited );
+ }
+
+ dialog->exec();
+ QStringList files = dialog->selectedFiles();
+ lastVisited = dialog->baseURL();
+
+ for ( unsigned int i = 0; i < files.count(); i++ )
+ {
+ switch ( dialog->mode() )
+ {
+ case AddFilesDialog::Copy:
+ {
+ // Copy selected files to current subproject folder
+ // and add them to the filelist
+ QString filename = KURL( files[ i ] ).fileName();
+ KIO::NetAccess::file_copy( files[ i ], cleanSubprojectDir + QString( QChar( QDir::separator() ) ) + filename, -1, false, false, this );
+ QFile testExist( cleanSubprojectDir + QString( QChar( QDir::separator() ) ) + filename );
+
+ if ( testExist.exists() )
+ {
+ QStringList files( filename );
+ addFiles( files, false );
+ }
+ }
+ break;
+
+ case AddFilesDialog::Link:
+ {
+ // Link selected files to current subproject folder
+ KProcess *proc = new KProcess( this );
+ *proc << "ln";
+ *proc << "-s";
+ *proc << files[ i ];
+ *proc << cleanSubprojectDir;
+ proc->start(KProcess::Block);
+ QString filename = files[ i ].right( files[ i ].length() - files[ i ].findRev( '/' ) - 1 );
+ // and add them to the filelist
+ QFile testExist( cleanSubprojectDir + QString( QChar( QDir::separator() ) ) + filename );
+ if ( testExist.exists() )
+ {
+ QStringList files( filename );
+ addFiles( files, false );
+ }
+ }
+ break;
+
+ case AddFilesDialog::Relative:
+ {
+ // Form relative path to current subproject folder
+ QString theFile = files[ i ];
+ QStringList files( URLUtil::relativePathToFile( cleanSubprojectDir , theFile )
+ );
+ addFiles( files, false );
+ }
+ break;
+ }
+ }
+}
+
+GroupItem* TrollProjectWidget::getInstallRoot( QMakeScopeItem* item )
+{
+ if ( item->groups.contains( GroupItem::InstallRoot ) )
+ return item->groups[ GroupItem::InstallRoot ];
+ return 0;
+}
+
+GroupItem* TrollProjectWidget::getInstallObject( QMakeScopeItem* item, const QString& objectname )
+{
+ GroupItem * instroot = getInstallRoot( item );
+ if ( !instroot )
+ return 0;
+ QPtrListIterator<GroupItem> it( instroot->installs );
+ for ( ;it.current();++it )
+ {
+ if ( ( *it ) ->groupType == GroupItem::InstallObject &&
+ ( *it ) ->text( 0 ) == objectname )
+ return * it;
+ }
+ return 0;
+
+}
+
+void TrollProjectWidget::slotNewFile()
+{
+ GroupItem * gitem = dynamic_cast<GroupItem*>( details->currentItem() );
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ if( !gitem )
+ {
+ gitem = dynamic_cast<GroupItem*>( details->currentItem()->parent() );
+ }
+
+ if ( gitem )
+ {
+ if ( gitem->groupType == GroupItem::InstallObject )
+ {
+ // QString relpath = m_shownSubproject->path.mid(projectDirectory().length());
+ bool ok = FALSE;
+ QString filepattern = KInputDialog::getText(
+ i18n( "Insert New Filepattern" ),
+ i18n( "Please enter a filepattern relative the current "
+ "subproject (example docs/*.html):" ),
+ QString::null, &ok, this );
+ if ( ok && !filepattern.isEmpty() )
+ {
+ addFileToCurrentSubProject( gitem, filepattern );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ return ;
+ }
+ if ( gitem->groupType == GroupItem::InstallRoot )
+ {
+ // QString relpath = m_shownSubproject->path.mid(projectDirectory().length());
+ bool ok = FALSE;
+ QString install_obj = KInputDialog::getText(
+ i18n( "Insert New Install Object" ),
+ i18n( "Please enter a name for the new object:" ),
+ QString::null, &ok, this );
+ if ( ok && !install_obj.isEmpty() )
+ {
+ gitem->addInstallObject( install_obj );
+ //GroupItem * institem = createGroupItem( GroupItem::InstallObject, install_obj , m_shownSubproject );
+ //gitem->owner->scope->addToPlusOp("INSTALLS", install_obj);
+ gitem->owner->scope->saveToFile();
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ return ;
+ }
+ }
+ KDevCreateFile * createFileSupport = m_part->extension<KDevCreateFile>( "KDevelop/CreateFile" );
+ QString fcext;
+ if( gitem )
+ {
+ switch ( gitem->groupType )
+ {
+ case GroupItem::Sources:
+ fcext = "cpp";
+ break;
+ case GroupItem::Headers:
+ fcext = "h";
+ break;
+ case GroupItem::Forms:
+ if ( !m_part->isQt4Project() )
+ fcext = "ui-widget";
+ else
+ fcext = "ui-widget-qt4";
+ break;
+ case GroupItem::Translations:
+ fcext = "ts";
+ break;
+ case GroupItem::Lexsources:
+ fcext = "l";
+ break;
+ case GroupItem::Yaccsources:
+ fcext = "y";
+ break;
+ case GroupItem::Resources:
+ fcext = "qrc";
+ break;
+ default:
+ fcext = QString::null;
+ }
+ }
+ KDevCreateFile::CreatedFile crFile =
+ createFileSupport->createNewFile( fcext, projectDirectory() + QString(QChar(QDir::separator()))+ m_shownSubproject->relativePath() );
+}
+
+void TrollProjectWidget::slotRemoveFile()
+{
+ QListViewItem * selectedItem = details->currentItem();
+ if ( !selectedItem )
+ return ;
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ qProjectItem *pvitem = static_cast<qProjectItem*>( selectedItem );
+ // Check that it is a file (just in case)
+ if ( pvitem->type() != qProjectItem::File )
+ return ;
+ FileItem *fitem = static_cast<FileItem*>( pvitem );
+ removeFile( m_shownSubproject, fitem );
+}
+
+void TrollProjectWidget::slotExcludeFileFromScopeButton()
+{
+ QListViewItem * selectedItem = details->currentItem();
+ if ( !selectedItem )
+ return ;
+ qProjectItem *pvitem = static_cast<qProjectItem*>( selectedItem );
+ // Check that it is a file (just in case)
+ if ( pvitem->type() != qProjectItem::File )
+ return ;
+ FileItem *fitem = static_cast<FileItem*>( pvitem );
+
+ GroupItem *gitem = static_cast<GroupItem*>( fitem->parent() );
+
+ gitem->removeFileFromScope( fitem->text( 0 ) );
+}
+
+void TrollProjectWidget::slotDetailsSelectionChanged( QListViewItem *item )
+{
+ if ( !item )
+ {
+ removefileButton->setEnabled( false );
+ excludeFileFromScopeButton->setEnabled( false );
+ return ;
+ }
+ removefileButton->setEnabled( false );
+ excludeFileFromScopeButton->setEnabled( false );
+
+ qProjectItem *pvitem = static_cast<qProjectItem*>( item );
+ if ( pvitem->type() == qProjectItem::Group )
+ {
+ GroupItem * gitem = static_cast<GroupItem*>( item );
+ if ( gitem->groupType == GroupItem::InstallObject )
+ {
+ excludeFileFromScopeButton->setEnabled( true );
+ newfileButton->setEnabled( true );
+ }
+ else if ( gitem->groupType == GroupItem::InstallRoot )
+ {
+ newfileButton->setEnabled( true );
+ }
+ else
+ {
+ addfilesButton->setEnabled( true );
+ newfileButton->setEnabled( true );
+ }
+
+
+ }
+ else if ( pvitem->type() == qProjectItem::File )
+ {
+ removefileButton->setEnabled( true );
+ excludeFileFromScopeButton->setEnabled( true );
+ /* buildTargetButton->setEnabled(true);
+ rebuildTargetButton->setEnabled(true);
+ executeTargetButton->setEnabled(true);*/
+ }
+}
+
+void TrollProjectWidget::slotDetailsContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ if ( !item )
+ return ;
+
+ qProjectItem *pvitem = static_cast<qProjectItem*>( item );
+ if ( pvitem->type() == qProjectItem::Group )
+ {
+ GroupItem * titem = static_cast<GroupItem*>( pvitem );
+ QString title, ext;
+ GroupItem::groupTypeMeanings( titem->groupType, title, ext );
+
+ KPopupMenu popup( this );
+ popup.insertTitle( title );
+
+ int idInsExistingFile = -2;
+ int idInsNewFile = -2;
+ int idInsInstallObject = -2;
+ int idInsNewFilepatternItem = -2;
+ int idSetInstObjPath = -2;
+ int idLUpdate = -2;
+ int idLRelease = -2;
+ int idRemoveFile = -2;
+
+ // int idFileProperties = popup.insertItem(SmallIconSet("filenew"),i18n("Properties..."));
+ if ( titem->groupType == GroupItem::InstallRoot )
+ {
+ idInsInstallObject = popup.insertItem( SmallIconSet( "fileopen" ), i18n( "Add Install Object..." ) );
+ popup.setWhatsThis( idInsInstallObject, i18n( "<b>Add install object</b><p>Creates QMake install object. "
+ "It is possible to define a list of files to install and installation locations for each object. Warning! "
+ "Install objects without path specified will not be saved to a project file." ) );
+ }
+ else if ( titem->groupType == GroupItem::InstallObject )
+ {
+ idSetInstObjPath = popup.insertItem( SmallIconSet( "fileopen" ), i18n( "Install Path..." ) );
+ popup.setWhatsThis( idSetInstObjPath, i18n( "<b>Install path</b><p>Allows to choose the installation path for the current install object." ) );
+ idInsNewFilepatternItem = popup.insertItem( SmallIconSet( "fileopen" ), i18n( "Add Pattern of Files to Install..." ) );
+ popup.setWhatsThis( idInsNewFilepatternItem, i18n( "<b>Add pattern of files to install</b><p>Defines the pattern to match files which will be installed. "
+ "It is possible to use wildcards and relative paths like <i>docs/*</i>." ) );
+ idRemoveFile = popup.insertItem( SmallIconSet( "editdelete" ), i18n( "Remove Install Object" ) );
+ popup.setWhatsThis( idRemoveFile, i18n( "<b>Remove install object</b><p>Removes the install object the current group." ) );
+ }
+ else if ( titem->groupType == GroupItem::Translations )
+ {
+ idInsNewFile = popup.insertItem( SmallIconSet( "filenew" ), i18n( "Create New File..." ) );
+ popup.setWhatsThis( idInsNewFile, i18n( "<b>Create new file</b><p>Creates a new translation file and adds it to a currently selected TRANSLATIONS group." ) );
+ idInsExistingFile = popup.insertItem( SmallIconSet( "fileopen" ), i18n( "Add Existing Files..." ) );
+ popup.setWhatsThis( idInsExistingFile, i18n( "<b>Add existing files</b><p>Adds existing translation (*.ts) files to a currently selected TRANSLATIONS group. It is "
+ "possible to copy files to a current subproject directory, create symbolic links or "
+ "add them with the relative path." ) );
+ idLUpdate = popup.insertItem( SmallIconSet( "konsole" ), i18n( "Update Translation Files" ) );
+ popup.setWhatsThis( idLUpdate, i18n( "<b>Update Translation Files</b><p>Runs <b>lupdate</b> command from the current subproject directory. It collects translatable "
+ "messages and saves them into translation files." ) );
+ idLRelease = popup.insertItem( SmallIconSet( "konsole" ), i18n( "Release Binary Translations" ) );
+ popup.setWhatsThis( idLRelease, i18n( "<b>Release Binary Translations</b><p>Runs <b>lrelease</b> command from the current subproject directory. It creates binary "
+ "translation files that are ready to be loaded at program execution." ) );
+ }
+ else // File group containing files
+ {
+ idInsNewFile = popup.insertItem( SmallIconSet( "filenew" ), i18n( "Create New File..." ) );
+ popup.setWhatsThis( idInsNewFile, i18n( "<b>Create new file</b><p>Creates a new file and adds it to a currently selected group." ) );
+ idInsExistingFile = popup.insertItem( SmallIconSet( "fileopen" ), i18n( "Add Existing Files..." ) );
+ popup.setWhatsThis( idInsExistingFile, i18n( "<b>Add existing files</b><p>Adds existing files to a currently selected group. It is "
+ "possible to copy files to a current subproject directory, create symbolic links or "
+ "add them with the relative path." ) );
+ }
+ int r = popup.exec( p );
+ QString cleanSubprojectPath = QDir::cleanDirPath( m_shownSubproject->scope->projectDir() );
+
+ if ( r == idSetInstObjPath )
+ {
+ KURLRequesterDlg dialog( i18n( "Choose Install Path" ), i18n( "Enter a path "
+ "(example /usr/local/share/... ):" ), this, 0 );
+ dialog.urlRequester() ->setMode( KFile::Directory );
+ dialog.urlRequester() ->setURL( titem->owner->scope->variableValues( titem->text( 0 ) + ".path" ).front() );
+ if ( dialog.exec() == QDialog::Accepted )
+ {
+ titem->owner->scope->setEqualOp( titem->text( 0 ) + ".path", dialog.urlRequester() ->url() );
+ titem->owner->scope->saveToFile( );
+ }
+ }
+ else if ( r == idInsNewFilepatternItem )
+ {
+ bool ok = FALSE;
+ QString filepattern = KInputDialog::getText(
+ i18n( "Add Pattern of Files to Install" ),
+ i18n( "Enter a pattern relative to the current "
+ "subproject (example docs/*.html):" ),
+ QString::null, &ok, this );
+ if ( ok && !filepattern.isEmpty() )
+ {
+ addFileToCurrentSubProject( titem, filepattern );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }
+ else if ( r == idInsExistingFile )
+ {
+ AddFilesDialog * dialog = new AddFilesDialog( cleanSubprojectPath,
+ ext + "|" + title + " (" + ext + ")",
+ this,
+ "Add existing files",
+ true, new QComboBox( false ) );
+ dialog->setMode( KFile::Files | KFile::ExistingOnly | KFile::LocalOnly );
+ if ( dialog->exec() == QDialog::Rejected )
+ return ;
+ QStringList files = dialog->selectedFiles();
+ for ( unsigned int i = 0;i < files.count();++i )
+ {
+ switch ( dialog->mode() )
+ {
+ case AddFilesDialog::Copy:
+ {
+ // Copy selected files to current subproject folder
+ // and add them to the filelist
+ QString filename = KURL( files[ i ] ).fileName();
+ KIO::NetAccess::file_copy( files[ i ], cleanSubprojectPath + QString( QChar( QDir::separator() ) ) + filename, -1, false, false, this );
+ QFile testExist( cleanSubprojectPath + QString( QChar( QDir::separator() ) ) + filename );
+
+ if ( testExist.exists() )
+ {
+ QStringList files( filename );
+ addFiles( files, false );
+ }
+ }
+ break;
+
+ case AddFilesDialog::Link:
+ {
+ // Link selected files to current subproject folder
+ KProcess *proc = new KProcess( this );
+ *proc << "ln";
+ *proc << "-s";
+ *proc << files[ i ];
+ *proc << cleanSubprojectPath;
+ proc->start(KProcess::Block);
+ QString filename = files[ i ].right( files[ i ].length() - files[ i ].findRev( '/' ) - 1 );
+ // and add them to the filelist
+ QFile testExist( cleanSubprojectPath + QString( QChar( QDir::separator() ) ) + filename );
+ if ( testExist.exists() )
+ {
+ QStringList files( filename );
+ addFiles( files, false );
+ }
+ }
+ break;
+
+ case AddFilesDialog::Relative:
+ {
+ // Form relative path to current subproject folder
+ QString theFile = files[ i ];
+ QStringList files( URLUtil::relativePathToFile( cleanSubprojectPath, theFile )
+ );
+ addFiles( files, false );
+ }
+ break;
+ }
+ }
+ // Update project file
+ if ( titem && titem->owner )
+ {
+ titem->owner->scope->saveToFile( );
+ }
+ // Update subprojectview
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ else if ( r == idInsNewFile )
+ {
+ KDevCreateFile * createFileSupport = m_part->extension<KDevCreateFile>( "KDevelop/CreateFile" );
+ QString fcext;
+ switch ( titem->groupType )
+ {
+ case GroupItem::Sources:
+ fcext = "cpp";
+ break;
+ case GroupItem::Headers:
+ fcext = "h";
+ break;
+ case GroupItem::Forms:
+ if ( !m_part->isQt4Project() )
+ fcext = "ui-widget";
+ else
+ fcext = "ui-widget-qt4";
+ break;
+ case GroupItem::Translations:
+ fcext = "ts";
+ break;
+ case GroupItem::Lexsources:
+ fcext = "l";
+ break;
+ case GroupItem::Yaccsources:
+ fcext = "y";
+ break;
+ case GroupItem::Resources:
+ fcext = "qrc";
+ break;
+ default:
+ fcext = QString::null;
+ }
+ KDevCreateFile::CreatedFile crFile =
+ createFileSupport->createNewFile( fcext, cleanSubprojectPath );
+
+ }
+ else if ( r == idInsInstallObject )
+ {
+ bool ok = FALSE;
+ QString install_obj = KInputDialog::getText(
+ i18n( "Add Install Object" ),
+ i18n( "Enter a name for the new object:" ),
+ QString::null, &ok, this );
+ if ( ok && !install_obj.isEmpty() )
+ {
+ titem->addInstallObject( install_obj );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }
+ else if ( r == idLUpdate )
+ {
+ QString cmd = "lupdate ";
+ cmd += m_shownSubproject->scope->fileName();
+ m_part->appFrontend() ->startAppCommand( m_shownSubproject->scope->projectDir(), cmd, false );
+ }
+ else if ( r == idLRelease )
+ {
+ QString cmd = "lrelease ";
+ cmd += m_shownSubproject->scope->fileName();
+ m_part->appFrontend() ->startAppCommand( m_shownSubproject->scope->projectDir(), cmd, false );
+ }else if( r == idRemoveFile )
+ {
+ static_cast<GroupItem*>(titem->parent())->removeInstallObject( titem );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }
+ else if ( pvitem->type() == qProjectItem::File )
+ {
+
+ removefileButton->setEnabled( true );
+ FileItem *fitem = static_cast<FileItem*>( pvitem );
+ GroupItem* gitem = static_cast<GroupItem*>( item->parent() );
+
+ KPopupMenu popup( this );
+ if ( !( gitem->groupType == GroupItem::InstallObject ) )
+ popup.insertTitle( i18n( "File: %1" ).arg( fitem->text( 0 ) ) );
+ else
+ popup.insertTitle( i18n( "Pattern: %1" ).arg( fitem->text( 0 ) ) );
+
+ int idRemoveFile = -2;
+ int idSubclassWidget = -2;
+ int idUpdateWidgetclass = -2;
+ int idBuildFile = -2;
+ int idUISubclasses = -2;
+ int idViewUIH = -2;
+ int idFileProperties = -2;
+ int idEditInstallPattern = -2;
+
+ if ( !fitem->uiFileLink.isEmpty() )
+ {
+ idUpdateWidgetclass = popup.insertItem( SmallIconSet( "qmake_subclass" ), i18n( "Edit ui-Subclass..." ) );
+ popup.setWhatsThis( idUpdateWidgetclass, i18n( "<b>Edit ui-subclass</b><p>Launches <b>Subclassing</b> wizard "
+ "and prompts to implement missing in childclass slots and functions." ) );
+ }
+ if ( fitem->text( 0 ).contains( ".ui" ) )
+ {
+ idSubclassWidget = popup.insertItem( SmallIconSet( "qmake_subclass" ), i18n( "Subclassing Wizard..." ) );
+ popup.setWhatsThis( idSubclassWidget, i18n( "<b>Subclass widget</b><p>Launches <b>Subclassing</b> wizard. "
+ "It allows to create a subclass from the class defined in .ui file. "
+ "There is also possibility to implement slots and functions defined in the base class." ) );
+ if ( !m_part->isQt4Project() )
+ {
+ idViewUIH = popup.insertItem( SmallIconSet( "qmake_ui_h" ), i18n( "Open ui.h File" ) );
+ popup.setWhatsThis( idViewUIH, i18n( "<b>Open ui.h file</b><p>Opens .ui.h file associated with the selected .ui." ) );
+ }
+ idUISubclasses = popup.insertItem( SmallIconSet( "qmake_subclass" ), i18n( "List of Subclasses..." ) );
+ popup.setWhatsThis( idUISubclasses, i18n( "<b>List of subclasses</b><p>Shows subclasses list editor. "
+ "There is possibility to add or remove subclasses from the list." ) );
+ }
+ if ( !( gitem->groupType == GroupItem::InstallObject ) )
+ {
+ idRemoveFile = popup.insertItem( SmallIconSet( "editdelete" ), i18n( "Remove File" ) );
+ popup.setWhatsThis( idRemoveFile, i18n( "<b>Remove file</b><p>Removes file from a current group. For sources, this also removes the subclassing information." ) );
+ idFileProperties = popup.insertItem( SmallIconSet( "configure_file" ), i18n( "Exclude File" ) );
+ popup.setWhatsThis( idFileProperties, i18n( "<b>Exclude File</b><p>Excludes the file from this Scope. Does not touch subclassing information" ) );
+ }
+ else
+ {
+ idEditInstallPattern = popup.insertItem( SmallIconSet( "configure_file" ), i18n( "Edit Pattern" ) );
+ popup.setWhatsThis( idEditInstallPattern, i18n( "<b>Edit pattern</b><p>Allows to edit install files pattern." ) );
+ idRemoveFile = popup.insertItem( SmallIconSet( "editdelete" ), i18n( "Remove Pattern" ) );
+ popup.setWhatsThis( idRemoveFile, i18n( "<b>Remove pattern</b><p>Removes install files pattern from the current install object." ) );
+ }
+ if ( !( gitem->groupType == GroupItem::InstallObject ) )
+ {
+ KURL::List urls;
+ urls.append( m_shownSubproject->scope->projectDir() + QChar( QDir::separator() ) + m_shownSubproject->scope->resolveVariables( fitem->localFilePath ) );
+ FileContext context( urls );
+ m_part->core() ->fillContextMenu( &popup, &context );
+ }
+ if ( gitem->groupType == GroupItem::Sources )
+ {
+ idBuildFile = popup.insertItem( SmallIconSet( "make_kdevelop" ), i18n( "Build File" ) );
+ popup.setWhatsThis( idBuildFile, i18n( "<b>Build File</b><p>Builds the object file for this source file." ) );
+ }
+
+ int r = popup.exec( p );
+ if ( r == idRemoveFile )
+ removeFile( m_shownSubproject, fitem );
+ else if ( r == idFileProperties )
+ {
+ slotExcludeFileFromScopeButton();
+ }
+ else if ( r == idViewUIH )
+ {
+ kdDebug(9024) << "Opening:" << fitem->text(0) << ";" << fitem->text(0).replace(".ui","") << endl;
+ m_part->partController() ->editDocument( KURL( m_shownSubproject->scope->projectDir() + QChar( QDir::separator() ) +
+ fitem->localFilePath.replace(".ui","") + ".h" ) );
+
+ }
+ else if ( r == idSubclassWidget )
+ {
+ QStringList newFileNames;
+ newFileNames = m_part->languageSupport() ->subclassWidget( m_shownSubproject->scope->projectDir() + QChar( QDir::separator() ) + fitem->localFilePath );
+ kdDebug(9024) << "got new filenames: " << newFileNames << endl;
+ if ( !newFileNames.empty() )
+ {
+ QDomDocument & dom = *( m_part->projectDom() );
+ for ( uint i = 0; i < newFileNames.count(); ++i )
+ {
+ QString srcfile_relpath = URLUtil::getRelativePath( m_shownSubproject->scope->projectDir(), newFileNames[ i ] ) ;
+ newFileNames[i] = URLUtil::getRelativePath( projectDirectory(), newFileNames[ i ] ) ;
+ QString uifile_relpath = m_shownSubproject->relativePath() + QChar( QDir::separator() ) + fitem->localFilePath;
+ DomUtil::PairList list = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+
+ list << DomUtil::Pair( srcfile_relpath, uifile_relpath );
+ DomUtil::writePairListEntry( dom, "/kdevtrollproject/subclassing", "subclass", "sourcefile", "uifile", list );
+ // newFileNames[i] = newFileNames[i].replace(QRegExp(projectDirectory()+"/"),"");
+ qWarning( "new file: %s", newFileNames[ i ].latin1() );
+ }
+ m_subclasslist = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+
+ m_part->addFiles( newFileNames );
+ }
+ }
+ else if ( r == idUpdateWidgetclass )
+ {
+ QString noext = fitem->text( 0 );
+ if ( noext.findRev( '.' ) > -1 )
+ noext = noext.left( noext.findRev( '.' ) );
+ QStringList dummy;
+ QString uifile = fitem->uiFileLink;
+ if ( uifile.findRev( QString( QChar( QDir::separator() ) ) ) > -1 )
+ {
+ QStringList uisplit = QStringList::split( QString( QChar( QDir::separator() ) ), uifile );
+ uifile = uisplit[ uisplit.count() - 1 ];
+ }
+ m_part->languageSupport() ->updateWidget( m_shownSubproject->scope->projectDir() + QString( QChar( QDir::separator() ) ) + uifile, noext );
+ }
+ else if ( r == idUISubclasses )
+ {
+ QDomDocument & dom = *( m_part->projectDom() );
+ DomUtil::PairList list = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+ SubclassesDlg *sbdlg = new SubclassesDlg( m_shownSubproject->relativePath() + QChar( QDir::separator() ) + fitem->localFilePath,
+ list, projectDirectory() );
+
+ if ( sbdlg->exec() )
+ {
+ QDomElement el = DomUtil::elementByPath( dom, "/kdevtrollproject" );
+ QDomElement el2 = DomUtil::elementByPath( dom, "/kdevtrollproject/subclassing" );
+ if ( ( !el.isNull() ) && ( !el2.isNull() ) )
+ {
+ el.removeChild( el2 );
+ }
+
+ DomUtil::writePairListEntry( dom, "/kdevtrollproject/subclassing", "subclass", "sourcefile", "uifile", list );
+
+ m_subclasslist = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+ }
+ }
+ else if ( r == idEditInstallPattern )
+ {
+ GroupItem * titem = static_cast<GroupItem*>( item->parent() );
+
+ bool ok = FALSE;
+ QString filepattern = KInputDialog::getText(
+ i18n( "Edit Pattern" ),
+ i18n( "Enter a pattern relative to the current "
+ "subproject (example docs/*.html):" ),
+ fitem->text( 0 ) , &ok, this );
+ if ( ok && !filepattern.isEmpty() )
+ {
+ removeFile( m_shownSubproject, fitem );
+ addFileToCurrentSubProject( titem, filepattern );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }
+ else if ( r == idBuildFile )
+ {
+ buildFile( m_shownSubproject, fitem );
+ }
+ }
+}
+
+
+void TrollProjectWidget::removeFile( QMakeScopeItem *spitem, FileItem *fitem )
+{
+ GroupItem * gitem = static_cast<GroupItem*>( fitem->parent() );
+
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ QString realfilename = spitem->scope->resolveVariables( fitem->localFilePath );
+ if ( KMessageBox::warningYesNo( this,
+ "<qt>" +
+ i18n( "Do you want to delete the file <strong>%1</strong> from the project and your disk?" )
+ .arg( fitem->text( 0 ) ) +
+ "</qt>",
+ i18n( "Remove File" ),
+ KStdGuiItem::remove(),
+ KStdGuiItem::no(),
+ "deleteFileFromQMakeProject" ) == KMessageBox::No )
+ {
+ return;
+ }else
+ {
+ kdDebug(9024) << "Deleting file as the user wished: " << spitem->scope->projectDir() + QString( QChar( QDir::separator() ) ) + realfilename << endl;
+ KIO::NetAccess::del( KURL::fromPathOrURL( spitem->scope->projectDir() + QString( QChar( QDir::separator() ) ) + realfilename ), 0 );
+ }
+
+ if ( gitem->groupType != GroupItem::InstallObject )
+ {
+ QString removedFileName = spitem->relativePath() + QString( QChar( QDir::separator() ) ) + realfilename;
+ if ( removedFileName.startsWith( QDir::rootDirPath() ) )
+ removedFileName = removedFileName.mid( 1 );
+ emitRemovedFile( removedFileName );
+ }
+
+
+ //remove subclassing info
+ QDomDocument &dom = *( m_part->projectDom() );
+ DomUtil::PairList list = DomUtil::readPairListEntry( dom, "/kdevtrollproject/subclassing" ,
+ "subclass", "sourcefile", "uifile" );
+ QPtrList<DomUtil::Pair> pairsToRemove;
+ DomUtil::PairList::iterator it;
+ for ( it = list.begin(); it != list.end(); ++it )
+ {
+ if ( ( ( *it ).first == realfilename ) || ( ( *it ).second == realfilename ) )
+ {
+ pairsToRemove.append( &( *it ) );
+ }
+ }
+ DomUtil::Pair *pair;
+ for ( pair = pairsToRemove.first(); pair; pair = pairsToRemove.next() )
+ {
+ list.remove( *pair );
+ }
+ QDomElement el = DomUtil::elementByPath( dom, "/kdevtrollproject" );
+ QDomElement el2 = DomUtil::elementByPath( dom, "/kdevtrollproject/subclassing" );
+ if ( ( !el.isNull() ) && ( !el2.isNull() ) )
+ {
+ el.removeChild( el2 );
+ }
+ DomUtil::writePairListEntry( dom, "/kdevtrollproject/subclassing", "subclass", "sourcefile", "uifile", list );
+
+ gitem->removeFileFromScope( fitem->text( 0 ) );
+}
+
+void TrollProjectWidget::emitAddedFile( const QString &fileName )
+{
+ emit m_part->addedFilesToProject( QStringList( fileName ) );
+}
+
+
+void TrollProjectWidget::emitRemovedFile( const QString &fileName )
+{
+ emit m_part->removedFilesFromProject( QStringList( fileName ) );
+}
+
+
+QString TrollProjectWidget::getUiFileLink( const QString &relpath, const QString& filename )
+{
+ DomUtil::PairList::iterator it;
+ for ( it = m_subclasslist.begin();it != m_subclasslist.end(); ++it )
+ {
+ if ( ( *it ).first == relpath + filename )
+ return ( *it ).second;
+ }
+ return "";
+}
+
+void TrollProjectWidget::slotBuildOpenFile()
+{
+ KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( m_part->partController() ->activePart() );
+ if ( !part || !part->url().isLocalFile() )
+ return ;
+
+ QString fileName = part->url().path();
+ QFileInfo fi( fileName );
+ QString sourceDir = fi.dirPath();
+ QString baseName = fi.baseName( true );
+ kdDebug( 9024 ) << "Compiling " << fileName
+ << "in dir " << sourceDir
+ << " with baseName " << baseName << endl;
+
+
+ QString buildDir = sourceDir;
+ QString target = baseName + ".o";
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ // m_part->startMakeCommand(buildDir, target);
+
+ QPtrList<QMakeScopeItem> list = findSubprojectForFile( fi );
+
+ QMakeScopeItem *spitem;
+ for ( spitem = list.first(); spitem; spitem = list.next() )
+ {
+ QString buildcmd = constructMakeCommandLine( spitem->scope );
+ QString dircmd = "cd " + KProcess::quote( spitem->scope->projectDir() ) + " && " ;
+ kdDebug( 9024 ) << "builddir " << spitem->scope->projectDir() << ", cmd " << dircmd + buildcmd + " " + target << endl;
+ m_part->queueCmd( spitem->scope->projectDir(), dircmd + buildcmd + " " + target );
+ }
+
+ // startMakeCommand(buildDir, target);
+
+}
+
+
+void TrollProjectWidget::slotExecuteProject()
+{
+ QString program = m_part->mainProgram();
+ if ( program.isEmpty() )
+ {
+ KMessageBox::sorry( this, i18n( "Please specify the executable name in the "
+ "project options dialog or select an application subproject in the QMake Manager." ), i18n( "No Executable Found" ) );
+ return ;
+ }
+
+ //only run once
+ if (m_part->appFrontend()->isRunning())
+ {
+ if (KMessageBox::questionYesNo(this, i18n("Your application is currently running. Do you want to restart it?"), i18n("Application Already Running"), i18n("&Restart Application"), i18n("Do &Nothing")) == KMessageBox::No)
+ return;
+ m_part->appFrontend()->stopApplication();
+ while(m_part->appFrontend()->isRunning())
+ {
+ KApplication::kApplication()->processEvents();
+ usleep(100);
+ }
+ }
+
+ if ( !program.startsWith( QDir::rootDirPath() ) )
+ program.prepend( "." + QString( QChar( QDir::separator() ) ) );
+
+
+ // Build environment variables to prepend to the executable path
+ QString runEnvVars = QString::null;
+ DomUtil::PairList list =
+ DomUtil::readPairListEntry( *( m_part->projectDom() ), "/kdevtrollproject/run/envvars", "envvar", "name", "value" );
+
+ DomUtil::PairList::ConstIterator it;
+ for ( it = list.begin(); it != list.end(); ++it )
+ {
+ const DomUtil::Pair &pair = ( *it );
+ if ( ( !pair.first.isEmpty() ) && ( !pair.second.isEmpty() ) )
+ runEnvVars += pair.first + "=" + pair.second + " ";
+ }
+ program.prepend( runEnvVars );
+ program.append( " " + m_part->runArguments() + " " );
+
+ bool inTerminal = DomUtil::readBoolEntry( *( m_part->projectDom() ), "/kdevtrollproject/run/terminal" );
+ m_part->appFrontend() ->startAppCommand( m_part->runDirectory(), program, inTerminal );
+}
+
+
+void TrollProjectWidget::slotCleanProject()
+{
+ runClean(m_rootSubproject, "clean");
+}
+
+void TrollProjectWidget::slotCleanTarget()
+{
+ runClean(m_shownSubproject, "clean");
+}
+
+void TrollProjectWidget::slotDistCleanProject()
+{
+ runClean(m_rootSubproject, "distclean");
+
+}
+
+void TrollProjectWidget::slotDistCleanTarget()
+{
+ runClean(m_shownSubproject, "distclean");
+}
+
+void TrollProjectWidget::runClean( QMakeScopeItem* item, const QString& cleantargetname )
+{
+ // no subproject selected
+ m_part->partController() ->saveAllFiles();
+ if ( !item )
+ return ;
+ // can't build from scope
+ if ( item->scope->scopeType() != Scope::ProjectScope )
+ return ;
+
+ QString dir = item->scope->projectDir();
+ createMakefileIfMissing( dir, item );
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ QString dircmd = "cd " + KProcess::quote( dir ) + " && " ;
+ QString rebuildcmd = constructMakeCommandLine( item->scope ) + " "+cleantargetname;
+ m_part->queueCmd( dir, dircmd + rebuildcmd );
+}
+
+QString TrollProjectWidget::constructMakeCommandLine( Scope* s )
+{
+ QString makeFileName;
+ if ( s )
+ makeFileName = s->resolveVariables( s->variableValues( "MAKEFILE", true, true, true ).front() );
+
+ QDomDocument & dom = *( m_part->projectDom() );
+
+ QString cmdline = DomUtil::readEntry( dom, "/kdevtrollproject/make/makebin" );
+ if ( cmdline.isEmpty() )
+ cmdline = MAKE_COMMAND;
+ if ( !makeFileName.isEmpty() )
+ {
+ cmdline += " -f " + makeFileName;
+ }
+ if ( !DomUtil::readBoolEntry( dom, "/kdevtrollproject/make/abortonerror" ) )
+ cmdline += " -k";
+ bool runmultiple = DomUtil::readBoolEntry(dom, "/kdevtrollproject/make/runmultiplejobs");
+ int jobs = DomUtil::readIntEntry( dom, "/kdevtrollproject/make/numberofjobs" );
+ if ( jobs != 0 && runmultiple )
+ {
+ cmdline += " -j";
+ cmdline += QString::number( jobs );
+ }
+ if ( DomUtil::readBoolEntry( dom, "/kdevtrollproject/make/dontact" ) )
+ cmdline += " -n";
+
+ cmdline += " ";
+ cmdline.prepend( m_part->makeEnvironment() );
+
+ return cmdline;
+}
+
+
+void TrollProjectWidget::createMakefileIfMissing( const QString &dir, QMakeScopeItem *item )
+{
+ QFileInfo fi;
+ QFileInfo fi2;
+ kdDebug(9024) << "Makefile:" << item->scope->variableValues( "MAKEFILE", true, true, true ) << endl;
+ if ( item->scope->variableValues( "MAKEFILE", true, true, true ).isEmpty() )
+ {
+ fi.setFile( dir + QString( QChar( QDir::separator() ) ) + "Makefile" );
+ fi2.setFile( dir + QString( QChar( QDir::separator() ) ) + "makefile" );
+ }
+ else
+ {
+ QString realmf = item->scope->resolveVariables( item->scope->variableValues( "MAKEFILE", true, true, true ).front() );
+ fi.setFile( realmf );
+ fi2.setFile( dir + QString( QChar( QDir::separator() ) ) + realmf );
+ }
+ if ( !fi.exists() && !fi2.exists() )
+ {
+ int r = KMessageBox::questionYesNo( this, i18n( "There is no Makefile in this directory. Run qmake first?" ), QString::null, i18n( "Run qmake" ), i18n( "Do Not Run" ) );
+ if ( r == KMessageBox::No )
+ return ;
+ m_part->startQMakeCommand( dir );
+ }
+}
+
+QMakeScopeItem* TrollProjectWidget::findSubprojectForPath( const QString& relPath )
+{
+ if( !m_rootSubproject )
+ return 0;
+ QStringList dirs = QStringList::split("/", relPath);
+ QMakeScopeItem* pitem = static_cast<QMakeScopeItem*>(m_rootSubproject);
+ for( QStringList::iterator it = dirs.begin(); it != dirs.end(); ++it)
+ {
+ QListViewItem* item = pitem->firstChild();
+ while( item )
+ {
+ QMakeScopeItem* sitem = static_cast<QMakeScopeItem*>(item);
+ if( QFileInfo( sitem->scope->projectDir() ).fileName() == *it )
+ {
+ pitem = sitem;
+ break;
+ }
+ }
+ }
+ return pitem;
+}
+
+QPtrList<QMakeScopeItem> TrollProjectWidget::findSubprojectForFile( QFileInfo fi )
+{
+ QPtrList<QMakeScopeItem> list;
+ findSubprojectForFile( list, m_rootSubproject, fi.absFilePath() );
+ return list;
+}
+
+void TrollProjectWidget::findSubprojectForFile( QPtrList<QMakeScopeItem> &list, QMakeScopeItem * item, QString absFilePath )
+{
+ if( !item )
+ return;
+
+ QDir d( item->scope->projectDir() );
+
+ QStringList vars = item->scope->variableValues( "SOURCES" );
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it )
+ {
+ QFileInfo fi2( d, item->scope->resolveVariables( *it ) );
+ if ( absFilePath == fi2.absFilePath() )
+ list.append( item );
+ }
+
+ vars = item->scope->variableValues( "HEADERS" );
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it )
+ {
+ QFileInfo fi2( d, item->scope->resolveVariables( *it ) );
+ if ( absFilePath == fi2.absFilePath() )
+ list.append( item );
+ }
+
+ QListViewItem * child = item->firstChild();
+ while ( child )
+ {
+ QMakeScopeItem * spitem = dynamic_cast<QMakeScopeItem*>( child );
+
+ if ( spitem )
+ {
+ findSubprojectForFile( list, spitem, absFilePath );
+ }
+
+ child = child->nextSibling();
+ }
+}
+
+void TrollProjectWidget::slotRemoveScope( QMakeScopeItem * spitem )
+{
+ if ( spitem == 0 && m_shownSubproject == 0 )
+ return ;
+ else
+ {
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ QMakeScopeItem* pitem = dynamic_cast<QMakeScopeItem *>( spitem->parent() );
+ if ( pitem != 0 )
+ {
+ switch ( spitem->scope->scopeType() )
+ {
+ case Scope::FunctionScope:
+ if( !pitem->scope->deleteFunctionScope( spitem->scope->getNum() ) )
+ {
+ KMessageBox::error(this, i18n("Could not delete Function Scope.\nThis is an internal error, please write a bug report to bugs.kde.org and include the output of kdevelop when run from a shell."),i18n("Function Scope Deletion failed"));
+ return;
+ }
+ // pitem->scopes.remove( spitem );
+ break;
+ case Scope::IncludeScope:
+ if( !pitem->scope->deleteIncludeScope( spitem->scope->getNum() ) )
+ {
+ KMessageBox::error(this, i18n("Could not delete Include Scope.\nThis is an internal error, please write a bug report to bugs.kde.org and include the output of kdevelop when run from a shell."),i18n("Include Scope Deletion failed"));
+ return;
+ }
+ // pitem->scopes.remove( spitem );
+ delete spitem;
+ spitem = pitem;
+ pitem = dynamic_cast<QMakeScopeItem *>( pitem->parent() );
+ // pitem->scopes.remove(spitem);
+ break;
+ case Scope::SimpleScope:
+ if( !pitem->scope->deleteSimpleScope( spitem->scope->getNum() ) )
+ {
+ KMessageBox::error(this, i18n("Could not delete Scope.\nThis is an internal error, please write a bug report to bugs.kde.org and include the output of kdevelop when run from a shell."),i18n("Scope Deletion failed"));
+ return;
+ }
+ // pitem->scopes.remove( spitem );
+ break;
+ default:
+ break;
+ }
+ pitem->scope->saveToFile();
+ delete spitem;
+ m_shownSubproject = pitem;
+ overview->setCurrentItem ( m_shownSubproject );
+ overview->setSelected( m_shownSubproject, true );
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }
+}
+
+QMakeScopeItem * TrollProjectWidget::findSubprojectForScope( QMakeScopeItem * scope )
+{
+ if ( ( scope == 0 ) || ( scope->parent() == 0 ) )
+ return 0;
+ if ( scope->scope->scopeType() == Scope::ProjectScope )
+ return scope;
+ return findSubprojectForScope( dynamic_cast<QMakeScopeItem *>( scope->parent() ) );
+}
+
+void TrollProjectWidget::focusInEvent( QFocusEvent * /*e*/ )
+{
+ switch ( m_lastFocusedView )
+ {
+ case DetailsView:
+ details->setFocus();
+ break;
+ case SubprojectView:
+ default:
+ overview->setFocus();
+ }
+}
+
+void TrollProjectWidget::setLastFocusedView( TrollProjectView view )
+{
+ m_lastFocusedView = view;
+}
+
+void TrollProjectWidget::runQMakeRecursive( QMakeScopeItem* proj )
+{
+ if( m_part->isQt4Project() )
+ {
+ m_part->startQMakeCommand( proj->scope->projectDir(), true );
+ }else
+ {
+ if ( proj->scope->scopeType() == Scope::ProjectScope )
+ {
+ m_part->startQMakeCommand( proj->scope->projectDir() );
+ }
+ QMakeScopeItem* item = static_cast<QMakeScopeItem*>( proj->firstChild() );
+ while ( item )
+ {
+ runQMakeRecursive( item );
+ item = static_cast<QMakeScopeItem*>( item->nextSibling() );
+ }
+ }
+}
+
+void TrollProjectWidget::slotBuildSelectedFile()
+{
+ QListViewItem * selectedItem = details->currentItem();
+ if ( !selectedItem )
+ return ;
+ qProjectItem *pvitem = static_cast<qProjectItem*>( selectedItem );
+ // Check that it is a file (just in case)
+ if ( pvitem->type() != qProjectItem::File )
+ return ;
+ FileItem *fitem = static_cast<FileItem*>( pvitem );
+ buildFile( m_shownSubproject, fitem );
+}
+
+void TrollProjectWidget::buildFile( QMakeScopeItem* spitem, FileItem* fitem )
+{
+ QFileInfo fi( spitem->scope->projectDir() + QChar( QDir::separator() ) + spitem->scope->resolveVariables( fitem->localFilePath ) );
+ QString sourceDir = fi.dirPath();
+ QString baseName = fi.baseName( true );
+ kdDebug( 9024 ) << "Compiling " << spitem->scope->resolveVariables( fitem->text( 0 ) )
+ << "in dir " << sourceDir
+ << " with baseName " << baseName << endl;
+
+ QString buildDir = sourceDir;
+ QString target = baseName + ".o";
+ if( !spitem->scope->variableValues("OBJECTS_DIR").isEmpty() )
+ target = spitem->scope->resolveVariables( spitem->scope->variableValues("OBJECTS_DIR").first() )+ QString( QChar( QDir::separator() ) )+target;
+ kdDebug( 9024 ) << "builddir " << buildDir << ", target " << target << endl;
+
+ m_part->mainWindow() ->raiseView( m_part->makeFrontend() ->widget() );
+ // m_part->startMakeCommand(buildDir, target);
+
+ QString buildcmd = constructMakeCommandLine( spitem->scope );
+ QString dircmd = "cd " + KProcess::quote( spitem->scope->projectDir() ) + " && " ;
+ kdDebug( 9024 ) << "builddir " << spitem->scope->projectDir() << ", cmd " << dircmd + buildcmd + " " + target << endl;
+ m_part->queueCmd( spitem->scope->projectDir(), dircmd + buildcmd + " " + target );
+
+
+ // startMakeCommand(buildDir, target);
+
+}
+
+TrollProjectWidget::SaveType TrollProjectWidget::dialogSaveBehaviour() const
+{
+ switch ( DomUtil::readIntEntry( *m_part->projectDom(), "/kdevtrollproject/qmake/savebehaviour", 2 ) )
+ {
+ case 0:
+ return AlwaysSave;
+ break;
+ case 1:
+ return NeverSave;
+ break;
+ case 2:
+ default:
+ return Ask;
+ break;
+ }
+}
+
+bool TrollProjectWidget::isTMakeProject()
+{
+ return m_part->isTMakeProject();
+}
+
+void TrollProjectWidget::slotDisableSubproject( QMakeScopeItem* spitem )
+{
+ m_filesCached = false;
+ m_allFilesCache.clear();
+
+ if( spitem->scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 )
+ {
+ QStringList subdirs = spitem->scope->variableValues( "SUBDIRS" );
+ DisableSubprojectDlg dlg( subdirs );
+ if( dlg.exec() )
+ {
+ QStringList values = dlg.selectedProjects();
+ QListViewItem* item = spitem->firstChild();
+ while( item )
+ {
+ if( values.findIndex( item->text(0) ) != -1 )
+ delete item;
+ item = item->nextSibling();
+ }
+ spitem->disableSubprojects( values );
+ spitem->scope->saveToFile();
+ m_shownSubproject = spitem;
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+ }else
+ {
+ QMakeScopeItem* parent = static_cast<QMakeScopeItem*>(spitem->parent());
+ parent->disableSubprojects( QStringList( spitem->scope->scopeName() ) );
+ delete spitem;
+ parent->scope->saveToFile();
+ m_shownSubproject = parent;
+ slotOverviewSelectionChanged( m_shownSubproject );
+ }
+}
+
+void TrollProjectWidget::slotProjectDirty(const QString& path)
+{
+ kdDebug(9024) << "File is dirty:" << path << " using method " << endl;
+ if( KMessageBox::warningYesNo(this, i18n("The project file \"%1\" has changed on disk\n(Or you have \"%2\" opened in the editor, which also triggers a reload when you change something in the QMake Manager).\n\nDo you want to reload it?").arg(path).arg(path), i18n("Project File Changed"), i18n("Reload"), i18n("Do Not Reload"), "trollproject_reload_project_file" ) != KMessageBox::No )
+ {
+ m_part->dirWatch()->stopScan();
+ QListViewItemIterator it(m_rootSubproject);
+ QValueList<QMakeScopeItem*> itemstoreload;
+ while( it.current() )
+ {
+ QMakeScopeItem* projectitem = static_cast<QMakeScopeItem*>( it.current() );
+ if( projectitem->scope->scopeType() == Scope::ProjectScope
+ || projectitem->scope->scopeType() == Scope::IncludeScope )
+ {
+ QString projectfile = projectitem->scope->projectDir() + QString(QChar(QDir::separator())) + projectitem->scope->fileName();
+ if( projectfile == path )
+ {
+ itemstoreload.append(projectitem);
+ }
+ }
+ it++;
+ }
+
+ QValueList<QMakeScopeItem*>::const_iterator reloadit = itemstoreload.begin();
+ for( ; reloadit != itemstoreload.end() ; ++reloadit )
+ {
+ (*reloadit)->reloadProject();
+ if( m_shownSubproject == (*reloadit) )
+ {
+ cleanDetailView(*reloadit);
+ setupContext();
+ buildProjectDetailTree( *reloadit, details );
+ }
+ if( m_configDlg->isShown() && m_configDlg->currentProjectItem() == (*reloadit) )
+ {
+ m_configDlg->reject();
+ m_configDlg->updateSubproject(m_shownSubproject);
+ m_configDlg->show();
+ }
+ }
+ m_part->dirWatch()->startScan();
+ }
+}
+
+
+QMakeScopeItem* TrollProjectWidget::currentSubproject()
+{
+ return m_shownSubproject;
+}
+
+bool TrollProjectWidget::showFilenamesOnly() const
+{
+ return m_showFilenamesOnly;
+}
+
+bool TrollProjectWidget::showVariablesInTree() const
+{
+ return m_showVariablesInTree;
+}
+
+
+QMap<QString,QString> TrollProjectWidget::qmakeEnvironment() const
+{
+ QMap<QString,QString> map;
+ DomUtil::PairList envvars =
+ DomUtil::readPairListEntry(*m_part->projectDom(), "/kdevtrollproject/make/envvars", "envvar", "name", "value");
+
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ bool hasQtDir = false;
+ for (it = envvars.begin(); it != envvars.end(); ++it) {
+ if( (*it).first == "QTDIR" )
+ hasQtDir = true;
+
+ map[(*it).first] = (*it).second;
+ }
+
+ if( !hasQtDir && !m_part->isQt4Project() && !DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "").isEmpty() )
+ {
+ map["QTDIR="] = DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "");
+ map["PATH"] = map["PATH"].prepend( DomUtil::readEntry(*m_part->projectDom(), "/kdevcppsupport/qt/root", "") +"/bin" );
+ }
+ return map;
+}
+
+#include "trollprojectwidget.moc"
+
+//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
diff --git a/buildtools/qmake/trollprojectwidget.h b/buildtools/qmake/trollprojectwidget.h
new file mode 100644
index 00000000..19595f78
--- /dev/null
+++ b/buildtools/qmake/trollprojectwidget.h
@@ -0,0 +1,218 @@
+/***************************************************************************
+* Copyright (C) 2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2002 by Jakob Simon-Gaarde *
+* jakob@jsg.dk *
+* Copyright (C) 2002-2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* Copyright (C) 2003 by Thomas Hasart *
+* thasart@gmx.de *
+* Copyright (C) 2006 by Andreas Pakulat *
+* apaku@gmx.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 _TROLLPROJECTWIDGET_H_
+#define _TROLLPROJECTWIDGET_H_
+
+#include <qdict.h>
+#include <qlistview.h>
+#include <qmap.h>
+#include <qstrlist.h>
+#include <qvbox.h>
+#include <qtoolbutton.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdeversion.h>
+#include <qbutton.h>
+#include <qfileinfo.h>
+#include <qptrlist.h>
+#include "choosesubprojectdlg.h"
+#include "newwidgetdlg.h"
+#include "domutil.h"
+#include "qmakescopeitem.h"
+
+class TrollProjectPart;
+class KListView;
+class ProjectConfigurationDlg;
+
+class TrollProjectWidget : public QVBox
+{
+ Q_OBJECT
+
+public:
+ TrollProjectWidget( TrollProjectPart *part );
+ ~TrollProjectWidget();
+
+ void openProject( const QString &dirName );
+ void closeProject();
+
+ /**
+ * A list of the (relative) names of all subprojects (== subdirectories).
+ */
+ //QStringList allSubprojects();
+ /**
+ * A list of the (relative) names of all libraries.
+ */
+ QStringList allLibraries();
+ /**
+ * A list of all files that belong to the project.
+ **/
+ QStringList allFiles();
+ /**
+ * The top level directory of the project.
+ **/
+ QString projectDirectory();
+ /**
+ * The directory of the currently active subproject.
+ */
+ QString subprojectDirectory();
+ /**
+ * The directory of the currently active subproject.
+ */
+ QString getCurrentTarget();
+
+ QString getCurrentDestDir();
+
+ QString getCurrentOutputFilename();
+
+ void addFileToCurrentSubProject( GroupItem *titem, const QString &filename );
+ void addFileToCurrentSubProject( GroupItem::GroupType gtype, const QString &filename );
+ void addFiles( QStringList &files, bool relativeToProjectRoot = true );
+ void emitAddedFile( const QString &name );
+ void emitRemovedFile( const QString &name );
+
+ QString getUiFileLink( const QString &path, const QString& filename );
+ bool isTMakeProject();
+
+ enum TrollProjectView { SubprojectView, DetailsView };
+ void setLastFocusedView( TrollProjectView view );
+ enum SaveType { AlwaysSave, NeverSave, Ask };
+ QMakeScopeItem* currentSubproject();
+
+ bool showFilenamesOnly() const;
+ bool showVariablesInTree() const;
+
+public slots:
+ void slotBuildTarget();
+ void slotInstallTarget();
+ void slotRebuildTarget();
+ void slotCleanTarget();
+ void slotDistCleanTarget();
+ void slotExecuteTarget();
+
+ void slotBuildProject();
+ void slotInstallProject();
+ void slotRebuildProject();
+ void slotCleanProject();
+ void slotDistCleanProject();
+ void slotExecuteProject();
+
+ void slotBuildOpenFile();
+ void slotBuildSelectedFile();
+
+ void slotConfigureProject();
+ void slotAddFiles();
+ void slotNewFile();
+ void slotRemoveFile();
+
+protected:
+ virtual void focusInEvent( QFocusEvent *e );
+
+private slots:
+ void slotOverviewSelectionChanged( QListViewItem *item );
+ void slotOverviewContextMenu( KListView *, QListViewItem *item, const QPoint &p );
+ void slotDetailsSelectionChanged( QListViewItem* );
+ void slotDetailsExecuted( QListViewItem *item );
+ void slotDetailsContextMenu( KListView *, QListViewItem *item, const QPoint &p );
+ void slotExcludeFileFromScopeButton();
+ void slotAddSubproject( QMakeScopeItem *spitem = 0 );
+ void slotRemoveSubproject( QMakeScopeItem *spitem = 0 );
+ void slotCreateScope( QMakeScopeItem *spitem = 0 );
+ void slotRemoveScope( QMakeScopeItem *spitem = 0 );
+ void slotDisableSubproject( QMakeScopeItem* spitem = 0 );
+ void slotProjectDirty( const QString& );
+
+ void createQMakeScopeItems();
+
+private:
+ void cleanDetailView( QMakeScopeItem *item );
+ void runClean( QMakeScopeItem*, const QString& );
+ void buildProjectDetailTree( QMakeScopeItem *item, KListView *listviewControl );
+ void removeFile( QMakeScopeItem *spitem, FileItem *fitem );
+ void addSubprojectToItem( QMakeScopeItem*, const QString& );
+ void setupContext();
+ // void parseScope(QMakeScopeItem *item,QString scopeString, Scope *scope);
+ GroupItem* getInstallRoot( QMakeScopeItem *item );
+ GroupItem* getInstallObject( QMakeScopeItem *item, const QString& objectname );
+ QString constructMakeCommandLine( Scope* s = 0 );
+
+ void createMakefileIfMissing( const QString &dir, QMakeScopeItem *item );
+
+ void runQMakeRecursive( QMakeScopeItem* proj);
+ void buildFile( QMakeScopeItem* spitem, FileItem* fitem);
+
+ /*fileName: full base file name like QFileInfo::baseName ( true )*/
+ QPtrList<QMakeScopeItem> findSubprojectForFile( QFileInfo fi );
+ void findSubprojectForFile( QPtrList<QMakeScopeItem> &list, QMakeScopeItem * item, QString absFilePath );
+ QMakeScopeItem* findSubprojectForPath( const QString& );
+ // QString makeEnvironment();
+
+ TrollProjectWidget::SaveType dialogSaveBehaviour() const;
+
+ QMakeScopeItem *findSubprojectForScope( QMakeScopeItem *scope );
+
+ void reloadProjectFromFile( QMakeScopeItem* item );
+ QMap<QString,QString> qmakeEnvironment() const;
+
+ QVBox *overviewContainer;
+ KListView *overview;
+ QHBox *projectTools;
+ QToolButton *addSubdirButton;
+ QToolButton *createScopeButton;
+
+ QToolButton *buildProjectButton;
+ QToolButton *rebuildProjectButton;
+ QToolButton *executeProjectButton;
+
+ QToolButton *buildTargetButton;
+ QToolButton *rebuildTargetButton;
+ QToolButton *executeTargetButton;
+
+ QToolButton *buildFileButton;
+ QToolButton *projectconfButton;
+
+ QVBox *detailContainer;
+ KListView *details;
+ QHBox *fileTools;
+ QToolButton *addfilesButton;
+ QToolButton *newfileButton;
+ QToolButton *removefileButton;
+ QToolButton *excludeFileFromScopeButton;
+
+ DomUtil::PairList m_subclasslist;
+ QMakeScopeItem *m_shownSubproject;
+ QMakeScopeItem *m_rootSubproject;
+ Scope* m_rootScope;
+ TrollProjectPart *m_part;
+ ProjectConfigurationDlg* m_configDlg;
+
+ TrollProjectView m_lastFocusedView;
+
+ bool m_filesCached;
+ bool m_showFilenamesOnly;
+ bool m_showVariablesInTree;
+ QStringList m_allFilesCache;
+
+ friend class ChooseSubprojectDlg;
+ friend class ProjectConfigurationDlg;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/buildtools/script/Makefile.am b/buildtools/script/Makefile.am
new file mode 100644
index 00000000..73cee869
--- /dev/null
+++ b/buildtools/script/Makefile.am
@@ -0,0 +1,26 @@
+# Here resides the script project part.
+# This is a generic part for various scripting languages that simply
+# includes all files from the project directory without managing
+# them. If a language needs more specific features, it deserves
+# its own part (or the respective features should be added to the
+# language support part)
+
+INCLUDES = -I$(top_srcdir)/buildtools/lib/base \
+ -I$(top_srcdir)/buildtools/lib/widgets -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/external_interfaces $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevscriptproject.la
+libkdevscriptproject_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevscriptproject_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/buildtools/lib/widgets/libkdevbuildtoolswidgets.la $(top_builddir)/buildtools/lib/base/libkdevbuildbase.la
+
+libkdevscriptproject_la_SOURCES = scriptprojectpart.cpp scriptoptionswidget.cpp scriptoptionswidgetbase.ui scriptnewfiledlg.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevscriptproject.desktop
+
+rcdir = $(kde_datadir)/kdevscriptproject
+rc_DATA = kdevscriptproject.rc
diff --git a/buildtools/script/README.dox b/buildtools/script/README.dox
new file mode 100644
index 00000000..a7a19983
--- /dev/null
+++ b/buildtools/script/README.dox
@@ -0,0 +1,48 @@
+/** \class ScriptProjectPart
+This is the script build tool part
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\unmaintained This part is currently un-maintained
+
+\deprecated This class is deprecated, use GenericProjectPart (buildtools/generic) instead.
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/buildtools/script/kdevscriptproject.desktop b/buildtools/script/kdevscriptproject.desktop
new file mode 100644
index 00000000..1200f9ba
--- /dev/null
+++ b/buildtools/script/kdevscriptproject.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Scripting Language Project
+Comment[ca]=Projecte de llenguatge escrivint scripts
+Comment[da]=Scriptsprog-projekt
+Comment[de]=Skriptsprachen-Projekt für KDevelop
+Comment[el]=Έργο γλώσσας γραφής σεναρίων
+Comment[es]=Proyecto de lenguaje de guiones
+Comment[et]=Skriptikeele projekt
+Comment[eu]=Script lengoai proiektua
+Comment[fa]=پروژۀ زبان دست‌نوشته‌ای
+Comment[fr]=Projet avec les langages de scripts
+Comment[ga]=Tionscadal i dTeanga Scriptithe
+Comment[gl]=Proxecto de linguaxe de scripting
+Comment[hi]=स्क्रिप्टिंग भाषा परियोजना
+Comment[hu]=Szkript-projekt
+Comment[is]=Skriftumálsverkefni
+Comment[it]=Progetto con linguaggio di scripting
+Comment[ja]=スクリプト言語プロジェクト
+Comment[ms]=Projek Bahasa Penskrip
+Comment[nds]=Skriptspraak-Projekt
+Comment[ne]=स्क्रिप्टिङ भाषा परियोजना
+Comment[nl]=Scripttaal-project
+Comment[pl]=Projekt w języku skryptowym
+Comment[pt]=Projecto de uma Linguagem de 'Scripting'
+Comment[pt_BR]=Projeto de Linguagem de Script
+Comment[ru]=Проект скриптового языка
+Comment[sk]=Skriptovací jazyk projekt
+Comment[sl]=Projekt skriptnega jezika
+Comment[sr]=Пројекат скриптног језика
+Comment[sr@Latn]=Projekat skriptnog jezika
+Comment[sv]=Projekt för skriptspråk
+Comment[ta]=ஸ்கிரிப்டிங் மொழி பிராஜக்ட்
+Comment[tg]=Лоиҳа бо забони ғарчкунӣ
+Comment[tr]=Betik Dili Projesi
+Comment[zh_CN]=脚本语言工程
+Comment[zh_TW]=文稿語言專案
+Name=KDevScriptProject
+Name[da]=KDevelop script-projekt
+Name[de]=Skriptsprachen-Projekt (KDevelop)
+Name[hi]=के-डेव-स्क्रिप्ट-परियोजना
+Name[nds]=Skriptspraak-Projekt (KDevelop)
+Name[ne]=केडीई विकास स्क्रिप्ट परियोजना
+Name[pl]=KDevProjektSkrypt
+Name[sk]=KDevSkriptProjekt
+Name[sv]=KDevelop skriptprojekt
+Name[ta]=கெடெவ் ஸ்கிரிப்ட் பிராஜக்ட்
+Name[tg]=KDevЛоиҳаи скрипт
+Name[zh_TW]=KDevelop 文稿專案
+GenericName=Scripting Language Project
+GenericName[ca]=Projecte de llenguatge escrivint scripts
+GenericName[da]=Scriptsprog-projekt
+GenericName[de]=Skriptsprachen-Projekt
+GenericName[el]=Έργο γλώσσας γραφής σεναρίων
+GenericName[es]=Proyecto de lenguaje de guiones
+GenericName[et]=Skriptikeele projekt
+GenericName[eu]=Script lengoaia proiektua
+GenericName[fa]=پروژۀ زبان دست‌نوشته‌ای
+GenericName[fr]=Projet avec les langages de scripts
+GenericName[ga]=Tionscadal i dTeanga Scriptithe
+GenericName[gl]=Proxecto de linguaxe de scripting
+GenericName[hi]=स्क्रिप्टिंग भाषा परियोजना
+GenericName[hu]=Szkript-projekt
+GenericName[it]=Progetto con linguaggio di scripting
+GenericName[ja]=スクリプト言語プロジェクト
+GenericName[nds]=Skriptspraak-Projekt
+GenericName[ne]=स्क्रिप्टिङ भाषा परियोजना
+GenericName[nl]=Scripttaal-project
+GenericName[pl]=Projekt w języku skryptowym
+GenericName[pt]=Projecto de uma Linguagem de 'Scripting'
+GenericName[pt_BR]=Projeto de Linguagem de Script
+GenericName[ru]=Проект скриптового языка
+GenericName[sk]=Skriptovací jazyk projekt
+GenericName[sl]=Projekt skriptnega jezika
+GenericName[sr]=Пројекат скриптног језика
+GenericName[sr@Latn]=Projekat skriptnog jezika
+GenericName[sv]=Projekt för skriptspråk
+GenericName[ta]=ஸ்கிரிப்டிங் மொழி பிராஜக்ட்
+GenericName[tg]=Лоиҳа бо забони ғарчкунӣ
+GenericName[tr]=Betik Dili Projesi
+GenericName[zh_CN]=脚本语言工程
+GenericName[zh_TW]=文稿語言專案
+ServiceTypes=KDevelop/Project
+Icon=kdevelop
+X-KDE-Library=libkdevscriptproject
+X-KDevelop-Version=5
diff --git a/buildtools/script/kdevscriptproject.rc b/buildtools/script/kdevscriptproject.rc
new file mode 100644
index 00000000..651b10b4
--- /dev/null
+++ b/buildtools/script/kdevscriptproject.rc
@@ -0,0 +1,12 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevCustomProject" version="2">
+<MenuBar>
+ <Menu name="file" >
+ <Action name="file_newfile" />
+ </Menu>
+ <Menu name="project" >
+ <Action name="rescan" />
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/buildtools/script/scriptnewfiledlg.cpp b/buildtools/script/scriptnewfiledlg.cpp
new file mode 100644
index 00000000..336187d3
--- /dev/null
+++ b/buildtools/script/scriptnewfiledlg.cpp
@@ -0,0 +1,119 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "scriptnewfiledlg.h"
+
+#include <qcheckbox.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "scriptprojectpart.h"
+#include "filetemplate.h"
+
+
+ScriptNewFileDialog::ScriptNewFileDialog(ScriptProjectPart *part,
+ QWidget *parent, const char *name)
+ : QDialog(parent, name, true)
+{
+ setCaption(i18n("New File"));
+
+ QLabel *filename_label = new QLabel(i18n("&File name:"), this);
+
+ filename_edit = new KLineEdit(this);
+ filename_edit->setFocus();
+ filename_label->setBuddy(this);
+ QFontMetrics fm(filename_edit->fontMetrics());
+ filename_edit->setMinimumWidth(fm.width('X')*35);
+
+ usetemplate_box = new QCheckBox(i18n("&Use file template"), this);
+ usetemplate_box->setChecked(true);
+
+ QFrame *frame = new QFrame(this);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ QPushButton *ok_button = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel_button = buttonbox->addButton(KStdGuiItem::cancel());
+ ok_button->setDefault(true);
+ connect( ok_button, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancel_button, SIGNAL(clicked()), this, SLOT(reject()) );
+ buttonbox->layout();
+
+ QVBoxLayout *layout = new QVBoxLayout(this, 10, 4);
+ layout->addWidget(filename_label);
+ layout->addWidget(filename_edit);
+ layout->addWidget(usetemplate_box);
+ layout->addWidget(frame, 0);
+ layout->addWidget(buttonbox, 0);
+
+ m_part = part;
+}
+
+
+ScriptNewFileDialog::~ScriptNewFileDialog()
+{}
+
+
+void ScriptNewFileDialog::accept()
+{
+ QString fileName = filename_edit->text();
+ if (fileName.find('/') != -1) {
+ KMessageBox::sorry(this, i18n("Please enter the file name without '/' and so on."));
+ return;
+ }
+
+ KDevProject *project = m_part->project();
+ if (!project->activeDirectory().isEmpty())
+ fileName.prepend(project->activeDirectory() + "/");
+ QString destpath = project->projectDirectory() + "/" + fileName;
+
+ if (QFileInfo(destpath).exists()) {
+ KMessageBox::sorry(this, i18n("A file with this name already exists."));
+ return;
+ }
+
+ bool success = false;
+
+ if (usetemplate_box->isChecked()) {
+ QString extension = QFileInfo(destpath).extension();
+ if (!FileTemplate::exists(m_part, extension)) {
+ KMessageBox::sorry(this, i18n("A file template for this extension does not exist."));
+ return;
+ }
+ success = FileTemplate::copy(m_part, extension, destpath);
+ } else {
+ QFile f(destpath);
+ success = f.open(IO_WriteOnly);
+ if (success)
+ f.close();
+ }
+
+ if (!success)
+ KMessageBox::sorry(this, i18n("Could not create the new file."));
+
+ kdDebug(9015) << "AddFile1: " << fileName << endl;
+ m_part->addFile(fileName);
+
+ QDialog::accept();
+}
+
+#include "scriptnewfiledlg.moc"
diff --git a/buildtools/script/scriptnewfiledlg.h b/buildtools/script/scriptnewfiledlg.h
new file mode 100644
index 00000000..b3c73713
--- /dev/null
+++ b/buildtools/script/scriptnewfiledlg.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SCRIPTNEWFILEDLG_H_
+#define _SCRIPTNEWFILEDLG_H_
+
+#include <qdialog.h>
+
+class QCheckBox;
+class KLineEdit;
+class ScriptProjectPart;
+
+
+class ScriptNewFileDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ ScriptNewFileDialog( ScriptProjectPart *part, QWidget *parent=0, const char *name=0 );
+ ~ScriptNewFileDialog();
+
+protected:
+ virtual void accept();
+
+private:
+ QCheckBox *usetemplate_box;
+ KLineEdit *filename_edit;
+ ScriptProjectPart *m_part;
+};
+
+#endif
diff --git a/buildtools/script/scriptoptionswidget.cpp b/buildtools/script/scriptoptionswidget.cpp
new file mode 100644
index 00000000..c1660b00
--- /dev/null
+++ b/buildtools/script/scriptoptionswidget.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "scriptoptionswidget.h"
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <qradiobutton.h>
+#include <qtabwidget.h>
+#include "domutil.h"
+#include "kdevlanguagesupport.h"
+
+
+ScriptOptionsWidget::ScriptOptionsWidget(KDevPlugin *part,
+ QWidget *parent, const char *name)
+ : ScriptOptionsWidgetBase(parent, name)
+{
+ m_part = part;
+
+ QDomDocument &dom = *m_part->projectDom();
+
+ QString includepatterns
+ = DomUtil::readEntry(dom, "/kdevscriptproject/general/includepatterns");
+
+ if (includepatterns.isNull() && part->languageSupport()){
+ QStringList includepatternList;
+ KMimeType::List list = part->languageSupport()->mimeTypes();
+ KMimeType::List::Iterator it = list.begin();
+ while( it != list.end() ){
+ includepatternList += (*it)->patterns();
+ ++it;
+ }
+ includepatterns = includepatternList.join( "," );
+ }
+
+ QString excludepatterns
+ = DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns");
+ if (excludepatterns.isNull())
+ excludepatterns = "*~";
+
+ includepatterns_edit->setText(includepatterns);
+ excludepatterns_edit->setText(excludepatterns);
+}
+
+
+ScriptOptionsWidget::~ScriptOptionsWidget()
+{}
+
+
+void ScriptOptionsWidget::accept()
+{
+ QDomDocument &dom = *m_part->projectDom();
+
+ QString includepatterns = includepatterns_edit->text();
+ QString excludepatterns = excludepatterns_edit->text();
+
+ DomUtil::writeEntry(dom, "/kdevscriptproject/general/includepatterns", includepatterns);
+ DomUtil::writeEntry(dom, "/kdevscriptproject/general/excludepatterns", excludepatterns);
+}
+
+#include "scriptoptionswidget.moc"
diff --git a/buildtools/script/scriptoptionswidget.h b/buildtools/script/scriptoptionswidget.h
new file mode 100644
index 00000000..c33d099d
--- /dev/null
+++ b/buildtools/script/scriptoptionswidget.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SCRIPTPROJECTOPTIONSWIDGET_H_
+#define _SCRIPTPROJECTOPTIONSWIDGET_H_
+
+#include "scriptoptionswidgetbase.h"
+
+class KDevPlugin;
+
+
+class ScriptOptionsWidget : public ScriptOptionsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ ScriptOptionsWidget( KDevPlugin *part, QWidget *parent=0, const char *name=0 );
+ ~ScriptOptionsWidget();
+
+public slots:
+ void accept();
+
+private:
+ KDevPlugin *m_part;
+};
+
+#endif
diff --git a/buildtools/script/scriptoptionswidgetbase.ui b/buildtools/script/scriptoptionswidgetbase.ui
new file mode 100644
index 00000000..3a8f7b99
--- /dev/null
+++ b/buildtools/script/scriptoptionswidgetbase.ui
@@ -0,0 +1,155 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ScriptOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>script_project_options</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>482</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Script Project Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>includepatterns_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Include files into the project with the following patterns:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>includepatterns_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>includepatterns_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>excludepatterns_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Exclude the following patterns:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>excludepatterns_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>excludepatterns_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/buildtools/script/scriptprojectpart.cpp b/buildtools/script/scriptprojectpart.cpp
new file mode 100644
index 00000000..ff560f23
--- /dev/null
+++ b/buildtools/script/scriptprojectpart.cpp
@@ -0,0 +1,446 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "scriptprojectpart.h"
+
+#include <qdir.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qvaluestack.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdevgenericfactory.h>
+#include <kdevcreatefile.h>
+#include <kdirwatch.h>
+
+#include "domutil.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "kdevlanguagesupport.h"
+#include "scriptoptionswidget.h"
+#include "scriptnewfiledlg.h"
+#include "kdevplugininfo.h"
+
+typedef KDevGenericFactory<ScriptProjectPart> ScriptProjectFactory;
+static const KDevPluginInfo data("kdevscriptproject");
+K_EXPORT_COMPONENT_FACTORY( libkdevscriptproject, ScriptProjectFactory( data ) )
+
+ScriptProjectPart::ScriptProjectPart(QObject *parent, const char *name, const QStringList &)
+ : KDevBuildTool(&data, parent, name ? name : "ScriptProjectPart")
+{
+ setInstance(ScriptProjectFactory::instance());
+
+ setXMLFile("kdevscriptproject.rc");
+
+ // only create new file action if file creation part not available
+ if (!extension<KDevCreateFile>("KDevelop/CreateFile")) {
+ KAction *action;
+ action = new KAction( i18n("New File..."), 0,
+ this, SLOT(slotNewFile()),
+ actionCollection(), "file_newfile" );
+ action->setWhatsThis( i18n("<b>New file</b><p>Creates a new file.") );
+ action->setToolTip( i18n("Create a new file") );
+ }
+ new KAction( i18n("Rescan Project"), 0, CTRL+ALT+Key_R,
+ this, SLOT(rescan()),
+ actionCollection(), "rescan" );
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+}
+
+
+ScriptProjectPart::~ScriptProjectPart()
+{}
+
+
+void ScriptProjectPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Script Project Options"), i18n("Script Project Options"), BarIcon("kdevelop", KIcon::SizeMedium));
+ ScriptOptionsWidget *w = new ScriptOptionsWidget(this, vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+
+/**
+ * @todo This should really be merged with FileTreeWidget::matchesHidePattern()
+ * and put in its own class. Currently this is repeated in scriptprojectpart.cpp, pascalproject_part.cpp, adaproject_part.cpp
+ */
+static bool matchesPattern(const QString &fileName, const QStringList &patternList)
+{
+ QStringList::ConstIterator it;
+ for (it = patternList.begin(); it != patternList.end(); ++it) {
+ QRegExp re(*it, true, true);
+ if (re.search(fileName) == 0 && re.matchedLength() == (int)fileName.length())
+ return true;
+ }
+
+ return false;
+}
+
+
+void ScriptProjectPart::openProject(const QString &dirName, const QString &projectName)
+{
+ if (!languageSupport())
+ kdDebug(9015) << "ScriptProjectPart::openProject: no language support found!" << endl;
+
+ m_projectDirectory = dirName;
+ m_projectName = projectName;
+
+ QDomDocument &dom = *projectDom();
+
+ // Set the default directory radio to "executable"
+ if (DomUtil::readEntry(dom, "/kdevscriptproject/run/directoryradio") == "" ) {
+ DomUtil::writeEntry(dom, "/kdevscriptproject/run/directoryradio", "executable");
+ }
+
+ // Put all files from all subdirectories into file list
+ QValueStack<QString> s;
+ int prefixlen = m_projectDirectory.length()+1;
+ s.push(m_projectDirectory);
+
+ QDir dir;
+ do {
+ dir.setPath(s.pop());
+ kdDebug(9015) << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if ( dirEntries )
+ {
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it) {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir()) {
+ //do not follow symlinks which point to the themselves
+ if (it.current()->isSymLink())
+ {
+ QString symLink = it.current()->readLink();
+ if ((symLink == path) || (symLink == "./"))
+ continue;
+ } else if (canAddDirectoryToProject(path)) {
+ kdDebug(9015) << "Pushing: " << path << endl;
+ s.push(path);
+ }
+ }
+ else {
+ if (canAddToProject(path))
+ m_sourceFiles.append(path.mid(prefixlen));
+ }
+ }
+ }
+ } while (!s.isEmpty());
+
+ KDevProject::openProject( dirName, projectName );
+}
+
+
+void ScriptProjectPart::closeProject()
+{
+}
+
+
+QString ScriptProjectPart::projectDirectory() const
+{
+ return m_projectDirectory;
+}
+
+
+QString ScriptProjectPart::buildDirectory() const
+{
+ return m_projectDirectory;
+}
+
+QString ScriptProjectPart::projectName() const
+{
+ return m_projectName;
+}
+
+
+/** Retuns a PairList with the run environment variables */
+DomUtil::PairList ScriptProjectPart::runEnvironmentVars() const
+{
+ return DomUtil::readPairListEntry(*projectDom(), "/kdevscriptproject/run/envvars", "envvar", "name", "value");
+}
+
+
+/** Retuns the currently selected run directory
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The directory where the executable is
+ * if run/directoryradio == build
+ * The directory where the executable is relative to build directory
+ * if run/directoryradio == custom
+ * The custom directory absolute path
+ */
+QString ScriptProjectPart::runDirectory() const
+{
+ QString cwd = defaultRunDirectory("kdevscriptproject");
+ if (cwd.isEmpty())
+ cwd = buildDirectory();
+ return cwd;
+}
+
+
+/** Retuns the currently selected main program
+ * The returned string can be:
+ * if run/directoryradio == executable
+ * The executable name
+ * if run/directoryradio == build
+ * The path to executable relative to build directory
+ * if run/directoryradio == custom or relative == false
+ * The absolute path to executable
+ */
+QString ScriptProjectPart::mainProgram() const
+{
+ QDomDocument * dom = projectDom();
+
+ if ( !dom ) return QString();
+
+ QString DomMainProgram = DomUtil::readEntry( *dom, "/kdevscriptproject/run/mainprogram");
+
+ if ( DomMainProgram.isEmpty() ) return QString();
+
+ if ( DomMainProgram.startsWith("/") ) // assume absolute path
+ {
+ return DomMainProgram;
+ }
+ else // assume project relative path
+ {
+ return projectDirectory() + "/" + DomMainProgram;
+ }
+
+ return QString();
+}
+
+/** Retuns a QString with the debug command line arguments */
+QString ScriptProjectPart::debugArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globaldebugarguments");
+}
+
+
+/** Retuns a QString with the run command line arguments */
+QString ScriptProjectPart::runArguments() const
+{
+ return DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/programargs");
+}
+
+
+QString ScriptProjectPart::activeDirectory() const
+{
+ QDomDocument &dom = *projectDom();
+
+ return DomUtil::readEntry(dom, "/kdevscriptproject/general/activedir");
+}
+
+
+QStringList ScriptProjectPart::allFiles() const
+{
+/* QStringList res;
+
+ QStringList::ConstIterator it;
+ for (it = m_sourceFiles.begin(); it != m_sourceFiles.end(); ++it)
+ res += (m_projectDirectory + "/" + (*it));
+
+ return res;*/
+
+ // return all files relative to the project directory!
+ return m_sourceFiles;
+}
+
+void ScriptProjectPart::addFile(const QString &fileName)
+{
+ kdDebug(9015) << "AddFile2" << fileName << endl;
+
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->addFiles ( fileList );
+}
+
+void ScriptProjectPart::addFiles ( const QStringList& fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ m_sourceFiles.append ( ( *it ) );
+ }
+
+ emit addedFilesToProject ( fileList );
+}
+
+void ScriptProjectPart::removeFile(const QString &fileName)
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ this->addFiles ( fileList );
+}
+
+void ScriptProjectPart::removeFiles ( const QStringList& fileList )
+{
+ emit removedFilesFromProject ( fileList );
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ m_sourceFiles.remove ( ( *it ) );
+ }
+}
+
+void ScriptProjectPart::slotNewFile()
+{
+ ScriptNewFileDialog dlg(this);
+ dlg.exec();
+}
+
+/*!
+ \fn ScriptProjectPart::distFiles() const
+ */
+QStringList ScriptProjectPart::distFiles() const
+{
+ QStringList sourceList = allFiles();
+ // Scan current source directory for any .pro files.
+ QString projectDir = projectDirectory();
+ QDir dir(projectDir);
+ QStringList files = dir.entryList( "*README*");
+ return sourceList + files;
+}
+
+void ScriptProjectPart::rescan()
+{
+// kdDebug() << "Directory " << path << " changed, scanning for new files in the project" << endl;
+
+ // Put all files from all subdirectories into file list
+ QValueStack<QString> s;
+ int prefixlen = m_projectDirectory.length()+1;
+ s.push(m_projectDirectory);
+
+ QDir dir;
+ do {
+ dir.setPath(s.pop());
+ kdDebug(9015) << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if ( dirEntries )
+ {
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it) {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir()) {
+ //do not follow symlinks which point to the themselves
+ if (it.current()->isSymLink())
+ {
+ QString symLink = it.current()->readLink();
+ if ((symLink == path) || (symLink == "./"))
+ continue;
+ } else if (canAddDirectoryToProject(path)) {
+ kdDebug(9015) << "Pushing: " << path << endl;
+ s.push(path);
+ }
+ }
+ else {
+ if (!isProjectFile(path) && canAddToProject(path))
+ addFile(path.mid(prefixlen));
+// m_sourceFiles.append(path.mid(prefixlen));
+ }
+ }
+ }
+ } while (!s.isEmpty());
+
+/* const QFileInfoList *dirEntries = QDir(path).entryInfoList();
+ if ( dirEntries )
+ {
+ kdDebug() << "1" << endl;
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it) {
+ kdDebug() << "2" << endl;
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ kdDebug() << "3" << endl;
+ QString filePath = it.current()->absFilePath();
+ if (!it.current()->isDir() && canAddToProject(filePath) && !isProjectFile(filePath)) {
+ kdDebug() << "=== adding " << filePath << endl;
+ addFile(filePath);
+ }
+ }
+ }*/
+}
+
+bool ScriptProjectPart::canAddToProject(const QString & path)
+{
+ QDomDocument &dom = *projectDom();
+ QString includepatterns
+ = DomUtil::readEntry(dom, "/kdevscriptproject/general/includepatterns");
+ QStringList includepatternList;
+ if ( includepatterns.isNull() ) {
+ if ( languageSupport() ){
+ KMimeType::List list = languageSupport()->mimeTypes();
+ KMimeType::List::Iterator it = list.begin();
+ while( it != list.end() ){
+ includepatternList += (*it)->patterns();
+ ++it;
+ }
+ }
+ } else {
+ includepatternList = QStringList::split(",", includepatterns);
+ }
+
+ QString excludepatterns
+ = DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns");
+ if (excludepatterns.isNull())
+ excludepatterns = "*~";
+ QStringList excludepatternList = QStringList::split(",", excludepatterns);
+
+ if (matchesPattern(path, includepatternList)
+ && !matchesPattern(path, excludepatternList)) {
+ kdDebug(9015) << "Adding: " << path << endl;
+ return true;
+ } else {
+ kdDebug(9015) << "Ignoring: " << path << endl;
+ return false;
+ }
+}
+
+bool ScriptProjectPart::canAddDirectoryToProject(const QString & path)
+{
+ QDomDocument &dom = *projectDom();
+ QString excludepatterns
+ = DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns");
+ if (excludepatterns.isNull()) {
+ return true;
+ }
+ QStringList excludepatternList = QStringList::split(",", excludepatterns);
+
+ if (!matchesPattern(path, excludepatternList)) {
+ return true;
+ } else {
+ kdDebug(9015) << "Ignoring Directory: " << path << endl;
+ return false;
+ }
+}
+
+#include "scriptprojectpart.moc"
diff --git a/buildtools/script/scriptprojectpart.h b/buildtools/script/scriptprojectpart.h
new file mode 100644
index 00000000..b16c4ffb
--- /dev/null
+++ b/buildtools/script/scriptprojectpart.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SCRIPTPROJECTPART_H_
+#define _SCRIPTPROJECTPART_H_
+
+#include <qdict.h>
+#include <qguardedptr.h>
+
+#include "kdevbuildtool.h"
+
+class QListViewItem;
+class QStringList;
+class KDialogBase;
+class ScriptProjectWidget;
+
+class ScriptProjectPart : public KDevBuildTool
+{
+ Q_OBJECT
+
+public:
+ ScriptProjectPart( QObject *parent, const char *name, const QStringList &args );
+ ~ScriptProjectPart();
+ QStringList distFiles() const;
+
+protected:
+ virtual void openProject(const QString &dirName, const QString &projectName);
+ virtual void closeProject();
+
+ virtual QString projectDirectory() const;
+ virtual QString projectName() const;
+ virtual QString mainProgram() const;
+ virtual QString activeDirectory() const;
+ virtual QStringList allFiles() const;
+ virtual void addFile(const QString &fileName);
+ virtual void addFiles ( const QStringList& fileList );
+ virtual void removeFile(const QString &fileName);
+ virtual void removeFiles ( const QStringList& fileList );
+ virtual QString buildDirectory() const;
+ virtual QString runDirectory() const;
+ virtual QString debugArguments() const;
+ virtual QString runArguments() const;
+ virtual DomUtil::PairList runEnvironmentVars() const;
+
+ bool canAddToProject(const QString &path);
+ bool canAddDirectoryToProject(const QString &path);
+
+private slots:
+ void projectConfigWidget(KDialogBase *dlg);
+ void slotNewFile();
+ void rescan();
+
+private:
+ QString m_projectDirectory;
+ QString m_projectName;
+ QStringList m_sourceFiles;
+
+ friend class ScriptNewFileDialog;
+};
+
+#endif
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 00000000..77d61a45
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,22 @@
+/* config.h. Generated by cmake from config.h.cmake */
+
+
+#define QT_DOCDIR ${CONFIG_QT_DOCDIR}
+
+#define KDELIBS_DOXYDIR ${CONFIG_KDELIBS_DOXYDIR}
+
+#define MAKE_COMMAND "gmake"
+
+/* Version number of package */
+#define VERSION "3.2.0"
+
+/* Define if you have libz */
+#define HAVE_LIBZ ${HAVE_LIBZ}
+
+/* Define if you have libpng */
+#define HAVE_LIBPNG ${HAVE_LIBPNG}
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H ${HAVE_DLFCN_H}
+
+//////////////////////////////
diff --git a/configure.in.bot b/configure.in.bot
new file mode 100644
index 00000000..91ad3029
--- /dev/null
+++ b/configure.in.bot
@@ -0,0 +1,24 @@
+if test "$DOT_FOUND" = "no"; then
+ echo ""
+ echo "You're missing the dot program."
+ echo "It is still possible to run and use KDevelop without it, but you will "
+ echo "not be able to use the new graphical classbrowser. In order to get "
+ echo "a dot copy, go to www.graphviz.org and download the graphviz package."
+fi
+
+if test -z "$kdelibs_doxydir"; then
+ echo ""
+ echo "You have no kdelibs documentation generated by Doxygen installed."
+ echo "You should install Doxygen from www.doxygen.org, reconfigure"
+ echo "and rebuild the kdelibs sources. You should 'make apidox' and"
+ echo "'make install' in your kdelibs build dir, and then rerun this"
+ echo "configure script."
+fi
+
+if test -n "$VCSCOMPAT" -a -z "$SVN_SUBDIR"; then
+ echo ""
+ echo "You're missing Subversion libraries (1.x)"
+ echo "KDevelop subversion support will not work without it,"
+ echo "consider installing it."
+ echo ""
+fi
diff --git a/configure.in.in b/configure.in.in
new file mode 100644
index 00000000..3cdfa2df
--- /dev/null
+++ b/configure.in.in
@@ -0,0 +1,127 @@
+#MIN_CONFIG(3.3.0)
+
+AM_INIT_AUTOMAKE(kdevelop, 3.5.4)
+KDEV_CHECK_KDE_VERSION
+KDE_NEED_FLEX
+
+KDEV_CHECK_DOCBASE
+#KDEV_CHECK_SCRIPTING
+#KDEV_CHECK_JAVA
+#KDEV_CHECK_CSHARP
+#KDEV_CHECK_SVN
+#KDEV_CHECK_QEDITOR
+KDEV_CHECK_BDB
+#KDEV_PATH_PYTHONDOCDIR
+#KDEV_PATH_PHPDOCDIR
+#KDEV_PATH_GNUSTEPDOCDIR
+#KDEV_PATH_GTKDOCDIR
+KDEV_PATH_QTDOC
+KDEV_PATH_KDELIBSDOXY
+KDEV_PATH_KDELIBSDOC
+
+AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
+
+dnl **********
+dnl Check which programming languages support should be compiled
+dnl **********
+
+AC_ARG_ENABLE(ada, AC_HELP_STRING([--disable-ada], [disable programming language support for Ada]), [ada=${enableval}], [ada=yes])
+AM_CONDITIONAL(include_ada, test "$ada" = "yes")
+
+AC_ARG_ENABLE(bash, AC_HELP_STRING([--disable-bash], [disable programming language support for bash]), [bash=${enableval}], [bash=yes])
+AM_CONDITIONAL(include_bash, test "$bash" = "yes")
+
+AC_ARG_ENABLE(cpp, AC_HELP_STRING([--disable-cpp], [disable programming language support for C and C++]), [cpp=${enableval}], [cpp=yes])
+AM_CONDITIONAL(include_cpp, test "$cpp" = "yes")
+
+AC_ARG_ENABLE(fortran, AC_HELP_STRING([--disable-fortran], [disable programming language support for Fortran]), [fortran=${enableval}], [fortran=yes])
+AM_CONDITIONAL(include_fortran, test "$fortran" = "yes")
+
+AC_ARG_ENABLE(java, AC_HELP_STRING([--disable-java], [disable programming language support for Java]), [java=${enableval}], [java=yes])
+AM_CONDITIONAL(include_java, test "$java" = "yes")
+
+AC_ARG_ENABLE(csharp, AC_HELP_STRING([--disable-csharp], [disable programming language support for C#]), [csharp=${enableval}], [csharp=yes])
+AM_CONDITIONAL(include_csharp, test "$csharp" = "yes")
+
+AC_ARG_ENABLE(pascal, AC_HELP_STRING([--disable-pascal], [disable programming language support for Pascal]), [pascal=${enableval}], [pascal=yes])
+AM_CONDITIONAL(include_pascal, test "$pascal" = "yes")
+
+AC_ARG_ENABLE(perl, AC_HELP_STRING([--disable-perl], [disable programming language support for perl]), [perl=${enableval}], [perl=yes])
+AM_CONDITIONAL(include_perl, test "$perl" = "yes")
+
+AC_ARG_ENABLE(php, AC_HELP_STRING([--disable-php], [disable programming language support for PHP]), [php=${enableval}], [php=yes])
+AM_CONDITIONAL(include_php, test "$php" = "yes")
+
+AC_ARG_ENABLE(python, AC_HELP_STRING([--disable-python], [disable programming language support for Python]), [python=${enableval}], [python=yes])
+AM_CONDITIONAL(include_python, test "$python" = "yes")
+
+AC_ARG_ENABLE(ruby, AC_HELP_STRING([--disable-ruby], [disable programming language support for ruby]), [ruby=${enableval}], [ruby=yes])
+AM_CONDITIONAL(include_ruby, test "$ruby" = "yes")
+
+AC_ARG_ENABLE(sql, AC_HELP_STRING([--disable-sql], [disable programming language support for SQL]), [sql=${enableval}], [sql=yes])
+AM_CONDITIONAL(include_sql, test "$sql" = "yes")
+
+dnl **********
+dnl Check which build tools support should be compiled
+dnl **********
+
+AC_ARG_ENABLE(antproject, AC_HELP_STRING([--disable-antproject], [disable build tool support for ant]), [antproject=${enableval}], [antproject=yes])
+AM_CONDITIONAL(include_ant, test "$antproject" = "yes")
+
+AC_ARG_ENABLE(autoproject, AC_HELP_STRING([--disable-autoproject], [disable build tool support for autotools]), [autoproject=${enableval}], [autoproject=yes])
+AM_CONDITIONAL(include_autoproject, test "$autoproject" = "yes")
+
+AC_ARG_ENABLE(customproject, AC_HELP_STRING([--disable-customproject], [disable build tool support for custom makefiles]), [customproject=${enableval}], [customproject=yes])
+AM_CONDITIONAL(include_customproject, test "$customproject" = "yes")
+
+AC_ARG_ENABLE(scriptproject, AC_HELP_STRING([--disable-scriptproject], [disable build tool support for script]), [scriptproject=${enableval}], [scriptproject=yes])
+AM_CONDITIONAL(include_scriptproject, test "$scriptproject" = "yes")
+
+AC_ARG_ENABLE(trollproject, AC_HELP_STRING([--disable-trollproject], [disable build tool support for qmake]), [trollproject=${enableval}], [trollproject=yes])
+AM_CONDITIONAL(include_trollproject, test "$trollproject" = "yes")
+
+
+dnl **********
+dnl Check which version control systems support should be compiled
+dnl **********
+
+dnl cervisia is currently disabled
+dnl AC_ARG_ENABLE(cervisia, AC_HELP_STRING([--disable-cervisia], [disable vcs support for cervisia]), [with_cervisia=${enableval}], [with_cervisia=yes])
+
+AC_ARG_ENABLE(clearcase, AC_HELP_STRING([--disable-clearcase], [disable vcs support for clearcase]), [with_clearcase=${enableval}], [with_clearcase=yes])
+AM_CONDITIONAL(include_clearcase, test "$with_clearcase" = "yes")
+
+AC_ARG_ENABLE(cvs, AC_HELP_STRING([--disable-cvs], [disable vcs support for cvs]), [with_cvs=${enableval}], [with_cvs=yes])
+AM_CONDITIONAL(include_cvsclient, test "$with_cvs" = "yes")
+
+dnl This one is automatic and depends is cervisia is installed or not
+KDE_CHECK_HEADER(cvsservice_stub.h, [cvsservice_stub_h="found"], [cvsservice_stub_h="none"])
+AM_CONDITIONAL(include_cvsservice, test "$cvsservice_stub_h" = "found")
+
+AC_ARG_ENABLE(perforce, AC_HELP_STRING([--disable-perforce], [disable vcs support for perforce]), [with_perforce=${enableval}], [with_perforce=yes])
+AM_CONDITIONAL(include_perforce, test "$with_perforce" = "yes")
+
+dnl **********
+dnl Check which embedded support should be compiled
+dnl **********
+
+AC_ARG_ENABLE(vba, AC_HELP_STRING([--enable-vba], [enable visualboy advance support]), [with_vba=${enableval}], [with_vba=no])
+AM_CONDITIONAL(include_vba, test "$with_vba" = "yes")
+
+
+AC_PATH_PROG(DOT_FOUND, dot, no)
+AC_CHECK_PROG(gmake_prog, gmake, gmake, make)
+AC_CHECK_PROGS(TAR, gnutar gtar tar, [AM_MISSING_PROG(tar)])
+AC_CHECK_PROG(GZIP_COMMAND, gzip, gzip)
+AC_DEFINE_UNQUOTED(MAKE_COMMAND, "$gmake_prog", [GNU make command])
+
+CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
+case $host_os in
+hpux11*)
+ CPPFLAGS="$CPPFLAGS -D_PROTOTYPES"
+ ;;
+esac
+
+AC_CHECK_FILE([$qt_includes/qassistantclient.h], [],[AC_MSG_ERROR([The qassistantclient.h header from Qt3 is needed to build kdevelop, on some systems this header is in a separate package called qt3-apps-dev])])
+
+KDE_INIT_DOXYGEN([KDevelop], [Version $VERSION])
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 00000000..2c7c6128
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = kdevelop std extras kde_app_devel
+
diff --git a/doc/api/Architecture.dox b/doc/api/Architecture.dox
new file mode 100644
index 00000000..ae4ef73d
--- /dev/null
+++ b/doc/api/Architecture.dox
@@ -0,0 +1,315 @@
+/** \file Architecture.dox
+ * \brief KDevelop architecture
+ */
+
+/** \page architecture KDevelop 3 Architecture
+
+KDevelop uses a plugin based architecture. This will be explained in more
+detail in the next sections. To add a new plugin check the \ref howToAddPlugins page.
+
+\section devteammodel Development Team cooperation model
+
+KDevelop is the result of the work of many people. To help syncronize the effords and to automate
+some tasks, the team uses many tools:
+
+ - CVS servers
+ - KDE Bugzilla
+ - Web servers
+ - Mailing Lists
+ - IRC
+ - Doxygen
+ - docbook
+ - LXR
+ - E-mail :)
+ - Cron Jobs
+ - and of course KDevelop :)
+ .
+
+They get interconnected like this:
+
+\image html Development.png
+
+
+\section overview Source Overview
+
+\subsection source-division Main Source Divisions
+
+The KDevelop 3 source is divided into several parts which correspond to
+subdirectories in the KDevelop project directory. There are several main
+parts to distinguish, mainly:
+
+ - src = The core part of KDevelop
+ - lib/interfaces = Plugin handler interface classes
+ - parts = The various parts using the KParts framework ( KDevPlugin children )
+ - languages = \ref language-parts
+ - buildtools = \ref buildtool-parts
+ - vcs = \ref vcs-parts
+ - editors = \ref editor-parts
+ .
+
+\image html Architecture.png
+
+This image is not complete there are parts that are not displayed. See below for a more detailed description.
+
+\subsection core-part The Core Part of KDevelop
+
+\subsubsection mainwindows Main Window Objects
+
+There are two types of possible main window objects:
+
+ - MainWindow implements standard MDI user interfaces:
+ - Top level mode (see MainWindow::switchToToplevelMode() )
+ - Childframe mode (see MainWindow::switchToChildframeMode() )
+ - Tab page mode (see MainWindow::switchToTabPageMode() )
+ - IDEAl mode (see MainWindow::switchToIDEAlMode() )
+ .
+ - MainWindowIDEAl implements an enhanced MDI main window providing a set of
+ pre-arranged access tabs around user areas.
+ .
+
+Both main window classes inherit from the KDevMainWindow class which provides
+access to common window features.
+
+\subsubsection toplevel The TopLevel Object
+
+There is only one toplevel object of class KDevMainWindow in KDevelop. It can
+be accessed through the static function TopLevel::getInstance() (see the
+TopLevel class).
+
+\subsection parts-overview KDevelop Parts Overview
+
+All parts reside in dedicated subdirectories acording to their function. They can
+be viewed according to their functionalities as follows.
+
+\subsubsection language-parts Programming Language Support Parts
+
+These parts implement a KDevLanguageSupport Class interface.
+To add support for a new programming language check the \ref howToAddProgrammingLanguages page (doc/api/HowToAddProgrammingLanguages.dox file).
+Take a look at \ref LangSupportStatus (doc/api/LangSupportStatus.dox file) to see the current status/features of the programming languages currently supported by KDevelop.
+
+ - languages/ada = Support for Ada
+ - (see AdaSupportPart)
+ .
+ - languages/bash = Support for bash
+ - (see BashSupportPart)
+ .
+ - languages/cpp = Support for C/C++
+ - (see CppSupportPart)
+ - languages/cpp/debugger = GNU Debugger frontend
+ - (see GDBDebugger::DebuggerPart)
+ .
+ .
+ .
+ - languages/fortran = Support for Fortran
+ - (see FortranSupportPart)
+ .
+ - languages/haskell = Support for Haskell
+ - (see HaskellSupportPart)
+ .
+ - languages/java = Support for Java
+ - (see JavaSupportPart)
+ - languages/java/degugger = Java debugger frontend
+ - (JAVADebugger::JavaDebuggerPart)
+ .
+ .
+ .
+ - languages/pascal = Support for Pascal
+ - (see PascalSupportPart)
+ .
+ - languages/perl = Support for Perl
+ - (see PerlSupportPart)
+ .
+ - languages/php = Support for PHP
+ - (see PHPSupportPart)
+ .
+ - languages/python = Support for Python
+ - (see PythonSupportPart)
+ .
+ - languages/ruby = Support for Ruby
+ - (see RubySupportPart)
+ .
+ - languages/sql = Support for SQL
+ - (see SQLSupportPart)
+ .
+ .
+
+\subsubsection buildtool-parts Build tools Parts
+
+These parts implement a KDevProject Class interface.
+
+ - buildtools/ada = Ada build tool
+ - (see AdaProjectPart)
+ .
+ - buildtools/ant = ANT build tool
+ - (see AntProjectPart)
+ .
+ - buildtools/autotools = Autotools build tool
+ - (see AutoProjectPart)
+ .
+ - buildtools/custommakefiles = Custom makefiles build tool
+ - (see CustomProjectPart)
+ .
+ - buildtools/generic = Generic build tool
+ - (see GenericProjectPart)
+ .
+ - buildtools/pascal = Pascal build tool
+ - (see PascalProjectPart)
+ .
+ - buildtools/script = Script build tool
+ - (see ScriptProjectPart)
+ .
+ - buildtools/qmake = QMake based build tool
+ - (see TrollProjectPart)
+ .
+ .
+
+
+\subsubsection vcs-parts VCS (Version Control System) Parts
+
+These parts implement a KDevVersionControl Class interface.
+
+ - vcs/cervisia = Cervisia Support
+ - (see CervisiaPlugin)
+ .
+ - vcs/clearcase = IBM Rational ClearCase Support
+ - (see ClearcasePart)
+ .
+ - vcs/cvs = CVS Support
+ - (see CvsPart)
+ .
+ - vcs/cvsservice = cvsservice Support (Cervisia interface)
+ - (see CvsServicePart)
+ .
+ - vcs/perforce = Version managment system perforce integration
+ - (see PerforcePart)
+ .
+ - vcs/subversion = Subversion integration
+ - (see subversionPart)
+ .
+ .
+
+
+\subsubsection editor-parts editor support Specific Parts
+
+These parts implement a KTextEditor Class interface.
+Take a look at \ref EditorsSupportStatus (doc/api/EditorsSupportStatus.dox file) to see the current status/features of the editors currently supported by KDevelop.
+
+ - editors/editor-chooser = Chooses an internal text editor
+ - (see EditorChooserPart)
+ .
+ - editors/nedit = KTextEditor interface for nedit
+ - (see KNEditFactory, Document, View)
+ .
+ - editors/qeditor = QEditor integration
+ - (see QEditorPart)
+ .
+ .
+
+
+\subsubsection global-parts Global Parts
+
+Some of the parts are considered global - that is, they effect the entire
+operation of KDevelop.
+
+These parts implement a KDevPlugin Class interface.
+
+ - parts/appwizard = New Project Wizard
+ - see AppWizardPart
+ - see \ref howToAddApplicationTemplates (doc/api/HowToAddApplicationTemplates.dox file)
+ .
+ - parts/history = Project history
+ - (see HistoryPart)
+ .
+ - parts/konsole = Embedded Konsole
+ - (see KonsoleViewPart)
+ .
+ - parts/doctreeview = Documentation Viewer
+ - (see DocTreeViewPart)
+ .
+ - parts/openwith = "Open with" menu addon
+ - (see OpenWithPart)
+ .
+ - parts/fileselector = A file selection widget
+ - (see FileSelectorPart)
+ .
+ - parts/uimode = Customize the UI mode
+ - (see UIChooserPart)
+ .
+ - parts/texttools = Additional text tools
+ - (see TextToolsPart)
+ .
+ - parts/tipofday = A tip of the day
+ - (see TipOfDayPart)
+ .
+ - parts/grepview = A graphical grep utility
+ - (see GrepViewPart)
+ .
+ - parts/tools = Toolbar management
+ - (see ToolsPart)
+ .
+ - parts/regexptest = A regular expression tester
+ - (see RegexpTestPart)
+ .
+ - parts/abbrev = Abbreviation Expansion
+ - (see AbbrevPart)
+ .
+ - parts/filter = Shell Filtering and Insertion
+ - (see FilterPart)
+ .
+ - parts/valgrind = A graphical valgrind frontend
+ - (see ValgrindPart)
+ .
+ .
+
+
+\subsubsection project-specific-parts Project Specific Parts
+
+These parts implement a KDevPlugin Class interface.
+
+ - parts/astyle = Source code formatter
+ - (see AStylePart)
+ .
+ - parts/buglist = Bug tracking application
+ - (see BugList)
+ .
+ - parts/classview = Classview Manager
+ - (see ClassViewPart)
+ .
+ - parts/ctags = CTags frontend
+ - (see CTagsPart)
+ .
+ - parts/diff = Difference viewer
+ - (see DiffPart)
+ .
+ - parts/distpart = Aids in building and publishing the final project
+ - (see DistpartPart)
+ .
+ - parts/doxygen = Doxygen integration
+ - (see DoxygenPart)
+ .
+ - parts/filecreate = New file creation
+ - see FileCreatePart
+ - see \ref howToAddFileTemplates (doc/api/HowToAddFileTemplates.dox file)
+ .
+ - parts/fileview = File groups
+ - (see FileViewPart, FileGroupsPart)
+ .
+ - parts/manager = Document manager
+ - (see DocManager, ViewManager)
+ .
+ - parts/outputviews = Application output views
+ - (see AppOutputViewPart, MakeViewPart)
+ .
+ - parts/scripting = Python scripting interface
+ - (see ScriptingPart)
+ .
+ - parts/sourcenav = Source code navigation
+ - (see SourceNavPart)
+ .
+ - parts/visualboyadvance = VisualBoy Advance integration
+ - (see VisualBoyAdvance::VisualBoyAdvancePart)
+ .
+ .
+
+*/
+
diff --git a/doc/api/Architecture.png b/doc/api/Architecture.png
new file mode 100644
index 00000000..306881fa
--- /dev/null
+++ b/doc/api/Architecture.png
Binary files differ
diff --git a/doc/api/Architecture.sxd b/doc/api/Architecture.sxd
new file mode 100644
index 00000000..b48f9a36
--- /dev/null
+++ b/doc/api/Architecture.sxd
Binary files differ
diff --git a/doc/api/Development.png b/doc/api/Development.png
new file mode 100644
index 00000000..063e63db
--- /dev/null
+++ b/doc/api/Development.png
Binary files differ
diff --git a/doc/api/Development.sxd b/doc/api/Development.sxd
new file mode 100644
index 00000000..ff5b06cc
--- /dev/null
+++ b/doc/api/Development.sxd
Binary files differ
diff --git a/doc/api/EditorsSupportStatus.dox b/doc/api/EditorsSupportStatus.dox
new file mode 100644
index 00000000..e826471c
--- /dev/null
+++ b/doc/api/EditorsSupportStatus.dox
@@ -0,0 +1,189 @@
+/** \file EditorsSupportStatus.dox
+ * \brief Editors Support Status
+ */
+
+/** \page EditorsSupportStatus Editors Support Status
+
+Kate and Kvim are part of KDE and KDevelop just uses them.
+
+qeditor and Nedit are interfaced via KDevelop's code. You can look at their code at <code>editors/qeditor</code> and <code>editors/nedit</code>.
+
+<table border="1" style="text-align: left; margin-left: auto; margin-right: auto;" cellpadding="2" cellspacing="2">
+ <tr>
+ <th style="text-align: center;">features/editor</th>
+ <th style="text-align: center;">kate</th>
+ <th style="text-align: center;">kvim (KDE 3.2)</th>
+ <th style="text-align: center;"><a href="classQEditor.html">qeditor</a></th>
+ <th style="text-align: center;"><a href="classKNEditFactory.html">Nedit (Disabled)</a></th>
+ </tr>
+ <tr>
+ <td style="background-color: rgb(51, 204, 0);">Advanced text editor</td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ </tr>
+ <tr>
+ <td>Open, close and save big text files</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ </tr>
+ <tr>
+ <td>Undo and redo</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Jump in text: next/previous character, word.</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ </tr>
+ <tr>
+ <td>Jump to start or the end of the line/text</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td>Y</td>
+ </tr>
+ <tr>
+ <td>Go to line</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Select text when jumping (character, word, line), </td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Select all the text</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Copy, paste and delete selections of text</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Print</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="background-color: rgb(51, 204, 0);">Advanced text view:</td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ <td style="background-color: rgb(51, 204, 0);"></td>
+ </tr>
+ <tr>
+ <td>Horizontal and vertical scrolling</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Display selections</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Mouse Wheel support</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Dynamic word wrap</td>
+ <td>Y</td>
+ <td>N</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Line numbers</td>
+ <td>Y</td>
+ <td>N</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Show tabs</td>
+ <td>Y</td>
+ <td>N</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Find in file</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Replace in file</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td style="background-color: rgb(51, 204, 0);">Coding specific properties:</td>
+ <td style="background-color: rgb(51, 204, 0);"><br></td>
+ <td style="background-color: rgb(51, 204, 0);"><br></td>
+ <td style="background-color: rgb(51, 204, 0);"><br></td>
+ <td style="background-color: rgb(51, 204, 0);"><br></td>
+ </tr>
+ <tr>
+ <td>Syntax highlighting</td>
+ <td>Y</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Code folding</td>
+ <td>Y</td>
+ <td>N</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Spell</td>
+ <td>Y</td>
+ <td>N</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Auto indendt</td>
+ <td>N</td>
+ <td>N</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+</table>
+
+*/
diff --git a/doc/api/FutureTasks.dox b/doc/api/FutureTasks.dox
new file mode 100644
index 00000000..fbed119a
--- /dev/null
+++ b/doc/api/FutureTasks.dox
@@ -0,0 +1,136 @@
+/** \file FutureTasks.dox
+ * \brief Future tasks and ideas for the next release of KDevelop
+ */
+/** \page FutureTasks Future tasks and ideas for the next release of KDevelop
+
+\section codereftodo Code Refactoring / Improvements:
+
+ - Core
+ - Make sure all lib interfaces are available via DCOP
+ - Find a nicer way to remove dynamic menu entries from context menus
+ - Resolve the path handling mess
+ - Project name should be able to contain spaces
+ - Import existing directory: Should be named "Import existing project"
+ and more intuitive (wizard-like)
+ - Question from the wizard: "I have found C++ files in your
+ project directory. Should C++ be the primary language of your
+ project?" User: [Yes/No] =&gt; Next Step...
+ - Something intuitive for the binary/-ies (for debugger and
+ execution of program), libtool ([Yes/No] for the debugger), build
+ tool (qmake, automake,...?), etc.., too.
+ - use mimetype to determine code files, not extension
+ (see bug #
+ - Make the help buttons (that we already have) open the KDevelop Handbook on
+ the correct page (or the index if the subject is not covered yet).
+ - New and improved VCS framework (Needs better description)
+ - Another look at the plugin system (Nees better description)
+ - Another look at the project files (shared, non-shared, session)
+ - fix(redesign?) project language switching
+ - editor handling could be made a bit saner if editor plugin switching was an after-restart-only feature
+
+ - Programming Language Support Parts
+ - Create base classes for language support parts:
+ - AntlrLanguageSupport
+ - AntlrBackgroundParser
+ - AntlrProblemReporter
+ - Same for:
+ - YaccLanguageSupport
+ - YaccBackgroundParser
+ - YaccProblemReporter
+ - There is a possibility to create even something like
+ - LanguageSupportBase
+
+ Look at java, pascal and ada support parts to get more inspiration.
+ There should be base classes for ada, java and pascal language supports - too much code duplication.
+
+ - CppSupportPart
+ - Extended "make member" functionality - run on a .h to implement stubs for all unimplemented non-abstract methods
+ - Code Refactoring
+ - text hint type info tooltips (edit mode)
+ - text hint value info tooltips (debug mode)
+ - Make the language plugin know stuff like what file patterns to look for (for instance, "find in files" needs this)
+
+ - Build tools Parts
+ - Show .po files in project management
+ - Custom actions for groups, targets and files for project managers:
+ - any menu item should be a KAction plugged into KPopupMenu, also we need to define shortcuts for any such action,
+ also we should make sure those actions are properly executed from a shortcut.
+ - AutoProjectPart
+ - Should be able to DND files from other targets / file list / konq to add to targets
+ - Should loose the experimental crashy and nonstandard "add files" dialog
+ - Update configure.in when sub projects are added and the project doesn't use am_edit
+ - Keep the correctly cased project name and save it to the project file
+
+ - Debugger Parts
+ - Create a debugger support base classes. Make the current GDB support a plugin.
+ - Implement parts for other debuggers i.e. DBX, WDB, Ladebug, JDB, XDB, bashdb, the Perl debugger, or the Python debugger.
+ We can use DDD as inspiration.
+ - General debugger
+ - variable widget
+ - set variable by editing the value in the tree
+ - cast value by editing the type in the tree
+ - disassembly
+ - add breakpoint display
+ - set breakpoint by selecting a line as in the edit window
+ - allow scrolling of disassembled code about and below current limits
+ - add source to disassembled code as comments
+ - basically just re-work the whole disassemble window :)
+ - Bugs
+ - Fix "core file" handling
+ - Fix "attach to" handling
+ - Breakpoints can disappear at odd times
+ - When the target program crashes, the debugger can't be started again. (intermittant?)
+ - Break on method() - could have multiple methods which require a choice. How to handle this?
+
+
+ - Plugins
+ - DocTreeViewPart
+ - Implement plugin system for doctreeview.
+ - improve documentation browsing
+ - Check if a man page exists before offering the context menu item 'Goto manpage'
+ - right click -> set as bookmark in docviewer
+ - ClassViewPart
+ - Implement language-dependant plugin system for classview:
+ - namespaces/classes/functions are not always applicable to a language, we need a way to correctly
+ fill a class view and combo boxes - only a language support can do that properly.
+ - Distinguish vanilla c++ support from c++ + Qt extensions and show signals/slots in the class view only with Qt. (is this still valid?)
+ - KonsoleViewPart
+ - Perhaps use konsole part for the application frontend
+ - cd's when selecting a file, but doesn't when selecting a dir,
+ desired: a menu option to "cd" to that directory
+ - QEditor
+ - Replace editors/qeditor/koReplace.* and editors/qeditor/koFind.* with kdelibs/kutils/kreplace.* and kdelibs/kutils/kfind.*
+
+
+\section extensiontodo Extensions / New Functionality:
+
+ - Core
+ - implement multiple-views per document (why?)
+ - Document manager (not obviously useful)
+ - Implement Add Plugin
+ - Show intro page on startup
+ - Programming Language Support Parts
+ - Build tools Parts
+ - Plugins
+ - better sourcenav part (all navigation tools should be supported with at least a "back" action - forward much less important)
+ - Integrate kontact's TODO-List and knotes plugin. (We need something like a
+ server/client system that all the knotes/toto-clients are always synced.)
+ - a generic macro-tool (if possible, probably best implemented as a KTE plugin)
+ - Free grouping of files in file group plugin
+
+
+\section misctodo Miscellaneous (and possibly invalid) items:
+
+ - UI bugs
+ - Editor options dialog missing when all views are closed (virtually impossible to fix)
+ - If you click an error in the output view, "Next Error"/"Previous
+ Error" should then start from that point (already implemented?)
+ - Messages in status bar would look nicer if they appeared with
+ the same border as other items (impossible)
+ - Browser tool bar should truncate long menu entries so it doesn't
+ take so much space (already implemented?)
+ - Extend KDevPlugin-API in order to have a preferred border for at
+ least the selection parts (Automake Manager, Class Browser, File
+ Groups, etc...)
+
+*/
diff --git a/doc/api/HighPriTasks.dox b/doc/api/HighPriTasks.dox
new file mode 100644
index 00000000..21116342
--- /dev/null
+++ b/doc/api/HighPriTasks.dox
@@ -0,0 +1,36 @@
+/** \file HighPriTasks.dox
+ * \brief High priority tasks
+ */
+/** \page HighPriTasks High priority tasks!
+
+\section fixMajBugs Fixing major/annoying bugs
+
+ - Fix the mess of .kdevelop and .kdevses file.
+ - All project wide setings should go into .kdevelop and
+ - all session (and personal) options should go into .kdevses file
+ .
+ This way the .kdevelop file can be shared in teams of developers.
+
+
+\section KDevelop2compat KDevelop 2 compatibility
+(These are things that must be accomplished before we can say that KDevelop 3
+&gt;= kdevelop 2.x UI-wise and functionality-wise!)
+
+ - general UI issues:
+ - toplevel UI mode broken concerning to the accels
+ - [Modified] missing in mainframe caption
+ - captions missing for toolbar buttons
+ .
+ - build/configuration:
+ - cross-compiling feature missing
+ - make "MIN_VERSION" configurable on new project creation
+ .
+ - doctreeview:
+ - implement "Make User Manual"
+ - use kdoc to update Qt/KDE docs
+ .
+ - Solve the regression bugs. These are the <a href= "http://bugs.kde.org/buglist.cgi?product=kdevelop&bug_status=UNCONFIRMED&bug_status=NEW&priority=HI">ones
+marked with priority "HI" in the bug database</a>
+
+
+*/
diff --git a/doc/api/HowToAddApplicationTemplates.dox b/doc/api/HowToAddApplicationTemplates.dox
new file mode 100644
index 00000000..7eec80c7
--- /dev/null
+++ b/doc/api/HowToAddApplicationTemplates.dox
@@ -0,0 +1,285 @@
+/** \file HowToAddApplicationTemplates.dox
+ * \brief How to add application templates to the application wizard part
+ */
+/** \page howToAddApplicationTemplates How to add application templates to the application wizard part
+
+Project templates provide the developer with a basic application framework.
+This is necessary for rapid application development (RAD) and makes it even possible
+for an inexperienced 3rd party developer to create standard conforming
+applications like kedit as well as plugins for example for kdevelop or noatun.\n\n
+\ref templates_1\n
+ - \ref templates_1_1
+ - \ref templates_1_2
+ - \ref templates_1_2a
+ - \ref templates_1_2b
+ - \ref templates_1_2c
+ - \ref templates_1_2d
+ - \ref templates_1_2e
+ .
+ .
+\ref templates_2\n
+\ref templates_3\n
+\ref templates_4\n
+<!-- @todo <b>Developer information:</b> The documentation for the related
+<code>"Project"->"Import Existing Project..."</code> is available here: \ref appwizard_imports
+-->
+<hr>
+
+\section templates_1 I. Example: How To Create a Simple KDE Application Template "KHello"
+
+You can find this template in <code>$KDEDIR/share/apps/kdevappwizard/template-khello</code>.
+
+\subsection templates_1_1 I.1. Step 1: Basic Skeleton
+
+Create a directory <code>template-khello</code> with the files
+<code><pre>
+ - template-khello/app.cpp
+ - template-khello/app.h
+ - template-khello/app.desktop
+ - template-khello/app.kdevelop
+ - template-khello/appui.rc
+ - template-khello/khello
+ - template-khello/main.cpp
+ - template-khello/preview.png
+ - template-khello/script
+ - template-khello/src-Makefile.am
+ - template-khello/subdirs
+ .
+</pre></code>
+\note The directory name must begin with <code>"template-"</code>.
+
+\subsection templates_1_2 I.2. Step 2: The Files in Detail
+
+Have a look into the files! There are some variables which the application
+wizard will replace:
+<code><pre>
+ - \%{AUTHOR} ...... by the author
+ - \%{EMAIL} ....... by the e-mail address
+ - \%{VERSION} ..... by the version
+ - \%{APPNAME} ..... by the project name (KHello)
+ - \%{APPNAMELC} ... by the project name in lowercase (khello)
+ - \%{APPNAMEUC} ... by the project name in uppercase (KHELLO)
+ - \%{LICENSE} ..... by the license (GPL, BSD, QPL, LGPL, ...)
+ - \%{LICENSEFILE} . by the licensefile
+ - \%{YEAR} ........ by the year
+ .
+</pre></code>
+All this can be found in <code>$KDEDIR/share/apps/kdevappwizard/template-common/kdevelop.pm</code>.
+\subsubsection templates_1_2a I.2.1. The Source Files
+
+The files <code>template-khello/app.cpp, template-khello/app.h</code> and
+<code>template-khello/main.cpp</code> contain the source code that should not
+be too special so that the user can implement his own ideas.\n
+(There may be variables included - see \ref templates_1_2 "Step 2: The Files in Detail").
+
+\subsubsection templates_1_2b I.2.2. The File template-khello/khello
+
+It may look like this:
+\verbinclude khello/khello
+
+The application wizard looks into this file to get
+ - the information where to integrate the plugin into the the listview (<code>Category=</code>)
+ - the name (<code>Name=</code>) and the comment (<code>Comment=</code>)
+ - the preview image (<code>Icon=</code>)
+ - and the file templates the project uses (<code>FileTemplates=</code>).
+ .
+Further information could be (not required):
+ - <code>Comment=</code> a small comment for the template. Longer comments should go into a README.devel and shown on startup
+ - <code>ShowFilesAfterGeneration=</code> a comma-separated list (without whitespaces) of files that should be opened immediately after the generation, for instance a README.devel or a source file the user has to modify, the path is relative to the project directory (example: <code>ShowFilesAfterGeneration=src/main.cpp,src/plugin.cpp</code>). And
+ - <code>APPNAMEUC</code> will be replaced with the projectname in uppercase,
+ - <code>APPNAMELC</code> will be replaced with the projectname in lowercase,
+ - <code>APPNAME</code> will be replaced with the projectname.
+ .
+ - <code>DefaultDestinatonDir</code> changes the default destination dir for the project (~) to your value, whereas <code>HOMEDIR</code> is a keyword
+ .
+
+\attention The file <code>template-khello/khello</code> must have the same name as
+the right half of the directory! If the directory is <code>template-foobar</code>
+the file must be <code>template-foobar/foobar</code>.
+
+\see AppWizardPart for more information.
+
+\subsubsection templates_1_2c I.2.3. Some Additional Files
+
+The file
+ - <code>template-khello/appui.rc</code> contains information about the toolbar and the menu.
+ - <code>template-khello/preview.png</code> will be shown in the aplication wizard.
+ - <code>template-khello/app.desktop</code> describes the application.
+ - <code>template-khello/subdirs</code> contains a list of the subdirectories (usually <code>doc, po, src</code>) and can be found in the project root directory. It is necessary for the autotools.
+ .
+
+\subsubsection templates_1_2d I.2.4. The File template-khello/src-Makefile.am
+
+This file will be copied to the <code>$PROJECTDIR/src/</code>.
+\verbinclude khello/src-Makefile.am
+
+\subsubsection templates_1_2e I.2.5. The File template-khello/script
+
+The following script is used to install the template and replaces all
+variables by the corresponding value. The result is a hopefully working
+kdevelop project!
+\verbinclude khello/script
+<br>
+\note There are several application templates which use some identical
+files - that's why some files are taken from the <code>"template-common"</code>-directory.
+
+\section templates_2 II. Registration/Installation Of The Application Template
+
+The easiest way to install your template is to provide an "install.sh" shell script.\n
+Example:
+\code
+#!/bin/sh
+
+kde_prefix=`kde-config --prefix`
+if [ `id -u` = 0 ]; then
+ # we are root so install the template into the global kde directory
+ kde_dir=`kde-config --prefix`
+else
+ # we are a user so install it into $HOME/.kde/share/apps/kdevappwizard directory
+ kde_dir=`kde-config --localprefix`
+ echo "Note: It would be better to install as root. Press CTRL+C to abort"
+fi
+
+# use usual path or another one?
+echo "Install dir [${kde_dir}/share/apps/kdevappwizard]:"
+read newdir
+
+if [ "$newdir"a = a ]; then newdir="${kde_dir}/share/apps/kdevappwizard/"; fi
+
+# make sure the directories exist
+if [ ! -e "${newdir}/template-khello" ]; then mkdir -p "${newdir}/template-khello" ; fi;
+if [ ! -e "${newdir}/templates" ]; then mkdir -p "${newdir}/templates" ; fi;
+if [ ! -e "${newdir}" ]; then mkdir -p "$newdir" ; fi;
+if [ ! -e "${newdir}/template-common" ]; then ln -s "${kde_prefix}/share/apps/kdevappwizard/template-common" "${newdir}/template-common" ; fi;
+
+# install now
+cp -R --target-directory "$newdir" template-khello
+# the file template-khello/khello must go to the "templates" directory that
+# kdevelop knows that it exists
+mv "$newdir/template-khello/khello" "$newdir/templates/"
+echo "done"
+\endcode
+\n
+\attention Please test your template whether it installs and behaves correctly! Test, test and test again! ;)
+
+\section templates_3 III. How To Add The Template To KDevelop CVS HEAD
+
+This section is for kdevelop developers only. Most probably you don't have to read this!.\n
+Move the directory <code>"template-khello"</code> to <code>kdevelop/languages/cpp/app_templates/</code>
+and then add the following files in <code>kdevelop/languages/cpp/app_templates/template-khello/</code>
+(in this example the language is c++ if you use other language replace cpp with the language name):
+ - <code>".kdev_ignore"</code> is an empty file. It prevents KDevelop's
+ C++-parser from parsing the C++ template files. This is necessary because the template files are just code templates and not real code (yet).
+ - <code>".cvsignore"</code> looks like this:
+\code
+Makefile
+Makefile.in
+script.local
+\endcode
+ - <code>"Makefile.am"</code> looks like this:
+ \verbinclude khello/Makefile.am
+ .
+Finally add <code>"template-khello"</code> to "SUBDIRS = " in <code>kdevelop/languages/cpp/app_templates/Makefile.am</code>.\n
+\attention Please test your template whether it installs and behaves correctly!
+Test, test and test again! It works? Well - now talk to the kdevelop guys so
+that they know what's going on and probably you may commit. ;)
+
+\section templates_4 IV. Changes to the template system (VERY IMPORTANT)
+
+The entire app template system described above has been changed.
+To port a template to the new system the
+information from the script file will need to be moved into the ini file.
+The example is as follows:
+\code
+install(
+"${src}/template-chello/app.kdevelop","${dest}/${APPNAMELC}.kdevelop" );
+\endcode
+becomes
+\code
+[PROJECT]
+Type=install
+Source=%{src}/template-chello/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+\endcode
+
+Things like <code>installIncAdmin();</code> and <code>installGNU();</code> now involve unpacking
+the tar archives. This is done by creating a target in the ini file as
+follows:
+\code
+[GNU]
+Type=install archive
+Source=%{src}/template-common/gnu.tar.gz
+Dest=%{dest}
+\endcode
+
+The popular script functions convert as follows:
+\code
+installIncAdmin(); %{src}/template-common/incadmin.tar.gz
+installGNU(); %{src}/template-common/gnu.tar.gz
+installAdmin(); %{src}/template-common/admin.tar.gz
+installGnome(); %{src}/template-common/gnome.tar.gz
+installWX(); %{src}/template-common/wxwidgets.tar.gz
+\endcode
+
+
+To create directories is now:
+\code
+[SRC]
+Type= mkdir
+Dir=%{dest}/src
+\endcode
+
+New additions are as follows:
+\code
+[MGS]
+Type=message
+Comment=A simple C project was created in %{dest}.
+\endcode
+
+Will allow you to display a custom message when the template has
+finished installing. This is very handy for projects that require
+custom variables to be set.
+
+The concept of custom variables was also introduced. To create a
+variable that can be edited from the project wizard you need to add an
+entry as follows:
+\code
+[LIBS]
+Type = value
+ValueType=<Qt Data type>
+Value= <Value Name that will be substituted in the code>
+Comment= <The label in the UI>
+Default= <The default value>
+\endcode
+
+One special value can be used to turn targets on and off. This is done
+by adding a value as follows:
+\code
+[DOCSOPT]
+Type = value
+ValueType=bool
+Value=INSTALL_DOCS
+Comment= Install Docbook documentation templates.
+Default=true
+\endcode
+
+Then in the targets you wish to make optional you add the Option
+property with the value's name as the data. This will look as follows:
+\code
+[DOCSDIREN]
+Type=mkdir
+Dir=%{dest}/doc/en
+Option=INSTALL_DOCS
+\endcode
+
+The Option target is available to the mkdir, install, and install
+archive targets.
+
+The last new addition is the optional post processing of the files as
+they are copied. For install and install archive you can add a
+<code>Process=true</code> or <code>Process=false</code> to turn the processing on or off.
+
+A note on the UI. its not final, it will get better. Suggestions or
+bugs should be noted asap.
+
+*/
diff --git a/doc/api/HowToAddFileTemplates.dox b/doc/api/HowToAddFileTemplates.dox
new file mode 100644
index 00000000..fa6e630b
--- /dev/null
+++ b/doc/api/HowToAddFileTemplates.dox
@@ -0,0 +1,30 @@
+/** \file HowToAddFileTemplates.dox
+ * \brief How to add file templates to the file create part
+ */
+/** \page howToAddFileTemplates How to add file templates to the file create part
+
+File templates provide the developer with a basic file. They are prototypes for both source files of
+the project's language, and for other files that may be useful in the project. For example, a C++
+project may have templates for both .cpp and .h files, plus QT Designer .ui files, and supporting
+files such as XML.
+
+These prototypes are placed in <code>parts/filecreate/file-templates</code> dir or
+<code>languages/YOURLANGUAGE/file_templates</code> and have names equal to the extensions of language
+source files.
+
+Sometimes, different 'flavours' of template are required for a particular file type. In these
+instances, 'subtypes' can be defined to allow several different templates for a file type. An example
+of this are QT designer '.ui' files. KDevelop supplies several different templates for .ui
+files. Subtypes are named by the file type extension followed by a hyphen followed by an identifier
+for the subtype. E.g. ui-widget, ui-dialog
+
+The description of the prototypes is placed in <code>parts/filecreate/template-info.xml</code>. This
+file is fairly self-explanatory if you take a look at it.
+
+Note that templates and templates information can be edited within KDevelop itself. The global
+templates that can be made available to any project can be changed in Settings / Configure KDevelop... / New File
+Wizard; and project related settings can be changed in Project / Project Options / New File Wizard.
+
+That's all! :)
+
+*/
diff --git a/doc/api/HowToAddGenericBuildTools.dox b/doc/api/HowToAddGenericBuildTools.dox
new file mode 100644
index 00000000..b073cf0f
--- /dev/null
+++ b/doc/api/HowToAddGenericBuildTools.dox
@@ -0,0 +1,21 @@
+/** \file HowToAddGenericBuildTools.dox
+ * \brief How to add a generic build tool plugins to the generic build tool part
+ */
+
+/** \page howToAddGenericBuildTools How to add a generic build tool plugins to the generic build tool part
+
+This part offers build tool facilities using project files in xml format (dtd is located in buildtools/generic/kdevxmlproject.dtd).
+Those xml files can be converted into makefiles, ant xml files or simply shell scripts using build system plugins.
+Build system plugin is an object that implements KDevBuildSystem interface.
+Build system plugins are located in buildtools/generic/buildsystem.
+
+\section sectionStep1 Step 1: Make your plugin loadable
+
+For a plugin <code>foo</code>, create a file <code>foo.desktop</code> which contains KDevelop/Part in its list of ServiceTypes.
+
+The rest of this document is to be written.
+
+Document your plugin in the way described at \ref howToDocument (doc/api/HowToDocument.dox file).
+
+*/
+
diff --git a/doc/api/HowToAddPlugins.dox b/doc/api/HowToAddPlugins.dox
new file mode 100644
index 00000000..ce8f259a
--- /dev/null
+++ b/doc/api/HowToAddPlugins.dox
@@ -0,0 +1,204 @@
+/** \file HowToAddPlugins.dox
+ * \brief How to extend KDevelop via plugins
+ */
+
+/** \page howToAddPlugins How to extend KDevelop via plugins
+
+\section createDesktop Step 1: Make your plugin loadable
+
+For a plugin <code>foo</code>, create a file <code>foo.desktop</code> which contains KDevelop/Part in its list of ServiceTypes.
+
+ - See <code>parts/doctreeview/kdevdoctreeview.desktop</code> for an example.
+ .
+
+If you install this file into <code>\$(kde_servicesdir)</code>, your plugin will automatically be loaded.
+
+\subsection changeLoading How to change the default loading
+
+You can change the default loading by changing some settings in your <code>foo.desktop</code> file:
+
+ - Set <code>X-KDevelop-Scope=</code> to <code>Global</code> or
+ <code>Project</code>
+ - <b>Note:</b> This property is <i>not</i> optional
+ .
+ - You can add a list of programming languages which are supported by your
+ plugin
+ - If your plugin works with all languages leave the
+ <code>X-KDevelop-ProgrammingLanguages=</code> field empty
+ <i>(optional)</i>
+ .
+ - You can add a list of keywords.
+ - The plugin will only be loaded if all keywords match with the
+ <code>Keywords=</code> field in the projectfile <i>(optional)</i>.
+ .
+ .
+
+An example from the Java Debugger Plugin:
+
+<code><pre>
+ #######################
+ X-KDevelop-Scope=Project
+ X-KDevelop-ProgrammingLanguages=Java
+ Keywords=
+ ##########################
+</pre></code>
+
+
+\section createFactory Step 2: Make the plugin accessible by the factory
+
+Create a factory class <code>FooFactory</code> which inherits
+<code>KDevFactory</code>. Put a section
+
+<code><pre>
+ extern "C" {
+ void *init_libfoo()
+ {
+ return new FooFactory;
+ }
+ }
+</pre></code>
+
+into the source file, so that the factory can be accessed by KDE's library
+loader. Keep in mind that the name of the method <code>init_libfoo()</code> is
+required for a library with the name <code>libfoo.so</code>.
+
+This may be simplified by the use of the
+<code>K_EXPORT_COMPONENT_FACTORY</code> macro which is defined in
+<code>klibloader.h</code>:
+
+<code>
+K_EXPORT_COMPONENT_FACTORY( libfoo, FooFactory );
+</code>
+
+ - <i>Note:</i> Your factory must reimplement the
+ <code>createPartObject()</code> method of <code>KDevFactory</code> and
+ produce the part there.
+ .
+
+See <code>parts/doctreeview/doctreeviewfactory.cpp</code> for an example.
+
+
+\section implementPart Step 3: Implement your part.
+
+Your part must be derived from <code>KDevPlugin</code>.
+
+ - KDevPlugin takes two arguments:
+ - 1) A <i>parent</i> argument. This also comes from
+ <code>createPartObject()</code>.
+ - 2) A <i>name</i>, which in turn is given to the <code>QObject</code>
+ constructor.
+ .
+ .
+
+\subsection accessIDE How to access other IDE components
+
+A part can access other components of the IDE via some accessors
+of <code>KDevPlugin</code>:
+
+ - The <i>application core</i> via <code>core()</code>,
+ - the <i>build tools</i> via <code>project()</code>,
+ - the <i>programming language specific stuff</i> via
+ <code>languageSupport()</code>,
+ - the <i>make frontend</i> via <code>makeFrontend()</code>,
+ - the part which displays <i>appication output</i> via
+ <code>appFrontend()</code>,
+ and finally
+ - the <i>symbol database</i> via <code>classStore()</code>.
+ .
+
+In order to see what these components provide, see <code>lib/interfaces/kdev*.h</code>.
+
+\subsection userPrefs How to store user preferences
+
+Parts can also store user preferences on a per-project basis. To this
+end, they can access a <code>QDomDocument</code> representing the project file
+(which is stored as xml) via <code>document()</code>.
+
+Take attention to the issue that the project file usually is shared in a team of
+developers (e.g. via version control application CVS). So some user preferences might be
+very individual, and some may be valid for all of the team - project-wide so to speak.
+
+That's why the KDevelop architecture makes a difference here and supports two files
+which will be stored in the project root directory. They are the project file (*.kdevelop)
+and the session (*.kdevses) file. The later is for individual settings, not to be thought
+to be shared.
+
+\subsection domProject Project file (*.kdevelop)
+
+For your convenience, you don't have to use the quite complex DOM API. Strings
+can very easily be read from and written to this document using the
+<code>DomUtil</code> class. Here, entries are identified by a 'path' in the
+document. You can think of the DOM document as representing a file system
+rooted in the <code>dom</code> document node.
+
+For example, the <code>autoproject</code> part uses the statement
+
+<code><pre>
+ QString cflags = DomUtil::readEntry( *part->document(),
+ "/kdevautoproject/cflags" );
+</pre></code>
+
+to read the <code>CFLAGS</code> variable set by the user, and uses the statement similar to
+
+<code><pre>
+ DomUtil::writeEntry( *part->document(),
+ "kdevautoproject/cflags",
+ "--no-exceptions" );
+</pre></code>
+
+to write it back.
+
+ - <i>Note:</i> In order to avoid conflicts between different plugins, you
+ should use your part name as top-level 'directory' in the configuration
+ tree.
+ .
+
+\subsection sessionAccess Project session file (*.kdevses)
+
+The base class of all KDevelop plugins is KDevPlugin. It provides two virtual methods
+restorePartialProjectSession(..) and savePartialProjectSession(..)
+that you should reimplement in your special plugin to attach to session loading and saving.
+
+When KDevelop loads or closes a project, the program's project session manager
+(class ProjectSession) calls them for each plugin. That manager gives a QDOM node to the
+plugin where it can read out or build up its partial DOM subtree with the session settings.
+That subtree will be stored in the .kdevses file by that session manager.
+
+For example each programmer has set breakpoints in different files than the other ones of
+the team. So the debugger plugin saves them to project session file:
+
+<code><pre>
+void DebuggerPart::savePartialProjectSession(QDomElement* el)
+{
+ gdbBreakpointWidget->savePartialProjectSession(el);
+}
+void GDBBreakpointWidget::savePartialProjectSession(QDomElement* el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull()) return;
+ QDomElement breakpointListEl = domDoc.createElement("breakpointList");
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ Breakpoint* bp = btr->breakpoint();
+ QDomElement breakpointEl = domDoc.createElement("breakpoint"+QString::number(row));
+ breakpointEl.setAttribute("type", bp->type());
+ breakpointEl.setAttribute("location", bp->location(false));
+ breakpointEl.setAttribute("enabled", bp->isEnabled());
+ breakpointEl.setAttribute("condition", bp->conditional());
+ breakpointListEl.appendChild(breakpointEl);
+ }
+ if (!breakpointListEl.isNull()) el->appendChild(breakpointListEl);
+}
+
+}
+</pre></code>
+
+Note that the .kdevses is related to a project. User settings equal for all projects don't
+belong to here. You save them to ~/.kde/share/config/kdeveloprc via class KConfig of the
+kdecore library.
+
+Document your part in the way described at \ref howToDocument (doc/api/HowToDocument.dox file).
+
+*/
+
diff --git a/doc/api/HowToAddProgrammingLanguages.dox b/doc/api/HowToAddProgrammingLanguages.dox
new file mode 100644
index 00000000..5cfa3643
--- /dev/null
+++ b/doc/api/HowToAddProgrammingLanguages.dox
@@ -0,0 +1,252 @@
+/** \file HowToAddProgrammingLanguages.dox
+ * \brief How to add support for a programming language
+ */
+
+/** \page howToAddProgrammingLanguages How to add support for a programming language
+
+\section LSupport List of things to have "complete" support of a given language in KDevelop
+
+ - Implement interface KDevLanguageSupport
+ - \ref sectionClassWizard
+ - \ref sectionAttributeMethodWizard
+ - \ref sectionQtUiSubclassing - (if the language has Qt bindings)
+ - \ref sectionLanguageParser
+ - \ref sectionClassStore
+ - \ref sectionMemoryClassStore
+ - \ref sectionPersistantClassStore
+ .
+ - \ref sectionCodeCompletion
+ - \ref sectionProblemReporter - (parses source on the fly and reports syntax errors)
+ - \ref sectionTemplates
+ - \ref sectionApplicationTemplates
+ - \ref sectionApplicationImportTemplates
+ - \ref sectionSourceFileTemplates
+ - \ref sectionAbbreviationTemplates - (ife expands to an if else statement, etc)
+ .
+ - \ref sectionSourceCodeFormater (prettyprint functionality)
+ - \ref sectionDocumentationTopics
+ - \ref sectionDebugger
+ - (gdb/jdb/??? integration)
+ - \ref sectionCompilerPlugins
+ .
+
+List of optional things to support a given language in KDevelop:
+ - \ref sectionEditor - Syntax highlighter - (add to QEditor if not available elsewhere)
+ - \ref sectionBuildTool (make/ant/etc)
+ .
+
+Take a look at \ref LangSupportStatus (doc/api/LangSupportStatus.dox file) to see the current status/features of the programming languages currently supported by KDevelop.
+
+
+
+
+\section sectionLanguageSupport Language Support
+
+Any language support should be written as a kdevelop part and implement
+KDevLanguageSupport interface (<code>lib/interfaces/kdevlanguagesupport.h</code>).
+
+Implementing methods:
+ - <code>virtual Features features();</code>
+ - <code>virtual KMimeType::List mimeTypes();</code>
+ .
+
+Should be enough for a language support to start working.
+
+KDevelop ships with KDevLang project template. It is a simple language support prototype that can be used when developing language support plugins with KDevelop.
+To use it, start a New Project and select: <code>C++->KDevelop->KDevelop Language Support Plugin</code> in the application wizard.
+The template is located in <code>languages/cpp/app_templates/kdevlang</code>, you can change it there if you need.
+
+
+You should look at <code>languages/ruby</code> for a simple language support
+implementation. For a compilable language support, consult <code>languages/ada</code> or <code>languages/pascal</code> (they are not so complex as <code>languages/cpp</code>).
+
+Pascal would be a good starting place, as it is the smaller of the two by far.
+
+Language support can offer additional features:
+
+\subsection sectionClassWizard Class wizard
+ - new class wizard: (See <code>ada, php, cpp</code> or <code>java</code>)
+ - <code>virtual void addClass();</code>
+ .
+
+\subsection sectionAttributeMethodWizard Attribute/Method wizard
+ - add method dialog: (See <code>cpp</code> or <code>java</code>)
+ - <code>virtual void addMethod(const QString &className);</code>
+ .
+ - add attribute dialog: (See <code>cpp</code> or <code>java</code>)
+ - <code>virtual void addAttribute(const QString &className);</code>
+ .
+ .
+
+\subsection sectionQtUiSubclassing Qt UI subclassing
+
+If there is a Qt bindings for your language and there is a possibility
+to use QtDesigner ui files, you could implement ui subclassing feature:
+ - <code>virtual QStringList subclassWidget(const QString& formName);</code>
+ - <code>virtual QStringList updateWidget(const QString& formName, const QString&
+ fileName);</code>
+ .
+
+See <code>cpp</code> and <code>java</code> for examples.
+
+\subsection sectionLanguageParser Language parser
+
+In general, class stores can be filled with information without specialized
+and complex language parsers (take a look at <code>languages/python</code> that have a very simple python parser) but your language support will surely benefit
+from having such. There is a hand-written c/c++ parser (<code>lib/cppparser</code>) in KDevelop that might be used for ObjC or related C-based languages.
+
+Other (not so complex as c++) languages can be parsed by ANTLR based parsers (library is in lib/antlr).
+Consult www.antlr.org for a ANTLR documentation and look at <code>languages/java</code>, <code>languages/ada</code> and <code>languages/pascal</code> for an example of using such parsers.
+The latest version of ANTLR (2.7.2) has support for Java, C, Pascal, Ada, C++, CIM, HTML, IDL, Verilog, VRML, OCL, ASN.1, and SQL. You can write an ANTLR parser for your own language, of course.
+
+\subsection sectionClassStore Class store
+
+If you write (or have) a language parser, your language support can have
+"class store" (a database containing the information about scopes, classes
+and methods - their names, names of source files, location in source files,
+etc.). Class store libraries can be found at <code>lib/catalog</code> (Catalog) and <code>lib/interfaces</code> (CodeModel).
+
+KDevelop provides class browsers that extract information from a <b>class store</b> and display it in a tree view and toolbar selectors of scopes, classes and methods.
+
+\subsubsection sectionMemoryClassStore Memory class store
+CodeModel is the memory class store. It is very efficient and thus it is recommended for using as a project class store. CodeModel libraries are located in <code>lib/interfaces/codemodel.h</code>. The class browser for a CodeModel based stores is <code>parts/classview</code>.
+
+\subsubsection sectionPersistantClassStore Persistant class store
+Catalog is the persistant class store for KDevelop. Persistant class store can be used as an information storage for code completion but it also can be used as a class store for the project. Take a look at
+<code>languages/cpp</code> for an example of using catalog. Catalog is stored on disk in the database file (Berkeley db) If you use catalog with the project, your class browser will be <code>parts/classbrowser</code>.
+
+\subsection sectionCodeCompletion Code completion
+Class store enables you to write a code completion for the language. At the
+moment (2003-06-25), code completion is available only to cpp so take a
+look at it for an example.
+
+\subsection sectionProblemReporter Problem reporter
+
+If you have a language parser, you can implement <b>problem reporter</b>
+functionality for your language. The problem reporter catches errors
+reported by a parser and displays it in a problem reporter view.
+<code>languages/java</code>, <code>languages/ada</code>, <code>languages/pascal</code> and <code>languages/cpp</code> have problem reporters.
+
+\subsection sectionTemplates Templates
+
+\subsubsection sectionApplicationTemplates Application templates
+
+<b>Application wizard</b> templates should be also written. Appwizard templates are simple to create - consult \ref howToAddApplicationTemplates (HowToAddApplicationTemplates.dox file)
+and look at <code>languages/ruby/app_templates/rubyhello</code>, <code>languages/pascal/app_templates/pascalhello</code>, or <code>languages/ada/app_templates/adahello</code>.
+
+\subsubsection sectionApplicationImportTemplates Application import templates
+
+KDevelop has the ability to <b>create a new project from existing projects or source code</b>.
+It scans for project files ('*.kdevelop, *.kdevprj, *.studio, *.pro) and if
+ - it finds a project it extracts the necessary information
+ - it does not find project files it scans for source files (*.cpp, *.java, *.pl, *.py, ...)
+ .
+and creates a new KDevelop project in the direcotry the user has chosen.
+
+\subsubsection sectionSourceFileTemplates Source file templates
+
+Another thing to do is to create <b>file create templates</b>. They are prototypes for a source files of your language. These prototypes are placed in
+<code>parts/filecreate/file-templates</code> dir or <code>languages/YOURLANGUAGE/file_templates</code> and have names equal to the extensions of language source files.
+The description of the prototypes is placed in <code>parts/filecreate/template-info.xml</code>.
+
+Consult FileCreatePart (parts/filecreate/README.dox file) and \ref howToAddFileTemplates for further information.
+
+\subsubsection sectionAbbreviationTemplates Code abbreviation templates
+
+KDevelop has a support for <b>code abbreviations</b> so you can add some predefined abbreviations to your language support. Take <code>languages/cpp/cpptemplates</code> as an example.
+
+
+\subsection sectionSourceCodeFormater Source code formater
+
+Implement a KDevSourceFormater class interface.
+To obtain source formater functionality (that is already available to
+c-based languages) you can extend astyle library (<code>lib/astyle</code>) that is used by KDevelop to format sources.
+Take a look at AStylePart for an example how to do it.
+
+\subsection sectionDocumentationTopics Documentation topics
+
+Add them to <code>languages/YOURLANGUAGE/doc</code>. For an example see <code>languages/python/doc/python.toc</code> and <code>languages/python/doc/python.index</code>
+In the end you need to edit the <code>languages/YOURLANGUAGE/doc/Makefile.am</code> file to include the .toc and/or .index file.
+
+\subsection sectionDebugger Debugger
+
+The last thing to have a complete language support in KDevelop is to
+write a <b>Debugger </b>. KDevelop already provides GDB support
+(<code>languages/cpp/debugger</code>) and JDB (java debugger) support (<code>languages/java/debugger</code>). Take a look at them to get inspiration.
+
+\subsection sectionCompilerPlugins Compiler plugins
+
+There is an ability to create compiler plugin for KDevelop. Compiler plugin provides the compiler configuration dialog which implements command line compiler options.
+Compiler plugins must implement KDevCompilerOptions interface.
+
+
+\section MiscInf Other Info
+
+In the end you should add the language you implemented to the doc/api/LangSupportStatus.dox file and
+document your language support part in the way described at \ref howToDocument (doc/api/HowToDocument.dox file).
+See also \ref howToAddPlugins (doc/api/HowToAddPlugins.dox file) for an information on how to create a generic KDevelop plugin and how to manage project and global configuration information.
+
+
+
+
+
+\section sectionEditor Language Editor
+
+To edit source files KDevelop uses any editor that supports the KTextEditor
+interface. The current supported editors and their features are listed
+in the \ref EditorsSupportStatus (doc/api/EditorsSupportStatus.dox file) page.
+
+In case none of the editors does support advanced editing of sources
+written in your language (like code folding, syntax highlighting, line
+indentation) you can improve QEditor included in KDevelop (<code>editors/qeditor</code>).
+By creating QEditorIndenter and QSourceColorizer descendants you can provide the support for an automatic indentation and syntax highlighting that will be available for sure in KDevelop.
+
+
+
+
+
+
+\section sectionBuildTool Build Tool
+
+The language support is important, but it is unusable without a <b>build tool</b>
+that can manage projects written on this language. KDevelop
+currently provides several build tools. They are:
+
+ - ANT build tool
+ - see AntProjectPart at <code>buildtools/ant</code>
+ .
+ - Autotools build tool
+ - see AutoProjectPart at <code>buildtools/autotools</code>
+ .
+ - Custom build tool
+ - see CustomProjectPart at <code>buildtools/custommakefiles</code>
+ - (works with custom makefiles, also has ant support)
+ .
+ - Generic build tool
+ - see GenericProjectPart at <code>buildtools/generic</code>
+ - Offers build tool facilities using project files in xml format (dtd is located in <code>buildtools/generic/kdevxmlproject.dtd</code>).
+ Those xml files can be converted into makefiles, ant xml files or simply shell scripts using build system plugins.
+ Build system plugin is an object that implements KDevBuildSystem interface. Build system plugins are located in <code>buildtools/generic/buildsystem</code>.
+ .
+ - QMake build tool
+ - see TrollProjectPart at <code>buildtools/qmake</code>
+ .
+ .
+
+Also available:
+ - Script build tool
+ - <code>buildtools/script</code>
+ - (the generic build tool for all scripting languages).
+ .
+ - <code>buildtools/pascal</code> and
+ - <code>buildtools/ada</code>
+ - <code>buildtools/haskell</code>
+ .
+
+(They are deprecated build tools that will be replaced with the generic build tool).
+
+Choose your build tool and if the existing build tools doesn't fit
+in, extend generic build tool via build system plugin. \ref howToAddGenericBuildTools page (doc/api/HowToAddGenericBuildTools.dox file) helps you to do it.
+
+
+*/
diff --git a/doc/api/HowToDocument.dox b/doc/api/HowToDocument.dox
new file mode 100644
index 00000000..d606a8bf
--- /dev/null
+++ b/doc/api/HowToDocument.dox
@@ -0,0 +1,39 @@
+/** \file HowToDocument.dox
+ * \brief How to document KDevelop parts
+ */
+/** \page howToDocument How to document KDevelop parts
+
+You should add a README and a README.dox file to your part (KDevPlugin).
+
+On the README file put this text:
+\verbatim
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
+\endverbatim
+
+On the README.dox file put the mandatory information:
+\verbatim
+/** \class yourPartClassName
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+...
+
+/*
+\endverbatim
+
+<b>IMPORTANT:</b> You should replace <code>yourPartClassName</code> with the name of the class that
+implements your part.
+
+On the area marked with <code>...</code> you can add optional informations. Here is an example of that:
+
+\verbinclude languages/cpp/app_templates/kdevpart/README.dox
+
+All these infos are optional and you should only add the link to the bugzilla database if YOUR_COMPONENT_NAME
+has been defined in that database.
+
+*/
diff --git a/doc/api/LangSupportStatus.dox b/doc/api/LangSupportStatus.dox
new file mode 100644
index 00000000..fa08cc67
--- /dev/null
+++ b/doc/api/LangSupportStatus.dox
@@ -0,0 +1,330 @@
+/** \file LangSupportStatus.dox
+ * \brief Programming Languages Support Status
+ */
+
+/** \page LangSupportStatus Programming Languages Support Status
+
+\ref howToAddProgrammingLanguages (doc/api/HowToAddProgrammingLanguages.dox file) for step by step info on how to implement these features.
+
+<table border="1">
+ <tr>
+ <th scope=col>Feature/Language</th>
+ <th scope=col><a href="classAdaSupportPart.html">Ada</a></th>
+ <th scope=col><a href="classBashSupportPart.html">Bash</a></th>
+ <th scope=col><a href="classCppSupportPart.html">C/C++</a></th>
+ <th scope=col><a href="classFortranSupportPart.html">Fortran</a></th>
+ <th scope=col><a href="classHaskellSupportPart.html">Haskell</a></th>
+ <th scope=col><a href="classJavaSupportPart.html">Java</a></th>
+ <th scope=col><a href="classPascalSupportPart.html">Pascal</a></th>
+ <th scope=col><a href="classPerlSupportPart.html">Perl</a></th>
+ <th scope=col><a href="classPHPSupportPart.html">PHP</a></th>
+ <th scope=col><a href="classPythonSupportPart.html">Python</a></th>
+ <th scope=col><a href="classRubySupportPart.html">Ruby</a></th>
+ <th scope=col><a href="classSQLSupportPart.html">SQL</a></th>
+ </tr>
+ <tr>
+ <td>\ref sectionClassWizard</td>
+ <td bgcolor="cyan">Y</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ </tr>
+ <tr>
+ <td>\ref sectionAttributeMethodWizard</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ </tr>
+ <tr>
+ <td>\ref sectionQtUiSubclassing</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">N/A</td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>\ref sectionLanguageParser</td>
+ <td bgcolor="green">ANTLR</td>
+ <td bgcolor="yellow">Internal</td>
+ <td bgcolor="green">cppparser</td>
+ <td bgcolor="yellow">Internal</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">ANTLR</td>
+ <td bgcolor="yellow">ANTLR</td>
+ <td bgcolor="yellow">Internal</td>
+ <td bgcolor="yellow">Internal</td>
+ <td bgcolor="yellow">Internal</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionMemoryClassStore</td>
+ <td bgcolor="cyan">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="yellow">CodeModel</td>
+ <td bgcolor="cyan">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="green">CodeModel</td>
+ <td bgcolor="green">N</td>
+ <td bgcolor="green">Y</td>
+ </tr>
+ <tr>
+ <td>\ref sectionPersistantClassStore</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Catalog</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ </tr>
+ <tr>
+ <td>\ref sectionCodeCompletion</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="cyan">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionProblemReporter</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>\ref sectionApplicationTemplates</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="yellow">Y</td>
+ </tr>
+ <tr>
+ <td>\ref sectionApplicationImportTemplates</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionSourceFileTemplates</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionAbbreviationTemplates</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionSourceCodeFormater</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>\ref sectionDocumentationTopics</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="cyan">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>\ref sectionDebugger</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="yellow">Y</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+ <tr>
+ <td>\ref sectionCompilerPlugins</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">N/A</td>
+ <td bgcolor="green">gcc</td>
+ <td bgcolor="green">PGHPF, PGF77</td>
+ <td bgcolor="green">Glasgow</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="green">Delphi, Free Pascal</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ <td bgcolor="red">N</td>
+ </tr>
+</table>
+<br>
+Legend:
+<br>
+<table>
+ <tr>
+ <td bgcolor="red"></td>
+ <td>Feature has not been implemented</td>
+ </tr>
+ <tr>
+ <td bgcolor="cyan"></td>
+ <td>Feature is in alpha state, the development has only been started or the feature is turned off at the moment</td>
+ </tr>
+ <tr>
+ <td bgcolor="yellow"></td>
+ <td>Feature is in beta state or it is unfinished</td>
+ </tr>
+ <tr>
+ <td bgcolor="green"></td>
+ <td>Feature is considered to be complete or complete enough for the release</td>
+ </tr>
+ <tr>
+ <td>N/A</td>
+ <td>Feature is not applicable for given language</td>
+ </tr>
+ <tr>
+ <td>Sourceinfo</td>
+ <td>Deprecated class store that should be replaced by a CodeModel
+ <br>Features implemented with Sourceinfo should not be marked as complete</td>
+ </tr>
+ <tr>
+ <td>CodeModel</td>
+ <td>New memory class store</td>
+ </tr>
+ <tr>
+ <td>Catalog</td>
+ <td>New persistant class store using Berkeley DB storage backend</td>
+ </tr>
+ <tr>
+ <td>ANTLR</td>
+ <td>Language parser is generated by ANTLR parser generator, http://www.antlr.org</td>
+ </tr>
+ <tr>
+ <td>cppparser</td>
+ <td>New c/c++ parser written by Roberto Raggi for KDevelop</td>
+ </tr>
+ <tr>
+ <td>Internal</td>
+ <td>Language parser is included in language support part</td>
+ </tr>
+</table>
+
+*/
+
diff --git a/doc/api/Mainpage.dox b/doc/api/Mainpage.dox
new file mode 100644
index 00000000..9d4b6d4c
--- /dev/null
+++ b/doc/api/Mainpage.dox
@@ -0,0 +1,91 @@
+/** \file Mainpage.dox
+ \brief The main page of the doxygen generated %API Documentation
+*/
+
+/**
+\mainpage The KDevelop %API %Documentation
+
+KDevelop is an easy to use IDE (Integrated Development Environment) for developing applications under X11.
+
+\section intro Introduction
+
+This document is targeted at all those that want to add or improve KDevelop's source code.
+If you are instead looking for a user manual, just go to the help menu of your KDevelop and select KDevelop handbook.
+This documentation contains the KDevelop online class reference for the current
+development version of KDevelop. Additionally, you
+can subscribe or read the <a href="http://www.kdevelop.org/index.html?filename=mailinglist.html">mailing list</a> for any additions and/or
+modifications to the %API.
+
+An on-line, updated every 24H, html version of this documentation can be found at: http://www.kdevelop.org/HEAD/doc/api/html/index.html
+
+More information about the KDevelop architecture in form of tutorials, HOWTOs,
+and FAQs can be found at
+the <a href="http://www.kdevelop.org">KDevelop website</a>.
+
+
+\section status Current Status
+
+Here you can see the current \ref requirements and the \ref features.
+There is also a \ref LangSupportStatus (doc/api/LangSupportStatus.dox file) page and a \ref EditorsSupportStatus (doc/api/EditorsSupportStatus.dox file) page.
+
+
+\section expand How to expand KDevelop
+
+First of all read the \ref architecture (doc/api/Architecture.dox file) then you can find more information on how to expand KDevelop:
+ - \ref howToAddPlugins (doc/api/HowToAddPlugins.dox file)
+ - \ref howToAddProgrammingLanguages (doc/api/HowToAddProgrammingLanguages.dox file)
+ - \ref howToAddApplicationTemplates (doc/api/HowToAddApplicationTemplates.dox file)
+ - \ref howToAddFileTemplates (doc/api/HowToAddFileTemplates.dox file)
+ - \ref howToAddGenericBuildTools (doc/api/HowToAddGenericBuildTools.dox file)
+
+Additionally you may also want to find out \ref howToDocument (doc/api/HowToDocument.dox file).
+
+\section PlannedTasks Planned tasks
+
+Here is a priority ordered list:
+ -# \ref HighPriTasks (doc/api/HighPriTasks.dox file)
+ -# fix the dispersed \ref fixme
+ -# <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=bugs.bug_id">reported bugs in bugzilla database</a>
+ -# fix the bugs in the \ref bug
+ -# fix the dispersed \ref todo all over the code.
+ .
+There are some \ref unmaintained parts in KDevelop. You migth want to "adopt" one. :)\n
+There is also \ref FutureTasks (doc/api/FutureTasks.dox file). Put all ideas for the future KDevelop releases there. It is also a good place to comment on those ideas.
+
+\section misc Misc
+
+ - \ref authors
+ - \ref maintainers
+ - \ref FAQ
+ - \ref deprecated
+
+\section misc_libs Miscellaneous libraries included in KDevelop
+ - \ref PropEditor
+
+\section howTobuildAPIlocalcopy How to build a local copy of this documentation
+
+This documentation is very large and changes with every cvs commit, therefore is not available for download.
+To build your local copy of this documentation you have two choices, depending on your system configuration.
+ - If you have doxygen >= 1.3.4 , PHP >= 4.10 and a local running webserver then
+ - make apidox
+ - make install-apidox (as root)
+ .
+ - If you have an older system then
+ - setenv KDEDIR=/location_of_your_kde_instalation
+ - setenv QTDIR=/location_of_your_qt_instalation
+ - doxygen Doxyfile
+ - make install-apidox (as root)
+ .
+ .
+
+The advantage of the first method is that you'll get a search engine in your documentation if you read your
+documentation using your local webserver.
+
+\section License
+
+Permission is granted to copy, distribute and/or modify this document under
+the terms of the GNU Free %Documentation License, Version 1.2 or any later
+version published by the Free Software Foundation; For details see
+http://www.gnu.org/copyleft/fdl.html .
+
+*/
diff --git a/doc/api/PropEditor.dox b/doc/api/PropEditor.dox
new file mode 100644
index 00000000..b4f4eccc
--- /dev/null
+++ b/doc/api/PropEditor.dox
@@ -0,0 +1,108 @@
+/** \file PropEditor.dox
+ \brief The KDevelop Property Editor library description page
+*/
+
+/** \page PropEditor KDevelop Property Editor library description
+
+\section whatis What is Property Editor?
+
+%Property editor is a collection of facilities to store and edit the
+properties of an object. For example, look at %Qt Designer. Each widget
+has a list of properties that can be edited in a nice table form.
+Same ideology is used to edit properties in Kugar Report Designer
+(from KOffice distribution). In KDevelop project manager can also display
+the properties of currently selected build item in property editor.
+
+\section over Library Overview
+
+This PropertyEditor library is a redesign of Kugar property editing library
+with the goal to be more generic and extensible.
+
+Library provides a @ref PropertyLib::Property class which stores property name, value and some
+more important information like description or the list of possible values.
+Using @ref PropertyLib::Property class adds more overhead over Q_PROPERTY but provides more
+flexibility. You can subclass @ref PropertyLib::Property and create your custom properties.
+Custom properties can have either predefined type (see @ref PropertyLib::PropertyType) or
+custom type. Custom type should be used if a custom property editor widget is
+necessary.
+
+Properties are organized into lists. @ref PropertyLib::PropertyList is designed
+to store such lists in most efficient manner. It also allows to group
+properties (for example think about "geometrical" properties like "x", "y", etc.).
+
+Property lists can be displayed in @ref PropertyLib::PropertyEditor widget which will
+display them in a table form. Note that @ref PropertyLib::PropertyEditor takes not
+a @ref PropertyLib::PropertyList object, but @ref PropertyLib::PropertyAccessor instead.
+
+@ref PropertyLib::PropertyAccessor is designed to provide a method to access an intersection
+of property lists. For example, let's consider object A with property list a_list
+abd object B with list b_list. Now let's imagine we want to display common properties
+from a_list and b_list in one @ref PropertyLib::PropertyEditor widget. Obviously, we need to
+"intersect" a_list with b_list and display the result of intersection.
+This is why @ref PropertyLib::PropertyAccessor is used for editing. If we change
+the value of a property in the editor, @ref PropertyLib::PropertyAccessor will update
+both properties from underlying a_list and b_list.
+
+@ref PropertyLib::PropertyEditor at the same time shows only one editor for selected
+property in the list. Each @ref PropertyLib::PropertyType has corresponding @ref PropertyLib::PropertyWidget
+which displays property editor or draws a property in the list if it is not edited.
+More exactly, if @ref PropertyLib::PropertyEditor needs to display editor widget, it displays
+@ref PropertyLib::PropertyWidget, else it calls @ref PropertyLib::PropertyWidget::drawViewer function.
+Custom property widgets should be subclasses of @ref PropertyLib::PropertyWidget.
+
+To create property widgets at runtime, a factory is used. Factory class is
+called @ref PropertyLib::PropertyMachineFactory. Static function @ref PropertyLib::PropertyMachineFactory::getInstance
+can be used to obtain the reference to the factory instance. Factory creates and returns
+so-called @ref Machine for each registered property type (either predefined or user defined).
+
+@ref Machine contains @ref PropertyLib::PropertyWidget and a list of "detailed" machines.
+Usually only property widget is necessary for a property but there are
+complex properties like "Font" for example. We would like to see separate editors
+for font family, size, etc. and a button to choose all of these in the dialog.
+For that "Font" property, a PropertyWidget with a "choose font" button
+and also number of detailed widgets like "font family" combo, etc. can be created.
+
+\section Examples
+A simple example on how to create a property editor and use it with one property list:
+\code
+ PropertyEditor *m_editor = new PropertyEditor(this);
+
+ PropertyList *list = new PropertyList;
+ list->addProperty("My Group", new Property(Integer, "First Property",
+ "This is my first property", -5));
+ list->addProperty("My Group", new Property(String, "Second Property",
+ "This is my second property", "Hello"));
+ list->addProperty(new Property(Color, "Third Property",
+ "This is my third property", QColor("green")));
+
+ m_editor->populateProperties(*list);
+\endcode
+
+More advanced example with property accessors and list intersection:
+\code
+ PropertyEditor *m_editor = new PropertyEditor(this);
+
+ PropertyList *list = new PropertyList;
+ list->addProperty("My Group", new Property(Integer, "First Property",
+ "This is my first property", -5));
+ list->addProperty("My Group", new Property(String, "Second Property",
+ "This is my second property", "Hello"));
+ list->addProperty(new Property(Color, "Third Property",
+ "This is my third property", QColor("green")));
+
+ PropertyList *list2 = new PropertyList;
+ list2->addProperty("My Group", new Property(Integer, "First Property",
+ "This is my first property", -7));
+ list2->addProperty("My Group", new Property(String, "Second Property",
+ "This is my second property", "Hello"));
+ list2->addProperty(new Property(String, "Third Property",
+ "This is my third property", "green"));
+
+ PropertyAccessor *ac = list->intersect(*list2);
+
+ m_editor->populateProperties(ac);
+\endcode
+In this example only properties named "First Property" and "Second Property" will be shown in editor.
+"Third Property" has different types in list and list2 and will not be included in intersection.
+
+*/
diff --git a/doc/api/propeditor1.png b/doc/api/propeditor1.png
new file mode 100644
index 00000000..854b91f6
--- /dev/null
+++ b/doc/api/propeditor1.png
Binary files differ
diff --git a/doc/api/propeditor2.png b/doc/api/propeditor2.png
new file mode 100644
index 00000000..66f8a75b
--- /dev/null
+++ b/doc/api/propeditor2.png
Binary files differ
diff --git a/doc/extras/Makefile.am b/doc/extras/Makefile.am
new file mode 100644
index 00000000..0e7893c4
--- /dev/null
+++ b/doc/extras/Makefile.am
@@ -0,0 +1,8 @@
+SUBDIRS=w3c
+
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = sdl.toc opengl.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/doc/extras/opengl.toc b/doc/extras/opengl.toc
new file mode 100644
index 00000000..efe104ff
--- /dev/null
+++ b/doc/extras/opengl.toc
@@ -0,0 +1,267 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>OpenGL</title>
+<tocsect1 name="GL Functions">
+ <tocsect2 name="glAccum" url="man:glAccum"/>
+ <tocsect2 name="glActiveTextureARB" url="man:glActiveTextureARB"/>
+ <tocsect2 name="glAlphaFunc" url="man:glAlphaFunc"/>
+ <tocsect2 name="glAreTexturesResident" url="man:glAreTexturesResident"/>
+ <tocsect2 name="glArrayElement" url="man:glArrayElement"/>
+ <tocsect2 name="glBegin" url="man:glBegin"/>
+ <tocsect2 name="glBindTexture" url="man:glBindTexture"/>
+ <tocsect2 name="glBitmap" url="man:glBitmap"/>
+ <tocsect2 name="glBlendColor" url="man:glBlendColor"/>
+ <tocsect2 name="glBlendEquation" url="man:glBlendEquation"/>
+ <tocsect2 name="glBlendFunc" url="man:glBlendFunc"/>
+ <tocsect2 name="glCallList" url="man:glCallList"/>
+ <tocsect2 name="glCallLists" url="man:glCallLists"/>
+ <tocsect2 name="glClear" url="man:glClear"/>
+ <tocsect2 name="glClearAccum" url="man:glClearAccum"/>
+ <tocsect2 name="glClearColor" url="man:glClearColor"/>
+ <tocsect2 name="glClearDepth" url="man:glClearDepth"/>
+ <tocsect2 name="glClearIndex" url="man:glClearIndex"/>
+ <tocsect2 name="glClearStencil" url="man:glClearStencil"/>
+ <tocsect2 name="glClientActiveTextureARB" url="man:glClientActiveTextureARB"/>
+ <tocsect2 name="glClipPlane" url="man:glClipPlane"/>
+ <tocsect2 name="glColor" url="man:glColor"/>
+ <tocsect2 name="glColorMask" url="man:glColorMask"/>
+ <tocsect2 name="glColorMaterial" url="man:glColorMaterial"/>
+ <tocsect2 name="glColorPointer" url="man:glColorPointer"/>
+ <tocsect2 name="glColorSubTable" url="man:glColorSubTable"/>
+ <tocsect2 name="glColorTable" url="man:glColorTable"/>
+ <tocsect2 name="glColorTableParameter" url="man:glColorTableParameter"/>
+ <tocsect2 name="glConvolutionFilter1D" url="man:glConvolutionFilter1D"/>
+ <tocsect2 name="glConvolutionFilter2D" url="man:glConvolutionFilter2D"/>
+ <tocsect2 name="glConvolutionParameter" url="man:glConvolutionParameter"/>
+ <tocsect2 name="glCopyColorSubTable" url="man:glCopyColorSubTable"/>
+ <tocsect2 name="glCopyColorTable" url="man:glCopyColorTable"/>
+ <tocsect2 name="glCopyConvolutionFilter1D" url="man:glCopyConvolutionFilter1D"/>
+ <tocsect2 name="glCopyConvolutionFilter2D" url="man:glCopyConvolutionFilter2D"/>
+ <tocsect2 name="glCopyPixels" url="man:glCopyPixels"/>
+ <tocsect2 name="glCopyTexImage1D" url="man:glCopyTexImage1D"/>
+ <tocsect2 name="glCopyTexImage2D" url="man:glCopyTexImage2D"/>
+ <tocsect2 name="glCopyTexSubImage1D" url="man:glCopyTexSubImage1D"/>
+ <tocsect2 name="glCopyTexSubImage2D" url="man:glCopyTexSubImage2D"/>
+ <tocsect2 name="glCopyTexSubImage3D" url="man:glCopyTexSubImage3D"/>
+ <tocsect2 name="glCullFace" url="man:glCullFace"/>
+ <tocsect2 name="glDeleteLists" url="man:glDeleteLists"/>
+ <tocsect2 name="glDeleteTextures" url="man:glDeleteTextures"/>
+ <tocsect2 name="glDepthFunc" url="man:glDepthFunc"/>
+ <tocsect2 name="glDepthMask" url="man:glDepthMask"/>
+ <tocsect2 name="glDepthRange" url="man:glDepthRange"/>
+ <tocsect2 name="glDisable" url="man:glDisable"/>
+ <tocsect2 name="glDisableClientState" url="man:glDisableClientState"/>
+ <tocsect2 name="glDrawArrays" url="man:glDrawArrays"/>
+ <tocsect2 name="glDrawBuffer" url="man:glDrawBuffer"/>
+ <tocsect2 name="glDrawElements" url="man:glDrawElements"/>
+ <tocsect2 name="glDrawPixels" url="man:glDrawPixels"/>
+ <tocsect2 name="glDrawRangeElements" url="man:glDrawRangeElements"/>
+ <tocsect2 name="glEdgeFlag" url="man:glEdgeFlag"/>
+ <tocsect2 name="glEdgeFlagPointer" url="man:glEdgeFlagPointer"/>
+ <tocsect2 name="glEnable" url="man:glEnable"/>
+ <tocsect2 name="glEnableClientState" url="man:glEnableClientState"/>
+ <tocsect2 name="glEnd" url="man:glEnd"/>
+ <tocsect2 name="glEndList" url="man:glEndList"/>
+ <tocsect2 name="glEvalCoord" url="man:glEvalCoord"/>
+ <tocsect2 name="glEvalMesh" url="man:glEvalMesh"/>
+ <tocsect2 name="glEvalPoint" url="man:glEvalPoint"/>
+ <tocsect2 name="glFeedbackBuffer" url="man:glFeedbackBuffer"/>
+ <tocsect2 name="glFinish" url="man:glFinish"/>
+ <tocsect2 name="glFlush" url="man:glFlush"/>
+ <tocsect2 name="glFog" url="man:glFog"/>
+ <tocsect2 name="glFrontFace" url="man:glFrontFace"/>
+ <tocsect2 name="glFrustum" url="man:glFrustum"/>
+ <tocsect2 name="glGenLists" url="man:glGenLists"/>
+ <tocsect2 name="glGenTextures" url="man:glGenTextures"/>
+ <tocsect2 name="glGet" url="man:glGet"/>
+ <tocsect2 name="glGetBooleanv" url="man:glGetBooleanv"/>
+ <tocsect2 name="glGetClipPlane" url="man:glGetClipPlane"/>
+ <tocsect2 name="glGetColorTable" url="man:glGetColorTable"/>
+ <tocsect2 name="glGetColorTableParameter" url="man:glGetColorTableParameter"/>
+ <tocsect2 name="glGetConvolutionFilter" url="man:glGetConvolutionFilter"/>
+ <tocsect2 name="glGetConvolutionParameter" url="man:glGetConvolutionParameter"/>
+ <tocsect2 name="glGetDoublev" url="man:glGetDoublev"/>
+ <tocsect2 name="glGetError" url="man:glGetError"/>
+ <tocsect2 name="glGetFloatv" url="man:glGetFloatv"/>
+ <tocsect2 name="glGetHistogram" url="man:glGetHistogram"/>
+ <tocsect2 name="glGetHistogramParameter" url="man:glGetHistogramParameter"/>
+ <tocsect2 name="glGetIntegerv" url="man:glGetIntegerv"/>
+ <tocsect2 name="glGetLight" url="man:glGetLight"/>
+ <tocsect2 name="glGetMap" url="man:glGetMap"/>
+ <tocsect2 name="glGetMaterial" url="man:glGetMaterial"/>
+ <tocsect2 name="glGetMinmax" url="man:glGetMinmax"/>
+ <tocsect2 name="glGetMinmaxParameter" url="man:glGetMinmaxParameter"/>
+ <tocsect2 name="glGetPixelMap" url="man:glGetPixelMap"/>
+ <tocsect2 name="glGetPointerv" url="man:glGetPointerv"/>
+ <tocsect2 name="glGetPolygonStipple" url="man:glGetPolygonStipple"/>
+ <tocsect2 name="glGetSeparableFilter" url="man:glGetSeparableFilter"/>
+ <tocsect2 name="glGetString" url="man:glGetString"/>
+ <tocsect2 name="glGetTexEnv" url="man:glGetTexEnv"/>
+ <tocsect2 name="glGetTexGen" url="man:glGetTexGen"/>
+ <tocsect2 name="glGetTexImage" url="man:glGetTexImage"/>
+ <tocsect2 name="glGetTexLevelParameter" url="man:glGetTexLevelParameter"/>
+ <tocsect2 name="glGetTexParameter" url="man:glGetTexParameter"/>
+ <tocsect2 name="glHint" url="man:glHint"/>
+ <tocsect2 name="glHistogram" url="man:glHistogram"/>
+ <tocsect2 name="glIndex" url="man:glIndex"/>
+ <tocsect2 name="glIndexMask" url="man:glIndexMask"/>
+ <tocsect2 name="glIndexPointer" url="man:glIndexPointer"/>
+ <tocsect2 name="glInitNames" url="man:glInitNames"/>
+ <tocsect2 name="glInterleavedArrays" url="man:glInterleavedArrays"/>
+ <tocsect2 name="glIsEnabled" url="man:glIsEnabled"/>
+ <tocsect2 name="glIsTexture" url="man:glIsTexture"/>
+ <tocsect2 name="glIslist" url="man:glIslist"/>
+ <tocsect2 name="glLight" url="man:glLight"/>
+ <tocsect2 name="glLightModel" url="man:glLightModel"/>
+ <tocsect2 name="glLineStipple" url="man:glLineStipple"/>
+ <tocsect2 name="glLineWidth" url="man:glLineWidth"/>
+ <tocsect2 name="glListBase" url="man:glListBase"/>
+ <tocsect2 name="glLoadIdentity" url="man:glLoadIdentity"/>
+ <tocsect2 name="glLoadMatrix" url="man:glLoadMatrix"/>
+ <tocsect2 name="glLoadName" url="man:glLoadName"/>
+ <tocsect2 name="glLogicOp" url="man:glLogicOp"/>
+ <tocsect2 name="glMap1" url="man:glMap1"/>
+ <tocsect2 name="glMap2" url="man:glMap2"/>
+ <tocsect2 name="glMapGrid" url="man:glMapGrid"/>
+ <tocsect2 name="glMaterial" url="man:glMaterial"/>
+ <tocsect2 name="glMatrixMode" url="man:glMatrixMode"/>
+ <tocsect2 name="glMinmax" url="man:glMinmax"/>
+ <tocsect2 name="glMultMatrix" url="man:glMultMatrix"/>
+ <tocsect2 name="glMultiTexCoordARB" url="man:glMultiTexCoordARB"/>
+ <tocsect2 name="glNewList" url="man:glNewList"/>
+ <tocsect2 name="glNormal" url="man:glNormal"/>
+ <tocsect2 name="glNormalPointer" url="man:glNormalPointer"/>
+ <tocsect2 name="glOrtho" url="man:glOrtho"/>
+ <tocsect2 name="glPassThrough" url="man:glPassThrough"/>
+ <tocsect2 name="glPixelMap" url="man:glPixelMap"/>
+ <tocsect2 name="glPixelStore" url="man:glPixelStore"/>
+ <tocsect2 name="glPixelTransfer" url="man:glPixelTransfer"/>
+ <tocsect2 name="glPixelZoom" url="man:glPixelZoom"/>
+ <tocsect2 name="glPointSize" url="man:glPointSize"/>
+ <tocsect2 name="glPolygonMode" url="man:glPolygonMode"/>
+ <tocsect2 name="glPolygonOffset" url="man:glPolygonOffset"/>
+ <tocsect2 name="glPolygonStipple" url="man:glPolygonStipple"/>
+ <tocsect2 name="glPopAttrib" url="man:glPopAttrib"/>
+ <tocsect2 name="glPopClientAttrib" url="man:glPopClientAttrib"/>
+ <tocsect2 name="glPopMatrix" url="man:glPopMatrix"/>
+ <tocsect2 name="glPopName" url="man:glPopName"/>
+ <tocsect2 name="glPrioritizeTextures" url="man:glPrioritizeTextures"/>
+ <tocsect2 name="glPushAttrib" url="man:glPushAttrib"/>
+ <tocsect2 name="glPushClientAttrib" url="man:glPushClientAttrib"/>
+ <tocsect2 name="glPushMatrix" url="man:glPushMatrix"/>
+ <tocsect2 name="glPushName" url="man:glPushName"/>
+ <tocsect2 name="glRasterPos" url="man:glRasterPos"/>
+ <tocsect2 name="glReadBuffer" url="man:glReadBuffer"/>
+ <tocsect2 name="glReadPixels" url="man:glReadPixels"/>
+ <tocsect2 name="glRect" url="man:glRect"/>
+ <tocsect2 name="glRenderMode" url="man:glRenderMode"/>
+ <tocsect2 name="glResetHistogram" url="man:glResetHistogram"/>
+ <tocsect2 name="glResetMinmax" url="man:glResetMinmax"/>
+ <tocsect2 name="glRotate" url="man:glRotate"/>
+ <tocsect2 name="glScale" url="man:glScale"/>
+ <tocsect2 name="glScissor" url="man:glScissor"/>
+ <tocsect2 name="glSelectBuffer" url="man:glSelectBuffer"/>
+ <tocsect2 name="glSeparableFilter2D" url="man:glSeparableFilter2D"/>
+ <tocsect2 name="glShadeModel" url="man:glShadeModel"/>
+ <tocsect2 name="glStencilFunc" url="man:glStencilFunc"/>
+ <tocsect2 name="glStencilMask" url="man:glStencilMask"/>
+ <tocsect2 name="glStencilOp" url="man:glStencilOp"/>
+ <tocsect2 name="glTexCoord" url="man:glTexCoord"/>
+ <tocsect2 name="glTexCoordPointer" url="man:glTexCoordPointer"/>
+ <tocsect2 name="glTexEnv" url="man:glTexEnv"/>
+ <tocsect2 name="glTexGen" url="man:glTexGen"/>
+ <tocsect2 name="glTexImage1D" url="man:glTexImage1D"/>
+ <tocsect2 name="glTexImage2D" url="man:glTexImage2D"/>
+ <tocsect2 name="glTexImage3D" url="man:glTexImage3D"/>
+ <tocsect2 name="glTexParameter" url="man:glTexParameter"/>
+ <tocsect2 name="glTexSubImage1D" url="man:glTexSubImage1D"/>
+ <tocsect2 name="glTexSubImage2D" url="man:glTexSubImage2D"/>
+ <tocsect2 name="glTexSubImage3D" url="man:glTexSubImage3D"/>
+ <tocsect2 name="glTranslate" url="man:glTranslate"/>
+ <tocsect2 name="glVertex" url="man:glVertex"/>
+ <tocsect2 name="glVertexPointer" url="man:glVertexPointer"/>
+ <tocsect2 name="glViewport" url="man:glViewport"/>
+</tocsect1>
+<tocsect1 name="GLU Functions">
+ <tocsect2 name="gluBeginCurve" url="man:gluBeginCurve"/>
+ <tocsect2 name="gluBeginPolygon" url="man:gluBeginPolygon"/>
+ <tocsect2 name="gluBeginSurface" url="man:gluBeginSurface"/>
+ <tocsect2 name="gluBeginTrim" url="man:gluBeginTrim"/>
+ <tocsect2 name="gluBuild1DMipmaps" url="man:gluBuild1DMipmaps"/>
+ <tocsect2 name="gluBuild2DMipmaps" url="man:gluBuild2DMipmaps"/>
+ <tocsect2 name="gluCylinder" url="man:gluCylinder"/>
+ <tocsect2 name="gluDeleteNurbsRenderer" url="man:gluDeleteNurbsRenderer"/>
+ <tocsect2 name="gluDeleteQuadric" url="man:gluDeleteQuadric"/>
+ <tocsect2 name="gluDeleteTess" url="man:gluDeleteTess"/>
+ <tocsect2 name="gluDisk" url="man:gluDisk"/>
+ <tocsect2 name="gluEndCurve" url="man:gluEndCurve"/>
+ <tocsect2 name="gluEndPolygon" url="man:gluEndPolygon"/>
+ <tocsect2 name="gluEndSurface" url="man:gluEndSurface"/>
+ <tocsect2 name="gluEndTrim" url="man:gluEndTrim"/>
+ <tocsect2 name="gluErrorString" url="man:gluErrorString"/>
+ <tocsect2 name="gluGetNurbsProperty" url="man:gluGetNurbsProperty"/>
+ <tocsect2 name="gluGetString" url="man:gluGetString"/>
+ <tocsect2 name="gluGetTessProperty" url="man:gluGetTessProperty"/>
+ <tocsect2 name="gluLoadSamplingMatrices" url="man:gluLoadSamplingMatrices"/>
+ <tocsect2 name="gluLookAt" url="man:gluLookAt"/>
+ <tocsect2 name="gluNewNurbsRenderer" url="man:gluNewNurbsRenderer"/>
+ <tocsect2 name="gluNewQuadric" url="man:gluNewQuadric"/>
+ <tocsect2 name="gluNewTess" url="man:gluNewTess"/>
+ <tocsect2 name="gluNextContour" url="man:gluNextContour"/>
+ <tocsect2 name="gluNurbsCallback" url="man:gluNurbsCallback"/>
+ <tocsect2 name="gluNurbsCallbackDataEXT" url="man:gluNurbsCallbackDataEXT"/>
+ <tocsect2 name="gluNurbsCurve" url="man:gluNurbsCurve"/>
+ <tocsect2 name="gluNurbsProperty" url="man:gluNurbsProperty"/>
+ <tocsect2 name="gluNurbsSurface" url="man:gluNurbsSurface"/>
+ <tocsect2 name="gluOrtho2D" url="man:gluOrtho2D"/>
+ <tocsect2 name="gluPartialDisk" url="man:gluPartialDisk"/>
+ <tocsect2 name="gluPerspective" url="man:gluPerspective"/>
+ <tocsect2 name="gluPickMatrix" url="man:gluPickMatrix"/>
+ <tocsect2 name="gluProject" url="man:gluProject"/>
+ <tocsect2 name="gluPwlCurve" url="man:gluPwlCurve"/>
+ <tocsect2 name="gluQuadricCallback" url="man:gluQuadricCallback"/>
+ <tocsect2 name="gluQuadricDrawStyle" url="man:gluQuadricDrawStyle"/>
+ <tocsect2 name="gluQuadricNormals" url="man:gluQuadricNormals"/>
+ <tocsect2 name="gluQuadricOrientation" url="man:gluQuadricOrientation"/>
+ <tocsect2 name="gluQuadricTexture" url="man:gluQuadricTexture"/>
+ <tocsect2 name="gluScaleImage" url="man:gluScaleImage"/>
+ <tocsect2 name="gluSphere" url="man:gluSphere"/>
+ <tocsect2 name="gluTessBeginContour" url="man:gluTessBeginContour"/>
+ <tocsect2 name="gluTessBeginPolygon" url="man:gluTessBeginPolygon"/>
+ <tocsect2 name="gluTessCallback" url="man:gluTessCallback"/>
+ <tocsect2 name="gluTessEndContour" url="man:gluTessEndContour"/>
+ <tocsect2 name="gluTessEndPolygon" url="man:gluTessEndPolygon"/>
+ <tocsect2 name="gluTessNormal" url="man:gluTessNormal"/>
+ <tocsect2 name="gluTessProperty" url="man:gluTessProperty"/>
+ <tocsect2 name="gluTessVertex" url="man:gluTessVertex"/>
+ <tocsect2 name="gluUnProject" url="man:gluUnProject"/>
+</tocsect1>
+<tocsect1 name="GLX Functions">
+ <tocsect2 name="glXChooseVisual" url="man:glXChooseVisual"/>
+ <tocsect2 name="glXCopyContext" url="man:glXCopyContext"/>
+ <tocsect2 name="glXCreateContext" url="man:glXCreateContext"/>
+ <tocsect2 name="glXCreateGLXPixmap" url="man:glXCreateGLXPixmap"/>
+ <tocsect2 name="glXDestroyContext" url="man:glXDestroyContext"/>
+ <tocsect2 name="glXDestroyGLXPixmap" url="man:glXDestroyGLXPixmap"/>
+ <tocsect2 name="glXFreeContextEXT" url="man:glXFreeContextEXT"/>
+ <tocsect2 name="glXGetClientString" url="man:glXGetClientString"/>
+ <tocsect2 name="glXGetConfig" url="man:glXGetConfig"/>
+ <tocsect2 name="glXGetContextIDEXT" url="man:glXGetContextIDEXT"/>
+ <tocsect2 name="glXGetCurrentContext" url="man:glXGetCurrentContext"/>
+ <tocsect2 name="glXGetCurrentDisplay" url="man:glXGetCurrentDisplay"/>
+ <tocsect2 name="glXGetCurrentDrawable" url="man:glXGetCurrentDrawable"/>
+ <tocsect2 name="glXImportContextEXT" url="man:glXImportContextEXT"/>
+ <tocsect2 name="glXIntro" url="man:glXIntro"/>
+ <tocsect2 name="glXIsDirect" url="man:glXIsDirect"/>
+ <tocsect2 name="glXMakeCurrent" url="man:glXMakeCurrent"/>
+ <tocsect2 name="glXQueryContextInfoEXT" url="man:glXQueryContextInfoEXT"/>
+ <tocsect2 name="glXQueryExtension" url="man:glXQueryExtension"/>
+ <tocsect2 name="glXQueryExtensionsString" url="man:glXQueryExtensionsString"/>
+ <tocsect2 name="glXQueryServerString" url="man:glXQueryServerString"/>
+ <tocsect2 name="glXQueryVersion" url="man:glXQueryVersion"/>
+ <tocsect2 name="glXSwapBuffers" url="man:glXSwapBuffers"/>
+ <tocsect2 name="glXUseXFont" url="man:glXUseXFont"/>
+ <tocsect2 name="glXWaitGL" url="man:glXWaitGL"/>
+ <tocsect2 name="glXWaitX" url="man:glXWaitX"/>
+</tocsect1>
+</kdeveloptoc>
diff --git a/doc/extras/sdl.toc b/doc/extras/sdl.toc
new file mode 100644
index 00000000..947dd09a
--- /dev/null
+++ b/doc/extras/sdl.toc
@@ -0,0 +1,219 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>SDL</title>
+<base href="http://sdldoc.csn.ul.ie"/>
+<tocsect1 name="I. SDL Guide" url="guide.php">
+ <tocsect2 name="Preface" url="guidepreface.php">
+ <tocsect3 name="About SDL" url="guidepreface.php#GUIDEABOUTSDL" />
+ <tocsect3 name="About SDLdoc" url="guideaboutsdldoc.php" />
+ <tocsect3 name="Credits" url="guidecredits.php" />
+ </tocsect2>
+ <tocsect2 name="1. The Basics" url="guidethebasics.php">
+ <tocsect3 name="Introduction" url="guidethebasics.php#GUIDEINTRODUCTION" />
+ <tocsect3 name="Initializing SDL" url="guidebasicsinit.php" />
+ </tocsect2>
+ <tocsect2 name="2. Graphics and Video" url="guidevideo.php">
+ <tocsect3 name="Introduction to SDL Video" url="guidevideo.php#GUIDEVIDEOINTRO" />
+ <tocsect3 name="Using OpenGL With SDL" url="guidevideoopengl.php" />
+ </tocsect2>
+ <tocsect2 name="3. Input handling" url="guideinput.php">
+ <tocsect3 name="Handling Joysticks" url="guideinput.php#GUIDEINPUTJOYSTICK" />
+ <tocsect3 name="Handling the Keyboard" url="guideinputkeyboard.php" />
+ </tocsect2>
+ <tocsect2 name="4. Examples" url="guideexamples.php">
+ <tocsect3 name="Introduction" url="guideexamples.php#AEN369" />
+ <tocsect3 name="Event Examples" url="guideeventexamples.php" />
+ <tocsect3 name="Audio Examples" url="guideaudioexamples.php" />
+ <tocsect3 name="CDROM Examples" url="guidecdromexamples.php" />
+ <tocsect3 name="Time Examples" url="guidetimeexamples.php" />
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="II. SDL Reference" url="reference.php">
+ <tocsect2 name="5. General" url="general.php">
+ <tocsect3 name="SDL_Init" url="sdlinit.php" />
+ <tocsect3 name="SDL_InitSubSystem" url="sdlinitsubsystem.php" />
+ <tocsect3 name="SDL_QuitSubSystem" url="sdlquitsubsystem.php" />
+ <tocsect3 name="SDL_Quit" url="sdlquit.php" />
+ <tocsect3 name="SDL_WasInit" url="sdlwasinit.php" />
+ <tocsect3 name="SDL_GetError" url="sdlgeterror.php" />
+ </tocsect2>
+ <tocsect2 name="6. Video" url="video.php">
+ <tocsect3 name="SDL_GetVideoSurface" url="sdlgetvideosurface.php" />
+ <tocsect3 name="SDL_GetVideoInfo" url="sdlgetvideoinfo.php" />
+ <tocsect3 name="SDL_VideoDriverName" url="sdlvideodrivername.php" />
+ <tocsect3 name="SDL_ListModes" url="sdllistmodes.php" />
+ <tocsect3 name="SDL_VideoModeOK" url="sdlvideomodeok.php" />
+ <tocsect3 name="SDL_SetVideoMode" url="sdlsetvideomode.php" />
+ <tocsect3 name="SDL_UpdateRect" url="sdlupdaterect.php" />
+ <tocsect3 name="SDL_UpdateRects" url="sdlupdaterects.php" />
+ <tocsect3 name="SDL_Flip" url="sdlflip.php" />
+ <tocsect3 name="SDL_SetColors" url="sdlsetcolors.php" />
+ <tocsect3 name="SDL_SetPalette" url="sdlsetpalette.php" />
+ <tocsect3 name="SDL_SetGamma" url="sdlsetgamma.php" />
+ <tocsect3 name="SDL_GetGammaRamp" url="sdlgetgammaramp.php" />
+ <tocsect3 name="SDL_SetGammaRamp" url="sdlsetgammaramp.php" />
+ <tocsect3 name="SDL_MapRGB" url="sdlmaprgb.php" />
+ <tocsect3 name="SDL_MapRGBA" url="sdlmaprgba.php" />
+ <tocsect3 name="SDL_GetRGB" url="sdlgetrgb.php" />
+ <tocsect3 name="SDL_GetRGBA" url="sdlgetrgba.php" />
+ <tocsect3 name="SDL_CreateRGBSurface" url="sdlcreatergbsurface.php" />
+ <tocsect3 name="SDL_CreateRGBSurfaceFrom" url="sdlcreatergbsurfacefrom.php" />
+ <tocsect3 name="SDL_FreeSurface" url="sdlfreesurface.php" />
+ <tocsect3 name="SDL_LockSurface" url="sdllocksurface.php" />
+ <tocsect3 name="SDL_UnlockSurface" url="sdlunlocksurface.php" />
+ <tocsect3 name="SDL_LoadBMP" url="sdlloadbmp.php" />
+ <tocsect3 name="SDL_SaveBMP" url="sdlsavebmp.php" />
+ <tocsect3 name="SDL_SetColorKey" url="sdlsetcolorkey.php" />
+ <tocsect3 name="SDL_SetAlpha" url="sdlsetalpha.php" />
+ <tocsect3 name="SDL_SetClipRect" url="sdlsetcliprect.php" />
+ <tocsect3 name="SDL_GetClipRect" url="sdlgetcliprect.php" />
+ <tocsect3 name="SDL_ConvertSurface" url="sdlconvertsurface.php" />
+ <tocsect3 name="SDL_BlitSurface" url="sdlblitsurface.php" />
+ <tocsect3 name="SDL_FillRect" url="sdlfillrect.php" />
+ <tocsect3 name="SDL_DisplayFormat" url="sdldisplayformat.php" />
+ <tocsect3 name="SDL_DisplayFormatAlpha" url="sdldisplayformatalpha.php" />
+ <tocsect3 name="SDL_WarpMouse" url="sdlwarpmouse.php" />
+ <tocsect3 name="SDL_CreateCursor" url="sdlcreatecursor.php" />
+ <tocsect3 name="SDL_FreeCursor" url="sdlfreecursor.php" />
+ <tocsect3 name="SDL_SetCursor" url="sdlsetcursor.php" />
+ <tocsect3 name="SDL_GetCursor" url="sdlgetcursor.php" />
+ <tocsect3 name="SDL_ShowCursor" url="sdlshowcursor.php" />
+ <tocsect3 name="SDL_GL_LoadLibrary" url="sdlglloadlibrary.php" />
+ <tocsect3 name="SDL_GL_GetProcAddress" url="sdlglgetprocaddress.php" />
+ <tocsect3 name="SDL_GL_GetAttribute" url="sdlglgetattribute.php" />
+ <tocsect3 name="SDL_GL_SetAttribute" url="sdlglsetattribute.php" />
+ <tocsect3 name="SDL_GL_SwapBuffers" url="sdlglswapbuffers.php" />
+ <tocsect3 name="SDL_CreateYUVOverlay" url="sdlcreateyuvoverlay.php" />
+ <tocsect3 name="SDL_LockYUVOverlay" url="sdllockyuvoverlay.php" />
+ <tocsect3 name="SDL_UnlockYUVOverlay" url="sdlunlockyuvoverlay.php" />
+ <tocsect3 name="SDL_DisplayYUVOverlay" url="sdldisplayyuvoverlay.php" />
+ <tocsect3 name="SDL_FreeYUVOverlay" url="sdlfreeyuvoverlay.php" />
+ <tocsect3 name="SDL_GLattr" url="sdlglattr.php" />
+ <tocsect3 name="SDL_Rect" url="sdlrect.php" />
+ <tocsect3 name="SDL_Color" url="sdlcolor.php" />
+ <tocsect3 name="SDL_Palette" url="sdlpalette.php" />
+ <tocsect3 name="SDL_PixelFormat" url="sdlpixelformat.php" />
+ <tocsect3 name="SDL_Surface" url="sdlsurface.php" />
+ <tocsect3 name="SDL_VideoInfo" url="sdlvideoinfo.php" />
+ <tocsect3 name="SDL_Overlay" url="sdloverlay.php" />
+ </tocsect2>
+ <tocsect2 name="7. Window Management" url="wm.php">
+ <tocsect3 name="SDL_WM_SetCaption" url="sdlwmsetcaption.php" />
+ <tocsect3 name="SDL_WM_GetCaption" url="sdlwmgetcaption.php" />
+ <tocsect3 name="SDL_WM_SetIcon" url="sdlwmseticon.php" />
+ <tocsect3 name="SDL_WM_IconifyWindow" url="sdlwmiconifywindow.php" />
+ <tocsect3 name="SDL_WM_ToggleFullScreen" url="sdlwmtogglefullscreen.php" />
+ <tocsect3 name="SDL_WM_GrabInput" url="sdlwmgrabinput.php" />
+ </tocsect2>
+ <tocsect2 name="8. Events" url="event.php">
+ <tocsect3 name="Introduction" url="event.php#AEN3307" />
+ <tocsect3 name="SDL Event Structures." url="eventstructures.php" />
+ <tocsect3 name="Event Functions." url="eventfunctions.php" />
+ </tocsect2>
+ <tocsect2 name="9. Joystick" url="joystick.php">
+ <tocsect3 name="SDL_NumJoysticks" url="sdlnumjoysticks.php" />
+ <tocsect3 name="SDL_JoystickName" url="sdljoystickname.php" />
+ <tocsect3 name="SDL_JoystickOpen" url="sdljoystickopen.php" />
+ <tocsect3 name="SDL_JoystickOpened" url="sdljoystickopened.php" />
+ <tocsect3 name="SDL_JoystickIndex" url="sdljoystickindex.php" />
+ <tocsect3 name="SDL_JoystickNumAxes" url="sdljoysticknumaxes.php" />
+ <tocsect3 name="SDL_JoystickNumBalls" url="sdljoysticknumballs.php" />
+ <tocsect3 name="SDL_JoystickNumHats" url="sdljoysticknumhats.php" />
+ <tocsect3 name="SDL_JoystickNumButtons" url="sdljoysticknumbuttons.php" />
+ <tocsect3 name="SDL_JoystickUpdate" url="sdljoystickupdate.php" />
+ <tocsect3 name="SDL_JoystickGetAxis" url="sdljoystickgetaxis.php" />
+ <tocsect3 name="SDL_JoystickGetHat" url="sdljoystickgethat.php" />
+ <tocsect3 name="SDL_JoystickGetButton" url="sdljoystickgetbutton.php" />
+ <tocsect3 name="SDL_JoystickGetBall" url="sdljoystickgetball.php" />
+ <tocsect3 name="SDL_JoystickClose" url="sdljoystickclose.php" />
+ </tocsect2>
+ <tocsect2 name="10. Audio" url="audio.php">
+ <tocsect3 name="SDL_AudioSpec" url="sdlaudiospec.php" />
+ <tocsect3 name="SDL_OpenAudio" url="sdlopenaudio.php" />
+ <tocsect3 name="SDL_PauseAudio" url="sdlpauseaudio.php" />
+ <tocsect3 name="SDL_GetAudioStatus" url="sdlgetaudiostatus.php" />
+ <tocsect3 name="SDL_LoadWAV" url="sdlloadwav.php" />
+ <tocsect3 name="SDL_FreeWAV" url="sdlfreewav.php" />
+ <tocsect3 name="SDL_AudioCVT" url="sdlaudiocvt.php" />
+ <tocsect3 name="SDL_BuildAudioCVT" url="sdlbuildaudiocvt.php" />
+ <tocsect3 name="SDL_ConvertAudio" url="sdlconvertaudio.php" />
+ <tocsect3 name="SDL_MixAudio" url="sdlmixaudio.php" />
+ <tocsect3 name="SDL_LockAudio" url="sdllockaudio.php" />
+ <tocsect3 name="SDL_UnlockAudio" url="sdlunlockaudio.php" />
+ <tocsect3 name="SDL_CloseAudio" url="sdlcloseaudio.php" />
+ </tocsect2>
+ <tocsect2 name="11. CD-ROM" url="cdrom.php">
+ <tocsect3 name="SDL_CDNumDrives" url="sdlcdnumdrives.php" />
+ <tocsect3 name="SDL_CDName" url="sdlcdname.php" />
+ <tocsect3 name="SDL_CDOpen" url="sdlcdopen.php" />
+ <tocsect3 name="SDL_CDStatus" url="sdlcdstatus.php" />
+ <tocsect3 name="SDL_CDPlay" url="sdlcdplay.php" />
+ <tocsect3 name="SDL_CDPlayTracks" url="sdlcdplaytracks.php" />
+ <tocsect3 name="SDL_CDPause" url="sdlcdpause.php" />
+ <tocsect3 name="SDL_CDResume" url="sdlcdresume.php" />
+ <tocsect3 name="SDL_CDStop" url="sdlcdstop.php" />
+ <tocsect3 name="SDL_CDEject" url="sdlcdeject.php" />
+ <tocsect3 name="SDL_CDClose" url="sdlcdclose.php" />
+ <tocsect3 name="SDL_CD" url="sdlcd.php" />
+ <tocsect3 name="SDL_CDtrack" url="sdlcdtrack.php" />
+ </tocsect2>
+ <tocsect2 name="12. Multi-threaded Programming" url="thread.php">
+ <tocsect3 name="SDL_CreateThread" url="sdlcreatethread.php" />
+ <tocsect3 name="SDL_ThreadID" url="sdlthreadid.php" />
+ <tocsect3 name="SDL_GetThreadID" url="sdlgetthreadid.php" />
+ <tocsect3 name="SDL_WaitThread" url="sdlwaitthread.php" />
+ <tocsect3 name="SDL_KillThread" url="sdlkillthread.php" />
+ <tocsect3 name="SDL_CreateMutex" url="sdlcreatemutex.php" />
+ <tocsect3 name="SDL_DestroyMutex" url="sdldestroymutex.php" />
+ <tocsect3 name="SDL_mutexP" url="sdlmutexp.php" />
+ <tocsect3 name="SDL_mutexV" url="sdlmutexv.php" />
+ <tocsect3 name="SDL_CreateSemaphore" url="sdlcreatesemaphore.php" />
+ <tocsect3 name="SDL_DestroySemaphore" url="sdldestroysemaphore.php" />
+ <tocsect3 name="SDL_SemWait" url="sdlsemwait.php" />
+ <tocsect3 name="SDL_SemTryWait" url="sdlsemtrywait.php" />
+ <tocsect3 name="SDL_SemWaitTimeout" url="sdlsemwaittimeout.php" />
+ <tocsect3 name="SDL_SemPost" url="sdlsempost.php" />
+ <tocsect3 name="SDL_SemValue" url="sdlsemvalue.php" />
+ <tocsect3 name="SDL_CreateCond" url="sdlcreatecond.php" />
+ <tocsect3 name="SDL_DestroyCond" url="sdldestroycond.php" />
+ <tocsect3 name="SDL_CondSignal" url="sdlcondsignal.php" />
+ <tocsect3 name="SDL_CondBroadcast" url="sdlcondbroadcast.php" />
+ <tocsect3 name="SDL_CondWait" url="sdlcondwait.php" />
+ <tocsect3 name="SDL_CondWaitTimeout" url="sdlcondwaittimeout.php" />
+ </tocsect2>
+ <tocsect2 name="13. Time" url="time.php">
+ <tocsect3 name="SDL_GetTicks" url="sdlgetticks.php" />
+ <tocsect3 name="SDL_Delay" url="sdldelay.php" />
+ <tocsect3 name="SDL_AddTimer" url="sdladdtimer.php" />
+ <tocsect3 name="SDL_RemoveTimer" url="sdlremovetimer.php" />
+ <tocsect3 name="SDL_SetTimer" url="sdlsettimer.php" />
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="List of Tables">
+ <tocsect2 name="8-1. SDL Keysym definitions" url="sdlkey.php#AEN4336" />
+ <tocsect2 name="8-2. SDL modifier definitions" url="sdlkey.php#SDLMOD" />
+</tocsect1>
+ <tocsect1 name="List of Examples">
+ <tocsect2 name="1-1. Initializing SDL" url="guidebasicsinit.php#AEN60" />
+ <tocsect2 name="2-1. Initializing the Video Display" url="guidevideo.php#AEN71" />
+ <tocsect2 name="2-2. Initializing the Best Video Mode" url="guidevideo.php#AEN77" />
+ <tocsect2 name="2-3. Loading and Displaying a BMP File" url="guidevideo.php#AEN83" />
+ <tocsect2 name="2-4. getpixel()" url="guidevideo.php#AEN90" />
+ <tocsect2 name="2-5. putpixel()" url="guidevideo.php#AEN93" />
+ <tocsect2 name="2-6. Using putpixel()" url="guidevideo.php#AEN97" />
+ <tocsect2 name="2-7. Initializing SDL with OpenGL" url="guidevideoopengl.php#AEN114" />
+ <tocsect2 name="2-8. SDL and OpenGL" url="guidevideoopengl.php#AEN128" />
+ <tocsect2 name="3-1. Initializing SDL with Joystick Support" url="guideinput.php#AEN141" />
+ <tocsect2 name="3-2. Querying the Number of Available Joysticks" url="guideinput.php#AEN154" />
+ <tocsect2 name="3-3. Opening a Joystick" url="guideinput.php#AEN183" />
+ <tocsect2 name="3-4. Joystick Axis Events" url="guideinput.php#AEN191" />
+ <tocsect2 name="3-5. More Joystick Axis Events" url="guideinput.php#AEN195" />
+ <tocsect2 name="3-6. Joystick Button Events" url="guideinput.php#AEN203" />
+ <tocsect2 name="3-7. Joystick Ball Events" url="guideinput.php#AEN217" />
+ <tocsect2 name="3-8. Joystick Hat Events" url="guideinput.php#AEN244" />
+ <tocsect2 name="3-9. Querying Joystick Characteristics" url="guideinput.php#AEN265" />
+ <tocsect2 name="3-10. Reading Keyboard Events" url="guideinputkeyboard.php#AEN334" />
+ <tocsect2 name="3-11. Interpreting Key Event Information" url="guideinputkeyboard.php#AEN351" />
+ <tocsect2 name="3-12. Proper Game Movement" url="guideinputkeyboard.php#AEN363" />
+</tocsect1>
+</kdeveloptoc>
diff --git a/doc/extras/w3c/Makefile.am b/doc/extras/w3c/Makefile.am
new file mode 100644
index 00000000..19518e8d
--- /dev/null
+++ b/doc/extras/w3c/Makefile.am
@@ -0,0 +1,3 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = w3c-dom-level2-html.toc w3c-svg.toc w3c-uaag10.toc
+
diff --git a/doc/extras/w3c/w3c-dom-level2-html.toc b/doc/extras/w3c/w3c-dom-level2-html.toc
new file mode 100644
index 00000000..f3540ff1
--- /dev/null
+++ b/doc/extras/w3c/w3c-dom-level2-html.toc
@@ -0,0 +1,70 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Document Object Model (DOM) Level 2 HTML Specification</title>
+<base href="http://www.w3.org/TR/DOM-Level-2-HTML" />
+ <tocsect1 name="1. Document Object Model HTML" url="html.html">
+ <tocsect2 name="1.1. Introduction" url="html.html#ID-1176245063">
+ </tocsect2>
+ <tocsect2 name="1.2. HTML Application of Core DOM" url="html.html#ID-535378264">
+ <tocsect3 name="1.2.1. Naming Conventions" url="html.html#ID-2041995112">
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="1.3. XHTML and the HTML DOM" url="html.html#ID-5353782642">
+ </tocsect2>
+ <tocsect2 name="1.4. Miscellaneous Object Definitions" url="html.html#ID-1019015399">
+ </tocsect2>
+ <tocsect2 name="1.5. Objects related to HTML documents" url="html.html#ID-1006298752">
+ </tocsect2>
+ <tocsect2 name="1.6. HTML Elements" url="html.html#ID-882764350">
+ <tocsect3 name="1.6.1. Property Attributes" url="html.html#ID-642250288">
+ </tocsect3>
+ <tocsect3 name="1.6.2. Naming Exceptions" url="html.html#ID-213157251">
+ </tocsect3>
+ <tocsect3 name="1.6.3. Exposing Element Type Names (tagName, (nodeName))" url="html.html#ID-822762427">
+ </tocsect3>
+ <tocsect3 name="1.6.4. The HTMLElement interface" url="html.html#ID-011100101">
+ </tocsect3>
+ <tocsect3 name="1.6.5. Object definitions" url="html.html#ID-798055546">
+ </tocsect3>
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="Appendix A: Changes" url="changes.html">
+ <tocsect2 name="A.1. Changes between DOM Level 1 and DOM Level 2" url="changes.html#DOMLevel1to2Changes">
+ <tocsect3 name="A.1.1. Changes to DOM Level 1 interfaces and exceptions" url="changes.html#DOMLevel1Changes">
+ </tocsect3>
+ <tocsect3 name="A.1.2. New Interfaces" url="changes.html#DOMLevel2Addons">
+ </tocsect3>
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="Appendix B: IDL Definitions" url="idl-definitions.html">
+ </tocsect1>
+ <tocsect1 name="Appendix C: Java language Binding" url="java-binding.html">
+ </tocsect1>
+ <tocsect1 name="Appendix D: ECMAScript Language Binding" url="ecma-script-binding.html">
+ </tocsect1>
+ <tocsect1 name="Appendix E: Acknowledgments" url="acknowledgements.html">
+ <tocsect2 name="E.1. Production Systems" url="acknowledgements.html#Productions">
+ </tocsect2>
+ <tocsect2 name="E.2. DOM Level 1" url="acknowledgements.html#dom_level_1">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="Glossary" url="glossary.html">
+ </tocsect1>
+ <tocsect1 name="References" url="references.html">
+ <tocsect2 name="1. Normative references" url="references.html#References-Normative">
+ </tocsect2>
+ <tocsect2 name="2. Informative references" url="references.html#References-Informative">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="Index" url="def-index.html">
+ </tocsect1>      
+ <tocsect1 name="Expanded Table of Contents" url="expanded-toc.html">
+ </tocsect1>
+ <tocsect1 name="Copyright Notice" url="copyright-notice.html">
+ <tocsect2 name="W3C Document Copyright Notice and License" url="copyright-notice.html#Copyright-notice-document">
+ </tocsect2>
+ <tocsect2 name="W3C Software Copyright Notice and License" url="copyright-notice.html#Copyright-notice-software">
+ </tocsect2>
+ </tocsect1>
+</kdeveloptoc>
+
diff --git a/doc/extras/w3c/w3c-svg.toc b/doc/extras/w3c/w3c-svg.toc
new file mode 100644
index 00000000..a53e34fc
--- /dev/null
+++ b/doc/extras/w3c/w3c-svg.toc
@@ -0,0 +1,1446 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Scalable Vector Graphics (SVG) 1.1 Specification</title>
+<base href="http://www.w3.org/TR/SVG11" url="index.html"/>
+
+<tocsect1 name="1 Introduction" url="intro.html">
+
+
+ <tocsect2 name="1.1 About SVG" url="intro.html#AboutSVG">
+
+
+ <tocsect3 name="1.1.1 Modularization" url="intro.html#Modularization">
+ </tocsect3>
+
+ <tocsect3 name="1.1.2 Element and Attribute Collections" url="intro.html#ElementAndAttributeCollections">
+ </tocsect3>
+
+ <tocsect3 name="1.1.3 Profiling the SVG specification" url="intro.html#Profiling">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="1.2 SVG MIME type, file name extension and Macintosh file type" url="intro.html#MIMEType">
+ </tocsect2>
+
+ <tocsect2 name="1.3 SVG Namespace, Public Identifier and System Identifier" url="intro.html#Namespace">
+ </tocsect2>
+
+ <tocsect2 name="1.4 Compatibility with Other Standards Efforts" url="intro.html#W3CCompatibility">
+ </tocsect2>
+
+ <tocsect2 name="1.5 Terminology" url="intro.html#Terminology">
+ </tocsect2>
+
+ <tocsect2 name="1.6 Definitions" url="intro.html#Definitions">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="2 Concepts" url="concepts.html">
+
+
+ <tocsect2 name="2.1 Explaining the name: SVG" url="concepts.html#Intro">
+ </tocsect2>
+
+ <tocsect2 name="2.2 Important SVG concepts" url="concepts.html#Concepts">
+ </tocsect2>
+
+ <tocsect2 name="2.3 Options for using SVG in Web pages" url="concepts.html#UsageOptions">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="3 Rendering Model" url="render.html">
+
+
+ <tocsect2 name="3.1 Introduction" url="render.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="3.2 The painters model" url="render.html#PaintersModel">
+ </tocsect2>
+
+ <tocsect2 name="3.3 Rendering Order" url="render.html#RenderingOrder">
+ </tocsect2>
+
+ <tocsect2 name="3.4 How groups are rendered" url="render.html#Grouping">
+ </tocsect2>
+
+ <tocsect2 name="3.5 How elements are rendered" url="render.html#Elements">
+ </tocsect2>
+
+ <tocsect2 name="3.6 Types of graphics elements" url="render.html#TypesOfGraphicsElements">
+
+
+ <tocsect3 name="3.6.1 Painting shapes and text" url="render.html#PaintingShapesAndText">
+ </tocsect3>
+
+ <tocsect3 name="3.6.2 Painting raster images" url="render.html#PaintingRasterImages">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="3.7 Filtering painted regions" url="render.html#FilteringPaintRegions">
+ </tocsect2>
+
+ <tocsect2 name="3.8 Clipping, masking and object opacity" url="render.html#ClippingMaskingObjectOpacity">
+ </tocsect2>
+
+ <tocsect2 name="3.9 Parent Compositing" url="render.html#ParentCompositing">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="4 Basic Data Types and Interfaces" url="types.html">
+
+
+ <tocsect2 name="4.1 Basic data types" url="types.html#BasicDataTypes">
+ </tocsect2>
+
+ <tocsect2 name="4.2 Recognized color keyword names" url="types.html#ColorKeywords">
+ </tocsect2>
+
+ <tocsect2 name="4.3 Basic DOM interfaces" url="types.html#BasicDOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="5 Document Structure" url="struct.html">
+
+
+ <tocsect2 name="5.1 Defining an SVG document fragment: the 'svg' element" url="struct.html#NewDocument">
+
+
+ <tocsect3 name="5.1.1 Overview" url="struct.html#NewDocumentOverview">
+ </tocsect3>
+
+ <tocsect3 name="5.1.2 The 'svg' element" url="struct.html#SVGElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="5.2 Grouping: the 'g' element" url="struct.html#Groups">
+
+
+ <tocsect3 name="5.2.1 Overview" url="struct.html#GroupsOverview">
+ </tocsect3>
+
+ <tocsect3 name="5.2.2 The 'g' element" url="struct.html#GElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="5.3 References and the 'defs' element" url="struct.html#Head">
+
+
+ <tocsect3 name="5.3.1 Overview" url="struct.html#HeadOverview">
+ </tocsect3>
+
+ <tocsect3 name="5.3.2 URI reference attributes" url="struct.html#xlinkRefAttrs">
+ </tocsect3>
+
+ <tocsect3 name="5.3.3 The 'defs' element" url="struct.html#DefsElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="5.4 The 'desc' and 'title' elements" url="struct.html#DescriptionAndTitleElements">
+ </tocsect2>
+
+ <tocsect2 name="5.5 The 'symbol' element" url="struct.html#SymbolElement">
+ </tocsect2>
+
+ <tocsect2 name="5.6 The 'use' element" url="struct.html#UseElement">
+ </tocsect2>
+
+ <tocsect2 name="5.7 The 'image' element" url="struct.html#ImageElement">
+ </tocsect2>
+
+ <tocsect2 name="5.8 Conditional processing" url="struct.html#ConditionalProcessing">
+
+
+ <tocsect3 name="5.8.1 Conditional processing overview" url="struct.html#ConditionalProcessingOverview">
+ </tocsect3>
+
+ <tocsect3 name="5.8.2 The 'switch' element" url="struct.html#SwitchElement">
+ </tocsect3>
+
+ <tocsect3 name="5.8.3 The requiredFeatures attribute" url="struct.html#RequiredFeaturesAttribute">
+ </tocsect3>
+
+ <tocsect3 name="5.8.4 The requiredExtensions attribute" url="struct.html#RequiredExtensionsAttribute">
+ </tocsect3>
+
+ <tocsect3 name="5.8.5 The systemLanguage attribute" url="struct.html#SystemLanguageAttribute">
+ </tocsect3>
+
+ <tocsect3 name="5.8.6 Applicability of test attributes" url="struct.html#ApplicabilityOfTestAttributes">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="5.9 Specifying whether external resources are required for proper rendering" url="struct.html#ExternalResourcesRequired">
+ </tocsect2>
+
+ <tocsect2 name="5.10 Common attributes" url="struct.html#CommonAttributes">
+
+
+ <tocsect3 name="5.10.1 Attributes common to all elements: id and xml:base" url="struct.html#Core.attrib">
+ </tocsect3>
+
+ <tocsect3 name="5.10.2 The xml:lang and xml:space attributes" url="struct.html#LangSpaceAttrs">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="5.11 Core Attribute Module" url="struct.html#core-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.12 Structure Module" url="struct.html#structure-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.13 Basic Structure Module" url="struct.html#basic-structure-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.14 Container Attribute Module" url="struct.html#container-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.15 Conditional Processing Module" url="struct.html#conditional-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.16 Image Module" url="struct.html#image-mod">
+ </tocsect2>
+
+ <tocsect2 name="5.17 DOM interfaces" url="struct.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="6 Styling" url="styling.html">
+
+
+ <tocsect2 name="6.1 SVG's styling properties" url="styling.html#SVGStylingProperties">
+ </tocsect2>
+
+ <tocsect2 name="6.2 Usage scenarios for styling" url="styling.html#StylingScenarios">
+ </tocsect2>
+
+ <tocsect2 name="6.3 Alternative ways to specify styling properties" url="styling.html#AlternativesForStyling">
+ </tocsect2>
+
+ <tocsect2 name="6.4 Specifying properties using the presentation attributes" url="styling.html#UsingPresentationAttributes">
+ </tocsect2>
+
+ <tocsect2 name="6.5 Entity definitions for the presentation attributes" url="styling.html#EntityDefinitionsPresentationAttributes">
+ </tocsect2>
+
+ <tocsect2 name="6.6 Styling with XSL" url="styling.html#StylingWithXSL">
+ </tocsect2>
+
+ <tocsect2 name="6.7 Styling with CSS" url="styling.html#StylingWithCSS">
+ </tocsect2>
+
+ <tocsect2 name="6.8 Case sensitivity of property names and values" url="styling.html#CaseSensitivity">
+ </tocsect2>
+
+ <tocsect2 name="6.9 Facilities from CSS and XSL used by SVG" url="styling.html#SVGUseOfCSS">
+ </tocsect2>
+
+ <tocsect2 name="6.10 Referencing external style sheets" url="styling.html#ReferencingExternalStyleSheets">
+ </tocsect2>
+
+ <tocsect2 name="6.11 The 'style' element" url="styling.html#StyleElement">
+ </tocsect2>
+
+ <tocsect2 name="6.12 The class attribute" url="styling.html#ClassAttribute">
+ </tocsect2>
+
+ <tocsect2 name="6.13 The style attribute" url="styling.html#StyleAttribute">
+ </tocsect2>
+
+ <tocsect2 name="6.14 Specifying the default style sheet language" url="styling.html#DefaultStyleSheetLanguage">
+ </tocsect2>
+
+ <tocsect2 name="6.15 Property inheritance" url="styling.html#Inheritance">
+ </tocsect2>
+
+ <tocsect2 name="6.16 The scope/range of styles" url="styling.html#Scope">
+ </tocsect2>
+
+ <tocsect2 name="6.17 User agent style sheet" url="styling.html#UAStyleSheet">
+ </tocsect2>
+
+ <tocsect2 name="6.18 Aural style sheets" url="styling.html#AuralStyleSheets">
+ </tocsect2>
+
+ <tocsect2 name="6.19 Style Module" url="styling.html#style-mod">
+ </tocsect2>
+
+ <tocsect2 name="6.20 DOM interfaces" url="styling.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="7 Coordinate Systems, Transformations and Units" url="coords.html">
+
+
+ <tocsect2 name="7.1 Introduction" url="coords.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="7.2 The initial viewport" url="coords.html#ViewportSpace">
+ </tocsect2>
+
+ <tocsect2 name="7.3 The initial coordinate system" url="coords.html#InitialCoordinateSystem">
+ </tocsect2>
+
+ <tocsect2 name="7.4 Coordinate system transformations" url="coords.html#EstablishingANewUserSpace">
+ </tocsect2>
+
+ <tocsect2 name="7.5 Nested transformations" url="coords.html#NestedTransformations">
+ </tocsect2>
+
+ <tocsect2 name="7.6 The transform attribute" url="coords.html#TransformAttribute">
+ </tocsect2>
+
+ <tocsect2 name="7.7 The viewBox attribute" url="coords.html#ViewBoxAttribute">
+ </tocsect2>
+
+ <tocsect2 name="7.8 The preserveAspectRatio attribute" url="coords.html#PreserveAspectRatioAttribute">
+ </tocsect2>
+
+ <tocsect2 name="7.9 Establishing a new viewport" url="coords.html#EstablishingANewViewport">
+ </tocsect2>
+
+ <tocsect2 name="7.10 Units" url="coords.html#Units">
+ </tocsect2>
+
+ <tocsect2 name="7.11 Object bounding box units" url="coords.html#ObjectBoundingBox">
+ </tocsect2>
+
+ <tocsect2 name="7.12 Geographic Coordinate Systems" url="coords.html#GeographicCoordinates">
+ </tocsect2>
+
+ <tocsect2 name="7.13 Viewport Attribute Module" url="coords.html#viewport-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="7.14 DOM interfaces" url="coords.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="8 Paths" url="paths.html">
+
+ <tocsect2 name="8.1 Introduction" url="paths.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="8.2 The 'path' element" url="paths.html#PathElement">
+ </tocsect2>
+
+ <tocsect2 name="8.3 Path Data" url="paths.html#PathData">
+
+
+ <tocsect3 name="8.3.1 General information about path data" url="paths.html#PathDataGeneralInformation">
+ </tocsect3>
+
+ <tocsect3 name="8.3.2 The &quot;moveto&quot; commands" url="paths.html#PathDataMovetoCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.3 The &quot;closepath&quot; command" url="paths.html#PathDataClosePathCommand">
+ </tocsect3>
+
+ <tocsect3 name="8.3.4 The &quot;lineto&quot; commands" url="paths.html#PathDataLinetoCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.5 The curve commands" url="paths.html#PathDataCurveCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.6 The cubic Bézier curve commands" url="paths.html#PathDataCubicBezierCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.7 The quadratic Bézier curve commands" url="paths.html#PathDataQuadraticBezierCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.8 The elliptical arc curve commands" url="paths.html#PathDataEllipticalArcCommands">
+ </tocsect3>
+
+ <tocsect3 name="8.3.9 The grammar for path data" url="paths.html#PathDataBNF">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="8.4 Distance along a path" url="paths.html#DistanceAlongAPath">
+ </tocsect2>
+
+ <tocsect2 name="8.5 DOM interfaces" url="paths.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="9 Basic Shapes" url="shapes.html">
+
+
+ <tocsect2 name="9.1 Introduction" url="shapes.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="9.2 The 'rect' element" url="shapes.html#RectElement">
+ </tocsect2>
+
+ <tocsect2 name="9.3 The 'circle' element" url="shapes.html#CircleElement">
+ </tocsect2>
+
+ <tocsect2 name="9.4 The 'ellipse' element" url="shapes.html#EllipseElement">
+ </tocsect2>
+
+ <tocsect2 name="9.5 The 'line' element" url="shapes.html#LineElement">
+ </tocsect2>
+
+ <tocsect2 name="9.6 The 'polyline' element" url="shapes.html#PolylineElement">
+ </tocsect2>
+
+ <tocsect2 name="9.7 The 'polygon' element" url="shapes.html#PolygonElement">
+ </tocsect2>
+
+ <tocsect2 name="9.8 The grammar for points specifications in 'polyline' and 'polygon' elements" url="shapes.html#PointsBNF">
+ </tocsect2>
+
+ <tocsect2 name="9.9 Shape Module" url="shapes.html#shape-mod">
+ </tocsect2>
+
+ <tocsect2 name="9.10 DOM interfaces" url="shapes.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="10 Text" url="text.html">
+
+
+ <tocsect2 name="10.1 Introduction" url="text.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="10.2 Characters and their corresponding glyphs" url="text.html#CharactersAndGlyphs">
+ </tocsect2>
+
+ <tocsect2 name="10.3 Fonts, font tables and baselines" url="text.html#FontsTablesBaselines">
+ </tocsect2>
+
+ <tocsect2 name="10.4 The 'text' element" url="text.html#TextElement">
+ </tocsect2>
+
+ <tocsect2 name="10.5 The 'tspan' element" url="text.html#TSpanElement">
+ </tocsect2>
+
+ <tocsect2 name="10.6 The 'tref' element" url="text.html#TRefElement">
+ </tocsect2>
+
+ <tocsect2 name="10.7 Text layout" url="text.html#TextLayout">
+
+
+ <tocsect3 name="10.7.1 Text layout introduction" url="text.html#TextLayoutIntroduction">
+ </tocsect3>
+
+ <tocsect3 name="10.7.2 Setting the inline-progression-direction" url="text.html#SettingInlineProgressionDirection">
+ </tocsect3>
+
+ <tocsect3 name="10.7.3 Glyph orientation within a text run" url="text.html#GlyphOrientation">
+ </tocsect3>
+
+ <tocsect3 name="10.7.4 Relationship with bidirectionality" url="text.html#RelationshipWithBiDirectionality">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="10.8 Text rendering order" url="text.html#TextRenderingOrder">
+ </tocsect2>
+
+ <tocsect2 name="10.9 Alignment properties" url="text.html#AlignmentProperties">
+
+
+ <tocsect3 name="10.9.1 Text alignment properties" url="text.html#TextAlignmentProperties">
+ </tocsect3>
+
+ <tocsect3 name="10.9.2 Baseline alignment properties" url="text.html#BaselineAlignmentProperties">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="10.10 Font selection properties" url="text.html#FontPropertiesUsedBySVG">
+ </tocsect2>
+
+ <tocsect2 name="10.11 Spacing properties" url="text.html#SpacingProperties">
+ </tocsect2>
+
+ <tocsect2 name="10.12 Text decoration" url="text.html#TextDecorationProperties">
+ </tocsect2>
+
+ <tocsect2 name="10.14 Text on a path" url="text.html#TextOnAPath">
+
+
+ <tocsect3 name="10.14.1 Introduction to text on a path" url="text.html#TextOnAPathIntroduction">
+ </tocsect3>
+
+ <tocsect3 name="10.14.2 The 'textPath' element" url="text.html#TextPathElement">
+ </tocsect3>
+
+ <tocsect3 name="10.14.3 Text on a path layout rules" url="text.html#TextpathLayoutRules">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="10.14 Alternate glyphs" url="text.html#AlternateGlyphs">
+ </tocsect2>
+
+ <tocsect2 name="10.15 White space handling" url="text.html#WhiteSpace">
+ </tocsect2>
+
+ <tocsect2 name="10.16 Text selection and clipboard operations" url="text.html#TextSelection">
+ </tocsect2>
+
+ <tocsect2 name="10.17 Text Module" url="text.html#text-mod">
+ </tocsect2>
+
+ <tocsect2 name="10.18 Basic Text Module" url="text.html#basic-text-mod">
+ </tocsect2>
+
+ <tocsect2 name="10.19 DOM interfaces" url="text.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="11 Painting: Filling, Stroking and Marker Symbols" url="painting.html">
+
+
+ <tocsect2 name="11.1 Introduction" url="painting.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="11.2 Specifying paint" url="painting.html#SpecifyingPaint">
+ </tocsect2>
+
+ <tocsect2 name="11.3 Fill Properties" url="painting.html#FillProperties">
+ </tocsect2>
+
+ <tocsect2 name="11.4 Stroke Properties" url="painting.html#StrokeProperties">
+ </tocsect2>
+
+ <tocsect2 name="11.5 Controlling visibility" url="painting.html#VisibilityControl">
+ </tocsect2>
+
+ <tocsect2 name="11.6 Markers" url="painting.html#Markers">
+
+
+ <tocsect3 name="11.6.1 Introduction" url="painting.html#MarkersIntroduction">
+ </tocsect3>
+
+ <tocsect3 name="11.6.2 The 'marker' element" url="painting.html#MarkerElement">
+ </tocsect3>
+
+ <tocsect3 name="11.6.3 Marker properties" url="painting.html#MarkerProperties">
+ </tocsect3>
+
+ <tocsect3 name="11.6.4 Details on how markers are rendered" url="painting.html#MarkerAlgorithm">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="11.7 Rendering properties" url="painting.html#RenderingProperties">
+
+
+ <tocsect3 name="11.7.1 Color interpolation properties: 'color-interpolation' and 'color-interpolation-filters'" url="painting.html#ColorInterpolationProperties">
+ </tocsect3>
+
+ <tocsect3 name="11.7.2 The 'color-rendering' property" url="painting.html#ColorRenderingProperty">
+ </tocsect3>
+
+ <tocsect3 name="11.7.3 The 'shape-rendering' property" url="painting.html#ShapeRenderingProperty">
+ </tocsect3>
+
+ <tocsect3 name="11.7.4 The 'text-rendering' property" url="painting.html#TextRenderingProperty">
+ </tocsect3>
+
+ <tocsect3 name="11.7.5 The 'image-rendering' property" url="painting.html#ImageRenderingProperty">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="11.8 Inheritance of painting properties" url="painting.html#InheritanceOfPaintingProperties">
+ </tocsect2>
+
+ <tocsect2 name="11.9 Paint Attribute Module" url="painting.html#paint-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.10 Basic Paint Attribute Module" url="painting.html#basic-paint-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.11 Opacity Attribute Module" url="painting.html#opacity-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.12 Graphics Attribute Module" url="painting.html#graphics-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.13 Basic Graphics Attribute Module" url="painting.html#basic-graphics-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.14 Marker Module" url="painting.html#marker-mod">
+ </tocsect2>
+
+ <tocsect2 name="11.15 DOM interfaces" url="painting.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="12 Color" url="color.html">
+
+ <tocsect2 name="12.1 Introduction" url="color.html#ColorIntroduction">
+ </tocsect2>
+
+ <tocsect2 name="12.2 The 'color' property" url="color.html#ColorProperty">
+ </tocsect2>
+
+ <tocsect2 name="12.3 Color profile descriptions" url="color.html#ColorProfileDescriptions">
+
+
+ <tocsect3 name="12.3.1 Overview of color profile descriptions" url="color.html#ColorProfileDescriptionsOverview">
+ </tocsect3>
+
+ <tocsect3 name="12.3.2 Alternative ways for defining a color profile description" url="color.html#ColorProfileAlternatives">
+ </tocsect3>
+
+ <tocsect3 name="12.3.3 The 'color-profile' element" url="color.html#ColorProfileElement">
+ </tocsect3>
+
+ <tocsect3 name="12.3.4 @color-profile when using CSS styling" url="color.html#ColorProfileAtRule">
+ </tocsect3>
+
+ <tocsect3 name="12.3.5 'color-profile' property" url="color.html#ColorProfileProperty">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="12.4 Color Profile Module" url="color.html#color-profile-mod">
+ </tocsect2>
+
+ <tocsect2 name="12.7 DOM interfaces" url="color.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="13 Gradients and Patterns" url="pservers.html">
+
+
+ <tocsect2 name="13.1 Introduction" url="pservers.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="13.2 Gradients" url="pservers.html#Gradients">
+
+
+ <tocsect3 name="13.2.1 Introduction" url="pservers.html#GradientsIntroduction">
+ </tocsect3>
+
+ <tocsect3 name="13.2.2 Linear gradients" url="pservers.html#LinearGradients">
+ </tocsect3>
+
+ <tocsect3 name="13.2.3 Radial gradients" url="pservers.html#RadialGradients">
+ </tocsect3>
+
+ <tocsect3 name="13.2.4 Gradient stops" url="pservers.html#GradientStops">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="13.3 Patterns" url="pservers.html#Patterns">
+ </tocsect2>
+
+ <tocsect2 name="13.4 Gradient Module" url="pservers.html#gradient-mod">
+ </tocsect2>
+
+ <tocsect2 name="13.5 Pattern Module" url="pservers.html#pattern-mod">
+ </tocsect2>
+
+ <tocsect2 name="13.6 DOM interfaces" url="pservers.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="14 Clipping, Masking and Compositing" url="masking.html">
+
+
+ <tocsect2 name="14.1 Introduction" url="masking.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="14.2 Simple alpha compositing" url="masking.html#SimpleAlphaBlending">
+ </tocsect2>
+
+ <tocsect2 name="14.3 Clipping paths" url="masking.html#ClippingPaths">
+
+
+ <tocsect3 name="14.3.1 Introduction" url="masking.html#ClippingPathsIntro">
+ </tocsect3>
+
+ <tocsect3 name="14.3.2 The initial clipping path" url="masking.html#InitialClippingPath">
+ </tocsect3>
+
+ <tocsect3 name="14.3.3 The 'overflow' and 'clip' properties" url="masking.html#OverflowAndClipProperties">
+ </tocsect3>
+
+ <tocsect3 name="14.3.4 Clip to viewport vs. clip to viewBox" url="masking.html#AutoClipAtViewportNotViewBox">
+ </tocsect3>
+
+ <tocsect3 name="14.3.5 Establishing a new clipping path" url="masking.html#EstablishingANewClippingPath">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="14.4 Masking" url="masking.html#Masking">
+ </tocsect2>
+
+ <tocsect2 name="14.5 Object and group opacity: the 'opacity' property" url="masking.html#ObjectAndGroupOpacityProperties">
+ </tocsect2>
+
+ <tocsect2 name="14.6 Clip Module" url="masking.html#clip-mod">
+ </tocsect2>
+
+ <tocsect2 name="14.7 Basic Clip Module" url="masking.html#basic-clip-mod">
+ </tocsect2>
+
+ <tocsect2 name="14.8 Mask Module" url="masking.html#mask-mod">
+ </tocsect2>
+
+ <tocsect2 name="14.9 DOM interfaces" url="masking.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="15 Filter Effects" url="filters.html">
+
+
+ <tocsect2 name="15.1 Introduction" url="filters.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="15.2 An example" url="filters.html#AnExample">
+ </tocsect2>
+
+ <tocsect2 name="15.3 The 'filter' element" url="filters.html#FilterElement">
+ </tocsect2>
+
+ <tocsect2 name="15.4 The 'filter' property" url="filters.html#FilterProperty">
+ </tocsect2>
+
+ <tocsect2 name="15.5 Filter effects region" url="filters.html#FilterEffectsRegion">
+ </tocsect2>
+
+ <tocsect2 name="15.6 Accessing the background image" url="filters.html#AccessingBackgroundImage">
+ </tocsect2>
+
+ <tocsect2 name="15.7 Filter primitives overview" url="filters.html#FilterPrimitivesOverview">
+
+
+ <tocsect3 name="15.7.1 Overview" url="filters.html#FilterPrimitivesOverviewIntro">
+ </tocsect3>
+
+ <tocsect3 name="15.7.2 Common attributes" url="filters.html#CommonAttributes">
+ </tocsect3>
+
+ <tocsect3 name="15.7.3 Filter primitive subregion" url="filters.html#FilterPrimitiveSubRegion">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="15.8 Light source elements and properties" url="filters.html#LightSourceDefinitions">
+
+
+ <tocsect3 name="15.8.1 Introduction" url="filters.html#LightSourceIntro">
+ </tocsect3>
+
+ <tocsect3 name="15.8.2 Light source 'feDistantLight'" url="filters.html#feDistantLight">
+ </tocsect3>
+
+ <tocsect3 name="15.8.3 Light source 'fePointLight'" url="filters.html#fePointLight">
+ </tocsect3>
+
+ <tocsect3 name="15.8.4 Light source 'feSpotLight'" url="filters.html#feSpotLight">
+ </tocsect3>
+
+ <tocsect3 name="15.8.5 The 'lighting-color' property" url="filters.html#LightingColorProperty">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="15.9 Filter primitive 'feBlend'" url="filters.html#feBlend">
+ </tocsect2>
+
+ <tocsect2 name="15.10 Filter primitive 'feColorMatrix'" url="filters.html#feColorMatrix">
+ </tocsect2>
+
+ <tocsect2 name="15.11 Filter primitive 'feComponentTransfer'" url="filters.html#feComponentTransfer">
+ </tocsect2>
+
+ <tocsect2 name="15.12 Filter primitive 'feComposite'" url="filters.html#feComposite">
+ </tocsect2>
+
+ <tocsect2 name="15.13 Filter primitive 'feConvolveMatrix'" url="filters.html#feConvolveMatrix">
+ </tocsect2>
+
+ <tocsect2 name="15.14 Filter primitive 'feDiffuseLighting'" url="filters.html#feDiffuseLighting">
+ </tocsect2>
+
+ <tocsect2 name="15.15 Filter primitive 'feDisplacementMap'" url="filters.html#feDisplacementMap">
+ </tocsect2>
+
+ <tocsect2 name="15.16 Filter primitive 'feFlood'" url="filters.html#feFlood">
+ </tocsect2>
+
+ <tocsect2 name="15.17 Filter primitive 'feGaussianBlur'" url="filters.html#feGaussianBlur">
+ </tocsect2>
+
+ <tocsect2 name="15.18 Filter primitive 'feImage'" url="filters.html#feImage">
+ </tocsect2>
+
+ <tocsect2 name="15.19 Filter primitive 'feMerge'" url="filters.html#feMerge">
+ </tocsect2>
+
+ <tocsect2 name="15.20 Filter primitive 'feMorphology'" url="filters.html#feMorphology">
+ </tocsect2>
+
+ <tocsect2 name="15.21 Filter primitive 'feOffset'" url="filters.html#feOffset">
+ </tocsect2>
+
+ <tocsect2 name="15.22 Filter primitive 'feSpecularLighting'" url="filters.html#feSpecularLighting">
+ </tocsect2>
+
+ <tocsect2 name="15.23 Filter primitive 'feTile'" url="filters.html#feTile">
+ </tocsect2>
+
+ <tocsect2 name="15.24 Filter primitive 'feTurbulence'" url="filters.html#feTurbulence">
+ </tocsect2>
+
+ <tocsect2 name="15.25 Filter Module" url="filters.html#filter-mod">
+ </tocsect2>
+
+ <tocsect2 name="15.26 Basic Filter Module" url="filters.html#basic-filter-mod">
+ </tocsect2>
+
+ <tocsect2 name="15.27 DOM interfaces" url="filters.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="16 Interactivity" url="interact.html">
+
+
+ <tocsect2 name="16.1 Introduction" url="interact.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="16.2 Complete list of supported events" url="interact.html#SVGEvents">
+ </tocsect2>
+
+ <tocsect2 name="16.3 User interface events" url="interact.html#UIEvents">
+ </tocsect2>
+
+ <tocsect2 name="16.4 Pointer events" url="interact.html#PointerEvents">
+ </tocsect2>
+
+ <tocsect2 name="16.5 Processing order for user interface events" url="interact.html#UIEventProcessing">
+ </tocsect2>
+
+ <tocsect2 name="16.6 The 'pointer-events' property" url="interact.html#PointerEventsProperty">
+ </tocsect2>
+
+ <tocsect2 name="16.7 Magnification and panning" url="interact.html#EnableZoomAndPanControls">
+ </tocsect2>
+
+ <tocsect2 name="16.8 Cursors" url="interact.html#Cursors">
+
+
+ <tocsect3 name="16.8.1 Introduction to cursors" url="interact.html#CursorIntro">
+ </tocsect3>
+
+ <tocsect3 name="16.8.2 The 'cursor' property" url="interact.html#CursorProperty">
+ </tocsect3>
+
+ <tocsect3 name="16.8.3 The 'cursor' element" url="interact.html#CursorElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="16.9 Document Events Attribute Module" url="interact.html#document-events-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="16.10 Graphical Events Attribute Module" url="interact.html#graphical-events-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="16.11 Animation Events Attribute Module" url="interact.html#animation-events-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="16.12 Cursor Module" url="interact.html#cursor-mod">
+ </tocsect2>
+
+ <tocsect2 name="16.13 DOM interfaces" url="interact.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="17 Linking" url="linking.html">
+
+
+ <tocsect2 name="17.1 Links out of SVG content: the 'a' element" url="linking.html#Links">
+ </tocsect2>
+
+ <tocsect2 name="17.2 Linking into SVG content: URI fragments and SVG views" url="linking.html#LinksIntoSVG">
+
+
+ <tocsect3 name="17.2.1 Introduction: URI fragments and SVG views" url="linking.html#IntroFragmentsViews">
+ </tocsect3>
+
+ <tocsect3 name="17.2.2 SVG fragment identifiers" url="linking.html#SVGFragmentIdentifiers">
+ </tocsect3>
+
+ <tocsect3 name="17.2.3 Predefined views: the 'view' element" url="linking.html#ViewElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="17.3 Hyperlinking Module" url="linking.html#hyperlinking-mod">
+ </tocsect2>
+
+ <tocsect2 name="17.4 Xlink Attribute Module" url="linking.html#xlink-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="17.5 ExternalResourcesRequired Attribute Module" url="linking.html#err-att-mod">
+ </tocsect2>
+
+ <tocsect2 name="17.6 View Module" url="linking.html#view-mod">
+ </tocsect2>
+
+ <tocsect2 name="17.7 DOM interfaces" url="linking.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="18 Scripting" url="script.html">
+
+
+ <tocsect2 name="18.1 Specifying the scripting language" url="script.html#ScriptingLanguage">
+
+
+ <tocsect3 name="18.1.1 Specifying the default scripting language" url="script.html#DefaultScriptingLanguage">
+ </tocsect3>
+
+ <tocsect3 name="18.1.2 Local declaration of a scripting language" url="script.html#SpecifiedScriptingLanguage">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="18.2 The 'script' element" url="script.html#ScriptElement">
+ </tocsect2>
+
+ <tocsect2 name="18.3 Event handling" url="script.html#EventHandling">
+ </tocsect2>
+
+ <tocsect2 name="18.4 Event attributes" url="script.html#EventAttributes">
+ </tocsect2>
+
+ <tocsect2 name="18.5 Scripting Module" url="script.html#scripting-mod">
+ </tocsect2>
+
+ <tocsect2 name="18.6 DOM interfaces" url="script.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="19 Animation" url="animate.html">
+
+
+ <tocsect2 name="19.1 Introduction" url="animate.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="19.2 Animation elements" url="animate.html#Animation.class">
+
+
+ <tocsect3 name="19.2.1 Overview" url="animate.html#AnimateElementsIntro">
+ </tocsect3>
+
+ <tocsect3 name="19.2.2 Relationship to SMIL Animation" url="animate.html#RelationshipToSMILAnimation">
+ </tocsect3>
+
+ <tocsect3 name="19.2.3 Animation elements example" url="animate.html#Animation.classExample">
+ </tocsect3>
+
+ <tocsect3 name="19.2.4 Attributes to identify the target element for an animation" url="animate.html#TargetElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.5 Attributes to identify the target attribute or property for an animation" url="animate.html#TargetAttributes">
+ </tocsect3>
+
+ <tocsect3 name="19.2.6 Attributes to control the timing of the animation" url="animate.html#TimingAttributes">
+ </tocsect3>
+
+ <tocsect3 name="19.2.7 Attributes that define animation values over time" url="animate.html#ValueAttributes">
+ </tocsect3>
+
+ <tocsect3 name="19.2.8 Attributes that control whether animations are additive" url="animate.html#AdditionAttributes">
+ </tocsect3>
+
+ <tocsect3 name="19.2.9 Inheritance" url="animate.html#Inheritance">
+ </tocsect3>
+
+ <tocsect3 name="19.2.10 The 'animate' element" url="animate.html#AnimateElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.11 The 'set' element" url="animate.html#SetElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.12 The 'animateMotion' element" url="animate.html#AnimateMotionElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.13 The 'animateColor' element" url="animate.html#AnimateColorElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.14 The 'animateTransform' element" url="animate.html#AnimateTransformElement">
+ </tocsect3>
+
+ <tocsect3 name="19.2.15 Elements, attributes and properties that can be animated" url="animate.html#AnimationAttributesAndProperties">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="19.3 Animation using the SVG DOM" url="animate.html#DOMAnimationExample">
+ </tocsect2>
+
+ <tocsect2 name="19.4 Animation Module" url="animate.html#animation-mod">
+ </tocsect2>
+
+ <tocsect2 name="19.5 DOM interfaces" url="animate.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="20 Fonts" url="fonts.html">
+
+
+ <tocsect2 name="20.1 Introduction" url="fonts.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="20.2 Overview of SVG fonts" url="fonts.html#SVGFontsOverview">
+ </tocsect2>
+
+ <tocsect2 name="20.3 The 'font' element" url="fonts.html#FontElement">
+ </tocsect2>
+
+ <tocsect2 name="20.4 The 'glyph' element" url="fonts.html#GlyphElement">
+ </tocsect2>
+
+ <tocsect2 name="20.5 The 'missing-glyph' element" url="fonts.html#MissingGlyphElement">
+ </tocsect2>
+
+ <tocsect2 name="20.6 Glyph selection rules" url="fonts.html#GlyphSelectionRules">
+ </tocsect2>
+
+ <tocsect2 name="20.7 The 'hkern' and 'vkern' elements" url="fonts.html#KernElements">
+ </tocsect2>
+
+ <tocsect2 name="20.8 Describing a font" url="fonts.html#FontDescriptions">
+
+
+ <tocsect3 name="20.8.1 Overview of font descriptions" url="fonts.html#FontDescriptionsOverview">
+ </tocsect3>
+
+ <tocsect3 name="20.8.2 Alternative ways for providing a font description" url="fonts.html#FontDescriptionsAlternatives">
+ </tocsect3>
+
+ <tocsect3 name="20.8.3 The 'font-face' element" url="fonts.html#FontFaceElement">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="20.9 Full Font Module" url="fonts.html#font-mod">
+ </tocsect2>
+
+ <tocsect2 name="20.10 Basic Font Module" url="fonts.html#basic-font-mod">
+ </tocsect2>
+
+ <tocsect2 name="20.11 DOM interfaces" url="fonts.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="21 Metadata" url="metadata.html">
+
+
+ <tocsect2 name="21.1 Introduction" url="metadata.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="21.2 The 'metadata' element" url="metadata.html#MetadataElement">
+ </tocsect2>
+
+ <tocsect2 name="21.3 An example" url="metadata.html#Example">
+ </tocsect2>
+
+ <tocsect2 name="21.4 DOM interfaces" url="metadata.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="22 Backwards Compatibility" url="backward.html">
+</tocsect1>
+
+<tocsect1 name="23 Extensibility" url="extend.html">
+
+
+ <tocsect2 name="23.1 Foreign namespaces and private data" url="extend.html#PrivateData">
+ </tocsect2>
+
+ <tocsect2 name="23.2 Embedding foreign object types" url="extend.html#EmbeddingForeignObjects">
+ </tocsect2>
+
+ <tocsect2 name="23.3 The 'foreignObject' element" url="extend.html#ForeignObjectElement">
+ </tocsect2>
+
+ <tocsect2 name="23.4 An example" url="extend.html#AnExample">
+ </tocsect2>
+
+ <tocsect2 name="23.5 Adding private elements and attributes to the DTD" url="extend.html#PrivateElementsAndAttribute">
+ </tocsect2>
+
+ <tocsect2 name="23.6 Extensibility Module" url="extend.html#extensibility-mod">
+ </tocsect2>
+
+ <tocsect2 name="23.7 DOM interfaces" url="extend.html#DOMInterfaces">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix A: DTD" url="svgdtd.html">
+ <tocsect2 name="A.1 SVG 1.1 DTD Module Implementations" url="svgdtd.html#DTD.1">
+
+ <tocsect3 name="A.1.1 Modular Framework Module" url="svgdtd.html#DTD.1.1">
+ </tocsect3>
+
+ <tocsect3 name="A.1.2 Datatypes Module" url="svgdtd.html#DTD.1.2">
+ </tocsect3>
+
+ <tocsect3 name="A.1.3 Qualified Name Module" url="svgdtd.html#DTD.1.3">
+ </tocsect3>
+
+ <tocsect3 name="A.1.4 Core Attribute Module" url="svgdtd.html#DTD.1.4">
+ </tocsect3>
+
+ <tocsect3 name="A.1.5 Container Attribute Module" url="svgdtd.html#DTD.1.5">
+ </tocsect3>
+
+ <tocsect3 name="A.1.6 Viewport Attribute Module" url="svgdtd.html#DTD.1.6">
+ </tocsect3>
+
+ <tocsect3 name="A.1.7 Paint Attribute Module" url="svgdtd.html#DTD.1.7">
+ </tocsect3>
+
+ <tocsect3 name="A.1.8 Basic Paint Attribute Module" url="svgdtd.html#DTD.1.8">
+ </tocsect3>
+
+ <tocsect3 name="A.1.9 Paint Opacity Attribute Module" url="svgdtd.html#DTD.1.9">
+ </tocsect3>
+
+ <tocsect3 name="A.1.10 Graphics Attribute Module" url="svgdtd.html#DTD.1.10">
+ </tocsect3>
+
+ <tocsect3 name="A.1.11 Basic Graphics Attribute Module" url="svgdtd.html#DTD.1.11">
+ </tocsect3>
+
+ <tocsect3 name="A.1.12 Document Events Attribute Module" url="svgdtd.html#DTD.1.12">
+ </tocsect3>
+
+ <tocsect3 name="A.1.13 Graphical Element Events Attribute Module" url="svgdtd.html#DTD.1.13">
+ </tocsect3>
+
+ <tocsect3 name="A.1.14 Animation Events Attribute Module" url="svgdtd.html#DTD.1.14">
+ </tocsect3>
+
+ <tocsect3 name="A.1.15 XLink Attribute Module" url="svgdtd.html#DTD.1.15">
+ </tocsect3>
+
+ <tocsect3 name="A.1.16 External Resources Attribute Module" url="svgdtd.html#DTD.1.16">
+ </tocsect3>
+
+ <tocsect3 name="A.1.17 Structure Module" url="svgdtd.html#DTD.1.17">
+ </tocsect3>
+
+ <tocsect3 name="A.1.18 Basic Structure Module" url="svgdtd.html#DTD.1.18">
+ </tocsect3>
+
+ <tocsect3 name="A.1.19 Conditional Processing Module" url="svgdtd.html#DTD.1.19">
+ </tocsect3>
+
+ <tocsect3 name="A.1.20 Image Module" url="svgdtd.html#DTD.1.20">
+ </tocsect3>
+
+ <tocsect3 name="A.1.21 Style Module" url="svgdtd.html#DTD.1.21">
+ </tocsect3>
+
+ <tocsect3 name="A.1.22 Shape Module" url="svgdtd.html#DTD.1.22">
+ </tocsect3>
+
+ <tocsect3 name="A.1.23 Text Module" url="svgdtd.html#DTD.1.23">
+ </tocsect3>
+
+ <tocsect3 name="A.1.24 Basic Text Module" url="svgdtd.html#DTD.1.24">
+ </tocsect3>
+
+ <tocsect3 name="A.1.25 Marker Module" url="svgdtd.html#DTD.1.25">
+ </tocsect3>
+
+ <tocsect3 name="A.1.26 Color Profile Module" url="svgdtd.html#DTD.1.26">
+ </tocsect3>
+
+ <tocsect3 name="A.1.27 Gradient Module" url="svgdtd.html#DTD.1.27">
+ </tocsect3>
+
+ <tocsect3 name="A.1.28 Pattern Module" url="svgdtd.html#DTD.1.28">
+ </tocsect3>
+
+ <tocsect3 name="A.1.29 Clip Module" url="svgdtd.html#DTD.1.29">
+ </tocsect3>
+
+ <tocsect3 name="A.1.30 Basic Clip Module" url="svgdtd.html#DTD.1.30">
+ </tocsect3>
+
+ <tocsect3 name="A.1.31 Mask Module" url="svgdtd.html#DTD.1.31">
+ </tocsect3>
+
+ <tocsect3 name="A.1.32 Filter Module" url="svgdtd.html#DTD.1.32">
+ </tocsect3>
+
+ <tocsect3 name="A.1.33 Basic Filter Module" url="svgdtd.html#DTD.1.33">
+ </tocsect3>
+
+ <tocsect3 name="A.1.34 Cursor Module" url="svgdtd.html#DTD.1.34">
+ </tocsect3>
+
+ <tocsect3 name="A.1.35 Hyperlinking Module" url="svgdtd.html#DTD.1.35">
+ </tocsect3>
+
+ <tocsect3 name="A.1.36 View Module" url="svgdtd.html#DTD.1.36">
+ </tocsect3>
+
+ <tocsect3 name="A.1.37 Scripting Module" url="svgdtd.html#DTD.1.37">
+ </tocsect3>
+
+ <tocsect3 name="A.1.38 Animation Module" url="svgdtd.html#DTD.1.38">
+ </tocsect3>
+
+ <tocsect3 name="A.1.39 Font Module" url="svgdtd.html#DTD.1.39">
+ </tocsect3>
+
+ <tocsect3 name="A.1.40 Basic Font Module" url="svgdtd.html#DTD.1.40">
+ </tocsect3>
+
+ <tocsect3 name="A.1.41 Extensibility Module" url="svgdtd.html#DTD.1.41">
+ </tocsect3>
+ </tocsect2>
+
+ <tocsect2 name="A.2 SVG 1.1 Document Type Definition" url="svgdtd.html#DTD.2">
+
+
+ <tocsect3 name="A.2.1 SVG 1.1 DTD Driver" url="svgdtd.html#DTD.2.1">
+ </tocsect3>
+
+ <tocsect3 name="A.2.2 SVG 1.1 Document Model" url="svgdtd.html#DTD.2.2">
+ </tocsect3>
+
+ <tocsect3 name="A.2.3 SVG 1.1 Attribute Collection" url="svgdtd.html#DTD.2.3">
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Appendix B: SVG Document Object Model (DOM)" url="svgdom.html">
+
+
+ <tocsect2 name="B.1 SVG DOM Overview" url="svgdom.html#SVGDOMOverview">
+ </tocsect2>
+
+ <tocsect2 name="B.2 Naming Conventions" url="svgdom.html#SVGDOMNamingConventions">
+ </tocsect2>
+
+ <tocsect2 name="B.3 Interface SVGException" url="svgdom.html#InterfaceSVGException">
+ </tocsect2>
+
+ <tocsect2 name="B.4 Feature strings for the hasFeature method call" url="svgdom.html#FeatureStrings">
+ </tocsect2>
+
+ <tocsect2 name="B.5 Relationship with DOM2 events" url="svgdom.html#RelationShipWithDOM2Events">
+ </tocsect2>
+
+ <tocsect2 name="B.6 Relationship with DOM2 CSS object model (CSS OM)" url="svgdom.html#RelationShipWithCSSOM">
+
+
+ <tocsect3 name="B.6.1 Introduction" url="svgdom.html#CSSDOMIntro">
+ </tocsect3>
+
+ <tocsect3 name="B.6.2 User agents that do not support styling with CSS" url="svgdom.html#CSSDOMFeaturesNoCSSSupport">
+ </tocsect3>
+
+ <tocsect3 name="B.6.3 User agents that support styling with CSS" url="svgdom.html#CSSDOMFeaturesWithCSSSupport">
+ </tocsect3>
+
+ <tocsect3 name="B.6.4 Extended interfaces" url="svgdom.html#ExtendedInterfaces">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="B.7 Invalid values" url="svgdom.html#InvalidValues">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix C: IDL Definitions" url="idl.html">
+</tocsect1>
+
+<tocsect1 name="Appendix D: Java Language Binding" url="java.html">
+
+
+ <tocsect2 name="D.1 Using SVG with Java" url="java.html#UsingSVGWithJava">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix E: ECMAScript Language Binding" url="escript.html">
+</tocsect1>
+
+<tocsect1 name="Appendix F: Implementation Requirements" url="implnote.html">
+
+
+ <tocsect2 name="F.1 Introduction" url="implnote.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="F.2 Error processing" url="implnote.html#ErrorProcessing">
+ </tocsect2>
+
+ <tocsect2 name="F.3 Version control" url="implnote.html#VersionControl">
+ </tocsect2>
+
+ <tocsect2 name="F.4 Clamping values which are restricted to a particular range" url="implnote.html#RangeClamping">
+ </tocsect2>
+
+ <tocsect2 name="F.5 'path' element implementation notes" url="implnote.html#PathElementImplementationNotes">
+ </tocsect2>
+
+ <tocsect2 name="F.6 Elliptical arc implementation notes" url="implnote.html#ArcImplementationNotes">
+
+
+ <tocsect3 name="F.6.1 Elliptical arc syntax" url="implnote.html#ArcSyntax">
+ </tocsect3>
+
+ <tocsect3 name="F.6.2 Out-of-range parameters" url="implnote.html#ArcOutOfRangeParameters">
+ </tocsect3>
+
+ <tocsect3 name="F.6.3 Parameterization alternatives" url="implnote.html#ArcParameterizationAlternatives">
+ </tocsect3>
+
+ <tocsect3 name="F.6.4 Conversion from center to endpoint parameterization" url="implnote.html#ArcConversionCenterToEndpoint">
+ </tocsect3>
+
+ <tocsect3 name="F.6.5 Conversion from endpoint to center parameterization" url="implnote.html#ArcConversionEndpointToCenter">
+ </tocsect3>
+
+ <tocsect3 name="F.6.6 Correction of out-of-range radii" url="implnote.html#ArcCorrectionOutOfRangeRadii">
+ </tocsect3>
+
+ </tocsect2>
+
+ <tocsect2 name="F.7 Text selection implementation notes" url="implnote.html#TextSelectionImplementationNotes">
+ </tocsect2>
+
+ <tocsect2 name="F.8 Printing implementation notes" url="implnote.html#PrintingImplementationNotes">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix G: Conformance Criteria" url="conform.html">
+
+
+ <tocsect2 name="G.1 Introduction" url="conform.html#Introduction">
+ </tocsect2>
+
+ <tocsect2 name="G.2 Conforming SVG Document Fragments" url="conform.html#ConformingSVGDocuments">
+ </tocsect2>
+
+ <tocsect2 name="G.3 Conforming SVG Stand-Alone Files" url="conform.html#ConformingSVGStandAloneFiles">
+ </tocsect2>
+
+ <tocsect2 name="G.4 Conforming SVG Included Document Fragments" url="conform.html#ConformingSVGIncludedDocuments">
+ </tocsect2>
+
+ <tocsect2 name="G.5 Conforming SVG Generators" url="conform.html#ConformingSVGGenerators">
+ </tocsect2>
+
+ <tocsect2 name="G.6 Conforming SVG Interpreters" url="conform.html#ConformingSVGInterpreters">
+ </tocsect2>
+
+ <tocsect2 name="G.7 Conforming SVG Viewers" url="conform.html#ConformingSVGViewers">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix H: Accessibility Support" url="access.html">
+
+
+ <tocsect2 name="H.1 WAI Accessibility Guidelines" url="access.html#AccessibilityAndSVG">
+ </tocsect2>
+
+ <tocsect2 name="H.2 SVG Content Accessibility Guidelines" url="access.html#SVGAccessibilityGuidelines">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix I: Internationalization Support" url="i18n.html">
+
+
+ <tocsect2 name="I.1 Introduction" url="i18n.html#Intro">
+ </tocsect2>
+
+ <tocsect2 name="I.2 Internationalization and SVG" url="i18n.html#InternationalizationAndSVG">
+ </tocsect2>
+
+ <tocsect2 name="I.3 SVG Internationalization Guidelines" url="i18n.html#SVGInternationalizationGuidelines">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix J: Minimizing SVG File Sizes" url="minimize.html">
+</tocsect1>
+
+<tocsect1 name="Appendix K: References" url="refs.html">
+
+
+ <tocsect2 name="K.1 Normative references" url="refs.html#q1">
+ </tocsect2>
+
+ <tocsect2 name="K.2 Informative references" url="refs.html#q2">
+ </tocsect2>
+
+</tocsect1>
+
+<tocsect1 name="Appendix L: Element Index" url="eltindex.html">
+</tocsect1>
+
+<tocsect1 name="Appendix M: Attribute Index" url="attindex.html">
+</tocsect1>
+
+<tocsect1 name="Appendix N: Property Index" url="propidx.html">
+</tocsect1>
+
+<tocsect1 name="Appendix O: Feature Strings" url="propidx.html">
+</tocsect1>
+
+<tocsect1 name="Appendix P: Index" url="indexlist.html">
+</tocsect1>
+
+<tocsect1 name="Expanded Table of Contents" url="expanded-toc.html">
+</tocsect1>
+<tocsect1 name="Copyright notice" url="copyright-notice.html">
+ <tocsect2 name="W3C Document Copyright Notice and License" url="copyright-notice.html#Copyright-notice-document">
+ </tocsect2>
+ <tocsect2 name="W3C Software Copyright Notice and License" url="copyright-notice.html#Copyright-notice-software">
+ </tocsect2>
+</tocsect1>
+
+</kdeveloptoc>
+
diff --git a/doc/extras/w3c/w3c-uaag10.toc b/doc/extras/w3c/w3c-uaag10.toc
new file mode 100644
index 00000000..08f90cc9
--- /dev/null
+++ b/doc/extras/w3c/w3c-uaag10.toc
@@ -0,0 +1,69 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>User Agent Accessibility Guidelines 1.0</title>
+<base href="http://www.w3.org/TR/UAAG10" url="cover.html"/>
+ <tocsect1 name="Abstract" url="cover.html#abstract">
+ </tocsect1>
+ <tocsect1 name="Status of this document" url="cover.html#status">
+ </tocsect1>
+ <tocsect1 name="1. Introduction" url="intro.html#introduction">
+ <tocsect2 name="1.1 Relation to WAI accessibility guidelines" url="intro.html#context">
+ </tocsect2>
+ <tocsect2 name="1.2 Target user agents" url="intro.html#target">
+ </tocsect2>
+ <tocsect2 name="1.3 Known limitations of this document" url="intro.html#limitations">
+ </tocsect2>
+ <tocsect2 name="1.4 Relation to general software design guidelines and other specifications" url="intro.html#general-design">
+ </tocsect2>
+ <tocsect2 name="1.5 Security considerations" url="intro.html#security-considerations">
+ </tocsect2>
+ <tocsect2 name="1.6 User control" url="intro.html#user-control">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="2. The user agent accessibility guidelines" url="guidelines.html#Guidelines">
+ <tocsect2 name="1. Support input and output device-independence" url="guidelines.html#gl-device-independence">
+ </tocsect2>
+ <tocsect2 name="2. Ensure user access to all content" url="guidelines.html#gl-content-access">
+ </tocsect2>
+ <tocsect2 name="3. Allow configuration not to render some content that may reduce accessibility" url="guidelines.html#gl-feature-on-off">
+ </tocsect2>
+ <tocsect2 name="4. Ensure user control of rendering" url="guidelines.html#gl-user-control-styles">
+ </tocsect2>
+ <tocsect2 name="5. Ensure user control of user interface behavior" url="guidelines.html#gl-user-control-ui">
+ </tocsect2>
+ <tocsect2 name="6. Implement interoperable application programming interfaces" url="guidelines.html#gl-accessible-interface">
+ </tocsect2>
+ <tocsect2 name="7. Observe operating environment conventions" url="guidelines.html#gl-conventions">
+ </tocsect2>
+ <tocsect2 name="8. Implement specifications that benefit accessibility" url="guidelines.html#gl-implement-access-features">
+ </tocsect2>
+ <tocsect2 name="9. Provide navigation mechanisms" url="guidelines.html#gl-navigation">
+ </tocsect2>
+ <tocsect2 name="10. Orient the user" url="guidelines.html#gl-orientation">
+ </tocsect2>
+ <tocsect2 name="11. Allow configuration and customization" url="guidelines.html#gl-configuration">
+ </tocsect2>
+ <tocsect2 name="12. Provide accessible user agent documentation and help" url="guidelines.html#gl-documentation">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="3. Conformance" url="conformance.html#Conformance">
+ <tocsect2 name="3.1 Conformance profiles" url="conformance.html#conformance-profiles">
+ </tocsect2>
+ <tocsect2 name="3.2 Conformance claims" url="conformance.html#conformance-claims">
+ </tocsect2>
+ <tocsect2 name="3.3 UAAG 1.0 requirements in other specifications" url="conformance.html#include-uaag-reqs">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="4. Glossary" url="glossary.html#terms">
+ </tocsect1>
+ <tocsect1 name="5. References" url="references.html#References">
+ <tocsect2 name="5.1 How to refer to this document" url="references.html#this-doc-ref">
+ </tocsect2>
+ <tocsect2 name="5.2 Normative references" url="references.html#Normative-ref">
+ </tocsect2>
+ <tocsect2 name="5.3 Informative references" url="references.html#Informative-ref">
+ </tocsect2>
+ </tocsect1>
+ <tocsect1 name="6. Acknowledgments" url="acks.html#Acknowledgments">
+ </tocsect1>
+</kdeveloptoc>
diff --git a/doc/kde_app_devel/Makefile.am b/doc/kde_app_devel/Makefile.am
new file mode 100644
index 00000000..41691557
--- /dev/null
+++ b/doc/kde_app_devel/Makefile.am
@@ -0,0 +1,3 @@
+KDE_LANG = en
+KDE_DOCS = AUTO
+
diff --git a/doc/kde_app_devel/appwizard.png b/doc/kde_app_devel/appwizard.png
new file mode 100644
index 00000000..adbadb35
--- /dev/null
+++ b/doc/kde_app_devel/appwizard.png
Binary files differ
diff --git a/doc/kde_app_devel/index.docbook b/doc/kde_app_devel/index.docbook
new file mode 100644
index 00000000..5b721135
--- /dev/null
+++ b/doc/kde_app_devel/index.docbook
@@ -0,0 +1,1549 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+ <!ENTITY kdevelop "<application>KDevelop</application>">
+ <!ENTITY kappname "&kdevelop;">
+ <!ENTITY % addindex "INCLUDE">
+ <!ENTITY % English "INCLUDE" > <!-- change language only here -->
+]>
+
+<book lang="&language;">
+
+<bookinfo>
+<title>The &kdevelop; Programming Handbook</title>
+
+<date>2002-12-05</date>
+<releaseinfo>2.0</releaseinfo>
+
+<authorgroup>
+<author>
+<firstname>Ralf</firstname>
+<surname>Nolden</surname>
+<affiliation><address><email>Ralf.Nolden@post.rwth-aachen.de</email></address></affiliation>
+</author>
+<author>
+<firstname>Caleb</firstname>
+<surname>Tennis</surname>
+<affiliation><address><email>caleb@aei-tech.com</email></address></affiliation>
+</author>
+</authorgroup>
+
+<copyright>
+<year>1999</year>
+<holder>Ralf Nolden</holder>
+</copyright>
+<copyright>
+<year>2002</year>
+<holder>Caleb Tennis</holder>
+</copyright>
+
+<!-- ROLES_OF_TRANSLATORS -->
+
+<legalnotice>&FDLNotice;</legalnotice>
+
+<abstract>
+<para>The User Guide to C++ Application Design for the K Desktop Environment (KDE) with
+the &kdevelop; IDE</para>
+</abstract>
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>KDevelop</keyword>
+<keyword>IDE</keyword>
+<keyword>development</keyword>
+<keyword>programming</keyword>
+</keywordset>
+
+</bookinfo>
+
+<chapter id="chapter1">
+<title>Introduction</title>
+<para>
+As Unix Systems are becoming more and more popular to even beginners working with computer machines
+due to its advantages in regards of stability and functionality, most are somehow disappointed, because
+those applications don't have a consistent look and each one behaves different from another. With KDE,
+developers have an almost perfect way to create first-class applications for Unix desktop systems to get
+a wider user community by the mere quality their applications have to offer. Therefore, KDE becomes more
+and more popular as a base for programming design, and developers want to take advantage of the
+possibilities that the system has to offer.
+</para>
+
+<sect1 id="c1s1">
+<title>What you should know already</title>
+<para>
+For making the best use of this programming handbook, we assume that you already know about the
+C++ programming language; if not, you should make yourself familiar with that first. Information about
+C++ is available through various sources either in printed form at your local bookstore or by tutorials
+found on the Internet. Knowledge about the design of Graphical User Interfaces is not required, as this
+handbook tries to cover the application design for KDE programs, which also includes an introduction into
+the Qt toolkit as well as the KDE libraries and the design of User Interfaces. Also, you should have made
+yourself comfortable with &kdevelop; by reading The User Manual to &kdevelop;, which contains a descriptive
+review of the functionality provided by the IDE.
+</para>
+</sect1>
+
+<sect1 id="c1s2">
+<title>About this Handbook</title>
+<para>
+This handbook has been written to give developers an introduction into KDE application development by
+using the KDevelop Integrated Development Environment.
+</para>
+<para>
+The following chapters therefore give an introduction on how to create projects, explains the sourcecode
+already generated and shows how to extend the given sources on various topics such as toolbars, menu bars
+and view areas.
+</para>
+<para>
+Then the dialogeditor is discussed in detail, explaining how widgets are created and covers widget
+properties settings in detail for all provided widgets.
+</para>
+<para>
+Finally, you will learn about several topics that will complete your knowledge in regards of project design
+and helps you work out additional issues besides coding such as adding API documentation and extending
+online-manuals.
+</para>
+<sect2 id="c1s2s1">
+<title>In the next chapter</title>
+<para>
+We'll take a look at the Qt and KDE libraries, showing basic concepts and why things are the way they are.
+Also, we will discuss how to create the tutorial applications provided with the Qt toolkit by using
+kdevelop;, so beginners can already see first results with a few steps, and thereby will learn how to make
+use of some of &kdevelop;'s best features.
+</para>
+</sect2>
+
+<sect2 id="c1s2s2">
+<title>In the following chapters</title>
+<para>
+You will learn how to:
+<itemizedlist>
+<listitem><para>create an application with the KAppWizard</para></listitem>
+<listitem><para>What the project skeleton already provides</para></listitem>
+<listitem><para>What the code already create means</para></listitem>
+<listitem><para>How to create your own views</para></listitem>
+<listitem><para>How to extend your application's functionality by dialog, menu bars, and toolbars</para></listitem>
+<listitem><para>How to make your application user friendly by providing help functions</para></listitem>
+<listitem><para>How to write online documentation</para></listitem>
+</itemizedlist>
+</para>
+</sect2>
+
+</sect1>
+
+<sect1 id="c1s3">
+<title>Additional Information</title>
+<para>
+Additional information about Qt/KDE programming is available by various sources:
+<itemizedlist>
+<listitem><para>Programming with Qt by Matthias Kalle Dalheimer</para></listitem>
+<listitem><para><ulink url="www.kdevelop.org">The User Manual to KDevelop, provided with the KDevelop IDE</ulink></para></listitem>
+<listitem><para><ulink url="doc.trolltech.com">The Online Reference to the Qt library</ulink></para></listitem>
+<listitem><para><ulink url="developer.kde.org">The KDE Developer web site</ulink></para></listitem>
+</itemizedlist>
+</para>
+<para>
+Additionally, you should look for help by subscribing to the various mailing lists, whose addresses
+are available on the mentioned web sites, and on the Usenet newsgroups dedicated to users of KDE and
+Unix Systems as well as about the C and C++ programming language.
+</para>
+<para>
+For obtaining help about the KDevelop IDE, you should send requests to our mailinglist at
+<email>kdevelop@kdevelop.org</email>. Mind that the KDevelop team is dedicated to provide the means to enable you to
+program applications and therefore is not intended as a technical support team in cases where the
+applications you're developing don't work due to implementation errors or misconfigurations of your
+operating system. By this, we ask all users to take advantage of the mailinglist in any case you're running
+into problems with the use of the IDE itself, as well as for bug reports and suggestions for improving the
+functionality of the development environment.
+</para>
+</sect1>
+
+</chapter>
+
+<chapter id="chapter2">
+<title>The KDE and Qt Libraries</title>
+<para>
+The Norwegian company TrollTech (<ulink url="http://www.trolltech.com">http://www.trolltech.com</ulink>)
+provides a so-called GUI toolkit, named Qt. GUI means "Graphical User Interface", and therefore, Qt-based
+applications represent themselves with buttons, windows etc, allowing user input by visualizing the functions
+an application provides. Such a toolkit is needed for developing graphical applications that run on the X-Window
+interface on Unix Systems, because X does not contain a pre-defined user interface itself. Although other
+toolkits are also available to create User Interfaces, Qt offers some technical advantages that make
+application design very easy. Additionally, the Qt toolkit is also available for Microsoft Windows systems,
+which allows developers to provide their applications for both platforms.
+</para>
+<para>
+The KDE Team (<ulink url="http://www.kde.org">http://www.kde.org</ulink>) joined together with the goal
+to make using Unix Systems more friendly, and decided to use the Qt toolkit for the development of a window
+manager on X-Windows, plus a variety of tools included with the KDE packages. The K Desktop Environment
+therefore contains the window manager kwm, the file manager kfm and the launch panel kpanel as the main
+components plus a variety of first-class utilities and applications. After KDE was out, a lot of developers
+turned their eyes towards the new environment and what it has to offer them. The KDE libraries are providing
+essential methods and classes that make all applications designed with them look similar and consistent,
+so the user has the great advantage that he only has to get accustomed with an application's specific
+usage, not with handling dialogs or buttons. Also, KDE programs integrate themselves into the desktop and
+are able to interact with the file manager via drag'n drop, offer session management and many more, if all
+features offered by the KDE libraries are used. Both, the Qt toolkit and the KDE libraries, are implemented
+in the C++ programming language; therefore applications that make use of these libraries are also mostly
+written in C++. In the following chapter, we'll make a short trip through the libraries to see what already
+is provided and how Qt and KDE applications are created in general.
+</para>
+<para>
+Both, the Qt toolkit and the KDE libraries, are implemented in the C++ programming language;
+therefore applications that make use of these libraries are also mostly written in C++. In the following
+chapter, we'll make a short trip through the libraries to see what already is provided and how Qt and KDE
+applications are created in general.
+</para>
+
+<sect1 id="c2s1">
+<title>The Qt GUI Toolkit</title>
+<para>
+As said, the Qt library is a toolkit that offers graphical elements that are used for creating GUI
+applications and are needed for X-Window programming. Additionally, the toolkit offers:
+<itemizedlist>
+<listitem><para>A complete set of classes and methods ready to use even for non-graphical programming issues</para></listitem>
+<listitem><para>A good solution towards user interaction by virtual methods and the signal/slot mechanism</para></listitem>
+<listitem><para>A set of predefined GUI-elements, called "widgets", that can be used easily for creating the visible elements</para></listitem>
+<listitem><para>Additional completely pre-defined dialogs that are often used in applications such as progress and file dialogs</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Therefore knowing the Qt classes is very essential, even if you only want to program KDE-applications.
+To have an impression on the basic concept how GUI-applications are constructed and compiled, we'll first
+have a look at a sample Qt-only program; then we'll extend it to a KDE program.
+</para>
+
+<sect2 id="c2s1s1">
+<title>The first Qt Application</title>
+<para>
+As usual, programs in C++ have to contain a <function>main()</function> function, which is the starting point for application
+execution. As we want them to be graphically visible in windows and offering user interaction,
+we first have to know, how they can show themselves to the user. For an example, we'll have a look
+at the first tutorial included with the Qt Online Reference Documentation and explain the basic execution
+steps; also why and how the application window appears:
+<programlisting>
+#include &lt;qapplication.h>
+#include &lt;qpushbutton.h>
+
+int main( int argc, char **argv )
+{
+QApplication a( argc, argv );
+
+QPushButton hello( "Hello world!", 0 );
+hello.resize( 100, 30 );
+
+a.setMainWidget( &amp;hello );
+hello.show();
+return a.exec();
+}
+</programlisting>
+</para>
+<para>
+This application merely paints a window containing a button with "Hello world" as its text. As for
+all Qt-based applications, you first have to create an instance of the class <classname>QApplication</classname>, represented by
+variable a.
+</para>
+<para>
+Next, the program creates an instance of the class <classname>QPushButton</classname> called hello, this will be the button.
+The constructor of hello gets a string as a parameter, which is the contents of the widget visible as
+the buttons text.
+</para>
+<para>
+Then the <methodname>resize()</methodname> method is called on the hello button. This changes the default size a widget
+(which is in this case the <classname>QPushButton</classname>) has when created to the length of 100 pixels and the height of
+30 pixels. Finally, the setMainWidget() method is called for a and the show() method for hello. The
+QApplication is finally executed by <methodname>a.exec()</methodname>, enters the main event loop and waits until it has to return
+an integer value to the overlaying Operating System signaling that the application is exited.
+</para>
+</sect2>
+
+<sect2 id="c2s1s2">
+<title>The Reference Documentation for Qt</title>
+<para>
+Now, let's have a quick look at the reference documentation of the Qt library. To do this, start
+&kdevelop; and select "Qt" from the tree in the Documentation tab. The documentation browser opens
+and shows you the start page of the Qt reference. This will be your first place to get information
+about Qt, it's classes and the available functions they provide. Also, the above program is the first
+that is included in the tutorials section. To get to the classes we want to have a look at,
+<classname>QApplication</classname> and <classname>QPushButton</classname>, select "Alphabetical Class List"
+and search for the according names. Follow either of them to have a look at the class documentation.
+</para>
+<para>
+Alternatively, you can use the online documentation from Trolltech's <ulink url="doc.trolltech.com">Qt Documentation</ulink>
+</para>
+<para>
+For <classname>QApplication</classname>, you will see the constructor and all other methods that this
+class provides. If you follow a link, you will get more information about the usage and meaning of the
+methods, which is very useful when you sometimes can't detect the correct use or want to have an example.
+This also counts for the KDE library documentation, which uses a similar documentation type; therefore
+this is almost all you have to know about using the class-references with the documentation browser.
+</para>
+<sect3 id="c2s1s2s1">
+<title>Interpretation of the Sample</title>
+<para>
+Starting with <classname>QApplication</classname>, you will find all the methods used in our first example:
+<itemizedlist>
+<listitem><para>the constructor <methodname>QApplication()</methodname></para></listitem>
+<listitem><para>the <methodname>setMainWidget()</methodname> method</para></listitem>
+<listitem><para>the <methodname>exec()</methodname> method</para></listitem>
+</itemizedlist>
+</para>
+<para>
+The interpretation why we use these methods is very simple:
+<orderedlist>
+<listitem><para>Create an instance of the class <classname>QApplication</classname> with the constructor,
+so we can make use of the GUI elements provided by Qt</para></listitem>
+<listitem><para>Create a widget which will be the contents of our program window</para></listitem>
+<listitem><para>Set the widget as the main widget for a</para></listitem>
+<listitem><para>Execute the a instance of <classname>QApplication</classname></para></listitem>
+</orderedlist>
+</para>
+<para>
+The second object of our program is the pushbutton, an instance of the class <classname>QPushButton</classname>.
+From the two constructors given to create an instance, we used the second: this accepts a text,
+which is the label contents of the button; here, it is the string "Hello world!". Then we called the
+<methodname>resize()</methodname> method to change the size of the button according to it's contents -
+the button has to be larger to make the string completely visible.
+</para>
+<para>
+But what about the <methodname>show()</methodname> method? Now, you see that like most other widgets,
+<classname>QPushButton</classname> is based on a single inheritance, the documentation says, Inherits
+<classname>QButton</classname>. Follow the link to the <classname>QButton</classname> class.
+This shows you a lot of other widgets that are inherited by <classname>QPushButton</classname>,
+which we'll use later to explain the signal/slot mechanism. Anyway, the <methodname>show()</methodname>
+method is not listed, therefore, it must be a method that is provided by inheritance as well. The class
+that <classname>QButton</classname> inherits is <classname>QWidget</classname>. Just follow the link
+again, and you will see a whole bunch of methods that the QWidget class provides; including
+the <methodname>show()</methodname> method. Now we understand what was done in the sample with the button:
+<orderedlist>
+<listitem><para>Create an instance of <classname>QPushButton</classname>, use the second constructor to set the button text</para></listitem>
+<listitem><para>Resize the widget to its contents</para></listitem>
+<listitem><para>Set the widget as the main widget of the <classname>QApplication</classname> instance a</para></listitem>
+<listitem><para>Tell the widget to display itself on the screen by calling <methodname>show()</methodname>, an inherited method from <classname>QWidget</classname></para></listitem>
+</orderedlist>
+</para>
+<para>
+After calling the <methodname>exec()</methodname> method, the application is visible to the user,
+showing a window with the button showing "Hello world!". Note: GUI programs behave somewhat differently
+than procedural applications. The main thing here is that the application enters a so-called
+"main event loop". This means that the program has to wait for user actions and then react to it, also
+that for a Qt application, the program has to be in the main event loop to start the event handling.
+The next section tells you in short what this means to the programmer and what Qt offers to process
+user events.
+</para>
+<note><para>
+For already advanced users: The button has no parent declared in the constructor, therefore it
+is a top-level widget alone and runs in a local event loop which doesn't need to wait for the main
+event loop. See the QWidget class documentation and The KDE Library Reference Guide</para>
+</note>
+
+</sect3>
+</sect2>
+
+<sect2 id="c2s1s3">
+<title>User Interaction</title>
+<para>
+After reading the last sections, you should already know:
+<itemizedlist>
+<listitem><para>What the Qt-library provides in terms of GUI applications</para></listitem>
+<listitem><para>How a program using Qt is created and</para></listitem>
+<listitem><para>Where and how to find information about classes that you want to use with the documentation browser</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Now we'll turn to give the application "life" by processing user events. Generally, the user has two ways
+to interact with a program: the mouse and the keyboard. For both ways, a graphical user interface has to
+provide methods that detect actions and methods that do something as a reaction to these actions.
+</para>
+<para>
+The Window system therefore sends all interaction events to the according application. The
+<classname>QApplication</classname> then sends them to the active window as a <classname>QEvent</classname>
+and the widgets themselves have to decide what to do with them. A widget receives the event and processes
+<methodname>QWidget::event(QEvent*)</methodname>, which then decides which event has been executed
+and how to react; <methodname>event()</methodname> is therefore the main event handler. Then,
+the <methodname>event()</methodname> method passes the event to so-called event filters
+that determine what happened and what to do with the event. If no filter signs responsible for the
+event, the specialized event handlers are called. Thereby we can decide between:
+<itemizedlist>
+<listitem><para>
+Keyboard events -- TAB and Shift-TAB keys:</para>
+<itemizedlist>
+<listitem><para><methodname>virtual void focusInEvent(QFocusEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void focusOutEvent(QFocusEvent *)</methodname></para></listitem>
+</itemizedlist>
+</listitem>
+
+<listitem><para>
+All other keyboard input:</para>
+<itemizedlist>
+<listitem><para><methodname>virtual void keyPressEvent(QKeyEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void keyReleaseEvent(QKeyEvent *)</methodname></para></listitem>
+</itemizedlist>
+</listitem>
+
+<listitem><para>
+Mouse movements:</para>
+<itemizedlist>
+<listitem><para><methodname>virtual void mouseMoveEvent(QMouseEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void enterEvent(QEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void leaveEvent(QEvent *)</methodname></para></listitem>
+</itemizedlist>
+</listitem>
+
+<listitem><para>
+Mouse button actions</para>
+<itemizedlist>
+<listitem><para><methodname>virtual void mousePressEvent(QMouseEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void mouseReleaseEvent(QMouseEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void mouseDoubleClickEvent(QMouseEvent *)</methodname></para></listitem>
+</itemizedlist>
+</listitem>
+
+<listitem><para>
+Window events containing the widget</para>
+<itemizedlist>
+<listitem><para><methodname>virtual void moveEvent(QMoveEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void resizeEvent(QResizeEvent *)</methodname></para></listitem>
+<listitem><para><methodname>virtual void closeEvent(QCloseEvent *)</methodname></para></listitem>
+</itemizedlist>
+</listitem>
+
+</itemizedlist>
+</para>
+<para>
+Note that all event functions are virtual and protected; therefore you can re-implement the events
+that you need in your own widgets and specify how your widget has to react. <classname>QWidget</classname>
+also contains some other virtual methods that can be useful in your programs; anyway, it is sufficient
+to know about <classname>QWidget</classname> very well.
+</para>
+</sect2>
+<sect2 id="c1s2s4">
+<title>Object Interaction by Signals and Slots</title>
+<para>
+Now we're coming to the most obvious advantages of the Qt toolkit: the signal/slot mechanism.
+This offers a very handy and useful solution to object interaction, which usually is solved by
+callback functions for X-Window toolkits. As this communication requires a strict programming and
+sometimes makes user interface creation very difficult (as referred by the Qt documentation and explained
+in Programming with Qt by K.Dalheimer), Troll Tech invented a new system where objects can emit signals
+that can be connected to methods declared as slots. For the C++ part of the programmer, he only has to know
+some things about this mechanism:
+<itemizedlist>
+<listitem><para>
+the class declaration of a class using signals/slots has to contain the Q_OBJECT macro at the beginning
+(without a semicolon); and have to be derved from the <classname>QObject</classname> class
+</para></listitem>
+<listitem><para>
+a signal can be emitted by the keyword emit, e.g. emit signal(parameters); from within any member function
+of a class that allows signals/slots
+</para></listitem>
+
+<listitem><para>
+all signals used by the classes that are not inherited have to be added to the class declaration by a
+signals section
+</para></listitem>
+<listitem><para>
+all methods that can be connected with a signal are declared in sections with the additional keyword slot,
+e.g. public slots: within the class declaration
+</para></listitem>
+<listitem><para>
+the meta-object compiler moc has to run over the header file to expand the macros and to produce the
+implementation (which is not necessary to know). The output files of moc are compiled also by the C++ compiler.
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Another way to use signals without deriving from <classname>QObject</classname> is to use the
+<classname>QSignal</classname> class- see the reference documentation for more information and example
+usage. In the following, we assume you're deriving from <classname>QObject</classname>.
+</para>
+<para>
+This way, your class is able to send signals anywhere and to provide slots that signals can connect
+to. By using the signals, you don't have to care about who's receiving it- you just have to emit the
+signal and whatever slot you want to connect to it can react to the emission. Also the slots can be used
+as normal methods during implementation.
+</para>
+<para>
+Now, to connect a signal to a slot, you have to use the <methodname>connect()</methodname> methods that
+are provided by <classname>QObject</classname> or, where available, special methods that objects provide
+to set the connection for a certain signal.
+</para>
+
+<sect3 id="c1s2s4s1">
+<title>Sample Usage</title>
+<para>
+To explain the way how to set up object-interaction, we'll take our first example again and extend it by a
+simple connection:
+<programlisting>
+#include &lt;qapplication.h>
+#include &lt;qpushbutton.h>
+
+int main( int argc, char **argv )
+{
+QApplication a( argc, argv );
+
+QPushButton hello( "Hello world!" , 0);
+hello.resize( 100, 30 );
+
+a.setMainWidget( &amp;hello );
+
+QObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ));
+
+hello.show();
+return a.exec();
+}
+</programlisting>
+</para>
+<para>
+You see, the only addition to give the button more interaction is to use a <methodname>connect()
+</methodname> method: <methodname>connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ))</methodname>;
+is all you have to add. What is the meaning now? The class declaration of QObject says about the
+<methodname>connect()</methodname> method:
+</para>
+<para><methodname>
+bool connect ( const QObject * sender, const char * signal, const QObject * receiver, const char * member )
+</methodname></para>
+<para>
+This means you have to specify a <classname>QObject</classname> instance pointer that is the sender
+of the signal, meaning that it can emit this signal as first parameter; then you have to specify the signal
+that you want to connect to. The last two parameters are the receiver object that provides a slot, followed
+by the member function which actually is the slot that will be executed on signal emission.
+</para>
+<para>
+By using signals and slots, your program's objects can interact with each other easily without explicitly
+depending on the type of the receiver object. You will learn more about using this mechanism for productive
+usage later in this handbook. More information about the Signals/Slot mechanism can also be found in
+<ulink url="developer.kde.org/documentation/library/libraryref.html">The KDE Library Reference Guide</ulink>
+and the <ulink url="doc.trolltech.com">Qt online reference</ulink>.
+</para>
+</sect3>
+</sect2>
+</sect1>
+
+<sect1 id="c2s3">
+<title>What KDE provides</title>
+<sect2 id="c2s3s1">
+<title>The KDE 3.x libraries</title>
+<para>
+The main KDE libraries you'll be using for creating your own KDE applications are:
+<itemizedlist>
+<listitem><para>
+the kdecore library, containing all classes that are non-visible elements to provide application functionality
+</para></listitem>
+<listitem><para>
+the kdeui library, containing user interface elements like menubars, toolbars, etc.
+</para></listitem>
+<listitem><para>
+the kfile library, containing the file selection dialogs
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Additionally, for specific solutions KDE offers the following libraries:
+<itemizedlist>
+<listitem><para>
+the kdefx library, containing pixmaps, image effects the KStyle extension to QStyle
+</para></listitem>
+<listitem><para>
+the khtml library, containing KDE's html component
+</para></listitem>
+<listitem><para>
+the kjs library, containing KDE's Javascript support
+</para></listitem>
+<listitem><para>
+the kio library, containing low level access to network files
+</para></listitem>
+<listitem><para>
+the kparts library, containing support for re-usable embeddable extendable applications
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Next we'll have a look at what is needed to turn out first Qt Application into a KDE one.
+</para>
+</sect2>
+<sect2 id="c2s3s2">
+<title>Example KDE Application</title>
+<para>
+In the following, you will see that writing a KDE application is not much more difficult than a
+Qt application. For the use of KDE's features, you just have to use some other classes, and you're almost
+done. As an example, we'll discuss the changed version of the Qt example from above:
+<programlisting>
+#include &lt;kapplication.h>
+#include &lt;qpushbutton.h>
+
+int main( int argc, char **argv )
+{
+KApplication a( argc, argv );
+
+QPushButton hello( "Hello world!", 0 );
+hello.resize( 100, 30 );
+
+a.setTopWidget( &amp;hello );
+
+QObject::connect(&amp;hello, SIGNAL( clicked() ), &amp;a, SLOT( quit() ));
+
+hello.show();
+return a.exec();
+}
+</programlisting>
+</para>
+<para>
+You see that first we have changed from <classname>QApplication</classname> to <classname>KApplication
+</classname>. Further, we had to change the previously used <methodname>setMainWidget()</methodname> method
+to <methodname>setTopWidget</methodname>, which <classname>KApplication</classname> uses to set the main
+widget. That's it! Your first KDE application is ready - you only have to tell the compiler the KDE
+include path and the linker to link in the kdecore library with -lkdecore.
+</para>
+<para>
+As you now know what at least the <function>main()</function> function provides generally and how an
+application gets visible and allows user and object interaction, we'll go on with the next chapter,
+where our first application is made with &kdevelop;. There you can also test everything which was
+mentioned before and see the effects.
+</para>
+<para>
+What you should have looked into additionally until now is the reference documentation for Qt,
+especially the <classname>QApplication</classname>, <classname>QWidget</classname> and <classname>QObject
+</classname> class and the kdecore library documentation for the <classname>KApplication</classname> class.
+The <ulink url="developer.kde.org/documentation/library/libraryref.html">KDE Library Reference handbook</ulink>
+also covers a complete description about the invocation of the <classname>QApplication</classname> and
+<classname>KApplication</classname> constructors including command-line argument processing.
+</para>
+</sect2>
+</sect1>
+
+</chapter>
+
+<chapter id="chapter3">
+<title>Creating New Applications</title>
+
+<sect1 id="c3s1">
+<title>The Application Wizard</title>
+<para>
+&kdevelop;'s Application Wizard is intended to let you start working on new project with &kdevelop;. Therefore
+all of your projects are first created by the wizard, and then you can start building them and extend what is
+already provided by the source skeleton. You can choose from several project types according to your project goals:
+<itemizedlist>
+<listitem><para>
+KDE Application Framework: includes source code for a complete frame structre of a standard KDE application
+</para></listitem>
+<listitem><para>
+QMake Project: Creates an application framework based around Trolltech's qmake configuration system
+</para></listitem>
+<listitem><para>
+Simple hello world program: Creates a C++ terminal based program with no GUI support
+</para></listitem>
+<listitem><para>
+A multitude of other program skeletons
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+In this chapter we'll see how the Application Wizard can be invoked and what has to be done to generate
+a KDE application project. This will also be the initial step of our coverage, where we will create the
+initial version of a sample project. For all other project types the steps are usualyl the same, but you
+may not have as many options available.
+</para>
+</sect1>
+
+<sect1 id="c3s2">
+<title>Invoking the Application Wizard and Project Generation</title>
+<sect2 id="c3s2s1">
+<title>Starting the Application Wizard and the First Page</title>
+<para>
+To start with your KDE application, open &kdevelop;. From the Project menu, selection New Project. The
+Application Wizard starts, and you'll see the selection tree on the first page containing available project
+types that can be created. Choose the C++ subtree, then KDE, then Application Framework.
+</para>
+<para>
+For our sample project, we are going to create the application KScribble. Enter this as the application
+name, and change any other information at the bottom of this screen that may need it. Then, select Next.
+<screenshot><mediaobject><imageobject>
+<imagedata fileref="appwizard.png" format="PNG"/>
+</imageobject><textobject><phrase>Application Wizard</phrase></textobject>
+</mediaobject></screenshot>
+</para>
+</sect2>
+<sect2 id="c3s2s2">
+<title>Version control information</title>
+<para>
+On this screen you have the ability to decide if your project will use a version control system like
+CVS. For our sample project we will not use source control, so make sure the selection box reads None
+and select Next.
+</para>
+</sect2>
+<sect2 id="c3s2s3">
+<title>Header and Source Templates</title>
+<para>
+The next two pages show example headers that will go at the top of each of the header and source files that
+you create using &kdevelop;. For now, just leave these as the default, and select Next, then Finish. If the
+Finish button is not activated, you haven't set all of the options correct. Use the Back button to return
+to earlier menus and correct any mistakes.
+</para>
+</sect2>
+<sect2 id="c3s2s4">
+<title>Finishing Up</title>
+<para>
+Upon completion, the Application Wizard should close and the messages window should popup displaying
+information about the tasks that &kdevelop; is currently doing. At the end of all of the tasks, you
+should see **** Success *****. This means the application framework was successfully loaded.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="c3s3">
+<title>The First Build</title>
+<para>
+After our project is generated, we'll first make a trip through the source code to get a general understanding
+of how the application framework looks. This won't only help us get started, but we'll know where to change
+what in later steps.
+</para>
+<para>
+This chapter makes the assumption that you understand the basic navigation of &kdevelop;. Consult the
+KDevelop User Manual for information if you need it.
+</para>
+<para>
+The Automake manager shows the project files as follows:
+<screenshot><mediaobject><imageobject>
+<imagedata fileref="kscribblefiles.png" format="PNG"/>
+</imageobject><textobject><phrase>Files in our project</phrase></textobject>
+</mediaobject></screenshot>
+</para>
+<para>
+Before diving into the sources, we'll let &kdevelop; build an run our new application. To do this, select
+Build Project from the Build menu, or press F8. The output window opens and displays output messages during
+the compilation phase.
+<programlisting>
+1 cd /home/caleb/kscribble &amp;&amp; WANT_AUTOCONF_2_5=1 WANT_AUTOMAKE_1_6=1 gmake k
+2 gmake all-recursive
+3 gmake[1]: Entering directory `/home/caleb/kscribble'
+4 Making all in doc
+5 gmake[2]: Entering directory `/home/caleb/kscribble/doc'
+6 Making all in .
+7 gmake[3]: Entering directory `/home/caleb/kscribble/doc'
+8 gmake[3]: Nothing to be done for `all-am'.
+9 gmake[3]: Leaving directory `/home/caleb/kscribble/doc'
+10 Making all in en
+11 gmake[3]: Entering directory `/home/caleb/kscribble/doc/en'
+12 /usr/local/kde3/bin/meinproc --check --cache index.cache.bz2 /home/caleb/kscribble/doc/en/index.docbook
+13 gmake[3]: Leaving directory `/home/caleb/kscribble/doc/en'
+14 gmake[2]: Leaving directory `/home/caleb/kscribble/doc'
+15 Making all in po
+16 gmake[2]: Entering directory `/home/caleb/kscribble/po'
+17 gmake[2]: Nothing to be done for `all'.
+18 gmake[2]: Leaving directory `/home/caleb/kscribble/po'
+19 Making all in src
+20 gmake[2]: Entering directory `/home/caleb/kscribble/src'
+21 source='main.cpp' object='main.o' libtool=no \
+22 depfile='.deps/main.Po' tmpdepfile='.deps/main.TPo' \
+23 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+24 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
+ -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new
+ -c -o main.o `test -f 'main.cpp' || echo '/home/caleb/kscribble/src/'`main.cpp
+25 /usr/lib/qt/bin/moc /home/caleb/kscribble/src/kscribble.h -o kscribble.moc
+26 source='kscribble.cpp' object='kscribble.o' libtool=no \
+27 depfile='.deps/kscribble.Po' tmpdepfile='.deps/kscribble.TPo' \
+28 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+29 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
+ -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new
+ -c -o kscribble.o `test -f 'kscribble.cpp' || echo '/home/caleb/kscribble/src/'`kscribble.cpp
+30 kscribble.cpp: In member function `void KScribble::setupActions()'
+31 kscribble.cpp:107: warning: unused variable `KAction*custom'
+32 /usr/lib/qt/bin/moc /home/caleb/kscribble/src/kscribbleview.h -o kscribbleview.moc
+33 source='kscribbleview.cpp' object='kscribbleview.o' libtool=no \
+34 depfile='.deps/kscribbleview.Po' tmpdepfile='.deps/kscribbleview.TPo' \
+35 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+36 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi
+ -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new -c
+ -o kscribbleview.o `test -f 'kscribbleview.cpp' || echo '/home/caleb/kscribble/src/'`kscribbleview.cpp
+37 kscribbleview.cpp: In member function `void KScribbleView::print(QPainter*,
+38 int, int)':
+39 kscribbleview.cpp:79: warning: unused parameter `QPainter*p'
+40 kscribbleview.cpp:79: warning: unused parameter `int height'
+41 kscribbleview.cpp:79: warning: unused parameter `int width'
+42 /usr/lib/qt/bin/moc /home/caleb/kscribble/src/pref.h -o pref.moc
+43 source='pref.cpp' object='pref.o' libtool=no \
+44 depfile='.deps/pref.Po' tmpdepfile='.deps/pref.TPo' \
+45 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+46 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
+ -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new
+ -c -o pref.o `test -f 'pref.cpp' || echo '/home/caleb/kscribble/src/'`pref.cpp
+47 /usr/local/kde3/bin/dcopidl /home/caleb/kscribble/src/kscribbleiface.h > kscribbleiface.kidl ||
+ ( rm -f kscribbleiface.kidl ; /bin/false )
+48 /usr/local/kde3/bin/dcopidl2cpp --c++-suffix cpp --no-signals --no-stub kscribbleiface.kidl
+49 source='kscribbleiface_skel.cpp' object='kscribbleiface_skel.o' libtool=no \
+50 depfile='.deps/kscribbleiface_skel.Po' tmpdepfile='.deps/kscribbleiface_skel.TPo' \
+51 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+52 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
+ -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new
+ -c -o kscribbleiface_skel.o `test -f 'kscribbleiface_skel.cpp' ||
+ echo '/home/caleb/kscribble/src/'`kscribbleiface_skel.cpp
+53 /bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall
+ -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500
+ -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new -o kscribble -R
+ /usr/local/kde3/lib -R /usr/lib/qt/lib -R /usr/X11R6/lib -L/usr/X11R6/lib -L/usr/lib/qt/lib
+ -L/usr/local/kde3/lib main.o kscribble.o kscribbleview.o pref.o kscribbleiface_skel.o -lkio
+54 source='kscribble_client.cpp' object='kscribble_client.o' libtool=no \
+55 depfile='.deps/kscribble_client.Po' tmpdepfile='.deps/kscribble_client.TPo' \
+56 depmode=gcc3 /bin/sh /home/caleb/kscribble/admin/depcomp \
+57 g++ -DHAVE_CONFIG_H -I. -I/home/caleb/kscribble/src -I.. -I/usr/local/kde3/include
+ -I/usr/lib/qt/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor
+ -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings
+ -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new
+ -c -o kscribble_client.o `test -f 'kscribble_client.cpp' || echo
+ '/home/caleb/kscribble/src/'`kscribble_client.cpp
+58 /bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef
+ -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500
+ -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -fno-exceptions -fno-check-new -o kscribble_client -R
+ /usr/local/kde3/lib -R /usr/lib/qt/lib -R /usr/X11R6/lib -L/usr/X11R6/lib -L/usr/lib/qt/lib
+ -L/usr/local/kde3/lib kscribble_client.o -lkdecore
+59 gmake[2]: Leaving directory `/home/caleb/kscribble/src'
+60 gmake[2]: Entering directory `/home/caleb/kscribble'
+61 gmake[2]: Nothing to be done for `all-am'.
+62 gmake[2]: Leaving directory `/home/caleb/kscribble'
+63 gmake[1]: Leaving directory `/home/caleb/kscribble'
+64 *** Success ***
+</programlisting>
+</para>
+<para>
+As you can see, we've put line numbers in front of each line which won't appear on your output but it makes it
+easier to describe what is happening during the build. First of all, gmake works recursively. This means
+that it starts from the directory it is invoked and goes into the subdirectories first, one at a time, then
+returns to the directory it was started, processes it, then finishes.
+</para>
+<para>
+Our first line of interest is 24. Notice on this line that g++, which is our C++ compiler, gets called by make
+to compile the first source code file in our project - in this case main.cpp. Many extra command line options
+are also being used with the g++ compiler; some of which are defaults and some of which can be configured
+via &kdevelop;.
+</para>
+<para>
+Before the next file (kscribble.cpp, line 29) is compiled, the moc (meta object compiler) is first
+invoked on kscribble.h (line 25). This is because KScribble classes use signals/slots, so the
+Q_OBJECT macro must be expanded, and the moc does this for us. The resultant file, kscribble.moc, is
+used by kscribble.cpp via an #include statement inside of the file.
+</para>
+</sect1>
+
+<sect1 id="c3s4">
+<title>The source skeleton</title>
+<para>
+To conceptualize how a KDE application works, we'll first have a very close look at the source
+skeleton already provided by the Application Wizard. As we already saw, we're having a set of source
+and header files that build the initial code for the application and make it ready-to-run. Therefore,
+the easiest way to explain the code is to follow the implementation line by line as it is processed
+during executing the program until it enters the main event loop and is ready to accept user input.
+Then, we'll have a look at the functionality that enables user interaction and how certain things work.
+This is probably the best way to explain the framework and, as it is similar to almost all KDE
+applications, will enable you to read source codes from other projects as well; additionally, you will
+know where to change what part of the code to make your applications behave the way they are designed for.
+</para>
+
+<sect2 id="c3s4s1">
+<title>The main() function</title>
+<para>
+As the application begins its execution with entering the <function>main()</function> function,
+this will be the start for our code examination. The <function>main()</function> function of
+KScribble is implemented in the file main.cpp and can also be found using the Class Browser
+by selecting the "Global Functions" folder.
+<programlisting>
+1 int main(int argc, char **argv)
+2 {
+3 KAboutData about("kscribble", I18N_NOOP("KScribble"), version, description,
+4 KAboutData::License_GPL, "(C) 2002 Your Name", 0, 0, "you@you.com");
+5 about.addAuthor( "Your Name", 0, "you@you.com" );
+6 KCmdLineArgs::init(argc, argv, &amp;about);
+7 KCmdLineArgs::addCmdLineOptions(options);
+8 KApplication app;
+9
+10 // register ourselves as a dcop client
+11 app.dcopClient()->registerAs(app.name(), false);
+12
+13 // see if we are starting with session management
+14 if (app.isRestored())
+15 RESTORE(KScribble)
+16 else
+17 {
+18 // no session.. just start up normally
+19 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+20 if (args->count() == 0)
+21 {
+22 KScribble *widget = new KScribble;
+23 widget->show();
+24 }
+25 else
+26 {
+27 int i = 0;
+28 for (; i &lt; args->count(); i++)
+29 {
+30 KScribble *widget = new KScribble;
+31 widget->show();
+32 widget->load(args->url(i));
+33 }
+34 }
+35 args->clear();
+36 }
+37
+38 return app.exec();
+39 }
+</programlisting>
+</para>
+<para>
+Now, what happens first is the usual creation of a <classname>KApplication</classname> object, but we've
+added some KDE methods that set program and author information for this application.
+</para>
+</sect2>
+<sect2>
+<title>User Application Start</title>
+
+<para>... (not written yet)</para>
+
+</sect2>
+<sect2>
+<title>The Constructor</title>
+<para>
+Let's have a look at the constructor and see how this instance is called
+<programlisting>
+1 KScribble::KScribble()
+2 : KMainWindow( 0, "KScribble" ),
+3 m_view(new KScribbleView(this)),
+4 m_printer(0)
+5 {
+6 // accept dnd
+7 setAcceptDrops(true);
+8
+9 // tell the KMainWindow that this is indeed the main widget
+10 setCentralWidget(m_view);
+11
+12 // then, setup our actions
+13 setupActions();
+14
+15 // and a status bar
+16 statusBar()->show();
+17
+18 // allow the view to change the statusbar and caption
+19 connect(m_view, SIGNAL(signalChangeStatusbar(const QString&amp;)),
+20 this, SLOT(changeStatusbar(const QString&amp;)));
+21 connect(m_view, SIGNAL(signalChangeCaption(const QString&amp;)),
+22 this, SLOT(changeCaption(const QString&amp;)));
+23
+24 }
+</programlisting>
+</para>
+<para>
+Notice that <classname>KScribble</classname> inherits the <classname>KMainWindow</classname> class - a
+commonly used base class for KDE applications. We initialize a class called <classname>KScribbleView</classname>
+as our central widget, create a <classname>KStatusBar</classname> via the <methodname>statusBar()</methodname>
+method (line 16), and connect some signals and slots together.
+</para>
+</sect2>
+</sect1>
+</chapter>
+
+
+<chapter id="chapter4">
+<title>Application View Design</title>
+<sect1 id="c4s1">
+<title>Introduction</title>
+<para>
+When developing an application with a graphical user interface, the main work takes place in
+providing a so-called "view" for the application. A view generally is a widget that displays the data
+of a document and provides methods to manipulate the document contents. This can be done by the user via
+the events he emits by the keyboard or the mouse; more complex operations are often processed by toolbars
+and menubars which interact with the view and the document. The statusbar then provides information about
+the document, view or application status. As an example, we look at how an editor is constructed and where
+we can find which part.
+</para>
+<para>
+An editor generally is supposed to provide an interface to view and/or change the contents of a text
+document for the user. If you start Kate, you see the visual interface as the following:
+<itemizedlist>
+<listitem><para>
+The menubar: providing complex operations as well as opening, saving and closing files and
+exiting the application.
+</para></listitem>
+<listitem><para>
+The toolbar: offers icons which allow quicker access for most needed functions,
+</para></listitem>
+<listitem><para>
+The statusbar: displays the status of the cursor position by the current row and column,
+</para></listitem>
+<listitem><para>
+The view in the center of the window, displaying a document and offering a cursor connected to
+the keyboard and the mouse to operate on the data.
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Now it's easy to understand that a view is the most unique part of the application and the design
+of the view decides about the usability and acceptability of an application. This means that one of
+the first steps in development is to determine the purpose of the application and what kind of view
+design would match best to allow any user to work with the application with a minimum of work
+learning how to handle the user interface.
+</para>
+<para>
+For some purposes like text editing and displaying HTML files, views are provided by the Qt and KDE
+libraries; we will discuss certain aspects of these high-level widgets in the next section.
+But for most applications new widgets have to be designed and implemented. It is that what makes a
+programmer also a designer and where his abilities on creativity are asked. Nevertheless, you should
+watch for intuitivity first. Remember, a lot of users won't accept an application that isn't:
+<itemizedlist>
+<listitem><para>
+graphically nice.
+</para></listitem>
+<listitem><para>
+offering a lot of features
+</para></listitem>
+<listitem><para>
+easy to handle
+</para></listitem>
+<listitem><para>
+fast to learn how to use it
+</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Needless to say that stability is a major design goal. Nobody can prevent bugs, but a minimum can
+be reached at least by clever design goals and wide use of object-oriented design. C++ makes programming
+a joy if you know how to exploit it's capabilities- inheritance, information hiding and reusablitity of
+already existing code.
+</para>
+<para>
+When creating a KDE or Qt project, you always have to have a view that inherits QWidget, either by
+direct inheritance or because the library widget you want to use inherits QWidget. Therefore, the
+Application Wizard already constructed a view that is an instance of a class yourappView, which
+inherits QWidget already.
+</para>
+<para>
+This chapter therefore describes how to use library widgets for creating views of KDE or
+Qt applications that are generated with &kdevelop;, then we look at the libraries and what kind of
+views are already offered.
+</para>
+</sect1>
+<sect1 id="c4s2">
+<title>Using Library Views</title>
+<para>
+When your application design has been set up, you first should look for already existing code that
+will make your life a lot easier. A part of this search is to look for a widget that can be used as
+a view or at least as a part of it; either directly or by inheritance. The KDE and Qt libraries already
+contain a set of widgets that can be used for this purpose. To use them, you have two options:
+<orderedlist>
+<listitem><para>
+Remove the new view class and create an instance of a library widget; then set this as the view,
+</para></listitem>
+<listitem><para>
+Change the inheritance of the provided view class to the class of the library widget to use.
+</para></listitem>
+</orderedlist>
+</para>
+<para>
+In either way, it is important to know that if the application framework is currently not linked
+against the library that contains the widget, the linker will fail. After you decided to use a
+certain widget, look for the library to link to; then open "Project"->"Options" from the &kdevelop;
+menubar. Switch to the "Linker Options" page and look for the checkmarks indicating the libraries
+that are currently used. If the library of your view widget is already checked, you can leave the
+project options untouched and start doing the necessary changes due to your choice. If not, and the
+linker options offer to add the library by a check box, check it and press "OK" to leave the project
+options dialog again. In any other case, add the library in the edit line below with the -l option.
+For libraries that your application has to search for before preparing the Makefiles by the
+configure script on the end-user machine, add the according search macro to the configure.in file
+located at the root directory of your project and add the macro to the edit line. Mind that you have
+to run "Build"->"Autoconf and automake" and "Build"->"Configure" before the Makefiles contain the
+correct expansion for the library macro.
+</para>
+<para>
+Also, if the include files for the library to add are not in the current include path
+(which can be seen by the -I options in the output window on "Make"), you have to add the path to the
+Project Options dialog -"Compiler Options" page with the -I option or the according automake macro at
+the edit line for "Additional Options".
+</para>
+<sect2 id="c4s3s1">
+<title>Qt Views</title>
+<para>
+Looking at the first page of the Qt online documentation, you will find a link to
+"Widget Screenshots" where you can have a look at how the widgets Qt contains look like.
+These are ready to use and can be combined together to form complex widgets to create application
+views or dialogs. In the following, we'll discuss some of these which are very usable for creating
+application views, but keep in mind that the KDE libraries sometimes contain other widgets for the
+same purpose; those will be reviewed in the next section.
+</para>
+<para>
+Here are a set of hints for what purpose you could use which Qt component:
+<orderedlist>
+<listitem><para>
+If your view area isn't big enough to display all your data, the user must be enabled to scroll
+over the document with bars on the left and bottom of the view. For this, Qt provides the class
+<classname>QScrollView</classname>, which offers a scrollable child area. As explained, you could
+inherit your own widget from <classname>QScrollView</classname> or use an instance to manage your
+document's view widget.
+</para></listitem>
+<listitem><para>
+to create a ScrollView yourself, inherit the View widget from <classname>QWidget</classname>
+and add vertical and horizontal <classname>QScrollBars </classname>.
+(This is done by KDE`s KHTMLView widget.)
+</para></listitem>
+<listitem><para>
+For text processing, use <classname>QTextEdit</classname>. This class provides a complete
+text editor widget that is already capable to cut, copy and paste text and is managed by a scrollview.
+</para></listitem>
+<listitem><para>
+Use <classname>QTable</classname> to display data that is arranged in a table.
+As <classname>QTable</classname> is managed by scrollbars as well, it offers a good solution for
+table calculation applications.
+</para></listitem>
+<listitem><para>
+To display two different widgets or two widget instances at the same time, use <classname>QSplitter
+</classname>. This allows to tile views by horizontal or vertical dividers.
+KMail is a good example what this would look like- the main view is separated by a
+splitter vertically, the right window then is divided again horizontally.
+</para></listitem>
+<listitem><para>
+<classname>QListView</classname> displays information in a list and tree.
+This is useful for creating file trees or any other hierarchical information you want to interact with.
+</para></listitem>
+</orderedlist>
+</para>
+<para>
+You see that Qt alone offers a whole set of widgets which are ready to use so you don't have to invent
+new solutions if these match your needs. The sideffect when using standard widgets is that users already
+know how to handle them and only have to concentrate on the displayed data.
+</para>
+</sect2>
+<sect2 id="c4s3s2">
+<title>KDE Views</title>
+<para>
+The KDE libraries were invented to make designing applications for the K Desktop Environment easier
+and capable of more functionality than what Qt alone is offering. The kdeui library offers:
+<orderedlist>
+<listitem><para>
+KListView: a more powerful version of <classname>QListView</classname>
+</para></listitem>
+<listitem><para>
+KIconView: a graphical viewer of icon files
+</para></listitem>
+</orderedlist>
+</para>
+<para>
+The khtml library, on the other hand, offers a complete HTML-interpreting widget that is ready to use.
+It is scrollable already, so you don't even have to take care for that. A possible use could be to
+integrate it as a preview widget for an HTML editor; used by applications such as Konqueror to display HTML files.
+</para>
+</sect2>
+</sect1>
+<sect1 id="c4s4">
+<title>Creating your own Views</title>
+<para>
+Not yet written
+</para>
+</sect1>
+</chapter>
+
+<chapter id="chapter5">
+<title>Configuring Menubars and Toolbars</title>
+<sect1 id="c5s1">
+<title>Introduction</title>
+<para>
+Menubars and toolbars are one of the most important parts of an application to provide methods to
+work with a document structure. As a general rule, you should make all functions available by the menubar.
+Those methods that should not be available at a current stage of the application process should be
+disabled.
+</para>
+<para>
+Further, an application can only contain one menubar, but several toolbars.
+Toolbars on the other hand should contain only the most frequently used commands by pixmap
+icons or provide quick access methods like combos to select values.
+</para>
+</sect1>
+<sect1 id="c5s2">
+<title>How does it work?</title>
+<para>
+Our application inherits the <classname>KMainWindow</classname> class, which automatically handles creating
+a menu bar and tool bars for us. In the <methodname>KScribble::setupActions()</methodname> method there is
+a call to <methodname>KMainWindow::createGUI()</methodname>. This method loads a resource file, in this
+case kscribbleui.rc, to initialize menus at startup. Note that kscribbleui.rc is listed as one of the
+project files in the Automake Manager. Opening that file up reveals this:
+<programlisting>
+1 &lt;!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+2 &lt;kpartgui name="kscribble" version="1">
+3 &lt;MenuBar>
+4 &lt;Menu name="custom">&lt;text>C&amp;ustom&lt;/text>
+5 &lt;Action name="custom_action" />
+6 &lt;/Menu>
+7 &lt;/MenuBar>
+8 &lt;/kpartgui>
+</programlisting>
+</para>
+<para>
+Explanation...
+</para>
+<para>
+Another way to modify the contents of the menu and tool bars is to directly manipulate them through the
+methods provided by their class. For example, the <methodname>menuBar()</methodname> method returns the
+<classname>KMenuBar</classname> widget that the menubar for our program. Looking at the documentation for
+<classname>KMenuBar</classname> and its inheritor class <classname>QMenuBar</classname>, you will find
+a large number of <methodname>insertItem()</methodname> methods which allow you to add items to the
+menu bar.
+</para>
+<para>
+<classname>KMainWindow</classname>'s methods <methodname>statusBar()</methodname> and <methodname>
+toolBar()</methodname> will also provide you with applicable widgets.
+</para>
+</sect1>
+<sect1 id="c5s3">
+<title>Keyboard Accelerator Configuration</title>
+<para>
+A very professional thing you should always add to your application are keyboard accelerators.
+Those are mainly used by experienced users that want to work fast with their applications and
+are willing to learn shortcuts. For this, the KDE libraries provide the class <classname>
+KAction</classname>, which provides the keyboard accelerator keys and access to global configured
+standard keyboard accelerators.
+</para>
+<para>
+By default, frame applications generated by &kdevelop; only use standard keyboard accelerators
+such as F1 for accessing online-help, Ctrl+N for New File etc.
+</para>
+<para>
+If your application contains a lot of accelerators, you should make them configurable
+by an Options-menu; either it could be combined with other application configuration in a QWidget
+or stand alone. The KDE library already provides a <classname>KKeyChooser</classname>
+for use in tab dialogs, whereas <classname>KKeyDialog</classname> provides a ready-to use
+key-configuration dialog.
+</para>
+
+</sect1>
+</chapter>
+
+<!--
+<chapter id="chapter6">
+<title>Other Features</title>
+</chapter>
+
+<chapter id="chapter7">
+<title>Printing Support</title>
+</chapter>
+-->
+<chapter id="chapter8">
+<title>Help Functions</title>
+<sect1 id="c8s1">
+<title>Introduction</title>
+<para>
+A very important part of the development process is to provide help functionality to the user
+wherever possible. Most developers tend to delay this, but you should remember that a normal user
+isn't necessarily a Unix expert. He may come from the the dark side of computer software usage offering
+all sweets that a user may need to work himself into using an application even without ever touching the
+manuals. Therefore, the KDE and Qt library provide all means usually considered making an application
+professional in the eyes of the normal user by help functions that are ready to use.
+Within the application, those are:</para>
+<itemizedlist>
+<listitem><para>Tool-Tips</para></listitem>
+<listitem><para>Statusbar help</para></listitem>
+<listitem><para>What's this...? buttons</para></listitem>
+</itemizedlist>
+<para>
+Additionally, the application should provide means to access a HTML-based online manual directly
+using the standard help key F1. This context based help system is provided automatically through the
+<classname>KMainWindow</classname> class, though as the author you must provide the content.
+</para>
+<para>
+As &kdevelop; also offers all types of help as well as the KDE framework generated by the
+application wizard already contains support for this, this chapter will help you find out where
+and how to add your help functionality. </para>
+<para>
+During the development of your application you should try to be consistent whatever you're doing;
+therefore you should do the necessary steps directly while extending the code. This will prevent you
+from diving into the code again and figuring out what your application does or what you intended by
+certain parts of the code.
+</para>
+</sect1>
+
+<sect1 id="c8s2">
+<title>Tool-Tips</title>
+<para>
+A very easy means of providing help are tool-tips. Those are small help messages popping up while
+the user moves the mouse over a widget that provides a tool-tip and disappears when the mouse moves away.
+The most popular usage of tool-tips is made in toolbars where your tool-tips should be kept as small
+as possible because toolbars can be configured to display their contents in various ways:
+either displaying the button, button with text on the right, button with text below, text only.
+This possibility should be made configurable by the user, but isn't a must-be. The text is shown
+as a tool-tip anyway and a toolbar usually consists of buttons and other widgets like lineedits and
+combo boxes. For a complete reference, see the <classname>KToolBar</classname> class reference located
+in the kdeui library.
+</para>
+<para>
+As an example, we have a look at the "New File" button in a generic application:
+</para>
+<para>
+There, the part i18n("New File") provides a tool-tip message. It is enclosed by the i18n()
+macro provided by kapp.h to translate the tool-tip towards the currently selected language.
+</para>
+<para>
+Tool-tips can also be added to any custom widget by using the <classname>QToolTip</classname>
+provided by Qt. An example of that would be:
+</para>
+</sect1>
+<sect1 id="c8s3">
+<title>Extending the Statusbar</title>
+<para>
+As the applications that inherit <classname>KMainWindow</classname> contain a statusbar as well,
+it also offers a set of statusbar messages already for all menu and toolbar items. A statusbar
+help message is a short message that extends the meaning of a tool-tip or can be seen as a replacement
+for a tool-tip over menubar items and is (as the name suggests) displayed in the statusbar when the user
+enters a menu and highlights the menu entry.
+</para>
+</sect1>
+<sect1 id="c8s4">
+<title>The <guibutton>What's This...?</guibutton> Button</title>
+<para>
+The <guibutton>What's This...?</guibutton> button provides help windows with the intention
+that the user wants to get help about a certain widget within the working view or a toolbar item.
+It is placed in the toolbar and gets activated once the user hits the button. The cursor changes
+to an arrow cursor with a question mark like the button itself looks like. The the user can press on
+a visible widget item and gets a help window. As an exercise, you could try this behavior with the
+<guibutton>What's this...?</guibutton> button within &kdevelop;.
+</para>
+<para>
+To add the What's This...? help to one of your widgets, use the static method
+<methodname>QWhatsThis::add(QWidget *widget, const QString &amp;text)</methodname>
+</para>
+</sect1>
+</chapter>
+
+<chapter id="chapter9">
+<title>Documentation</title>
+<sect1 id="c9s1">
+<title>Introduction</title>
+<para>
+Due to the fact that projects often lack a complete set of user documentation,
+all &kdevelop; projects contain a pre-build handbook that can be easily adapted;
+therefore fulfiling another goal of KDE: providing enough online-help to support users that
+are not familiar with an application. This chapter therefore introduces you on how to extend
+the provided documentation template and what you have to do to make it available to the user.
+</para>
+</sect1>
+<sect1 id="c9s2">
+<title>User Documentation</title>
+<para>
+The documentation for your project lies in projectdir/doc/en, or perhaps another directory if English
+isn't your native language. Therein lies a file, index.docbook, in which the documentation is stored.
+The format for editing this file is explained on
+<ulink url="http://i18n.kde.org/doc/markup/">KDE's documentation website</ulink>.
+</para>
+</sect1>
+<sect1 id="c9s3">
+<title>Programmer Documentation</title>
+<para>
+Another important part of the documentation is including a descriptive help for your class interfaces.
+This will allow you and other programmers to use your classes by reading the HTML class documentation
+that can be created with KDoc. &kdevelop; supports the use of KDoc completely by creating the
+KDE-library documentation, also your application frameworks are already documented. To work yourself
+into the provided code, it would be a good start to read the included documentation online.
+The following describes what to do to get the API documentation, where &kdevelop; helps you add it
+and what kind of special tags KDoc provides.
+</para>
+</sect1>
+</chapter>
+
+<chapter id="chapter10">
+<title>Internationalization</title>
+<sect1 id="c10s1">
+<title>Introdction</title>
+<para>
+i18n is an internationalization system that is used to offer internationalized versions of an
+application or project. The difficulty with writing applications is that they only support the
+language they originally are composed with; visually this can be seen on labels, menu entries and the
+like. The goal of the internationalization is to provide applications and library functions in the
+language of the user; therefore enabling users that are not native speakers the original language to make
+use of the provided functionality and feel more comfortable.
+</para>
+</sect1>
+<!--
+<sect1 id="c10s2">
+<title>How KDE support Internationalization</title>
+<para>
+</para>
+</sect1> -->
+</chapter>
+<!--
+<chapter id="chapter11">
+<title>Finding Errors</title>
+</chapter>
+
+<chapter id="chapter12">
+<title>Licensing</title>
+</chapter>
+
+<chapter id="chapter13">
+<title>References</title>
+</chapter>
+-->
+<chapter id="credits">
+<title>Credits</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<!--CREDITS_FOR_TRANSLATORS-->
+
+</chapter> <!-- credits -->
+
+<appendix id="bibliography">
+<title>Bibliography</title>
+<bibliography>
+
+<biblioentry>
+<title><ulink url="info://make/Top">GNU Make Manual</ulink></title>
+<authorgroup>
+<author><firstname>Richard M.</firstname><surname>Stallman</surname></author>
+<author><firstname>Roland</firstname><surname>McGrath</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://automake/Top">GNU Automake</ulink></title>
+<authorgroup>
+<author><firstname>David</firstname><surname>MacKenzie</surname></author>
+<author><firstname>Tom</firstname><surname>Tromey</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://autoconf/Top">GNU Autoconf</ulink></title>
+<authorgroup>
+<author><firstname>David</firstname><surname>MacKenzie</surname></author>
+<author><firstname>Ben</firstname><surname>Elliston</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://gcc/Top">Using the GNU Compiler Collection</ulink></title>
+<author><firstname>Richard M.</firstname><surname>Stallman</surname></author>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://libtool/Top">GNU Libtool</ulink></title>
+<authorgroup>
+<author><firstname>Gordon</firstname><surname>Matzigkeit</surname></author>
+<author><firstname>Alexandre</firstname><surname>Oliva</surname></author>
+<author><firstname>Thomas</firstname><surname>Tanner</surname></author>
+<author><firstname>Gary V.</firstname><surname>Vaughan</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title>GNU Autoconf, Automake, and Libtool</title>
+<edition>1st edition</edition>
+<pubdate>October 2000</pubdate>
+<authorgroup>
+<author><firstname>Gary V.</firstname><surname>Vaughan</surname></author>
+<author><firstname>Ben</firstname><surname>Elliston</surname></author>
+<author><firstname>Tom</firstname><surname>Tromey</surname></author>
+<author><firstname>Ian Lance</firstname><surname>Taylor</surname></author>
+</authorgroup>
+<publisher><publishername>New Riders Publishing</publishername></publisher>
+<isbn>ISBN 1578701902</isbn>
+</biblioentry>
+
+
+<biblioentry>
+<title>Advanced Programming in the UNIX(R) Environment</title>
+<edition>1st edition</edition>
+<pubdate>June 1992</pubdate>
+<author><firstname>W. Richard</firstname><surname>Stevens</surname></author>
+<publisher><publishername>Addison-Wesley Pub Co</publishername></publisher>
+<isbn>ISBN 0201563177</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Thinking in C++, Volume 1: Introduction to Standard C++</title>
+<edition>2nd Edition</edition>
+<pubdate>April 15, 2000</pubdate>
+<author><firstname>Bruce</firstname><surname>Eckel</surname></author>
+<publisher><publishername>Prentice Hall</publishername></publisher>
+<isbn>ISBN 0139798099</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Open Source Development with CVS</title>
+<edition>2nd Edition</edition>
+<pubdate>October 12, 2001</pubdate>
+<authorgroup>
+<author><firstname>Karl</firstname><surname>Fogel</surname></author>
+<author><firstname>Moshe</firstname><surname>Bar</surname></author>
+</authorgroup>
+<publisher><publishername>The Coriolis Group</publishername></publisher>
+<isbn>ISBN 158880173X</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming PHP</title>
+<edition>1st edition</edition>
+<pubdate>March 2002</pubdate>
+<authorgroup>
+<author><firstname>Rasmus</firstname><surname>Lerdorf</surname></author>
+<author><firstname>Kevin</firstname><surname>Tatroe</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 1565926102</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming Python</title>
+<edition>2nd Edition</edition>
+<pubdate>March 2001</pubdate>
+<author><firstname>Mark</firstname><surname>Lutz</surname></author>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596000855</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Gui Programming With Python : Using the Qt Toolkit</title>
+<edition>Bk&amp;Cd-r edition</edition>
+<pubdate>January 2002</pubdate>
+<author><firstname>Boudewijn</firstname><surname>Rempt</surname></author>
+<publisher><publishername>Opendocs Llc</publishername></publisher>
+<isbn>ISBN 0970033044</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming Perl</title>
+<subtitle>The Camel book</subtitle>
+<edition>3rd Edition</edition>
+<pubdate>July 2000</pubdate>
+<authorgroup>
+<author><firstname>Larry</firstname><surname>Wall</surname></author>
+<author><firstname>Tom</firstname><surname>Christiansen</surname></author>
+<author><firstname>Jon</firstname><surname>Orwant</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596000278</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Learning Perl</title>
+<subtitle>The Lama book</subtitle>
+<edition>3rd Edition</edition>
+<pubdate>July 15, 2001</pubdate>
+<authorgroup>
+<author><firstname>Randal L.</firstname><surname>Schwartz</surname></author>
+<author><firstname>Tom</firstname><surname>Phoenix</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596001320</isbn>
+</biblioentry>
+
+</bibliography>
+
+&underFDL;
+
+
+</appendix>
+
+</book>
diff --git a/doc/kde_app_devel/kscribblefiles.png b/doc/kde_app_devel/kscribblefiles.png
new file mode 100644
index 00000000..1591b3cf
--- /dev/null
+++ b/doc/kde_app_devel/kscribblefiles.png
Binary files differ
diff --git a/doc/kdearch/Makefile.am b/doc/kdearch/Makefile.am
new file mode 100644
index 00000000..171f575c
--- /dev/null
+++ b/doc/kdearch/Makefile.am
@@ -0,0 +1,2 @@
+KDE_LANG = en
+KDE_DOCS = AUTO
diff --git a/doc/kdearch/affine-general.png b/doc/kdearch/affine-general.png
new file mode 100644
index 00000000..8e59d5e5
--- /dev/null
+++ b/doc/kdearch/affine-general.png
Binary files differ
diff --git a/doc/kdearch/affine-rotate.png b/doc/kdearch/affine-rotate.png
new file mode 100644
index 00000000..7192ed9c
--- /dev/null
+++ b/doc/kdearch/affine-rotate.png
Binary files differ
diff --git a/doc/kdearch/affine-scale.png b/doc/kdearch/affine-scale.png
new file mode 100644
index 00000000..0b52fd4c
--- /dev/null
+++ b/doc/kdearch/affine-scale.png
Binary files differ
diff --git a/doc/kdearch/affine-shear.png b/doc/kdearch/affine-shear.png
new file mode 100644
index 00000000..1ed5fbd8
--- /dev/null
+++ b/doc/kdearch/affine-shear.png
Binary files differ
diff --git a/doc/kdearch/affine-translate.png b/doc/kdearch/affine-translate.png
new file mode 100644
index 00000000..87265e30
--- /dev/null
+++ b/doc/kdearch/affine-translate.png
Binary files differ
diff --git a/doc/kdearch/brushstyles.png b/doc/kdearch/brushstyles.png
new file mode 100644
index 00000000..b6df50ca
--- /dev/null
+++ b/doc/kdearch/brushstyles.png
Binary files differ
diff --git a/doc/kdearch/canvas.png b/doc/kdearch/canvas.png
new file mode 100644
index 00000000..dd83dae9
--- /dev/null
+++ b/doc/kdearch/canvas.png
Binary files differ
diff --git a/doc/kdearch/capflat.png b/doc/kdearch/capflat.png
new file mode 100644
index 00000000..5e1c92ce
--- /dev/null
+++ b/doc/kdearch/capflat.png
Binary files differ
diff --git a/doc/kdearch/capround.png b/doc/kdearch/capround.png
new file mode 100644
index 00000000..0e66eaac
--- /dev/null
+++ b/doc/kdearch/capround.png
Binary files differ
diff --git a/doc/kdearch/capsquare.png b/doc/kdearch/capsquare.png
new file mode 100644
index 00000000..35724a72
--- /dev/null
+++ b/doc/kdearch/capsquare.png
Binary files differ
diff --git a/doc/kdearch/index.docbook b/doc/kdearch/index.docbook
new file mode 100644
index 00000000..b1a40091
--- /dev/null
+++ b/doc/kdearch/index.docbook
@@ -0,0 +1,3337 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+ <!ENTITY % addindex "INCLUDE">
+ <!ENTITY % English "INCLUDE" > <!-- change language only here -->
+]>
+
+<book lang="&language;">
+
+<bookinfo>
+<title>KDE Architecture Overview</title>
+
+<date></date>
+<releaseinfo></releaseinfo>
+
+<authorgroup>
+<author>
+<firstname>Bernd</firstname>
+<surname>Gehrmann</surname>
+<affiliation><address><email>bernd@kdevelop.org</email></address></affiliation>
+</author>
+</authorgroup>
+
+<copyright>
+<year>2001</year>
+<year>2002</year>
+<holder>Bernd Gehrmann</holder>
+</copyright>
+
+<legalnotice>&FDLNotice;</legalnotice>
+
+<abstract>
+<para>This documentation gives an overview of the KDE Development Platform</para>
+</abstract>
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>architecture</keyword>
+<keyword>development</keyword>
+<keyword>programming</keyword>
+</keywordset>
+
+</bookinfo>
+
+<chapter id="structure">
+<title>Library structure</title>
+
+<simplesect id="structure-byname">
+<title>Libraries by name</title>
+
+<variablelist>
+
+<varlistentry>
+<term><ulink url="kdeapi:kdecore/index.html">kdecore</ulink></term>
+<listitem><para>
+The kdecore library is the basic application framework for every KDE based
+program. It provides access to the configuration system, command line
+handling, icon loading and manipulation, some special kinds inter-process
+communication, file handling and various other utilities.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><ulink url="kdeapi:kdeui/index.html">kdeui</ulink></term>
+<listitem><para>
+The <literal>kdeui</literal> library provides many widgets and standard
+dialogs which Qt doesn't have or which have more features than their Qt
+counterparts. It also includes several widgets which are subclassed
+from Qt ones and are better integrated with the KDE desktop by
+respecting user preferences.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><ulink url="kdeapi:kio/index.html">kio</ulink></term>
+<listitem><para>
+The <literal>kio</literal> library contains facilities for asynchronous,
+network transparent I/O and access to mimetype handling. It also provides the
+KDE file dialog and its helper classes.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><ulink url="kdeapi:kjs/index.html">kjs</ulink></term>
+<listitem><para>
+The <literal>kjs</literal> library provides an implementation of JavaScript.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><ulink url="kdeapi:khtml/index.html">khtml</ulink></term>
+<listitem><para>
+The <literal>khtml</literal> library contains the KHTML part, a HTML browsing
+widget, DOM API and parser, including interfaces to Java and JavaScript.
+</para></listitem>
+</varlistentry>
+
+</variablelist>
+
+</simplesect>
+
+
+<simplesect id="structure-grouped">
+<title>Grouped classes</title>
+
+<para>
+Core application skeleton - classes needed by almost every application.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara>
+<title><ulink url="kdeapi:kdecore/KApplication">KApplication</ulink></title>
+<para>
+Initializes and controls a KDE application.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara>
+<title><ulink url="kdeapi:kdecore/KUniqueApplication">KUniqueApplication</ulink></title>
+<para>
+Makes sure only one instance of an application can run simultaneously.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KAboutData">KAboutData</ulink></title>
+<para>
+Holds information for the about box.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KCmdLineArgs">KCmdLineArgs</ulink></title>
+<para>
+Command line argument processing.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Configuration settings - access to KDE's hierarchical configuration
+database, global settings and application resources.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KConfig">KConfig</ulink></title>
+<para>
+Provides access to KDE's configuration database.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KSimpleConfig">KSimpleConfig</ulink></title>
+<para>
+Access to simple, non-hierarchical configuration files.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KDesktopFile">KDesktopFile</ulink></title>
+<para>
+Access to <literal>.desktop</literal> files.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KGlobalSettings">KGlobalSettings</ulink></title>
+<para>
+Convenient access to not application-specific settings.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+File and URL handling - decoding of URLs, temporary files etc.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KURL">KURL</ulink></title>
+<para>
+Represents and parses URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KTempFile">KTempFile</ulink></title>
+<para>
+Creates unique files for temporary data.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KSaveFile">KSaveFile</ulink></title>
+<para>
+Allows to save files atomically.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Interprocess communication - DCOP helper classes and subprocess invocation.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KProcess">KProcess</ulink></title>
+<para>
+Invokes and controls child processes.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KShellProcess">KShellProcess</ulink></title>
+<para>
+Invokes child processes via a shell.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdesu/PtyProcess">PtyProcess</ulink></title>
+<para>
+Communication with a child processes through a pseudo terminal.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KIPC">KIPC</ulink></title>
+<para>
+Simple IPC mechanism using X11 ClientMessages.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:dcop/DCOPClient">DCOPClient</ulink></title>
+<para>
+DCOP messaging.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KDCOPPropertyProxy">KDCOPPropertyProxy</ulink></title>
+<para>
+A proxy class publishing Qt properties through DCOP.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KDCOPActionProxy">KDCOPActionProxy</ulink></title>
+<para>
+A proxy class publishing a DCOP interface for actions.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Utility classes - memory management, regular expressions, string manipulation,
+random numbers
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KRegExp">KRegExp</ulink></title>
+<para>
+POSIX regular expression matching.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KStringHandler">KStringHandler</ulink></title>
+<para>
+An extravagant interface for string manipulation.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KZoneAllocator">KZoneAllocator</ulink></title>
+<para>
+Efficient memory allocator for large groups of small objects.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KRandomSequence">KRandomSequence</ulink></title>
+<para>
+Pseudo random number generator.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Keyboard accelerators - classes helping to establish consistent key bindings
+throughout the desktop.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KAccel">KAccel</ulink></title>
+<para>
+Collection of keyboard shortcuts.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KStdAccel">KStdAccel</ulink></title>
+<para>
+Easy access to the common keyboard shortcut keys.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KGlobalAccel"></ulink></title>
+<para>
+Collection of system-wide keyboard shortcuts.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Image processing - icon loading and manipulating.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KIconLoader">KIconLoader</ulink></title>
+<para>
+Loads icons in a theme-conforming way.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KIconTheme">KIconTheme</ulink></title>
+<para>
+Helper classes for KIconLoader.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KPixmap">KPixmap</ulink></title>
+<para>
+A pixmap class with extended dithering capabilities.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KPixmapEffect">KPixmapEffect</ulink></title>
+<para>
+Pixmap effects like gradients and patterns.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KPixmapIO">KPixmapIO</ulink></title>
+<para>
+Fast <classname>QImage</classname> to <classname>QPixmap</classname> conversion.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Drag and Drop - drag objects for colors and URLs.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KURLDrag">KURLDrag</ulink></title>
+<para>
+A drag object for URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KColorDrag">KColorDrag</ulink></title>
+<para>
+A drag object for colors.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KMultipleDrag">KMultipleDrag</ulink></title>
+<para>
+Allows to construct drag objects from several others.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Auto-Completion
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KCompletion">KCompletion</ulink></title>
+<para>
+Generic auto-completion of strings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KURLCompletion">KURLCompletion</ulink></title>
+<para>
+Auto-completion of URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KShellCompletion">KShellCompletion</ulink></title>
+<para>
+Auto-completion of executables.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Widgets - widget classes for list views, rules, color selection etc.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KListView">KListView</ulink></title>
+<para>
+A variant of <classname>QListView</classname> that honors KDE's system-wide settings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KListView">KListBox</ulink></title>
+<para>
+A variant of <classname>QListBox</classname> that honors KDE's system-wide settings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KListView">KIconView</ulink></title>
+<para>
+A variant of <classname>QIconView</classname> that honors KDE's system-wide settings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KListView">KLineEdit</ulink></title>
+<para>
+A variant of <classname>QLineEdit</classname> with completion support.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KComboBox">KComboBox</ulink></title>
+<para>
+A variant of <classname>QComboBox</classname> with completion support.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KFontCombo">KFontCombo</ulink></title>
+<para>
+A combo box for selecting fonts.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KColorCombo">KColorCombo</ulink></title>
+<para>
+A combo box for selecting colors.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KColorButton">KColorButton</ulink></title>
+<para>
+A button for selecting colors.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KURLCombo">KURLCombo</ulink></title>
+<para>
+A combo box for selecting file names and URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kfile/KURLRequester">KURLRequester</ulink></title>
+<para>
+A line edit for selecting file names and URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KRuler">KRuler</ulink></title>
+<para>
+A ruler widget.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink
+url="kdeapi:kdeui/KAnimWidget">KAnimWidget</ulink></title>
+<para>
+animations.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KNumInput">KNumInput</ulink></title>
+<para>
+A widget for inputting numbers.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KPasswordEdit">KPasswordEdit</ulink></title>
+<para>
+A widget for inputting passwords.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Dialogs - full-featured dialogs for file, color and font selection.
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kfile/KFileDialog">KFileDialog</ulink></title>
+<para>
+A file selection dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KColorDialog">KColorDialog</ulink></title>
+<para>
+A color selection dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KFontDialog">KFontDialog</ulink></title>
+<para>
+A font selection dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kfile/KIconDialog">KIconDialog</ulink></title>
+<para>
+An icon selection dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KKeyDialog">KKeyDialog</ulink></title>
+<para>
+A dialog for editing keyboard bindings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KEditToolBar">KEditToolBar</ulink></title>
+<para>
+A dialog for editing toolbars.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KTipDialog">KTipDialog</ulink></title>
+<para>
+A Tip-of-the-day dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KAboutDialog">KAboutDialog</ulink></title>
+<para>
+An about dialog.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KLineEditDlg">KLineEditDlg</ulink></title>
+<para>
+A simple dialog for entering text.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kfile/KURLRequesterDlg">KURLRequesterDlg</ulink></title>
+<para>
+A simple dialog for entering URLs.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KMessageBox">KMessageBox</ulink></title>
+<para>
+A dialog for signaling errors and warnings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KPasswordDialog">KPasswordDialog</ulink></title>
+<para>
+A dialog for inputting passwords.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Actions and XML GUI
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KAction">KAction</ulink></title>
+<para>
+Abstraction for an action that can be plugged into menu bars and tool bars.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KActionCollection">KActionCollection</ulink></title>
+<para>
+A set of actions.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdeui/KXMLGUIClient">KXMLGUIClient</ulink></title>
+<para>
+A GUI fragment consisting of an action collection and a DOM tree representing their location in the GUI.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kparts/KPartManager">KPartManager</ulink></title>
+<para>
+Manages the activation of XMLGUI clients.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+<para>
+Plugins and Components
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KLibrary">KLibrary</ulink></title>
+<para>
+Represents a dynamically loaded library.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KLibrary">KLibLoader</ulink></title>
+<para>
+Shared library loading.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kdecore/KLibFactory">KLibFactory</ulink></title>
+<para>
+Object factory in plugins.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KServiceType">KServiceType</ulink></title>
+<para>
+Represents a service type.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KService">KService</ulink></title>
+<para>
+Represents a service.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KMimeType">KMimeType</ulink></title>
+<para>
+Represents a MIME type.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KServiceTypeProfile">KServiceTypeProfile</ulink></title>
+<para>
+User preferences for MIME type mappings.
+</para>
+</formalpara></listitem>
+
+<listitem><formalpara><title><ulink url="kdeapi:kio/KServiceTypeProfile">KTrader</ulink></title>
+<para>
+Querying for services.
+</para>
+</formalpara></listitem>
+
+</itemizedlist>
+
+</simplesect>
+
+</chapter>
+
+
+
+<chapter id="graphics">
+<title>Graphics</title>
+
+<sect1 id="graphics-qpainter">
+<title>Low-level graphics with QPainter</title>
+
+<simplesect id="qpainter-rendering">
+<title>Rendering with QPainter</title>
+
+<para>
+Qt's low level imaging model is based on the capabilities provided by X11 and
+other windowing systems for which Qt ports exist. But it also extends these by
+implementing additional features such as arbitrary affine transformations for
+text and pixmaps.
+</para>
+
+<para>
+The central graphics class for 2D painting with Qt is
+<ulink url="kdeapi:qt/QPainter">QPainter</ulink>. It can
+draw on a
+<ulink url="kdeapi:qt/QPaintDevice">QPaintDevice</ulink>.
+There are three possible paint devices implemented: One is
+<ulink url="kdeapi:qt/QWidget">QWidget</ulink>
+which represents a widget on the screen. The second is
+<ulink url="kdeapi:qt/QPrinter">QPrinter</ulink> which
+represents a printer and produces Postscript output. The third it
+the class
+<ulink url="kdeapi:qt/QPicture">QPicture</ulink> which
+records paint commands and can save them on disk and play them back
+later. A possible storage format for paint commands is the W3C standard
+SVG.
+</para>
+
+<para>
+So, it is possible to reuse the rendering code you use for displaying a
+widget for printing, with the same features supported. Of course, in
+practice, the code is used in a slightly different context. Drawing
+on a widget is almost exclusively done in the paintEvent() method
+of a widget class.
+</para>
+
+<programlisting>
+void FooWidget::paintEvent()
+{
+ QPainter p(this);
+ // Setup painter
+ // Use painter
+}
+</programlisting>
+
+<para>
+When drawing on a printer, you have to make sure to use QPrinter::newPage()
+to finish with a page and begin a new one - something that naturally is not
+relevant for painting widgets. Also, when printing, you may want to use the
+<ulink url="kdeapi:qt/QPaintDeviceMetrics">device metrics</ulink>
+in order to compute coordinates.
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-transformations">
+<title>Transformations</title>
+
+<para>
+By default, when using QPainter, it draws in the natural coordinate
+system of the device used. This means, if you draw a line along the horizontal
+axis with a length of 10 units, it will be painted as a horizontal line
+on the screen with a length of 10 pixels. However, QPainter can apply arbitrary
+affine transformations before actually rendering shapes and curves. An
+affine transformation maps the x and y coordinates linearly into x' and
+y' according to
+</para>
+
+<mediaobject>
+<imageobject><imagedata fileref="affine-general.png"/></imageobject>
+</mediaobject>
+
+<para>
+The 3x3 matrix in this equation can be set with QPainter::setWorldMatrix() and
+is of type <ulink url="kdeapi:qt/QWMatrix">QWMatrix</ulink>.
+Normally, this is the identity matrix, i.e. m11 and m22 are one, and the
+other parameters are zero. There are basically three different groups of
+transformations:
+</para>
+
+<itemizedlist>
+
+<listitem><formalpara>
+<title>Translations</title>
+<para>
+These move all points of an object by a fixed amount in
+some direction. A translation matrix can be obtained by calling
+method m.translate(dx, dy) for a QWMatrix. This corresponds to the
+matrix
+</para>
+</formalpara>
+
+<mediaobject>
+<imageobject><imagedata fileref="affine-translate.png"/></imageobject>
+</mediaobject>
+
+</listitem>
+
+<listitem><formalpara>
+<title>Scaling</title>
+<para>
+These stretch or shrink the coordinates of an object, making
+it bigger or smaller without distorting it. A scaling transformation
+can be applied to a QWMatrix by calling m.scale(sx, sy). This corresponds
+to the matrix
+</para>
+</formalpara>
+
+<mediaobject>
+<imageobject><imagedata fileref="affine-scale.png"/></imageobject>
+</mediaobject>
+
+<para>
+By setting one of the parameters to a negative value, one can
+achieve a mirroring of the coordinate system.
+</para>
+
+</listitem>
+
+<listitem><formalpara>
+<title>Shearing</title>
+<para>
+A distortion of the coordinate system with two
+parameters. A shearing transformation can be applied by calling
+m.shear(sh, sv), corresponding to the matrix
+</para>
+</formalpara>
+
+<mediaobject>
+ <imageobject><imagedata fileref="affine-shear.png"/></imageobject>
+</mediaobject>
+
+</listitem>
+
+<listitem><formalpara>
+<title>Rotating</title>
+<para>
+This rotates an object. A rotation transformation can be
+applied by calling m.rotate(alpha). Note that the angle has to be given
+in degrees, not as mathematical angle! The corresponding matrix is
+</para>
+</formalpara>
+
+<mediaobject>
+<imageobject><imagedata fileref="affine-rotate.png"/></imageobject>
+</mediaobject>
+
+<para>
+Note that a rotation is equivalent with a combination of
+scaling and shearing.
+</para>
+
+</listitem>
+
+</itemizedlist>
+
+<para>
+Here are some pictures that show the effect of the elementary
+transformation to our masquot:
+</para>
+
+<informaltable frame="none">
+<tgroup cols="3">
+<tbody>
+<row>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="konqi-normal.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="konqi-rotated.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="konqi-sheared.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="konqi-mirrored.png"/></imageobject>
+</mediaobject></entry>
+</row>
+<row>
+<entry>a) Normal</entry>
+<entry>b) Rotated by 30 degrees</entry>
+<entry>c) Sheared by 0.4</entry>
+<entry>d) Mirrored</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+
+<para>
+Transformations can be combined by multiplying elementary matrices. Note that
+matrix operations are not commutative in general, and therefore the combined
+effect of of a concatenation depends on the order in which the matrices are
+multiplied.
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-strokeattributes">
+<title>Setting stroking attributes</title>
+
+<para>
+The rendering of lines, curves and outlines of polygons can be modified by
+setting a special pen with QPainter::setPen(). The argument of this function is a
+<ulink url="kdeapi:qt/QPen">QPen</ulink> object. The properties
+stored in it are a style, a color, a join style and a cap style.
+</para>
+
+<para>
+The pen style is member of the enum
+<ulink url="kdeapi:qt/Qt#PenStyle-enum">Qt::PenStyle</ulink>.
+and can take one of the following values:
+</para>
+
+<mediaobject>
+ <imageobject><imagedata fileref="penstyles.png"/></imageobject>
+</mediaobject>
+
+<para>
+The join style is a member of the enum
+<ulink url="kdeapi:qt/Qt#PenJoinStyle-enum">Qt::PenJoinStyle</ulink>.
+It specifies how the junction between multiple lines which are attached to each
+other is drawn. It takes one of the following values:
+</para>
+
+<informaltable frame="none">
+<tgroup cols="3">
+<tbody>
+<row>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="joinmiter.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="joinbevel.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="joinround.png"/></imageobject>
+</mediaobject></entry>
+</row>
+<row>
+<entry>a) MiterJoin</entry>
+<entry>c) BevelJoin</entry>
+<entry>b) RoundJoin</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+
+<para>
+The cap style is a member of the enum
+<ulink url="kdeapi:qt/Qt#PenCapStyle-enum">Qt::PenCapStyle</ulink>and specifies how the end points of lines are drawn. It takes one of the values
+from the following table:
+</para>
+
+<informaltable frame="none">
+<tgroup cols="3">
+<tbody>
+<row>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="capflat.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="capsquare.png"/></imageobject>
+</mediaobject></entry>
+<entry><mediaobject>
+ <imageobject><imagedata fileref="capround.png"/></imageobject>
+</mediaobject></entry>
+</row>
+<row>
+<entry>a) FlatCap</entry>
+<entry>b) SquareCap</entry>
+<entry>c) RoundCap</entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+
+</simplesect>
+
+
+<simplesect id="qpainter-fillattributes">
+<title>Setting fill attributes</title>
+
+<para>
+The fill style of polygons, circles or rectangles can be modified by setting
+a special brush with QPainter::setBrush(). This function takes a
+<ulink url="kdeapi:qt/QBrush">QBrush</ulink> object as argument.
+Brushes can be constructed in four different ways:
+</para>
+
+<itemizedlist>
+<listitem>
+<para>QBrush::QBrush() - This creates a brush that does not fill shapes.</para>
+</listitem>
+<listitem>
+<para>QBrush::QBrush(BrushStyle) - This creates a black brush with one of the default
+patterns shown below.</para>
+</listitem>
+<listitem>
+<para>QBrush::QBrush(const QColor &amp;, BrushStyle) - This creates a colored brush
+with one of the patterns shown below.</para>
+</listitem>
+<listitem>
+<para>QBrush::QBrush(const QColor &amp;, const QPixmap) - This creates a colored
+brush with the custom pattern you give as second parameter.</para>
+</listitem>
+</itemizedlist>
+
+<para>
+A default brush style is from the enum
+<ulink url="kdeapi:qt/Qt#BrushStyle-enum">Qt::BrushStyle</ulink>.
+Here is a picture of all predefined patterns:
+</para>
+
+<mediaobject>
+ <imageobject><imagedata fileref="brushstyles.png"/></imageobject>
+</mediaobject>
+
+<para>
+A further way to customize the brush behavior is to use the function
+QPainter::setBrushOrigin().
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-color">
+<title>Color</title>
+
+<para>
+Colors play a role both when stroking curves and when filling shapes. In Qt,
+colors are represented by the class
+<ulink url="kdeapi:qt/QColor">QColor</ulink>. Qt does not support
+advanced graphics features like ICC color profiles and color correction. Colors
+are usually constructed by specifying their red, green and blue components, as
+the RGB model is the way pixels are composed of on a monitor.
+</para>
+
+<para>
+It is also possible to use hue, saturation and value. This HSV representation is
+what you use in the Gtk color dialog, e.g. in GIMP. There, the hue corresponds
+to the angle on the color wheel, while the saturation corresponds to the
+distance from the center of the circle. The value can be chosen with a separate
+slider.
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-paintsettings">
+<title>Other settings</title>
+
+<para>
+Normally, when you paint on a paint device, the pixels you draw replace those
+that were there previously. This means, if you paint a certain region with
+a red color and paint the same region with a blue color afterwards, only
+the blue color will be visible. Qt's imaging model does not support
+transparency, i.e. a way to blend the painted foreground with the background.
+However, there is a simple way to combine background and foreground with
+boolean operators. The method QPainter::setRasterOp() sets the used operator,
+which comes from the enum
+<ulink url="kdeapi:qt/Qt#RasterOp-enum">RasterOp</ulink>.
+</para>
+
+<para>
+The default is CopyROP which ignores the background. Another popular choice is
+XorROP. If you paint a black line with this operator on a colored image, then
+the covered area will be inverted. This effect is for example used to create
+the rubberband selections in image manipulation programs known as
+"marching ants".
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-primitives">
+<title>Drawing graphics primitives</title>
+
+<para>
+In the following we list the elementary graphics elements supported by
+QPainter. Most of them exist in several overloaded versions which take a
+different number of arguments. For example, methods that deal with rectangles
+usually either take a
+<ulink url="kdeapi:qt/QRect">QRect</ulink> as argument or a set
+of four integers.
+</para>
+
+<itemizedlist>
+<listitem>
+<para>Drawing a single point - drawPoint().</para>
+</listitem>
+<listitem>
+<para>Drawing lines - drawLine(), drawLineSegments() and drawPolyLine().</para>
+</listitem>
+<listitem>
+<para>Drawing and filling rectangles - drawRect(), drawRoundRect(),
+fillRect() and eraseRect().</para>
+</listitem>
+<listitem>
+<para>Drawing and filling circles, ellipses and parts or them -
+drawEllipse(), drawArc(), drawPie and drawChord().</para>
+</listitem>
+<listitem>
+<para>Drawing and filling general polygons - drawPolygon().</para>
+</listitem>
+<listitem>
+<para>Drawing bezier curves - drawQuadBezier() [drawCubicBezier in Qt 3.0].</para>
+</listitem>
+</itemizedlist>
+
+</simplesect>
+
+
+<simplesect id="qpainter-pixmaps">
+<title>Drawing pixmaps and images</title>
+
+<para>
+Qt provides two very different classes to represent images.
+</para>
+
+<para>
+<ulink url="kdeapi:qt/QPixmap">QPixmap</ulink> directly corresponds
+to the pixmap objects in X11. Pixmaps are server-side objects and may - on a
+modern graphics card - even be stored directly in the card's memory. This makes
+it <emphasis>very</emphasis> efficient to transfer pixmaps to the screen. Pixmaps also act as
+an off-screen equivalent of widgets - the QPixmap class is a subclass of
+QPaintDevice, so you can draw on it with a QPainter. Elementary drawing
+operations are usually accelerated by modern graphics. Therefore, a common usage
+pattern is to use pixmaps for double buffering. This means, instead of painting
+directly on a widget, you paint on a temporary pixmap object and use the
+<ulink url="kdeapi:qt/QPaintDevice#bitBlt-1">bitBlt</ulink>
+function to transfer the pixmap to the widget. For complex repaints, this helps
+to avoid flicker.
+</para>
+
+<para>
+In contrast, <ulink url="kdeapi:qt/QImage">QImage</ulink> objects
+live on the client side. Their emphasis in on providing direct access to the
+pixels of the image. This makes them of use for image manipulation, and things
+like loading and saving to disk (QPixmap's load() method takes QImage as
+intermediate step). On the other hand, painting an image on a widget is a
+relatively expensive operation, as it implies a transfer to the X server,
+which can take some time, especially for large images and for remote servers.
+Depending on the color depth, the conversion from QImage to QPixmap may also
+require dithering.
+</para>
+
+</simplesect>
+
+
+<simplesect id="qpainter-drawingtext">
+<title>Drawing text</title>
+
+<para>
+Text can be drawn with one of the overloaded variants of the method
+QPainter::drawText(). These draw a QString either at a given point or in a given
+rectangle, using the font set by QPainter::setFont(). There is also a parameter
+which takes an ORed combination of some flags from the enums
+<ulink url="kdeapi:qt/Qt#AlignmentFlags-enum">Qt::AlignmentFlags</ulink>
+and
+<ulink url="kdeapi:qt/Qt#TextFlags-enum">Qt::TextFlags</ulink>
+</para>
+
+<para>
+Beginning with version 3.0, Qt takes care of the complete text layout even for
+languages written from right to left.
+</para>
+
+<para>
+A more advanced way to display marked up text is the
+<ulink url="kdeapi:qt/QSimpleRichText">QSimpleRichText</ulink>
+class. Objects of this class can be constructed with a piece of text using
+a subset of the HTML tags, which is quite rich and provides even tables.
+The text style can be customized by using a
+<ulink url="kdeapi/qt/QStyleSheet">QStyleSheet</ulink> (the
+documentation of the tags can also be found here). Once the rich text object has
+been constructed, it can be rendered on a widget or another paint device with
+the QSimpleRichText::draw() method.
+</para>
+
+</simplesect>
+
+</sect1>
+
+
+<sect1 id="graphics-qcanvas">
+<title>Structured graphics with QCanvas</title>
+
+<para>
+QPainter offers a powerful imaging model for painting on widgets and pixmaps.
+However, it can also be cumbersome to use. Each time your widget receives
+a paint event, it has to analyze the QPaintEvent::region() or
+QPaintEvent::rect() which has to be redrawn. Then it has to setup a
+QPainter and paint all objects which overlap with that region. For example,
+image a vector graphics program which allows to drag objects like polygons,
+circles and groups of them around. Each time those objects move a bit, the
+widget's mouse event handler triggers a paint event for the whole area covered
+by the objects in their old position and in their new position. Figuring
+out the necessary redraws and doing them in an efficient way can be difficult,
+and it may also conflict with the object-oriented structure of the program's
+source code.
+</para>
+
+<para>
+As an alternative, Qt contains the class
+<ulink url="kdeapi:qt/QCanvas">QCanvas</ulink> in which
+you put graphical objects like polygons, text, pixmaps. You may also provide
+additional items by subclassing
+<ulink url="kdeapi:qt/QCanvasItem">QCanvasItem</ulink> or
+one of its more specialized subclasses. A canvas can be shown on the screen by
+one or more widgets of the class
+<ulink url="kdeapi:qt/QCanvas">QCanvasView</ulink> which
+you have to subclass in order to handle user interactions. Qt takes care of
+all repaints of objects in the view, whether they are caused by the widget
+being exposed, new objects being created or modified or other things. By using
+double buffering, this can be done in an efficient and flicker-free way.
+</para>
+
+<para>
+Canvas items can overlap each other. In this case, the visible one depends on
+the z order which can be assigned by QCanvasItem::setZ(). Items can also be
+made visible or invisible. You can also provide a background to be drawn
+"behind" all items and a foreground. For associating mouse events with objects,
+in the canvas, there is the method QCanvas::collisions() which returns a list
+of items overlapping with a given point. Here we show a screenshot of a canvas
+view in action:
+</para>
+
+<mediaobject>
+<imageobject><imagedata fileref="canvas.png"/></imageobject>
+</mediaobject>
+
+<para>
+Here, the mesh is drawn in the background. Furthermore, there is a
+QCanvasText item and a violet QCanvasPolygon. The butterfly is a
+QCanvasPixmap. It has transparent areas, so you can see the underlying
+items through it.
+</para>
+
+<para>
+A tutorial on using QCanvas for writing sprite-based games can be
+found <ulink url="http://zez.org/article/articleview/2/1/">here</ulink>.
+</para>
+
+</sect1>
+
+
+<sect1 id="graphics-qglwidget">
+<title>3D graphics with OpenGL</title>
+
+<simplesect id="qglwidget-lowlevel">
+<title>Low-level interface</title>
+
+<para>
+The de facto standard for rendering 3D graphics today is
+<ulink url="http://www.opengl.org">OpenGL</ulink>. Implementations of this
+specification come with Microsoft Windows, Mac OS X and XFree86 and often
+support the hardware acceleration features offered by modern graphics cards.
+OpenGL itself only deals with rendering on a specified area of the framebuffer
+through a <emphasis>GL context</emphasis> and does not have any interactions
+with the toolkit of the environment
+</para>
+
+<para>
+Qt offers the widget <ulink url="kdeapi:qt/QGLWidget">QGLWidget</ulink>
+which encapsulates a window with an associated GL context. Basically, you use it
+by subclassing it and reimplementing some methods.
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+Instead of reimplementing paintEvent() and using QPainter to draw the widget's
+contents, you override paintGL() and use GL commands to render a scene. QLWidget
+will take care of making its GL context the current one before paintGL() is
+called, and it will flush afterwards.
+</para></listitem>
+
+<listitem><para>
+The virtual method initializeGL() is called once before the first time resizeGL()
+or paintGL() are called. This can be used to construct display lists for objects,
+and make any initializations.
+</para></listitem>
+
+<listitem><para>
+Instead of reimplementing resizeEvent(), you override resizeGL(). This can
+be used to set the viewport appropriately.
+</para></listitem>
+
+<listitem><para>
+Instead of calling update() when the state of the scene has changed - for example
+when you animate it with a timer -, you should call updateGL(). This will trigger
+a repaint.
+</para></listitem>
+
+</itemizedlist>
+
+<para>
+In general, QGLWidget behaves just like any other widget, i.e. for example
+you can process mouse events as usual, resize the widget and combine it with
+others in a layout.
+</para>
+
+<mediaobject>
+<imageobject><imagedata fileref="opengl.png"/></imageobject>
+</mediaobject>
+
+<para>
+Qt contains some examples of QGLWidget usage in its <literal>demo</literal>
+example. A collection of tutorials can be found
+<ulink url="http://www.libsdl.org/opengl/intro.html">here</ulink>,
+and more information and a reference of OpenGL is available on the
+<ulink url="http://www.opengl.org">OpenGL homepage</ulink>.
+</para>
+
+</simplesect>
+
+
+<simplesect id="qglwidget-highlevel">
+<title>High-level interfaces</title>
+
+<para>
+OpenGL is a relatively low-level interface for drawing 3D graphics. In the same
+way QCanvas gives the programmer a higher-level interface which details with
+objects and their properties, there are also high-level interfaces for 3D graphics.
+One of the most popular is Open Inventor. Originally a technology developed by SGI,
+there is today also the open source implementation
+<ulink url="http://www.coin3d.org">Coin</ulink>, complemented by a toolkit binding to Qt
+called SoQt.
+</para>
+
+<para>
+The basic concept of Open Inventor is that of a <emphasis>scene</emphasis>.
+A scene can be loaded from disk and saved in a special format closely related
+to <ulink url="http://www.vrml.org">VRML</ulink>. A scene consists of a
+collection of objects called <emphasis>nodes</emphasis>. Inventor already
+provides a rich collection of reusable nodes, such as cubes, cylinders and
+meshes, furthermore light sources, materials, cameras etc. Nodes are
+represented by C++ classes and can be combined and subclassed.
+</para>
+
+<para>
+An introduction to Inventor can be found
+<ulink url="http://www.motifzone.com/tmd/articles/OpenInventor/OpenInventor.html">here</ulink>
+(in general, you can substitute all mentions of SoXt by SoQt in this article).
+</para>
+
+</simplesect>
+
+</sect1>
+
+</chapter>
+
+
+
+<chapter id="userinterface">
+<title>User interface</title>
+
+<sect1 id="userinterface-actionpattern">
+<title>The action pattern</title>
+
+<para></para>
+
+</sect1>
+
+
+<sect1 id="userinterface-xmlgui">
+<title>Defining menus and toolbars in XML</title>
+
+<simplesect id="xmlgui-intro">
+<title>Introduction</title>
+
+<para>
+While the <link linkend="userinterface-actionpattern">action pattern</link>
+allows to encapsulate actions triggered by the user in an object which can be
+"plugged" somewhere in the menu bars or toolbars, it does not by itself solve
+the problem of constructing the menus themselves. In particular, you have to
+build all popup menus in C++ code and explicitly insert the actions in a
+certain order, under consideration of the style guide for standard actions.
+This makes it pretty difficult to allow the user to customize the menus or
+change shortcuts to fit his needs, without changing the source code.
+</para>
+
+<para>
+This problem is solved by a set of classes called <literal>XMLGUI</literal>.
+Basically, this separates actions (coded in C++) from their appearance in menu
+bars and tool bars (coded in XML). Without modifying any source code, menus
+can be simply customized by adjusting an XML file. Furthermore, it helps
+to make sure that standard actions (such as
+<menuchoice><guimenu>File</guimenu><guimenuitem>Open</guimenuitem></menuchoice>
+or <menuchoice><guimenu>Help</guimenu><guimenuitem>About</guimenuitem></menuchoice>)
+appear in the locations suggested by the style guide. XMLGUI is especially
+important for modular programs, where the items appearing in the menu bar may
+come from many different plugins or parts.
+</para>
+
+<para>
+KDE's class for toplevel windows,
+<ulink url="kdeapi:kdeui/KMainWindow.html">KMainWindow</ulink>,
+inherits
+<ulink url="kdeapi:kdeui/KXMLGUIClient.html">KXMLGUIClient</ulink>
+and therefore supports XMLGUI out of the box. All actions created within it must
+have the client's <literal>actionCollection()</literal> as parent. A call to
+<literal>createGUI()</literal> will then build the whole set of menu and tool
+bars defined the applications XML file (conventionally with the suffix
+<literal>ui.rc</literal>).
+</para>
+
+</simplesect>
+
+
+<simplesect id="xmlgui-kviewexample">
+<title>An example: Menu in KView</title>
+
+<para>
+In the following, we take KDE's image view <application>KView</application> as
+example. It has a <literal>ui.rc</literal> file named
+<filename>kviewui.rc</filename> which is installed with the
+<filename>Makefile.am</filename> snippet
+</para>
+
+<programlisting>
+rcdir = $(kde_datadir)/kview
+rc_DATA = kviewui.rc
+</programlisting>
+
+<para>
+Here is an excerpt from the <filename>kviewui.rc</filename> file. For
+simplicity, we show only the definition of the <guimenu>View</guimenu> menu.
+</para>
+
+<programlisting>
+&lt;!DOCTYPE kpartgui&gt;
+&lt;kpartgui name="kview"&gt;
+ &lt;MenuBar&gt;
+ &lt;Menu name="view" &gt;
+ &lt;Action name="zoom50" /&gt;
+ &lt;Action name="zoom100" /&gt;
+ &lt;Action name="zoom200" /&gt;
+ &lt;Action name="zoomMaxpect" /&gt;
+ &lt;Separator/&gt;
+ &lt;Action name="fullscreen" /&gt;
+ &lt;/Menu&gt;
+ &lt;/MenuBar&gt;
+&lt;/kpartgui&gt;
+</programlisting>
+
+<para>
+The corresponding part of the setup in C++ is:
+</para>
+
+<programlisting>
+ KStdAction::zoomIn ( this, SLOT(slotZoomIn()), actionCollection() );
+ KStdAction::zoomOut ( this, SLOT(slotZoomOut()), actionCollection() );
+ KStdAction::zoom ( this, SLOT(slotZoom()), actionCollection() );
+ new KAction ( i18n("&amp;Half size"), ALT+Key_0,
+ this, SLOT(slotHalfSize()),
+ actionCollection(), "zoom50" );
+ new KAction ( i18n("&amp;Normal size"), ALT+Key_1,
+ this, SLOT(slotDoubleSize()),
+ actionCollection(), "zoom100" );
+ new KAction ( i18n("&amp;Double size"), ALT+Key_2,
+ this, SLOT(slotDoubleSize()),
+ actionCollection(), "zoom200" );
+ new KAction ( i18n("&amp;Fill Screen"), ALT+Key_3,
+ this, SLOT(slotFillScreen()),
+ actionCollection(), "zoomMaxpect" );
+ new KAction ( i18n("Fullscreen &amp;Mode"), CTRL+SHIFT+Key_F,
+ this, SLOT(slotFullScreen()),
+ actionCollection(), "fullscreen" );
+</programlisting>
+
+<para>
+The <guimenu>View</guimenu> menu resulting from this GUI definition looks like
+in this screenshot:
+</para>
+
+<mediaobject>
+<imageobject><imagedata fileref="kview-menu.png"/></imageobject>
+</mediaobject>
+
+<para>
+The XML file begins with a document type declaration. The DTD for kpartgui can
+be found in the kdelibs sources in <filename>kdeui/kpartgui.dtd</filename>. The
+outermost element of the file contains the instance name of the application as
+attribute. It can also contain a version number in the form "version=2". This
+is useful when you release new versions of an application with a changed menu
+structure, e.g. with more features. If you bump up the version number of the
+<literal>ui.rc</literal> file, KDE makes sure that any customized version of
+the file is discarded and the new file is used instead.
+</para>
+
+<para>
+The next line, <literal>&lt;MenuBar&gt;</literal>, contains a declaration of a
+menu bar. You can also insert any number of <literal>&lt;ToolBar&gt;</literal>
+declarations in order to create some tool bars. The menu contains a submenu
+with the name "view". This name is already predefined, and thus you see a
+translated version of the word "View" in the screenshot. If you declare your
+own submenus, you have to add the title explicitly. For example,
+<application>KView</application> has a submenu with the title "Image" which is
+declared as follows:
+</para>
+
+<programlisting>
+&lt;Menu name="image" &gt;
+ &lt;text&gt;&amp;amp;Image&lt;/text&gt;
+ ...
+&lt;/Menu&gt;
+</programlisting>
+
+<para>
+In KDE's automake framework, such titles are automatically extracted and put
+into the application's <ulink url="kde-i18n-howto.html"><literal>.po</literal></ulink>
+file , so it is considered by translators. Note that you have to write the
+accelerator marker "&amp;" in the form XML compliant form "&amp;amp;".
+</para>
+
+<para>
+Let us come back to the example. <application>KView</application>'s
+<guimenu>View</guimenu> menu contains a couple of custom actions:
+<literal>zoom50</literal>, <literal>zoom100</literal>,
+<literal>zoom200</literal>, <literal>zoomMaxpect</literal> and
+<literal>fullscreen</literal>, declared with a
+<literal>&lt;Action&gt;</literal> element. The separator in the
+screenshots corresponds to the <literal>&lt;Separator&gt;</literal> element.
+</para>
+
+<para>
+You will note that some menu items do not not have a corresponding element in
+the XML file. These are <emphasis>standard actions</emphasis>. Standard
+actions are created by the class
+<ulink url="kdeapi:kdeui/KStdAction.html">KStdAction</ulink>.
+When you create such actions in your application (such as in the C++ example
+above), they will automatically be inserted in a prescribed position, and
+possibly with an icon and a shortcut key. You can look up these locations in
+the file <filename>kdeui/ui_standards.rc</filename> in the kdelibs sources.
+</para>
+
+</simplesect>
+
+
+<simplesect id="xmlgui-konqexample">
+<title>An example: Toolbars in Konqueror</title>
+
+<para>
+For the discussion of toolbars, we switch to
+<application>Konqueror</application>'s GUI definition. This excerpt defines
+the location bar, which contains the input field for URLs.
+</para>
+
+<programlisting>
+&lt;ToolBar name="locationToolBar" fullWidth="true" newline="true" &gt;
+ &lt;text&gt;Location Toolbar&lt;/text&gt;
+ &lt;Action name="clear_location" /&gt;
+ &lt;Action name="location_label" /&gt;
+ &lt;Action name="toolbar_url_combo" /&gt;
+ &lt;Action name="go_url" /&gt;
+&lt;/ToolBar&gt;
+</programlisting>
+
+<para>
+The first thing we notice is that there are a lot more attributes than for
+menu bars. These include:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+<literal>fullWidth</literal>: Tells XMLGUI that the toolbar has the same width as the
+ toplevel window. Af this is "false", the toolbar only takes as much space as
+ necessary, and further toolbars are put in the same row.
+</para></listitem>
+
+<listitem><para>
+<literal>newline</literal>: This is related to the option above. If newline is "true",
+the toolbar starts a new row. Otherwise it may be put in the row together
+with the previous toolbar.
+</para></listitem>
+
+<listitem><para>
+<literal>noEdit</literal>: Normally toolbars can be customized by the user,
+e.g. in <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure
+Toolbars</guimenuitem></menuchoice> in
+<application>Konqueror</application>. Setting this option to "true" marks this
+toolbar as not editable. This is important for toolbars which are filled with
+items at runtime, e.g. <application>Konqueror</application>'s bookmark toolbar.
+</para></listitem>
+
+<listitem><para>
+<literal>iconText</literal>: Tells XMLGUI to show the text of the action next to the
+icon. Normally, the text is only shown as a tooltip when the mouse cursor
+remains over the icon for a while. Possible values for this attribute are
+"icononly" (shows only the icon), "textonly" (shows only the text),
+"icontextright" (shows the text on the right side of the icon) and
+"icontextbottom" (shows the text beneath the icon).
+</para></listitem>
+
+
+<listitem><para>
+<literal>hidden</literal>: If this is "true", the toolbar is not visible initially
+and must be activated by some menu item.
+</para></listitem>
+
+
+<listitem><para>
+<literal>position</literal>: The default for this attribute is "top", meaning that the
+toolbar is positioned under the menu bar. For programs with many tools,
+such as graphics programs, it may be interesting to replace this with
+"left", "right" or "bottom".
+</para></listitem>
+
+</itemizedlist>
+
+</simplesect>
+
+
+<simplesect id="xmlgui-dynamical">
+<title>Dynamical menus</title>
+
+<para>
+Obviously, an XML can only contain a static description of a user interface.
+Often, there are menus which change at runtime. For example,
+<application>Konqueror</application>'s <guimenu>Location</guimenu> menu
+contains a set of items <guimenuitem>Open with Foo</guimenuitem> with the
+applications able to load a file with a given MIME type. Each time the
+document shown changes, the list of menu items is updated. XMLGUI is prepared
+to handle such cases with the notion of <emphasis>action lists</emphasis>.
+An action list is declared as one item in the XML file, but consists of
+several actions which are plugged into the menu at runtime. The above example
+is implemented with the following declaration in
+<application>Konqueror</application>'s XML file:
+</para>
+
+<programlisting>
+&lt;Menu name="file"&gt;
+ &lt;text&gt;&amp;amp;Location&lt;/text&gt;
+ ...
+ &lt;ActionList name="openwith"&gt;
+ ...
+&lt;/Menu&gt;
+</programlisting>
+
+<para>
+The function <function>KXMLGUIClient::plugActionList()</function> is then used
+to add actions to be displayed, whereas the function
+<function>KXMLGuiClient::unplugActionList()</function> removes all
+plugged actions. The routine responsible for updating looks as follows:
+</para>
+
+<programlisting>
+void MainWindow::updateOpenWithActions()
+{
+ unplugActionList("openwith");
+ openWithActions.clear();
+ for ( /* iterate over the relevant services */ ) {
+ KAction *action = new KAction( ...);
+ openWithActions.append(action);
+ }
+ plugActionList("openwith", openWithActions);
+}
+</programlisting>
+
+<para>
+Note that in contrast to the static actions, the ones created here are
+<emphasis>not</emphasis> constructed with the action collection as parent, and
+you are responsible for deleting them for yourself. The simplest way to achievethis
+is by using <literal>openWithActions.setAutoDelete(true)</literal> in the above
+example.
+</para>
+
+</simplesect>
+
+
+<simplesect id="xmlgui-contextmenus">
+<title>Context menus</title>
+
+<para>
+The examples above only contained cases where a main window's menubar and
+toolbars were created. In the cases, the processes of constructing these
+containers is completely hidden from you behind the
+<function>createGUI()</function> call (except if you have custom containers).
+However, there are cases, where you want to construct other containers and
+populate them with GUI definitions from the XML file. One such example are
+context menus. In order to get a pointer to a context menu, you have to
+ask the client's factory for it:
+</para>
+
+<programlisting>
+void MainWindow::popupRequested()
+{
+ QWidget *w = factory()->container("context_popup", this);
+ QPopupMenu *popup = static_cast&lt;QPopupMenu *&gt;(w);
+ popup->exec(QCursor::pos());
+}
+</programlisting>
+
+<para>
+The method <function>KXMLGUIFactory::container()</function> used above looks
+whether it finds a container in the XML file with the given name. Thus, a
+possible definition could look as follows:
+</para>
+
+<programlisting>
+...
+&lt;Menu name="context_popup"&gt;
+ &lt;Action name="file_add"/&gt;
+ &lt;Action name="file_remove"/&gt;
+&lt;/Menu&gt;
+...
+</programlisting>
+
+</simplesect>
+
+</sect1>
+
+
+<sect1 id="help">
+<title>Providing online help</title>
+
+<para>
+Making a program easy and intuitive to use involves a wide range of
+facilities which are usually called online help. Online help has several,
+partially conflicting goals: on the one, it should give the user answers
+to the question "How can I do a certain task?", on the other hand it
+should help the user exploring the application and finding features he
+doesn't yet know about. It is important to recognize that this can only
+be achieved by offering several levels of help:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+Tooltips are tiny labels that pop up over user interface elements when
+the mouse remains there longer. They are especially important for tool-
+bars, where icons are not always sufficient to explain the purpose of
+a button.
+</para></listitem>
+
+<listitem><para>
+"What's this?" help is usually a longer and richer explanation of a widget
+or a menu item. It is also more clunky to use: In dialogs, it can be invoked
+in two ways: either by pressing
+<keycombo><keycap>Shift</keycap><keycap>F1</keycap></keycombo> or by clicking
+on the question mark in the title bar (where the support of the latter depends
+on the window manager). The mouse pointer then turns into an arrow with a
+question mark, and the help window appears when a user interfact element has
+been clicked. "What's this?" help for menu items is usually activated by a
+button in the toolbar which contains an arrow and a question mark.
+</para></listitem>
+
+<listitem><para>
+The problem with this approach is that the user can't see whether a widget
+provides help or not. When the user activates the question mark button and
+doesn't get any help window when clicking on a user interface element, he
+will get frustrated very quickly.
+</para>
+
+<para>
+The advantage of "What's this?" help windows as provided by Qt and KDE is that
+they can contain <ulink url="kdeapi:qt/QStyleSheet">rich text</ulink>,
+i.e. the may contain different fonts, bold and italic text and even images and tables.
+</para>
+
+<para>
+An example of "What's this?" help:
+</para>
+
+<mediaobject>
+<imageobject><imagedata fileref="whatsthis.png"/></imageobject>
+</mediaobject>
+
+</listitem>
+
+<listitem><para>
+Finally, every program should have a manual. A manual is normally viewed in
+<application>KHelpCenter</application> by activating the
+<guimenu>Help</guimenu> menu. That means, a complete additional application
+pops up and diverts the user from his work. Consequently, consulting the
+manual should only be necessary if other facilities like tooltips and what's
+this help are not sufficient. Of course, a manual has the advantage that it
+does not explain single, isolated aspects of the user interface. Instead, it
+can explain aspects of the application in a greater context. Manuals for KDE
+are written using the <ulink url="http://i18n.kde.org">DocBook</ulink> markup
+language.
+</para></listitem>
+
+</itemizedlist>
+
+<para>
+From the programmer's point of view, Qt provides an easy to use API for online
+help. To assign a tooltip to widget, use the
+<ulink url="kdeapi:qt/QToolTip">QToolTip</ulink> class.
+</para>
+
+<programlisting>
+QToolTip::add(w, i18n("This widget does something."))
+</programlisting>
+
+<para>
+If the menu bars and tool bars are created using the <ulink url="actionpattern.html">
+action pattern</ulink>, the string used as tooltip is derived from the first argument
+of the <ulink url="kdeapi:kdeui/KAction.html">KAction</ulink> constructor:
+</para>
+
+<programlisting>
+action = new KAction(i18n("&amp;Delete"), "editdelete",
+ SHIFT+Key_Delete, actionCollection(), "del")
+</programlisting>
+
+<para>
+Here it is also possible to assign a text which is shown in the status bar when the
+respective menu item is highlighted:
+</para>
+
+<programlisting>
+action->setStatusText(i18n("Deletes the marked file"))
+</programlisting>
+
+<para>
+The API for "What's this?' help is very similar. In dialogs, use the following
+code:
+</para>
+
+<programlisting>
+QWhatsThis::add(w, i18n("&lt;qt&gt;This demonstrates &lt;b&gt;Qt&lt;/b&gt;'s"
+ " rich text engine.&lt;ul&gt;"
+ "&lt;li&gt;Foo&lt;/li&gt;"
+ "&lt;li&gt;Bar&lt;/li&gt;"
+ "&lt;/ul&gt;&lt;/qt&gt;"))
+</programlisting>
+
+<para>
+For menu items, use
+</para>
+
+<programlisting>
+action->setWhatsThis(i18n("Deletes the marked file"))
+</programlisting>
+
+<para>
+The invocation of <application>KHelpCenter</application> is encapsulated in the
+<ulink url="kdeapi:kdecore/KApplication">KApplication</ulink>
+class. In order to show the manual of your application, just use
+</para>
+
+<programlisting>
+kapp->invokeHelp()
+</programlisting>
+
+<para>
+This displays the first page with the table of contents. When you want to
+display only a certain section of the manual, you can give an additional
+argument to <function>invokeHelp()</function> determining the anchor which
+the browser jumps to.
+</para>
+
+</sect1>
+
+</chapter>
+
+
+
+<chapter id="components">
+<title>Components and services</title>
+
+<sect1 id="components-services">
+<title>KDE services</title>
+
+<simplesect id="services-whatarekdeservices">
+<title>What are KDE services?</title>
+
+<para>
+The notion of a <emphasis>service</emphasis> is a central concept in KDE's
+modular architecture. There is no strict technical implementation connected
+with this term - services can be plugins in the form of shared libraries,
+or they can be programs controlled via <ulink url="dcop.html">DCOP</ulink>.
+By claiming to be of a certain <emphasis>service type</emphasis>, a service
+promises to implement certain APIs or features. In C++ terms, one can think
+of a service type as an abstract class, and a service as an implementation
+of that interface.
+</para>
+
+<para>
+The advantage of this separation is clear: An application utilizing a service
+type does not have to know about possible implementations of it. It just uses
+the APIs associated with the service type. In this way, the used service can be
+changed without affecting the application. Also, the user can configure which
+services he prefers for certain features.
+</para>
+
+<para>
+Some examples:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+The HTML rendering engine used in <application>Konqueror</application> is an
+embedable component that implements the service types
+<literal>KParts/ReadOnlyPart</literal> and <literal>Browser/View</literal>.
+</para></listitem>
+<listitem><para>
+In <application>KDevelop</application> HEAD, most functionality is packaged in
+plugins with the service type <literal>KDevelop/Part</literal>. At startup,
+all services with this type are loaded, such that you can extend the IDE in a
+very flexible way.
+</para></listitem>
+<listitem><para>
+In the icon view, <application>Konqueror</application> displays - if enabled -
+thumbnail pictures of images, HTML pages, PDF and text files. This ability can
+be extended. If you want it to display preview pictures of your own data files
+with some MIME type, you can implement a service with service type
+<classname>ThumbCreator</classname>.
+</para></listitem>
+
+</itemizedlist>
+
+<para>
+Obviously, a service is not only characterized by the service types it
+implements, but also by some <emphasis>properties</emphasis>. For example, a
+ThumbCreator does not only claim to implement the C++ class with the type
+<classname>ThumbCreator</classname>, it also has a list of MIME types it is
+responsible for. Similarly, KDevelop parts have the programming language they
+support as a property. When an application requests a service type, it can
+also list constraints on the properties of the service. In the above example,
+when KDevelop loads the plugins for a Java project, it asks only for the
+plugins which have Java as the programming language property. For this
+purpose, KDE contains a full-blown CORBA-like <emphasis>trader</emphasis> with
+a complex query language.
+</para>
+
+</simplesect>
+
+
+<simplesect id="services-definingservicetypes">
+<title>Defining service types</title>
+
+<para>
+New service types are added by installing a description of them into the
+directory <filename>KDEDIR/share/servicetypes</filename>. In an automake
+framework, this can be done with this <filename>Makefile.am</filename>
+snippet:
+</para>
+
+<programlisting>
+kde_servicetypesdir_DATA = kdeveloppart.desktop
+EXTRA_DIST = $(kde_servicetypesdir_DATA)
+</programlisting>
+
+<para>
+The definition <filename>kdeveloppart.desktop</filename> of a
+<application>KDevelop</application> part looks as follows:
+</para>
+
+<programlisting>
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/Part
+Name=KDevelop Part
+
+[PropertyDef::X-KDevelop-Scope]
+Type=QString
+
+[PropertyDef::X-KDevelop-ProgrammingLanguages]
+Type=QStringList
+
+[PropertyDef::X-KDevelop-Args]
+Type=QString
+</programlisting>
+
+<para>
+In addition to the usual entries, this example demonstrates how you declare
+that a service has some properties. Each property definition corresponds
+to a group <literal>[PropertyDef::name]</literal> in the configuration file. In
+this group, the <literal>Type</literal> entry declares the type of the property.
+Possible types are everything that can be stored in a
+<ulink url="kdeapi:qt/QVariant">QVariant</ulink>.
+</para>
+
+</simplesect>
+
+
+<simplesect id="services-defininglibraryservices">
+<title>Defining shared library services</title>
+
+<para>
+Service definitions are stored in the directory
+<filename>KDEDIR/share/services</filename>:
+</para>
+
+<programlisting>
+kde_servicesdir_DATA = kdevdoxygen.desktop
+EXTRA_DIST = $(kde_servicesdir_DATA)
+</programlisting>
+
+<para>
+The content of the following example file
+<filename>kdevdoxygen.desktop</filename> defines the
+<literal>KDevDoxygen</literal> plugin with the service type
+<literal>KDevelop/Part</literal>:
+</para>
+
+<programlisting>
+[Desktop Entry]
+Type=Service
+Comment=Doxygen
+Name=KDevDoxygen
+ServiceTypes=KDevelop/Part
+X-KDE-Library=libkdevdoxygen
+X-KDevelop-ProgrammingLanguages=C,C++,Java
+X-KDevelop-Scope=Project
+</programlisting>
+
+<para>
+In addition to the usual declarations, an important entry is
+<literal>X-KDE-Library</literal>. This contains the name of the libtool
+library (without the <literal>.la</literal> extension). It also fixes
+(with the prefix <literal>init_</literal> prepended) the name of the exported
+symbol in the library which returns an object factory. For the above example,
+the library must contain the following function:
+</para>
+
+<programlisting>
+extern "C" {
+ void *init_libkdevdoxygen()
+ {
+ return new DoxygenFactory;
+ }
+};
+</programlisting>
+
+<para>
+The type of the factory class <classname>DoxygenFactory</classname> depends on
+the specific service type the service implements. In our example of a KDevelop
+plugin, the factory must be a <classname>KDevFactory</classname> (which
+inherits <classname>KLibFactory</classname>). More common examples are
+<ulink url="kdeapi:kparts/KParts::Factory">KParts::Factory</ulink>
+which is supposed to produce
+<ulink url="kdeapi:kparts/KParts::ReadOnlyPart">KParts::ReadOnlyPart</ulink>
+objects or in most cases the generic
+<ulink url="kdeapi:kdecore/KLibFactory">KLibFactory</ulink>.
+</para>
+
+</simplesect>
+
+
+<simplesect id="services-usinglibraryservices">
+<title>Using shared library services</title>
+
+<para>
+In order to use a shared library service in an application, you need to obtain a
+<ulink url="kdeapi:kio/KService.html">KService</ulink> object
+representing it. This is discussed in the
+<ulink url="mime.html">section about MIME types</ulink> (and in a section about the
+trader to be written :-)
+</para>
+
+<para>
+With the <classname>KService</classname> object at hand, you can very simply
+load the library and get a pointer to its factory object:
+</para>
+
+<programlisting>
+KService *service = ...
+QString libName = QFile::encodeName(service->library());
+KLibFactory *factory = KLibLoader::self()->factory(libName);
+if (!factory) {
+ QString name = service->name();
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ KMessageBox::error(0, i18n("There was an error loading service %1.\n"
+ "The diagnostics from libtool is:\n%2")
+ .arg(name).arg(errorMessage);
+}
+</programlisting>
+
+<para>
+From this point, the further proceeding depends again on the service type. For
+generic plugins, you create objects with the method
+<ulink url="kdeapi:kdecore/KLibFactory.html#ref3">KLibFactory::create()</ulink>.
+For KParts, you must cast the factory pointer to the more specific KParts::Factory and use
+its create() method:
+</para>
+
+<programlisting>
+if (factory->inherits("KParts::Factory")) {
+ KParts::Factory *partFactory = static_cast&lt;KParts::Factory*&gt;(factory);
+ QObject *obj = partFactory->createPart(parentWidget, widgetName,
+ parent, name, "KParts::ReadOnlyPart");
+ ...
+} else {
+ cout &lt;&lt; "Service does not implement the right factory" &lt;&lt; endl;
+}
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="services-definingdcopservices">
+<title>Defining DCOP services</title>
+
+<para>
+A DCOP service is usually implemented as a program that is started up when it is
+needed. It then goes into a loop and listens for DCOP connections. The program
+may be an interactive one, but it may also run completely or for a part of its
+lifetime as a daemon in the background without the user noticing it. An example
+for such a daemon is <literal>kio_uiserver</literal>, which implements user interaction
+such as progress dialog for the KIO library. The advantage of such a centralized
+daemon in this context is that e.g. the download progress for several different
+files can be shown in one window, even if those downloads were initiated from
+different applications.
+</para>
+
+<para>
+A DCOP service is defined differently from a shared library service. Of course,
+it doesn't specify a library, but instead an executable. Also, DCOP services
+do not specify a ServiceType line, because usually they are started by their
+name. As additional properties, it contains two lines:
+</para>
+
+<para>
+<literal>X-DCOP-ServiceType</literal> specifies the way the service is
+started. The value <literal>Unique</literal> says that the service must not be
+started more than once. This means, if you try to start this service (e.g. via
+<ulink url="kdeapi:kdecore/KApplication.html#startServiceByName">
+KApplication::startServiceByName()</ulink>, KDE looks whether it is already
+registered with DCOP and uses the running service. If it is not registered yet,
+KDE will start it up and wait until is registered. Thus, you can immediately
+send DCOP calls to the service. In such a case, the service should be implemented
+as a
+<ulink url="kdeapi:kdecore/KUniqueApplication.html">KUniqueApplication</ulink>.
+</para>
+
+<para>
+The value <literal>Multi</literal> for <literal>X-DCOP-ServiceType</literal> says that multiple
+instances of the service can coexist, so every attempt to start the service
+will create another process. As a last possibility the value <literal>None</literal>
+can be used. In this case, a start of the service will not wait until it
+is registered with DCOP.
+</para>
+
+<para>
+<literal>X-KDE-StartupNotify</literal> should normally be set to false. Otherwise, when
+the program is started, the task bar will show a startup notification, or, depending
+on the user's settings, the cursor will be changed.
+</para>
+
+<para>
+Here is the definition of <literal>kio_uiserver</literal>:
+</para>
+
+<programlisting>
+[Desktop Entry]
+Type=Service
+Name=kio_uiserver
+Exec=kio_uiserver
+X-DCOP-ServiceType=Unique
+X-KDE-StartupNotify=false
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="services-usingdcopservices">
+<title>Using DCOP services</title>
+
+<para>
+A DCOP service is started with one of several methods in the KApplication
+class:
+</para>
+
+<programlisting>
+DCOPClient *client = kapp->dcopClient();
+client->attach();
+if (!client->isApplicationRegistered("kio_uiserver")) {
+ QString error;
+ if (KApplication::startServiceByName("kio_uiserver", QStringList(), &amp;error))
+ cout &lt;&lt; "Starting kioserver failed with message " &lt;&lt; error &lt;&lt; endl;
+}
+...
+QByteArray data, replyData;
+QCString replyType;
+QDataStream arg(data, IO_WriteOnly);
+arg &lt;&lt; true;
+if (!client->call("kio_uiserver", "UIServer", "setListMode(bool)",
+ data, replyType, replyData))
+ cout &lt;&lt; "Call to kio_uiserver failed" &lt;&lt; endl;
+...
+</programlisting>
+
+<para>
+Note that the example of a DCOP call given here uses explicit marshalling
+of arguments. Often you will want to use a stub generated by dcopidl2cpp
+instead, because it is much simpler and less error prone.
+</para>
+
+<para>
+In the example given here, the service was started "by name", i.e. the
+first argument to <function>KApplication::startServiceByName()</function> is
+the name is appearing in the <literal>Name</literal> line of the desktop
+file. An alternative is to use
+<function>KApplication::startServiceByDesktopName()</function>, which takes
+the file name of its desktop file as argument, i.e. in this case
+<literal>"kio_uiserver.desktop"</literal>.
+</para>
+
+<para>
+All these calls take a list of URLs as a second argument, which is given
+to the service on the command line. The third argument is a pointer to a
+<classname>QString</classname>. If starting the service fails, this argument
+is set to a translated error message.
+</para>
+
+</simplesect>
+
+</sect1>
+
+
+<sect1 id="components-mime">
+<title>MIME types</title>
+
+<simplesect id="mime-whataremimetypes">
+<title>What are MIME types?</title>
+
+<para>
+MIME types are used to describe the content type of files or data
+chunks. Originally they were introduced in order to allow sending around image
+or sound files etc. by e-mail (MIME stands for "Multipurpose Internet Mail
+Extensions"). Later this system was also used by web browsers to determine how
+to present data sent by a web server to the user. For example, an HTML page
+has a MIME type "text/html", a postscript file "application/postscript". In
+KDE, this concept is used at a variety of places:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+In <application>Konqueror</application>'s icon view, files are represented by
+icons. Each MIME type has a certain associated icon shown here.
+</para></listitem>
+
+<listitem><para>
+When you click onto a file icon or a file name in
+<application>Konqueror</application>, either the file is shown in an embedded
+view, or an application associated with the file type is opened.
+</para></listitem>
+
+<listitem><para>
+When you drag and drop some data from one application to another (or
+within the same application), the drop target may choose to accept only
+certain data types. Furthermore, it will handle image data different
+from textual data.
+</para></listitem>
+
+<listitem><para>
+Clipboard data has a MIME type. Traditionally, X programs only handle
+pixmaps or texts, but with Qt, there are no restrictions on the data type.
+</para></listitem>
+
+</itemizedlist>
+
+<para>
+From the above examples, it is clear that MIME handling is a complex issue.
+First, it is necessary to establish a mapping from file names to MIME types.
+KDE goes one step further in allowing even file contents to be mapped to
+MIME types, for cases in which the file name is not available. Second, it
+is necessary to map MIME types to applications or libraries which can view
+or edit a file with a certain type, or create a thumbnail picture for it.
+</para>
+
+<para>
+There is a variety of APIs to figure out the MIME type of data or files. In
+general, there is a certain speed/reliability trade-off you have to make. You
+can find out the type of a file by examining only its file name (i.e. in most
+cases the file name extension). For example, a file
+<filename>foo.jpg</filename> is normally "image/jpeg". In cases where the
+extension is stripped off this is not safe, and you actually have to look at
+the contents of the file. This is of course slower, in particular for files
+that have to be downloaded via HTTP first. The content-based method is based
+on the file <filename>KDEDIR/share/mimelnk/magic</filename> and therefore
+difficult to extend. But in general, MIME type information can easily be made
+available to the system by installing a <literal>.desktop</literal> file, and
+it is efficiently and conveniently available through the KDE libraries.
+</para>
+
+</simplesect>
+
+
+<simplesect id="mime-definingmimetypes">
+<title>Defining MIME types</title>
+
+<para>
+Let us define a type <literal>"application/x-foo"</literal> for our new
+<application>foobar</application> program. To this end, you have to write a
+file <filename>foo.desktop</filename> and install it into
+<filename>KDEDIR/share/mimelnk/application</filename>. (This is the usual
+location, which may differ between distributions). This can be done by adding
+this to the <filename>Makefile.am</filename>:
+</para>
+
+<programlisting>
+mimedir = $(kde_mimedir)/application
+mime_DATA = foo.desktop
+EXTRA_DIST = $(mime_DATA)
+</programlisting>
+
+<para>
+The file <filename>foo.desktop</filename> should look as follows:
+</para>
+
+<programlisting>
+[Desktop Entry]
+Type=MimeType
+MimeType=application/x-foo
+Icon=fooicon
+Patterns=*.foo;
+DefaultApp=foobar
+Comment=Foo Data File
+Comment[de]=Foo Datei
+</programlisting>
+
+<para>
+The <literal>"Comment"</literal> entry is supposed to be translated. Since the
+<filename>.desktop</filename> file specifies an icon, you should also install
+an icon <filename>fooicon.png</filename>, which represents the file e.g. in
+<application>Konqueror</application>.
+</para>
+
+<para>
+In the KDE libraries, such a type definition is mapped to an instance of the
+class <ulink url="kdeapi:kio/KMimeType.html">KMimeType</ulink>.
+Use this like in the following example:
+</para>
+
+<programlisting>
+KMimeType::Ptr type = KMimeType::mimeType("application/x-foo");
+cout &lt;&lt; "Type: " &lt;&lt; type->name() &lt; endl;
+cout &lt;&lt; "Icon: " &lt;&lt; type->icon() &lt; endl;
+cout &lt;&lt; "Comment: " &lt;&lt; type->icon() &lt; endl;
+QStringList patterns = type->patterns();
+QStringList::ConstIterator it;
+for (it = patterns.begin(); it != patterns.end(); ++it)
+ cout &lt;&lt; "Pattern: " &lt;&lt; (*it) &lt;&lt; endl;
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="mime-determiningmimetypes">
+<title>Determining the MIME type of data</title>
+
+<para>
+The fast method for determining the type of a file is
+<function>KMimeType::findByURL()</function>. This looks for the URL string and
+in most cases determines the type from the extension. For certain protocols
+(e.g. http, man, info), this mechanism is not used. For example, CGI scripts
+on web servers written in Perl often have the extension
+<literal>.pl</literal>, which would indicate a
+<literal>"text/x-perl"</literal> type. However, we file delivered by the
+server is the output of this script, which is normally HTML. For such a case,
+<function>KMimeType::findByURL()</function> returns the MIME type
+<literal>"application/octet-stream"</literal> (available through
+<function>KMimeType::defaultMimeType()</function>), which indicates a failure
+to find out the type.
+</para>
+
+<programlisting>
+KMimeType::Ptr type = KMimeType::findByURL("/home/bernd/foobar.jpg");
+if (type->name() == KMimeType::defaultMimeType())
+ cout &lt;&lt; "Could not find out type" &lt;&lt; endl;
+else
+ cout &lt;&lt; "Type: " &lt;&lt; type->name() &lt;&lt; endl;
+</programlisting>
+
+<para>
+(this method has some more arguments, but these are undocumented, so simply
+forget about them.)
+</para>
+
+<para>
+You may want to find out a MIME from the contents of file instead of
+the file name. This is more reliable, but also slower, as it requires
+reading a part of the file. This is done with the
+<ulink url="kdeapi:kio/KMimeMagic.html">KMimeMagic</ulink>
+class, which has different error handling:
+</para>
+
+<programlisting>
+KMimeMagicResult *result = KMimeMagic::self()->findFileType("/home/bernd/foobar.jpg");
+if (!result || !result->isValid())
+ cout &lt;&lt; "Could not find out type" &lt;&lt; endl;
+else
+ cout &lt;&lt; "Type: " &lt;&lt; result->mimeType() &lt;&lt; endl;
+</programlisting>
+
+<para>
+As a variant of this function, you can also determine the type of a memory
+chunk. This is e.g. used in <application>Kate</application> in order to find
+out the highlighting mode:
+</para>
+
+<programlisting>
+QByteArray array;
+...
+KMimeMagicResult *result = KMimeMagic::self()->findBufferType(array);
+if (!result || !result->isValid())
+ cout &lt;&lt; "Could not find out type" &lt;&lt; endl;
+else
+ cout &lt;&lt; "Type: " &lt;&lt; result->mimeType() &lt;&lt; endl;
+</programlisting>
+
+<para>
+Of course, even KMimeMagic is only able to determine a file type from the
+contents of a local file. For remote files, there is a further possibility:
+</para>
+
+<programlisting>
+KURL url("http://developer.kde.org/favicon.ico");
+QString type = KIO::NetAccess::mimetype(url);
+if (type == KMimeType::defaultMimeType())
+ cout &lt;&lt; "Could not find out type" &lt;&lt; endl;
+else
+ cout &lt;&lt; "Type: " &lt;&lt; type &lt;&lt; endl;
+</programlisting>
+
+<para>
+This starts a KIO job to download a part of the file and check this.
+Note that this function is perhaps quite slow and blocks the program. Normally
+you will only want to use this if <function>KMimeType::findByURL()</function>
+has returned <literal>"application/octet-stream"</literal>.
+</para>
+
+<para>
+On the other hand, if you do not want to block your application, you can also
+explicitly start the KIO job and connect to some of its signals:
+</para>
+
+<programlisting>
+void FooClass::findType()
+{
+ KURL url("http://developer.kde.org/favicon.ico");
+ KIO::MimetypeJob *job = KIO::mimetype(url);
+ connect( job, SIGNAL(result(KIO::Job*)),
+ this, SLOT(mimeResult(KIO::Job*)) );
+}
+
+void FooClass::mimeResult(KIO::Job *job)
+{
+ if (job->error())
+ job->showErrorDialog();
+ else
+ cout &lt;&lt; "MIME type: " &lt;&lt; ((KIO::MimetypeJob *)job)->mimetype() &lt;&lt; endl;
+}
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="mime-mappingmimetypes">
+<title>Mapping a MIME type to an application or service</title>
+
+<para>
+When an application is installed, it installs a <literal>.desktop</literal>
+file which contains a list of MIME types this application can load. Similarly,
+components like KParts make this information available by their service
+<literal>.desktop</literal> files. So in general, there are several programs
+and components which can process a given MIME type. You can obtain such a list
+from the class <classname>KServiceTypeProfile</classname>:
+</para>
+
+<programlisting>
+KService::OfferList offers = KServiceTypeProfile::offers("text/html", "Application");
+KService::OfferList::ConstIterator it;
+for (it = offers.begin(); it != offers.end(); ++it) {
+ KService::Ptr service = (*it);
+ cout &lt;&lt; "Name: " &lt;&lt; service->name() &lt;&lt; endl;
+}
+</programlisting>
+
+<para>
+The return value of this function is a list of service offers. A
+<classname>KServiceOffer</classname> object packages a KService::Ptr together
+with a preference number. The list returned by
+<function>KServiceTypeProfile::offers()</function> is ordered by the user's
+preference. The user can change this by calling <command>"keditfiletype
+text/html"</command> or choosing <guimenuitem>Edit File Type</guimenuitem> on
+<application>Konqueror</application>'s context menu on a HTML file.
+</para>
+
+<para>
+In the above example, an offer list of the applications supporting
+<literal>text/html</literal> was requested. This will - among others - contain
+HTML editors like <application>Quanta Plus</application>. You can also replace
+the second argument <literal>"Application"</literal> by
+<literal>"KParts::ReadOnlyPart"</literal>. In that case, you get a list of
+embedable components for presenting HTML content, for example KHTML.
+</para>
+
+<para>
+In most cases, you are not interested in the list of all service offers
+for a combination of MIME type and service type. There is a convenience
+function which gives you only the service offer with the highest preference:
+</para>
+
+<programlisting>
+KService::Ptr offer = KServiceTypeProfile::preferredService("text/html", "Application");
+if (offer)
+ cout &lt;&lt; "Name: " &lt;&lt; service->name() &lt;&lt; endl;
+else
+ cout &lt;&lt; "No appropriate service found" &lt;&lt; endl;
+</programlisting>
+
+<para>
+For even more complex queries, there is a full-blown CORBA-like
+<ulink url="kdeapi:kio/KTrader.html">trader</ulink>.
+</para>
+
+<para>
+In order to run an application service with some URLs, use
+<ulink url="kdeapi:kio/KRun.html">KRun</ulink>:
+</para>
+
+<programlisting>
+KURL::List urlList;
+urlList &lt;&lt; "http://www.ietf.org/rfc/rfc1341.txt?number=1341";
+urlList &lt;&lt; "http://www.ietf.org/rfc/rfc2046.txt?number=2046";
+KRun::run(offer.service(), urlList);
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="mime-misc">
+<title>Miscellaneous</title>
+
+<para>
+In this section, we want to list some APIs which are loosely related
+to the previous discussion.
+</para>
+
+<para>
+Getting an icon for a URL. This looks for the type of the URL
+and returns the associated icon.
+</para>
+
+<programlisting>
+KURL url("ftp://ftp.kde.org/pub/incoming/wibble.c");
+QString icon = KMimeType::iconForURL(url);
+</programlisting>
+
+<para>
+Running a URL. This looks for the type of the URL and starts the
+user's preferred program associated with this type.
+</para>
+
+<programlisting>
+KURL url("http://dot.kde.org");
+new KRun(url);
+</programlisting>
+
+</simplesect>
+
+</sect1>
+
+
+<sect1 id="nettransparency">
+<title>Network transparency</title>
+
+<simplesect id="nettransparency-intro">
+<title>Introduction</title>
+
+<para>
+In the age of the world wide web, it is of essential importance that desktop
+applications can access resources over the internet: they should be able to
+download files from a web server, write files to an ftp server or read mails
+from a web server. Often, the ability to access files regardless of their
+location is called <emphasis>network transparency</emphasis>.
+</para>
+
+<para>
+In the past, different approaches to this goals were implemented. The old NFS
+file system is an attempt to implement network transparency on the level of
+the POSIX API. While this approach works quite well in local, closely coupled
+networks, it does not scale for resources to which access is unreliable and
+possibly slow. Here, <emphasis>asynchronicity</emphasis> is important. While
+you are waiting for your web browser to download a page, the user interface
+should not block. Also, the page rendering should not begin when the page is
+completely available, but should updated regularly as data comes in.
+</para>
+
+<para>
+In the KDE libraries, network transparency is implemented in the KIO API. The
+central concept of this architecture is an IO <emphasis>job</emphasis>. A job
+may copy, or delete files or similar things. Once a job is started, it works
+in the background and does not block the application. Any communication from
+the job back to the application - like delivering data or progress information
+- is done integrated with the Qt event loop.
+</para>
+
+<para>
+Background operation is achieved by starting <emphasis>ioslaves</emphasis> to
+perform certain tasks. ioslaves are started as separate processes and are
+communicated with through UNIX domain sockets. In this way, no multi-threading
+is necessary and unstable slaves can not crash the application that uses them.
+</para>
+
+<para>
+File locations are expressed by the widely used URLs. But in KDE, URLs do not
+only expand the range of addressable files beyond the local file system. It
+also goes in the opposite direction - e.g. you can browse into tar archives.
+This is achieved by nesting URLs. For example, a file in a tar archive on
+a http server could have the URL
+</para>
+
+<programlisting>
+http://www-com.physik.hu-berlin.de/~bernd/article.tgz#tar:/paper.tex
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-usingkio">
+<title>Using KIO</title>
+
+<para>
+In most cases, jobs are created by calling functions in the KIO namespace.
+These functions take one or two URLs as arguments, and possible other
+necessary parameters. When the job is finished, it emits the signal
+<literal>result(KIO::Job*)</literal>. After this signal has been emitted, the job
+deletes itself. Thus, a typical use case will look like this:
+</para>
+
+<programlisting>
+void FooClass::makeDirectory()
+{
+ SimpleJob *job = KIO::mkdir(KURL("file:/home/bernd/kiodir"));
+ connect( job, SIGNAL(result(KIO::Job*)),
+ this, SLOT(mkdirResult(KIO::Job*)) );
+}
+
+void FooClass::mkdirResult(KIO::Job *job)
+{
+ if (job->error())
+ job->showErrorDialog();
+ else
+ cout &lt;&lt; "mkdir went fine" &lt;&lt; endl;
+}
+</programlisting>
+
+<para>
+Depending on the type of the job, you may connect also to other
+signals.
+</para>
+
+<para>
+Here is an overview over the possible functions:
+</para>
+
+<variablelist>
+
+<varlistentry><term>KIO::mkdir(const KURL &amp;url, int permission)</term>
+<listitem><para>
+Creates a directory, optionally with certain permissions.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::rmdir(const KURL &amp;url)</term>
+<listitem><para>
+Removes a directory.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::chmod(const KURL &amp;url, int permissions)</term>
+<listitem><para>
+Changes the permissions of a file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::rename(const KURL &amp;src, const KURL &amp;dest,
+ bool overwrite)</term>
+<listitem><para>
+Renames a file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::symlink(const QString &amp;target, const KURL &amp;dest,
+ bool overwrite, bool showProgressInfo)</term>
+<listitem><para>
+Creates a symbolic link.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::stat(const KURL &amp;url, bool showProgressInfo)</term>
+<listitem><para>
+Finds out certain information about the file, such as size, modification
+time and permissions. The information can be obtained from
+KIO::StatJob::statResult() after the job has finished.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::get(const KURL &amp;url, bool reload, bool showProgressInfo)</term>
+<listitem><para>
+Transfers data from a URL.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::put(const KURL &amp;url, int permissions, bool overwrite,
+ bool resume, bool showProgressInfo)</term>
+<listitem><para>
+Transfers data to a URL.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::http_post(const KURL &amp;url, const QByteArray &amp;data,
+ bool showProgressInfo)</term>
+<listitem><para>Posts data. Special for HTTP.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::mimetype(const KURL &amp;url, bool showProgressInfo)</term>
+<listitem><para>
+Tries to find the MIME type of the URL. The type can be obtained from
+KIO::MimetypeJob::mimetype() after the job has finished.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::file_copy(const KURL &amp;src, const KURL &amp;dest, int permissions,
+ bool overwrite, bool resume, bool showProgressInfo)</term>
+<listitem><para>
+Copies a single file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::file_move(const KURL &amp;src, const KURL &amp;dest, int permissions,
+ bool overwrite, bool resume, bool showProgressInfo)</term>
+<listitem><para>
+Renames or moves a single file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::file_delete(const KURL &amp;url, bool showProgressInfo)</term>
+<listitem><para>
+Deletes a single file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::listDir(const KURL &amp;url, bool showProgressInfo)</term>
+<listitem><para>
+Lists the contents of a directory. Each time some new entries are known, the
+signal KIO::ListJob::entries() is emitted.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::listRecursive(const KURL &amp;url, bool showProgressInfo)</term>
+<listitem><para>
+Similar to the listDir() function, but this one is recursive.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::copy(const KURL &amp;src, const KURL &amp;dest, bool showProgressInfo)</term>
+<listitem><para>
+Copies a file or directory. Directories are copied recursively.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::move(const KURL &amp;src, const KURL &amp;dest, bool showProgressInfo)</term>
+<listitem><para>
+Moves or renames a file or directory.
+</para></listitem>
+</varlistentry>
+
+<varlistentry><term>KIO::del(const KURL &amp;src, bool shred, bool showProgressInfo)</term>
+<listitem><para>
+Deletes a file or directory.
+</para></listitem>
+</varlistentry>
+
+</variablelist>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-direntries">
+<title>Directory entries</title>
+
+<para>
+Both the KIO::stat() and KIO::listDir() jobs return their results as a type
+UDSEntry, UDSEntryList resp. The latter is defined as QValueList&lt;UDSEntry&gt;.
+The acronym UDS stands for "Universal directory service". The principle behind
+it is that the a directory entry only carries the information which an ioslave
+can provide, not more. For example, the http slave does not provide any
+information about access permissions or file owners.
+Instead, a UDSEntry is a list of UDSAtoms. Each atom provides a specific piece
+of information. It consists of a type stored in m_uds and either an integer
+value in m_long or a string value in m_str, depending on the type.
+</para>
+
+<para>
+The following types are currently defined:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+UDS_SIZE (integer) - Size of the file.
+</para></listitem>
+
+<listitem><para>
+UDS_USER (string) - User owning the file.
+</para></listitem>
+
+<listitem><para>
+UDS_GROUP (string) - Group owning the file.
+</para></listitem>
+
+<listitem><para>
+UDS_NAME (string) - File name.
+</para></listitem>
+
+<listitem><para>
+UDS_ACCESS (integer) - Permission rights of the file, as e.g. stored
+by the libc function stat() in the st_mode field.
+</para></listitem>
+
+<listitem><para>
+UDS_FILE_TYPE (integer) - The file type, as e.g. stored by stat() in the
+st_mode field. Therefore you can use the usual libc macros like S_ISDIR to
+test this value. Note that the data provided by ioslaves corresponds to
+stat(), not lstat(), i.e. in case of symbolic links, the file type here is
+the type of the file pointed to by the link, not the link itself.
+</para></listitem>
+
+<listitem><para>
+UDS_LINK_DEST (string) - In case of a symbolic link, the name of the file
+pointed to.
+</para></listitem>
+
+<listitem><para>
+UDS_MODIFICATION_TIME (integer) - The time (as in the type time_t) when the
+file was last modified, as e.g. stored by stat() in the st_mtime field.
+</para></listitem>
+
+<listitem><para>
+UDS_ACCESS_TIME (integer) - The time when the file was last accessed, as
+e.g. stored by stat() in the st_atime field.
+</para></listitem>
+
+<listitem><para>
+UDS_CREATION_TIME (integer) - The time when the file was created, as e.g.
+stored by stat() in the st_ctime field.
+</para></listitem>
+
+<listitem><para>
+UDS_URL (string) - Provides a URL of a file, if it is not simply the
+the concatenation of directory URL and file name.
+</para></listitem>
+
+<listitem><para>
+UDS_MIME_TYPE (string) - MIME type of the file
+</para></listitem>
+
+<listitem><para>
+UDS_GUESSED_MIME_TYPE (string) - MIME type of the file as guessed by the
+slave. The difference to the previous type is that the one provided here
+should not be taken as reliable (because determining it in a reliable way
+would be too expensive). For example, the KRun class explicitly checks the
+MIME type if it does not have reliable information.
+</para></listitem>
+
+</itemizedlist>
+
+<para>
+Although the way of storing information about files in a
+<classname>UDSEntry</classname> is flexible and practical from the ioslave
+point of view, it is a mess to use for the application programmer. For
+example, in order to find out the MIME type of the file, you have to iterate
+over all atoms and test whether <literal>m_uds</literal> is
+<literal>UDS_MIME_TYPE</literal>. Fortunately, there is an API which is a lot
+easier to use: the class <classname>KFileItem</classname>.
+</para>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-syncuse">
+<title>Synchronous usage</title>
+
+<para>
+Often, the asynchronous API of KIO is too complex to use and therefore
+implementing full asynchronicity is not a priority. For example, in a program
+that can only handle one document file at a time, there is little that can be
+done while the program is downloading a file anyway. For these simple cases,
+there is a mucher simpler API in the form of a set of static functions in
+KIO::NetAccess. For example, in order to copy a file, use
+</para>
+
+<programlisting>
+KURL source, target;
+source = ...;
+target = ...
+KIO::NetAccess::copy(source, target);
+</programlisting>
+
+<para>
+The function will return after the complete copying process has finished. Still,
+this method provides a progress dialog, and it makes sure that the application
+processes repaint events.
+</para>
+
+<para>
+A particularly interesting combination of functions is
+<function>download()</function> in combination with
+<function>removeTempFile()</function>. The former downloads a file from given
+URL and stores it in a temporary file with a unique name. The name is stored
+in the second argument. <emphasis>If</emphasis> the URL is local, the file is
+not downloaded, and instead the second argument is set to the local file
+name. The function <function>removeTempFile()</function> deletes the file
+given by its argument if the file is the result of a former download. If that
+is not the case, it does nothing. Thus, a very easy to use way of loading
+files regardless of their location is the following code snippet:
+</para>
+
+<programlisting>
+KURL url;
+url = ...;
+QString tempFile;
+if (KIO::NetAccess::download(url, tempFile) {
+ // load the file with the name tempFile
+ KIO::NetAccess::removeTempFile(tempFile);
+}
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-metadata">
+<title>Meta data</title>
+
+<para>
+As can be seen above, the interface to IO jobs is quite abstract and does not
+consider any exchange of information between application and IO slave that
+is protocol specific. This is not always appropriate. For example, you may give
+certain parameters to the HTTP slave to control its caching behavior or
+send a bunch of cookies with the request. For this need, the concept of meta
+data has been introduced. When a job is created, you can configure it by adding
+meta data to it. Each item of meta data consists of a key/value pair. For
+example, in order to prevent the HTTP slave from loading a web page from its
+cache, you can use:
+</para>
+
+<programlisting>
+void FooClass::reloadPage()
+{
+ KURL url("http://www.kdevelop.org/index.html");
+ KIO::TransferJob *job = KIO::get(url, true, false);
+ job->addMetaData("cache", "reload");
+ ...
+}
+</programlisting>
+
+<para>
+The same technique is used in the other direction, i.e. for communication from
+the slave to the application. The method
+<function>Job::queryMetaData()</function> asks for the value of the certain
+key delivered by the slave. For the HTTP slave, one such example is the key
+<literal>"modified"</literal>, which contains a (stringified representation of)
+the date when the web page was last modified. An example how you can use this
+is the following:
+</para>
+
+<programlisting>
+void FooClass::printModifiedDate()
+{
+ KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
+ KIO::TransferJob *job = KIO::get(url, true, false);
+ connect( job, SIGNAL(result(KIO::Job*)),
+ this, SLOT(transferResult(KIO::Job*)) );
+}
+
+void FooClass::transferResult(KIO::Job *job)
+{
+ QString mimetype;
+ if (job->error())
+ job->showErrorDialog();
+ else {
+ KIO::TransferJob *transferJob = (KIO::TransferJob*) job;
+ QString modified = transferJob->queryMetaData("modified");
+ cout &lt;&lt; "Last modified: " &lt;&lt; modified &lt;&lt; endl;
+}
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-scheduling">
+<title>Scheduling</title>
+
+<para>
+When using the KIO API, you usually do not have to cope with the details of
+starting IO slaves and communicating with them. The normal use case is to
+start a job and with some parameters and handle the signals the jobs emits.
+</para>
+
+<para>
+Behind the curtains, the scenario is a lot more complicated. When you create a
+job, it is put in a queue. When the application goes back to the event loop,
+KIO allocates slave processes for the jobs in the queue. For the first jobs
+started, this is trivial: an IO slave for the appropriate protocol is started.
+However, after the job (like a download from an http server) has finished, it
+is not immediately killed. Instead, it is put in a pool of idle slaves and
+killed after a certain time of inactivity (current 3 minutes). If a new request
+for the same protocol and host arrives, the slave is reused. The obvious
+advantage is that for a series of jobs for the same host, the cost for creating
+new processes and possibly going through an authentication handshake is saved.
+</para>
+
+<para>
+Of course, reusing is only possible when the existing slave has already finished
+its previous job. when a new request arrives while an existing slave process is
+still running, a new process must be started and used. In the API usage in the
+examples above, there are no limitation for creating new slave processes: if you
+start a consecutive series of downloads for 20 different files, then KIO will
+start 20 slave processes. This scheme of assigning slaves to jobs is called
+<emphasis>direct</emphasis>. It not always the most appropriate scheme, as it
+may need much memory and put a high load on both the client and server machines.
+</para>
+
+<para>
+So there is a different way. You can <emphasis>schedule</emphasis> jobs. If
+you do this, only a limited number (currently 3) of slave processes for a
+protocol will be created. If you create more jobs than that, they are put in a
+queue and are processed when a slave process becomes idle. This is done as
+follows:
+</para>
+
+<programlisting>
+KURL url("http://developer.kde.org/documentation/kde2arch/index.html");
+KIO::TransferJob *job = KIO::get(url, true, false);
+KIO::Scheduler::scheduleJob(job);
+</programlisting>
+
+<para>
+A third possibility is <emphasis>connection oriented</emphasis>. For example,
+for the IMAP slave, it does not make any sense to start multiple processes for
+the same server. Only one IMAP connection at a time should be enforced. In
+this case, the application must explicitly deal with the notion of a slave. It
+has to deallocate a slave for a certain connection and then assign all jobs
+which should go through the same connection to the same slave. This can again
+be easily achieved by using the KIO::Scheduler:
+</para>
+
+<programlisting>
+KURL baseUrl("imap://bernd@albert.physik.hu-berlin.de");
+KIO::Slave *slave = KIO::Scheduler::getConnectedSlave(baseUrl);
+
+KIO::TransferJob *job1 = KIO::get(KURL(baseUrl, "/INBOX;UID=79374"));
+KIO::Scheduler::assignJobToSlave(slave, job1);
+
+KIO::TransferJob *job2 = KIO::get(KURL(baseUrl, "/INBOX;UID=86793"));
+KIO::Scheduler::assignJobToSlave(slave, job2);
+
+...
+
+KIO::Scheduler::disconnectSlave(slave);
+</programlisting>
+
+<para>
+You may only disconnect the slave after all jobs assigned to it are guaranteed
+to be finished.
+</para>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-definingslaves">
+<title>Defining an ioslave</title>
+
+<para>
+In the following we discuss how you can add a new ioslave to the system.
+In analogy to services, new ioslaves are advertised to the system by
+installing a little configuration file. The following Makefile.am
+snippet installs the ftp protocol:
+</para>
+
+<programlisting>
+protocoldir = $(kde_servicesdir)
+protocol_DATA = ftp.protocol
+EXTRA_DIST = $(mime_DATA)
+</programlisting>
+
+<para>
+The contents of the file ftp.protocol is as follows:
+</para>
+
+<programlisting>
+[Protocol]
+exec=kio_ftp
+protocol=ftp
+input=none
+output=filesystem
+listing=Name,Type,Size,Date,Access,Owner,Group,Link,
+reading=true
+writing=true
+makedir=true
+deleting=true
+Icon=ftp
+</programlisting>
+
+<para>
+The <literal>"protocol"</literal> entry defines for which protocol this slave
+is responsible. <literal>"exec"</literal> is (in contrast what you would
+expect naively) the name of the library that implements the slave. When the
+slave is supposed to start, the <command>"kdeinit"</command> executable is
+started which in turn loads this library into its address space. So in
+practice, you can think of the running slave as a separate process although it
+is implemented as library. The advantage of this mechanism is that it saves a
+lot of memory and reduces the time needed by the runtime linker.
+</para>
+
+<para>
+The "input" and "output" lines are not used currently.
+</para>
+
+<para>
+The remaining lines in the <literal>.protocol</literal> file define which
+abilities the slave has. In general, the features a slave must implement are
+much simpler than the features the KIO API provides for the application. The
+reason for this is that complex jobs are scheduled to a couple of subjobs. For
+example, in order to list a directory recursively, one job will be started for
+the toplevel directory. Then for each subdirectory reported back, new subjobs
+are started. A scheduler in KIO makes sure that not too many jobs are active
+at the same time. Similarly, in order to copy a file within a protocol that
+does not support copying directly (like the <literal>ftp:</literal> protocol),
+KIO can read the source file and then write the data to the destination
+file. For this to work, the <literal>.protocol</literal> must advertise the
+actions its slave supports.
+</para>
+
+<para>
+Since slaves are loaded as shared libraries, but constitute standalone programs,
+their code framework looks a bit different from normal shared library plugins.
+The function which is called to start the slave is called
+<function>kdemain()</function>. This function does some initializations and
+then goes into an event loop and waits for requests by the application using
+it. This looks as follows:
+</para>
+
+<programlisting>
+extern "C" { int kdemain(int argc, char **argv); }
+
+int kdemain(int argc, char **argv)
+{
+ KLocale::setMainCatalogue("kdelibs");
+ KInstance instance("kio_ftp");
+ (void) KGlobal::locale();
+
+ if (argc != 4) {
+ fprintf(stderr, "Usage: kio_ftp protocol "
+ "domain-socket1 domain-socket2\n");
+ exit(-1);
+ }
+
+ FtpSlave slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+ return 0;
+}
+</programlisting>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-implementingslaves">
+<title>Implementing an ioslave</title>
+
+<para>
+Slaves are implemented as subclasses of <classname>KIO::SlaveBase</classname>
+(FtpSlave in the above example). Thus, the actions listed in the
+<literal>.protocol</literal> correspond to certain virtual functions in
+<classname>KIO::SlaveBase</classname> the slave implementation must
+reimplement. Here is a list of possible actions and the corresponding virtual
+functions:
+</para>
+
+<variablelist>
+
+<varlistentry><term>reading - Reads data from a URL</term>
+<listitem><para>void get(const KURL &amp;url)</para></listitem></varlistentry>
+
+<varlistentry><term>writing - Writes data to a URL and create the file if it does not exist yet.</term>
+<listitem><para>void put(const KURL &amp;url, int permissions, bool overwrite, bool resume)</para></listitem></varlistentry>
+
+<varlistentry><term>moving - Renames a file.</term>
+<listitem><para>void rename(const KURL &amp;src, const KURL &amp;dest, bool overwrite)</para></listitem></varlistentry>
+
+<varlistentry><term>deleting - Deletes a file or directory.</term>
+<listitem><para>void del(const KURL &amp;url, bool isFile)</para></listitem></varlistentry>
+
+<varlistentry><term>listing - Lists the contents of a directory.</term>
+<listitem><para>void listDir(const KURL &amp;url)</para></listitem></varlistentry>
+
+<varlistentry><term>makedir - Creates a directory.</term>
+<listitem><para>void mkdir(const KURL &amp;url, int permissions)</para></listitem></varlistentry>
+
+</variablelist>
+
+<para>
+Additionally, there are reimplementable functions not listed in the <literal>.protocol</literal>
+file. For these operations, KIO automatically determines whether they are supported
+or not (i.e. the default implementation returns an error).
+</para>
+
+<variablelist>
+
+<varlistentry><term>Delivers information about a file, similar to the C function stat().</term>
+<listitem><para>void stat(const KURL &amp;url)</para></listitem></varlistentry>
+
+<varlistentry><term>Changes the access permissions of a file.</term>
+<listitem><para>void chmod(const KURL &amp;url, int permissions)</para></listitem></varlistentry>
+
+<varlistentry><term>Determines the MIME type of a file.</term>
+<listitem><para>void mimetype(const KURL &amp;url)</para></listitem></varlistentry>
+
+<varlistentry><term>Copies a file.</term>
+<listitem><para>copy(const KURL &amp;url, const KURL &amp;dest, int permissions, bool overwrite)</para></listitem></varlistentry>
+
+<varlistentry><term>Creates a symbolic link.</term>
+<listitem><para>void symlink(const QString &amp;target, const KURL &amp;dest, bool overwrite)</para></listitem></varlistentry>
+
+</variablelist>
+
+<para>
+All these implementation should end with one of two calls: If the operation
+was successful, they should call <literal>finished()</literal>. If an error has occurred,
+<literal>error()</literal> should be called with an error code as first argument and a
+string in the second. Possible error codes are listed as enum
+<type>KIO::Error</type>. The second argument is usually the URL in
+question. It is used e.g. in <function>KIO::Job::showErrorDialog()</function>
+in order to parameterize the human-readable error message.
+</para>
+
+<para>
+For slaves that correspond to network protocols, it might be interesting to
+reimplement the method <function>SlaveBase::setHost()</function>. This is
+called to tell the slave process about the host and port, and the user name
+and password to log in. In general, meta data set by the application can be
+queried by <function>SlaveBase::metaData()</function>. You can check for the
+existence of meta data of a certain key with
+<function>SlaveBase::hasMetaData()</function>.
+</para>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-communication">
+<title>Communicating back to the application</title>
+
+<para>
+Various actions implemented in a slave need some way to communicate data back
+to the application using the slave process:
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+<function>get()</function> sends blocks of data. This is done with
+<function>data()</function>, which takes a <classname>QByteArray</classname>
+as argument. Of course, you do not need to send all data at once. If you send
+a large file, call <function>data()</function> with smaller data blocks, so
+the application can process them. Call <function>finished()</function> when
+the transfer is finished.
+</para></listitem>
+
+<listitem><para>
+<function>listDir()</function> reports information about the entries of a
+directory. For this purpose, call <function>listEntries()</function> with a
+<classname>KIO::UDSEntryList</classname> as argument. Analogously to
+<function>data()</function>, you can call this several times. When you are
+finished, call <function>listEntry()</function> with the second argument set
+to true. You may also call <function>totalSize()</function> to report the
+total number of directory entries, if known.
+</para></listitem>
+
+<listitem><para>
+<function>stat()</function> reports information about a file like size, MIME
+type, etc. Such information is packaged in a
+<classname>KIO::UDSEntry</classname>, which will be discussed below. Use
+<function>statEntry()</function> to send such an item to the application.
+</para></listitem>
+
+<listitem><para>
+<function>mimetype()</function> calls <function>mimeType()</function> with a
+string argument.
+</para></listitem>
+
+<listitem><para>
+<function>get()</function> and <function>copy()</function> may want to provide
+progress information. This is done with the methods
+<function>totalSize()</function>, <function>processedSize()</function>,
+<function>speed()</function>. The total size and processed size are reported
+as bytes, the speed as bytes per second.
+</para></listitem>
+
+<listitem><para>
+You can send arbitrary key/value pairs of meta data with
+<function>setMetaData()</function>.
+</para></listitem>
+
+</itemizedlist>
+
+</simplesect>
+
+
+<simplesect id="nettransparency-interacting">
+<title>Interacting with the user</title>
+
+<para>
+Sometimes a slave has to interact with the user. Examples include informational
+messages, authentication dialogs and confirmation dialogs when a file is about
+to be overwritten.
+</para>
+
+<itemizedlist>
+
+<listitem><para>
+<function>infoMessage()</function> - This is for informational feedback, such
+as the message "Retrieving data from &lt;host&gt;" from the http slave, which
+is often displayed in the status bar of the program. On the application side,
+this method corresponds to the signal
+<function>KIO::Job::infoMessage()</function>.
+</para></listitem>
+
+<listitem><para>
+<function>warning()</function> - Displays a warning in a message box with
+<function>KMessageBox::information()</function>. If a message box is still
+open from a former call of warning() from the same slave process, nothing
+happens.
+</para></listitem>
+
+<listitem><para>
+<function>messageBox()</function> - This is richer than the previous
+method. It allows to open a message box with text and caption and some
+buttons. See the enum <type>SlaveBase::MessageBoxType</type> for reference.
+</para></listitem>
+
+<listitem><para>
+<function>openPassDlg()</function> - Opens a dialog for the input of user name
+and password.
+</para></listitem>
+
+</itemizedlist>
+
+</simplesect>
+
+</sect1>
+
+</chapter>
+
+
+
+<appendix id="misc">
+<title>Licensing</title>
+
+&underFDL;
+&underGPL;
+
+</appendix>
+
+</book>
diff --git a/doc/kdearch/joinbevel.png b/doc/kdearch/joinbevel.png
new file mode 100644
index 00000000..584b6bd4
--- /dev/null
+++ b/doc/kdearch/joinbevel.png
Binary files differ
diff --git a/doc/kdearch/joinmiter.png b/doc/kdearch/joinmiter.png
new file mode 100644
index 00000000..e5d94b13
--- /dev/null
+++ b/doc/kdearch/joinmiter.png
Binary files differ
diff --git a/doc/kdearch/joinround.png b/doc/kdearch/joinround.png
new file mode 100644
index 00000000..9a8bbe93
--- /dev/null
+++ b/doc/kdearch/joinround.png
Binary files differ
diff --git a/doc/kdearch/konqi-mirrored.png b/doc/kdearch/konqi-mirrored.png
new file mode 100644
index 00000000..5145c0ee
--- /dev/null
+++ b/doc/kdearch/konqi-mirrored.png
Binary files differ
diff --git a/doc/kdearch/konqi-normal.png b/doc/kdearch/konqi-normal.png
new file mode 100644
index 00000000..c16e1475
--- /dev/null
+++ b/doc/kdearch/konqi-normal.png
Binary files differ
diff --git a/doc/kdearch/konqi-rotated.png b/doc/kdearch/konqi-rotated.png
new file mode 100644
index 00000000..157e82dd
--- /dev/null
+++ b/doc/kdearch/konqi-rotated.png
Binary files differ
diff --git a/doc/kdearch/konqi-sheared.png b/doc/kdearch/konqi-sheared.png
new file mode 100644
index 00000000..ee645f87
--- /dev/null
+++ b/doc/kdearch/konqi-sheared.png
Binary files differ
diff --git a/doc/kdearch/kview-menu.png b/doc/kdearch/kview-menu.png
new file mode 100644
index 00000000..0e57e721
--- /dev/null
+++ b/doc/kdearch/kview-menu.png
Binary files differ
diff --git a/doc/kdearch/opengl.png b/doc/kdearch/opengl.png
new file mode 100644
index 00000000..2489777d
--- /dev/null
+++ b/doc/kdearch/opengl.png
Binary files differ
diff --git a/doc/kdearch/penstyles.png b/doc/kdearch/penstyles.png
new file mode 100644
index 00000000..7e976bcd
--- /dev/null
+++ b/doc/kdearch/penstyles.png
Binary files differ
diff --git a/doc/kdearch/whatsthis.png b/doc/kdearch/whatsthis.png
new file mode 100644
index 00000000..4bdba093
--- /dev/null
+++ b/doc/kdearch/whatsthis.png
Binary files differ
diff --git a/doc/kdevelop/Makefile.am b/doc/kdevelop/Makefile.am
new file mode 100644
index 00000000..41691557
--- /dev/null
+++ b/doc/kdevelop/Makefile.am
@@ -0,0 +1,3 @@
+KDE_LANG = en
+KDE_DOCS = AUTO
+
diff --git a/doc/kdevelop/SF-general.png b/doc/kdevelop/SF-general.png
new file mode 100644
index 00000000..0824c835
--- /dev/null
+++ b/doc/kdevelop/SF-general.png
Binary files differ
diff --git a/doc/kdevelop/SF-indent.png b/doc/kdevelop/SF-indent.png
new file mode 100644
index 00000000..d84cd469
--- /dev/null
+++ b/doc/kdevelop/SF-indent.png
Binary files differ
diff --git a/doc/kdevelop/SF-other.png b/doc/kdevelop/SF-other.png
new file mode 100644
index 00000000..750f112b
--- /dev/null
+++ b/doc/kdevelop/SF-other.png
Binary files differ
diff --git a/doc/kdevelop/adv-build-management.docbook b/doc/kdevelop/adv-build-management.docbook
new file mode 100644
index 00000000..e589a007
--- /dev/null
+++ b/doc/kdevelop/adv-build-management.docbook
@@ -0,0 +1,128 @@
+<chapter id="adv-build-management">
+<title>Advanced Build Management</title>
+<indexterm zone="adv-build-management"><primary>&automake;</primary></indexterm>
+
+<sect1 id="buildconfigurations">
+<title>Multiple Build Configurations</title>
+<indexterm zone="buildconfigurations"><primary>build configurations</primary><secondary>multiple</secondary></indexterm>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- buildconfigurations -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="crosscompiling">
+<title>Cross-Compiling</title>
+<indexterm zone="crosscompiling"><primary>cross compiling</primary></indexterm>
+<indexterm zone="crosscompiling"><primary>compiling</primary><secondary>cross</secondary></indexterm>
+<indexterm zone="crosscompiling"><primary><option>--host</option></primary></indexterm>
+
+<para>
+When you have suitable cross compilers available, you can cross compile your
+programs for processors and operating systems different from the system where
+&kdevelop; and the compiler is running. The &GNU; compiler collection &gcc; can
+be configured and compiled as a cross compiler if you compile it yourself.
+Consult the <ulink url="info://gcc/Cross-Compiler">GCC info pages</ulink> for
+more information. Some &Linux; distributions also provide binary packages.
+</para>
+
+<para>
+An <application>automake</application> based package can easily be
+cross-compiled by specifying the <option>--host</option> option to the
+configure script and setting the <envar>CC</envar> and <envar>CXX</envar>
+environment variables to the respective cross compiler binaries. Often you
+want to switch between a the cross-compiled version of your application and
+one compiled for your development system. For this, it is advantageous to
+use &kdevelop; capability of creating multiple build configurations, as
+explained in <xref linkend="buildconfigurations"/>. Once you have created a
+new build configuration for cross-compiling in the
+<menuchoice><guimenu>Project</guimenu><guimenuitem>Project
+Options...</guimenuitem></menuchoice> dialog, add the option
+</para>
+
+<screen><option>--host=</option><replaceable>platform</replaceable></screen>
+
+<para>
+to the configure options. The <replaceable>platform</replaceable> name
+is a tuple of the form
+</para>
+
+<programlisting>cpu-vendor-os</programlisting>
+<para>or</para>
+<programlisting>cpu-vendor-kernel-os</programlisting>
+
+<para>
+For many combinations, you can use a short form, for instance
+<wordasword>i386-linux</wordasword> or <wordasword>arm-elf</wordasword>.
+</para>
+
+</sect1> <!-- crosscompiling -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="qtembedded">
+<title>Qt/Embedded</title>
+<indexterm zone="qtembedded"><primary>embedded</primary><secondary>Qt</secondary></indexterm>
+<indexterm zone="qtembedded"><primary>Qt/Embedded</primary></indexterm>
+<indexterm zone="qtembedded"><primary>Qtopia</primary></indexterm>
+<indexterm zone="qtembedded"><primary>framebuffer</primary></indexterm>
+
+<para>
+&qte; is a version of the &Qt; library that does not use the X window
+system, but draws directly to the framebuffer on &Linux; systems. It is
+therefore interesting for embedded systems which have tight restrictions
+on the memory usage of the whole system. Its &API; is fully compatible with
+the one of the X11 version.
+</para>
+
+<para>
+Developing an application for &qte; with &kdevelop; is not very different
+from developing a program for the X11 version of &Qt;. In fact, you can use the
+same codebase for both versions. If you use the autoproject project
+management, you switch to the embedded version by passing the argument
+<option>--enable-embedded</option> to the configure script. You can set
+this in the <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options...</guimenuitem></menuchoice> dialog under
+<guilabel>Configure Options</guilabel>. With the option
+<option>--with-qt-dir=DIR</option> you set the directory in which &qte;
+is installed.
+</para>
+
+<para>
+After configuring and compiling your application with these options, it will
+link with the <filename>libqpe.so</filename> library. This version of your
+application will not normally run when you use X11. In order to test it,
+run it under the control of the program <application>qvfb</application>
+(&Qt; Virtual Frame Buffer). This is done by starting
+<application>qvfb</application> and then starting your application with
+</para>
+
+<screen><command>app <option>-qws</option> <option>-display QVFb:0</option></command></screen>
+
+<para>
+Naturally, when you have a working version of your application, you
+will want to use it on the target processor. For this, it will probably
+be convenient to create multiple build configurations, as explained above,
+so that you can quickly switch between the version running on your development
+system and the version running on the target system.
+</para>
+
+<para>
+Applications for &qte; normally run as single applications on the
+device they are designed for. Trolltech also supports Qtopia, which is a
+collection of applications for PIM, web browsing and various other areas that
+work together in a consistent manner. It is the standard environment for
+instance on the Sharp Zaurus. You can write applications that integrate into
+this environment by using the Qtopia SDK. This implies making your application
+class a subclass of <classname>QPEApplication</classname> and linking to the
+library <filename>libqpe.so</filename>. If you develop your application with
+the autoproject project management, you have to add
+<option>--enable-qtopia</option> to the configure options.
+</para>
+
+</sect1> <!-- qtembedded -->
+
+</chapter> <!-- adv-build-management -->
diff --git a/doc/kdevelop/app-changelog.docbook b/doc/kdevelop/app-changelog.docbook
new file mode 100644
index 00000000..50e8f4ee
--- /dev/null
+++ b/doc/kdevelop/app-changelog.docbook
@@ -0,0 +1,69 @@
+<appendix id="app-changelog">
+<title>Changes</title>
+<sect1 id="changes">
+<title>Changes to This Document</title>
+
+<itemizedlist>
+ <listitem>
+ <para>2003-01-03 Bernd Gehrmann, Caleb Tennis
+ <itemizedlist>
+ <listitem>
+ <para>initial manual layout</para>
+ </listitem>
+ <listitem>
+ <para>many chapter contents sketched</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+
+ <listitem>
+ <para>2004-08-01 Bernd Pol, Ian Wadham
+ <itemizedlist>
+ <listitem>
+ <para>manual slightly reorganized</para>
+ </listitem>
+ <listitem>
+ <para>some missing chapters written</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>2005-05-02 Volker Paul &mdash; Many changes, including:
+ <itemizedlist>
+ <listitem>
+ <para>split into one file per chapter/appendix</para>
+ </listitem>
+ <listitem>
+ <para>added command reference sorted by menu (descriptions not yet complete)</para>
+ </listitem>
+ <listitem>
+ <para>AppWizard tutorial in getting-started.docbook</para>
+ </listitem>
+ <listitem>
+ <para>reorganized chapters, guided by Konqueror manual</para>
+ </listitem>
+ <listitem>
+ <para>moved installation, Unix development, <quote>In a Nutshell</quote> to the appendix</para>
+ </listitem>
+ <listitem>
+ <para>rewrote plugin appendix, incl. plugin list generator listplugins.sh</para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>Still far from complete, but a small step forward.</para>
+ </listitem>
+
+ <listitem>
+ <para>2006-05-20 Bernd Pol &mdash; Filling in some more <quote>to be written</quote> holes:</para>
+ </listitem>
+
+</itemizedlist>
+
+</sect1> <!-- changes -->
+</appendix> <!-- app-changelog -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/app-files.docbook b/doc/kdevelop/app-files.docbook
new file mode 100644
index 00000000..210e1469
--- /dev/null
+++ b/doc/kdevelop/app-files.docbook
@@ -0,0 +1,425 @@
+<appendix id="app-files">
+<!-- LWatts (2005-04-30): A lot of this might be better as variable lists, -->
+<!-- but it's not that big a deal. Something to be done only when there's -->
+<!-- a lot of textual changes needed here (e.g., maybe never ) -->
+
+<appendixinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</appendixinfo>
+
+<title>Configuration Files Used by &kdevelop;</title>
+
+<para>
+&kdevelop; uses a series of configuration files which are distributed amongst several directories. There are two main groups of configuration files to distinguish:
+</para>
+<simplelist>
+ <member>
+ <link linkend="app-files-default">&kdevelop; Default Configuration</link> &mdash; files set up when &kdevelop; was installed.
+ </member>
+ <member>
+ <link linkend="app-files-user">User Oriented Configuration</link> &mdash; files which contain user modifications of the defaults as well as settings made by the &kdevelop; application itself and its plugins.
+ </member>
+</simplelist>
+
+<sect1 id="app-files-default">
+<title>&kdevelop; Default Configuration</title>
+
+<para>
+On installation, &kdevelop; writes some default information files for setup and configuration purposes into subdirectories of the <filename class="directory">$<envar>KDEDIR</envar></filename> installation directory (usually something like <filename class="directory">/opt/kde</filename>, <filename class="directory">/usr/local/kde</filename>, or some other user-defined installation directory, see <link linkend="kdevelop-install">Installing &kdevelop;</link>).
+</para>
+
+<sect2 id="app-files-default-config">
+<title>Default &kdevelop; Configuration</title>
+
+<para>
+There is only one &kdevelop; specific default configuration file in the <filename class="directory">$<envar>KDEDIR</envar>/share/config/</filename> directory:
+</para>
+<variablelist>
+ <varlistentry>
+ <term><filename>kdeveloprc</filename></term>
+ <listitem><para>
+ This file contains the basic settings &kdevelop; needs to start. It will be copied to the user's <filename class="directory">$<envar>KDEHOME</envar>/share/config</filename> directory when &kdevelop; does not find a <filename>kdeveloprc</filename> file there on startup.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+</sect2> <!-- app-files-default-config -->
+
+<sect2 id="app-files-default-apps">
+<title>Application Specific Defaults</title>
+
+<para>
+Most &kdevelop; features are provided by KParts. These are basically applications specially designed to run in the &kdevelop; framework (see the overview in the <link linkend="plugin-tools">Plugin Tools</link> appendix). Each KPart application has its own set of configuration files whose defaults will be stored in several subdirectories of the <filename class="directory">$<envar>KDEDIR</envar>/share/apps/</filename> installation directory.
+</para>
+
+<para>
+There are quite a lot of default configuration subdirectories in <filename class="directory">$<envar>KDEDIR</envar>/share/apps/</filename> whose names all start with a <filename>kdev</filename> sequence. Most of them are for &kdevelop; internal use only. They might be deliberately grouped for readability as:
+<simplelist>
+ <member><link linkend="app-files-default-apps-stdalone">Stand-alone Applications</link></member>
+ <member><link linkend="app-files-default-apps-task">Task Specific Parts</link></member>
+ <member><link linkend="app-files-default-apps-project">Project Generation Parts</link></member>
+ <member><link linkend="app-files-default-apps-lang">Language Specific Parts</link></member>
+</simplelist>
+</para>
+
+<itemizedlist>
+ <listitem id="app-files-default-apps-stdalone"><itemizedlist>
+ <title>Stand-alone Applications</title>
+ <listitem>
+ <para><filename class="directory">kdevelop/</filename> &mdash; contains files to configure the &kdevelop; &IDE;:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">licenses/</filename> &mdash; contains various licenses texts.</para></listitem>
+ <listitem><para><filename class="directory">pics/</filename> &mdash; contains the picture files used for the &kdevelop;, &kdevelop; Assistant, and &kdevelop; Designer splash screens.</para></listitem>
+ <listitem><para><filename class="directory">profiles/</filename> &mdash; contains default plugin profile settings. (Currently there is only a <filename>tiny</filename> profile provided which defines a minimum set of active &kdevelop; plugins.)</para></listitem>
+ <listitem><para><filename>eventsrc</filename> &mdash; holds a lot of <quote>Process successful</quote> localization strings.</para></listitem>
+ <listitem><para><filename>kdevelopui.rc</filename> &mdash; provides the basic menu and tool bar entries &kdevelop; uses.</para></listitem>
+ <listitem><para><filename>kdevhtml_partui.rc</filename> &mdash; provides a <guimenuitem>Print...</guimenuitem> entry in the <guimenu>File</guimenu> menu, a <guimenuitem>Copy</guimenuitem> entry in the <guimenu>Edit</guimenu> menu, and <guilabel>Back</guilabel> and <guilabel>Forward</guilabel> arrows in the <guilabel>Browser Toolbar</guilabel> in case a &HTML; file is browsed from the <guilabel>Documentation</guilabel> plugin.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><filename class="directory">kdevassistant/</filename> &mdash; provides the menu and tool bars of the stand-alone &kdevelop; Assistant documentation browser.</para></listitem>
+ <listitem><para><filename class="directory">kdevdesigner/</filename> and <filename class="directory">kdevdesignerpart/</filename> &mdash; provide menu bar and tool bars of the stand-alone &kdevelop; user interface designer.</para></listitem>
+ </itemizedlist></listitem>
+
+ <listitem><itemizedlist id="app-files-default-apps-task">
+ <title>Task Specific Parts</title>
+ <listitem id="app-files-default-abbrev">
+ <para><filename class="directory">kdevabbrev/</filename> &mdash; contains files used by the <guilabel>Abbreviation Expansion</guilabel> plugin:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">sources/</filename> &mdash; contains keyword definition files used by the <guilabel>Expand Text</guilabel> command.</para></listitem>
+ <listitem><para><filename class="directory">templates/</filename> &mdash; contains template definition files used by the <guilabel>Expand Abbreviation</guilabel> command.</para></listitem>
+ <listitem><para><filename>kdevabbrev.rc</filename> &mdash; provides the <guimenuitem>Expand Text</guimenuitem> and <guimenuitem>Expand Abbreviation</guimenuitem> entries in the <guimenu>Edit</guimenu> menu.</para></listitem>
+</itemizedlist>
+ </listitem>
+ <listitem id="app-files-default-appwizard">
+ <para><filename class="directory">kdevappwizard/</filename> &mdash; contains files used by the &appwizard; part:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">importfiles/</filename> &mdash; contains <filename>.kdevelop</filename> project files which control the initialization of a new project.</para></listitem>
+ <listitem><para><filename class="directory">imports/</filename> &mdash; contains templates to set up project specific <filename>.desktop</filename> files.</para></listitem>
+ <listitem><para><filename class="directory">template-common/</filename> &mdash; contains various files commonly included in the project source directories.</para></listitem>
+ <listitem><para><filename class="directory">templates/</filename> &mdash; contains configuration files which describe the information to be included in a given project source directory.</para></listitem>
+ <listitem><para><filename>*.png</filename> &mdash; project preview images used by the &appwizard;.</para></listitem>
+ <listitem><para><filename>*.tar.gz</filename> &mdash; tarballs containing the source files to be included in a new generated project directory.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><filename class="directory">kdevastyle/</filename> &mdash; provides the <guimenuitem>Reformat Source</guimenuitem> entry in the <guimenu>Edit</guimenu> menu.</para></listitem>
+ <listitem><para><filename class="directory">kdevautoproject/</filename> &mdash; provides most of the entries in the <guimenu>Build</guimenu> menu and the <guilabel>Build Toolbar (&kdevelop;)</guilabel> toolbar.</para></listitem>
+ <listitem>
+ <para><filename class="directory">kdevclassview/</filename> &mdash; contains files used by the <guilabel>Class View</guilabel> project plugin:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">pics/</filename> &mdash; contains the icons used in the <guilabel>Classes</guilabel> classview tree.</para></listitem>
+ <listitem><para><filename>kdevclassview.tc</filename> &mdash; provides the <guimenuitem>Class Inheritance Diagram</guimenuitem> entry in the <guimenu>Projects</guimenu> menu as well as the classes navigation combo box in the <guilabel>Browser Toolbar</guilabel>.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><filename class="directory">kdevcloser/</filename> &mdash; provides the <guimenu>Windows</guimenu> menu close entries.</para></listitem>
+ <listitem><para><filename class="directory">kdevctags/</filename> &mdash; provides the <guimenuitem>CTags</guimenuitem> entry in the <guimenu>Tools</guimenu> menu for the <guilabel>CTags Frontend</guilabel> project plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevcvsservice/</filename> &mdash; provides the icon used by the <guilabel>CvsService</guilabel> tab and a short shell script used to add a new entry to the &cvs; repository, both used by the <guilabel>CVS Integration</guilabel> project plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevdebugger/</filename> &mdash; provides the <guimenu>Debug</guimenu> menu entries for the <guilabel>Debugger Frontend</guilabel> project plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevdiff/</filename> &mdash; provides the <guimenuitem>Difference Viewer</guimenuitem> entry in the <guimenu>Tools</guimenu> menu.</para></listitem>
+ <listitem><para><filename class="directory">kdevdistpart/</filename> &mdash; provides the <guimenuitem>Distribution &amp; Publishing</guimenuitem> entry in the <guimenu>Project</guimenu> menu for the <guilabel>Final Packaging Support</guilabel> project plugin.</para></listitem>
+ <listitem id="app-files-default-kdevdoc">
+ <para><filename class="directory">kdevdocumentation/</filename> &mdash; contains files used by the <guilabel>Documentation</guilabel> plugin:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">en/</filename> and <filename class="directory">pics/</filename> &mdash; contain files used by the <application>htdig</application> search tool.</para></listitem>
+ <listitem><para><filename class="directory">tocs/</filename> &mdash; contain the default &kdevelop; documentation content description files (see the description in <link linkend="toc-file-structure">Basic Structure of &kdevelop; TOC Files</link>).</para></listitem>
+ <listitem><para><filename>kdevpart_documentation.rc</filename> &mdash; provides the search related entries in the <guimenu>Help</guimenu> menu.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><filename class="directory">kdevdoxygen/</filename> &mdash; provides the menu entries for the <guilabel>Doxygen Support</guilabel> project plugin.</para></listitem>
+ <listitem id="app-files-default-filecreate">
+ <para><filename class="directory">kdevfilecreate/</filename> &mdash; contains files used by the <guilabel>New File Wizard:</guilabel>
+ <itemizedlist>
+ <listitem><para><filename class="directory">file-templates/</filename> &mdash; provides the initial text contents to be put into the new source file of a given type.</para></listitem>
+ <listitem><para><filename>kdevpart_filecreate.rc</filename> &mdash; provides the <guimenuitem>New</guimenuitem> entry in the <guimenu>File</guimenu> menu.</para></listitem>
+ <listitem><para><filename>template-info.xml</filename> &mdash; contains descriptions of the available file types to be displayed in the <guilabel>New File</guilabel> tool view.</para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><filename class="directory">kdevfilter/</filename> &mdash; provides the <guimenuitem>Execute Command...</guimenuitem> and <guimenuitem>Filter Selection Through Command...</guimenuitem> entries in the <guimenu>Tools</guimenu> menu used by the <guilabel>Shell Filtering and Insertion</guilabel> plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevfullscreen/</filename> &mdash; provides the <guimenuitem>Full Screen Mode</guimenuitem> entry in the <guimenu>View</guimenu> menu and the according tool bar icon.</para></listitem>
+ <listitem><para><filename class="directory">kdevgrepview/</filename> &mdash; provides the <guimenuitem>Find in Files...</guimenuitem>entry in the <guimenu>Edit</guimenu> menu used by the <guilabel>Grep Frontend</guilabel> plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevhistory/</filename> &mdash; provides the <guimenuitem>Back</guimenuitem> and <guimenuitem>Forward</guimenuitem> entries in the <guimenu>View</guimenu> menu.</para></listitem>
+ <listitem><para><filename class="directory">kdevjavadebugger/</filename> &mdash; provides a <guimenu>Java Debug</guimenu> menu in order to debug a &Java; application.</para></listitem>
+ <listitem><para><filename class="directory">kdevoutputviews/</filename> &mdash; provides the <guimenuitem>Next Error</guimenuitem> and <guimenuitem>Previous Error</guimenuitem> entries in the <guimenu>View</guimenu> menu.</para></listitem>
+ <listitem><para><filename class="directory">kdevpartexplorer/</filename> &mdash; provides the <guimenuitem>Part Explorer</guimenuitem> entry in the <guimenu>Tools</guimenu> menu used by the <guilabel>Part Explorer Tool</guilabel> plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevquickopen/</filename> &mdash; provides the <guimenuitem>Quick Open File..</guimenuitem> entry in the <guimenu>File</guimenu> menu and the <guimenuitem>Quick Open Class...</guimenuitem> and <guimenuitem>Quick Open Method</guimenuitem> entries in the <guimenu>Tools</guimenu> menu used by the <guilabel>Quick Open</guilabel> project plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevregexptest/</filename> &mdash; provides the <guimenuitem>Debug Regular Expression...</guimenuitem> entry in the <guimenu>Tools</guimenu> menu used by the <guilabel>Regular Expression Tester</guilabel> plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevreplace/</filename> &mdash; provides the <guimenuitem>Find-Select-Replace...</guimenuitem> entry in the <guimenu>Edit</guimenu> menu used by the <guilabel>Replace Part</guilabel> plugin.</para></listitem>
+ <listitem id="app-files-default-tips"><para><filename class="directory">kdevtipofday/</filename> &mdash; provides the <guimenuitem>Tip of the Day</guimenuitem> entry in the <guimenu>Help</guimenu> menu as well as a HTML-File containing the available tips.</para></listitem>
+ <listitem><para><filename class="directory">kdevtools/</filename> &mdash; controls various menu entries ceated by <guimenu>Tools Menu</guimenu> and <guilabel>External Tools Menu</guilabel> settings provided by the <guilabel>Tools Menu Addition</guilabel> plugin.</para></listitem>
+ <listitem><para><filename class="directory">kdevvalgrind/</filename> &mdash; provides the <guimenuitem>Valgrind Memory Leak Check</guimenuitem> and <guimenuitem>Profile with KCachegrind</guimenuitem> entries in the <guimenu>Debug</guimenu> menu used by the <guilabel>Valgrind Frontend</guilabel> plugin.</para></listitem>
+ </itemizedlist></listitem>
+
+ <listitem><itemizedlist id="app-files-default-apps-project">
+ <title>Project Generation Parts</title>
+ <listitem><para><filename class="directory">kdevadaproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons to build an Ada application.</para></listitem>
+ <listitem><para><filename class="directory">kdevantproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu when the Ant project generator is used.</para></listitem>
+ <listitem><para><filename class="directory">kdevautoproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons when working with the &GNU; Tools based &automake; project generator. Additionally provides the <guimenuitem>Add Translation</guimenuitem> and <guimenuitem>Build Configuration</guimenuitem> entries to the <guimenu>Project</guimenu> menu.</para></listitem>
+ <listitem><para><filename class="directory">kdevcustomproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons when the project is based on custom Makefils.</para></listitem>
+ <listitem><para><filename class="directory">kdevgenericproject/</filename> &mdash; contains menu definitions for an experimental generic project generator. Currently (version 3.1.0) unused.</para></listitem>
+ <listitem><para><filename class="directory">kdevhaskellproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons to build a Haskell application.</para></listitem>
+ <listitem><para><filename class="directory">kdevpascalproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons to build a Pascal application.</para></listitem>
+ <listitem><para><filename class="directory">kdevtrollproject/</filename> &mdash; provides entries for the <guimenu>Build</guimenu> menu and according tool bar icons to build an application using the &Qt; QMake project manager.</para></listitem>
+ </itemizedlist></listitem>
+
+ <listitem><itemizedlist id="app-files-default-apps-lang">
+ <title>Language Specific Parts</title>
+ <listitem><para><filename class="directory">kdevadasupport/</filename> &mdash; provides entries in the <guimenu>Tools</guimenu> menu and according tool bar icons needed to develop Ada applications.</para></listitem>
+ <listitem><para><filename class="directory">kdevbashsupport/</filename> &mdash; provides entries in the <guimenu>Build</guimenu> menu and according tool bar icons needed to develop Bash scripts.</para></listitem>
+ <listitem id="app-files-default-apps-lang-cpp">
+ <para><filename class="directory">kdevcppsupport/</filename> &mdash; contains files used by the &appwizard; to build C++ applications:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">newclass/</filename> &mdash; contains header and source templates from which the &appwizard; builds the according source files.</para></listitem>
+ <listitem><para><filename class="directory">subclassing/</filename> &mdash; contains templates which the &appwizard; uses to set up initial class declarations/definitions in the source files.</para></listitem>
+ <listitem><para><filename class="directory">templates</filename> &mdash; contains templates from which the &appwizard; sets up the default header and source template files to be used by the &nfwizard;. </para></listitem>
+ <listitem><para><filename>configuration</filename> &mdash; dummy template to add macros.</para></listitem>
+ <listitem><para><filename>kdevcppsupport.rc</filename> &mdash; provides the <guimenuitem>Complete Text</guimenuitem> and <guimenuitem>Make Member</guimenuitem> entries fo the <guimenu>Edit</guimenu> menu, the <guimenuitem>Switch Header/Implementation</guimenuitem> entry for the <guimenu>View</guimenu> menu, and the <guimenuitem>New Class</guimenuitem> entry for the <guimenu>Project</guimenu> menu as well as a <guiicon>New Class</guiicon> icon for the <guilabel>Browser Toolbar</guilabel>.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para><filename class="directory">kdevfortransupport/</filename> &mdash; provides entries in the <guimenu>Build</guimenu> menu needed to develop Fortran applications.</para></listitem>
+ <listitem><para><filename class="directory">kdevhaskellsupport/</filename> &mdash; provides entries in the <guimenu>Build</guimenu> menu and according tool bar icons needed to develop Haskell applications.</para></listitem>
+ <listitem><para><filename class="directory">kdevjavasupport/</filename> &mdash; contains the UI definition needed to develop &Java; applications.</para></listitem>
+ <listitem><para><filename class="directory">kdevpascalsupport/</filename> &mdash; contains the UI definition needed to develop Pascal applications.</para></listitem>
+ <listitem><para><filename class="directory">kdevperlsupport/</filename> &mdash; provides <guimenu>Project</guimenu> and <guimenu>Help</guimenu> menu entries needed to develop Perl scripts.</para></listitem>
+ <listitem><para><filename class="directory">kdevphpsupport/</filename> &mdash; contains UI and PHP function definition files needed to develop PHP scripts.</para></listitem>
+ <listitem><para><filename class="directory">kdevpythonsupport/</filename> &mdash; provides <guimenu>Build</guimenu> and <guimenu>Help</guimenu> menu entries and according tool bar icons needed to develop Python scripts.</para></listitem>
+ <listitem><para><filename class="directory">kdevrubysupport/</filename> &mdash; provides <guimenu>Build</guimenu> menu entries and according tool bar icons needed to develop Ruby scripts.</para></listitem>
+ <listitem><para><filename class="directory">kdevscriptproject/</filename> &mdash; provides th UI definitions needed to develop custom projects. Currently (version 3.1.0) unused.</para></listitem>
+ <listitem><para><filename class="directory">kdevsqlsupport/</filename> &mdash; provides th UI definitions needed to develop SQL projects. Currently (version 3.1.0) unused.</para></listitem>
+ </itemizedlist></listitem>
+
+</itemizedlist>
+
+</sect2> <!-- app-files-default-apps -->
+
+</sect1> <!-- app-files-default -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="app-files-user">
+<title>User Oriented Configuration</title>
+
+<para>
+All information about user defined settings is kept in two subdirectories of <filename class="directory">$<envar>KDEHOME</envar></filename>, namely:
+<simplelist>
+ <member><link linkend="app-files-user-apps">Application Specific Configuration</link> in the <filename class="directory">$<envar>KDEHOME</envar>/share/apps/</filename> directory, and</member>
+ <member><link linkend="app-files-user-config">Resource Configuration File</link> in the <filename class="directory">$<envar>KDEHOME</envar>/share/config/</filename> directory.</member>
+</simplelist>
+</para>
+
+<sect2 id="app-files-user-apps">
+<title>Application Specific Configuration</title>
+
+<para>
+Any user changes to the <link linkend="app-files-default">&kdevelop; Default Configuration</link> settings as well as user specific settings which are not kept in any of the <link linkend="app-files-user-config">Resource Configuration Files</link> are found in <filename>kdev...</filename> subdirectories of the <filename class="directory">$<envar>KDEHOME</envar>/share/apps/</filename> directory.
+</para>
+<para>
+Most of these configuration files are however used by various &kdevelop; plugins in order to provide some specific menu and/or toolbar entries. Thus they are of interest only in case something went really wrong with the user interface.
+</para>
+<note><para>
+In case the contents of these directories mirror those of the Default Configuration settings, &kdevelop; will have copied them from <filename class="directory">$<envar>KDEDIR</envar>/apps/</filename> into the <filename class="directory">$<envar>KDEHOME</envar>/apps/</filename> directory on its initial start. Any subsequent changes will be made to these copies only. The Default Configuration settings remain unchanged in any case.
+</para></note>
+
+<itemizedlist>
+ <listitem>
+ <para><filename class="directory">kdevabbrev/</filename> &mdash; contains files used by the <guilabel>Abbreviation Expansion</guilabel> plugin:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">sources/</filename> &mdash; currently empty; &kdevelop; uses the <link linkend="app-files-default-abbrev">default keyword definition</link> files for <guilabel>Expand Text</guilabel> commands.</para></listitem>
+ <listitem><para><filename class="directory">templates/</filename> &mdash; contains the user modified template definition files used by the <guilabel>Expand Abbreviation</guilabel> command.</para></listitem>
+ <listitem><para><filename>kdevabbrev.rc</filename> &mdash; provides the <guimenuitem>Expand Text</guimenuitem> and <guimenuitem>Expand Abbreviation</guimenuitem> entries in the <guimenu>Edit</guimenu> menu.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevappwizard/</filename> &mdash; only provides the <guimenuitem>New Project...</guimenuitem> and <guimenuitem>Import Existing Project...</guimenuitem> entries in the <guimenu>Projects</guimenu> menu. The &appwizard; will use the <link linkend="app-files-default-appwizard">default configuration settings</link> for its actual works.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevastyle/</filename> &mdash; provides the actual <guimenuitem>Reformat Source</guimenuitem> entry in the <guimenu>Edit</guimenu> menu.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevautoproject/</filename> &mdash; provides the actual entries in the <guimenu>Build</guimenu> menu and the <guilabel>Build Toolbar (KDevelop)</guilabel> toolbar.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevclassview/</filename> &mdash; provides the <guimenuitem>Class Inheritance Diagram</guimenuitem> entry in the <guimenu>Project</guimenu> menu and the class browser combo box in the <guilabel>Browser Toolbar</guilabel> by the <guilabel>Class View</guilabel> project plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevcloser/</filename> &mdash; provides the <guimenuitem>Close Selected Windows...</guimenuitem> entry in the <guimenu>Windows</guimenu> menu.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevcppsupport/</filename> &mdash; holds the acual configuration used by the &appwizard; to build C++ applications. The &appwizard; however uses its main bulk of configuration information directly from the <link linkend="app-files-default-apps-lang-cpp">default configuration directory</link>. See there for more detail.</para>
+ <itemizedlist>
+ <listitem>
+ <para><filename class="directory">newclass/</filename> &mdash; contains the actual header and source templates from which the &appwizard; builds the according source files.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">pcs/</filename> &mdash; contains database files &kdevelop; uses build the actual Persistent Code Store (<filename>.pcs</filename>) file of a &kde; C++ project.</para>
+ </listitem>
+ <listitem>
+ <para><filename>kdevcppsupport.rc</filename> &mdash; provides the <guimenuitem>Complete Text</guimenuitem> and <guimenuitem>Make Member</guimenuitem> entries fo the <guimenu>Edit</guimenu> menu, the <guimenuitem>Switch Header/Implementation</guimenuitem> entry for the <guimenu>View</guimenu> menu, and the <guimenuitem>New Class</guimenuitem> entry for the <guimenu>Project</guimenu> menu as well as a <guiicon>New Class</guiicon> icon for the <guilabel>Browser Toolbar</guilabel>.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevctags/</filename> &mdash; provides the <guimenuitem>CTags</guimenuitem> entry in the <guimenu>Tools</guimenu> menu for the <guilabel>CTags Frontend</guilabel> project plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevdebugger/</filename> &mdash; provides the <guimenu>Debug</guimenu> menu entries for the <guilabel>Debugger Frontend</guilabel> project plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevdiff/</filename> &mdash; provides the <guimenuitem>Difference Viewer</guimenuitem> entry in the <guimenu>Tools</guimenu> menu.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevdocumentation/</filename> &mdash; contains the actual files used by the <guilabel>Documentation</guilabel> plugin in addition to the <link linkend="app-files-default-kdevdoc"> default configuration files</link>. See there for more detail.</para>
+ <para>The directories in <filename class="directory">kdevdocumentation/</filename> mainly hold actual bookkeeping information. The actually set up documentation files are kept in <link linkend="app-files-user-config-doc"> <quote><filename>doc...pluginrc</filename></quote> files</link> in the <filename class="directory">$<envar>KDEHOME</envar>/share/config/</filename> directory.</para>
+ <itemizedlist>
+ <listitem>
+ <para><filename class="directory">bookmarks/</filename> &mdash; maintains the entries in the <guilabel>Bookmarks</guilabel> tab of the &kdevelop; <guilabel>Documentation</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">index/</filename> &mdash; holds various cache files &kdevelop; uses to speed up indexed documentation searches in the <guilabel>Index</guilabel> tab of the <guilabel>Documentation</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">search/</filename> &mdash; contains files used by the <application>htdig</application> search tool which serves search calls from the <guilabel>Search</guilabel> tab of the <guilabel>Documentation</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename>kdevpart_documentation.rc</filename> &mdash; provides the search related entries in the <guimenu>Help</guimenu> menu.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevdoxygen/</filename> &mdash; provides the menu entries for the <guilabel>Doxygen Support</guilabel> project plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevelop/</filename> &mdash; contains some actual settings &kdevelop; uses for its basic setup:</para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">profiles/</filename> &mdash; provides actual plugin profile setting. (Initially there is only a <filename>FullIDE</filename> profile which defines a full set of initially active &kdevelop; plugins.)</para></listitem>
+ <listitem><para><filename>kdevelopui.rc</filename> &mdash; provides the basic menu and tool bar entries &kdevelop; uses.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevfilecreate/</filename> &mdash; contains files used by the <guilabel>New File Wizard:</guilabel></para>
+ <itemizedlist>
+ <listitem><para><filename class="directory">file-templates/</filename> &mdash; provides the actually used text contents to be put into the new source file of a given type. More file templates are found in the <link linkend="app-files-default-filecreate">default configuration files</link> directory.</para></listitem>
+ <listitem><para><filename>kdevpart_filecreate.rc</filename> &mdash; provides the <guimenuitem>New</guimenuitem> entry in the <guimenu>File</guimenu> menu.</para></listitem>
+ <listitem><para><filename>template-info.xml</filename> &mdash; contains descriptions of the available file types to be displayed in the <guilabel>New File</guilabel> tool view.</para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevfilter/</filename> &mdash; provides the <guimenuitem>Execute Command...</guimenuitem> and <guimenuitem>Filter Selection Through Command...</guimenuitem> entries in the <guimenu>Tools</guimenu> menu used by the <guilabel>Shell Filtering and Insertion</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevfullscreen/</filename> &mdash; provides the <guimenuitem>Full Screen Mode</guimenuitem> entry in the <guimenu>View</guimenu> menu and the according tool bar icon.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevgrepview/</filename> &mdash; provides the <guimenuitem>Find in Files...</guimenuitem>entry in the <guimenu>Edit</guimenu> menu used by the <guilabel>Grep Frontend</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevoutputviews/</filename> &mdash; provides the <guimenuitem>Next Error</guimenuitem> and <guimenuitem>Previous Error</guimenuitem> entries in the <guimenu>View</guimenu> menu.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevpartexplorer/</filename> &mdash; provides the <guimenuitem>Part Explorer</guimenuitem> entry in the <guimenu>Tools</guimenu> menu used by the <guilabel>Part Explorer Tool</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevquickopen/</filename> &mdash; provides the <guimenuitem>Quick Open File..</guimenuitem> entry in the <guimenu>File</guimenu> menu and the <guimenuitem>Quick Open Class...</guimenuitem> and <guimenuitem>Quick Open Method</guimenuitem> entries in the <guimenu>Tools</guimenu> menu used by the <guilabel>Quick Open</guilabel> project plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevregexptest/</filename> &mdash; provides the <guimenuitem>Debug Regular Expression...</guimenuitem> entry in the <guimenu>Tools</guimenu> menu used by the <guilabel>Regular Expression Tester</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevreplace/</filename> &mdash; provides the <guimenuitem>Find-Select-Replace...</guimenuitem> entry in the <guimenu>Edit</guimenu> menu used by the <guilabel>Replace Part</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevtipofday/</filename> &mdash;provides the <guimenuitem>Tip of the Day</guimenuitem> entry in the <guimenu>Help</guimenu> menu. The HTML-File containing the available tips is provided as a <link linkend="app-files-default-tips">default configuration file</link> only.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevtools/</filename> &mdash; controls various menu entries ceated by <guimenu>Tools Menu</guimenu> and <guilabel>External Tools Menu</guilabel> settings provided by the <guilabel>Tools Menu Addition</guilabel> plugin.</para>
+ </listitem>
+ <listitem>
+ <para><filename class="directory">kdevvalgrind/</filename> &mdash; provides the <guimenuitem>Valgrind Memory Leak Check</guimenuitem> and <guimenuitem>Profile with KCachegrind</guimenuitem> entries in the <guimenu>Debug</guimenu> menu used by the <guilabel>Valgrind Frontend</guilabel> plugin.</para>
+ </listitem>
+</itemizedlist>
+
+</sect2> <!-- app-files-user-apps -->
+
+<sect2 id="app-files-user-config">
+<title>Resource Configuration Files</title>
+
+<para>
+There are two groups of &kdevelop; configuration files in the <filename class="directory">$<envar>KDEHOME</envar>/share/config/</filename> directory, distiguished by their surrounding character sequences:
+<simplelist>
+ <member><quote><filename>doc...pluginrc</filename></quote> denotes <link linkend="app-files-user-config-doc">files used by the documentation plugin.</link></member>
+ <member><quote><filename>kdev...rc</filename></quote> denotes configuration <link linkend="app-files-user-config-kdev">files used by &kdevelop;</link> itself and its available plugins.</member>
+</simplelist>
+</para>
+
+<itemizedlist id="app-files-user-config-kdev">
+<title>Configuration Files Used by &kdevelop;</title>
+ <listitem>
+ <para><filename>kdevabbrevrc</filename> &mdash; holds the current state of the <guilabel>Abbreviations</guilabel> configuration provided by the <guilabel>Abbreviation Expansion</guilabel> plugin.</para>
+ <note><para>This only records whether the abbreviations will be used or not. The actual definitions of new abbreviations will go into the <filename>$<envar>KDEHOME</envar>/share/apps/kdevabbrev/templates/templates</filename> file.</para></note>
+ </listitem>
+ <listitem>
+ <para><filename>kdevassistantrc</filename> &mdash; holds some configuration states specific of the stand-alone &kdevelop; Assistant documentation browser.</para>
+ <note><para>Most common configuration settings are shared with the &kdevelop; IDE <filename>kdeveloprc</filename> file.</para></note>
+ </listitem>
+ <listitem><para><filename>kdevassistantuimode4rc</filename> &mdash; holds the current MDI configuration states (dock positions &etc;) of the stand-alone &kdevelop; Assistant documentation browser.</para></listitem>
+ <listitem>
+ <para><filename>kdevclassviewrc</filename> &mdash; holds the <guilabel>View Mode</guilabel> setting of the <guilabel>Classes</guilabel> class browser tab provided by the <guilabel>Class View</guilabel> project plugin.</para>
+ <note><para>This is a global setting, although the <guilabel>Class View</guilabel> plugin may be disabled on a per project basis. Any change in this setting will be globally updated whenever the current project is closed and thus affect all subsequently loaded projects.</para></note>
+ </listitem>
+ <listitem><para><filename>kdevcppsupportrc</filename> &mdash; holds some settings used to set up CPP source files. In particular you will find the settings made on the <guilabel>C++ Class Generator</guilabel> configuration dialog in here.</para></listitem>
+ <listitem><para><filename>kdevdocumentationrc</filename> &mdash; holds actual settings the <guilabel>Documentation</guilabel> plugin uses.</para></listitem>
+ <listitem><para><filename>kdeveloprc</filename> &mdash; holds the global settings the &kdevelop; IDE and the &kdevelop; Assistant stand-alone documentation browser will use.</para></listitem>
+ <listitem><para><filename>kdevelopuimode4rc</filename> &mdash; holds the current MDI configuration states (dock positions &etc;) of the &kdevelop; IDE.</para></listitem>
+ <listitem><para><filename>kdevfileselectorrc</filename> &mdash; holds actual settings the <guilabel>File Selector</guilabel> plugin uses.</para></listitem>
+ <listitem><para><filename>kdevfileviewrc</filename> &mdash; holds the actual filename color settings the <guilabel>CVS Integration (Cervisia)</guilabel> project plugin uses for display.</para></listitem>
+ <listitem><para><filename>kdevfilterrc</filename> &mdash; holds actual settings the <guilabel>Shell Filtering and Insertion</guilabel> plugin uses.</para></listitem>
+ <listitem><para><filename>kdevgrepviewrc</filename> &mdash; holds actual settings the <guilabel>Grep Frontend</guilabel> plugin uses.</para></listitem>
+ <listitem><para><filename>kdevsnippetrc</filename> &mdash; holds actual settings the <guilabel>Code Snippets</guilabel> plugin uses.</para></listitem>
+ <listitem><para><filename>kdevtoolsrc</filename> &mdash; holds actual settings the <guilabel>Tools Menu Addition</guilabel> plugin uses.</para></listitem>
+</itemizedlist>
+
+<itemizedlist id="app-files-user-config-doc">
+<title>Configuration Files Used by the Documentation Plugin</title>
+ <listitem><para><filename>docchmpluginrc</filename> &mdash; holds information about the actual &Microsoft; CHM help files as defined on the <guilabel>CHM Documentation Collection</guilabel> configuration page.</para></listitem>
+ <listitem><para><filename>doccustompluginrc</filename> &mdash; holds information about any custom documentation file defined on the <guilabel>Custom Documentation Collection</guilabel> configuration page.</para></listitem>
+ <listitem><para><filename>docdevhelppluginrc</filename> &mdash; holds information about the actual GNOME 2 DevHelp documentation files as defined on the <guilabel>Devhelp Documentation Collection</guilabel> configuration page.</para></listitem>
+ <listitem><para><filename>docdoxygenpluginrc</filename> &mdash; holds information about the actual Doxygen generated API documentations as defined on the <guilabel>Doxygen Documentation Collection</guilabel> configuration page.</para></listitem>
+ <listitem><para><filename>dockdevtocpluginrc</filename> &mdash; holds information about the actual KDevelopTOC structured documentation files as defined on the <guilabel>KDevelopTOC Documentation Collection</guilabel> configuration page.</para></listitem>
+ <listitem><para><filename>docqtpluginrc</filename> &mdash; holds information about the QT documentation files actually included on the <guilabel> Documentation Collection</guilabel>Qt configuration page.</para></listitem>
+</itemizedlist>
+
+</sect2> <!-- app-files-user-config -->
+
+</sect1> <!-- app-files-user -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="app-files-project">
+<title>Project Dependent Configuration</title>
+
+<para>
+Most project dependend configuration is kept in the <filename>&lt;project-name&gt;.kdevelop</filename> and <filename>&lt;project-name&gt;.kdevses</filename> &kdevelop; project configuration files rather than in separate files as the other, more global, configuration settings. In short, those files are meant for:
+</para>
+<simplelist>
+ <member><filename>&lt;project-name&gt;.kdevelop</filename> &mdash; global project configuration information.</member>
+ <member><filename>&lt;project-name&gt;.kdevses</filename> &mdash; configuration information needed to restore the specific behaviours of the running session.</member>
+</simplelist>
+<para>
+Both are &XML; coded files. They can be viewed and (cautiously) altered using any text editor.
+</para>
+
+<sect2>
+<title>Persistent Code Store Files</title>
+
+<para>There is a third project dependend configuration file, the <filename>&lt;project-name&gt;.kdevelop.pcs</filename> Persistant Code Store. This is a binary coded file holding an internal parser cache for the most part in order to speed up the loading sequence of the project. Additionally, this Persistant Code Store keeps information use by the <guilabel>Code Completion</guilabel> facility of &kdevelop;.
+</para>
+
+<note><para>
+There can be additional Persistant Code Store files be set up on the <guilabel>Code Completion</guilabel> tab of the <guilabel>C++ Specific</guilabel> project configuration page. Information about these additional <filename>.pcs</filename> is kept globally in the <filename class="directory">$<envar>KDEHOME</envar>/share/apps/kdevcppsupport/pcs/</filename> directory.
+</para></note>
+</sect2>
+
+</sect1> <!-- app-files-project -->
+
+</appendix> <!-- app-files -->
diff --git a/doc/kdevelop/app-menu.docbook b/doc/kdevelop/app-menu.docbook
new file mode 100644
index 00000000..954b65f2
--- /dev/null
+++ b/doc/kdevelop/app-menu.docbook
@@ -0,0 +1,61 @@
+<appendix id="app-menus">
+
+<appendixinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</appendixinfo>
+
+<title>Menus and Toolbars Overview</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect1 id="app-menus-menu">
+<title>Menus</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect2 id="app-menus-menu-common">
+<title>Commonly Available Menus</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- app-menus-menu-common -->
+
+<sect2 id="app-menus-menu-project">
+<title>Project Specific Menus</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- app-menus-menu-project -->
+
+<sect2 id="app-menus-menu-specific">
+<title>Plugin Tools Specific Menus</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- app-menus-menu-specific -->
+
+</sect1> <!-- app-menus-menu -->
+
+<sect1 id="app-menus-tool">
+<title>Toolbars</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- app-menus-tool -->
+
+</appendix> <!-- app-menus -->
diff --git a/doc/kdevelop/app-misc-info.docbook b/doc/kdevelop/app-misc-info.docbook
new file mode 100644
index 00000000..308be579
--- /dev/null
+++ b/doc/kdevelop/app-misc-info.docbook
@@ -0,0 +1,24 @@
+<appendix id="app-misc-info">
+<title>Further Information</title>
+<sect1 id="gettinginformation">
+<title>Getting Information</title>
+<para>
+(... to be written ...)
+</para>
+</sect1> <!-- gettinginformation -->
+
+<sect1 id="app-reporting-bugs">
+<title>Reporting Bugs</title>
+<para>
+(... to be written ...)
+</para>
+</sect1> <!-- app-reporting-bugs -->
+
+<sect1 id="app-licensing">
+<title>Licensing</title>
+&underFDL;
+&underGPL;
+</sect1> <!-- app-licensing -->
+</appendix> <!-- app-misc-info -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/app-uimodes-examples.docbook b/doc/kdevelop/app-uimodes-examples.docbook
new file mode 100644
index 00000000..24b93c61
--- /dev/null
+++ b/doc/kdevelop/app-uimodes-examples.docbook
@@ -0,0 +1,125 @@
+<appendix id="app-uimodes-examples">
+<title>&kdevelop; User Interface Mode Examples</title>
+
+<sect1 id="ideal-desc">
+<title>IDEAl Mode</title>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevelop-ideal-mode.png" format="PNG"/>
+ </imageobject>
+ <textobject><phrase>Screenshot</phrase></textobject>
+ <caption><para>&kdevelop; IDEAl mode</para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevelop-ideal-mode-0.png" format="PNG"/>
+ </imageobject>
+ <textobject><phrase>Screenshot</phrase></textobject>
+ <caption><para>&kdevelop; IDEAl mode, closed tabs</para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+This example screenshot demonstrates one of the main virtues of IDEAl mode. There is a maximum workspace available. Yet any tool view is readily available by clicking on the according tab.
+</para>
+<para>
+You will most probably need some time to get accustomed to the icons in the tab bar. If you got lost, just position the mouse over a tab and wait a few seconds. A short tool tip description will pop up. In this screenshot the <quote>Automake Manager</quote> tool tip is shown as an example. It describes the lower tab in the right tab bar.
+</para>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+</sect1> <!-- ideal-desc -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="mdi-desc">
+<title>Child Frame Windows Mode</title>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevelop-mdi-mode.png" format="PNG"/>
+ </imageobject>
+ <textobject><phrase>Screenshot</phrase></textobject>
+ <caption><para>&kdevelop; child frame windows mode</para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+</sect1> <!-- mdi-desc -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="tabbed-desc">
+<title>Tabbed Pages Mode</title>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevelop-tabbed-mode.png" format="PNG"/>
+ </imageobject>
+ <textobject><phrase>Screenshot</phrase></textobject>
+ <caption><para>&kdevelop; tabbed pages mode</para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+</sect1> <!-- tabbed-desc -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="toplevel-desc">
+<title>Toplevel Windows Mode</title>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevelop-toplevel-mode.png" format="PNG"/>
+ </imageobject>
+ <textobject><phrase>Screenshot</phrase></textobject>
+ <caption><para>&kdevelop; toplevel windows mode</para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Click <link linkend="uimodes-survey">here</link> to return to the modes overview.
+</para>
+
+</sect1> <!-- toplevel-desc -->
+
+</appendix> <!-- app-uimodes-examples -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/applicationwizard.docbook b/doc/kdevelop/applicationwizard.docbook
new file mode 100644
index 00000000..ee732a78
--- /dev/null
+++ b/doc/kdevelop/applicationwizard.docbook
@@ -0,0 +1,820 @@
+<chapter id="applicationwizard">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Getting Started &mdash; the &appwizard;</title>
+<!-- FIXME (bp, 2006-06-18) This is a misnomer. It should be something like -->
+<!-- Working With Projects -->
+<!-- featuring the application manager as part of the New Projects section. -->
+
+<indexterm zone="applicationwizard">
+ <primary>&appwizard;</primary></indexterm>
+
+<para>
+In &kdevelop; software development work is organized in <emphasis>projects</emphasis>. Such a project keeps everything together which belongs to a complete programming task: source files, additional data files, any actually needed management facilities as the make system as well as access to all components and any additional tools needed to get the application up and running.
+</para>
+<para>
+Organizing all development work in projects allows you to easily switch between the global tasks at hand. This is quite handy if you &eg; work on several applications at the same time as is often the case. Tell &kdevelop; to open the project you want to work at and you may proceed in the environment just where you left.
+</para>
+
+<sect1 id="new-projects">
+<title>New Projects</title>
+
+<!-- TODO (bp, 2006-06-18) This whole section must be completely rewritten. -->
+<!-- There is no need for a tutorial habit anymore. -->
+
+<indexterm zone="new-projects">
+ <primary>project</primary>
+ <secondary>new</secondary></indexterm>
+
+<para>
+Whenever you want to initiate a new programming project quite a lot of formal setup procedures need to be done. An initial directory structure has to be set up, initial header and source files must be provided, the make system has to be initialized, &etc;
+</para>
+<para>
+&kdevelop; provides an easy way to initiate a new programming project&mdash;the <emphasis>&appwizard;</emphasis>. You will find the &appwizard; at menu entry <menuchoice><guimenu>Project</guimenu> <guimenuitem>New Project</guimenuitem></menuchoice>.
+</para>
+<para>
+Only a short series of steps is necessary to start a new programming project, using the &appwizard;:
+</para>
+<orderedlist>
+ <listitem><para>
+ <link linkend="new-projects-start-type">Select the programming language</link> you want to use and the type of the application you want to build from a set of predefined templates.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="new-projects-start-general">Supply some general information</link> as application name, directory where the application shall be built, &etc;
+ </para></listitem>
+ <listitem><para>
+ Decide whether you want to use a <link linkend="new-projects-start-cvs">version control system</link>, like &eg; CVS, and supply the necessary data if needed.
+ </para></listitem>
+ <listitem><para>
+ Set up some templates for <link linkend="new-projects-start-templates">initial header and source files</link> (if applicable).
+ </para></listitem>
+ <listitem><para>
+ Finally tell &appwizard; to <link linkend="new-projects-start-build">set up all initial stuff</link>, directory structure, starting header/source file templates, and management tools, like &eg; an initial make skeleton, &etc;
+ </para></listitem>
+</orderedlist>
+<para>
+Voil&agrave;&mdash;that's all. &appwizard; will have provided you with a primary functional set of programming files, where you can readily start working.
+</para>
+<para>
+Let's look at all this in more detail now ...
+</para>
+
+<sect2 id="new-projects-start">
+<title>Initial Steps</title>
+
+<indexterm zone="new-projects-start">
+ <primary>dialog</primary>
+ <secondary>create new project</secondary></indexterm>
+<indexterm zone="new-projects-start">
+ <primary>project</primary>
+ <secondary>create new project</secondary>
+ <tertiary>dialog</tertiary></indexterm>
+<indexterm zone="new-projects-start">
+ <primary>project</primary>
+ <secondary>templates</secondary></indexterm>
+<indexterm zone="new-projects-start">
+ <primary>templates</primary>
+ <secondary>project</secondary></indexterm>
+
+<para>
+To create a new project in &kdevelop;, select <guimenuitem>New Project</guimenuitem> from the <guimenu>Project</guimenu> menu. The <guilabel>Create New Project</guilabel> dialog will pop up showing an initial <guilabel>General</guilabel> page:
+</para>
+
+<screenshot id="screenshot-newprojectwizard">
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="create-new-project.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Initial dialog to set up a new project
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+As you see, this dialog is divided into an upper and a lower part. In the upper part you can decide on the programming language and application type, the lower part holds some general information.
+</para>
+
+<sect3 id="new-projects-start-type">
+<title>Select Programming Language and Application Type</title>
+
+<indexterm zone="new-projects-start-type">
+ <primary>project</primary>
+ <secondary>application type</secondary></indexterm>
+<indexterm zone="new-projects-start-type">
+ <primary>project</primary>
+ <secondary>programming language</secondary></indexterm>
+<indexterm zone="new-projects-start-type">
+ <primary>project</primary>
+ <secondary>language</secondary></indexterm>
+<indexterm zone="new-projects-start-type">
+ <primary>language</primary></indexterm>
+<indexterm zone="new-projects-start-type">
+ <primary>programming language</primary></indexterm>
+<indexterm zone="new-projects-start-type">
+ <primary>application</primary>
+ <secondary>type</secondary></indexterm>
+
+<para>
+The left hand side of the upper part in this dialog is where you do the selection work. When it shows up, you'll find there a list of folders each labeled with a programming language, as there are:
+</para>
+
+<itemizedlist>
+ <listitem><para>
+ Ada
+ <indexterm>
+ <primary>Ada</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ C
+ <indexterm>
+ <primary>C</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ C++
+ <indexterm>
+ <primary>C++</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Database (SQL Projects)
+ <indexterm>
+ <primary>SQL</primary>
+ <secondary>new project</secondary></indexterm>
+ <indexterm>
+ <primary>Database</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Fortran
+ <indexterm>
+ <primary>Fortran</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Haskell
+ <indexterm>
+ <primary>Haskell</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Java
+ <indexterm>
+ <primary>Java</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ PHP
+ <indexterm>
+ <primary>PHP</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Pascal
+ <indexterm>
+ <primary>Pascal</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Perl
+ <indexterm>
+ <primary>Perl</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Python
+ <indexterm>
+ <primary>Python</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Ruby
+ <indexterm>
+ <primary>Ruby</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Shell (Scripts for the Bash Shell)
+ <indexterm>
+ <primary>Bash</primary>
+ <secondary>new project</secondary></indexterm>
+ <indexterm>
+ <primary>shell</primary>
+ <secondary>new project</secondary></indexterm>
+ </para></listitem>
+</itemizedlist>
+
+<para>
+To be precise, these folders do not contain real programming tools actually. They do lead to pre-defined <emphasis>templates</emphasis> you can use as a starting point for development in that language. To get an idea of what is provided, just open the folders one after the other. There will be a series of subfolders on some, one or more simple entries only on others. The subfolders you see organize the available templates according to some tasks, the simple entries name the templates you may select.
+</para>
+<para>
+We cannot go into detail here on which tasks each template provides, but it's easy to find out. Whenever you select a template entry some information is displayed in the fields to the right. In the lower field you will find a <emphasis>short description</emphasis> on what the template is supposed to do. In the field above that a picture will be shown, if available, about the outcome of the application this template produces if you compile and run it unmodified. Usually this is a <emphasis>screenshot</emphasis> of the main window the application will display.
+</para>
+<para>
+Select the template which best fits your application's goals as a starting point. Then enter the general properties information in the lower field as shown in the next chapter.
+</para>
+
+<formalpara>
+<title>Selecting a Project Management System</title>
+<para>
+Each template is bound to a specific <link linkend="makesystems">Project Management System</link>. Currently there is no direct means to freely select such a Project Management System. You have to find a template which suits your needs or alter your project accordingly after creation.
+</para>
+</formalpara>
+
+</sect3> <!-- new-projects-start-type -->
+
+<sect3 id="new-projects-start-general">
+<title>Provide General Information</title>
+
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>properties</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>properties</primary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>application</primary>
+ <secondary>name</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>name</primary>
+ <secondary>application</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>directory</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>directory</primary>
+ <secondary>project</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>path</primary>
+ <secondary>new project</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>author</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>email</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>author</primary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>email</primary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>main.cpp</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>main.cpp</primary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>project</primary>
+ <secondary>license</secondary></indexterm>
+<indexterm zone="new-projects-start-general">
+ <primary>license</primary></indexterm>
+
+<para>
+The lower part of the <guilabel>Create New Project</guilabel> dialog <guilabel>General</guilabel> page is a framed field labeled <guilabel>Properties</guilabel>. You must provide some general information about your project here so that the &appwizard; knows how to build the initial structure.
+</para>
+<formalpara>
+<title>Application Name</title>
+<para>
+Your application needs a name of course. Enter this in the uppermost <guilabel>Properties</guilabel> field, called <guilabel>Application Name</guilabel>. We use <quote>MyApp</quote> as an example.
+</para>
+</formalpara>
+<para>
+When you do so, you will notice that the &appwizard; refuses to accept special characters of any kind. The only characters accepted are:
+<itemizedlist>
+ <listitem><para>upper and lower case characters</para></listitem>
+ <listitem><para>numbers</para></listitem>
+ <listitem><para>the underline character</para></listitem>
+</itemizedlist>
+</para>
+<para>
+One prominent cause of this restriction is that the &appwizard; will use this application name as the <emphasis>basis of some class names</emphasis> it will construct when it sets up an initial project. Thus the name of the application must stick to the rules of the programming language you use.
+</para>
+<formalpara>
+<title>The Project Directory</title>
+<para>
+The other prominent cause of this restriction you can see at the bottom line of the <guilabel>Properties</guilabel> area. It is labeled <guilabel>Final location</guilabel> and shows the directory where the &appwizard; will create the application.
+</para>
+</formalpara>
+<para>
+As you type the application name you will notice that the &appwizard; repeats your input at the end of the <guilabel>Final location</guilabel> line, using lower case only characters.
+</para>
+<para>
+Thus you must select the name of your new application with care. If you end up with an already used directory the &appwizard; will not allow you to continue to the next step, keeping the <guibutton>Next &gt;</guibutton> button deactivated (grayed). Yet, it will <emphasis>warn</emphasis> you in this case by appending <quote>(dir/file already exist)</quote> to the <guilabel>Final location</guilabel> line.
+</para>
+
+<formalpara>
+<title>The Starting Path</title>
+<para>
+There are two ways to select another path for your new application. One is to select another name. Yet, this is not always feasible (you might &eg; set up for another version of an already existing application). As an alternative you may select another path to the application directory.
+</para>
+</formalpara>
+<para>
+This is done in the second row input field of the <guilabel>Properties</guilabel>, named <guilabel>Location</guilabel>. What you enter here is the <emphasis>starting path</emphasis> of the new application development directory. The &appwizard; appends the application name to this path when it initializes the new project. The result is shown in the <guilabel>Final location</guilabel> line to give you better control on what is going on.
+</para>
+<para>
+&appwizard; will copy an <emphasis>initial value</emphasis> to the <guilabel>Location</guilabel> field on start-up. This is taken from what you have chosen in the <guilabel>Default projects directory</guilabel> field during the <link linkend="setup-general">general configuration steps</link>. In our case we have &kdevelop; set up to use <filename class="directory">/home/devel/projects/</filename> as initial path for new projects.
+</para>
+<para>
+Alter the <guilabel>Location</guilabel> field contents so that the application development directory shown in the <guilabel>Final location</guilabel> line will be unique.
+</para>
+<!--TODO add tab description Project Options -->
+<note><para>
+Take care that the path you enter in the <guilabel>Location</guilabel> field already exists. Otherwise you will not be able to continue to the next step. The &appwizard; will <emphasis>warn</emphasis> you about non-existing paths by appending <quote>(invalid)</quote> to the <guilabel>Final location</guilabel> line.
+</para></note>
+
+<screenshot id="screenshot-createnewprojectoptions">
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="createnewprojectoptions.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Set new project up for CVS
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<formalpara>
+<title>Personal Information</title>
+<para>
+The fields following this are not so critical. Just supply your name (&ie; the name of the person who is responsible for the application) in the <guilabel>Author</guilabel> field, and a valid e-mail address in the <guilabel>Email</guilabel> field, so that users can give you feedback on the application.
+</para>
+</formalpara>
+
+<note>
+<orderedlist>
+ <listitem><para>
+ The &appwizard; fills these fields with some default values, taken from
+ the Email presets in the &kcontrolcenter;. If these defaults in the <guilabel>Create New Project</guilabel> <guilabel>Author</guilabel> and <guilabel>Email</guilabel> fields do not suit, you may want to have a look at your mail configuration in the &kcontrolcenter;.
+ </para></listitem>
+ <listitem><para>
+ The &appwizard; will integrate this information into the starting program templates if applicable. In &kde; C++ programs for instance you will find it near the beginning of the <filename>main.cpp</filename> source file.
+ </para></listitem>
+ <listitem><para>
+ Of all fields, the <guilabel>Email</guilabel> is <emphasis>optional</emphasis>, reflecting the fact that not every developer may have access to the internet. You may keep this field empty if you wish and proceed nevertheless.
+ </para></listitem>
+</orderedlist>
+</note>
+
+<formalpara>
+<title>Version and License Info</title>
+<para>
+Finally enter a starting version number for your new application in the <guilabel>Version</guilabel> field, and select the license under which you want your application be put from the <guilabel>License</guilabel> tab.
+</para>
+</formalpara>
+
+<para>
+If you select an application type for which the &appwizard; provides common source template texts (&eg; C/C++), you may view the license notification text on the third page of this <guilabel>Create New Project</guilabel> dialog (see the <link linkend="new-projects-start-templates">Supply header/source templates</link> chapter below).
+</para>
+<para>
+If you selected <quote>Custom</quote> from the <guilabel>License</guilabel> tab you must provide a license text on your own.
+</para>
+
+<note><para>
+Both version and license information will as well be integrated into the starting templates in a suiting format the application type you selected does provide.
+</para></note>
+
+<para>
+Once you have correctly entered all this information stuff, press the <guibutton>Next &gt;</guibutton> button to proceed as shown in the following chapters.
+</para>
+</sect3> <!-- new-projects-start-general -->
+
+</sect2> <!-- new-projects-start -->
+
+<sect2 id="new-projects-start-cvs">
+<title>Supply Version System Information</title>
+
+<indexterm zone="new-projects-start-cvs">
+ <primary>CVS</primary>
+ <secondary>new project</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs">
+ <primary>project</primary>
+ <secondary>CVS</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs">
+ <primary>database</primary>
+ <secondary>CVS</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs">
+ <primary>version</primary>
+ <secondary>database</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs">
+ <primary>version</primary>
+ <secondary>CVS</secondary></indexterm>
+
+<para>
+In a second step the &appwizard; will lead you to the <guilabel>Version Control System</guilabel> page where you can decide which version control system you want to use.
+</para>
+
+<note><para>
+This discussion concentrates on the needs for project creation only. For more information on &CVS; see the <link linkend="cvs">Using &CVS;</link> chapter below.
+</para></note>
+
+<formalpara>
+<title>No Version Control System Wanted</title>
+<para>
+Initially there is <quote>None</quote> selected in the <guilabel>Version control system</guilabel> tab, and the page will be empty otherwise. If you don't want to use a version control system, just click the <guibutton>Next ></guibutton> button and go on.
+</para>
+</formalpara>
+
+<formalpara>
+<title>Using &CVS;</title>
+<para>
+Otherwise you must reselect the version control system you want to use from the <guilabel>Version control system</guilabel> tab. We use <quote>&cvs;</quote> for our example. If you select this, the &appwizard; will redisplay the page, now showing a series of fields you must fill in.
+</para>
+</formalpara>
+
+<screenshot id="screenshot-newproject-cvs">
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="create-new-project-cvs.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Set new project up for CVS
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+A version control system such as &CVS; (which means <quote>Concurrent Versions System</quote>) stores copies of selected project files in some sort of a database. If you use &CVS; you can amongst others upload (<quote>commit</quote>) those files or load them back into your project directory (<quote>checkout</quote>, or <quote>update</quote>). The special thing about this is that the files in the versioning database are stored in a structured way which allows you to always revert to an earlier development state if you need so. And &CVS; allows multiple designers to fairly easily collaborate on a big project (such as &kdevelop;) without disturbing each others work.
+</para>
+
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>CVS</primary>
+ <secondary>root</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>root</primary>
+ <secondary>CVS</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>CVS</primary>
+ <secondary>local</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>CVS</primary>
+ <secondary>remote</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>local CVS</primary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>:local:</primary></indexterm>
+<indexterm zone="new-projects-start-cvs-root">
+ <primary>CVS</primary>
+ <secondary>:local:</secondary></indexterm>
+
+<formalpara id="new-projects-start-cvs-root">
+<title>&CVS; Root</title>
+<para>
+&CVS; needs to <emphasis>manage</emphasis> the versioning database it keeps from your project files. To accomplish this it keeps some special database information in an own directory, called the <emphasis>&CVS; root</emphasis>. The first step on setting up &CVS; for your new project thus is to tell &kdevelop; where this root is located.
+</para>
+</formalpara>
+
+<para>
+<emphasis>Local &CVS; root.</emphasis> There are two basic possibilities. Either you want to use a <emphasis>local</emphasis> &CVS; database or you use a database which is held on a <emphasis>remote server</emphasis>. If you develop for your own, you may want use the &CVS; database as some sort of a backup system on your own computer. Usually this is set up in your home directory root and given the name <filename>cvsroot</filename>. This may look as follows:
+</para>
+<para><userinput><filename class="directory">/home/devel/cvsroot</filename></userinput> (where <filename>devel</filename> simply denotes the <quote>developing</quote> user, just for example)
+</para>
+
+<note><para>
+In fact, this is a short form. Exactly, the local &CVS; root should be addressed using the <computeroutput>:local:</computeroutput> prefix. The short form is only allowed in cases where the filename starts with a slash (<computeroutput>/</computeroutput>). The full name for our example local &CVS; root would exactly look like: <filename class="directory">:local:/home/devel/cvsroot</filename>
+</para></note>
+
+<para>
+Enter the name of the &CVS; root directory your system has been set up for in the <guilabel>CVS root</guilabel> field. In principle you can select any name, even use multiple &CVS; databases, but it is advisable that you stick to the &CVS; root once set up.
+</para>
+<para>
+<emphasis>Initialize a new &CVS; root.</emphasis> If there does not exist a &CVS; root yet, &kdevelop; can command the &CVS; system to create one for you in the given directory. Just check the <guilabel>Init root</guilabel> checkbox below the <guilabel>CVS root</guilabel> field.
+</para>
+<note><para>
+As said, &kdevelop; only <emphasis>commands</emphasis> the &CVS; system to initialize a new &CVS; root. It does nothing by itself to this directory. Fortunately &CVS; is clever enough to check whether the &CVS; root directory already exists. Hence it does no harm if you should have inadvertently checked <guilabel>Init root</guilabel> on an already existing &CVS; root directory.
+</para></note>
+
+<para>
+<emphasis>Remote &CVS; root.</emphasis> There are occasions where the &CVS; database is to be kept on a remote server, especially when several developers work at the same project. Then you must enter the &CVS; root &URL; of this server in the <guilabel>CVS root</guilabel> field. For example, if you want access to the &kde; &CVS; server:
+</para>
+<para>
+<userinput><filename class="directory">:pserver:<replaceable>mylogin</replaceable>@cvs.kde.org:/home/kde</filename></userinput> (where <replaceable>mylogin</replaceable> denotes the login name set up in your &kde; &CVS; account)
+</para>
+
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>remote CVS</primary></indexterm>
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>:pserver:</primary></indexterm>
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>:ext:</primary></indexterm>
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>CVS</primary>
+ <secondary>:local:</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>CVS</primary>
+ <secondary>:pserver:</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-remote">
+ <primary>CVS</primary>
+ <secondary>:ext:</secondary></indexterm>
+
+<formalpara id="new-projects-start-cvs-remote">
+<title>Remote &CVS; Server Types</title>
+<para>
+Basically there are two widely used remote &CVS; server types, the
+<emphasis>pserver</emphasis> which uses a password-secured non-encrypted
+protocol, and the <emphasis>ext</emphasis> server which uses an rsh or ssh
+encrypted data transfer. They are distinguished by the &URL; prefix they use:
+</para>
+</formalpara>
+<para>
+<filename>:pserver:</filename>
+</para>
+<para>
+for the <quote>password protected server</quote> non-encrypted type, and
+</para>
+<para>
+<filename>:ext:</filename>
+</para>
+<para>
+for an rsh or ssh encrypted server type. For example
+</para>
+<para>
+<userinput><filename class="directory">:ext:<replaceable>mylogin</replaceable>@cvs.cervisia.sourceforge.net:/cvsroot/cervisia</filename></userinput>
+</para>
+<para>
+accesses the &CVS; root of the widely used <application>Cervisia</application> &CVS; management tool on the SourceForge server.
+</para>
+<para>
+If you want to use an rsh or ssh encrypted server for &CVS; access you must tell &kdevelop; the encryption protocol to be used. Just enter <userinput>rsh</userinput> or <userinput>ssh</userinput> in the <guilabel>CVS_RSH</guilabel> field of the <guilabel>Create New Project</guilabel> <guilabel>Version Control System</guilabel> page.
+</para>
+
+<note><para>
+There is a caveat if you use an encrypted server for &CVS; from within &kdevelop;. See the <link linkend="cvs">Using &CVS;</link> chapter for details.
+</para></note>
+
+<indexterm zone="new-projects-start-cvs-repository">
+ <primary>CVS</primary>
+ <secondary>repository</secondary></indexterm>
+<indexterm zone="new-projects-start-cvs-repository">
+ <primary>repository</primary>
+ <secondary>CVS</secondary></indexterm>
+
+<formalpara id="new-projects-start-cvs-repository">
+<title>The &CVS; Repository</title>
+<para>
+So far you have told &kdevelop; where the &CVS; root resides which manages the versioning database and how to access it. Now you need to tell &kdevelop; under which name you want &CVS; save your project files in that database. Such a place your project files will be held in &CVS; is called a <emphasis>repository</emphasis>.
+</para>
+</formalpara>
+<para>
+In principle you can use any name for the &CVS; repository of your project files as long as it adheres to the specifications of naming a file. Yet, most developers simply use the name of the application itself. &CVS; will build a directory with this name in the &CVS; root, hence it is more easily found if you keep the application name for it.
+</para>
+<para>
+Just enter the repository name you want to use in the <guilabel>CVS repository</guilabel> field of the <guilabel>Create New Project</guilabel> <guilabel>Version Control System</guilabel> page. In our example this is: <userinput>MyApp</userinput>
+</para>
+
+<warning><para>
+<emphasis>Take care not to use a repository which already exists!</emphasis> The &CVS; system does not warn about duplicate files but will shovel everything in which does not produce a formal conflict. You will mess up everything!
+</para></warning>
+
+<formalpara>
+<title>The Remaining Fields</title>
+<para>
+There is not much work left to do. &appwizard; has already set up the remaining fields for you. In detail:
+</para>
+</formalpara>
+<para>
+The <guilabel>Vendor</guilabel> field is used for compatibility reasons only. You can stick to the <quote>vendor</quote> default the &appwizard; puts in here.
+</para>
+<para>
+The <guilabel>Message</guilabel> field allows you to comment the initial &CVS; contents. Use any text you like or just stick to the <quote>new project</quote> default the &appwizard; did put in.
+</para>
+<para>
+The <guilabel>Release tag</guilabel> holds the name which tags the initial state of your project. Such a <emphasis>tag</emphasis> names a certain point within the &CVS; repository by which you can later access this state of your development. (See more in the <link linkend="cvs">Using &CVS;</link> chapter.)
+</para>
+<para>
+The &appwizard; has put a default <quote>start</quote> tag in here which is a worthy proposal. Just stick to it.
+</para>
+
+<note>
+<para>
+When any information of all these is wrong &kdevelop; usually will not know about until project construction time. It is the &CVS; system which will figure out those errors when it tries to build the repository. Hence you must keep an eye to the <guilabel>Messages</guilabel> window of &kdevelop; when the project is created in the final setup step. If anything was in error with &CVS; you will in most cases see an error message like this:
+</para>
+
+<screen><computeroutput>
+* cd '/home/devel/test' &amp;&amp; cvs -d '/home/devel/mycvsroot' \
+ import -m 'new project' '' 'vendor' 'start' &amp;&amp;\
+ sh /opt/kde3/share/apps/kdevcvs/buildcvs.sh . '' \
+ '/home/devel/mycvsroot'
+* cvs [import aborted]: /home/devel/mycvsroot/CVSROOT: No such file or
+ directory
+* *** Exited with status: 1 ***
+</computeroutput></screen>
+
+<para>
+If this happens you will have to either manually set up &CVS; (&kdevelop; should have successfully initialized your project files at this time) or delete the project directory and start over again with <guimenuitem>New Project</guimenuitem> from the <guimenu>Project</guimenu> menu.
+</para>
+</note>
+
+<para>
+After you have entered all &CVS; related information, click the <guibutton>Next &gt;</guibutton> to go on.
+</para>
+
+<note><para>
+If you want to correct an error on the previous <guilabel>Create New Project</guilabel> page, just press the <guibutton>&lt; Back</guibutton> button. The &appwizard; will remember your settings on the current page, so you can easily proceed when you come back.
+</para></note>
+
+</sect2> <!-- new-projects-start-cvs -->
+
+<sect2 id="new-projects-start-templates">
+<title>Supply Header/Source Templates</title>
+
+<para>
+The next step brings you to a series of pages where you can set up common information you want to include in your source and header files, if the task at hand allows.
+</para>
+<para>
+Both header and source templates are provided for C and C++ applications, each on its own page. For other languages there may be source templates only. And in some cases you will even find this template page empty.
+</para>
+<para>
+If the page is used, &appwizard; will fill in some common header comment which for a C++ based application might look like:
+</para>
+
+<screen><computeroutput><literal>
+/***************************************************************************
+ * Copyright (C) 2003 by Your Name *
+ * you@you.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+</literal></computeroutput></screen>
+
+<para>
+Other templates will provide similar information in a format according to the definitions of the programming language you want to use.
+</para>
+<para>
+As you might have noticed, the applications manager did readily fill in some information you provided on the first <guilabel>General</guilabel> page of the <guilabel>Create New Project</guilabel> dialog, namely the contents of the <guilabel>Author</guilabel> and <guilabel>Email</guilabel> fields. Also proper license information will have been inserted according to your selection in the <guilabel>License</guilabel> tab.
+</para>
+
+<sect3 id="new-projects-start-templates-edit">
+<title>How to Edit the Templates</title>
+
+<indexterm zone="new-projects-start-templates-edit">
+ <primary>templates</primary>
+ <secondary>project</secondary>
+ <tertiary>edit</tertiary></indexterm>
+<indexterm zone="new-projects-start-templates-edit">
+ <primary>project</primary>
+ <secondary>templates</secondary>
+ <tertiary>edit</tertiary></indexterm>
+
+<para>
+The templates you set up in the <guilabel>Create New Project</guilabel> dialog will later be processed whenever you command &kdevelop; to set up a new source and/or header file. The information you provided here will be included at top as a documentation header, before the code parts begin.
+</para>
+<para>
+You are not restricted to plain text however. &kdevelop; knows of several variables which allow you to include actual information in the file. The &appwizard; did in fact use some such variables to insert the <guilabel>Author</guilabel>, <guilabel>Email</guilabel>, and <guilabel>License</guilabel> informations into the initial template text.
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Include &doxygen; File Information</term>
+<listitem>
+<para>
+If, for example, you want the &doxygen;-built &API; documentation to display some further information about the file's contents in its filenames list, you may include the following lines in the source file template:
+</para>
+<screen><computeroutput>
+/**
+ * \file $MODULE$.cpp
+ * \brief (put some short descripion here).
+ **/
+</computeroutput></screen>
+<para>
+Whenever you create a new source file, &kdevelop; will replace the <varname>$MODULE$</varname> variable by the name body of the newly created file. For example, if you created a new C++ class named <classname>ASimpleTest</classname> you will see the following lines in the <filename>asimpletest.cpp</filename> file:
+</para>
+<screen><computeroutput>
+/**
+ * \file asimpletest.cpp
+ * \brief (put some short descripion here).
+ **/
+</computeroutput></screen>
+<para>
+You will still have to provide the short description after the <quote>\brief</quote> keyword, but part of the job is automatically done for you.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>The License Text File</term>
+<listitem>
+<para>
+As another example you could include an explicit hint to the license text you want to use into the template. Use the <varname>$LICENSEFILE$</varname> variable for this and add for example this line:
+</para>
+
+<screen><computeroutput>
+// See $LICENSEFILE$ for the full license text.
+</computeroutput></screen>
+<para>
+The &appwizard; will replace the <varname>$LICENSEFILE$</varname> with the name of the file where the full license text is to be found, namely:
+</para>
+<screen><computeroutput>
+// See COPYING for the full license text.
+</computeroutput></screen>
+<para>
+for the <acronym>GPL</acronym> license, or
+</para>
+<screen><computeroutput>
+// See LICENSE.BSD for the full license text.
+</computeroutput></screen>
+<para>
+if you decided to put your application under the <acronym>BSD</acronym> license.
+</para>
+<para>
+Thee are of course more variables &kdevelop; knows of. See the <link linkend="newfiles-edittemplates">Editing the templates</link> section in the <link linkend="editing">Editing tools</link> chapter for what is possible.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<note><para>
+The templates you define here will come in effect only after the &appwizard; has created the new project. You will find this information on top of the files you created yourself in the development process. When creating the initial files the &appwizard; will use some predefined standard templates. You will have to manually adapt those initial files to your needs.
+</para></note>
+
+</sect3> <!-- new-projects-start-templates-edit -->
+</sect2> <!-- new-projects-start-templates -->
+
+<sect2 id="new-projects-start-build">
+<title>Build the Initial Project Files</title>
+
+<indexterm zone="new-projects-start-build">
+ <primary>project</primary>
+ <secondary>new</secondary>
+ <tertiary>build</tertiary></indexterm>
+<indexterm zone="new-projects-start-build">
+ <primary>project</primary>
+ <secondary>initial build</secondary></indexterm>
+
+<para>
+Almost everything is done now. On the last templates page the <guibutton>Next &gt;</guibutton> button will have changed to read <guibutton>Finish</guibutton> now.
+</para>
+<para>
+<emphasis>Think twice before you click on it!</emphasis> You still have the option to revise everything by repeatedly using the <guibutton>&lt; Back</guibutton> button. As the &appwizard; remembers all information you did input so far, it may be advisable for you to take the time and look back once again. In case you use local &CVS;, do not forget to double-check the <emphasis>&CVS; repository</emphasis> name (there should be no subdirectory with that name in the &CVS; root directory already&mdash;if it does, try another repository name).
+</para>
+<para>
+If ever you don't want the new project be built, abort the <guilabel>Create New Project</guilabel> dialog by the <guibutton>Cancel</guibutton> button. Otherwise click <guibutton>Finish</guibutton> and watch in the <guilabel>Messages</guilabel> window how the &appwizard; initiates the project.
+</para>
+<para>
+If you want to use a versioning system (&CVS;) there will be two runs actually. &appwizard; will first build the project directories and files and then call up the &CVS; program which restarts the <guilabel>Messages</guilabel> window with its own contents. If any error occurs in either of these runs, the process will stop showing you an according error message in the window.
+</para>
+
+<note><para>
+In many cases when your new project has been set up this way, &kdevelop; will automatically load the source file(s) of one or more basically important modules so you can readily start work. (Which source modules will be displayed&mdash;if any at all&mdash;however depends on the template initially selected in the &appwizard;.)
+</para></note>
+
+<para>
+Do not forget to initially check what the &appwizard; has provided. For example you may want to change the initial heading informations according to your own templates. Usually you will find these in a <filename class="directory">templates</filename> subdirectory in your project directory. Some simple copy operations will mostly suffice.
+</para>
+<para>
+Then it is advisable that you <emphasis>compile the initial project</emphasis> before you attempt to change any code. In most cases this initial compilation should be possible. Thus you can make up whether the project really was set up according to your needs. If it was not, simply remove the project directory (in your local &CVS; root as well if you use one) and start over again.
+</para>
+
+<warning id="defaultbuild-warning"> <!-- ### remove this when "default" works again -->
+
+ <indexterm zone="defaultbuild-warning">
+ <primary>default build configuration</primary>
+ <secondary>warning</secondary></indexterm>
+ <indexterm zone="defaultbuild-warning">
+ <primary>build configurations</primary>
+ <secondary>default build warning</secondary></indexterm>
+ <indexterm zone="defaultbuild-warning">
+ <primary>warning</primary>
+ <secondary>default build configuration</secondary></indexterm>
+
+ <para>
+ Before you compile your new project the first time, have a look at <menuchoice><guimenu>Project</guimenu> <guimenuitem>Build Configuration</guimenuitem></menuchoice>. If there are three selections displayed: <guimenuitem>default</guimenuitem>, <guimenuitem>optimized</guimenuitem>, and <guimenuitem>debug</guimenuitem>, with <guimenuitem>debug</guimenuitem> selected, by all means stick to this, or use <guimenuitem>optimized</guimenuitem> instead.
+ </para>
+ <para>
+ Due to some limitations in the current autoconf/automake setup you should <emphasis>by no means</emphasis> build in the <guimenuitem>default</guimenuitem> configuration. This will corrupt some internal directory settings, thus making <command>configure</command> complain when you try to use it in the <guimenuitem>optimized</guimenuitem>, or <guimenuitem>debug</guimenuitem> build configuration afterwards.
+ </para>
+ <para>
+ (This applies to these multiselection capabilities only. If the application type you selected provides a <guimenuitem>default</guimenuitem> build configuration only, you should of course use this one.)
+ </para>
+</warning>
+
+</sect2> <!-- new-projects-start-build -->
+
+</sect1> <!-- new-projects -->
+
+<sect1 id="projects-configure">
+<title>Configuring Projects</title>
+
+<para>(... to be written ...)</para>
+
+</sect1>
+
+</chapter> <!-- applicationwizard -->
diff --git a/doc/kdevelop/automake-file-popup.png b/doc/kdevelop/automake-file-popup.png
new file mode 100644
index 00000000..e40f7108
--- /dev/null
+++ b/doc/kdevelop/automake-file-popup.png
Binary files differ
diff --git a/doc/kdevelop/automake-manager.png b/doc/kdevelop/automake-manager.png
new file mode 100644
index 00000000..5e3a9907
--- /dev/null
+++ b/doc/kdevelop/automake-manager.png
Binary files differ
diff --git a/doc/kdevelop/automake-subproject-popup.png b/doc/kdevelop/automake-subproject-popup.png
new file mode 100644
index 00000000..e795be9b
--- /dev/null
+++ b/doc/kdevelop/automake-subproject-popup.png
Binary files differ
diff --git a/doc/kdevelop/automake-target-popup.png b/doc/kdevelop/automake-target-popup.png
new file mode 100644
index 00000000..a561e4cc
--- /dev/null
+++ b/doc/kdevelop/automake-target-popup.png
Binary files differ
diff --git a/doc/kdevelop/automakemanager.png b/doc/kdevelop/automakemanager.png
new file mode 100644
index 00000000..89891748
--- /dev/null
+++ b/doc/kdevelop/automakemanager.png
Binary files differ
diff --git a/doc/kdevelop/build-commands.png b/doc/kdevelop/build-commands.png
new file mode 100644
index 00000000..a6ed86e9
--- /dev/null
+++ b/doc/kdevelop/build-commands.png
Binary files differ
diff --git a/doc/kdevelop/build-configurations.png b/doc/kdevelop/build-configurations.png
new file mode 100644
index 00000000..6194255e
--- /dev/null
+++ b/doc/kdevelop/build-configurations.png
Binary files differ
diff --git a/doc/kdevelop/build-menu-automake.png b/doc/kdevelop/build-menu-automake.png
new file mode 100644
index 00000000..e468bb78
--- /dev/null
+++ b/doc/kdevelop/build-menu-automake.png
Binary files differ
diff --git a/doc/kdevelop/build-menu.png b/doc/kdevelop/build-menu.png
new file mode 100644
index 00000000..20353cb5
--- /dev/null
+++ b/doc/kdevelop/build-menu.png
Binary files differ
diff --git a/doc/kdevelop/class-browsers.docbook b/doc/kdevelop/class-browsers.docbook
new file mode 100644
index 00000000..7c251ee1
--- /dev/null
+++ b/doc/kdevelop/class-browsers.docbook
@@ -0,0 +1,90 @@
+<chapter id="class-browsers">
+<title>The Class Browsers</title>
+<indexterm zone="class-browsers"><primary>class browser</primary></indexterm>
+
+<para>
+When working on a project in an object-oriented language, your emphasis when
+working on a project is not on the source files and their names, but on the
+classes and their relationships. In order to help you navigating in the space
+of defined classes and symbols, &kdevelop; includes various class browsers
+that visualize the class structure in different ways.
+</para>
+
+<sect1 id="classview">
+<title>Class View</title>
+
+<para>
+This view is shown on the left side of the main window and contains a linear
+list of all classes, variables and functions in your project. It is designed
+as a tree view. If you open a class node by clicking on it, a list with all
+methods and attributes of the respective class is shown.
+</para>
+
+<figure id="screenshot-classview" float="1">
+<title>A Screenshot of the Class View</title>
+<mediaobject>
+<imageobject><imagedata fileref="classview.png"/></imageobject>
+</mediaobject>
+</figure>
+
+<para>
+The class view works in two different modes. By default, all symbols are
+grouped into <quote>Classes</quote>, <quote>Structs</quote>,
+<quote>Functions</quote>, <quote>Variables</quote> and
+<quote>Namespaces</quote>. In the context menu of the view, you can choose
+<guimenuitem>List by Namespaces</guimenuitem>. In this mode, the namespace
+hierarchy is shown and the symbols grouped into the respective namespace
+where they are defined. This may be more useful in projects which make heavy
+use of (nested) namespaces. It is less useful in projects without
+namespaces.
+</para>
+
+<para>
+You can also change the way in which class names are displayed. Normally, the
+names of the classes are shown, without the namespace in which they are defined.
+This means, you cannot immediately distinguish classes with the same name in
+different namespaces. If you rest for a while with the mouse over an item, the
+full scoped name is shown as a tooltip though. You can decide to always
+display the fully scoped class name by choosing
+<guimenuitem>Full Identifier scopes</guimenuitem> from the context menu.
+</para>
+
+<para>
+Clicking on a class or method in the class view brings you to its definition.
+You can also jump to the declaration of a method by choosing
+<guimenuitem>Go to declaration</guimenuitem> from the context menu. In the
+context menu for classes are also the items
+<guimenuitem>Add method...</guimenuitem> and
+<guimenuitem>Add attribute...</guimenuitem>. This opens dialogs where you can
+generate new method and variable declaration in the respective class, together
+with an empty implementation.
+</para>
+
+</sect1> <!-- classview -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="classtools">
+<title>Class Tools</title>
+
+<para>
+The class tool dialog is activated by right clicking on a class in the class
+view and choosing <guimenuitem>Class tool...</guimenuitem>.
+</para>
+
+</sect1> <!-- classtools -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="classhierarchy">
+<title>Class Hierarchy</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- classhierarchy -->
+
+</chapter> <!-- class-browsers -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/classview.png b/doc/kdevelop/classview.png
new file mode 100644
index 00000000..34e3707d
--- /dev/null
+++ b/doc/kdevelop/classview.png
Binary files differ
diff --git a/doc/kdevelop/commands.docbook b/doc/kdevelop/commands.docbook
new file mode 100644
index 00000000..31fff849
--- /dev/null
+++ b/doc/kdevelop/commands.docbook
@@ -0,0 +1,1989 @@
+<chapter id="commands">
+
+<!-- TODO
+- CAUTION: Check everything against actual KDevelp behaviour. Do not rely on tool tips etc.
+- Summarize menu entries, like in getting-started.
+- Complete descriptions, e.g. from What's This.
+- Link to more detailed description, e.g. in plugin chapter.
+-->
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Volker</firstname> <surname>Paul</surname></author>
+ <!-- TRANS:ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+
+ <date>2005-04-03</date>
+</chapterinfo>
+
+<title>Command Reference</title>
+
+<note><para>
+ The shortcut key combinations shown in this chapter are the default ones. They can be changed.
+</para></note>
+
+
+
+<sect1 id="menubar">
+<title>The Menubar</title> <para>Note that some menu entries only appear when
+they are applicable. Especially, some entries are linked to
+<link linkend="plugin-tools">plugin</link>
+functionality which is only available when the plugin is enabled.</para>
+
+
+
+
+
+
+<!-- ======================= F I L E ============================= -->
+
+<sect2 id="menu-file">
+<title>The <guimenu>File</guimenu> Menu</title>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>New</guimenuitem>
+</menuchoice></term>
+<listitem><para>Create a new file.
+The user is prompted to select the directory (default: the current project's
+source directory) and enter a file name. The file type can be selected from a list.
+Also, the user can choose whether the file is to be added to the project.
+Then the Automake Manager asks which target to add the new file to.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Open</guimenuitem>
+</menuchoice></term>
+<listitem><para>Open an existing file in a simple dialog
+box.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>O</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Open Recent</guimenuitem>
+</menuchoice></term>
+<listitem><para>Displays a submenu showing the files recently opened.
+Selecting one of these will make KDevelop open that file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>O</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Quick Open</guimenuitem>
+</menuchoice></term>
+<listitem><para>Presents a list of files in the current project's
+source directory. The user can select from this list
+or type a filename. That file is then opened.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Save</guimenuitem>
+</menuchoice></term>
+<listitem><para>Saves the current file.</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Save As...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Uses the
+<guilabel>Save As...</guilabel> dialog box to let you save a copy
+under a new name.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Save All</guimenuitem>
+</menuchoice></term>
+<listitem><para>Saves all open files.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycap>F5</keycap></shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Reload</guimenuitem>
+</menuchoice></term>
+<listitem><para>Reloads current file to show changes
+made by different programs.
+(Note that such changes are normally detected automatically
+and the user is prompted whether the file is to be reloaded.)
+.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Revert all</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Reverts all changes in opened files.
+Prompts to save changes so the
+reversion can be canceled for each
+modified file.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>P</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Print...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Print.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Export</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Export
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>F4</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Close</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Closes current file.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Close All</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Closes all open files.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Close All Others</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Closes all files except the current one.
+Very useful if you opened a lot of files and you want
+to concentrate on the current one.
+Without this, you would have to close them all
+and re-open the current one.
+</para>
+<para>Note there is a similar command in the Window menu.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Quit</guimenuitem>
+</menuchoice></term>
+<listitem><para>Close KDevelop.</para></listitem>
+</varlistentry>
+
+</variablelist>
+
+</sect2>
+
+
+
+<!-- ======================= E D I T ============================= -->
+
+
+<sect2 id="menu-edit">
+<title>The <guimenu>Edit</guimenu> Menu</title>
+
+
+<variablelist>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Z</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Undo</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Undo
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>Z</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Redo</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Redo
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>X</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Cut</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Cut
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>C</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Copy</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Copy
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>V</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Paste</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Paste
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>A</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Select All</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Select All
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>A</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Deselect</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Deselect
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>B</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Block Selection Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Block Selection Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>Insert</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Overwrite Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Overwrite Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Find
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F3</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find Next</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Find Next
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>F3</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find Previous</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Find Previous
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Replace</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Replace
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>G</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Go to Line</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Go to Line
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>F</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find in Files</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Find in Files
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>R</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Find-Select-Replace</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Find-Select-Replace
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Edit</guimenu>
+<guimenuitem>Reformat Source</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Reformat Source
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>J</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Expand Text</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Expand Text
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>L</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Expand Abbreviation</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Expand Abbreviation
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Space</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Complete Text</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Complete Text
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F2</keycap></keycombo>
+</shortcut>
+<guimenu>Edit</guimenu>
+<guimenuitem>Make Member</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Make Member
+</para></listitem>
+</varlistentry>
+
+
+</variablelist>
+
+</sect2>
+
+
+
+<!-- ======================= V I E W ============================= -->
+
+
+<sect2 id="menu-view">
+
+<title>The <guimenu>View</guimenu> Menu</title>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Back</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Back
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Forward</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Forward
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>/</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Switch to...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Switch to...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>C</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Raise Editor</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Raise Editor
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F4</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Next Error</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Next Error
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>F4</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Previous Error</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Previous Error
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>F</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Full Screen Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Full Screen Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>F12</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Switch Header/Implementation</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Switch Header/Implementation
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Tool Views</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Tool Views
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Tool Docks</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Tool Docks
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F7</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Switch to Command Line</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Switch to Command Line
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Schema</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Schema
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F10</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Dynamic Word Wrap</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Dynamic Word Wrap
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Dynamic Word Wrap Indicators</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Dynamic Word Wrap Indicators
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Show/Hide Static Word Wrap Marker</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Show/Hide Static Word Wrap Marker
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F6</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Show/Hide Icon Border</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Show/Hide Icon Border
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F11</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Show/Hide Line Numbers</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Show/Hide Line Numbers
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Show/Hide Scrollbar Marks</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Show/Hide Scrollbar Marks
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F9</keycap></keycombo>
+</shortcut>
+<guimenu>View</guimenu>
+<guimenuitem>Show/Hide Folding Marks</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Show/Hide Folding Marks
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Code Folding</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Code Folding
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>View</guimenu>
+<guimenuitem>Set Encoding</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Set Encoding
+</para></listitem>
+</varlistentry>
+
+
+
+</variablelist>
+
+</sect2>
+
+
+
+
+<!-- ======================= P R O J E C T ============================= -->
+
+
+<sect2 id="menu-project">
+<title>The <guimenu>Project</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>New Project...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+New Project...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Open Project...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Open Project...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Open Recent Project</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Open Recent Project
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Active Language</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Active Language
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Import Existing Project...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Import Existing Project...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>New Class...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+New Class...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Class Inheritance Diagram</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Class Inheritance Diagram
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Add Translation...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Add Translation...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Build Configuration</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Build Configuration
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Distribution &amp; Publishing</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Distribution &amp; Publishing
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Project Options...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Project Options...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Project</guimenu>
+<guimenuitem>Close Project</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Close Project
+</para></listitem>
+</varlistentry>
+
+
+
+
+</variablelist>
+
+</sect2>
+
+
+<!-- ======================= B U I L D ============================= -->
+
+
+<sect2 id="menu-build">
+<title>The <guimenu>Project</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F8</keycap></keycombo>
+</shortcut>
+<guimenu>Build</guimenu>
+<guimenuitem>Build Project</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Build Project
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>F7</keycap></keycombo>
+</shortcut>
+<guimenu>Build</guimenu>
+<guimenuitem>Build Active Target</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Build Active Target
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Compile File</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Compile File
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Run Configure</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Run Configure
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Run automake &amp; friends</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Run automake &amp; friends
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Install</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Install
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Install (as root user)</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Install (as root user)
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Clean project</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Clean project
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Distclean</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Distclean
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Shift;<keycap>F9</keycap></keycombo>
+</shortcut>
+<guimenu>Build</guimenu>
+<guimenuitem>Make Messages &amp; Merge</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Make Messages &amp; Merge
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Execute Program</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Execute Program
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Build API Documentation</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Build API Documentation
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Build</guimenu>
+<guimenuitem>Clean API Documentation</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Clean API Documentation
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul"><keycap>Escape</keycap></keycombo>
+</shortcut>
+<guimenu>Build</guimenu>
+<guimenuitem>Stop</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Stop
+</para></listitem>
+</varlistentry>
+
+
+
+
+</variablelist>
+
+</sect2>
+
+
+
+<!-- ======================= D E B U G ============================= -->
+
+
+<sect2 id="menu-debug">
+<title>The <guimenu>Project</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Start</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Start
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Stop</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Stop
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Interrupt</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Interrupt
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Run to Cursor</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Run to Cursor
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Step Over</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Step Over
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Step over Instruction</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Step over Instruction
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Step Into</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Step Into
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Step into Instruction</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Step into Instruction
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Step Out</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Step Out
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Toggle Breakpoint</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Toggle Breakpoint
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Viewers</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Viewers
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Examine Core File...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Examine Core File...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Attach to Process</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Attach to Process
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Valgrind Memory Leak Check</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Valgrind Memory Leak Check
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Debug</guimenu>
+<guimenuitem>Profile with KCachegrind</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Profile with KCachegrind
+</para></listitem>
+</varlistentry>
+
+
+
+
+</variablelist>
+
+</sect2>
+
+
+
+
+
+<!-- ======================= B O O K M A R K S ============================= -->
+
+
+
+<sect2 id="menu-bookmarks">
+<title>The <guimenu>Bookmarks</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo>
+</shortcut>
+<guimenu>Bookmarks</guimenu>
+<guimenuitem>Set Bookmark</guimenuitem>
+</menuchoice></term>
+<listitem><para>Add current selection to your
+bookmarks.</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Bookmarks</guimenu>
+<guimenuitem>Clear All Bookmarks</guimenuitem>
+</menuchoice></term>
+<listitem><para>Clear All Bookmarks.</para></listitem>
+</varlistentry>
+</variablelist>
+
+</sect2>
+
+
+
+
+<!-- ======================= W I N D O W ============================= -->
+
+
+<sect2 id="menu-window">
+<title>The <guimenu>Window</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;<keycap>W</keycap></keycombo></shortcut>
+<guimenu>Window</guimenu>
+<guimenuitem>Close Selected Windows...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Close Selected Windows...</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>F4</keycap></keycombo></shortcut>
+<guimenu>Window</guimenu>
+<guimenuitem>Close</guimenuitem>
+</menuchoice></term>
+<listitem><para>Close</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Window</guimenu>
+<guimenuitem>Close All</guimenuitem>
+</menuchoice></term>
+<listitem><para>Close All</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Window</guimenu>
+<guimenuitem>Close All Others</guimenuitem>
+</menuchoice></term>
+<listitem><para>Close All Others</para></listitem>
+</varlistentry>
+
+
+</variablelist>
+
+</sect2>
+
+
+
+
+
+
+<!-- ======================= T O O L S ============================= -->
+
+
+<sect2 id="menu-tools">
+<title>The <guimenu>Tools</guimenu> Menu</title>
+
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Read Only Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Read Only Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Filetype Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Filetype Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Highlight Mode</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Highlight Mode
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>End of Line</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+End of Line
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Spelling</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Spelling
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>I</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Indent</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Indent
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>I</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>unindent</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+unindent
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Clean Indentation</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Clean Indentation
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Tab</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Align</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Align
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>D</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Comment</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Comment
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>D</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Uncomment</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Uncomment
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>U</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Uppercase</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Uppercase
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>U</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Lowercase</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Lowercase
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>U</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Capitalize</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Capitalize
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>J</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Join Lines</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Join Lines
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Word Wrap Document</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Word Wrap Document
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Difference Viewer...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Difference Viewer...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Execute Command...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Execute Command...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Filter Selection Through Command...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Filters selection through external command using
+<link linkend="KDevFilter">the Filter plugin</link>.
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Debug Regular Expression...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Debug Regular Expression...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Tools</guimenu>
+<guimenuitem>Part Explorer</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Part Explorer
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>C</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Quick Open Class...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Quick Open Class...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>M</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Quick Open Method...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Quick Open Method...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>P</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Preview Doxygen Output</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Preview Doxygen Output
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;&Shift;<keycap>S</keycap></keycombo>
+</shortcut>
+<guimenu>Tools</guimenu>
+<guimenuitem>Document Current Function</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Document Current Function
+</para></listitem>
+</varlistentry>
+
+
+
+</variablelist>
+
+</sect2>
+
+
+
+
+<!-- ======================= S E T T I N G S ============================= -->
+
+
+<sect2 id="menu-settings">
+<title>The <guimenu>Settings</guimenu> Menu</title>
+
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>M</keycap></keycombo></shortcut>
+<guimenu>Settings</guimenu>
+<guimenuitem>Show/Hide Menubar</guimenuitem>
+</menuchoice></term>
+<listitem><para>Show/Hide the menubar.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Toolbars</guimenuitem>
+</menuchoice></term>
+<listitem><para>Opens a sub menu where you can choose to show or hide
+the various Toolbars.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Show Statusbar</guimenuitem>
+</menuchoice></term>
+<listitem><para>Show the Statusbar.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Configure Shortcuts...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Configure Shortcuts...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Configure Toolbar...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Configure Toolbar...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Configure Notifications...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Configure Notifications...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Configure Editor...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Configure Editor...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Settings</guimenu>
+<guimenuitem>Configure KDevelop...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Configure KDevelop...
+</para></listitem>
+</varlistentry>
+
+
+
+
+</variablelist>
+
+</sect2>
+
+
+<!-- ======================= H E L P ============================= -->
+
+
+<sect2 id="menu-help">
+<title>The <guimenu>Help</guimenu> Menu</title>
+
+<variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>KDevelop Handbook</guimenuitem>
+</menuchoice></term>
+<listitem><para>View this document.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo
+ action="simul">&Shift;<keycap>F1</keycap></keycombo></shortcut>
+<guimenu>Help</guimenu>
+<guimenuitem>What's This?</guimenuitem>
+</menuchoice></term>
+<listitem><para>Draws a question mark (?) beside the mouse
+pointer, clicking on a window item such as the
+<guiicon>Stop</guiicon> button will then display a brief explanation.
+<!-- See
+<link linkend="bubble">Tooltips and What's This?</link>.-->
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>Tip of the Day</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Tip of the Day
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>I</keycap></keycombo>
+</shortcut>
+<guimenu>Help</guimenu>
+<guimenuitem>Look in Documentation Index...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Look in Documentation Index...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Alt;&Ctrl;<keycap>S</keycap></keycombo>
+</shortcut>
+<guimenu>Help</guimenu>
+<guimenuitem>Search in Documentation...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Search in Documentation...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>Man Page...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Man Page...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>Info Page...</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Info Page...
+</para></listitem>
+</varlistentry>
+
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>Report Bug...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Report bug.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>About KDevelop...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Display some brief information about
+KDevelop's version number, authors and license agreement.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Help</guimenu>
+<guimenuitem>About KDE...</guimenuitem>
+</menuchoice></term>
+<listitem><para>Show some information about the version of &kde; that
+you are running.</para></listitem>
+</varlistentry>
+
+</variablelist>
+
+</sect2>
+
+
+
+</sect1>
+
+
+
+
+</chapter>
diff --git a/doc/kdevelop/configure-adddialog-baselibs.png b/doc/kdevelop/configure-adddialog-baselibs.png
new file mode 100644
index 00000000..6d97097c
--- /dev/null
+++ b/doc/kdevelop/configure-adddialog-baselibs.png
Binary files differ
diff --git a/doc/kdevelop/configure-adddialog-qt.png b/doc/kdevelop/configure-adddialog-qt.png
new file mode 100644
index 00000000..3138d416
--- /dev/null
+++ b/doc/kdevelop/configure-adddialog-qt.png
Binary files differ
diff --git a/doc/kdevelop/configure-adddialog.png b/doc/kdevelop/configure-adddialog.png
new file mode 100644
index 00000000..6ebd62d5
--- /dev/null
+++ b/doc/kdevelop/configure-adddialog.png
Binary files differ
diff --git a/doc/kdevelop/configure-doctree-DevHelp.png b/doc/kdevelop/configure-doctree-DevHelp.png
new file mode 100644
index 00000000..0cf26aeb
--- /dev/null
+++ b/doc/kdevelop/configure-doctree-DevHelp.png
Binary files differ
diff --git a/doc/kdevelop/configure-doctree-TOC.png b/doc/kdevelop/configure-doctree-TOC.png
new file mode 100644
index 00000000..cec94cd6
--- /dev/null
+++ b/doc/kdevelop/configure-doctree-TOC.png
Binary files differ
diff --git a/doc/kdevelop/configure-doctree-bookmark.png b/doc/kdevelop/configure-doctree-bookmark.png
new file mode 100644
index 00000000..152ee605
--- /dev/null
+++ b/doc/kdevelop/configure-doctree-bookmark.png
Binary files differ
diff --git a/doc/kdevelop/configure-doctree-general.png b/doc/kdevelop/configure-doctree-general.png
new file mode 100644
index 00000000..abf8be8c
--- /dev/null
+++ b/doc/kdevelop/configure-doctree-general.png
Binary files differ
diff --git a/doc/kdevelop/configure-doctree-textsearch.png b/doc/kdevelop/configure-doctree-textsearch.png
new file mode 100644
index 00000000..680f5137
--- /dev/null
+++ b/doc/kdevelop/configure-doctree-textsearch.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-chm.png b/doc/kdevelop/configure-docu-chm.png
new file mode 100644
index 00000000..6456580a
--- /dev/null
+++ b/doc/kdevelop/configure-docu-chm.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-custom.png b/doc/kdevelop/configure-docu-custom.png
new file mode 100644
index 00000000..25e3bb6d
--- /dev/null
+++ b/doc/kdevelop/configure-docu-custom.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-devhelp.png b/doc/kdevelop/configure-docu-devhelp.png
new file mode 100644
index 00000000..b7db6634
--- /dev/null
+++ b/doc/kdevelop/configure-docu-devhelp.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-dox.png b/doc/kdevelop/configure-docu-dox.png
new file mode 100644
index 00000000..916e32b8
--- /dev/null
+++ b/doc/kdevelop/configure-docu-dox.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-edit.png b/doc/kdevelop/configure-docu-edit.png
new file mode 100644
index 00000000..bc904327
--- /dev/null
+++ b/doc/kdevelop/configure-docu-edit.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-general.png b/doc/kdevelop/configure-docu-general.png
new file mode 100644
index 00000000..0feaef99
--- /dev/null
+++ b/doc/kdevelop/configure-docu-general.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-indexgen.png b/doc/kdevelop/configure-docu-indexgen.png
new file mode 100644
index 00000000..4315b6c3
--- /dev/null
+++ b/doc/kdevelop/configure-docu-indexgen.png
Binary files differ
diff --git a/doc/kdevelop/configure-docu-toc.png b/doc/kdevelop/configure-docu-toc.png
new file mode 100644
index 00000000..5f5bfb65
--- /dev/null
+++ b/doc/kdevelop/configure-docu-toc.png
Binary files differ
diff --git a/doc/kdevelop/configure-editor.png b/doc/kdevelop/configure-editor.png
new file mode 100644
index 00000000..2e4b80fa
--- /dev/null
+++ b/doc/kdevelop/configure-editor.png
Binary files differ
diff --git a/doc/kdevelop/configure-file-selector.png b/doc/kdevelop/configure-file-selector.png
new file mode 100644
index 00000000..7ddcb044
--- /dev/null
+++ b/doc/kdevelop/configure-file-selector.png
Binary files differ
diff --git a/doc/kdevelop/configure-file-templates.png b/doc/kdevelop/configure-file-templates.png
new file mode 100644
index 00000000..b49fbc77
--- /dev/null
+++ b/doc/kdevelop/configure-file-templates.png
Binary files differ
diff --git a/doc/kdevelop/configure-general.png b/doc/kdevelop/configure-general.png
new file mode 100644
index 00000000..b8c7268c
--- /dev/null
+++ b/doc/kdevelop/configure-general.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-buildconfig.png b/doc/kdevelop/configure-project-buildconfig.png
new file mode 100644
index 00000000..a0236cd8
--- /dev/null
+++ b/doc/kdevelop/configure-project-buildconfig.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-configure.png b/doc/kdevelop/configure-project-configure.png
new file mode 100644
index 00000000..c918a48b
--- /dev/null
+++ b/doc/kdevelop/configure-project-configure.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-cpp.png b/doc/kdevelop/configure-project-cpp.png
new file mode 100644
index 00000000..7d29091c
--- /dev/null
+++ b/doc/kdevelop/configure-project-cpp.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-cppoptions.png b/doc/kdevelop/configure-project-cppoptions.png
new file mode 100644
index 00000000..2f51ec88
--- /dev/null
+++ b/doc/kdevelop/configure-project-cppoptions.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-doc.png b/doc/kdevelop/configure-project-doc.png
new file mode 100644
index 00000000..05b29e6d
--- /dev/null
+++ b/doc/kdevelop/configure-project-doc.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-make.png b/doc/kdevelop/configure-project-make.png
new file mode 100644
index 00000000..17b5f426
--- /dev/null
+++ b/doc/kdevelop/configure-project-make.png
Binary files differ
diff --git a/doc/kdevelop/configure-project-run.png b/doc/kdevelop/configure-project-run.png
new file mode 100644
index 00000000..6bbef8c6
--- /dev/null
+++ b/doc/kdevelop/configure-project-run.png
Binary files differ
diff --git a/doc/kdevelop/configure-select.png b/doc/kdevelop/configure-select.png
new file mode 100644
index 00000000..1c272a65
--- /dev/null
+++ b/doc/kdevelop/configure-select.png
Binary files differ
diff --git a/doc/kdevelop/configure-snippets.png b/doc/kdevelop/configure-snippets.png
new file mode 100644
index 00000000..64a2ca00
--- /dev/null
+++ b/doc/kdevelop/configure-snippets.png
Binary files differ
diff --git a/doc/kdevelop/create-new-project-cvs.png b/doc/kdevelop/create-new-project-cvs.png
new file mode 100644
index 00000000..a4955ae5
--- /dev/null
+++ b/doc/kdevelop/create-new-project-cvs.png
Binary files differ
diff --git a/doc/kdevelop/create-new-project.png b/doc/kdevelop/create-new-project.png
new file mode 100644
index 00000000..140d5ebb
--- /dev/null
+++ b/doc/kdevelop/create-new-project.png
Binary files differ
diff --git a/doc/kdevelop/createnewproject.png b/doc/kdevelop/createnewproject.png
new file mode 100644
index 00000000..965a14d1
--- /dev/null
+++ b/doc/kdevelop/createnewproject.png
Binary files differ
diff --git a/doc/kdevelop/createnewprojectoptions.png b/doc/kdevelop/createnewprojectoptions.png
new file mode 100644
index 00000000..1d515bc3
--- /dev/null
+++ b/doc/kdevelop/createnewprojectoptions.png
Binary files differ
diff --git a/doc/kdevelop/credits.docbook b/doc/kdevelop/credits.docbook
new file mode 100644
index 00000000..77712cc4
--- /dev/null
+++ b/doc/kdevelop/credits.docbook
@@ -0,0 +1,24 @@
+<chapter id="credits">
+<title>Credits</title>
+
+<sect1 id="credits-contributions">
+<title>Contributions</title>
+
+<para>
+<itemizedlist>
+ <listitem><para>
+ The initial contents of this manual were witten by Bernd Gehrmann <email>bernd@kdevelop.org</email> and Caleb Tennis <email>caleb@aei-tech.com</email>.
+ </para></listitem>
+ <listitem><para>
+ The <link linkend="automake-manager-summary">Summary of &automanag;</link> and <link linkend="automake-manager-operation">Automake Manager Operation</link> chapters were written by Ian Wadham, <email>ianw@netspace.net.au</email>).
+ </para></listitem>
+</itemizedlist>
+</para>
+
+</sect1> <!-- credits-contributions -->
+
+<!--CREDITS_FOR_TRANSLATORS-->
+
+</chapter> <!-- credits -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/cvs.docbook b/doc/kdevelop/cvs.docbook
new file mode 100644
index 00000000..ccdce4e6
--- /dev/null
+++ b/doc/kdevelop/cvs.docbook
@@ -0,0 +1,139 @@
+<chapter id="cvs">
+<title>Using &CVS;</title>
+<indexterm zone="cvs"><primary>CVS</primary></indexterm>
+<indexterm zone="cvs"><primary>revision control</primary></indexterm>
+
+<sect1 id="cvs-basics">
+<title>&CVS; Basics</title>
+
+<para>
+&CVS; is the revision control system which many open source projects -
+including &kde; &mdash; are using. It stores all sources codes in a central place,
+called the <emphasis>repository</emphasis>. From the repository, developers
+can check out a current version of the project or snapshots of it at arbitrary
+points of time. In contrast to some other revision control systems, it is not
+necessary to <emphasis>lock</emphasis> files one wants to work on. So
+development can be highly parallelized.
+</para>
+
+<para>
+Whenever a developer has finished a task, he <emphasis>commits</emphasis> his
+code (accompanied by a log message). &CVS; takes the job to merge the changes
+made by several developers. It can of course happen that developers work on
+the same piece of code, resulting in a conflicting set of changes (in practice
+this occurs seldom, and is often a sign of a lack of communication). In this
+case &CVS; rejects a commit; only after all conflicts are resolved, a file can
+be committed.
+</para>
+
+<para>
+So far, this has been a description of the basic features of &CVS; one usually
+has to cope with. But &CVS; can provide a lot more: One can maintain several
+branches of a project (&eg; &kde; 1.1.2 and &kde; 2 were branches in &kde;'s
+development tree), merge changes from one branch to another, ask for
+differences between revisions, the revision history of files &etc;
+</para>
+
+<para>
+&CVS; is implemented as a client-server system. As a user, all communication
+with the repository goes through the command line program &cvs;. A higher
+level user interface is available through frontends like &cervisia; (<ulink
+url="http://cervisia.sf.net"/>) or <application>TkCVS</application> (<ulink
+url="http://tkcvs.sf.net"/>). In &kdevelop;, only a small part of the &cvs;
+functionality which is important for your daily work can be used directly.
+</para>
+
+<para>
+Basic knowledge of &CVS; usage is assumed. In particular, you should know
+how to checkout a given project from the repository. We recommend the
+book <quote>Open Source Development With &CVS;</quote> by Karl Fogel which is freely
+distributed (except for the non-technical chapters). See
+<ulink url="http://cvsbook.red-bean.com/cvsbook.html"/>.
+</para>
+
+</sect1> <!-- cvs-basics -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="cvs-commands">
+<title>&CVS; Commands in &kdevelop;</title>
+
+<para>
+In the file views, the following context menu items are available:
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Add to Repository</term>
+<listitem>
+<para>Prepares the marked file for addition to the repository. The file
+is transferred to the repository when you commit it (or the containing
+directory) the next time.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Remove from Repository</term>
+<listitem>
+<para>
+Prepares a file for removal from the repository. This also deletes
+the file on the local file system, so use this feature with care!
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Update</term>
+<listitem>
+<para>
+Runs <command>cvs update</command> to merge any changes from other
+users into your working directory. When you use this menu item over
+a directory, the update normally happens recursively, except if you
+have disabled this in the configuration file <filename>.cvsrc</filename>.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Commit</term>
+<listitem>
+<para>
+Runs <command>cvs commit</command> to upload any locally made changes
+to the repository. Note that you should update before doing this.
+Otherwise, when another user has committed his own changes before,
+&CVS; may give you an error message.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<para>
+All these commands are invoked as subprocesses by &kdevelop; without any
+further command line options or environment variables. This may be a
+problem when the connection with the &CVS; server goes through a
+&ssh; connection and requires that you enter your password each time
+you commit or update. This is for instance necessary when your project is
+hosted on <filename>sourceforge.net</filename>. Workarounds for this
+problem are described on the &CVS;/SSH FAQ which you can find in the
+SourceForge documentation.
+</para>
+
+</sect1> <!-- cvs-basics -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="cvs-behind">
+<title>Behind the Scenes</title>
+
+<sect2 id="cvs-behind-workdir">
+<title>What &CVS; Records in the Working Directory</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- cvs-behind-workdir -->
+
+</sect1> <!-- cvs-behind -->
+
+</chapter> <!-- cvs -->
diff --git a/doc/kdevelop/debugger.docbook b/doc/kdevelop/debugger.docbook
new file mode 100644
index 00000000..a06f2c83
--- /dev/null
+++ b/doc/kdevelop/debugger.docbook
@@ -0,0 +1,242 @@
+<chapter id="debugger">
+<title>The Debugger Interface</title>
+<indexterm zone="debugger"><primary>debugger</primary></indexterm>
+
+<para>
+For C and C++, &kdevelop; contains an internal debugger that is directly
+integrated with the editor. Technically, it is implemented as a frontend
+that uses the portable &GNU; debugger <application>gdb</application> through
+a pipe. The debugger can be started in several ways:
+</para>
+
+<itemizedlist>
+<listitem>
+<para>
+With <menuchoice><guimenu>Debug</guimenu><guimenuitem>Start</guimenuitem></menuchoice>,
+the main program of your project is loaded into the debugger.
+</para>
+</listitem>
+
+<listitem>
+<para>
+Using <menuchoice><guimenu>Debug</guimenu>
+<guimenuitem>Start (other)</guimenuitem>
+<guimenuitem>Examine core file</guimenuitem></menuchoice> you load a core file
+into memory, which is generated by the operating system kernel when the
+program has crashed (The generation of core files may be switched off on your
+system, see <application>ulimit(1)</application>). This is useful for a
+post-mortem analysis of a program.
+</para>
+</listitem>
+
+<listitem>
+<para>
+With <menuchoice><guimenu>Debug</guimenu>
+<guimenuitem>Start (other)</guimenuitem>
+<guimenuitem>Attach to process</guimenuitem></menuchoice> you invoke the
+debugger on an already running program. You will be shown a
+process list where you can select the process which the debugger
+should take over.
+</para>
+</listitem>
+
+<listitem>
+<para>
+Note that debugging is only possible if your project has been compiled with
+debugging information enabled. It can be activated in the
+<guibutton>Compiler options</guibutton> dialog. When this option is switched
+on, the compiler generates additional data which allows the debugger to
+associate file names and line numbers with addresses in the executable.
+</para>
+</listitem>
+</itemizedlist>
+
+<para>
+The debugger frontend offers several views <quote>into</quote> the process:
+</para>
+
+<para>If you try to debug a project without debugging information, you get
+the message <computeroutput>No source...</computeroutput> in the status
+bar.If you try to set a breakpoint, it is shown as <computeroutput>Pending
+(add)</computeroutput> in the breakpoint window (see below).
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Variables</term>
+<listitem>
+<indexterm zone="debugger"><primary>watch variables</primary></indexterm>
+<para>
+This window lists the values of all local variables at the current execution
+point of the program. It covers the variables in the complete call stack,
+&ie; the function where the process was interrupted, the function that called
+this function, and so on up to <function>main()</function> function.
+</para>
+
+<para>
+Another branch in the variables contains watch variables. You can configure
+yourself which variables are shown here. Both local and global variables can
+be watched. You can add variables either by clicking on the
+<guibutton>Add</guibutton> button or pressing <keycap>Return</keycap> while
+the <guilabel>Watch</guilabel> item is selected. They can be removed again
+via the context menu.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Frame Stack</term>
+<listitem>
+<indexterm zone="debugger"><primary>frame stack</primary></indexterm>
+<para>
+(... to be written ...)
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Breakpoints</term>
+<listitem>
+<indexterm zone="debugger"><primary>breakpoints</primary></indexterm>
+<para>
+This window allows you to see and manipulate the breakpoints. Remember that
+&kdevelop; uses <application>GDB</application>, so to fully understand the
+&kdevelop; debugging features, you should know a little bit about the <ulink
+url="http://www.gnu.org/software/gdb">GDB</ulink>.
+</para>
+
+<para>If you want to look at the source code, breakpoints are defined in
+<filename>kdevelop/languages/cpp/debugger/breakpoint.h</filename>.
+</para>
+
+<para>At the left edge, the window has buttons to:</para>
+
+<itemizedlist>
+<listitem><para>Add an empty breakpoint</para></listitem>
+<listitem><para>Edit the selected breakpoint</para></listitem>
+ <listitem><para>Delete the selected breakpoint</para></listitem>
+<listitem><para>Remove all breakpoints</para></listitem>
+</itemizedlist>
+
+<para>The main part of the window is a table with 7 columns. Each line in
+the table is a breakpoint. The columns are:</para>
+
+<orderedlist>
+<listitem><para>Selection checkbox</para></listitem>
+<listitem><para>Type: one of: Invalid, File:Line, Watchpoint, Address, Function</para></listitem>
+<listitem><para>Status. Values are:</para>
+<itemizedlist>
+ <listitem><para>Active</para></listitem>
+ <listitem><para>Disabled: Each breakpoint may be <quote>enabled</quote> or
+ <quote>disabled</quote>; if disabled, it has no effect on your program until
+ you enable it again.</para></listitem>
+ <listitem><para>Pending (add): a breakpoint is marked like this if no
+ debugging information is available. From GDB Info page:
+ <blockquote><para>If a specified breakpoint location cannot be found, it may be due to
+ the fact that the location is in a shared library that is yet to be
+ loaded. In such a case, you may want GDB to create a special
+ breakpoint (known as a <quote>pending breakpoint</quote>) that attempts to resolve
+ itself in the future when an appropriate shared library gets loaded.</para>
+ </blockquote>
+ </para></listitem>
+</itemizedlist>
+</listitem>
+<listitem><para>Pending (clear)</para></listitem>
+<listitem><para>Pending (modify)</para></listitem>
+<listitem><para>Location in the format filename:linenumber</para></listitem>
+<listitem><para>Condition</para></listitem>
+<listitem><para>Ignore Count: If this is a number <varname>COUNT</varname>
+greater than zero, the next <varname>COUNT</varname> times the breakpoint is
+reached, your program's execution does not stop; other than to decrement the
+ignore count, <application>gdb</application> takes no action.</para></listitem>
+<listitem><para>Hits: counts how many times a breakopint has been hit.</para></listitem>
+</orderedlist>
+
+
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Disassemble</term>
+<listitem>
+<indexterm zone="debugger"><primary>disassemble</primary></indexterm>
+<para>(... to be written ...)</para>
+
+</listitem>
+</varlistentry>
+</variablelist>
+
+
+<sect1 id="settingbreakpoints">
+<title>Setting Breakpoints</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- settingbreakpoints -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id ="debuggeroptions">
+<title>Options</title>
+
+<variablelist>
+<varlistentry>
+<term>Display Mangled Names</term>
+<listitem>
+<indexterm zone="debugger"><primary>name mangling</primary></indexterm>
+<indexterm zone="debugger"><primary>mangling</primary><secondary>name</secondary></indexterm>
+
+<para>
+In C++, function names in the executable are <quote>mangled</quote>, &ie;
+the function names include information about the argument types. This is
+necessary in order to support overloading of functions. The mangling
+algorithm is not standardized and differs even between different versions of
+the &GNU; C++ compiler.
+</para>
+
+<para>
+In the disassembling window, normally unmangled names are displayed, so
+function signatures appear in the similar way as in the source code, so
+they are easily readable. Alternatively, you can decide to see mangled names.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Try Setting Breakpoints on Lib Load</term>
+<listitem>
+<indexterm zone="debugger"><primary>lazy breakpoints</primary></indexterm>
+<indexterm zone="debugger"><primary>breakpoints</primary><secondary>lazy</secondary></indexterm>
+
+<para>
+The debugger backend <application>gdb</application> does not allow to set
+breakpoints within code that is not currently loaded. In a highly modular
+application, where often code is only loaded on demand as a plugin (using
+the libc function <function>dlopen(3)</function>), this can be inconvenient.
+Therefore, &kdevelop; rolls its own support for breakpoints in shared
+libraries. If you set this option, it allows you to set breakpoints in
+libraries which are not loaded. Then, whenever <application>gdb</application>
+notifies that a library is loaded, &kdevelop; tries to set the pending
+breakpoints.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Enable Floating Toolbar</term>
+<listitem>
+<indexterm zone="debugger"><primary>debugger toolbar</primary></indexterm>
+<indexterm zone="debugger"><primary>toolbar</primary><secondary>debugger</secondary></indexterm>
+
+<para>
+(... to be written ...)
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect1> <!-- debuggeroptions -->
+
+</chapter> <!-- debugger -->
diff --git a/doc/kdevelop/doctree-add-bookmark.png b/doc/kdevelop/doctree-add-bookmark.png
new file mode 100644
index 00000000..090c93f9
--- /dev/null
+++ b/doc/kdevelop/doctree-add-bookmark.png
Binary files differ
diff --git a/doc/kdevelop/doctree-reduced.png b/doc/kdevelop/doctree-reduced.png
new file mode 100644
index 00000000..30c22e79
--- /dev/null
+++ b/doc/kdevelop/doctree-reduced.png
Binary files differ
diff --git a/doc/kdevelop/doctree.png b/doc/kdevelop/doctree.png
new file mode 100644
index 00000000..26264828
--- /dev/null
+++ b/doc/kdevelop/doctree.png
Binary files differ
diff --git a/doc/kdevelop/doctreeview.png b/doc/kdevelop/doctreeview.png
new file mode 100644
index 00000000..64031238
--- /dev/null
+++ b/doc/kdevelop/doctreeview.png
Binary files differ
diff --git a/doc/kdevelop/documentation.docbook b/doc/kdevelop/documentation.docbook
new file mode 100644
index 00000000..eed065b0
--- /dev/null
+++ b/doc/kdevelop/documentation.docbook
@@ -0,0 +1,57 @@
+<chapter id="documentation">
+<title>Documentation</title>
+
+<para>
+Documention unfortunately belongs to the most-overlooked programming
+issues. Yet, once properly set up and maintained internal and external
+documentation provides most valuable help.
+</para>
+
+<para>
+Documentation has multiple facets. There is
+<itemizedlist>
+ <listitem><para>
+ <emphasis>project internal documentation</emphasis>, mainly consisting of
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>comments</emphasis> in header/source files
+ </para></listitem>
+ <listitem><para>
+ <emphasis>internal &API; documentation</emphasis> of your project
+ generated from the program file by special tools, &eg; &doxygen;
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>project external documentation</emphasis>, comprising among others
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>external &API; documentation</emphasis> of &eg; common system libraries (&kde;, &Qt;, &etc;)
+ </para></listitem>
+ <listitem><para>
+ any other documentation (programming language manuals, general system information, how-to articles and the like)
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+</itemizedlist>
+</para>
+<para>
+All this documentation should be easily maintainable and ready at hand whenever you need it. &kdevelop; has provisions for just this.
+</para>
+
+<!-- ### doc browser, notes on internal documentation, how to profit from Doxygen -->
+
+<sect1 id="docbrowser">
+<title>The Documentation Browser</title>
+
+
+<figure id="screenshot-doctreeview" float="1">
+<title>A Screenshot of the Documentation Tree</title>
+<mediaobject>
+<imageobject><imagedata fileref="doctreeview.png"/></imageobject>
+</mediaobject>
+</figure>
+
+</sect1> <!-- docbrowser -->
+
+</chapter> <!-- documentation -->
diff --git a/doc/kdevelop/documents-contents.png b/doc/kdevelop/documents-contents.png
new file mode 100644
index 00000000..9adb1699
--- /dev/null
+++ b/doc/kdevelop/documents-contents.png
Binary files differ
diff --git a/doc/kdevelop/documents-search.png b/doc/kdevelop/documents-search.png
new file mode 100644
index 00000000..f1e23048
--- /dev/null
+++ b/doc/kdevelop/documents-search.png
Binary files differ
diff --git a/doc/kdevelop/edit-doctree-TOC-entry.png b/doc/kdevelop/edit-doctree-TOC-entry.png
new file mode 100644
index 00000000..f0d56685
--- /dev/null
+++ b/doc/kdevelop/edit-doctree-TOC-entry.png
Binary files differ
diff --git a/doc/kdevelop/editing.docbook b/doc/kdevelop/editing.docbook
new file mode 100644
index 00000000..54074bdb
--- /dev/null
+++ b/doc/kdevelop/editing.docbook
@@ -0,0 +1,401 @@
+<chapter id="editing">
+<title>Editing Tools</title>
+
+<sect1 id="editing-snippets">
+<title>Code Snippets</title>
+
+<itemizedlist>
+ <title>Features (preliminary overview)</title>
+ <listitem><para>
+ SnippetPart adds a tool-view which by default docks to the right
+ </para></listitem>
+ <listitem><para>
+ Adding, editing and removing of snippets is available via a popup-menu
+ </para></listitem>
+ <listitem><para>
+ Double-clicking a snippet form the list inserts it into to the active view at the current cursor position
+ </para></listitem>
+ <listitem><para>
+ Tool tips show the content of a snippet
+ </para></listitem>
+ <listitem><para>
+ Snippets are stored in the users home-directory, so every user can have his own snippets
+ </para></listitem>
+ <listitem><para>
+ Snippets can contain variables in the style of $<varname>VARNAME</varname>$. On using the snippet the user is prompted to enter replacement value for the variables
+ </para></listitem>
+</itemizedlist>
+</sect1> <!-- editing-snippets -->
+
+<sect1 id="keyboardmapping">
+<title>Keyboard Mapping</title>
+<indexterm zone="keyboardmapping"><primary>keybindings</primary></indexterm>
+
+<para>
+In the following, we will list the default keybindings of the
+default editor. You can configure them as you like (how?)
+</para>
+
+<informaltable>
+<tgroup cols="2">
+<tbody>
+
+<row><entry><para><keycap>
+ Left
+</keycap></para></entry>
+<entry><para>
+ Moves one character left
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Right
+</keycap></para></entry>
+<entry><para>
+ Moves one character right
+</para></entry></row>
+
+<row><entry><para><keycombo>
+&Ctrl;<keycap>
+ Left
+</keycap></keycombo></para></entry>
+<entry><para>
+ Moves one word left
+</para></entry></row>
+
+<row><entry><para><keycombo>
+&Ctrl;<keycap>
+ Right
+</keycap></keycombo></para></entry>
+<entry><para>
+ Moves one word right
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Up
+</keycap></para></entry>
+<entry><para>
+ Moves up one line
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Down
+</keycap></para></entry>
+<entry><para>
+ Moves down one line
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Page Up
+</keycap></para></entry>
+<entry><para>
+ Moves up one page
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Page Down
+</keycap></para></entry>
+<entry><para>
+ Moves down one page
+</para></entry></row>
+
+<row><entry><para><keycombo>&Ctrl;<keycap>
+ Page Down
+</keycap></keycombo></para></entry>
+<entry><para>
+ Moves to the beginning of the file
+</para></entry></row>
+
+<row><entry><para><keycombo>&Ctrl;
+<keycap>
+ Page Down
+</keycap></keycombo></para></entry>
+<entry><para>
+ Moves to the end of the file
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Home
+</keycap></para></entry>
+<entry><para>
+ Moves to the beginning of the line
+</para></entry></row>
+
+<row><entry><para><keycap>
+ End
+</keycap></para></entry>
+<entry><para>
+ Moves to the end of the line
+</para></entry></row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+<para>
+For all the keys above, the &Shift; key can be pressed additionally,
+to mark from the current cursor position to the one afterwards.
+</para>
+
+<informaltable>
+<tgroup cols="2">
+<tbody>
+
+<row><entry><para><keycap>
+ Backspace
+</keycap></para></entry>
+<entry><para>
+ Deletes one character left
+</para></entry></row>
+
+<row><entry><para><keycap>
+ Delete
+</keycap></para></entry>
+<entry><para>
+ Deletes the character under the cursor
+</para></entry></row>
+
+<row><entry><para><keycombo>
+&Ctrl;
+<keycap>
+ C
+</keycap></keycombo></para></entry>
+<entry><para>
+ Copies the selected text to the clipboard
+</para></entry></row>
+
+<row><entry><para><keycombo>&Ctrl;<keycap>
+ V
+</keycap></keycombo></para></entry>
+<entry><para>
+ Pastes the selected text from the clipboard
+</para></entry></row>
+
+<row><entry><para><keycombo>&Ctrl;<keycap>
+ X
+</keycap></keycombo></para></entry>
+<entry><para>
+ Deletes the selected text and puts it into the clipboard
+</para></entry></row>
+
+<row><entry><para><keycombo>&Ctrl;<keycap>
+ Z
+</keycap></keycombo></para></entry>
+<entry><para>
+ Undo
+</para></entry></row>
+
+<row><entry><para><keycombo>&Shift;&Ctrl;<keycap>
+ Z
+</keycap></keycombo></para></entry>
+<entry><para>
+Redo
+</para></entry></row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+</sect1> <!-- keyboardmapping -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="editing-reporter">
+<title>The Problem Reporter</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect1> <!-- editing-reporter -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="searchinggrepping">
+<title>Searching and Grepping</title>
+<indexterm zone="searchinggrepping"><primary>searching</primary></indexterm>
+<indexterm zone="searchinggrepping"><primary>finding</primary></indexterm>
+
+<sect2 id="searching">
+<title>Searching for Text</title>
+
+<para>
+<keycombo>&Ctrl;<keycap>F</keycap></keycombo>- Find
+<keycombo>&Ctrl;<keycap>R</keycap></keycombo>- Replace
+</para>
+
+</sect2> <!-- searching -->
+
+
+<sect2 id="isearch">
+<title>ISearch</title>
+<indexterm zone="isearch"><primary>isearch</primary></indexterm>
+<indexterm zone="isearch"><primary>incremental search</primary></indexterm>
+<indexterm zone="isearch"><primary>search</primary><secondary>incremental</secondary></indexterm>
+
+<para>
+The conventional search with <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find</guimenuitem></menuchoice> requires you to specify the full
+search term before starting. Most of the time, it is much faster to search
+incrementally. If you click into the edit field labeled
+<guilabel>ISearch</guilabel> in the toolbar, the search is performed as you
+type. You will find that often the desired term is already found after typing
+in 3 or 4 letters.
+</para>
+
+</sect2> <!-- isearch -->
+
+
+<sect2 id="grep">
+<title>Grep</title>
+<indexterm zone="grep"><primary>search</primary><secondary>in files</secondary></indexterm>
+
+<para>
+Both search mechanisms described above are restricted to searching within one
+source file. An additional tool which allows you to search through a (possibly
+large) number of files is available through the
+<guimenuitem>Search in Files...</guimenuitem> item in the
+<guimenu>Edit</guimenu> menu. It is basically a frontend for the
+&grep;(1) program.
+</para>
+
+<para>
+In the dialog, you can specify which files are searched. There is a number of
+wildcard patterns available in a combobox. In this way, you can easily
+restrict the find mechanism to header files. Furthermore, you specify a
+directory where the search is started. If you check the
+<guibutton>Recursive</guibutton> box, the search iterates through all
+directories in the hierarchy below this one.
+</para>
+
+<para>
+The search term is in general a regular expression following POSIX syntax.
+For example, you can use the term <literal>"\&lt;K.*"</literal> if you want to
+find all words which begin with the letter K. The following characters
+are interpreted in a special way:
+</para>
+
+<informaltable>
+<tgroup cols="2">
+<tbody>
+
+<row><entry>
+ <literal>.</literal>
+</entry><entry>
+ Matches any character
+</entry></row>
+<row><entry>
+ <literal>^</literal>
+</entry><entry>
+Matches the beginning of a line
+</entry></row>
+<row><entry>
+ <literal>$</literal>
+</entry><entry>
+ Matches the end of a line
+</entry></row>
+<row><entry>
+ <literal>\&lt;</literal>
+</entry><entry>
+ Matches the beginning of a word
+</entry></row>
+<row><entry>
+ <literal>\&gt;</literal>
+</entry><entry>
+ Matches the end of a word
+</entry></row>
+<row><entry>
+ <literal>?</literal>
+</entry><entry>
+ The preceding item matches less than once
+</entry></row>
+<row><entry>
+ <literal>*</literal>
+</entry><entry>
+ The preceding item is matched zero or more times
+</entry></row>
+<row><entry>
+ <literal>+</literal>
+</entry><entry>
+ The preceding item is matched once or more times
+</entry></row>
+<row><entry>
+ <literal>{n}</literal>
+</entry><entry>
+ The preceding item is matched exactly n times
+</entry></row>
+<row><entry>
+ <literal>{n,}</literal>
+</entry><entry>
+ The preceding item is matched n or more times
+</entry></row>
+<row><entry>
+ <literal>{,n}</literal>
+</entry><entry>
+ The preceding item matches less than n times
+</entry></row>
+<row><entry>
+ <literal>{n,m}</literal>
+</entry><entry>
+ The preceding item matches at least <literal>n</literal> times but less
+than <literal>m</literal> times
+</entry></row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+<para>
+Backreferences to bracketed subexpressions are also available by the notation
+<literal>\n</literal>.
+</para>
+
+<para>
+For C++ programmers, as special bonus there are some search templates
+available for typical patterns. These allow you to search for example
+all calls of member functions of a certain object.
+</para>
+
+<para>
+Once you start the search by clicking on the <guibutton>Search</guibutton>
+button, it will be performed by an external, asynchronous process. All found
+items will appear in the view called <guilabel>Grep</guilabel>. You can then
+jump to the found items by clicking on them. Note that grep scans the files
+as they stored in the file system. If you have modified versions of them in
+your editor, you may get some mismatches in the line number, or some found
+items will be invalid. You can avoid this by saving all files beforehand.
+</para>
+
+</sect2> <!-- grep -->
+
+</sect1> <!-- searchinggrepping -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="code-completion">
+<title>Code Completion</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect1> <!-- code-completion -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="newfiles">
+<title>Creating New Files and Classes</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect2 id="newfiles-edittemplates">
+<title>Editing the Templates</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- newfiles-edittemplates -->
+
+</sect1> <!-- newfiles -->
+
+</chapter> <!-- editing -->
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/editor-ctags-lookup.png b/doc/kdevelop/editor-ctags-lookup.png
new file mode 100644
index 00000000..f07a1348
--- /dev/null
+++ b/doc/kdevelop/editor-ctags-lookup.png
Binary files differ
diff --git a/doc/kdevelop/editor-ctags-menu.png b/doc/kdevelop/editor-ctags-menu.png
new file mode 100644
index 00000000..b128b69b
--- /dev/null
+++ b/doc/kdevelop/editor-ctags-menu.png
Binary files differ
diff --git a/doc/kdevelop/editor-ctags-regenerate.png b/doc/kdevelop/editor-ctags-regenerate.png
new file mode 100644
index 00000000..b29cb352
--- /dev/null
+++ b/doc/kdevelop/editor-ctags-regenerate.png
Binary files differ
diff --git a/doc/kdevelop/editor-find-menu.png b/doc/kdevelop/editor-find-menu.png
new file mode 100644
index 00000000..e71c6d00
--- /dev/null
+++ b/doc/kdevelop/editor-find-menu.png
Binary files differ
diff --git a/doc/kdevelop/editor-search-doc.png b/doc/kdevelop/editor-search-doc.png
new file mode 100644
index 00000000..ad91da28
--- /dev/null
+++ b/doc/kdevelop/editor-search-doc.png
Binary files differ
diff --git a/doc/kdevelop/editor-switch-header.png b/doc/kdevelop/editor-switch-header.png
new file mode 100644
index 00000000..76d95c29
--- /dev/null
+++ b/doc/kdevelop/editor-switch-header.png
Binary files differ
diff --git a/doc/kdevelop/empty-ide.png b/doc/kdevelop/empty-ide.png
new file mode 100644
index 00000000..3cf19981
--- /dev/null
+++ b/doc/kdevelop/empty-ide.png
Binary files differ
diff --git a/doc/kdevelop/file-browsers.docbook b/doc/kdevelop/file-browsers.docbook
new file mode 100644
index 00000000..f8b37735
--- /dev/null
+++ b/doc/kdevelop/file-browsers.docbook
@@ -0,0 +1,79 @@
+<chapter id="file-browsers">
+<title>The File Browsers</title>
+
+<para>
+On the left side of the main window, &kdevelop; can display various kinds of
+lists and trees for the selection of files:
+</para>
+
+<variablelist>
+<varlistentry>
+<term>File Tree</term>
+<listitem>
+<para>
+This shows a tree view of the file hierarchy below the project directory. If
+you click on a file, it is loaded into the editor. For files which do not
+contain text, &kdevelop; starts an application that can handle the respective
+MIME type.
+</para>
+
+<para>
+The file tree is regularly updated whenever something changes in the file
+system. For example, if you create new files or directories (even outside
+&kdevelop;), this is immediately reflected in the file list. On &Linux;,
+this feature makes use of the FAM library. On other operating systems or over
+NFS, the directories shown are polled in small intervals.
+</para>
+
+<para>
+The file tree hides files which are usually not interesting, like object
+files. In the <guimenuitem>Project options</guimenuitem> under
+<guibutton>File views</guibutton>, you can configure (as a comma separated
+list of wildcards) which patterns are used to filter out irrelevant files.
+</para>
+
+<para>
+Furthermore, you can decide to restrict the file tree to show only files which
+belong to the currently loaded project. This can be toggled by clicking with
+the right mouse button on the root item of the tree.
+</para>
+
+<figure id="screenshot-filetree" float="1">
+<title>A Screenshot of the File Tree</title>
+<mediaobject>
+<imageobject><imagedata fileref="filetree.png"/></imageobject>
+<textobject><phrase>A Screenshot of the File Tree</phrase></textobject>
+</mediaobject>
+</figure>
+
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>File Groups</term>
+<listitem>
+<para>
+This shows the files belonging to the project, grouped by their file name
+extension. As in the file tree, you can edit a file by clicking on it
+with the &LMB;.
+</para>
+
+<para>
+The groups shown in this view can be configured under
+<guibutton>File views</guibutton> in the
+<guimenuitem>Project options</guimenuitem> dialog. In order to customize the
+view to your needs, it is helpful to understand how files are distributed on
+the groups. For each file, &kdevelop; goes through all groups from top to
+bottom. In each group, it looks whether the file name matches one of the
+patterns. If there is a match, the file is shown in this group and the
+iteration is aborted. This makes it clear that more general patterns should
+be put below more specific ones. For example, an asterisk for the
+<guilabel>Other</guilabel> group should be the last pattern.
+</para>
+
+</listitem>
+</varlistentry>
+</variablelist>
+
+</chapter> <!-- file-browsers -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/file-list-close-selected.png b/doc/kdevelop/file-list-close-selected.png
new file mode 100644
index 00000000..18ff8b9b
--- /dev/null
+++ b/doc/kdevelop/file-list-close-selected.png
Binary files differ
diff --git a/doc/kdevelop/file-list-session-create.png b/doc/kdevelop/file-list-session-create.png
new file mode 100644
index 00000000..a80fa37c
--- /dev/null
+++ b/doc/kdevelop/file-list-session-create.png
Binary files differ
diff --git a/doc/kdevelop/file-list-session-default.png b/doc/kdevelop/file-list-session-default.png
new file mode 100644
index 00000000..1eaf565c
--- /dev/null
+++ b/doc/kdevelop/file-list-session-default.png
Binary files differ
diff --git a/doc/kdevelop/file-selector.png b/doc/kdevelop/file-selector.png
new file mode 100644
index 00000000..8a357851
--- /dev/null
+++ b/doc/kdevelop/file-selector.png
Binary files differ
diff --git a/doc/kdevelop/filetree.png b/doc/kdevelop/filetree.png
new file mode 100644
index 00000000..1e731402
--- /dev/null
+++ b/doc/kdevelop/filetree.png
Binary files differ
diff --git a/doc/kdevelop/find-in-files.png b/doc/kdevelop/find-in-files.png
new file mode 100644
index 00000000..17dae505
--- /dev/null
+++ b/doc/kdevelop/find-in-files.png
Binary files differ
diff --git a/doc/kdevelop/folded-tabs.png b/doc/kdevelop/folded-tabs.png
new file mode 100644
index 00000000..1218421f
--- /dev/null
+++ b/doc/kdevelop/folded-tabs.png
Binary files differ
diff --git a/doc/kdevelop/getting-started.docbook b/doc/kdevelop/getting-started.docbook
new file mode 100644
index 00000000..11a08253
--- /dev/null
+++ b/doc/kdevelop/getting-started.docbook
@@ -0,0 +1,3221 @@
+
+<!--
+Please keep the formatting simple.
+Do not indent XML constructs.
+Keep lines at 80 characters length maximum.
+-->
+
+<chapter id="getting-started">
+
+<chapterinfo>
+<authorgroup>
+<author><firstname>Bernd</firstname><surname>Pol</surname></author>
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
+</authorgroup>
+</chapterinfo>
+
+<title>Getting Started with &kdevelop; &mdash; a Guided Tour</title>
+
+<para>Now that you have got your new &kdevelop; &IDE;, how are you going to make
+good use of it? As this is a complex application, the learning curve may be
+somewhat steep, especially if you are not already used to this type of an
+Integrated Development Environment.</para>
+
+<para>We will try to soften this learning curve a bit by stepping through the
+makings of a simple KDE C++ application. Thereby we will have a (cursory) look
+at:</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-overview">A first look &mdash; the user
+interface elements of the &kdevelop; &IDE;.</link></member>
+<member><link linkend="gettingstarted-configure">Doing some initial
+configuration.</link></member>
+<member><link linkend="gettingstarted-new">How to create a new project.</link>
+</member>
+<member><link linkend="gettingstarted-edit">Some tips about dealing with
+documents.</link></member>
+<member><link linkend="gettingstarted-compile">How to compile the application in
+this project.</link></member>
+<member><link linkend="gettingstarted-extend">How to add classes and other
+detail to your project.</link></member>
+<member><link linkend="gettingstarted-debug">What to do to debug the
+application.</link></member>
+<member><link linkend="gettingstarted-doc">Some basic tools to build program or
+user documentation.</link></member>
+<member><link linkend="gettingstarted-keys">Last but not least, keyboard
+shortcuts</link></member>
+</simplelist>
+
+<para>Before we start, one important concept should be made clear.</para>
+
+<formalpara>
+<title>What to expect?</title>
+<para>As said, &kdevelop; is an <emphasis>Integrated Development
+Environment</emphasis>. That means in essence that &kdevelop; is no development
+tool by itself but rather a graphical front end to easily access a wide range of
+development tools, many of which actually would require complex keyboard
+commands run from a text console.</para>
+</formalpara>
+
+<para>While &kdevelop; eases many of those programming tasks, much of the
+complexity from this bundle of tools still remains which means that in order to
+fully understand the &kdevelop; &IDE; you will still need to comprehend these
+tools actually running beneath the surface.</para>
+
+<para>Hence, we cannot teach you how to build software, but rather introduce you
+to some of the ways &kdevelop; was designed to ease such a software building
+process. If you want to learn more about what an Integrated Development
+Environment is meant for, you might want to have a look at the <link
+linkend="unixdev">Development on &UNIX;</link> historical overview and there
+especially at the <link linkend="unixdev-ide">Integrating Concepts and
+Tools</link> chapter.</para>
+
+<note>
+<para>The following discussions apply to the default case, where &kdevelop;
+starts up in the <guilabel>Simplified IDEAl Window Mode</guilabel>. If you
+already did switch to another user interface mode some items may not be there as
+described or will behave slightly different. If in doubt which user interface
+mode your &kdevelop; currently uses, check with the
+<menuchoice><guimenu>Settings</guimenu> <guimenuitem>Configure
+KDevelop...</guimenuitem> <guimenuitem>User Interface</guimenuitem></menuchoice>
+dialog.</para>
+</note>
+
+<sect1 id="gettingstarted-overview">
+<title>A Very First Look at &kdevelop;</title>
+
+<para>This is all about what you will see when you first started &kdevelop;.
+You will find preliminary information about:</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-overview-basic">What is there on the
+surface?</link></member>
+<member><link linkend="gettingstarted-overview-help">How to get some
+help.</link></member>
+<member><link linkend="gettingstarted-overview-menu">What is in the
+menus?</link></member>
+<member><link linkend="gettingstarted-overview-tools">What are those tool views
+for?</link></member>
+</simplelist>
+
+<sect2 id="gettingstarted-overview-basic">
+<title>On the Surface</title>
+
+<para>When you start &kdevelop; for the first time you will get a display
+similar to this one:</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="empty-ide.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>The &kdevelop; initial layout</para>
+<para>(Actually the initial &kdevelop; window will be larger, but the elements
+you see are the same.)</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<formalpara>
+<title>Workspace Area and Tool View Tabs</title>
+<para>In this initial case &kdevelop; uses the so-called <link
+linkend="uimodes-survey">IDEAl user interface mode</link>. A workspace area of
+maximum possible size is surrounded left, bottom, and right by a series of
+buttons which act similar to tabs on a tabbed display. If you click on one of
+those tabs, a so-called <emphasis>tool view window</emphasis> will open which
+allows you to work on a specific task.</para>
+</formalpara>
+
+<formalpara>
+<title>Menu and Toolbars</title>
+<para>On top there is the usual menubar, followed by several rows of toolbars,
+some being initially empty. They will get populated once there is a project open
+for actual work.</para>
+</formalpara>
+
+<formalpara>
+<title>Status Bar</title>
+<para>Finally, there is a status bar on the bottom of the window where short
+informations on several tasks will be shown.</para>
+</formalpara>
+</sect2>
+
+<sect2 id="gettingstarted-overview-help">
+<title>How to Get Some Help</title>
+
+<para>Besides the <guimenu>Help</guimenu> menu which offers answers to specific
+questions, the status bar and two kinds of tool tips provide some quick
+information.</para>
+
+<formalpara>
+<title>What Does This Menu Entry Do?</title>
+<para>When you place the mouse cursor on a menu entry, there will usually some
+short information be displayed in the status bar. While in most cases this
+repeats just the name of the selection, in some cases it will provide additional
+information about the purpose of the menu command.</para>
+</formalpara>
+
+<formalpara>
+<title>What Is the Name of This Item?</title>
+<para>On many items a short function name tool tip will pop up when you place
+the cursor on it for a few seconds. This is useful for quick orientation on
+toolbar or tool view tabs in IDEAl mode when the &IDE; has been set up to
+display icons only on these buttons.</para>
+</formalpara>
+
+<formalpara>
+<title>What Does This Item Do?</title>
+<para>More information is available through expanded tool tip help for many
+items on the &IDE;. Select <menuchoice><guimenu>Help</guimenu>
+<guimenuitem>What&apos;s This?</guimenuitem></menuchoice> or press
+<keycombo><keycap>&Shift;</keycap><keycap>F1</keycap></keycombo>, then with the
+question mark cursor select the item you want to know more of. You can as well
+open any menu this way and click on a specific menu entry (active as well as
+greyed disabled ones) to see if more information is available.</para>
+</formalpara>
+</sect2>
+
+<sect2 id="gettingstarted-overview-menu">
+<title>What is in the menus?</title>
+
+<para>There are ten menus selectable on the menubar. Most of them get fully
+populated once a project is open for actual work while others require at least
+one document be open in an editor window. In short, they will allow the
+following action types.</para>
+
+<note>
+<para>This is only a preliminary overview. For a detailed menu description see
+the <link linkend="commands">Command Reference</link>.</para>
+</note>
+
+<variablelist>
+<varlistentry>
+<term><guimenu>File</guimenu></term>
+<listitem>
+<formalpara>
+<title>Usual Actions</title>
+<para>This is pretty standard. It allows to create, open, save, print, and close
+document files as well as quitting the &kdevelop; application as usual.</para>
+</formalpara>
+
+<formalpara>
+<title>Revert All</title>
+<para>This allows to revert all recent, yet unsaved changes by reloading the
+file from the disk. This works on any file you edit, not only on those which are
+part of a project.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Edit</guimenu></term>
+<listitem>
+<para>This menu is useful only if a document is opened.</para>
+
+<formalpara>
+<title>Usual Actions</title>
+<para>It provides the usual undo/redo and cut/copy/paste actions.
+Furthermore it allows to select text blocks in various ways.</para>
+</formalpara>
+
+<formalpara>
+<title>Search and Replace</title>
+<para>There are two very powerful search facility available,
+<menuchoice><guimenu>Edit</guimenu> <guimenuitem>Find in
+Files...</guimenuitem></menuchoice>, and <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find-Select-Replace...</guimenuitem></menuchoice>. These allow, in
+addition to the usual search and replace actions limited to the the current
+document, to conduct global search or search-and-replace actions in one single
+turn.</para>
+</formalpara>
+
+<formalpara>
+<title>Advanced Text Edit</title>
+<para>There are provisions to reformat the current document and to automatically
+complete partially typed texts in various ways.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>View</guimenu></term>
+<listitem>
+<para>Like the <guimenu>Edit</guimenu> menu, this menu is useful only if there
+is an open project. I this case there will be the following actions available
+(amongst others):</para>
+
+<formalpara>
+<title>Navigation History</title>
+<para>Switch back and forth through the documents &etc; you visited.</para>
+</formalpara>
+
+<formalpara>
+<title>Error Tracking</title>
+<para>Navigate to the source lines of the errors encountered in the most recent
+compilation/build process.</para>
+</formalpara>
+
+<formalpara>
+<title>Editor Related Actions</title>
+<para>Some entries in the <guimenu>View</guimenu> menu control the look and view
+of the editor you use. In case of the &kate; Part (Embedded Advanced Text
+Editor) there will be the following controls available:</para>
+</formalpara>
+
+<itemizedlist>
+<listitem>
+<para>Control the word wrap behavior in the document window.</para>
+</listitem>
+<listitem>
+<para>Show or hide several border displays in the document windows: line
+numbers, icons, and, additionally, bookmark marks in the scroll bar.</para>
+</listitem>
+<listitem>
+<para>Control the display of folded (temporarily hidden) sections in a source
+text.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Project</guimenu></term>
+<listitem>
+<para>All work of &kdevelop; is based on <emphasis>projects</emphasis> which
+basically collect source files, build management files, and other information in
+one project directory. In this menu you control which project to use, which
+properties it has, and some other managing actions.
+In particular:</para>
+
+<formalpara>
+<title>Open a Project</title>
+<para>Allows to create new projects, open existing ones, and import projects
+from other environments.</para>
+</formalpara>
+
+<formalpara>
+<title>Project Options</title>
+<para>Allows to define a whole bunch of different project properties.</para>
+</formalpara>
+
+<formalpara>
+<title>Classes Management</title>
+<para>Add new classes to the project and traverse the inheritance tree of a
+class.</para>
+</formalpara>
+
+<formalpara>
+<title>Distribute Project</title>
+<para>Helps to build distribution packages of the project.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Build</guimenu></term>
+<listitem>
+<para>This menu is all about compiling and documenting the project. Thus it is
+of use only when a project is actually open. In this case it provides the
+following actions:</para>
+
+<formalpara>
+<title>Compile, Link, Execute</title>
+<para>Allows to compile and link the whole project or parts of it as well as run
+the application from within the &IDE;.</para>
+</formalpara>
+
+<formalpara>
+<title>Prepare Build Operations</title>
+<para>This actually depends on the make system you use for this project. In the
+case of automake projects it allows to run <filename>Makefile.cvs</filename> and
+<filename>configure</filename> on their own. There are also provisions to remove
+translated files from the project in various stages of intensity.</para>
+</formalpara>
+
+<formalpara>
+<title>Install the Application</title>
+<para>Allows to install the application both in local directories as well as in
+system directories only accessible to the root user.</para>
+</formalpara>
+
+<formalpara>
+<title>API Documentation</title>
+<para>Build or remove a doxygen-based API documentation of the project as
+defined in the project options.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Debug</guimenu></term>
+<listitem>
+<para>Although this menu will be filled once a project is active, it of course
+is useful only if the actual project has been previously compiled with debugging
+information (this is basically set up in <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options..</guimenuitem></menuchoice>). There are the
+following actions available in this case:</para>
+
+<formalpara>
+<title>Usual Debugger Actions</title>
+<para>The first section in the <guimenu>Debug</guimenu> provides a graphical
+interface to the GDB &GNU; symbolic debugger. It allows to start and stop your
+application in the debugger and step through it in various ways.</para>
+</formalpara>
+
+<formalpara>
+<title>Breakpoints</title>
+<para>&kdevelop; provides several means to set breakpoints in your application
+sources. One is through the use of the <guimenuitem>Toggle
+Breakpoint</guimenuitem> menu entry.</para>
+</formalpara>
+
+<formalpara>
+<title>Advanced Debugging</title>
+<para>Other <guimenu>Debug</guimenu> menu entries allow more sophisticated
+program analysis. Use
+<keycombo><keycap>&Shift;</keycap><keycap>F1</keycap></keycombo> to get more
+information about their purpose.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Scripts</guimenu></term>
+<listitem>
+<para>You can call various scripts from this menu to more easily accomplish
+tedious actions on the text in the currently selected editor window. The
+available actions depend on the selected script, however.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Window</guimenu></term>
+<listitem>
+<para>This is fairly standard. You may select any open document window as well
+as close one or more documents windows in here. You may even select a set of
+document windows to be closed in one single turn.</para>
+
+<para>Depending on the editor plugin you use may there be other menu items as
+well. So will the default Kate editor plugin additionally allow to split the
+editor window horizontally as well as vertically.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Tools</guimenu></term>
+<listitem>
+<para>&kdevelop; is highly customizable.
+You may select a favorite editor for your documents as well as provide external
+and plugged-in tools to extend the basic &IDE; capabilities. The
+<guimenu>Tools</guimenu> menu reflects most of this setup.</para>
+
+<formalpara>
+<title>Advanced Editing</title>
+<para>The upper set of <guimenu>Tools</guimenu> menu entries will be provided by
+the editor plugin which is in use. You may select your favorite editor via
+<menuchoice><guimenu>Settings</guimenu> <guimenuitem>Configure
+KDevelop...</guimenuitem> <guilabel>Editor</guilabel></menuchoice>. Once an
+editable document file is selected, the upper part of the
+<guimenu>Tools</guimenu> menu will provide advanced editing commands specific to
+the editor part in use.</para>
+</formalpara>
+
+<formalpara>
+<title>Web Side Handling</title>
+<para>In case the active document window contains a HTML page (&eg; displayed
+from a <guilabel>Documentation</guilabel> selection), the
+<guimenu>Tools</guimenu> will show additional menu entries which provide various
+means to handle Web pages.</para>
+</formalpara>
+
+<formalpara>
+<title>Other Tools</title>
+<para>Usually there will be a bunch of other entries according to the currently
+available tools. Use <keycombo><keycap>&Shift;</keycap>
+<keycap>F1</keycap></keycombo> to get more information about their
+purposes.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Settings</guimenu></term>
+<listitem>
+<para>This menu allows you to show and hide menubar, toolbars and statusbar.
+Also, you can configure shortcuts, toolbars, notifications, the editor and
+&kdevelop;&apos;s general behavior.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenu>Help</guimenu></term>
+<listitem>
+<para>Here you can open this KDevelop manual, look up terms in various
+documentation files, open man pages (the traditional UNIX manual format) and
+info pages (the GNU manual format). Furthermore you can report bugs here or get
+some info about your current KDevelop version and its authors.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</sect2>
+
+<sect2 id="gettingstarted-overview-tools">
+<title>What are those tool views for?</title>
+
+<para>In the IDEAl user interface mode the workspace will be surrounded by three
+areas of buttons, so-called <emphasis>tool view tabs</emphasis>. They provide
+access to <emphasis>tool view windows</emphasis> which accomplish main tasks
+during software development. Each of these three tool view areas serves a
+different main purpose.</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Left Side</title>
+<para>Provides access to navigation and selection tools</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Bottom</title>
+<para>These views display messages produced by various tools.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Right Side</title>
+<para>Provides access to documentation and source management tools.</para>
+</formalpara>
+</listitem>
+</itemizedlist>
+
+<para>The number of tool view tabs shown will change once a project is open for
+actual work. More tools to work on that project will be available then. The
+actual number of tool views depends on the <link linkend="plugin-tools">Plugin
+Tools</link> being currently available to &kdevelop;. You will find more on this
+topic in the <link linkend="setup">Configuring KDevelop</link> chapter.</para>
+
+<para>Currently, with no project open and the default number of plugin tools
+loaded, you will find the following tool views. Clicking on a tab will open
+respectively close its tool view window.</para>
+
+<variablelist>
+<varlistentry>
+<term>Navigation and Selection</term>
+<listitem>
+<formalpara>
+<title>File Selector</title>
+<para>Provides a panel to navigate the directory tree and select files for work
+just like you do in the &konqueror;. Clicking a file will open it in an
+appropriate editor window in the workspace area. A right click in the file
+selector area will pop up a navigation and file manipulation menu.</para>
+</formalpara>
+
+<formalpara>
+<title>File List</title>
+<para>Lists the currently open files. Clicking on a file will usually select its
+editor window in the workspace area. Use this to quickly navigate in a large
+number of open files. Furthermore this view provides a means to organize the
+open files into different <emphasis>sessions</emphasis>. This is particularly
+useful in very large and complex projects to help the developer concentrate on
+different tasks. Right clicking a file will pop up a file manipulation
+menu.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Messages Displays</term>
+<listitem>
+<formalpara>
+<title>Application</title>
+<para>Displays the output from an application started from within
+&kdevelop;.</para>
+</formalpara>
+
+<formalpara>
+<title>Diff</title>
+<para>Used to display patch file contents.
+Displays the output from the difference viewer tool started from the
+<menuchoice><guimenu>Tools</guimenu> <guimenuitem>Difference
+Viewer...</guimenuitem></menuchoice> menu.</para>
+</formalpara>
+
+<formalpara>
+<title>Messages</title>
+<para>Displays messages produced by the build tools called from within
+&kdevelop;, usually from the <guimenu>Build</guimenu> menu.</para>
+</formalpara>
+
+<formalpara>
+<title>Find in Files</title>
+<para>Displays the list of items found by the global search operation started
+from the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Find in
+Files...</guimenuitem></menuchoice> menu. Clicking on a line here will
+automatically open that file at the specified position in an editor
+window.</para>
+</formalpara>
+
+<formalpara>
+<title>Replace</title>
+<para>Lists the results of the global search-and-replace operation issued from
+the <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find-Select-Replace...</guimenuitem></menuchoice> menu. In this
+view you can decide on every found item whether you really want it be replaced
+or not.</para>
+</formalpara>
+<note>
+<para>This global search-and-replace facility is actually available only after a
+project has been loaded into &kdevelop;. Otherwise the global replace tool in
+the <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find-Select-Replace...</guimenuitem> </menuchoice> menu will in
+fact be be disabled.</para>
+</note>
+
+<formalpara>
+<title>Konsole</title>
+<para>Opens a &kde; <application>Konsole</application> like terminal emulator
+window where you can use keyboard commands in a traditional &UNIX; command line
+interface.</para>
+</formalpara>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Documentation and Source Manipulation</term>
+<listitem>
+<formalpara>
+<title>Documentation</title>
+<para>&kdevelop; provides access to a whole bunch of documentation through this
+tool. You may here access document files, usually online from remote locations,
+in a structured way. And there are several ways available to directly access
+valuable information from &kde; or &Qt; manuals.</para>
+</formalpara>
+
+<para>See the <link linkend="documentation">Documentation</link> and <link
+linkend="setup-docu">Configuring the Documentation</link> chapters for more
+details.</para>
+
+<formalpara>
+<title>Code Snippets</title>
+<para>This tool allows you to permanently store selected texts for later use in
+other editing cycles. It is a very flexible tool, as any text snipped stored
+here may contain a set of variables which will get their actual values at the
+time when you insert such a snippet in some other text.</para>
+</formalpara>
+<para>More information on this is available in the <link
+linkend="editing-snippets">Code Snippets</link> and <link
+linkend="setup-snippets">Setting Up the Code Snippets Tool</link>
+chapters.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</sect2>
+</sect1>
+
+<sect1 id="gettingstarted-configure">
+<title>A Bit of Configuration</title>
+
+<para>Before we actually start a first example project, we should tailor the
+&kdevelop; behavior to our needs. Although most of the default settings will be
+appropriate for now, there are a few places which better should be
+adjusted.</para>
+
+<note>
+<para>If you want to know more about &kdevelop; configuration, have a look at
+the <link linkend="setup">Configuring KDevelop</link> chapter.</para>
+</note>
+
+<sect2 id="gettingstarted-configure-general">
+<title>Some General Settings</title>
+
+<para>To configure &kdevelop;, click the
+<menuchoice><guimenu>Settings</guimenu></menuchoice> menu and select
+<menuchoice><guimenuitem>Configure KDevelop...</guimenuitem></menuchoice>. The
+<guilabel>Configure KDevelop</guilabel> dialog will pop up, showing the
+following <guilabel>General</guilabel> settings page to the right.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-general.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>The &kdevelop; general configuration dialog</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<para>Most of the defaults will be o.k.
+But you will probably want to change two of those settings.</para>
+
+<formalpara>
+<title>Default projects directory</title>
+<para>At first start of &kdevelop; this will most likely be preset to your home
+directory. Most people however prefer a dedicated projects directory for
+software development. Change the text box to your preferred parent development
+directory. You may select it from the directory tree if you press the
+<guilabel>Open file dialog</guilabel> button labeled with a folder icon to the
+right of it.</para>
+</formalpara>
+
+<para>In our examples we will assume a (somewhat artificial) user called
+<filename class="directory">devel</filename>.
+Thus always replace this <quote>devel</quote> by your user name. Our devel user
+will utilize the <filename class="directory">/home/devel/projects</filename>
+parent directory for actual development. Again, replace <filename
+class="directory">projects</filename> with your development directory name.
+</para>
+
+<para>&kdevelop; will by default set up an own subdirectory below this parent
+for every new project you create. So will &eg; all files of a project named
+<quote>Hello</quote> in our case be located in the <filename
+class="directory">/home/devel/projects/hello</filename> directory.</para>
+
+<para>You may of course temporarily override these directory settings if you
+need to. See the <link linkend="applicationwizard">&appwizard;</link> chapter
+for more info on this.</para>
+
+<formalpara>
+<title>Compiler output</title>
+<para>Whenever &kdevelop; compiles some source, it will display the messages of
+the <application>make</application>, etc. build tools in the
+<guilabel>Messages</guilabel> window in the lower part of the workspace area.
+Usually these messages will be overwhelmingly wordy. To keep a better overview
+of what happens, &kdevelop; has some means of shortening those messages built
+in.</para>
+</formalpara>
+
+<para>Depending on the &kdevelop; version you use, the <guilabel>Compiler
+output</guilabel> selection may be preset to <quote>Long</quote>, which will
+cause all message contents be fully shown. You may probably want to change this
+to the far more convenient <quote>Very Short</quote> setting. Just select this
+from the drop down box.</para>
+
+<caution>
+<para>Be aware that only <emphasis>most basic</emphasis> information will be
+shown in the <guilabel>Messages</guilabel> window this way. In case of errors
+during &eg; a build run you will most likely want to see more, if not all, of
+the message texts. They are not lost, however. Just right click into the
+<guilabel>Messages</guilabel> window and select &eg; <quote>Full Compiler
+Output</quote> from the popup menu.</para>
+</caution>
+</sect2>
+
+<sect2 id="gettingstarted-configure-search">
+<title>Initializing Documentation Search Indexes</title>
+
+<para>There is another, not so obvious, item which preferably should be
+initialized before you start actual development work. This is because you will
+want to perform documentation search regularly during development. &kdevelop;
+requires some search indexes be created before such search operations can be
+performed. So let&apos;s initialize them before we attempt our first steps
+toward actual &kdevelop; work.</para>
+
+<para>Open the <guilabel>Documentation</guilabel> tool view at the right side of
+the &kdevelop; main window. There open the <guilabel>Search</guilabel> dialog
+page.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="documents-search.png" format="PNG"/>
+</imageobject>
+<caption><para>Where to generate the search indexes.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Now press the <guibutton>Update Config</guibutton> button to make sure the
+basic search tools are properly set up. A dialog should pop up, telling
+<quote>Configuration file updated</quote>. Click <guibutton>OK</guibutton> to
+make it disappear.</para>
+
+<para>This done, &kdevelop; will be ready to parse the documentation it knows of
+and build some useful search indexes from it. Press the <guibutton>Update
+Index</guibutton> button to the right. Now the <guilabel>Generating Search
+Index</guilabel> dialog will pop up showing the progress of the index build
+operations.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-docu-indexgen.png" format="PNG"/>
+</imageobject>
+<caption><para>&kdevelop; is generating documentation search
+indexes.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>This will take some time depending on the size of documentation and the
+speed of your machine. But finally the <guibutton>Cancel</guibutton> will make
+place to <guibutton>OK</guibutton>. Just press this button to proceed.</para>
+
+<note>
+<itemizedlist>
+<listitem>
+<para>This usually should work out of the box. In some cases the
+<application>htdig</application> application &kdevelop; uses to perform its full
+text searches might not be properly set up. Refer to the <link
+linkend="setup-docu-textsearch">Setting Up Text Search Indexes</link> chapter
+for more help in this case.</para>
+</listitem>
+<listitem>
+<para>To be able to look up &kde; and &Qt; specific API documentation, it is
+mandatory that the <emphasis>KDELibs Apidocs</emphasis> were present when
+&kdevelop; was installed. If you experience problems building the indexes or
+perform the <link linkend="gettingstarted-edit-defs">identifier lookup
+examples</link> later in this chapter, make sure that this documentation exists
+and is accessible to &kdevelop;. See <link linkend="kdevelop-install">Installing
+KDevelop</link> fore more detail.</para>
+</listitem>
+</itemizedlist>
+</note>
+</sect2>
+</sect1>
+
+
+<sect1 id="gettingstarted-new">
+<title>Starting a New Project</title>
+
+<para>Almost any application will consist of dozens, hundreds, even thousands of
+files which need kept structured and maintainable. To accomplish this,
+&kdevelop; organizes software development tasks in
+<emphasis>projects</emphasis>. Thus the first practical step to develop software
+in &kdevelop; usually is to create a new project.</para>
+
+<para>Fortunately this is fairly easily accomplished. &kdevelop; provides the
+so-called &appwizard; tool for this. (See the <link
+linkend="applicationwizard">Getting Started &mdash; the &appwizard;</link>
+chapter for more.)</para>
+
+<para>We will now start a simple &kde; application project to illustrate how
+easily this is accomplished and which files and tools &kdevelop; will have
+provided. Thereby we will have a short look at:</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-new-setup">How to create a new project
+with the help of the &appwizard;.</link></member>
+<member><link linkend="gettingstarted-new-files">Which files the &appwizard;
+initially did set up.</link></member>
+<member><link linkend="gettingstarted-new-toolviews">What about the additional
+tool view shown with the project?</link></member>
+</simplelist>
+
+<sect2 id="gettingstarted-new-setup">
+<title>How to Create a New Project</title>
+
+<para>Let us create a rather simple <quote>Hello World</quote> &kde; project.
+Just follow these steps.</para>
+
+<procedure>
+<step>
+<para>To start the &appwizard; click the <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>New Project...</guimenuitem></menuchoice> menu.</para>
+</step>
+
+<step>
+<para>The <guilabel>Create New Project</guilabel> dialog will pop up. In the
+upper left <guilabel>All Projects</guilabel> window there will be a number of
+programming languages listed.</para>
+
+<substeps>
+<step>
+<para>We want to build a &kde; C++ application as usual, thus click on the
+<guilabel>+</guilabel> label left of the <guilabel>C++</guilabel> label to open
+this branch.</para>
+</step>
+
+<step>
+<para>A series of possible application targets will be displayed. We will build
+a &kde; application, thus open the next sub-branch via the
+<guilabel>+</guilabel> label next to <guilabel>KDE</guilabel></para>
+</step>
+
+<step>
+<para>Now you will be offered a series of possible <emphasis>project
+templates</emphasis>. Navigate down to the end of this branch and click
+<guilabel>Simple KDE Application</guilabel>.</para>
+
+<para>A preview and short description of the application this project template
+will produce pops up in the two windows to the right.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="tutorial-new-project.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>Selecting a <quote>Hello World</quote> project template</para>
+</caption>
+</mediaobject></screenshot>
+</step>
+
+<step>
+<para>Our application will need a name. Find the <guilabel>Properties</guilabel>
+area on the dialog bottom and enter a suitable name into the
+<guilabel>Application name</guilabel> input field.</para>
+
+<para>We use <quote>Hello</quote> in our example, but you can use whatever you
+like, provided the name consists of letters, number digits, and underlines only.
+You will find that the &appwizard; rejects any other character.</para>
+</step>
+
+<step>
+<para>Make sure the <guilabel>Location</guilabel> text box below the input field
+shows the name of your top project directory as set up in the <link
+linkend="gettingstarted-configure">A Bit of Configuration</link> chapter above.
+If it does not do so, enter a suitable directory name or select one from the
+directory list provided by the folder labeled button to the right.</para>
+
+<para>If all went well, the <guilabel>Final location</guilabel> line at the
+bottom will show the directory path your new project will use. In case there was
+an <quote>(invalid)</quote> suffix appended, try another name for your project
+and/or make sure the top project directory in the <guilabel>Location</guilabel>
+text box really exists and is writable.</para>
+</step>
+
+<step>
+<para>Once everything is right, the <guibutton>Next</guibutton> button in the
+bottom row of the dialog will be enabled. Click it to proceed.</para>
+</step>
+</substeps>
+</step>
+
+<step>
+<para>This will lead you to the <guilabel>Project Options</guilabel> dialog
+page. Make sure the <guilabel>Author</guilabel> and <guilabel>Email</guilabel>
+text boxes are properly filled in. Usually they will default to your general
+&kde; user settings as given in the <guilabel>Password &amp; User
+Account</guilabel> dialog of the &kde; Control Center. If not, change them to
+some settings you prefer for your application.</para>
+
+<screenshot id="gettingstarted-new-setup-options">
+<mediaobject>
+<imageobject>
+<imagedata fileref="tutorial-hello-options.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>Provide your name and (optionally) email address.</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<note>
+<para>You must provide an <guilabel>Author</guilabel> name at least. This is
+mandatory for the application files setup.</para>
+</note>
+
+<para>If all is right, the <guibutton>Next</guibutton> button will be enabled.
+Click it to further proceed.</para>
+</step>
+
+<step>
+<para>The following <guilabel>Version Control System</guilabel>,
+<guilabel>Template for .h Files</guilabel>, and <guilabel>Template for .cpp
+Files</guilabel> dialog pages are not of interest for now. Skip them by clicking
+the <guibutton>Next</guibutton> buttons and, finally, the
+<guibutton>Finish</guibutton> button.</para>
+</step>
+</procedure>
+
+<para>That was all!
+The &appwizard; will take over and construct a series of initial files in the
+<guilabel>Final location</guilabel> directory you provided in step 2c
+above.</para>
+
+<para>Once this file creation phase is finished, &kdevelop; will open an editor
+window for the <emphasis>application main window</emphasis> implementation file
+(which is <filename>hello.cpp</filename> in our example), so you can readily
+proceed.</para>
+</sect2>
+
+<sect2 id="gettingstarted-new-files">
+<title>Initial Project Files</title>
+
+<para>Even if our sample Hello project is fairly simple, the &appwizard; did
+create a whole bunch of source and project management files. You will most
+easily list them if you open the <guilabel>File Tree</guilabel> tool view on the
+bottom left. This will open a file list similar to the one below.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="tutorial-hello-new.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>Initial files in our <quote>Hello World</quote> project</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<para>To demonstrate the main bunch of files the &appwizard; produced, we did
+open most of the directory branches in the left-hand <guilabel>File
+Tree</guilabel> tool view window. Just click the branch names in the tree to see
+for yourself.</para>
+
+<para>Additionally, just for demonstration, we did as well open most of the
+branches the <guilabel>Automake Manager</guilabel> tool view window to the right
+where some of the project sources are listed, too.</para>
+
+<sect3 id="gettingstarted-new-files-copyright">
+<title>Copyright Issues</title>
+
+<para>All &GNU; conformant applications must be copyrighted. There are two
+levels which require copyright notices, <emphasis>individual source
+files</emphasis> and <emphasis>run-time application level</emphasis>. The
+&appwizard; did already put appropriate copyright and licensing information into
+the project files.</para>
+
+<formalpara>
+<title>Source File Level Copyrights</title>
+<para>Do you remember the <link linkend="gettingstarted-new-setup-options">
+<guilabel>Project Options</guilabel></link> dialog page in the new project
+setup? You had to provide your (the developer&apos;s) name and optionally an
+email address there. Now refer to the top of the <guilabel>hello.cpp</guilabel>
+editor window currently displayed in the workspace area. The &appwizard; did
+enter these statements on top of the licensing header of every source file it
+created.</para>
+</formalpara>
+
+<programlisting>
+/***************************************************************************
+ * Copyright (C) 2006 by Joe User *
+ * joe@user.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+</programlisting>
+
+<para>You will find exactly the same text headers in every source file you will
+create inside &kdevelop; (provided you use the proper built in tools for file
+creation). &kdevelop; remembers these settings in some template files you may
+find in the <filename class="directory">templates</filename> directory.</para>
+
+<formalpara>
+<title>Application Run-Time Copyrights</title>
+<para>Once your &kde; application runs, the user may display some
+<guilabel>About</guilabel> data, usually from the <guimenu>Help</guimenu> menu.
+The &appwizard; did also take care of this. If you have a look at the
+<filename>main.cpp</filename> file, you will find an entry similar to the one
+below.</para>
+</formalpara>
+
+<programlisting>
+int main(int argc, char **argv)
+{
+ KAboutData about("hello", I18N_NOOP("Hello"), version, description,
+ KAboutData::License_GPL, "(C) 2006 Joe User", 0, 0,
+ "joe@user.com");
+ about.addAuthor( "Joe User", 0, "joe@user.com" );
+</programlisting>
+
+<para>This will put the main developer&apos;s name (<quote>Joe User</quote> in
+our case) and email address into the <guilabel>About</guilabel> copyright page
+in the display and list this name and address on the
+<guilabel>Authors</guilabel> page there as well.</para>
+
+<important>
+<para>Whenever you make substantial changes to an existing project, be sure to
+enter your name and email address to the copyright notices on every file you
+changed and to the run-time copyright display as well. Don&apos;t be shy, you
+help the open source society considerably if you do so.</para>
+</important>
+</sect3>
+
+<sect3 id="gettingstarted-new-files-source">
+<title>Initial Source Files</title>
+
+<para>The &appwizard; did put the source files into the <filename
+class="directory">src</filename> sub-directory of the project&apos;s directory.
+You will find the <filename>main.cpp</filename>, <filename>hello.h</filename>,
+and <filename>hello.cpp</filename> files there as you may have possibly
+expected.</para>
+
+<para>There are some additional files you usually will find in a typical &kde;
+application, namely</para>
+
+<itemizedlist>
+<listitem>
+<para><filename>hello.desktop</filename> contains some meta data used by
+&kdevelop; to maintain and start the application.</para>
+</listitem>
+
+<listitem>
+<para><filename>hi16-app-hello.png</filename>, and
+<filename>hi32-app-hello.png</filename> contain some initial default icons,
+&kdevelop; will use for application display.</para>
+</listitem>
+
+<listitem>
+<para>Finally, <filename>helloui.rc</filename> contains a description of the
+application&apos;s user interface, currently the menus the application will
+provide.</para>
+</listitem>
+</itemizedlist>
+</sect3>
+
+<sect3 id="gettingstarted-new-files-doc">
+<title>Initial Application Documentation</title>
+
+<para>In the <filename class="directory">doc/en</filename> subdirectory of the
+project you will find the <filename>index.docbook</filename> file. This is a
+default template from where you can start to write a suitable user
+documentation.</para>
+</sect3>
+
+<sect3 id="gettingstarted-new-files-project">
+<title>Project and Auxiliary Files</title>
+
+<para>You will have noted that the files we introduced so far are listed in
+boldface in the <guilabel>File Tree</guilabel> tool view while most of the other
+files are not. This depicts the substantially different tasks these files are
+used for. The contents of those bold listed files directly influence the
+application. Source files will produce the code to be run, others will provide
+necessary data or documentation. These files must be maintained and orderly
+processed in the build stages by the project, hence they are called
+<emphasis>project files</emphasis>.</para>
+
+<para>If you have a look at the lower <guilabel>Automake Manager</guilabel>
+window to the right of the workspace area you will find all project files listed
+as well. The &automanag; tool uses this knowledge to take care of the build
+control as we shortly will see.</para>
+
+<para>The other, non-bold listed files are of more auxiliary nature. They belong
+to several distinctive classes as follows:</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Project Build Control</title>
+<para>These files control the compile, install, documentation building, &etc;
+processes. If the project utilizes the &GNU;
+<application>autotools</application> machinery as our example does, you will
+find a <filename>Makefile.am</filename> file in each project directory. These
+are kind of basic make core files which contain build control commands and will
+be processed in conjunction with various <filename>configure</filename> files
+during the build stages. Such a build produces a final
+<filename>Makefile</filename> in every directory. And from these in turn the
+<application>make</application> utility will finally build the binaries of the
+application.</para>
+</formalpara>
+
+<para>Those <filename>Makefile.am</filename> files need to be maintained
+throughout the development process. Luckily, &kdevelop; relieves you of most of
+this burden by the &automanag; tool, which basically is a graphical front end to
+maintain <filename>Makefile.am</filename> contents.</para>
+
+<para>Other project build control files currently listed are
+<filename>configure.in.in</filename> and <filename>subdirs</filename> in the
+project root directory. They will be processed by some of the files in the
+<filename class="directory">admin</filename> &kde; specific administration
+directory to produce more <filename>configure</filename> and
+<filename>Makefile</filename> type files and finally the application&apos;s
+binaries.</para>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>&kdevelop; Control Files</title>
+<para>&kdevelop; needs some control and administration data on its own. These
+are located in the project root directory, in our example
+<filename>hello.kdevelop</filename>, <filename>hello.kdevelop.pcs</filename>,
+and <filename>hello.kdevses</filename>.</para>
+</formalpara>
+
+<para>Of particular importance in each project is the
+<filename>xxx.kdevelop</filename> (where <quote>xxx</quote> denotes the project
+name) file. It is the main <emphasis>KDevelop 3 Project File</emphasis> and
+needed if you later want load this project into the &IDE;.</para>
+
+<warning>
+<para>Never do manually modify, rename, or even delete any of these &kdevelop;
+control files! The &IDE; will most likely not function properly on your project
+afterwards.</para>
+</warning>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>GNU Project Description Files</title>
+<para>Some files in the project root directory are mandatory in any &GNU;
+conformant application. These are: <filename>AUTHORS</filename>,
+<filename>ChangeLog</filename>, <filename>INSTALL</filename>,
+<filename>COPYING</filename> (which contains the GNU GENERAL PUBLIC LICENSE),
+<filename>INSTALL</filename>, <filename>NEWS</filename>,
+<filename>README</filename>, and <filename>TODO</filename>.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Other Files</title>
+<para>A few more files, not mentioned yet, are:</para>
+</formalpara>
+
+<itemizedlist>
+<listitem>
+<para><filename>Doxyfile</filename> controls the creation of the project
+specific &API; internal programming interface documentation.</para>
+</listitem>
+
+<listitem>
+<para>The <filename class="directory">templates</filename> directory containes
+file templates the &IDE; uses as stubs to create new source files.
+You may at any time edit these templates. The new contents will be reflected in
+the next source files you create of the related types.</para>
+
+<para>You may &eg; want to realign the right hand stars in the copyright lines
+the &appwizard; inserted into the <filename>cpp</filename> and
+<filename>h</filename> template files, so the source files created from them
+will look less awkward.</para>
+</listitem>
+
+<listitem>
+<para>The <filename class="directory">po</filename> directory will be used for
+localization purposes. It is essentially part of the project files (contains a
+<filename>Makefile.am</filename>) but will mainly be used in translation
+processing. Not of main interest to the application developer, however.</para>
+</listitem>
+
+<listitem>
+<para>Finally, the <filename class="directory">admin</filename> directory is
+specially needed in &kde; oriented applications. It provides a whole bunch of
+files necessary to maintain the application&apos;s sources and binaries so they
+will integrate properly into the &kde; environment.</para>
+</listitem>
+</itemizedlist>
+
+</listitem>
+</itemizedlist>
+</sect3>
+</sect2>
+
+<sect2 id="gettingstarted-new-toolviews">
+<title>Additional Tool Views</title>
+
+<para>As you will have noticed, as soon as the &appwizard; had the new project
+ready, several additional tool views were provided. These make sense during
+project development only and, in short, provide the following
+functionality.</para>
+
+<note>
+<para>The tool views actually visible depend on the plugins currently loaded
+into &kdevelop;. There are ways to control this. See the <link
+linkend="setup-plugins">Plugin Tools</link> chapter for instructions.</para>
+</note>
+
+<sect3 id="gettingstarted-new-toolviews-left">
+<title>Navigation and Selection Tools (left side)</title>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Bookmarks</title>
+<para>You can mark any text file line in order to quickly return to this
+position from everywhere. &kdevelop; will remember all those
+<emphasis>bookmarks</emphasis>, even if you close the editor window afterwards.
+The <guilabel>Bookmarks</guilabel> tool view lists all those bookmarks by file
+name and line number. You need only click such an entry to open the editor
+window accordingly and position the cursor on that line.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Classes</title>
+<para>Lists classes, methods, &etc; known in the project. Clicking the entry
+opens the appropriate header or source file in an editor window and positions
+the cursor at the respective declaration or definition.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>File Groups</title>
+<para>Sorts the files in the projects into various utility groups, &ie; Sources,
+User Interface, Icons, Translations, and Others. Clicking an entry opens that
+file in an editor window.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Variables</title>
+<para>This is used by the debugger tool to display, evaluate, and watch
+variables during debug runs.</para>
+</formalpara>
+</listitem>
+</itemizedlist>
+</sect3>
+
+<sect3 id="gettingstarted-new-toolviews-bottom">
+<title>Messages (bottom)</title>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Valgrind</title>
+<para><application>Valgrind</application> is a run-time program analyzer. This
+tool view lists the results of such an analyze run. It is used &eg; to find
+memory leaks.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Security Problems</title>
+<para>There is a <guilabel>Security Checker</guilabel> plugin tool for
+&kdevelop;. It analyzes the currently edited source file for several common
+security problems which may occur in the application and notifies the user in
+this tool view window.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Breakpoints</title>
+<para>This tool view allows to explicitly set, clear, and manage debug
+breakpoints in the application source files. It is used in conjunction with the
+debugger.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>CTags</title>
+<para>Allows to create a database of identifier indexes using the popular
+<application>CTags</application> application. This tags database may then be
+used from out this tool view window to look up any needed identifier in the
+project sources. Clicking a thus found item line will open an editor window and
+position the cursor on the appropriate identifier there.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Problems</title>
+<para>&kdevelop; keeps track of common programming problems in the currently
+edited source file and notifies the user in this tool view window.</para>
+</formalpara>
+</listitem>
+</itemizedlist>
+</sect3>
+
+<sect3 id="gettingstarted-new-toolviews-right">
+<title>Source Management (right side)</title>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Automake Manager</title>
+<para>The &automanag; tool is basically a graphical front end to maintain the
+contents of the <filename>Makefile.am</filename> files located in each project
+directory. This tool view uses two windows to control its work. The upper window
+mirrors part of the project subdirectories, namely those which explicitly
+contain <emphasis>project files</emphasis>. Each subdirectory of this kind must
+contain a <filename>Makefile.am</filename> file and is termed a
+<emphasis>subproject</emphasis> in the &automanag; context.</para>
+</formalpara>
+
+<para>Clicking a subproject entry opens a suitable display of the project files
+in this subproject in the lower window. The files listed there will be grouped
+according to their <filename>Makefile.am</filename> functionality in this
+subproject.</para>
+
+<para>The &automanag; is a very powerful tool to manage the project and its
+subprojects as well as the roles project files play in building the application.
+We will have a short look at a few major details <link
+linkend="gettingstarted-extend-automake">below</link>. See the <link
+linkend="project-management">Building and Project Management</link> chapter for
+a more extensive description.</para>
+</listitem>
+</itemizedlist>
+</sect3>
+</sect2>
+</sect1>
+
+
+<sect1 id="gettingstarted-edit">
+<title>Some Tips About Dealing With Documents</title>
+
+<para>In our example project the &appwizard; did leave the
+<filename>hello.cpp</filename> file open in an editor window, so you can
+immediately start working. Now, we may well assume your are knowledgeable about
+using an editor, so we do not need talk much about this here. But there are some
+handy &kdevelop; specifics about dealing with such tabbed editor windows and the
+documents you are working on. We will have a short look at some of them,
+namely:</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-edit-headers">How to easily switch between
+header and implementation files.</link></member>
+<member><link linkend="gettingstarted-edit-defs">How to quickly access
+declarations and definitions.</link></member>
+<member><link linkend="gettingstarted-edit-arrange">How to arrange editor
+windows to your current needs.</link></member>
+<member><link linkend="gettingstarted-edit-problems">How to keep an eye on
+common problems.</link></member>
+</simplelist>
+
+<sect2 id="gettingstarted-edit-headers">
+<title>Switching Between Header and Implementation Files</title>
+
+<para>&kdevelop; provides a quick and easy way to switch from a given
+implementation (<filename>.cpp</filename>) file to the corresponding header
+(<filename>.h</filename>) file and vice versa. Just right click into the editor
+window you want to switch. A menu similar to the following will pop up.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-switch-header.png" format="PNG"/>
+</imageobject>
+<caption><para>How to switch between implementation and header
+files.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Find the <guimenuitem>Switch header/implementation</guimenuitem> entry and
+select it. &kdevelop; will look up the corresponding header or implementation
+file and open it in another editor window. In our example, if you did right
+click into the <filename>hello.cpp</filename> source, the
+<filename>hello.h</filename> file will be displayed and the cursor positioned
+there.</para>
+
+<para>There is even more. If you do right click inside the text of a class
+implementation, &kdevelop; will position the cursor on the corresponding
+declaration line in the header file. And vice versa, right clicking on a
+declaration line will bring you to the corresponding class
+implementation.</para>
+
+<para>If the editor window with the file to be switched to already exists,
+&kdevelop; will of course activate this one and reposition the cursor there if
+necessary.</para>
+</sect2>
+
+<sect2 id="gettingstarted-edit-defs">
+<title>How to Access Declarations and Definitions</title>
+
+<para>But what if you are working on a source file and want to look up the
+declaration or definition of an identifier you just found there? Well, this is
+equally easily accomplished. Basically all you need to do is to right click on
+the identifier in question.</para>
+
+<para>There are two different cases to consider, however, namely:</para>
+<simplelist>
+<member><link linkend="gettingstarted-edit-defs-external">Accessing externally
+defined identifiers</link>, and</member>
+<member><link linkend="gettingstarted-edit-defs-project">dealing with project
+internal text items</link>.</member>
+</simplelist>
+
+<sect3 id="gettingstarted-edit-defs-external">
+<title>External Declarations and Definitions</title>
+
+<para>In a most common case you want to look up an identifier which was defined
+externally to your project. In &kde; projects such identifiers are most likely
+documented in various &kde; or &Qt; libraries. If &kde; and &kdevelop; were
+properly installed, &kdevelop; will be able to access such so-called API
+documentation and be able to search it for identifiers of this kind.</para>
+
+<para>Let us look at an example. In the <filename>hello.cpp</filename> editor
+window find the following lines.</para>
+
+<programlisting>
+Hello::Hello()
+ : KMainWindow( 0, "Hello" )
+{
+</programlisting>
+
+<para>Right click on <classname>KMainWindow</classname>.
+A menu will pop up. There select the <guimenuitem>Search in Documentation:
+KMainWindow</guimenuitem> entry and release the mouse button. Now the
+<guilabel>Documentation</guilabel> tool view will open, showing the
+<classname>KMainWindow</classname> entry as search item on the
+<guilabel>Search</guilabel> sub-page. And a short while after another editor
+window will open in the workspace area, showing the KDE API Reference page of
+the <classname>KMainWindow</classname> class.</para>
+
+<para>This all will look like the following. (We deliberately opened the
+<guilabel>Documentation</guilabel>, <guilabel>Search</guilabel> page already to
+illustrate the result of the menu selection.)</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-search-doc.png" format="PNG"/>
+</imageobject>
+<caption><para>How to look up an externally documented
+identifier.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>You might as well select <guimenuitem>Find Documentation:
+KMainWindow</guimenuitem>. In this case the <guilabel>Finder</guilabel> sub-page
+of the <guilabel>Documentation</guilabel> tool view will show up, usually
+providing a selection of pages containing the search term. (In our example this
+will probably be the <classname>KMainWindow</classname> and
+<classname>KMainWindowInterface</classname> classes. Select the one you are
+interested in and the corresponding documentation will be displayed in an editor
+window.</para>
+
+<note>
+<para>If this did not work, then there is probably no documents index yet. Did
+you initialize the indexes as shown <link
+linkend="gettingstarted-configure-search">above</link>? If not, please do so,
+then come back here and try again.</para>
+</note>
+</sect3>
+
+<sect3 id="gettingstarted-edit-defs-project">
+<title>Project Internal Declarations and Definitions</title>
+
+<para>Such search facilities in external documentation have their limitations,
+however. Of course one cannot look up an identifier externally if it is only
+defined and used inside the current project. But there is help. &kdevelop; can
+use indexes built by the <application>CTags</application> application to search
+the sources in your project.</para>
+
+<para>Before we can use this on our Hello example project, we must however first
+generate a suitable index. This is done by the <guilabel>CTags</guilabel> tool
+view at the bottom of the workspace area.</para>
+
+<para>When you click the <guibutton>CTags</guibutton> tab, a dialog window will
+open where you will find the following key in the lower right corner.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-ctags-regenerate.png" format="PNG"/>
+</imageobject>
+<caption><para>Build a CTags index with the <guibutton>Regenerate</guibutton>
+key.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Press the <guibutton>Regenerate</guibutton> button and wait a few seconds.
+Then the <guilabel>No CTags Database Found</guilabel> will be replaced by the
+current date. Now you are ready to perform some identifier look ups in your
+project source.</para>
+
+<tip>
+<para>The date next to the <guilabel>Regenerate</guilabel> button is there to
+remind you of possibly too old indexes. Whenever you are obviously not able to
+look up some identifier in your project, consider regenerating the index. On
+large projects this might take considerable time, but you should make it a habit
+to regenerate the index regularly after extensive source file changes.</para>
+</tip>
+
+<para>To look up an identifier in your project sources there are several
+possibilities.</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Use the CTags tool view</title>
+<para>This is easy.
+Just start typing the identifier name you are interested in into the
+<guilabel>Lookup</guilabel> input field in the bottom left. &kdevelop; will try
+to complete the word you have typed so far and show all occurrences of those
+identifiers which start with this character sequence.</para>
+</formalpara>
+
+<para>If for example you want to know wherever the <quote>Hello</quote>
+identifier was used in our example project, type an "H" into the
+<guilabel>Lookup</guilabel> input field. &kdevelop; will immediately start
+working and present you a result like this:</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-ctags-lookup.png" format="PNG"/>
+</imageobject>
+<caption><para>How to look up an identifier in the <guilabel>CTags</guilabel>
+tool view.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>If you click one of the listed entries, &kdevelop; will open an editor
+window with this file and position the cursor on the appropriate place.</para>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Use a context menu in a source file</title>
+<para>This is handy while you are working on a certain source file.
+Assume you are studying the <filename>main.cpp</filename> file of our Hello
+example project. There you find the following line</para>
+</formalpara>
+<programlisting>
+ Hello *mainWin = 0;
+</programlisting>
+<para>and wonder whatever the <quote>Hello</quote> was used for in the program.
+To find out, simply right click on this Hello identifier. A menu will pop up in
+response to this right mouse click, featuring the following lines near the
+bottom.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-ctags-menu.png" format="PNG"/>
+</imageobject>
+<caption><para>Getting <application>CTags</application> information on a project
+internal identifier.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Click what you are interested in, say <guilabel>CTags - Go to Definition:
+Hello</guilabel>, and &kdevelop; will immediately open the
+<filename>hello.cpp</filename> editor window and position the cursor right in
+front of this class definition:</para>
+<programlisting>
+Hello::Hello()
+ : KMainWindow( 0, "Hello" )
+{
+</programlisting>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Do a global search</title>
+<para>This is especially useful if you want to look up arbitrary text in your
+project source. There are two possibilities to start a global search from within
+&kdevelop;.</para>
+</formalpara>
+<itemizedlist>
+<listitem>
+<para>Start a global search from the <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find in Files...</guimenuitem></menuchoice> menu.
+Or</para>
+</listitem>
+<listitem>
+<para>Directly make use of the context menu with a right mouse click in the
+editor window.</para>
+</listitem>
+</itemizedlist>
+
+<para>We will illustrate the second possibility on our Hello example project.
+The outcome of the menu call will essentially be the same. Let us assume you are
+studying the <filename>hello.cpp</filename> source file and have the cursor
+positioned on the first Hello occurrence there. Now you wonder, where this one
+word <quote>Hello</quote> was used in the project source and how many
+occurrences there are. This is a typical case where to use &kdevelop;&apos;s
+global search facilities.</para>
+
+<para>Now, still keeping the cursor somewhere on this <quote>Hello</quote> in
+the source text, click the right mouse button. The now well known context menu
+will pop up, where you should select the <guilabel>Grep: Hello</guilabel>
+line.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="editor-find-menu.png" format="PNG"/>
+</imageobject>
+<caption><para>Initiating a global search from within an editor
+window.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>This will pop up the following <guilabel>Find in Files</guilabel> dialog
+(exactly the same as if you did use the <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Find in Files...</guimenuitem></menuchoice> menu).</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="find-in-files.png" format="PNG"/>
+</imageobject>
+<caption><para>A versatile graphical front end to perform global searches in the
+project.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>As you see, this is a very versatile tool to initiate
+<application>find</application>-and-<application>grep</application> searches
+throughout your project. We won&apos;t delve further into details here, but you
+may want to experiment with this facility on your own. For the moment, there
+should be our <quote>Hello</quote> be preselected in the
+<guilabel>Pattern</guilabel> field. If it is not, just type it in, then press
+the <guibutton>Search</guibutton> button at the bottom right.</para>
+
+<para>Now the <guilabel>Find in Files</guilabel> tool view will open at the
+bottom, showing you file names and lines of all literal occurrences of
+<quote>Hello</quote> in our example project. As usual, if you click an entry,
+&kdevelop; will get you to exactly that position in an editor window in the
+workspace area.</para>
+
+<para>There are two lines of special interest in the tool view window.</para>
+<itemizedlist>
+<listitem>
+<para>Right on top you will find the command sequences &kdevelop; did actually
+use to perform the search. This will be useful to more precisely control the
+search outcome.</para>
+</listitem>
+
+<listitem>
+<para>On bottom the number of occurrences found in these search run will be
+listed. In our example this should read <quote>*** 11 matches found
+***</quote>.</para>
+</listitem>
+</itemizedlist>
+
+<para>&kdevelop; will remember these search results throughout the currently
+running session. If you initiate another global search, its results will display
+in another tabbed window in the <guilabel>Find in Files</guilabel> tool view
+window.</para>
+</listitem>
+</itemizedlist>
+</sect3>
+</sect2>
+
+<sect2 id="gettingstarted-edit-arrange">
+<title>Arranging Editor Windows</title>
+
+<para>When your work with large complex projects you will often end up with
+quite a lot of tabbed editor windows residing on the tab bar. This makes
+specific facilities to clean up, order, and group all those editor tabs
+necessary. &kdevelop; provides several means for this. We will have a short look
+at some of them.</para>
+<simplelist>
+<member><link linkend="gettingstarted-edit-arrange-clean">How to remove unneeded
+tabs.</link></member>
+<member><link linkend="gettingstarted-edit-arrange-tabs">How to rearrange the
+tabs.</link></member>
+<member><link linkend="gettingstarted-edit-arrange-split">How to view several
+files simultaneously in the workspace area.</link></member>
+<member><link
+linkend="gettingstarted-edit-arrange-sourceheader">How to edit
+C++ source and header files simultaneously</link></member>
+<member><link linkend="gettingstarted-edit-arrange-group">How to group source
+files into development sessions.</link></member>
+</simplelist>
+
+<sect3 id="gettingstarted-edit-arrange-clean">
+<title>Cleaning up the Tabs Row</title>
+
+<para>If the vast amount of editor window tabs becomes badly arranged at all,
+you usually may want to close all those tabs you really do not need any more.
+&kdevelop; provides several facilities to do so, the usual way of bulk closing
+open editor windows and a more specific approach where you can expressly command
+which ones to close and which to keep open.</para>
+
+<formalpara>
+<title>Closing Several Tabs At Once</title>
+<para>This is kind of a bulk approach to close unnecessarily open tabs which you
+may find in other &kde; applications as well. You can use the
+<guimenu>Window</guimenu> menu or right click on a tab to either</para>
+</formalpara>
+<itemizedlist>
+<listitem>
+<para>close the currently selected editor window,</para>
+</listitem>
+<listitem>
+<para>close all other open editor windows, or</para>
+</listitem>
+<listitem>
+<para>close all editor windows at once (available from the
+<guimenu>Window</guimenu> menu only).</para>
+</listitem>
+</itemizedlist>
+
+<formalpara>
+<title>Closing Selected Sets of Tabs</title>
+<para>The step-by-step approach of closing individual editor window tabs can
+become awkward if there are a great number of tabs from which you want to still
+keep several open. Instead of searching and closing one editor window tab after
+another &kdevelop; provides a means to select the candidates from a list and
+close those, and only those, with one single mouse click.</para>
+</formalpara>
+
+<para>Let us illustrate this on a simple example.
+In our Hello example project let us assume there were several files open for
+edit: <filename>hello.cpp</filename>, <filename>hello.h</filename>,
+<filename>helloui.rc</filename>, <filename>hello.desktop</filename>, and
+<filename>main.cpp</filename>. Now you want to close all of them except
+<filename>hello.cpp</filename> and <filename>hello.h</filename>. The easiest way
+to do so is with the <guilabel>File List</guilabel> tool view. Because this list
+of open files is alphabetically ordered you can more easily find the ones you
+want to be closed. Proceed as follows:</para>
+
+<procedure>
+<step>
+<para>Open <guilabel>File List</guilabel> and, with the <keycap>Ctrl</keycap>
+key held down, click the files you want to be closed in the list.</para>
+</step>
+<step>
+<para>Then, keeping the mouse pointer on a file name in the list, click the
+right mouse button.</para>
+</step>
+<step>
+<para>From the <guimenu>File List</guimenu> popup menu select <guimenuitem>Close
+Selected</guimenuitem>.</para>
+</step>
+</procedure>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="file-list-close-selected.png" format="PNG"/>
+</imageobject>
+<caption><para>How to close selected editor windows in one
+step.</para></caption>
+</mediaobject>
+</screenshot>
+<para>That was all.
+&kdevelop; will have closed all editor windows at your wish, and you are ready
+to proceed with a clean tab bar again.</para>
+</sect3>
+
+<sect3 id="gettingstarted-edit-arrange-tabs">
+<title>How to Rearrange Edit Window Tabs</title>
+
+<para>Even if you have only the really necessary editor windows open you may
+still want to have their tabs arranged in some logical way. &kdevelop; provides
+some common means to do so, in short:</para>
+
+<formalpara>
+<title>Basic Setup &mdash; Where to Position New Tabs</title>
+
+<para>By default, when you open a new editor window, its tab will be inserted to
+the right of the editor window tab currently in use. This can be changed so that
+the new tab will open to the far right on the tab bar.</para>
+</formalpara>
+<para>You must change a basic user interface setting in &kdevelop; to enable
+this behavior.</para>
+<procedure>
+<step>
+<para>Select <menuchoice><guimenu>Settings</guimenu> <guimenuitem>Configure
+KDevelop...</guimenuitem></menuchoice></para>
+</step>
+<step>
+<para>In the left hand icon bar on the dialog popup click the <guilabel>User
+Interface</guilabel> icon. The <guilabel>User Interface</guilabel> dialog page
+will be now shown.</para>
+</step>
+<step>
+<para>In the left bottom corner there find the section labeled <guilabel>Tabbed
+Browsing</guilabel>. Remove the check mark on the <guilabel>Open new tab after
+current tab</guilabel> line.</para>
+</step>
+<step>
+<para>Close &kdevelop; and restart it again. Now the new editor window tabs will
+open at the far right end of the current tabs row.</para>
+</step>
+</procedure>
+
+<para>Unfortunately, this setting cannot be changed on the fly during a
+development session. You must make up your mind which behavior you prefer in the
+long run and then stick to it, at least until the next start of
+&kdevelop;.</para>
+
+<formalpara>
+<title>How to Rearrange the Tabs</title>
+<para>As development tasks do vary over time, the need to rearrange the tabbed
+editor windows will more or less often arise. This is easily accomplished in
+&kdevelop;.</para>
+</formalpara>
+<para>
+Just click the tab you want to move with the middle mouse button and move the
+mouse a short distance. The cursor will change to a crossed-arrow pattern. You
+can now drag this tab, holding the middle mouse button down, until it did skip
+into the place where you want it to be.</para>
+</sect3>
+
+<sect3 id="gettingstarted-edit-arrange-split">
+<title>Viewing Several Files Simultaneously</title>
+
+<para>At first sight there is always at most one single editor window open to
+work on a source file. Although you may fast switch the tabbed windows, there
+are times where you want have several files open at once, &eg; for reference
+purposes or to keep complex tasks under better control. To accomplish this,
+&kdevelop; provides a way to split the workspace area into different,
+simultaneously visible sections which each can hold their own series of tabbed
+windows.</para>
+
+<para>There are two split commands which you can reach either through the
+<guimenu>Window</guimenu> menu or by right clicking either into a tabbed window
+or on the window tab itself. We will illustrate this splitting behavior again
+with our Hello example project.</para>
+
+<para>Assume there are two source files open on the tab bar,
+<filename>hello.cpp</filename> and <filename>hello.h</filename>. Now, while
+working on the <filename>hello.cpp</filename> source, you often need to refer to
+the declarations in the <filename>hello.h</filename> headers file, so you want
+to keep both files open simultaneously.</para>
+
+<para>To get this done, right click on the tab of, say,
+<filename>hello.h</filename>. The following menu will then pop up.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="split-workspace.png" format="PNG"/>
+</imageobject>
+<caption><para>How to split the current workspace area into two
+parts.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Select the <guimenuitem>Split Horizontal</guimenuitem> entry. This will
+split the current workspace area in the middle and move the tabbed editor window
+holding the <filename>hello.h</filename> file into the lower part.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="split-windows.png"/>
+</imageobject>
+<caption><para>The workspace has been split horizontally.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Note the dotted separator line between both windows. You can grab it with
+the mouse and adjust the heights of the editor windows according to your
+needs.</para>
+
+<para>There are a few points to note.</para>
+<itemizedlist>
+<listitem>
+<para>The split workspace areas are fully functional at their own. This means,
+new tabbed windows will open in the workspace which contains the currently
+active editor window. And you can split any sub-area again to your wish, thus
+keeping as much windows open simultaneously as you need.</para>
+</listitem>
+
+<listitem>
+<para>Any split will move the currently active editor window into the new
+workspace sub-area, either downward or to the right. The other tabbed windows
+all remain where they were. You cannot directly move tabbed windows between
+split areas, instead you need to explicitly close the window in one workspace
+area and reopen it in another to regroup.</para>
+</listitem>
+
+<listitem>
+<para>Also, there is no direct way to close a split area again.
+It closes automatically, once the last tabbed window in it was closed.</para>
+</listitem>
+</itemizedlist>
+</sect3>
+
+<sect3 id="gettingstarted-edit-arrange-sourceheader">
+<title>Edit C++ Source and Header Files Simultaneously</title>
+
+<para>There is a neat application of the above mentioned workspace split
+feature built into &kdevelop;. It allows to automatically keep a
+<filename>.cpp</filename> source and its accompanying
+<filename>.h</filename> header file side by side open in the workspace area.
+And, optionally, it allows to work on both files synchronously, such that if
+you select a declaration in the header file &kdevelop; will navigate to the
+respective definition in the source file and vice versa.</para>
+
+<para>This feature is however deactivated by default. If you want to use it in
+your project you need to activate it.</para>
+
+<para>Select <menuchoice><guibutton>Project</guibutton>
+<guimenuitem>Project Options</guimenuitem></menuchoice>. The
+<guilabel>Project Options</guilabel> dialog will pop up. In the left hand icon
+bar there select <guiicon>C++ Support</guiicon> and subsequently the
+<guilabel>Navigation</guilabel> tab on the dialog page which will display on
+the right side.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="split-source-header.png" format="PNG"/>
+</imageobject>
+<caption><para>Have C++ source and header files be displayed side by
+side.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Now check the <guilabel>Enable split of Header/Source files</guilabel>
+box. This will enable <guilabel>Automatic Synchronize</guilabel>
+and <guilabel>Vertical</guilabel> by default. Keep these settings for now and
+press <guibutton>OK</guibutton>.</para>
+
+<para>To illustrate this feature, now close in our example Hello project
+both the <filename>hello.cpp</filename> and <filename>hello.h</filename> editor
+windows, if necessary. Then select <filename>hello.cpp</filename> again from the
+<filename class="directory">src</filename> subdirectory of the project. The
+editor window will open as usual. But if you now open the
+<filename>hello.h</filename> belonging to it, &kdevelop; will automatically
+split the workspace and open this header file editor window just beneath the
+<filename>hello.cpp</filename> window.</para>
+
+<para>There is even more, as we mentioned already. In the
+<filename>hello.cpp</filename> editor find &eg; this constructor definition
+line:</para>
+<programlisting>
+Hello::Hello()
+</programlisting>
+<para>and put the cursor there. Then look at the <filename>hello.h</filename>
+window below and note how &kdevelop; did navigate to the corresponding default
+constructor declaration line.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="split-source-header-navigate.png" format="PNG"/>
+</imageobject>
+<caption><para>&kdevelop; automatically navigated to the constructor
+declaration.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>This works vice versa as well. Whenever you put the cursor somewhere into
+a construct in one editor window, &kdevelop; will navigate to the corresponding
+construct in the other.</para>
+</sect3>
+
+<sect3 id="gettingstarted-edit-arrange-group">
+<title>Grouping Source Files Into Development Sessions</title>
+
+<para>When your project grows larger, and the development tasks become more and
+more complex and force you to often switch between different, even distinct sets
+of files, it is about time to organize your development work into distinct
+sessions. The <guilabel>File List</guilabel> tool view of &kdevelop; allows you
+do to just this.</para>
+
+<para>On top of the <guilabel>File List</guilabel> tool view window there is a
+tool bar where you can create, save, select, and remove such sessions. Or
+alternatively use the <menuchoice><guimenu>View</guimenu> <guimenuitem>View
+Sessions</guimenuitem></menuchoice> sub-menu.</para>
+
+<para>We will illustrate this facility again with our Hello example project.
+Assume you want to always open the <filename>hello.cpp</filename>,
+<filename>hello.h</filename>, and <filename>main.cpp</filename> files all in one
+step, no matter what development task you just did perform in the project. To
+accomplish this, you first need to create a new development session named, say,
+<quote>sources</quote>.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="file-list-session-create.png" format="PNG"/>
+</imageobject>
+<caption><para>Use development sessions to remember groups of
+files.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>This is a multiple step approach as follows.</para>
+<procedure>
+<step>
+<para>Create a new session</para>
+<substeps>
+<step>
+<para>Click the <guiicon>New Session</guiicon> icon top left in the
+<guilabel>File List</guilabel> tool view window.</para>
+</step>
+<step>
+<para>A dialog will pop up. In the <guilabel>Enter the name of the
+session</guilabel> input field give your new session a name, &eg;
+<quote>sources</quote>.</para>
+</step>
+<step>
+<para>Close the dialog with <guibutton>OK</guibutton>. The new session will now
+be listed in the drop down box on the toolbar.</para>
+</step>
+</substeps>
+</step>
+<step>
+<para>This new session will initially be empty. You must populate it with the
+files you want to be kept there.</para>
+<substeps>
+<step>
+<para>Open all files you want to be grouped in this development session. In our
+example we decided to keep <filename>hello.cpp</filename>,
+<filename>hello.h</filename>, and <filename>main.cpp</filename> there as
+planned.</para>
+</step>
+<step>
+<para>Once your file list is complete, click the <guiicon>Save Session</guiicon>
+icon in the toolbar. Do not skip this step, &kdevelop; will forget the file list
+otherwise.</para>
+</step>
+</substeps>
+</step>
+</procedure>
+
+<para>That was it. Whenever you select the <guilabel>sources</guilabel> session
+from the <guilabel>Open Session</guilabel> drop down box, &kdevelop; will close
+all currently open editor windows and open the remembered ones
+(<filename>hello.cpp</filename>, <filename>hello.h</filename>, and
+<filename>main.cpp</filename> in our example) instead.</para>
+
+<para>You can define as many sessions as you wish in the context of your
+project. If you want to change the session&apos;s contents, just update the
+remembered file list with a <guiicon>Save Session</guiicon> click. And if you
+want get rid of a session, select it in the drop down box, then click the
+<guiicon>Delete Session</guiicon> icon in the toolbar right.</para>
+
+<para>There is even more. You can force &kdevelop; to open a given session by
+default when it loads the project. Just select the session in the drop down box
+on the <menuchoice><guimenu>Projects</guimenu> <guimenuitem>Project
+Options</guimenuitem> <guimenuitem>File List</guimenuitem></menuchoice> project
+options configuration page.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="file-list-session-default.png" format="PNG"/>
+</imageobject>
+<caption><para>Let &kdevelop; open a specific session when the project is
+loaded.</para></caption>
+</mediaobject>
+</screenshot>
+</sect3>
+</sect2>
+
+<sect2 id="gettingstarted-edit-problems">
+<title>Keeping an Eye on Common Problems</title>
+
+<para>When you open an editor window containing a source file, &kdevelop; will
+parse its contents. This allows the built in <emphasis>problem
+reporter</emphasis> to scan the source text for some common errors it knows of.
+And it can alert the user of different places which have been marked for special
+treatment.</para>
+
+<para>Let us illustrate this facility with our Hello example project.</para>
+
+<itemizedlist>
+<listitem>
+<para>Open an editor window with the <filename>main.cpp</filename> source
+file.</para>
+</listitem>
+
+<listitem>
+<para>Make sure it still contains the following line somewhere towards the
+end:</para>
+<programlisting>
+ /// @todo do something with the command line args here
+</programlisting>
+<para>This was inserted by the &appwizard; when you created the Hello project in
+the <link linkend="gettingstarted-new">Starting a New Project</link> chapter
+above.</para>
+</listitem>
+
+<listitem>
+<para>Now open the <guilabel>Problems</guilabel> tool view in the bottom tabs
+row. If all went right, it will currently report this todo:</para>
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="problem-report-todo.png"/>
+</imageobject>
+<caption><para>&kdevelop; is alerting a source code line containing a todo
+mark.</para></caption>
+</mediaobject>
+</screenshot>
+</listitem>
+</itemizedlist>
+
+<para>The format of the <computeroutput>/// @todo</computeroutput> command is
+for special treatment by the <application>Doxygen</application> code documenter,
+which we will look at briefly in the <link
+linkend="gettingstarted-doc">Documentation</link> section below. It is not
+mandatory that you use this format, the more common
+<computeroutput>TODO</computeroutput> and <computeroutput>FIXME</computeroutput>
+comment marks will be recognized as well.</para>
+
+<para>If you &eg; insert the following <computeroutput>TODO</computeroutput> and
+<computeroutput>FIXME</computeroutput> comment lines in our
+<filename>hello.cpp</filename> example file</para>
+<programlisting>
+Hello::Hello()
+ : KMainWindow( 0, "Hello" )
+{
+ // set the shell's ui resource file
+ // TODO check the user interface
+ setXMLFile("helloui.rc");
+
+ // FIXME change to a better suited greeting
+ new QLabel( "Hello World", this, "hello label" );
+}
+</programlisting>
+<para>you will find them listed in the <guilabel>Problems</guilabel> tool view
+as well:</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="problem-report-marks.png" format="PNG"/>
+</imageobject>
+<caption><para>The problem reporter listing lines which require attention in the
+currently edited file.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Note the other tabs in the <guilabel>Problem</guilabel> reporter tool view
+window, especially <guilabel>Fixme</guilabel>, and <guilabel>Todo</guilabel>. If
+you open them, you will find all <computeroutput>FIXME</computeroutput> and
+<computeroutput>TODO</computeroutput> marked lines, &kdevelop; has found so far
+in this session. For example the <computeroutput>TODO</computeroutput> alerts
+will currently look thus:</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="problem-report-all-todos.png" format="PNG"/>
+</imageobject>
+<caption><para>The problem reporter has collected the
+<computeroutput>TODO</computeroutput> alerts.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>The <guilabel>Errors</guilabel> tab will however not list every coding
+error you make. This is the job of other tools in &eg; the build process. But
+you will find here alerts of some common programming mistakes which would likely
+go unnoticed otherwise and probably be catched with difficulties during complex
+debugging session.</para>
+
+<para>You will find the &kdevelop; problem reporter facility a very valuable
+tool, so check the <guilabel>Problems</guilabel> tool view regularly in the
+development process.</para>
+</sect2>
+</sect1>
+
+<sect1 id="gettingstarted-compile">
+<title>How to Compile a Project</title>
+
+<para>Compiling a project in &kdevelop; requires several setup steps and then
+building the application. All these are available through the
+<guimenu>Build</guimenu> menu.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="build-menu.png" format="PNG"/>
+</imageobject>
+<caption><para>Building a project requires several steps.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>We are interested for now in the upper section only of this menu. The
+entries there are sorted in order of their importance. Thus the most often
+needed command is on top, the <guimenuitem>Build Project</guimenuitem> entry,
+which will cause all of the project be initialized, compiled and linked as
+needed. Other entries are there to compile selected project portions or a single
+file only, to perform several initialization sequences, or to install the
+completed application binaries.</para>
+
+<para>For now we will concentrate on several facilities which &kdevelop;
+provides for project setup, initializing, building, and running an application.
+In general, this includes:</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-compile-basic">Looking briefly at the
+basic build cycle.</link></member>
+<member><link linkend="gettingstarted-compile-setup">Looking at some basic
+means to configure a project.</link></member>
+</simplelist>
+
+<sect2 id="gettingstarted-compile-basic">
+<title>The Basic Build Cycle</title>
+
+<para>Once you created a new project you usually want to check if everything
+went right so far. This implies a first build and test run of the application,
+which we will do now. In order to initially compile a project there are several
+steps to perform, which we will briefly look at.</para>
+<simplelist>
+<member><link linkend="gettingstarted-compile-basic-init">How to initialize the
+project for a first build.</link></member>
+<member><link linkend="gettingstarted-compile-basic-config">How to do the
+initial configuration.</link></member>
+<member><link linkend="gettingstarted-compile-basic-build">How to build the
+project.</link></member>
+<member><link linkend="gettingstarted-compile-basic-run">How to run the
+application from within &kdevelop;.</link></member>
+</simplelist>
+
+<note>
+<para>This discussion implies that your project is based on the &GNU; autotools,
+which enabled the &automanag; tool in &kdevelop; as our example Hello project
+does. If you created another type project, &eg; for the &Qt; based
+<application>QMake</application> project manager, there will be other facilities
+available in the menus or perhaps even none of them. You will have to consult
+the respective vendor documentation on project management and application
+building in these cases.</para>
+</note>
+
+<sect3 id="gettingstarted-compile-basic-init">
+<title>Initialize the Project for the Build</title>
+
+<para>When the &appwizard; created our Hello example project, it left it in a
+sort of raw, <quote>virgin</quote> state. The &GNU; autotools chain dictates
+several initialization steps to be performed before the application could be
+actually compiled and linked. If you try to build a project in such a raw state,
+&eg; by selecting the <menuchoice><guimenu>Build</guimenu> <guimenuitem>Build
+Project</guimenuitem></menuchoice> menu or pressing the <keycap>F8</keycap>
+function key, you will get the following warning.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="raw-project-warning.png" format="PNG"/>
+</imageobject>
+<caption><para>Trying to build a raw automake based project.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>You may press the <guibutton>Run Them</guibutton> button in which case
+&kdevelop; will try to automatically run all required setup steps prior to
+compiling and linking the application. But we will look at those initial steps
+in sequence, so cancel the dialog by pressing <guibutton>Do Not run</guibutton>.
+</para>
+
+<para>As mentioned already, compiling and linking the application is done
+through the <guimenu>Build</guimenu> menu. Call it up and select
+<guimenuitem>Run automake and friends</guimenuitem>.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="build-menu-automake.png" format="PNG"/>
+</imageobject>
+<caption><para>Initiating a basic initialization run.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>
+&kdevelop; will now open the <guilabel>Messages</guilabel> tool view window at
+the bottom and list a series of messages produced by several make tools. If
+everything went right, the final line will read
+<quote><computeroutput>*** Success ***</computeroutput></quote>.</para>
+
+<para>If you scroll back to the top, you will find the command line, &kdevelop;
+issued to call up the tools beneath the surface:</para>
+
+<programlisting>
+cd '/home/devel/projects/hello' &amp;&amp; \
+WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -f Makefile.cvs
+</programlisting>
+
+<para>This basically tells that &kdevelop; first switched to the root directory
+of our example project. Then it set up a dedicated environment, advising the
+make system of the <application>autoconf</application> and
+<application>automake</application> tool revisions used for this initialization.
+And finally it instructed the make tool (&GNU; <application>gmake</application>
+in this case) to process the <filename>Makefile.cvs</filename> make file.</para>
+
+<para>This make file was automatically set up when you created the Hello
+project. It contains all the commands necessary to properly initialize the
+project so the resulting application will run under &kde;. Especially this will
+create the <filename>configure</filename> skript file necessary to perform the
+next setup step.</para>
+</sect3>
+
+<sect3 id="gettingstarted-compile-basic-config">
+<title>Initial Hello Configuration</title>
+
+<para>Configuring means to tailor the build process to the hardware and software
+peculiarities of your system. This is a basic requirement in build processes
+based on the &GNU; autotools scheme as you probably will know.</para>
+
+<para>You can command a configure sequence once the basic automake
+initialization has been successfully finished because only after this
+initial run the necessary <filename>configure</filename> files will be
+available. This done, select the <menuchoice><guimenu>Build</guimenu>
+<guimenuitem>Run Configure</guimenuitem></menuchoice> menu entry to initiate a
+configuration sequence.</para>
+
+<para>&kdevelop; opened the <guilabel>Messages</guilabel> tool view
+window again if necessary and listed the messages of the configure run therein.
+If all went right, the final messages will be <quote><computeroutput>Good - your
+configure finished. Start make now</computeroutput></quote> (which was issued by
+configure) followed by the &kdevelop; <quote><computeroutput>*** Success
+***</computeroutput></quote> message.</para>
+
+<para id="gettingstarted-compile-basic-config-cmd">On top of the
+<guilabel>Messages</guilabel> window you will again find
+the command line, &kdevelop; used to initiate this configuration run:</para>
+
+<programlisting>
+mkdir '/home/devel/projects/hello/debug' &amp;&amp; \
+cd '/home/devel/projects/hello/debug' &amp;&amp; \
+CXXFLAGS="-O0 -g3" "/home/devel/projects/hello/configure" --enable-debug=full
+</programlisting>
+
+<para>You can tell several interesting details from these commands.</para>
+
+<informaltable frame="none">
+<tgroup cols="2"><tbody><row>
+<entry>
+<mediaobject>
+<imageobject>
+<imagedata fileref="tutorial-debug-tree.png"/>
+</imageobject>
+</mediaobject>
+</entry>
+<entry>
+<itemizedlist>
+<listitem>
+<para>First, &kdevelop; uses a dedicated subdirectory in the project directory
+tree for the build process. This <filename class="directory">debug</filename>
+build directory (shown to the left) mirrors the basic project structure and
+contains some set of build related files, such as several
+<filename>configure</filename> based files and additionally a
+<filename>Makefile</filename> in each subdirectory.</para>
+</listitem>
+<listitem>
+<para>In the <link linkend="gettingstarted-compile-setup">Configuring the
+Project</link>
+section shortly below we will have a brief look at the motivations why
+&kdevelop; uses separate build directories in cases like this one. For the
+moment it is enough to know that &kdevelop; created this <filename
+class="directory">debug</filename> directory &mdash; if necessary &mdash; prior
+to the configure call and that the <filename>configure</filename> script did
+build the sub structure and all the <filename>Makefiles</filename> in
+there.</para>
+</listitem>
+<listitem>
+<para>Next, from within the <filename class="directory">debug</filename> build
+directory, &kdevelop; called the <filename>configure</filename> script in the
+root directory of our project using a dedicated environment, where the
+<computeroutput>CXXFLAGS="-O0 -g3"</computeroutput> flags will later signal the
+&gcc; compiler that it should not optimize the resulting binaries and include
+full debugging information with them.</para>
+</listitem>
+<listitem>
+<para>Finally the <filename>configure</filename> script was called with the
+<computeroutput>--enable-debug=full</computeroutput> option which instructs it
+to create each <filename>Makefile</filename> so that later compilation and
+linking will have all necessary debugging information be built in and
+usable.</para>
+</listitem>
+</itemizedlist>
+</entry>
+</row></tbody></tgroup>
+</informaltable>
+
+<para>All these settings are configurable on a per project basis. You will learn
+more about this in the <link linkend="project-management">Project
+Management</link> chapter.</para>
+</sect3>
+
+<sect3 id="gettingstarted-compile-basic-build">
+<title>Build the Project</title>
+
+<para>Once you got this far you will be ready to actually build, &ie;
+compile and link the application. Looking at the <guimenu>Build</guimenu> menu,
+there are three such compile options from which to select.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="build-commands.png" format="PNG"/>
+</imageobject>
+<caption><para>&kdevelop; commands to build binaries.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Going from bottom to top, there are:</para>
+<itemizedlist>
+<listitem>
+<para><guimenuitem>Compile File</guimenuitem> &mdash; This will compile the
+source file in the currently open editor window. Mostly used for quick error
+checks.</para>
+</listitem>
+<listitem>
+<para><guimenuitem>Build Active Target</guimenuitem> &mdash; This is mainly used
+in conjunction with the <link linkend="gettingstarted-extend-automake">Automake
+Manager</link> which we will briefly look at below.</para>
+</listitem>
+<listitem>
+<para><guimenuitem>Build Project</guimenuitem> &mdash; Now this is what we
+currently are interested in. It will iterate over the whole project, compiling
+and linking all files as necessary.</para>
+</listitem>
+</itemizedlist>
+
+<para>It might be interesting to watch what happens to the
+<filename class="directory">Debug</filename> directory created in the former
+<filename>configure</filename> run. So best keep it open with all
+subdirectories unfolded just as shown above. Then select
+<menuchoice><guimenu>Build</guimenu> <guimenuitem>Build
+Project</guimenuitem></menuchoice> (or press the <keycap>F8</keycap> key) to
+initiate the build sequence. As before, the <guilabel>Messages</guilabel> tool
+view window will open at the bottom and list the outcome of this build run. And
+additionally some files will appear on the <filename
+class="directory">Debug</filename> subtree.</para>
+
+<para id="gettingstarted-compile-basic-build-cmd">There are not many source
+files in our Hello example project, so the <guilabel>Messages</guilabel> window
+will contain only a few lines. On top of them again find the command line
+&kdevelop; issued to the underlying shell.</para>
+
+<programlisting>
+cd '/home/devel/projects/hello/debug' &amp;&amp; \
+WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
+</programlisting>
+
+<para>Not very surprisingly, &kdevelop; switched to the <filename
+class="directory">Debug</filename> subtree root in order to run the
+<filename>Makefile</filename> located there. A dedicated sub-environment was
+set up again as before in the <link
+linkend="gettingstarted-compile-basic-init">Initialization step</link> in which
+then the <application>gmake</application> tool was called.</para>
+
+<para>Note the <computeroutput>-k</computeroutput> option in the
+<application>gmake</application> call. It forces the build process to continue
+up to its very end, even if errors will occur. This makes sense as &kdevelop;
+will list all error messages in the <guilabel>Messages</guilabel> window. If
+there are any, use the virtues of an &IDE;: Just click on the error message in
+the <guilabel>Messages</guilabel> window and &kdevelop; will take you to
+exactly the position where the error occurred in the source file.</para>
+
+<para>And what did happen inside the <filename
+class="directory">Debug</filename> subtree? Not very much. A few files showed up
+on the <filename class="directory">doc/en</filename> and <filename
+class="directory">src</filename> branches, most notably the
+<filename>hello</filename> file in <filename
+class="directory">/home/devel/projects/hello/debug/src/</filename>. This,
+finally, is the application binary we were looking for. All what is left
+to do in our initial project check is to run this
+<filename>hello</filename>.</para>
+</sect3>
+
+<sect3 id="gettingstarted-compile-basic-run">
+<title>Run the Application</title>
+
+<para>There are no extra steps involved to run this new Hello
+application. Either select <menuchoice><guimenu>Build</guimenu>
+<guimenuitem>Execute Program</guimenuitem></menuchoice> or press
+<keycombo><keycap>Shift</keycap> <keycap>F9</keycap></keycombo> or use the
+<guibutton>Execute program</guibutton> button on the <guilabel>Build
+Toolbar</guilabel> shown below.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="run-button.png"/>
+</imageobject>
+<caption><para>Running an application form the <guilabel>Build
+Toolbar</guilabel>.</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<para>That was all. &kdevelop; will now start the new application in
+the dedicated console window which opens as <guilabel>Application</guilabel>
+tool view on the bottom. There the command &kdevelop; issued to execute the
+program will be shown in the top line:</para>
+
+<programlisting>
+./hello
+</programlisting>
+
+<para>showing that the &IDE; has a notion about where the executable it
+shall run resides. This notion can be widely configured. See more about
+this in the <link linkend="project-management">Project
+Management</link> chapter.</para>
+
+<para>The <computeroutput>./hello</computeroutput> line will most likely
+be followed by a warning message. Ignore this for now. It does not keep
+our <application>Hello</application> form running.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="hello-world-app.png" format="PNG"/>
+</imageobject>
+<caption>
+<para>Our initial <application>Hello</application> application.</para>
+</caption>
+</mediaobject>
+</screenshot>
+
+<para>Close the <application>Hello</application> application window as
+usual. If no errors occurred, &kdevelop; will report this as
+<quote><computeroutput>*** Exited normally ***</computeroutput></quote>
+in the <guilabel>Application</guilabel> tool view window.</para>
+</sect3>
+</sect2>
+
+<sect2 id="gettingstarted-compile-setup">
+<title>Configuring the Project</title>
+
+<para>In &kdevelop; there are numerous ways how you can manage your project.
+This behavior is configurable on a per-project basis and mostly of interest to
+the advanced developer. Yet there are a few project specific settings you
+should know of right from the beginning.
+</para>
+
+<simplelist>
+<member><link linkend="gettingstarted-compile-setup-build">Of what use are build
+configurations?</link></member>
+
+<member><link linkend="gettingstarted-compile-setup-config">Where to the define
+the behavior of the <filename>configure</filename> script.</link></member>
+
+<member><link linkend="gettingstarted-compile-setup-make">Some considerations
+how <application>make</application> should run.</link></member>
+
+<member><link linkend="gettingstarted-compile-setup-run">Where should the
+executable be and how should it be called?</link></member>
+</simplelist>
+
+<sect3 id="gettingstarted-compile-setup-build">
+<title>Build Configurations</title>
+
+<para>When we did a first run of the <filename>configure</filename> script in
+the <link linkend="gettingstarted-compile-basic-config">Initial Hello
+Configuration</link> section above, we noted that &kdevelop; had set up a
+dedicated <filename class="directory">debug</filename> subdirectory for this
+purpose. In this section we will briefly consider some consequences of
+this feature.</para>
+
+<para>First of all, &kdevelop; does not necessarily use dedicated build
+directories apart from the source. The preparations to automatically use
+dedicated build configurations is done through templates the &appwizard; uses
+when creating a new project.</para>
+
+<para>To find out which build configurations currently are available, have a
+look at the <menuchoice><guimenu>Project</guimenu> <guisubmenu>Build
+Configuration</guisubmenu></menuchoice> menu.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="build-configurations.png" format="PNG"/>
+</imageobject>
+<caption><para>There are various build configurations available
+for this project.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>In this case, like our Hello example project, there are three different
+build configurations available. In other cases, there may &mdash; initially
+&mdash; be only one such build configuration, namely
+<guimenuitem>default</guimenuitem>.</para>
+
+<para>The currently used build configuration has a check mark left to it. In
+order to switch to another build configuration simply select its menu
+entry.</para>
+
+<para>Now let us have a brief look at what these build configurations
+provide.</para>
+
+<variablelist id="gettingstarted-compile-setup-build-configs">
+<varlistentry>
+<term><guimenuitem>debug</guimenuitem></term>
+<listitem>
+<para>You should use this as the standard build configuration during the
+development process. The build occurs separately from the source directories in
+the dedicated <filename class="directory">debug</filename> subdirectory, &ie;
+all object, auxiliary, and executable files will be put in the subdirectories
+there instead of their counterparts in the project root. The
+<filename>configure</filename> script will be given the
+<computeroutput>--enable-debug=full</computeroutput> option and the
+<computeroutput>CXXFLAGS="-O0 -g3"</computeroutput> will signal the &gcc;
+compiler to not optimize the code and to insert extensive debug information
+into the resulting binaries.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenuitem>optimized</guimenuitem></term>
+<listitem>
+<para>This is used to build a final C++ application. The build occurs
+separately from the source directories in the dedicated <filename
+class="directory">optimized</filename> subdirectory. No specific arguments to
+the <filename>configure</filename> script will be preset, yet the
+<computeroutput>CXXFLAGS="-O2 -g0"</computeroutput> will signal the &gcc;
+compiler to optimize the code and to not insert debug information into the
+resulting binaries.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guimenuitem>default</guimenuitem></term>
+<listitem>
+<para>The term <quote>default</quote> denotes the standard setup when you build
+an application from the console using &eg; the &GNU;
+<application>configure</application> and
+<application>make</application>/<application>gmake</application> command line
+oriented build tools. Other than <guimenuitem>debug</guimenuitem> or
+<guimenuitem>optimize</guimenuitem> no dedicated build directory will be used.
+The application will by default be built in the sources directories instead.
+There are no special configuration switches predefined. Building and running the
+application will use the default settings of the underlying tools (e.g. &gcc;,
+etc.).</para>
+
+<warning>
+<para>Think twice before you decide to use the
+<guimenuitem>default</guimenuitem> build environment!</para>
+
+<para>It cannot be used in parallel to the dedicated
+<guimenuitem>debug</guimenuitem> or <guimenuitem>optimized</guimenuitem> ones.
+<emphasis>Any build operation using <guimenuitem>default</guimenuitem> will
+render both of the other build environments unusable.</emphasis> This is caused
+by some peculiarities of the <filename>Makefile</filename> construction process
+using the
+<application>automake</application>/<application>autoconf</application>
+machinery, which cannot be easily overcome.</para>
+</warning>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<para>Now, why does one one want to use different build configurations at all,
+when they even appear to be not compatible to each other? The answer is &mdash;
+it simplifies edit-compile-debug cycles. The extra debug instructions
+inserted into the binaries as well as all those subtle structure changes to
+the program code made during optimizations will effect the run time behavior of
+the resulting application. So in many cases, when the logical structure of some
+routine appears to be correct, you may want to test whether it still behaves
+correctly under more practical conditions.</para>
+
+<para>This is where the build configurations of &kdevelop; step in. Because
+the built object and executable files in each dedicated build directory and the
+build commands are kept separately from each other only source changes need
+to be handled when you switch between these build configurations.</para>
+
+<para>Thus instead of cleaning up and recompile everything from scratch with
+alternate options, you need only switch from the
+<guimenuitem>debug</guimenuitem> to the <guimenuitem>optimize</guimenuitem>
+build configuration, have the source changes compiled in and then retest the
+application under these circumstances. If anything inappropriate shows up,
+simply switch back to <guimenuitem>debug</guimenuitem> and immediately continue
+your work there.</para>
+
+<para>A final note &mdash; many build configuration settings are configurable.
+You can even define your own build configurations if your development process
+requires some. We will briefly look at these possibilities in the next
+section.</para>
+</sect3>
+
+<sect3 id="gettingstarted-compile-setup-config">
+<title>Project Configure Options</title>
+
+<para>Configuring the application properly is vital in the &GNU;
+autotools building chain. This is usually guided by option definitions to the
+<filename>configure</filename> script and/or specific flags settings in the
+environment prior to running <filename>configure</filename> as &eg; the
+<computeroutput>CXXFLAGS</computeroutput> in our previous discussions.</para>
+
+<para>You may set most of the configuring options for a given project from
+within &kdevelop; &GUI;. Select
+<menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options</guimenuitem></menuchoice> and then from the
+icon bar on the left of the dialog the <guiicon>Configure Options</guiicon>
+icon. The <guilabel>Configure Options</guilabel> dialog featuring several tabbed
+windows will display on the right handed side.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-configure.png" format="PNG"/>
+</imageobject>
+<caption><para>Most configure options can be defined here.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>As you see, there are quite a lot of options you can set up in this
+dialog. For now we will briefly look at only a few of them with regard to our
+Hello example project. For detailed instructions see the <link
+linkend="projects-configure">Configuring Projects</link> chapter. If you
+want to know more about the meaning of the various flags which can be
+set, look up <command>info make</command> from the console (or
+<command>info:make</command> from within &konqueror;) and there the
+<menuchoice><guimenu>Implicit Rules</guimenu>
+<guimenuitem>Implicit Variables</guimenuitem></menuchoice> section.</para>
+
+<para>There are several tabbed dialog setup windows from which the first
+one, <guilabel>General</guilabel>, refers to commonly used settings,
+while the others are rather compiler specific. In all cases, however, will the
+actual contents of those dialogs be governed by the given build
+configuration.</para>
+
+<para>You select the build configuration whose configuration settings
+have to be defined from the <guilabel>Configuration</guilabel> combo box
+on top of the <guilabel>Configure Options</guilabel> dialog.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-buildconfig.png" format="PNG"/>
+</imageobject>
+<caption><para>Select the build configuration whose settings to
+define.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Now select another build configuration from this combo box and note how
+the contents of &eg; the <guilabel>Configure arguments</guilabel> and
+<guilabel>Build directory</guilabel> text boxes change according to the
+settings we mentioned in the <link
+linkend="gettingstarted-compile-setup-build-configs"> build
+configurations list</link> above.</para>
+
+<sect4 id="gettingstarted-compile-setup-config-general">
+<title>General Configuration Settings</title>
+
+<para>On the <guilabel>General</guilabel> dialog page, these
+configuration options can be defined:</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Configure arguments</title>
+<para>These are the options &kdevelop; assigns to the
+<filename>configure</filename> script call in the build process. See the
+<link linkend="gettingstarted-compile-basic-config-cmd">example</link> in
+the <quote>Initial Hello Configuration</quote> section above.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Build directory</title>
+<para>This is the subdirectory in the current project root, where &kdevelop;
+will put all files created in the build process. Ideally, this should
+correspond to the name of the build configuration in use, but you are
+free to use any name you like, provided it is different from any other
+build configuration directory.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Top source directory</title>
+<para>You won&apos;t need this one often. It defaults to the project root
+directory and needs only be redefined if your project sources are located
+in another place.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>C/C++ preprocessor flags (CPPFLAGS)</title>
+<para>Put specific instructions for the preprocessor here. &kdevelop; will
+use this to set up a temporary environment before it calls the actual
+build tool. Again, see the <link
+linkend="gettingstarted-compile-basic-config-cmd">example</link> in
+the <quote>Initial Hello Configuration</quote> section above how this is
+done.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Linker flags (LDFLAGS)</title>
+<para>This is extra information for the <application>ld</application> linker
+tool where it should look for additional libraries. It is used to build the
+temporary build environment as well.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Environment Variables</title>
+<para>Here you may define additional variables to be set up in the
+temporal build environment, &kdevelop; will set up before calling the
+respective build tool. Again, you must define these environment variables for
+every build configuration where they are to be used.</para>
+</formalpara>
+</listitem>
+</itemizedlist>
+</sect4>
+
+<sect4 id="gettingstarted-compile-setup-config-spec">
+<title>Compiler Specific Settings</title>
+
+<para>The other tabs on the <guilabel>Configure Options</guilabel> dialog
+page are for compiler specific settings. They are similarly structured,
+so it suffices to have a brief look at the <guilabel>C++</guilabel> page.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-cpp.png" format="PNG"/>
+</imageobject>
+<caption><para>Select the compiler and its working environment &kdevelop; shall
+use here.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>This is what you can set up from here:</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>C++ compiler</title>
+<para>Select the C++ compiler &kdevelop; should regularly use from this
+combo box. It however lists only those compilers &kdevelop; really knows
+of.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Compiler command (CXX)</title>
+<para>Only for experts. This is only needed if the C++ compiler is not standard.
+Put the name by which it is called here.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Compiler flags (CXXFLAGS)</title>
+<para>Here you can enter any extra option &kdevelop; shall pass (via the
+<filename>Makefile</filename>) to the compiler. Some option values will be
+preset according to the build configuration selected in the
+<guilabel>Configuration</guilabel> combo box.</para>
+</formalpara>
+
+<para>Note, that many common compiler options can be selected from a
+dialog which will pop up when you press the <guibutton>...</guibutton> button to
+the right of the text box.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-cppoptions.png" format="PNG"/>
+</imageobject>
+<caption><para>Use this dialog to define the &GNU; C++ compiler
+behavior.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>We deliberately selected the <guilabel>Optimization</guilabel> tab
+here. Note how the <guilabel>No Optimization</guilabel> option has been
+preselected (according to the <computeroutput>-O0</computeroutput>
+option preset in the <computeroutput>debug</computeroutput> build
+configuration).</para>
+
+<para>Unfortunately you cannot currently select all options from this
+dialog. The <computeroutput>-g3</computeroutput> option &eg; used by the
+<computeroutput>debug</computeroutput> build
+configuration would have to be altered manually if ever needed.</para>
+</listitem>
+</itemizedlist>
+</sect4>
+</sect3>
+
+<sect3 id="gettingstarted-compile-setup-make">
+<title>How Make Should Build the Program</title>
+
+<para>You can as well configure the way &kdevelop; will call the
+<application>make</application> tool in the project build. Select
+<menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options</guimenuitem></menuchoice> and then the
+<guiicon>Make Options</guiicon> icon from the left dialog window side. The
+<guilabel>Make Options</guilabel> dialog page will then be displayed to
+the right.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-make.png" format="PNG"/>
+</imageobject>
+<caption><para>Define how &kdevelop; will call the
+<application>make</application> tool.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>There is not much to do here for now. The only setting of interest in
+most cases will be the <guilabel>Abort on first error</guilabel> switch.
+You will find it deactivated in most projects. This corresponds to the
+<computeroutput>-k</computeroutput> option in the
+<application>gmake</application> call we found in the <link
+linkend="gettingstarted-compile-basic-build-cmd">initial build</link> of
+our example Hello project.</para>
+
+<para>This makes sense in an &IDE; like &kdevelop; which will protocol any
+error message during the build. After the build process you may easily
+navigate to any error message in the <guilabel>Messages</guilabel> tool
+window. Use <menuchoice><guimenu>View</guimenu>
+<guimenuitem>Next Error</guimenuitem></menuchoice> and
+<menuchoice><guimenu>View</guimenu> <guimenuitem>Previous
+Error</guimenuitem></menuchoice> or respectively the <keycap>F4</keycap> and
+<keycombo><keycap>Shift</keycap> <keycap>F4</keycap></keycombo> keys for this.
+&kdevelop; will automatically activate the editor window of the source file in
+question and put the cursor on the error line.</para>
+
+<para>If on the other hand you rather want the build be stopped on whenever an
+error occurs, check the <guilabel>Abort on first error</guilabel> option
+in this dialog. &kdevelop; will then call <application>gmake</application>
+without the <computeroutput>-k</computeroutput> option.</para>
+</sect3>
+
+<sect3 id="gettingstarted-compile-setup-run">
+<title>How to Run the Executable</title>
+
+<para>Once the build is complete, you can easily run the application from within
+&kdevelop;. Use either <menuchoice><guimenu>Build</guimenu>
+<guimenuitem>Execute Program</guimenuitem></menuchoice>, the
+<keycombo><keycap>Shift</keycap> <keycap>F9</keycap></keycombo> keys, or the
+<guibutton>Execute program</guibutton> button in the <guilabel>Build
+Toolbar</guilabel> of &kdevelop;.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="run-button.png" format="PNG"/>
+</imageobject>
+<caption><para>Run the program from here.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>But where is the executable located which should be run? How does
+one have &kdevelop; append options to the call? Or, how can I have the
+application executed in a terminal by its own to test its console interactive
+behavior?</para>
+
+<para>All this can be solved by configuring some project oriented run options in
+&kdevelop;. Select <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options</guimenuitem></menuchoice> and then the
+<guiicon>Run Options</guiicon> icon from the icon bar on the left dialog window
+side. The <guilabel>Run Options</guilabel> dialog page will display to the
+right.</para>
+
+<screenshot>
+<mediaobject>
+<imageobject>
+<imagedata fileref="configure-project-run.png" format="PNG"/>
+</imageobject>
+<caption><para>Define where and how your program shall be run.</para></caption>
+</mediaobject>
+</screenshot>
+
+<para>Now, there is quite a lot which can be set up from this dialog.
+Basically there are four groups of configuration items.</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>Directory</title>
+<para>This tells &kdevelop; where it basically shall assume the
+executable to be called. There are three possibilities you can select
+from.</para>
+</formalpara>
+
+<para>Note however that only root directories are defined here.
+&kdevelop; usually looks for the executable in some subdirectory
+given in the next configuration group.</para>
+
+<itemizedlist>
+<listitem>
+<para>Run from the directory, where the executable was build the last
+time. This is the default. You can keep this for now.</para>
+</listitem>
+
+<listitem>
+<para>Run from the build directory according to the currently selected
+<link linkend="gettingstarted-compile-setup-build">build configuration</link>.
+The name of this directory was set up on the <link
+linkend="gettingstarted-compile-setup-config-general">General
+Configuration</link> dialog page.</para>
+
+<para>This is the root where &kdevelop; will find the executable. It
+changes automatically with the selection you made in
+<menuchoice><guimenu>Project</guimenu>
+<guisubmenu>Build Configurations</guisubmenu></menuchoice> menu. Try it.</para>
+
+<para>Other than always running the most recently built executable according to
+the setting above, this allows you to switch the program to be executed by
+simply selecting another build configuration from the <guimenu>Project</guimenu>
+menu.</para>
+</listitem>
+
+<listitem>
+<para>Run the executable found in a fixed custom directory. Again
+this is the root only from where the actual executable is to be
+found.</para>
+
+<para>Use this if you &eg; want to run the actually installed program instead of
+the version located in the project directories.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Program</title>
+<para>This tells &kdevelop; the relative position and name of the
+program it shall actually call. This is relative to the root directory
+defined in the configuration group above. Furthermore you can define any
+argument &kdevelop; will pass to the program when it is actually called.</para>
+</formalpara>
+
+<note>
+<para>If leave the <guilabel>Main program</guilabel> text box empty, the
+<emphasis>active target</emphasis> settings of the &automanag; will be used.
+Although this is an expert setting, inadvertently leaving this input
+field blank is a common cause of problems. Check this setting if &kdevelop;
+appears not to call the executable you wanted.</para>
+</note>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Environment Variables</title>
+<para>&kdevelop; will set up a dedicated shell environment to run the
+program in. Define any extra environment variable in this configuration
+group.</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>Miscellaneous</title>
+<para>Two more check boxes are located at the bottom of this dialog page.</para>
+</formalpara>
+
+<itemizedlist>
+<listitem>
+<para><guilabel>Automatically compile before execution</guilabel> comes
+in handy most of time. &kdevelop; will check the project for changes and
+perform necessary configure and build steps for you any time you command
+it to run the program.</para>
+
+<para>Uncheck this in case you want to run the program version prior to the
+last change.</para>
+</listitem>
+
+<listitem>
+<para><guilabel>Start in external terminal</guilabel> is interesting if
+you want to test the input/output behavior of non-&GUI; programs in a console
+terminal. This is unchecked by default, so &kdevelop; does start the program in
+a window of its own without console terminal I/O capabilities.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+</itemizedlist>
+</sect3>
+</sect2>
+</sect1>
+
+<sect1 id="gettingstarted-extend">
+<title>How to Extend a Project &mdash; the &automanag;</title>
+
+<para>(- to be written -)</para>
+
+<sect2 id="gettingstarted-extend-automake">
+<title>A Short Look at the Automake Machinery</title>
+
+<para>(- to be written -)</para>
+</sect2>
+
+<sect2 id="gettingstarted-extend-pics">
+<title>How to Place Icons in a Separate Directory</title>
+
+<para>(- to be written -)</para>
+</sect2>
+
+<sect2 id="gettingstarted-extend-class">
+<title>How to Add New Classes</title>
+
+<para>(- to be written -)</para>
+
+<caution><para>
+Be careful when you select your class file names. It is extremely difficult to
+change them later.</para></caution>
+</sect2>
+
+<sect2 id="gettingstarted-extend-subproject">
+<title>What is in a Subproject?</title>
+
+<para>(- to be written -)</para>
+
+<sect3 id="gettingstarted-extend-subproject-active">
+<title>Concentrate on Your Work &mdash; the Active Target</title>
+
+<para>(- to be written -)</para>
+</sect3>
+</sect2>
+
+<sect2 id="gettingstarted-extend-restructure">
+<title>Some Steps to Restructure a Project</title>
+
+<para>(- to be written -)</para>
+</sect2>
+</sect1>
+
+
+<sect1 id="gettingstarted-debug">
+<title>How to Debug</title>
+
+<para>(- to be written -)</para>
+</sect1>
+
+
+<sect1 id="gettingstarted-doc">
+<title>A Note on Your Project Documentation</title>
+
+<para>The &kde; project uses <ulink
+url="http://www.docbook.org/tdg5/en/html/docbook.html">docbook</ulink> for
+generating your project handbook (&ie; the user manual). The user manual is
+available through your application menubar by choosing
+<menuchoice><guimenu>Help</guimenu>
+<guimenuitem><replaceable>YourApplication</replaceable>
+Handbook</guimenuitem></menuchoice > when your &kde; GUI application is running.
+After building your project, the user manual is displayed in &kde;
+&khelpcenter;. It should explain to the user how your application works, what
+are the main features and how to configure it. It should also explain the
+advanced features if any.
+</para>
+<para>All &kde; based templates in &kdevelop; have a doc subdir which contains
+a <filename>index.docbook</filename> template in the en folder to get you
+started in writing the user manual. You should edit this
+<filename>index.docbook</filename> in &kdevelop; and start changing personal
+details such as name, email, &etc;. Look at the comments in this file and try
+following these indications to start your application documentation. Rebuild
+your project to see the changes in &khelpcenter;.</para>
+<note><para>You need to install your project using
+<menuchoice><guimenu>Build</guimenu>
+<guimenuitem>Install</guimenuitem></menuchoice > or <guimenuitem>Install (as
+root user)</guimenuitem> in &kdevelop; to see the user manual in
+&khelpcenter;.</para></note>
+<para>You can find more about the docbook syntax on <ulink
+url="http://l10n.kde.org/docs/markup/index.html">the &kde; documentation
+website</ulink>.</para>
+</sect1>
+
+<sect1 id="gettingstarted-keys">
+<title>Last But Not Least, Keyboard Shortcuts</title>
+
+<para>(- to be written -)</para>
+</sect1>
+
+<sect1 id="gettingstarted-whereto">
+<title>Where to go from here</title>
+
+<para>(- to be written -)</para>
+
+<sect2 id="gettingstarted-whereto-faq">
+<title>Frequently Encountered Problems</title>
+
+<simplelist>
+<member>The nutshell chapter</member>
+<member>FAQ pages</member>
+<member>Forum</member>
+<member>Mailing lists</member>
+</simplelist>
+</sect2>
+
+<sect2 id="gettingstarted-whereto-projects">
+<title>Working With Projects</title>
+
+<para>(- to be written -)</para>
+
+<sect3 id="gettingstarted-whereto-projects-open">
+<title>Using Existing &kdevelop; Projects</title>
+
+<para>(- to be written -)</para>
+</sect3>
+
+<sect3 id="gettingstarted-whereto-projects-import">
+<title>Importing External Projects</title>
+
+<para>(- to be written -)</para>
+</sect3>
+</sect2>
+</sect1>
+
+</chapter>
diff --git a/doc/kdevelop/hello-world-app.png b/doc/kdevelop/hello-world-app.png
new file mode 100644
index 00000000..6f2ab007
--- /dev/null
+++ b/doc/kdevelop/hello-world-app.png
Binary files differ
diff --git a/doc/kdevelop/importdirectory.png b/doc/kdevelop/importdirectory.png
new file mode 100644
index 00000000..3d0372ad
--- /dev/null
+++ b/doc/kdevelop/importdirectory.png
Binary files differ
diff --git a/doc/kdevelop/index.docbook b/doc/kdevelop/index.docbook
new file mode 100644
index 00000000..993400c0
--- /dev/null
+++ b/doc/kdevelop/index.docbook
@@ -0,0 +1,372 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+<!-- <!ENTITY kdevelop "<application>KDevelop</application>"> -->
+ <!ENTITY kdevelop "KDevelop">
+ <!ENTITY kdevrelease "3.3.91">
+
+ <!-- abbreviations used in the body text -->
+ <!ENTITY apache "<application>Apache</application>">
+ <!ENTITY API "<acronym>API</acronym>">
+ <!ENTITY appwizard "Application Wizard">
+ <!ENTITY autoconf "<command>autoconf</command>">
+ <!ENTITY automake "<command>automake</command>">
+ <!ENTITY automanag "Automake Manager">
+ <!ENTITY ctags "<command>ctags</command>">
+ <!ENTITY CVS "<application>CVS</application>">
+ <!ENTITY cvs "CVS">
+ <!ENTITY doxygen "<application>Doxygen</application>">
+ <!ENTITY doxywizard "<application>doxywizard</application>">
+ <!ENTITY egrep "<command>egrep</command>">
+ <!ENTITY grep "<command>grep</command>">
+ <!ENTITY HTML "<acronym>HTML</acronym>">
+ <!ENTITY IDE "<acronym>IDE</acronym>">
+ <!ENTITY libtool "<command>libtool</command>">
+ <!ENTITY nfwizard "New File Wizard">
+ <!ENTITY python "<application>Python</application>">
+ <!ENTITY perl "<application>Perl</application>">
+ <!ENTITY php "<application>PHP</application>">
+ <!ENTITY promanag "Project Manager">
+ <!ENTITY qte "<application>Qt/embedded</application>">
+ <!ENTITY ssh "<application>ssh</application>">
+
+ <!-- chapters in separate docbook files -->
+ <!ENTITY survey-manual SYSTEM "survey-manual.docbook">
+ <!ENTITY getting-started SYSTEM "getting-started.docbook">
+ <!ENTITY kdevelop-survey SYSTEM "kdevelop-survey.docbook">
+ <!ENTITY setup SYSTEM "setup.docbook">
+ <!ENTITY applicationwizard SYSTEM "applicationwizard.docbook">
+ <!ENTITY editing SYSTEM "editing.docbook">
+ <!ENTITY file-browsers SYSTEM "file-browsers.docbook">
+ <!ENTITY class-browsers SYSTEM "class-browsers.docbook">
+ <!ENTITY documentation SYSTEM "documentation.docbook">
+ <!ENTITY project-management SYSTEM "project-management.docbook">
+ <!ENTITY adv-build-management SYSTEM "adv-build-management.docbook">
+ <!ENTITY debugger SYSTEM "debugger.docbook">
+ <!ENTITY cvs-chapter SYSTEM "cvs.docbook">
+ <!ENTITY external-progs SYSTEM "external-progs.docbook">
+ <!ENTITY scripts SYSTEM "scripts.docbook">
+ <!ENTITY credits SYSTEM "credits.docbook">
+ <!ENTITY kdevelop-scripting SYSTEM "kdevelop-scripting.docbook">
+
+ <!-- appendices in separate docbook files -->
+ <!ENTITY kdevelop-install SYSTEM "kdevelop-install.docbook">
+ <!ENTITY nutshell SYSTEM "nutshell.docbook">
+ <!ENTITY unixdev SYSTEM "unixdev.docbook">
+ <!ENTITY app-menu SYSTEM "app-menu.docbook">
+ <!ENTITY app-shortcuts SYSTEM "app-shortcuts.docbook">
+ <!ENTITY app-files SYSTEM "app-files.docbook">
+ <!ENTITY plugin-tools SYSTEM "plugin-tools.docbook">
+ <!ENTITY app-uimodes-examples SYSTEM "app-uimodes-examples.docbook">
+ <!ENTITY commands SYSTEM "commands.docbook">
+ <!ENTITY app-misc-info SYSTEM "app-misc-info.docbook">
+ <!ENTITY app-changelog SYSTEM "app-changelog.docbook">
+ <!ENTITY app-bibliography SYSTEM "app-bibliography.docbook">
+
+ <!-- book related entities -->
+ <!ENTITY kappname "&kdevelop;">
+ <!ENTITY % addindex "INCLUDE">
+ <!ENTITY % English "INCLUDE" > <!-- change language only here -->
+]>
+
+<!--
+NOTE:
+Entries which require special treatment are marked with comments starting with '###'. They should be visited on a regular basis.
+-->
+
+<book lang="&language;">
+
+<bookinfo>
+ <title>&kdevelop; User Manual</title>
+
+ <date>2006-06-19</date>
+ <releaseinfo>&kdevrelease;</releaseinfo>
+
+ <authorgroup>
+ <author>
+ <firstname>Bernd</firstname>
+ <surname>Gehrmann</surname>
+ <affiliation>
+ <address><email>bernd@kdevelop.org</email></address>
+ </affiliation>
+ </author>
+
+ <author>
+ <firstname>Caleb</firstname>
+ <surname>Tennis</surname>
+ <affiliation>
+ <address><email>caleb@aei-tech.com</email></address>
+ </affiliation>
+ </author>
+
+ <author>
+ <firstname>Bernd</firstname>
+ <surname>Pol</surname>
+ <affiliation>
+ <address><email>bernd.pol@online.de</email></address>
+ </affiliation>
+ </author>
+
+ <author>
+ <firstname>Volker</firstname>
+ <surname>Paul</surname>
+ <affiliation>
+ <address><email>volker.paul@tiscali.de</email></address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <copyright>
+ <year>2002</year>
+ <holder>Bernd Gehrmann</holder>
+ </copyright>
+ <copyright>
+ <year>2002</year>
+ <holder>Caleb Tennis</holder>
+ </copyright>
+ <copyright>
+ <year>2004</year>
+ <holder>Bernd Pol</holder>
+ </copyright>
+ <copyright>
+ <year>2005</year>
+ <holder>Volker Paul</holder>
+ </copyright>
+
+ <!-- TRANS:ROLES_OF_TRANSLATORS -->
+
+ <legalnotice>&FDLNotice;</legalnotice>
+
+ <abstract>
+ <para>&kdevelop; is an Integrated Development Environment to be used for a wide variety of programming tasks.</para>
+ </abstract>
+
+ <keywordset>
+ <keyword>KDE</keyword>
+ <keyword>KDevelop</keyword>
+ <keyword>IDE</keyword>
+ <keyword>development</keyword>
+ <keyword>programming</keyword>
+ </keywordset>
+
+</bookinfo>
+
+<!-- ====================================================================== -->
+
+&survey-manual;
+&getting-started; <!-- "Getting Started" -->
+&kdevelop-survey; <!-- "Overview of &kdevelop; Features" -->
+&setup; <!-- "Configuring &kdevelop;" -->
+&applicationwizard; <!-- "Getting Started &mdash; the &appwizard;" -->
+&editing;
+&file-browsers;
+&class-browsers;
+&documentation;
+&project-management;
+&adv-build-management;
+&debugger;
+&cvs-chapter;
+<!--&kdevelop-scripting;--> <!-- "Scripting &kdevelop;" -->
+&credits;
+
+<!-- ====================================================================== -->
+<!-- External Appendices -->
+
+&kdevelop-install; <!-- "Installing &kdevelop;" -->
+&nutshell;
+&unixdev; <!-- "Development on &UNIX;" -->
+<!--
+&app-menu;
+&app-shortcuts;
+-->
+&app-files;
+&plugin-tools;
+&app-uimodes-examples;
+&commands;
+&app-misc-info;
+&app-changelog;
+
+<!-- ====================================================================== -->
+<!-- ### Questionable, probably not IDE-specific enough. Check later again.
+<chapter id="python">
+<title>Python</title>
+
+<para>...
+</para>
+
+</chapter> --> <!-- python -->
+
+<!-- ====================================================================== -->
+<!-- ### Questionable, probably not IDE-specific enough. Check later again.
+<chapter id="php">
+<title>PHP</title>
+
+<para>...
+</para>
+</chapter> --> <!-- php -->
+
+<!-- ====================================================================== -->
+
+<!-- Note (bp, 2003-09-04): <bibliography> should remain the last appendix -->
+<!-- section because of a (meinproc???) bug which sends the Next selection -->
+<!-- in circles back to it. -->
+<!-- (LWatts: 2005-04-30) This is probably due to a missing id= somewhere, -->
+<!-- so I've added a couple in hopes it goes away. -->
+
+<appendix id="app-bibliography">
+<title>Bibliography</title>
+
+<para>(... to be written ...)</para>
+
+<bibliography id="bibliography">
+
+<biblioentry>
+<title><ulink url="info://make/Top">GNU Make Manual</ulink></title>
+<authorgroup>
+<author><firstname>Richard M.</firstname><surname>Stallman</surname></author>
+<author><firstname>Roland</firstname><surname>McGrath</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://automake/Top">GNU Automake</ulink></title>
+<authorgroup>
+<author><firstname>David</firstname><surname>MacKenzie</surname></author>
+<author><firstname>Tom</firstname><surname>Tromey</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://autoconf/Top">GNU Autoconf</ulink></title>
+<authorgroup>
+<author><firstname>David</firstname><surname>MacKenzie</surname></author>
+<author><firstname>Ben</firstname><surname>Elliston</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://gcc/Top">Using the GNU Compiler Collection</ulink></title>
+<author><firstname>Richard M.</firstname><surname>Stallman</surname></author>
+</biblioentry>
+
+<biblioentry>
+<title><ulink url="info://libtool/Top">GNU Libtool</ulink></title>
+<authorgroup>
+<author><firstname>Gordon</firstname><surname>Matzigkeit</surname></author>
+<author><firstname>Alexandre</firstname><surname>Oliva</surname></author>
+<author><firstname>Thomas</firstname><surname>Tanner</surname></author>
+<author><firstname>Gary V.</firstname><surname>Vaughan</surname></author>
+</authorgroup>
+</biblioentry>
+
+<biblioentry>
+<title>GNU Autoconf, Automake, and Libtool</title>
+<edition>1st edition</edition>
+<pubdate>October 2000</pubdate>
+<authorgroup>
+<author><firstname>Gary V.</firstname><surname>Vaughan</surname></author>
+<author><firstname>Ben</firstname><surname>Elliston</surname></author>
+<author><firstname>Tom</firstname><surname>Tromey</surname></author>
+<author><firstname>Ian Lance</firstname><surname>Taylor</surname></author>
+</authorgroup>
+<publisher><publishername>New Riders Publishing</publishername></publisher>
+<isbn>ISBN 1578701902</isbn>
+</biblioentry>
+
+
+<biblioentry>
+<title>Advanced Programming in the &UNIX; Environment</title>
+<edition>1st edition</edition>
+<pubdate>June 1992</pubdate>
+<author><firstname>W. Richard</firstname><surname>Stevens</surname></author>
+<publisher><publishername>Addison-Wesley Pub Co</publishername></publisher>
+<isbn>ISBN 0201563177</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Thinking in C++, Volume 1: Introduction to Standard C++</title>
+<edition>2nd Edition</edition>
+<pubdate>April 15, 2000</pubdate>
+<author><firstname>Bruce</firstname><surname>Eckel</surname></author>
+<publisher><publishername>Prentice Hall</publishername></publisher>
+<isbn>ISBN 0139798099</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Open Source Development with CVS</title>
+<edition>2nd Edition</edition>
+<pubdate>October 12, 2001</pubdate>
+<authorgroup>
+<author><firstname>Karl</firstname><surname>Fogel</surname></author>
+<author><firstname>Moshe</firstname><surname>Bar</surname></author>
+</authorgroup>
+<publisher><publishername>The Coriolis Group</publishername></publisher>
+<isbn>ISBN 158880173X</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming PHP</title>
+<edition>1st edition</edition>
+<pubdate>March 2002</pubdate>
+<authorgroup>
+<author><firstname>Rasmus</firstname><surname>Lerdorf</surname></author>
+<author><firstname>Kevin</firstname><surname>Tatroe</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 1565926102</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming Python</title>
+<edition>2nd Edition</edition>
+<pubdate>March 2001</pubdate>
+<author><firstname>Mark</firstname><surname>Lutz</surname></author>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596000855</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Gui Programming With Python : Using the Qt Toolkit</title>
+<edition>Bk&amp;Cd-r edition</edition>
+<pubdate>January 2002</pubdate>
+<author><firstname>Boudewijn</firstname><surname>Rempt</surname></author>
+<publisher><publishername>Opendocs Llc</publishername></publisher>
+<isbn>ISBN 0970033044</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Programming Perl</title>
+<subtitle>The Camel book</subtitle>
+<edition>3rd Edition</edition>
+<pubdate>July 2000</pubdate>
+<authorgroup>
+<author><firstname>Larry</firstname><surname>Wall</surname></author>
+<author><firstname>Tom</firstname><surname>Christiansen</surname></author>
+<author><firstname>Jon</firstname><surname>Orwant</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596000278</isbn>
+</biblioentry>
+
+<biblioentry>
+<title>Learning Perl</title>
+<subtitle>The Lama book</subtitle>
+<edition>3rd Edition</edition>
+<pubdate>July 15, 2001</pubdate>
+<authorgroup>
+<author><firstname>Randal L.</firstname><surname>Schwartz</surname></author>
+<author><firstname>Tom</firstname><surname>Phoenix</surname></author>
+</authorgroup>
+<publisher><publishername>O'Reilly &amp; Associates</publishername></publisher>
+<isbn>ISBN 0596001320</isbn>
+</biblioentry>
+
+</bibliography>
+<!-- -->
+
+</appendix> <!-- app-bibliography -->
+
+<!-- ====================================================================== -->
+
+&documentation.index;
+
+</book>
diff --git a/doc/kdevelop/kdcop_browsing.png b/doc/kdevelop/kdcop_browsing.png
new file mode 100644
index 00000000..26dbaaf1
--- /dev/null
+++ b/doc/kdevelop/kdcop_browsing.png
Binary files differ
diff --git a/doc/kdevelop/kdevdesigner.png b/doc/kdevelop/kdevdesigner.png
new file mode 100644
index 00000000..4fa74c68
--- /dev/null
+++ b/doc/kdevelop/kdevdesigner.png
Binary files differ
diff --git a/doc/kdevelop/kdevelop-ideal-mode-0.png b/doc/kdevelop/kdevelop-ideal-mode-0.png
new file mode 100644
index 00000000..ea2d7c50
--- /dev/null
+++ b/doc/kdevelop/kdevelop-ideal-mode-0.png
Binary files differ
diff --git a/doc/kdevelop/kdevelop-ideal-mode.png b/doc/kdevelop/kdevelop-ideal-mode.png
new file mode 100644
index 00000000..00e73804
--- /dev/null
+++ b/doc/kdevelop/kdevelop-ideal-mode.png
Binary files differ
diff --git a/doc/kdevelop/kdevelop-install.docbook b/doc/kdevelop/kdevelop-install.docbook
new file mode 100644
index 00000000..1ff5982c
--- /dev/null
+++ b/doc/kdevelop/kdevelop-install.docbook
@@ -0,0 +1,754 @@
+<appendix id="kdevelop-install">
+
+<appendixinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <author><firstname>Anne-Marie</firstname><surname>Mahfouf</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</appendixinfo>
+
+<title>Installing &kdevelop;</title>
+
+<indexterm zone="kdevelop-install">
+ <primary>installation</primary></indexterm>
+
+<para>
+In this chapter we will discuss the steps necessary to compile and install the &kdevelop; IDE:
+
+<itemizedlist>
+ <listitem><para>
+ <link linkend="kdevelop-install-howto">How to obtain &kdevelop;</link> mainly concentrates on downloading the most recent &kdevelop; sources from svn.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="requirements">&kdevelop; requirements</link> lists the programs and libraries which you need installed to successfully compile the IDE.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="compile-and-install">&kdevelop; compilation and installation</link> leads you through all the steps of compilation and installation of the application.
+ </para></listitem>
+ <listitem><para>
+<link linkend="make-api">How to obtain a &kdevelop; &API; documentation</link> tells what an API is and how you get such a useful tool for navigating the &kdevelop; sources.
+ </para></listitem>
+</itemizedlist>
+</para>
+
+<sect1 id="kdevelop-install-howto">
+<title>How to Obtain &kdevelop;</title>
+
+<indexterm zone="kdevelop-install-howto">
+ <primary>obtain &kdevelop;</primary></indexterm>
+<indexterm zone="kdevelop-install-howto">
+ <primary>&kdevelop;</primary>
+ <secondary>obtain</secondary></indexterm>
+
+<para>
+&kdevelop; is available in binary form from many different &Linux; distributions such as <!--&SuSE;, &RedHat;//--> SuSE, RedHat and others. These binaries are packed in some convenient format, mostly RPM, for easy installation. To install, follow the standard instructions given in your distribution.
+</para>
+<para>
+You may as well obtain the &kdevelop; sources, compile and install them by yourself. These sources can be found via the project home page at <ulink url="http://www.kdevelop.org"> http://www.kdevelop.org</ulink> or via the <ulink url="http://download.kde.org">&kde; ftp site</ulink>.
+</para>
+
+<sect2 id="howto-svn">
+<title>Get Daily &kdevelop; Snapshots from svn</title>
+
+<indexterm zone="howto-svn">
+ <primary>svn</primary></indexterm>
+
+<para>If you want to be in front of current development, anonymous svn repository snapshots are available.</para>
+<para>The module name is <emphasis>kdevelop</emphasis> at <filename class="directory">svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdevelop</filename>.
+</para>
+
+<sect3 id="howto-svn-co">
+<title>Initial svn Checkout</title>
+
+<indexterm zone="howto-svn-co">
+ <primary>checkout</primary></indexterm>
+<indexterm zone="howto-svn-co">
+ <primary>&kdevelop;</primary>
+ <secondary>svn</secondary>
+ <tertiary>checkout</tertiary></indexterm>
+
+<para>
+To obtain an initial version of &kdevelop; you must download it from anonymous svn. For this so-called <emphasis>checkout</emphasis> operation follow these steps.
+</para>
+
+<note><para>
+We assume you want to put your &kdevelop; copy into the <filename class="directory">kde3src</filename> subdirectory of your home directory (<filename class="directory">~</filename>).
+</para></note>
+
+<informalexample><simplelist>
+ <member>
+ # Create the destination directory, if necessary:
+ </member>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>mkdir kde3src</userinput>
+ </member>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>cd kde3src</userinput>
+ </member>
+ <member>
+ <prompt>~/kde3src&gt; </prompt>
+ <userinput>svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdevelop</userinput>
+ </member>
+ <member>
+ <prompt>~/kde3src&gt; </prompt>
+ <userinput>cd kdevelop</userinput>
+ </member>
+</simplelist></informalexample>
+
+<note><para>
+ Once you have successfully checked out your &kdevelop; version, you may keep up with the changes using the update procedure shown in the next section.
+</para></note>
+
+<important><para>
+ Keep the server load low. <emphasis>Please do not checkout every time you want to keep your &kdevelop; up to date!</emphasis> Use svn update for this purpose.
+</para></important>
+
+<para>
+Now you may compile your &kdevelop; version as shown in the <link linkend="compile-and-install">&kdevelop; Compilation and Installation</link> section.
+</para>
+
+</sect3> <!-- howto-svn-co -->
+
+<sect3 id="howto-svn-up">
+<title>Keeping Your svn Copy up to Date</title>
+
+<indexterm zone="howto-svn-up">
+ <primary>update</primary></indexterm>
+<indexterm zone="howto-svn-up">
+ <primary>&kdevelop;</primary>
+ <secondary>svn</secondary>
+ <tertiary>update</tertiary></indexterm>
+
+<para>
+After you checked out (and successfully compiled) &kdevelop; from svn as shown above, you'll want to keep it up to date in order to get all the patches. Follow these steps. (We again assume you have put your &kdevelop; copy into the <filename class="directory">kde3src</filename> directory.)
+</para>
+<para>
+Note the <command>up</command> (= <emphasis>update</emphasis>) command instead of the <command>co</command> (which stands for <emphasis>checkout</emphasis>).
+</para>
+
+<informalexample><simplelist>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>cd kde3src</userinput>
+ </member>
+ <member>
+ <prompt>~/kde3src&gt; </prompt>
+ <userinput>cd kdevelop</userinput>
+ </member>
+ <member>
+ <prompt>~/kde3src&gt; </prompt>
+ <userinput>svn up</userinput>
+ </member>
+</simplelist></informalexample>
+
+<note><para>
+Keep an eye on the messages svn produces during the update sequence. The exact steps in the compilation sequence depend on this.
+</para></note>
+
+<para>
+Now you can compile a new &kdevelop; version as shown in the <link linkend="compile-and-install-make-svn">Special svn compilation considerations</link> chapter.
+</para>
+</sect3> <!-- howto-svn-up -->
+
+</sect2> <!-- howto-svn -->
+
+</sect1> <!-- howto -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="requirements">
+<title>&kdevelop; Requirements</title>
+
+<indexterm zone="requirements">
+ <primary>requirements</primary></indexterm>
+<indexterm zone="requirements">
+ <primary>&kdevelop;</primary>
+ <secondary>requirements</secondary></indexterm>
+<indexterm zone="requirements">
+ <primary>GNU</primary>
+ <secondary>requirements</secondary></indexterm>
+
+<para>
+In order to successfully compile and use &kdevelop;, you need the following programs and libraries. They are available on most platforms as distribution packages and thereby can be installed easily.
+</para>
+
+<itemizedlist>
+<title>Required:</title>
+ <listitem>
+ <para>
+ <application>gcc/g++</application> &ge; 2.95.3 (or compatible)
+ <indexterm>
+ <primary>gcc</primary>
+ <secondary>requirements</secondary></indexterm>
+ <indexterm>
+ <primary>g++</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="gcc.gnu.org">gcc.gnu.org</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <application>&GNU; make</application> (or compatible)
+ <indexterm>
+ <primary>make</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.gnu.org/software/make">www.gnu.org/software/make</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ &perl; 5.004 (or higher)
+ <indexterm>
+ <primary>Perl</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.perl.com">www.perl.com</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <application>autoconf</application> &ge; 2.52 (or higher)
+ <indexterm>
+ <primary>autoconf</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.gnu.org/software/autoconf">www.gnu.org/software/autoconf</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <application>automake</application> &ge; 1.6 (or higher)
+ <indexterm>
+ <primary>automake</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.gnu.org/software/automake">www.gnu.org/software/automake</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <application>flex</application> 2.5.4 (or higher)
+ <indexterm>
+ <primary>flex</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.gnu.org/software/flex">www.gnu.org/software/flex</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ &Qt; &ge; 3.3.0 (or higher)
+ <indexterm>
+ <primary>Qt</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.trolltech.com/products/qt">www.trolltech.com/products/qt</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <application>KDE</application> &ge; 3.4.0 (or higher)
+ <indexterm>
+ <primary>KDE</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para>
+ <para>
+ Available from <ulink url="www.kde.org">www.kde.org</ulink>
+ </para>
+ </listitem>
+</itemizedlist>
+
+<itemizedlist>
+<title>Optional:</title>
+ <listitem><para>
+ The <emphasis><application>ctags</application></emphasis> source navigation tool, from <ulink url="http://ctags.sourceforge.net">http://ctags.sourceforge.net</ulink>, which enables you fast access to declarations and definitions by a few simple clicks on a name in the editor.
+ <indexterm><primary>ctags</primary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><application>dot</application></emphasis>, a graphics language compiler, from <ulink url="http://www.graphviz.org">http:/www.graphviz.org</ulink>. This
+ <!-- ### temporarily disabled until the graphical class browser works again
+ allows you to navigate in a graphical view of your classes' dependencies. Likewise the <application>dot</application> //-->
+ tool is needed in conjunction with &doxygen; below if you want to have class relationships graphically displayed (which is highly recommended).
+ <indexterm><primary>dot</primary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ The <emphasis>&doxygen;</emphasis> documentation tool, from <ulink url="http://www.doxygen.org">http://www.doxygen.org</ulink> if you want to generate concise and powerful API documentation from your projects.
+ <indexterm><primary>doxygen</primary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><application>valgrind</application></emphasis> from <ulink url="http://developer.kde.org/~sewardj/">http://developer.kde.org/~sewardj/</ulink> helps you to find memory management problems in your applications.
+ <indexterm><primary>valgrind</primary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><application>svn</application></emphasis> from <ulink url="http://subversion.tigris.org/">http://subversion.tigris.org/</ulink> if you want to use the svn versioning system.
+ <indexterm>
+ <primary>svn</primary>
+ <secondary>requirements</secondary></indexterm>
+ </para></listitem>
+ <listitem><para>
+ Any other compiler and/or tool in case you want to develop for another language/platform than C++/&kde; or use some special facility.
+ </para></listitem>
+</itemizedlist>
+
+<note>
+<orderedlist>
+ <listitem>
+ <para>
+ You can, to a certain extent, circumvent the need for &autoconf; &ge; 2.52 and &automake; &ge; 1.6. Just remove the <filename class="directory">admin</filename> directory in your &kdevelop; installation directory and type
+ <indexterm>
+ <primary>autoconf</primary>
+ <secondary>circumvent version need</secondary></indexterm>
+ <indexterm>
+ <primary>automake</primary>
+ <secondary>circumvent version need</secondary></indexterm>
+ <indexterm>
+ <primary>version need</primary>
+ <secondary>circumvent for autoconf/automake</secondary></indexterm>
+ </para>
+ <informalexample><simplelist>
+ <member><prompt>(your-kdevelop-directory)&gt; </prompt>
+ <userinput>ln -s $KDEDIR/share/apps/kdelibs/admin admin</userinput></member>
+ </simplelist></informalexample>
+ <para>
+ at the console. This causes &kdevelop; to use the standard settings in the &kde; <filename class="directory">admin</filename> directory instead.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Be careful <emphasis>not to mix &Qt; versions</emphasis>. Always link &kdevelop; to the same &Qt; version your &kde; library was compiled. Otherwise you will most likely experience <emphasis>very strange</emphasis> behaviours.
+ </para>
+ </listitem>
+</orderedlist>
+</note>
+
+</sect1> <!-- requirements -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="compile-and-install">
+<title>&kdevelop; Compilation and Installation</title>
+
+<indexterm zone="compile-and-install">
+ <primary>&kdevelop;</primary>
+ <secondary>compilation</secondary></indexterm>
+<indexterm zone="compile-and-install">
+ <primary>&kdevelop;</primary>
+ <secondary>installation</secondary></indexterm>
+
+<para>
+Once all requirements are met, you are ready to compile and install &kdevelop;. This appendix will discuss the necessary steps to do so.
+</para>
+<itemizedlist>
+ <listitem><para>
+ <link linkend="compile-and-install-preliminaries">Preliminary Steps</link> tells you about setting up a proper environment.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="compile-and-install-make">Compile &kdevelop;</link> deals with obtaining the &kdevelop; sources from svn, how to prepare them for the installation process, and finally shows the steps necessary to compile and install &kdevelop;.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="compile-and-install-options">Some Notes on configure Options</link> tells you how to run &kdevelop; if it has been installed in a location other than the &kde; directory.
+ </para></listitem>
+</itemizedlist>
+
+<sect2 id="compile-and-install-preliminaries">
+<title>Preliminary Steps</title>
+
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>preliminaries</primary>
+ <secondary>&kdevelop; installation</secondary></indexterm>
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>KDEDIR</primary></indexterm>
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>QTDIR</primary></indexterm>
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>LD_LIBRARY_PATH</primary></indexterm>
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>LIBRARY_PATH</primary></indexterm>
+<indexterm zone="compile-and-install-preliminaries">
+ <primary>PATH</primary></indexterm>
+
+<para>
+Before entering the compile sequence you must make sure all libraries and tools are available to the make system. To accomplish this some environment variables need to be properly set. The actual steps to be performed depend on the console shell you use.
+</para>
+
+<note><para>
+To avoid typing in all the statements that set the necessary environment variables every time you want to compile, you should put them into your <filename>.bashrc</filename> or <filename>.cshrc</filename> file. This way the environment variables will be properly set every time you start the shell.
+</para></note>
+
+<sect3 id="compile-and-install-preliminaries-bash">
+<title>Setting the Environment for the bash Shell</title>
+
+<para>
+If you use the bash shell add the following lines:
+</para>
+
+<informalexample><simplelist>
+ <member><userinput>export KDEDIR=</userinput>(path to your KDE installation)</member>
+ <member><userinput>export QTDIR=</userinput>(path to your Qt library)</member>
+ <member><userinput>export LD_LIBRARY_PATH=$QTDIR/lib:$KDEDIR/lib:$LD_LIBRARY_PATH</userinput></member>
+ <member><userinput>export LIBRARY_PATH=$QTDIR/lib:$KDEDIR/lib:$LIBRARY_PATH</userinput></member>
+ <member><userinput>export PATH=$QTDIR/bin:$KDEDIR/bin:$PATH</userinput></member>
+</simplelist></informalexample>
+<para></para>
+
+</sect3> <!-- compile-and-install-preliminaries-bash -->
+
+<sect3 id="compile-and-install-preliminaries-tcsh">
+<title>Setting the Environment for the tcsh Shell</title>
+
+<para>
+If you use the tcsh shell add the following lines:
+</para>
+<para>
+<informalexample><simplelist>
+ <member><userinput>setenv KDEDIR </userinput>(path to your KDE installation)</member>
+ <member><userinput>setenv QTDIR </userinput>(path to your Qt library)</member>
+ <member><userinput>setenv LD_LIBRARY_PATH=$QTDIR/lib:$KDEDIR/lib:$LD_LIBRARY_PATH</userinput></member>
+ <member><userinput>setenv LIBRARY_PATH $QTDIR/lib:$KDEDIR/lib:$LIBRARY_PATH</userinput></member>
+ <member><userinput>setenv PATH $QTDIR/bin:$KDEDIR/bin:$PATH</userinput></member>
+</simplelist></informalexample>
+</para>
+
+</sect3> <!-- compile-and-install-preliminaries-tcs -->
+
+</sect2> <!-- compile-and-install-preliminaries -->
+
+<sect2 id="compile-and-install-make">
+<title>Compile &kdevelop;</title>
+
+<indexterm zone="compile-and-install-make">
+ <primary>make</primary>
+ <secondary>&kdevelop; installation</secondary></indexterm>
+<indexterm zone="compile-and-install-make">
+ <primary>compiling</primary>
+ <secondary>&kdevelop;</secondary></indexterm>
+
+<note><para>
+In the following discussion we assume that you have put your &kdevelop; sources in the <filename class="directory">~/kde3src/kdevelop</filename> directory.
+</para></note>
+
+<sect3 id="compile-and-install-make-svn">
+<title>Special svn Compilation Considerations</title>
+
+<para>
+In case you use a &kdevelop; snapshot from svn the initial compilation steps depend on whether you just did a complete checkout or only updated the source.
+</para>
+
+<variablelist>
+<varlistentry>
+<term id="compile-and-install-make-svn-co">After a svn Checkout</term>
+<listitem>
+<para>
+You must <emphasis>initialize the make system</emphasis> after a fresh checkout. The same is true every time you need to start over from scratch. Type:
+</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make -f admin/Makefile.common svn-clean</userinput>
+</member></simplelist></informalexample>
+<para>
+and then <emphasis>all of the following steps</emphasis>.
+</para>
+<note><para>
+You might need access to the svn repository for the clean-up if any corrupted or missing files must be reconstructed.
+</para></note>
+<important><para>
+The <command>svn-clean</command> command will <emphasis>remove every file</emphasis> not in svn from the directory! Make sure to back up any valuable information before you issue this clean-up command.
+</para></important>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="compile-and-install-make-svn-up">After a svn Update</term>
+<listitem>
+<para>
+The next step depends on the output of the svn update sequence. If you got something like (there may be a U or a P marker in the leftmost column, both denoting the file has been changed):
+</para>
+
+<screen>
+U /some_directory_path/Makefile.am
+</screen>
+<para>
+or if you just did a full checkout, you must enter:
+</para>
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make -f Makefile.svn</userinput>
+</member></simplelist></informalexample>
+<para>
+before you proceed with <emphasis>all of the following steps</emphasis>.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</sect3> <!-- compile-and-install-make-svn -->
+
+<sect3 id="compile-and-install-make-basic">
+<title>Basic <command>make</command> Command Sequence</title>
+
+<para>
+Once the basic make system is set up you must decide which type of the &kdevelop; system you want to use. This is done in the following configure step which builds the actual <filename>Makefile</filename>s the <command>make</command> command will use.
+</para>
+
+<note><para>
+You may drop the <option>--prefix</option> option in the following <command>configure</command> command lines if you want &kdevelop; be installed in the default &kde; directory. See the <link linkend="compile-and-install-options">Some notes on configure options</link> chapter for this.
+</para></note>
+
+<variablelist>
+<varlistentry>
+<term>A Debug-Compiled Version</term>
+<listitem>
+<para>
+If you want to keep track of what your &kdevelop; application does at run-time you may build a debug-compiled version. Just command <command>configure</command> to do so:
+</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>./configure --enable-debug=full --prefix=</userinput>(where-your-kde3-is)
+</member></simplelist></informalexample>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>A Release-Compiled Version</term>
+<listitem>
+<para>If you only want to use &kdevelop; as-is a (smaller and faster
+running) release version suffices. <command>configure</command> defaults to
+this.</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>./configure --prefix=</userinput>(where-your-kde3-is)
+</member></simplelist></informalexample>
+
+<note>
+<para>
+If you want to build your own <link linkend="make-api">API documentation</link> for &kdevelop; you must include yet another option in the <command>configure</command> command:
+</para>
+<informalexample><simplelist>
+ <member><prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>./configure --</userinput>(options-as-above) <userinput>\</userinput></member> <member><userinput>--with-kdelibsdoxy-dir=$KDEDIR/share/doc/HTML/en/kdelibs-apidocs</userinput></member>
+</simplelist></informalexample>
+</note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Make and Install &kdevelop;</term>
+<listitem>
+<para>
+<command>configure</command> will check the system and build some <filename>Makefile</filename>s according to what it found. The <command>make</command> command will use the main <filename>Makefile</filename> by default. Thus
+</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make</userinput>
+</member></simplelist></informalexample>
+<para>
+suffices. If necessary, now gain root user rights using the command
+</para>
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>su</userinput>
+</member></simplelist></informalexample>
+<para>
+and entering the root password. Then install the application:
+</para>
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make install</userinput>
+</member></simplelist></informalexample>
+<para>
+That's all. If you installed &kdevelop; in the default &kde; directory you may now run the IDE. Otherwise some additional steps will be necessary as shown in the <link linkend="compile-and-install-options-dir">Non-default installation directory</link> section below.
+</para>
+
+<note>
+ <para>
+ In fact there usually will have been three &kdevelop;-based applications installed:
+ </para>
+ <itemizedlist>
+ <listitem><para>The &kdevelop; IDE &mdash; this is the place where you will usually work.</para></listitem>
+ <listitem><para>The stand-alone &kdevelop; Assistant documentation browser &mdash; isolates all the powerful documentation facilities of the &kdevelop; IDE in a separate tool. This comes in handy when you want to look up some programming documentation but do not want to start the full IDE.</para></listitem>
+ <listitem><para>The &kdevelop; Designer &mdash; enhances the &Qt; User Interface Designer by &kde; specific elements and integrates nicely in the &kdevelop; IDE.</para></listitem>
+ </itemizedlist>
+</note>
+</listitem>
+</varlistentry>
+</variablelist>
+
+
+</sect3> <!-- compile-and-install-make-basic -->
+</sect2> <!-- compile-and-install-make -->
+
+
+<sect2 id="compile-and-install-options">
+<title>Some Notes on <command>configure</command> Options</title>
+
+<sect3 id="compile-and-install-options-dir">
+<title>Non-default Installation Directory</title>
+
+<indexterm zone="compile-and-install-options-dir">
+ <primary>&kdevelop;</primary>
+ <secondary>installation</secondary>
+ <tertiary>non-default directory</tertiary></indexterm>
+<indexterm zone="compile-and-install-options-dir">
+ <primary>non-default directory</primary></indexterm>
+<indexterm zone="compile-and-install-options-dir">
+ <primary>KDEDIRS</primary></indexterm>
+<indexterm zone="compile-and-install-options-dir">
+ <primary>kbuildsycoca</primary></indexterm>
+
+<para>
+By default <command>configure</command> prepares the IDE to be installed in the default &kde; directory. This is necessary because &kdevelop; assumes direct access to some tools and parts which reside there. If want to use your own installation directory, you must tell <command>configure</command> this by the <option>--prefix</option> option:
+</para>
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>./configure --prefix=</userinput>(where-your-kde3-is)
+</member></simplelist></informalexample>
+<para>
+There is a caveat if you do so. You must provide a means for &kdevelop; to access the needed tools and parts in the &kde; directory when running. (You can still use the IDE without doing so, but with very restrained capabilities.)
+</para>
+<para>
+Call up a shell and have the following commands executed before you start &kdevelop; at the shell prompt.
+</para>
+
+<note><para>
+ <emphasis>Take care to use the plural:</emphasis> It is <quote><envar>KDEDIRS</envar></quote>, not just <quote><envar>KDEDIR</envar></quote>)
+</para></note>
+
+<informalexample><simplelist>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>export KDEDIRS=/usr/local/kde:/opt/kde3</userinput>
+ </member>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>kbuildsycoca</userinput>
+ </member>
+ <member>
+ (Now start &kdevelop;:)
+ </member>
+ <member>
+ <prompt>~&gt; </prompt>
+ <userinput>kdevelop</userinput>
+ </member>
+</simplelist></informalexample>
+
+<note><simplelist>
+ <member>The <envar>KDEDIRS</envar> environment variable must be set to the <emphasis>list of active &kde; directories</emphasis> in your system. We use</member>
+ <member><filename class="directory">/usr/local/kde</filename>:<filename class="directory">/opt/kde3</filename></member>
+ <member>as an example only.</member>
+ <member>The <filename class="directory">/usr/local/kde</filename> directory may for instance contain an incomplete &kde; version you compiled for debug purposes, and the <filename class="directory">/opt/kde3</filename> directory may in addition contain the standard &kde; version from your distribution that is used for everyday work.</member>
+</simplelist></note>
+
+<para>
+In a tcsh shell you must set the environment variables using:
+</para>
+<informalexample><simplelist><member>
+ <prompt>~&gt; </prompt>
+ <userinput>setenv KDEDIRS /usr/local/kde:/opt/kde3</userinput>
+</member></simplelist></informalexample>
+<para>
+The <command>kbuildsycoca</command> command (<quote>build system control cache</quote>) looks around for libraries and caches their location and version, so that &kdevelop; can find them. The caveat is that it takes noticeable time&mdash;and it has to be run any time you call up the shell to start &kdevelop; from a non-default directory. You may want to put the above commands into a shell script to reduce the typing effort.
+</para>
+<para>
+(You could as well put the lines in your <filename>.bashrc</filename> or <filename>.cshrc</filename> file, but this is not advisable as <command>kbuildsycoca</command> will then be run any time you call up the shell.)
+</para>
+
+<note><para>
+The <command>kbuildsycoca</command> command does not run from within the root. You must call it from a non-root user. (But is <emphasis>not a very good idea</emphasis> after all to do software development from within the root!)
+</para></note>
+</sect3> <!-- compile-and-install-options-dir -->
+
+<!-- ### put a sect3 with other configuration options here -->
+
+</sect2> <!-- compile-and-install-options -->
+
+</sect1> <!-- compile-and-install -->
+
+<sect1 id="make-api">
+<title>How to Obtain a &kdevelop; API Documentation</title>
+
+<indexterm zone="make-api">
+ <primary>API</primary>
+ <secondary>&kdevelop;</secondary></indexterm>
+<indexterm zone="make-api">
+ <primary>&kdevelop;</primary>
+ <secondary>API</secondary></indexterm>
+<indexterm zone="make-api">
+ <primary>compiling</primary>
+ <secondary>&kdevelop;</secondary>
+ <tertiary>API</tertiary></indexterm>
+<indexterm zone="make-api">
+ <primary>configure</primary>
+ <secondary>&kdevelop; API</secondary></indexterm>
+
+<para>
+API is the short form of <quote>Application Program Interface</quote>. Actually such an API cotains a series of descriptions (&ie; calling conventions) by which an application program can access the operating system and other services. In our context, however, a broader definition was adopted. The API of a &kde; or &Qt; application is an abstract of the classes and methods interfaces, a synopsis to be used like a dictionary to navigate the sources.
+</para>
+<para>
+There is a version of the most current API available at the <ulink url="http://www.kdevelop.org/HEAD/doc/api/html/index.html">KDevelop-Home website</ulink>. It will be automatically updated every 24 hours so you can keep up.
+</para>
+<para>
+Alas, this version is best used read-only over the internet. If you do not always have internet access you may as well build your own API documentation from the &kdevelop; sources. To do so, you must tell the automake system where to find the KDELIBS API in your system. This is accomplished by the special option <option>--with-kdelibsdoxy-dir</option> in the <command>configure</command> command when you prepare to compile the &kdevelop; sources:
+</para>
+
+<informalexample><simplelist>
+ <member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>./configure --</userinput>(options-as-usual)<userinput> \</userinput>
+ </member>
+ <member>
+ <userinput>--with-kdelibsdoxy-dir=$KDEDIR/share/doc/HTML/en/kdelibs-apidocs</userinput>
+ </member>
+</simplelist></informalexample>
+
+<para>
+(<command>make</command> will replace the global <varname>$KDEDIR</varname> variable with the actual &kde; directory setting recorded therein.) Then issue a <command>make</command> command <link linkend="compile-and-install-make-basic">as usual</link>. After the &kdevelop; IDE has been built you have the option to build the API as well. For this you must issue
+</para>
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make apidocs</userinput>
+</member></simplelist></informalexample>
+
+<para>
+This will build a <filename>Doxyfile</filename> in your &kdevelop; base directory which in turn will be processed by the <application>Doxygen</application> application to build quite a lot of <filename>.html</filename> API files. When this rather lengthy API building process (may last more than an hour on a slow system) finally comes to an end, you must install the API just like you have to install the &kdevelop; IDE itself. If necessary obtain superuser rights by
+</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>su</userinput>
+</member></simplelist></informalexample>
+
+<para>
+and entering the root password. Then install the API files:
+</para>
+
+<informalexample><simplelist><member>
+ <prompt>~/kde3src/kdevelop&gt; </prompt>
+ <userinput>make install-apidox</userinput>
+</member></simplelist></informalexample>
+
+<para>
+Once this is done, <command>make</command> will inform you about the directory where you can finally look at the API documentation's contents. Note this address, you can use it from &konqueror; as well as from inside &kdevelop;, in case you have set up the &kdevelop; sources themselves as a project to work on.
+</para>
+
+<note><para>
+You will most probably see a lot of warning and/or error messages during the API build run by <application>Doxygen</application>. It is best to ignore them, they are of interest to the &kdevelop; developers only. If the API generation ever comes to a successful end, the <filename>.html</filename> API files will be usable.
+</para></note>
+
+</sect1> <!-- make-api -->
+
+</appendix> <!-- kdevelop-install -->
diff --git a/doc/kdevelop/kdevelop-mdi-mode.png b/doc/kdevelop/kdevelop-mdi-mode.png
new file mode 100644
index 00000000..51ed019a
--- /dev/null
+++ b/doc/kdevelop/kdevelop-mdi-mode.png
Binary files differ
diff --git a/doc/kdevelop/kdevelop-scripting.docbook b/doc/kdevelop/kdevelop-scripting.docbook
new file mode 100644
index 00000000..d9e59bb5
--- /dev/null
+++ b/doc/kdevelop/kdevelop-scripting.docbook
@@ -0,0 +1,56 @@
+<chapter id="kdevelop-scripting">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Ian</firstname><surname>Geiser</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Using Scripts in KDevelop</title>
+
+<sect1 id="running-scripts">
+<title>Running Scripts</title>
+<para>
+ To access a script that is available to &kdevelop; use the <menuchoice><guimenu>Tools</guimenu><guimenuitem>Scripts</guimenuitem></menuchoice> menu. If there there is no such menu item then there are no installed scripts available to KDevelop.
+</para>
+</sect1>
+
+<sect1 id="adding-scripts">
+<title>Adding Scripts</title>
+<para>
+ Once you have added KScript support to your host application adding the scripts is just as easy. The scripts are comprised of two parts, a desktop file that contains meta-data about the script and the script itself. This approach was used because of security and simplicity. The desktop file provides meta-information for menus and script type. This keeps the host application from having to inspect for load each script. An example of this file is shown below:
+</para>
+<para>
+ The above example demonstrates the main parts that KScript will look for. The first item the "Name" is the name that will appear to the user in the host application and the "Comment" will be usually provided as a tool tip. The "Type" is the most important. This is used to select the proper script engine to run the script. Currently the ones available to KDE are "ShellScript/bash" and "JavaScript/kjs"
+The next step is to create the actual script. For the above example the Type of script that is used is "ShellScript/bash". The shellscript script engine provides a few things for the developer. The first element is the DCOP ID of the host application. This is passed to the script as the first argument. This means from anywhere in the script the value of "$1" will return the host's DCOP ID. An example shell script is shown below:
+</para>
+
+<para>This script is quite simple and just executes a command and sets the text of the first document to the output of "ls -l"</para>
+
+<para>One of the most useful tools in developing scripts for applications is the KDCOP application.</para>
+<figure id="screenshot-kdcop" float="1">
+ <title>KDCOP Browsing DCOP Interfaces in &kdevelop;</title>
+ <mediaobject>
+ <imageobject><imagedata fileref="kdcop_browsing.png"/></imageobject>
+ </mediaobject>
+</figure>
+
+<para>The KDCOP tool allows script developers to browse and debug the current interfaces of the host application. KDCOP also provides a neat feature of allowing users to select a method and drag the current code to their text editor. This simplifies use for people who are not savvy to the DCOP methods of the host language. Currently KDCOP supports KJSEmbed, Python, and UNIX Shell method for accessing DCOP.</para>
+
+<para>Once the script is complete it is ready to be installed. Application developers should document the location that will be scanned for scripts. In the case of the above example for Kate the scripts are located in "$KDEDIRS/share/apps/kate/scripts".</para>
+
+<figure id="screenshot-scripts" float="1">
+ <title>&kdevelop; Scripts on the Filesystem</title>
+ <mediaobject>
+ <imageobject><imagedata fileref="script_location.png"/></imageobject>
+ </mediaobject>
+</figure>
+
+<para>The script desktop file, and its associated script should be in the same directory. For script developers it is also recommended that all other script resources such as UI files, or data files should also reside in the script directory. In the above example the script will appear under the Tools->KDE Scripts menu. One important thing for script developers to note is that they should not perform operations that could block for a long time, or go into an eventloop. This is because the current version of the script interface is geared for automated tasks that run until completion. This is being addressed and extended for KDE 4.
+</para>
+
+</sect1>
+
+
+</chapter>
diff --git a/doc/kdevelop/kdevelop-survey.docbook b/doc/kdevelop/kdevelop-survey.docbook
new file mode 100644
index 00000000..9fe32d2d
--- /dev/null
+++ b/doc/kdevelop/kdevelop-survey.docbook
@@ -0,0 +1,489 @@
+<chapter id="kdevelop-survey">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Overview of &kdevelop; Features</title>
+
+<indexterm zone="kdevelop-survey">
+ <primary>&kdevelop;</primary>
+ <secondary>survey</secondary></indexterm>
+<indexterm zone="kdevelop-survey">
+ <primary>overall view</primary></indexterm>
+<indexterm zone="kdevelop-survey">
+ <primary>survey</primary></indexterm>
+
+<para>
+&kdevelop; integrates a lot of tools, scripts, and templates in a common user interface. Basically it consists of
+
+<itemizedlist>
+ <listitem><para>
+ several <link linkend="uimodes-survey">user interface modes</link> from which you can select the look and feel of the workspace,
+ </para></listitem>
+ <listitem><para>
+ an <link linkend="applicationwizard">&appwizard;</link> which aids you in setting up a new project,
+ </para></listitem>
+ <listitem><para>
+ several <link linkend="makesystems">project management systems</link> which aid in building and managing your project,
+ </para></listitem>
+ <listitem><para>
+ some <link linkend="editing">editing tools</link> to easily work on your program texts
+ </para></listitem>
+ <listitem><para>
+ various <link linkend="file-browsers">file browsers</link> providing you different views on your file system,
+ </para></listitem>
+ <listitem><para>
+ various <link linkend="class-browsers">class browsers</link> to aid you in maintaining the classes and their relationships of your object-oriented programming project,
+ </para></listitem>
+ <listitem><para>
+ a <link linkend="debugger">debugger interface</link> to find and remove program errors from within &kdevelop;, and
+ </para></listitem>
+ <listitem><para>
+ several <link linkend="plugin-tools">plugin tools</link>, extensible modules which can be loaded at runtime and on demand. This allows you to only turn on those features you really need.
+ </para></listitem>
+ <listitem><para>
+ a set of other diagnosis, documentation, and optimization helper tools.
+ </para></listitem>
+</itemizedlist>
+</para>
+
+<note>
+ <para>
+ In fact there are three &kdevelop;-based applications:
+ </para>
+ <itemizedlist>
+ <listitem><para>The &kdevelop; IDE &mdash; this is the place where you will usually work.</para></listitem>
+ <listitem><para>The stand-alone &kdevelop; Assistant documentation browser &mdash; isolates all the powerful documentation facilities of the &kdevelop; IDE in a separate tool. This comes in handy when you want to look up some programming documentation but do not want to start the full IDE.</para></listitem>
+ <listitem><para>The &kdevelop; Designer &mdash; enhances the &Qt; User Interface Designer by &kde; specific elements and integrates nicely in the &kdevelop; IDE.</para></listitem>
+ </itemizedlist>
+</note>
+
+
+<sect1 id="uimodes-survey">
+<title>Available User Interface Modes</title>
+
+<indexterm zone="uimodes-survey">
+ <primary>&kdevelop;</primary>
+ <secondary>user interface modes</secondary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>user interface</primary>
+ <secondary>&kdevelop; modes</secondary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>UI modes</primary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>Child Frame Windows</primary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>Tabbed Pages</primary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>Toplevel Windows</primary></indexterm>
+<indexterm zone="uimodes-survey">
+ <primary>IDEAl</primary></indexterm>
+
+<para>
+&kdevelop; offers developers four separate user interface modes (click on the mode name to view an example):
+<itemizedlist>
+ <listitem><para><link linkend="ideal-desc">IDEAl</link></para>
+ <para>
+ This is a novel user interface approach optimizing both work space and intuitive handling of the tools.
+ </para>
+ <itemizedlist>
+ <listitem><para>
+ All tool views are docked in a tabbar fashion around the mainframe area. They are grouped left, bottom, and right according to the services provided.
+ </para></listitem>
+ <listitem><para>
+ Editor and browser views will be stacked in a big sized tabbed window inmidst the mainframe area.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para><link linkend="mdi-desc">Child Frame Windows</link></para>
+ <itemizedlist>
+ <listitem><para>All tool views are initially docked to the mainframe.</para></listitem>
+ <listitem><para>Editor and browser views will live like toplevel windows within a view area of the mainframe.</para></listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para><link linkend="tabbed-desc">Tabbed Pages</link></para>
+ <itemizedlist>
+ <listitem><para>
+ All tool views are initially docked to the mainframe.
+ </para></listitem>
+ <listitem><para>
+ Editor and browser views will be stacked in a tabbed window.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
+ <para><link linkend="toplevel-desc">Toplevel Windows</link></para>
+ <itemizedlist>
+ <listitem><para>
+ All editor, browser, and tool views will be toplevel windows directly on the desktop.
+ </para></listitem>
+ <listitem><para>
+ The main widget only contains the menu, toolbars, and statusbar.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+
+</itemizedlist>
+</para>
+
+<sect2 id="uimodes-switch">
+<title>How to Switch User Interface Modes</title>
+
+<indexterm zone="uimodes-switch">
+ <primary>user interface</primary>
+ <secondary>switch modes</secondary></indexterm>
+<indexterm zone="uimodes-switch">
+ <primary>switch UI modes</primary></indexterm>
+
+<para>
+To switch the user interface mode select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Configure KDevelop...</guimenuitem> </menuchoice> from the menus. The <guilabel>Customize KDevelop</guilabel> dialog will pop up, where you have to select <guilabel>User Interface</guilabel> in the left hand tree. This will display the settings page shown below.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="select-user-interface.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Select a user interface mode
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+(Older &kdevelop; versions provide the top mode selection section only.)
+</para>
+
+<para>
+In the <guilabel>Major User-Interface Mode</guilabel> section select the radio button of the user interface mode you want to work in.
+</para>
+<para>
+Dependent on the user interface mode you selected, other configuration sections will become available where you can taylor more details of the look and feel to your preferences. See the <link linkend="setup-ui">Selecting the User Interface</link> chapter for more detail.
+</para>
+
+<note><para>
+Do not forget to restart &kdevelop; in order to let your selections take effect.
+</para></note>
+
+</sect2> <!-- uimodes-switch -->
+
+<sect2 id="maximize-workspace">
+<title>How to Maximize the Work Space Area</title>
+
+<indexterm zone="maximize-workspace">
+ <primary>&kdevelop;</primary>
+ <secondary>work space</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>&kdevelop;</primary>
+ <secondary>maximize work space</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>user interface</primary>
+ <secondary>work space</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>user interface</primary>
+ <secondary>menubar</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>user interface</primary>
+ <secondary>full screen mode</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>full screen mode</primary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>menubar</primary>
+ <secondary>hide/unhide</secondary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>hide menubar</primary></indexterm>
+<indexterm zone="maximize-workspace">
+ <primary>unhide menubar</primary></indexterm>
+
+<para>
+To maximize space, there is a full-screen window mode available which expands the mainframe area to the screen borders. Additional space can be reclaimed by hiding the menubar. And you can of course hide any toolbar as usual in <application>KDE</application> applications.
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Full Screen Mode</term>
+<listitem>
+<para>
+To switch to or from full screen mode select <menuchoice>
+<guimenu>View</guimenu> <guimenuitem>Full-Screen Mode</guimenuitem>
+</menuchoice> from the menus or press
+<keycombo>&Ctrl;&Shift;<keycap>F</keycap> </keycombo>. There is also a
+<guiicon>Full-Screen Mode</guiicon> icon in the <guilabel>Browse
+Toolbar</guilabel> available.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Hide/Unhide the Menubar</term>
+<listitem>
+<para>
+To <emphasis>hide</emphasis> the menubar select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Show Menubar</guimenuitem> </menuchoice> from the menus or press <keycombo>&Ctrl;<keycap>M</keycap> </keycombo>. You may also include a <guiicon>Show Menubar</guiicon> icon in a suiting toolbar, &eg; the <guilabel>Browse Toolbar</guilabel> for that purpose. To <emphasis>unhide</emphasis> the menubar you must press <keycombo> &Ctrl;<keycap>M</keycap> </keycombo> or use the <guiicon>Show Menubar</guiicon> icon if available.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2> <!-- maximize-workspace -->
+
+</sect1> <!-- uimodes-survey -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="ui-elements">
+<title>Elements of the User Interface</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect2 id="ui-elements-workarea">
+<title>The Workarea</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-workarea -->
+
+<sect2 id="ui-elements-titlebar">
+<title>The &kdevelop; Titlebar</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-titlebar -->
+
+<sect2 id="ui-elements-statusbar">
+<title>The &kdevelop; Statusbar</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-statusbar -->
+
+<sect2 id="ui-elements-menubar">
+<title>The menubar</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-menubar -->
+
+<sect2 id="ui-elements-toolbars">
+<title>The Toolbars</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-toolbars -->
+
+<sect2 id="ui-elements-treetoolviews">
+<title>The Tree Tool Views</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-treetoolviews -->
+
+<sect2 id="ui-elements-outputtoolviews">
+<title>The Output Tool Views</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- ui-elements-outputtoolviews -->
+
+</sect1> <!-- ui-elements -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="makesystems">
+<title>Project Management Systems</title>
+
+<indexterm zone="makesystems">
+ <primary>project management</primary></indexterm>
+
+<para>
+Globally, a project will rely on some form of project management system. &kdevelop; offers four <emphasis>project management systems</emphasis> the programmer can select from when creating a new project.
+
+<itemizedlist>
+ <listitem><para>
+ <link linkend="automake-project">Automake projects</link> use the &GNU; standard development tools.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="qmake-project">QMake projects</link> use the trolltech QMake project manager.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="ant-project">ANT projects</link> use the Apache ANT project manager for &Java; development.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="custom-project">Custom projects</link> require you to maintain your own <filename>Makefiles</filename>.
+ </para></listitem>
+</itemizedlist>
+</para>
+
+<sect2 id="automake-project">
+<title>Automake Projects</title>
+
+<indexterm zone="automake-project">
+ <primary>projects</primary>
+ <secondary>automake</secondary></indexterm>
+<indexterm zone="automake-project">
+ <primary>automake</primary>
+ <secondary>projects</secondary></indexterm>
+
+<para>
+Projects created with &kdevelop;'s &automanag; make it very easy for developers to use the &GNU; standard development tools. They provide
+<itemizedlist>
+ <listitem><para>
+ a better way of <filename>Makefile</filename> generation and
+ </para></listitem>
+ <listitem><para>
+ a good and safe way for fast adaption towards different systems by autoconf-generated <filename>configure</filename> scripts.
+ </para></listitem>
+</itemizedlist>
+</para>
+</sect2> <!-- automake-project -->
+
+<sect2 id="qmake-project">
+<title>QMake Projects</title>
+
+<indexterm zone="qmake-project">
+ <primary>projects</primary>
+ <secondary>qmake</secondary></indexterm>
+<indexterm zone="qmake-project">
+ <primary>qmake</primary>
+ <secondary>projects</secondary></indexterm>
+
+<para>
+For developers who enjoy the flexibility and feel of &Qt;'s qmake system, &kdevelop; offers the ability to handle qmake based projects (.pro files) within the &GUI;.
+</para>
+<para>
+For more information on the QMake project manager see the <quote>qmake User Guide</quote> which should be included in your distribution or have a look at the <ulink url="http://doc.trolltech.com/">TROLLTECH Documentation</ulink> home page where you may find the QMake documentation of your <quote>Qt C++ GUI Application Development Toolkit</quote> version.
+</para>
+</sect2> <!-- qmake-project -->
+
+<sect2 id="cmake-project">
+<title>CMake Projects</title>
+
+<indexterm zone="cmake-project">
+ <primary>projects</primary>
+ <secondary>cmake</secondary></indexterm>
+<indexterm zone="cmake-project">
+ <primary>cmake</primary>
+ <secondary>projects</secondary></indexterm>
+
+<para>
+CMake will be the &kde; build system for &kde; 4 and &kdevelop; already
+provides you some CMake based templates in C and C++. You only need the cmake
+program in your $<envar>PATH</envar> to build them.
+</para>
+<para>
+To set up a new C or C++ project in &kdevelop; select
+<menuchoice><guimenu>Project</guimenu>
+<guimenuitem>New Project...</guimenuitem>
+<guimenuitem>C or C++</guimenuitem>
+<guimenuitem>CMake based projects</guimenuitem>
+<guimenuitem>A shared library template or Hello world program</guimenuitem>
+</menuchoice>.
+</para>
+</sect2> <!-- cmake-project -->
+
+<sect2 id="ant-project">
+<title>ANT Projects (&Java; Projects)</title>
+
+<indexterm zone="ant-project">
+ <primary>projects</primary>
+ <secondary>ant</secondary></indexterm>
+<indexterm zone="ant-project">
+ <primary>ant</primary>
+ <secondary>projects</secondary></indexterm>
+<indexterm zone="ant-project">
+ <primary>projects</primary>
+ <secondary>Java</secondary></indexterm>
+<indexterm zone="ant-project">
+ <primary>Java</primary>
+ <secondary>projects</secondary></indexterm>
+<indexterm zone="ant-project">
+ <primary>development</primary>
+ <secondary>Java</secondary></indexterm>
+
+<para>
+&Java; developers may want to use the Apache ANT project manager for their projects. To set up a new Ant project in &kdevelop; select <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>New Project...</guimenuitem>
+<guimenuitem>Java</guimenuitem>
+<guimenuitem>Ant Project</guimenuitem>
+<guimenuitem>Application</guimenuitem></menuchoice>.
+</para>
+<para>
+For more information see <ulink url="http://ant.apache.org/">The Apache Ant Project</ulink> home page.
+</para>
+</sect2> <!-- ant-project -->
+
+<sect2 id="custom-project">
+<title>Custom Projects</title>
+
+<indexterm zone="custom-project">
+ <primary>projects</primary>
+ <secondary>custom</secondary></indexterm>
+<indexterm zone="custom-project">
+ <primary>custom projects</primary></indexterm>
+<indexterm zone="custom-project">
+ <primary>Makefile</primary>
+ <secondary>custom projects</secondary></indexterm>
+
+<para>
+If you prefer to maintain your own <filename>Makefiles</filename> for your project you may use the custom project option of &kdevelop;. This may be feasible in unusually structured projects or if you want to retain full control over the <command>make</command> process.
+</para>
+<para>
+Yet, if you do not <emphasis>really need</emphasis> the extra flexibility and control of the custom project manager you should consider &automanag; or one of the other project managers, because they considerably ease the program building and distribution processes.
+</para>
+</sect2> <!-- custom-project -->
+
+<sect2 id="makesystems-distribution">
+<title>How to Distribute Your Application</title>
+
+<indexterm zone="makesystems-distribution">
+ <primary>distribution</primary></indexterm>
+<indexterm zone="makesystems-distribution">
+ <primary>application</primary>
+ <secondary>distribution</secondary></indexterm>
+<indexterm zone="makesystems-distribution">
+ <primary>binary packages</primary></indexterm>
+
+<para>
+The distribution of your applications does not require the end-user to have anything different installed other than
+<itemizedlist>
+ <listitem><para>an appropriate compiler,</para></listitem>
+ <listitem><para>a linker, and</para></listitem>
+ <listitem><para>the appropriate development libraries,</para></listitem>
+</itemizedlist>
+</para>
+<para>
+which at least for C++ applications is most often the case. But you can as well distribute <emphasis>binary packages</emphasis> of your application.
+<!-- ### more detail on binary construction needed somewhere -->
+In either way, the end-user of your product does not need &kdevelop; installed.
+</para>
+<para>
+For giving away your sources, we advise to include the <emphasis>project file</emphasis> of &kdevelop; as well. This makes it very easy for other developers&mdash;if they use &kdevelop;&mdash;to work with your sources.
+</para>
+<para>
+For projects where <emphasis>several developers</emphasis>, maybe working on different places, are involved, this should be the case anyway. So you can ensure consistency of the <filename>Makefiles</filename> to not run into trouble.
+</para>
+<para>
+Especially on multi language applications, <emphasis>translators</emphasis> won't actually work with the source code, except in cases that require correction for enabling translation support.
+</para>
+
+</sect2> <!-- makesystems-distribution -->
+
+</sect1> <!-- makesystems -->
+
+</chapter> <!-- kdevelop-survey -->
diff --git a/doc/kdevelop/kdevelop-tabbed-mode.png b/doc/kdevelop/kdevelop-tabbed-mode.png
new file mode 100644
index 00000000..faa7a97f
--- /dev/null
+++ b/doc/kdevelop/kdevelop-tabbed-mode.png
Binary files differ
diff --git a/doc/kdevelop/kdevelop-toplevel-mode.png b/doc/kdevelop/kdevelop-toplevel-mode.png
new file mode 100644
index 00000000..c2fb812b
--- /dev/null
+++ b/doc/kdevelop/kdevelop-toplevel-mode.png
Binary files differ
diff --git a/doc/kdevelop/listplugins.sh b/doc/kdevelop/listplugins.sh
new file mode 100755
index 00000000..e21b3a15
--- /dev/null
+++ b/doc/kdevelop/listplugins.sh
@@ -0,0 +1,43 @@
+
+# kdevdir must be set to the KDevelop project directory.
+kdevdir=/home/volker/data/prj/kdevelop/kdevelop/
+# The plugins are in the parts/ subdirectory.
+
+pushd $kdevdir/parts >/dev/null
+oldscope=nix
+echo "<para>The following plugin list is generated by a small script"
+echo "written by Volker Paul. All plugins have a .desktop file"
+echo "where information such as name and comments are written."
+echo "If in the following these comments are not very useful,"
+echo "it is because the plugin authors made them this way.</para>"
+echo "<para>The plugins are grouped by scope (Core, Global, Project).</para>"
+
+for defscope in Core Global Project; do
+ if [ $defscope != $oldscope ]; then
+ oldscope=$defscope
+ echo
+# echo "<sect1><title>Scope: $defscope</title>"
+ echo "<para>Scope: $defscope</para>"
+ echo "<itemizedlist>"
+ fi
+ for dir in `ls`; do
+ if [ ! -d $dir ]; then continue; fi
+ dfile=$dir/*.desktop
+ # echo $dfile | wc -w
+ if [ `echo $dfile | wc -w` -gt 1 ]; then continue; fi
+ if [ ! -f $dfile ]; then continue; fi
+ scope=`cat $dfile | grep "X-KDevelop-Scope=" | cut -d= -f2-`
+ if [ $scope != $defscope ]; then continue; fi
+ comment=`cat $dfile | grep "Comment=" | cut -d= -f2-`
+ name=`cat $dfile | egrep "^Name=" | cut -d= -f2- | tr " " _`
+ genericname=`cat $dfile | grep "GenericName=" | cut -d= -f2-`
+ echo "<listitem><formalpara id=\"$name\">"
+ echo "<title>$genericname</title>"
+ echo "<para>$comment</para></formalpara></listitem>"
+ done
+ echo "</itemizedlist>"
+# echo "</sect1>"
+done
+popd >/dev/null
+echo "<para>So far the generated plugin list.</para>"
+echo
diff --git a/doc/kdevelop/loading-progress-bar.png b/doc/kdevelop/loading-progress-bar.png
new file mode 100644
index 00000000..f786721d
--- /dev/null
+++ b/doc/kdevelop/loading-progress-bar.png
Binary files differ
diff --git a/doc/kdevelop/nutshell.docbook b/doc/kdevelop/nutshell.docbook
new file mode 100644
index 00000000..1c5395dd
--- /dev/null
+++ b/doc/kdevelop/nutshell.docbook
@@ -0,0 +1,242 @@
+<appendix id="nutshell">
+<title>In a Nutshell &mdash; Tips and Tricks</title>
+
+<!-- Traditionally, most of this stuff will have been put into a FAQ section. It is more useful, however, to put it at the very start of a manual, as this is the place the (inexperienced) user first looks for.
+
+I disagree. What is useful for a quick start, should go in "Getting started".
+Troubleshooting hints go in the appendix or a FAQ. Volker Paul.
+
+This chapter is meant to provide short hints and tips together with (mandatory) navigation links.
+There should be an additional FAQ section near the end nevertheless which contains more general stuff not directly related to navigating the manual. -->
+
+<para>
+The information in this chapter is meant as a quick reference for a head start or if you (momentarily) forgot about some basic concept. There are also short hints on how to solve some common problems when working with &kdevelop;.
+</para>
+<para>
+If you want more information on a topic, just follow the link in the title starting that advice.
+</para>
+<para>
+Information on these topics is availabe:
+</para>
+<simplelist>
+ <member><link linkend="nutshellitem-look-and-feel">Look and Feel</link></member>
+ <member><link linkend="nutshellitem-projects">Projects</link></member>
+ <member><link linkend="nutshellitem-compilation">Compilation</link></member>
+ <member><link linkend="nutshellitem-automake">&automanag;</link></member>
+ <member><link linkend="nutshellitem-compilemake">Compile/Make Problems</link></member>
+ <member><link linkend="nutshellitem-others">Other Topics</link></member>
+</simplelist>
+
+<variablelist id="nutshellitem-look-and-feel">
+<title>Look and Feel</title>
+
+<varlistentry>
+<term id="nutshell-ideal-tabs"><link linkend="setup-ui-toolview">Force
+smaller tool view tabs in IDEAl Mode</link></term>
+<listitem>
+<para>By default &kdevelop; starts with large text-based tool tip tabs
+around the work area. You may change this look to &eg; save space in the
+&kdevelop; configuration dialog (<menuchoice><guimenu>Settings</guimenu>
+<guimenuitem>Configure KDevelop...</guimenuitem> <guimenuitem>User
+Interface</guimenuitem></menuchoice>).</para>
+<para>If you use an older &kdevelop; 3 version, this configuration dialog
+may not be available. To change the toolview tabs display manually, place a
+<option>MDIStyle</option> entry under the
+<option>[UI]</option> tag in your
+<filename>$KDEHOME/share/config/kdeveloprc</filename> configuration file as
+follows:</para>
+
+<simplelist>
+<member><option>MDIStyle=0</option>: icons only</member>
+<member><option>MDIStyle=1</option>: text only (default)</member>
+<!--<member><computeroutput>MDIStyle=2</computeroutput>: icons only on smaller tabs (not very useful)</member>-->
+<member><option>MDIStyle=3</option>: icons and text</member>
+</simplelist>
+</listitem>
+</varlistentry>
+
+<varlistentry> <!-- ### remove this entry when the bug is repaired -->
+<term id="nutshell-weird-style">Weird colored characters and/or display
+style</term>
+<listitem>
+<para>If you notice random colored letters everywhere (&ie; on tabs, on tool
+bars, etc.) and the &kdevelop; window seemingly uses a wrong display style,
+this may help:</para>
+
+<itemizedlist>
+<listitem><para>In your
+<filename>$<envar>KDEHOME</envar>/share/config/kdeveloprc</filename>
+configuration file find the line containing
+<quote><computeroutput>Style=Checked</computeroutput></quote> and remove
+it. Then restart &kdevelop;.
+</para>
+</listitem>
+</itemizedlist>
+<para>(This behaviour does sometimes occur after you left clicked a .ui file
+in one of the file navigators and &kdevelop; did load
+<application>KUIViewer</application> to show the &GUI; which was produced
+from this file.)</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="nutshell-full-screen"><link linkend="maximize-workspace">Full
+screen mode</link></term>
+<listitem>
+<para>Select <menuchoice><guimenu>View</guimenu><guimenuitem>Full-Screen
+Mode</guimenuitem></menuchoice> from the menus or press
+<keycombo>&Ctrl;&Shift;<keycap>F</keycap></keycombo>.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="nutshell-hide-menu"><link linkend="maximize-workspace">Hide/Unhide
+the menubar</link></term>
+<listitem>
+<para>To hide the menubar select
+<menuchoice><guimenu>Settings</guimenu><guimenuitem>Show
+Menubar</guimenuitem></menuchoice> from the menus or press
+<keycombo>&Ctrl;<keycap>M</keycap></keycombo>. To redisplay the menubar only
+<keycombo>&Ctrl;<keycap>M</keycap> </keycombo> is available.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist>
+<title id="nutshellitem-projects">Projects</title>
+<varlistentry>
+<term><link linkend="new-projects">Create New Project</link></term>
+<listitem>
+<para><menuchoice><guimenu>Project</guimenu><guimenuitem>New
+Project...</guimenuitem></menuchoice> will start the <link
+linkend="applicationwizard">&appwizard;</link>.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="nutshell-new-custom-project">Create a custom project</term>
+<listitem>
+<para>There is no direct way to create a custom project (&ie; a project
+which does use its own makefiles). Use
+<menuchoice><guimenu>Project</guimenu> <guimenuitem>Import Existing
+Project</guimenuitem></menuchoice> instead. Remember to set the appropriate
+<guilabel>Project Type</guilabel>, labeled by an additional <quote>(Custom
+Makefiles)</quote>, in the dialog.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="nutshell-project-options">Use project options early</term>
+<listitem>
+<para>Whenever you start a new project do not forget to set the
+<menuchoice><guimenu>Project</guimenu> <guimenuitem>Project
+Options...</guimenuitem></menuchoice> to your needs.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist id="nutshellitem-compilation">
+<title>Compilation</title>
+<varlistentry>
+<term id="nutshell-compilemsg-detail"><link
+linkend="setup-main-compile">Missing detail in compilation
+messages</link></term>
+<listitem>
+<para>If during compilations you notice some valuable information is missing
+in the <guilabel>Messages Output View</guilabel> window, it may be that the
+level of message detail is set too low. &RMB; click in the window and select
+another detail level from the context menu.<!-- they are programmers, so -->
+<!-- they should know what a context menu is. (Re: But they keep on asking -->
+<!-- just about this one all the time!! bp) -->
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist id="nutshellitem-automake">
+<title><link linkend="automake-manager">&automanag;</link></title>
+
+<varlistentry>
+<term>Create new files in a project</term>
+<listitem>
+<para>Select the sub-project in the upper half of the &automanag;, then
+&RMB; click in the lower half on the groups title you want to have the files
+added and select <guimenuitem>Create New File...</guimenuitem>.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry id="nutshell-add-project-file">
+<term>Add existing files to a project</term>
+<listitem>
+<para>Select the sub-project in the upper half of the &automanag;, then
+&RMB; click in the lower half on the groups title you want to have the files
+added and select <guimenuitem>Add Existing Files...</guimenuitem>.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Remove a file from a project</term>
+<listitem>
+<para>Select the sub-project in the upper half of the &automanag;, then in
+the lower half open the groups list you want to have the file removed from,
+&RMB; click on the file in this list and select
+<guimenuitem>Remove</guimenuitem>.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist id="nutshellitem-compilemake">
+<title>Compile/Make Problems</title>
+<varlistentry>
+<term id="nutshell-builddirproblems"><link
+linkend="defaultbuild-warning">Project does not build again after switching
+to/from default target</link></term>
+<listitem>
+<para>There is a problem with the &automake;/&autoconf; machinery. If
+<menuchoice> <guimenu>Project</guimenu> <guimenuitem>Build
+Configuration</guimenuitem></menuchoice> provides to select from three build
+directories: <guimenuitem>default</guimenuitem>,
+<guimenuitem>optimized</guimenuitem>, and <guimenuitem>debug</guimenuitem>,
+by all means stick to <emphasis>either</emphasis> the default
+<emphasis>or</emphasis> the debug/optimized targets.</para>
+<itemizedlist>
+<listitem>
+<para>Once you configured your project with default it will no longer build
+with debug or optimzed.</para>
+</listitem>
+<listitem>
+<para>Once you configured your project with debug or optimzed it will no
+longer build with default.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="nutshell-autoconf-problem"><quote>Wrong
+<command>autoconf</command> version</quote> &etc; Error</term>
+<listitem>
+<para>There are several error messages concerning too old versions of
+<application>autoconf</application> &etc; prohibiting
+<command>configure</command> to work properly. Run
+<command>autoreconf</command> in the directory tree where the
+<filename>configure.in</filename> files in question are. This command will
+try to update the information in the &GNU; Build System files. See
+<command>man autoreconf</command> for more information.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist id="nutshellitem-others">
+<title>Other Topics</title>
+<varlistentry>
+<term id="nutshell-others-files"><link linkend="app-files">Configuration
+Files used by &kdevelop;</link></term>
+<listitem>
+<para>Usually you should not need to care, but this is very useful to know
+in case something went wrong with your setup.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</appendix> <!-- nutshell -->
diff --git a/doc/kdevelop/open-project.png b/doc/kdevelop/open-project.png
new file mode 100644
index 00000000..c7b1ee20
--- /dev/null
+++ b/doc/kdevelop/open-project.png
Binary files differ
diff --git a/doc/kdevelop/open-recent-project.png b/doc/kdevelop/open-recent-project.png
new file mode 100644
index 00000000..20a1adc6
--- /dev/null
+++ b/doc/kdevelop/open-recent-project.png
Binary files differ
diff --git a/doc/kdevelop/plugin-tools.docbook b/doc/kdevelop/plugin-tools.docbook
new file mode 100644
index 00000000..1c07cb7a
--- /dev/null
+++ b/doc/kdevelop/plugin-tools.docbook
@@ -0,0 +1,433 @@
+<appendix id="plugin-tools">
+<title>Plugin Tools</title>
+
+<indexterm zone="plugin-tools">
+ <primary>plugins</primary></indexterm>
+
+<para>
+&kdevelop; contains a large number of little tools that help you to perform
+certain task. Most of them are realized as plugins. That means, if you do not
+need a plugin, you can disable it.</para>
+<para>That also means, if you are looking for a functionality that should be there
+and isn't, then maybe it's implemented in a plugin and that plugin is disabled.
+For example, in the file menu there is a Quick Open feature, but only if
+it's enabled in the Project - Project Options dialog.
+</para>
+
+<para>Technically, plugins are based on the KDevPlugin class defined in
+lib/interfaces/kdevplugin.h. The following is taken from a comment from there.</para>
+
+<para>
+KDevPlugin is the base class for all KDevelop plugins.
+A plugin is a component which is loaded into KDevelop shell at startup or by request.
+A plugin has a scope that can be either:
+<itemizedlist>
+<listitem><simpara>Core</simpara></listitem>
+<listitem><simpara>Global</simpara></listitem>
+<listitem><simpara>Project</simpara></listitem>
+</itemizedlist>
+</para>
+
+<para>Core plugins are global plugins which offer some important "core" functionality and thus
+are not selectable by user in plugin configuration pages.</para>
+
+<para>Global plugins are plugins which require only shell to be loaded and do not operate on
+KDevProject interface and/or do not use project wide information.
+For example, the uimode plugin allows a developer to select which user interface they wish to use.
+</para>
+
+<para>Project plugins require a project to be loaded and are usually loaded/unloaded along with the project.
+If a plugin operates on project-related information then it is a project plugin.
+The Automake Manager, for example, only needs to be active when an Automake based project is currently loaded.
+</para>
+
+<para>As stated above, core plugins cannot be disabled. Global plugins can be
+enabled/disabled in <menuchoice><guimenu>Settings</guimenu>
+<guimenuitem>Configure KDevelop...</guimenuitem></menuchoice>
+under <guibutton>Plugins</guibutton>.
+Project plugins can be
+enabled/disabled in <menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project Options...</guimenuitem></menuchoice>
+under <guibutton>Plugins</guibutton>.
+Active plugins can have many effects on KDevelop.
+Depending on their function, they may add extra menus, extra menu items, extra tool buttons, etc.
+</para>
+
+<para>Plugins which are disabled do not clutter your menus and are not loaded
+into memory.
+</para>
+
+
+<para>The following plugin list is generated by a small script
+(listplugins.sh) written by Volker Paul. All plugins have a .desktop file
+where information such as name and comments are written.
+If in the following these comments are not very useful,
+it is because the plugin authors made them this way.</para>
+<para>The plugins are grouped by scope (Core, Global, Project).</para>
+
+<para>Scope: Core</para>
+<itemizedlist>
+<listitem><formalpara id="KDevAppWizard">
+<title>Application Wizard</title>
+<para>Application Wizard</para></formalpara></listitem>
+<listitem><formalpara id="KDevDiff">
+<title>Difference Viewer</title>
+<para>Difference Viewer</para></formalpara></listitem>
+<listitem><formalpara id="KDevFileCreate">
+<title>FileCreate</title>
+<para>FileCreate</para></formalpara></listitem>
+<listitem><formalpara id="KDevFullScreen">
+<title>FullScreen</title>
+<para>FullScreen</para></formalpara></listitem>
+<listitem><formalpara id="KDevTipOfDay">
+<title>Tip of the Day</title>
+<para>Tip of the Day</para></formalpara></listitem>
+<listitem><formalpara id="KDevUIChooser">
+<title>User-Interface Selection</title>
+<para>Provides a dialog for UI-mode selection.</para></formalpara></listitem>
+<listitem><formalpara id="KDevVCSManager">
+<title>VCSManager</title>
+<para>Version Control System Manager </para></formalpara></listitem>
+</itemizedlist>
+
+<para>Scope: Global</para>
+<itemizedlist>
+<listitem><formalpara id="KDevAbbrev">
+<title>Abbreviation Expansion</title>
+<para>Provides support for customizable abbreviations - short words which expand into commonly needed code structures.</para></formalpara></listitem>
+<listitem><formalpara id="KDevDocumentation">
+<title>Documentation</title>
+<para>The Documentation plugin offers browsing and searching in local and online documentation with support for multiple documentation systems.</para></formalpara></listitem>
+<listitem><formalpara id="KDevfilelist">
+<title>FileList</title>
+<para>Provides a list of all currently open files. (Handy when the tab bar is not quite wide enough.)</para></formalpara></listitem>
+<listitem><formalpara id="KDevFileSelector">
+<title>File Selector</title>
+<para>Powerful network transparent file browser utility.</para></formalpara></listitem>
+<listitem><formalpara>
+<title>Shell Filtering and Insertion</title>
+<para>Provides a way of manipulating editor text using commandline tools. Appears in the Tools menu.</para></formalpara></listitem>
+<listitem><formalpara id="KDevGrepView">
+<title>Grep Frontend</title>
+<para>Integrates "find|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.</para></formalpara></listitem>
+<listitem><formalpara id="KDevKonsoleView">
+<title>Embedded Konsole</title>
+<para>This plugin gives KDevelop an embedded konsole for quick and easy command line access.</para></formalpara></listitem>
+<listitem><formalpara id="KDevOpenWith">
+<title>"Open with" Menu Addon</title>
+<para>This plugin provides additional "open" alternatives for various context menus in KDevelop.</para></formalpara></listitem>
+<listitem><formalpara id="KDevPartExplorer">
+<title>Part Explorer Tool</title>
+<para>A Graphical tool for performing KTrader-like queries about registered services</para></formalpara></listitem>
+<listitem><formalpara id="KDevRegexpTest">
+<title>Regular Expression Tester</title>
+<para>Tool to design and test regular expressions against common regexp syntaxes.</para></formalpara></listitem>
+<listitem><formalpara id="KDevReplace">
+<title>Replace Part</title>
+<para>This plugin is an interactive projectwide "Search and Replace" tool. Search using string or regexp matching, and select the replacements to be made from a preview before the action is finalized. When loaded it appears in the Edit menu.</para></formalpara></listitem>
+<listitem><formalpara id="KDevscripting">
+<title>Scripting</title>
+<para>The Scripting plugin offers KScript based scripting of the KDevelop application</para></formalpara></listitem>
+<listitem><formalpara id="Code_Snippets">
+<title>Code Snippets</title>
+<para>This plugin allows you to store code snippets and add them to your code</para></formalpara></listitem>
+<listitem><formalpara id="KDevTextTools">
+<title>Text Structure</title>
+<para>Provides a structure overview and navigation for HTML and TEX files</para></formalpara></listitem>
+<listitem><formalpara id="KDevTools">
+<title>Tools Menu Addition</title>
+<para>This plugin provides an easy way to add external applications to the Tools menu and toolbar.</para></formalpara></listitem>
+<listitem><formalpara id="KDevvalgrind">
+<title>Valgrind Frontend</title>
+<para>Valgrind is a tool that helps you find memory management problems in programs. http://developer.kde.org/~sewardj/</para></formalpara></listitem>
+</itemizedlist>
+
+<para>Scope: Project</para>
+<itemizedlist>
+<listitem><formalpara id="KDevannotation">
+<title>annotation Plugin</title>
+<para>annotation Description</para></formalpara></listitem>
+<listitem><formalpara id="KDevAStyle">
+<title>Source Code Formatter</title>
+<para>A plugin for formatting of sourcecode according to a specified set of rules. When loaded it is found in the Tools menu.</para></formalpara></listitem>
+<listitem><formalpara id="KDevBookmarks">
+<title>Bookmarks</title>
+<para>Plugin that provides navigation and overview of active source bookmarks and persists them between sessions.</para></formalpara></listitem>
+<listitem><formalpara id="KDevClassView">
+<title>Class View</title>
+<para>This plugin displays a graphical view of all the classes in the project, complete with methods and attributes, and provides a way of direct source navigation.</para></formalpara></listitem>
+<listitem><formalpara id="KDevcopyto">
+<title>CopyTo</title>
+<para>Simple file uploader plugin. It does a file copy over any KIO supported protocol.</para></formalpara></listitem>
+<listitem><formalpara id="KDevCTags2">
+<title>CTags Frontend</title>
+<para>CTags is a source navigation tool with support for many languages. When loaded it provides a context menu for finding type declarations/definitions and also a query dialog. http://ctags.sourceforge.net/</para></formalpara></listitem>
+<listitem><formalpara id="KDevdistpart">
+<title>Final Packaging Support</title>
+<para>Aids in building and publishing the final project. Only RPM package format is supported for now.</para></formalpara></listitem>
+<listitem><formalpara id="KDevDoxygen">
+<title>Doxygen Support</title>
+<para>The doxygen plugin provides a way to specify and control generation of documentation for a project, based on source code content. You need to have doxygen installed to be able to use this. For more info goto http://www.doxygen.org</para></formalpara></listitem>
+<listitem><formalpara id="KDevQuickOpen">
+<title>QuickOpen</title>
+<para>Provides an efficient way of finding/opening files, classes and methods in a large project. Appears in the File and Tools menus when loaded.</para></formalpara></listitem>
+<listitem><formalpara id="KDevSecurity">
+<title>Security Checker</title>
+<para>Code security checker</para></formalpara></listitem>
+</itemizedlist>
+<para>So far the generated plugin list.</para>
+
+
+<table id="table-project-parts">
+<title>Project Management Plugins in &kdevelop;</title>
+<tgroup cols="2"><tbody>
+<row>
+ <entry>antproject</entry>
+ <entry>ANT Project Manager (&Java; applications)</entry>
+</row>
+<row>
+ <entry>autoproject</entry>
+ <entry>Automake Project Manager</entry>
+</row>
+<row>
+ <entry>customproject</entry>
+ <entry>Custom Project Manager</entry>
+</row>
+<row>
+ <entry>trollproject</entry>
+ <entry>QMake based Project Manager</entry>
+</row>
+</tbody></tgroup>
+</table>
+<para>The above plugins are currently (May 2005) empty. Maybe
+project management support will be implemented as plugins
+in the future.</para>
+
+
+<table>
+<title>Language Support Plugins in &kdevelop;</title>
+<tgroup cols="2">
+<tbody>
+<row><entry>cppsupport</entry><entry>Support for C/C++</entry></row>
+<row><entry>fortransupport</entry><entry>Support for Fortran</entry></row>
+<row><entry>javasupport</entry><entry>Support for &Java;</entry></row>
+<row><entry>perlsupport</entry><entry>Support for Perl</entry></row>
+<row><entry>phpsupport</entry><entry>Support for PHP</entry></row>
+<row><entry>pythonsupport</entry><entry>Support for Python</entry></row>
+</tbody></tgroup>
+</table>
+
+
+<para>In the following, some of the plugins will be discussed in detail.</para>
+
+<itemizedlist>
+<listitem>
+<formalpara>
+<title>The <command>abbrev</command> Plugin</title>
+<indexterm zone="plugin-tools"><primary><command>abbrev</command></primary></indexterm>
+
+<para>
+This plugin expands abbreviations into frequently used code snippets. It is
+activated by pressing <keycombo><keycap>Ctrl</keycap>
+<keycap>Space</keycap></keycombo>. For example, when you enter
+<literal>"ife"</literal> into a C++ in the editor and press
+<keycombo><keycap>Ctrl</keycap><keycap>Space</keycap></keycombo>, you obtain
+an <literal>if-else</literal> code template and save some key strokes. The set
+of supported abbreviations depends on the programming language of the edited
+file. For example, for PHP you will obviously be interested in other code
+templates than for &Java;.
+</para>
+</formalpara>
+
+<para>
+The set of code templates is configurable. If the plugin is enabled, you can see
+which ones are available in the <menuchoice><guimenu>Settings</guimenu>
+<guimenuitem>Configure KDevelop...</guimenuitem></menuchoice>
+dialog under <guibutton>Abbreviations</guibutton>.
+</para>
+</listitem>
+
+<listitem>
+<formalpara id="KDevFilter">
+<title>The <command>filter</command> Plugin</title>
+<indexterm zone="plugin-tools"><primary><command>filter</command></primary></indexterm>
+
+<para>
+This offers two features. If you select <menuchoice><guimenu>Tools</guimenu>
+<guimenuitem>Execute command</guimenuitem></menuchoice>, you can enter a shell
+command. The output of this command is inserted into the editor buffer when
+you hit the <guibutton>Start</guibutton> button.
+</para>
+</formalpara>
+
+<para>
+A related feature is available under
+<menuchoice><guimenu>Tools</guimenu><guimenuitem>Filter selection through
+command...</guimenuitem></menuchoice>. In order to use this, you must
+select a text area in the editor. If you now enter a shell command and hit
+the <guibutton>Start</guibutton> button, the command is started and the
+selection used as the standard input for it. The standard output of the
+command is then inserted into the editor, replacing the selection.
+</para>
+
+<para>
+For example, if you write documentation, you frequently have to refer
+to menu items. To do this correctly for e.g. the Copy command in the
+Edit menu, you have to write:
+<programlisting>&lt;menuchoice&gt;&lt;guimenu&gt;Edit&lt;/guimenu&gt;&lt;guimenuitem&gt;Copy&lt;/guimenuitem&gt;&lt;/menuchoice&gt;</programlisting>
+This is cumbersome, so you'd rather just write "Edit - Copy"
+and let the computer do the tagging.
+Here is how you can do it.
+You write a little shell script called mef you put e.g. in your home's bin directory:
+<programlisting>sed s/"^\(.*\) - \(.*\)\$"/"&lt;menuchoice&gt;&lt;guimenu&gt;\1&lt;\/guimenu&gt;&lt;guimenuitem&gt;\2&lt;\/guimenuitem&gt;&lt;\/menuchoice&gt;"/</programlisting>
+Don't forget to make it executable.
+That's all. Now, in your documentation .docbook source, you write "Edit - Copy".
+You select this text you just wrote, choose
+<menuchoice><guimenu>Tools</guimenu><guimenuitem>Filter selection through
+command...</guimenuitem></menuchoice> and call ~/bin/mef.
+Instantly "Edit - Copy" is replaced by
+<programlisting>&lt;menuchoice&gt;&lt;guimenu&gt;Edit&lt;/guimenu&gt;&lt;guimenuitem&gt;Copy&lt;/guimenuitem&gt;&lt;/menuchoice&gt;</programlisting>
+</para>
+
+
+</listitem>
+
+<listitem>
+<formalpara>
+<title>The &doxygen; Plugin</title>
+<indexterm zone="plugin-tools"><primary>&doxygen;</primary></indexterm>
+<indexterm zone="plugin-tools"><primary>documentation tool</primary></indexterm>
+<indexterm zone="plugin-tools"><primary>API documentation</primary></indexterm>
+
+<para>
+This one helps you to use the &doxygen; API documentation tool
+(<ulink url="http://www.doxygen.org"/>). You can select
+<menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Run Doxygen</guimenuitem></menuchoice> to generate API
+documentation for your current project, based on the configuration given by
+the file <filename>Doxyfile</filename> in your project directory.
+</para>
+</formalpara>
+
+<para>
+Furthermore, you can configure &doxygen; in the
+<menuchoice><guimenu>Project</guimenu>
+<guimenuitem>Project options...</guimenuitem></menuchoice> dialog. This dialog
+is very similar to the &doxywizard; tool.
+</para>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>The &ctags; Plugin</title>
+<indexterm zone="plugin-tools"><primary>&ctags;</primary></indexterm>
+
+<para>
+Although the class browser gives you extensive insight into the symbols and
+classes of your project, you may also want to use the ctags tool. In particular,
+this one supports a lot more language than the class browser.
+</para>
+</formalpara>
+
+<para>
+You activate this plugin under <menuchoice><guimenu>Tools</guimenu>
+<guimenuitem>CTags...</guimenuitem></menuchoice>. When you start it the first
+time, you will be asked to generate a search database first. When you accept
+this, the &ctags; program will be started and will create a file named
+<filename>tags</filename> in your project directory. This is a text file containing
+all symbols of your source files.
+</para>
+
+<para>
+You can search in the symbol database in two ways: when the
+<guilabel>Regular expression match</guilabel> box is checked, the text you
+enter will be interpreted as a regular expression (POSIX flavor) and matched
+with the existing symbols. For example, the text <literal>.*Widget</literal>
+will search for all symbols ending with <literal>Widget</literal>. If the
+box is not checked, the search will be verbatim.
+</para>
+
+<para>
+When searching, you will get a list of the matched symbols, accompanied with
+the line numbers where they are defined. You jump to the respective point by
+clicking on the list.
+</para>
+
+<para>
+For some languages, &ctags; distinguishes different kinds of symbols. For
+example, Python has classes and functions. You can selectively search only
+for classes by checking the respecting kinds in the dialog.
+</para>
+
+<para>
+The symbol database is normally not updated when your sources change.
+Consequently, after a while the line numbers will not be correct anymore
+and newly added classes and functions will be missing. Therefore you should
+update the <filename>tags</filename> file in regular intervals by pressing
+the button <guibutton>Regenerate</guibutton>.
+</para>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>The <command>astyle</command> Plugin</title>
+<indexterm zone="plugin-tools"><primary><command>astyle</command></primary></indexterm>
+<indexterm zone="plugin-tools"><primary><application>Artistic Style</application></primary></indexterm>
+<indexterm zone="plugin-tools"><primary>indentation</primary></indexterm>
+
+<para>
+Astyle is a plugin for formatting of sourcecode according to a specified set of rules.
+</para>
+</formalpara>
+</listitem>
+
+<listitem>
+<formalpara>
+<title>The <command>regexptest</command> Plugin</title>
+<indexterm zone="plugin-tools"><primary><command>regexptest</command></primary></indexterm>
+<indexterm zone="plugin-tools"><primary>debugging</primary><secondary>regular expressions</secondary></indexterm>
+<indexterm zone="plugin-tools"><primary>regular expressions</primary><secondary>debugging</secondary></indexterm>
+
+<para>
+Designing with regular expressions can be hard work. Often the first try at an
+expression matches too many strings. In particular, when working with a
+compiled language, the turnaround times when debugging a regular expression
+can be awkward. The regexptest plugin allows you to directly explore the
+changes in a regular expression. It is activated by choosing
+<menuchoice><guimenu>Tools</guimenu>
+<guimenuitem>Debug Regular Expression...</guimenuitem></menuchoice>.
+</para>
+</formalpara>
+
+<para>
+In the flavor group box, you can choose the flavor of the regular expression
+engine used. Currently supported is the flavor defined in the POSIX standard,
+which is used by the &grep; program, and the extended POSIX syntax used by the
+program &egrep;.
+</para>
+
+<para>
+When you enter an expression, you get immediate feedback about any syntax
+errors in it. By entering a text under <guilabel>Test string</guilabel>,
+you can see whether the expression matches this string. In particular, if
+your regular expression includes groups, such as <literal>([a-z])</literal>,
+the content of the matched subgroups will be shown in a list box.
+</para>
+</listitem>
+
+<!--
+<listitem>
+<formalpara>
+<title>The <command>konsole</command> Plugin</title>
+<indexterm zone="plugin-tools"><primary><command>konsole</command></primary></indexterm>
+<indexterm zone="plugin-tools"><primary>terminal</primary><secondary>embedded</secondary></indexterm>
+<para></para>
+</formalpara>
+</listitem>
+-->
+
+</itemizedlist>
+
+</appendix> <!-- plugin-tools -->
+
+<!-- ====================================================================== -->
diff --git a/doc/kdevelop/problem-report-all-todos.png b/doc/kdevelop/problem-report-all-todos.png
new file mode 100644
index 00000000..7b2d1b62
--- /dev/null
+++ b/doc/kdevelop/problem-report-all-todos.png
Binary files differ
diff --git a/doc/kdevelop/problem-report-marks.png b/doc/kdevelop/problem-report-marks.png
new file mode 100644
index 00000000..1e01ebdf
--- /dev/null
+++ b/doc/kdevelop/problem-report-marks.png
Binary files differ
diff --git a/doc/kdevelop/problem-report-todo.png b/doc/kdevelop/problem-report-todo.png
new file mode 100644
index 00000000..56ccbd54
--- /dev/null
+++ b/doc/kdevelop/problem-report-todo.png
Binary files differ
diff --git a/doc/kdevelop/project-advanced.docbook b/doc/kdevelop/project-advanced.docbook
new file mode 100644
index 00000000..d597e65e
--- /dev/null
+++ b/doc/kdevelop/project-advanced.docbook
@@ -0,0 +1,83 @@
+<chapter id="projects-advanced">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Advanced Project Management</title>
+
+<sect1 id="oldprojects">
+<title>Loading Projects</title>
+
+<sect2 id="loading-recent-project">
+<title>Loading a Recently Used Project</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="open-recent-project.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ How to open a recent project
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+
+</sect2> <!-- loading-recent-project -->
+
+<sect2 id="loading-project">
+<title>Loading an Existing Project</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- loading-project -->
+
+<sect2 id="converting-projects">
+<title>Converting Old KDevelop Project Files</title>
+
+<para>
+&kdevelop; allows you to open old KDevelop 2.x project files and convert them to &kdevelop; files. To do so go to <guimenuitem>Open Project...</guimenuitem> and select <guilabel>KDevelop 2 project files</guilabel> in the <guilabel>Filter:</guilabel>. Then select project file you want to open. The project gets converted to &kdevelop; and saved as a <guilabel>&kdevelop; project file</guilabel>.
+</para>
+
+</sect2> <!-- converting-projects -->
+
+<sect2 id="importing-projects">
+<title>Importing an Existing Project</title>
+
+<para>
+To import an existing directory in &kdevelop; select <guimenuitem>Import Existing Directory</guimenuitem>
+from the <guimenu>Project</guimenu> menu. You should see the Import Directory Wizard, as seen below:
+</para>
+
+<figure id="screenshot-importdirectory" float="1">
+<title>The Import Directory Dialog</title>
+<mediaobject>
+<imageobject><imagedata fileref="importdirectory.png"/></imageobject>
+</mediaobject>
+</figure>
+
+</sect2> <!-- importing-projects -->
+
+</sect1> <!-- oldprojects -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="project-options">
+<title>Tailoring the Project &mdash; Project Options</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- project-options -->
+
+</chapter> <!-- projects-advanced -->
diff --git a/doc/kdevelop/project-management.docbook b/doc/kdevelop/project-management.docbook
new file mode 100644
index 00000000..38a3ff8d
--- /dev/null
+++ b/doc/kdevelop/project-management.docbook
@@ -0,0 +1,751 @@
+<chapter id="project-management">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <author><firstname>Ian</firstname><surname>Wadham</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Building and Project Management</title>
+
+<para>
+This chapter deals only with compiled projects, such as C++, &Java; or
+Fortran projects. Projects for scripting languages like Python and
+PHP work very differently.
+</para>
+
+<para>
+You will find here information on:</para>
+<itemizedlist>
+ <listitem><para>
+ <link linkend="automake-manager-summary">Summary of &automanag;</link> containing an initial overall view of &automanag;,
+ </para></listitem>
+ <listitem><para>
+ <link linkend="automake-manager-operation">Automake Manager Operation</link> describing the basics of how to work with &automanag;,
+ </para></listitem>
+</itemizedlist>
+
+<sect1 id="automake-manager-summary">
+<title>Summary of &automanag;</title>
+
+<para>
+In the <link linkend="unixdev-buildsystems">Build systems</link> chapter we have given a rough overview of the build systems commonly in use on &UNIX; systems. In the following sections we will look at this in more detail.
+</para>
+<para>
+There is some confusion about how to name such things. &GNU; calls them <quote>build systems</quote> when it describes Automake, Autoconf and Libtool. QMake calls itself <quote>a tool to write Makefiles for different compilers and platforms</quote>. In &kde; often the term <quote>project management systems</quote> is used. We will use this term in a broader sense to describe the built-in environments in &kdevelop; which are used to organize and build your projects. In the context of this section, however, we will mostly talk about <quote>automated build systems</quote>.
+</para>
+
+<sect2 id="automake-manager-summary-buildsys">
+<title>The Need for an Automated Build System</title>
+
+<para>
+If you have a simple <quote>Hello World</quote> program, written in C, you can compile and link it using &gcc; <parameter>-o hello hello.c</parameter> and execute it using the command <command>./hello</command>, so you do not even need a <filename>Makefile</filename>.
+</para>
+<para>
+If you have a C application with several modules and header files and you are only going to run it on your own machine (&ie; it is an in-house application), you will only need a simple <filename>Makefile</filename>, which is fairly easy to write by hand (use <userinput>info make</userinput> to find out more).
+</para>
+<para>
+The complications begin when:
+</para>
+<itemizedlist>
+ <listitem><para>
+ Your source-code, documentation, graphics, sounds, translations, data files, &etc; are located in more than one directory,
+ </para></listitem>
+ <listitem><para>
+ You have a hierarchy of directories and sub-directories,
+ </para></listitem>
+ <listitem><para>
+ You are using libraries that are not part of the traditional &UNIX; set, such as the &Qt; Object Library or the &kde; Desktop libraries,
+ </para></listitem>
+ <listitem><para>
+ You are using a pre-processor to generate some of your source-code, such as Qt's MOC pre-compiler,
+ </para></listitem>
+ <listitem><para>
+ You aim to distribute your application worldwide, to people who may not have the same &UNIX;/&Linux; system, software and hardware as you,
+ </para></listitem>
+ <listitem><para>
+ You require an automated Install and Uninstall facility,
+ </para></listitem>
+ <listitem><para>
+ You aim to make your application part of the &kde; Desktop set.
+ </para></listitem>
+</itemizedlist>
+
+<para>
+If you have some or all of the above situations, you probably need a <emphasis>build system</emphasis>. In the example above we used &gcc; to compile and build the <quote>Hello World</quote> program, but not all C compilers are called <quote>&gcc;</quote>. So if you distribute your application to someone who is using some other C compiler, your Makefile must somehow use the name of that person's compiler, otherwise your application will fail to compile&mdash;and that is just simple example of what can go wrong.
+</para>
+<para>
+A build system will iron out these differences for you.
+</para>
+<itemizedlist>
+ <listitem><para>
+ It will check that the libraries you need are present on each receiving machine,
+ </para></listitem>
+ <listitem><para>
+ will automatically scan all your application directories for files to pre-process, compile or install and
+ </para></listitem>
+ <listitem><para>
+ will install the components of your application in the correct receiving directories, making sure that
+ </para></listitem>
+ <listitem><para>
+ the directories are created in the receiving machine as required.
+ </para></listitem>
+</itemizedlist>
+
+<para>
+In brief, a build system offers safe and secure methods for your application to be compiled and installed correctly on any receiving machine. As we have shown before in the <link linkend="makesystems">Project Management Systems</link> survey, &kdevelop; offers three automated build systems and the option of creating your own Makefile, in short (click on the project names to get more information):
+</para>
+<itemizedlist>
+ <listitem><para>
+ <link linkend="automake-project">Automake projects</link> which use the &GNU; standard development tools.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="qmake-project">QMake projects</link> which use the trolltech QMake project manager.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="ant-project">ANT projects</link> which use the Apache ANT project manager for &Java; development.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="custom-project">Custom projects</link> which require you to maintain your own <filename>Makefiles</filename>.
+ </para></listitem>
+</itemizedlist>
+
+<important>
+<para>
+One of these four alternatives must be chosen when you create a project and <emphasis>the choice is difficult to change later</emphasis>, so you should give it some thought before you start.
+</para>
+</important>
+
+</sect2> <!-- automake-manager-summary-buildsys -->
+
+<sect2 id="automake-references">
+<title>Tutorials on Autoconf/Automake/Libtool</title>
+<para>
+There are several tutorials available on the &GNU; Build System (<command>Autoconf</command>, <command>Automake</command> and <command>Libtool</command>) of which the &automanag; makes use.
+</para>
+<itemizedlist>
+ <listitem><para>A short <ulink url="http://www.kdevelop.org/index.html?filename=tutorial_autoconf.html">autoconf tutorial</ulink> written by Christopher W. Curtis available on the &kdevelop; home page. It concentrates on some basic steps to modify a <filename>Makefile</filename>.
+ </para></listitem>
+ <listitem><para>
+ A more detailed tutorial can be found in a greater set of tutorials on <ulink url="http://www.amath.washington.edu/~lf/tutorials/autoconf/toolsmanual_toc.html"><quote>Developing software with GNU</quote></ulink>.
+ </para></listitem>
+ <listitem><para>
+ And there is the famous <ulink url="http://sources.redhat.com/autobook"><quote>Goat Book</quote></ulink>, titled <quote>Autoconf, Automake, and Libtool</quote>. This is an easily readable, yet concise, introduction in all main aspects of the &GNU; Autotools.
+ </para></listitem>
+</itemizedlist>
+
+</sect2> <!-- automake-references -->
+
+<sect2 id="automake-manager-basics">
+<title>What does &automanag; Do?</title>
+
+<para>
+The <link linkend="applicationwizard">&appwizard;</link> will have set up some initial <filename>Makefile.am</filename> files when you created a <guilabel>New Project</guilabel> of a type that uses the &GNU; Build System, such as <menuchoice><guimenuitem>C++</guimenuitem> <guimenuitem>KDE</guimenuitem> <guimenuitem>Application framework</guimenuitem></menuchoice>. During development &automanag; creates any other <filename>Makefile.am</filename> files for projects that use the &GNU; Build System and maintains them all, &appwizard; and &automanag; created alike.
+</para>
+<para>
+There will be one <filename>Makefile.am</filename> file in each directory of your project that contains files to be compiled or installed. It will contain your specifications for compiling, building and installing files and a reference to any subdirectories that also have a <filename>Makefile.am</filename> file and possibly some files to compile, build and install.
+</para>
+
+<note><para>
+Your project's directories and source files may be structured to any depth, or you may prefer a flat project-structure with all subdirectories at the top level.
+</para></note>
+
+<para>
+The aim of the &GNU; Build System is to produce source-code file structures that can be compiled, built and installed on any &UNIX; or &Linux; system by using the simple commands:
+</para>
+
+<screen>
+./configure
+make
+make install # Usually as "root".
+</screen>
+
+<para>and can be uninstalled by the command <command>make uninstall</command> (usually as root).
+</para>
+
+<para>
+How does this work? Well <command>configure</command> is a script that
+
+<itemizedlist>
+ <listitem><para>
+ works out the details of whatever system it is in, such as what compiler and libraries to use and where they are located, and then
+ </para></listitem>
+ <listitem><para>
+ creates recursive <filename>Makefile</filename> files by filling in the substitutions in the corresponding <filename>Makefile.in</filename> files.
+ </para></listitem>
+</itemizedlist>
+</para>
+<para>
+The <filename>Makefile.in</filename> are <quote>input</quote> files&mdash;templates which provide basic information for the <filename>Makefile</filename>s to be produced from them by filling in some system dependent information. They are generated by the <command>Automake</command> utility from the <filename>Makefile.am</filename> files.
+</para>
+<para>
+The process of going from <filename>Makefile.am</filename> (<filename>.am</filename> denotes <quote>Automake</quote> template files) to <filename>Makefile</filename> files is handled automatically by the &kdevelop; &promanag;, using the <command>Autoconf</command> utility, <command>M4</command> macros and other arcana we need not go into here.
+</para>
+<para>
+So when <command>make</command> runs, it automatically picks up the correct pieces from the current environment, such as compilers and libraries. Similarly, <command>make install</command> puts your application components, such as executables, documentation and data files in the correct places for that environment.
+</para>
+
+<para>
+If you distribute your application as a <quote>tarball</quote> (a single compressed file that &kdevelop; can create for you), it will include the <filename>Makefile.in</filename> files and the <filename>configure</filename> script file, so the recipient can compile, build and install your application without having <command>Automake</command>, <command>Autoconf</command> or &kdevelop; on their machine. The <filename>Makefile.am</filename> files are also included, just in case the receiver needs to do any source-code modifications.
+</para>
+<note><para>
+The rules are rather different if you distribute via a web-based source-code repository such as &kde; &cvs;.
+</para></note>
+
+</sect2> <!-- automake-manager-basics -->
+
+<sect2 id="automake-manager-basics-summary">
+<title>Summary of What Automake Manager Does</title>
+
+<itemizedlist>
+ <listitem><para>
+ Generates <filename>Makefile.am</filename> files in subdirectories it knows as <quote>subprojects</quote>.
+ </para></listitem>
+ <listitem><para>
+ Updates <filename>Makefile.am</filename> files as the project structure changes.
+ </para></listitem>
+ <listitem><para>
+ Updates <filename>Makefile.am</filename> files as files are added to or removed from the project.
+ </para></listitem>
+ <listitem><para>
+ Accepts definitions of how the various files are to be built or installed and modifies the <filename>Makefile.am</filename> accordingly.
+ </para></listitem>
+ <listitem><para>
+ Accepts parameters used in building or installing (&eg; library names) and ensures that they are used in the required compilation and build steps.
+ </para></listitem>
+</itemizedlist>
+
+</sect2> <!-- automake-manager-basics-summary -->
+
+<sect2 id="automake-file-contents">
+<title>Contents of Automake Files</title>
+
+<para>
+A <filename>Makefile.am</filename> file has lines containing variable-names followed by an equals sign and a list of files or parameter values. The <quote>variables</quote> have two-part names, such as <varname>bin_PROGRAMS</varname>, <varname>myapp_SOURCES</varname> or <varname>kdelnk_DATA</varname>. The second part is called the <emphasis>primary</emphasis> and represents something from which to build or install. The first part is called the <emphasis>prefix</emphasis> and represents:
+</para>
+<itemizedlist>
+ <listitem><para>
+ A <emphasis>directory</emphasis> in which to do installation (&eg; <filename>bin</filename>),
+ </para></listitem>
+ <listitem><para>
+ A <emphasis>qualifier</emphasis> for the primary (&eg; <varname>myapp</varname> for <varname>SOURCES</varname>, indicating that the source files listed after <varname>myapp_SOURCES</varname> go into building <filename>myapp</filename>),
+ </para></listitem>
+ <listitem><para>
+ A special <emphasis>prefix</emphasis> <varname>noinst</varname> (short for <quote>no installation</quote>), usually used to list program header files (<filename>.h</filename>),
+ </para></listitem>
+ <listitem><para>
+ Or the special prefix <varname>EXTRA</varname>, for <emphasis>configuration-dependent</emphasis> stuff.
+ </para></listitem>
+</itemizedlist>
+
+<para>
+For more information on <command>Automake</command> and <filename>Makefile.am</filename> files, look up <userinput>info Automake</userinput>.
+</para>
+<para>
+Basically, &automanag; creates and updates the variable-names and lists of files or parameters. See the following example of a <filename>Makefile.am</filename> for a typical application, called <filename>myapp</filename>.
+</para>
+
+<screen>
+## Makefile.am for myapp
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = myapp
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# the library search path.
+myapp_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+
+# the libraries to link against.
+myapp_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT)
+
+# which sources should be compiled for myapp
+myapp_SOURCES = main.cpp myapp.cpp myappview.cpp
+
+# these are the headers for your project
+noinst_HEADERS = myapp.h myappview.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+KDE_ICON = myapp
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = myapp.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/myapp
+rc_DATA = myappui.rc
+
+AM_CXXFLAGS = -DMY_C++_PREPROCESSOR_OPTION
+</screen>
+
+<para>
+As you can see, many of the items on the right hand side are symbols of the form <varname>$(xxx)</varname>. These are <emphasis>environment variables</emphasis> which are defined in the actual &kde; environment and are substituted with real values when <command>./configure</command> generates the final <filename>Makefile</filename> files in the receiving machine.
+</para>
+
+<para>
+Also, sometime after you have started with &kdevelop;, it is a good idea to run the command <command>./configure --help</command>, which will show you the range of things you can change at build and installation time, such as for a test environment. In particular, the command:
+
+<screen>
+./configure --prefix=/where/you/wish
+</screen>
+will re-direct the entire installation to a directory structure of your choice, by changing the internal variable <varname>$(prefix)</varname> to value <filename class="directory">/where/you/wish</filename>.
+</para>
+
+</sect2> <!-- automake-file-contents -->
+
+</sect1> <!-- automake-manager-summary -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="automake-manager-operation">
+<title>Automake Manager Operation</title>
+
+<para>
+In this chapter you will find a basic description of the &automanag; elements and how to use them. This covers:
+<itemizedlist>
+ <listitem><para>
+ <link linkend="automake-manager-operation-window">The &automanag; Window</link> describes the basic structure of the &automanag; main window.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="automake-manager-operation-survey-window">The Overall View Window</link> describes the elements of the upper subwindow.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="automake-manager-operation-detail-window">The Detail View Window</link> describes the elements of the lower subwindow.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="automake-manager-operation-navigate">Navigating in the &automanag;</link> lists some basic operations you can perform in the &automanag;.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="automake-manager-operation-popups">Popup Menus in the &automanag;</link> describes the windows which will pop up when you select an action in the &automanag;.
+ </para></listitem>
+</itemizedlist>
+</para>
+
+<sect2 id="automake-manager-operation-window">
+<title>The &automanag; Window</title>
+
+<informaltable frame="none">
+<tgroup cols="2"><tbody><row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="automakemanager.png" format="PNG"/>
+ </imageobject>
+ </inlinemediaobject></entry>
+ <entry valign="top"><itemizedlist>
+ <listitem><para>
+ &automanag; runs in a split window. The top part is called the <emphasis>Overall View</emphasis> and the bottom part is called the <emphasis>Detail View</emphasis>. Between them is a narrow bar that can be dragged with the mouse to adjust the sizes of the views. In IDEAl mode you can also drag the side of the split window to change the width.
+ </para></listitem>
+ <listitem><para>
+ On top of each view there is a <emphasis>toolbar</emphasis>, the buttons in which will become activated when an element in this view is selected. This provides one way you can access the actions provided for that view element. The other are context menus which pop up on right mouse button click as will be discussed below.
+ </para></listitem>
+ <listitem><para>
+ In IDEAl mode there are two additional small buttons in the &automanag; window titlebar left hand side &ndash; a triangular shaped right arrow, and a dot button. The arrow button is used to <emphasis>close the window</emphasis>. The dot button on the other hand will <emphasis>keep the window open</emphasis> even if another &kdevelop; window has been selected. (Otherwise the &automanag; window will automatically close whenever another window gets the input focus.)
+ </para></listitem>
+ </itemizedlist></entry>
+</row></tbody></tgroup>
+</informaltable>
+
+</sect2> <!-- automake-manager-operation-window -->
+
+<sect2 id="automake-manager-operation-survey-window">
+<title>The Overall View Window</title>
+
+<para>
+The overall view window contains a tree-list of all the directories in your project that contain program files, documentation or data. Each such directory contains a <filename>Makefile.am</filename> file and is known in &automanag; as a <emphasis>subproject</emphasis>. There are three typical subprojects in a &kde;-based project as shown in the above illustration:
+</para>
+
+<itemizedlist>
+ <listitem><para>
+ <filename>src</filename> &ndash; source-code files for your application,
+ </para></listitem>
+ <listitem><para>
+ <filename>doc</filename> &ndash; your user manual or Handbook,
+ </para></listitem>
+ <listitem><para>
+ <filename>po</filename> &ndash; extracts of strings in your source-code files that require translation into other human languages (&eg; window titles, menu names, button labels, dialog box text and messages of various kinds).
+ </para></listitem>
+</itemizedlist>
+
+<para>
+Note that the <filename>doc</filename> subproject always has an <filename>en</filename> subproject, which you can see if you click on the <symbol>+</symbol> symbol next to the word <filename>doc</filename>. That is because the base language of all documentation in &kde; is United States English (en). If your application becomes part of &kde;, the &kde; translation teams may translate your documentation from United States English into other languages and the translations will go into other subprojects, such as <filename>de</filename> (German) or <filename>fr</filename> (French). The strings in the <filename>po</filename> subproject may also be translated and stored in other files in <filename>po</filename>, thus allowing your application to be operated by people who do not know English.
+</para>
+
+<note><para>
+The <filename>doc</filename> and <filename>po</filename> subprojects serve different purposes. <filename>doc</filename> contains <emphasis>documentation</emphasis> like a user manual, <filename>po</filename> contains translatable text strings of the <emphasis>user interface</emphasis> which is integrated in the source code of this application.
+</para></note>
+
+<para>
+The overall view window serves&mdash;amongst other things&mdash;as a navigation tool. If you select a subproject in the overall view window, the corresponding details will be shown in the detail view window.
+</para>
+
+</sect2> <!-- automake-manager-operation-survey-window -->
+
+<sect2 id="automake-manager-operation-detail-window">
+<title>The Detail View Window</title>
+
+<para>
+The detail view contains a tree-list of all the files in the subproject currently selected in the overall view as well as the compilation, build and installation rules for this subproject. Thus the two views together can give you access to all the components of your application and all the information on how to compile, build and install it.
+</para>
+
+<sect3>
+<title>Targets</title>
+
+<para>The tree-list in the detail view has two levels. The top level consists of so-called &automanag; <emphasis>targets</emphasis> and the next level contains lists of files that go to make up each target.
+</para>
+
+<para>
+This concept of an &automanag; target differs somewhat from what a <filename>Makefile</filename> target usually is. In short:</para>
+<itemizedlist>
+ <listitem><para>
+ The definition of how a set of files is to be compiled, built or installed is known as a <emphasis>target</emphasis> in &automanag;, but as a <emphasis>variable</emphasis> in <command>Automake</command> itself.
+ </para></listitem>
+ <listitem><para>
+ A <emphasis>target</emphasis> in <command>make</command> is often something quite different, being the parameter of a <command>make</command> command (&eg; <userinput>make install</userinput>, <userinput>make clean</userinput>).
+ </para>
+ <para>
+ However some <filename>Makefile.am</filename> variables do represent an underlying <emphasis>sub-target</emphasis> in <command>make</command>.
+ </para></listitem>
+</itemizedlist>
+
+</sect3>
+</sect2> <!-- automake-manager-operation-detail-window -->
+
+<sect2 id="automake-manager-operation-navigate">
+<title>Navigating in the &automanag;</title>
+
+<para>
+In both the overall and the detail view you can left-click on the <symbol>+</symbol> or <symbol>-</symbol> next to a subproject or target name to expand or contract the tree view. If you do that with a <emphasis>subproject</emphasis> in the overall view, it shows or hides the subprojects at the next level down (if any). If you do it with a <emphasis>target</emphasis> in the detail view, it shows or hides the list of files that go into that target.
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Opening a file for Edit</term>
+<listitem>
+<para>If you <emphasis>&LMB; click</emphasis> on a file name in the detail
+view, the corresponding file opens up in &kdevelop;'s editing window.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Activating the &automanag; Toolbar Buttons</term>
+<listitem>
+<para>
+If you <emphasis>&LMB; click</emphasis> on the name of a subproject in the
+overall view or target in the detail view, the name is highlighted and some
+toolbar buttons become active in the top part of that view.</para>
+
+<note>
+ <para>
+ It is recommended that you use the <emphasis>right mouse-button and popup menus</emphasis>, rather than the toolbar buttons, because it is then much easier to see and understand what you are doing.
+ </para>
+ <para>
+ Operations on subprojects and targets have far-reaching effects on the structure, compilation, building and installation of your application.
+ </para>
+</note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Selecting Actions/Popup Menus</term>
+<listitem>
+<para>
+If you <emphasis>&RMB; click</emphasis> on the name of a subproject, target or file, a menu pops up and you can then select actions to perform on the subproject, target or file, such as add a target to the subproject, add a file to a target or logically remove the selected file from its target.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2> <!-- automake-manager-operation-navigate -->
+
+<sect2 id="automake-manager-operation-popups">
+<title>Popup Menus in the &automanag;</title>
+
+<para>
+The following sections explain in short terms which operations the menus make available which will pop up on right mouse button clicks in the &automanag; window. They are meant for overall view only. You will find detailed descriptions of most operations in a later chapter.
+</para>
+<!-- ### add a link to this chapter when ready -->
+
+<sect3 id="automake-manager-operation-popups-file">
+<title>The Popup Menu for a File</title>
+
+<para>
+When you &RMB; click on a <emphasis>file name</emphasis> in the detail view the following menu will pop up allowing you to select one of several operations to be performed on that file. In the illustration below the <filename>hi-16app-myapp.png</filename> icon file was selected from the <guilabel>Icon data in myapp</guilabel> target of the <guilabel>myapp/src</guilabel> subproject.
+</para>
+
+<informaltable frame="none">
+<tgroup cols="2"><tbody><row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="automake-file-popup.png" format="PNG"/>
+ </imageobject>
+ </inlinemediaobject></entry>
+ <entry valign="bottom"><itemizedlist>
+ <listitem><para>
+ The main popup-menu item for a file is to <guimenuitem>Remove</guimenuitem> the file from its target (&ie; it will no longer be used to compile, build or install that target).
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>CVS</guimenuitem> item offers a variety of CVS operations on the file.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Open With</guimenuitem> item allows you to open the file with a variety of editors or with any application at all (&eg; you can open the icon file in our example with <application>KIcon</application>).
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Perforce</guimenuitem> item is used for similar operations as in CVS using the commercial <quote><application>Perforce</application></quote> version control system.
+ </para></listitem>
+ </itemizedlist></entry>
+</row></tbody></tgroup>
+</informaltable>
+
+</sect3> <!-- automake-manager-operation-popups-file -->
+
+<sect3 id="automake-manager-operation-popups-target">
+<title>The Popup Menu for a Target</title>
+
+<para>
+When you right-click on a <emphasis>target</emphasis> in the detail view the following menu will pop up allowing you to select one of several operations to be performed on it. In the illustration below the <guilabel>myapp (Program in bin)</guilabel> target of the <guilabel>myapp/src</guilabel> subproject was selected.
+</para>
+
+<informaltable frame="none">
+<tgroup cols="2"><tbody><row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="automake-target-popup.png" format="PNG"/>
+ </imageobject>
+ </inlinemediaobject></entry>
+ <entry valign="bottom"><itemizedlist>
+ <listitem><para>
+ The <guimenuitem>Options</guimenuitem> item for a target only applies to source code files. In the corresponding dialog box you can specify linker flags and paths on which to locate libraries and you can give a list of actual libraries to be linked in to your application.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Create New File</guimenuitem> item brings up a dialog in which you can set the file name and the type of file to be generated (from a drop-down list).
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Add Existing Files</guimenuitem> item brings up a dialog box in which you can add an already existing file to this target.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Remove</guimenuitem> item for a target allows you to logically remove the target and all its files from the project structure.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Make Target Active</guimenuitem> item only applies to targets containing source code files. New files will always be added to such an active target.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Build Target</guimenuitem> item calls all necessary compile and make operations to build the code for this target only.
+ </para></listitem>
+ </itemizedlist></entry>
+</row></tbody></tgroup>
+</informaltable>
+
+</sect3> <!-- automake-manager-operation-popups-target -->
+
+<sect3 id="automake-manager-operation-popups-subproject">
+<title>The Popup Menu for a Subproject</title>
+
+<para>
+When you &RMB; click on a <emphasis>subproject</emphasis> in the overall view window the following menu will pop up which allows you to make major changes to the structure of your project and the way it is compiled, built and installed. You can use it to expand or modify the basic project structure that the &appwizard; has created.
+</para>
+
+
+<informaltable frame="none">
+<tgroup cols="2"><tbody><row>
+ <entry><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="automake-subproject-popup.png" format="PNG"/>
+ </imageobject>
+ </inlinemediaobject></entry>
+ <entry valign="bottom"><itemizedlist>
+ <listitem><para>
+ The <guimenuitem>Options</guimenuitem> item for a subproject controls the way that the subproject will be compiled, built and installed. The dialog box that pops up has tabs for Compiler, Includes, Prefixes and Build Order.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Add Subproject</guimenuitem> item creates a new directory and skeleton Makefile.am file.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Add Target</guimenuitem> item pops up a dialog in which you can set the rules for compiling, building or installing a group of files within your subproject.
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Add Service</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Add Application</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Add Existing Subprojects</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Remove Subproject</guimenuitem> item in the popup menu for a subproject is the proper way to remove a subproject. It will adjust the <filename>Makefile.am</filename> files accordingly. You will also be offered the option to delete all the files (or links) in the corresponding subdirectory. Obviously, this feature should be used with caution.
+ </para></listitem>
+ <listitem><para>
+ The <guimenuitem>Build</guimenuitem> item calls all necessary compile and make operations to build the code for this subproject only.
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Force Reedit</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Clean</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Install</guimenuitem> (... to be written ...)
+ </para></listitem>
+ <listitem><para>
+ <guimenuitem>Install (as root user)</guimenuitem> (... to be written ...)
+ </para></listitem>
+ </itemizedlist></entry>
+</row></tbody></tgroup>
+</informaltable>
+
+</sect3> <!-- automake-manager-operation-popups-subproject -->
+
+</sect2> <!-- automake-manager-operation-popups -->
+
+</sect1> <!-- automake-manager-operation -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="autoproject">
+<title>Automake Projects</title>
+<indexterm zone="autoproject"><primary><command>autoproject</command></primary></indexterm>
+<indexterm zone="autoproject"><primary>&automake;</primary></indexterm>
+<indexterm zone="autoproject"><primary>&autoconf;</primary></indexterm>
+<indexterm zone="autoproject"><primary>&libtool;</primary></indexterm>
+
+<para>
+(... to be written ...)
+</para>
+
+
+<sect2 id="autoconf">
+<title>Autoconf</title>
+<indexterm zone="autoconf"><primary><filename>configure</filename> script</primary></indexterm>
+<indexterm zone="autoconf"><primary><filename>config.status</filename> script</primary></indexterm>
+<indexterm zone="autoconf"><primary><filename>Makefile.in</filename></primary></indexterm>
+<indexterm zone="autoconf"><primary><filename>config.h.in</filename></primary></indexterm>
+
+<para>
+<filename>Makefile.in</filename> into <filename>Makefile</filename>
+</para>
+
+<programlisting>
+prefix = @prefix@
+INSTALL = @INSTALL@
+build_triplet = @build@
+CXX = @CXX@
+</programlisting>
+
+<programlisting>
+prefix = /home/bernd/kde3
+INSTALL = /usr/bin/ginstall -c -p
+build_triplet = i686-pc-linux-gnu
+CXX = g++
+</programlisting>
+
+<para>
+<filename>config.h.in</filename> into <filename>config.h</filename>
+</para>
+
+<programlisting>
+/* Define if you have libz */
+#undef HAVE_LIBZ
+/* The size of a `int', as computed by sizeof. */
+#undef SIZEOF_INT
+</programlisting>
+
+<programlisting>
+/* Define if you have libz */
+#define HAVE_LIBZ 1
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+</programlisting>
+
+</sect2> <!-- autoconf -->
+
+
+<sect2 id="automake">
+<title>Automake</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!--automake -->
+
+
+<sect2 id="automake-manager">
+<title>&kdevelop;'s &automanag;</title>
+
+<figure id="screenshot-automake-manager" float="1">
+<title>A screenshot of the automake manager</title>
+<mediaobject>
+<imageobject><imagedata fileref="automake-manager.png"/></imageobject>
+</mediaobject>
+</figure>
+
+</sect2> <!-- automake-manager -->
+
+
+<sect2 id="automakelibrary">
+<title>Building and Installing Libraries</title>
+
+<para>
+<itemizedlist>
+<listitem><para>
+ -rpath
+</para></listitem>
+<listitem><para>
+ PIC
+</para></listitem>
+<listitem><para>
+ static
+</para></listitem>
+<listitem><para>
+ plugins: no-undefined
+</para></listitem>
+</itemizedlist>
+</para>
+
+</sect2> <!-- automakelibrary -->
+
+</sect1> <!-- autoproject -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="customproject">
+<title>Custom Makefiles and Build Scripts</title>
+<indexterm zone="customproject"><primary><filename>Makefile</filename></primary></indexterm>
+<indexterm zone="customproject"><primary><filename>build.xml</filename></primary></indexterm>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- customproject -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="compileroptions">
+<title>Compiler Options</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- compileroptions -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="makeoptions">
+<title>Make Options</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect1> <!-- makeoptions -->
+
+</chapter> <!-- project-management -->
diff --git a/doc/kdevelop/raw-project-warning.png b/doc/kdevelop/raw-project-warning.png
new file mode 100644
index 00000000..c9065815
--- /dev/null
+++ b/doc/kdevelop/raw-project-warning.png
Binary files differ
diff --git a/doc/kdevelop/run-button.png b/doc/kdevelop/run-button.png
new file mode 100644
index 00000000..51522e90
--- /dev/null
+++ b/doc/kdevelop/run-button.png
Binary files differ
diff --git a/doc/kdevelop/script_location.png b/doc/kdevelop/script_location.png
new file mode 100644
index 00000000..e5488024
--- /dev/null
+++ b/doc/kdevelop/script_location.png
Binary files differ
diff --git a/doc/kdevelop/select-user-interface-0.png b/doc/kdevelop/select-user-interface-0.png
new file mode 100644
index 00000000..c98faf71
--- /dev/null
+++ b/doc/kdevelop/select-user-interface-0.png
Binary files differ
diff --git a/doc/kdevelop/select-user-interface.png b/doc/kdevelop/select-user-interface.png
new file mode 100644
index 00000000..927ad411
--- /dev/null
+++ b/doc/kdevelop/select-user-interface.png
Binary files differ
diff --git a/doc/kdevelop/setup.docbook b/doc/kdevelop/setup.docbook
new file mode 100644
index 00000000..e5449a99
--- /dev/null
+++ b/doc/kdevelop/setup.docbook
@@ -0,0 +1,1990 @@
+<chapter id="setup">
+
+<chapterinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</chapterinfo>
+
+<title>Configuring &kdevelop;</title>
+
+<para>
+&kdevelop; is a very powerful and flexible IDE which offers many ways to tailor it to your needs. To start configuration select <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kdevelop;...</guimenuitem></menuchoice>. This will cause the configuration dialog to pop up consisting of a selection window to the left and the configuration dialog on the right hand side whose contents will vary upon the configuration item you did select.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-select.png" format="PNG"/>
+ </imageobject>
+<textobject>
+<phrase>Select a configuration item</phrase>
+</textobject>
+ <caption><para>
+ Select a configuration item
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+We will discuss these configurations in a different order, split up into the main topics of <link linkend="setup-general">General Configuration</link>, <link linkend="setup-docu">Configuring the Documentation</link>, and <link linkend="setup-advanced">Advanced Configuration</link> which makes for a more intuitive reading.
+</para>
+<para>
+If you want directly look up a certain configuration item use one of the following links.
+</para>
+
+<simplelist>
+ <member><link linkend="setup-main">General</link></member>
+ <member><link linkend="setup-ui">User Interface</link></member>
+ <member><link linkend="setup-templates">File Templates</link></member>
+<member><link linkend="setup-editor">Editor</link></member>
+ <member><link linkend="setup-abbrev">Abbreviations</link></member>
+ <member><link linkend="setup-scripting">Scripting</link></member>
+ <member><link linkend="setup-menu-standard">Tools Menu</link></member>
+ <member><link linkend="setup-menu-external">External Tools</link></member>
+ <member><link linkend="setup-docu">Documentation</link></member>
+ <member><link linkend="setup-snippets">Code Snippets</link></member>
+ <member><link linkend="setup-file-list">File List</link></member>
+ <member><link linkend="setup-file-selector">File Selector</link></member>
+ <member><link linkend="setup-cpp-generator">C++ Class generator</link></member>
+ <member><link linkend="setup-format">Formatting</link></member>
+ <member><link linkend="setup-cpp-parsing">C++ Parsing</link></member>
+</simplelist>
+
+<sect1 id="setup-general">
+<title>General Configuration</title>
+
+<para>
+General configuration concerns the more common tasks of tailoring &kdevelop; as there are:
+</para>
+<itemizedlist>
+ <listitem><para>
+ <link linkend="setup-main">General Setup</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend="setup-ui">Selecting the User Interface</link>
+ </para></listitem>
+ <listitem>
+ <itemizedlist>
+<title>Source Edit Tasks</title>
+ <listitem><para>
+ <link linkend="setup-editor">Selecting an Editor</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend="setup-format">Selecting a Source Format Style</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend="setup-snippets">Setting Up the Code Snippets Tool</link>
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para>
+ <link linkend="setup-file-selector">Configuring the File Selector</link>
+ </para></listitem>
+</itemizedlist>
+
+<sect2 id="setup-main">
+<title>General Setup</title>
+
+<para>
+The <guilabel>General</guilabel> configuration dialog allows you to define some basic &kdevelop; behaviour which seldom will change in everyday work. This concerns:
+</para>
+
+<variablelist>
+<varlistentry>
+<term>General project options such as</term>
+<listitem>
+ <itemizedlist>
+ <listitem><para>
+ defining a <link linkend="setup-main-projects">default parent directory</link> &kdevelop; shall use for new projects.
+ </para></listitem>
+ <listitem><para>
+ deciding whether you want &kdevelop; to <link linkend="setup-main-preload">automatically load</link> the project you last worked on.
+ </para></listitem>
+ </itemizedlist>
+ </listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Selecting a font for the most commonly used output view windows,
+namely:</term>
+<listitem>
+
+<itemizedlist>
+<listitem>
+<para>the <link linkend="setup-main-messages-font">Messages Output
+View</link> &kdevelop; uses to communicate &eg; compilation progresses,
+and</para>
+</listitem>
+<listitem>
+<para>the <!--<link linkend="setup-main-applications-font">-->Application Output
+View<!--</link>--> which will show error and state information concerning a running
+application.</para>
+</listitem>
+</itemizedlist>
+
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Some common behaviour concerning the displayed lines in the
+<guilabel>Messages Output View</guilabel> window, namely:</term>
+<listitem>
+ <itemizedlist>
+<listitem>
+<para>whether long lines will <link linkend="setup-main-wrap">wrap
+ around</link>, and </para>
+</listitem>
+<listitem>
+<para>if <link linkend="setup-main-navigation">directory entry and exit
+messages</link> issued by <command>make</command> will be shown.</para>
+</listitem>
+</itemizedlist>
+
+<para>The <link linkend="setup-main-compile">level of detail</link> of
+ messages concerning the compilation process shown in the
+ <guilabel>Messages Output View</guilabel> window.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-general.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ The general configuration dialog
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<variablelist>
+<varlistentry>
+<term id="setup-main-preload"><guilabel>Load last project on
+startup</guilabel></term>
+<listitem>
+<para>
+Mark this checkbox if you want to continue to work with the last project you worked on. This will cause &kdevelop; to automatically load this project on start-up. It will usually be shown in the state you left work so you can readily proceed.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-main-projects">
+<guilabel>Default projects directory:</guilabel></term>
+<listitem>
+<para>
+By default, &kdevelop; uses a common parent directory for all new
+projects. Enter the absolute path of this common directory in the box or
+select it from your directory structure. &kdevelop; will place the any new
+project here as a subdirectory.</para>
+<note><para>
+You may of course change the directory path of a new project at the time you set it up in the <link linkend="applicationwizard">&appwizard;</link>.
+</para></note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-main-messages-font"><guilabel>Window font:</guilabel></term>
+<listitem>
+<para>
+The <guilabel>Application Output View</guilabel> window is used to display error and state information from applications which are run from inside &kdevelop;. These are informations the applications usually sends to the console when run stand-alone. So you do not need to leave the IDE when testing the application you currently work on.
+</para>
+<para>
+To select a font suitable for the <guilabel>Messages Output View</guilabel> window click the <guilabel>Window Font</guilabel> button showing the currently selected font (it says <quote>Luxi Sans</quote> in the above illustration). The &kde; standard <guilabel>Select Font</guilabel> dialog will pop up from which you may select the font to be used.
+</para>
+<note><para>
+On first start-up, &kdevelop; initializes this font setting to the standard font for which your &kde; user has been configured. <emphasis>This setting is fixed</emphasis>, so if you alter <menuchoice><guimenuitem>Preferences</guimenuitem><guimenuitem>Appearances &amp; Themes</guimenuitem><guimenuitem>Fonts</guimenuitem></menuchoice> in the <guilabel>Control Center</guilabel>, this will not effect this &kdevelop; font selection. You will have to explicitely reselect the <guilabel>Messages Output View</guilabel> window font.
+</para></note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-main-compile"><guilabel>Compiler Output</guilabel></term>
+<listitem>
+<para>
+&kdevelop; preprocesses the messages the <guilabel>Messages Output View</guilabel> window receives during the build processes in order to filter superfluous information. You can control the level of detail &kdevelop; will display using the dropdown box in this field.
+</para>
+<variablelist>
+<varlistentry>
+<term><guilabel>Very Short</guilabel></term>
+<listitem><para>
+Displays only warnings, errors, and the filenames which are compiled.
+</para></listitem>
+</varlistentry>
+<varlistentry>
+<term><guilabel>Short</guilabel></term>
+<listitem><para>
+Suppresses all compiler flags and formats the output to be more readable.
+</para></listitem>
+</varlistentry>
+<varlistentry>
+<term><guilabel>Full</guilabel></term>
+<listitem><para>
+Displays all output messages unmodified.
+</para></listitem>
+</varlistentry>
+</variablelist>
+
+<tip><para>
+There is an alternative way to switch the compiler output detail. Just right click in the <guilabel>Messages Output View</guilabel> window and select the according detail level from the popup menu.
+</para></tip>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-main-wrap"><guilabel>Line wrapping</guilabel></term>
+<listitem>
+<para>
+By default, &kdevelop; will wrap long lines around in the <guilabel>Messages Output View</guilabel> window so that valuable information will not be easily overlooked. In some cases this will clutter long message lists. Remove the checkbox mark if you do not want the lines wrap around.
+</para>
+<tip><para>
+There is an alternative way to switch the line wrapping. Just &RMB; click in the <guilabel>Messages Output View</guilabel> window and mark/unmark the <guimenuitem>Line Wrapping</guimenuitem> entry in the menu which will pop up.
+</para></tip>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-main-navigation"><guilabel>Directory navigation
+messages</guilabel></term>
+<listitem>
+<para>
+The <command>make</command> tool usually will display messages like <quote>Entering directory</quote>, or <quote>Leaving directory</quote> when it switches the directories it currently works in. As this clutters the messages list in the <guilabel>Messages Output View</guilabel> window, &kdevelop; suppresses those messages by default. Mark the checkbox if you want to protocol which directories <command>make</command> worked in.
+</para>
+<note><para>
+Changes in this setting effect the processing of new messages only. Old directory navigation messages will be kept visible when you switch this feature off.
+</para></note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="ui-designer-integration"><guilabel>UI Designer Integration</guilabel></term>
+<listitem>
+<para>
+This let you choose the way you want <filename>.ui</filename> files to be displayed in &kdevelop;. &kdevelop; comes with its own UI designer called KDeveDesigner that can either be embedded or be run as a separate program. Qt Designer can also be used to edit <filename>.ui</filename> files.
+</para>
+<itemizedlist>
+ <listitem><para>
+ Use &kdevelop;'s embedded designer
+ </para><para>This uses &kdevelop; own designer embedded within &kdevelop;</para></listitem>
+ <listitem><para>
+ Run &kdevelop;'s designer as a separate application
+ </para><para>The KDevDesigner application will be run separately in its own window.</para>
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kdevdesigner.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ KDevDesigner in its own window
+ </para></caption>
+ </mediaobject>
+</screenshot>
+</listitem>
+ <listitem><para>
+Run Qt Designer
+ </para><para>Qt Designer from your Qt installation will be started externally whenever you click on a <filename>.ui</filename> file in &kdevelop;.</para></listitem>
+</itemizedlist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="terminal-emulation"><guilabel>Terminal Emulation</guilabel></term>
+<listitem>
+<para>
+You choose here which terminal you want to be integrated within KDevelop.
+</para>
+<itemizedlist>
+ <listitem><para>
+ Use &kde; setting
+ </para><para>This uses &kde; setting as set in &kcontrol; in <guilabel>&kde; component</guilabel> <guilabel>Component Chooser</guilabel> tab which sets the default terminal emulator used by all &kde; applications that need a terminal.</para></listitem>
+ <listitem><para>
+ Other
+ </para><para>Choose some other terminal different from the default one.</para>
+</listitem>
+</itemizedlist>
+</listitem>
+</varlistentry>
+
+</variablelist>
+
+</sect2> <!-- setup-main -->
+
+<sect2 id="setup-ui">
+<title>Selecting the User Interface</title>
+
+<indexterm zone="setup-ui">
+ <primary>user interface</primary>
+ <secondary>switch modes</secondary></indexterm>
+<indexterm zone="setup-ui">
+ <primary>switch UI modes</primary></indexterm>
+
+<para>
+As already said in the <link linkend="uimodes-survey">Available User Interface Modes</link> chapter there are five different ways the &kdevelop; work area may be set up, namely:
+</para>
+<itemizedlist>
+ <listitem><para>
+ <link linkend="ideal-desc">Simplified IDEAl window mode</link>
+ </para><para>This is a simplified version of the IDEA user interface. It is designed to be simple and clean. It also does not uses docked toolviews.</para></listitem>
+ <listitem><para>
+ <link linkend="ideal-desc">IDEAl window mode</link>
+ </para><para>This is a clone of the IDEA user interface, similar to the Tabbed pages mode and is default.</para></listitem>
+ <listitem><para>
+ <link linkend="mdi-desc">Childframe window mode</link>
+ </para><para>All tool views are initially docked to the mainframe.
+Editor and browser views will live like toplevel windows within a view area of the mainframe.
+A typical example of this user interface mode is MS Visual Studio 6.0.</para></listitem>
+ <listitem><para>
+ <link linkend="tabbed-desc">Tabbed pages mode</link>
+ </para><para>All tool views are initially docked to the mainframe.
+Editor and browser views will be stacked in a tab window.
+A typical example of this user interface mode is KDEStudio, our friend C++-IDE in the world of KDE.</para></listitem>
+ <listitem><para>
+ <link linkend="toplevel-desc">Toplevel window mode</link>
+ </para><para>All editor, browser and tool views will be toplevel windows (directly on desktop).
+The main widget contains the menu, toolbars and statusbar only.
+A typical example of this user interface mode is Borland Delphi 6.0.</para></listitem>
+</itemizedlist>
+
+<para>
+To switch the user interface mode select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Configure &kdevelop;...</guimenuitem> </menuchoice> from the menus. The <guilabel>Customize KDevelop</guilabel> dialog will pop up, where you have to select <guilabel>User Interface</guilabel> in the left hand tree. This will display the following settings dialog to the right.</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="select-user-interface-0.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Select a user interface mode</phrase></textobject>
+ <caption><para>
+ Select a user interface mode
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Select the radio button of the user interface mode you want to switch to, then click <guibutton>OK</guibutton>.
+</para>
+
+<note><para>
+Do not forget to restart &kdevelop; in order to let any of these selections take effect.
+</para></note>
+
+<para>
+When you selected either the <guilabel>Simplified IDEAl window mode</guilabel> or the <guilabel>IDEAl window mode</guilabel> or the <guilabel>Tabbed pages mode</guilabel> two more configuration sections will become available: <link linkend="setup-ui-tabs">Use Tabs</link> and <link linkend="setup-ui-hover">Use Close On Hover</link>. These allow to configure under which circumstances tabs will be shown on top of the document windows and whether you may close the document by a click on the tab icon.
+</para>
+
+<para>
+In <guilabel>Simplified IDEAl window mode</guilabel> and in <guilabel>IDEAl window mode</guilabel> only yet another configuration section will be available, <link linkend="setup-ui-toolview">Toolview Tab Layout</link> which effectively allows to select between different sizes of the toolview tabs which surround the main working area in this mode.
+</para>
+
+<variablelist>
+<varlistentry>
+<term id="setup-ui-tabs">Configuring the Documents Tab Bar Display</term>
+<listitem>
+<para>
+In the IDEAl and tabbed pages modes there will be named tabs on top of the document windows by default, so you can easily select different documents with a &LMB; click. If you prefer to provide more space for the document windows in the &kdevelop; main work area, you may change to another behaviour in the <guilabel>Use Tabs</guilabel> configuration section.
+</para>
+
+<variablelist>
+<varlistentry>
+ <term><guilabel>Always</guilabel></term>
+ <listitem><para>
+ This is the default &mdash; show a tab comprising an icon and the document name on top of any document window in the &kdevelop; main area display.
+ </para></listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>When more than one</guilabel></term>
+ <listitem><para>
+ Do not show a tab when only one document is displayed. If there is more than one document, however, &kdevelop; will display an according tab bar as in the <guilabel>Always</guilabel> selection above. You may want to select this mode if you work on a single document most of the time as this provides more vertical space.
+ </para></listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>Never</guilabel></term>
+ <listitem><para>
+ Never show any document selection tab. You may prefer this mode if you seldom use the mouse to switch between documents. It provides more vertical space for all document windows. To select another the document window or to close any, use the &kdevelop; <guimenu>Window</guimenu> menu.
+ </para></listitem>
+</varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-ui-hover">Setting Up to Close a Document by a Click On Its
+Tab</term>
+<listitem>
+<para>
+When you configured &kdevelop; to display the documents tab bar, either always or when more than one document is displayed in the main work area, you may add more functionality to the tabs beyond their document selection capability. Use the <guilabel>Use Close On Hover</guilabel> coniguration section for this.
+</para>
+
+<variablelist>
+<varlistentry>
+ <term><guilabel>No</guilabel></term>
+ <listitem><para>
+ This is standard behaviour. No extra functionality is added to the tabs. They may be used only to select document windows on &LMB; clicks.
+ </para></listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>Yes</guilabel></term>
+ <listitem><para>
+ When you selected this radio button, &kdevelop; will allow to close a document window by a &LMB; click. Use the mouse to point at the small icon on the on the left tab border. It will change to a close symbol. Now click with the &LMB; on this changed symbol and &kdevelop; will close the according document window.
+ </para></listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>Yes, Delayed</guilabel></term>
+ <listitem><para>
+ After selecting this radio button, &kdevelop; will allow to close a document window as shown in the <guilabel>Yes</guilabel> case above. The icon will not change instantly, however, but there will be a short delay before the close icon shows up.
+ </para></listitem>
+</varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-ui-toolview">Configuring the Toolview Tab Layout</term>
+<listitem>
+<para>
+The <guilabel>Toolview Tab Layout</guilabel> configuration section will be available in IDEAl mode only. Use these radio buttons to set up the look of the toolview tabs which surround the main working area in this mode.
+</para>
+
+<variablelist>
+<varlistentry>
+ <term><guilabel>Icons</guilabel></term>
+ <listitem>
+ <para>
+ Each tab will show an icon only. If the associated toolview is displayed, the tab will open and a descriptive text for this toolview be shown. You may want to use this mode if you work on a monitor with limited resolution.
+ </para>
+ <para>
+ The icons are not very descriptive, however. If you want to find out which toolview is assigned to a given tab, point at it with the mouse and wait a second. A short tooltip will then pop up with the toolview name.
+ </para>
+ </listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>Text</guilabel></term>
+ <listitem><para>
+ This is the default toolview tab display mode. Each tab displays the name of its associated toolwiew.
+ </para></listitem>
+</varlistentry>
+<varlistentry>
+ <term><guilabel>Text and Icons</guilabel></term>
+ <listitem><para>
+ If the standard text toolview display looks too flat to you and you are working on a high-resolution monitor you may want to select this radio button. It will cause the name of the associated toolview be displayed on each tab plus an icon to the left of it, making the tabs easier to distinguish. See the <link linkend="folded-toolview-tabs">Folded Toolview Tabs</link> illustration below for an example.
+ </para></listitem>
+</varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Folded Toolview Tabs</term>
+<listitem>
+<para>
+If you selected the IDEAl mode toolview tabs to display texts (with or without accompanying icons) you need not worry about them being hidden behind some toolview window. If one of the bottom toolview windows occupies more space than is available to display all (vertical) tabs, they will fold around as this illustration shows:
+</para>
+
+<screenshot>
+ <mediaobject id="folded-toolview-tabs">
+ <imageobject>
+ <imagedata fileref="folded-tabs.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Toolview tabs fold to not be hidden behind another view window</phrase></textobject>
+ <caption><para>
+ Toolview tabs fold to not be hidden behind another view window
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<note><para>
+The active toolview window must be shown fixed (non-overlap mode), sharing the work area with the other windows, to force such tab folding. Press the small square in the window border to accomplish this as shown in the example.
+</para></note>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2> <!-- setup-ui -->
+
+<sect2 id="setup-templates">
+<title>File Templates</title>
+<!--TODO fill--><para></para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-file-templates.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Configure File Templates</phrase></textobject>
+ <caption><para>
+ Configure File Templates
+ </para></caption>
+ </mediaobject>
+</screenshot>
+</sect2> <!-- setup-templates -->
+
+<sect2 id="setup-editor">
+<title>Selecting an Editor</title>
+
+<para>&kdevelop; allows you to select your favorite text editor tool. Mark the <guilabel>Editor</guilabel> entry in the left hand side selections tree of the <guilabel>Configure KDevelop</guilabel> window. The following dialog will be displayed to the right.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-editor.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Select an editor</phrase></textobject>
+ <caption><para>
+ Select an editor
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+To select a new editor, click on the arrow on the drop down list field. Depending on the editor parts interfaces your &kde; version has compiled in you will be provided with a list of editors you may select from (see the <link linkend="setup-editor-kparts">Important</link> note below for this). Click on the editor of your liking and click <guilabel>OK</guilabel>. Currently there are two possibilities:
+</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Embedded Advanced Text Editor</guilabel></term>
+ <listitem><para>
+ This is the &kde; standard <application>Kate</application> editor part.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Qt Designer Based Text Editor</guilabel></term>
+ <listitem><para>
+ This is the editor &Qt; provides in its <application>Designer</application> component.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<para>
+These editor interfaces are fully integrated in the &kdevelop; IDE concept. Particularly the possibility to jump to the offending source code line by just clicking on an error message in the <guilabel>Messages Output View</guilabel> window has been provided.
+</para>
+
+<note><para>
+Changing the editor will not effect already open files. There are two possibilities to proceed. Either close all open text windows and reopen them one by one. Or simply close the whole project and reopen it again. The windows will then automatically open under the new text editor interface.
+</para></note>
+
+<important id="setup-editor-kparts"><para>
+KDevelop lets you use editor interfaces which have registered with &kde; and that provide a KatePart interface. If you miss one one of the selections shown above check your &kde; installation if the corresponding KPart was correctly installed.
+</para></important>
+
+<para>What to do if the file has been changed externally:</para>
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Do nothing</guilabel></term>
+ <listitem><para>
+ The file will be marked as externally changed and the user will be asked to verify any attempt to overwrite it.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Alert the user</guilabel></term>
+ <listitem><para>
+ A dialog will alert the user that a file has changed and offer the user to reload the file.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Automatically reload the file if safe, alert the user if not</guilabel></term>
+ <listitem><para>
+ Any files that are not modified in memory are reloaded and an alert is shown for any conflicts.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</sect2> <!-- setup-editor -->
+
+<sect2 id="setup-abbrev">
+<title>Abbreviations for the Word Completion</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- setup-abbrev -->
+
+<sect2 id="setup-scripting">
+<title>Scripting</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- setup-scripting -->
+
+<sect2 id="setup-menu-standard">
+<title>Adding &kde; Standard Applications to the Tools Menu</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- setup-menu-standard Tools Menu-->
+
+<sect2 id="setup-menu-external">
+<title>Adding External Applications to Menus</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect3 id="setup-menu-external-tools">
+<title>Adding to the Tools Menu</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect3> <!-- setup-menu-external-tools -->
+
+<sect3 id="setup-menu-external-filecontext">
+<title>Adding to the File Context Menu</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect3> <!-- setup-menu-external-filecontext -->
+
+<sect3 id="setup-menu-external-dircontext">
+<title>Adding to the Directory Context Menu</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect3> <!-- setup-menu-external-dircontext -->
+
+</sect2> <!-- setup-menu-external -->
+
+<sect2 id="setup-format">
+<title>Selecting a Source Format Style</title>
+
+<para>
+&kdevelop; automatically formats a source text in a predefined style. This style is highly configurable.
+</para>
+
+<note><para>
+The reformat source feature is currently available for C, C++, and &Java; only. Especially you cannot use it for scripting languages like &eg; PHP. This is because &kdevelop; uses the <ulink url="http://astyle.sourceforge.net/">astyle</ulink> application to implement this feature.
+</para></note>
+
+<para>
+To set up a specific format style, select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Configure &kdevelop;..</guimenuitem> </menuchoice> from the menubar. The <guilabel>Customize KDevelop</guilabel> dialog will pop up, where you have to select <guilabel>Source Formatter</guilabel> in the left hand tree. This will display a series of three settings dialog tabs to the right, namely a <link linkend="setup-format-general">General Formatting Setup</link>, a <link linkend="setup-format-indent">Indentation Style Setup</link>, and a <link linkend="setup-format-other">Other Formatting Setup</link>.
+</para>
+
+<tip><para>
+Any style changes apply to newly entered text only. If you want to change the formatting style of an already existing source text you will have to explicitely use the <menuchoice><guimenu>Edit</guimenu><guimenuitem>Reformat Source</guimenuitem></menuchoice> command.
+</para></tip>
+
+<note><para>
+The exact outcome of these style formatting definitions depends on the <link linkend="setup-editor">editor</link> you use. Currently, most settings are tailored to the Kate editor part (the <quote>Embedded Advanced Text Editor</quote>). Some other editors (&eg; the Qt editor) may rely on their own configuration settings. You will have to experiment in this case to find out the exact effects of the style settings provided here.
+</para></note>
+
+<warning><para>
+There may be incompatibilities between the configuration style settings provided here and the editor you use up to the extent that in extreme cases it even might destroy your files. Make sure you have a backup of your source files before you try out these settings with an none KDE standard editor.
+</para></warning>
+
+<sect3 id="setup-format-general">
+<title>General Formatting Setup</title>
+
+<para>
+The <guilabel>General</guilabel> tab of the <guilabel>Source Formatter</guilabel> dialog allows you to select one out of five predefined source format styles.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SF-general.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Source format style general setup</phrase></textobject>
+ <caption><para>
+ Source format style general setup
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+A formatted source example will be displayed in the field to the right. If none of the predefined styles is to your liking, you may click the top <guilabel>User defined</guilabel> radio button and define your own source formatting style preferences on the other two tabs which will become available then.
+</para>
+
+<note><para>
+Currently only the predefined source formatting styles will be demonstrated by an example text. If you decide to define your own style, no example display will be available. You have to experiment on an actual source text to tailor the settings to your liking.
+</para></note>
+
+</sect3> <!-- setup-format-general -->
+
+<sect3 id="setup-format-indent">
+<title>Indentation Style Setup</title>
+
+<para>
+Proper indentation is the main means to enhance readability of a source text. I you selected the <guilabel>Indentation</guilabel> tab of the <guilabel>Source Formatter</guilabel> dialog you will be presented with a series of indentation formatting choices grouped into three boxes as following.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SF-indent.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Source format indentation style setup</phrase></textobject>
+ <caption><para>
+ Source format indentation style setup
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<variablelist>
+<varlistentry>
+<term>Default Settings</term>
+<listitem>
+<para>The preset format choices will cause the source text to resemble the
+ANSI formatting style:</para>
+
+<screen>
+namespace foospace
+{
+ int Foo()
+ {
+ if (isBar)
+ {
+ bar();
+ return 1;
+ }
+ else
+ return 0;
+ }
+}
+</screen>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-format-indent-filling">Defining Indentation Width and Characters</term>
+<listitem>
+<para>The radio buttons grouped in the <guilabel>Filling</guilabel> group
+define how indents in the source text will be drawn.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Use tabs</guilabel></term>
+ <listitem>
+ <para>
+ This will cause the editor to insert a tab character for each
+indentation level. The tab width is predefined in the editor settings (8 or
+4 character columns usually). Use <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure Editor...</guimenuitem></menuchoice> to redefine it.
+ </para>
+ <note><para>
+ The actual tab width definition procedure depends on the editor you selected in the <link linkend="setup-editor">Selecting an Editor</link> configuration step. You will have to look up the corresponding editor help to find out.
+ </para></note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Use spaces</guilabel></term>
+ <listitem><para>
+ If you select this radio button, the editor will enter a number of spaces for each indentation level. Change the number from the default 2 to the indentation width you prefer.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Indented Entities</term>
+<listitem>
+<para>This defines which of the (C/C++) entities will be formatted with an
+extra indent beyond the current indentation level.</para>
+
+<para>By default only <guilabel>namespaces</guilabel> and
+<guilabel>labels</guilabel> will be extra indented. You may want to
+experiment with various settings to tailor those extra indents to your
+liking.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Continuation</term>
+<listitem>
+<para>
+The settings grouped here apply to those cases where the source formatter automatically wraps around long source lines. It takes two special cases in account, namely that in deeply nested indents there should remain enough room for the source and that conditionals should get extra indent levels on continuation to make them stand out properly.
+</para>
+
+<note><para>
+This applies to <emphasis>static word wrap cases</emphasis> only where a fixed maximum line width is used in the source text. If you set up your editor to dynamically wrap around long lines in display only (which is possible in the &kate; editor part) the effects of these settings usually will not show.
+</para></note>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Maximum in statement</guilabel></term>
+ <listitem>
+ <para>
+ This setting limits the maximum possible indentation for the continuation lines so that enough space will remain to keep the text readable. No continuation line will ever be indented beyond the number of columns you selected in this field.
+ </para>
+ <para>
+ The default is set to 40 character columns (half a standard 80 column page). You may want to increase this value to account for wider paper (e.g if you use landscape printing for your sources). Or decrease the value accordingly to take larger margin settings of your printouts into account.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Minimum in conditional</guilabel></term>
+ <listitem>
+ <para>
+ Conditionals or source following &eg; an assignment operator should usually get an extra indent on continuation lines in order to keep the text readable. The amount of this extra indent is defined here.
+ </para>
+ <para>
+ The default is set to <quote>Twice current</quote> which means that continued conditionals will get an extra indent level of the standard indentation size you selected in the <link linkend="setup-format-indent-filling">Filling</link> group. You may change this extra indent to another fixed width (including zero) using the arrows or by entering the value directly.
+ </para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect3> <!-- setup-format-indent -->
+
+<sect3 id="setup-format-other">
+<title>Other Formatting Setup</title>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SF-other.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Other source format style settings</phrase></textobject>
+ <caption><para>
+ Other source format style settings
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<variablelist>
+<varlistentry>
+<term>Controlling the position of braces</term>
+<listitem>
+<para>The radio buttons the (somewhat misnamed)
+<guilabel>Brackets</guilabel> group control the position of block delimiting
+braces in a (C/C++) source text. There are three possibilities from which
+you can select.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Break</guilabel></term>
+ <listitem>
+ <para>This inserts a line break before each opening brace. Both delimiting braces of any block will be put at the same indentation level as the block head statement.</para>
+
+<screen>
+namespace foospace
+{
+ int Foo()
+ {
+ if (isBar)
+ {
+ bar();
+ return 1;
+ }
+ else
+ return 0;
+ }
+}
+</screen>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Attach</guilabel></term>
+ <listitem>
+ <para>
+ This will keep the opening brace of a block in line with the block head statement. Closing braces will be on the same indentation level as the block head statement. The <token>else</token> of an <token>if</token> statement will be kept in line with the closing brace of the preceding block.
+ </para>
+<screen>
+namespace foospace {
+ int Foo() {
+ if (isBar) {
+ bar();
+ return 1;
+ } else
+ return 0;
+ }
+}
+</screen>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Linux Style</guilabel></term>
+ <listitem>
+ <para>
+ This is a compromise of the above listed styles. Functional block delimiting braces will be put on extra lines. Braces opening a block in a conditional or loop statement will be kept in line.
+ </para>
+<screen>
+namespace foospace
+{
+ int Foo()
+ {
+ if (isBar) {
+ bar();
+ return 1;
+ } else
+ return 0;
+ }
+}
+</screen>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Controlling Extra Spaces</term>
+<listitem>
+<para>
+By default &kdevelop; does minimize the use of spaces in source texts.
+</para>
+
+
+<screen>
+if (isBar(fooArg)==barValue)
+</screen>
+
+<para>You may enhance readability if you force the source formatter to
+insert extra spaces in special positions.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Add spaces around parentheses</guilabel></term>
+ <listitem>
+ <para>In fact what is meant is to add spaces around the text put in parentheses. This enhances the readabilitiy of function arguments and conditionals.</para>
+<screen>
+if ( isBar( fooArg )==barValue )
+</screen>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Add spaces around operators</guilabel></term>
+ <listitem>
+ <para>This will put spaces around assignment and comparison operators to enhance the readability.</para>
+<screen>
+if (isBar(fooArg) == barValue)
+</screen>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Controlling the formatting of one-line constructs</term>
+<listitem>
+<para>There are a few cases where you don't want the source formatter to
+split a long line apart. For C/C++ code this can be controlled here.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Keep one-line statements</guilabel></term>
+ <listitem><para>
+ This keeps single line statements together in some situations even if they exceed a fixed maximum line length.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Keep one-line blocks</guilabel></term>
+ <listitem><para>
+ This keeps single line blocks together in some situations even if they exceed a fixed maximum line length.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+</variablelist>
+
+
+</sect3> <!-- setup-format-other -->
+
+</sect2> <!-- setup-format -->
+
+<sect2 id="setup-snippets">
+<title>Setting Up the Code Snippets Tool</title>
+
+<para>
+When editing in &kdevelop; you can store often used parts of code as <link linkend="editing-snippets">Code Snippets</link>. To configure the capabilities of the code snippets part select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Configure &kdevelop;..</guimenuitem> </menuchoice> from the menubar. The <guilabel>Customize KDevelop</guilabel> dialog will pop up, where you have to select <guilabel>Code Snippets</guilabel> in the left hand tree. This will show the following dialog in the right hand side.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-snippets.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Configuring the code snippets tool</phrase></textobject>
+ <caption><para>
+ Configuring the Code Snippets tool
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<variablelist>
+<varlistentry>
+<term>Activate Snippet Preview</term>
+<listitem>
+<para>Mark the <guilabel>Show snippet's text in tooltip</guilabel> checkbox
+if you want to view the stored text in a tooltip window whenever you keep
+the mouse cursor over the title of that snippet.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Working with Snippet Variables</term>
+<listitem>
+<para>The <guilabel>Code Snippets</guilabel> tool allows for a variable text
+in predefined places any time you insert a snippet into a file. To
+accomplish this <guilabel>Code Snippets</guilabel> provides its own
+variables' mechanism. You can set up it's behaviour in the
+<guilabel>Variables</guilabel> group.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Delimiter</guilabel></term>
+ <listitem><para>
+ The <guilabel>Code Snippets</guilabel> tool distinguishes variables in the text by surrounding the variable name with special delimiter symbols. To use your own delimiter symbol, change the predefined <guilabel>$</guilabel> character in the <guilabel>Delimiter</guilabel> field.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Input method for variables</guilabel></term>
+ <listitem><itemizedlist>
+ <listitem><para>
+ <guilabel>Single dialog for each variable within a snippet</guilabel> &ndash; will in turn pop up a separate dialog for each variable which the tool finds when inserting the selected code snippet.
+ </para></listitem>
+ <listitem><para>
+ <guilabel>One dialog for all variables within a snippet</guilabel> &ndash; will pop up a common dialog where the user has to fill in the values of all variables before the snippet will be inserted
+ </para></listitem>
+ </itemizedlist></listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2> <!-- setup-snippets -->
+
+<sect2 id="setup-file-list">
+<title>File List</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- setup-file-list-->
+
+<sect2 id="setup-file-selector">
+<title>Configuring the File Selector</title>
+
+<para>
+&kdevelop; provides a <guilabel>File Selector</guilabel> plugin which, when
+loaded at start-up, allows to navigate to any file or directory in the
+system.
+</para>
+
+<screenshot id="setup-fileselector-image">
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="file-selector.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>The file selector in IDEAl mode</phrase></textobject>
+ <caption><para>
+ The file selector (IDEAl mode)
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>The behaviour of the <guilabel>File Selector</guilabel> can be highly
+configured. Select <menuchoice> <guimenu>Settings</guimenu>
+<guimenuitem>Configure &kdevelop;..</guimenuitem> </menuchoice> from the
+menubar. The <guilabel>Customize KDevelop</guilabel> dialog will pop up,
+where you have to select <guilabel>File Selector</guilabel> in the left hand
+tree. This will show the following dialog in the right hand side.</para>
+
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-file-selector.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Configuring the file selector</phrase></textobject>
+ <caption><para>
+ Configuring the file selector
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<variablelist>
+<varlistentry>
+<term>Configuring the Toolbar</term>
+<listitem>
+<para>There is a toolbar on top of the <guilabel>File Selector</guilabel>
+which can be configured as usual in the <guilabel>Toolbar</guilabel>
+group.</para>
+
+<procedure id="setup-fileselector-add-action">
+ <title>Add an Action to the Toolbar</title>
+ <step>
+ <para>
+ Select an item in the right hand <guilabel>Selected actions</guilabel> list after which the new action should be inserted.
+ </para>
+ </step>
+ <step>
+ <para>
+ Select the action to be inserted in the left hand <guilabel>Available actions</guilabel> list.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the right (upper) arrow between both lists.
+ </para>
+ <para>The action will be removed from the <guilabel>Available actions</guilabel> list and inserted into the <guilabel>Selected actions</guilabel> list below the selected item.
+ </para>
+ </step>
+</procedure>
+
+<procedure>
+ <title>Remove an Action from the Toolbar</title>
+ <step>
+ <para>
+ Select the item to be removed in the right hand <guilabel>Selected actions</guilabel> list.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the left (lower) arrow between both lists.
+ </para>
+ <para>The selected item will be removed from the <guilabel>Selected actions</guilabel> list and put back into the <guilabel>Available actions</guilabel> list.
+ </para>
+ </step>
+</procedure>
+
+<procedure>
+ <title>Reorder the Actions on the Toolbar</title>
+ <step>
+ <para>
+ Select the action to be moved in the right hand <guilabel>Selected actions</guilabel> list.
+ </para>
+ </step>
+ <step>
+ <para>
+ Click the up or down arrow to the right of this list.
+ </para>
+ <para>The selected item will be moved up or down the <guilabel>Selected actions</guilabel> list.
+ </para>
+ </step>
+</procedure>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term id="setup-fileselector-autosync">Defining When the Contents Should
+Change</term>
+<listitem>
+<para>
+Updating the contents in the <guilabel>File Selector</guilabel> window takes time and resources, esp. when changing to another directory. Therefore <guilabel>File Selector</guilabel> is set up by default in such a way that its contents change only on demand, &ie; when you select another directory or when you explicitely want to refresh its contents.
+</para>
+
+<note><para>
+Click the <guilabel>Reload</guilabel> button in the toolbar to update the contents of the <guilabel>File Selector</guilabel>. This toolbar button is not available by default, however. You must <link linkend="setup-fileselector-add-action">insert it there</link> first.
+</para></note>
+
+<para>
+You can configure the <guilabel>File Selector</guilabel> to immediately reflect certain changes in your work. The settings in the <guilabel>Auto Synchronization</guilabel> group of the configuration dialog are responsible for this.
+</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>When a document becomes active</guilabel></term>
+ <listitem><para>
+ If you select this checkbox, the contents in the <guilabel>File Selector</guilabel> window will be updated whenever you go to another already open document, &eg; when you click on the tab of the according edit window in IDEAl mode. If necessary the <guilabel>File Selector</guilabel> will switch to the directory this file belongs to and update the display to show the actual contents in there.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>When a document is opened</guilabel></term>
+ <listitem><para>
+ If you select this checkbox, the contents in the <guilabel>File Selector</guilabel> window will be updated whenever a document will be opened, &eg; by the <menuchoice><guimenu>File</guimenu><guimenuitem>Open</guimenuitem></menuchoice> menu. If necessary the <guilabel>File Selector</guilabel> will switch to the directory this file belongs to and update the display to show the actual contents in there.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>When the file selector becomes visible</guilabel></term>
+ <listitem><para>
+ If you select this checkbox, the contents in the <guilabel>File Selector</guilabel> window will be updated whenever it gets visible again. If necessary it will switch to the directory the actual document belongs to and update the display to show the actual contents in there.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<para>
+You may freely combine these settings to tailor the actualization behaviour of the <guilabel>File Selector</guilabel> to your liking.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Controlling the History in the Comboboxes</term>
+<listitem>
+<para>There are two comboboxes on top and bottom of the <guilabel>File
+Selector</guilabel> contents window which control the directory to be
+displayed (top combobox) and the filters to be applied to the file display
+(bottom combobox). A history of the most recent settings is kept in the
+selection field of each combobox. You can configure the number of history
+entries as follows.</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>Remember locations</guilabel></term>
+ <listitem><para>
+ Enter here the maximum number of directory selections the upper combobox shall remember.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Remember filters</guilabel></term>
+ <listitem><para>
+ Enter here the maximum number of filter definitions the lower combobox shall remember.
+ </para></listitem>
+ </varlistentry>
+
+<varlistentry>
+<term>Controlling What Should be Remembered Between Sessions</term>
+<listitem>
+<para>
+By default the <guilabel>File Selector</guilabel> is set up so that it shows the display of the most recent session again at the next &kdevelop; start-up. You may change this behaviour in the <guilabel>Session</guilabel> configuration group.
+</para>
+
+<note><para>
+If &kdevelop; was automatically restarted by the &kde; session manager the changes in these settings will have no effect. In this case location and filter settings of the most recent &kde; session will always be restored.
+</para></note>
+</listitem>
+</varlistentry>
+
+ <varlistentry>
+ <term><guilabel>Restore location</guilabel></term>
+ <listitem>
+ <para>
+ Remove the checkbox mark here if you don't want the displayed location be remembered between sessions.
+ </para>
+ <note><para>
+ If you selected one of the <link linkend="setup-fileselector-autosync">automatic update</link> settings the displayed location might automatically change regardless what has been remembered from the recent session.
+ </para></note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Restore filters</guilabel></term>
+ <listitem>
+ <para>
+ Remove the checkbox mark here if you don't want the filters applied to the display be remembered between sessions.
+ </para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect2> <!-- setup-file-selector -->
+
+<sect2 id="setup-cpp-generator">
+<title>C++ Class Generator</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- setup-c++-generator-->
+
+<sect2 id="setup-formatting">
+<title>Formatting</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- setup-formatting-->
+
+<sect2 id="setup-cpp-parsing">
+<title>C++ Parsing</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- setup-c++-parsing-->
+
+</sect1> <!-- setup-general -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="setup-docu">
+<title>Configuring the Documentation</title>
+
+<para>
+&kdevelop; contains a very powerful documentation facility which provides access to several kinds of extensive documentation. In &eg; IDEAl mode you find a <guilabel>Documentation</guilabel> tab at the right border of the work area.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="documents-contents.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>The &kdevelop; documentation window in IDEAl mode</phrase></textobject>
+ <caption><para>
+ The &kdevelop; documentation window (IDEAl mode)
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<note><para>
+&kdevelop; must have loaded the <guilabel>Documentation</guilabel> plugin in order to view the documentation tree. See the <link linkend="setup-plugins">Plugin Tools</link> section for more info.
+</para></note>
+
+<para>
+You may set up contents and behaviour of the various parts of this documentation window if you select <menuchoice> <guimenu>Settings</guimenu> <guimenuitem>Configure &kdevelop;..</guimenuitem> </menuchoice> from the menubar. The <guilabel>Customize KDevelop</guilabel> dialog will pop up, where you have to select <guilabel>Documentation</guilabel> in the left hand window.
+</para>
+
+<para>
+The thus displayed <link linkend="configure-docu-general">configuration page</link> shows three tabbed configuration dialog pages, namely:
+</para>
+
+<simplelist>
+ <member><link linkend="setup-docu-general">Documentation Collections</link></member>
+ <member><link linkend="setup-docu-textsearch">Full Text Search</link></member>
+ <member><link linkend="setup-docu-other">Other</link></member>
+</simplelist>
+
+<sect2 id="setup-docu-general">
+<title>Setting Up Documentation Collections</title>
+
+<para>
+The documentation configuration settings have been divided into a series of documentation collections, each providing access to documentation files of some unique format and content type. These setups control which documentation items will be listed on the <guilabel>Contents</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility, and how the user may access documentation details by indexed and full text searches.
+</para>
+<para>
+The <guilabel>Documentation</guilabel> tab provides a series of configuration pages which are ordered vertically like a stack of index cards. One page at a time will open after a click on its index card title:
+</para>
+<simplelist>
+ <member><link linkend="setup-docu-general-qt">&Qt; Documentation Collection</link></member>
+ <member><link linkend="setup-docu-general-chm">CHM Documentation Collection</link></member>
+ <member><link linkend="setup-docu-general-dox">Doxygen Documentation Collection</link></member>
+ <member><link linkend="setup-docu-general-toc">&kdevelop; TOC Documentation Collection</link></member>
+ <member><link linkend="setup-docu-general-devhelp">Devhelp Documentation Collection</link></member>
+ <member><link linkend="setup-docu-general-custom">Custom Documentation Collection</link></member>
+</simplelist>
+
+<para id="configure-docu-general">
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-general.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Setting up documentation collections</phrase></textobject>
+ <caption><para>
+ Setting up documentation collections
+ </para></caption>
+ </mediaobject>
+</screenshot>
+</para>
+
+<sect3 id="setup-docu-general-common">
+<title>Common Documentation Setup Structure</title>
+
+<para>
+All configurations pages on the <guilabel>Documentation</guilabel> tab use a common layout. You will find the currently available documentation items of this type listed on the open page to the left and a set of buttons to the right.
+</para>
+
+<variablelist>
+<varlistentry>
+<term id="setup-docu-buttons">Buttons to Maintain Documentation List Contents</term>
+<listitem>
+<para>
+There are three buttons available to maintain the contents of the documentation setup pages:
+</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guibutton>Add</guibutton></term>
+ <listitem>
+ <para>Opens a <guilabel>Documentation Catalog Properties</guilabel> dialog as shown below where you can select the source location of the documentation item to be added and name it.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guibutton>Edit</guibutton></term>
+ <listitem>
+ <para>Opens a <guilabel>Documentation Catalog Properties</guilabel> dialog as shown below where you can change the source location of the documentation item previously selected in the list and rename it.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guibutton>Remove</guibutton></term>
+ <listitem>
+ <para>Removes the selected documentation entry from the list.</para>
+ <note><para>
+ The entry will be removed from the list only. Actual documentation sources remain untouched. You will have to remove them explicitely by other means.
+ </para></note>
+ </listitem>
+ </varlistentry>
+</variablelist>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-edit.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Add or change a documentation item
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+The button to the right of the <guilabel>Location</guilabel> field opens a directory dialog whose entries usually will be filtered according to the file type of the selected configuration page.
+</para>
+<para>
+The <guilabel>Title</guilabel> field may not be accessible, depending on the documentation type to be maintained.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term id="setup-docu-columns">Documentation List Structure</term>
+<listitem>
+<para>
+Every documentation setup page shows the listed documentation items in a table with four columns:
+</para>
+
+<variablelist>
+ <varlistentry>
+ <term><guilabel>TOC</guilabel></term>
+ <listitem>
+ <para>
+ If this check box is marked, this documentation item will show up on the <guilabel>Contents</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility.
+ </para>
+ <note><para>
+ Unchecking the <guilabel>TOC</guilabel> check box will in turn disable the <guilabel>Index</guilabel> and <guilabel>Search</guilabel> check boxes (see below). Thus you cannot have documentation collection items indexed but not shown in the contents.
+ </para></note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Index</guilabel></term>
+ <listitem>
+ <para>
+ If this check box is marked, an internal index will be built of this documentation item. This provides fast access to the documentation by the use of the <guilabel>Index</guilabel> and (optionally) <guilabel>Finder</guilabel> pages of the &kdevelop; <guilabel>Documentation</guilabel> facility.
+ </para>
+ <note>
+ <para>
+ The internal index will be built the first time the user selects the <guilabel>Index</guilabel> page. This will delay the first access noticeably, because the index will be read from disk and then cached.
+ </para>
+ <para>
+ All subsequent indexed searches will however use this chache and thus work significally faster.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Search</guilabel></term>
+ <listitem>
+ <para>
+ If this check box is marked, the contents of this documentation item will be included in the full text search path of the <guilabel>Search</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility.
+ </para>
+ <note>
+ <para>
+ &kdevelop; utilizes the htdig application collection to perform full text searches. This search is done over an internal index, the htdig machinery has to build before it can be used.
+ </para>
+ <para>
+ Any change of the <guilabel>Search</guilabel> check box marks will thus effect the search runs only after you rebuilt the index on the <guilabel>Search</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><guilabel>Title</guilabel></term>
+ <listitem><para>
+ This is the name of the Documentation item as it will be shown on the <guilabel>Contents</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<note><para>
+Former &kdevelop; versions allowed to select the documentation items to be displayed on a per-project basis. This is not available any more.
+</para></note>
+</listitem>
+</varlistentry>
+</variablelist>
+
+</sect3> <!-- setup-docu-general-common -->
+
+<sect3 id="setup-docu-general-qt">
+<title>&Qt; Documentation Collections</title>
+
+<para>
+On this configuration page all &Qt; documentation is set up.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-general.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Setting up the &Qt; documentation collection</phrase></textobject>
+ <caption><para>
+ Setting up the &Qt; documentation collection
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Normally &kdevelop; will fill this in on its first start-up. It looks for standard <filename>*.xml</filename>, or <filename>*.dcf</filename> documentation files in the &Qt; installation directory. The table to the left lists the files &kdevelop; found by their standard titles.
+</para>
+
+<para>
+If you have a non-standard installation, either there will be no information listed at all or the entries will possibly refer to improper locations (&eg; to another &Qt; installation available in your system). You may adjust the entries using the <link linkend="setup-docu-buttons">buttons</link> to the right of the list field.
+</para>
+
+<note><para>
+&kdevelop; will use the titles already provided by the installed &Qt; documentation. Hence the <guilabel>Title</guilabel> field in the <guilabel>Documentation Catalog Properties</guilabel> dialog is inaccessible.
+</para></note>
+
+<para>
+By default, not all &Qt; documentation will be shown on the <guilabel>Contents</guilabel> page of the &kdevelop; <guilabel>Documentation</guilabel> facility. Use the <guilabel>TOC</guilabel> check box in the <link linkend="setup-docu-columns">setup table</link> to select the documentation to be shown.
+</para>
+
+<para>
+If you want to have some specific &Qt; documentation included in the search indexes or full text search use the <guilabel>Index</guilabel> and <guilabel>Search</guilabel>check boxes in the <link linkend="setup-docu-columns">setup table</link>.
+</para>
+
+</sect3> <!-- setup-docu-general-qt -->
+
+<sect3 id="setup-docu-general-chm">
+<title>Setting Up the CHM Documentation Collection</title>
+
+<para>
+On this configuration page you may collect documentation according to the &Microsoft; CHM help file standard.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-chm.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Setting up &Microsoft; CHM standard documentation files</phrase></textobject>
+ <caption><para>
+ Setting up &Microsoft; CHM standard documentation files
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+By default, this configuration page will be empty (as shown above). You may add new entries using the <link linkend="setup-docu-buttons">buttons</link> to the right of the list field. &kdevelop; will filter <filename>*.chm</filename> files in the directory dialog associated to the <guibutton>Add</guibutton> and <guibutton>Edit</guibutton> buttons.
+</para>
+
+<para>
+For more information on the format of &Microsoft; <filename>*.chm</filename> files see &eg; PHP: Documentation - Extended CHM Format at <ulink url="http://de2.php.net/docs-echm.php">http://de2.php.net/docs-echm.php</ulink>.
+</para>
+
+</sect3> <!-- setup-docu-general-chm -->
+
+<sect3 id="setup-docu-general-dox">
+<title>Documentation Generated by Doxygen</title>
+
+<para>
+On this configuration page all &API; documentation generated by &doxygen; is set up.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-dox.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Setting up Doxygen generated &API; documentation</phrase></textobject>
+ <caption><para>
+ Setting up Doxygen generated &API; documentation
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+In short, such an &API; documents the interface to certain library functions. The &API; documentation on this page should be produced by the externally provided <ulink url="http://www.stack.nl/~dimitri/doxygen/">&doxygen;</ulink> tool.
+</para>
+<para>
+&doxygen; generated &API; documentationconsists of a series of <filename>html</filename> files, starting with <filename>index.html</filename>. Additionally there may exist <filename>tag</filename> files which contain information to link to already existing &API; documentations. Thus &kdevelop; will look for <filename>index.html</filename> and <filename>*.tag</filename> files when seaching for &doxygen; generated &API; documentation.
+</para>
+<para>
+There are some structural constraints assumed when searching for &doxygen; generated &API; documentation. The directory in which the <filename>index.html</filename> file resides should contain subdirectories with separate documentation collections. Each of these subdirectories is assumed to contain a <filename>.tag</filename> file and a <filename class="directory">html/</filename> subdirectory.
+</para>
+<para>
+You may have a look at <filename class="directory">$<envar>KDEDIR</envar>/share/doc/HTML/en/kdelibs-apidocs</filename> for an example of such a &doxygen; &API; documentation layout.
+</para>
+
+<note><para>
+The older &kde; <ulink url="http://sirtaj.net/projects/kdoc/">KDoc</ulink> generated &API; format is not directly supported any more. If you still want to use such documentation, you may add it on the <link linkend="setup-docu-general-custom">Custom Documentation Collection</link> page.
+</para></note>
+
+<para>
+&kdevelop; will have filled in a link to the current &kde; Libraries &API;, provided it found one. There are several ways for &kdevelop; to find out:
+</para>
+
+<itemizedlist>
+ <listitem><para>
+ Either you provided the <command>configure</command> command with the
+ <option>--with-kdelibsdoxy-dir</option> option when you compiled
+ &kdevelop; (see the <link linkend="make-api">How to Obtain a &kdevelop; &API; Documentation</link> chapter).
+ </para></listitem>
+ <listitem><para>
+ Or the <command>configure</command> command did automatically find a &doxygen; generated &kde; Libraries &API; in one of several standard locations it knows of.
+ </para></listitem>
+ <listitem><para>
+ Or as a last resort the <filename class="directory">$<envar>KDEDIR</envar>/share/doc/HTML/en/kdelibs-apidocs/</filename> was found at the first &kdevelop; startup.
+ </para></listitem>
+</itemizedlist>
+
+<para>
+If &kdevelop; did not find a valid &doxygen; generated &kde; Libraries &API; at its first start-up the <guilabel>Doxygen Documentation Collection</guilabel> list will be empty.
+</para>
+
+<para>
+You may add your own &API; documentation entries (&eg; from your current projects) by using the <link linkend="setup-docu-buttons">buttons</link> to the right. If you want to have them included in the indexed and/or full text search mark the <guilabel>Index</guilabel> or <guilabel>Search</guilabel> check boxes in the <link linkend="setup-docu-columns">setup table</link>.
+</para>
+
+<note><para>
+&kdevelop; uses the title information from the <filename>index.html</filename>. Hence the <guilabel>Title</guilabel> field in the <guilabel>Documentation Catalog Properties</guilabel> dialog is inaccessible.
+</para></note>
+
+<tip>
+ <para>
+ The &kde; system provides more &API; documentation than the &kde; Libraries &API; only. You will need additional interfaces information if you want to &eg; include the &kate; part into you programs. For this &kate; part &API; for example you should compile and install the &kde; Base Libraries &API; from the <ulink url="http://developer.kde.org/source/index.html">sources</ulink> (using the <command>make apidox</command> and <command>make install</command> commands on the <filename class="directory">kdebase</filename> sources) and then add an entry to the <guilabel>Doxygen Documentation Collection</guilabel> list like this:
+ </para>
+ <screenshot><mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-adddialog-baselibs.png" format="PNG"/>
+ </imageobject>
+<textobject><phrase>Adding a &kde; base &API; to the list</phrase></textobject>
+ <caption><para>
+ Adding a &kde; Base &API; to the list
+ </para></caption>
+ </mediaobject></screenshot>
+ <para>
+ (Of course you should replace the <filename class="directory">/home/dev/mykde-system/</filename> directory in the <guilabel>Location</guilabel> field example with the path to your &kde; installation.)
+ </para>
+</tip>
+
+<note><para>
+You must put the &API; of your current project into this <guilabel>Doxygen Documentation Collection</guilabel> as well. Former &kdevelop; versions did put it into the documentation tree on a per-project basis. This is not provided any more.
+</para></note>
+
+</sect3> <!-- setup-docu-general-dox -->
+
+<sect3 id="setup-docu-general-toc">
+<title>Handling Structured Documentation (KDevelopTOC Files)</title>
+
+<para>
+The main bulk of the &kdevelop; documentation facility provides immediate access to structured documentation, local as well as remote ones. You can configure this on the <guilabel>KDevelopTOC Documentation Collection</guilabel> page.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-toc.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Providing KDevelopTOC structured documentation access
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+&kdevelop; comes with a bunch of predefined KDevelopTOC files which are automatically entered in the table at installation time. To keep the display manageable only the most often used will initially be marked for display. If you want to see another documentation, mark the <guilabel>TOC</guilabel> check box in the <link linkend="setup-docu-columns">setup table</link>.
+</para>
+
+<para>
+KDevelopTOC files cannot be indexed to perform a full text search because they usually point to a remote location. On the other hand, such a <filename>.toc</filename> file can have an index manually defined, using the <computeroutput>&lt;index&gt;</computeroutput> tag. Thus the <guilabel>Index</guilabel> check box will be enabled ony when &kdevelop; finds an <computeroutput>&lt;index&gt;</computeroutput> tag in the <filename>.toc</filename> file. (For more detail see the description below in the <link linkend="setup-docu-general-toc-files">&kdevelop; TOC Files</link> section.)
+</para>
+<para>
+The <guilabel>Search</guilabel> check box in the <link linkend="setup-docu-columns">setup table</link> will alway be disabled.
+</para>
+
+<para>
+You may add new entries using the <link linkend="setup-docu-buttons">buttons</link> to the right of the list field. &kdevelop; will filter <filename>*.toc</filename> files in the directory dialog associated to the <guibutton>Add</guibutton> and <guibutton>Edit</guibutton> buttons.
+</para>
+
+<note><para>
+Other than former &kdevelop; versions will the <guibutton>Remove</guibutton> button not change the <filename>*.toc</filename> files on disk, so the remove operation is safe now.
+</para></note>
+
+</sect3> <!-- setup-docu-general-toc -->
+
+<sect3 id="setup-docu-general-toc-files">
+<title>&kdevelop; TOC Files</title>
+
+<para>
+There is a special feature associated with this. To illustrate, follow these steps: In the documentation tree find an entry shortly below the &Qt;/&kde; documentation (&eg; <quote>KDE2 Development Book (kde.org)</quote>). Click on the plus sign next to it. A tree will open where you can quickly navigate to subsequent chapters nested several levels deep, all offline. But if you finally select one of the chapters, &kdevelop; will in many cases try to access a <emphasis>remote</emphasis> documentation file.
+</para>
+
+<para>
+The rationale behind this is not only to locally navigate remote documentation without wasting net access ressources, but to provide the developer with easy, structured access to the documentation he/she needs. Using these tools one can access almost any local or remote documentation in a structured fashion even if the original is laid out flat or structured in another way. All that is needed is access to files and/or parts of files which are displayable by the Konqueror.
+</para>
+
+<para>
+Such structured access is made possible through the use of special <quote>table of content</quote> files, which are denoted by <filename>.toc</filename> filename extensions. Any such &kdevelop; TOC file contains an &XML; structured description of the document to be accessed.
+</para>
+
+<variablelist>
+<varlistentry>
+<term>Standard Directory of &kdevelop; TOC Files</term>
+<listitem>
+<para>
+When &kdevelop; was installed usually a series of predefined <filename>.toc</filename> files has been put into the <filename class="directory">$KDEDIR/share/apps/kdevdocumentation/tocs</filename> directory. These are fairly simple, structured text files. You may look at them using a text editor or other text display facility.
+</para>
+</listitem>
+</varlistentry></variablelist>
+
+<!-- FIXME: Lauri Watts (2005-05-03) This could be marked up a whole lot -->
+<!-- more clearly with the sgmltags stuff. Making a note to do that once -->
+<!-- this first revision is done. -->
+
+<variablelist id="toc-file-structure">
+ <title>Basic Structure of &kdevelop; TOC Files</title>
+ <varlistentry>
+ <term>header</term>
+ <listitem>
+ <simplelist>
+ <member>
+ <computeroutput>&lt;!DOCTYPE kdeveloptoc&gt;</computeroutput>
+ </member>
+ <member>
+ <computeroutput>&lt;kdeveloptoc&gt;</computeroutput>
+ </member>
+ <member>
+ <emphasis>(title)</emphasis>
+ </member>
+ <member>
+ <emphasis>(base address)</emphasis>
+ </member>
+ <member>
+ <emphasis>(content structure)</emphasis>
+ </member>
+ <member>
+ <emphasis>(index structure)</emphasis>
+ </member>
+ <member>
+ <computeroutput>&lt;/kdeveloptoc&gt;</computeroutput>
+ </member>
+ </simplelist>
+ <para>
+ This &XML; structure will be parsed by the &kdevelop; <guilabel>Documentation</guilabel> plugin to set up the documentation tree contents and to guide the user in navigating the documentation. It contains all information necessary to display titles and access the documentation file contents.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>title</term>
+ <listitem>
+ <simplelist>
+ <member>
+ <computeroutput>&lt;title&gt;</computeroutput>
+ <emphasis>(some title string)</emphasis>
+ <computeroutput>&lt;/title&gt;</computeroutput>
+ </member>
+ </simplelist>
+ <para>
+ This is the title &kdevelop; will display at the basic levels in the documentation tree.
+ </para>
+ <note><para>
+ This displayed title cannot be changed by the user. If you want another text be displayed, you must manually change the <computeroutput>&lt;title&gt;</computeroutput> entry in the <filename>.toc</filename> file.
+ </para></note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>base address</term>
+ <listitem>
+ <simplelist>
+ <member>
+ <computeroutput>&lt;base href="</computeroutput>
+ <emphasis>(base document &URL;)</emphasis>
+ <computeroutput>"/&gt;</computeroutput>
+ </member>
+ </simplelist>
+ <para>
+ This &URL; points to the location where all files of this documentation are located. It will be prepended before each section &URL; in the following content structure list. So, if you &eg; downloaded a documentation from a remote server, all you need to display the files from this new location is to change its <computeroutput>&lt;base&gt;</computeroutput> &URL;.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>content structure</term>
+ <listitem>
+ <simplelist>
+ <member>
+ <computeroutput>&lt;tocsect1 name="</computeroutput>
+ <emphasis>(section title)</emphasis>
+ <computeroutput>" url="</computeroutput>
+ <emphasis>(section &URL;)</emphasis>
+ <computeroutput>"&gt;</computeroutput>
+ </member>
+ <member>...</member>
+ <member>
+ <computeroutput>&lt;tocsectn name="</computeroutput>
+ <emphasis>(section title)</emphasis>
+ <computeroutput>" url="</computeroutput>
+ <emphasis>(section &URL;)</emphasis>
+ <computeroutput>"/&gt;</computeroutput>
+ </member>
+ <member>...</member>
+ <member>
+ <computeroutput>&lt;/tocsect1&gt;</computeroutput>
+ </member>
+ </simplelist>
+ <para>
+ All remaining navigation and access information is stored in a series of nested <computeroutput>&lt;tocsecti&gt;</computeroutput> ... <computeroutput>&lt;/tocsecti&gt;</computeroutput> pairs. Each <emphasis>i</emphasis> denotes a consecutive nesting level down to number <emphasis>n</emphasis> which will correspond to the finally displayed documentation section.
+ </para>
+ <para>
+ Any <computeroutput>&lt;tocsecti&gt;</computeroutput> entry must have a <computeroutput>name="xxx"</computeroutput> attribute associated with it (the "xxx" denotes the actual title string). This name will be displayed as level title in the documentation tree. It should correspond to an actual documentation section.
+ </para>
+ <para>
+ There may be an <computeroutput>url=""</computeroutput> attribute associated with any <emphasis>i</emphasis> nesting level. When the user clicks on a section title in the documentation tree &kdevelop; will try to access the file at the location pointed to by the combined base and section &URL;.
+ </para>
+ <para>
+ The <computeroutput>&lt;tocsectn/&gt;</computeroutput> entry must have an <computeroutput>url=""</computeroutput> attribute whatsoever.
+ This final nested <computeroutput>&lt;tocsectn/&gt;</computeroutput> does not come in pairs but will immediately be closed by a <computeroutput>/</computeroutput> before the <computeroutput>&gt;</computeroutput> bracket.
+ </para>
+ <note><para>
+ Any address combined of base and section &URL; must point to some displayable text file. Usually this will be an HTML-structured file. It is possible to link to anchor marks within such an HTML file using the standard # notation of the format: <filename>/base-url/section-url#anchor-mark</filename>.
+ </para></note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>index structure</term>
+ <listitem>
+ <simplelist>
+ <member>
+ <computeroutput>&lt;index&gt;</computeroutput>
+ </member>
+ <member>
+ <computeroutput>&lt;entry name="</computeroutput>
+ <emphasis>(index entry title)</emphasis>
+ <computeroutput>" url="</computeroutput>
+ <emphasis>(index section &URL;)</emphasis>
+ <computeroutput>"/&gt;</computeroutput>
+ </member>
+ <member>
+ <computeroutput>&lt;/index&gt;</computeroutput>
+ </member>
+ </simplelist>
+ <para>
+ Index is a plain list of index entries - pairs of title and &URL;. Index is not mandatory.
+ </para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+<!-- FIXME: End -->
+
+</sect3> <!-- setup-docu-general-toc-files -->
+
+<sect3 id="setup-docu-general-devhelp">
+<title>DevHelp Documentation</title>
+
+<para>
+DevHelp documentation is another means of structured documentation access. It uses structured table of content files denoted by a <filename>.devhelp</filename> extension similar to <link linkend="setup-docu-general-toc-files">&kdevelop; TOC files</link> to access documentation for the GNOME 2 desktop.
+</para>
+<para>
+You can control which DevHelp files should be accessible on the <guilabel>DevHelp Documentation Collection</guilabel> configuration page.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-devhelp.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Providing DevHelp documentation
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+DevHelp files originally were accessible on the <ulink url="http://lidn.sourceforge.net/">LiDN</ulink> website, but this seems to be not maintained for some time now. More recent DevHelp documentation is available at the <ulink url="http://htmlhelp.berlios.de/books/devhelp.php">DevHelp Books Download</ulink> web page.
+</para>
+
+<para>
+When &kdevelop; is installed it will attempt to find all <filename>.devhelp</filename> files in some standard places in the system, &eg; in the subdirectories of <filename class="directory">/opt/gnome/share/</filename>. Initially these files will not be marked for display. If you want to see another documentation, mark the <guilabel>TOC</guilabel> check box in the <link linkend="setup-docu-columns">setup table</link>.
+</para>
+
+<para>
+You may add new entries using the <link linkend="setup-docu-buttons">buttons</link> to the right of the list field. &kdevelop; will filter <filename>*.toc</filename> files in the directory dialog associated to the <guibutton>Add</guibutton> and <guibutton>Edit</guibutton> buttons.
+</para>
+
+</sect3> <!-- setup-docu-general-devhelp -->
+
+<sect3 id="setup-docu-general-custom">
+<title>Setting Up Custom Documentation Collections</title>
+
+<para>
+This is for your own purpose. You may add almost any documentation files here, provided they can be displayed by the &konqueror; plugins.
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-docu-custom.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Providing custom documentation
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+<para>
+Usually this collection will be empty at first &kdevelop; startup. We have filled in a deliberate item to show the entry structure.
+</para>
+<para>
+Handling is straightforward here. Use the <link linkend="setup-docu-buttons">buttons</link> to the right of the list field to add, edit or remove the document items. &kdevelop; will not filter anything in the directory dialog associated to the <guibutton>Add</guibutton> and <guibutton>Edit</guibutton> buttons.
+</para>
+
+<para>
+You will have to explicitely select the items for display in the &kdevelop; documentation facility. Mark the <guilabel>TOC</guilabel> check box of the entry in the <link linkend="setup-docu-columns">setup table</link>.
+</para>
+
+<note><para>
+Custom documention cannot be indexed or searched. Thus the <guilabel>Index</guilabel> and <guilabel>Search</guilabel> check boxes have no effect here as shown above.
+</para></note>
+
+</sect3> <!--- setup-docu-general-custom -->
+
+</sect2> <!-- setup-docu-general -->
+
+<sect2 id="setup-docu-textsearch">
+<title>Setting Up Text Search Indexes</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="configure-doctree-textsearch.png" format="PNG"/>
+ </imageobject>
+ <caption><para>
+ Setting up text search indexes
+ </para></caption>
+ </mediaobject>
+</screenshot>
+
+</sect2> <!-- setup-docu-textsearch -->
+
+<sect2 id="setup-docu-other">
+<title>Other Documentation Configuration Settings</title>
+
+<para>
+(... to be written ...)
+</para>
+
+</sect2> <!-- setup-docu-other -->
+
+</sect1> <!-- setup-docu -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="setup-advanced">
+<title>Advanced Configuration</title>
+
+<para>
+(... to be written ...)
+</para>
+
+<sect2 id="setup-plugins">
+<title>Plugin Tools</title>
+
+<para>
+(... to be written ...)
+</para>
+</sect2> <!-- setup-plugins -->
+
+</sect1> <!-- setup-advanced -->
+
+</chapter> <!-- setup -->
diff --git a/doc/kdevelop/split-source-header-navigate.png b/doc/kdevelop/split-source-header-navigate.png
new file mode 100644
index 00000000..f4d72868
--- /dev/null
+++ b/doc/kdevelop/split-source-header-navigate.png
Binary files differ
diff --git a/doc/kdevelop/split-source-header.png b/doc/kdevelop/split-source-header.png
new file mode 100644
index 00000000..d57b306b
--- /dev/null
+++ b/doc/kdevelop/split-source-header.png
Binary files differ
diff --git a/doc/kdevelop/split-windows.png b/doc/kdevelop/split-windows.png
new file mode 100644
index 00000000..3ebb79f5
--- /dev/null
+++ b/doc/kdevelop/split-windows.png
Binary files differ
diff --git a/doc/kdevelop/split-workspace.png b/doc/kdevelop/split-workspace.png
new file mode 100644
index 00000000..d497ab49
--- /dev/null
+++ b/doc/kdevelop/split-workspace.png
Binary files differ
diff --git a/doc/kdevelop/survey-manual.docbook b/doc/kdevelop/survey-manual.docbook
new file mode 100644
index 00000000..d9611a03
--- /dev/null
+++ b/doc/kdevelop/survey-manual.docbook
@@ -0,0 +1,228 @@
+<chapter id="survey-manual">
+<title>What This Manual Contains</title>
+
+<para>
+This user manual is intended to describe the contents and use of the &kdevelop; &kdevrelease; Integrated Development Environment (IDE) from a user's point of view. It is not a programming manual, nor does it describe the development process in detail. Its only aim is to guide you in the handling of the IDE.
+</para>
+<para>
+Here you will find information on the following topics:
+</para>
+<variablelist>
+<varlistentry>
+<term><link linkend="getting-started">Getting Started with &kdevelop; &mdash; a Guided Tour</link> </term>
+<listitem>
+<para>Gives you a quick start on the use of this &IDE;, introducing the basic steps of how to work on a project.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="kdevelop-survey">Overview of the Features of
+ &kdevelop;</link></term>
+<listitem>
+<para>Extends the guided tour in the previous chapter, giving an overall
+view of what is built-in within &kdevelop; and gets you acquainted with the
+look and feel of this &IDE;.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="setup">Configuring &kdevelop;</link></term>
+<listitem>
+<para>Shows how you can tailor the &IDE; to suit your needs.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="applicationwizard">Getting started: the
+&appwizard;</link></term>
+<listitem>
+<para>Describes the basics of how to set up a new project in &kdevelop;
+using the built-in &appwizard;.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="editing">Editing tools</link></term>
+<listitem>
+<para>All you need to write your source files: using the editor, searching
+for text both locally and project-wide, up to integrating new files and
+classes into the project.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="file-browsers">The File Browsers</link></term>
+<listitem>
+<para>Demonstrates various tools to look at the structure of your project
+and how to access the files you want to work with.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="class-browsers">The Class Browsers</link></term>
+<listitem>
+<para>Describes one of the most powerful tools of &kdevelop; which lets you
+navigate through class dependencies and allows you to easily create and
+access the classes and methods you need.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="documentation">Documentation</link></term>
+<listitem>
+<para>Shows how to access the rich built-in documentation &kdevelop;
+provides and tells you how to create documentation of your project, concise
+and powerful &API; documentation providing you an overall view of all your
+project sources as well as docbook-based user documentation.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="project-management">Building and Project
+ Management</link></term>
+<listitem>
+<para>Deals with the creation and management of your project; describing the
+basics of autoconf and automake as well as how to set up custom make files
+and how to use compiler or make options to tailor your application to suit
+your needs.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="adv-build-management">Advanced Build
+ Management</link></term>
+<listitem>
+<para>Looks at ways to keep multiple build configurations, to cross-compile
+for diverse platforms, or to make an embedded system using the
+<application>Qt/embedded</application> library.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="debugger">The Debugger Interface</link></term>
+<listitem>
+<para>Describes how to use the integrated <application>gdb</application>
+debugger interface so you can hunt down bugs without leaving
+&kdevelop;.</para>
+</listitem>
+</varlistentry>
+
+<!-- ### Currently disabled. Probably too specialized programming stuff. Check later again.
+ <listitem><para>
+ <link linkend="python">Python</link> &mdash; an overview of how to create Python-based applications in &kdevelop;.
+ </para></listitem>
+ <listitem><para>
+ <link linkend="php">PHP</link> &mdash; an overview of how to create PHP-based HTML applications in &kdevelop;.
+ </para></listitem>//-->
+
+<varlistentry>
+<term><link linkend="cvs">Using CVS</link></term>
+<listitem>
+<para>Tells you how you can maintain your project using the CVS versioning
+system; a must, especially if many developers work on the same
+project.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<!--
+ <listitem><para>
+ <link linkend="kdevelop-scripting">Scripting &kdevelop;</link> &mdash; describes how to add scripts to automate &kdevelop;.
+ </para></listitem>
+
+
+ <listitem><para>
+ Some commonly used information has been put into the <emphasis>appendix</emphasis>. Amongst others this consists of:
+-->
+<para>
+Some commonly used information has been put into the <emphasis>appendix</emphasis>. Amongst others this consists of:
+</para>
+
+<variablelist>
+<varlistentry>
+<term><link linkend="kdevelop-install">Installing &kdevelop;</link></term>
+<listitem>
+<para>Tells you where to obtain &kdevelop; and how to get it up and
+running.</para>
+</listitem>
+</varlistentry>
+</variablelist>
+
+<variablelist>
+<varlistentry>
+<term><link linkend="nutshell">In a Nutshell &mdash; Tips and
+Tricks</link></term>
+<listitem>
+<para>A quick reference to commonly used commands and actions. And a short
+guide to solve common problems when working with
+&kdevelop;.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><link linkend="unixdev">Development on &UNIX;</link></term>
+<listitem>
+<para>A historical overview of &UNIX; program development, the main tools
+necessary and why you need an &IDE;.</para>
+</listitem>
+</varlistentry>
+
+<!--
+ <listitem><para>
+ <link linkend="app-menus">Menus and Toolbars Overview</link> &mdash; provides you with a short overall view of the menu and toolbar selections available.
+ </para></listitem>
+
+ <listitem><para>
+ <link linkend="app-shortcuts">Shortcut Keys</link> &mdash; the keys you can use to work with &kdevelop; without resorting to the mouse.
+ </para></listitem>
+-->
+
+<varlistentry>
+<term><link linkend="app-files">Configuration Files Used by
+ &kdevelop;</link></term>
+<listitem><para>Lists the files &kdevelop; uses to save its internal
+ information. This is particularly useful in case something went wrong with
+ your setup.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry><term>
+<link linkend="plugin-tools">Plugin Tools</link>
+</term><listitem><para>Lists the pluggable tools you can use to taylor the capabilities of
+&kdevelop; to your needs.
+</para></listitem></varlistentry>
+
+<!--
+ <listitem><para>
+ <link linkend="plugin-tools">Plugin tools</link> &mdash; provides you with an overview of the parts which make up &kdevelop; and how you can tailor it to suit your needs by only loading the parts that are necessary, both IDE and project-wide.
+ </para></listitem>
+-->
+<varlistentry><term>
+<link linkend="app-uimodes-examples">KDevelop User Interface Mode Examples </link>
+</term><listitem><para>Shows user interface modes.
+</para></listitem></varlistentry>
+
+<varlistentry><term>
+<link linkend="app-misc-info">Further Information </link> </term><listitem><para>
+Getting Information, reporting Bugs etc.
+</para></listitem></varlistentry>
+
+<varlistentry><term>
+<link linkend="app-changelog">Changelog </link>
+</term><listitem><para>Shows the history of this documentation.
+</para></listitem></varlistentry>
+
+<varlistentry><term>
+<link linkend="app-bibliography">Bibliography </link>
+</term><listitem><para>Bibliography
+</para></listitem></varlistentry>
+
+</variablelist>
+ <!--
+ <listitem><para>
+ <link linkend="documentation-index">Index </link> &mdash;
+ </para></listitem>
+-->
+
+
+</chapter>
diff --git a/doc/kdevelop/tutorial-debug-tree.png b/doc/kdevelop/tutorial-debug-tree.png
new file mode 100644
index 00000000..23c7f2c6
--- /dev/null
+++ b/doc/kdevelop/tutorial-debug-tree.png
Binary files differ
diff --git a/doc/kdevelop/tutorial-hello-new.png b/doc/kdevelop/tutorial-hello-new.png
new file mode 100644
index 00000000..abbb912d
--- /dev/null
+++ b/doc/kdevelop/tutorial-hello-new.png
Binary files differ
diff --git a/doc/kdevelop/tutorial-hello-options.png b/doc/kdevelop/tutorial-hello-options.png
new file mode 100644
index 00000000..7b9d98cd
--- /dev/null
+++ b/doc/kdevelop/tutorial-hello-options.png
Binary files differ
diff --git a/doc/kdevelop/tutorial-new-project.png b/doc/kdevelop/tutorial-new-project.png
new file mode 100644
index 00000000..8f3aa78d
--- /dev/null
+++ b/doc/kdevelop/tutorial-new-project.png
Binary files differ
diff --git a/doc/kdevelop/unixdev.docbook b/doc/kdevelop/unixdev.docbook
new file mode 100644
index 00000000..d7881afb
--- /dev/null
+++ b/doc/kdevelop/unixdev.docbook
@@ -0,0 +1,386 @@
+<appendix id="unixdev">
+
+<appendixinfo>
+ <authorgroup>
+ <author><firstname>Bernd</firstname><surname>Pol</surname></author>
+ <!-- ROLES_OF_TRANSLATORS -->
+ </authorgroup>
+</appendixinfo>
+
+<title>Development on &UNIX;</title>
+
+<indexterm zone="unixdev"><primary>development</primary></indexterm>
+<indexterm zone="unixdev">
+ <primary>&UNIX;</primary>
+ <secondary>development</secondary></indexterm>
+
+<sect1 id="history">
+<title>Some Historical Remarks</title>
+
+<indexterm zone="history"><primary>history</primary></indexterm>
+<indexterm zone="history"><primary>scripting languages</primary></indexterm>
+<indexterm zone="history">
+ <primary>&UNIX;</primary>
+ <secondary>history</secondary></indexterm>
+<indexterm zone="history">
+ <primary>&UNIX;</primary>
+ <secondary>pipe</secondary></indexterm>
+<indexterm zone="history">
+ <primary>&UNIX;</primary>
+ <secondary>shell</secondary></indexterm>
+<indexterm zone="history">
+ <primary>shell</primary>
+ <secondary>&UNIX;</secondary></indexterm>
+
+<para>
+From the beginning, &UNIX; has maintained two very different development paradigms. One is the world of <emphasis>system and application programming languages</emphasis>, where some source code is translated to machine code by a translation program, usually a <emphasis>compiler</emphasis> or an <emphasis>interpreter</emphasis>. The programming language C is an example. &UNIX; was the first operating system kernel to be written in such a high level language instead of tightly machine-oriented assembler which was common before that time. (In fact, the C language once even was invented to write the &UNIX; kernel and associated programs on a DEC PDP-11 computer.)
+</para>
+<para>
+The other paradigm is the world of <emphasis>scripting languages</emphasis>. This world evolved with the invention of the &UNIX; shell which was the user's interface to the operating system&mdash;and at the same time a very high level programming language. A shell script is built from a set of small utility programs like &eg; <command>grep</command>, <command>sed</command>, or <command>find</command>. Each such utility is designed for some tightly defined job. The trick is that any such utility can be connected to another one via a simple transport mechanism, called a <emphasis>pipe</emphasis>, which directs the output of the foregoing utility into the input of the next processed one. This makes for a very powerful and highly flexible programming tool.
+</para>
+<para>
+As time has gone by, both worlds have evolved. While C is still used mainly as a system programming language, C++ as a variant of C enriched by object-oriented and generic extensions has found its place for the development of complex applications in the 1990's. There are numerous other programming languages, even older ones keep their place&mdash;FORTRAN77 and Ada &eg; still have their stronghold in numerical applications.
+</para>
+</sect1> <!-- history -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="unixdev-scripting-languages">
+<title>Contemporary Scripting Languages</title>
+<para>
+In the scripting area, there has been a shift away from the shell, which suffers from portability concerns, to languages which unify all commonly needed functionality in their standard libraries, while still being able to interface to the outside through pipes when necessary.
+</para>
+<para>
+All these scripting languages have in common that they are widely portable between &UNIX; variants, Microsoft &Windows;, &MacOS; or even VMS. Also, they all have implementations that are freely distributable.
+</para>
+
+<sect2 id="unixdev-SL-Perl">
+<title>&perl;</title>
+
+<indexterm zone="unixdev-SL-Perl"><primary>Perl</primary></indexterm>
+<indexterm zone="unixdev-SL-Perl">
+ <primary>scripting languages</primary>
+ <secondary>Perl</secondary></indexterm>
+
+<para>
+<ulink url="http://www.perl.com">&perl;</ulink> has become popular as a text processing and system administration language. In the beginning of the World Wide Web, CGI scripts written in &perl; were a widely used method to create dynamic web pages from databases. Today, this method has been replaced mostly by the <command>mod_perl</command> plugin for the &apache; web server. Among &perl;'s strengths are its built-in support for advanced regular expression matching and its rich archive of freely distributed modules.
+</para>
+<para>
+For more information see the <ulink url="http://cpan.org">Comprehensive Perl Archive Network (<acronym>CPAN</acronym>)</ulink> website.
+</para>
+</sect2> <!-- unixdev-SL-Perl -->
+
+<sect2 id="unixdev-SL-Python">
+<title>Python</title>
+
+<indexterm zone="unixdev-SL-Python"><primary>Python</primary></indexterm>
+<indexterm zone="unixdev-SL-Python">
+ <primary>scripting languages</primary>
+ <secondary>Python</secondary></indexterm>
+
+<para>
+<ulink url="http://www.python.org">&python;</ulink> shines by the elegance of its class system and the ease and flexibility with which external libraries can be wrapped in a way that they appear like standard &python; classes and functions. In contrast to &perl;, &python; has a clear and concise embedding &API;, which makes it the language of choice for making C and C++ programs scriptable.
+</para>
+</sect2> <!-- unixdev-SL-Python -->
+
+<sect2 id="unixdev-SL-PHP">
+<title>PHP</title>
+
+<indexterm zone="unixdev-SL-PHP"><primary>PHP</primary></indexterm>
+<indexterm zone="unixdev-SL-PHP">
+ <primary>scripting languages</primary>
+ <secondary>PHP</secondary></indexterm>
+
+<para>
+<ulink url="http://www.php.net">&php;</ulink> was invented as a language directly embeddable into &HTML; pages and consequently has its main uses in delivering dynamic content on the web.
+</para>
+</sect2> <!-- unixdev-SL-PHP -->
+</sect1> <!-- unixdev-scripting-languages -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<sect1 id="unixdev-hl-script">
+<title>Higher-level Scripting</title>
+
+<para>
+Higher-level &UNIX; applications usually miss the speed and flexibility of the traditional character-oriented shell scripting mechanisms. This is especially true in the world of graphical user interfaces (&GUI;) such as &eg; &kde;.
+</para>
+<para>
+There have been attempts to provide similar mechanisms which will work on a higher application level, most notably <link linkend="unixdev-corba">CORBA</link> and, in the &kde; environment, <link linkend="unixdev-dcop">&DCOP;</link>.
+</para>
+
+<sect2 id="unixdev-corba">
+<title>The CORBA Protocol</title>
+
+<indexterm zone="unixdev-corba"><primary>CORBA</primary></indexterm>
+<indexterm zone="unixdev-corba">
+ <primary>scripting languages</primary>
+ <secondary>CORBA</secondary></indexterm>
+<indexterm zone="unixdev-corba">
+ <primary>communication</primary>
+ <secondary>CORBA</secondary></indexterm>
+
+<para>
+<ulink url="http://www.omg.org/gettingstarted/corbafaq.htm">CORBA</ulink> (<emphasis>Common Object Request Broker Architecture</emphasis>) is an attempt to let computer applications work together over networks. It was devised by the private, vendor independent <ulink url="http://www.omg.org">OMG</ulink> (Object Management Group) standards comittee.
+</para>
+<para>
+CORBA-based programs use the IIOP standard protocol to communicate. Implementations based on IIOP are available on a wide variety of operating systems, programming languages, and networks and are thus highly portable.
+</para>
+<para>
+The main drawback of CORBA is its rather low speed. While this may be tolerable in networks, it is a real hindrance for inter-application communications in a non-networked environment such as &kde; running on a single computer.
+</para>
+
+</sect2> <!-- unixdev-corba -->
+
+<sect2 id="unixdev-dcop">
+<title>The &DCOP; Interface</title>
+
+<indexterm zone="unixdev-dcop"><primary>DCOP</primary></indexterm>
+<indexterm zone="unixdev-dcop">
+ <primary>scripting languages</primary>
+ <secondary>DCOP</secondary></indexterm>
+<indexterm zone="unixdev-dcop">
+ <primary>communication</primary>
+ <secondary>DCOP</secondary></indexterm>
+
+<para>
+Another evolution on &UNIX;-like scripting is the <ulink url="http://developer.kde.org/documentation/library/kdeqt/dcop.html"><emphasis>DCOP</emphasis></ulink> protocol which was devised for communication between &kde; applications to overcome the limitations of CORBA.
+</para>
+<para>
+&DCOP; stands for <emphasis>Desktop Communication Protocol</emphasis> and is implemented as a simple IPC/RPC mechanism built to operate over sockets. In effect this provides facilities similar to the traditional &UNIX; pipe mechanism.
+</para>
+<para>
+Traditional shell scripting is based on fairly small tool programs which were designed to work on a strictly textual basis. &DCOP; allows elaborate graphical programs to communicate with each other in a quite similar way. This enables &eg; a &kde; program to send messages to another &kde; program, or receive data from it for its own purposes.
+</para>
+<para>
+There are drawbacks, however. To use &DCOP; a program must be designed to contain a special &DCOP; interface. And the &DCOP; communication process runs somewhat slowly (although a lot faster than CORBA). But it returns much of the power and flexibility of &UNIX; scripting to high-level programs which are based on a graphical user interface.
+</para>
+<para>
+For more information, see the <ulink url="http://developer.kde.org/documentation/library/kdeqt/dcop.html">DCOP: Desktop COmmunications Protocol</ulink> paper or <ulink url="developer.kde.org/documentation/library/cvs-api/dcop/html/index.html">The &DCOP; Desktop Communication Protocol library</ulink> &API; reference of the &kde; dcop library.
+</para>
+</sect2> <!-- unixdev-dcop -->
+
+</sect1> <!-- unixdev-hl-script -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="unixdev-buildsystems">
+<title>Build Systems</title>
+
+<para>
+Except in very simple cases a programming project will consist of a lot of building blocks of source code each put into a separate file for easier maintenance. To make this running one has to effectively translate all this stuff into a few machine language units in a suiting format which allows the operating system to load and execute the program.
+</para>
+<para>
+To accomplish this, the basic tools needed are
+<itemizedlist>
+ <listitem><para>
+ a <emphasis>text editor</emphasis> to write the source code files,
+ </para></listitem>
+ <listitem><para>
+ a translating program, usually a <emphasis>compiler</emphasis> to turn the source code into object files,
+ </para></listitem>
+ <listitem><para>
+ a <emphasis>librarian</emphasis> which collects object files into libraries to reuse them easily without the need to recompile,
+ </para></listitem>
+ <listitem><para>
+ a <emphasis>linker</emphasis> which binds several object files and libraries together into one executable,
+ </para></listitem>
+ <listitem><para>
+ a <emphasis>make system</emphasis> which provides some means to manage all this stuff and&mdash;not to forget
+ </para></listitem>
+ <listitem><para>
+ a <emphasis>debugger</emphasis> to (hopefully) find all errors in the program and possibly some other diagnostic tools to get everything running smoothly.
+ </para></listitem>
+</itemizedlist>
+</para>
+
+<para>
+When you have a large project consisting of possibly hundreds of source code files, the process of compiling may become quite laborsome. You do not want to recompile all files each time you have changed only some of them. Instead, you only want to compile those files which are affected by the changes. In general, it is not always easily obvious which of the files have to be recompiled.
+</para>
+<para>
+When you &eg; change a function prototype in a header file, you need to compile every file which includes this header file. If your project contains many such files you may easily miss one or two of them if you have to do the job manually. Thus some means of automization is necessary.
+</para>
+
+<sect2 id="unixdev-buildsystems-make">
+<title>The Make Process</title>
+
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>make</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>Makefile</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>rule</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>recompilations</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>target</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>dependencies</primary></indexterm>
+<indexterm zone="unixdev-buildsystems-make">
+ <primary>commands</primary></indexterm>
+
+<para>
+A tool which takes care of recompilations is <command>make</command>. It keeps track of all work using a set of <emphasis>rules</emphasis> which describe what to do in case some piece of information (usually a source or object code file) was changed. All rules belonging to a certain project are stored in a so-called <filename>Makefile</filename> which is processed by <command>make</command> any time you want to update your work.
+</para>
+<para>
+Each rule consists of several building blocks, namely
+<itemizedlist>
+ <listitem><para>
+ a <emphasis>target</emphasis>, &ie; the file to be built
+ </para></listitem>
+ <listitem><para>
+ a set of <emphasis>dependencies</emphasis>, basically the names of those files the target depends on (&eg; the name of a source file, where then the target will be the name of the object file to be built) and
+ </para></listitem>
+ <listitem><para>
+ the <emphasis>commands</emphasis> which are to be executed to <quote>make</quote> the target (&ie; to compile it or to link other object files together to build an executable progam file).
+ </para></listitem>
+</itemizedlist>
+</para>
+<para>
+Basically the <command>make</command> command will read the rules one after another, check each file in the dependency list of a given target and make this target anew if any one of these files has changed, using the commands listed in that rule.
+</para>
+<para>
+There are several additional possibilities to control such a make process, and a <filename>Makefile</filename> can thus grow very complex. We cannot go into the details here. However, we recommend that you make yourself accustomed to the syntax of <command>make</command>. Even if you do not normally use it directly, an understanding of the fundamentals of the build system can be useful. See the <ulink url="info://make/Top"> <quote>GNU Make Manual</quote></ulink> for more information. </para>
+<para>
+For more &kdevelop; specific detail see the <link linkend="project-management">Building and Project Management</link> chapter of this manual.
+</para>
+<para>
+There are several tutorials available, see the <link linkend="automake-references">references</link> in the Building and project management chapter.
+</para>
+</sect2> <!-- unixdev-buildsystems-make -->
+
+</sect1> <!-- unixdev-buildsystems -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="unixdev-guidevelopment">
+<title>&GUI; Development</title>
+
+<indexterm zone="unixdev-guidevelopment">
+ <primary>GUI</primary></indexterm>
+<indexterm zone="unixdev-guidevelopment">
+ <primary>graphical user interface</primary></indexterm>
+<indexterm zone="unixdev-guidevelopment">
+ <primary>user interface</primary>
+ <secondary>GUI</secondary></indexterm>
+
+<para>
+Application developers become even more encumbered by having not only to create program libraries and logic, but also to provide an easy to use custom built user interface that is both intuitive and functional. Most programmers receive little to no training in &GUI; development, and as a result user interfaces often are poorly designed.
+</para>
+<para>
+During the years some common design principles have evolved. It is strongly advised to adhere to them. This way your user interfaces will retain a common look and feel that the users of your application will gratefully appreciate.
+</para>
+<para>
+For &kde; &GUI; development there is a style guide available. It is found in the <ulink url="http://developer.kde.org/documentation/standards/kde/style/basics/index.html">&kde; User Interface Guidelines</ulink> on the &kde; Developer's Corner page.
+</para>
+<para>
+A short introduction to common &GUI; design principles can be found <ulink url="http://axp16.iie.org.mx/Monitor/v01n03/ar_ihc2.htm">here</ulink>.
+</para>
+
+</sect1> <!-- unixdev-guidevelopment -->
+
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+<sect1 id="unixdev-ide">
+<title>Integrating Concepts and Tools &ndash; the IDE</title>
+
+<indexterm zone="unixdev-ide">
+ <primary>IDE</primary></indexterm>
+<indexterm zone="unixdev-ide">
+ <primary>integrated development environment</primary></indexterm>
+<indexterm zone="unixdev-ide">
+ <primary>development</primary>
+ <secondary>IDE</secondary></indexterm>
+<indexterm zone="unixdev-ide">
+ <primary>environment</primary>
+ <secondary>IDE</secondary></indexterm>
+
+<para>
+There are separate tools available for almost any step in the programming process&mdash;planning, editing, managing files and compilation processes, debugging, documentation and the like. But once the projects grow the programming processes will most likely become quite cumbersome.
+</para>
+<para>
+Much repetitive work has to be done when designing, compiling, and debugging a program. A lot of such work can be saved through the use of templates and scripts. And another lot by keeping these tools easily available and able to communicate with each other under a common &GUI;.
+</para>
+<para>
+For example&mdash;would it not be convenient if a debugger were able to open the source file in question in an editor and place the cursor directly at the position of that bug just found?
+</para>
+<para>
+To more easily accomplish such a scheme, <emphasis>Integrated Development Environments</emphasis> (&IDE;s) were devised. Such an &IDE; integrates all templates, tools, and scripts which are commonly needed in the development process into one single environment.
+</para>
+<para>
+For the &kde; platform &kdevelop; is such an &IDE;. It provides a wide range of tools which ease program development and maintenance, even for different programming languages and across platforms.
+</para>
+
+<sect2 id="unixdev-ide-kdevelop">
+<title>Basic Features of &kdevelop; &kdevrelease;</title>
+
+<indexterm zone="unixdev-ide-kdevelop">
+ <primary>&kdevelop;</primary>
+ <secondary>features</secondary></indexterm>
+<indexterm zone="unixdev-ide-kdevelop">
+ <primary>features</primary></indexterm>
+
+<!-- ### copied from web page, needs to be updated -->
+
+<itemizedlist>
+ <listitem>
+ <para>Manages all <emphasis>development tools</emphasis> needed for C++ programming, such as compiler, linker, debugger and build system.</para>
+ </listitem>
+ <listitem>
+ <para>Provides an <emphasis>&appwizard;</emphasis> which generates complete, ready-to-go sample applications.</para>
+ </listitem>
+ <listitem>
+ <para>Allows the user to select an <emphasis>integrated editor</emphasis> based on the &kde; programmer's editor &kwrite;, Trolltec's <application>QEditor</application>, or others.</para>
+ </listitem>
+ <listitem>
+ <para>A <emphasis>class generator</emphasis>, for creating new classes and integrating them into the current project.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>File management</emphasis> for sources, headers, documentation &etc; to be included in the project.</para>
+ </listitem>
+ <listitem>
+ <para>Assistance in <emphasis>creating application user manuals</emphasis> written with &kde; tools.</para>
+ </listitem>
+ <listitem>
+ <para>Automatic &HTML; based <emphasis>&API; documentation</emphasis> for a project's classes with cross-references to the used libraries.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Internationalization support</emphasis>, allowing translators to add their target language to a project easily, including support for &kbabel;.</para>
+ </listitem>
+ <listitem>
+ <para>Support for managing a project via one of several <emphasis>versioning systems</emphasis> (&eg; &CVS;) by providing an easy-to-use frontend for the most needed functions.</para>
+ </listitem>
+ <listitem>
+ <para>An integrated <emphasis>debugger</emphasis> frontend.</para>
+ </listitem>
+ <listitem>
+ <para>An integrated <emphasis>shell console</emphasis> emulator.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Syntax highlighting</emphasis> in source texts.</para>
+ </listitem>
+ <listitem>
+ <para>An <emphasis>auto-code completion</emphasis> facility for class variables, class methods, function arguments and more.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Templates for creating various projects</emphasis> (&kcontrol; modules, &kicker; (panel) applets, KIOSlaves, &konqueror; plugins and desktop styles).</para>
+ </listitem>
+ <listitem>
+ <para>Four <emphasis>navigation tree views</emphasis> for easily switching between source files, header files, classes and documentation, obviating the need for an external file manager.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Cross-compiling support</emphasis>, with the ability to specify different compilers, compiler flags, target architecture, &etc;</para>
+ </listitem>
+ <listitem>
+ <para>Support for <emphasis>Qt/Embedded projects</emphasis> (such as the Zaurus and iPAQ).</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Inclusion of any other program</emphasis> you need for development by adding it to the <guimenuitem>Tools</guimenuitem> menu according to your individual needs.</para>
+ </listitem>
+</itemizedlist>
+
+</sect2> <!-- unixdev-ide-kdevelop -->
+
+</sect1> <!-- unixdev-ide -->
+
+</appendix> <!-- unixdev -->
+
diff --git a/doc/kdevelop/wrong-project-location.png b/doc/kdevelop/wrong-project-location.png
new file mode 100644
index 00000000..cb9c45a2
--- /dev/null
+++ b/doc/kdevelop/wrong-project-location.png
Binary files differ
diff --git a/doc/platform/Mainpage.dox b/doc/platform/Mainpage.dox
new file mode 100644
index 00000000..dd69ba92
--- /dev/null
+++ b/doc/platform/Mainpage.dox
@@ -0,0 +1,148 @@
+/** \file Mainpage.dox
+ \brief The main page of the doxygen generated %API Documentation
+*/
+
+/**
+\mainpage The KDevelop Platform %API %Documentation
+
+
+KDevelop Platform is set of libraries and tools that are used to build IDEs (Integrated Development Environments),
+applications similar to IDEs (web development enviroment, text editors for programmers and designers, etc.)
+and/or IDE plugins for all possible purposes.
+
+Platform provides:
+- the plugin architecture (interfaces);
+- the common support libraries;
+- the generic shell with plugin profiles support.
+.
+
+\section intro Introduction
+
+This document is targeted at all those that want to build their own IDE or improve KDevelop's source code.
+If you are instead looking for a user manual, just go to the help menu of your KDevelop and select KDevelop handbook.
+This documentation contains the KDevelop Platform online class reference for the current
+development version of KDevelop. Additionally, you
+can subscribe or read the <a href="http://www.kdevelop.org/index.html?filename=mailinglist.html">mailing list</a> for any additions and/or
+modifications to the Platform %API.
+
+An on-line, updated every 24H, html version of this documentation can be found at: http://www.kdevelop.org/HEAD/doc/platform/html/index.html
+
+You can also download a local browseable copy form http://www.kdevelop.org/HEAD/doc/platform/kdevplatformdoc.tar.bz2 . It gets updated every single day too.
+
+More information about the KDevelop Platform architecture in form of tutorials, Wikis, HOWTOs,
+and FAQs can be found at
+the <a href="http://www.kdevelop.org">KDevelop website</a>.
+
+Quick overviews of the architecture can also be found in the issues of <a href="http://www.kdevelop.org/doc/tehcnotes">
+KDevelop Technotes</a>.
+
+\section platformapi Platform Libraries API
+
+- <a href="kdevinterfaces/html/index.html"><b>Interfaces Library</b></a>
+ (<a href="kdevinterfaces/html/classes.html">classes</a>)\n
+ <i>Interfaces and classes that form KDevelop plugin architecture.</i>
+- <a href="kdevextensions/html/index.html"><b>Extension Interfaces Library</b></a>
+ (<a href="kdevextensions/html/classes.html">classes</a>)\n
+ <i>Extension interfaces used by KDevelop plugin architecture.</i>
+- <a href="kdevutil/html/index.html"><b>Utility Library</b></a>
+ (<a href="kdevutil/html/classes.html">classes</a>)\n
+ <i>Utility classes for the KDevelop architecture.</i>
+- <a href="kdevextras/html/index.html"><b>Extra Interfaces Library</b></a>
+ (<a href="kdevextras/html/classes.html">classes</a>)\n
+ <i>Extra interfaces that are not the part of KDevelop plugin architecture
+ but that can be implemented by extra plugins or "plugins for plugins".</i>
+- <a href="kdevwidgets/html/index.html"><b>Widgets Library</b></a>
+ (<a href="kdevwidgets/html/classes.html">classes</a>)\n
+ <i>A collection of widgets.</i>
+- <a href="propeditor/html/index.html"><b>Property Editing Library</b></a>
+ (<a href="propeditor/html/classes.html">classes</a>)\n
+ <i>A collection of facilities to store and edit the properties of various objects.</i>
+- <a href="kdevcatalog/html/index.html"><b>Catalog Library</b></a>
+ (<a href="kdevcatalog/html/classes.html">classes</a>)\n
+ <i>The persistant symbol store library working with BerkeleyDb backend.</i>
+.
+
+\section designerapi GUI Designer Integration API
+
+- <a href="external/html/index.html"><b>KInterfaceDesigner Library</b></a>
+ (<a href="external/html/classes.html">classes</a>)\n
+ <i>KInterfaceDesigner classes and interfaces which form the core of GUI Designer integration framework.</i>
+- <a href="designer_integration/html/index.html"><b>Designer Integration Support Library</b></a>
+ (<a href="designer_integration/html/classes.html">classes</a>)\n
+ <i>The base classes to implement GUI designer integration in language support plugins.</i>
+.
+
+\section pluginsapi Platform Plugins API
+
+- <a href="kdevdocinterfaces/html/index.html"><b>Documentation Part Interfaces Library</b></a>
+ (<a href="kdevdocinterfaces/html/classes.html">classes</a>)\n
+ <i>Interfaces to implement KDevelop documentation plugins.</i>
+.
+
+\section langapi Programming Language Support API
+
+- <a href="kdevlanginterfaces/html/index.html"><b>Language Support Interfaces Library</b></a>
+ (<a href="kdevlanginterfaces/html/classes.html">classes</a>)\n
+ <i>Interfaces for KDevelop language support facilities.</i>
+- <a href="kdevlangdebugger/html/index.html"><b>Debugger Support Library</b></a>
+ (<a href="kdevlangdebugger/html/classes.html">classes</a>)\n
+ <i>Classes to implement debugger support for a programming language.</i>
+.
+
+\section buildtoolapi Buildtool Support API
+
+- <a href="kdevbtbase/html/index.html"><b>Buildtool Base Library</b></a>
+ (<a href="kdevbtbase/html/classes.html">classes</a>)\n
+ <i>Base classes for KDevelop builtool support plugins.</i>
+- <a href="kdevpminterfaces/html/index.html"><b>Project Manager Interfaces Library</b></a>
+ (<a href="kdevpminterfaces/html/classes.html">classes</a>)\n
+ <i>Interfaces to implement plugins for the KDevelop generic project manager.</i>
+- <a href="kdevbtwidgets/html/index.html"><b>Buildtool Widgets Library</b></a>
+ (<a href="kdevbtwidgets/html/classes.html">classes</a>)\n
+ <i>Widgets commonly used in buildtool support plugins.</i>
+- <a href="kdevparserautotools/html/index.html"><b>Autotools parser Library</b></a>
+ (<a href="kdevparserautotools/html/classes.html">classes</a>)\n
+ <i>Parser for Autotools based support plugins.</i>
+- <a href="kdevparserqmake/html/index.html"><b>QMake parser Library</b></a>
+ (<a href="kdevparserqmake/html/classes.html">classes</a>)\n
+ <i>Parser for QMake based support plugins.</i>
+.
+
+\section shellapi Shell API
+
+- <a href="kdevshellsrc/html/index.html"><b>Generic Shell</b></a>
+ (<a href="kdevshellsrc/html/classes.html">classes</a>)\n
+ <i>The Shell - a profile-based implementation of KDevelop plugin architecture.</i>
+- <a href="kdevprofileslib/html/index.html"><b>Shell Profiles Library</b></a>
+ (<a href="kdevprofileslib/html/classes.html">classes</a>)\n
+ <i>Plugin profiles implementation for KDevelop shell.</i>
+.
+
+\section PlannedTasks Planned tasks
+
+Here is a priority ordered list:
+ -# fix the dispersed fixme
+ -# <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=bugs.bug_id">reported bugs in bugzilla database</a>
+ -# fix the dispersed todo all over the code.
+ .
+
+\section howTobuildAPIlocalcopy How to build a local copy of this documentation
+
+This documentation is large and changes with every cvs commit, therefore is not available for download.
+To build your local copy of this documentation you need to fetch KDevelop sources and
+if you have doxygen >= 1.3.4 and (optionally) PHP >= 4.10 plus a local running webserver then
+- make apidox
+- make install-apidox (as root)
+.
+
+The advantage of the webserver is that you'll get a search engine in your documentation if you read your
+documentation using your local webserver.
+
+\section License
+
+Permission is granted to copy, distribute and/or modify this document under
+the terms of the GNU Free %Documentation License, Version 1.2 or any later
+version published by the Free Software Foundation; For details see
+http://www.gnu.org/copyleft/fdl.html .
+
+*/
diff --git a/doc/std/Makefile.am b/doc/std/Makefile.am
new file mode 100644
index 00000000..07f12cde
--- /dev/null
+++ b/doc/std/Makefile.am
@@ -0,0 +1,7 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = kdev3api.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
+
diff --git a/doc/std/kdev3api.toc b/doc/std/kdev3api.toc
new file mode 100644
index 00000000..28d9cf3a
--- /dev/null
+++ b/doc/std/kdev3api.toc
@@ -0,0 +1,45 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>KDevelop API Documentation</title>
+<base href="http://www.kdevelop.org/HEAD/doc/api/html"/>
+<tocsect1 name="Overview" url="index.html">
+ <tocsect2 name="KDevelop 3 Architecture" url="KDev3Arch.html"/>
+ <tocsect2 name="Programming Languages Status" url="LangSupportStatus.html"/>
+ <tocsect2 name="Editors Status" url="EditorsSupportStatus.html"/>
+</tocsect1>
+<tocsect1 name="How to" url="index.html#expand">
+ <tocsect2 name="Extend KDevelop via plugins" url="howToAddPlugins.html"/>
+ <tocsect2 name="Add a programming language" url="howToAddProgrammingLanguages.html"/>
+ <tocsect2 name="Add application templates" url="howToAddApplicationTemplates.html"/>
+ <tocsect2 name="Add file templates" url="howToAddFileTemplates.html"/>
+ <tocsect2 name="Add generic build tools" url="howToAddGenericBuildTools.html"/>
+ <tocsect2 name="Document KDevelop parts" url="howToDocument.html"/>
+</tocsect1>
+<tocsect1 name="Planned tasks" url="index.html#PlannedTasks">
+ <tocsect2 name="High priority tasks!" url="HighPriTasks.html"/>
+ <tocsect2 name="Future Tasks!" url="FutureTasks.html"/>
+</tocsect1>
+<tocsect1 name="Class Hierarchy" url="hierarchy.html">
+</tocsect1>
+<tocsect1 name="Classes" url="classes.html">
+</tocsect1>
+<tocsect1 name="Classes (annotated)" url="annotated.html">
+</tocsect1>
+<tocsect1 name="Members" url="functions.html">
+</tocsect1>
+<tocsect1 name="Namespaces" url="namespaces.html">
+</tocsect1>
+<tocsect1 name="Source Files" url="files.html">
+</tocsect1>
+<tocsect1 name="README.dox" url="index.html#misc">
+ <tocsect2 name="Requirements" url="requirements.html"/>
+ <tocsect2 name="Features" url="features.html"/>
+ <tocsect2 name="Authors" url="authors.html"/>
+ <tocsect2 name="Maintainers" url="maintainers.html"/>
+ <tocsect2 name="Unmaintained parts" url="unmaintained.html"/>
+ <tocsect2 name="Deprecated List" url="deprecated.html"/>
+ <tocsect2 name="Todo List" url="todo.html"/>
+ <tocsect2 name="Known Bugs" url="bug.html"/>
+ <tocsect2 name="F.A.Q." url="FAQ.html"/>
+</tocsect1>
+</kdeveloptoc>
diff --git a/doc/tools/Makefile.am b/doc/tools/Makefile.am
new file mode 100644
index 00000000..4eb7f5af
--- /dev/null
+++ b/doc/tools/Makefile.am
@@ -0,0 +1,4 @@
+EXTRA_DIST = index-texi index-python index.xsl \
+ toc-gsdoc toc-docbook toc-python
+
+
diff --git a/doc/tools/index-python b/doc/tools/index-python
new file mode 100644
index 00000000..96cfcd8f
--- /dev/null
+++ b/doc/tools/index-python
@@ -0,0 +1,52 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+
+my $prefix = '';
+GetOptions( 'prefix=s' => \$prefix ) || die "Wrong options\n";
+
+$file = $ARGV[0];
+open(FILE, "$file") || die "File not found: $file\n";
+
+print "<conceptindex>\n";
+
+$ingroup = 0;
+while (<FILE>) {
+
+ if (/\<dt\>\<a href=\'(.+)'\>(.+)\<\/a\>/) {
+# print "Index: $1, $2, $ingroup\n";
+ if ($ingroup) {
+ $name = "$ingroup, $2";
+ } else {
+ $name = $2;
+ }
+ $url = "$prefix/$1";
+ print "<entry name=\"$name\" url=\"$url\"/>\n";
+ } elsif (/\<dt\>(.+)/) {
+# print "Ingroup: $1\n";
+ $ingroup = $1;
+ } elsif (/\s+\<\/dl>/) {
+ $ingroup = 0;
+ }
+}
+
+print "</conceptindex>\n";
+close(FILE);
+
+
+sub dehtml
+{
+ my ( $str ) = @_;
+
+ $str =~ s/\<CODE\>//g;
+ $str =~ s/\<\/CODE\>//g;
+ $str =~ s/\<TT\>//g;
+ $str =~ s/\<\/TT\>//g;
+
+ return $str;
+}
+
+# Local Variables:
+# mode: perl
+# fill-column: 120
+# End:
diff --git a/doc/tools/index-texi b/doc/tools/index-texi
new file mode 100755
index 00000000..8aa85184
--- /dev/null
+++ b/doc/tools/index-texi
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+
+GetOptions( 'map=s' => \%mapping ) || die "Wrong options\n";
+
+for $file (@ARGV) {
+
+ open(FILE, "$file") || die "File not found: $file\n";
+
+ $indir = 0;
+
+ while (<FILE>) {
+
+ if (/\<H1\>\<A NAME=\".*\" HREF=\".*\"\>(.*)\<\/A\>\<\/H1\>/) {
+ $index = $mapping{$1};
+# print "Index: $1 => $index\n";
+ } elsif (/\<DIR\>/) {
+ $indir = 1;
+ } elsif (/\<\/DIR>/) {
+ $indir = 0;
+ } elsif ($indir) {
+ if (/\<LI\>\<A HREF=\"([^\"]*)\"\>([^<]*)\<\/A\>/) {
+ unless ($lastindex eq $index) {
+ if ($lastindex) {
+ print "</$lastindex>\n";
+ }
+ print "<$index>\n";
+ $lastindex = $index;
+ }
+ $name = dehtml($2);
+ $url = $1;
+ print STDOUT "<entry name=\"$name\" url=\"$url\"/>\n";
+ }
+ }
+ }
+
+ close(FILE);
+}
+
+if ($lastindex) {
+ print "</$lastindex>\n";
+}
+
+sub dehtml
+{
+ my ( $str ) = @_;
+
+ $str =~ s/\<CODE\>//g;
+ $str =~ s/\<\/CODE\>//g;
+ $str =~ s/\<TT\>//g;
+ $str =~ s/\<\/TT\>//g;
+
+ return $str;
+}
+
+# Local Variables:
+# mode: perl
+# fill-column: 120
+# End:
diff --git a/doc/tools/index.xsl b/doc/tools/index.xsl
new file mode 100644
index 00000000..8d3d0a52
--- /dev/null
+++ b/doc/tools/index.xsl
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output omit-xml-declaration="yes"/>
+
+<xsl:template match="/"><xsl:apply-templates/></xsl:template>
+
+<xsl:template match="text()|@*"></xsl:template>
+
+<xsl:template match="chapter">
+ <xsl:variable name="url" select="@id"/>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="chapter/section[position()!=1]">
+ <xsl:variable name="url" select="@id"/>
+ <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="indexterm">
+ <xsl:choose>
+ <xsl:when test="./secondary and ./tertiary">
+ <entry name="{primary}, {secondary}, {tertiary}" url="{$url}.html"/>
+ </xsl:when>
+ <xsl:when test="./secondary">
+ <entry name="{primary}, {secondary}" url="{$url}.html"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <entry name="{primary}" url="{$url}.html"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/tools/toc-docbook b/doc/tools/toc-docbook
new file mode 100644
index 00000000..6d16f9b3
--- /dev/null
+++ b/doc/tools/toc-docbook
@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2001 by Claudiu Costin
+# <claudiuc@work.ro>
+#
+# 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.
+
+use Getopt::Long;
+
+my $prefix = '';
+my $depth = 1;
+GetOptions( 'prefix=s' => \$prefix,
+ 'depth=i' => \$depth ) || die "Wrong options\n";
+
+$initialdepth = $depth;
+$b3=$b2=$b1="";
+$in_processing=0;
+while (<>) {
+ chop;
+
+ if (/Table of Contents<\/B/) {
+ $in_processing=1;
+ next;
+ }
+ last if (/List of Tables/);
+ next if (!$in_processing);
+
+ if (/HREF=\"(.+)\"/) {
+ $url = $1;
+ }
+ if (/>(.+)<\/A/) {
+ $name=$1;
+ $name =~ s/\"/&quote;/g;
+ $name =~ s/&#8212;/-/g;
+ $name =~ s/^\s*-?\s*//g;
+ $name =~ s/\.$//g;
+# print "NAME $name\n";
+ }
+
+ if ($b3 =~ /><DL/i) {
+ $depth++;
+ $b3=$b2;
+ $b2=$b1;
+ $b1=$_;
+ next;
+ }
+ if ($b3 =~ /><\/DL/i) {
+ $depth--;
+ print " "x($depth-1) . "</tocsect${depth}>\n" if ($depth != $initialdepth-1);
+ $b3=$b2;
+ $b2=$b1;
+ $b1=$_;
+ next;
+ }
+
+ if ($b3 =~ />.*<\/DT/i && $name ne "" && $url ne "") {
+ if ($b1 =~ /><DL/i) {
+ print " "x($depth-1) . "<tocsect${depth} name=\"$name\" url=\"$url\">\n";
+ } else {
+ print " "x($depth-1) . "<tocsect${depth} name=\"$name\" url=\"$url\"/>\n";
+ }
+ }
+
+ # a simulated delay line with 6 cells
+ $b3=$b2;
+ $b2=$b1;
+ $b1=$_;
+}
diff --git a/doc/tools/toc-gsdoc b/doc/tools/toc-gsdoc
new file mode 100644
index 00000000..69785d91
--- /dev/null
+++ b/doc/tools/toc-gsdoc
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+
+my $prefix = '';
+GetOptions( 'title=s' => \$title,
+ 'main=s' => \$main ) || die "Wrong options\n";
+
+$file = $ARGV[0];
+open(FILE, "$file") || die "File not found: $file\n";
+
+print "<tocsect1 name=\"$title\" url=\"$main.html\">\n";
+
+while (<FILE>) {
+
+ if (/\<item\>\<uref url=\"(.+)\.html\"\>(.+)\<\/uref\>\<\/item\>/) {
+ $name = $1;
+ $url = "$1.html";
+ print " <tocsect2 name=\"$name\" url=\"$url\"/>\n";
+ }
+
+}
+
+print "</tocsect1>\n";
diff --git a/doc/tools/toc-python b/doc/tools/toc-python
new file mode 100644
index 00000000..c91cdcf2
--- /dev/null
+++ b/doc/tools/toc-python
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+
+my $prefix = '';
+GetOptions( 'prefix=s' => \$prefix,
+ 'title=s' => \$title,
+ 'main=s' => \$main ) || die "Wrong options\n";
+
+$file = $ARGV[0];
+open(FILE, "$file") || die "File not found: $file\n";
+
+$prevdepth = 1;
+$depth = 1;
+print "<tocsect${depth} name=\"$title\" url=\"$main.html\"";
+
+while (<FILE>) {
+
+ if (/^\s*href/ && !/.*\<\/A\>$/i) {
+ chop;
+ $_ = $_ . <FILE>;
+ }
+ if (/\<UL\>/i) {
+ $depth++;
+ } elsif (/\<\/UL\>/i) {
+ print "/" if ($prevdepth == $depth);
+ $depth--;
+ print ">\n</tocsect${depth}";
+ } elsif (/^\s*href=\"([^\"]+)\"\>(.+)\<\/A\>$/i) {
+ $url = "$prefix/$1";
+ $name = dehtml($2);
+ $name =~ s/\s+/ /g;
+ print "/" if ($prevdepth == $depth);
+ print ">\n<tocsect${depth} name=\"$name\" url=\"$url\"";
+ $prevdepth = $depth;
+ }
+}
+
+print ">\n";
+close(FILE);
+
+sub dehtml
+{
+ my ( $str ) = @_;
+
+ $str =~ s/\<(tt|b) class=\"([^\"]*)\"\>//g;
+ $str =~ s/\<\/(tt|b)\>//g;
+ $str =~ s/\<i\>//g;
+ $str =~ s/\<\/i\>//g;
+
+ return $str;
+}
+
+# Local Variables:
+# mode: perl
+# fill-column: 120
+# End:
diff --git a/doc/tools/toc-texi b/doc/tools/toc-texi
new file mode 100755
index 00000000..2be48fa6
--- /dev/null
+++ b/doc/tools/toc-texi
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2001 by Claudiu Costin
+# <claudiuc@work.ro>
+#
+# 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.
+
+$depth=0;
+$buffer="";
+
+while (<>) {
+ chop;
+
+ if ($buffer =~ /<ul>/i) {
+ $depth++;
+ $buffer = $_;
+ next;
+ }
+ if ($buffer =~ /<\/ul>/i) {
+ $depth--;
+ print " "x($depth-1) . "</tocsect${depth}>\n" if ($depth != 0);
+ $buffer = $_;
+ next;
+ }
+
+ if ($buffer =~ /<li>/i) {
+ $buffer =~ /HREF=\"([^\"]+)\"/;
+ $url=$1;
+ $buffer =~ /\">(.+)<\/A>/;
+ $text=$1;
+ $text =~ s/<tt>//gi;
+ $text =~ s/<\/tt>//gi;
+ $text =~ s/<CODE>//gi;
+ $text =~ s/<\/CODE>//gi;
+ $text =~ s/<BR>//gi;
+ if (/<ul>/i) {
+ print " "x($depth-1) . "<tocsect${depth} name=\"$text\" url=\"$url\">\n";
+ } else {
+ print " "x($depth-1) . "<tocsect${depth} name=\"$text\" url=\"$url\"/>\n";
+ }
+ }
+ # a simulated delay line with one cell
+ $buffer = $_;
+}
diff --git a/editors/Makefile.am b/editors/Makefile.am
new file mode 100644
index 00000000..ae0c79eb
--- /dev/null
+++ b/editors/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = editor-chooser
diff --git a/editors/editor-chooser/Makefile.am b/editors/editor-chooser/Makefile.am
new file mode 100644
index 00000000..2cdf58a6
--- /dev/null
+++ b/editors/editor-chooser/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdeveditorchooser.la
+libkdeveditorchooser_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdeveditorchooser_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdeveditorchooser_la_SOURCES = editorchooser_part.cpp editchooser.ui editorchooser_widget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdeveditorchooser.desktop
+
diff --git a/editors/editor-chooser/README.dox b/editors/editor-chooser/README.dox
new file mode 100644
index 00000000..4dea700d
--- /dev/null
+++ b/editors/editor-chooser/README.dox
@@ -0,0 +1,8 @@
+/** \class EditorChooserPart
+Chooses the text editor to use in KDevelop from a list of all KTextEditor Class interface compliant editors installed in KDE.
+
+\authors <a href="mailto:hoelzer AT physik.uni-wuerzburg.de">Matthias Hoelzer</a>
+
+\feature Chooses the text editor to use in KDevelop from a list of all KTextEditor Class interface compliant editors installed in KDE.
+
+*/
diff --git a/editors/editor-chooser/editchooser.ui b/editors/editor-chooser/editchooser.ui
new file mode 100644
index 00000000..66f46b59
--- /dev/null
+++ b/editors/editor-chooser/editchooser.ui
@@ -0,0 +1,130 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EditChooser</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>EditChooser</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>514</width>
+ <height>383</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Embedded Editor</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="0" column="0">
+ <property name="name">
+ <cstring>EditorPart</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;i&gt;Note:&lt;/i&gt; Changing the preferred editor will not affect
+already open files.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>external_changes_group</cstring>
+ </property>
+ <property name="title">
+ <string>On External Changes</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;p&gt;&lt;b&gt;Action to take when an open file is changed on disk&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;&lt;b&gt;Do nothing&lt;/b&gt; - The file will be marked as externally changed and the user will be asked to verify any attempt to overwrite it &lt;/p&gt;
+&lt;p&gt;&lt;b&gt;Alert the user&lt;/b&gt; - A dialog will alert the user that a file has changed and offer the user to reload the file&lt;/p&gt;
+&lt;p&gt;&lt;b&gt;Automatically reload&lt;/b&gt; - Any files that are not modified in memory are reloaded, and an alert is shown for any conflicts&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>nothing</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do nothing</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>alert</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Alert the user</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>reload</cstring>
+ </property>
+ <property name="text">
+ <string>Automatically reload the file &amp;if safe, alert the user if not</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <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>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>EditorPart</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditChooser</receiver>
+ <slot>slotEditPartChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>slotEditPartChanged(const QString &amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/editors/editor-chooser/editorchooser_part.cpp b/editors/editor-chooser/editorchooser_part.cpp
new file mode 100644
index 00000000..f11a540b
--- /dev/null
+++ b/editors/editor-chooser/editorchooser_part.cpp
@@ -0,0 +1,42 @@
+#include <qvbox.h>
+
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdialogbase.h>
+#include <kdevgenericfactory.h>
+
+#include <kdevcore.h>
+#include <kdevplugininfo.h>
+
+#include "editorchooser_part.h"
+#include "editorchooser_widget.h"
+
+typedef KDevGenericFactory<EditorChooserPart> EditorChooserFactory;
+static const KDevPluginInfo data("kdeveditorchooser");
+K_EXPORT_COMPONENT_FACTORY( libkdeveditorchooser, EditorChooserFactory( data ) )
+
+EditorChooserPart::EditorChooserPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "EditorChooserPart")
+{
+ setInstance(EditorChooserFactory::instance());
+
+ connect(core(), SIGNAL(configWidget(KDialogBase*)), this, SLOT(configWidget(KDialogBase*)));
+}
+
+
+EditorChooserPart::~EditorChooserPart()
+{
+}
+
+
+void EditorChooserPart::configWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Editor"), i18n("Editor"), BarIcon("kate", KIcon::SizeMedium) );
+ EditorChooserWidget *w = new EditorChooserWidget(vbox);
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+}
+
+
+
+#include "editorchooser_part.moc"
diff --git a/editors/editor-chooser/editorchooser_part.h b/editors/editor-chooser/editorchooser_part.h
new file mode 100644
index 00000000..15cb2f97
--- /dev/null
+++ b/editors/editor-chooser/editorchooser_part.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2001 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_EDITORCHOOSER_H__
+#define __KDEVPART_EDITORCHOOSER_H__
+
+
+class KDialogBase;
+
+
+#include <kdevplugin.h>
+
+
+class EditorChooserPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ EditorChooserPart(QObject *parent, const char *name, const QStringList &);
+ ~EditorChooserPart();
+
+
+private slots:
+
+ void configWidget(KDialogBase *dlg);
+
+};
+
+
+#endif
diff --git a/editors/editor-chooser/editorchooser_widget.cpp b/editors/editor-chooser/editorchooser_widget.cpp
new file mode 100644
index 00000000..6c9f7071
--- /dev/null
+++ b/editors/editor-chooser/editorchooser_widget.cpp
@@ -0,0 +1,132 @@
+#include <qcombobox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+
+#include <kapplication.h>
+#include <kdeversion.h>
+#include <kservice.h>
+#include <kdebug.h>
+#include <kconfig.h>
+
+
+#include "editorchooser_widget.h"
+
+
+EditorChooserWidget::EditorChooserWidget(QWidget *parent, const char *name)
+ : EditChooser(parent, name)
+{
+ // ask the trader which editors he has to offer
+ m_offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes");
+
+ // remove the vim-part, it's known to crash
+ KTrader::OfferList::Iterator it = m_offers.begin();
+ while( it != m_offers.end() )
+ {
+ if ( ((*it)->desktopEntryName() == "vimpart")
+ || ((*it)->desktopEntryName() == "qeditor_part") )
+ {
+ m_offers.remove( it );
+ break;
+ }
+ ++it;
+ }
+
+ load();
+ slotEditPartChanged(QString());
+}
+
+
+void EditorChooserWidget::load()
+{
+ EditorPart->clear();
+
+ // find the editor to use
+ KConfig *config = kapp->config();
+ config->setGroup("Editor");
+ QString editor = config->readPathEntry("EmbeddedKTextEditor");
+
+ // add the entries to the listview
+ KTrader::OfferList::Iterator it;
+ int index=-1, current=0;
+ for (it = m_offers.begin(); it != m_offers.end(); ++it)
+ {
+ EditorPart->insertItem((*it)->name());
+ if ( (*it)->desktopEntryName() == editor )
+ index = current;
+ ++current;
+ }
+
+ if (index >=0)
+ EditorPart->setCurrentItem(index);
+
+ QString dirtyAction = config->readEntry( "DirtyAction" );
+
+ if ( dirtyAction == "reload" )
+ {
+ reload->setChecked( true );
+ }
+ else if ( dirtyAction == "alert" )
+ {
+ alert->setChecked( true );
+ }
+ else
+ {
+ nothing->setChecked( true );
+ }
+}
+
+
+void EditorChooserWidget::save()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Editor");
+
+ KTrader::OfferList::Iterator it;
+ for (it = m_offers.begin(); it != m_offers.end(); ++it)
+ if ( EditorPart->currentText() == (*it)->name() )
+ {
+ config->writePathEntry("EmbeddedKTextEditor", (*it)->desktopEntryName());
+ }
+
+ if ( reload->isChecked() )
+ {
+ config->writeEntry( "DirtyAction", "reload" );
+ }
+ else if ( alert->isChecked() )
+ {
+ config->writeEntry( "DirtyAction", "alert" );
+ }
+ else
+ {
+ config->writeEntry( "DirtyAction", "nothing" );
+ }
+
+ config->sync();
+}
+
+
+void EditorChooserWidget::accept()
+{
+ save();
+}
+
+void EditorChooserWidget::slotEditPartChanged( const QString & )
+{
+ KTrader::OfferList::Iterator it;
+ for (it = m_offers.begin(); it != m_offers.end(); ++it)
+ {
+ if ( EditorPart->currentText() == (*it)->name() )
+ {
+ external_changes_group->setEnabled( (*it)->desktopEntryName() == "katepart" );
+ return;
+ }
+ }
+ external_changes_group->setEnabled( false );
+}
+
+
+#include "editorchooser_widget.moc"
+
+
+
+
diff --git a/editors/editor-chooser/editorchooser_widget.h b/editors/editor-chooser/editorchooser_widget.h
new file mode 100644
index 00000000..1688b5c0
--- /dev/null
+++ b/editors/editor-chooser/editorchooser_widget.h
@@ -0,0 +1,39 @@
+#ifndef __EDITORCHOOSER_WIDGET_H__
+#define __EDITORCHOOSER_WIDGET_H__
+
+
+#include <qwidget.h>
+#include <ktrader.h>
+
+#include "editchooser.h"
+
+
+class EditorChooserWidget : public EditChooser
+{
+ Q_OBJECT
+
+public:
+
+ EditorChooserWidget(QWidget *parent=0, const char *name=0);
+
+public slots:
+ virtual void slotEditPartChanged(const QString &);
+
+private slots:
+
+ void load();
+ void save();
+
+ void accept();
+
+private:
+ KTrader::OfferList m_offers;
+
+};
+
+
+#endif
+
+
+
+
diff --git a/editors/editor-chooser/kdeveditorchooser.desktop b/editors/editor-chooser/kdeveditorchooser.desktop
new file mode 100644
index 00000000..691c538a
--- /dev/null
+++ b/editors/editor-chooser/kdeveditorchooser.desktop
@@ -0,0 +1,91 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a dialog for Editor selection.
+Comment[ca]=Proporciona un diàleg per a la selecció de l'Editor.
+Comment[da]=Sørger for en dialog til editor-valg.
+Comment[de]=Editor-Auswahl für KDevelop.
+Comment[el]=Παρέχει ένα διάλογο για επιλογή επεξεργαστή.
+Comment[en_GB]=Provides a dialogue for Editor selection.
+Comment[es]=Proporciona un diálogo para la selección de un editor.
+Comment[et]=Dialoog redaktori valimiseks.
+Comment[eu]=Editorearen hautapenerako elkarrizketa-koadroa eskeintzen du.
+Comment[fa]=محاوره‌ای برای گزینش ویرایشگر فراهم می‌کند.
+Comment[fr]=Fournit une boîte de dialogue pour la sélection de l'éditeur.
+Comment[ga]=Soláthraíonn sé dialóg roghnaithe eagarthóra.
+Comment[gl]=Proporciona un diálogo para a selección dun editor.
+Comment[hi]=संपादक चयन के लिए एक संवाद उपलब्ध कराता है.
+Comment[hu]=A szövegszerkesztő komponens kiválasztását teszi lehetővé.
+Comment[is]=Útvegar samtalsglugga fyrir val á ritli
+Comment[it]=Fornisce a una finestra per la selezione dell'editor.
+Comment[ja]=エディタを選択するためのダイアログを提供します。
+Comment[ms]=Menyediakan dialog untuk pemilihan Penyunting.
+Comment[nds]=Stellt en Dialoog för de Editor-Utwahl praat.
+Comment[ne]=सम्पादन चयनका लागि संवाद प्रदान गर्दछ
+Comment[nl]=Biedt een dialoog om een editor te kiezen.
+Comment[pl]=Okno dialogowe do wyboru edytora.
+Comment[pt]=Fornece um diálogo para a selecção de Editor.
+Comment[pt_BR]=Provê um diálogo para seleção do Editor.
+Comment[ru]=Предоставляет диалог выбора редактора.
+Comment[sk]=Poskytuje dialógové okno pre voľbu editora.
+Comment[sl]=Ponuja pogovorno okno za izbiro urejevalnika
+Comment[sr]=Обезбеђује прозор за избор уређивача.
+Comment[sr@Latn]=Obezbeđuje prozor za izbor uređivača.
+Comment[sv]=Tillhandahåller en dialogruta för val av editor.
+Comment[ta]=தொகுப்பாளர் தேர்விற்கான உரையாடலைத் தரும்
+Comment[tg]=Ба ихтиёр гузоштани гуфтугӯи интихоби муҳаррир.
+Comment[tr]=Düzenleyici seçimi için bir pencere sağlar
+Comment[zh_CN]=提供编辑器选择对话框
+Comment[zh_TW]=提供對話框以編輯選擇。
+Name=KDevEditorChooser
+Name[da]=KDevelop Editorvælger
+Name[de]=Editor-Auswahl (KDevelop)
+Name[hi]=के-डेव-एडिटर-चूसर
+Name[nds]=KDevelop-Editorutwahl
+Name[ne]=केडीई विकास सम्पादक छनोटकर्ता
+Name[pl]=KDevWybórEdytora
+Name[sk]=KDevEditorVolič
+Name[sv]=KDevelop editorväljare
+Name[ta]=கெடெவ் தொகுப்பாளர் தேர்வாளர்
+Name[tg]=KDevМуҳаррирИнтихобкунанда
+Name[zh_TW]=KDevelop 編輯器選擇器
+GenericName=Editor Selection
+GenericName[ca]=Selecció de l'Editor
+GenericName[da]=Editorvalg
+GenericName[de]=Editor-Auswahl
+GenericName[el]=Επιλογή επεξεργαστή
+GenericName[es]=Selección de un editor
+GenericName[et]=Redaktori valimine
+GenericName[eu]=Editore-hautapena
+GenericName[fa]=گزینش ویرایشگر
+GenericName[fr]=Sélection de l'éditeur
+GenericName[ga]=Roghnú Eagarthóra
+GenericName[gl]=Selección de editor
+GenericName[hi]=संपादक चयन
+GenericName[hu]=Szerkesztőkomponens-választás
+GenericName[it]=Selezione Editor
+GenericName[ja]=エディタの選択
+GenericName[ms]=Pemilih Penyunting
+GenericName[nds]=Editor-Utwahl
+GenericName[ne]=सम्पादक चयन
+GenericName[nl]=Editorkiezer
+GenericName[pl]=Wybór edytora
+GenericName[pt]=Selecção de Editor
+GenericName[pt_BR]=Seleção de Editor
+GenericName[ru]=Выбор редактора
+GenericName[sk]=Voľba editora
+GenericName[sl]=Izbira urejevalnika
+GenericName[sr]=Избор уређивача
+GenericName[sr@Latn]=Izbor uređivača
+GenericName[sv]=Val av editor
+GenericName[ta]=தொகுப்பாளர் தேர்வு
+GenericName[tg]=Интихоби муҳаррир
+GenericName[tr]=Düzenleyici Seçimi
+GenericName[zh_CN]=编辑器选择
+GenericName[zh_TW]=編輯器選擇
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdeveditorchooser
+X-KDevelop-Version=5
+X-KDevelop-Scope=Core
+X-KDevelop-Properties=EditorChooser
diff --git a/embedded/Makefile.am b/embedded/Makefile.am
new file mode 100644
index 00000000..9bd593c0
--- /dev/null
+++ b/embedded/Makefile.am
@@ -0,0 +1,13 @@
+##
+## Do NOT remove the comments that start with "kdevelop:"
+## They are actually directives to the kdevelop plugin system
+##
+## The include_xxxx variables are controlled by configure.in.in
+##
+
+#kdevelop: VISUALBOYADVANCE_SUBDIR = visualboyadvance
+if include_vba
+VISUALBOYADVANCE_SUBDIR = visualboyadvance
+endif
+
+SUBDIRS = $(VISUALBOYADVANCE_SUBDIR) \ No newline at end of file
diff --git a/embedded/visualboyadvance/Makefile.am b/embedded/visualboyadvance/Makefile.am
new file mode 100644
index 00000000..4732b646
--- /dev/null
+++ b/embedded/visualboyadvance/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevvisualboyadvance.la
+libkdevvisualboyadvance_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevvisualboyadvance_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevvisualboyadvance_la_SOURCES = visualboyadvance_part.cpp vbaconfigwidgetbase.ui vbaconfigwidget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevvisualboyadvance.desktop
+
+rcdir = $(kde_datadir)/kdevvisualboyadvance
+rc_DATA = kdevpart_visualboyadvance.rc
+
diff --git a/embedded/visualboyadvance/kdevpart_visualboyadvance.rc b/embedded/visualboyadvance/kdevpart_visualboyadvance.rc
new file mode 100644
index 00000000..674cd41f
--- /dev/null
+++ b/embedded/visualboyadvance/kdevpart_visualboyadvance.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="visualboyadvance" library="libvisualboyadvanceplugin" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="build_execute" group="build_operations"/>
+</ToolBar>
+</kpartplugin>
diff --git a/embedded/visualboyadvance/kdevvisualboyadvance.desktop b/embedded/visualboyadvance/kdevvisualboyadvance.desktop
new file mode 100644
index 00000000..bec85456
--- /dev/null
+++ b/embedded/visualboyadvance/kdevvisualboyadvance.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=VisualBoyAdvance is a GameBoyAdvance emulator. http://vboy.emuhq.com/
+Comment[ca]=VisualBoyAdvance és un emulador de GameBoyAdvance. http://vboy.emuhq.com/
+Comment[da]=VisualBoyAdvance er en GameBoyAdvance emulator. http://vboy.emuhq.com/
+Comment[de]=VisualBoy Advance ist ein Emulator für den GameBoy Advance (http://vboy.emuhq.com/)
+Comment[el]=Το VisualBoyAdvance είναι ένας εξομοιωτής του GameBoyAdvance. http://vboy.emuhq.com/
+Comment[es]=VisualBoyAdvance es un emulador de GameBoyAdvance. http://vboy.emuhq.com/
+Comment[et]=VisualBoyAdvance on GameBoyAdvance emulaator. http://vboy.emuhq.com/
+Comment[eu]=VisualBoyAdvance GameBoyAdvance-en emulatzaile bat da. http://vboy.emuhq.com/
+Comment[fa]=VisualBoyAdvance یک مقلد GameBoyAdvanc است. http://vboy.emuhq.com/
+Comment[fr]=VisualBoyAdvance est un émulateur de GameBoyAdvance. http://vboy.emuhq.com/
+Comment[ga]=Is aithriseoir GameBoyAdvance é VisualBoyAdvance. Féach ar http://vboy.emuhq.com/
+Comment[gl]=VisualBoyAdvance é un emulador de GameBoyAdvance. http://vboy.emuhq.com/
+Comment[hi]=विज़ुअल-बॉय-एडवांस एक गेम-बॉय-एडवांस एमुलेटर है. http://vboy.emuhq.com/
+Comment[hu]=A VisualBoyAdvance egy emulátor a Game Boy Advance-hoz - http://vboy.emuhq.com/
+Comment[is]=VisualBoyAdvance er GameBoyAdvance hermir. http://vboy.emuhq.com/
+Comment[it]=VisualBoyAdvance è un emulatore per GameBoyAdvance. http://vboy.emuhq.com/
+Comment[ja]=VisualBoyAdvance は、ゲームボーイアドバンスエミュレータです。http://vboy.emuhq.com/
+Comment[ms]=VisualBoyAdvance adalah emulator GameBoyAdvance. http://vboy.emuhq.com/
+Comment[nds]=VisualBoy Advance is en GameBoy-Advance-Emulator (http://vboy.emuhq.com/)
+Comment[ne]=VisualBoyAdvance एउटा GameBoyAdvance इमुलेटर हो । http://vboy.emuhq.com/
+Comment[nl]=VisualBoyAdvance is een GameBoyAdvance-emulator (http://vboy.emuhq.com/
+Comment[pl]=VisualBoyAdvance to emulator GameBoyAdvance. http://vboy.emuhq.com/
+Comment[pt]=O VisualBoyAdvance é um emulador do GameBoyAdvance. http://vboy.emuhq.com/
+Comment[pt_BR]=VisualBoyAdvance é um emulador do GameBoyAdvance. http://vboy.emuhq.com/
+Comment[ru]=VisualBoyAdvance - эмулятор GameBoyAdvance. http://vboy.emuhq.com/
+Comment[sk]=VisualBoyAdvance je emulátor GameBoyAdvance. http://vboy.emuhq.com/
+Comment[sl]=VisualBoyAdvance je emulator GameBoyAdvance. http://vboy.emuhq.com/
+Comment[sr]=VisualBoyAdvance je емулатор GameBoyAdvance-а. http://vboy.emuhq.com/
+Comment[sr@Latn]=VisualBoyAdvance je emulator GameBoyAdvance-a. http://vboy.emuhq.com/
+Comment[sv]=VisualBoyAdvance är en emulator för GameBoyAdvance. http://vboy.emuhq.com/
+Comment[ta]=கெடெவ் காட்சியாக்க பாய் அட்வான்ஸ் பொன்மி.. http://vboy.emuhq.com/
+Comment[tg]=VisualBoyAdvance-ин эмулятори GameBoyAdvance мебошад. http://vboy.emuhq.com/
+Comment[tr]=VisualBoyAdvance bir GameBoyAdvance emülatörüdür: http://vboy.emuhq.com/
+Comment[zh_CN]=VisualBoyAdvance 是 GameBoyAdvance 的模拟器。http://vboy.emuhq.com/
+Comment[zh_TW]=VisualBoyAdvance 是一個 GameBoyAdvance 模擬器。http://vboy.emuhq.com/
+Name=KDevVisualBoyAdvance
+Name[da]=KDevelop VisualBoyAdvance
+Name[de]=VisualBoy Advance (KDevelop)
+Name[hi]=के-डेव-विज़ुअल-बॉय-एडवांस
+Name[nds]=VisualBoy Advance för KDevelop
+Name[sv]=KDevelop Visual Boy Advance
+Name[ta]=கெடெவ் காட்சியாக்க பாய் அட்வான்ஸ்
+Name[zh_TW]=KDevelop VisualBoyAdvance
+GenericName=VisualBoyAdvance Support
+GenericName[ca]=Suport per a VisualBoyAdvance
+GenericName[da]=VisualBoyAdvance understøttelse
+GenericName[de]=Unterstützung für VisualBoy Advance
+GenericName[el]=Υποστήριξη VisualBoyAdvance
+GenericName[es]=Soporte para VisualBoyAdvance
+GenericName[et]=VisualBoyAdvance toetus
+GenericName[eu]=VisualBoyAdvance euskarria
+GenericName[fa]=پشتیبانی VisualBoyAdvance
+GenericName[fr]=Prise en charge de VisualBoyAdvance
+GenericName[ga]=Tacaíocht VisualBoyAdvance
+GenericName[gl]=Soporte de VisualBoyAdvance
+GenericName[hu]=VisualBoyAdvance-támogatás
+GenericName[it]=Supporto per VisualBoyAdvance
+GenericName[ja]=VisualBoyAdvance サポート
+GenericName[ms]=Sokongan VisualBoyAdvance
+GenericName[nds]=Unnerstütten för VisualBoy Advance
+GenericName[ne]=VisualBoyAdvance समर्थन
+GenericName[nl]=Ondersteuning voor VisualBoyAdvance
+GenericName[pl]=Obsługa VisualBoyAdvance
+GenericName[pt]=Suporte a VisualBoyAdvance
+GenericName[pt_BR]=Suporte ao VisualBoyAdvance
+GenericName[ru]=Поддержка VisualBoyAdvance
+GenericName[sk]=VisualBoyAdvance podpora
+GenericName[sl]=Podpora VisualBoyAdvance
+GenericName[sr]=Подршка за VisualBoyAdvance
+GenericName[sr@Latn]=Podrška za VisualBoyAdvance
+GenericName[sv]=Stöd för Visual Boy Advance
+GenericName[ta]=காட்சியாக்க பாய் அட்வான்ஸ் ஆதரவு
+GenericName[tg]=Ёри намудан ба VisualBoyAdvance
+GenericName[tr]=VisualBoyAdvance Desteği
+GenericName[zh_CN]=VisualBoyAdvance 支持
+GenericName[zh_TW]=VisualBoyAdvance 支援
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevvisualboyadvance
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+Keywords=GBA
+Keywords[hi]=जीबीए
diff --git a/embedded/visualboyadvance/vbaconfigwidget.cpp b/embedded/visualboyadvance/vbaconfigwidget.cpp
new file mode 100644
index 00000000..e9c00c12
--- /dev/null
+++ b/embedded/visualboyadvance/vbaconfigwidget.cpp
@@ -0,0 +1,144 @@
+/***************************************************************************
+ vbaconfigwidget.cpp
+ -------------------
+ begin : Thu Nov 29 2001
+ copyright : (C) 2001 by Sandy Meier
+ email : smeier@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "vbaconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <qdir.h>
+#include <qlineedit.h>
+#include <qradiobutton.h>
+#include <qtoolbutton.h>
+
+#include <kfiledialog.h>
+
+#include "domutil.h"
+
+
+using namespace VisualBoyAdvance;
+
+VBAConfigWidget::VBAConfigWidget(VisualBoyAdvancePart* part,QWidget *parent, const char *name ) : VBAConfigWidgetBase(parent,name) {
+ m_part = part;
+ QDomDocument &doc = *m_part->projectDom();
+ // read
+ QString emulator = DomUtil::readEntry(doc, "/kdevvisualadvance/emulator");
+ QString binary = DomUtil::readEntry(doc, "/kdevvisualadvance/binary");
+ QString graphicFilter = DomUtil::readEntry(doc, "/kdevvisualadvance/graphicFilter");
+ QString scaling = DomUtil::readEntry(doc, "/kdevvisualadvance/scaling");
+ QString addOptions = DomUtil::readEntry(doc, "/kdevvisualadvance/addOptions");
+ bool terminal = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/terminal");
+ bool fullscreen = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/fullscreen");
+ // set the widgets
+
+ if(emulator.isNull()){
+ emuPathEdit->setText("VisualBoyAdvance"); // default
+ }else{
+ emuPathEdit->setText(emulator);
+ }
+ binaryEdit->setText(binary);
+
+ // graphic
+ if(graphicFilter.isNull()){
+ normalModeButton->setChecked(true);
+ }else{
+ if(graphicFilter == "-f0"){
+ normalModeButton->setChecked(true);
+ }
+ if(graphicFilter == "-f1"){
+ tvModeButton->setChecked(true);
+ }
+ if(graphicFilter == "-f2"){
+ salModeButton->setChecked(true);
+ }
+ if(graphicFilter == "-f3"){
+ superSalModeButton->setChecked(true);
+ }
+ if(graphicFilter == "-f4"){
+ superEagleModeButton->setChecked(true);
+ }
+ }
+
+ // scaling
+ if(scaling.isNull()){
+ scaling1Button->setChecked(true);//default
+ }else{
+ if(scaling == "-1"){
+ scaling1Button->setChecked(true);
+ }
+ if(scaling == "-2"){
+ scaling2Button->setChecked(true);
+ }
+ if(scaling == "-3"){
+ scaling3Button->setChecked(true);
+ }
+ if(scaling == "-4"){
+ scaling4Button->setChecked(true);
+ }
+
+ }
+
+ if(fullscreen){
+ fullscreenCheckBox->setChecked(true);
+ }
+ if(terminal){
+ terminalCheckBox->setChecked(true);
+ }
+
+ addOptionsEdit->setText(addOptions);
+ connect(emuPathButton,SIGNAL(clicked()),this,SLOT(emuPathButtonClicked()));
+}
+VBAConfigWidget::~VBAConfigWidget(){
+}
+
+void VBAConfigWidget::accept(){
+ QDomDocument &doc = *m_part->projectDom();
+
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/emulator",emuPathEdit->text());
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/binary",binaryEdit->text());
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/addOptions",addOptionsEdit->text());
+ DomUtil::writeBoolEntry(doc, "/kdevvisualadvance/terminal",terminalCheckBox->isChecked());
+ DomUtil::writeBoolEntry(doc, "/kdevvisualadvance/fullscreen",fullscreenCheckBox->isChecked());
+
+ if(normalModeButton->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f0");
+ }else if (tvModeButton->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f1");
+ }else if (salModeButton->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f2");
+ }else if (superSalModeButton->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f3");
+ }else if (superEagleModeButton->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/graphicFilter","-f4");
+ }
+
+ if(scaling1Button->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-1");
+ }else if(scaling2Button->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-2");
+ }else if(scaling3Button->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-3");
+ }else if(scaling4Button->isChecked()){
+ DomUtil::writeEntry(doc, "/kdevvisualadvance/scaling","-4");
+ }
+}
+void VBAConfigWidget::emuPathButtonClicked(){
+ QString emu = KFileDialog::getOpenFileName(QDir::homeDirPath());
+ if(!emu.isEmpty()){
+ emuPathEdit->setText(emu);
+ }
+}
+
+#include "vbaconfigwidget.moc"
diff --git a/embedded/visualboyadvance/vbaconfigwidget.h b/embedded/visualboyadvance/vbaconfigwidget.h
new file mode 100644
index 00000000..61866eb6
--- /dev/null
+++ b/embedded/visualboyadvance/vbaconfigwidget.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ vbaconfigwidget.h - VisualBoy Advance configuration Widget
+ -------------------
+ begin : Thu Nov 29 2001
+ copyright : (C) 2001 by Sandy Meier
+ email : smeier@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef VBACONFIGWIDGET_H
+#define VBACONFIGWIDGET_H
+
+#include <qwidget.h>
+#include "vbaconfigwidgetbase.h"
+#include "visualboyadvance_part.h"
+
+namespace VisualBoyAdvance {
+/**
+ *@author
+ */
+
+class VBAConfigWidget : public VBAConfigWidgetBase {
+ Q_OBJECT
+public:
+ VBAConfigWidget(VisualBoyAdvancePart* part,QWidget *parent=0, const char *name=0);
+ ~VBAConfigWidget();
+public slots:
+ void accept();
+ void emuPathButtonClicked();
+ private:
+ VisualBoyAdvancePart* m_part;
+};
+}
+#endif
diff --git a/embedded/visualboyadvance/vbaconfigwidgetbase.ui b/embedded/visualboyadvance/vbaconfigwidgetbase.ui
new file mode 100644
index 00000000..fb24e2d7
--- /dev/null
+++ b/embedded/visualboyadvance/vbaconfigwidgetbase.ui
@@ -0,0 +1,249 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>VBAConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>VBAConfigWigdet</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>510</width>
+ <height>367</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLineEdit" row="1" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>binaryEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>ButtonGroup3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Graphic Filter</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>normalModeButton</cstring>
+ </property>
+ <property name="text">
+ <string>Normal mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>tvModeButton</cstring>
+ </property>
+ <property name="text">
+ <string>TV mode</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>salModeButton</cstring>
+ </property>
+ <property name="text">
+ <string>2xSaI</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>superSalModeButton</cstring>
+ </property>
+ <property name="text">
+ <string>Super 2xSal</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>superEagleModeButton</cstring>
+ </property>
+ <property name="text">
+ <string>Super Eagle</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>GBA binary:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>emuPathEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Additional parameters:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>VisualBoy Advance (emulator):</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="0" column="4">
+ <property name="name">
+ <cstring>emuPathButton</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>22</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="1" rowspan="3" colspan="2">
+ <property name="name">
+ <cstring>ButtonGroup4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>120</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Scaling</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>scaling1Button</cstring>
+ </property>
+ <property name="text">
+ <string>1x</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>scaling2Button</cstring>
+ </property>
+ <property name="text">
+ <string>2x</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>scaling3Button</cstring>
+ </property>
+ <property name="text">
+ <string>3x</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>scaling4Button</cstring>
+ </property>
+ <property name="text">
+ <string>4x</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox" row="2" column="3">
+ <property name="name">
+ <cstring>fullscreenCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Full screen</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="3">
+ <property name="name">
+ <cstring>terminalCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Start in external terminal</string>
+ </property>
+ </widget>
+ <spacer row="4" column="3">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QLineEdit" row="5" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>addOptionsEdit</cstring>
+ </property>
+ </widget>
+ <spacer row="6" column="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+
+</UI>
diff --git a/embedded/visualboyadvance/visualboyadvance_part.cpp b/embedded/visualboyadvance/visualboyadvance_part.cpp
new file mode 100644
index 00000000..ad434b43
--- /dev/null
+++ b/embedded/visualboyadvance/visualboyadvance_part.cpp
@@ -0,0 +1,77 @@
+#include "visualboyadvance_part.h"
+
+#include <qvbox.h>
+#include <qwhatsthis.h>
+
+#include <kaction.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevappfrontend.h"
+#include "domutil.h"
+#include "kdevplugininfo.h"
+
+#include "vbaconfigwidget.h"
+
+
+using namespace VisualBoyAdvance;
+
+typedef KDevGenericFactory<VisualBoyAdvancePart> VisualBoyAdvanceFactory;
+static const KDevPluginInfo data("kdevvisualboyadvance");
+K_EXPORT_COMPONENT_FACTORY( libkdevvisualboyadvance, VisualBoyAdvanceFactory( data ) )
+
+VisualBoyAdvancePart::VisualBoyAdvancePart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name){
+ setInstance(VisualBoyAdvanceFactory::instance());
+
+ setXMLFile("kdevpart_visualboyadvance.rc");
+
+ KAction *action;
+ action = new KAction( i18n("Execute Program"), "exec", Key_F9,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_execute" );
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+}
+
+
+VisualBoyAdvancePart::~VisualBoyAdvancePart()
+{
+
+}
+void VisualBoyAdvancePart::slotExecute(){
+ KDevProject* prj = project();
+ QDomDocument &doc = *projectDom();
+ QString binary = DomUtil::readEntry(doc, "/kdevvisualadvance/binary");
+ QString emulator = DomUtil::readEntry(doc, "/kdevvisualadvance/emulator");
+ QString graphicFilter = DomUtil::readEntry(doc, "/kdevvisualadvance/graphicFilter");
+ QString scaling = DomUtil::readEntry(doc, "/kdevvisualadvance/scaling");
+ QString addOptions = DomUtil::readEntry(doc, "/kdevvisualadvance/addOptions");
+ bool terminal = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/terminal");
+ bool fullscreen = DomUtil::readBoolEntry(doc, "/kdevvisualadvance/fullscreen");
+
+ if(emulator.isNull()) emulator = "VisualBoyAdvance";
+ QString program = emulator + " " + graphicFilter +" " + scaling + " " + addOptions +" ";
+ if(fullscreen){
+ program += "-F ";
+ }
+
+ program += prj->projectDirectory() + "/" + binary;
+
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, terminal);
+}
+
+void VisualBoyAdvancePart::projectConfigWidget(KDialogBase *dlg){
+ QVBox *vbox;
+ vbox = dlg->addVBoxPage(i18n("Run Options"), i18n("Run Options"), BarIcon( "make", KIcon::SizeMedium ));
+ VBAConfigWidget* w = new VBAConfigWidget(this,vbox);
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+
+#include "visualboyadvance_part.moc"
diff --git a/embedded/visualboyadvance/visualboyadvance_part.h b/embedded/visualboyadvance/visualboyadvance_part.h
new file mode 100644
index 00000000..86903d0b
--- /dev/null
+++ b/embedded/visualboyadvance/visualboyadvance_part.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2001 Sandy Meier <smeier@kdevelop.org>
+ */
+
+
+#ifndef __KDEVPART_VISUALBOYADVANCE_H__
+#define __KDEVPART_VISUALBOYADVANCE_H__
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+#include <kdialogbase.h>
+
+namespace VisualBoyAdvance {
+ class VisualBoyAdvancePart : public KDevPlugin
+ {
+ Q_OBJECT
+
+ public:
+
+ VisualBoyAdvancePart(QObject *parent, const char *name, const QStringList &);
+ ~VisualBoyAdvancePart();
+ private slots:
+ void slotExecute();
+ void projectConfigWidget(KDialogBase *dlg);
+
+ };
+
+}
+#endif
diff --git a/kde-development-kdevelop.directory b/kde-development-kdevelop.directory
new file mode 100644
index 00000000..add723a6
--- /dev/null
+++ b/kde-development-kdevelop.directory
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=KDevelop
+Name[ne]=केडीई विकास
+Icon=kdevelop
diff --git a/kdevassistant.desktop b/kdevassistant.desktop
new file mode 100644
index 00000000..c4310dff
--- /dev/null
+++ b/kdevassistant.desktop
@@ -0,0 +1,74 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevassistant %u
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop Assistant
+Name[br]=Skoazeller KDevelop
+Name[ca]=Assistent per a KDevelop
+Name[cy]=Cymhorthwr KDevelop
+Name[da]=KDevelop assistent
+Name[de]=KDevelop-Assistent
+Name[el]=Βοηθός KDevelop
+Name[es]=Asistente de KDevelop
+Name[et]=KDevelopi abiline
+Name[eu]=KDevelop laguntzailea
+Name[fa]=دستیار KDevelop
+Name[fr]=Assistant de KDevelop
+Name[it]=Assistente di KDevelop
+Name[ja]=KDevelop アシスタント
+Name[ms]=Pembantu KDevelop
+Name[nds]=KDevelop-Hölper
+Name[ne]=केडीई विकास सहायक
+Name[nl]=KDevelop Assistent
+Name[pl]=Asystent KDevelop
+Name[pt]=Assistente do KDevelop
+Name[pt_BR]=Assistente do KDevelop
+Name[sk]=KDevelop asistent
+Name[sl]=Pomočnik za KDevelop
+Name[sr]=KDevelop-ов асистент
+Name[sr@Latn]=KDevelop-ov asistent
+Name[sv]=KDevelop assistent
+Name[ta]=Kஉருவாக்கு உதவி
+Name[tg]=KDevelop Ассистент
+Name[zh_CN]=KDevelop 助手
+Name[zh_TW]=KDevelop 助理
+GenericName=Documentation Viewer
+GenericName[br]=Gweler an teuliadur
+GenericName[ca]=Visor de documentació
+GenericName[da]=Dokumentationsfremviser
+GenericName[de]=Dokumentationsbetrachter
+GenericName[el]=Προβολέας τεκμηρίωσης
+GenericName[es]=Visor de documentación
+GenericName[et]=Dokumentatsiooninäitaja
+GenericName[eu]=Documentazio ikustailea
+GenericName[fa]=مشاهده‌گر مستندات
+GenericName[fr]=Afficheur de documentation
+GenericName[ga]=Amharcán Doiciméadithe
+GenericName[gl]=Visor de documentación
+GenericName[hu]=Dokumentációmegjelenítő
+GenericName[it]=Visualizzatore documentazione
+GenericName[ja]=ドキュメンテーションビューア
+GenericName[ms]=Pelihat Dokumentasi
+GenericName[nds]=Dokmentatschoonkieker
+GenericName[ne]=मिलिसीकरण दृश्यकर्ता
+GenericName[nl]=Documentatie Browser
+GenericName[pa]=ਦਸਤਾਵੇਜ਼ ਦਰਸ਼ਕ
+GenericName[pl]=Przeglądarka dokumentacji
+GenericName[pt]=Visualizador de Documentação
+GenericName[pt_BR]=Visualizador de Documentação
+GenericName[ru]=Просмотр документации
+GenericName[sk]=Prezerač dokumentácie
+GenericName[sl]=Pregledovalnik dokumentacije
+GenericName[sr]=Приказивач документације
+GenericName[sr@Latn]=Prikazivač dokumentacije
+GenericName[sv]=Dokumentationsvisning
+GenericName[ta]=ஆவணமாக்கல் காட்சியமைப்பாளர்
+GenericName[tg]=Аз назар бо ҳуҷҷатнок гузарондан
+GenericName[tr]=Belge Gösterici
+GenericName[zh_CN]=文档查看器
+GenericName[zh_TW]=文件檢視器
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;Documentation;X-KDE-KDevelopIDE;
+
diff --git a/kdevdesigner/AUTHORS b/kdevdesigner/AUTHORS
new file mode 100644
index 00000000..40d295ec
--- /dev/null
+++ b/kdevdesigner/AUTHORS
@@ -0,0 +1,4 @@
+KDevDesigner: Alexander Dymo <adymo@mksat.net>
+Qt Designer Copyright: (C) 2000-2003 Trolltech AS All Rights Reserved
+
+
diff --git a/kdevdesigner/LICENSE.GPL b/kdevdesigner/LICENSE.GPL
new file mode 100644
index 00000000..5b6e7c66
--- /dev/null
+++ b/kdevdesigner/LICENSE.GPL
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/kdevdesigner/Makefile.am b/kdevdesigner/Makefile.am
new file mode 100644
index 00000000..4cc5b44c
--- /dev/null
+++ b/kdevdesigner/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS = shared uilib designer src
+#plugins
+
+EXTRA_DIST = COPYING configure.in.in
diff --git a/kdevdesigner/NEWS b/kdevdesigner/NEWS
new file mode 100644
index 00000000..0519ecba
--- /dev/null
+++ b/kdevdesigner/NEWS
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/kdevdesigner/README b/kdevdesigner/README
new file mode 100644
index 00000000..a9e2cf4b
--- /dev/null
+++ b/kdevdesigner/README
@@ -0,0 +1,25 @@
+KDevDesigner is a port of Qt Designer (code taken from Qt 3.3 distribution) to KDE technologies:
+1) XML GUI
+2) KParts
+3) KFileDialog
+4) KIconLoader
+
+KDevDesigner consists of a part and a shell.
+Part can be used in Konqueror and KDevelop to edit and view ui files and projects.
+Shell loads a part with "in shell" argument so that the part can create projects and ui files.
+
+Other important notes:
+KDevDesignerPart is Read/Write part which ignores readonly mode.
+Designer Editor plugins are not loaded.
+Available in system designer plugins are loaded if possible (tested with Qt 3.3 version).
+
+KDevDesignerPart integration:
+KDevDesignerPart implements KInterfaceDesigner interface (defined in kdevelop/lib/external_interfaces).
+
+WARNING:
+If you want to modify this code, try to introduce as few modifications to original Qt Designer code as possible.
+Write your own classes and wrappers instead. The goal is to ease syncronization between the port and original Qt Designer.
+Feel free to modify kdevdesigner_part.h(cpp) though.
+
+FUTURE:
+Trolltech promises that Qt 4 will have easilly embeddable designer. If that happens, this port will be dropped for KDevelop 4.
diff --git a/kdevdesigner/TODO b/kdevdesigner/TODO
new file mode 100644
index 00000000..0519ecba
--- /dev/null
+++ b/kdevdesigner/TODO
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/kdevdesigner/designer/Makefile.am b/kdevdesigner/designer/Makefile.am
new file mode 100644
index 00000000..5b8372f9
--- /dev/null
+++ b/kdevdesigner/designer/Makefile.am
@@ -0,0 +1,21 @@
+SUBDIRS = pics
+
+AM_CXXFLAGS=-DDESIGNER
+KDE_CXXFLAGS=-UQT_NO_ASCII_CAST
+INCLUDES = -I$(top_srcdir)/kdevdesigner/shared \
+ -I$(top_srcdir)/lib/interfaces/external $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkdevdesignerpart.la
+libkdevdesignerpart_la_LDFLAGS = $(KDE_PLUGIN) $(all_libraries)
+libkdevdesignerpart_la_LIBADD = \
+ $(top_builddir)/kdevdesigner/uilib/libkdevqui.la $(top_builddir)/kdevdesigner/shared/libshared.la \
+ $(top_builddir)/lib/interfaces/external/libkinterfacedesigner.la -lqassistantclient $(LIB_KFILE) $(LIB_KPARTS)
+libkdevdesignerpart_la_SOURCES = kdevdesigner_part.cpp actiondnd.cpp actioneditorimpl.cpp actionlistview.cpp asciivalidator.cpp command.cpp connectionitems.cpp connectiontable.cpp customwidgeteditorimpl.cpp database.cpp dbconnectionimpl.cpp dbconnectionsimpl.cpp defs.cpp designerapp.cpp designerappiface.cpp editfunctionsimpl.cpp filechooser.cpp formfile.cpp formsettingsimpl.cpp formwindow.cpp hierarchyview.cpp iconvieweditorimpl.cpp layout.cpp listboxdnd.cpp listboxeditorimpl.cpp listboxrename.cpp listdnd.cpp listviewdnd.cpp listvieweditorimpl.cpp mainwindow.cpp mainwindowactions.cpp menubareditor.cpp metadatabase.cpp multilineeditorimpl.cpp newformimpl.cpp orderindicator.cpp outputwindow.cpp paletteeditoradvancedimpl.cpp paletteeditorimpl.cpp pixmapchooser.cpp pixmapcollection.cpp popupmenueditor.cpp previewframe.cpp previewwidgetimpl.cpp project.cpp projectsettingsimpl.cpp propertyeditor.cpp propertyobject.cpp qcompletionedit.cpp resource.cpp sizehandle.cpp sourceeditor.cpp sourcefile.cpp startdialogimpl.cpp styledbutton.cpp syntaxhighlighter_html.cpp tableeditorimpl.cpp timestamp.cpp variabledialogimpl.cpp widgetaction.cpp widgetfactory.cpp wizardeditorimpl.cpp workspace.cpp about.ui dbconnection.ui gotolinedialog.ui newform.ui previewwidget.ui variabledialog.ui actioneditor.ui dbconnectioneditor.ui iconvieweditor.ui paletteeditor.ui projectsettings.ui wizardeditor.ui configtoolboxdialog.ui dbconnections.ui listboxeditor.ui paletteeditoradvanced.ui replacedialog.ui connectiondialog.ui editfunctions.ui listeditor.ui pixmapcollectioneditor.ui richtextfontdialog.ui createtemplate.ui finddialog.ui listvieweditor.ui pixmapfunction.ui startdialog.ui customwidgeteditor.ui formsettings.ui multilineeditor.ui preferences.ui tableeditor.ui designeraction.cpp myiconloader.cpp
+partrcdir = $(kde_datadir)/kdevdesignerpart
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = kdevdesigner_part.desktop
+partrc_DATA = kdevdesigner_part.rc kdevdesigner_part_sh.rc
+noinst_HEADERS = kdevdesigner_part.h designeraction.h myiconloader.h
+picsdirdir = $(kde_datadir)/kdevdesignerpart/pics
+
+KDE_OPTIONS=nofinal
diff --git a/kdevdesigner/designer/about.ui b/kdevdesigner/designer/about.ui
new file mode 100644
index 00000000..68980df0
--- /dev/null
+++ b/kdevdesigner/designer/about.ui
@@ -0,0 +1,219 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AboutDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2003 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AboutDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>544</width>
+ <height>667</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt Designer</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>aboutPixmap</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_splash.png"</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>aboutVersion</cstring>
+ </property>
+ <property name="text">
+ <string>Version 3.2</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>aboutCopyright</cstring>
+ </property>
+ <property name="text">
+ <string>Copyright (C) 2000-2003 Trolltech AS. All Rights Reserved.</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>aboutLicense</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;Qt Commercial Edition license holders: This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Qt Free Edition users: This program is licensed to you under the terms of the GNU General Public License Version 2. For details, see the file LICENSE.GPL that came with this software distribution.&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="wordwrap" stdset="0">
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</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>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>AboutDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/actiondnd.cpp b/kdevdesigner/designer/actiondnd.cpp
new file mode 100644
index 00000000..071f0d4b
--- /dev/null
+++ b/kdevdesigner/designer/actiondnd.cpp
@@ -0,0 +1,726 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "command.h"
+#include "defs.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "hierarchyview.h"
+
+#include <qaction.h>
+#include <qapplication.h>
+#include <qbitmap.h>
+#include <qdragobject.h>
+#include <qinputdialog.h>
+#include <qlayout.h>
+#include <qmainwindow.h>
+#include <qmenudata.h>
+#include <qmessagebox.h>
+#include <qobjectlist.h>
+#include <qpainter.h>
+#include <qstyle.h>
+#include <qtimer.h>
+
+#include <klocale.h>
+
+QAction *ActionDrag::the_action = 0;
+
+ActionDrag::ActionDrag(QAction *action, QWidget *source)
+: QStoredDrag("application/x-designer-actions", source)
+{
+ Q_ASSERT(the_action == 0);
+ the_action = action;
+}
+
+ActionDrag::ActionDrag(QActionGroup *group, QWidget *source)
+: QStoredDrag("application/x-designer-actiongroup", source)
+{
+ Q_ASSERT(the_action == 0);
+ the_action = group;
+}
+
+ActionDrag::ActionDrag(const QString &type, QAction *action, QWidget *source)
+: QStoredDrag(type, source)
+{
+ Q_ASSERT(the_action == 0);
+ the_action = action;
+}
+
+bool ActionDrag::canDecode(QDropEvent *e)
+{
+ return e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ||
+ e->provides( "application/x-designer-separator" );
+}
+
+ActionDrag::~ActionDrag()
+{
+ the_action = 0;
+}
+
+void QDesignerAction::init()
+{
+ MetaDataBase::addEntry( this );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( this ) );
+ WidgetFactory::saveDefaultProperties( this, id );
+ WidgetFactory::saveChangedProperties( this, id );
+}
+
+void QDesignerActionGroup::init()
+{
+ MetaDataBase::addEntry( this );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( this ) );
+ WidgetFactory::saveDefaultProperties( this, id );
+ WidgetFactory::saveChangedProperties( this, id );
+}
+
+bool QDesignerAction::addTo( QWidget *w )
+{
+ if ( !widgetToInsert )
+ return QAction::addTo( w );
+
+ if ( ::qt_cast<QPopupMenu*>(w) )
+ return FALSE;
+
+ widgetToInsert->reparent( w, QPoint( 0, 0 ), FALSE );
+ widgetToInsert->show();
+ addedTo( widgetToInsert, w );
+ return TRUE;
+}
+
+bool QDesignerAction::removeFrom( QWidget *w )
+{
+ if ( !widgetToInsert )
+ return QAction::removeFrom( w );
+
+ remove();
+ return TRUE;
+}
+
+void QDesignerAction::remove()
+{
+ if ( !widgetToInsert )
+ return;
+ MainWindow::self->formWindow()->selectWidget( widgetToInsert, FALSE );
+ widgetToInsert->reparent( 0, QPoint( 0, 0 ), FALSE );
+}
+
+QDesignerToolBarSeparator::QDesignerToolBarSeparator(Orientation o , QToolBar *parent,
+ const char* name )
+ : QWidget( parent, name )
+{
+ connect( parent, SIGNAL(orientationChanged(Orientation)),
+ this, SLOT(setOrientation(Orientation)) );
+ setOrientation( o );
+ setBackgroundMode( parent->backgroundMode() );
+ setBackgroundOrigin( ParentOrigin );
+ setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
+}
+
+void QDesignerToolBarSeparator::setOrientation( Orientation o )
+{
+ orient = o;
+}
+
+void QDesignerToolBarSeparator::styleChange( QStyle& )
+{
+ setOrientation( orient );
+}
+
+QSize QDesignerToolBarSeparator::sizeHint() const
+{
+ int extent = style().pixelMetric( QStyle::PM_DockWindowSeparatorExtent,
+ this );
+ if ( orient == Horizontal )
+ return QSize( extent, 0 );
+ else
+ return QSize( 0, extent );
+}
+
+void QDesignerToolBarSeparator::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ QStyle::SFlags flags = QStyle::Style_Default;
+
+ if ( orientation() == Horizontal )
+ flags |= QStyle::Style_Horizontal;
+
+ style().drawPrimitive( QStyle::PE_DockWindowSeparator, &p, rect(),
+ colorGroup(), flags );
+}
+
+
+
+QSeparatorAction::QSeparatorAction( QObject *parent )
+ : QAction( parent, "qt_designer_separator" ), wid( 0 )
+{
+}
+
+bool QSeparatorAction::addTo( QWidget *w )
+{
+ if ( ::qt_cast<QToolBar*>(w) ) {
+ QToolBar *tb = (QToolBar*)w;
+ wid = new QDesignerToolBarSeparator( tb->orientation(), tb );
+ return TRUE;
+ } else if ( ::qt_cast<QPopupMenu*>(w) ) {
+ idx = ( (QPopupMenu*)w )->count();
+ ( (QPopupMenu*)w )->insertSeparator( idx );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool QSeparatorAction::removeFrom( QWidget *w )
+{
+ if ( ::qt_cast<QToolBar*>(w) ) {
+ delete wid;
+ return TRUE;
+ } else if ( ::qt_cast<QPopupMenu*>(w) ) {
+ ( (QPopupMenu*)w )->removeItemAt( idx );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+QWidget *QSeparatorAction::widget() const
+{
+ return wid;
+}
+
+
+
+QDesignerToolBar::QDesignerToolBar( QMainWindow *mw )
+ : QToolBar( mw ), lastIndicatorPos( -1, -1 )
+{
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ setAcceptDrops( TRUE );
+ MetaDataBase::addEntry( this );
+ lastIndicatorPos = QPoint( -1, -1 );
+ indicator = new QDesignerIndicatorWidget( this );
+ indicator->hide();
+ installEventFilter( this );
+ widgetInserting = FALSE;
+ findFormWindow();
+ mw->setDockEnabled( DockTornOff, FALSE );
+}
+
+QDesignerToolBar::QDesignerToolBar( QMainWindow *mw, Dock dock )
+ : QToolBar( QString::null, mw, dock), lastIndicatorPos( -1, -1 )
+{
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ setAcceptDrops( TRUE );
+ indicator = new QDesignerIndicatorWidget( this );
+ indicator->hide();
+ MetaDataBase::addEntry( this );
+ installEventFilter( this );
+ widgetInserting = FALSE;
+ findFormWindow();
+ mw->setDockEnabled( DockTornOff, FALSE );
+}
+
+void QDesignerToolBar::findFormWindow()
+{
+ QWidget *w = this;
+ while ( w ) {
+ formWindow = ::qt_cast<FormWindow*>(w);
+ if ( formWindow )
+ break;
+ w = w->parentWidget();
+ }
+}
+
+void QDesignerToolBar::addAction( QAction *a )
+{
+ actionList.append( a );
+ connect( a, SIGNAL( destroyed() ), this, SLOT( actionRemoved() ) );
+ if ( ::qt_cast<QActionGroup*>(a) ) {
+ ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
+ } else if ( ::qt_cast<QSeparatorAction*>(a) ) {
+ ( (QSeparatorAction*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (QSeparatorAction*)a )->widget(), a );
+ } else {
+ ( (QDesignerAction*)a )->widget()->installEventFilter( this );
+ actionMap.insert( ( (QDesignerAction*)a )->widget(), a );
+ }
+}
+
+static void fixObject( QObject *&o )
+{
+ while ( o && o->parent() && !::qt_cast<QDesignerToolBar*>(o->parent()) )
+ o = o->parent();
+}
+
+bool QDesignerToolBar::eventFilter( QObject *o, QEvent *e )
+{
+ if ( !o || !e || o->inherits( "QDockWindowHandle" ) || o->inherits( "QDockWindowTitleBar" ) )
+ return QToolBar::eventFilter( o, e );
+
+ if ( o == this && e->type() == QEvent::MouseButtonPress &&
+ ( ( QMouseEvent*)e )->button() == LeftButton ) {
+ mousePressEvent( (QMouseEvent*)e );
+ return TRUE;
+ }
+
+ if ( o == this )
+ return QToolBar::eventFilter( o, e );
+
+ if ( e->type() == QEvent::MouseButtonPress ) {
+ QMouseEvent *ke = (QMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMousePressEvent( ke, o );
+ return TRUE;
+ } else if(e->type() == QEvent::ContextMenu ) {
+ QContextMenuEvent *ce = (QContextMenuEvent*)e;
+ fixObject( o );
+ if( !o )
+ return FALSE;
+ buttonContextMenuEvent( ce, o );
+ return TRUE;
+ } else if ( e->type() == QEvent::MouseMove ) {
+ QMouseEvent *ke = (QMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMouseMoveEvent( ke, o );
+ return TRUE;
+ } else if ( e->type() == QEvent::MouseButtonRelease ) {
+ QMouseEvent *ke = (QMouseEvent*)e;
+ fixObject( o );
+ if ( !o )
+ return FALSE;
+ buttonMouseReleaseEvent( ke, o );
+ return TRUE;
+ } else if ( e->type() == QEvent::DragEnter ) {
+ QDragEnterEvent *de = (QDragEnterEvent*)e;
+ if (ActionDrag::canDecode(de))
+ de->accept();
+ } else if ( e->type() == QEvent::DragMove ) {
+ QDragMoveEvent *de = (QDragMoveEvent*)e;
+ if (ActionDrag::canDecode(de))
+ de->accept();
+ }
+
+ return QToolBar::eventFilter( o, e );
+}
+
+void QDesignerToolBar::paintEvent( QPaintEvent *e )
+{
+ QToolBar::paintEvent( e );
+ if ( e->rect() != rect() )
+ return;
+ lastIndicatorPos = QPoint( -1, -1 );
+}
+
+void QDesignerToolBar::contextMenuEvent( QContextMenuEvent *e )
+{
+ e->accept();
+ QPopupMenu menu( 0 );
+ menu.insertItem( i18n( "Delete Toolbar" ), 1 );
+ int res = menu.exec( e->globalPos() );
+ if ( res != -1 ) {
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n( "Delete Toolbar '%1'" ).arg( name() ),
+ formWindow, 0, this );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void QDesignerToolBar::mousePressEvent( QMouseEvent *e )
+{
+ widgetInserting = FALSE;
+ if ( e->button() == LeftButton &&
+ MainWindow::self->currentTool() != POINTER_TOOL &&
+ MainWindow::self->currentTool() != ORDER_TOOL &&
+ MainWindow::self->currentTool() != CONNECT_TOOL &&
+ MainWindow::self->currentTool() != BUDDY_TOOL )
+ widgetInserting = TRUE;
+}
+
+void QDesignerToolBar::mouseReleaseEvent( QMouseEvent *e )
+{
+ if ( widgetInserting )
+ doInsertWidget( mapFromGlobal( e->globalPos() ) );
+ widgetInserting = FALSE;
+}
+
+void QDesignerToolBar::buttonMouseReleaseEvent( QMouseEvent *e, QObject *w )
+{
+ if ( widgetInserting )
+ doInsertWidget( mapFromGlobal( e->globalPos() ) );
+ else if ( w->isWidgetType() && formWindow->widgets()->find( w ) ) {
+ formWindow->clearSelection( FALSE );
+ formWindow->selectWidget( w );
+ }
+ widgetInserting = FALSE;
+}
+
+void QDesignerToolBar::buttonContextMenuEvent( QContextMenuEvent *e, QObject *o )
+{
+ e->accept();
+ QPopupMenu menu( 0 );
+ const int ID_DELETE = 1;
+ const int ID_SEP = 2;
+ const int ID_DELTOOLBAR = 3;
+ QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ if ( it != actionMap.end() && ::qt_cast<QSeparatorAction*>(*it) )
+ menu.insertItem( i18n( "Delete Separator" ), ID_DELETE );
+ else
+ menu.insertItem( i18n( "Delete Item" ), ID_DELETE );
+ menu.insertItem( i18n( "Insert Separator" ), ID_SEP );
+ menu.insertSeparator();
+ menu.insertItem( i18n( "Delete Toolbar" ), ID_DELTOOLBAR );
+ int res = menu.exec( e->globalPos() );
+ if ( res == ID_DELETE ) {
+ QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ if ( it == actionMap.end() )
+ return;
+ QAction *a = *it;
+ int index = actionList.find( a );
+ RemoveActionFromToolBarCommand *cmd = new RemoveActionFromToolBarCommand(
+ i18n( "Delete Action '%1' From Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( res == ID_SEP ) {
+ calcIndicatorPos( mapFromGlobal( e->globalPos() ) );
+ QAction *a = new QSeparatorAction( 0 );
+ int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand(
+ i18n( "Add Separator to Toolbar '%1'" ).
+ arg( a->name() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( res == ID_DELTOOLBAR ) {
+ RemoveToolBarCommand *cmd = new RemoveToolBarCommand( i18n( "Delete Toolbar '%1'" ).arg( name() ),
+ formWindow, 0, this );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void QDesignerToolBar::buttonMousePressEvent( QMouseEvent *e, QObject * )
+{
+ widgetInserting = FALSE;
+
+ if ( e->button() == MidButton )
+ return;
+
+ if ( e->button() == LeftButton &&
+ MainWindow::self->currentTool() != POINTER_TOOL &&
+ MainWindow::self->currentTool() != ORDER_TOOL &&
+ MainWindow::self->currentTool() != CONNECT_TOOL &&
+ MainWindow::self->currentTool() != BUDDY_TOOL ) {
+ widgetInserting = TRUE;
+ return;
+ }
+
+ dragStartPos = e->pos();
+}
+
+void QDesignerToolBar::removeWidget( QWidget *w )
+{
+ QMap<QWidget*, QAction*>::Iterator it = actionMap.find( w );
+ if ( it == actionMap.end() )
+ return;
+ QAction *a = *it;
+ int index = actionList.find( a );
+ RemoveActionFromToolBarCommand *cmd =
+ new RemoveActionFromToolBarCommand( i18n( "Delete Action '%1' From Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ QApplication::sendPostedEvents();
+ adjustSize();
+}
+
+void QDesignerToolBar::buttonMouseMoveEvent( QMouseEvent *e, QObject *o )
+{
+ if ( widgetInserting || ( e->state() & LeftButton ) == 0 )
+ return;
+ if ( QABS( QPoint( dragStartPos - e->pos() ).manhattanLength() ) < QApplication::startDragDistance() )
+ return;
+ QMap<QWidget*, QAction*>::Iterator it = actionMap.find( (QWidget*)o );
+ if ( it == actionMap.end() )
+ return;
+ QAction *a = *it;
+ if ( !a )
+ return;
+ int index = actionList.find( a );
+ RemoveActionFromToolBarCommand *cmd =
+ new RemoveActionFromToolBarCommand( i18n( "Delete Action '%1' From Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ QApplication::sendPostedEvents();
+ adjustSize();
+
+ QString type = ::qt_cast<QActionGroup*>(a) ? QString( "application/x-designer-actiongroup" ) :
+ ::qt_cast<QSeparatorAction*>(a) ? QString( "application/x-designer-separator" ) : QString( "application/x-designer-actions" );
+ QStoredDrag *drag = new ActionDrag( type, a, this );
+ drag->setPixmap( a->iconSet().pixmap() );
+ if ( ::qt_cast<QDesignerAction*>(a) ) {
+ if ( formWindow->widgets()->find( ( (QDesignerAction*)a )->widget() ) )
+ formWindow->selectWidget( ( (QDesignerAction*)a )->widget(), FALSE );
+ }
+ if ( !drag->drag() ) {
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n( "Add Action '%1' to Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ lastIndicatorPos = QPoint( -1, -1 );
+ indicator->hide();
+}
+
+#ifndef QT_NO_DRAGANDDROP
+
+void QDesignerToolBar::dragEnterEvent( QDragEnterEvent *e )
+{
+ widgetInserting = FALSE;
+ lastIndicatorPos = QPoint( -1, -1 );
+ if (ActionDrag::canDecode(e))
+ e->accept();
+}
+
+void QDesignerToolBar::dragMoveEvent( QDragMoveEvent *e )
+{
+ if (ActionDrag::canDecode(e)) {
+ e->accept();
+ drawIndicator( calcIndicatorPos( e->pos() ) );
+ }
+}
+
+void QDesignerToolBar::dragLeaveEvent( QDragLeaveEvent * )
+{
+ indicator->hide();
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+}
+
+void QDesignerToolBar::dropEvent( QDropEvent *e )
+{
+ if (!ActionDrag::canDecode(e))
+ return;
+
+ e->accept();
+
+ indicator->hide();
+ QAction *a = 0;
+ int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+ if ( e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-separator" ) ) {
+ if ( e->provides( "application/x-designer-actions" ) )
+ a = ::qt_cast<QDesignerAction*>(ActionDrag::action());
+ else
+ a = ::qt_cast<QSeparatorAction*>(ActionDrag::action());
+ } else {
+ a = ::qt_cast<QDesignerActionGroup*>(ActionDrag::action());
+ }
+
+ if ( actionList.findRef( a ) != -1 ) {
+ QMessageBox::warning( MainWindow::self, i18n( "Insert/Move Action" ),
+ i18n( "Action '%1' has already been added to this toolbar.\n"
+ "An Action may only occur once in a given toolbar." ).
+ arg( a->name() ) );
+ return;
+ }
+
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n( "Add Action '%1' to Toolbar '%2'" ).
+ arg( a->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ lastIndicatorPos = QPoint( -1, -1 );
+}
+
+#endif
+
+void QDesignerToolBar::reInsert()
+{
+ QAction *a = 0;
+ actionMap.clear();
+ clear();
+ for ( a = actionList.first(); a; a = actionList.next() ) {
+ a->addTo( this );
+ if ( ::qt_cast<QActionGroup*>(a) ) {
+ actionMap.insert( ( (QDesignerActionGroup*)a )->widget(), a );
+ if ( ( (QDesignerActionGroup*)a )->widget() )
+ ( (QDesignerActionGroup*)a )->widget()->installEventFilter( this );
+ } else if ( ::qt_cast<QDesignerAction*>(a) ) {
+ actionMap.insert( ( (QDesignerAction*)a )->widget(), a );
+ ( (QDesignerAction*)a )->widget()->installEventFilter( this );
+ } else if ( ::qt_cast<QSeparatorAction*>(a) ) {
+ actionMap.insert( ( (QSeparatorAction*)a )->widget(), a );
+ ( (QSeparatorAction*)a )->widget()->installEventFilter( this );
+ }
+ }
+ QApplication::sendPostedEvents();
+ adjustSize();
+}
+
+void QDesignerToolBar::actionRemoved()
+{
+ actionList.removeRef( (QAction*)sender() );
+}
+
+QPoint QDesignerToolBar::calcIndicatorPos( const QPoint &pos )
+{
+ if ( orientation() == Horizontal ) {
+ QPoint pnt( width() - 2, 0 );
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ if ( !children() )
+ return pnt;
+ pnt = QPoint( 13, 0 );
+ QObjectListIt it( *children() );
+ QObject * obj;
+ while( (obj=it.current()) != 0 ) {
+ ++it;
+ if ( obj->isWidgetType() &&
+ qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
+ QWidget *w = (QWidget*)obj;
+ if ( w->x() < pos.x() ) {
+ pnt.setX( w->x() + w->width() + 1 );
+ insertAnchor = w;
+ afterAnchor = TRUE;
+ }
+ }
+ }
+ return pnt;
+ } else {
+ QPoint pnt( 0, height() - 2 );
+ insertAnchor = 0;
+ afterAnchor = TRUE;
+ if ( !children() )
+ return pnt;
+ pnt = QPoint( 0, 13 );
+ QObjectListIt it( *children() );
+ QObject * obj;
+ while( (obj=it.current()) != 0 ) {
+ ++it;
+ if ( obj->isWidgetType() &&
+ qstrcmp( "qt_dockwidget_internal", obj->name() ) != 0 ) {
+ QWidget *w = (QWidget*)obj;
+ if ( w->y() < pos.y() ) {
+ pnt.setY( w->y() + w->height() + 1 );
+ insertAnchor = w;
+ afterAnchor = TRUE;
+ }
+ }
+ }
+ return pnt;
+ }
+}
+
+void QDesignerToolBar::drawIndicator( const QPoint &pos )
+{
+ if ( lastIndicatorPos == pos )
+ return;
+ bool wasVsisible = indicator->isVisible();
+ if ( orientation() == Horizontal ) {
+ indicator->resize( 3, height() );
+ if ( pos != QPoint( -1, -1 ) )
+ indicator->move( pos.x() - 1, 0 );
+ indicator->show();
+ indicator->raise();
+ lastIndicatorPos = pos;
+ } else {
+ indicator->resize( width(), 3 );
+ if ( pos != QPoint( -1, -1 ) )
+ indicator->move( 0, pos.y() - 1 );
+ indicator->show();
+ indicator->raise();
+ lastIndicatorPos = pos;
+ }
+ if ( !wasVsisible )
+ QApplication::sendPostedEvents();
+}
+
+void QDesignerToolBar::doInsertWidget( const QPoint &p )
+{
+ if ( formWindow != MainWindow::self->formWindow() )
+ return;
+ calcIndicatorPos( p );
+ QWidget *w = WidgetFactory::create( MainWindow::self->currentTool(), this, 0, TRUE );
+ installEventFilters( w );
+ MainWindow::self->formWindow()->insertWidget( w, TRUE );
+ QDesignerAction *a = new QDesignerAction( w, parent() );
+ int index = actionList.findRef( *actionMap.find( insertAnchor ) );
+ if ( index != -1 && afterAnchor )
+ ++index;
+ if ( !insertAnchor )
+ index = 0;
+ AddActionToToolBarCommand *cmd = new AddActionToToolBarCommand( i18n( "Add Widget '%1' to Toolbar '%2'" ).
+ arg( w->name() ).arg( caption() ),
+ formWindow, a, this, index );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ MainWindow::self->resetTool();
+}
+
+void QDesignerToolBar::clear()
+{
+ for ( QAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( ::qt_cast<QDesignerAction*>(a) )
+ ( (QDesignerAction*)a )->remove();
+ }
+ QToolBar::clear();
+}
+
+void QDesignerToolBar::installEventFilters( QWidget *w )
+{
+ if ( !w )
+ return;
+ QObjectList *l = w->queryList( "QWidget" );
+ for ( QObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( this );
+ delete l;
+}
+
+//#include "actiondnd.moc"
diff --git a/kdevdesigner/designer/actiondnd.h b/kdevdesigner/designer/actiondnd.h
new file mode 100644
index 00000000..fcf37fe9
--- /dev/null
+++ b/kdevdesigner/designer/actiondnd.h
@@ -0,0 +1,247 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ACTIONDND_H
+#define ACTIONDND_H
+
+#include <qaction.h>
+#include <qdragobject.h>
+#include <qmap.h>
+#include <qmenubar.h>
+#include <qpixmap.h>
+#include <qpopupmenu.h>
+#include <qptrlist.h>
+#include <qtoolbar.h>
+#include <qguardedptr.h>
+#include "../shared/widgetdatabase.h"
+
+//class QDesignerPopupMenu;
+class QDesignerIndicatorWidget;
+class FormWindow;
+class QPopupMenu;
+
+class QDesignerIndicatorWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ QDesignerIndicatorWidget( QWidget *p )
+ : QWidget( p, "qt_dockwidget_internal" ) {
+ setBackgroundColor( red );
+ }
+
+};
+
+class ActionDrag : public QStoredDrag
+{
+ Q_OBJECT
+
+public:
+ ActionDrag(const QString &type, QAction *action, QWidget *source);
+ ActionDrag(QAction *action, QWidget *source);
+ ActionDrag(QActionGroup *group, QWidget *source);
+
+ ~ActionDrag();
+
+ static bool canDecode(QDropEvent *e);
+
+ static QAction *action()
+ {
+ return the_action;
+ }
+
+private:
+ static QAction *the_action;
+};
+
+class QDesignerActionGroup : public QActionGroup
+{
+ Q_OBJECT
+
+public:
+ QDesignerActionGroup( QObject *parent )
+ : QActionGroup( ::qt_cast<QActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ) { init(); }
+
+ void init();
+
+ QWidget *widget() const { return wid; }
+ QWidget *widget( QAction *a ) const { return *widgets.find( a ); }
+ int index() const { return idx; }
+
+protected:
+#if !defined(Q_NO_USING_KEYWORD)
+ using QActionGroup::addedTo;
+#endif
+ void addedTo( QWidget *w, QWidget * ) {
+ wid = w;
+ }
+ void addedTo( QWidget *w, QWidget *, QAction *a ) {
+ widgets.insert( a, w );
+ }
+ void addedTo( int index, QPopupMenu * ) {
+ idx = index;
+ }
+
+private:
+ QWidget *wid;
+ QMap<QAction *, QWidget *> widgets;
+ int idx;
+
+};
+
+class QDesignerAction : public QAction
+{
+ Q_OBJECT
+
+public:
+ QDesignerAction( QObject *parent )
+ : QAction( ::qt_cast<QActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( 0 ) { init(); }
+ QDesignerAction( QWidget *w, QObject *parent )
+ : QAction( ::qt_cast<QActionGroup*>(parent) ? parent : 0 ), wid( 0 ), idx( -1 ), widgetToInsert( w ) { init(); }
+
+ void init();
+
+ QWidget *widget() const { return wid; }
+ int index() const { return idx; }
+
+ bool addTo( QWidget *w );
+ bool removeFrom( QWidget *w );
+
+ void remove();
+ bool supportsMenu() const { return !widgetToInsert; }
+
+protected:
+ void addedTo( QWidget *w, QWidget * ) {
+ wid = w;
+ }
+ void addedTo( int index, QPopupMenu * ) {
+ idx = index;
+ }
+
+private:
+ QWidget *wid;
+ int idx;
+ QWidget *widgetToInsert;
+
+};
+
+class QDesignerToolBarSeparator : public QWidget
+{
+ Q_OBJECT
+
+public:
+ QDesignerToolBarSeparator( Orientation, QToolBar *parent, const char* name=0 );
+
+ QSize sizeHint() const;
+ Orientation orientation() const { return orient; }
+public slots:
+ void setOrientation( Orientation );
+protected:
+ void styleChange( QStyle& );
+ void paintEvent( QPaintEvent * );
+private:
+ Orientation orient;
+};
+
+
+class QSeparatorAction : public QAction
+{
+ Q_OBJECT
+
+public:
+ QSeparatorAction( QObject *parent );
+
+ bool addTo( QWidget *w );
+ bool removeFrom( QWidget *w );
+ QWidget *widget() const;
+ int index() const;
+
+private:
+ QWidget *wid;
+ int idx;
+
+};
+
+
+class QDesignerToolBar : public QToolBar
+{
+ Q_OBJECT
+
+public:
+ QDesignerToolBar( QMainWindow *mw );
+ QDesignerToolBar( QMainWindow *mw, Dock dock );
+ QPtrList<QAction> insertedActions() const { return actionList; }
+ void addAction( QAction *a );
+
+ void clear();
+ void installEventFilters( QWidget *w );
+ void insertAction( QWidget *w, QAction *a ) { actionMap.insert( w, a ); }
+ void insertAction( int index, QAction *a ) { actionList.insert( index, a ); }
+ void appendAction( QAction *a ) { actionList.append( a ); }
+ void removeAction( QAction *a ) { actionList.remove( a ); }
+ void reInsert();
+ void removeWidget( QWidget *w );
+
+protected:
+ bool eventFilter( QObject *, QEvent * );
+ void paintEvent( QPaintEvent * );
+#ifndef QT_NO_DRAGANDDROP
+ void dragEnterEvent( QDragEnterEvent * );
+ void dragMoveEvent( QDragMoveEvent * );
+ void dragLeaveEvent( QDragLeaveEvent * );
+ void dropEvent( QDropEvent * );
+#endif
+ void contextMenuEvent( QContextMenuEvent *e );
+ void mousePressEvent( QMouseEvent *e );
+ void mouseReleaseEvent( QMouseEvent *e );
+
+private slots:
+ void actionRemoved();
+
+private:
+ void drawIndicator( const QPoint &pos );
+ QPoint calcIndicatorPos( const QPoint &pos );
+ void buttonContextMenuEvent( QContextMenuEvent *e, QObject *o );
+ void buttonMousePressEvent( QMouseEvent *e, QObject *o );
+ void buttonMouseMoveEvent( QMouseEvent *e, QObject *o );
+ void buttonMouseReleaseEvent( QMouseEvent *e, QObject *o );
+ void doInsertWidget( const QPoint &p );
+ void findFormWindow();
+
+private:
+ QPoint lastIndicatorPos;
+ QWidget *insertAnchor;
+ bool afterAnchor;
+ QPtrList<QAction> actionList;
+ QMap<QWidget*, QAction*> actionMap;
+ QPoint dragStartPos;
+ QDesignerIndicatorWidget *indicator;
+ bool widgetInserting;
+ FormWindow *formWindow;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/actioneditor.ui b/kdevdesigner/designer/actioneditor.ui
new file mode 100644
index 00000000..669c60e0
--- /dev/null
+++ b/kdevdesigner/designer/actioneditor.ui
@@ -0,0 +1,227 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ActionEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ActionEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>206</width>
+ <height>227</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Actions</string>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>buttonNewAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_filenew.png"</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Create new Action</string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>buttonDeleteAction</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete current Action</string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>buttonConnect</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_connecttool.png"</pixmap>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Connect current Action</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="ActionListView">
+ <property name="name">
+ <cstring>listActions</cstring>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ActionListView</class>
+ <header location="local">actionlistview.h</header>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>"image0"</pixmap>
+ <signal>selectionChanged( QListViewItem * )</signal>
+ <signal>currentChanged( QListViewItem * )</signal>
+ <signal>clicked( QListViewItem * )</signal>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>listActions</sender>
+ <signal>currentChanged( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listActions</sender>
+ <signal>clicked( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listActions</sender>
+ <signal>selectionChanged( QListViewItem * )</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>currentActionChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewAction</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>newAction()</slot>
+ </connection>
+ <connection>
+ <sender>buttonConnect</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>connectionsClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteAction</sender>
+ <signal>clicked()</signal>
+ <receiver>ActionEditorBase</receiver>
+ <slot>deleteAction()</slot>
+ </connection>
+</connections>
+<forwards>
+ <forward>class QListViewItem;</forward>
+</forwards>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">connectionsClicked()</slot>
+ <slot access="protected">currentActionChanged( QListViewItem * )</slot>
+ <slot access="protected">deleteAction()</slot>
+ <slot access="protected">newAction()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/actioneditorimpl.cpp b/kdevdesigner/designer/actioneditorimpl.cpp
new file mode 100644
index 00000000..589525e4
--- /dev/null
+++ b/kdevdesigner/designer/actioneditorimpl.cpp
@@ -0,0 +1,320 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "actioneditorimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "actionlistview.h"
+#include "connectiondialog.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "formfile.h"
+
+#include <qaction.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qtoolbutton.h>
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qpopupmenu.h>
+#include <qobjectlist.h>
+
+#include <klocale.h>
+
+ActionEditor::ActionEditor( QWidget* parent, const char* name, WFlags fl )
+ : ActionEditorBase( parent, name, fl ), currentAction( 0 ), formWindow( 0 ),
+ explicitlyClosed(false)
+{
+ listActions->addColumn( i18n( "Actions" ) );
+ setEnabled( FALSE );
+ buttonConnect->setEnabled( FALSE );
+
+ QPopupMenu *popup = new QPopupMenu( this );
+ popup->insertItem( i18n( "New &Action" ), this, SLOT( newAction() ) );
+ popup->insertItem( i18n( "New Action &Group" ), this, SLOT( newActionGroup() ) );
+ popup->insertItem( i18n( "New &Dropdown Action Group" ), this, SLOT( newDropDownActionGroup() ) );
+ buttonNewAction->setPopup( popup );
+ buttonNewAction->setPopupDelay( 0 );
+
+ connect( listActions, SIGNAL( insertAction() ), this, SLOT( newAction() ) );
+ connect( listActions, SIGNAL( insertActionGroup() ), this, SLOT( newActionGroup() ) );
+ connect( listActions, SIGNAL( insertDropDownActionGroup() ), this, SLOT( newDropDownActionGroup() ) );
+ connect( listActions, SIGNAL( deleteAction() ), this, SLOT( deleteAction() ) );
+ connect( listActions, SIGNAL( connectAction() ), this, SLOT( connectionsClicked() ) );
+}
+
+void ActionEditor::closeEvent( QCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+void ActionEditor::currentActionChanged( QListViewItem *i )
+{
+ buttonConnect->setEnabled( i != 0 );
+ if ( !i )
+ return;
+ currentAction = ( (ActionItem*)i )->action();
+ if ( !currentAction )
+ currentAction = ( (ActionItem*)i )->actionGroup();
+ if ( formWindow && currentAction )
+ formWindow->setActiveObject( currentAction );
+ MainWindow::self->objectHierarchy()->hierarchyList()->setCurrent( currentAction );
+}
+
+void ActionEditor::setCurrentAction( QAction *a )
+{
+ QListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a || ( (ActionItem*)it.current() )->actionGroup() == a ) {
+ listActions->setCurrentItem( it.current() );
+ listActions->ensureItemVisible( it.current() );
+ break;
+ }
+ ++it;
+ }
+}
+
+QAction *ActionEditor::newActionEx()
+{
+ ActionItem *i = new ActionItem( listActions, (bool)FALSE );
+ QAction *a = i->action();
+ QObject::connect( a, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject* ) ) );
+ MetaDataBase::addEntry( i->action() );
+ QString n = "Action";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->action()->setName( n );
+ i->action()->setText( i->action()->name() );
+ MetaDataBase::setPropertyChanged( i->action(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "name", TRUE );
+ formWindow->actionList().append( i->action() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+ return i->action();
+}
+
+void ActionEditor::deleteAction()
+{
+ if ( !currentAction )
+ return;
+
+ QListViewItemIterator it( listActions );
+ ActionItem *ai = 0;
+ while ( it.current() ) {
+ ai = (ActionItem*)it.current();
+ if ( ai->action() == currentAction || ai->actionGroup() == currentAction ) {
+ emit removing( currentAction );
+ formWindow->actionList().removeRef( currentAction );
+ delete currentAction;
+ currentAction = 0;
+ delete it.current();
+ break;
+ }
+ ++it;
+ }
+ if ( formWindow ) {
+ formWindow->setActiveObject( formWindow->mainContainer() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+ }
+}
+
+void ActionEditor::newAction()
+{
+ ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
+ if ( actionParent ) {
+ if ( !::qt_cast<QActionGroup*>(actionParent->actionGroup()) )
+ actionParent = (ActionItem*)actionParent->parent();
+ }
+
+ ActionItem *i = 0;
+ if ( actionParent )
+ i = new ActionItem( actionParent );
+ else
+ i = new ActionItem( listActions, (bool)FALSE );
+ QAction *a = i->action();
+ QObject::connect( a, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject* ) ) );
+ MetaDataBase::addEntry( i->action() );
+ QString n = "Action";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->action()->setName( n );
+ i->action()->setText( i->action()->name() );
+ if ( actionParent && actionParent->actionGroup() &&
+ actionParent->actionGroup()->usesDropDown() ) {
+ i->action()->setToggleAction( TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "toggleAction", TRUE );
+ }
+ MetaDataBase::setPropertyChanged( i->action(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->action(), "name", TRUE );
+ listActions->setCurrentItem( i );
+ if ( !actionParent )
+ formWindow->actionList().append( i->action() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+}
+
+void ActionEditor::newActionGroup()
+{
+ ActionItem *actionParent = (ActionItem*)listActions->selectedItem();
+ if ( actionParent ) {
+ if ( !::qt_cast<QActionGroup*>(actionParent->actionGroup()) )
+ actionParent = (ActionItem*)actionParent->parent();
+ }
+
+ ActionItem *i = 0;
+ if ( actionParent )
+ i = new ActionItem( actionParent, TRUE );
+ else
+ i = new ActionItem( listActions, TRUE );
+ QAction *ag = i->actionGroup();
+ QObject::connect( ag, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject* ) ) );
+ MetaDataBase::addEntry( i->actionGroup() );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "usesDropDown", TRUE );
+ QString n = "ActionGroup";
+ formWindow->unify( i->action(), n, TRUE );
+ i->setText( 0, n );
+ i->actionGroup()->setName( n );
+ i->actionGroup()->setText( i->actionGroup()->name() );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "text", TRUE );
+ MetaDataBase::setPropertyChanged( i->actionGroup(), "name", TRUE );
+ listActions->setCurrentItem( i );
+ i->setOpen( TRUE );
+ if ( !actionParent )
+ formWindow->actionList().append( i->actionGroup() );
+ if ( formWindow->formFile() )
+ formWindow->formFile()->setModified( TRUE );
+}
+
+void ActionEditor::newDropDownActionGroup()
+{
+ newActionGroup();
+ ( (ActionItem*)listActions->currentItem() )->actionGroup()->setUsesDropDown( TRUE );
+}
+
+void ActionEditor::setFormWindow( FormWindow *fw )
+{
+ listActions->clear();
+ formWindow = fw;
+ if ( !formWindow ||
+ !::qt_cast<QMainWindow*>(formWindow->mainContainer()) ) {
+ setEnabled( FALSE );
+ } else {
+ setEnabled( TRUE );
+ for ( QAction *a = formWindow->actionList().first(); a; a = formWindow->actionList().next() ) {
+ ActionItem *i = 0;
+ if ( ::qt_cast<QAction*>(a->parent()) )
+ continue;
+ i = new ActionItem( listActions, a );
+ i->setText( 0, a->name() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ // make sure we don't duplicate the connection
+ QObject::disconnect( a, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject * ) ) );
+ QObject::connect( a, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject* ) ) );
+ if ( ::qt_cast<QActionGroup*>(a) ) {
+ insertChildActions( i );
+ }
+ }
+ if ( listActions->firstChild() ) {
+ listActions->setCurrentItem( listActions->firstChild() );
+ listActions->setSelected( listActions->firstChild(), TRUE );
+ }
+ }
+}
+
+void ActionEditor::insertChildActions( ActionItem *i )
+{
+ if ( !i->actionGroup() || !i->actionGroup()->children() )
+ return;
+ QObjectListIt it( *i->actionGroup()->children() );
+ while ( it.current() ) {
+ QObject *o = it.current();
+ ++it;
+ if ( !::qt_cast<QAction*>(o) )
+ continue;
+ QAction *a = (QAction*)o;
+ ActionItem *i2 = new ActionItem( (QListViewItem*)i, a );
+ i->setOpen( TRUE );
+ i2->setText( 0, a->name() );
+ i2->setPixmap( 0, a->iconSet().pixmap() );
+ // make sure we don't duplicate the connection
+ QObject::disconnect( o, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject * ) ) );
+ QObject::connect( o, SIGNAL( destroyed( QObject * ) ),
+ this, SLOT( removeConnections( QObject * ) ) );
+ if ( ::qt_cast<QActionGroup*>(a) )
+ insertChildActions( i2 );
+ }
+}
+
+void ActionEditor::updateActionName( QAction *a )
+{
+ QListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a )
+ ( (ActionItem*)it.current() )->setText( 0, a->name() );
+ else if ( ( (ActionItem*)it.current() )->actionGroup() == a )
+ ( (ActionItem*)it.current() )->setText( 0, a->name() );
+ ++it;
+ }
+}
+
+void ActionEditor::updateActionIcon( QAction *a )
+{
+ QListViewItemIterator it( listActions );
+ while ( it.current() ) {
+ if ( ( (ActionItem*)it.current() )->action() == a )
+ ( (ActionItem*)it.current() )->setPixmap( 0, a->iconSet().pixmap() );
+ else if ( ( (ActionItem*)it.current() )->actionGroup() == a )
+ ( (ActionItem*)it.current() )->setPixmap( 0, a->iconSet().pixmap() );
+ ++it;
+ }
+}
+
+void ActionEditor::connectionsClicked()
+{
+ ConnectionDialog dlg( formWindow->mainWindow() );
+ dlg.setDefault( currentAction, formWindow );
+ dlg.addConnection();
+ dlg.exec();
+}
+
+void ActionEditor::removeConnections( QObject *o )
+{
+ QValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( formWindow, o );
+ for ( QValueList<MetaDataBase::Connection>::Iterator it2 = conns.begin();
+ it2 != conns.end(); ++it2 )
+ MetaDataBase::removeConnection( formWindow, (*it2).sender, (*it2).signal,
+ (*it2).receiver, (*it2).slot );
+}
diff --git a/kdevdesigner/designer/actioneditorimpl.h b/kdevdesigner/designer/actioneditorimpl.h
new file mode 100644
index 00000000..439a8fb8
--- /dev/null
+++ b/kdevdesigner/designer/actioneditorimpl.h
@@ -0,0 +1,79 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ACTIONEDITORIMPL_H
+#define ACTIONEDITORIMPL_H
+
+#include "actioneditor.h"
+
+class QAction;
+class FormWindow;
+class ActionItem;
+
+class ActionEditor : public ActionEditorBase
+{
+ Q_OBJECT
+
+public:
+ ActionEditor( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ void setFormWindow( FormWindow *fw );
+ void updateActionName( QAction *a );
+ void updateActionIcon( QAction *a );
+ FormWindow *form() const { return formWindow; }
+
+ bool wantToBeShown() const { return !explicitlyClosed; }
+ void setWantToBeShown( bool b ) { explicitlyClosed = !b; }
+
+ void setCurrentAction( QAction *a );
+ QAction *newActionEx();
+
+protected:
+ void closeEvent( QCloseEvent *e );
+
+protected slots:
+ void currentActionChanged( QListViewItem * );
+ void deleteAction();
+ void newAction();
+ void newActionGroup();
+ void newDropDownActionGroup();
+ void connectionsClicked();
+ void removeConnections( QObject *o );
+
+signals:
+ void hidden();
+ void removing( QAction * );
+
+private:
+ void insertChildActions( ActionItem *i );
+
+private:
+ QAction *currentAction;
+ FormWindow *formWindow;
+ bool explicitlyClosed;
+
+};
+
+#endif // ACTIONEDITORIMPL_H
diff --git a/kdevdesigner/designer/actionlistview.cpp b/kdevdesigner/designer/actionlistview.cpp
new file mode 100644
index 00000000..53c7e292
--- /dev/null
+++ b/kdevdesigner/designer/actionlistview.cpp
@@ -0,0 +1,110 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "actionlistview.h"
+#include <qheader.h>
+
+#include <klocale.h>
+
+ActionListView::ActionListView( QWidget *parent, const char *name )
+ : QListView( parent, name )
+{
+ setShowSortIndicator( TRUE );
+ setResizeMode( LastColumn );
+ setRootIsDecorated( TRUE );
+ connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( rmbMenu( QListViewItem *, const QPoint & ) ) );
+}
+
+ActionItem::ActionItem( QListView *lv, QAction *ac )
+ : QListViewItem( lv ), a( 0 ), g( 0 )
+{
+ g = ::qt_cast<QDesignerActionGroup*>(ac);
+ if ( !g )
+ a = ::qt_cast<QDesignerAction*>(ac);
+ setDragEnabled( TRUE );
+}
+
+ActionItem::ActionItem( QListViewItem *i, QAction *ac )
+ : QListViewItem( i ), a( 0 ), g( 0 )
+{
+ g = ::qt_cast<QDesignerActionGroup*>(ac);
+ if ( !g )
+ a = ::qt_cast<QDesignerAction*>(ac);
+ setDragEnabled( TRUE );
+ moveToEnd();
+}
+
+void ActionItem::moveToEnd()
+{
+ QListViewItem *i = this;
+ while ( i->nextSibling() )
+ i = i->nextSibling();
+ if ( i != this )
+ moveItem( i );
+}
+
+QDragObject *ActionListView::dragObject()
+{
+ ActionItem *i = (ActionItem*)currentItem();
+ if ( !i )
+ return 0;
+ QStoredDrag *drag = 0;
+ if ( i->action() ) {
+ drag = new ActionDrag( i->action(), viewport() );
+ drag->setPixmap( i->action()->iconSet().pixmap() );
+ } else {
+ drag = new ActionDrag( i->actionGroup(), viewport() );
+ drag->setPixmap( i->actionGroup()->iconSet().pixmap() );
+ }
+ return drag;
+}
+
+void ActionListView::rmbMenu( QListViewItem *i, const QPoint &p )
+{
+ QPopupMenu *popup = new QPopupMenu( this );
+ popup->insertItem( i18n( "New &Action" ), 0 );
+ popup->insertItem( i18n( "New Action &Group" ), 1 );
+ popup->insertItem( i18n( "New &Dropdown Action Group" ), 2 );
+ if ( i ) {
+ popup->insertSeparator();
+ popup->insertItem( i18n( "&Connect Action..." ), 3 );
+ popup->insertSeparator();
+ popup->insertItem( i18n( "Delete Action" ), 4 );
+ }
+ int res = popup->exec( p );
+ if ( res == 0 )
+ emit insertAction();
+ else if ( res == 1 )
+ emit insertActionGroup();
+ else if ( res == 2 )
+ emit insertDropDownActionGroup();
+ else if ( res == 3 )
+ emit connectAction();
+ else if ( res == 4 )
+ emit deleteAction();
+}
diff --git a/kdevdesigner/designer/actionlistview.h b/kdevdesigner/designer/actionlistview.h
new file mode 100644
index 00000000..59c48b20
--- /dev/null
+++ b/kdevdesigner/designer/actionlistview.h
@@ -0,0 +1,81 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ACTIONLISTVIEW_H
+#define ACTIONLISTVIEW_H
+
+#include <qlistview.h>
+#include "actiondnd.h"
+
+class ActionItem : public QListViewItem
+{
+public:
+ ActionItem( QListView *lv, bool group )
+ : QListViewItem( lv ),
+ a( group ? 0 : new QDesignerAction( 0 ) ),
+ g( group ? new QDesignerActionGroup( 0 ) : 0 ) { setDragEnabled( TRUE ); }
+ ActionItem( QListView *lv, QAction *ac );
+ ActionItem( QListViewItem *i, QAction *ac );
+ ActionItem( ActionItem *parent, bool group = FALSE )
+ : QListViewItem( parent ),
+ a( group ? 0 : new QDesignerAction( parent->actionGroup() ) ),
+ g( group ? new QDesignerActionGroup( parent->actionGroup() ) : 0 ) { setDragEnabled( TRUE ); moveToEnd(); }
+
+ QDesignerAction *action() const { return a; }
+ QDesignerActionGroup *actionGroup() const { return g; }
+
+private:
+ void moveToEnd();
+
+private:
+ QDesignerAction *a;
+ QDesignerActionGroup *g;
+
+};
+
+class ActionListView : public QListView
+{
+ Q_OBJECT
+
+public:
+ ActionListView( QWidget *parent = 0, const char *name = 0 );
+
+protected:
+ QDragObject *dragObject();
+
+private slots:
+ void rmbMenu( QListViewItem *i, const QPoint &p );
+
+signals:
+ void insertAction();
+ void insertActionGroup();
+ void insertDropDownActionGroup();
+ void deleteAction();
+ void connectAction();
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/asciivalidator.cpp b/kdevdesigner/designer/asciivalidator.cpp
new file mode 100644
index 00000000..7642d47f
--- /dev/null
+++ b/kdevdesigner/designer/asciivalidator.cpp
@@ -0,0 +1,94 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "asciivalidator.h"
+
+#include <qstring.h>
+
+AsciiValidator::AsciiValidator( QObject * parent, const char *name )
+ : QValidator( parent, name ), functionName( FALSE )
+{
+}
+
+AsciiValidator::AsciiValidator( bool funcName, QObject * parent, const char *name )
+ : QValidator( parent, name ), functionName( funcName )
+{
+}
+
+AsciiValidator::AsciiValidator( const QString &allow, QObject * parent, const char *name )
+ : QValidator( parent, name ), functionName( FALSE ), allowedChars( allow )
+{
+}
+
+AsciiValidator::~AsciiValidator()
+{
+}
+
+QValidator::State AsciiValidator::validate( QString &s, int & ) const
+{
+ bool inParen = FALSE;
+ bool outParen = FALSE;
+ if ( !s.isEmpty() && s[0].row() == 0 && s[0].cell() >= '0' && s[0].cell() <= '9' )
+ s[0] = '_';
+ for ( int i = 0, j = 0; i < (int) s.length(); i++ ) {
+ uchar r = s[i].row();
+ uchar c = s[i].cell();
+
+ if ( outParen ) { // check if we have 'const' or 'volatile'
+ static const QString con = " const";
+ static const QString vol = " volatile";
+ QString mid = s.mid( j );
+ if ( !( con.startsWith( mid ) || vol.startsWith( mid ) ) )
+ return QValidator::Invalid;
+ }
+
+ if ( inParen && c != ')' )
+ continue;
+
+ if ( r == 0 && ( ( c >= '0' && c <= '9' ) ||
+ ( c >= 'a' && c <= 'z' ) ||
+ ( c >= 'A' && c <= 'Z' ) ) )
+ continue;
+
+ if ( functionName ) {
+ if ( c == '(' ) {
+ inParen = TRUE;
+ continue;
+ }
+ if ( c == ')' ) {
+ outParen = TRUE;
+ j = i + 1;
+ continue;
+ }
+ }
+
+ if ( allowedChars.find( s[ i ] ) != -1 )
+ continue;
+
+ s[i] = '_';
+ }
+ return QValidator::Acceptable;
+}
diff --git a/kdevdesigner/designer/asciivalidator.h b/kdevdesigner/designer/asciivalidator.h
new file mode 100644
index 00000000..2cdfe0cb
--- /dev/null
+++ b/kdevdesigner/designer/asciivalidator.h
@@ -0,0 +1,52 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ASCIIVALIDATOR_H
+#define ASCIIVALIDATOR_H
+
+
+#include <qvalidator.h>
+
+
+class AsciiValidator: public QValidator
+{
+ Q_OBJECT
+public:
+ AsciiValidator( QObject * parent, const char *name = 0 );
+ AsciiValidator( bool funcName, QObject * parent, const char *name = 0 );
+ AsciiValidator( const QString &allow, QObject * parent, const char *name = 0 );
+ ~AsciiValidator();
+
+ QValidator::State validate( QString &, int & ) const;
+
+private:
+ bool functionName;
+ QString allowedChars;
+
+};
+
+
+#endif
diff --git a/kdevdesigner/designer/command.cpp b/kdevdesigner/designer/command.cpp
new file mode 100644
index 00000000..83ec9a77
--- /dev/null
+++ b/kdevdesigner/designer/command.cpp
@@ -0,0 +1,2473 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "command.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+#include "propertyeditor.h"
+#include "metadatabase.h"
+#include <widgetdatabase.h>
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "workspace.h"
+#include "actioneditorimpl.h"
+#include "actiondnd.h"
+#include "formfile.h"
+#include "../interfaces/languageinterface.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+#include <qfeatures.h>
+#include <qwidget.h>
+#include <qmetaobject.h>
+#include <qapplication.h>
+#include <qlayout.h>
+#include <qmessagebox.h>
+#include <qlistbox.h>
+#include <qiconview.h>
+#include <qtextedit.h>
+#include <qptrstack.h>
+#include <qheader.h>
+#include <qsplitter.h>
+#ifndef QT_NO_TABLE
+#include <qtable.h>
+#endif
+#include <qaction.h>
+
+#include "kdevdesigner_part.h"
+
+#include <klocale.h>
+
+CommandHistory::CommandHistory( int s )
+ : current( -1 ), steps( s ), savedAt( -1 )
+{
+ history.setAutoDelete( TRUE );
+ modified = FALSE;
+ compressedCommand = 0;
+}
+
+void CommandHistory::addCommand( Command *cmd, bool tryCompress )
+{
+ if ( tryCompress ) {
+ if ( !compressedCommand ||
+ compressedCommand->type() != cmd->type() ||
+ !compressedCommand->canMerge( cmd ) ) {
+ checkCompressedCommand();
+ compressedCommand = 0;
+ }
+
+ if ( compressedCommand ) {
+ compressedCommand->merge( cmd );
+ modified = TRUE;
+ modificationChanged( modified );
+ return;
+ }
+ compressedCommand = cmd;
+ } else {
+ checkCompressedCommand();
+ }
+
+ if ( current < (int)history.count() - 1 ) {
+ if ( current < savedAt )
+ savedAt = -2;
+
+ QPtrList<Command> commands;
+ commands.setAutoDelete( FALSE );
+
+ for( int i = 0; i <= current; ++i ) {
+ commands.insert( i, history.at( 0 ) );
+ history.take( 0 );
+ }
+
+ commands.append( cmd );
+ history.clear();
+ history = commands;
+ history.setAutoDelete( TRUE );
+ } else {
+ history.append( cmd );
+ }
+
+ if ( (int)history.count() > steps ) {
+ savedAt--;
+ history.removeFirst();
+ } else {
+ ++current;
+ }
+
+ emitUndoRedo();
+ modified = TRUE;
+ modificationChanged( modified );
+}
+
+void CommandHistory::undo()
+{
+ checkCompressedCommand();
+ compressedCommand = 0;
+ if ( current > -1 ) {
+ history.at( current )->unexecute();
+ --current;
+ }
+ emitUndoRedo();
+ modified = savedAt != current;
+ modificationChanged( modified );
+}
+
+void CommandHistory::redo()
+{
+ checkCompressedCommand();
+ compressedCommand = 0;
+ if ( current > -1 ) {
+ if ( current < (int)history.count() - 1 ) {
+ ++current;
+ history.at( current )->execute();
+ }
+ } else {
+ if ( history.count() > 0 ) {
+ ++current;
+ history.at( current )->execute();
+ }
+ }
+ emitUndoRedo();
+ modified = savedAt != current;
+ modificationChanged( modified );
+}
+
+void CommandHistory::emitUndoRedo()
+{
+ Command *undoCmd = 0;
+ Command *redoCmd = 0;
+
+ if ( current >= 0 && current < (int)history.count() )
+ undoCmd = history.at( current );
+ if ( current + 1 >= 0 && current + 1 < (int)history.count() )
+ redoCmd = history.at( current + 1 );
+
+ bool ua = (undoCmd != 0);
+ QString uc;
+ if ( ua )
+ uc = undoCmd->name();
+ bool ra = (redoCmd != 0);
+ QString rc;
+ if ( ra )
+ rc = redoCmd->name();
+ emit undoRedoChanged( ua, ra, uc, rc );
+}
+
+void CommandHistory::setModified( bool m )
+{
+ modified = m;
+ if ( !modified )
+ savedAt = current;
+ modificationChanged( modified );
+}
+
+bool CommandHistory::isModified() const
+{
+ return modified;
+}
+
+void CommandHistory::checkCompressedCommand()
+{
+ if ( compressedCommand && compressedCommand->type() == Command::SetProperty ) {
+ Command *c = compressedCommand;
+ compressedCommand = 0;
+ if ( !( (SetPropertyCommand*)c )->checkProperty() ) {
+ history.remove( current );
+ --current;
+ emitUndoRedo();
+ }
+ }
+}
+
+// ------------------------------------------------------------
+
+Command::Command( const QString &n, FormWindow *fw )
+ : cmdName( n ), formWin( fw )
+{
+}
+
+Command::~Command()
+{
+}
+
+QString Command::name() const
+{
+ return cmdName;
+}
+
+FormWindow *Command::formWindow() const
+{
+ return formWin;
+}
+
+void Command::merge( Command * )
+{
+}
+
+bool Command::canMerge( Command * )
+{
+ return FALSE;
+}
+
+// ------------------------------------------------------------
+
+ResizeCommand::ResizeCommand( const QString &n, FormWindow *fw,
+ QWidget *w, const QRect &oldr, const QRect &nr )
+ : Command( n, fw ), widget( w ), oldRect( oldr ), newRect( nr )
+{
+}
+
+void ResizeCommand::execute()
+{
+ widget->setGeometry( newRect );
+ formWindow()->updateSelection( widget );
+ formWindow()->emitUpdateProperties( widget );
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow()->updateChildSelections( widget );
+}
+
+void ResizeCommand::unexecute()
+{
+ widget->setGeometry( oldRect );
+ formWindow()->updateSelection( widget );
+ formWindow()->emitUpdateProperties( widget );
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow()->updateChildSelections( widget );
+}
+
+// ------------------------------------------------------------
+
+InsertCommand::InsertCommand( const QString &n, FormWindow *fw,
+ QWidget *w, const QRect &g )
+ : Command( n, fw ), widget( w ), geometry( g )
+{
+}
+
+void InsertCommand::execute()
+{
+ if ( geometry.size() == QSize( 0, 0 ) ) {
+ widget->move( geometry.topLeft() );
+ widget->adjustSize();
+ } else {
+ QSize s = geometry.size().expandedTo( widget->minimumSize() );
+ s = s.expandedTo( widget->minimumSizeHint() );
+ QRect r( geometry.topLeft(), s );
+ widget->setGeometry( r );
+ }
+ widget->show();
+ formWindow()->widgets()->insert( widget, widget );
+ formWindow()->clearSelection( FALSE );
+ formWindow()->selectWidget( widget );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( widget );
+}
+
+void InsertCommand::unexecute()
+{
+ widget->hide();
+ formWindow()->selectWidget( widget, FALSE );
+ formWindow()->widgets()->remove( widget );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( widget );
+ }
+
+// ------------------------------------------------------------
+
+MoveCommand::MoveCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &w,
+ const QValueList<QPoint> op,
+ const QValueList<QPoint> np,
+ QWidget *opr, QWidget *npr )
+ : Command( n, fw ), widgets( w ), oldPos( op ), newPos( np ),
+ oldParent( opr ), newParent( npr )
+{
+ widgets.setAutoDelete( FALSE );
+}
+
+void MoveCommand::merge( Command *c )
+{
+ MoveCommand *cmd = (MoveCommand*)c;
+ newPos = cmd->newPos;
+}
+
+bool MoveCommand::canMerge( Command *c )
+{
+ MoveCommand *cmd = (MoveCommand*)c;
+ return widgets == cmd->widgets;
+}
+
+
+void MoveCommand::execute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) {
+ if ( newParent && oldParent && newParent != oldParent ) {
+ QPoint pos = newParent->mapFromGlobal( w->mapToGlobal( QPoint( 0,0 ) ) );
+ w->reparent( newParent, pos, TRUE );
+ formWindow()->raiseSelection( w );
+ formWindow()->raiseChildSelections( w );
+ formWindow()->widgetChanged( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+ w->move( newPos[ widgets.at() ] );
+ }
+ formWindow()->updateSelection( w );
+ formWindow()->updateChildSelections( w );
+ formWindow()->emitUpdateProperties( w );
+ }
+}
+
+void MoveCommand::unexecute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout ) {
+ if ( newParent && oldParent && newParent != oldParent ) {
+ QPoint pos = oldParent->mapFromGlobal( w->mapToGlobal( QPoint( 0,0 ) ) );
+ w->reparent( oldParent, pos, TRUE );
+ formWindow()->raiseSelection( w );
+ formWindow()->raiseChildSelections( w );
+ formWindow()->widgetChanged( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+ w->move( oldPos[ widgets.at() ] );
+ }
+ formWindow()->updateSelection( w );
+ formWindow()->updateChildSelections( w );
+ formWindow()->emitUpdateProperties( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+DeleteCommand::DeleteCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &wl )
+ : Command( n, fw ), widgets( wl )
+{
+ widgets.setAutoDelete( FALSE );
+ QWidgetList copyOfWidgets = widgets;
+ copyOfWidgets.setAutoDelete(FALSE);
+
+ // Include the children of the selected items when deleting
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ QObjectList *children = w->queryList( "QWidget" );
+ for ( QWidget *c = (QWidget *)children->first(); c; c = (QWidget *)children->next() ) {
+ if ( copyOfWidgets.find( c ) == -1 && formWindow()->widgets()->find( c ) ) {
+ widgets.insert(widgets.at() + 1, c);
+ widgets.prev();
+ copyOfWidgets.append(c);
+ }
+ }
+ delete children;
+ }
+}
+
+void DeleteCommand::execute()
+{
+ formWindow()->setPropertyShowingBlocked( TRUE );
+ connections.clear();
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->hide();
+ QString s = w->name();
+ s.prepend( "qt_dead_widget_" );
+ w->setName( s );
+ formWindow()->selectWidget( w, FALSE );
+ formWindow()->widgets()->remove( w );
+ QValueList<MetaDataBase::Connection> conns = MetaDataBase::connections( formWindow(), w );
+ connections.insert( w, conns );
+ QValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ for ( ; it != conns.end(); ++it ) {
+ MetaDataBase::removeConnection( formWindow(), (*it).sender,
+ (*it).signal, (*it).receiver, (*it).slot );
+ }
+ }
+ formWindow()->setPropertyShowingBlocked( FALSE );
+ formWindow()->emitShowProperties();
+ formWindow()->mainWindow()->objectHierarchy()->widgetsRemoved( widgets );
+
+}
+
+void DeleteCommand::unexecute()
+{
+ formWindow()->setPropertyShowingBlocked( TRUE );
+ formWindow()->clearSelection( FALSE );
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->show();
+ QString s = w->name();
+ s.remove( 0, QString( "qt_dead_widget_" ).length() );
+ w->setName( s );
+ formWindow()->widgets()->insert( w, w );
+ formWindow()->selectWidget( w );
+ QValueList<MetaDataBase::Connection> conns = *connections.find( w );
+ QValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ for ( ; it != conns.end(); ++it ) {
+ MetaDataBase::addConnection( formWindow(), (*it).sender,
+ (*it).signal, (*it).receiver, (*it).slot );
+ }
+ }
+ formWindow()->setPropertyShowingBlocked( FALSE );
+ formWindow()->emitShowProperties();
+ formWindow()->mainWindow()->objectHierarchy()->widgetsInserted( widgets );
+}
+
+// ------------------------------------------------------------
+
+SetPropertyCommand::SetPropertyCommand( const QString &n, FormWindow *fw,
+ QObject *w, PropertyEditor *e,
+ const QString &pn, const QVariant &ov,
+ const QVariant &nv, const QString &ncut,
+ const QString &ocut, bool reset )
+ : Command( n, fw ), widget( w ), editor( e ), propName( pn ),
+ oldValue( ov ), newValue( nv ), oldCurrentItemText( ocut ), newCurrentItemText( ncut ),
+ wasChanged( TRUE ), isResetCommand( reset )
+{
+ wasChanged = MetaDataBase::isPropertyChanged( w, propName );
+ if ( oldCurrentItemText.isNull() )
+ oldCurrentItemText = "";
+ if ( newCurrentItemText.isNull() )
+ newCurrentItemText = "";
+}
+
+
+void SetPropertyCommand::execute()
+{
+ if ( !wasChanged )
+ MetaDataBase::setPropertyChanged( widget, propName, TRUE );
+ if ( isResetCommand ) {
+ MetaDataBase::setPropertyChanged( widget, propName, FALSE );
+ if ( WidgetFactory::resetProperty( widget, propName ) ) {
+ if ( !formWindow()->isWidgetSelected( widget ) && formWindow() != (QObject *)widget )
+ formWindow()->selectWidget( (QObject *)widget );
+ if ( editor->widget() != widget )
+ editor->setWidget( widget, formWindow() );
+ editor->propertyList()->setCurrentProperty( propName );
+ PropertyItem *i = (PropertyItem*)editor->propertyList()->currentItem();
+ if ( !i )
+ return;
+ i->setValue( widget->property( propName ) );
+ i->setChanged( FALSE );
+ editor->refetchData();
+ editor->emitWidgetChanged();
+ return;
+ }
+ }
+ setProperty( newValue, newCurrentItemText );
+}
+
+void SetPropertyCommand::unexecute()
+{
+ if ( !wasChanged )
+ MetaDataBase::setPropertyChanged( widget, propName, FALSE );
+ if ( isResetCommand )
+ MetaDataBase::setPropertyChanged( widget, propName, TRUE );
+ setProperty( oldValue, oldCurrentItemText );
+}
+
+bool SetPropertyCommand::canMerge( Command *c )
+{
+ SetPropertyCommand *cmd = (SetPropertyCommand*)c;
+ if ( !widget )
+ return FALSE;
+ const QMetaProperty *p =
+ widget->metaObject()->property( widget->metaObject()->findProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ if ( propName == "toolTip" || propName == "whatsThis" )
+ return TRUE;
+ if ( ::qt_cast<CustomWidget*>((QObject *)widget) ) {
+ MetaDataBase::CustomWidget *cw = ((CustomWidget*)(QObject*)widget)->customWidget();
+ if ( !cw )
+ return FALSE;
+ for ( QValueList<MetaDataBase::Property>::Iterator it = cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) {
+ if ( QString( (*it ).property ) == propName ) {
+ if ( (*it).type == "String" || (*it).type == "CString" || (*it).type == "Int" || (*it).type == "UInt" )
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+ }
+ QVariant::Type t = QVariant::nameToType( p->type() );
+ return ( cmd->propName == propName &&
+ t == QVariant::String || t == QVariant::CString || t == QVariant::Int || t == QVariant::UInt );
+}
+
+void SetPropertyCommand::merge( Command *c )
+{
+ SetPropertyCommand *cmd = (SetPropertyCommand*)c;
+ newValue = cmd->newValue;
+ newCurrentItemText = cmd->newCurrentItemText;
+}
+
+bool SetPropertyCommand::checkProperty()
+{
+ if ( propName == "name" /*|| propName == "itemName"*/ ) { // ### fix that
+ QString s = newValue.toString();
+ if ( !formWindow()->unify( widget, s, FALSE ) ) {
+ QMessageBox::information( formWindow()->mainWindow(),
+ i18n( "Set 'name' Property" ),
+ i18n( "The name of a widget must be unique.\n"
+ "'%1' is already used in form '%2',\n"
+ "so the name has been reverted to '%3'." ).
+ arg( newValue.toString() ).
+ arg( formWindow()->name() ).
+ arg( oldValue.toString() ));
+ setProperty( oldValue, oldCurrentItemText, FALSE );
+ return FALSE;
+ }
+ if ( s.isEmpty() ) {
+ QMessageBox::information( formWindow()->mainWindow(),
+ i18n( "Set 'name' Property" ),
+ i18n( "The name of a widget must not be null.\n"
+ "The name has been reverted to '%1'." ).
+ arg( oldValue.toString() ));
+ setProperty( oldValue, oldCurrentItemText, FALSE );
+ return FALSE;
+ }
+
+ if ( ::qt_cast<FormWindow*>(widget->parent()) )
+ formWindow()->mainWindow()->formNameChanged( (FormWindow*)((QWidget*)(QObject*)widget)->parentWidget() );
+ }
+ return TRUE;
+}
+
+void SetPropertyCommand::setProperty( const QVariant &v, const QString &currentItemText, bool select )
+{
+ if ( !widget )
+ return;
+
+ if ( !formWindow()->isWidgetSelected( widget ) && !formWindow()->isMainContainer( widget ) && select )
+ formWindow()->selectWidget( widget );
+ if ( editor->widget() != widget && select )
+ editor->setWidget( widget, formWindow() );
+ if ( select )
+ editor->propertyList()->setCurrentProperty( propName );
+ const QMetaProperty *p =
+ widget->metaObject()->property( widget->metaObject()->findProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ if ( propName == "hAlign" ) {
+ p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", TRUE ), TRUE );
+ int align = widget->property( "alignment" ).toInt();
+ align &= ~( AlignHorizontal_Mask );
+ align |= p->keyToValue( currentItemText );
+ widget->setProperty( "alignment", QVariant( align ) );
+ } else if ( propName == "vAlign" ) {
+ p = widget->metaObject()->property( widget->metaObject()->findProperty( "alignment", TRUE ), TRUE );
+ int align = widget->property( "alignment" ).toInt();
+ align &= ~( AlignVertical_Mask );
+ align |= p->keyToValue( currentItemText );
+ widget->setProperty( "alignment", QVariant( align ) );
+ } else if ( propName == "wordwrap" ) {
+ int align = widget->property( "alignment" ).toInt();
+ align &= ~WordBreak;
+ if ( v.toBool() )
+ align |= WordBreak;
+ widget->setProperty( "alignment", QVariant( align ) );
+ } else if ( propName == "layoutSpacing" ) {
+ QVariant val = v;
+ if ( val.toString() == "default" )
+ val = -1;
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), val.toInt() );
+ } else if ( propName == "layoutMargin" ) {
+ QVariant val = v;
+ if ( val.toString() == "default" )
+ val = -1;
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), val.toInt() );
+ } else if ( propName == "resizeMode" ) {
+ MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ), currentItemText );
+ } else if ( propName == "toolTip" || propName == "whatsThis" || propName == "database" || propName == "frameworkCode" ) {
+ MetaDataBase::setFakeProperty( editor->widget(), propName, v );
+ } else if ( ::qt_cast<CustomWidget*>(editor->widget()) ) {
+ MetaDataBase::CustomWidget *cw = ((CustomWidget *)(QObject *)widget)->customWidget();
+ if ( cw ) {
+ MetaDataBase::setFakeProperty( editor->widget(), propName, v );
+ }
+ }
+ editor->refetchData();
+ editor->emitWidgetChanged();
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->setChanged( MetaDataBase::isPropertyChanged( widget, propName ) );
+#ifndef QT_NO_SQL
+ if ( propName == "database" ) {
+ formWindow()->mainWindow()->objectHierarchy()->databasePropertyChanged( (QWidget*)((QObject *)widget), MetaDataBase::fakeProperty( widget, "database" ).toStringList() );
+ }
+#endif
+ return;
+ }
+
+ if ( p->isSetType() ) {
+ QStrList strlst;
+ QStringList lst = QStringList::split( "|", currentItemText );
+ QValueListConstIterator<QString> it = lst.begin();
+ for ( ; it != lst.end(); ++it )
+ strlst.append( (*it).latin1() );
+ widget->setProperty( propName, p->keysToValue( strlst ) );
+ } else if ( p->isEnumType() ) {
+ widget->setProperty( propName, p->keyToValue( currentItemText ) );
+ } else if ( qstrcmp( p->name(), "buddy" ) == 0 ) {
+ widget->setProperty( propName, currentItemText );
+ } else {
+ QVariant ov;
+ if ( propName == "name" || propName == "itemName" )
+ ov = widget->property( propName );
+ int oldSerNum = -1;
+ if ( v.type() == QVariant::Pixmap )
+ oldSerNum = v.toPixmap().serialNumber();
+ widget->setProperty( propName, v );
+ if ( oldSerNum != -1 && oldSerNum != widget->property( propName ).toPixmap().serialNumber() )
+ MetaDataBase::setPixmapKey( formWindow(),
+ widget->property( propName ).toPixmap().serialNumber(),
+ MetaDataBase::pixmapKey( formWindow(), oldSerNum ) );
+ if ( propName == "cursor" ) {
+ MetaDataBase::setCursor( (QWidget*)((QObject *)widget), v.toCursor() );
+ }
+ if ( propName == "name" && widget->isWidgetType() ) {
+ formWindow()->mainWindow()->objectHierarchy()->namePropertyChanged( ((QWidget*)(QObject *)widget), ov );
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setName( v.toCString() );
+ }
+ if ( propName == "name" && ::qt_cast<QAction*>((QObject *)widget) && ::qt_cast<QMainWindow*>(formWindow()->mainContainer()) ) {
+ formWindow()->mainWindow()->actioneditor()->updateActionName( (QAction*)(QObject *)widget );
+ }
+ if ( propName == "iconSet" && ::qt_cast<QAction*>((QObject *)widget) && ::qt_cast<QMainWindow*>(formWindow()->mainContainer()) ) {
+ formWindow()->mainWindow()->actioneditor()->updateActionIcon( (QAction*)(QObject *)widget );
+ }
+ if ( propName == "caption" ) {
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setCaption( v.toString() );
+ }
+ if ( propName == "icon" ) {
+ if ( formWindow()->isMainContainer( widget ) )
+ formWindow()->setIcon( v.toPixmap() );
+ }
+ }
+ editor->refetchData();
+ if ( editor->propertyList()->currentItem() && select ) {
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->showEditor();
+ ( ( PropertyItem* )editor->propertyList()->currentItem() )->setChanged( MetaDataBase::isPropertyChanged( widget, propName ) );
+ }
+ editor->emitWidgetChanged();
+ formWindow()->killAccels( widget );
+}
+
+// ------------------------------------------------------------
+
+LayoutHorizontalCommand::LayoutHorizontalCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl )
+ : Command( n, fw ), layout( wl, parent, fw, layoutBase )
+{
+}
+
+void LayoutHorizontalCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutHorizontalCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutHorizontalSplitCommand::LayoutHorizontalSplitCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl )
+ : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE )
+{
+}
+
+void LayoutHorizontalSplitCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutHorizontalSplitCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutVerticalCommand::LayoutVerticalCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl )
+ : Command( n, fw ), layout( wl, parent, fw, layoutBase )
+{
+}
+
+void LayoutVerticalCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutVerticalCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutVerticalSplitCommand::LayoutVerticalSplitCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl )
+ : Command( n, fw ), layout( wl, parent, fw, layoutBase, TRUE, TRUE )
+{
+}
+
+void LayoutVerticalSplitCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutVerticalSplitCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+LayoutGridCommand::LayoutGridCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl, int xres, int yres )
+ : Command( n, fw ), layout( wl, parent, fw, layoutBase, QSize( QMAX(5,xres), QMAX(5,yres) ) )
+{
+}
+
+void LayoutGridCommand::execute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void LayoutGridCommand::unexecute()
+{
+ formWindow()->clearSelection( FALSE );
+ layout.undoLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+BreakLayoutCommand::BreakLayoutCommand( const QString &n, FormWindow *fw,
+ QWidget *layoutBase, const QWidgetList &wl )
+ : Command( n, fw ), lb( layoutBase ), widgets( wl )
+{
+ WidgetFactory::LayoutType lay = WidgetFactory::layoutType( layoutBase );
+ spacing = MetaDataBase::spacing( layoutBase );
+ margin = MetaDataBase::margin( layoutBase );
+ layout = 0;
+ if ( lay == WidgetFactory::HBox )
+ layout = new HorizontalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<QSplitter*>(layoutBase) != 0 );
+ else if ( lay == WidgetFactory::VBox )
+ layout = new VerticalLayout( wl, layoutBase, fw, layoutBase, FALSE, ::qt_cast<QSplitter*>(layoutBase) != 0 );
+ else if ( lay == WidgetFactory::Grid )
+ layout = new GridLayout( wl, layoutBase, fw, layoutBase, QSize( QMAX( 5, fw->grid().x()), QMAX( 5, fw->grid().y()) ), FALSE );
+}
+
+void BreakLayoutCommand::execute()
+{
+ if ( !layout )
+ return;
+ formWindow()->clearSelection( FALSE );
+ layout->breakLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() )
+ w->resize( QMAX( 16, w->width() ), QMAX( 16, w->height() ) );
+}
+
+void BreakLayoutCommand::unexecute()
+{
+ if ( !layout )
+ return;
+ formWindow()->clearSelection( FALSE );
+ layout->doLayout();
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( lb ), spacing );
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( lb ), margin );
+}
+
+// ------------------------------------------------------------
+
+MacroCommand::MacroCommand( const QString &n, FormWindow *fw,
+ const QPtrList<Command> &cmds )
+ : Command( n, fw ), commands( cmds )
+{
+}
+
+void MacroCommand::execute()
+{
+ for ( Command *c = commands.first(); c; c = commands.next() )
+ c->execute();
+}
+
+void MacroCommand::unexecute()
+{
+ for ( Command *c = commands.last(); c; c = commands.prev() )
+ c->unexecute();
+}
+
+// ------------------------------------------------------------
+
+AddTabPageCommand::AddTabPageCommand( const QString &n, FormWindow *fw,
+ QTabWidget *tw, const QString &label )
+ : Command( n, fw ), tabWidget( tw ), tabLabel( label )
+{
+ tabPage = new QDesignerWidget( formWindow(), tabWidget, "TabPage" );
+ tabPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( tabPage );
+}
+
+void AddTabPageCommand::execute()
+{
+ if ( index == -1 )
+ index = ( (QDesignerTabWidget*)tabWidget )->count();
+ tabWidget->insertTab( tabPage, tabLabel, index );
+ tabWidget->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void AddTabPageCommand::unexecute()
+{
+ tabWidget->removePage( tabPage );
+ tabPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+MoveTabPageCommand::MoveTabPageCommand( const QString &n, FormWindow *fw,
+ QTabWidget *tw, QWidget* page, const QString& label, int nIndex, int oIndex )
+ : Command( n, fw ), tabWidget( tw ), tabPage( page ), tabLabel( label )
+{
+ newIndex = nIndex;
+ oldIndex = oIndex;
+}
+
+void MoveTabPageCommand::execute()
+{
+ ((QDesignerTabWidget*)tabWidget )->removePage( tabPage );
+ ((QDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, newIndex );
+ ((QDesignerTabWidget*)tabWidget )->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void MoveTabPageCommand::unexecute()
+{
+ ((QDesignerTabWidget*)tabWidget )->removePage( tabPage );
+ ((QDesignerTabWidget*)tabWidget )->insertTab( tabPage, tabLabel, oldIndex );
+ ((QDesignerTabWidget*)tabWidget )->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+DeleteTabPageCommand::DeleteTabPageCommand( const QString &n, FormWindow *fw,
+ QTabWidget *tw, QWidget *page )
+ : Command( n, fw ), tabWidget( tw ), tabPage( page )
+{
+ tabLabel = ( (QDesignerTabWidget*)tabWidget )->pageTitle();
+ index = ( (QDesignerTabWidget*)tabWidget )->currentPage();
+}
+
+void DeleteTabPageCommand::execute()
+{
+ tabWidget->removePage( tabPage );
+ tabPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+void DeleteTabPageCommand::unexecute()
+{
+ tabWidget->insertTab( tabPage, tabLabel, index );
+ tabWidget->showPage( tabPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( tabWidget );
+}
+
+// ------------------------------------------------------------
+
+AddWidgetStackPageCommand::AddWidgetStackPageCommand( const QString &n, FormWindow *fw,
+ QDesignerWidgetStack *ws )
+ : Command( n, fw ), widgetStack( ws )
+{
+ stackPage = new QDesignerWidget( formWindow(), widgetStack, "WStackPage" );
+ stackPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( stackPage );
+}
+
+void AddWidgetStackPageCommand::execute()
+{
+ index = widgetStack->insertPage( stackPage, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( 0 );
+}
+
+void AddWidgetStackPageCommand::unexecute()
+{
+ index = widgetStack->removePage( stackPage );
+ stackPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->tabsChanged( 0 );
+}
+
+DeleteWidgetStackPageCommand::DeleteWidgetStackPageCommand( const QString &n, FormWindow *fw,
+ QDesignerWidgetStack *ws, QWidget *page )
+ : Command( n, fw), widgetStack( ws ), stackPage( page )
+{
+ index = -1;
+}
+
+void DeleteWidgetStackPageCommand::execute()
+{
+ index = widgetStack->removePage( stackPage );
+ stackPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( stackPage );
+}
+
+void DeleteWidgetStackPageCommand::unexecute()
+{
+ index = widgetStack->insertPage( stackPage, index );
+ widgetStack->raiseWidget( stackPage );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( stackPage );
+}
+
+// ------------------------------------------------------------
+
+AddWizardPageCommand::AddWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, const QString &label, int i, bool s )
+ : Command( n, fw ), wizard( w ), pageLabel( label )
+{
+ page = new QDesignerWidget( formWindow(), wizard, "WizardPage" );
+ page->hide();
+ index = i;
+ show = s;
+ MetaDataBase::addEntry( page );
+}
+
+void AddWizardPageCommand::execute()
+{
+ if ( index == -1 )
+ index = wizard->pageCount();
+ wizard->insertPage( page, pageLabel, index );
+ if ( show )
+ ( (QDesignerWizard*)wizard )->setCurrentPage( ( (QDesignerWizard*)wizard )->pageNum( page ) );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void AddWizardPageCommand::unexecute()
+{
+ wizard->removePage( page );
+ page->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+DeleteWizardPageCommand::DeleteWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int i, bool s )
+ : Command( n, fw ), wizard( w ), index( i )
+{
+ show = s;
+}
+
+void DeleteWizardPageCommand::execute()
+{
+ page = wizard->page( index );
+ pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ page->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void DeleteWizardPageCommand::unexecute()
+{
+ wizard->insertPage( page, pageLabel, index );
+ if ( show )
+ ( (QDesignerWizard*)wizard )->setCurrentPage( ( (QDesignerWizard*)wizard )->pageNum( page ) );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+RenameWizardPageCommand::RenameWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int i, const QString& name )
+ : Command( n, fw ), wizard( w ), index( i ), label( name )
+{
+
+}
+
+void RenameWizardPageCommand::execute()
+{
+ page = wizard->page( index );
+ QString oldLabel = wizard->title( page );
+
+ wizard->setTitle( page, label );
+ label = oldLabel;
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+}
+
+void RenameWizardPageCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+SwapWizardPagesCommand::SwapWizardPagesCommand( const QString &n, FormWindow *fw, QWizard *w, int i1, int i2 )
+ : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 )
+{
+}
+
+void SwapWizardPagesCommand::execute()
+{
+ QWidget *page1 = wizard->page( index1 );
+ QWidget *page2 = wizard->page( index2 );
+ QString page1Label = wizard->title( page1 );
+ QString page2Label = wizard->title( page2 );
+ wizard->removePage( page1 );
+ wizard->removePage( page2 );
+ wizard->insertPage( page1, page1Label, index2 );
+ wizard->insertPage( page2, page2Label, index1 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void SwapWizardPagesCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+MoveWizardPageCommand::MoveWizardPageCommand( const QString &n, FormWindow *fw, QWizard *w, int i1, int i2 )
+ : Command( n, fw ), wizard( w ), index1( i1 ), index2( i2 )
+{
+}
+
+void MoveWizardPageCommand::execute()
+{
+ QWidget *page = wizard->page( index1 );
+ QString pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ wizard->insertPage( page, pageLabel, index2 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+void MoveWizardPageCommand::unexecute()
+{
+ // ###FIX: index1 may be the wrong place
+ QWidget *page = wizard->page( index2 );
+ QString pageLabel = wizard->title( page );
+ wizard->removePage( page );
+ wizard->insertPage( page, pageLabel, index1 );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->pagesChanged( wizard );
+}
+
+// ------------------------------------------------------------
+
+AddConnectionCommand::AddConnectionCommand( const QString &name, FormWindow *fw,
+ MetaDataBase::Connection c )
+ : Command( name, fw ), connection( c )
+{
+}
+
+void AddConnectionCommand::execute()
+{
+ MetaDataBase::addConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( connection.receiver == formWindow()->mainContainer() )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+void AddConnectionCommand::unexecute()
+{
+ MetaDataBase::removeConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( connection.receiver == formWindow()->mainContainer() )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+// ------------------------------------------------------------
+
+RemoveConnectionCommand::RemoveConnectionCommand( const QString &name, FormWindow *fw,
+ MetaDataBase::Connection c )
+ : Command( name, fw ), connection( c )
+{
+}
+
+void RemoveConnectionCommand::execute()
+{
+ MetaDataBase::removeConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( connection.receiver == formWindow()->mainContainer() )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+void RemoveConnectionCommand::unexecute()
+{
+ MetaDataBase::addConnection( formWindow(), connection.sender,
+ connection.signal, connection.receiver, connection.slot );
+ if ( connection.receiver == formWindow()->mainContainer() )
+ formWindow()->mainWindow()->propertyeditor()->eventList()->setup();
+}
+
+// ------------------------------------------------------------
+
+AddFunctionCommand::AddFunctionCommand( const QString &name, FormWindow *fw, const QCString &f,
+ const QString& spec, const QString &a, const QString &t,
+ const QString &l, const QString &rt )
+ : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ),
+ returnType( rt )
+{
+}
+
+void AddFunctionCommand::execute()
+{
+ MetaDataBase::addFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (add - execute)
+ KInterfaceDesigner::Function f;
+ f.returnType = returnType;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = (functionType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->clearSelection(false);
+ formWindow()->mainWindow()->part()->emitAddedFunction(formWindow()->fileName(), f);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void AddFunctionCommand::unexecute()
+{
+ MetaDataBase::removeFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (add - unexecute)
+ KInterfaceDesigner::Function f;
+ f.returnType = returnType;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = (functionType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->mainWindow()->part()->emitRemovedFunction(formWindow()->fileName(), f);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+ChangeFunctionAttribCommand::ChangeFunctionAttribCommand( const QString &name, FormWindow *fw, MetaDataBase::Function f,
+ const QString &on, const QString &os,
+ const QString &oa, const QString &ot, const QString &ol,
+ const QString &ort )
+ : Command( name, fw ), oldName( on ), oldSpec( os ), oldAccess( oa ),
+ oldType( ot ), oldLang( ol ), oldReturnType( ort )
+{
+ newName = f.function;
+ newSpec = f.specifier;
+ newAccess = f.access;
+ newType = f.type;
+ newLang = f.language;
+ newReturnType = f.returnType;
+}
+
+void ChangeFunctionAttribCommand::execute()
+{
+ MetaDataBase::changeFunctionAttributes( formWindow(), oldName, newName, newSpec, newAccess,
+ newType, newLang, newReturnType );
+ formWindow()->formFile()->functionNameChanged( oldName, newName );
+ formWindow()->formFile()->functionRetTypeChanged( newName, oldReturnType, newReturnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (edit - execute)
+ KInterfaceDesigner::Function f;
+ f.returnType = newReturnType;
+ f.function = newName;
+ f.specifier = newSpec;
+ f.access = newAccess;
+ f.type = (newType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ KInterfaceDesigner::Function of;
+ f.returnType = oldReturnType;
+ f.function = oldName;
+ f.specifier = oldSpec;
+ f.access = oldAccess;
+ f.type = (oldType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->mainWindow()->part()->emitEditedFunction(formWindow()->fileName(), of, f);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void ChangeFunctionAttribCommand::unexecute()
+{
+ MetaDataBase::changeFunctionAttributes( formWindow(), newName, oldName, oldSpec, oldAccess,
+ oldType, oldLang, oldReturnType );
+ formWindow()->formFile()->functionNameChanged( newName, oldName );
+ formWindow()->formFile()->functionRetTypeChanged( oldName, newReturnType, oldReturnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (edit - execute)
+ KInterfaceDesigner::Function f;
+ f.returnType = newReturnType;
+ f.function = newName;
+ f.specifier = newSpec;
+ f.access = newAccess;
+ f.type = (newType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ KInterfaceDesigner::Function of;
+ f.returnType = oldReturnType;
+ f.function = oldName;
+ f.specifier = oldSpec;
+ f.access = oldAccess;
+ f.type = (oldType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->mainWindow()->part()->emitEditedFunction(formWindow()->fileName(), f, of);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+RemoveFunctionCommand::RemoveFunctionCommand( const QString &name, FormWindow *fw, const QCString &f,
+ const QString& spec, const QString &a, const QString &t,
+ const QString &l, const QString &rt )
+ : Command( name, fw ), function( f ), specifier( spec ), access( a ), functionType( t ), language( l ),
+ returnType( rt )
+{
+ if ( spec.isNull() ) {
+ QValueList<MetaDataBase::Function> lst = MetaDataBase::functionList( fw );
+ for ( QValueList<MetaDataBase::Function>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).function ) ==
+ MetaDataBase::normalizeFunction( function ) ) {
+ specifier = (*it).specifier;
+ access = (*it).access;
+ functionType = (*it).type;
+ returnType = (*it).returnType;
+ language = (*it).language;
+ break;
+ }
+ }
+ }
+}
+
+void RemoveFunctionCommand::execute()
+{
+ MetaDataBase::removeFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (remove - execute)
+ KInterfaceDesigner::Function f;
+ f.returnType = returnType;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = (functionType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->mainWindow()->part()->emitRemovedFunction(formWindow()->fileName(), f);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void RemoveFunctionCommand::unexecute()
+{
+ if ( MetaDataBase::hasFunction( formWindow(), function ) )
+ return;
+ MetaDataBase::addFunction( formWindow(), function, specifier, access, functionType, language, returnType );
+ formWindow()->mainWindow()->functionsChanged();
+
+ //integration (remove - unexecute)
+ KInterfaceDesigner::Function f;
+ f.returnType = returnType;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = (functionType == "slot") ? KInterfaceDesigner::ftQtSlot : KInterfaceDesigner::ftFunction ;
+ formWindow()->clearSelection(false);
+ formWindow()->mainWindow()->part()->emitAddedFunction(formWindow()->fileName(), f);
+
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+AddVariableCommand::AddVariableCommand( const QString &name, FormWindow *fw, const QString &vn, const QString &a )
+ : Command( name, fw ), varName( vn ), access( a )
+{
+}
+
+void AddVariableCommand::execute()
+{
+ MetaDataBase::addVariable( formWindow(), varName, access );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void AddVariableCommand::unexecute()
+{
+ MetaDataBase::removeVariable( formWindow(), varName );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+SetVariablesCommand::SetVariablesCommand( const QString &name, FormWindow *fw,
+ QValueList<MetaDataBase::Variable> lst )
+ : Command( name, fw ), newList( lst )
+{
+ oldList = MetaDataBase::variables( formWindow() );
+}
+
+void SetVariablesCommand::execute()
+{
+ MetaDataBase::setVariables( formWindow(), newList );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void SetVariablesCommand::unexecute()
+{
+ MetaDataBase::setVariables( formWindow(), oldList );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+RemoveVariableCommand::RemoveVariableCommand( const QString &name, FormWindow *fw, const QString &vn )
+ : Command( name, fw ), varName( vn )
+{
+ QValueList<MetaDataBase::Variable> lst = MetaDataBase::variables( fw );
+ for ( QValueList<MetaDataBase::Variable>::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( (*it).varName == varName ) {
+ access = (*it).varAccess;
+ break;
+ }
+ }
+}
+
+void RemoveVariableCommand::execute()
+{
+ MetaDataBase::removeVariable( formWindow(), varName );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void RemoveVariableCommand::unexecute()
+{
+ MetaDataBase::addVariable( formWindow(), varName, access );
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+EditDefinitionsCommand::EditDefinitionsCommand( const QString &name, FormWindow *fw, LanguageInterface *lf,
+ const QString &n, const QStringList &nl )
+ : Command( name, fw ), lIface( lf ), defName( n ), newList( nl )
+{
+ oldList = lIface->definitionEntries( defName, formWindow()->mainWindow()->designerInterface() );
+}
+
+void EditDefinitionsCommand::execute()
+{
+ lIface->setDefinitionEntries( defName, newList, formWindow()->mainWindow()->designerInterface() );
+ lIface->release();
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+void EditDefinitionsCommand::unexecute()
+{
+ lIface->setDefinitionEntries( defName, oldList, formWindow()->mainWindow()->designerInterface() );
+ lIface->release();
+ formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ if ( formWindow()->formFile() )
+ formWindow()->formFile()->setModified( TRUE );
+}
+
+// ------------------------------------------------------------
+
+LowerCommand::LowerCommand( const QString &name, FormWindow *fw, const QWidgetList &w )
+ : Command( name, fw ), widgets( w )
+{
+}
+
+void LowerCommand::execute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->lower();
+ formWindow()->raiseSelection( w );
+ }
+
+}
+
+void LowerCommand::unexecute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->raise();
+ formWindow()->raiseSelection( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+RaiseCommand::RaiseCommand( const QString &name, FormWindow *fw, const QWidgetList &w )
+ : Command( name, fw ), widgets( w )
+{
+}
+
+void RaiseCommand::execute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->raise();
+ formWindow()->raiseSelection( w );
+ }
+
+}
+
+void RaiseCommand::unexecute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->lower();
+ formWindow()->raiseSelection( w );
+ }
+}
+
+// ------------------------------------------------------------
+
+PasteCommand::PasteCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &w )
+ : Command( n, fw ), widgets( w )
+{
+}
+
+void PasteCommand::execute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->show();
+ formWindow()->selectWidget( w );
+ formWindow()->widgets()->insert( w, w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetInserted( w );
+ }
+}
+
+void PasteCommand::unexecute()
+{
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ w->hide();
+ formWindow()->selectWidget( w, FALSE );
+ formWindow()->widgets()->remove( w );
+ formWindow()->mainWindow()->objectHierarchy()->widgetRemoved( w );
+ }
+ }
+
+// ------------------------------------------------------------
+
+TabOrderCommand::TabOrderCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &ol, const QWidgetList &nl )
+ : Command( n, fw ), oldOrder( ol ), newOrder( nl )
+{
+}
+
+void TabOrderCommand::merge( Command *c )
+{
+ TabOrderCommand *cmd = (TabOrderCommand*)c;
+ newOrder = cmd->newOrder;
+}
+
+bool TabOrderCommand::canMerge( Command * )
+{
+ return TRUE;
+}
+
+void TabOrderCommand::execute()
+{
+ MetaDataBase::setTabOrder( formWindow(), newOrder );
+}
+
+void TabOrderCommand::unexecute()
+{
+ MetaDataBase::setTabOrder( formWindow(), oldOrder );
+}
+
+// ------------------------------------------------------------
+
+PopulateListBoxCommand::PopulateListBoxCommand( const QString &n, FormWindow *fw,
+ QListBox *lb, const QValueList<Item> &items )
+ : Command( n, fw ), newItems( items ), listbox( lb )
+{
+ QListBoxItem *i = 0;
+ for ( i = listbox->firstItem(); i; i = i->next() ) {
+ Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ oldItems.append( item );
+ }
+}
+
+void PopulateListBoxCommand::execute()
+{
+ listbox->clear();
+ for ( QValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) {
+ Item i = *it;
+ if ( !i.pix.isNull() )
+ (void)new QListBoxPixmap( listbox, i.pix, i.text );
+ else
+ (void)new QListBoxText( listbox, i.text );
+ }
+ formWindow()->mainWindow()->propertyeditor()->refetchData();
+}
+
+void PopulateListBoxCommand::unexecute()
+{
+ listbox->clear();
+ for ( QValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) {
+ Item i = *it;
+ if ( !i.pix.isNull() )
+ (void)new QListBoxPixmap( listbox, i.pix, i.text );
+ else
+ (void)new QListBoxText( listbox, i.text );
+ }
+ formWindow()->mainWindow()->propertyeditor()->refetchData();
+}
+
+// ------------------------------------------------------------
+
+PopulateIconViewCommand::PopulateIconViewCommand( const QString &n, FormWindow *fw,
+ QIconView *iv, const QValueList<Item> &items )
+ : Command( n, fw ), newItems( items ), iconview( iv )
+{
+#ifndef QT_NO_ICONVIEW
+ QIconViewItem *i = 0;
+ for ( i = iconview->firstItem(); i; i = i->nextItem() ) {
+ Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ oldItems.append( item );
+ }
+#endif
+}
+
+void PopulateIconViewCommand::execute()
+{
+#ifndef QT_NO_ICONVIEW
+ iconview->clear();
+ for ( QValueList<Item>::Iterator it = newItems.begin(); it != newItems.end(); ++it ) {
+ Item i = *it;
+ (void)new QIconViewItem( iconview, i.text, i.pix );
+ }
+#endif
+}
+
+void PopulateIconViewCommand::unexecute()
+{
+#ifndef QT_NO_ICONVIEW
+ iconview->clear();
+ for ( QValueList<Item>::Iterator it = oldItems.begin(); it != oldItems.end(); ++it ) {
+ Item i = *it;
+ (void)new QIconViewItem( iconview, i.text, i.pix );
+ }
+#endif
+}
+
+// ------------------------------------------------------------
+
+PopulateListViewCommand::PopulateListViewCommand( const QString &n, FormWindow *fw,
+ QListView *lv, QListView *from )
+ : Command( n, fw ), listview( lv )
+{
+ newItems = new QListView();
+ newItems->hide();
+ transferItems( from, newItems );
+ oldItems = new QListView();
+ oldItems->hide();
+ transferItems( listview, oldItems );
+}
+
+void PopulateListViewCommand::execute()
+{
+ listview->clear();
+ transferItems( newItems, listview );
+}
+
+void PopulateListViewCommand::unexecute()
+{
+ listview->clear();
+ transferItems( oldItems, listview );
+}
+
+void PopulateListViewCommand::transferItems( QListView *from, QListView *to )
+{
+ QHeader *header = to->header();
+ while ( header->count() )
+ to->removeColumn( 0 );
+ QHeader *h2 = from->header();
+ for ( int i = 0; i < h2->count(); ++i ) {
+ to->addColumn( h2->label( i ) );
+ if ( h2->iconSet( i ) && !h2->iconSet( i )->pixmap().isNull() )
+ header->setLabel( i, *h2->iconSet( i ), h2->label( i ) );
+ header->setResizeEnabled( h2->isResizeEnabled( i ), i );
+ header->setClickEnabled( h2->isClickEnabled( i ), i );
+ }
+
+ QListViewItemIterator it( from );
+ QPtrStack<QListViewItem> fromParents, toParents;
+ fromParents.push( 0 );
+ toParents.push( 0 );
+ QPtrStack<QListViewItem> toLasts;
+ QListViewItem *fromLast = 0;
+ toLasts.push( 0 );
+ int cols = from->columns();
+ to->setSorting( -1 );
+ from->setSorting( -1 );
+ for ( ; it.current(); ++it ) {
+ QListViewItem *i = it.current();
+ if ( i->parent() == fromParents.top() ) {
+ QListViewItem *pi = toParents.top();
+ QListViewItem *ni = 0;
+ if ( pi )
+ ni = new QListViewItem( pi, toLasts.top() );
+ else
+ ni = new QListViewItem( to, toLasts.top() );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ toLasts.pop();
+ toLasts.push( ni );
+ if ( pi )
+ pi->setOpen( TRUE );
+ } else {
+ if ( i->parent() == fromLast ) {
+ fromParents.push( fromLast );
+ toParents.push( toLasts.top() );
+ toLasts.push( 0 );
+ QListViewItem *pi = toParents.top();
+ QListViewItem *ni = 0;
+ if ( pi )
+ ni = new QListViewItem( pi );
+ else
+ ni = new QListViewItem( to );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ toLasts.pop();
+ toLasts.push( ni );
+ if ( pi )
+ pi->setOpen( TRUE );
+ } else {
+ while ( fromParents.top() != i->parent() ) {
+ fromParents.pop();
+ toParents.pop();
+ toLasts.pop();
+ }
+
+ QListViewItem *pi = toParents.top();
+ QListViewItem *ni = 0;
+ if ( pi )
+ ni = new QListViewItem( pi, toLasts.top() );
+ else
+ ni = new QListViewItem( to, toLasts.top() );
+ for ( int c = 0; c < cols; ++c ) {
+ ni->setText( c, i->text( c ) );
+ if ( i->pixmap( c ) )
+ ni->setPixmap( c, *i->pixmap( c ) );
+ }
+ if ( pi )
+ pi->setOpen( TRUE );
+ toLasts.pop();
+ toLasts.push( ni );
+ }
+ }
+ fromLast = i;
+ }
+}
+
+
+
+// ------------------------------------------------------------
+
+PopulateMultiLineEditCommand::PopulateMultiLineEditCommand( const QString &n, FormWindow *fw,
+ QTextEdit *mle, const QString &txt )
+ : Command( n, fw ), newText( txt ), mlined( mle )
+{
+ oldText = mlined->text();
+ wasChanged = MetaDataBase::isPropertyChanged( mlined, "text" );
+}
+
+void PopulateMultiLineEditCommand::execute()
+{
+ mlined->setText( newText );
+ MetaDataBase::setPropertyChanged( mlined, "text", TRUE );
+ formWindow()->emitUpdateProperties( mlined );
+}
+
+void PopulateMultiLineEditCommand::unexecute()
+{
+ mlined->setText( oldText );
+ MetaDataBase::setPropertyChanged( mlined, "text", wasChanged );
+ formWindow()->emitUpdateProperties( mlined );
+}
+
+// ------------------------------------------------------------
+
+PopulateTableCommand::PopulateTableCommand( const QString &n, FormWindow *fw, QTable *t,
+ const QValueList<Row> &rows,
+ const QValueList<Column> &columns )
+ : Command( n, fw ), newRows( rows ), newColumns( columns ), table( t )
+{
+#ifndef QT_NO_TABLE
+ int i = 0;
+ QMap<QString, QString> columnFields = MetaDataBase::columnFields( table );
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ PopulateTableCommand::Column col;
+ col.text = table->horizontalHeader()->label( i );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ col.pix = table->horizontalHeader()->iconSet( i )->pixmap();
+ col.field = *columnFields.find( col.text );
+ oldColumns.append( col );
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ PopulateTableCommand::Row row;
+ row.text = table->verticalHeader()->label( i );
+ if ( table->verticalHeader()->iconSet( i ) )
+ row.pix = table->verticalHeader()->iconSet( i )->pixmap();
+ oldRows.append( row );
+ }
+#endif
+}
+
+void PopulateTableCommand::execute()
+{
+#ifndef QT_NO_TABLE
+ QMap<QString, QString> columnFields;
+ table->setNumCols( newColumns.count() );
+ int i = 0;
+ for ( QValueList<Column>::Iterator cit = newColumns.begin(); cit != newColumns.end(); ++cit, ++i ) {
+ table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text );
+ if ( !(*cit).field.isEmpty() )
+ columnFields.insert( (*cit).text, (*cit).field );
+ }
+ MetaDataBase::setColumnFields( table, columnFields );
+ table->setNumRows( newRows.count() );
+ i = 0;
+ for ( QValueList<Row>::Iterator rit = newRows.begin(); rit != newRows.end(); ++rit, ++i )
+ table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text );
+#endif
+}
+
+void PopulateTableCommand::unexecute()
+{
+#ifndef QT_NO_TABLE
+ QMap<QString, QString> columnFields;
+ table->setNumCols( oldColumns.count() );
+ int i = 0;
+ for ( QValueList<Column>::Iterator cit = oldColumns.begin(); cit != oldColumns.end(); ++cit, ++i ) {
+ table->horizontalHeader()->setLabel( i, (*cit).pix, (*cit).text );
+ if ( !(*cit).field.isEmpty() )
+ columnFields.insert( (*cit).text, (*cit).field );
+ }
+ MetaDataBase::setColumnFields( table, columnFields );
+ table->setNumRows( oldRows.count() );
+ i = 0;
+ for ( QValueList<Row>::Iterator rit = oldRows.begin(); rit != oldRows.end(); ++rit, ++i )
+ table->verticalHeader()->setLabel( i, (*rit).pix, (*rit).text );
+#endif
+}
+
+// ------------------------------------------------------------
+
+AddActionToToolBarCommand::AddActionToToolBarCommand( const QString &n, FormWindow *fw,
+ QAction *a, QDesignerToolBar *tb, int idx )
+ : Command( n, fw ), action( a ), toolBar( tb ), index( idx )
+{
+}
+
+void AddActionToToolBarCommand::execute()
+{
+ action->addTo( toolBar );
+
+ if ( ::qt_cast<QDesignerAction*>(action) ) {
+ QString s = ( (QDesignerAction*)action )->widget()->name();
+ if ( s.startsWith( "qt_dead_widget_" ) ) {
+ s.remove( 0, QString( "qt_dead_widget_" ).length() );
+ ( (QDesignerAction*)action )->widget()->setName( s );
+ }
+ toolBar->insertAction( ( (QDesignerAction*)action )->widget(), action );
+ ( (QDesignerAction*)action )->widget()->installEventFilter( toolBar );
+ } else if ( ::qt_cast<QDesignerActionGroup*>(action) ) {
+ if ( ( (QDesignerActionGroup*)action )->usesDropDown() ) {
+ toolBar->insertAction( ( (QDesignerActionGroup*)action )->widget(), action );
+ ( (QDesignerActionGroup*)action )->widget()->installEventFilter( toolBar );
+ }
+ } else if ( ::qt_cast<QSeparatorAction*>(action) ) {
+ toolBar->insertAction( ( (QSeparatorAction*)action )->widget(), action );
+ ( (QSeparatorAction*)action )->widget()->installEventFilter( toolBar );
+ }
+ if ( !::qt_cast<QActionGroup*>(action) || ( (QActionGroup*)action )->usesDropDown()) {
+ if ( index == -1 )
+ toolBar->appendAction( action );
+ else
+ toolBar->insertAction( index, action );
+ toolBar->reInsert();
+ QObject::connect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) );
+ } else {
+ if ( action->children() ) {
+ QObjectListIt it( *action->children() );
+ int i = 0;
+ while ( it.current() ) {
+ QObject *o = it.current();
+ ++it;
+ if ( !::qt_cast<QAction*>(o) )
+ continue;
+ // ### fix it for nested actiongroups
+ if ( ::qt_cast<QDesignerAction*>(o) ) {
+ QDesignerAction *ac = (QDesignerAction*)o;
+ toolBar->insertAction( ac->widget(), ac );
+ ac->widget()->installEventFilter( toolBar );
+ if ( index == -1 )
+ toolBar->appendAction( ac );
+ else
+ toolBar->insertAction( index + (i++), ac );
+ }
+ QObject::connect( o, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) );
+ }
+ }
+ toolBar->reInsert();
+ QObject::connect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddActionToToolBarCommand::unexecute()
+{
+ if ( ::qt_cast<QDesignerAction*>(action) ) {
+ QString s = ( (QDesignerAction*)action )->widget()->name();
+ s.prepend( "qt_dead_widget_" );
+ ( (QDesignerAction*)action )->widget()->setName( s );
+ }
+
+ toolBar->removeAction( action );
+ action->removeFrom( toolBar );
+ QObject::disconnect( action, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) );
+ if ( !::qt_cast<QActionGroup*>(action) || ( (QActionGroup*)action )->usesDropDown()) {
+ action->removeEventFilter( toolBar );
+ } else {
+ if ( action->children() ) {
+ QObjectListIt it( *action->children() );
+ while ( it.current() ) {
+ QObject *o = it.current();
+ ++it;
+ if ( !::qt_cast<QAction*>(o) )
+ continue;
+ if ( ::qt_cast<QDesignerAction*>(o) ) {
+ o->removeEventFilter( toolBar );
+ toolBar->removeAction( (QAction*)o );
+ }
+ QObject::disconnect( o, SIGNAL( destroyed() ), toolBar, SLOT( actionRemoved() ) );
+ }
+ }
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+AddToolBarCommand::AddToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw )
+ : Command( n, fw ), toolBar( 0 ), mainWindow( mw )
+{
+}
+
+void AddToolBarCommand::execute()
+{
+ if ( !toolBar ) {
+ toolBar = new QDesignerToolBar( mainWindow );
+ QString n = "Toolbar";
+ formWindow()->unify( toolBar, n, TRUE );
+ toolBar->setName( n );
+ mainWindow->addToolBar( toolBar, n );
+ } else {
+ toolBar->show();
+ QString s = toolBar->name();
+ s.remove( 0, QString( "qt_dead_widget_" ).length() );
+ toolBar->setName( s );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddToolBarCommand::unexecute()
+{
+ toolBar->hide();
+ QString s = toolBar->name();
+ s.prepend( "qt_dead_widget_" );
+ toolBar->setName( s );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+AddContainerPageCommand::AddContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *c, const QString &label )
+ : Command( n, fw ), container( c ), index( -1 ), pageLabel( label ), page( 0 )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+}
+
+AddContainerPageCommand::~AddContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void AddContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ if ( index == -1 )
+ index = wiface->count( wClassName, container );
+ if ( !page )
+ page = wiface->addPage( wClassName, container, pageLabel, index );
+ else
+ wiface->insertPage( wClassName, container, pageLabel, index, page );
+
+ MetaDataBase::addEntry( page );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void AddContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->removePage( wClassName, container, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+// ------------------------------------------------------------
+
+DeleteContainerPageCommand::DeleteContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *c, int idx )
+ : Command( n, fw ), container( c ), index( idx )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+ page = wiface->page( wClassName, container, index );
+ pageLabel = wiface->pageLabel( wClassName, container, index );
+}
+
+DeleteContainerPageCommand::~DeleteContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void DeleteContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+
+ wiface->removePage( wClassName, container, index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void DeleteContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ if ( index == -1 )
+ index = wiface->count( wClassName, container );
+
+ wiface->insertPage( wClassName, container, pageLabel, index, page );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+// ------------------------------------------------------------
+
+RenameContainerPageCommand::RenameContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *c, int idx,
+ const QString &label )
+ : Command( n, fw ), container( c ), index( idx ), newLabel( label )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( container ), &iface );
+ if ( !iface )
+ return;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&wiface );
+ if ( !wiface )
+ return;
+ wClassName = WidgetFactory::classNameOf( container );
+ oldLabel = wiface->pageLabel( wClassName, container, index );
+}
+
+RenameContainerPageCommand::~RenameContainerPageCommand()
+{
+ if ( wiface )
+ wiface->release();
+}
+
+void RenameContainerPageCommand::execute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->renamePage( wClassName, container, index, newLabel );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+
+void RenameContainerPageCommand::unexecute()
+{
+ if ( !wiface || !wiface->supportsPages( wClassName ) )
+ return;
+ wiface->renamePage( wClassName, container, index, oldLabel );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ // #### show and update pages in object hierarchy view
+}
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+// ------------------------------------------------------------
+
+AddActionToPopupCommand::AddActionToPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ PopupMenuEditorItem *i,
+ int idx )
+ : Command( n, fw ), menu( m ), item( i ), index( idx )
+{ }
+
+void AddActionToPopupCommand::execute()
+{
+ menu->insert( item, index );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddActionToPopupCommand::unexecute()
+{
+ item->hideMenu();
+ int i = menu->find( item->action() );
+ menu->remove( i );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+RemoveActionFromPopupCommand::RemoveActionFromPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int idx )
+ : AddActionToPopupCommand( n, fw, m, 0, idx )
+{
+ item = menu->at( index );
+}
+
+void RemoveActionFromPopupCommand::execute()
+{
+ AddActionToPopupCommand::unexecute();
+}
+
+void RemoveActionFromPopupCommand::unexecute()
+{
+ AddActionToPopupCommand::execute();
+}
+
+// ------------------------------------------------------------
+
+ExchangeActionInPopupCommand::ExchangeActionInPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b )
+ : Command( n, fw ), menu( m ), c( a ), d( b )
+{ }
+
+void ExchangeActionInPopupCommand::execute()
+{
+ menu->exchange( c, d );
+}
+
+void ExchangeActionInPopupCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+ActionEditor *ActionCommand::actionEditor()
+{
+ // FIXME: handle multiple action editors
+ return (ActionEditor *) formWindow()->mainWindow()->child( 0, "ActionEditor" );
+}
+
+// ------------------------------------------------------------
+
+RenameActionCommand::RenameActionCommand( const QString &n,
+ FormWindow *fw,
+ QAction *a,
+ PopupMenuEditor *m,
+ QString nm )
+ : ActionCommand( n, fw, a ), menu( m ), newName( nm )
+{
+ oldName = action->menuText();
+}
+
+void RenameActionCommand::execute()
+{
+ QString actionText = newName;
+ actionText.replace("&&", "&");
+ QString menuText = newName;
+ action->setText( actionText );
+ action->setMenuText( menuText );
+
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void RenameActionCommand::unexecute()
+{
+ action->setMenuText( oldName );
+ action->setText( oldName );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+SetActionIconsCommand::SetActionIconsCommand( const QString &n,
+ FormWindow *fw,
+ QAction *a,
+ PopupMenuEditor *m,
+ QIconSet &icons )
+ : ActionCommand( n, fw, a ), menu( m ), newIcons( icons )
+{
+ oldIcons = a->iconSet();
+}
+
+void SetActionIconsCommand::execute()
+{
+ action->setIconSet( newIcons );
+ ActionEditor *ae = actionEditor();
+ if ( ae )
+ ae->updateActionIcon( action );
+ MetaDataBase::setPropertyChanged( action, "iconSet", TRUE );
+}
+
+void SetActionIconsCommand::unexecute()
+{
+ action->setIconSet( oldIcons );
+ ActionEditor *ae = actionEditor();
+ if ( ae )
+ ae->updateActionIcon( action );
+ MetaDataBase::setPropertyChanged( action, "iconSet", TRUE );
+}
+
+// ------------------------------------------------------------
+
+AddMenuCommand::AddMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ MenuBarEditorItem *i,
+ int idx )
+ : Command( n, fw ), mb( b ), item( i ), name( 0 ), index( idx )
+{ }
+
+AddMenuCommand::AddMenuCommand( const QString &n,
+ FormWindow *fw,
+ QMainWindow *mw,
+ const QString &nm )
+ : Command( n, fw ), mb( 0 ), item( 0 ), name( nm ), index( -1 )
+{
+ if ( mw )
+ mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+}
+
+void AddMenuCommand::execute()
+{
+ QString n;
+ QMainWindow *mw = (QMainWindow*)formWindow()->mainContainer();
+ if ( !mb ) {
+ mb = new MenuBarEditor( formWindow(), mw );
+ mb->setName( "MenuBarEditor" );
+ formWindow()->insertWidget( mb, TRUE );
+ }
+ if ( !item ) {
+ PopupMenuEditor *popup = new PopupMenuEditor( formWindow(), mw );
+ popup->setName( "PopupMenuEditor" );
+ formWindow()->insertWidget( popup, TRUE );
+ mb->insertItem( name, popup, index );
+ index = mb->findItem( popup );
+ item = mb->item( index );
+ } else {
+ PopupMenuEditor *popup = item->menu();
+ popup->setName( item->menuText() );
+ formWindow()->insertWidget( popup, TRUE );
+ mb->insertItem( item, index );
+ }
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddMenuCommand::unexecute()
+{
+ if ( !item ) {
+ qWarning( "The AddMenuCommand was created without a menu item." );
+ return;
+ }
+ item->menu()->hide();
+ int i = mb->findItem( item );
+ formWindow()->removeWidget( item->menu() );
+ mb->removeItemAt( i );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+RemoveMenuCommand::RemoveMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int idx )
+ : AddMenuCommand( n, fw, b, 0, idx )
+{
+ item = mb->item( index );
+}
+
+void RemoveMenuCommand::execute()
+{
+ mb->hideItem( index );
+ AddMenuCommand::unexecute();
+}
+
+void RemoveMenuCommand::unexecute()
+{
+ AddMenuCommand::execute();
+}
+
+// ------------------------------------------------------------
+
+ExchangeMenuCommand::ExchangeMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j )
+ : Command( n, fw ), bar( b ), k( i ), l( j )
+{ }
+
+void ExchangeMenuCommand::execute()
+{
+ bar->exchange( k, l );
+}
+
+void ExchangeMenuCommand::unexecute()
+{
+ execute();
+}
+
+// ------------------------------------------------------------
+
+MoveMenuCommand::MoveMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j )
+ : Command( n, fw ), bar( b ), from( i ), to( j )
+{ }
+
+void MoveMenuCommand::execute()
+{
+ bar->hideItem( from );
+ MenuBarEditorItem * i = bar->item( from );
+ bar->removeItemAt( from );
+ int t = ( from > to ? to : to - 1 );
+ bar->insertItem( i, t );
+}
+
+void MoveMenuCommand::unexecute()
+{
+ bar->hideItem( to );
+ int t = ( from > to ? to : to - 1 );
+ MenuBarEditorItem * i = bar->item( t );
+ bar->removeItemAt( t );
+ bar->insertItem( i, from );
+}
+
+// ------------------------------------------------------------
+
+RenameMenuCommand::RenameMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ QString nm,
+ MenuBarEditorItem *i )
+ : Command( n, fw ), bar( b ), item( i ), newName( nm )
+{
+ oldName = item->menu()->name();
+}
+
+QString RenameMenuCommand::makeLegal( const QString &str )
+{
+ // remove illegal characters
+ QString d;
+ char c = 0, i = 0;
+ while ( !str.at(i).isNull() ) {
+ c = str.at(i).latin1();
+ if ( c == '-' || c == ' ' )
+ d += '_';
+ else if ( ( c >= '0' && c <= '9') || ( c >= 'A' && c <= 'Z' )
+ || c == '_' || ( c >= 'a' && c <= 'z' ) )
+ d += c;
+ ++i;
+ }
+ return d;
+}
+
+void RenameMenuCommand::execute()
+{
+ PopupMenuEditor *popup = item->menu();
+ item->setMenuText( newName );
+ QString legal = makeLegal( newName );
+ formWindow()->unify( popup, legal, TRUE );
+ popup->setName( legal );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void RenameMenuCommand::unexecute()
+{
+ PopupMenuEditor *popup = item->menu();
+ item->setMenuText( oldName );
+ popup->setName( oldName );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+AddToolBoxPageCommand::AddToolBoxPageCommand( const QString &n, FormWindow *fw,
+ QToolBox *tw, const QString &label )
+ : Command( n, fw ), toolBox( tw ), toolBoxLabel( label )
+{
+ toolBoxPage = new QDesignerWidget( formWindow(), toolBox, "page" );
+ toolBoxPage->hide();
+ index = -1;
+ MetaDataBase::addEntry( toolBoxPage );
+}
+
+void AddToolBoxPageCommand::execute()
+{
+ index = toolBox->insertItem( index, toolBoxPage, toolBoxLabel);
+ toolBox->setCurrentIndex( index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void AddToolBoxPageCommand::unexecute()
+{
+ toolBox->removeItem( toolBoxPage );
+ toolBoxPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+// ------------------------------------------------------------
+
+DeleteToolBoxPageCommand::DeleteToolBoxPageCommand( const QString &n, FormWindow *fw,
+ QToolBox *tw, QWidget *page )
+ : Command( n, fw ), toolBox( tw ), toolBoxPage( page )
+{
+ toolBoxLabel = toolBox->itemLabel( toolBox->currentIndex() );
+ index = toolBox->currentIndex();
+}
+
+void DeleteToolBoxPageCommand::execute()
+{
+ toolBox->removeItem( toolBoxPage );
+ toolBoxPage->hide();
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
+
+void DeleteToolBoxPageCommand::unexecute()
+{
+ index = toolBox->insertItem( index, toolBoxPage, toolBoxLabel );
+ toolBox->setCurrentIndex( index );
+ formWindow()->emitUpdateProperties( formWindow()->currentWidget() );
+ formWindow()->mainWindow()->objectHierarchy()->rebuild();
+}
diff --git a/kdevdesigner/designer/command.h b/kdevdesigner/designer/command.h
new file mode 100644
index 00000000..ac5e9d5a
--- /dev/null
+++ b/kdevdesigner/designer/command.h
@@ -0,0 +1,1259 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef COMMAND_H
+#define COMMAND_H
+
+#include "metadatabase.h"
+#include "layout.h"
+
+#include <qstring.h>
+#include <qrect.h>
+#include <qvaluelist.h>
+#include <qvariant.h>
+#include <qobject.h>
+#include <qlistview.h>
+#include <qptrlist.h>
+#include <qmap.h>
+#include <qiconset.h>
+
+class QWizard;
+class QTabWidget;
+class Command;
+class QWidget;
+class FormWindow;
+class PropertyEditor;
+class QListBox;
+class QIconView;
+class QTable;
+class QAction;
+class QDesignerToolBar;
+class QMainWindow;
+class QTextEdit;
+struct LanguageInterface;
+class QToolBox;
+
+class MenuBarEditor;
+class MenuBarEditorItem;
+class PopupMenuEditor;
+class PopupMenuEditorItem;
+class ActionEditor;
+
+class Command : public Qt
+{
+public:
+ Command( const QString &n, FormWindow *fw );
+ virtual ~Command();
+
+ enum Type {
+ Resize,
+ Insert,
+ Move,
+ Delete,
+ SetProperty,
+ LayoutHorizontal,
+ LayoutVertical,
+ LayoutHorizontalSplitter,
+ LayoutVerticalSplitter,
+ LayoutGrid,
+ BreakLayout,
+ Macro,
+ AddTabPage,
+ DeleteTabPage,
+ MoveTabPage,
+ AddWidgetStackPage,
+ DeleteWidgetStackPage,
+ AddWizardPage,
+ DeleteWizardPage,
+ SwapWizardPages,
+ MoveWizardPage,
+ RenameWizardPage,
+ AddConnection,
+ RemoveConnection,
+ Lower,
+ Raise,
+ Paste,
+ TabOrder,
+ PopulateListBox,
+ PopulateIconView,
+ PopulateListView,
+ PopulateMultiLineEdit,
+ PopulateTable,
+ AddActionToToolBar,
+ RemoveActionFromToolBar,
+ AddToolBar,
+ RemoveToolBar,
+ AddFunction,
+ ChangeFunctionAttrib,
+ RemoveFunction,
+ AddVariable,
+ SetVariables,
+ RemoveVariable,
+ EditDefinitions,
+ AddContainerPage,
+ DeleteContainerPage,
+ RenameContainerPage,
+ AddActionToPopup,
+ RemoveActionFromPopup,
+ ExchangeActionInPopup,
+ //MoveActionInPopup,
+ RenameAction,
+ SetActionIcons,
+ AddMenu,
+ RemoveMenu,
+ ExchangeMenu,
+ MoveMenu,
+ RenameMenu,
+ AddToolBoxPage,
+ DeleteToolBoxPage
+ };
+
+ QString name() const;
+
+ virtual void execute() = 0;
+ virtual void unexecute() = 0;
+ virtual Type type() const = 0;
+ virtual void merge( Command *c );
+ virtual bool canMerge( Command *c );
+
+ FormWindow *formWindow() const;
+
+private:
+ QString cmdName;
+ FormWindow *formWin;
+
+};
+
+class CommandHistory : public QObject
+{
+ Q_OBJECT
+
+public:
+ CommandHistory( int s );
+
+ void addCommand( Command *cmd, bool tryCompress = FALSE );
+ void undo();
+ void redo();
+
+ void emitUndoRedo();
+
+ void setModified( bool m );
+ bool isModified() const;
+
+public slots:
+ void checkCompressedCommand();
+
+signals:
+ void undoRedoChanged( bool undoAvailable, bool redoAvailable,
+ const QString &undoCmd, const QString &redoCmd );
+ void modificationChanged( bool m );
+
+private:
+ QPtrList<Command> history;
+ int current, steps;
+ bool modified;
+ int savedAt;
+ Command *compressedCommand;
+
+};
+
+class ResizeCommand : public Command
+{
+public:
+ ResizeCommand( const QString &n, FormWindow *fw,
+ QWidget *w, const QRect &oldr, const QRect &nr );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Resize; }
+
+private:
+ QWidget *widget;
+ QRect oldRect, newRect;
+
+};
+
+class InsertCommand : public Command
+{
+public:
+ InsertCommand( const QString &n, FormWindow *fw, QWidget *w, const QRect &g );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Insert; }
+
+private:
+ QWidget *widget;
+ QRect geometry;
+
+};
+
+class MoveCommand : public Command
+{
+public:
+ MoveCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &w,
+ const QValueList<QPoint> op,
+ const QValueList<QPoint> np,
+ QWidget *opr, QWidget *npr );
+ void execute();
+ void unexecute();
+ Type type() const { return Move; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+
+private:
+ QWidgetList widgets;
+ QValueList<QPoint> oldPos, newPos;
+ QWidget *oldParent, *newParent;
+
+};
+
+class DeleteCommand : public Command
+{
+public:
+ DeleteCommand( const QString &n, FormWindow *fw,
+ const QWidgetList &w );
+ void execute();
+ void unexecute();
+ Type type() const { return Delete; }
+
+private:
+ QWidgetList widgets;
+ QMap< QWidget*, QValueList<MetaDataBase::Connection> > connections;
+
+};
+
+class SetPropertyCommand : public Command
+{
+public:
+ SetPropertyCommand( const QString &n, FormWindow *fw,
+ QObject *w, PropertyEditor *e,
+ const QString &pn, const QVariant &ov,
+ const QVariant &nv, const QString &ncut,
+ const QString &ocut,
+ bool reset = FALSE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return SetProperty; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+ bool checkProperty();
+
+private:
+ void setProperty( const QVariant &v, const QString &currentItemText, bool select = TRUE );
+
+ QGuardedPtr<QObject> widget;
+ PropertyEditor *editor;
+ QString propName;
+ QVariant oldValue, newValue;
+ QString oldCurrentItemText, newCurrentItemText;
+ bool wasChanged;
+ bool isResetCommand;
+
+};
+
+class LayoutHorizontalCommand : public Command
+{
+public:
+ LayoutHorizontalCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutHorizontal; }
+
+private:
+ HorizontalLayout layout;
+
+};
+
+class LayoutHorizontalSplitCommand : public Command
+{
+public:
+ LayoutHorizontalSplitCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutHorizontalSplitter; }
+
+private:
+ HorizontalLayout layout;
+
+};
+
+class LayoutVerticalCommand : public Command
+{
+public:
+ LayoutVerticalCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutVertical; }
+
+private:
+ VerticalLayout layout;
+
+};
+
+class LayoutVerticalSplitCommand : public Command
+{
+public:
+ LayoutVerticalSplitCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutVerticalSplitter; }
+
+private:
+ VerticalLayout layout;
+
+};
+
+class LayoutGridCommand : public Command
+{
+public:
+ LayoutGridCommand( const QString &n, FormWindow *fw,
+ QWidget *parent, QWidget *layoutBase,
+ const QWidgetList &wl, int xres, int yres );
+
+ void execute();
+ void unexecute();
+ Type type() const { return LayoutGrid; }
+
+private:
+ GridLayout layout;
+
+};
+
+class BreakLayoutCommand : public Command
+{
+public:
+ BreakLayoutCommand( const QString &n, FormWindow *fw,
+ QWidget *layoutBase, const QWidgetList &wl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return BreakLayout; }
+
+private:
+ Layout *layout;
+ int spacing;
+ int margin;
+ QWidget *lb;
+ QWidgetList widgets;
+
+};
+
+class MacroCommand : public Command
+{
+public:
+ MacroCommand( const QString &n, FormWindow *fw,
+ const QPtrList<Command> &cmds );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Macro; }
+
+private:
+ QPtrList<Command> commands;
+
+};
+
+class AddTabPageCommand : public Command
+{
+public:
+ AddTabPageCommand( const QString &n, FormWindow *fw,
+ QTabWidget *tw, const QString &label );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddTabPage; }
+
+private:
+ QTabWidget *tabWidget;
+ int index;
+ QWidget *tabPage;
+ QString tabLabel;
+
+};
+
+class DeleteTabPageCommand : public Command
+{
+public:
+ DeleteTabPageCommand( const QString &n, FormWindow *fw,
+ QTabWidget *tw, QWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteTabPage; }
+
+private:
+ QTabWidget *tabWidget;
+ int index;
+ QWidget *tabPage;
+ QString tabLabel;
+
+};
+
+class MoveTabPageCommand : public Command
+{
+public:
+ MoveTabPageCommand(const QString &n, FormWindow *fw,
+ QTabWidget *tw, QWidget *page, const QString& label, int nIndex, int oIndex );
+
+ void execute();
+ void unexecute();
+ Type type() const { return MoveTabPage; }
+
+private:
+ QTabWidget *tabWidget;
+ int newIndex, oldIndex;
+ QWidget *tabPage;
+ QString tabLabel;
+
+};
+class QDesignerWidgetStack;
+class AddWidgetStackPageCommand : public Command
+{
+public:
+ AddWidgetStackPageCommand( const QString &n, FormWindow *fw,
+ QDesignerWidgetStack *ws );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddWidgetStackPage; }
+
+private:
+ QDesignerWidgetStack *widgetStack;
+ int index;
+ QWidget *stackPage;
+};
+
+class DeleteWidgetStackPageCommand : public Command
+{
+public:
+ DeleteWidgetStackPageCommand( const QString &n, FormWindow *fw,
+ QDesignerWidgetStack *ws, QWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteWidgetStackPage; }
+
+private:
+ QDesignerWidgetStack *widgetStack;
+ int index;
+ QWidget *stackPage;
+};
+
+
+
+class AddWizardPageCommand : public Command
+{
+public:
+ AddWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, const QString &label, int index = -1, bool show = TRUE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddWizardPage; }
+
+private:
+ QWizard *wizard;
+ int index;
+ bool show;
+ QWidget *page;
+ QString pageLabel;
+
+};
+
+class DeleteWizardPageCommand : public Command
+{
+public:
+ DeleteWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int index, bool show = TRUE );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteWizardPage; }
+
+private:
+ QWizard *wizard;
+ int index;
+ bool show;
+ QWidget *page;
+ QString pageLabel;
+
+};
+
+class RenameWizardPageCommand : public Command
+{
+public:
+ RenameWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int index, const QString& name );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RenameWizardPage; }
+
+private:
+ QWizard *wizard;
+ int index;
+ QWidget *page;
+ QString label;
+
+};
+
+class SwapWizardPagesCommand : public Command
+{
+public:
+ SwapWizardPagesCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int index1, int index2 );
+
+ void execute();
+ void unexecute();
+ Type type() const { return SwapWizardPages; }
+
+private:
+ QWizard *wizard;
+ int index1, index2;
+
+};
+
+class MoveWizardPageCommand : public Command
+{
+public:
+ MoveWizardPageCommand( const QString &n, FormWindow *fw,
+ QWizard *w, int index1, int index2 );
+
+ void execute();
+ void unexecute();
+ Type type() const { return MoveWizardPage; }
+
+private:
+ QWizard *wizard;
+ int index1, index2;
+
+};
+
+class AddConnectionCommand : public Command
+{
+public:
+ AddConnectionCommand( const QString &name, FormWindow *fw,
+ MetaDataBase::Connection c );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddConnection; }
+
+private:
+ MetaDataBase::Connection connection;
+
+};
+
+class RemoveConnectionCommand : public Command
+{
+public:
+ RemoveConnectionCommand( const QString &name, FormWindow *fw,
+ MetaDataBase::Connection c );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveConnection; }
+
+private:
+ MetaDataBase::Connection connection;
+
+};
+
+
+class AddFunctionCommand : public Command
+{
+public:
+ AddFunctionCommand( const QString &name, FormWindow *fw, const QCString &f, const QString& spec,
+ const QString &a, const QString &t, const QString &l, const QString &rt );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddFunction; }
+
+private:
+ QCString function;
+ QString specifier;
+ QString access;
+ QString functionType;
+ QString language;
+ QString returnType;
+};
+
+class ChangeFunctionAttribCommand : public Command
+{
+public:
+ ChangeFunctionAttribCommand( const QString &name, FormWindow *fw, MetaDataBase::Function f,
+ const QString &on, const QString &os, const QString &oa,
+ const QString &ot, const QString &ol, const QString &ort );
+
+ void execute();
+ void unexecute();
+ Type type() const { return ChangeFunctionAttrib; }
+
+private:
+ QString oldName, newName;
+ QString oldSpec, newSpec;
+ QString oldAccess, newAccess;
+ QString oldType, newType;
+ QString oldLang, newLang;
+ QString oldReturnType, newReturnType;
+};
+
+class RemoveFunctionCommand : public Command
+{
+public:
+ RemoveFunctionCommand( const QString &name, FormWindow *fw, const QCString &f, const QString& spec,
+ const QString &a, const QString &t, const QString &l, const QString &rt );
+
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveFunction; }
+
+private:
+ QCString function;
+ QString specifier;
+ QString access;
+ QString functionType;
+ QString language;
+ QString returnType;
+};
+
+class AddVariableCommand : public Command
+{
+public:
+ AddVariableCommand( const QString &name, FormWindow *fw, const QString &vn, const QString &a );
+ void execute();
+ void unexecute();
+ Type type() const { return AddVariable; }
+
+private:
+ QString varName;
+ QString access;
+};
+
+class SetVariablesCommand : public Command
+{
+public:
+ SetVariablesCommand( const QString &name, FormWindow *fw, QValueList<MetaDataBase::Variable> lst );
+ void execute();
+ void unexecute();
+ Type type() const { return SetVariables; }
+
+private:
+ QValueList<MetaDataBase::Variable> oldList, newList;
+};
+
+class RemoveVariableCommand : public Command
+{
+public:
+ RemoveVariableCommand( const QString &name, FormWindow *fw, const QString &vn );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveVariable; }
+
+private:
+ QString varName;
+ QString access;
+};
+
+class EditDefinitionsCommand : public Command
+{
+public:
+ EditDefinitionsCommand( const QString &name, FormWindow *fw, LanguageInterface *lf,
+ const QString &n, const QStringList &l );
+ void execute();
+ void unexecute();
+ Type type() const { return EditDefinitions; }
+
+private:
+ LanguageInterface *lIface;
+ QString defName;
+ QStringList newList, oldList;
+};
+
+class LowerCommand : public Command
+{
+public:
+ LowerCommand( const QString &name, FormWindow *fw, const QWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Lower; }
+
+private:
+ QWidgetList widgets;
+
+};
+
+class RaiseCommand : public Command
+{
+public:
+ RaiseCommand( const QString &name, FormWindow *fw, const QWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Raise; }
+
+private:
+ QWidgetList widgets;
+
+};
+
+class PasteCommand : public Command
+{
+public:
+ PasteCommand( const QString &n, FormWindow *fw, const QWidgetList &w );
+
+ void execute();
+ void unexecute();
+ Type type() const { return Paste; }
+
+private:
+ QWidgetList widgets;
+
+};
+
+class TabOrderCommand : public Command
+{
+public:
+ TabOrderCommand( const QString &n, FormWindow *fw, const QWidgetList &ol, const QWidgetList &nl );
+
+ void execute();
+ void unexecute();
+ Type type() const { return TabOrder; }
+ void merge( Command *c );
+ bool canMerge( Command *c );
+
+private:
+ QWidgetList oldOrder, newOrder;
+
+};
+
+class PopulateListBoxCommand : public Command
+{
+public:
+ struct Item
+ {
+ QString text;
+ QPixmap pix;
+ Q_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ PopulateListBoxCommand( const QString &n, FormWindow *fw,
+ QListBox *lb, const QValueList<Item> &items );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateListBox; }
+
+ bool operator==( const PopulateListBoxCommand & ) const;
+
+private:
+ QValueList<Item> oldItems, newItems;
+ QListBox *listbox;
+
+};
+
+class PopulateIconViewCommand : public Command
+{
+public:
+ struct Item
+ {
+ QString text;
+ QPixmap pix;
+ Q_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ PopulateIconViewCommand( const QString &n, FormWindow *fw,
+ QIconView *iv, const QValueList<Item> &items );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateIconView; }
+
+ bool operator==( const PopulateIconViewCommand & ) const;
+
+private:
+ QValueList<Item> oldItems, newItems;
+ QIconView *iconview;
+
+};
+
+class PopulateListViewCommand : public Command
+{
+public:
+ PopulateListViewCommand( const QString &n, FormWindow *fw,
+ QListView *lv, QListView *from );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateListView; }
+ static void transferItems( QListView *from, QListView *to );
+
+ bool operator==( const PopulateListViewCommand & ) const;
+
+private:
+ QListView *oldItems, *newItems;
+ QListView *listview;
+
+};
+
+class PopulateMultiLineEditCommand : public Command
+{
+public:
+ PopulateMultiLineEditCommand( const QString &n, FormWindow *fw,
+ QTextEdit *mle, const QString &txt );
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateMultiLineEdit; }
+
+private:
+ QString newText, oldText;
+ QTextEdit *mlined;
+ bool wasChanged;
+
+};
+
+class PopulateTableCommand : public Command
+{
+public:
+ struct Row
+ {
+ QString text;
+ QPixmap pix;
+ Q_DUMMY_COMPARISON_OPERATOR( Row )
+ };
+
+ struct Column
+ {
+ QString text;
+ QPixmap pix;
+ QString field;
+ Q_DUMMY_COMPARISON_OPERATOR( Column )
+ };
+
+ PopulateTableCommand( const QString &n, FormWindow *fw, QTable *t,
+ const QValueList<Row> &rows,
+ const QValueList<Column> &columns );
+
+ void execute();
+ void unexecute();
+ Type type() const { return PopulateTable; }
+
+private:
+ QValueList<Row> oldRows, newRows;
+ QValueList<Column> oldColumns, newColumns;
+ QTable *table;
+
+};
+
+class AddActionToToolBarCommand : public Command
+{
+public:
+ AddActionToToolBarCommand( const QString &n, FormWindow *fw,
+ QAction *a, QDesignerToolBar *tb, int idx );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddActionToToolBar; }
+
+private:
+ QAction *action;
+ QDesignerToolBar *toolBar;
+ int index;
+
+};
+
+class RemoveActionFromToolBarCommand : public AddActionToToolBarCommand
+{
+public:
+ RemoveActionFromToolBarCommand( const QString &n, FormWindow *fw,
+ QAction *a, QDesignerToolBar *tb, int idx )
+ : AddActionToToolBarCommand( n, fw, a, tb, idx ) {}
+
+ void execute() { AddActionToToolBarCommand::unexecute(); }
+ void unexecute() { AddActionToToolBarCommand::execute(); }
+ Type type() const { return RemoveActionFromToolBar; }
+
+};
+
+// MenuCommands
+
+class AddToolBarCommand : public Command
+{
+public:
+ AddToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddToolBar; }
+
+protected:
+ QDesignerToolBar *toolBar;
+ QMainWindow *mainWindow;
+
+};
+
+class RemoveToolBarCommand : public AddToolBarCommand
+{
+public:
+ RemoveToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw, QDesignerToolBar *tb )
+ : AddToolBarCommand( n, fw, mw ) { toolBar = tb; }
+
+ void execute() { AddToolBarCommand::unexecute(); }
+ void unexecute() { AddToolBarCommand::execute(); }
+ Type type() const { return RemoveToolBar; }
+
+};
+
+struct QWidgetContainerInterfacePrivate;
+
+class AddContainerPageCommand : public Command
+{
+public:
+ AddContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *c, const QString &label );
+
+ ~AddContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddContainerPage; }
+
+private:
+ QString wClassName;
+ QWidget *container;
+ int index;
+ QString pageLabel;
+ QWidget *page;
+ QWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class DeleteContainerPageCommand : public Command
+{
+public:
+ DeleteContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *container, int index );
+ ~DeleteContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteContainerPage; }
+
+private:
+ QString wClassName;
+ QWidget *container;
+ int index;
+ QString pageLabel;
+ QWidget *page;
+ QWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class RenameContainerPageCommand : public Command
+{
+public:
+ RenameContainerPageCommand( const QString &n, FormWindow *fw,
+ QWidget *container, int index,
+ const QString &label );
+ ~RenameContainerPageCommand();
+
+ void execute();
+ void unexecute();
+ Type type() const { return RenameContainerPage; }
+
+private:
+ QString wClassName;
+ QWidget *container;
+ int index;
+ QString oldLabel, newLabel;
+ QWidgetContainerInterfacePrivate *wiface;
+
+};
+
+class AddActionToPopupCommand : public Command
+{
+public:
+ AddActionToPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ PopupMenuEditorItem *i,
+ int idx = -1 );
+ void execute();
+ void unexecute();
+ Type type() const { return AddActionToPopup; }
+protected:
+ QString constructName() const;
+ PopupMenuEditor *menu;
+ PopupMenuEditorItem *item;
+ int index;
+private:
+};
+
+class RemoveActionFromPopupCommand : public AddActionToPopupCommand
+{
+public:
+ RemoveActionFromPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int idx );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveActionFromPopup; }
+protected:
+private:
+};
+
+class ExchangeActionInPopupCommand : public Command
+{
+public:
+ ExchangeActionInPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b );
+ void execute();
+ void unexecute();
+ Type type() const { return ExchangeActionInPopup; }
+protected:
+private:
+ PopupMenuEditor *menu;
+ int c;
+ int d;
+};
+/*
+class MoveActionInPopupCommand : public Command
+{
+public:
+ MoveActionInPopupCommand( const QString &n,
+ FormWindow *fw,
+ PopupMenuEditor *m,
+ int a,
+ int b );
+ void execute();
+ void unexecute();
+ Type type() const { return MoveActionInPopup; }
+protected:
+private:
+ PopupMenuEditor *menu;
+ int from;
+ int to;
+};
+*/
+class ActionCommand : public Command
+{
+public:
+ ActionCommand( const QString &n,
+ FormWindow *fw,
+ QAction *a )
+ : Command( n, fw ), action( a ) { }
+ virtual Type type() const = 0;
+protected:
+ ActionEditor *actionEditor();
+ QAction *action;
+};
+
+class RenameActionCommand : public ActionCommand
+{
+public:
+ RenameActionCommand( const QString &n,
+ FormWindow *fw,
+ QAction *a,
+ PopupMenuEditor *m,
+ QString nm );
+ void execute();
+ void unexecute();
+ Type type() const { return RenameAction; }
+private:
+ PopupMenuEditor *menu;
+ QString newName;
+ QString oldName;
+};
+
+class SetActionIconsCommand : public ActionCommand
+{
+public:
+ SetActionIconsCommand( const QString &n,
+ FormWindow *fw,
+ QAction *a,
+ PopupMenuEditor *m,
+ QIconSet &icons );
+ void execute();
+ void unexecute();
+ Type type() const { return SetActionIcons; }
+protected:
+ void updateActionEditorItem();
+private:
+ PopupMenuEditor *menu;
+ QIconSet newIcons;
+ QIconSet oldIcons;
+};
+
+class AddMenuCommand : public Command
+{
+public:
+ AddMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ MenuBarEditorItem *i,
+ int idx = -1 );
+
+ AddMenuCommand( const QString &n,
+ FormWindow *fw,
+ QMainWindow *mw,
+ const QString &nm = "Menu" );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddMenu; }
+protected:
+ MenuBarEditor *mb;
+ MenuBarEditorItem *item;
+ QString name;
+ int index;
+private:
+};
+
+class RemoveMenuCommand : public AddMenuCommand
+{
+public:
+ RemoveMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int idx );
+ void execute();
+ void unexecute();
+ Type type() const { return RemoveMenu; }
+protected:
+private:
+};
+
+class ExchangeMenuCommand : public Command
+{
+public:
+ ExchangeMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j );
+ void execute();
+ void unexecute();
+ Type type() const { return ExchangeMenu; }
+protected:
+private:
+ MenuBarEditor *bar;
+ int k;
+ int l;
+};
+
+
+class MoveMenuCommand : public Command
+{
+public:
+ MoveMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *b,
+ int i,
+ int j );
+ void execute();
+ void unexecute();
+ Type type() const { return MoveMenu; }
+protected:
+private:
+ MenuBarEditor *bar;
+ int from;
+ int to;
+};
+
+class RenameMenuCommand : public Command
+{
+public:
+ RenameMenuCommand( const QString &n,
+ FormWindow *fw,
+ MenuBarEditor *m,
+ QString nm,
+ MenuBarEditorItem *i );
+ void execute();
+ void unexecute();
+ Type type() const { return RenameMenu; }
+ static QString makeLegal( const QString &str );
+private:
+ MenuBarEditor *bar;
+ MenuBarEditorItem *item;
+ QString newName;
+ QString oldName;
+};
+
+class AddToolBoxPageCommand : public Command
+{
+public:
+ AddToolBoxPageCommand( const QString &n, FormWindow *fw,
+ QToolBox *tw, const QString &label );
+
+ void execute();
+ void unexecute();
+ Type type() const { return AddToolBoxPage; }
+
+private:
+ QToolBox *toolBox;
+ int index;
+ QWidget *toolBoxPage;
+ QString toolBoxLabel;
+
+};
+
+class DeleteToolBoxPageCommand : public Command
+{
+public:
+ DeleteToolBoxPageCommand( const QString &n, FormWindow *fw,
+ QToolBox *tw, QWidget *page );
+
+ void execute();
+ void unexecute();
+ Type type() const { return DeleteToolBoxPage; }
+
+private:
+ QToolBox *toolBox;
+ int index;
+ QWidget *toolBoxPage;
+ QString toolBoxLabel;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/configtoolboxdialog.ui b/kdevdesigner/designer/configtoolboxdialog.ui
new file mode 100644
index 00000000..ac19357b
--- /dev/null
+++ b/kdevdesigner/designer/configtoolboxdialog.ui
@@ -0,0 +1,326 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConfigToolboxDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ConfigToolboxDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>467</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Configure Toolbox</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>342</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonAdd</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <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>111</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="2">
+ <column>
+ <property name="text">
+ <string>Available Tools</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listViewTools</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>buttonRemove</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Common Widgets Page</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listViewCommon</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="1" column="3">
+ <property name="name">
+ <cstring>buttonDown</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <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>41</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QToolButton" row="1" column="2">
+ <property name="name">
+ <cstring>buttonUp</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>addTool()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>removeTool()</slot>
+ </connection>
+ <connection>
+ <sender>buttonUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>moveToolUp()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>moveToolDown()</slot>
+ </connection>
+ <connection>
+ <sender>listViewTools</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>currentToolChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listViewCommon</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>currentCommonToolChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>ok()</slot>
+ </connection>
+ <connection>
+ <sender>listViewTools</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
+ <receiver>ConfigToolboxDialog</receiver>
+ <slot>addTool()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">configtoolboxdialog.ui.h</include>
+</includes>
+<slots>
+ <slot>addTool()</slot>
+ <slot>removeTool()</slot>
+ <slot>moveToolUp()</slot>
+ <slot>moveToolDown()</slot>
+ <slot>currentToolChanged( QListViewItem * i )</slot>
+ <slot>currentCommonToolChanged( QListViewItem * i )</slot>
+ <slot>ok()</slot>
+</slots>
+<functions>
+ <function access="private">init()</function>
+</functions>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/configtoolboxdialog.ui.h b/kdevdesigner/designer/configtoolboxdialog.ui.h
new file mode 100644
index 00000000..6b5d55b6
--- /dev/null
+++ b/kdevdesigner/designer/configtoolboxdialog.ui.h
@@ -0,0 +1,215 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+#include "widgetaction.h"
+#include "listviewdnd.h"
+#include <qlistview.h>
+
+void ConfigToolboxDialog::init()
+{
+ listViewTools->setSorting( -1 );
+ listViewCommon->setSorting( -1 );
+
+ ListViewDnd *toolsDnd = new ListViewDnd( listViewTools );
+ toolsDnd->setDragMode( ListViewDnd::External | ListViewDnd::NullDrop | ListViewDnd::Flat );
+
+ ListViewDnd *commonDnd = new ListViewDnd( listViewCommon );
+ commonDnd->setDragMode( ListViewDnd::Both | ListViewDnd::Move | ListViewDnd::Flat );
+
+ QObject::connect( toolsDnd, SIGNAL( dropped( QListViewItem * ) ),
+ commonDnd, SLOT( confirmDrop( QListViewItem * ) ) );
+ QObject::connect( commonDnd, SIGNAL( dropped( QListViewItem * ) ),
+ commonDnd, SLOT( confirmDrop( QListViewItem * ) ) );
+
+ QDict<QListViewItem> groups;
+ QAction *a;
+ for ( a = MainWindow::self->toolActions.last();
+ a;
+ a = MainWindow::self->toolActions.prev() ) {
+ QString grp = ( (WidgetAction*)a )->group();
+ QListViewItem *parent = groups.find( grp );
+ if ( !parent ) {
+ parent = new QListViewItem( listViewTools );
+ parent->setText( 0, grp );
+ parent->setOpen( TRUE );
+ groups.insert( grp, parent );
+ }
+ QListViewItem *i = new QListViewItem( parent );
+ i->setText( 0, a->text() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ }
+ for ( a = MainWindow::self->commonWidgetsPage.last(); a;
+ a = MainWindow::self->commonWidgetsPage.prev() ) {
+ QListViewItem *i = new QListViewItem( listViewCommon );
+ i->setText( 0, a->text() );
+ i->setPixmap( 0, a->iconSet().pixmap() );
+ }
+
+}
+
+
+void ConfigToolboxDialog::addTool()
+{
+ QListView *src = listViewTools;
+
+ bool addKids = FALSE;
+ QListViewItem *nextSibling = 0;
+ QListViewItem *nextParent = 0;
+ QListViewItemIterator it = src->firstChild();
+ for ( ; *it; it++ ) {
+ // Hit the nextSibling, turn of child processing
+ if ( (*it) == nextSibling )
+ addKids = FALSE;
+
+ if ( (*it)->isSelected() ) {
+ if ( (*it)->childCount() == 0 ) {
+ // Selected, no children
+ QListViewItem *i = new QListViewItem( listViewCommon, listViewCommon->lastItem() );
+ i->setText( 0, (*it)->text(0) );
+ i->setPixmap( 0, *((*it)->pixmap(0)) );
+ listViewCommon->setCurrentItem( i );
+ listViewCommon->ensureItemVisible( i );
+ } else if ( !addKids ) {
+ // Children processing not set, so set it
+ // Also find the item were we shall quit
+ // processing children...if any such item
+ addKids = TRUE;
+ nextSibling = (*it)->nextSibling();
+ nextParent = (*it)->parent();
+ while ( nextParent && !nextSibling ) {
+ nextSibling = nextParent->nextSibling();
+ nextParent = nextParent->parent();
+ }
+ }
+ } else if ( ((*it)->childCount() == 0) && addKids ) {
+ // Leaf node, and we _do_ process children
+ QListViewItem *i = new QListViewItem( listViewCommon, listViewCommon->lastItem() );
+ i->setText( 0, (*it)->text(0) );
+ i->setPixmap( 0, *((*it)->pixmap(0)) );
+ listViewCommon->setCurrentItem( i );
+ listViewCommon->ensureItemVisible( i );
+ }
+ }
+}
+
+
+void ConfigToolboxDialog::removeTool()
+{
+ QListViewItemIterator it = listViewCommon->firstChild();
+ while ( *it ) {
+ if ( (*it)->isSelected() )
+ delete (*it);
+ else
+ it++;
+ }
+}
+
+
+void ConfigToolboxDialog::moveToolUp()
+{
+ QListViewItem *next = 0;
+ QListViewItem *item = listViewCommon->firstChild();
+ for ( int i = 0; i < listViewCommon->childCount(); ++i ) {
+ next = item->itemBelow();
+ if ( item->isSelected() && (i > 0) && !item->itemAbove()->isSelected() )
+ item->itemAbove()->moveItem( item );
+ item = next;
+ }
+}
+
+
+void ConfigToolboxDialog::moveToolDown()
+{
+ int count = listViewCommon->childCount();
+ QListViewItem *next = 0;
+ QListViewItem *item = listViewCommon->lastItem();
+ for ( int i = 0; i < count; ++i ) {
+ next = item->itemAbove();
+ if ( item->isSelected() && (i > 0) && !item->itemBelow()->isSelected() )
+ item->moveItem( item->itemBelow() );
+ item = next;
+ }
+
+ // QListViewItem *item = listViewCommon->firstChild();
+ // for ( int i = 0; i < listViewCommon->childCount(); ++i ) {
+ //if ( item == listViewCommon->currentItem() ) {
+ // item->moveItem( item->itemBelow() );
+ // currentCommonToolChanged( item );
+ // break;
+ //}
+ //item = item->itemBelow();
+ // }
+}
+
+
+void ConfigToolboxDialog::currentToolChanged( QListViewItem *i )
+{
+ bool canAdd = FALSE;
+ QListViewItemIterator it = listViewTools->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() ) {
+ canAdd = TRUE;
+ break;
+ }
+ }
+ buttonAdd->setEnabled( canAdd || ( i && i->isSelected() ) );
+}
+
+
+void ConfigToolboxDialog::currentCommonToolChanged( QListViewItem *i )
+{
+ buttonUp->setEnabled( (bool) (i && i->itemAbove()) );
+ buttonDown->setEnabled( (bool) (i && i->itemBelow()) );
+
+ bool canRemove = FALSE;
+ QListViewItemIterator it = listViewCommon->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() ) {
+ canRemove = TRUE;
+ break;
+ }
+ }
+ buttonRemove->setEnabled( canRemove || ( i && i->isSelected() ) );
+}
+
+
+void ConfigToolboxDialog::ok()
+{
+ MainWindow::self->commonWidgetsPage.clear();
+ QListViewItem *item = listViewCommon->firstChild();
+ for ( int j = 0; j < listViewCommon->childCount(); item = item->itemBelow(), ++j ) {
+ QAction *a = 0;
+ for ( a = MainWindow::self->toolActions.last();
+ a;
+ a = MainWindow::self->toolActions.prev() ) {
+ if ( a->text() == item->text( 0 ) )
+ break;
+ }
+ if ( a )
+ MainWindow::self->commonWidgetsPage.insert( j, a );
+ }
+}
diff --git a/kdevdesigner/designer/connectiondialog.ui b/kdevdesigner/designer/connectiondialog.ui
new file mode 100644
index 00000000..c8cc9c4f
--- /dev/null
+++ b/kdevdesigner/designer/connectiondialog.ui
@@ -0,0 +1,219 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConnectionDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ConnectionDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>365</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>View &amp; Edit Connections</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Connections:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>connectionsTable</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>PushButton7</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer1</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>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>buttonEditSlots</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Slots...</string>
+ </property>
+ </widget>
+ <widget class="ConnectionTable" row="1" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>connectionsTable</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ConnectionTable</class>
+ <header location="local">connectiontable.h</header>
+ <sizehint>
+ <width>50</width>
+ <height>50</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>7</hordata>
+ <verdata>7</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>"image0"</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4830">789c9597c972e3480e40eff5158ec2ada203cd3549c6c41cbcc9b6bccabbddd1078014bdcb9b6449ee987f9f240072caac9e4357d6c1cf5812890490f4ef3f562e8ff6577efcfeed7d4ad3bb72a5bca5b7951fd5ece969f9c79ffffeebdbf7285a69fec7f14af4fdb76fdf47d39572e5e079326e00c10304f24ff8b9c7d463ee71d9e3aac7e31ed70d67dc2ce1cb9e7cd0e3c957863eaff778d4b3bfe8c97be781a71eaff5f8e82bf37ecfff4dc314364b58fdb966096ff6ecf77af6b70d1771b3841f1b8ef366099ff7ec17bdf8faf7970847cd12f9b2e344f8b563890f5e3a96fda0ea98c45fdc71299c765c354c67c249bb1fcd3a56ff271d8b3d9d1b271a0f1d742c725874acfe9d70eef3a9f65bc2e47fa3f16a7d55411d6a3e4e1b0e03bf349e8171144a7e49ceeb295239cb79c3384ccdff76c7b23f14c269e8ccdfa9716ef6b5b18f407857d88585e57bbf65b39f18971a0fc8fd7b6fc624f723e524f9e3d2b8d4f391d49ba74ae5bed585a3c8e49b1d6b7c929f701ca5e65feac10b9dd967c2519485a9dcaf33ce952110cea3caec23e53830f9863045b5ca79ae1c8741263cec58eb59ed390ecd3e378e8d651e44651c85527f20f51cd55eae5c1b27a1f823b9bf388c0b65b831a6b090fd24be384bc24098a6d65fb5ca29ed58fd5f35eccbaf34ff320f922819ab3e487e93d4b3d6eb9b711d4abda0f44352a685d5f39d709db2ca296c380dd2c238366ee5605c1acb3c96f2d3feff148ed25aeb0d1e955d60fd22f94a63178632df79d5d8fa95971d8b9cee5b8e647ec1d038567b40e1a4d567a9d73475b1f14ecb5a7f2cf94a9d4b343eba304e357e3814ce5c6afd22f33b2d5c6ee7295bb6fc4abda4e40af3f7d972a4f52df79bb223ebff79cb2a2736e650ce470fc2652b67b9cfb4726dff5d195776bead96adbf1e3bd67a9779928ebbfdc898357f34346ee7c3a0658d07359eba5922d7fbaebd3fdd6f6e3c567d96f9e4c22cb4780a63eb7f90f7c525596cf11c1a2791ce9bd8d869bd93e4dba55eaeefc781b1dd17ee1b9b3e4b3e9dcbfcc4107f9fc671a4ef9dcc139765763fa4f6943965947a7355b3c45eceebc65965fb851deb79655e662ecfcddf93716172999759966791f67f689ceb79e9a363951f1b9b3d1e76acf36fcf98544e529fdebc954b3f67d42ce1eb86f3465df3fb2e5c14a5d53b2b53a0f316773ad6f922f32c2fa9cd9fdc6f5e79d6f8768d13ebc79d96559fe47dcd6b8a63cdcfbb71126bfcd21f45e0f5f57dbb357691c63f342e2cbea063d597f7b808c9e6151e1993c573d1b2de0fc8fd1711151a1fdf187324f393671debfe92df22a134d67e93fb2a1cd93c05630ef4fe48f25d641c683de2b171a8f399ef3a56f989b1bd273c6dd9f697f7bcc85b7dca8da348be4f41fabf2838b1f7e9cc38d5f715e4fd2888439b9f53639ba72cf55a701b3f0c8cad3ff9de38b57c4bfd15a5678d6f646cfd87857166ef95f46b51f9fdf57c609cda7b756edcbee7ceb850a671c7faf7809e7fccb9d63b6c1b93d5f7ac63d5d7fcd41c245a8fabc685e68f1f8c49ef93e5bda4c0fbd7f9b16b4c5a9ff060ccf63e4b3d52c889c6433bc685da33195bbfc2bd31dbfc947aa5982bf37fddb1c623f39c7cbbda7c94f889cac4ea4df24f55c9367fe43da47159da3c907ea39ac74ebfdfe5fe39e0dac9f71f4abed87fb02993d42b475562effb5dcb36ff243fec3f3f327d4fd1384db5ffd68c9db1bc579cb6faf8619cdafe321f39f39f33721fb46bec4cfe699c19cf3bd6f3ad1ae7c6f2de71ce2549fe71a9dcc917c685324b7eb8aac6767ff27dc763cf92afd1b4590848c8586285e3deaafc6fd94b61346df5b1c61bbcc53bbcff9bf5808ff884136ff5acfadef70dbee02bbee13b4e71861f38c7052ef1d3af555cc375dcc04d1c6069fae47dbfe2166ee30e0e7117f7701f0ff0108f7084c77882a77886e7788197a6cf3e922baf7d8d018618618c895f293acc30c702478000403831fdd247f90e8c019450610c63a8e1066efd4f15dcc13d3cc0a3d77f8256bff2fa531cc233bcc02bbcc13b4c61061f3087052ce11356c5ff1aac9bfed8ebcf701736bc741306b005dbb00343d8853def611f0ee0d0eb1fc1e827fd0f38861338f5becfe01c2ee0d26b5ec13504de4708d12ffa7388bd2481141c64907bed020f0909604944fc8bfe924a4ca8a231d5e2fb956ee896eee8deeb3fd0e32ffa0b7ac29426f041fed4f442afdee28dde694a33faa0f9aff1d0829618d327add21aadd3066dfafd06b445dbb443c3be3eedd21eed7bfd033aa4231ad1319dd0299dd1395dd0255dfd8dff6b0a28c4042af27fcc907fafc879ed73ff199053f145bfc207463c666062e6d2dfd9d2db2db9a20b1e73cd377cfbe5be4a5fb1eb7cc7f7fcc08ffcc4137ee6177ee5377ee729cff883e7bcf8a91ed8d7f7069ef1923f7995d7789d37789307bc4557bccd3b3ce45ddefba9defc4fbebecfe1fffce305eff1fe4ff50c3ea2015e00f93dd7fcb9beae35ff5bf2da5dbf788b676f71891398c03a8c7a6b1d267effcbfff5e33fe8f7fffcebdb7f01520e2ea3</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>addConnection()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton7</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>deleteClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonEditSlots</sender>
+ <signal>clicked()</signal>
+ <receiver>ConnectionDialog</receiver>
+ <slot>editSlots()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in declaration">qptrlist.h</include>
+ <include location="local" impldecl="in declaration">connectionitems.h</include>
+ <include location="local" impldecl="in implementation">connectiondialog.ui.h</include>
+</includes>
+<variables>
+ <variable>QPtrList&lt;ConnectionContainer&gt; connections;</variable>
+ <variable>QObject *defaultSender;</variable>
+ <variable>QObject *defaultReceiver;</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>addConnection()</slot>
+ <slot returnType="ConnectionContainer *">addConnection( QObject * sender, QObject * receiver, const QString &amp; signal, const QString &amp; slot )</slot>
+ <slot>updateConnectionState( ConnectionContainer * c )</slot>
+ <slot>okClicked()</slot>
+ <slot>cancelClicked()</slot>
+ <slot>deleteClicked()</slot>
+ <slot>editSlots()</slot>
+ <slot>setDefault( QObject * sender, QObject * receiver )</slot>
+ <slot>updateEditSlotsButton()</slot>
+ <slot>updateConnectionContainers()</slot>
+ <slot>ensureConnectionVisible()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/connectiondialog.ui.h b/kdevdesigner/designer/connectiondialog.ui.h
new file mode 100644
index 00000000..3c6cd932
--- /dev/null
+++ b/kdevdesigner/designer/connectiondialog.ui.h
@@ -0,0 +1,318 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include "mainwindow.h"
+#include "formwindow.h"
+#include "editfunctionsimpl.h"
+
+static const char *valid_connection[] = {
+ "16 14 7 1",
+ ". c none",
+ "# c #00c000",
+ "a c #008000",
+ "b c #004000",
+ "c c #000000",
+ "d c #c0fcc0",
+ "e c #400000",
+ "...............d",
+ "..............d#",
+ ".............d#a",
+ "............d#ab",
+ "...........d#abc",
+ "..da......d#abc.",
+ ".d##a....d#abe..",
+ "cba##a..d#abc...",
+ ".cba##ad#abe....",
+ "..eba###abe.....",
+ "...cba#abc......",
+ "....cbabc.......",
+ ".....cec........",
+ "................"
+};
+
+static const char * invalid_connection[] = {
+ "17 18 7 1",
+ " c None",
+ ". c #000000",
+ "+ c #C3C3C3",
+ "@ c #FFFFFF",
+ "# c #C00000",
+ "$ c #FFC0C0",
+ "% c #FF0000",
+ " ",
+ " . ",
+ " ... ",
+ " .+.. ",
+ " ...+@+.. ",
+ "..+@@@+#.. ",
+ ".@@@@$#%#.. ",
+ ".@@$$#%##.. ",
+ " .$%%%##.... ",
+ " .%%%##. .. ",
+ " .%#.. .. ",
+ " .. .. ",
+ " .. ",
+ " .. ",
+ " .. ",
+ " .. ",
+ " ",
+ " "
+};
+
+static QPixmap *invalidConnection = 0;
+static QPixmap *validConnection = 0;
+
+void ConnectionDialog::init()
+{
+ connect( connectionsTable, SIGNAL( currentChanged( int, int ) ),
+ this, SLOT( updateEditSlotsButton() ) );
+ connect( connectionsTable, SIGNAL( resorted() ),
+ this, SLOT( updateConnectionContainers() ) );
+ buttonEditSlots->setEnabled( FALSE );
+
+ if ( !invalidConnection ) {
+ invalidConnection = new QPixmap( invalid_connection );
+ validConnection = new QPixmap( valid_connection );
+ }
+
+ QValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ for ( QValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ it != conns.end(); ++it ) {
+ ConnectionContainer *c = addConnection( (*it).sender, (*it).receiver,
+ (*it).signal, (*it).slot );
+ c->setModified( FALSE );
+ updateConnectionState( c );
+ }
+
+ defaultSender = defaultReceiver = 0;
+ connectionsTable->setCurrentCell( 0, 0 );
+}
+
+void ConnectionDialog::addConnection()
+{
+ addConnection( defaultSender, defaultReceiver, QString::null, QString::null );
+ ensureConnectionVisible();
+}
+
+ConnectionContainer *ConnectionDialog::addConnection( QObject *sender, QObject *receiver,
+ const QString &signal,
+ const QString &slot )
+{
+ connectionsTable->insertRows( connectionsTable->numRows() );
+
+ int row = connectionsTable->numRows() - 1;
+ SenderItem *se;
+ SignalItem *si;
+ ReceiverItem *re;
+ SlotItem *sl;
+ connectionsTable->setItem( row, 0,
+ ( se = new SenderItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 1,
+ ( si = new SignalItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 2,
+ ( re = new ReceiverItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+ connectionsTable->setItem( row, 3,
+ ( sl = new SlotItem( connectionsTable,
+ MainWindow::self->formWindow() ) ) );
+
+ si->setSender( se );
+ re->setSender( se );
+ sl->setSender( se );
+ se->setSender( se );
+
+ se->setSignal( si );
+ re->setSignal( si );
+ sl->setSignal( si );
+ si->setSignal( si );
+
+ se->setReceiver( re );
+ si->setReceiver( re );
+ sl->setReceiver( re );
+ re->setReceiver( re );
+
+ se->setSlot( sl );
+ si->setSlot( sl );
+ re->setSlot( sl );
+ sl->setSlot( sl );
+
+ connect( re, SIGNAL( currentReceiverChanged( QObject * ) ),
+ this, SLOT( updateEditSlotsButton() ) );
+
+ ConnectionContainer *c = new ConnectionContainer( this, se, si, re, sl, row );
+ connections.append( c );
+ connect( c, SIGNAL( changed( ConnectionContainer * ) ),
+ this, SLOT( updateConnectionState( ConnectionContainer * ) ) );
+
+ connectionsTable->setCurrentCell( row, 0 );
+
+ connectionsTable->verticalHeader()->setLabel( row, *invalidConnection, QString::null );
+
+ if ( sender )
+ se->setSenderEx( sender );
+ defaultSender = sender;
+ if ( receiver )
+ re->setReceiverEx( receiver );
+ defaultReceiver = receiver;
+
+ if ( !signal.isEmpty() && !slot.isEmpty() ) {
+ si->setCurrentItem( signal );
+ sl->signalChanged( signal );
+ sl->setCurrentItem( slot );
+ }
+
+ c->setModified( TRUE );
+ return c;
+}
+
+void ConnectionDialog::updateConnectionState( ConnectionContainer *c )
+{
+ c->repaint();
+ if ( c->isValid() )
+ connectionsTable->verticalHeader()->setLabel( c->row(),
+ *validConnection, QString::null );
+ else
+ connectionsTable->verticalHeader()->setLabel( c->row(),
+ *invalidConnection, QString::null );
+}
+
+
+void ConnectionDialog::okClicked()
+{
+ QValueList<MetaDataBase::Connection> oldConnections =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ QPtrList<Command> newConnectionCmds;
+ QPtrList<Command> oldConnectionCmds;
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ MetaDataBase::Connection conn;
+
+ // find sender widget
+ conn.sender = MainWindow::self->formWindow()->child( c->senderItem()->currentText() );
+ if ( !conn.sender ) // if no sender widget, find sender action
+ conn.sender = MainWindow::self->formWindow()->findAction( c->senderItem()->currentText() );
+
+ // find receiver widget
+ conn.receiver = MainWindow::self->formWindow()->child( c->receiverItem()->currentText() );
+ if ( !conn.receiver ) // if no receiver widget, find receiver action
+ conn.receiver = MainWindow::self->formWindow()->findAction( c->receiverItem()->currentText() );
+
+ conn.signal = c->signalItem()->currentText();
+ conn.slot = c->slotItem()->currentText();
+ AddConnectionCommand *cmd = new AddConnectionCommand( i18n( "Add Signal/Slot "
+ "Connection" ),
+ MainWindow::self->formWindow(),
+ conn );
+ newConnectionCmds.append( cmd );
+ }
+
+
+ QValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( MainWindow::self->formWindow() );
+ for ( QValueList<MetaDataBase::Connection>::Iterator it = conns.begin();
+ it != conns.end(); ++it ) {
+ RemoveConnectionCommand *cmd = new RemoveConnectionCommand( i18n( "Remove Signal/Slot "
+ "Connection" ),
+ MainWindow::self->
+ formWindow(), *it );
+ oldConnectionCmds.append( cmd );
+ }
+
+ MacroCommand *cmd1 = new MacroCommand( i18n( "Add Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ newConnectionCmds );
+ MacroCommand *cmd2 = new MacroCommand( i18n( "Remove Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ oldConnectionCmds );
+ QPtrList<Command> cmds;
+ cmds.append( cmd2 );
+ cmds.append( cmd1 );
+ MacroCommand *cmd = new MacroCommand( i18n( "Edit Signal/Slot Connections" ),
+ MainWindow::self->formWindow(),
+ cmds );
+ MainWindow::self->formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ accept();
+}
+
+
+void ConnectionDialog::cancelClicked()
+{
+ reject();
+}
+
+
+void ConnectionDialog::deleteClicked()
+{
+ int cr = connectionsTable->currentRow();
+ connections.remove( cr );
+ connectionsTable->removeRow( cr );
+ int i = 0;
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() )
+ c->setRow( i++ );
+}
+
+
+void ConnectionDialog::editSlots()
+{
+ EditFunctions dlg( this, MainWindow::self->formWindow(), TRUE );
+ dlg.exec();
+ int currentCol = connectionsTable->currentColumn();
+ connectionsTable->setCurrentCell( connectionsTable->currentRow(), 0 );
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ if ( c->receiverItem()->currentText() !=
+ QString( MainWindow::self->formWindow()->mainContainer()->name() ) )
+ continue;
+ c->slotItem()->customSlotsChanged();
+ }
+ connectionsTable->setCurrentCell( connectionsTable->currentRow(), currentCol );
+}
+
+void ConnectionDialog::setDefault( QObject *sender, QObject *receiver )
+{
+ defaultSender = sender;
+ defaultReceiver = receiver;
+}
+
+void ConnectionDialog::updateEditSlotsButton()
+{
+ if ( connectionsTable->currentRow() < 0 ||
+ connectionsTable->currentRow() > (int)connections.count() - 1 )
+ return;
+ ConnectionContainer *c = connections.at( connectionsTable->currentRow() );
+ if ( !c || !c->receiverItem() )
+ return;
+ buttonEditSlots->setEnabled( c->receiverItem()->currentText() ==
+ QString( MainWindow::self->formWindow()->
+ mainContainer()->name() ) );
+}
+
+void ConnectionDialog::updateConnectionContainers()
+{
+ QPtrList<ConnectionContainer> newContainers;
+ for ( int i = 0; i < connectionsTable->numRows(); ++i ) {
+ for ( ConnectionContainer *c = connections.first(); c; c = connections.next() ) {
+ if ( c->senderItem() == connectionsTable->item( i, 0 ) ) {
+ newContainers.append( c );
+ c->setRow( i );
+ updateConnectionState(c);
+ break;
+ }
+ }
+ }
+ connections = newContainers;
+ updateEditSlotsButton();
+}
+
+void ConnectionDialog::ensureConnectionVisible()
+{
+ connectionsTable->ensureCellVisible( connectionsTable->numRows() - 1, 0 );
+}
diff --git a/kdevdesigner/designer/connectionitems.cpp b/kdevdesigner/designer/connectionitems.cpp
new file mode 100644
index 00000000..197eef65
--- /dev/null
+++ b/kdevdesigner/designer/connectionitems.cpp
@@ -0,0 +1,517 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "connectionitems.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "project.h"
+#include <qpainter.h>
+#include <qcombobox.h>
+#include <qmetaobject.h>
+#include <qcombobox.h>
+#include <qlistbox.h>
+#include <qaction.h>
+#include <qdatabrowser.h>
+
+static const char* const ignore_slots[] = {
+ "destroyed()",
+ "setCaption(const QString&)",
+ "setIcon(const QPixmap&)",
+ "setIconText(const QString&)",
+ "setMouseTracking(bool)",
+ "clearFocus()",
+ "setUpdatesEnabled(bool)",
+ "update()",
+ "update(int,int,int,int)",
+ "update(const QRect&)",
+ "repaint()",
+ "repaint(bool)",
+ "repaint(int,int,int,int,bool)",
+ "repaint(const QRect&,bool)",
+ "repaint(const QRegion&,bool)",
+ "show()",
+ "hide()",
+ "iconify()",
+ "showMinimized()",
+ "showMaximized()",
+ "showFullScreen()",
+ "showNormal()",
+ "polish()",
+ "constPolish()",
+ "raise()",
+ "lower()",
+ "stackUnder(QWidget*)",
+ "move(int,int)",
+ "move(const QPoint&)",
+ "resize(int,int)",
+ "resize(const QSize&)",
+ "setGeometry(int,int,int,int)",
+ "setGeometry(const QRect&)",
+ "focusProxyDestroyed()",
+ "showExtension(bool)",
+ "setUpLayout()",
+ "showDockMenu(const QPoint&)",
+ "init()",
+ "destroy()",
+ "deleteLater()",
+ 0
+};
+
+ConnectionItem::ConnectionItem( QTable *table, FormWindow *fw )
+ : QComboTableItem( table, QStringList(), FALSE ), formWindow( fw ), conn( 0 )
+{
+ setReplaceable( FALSE );
+}
+
+void ConnectionItem::senderChanged( QObject * )
+{
+ emit changed();
+ QWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::receiverChanged( QObject * )
+{
+ emit changed();
+ QWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::signalChanged( const QString & )
+{
+ emit changed();
+ QWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::slotChanged( const QString & )
+{
+ emit changed();
+ QWidget *w = table()->cellWidget( row(), col() );
+ if ( w )
+ setContentFromEditor( w );
+}
+
+void ConnectionItem::setSender( SenderItem *i )
+{
+ connect( i, SIGNAL( currentSenderChanged( QObject * ) ),
+ this, SLOT( senderChanged( QObject * ) ) );
+}
+
+void ConnectionItem::setReceiver( ReceiverItem *i )
+{
+ connect( i, SIGNAL( currentReceiverChanged( QObject * ) ),
+ this, SLOT( receiverChanged( QObject * ) ) );
+}
+
+void ConnectionItem::setSignal( SignalItem *i )
+{
+ connect( i, SIGNAL( currentSignalChanged( const QString & ) ),
+ this, SLOT( signalChanged( const QString & ) ) );
+}
+
+void ConnectionItem::setSlot( SlotItem *i )
+{
+ connect( i, SIGNAL( currentSlotChanged( const QString & ) ),
+ this, SLOT( slotChanged( const QString & ) ) );
+}
+
+void ConnectionItem::paint( QPainter *p, const QColorGroup &cg,
+ const QRect &cr, bool selected )
+{
+ p->fillRect( 0, 0, cr.width(), cr.height(),
+ selected ? cg.brush( QColorGroup::Highlight )
+ : cg.brush( QColorGroup::Base ) );
+
+ int w = cr.width();
+ int h = cr.height();
+
+ int x = 0;
+
+ if ( currentText()[0] == '<' )
+ p->setPen( QObject::red );
+ else if ( selected )
+ p->setPen( cg.highlightedText() );
+ else
+ p->setPen( cg.text() );
+
+ QFont f( p->font() );
+ QFont oldf( p->font() );
+ if ( conn && conn->isModified() ) {
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ p->drawText( x + 2, 0, w - x - 4, h, alignment(), currentText() );
+ p->setFont( oldf );
+}
+
+void ConnectionItem::setConnection( ConnectionContainer *c )
+{
+ conn = c;
+}
+
+// ------------------------------------------------------------------
+
+static void appendChildActions( QAction *action, QStringList &lst )
+{
+ QObjectListIt it( *action->children() );
+ while ( it.current() ) {
+ QObject *o = it.current();
+ ++it;
+ if ( !::qt_cast<QAction*>(o) )
+ continue;
+ lst << o->name();
+ if ( o->children() && ::qt_cast<QActionGroup*>(o) )
+ appendChildActions( (QAction*)o, lst );
+ }
+}
+
+static QStringList flatActions( const QPtrList<QAction> &l )
+{
+ QStringList lst;
+
+ QPtrListIterator<QAction> it( l );
+ while ( it.current() ) {
+ QAction *action = it.current();
+ lst << action->name();
+ if ( action->children() && ::qt_cast<QActionGroup*>(action) )
+ appendChildActions( action, lst );
+ ++it;
+ }
+
+ return lst;
+}
+
+// ------------------------------------------------------------------
+
+SenderItem::SenderItem( QTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ QStringList lst;
+
+ QPtrDictIterator<QWidget> it( *formWindow->widgets() );
+ while ( it.current() ) {
+ if ( lst.find( it.current()->name() ) != lst.end() ) {
+ ++it;
+ continue;
+ }
+ if ( !QString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ !::qt_cast<QLayoutWidget*>(it.current()) &&
+ !::qt_cast<Spacer*>(it.current()) &&
+ !::qt_cast<SizeHandle*>(it.current()) &&
+ qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
+ lst << it.current()->name();
+ }
+ ++it;
+ }
+
+ lst += flatActions( formWindow->actionList() );
+
+ lst.prepend( "<No Sender>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+QWidget *SenderItem::createEditor() const
+{
+ QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, SIGNAL( activated( const QString & ) ),
+ this, SLOT( senderChanged( const QString & ) ) );
+ return cb;
+}
+
+void SenderItem::setSenderEx( QObject *sender )
+{
+ setCurrentItem( sender->name() );
+ emit currentSenderChanged( sender );
+}
+
+void SenderItem::senderChanged( const QString &sender )
+{
+ QObject *o = formWindow->child( sender, "QObject" );
+ if ( !o )
+ o = formWindow->findAction( sender );
+ if ( !o )
+ return;
+ emit currentSenderChanged( o );
+}
+
+
+
+// ------------------------------------------------------------------
+
+ReceiverItem::ReceiverItem( QTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ QStringList lst;
+
+ QPtrDictIterator<QWidget> it( *formWindow->widgets() );
+ while ( it.current() ) {
+ if ( lst.find( it.current()->name() ) != lst.end() ) {
+ ++it;
+ continue;
+ }
+ if ( !QString( it.current()->name() ).startsWith( "qt_dead_widget_" ) &&
+ !::qt_cast<QLayoutWidget*>(it.current()) &&
+ !::qt_cast<Spacer*>(it.current()) &&
+ !::qt_cast<SizeHandle*>(it.current()) &&
+ qstrcmp( it.current()->name(), "central widget" ) != 0 ) {
+ lst << it.current()->name();
+ }
+ ++it;
+ }
+
+ lst += flatActions( formWindow->actionList() );
+
+ lst.prepend( "<No Receiver>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+QWidget *ReceiverItem::createEditor() const
+{
+ QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, SIGNAL( activated( const QString & ) ),
+ this, SLOT( receiverChanged( const QString & ) ) );
+ return cb;
+}
+
+void ReceiverItem::setReceiverEx( QObject *receiver )
+{
+ setCurrentItem( receiver->name() );
+ emit currentReceiverChanged( receiver );
+}
+
+void ReceiverItem::receiverChanged( const QString &receiver )
+{
+ QObject *o = formWindow->child( receiver, "QObject" );
+ if ( !o )
+ o = formWindow->findAction( receiver );
+ if ( !o )
+ return;
+ emit currentReceiverChanged( o );
+}
+
+
+
+// ------------------------------------------------------------------
+
+SignalItem::SignalItem( QTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ QStringList lst;
+ lst << "<No Signal>";
+ lst.sort();
+ setStringList( lst );
+}
+
+void SignalItem::senderChanged( QObject *sender )
+{
+ QStrList sigs = sender->metaObject()->signalNames( TRUE );
+ sigs.remove( "destroyed()" );
+ sigs.remove( "destroyed(QObject*)" );
+ sigs.remove( "accessibilityChanged(int)" );
+ sigs.remove( "accessibilityChanged(int,int)" );
+
+ QStringList lst = QStringList::fromStrList( sigs );
+
+ if ( ::qt_cast<CustomWidget*>(sender) ) {
+ MetaDataBase::CustomWidget *w = ( (CustomWidget*)sender )->customWidget();
+ for ( QValueList<QCString>::Iterator it = w->lstSignals.begin();
+ it != w->lstSignals.end(); ++it )
+ lst << MetaDataBase::normalizeFunction( *it );
+ }
+
+ if ( sender == formWindow->mainContainer() ) {
+ QStringList extra = MetaDataBase::signalList( formWindow );
+ if ( !extra.isEmpty() )
+ lst += extra;
+ }
+
+ lst.prepend( "<No Signal>" );
+
+ lst.sort();
+ setStringList( lst );
+
+ ConnectionItem::senderChanged( sender );
+}
+
+QWidget *SignalItem::createEditor() const
+{
+ QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, SIGNAL( activated( const QString & ) ),
+ this, SIGNAL( currentSignalChanged( const QString & ) ) );
+ return cb;
+}
+
+// ------------------------------------------------------------------
+
+SlotItem::SlotItem( QTable *table, FormWindow *fw )
+ : ConnectionItem( table, fw )
+{
+ QStringList lst;
+ lst << "<No Slot>";
+ lst.sort();
+ setStringList( lst );
+
+ lastReceiver = 0;
+ lastSignal = "<No Signal>";
+}
+
+void SlotItem::receiverChanged( QObject *receiver )
+{
+ lastReceiver = receiver;
+ updateSlotList();
+ ConnectionItem::receiverChanged( receiver );
+}
+
+void SlotItem::signalChanged( const QString &signal )
+{
+ lastSignal = signal;
+ updateSlotList();
+ ConnectionItem::signalChanged( signal );
+}
+
+bool SlotItem::ignoreSlot( const char* slot ) const
+{
+#ifndef QT_NO_SQL
+ if ( qstrcmp( slot, "update()" ) == 0 &&
+ ::qt_cast<QDataBrowser*>(lastReceiver) )
+ return FALSE;
+#endif
+
+ for ( int i = 0; ignore_slots[i]; i++ ) {
+ if ( qstrcmp( slot, ignore_slots[i] ) == 0 )
+ return TRUE;
+ }
+
+ if ( !formWindow->isMainContainer( (QWidget*)lastReceiver ) ) {
+ if ( qstrcmp( slot, "close()" ) == 0 )
+ return TRUE;
+ }
+
+ if ( qstrcmp( slot, "setFocus()" ) == 0 )
+ if ( lastReceiver->isWidgetType() &&
+ ( (QWidget*)lastReceiver )->focusPolicy() == QWidget::NoFocus )
+ return TRUE;
+
+ return FALSE;
+}
+
+void SlotItem::updateSlotList()
+{
+ QStringList lst;
+ if ( !lastReceiver || lastSignal == "<No Signal>" ) {
+ lst << "<No Slot>";
+ lst.sort();
+ setStringList( lst );
+ return;
+ }
+
+ QString signal = MetaDataBase::normalizeFunction( lastSignal );
+ int n = lastReceiver->metaObject()->numSlots( TRUE );
+ QStringList slts;
+
+ for( int i = 0; i < n; ++i ) {
+ // accept only public slots. For the form window, also accept protected slots
+ const QMetaData* md = lastReceiver->metaObject()->slot( i, TRUE );
+ if ( ( (lastReceiver->metaObject()->slot( i, TRUE )->access == QMetaData::Public) ||
+ (formWindow->isMainContainer( (QWidget*)lastReceiver ) &&
+ lastReceiver->metaObject()->slot(i, TRUE)->access ==
+ QMetaData::Protected) ) &&
+ !ignoreSlot( md->name ) &&
+ checkConnectArgs( signal.latin1(), lastReceiver, md->name ) )
+ if ( lst.find( md->name ) == lst.end() )
+ lst << MetaDataBase::normalizeFunction( md->name );
+ }
+
+ LanguageInterface *iface =
+ MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !iface || iface->supports( LanguageInterface::ConnectionsToCustomSlots ) ) {
+ if ( formWindow->isMainContainer( (QWidget*)lastReceiver ) ) {
+ QValueList<MetaDataBase::Function> moreSlots = MetaDataBase::slotList( formWindow );
+ if ( !moreSlots.isEmpty() ) {
+ for ( QValueList<MetaDataBase::Function>::Iterator it = moreSlots.begin();
+ it != moreSlots.end(); ++it ) {
+ QCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ s = MetaDataBase::normalizeFunction( s );
+ if ( checkConnectArgs( signal.latin1(), lastReceiver, s ) ) {
+ if ( lst.find( (*it).function ) == lst.end() )
+ lst << s;
+ }
+ }
+ }
+ }
+ }
+
+ if ( ::qt_cast<CustomWidget*>(lastReceiver) ) {
+ MetaDataBase::CustomWidget *w = ( (CustomWidget*)lastReceiver )->customWidget();
+ for ( QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin();
+ it != w->lstSlots.end(); ++it ) {
+ QCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ s = MetaDataBase::normalizeFunction( s );
+ if ( checkConnectArgs( signal.latin1(), lastReceiver, s ) ) {
+ if ( lst.find( (*it).function ) == lst.end() )
+ lst << s;
+ }
+ }
+ }
+
+ lst.prepend( "<No Slot>" );
+ lst.sort();
+ setStringList( lst );
+}
+
+QWidget *SlotItem::createEditor() const
+{
+ QComboBox *cb = (QComboBox*)ConnectionItem::createEditor();
+ cb->listBox()->setMinimumWidth( cb->fontMetrics().width( "01234567890123456789012345678901234567890123456789" ) );
+ connect( cb, SIGNAL( activated( const QString & ) ),
+ this, SIGNAL( currentSlotChanged( const QString & ) ) );
+ return cb;
+}
+
+void SlotItem::customSlotsChanged()
+{
+ QString currSlot = currentText();
+ updateSlotList();
+ setCurrentItem( "<No Slot>" );
+ setCurrentItem( currSlot );
+ emit currentSlotChanged( currentText() );
+}
diff --git a/kdevdesigner/designer/connectionitems.h b/kdevdesigner/designer/connectionitems.h
new file mode 100644
index 00000000..2442e475
--- /dev/null
+++ b/kdevdesigner/designer/connectionitems.h
@@ -0,0 +1,220 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef CONNECTIONITEMS_H
+#define CONNECTIONITEMS_H
+
+class FormWindow;
+
+#include <qtable.h>
+
+class SenderItem;
+class ReceiverItem;
+class SignalItem;
+class SlotItem;
+class ConnectionContainer;
+
+
+class ConnectionItem : public QObject,
+ public QComboTableItem
+{
+ Q_OBJECT
+
+public:
+ ConnectionItem( QTable *table, FormWindow *fw );
+
+ void paint( QPainter *p, const QColorGroup &cg,
+ const QRect &cr, bool selected );
+
+ void setSender( SenderItem *i );
+ void setReceiver( ReceiverItem *i );
+ void setSignal( SignalItem *i );
+ void setSlot( SlotItem *i );
+ void setConnection( ConnectionContainer *c );
+
+public slots:
+ virtual void senderChanged( QObject *sender );
+ virtual void receiverChanged( QObject *receiver );
+ virtual void signalChanged( const QString &sig );
+ virtual void slotChanged( const QString &slot );
+
+signals:
+ void changed();
+
+protected:
+ FormWindow *formWindow;
+
+private:
+ ConnectionContainer *conn;
+
+};
+
+// ------------------------------------------------------------------
+
+class SenderItem : public ConnectionItem
+{
+ Q_OBJECT
+
+public:
+ SenderItem( QTable *table, FormWindow *fw );
+ QWidget *createEditor() const;
+ void setSenderEx( QObject *sender );
+
+signals:
+ void currentSenderChanged( QObject *sender );
+
+private slots:
+ void senderChanged( const QString &sender );
+
+};
+
+// ------------------------------------------------------------------
+
+class ReceiverItem : public ConnectionItem
+{
+ Q_OBJECT
+
+public:
+ ReceiverItem( QTable *table, FormWindow *fw );
+ QWidget *createEditor() const;
+ void setReceiverEx( QObject *receiver );
+
+signals:
+ void currentReceiverChanged( QObject *receiver );
+
+private slots:
+ void receiverChanged( const QString &receiver );
+
+};
+
+// ------------------------------------------------------------------
+
+class SignalItem : public ConnectionItem
+{
+ Q_OBJECT
+
+public:
+ SignalItem( QTable *table, FormWindow *fw );
+
+ void senderChanged( QObject *sender );
+ QWidget *createEditor() const;
+
+signals:
+ void currentSignalChanged( const QString & );
+
+};
+
+// ------------------------------------------------------------------
+
+class SlotItem : public ConnectionItem
+{
+ Q_OBJECT
+
+public:
+ SlotItem( QTable *table, FormWindow *fw );
+
+ void receiverChanged( QObject *receiver );
+ void signalChanged( const QString &signal );
+ QWidget *createEditor() const;
+
+ void customSlotsChanged();
+
+signals:
+ void currentSlotChanged( const QString & );
+
+private:
+ void updateSlotList();
+ bool ignoreSlot( const char* slot ) const;
+
+private:
+ QObject *lastReceiver;
+ QString lastSignal;
+
+};
+
+// ------------------------------------------------------------------
+
+class ConnectionContainer : public QObject
+{
+ Q_OBJECT
+
+public:
+ ConnectionContainer( QObject *parent, SenderItem *i1, SignalItem *i2,
+ ReceiverItem *i3, SlotItem *i4, int r )
+ : QObject( parent ), mod( FALSE ), se( i1 ), si( i2 ),
+ re( i3 ), sl( i4 ), rw ( r ) {
+ i1->setConnection( this );
+ i2->setConnection( this );
+ i3->setConnection( this );
+ i4->setConnection( this );
+ connect( i1, SIGNAL( changed() ), this, SLOT( somethingChanged() ) );
+ connect( i2, SIGNAL( changed() ), this, SLOT( somethingChanged() ) );
+ connect( i3, SIGNAL( changed() ), this, SLOT( somethingChanged() ) );
+ connect( i4, SIGNAL( changed() ), this, SLOT( somethingChanged() ) );
+ }
+
+ bool isModified() const { return mod; }
+ void setModified( bool b ) { mod = b; repaint(); }
+ bool isValid() const {
+ return se->currentText()[0] != '<' &&
+ si->currentText()[0] != '<' &&
+ re->currentText()[0] != '<' &&
+ sl->currentText()[0] != '<';
+ }
+
+ void repaint() {
+ se->table()->updateCell( se->row(), se->col() );
+ si->table()->updateCell( si->row(), si->col() );
+ re->table()->updateCell( re->row(), re->col() );
+ sl->table()->updateCell( sl->row(), sl->col() );
+ }
+
+ int row() const { return rw; }
+ void setRow( int r ) { rw = r; }
+
+ SenderItem *senderItem() const { return se; }
+ SignalItem *signalItem() const { return si; }
+ ReceiverItem *receiverItem() const { return re; }
+ SlotItem *slotItem() const { return sl; }
+
+public slots:
+ void somethingChanged() { mod = TRUE; emit changed( this ); }
+
+signals:
+ void changed( ConnectionContainer *c );
+
+private:
+ bool mod;
+ SenderItem *se;
+ SignalItem *si;
+ ReceiverItem *re;
+ SlotItem *sl;
+ int rw;
+
+};
+
+
+#endif
diff --git a/kdevdesigner/designer/connectiontable.cpp b/kdevdesigner/designer/connectiontable.cpp
new file mode 100644
index 00000000..7fed1b07
--- /dev/null
+++ b/kdevdesigner/designer/connectiontable.cpp
@@ -0,0 +1,56 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "connectiontable.h"
+
+#include <klocale.h>
+
+ConnectionTable::ConnectionTable( QWidget *parent, const char *name )
+ : QTable( 0, 4, parent, name )
+{
+ setSorting( TRUE );
+ setShowGrid( FALSE );
+ setFocusStyle( FollowStyle );
+ setSelectionMode( SingleRow );
+ horizontalHeader()->setLabel( 0, i18n( "Sender" ) );
+ horizontalHeader()->setLabel( 1, i18n( "Signal" ) );
+ horizontalHeader()->setLabel( 2, i18n( "Receiver" ) );
+ horizontalHeader()->setLabel( 3, i18n( "Slot" ) );
+ setColumnStretchable( 0, TRUE );
+ setColumnStretchable( 1, TRUE );
+ setColumnStretchable( 2, TRUE );
+ setColumnStretchable( 3, TRUE );
+}
+
+void ConnectionTable::sortColumn( int col, bool ascending, bool )
+{
+ horizontalHeader()->setSortIndicator( col, ascending );
+ if ( isEditing() )
+ endEdit( currEditRow(), currEditCol(), FALSE, FALSE );
+ QTable::sortColumn( col, ascending, TRUE );
+ setCurrentCell( 0, 0 );
+ emit resorted();
+}
diff --git a/kdevdesigner/designer/connectiontable.h b/kdevdesigner/designer/connectiontable.h
new file mode 100644
index 00000000..288b544f
--- /dev/null
+++ b/kdevdesigner/designer/connectiontable.h
@@ -0,0 +1,46 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef CONNECTIONTABLE_H
+#define CONNECTIONTABLE_H
+
+#include <qtable.h>
+
+class ConnectionTable : public QTable
+{
+ Q_OBJECT
+
+public:
+ ConnectionTable( QWidget *parent, const char *name );
+
+ void sortColumn( int col, bool ascending, bool wholeRows );
+
+signals:
+ void resorted();
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/createtemplate.ui b/kdevdesigner/designer/createtemplate.ui
new file mode 100644
index 00000000..761873cc
--- /dev/null
+++ b/kdevdesigner/designer/createtemplate.ui
@@ -0,0 +1,195 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CreateTemplate</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CreateTemplate</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>347</width>
+ <height>248</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create Template</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Template &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editName</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Name of the new template</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the name of the new template</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>listClass</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Class of the new template</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the name of the class which should be used as the template's base class</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCreate</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;reate</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Creates the new template</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Closes the Dialog</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Baseclass for template:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listClass</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCreate</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateTemplate</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateTemplate</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kdevdesigner/designer/customwidgeteditor.ui b/kdevdesigner/designer/customwidgeteditor.ui
new file mode 100644
index 00000000..4d0e301a
--- /dev/null
+++ b/kdevdesigner/designer/customwidgeteditor.ui
@@ -0,0 +1,1378 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CustomWidgetEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CustomWidgetEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>712</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Custom Widgets</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Custom Widgets&lt;/b&gt;&lt;p&gt;Add or delete custom widgets from &lt;i&gt;Qt Designer&lt;/i&gt;'s database, and edit the properties of existing widgets.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>boxWidgets</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all custom widgets known to Qt Designer.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewWidget</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new custom widget.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create an empty custom widget and add it to the list.&lt;/b&gt;&lt;p&gt;New custom widgets have a default name and header file, which must both be changed to appropriate values.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteWidget</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete custom widget</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected custom widget.&lt;/b&gt;&lt;p&gt;You can only delete widgets that are not used in any open form.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Closes the Dialog.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</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>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>buttonLoad</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Load Descriptions...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Loads widget description file</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Load Descriptions&lt;/b&gt;&lt;p&gt;Loads a file which contains descriptions of custom widgets, so that these custom widgets can be used in the Qt Designer.&lt;/p&gt;
+&lt;p&gt;Since it is a lot of work to type in all the information for custom widgets, you should consider using the createcw tool which is in $QTDIR/tools/designer/tools/createcw. Using createcw you can create custom widget description files for your custom widgets without the need to type in all the information manually. For more information about the README file in the createcw directory&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonSave</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Save Descriptions...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Saves widget description file</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Save Descriptions&lt;/b&gt;&lt;p&gt;Saves all the descriptions of the shown custom widgets to a file which can then be used to import the custom widgets elsewhere.</string>
+ </property>
+ </widget>
+ <widget class="QTabWidget" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>TabWidget1</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the properties of the selected custom widget.</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget2</cstring>
+ </property>
+ <attribute name="title">
+ <string>De&amp;finition</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>previewPixmap</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonChoosePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file.&lt;/b&gt;&lt;p&gt;The pixmap will be used to represent the widget in forms.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>editHeader</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter filename</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the header file's name for the selected custom widget.&lt;/b&gt;&lt;p&gt;The header file will be included by forms using the widget.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonChooseHeader</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose headerfile</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Look for the header file using a file dialog.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Global</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Local</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>localGlobalCombo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change how the include file will be included.&lt;/b&gt;&lt;p&gt;Global include files will be included using &amp;lt;&amp;gt;-brackets, while local files will included using quotation marks.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>editClass</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change classname</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the classname for the selected custom widget.&lt;/b&gt;&lt;p&gt;A class of that name must be defined in the header file.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label11</cstring>
+ </property>
+ <property name="text">
+ <string>Heade&amp;rfile:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editHeader</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label10</cstring>
+ </property>
+ <property name="text">
+ <string>Cl&amp;ass:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editClass</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>Label7</cstring>
+ </property>
+ <property name="text">
+ <string>Si&amp;ze hint:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinWidth</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Size p&amp;olicy:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>sizeHor</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="4" column="2">
+ <item>
+ <property name="text">
+ <string>Fixed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Preferred</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>MinimumExpanding</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Expanding</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>sizeVer</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Vertical Sizepolicy</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the Vertical size policy</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="1">
+ <property name="name">
+ <cstring>spinWidth</cstring>
+ </property>
+ <property name="maxValue">
+ <number>32767</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Size hint width</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Set the size hint for the selected widget.&lt;/b&gt;&lt;p&gt;The size hint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="2">
+ <property name="name">
+ <cstring>spinHeight</cstring>
+ </property>
+ <property name="maxValue">
+ <number>32767</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Size hint height</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Set the size hint for the selected widget.&lt;/b&gt;&lt;p&gt;The size hint provides the recommended size for the widget. Enter a sizehint of -1/-1 if no size is recommended.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="4" column="1">
+ <item>
+ <property name="text">
+ <string>Fixed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Minimum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Maximum</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Preferred</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>MinimumExpanding</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Expanding</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>sizeHor</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Horizontal Sizepolicy</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the horizontal size policy for the widget</string>
+ </property>
+ </widget>
+ <spacer row="6" column="2">
+ <property name="name">
+ <cstring>Spacer1</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>
+ <widget class="QCheckBox" row="5" column="1">
+ <property name="name">
+ <cstring>checkContainer</cstring>
+ </property>
+ <property name="text">
+ <string>Con&amp;tainer widget</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Container Widget</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;p&gt;&lt;b&gt;Container Widget&lt;/b&gt;&lt;/p&gt;
+&lt;p&gt;If this custom widget is able to contain other widgets (children), check this checkbox.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget3</cstring>
+ </property>
+ <attribute name="title">
+ <string>Si&amp;gnals</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>listSignals</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all the signals that the selected widget can emit.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout40</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonAddSignal</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Signal</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new signal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new signal for the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonRemoveSignal</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Signal</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete signal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the signal.&lt;/b&gt;&lt;p&gt;All connections using this signal will also be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout38</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;ignal:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSignal</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>editSignal</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change signal name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget4</cstring>
+ </property>
+ <attribute name="title">
+ <string>S&amp;lots</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Slot</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listSlots</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of all the custom widget's slots.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Sl&amp;ot:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSlot</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editSlot</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change slot name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected slot.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Access:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboAccess</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboAccess</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change slot access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the slot's access policy.&lt;/b&gt;&lt;p&gt;You can only connect to the widget's public slots.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonAddSlot</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Slot</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new slot</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new slot to the current custom widget.&lt;/b&gt;&lt;p&gt;An argument list should be provided in the signal's name, and the name must be unique.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonRemoveSlot</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Slot</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete slot</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the slot.&lt;/b&gt;&lt;p&gt;All connections using this slot will also be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget5</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Properties</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Layout7_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonAddProperty</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ew Property</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new property</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new property to the current custom widget.&lt;/b&gt;&lt;p&gt;The properties must be implemented in the class using Qt's property system.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonRemoveProperty</cstring>
+ </property>
+ <property name="text">
+ <string>Dele&amp;te Property</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete property</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Deletes the selected property.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>String</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>CString</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>StringList</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Bool</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Int</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>UInt</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Font</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Color</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Rect</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Point</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Size</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Pixmap</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Cursor</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>SizePolicy</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboType</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select property type</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select the type of the property.&lt;/b&gt;&lt;p&gt;The property must be implemented in the class using Qt's property system.&lt;/p&gt;&lt;p&gt;You can use integer types to support enumeration properties in the property editor.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Property</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listProperties</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;The list of the current widget's properties.&lt;/b&gt;&lt;p&gt;The properties of the custom widget can be changed in the property editor.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editProperty</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change property name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter a name for the property.&lt;/b&gt;&lt;p&gt;The properties must be implemented in the class using Qt's property system.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;roperty name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editProperty</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="2">
+ <property name="name">
+ <cstring>TextLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>T&amp;ype:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboType</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>boxWidgets</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentWidgetChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>boxWidgets</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentWidgetChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewWidget</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addWidgetClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteWidget</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>deleteWidgetClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editClass</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>classNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>editHeader</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>headerFileChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>spinWidth</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>widthChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>spinHeight</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>heightChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>pixmapChoosen()</slot>
+ </connection>
+ <connection>
+ <sender>localGlobalCombo</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>includePolicyChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseHeader</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>chooseHeader()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>closeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listSignals</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSignalChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listSignals</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSignalChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveSignal</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeSignal()</slot>
+ </connection>
+ <connection>
+ <sender>editSignal</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>signalNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listSlots</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSlotChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listSlots</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentSlotChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveSlot</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeSlot()</slot>
+ </connection>
+ <connection>
+ <sender>editSlot</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>slotNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>comboAccess</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>slotAccessChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listProperties</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentPropertyChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listProperties</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>currentPropertyChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveProperty</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>removeProperty()</slot>
+ </connection>
+ <connection>
+ <sender>editProperty</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>propertyNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>comboType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>propertyTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonLoad</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>loadDescription()</slot>
+ </connection>
+ <connection>
+ <sender>buttonSave</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>saveDescription()</slot>
+ </connection>
+ <connection>
+ <sender>sizeHor</sender>
+ <signal>activated(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>horDataChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>sizeVer</sender>
+ <signal>activated(int)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>verDataChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddProperty</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addProperty()</slot>
+ </connection>
+ <connection>
+ <sender>checkContainer</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>widgetIsContainer(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddSignal</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addSignal()</slot>
+ </connection>
+ <connection>
+ <sender>buttonAddSlot</sender>
+ <signal>clicked()</signal>
+ <receiver>CustomWidgetEditorBase</receiver>
+ <slot>addSlot()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">addProperty()</slot>
+ <slot access="public" language="C++" returnType="void">addSignal()</slot>
+ <slot access="protected" language="C++" returnType="void">addWidgetClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">chooseHeader()</slot>
+ <slot access="protected" language="C++" returnType="void">classNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">closeClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">currentPropertyChanged( QListViewItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentSignalChanged( QListBoxItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentSlotChanged( QListViewItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">currentWidgetChanged( QListBoxItem * )</slot>
+ <slot access="protected" language="C++" returnType="void">deleteWidgetClicked()</slot>
+ <slot access="protected" language="C++" returnType="void">headerFileChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">heightChanged( int )</slot>
+ <slot access="protected" language="C++" returnType="void">horDataChanged(int)</slot>
+ <slot access="protected" language="C++" returnType="void">includePolicyChanged( int )</slot>
+ <slot access="public" language="C++" returnType="void">loadDescription()</slot>
+ <slot access="public" language="C++" returnType="void">addSlot()</slot>
+ <slot access="protected" language="C++" returnType="void">pixmapChoosen()</slot>
+ <slot access="protected" language="C++" returnType="void">propertyNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">propertyTypeChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">removeProperty()</slot>
+ <slot access="protected" language="C++" returnType="void">removeSignal()</slot>
+ <slot access="protected" language="C++" returnType="void">removeSlot()</slot>
+ <slot access="protected" language="C++" returnType="void">saveDescription()</slot>
+ <slot access="protected" language="C++" returnType="void">signalNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">slotAccessChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">slotNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">verDataChanged(int)</slot>
+ <slot access="protected" language="C++" returnType="void">widgetIsContainer(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">widthChanged( int )</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>boxWidgets</tabstop>
+ <tabstop>buttonNewWidget</tabstop>
+ <tabstop>buttonDeleteWidget</tabstop>
+ <tabstop>buttonLoad</tabstop>
+ <tabstop>buttonSave</tabstop>
+ <tabstop>TabWidget1</tabstop>
+ <tabstop>editClass</tabstop>
+ <tabstop>editHeader</tabstop>
+ <tabstop>buttonChooseHeader</tabstop>
+ <tabstop>localGlobalCombo</tabstop>
+ <tabstop>buttonChoosePixmap</tabstop>
+ <tabstop>spinWidth</tabstop>
+ <tabstop>spinHeight</tabstop>
+ <tabstop>sizeHor</tabstop>
+ <tabstop>sizeVer</tabstop>
+ <tabstop>checkContainer</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>listSignals</tabstop>
+ <tabstop>buttonAddSignal</tabstop>
+ <tabstop>buttonRemoveSignal</tabstop>
+ <tabstop>editSignal</tabstop>
+ <tabstop>listSlots</tabstop>
+ <tabstop>buttonAddSlot</tabstop>
+ <tabstop>buttonRemoveSlot</tabstop>
+ <tabstop>editSlot</tabstop>
+ <tabstop>comboAccess</tabstop>
+ <tabstop>listProperties</tabstop>
+ <tabstop>buttonAddProperty</tabstop>
+ <tabstop>buttonRemoveProperty</tabstop>
+ <tabstop>editProperty</tabstop>
+ <tabstop>comboType</tabstop>
+</tabstops>
+</UI>
diff --git a/kdevdesigner/designer/customwidgeteditorimpl.cpp b/kdevdesigner/designer/customwidgeteditorimpl.cpp
new file mode 100644
index 00000000..dc0ed1a8
--- /dev/null
+++ b/kdevdesigner/designer/customwidgeteditorimpl.cpp
@@ -0,0 +1,842 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "customwidgeteditorimpl.h"
+#include "defs.h"
+#include "pixmapchooser.h"
+#include "mainwindow.h"
+#include "asciivalidator.h"
+#include "resource.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+
+#include <kfiledialog.h>
+#include <klineedit.h>
+
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qlabel.h>
+#include <qmessagebox.h>
+#include <qfiledialog.h>
+#include <qmessagebox.h>
+#include <qtimer.h>
+#include <qapplication.h>
+#include <qlistview.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qdom.h>
+#include <qtextcodec.h>
+#include <qcheckbox.h>
+
+#include <klocale.h>
+
+CustomWidgetEditor::CustomWidgetEditor( QWidget *parent, MainWindow *mw )
+ : CustomWidgetEditorBase( parent, 0, TRUE ), mainWindow( mw )
+{
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ checkTimer = new QTimer( this );
+ connect( checkTimer, SIGNAL( timeout() ),
+ this, SLOT( checkWidgetName() ) );
+
+ editClass->setEnabled( FALSE );
+ editHeader->setEnabled( FALSE );
+ buttonChooseHeader->setEnabled( FALSE );
+ buttonChoosePixmap->setEnabled( FALSE );
+ spinWidth->setEnabled( FALSE );
+ spinHeight->setEnabled( FALSE );
+ sizeHor->setEnabled( FALSE );
+ sizeVer->setEnabled( FALSE );
+ checkContainer->setEnabled( FALSE );
+ localGlobalCombo->setEnabled( FALSE );
+ editClass->setValidator( new AsciiValidator( QString(":"), editClass ) );
+ editSignal->setValidator( new AsciiValidator( TRUE, editSignal ) );
+ editSlot->setValidator( new AsciiValidator( TRUE, editSignal ) );
+ editProperty->setValidator( new AsciiValidator( editSignal ) );
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+
+ setupDefinition();
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::setupDefinition()
+{
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ QListBoxItem *i;
+ if ( w->pixmap )
+ i = new QListBoxPixmap( boxWidgets, *w->pixmap, w->className );
+ else
+ i = new QListBoxText( boxWidgets, w->className );
+ customWidgets.insert( i, w );
+ }
+
+ if ( boxWidgets->firstItem() ) {
+ boxWidgets->setCurrentItem( boxWidgets->firstItem() );
+ boxWidgets->setSelected( boxWidgets->firstItem(), TRUE );
+ }
+ oldItem = 0;
+}
+
+void CustomWidgetEditor::setupSignals()
+{
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listSignals->clear();
+ for ( QValueList<QCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ listSignals->insertItem( QString( *it ) );
+ if ( listSignals->firstItem() ) {
+ listSignals->setCurrentItem( listSignals->firstItem() );
+ listSignals->setSelected( listSignals->firstItem(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::setupSlots()
+{
+ editSlot->setEnabled( FALSE );
+ comboAccess->setEnabled( FALSE );
+ buttonRemoveSlot->setEnabled( FALSE );
+
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listSlots->clear();
+ for ( QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ (void)new QListViewItem( listSlots, (*it).function, (*it).access );
+
+ if ( listSlots->firstChild() ) {
+ listSlots->setCurrentItem( listSlots->firstChild() );
+ listSlots->setSelected( listSlots->firstChild(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::setupProperties()
+{
+ editProperty->setEnabled( FALSE );
+ comboType->setEnabled( FALSE );
+ buttonRemoveProperty->setEnabled( FALSE );
+
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w )
+ return;
+ listProperties->clear();
+ for ( QValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ (void)new QListViewItem( listProperties, (*it).property, (*it).type );
+
+ if ( listProperties->firstChild() ) {
+ listProperties->setCurrentItem( listProperties->firstChild() );
+ listProperties->setSelected( listProperties->firstChild(), TRUE );
+ }
+}
+
+void CustomWidgetEditor::currentWidgetChanged( QListBoxItem *i )
+{
+ checkTimer->stop();
+ checkWidgetName();
+
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w ) {
+ buttonChooseHeader->setEnabled( FALSE );
+ editClass->setEnabled( FALSE );
+ editHeader->setEnabled( FALSE );
+ buttonChoosePixmap->setEnabled( FALSE );
+ spinWidth->setEnabled( FALSE );
+ spinHeight->setEnabled( FALSE );
+ localGlobalCombo->setEnabled( FALSE );
+ sizeHor->setEnabled( FALSE );
+ sizeVer->setEnabled( FALSE );
+ checkContainer->setEnabled( FALSE );
+ return;
+ }
+
+ buttonChooseHeader->setEnabled( TRUE );
+ editClass->setEnabled( TRUE );
+ editHeader->setEnabled( TRUE );
+ buttonChoosePixmap->setEnabled( TRUE );
+ spinWidth->setEnabled( TRUE );
+ spinHeight->setEnabled( TRUE );
+ localGlobalCombo->setEnabled( TRUE );
+ sizeHor->setEnabled( TRUE );
+ sizeVer->setEnabled( TRUE );
+ checkContainer->setEnabled( TRUE );
+
+ editClass->blockSignals( TRUE );
+ editClass->setText( w->className );
+ editClass->blockSignals( FALSE );
+ editHeader->setText( w->includeFile );
+ localGlobalCombo->setCurrentItem( (int)w->includePolicy );
+ if ( w->pixmap )
+ previewPixmap->setPixmap( *w->pixmap );
+ else
+ previewPixmap->setText( "" );
+ spinWidth->setValue( w->sizeHint.width() );
+ spinHeight->setValue( w->sizeHint.height() );
+ sizeHor->setCurrentItem( size_type_to_int( w->sizePolicy.horData() ) );
+ sizeVer->setCurrentItem( size_type_to_int( w->sizePolicy.verData() ) );
+ checkContainer->setChecked( w->isContainer );
+
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::addWidgetClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ QString s = w->className;
+ if ( !MetaDataBase::addCustomWidget( w ) ) {
+ QMessageBox::information( this, i18n( "Adding Custom Widget" ),
+ i18n( "Custom widget names must be unique.\n"
+ "A custom widget called '%1' already exists, so it is not possible "
+ "to add another widget with this name." ).arg( s ) );
+ return;
+ }
+
+ QListBoxPixmap *i = new QListBoxPixmap( boxWidgets, *w->pixmap, w->className );
+ customWidgets.insert( i, w );
+
+ boxWidgets->setCurrentItem( i );
+ boxWidgets->setSelected( i, TRUE );
+}
+
+void CustomWidgetEditor::classNameChanged( const QString &s )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ WidgetDatabase::customWidgetClassNameChanged( w->className, s );
+
+ checkTimer->stop();
+ boxWidgets->blockSignals( TRUE );
+ oldName = w->className;
+ w->className = s;
+ QListBoxItem *old = i;
+ if ( w->pixmap )
+ boxWidgets->changeItem( *w->pixmap, s, boxWidgets->currentItem() );
+ else
+ boxWidgets->changeItem( s, boxWidgets->currentItem() );
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ oldItem = i;
+ customWidgets.insert( i, w );
+ customWidgets.remove( old );
+ boxWidgets->blockSignals( FALSE );
+ checkTimer->start( 1000, TRUE );
+}
+
+void CustomWidgetEditor::deleteWidgetClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+
+ if ( mainWindow->isCustomWidgetUsed( w ) ) {
+ QMessageBox::information( mainWindow, i18n( "Removing Custom Widget" ),
+ i18n( "The custom widget '%1' is in use, so it cannot be removed." ).
+ arg( w->className ) );
+ return;
+ }
+
+ if ( !i || !w )
+ return;
+
+ MetaDataBase::CustomWidget *cw = MetaDataBase::customWidget( mainWindow->currentTool() );
+ if ( cw == w )
+ mainWindow->resetTool();
+
+ MetaDataBase::removeCustomWidget( w );
+ customWidgets.remove( i );
+ delete i;
+
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ if ( i ) {
+ boxWidgets->setCurrentItem( i );
+ boxWidgets->setSelected( i, TRUE );
+ }
+}
+
+void CustomWidgetEditor::headerFileChanged( const QString &s )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->includeFile = s;
+}
+
+void CustomWidgetEditor::heightChanged( int h )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->sizeHint.setHeight( h );
+ updateCustomWidgetSizes();
+}
+
+void CustomWidgetEditor::includePolicyChanged( int p )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->includePolicy = (MetaDataBase::CustomWidget::IncludePolicy)p;
+}
+
+void CustomWidgetEditor::pixmapChoosen()
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ QPixmap pix = qChoosePixmap( this );
+ if ( pix.isNull() )
+ return;
+ delete w->pixmap;
+ w->pixmap = new QPixmap( pix );
+
+ boxWidgets->blockSignals( TRUE );
+ QListBoxItem *old = i;
+ boxWidgets->changeItem( *w->pixmap, w->className, boxWidgets->currentItem() );
+ i = boxWidgets->item( boxWidgets->currentItem() );
+ customWidgets.insert( i, w );
+ customWidgets.remove( old );
+ boxWidgets->blockSignals( FALSE );
+ previewPixmap->setPixmap( *w->pixmap );
+}
+
+void CustomWidgetEditor::widthChanged( int wid )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->sizeHint.setWidth( wid );
+ updateCustomWidgetSizes();
+}
+
+MetaDataBase::CustomWidget *CustomWidgetEditor::findWidget( QListBoxItem *i )
+{
+ if ( !i )
+ return 0;
+
+ QMap<QListBoxItem*, MetaDataBase::CustomWidget*>::Iterator it = customWidgets.find( i );
+ if ( it == customWidgets.end() )
+ return 0;
+ return *it;
+}
+
+void CustomWidgetEditor::chooseHeader()
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ QString h = KFileDialog::getOpenFileName( QString::null, i18n( "*.h *.h++ *.hxx *.hh|Header Files" ), this );
+ if ( h.isEmpty() )
+ return;
+ editHeader->setText( h );
+ localGlobalCombo->setCurrentItem( (int)MetaDataBase::CustomWidget::Global );
+}
+
+void CustomWidgetEditor::checkWidgetName()
+{
+ QListBoxItem *i = oldItem ? oldItem : boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ oldItem = 0;
+ if ( !i || !w )
+ return;
+
+ if ( MetaDataBase::isWidgetNameUsed( w ) ) {
+ QString s = w->className;
+ w->className = oldName;
+ QMessageBox::information( this, i18n( "Renaming Custom Widget" ),
+ i18n( "Custom widget names must be unique.\n"
+ "A custom widget called '%1' already exists, so it is not possible "
+ "to rename this widget with this name." ).arg( s ) );
+ if ( i != boxWidgets->item( boxWidgets->currentItem() ) ) {
+ boxWidgets->setCurrentItem( i );
+ qApp->processEvents();
+ }
+ editClass->setText( w->className );
+ classNameChanged( w->className );
+ }
+}
+
+void CustomWidgetEditor::closeClicked()
+{
+ oldItem = 0;
+ checkTimer->stop();
+ checkWidgetName();
+ accept();
+}
+
+void CustomWidgetEditor::currentSignalChanged( QListBoxItem *i )
+{
+ editSignal->blockSignals( TRUE );
+ editSignal->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editSignal->setEnabled( FALSE );
+ buttonRemoveSignal->setEnabled( FALSE );
+ return;
+ }
+
+ editSignal->blockSignals( TRUE );
+ editSignal->setEnabled( TRUE );
+ buttonRemoveSignal->setEnabled( TRUE );
+ editSignal->setText( i->text() );
+ editSignal->blockSignals( FALSE );
+}
+
+void CustomWidgetEditor::addSignal()
+{
+ QListBoxItem *i = new QListBoxText( listSignals, "signal()" );
+ listSignals->setCurrentItem( i );
+ listSignals->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w )
+ w->lstSignals.append( i->text().latin1() );
+}
+
+void CustomWidgetEditor::removeSignal()
+{
+ QString s = listSignals->currentText();
+ delete listSignals->item( listSignals->currentItem() );
+ if ( listSignals->currentItem() != -1 )
+ listSignals->setSelected( listSignals->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w )
+ w->lstSignals.remove( s.latin1() );
+}
+
+void CustomWidgetEditor::signalNameChanged( const QString &s )
+{
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || listSignals->currentItem() == -1 )
+ return;
+
+ QValueList<QCString>::Iterator it = w->lstSignals.find( listSignals->currentText().latin1() );
+ if ( it != w->lstSignals.end() )
+ w->lstSignals.remove( it );
+ listSignals->blockSignals( TRUE );
+ listSignals->changeItem( s, listSignals->currentItem() );
+ listSignals->blockSignals( FALSE );
+ w->lstSignals.append( s.latin1() );
+}
+
+void CustomWidgetEditor::slotAccessChanged( const QString &s )
+{
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listSlots->currentItem() )
+ return;
+
+ MetaDataBase::Function slot;
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.find( slot );
+ if ( it != w->lstSlots.end() )
+ w->lstSlots.remove( it );
+ listSlots->currentItem()->setText( 1, s );
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ w->lstSlots.append( slot );
+}
+
+void CustomWidgetEditor::slotNameChanged( const QString &s )
+{
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listSlots->currentItem() )
+ return;
+
+ MetaDataBase::Function slot;
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ slot.type = "slot";
+ QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.find( slot );
+ if ( it != w->lstSlots.end() )
+ w->lstSlots.remove( it );
+ listSlots->currentItem()->setText( 0, s );
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ w->lstSlots.append( slot );
+}
+
+void CustomWidgetEditor::addSlot()
+{
+ QListViewItem *i = new QListViewItem( listSlots, "slot()", "public" );
+ listSlots->setCurrentItem( i );
+ listSlots->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w ) {
+ MetaDataBase::Function slot;
+ slot.function = "slot()";
+ slot.access = "public";
+ slot.type = "slot";
+ w->lstSlots.append( slot );
+ }
+}
+
+void CustomWidgetEditor::removeSlot()
+{
+ MetaDataBase::Function slot;
+ slot.function = "1 2 3";
+ if ( listSlots->currentItem() ) {
+ slot.function = listSlots->currentItem()->text( 0 );
+ slot.access = listSlots->currentItem()->text( 1 );
+ }
+ delete listSlots->currentItem();
+ if ( listSlots->currentItem() )
+ listSlots->setSelected( listSlots->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w && slot.function != "1 2 3" )
+ w->lstSlots.remove( slot );
+}
+
+void CustomWidgetEditor::currentSlotChanged( QListViewItem *i )
+{
+ editSlot->blockSignals( TRUE );
+ editSlot->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editSlot->setEnabled( FALSE );
+ comboAccess->setEnabled( FALSE );
+ buttonRemoveSlot->setEnabled( FALSE );
+ return;
+ }
+
+ editSlot->setEnabled( TRUE );
+ comboAccess->setEnabled( TRUE );
+ buttonRemoveSlot->setEnabled( TRUE );
+ editSlot->blockSignals( TRUE );
+ comboAccess->blockSignals( TRUE );
+ editSlot->setText( i->text( 0 ) );
+ if ( i->text( 1 ) == i18n( "protected" ) )
+ comboAccess->setCurrentItem( 1 );
+ else
+ comboAccess->setCurrentItem( 0 );
+ editSlot->blockSignals( FALSE );
+ comboAccess->blockSignals( FALSE );
+}
+
+void CustomWidgetEditor::propertyTypeChanged( const QString &s )
+{
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listProperties->currentItem() )
+ return;
+
+ MetaDataBase::Property property;
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ QValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.find( property );
+ if ( it != w->lstProperties.end() )
+ w->lstProperties.remove( it );
+ listProperties->currentItem()->setText( 1, s );
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ w->lstProperties.append( property );
+}
+
+void CustomWidgetEditor::propertyNameChanged( const QString &s )
+{
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( !w || !listProperties->currentItem() )
+ return;
+
+ MetaDataBase::Property property;
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ QValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.find( property );
+ if ( it != w->lstProperties.end() )
+ w->lstProperties.remove( it );
+ listProperties->currentItem()->setText( 0, s );
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ w->lstProperties.append( property );
+}
+
+void CustomWidgetEditor::addProperty()
+{
+ QListViewItem *i = new QListViewItem( listProperties, "property", "String" );
+ listProperties->setCurrentItem( i );
+ listProperties->setSelected( i, TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w ) {
+ MetaDataBase::Property prop;
+ prop.property = "property";
+ prop.type = "String";
+ w->lstProperties.append( prop );
+ }
+}
+
+void CustomWidgetEditor::removeProperty()
+{
+ MetaDataBase::Property property;
+ property.property = "1 2 3";
+ if ( listProperties->currentItem() ) {
+ property.property = listProperties->currentItem()->text( 0 );
+ property.type = listProperties->currentItem()->text( 1 );
+ }
+ delete listProperties->currentItem();
+ if ( listProperties->currentItem() )
+ listProperties->setSelected( listProperties->currentItem(), TRUE );
+ MetaDataBase::CustomWidget *w = findWidget( boxWidgets->item( boxWidgets->currentItem() ) );
+ if ( w && property.property != "1 2 3" )
+ w->lstProperties.remove( property );
+}
+
+void CustomWidgetEditor::currentPropertyChanged( QListViewItem *i )
+{
+ editProperty->blockSignals( TRUE );
+ editProperty->setText( "" );
+ editSignal->blockSignals( FALSE );
+
+ if ( !i ) {
+ editProperty->setEnabled( FALSE );
+ comboType->setEnabled( FALSE );
+ buttonRemoveProperty->setEnabled( FALSE );
+ return;
+ }
+
+ editProperty->setEnabled( TRUE );
+ comboType->setEnabled( TRUE );
+ buttonRemoveProperty->setEnabled( TRUE );
+ editProperty->blockSignals( TRUE );
+ comboType->blockSignals( TRUE );
+ editProperty->setText( i->text( 0 ) );
+
+ for ( int j = 0; j < comboType->count(); ++j ) {
+ if ( i->text( 1 ) == comboType->text( j ) ) {
+ comboType->setCurrentItem( j );
+ break;
+ }
+ }
+ editProperty->blockSignals( FALSE );
+ comboType->blockSignals( FALSE );
+}
+
+static QString makeIndent2( int indent )
+{
+ QString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+
+static QString entitize2( const QString &s )
+{
+ QString s2 = s;
+ s2 = s2.replace( "\"", "&quot;" );
+ s2 = s2.replace( "&", "&amp;" );
+ s2 = s2.replace( ">", "&gt;" );
+ s2 = s2.replace( "<", "&lt;" );
+ s2 = s2.replace( "'", "&apos;" );
+ return s2;
+}
+
+void CustomWidgetEditor::saveDescription()
+{
+ QString fn = KFileDialog::getSaveFileName( QString::null, i18n( "*.cw|Custom-Widget Description\n*|All Files" ), this );
+ if ( fn.isEmpty() )
+ return;
+
+ if ( QFileInfo( fn ).extension() != "cw" )
+ fn += ".cw";
+ QFile f( fn );
+ if ( !f.open( IO_WriteOnly ) )
+ return;
+
+ QTextStream ts( &f );
+ ts.setCodec( QTextCodec::codecForName( "UTF-8" ) );
+ int indent = 0;
+
+ ts << "<!DOCTYPE CW><CW>" << endl;
+
+ ts << makeIndent2( indent ) << "<customwidgets>" << endl;
+ indent++;
+
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ ts << makeIndent2( indent ) << "<customwidget>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<class>" << w->className << "</class>" << endl;
+ ts << makeIndent2( indent ) << "<header location=\""
+ << ( w->includePolicy == MetaDataBase::CustomWidget::Local ? "local" : "global" )
+ << "\">" << w->includeFile << "</header>" << endl;
+ ts << makeIndent2( indent ) << "<sizehint>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<width>" << w->sizeHint.width() << "</width>" << endl;
+ ts << makeIndent2( indent ) << "<height>" << w->sizeHint.height() << "</height>" << endl;
+ indent--;
+ ts << makeIndent2( indent ) << "</sizehint>" << endl;
+ ts << makeIndent2( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl;
+ ts << makeIndent2( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent2( indent ) << "<hordata>" << (int)w->sizePolicy.horData() << "</hordata>" << endl;
+ ts << makeIndent2( indent ) << "<verdata>" << (int)w->sizePolicy.verData() << "</verdata>" << endl;
+ indent--;
+ ts << makeIndent2( indent ) << "</sizepolicy>" << endl;
+ ts << makeIndent2( indent ) << "<pixmap>" << endl;
+ indent++;
+ Resource::saveImageData( w->pixmap->convertToImage(), ts, indent );
+ indent--;
+ ts << makeIndent2( indent ) << "</pixmap>" << endl;
+ if ( !w->lstSignals.isEmpty() ) {
+ for ( QValueList<QCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ ts << makeIndent2( indent ) << "<signal>" << entitize2( *it ) << "</signal>" << endl;
+ }
+ if ( !w->lstSlots.isEmpty() ) {
+ for ( QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ ts << makeIndent2( indent ) << "<slot access=\"" << (*it).access << "\">" << entitize2( (*it).function ) << "</slot>" << endl;
+ }
+ if ( !w->lstProperties.isEmpty() ) {
+ for ( QValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ ts << makeIndent2( indent ) << "<property type=\"" << (*it).type << "\">" << entitize2( (*it).property ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent2( indent ) << "</customwidget>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent2( indent ) << "</customwidgets>" << endl;
+ ts << "</CW>" << endl;
+}
+
+void CustomWidgetEditor::loadDescription()
+{
+ QString fn = KFileDialog::getOpenFileName( QString::null, i18n( "*.cw|Custom-Widget Description\n*|All Files" ), this );
+ if ( fn.isEmpty() )
+ return;
+
+ QFile f( fn );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+ if ( !doc.setContent( &f, &errMsg, &errLine ) ) {
+ qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine );
+ return;
+ }
+
+ QDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement();
+
+ while ( firstWidget.tagName() != "customwidgets" )
+ firstWidget = firstWidget.nextSibling().toElement();
+
+ Resource::loadCustomWidgets( firstWidget, 0 );
+ boxWidgets->clear();
+ setupDefinition();
+ setupSignals();
+ setupSlots();
+ setupProperties();
+}
+
+void CustomWidgetEditor::updateCustomWidgetSizes()
+{
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( QObject *o = cwLst.first(); o; o = cwLst.next() )
+ ( (QWidget*)o )->updateGeometry();
+}
+
+void CustomWidgetEditor::horDataChanged( int a )
+{
+ QSizePolicy::SizeType st = int_to_size_type( a );
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ QSizePolicy osp = w->sizePolicy;
+ w->sizePolicy.setHorData( st );
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( QObject *o = cwLst.first(); o; o = cwLst.next() ) {
+ CustomWidget *cw = (CustomWidget*)o;
+ if ( cw->realClassName() == boxWidgets->currentText() ) {
+ if ( cw->sizePolicy() == osp )
+ cw->setSizePolicy( w->sizePolicy );
+ }
+ }
+}
+
+void CustomWidgetEditor::verDataChanged( int a )
+{
+ QSizePolicy::SizeType st = int_to_size_type( a );
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ QSizePolicy osp = w->sizePolicy;
+ w->sizePolicy.setVerData( st );
+ if ( cwLst.isEmpty() )
+ cwLst = *mainWindow->queryList( "CustomWidget" );
+ for ( QObject *o = cwLst.first(); o; o = cwLst.next() ) {
+ CustomWidget *cw = (CustomWidget*)o;
+ if ( cw->realClassName() == boxWidgets->currentText() ) {
+ if ( cw->sizePolicy() == osp )
+ cw->setSizePolicy( w->sizePolicy );
+ }
+ }
+}
+
+void CustomWidgetEditor::widgetIsContainer( bool b )
+{
+ QListBoxItem *i = boxWidgets->item( boxWidgets->currentItem() );
+ MetaDataBase::CustomWidget *w = findWidget( i );
+ if ( !i || !w )
+ return;
+
+ w->isContainer = b;
+ WidgetDatabaseRecord *r = WidgetDatabase::at( w->id );
+ if ( r )
+ r->isContainer = b;
+}
diff --git a/kdevdesigner/designer/customwidgeteditorimpl.h b/kdevdesigner/designer/customwidgeteditorimpl.h
new file mode 100644
index 00000000..cdbf402f
--- /dev/null
+++ b/kdevdesigner/designer/customwidgeteditorimpl.h
@@ -0,0 +1,98 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef CUSTOMWIDGETEDITORIMPL_H
+#define CUSTOMWIDGETEDITORIMPL_H
+
+#include "customwidgeteditor.h"
+#include "metadatabase.h"
+
+#include <qmap.h>
+#include <qobjectlist.h>
+
+class QTimer;
+class QListBoxItem;
+class MainWindow;
+
+class CustomWidgetEditor : public CustomWidgetEditorBase
+{
+ Q_OBJECT
+
+public:
+ CustomWidgetEditor( QWidget *parent , MainWindow *mw);
+
+protected slots:
+ void addWidgetClicked();
+ void classNameChanged( const QString & );
+ void currentWidgetChanged( QListBoxItem * );
+ void deleteWidgetClicked();
+ void headerFileChanged( const QString & );
+ void heightChanged( int );
+ void includePolicyChanged( int );
+ void pixmapChoosen();
+ void widthChanged( int );
+ void chooseHeader();
+ void checkWidgetName();
+ void closeClicked();
+ void currentSignalChanged( QListBoxItem *i );
+ void addSignal();
+ void removeSignal();
+ void signalNameChanged( const QString &s );
+ void slotAccessChanged( const QString & );
+ void slotNameChanged( const QString & );
+ void addSlot();
+ void removeSlot();
+ void currentSlotChanged( QListViewItem * );
+ void propertyTypeChanged( const QString & );
+ void propertyNameChanged( const QString & );
+ void addProperty();
+ void removeProperty();
+ void currentPropertyChanged( QListViewItem * );
+ void saveDescription();
+ void loadDescription();
+ void horDataChanged( int );
+ void verDataChanged( int );
+ void widgetIsContainer( bool );
+
+private:
+ MetaDataBase::CustomWidget *findWidget( QListBoxItem *i );
+ void setupDefinition();
+ void setupSignals();
+ void setupSlots();
+ void setupProperties();
+ void updateCustomWidgetSizes();
+
+private:
+ QMap<QListBoxItem*, MetaDataBase::CustomWidget*> customWidgets;
+ QString oldName;
+ QTimer *checkTimer;
+ QListBoxItem *oldItem;
+ MainWindow *mainWindow;
+ QObjectList cwLst;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/database.cpp b/kdevdesigner/designer/database.cpp
new file mode 100644
index 00000000..a92a04c8
--- /dev/null
+++ b/kdevdesigner/designer/database.cpp
@@ -0,0 +1,122 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#if defined(DESIGNER)
+#include "database.h"
+#else
+#include "database2.h"
+#endif
+
+#ifndef QT_NO_SQL
+
+#if defined(DESIGNER)
+#include "formwindow.h"
+#include "mainwindow.h"
+#endif
+
+#include <qsqldatabase.h>
+#include <qsqlform.h>
+#include <qsqlcursor.h>
+#include <qsqlrecord.h>
+
+DatabaseSupport::DatabaseSupport()
+{
+ con = 0;
+ frm = 0;
+ parent = 0;
+}
+
+void DatabaseSupport::initPreview( const QString &connection, const QString &table, QObject *o,
+ const QMap<QString, QString> &databaseControls )
+{
+ tbl = table;
+ dbControls = databaseControls;
+ parent = o;
+
+ if ( connection != "(default)" )
+ con = QSqlDatabase::database( connection );
+ else
+ con = QSqlDatabase::database();
+ frm = new QSqlForm( o, table );
+ for ( QMap<QString, QString>::Iterator it = dbControls.begin(); it != dbControls.end(); ++it ) {
+ QObject *chld = parent->child( it.key(), "QWidget" );
+ if ( !chld )
+ continue;
+ frm->insert( (QWidget*)chld, *it );
+ }
+}
+
+QDesignerDataBrowser::QDesignerDataBrowser( QWidget *parent, const char *name )
+ : QDataBrowser( parent, name )
+{
+}
+
+bool QDesignerDataBrowser::event( QEvent* e )
+{
+ bool b = QDataBrowser::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == QEvent::Show ) {
+ if ( con ) {
+ QSqlCursor* cursor = new QSqlCursor( tbl, TRUE, con );
+ setSqlCursor( cursor, TRUE );
+ setForm( frm );
+ refresh();
+ first();
+ }
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+QDesignerDataView::QDesignerDataView( QWidget *parent, const char *name )
+ : QDataView( parent, name )
+{
+}
+
+bool QDesignerDataView::event( QEvent* e )
+{
+ bool b = QDataView::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == QEvent::Show ) {
+ setForm( frm );
+ readFields();
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+
+#endif
diff --git a/kdevdesigner/designer/database.h b/kdevdesigner/designer/database.h
new file mode 100644
index 00000000..530085fb
--- /dev/null
+++ b/kdevdesigner/designer/database.h
@@ -0,0 +1,83 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DATABASE_H
+#define DATABASE_H
+
+#include "qfeatures.h"
+
+#ifndef QT_NO_SQL
+#include <qdataview.h>
+#include <qdatabrowser.h>
+#include <qsqlcursor.h>
+#include <qstring.h>
+
+class QSqlDatabase;
+class QSqlForm;
+
+class DatabaseSupport
+{
+public:
+ DatabaseSupport();
+ virtual ~DatabaseSupport() {}
+
+ void initPreview( const QString &connection, const QString &table, QObject *o,
+ const QMap<QString, QString> &databaseControls );
+
+protected:
+ QSqlDatabase* con;
+ QSqlForm* frm;
+ QString tbl;
+ QMap<QString, QString> dbControls;
+ QObject *parent;
+
+};
+
+class QDesignerDataBrowser : public QDataBrowser, public DatabaseSupport
+{
+ Q_OBJECT
+
+public:
+ QDesignerDataBrowser( QWidget *parent, const char *name );
+
+protected:
+ bool event( QEvent* e );
+};
+
+class QDesignerDataView : public QDataView, public DatabaseSupport
+{
+ Q_OBJECT
+
+public:
+ QDesignerDataView( QWidget *parent, const char *name );
+
+protected:
+ bool event( QEvent* e );
+
+};
+#endif
+
+#endif
diff --git a/kdevdesigner/designer/dbconnection.ui b/kdevdesigner/designer/dbconnection.ui
new file mode 100644
index 00000000..19a0e216
--- /dev/null
+++ b/kdevdesigner/designer/dbconnection.ui
@@ -0,0 +1,222 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionWidget</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DatabaseConnectionWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>199</width>
+ <height>185</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Database Connection</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Database name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editDatabase</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Username:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editUsername</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editPassword</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;river:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboDriver</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editName</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Hostname:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editHostname</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboDriver</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="1">
+ <property name="name">
+ <cstring>editHostname</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;ort:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editPort</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editUsername</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>editPassword</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="echoMode">
+ <enum>Password</enum>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editDatabase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="6" column="1">
+ <property name="name">
+ <cstring>editPort</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="specialValueText">
+ <string>Default</string>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+</connections>
+<tabstops>
+ <tabstop>editName</tabstop>
+ <tabstop>comboDriver</tabstop>
+ <tabstop>editDatabase</tabstop>
+ <tabstop>editUsername</tabstop>
+ <tabstop>editPassword</tabstop>
+ <tabstop>editHostname</tabstop>
+ <tabstop>editPort</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/dbconnectioneditor.ui b/kdevdesigner/designer/dbconnectioneditor.ui
new file mode 100644
index 00000000..64b77387
--- /dev/null
+++ b/kdevdesigner/designer/dbconnectioneditor.ui
@@ -0,0 +1,147 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>DatabaseConnectionEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>393</width>
+ <height>286</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Connect</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>grp</cstring>
+ </property>
+ <property name="title">
+ <string>Connection Details</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="0" column="0">
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionEditorBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+</connections>
+<tabstops>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+</UI>
diff --git a/kdevdesigner/designer/dbconnectionimpl.cpp b/kdevdesigner/designer/dbconnectionimpl.cpp
new file mode 100644
index 00000000..4867ed39
--- /dev/null
+++ b/kdevdesigner/designer/dbconnectionimpl.cpp
@@ -0,0 +1,80 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "dbconnectionimpl.h"
+#include "dbconnection.h"
+#include "project.h"
+#include "asciivalidator.h"
+#include <qgroupbox.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <klineedit.h>
+#include <qlayout.h>
+#include <qsqldatabase.h>
+
+DatabaseConnectionEditor::DatabaseConnectionEditor( DatabaseConnection* connection, QWidget* parent,
+ const char* name, bool modal, WFlags fl )
+ : DatabaseConnectionEditorBase( parent, name, modal, fl ), conn( connection )
+{
+ connectionWidget = new DatabaseConnectionWidget( grp );
+ grpLayout->addWidget( connectionWidget, 0, 0 );
+ init();
+}
+
+DatabaseConnectionEditor::~DatabaseConnectionEditor()
+{
+}
+
+void DatabaseConnectionEditor::accept()
+{
+#ifndef QT_NO_SQL
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+#endif
+ DatabaseConnectionEditorBase::accept();
+}
+
+void DatabaseConnectionEditor::init()
+{
+ connectionWidget->editName->setEnabled( FALSE );
+ connectionWidget->editName->setValidator( new AsciiValidator( connectionWidget->editName ) );
+ connectionWidget->editName->setText( conn->name() );
+ connectionWidget->comboDriver->setEnabled( FALSE );
+ connectionWidget->comboDriver->lineEdit()->setText( conn->driver() );
+ connectionWidget->editDatabase->setEnabled( FALSE );
+ connectionWidget->editDatabase->setText( conn->database() );
+ connectionWidget->editUsername->setEnabled( TRUE );
+ connectionWidget->editUsername->setText( conn->username() );
+ connectionWidget->editPassword->setEnabled( TRUE );
+ connectionWidget->editPassword->setText( "" );
+ connectionWidget->editHostname->setEnabled( TRUE );
+ connectionWidget->editHostname->setText( conn->hostname() );
+ connectionWidget->editPort->setEnabled( TRUE );
+ connectionWidget->editPort->setValue( conn->port() );
+ connectionWidget->editUsername->setFocus();
+ connectionWidget->editUsername->selectAll();
+}
diff --git a/kdevdesigner/designer/dbconnectionimpl.h b/kdevdesigner/designer/dbconnectionimpl.h
new file mode 100644
index 00000000..daef2c21
--- /dev/null
+++ b/kdevdesigner/designer/dbconnectionimpl.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DBCONNECTIONIMPL_H
+#define DBCONNECTIONIMPL_H
+
+#include "dbconnectioneditor.h"
+
+class DatabaseConnection;
+class DatabaseConnectionWidget;
+class QGridLayout;
+
+class DatabaseConnectionEditor : public DatabaseConnectionEditorBase
+{
+ Q_OBJECT
+
+public:
+ DatabaseConnectionEditor( DatabaseConnection* connection, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~DatabaseConnectionEditor();
+
+public slots:
+ void accept();
+private:
+ void init();
+
+private:
+ DatabaseConnection *conn;
+ QGridLayout* lay;
+ DatabaseConnectionWidget* connectionWidget;
+
+};
+
+#endif // DBCONNECTIONIMPL_H
diff --git a/kdevdesigner/designer/dbconnections.ui b/kdevdesigner/designer/dbconnections.ui
new file mode 100644
index 00000000..847c00b1
--- /dev/null
+++ b/kdevdesigner/designer/dbconnections.ui
@@ -0,0 +1,321 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>DatabaseConnectionBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>DatabaseConnectionBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>512</width>
+ <height>309</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Database Connections</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Connection</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>listConnections</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Connection</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonClose</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" column="1" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>Spacer1</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>
+ <widget class="QGroupBox" row="0" column="2" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>grp</cstring>
+ </property>
+ <property name="title">
+ <string>Connection</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="0" column="0">
+ <property name="name">
+ <cstring>Spacer3</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>
+ <widget class="QLayoutWidget" row="3" column="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonConnect</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Connec&amp;t</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</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>
+ <spacer row="4" column="2">
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonNew</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>newConnection()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>deleteConnection()</slot>
+ </connection>
+ <connection>
+ <sender>buttonConnect</sender>
+ <signal>clicked()</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>doConnect()</slot>
+ </connection>
+ <connection>
+ <sender>listConnections</sender>
+ <signal>highlighted(const QString&amp;)</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>currentConnectionChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listConnections</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>DatabaseConnectionBase</receiver>
+ <slot>currentConnectionChanged(const QString&amp;)</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">currentConnectionChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">deleteConnection()</slot>
+ <slot access="protected" language="C++" returnType="void">newConnection()</slot>
+ <slot access="protected" language="C++" returnType="void">connectionNameChanged( const QString &amp; )</slot>
+ <slot access="protected" language="C++" returnType="void">doConnect()</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonClose</tabstop>
+ <tabstop>listConnections</tabstop>
+ <tabstop>buttonNew</tabstop>
+ <tabstop>buttonDelete</tabstop>
+ <tabstop>buttonConnect</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/kdevdesigner/designer/dbconnectionsimpl.cpp b/kdevdesigner/designer/dbconnectionsimpl.cpp
new file mode 100644
index 00000000..6f059336
--- /dev/null
+++ b/kdevdesigner/designer/dbconnectionsimpl.cpp
@@ -0,0 +1,196 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "dbconnectionsimpl.h"
+#include <qptrlist.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include "project.h"
+#include <qlistbox.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <qsqldatabase.h>
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include "mainwindow.h"
+#include "asciivalidator.h"
+
+#include <klocale.h>
+
+static bool blockChanges = FALSE;
+
+/*
+ * Constructs a DatabaseConnectionsEditor which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+DatabaseConnectionsEditor::DatabaseConnectionsEditor( Project *pro, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : DatabaseConnectionBase( parent, name, modal, fl ), project( pro )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ connectionWidget = new DatabaseConnectionWidget( grp );
+ grpLayout->addWidget( connectionWidget, 0, 0 );
+#ifndef QT_NO_SQL
+ QPtrList<DatabaseConnection> lst = project->databaseConnections();
+ for ( DatabaseConnection *conn = lst.first(); conn; conn = lst.next() )
+ listConnections->insertItem( conn->name() );
+ connectionWidget->comboDriver->insertStringList( QSqlDatabase::drivers() );
+#endif
+ connectionWidget->editName->setValidator( new AsciiValidator( connectionWidget->editName ) );
+ enableAll( FALSE );
+}
+
+DatabaseConnectionsEditor::~DatabaseConnectionsEditor()
+{
+}
+
+void DatabaseConnectionsEditor::deleteConnection()
+{
+ if ( listConnections->currentItem() == -1 )
+ return;
+ project->removeDatabaseConnection( listConnections->currentText() );
+ delete listConnections->item( listConnections->currentItem() );
+ if ( listConnections->count() ) {
+ listConnections->setCurrentItem( 0 );
+ currentConnectionChanged( listConnections->currentText() );
+ } else {
+ enableAll( FALSE );
+ }
+ project->saveConnections();
+}
+
+void DatabaseConnectionsEditor::newConnection()
+{
+ blockChanges = TRUE;
+ enableAll( TRUE );
+ QString n( "(default)" );
+ if ( project->databaseConnection( n ) ) {
+ n = "connection";
+ int i = 2;
+ while ( project->databaseConnection( n + QString::number( i ) ) )
+ ++i;
+ n = n + QString::number( i );
+ }
+ connectionWidget->editName->setText( n );
+ listConnections->clearSelection();
+ buttonConnect->setDefault( TRUE );
+ connectionWidget->editName->setFocus();
+ blockChanges = FALSE;
+}
+
+void DatabaseConnectionsEditor::doConnect()
+{
+#ifndef QT_NO_SQL
+ if ( listConnections->currentItem() == -1 ||
+ !listConnections->item( listConnections->currentItem() )->isSelected() ) { // new connection
+ // ### do error checking for duplicated connection names
+ DatabaseConnection *conn = new DatabaseConnection( project );
+ conn->setName( connectionWidget->editName->text() );
+ conn->setDriver( connectionWidget->comboDriver->lineEdit()->text() );
+ conn->setDatabase( connectionWidget->editDatabase->text() );
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+ conn->setPort( connectionWidget->editPort->value() );
+ if ( conn->refreshCatalog() ) {
+ project->addDatabaseConnection( conn );
+ listConnections->insertItem( conn->name() );
+ listConnections->setCurrentItem( listConnections->count() - 1 );
+ project->saveConnections();
+ } else {
+ QMessageBox::warning( MainWindow::self, i18n( "Connection" ),
+ i18n( "Could not connect to the database.\n"
+ "Please ensure that the database server is running "
+ "and that all the connection information is correct.\n"
+ "[ " + conn->lastError() + " ]" ) );
+ delete conn;
+ }
+ } else { // sync // ### should this do something else? right now it just overwrites all info about the connection...
+ DatabaseConnection *conn = project->databaseConnection( listConnections->currentText() );
+ conn->setName( connectionWidget->editName->text() );
+ conn->setDriver( connectionWidget->comboDriver->lineEdit()->text() );
+ conn->setDatabase( connectionWidget->editDatabase->text() );
+ conn->setUsername( connectionWidget->editUsername->text() );
+ conn->setPassword( connectionWidget->editPassword->text() );
+ conn->setHostname( connectionWidget->editHostname->text() );
+ conn->setPort( connectionWidget->editPort->value() );
+ conn->refreshCatalog();
+ project->saveConnections();
+ }
+#endif
+}
+
+void DatabaseConnectionsEditor::currentConnectionChanged( const QString &s )
+{
+#ifndef QT_NO_SQL
+ DatabaseConnection *conn = project->databaseConnection( s );
+ blockChanges = TRUE;
+ enableAll( conn != 0 );
+ connectionWidget->editName->setEnabled( FALSE );
+ blockChanges = FALSE;
+ if ( !conn )
+ return;
+ blockChanges = TRUE;
+ connectionWidget->editName->setText( conn->name() );
+ blockChanges = FALSE;
+ connectionWidget->comboDriver->lineEdit()->setText( conn->driver() );
+ connectionWidget->editDatabase->setText( conn->database() );
+ connectionWidget->editUsername->setText( conn->username() );
+ connectionWidget->editPassword->setText( conn->password() );
+ connectionWidget->editHostname->setText( conn->hostname() );
+ connectionWidget->editPort->setValue( conn->port() );
+#endif
+}
+
+void DatabaseConnectionsEditor::connectionNameChanged( const QString &s )
+{
+ if ( listConnections->currentItem() == 0 || blockChanges )
+ return;
+ listConnections->changeItem( s, listConnections->currentItem() );
+}
+
+void DatabaseConnectionsEditor::enableAll( bool b )
+{
+ connectionWidget->editName->setEnabled( b );
+ connectionWidget->editName->setText( "" );
+ connectionWidget->comboDriver->setEnabled( b );
+ connectionWidget->comboDriver->lineEdit()->setText( "" );
+ connectionWidget->editDatabase->setEnabled( b );
+ connectionWidget->editDatabase->setText( "" );
+ connectionWidget->editUsername->setEnabled( b );
+ connectionWidget->editUsername->setText( "" );
+ connectionWidget->editPassword->setEnabled( b );
+ connectionWidget->editPassword->setText( "" );
+ connectionWidget->editHostname->setEnabled( b );
+ connectionWidget->editHostname->setText( "" );
+ connectionWidget->editPort->setEnabled( b );
+ connectionWidget->editPort->setValue( -1 );
+ buttonConnect->setEnabled( b );
+}
diff --git a/kdevdesigner/designer/dbconnectionsimpl.h b/kdevdesigner/designer/dbconnectionsimpl.h
new file mode 100644
index 00000000..fdb70427
--- /dev/null
+++ b/kdevdesigner/designer/dbconnectionsimpl.h
@@ -0,0 +1,60 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DBCONNECTIONSIMPL_H
+#define DBCONNECTIONSIMPL_H
+
+#include "dbconnections.h"
+#include "dbconnection.h"
+
+class Project;
+
+class DatabaseConnectionsEditor : public DatabaseConnectionBase
+{
+ Q_OBJECT
+
+public:
+ DatabaseConnectionsEditor( Project *pro, QWidget* parent = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~DatabaseConnectionsEditor();
+
+protected slots:
+ void deleteConnection();
+ void newConnection();
+ void doConnect();
+ void currentConnectionChanged( const QString & );
+ void connectionNameChanged( const QString &s );
+
+private:
+ void enableAll( bool b );
+
+private:
+ Project *project;
+ DatabaseConnectionWidget* connectionWidget;
+
+};
+
+#endif // DBCONNECTIONSIMPL_H
diff --git a/kdevdesigner/designer/defs.cpp b/kdevdesigner/designer/defs.cpp
new file mode 100644
index 00000000..11b3dca0
--- /dev/null
+++ b/kdevdesigner/designer/defs.cpp
@@ -0,0 +1,84 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "defs.h"
+
+int size_type_to_int( QSizePolicy::SizeType t )
+{
+ if ( t == QSizePolicy::Fixed )
+ return 0;
+ if ( t == QSizePolicy::Minimum )
+ return 1;
+ if ( t == QSizePolicy::Maximum )
+ return 2;
+ if ( t == QSizePolicy::Preferred )
+ return 3;
+ if ( t == QSizePolicy::MinimumExpanding )
+ return 4;
+ if ( t == QSizePolicy::Expanding )
+ return 5;
+ if ( t == QSizePolicy::Ignored )
+ return 6;
+ return 0;
+}
+
+QString size_type_to_string( QSizePolicy::SizeType t )
+{
+ if ( t == QSizePolicy::Fixed )
+ return "Fixed";
+ if ( t == QSizePolicy::Minimum )
+ return "Minimum";
+ if ( t == QSizePolicy::Maximum )
+ return "Maximum";
+ if ( t == QSizePolicy::Preferred )
+ return "Preferred";
+ if ( t == QSizePolicy::MinimumExpanding )
+ return "MinimumExpanding";
+ if ( t == QSizePolicy::Expanding )
+ return "Expanding";
+ if ( t == QSizePolicy::Ignored )
+ return "Ignored";
+ return QString();
+}
+
+QSizePolicy::SizeType int_to_size_type( int i )
+{
+ if ( i == 0 )
+ return QSizePolicy::Fixed;
+ if ( i == 1 )
+ return QSizePolicy::Minimum;
+ if ( i == 2 )
+ return QSizePolicy::Maximum;
+ if ( i == 3 )
+ return QSizePolicy::Preferred;
+ if ( i == 4 )
+ return QSizePolicy::MinimumExpanding;
+ if ( i == 5 )
+ return QSizePolicy::Expanding;
+ if ( i == 6 )
+ return QSizePolicy::Ignored;
+ return QSizePolicy::Preferred;
+}
diff --git a/kdevdesigner/designer/defs.h b/kdevdesigner/designer/defs.h
new file mode 100644
index 00000000..80a11671
--- /dev/null
+++ b/kdevdesigner/designer/defs.h
@@ -0,0 +1,42 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DEFS_H
+#define DEFS_H
+
+#include <qsizepolicy.h>
+#include <qstring.h>
+
+#define POINTER_TOOL 32000
+#define CONNECT_TOOL 32001
+#define ORDER_TOOL 32002
+#define BUDDY_TOOL 32004
+
+int size_type_to_int( QSizePolicy::SizeType t );
+QString size_type_to_string( QSizePolicy::SizeType t );
+QSizePolicy::SizeType int_to_size_type( int i );
+
+#endif
diff --git a/kdevdesigner/designer/designer_pch.h b/kdevdesigner/designer/designer_pch.h
new file mode 100644
index 00000000..6b53f984
--- /dev/null
+++ b/kdevdesigner/designer/designer_pch.h
@@ -0,0 +1,44 @@
+/*
+ * This is a precompiled header file for use in Xcode / Mac GCC /
+ * GCC >= 3.4 / VC to greatly speed the building of Qt Designer. It may
+ * also be of use to people developing their own project, but it is
+ * probably better to define your own header. Use of this header is
+ * currently UNSUPPORTED.
+ */
+
+#if defined __cplusplus
+
+#include <private/qucomextra_p.h>
+#include <qaction.h>
+#include <qapplication.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qdialog.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlistbox.h>
+#include <qlistview.h>
+#include <qmap.h>
+#include <qmessagebox.h>
+#include <qmetaobject.h>
+#include <qobjectlist.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qstring.h>
+#include <qtooltip.h>
+#include <qvariant.h>
+#include <qwhatsthis.h>
+#include <qwidget.h>
+
+#include "command.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "widgetfactory.h"
+
+#endif
diff --git a/kdevdesigner/designer/designeraction.cpp b/kdevdesigner/designer/designeraction.cpp
new file mode 100644
index 00000000..2cdcd5eb
--- /dev/null
+++ b/kdevdesigner/designer/designeraction.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "designeraction.h"
+
+DesignerAction::~DesignerAction()
+{
+}
+
+void DesignerAction::setDisabled( bool d )
+{
+ QAction::setEnabled(!d);
+ emit actionEnabled(!d);
+}
+
+void DesignerAction::setEnabled( bool e )
+{
+ QAction::setEnabled(e);
+ emit actionEnabled(e);
+}
+
+#if QT_VERSION < 0x030300
+void DesignerAction::activate()
+{
+ if ( isToggleAction() ) {
+ return;
+ }
+ emit activated();
+}
+#endif
+
+#include "designeraction.moc"
diff --git a/kdevdesigner/designer/designeraction.h b/kdevdesigner/designer/designeraction.h
new file mode 100644
index 00000000..db8f7901
--- /dev/null
+++ b/kdevdesigner/designer/designeraction.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DESIGNERACTION_H
+#define DESIGNERACTION_H
+
+#include <qaction.h>
+
+class DesignerAction : public QAction
+{
+Q_OBJECT
+public:
+ DesignerAction(QObject *parent = 0, const char *name = 0)
+ :QAction(parent, name) {}
+ DesignerAction ( const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0 )
+ :QAction(menuText, accel, parent, name) {}
+ DesignerAction ( const QIconSet & icon, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0 )
+ :QAction(icon, menuText, accel, parent, name) {}
+ DesignerAction ( const QString & text, const QIconSet & icon, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0, bool toggle = FALSE )
+ :QAction(text, icon, menuText, accel, parent, name, toggle) {}
+ DesignerAction ( const QString & text, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0, bool toggle = FALSE )
+ :QAction(text, menuText, accel, parent, name, toggle) {}
+ DesignerAction ( QObject * parent, const char * name, bool toggle )
+ :QAction(parent, name, toggle) {}
+ ~DesignerAction();
+
+ virtual void setEnabled(bool e);
+ virtual void setDisabled(bool d);
+#if QT_VERSION < 0x030300
+ virtual void activate();
+#endif
+
+signals:
+ void actionEnabled(bool e);
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/designerapp.cpp b/kdevdesigner/designer/designerapp.cpp
new file mode 100644
index 00000000..480bc65b
--- /dev/null
+++ b/kdevdesigner/designer/designerapp.cpp
@@ -0,0 +1,176 @@
+ /**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "designerappiface.h"
+#include "designerapp.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <kiconloader.h>
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qsettings.h>
+#include <qsplashscreen.h>
+
+#ifdef Q_WS_WIN
+#include <qt_windows.h>
+#include <process.h>
+#endif
+
+static QSplashScreen *splash = 0;
+
+void set_splash_status( const QString &txt )
+{
+ if ( !splash )
+ return;
+ QString splashText = "Licensed to "
+ + QString::fromLatin1( QT_PRODUCT_LICENSEE ) + "\n"
+ + txt;
+ splash->message( splashText, Qt::AlignRight|Qt::AlignTop );
+}
+
+DesignerApplication::DesignerApplication( int &argc, char **argv )
+ : QApplication( argc, argv )
+{
+#if defined(Q_WS_WIN)
+ if ( winVersion() & Qt::WV_NT_based )
+ DESIGNER_OPENFILE = RegisterWindowMessage((TCHAR*)"QT_DESIGNER_OPEN_FILE");
+ else
+ DESIGNER_OPENFILE = RegisterWindowMessageA("QT_DESIGNER_OPEN_FILE");
+#endif
+}
+
+QSplashScreen *DesignerApplication::showSplash()
+{
+ QRect screen = QApplication::desktop()->screenGeometry();
+ QSettings config;
+ config.insertSearchPath( QSettings::Windows, "/Trolltech" );
+
+ QRect mainRect;
+ QString keybase = settingsKey();
+ bool show = config.readBoolEntry( keybase + "SplashScreen", TRUE );
+ mainRect.setX( config.readNumEntry( keybase + "Geometries/MainwindowX", 0 ) );
+ mainRect.setY( config.readNumEntry( keybase + "Geometries/MainwindowY", 0 ) );
+ mainRect.setWidth( config.readNumEntry( keybase + "Geometries/MainwindowWidth", 500 ) );
+ mainRect.setHeight( config.readNumEntry( keybase + "Geometries/MainwindowHeight", 500 ) );
+ screen = QApplication::desktop()->screenGeometry( QApplication::desktop()->screenNumber( mainRect.center() ) );
+
+ if ( show ) {
+ splash = new QSplashScreen( UserIcon("designer_splash.png") );
+ splash->show();
+ set_splash_status( "Initializing..." );
+ }
+
+ return splash;
+}
+
+void DesignerApplication::closeSplash()
+{
+ splash->hide();
+}
+
+static QString *settings_key = 0;
+static QString *old_settings_key = 0;
+
+QString DesignerApplication::settingsKey()
+{
+ if ( !settings_key )
+ settings_key = new QString( "/Qt Designer/" +
+ QString::number( (QT_VERSION >> 16) & 0xff ) +
+ "." + QString::number( (QT_VERSION >> 8) & 0xff ) + "/" );
+ return *settings_key;
+}
+
+QString DesignerApplication::oldSettingsKey()
+{
+ if ( !old_settings_key ) {
+ int majorVer = (QT_VERSION >> 16) & 0xff;
+ int minorVer = (QT_VERSION >> 8) & 0xff;
+
+ // If minorVer is 0 (e.g. 4.0) then we don't want to read the
+ // old settings, too much might have changed.
+ if ( !minorVer == 0 )
+ minorVer--;
+
+ old_settings_key = new QString( "/Qt Designer/" +
+ QString::number( majorVer ) +
+ "." + QString::number( minorVer ) + "/" );
+ }
+ return *old_settings_key;
+}
+
+void DesignerApplication::setSettingsKey( const QString &key )
+{
+ if ( !settings_key )
+ settings_key = new QString( key );
+ else
+ *settings_key = key;
+}
+
+#if defined(Q_WS_WIN)
+bool DesignerApplication::winEventFilter( MSG *msg )
+{
+ if ( msg->message == DESIGNER_OPENFILE ) {
+ QFile f( QDir::homeDirPath() + "/.designerargs" );
+ QFileInfo fi(f);
+ if ( fi.lastModified() == lastMod )
+ return QApplication::winEventFilter( msg );
+ lastMod = fi.lastModified();
+ f.open( IO_ReadOnly );
+ QString args;
+ f.readLine( args, f.size() );
+ QStringList lst = QStringList::split( " ", args );
+
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ QString arg = (*it).stripWhiteSpace();
+ if ( arg[0] != '-' ) {
+ QObjectList* l = MainWindow::self->queryList( "FormWindow" );
+ FormWindow* fw = (FormWindow*) l->first();
+ FormWindow* totop = 0;
+ bool haveit = FALSE;
+ while ( fw ) {
+ haveit = haveit || fw->fileName() == arg;
+ if ( haveit )
+ totop = fw;
+
+ fw = (FormWindow*) l->next();
+ }
+
+ if ( !haveit ) {
+ FlashWindow( MainWindow::self->winId(), TRUE );
+ MainWindow::self->openFormWindow( arg );
+ } else if ( totop ) {
+ totop->setFocus();
+ }
+ delete l;
+ }
+ }
+ return TRUE;
+ }
+ return QApplication::winEventFilter( msg );
+}
+#endif
diff --git a/kdevdesigner/designer/designerapp.h b/kdevdesigner/designer/designerapp.h
new file mode 100644
index 00000000..d78d55af
--- /dev/null
+++ b/kdevdesigner/designer/designerapp.h
@@ -0,0 +1,58 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DESIGNERAPP_H
+#define DESIGNERAPP_H
+
+class QSplashScreen;
+
+#include <qapplication.h>
+
+class DesignerApplication : public QApplication
+{
+public:
+ const char *className() const { return "DesignerApplication"; }
+
+ DesignerApplication( int &argc, char **argv );
+
+ QSplashScreen *showSplash();
+ static void closeSplash();
+
+ static QString settingsKey();
+ static QString oldSettingsKey();
+ static void setSettingsKey( const QString &key );
+
+protected:
+ QDateTime lastMod;
+
+#if defined(Q_WS_WIN)
+ bool winEventFilter( MSG *msg );
+ uint DESIGNER_OPENFILE;
+#endif
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/designerappiface.cpp b/kdevdesigner/designer/designerappiface.cpp
new file mode 100644
index 00000000..798f45b6
--- /dev/null
+++ b/kdevdesigner/designer/designerappiface.cpp
@@ -0,0 +1,1093 @@
+ /**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qmenubar.h>
+#include <qpopupmenu.h>
+#include "designerappiface.h"
+#include "mainwindow.h"
+#include "project.h"
+#include "formwindow.h"
+#include "workspace.h"
+#include "widgetfactory.h"
+#include "command.h"
+#include "outputwindow.h"
+#include "../shared/widgetdatabase.h"
+#include <qvariant.h>
+#include <qlistview.h>
+#include <qtextedit.h>
+#include <qstatusbar.h>
+#include "pixmapcollection.h"
+#include "hierarchyview.h"
+#include <stdlib.h>
+#include <qmetaobject.h>
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+DesignerInterfaceImpl::DesignerInterfaceImpl( MainWindow *mw )
+ : mainWindow( mw )
+{
+}
+
+QRESULT DesignerInterfaceImpl::queryInterface( const QUuid &uuid, QUnknownInterface** iface )
+{
+ *iface = 0;
+
+ if ( uuid == IID_QUnknown )
+ *iface = (QUnknownInterface*)this;
+ else if ( uuid == IID_QComponentInformation )
+ *iface = (QComponentInformationInterface*)this;
+ else if ( uuid == IID_Designer )
+ *iface = (DesignerInterface*)this;
+ else
+ return QE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return QS_OK;
+}
+
+
+DesignerProject *DesignerInterfaceImpl::currentProject() const
+{
+ return mainWindow->currProject()->iFace();
+}
+
+DesignerFormWindow *DesignerInterfaceImpl::currentForm() const
+{
+ if ( mainWindow->formWindow() )
+ return mainWindow->formWindow()->iFace();
+ return 0;
+}
+
+DesignerSourceFile *DesignerInterfaceImpl::currentSourceFile() const
+{
+ if ( mainWindow->sourceFile() )
+ return mainWindow->sourceFile()->iFace();
+ return 0;
+}
+
+QPtrList<DesignerProject> DesignerInterfaceImpl::projectList() const
+{
+ return mainWindow->projectList();
+}
+
+void DesignerInterfaceImpl::showStatusMessage( const QString &text, int ms ) const
+{
+ if ( text.isEmpty() ) {
+ mainWindow->statusBar()->clear();
+ return;
+ }
+ if ( ms )
+ mainWindow->statusMessage( text/*, ms*/ );
+ else
+ mainWindow->statusMessage( text );
+}
+
+DesignerDock *DesignerInterfaceImpl::createDock() const
+{
+ return 0;
+}
+
+DesignerOutputDock *DesignerInterfaceImpl::outputDock() const
+{
+ return mainWindow->outputWindow() ? mainWindow->outputWindow()->iFace() : 0;
+}
+
+void DesignerInterfaceImpl::setModified( bool b, QWidget *window )
+{
+ mainWindow->setModified( b, window );
+}
+
+void DesignerInterfaceImpl::updateFunctionList()
+{
+ mainWindow->updateFunctionList();
+ if ( mainWindow->objectHierarchy()->sourceEditor() )
+ mainWindow->objectHierarchy()->updateClassBrowsers();
+}
+
+void DesignerInterfaceImpl::onProjectChange( QObject *receiver, const char *slot )
+{
+ QObject::connect( mainWindow, SIGNAL( projectChanged() ), receiver, slot );
+}
+
+void DesignerInterfaceImpl::onFormChange( QObject *receiver, const char *slot )
+{
+ QObject::connect( mainWindow, SIGNAL( formWindowChanged() ), receiver, slot );
+ QObject::connect( mainWindow, SIGNAL( editorChanged() ), receiver, slot );
+}
+
+bool DesignerInterfaceImpl::singleProjectMode() const
+{
+ return mainWindow->singleProjectMode();
+}
+
+void DesignerInterfaceImpl::showError( QWidget *widget,
+ int line, const QString &message )
+{
+ mainWindow->showErrorMessage( widget, line, message );
+}
+
+void DesignerInterfaceImpl::runFinished()
+{
+ mainWindow->finishedRun();
+}
+
+void DesignerInterfaceImpl::showStackFrame( QWidget *w, int line )
+{
+ mainWindow->showStackFrame( w, line );
+}
+
+void DesignerInterfaceImpl::showDebugStep( QWidget *w, int line )
+{
+ mainWindow->showDebugStep( w, line );
+}
+
+void DesignerInterfaceImpl::runProjectPrecondition()
+{
+ mainWindow->runProjectPrecondition();
+}
+
+void DesignerInterfaceImpl::runProjectPostcondition( QObjectList *l )
+{
+ mainWindow->runProjectPostcondition( l );
+}
+
+DesignerProjectImpl::DesignerProjectImpl( Project *pr )
+ : project( pr )
+{
+}
+
+QPtrList<DesignerFormWindow> DesignerProjectImpl::formList() const
+{
+ QPtrList<DesignerFormWindow> list;
+ QObjectList *forms = project->formList();
+ if ( !forms )
+ return list;
+
+ QPtrListIterator<QObject> it( *forms );
+ while ( it.current() ) {
+ QObject *obj = it.current();
+ ++it;
+ QWidget *par = ::qt_cast<FormWindow*>(obj->parent());
+ if ( !obj->isWidgetType() || !par )
+ continue;
+
+ list.append( ((FormWindow*)par)->iFace() );
+ }
+
+ delete forms;
+ return list;
+}
+
+QString DesignerProjectImpl::formFileName( const QString &form ) const
+{
+ for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( QString( forms.current()->formName() ) == form )
+ return forms.current()->fileName();
+ }
+ return QString::null;
+}
+
+QStringList DesignerProjectImpl::formNames() const
+{
+ QStringList l;
+ for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->isFake() )
+ continue;
+ l << f->formName();
+ }
+ return l;
+}
+
+void DesignerProjectImpl::addForm( DesignerFormWindow * )
+{
+}
+
+void DesignerProjectImpl::removeForm( DesignerFormWindow * )
+{
+}
+
+QString DesignerProjectImpl::fileName() const
+{
+ return project->fileName();
+}
+
+void DesignerProjectImpl::setFileName( const QString & )
+{
+}
+
+QString DesignerProjectImpl::projectName() const
+{
+ return project->projectName();
+}
+
+void DesignerProjectImpl::setProjectName( const QString & )
+{
+}
+
+QString DesignerProjectImpl::databaseFile() const
+{
+ return QString::null;
+}
+
+void DesignerProjectImpl::setDatabaseFile( const QString & )
+{
+}
+
+void DesignerProjectImpl::setupDatabases() const
+{
+ MainWindow::self->editDatabaseConnections();
+}
+
+QPtrList<DesignerDatabase> DesignerProjectImpl::databaseConnections() const
+{
+ QPtrList<DesignerDatabase> lst;
+#ifndef QT_NO_SQL
+ QPtrList<DatabaseConnection> conns = project->databaseConnections();
+ for ( DatabaseConnection *d = conns.first(); d; d = conns.next() )
+ lst.append( d->iFace() );
+#endif
+ return lst;
+}
+
+void DesignerProjectImpl::addDatabase( DesignerDatabase * )
+{
+}
+
+void DesignerProjectImpl::removeDatabase( DesignerDatabase * )
+{
+}
+
+void DesignerProjectImpl::save() const
+{
+}
+
+void DesignerProjectImpl::setLanguage( const QString &l )
+{
+ project->setLanguage( l );
+}
+
+QString DesignerProjectImpl::language() const
+{
+ return project->language();
+}
+
+void DesignerProjectImpl::setCustomSetting( const QString &key, const QString &value )
+{
+ project->setCustomSetting( key, value );
+}
+
+QString DesignerProjectImpl::customSetting( const QString &key ) const
+{
+ if ( key == "QTSCRIPT_PACKAGES" ) {
+ QString s = getenv( "QTSCRIPT_PACKAGES" );
+ QString s2 = project->customSetting( "QUICK_PACKAGES" );
+ if ( !s.isEmpty() && !s2.isEmpty() )
+#if defined(Q_OS_WIN32)
+ s += ";";
+#else
+ s += ":";
+#endif
+ s += s2;
+ return s;
+ }
+ return project->customSetting( key );
+}
+
+DesignerPixmapCollection *DesignerProjectImpl::pixmapCollection() const
+{
+ return project->pixmapCollection()->iFace();
+}
+
+void DesignerProjectImpl::breakPoints( QMap<QString, QValueList<uint> > &bps ) const
+{
+ MainWindow::self->saveAllBreakPoints();
+ for ( QPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ bps.insert( project->makeRelative( f->fileName() ) + " <Source-File>", MetaDataBase::breakPoints( f ) );
+ }
+ for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( forms.current()->formWindow() )
+ bps.insert( QString( forms.current()->formWindow()->name() ) + " <Form>", MetaDataBase::breakPoints( forms.current()->formWindow() ) );
+ }
+}
+
+QString DesignerProjectImpl::breakPointCondition( QObject *o, int line ) const
+{
+ return MetaDataBase::breakPointCondition( MainWindow::self->findRealObject( o ), line );
+}
+
+void DesignerProjectImpl::setBreakPointCondition( QObject *o, int line, const QString &condition )
+{
+ MetaDataBase::setBreakPointCondition( MainWindow::self->findRealObject( o ), line, condition );
+}
+
+void DesignerProjectImpl::clearAllBreakpoints() const
+{
+ QValueList<uint> empty;
+ for ( QPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ MetaDataBase::setBreakPoints( f, empty );
+ }
+ for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ if ( forms.current()->formWindow() )
+ MetaDataBase::setBreakPoints( forms.current()->formWindow(), empty );
+ MainWindow::self->resetBreakPoints();
+ }
+}
+
+void DesignerProjectImpl::setIncludePath( const QString &platform, const QString &path )
+{
+ project->setIncludePath( platform, path );
+}
+
+void DesignerProjectImpl::setLibs( const QString &platform, const QString &path )
+{
+ project->setLibs( platform, path );
+}
+
+void DesignerProjectImpl::setDefines( const QString &platform, const QString &path )
+{
+ project->setDefines( platform, path );
+}
+
+void DesignerProjectImpl::setConfig( const QString &platform, const QString &config )
+{
+ project->setConfig( platform, config );
+}
+
+void DesignerProjectImpl::setTemplate( const QString &t )
+{
+ project->setTemplate( t );
+}
+
+QString DesignerProjectImpl::config( const QString &platform ) const
+{
+ return project->config( platform );
+}
+
+QString DesignerProjectImpl::libs( const QString &platform ) const
+{
+ return project->libs( platform );
+}
+
+QString DesignerProjectImpl::defines( const QString &platform ) const
+{
+ return project->defines( platform );
+}
+
+QString DesignerProjectImpl::includePath( const QString &platform ) const
+{
+ return project->includePath( platform );
+}
+
+QString DesignerProjectImpl::templte() const
+{
+ return project->templte();
+}
+
+bool DesignerProjectImpl::isGenericObject( QObject *o ) const
+{
+ return !!project->fakeFormFileFor( o );
+}
+
+
+
+
+
+
+
+#ifndef QT_NO_SQL
+DesignerDatabaseImpl::DesignerDatabaseImpl( DatabaseConnection *d )
+ : db( d )
+{
+}
+
+QString DesignerDatabaseImpl::name() const
+{
+ return db->name();
+}
+
+void DesignerDatabaseImpl::setName( const QString & )
+{
+}
+
+QString DesignerDatabaseImpl::driver() const
+{
+ return db->driver();
+}
+
+void DesignerDatabaseImpl::setDriver( const QString & )
+{
+}
+
+QString DesignerDatabaseImpl::database() const
+{
+ return db->database();
+}
+
+void DesignerDatabaseImpl::setDatabase( const QString & )
+{
+}
+
+QString DesignerDatabaseImpl::userName() const
+{
+ return db->username();
+}
+
+void DesignerDatabaseImpl::setUserName( const QString & )
+{
+}
+
+QString DesignerDatabaseImpl::password() const
+{
+ return db->password();
+}
+
+void DesignerDatabaseImpl::setPassword( const QString & )
+{
+}
+
+QString DesignerDatabaseImpl::hostName() const
+{
+ return db->hostname();
+}
+
+void DesignerDatabaseImpl::setHostName( const QString & )
+{
+}
+
+QStringList DesignerDatabaseImpl::tables() const
+{
+ return db->tables();
+}
+
+QMap<QString, QStringList> DesignerDatabaseImpl::fields() const
+{
+ return db->fields();
+}
+
+void DesignerDatabaseImpl::open( bool suppressDialog ) const
+{
+ db->open( suppressDialog );
+}
+
+void DesignerDatabaseImpl::close() const
+{
+ db->close();
+}
+
+void DesignerDatabaseImpl::setFields( const QMap<QString, QStringList> & )
+{
+}
+
+void DesignerDatabaseImpl::setTables( const QStringList & )
+{
+}
+
+QSqlDatabase* DesignerDatabaseImpl::connection()
+{
+ return db->connection();
+}
+#endif
+
+
+
+DesignerPixmapCollectionImpl::DesignerPixmapCollectionImpl( PixmapCollection *coll )
+ : pixCollection( coll )
+{
+}
+
+void DesignerPixmapCollectionImpl::addPixmap( const QPixmap &p, const QString &name, bool force )
+{
+ PixmapCollection::Pixmap pix;
+ pix.pix = p;
+ pix.name = name;
+ pixCollection->addPixmap( pix, force );
+ FormWindow *fw = MainWindow::self->formWindow();
+ if ( fw )
+ MetaDataBase::setPixmapKey( fw, p.serialNumber(), name );
+}
+
+QPixmap DesignerPixmapCollectionImpl::pixmap( const QString &name ) const
+{
+ return pixCollection->pixmap( name );
+}
+
+
+
+DesignerFormWindowImpl::DesignerFormWindowImpl( FormWindow *fw )
+ : formWindow( fw )
+{
+}
+
+QString DesignerFormWindowImpl::name() const
+{
+ return formWindow->name();
+ }
+
+void DesignerFormWindowImpl::setName( const QString &n )
+{
+ formWindow->setName( n );
+}
+
+QString DesignerFormWindowImpl::fileName() const
+{
+ return formWindow->fileName();
+}
+
+void DesignerFormWindowImpl::setFileName( const QString & )
+{
+}
+
+void DesignerFormWindowImpl::save() const
+{
+}
+
+bool DesignerFormWindowImpl::isModified() const
+{
+ return formWindow->commandHistory()->isModified();
+}
+
+void DesignerFormWindowImpl::insertWidget( QWidget * )
+{
+}
+
+QWidget *DesignerFormWindowImpl::create( const char *className, QWidget *parent, const char *name )
+{
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, name );
+ formWindow->insertWidget( w, TRUE );
+ formWindow->killAccels( formWindow->mainContainer() );
+ return w;
+}
+
+void DesignerFormWindowImpl::removeWidget( QWidget * )
+{
+}
+
+QWidgetList DesignerFormWindowImpl::widgets() const
+{
+ return QWidgetList();
+}
+
+void DesignerFormWindowImpl::undo()
+{
+}
+
+void DesignerFormWindowImpl::redo()
+{
+}
+
+void DesignerFormWindowImpl::cut()
+{
+}
+
+void DesignerFormWindowImpl::copy()
+{
+}
+
+void DesignerFormWindowImpl::paste()
+{
+}
+
+void DesignerFormWindowImpl::adjustSize()
+{
+}
+
+void DesignerFormWindowImpl::editConnections()
+{
+}
+
+void DesignerFormWindowImpl::checkAccels()
+{
+}
+
+void DesignerFormWindowImpl::layoutH()
+{
+ formWindow->layoutHorizontal();
+}
+
+void DesignerFormWindowImpl::layoutV()
+{
+}
+
+void DesignerFormWindowImpl::layoutHSplit()
+{
+}
+
+void DesignerFormWindowImpl::layoutVSplit()
+{
+}
+
+void DesignerFormWindowImpl::layoutG()
+{
+ formWindow->layoutGrid();
+}
+
+void DesignerFormWindowImpl::layoutHContainer( QWidget* w )
+{
+ formWindow->layoutHorizontalContainer( w );
+}
+
+void DesignerFormWindowImpl::layoutVContainer( QWidget* w )
+{
+ formWindow->layoutVerticalContainer( w );
+}
+
+void DesignerFormWindowImpl::layoutGContainer( QWidget* w )
+{
+ formWindow->layoutGridContainer( w );
+}
+
+void DesignerFormWindowImpl::breakLayout()
+{
+}
+
+void DesignerFormWindowImpl::selectWidget( QWidget * w )
+{
+ formWindow->selectWidget( w, TRUE );
+}
+
+void DesignerFormWindowImpl::selectAll()
+{
+}
+
+void DesignerFormWindowImpl::clearSelection()
+{
+ formWindow->clearSelection();
+}
+
+bool DesignerFormWindowImpl::isWidgetSelected( QWidget * ) const
+{
+ return FALSE;
+}
+
+QWidgetList DesignerFormWindowImpl::selectedWidgets() const
+{
+ return formWindow->selectedWidgets();
+}
+
+QWidget *DesignerFormWindowImpl::currentWidget() const
+{
+ return formWindow->currentWidget();
+}
+
+QWidget *DesignerFormWindowImpl::form() const
+{
+ return formWindow;
+}
+
+
+void DesignerFormWindowImpl::setCurrentWidget( QWidget * )
+{
+}
+
+QPtrList<QAction> DesignerFormWindowImpl::actionList() const
+{
+ return QPtrList<QAction>();
+}
+
+QAction *DesignerFormWindowImpl::createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
+ QObject* parent, const char* name, bool toggle )
+{
+ QDesignerAction *a = new QDesignerAction( parent );
+ a->setName( name );
+ a->setText( text );
+ if ( !icon.isNull() && !icon.pixmap().isNull() )
+ a->setIconSet( icon );
+ a->setMenuText( menuText );
+ a->setAccel( accel );
+ a->setToggleAction( toggle );
+ return a;
+}
+
+void DesignerFormWindowImpl::addAction( QAction *a )
+{
+ if ( formWindow->actionList().findRef( a ) != -1 )
+ return;
+ formWindow->actionList().append( a );
+ MetaDataBase::addEntry( a );
+ setPropertyChanged( a, "name", TRUE );
+ setPropertyChanged( a, "text", TRUE );
+ setPropertyChanged( a, "menuText", TRUE );
+ setPropertyChanged( a, "accel", TRUE );
+ if ( !a->iconSet().isNull() && !a->iconSet().pixmap().isNull() )
+ setPropertyChanged( a, "iconSet", TRUE );
+}
+
+void DesignerFormWindowImpl::removeAction( QAction *a )
+{
+ formWindow->actionList().removeRef( a );
+}
+
+void DesignerFormWindowImpl::preview() const
+{
+}
+
+void DesignerFormWindowImpl::addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot )
+{
+ MetaDataBase::addConnection( formWindow, sender, signal, receiver, slot );
+}
+
+void DesignerFormWindowImpl::addFunction( const QCString &function, const QString &specifier,
+ const QString &access, const QString &type,
+ const QString &language, const QString &returnType )
+{
+ MetaDataBase::addFunction( formWindow, function, specifier, access, type, language, returnType );
+ formWindow->mainWindow()->functionsChanged();
+}
+
+
+
+void DesignerFormWindowImpl::setProperty( QObject *o, const char *property, const QVariant &value )
+{
+ int id = o->metaObject()->findProperty( property, TRUE );
+ const QMetaProperty* p = o->metaObject()->property( id, TRUE );
+ if ( p && p->isValid() )
+ o->setProperty( property, value );
+ else
+ MetaDataBase::setFakeProperty( o, property, value );
+}
+
+QVariant DesignerFormWindowImpl::property( QObject *o, const char *prop ) const
+{
+ int id = o->metaObject()->findProperty( prop, TRUE );
+ const QMetaProperty* p = o->metaObject()->property( id, TRUE );
+ if ( p && p->isValid() )
+ return o->property( prop );
+ return MetaDataBase::fakeProperty( o, prop );
+}
+
+void DesignerFormWindowImpl::setPropertyChanged( QObject *o, const char *property, bool changed )
+{
+ MetaDataBase::setPropertyChanged( o, property, changed );
+}
+
+bool DesignerFormWindowImpl::isPropertyChanged( QObject *o, const char *property ) const
+{
+ return MetaDataBase::isPropertyChanged( o, property );
+}
+
+void DesignerFormWindowImpl::setColumnFields( QObject *o, const QMap<QString, QString> &f )
+{
+ MetaDataBase::setColumnFields( o, f );
+}
+
+QStringList DesignerFormWindowImpl::implementationIncludes() const
+{
+ QValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formWindow );
+ QStringList lst;
+ for ( QValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl != "in implementation" )
+ continue;
+ QString s = inc.header;
+ if ( inc.location == "global" ) {
+ s.prepend( "<" );
+ s.append( ">" );
+ } else {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ lst << s;
+ }
+ return lst;
+}
+
+QStringList DesignerFormWindowImpl::declarationIncludes() const
+{
+ QValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formWindow );
+ QStringList lst;
+ for ( QValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in implementation" )
+ continue;
+ QString s = inc.header;
+ if ( inc.location == "global" ) {
+ s.prepend( "<" );
+ s.append( ">" );
+ } else {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ lst << s;
+ }
+ return lst;
+}
+
+void DesignerFormWindowImpl::setImplementationIncludes( const QStringList &lst )
+{
+ QValueList<MetaDataBase::Include> oldIncludes = MetaDataBase::includes( formWindow );
+ QValueList<MetaDataBase::Include> includes;
+ for ( QValueList<MetaDataBase::Include>::Iterator it = oldIncludes.begin(); it != oldIncludes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in implementation" )
+ continue;
+ includes << inc;
+ }
+
+ for ( QStringList::ConstIterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ QString s = *sit;
+ if ( s.startsWith( "#include" ) )
+ s.remove( (uint)0, 8 );
+ s = s.simplifyWhiteSpace();
+ if ( s[ 0 ] != '<' && s[ 0 ] != '"' ) {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ if ( s[ 0 ] == '<' ) {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in implementation";
+ inc.location = "global";
+ includes << inc;
+ } else {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in implementation";
+ inc.location = "local";
+ includes << inc;
+ }
+ }
+ MetaDataBase::setIncludes( formWindow, includes );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+void DesignerFormWindowImpl::setDeclarationIncludes( const QStringList &lst )
+{
+ QValueList<MetaDataBase::Include> oldIncludes = MetaDataBase::includes( formWindow );
+ QValueList<MetaDataBase::Include> includes;
+ for ( QValueList<MetaDataBase::Include>::Iterator it = oldIncludes.begin(); it != oldIncludes.end(); ++it ) {
+ MetaDataBase::Include inc = *it;
+ if ( inc.implDecl == "in declaration" )
+ continue;
+ includes << inc;
+ }
+
+ for ( QStringList::ConstIterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ QString s = *sit;
+ if ( s.startsWith( "#include" ) )
+ s.remove( (uint)0, 8 );
+ s = s.simplifyWhiteSpace();
+ if ( s[ 0 ] != '<' && s[ 0 ] != '"' ) {
+ s.prepend( "\"" );
+ s.append( "\"" );
+ }
+ if ( s[ 0 ] == '<' ) {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in declaration";
+ inc.location = "global";
+ includes << inc;
+ } else {
+ s.remove( (uint)0, 1 );
+ s.remove( s.length() - 1, 1 );
+ MetaDataBase::Include inc;
+ inc.header = s;
+ inc.implDecl = "in declaration";
+ inc.location = "local";
+ includes << inc;
+ }
+ }
+ MetaDataBase::setIncludes( formWindow, includes );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+QStringList DesignerFormWindowImpl::forwardDeclarations() const
+{
+ return MetaDataBase::forwards( formWindow );
+}
+
+void DesignerFormWindowImpl::setForwardDeclarations( const QStringList &lst )
+{
+ MetaDataBase::setForwards( formWindow, lst );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+QStringList DesignerFormWindowImpl::signalList() const
+{
+ return MetaDataBase::signalList( formWindow );
+}
+
+void DesignerFormWindowImpl::setSignalList( const QStringList &lst )
+{
+ MetaDataBase::setSignalList( formWindow, lst );
+ formWindow->mainWindow()->objectHierarchy()->formDefinitionView()->setup();
+}
+
+void DesignerFormWindowImpl::onModificationChange( QObject *receiver, const char *slot )
+{
+ QObject::connect( formWindow, SIGNAL( modificationChanged( bool, FormWindow * ) ), receiver, slot );
+}
+
+void DesignerFormWindowImpl::addMenu( const QString &text, const QString &name )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ PopupMenuEditor *popup = new PopupMenuEditor( formWindow, mw );
+ QString n = name;
+ formWindow->unify( popup, n, TRUE );
+ popup->setName( n );
+ MenuBarEditor *mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+ if ( !mb ) {
+ mb = new MenuBarEditor( formWindow, mw );
+ mb->setName( "MenuBar" );
+ MetaDataBase::addEntry( mb );
+ }
+ mb->insertItem( text, popup );
+ MetaDataBase::addEntry( popup );
+}
+
+void DesignerFormWindowImpl::addMenuAction( const QString &menu, QAction *a )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ if ( !mw->child( 0, "MenuBarEditor" ) )
+ return;
+ PopupMenuEditor *popup = (PopupMenuEditor*)mw->child( menu, "PopupMenuEditor" );
+ if ( !popup )
+ return;
+ popup->insert( a );
+}
+
+void DesignerFormWindowImpl::addMenuSeparator( const QString &menu )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ if ( !mw->child( 0, "MenuBarEditor" ) )
+ return;
+ PopupMenuEditor *popup = (PopupMenuEditor*)mw->child( menu, "PopupMenuEditor" );
+ if ( !popup )
+ return;
+ QAction *a = new QSeparatorAction( 0 );
+ popup->insert( a );
+}
+
+void DesignerFormWindowImpl::addToolBar( const QString &text, const QString &name )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ QToolBar *tb = new QDesignerToolBar( mw );
+ QString n = name;
+ formWindow->unify( tb, n, TRUE );
+ tb->setName( n );
+ mw->addToolBar( tb, text );
+}
+
+void DesignerFormWindowImpl::addToolBarAction( const QString &tbn, QAction *a )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" );
+ if ( !tb )
+ return;
+ a->addTo( tb );
+ tb->addAction( a );
+}
+
+void DesignerFormWindowImpl::addToolBarSeparator( const QString &tbn )
+{
+ if ( !::qt_cast<QMainWindow*>(formWindow->mainContainer()) )
+ return;
+ QMainWindow *mw = (QMainWindow*)formWindow->mainContainer();
+ QDesignerToolBar *tb = (QDesignerToolBar*)mw->child( tbn, "QDesignerToolBar" );
+ if ( !tb )
+ return;
+ QAction *a = new QSeparatorAction( 0 );
+ a->addTo( tb );
+ tb->addAction( a );
+}
+
+DesignerDockImpl::DesignerDockImpl()
+{
+}
+
+QDockWindow *DesignerDockImpl::dockWindow() const
+{
+ return 0;
+}
+
+DesignerOutputDockImpl::DesignerOutputDockImpl( OutputWindow *ow )
+ : outWin( ow )
+{
+}
+
+QWidget *DesignerOutputDockImpl::addView( const QString &title )
+{
+ QWidget *page = new QWidget( outWin );
+ outWin->addTab( page, title );
+ return page;
+}
+
+void DesignerOutputDockImpl::appendDebug( const QString &s )
+{
+ outWin->appendDebug( s );
+}
+
+void DesignerOutputDockImpl::clearDebug()
+{
+}
+
+void DesignerOutputDockImpl::appendError( const QString &s, int l )
+{
+ QStringList ls;
+ ls << s;
+ QValueList<uint> ll;
+ ll << l;
+ outWin->setErrorMessages( ls, ll, FALSE, QStringList(), QObjectList() );
+}
+
+void DesignerOutputDockImpl::clearError()
+{
+}
+
+DesignerSourceFileImpl::DesignerSourceFileImpl( SourceFile *e )
+ : ed( e )
+{
+}
+
+QString DesignerSourceFileImpl::fileName() const
+{
+ return ed->fileName();
+}
diff --git a/kdevdesigner/designer/designerappiface.h b/kdevdesigner/designer/designerappiface.h
new file mode 100644
index 00000000..a9eace16
--- /dev/null
+++ b/kdevdesigner/designer/designerappiface.h
@@ -0,0 +1,277 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DESIGNERAPPIFACE_H
+#define DESIGNERAPPIFACE_H
+
+#include "../interfaces/designerinterface.h"
+#include "project.h"
+
+class FormWindow;
+class MainWindow;
+class Project;
+class OutputWindow;
+class SourceFile;
+
+class DesignerInterfaceImpl : public DesignerInterface
+{
+public:
+ DesignerInterfaceImpl( MainWindow *mw );
+
+ DesignerProject *currentProject() const;
+ DesignerFormWindow *currentForm() const;
+ DesignerSourceFile *currentSourceFile() const;
+ QPtrList<DesignerProject> projectList() const;
+ void showStatusMessage( const QString &, int ms = 0 ) const;
+ DesignerDock *createDock() const;
+ DesignerOutputDock *outputDock() const;
+ void setModified( bool b, QWidget *window );
+ void updateFunctionList();
+
+ void onProjectChange( QObject *receiver, const char *slot );
+ void onFormChange( QObject *receiver, const char *slot );
+
+ bool singleProjectMode() const;
+ void showError( QWidget *widget, int line, const QString &message );
+ void runFinished();
+ void showStackFrame( QWidget *w, int line );
+ void showDebugStep( QWidget *w, int line );
+ void runProjectPrecondition();
+ void runProjectPostcondition( QObjectList *l );
+
+
+ QRESULT queryInterface( const QUuid &uuid, QUnknownInterface** iface );
+ Q_REFCOUNT
+
+private:
+ MainWindow *mainWindow;
+
+};
+
+class DesignerProjectImpl: public DesignerProject
+{
+public:
+ DesignerProjectImpl( Project *pr );
+
+ QPtrList<DesignerFormWindow> formList() const;
+ QStringList formNames() const;
+ QString formFileName( const QString &form ) const;
+ void addForm( DesignerFormWindow * );
+ void removeForm( DesignerFormWindow * );
+ QString fileName() const;
+ void setFileName( const QString & );
+ QString projectName() const;
+ void setProjectName( const QString & );
+ QString databaseFile() const;
+ void setDatabaseFile( const QString & );
+ void setupDatabases() const;
+ QPtrList<DesignerDatabase> databaseConnections() const;
+ void addDatabase( DesignerDatabase * );
+ void removeDatabase( DesignerDatabase * );
+ void save() const;
+ void setLanguage( const QString & );
+ QString language() const;
+ void setCustomSetting( const QString &key, const QString &value );
+ QString customSetting( const QString &key ) const;
+ DesignerPixmapCollection *pixmapCollection() const;
+ void breakPoints( QMap<QString, QValueList<uint> > &bps ) const;
+ QString breakPointCondition( QObject *o, int line ) const;
+ void setBreakPointCondition( QObject *o, int line, const QString &condition );
+ void clearAllBreakpoints() const;
+ void setIncludePath( const QString &platform, const QString &path );
+ void setLibs( const QString &platform, const QString &path );
+ void setDefines( const QString &platform, const QString &path );
+ void setConfig( const QString &platform, const QString &config );
+ void setTemplate( const QString &t );
+ QString config( const QString &platform ) const;
+ QString libs( const QString &platform ) const;
+ QString defines( const QString &platform ) const;
+ QString includePath( const QString &platform ) const;
+ QString templte() const;
+ bool isGenericObject( QObject *o ) const;
+
+private:
+ Project *project;
+
+};
+
+#ifndef QT_NO_SQL
+class QSqlDatabase;
+
+class DesignerDatabaseImpl: public DesignerDatabase
+{
+public:
+ DesignerDatabaseImpl( DatabaseConnection *d );
+
+ QString name() const;
+ void setName( const QString & );
+ QString driver() const;
+ void setDriver( const QString & );
+ QString database() const;
+ void setDatabase( const QString & );
+ QString userName() const;
+ void setUserName( const QString & );
+ QString password() const;
+ void setPassword( const QString & );
+ QString hostName() const;
+ void setHostName( const QString & );
+ QStringList tables() const;
+ void setTables( const QStringList & );
+ QMap<QString, QStringList> fields() const;
+ void setFields( const QMap<QString, QStringList> & );
+ void open( bool suppressDialog = TRUE ) const;
+ void close() const;
+ QSqlDatabase* connection();
+private:
+ DatabaseConnection *db;
+
+};
+#endif
+
+class DesignerPixmapCollectionImpl : public DesignerPixmapCollection
+{
+public:
+ DesignerPixmapCollectionImpl( PixmapCollection *coll );
+ void addPixmap( const QPixmap &p, const QString &name, bool force );
+ QPixmap pixmap( const QString &name ) const;
+
+private:
+ PixmapCollection *pixCollection;
+
+};
+
+class DesignerFormWindowImpl: public DesignerFormWindow
+{
+public:
+ DesignerFormWindowImpl( FormWindow *fw );
+
+ QString name() const;
+ void setName( const QString &n );
+ QString fileName() const;
+ void setFileName( const QString & );
+ void save() const;
+ bool isModified() const;
+ void insertWidget( QWidget * );
+ QWidget *create( const char *className, QWidget *parent, const char *name );
+ void removeWidget( QWidget * );
+ QWidgetList widgets() const;
+ void undo();
+ void redo();
+ void cut();
+ void copy();
+ void paste();
+ void adjustSize();
+ void editConnections();
+ void checkAccels();
+ void layoutH();
+ void layoutV();
+ void layoutHSplit();
+ void layoutVSplit();
+ void layoutG();
+ void layoutHContainer( QWidget* w );
+ void layoutVContainer( QWidget* w );
+ void layoutGContainer( QWidget* w );
+ void breakLayout();
+ void selectWidget( QWidget * );
+ void selectAll();
+ void clearSelection();
+ bool isWidgetSelected( QWidget * ) const;
+ QWidgetList selectedWidgets() const;
+ QWidget *currentWidget() const;
+ QWidget *form() const;
+ void setCurrentWidget( QWidget * );
+ QPtrList<QAction> actionList() const;
+ QAction *createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
+ QObject* parent, const char* name = 0, bool toggle = FALSE );
+ void addAction( QAction * );
+ void removeAction( QAction * );
+ void preview() const;
+ void addFunction( const QCString &function, const QString& specifier, const QString &access,
+ const QString &type, const QString &language, const QString &returnType );
+ void addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot );
+ void setProperty( QObject *o, const char *property, const QVariant &value );
+ QVariant property( QObject *o, const char *property ) const;
+ void setPropertyChanged( QObject *o, const char *property, bool changed );
+ bool isPropertyChanged( QObject *o, const char *property ) const;
+ void setColumnFields( QObject *o, const QMap<QString, QString> & );
+ QStringList implementationIncludes() const;
+ QStringList declarationIncludes() const;
+ void setImplementationIncludes( const QStringList &lst );
+ void setDeclarationIncludes( const QStringList &lst );
+ QStringList forwardDeclarations() const;
+ void setForwardDeclarations( const QStringList &lst );
+ QStringList signalList() const;
+ void setSignalList( const QStringList &lst );
+ void addMenu( const QString &text, const QString &name );
+ void addMenuAction( const QString &menu, QAction *a );
+ void addMenuSeparator( const QString &menu );
+ void addToolBar( const QString &text, const QString &name );
+ void addToolBarAction( const QString &tb, QAction *a );
+ void addToolBarSeparator( const QString &tb );
+
+ void onModificationChange( QObject *receiver, const char *slot );
+
+private:
+ FormWindow *formWindow;
+
+};
+
+class DesignerDockImpl: public DesignerDock
+{
+public:
+ DesignerDockImpl();
+
+ QDockWindow *dockWindow() const;
+};
+
+class DesignerOutputDockImpl: public DesignerOutputDock
+{
+public:
+ DesignerOutputDockImpl( OutputWindow *ow );
+
+ QWidget *addView( const QString &pageName );
+ void appendDebug( const QString & );
+ void clearDebug();
+ void appendError( const QString &, int );
+ void clearError();
+
+private:
+ OutputWindow *outWin;
+
+};
+
+class DesignerSourceFileImpl : public DesignerSourceFile
+{
+public:
+ DesignerSourceFileImpl( SourceFile *e );
+ QString fileName() const;
+
+private:
+ SourceFile *ed;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/editfunctions.ui b/kdevdesigner/designer/editfunctions.ui
new file mode 100644
index 00000000..2cecdcb1
--- /dev/null
+++ b/kdevdesigner/designer/editfunctions.ui
@@ -0,0 +1,714 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>EditFunctionsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditFunctionsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>371</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Functions</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Functions&lt;/b&gt;&lt;p&gt;Add, edit or delete the current form's slots or functions.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;Add Function&lt;/b&gt;-button to create a new function; enter a name, choose an access mode and specify if it should be a slot or normal function.&lt;/p&gt;&lt;p&gt;Select an entry from the list and click the &lt;b&gt;Delete Function&lt;/b&gt;-button to remove a function; in case of a slot all connections using this slot will also be removed.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Function</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Return Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Specifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>In Use</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>functionListView</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="showSortIndicator">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;This form's functions.&lt;/b&gt;&lt;p&gt;Select the function you want to change or delete.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showOnlySlots</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="text">
+ <string>Only d&amp;isplay slots</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change displaying mode for functions</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Check this button if only the slots should be displayed&lt;/b&gt;&lt;p&gt;Otherwise all functions, i.e. normal C++ functions and slots are displayed.&lt;/p&gt;
+</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Vertical Spacing1</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addFunction</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Function</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new function.&lt;/b&gt;&lt;p&gt;New functions have a default name and public access.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>deleteFunction</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Function</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected function.&lt;/b&gt;&lt;p&gt;All connections using this function are also removed.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>boxProperties</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Function Properties</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>Label8</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Function:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>functionName</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the name of the selected function.&lt;/b&gt;&lt;p&gt;The name should include the argument list and must be syntactically correct.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelType</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Return type:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editType</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>editType</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change the return type of the function</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the return type of the selected function.&lt;/b&gt;&lt;p&gt;Specifiy here the datatype which should be returned by the function.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>Label9_2</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;pecifier:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionSpecifier</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>non virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>pure virtual</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>static</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionSpecifier</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the access policy of the function&lt;/b&gt;&lt;p&gt;All functions are created virtual and should be reimplemented in subclasses.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Access:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionAccess</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>private</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionAccess</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function access</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the access policy of the function&lt;/b&gt;&lt;p&gt;All functions are created virtual and should be reimplemented in subclasses.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Type:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>functionType</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>slot</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>function</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>functionType</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change function type</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the type of the function.&lt;/b&gt;&lt;p&gt;The type specifies if the function is either a slot or a normal C++ function.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer5</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>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>deleteFunction</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>functionRemove()</slot>
+ </connection>
+ <connection>
+ <sender>addFunction</sender>
+ <signal>clicked()</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>functionAdd()</slot>
+ </connection>
+ <connection>
+ <sender>functionName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionListView</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>functionListView</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>editType</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentReturnTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionSpecifier</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentSpecifierChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionAccess</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentAccessChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>functionType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>currentTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>showOnlySlots</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>EditFunctionsBase</receiver>
+ <slot>displaySlots(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>functionName</tabstop>
+ <tabstop>editType</tabstop>
+ <tabstop>functionSpecifier</tabstop>
+ <tabstop>functionAccess</tabstop>
+ <tabstop>functionType</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ <tabstop>functionListView</tabstop>
+ <tabstop>showOnlySlots</tabstop>
+ <tabstop>addFunction</tabstop>
+ <tabstop>deleteFunction</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">currentItemChanged( QListViewItem * )</slot>
+ <slot access="protected">currentSpecifierChanged( const QString &amp; )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">currentReturnTypeChanged( const QString &amp; )</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">init()</slot>
+ <slot access="protected">currentAccessChanged( const QString &amp; )</slot>
+ <slot access="protected">currentTypeChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">functionAdd()</slot>
+ <slot access="protected">functionRemove()</slot>
+ <slot access="protected">displaySlots( bool )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/editfunctionsimpl.cpp b/kdevdesigner/designer/editfunctionsimpl.cpp
new file mode 100644
index 00000000..19506e22
--- /dev/null
+++ b/kdevdesigner/designer/editfunctionsimpl.cpp
@@ -0,0 +1,534 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "editfunctionsimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "project.h"
+
+#include <kiconloader.h>
+#include <klineedit.h>
+#include "kdevdesigner_part.h"
+
+#include <qlistview.h>
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qstrlist.h>
+#include <qmessagebox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qgroupbox.h>
+#include <qheader.h>
+#include <qcheckbox.h>
+
+#include <klocale.h>
+
+EditFunctions::EditFunctions( QWidget *parent, FormWindow *fw, bool justSlots )
+ : EditFunctionsBase( parent, 0, TRUE ), formWindow( fw )
+{
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+
+ id = 0;
+ functList.clear();
+
+ QValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( fw );
+ for ( QValueList<MetaDataBase::Function>::Iterator it = functionList.begin(); it != functionList.end(); ++it ) {
+ QListViewItem *i = new QListViewItem( functionListView );
+
+ i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) );
+ i->setText( 0, (*it).function );
+ i->setText( 1, (*it).returnType );
+ i->setText( 2, (*it).specifier );
+ i->setText( 3, (*it).access );
+ i->setText( 4, (*it).type );
+
+ FunctItem fui;
+ fui.id = id;
+ fui.oldName = (*it).function;
+ fui.newName = fui.oldName;
+ fui.oldRetTyp = (*it).returnType;
+ fui.retTyp = fui.oldRetTyp;
+ fui.oldSpec = (*it).specifier;
+ fui.spec = fui.oldSpec;
+ fui.oldAccess = (*it).access;
+ fui.access = fui.oldAccess;
+ fui.oldType = (*it).type;
+ fui.type = fui.oldType;
+ functList.append( fui );
+
+ functionIds.insert( i, id );
+ id++;
+
+ if ( (*it).type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( (*it).function ).latin1() ) )
+ i->setText( 5, i18n( "Yes" ) );
+ else
+ i->setText( 5, i18n( "No" ) );
+ } else {
+ i->setText( 5, "---" );
+ }
+ }
+
+ boxProperties->setEnabled( FALSE );
+ functionName->setValidator( new AsciiValidator( TRUE, functionName ) );
+
+ if ( functionListView->firstChild() )
+ functionListView->setCurrentItem( functionListView->firstChild() );
+
+ showOnlySlots->setChecked( justSlots );
+ lastType = "function";
+
+ // Enable rename for all QListViewItems
+ QListViewItemIterator lvit = functionListView->firstChild();
+ for ( ; *lvit; lvit++ )
+ (*lvit)->setRenameEnabled( 0, TRUE );
+
+ // Connect listview signal to signal-relay
+ QObject::connect( functionListView,
+ SIGNAL( itemRenamed( QListViewItem*, int, const QString & ) ),
+ this,
+ SLOT( emitItemRenamed(QListViewItem*, int, const QString&) ) );
+
+ // Connect signal-relay to QLineEdit "functionName"
+ QObjectList *l = parent->queryList( "QLineEdit", "functionName" );
+ QObject *obj;
+ QObjectListIt itemsLineEditIt( *l );
+ while ( (obj = itemsLineEditIt.current()) != 0 ) {
+ ++itemsLineEditIt;
+ QObject::connect( this,
+ SIGNAL( itemRenamed( const QString & ) ),
+ obj,
+ SLOT( setText( const QString & ) ) );
+ }
+ delete l;
+}
+
+void EditFunctions::okClicked()
+{
+ QValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
+ QString n = i18n( "Add/Remove functions of '%1'" ).arg( formWindow->name() );
+ QPtrList<Command> commands;
+ QValueList<MetaDataBase::Function>::Iterator fit;
+ if ( !functionList.isEmpty() ) {
+ for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) {
+ bool functionFound = FALSE;
+ QValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).oldName ) ==
+ MetaDataBase::normalizeFunction( (*fit).function ) ) {
+ functionFound = TRUE;
+ break;
+ }
+ }
+ if ( !functionFound )
+ commands.append( new RemoveFunctionCommand( i18n( "Remove Function" ),
+ formWindow, (*fit).function, (*fit).specifier,
+ (*fit).access,
+ (*fit).type,
+ formWindow->project()->language(),
+ (*fit).returnType ) );
+ }
+ }
+
+ bool invalidFunctions = FALSE;
+ QValueList<FunctItem> invalidItems;
+
+ if ( !functList.isEmpty() ) {
+ QStrList lst;
+ QValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ MetaDataBase::Function function;
+ function.function = (*it).newName;
+ function.returnType = (*it).retTyp;
+ function.specifier = (*it).spec;
+ function.access = (*it).access;
+ function.type = (*it).type;
+ function.language = formWindow->project()->language();
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ QString s = function.function;
+ s = s.simplifyWhiteSpace();
+ bool startNum = s[ 0 ] >= '0' && s[ 0 ] <= '9';
+ bool noParens = s.contains( '(' ) != 1 || s.contains( ')' ) != 1;
+ bool illegalSpace = s.find( ' ' ) != -1 && s.find( ' ' ) < s.find( '(' );
+
+ if ( startNum || noParens || illegalSpace || lst.find( function.function ) != -1 ) {
+ invalidFunctions = TRUE;
+ invalidItems.append( (*it) );
+ continue;
+ }
+ bool functionFound = FALSE;
+ for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) {
+ if ( MetaDataBase::normalizeFunction( (*fit).function ) ==
+ MetaDataBase::normalizeFunction( (*it).oldName ) ) {
+ functionFound = TRUE;
+ break;
+ }
+ }
+ if ( !functionFound )
+ commands.append( new AddFunctionCommand( i18n( "Add Function" ),
+ formWindow, function.function, function.specifier,
+ function.access,
+ function.type, formWindow->project()->language(),
+ function.returnType ) );
+ if ( MetaDataBase::normalizeFunction( (*it).newName ) != MetaDataBase::normalizeFunction( (*it).oldName ) ||
+ (*it).spec != (*it).oldSpec || (*it).access != (*it).oldAccess || (*it).type != (*it).oldType ||
+ (*it).retTyp != (*it).oldRetTyp ) {
+ QString normalizedOldName = MetaDataBase::normalizeFunction( (*it).oldName );
+ if ((*it).oldName.endsWith("const")) // make sure we get the 'const' when we remove the old name
+ normalizedOldName += " const";
+ commands.append( new ChangeFunctionAttribCommand( i18n( "Change Function Attributes" ),
+ formWindow, function, normalizedOldName,
+ (*it).oldSpec, (*it).oldAccess, (*it).oldType,
+ formWindow->project()->language(), (*it).oldRetTyp ) );
+ }
+ lst.append( function.function );
+ }
+ }
+
+ if ( invalidFunctions ) {
+ if ( QMessageBox::information( this, i18n( "Edit Functions" ),
+ i18n( "Some syntactically incorrect functions have been defined.\n"
+ "Remove these functions?" ), i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) {
+ QValueList<FunctItem>::Iterator it = functList.begin();
+ while ( it != functList.end() ) {
+ bool found = FALSE;
+ QValueList<FunctItem>::Iterator vit = invalidItems.begin();
+ for ( ; vit != invalidItems.end(); ++vit ) {
+ if ( (*vit).newName == (*it).newName ) {
+ invalidItems.remove( vit );
+ found = TRUE;
+ break;
+ }
+ }
+ if ( found ) {
+ int delId = (*it).id;
+ it = functList.remove( it );
+ QMap<QListViewItem*, int>::Iterator fit = functionIds.begin();
+ while ( fit != functionIds.end() ) {
+ if ( *fit == delId ) {
+ QListViewItem *litem = fit.key();
+ functionIds.remove( fit );
+ delete litem;
+ if ( functionListView->currentItem() )
+ functionListView->setSelected( functionListView->currentItem(), TRUE );
+ currentItemChanged( functionListView->currentItem() );
+ break;
+ }
+ ++fit;
+ }
+ }
+ else
+ ++it;
+ }
+ if ( functionListView->firstChild() ) {
+ functionListView->setCurrentItem( functionListView->firstChild() );
+ functionListView->setSelected( functionListView->firstChild(), TRUE );
+ }
+ }
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ return;
+ }
+
+ if ( !commands.isEmpty() ) {
+ MacroCommand *cmd = new MacroCommand( n, formWindow, commands );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ accept();
+}
+
+void EditFunctions::functionAdd( const QString &access, const QString &type )
+{
+ QListViewItem *i = new QListViewItem( functionListView );
+ i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) );
+ i->setRenameEnabled( 0, TRUE );
+ i->setText( 1, "void" );
+ i->setText( 2, "virtual" );
+
+ if ( access.isEmpty() )
+ i->setText( 3, "public" );
+ else
+ i->setText( 3, access );
+
+ if( type.isEmpty() ) {
+ if ( showOnlySlots->isChecked() )
+ i->setText( 4, "slot" );
+ else {
+ i->setText( 4, lastType );
+ }
+ } else {
+ i->setText( 4, type );
+ }
+
+ if ( i->text( 4 ) == "slot" ) {
+ i->setText( 0, "newSlot()" );
+ if ( MetaDataBase::isSlotUsed( formWindow, "newSlot()" ) )
+ i->setText( 5, i18n( "Yes" ) );
+ else
+ i->setText( 5, i18n( "No" ) );
+ } else {
+ i->setText( 0, "newFunction()" );
+ i->setText( 5, "---" );
+ }
+
+ functionListView->setCurrentItem( i );
+ functionListView->setSelected( i, TRUE );
+ functionListView->ensureItemVisible( i );
+ functionName->setFocus();
+ functionName->selectAll();
+
+ FunctItem fui;
+ fui.id = id;
+ fui.oldName = i->text( 0 );
+ fui.newName = fui.oldName;
+ fui.oldRetTyp = i->text( 1 );
+ fui.retTyp = fui.oldRetTyp;
+ fui.oldSpec = i->text ( 2 );
+ fui.spec = fui.oldSpec;
+ fui.oldAccess = i->text( 3 );
+ fui.access = fui.oldAccess;
+ fui.oldType = i->text( 4 );
+ fui.type = fui.oldType;
+ lastType = fui.oldType;
+ functList.append( fui );
+ functionIds.insert( i, id );
+ id++;
+}
+
+void EditFunctions::functionRemove()
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ functionListView->blockSignals( TRUE );
+ removedFunctions << MetaDataBase::normalizeFunction( functionListView->currentItem()->text( 0 ) );
+ int delId = functionIds[ functionListView->currentItem() ];
+ QValueList<FunctItem>::Iterator it = functList.begin();
+ while ( it != functList.end() ) {
+ if ( (*it).id == delId ) {
+ functList.remove( it );
+ break;
+ }
+ ++it;
+ }
+ functionIds.remove( functionListView->currentItem() );
+ delete functionListView->currentItem();
+ if ( functionListView->currentItem() )
+ functionListView->setSelected( functionListView->currentItem(), TRUE );
+ functionListView->blockSignals( FALSE );
+ currentItemChanged( functionListView->currentItem() );
+}
+
+void EditFunctions::currentItemChanged( QListViewItem *i )
+{
+ functionName->blockSignals( TRUE );
+ functionName->setText( "" );
+ functionAccess->setCurrentItem( 0 );
+ functionName->blockSignals( FALSE );
+
+ if ( !i ) {
+ boxProperties->setEnabled( FALSE );
+ return;
+ }
+
+ functionName->blockSignals( TRUE );
+ functionName->setText( i->text( 0 ) );
+ editType->setText( i->text( 1 ) );
+ QString specifier = i->text( 2 );
+ QString access = i->text( 3 );
+ QString type = i->text( 4 );
+ if ( specifier == "pure virtual" )
+ functionSpecifier->setCurrentItem( 2 );
+ else if ( specifier == "non virtual" )
+ functionSpecifier->setCurrentItem( 0 );
+ else if ( specifier == "virtual" )
+ functionSpecifier->setCurrentItem( 1 );
+ else
+ functionSpecifier->setCurrentItem( 3 );
+ if ( access == "private" )
+ functionAccess->setCurrentItem( 2 );
+ else if ( access == "protected" )
+ functionAccess->setCurrentItem( 1 );
+ else
+ functionAccess->setCurrentItem( 0 );
+ if ( type == "slot" )
+ functionType->setCurrentItem( 0 );
+ else
+ functionType->setCurrentItem( 1 );
+
+ functionName->blockSignals( FALSE );
+ boxProperties->setEnabled( TRUE );
+}
+
+void EditFunctions::currentTextChanged( const QString &txt )
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ changeItem( functionListView->currentItem(), Name, txt );
+ functionListView->currentItem()->setText( 0, txt );
+
+ if ( functionListView->currentItem()->text( 4 ) == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( txt.latin1() ).latin1() ) )
+ functionListView->currentItem()->setText( 5, i18n( "Yes" ) );
+ else
+ functionListView->currentItem()->setText( 5, i18n( "No" ) );
+ } else {
+ functionListView->currentItem()->setText( 5, "---" );
+ }
+}
+
+void EditFunctions::currentSpecifierChanged( const QString& s )
+{
+ if ( !functionListView->currentItem() )
+ return;
+
+ changeItem( functionListView->currentItem(), Specifier, s );
+ functionListView->currentItem()->setText( 2, s );
+}
+
+void EditFunctions::currentAccessChanged( const QString& a )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), Access, a );
+ functionListView->currentItem()->setText( 3, a );
+}
+
+
+void EditFunctions::currentReturnTypeChanged( const QString &type )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), ReturnType, type );
+ functionListView->currentItem()->setText( 1, type );
+}
+
+void EditFunctions::currentTypeChanged( const QString &type )
+{
+ if ( !functionListView->currentItem() )
+ return;
+ changeItem( functionListView->currentItem(), Type, type );
+ lastType = type;
+ functionListView->currentItem()->setText( 4, type );
+ if ( type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow,
+ MetaDataBase::normalizeFunction( functionListView->currentItem()->text( 0 ).latin1() ).latin1() ) )
+ functionListView->currentItem()->setText( 5, i18n( "Yes" ) );
+ else
+ functionListView->currentItem()->setText( 5, i18n( "No" ) );
+ } else {
+ functionListView->currentItem()->setText( 5, "---" );
+ }
+}
+
+void EditFunctions::changeItem( QListViewItem *item, Attribute a, const QString &nV )
+{
+ int itemId;
+ QMap<QListViewItem*, int>::Iterator fit = functionIds.find( item );
+ if ( fit != functionIds.end() )
+ itemId = *fit;
+ else
+ return;
+
+ QValueList<FunctItem>::Iterator it = functList.begin();
+ for ( ; it != functList.end(); ++it ) {
+ if ( (*it).id == itemId ) {
+ switch( a ) {
+ case Name:
+ (*it).newName = nV;
+ break;
+ case Specifier:
+ (*it).spec = nV;
+ break;
+ case Access:
+ (*it).access = nV;
+ break;
+ case ReturnType:
+ (*it).retTyp = nV;
+ break;
+ case Type:
+ (*it).type = nV;
+ break;
+ }
+ }
+ }
+}
+
+void EditFunctions::setCurrentFunction( const QString &function )
+{
+ QListViewItemIterator it( functionListView );
+ while ( it.current() ) {
+ if ( MetaDataBase::normalizeFunction( it.current()->text( 0 ) ) == function ) {
+ functionListView->setCurrentItem( it.current() );
+ functionListView->setSelected( it.current(), TRUE );
+ currentItemChanged( it.current() );
+ return;
+ }
+ ++it;
+ }
+}
+
+void EditFunctions::displaySlots( bool justSlots )
+{
+ functionIds.clear();
+ functionListView->clear();
+ for ( QValueList<FunctItem>::Iterator it = functList.begin(); it != functList.end(); ++it ) {
+ if ( (*it).type == "function" && justSlots )
+ continue;
+ QListViewItem *i = new QListViewItem( functionListView );
+ functionIds.insert( i, (*it).id );
+ i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) );
+ i->setText( 0, (*it).newName );
+ i->setText( 1, (*it).retTyp );
+ i->setText( 2, (*it).spec );
+ i->setText( 3, (*it).access );
+ i->setText( 4, (*it).type );
+
+ if ( (*it).type == "slot" ) {
+ if ( MetaDataBase::isSlotUsed( formWindow, MetaDataBase::normalizeFunction( (*it).newName ).latin1() ) )
+ i->setText( 5, i18n( "Yes" ) );
+ else
+ i->setText( 5, i18n( "No" ) );
+ } else {
+ i->setText( 5, "---" );
+ }
+ }
+
+ if ( functionListView->firstChild() )
+ functionListView->setSelected( functionListView->firstChild(), TRUE );
+}
+
+void EditFunctions::emitItemRenamed( QListViewItem *, int, const QString & text )
+{
+ emit itemRenamed( text ); // Relay signal ( to QLineEdit )
+}
diff --git a/kdevdesigner/designer/editfunctionsimpl.h b/kdevdesigner/designer/editfunctionsimpl.h
new file mode 100644
index 00000000..f19f9d72
--- /dev/null
+++ b/kdevdesigner/designer/editfunctionsimpl.h
@@ -0,0 +1,94 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef EDITFUNCTIONSIMPL_H
+#define EDITFUNCTIONSIMPL_H
+
+#include "editfunctions.h"
+#include "hierarchyview.h"
+#include "metadatabase.h"
+#include <qmap.h>
+
+class FormWindow;
+class QListViewItem;
+
+class EditFunctions : public EditFunctionsBase
+{
+ Q_OBJECT
+
+public:
+ EditFunctions( QWidget *parent, FormWindow *fw, bool showOnlySlots = FALSE );
+
+ void setCurrentFunction( const QString &function );
+ void functionAdd( const QString &access = QString::null,
+ const QString &type = QString::null );
+ void functionAdd() { functionAdd( "public" ); }
+
+signals:
+ void itemRenamed(const QString &);
+
+protected slots:
+ void okClicked();
+ void functionRemove();
+ void currentItemChanged( QListViewItem * );
+ void currentTextChanged( const QString &txt );
+ void currentSpecifierChanged( const QString &s );
+ void currentAccessChanged( const QString &a );
+ void currentReturnTypeChanged( const QString &type );
+ void currentTypeChanged( const QString &type );
+ void displaySlots( bool justSlots );
+ void emitItemRenamed( QListViewItem *, int, const QString & );
+
+private:
+ enum Attribute { Name, Specifier, Access, ReturnType, Type };
+ struct FunctItem {
+ int id;
+ QString oldName;
+ QString newName;
+ QString oldRetTyp;
+ QString retTyp;
+ QString spec;
+ QString oldSpec;
+ QString access;
+ QString oldAccess;
+ QString type;
+ QString oldType;
+
+ Q_DUMMY_COMPARISON_OPERATOR( FunctItem )
+ };
+
+ void changeItem( QListViewItem *item, Attribute a, const QString &nV );
+
+ FormWindow *formWindow;
+ QMap<QListViewItem*, int> functionIds;
+ QStringList removedFunctions;
+ QValueList<MetaDataBase::Function> itemList;
+ QValueList<FunctItem> functList;
+ int id;
+ QString lastType;
+};
+
+#endif
diff --git a/kdevdesigner/designer/filechooser.cpp b/kdevdesigner/designer/filechooser.cpp
new file mode 100644
index 00000000..5a882b37
--- /dev/null
+++ b/kdevdesigner/designer/filechooser.cpp
@@ -0,0 +1,90 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "filechooser.h"
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qfiledialog.h>
+#include <qlayout.h>
+
+#include <kfiledialog.h>
+
+FileChooser::FileChooser( QWidget *parent, const char *name )
+ : QWidget( parent, name ), md( File )
+{
+ QHBoxLayout *layout = new QHBoxLayout( this );
+ layout->setMargin( 0 );
+
+ lineEdit = new QLineEdit( this, "filechooser_lineedit" );
+ layout->addWidget( lineEdit );
+
+ connect( lineEdit, SIGNAL( textChanged( const QString & ) ),
+ this, SIGNAL( fileNameChanged( const QString & ) ) );
+
+ button = new QPushButton( "...", this, "filechooser_button" );
+ button->setFixedWidth( button->fontMetrics().width( " ... " ) );
+ layout->addWidget( button );
+
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( chooseFile() ) );
+
+ setFocusProxy( lineEdit );
+}
+
+void FileChooser::setMode( Mode m )
+{
+ md = m;
+}
+
+FileChooser::Mode FileChooser::mode() const
+{
+ return md;
+}
+
+void FileChooser::setFileName( const QString &fn )
+{
+ lineEdit->setText( fn );
+}
+
+QString FileChooser::fileName() const
+{
+ return lineEdit->text();
+}
+
+void FileChooser::chooseFile()
+{
+ QString fn;
+ if ( mode() == File )
+ fn = KFileDialog::getOpenFileName( lineEdit->text(), QString::null, this );
+ else
+ fn = KFileDialog::getExistingDirectory( lineEdit->text(),this );
+
+ if ( !fn.isEmpty() ) {
+ lineEdit->setText( fn );
+ emit fileNameChanged( fn );
+ }
+}
+
diff --git a/kdevdesigner/designer/filechooser.h b/kdevdesigner/designer/filechooser.h
new file mode 100644
index 00000000..6647a1d5
--- /dev/null
+++ b/kdevdesigner/designer/filechooser.h
@@ -0,0 +1,68 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef FILECHOOSER_H
+#define FILECHOOSER_H
+
+#include <qwidget.h>
+
+class QLineEdit;
+class QPushButton;
+
+class FileChooser : public QWidget
+{
+ Q_OBJECT
+
+ Q_ENUMS( Mode )
+ Q_PROPERTY( Mode mode READ mode WRITE setMode )
+ Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
+
+public:
+ FileChooser( QWidget *parent = 0, const char *name = 0);
+
+ enum Mode { File, Directory };
+
+ QString fileName() const;
+ Mode mode() const;
+
+public slots:
+ void setFileName( const QString &fn );
+ void setMode( Mode m );
+
+signals:
+ void fileNameChanged( const QString & );
+
+private slots:
+ void chooseFile();
+
+private:
+ QLineEdit *lineEdit;
+ QPushButton *button;
+ Mode md;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/finddialog.ui b/kdevdesigner/designer/finddialog.ui
new file mode 100644
index 00000000..3923d1ef
--- /dev/null
+++ b/kdevdesigner/designer/finddialog.ui
@@ -0,0 +1,274 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>FindDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FindDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>285</width>
+ <height>189</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Find Text</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>F&amp;ind:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFind</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>comboFind</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioForward</cstring>
+ </property>
+ <property name="text">
+ <string>Forwar&amp;d</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioBackward</cstring>
+ </property>
+ <property name="text">
+ <string>Bac&amp;kward</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkWords</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Whole words only</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkCase</cstring>
+ </property>
+ <property name="text">
+ <string>Case &amp;sensitive</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBegin</cstring>
+ </property>
+ <property name="text">
+ <string>Start at &amp;beginning</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>doFind()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>comboFind</tabstop>
+ <tabstop>checkWords</tabstop>
+ <tabstop>checkCase</tabstop>
+ <tabstop>checkBegin</tabstop>
+ <tabstop>radioForward</tabstop>
+ <tabstop>radioBackward</tabstop>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">qlineedit.h</include>
+ <include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+ <include location="local" impldecl="in implementation">finddialog.ui.h</include>
+</includes>
+<forwards>
+ <forward>struct EditorInterface;</forward>
+</forwards>
+<variables>
+ <variable>EditorInterface *editor;</variable>
+ <variable>QObject *formWindow;</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>doFind()</slot>
+ <slot>setEditor( EditorInterface * e, QObject * fw )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/finddialog.ui.h b/kdevdesigner/designer/finddialog.ui.h
new file mode 100644
index 00000000..c9b4f230
--- /dev/null
+++ b/kdevdesigner/designer/finddialog.ui.h
@@ -0,0 +1,61 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+void FindDialog::init()
+{
+ editor = 0;
+ formWindow = 0;
+}
+
+void FindDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+}
+
+void FindDialog::doFind()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->find( comboFind->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked() ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+
+}
+
+void FindDialog::setEditor( EditorInterface * e, QObject * fw )
+{
+ if ( fw != formWindow )
+ checkBegin->setChecked( TRUE );
+ formWindow = fw;
+ if ( editor )
+ editor->release();
+ editor = e;
+ editor->addRef();
+}
diff --git a/kdevdesigner/designer/formfile.cpp b/kdevdesigner/designer/formfile.cpp
new file mode 100644
index 00000000..cde7eb8b
--- /dev/null
+++ b/kdevdesigner/designer/formfile.cpp
@@ -0,0 +1,905 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "formfile.h"
+#include "timestamp.h"
+#include "project.h"
+#include "formwindow.h"
+#include "command.h"
+#include "sourceeditor.h"
+#include "mainwindow.h"
+#include "../interfaces/languageinterface.h"
+#include "resource.h"
+#include "workspace.h"
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qstatusbar.h>
+#include "propertyeditor.h"
+#include <qworkspace.h>
+#include <stdlib.h>
+#include "designerappiface.h"
+#include <qapplication.h>
+
+#include <kfiledialog.h>
+#include <klocale.h>
+#include "kdevdesigner_part.h"
+
+static QString make_func_pretty( const QString &s )
+{
+ QString res = s;
+ if ( res.find( ")" ) - res.find( "(" ) == 1 )
+ return res;
+ res.replace( "(", "( " );
+ res.replace( ")", " )" );
+ res.replace( "&", " &" );
+ res.replace( "*", " *" );
+ res.replace( ",", ", " );
+ res.replace( ":", " : " );
+ res = res.simplifyWhiteSpace();
+ res.replace( " : : ", "::" );
+ res.replace( ">>", "> >" );
+ return res;
+}
+
+FormFile::FormFile( const QString &fn, bool temp, Project *p, const char *name )
+ : filename( fn ), fileNameTemp( temp ), pro( p ), fw( 0 ), ed( 0 ),
+ timeStamp( 0, fn + codeExtension() ), codeEdited( FALSE ), pkg( FALSE ),
+ cm( FALSE ), codeFileStat( None )
+{
+ MetaDataBase::addEntry( this );
+ fake = qstrcmp( name, "qt_fakewindow" ) == 0;
+ //codeFileStat = FormFile::None;
+ pro->addFormFile( this );
+ loadCode();
+ if ( !temp )
+ checkFileName( FALSE );
+
+ connect(this, SIGNAL(somethingChanged(FormFile* )), this, SLOT(emitNewStatus(FormFile* )));
+}
+
+FormFile::~FormFile()
+{
+ pro->removeFormFile( this );
+ if ( formWindow() )
+ formWindow()->setFormFile( 0 );
+}
+
+void FormFile::setFormWindow( FormWindow *f )
+{
+ if ( f == fw )
+ return;
+ if ( fw )
+ fw->setFormFile( 0 );
+ fw = f;
+ if ( fw )
+ fw->setFormFile( this );
+ parseCode( cod, FALSE );
+ QTimer::singleShot( 0, this, SLOT( notifyFormWindowChange() ) );
+}
+
+void FormFile::setEditor( SourceEditor *e )
+{
+ ed = e;
+}
+
+void FormFile::setFileName( const QString &fn )
+{
+ if ( fn == filename )
+ return;
+ if ( fn.isEmpty() ) {
+ fileNameTemp = TRUE;
+ if ( filename.find( "unnamed" ) != 0 )
+ filename = createUnnamedFileName();
+ return;
+ } else {
+ fileNameTemp = FALSE;
+ }
+ filename = fn;
+ timeStamp.setFileName( filename + codeExtension() );
+ cod = "";
+ loadCode();
+}
+
+void FormFile::setCode( const QString &c )
+{
+ cod = c;
+}
+
+FormWindow *FormFile::formWindow() const
+{
+ return fw;
+}
+
+SourceEditor *FormFile::editor() const
+{
+ return ed;
+}
+
+QString FormFile::fileName() const
+{
+ return filename;
+}
+
+QString FormFile::absFileName() const
+{
+ return pro->makeAbsolute( filename );
+}
+
+QString FormFile::codeFile() const
+{
+ QString codeExt = codeExtension();
+ if ( codeExt.isEmpty() )
+ return "";
+ return filename + codeExt;
+}
+
+QString FormFile::code()
+{
+ return cod;
+}
+
+bool FormFile::save( bool withMsgBox, bool ignoreModified )
+{
+ if ( fileNameTemp )
+ return saveAs();
+ if ( !ignoreModified && !isModified() )
+ return TRUE;
+ if ( ed )
+ ed->save();
+
+ if ( formWindow() && isModified( WFormWindow ) ) {
+ if ( withMsgBox ) {
+ if ( !formWindow()->checkCustomWidgets() )
+ return FALSE;
+ }
+
+ if ( QFile::exists( pro->makeAbsolute( filename ) ) ) {
+ QString fn( pro->makeAbsolute( filename ) );
+#if defined(Q_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ QFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ QFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate ) ) {
+ QCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ } else {
+ QMessageBox::warning( MainWindow::self, i18n( "Save" ),
+ i18n( "The file %1 could not be saved" ).arg( codeFile() ) );
+ }
+ }
+ }
+ }
+
+ if ( isModified( WFormCode ) ) {
+ if ( QFile::exists( pro->makeAbsolute( codeFile() ) ) ) {
+ QString fn( pro->makeAbsolute( codeFile() ) );
+#if defined(Q_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ QFile f( pro->makeAbsolute( codeFile() ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ QFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate) ) {
+ QCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ } else if ( qApp->type() != QApplication::Tty ) {
+ QMessageBox::warning( MainWindow::self, i18n( "Save" ),
+ i18n( "The file %1 could not be saved" ).arg( codeFile() ) );
+ }
+ }
+ }
+ }
+
+ if ( formWindow() ) {
+ Resource resource( MainWindow::self );
+ resource.setWidget( formWindow() );
+ bool formCodeOnly = isModified( WFormCode ) && !isModified( WFormWindow );
+ if ( !resource.save( pro->makeAbsolute( filename ), formCodeOnly ) ) {
+ if ( MainWindow::self )
+ MainWindow::self->statusMessage( i18n( "Failed to save file '%1'.").arg( formCodeOnly ? codeFile(): filename ) );
+ if ( formCodeOnly )
+ return FALSE;
+ return saveAs();
+ }
+ if ( MainWindow::self )
+ MainWindow::self->statusMessage( i18n( "'%1' saved.").
+ arg( formCodeOnly ? codeFile() : filename ));
+ } else {
+ if ( !Resource::saveFormCode(this, MetaDataBase::languageInterface(pro->language())) )
+ return FALSE;
+ }
+ timeStamp.update();
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool FormFile::saveAs( bool ignoreModified )
+{
+ QString f = pro->makeAbsolute( fileName() );
+ if ( fileNameTemp && formWindow() ) {
+ f = QString( formWindow()->name() ).lower();
+ f.replace( "::", "_" );
+ f = pro->makeAbsolute( f + ".ui" );
+ }
+ bool saved = FALSE;
+ if ( ignoreModified ) {
+ QString dir = QStringList::split( ':', pro->iFace()->customSetting( "QTSCRIPT_PACKAGES" ) ).first();
+ f = QFileInfo( f ).fileName();
+ f.prepend( dir + "/" );
+ }
+ QString fn;
+ while ( !saved ) {
+ fn = KFileDialog::getSaveFileName( f,
+ i18n( "*.ui|Qt User-Interface Files" ) + "\n" +
+ i18n( "*|All Files" ), MainWindow::self, /*0,*/
+ i18n( "Save Form '%1' As").arg( formName() )/*,
+ MainWindow::self ? &MainWindow::self->lastSaveFilter : 0*/ );
+ if ( fn.isEmpty() )
+ return FALSE;
+ QFileInfo fi( fn );
+ if ( fi.extension() != "ui" )
+ fn += ".ui";
+ fileNameTemp = FALSE;
+ filename = pro->makeRelative( fn );
+ QFileInfo relfi( filename );
+ if ( relfi.exists() ) {
+ if ( QMessageBox::warning( MainWindow::self, i18n( "File Already Exists" ),
+ i18n( "The file already exists. Do you wish to overwrite it?" ),
+ QMessageBox::Yes,
+ QMessageBox::No ) == QMessageBox::Yes ) {
+ saved = TRUE;
+ } else {
+ filename = f;
+ }
+
+ } else {
+ saved = TRUE;
+ }
+ }
+ if ( !checkFileName( TRUE ) ) {
+ filename = f;
+ return FALSE;
+ }
+ pro->setModified( TRUE );
+ timeStamp.setFileName( pro->makeAbsolute( codeFile() ) );
+ if ( ed && formWindow() )
+ ed->setCaption( i18n( "Edit %1" ).arg( formWindow()->name() ) );
+ setModified( TRUE );
+ if ( pro->isDummy() )
+ fw->mainWindow()->addRecentlyOpenedFile( fn );
+ return save( TRUE, ignoreModified );
+}
+
+bool FormFile::close()
+{
+ if ( editor() ) {
+ editor()->save();
+ editor()->close();
+ }
+ if ( formWindow() )
+ return formWindow()->close();
+ return TRUE;
+}
+
+bool FormFile::closeEvent()
+{
+ if ( !isModified() && fileNameTemp ) {
+ pro->removeFormFile( this );
+ return TRUE;
+ }
+
+ if ( !isModified() )
+ return TRUE;
+
+ if ( editor() )
+ editor()->save();
+
+ switch ( QMessageBox::warning( MainWindow::self, i18n( "Save Form" ),
+ i18n( "Save changes to form '%1'?" ).arg( filename ),
+ i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ if ( !save() )
+ return FALSE;
+ case 1: // don't save
+ loadCode();
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+ if ( fileNameTemp )
+ pro->removeFormFile( this );
+ if ( MainWindow::self )
+ MainWindow::self->workspace()->update();
+ break;
+ case 2: // cancel
+ return FALSE;
+ default:
+ break;
+ }
+
+ setModified( FALSE );
+ if ( MainWindow::self )
+ MainWindow::self->updateFunctionList();
+ setCodeEdited( FALSE );
+ return TRUE;
+}
+
+void FormFile::setModified( bool m, int who )
+{
+ if ( ( who & WFormWindow ) == WFormWindow )
+ setFormWindowModified( m );
+ if ( ( who & WFormCode ) == WFormCode )
+ setCodeModified( m );
+}
+
+bool FormFile::isModified( int who )
+{
+ if ( who == WFormWindow )
+ return isFormWindowModified();
+ if ( who == WFormCode )
+ return isCodeModified();
+ return isCodeModified() || isFormWindowModified();
+}
+
+bool FormFile::isFormWindowModified() const
+{
+ if ( !formWindow() || !formWindow()->commandHistory() )
+ return FALSE;
+ return formWindow()->commandHistory()->isModified();
+}
+
+bool FormFile::isCodeModified() const
+{
+ if ( !editor() )
+ return cm;
+ return editor()->isModified();
+}
+
+void FormFile::setFormWindowModified( bool m )
+{
+ bool b = isFormWindowModified();
+ if ( m == b )
+ return;
+ if ( !formWindow() || !formWindow()->commandHistory() )
+ return;
+ formWindow()->commandHistory()->setModified( m );
+ emit somethingChanged( this );
+}
+
+void FormFile::setCodeModified( bool m )
+{
+ bool b = isCodeModified();
+ if ( m == b )
+ return;
+ emit somethingChanged( this );
+ cm = m;
+ if ( !editor() )
+ return;
+ editor()->setModified( m );
+}
+
+void FormFile::showFormWindow()
+{
+ if ( !MainWindow::self )
+ return;
+ if ( formWindow() ) {
+ if ( ( formWindow()->hasFocus() ||
+ MainWindow::self->qWorkspace()->activeWindow() == formWindow() ) &&
+ MainWindow::self->propertyeditor()->formWindow() != formWindow() ) {
+ MainWindow::self->propertyeditor()->setWidget( formWindow()->currentWidget(), formWindow() );
+ MainWindow::self->objectHierarchy()->setFormWindow( formWindow(),
+ formWindow()->currentWidget() );
+ }
+ formWindow()->setFocus();
+ return;
+ }
+ MainWindow::self->openFormWindow( pro->makeAbsolute( filename ), TRUE, this );
+}
+
+bool FormFile::setupUihFile( bool askForUih )
+{
+ if ( !pro->isCpp() || !askForUih ) {
+ if ( !hasFormCode() ) {
+ createFormCode();
+ setModified( TRUE );
+ }
+ codeFileStat = FormFile::Ok;
+ return TRUE;
+ }
+ if ( codeFileStat != FormFile::Ok && !ed ) {
+ if ( hasFormCode() ) {
+ int i = QMessageBox::information( MainWindow::self, i18n( "Using ui.h File" ),
+ i18n( "An \"ui.h\" file for this form already exists.\n"
+ "Do you want to use it or create a new one?" ),
+ i18n( "Use Existing" ), i18n( "Create New" ),
+ i18n( "Cancel" ), 2, 2 );
+ if ( i == 2 )
+ return FALSE;
+ if ( i == 1 )
+ createFormCode();
+ } else {
+ if ( QMessageBox::Yes != QMessageBox::information( MainWindow::self, i18n( "Creating ui.h file" ),
+ i18n( "Do you want to create an new \"ui.h\" file?" ),
+ QMessageBox::Yes, QMessageBox::No ) )
+ return FALSE;
+ createFormCode();
+ }
+ setModified( TRUE );
+ }
+ codeFileStat = FormFile::Ok;
+ return TRUE;
+}
+
+SourceEditor *FormFile::showEditor( bool askForUih )
+{
+ if ( !MainWindow::self )
+ return 0;
+ showFormWindow();
+ //emit signal to the embedding IDE if there is one and return 0 because
+ //no source editing is possible
+ emit fw->mainWindow()->part()->emitEditSource(fw->fileName());
+ return 0;
+/* if ( !setupUihFile( askForUih ) )
+ return 0;
+ return MainWindow::self->openSourceEditor();*/
+}
+
+static int ui_counter = 0;
+QString FormFile::createUnnamedFileName()
+{
+ return QString( "unnamed" ) + QString::number( ++ui_counter ) + QString( ".ui" );
+}
+
+QString FormFile::codeExtension() const
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ return iface->formCodeExtension();
+ return "";
+}
+
+QString FormFile::codeComment() const
+{
+ return QString( "/****************************************************************************\n"
+ "** ui.h extension file, included from the uic-generated form implementation.\n"
+ "**\n"
+ "** If you want to add, delete, or rename functions or slots, use\n"
+ "** Qt Designer to update this file, preserving your code.\n"
+ "**\n"
+ "** You should not define a constructor or destructor in this file.\n"
+ "** Instead, write your code in functions called init() and destroy().\n"
+ "** These will automatically be called by the form's constructor and\n"
+ "** destructor.\n"
+ "*****************************************************************************/\n" );
+}
+
+bool FormFile::hasFormCode() const
+{
+ return !cod.isEmpty() && cod != QString( codeComment() );
+}
+
+int FormFile::codeFileState() const
+{
+ return hasFormCode() ? codeFileStat : None;
+}
+
+void FormFile::setCodeFileState( UihState s )
+{
+ codeFileStat = s;
+}
+
+void FormFile::createFormCode()
+{
+ if ( !formWindow() )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+ if ( pro->isCpp() )
+ cod = codeComment();
+ QValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow() );
+ for ( QValueList<MetaDataBase::Function>::Iterator it = functionList.begin(); it != functionList.end(); ++it ) {
+ cod += (!cod.isEmpty() ? "\n\n" : "") +
+ iface->createFunctionStart( formWindow()->name(), make_func_pretty((*it).function),
+ (*it).returnType.isEmpty() ?
+ QString( "void" ) :
+ (*it).returnType, (*it).access ) +
+ "\n" + iface->createEmptyFunction();
+ }
+ parseCode( cod, FALSE );
+}
+
+void FormFile::load()
+{
+ showFormWindow();
+ code();
+}
+
+bool FormFile::loadCode()
+{
+ QFile f( pro->makeAbsolute( codeFile() ) );
+ if ( !f.open( IO_ReadOnly ) ) {
+ cod = "";
+ setCodeFileState( FormFile::None );
+ return FALSE;
+ }
+ QTextStream ts( &f );
+ cod = ts.read();
+ parseCode( cod, FALSE );
+ if ( hasFormCode() && codeFileStat != FormFile::Ok )
+ setCodeFileState( FormFile::Deleted );
+ timeStamp.update();
+ return TRUE;
+}
+
+bool FormFile::isCodeEdited() const
+{
+ return codeEdited;
+}
+
+void FormFile::setCodeEdited( bool b )
+{
+ codeEdited = b;
+}
+
+void FormFile::parseCode( const QString &txt, bool allowModify )
+{
+ if ( !formWindow() )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+ QValueList<LanguageInterface::Function> functions;
+ QValueList<MetaDataBase::Function> newFunctions, oldFunctions;
+ oldFunctions = MetaDataBase::functionList( formWindow() );
+ iface->functions( txt, &functions );
+ QMap<QString, QString> funcs;
+ for ( QValueList<LanguageInterface::Function>::Iterator it = functions.begin();
+ it != functions.end(); ++it ) {
+ bool found = FALSE;
+ for ( QValueList<MetaDataBase::Function>::Iterator fit = oldFunctions.begin();
+ fit != oldFunctions.end(); ++fit ) {
+ QString f( (*fit).function );
+ if ( MetaDataBase::normalizeFunction( f ) ==
+ MetaDataBase::normalizeFunction( (*it).name ) ) {
+ found = TRUE;
+ MetaDataBase::Function function;
+ function.function = make_func_pretty( (*it).name );
+ function.specifier = (*fit).specifier;
+ function.type = (*fit).type;
+ if ( !pro->isCpp() )
+ function.access = (*it).access;
+ else
+ function.access = (*fit).access;
+ function.language = (*fit).language;
+ function.returnType = (*it).returnType;
+ newFunctions << function;
+ funcs.insert( (*it).name, (*it).body );
+ oldFunctions.remove( fit );
+ break;
+ }
+ }
+ if ( !found ) {
+ MetaDataBase::Function function;
+ function.function = make_func_pretty( (*it).name );
+ function.specifier = "virtual";
+ function.access = "public";
+ function.language = pro->language();
+ function.returnType = (*it).returnType;
+ if ( function.returnType == "void" )
+ function.type = "slot";
+ else
+ function.type = "function";
+ if ( function.function == "init()" || function.function == "destroy()" ) {
+ function.type = "function";
+ function.access = "private";
+ function.specifier = "non virtual";
+ }
+ newFunctions << function;
+ funcs.insert( (*it).name, (*it).body );
+ if ( allowModify )
+ setFormWindowModified( TRUE );
+ }
+ }
+
+ if ( allowModify && oldFunctions.count() > 0 )
+ setFormWindowModified( TRUE );
+
+ MetaDataBase::setFunctionList( formWindow(), newFunctions );
+}
+
+void FormFile::syncCode()
+{
+ if ( !editor() )
+ return;
+ parseCode( editor()->editorInterface()->text(), TRUE );
+ cod = editor()->editorInterface()->text();
+}
+
+void FormFile::checkTimeStamp()
+{
+ if ( timeStamp.isUpToDate() )
+ return;
+ timeStamp.update();
+ if ( codeEdited ) {
+ if ( QMessageBox::information( MainWindow::self, i18n( "Qt Designer" ),
+ i18n( "File '%1' has been changed outside Qt Designer.\n"
+ "Do you want to reload it?" ).arg( timeStamp.fileName() ),
+ i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) {
+ QFile f( timeStamp.fileName() );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ editor()->editorInterface()->setText( ts.read() );
+ editor()->save();
+ if ( MainWindow::self )
+ MainWindow::self->functionsChanged();
+ }
+ }
+ } else {
+ loadCode();
+ }
+}
+
+bool FormFile::isUihFileUpToDate()
+{
+ if ( timeStamp.isUpToDate() )
+ return TRUE;
+ if ( !editor() ) {
+ MainWindow::self->editSource();
+ qDebug( "parse Code" );
+ parseCode( editor()->editorInterface()->text(), TRUE );
+ }
+ checkTimeStamp();
+ return FALSE;
+}
+
+void FormFile::addFunctionCode( MetaDataBase::Function function )
+{
+ if ( pro->isCpp() && !hasFormCode() && !codeEdited )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+
+ QValueList<LanguageInterface::Function> funcs;
+ iface->functions( cod, &funcs );
+ bool hasFunc = FALSE;
+ for ( QValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
+ it != funcs.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).name ) == MetaDataBase::normalizeFunction( function.function ) ) {
+ hasFunc = TRUE;
+ break;
+ }
+ }
+
+ if ( !hasFunc ) {
+ if ( !codeEdited && !timeStamp.isUpToDate() )
+ loadCode();
+ MetaDataBase::MetaInfo mi = MetaDataBase::metaInfo( formWindow() );
+ QString cn;
+ if ( mi.classNameChanged )
+ cn = mi.className;
+ if ( cn.isEmpty() )
+ cn = formWindow()->name();
+ QString body = "\n\n" + iface->createFunctionStart( cn,
+ make_func_pretty( function.function ),
+ function.returnType.isEmpty() ?
+ QString( "void" ) :
+ function.returnType, function.access ) +
+ "\n" + iface->createEmptyFunction();
+ cod += body;
+ if ( codeEdited ) {
+ setModified( TRUE );
+ emit somethingChanged( this );
+ }
+ }
+}
+
+void FormFile::removeFunctionCode( MetaDataBase::Function function )
+{
+ if ( pro->isCpp() && !hasFormCode() && !codeEdited )
+ return;
+
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( !iface )
+ return;
+
+ checkTimeStamp();
+ QString sourceCode = code();
+ if ( sourceCode.isEmpty() )
+ return;
+ QValueList<LanguageInterface::Function> functions;
+ iface->functions( sourceCode, &functions );
+ QString fu = MetaDataBase::normalizeFunction( function.function );
+ for ( QValueList<LanguageInterface::Function>::Iterator fit = functions.begin(); fit != functions.end(); ++fit ) {
+ if ( MetaDataBase::normalizeFunction( (*fit).name ) == fu ) {
+ int line = 0;
+ int start = 0;
+ while ( line < (*fit).start - 1 ) {
+ start = sourceCode.find( '\n', start );
+ if ( start == -1 )
+ return;
+ start++;
+ line++;
+ }
+ if ( start == -1 )
+ return;
+ int end = start;
+ while ( line < (*fit).end + 1 ) {
+ end = sourceCode.find( '\n', end );
+ if ( end == -1 ) {
+ if ( line <= (*fit).end )
+ end = sourceCode.length() - 1;
+ else
+ return;
+ }
+ end++;
+ line++;
+ }
+ if ( end < start )
+ return;
+ sourceCode.remove( start, end - start );
+ setCode( sourceCode );
+ }
+ }
+}
+
+void FormFile::functionNameChanged( const QString &oldName, const QString &newName )
+{
+ if ( !cod.isEmpty() ) {
+ QString funcStart = QString( formWindow()->name() ) + QString( "::" );
+ int i = cod.find( funcStart + oldName );
+ if ( i != -1 ) {
+ cod.remove( i + funcStart.length(), oldName.length() );
+ cod.insert( i + funcStart.length(), newName );
+ }
+ }
+}
+
+void FormFile::functionRetTypeChanged( const QString &fuName, const QString &oldType, const QString &newType )
+{
+ if ( !cod.isEmpty() ) {
+ QString oldFunct = oldType + " " + QString( formWindow()->name() ) + "::" + fuName;
+ QString newFunct = newType + " " + QString( formWindow()->name() ) + "::" + fuName;
+
+ int i = cod.find( oldFunct );
+ if ( i != -1 ) {
+ cod.remove( i, oldFunct.length() );
+ cod.insert( i, newFunct );
+ }
+ }
+}
+
+QString FormFile::formName() const
+{
+ FormFile* that = (FormFile*) this;
+ if ( formWindow() ) {
+ that->cachedFormName = formWindow()->name();
+ return cachedFormName;
+ }
+ if ( !cachedFormName.isNull() )
+ return cachedFormName;
+ QFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ QString line;
+ QString className;
+ while ( !ts.eof() ) {
+ line = ts.readLine();
+ if ( !className.isEmpty() ) {
+ int end = line.find( "</class>" );
+ if ( end == -1 ) {
+ className += line;
+ } else {
+ className += line.left( end );
+ break;
+ }
+ continue;
+ }
+ int start;
+ if ( ( start = line.find( "<class>" ) ) != -1 ) {
+ int end = line.find( "</class>" );
+ if ( end == -1 ) {
+ className = line.mid( start + 7 );
+ } else {
+ className = line.mid( start + 7, end - ( start + 7 ) );
+ break;
+ }
+ }
+ }
+ that->cachedFormName = className;
+ }
+ if ( cachedFormName.isEmpty() )
+ that->cachedFormName = filename;
+ return cachedFormName;
+}
+
+void FormFile::formWindowChangedSomehow()
+{
+ emit somethingChanged( this );
+}
+
+bool FormFile::checkFileName( bool allowBreak )
+{
+ FormFile *ff = pro->findFormFile( filename, this );
+ if ( ff )
+ QMessageBox::warning( MainWindow::self, i18n( "Invalid Filename" ),
+ i18n( "The project already contains a form with a\n"
+ "filename of '%1'. Please choose a new filename." ).arg( filename ) );
+ while ( ff ) {
+ QString fn;
+ while ( fn.isEmpty() ) {
+ fn = KFileDialog::getSaveFileName( pro->makeAbsolute( fileName() ),
+ i18n( "*.ui|Qt User-Interface Files" ) + "\n" +
+ i18n( "*|All Files" ), MainWindow::self,/* 0,*/
+ i18n( "Save Form '%1' As").
+ arg( formWindow()->name() )/*,
+ MainWindow::self ? &MainWindow::self->lastSaveFilter : 0 */);
+ if ( allowBreak && fn.isEmpty() )
+ return FALSE;
+ }
+ filename = pro->makeRelative( fn );
+ ff = pro->findFormFile( filename, this );
+ }
+ return TRUE;
+}
+
+void FormFile::addConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ iface->addConnection( sender, signal, receiver, slot, &cod );
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+}
+
+void FormFile::removeConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ if ( iface )
+ iface->removeConnection( sender, signal, receiver, slot, &cod );
+ if ( ed )
+ ed->editorInterface()->setText( cod );
+}
+
+void FormFile::notifyFormWindowChange()
+{
+ if ( fw )
+ pro->formOpened( fw );
+}
+
+void FormFile::emitNewStatus(FormFile *file)
+{
+ fw->mainWindow()->part()->emitNewStatus(fileName(), isModified());
+}
diff --git a/kdevdesigner/designer/formfile.h b/kdevdesigner/designer/formfile.h
new file mode 100644
index 00000000..65d0f389
--- /dev/null
+++ b/kdevdesigner/designer/formfile.h
@@ -0,0 +1,145 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef FORMFILE_H
+#define FORMFILE_H
+
+#include <qobject.h>
+#include "timestamp.h"
+#include "metadatabase.h"
+
+class Project;
+class FormWindow;
+class SourceEditor;
+
+class FormFile : public QObject
+{
+ Q_OBJECT
+ friend class SourceEditor;
+
+public:
+ enum Who {
+ WFormWindow = 1,
+ WFormCode = 2,
+ WAnyOrAll = WFormWindow | WFormCode
+ };
+
+ enum UihState { None, Ok, Deleted };
+
+ FormFile( const QString &fn, bool temp, Project *p, const char *name = 0 );
+ ~FormFile();
+
+ void setFormWindow( FormWindow *f );
+ void setEditor( SourceEditor *e );
+ void setFileName( const QString &fn );
+ void setCode( const QString &c );
+ void setModified( bool m, int who = WAnyOrAll );
+ void setCodeEdited( bool b );
+
+ FormWindow *formWindow() const;
+ SourceEditor *editor() const;
+ QString fileName() const;
+ QString absFileName() const;
+
+ bool supportsCodeFile() const { return !codeExtension().isEmpty(); }
+ QString codeComment() const;
+ QString codeFile() const;
+ QString code();
+ bool isCodeEdited() const;
+
+ bool loadCode();
+ void load();
+ bool save( bool withMsgBox = TRUE, bool ignoreModified = FALSE );
+ bool saveAs( bool ignoreModified = FALSE );
+ bool close();
+ bool closeEvent();
+ bool isModified( int who = WAnyOrAll );
+ bool hasFormCode() const;
+ void createFormCode();
+ void syncCode();
+ void checkTimeStamp();
+ bool isUihFileUpToDate();
+ void addFunctionCode( MetaDataBase::Function function );
+ void removeFunctionCode( MetaDataBase::Function function );
+ void functionNameChanged( const QString &oldName, const QString &newName );
+ void functionRetTypeChanged( const QString &fuName, const QString &oldType, const QString &newType );
+
+ void showFormWindow();
+ SourceEditor *showEditor( bool askForUih = TRUE );
+
+ static QString createUnnamedFileName();
+ QString formName() const;
+
+ bool isFake() const { return fake; }
+
+ void parseCode( const QString &txt, bool allowModify );
+
+ void addConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot );
+ void removeConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot );
+
+ bool hasTempFileName() const { return fileNameTemp; }
+ void setCodeFileState( UihState );
+ int codeFileState() const;
+ bool setupUihFile( bool askForUih = TRUE );
+
+ Project *project() const { return pro; }
+
+signals:
+ void somethingChanged( FormFile* );
+
+private slots:
+ void formWindowChangedSomehow();
+ void notifyFormWindowChange();
+ void emitNewStatus(FormFile* file);
+
+private:
+ bool isFormWindowModified() const;
+ bool isCodeModified() const;
+ void setFormWindowModified( bool m );
+ void setCodeModified( bool m );
+ QString codeExtension() const;
+ bool checkFileName( bool allowBreak );
+
+private:
+ QString filename;
+ bool fileNameTemp;
+ Project *pro;
+ FormWindow *fw;
+ SourceEditor *ed;
+ QString cod;
+ TimeStamp timeStamp;
+ bool codeEdited;
+ QString cachedFormName;
+ bool fake;
+ bool pkg;
+ bool cm;
+ UihState codeFileStat;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/formsettings.ui b/kdevdesigner/designer/formsettings.ui
new file mode 100644
index 00000000..c1d6be27
--- /dev/null
+++ b/kdevdesigner/designer/formsettings.ui
@@ -0,0 +1,549 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>FormSettingsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FormSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>597</width>
+ <height>458</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Form Settings&lt;/b&gt;&lt;p&gt;Change settings for the form. Settings like &lt;b&gt;Comment&lt;/b&gt; and &lt;b&gt;Author&lt;/b&gt; are for your own use and are not required.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Pixmaps</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radioPixmapInline</cstring>
+ </property>
+ <property name="text">
+ <string>Save in&amp;line</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Save pixmaps in the .ui files</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Save Inline&lt;/b&gt;&lt;p&gt;Saves the pixmaps as binary data in the .ui files. Pixmaps saved like this are not shared between forms. We recommend using Project image files instead.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>radioProjectImageFile</cstring>
+ </property>
+ <property name="text">
+ <string>Project &amp;image file</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the Project's Image file for pixmaps</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use the Project's Image file for pixmaps&lt;/b&gt;
+&lt;p&gt;Each project may have a collection of pixmaps. If you use a project, we recommend that you use this option since it shares the images and is the fastest and most efficient way to use pixmaps in your forms.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>editPixmapFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify Pixmap-Loader function (only the function's name, no parentheses.)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify Pixmap-Loader function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for loading a pixmap in the generated code. &lt;em&gt;Only enter the function's name, without parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radioPixmapFunction</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;function:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the given function for pixmaps</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use a given function for pixmaps&lt;/b&gt;&lt;p&gt;If you choose this option you must define a function in the line edit at the right which will be used in the generated code for loading pixmaps. When choosing a pixmap in &lt;i&gt;Qt Designer&lt;/i&gt; you will be asked to specify the arguments which will be passed to the function in the generated code.&lt;p&gt; This approach makes it possible to use your own icon-loader function for loading pixmaps. &lt;i&gt;Qt Designer&lt;/i&gt; cannot preview the correct image if you use your own function.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editClassName</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change class name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the name of the class that will be created.&lt;/b&gt;&lt;p&gt;&lt;em&gt;classname.h&lt;/em&gt; and &lt;em&gt;classname.cpp&lt;/em&gt; will be generated as C++ output when it is compiled by uic.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;uthor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editAuthor</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editAuthor</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter your name</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter your name.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Class &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editClassName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;mment:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editComment</cstring>
+ </property>
+ </widget>
+ <widget class="QMultiLineEdit" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>editComment</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter a comment about the form.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>La&amp;youts</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QSpinBox" row="0" column="2">
+ <property name="name">
+ <cstring>spinMargin</cstring>
+ </property>
+ <property name="value">
+ <number>11</number>
+ </property>
+ </widget>
+ <spacer row="0" column="3">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;efault spacing:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinSpacing</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkLayoutFunctions</cstring>
+ </property>
+ <property name="text">
+ <string>Use func&amp;tions:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use functions to get the margin and spacing</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Use a given function for margin and/or spacing&lt;/b&gt;&lt;p&gt;If you choose this option you must define functions in the line edit below which will be used in the generated code for getting the margin and spacing value. &lt;i&gt;Qt Designer&lt;/i&gt; cannot preview the correct margin or spacing if you use your own function. Instead, the default values will be used for preview.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="2">
+ <property name="name">
+ <cstring>spinSpacing</cstring>
+ </property>
+ <property name="value">
+ <number>6</number>
+ </property>
+ </widget>
+ <spacer row="1" column="3">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Default mar&amp;gin:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinMargin</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>spaFuLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>S&amp;pacing:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editSpacingFunction</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>marFuLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Ma&amp;rgin:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editMarginFunction</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>editSpacingFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify spacing function (only the function's name, no parentheses.)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify spacing function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for getting the spacing in the generated code. &lt;em&gt;Only enter the function's name, without parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>editMarginFunction</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Specify margin function (only the function's name, no parentheses.)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Specify margin function&lt;/b&gt;&lt;p&gt;Specify the function which should be used for getting the margin in the generated code. &lt;em&gt;Only enter the function's name, without parentheses.&lt;/em&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>FormSettingsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>FormSettingsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>radioPixmapFunction</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editPixmapFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editSpacingFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>editMarginFunction</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>marFuLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkLayoutFunctions</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>spaFuLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>editClassName</tabstop>
+ <tabstop>editComment</tabstop>
+ <tabstop>editAuthor</tabstop>
+ <tabstop>radioPixmapInline</tabstop>
+ <tabstop>radioPixmapFunction</tabstop>
+ <tabstop>editPixmapFunction</tabstop>
+ <tabstop>radioProjectImageFile</tabstop>
+ <tabstop>spinMargin</tabstop>
+ <tabstop>spinSpacing</tabstop>
+ <tabstop>checkLayoutFunctions</tabstop>
+ <tabstop>editMarginFunction</tabstop>
+ <tabstop>editSpacingFunction</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+<slots>
+ <slot>okClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/formsettingsimpl.cpp b/kdevdesigner/designer/formsettingsimpl.cpp
new file mode 100644
index 00000000..ce76dde7
--- /dev/null
+++ b/kdevdesigner/designer/formsettingsimpl.cpp
@@ -0,0 +1,118 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "formsettingsimpl.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "command.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "project.h"
+
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qradiobutton.h>
+#include <klineedit.h>
+#include <qspinbox.h>
+#include <qcheckbox.h>
+
+FormSettings::FormSettings( QWidget *parent, FormWindow *fw )
+ : FormSettingsBase( parent, 0, TRUE ), formwindow( fw )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( fw );
+ if ( info.classNameChanged && !info.className.isEmpty() )
+ editClassName->setText( info.className );
+ else
+ editClassName->setText( fw->name() );
+ editComment->setText( info.comment );
+ editAuthor->setText( info.author );
+
+ editClassName->setValidator( new AsciiValidator( QString( ":" ), editClassName ) );
+ editPixmapFunction->setValidator( new AsciiValidator( QString( ":" ), editPixmapFunction ) );
+
+ if ( formwindow->savePixmapInline() )
+ radioPixmapInline->setChecked( TRUE );
+ else if ( formwindow->savePixmapInProject() )
+ radioProjectImageFile->setChecked( TRUE );
+ else
+ radioPixmapFunction->setChecked( TRUE );
+ editPixmapFunction->setText( formwindow->pixmapLoaderFunction() );
+ radioProjectImageFile->setEnabled( !fw->project()->isDummy() );
+ spinSpacing->setValue( formwindow->layoutDefaultSpacing() );
+ spinMargin->setValue( formwindow->layoutDefaultMargin() );
+ editSpacingFunction->setValidator( new AsciiValidator( QString( ":" ), editSpacingFunction ) );
+ editMarginFunction->setValidator( new AsciiValidator( QString( ":" ), editMarginFunction ) );
+ checkLayoutFunctions->setChecked( formwindow->hasLayoutFunctions() );
+ editSpacingFunction->setText( formwindow->spacingFunction() );
+ editMarginFunction->setText( formwindow->marginFunction() );
+}
+
+void FormSettings::okClicked()
+{
+ MetaDataBase::MetaInfo info;
+ info.className = editClassName->text();
+ info.classNameChanged = info.className != QString( formwindow->name() );
+ info.comment = editComment->text();
+ info.author = editAuthor->text();
+ MetaDataBase::setMetaInfo( formwindow, info );
+
+ formwindow->commandHistory()->setModified( TRUE );
+
+ if ( formwindow->savePixmapInline() ) {
+ MetaDataBase::clearPixmapArguments( formwindow );
+ MetaDataBase::clearPixmapKeys( formwindow );
+ } else if ( formwindow->savePixmapInProject() ) {
+ MetaDataBase::clearPixmapArguments( formwindow );
+ } else {
+ MetaDataBase::clearPixmapKeys( formwindow );
+ }
+
+ if ( radioPixmapInline->isChecked() ) {
+ formwindow->setSavePixmapInline( TRUE );
+ formwindow->setSavePixmapInProject( FALSE );
+ } else if ( radioProjectImageFile->isChecked() ){
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( TRUE );
+ } else {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( FALSE );
+ }
+
+ if ( checkLayoutFunctions->isChecked() )
+ formwindow->hasLayoutFunctions( TRUE );
+ else
+ formwindow->hasLayoutFunctions( FALSE );
+
+ formwindow->setPixmapLoaderFunction( editPixmapFunction->text() );
+ formwindow->setLayoutDefaultSpacing( spinSpacing->value() );
+ formwindow->setSpacingFunction( editSpacingFunction->text() );
+ formwindow->setLayoutDefaultMargin( spinMargin->value() );
+ formwindow->setMarginFunction( editMarginFunction->text() );
+
+ accept();
+}
diff --git a/kdevdesigner/designer/formsettingsimpl.h b/kdevdesigner/designer/formsettingsimpl.h
new file mode 100644
index 00000000..08750fbc
--- /dev/null
+++ b/kdevdesigner/designer/formsettingsimpl.h
@@ -0,0 +1,49 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef FORMSETTINGSIMPL_H
+#define FORMSETTINGSIMPL_H
+
+#include "formsettings.h"
+
+class FormWindow;
+
+class FormSettings : public FormSettingsBase
+{
+ Q_OBJECT
+
+public:
+ FormSettings( QWidget *parent, FormWindow *fw );
+
+protected slots:
+ void okClicked();
+
+private:
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/formwindow.cpp b/kdevdesigner/designer/formwindow.cpp
new file mode 100644
index 00000000..d9de42cc
--- /dev/null
+++ b/kdevdesigner/designer/formwindow.cpp
@@ -0,0 +1,2775 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "defs.h"
+#include "mainwindow.h"
+#include "widgetfactory.h"
+#include "sizehandle.h"
+#include "metadatabase.h"
+#include "resource.h"
+#include "layout.h"
+#include "connectiondialog.h"
+#include <widgetdatabase.h>
+#include "pixmapchooser.h"
+#include "orderindicator.h"
+#include "hierarchyview.h"
+#include "designerappiface.h"
+#include "menubareditor.h"
+#define NO_STATIC_COLORS
+#include "globaldefs.h"
+
+#include <stdlib.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include "kdevdesigner_part.h"
+
+#include <qevent.h>
+#include <qpainter.h>
+#include <qpen.h>
+#include <qlabel.h>
+#include <qobjectlist.h>
+#include <qtimer.h>
+#include <qapplication.h>
+#include <qlayout.h>
+#include <qspinbox.h>
+#include <qstatusbar.h>
+#include <qapplication.h>
+#include <qpalette.h>
+#include <qmessagebox.h>
+#include <qpopupmenu.h>
+#include <qsizegrip.h>
+#include <qpushbutton.h>
+#include <qwhatsthis.h>
+#include <qmetaobject.h>
+#include <qtooltip.h>
+#include <qfeatures.h>
+#include <qaccel.h>
+#include <qpixmapcache.h>
+#include <qbitmap.h>
+#include <qsplitter.h>
+
+// FormWindow should be able to work to some limited degree
+// (existance, loading) without a MainWindow. Functions which require
+// a MainWindow in theory should never be called if no MainWindow
+// exists. These macros are used to let us know if that happens anyway
+// and to ensure that we don't crash
+#define CHECK_MAINWINDOW Q_ASSERT( mainWindow() ); if ( !mainWindow() ) return
+#define CHECK_MAINWINDOW_VALUE( v ) Q_ASSERT( mainWindow() ); if ( !mainWindow() ) return v
+
+static void setCursorToAll( const QCursor &c, QWidget *start )
+{
+ start->setCursor( c );
+ QObjectList *l = (QObjectList*)start->children();
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) )
+ setCursorToAll( c, ( (QWidget*)o ) );
+ }
+ }
+}
+
+static void restoreCursors( QWidget *start, FormWindow *fw )
+{
+ if ( fw->widgets()->find( start ) )
+ start->setCursor( MetaDataBase::cursor( start ) );
+ else
+ start->setCursor( Qt::ArrowCursor );
+ QObjectList *l = (QObjectList*)start->children();
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() && !::qt_cast<SizeHandle*>(o) )
+ restoreCursors( ( (QWidget*)o ), fw );
+ }
+ }
+}
+
+#if defined(Q_WS_WIN32) // #### needed for the workaround for repaint problem on windows
+#include <qt_windows.h>
+static void flickerfree_update( QWidget *w )
+{
+ InvalidateRect( w->winId(), 0, FALSE );
+}
+#endif
+
+/*!
+ \class FormWindow formwindow.h
+ \brief Editor window for a form
+
+ The FormWindow is the widget which is used as editor for forms. It
+ handles inserting, deleting, moving, resizing, etc. of widgets.
+
+ Normally multiple formwindows are used at the same time in the
+ Designer. So each formwindow has its own undo/redo buffer, etc.
+
+ Also the formwindow has some signals to inform e.g. about selection
+ changes which is interesting for the PropertyEditor.
+
+ For handling the events of the child widgets (moving, etc.) the
+ handleMousePress(), etc. functions are called from the application
+ event filter which is implemented in MainWindow::eventFilter().
+*/
+
+FormWindow::FormWindow( FormFile *f, MainWindow *mw, QWidget *parent, const char *name )
+ : QWidget( parent, name, WDestructiveClose ), mainwindow( mw ),
+ commands( 100 ), pixInline( TRUE ), pixProject( FALSE )
+{
+ ff = f;
+ init();
+ initSlots();
+}
+
+FormWindow::FormWindow( FormFile *f, QWidget *parent, const char *name )
+ : QWidget( parent, name, WDestructiveClose ), mainwindow( 0 ),
+ commands( 100 ), pixInline( TRUE )
+{
+ ff = f;
+ init();
+}
+
+void FormWindow::init()
+{
+ setWFlags(getWFlags() & Qt::WStyle_Maximize);
+
+ fake = qstrcmp( name(), "qt_fakewindow" ) == 0;
+ MetaDataBase::addEntry( this );
+ ff->setFormWindow( this );
+ iface = 0;
+ proj = 0;
+ propertyWidget = 0;
+ toolFixed = FALSE;
+ checkedSelectionsForMove = FALSE;
+ mContainer = 0;
+ startWidget = endWidget = 0;
+ currTool = POINTER_TOOL;
+ unclippedPainter = 0;
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ setFocusPolicy( ClickFocus );
+ sizePreviewLabel = 0;
+ checkSelectionsTimer = new QTimer( this, "checkSelectionsTimer" );
+ connect( checkSelectionsTimer, SIGNAL( timeout() ),
+ this, SLOT( invalidCheckedSelections() ) );
+ updatePropertiesTimer = new QTimer( this );
+ connect( updatePropertiesTimer, SIGNAL( timeout() ),
+ this, SLOT( updatePropertiesTimerDone() ) );
+ showPropertiesTimer = new QTimer( this );
+ //!!!!
+ connect( showPropertiesTimer, SIGNAL( timeout() ),
+ this, SLOT( showPropertiesTimerDone() ) );
+ selectionChangedTimer = new QTimer( this );
+ connect( selectionChangedTimer, SIGNAL( timeout() ),
+ this, SLOT( selectionChangedTimerDone() ) );
+ windowsRepaintWorkaroundTimer = new QTimer( this );
+ connect( windowsRepaintWorkaroundTimer, SIGNAL( timeout() ),
+ this, SLOT( windowsRepaintWorkaroundTimerTimeout() ) );
+ insertParent = 0;
+ connect( &commands, SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ),
+ this, SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ) );
+ propShowBlocked = FALSE;
+
+ setIcon( SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()) );
+
+ connect( &commands, SIGNAL( modificationChanged( bool ) ),
+ this, SLOT( modificationChanged( bool ) ) );
+ buffer = 0;
+
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QFrame" ), this );
+ setMainContainer( w );
+ propertyWidget = w;
+ targetContainer = 0;
+ hadOwnPalette = FALSE;
+
+ defSpacing = BOXLAYOUT_DEFAULT_SPACING;
+ defMargin = BOXLAYOUT_DEFAULT_MARGIN;
+ hasLayoutFunc = FALSE;
+}
+
+void FormWindow::setMainWindow( MainWindow *w )
+{
+ mainwindow = w;
+ MetaDataBase::addEntry( this );
+ initSlots();
+}
+
+void FormWindow::initSlots()
+{
+ if ( isFake() )
+ return;
+ Q_ASSERT( project() || MainWindow::self );
+ if ( !project() && !MainWindow::self )
+ return;
+ Project *p = project() ? project() : MainWindow::self->currProject();
+ if ( p && p->isCpp() ) {
+ QString code = formFile()->code();
+ if ( code.isEmpty() )
+ formFile()->setCode( formFile()->codeComment() );
+ }
+}
+
+FormWindow::~FormWindow()
+{
+ if ( MainWindow::self && MainWindow::self->objectHierarchy()->formWindow() == this )
+ MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 );
+
+ MetaDataBase::clear( this );
+ if ( ff )
+ ff->setFormWindow( 0 );
+ delete iface;
+}
+
+void FormWindow::closeEvent( QCloseEvent *e )
+{
+ QGuardedPtr<FormWindow> that = this;
+ if ( ff->closeEvent() && ( !that || ( mainwindow && mainwindow->unregisterClient( this ) ) ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void FormWindow::paintGrid( QWidget *w, QPaintEvent *e )
+{
+ if ( !mainWindow() || !mainWindow()->showGrid() )
+ return;
+ QPixmap grid;
+ QString grid_name;
+ grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y());
+ if( !QPixmapCache::find( grid_name, grid ) ) {
+ grid = QPixmap( 350 + ( 350 % mainWindow()->grid().x() ), 350 + ( 350 % mainWindow()->grid().y() ) );
+ grid.fill( colorGroup().color( QColorGroup::Foreground ) );
+ QBitmap mask( grid.width(), grid.height() );
+ mask.fill( color0 );
+ QPainter p( &mask );
+ p.setPen( color1 );
+ for ( int y = 0; y < grid.width(); y += mainWindow()->grid().y()) {
+ for ( int x = 0; x < grid.height(); x += mainWindow()->grid().x() ) {
+ p.drawPoint( x, y );
+ }
+ }
+ grid.setMask( mask );
+ QPixmapCache::insert( grid_name, grid );
+ }
+ QPainter p( w );
+ p.setClipRegion( e->rect() );
+ p.drawTiledPixmap( QRect( 0, 0, width(), height() ), grid );
+}
+
+/*! For operations like drawing a rubber band or drawing the rect
+ when inserting a new widget, a unclipped painter (which draws also
+ on child widgets) is needed. This method does all the initialization.
+*/
+
+void FormWindow::beginUnclippedPainter( bool doNot )
+{
+ endUnclippedPainter();
+ bool unclipped = testWFlags( WPaintUnclipped );
+ setWFlags( WPaintUnclipped );
+ unclippedPainter = new QPainter;
+ unclippedPainter->begin( this );
+ if ( !unclipped )
+ clearWFlags( WPaintUnclipped );
+ if ( doNot ) {
+ unclippedPainter->setPen( QPen( color0, 2 ) );
+ unclippedPainter->setRasterOp( NotROP );
+ }
+}
+
+/*!
+ Gets rid of an open unclipped painter.
+
+ \sa beginUnclippedPainter()
+*/
+
+void FormWindow::endUnclippedPainter()
+{
+ if ( unclippedPainter )
+ unclippedPainter->end();
+ delete unclippedPainter;
+ unclippedPainter = 0;
+}
+
+QPoint FormWindow::gridPoint( const QPoint &p )
+{
+ return QPoint( ( p.x() / grid().x() ) * grid().x(),
+ ( p.y() / grid().y() ) * grid().y() );
+}
+
+void FormWindow::drawSizePreview( const QPoint &pos, const QString& text )
+{
+ unclippedPainter->save();
+ unclippedPainter->setPen( QPen( colorGroup().foreground(), 1 ));
+ unclippedPainter->setRasterOp( CopyROP );
+ if ( !sizePreviewPixmap.isNull() )
+ unclippedPainter->drawPixmap( sizePreviewPos, sizePreviewPixmap );
+ if ( text.isNull() ) {
+ sizePreviewPixmap = QPixmap(); // set null again
+ unclippedPainter->restore();
+ return;
+ }
+ QRect r = fontMetrics().boundingRect( 0, 0, 0, 0, AlignCenter, text );
+ r = QRect( pos + QPoint( 10, 10 ), r.size() + QSize( 5, 5 ) );
+
+ checkPreviewGeometry( r );
+
+ sizePreviewPos = r.topLeft();
+ sizePreviewPixmap = QPixmap::grabWindow( winId(), r.x(), r.y(), r.width(), r.height() );
+ unclippedPainter->setBrush( QColor( 255, 255, 128 ) );
+ unclippedPainter->drawRect( r );
+ unclippedPainter->drawText( r, AlignCenter, text );
+ unclippedPainter->restore();
+}
+
+void FormWindow::insertWidget()
+{
+ CHECK_MAINWINDOW;
+ if ( !insertParent )
+ return;
+
+ if ( currTool == POINTER_TOOL )
+ return;
+
+ bool useSizeHint = !oldRectValid || ( currRect.width() < 2 && currRect.height() < 2 );
+ Orientation orient = Horizontal;
+ QString n = WidgetDatabase::className( currTool );
+ if ( useSizeHint && ( n == "Spacer" || n == "QSlider" || n == "Line" || n == "QScrollBar" ) ) {
+ QPopupMenu m( mainWindow() );
+ m.insertItem( i18n( "&Horizontal" ) );
+ int ver = m.insertItem( i18n( "&Vertical" ) );
+ int r = m.exec( QCursor::pos() );
+ if ( r == ver )
+ orient = Vertical;
+ }
+
+
+ QWidget *w = WidgetFactory::create( currTool, insertParent, 0, TRUE, &currRect, orient );
+ if ( !w )
+ return;
+
+ if ( !savePixmapInline() && currTool == WidgetDatabase::idFromClassName( "PixmapLabel" ) ) { // ### what to do for pixmaps in project
+ QPixmap pix;
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( SmallIcon( "designer_image.png" , KDevDesignerPartFactory::instance()).convertToImage() );
+ ( (QLabel*)w )->setPixmap( pix );
+ }
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
+ if ( WidgetDatabase::isCustomWidget( id ) ) {
+ QWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> "
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
+ "menu to add and change custom widgets. You can add "
+ "properties as well as signals and slots to integrate custom widgets into "
+ "<i>Qt Designer</i>, and provide a pixmap which will be used to represent "
+ "the widget on the form.</p>")
+ .arg(WidgetDatabase::toolTip( id )) );
+ QToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) );
+ } else {
+ QString tt = WidgetDatabase::toolTip( id );
+ QString wt = WidgetDatabase::whatsThis( id );
+ if ( !wt.isEmpty() && !tt.isEmpty() )
+ QWhatsThis::add( w, QString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) );
+ }
+
+ QString s = w->name();
+ unify( w, s, TRUE );
+ w->setName( s );
+ insertWidget( w );
+ QRect r( currRect );
+ if ( !oldRectValid ||
+ ( currRect.width() < 2 && currRect.height() < 2 ) )
+ r = QRect( rectAnchor, QSize( 0, 0 ) );
+
+ QPoint p = r.topLeft();
+ p = mapToGlobal( p );
+ p = insertParent->mapFromGlobal( p );
+ r = QRect( p, r.size() );
+
+ if ( useSizeHint ) {
+ if ( n == "Spacer" ) {
+ if ( orient == Vertical ) {
+ r.setWidth( 20 );
+ r.setHeight( 40 );
+ } else {
+ r.setWidth( 40 );
+ r.setHeight( 20 );
+ }
+ } else {
+ r.setWidth( w->sizeHint().width() );
+ r.setHeight( w->sizeHint().height() );
+ }
+ }
+
+ if ( r.width() < 2 * grid().x() )
+ r.setWidth( 2 * grid().x() );
+ if ( r.height() < 2 * grid().y() )
+ r.setHeight( 2 * grid().y() );
+
+ const QObjectList *l = insertParent->children();
+ QObjectListIt it( *l );
+ QWidgetList lst;
+ if ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ for ( ; it.current(); ) {
+ QObject *o = it.current();
+ ++it;
+ if ( o->isWidgetType() &&
+ ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.find( (QWidget*)o ) && o != w ) {
+ QRect r2( ( (QWidget*)o )->pos(),
+ ( (QWidget*)o )->size() );
+ if ( r.contains( r2 ) )
+ lst.append( (QWidget*)o );
+ }
+ }
+ }
+
+ if ( !lst.isEmpty() ) {
+ QWidget *pw = WidgetFactory::containerOfWidget( w );
+ if (pw) {
+ QValueList<QPoint> op, np;
+ for ( QWidget *i = lst.first(); i; i = lst.next() ) {
+ op.append( i->pos() );
+ QPoint pos = pw->mapFromGlobal( i->mapToGlobal( QPoint( 0, 0 ) ) );
+ pos -= r.topLeft();
+ np.append( pos );
+ }
+
+ MoveCommand *mv = new MoveCommand( i18n( "Reparent Widgets" ), this,
+ lst, op, np, insertParent, pw );
+
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ else
+ setCursorToAll( CrossCursor, w );
+
+ InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).arg( w->name() ), this, w, r );
+
+ QPtrList<Command> commands;
+ commands.append( mv );
+ commands.append( cmd );
+
+ MacroCommand *mc = new MacroCommand( i18n( "Insert %1" ).arg( w->name() ), this, commands );
+ commandHistory()->addCommand( mc );
+ mc->execute();
+ }
+ } else {
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ else
+ setCursorToAll( CrossCursor, w );
+
+ InsertCommand *cmd = new InsertCommand( i18n( "Insert %1" ).arg( w->name() ), this, w, r );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+
+ TemplateWizardInterface *iface = mainWindow()->templateWizardInterface( w->className() );
+ if ( iface ) {
+ iface->setup( w->className(), w, iFace(), mainWindow()->designerInterface() );
+ iface->release();
+ }
+}
+
+void FormWindow::insertWidget( QWidget *w, bool checkName )
+{
+ if ( !w )
+ return;
+ if ( checkName ) {
+ QString s = w->name();
+ unify( w, s, TRUE );
+ w->setName( s );
+ }
+
+ MetaDataBase::addEntry( w );
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) );
+ if ( WidgetDatabase::isCustomWidget( id ) ) {
+ QWhatsThis::add( w, i18n("<b>A %1 (custom widget)</b> "
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> "
+ "menu to add and change custom widgets. You can add "
+ "properties as well as signals and slots to integrate custom widgets into "
+ "<i>Qt Designer</i>, and provide a pixmap which will be used to represent "
+ "the widget on the form.</p>")
+ .arg(WidgetDatabase::toolTip( id )) );
+ QToolTip::add( w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip( id )) );
+ } else {
+ QString tt = WidgetDatabase::toolTip( id );
+ QString wt = WidgetDatabase::whatsThis( id );
+ if ( !wt.isEmpty() && !tt.isEmpty() )
+ QWhatsThis::add( w, QString("<b>A %1</b><p>%2</p>").arg( tt ).arg( wt ) );
+ }
+
+ restoreCursors( w, this );
+ widgets()->insert( w, w );
+ w->show();
+}
+
+void FormWindow::removeWidget( QWidget *w )
+{
+ MetaDataBase::removeEntry( w );
+ widgets()->take( w );
+}
+
+void FormWindow::handleContextMenu( QContextMenuEvent *e, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ switch ( currTool ) {
+ case POINTER_TOOL: {
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ raiseChildSelections( w ); // raise selections and select widget
+ selectWidget( w );
+ // if widget is laid out, find the first non-laid out super-widget
+ QWidget *realWidget = w; // but store the original one
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout ||
+ !insertedWidgets.find(w) ) )
+ w = w->parentWidget();
+ if ( ::qt_cast<QMainWindow*>(mainContainer()) && ((QMainWindow*)mainContainer())->centralWidget() == realWidget ) {
+ e->accept();
+ mainwindow->popupFormWindowMenu( e->globalPos(), this );
+ } else {
+ e->accept();
+ mainwindow->popupWidgetMenu( e->globalPos(), this, realWidget);
+ }
+ } else {
+ e->accept();
+ clearSelection();
+ mainwindow->popupFormWindowMenu( e->globalPos(), this );
+ }
+ break; }
+ default:
+ break;
+ }
+}
+
+void FormWindow::handleMousePress( QMouseEvent *e, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ checkedSelectionsForMove = FALSE;
+ checkSelectionsTimer->stop();
+ if ( !sizePreviewLabel ) {
+ sizePreviewLabel = new QLabel( this );
+ sizePreviewLabel->hide();
+ sizePreviewLabel->setBackgroundColor( QColor( 255, 255, 128 ) );
+ sizePreviewLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
+ }
+
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( !isMainContainer( w ) && qstrcmp( w->name(), "central widget" ) != 0 ) { // press on a child widget
+ // if the clicked widget is not in a layout, raise it
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ w->raise();
+ if ( ( e->state() & ControlButton ) ) { // with control pressed, always start rubber band selection
+ drawRubber = TRUE;
+ currRect = QRect( 0, 0, -1, -1 );
+ startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ break;
+ }
+
+ bool sel = isWidgetSelected( w );
+ if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) { // control not pressed...
+ if ( !sel ) { // ...and widget no selectted: unselect all
+ clearSelection( FALSE );
+ } else { // ...widget selected
+ // only if widget has a layout (it is a layout meta widget or a laid out container!), unselect its childs
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ) {
+ QObjectList *l = w->queryList( "QWidget" );
+ setPropertyShowingBlocked( TRUE );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( !o->isWidgetType() )
+ continue;
+ if ( insertedWidgets.find( (QWidget*)o ) )
+ selectWidget( (QWidget*)o, FALSE );
+ }
+ setPropertyShowingBlocked( FALSE );
+ delete l;
+ }
+ }
+ qApp->processEvents();
+ }
+ if ( ( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) &&
+ sel && e->button() == LeftButton ) { // control pressed and selected, unselect widget
+ selectWidget( w, FALSE );
+ break;
+ }
+
+ raiseChildSelections( w ); // raise selections and select widget
+ selectWidget( w );
+
+ // if widget is laid out, find the first non-laid out super-widget
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget()) != WidgetFactory::NoLayout || !insertedWidgets.find(w) ) )
+ w = w->parentWidget();
+
+ if ( e->button() == LeftButton ) { // left button: store original geometry and more as the widget might start moving
+ widgetPressed = TRUE;
+ widgetGeom = QRect( w->pos(), w->size() );
+ oldPressPos = w->mapFromGlobal( e->globalPos() );
+ origPressPos = oldPressPos;
+ checkedSelectionsForMove = FALSE;
+ moving.clear();
+ if ( w->parentWidget() && !isMainContainer( w->parentWidget() ) && !isCentralWidget( w->parentWidget() ) ) {
+ targetContainer = w->parentWidget();
+ hadOwnPalette = w->parentWidget()->ownPalette();
+ restorePalette = w->parentWidget()->palette();
+ }
+ }
+ } else { // press was on the formwindow
+ if ( e->button() == LeftButton ) { // left button: start rubber selection and show formwindow properties
+ drawRubber = TRUE;
+ if ( !( ( e->state() & ControlButton ) || ( e->state() & ShiftButton ) ) ) {
+ clearSelection( FALSE );
+ QObject *opw = propertyWidget;
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ }
+ currRect = QRect( 0, 0, -1, -1 );
+ startRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ }
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ if ( e->button() != LeftButton )
+ break;
+ validForBuddy = FALSE;
+ if ( currTool == BUDDY_TOOL ) {
+ if ( !::qt_cast<QLabel*>(w) )
+ break;
+ clearSelection( FALSE );
+ validForBuddy = TRUE;
+ mainWindow()->statusMessage( i18n( "Set buddy for '%1' to..." ).arg( w->name() ) );
+ } else {
+ mainWindow()->statusMessage( i18n( "Connect '%1' with..." ).arg( w->name() ) );
+ }
+ saveBackground();
+ startPos = mapFromGlobal( e->globalPos() );
+ currentPos = startPos;
+ startWidget = designerWidget( w );
+ endWidget = startWidget;
+ beginUnclippedPainter( FALSE );
+ drawConnectionLine();
+ break;
+ case ORDER_TOOL:
+ if ( !isMainContainer( w ) ) { // press on a child widget
+ orderedWidgets.removeRef( w );
+ orderedWidgets.append( w );
+ for ( QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
+ int i = stackedWidgets.findRef( wid );
+ if ( i != -1 ) {
+ stackedWidgets.removeRef( wid );
+ stackedWidgets.insert( 0, wid );
+ }
+ }
+ QWidgetList oldl = MetaDataBase::tabOrder( this );
+ TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd, TRUE );
+ updateOrderIndicators();
+ }
+ break;
+ default: // any insert widget tool
+ if ( e->button() == LeftButton ) {
+ insertParent = WidgetFactory::containerOfWidget( mainContainer() ); // default parent for new widget is the formwindow
+ if ( !isMainContainer( w ) ) { // press was not on formwindow, check if we can find another parent
+ QWidget *wid = w;
+ for (;;) {
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( wid ) );
+ if ( ( WidgetDatabase::isContainer( id ) || wid == mainContainer() ) &&
+ !::qt_cast<QLayoutWidget*>(wid) && !::qt_cast<QSplitter*>(wid) ) {
+ insertParent = WidgetFactory::containerOfWidget( wid ); // found another parent, store it
+ break;
+ } else {
+ wid = wid->parentWidget();
+ if ( !wid )
+ break;
+ }
+ }
+ }
+ startRectDraw( w->mapFromGlobal( e->globalPos() ), e->globalPos(), w, Insert );
+ }
+ break;
+ }
+}
+
+void FormWindow::handleMouseDblClick( QMouseEvent *, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ switch ( currTool ) {
+ case ORDER_TOOL:
+ if ( !isMainContainer( w ) ) { // press on a child widget
+ orderedWidgets.clear();
+ orderedWidgets.append( w );
+ for ( QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev() ) {
+ int i = stackedWidgets.findRef( wid );
+ if ( i != -1 ) {
+ stackedWidgets.removeRef( wid );
+ stackedWidgets.insert( 0, wid );
+ }
+ }
+ QWidgetList oldl = MetaDataBase::tabOrder( this );
+ TabOrderCommand *cmd = new TabOrderCommand( i18n( "Change Tab Order" ), this, oldl, stackedWidgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd, TRUE );
+ updateOrderIndicators();
+ }
+ default:
+ if ( !WidgetFactory::isPassiveInteractor( w ) &&
+ ( isMainContainer( w ) || w == this ) )
+ mainWindow()->editSource();
+ break;
+ }
+}
+
+void FormWindow::handleMouseMove( QMouseEvent *e, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ if ( ( e->state() & LeftButton ) != LeftButton )
+ return;
+
+ QWidget *newendWidget = endWidget, *oldendWidget = endWidget, *wid;
+ bool drawRecRect;
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( widgetPressed && allowMove( w ) ) { // we are prepated for a move
+
+ // if widget is laid out, find the first non-laid out super-widget
+ while ( w->parentWidget() &&
+ ( WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout || !insertedWidgets.find(w ) ) )
+ w = w->parentWidget();
+
+ // calc correct position
+ QPoint pos = w->mapFromGlobal( e->globalPos() );
+
+#if 0
+ QPoint mpos = w->mapToParent( pos );
+ // check if we are not outside the visible area, else correct coords
+ if ( mpos.x() < 0 )
+ pos.setX( w->mapFromParent( QPoint( 0, mpos.y() ) ).x() );
+ if ( mpos.y() < 0 )
+ pos.setY( w->mapFromParent( QPoint( mpos.x(), 0 ) ).y() );
+ if ( mpos.x() > w->parentWidget()->width() )
+ pos.setX( w->mapFromParent( QPoint( w->parentWidget()->width(), mpos.y() ) ).x() );
+ if ( mpos.y() > w->parentWidget()->height() )
+ pos.setY( w->mapFromParent( QPoint( mpos.x(), w->parentWidget()->height() ) ).y() );
+#endif
+
+ // calc move distance and store it
+ QPoint d = oldPressPos - pos;
+ if ( QABS( d.x() ) < grid().x() )
+ d.setX( 0 );
+ if ( QABS( d.y() ) < grid().y() )
+ d.setY( 0 );
+ if ( d.x() == 0 )
+ pos.setX( oldPressPos.x() );
+ if ( d.y() == 0 )
+ pos.setY( oldPressPos.y() );
+ oldPressPos = pos;
+
+ // snap to grid
+ int x = widgetGeom.x() - d.x();
+ widgetGeom.setX( x );
+ x = ( x / grid().x() ) * grid().x();
+ int y = widgetGeom.y() - d.y();
+ widgetGeom.setY( y );
+ y = ( y / grid().y() ) * grid().y();
+ QPoint p = w->pos();
+
+ if ( x - p.x() != 0 || y - p.y() != 0 ) { // if we actually have to move
+ if ( !checkedSelectionsForMove ) { // if not checked yet, check if the correct widget are selected...
+ if ( !isWidgetSelected( w ) ) { // and unselect others. Only siblings can be moved at the same time
+ setPropertyShowingBlocked( TRUE );
+ selectWidget( w );
+ setPropertyShowingBlocked( FALSE );
+ }
+ checkSelectionsForMove( w );
+ }
+
+ // check whether we would have to reparent the selection and highlight the possible new parent container
+ QMapConstIterator<QWidget*, QPoint> it = moving.begin();
+ QWidget* wa = containerAt( e->globalPos(), it.key() );
+ if ( wa && !isMainContainer( wa ) && !isCentralWidget( wa ) ) {
+ wa = WidgetFactory::containerOfWidget( wa );
+ // ok, looks like we moved onto a container
+
+ if ( wa != targetContainer ) {
+ if ( targetContainer ) {
+ if ( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ }
+ targetContainer = wa;
+ hadOwnPalette = wa->ownPalette();
+ restorePalette = wa->palette();
+ wa->setPaletteBackgroundColor( wa->colorGroup().midlight() );
+ }
+ }
+ else if ( targetContainer ) {
+ if( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ targetContainer = 0;
+ }
+
+ // finally move the selected widgets and show/update preview label
+ moveSelectedWidgets( x - p.x(), y - p.y() );
+ sizePreviewLabel->setText( i18n( "%1/%2" ).arg( w->pos().x() ).arg( w->pos().y() ) );
+ sizePreviewLabel->adjustSize();
+ QRect lg( mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ), sizePreviewLabel->size() );
+ checkPreviewGeometry( lg );
+ sizePreviewLabel->setGeometry( lg );
+ sizePreviewLabel->raise();
+ sizePreviewLabel->show();
+#if defined(Q_WS_WIN32)
+ windowsRepaintWorkaroundTimer->start( 100, TRUE );
+#endif
+ } else { // if we don't need to move, do some indication
+ QRect lg( mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ), sizePreviewLabel->size() );
+ checkPreviewGeometry( lg );
+ sizePreviewLabel->move( lg.x(), lg.y() );
+ }
+
+ oldPressPos += ( p - w->pos() );
+ } else if ( drawRubber ) { // draw rubber if we are in rubber-selection mode
+ continueRectDraw( mapFromGlobal( e->globalPos() ), e->globalPos(), this, Rubber );
+ }
+ break;
+ case CONNECT_TOOL:
+ restoreConnectionLine();
+ wid = qApp->widgetAt( e->globalPos(), TRUE );
+ if ( wid )
+ wid = designerWidget( wid );
+ if ( wid && ( isMainContainer( wid ) || insertedWidgets.find( wid ) ) && wid->isVisibleTo( this ) )
+ newendWidget = wid;
+ if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) )
+ newendWidget = (QWidget*)endWidget;
+ drawRecRect = newendWidget != endWidget;
+ if ( newendWidget &&
+ ( isMainContainer( newendWidget ) || insertedWidgets.find( newendWidget ) ) && !isCentralWidget( newendWidget ) )
+ endWidget = newendWidget;
+ mainWindow()->statusMessage( i18n( "Connect '%1' to '%2'" ).arg( startWidget->name() ).
+ arg( endWidget->name() ) );
+ currentPos = mapFromGlobal( e->globalPos() );
+ qApp->processEvents();
+ if ( drawRecRect )
+ restoreRect( QRect( mapToForm( ( (QWidget*)oldendWidget )->parentWidget(), ( (QWidget*)oldendWidget )->pos() ),
+ ( (QWidget*)oldendWidget )->size() ) );
+ drawConnectionLine();
+ break;
+ case BUDDY_TOOL:
+ if ( !validForBuddy )
+ break;
+ restoreConnectionLine();
+ wid = qApp->widgetAt( e->globalPos(), TRUE );
+ if ( wid )
+ wid = designerWidget( wid );
+ if ( wid && canBeBuddy( wid ) && wid->isVisibleTo( this ) )
+ newendWidget = wid;
+ else
+ newendWidget = 0;
+ if ( ::qt_cast<QLayoutWidget*>(newendWidget) || ::qt_cast<Spacer*>(newendWidget) )
+ newendWidget = (QWidget*)endWidget;
+ drawRecRect = newendWidget != endWidget;
+ if ( !newendWidget )
+ endWidget = newendWidget;
+ else if ( insertedWidgets.find( newendWidget ) && !isCentralWidget( newendWidget ) )
+ endWidget = newendWidget;
+ if ( endWidget )
+ mainWindow()->statusMessage( i18n( "Set buddy '%1' to '%2'" ).arg( startWidget->name() ).
+ arg( endWidget->name() ) );
+ else
+ mainWindow()->statusMessage( i18n( "Set buddy '%1' to ..." ).arg( startWidget->name() ) );
+ currentPos = mapFromGlobal( e->globalPos() );
+ qApp->processEvents();
+ if ( drawRecRect && oldendWidget )
+ restoreRect( QRect( mapToForm( ( (QWidget*)oldendWidget )->parentWidget(), ( (QWidget*)oldendWidget )->pos() ),
+ ( (QWidget*)oldendWidget )->size() ) );
+ drawConnectionLine();
+ break;
+ case ORDER_TOOL:
+ break;
+ default: // we are in an insert-widget tool
+ if ( insertParent ) // draw insert rect
+ continueRectDraw( w->mapFromGlobal( e->globalPos() ), e->globalPos(), w, Insert );
+ break;
+ }
+}
+
+void FormWindow::handleMouseRelease( QMouseEvent *e, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ if ( e->button() != LeftButton )
+ return;
+
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( widgetPressed && allowMove( w ) ) { // we moved the widget
+ sizePreviewLabel->hide();
+
+ if ( moving.isEmpty() || w->pos() == *moving.find(w) )
+ break;
+
+ // restore targetContainer
+ if ( targetContainer ) {
+ if( hadOwnPalette )
+ targetContainer->setPalette( restorePalette );
+ else
+ targetContainer->unsetPalette();
+ }
+
+ // tell property editor to update
+ if ( propertyWidget && propertyWidget->isWidgetType() && !isMainContainer( propertyWidget ) )
+ emitUpdateProperties( propertyWidget );
+
+ QMapConstIterator<QWidget*,QPoint> it = moving.begin();
+ QWidget *oldParent = it.key()->parentWidget();
+ QWidget *newParent = oldParent;
+ // check whether we have to reparent the selection
+ QWidget* wa = containerAt( e->globalPos(), it.key() );
+ if ( wa ) {
+ wa = WidgetFactory::containerOfWidget( wa );
+ // ok, looks like we moved onto a container
+
+ // check whether we really have different parents.
+ if ( wa == it.key()->parentWidget() )
+ goto make_move_command;
+
+ // break layout if necessary
+ if ( WidgetFactory::layoutType( wa ) != WidgetFactory::NoLayout ) {
+ if ( QMessageBox::information( mainWindow(), i18n( "Inserting Widget" ),
+ i18n( "You tried to insert a widget into the "
+ "layout Container Widget '%1'.\n"
+ "This is not possible. "
+ "In order to insert the widget, the layout of '%1'\n"
+ "must first be broken.\n"
+ "Break the layout or cancel the operation?" ).
+ arg( wa->name() ).
+ arg( wa->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) )
+ goto make_move_command; // cancel
+ breakLayout( wa );
+ }
+
+ // doesn't need to be a command, the MoveCommand does reparenting too
+ bool emitSelChanged = FALSE;
+ for ( QMap<QWidget*, QPoint>::Iterator it = moving.begin(); it != moving.end(); ++it ) {
+ QWidget *i = it.key();
+ if ( !emitSelChanged && ::qt_cast<QButton*>(i) ) {
+ if ( ::qt_cast<QButtonGroup*>(i->parentWidget()) || ::qt_cast<QButtonGroup*>(wa) )
+ emitSelChanged = TRUE;
+ if ( !::qt_cast<QButtonGroup*>(wa) ) {
+ MetaDataBase::setPropertyChanged( i, "buttonGroupId", FALSE );
+ if ( ::qt_cast<QButtonGroup*>(i->parentWidget()) )
+ ( (QButtonGroup*)i->parentWidget() )->remove( (QButton*)i );
+ }
+ }
+ QPoint pos = wa->mapFromGlobal( i->mapToGlobal( QPoint(0,0) ) );
+ i->reparent( wa, pos, TRUE );
+ raiseSelection( i );
+ raiseChildSelections( i );
+ widgetChanged( i );
+ mainWindow()->objectHierarchy()->widgetRemoved( i );
+ mainWindow()->objectHierarchy()->widgetInserted( i );
+ }
+ if ( emitSelChanged ) {
+ emit showProperties( wa );
+ emit showProperties( propertyWidget );
+ }
+ newParent = wa;
+ }
+
+ make_move_command:
+ QWidgetList widgets; // collect the widgets and its old and new positions which have been moved
+ QValueList<QPoint> oldPos, newPos;
+ for ( it = moving.begin(); it != moving.end(); ++it ) {
+ widgets.append( it.key() );
+ oldPos.append( *it );
+ newPos.append( it.key()->pos() );
+ }
+ // add move command, don't execute it, this is just a summary of the operations we did during the move-event handling
+ commandHistory()->addCommand( new MoveCommand( i18n( "Move" ),
+ this, widgets,
+ oldPos, newPos, oldParent, newParent ) );
+ } else if ( drawRubber ) { // we were drawing a rubber selection
+ endRectDraw(); // get rid of the rectangle
+ blockSignals( TRUE );
+ selectWidgets(); // select widgets which intersect the rect
+ blockSignals( FALSE );
+ emitSelectionChanged(); // inform about selection changes
+ if ( propertyWidget )
+ emitShowProperties( propertyWidget );
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ restoreConnectionLine();
+ if ( startWidget )
+ restoreRect( QRect( mapToForm( ( (QWidget*)startWidget )->parentWidget(),
+ ( (QWidget*)startWidget )->pos() ),
+ ((QWidget*)startWidget )->size() ) );
+ if ( endWidget )
+ restoreRect( QRect( mapToForm( ( (QWidget*)endWidget )->parentWidget(),
+ ( (QWidget*)endWidget )->pos() ),
+ ( (QWidget*)endWidget )->size() ) );
+ endUnclippedPainter();
+ qApp->processEvents();
+
+ if ( startWidget && endWidget ) {
+ if ( currTool == CONNECT_TOOL )
+ editConnections();
+ else if ( currTool == BUDDY_TOOL && validForBuddy && startWidget != endWidget ) {
+ QString oldBuddy = startWidget->property( "buddy" ).toString();
+ if ( oldBuddy.isNull() )
+ oldBuddy = "";
+ SetPropertyCommand *cmd = new SetPropertyCommand( i18n( "Set Buddy for %1" ).arg( startWidget->name() ),
+ this, startWidget, mainWindow()->propertyeditor(),
+ "buddy", startWidget->property( "buddy" ),
+ endWidget->name(), endWidget->name(),
+ oldBuddy );
+ commandHistory()->addCommand( cmd, TRUE );
+ cmd->execute();
+ emitUpdateProperties( startWidget );
+ }
+ }
+ if ( !toolFixed )
+ mainwindow->resetTool();
+ startWidget = endWidget = 0;
+ mainWindow()->statusBar()->clear();
+ break;
+ case ORDER_TOOL:
+ break;
+ default: // any insert widget tool is active
+ if ( insertParent ) { // we should insert the new widget now
+ endRectDraw();
+ if ( WidgetFactory::layoutType( insertParent ) != WidgetFactory::NoLayout ) {
+ if ( QMessageBox::information( mainWindow(), i18n( "Inserting Widget" ),
+ i18n( "You tried to insert a widget into the "
+ "layout Container Widget '%1'.\n"
+ "This is not possible. "
+ "In order to insert the widget, the layout of '%1'\n"
+ "must first be broken.\n"
+ "Break the layout or cancel the operation?" ).
+ arg( insertParent->name() ).
+ arg( insertParent->name() ), i18n( "&Break Layout" ), i18n( "&Cancel" ) ) == 0 ) {
+ breakLayout( insertParent );
+ } else {
+ if ( !toolFixed )
+ mainWindow()->resetTool();
+ break;
+ }
+ }
+ insertWidget(); // so do it
+ }
+ break;
+ }
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ insertParent = 0;
+ delete buffer;
+ buffer = 0;
+}
+
+void FormWindow::handleKeyPress( QKeyEvent *e, QWidget *w )
+{
+ CHECK_MAINWINDOW;
+ e->ignore();
+ checkSelectionsTimer->stop();
+ if ( !checkedSelectionsForMove &&
+ ( e->key() == Key_Left ||
+ e->key() == Key_Right ||
+ e->key() == Key_Up ||
+ e->key() == Key_Down ) &&
+ propertyWidget->isWidgetType() )
+ checkSelectionsForMove( (QWidget*)propertyWidget );
+ checkSelectionsTimer->start( 1000, TRUE );
+ if ( e->key() == Key_Left || e->key() == Key_Right ||
+ e->key() == Key_Up || e->key() == Key_Down ) {
+ QWidgetList widgets;
+ QValueList<QPoint> oldPos, newPos;
+ for ( WidgetSelection *s = selections.first(); s; s = selections.next() ) {
+ if ( s->isUsed() ) {
+ int dx = 0, dy = 0;
+ bool control = e->state() & ControlButton;
+
+ switch ( e->key() ) {
+ case Key_Left: {
+ e->accept();
+ if ( control )
+ dx = -1;
+ else
+ dx = -grid().x();
+ } break;
+ case Key_Right: {
+ e->accept();
+ if ( control )
+ dx = 1;
+ else
+ dx = grid().x();
+ } break;
+ case Key_Up: {
+ e->accept();
+ if ( control )
+ dy = -1;
+ else
+ dy = -grid().y();
+ } break;
+ case Key_Down: {
+ e->accept();
+ if ( control )
+ dy = 1;
+ else
+ dy = grid().y();
+ } break;
+ default:
+ break;
+ }
+
+ widgets.append( s->widget() );
+ oldPos.append( s->widget()->pos() );
+ newPos.append( s->widget()->pos() + QPoint( dx, dy ) );
+ }
+ }
+ if ( !widgets.isEmpty() ) {
+ MoveCommand *cmd = new MoveCommand( i18n( "Move" ), this,
+ widgets, oldPos, newPos, 0, 0 );
+ commandHistory()->addCommand( cmd, TRUE );
+ cmd->execute();
+ }
+ }
+ if ( !e->isAccepted() ) {
+ QObjectList *l = queryList( "QWidget" );
+ if ( !l )
+ return;
+ if ( l->find( w ) != -1 )
+ e->accept();
+ delete l;
+ }
+
+}
+
+void FormWindow::handleKeyRelease( QKeyEvent *e, QWidget * )
+{
+ e->ignore();
+}
+
+void FormWindow::selectWidget( QObject *o, bool select )
+{
+ CHECK_MAINWINDOW;
+ if ( !o->isWidgetType() ) {
+ // ########### do QObject stuff
+ return;
+ }
+
+ QWidget *w = (QWidget*)o;
+
+ if ( isMainContainer( w ) ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ emitShowProperties( propertyWidget );
+ return;
+ }
+
+ if ( ::qt_cast<QMainWindow*>(mainContainer()) && w == ( (QMainWindow*)mainContainer() )->centralWidget() ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ emitShowProperties( propertyWidget );
+ return;
+ }
+
+ if ( ::qt_cast<QDesignerToolBar*>(o) )
+ return;
+
+ if ( select ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = w;
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ if ( !isPropertyShowingBlocked() )
+ emitShowProperties( propertyWidget );
+ WidgetSelection *s = usedSelections.find( w );
+ if ( s ) {
+ s->show();
+ return;
+ }
+
+ for ( WidgetSelection *s2 = selections.first(); s2; s2 = selections.next() ) {
+ if ( !s2->isUsed() ) {
+ s = s2;
+ }
+ }
+
+ if ( !s ) {
+ s = new WidgetSelection( this, &usedSelections );
+ selections.append( s );
+ }
+
+ s->setWidget( w );
+ emitSelectionChanged();
+ } else {
+ WidgetSelection *s = usedSelections.find( w );
+ if ( s )
+ s->setWidget( 0 );
+ QObject *opw = propertyWidget;
+ if ( !usedSelections.isEmpty() )
+ propertyWidget = QPtrDictIterator<WidgetSelection>( usedSelections ).current()->widget();
+ else
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ if ( !isPropertyShowingBlocked() )
+ emitShowProperties( propertyWidget );
+ emitSelectionChanged();
+ }
+}
+
+QPoint FormWindow::grid() const
+{
+ if ( !mainWindow() || !mainWindow()->snapGrid() )
+ return QPoint( 1, 1 );
+ return mainWindow()->grid();
+}
+
+void FormWindow::updateSelection( QWidget *w )
+{
+ WidgetSelection *s = usedSelections.find( w );
+ if ( !w->isVisibleTo( this ) )
+ selectWidget( w, FALSE );
+ else if ( s )
+ s->updateGeometry();
+}
+
+void FormWindow::raiseSelection( QWidget *w )
+{
+ WidgetSelection *s = usedSelections.find( w );
+ if ( s )
+ s->show();
+}
+
+void FormWindow::repaintSelection( QWidget *w )
+{
+ WidgetSelection *s = usedSelections.find( w );
+ if ( s )
+ s->update();
+}
+
+void FormWindow::clearSelection( bool changePropertyDisplay )
+{
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ it.current()->setWidget( 0, FALSE );
+
+ usedSelections.clear();
+ if ( changePropertyDisplay ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ emitShowProperties( propertyWidget );
+ }
+ emitSelectionChanged();
+}
+
+void FormWindow::startRectDraw( const QPoint &p, const QPoint &global, QWidget *, RectType t )
+{
+ QPoint pos( p );
+ pos = mapFromGlobal( global );
+ oldRectValid = FALSE;
+ beginUnclippedPainter( TRUE );
+ if ( t == Rubber )
+ unclippedPainter->setPen( QPen( color0, 1 ) );
+ if ( t == Insert )
+ rectAnchor = gridPoint( pos );
+ else if ( t == Rubber )
+ rectAnchor = pos;
+ currRect = QRect( rectAnchor, QPoint( 0, 0 ) );
+ if ( t == Insert )
+ drawSizePreview( pos, i18n("Use Size Hint") );
+}
+
+void FormWindow::continueRectDraw( const QPoint &p, const QPoint &global, QWidget *, RectType t )
+{
+ QPoint pos =p;
+ pos = mapFromGlobal( global );
+ QPoint p2;
+ if ( t == Insert )
+ p2 = gridPoint( pos );
+ else if ( t == Rubber )
+ p2 = pos;
+ QRect r( rectAnchor, p2 );
+ r = r.normalize();
+
+ if ( currRect == r ) {
+ QString t = i18n( "%1/%2" );
+ t = t.arg( r.width() - 1 ).arg( r.height() - 1 );
+ drawSizePreview( pos, t );
+ return;
+ }
+
+ if ( oldRectValid )
+ unclippedPainter->drawRect( currRect );
+ if ( r.width() > 1 || r.height() > 1 ) {
+ oldRectValid = TRUE;
+ currRect = r;
+ if ( t == Insert ) {
+ QString t = i18n( "%1/%2" );
+ t = t.arg( r.width() - 1 ).arg( r.height() - 1 );
+ drawSizePreview( pos, t );
+ }
+ unclippedPainter->setClipRegion( QRegion( rect() ).subtract( QRect( sizePreviewPos, sizePreviewPixmap.size() ) ) );
+ unclippedPainter->drawRect( currRect );
+ unclippedPainter->setClipping( FALSE );
+ } else {
+ oldRectValid = FALSE;
+ if ( t == Insert )
+ drawSizePreview( pos, i18n("Use Size Hint") );
+ }
+}
+
+void FormWindow::endRectDraw()
+{
+ if ( !unclippedPainter )
+ return;
+
+ if ( oldRectValid )
+ unclippedPainter->drawRect( currRect );
+ drawSizePreview( QPoint(-1,-1), QString::null );
+ endUnclippedPainter();
+}
+
+void FormWindow::selectWidgets()
+{
+ QObjectList *l = mainContainer()->queryList( "QWidget" );
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ QPoint p = ( (QWidget*)o )->mapToGlobal( QPoint(0,0) );
+ p = mapFromGlobal( p );
+ QRect r( p, ( (QWidget*)o )->size() );
+ if ( r.intersects( currRect ) && !r.contains( currRect ) )
+ selectWidget( (QWidget*)o );
+ }
+ }
+ delete l;
+ }
+ emitSelectionChanged();
+}
+
+bool FormWindow::isWidgetSelected( QObject *w )
+{
+ if ( w->isWidgetType() )
+ return usedSelections.find( (QWidget*)w ) != 0;
+ return FALSE; // #### do stuff for QObjects
+}
+
+void FormWindow::moveSelectedWidgets( int dx, int dy )
+{
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ WidgetSelection *s = it.current();
+ QWidget *w = s->widget();
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ w->move( w->x() + dx, w->y() + dy );
+ s->updateGeometry();
+ updateChildSelections( w );
+ }
+}
+
+CommandHistory *FormWindow::commandHistory()
+{
+ return &commands;
+}
+
+void FormWindow::undo()
+{
+ commandHistory()->undo();
+}
+
+void FormWindow::redo()
+{
+ commandHistory()->redo();
+}
+
+void FormWindow::raiseChildSelections( QWidget *w )
+{
+ QObjectList *l = w->queryList( "QWidget" );
+ if ( !l || !l->first() ) {
+ delete l;
+ return;
+ }
+
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ if ( l->findRef( it.current()->widget() ) != -1 )
+ it.current()->show();
+ }
+ delete l;
+}
+
+void FormWindow::updateChildSelections( QWidget *w )
+{
+ QObjectList *l = w->queryList( "QWidget" );
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ insertedWidgets.find( (QWidget*)o ) )
+ updateSelection( (QWidget*)o );
+ }
+ delete l;
+ }
+}
+
+void FormWindow::checkSelectionsForMove( QWidget *w )
+{
+ checkedSelectionsForMove = TRUE;
+
+ QObjectList *l = w->parentWidget()->queryList( "QWidget", 0, FALSE, FALSE );
+ moving.clear();
+ if ( l ) {
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ WidgetSelection *sel;
+ while ( ( sel = it.current() ) != 0 ) {
+ if ( it.current()->widget() == mainContainer() )
+ continue;
+ ++it;
+ if ( l->find( sel->widget() ) == -1 ) {
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ sel->setWidget( 0 );
+ } else {
+ if ( WidgetFactory::layoutType( sel->widget()->parentWidget() ) == WidgetFactory::NoLayout ) {
+ moving.insert( sel->widget(), sel->widget()->pos() );
+ sel->widget()->raise();
+ raiseChildSelections( sel->widget() );
+ raiseSelection( sel->widget() );
+ }
+ }
+ }
+ delete l;
+ }
+}
+
+void FormWindow::deleteWidgets()
+{
+ CHECK_MAINWINDOW;
+ QWidgetList widgets;
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it ) {
+ QWidget *tb = 0;
+ if ( !( tb = mainWindow()->isAToolBarChild( it.current()->widget() ) ) )
+ widgets.append( it.current()->widget() );
+ else
+ ( (QDesignerToolBar*)tb )->removeWidget( it.current()->widget() );
+ }
+
+ if ( widgets.isEmpty() )
+ return;
+
+ DeleteCommand *cmd = new DeleteCommand( i18n( "Delete" ), this, widgets );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::editAdjustSize()
+{
+ QPtrList<Command> commands;
+ QWidgetList widgets = selectedWidgets();
+ if ( widgets.isEmpty() ) {
+ QRect oldr = geometry();
+ mainContainer()->adjustSize();
+ resize( mainContainer()->size() );
+ // check whether our own size constraint hit us
+ if ( size() != mainContainer()->size() )
+ mainContainer()->resize( size() );
+ QRect nr = geometry();
+ if ( oldr != nr ) {
+ ResizeCommand *cmd = new ResizeCommand( i18n( "Adjust Size" ), this, this, oldr, nr );
+ commandHistory()->addCommand( cmd );
+ }
+ return;
+ }
+ for ( QWidget* w = widgets.first(); w; w = widgets.next() ) {
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ QRect oldr = w->geometry();
+ w->adjustSize();
+ QRect nr = w->geometry();
+ if ( oldr != nr )
+ commands.append( new ResizeCommand( i18n("Adjust Size"), this, w, oldr, nr ) );
+ }
+
+ if ( commands.isEmpty() )
+ return;
+ for ( WidgetSelection *s = selections.first(); s; s = selections.next() )
+ s->updateGeometry();
+
+ MacroCommand *cmd = new MacroCommand( i18n( "Adjust Size" ), this, commands );
+ commandHistory()->addCommand( cmd );
+}
+
+
+QWidgetList FormWindow::selectedWidgets() const
+{
+ QWidgetList widgets;
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+ return widgets;
+}
+
+void FormWindow::widgetChanged( QObject *w )
+{
+ if ( w->isWidgetType() )
+ updateSelection( (QWidget*)w );
+ // ########## do QObject stuff
+}
+
+QLabel *FormWindow::sizePreview() const
+{
+ if ( !sizePreviewLabel ) {
+ ( (FormWindow*)this )->sizePreviewLabel = new QLabel( (FormWindow*)this );
+ ( (FormWindow*)this )->sizePreviewLabel->hide();
+ ( (FormWindow*)this )->sizePreviewLabel->setBackgroundColor( QColor( 255, 255, 128 ) );
+ ( (FormWindow*)this )->sizePreviewLabel->setFrameStyle( QFrame::Plain | QFrame::Box );
+ }
+ return sizePreviewLabel;
+}
+
+void FormWindow::invalidCheckedSelections()
+{
+ checkedSelectionsForMove = FALSE;
+}
+
+void FormWindow::checkPreviewGeometry( QRect &r )
+{
+ if ( !rect().contains( r ) ) {
+ if ( r.left() < rect().left() )
+ r.moveTopLeft( QPoint( 0, r.top() ) );
+ if ( r.right() > rect().right() )
+ r.moveBottomRight( QPoint( rect().right(), r.bottom() ) );
+ if ( r.top() < rect().top() )
+ r.moveTopLeft( QPoint( r.left(), rect().top() ) );
+ if ( r.bottom() > rect().bottom() )
+ r.moveBottomRight( QPoint( r.right(), rect().bottom() ) );
+ }
+}
+
+void FormWindow::focusInEvent( QFocusEvent * ){
+
+ if (ff)
+ ff->checkTimeStamp();
+}
+
+void FormWindow::focusOutEvent( QFocusEvent * )
+{
+ if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = mainContainer();
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ }
+}
+
+void FormWindow::resizeEvent( QResizeEvent *e )
+{
+ QWidget::resizeEvent( e );
+ if ( currTool == ORDER_TOOL )
+ repositionOrderIndicators();
+ if ( isVisible() )
+ formFile()->setModified( TRUE, FormFile::WFormWindow );
+
+#if defined(Q_WS_WIN32)
+ windowsRepaintWorkaroundTimer->start( 100, TRUE );
+#endif
+}
+
+void FormWindow::windowsRepaintWorkaroundTimerTimeout()
+{
+#if defined(Q_WS_WIN32)
+ QObjectList *l = queryList( "QWidget" );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ flickerfree_update( (QWidget*)o );
+ }
+ flickerfree_update( this );
+ delete l;
+#endif
+}
+
+QPtrDict<QWidget> *FormWindow::widgets()
+{
+ return &insertedWidgets;
+}
+
+QWidget *FormWindow::designerWidget( QObject *o ) const
+{
+ if ( !o || !o->isWidgetType() )
+ return 0;
+ QWidget *w = (QWidget*)o;
+ while ( w && !isMainContainer( w ) && !insertedWidgets[ (void*)w ] || isCentralWidget( w ) )
+ w = (QWidget*)w->parent();
+ return w;
+}
+
+void FormWindow::emitShowProperties( QObject *w )
+{
+ if ( w ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = w;
+ if ( opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ }
+ showPropertiesTimer->stop();
+// showPropertiesTimer->start( 0, TRUE );
+ showPropertiesTimerDone();
+}
+
+void FormWindow::emitUpdateProperties( QObject *w )
+{
+ if ( w == propertyWidget ) {
+ updatePropertiesTimer->stop();
+ updatePropertiesTimer->start( 0, TRUE );
+ }
+}
+
+void FormWindow::emitSelectionChanged()
+{
+ selectionChangedTimer->stop();
+ selectionChangedTimer->start( 0, TRUE );
+}
+
+void FormWindow::updatePropertiesTimerDone()
+{
+ CHECK_MAINWINDOW;
+ if ( propertyWidget && mainWindow()->formWindow() == this )
+ emit updateProperties( propertyWidget );
+}
+
+void FormWindow::showPropertiesTimerDone()
+{
+ CHECK_MAINWINDOW;
+ if ( propertyWidget && mainWindow()->formWindow() == this )
+ emit showProperties( propertyWidget );
+}
+
+void FormWindow::selectionChangedTimerDone()
+{
+ emit selectionChanged();
+}
+
+void FormWindow::currentToolChanged()
+{
+ CHECK_MAINWINDOW;
+ toolFixed = FALSE;
+ int t = mainwindow->currentTool();
+ if ( currTool == t && t != ORDER_TOOL )
+ return;
+
+ // tool cleanup
+ switch ( currTool ) {
+ case ORDER_TOOL:
+ hideOrderIndicators();
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ restoreConnectionLine();
+ if ( startWidget )
+ restoreRect( QRect( mapToForm( ( (QWidget*)startWidget )->parentWidget(),
+ ( (QWidget*)startWidget )->pos() ),
+ ( (QWidget*)startWidget )->size() ) );
+ if ( endWidget )
+ restoreRect( QRect( mapToForm( ( (QWidget*)endWidget )->parentWidget(),
+ ( (QWidget*)endWidget )->pos() ),
+ ( (QWidget*)endWidget )->size() ) );
+ endUnclippedPainter();
+ break;
+ case POINTER_TOOL:
+ break;
+ default:
+ if ( insertParent )
+ endRectDraw();
+ break;
+ }
+
+ startWidget = endWidget = 0;
+ widgetPressed = FALSE;
+ drawRubber = FALSE;
+ insertParent = 0;
+ delete buffer;
+ buffer = 0;
+
+ currTool = t;
+
+ if ( hasFocus() )
+ clearSelection( FALSE );
+
+ mainWindow()->statusBar()->clear();
+
+ // tool setup
+ switch ( currTool ) {
+ case POINTER_TOOL:
+ if ( propertyWidget && !isMainContainer( propertyWidget ) && !isWidgetSelected( propertyWidget ) )
+ emitShowProperties( mainContainer() );
+ restoreCursors( this, this );
+ break;
+ case ORDER_TOOL:
+ if ( mainWindow()->formWindow() == this ) {
+ mainWindow()->statusMessage( i18n( "Click widgets to change the tab order...") );
+ orderedWidgets.clear();
+ showOrderIndicators();
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ setCursorToAll( ArrowCursor, this );
+ }
+ break;
+ case CONNECT_TOOL:
+ case BUDDY_TOOL:
+ if ( currTool == CONNECT_TOOL )
+ mainWindow()->statusMessage( i18n( "Drag a line to create a connection...") );
+ else
+ mainWindow()->statusMessage( i18n( "Drag a line to set a buddy...") );
+ setCursorToAll( CrossCursor, this );
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ break;
+ default:
+ mainWindow()->statusMessage( i18n( "Click on the form to insert a %1..." ).arg( WidgetDatabase::toolTip( currTool ).lower() ) );
+ setCursorToAll( CrossCursor, this );
+ if ( mainWindow()->formWindow() == this )
+ emitShowProperties( mainContainer() );
+ break;
+ }
+}
+
+void FormWindow::showOrderIndicators()
+{
+ hideOrderIndicators();
+ orderIndicators.setAutoDelete( TRUE );
+ QObjectList *l = mainContainer()->queryList( "QWidget" );
+ stackedWidgets = MetaDataBase::tabOrder( this );
+ if ( l ) {
+ int order = 1;
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ QWidget* w = (QWidget*) o;
+ if ( w->isShown() &&
+ insertedWidgets[ (void*)w ] &&
+ w->focusPolicy() != NoFocus ) {
+ OrderIndicator* ind = new OrderIndicator( order++, w, this );
+ orderIndicators.append( ind );
+ if ( stackedWidgets.findRef( w ) == -1 )
+ stackedWidgets.append( w );
+ }
+ }
+ delete l;
+ }
+ updateOrderIndicators();
+}
+
+void FormWindow::hideOrderIndicators()
+{
+ orderIndicators.clear();
+}
+
+void FormWindow::updateOrderIndicators()
+{
+ int order = 1;
+ for ( QWidget *w = stackedWidgets.first(); w; w = stackedWidgets.next() ) {
+ for ( OrderIndicator* i = orderIndicators.first(); i; i = orderIndicators.next() )
+ i->setOrder( order, w );
+ order++;
+ }
+}
+
+void FormWindow::repositionOrderIndicators()
+{
+ for ( OrderIndicator* i = orderIndicators.first(); i; i = orderIndicators.next() )
+ i->reposition();
+}
+
+
+void FormWindow::updateUndoInfo()
+{
+ commandHistory()->emitUndoRedo();
+}
+
+bool FormWindow::checkCustomWidgets()
+{
+ QStringList missingCustomWidgets;
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isA( "CustomWidget" ) ) {
+ QString className = WidgetFactory::classNameOf( it.current() );
+ if ( !MetaDataBase::hasCustomWidget( className ) )
+ missingCustomWidgets << className;
+ }
+ }
+
+ if ( !missingCustomWidgets.isEmpty() ) {
+ QString txt = i18n( "The following custom widgets are used in '%1',\n"
+ "but are not known to Qt Designer:\n" ).arg( name() );
+ for ( QStringList::Iterator sit = missingCustomWidgets.begin(); sit != missingCustomWidgets.end(); ++sit )
+ txt += " " + *sit + "\n";
+ txt += i18n( "If you save this form and generate code for it using uic, \n"
+ "the generated code will not compile.\n"
+ "Do you want to save this form now?" );
+ if ( QMessageBox::information( mainWindow(), i18n( "Save Form" ), txt ) == 1 )
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void FormWindow::setPropertyShowingBlocked( bool b )
+{
+ propShowBlocked = b;
+}
+
+bool FormWindow::isPropertyShowingBlocked() const
+{
+ return propShowBlocked;
+}
+
+int FormWindow::numSelectedWidgets() const
+{
+ return usedSelections.count();
+}
+
+QString FormWindow::copy()
+{
+ CHECK_MAINWINDOW_VALUE( QString::null );
+ Resource resource( mainWindow() );
+ resource.setWidget( this );
+ return resource.copy();
+}
+
+void FormWindow::lowerWidgets()
+{
+ QWidgetList widgets;
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+
+ LowerCommand *cmd = new LowerCommand( i18n( "Lower" ), this, widgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd );
+}
+
+void find_accel( const QString &txt, QMap<QChar, QWidgetList > &accels, QWidget *w )
+{
+ int i = txt.find( "&" );
+ if ( i == -1 )
+ return;
+ QChar c = txt[ i + 1 ];
+ if ( c.isNull() || c == '&' )
+ return;
+ c = c.lower();
+ QMap<QChar, QWidgetList >::Iterator it = accels.find( c );
+ if ( it == accels.end() ) {
+ QWidgetList wl;
+ wl.append( w );
+ accels.insert( c, wl );
+ } else {
+ QWidgetList *wl = &*it;
+ wl->append( w );
+ }
+}
+
+void FormWindow::checkAccels()
+{
+ CHECK_MAINWINDOW;
+ QMap<QChar, QWidgetList > accels;
+ QObjectList *l = mainContainer()->queryList( "QWidget" );
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ QWidget *w = (QWidget*)o;
+ const QMetaProperty* text =
+ w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE );
+ const QMetaProperty* title =
+ w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE );
+ const QMetaProperty* pageTitle =
+ w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE );
+ if ( text )
+ find_accel( w->property( "text" ).toString(), accels, w );
+ if ( title )
+ find_accel( w->property( "title" ).toString(), accels, w );
+ if ( pageTitle )
+ find_accel( w->property( "pageTitle" ).toString(), accels, w );
+ } else if ( ::qt_cast<MenuBarEditor*>(o) ) {
+ ((MenuBarEditor *)o)->checkAccels( accels );
+ }
+ }
+ delete l;
+ }
+
+ bool ok = TRUE;
+ QWidget *wid;
+ for ( QMap<QChar, QWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it ) {
+ if ( (*it).count() > 1 ) {
+ ok = FALSE;
+ switch ( QMessageBox::information( mainWindow(), i18n( "Check Accelerators" ),
+ i18n( "Accelerator '%1' is used once.", "Accelerator '%1' is used %n times.", (*it).count()
+ ).arg( it.key().upper() ),
+ i18n( "&Select" ),
+ i18n( "&Cancel" ), QString::null, 2 ) ) {
+ case 0: // select
+ clearSelection( FALSE );
+ for ( wid = (*it).first(); wid; wid = (*it).next() )
+ selectWidget( wid, TRUE );
+ return;
+ case 1: // cancel
+ return;
+ }
+ }
+ }
+
+ if ( ok )
+ QMessageBox::information( mainWindow(), i18n( "Check Accelerators" ),
+ i18n( "No accelerator is used more than once." ) );
+}
+
+void FormWindow::raiseWidgets()
+{
+ QWidgetList widgets;
+ QPtrDictIterator<WidgetSelection> it( usedSelections );
+ for ( ; it.current(); ++it )
+ widgets.append( it.current()->widget() );
+
+ RaiseCommand *cmd = new RaiseCommand( i18n( "Raise" ), this, widgets );
+ cmd->execute();
+ commandHistory()->addCommand( cmd );
+}
+
+void FormWindow::paste( const QString &cb, QWidget *parent )
+{
+ CHECK_MAINWINDOW;
+ Resource resource( mainWindow() );
+ resource.setWidget( this );
+ resource.paste( cb, parent );
+}
+
+void FormWindow::selectAll()
+{
+ checkedSelectionsForMove = FALSE;
+ blockSignals( TRUE );
+ QObjectList *l = mainContainer()->queryList( "QWidget" );
+ if ( l ) {
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets[ (void*)o ] ) {
+ selectWidget( (QWidget*)o );
+ }
+ }
+ delete l;
+ }
+
+ blockSignals( FALSE );
+ emitSelectionChanged();
+ if ( propertyWidget )
+ emitShowProperties( propertyWidget );
+ emitSelectionChanged();
+}
+
+void FormWindow::layoutHorizontal()
+{
+ QWidgetList widgets( selectedWidgets() );
+ LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Horizontally" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVertical()
+{
+ QWidgetList widgets( selectedWidgets() );
+ LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Vertically" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutHorizontalSplit()
+{
+ QWidgetList widgets( selectedWidgets() );
+ LayoutHorizontalSplitCommand *cmd = new LayoutHorizontalSplitCommand( i18n( "Lay Out Horizontally (in splitter)" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVerticalSplit()
+{
+ QWidgetList widgets( selectedWidgets() );
+ LayoutVerticalSplitCommand *cmd = new LayoutVerticalSplitCommand( i18n( "Lay Out Vertically (in splitter)" ),
+ this, mainContainer(), 0, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutGrid()
+{
+ int xres = grid().x();
+ int yres = grid().y();
+
+ QWidgetList widgets( selectedWidgets() );
+ LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out in a Grid" ),
+ this, mainContainer(), 0, widgets, xres, yres );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutHorizontalContainer( QWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children();
+ if ( !l )
+ return;
+ QWidgetList widgets;
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.find( (QWidget*)o ) )
+ widgets.append( (QWidget*)o );
+ }
+ LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand( i18n( "Lay Out Children Horizontally" ),
+ this, mainContainer(), w, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutVerticalContainer( QWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children();
+ if ( !l )
+ return;
+ QWidgetList widgets;
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.find( (QWidget*)o ) )
+ widgets.append( (QWidget*)o );
+ }
+ LayoutVerticalCommand *cmd = new LayoutVerticalCommand( i18n( "Lay Out Children Vertically" ),
+ this, mainContainer(), w, widgets );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::layoutGridContainer( QWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ int xres = grid().x();
+ int yres = grid().y();
+
+ QObjectList *l = (QObjectList*)WidgetFactory::containerOfWidget(w)->children();
+ if ( !l )
+ return;
+ QWidgetList widgets;
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.find( (QWidget*)o ) )
+ widgets.append( (QWidget*)o );
+ }
+ LayoutGridCommand *cmd = new LayoutGridCommand( i18n( "Lay Out Children in a Grid" ),
+ this, mainContainer(), w, widgets, xres, yres );
+ clearSelection( FALSE );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void FormWindow::breakLayout( QWidget *w )
+{
+ if ( w == this )
+ w = mainContainer();
+ w = WidgetFactory::containerOfWidget( w );
+ QPtrList<Command> commands;
+
+ for (;;) {
+ if ( !w || w == this )
+ break;
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout &&
+ WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ Command *cmd = breakLayoutCommand( w );
+ if ( cmd )
+ commands.insert( 0, cmd );
+ if ( !::qt_cast<QLayoutWidget*>(w) && !::qt_cast<QSplitter*>(w) )
+ break;
+ }
+ w = w->parentWidget();
+ }
+
+ if ( commands.isEmpty() )
+ return;
+
+ clearSelection( FALSE );
+ MacroCommand *cmd = new MacroCommand( i18n( "Break Layout" ), this, commands );
+ commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+BreakLayoutCommand *FormWindow::breakLayoutCommand( QWidget *w )
+{
+ CHECK_MAINWINDOW_VALUE( 0 );
+ QObjectList *l = (QObjectList*)w->children();
+ if ( !l )
+ return 0;
+
+ QWidgetList widgets;
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ !mainWindow()->isAToolBarChild( (QWidget*)o ) &&
+ ( (QWidget*)o )->isVisibleTo( this ) &&
+ insertedWidgets.find( (QWidget*)o ) )
+ widgets.append( (QWidget*)o );
+ }
+ return new BreakLayoutCommand( i18n( "Break Layout" ), this, WidgetFactory::widgetOfContainer( w ), widgets );
+}
+
+int FormWindow::numVisibleWidgets() const
+{
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ int visible = 0;
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isVisibleTo( (FormWindow*)this ) )
+ visible++;
+ }
+ return visible;
+}
+
+bool FormWindow::hasInsertedChildren( QWidget *w ) const
+{
+ if ( !w )
+ return FALSE;
+ w = WidgetFactory::containerOfWidget( w );
+ if ( !w )
+ return FALSE;
+ QObjectList *l = w->queryList( "QWidget" );
+ if ( !l || !l->first() ) {
+ delete l;
+ return FALSE;
+ }
+
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o->isWidgetType() &&
+ ( (QWidget*)o )->isVisibleTo( (FormWindow*)this ) &&
+ insertedWidgets.find( (QWidget*)o ) ) {
+ delete l;
+ return TRUE;
+ }
+ }
+
+ delete l;
+ return FALSE;
+}
+
+bool FormWindow::allowMove( QWidget *w )
+{
+ w = w->parentWidget();
+ while ( w ) {
+ if ( ( isMainContainer( w ) || insertedWidgets.find( w ) ) && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout )
+ return TRUE;
+ w = w->parentWidget();
+ }
+ return FALSE;
+}
+
+
+void FormWindow::editConnections()
+{
+ CHECK_MAINWINDOW;
+ buffer = 0;
+ if ( !startWidget || !endWidget )
+ return;
+
+ ConnectionDialog dlg( mainwindow );
+ mainWindow()->statusMessage( i18n( "Edit connections...") );
+ dlg.addConnection( startWidget, endWidget, QString::null, QString::null );
+ QTimer::singleShot( 0, &dlg, SLOT(ensureConnectionVisible()) );
+ dlg.exec();
+}
+
+void FormWindow::saveBackground()
+{
+ if ( buffer )
+ delete buffer;
+ buffer = new QPixmap( width(), height() );
+ *buffer = QPixmap::grabWindow( winId() );
+}
+
+void FormWindow::restoreConnectionLine()
+{
+ if (!unclippedPainter || !buffer) // designer will occasionally crash if buffer is not tested to be non-zero
+ return;
+
+ int a =QABS( startPos.x() - currentPos.x() );
+ int b = QABS( startPos.y() - currentPos.y() );
+ QRect r( startPos, currentPos );
+
+ if ( a < 32 || b < 32 ) { // special case: vertical or horizontal line
+ r = r.normalize();
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer,
+ r.x() - 2, r.y() - 2, r.width() + 4, r.height() + 4 );
+ return;
+ }
+
+ if ( a <= 0 )
+ a = 1;
+ if ( b <= 0 )
+ b = 1;
+ int w, h;
+ if ( b > a ) {
+ h = 64;
+ w = ( a * h ) / b;
+ } else {
+ w = 64;
+ h = ( b * w ) / a;
+ }
+
+ int dx = 2 * w / 3;
+ int dy = 2 * h / 3;
+ QPoint p( startPos );
+
+ if ( r.x() > r.right() ) {
+ dx = dx * -1;
+ p.setX( p.x() - 64 );
+ r.moveBy( -64, 0 );
+ }
+ if ( r.y() > r.bottom() ) {
+ dy = dy * -1;
+ p.setY( p.y() - 64 );
+ r.moveBy( 0, -64 );
+ }
+
+ w = h = 64;
+ r = r.normalize();
+ while ( r.contains( p ) ) {
+ unclippedPainter->drawPixmap( p, *buffer, QRect( p, QSize( w, h ) ) );
+ unclippedPainter->setPen( red );
+ p.setX( p.x() + dx );
+ p.setY( p.y() + dy );
+ }
+
+ unclippedPainter->drawPixmap( startPos.x() - 10, startPos.y() - 10, *buffer,
+ startPos.x() - 10, startPos.y() - 10, 20, 20 );
+}
+
+void FormWindow::restoreRect( const QRect &rect )
+{
+ if (!unclippedPainter || !buffer)
+ return;
+
+ QRect r( rect );
+ r = r.normalize();
+
+ r = QRect( r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4 );
+
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, r.width() + 4, 4 );
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, 4, r.height() + 4 );
+ unclippedPainter->drawPixmap( r.x() - 2, r.y() + r.height() - 3, *buffer, r.x() - 2, r.y() + r.height() - 3, r.width() + 4, 5 );
+ unclippedPainter->drawPixmap( r.x() + r.width() - 2, r.y(), *buffer, r.x() + r.width() - 2, r.y(), 4, r.height() + 4 );
+}
+
+void FormWindow::drawConnectionLine()
+{
+ if ( !unclippedPainter )
+ return;
+
+ unclippedPainter->setPen( QPen( white, 2 ) );
+ unclippedPainter->drawLine( startPos, currentPos );
+ if ( validForBuddy )
+ unclippedPainter->setPen( QPen( darkRed, 1 ) );
+ else
+ unclippedPainter->setPen( QPen( darkCyan, 1 ) );
+ unclippedPainter->drawLine( startPos, currentPos );
+
+ if ( validForBuddy )
+ unclippedPainter->setPen( QPen( darkGreen, 1 ) );
+ else
+ unclippedPainter->setPen( QPen( magenta, 1 ) );
+ if ( startWidget ) {
+ QWidget *s = (QWidget*)startWidget;
+ QPoint p = mapToForm( s, QPoint(0,0) );
+ unclippedPainter->drawRect( QRect( p + QPoint( 2, 2 ), s->size() - QSize( 4, 4 ) ) );
+ }
+ if ( endWidget ) {
+ QWidget *e = (QWidget*)endWidget;
+ QPoint p = mapToForm( e, QPoint(0,0) );
+ unclippedPainter->drawRect( QRect( p + QPoint( 2, 2 ), e->size() - QSize( 4, 4 ) ) );
+ }
+}
+
+QString FormWindow::fileName() const
+{
+ return ff->absFileName();
+}
+
+void FormWindow::setFileName( const QString &fn )
+{
+ ff->setFileName( fn );
+ emit fileNameChanged( ff->fileName(), this );
+}
+
+void FormWindow::modificationChanged( bool m )
+{
+ emit modificationChanged( m, this );
+ emit modificationChanged( m, ff->fileName() );
+}
+
+bool FormWindow::unify( QObject *w, QString &s, bool changeIt )
+{
+ bool found = !isMainContainer( w ) && qstrcmp( name(), s.latin1() ) == 0;
+ if ( !found ) {
+ QString orig = s;
+ int num = 1;
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ for ( ; it.current();) {
+ if ( it.current() != w &&
+ qstrcmp( it.current()->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + QString::number( ++num );
+ it.toFirst();
+ } else {
+ ++it;
+ }
+ }
+ if ( !found ) {
+ QPtrList<QAction> al;
+ QAction *a = 0;
+ for ( a = actions.first(); a; a = actions.next() ) {
+ QObjectList *l = a->queryList( "QAction" );
+ al.append( a );
+ for ( QObject *ao = l->first(); ao; ao = l->next() )
+ al.append( (QAction*)ao );
+ delete l;
+ }
+ for ( a = al.first(); a; a = al.next() ) {
+ if ( a != w &&
+ qstrcmp( a->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + QString::number( ++num );
+ a = actions.first();
+ }
+ }
+ }
+ if ( ::qt_cast<QMainWindow*>(mainContainer()) && !found ) {
+ QObjectList *l = mainContainer()->queryList( "PopupMenuEditor" );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o != w &&
+ qstrcmp ( o->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + QString::number( ++num );
+ o = l->first();
+ }
+ }
+ delete l;
+ }
+ if ( ::qt_cast<QMainWindow*>(mainContainer()) ) {
+ if ( !found ) {
+ QObjectList *l = mainContainer()->queryList( "QDockWindow", 0, TRUE );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o != w &&
+ qstrcmp( o->name(), s.latin1() ) == 0 ) {
+ found = TRUE;
+ if ( !changeIt )
+ break;
+ s = orig + "_" + QString::number( ++num );
+ o = l->first();
+ }
+ }
+ delete l;
+ }
+ }
+ }
+
+ if ( !found )
+ return TRUE;
+ return FALSE;
+}
+
+bool FormWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *w )
+{
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isA( "CustomWidget" ) ) {
+ if ( qstrcmp( WidgetFactory::classNameOf( it.current() ), w->className.utf8() ) == 0 )
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool FormWindow::isDatabaseWidgetUsed() const
+{
+#ifndef QT_NO_SQL
+ QStringList dbClasses;
+ dbClasses << "QDataTable"; // add more here
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ for ( ; it.current(); ++it ) {
+ QString c( it.current()->className() );
+ if ( dbClasses.contains( c ) > 0 ) {
+ return TRUE;
+ }
+ }
+#endif
+ return FALSE;
+}
+
+bool FormWindow::isDatabaseAware() const
+{
+#ifndef QT_NO_SQL
+ if ( QString(mContainer->className()) == "QDesignerDataBrowser" || QString(mContainer->className()) == "QDesignerDataView" )
+ return TRUE;
+ return isDatabaseWidgetUsed();
+#else
+ return FALSE;
+#endif
+}
+
+void FormWindow::visibilityChanged()
+{
+ if ( currTool != ORDER_TOOL ) {
+ emitUpdateProperties( currentWidget() );
+ } else {
+ updateOrderIndicators();
+ repositionOrderIndicators();
+ }
+}
+
+
+/*!
+ Maps \a pos in \a w's coordinates to the form's coordinate system.
+
+ This is the equivalent to mapFromGlobal(w->mapToGlobal(pos) ) but
+ avoids the two roundtrips to the X-Server on Unix/X11.
+ */
+QPoint FormWindow::mapToForm( const QWidget* w, const QPoint& pos ) const
+{
+ QPoint p = pos;
+ const QWidget* i = w;
+ while ( i && !i->isTopLevel() && !isMainContainer( (QWidget*)i ) ) {
+ p = i->mapToParent( p );
+ i = i->parentWidget();
+ }
+ return mapFromGlobal( w->mapToGlobal( pos ) );
+}
+
+static int widgetDepth( QWidget *w )
+{
+ int d = -1;
+ while ( w && !w->isTopLevel() ) {
+ d++;
+ w = w->parentWidget();
+ }
+
+ return d;
+}
+
+static bool isChildOf( QWidget *c, QWidget *p )
+{
+ while ( c && !c->isTopLevel() ) {
+ if ( c == p )
+ return TRUE;
+ c = c->parentWidget();
+ }
+ return FALSE;
+}
+
+QWidget *FormWindow::containerAt( const QPoint &pos, QWidget *notParentOf )
+{
+ QPtrDictIterator<QWidget> it( insertedWidgets );
+ QWidget *container = 0;
+ int depth = -1;
+ QWidgetList selected = selectedWidgets();
+ if ( rect().contains( mapFromGlobal( pos ) ) ) {
+ container = mainContainer();
+ depth = widgetDepth( container );
+ }
+
+ for ( ; it.current(); ++it ) {
+ if ( ::qt_cast<QLayoutWidget*>(it.current())
+ || ::qt_cast<QSplitter*>(it.current()) )
+ continue;
+ if ( !it.current()->isVisibleTo( this ) )
+ continue;
+ if ( selected.find( it.current() ) != -1 )
+ continue;
+ if ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( it.current() ) ) ) &&
+ it.current() != mainContainer() )
+ continue;
+
+ // the rectangles of all ancestors of the container must contain the insert position
+ QWidget *w = it.current();
+ while ( w && !w->isTopLevel() ) {
+ if ( !w->rect().contains( ( w->mapFromGlobal( pos ) ) ) )
+ break;
+ w = w->parentWidget();
+ }
+ if ( !( w == 0 || w->isTopLevel() ) ) continue; // we did not get through the full while loop
+
+ int wd = widgetDepth( it.current() );
+ if ( wd == depth && container ) {
+ if ( ( (QObjectList*)it.current()->parentWidget()->children() )->find( it.current() ) >
+ ( (QObjectList*)container->parentWidget()->children() )->find( container ) )
+ wd++;
+ }
+ if ( wd > depth && !isChildOf( it.current(), notParentOf ) ) {
+ depth = wd;
+ container = it.current();
+ }
+ }
+
+ return container;
+}
+
+bool FormWindow::isMainContainer( QObject *w ) const
+{
+ return w && w->isWidgetType() && ( w == (QWidget*)this || w == mainContainer() );
+}
+
+void FormWindow::setMainContainer( QWidget *w )
+{
+ bool resetPropertyWidget = isMainContainer( propertyWidget );
+ if ( mContainer )
+ insertedWidgets.remove( mContainer );
+ if ( propertyWidget == mContainer )
+ propertyWidget = 0;
+ delete mContainer;
+ mContainer = w;
+ insertedWidgets.insert( mContainer, mContainer );
+ delete layout();
+ QHBoxLayout *l = new QHBoxLayout( this );
+ l->addWidget( w );
+ if ( resetPropertyWidget ) {
+ QObject *opw = propertyWidget;
+ propertyWidget = mContainer;
+ if ( opw && opw->isWidgetType() )
+ repaintSelection( (QWidget*)opw );
+ }
+ if ( project() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( project()->language() );
+ if ( iface && !project()->isCpp() && !isFake() ) {
+ if ( !MetaDataBase::hasFunction( this, "init()" ) )
+ MetaDataBase::addFunction( this, "init()", "", "private", "function",
+ project()->language(), "void" );
+ if ( !MetaDataBase::hasFunction( this, "destroy()" ) )
+ MetaDataBase::addFunction( this, "destroy()", "", "private", "function",
+ project()->language(), "void" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "shown()", mainContainer(), "init" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "shown()", mainContainer(), "init" );
+ if ( !MetaDataBase::hasConnection( this, mainContainer(), "destroyed()", mainContainer(), "destroy" ) )
+ MetaDataBase::addConnection( this, mainContainer(), "destroyed()",
+ mainContainer(), "destroy" );
+ }
+ }
+}
+
+bool FormWindow::savePixmapInline() const
+{
+ return pixInline;
+}
+
+bool FormWindow::savePixmapInProject() const
+{
+ return pixProject;
+}
+
+QString FormWindow::pixmapLoaderFunction() const
+{
+ return pixLoader;
+}
+
+void FormWindow::setSavePixmapInline( bool b )
+{
+ pixInline = b;
+ if ( b )
+ pixProject = FALSE;
+}
+
+void FormWindow::setSavePixmapInProject( bool b )
+{
+ pixProject = b;
+ if ( b )
+ pixInline = FALSE;
+}
+
+void FormWindow::setPixmapLoaderFunction( const QString &func )
+{
+ pixLoader = func;
+}
+
+void FormWindow::setActiveObject( QObject *o )
+{
+ emitShowProperties( o );
+ propertyWidget = o;
+}
+
+void FormWindow::setProject( Project *pro )
+{
+ proj = pro;
+}
+
+Project *FormWindow::project() const
+{
+ return proj;
+}
+
+QAction *FormWindow::findAction( const QString &name )
+{
+ for ( QAction *a = actionList().first(); a; a = actionList().next() ) {
+ if ( QString( a->name() ) == name )
+ return a;
+ QAction *ac = (QAction*)a->child( name.latin1(), "QAction" );
+ if ( ac )
+ return ac;
+ }
+ return 0;
+}
+
+void FormWindow::killAccels( QObject *top )
+{
+ QObjectList *l = top->queryList( "QAccel" );
+ if ( !l )
+ return;
+ for ( QObject *o = l->first(); o; o = l->next() )
+ ( (QAccel*)o )->setEnabled( FALSE );
+ delete l;
+}
+
+DesignerFormWindow *FormWindow::iFace()
+{
+ if ( !iface )
+ iface = new DesignerFormWindowImpl( this );
+ return iface;
+}
+
+bool FormWindow::isCentralWidget( QObject *w ) const
+{
+ if ( !::qt_cast<QMainWindow*>(mainContainer()) )
+ return FALSE;
+ return w == ( (QMainWindow*)mainContainer() )->centralWidget();
+}
+
+int FormWindow::layoutDefaultSpacing() const
+{
+ return defSpacing;
+}
+
+int FormWindow::layoutDefaultMargin() const
+{
+ return defMargin;
+}
+
+void FormWindow::setLayoutDefaultSpacing( int s )
+{
+ defSpacing = s;
+}
+
+void FormWindow::setLayoutDefaultMargin( int s )
+{
+ defMargin = s;
+}
+
+void FormWindow::setSpacingFunction( const QString &funct )
+{
+ spacFunction = funct;
+}
+
+QString FormWindow::spacingFunction() const
+{
+ return spacFunction;
+}
+
+void FormWindow::hasLayoutFunctions( bool b )
+{
+ hasLayoutFunc = b;
+}
+
+bool FormWindow::hasLayoutFunctions() const
+{
+ return hasLayoutFunc;
+}
+
+void FormWindow::setMarginFunction( const QString &funct )
+{
+ margFunction = funct;
+}
+
+QString FormWindow::marginFunction() const
+{
+ return margFunction;
+}
+
+FormFile *FormWindow::formFile() const
+{
+ return ff;
+}
+
+void FormWindow::setFormFile( FormFile *f )
+{
+ ff = f;
+ if ( ff )
+ connect( this, SIGNAL( modificationChanged(bool, const QString&) ), ff, SLOT( formWindowChangedSomehow() ) );
+}
+
+bool FormWindow::canBeBuddy( const QWidget *w ) const
+{
+ return w->focusPolicy() != QWidget::NoFocus;
+}
+
+bool FormWindow::event( QEvent *e )
+{
+ if (e->type() == QEvent::ShowMaximized)
+ {
+#if QT_VERSION >= 0x030300
+ if ( isMaximized() )
+ setWindowState( windowState() & ~WindowMaximized | WindowActive);
+#endif
+ return true;
+ }
+ return QWidget::event(e);
+}
diff --git a/kdevdesigner/designer/formwindow.h b/kdevdesigner/designer/formwindow.h
new file mode 100644
index 00000000..782a26c3
--- /dev/null
+++ b/kdevdesigner/designer/formwindow.h
@@ -0,0 +1,322 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef FORMWINDOW_H
+#define FORMWINDOW_H
+
+#include "command.h"
+#include "metadatabase.h"
+#include "sizehandle.h"
+#include "actiondnd.h"
+
+#include <qwidget.h>
+#include <qptrdict.h>
+#include <qpixmap.h>
+#include <qwidgetlist.h>
+#include <qmap.h>
+
+class QPaintEvent;
+class QMouseEvent;
+class QKeyEvent;
+class QPainter;
+class QLabel;
+class MainWindow;
+class QTimer;
+class QFocusEvent;
+class QCloseEvent;
+class Resource;
+class QResizeEvent;
+class BreakLayoutCommand;
+class QPixmap;
+class QSizeGrip;
+class Project;
+struct DesignerFormWindow;
+class FormFile;
+
+#if defined(Q_CC_MSVC) || defined(Q_FULL_TEMPLATE_INSTANTIATION)
+#include "orderindicator.h"
+#else
+class OrderIndicator;
+#endif
+
+class FormWindow : public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY( QString fileName READ fileName WRITE setFileName )
+
+public:
+ FormWindow( FormFile *f, MainWindow *mw, QWidget *parent, const char *name = 0 );
+ FormWindow( FormFile *f, QWidget *parent, const char *name = 0 );
+ ~FormWindow();
+
+ void init();
+ virtual void setMainWindow( MainWindow *w );
+
+ virtual QString fileName() const;
+ virtual void setFileName( const QString &fn );
+
+ virtual QPoint grid() const;
+ virtual QPoint gridPoint( const QPoint &p );
+
+ virtual CommandHistory *commandHistory();
+
+ virtual void undo();
+ virtual void redo();
+ virtual QString copy();
+ virtual void paste( const QString &cb, QWidget *parent );
+ virtual void lowerWidgets();
+ virtual void raiseWidgets();
+ virtual void checkAccels();
+
+ virtual void layoutHorizontal();
+ virtual void layoutVertical();
+ virtual void layoutHorizontalSplit();
+ virtual void layoutVerticalSplit();
+ virtual void layoutGrid();
+
+ virtual void layoutHorizontalContainer( QWidget *w );
+ virtual void layoutVerticalContainer( QWidget *w );
+ virtual void layoutGridContainer( QWidget *w );
+
+ virtual void breakLayout( QWidget *w );
+
+ virtual void selectWidget( QObject *w, bool select = TRUE );
+ virtual void selectAll();
+ virtual void updateSelection( QWidget *w );
+ virtual void raiseSelection( QWidget *w );
+ virtual void repaintSelection( QWidget *w );
+ virtual void clearSelection( bool changePropertyDisplay = TRUE );
+ virtual void selectWidgets();
+ bool isWidgetSelected( QObject *w );
+ virtual void updateChildSelections( QWidget *w );
+ virtual void raiseChildSelections( QWidget *w );
+
+ virtual void emitUpdateProperties( QObject *w );
+ virtual void emitShowProperties( QObject *w = 0 );
+ virtual void emitSelectionChanged();
+
+ virtual void setPropertyShowingBlocked( bool b );
+ bool isPropertyShowingBlocked() const;
+
+ virtual QLabel *sizePreview() const;
+ virtual void checkPreviewGeometry( QRect &r );
+
+ virtual QPtrDict<QWidget> *widgets();
+ virtual QWidgetList selectedWidgets() const;
+
+ virtual QWidget *designerWidget( QObject *o ) const;
+
+ virtual void handleContextMenu( QContextMenuEvent *e, QWidget *w );
+ virtual void handleMousePress( QMouseEvent *e, QWidget *w );
+ virtual void handleMouseRelease( QMouseEvent *e, QWidget *w );
+ virtual void handleMouseDblClick( QMouseEvent *e, QWidget *w );
+ virtual void handleMouseMove( QMouseEvent *e, QWidget *w );
+ virtual void handleKeyPress( QKeyEvent *e, QWidget *w );
+ virtual void handleKeyRelease( QKeyEvent *e, QWidget *w );
+
+ virtual void updateUndoInfo();
+
+ virtual MainWindow *mainWindow() const { return mainwindow; }
+
+ bool checkCustomWidgets();
+ virtual void insertWidget( QWidget *w, bool checkName = FALSE );
+ virtual void removeWidget( QWidget *w );
+ virtual void deleteWidgets();
+ virtual void editAdjustSize();
+ virtual void editConnections();
+
+ virtual int numSelectedWidgets() const;
+ virtual int numVisibleWidgets() const;
+
+ virtual bool hasInsertedChildren( QWidget *w ) const;
+
+ virtual QWidget *currentWidget() const { return propertyWidget && propertyWidget->isWidgetType() ? (QWidget*)propertyWidget : 0; } // #####
+ virtual bool unify( QObject *w, QString &s, bool changeIt );
+
+ virtual bool isCustomWidgetUsed( MetaDataBase::CustomWidget *w );
+ virtual bool isDatabaseWidgetUsed() const;
+ virtual bool isDatabaseAware() const;
+
+ virtual QPoint mapToForm( const QWidget* w, const QPoint& ) const;
+
+ bool isMainContainer( QObject *w ) const;
+ bool isCentralWidget( QObject *w ) const;
+ QWidget *mainContainer() const { return mContainer; }
+ void setMainContainer( QWidget *w );
+
+ void paintGrid( QWidget *w, QPaintEvent *e );
+
+ bool savePixmapInline() const;
+ QString pixmapLoaderFunction() const;
+ void setSavePixmapInline( bool b );
+ void setPixmapLoaderFunction( const QString &func );
+
+ bool savePixmapInProject() const;
+ void setSavePixmapInProject( bool b );
+
+ void setToolFixed() { toolFixed = TRUE; }
+
+ void setActiveObject( QObject *o );
+
+ QPtrList<QAction> &actionList() { return actions; }
+ QAction *findAction( const QString &name );
+
+ void setProject( Project *pro );
+ Project *project() const;
+
+ void killAccels( QObject *top );
+
+ DesignerFormWindow *iFace();
+
+ int layoutDefaultSpacing() const;
+ int layoutDefaultMargin() const;
+ void setLayoutDefaultSpacing( int s );
+ void setLayoutDefaultMargin( int s );
+ QString spacingFunction() const;
+ QString marginFunction() const;
+ void setSpacingFunction( const QString &func );
+ void setMarginFunction( const QString &func );
+ bool hasLayoutFunctions() const;
+ void hasLayoutFunctions( bool b );
+
+ void initSlots();
+ FormFile *formFile() const;
+ void setFormFile( FormFile *f );
+
+ bool isFake() const { return fake; }
+ bool canBeBuddy( const QWidget* ) const;
+
+public slots:
+ virtual void widgetChanged( QObject *w );
+ virtual void currentToolChanged();
+ virtual void visibilityChanged();
+ virtual void modificationChanged( bool m );
+
+signals:
+ void showProperties( QObject *w );
+ void updateProperties( QObject *w );
+ void undoRedoChanged( bool undoAvailable, bool redoAvailable,
+ const QString &undoCmd, const QString &redoCmd );
+ void selectionChanged();
+ void modificationChanged( bool m, FormWindow *fw );
+ void modificationChanged( bool m, const QString &s );
+ void fileNameChanged( const QString &s, FormWindow *fw );
+
+protected:
+ virtual void closeEvent( QCloseEvent *e );
+ virtual void focusInEvent( QFocusEvent *e );
+ virtual void focusOutEvent( QFocusEvent *e );
+ virtual void resizeEvent( QResizeEvent *e );
+ void mouseDoubleClickEvent( QMouseEvent *e ) { handleMouseDblClick( e, mainContainer() ); }
+ virtual bool event( QEvent *e );
+
+private:
+ enum RectType { Insert, Rubber };
+
+ void beginUnclippedPainter( bool doNot );
+ void endUnclippedPainter();
+ void drawConnectionLine();
+ void drawSizePreview( const QPoint &pos, const QString& text );
+
+ void insertWidget();
+ void moveSelectedWidgets( int dx, int dy );
+
+ void startRectDraw( const QPoint &p, const QPoint &global, QWidget *w, RectType t );
+ void continueRectDraw( const QPoint &p, const QPoint &global, QWidget *w, RectType t );
+ void endRectDraw();
+
+ void checkSelectionsForMove( QWidget *w );
+ BreakLayoutCommand *breakLayoutCommand( QWidget *w );
+
+ bool allowMove( QWidget *w );
+
+ void saveBackground();
+ void restoreConnectionLine();
+ void restoreRect( const QRect &rect ) ;
+
+ void showOrderIndicators();
+ void updateOrderIndicators();
+ void repositionOrderIndicators();
+ void hideOrderIndicators();
+
+ QWidget *containerAt( const QPoint &pos, QWidget *notParentOf );
+
+private slots:
+ void invalidCheckedSelections();
+ void updatePropertiesTimerDone();
+ void showPropertiesTimerDone();
+ void selectionChangedTimerDone();
+ void windowsRepaintWorkaroundTimerTimeout();
+
+private:
+ int currTool;
+ bool oldRectValid, widgetPressed, drawRubber, checkedSelectionsForMove;
+ bool validForBuddy;
+ QRect currRect;
+ QPoint rectAnchor;
+ QPainter *unclippedPainter;
+ QPoint sizePreviewPos;
+ QPixmap sizePreviewPixmap;
+ MainWindow *mainwindow;
+ QPtrList<WidgetSelection> selections;
+ QPtrDict<WidgetSelection> usedSelections;
+ QRect widgetGeom, rubber;
+ QPoint oldPressPos, origPressPos;
+ CommandHistory commands;
+ QMap<QWidget*, QPoint> moving;
+ QWidget *insertParent;
+ QObject *propertyWidget;
+ QLabel *sizePreviewLabel;
+ QTimer *checkSelectionsTimer;
+ QPtrDict<QWidget> insertedWidgets;
+ bool propShowBlocked;
+ QTimer* updatePropertiesTimer, *showPropertiesTimer, *selectionChangedTimer,
+ *windowsRepaintWorkaroundTimer;
+ QPoint startPos, currentPos;
+ QWidget *startWidget, *endWidget;
+ QPixmap *buffer;
+ QPtrList<OrderIndicator> orderIndicators;
+ QWidgetList orderedWidgets;
+ QWidgetList stackedWidgets;
+ QWidget *mContainer;
+ bool pixInline, pixProject;
+ QString pixLoader;
+ bool toolFixed;
+ QPtrList<QAction> actions;
+ Project *proj;
+ DesignerFormWindow *iface;
+ QWidget* targetContainer;
+ QPalette restorePalette;
+ bool hadOwnPalette;
+ int defSpacing, defMargin;
+ QString spacFunction, margFunction;
+ bool hasLayoutFunc;
+ FormFile *ff;
+ bool fake;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/gotolinedialog.ui b/kdevdesigner/designer/gotolinedialog.ui
new file mode 100644
index 00000000..f2acf011
--- /dev/null
+++ b/kdevdesigner/designer/gotolinedialog.ui
@@ -0,0 +1,169 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>GotoLineDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+<include location="local" implDecl="in declaration">gotolinedialog.ui.h</include>
+<forward>struct EditorInterface;</forward>
+<variable>EditorInterface *editor;</variable>
+<layoutdefaults spacing="6" margin="11"/>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>GotoLineDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>243</width>
+ <height>85</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Goto Line</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Line:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinLine</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>spinLine</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Goto</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer3</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>
+<connections>
+ <connection language="C++">
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>GotoLineDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection language="C++">
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>GotoLineDialog</receiver>
+ <slot>gotoLine()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="public" language="C++" returnType="void">gotoLine()</slot>
+ <slot access="public" language="C++" returnType="void">setEditor( EditorInterface * e )</slot>
+</connections>
+</UI>
diff --git a/kdevdesigner/designer/gotolinedialog.ui.h b/kdevdesigner/designer/gotolinedialog.ui.h
new file mode 100644
index 00000000..9ee0ef39
--- /dev/null
+++ b/kdevdesigner/designer/gotolinedialog.ui.h
@@ -0,0 +1,50 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+void GotoLineDialog::init()
+{
+ editor = 0;
+}
+
+void GotoLineDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+}
+
+void GotoLineDialog::gotoLine()
+{
+ if ( editor )
+ editor->gotoLine( spinLine->value() - 1 );
+ accept();
+}
+
+void GotoLineDialog::setEditor( EditorInterface *e )
+{
+ editor = e;
+ editor->addRef();
+}
+
diff --git a/kdevdesigner/designer/hierarchyview.cpp b/kdevdesigner/designer/hierarchyview.cpp
new file mode 100644
index 00000000..8c204ac3
--- /dev/null
+++ b/kdevdesigner/designer/hierarchyview.cpp
@@ -0,0 +1,1508 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "hierarchyview.h"
+#include "formwindow.h"
+#include "globaldefs.h"
+#include "mainwindow.h"
+#include "command.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+#include "project.h"
+#include "sourceeditor.h"
+#include "propertyeditor.h"
+#include "editfunctionsimpl.h"
+#include "listeditor.h"
+#include "actiondnd.h"
+#include "actioneditorimpl.h"
+#include "variabledialogimpl.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+#include <kiconloader.h>
+#include "kdevdesigner_part.h"
+#include <klocale.h>
+
+#include <qpalette.h>
+#include <qobjectlist.h>
+#include <qheader.h>
+#include <qpopupmenu.h>
+#include <qtabwidget.h>
+#include <qwizard.h>
+#include <qwidgetstack.h>
+#include <qtabbar.h>
+#include <qfeatures.h>
+#include <qapplication.h>
+#include <qtimer.h>
+#include "../interfaces/languageinterface.h"
+#include <qworkspace.h>
+#include <qaccel.h>
+#include <qmessagebox.h>
+
+#include <stdlib.h>
+
+QListViewItem *newItem = 0;
+
+static QPluginManager<ClassBrowserInterface> *classBrowserInterfaceManager = 0;
+
+HierarchyItem::HierarchyItem( Type type, QListViewItem *parent, QListViewItem *after,
+ const QString &txt1, const QString &txt2, const QString &txt3 )
+ : QListViewItem( parent, after, txt1, txt2, txt3 ), typ( type )
+{
+}
+
+HierarchyItem::HierarchyItem( Type type, QListView *parent, QListViewItem *after,
+ const QString &txt1, const QString &txt2, const QString &txt3 )
+ : QListViewItem( parent, after, txt1, txt2, txt3 ), typ( type )
+{
+}
+
+void HierarchyItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
+{
+ QColorGroup g( cg );
+ g.setColor( QColorGroup::Base, backgroundColor() );
+ g.setColor( QColorGroup::Foreground, Qt::black );
+ g.setColor( QColorGroup::Text, Qt::black );
+ QString txt = text( 0 );
+ if ( rtti() == Function &&
+ MainWindow::self->currProject()->isCpp() &&
+ ( txt == "init()" || txt == "destroy()" ) ) {
+ listView()->setUpdatesEnabled( FALSE );
+ if ( txt == "init()" )
+ setText( 0, txt + " " + "(Constructor)" );
+ else
+ setText( 0, txt + " " + "(Destructor)" );
+ QListViewItem::paintCell( p, g, column, width, align );
+ setText( 0, txt );
+ listView()->setUpdatesEnabled( TRUE );
+ } else {
+ QListViewItem::paintCell( p, g, column, width, align );
+ }
+ p->save();
+ p->setPen( QPen( cg.dark(), 1 ) );
+ if ( column == 0 )
+ p->drawLine( 0, 0, 0, height() - 1 );
+ if ( listView()->firstChild() != this ) {
+ if ( nextSibling() != itemBelow() && itemBelow()->depth() < depth() ) {
+ int d = depth() - itemBelow()->depth();
+ p->drawLine( -listView()->treeStepSize() * d, height() - 1, 0, height() - 1 );
+ }
+ }
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+}
+
+QColor HierarchyItem::backgroundColor()
+{
+ updateBackColor();
+ return backColor;
+}
+
+void HierarchyItem::updateBackColor()
+{
+ if ( listView()->firstChild() == this ) {
+ backColor = *backColor1;
+ return;
+ }
+
+ QListViewItemIterator it( this );
+ --it;
+ if ( it.current() ) {
+ if ( ( ( HierarchyItem*)it.current() )->backColor == *backColor1 )
+ backColor = *backColor2;
+ else
+ backColor = *backColor1;
+ } else {
+ backColor = *backColor1;
+ }
+}
+
+void HierarchyItem::setObject( QObject *o )
+{
+ obj = o;
+}
+
+QObject *HierarchyItem::object() const
+{
+ return obj;
+}
+
+void HierarchyItem::okRename( int col )
+{
+ if ( newItem == this )
+ newItem = 0;
+ QListViewItem::okRename( col );
+}
+
+void HierarchyItem::cancelRename( int col )
+{
+ if ( newItem == this ) {
+ newItem = 0;
+ QListViewItem::cancelRename( col );
+ delete this;
+ return;
+ }
+ QListViewItem::cancelRename( col );
+}
+
+
+
+
+HierarchyList::HierarchyList( QWidget *parent, FormWindow *fw, bool doConnects )
+ : QListView( parent ), formWindow( fw )
+{
+ DesignerFormPix = SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance());
+ DesignerLayoutPix = SmallIcon( "designer_layout.png" , KDevDesignerPartFactory::instance());
+ DesignerFolderPix = SmallIcon( "designer_folder.png" , KDevDesignerPartFactory::instance());
+ DesignerEditSlotsPix = SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance());
+
+ init_colors();
+
+ setDefaultRenameAction( Accept );
+ header()->setMovingEnabled( FALSE );
+ header()->setStretchEnabled( TRUE );
+ normalMenu = 0;
+ tabWidgetMenu = 0;
+ addColumn( i18n( "Name" ) );
+ addColumn( i18n( "Class" ) );
+ QPalette p( palette() );
+ p.setColor( QColorGroup::Base, QColor( *backColor2 ) );
+ (void)*selectedBack; // hack
+ setPalette( p );
+ disconnect( header(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( changeSortColumn( int ) ) );
+ setSorting( -1 );
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ if ( doConnects ) {
+ connect( this, SIGNAL( clicked( QListViewItem * ) ),
+ this, SLOT( objectClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( doubleClicked( QListViewItem * ) ),
+ this, SLOT( objectDoubleClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( returnPressed( QListViewItem * ) ),
+ this, SLOT( objectClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint&, int ) ),
+ this, SLOT( showRMBMenu( QListViewItem *, const QPoint & ) ) );
+ }
+ deselect = TRUE;
+ setColumnWidthMode( 1, Manual );
+}
+
+void HierarchyList::keyPressEvent( QKeyEvent *e )
+{
+ if ( e->key() == Key_Shift || e->key() == Key_Control )
+ deselect = FALSE;
+ else
+ deselect = TRUE;
+ QListView::keyPressEvent( e );
+}
+
+void HierarchyList::keyReleaseEvent( QKeyEvent *e )
+{
+ deselect = TRUE;
+ QListView::keyReleaseEvent( e );
+}
+
+void HierarchyList::viewportMousePressEvent( QMouseEvent *e )
+{
+ if ( e->state() & ShiftButton || e->state() & ControlButton )
+ deselect = FALSE;
+ else
+ deselect = TRUE;
+ QListView::viewportMousePressEvent( e );
+}
+
+void HierarchyList::viewportMouseReleaseEvent( QMouseEvent *e )
+{
+ QListView::viewportMouseReleaseEvent( e );
+}
+
+QObject *HierarchyList::handleObjectClick( QListViewItem *i )
+{
+ if ( !i )
+ return 0;
+
+ QObject *o = findObject( i );
+ if ( !o )
+ return 0;
+ if ( formWindow == o ) {
+ if ( deselect )
+ formWindow->clearSelection( FALSE );
+ formWindow->emitShowProperties( formWindow );
+ return 0;
+ }
+ if ( o->isWidgetType() ) {
+ QWidget *w = (QWidget*)o;
+ if ( !formWindow->widgets()->find( w ) ) {
+ if ( ::qt_cast<QWidgetStack*>(w->parent()) ) {
+ if (::qt_cast<QTabWidget*>(w->parent()->parent()) ) {
+ ((QTabWidget*)w->parent()->parent())->showPage( w );
+ o = (QWidget*)w->parent()->parent();
+ formWindow->emitUpdateProperties( formWindow->currentWidget() );
+ } else if ( ::qt_cast<QWizard*>(w->parent()->parent()) ) {
+ ((QDesignerWizard*)w->parent()->parent())->
+ setCurrentPage( ( (QDesignerWizard*)w->parent()->parent() )->pageNum( w ) );
+ o = (QWidget*)w->parent()->parent();
+ formWindow->emitUpdateProperties( formWindow->currentWidget() );
+ } else {
+ ( (QWidgetStack*)w->parent() )->raiseWidget( w );
+ if ( (QWidgetStack*)w->parent()->isA( "QDesignerWidgetStack" ) )
+ ( (QDesignerWidgetStack*)w->parent() )->updateButtons();
+ }
+ } else if ( ::qt_cast<QMenuBar*>(w) || ::qt_cast<QDockWindow*>(w) ) {
+ formWindow->setActiveObject( w );
+ } else if ( ::qt_cast<QPopupMenu*>(w) ) {
+ return 0; // ### we could try to find our menu bar and change the currentMenu to our index
+ } else {
+ return 0;
+ }
+ }
+ } else if ( ::qt_cast<QAction*>(o) ) {
+ MainWindow::self->actioneditor()->setCurrentAction( (QAction*)o );
+ deselect = TRUE;
+ }
+
+ if ( deselect )
+ formWindow->clearSelection( FALSE );
+
+ return o;
+}
+
+
+void HierarchyList::objectDoubleClicked( QListViewItem *i )
+{
+ QObject *o = handleObjectClick( i );
+ if ( !o )
+ return;
+ if ( o->isWidgetType() && ( (QWidget*)o )->isVisibleTo( formWindow ) ) {
+ QWidget *w = (QWidget*)o;
+ if ( !w->parentWidget() ||
+ WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ w->raise();
+ formWindow->selectWidget( w, TRUE );
+ }
+}
+
+void HierarchyList::objectClicked( QListViewItem *i )
+{
+ QObject *o = handleObjectClick( i );
+ if ( !o )
+ return;
+ if ( o->isWidgetType() && ( (QWidget*)o )->isVisibleTo( formWindow ) ) {
+ QWidget *w = (QWidget*)o;
+ formWindow->selectWidget( w, TRUE );
+ }
+}
+
+QObject *HierarchyList::findObject( QListViewItem *i )
+{
+ return ( (HierarchyItem*)i )->object();
+}
+
+QListViewItem *HierarchyList::findItem( QObject *o )
+{
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (HierarchyItem*)it.current() )->object() == o )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+QObject *HierarchyList::current() const
+{
+ if ( currentItem() )
+ return ( (HierarchyItem*)currentItem() )->object();
+ return 0;
+}
+
+void HierarchyList::changeNameOf( QObject *o, const QString &name )
+{
+ QListViewItem *item = findItem( o );
+ if ( !item )
+ return;
+ item->setText( 0, name );
+}
+
+
+void HierarchyList::changeDatabaseOf( QObject *o, const QString &info )
+{
+#ifndef QT_NO_SQL
+ if ( !formWindow->isDatabaseAware() )
+ return;
+ QListViewItem *item = findItem( o );
+ if ( !item )
+ return;
+ item->setText( 2, info );
+#endif
+}
+
+static QPtrList<QWidgetStack> *widgetStacks = 0;
+
+void HierarchyList::setup()
+{
+ if ( !formWindow || formWindow->isFake() )
+ return;
+ clear();
+ QWidget *w = formWindow->mainContainer();
+#ifndef QT_NO_SQL
+ if ( formWindow->isDatabaseAware() ) {
+ if ( columns() == 2 ) {
+ addColumn( i18n( "Database" ) );
+ header()->resizeSection( 0, 1 );
+ header()->resizeSection( 1, 1 );
+ header()->resizeSection( 2, 1 );
+ header()->adjustHeaderSize();
+ }
+ } else {
+ if ( columns() == 3 ) {
+ removeColumn( 2 );
+ }
+ }
+#endif
+ if ( !widgetStacks )
+ widgetStacks = new QPtrList<QWidgetStack>;
+ if ( w )
+ insertObject( w, 0 );
+ widgetStacks->clear();
+}
+
+void HierarchyList::setOpen( QListViewItem *i, bool b )
+{
+ QListView::setOpen( i, b );
+}
+
+void HierarchyList::insertObject( QObject *o, QListViewItem *parent )
+{
+ if ( QString( o->name() ).startsWith( "qt_dead_widget_" ) )
+ return;
+ bool fakeMainWindow = FALSE;
+ if ( ::qt_cast<QMainWindow*>(o) ) {
+ QObject *cw = ( (QMainWindow*)o )->centralWidget();
+ if ( cw ) {
+ o = cw;
+ fakeMainWindow = TRUE;
+ }
+ }
+ QListViewItem *item = 0;
+ QString className = WidgetFactory::classNameOf( o );
+ if ( ::qt_cast<QLayoutWidget*>(o) ) {
+ switch ( WidgetFactory::layoutType( (QWidget*)o ) ) {
+ case WidgetFactory::HBox:
+ className = "HBox";
+ break;
+ case WidgetFactory::VBox:
+ className = "VBox";
+ break;
+ case WidgetFactory::Grid:
+ className = "Grid";
+ break;
+ default:
+ break;
+ }
+ }
+
+ QString dbInfo;
+#ifndef QT_NO_SQL
+ dbInfo = MetaDataBase::fakeProperty( o, "database" ).toStringList().join(".");
+#endif
+
+ QString name = o->name();
+ if ( ::qt_cast<QWidgetStack*>(o->parent()) ) {
+ if ( ::qt_cast<QTabWidget*>(o->parent()->parent()) )
+ name = ( (QTabWidget*)o->parent()->parent() )->tabLabel( (QWidget*)o );
+ else if ( ::qt_cast<QWizard*>(o->parent()->parent()) )
+ name = ( (QWizard*)o->parent()->parent() )->title( (QWidget*)o );
+ }
+
+ QToolBox *tb;
+ if ( o->parent() && o->parent()->parent() &&
+ (tb = ::qt_cast<QToolBox*>(o->parent()->parent()->parent())) )
+ name = tb->itemLabel( tb->indexOf((QWidget*)o) );
+
+ if ( fakeMainWindow ) {
+ name = o->parent()->name();
+ className = "QMainWindow";
+ }
+
+ if ( !parent )
+ item = new HierarchyItem( HierarchyItem::Widget, this, 0, name, className, dbInfo );
+ else
+ item = new HierarchyItem( HierarchyItem::Widget, parent, 0, name, className, dbInfo );
+ item->setOpen( TRUE );
+ if ( !parent )
+ item->setPixmap( 0, DesignerFormPix );
+ else if ( ::qt_cast<QLayoutWidget*>(o) )
+ item->setPixmap( 0, DesignerLayoutPix );
+ else
+ item->setPixmap( 0, WidgetDatabase::iconSet(
+ WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( o ) ) ).
+ pixmap( QIconSet::Small, QIconSet::Normal ) );
+ if ( ::qt_cast<QAction*>(o) )
+ item->setPixmap( 0, ( (QAction*)o )->iconSet().pixmap() );
+
+ ( (HierarchyItem*)item )->setObject( o );
+ const QObjectList *l = o->children();
+ if ( ::qt_cast<QDesignerToolBar*>(o) )
+ l = 0;
+ if ( l ) {
+ QObjectListIt it( *l );
+ it.toLast();
+ for ( ; it.current(); --it ) {
+ if ( !it.current()->isWidgetType() ||
+ ( (QWidget*)it.current() )->isHidden() )
+ continue;
+ if ( !formWindow->widgets()->find( (QWidget*)it.current() ) ) {
+ if ( ::qt_cast<QWidgetStack*>(it.current()->parent()) ||
+ ::qt_cast<QWidgetStack*>(it.current()) ) {
+ QObject *obj = it.current();
+ QDesignerTabWidget *tw = ::qt_cast<QDesignerTabWidget*>(it.current()->parent());
+ QDesignerWizard *dw = ::qt_cast<QDesignerWizard*>(it.current()->parent());
+ QWidgetStack *stack = 0;
+ if ( dw || tw || ::qt_cast<QWidgetStack*>(obj) )
+ stack = (QWidgetStack*)obj;
+ else
+ stack = (QWidgetStack*)obj->parent();
+ if ( widgetStacks->findRef( stack ) != -1 )
+ continue;
+ widgetStacks->append( stack );
+ QObjectList *l2 = stack->queryList( "QWidget", 0, TRUE, FALSE );
+ for ( obj = l2->last(); obj; obj = l2->prev() ) {
+ if ( qstrcmp( obj->className(),
+ "QWidgetStackPrivate::Invisible" ) == 0 ||
+ ( tw && !tw->tabBar()->tab( stack->id( (QWidget*)obj ) ) ) ||
+ ( dw && dw->isPageRemoved( (QWidget*)obj ) ) )
+ continue;
+ if ( qstrcmp( obj->name(), "designer_wizardstack_button" ) == 0 )
+ continue;
+ if ( stack->id( (QWidget*)obj ) == -1 )
+ continue;
+ insertObject( obj, item );
+ }
+ delete l2;
+ } else if ( ::qt_cast<QToolBox*>(it.current()->parent()) ) {
+ if ( !::qt_cast<QScrollView*>(it.current()) )
+ continue;
+ QToolBox *tb = (QToolBox*)it.current()->parent();
+ for ( int i = tb->count() - 1; i >= 0; --i )
+ insertObject( tb->item( i ), item );
+ }
+ continue;
+ }
+ insertObject( it.current(), item );
+ }
+ }
+
+ if ( fakeMainWindow ) {
+ QObjectList *l = o->parent()->queryList( "QDesignerToolBar" );
+ QObject *obj;
+ for ( obj = l->first(); obj; obj = l->next() )
+ insertObject( obj, item );
+ delete l;
+ l = o->parent()->queryList( "MenuBarEditor" );
+ for ( obj = l->first(); obj; obj = l->next() )
+ insertObject( obj, item );
+ delete l;
+ } else if ( ::qt_cast<QDesignerToolBar*>(o) || ::qt_cast<PopupMenuEditor*>(o) ) {
+ QPtrList<QAction> actions;
+ if ( ::qt_cast<QDesignerToolBar*>(o) )
+ actions = ( (QDesignerToolBar*)o )->insertedActions();
+ else
+ ( (PopupMenuEditor*)o )->insertedActions( actions );
+
+ QPtrListIterator<QAction> it( actions );
+ it.toLast();
+ while ( it.current() ) {
+ QAction *a = it.current();
+ if ( ::qt_cast<QDesignerAction*>(a) ) {
+ QDesignerAction *da = (QDesignerAction*)a;
+ if ( da->supportsMenu() )
+ insertObject( da, item );
+ else
+ insertObject( da->widget(), item );
+ } else if ( ::qt_cast<QDesignerActionGroup*>(a) ) {
+ insertObject( a, item );
+ }
+ --it;
+ }
+ } else if ( ::qt_cast<QDesignerActionGroup*>(o) && o->children() ) {
+ QObjectList *l = (QObjectList*)o->children();
+ for ( QObject *obj = l->last(); obj; obj = l->prev() ) {
+ if ( ::qt_cast<QDesignerAction*>(obj) ) {
+ QDesignerAction *da = (QDesignerAction*)obj;
+ if ( da->supportsMenu() )
+ insertObject( da, item );
+ else
+ insertObject( da->widget(), item );
+ } else if ( ::qt_cast<QDesignerActionGroup*>(obj) ) {
+ insertObject( obj, item );
+ }
+ }
+ } else if ( ::qt_cast<MenuBarEditor*>(o) ) {
+ MenuBarEditor *mb = (MenuBarEditor*)o;
+ for ( int i = mb->count() -1; i >= 0; --i ) {
+ MenuBarEditorItem *md = mb->item( i );
+ if ( !md || !md->menu() )
+ continue;
+ insertObject( md->menu(), item );
+ }
+ }
+}
+
+void HierarchyList::setCurrent( QObject *o )
+{
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (HierarchyItem*)it.current() )->object() == o ) {
+ blockSignals( TRUE );
+ setCurrentItem( it.current() );
+ ensureItemVisible( it.current() );
+ blockSignals( FALSE );
+ return;
+ }
+ ++it;
+ }
+}
+
+void HierarchyList::showRMBMenu( QListViewItem *i, const QPoint & p )
+{
+ if ( !i )
+ return;
+
+ QObject *o = findObject( i );
+ if ( !o )
+ return;
+
+ if ( !o->isWidgetType() ||
+ ( o != formWindow && !formWindow->widgets()->find( (QWidget*)o ) ) )
+ return;
+
+ QWidget *w = (QWidget*)o;
+ if ( w->isVisibleTo( formWindow ) ) {
+ if ( !::qt_cast<QTabWidget*>(w) && !::qt_cast<QWizard*>(w) ) {
+ if ( !normalMenu )
+ normalMenu = formWindow->mainWindow()->setupNormalHierarchyMenu( this );
+ normalMenu->popup( p );
+ } else {
+ if ( !tabWidgetMenu )
+ tabWidgetMenu =
+ formWindow->mainWindow()->setupTabWidgetHierarchyMenu(
+ this, SLOT( addTabPage() ),
+ SLOT( removeTabPage() ) );
+ tabWidgetMenu->popup( p );
+ }
+ }
+}
+
+void HierarchyList::addTabPage()
+{
+ QObject *o = current();
+ if ( !o || !o->isWidgetType() )
+ return;
+ QWidget *w = (QWidget*)o;
+ if ( ::qt_cast<QTabWidget*>(w) ) {
+ QTabWidget *tw = (QTabWidget*)w;
+ AddTabPageCommand *cmd = new AddTabPageCommand( i18n( "Add Page to %1" ).
+ arg( tw->name() ), formWindow,
+ tw, "Tab" );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( ::qt_cast<QWizard*>(w) ) {
+ QWizard *wiz = (QWizard*)formWindow->mainContainer();
+ AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ).
+ arg( wiz->name() ), formWindow,
+ wiz, "Page" );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void HierarchyList::removeTabPage()
+{
+ QObject *o = current();
+ if ( !o || !o->isWidgetType() )
+ return;
+ QWidget *w = (QWidget*)o;
+ if ( ::qt_cast<QTabWidget*>(w) ) {
+ QTabWidget *tw = (QTabWidget*)w;
+ if ( tw->currentPage() ) {
+ QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw;
+ DeleteTabPageCommand *cmd =
+ new DeleteTabPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( dtw->pageTitle() ).arg( tw->name() ),
+ formWindow, tw, tw->currentPage() );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( ::qt_cast<QWizard*>(w) ) {
+ QWizard *wiz = (QWizard*)formWindow->mainContainer();
+ if ( wiz->currentPage() ) {
+ QDesignerWizard *dw = (QDesignerWizard*)wiz;
+ DeleteWizardPageCommand *cmd =
+ new DeleteWizardPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( dw->pageTitle() ).arg( wiz->name() ),
+ formWindow, wiz,
+ wiz->indexOf( wiz->currentPage() ), TRUE );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+}
+
+// ------------------------------------------------------------
+
+FormDefinitionView::FormDefinitionView( QWidget *parent, FormWindow *fw )
+ : HierarchyList( parent, fw, TRUE )
+{
+ header()->hide();
+ removeColumn( 1 );
+ connect( this, SIGNAL( itemRenamed( QListViewItem *, int, const QString & ) ),
+ this, SLOT( renamed( QListViewItem * ) ) );
+ popupOpen = FALSE;
+}
+
+void FormDefinitionView::setup()
+{
+ if ( popupOpen || !formWindow )
+ return;
+ if ( !formWindow->project()->isCpp() )
+ return;
+ QListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::DefinitionParent ) {
+ QListViewItem *a = i;
+ i = i->nextSibling();
+ delete a;
+ continue;
+ }
+ i = i->nextSibling();
+ }
+
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( lIface ) {
+ QStringList defs = lIface->definitions();
+ for ( QStringList::Iterator dit = defs.begin(); dit != defs.end(); ++dit ) {
+ HierarchyItem *itemDef = new HierarchyItem( HierarchyItem::DefinitionParent, this, 0,
+ i18n( *dit ), QString::null, QString::null );
+ itemDef->setPixmap( 0, DesignerFolderPix );
+ itemDef->setOpen( TRUE );
+ QStringList entries =
+ lIface->definitionEntries( *dit, formWindow->mainWindow()->designerInterface() );
+ HierarchyItem *item = 0;
+ for ( QStringList::Iterator eit = entries.begin(); eit != entries.end(); ++eit ) {
+ item = new HierarchyItem( HierarchyItem::Definition,
+ itemDef, item, *eit, QString::null, QString::null );
+ item->setRenameEnabled( 0, TRUE );
+ }
+ }
+ lIface->release();
+ }
+ setupVariables();
+ refresh();
+}
+
+void FormDefinitionView::setupVariables()
+{
+ bool pubOpen, protOpen, privOpen;
+ pubOpen = protOpen = privOpen = TRUE;
+ QListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::VarParent ) {
+ QListViewItem *a = i;
+ i = i->firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::VarPublic )
+ pubOpen = i->isOpen();
+ else if ( i->rtti() == HierarchyItem::VarProtected )
+ protOpen = i->isOpen();
+ else if ( i->rtti() == HierarchyItem::VarPrivate )
+ privOpen = i->isOpen();
+ i = i->nextSibling();
+ }
+ delete a;
+ break;
+ }
+ i = i->nextSibling();
+ }
+
+ HierarchyItem *itemVar = new HierarchyItem( HierarchyItem::VarParent, this, 0, i18n( "Class Variables" ),
+ QString::null, QString::null );
+ itemVar->setPixmap( 0, DesignerFolderPix );
+ itemVar->setOpen( TRUE );
+
+ itemVarPriv = new HierarchyItem( HierarchyItem::VarPrivate, itemVar, 0, i18n( "private" ),
+ QString::null, QString::null );
+ itemVarProt = new HierarchyItem( HierarchyItem::VarProtected, itemVar, 0, i18n( "protected" ),
+ QString::null, QString::null );
+ itemVarPubl = new HierarchyItem( HierarchyItem::VarPublic, itemVar, 0, i18n( "public" ),
+ QString::null, QString::null );
+
+ QValueList<MetaDataBase::Variable> varList = MetaDataBase::variables( formWindow );
+ QValueList<MetaDataBase::Variable>::Iterator it = --( varList.end() );
+ if ( !varList.isEmpty() && itemVar ) {
+ for (;;) {
+ QListViewItem *item = 0;
+ if ( (*it).varAccess == "public" )
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarPubl, 0, (*it).varName,
+ QString::null, QString::null );
+ else if ( (*it).varAccess == "private" )
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarPriv, 0, (*it).varName,
+ QString::null, QString::null );
+ else // default is protected
+ item = new HierarchyItem( HierarchyItem::Variable, itemVarProt, 0, (*it).varName,
+ QString::null, QString::null );
+ item->setPixmap( 0, DesignerEditSlotsPix );
+ if ( it == varList.begin() )
+ break;
+ --it;
+ }
+ }
+ itemVar->setOpen( TRUE );
+ itemVarPriv->setOpen( privOpen );
+ itemVarProt->setOpen( protOpen );
+ itemVarPubl->setOpen( pubOpen );
+}
+
+void FormDefinitionView::refresh()
+{
+ if ( popupOpen || !formWindow || !formWindow->project()->isCpp() )
+ return;
+
+ bool fuPub, fuProt, fuPriv, slPub, slProt, slPriv;
+ fuPub = fuProt = fuPriv = slPub = slProt = slPriv = TRUE;
+ QListViewItem *i = firstChild();
+ while ( i ) {
+ if ( i->rtti() == HierarchyItem::SlotParent ||
+ i->rtti() == HierarchyItem::FunctParent ) {
+ QListViewItem *a = i;
+ i = i->firstChild();
+ while ( i ) {
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctPublic:
+ fuPub = i->isOpen();
+ case HierarchyItem::FunctProtected:
+ fuProt = i->isOpen();
+ break;
+ case HierarchyItem::FunctPrivate:
+ fuPriv = i->isOpen();
+ break;
+ case HierarchyItem::SlotPublic:
+ slPub = i->isOpen();
+ if ( slPub )
+ break;
+ case HierarchyItem::SlotProtected:
+ slProt = i->isOpen();
+ break;
+ case HierarchyItem::SlotPrivate:
+ slPriv = i->isOpen();
+ }
+ i = i->nextSibling();
+ }
+ i = a->nextSibling();
+ delete a;
+ continue;
+ }
+ i = i->nextSibling();
+ }
+
+
+ itemFunct = new HierarchyItem( HierarchyItem::FunctParent,
+ this, 0, i18n( "Functions" ), QString::null, QString::null );
+ itemFunct->moveItem( i );
+ itemFunct->setPixmap( 0, DesignerFolderPix );
+ itemFunctPriv = new HierarchyItem( HierarchyItem::FunctPrivate, itemFunct, 0,
+ i18n( "private" ), QString::null, QString::null );
+ itemFunctProt = new HierarchyItem( HierarchyItem::FunctProtected, itemFunct, 0,
+ i18n( "protected" ), QString::null, QString::null );
+ itemFunctPubl = new HierarchyItem( HierarchyItem::FunctPublic, itemFunct, 0,
+ i18n( "public" ), QString::null, QString::null );
+
+ itemSlots = new HierarchyItem( HierarchyItem::SlotParent,
+ this, 0, i18n( "Slots" ), QString::null, QString::null );
+ itemSlots->setPixmap( 0, DesignerFolderPix );
+ itemPrivate = new HierarchyItem( HierarchyItem::SlotPrivate, itemSlots, 0, i18n( "private" ),
+ QString::null, QString::null );
+ itemProtected = new HierarchyItem( HierarchyItem::SlotProtected, itemSlots, 0, i18n( "protected" ),
+ QString::null, QString::null );
+ itemPublic = new HierarchyItem( HierarchyItem::SlotPublic, itemSlots, 0, i18n( "public" ),
+ QString::null, QString::null );
+
+ QValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
+ QValueList<MetaDataBase::Function>::Iterator it = --( functionList.end() );
+ if ( !functionList.isEmpty() && itemFunct ) {
+ for (;;) {
+ QListViewItem *item = 0;
+ if ( (*it).type == "slot" ) {
+ if ( (*it).access == "protected" )
+ item = new HierarchyItem( HierarchyItem::Slot, itemProtected, 0, (*it).function,
+ QString::null, QString::null );
+ else if ( (*it).access == "private" )
+ item = new HierarchyItem( HierarchyItem::Slot, itemPrivate, 0, (*it).function,
+ QString::null, QString::null );
+ else // default is public
+ item = new HierarchyItem( HierarchyItem::Slot, itemPublic, 0, (*it).function,
+ QString::null, QString::null );
+ } else {
+ if ( (*it).access == "protected" )
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctProt, 0, (*it).function,
+ QString::null, QString::null );
+ else if ( (*it).access == "private" )
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctPriv, 0, (*it).function,
+ QString::null, QString::null );
+ else // default is public
+ item = new HierarchyItem( HierarchyItem::Function, itemFunctPubl, 0, (*it).function,
+ QString::null, QString::null );
+ }
+ item->setPixmap( 0, DesignerEditSlotsPix );
+ if ( it == functionList.begin() )
+ break;
+ --it;
+ }
+ }
+
+ itemFunct->setOpen( TRUE );
+ itemFunctPubl->setOpen( fuPub );
+ itemFunctProt->setOpen( fuProt );
+ itemFunctPriv->setOpen( fuPriv );
+
+ itemSlots->setOpen( TRUE );
+ itemPublic->setOpen( slPub );
+ itemProtected->setOpen( slProt );
+ itemPrivate->setOpen( slPriv );
+}
+
+
+void FormDefinitionView::setCurrent( QWidget * )
+{
+}
+
+void FormDefinitionView::objectClicked( QListViewItem *i )
+{
+ if ( !i )
+ return;
+ if ( (i->rtti() == HierarchyItem::Slot) || (i->rtti() == HierarchyItem::Function) )
+ {
+ formWindow->clearSelection(false);
+ formWindow->mainWindow()->part()->emitEditFunction(formWindow->fileName(), i->text( 0 ));
+ }
+// formWindow->mainWindow()->editFunction( i->text( 0 ) );
+}
+
+static HierarchyItem::Type getChildType( int type )
+{
+ switch ( (HierarchyItem::Type)type ) {
+ case HierarchyItem::Widget:
+ qWarning( "getChildType: Inserting childs dynamically to Widget or SlotParent is not allowed!" );
+ break;
+ case HierarchyItem::SlotParent:
+ case HierarchyItem::SlotPublic:
+ case HierarchyItem::SlotProtected:
+ case HierarchyItem::SlotPrivate:
+ case HierarchyItem::Slot:
+ return HierarchyItem::Slot;
+ case HierarchyItem::DefinitionParent:
+ case HierarchyItem::Definition:
+ return HierarchyItem::Definition;
+ case HierarchyItem::Event:
+ case HierarchyItem::EventFunction:
+ return HierarchyItem::Event;
+ case HierarchyItem::FunctParent:
+ case HierarchyItem::FunctPublic:
+ case HierarchyItem::FunctProtected:
+ case HierarchyItem::FunctPrivate:
+ case HierarchyItem::Function:
+ return HierarchyItem::Function;
+ case HierarchyItem::VarParent:
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate:
+ case HierarchyItem::Variable:
+ return HierarchyItem::Variable;
+ }
+ return (HierarchyItem::Type)type;
+}
+
+void HierarchyList::insertEntry( QListViewItem *i, const QPixmap &pix, const QString &s )
+{
+ QListViewItem *after = i->firstChild();
+ while ( after && after->nextSibling() )
+ after = after->nextSibling();
+ HierarchyItem *item = new HierarchyItem( getChildType( i->rtti() ), i, after, s,
+ QString::null, QString::null );
+ if ( !pix.isNull() )
+ item->setPixmap( 0, pix );
+ item->setRenameEnabled( 0, TRUE );
+ setCurrentItem( item );
+ ensureItemVisible( item );
+ qApp->processEvents();
+ newItem = item;
+ item->startRename( 0 );
+}
+
+void FormDefinitionView::contentsMouseDoubleClickEvent( QMouseEvent *e )
+{
+ QListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if ( !i )
+ return;
+
+ if ( i->rtti() == HierarchyItem::SlotParent || i->rtti() == HierarchyItem::FunctParent ||
+ i->rtti() == HierarchyItem::VarParent )
+ return;
+
+ HierarchyItem::Type t = getChildType( i->rtti() );
+ if ( (int)t == i->rtti() )
+ i = i->parent();
+
+ if ( formWindow->project()->isCpp() )
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctPublic:
+ execFunctionDialog( "public", "function", TRUE );
+ break;
+ case HierarchyItem::FunctProtected:
+ execFunctionDialog( "protected", "function", TRUE );
+ break;
+ case HierarchyItem::FunctPrivate:
+ execFunctionDialog( "private", "function", TRUE );
+ break;
+ case HierarchyItem::SlotPublic:
+ execFunctionDialog( "public", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotProtected:
+ execFunctionDialog( "protected", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotPrivate:
+ execFunctionDialog( "private", "slot", TRUE );
+ break;
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate: {
+ VariableDialog varDia( formWindow, this );
+ QListViewItem *i = selectedItem();
+ if ( i )
+ varDia.setCurrentItem( i->text( 0 ) );
+ varDia.exec();
+ break;
+ }
+ default:
+ insertEntry( i );
+ } else
+ insertEntry( i );
+}
+
+void FormDefinitionView::execFunctionDialog( const QString &access, const QString &type, bool addFunc )
+{
+ FormFile *formFile = formWindow->formFile();
+ if ( !formFile || !formFile->isUihFileUpToDate() )
+ return;
+
+ // refresh the functions list in the metadatabase
+ SourceEditor *editor = formFile->editor();
+ if ( editor )
+ editor->refresh( TRUE );
+
+ EditFunctions dlg( this, formWindow );
+ if ( addFunc )
+ dlg.functionAdd( access, type );
+ dlg.exec();
+}
+
+void FormDefinitionView::showRMBMenu( QListViewItem *i, const QPoint &pos )
+{
+ if ( !i )
+ return;
+
+ const int EDIT = 1;
+ const int NEW = 2;
+ const int DEL = 3;
+ const int PROPS = 4;
+ const int GOIMPL = 5;
+
+ QPopupMenu menu;
+ bool insertDelete = FALSE;
+
+ if ( i->rtti() == HierarchyItem::FunctParent || i->rtti() == HierarchyItem::SlotParent ||
+ i->rtti() == HierarchyItem::VarParent ) {
+ menu.insertItem( SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), i18n( "Edit..." ), EDIT );
+ } else
+ menu.insertItem( SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()), i18n( "New..." ), NEW );
+ if ( i->rtti() == HierarchyItem::DefinitionParent || i->rtti() == HierarchyItem::Variable ||
+ i->rtti() == HierarchyItem::Definition ) {
+ menu.insertItem( SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), i18n( "Edit..." ), EDIT );
+ }
+ if ( i->rtti() == HierarchyItem::Function || i->rtti() == HierarchyItem::Slot ) {
+ if ( formWindow->project()->isCpp() )
+ menu.insertItem( SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), i18n( "Properties" ), PROPS );
+ if ( MetaDataBase::hasEditor( formWindow->project()->language() ) )
+ menu.insertItem( i18n( "Goto Implementation" ), GOIMPL );
+ insertDelete = TRUE;
+ }
+ if ( insertDelete || i->rtti() == HierarchyItem::Variable ||
+ i->rtti() == HierarchyItem::Function || i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Definition ) {
+ menu.insertSeparator();
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()), i18n( "Delete" ), DEL );
+ }
+ popupOpen = TRUE;
+ int res = menu.exec( pos );
+ popupOpen = FALSE;
+ if ( res == -1 )
+ return;
+
+ if ( res == EDIT ) {
+ switch( i->rtti() ) {
+ case HierarchyItem::FunctParent:
+ execFunctionDialog( "public", "function", FALSE );
+ break;
+ case HierarchyItem::SlotParent:
+ execFunctionDialog( "public", "slot", FALSE );
+ break;
+ case HierarchyItem::VarParent:
+ case HierarchyItem::VarPublic:
+ case HierarchyItem::VarProtected:
+ case HierarchyItem::VarPrivate:
+ case HierarchyItem::Variable: {
+ VariableDialog varDia( formWindow, this );
+ QListViewItem *i = selectedItem();
+ if ( i )
+ varDia.setCurrentItem( i->text( 0 ) );
+ if ( varDia.exec() == QDialog::Accepted )
+ formWindow->commandHistory()->setModified( TRUE );
+ break;
+ }
+ case HierarchyItem::Definition:
+ case HierarchyItem::DefinitionParent:
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !lIface )
+ return;
+ if ( i->rtti() == HierarchyItem::Definition )
+ i = i->parent();
+ ListEditor dia( this, 0, TRUE );
+ dia.setCaption( i18n( "Edit %1" ).arg( i->text( 0 ) ) );
+ QStringList entries = lIface->definitionEntries( i->text( 0 ), MainWindow::self->designerInterface() );
+ dia.setList( entries );
+ dia.exec();
+ Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).arg( i->text( 0 )), formWindow,
+ lIface, i->text( 0 ), dia.items() );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( res == NEW ) {
+ HierarchyItem::Type t = getChildType( i->rtti() );
+ if ( (int)t == i->rtti() )
+ i = i->parent();
+ switch( i->rtti() ) {
+ case HierarchyItem::SlotPublic:
+ execFunctionDialog( "public", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotProtected:
+ execFunctionDialog( "protected", "slot", TRUE );
+ break;
+ case HierarchyItem::SlotPrivate:
+ execFunctionDialog( "private" , "slot", TRUE );
+ break;
+ case HierarchyItem::FunctPublic:
+ execFunctionDialog( "public", "function", TRUE );
+ break;
+ case HierarchyItem::FunctProtected:
+ execFunctionDialog( "protected", "function", TRUE );
+ break;
+ case HierarchyItem::FunctPrivate:
+ execFunctionDialog( "private" , "function", TRUE );
+ break;
+ default:
+ insertEntry( i );
+ }
+ } else if ( res == DEL ) {
+ if ( i->rtti() == HierarchyItem::Slot || i->rtti() == HierarchyItem::Function ) {
+
+ QCString funct( MetaDataBase::normalizeFunction( i->text( 0 ) ).latin1() );
+ Command *cmd = new RemoveFunctionCommand( i18n( "Remove Function" ), formWindow, funct,
+ QString::null, QString::null, QString::null,
+ QString::null, formWindow->project()->language() );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ } else if ( i->rtti() == HierarchyItem::Variable ) {
+ Command *cmd = new RemoveVariableCommand( i18n( "Remove Variable" ), formWindow,
+ i->text( 0 ) );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else {
+ QListViewItem *p = i->parent();
+ delete i;
+ save( p, 0 );
+ }
+ } else if ( res == PROPS ) {
+ if ( i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Function ) {
+ EditFunctions dlg( this, formWindow );
+ dlg.setCurrentFunction( MetaDataBase::normalizeFunction( i->text( 0 ) ) );
+ dlg.exec();
+ }
+ } else if ( res == GOIMPL ) {
+ if ( i->rtti() == HierarchyItem::Slot ||
+ i->rtti() == HierarchyItem::Function ) {
+ formWindow->clearSelection(false);
+ formWindow->mainWindow()->part()->emitEditFunction(formWindow->fileName(), i->text( 0 ));
+// formWindow->mainWindow()->editFunction( i->text( 0 ) );
+ }
+ }
+}
+
+void FormDefinitionView::renamed( QListViewItem *i )
+{
+ if ( newItem == i )
+ newItem = 0;
+ if ( !i->parent() )
+ return;
+ save( i->parent(), i );
+}
+
+
+void FormDefinitionView::save( QListViewItem *p, QListViewItem *i )
+{
+ if ( i && i->text( 0 ).isEmpty() ) {
+ delete i;
+ return;
+ }
+
+ if ( i && i->rtti() == HierarchyItem::Variable ) {
+ i->setRenameEnabled( 0, FALSE );
+ QString varName = i->text( 0 );
+ varName = varName.simplifyWhiteSpace();
+ if ( varName[(int)varName.length() - 1] != ';' )
+ varName += ";";
+ if ( MetaDataBase::hasVariable( formWindow, varName ) ) {
+ QMessageBox::information( this, i18n( "Edit Variables" ),
+ i18n( "This variable has already been declared." ) );
+ } else {
+ if ( p->rtti() == HierarchyItem::VarPublic )
+ addVariable( varName, "public" );
+ else if ( p->rtti() == HierarchyItem::VarProtected )
+ addVariable( varName, "protected" );
+ else if ( p->rtti() == HierarchyItem::VarPrivate )
+ addVariable( varName, "private" );
+ }
+ } else {
+ LanguageInterface *lIface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( !lIface )
+ return;
+ QStringList lst;
+ i = p->firstChild();
+ while ( i ) {
+ lst << i->text( 0 );
+ i = i->nextSibling();
+ }
+ Command *cmd = new EditDefinitionsCommand( i18n( "Edit %1" ).arg( p->text( 0 ) ), formWindow,
+ lIface, p->text( 0 ), lst );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void FormDefinitionView::addVariable( const QString &varName, const QString &access )
+{
+ Command *cmd = new AddVariableCommand( i18n( "Add Variable" ), formWindow,
+ varName, access );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+// ------------------------------------------------------------
+
+HierarchyView::HierarchyView( QWidget *parent )
+ : QTabWidget( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
+ WStyle_Tool |WStyle_MinMax | WStyle_SysMenu )
+{
+ formwindow = 0;
+ editor = 0;
+ listview = new HierarchyList( this, formWindow() );
+ fView = new FormDefinitionView( this, formWindow() );
+ if ( !MainWindow::self->singleProjectMode() ) {
+ addTab( listview, i18n( "Objects" ) );
+ setTabToolTip( listview, i18n( "List of all widgets and objects of the current form in hierarchical order" ) );
+ addTab( fView, i18n( "Members" ) );
+ setTabToolTip( fView, i18n( "List of all members of the current form" ) );
+ } else {
+ listview->hide();
+ fView->hide();
+ }
+
+ if ( !classBrowserInterfaceManager ) {
+ classBrowserInterfaceManager =
+ new QPluginManager<ClassBrowserInterface>( IID_ClassBrowser, QApplication::libraryPaths(),
+ MainWindow::self->pluginDirectory() );
+ }
+
+ classBrowsers = new QMap<QString, ClassBrowser>();
+ QStringList langs = MetaDataBase::languages();
+ for ( QStringList::Iterator it = langs.begin(); it != langs.end(); ++it ) {
+ QInterfacePtr<ClassBrowserInterface> ciface = 0;
+ classBrowserInterfaceManager->queryInterface( *it, &ciface );
+ if ( ciface ) {
+ ClassBrowser cb( ciface->createClassBrowser( this ), ciface );
+ addTab( cb.lv, i18n( "Class Declarations" ) );
+ setTabToolTip( cb.lv, i18n( "List of all classes and its declarations of the current source file" ) );
+ ciface->onClick( this, SLOT( jumpTo( const QString &, const QString &, int ) ) );
+ classBrowsers->insert( *it, cb );
+ setTabEnabled( cb.lv, FALSE );
+ }
+ }
+}
+
+HierarchyView::~HierarchyView()
+{
+}
+
+void HierarchyView::clear()
+{
+ listview->clear();
+ fView->clear();
+ for ( QMap<QString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ (*it).iface->clear();
+ }
+}
+
+void HierarchyView::setFormWindow( FormWindow *fw, QObject *o )
+{
+ bool fake = fw && qstrcmp( fw->name(), "qt_fakewindow" ) == 0;
+ if ( fw == 0 || o == 0 ) {
+ listview->clear();
+ fView->clear();
+ listview->setFormWindow( fw );
+ fView->setFormWindow( fw );
+ formwindow = 0;
+ editor = 0;
+ }
+
+ setTabEnabled( listview, TRUE );
+ setTabEnabled( fView, fw && fw->project()->isCpp() );
+
+ if ( fw == formwindow ) {
+ if ( fw ) {
+ if ( !fake )
+ listview->setCurrent( (QWidget*)o );
+ else
+ listview->clear();
+ if ( MainWindow::self->qWorkspace()->activeWindow() == fw )
+ showPage( listview );
+ else if ( fw->project()->isCpp() )
+ showPage( fView );
+ else
+ showClasses( fw->formFile()->editor() );
+ }
+ }
+
+ formwindow = fw;
+ if ( !fake ) {
+ listview->setFormWindow( fw );
+ } else {
+ listview->setFormWindow( 0 );
+ listview->clear();
+ }
+
+ fView->setFormWindow( fw );
+ if ( !fake ) {
+ listview->setup();
+ listview->setCurrent( (QWidget*)o );
+ }
+ fView->setup();
+
+ for ( QMap<QString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ (*it).iface->clear();
+ setTabEnabled( (*it).lv, fw && !fw->project()->isCpp() );
+ }
+
+ if ( MainWindow::self->qWorkspace()->activeWindow() == fw )
+ showPage( listview );
+ else if ( fw && fw->project()->isCpp() )
+ showPage( fView );
+ else if ( fw )
+ showClasses( fw->formFile()->editor() );
+
+ editor = 0;
+}
+
+void HierarchyView::showClasses( SourceEditor *se )
+{
+ if ( !se->object() )
+ return;
+
+ lastSourceEditor = se;
+ QTimer::singleShot( 100, this, SLOT( showClassesTimeout() ) );
+}
+
+void HierarchyView::showClassesTimeout()
+{
+ if ( !lastSourceEditor )
+ return;
+ SourceEditor *se = (SourceEditor*)lastSourceEditor;
+ if ( !se->object() )
+ return;
+ if ( se->formWindow() && se->formWindow()->project()->isCpp() ) {
+ setFormWindow( se->formWindow(), se->formWindow()->currentWidget() );
+ MainWindow::self->propertyeditor()->setWidget( se->formWindow()->currentWidget(),
+ se->formWindow() );
+ return;
+ }
+
+ setTabEnabled( listview, !!se->formWindow() && !se->formWindow()->isFake() );
+ setTabEnabled( fView, FALSE );
+
+ formwindow = 0;
+ listview->setFormWindow( 0 );
+ fView->setFormWindow( 0 );
+ listview->clear();
+ fView->clear();
+ if ( !se->formWindow() )
+ MainWindow::self->propertyeditor()->setWidget( 0, 0 );
+ editor = se;
+
+ for ( QMap<QString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ if ( it.key() == se->project()->language() ) {
+ (*it).iface->update( se->text() );
+ setTabEnabled( (*it).lv, TRUE );
+ showPage( (*it).lv );
+ } else {
+ setTabEnabled( (*it).lv, FALSE );
+ (*it).iface->clear();
+ }
+ }
+}
+
+void HierarchyView::updateClassBrowsers()
+{
+ if ( !editor )
+ return;
+ for ( QMap<QString, ClassBrowser>::Iterator it = classBrowsers->begin();
+ it != classBrowsers->end(); ++it ) {
+ if ( it.key() == editor->project()->language() )
+ (*it).iface->update( editor->text() );
+ else
+ (*it).iface->clear();
+ }
+}
+
+FormWindow *HierarchyView::formWindow() const
+{
+ return formwindow;
+}
+
+void HierarchyView::closeEvent( QCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+void HierarchyView::widgetInserted( QWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetRemoved( QWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetsInserted( const QWidgetList & )
+{
+ listview->setup();
+}
+
+void HierarchyView::widgetsRemoved( const QWidgetList & )
+{
+ listview->setup();
+}
+
+void HierarchyView::namePropertyChanged( QWidget *w, const QVariant & )
+{
+ QWidget *w2 = w;
+ if ( ::qt_cast<QMainWindow*>(w) )
+ w2 = ( (QMainWindow*)w )->centralWidget();
+ listview->changeNameOf( w2, w->name() );
+}
+
+
+void HierarchyView::databasePropertyChanged( QWidget *w, const QStringList& info )
+{
+#ifndef QT_NO_SQL
+ QString i = info.join( "." );
+ listview->changeDatabaseOf( w, i );
+#endif
+}
+
+
+void HierarchyView::tabsChanged( QTabWidget * )
+{
+ listview->setup();
+}
+
+void HierarchyView::pagesChanged( QWizard * )
+{
+ listview->setup();
+}
+
+void HierarchyView::rebuild()
+{
+ listview->setup();
+}
+
+void HierarchyView::closed( FormWindow *fw )
+{
+ if ( fw == formwindow ) {
+ listview->clear();
+ fView->clear();
+ }
+}
+
+void HierarchyView::updateFormDefinitionView()
+{
+ fView->setup();
+}
+
+void HierarchyView::jumpTo( const QString &func, const QString &clss, int type )
+{
+ if ( !editor )
+ return;
+ if ( type == ClassBrowserInterface::Class )
+ editor->setClass( func );
+ else
+ editor->setFunction( func, clss );
+}
+
+HierarchyView::ClassBrowser::ClassBrowser( QListView *l, ClassBrowserInterface *i )
+ : lv( l ), iface( i )
+{
+}
+
+HierarchyView::ClassBrowser::~ClassBrowser()
+{
+}
diff --git a/kdevdesigner/designer/hierarchyview.h b/kdevdesigner/designer/hierarchyview.h
new file mode 100644
index 00000000..ffd269b7
--- /dev/null
+++ b/kdevdesigner/designer/hierarchyview.h
@@ -0,0 +1,249 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef HIRARCHYVIEW_H
+#define HIRARCHYVIEW_H
+
+#include <qvariant.h>
+#include <qlistview.h>
+#include <qtabwidget.h>
+#include <qguardedptr.h>
+#include <private/qcom_p.h>
+#include "../interfaces/classbrowserinterface.h"
+
+class FormWindow;
+class QCloseEvent;
+class QPopupMenu;
+class QKeyEvent;
+class QMouseEvent;
+class QWizard;
+class SourceEditor;
+
+class HierarchyItem : public QListViewItem
+{
+public:
+ enum Type {
+ Widget,
+ SlotParent,
+ SlotPublic,
+ SlotProtected,
+ SlotPrivate,
+ Slot,
+ DefinitionParent,
+ Definition,
+ Event,
+ EventFunction,
+ FunctParent,
+ FunctPublic,
+ FunctProtected,
+ FunctPrivate,
+ Function,
+ VarParent,
+ VarPublic,
+ VarProtected,
+ VarPrivate,
+ Variable
+ };
+
+ HierarchyItem( Type type, QListViewItem *parent, QListViewItem *after,
+ const QString &txt1, const QString &txt2, const QString &txt3 );
+ HierarchyItem( Type type, QListView *parent, QListViewItem *after,
+ const QString &txt1, const QString &txt2, const QString &txt3 );
+
+ void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
+ void updateBackColor();
+
+ void setObject( QObject *o );
+ QObject *object() const;
+
+ void setText( int col, const QString &txt ) { if ( !txt.isEmpty() ) QListViewItem::setText( col, txt ); }
+
+ int rtti() const { return (int)typ; }
+
+private:
+ void okRename( int col );
+ void cancelRename( int col );
+
+private:
+ QColor backgroundColor();
+ QColor backColor;
+ QObject *obj;
+ Type typ;
+
+};
+
+class HierarchyList : public QListView
+{
+ Q_OBJECT
+
+public:
+ HierarchyList( QWidget *parent, FormWindow *fw, bool doConnects = TRUE );
+
+ virtual void setup();
+ virtual void setCurrent( QObject *o );
+ void setOpen( QListViewItem *i, bool b );
+ void changeNameOf( QObject *o, const QString &name );
+ void changeDatabaseOf( QObject *o, const QString &info );
+ void setFormWindow( FormWindow *fw ) { formWindow = fw; }
+ void drawContentsOffset( QPainter *p, int ox, int oy,
+ int cx, int cy, int cw, int ch ) {
+ setUpdatesEnabled( FALSE );
+ triggerUpdate();
+ setUpdatesEnabled( TRUE );
+ QListView::drawContentsOffset( p, ox, oy, cx, cy, cw, ch );
+ }
+
+ void insertEntry( QListViewItem *i, const QPixmap &pix = QPixmap(), const QString &s = QString::null );
+
+protected:
+ void keyPressEvent( QKeyEvent *e );
+ void keyReleaseEvent( QKeyEvent *e );
+ void viewportMousePressEvent( QMouseEvent *e );
+ void viewportMouseReleaseEvent( QMouseEvent *e );
+
+public slots:
+ void addTabPage();
+ void removeTabPage();
+
+private:
+ void insertObject( QObject *o, QListViewItem *parent );
+ QObject *findObject( QListViewItem *i );
+ QListViewItem *findItem( QObject *o );
+ QObject *current() const;
+ QObject *handleObjectClick( QListViewItem *i );
+
+private slots:
+ virtual void objectClicked( QListViewItem *i );
+ virtual void objectDoubleClicked( QListViewItem *i );
+ virtual void showRMBMenu( QListViewItem *, const QPoint & );
+
+protected:
+ FormWindow *formWindow;
+ QPopupMenu *normalMenu, *tabWidgetMenu;
+ bool deselect;
+
+ QPixmap DesignerFormPix;
+ QPixmap DesignerLayoutPix;
+ QPixmap DesignerFolderPix;
+ QPixmap DesignerEditSlotsPix;
+
+};
+
+class FormDefinitionView : public HierarchyList
+{
+ Q_OBJECT
+
+public:
+ FormDefinitionView( QWidget *parent, FormWindow *fw );
+
+ void setup();
+ void setupVariables();
+ void refresh();
+ void setCurrent( QWidget *w );
+
+protected:
+ void contentsMouseDoubleClickEvent( QMouseEvent *e );
+
+private:
+ void save( QListViewItem *p, QListViewItem *i );
+ void execFunctionDialog( const QString &access, const QString &type, bool addFunc );
+ void addVariable( const QString &varName, const QString &access );
+
+private slots:
+ void objectClicked( QListViewItem *i );
+ void showRMBMenu( QListViewItem *, const QPoint & );
+ void renamed( QListViewItem *i );
+
+private:
+ bool popupOpen;
+ HierarchyItem *itemSlots, *itemPrivate, *itemProtected, *itemPublic;
+ HierarchyItem *itemFunct, *itemFunctPriv, *itemFunctProt, *itemFunctPubl;
+ HierarchyItem *itemVar, *itemVarPriv, *itemVarProt, *itemVarPubl;
+};
+
+
+class HierarchyView : public QTabWidget
+{
+ Q_OBJECT
+
+public:
+ HierarchyView( QWidget *parent );
+ ~HierarchyView();
+
+ void setFormWindow( FormWindow *fw, QObject *o );
+ FormWindow *formWindow() const;
+ SourceEditor *sourceEditor() const { return editor; }
+ void clear();
+
+ void showClasses( SourceEditor *se );
+ void updateClassBrowsers();
+
+ void widgetInserted( QWidget *w );
+ void widgetRemoved( QWidget *w );
+ void widgetsInserted( const QWidgetList &l );
+ void widgetsRemoved( const QWidgetList &l );
+ void namePropertyChanged( QWidget *w, const QVariant &old );
+ void databasePropertyChanged( QWidget *w, const QStringList& info );
+ void tabsChanged( QTabWidget *w );
+ void pagesChanged( QWizard *w );
+ void rebuild();
+ void closed( FormWindow *fw );
+ void updateFormDefinitionView();
+
+ FormDefinitionView *formDefinitionView() const { return fView; }
+ HierarchyList *hierarchyList() const { return listview; }
+
+protected slots:
+ void jumpTo( const QString &func, const QString &clss,int type );
+ void showClassesTimeout();
+
+protected:
+ void closeEvent( QCloseEvent *e );
+
+signals:
+ void hidden();
+
+private:
+ struct ClassBrowser
+ {
+ ClassBrowser( QListView * = 0, ClassBrowserInterface * = 0 );
+ ~ClassBrowser();
+ QListView *lv;
+ QInterfacePtr<ClassBrowserInterface> iface;
+
+ Q_DUMMY_COMPARISON_OPERATOR( ClassBrowser )
+ };
+ FormWindow *formwindow;
+ HierarchyList *listview;
+ FormDefinitionView *fView;
+ SourceEditor *editor;
+ QMap<QString, ClassBrowser> *classBrowsers;
+ QGuardedPtr<SourceEditor> lastSourceEditor;
+
+};
+
+
+#endif
diff --git a/kdevdesigner/designer/iconvieweditor.ui b/kdevdesigner/designer/iconvieweditor.ui
new file mode 100644
index 00000000..e06367f1
--- /dev/null
+++ b/kdevdesigner/designer/iconvieweditor.ui
@@ -0,0 +1,461 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>IconViewEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>IconViewEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>567</width>
+ <height>321</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Iconview</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Iconview&lt;/b&gt;&lt;p&gt;Add, edit or delete items in the icon view.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item, then enter text and choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the view and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the iconview.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QIconView">
+ <property name="name">
+ <cstring>preview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>All items in the iconview.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create a new item for the iconview.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Vertical Spacing1</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>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the text for the selected item.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item's pixmap.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select a pixmap file for the current item.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>insertNewItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>deleteCurrentItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged( const QString &amp; )</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>choosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>selectionChanged(QIconViewItem*)</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentItemChanged(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>currentChanged(QIconViewItem*)</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>currentItemChanged(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>IconViewEditorBase</receiver>
+ <slot>deletePixmap()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>preview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>buttonHelp</tabstop>
+ <tabstop>buttonApply</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">choosePixmap()</slot>
+ <slot access="protected">currentItemChanged( QIconViewItem * )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">deleteCurrentItem()</slot>
+ <slot access="protected">insertNewItem()</slot>
+ <slot access="protected">deletePixmap()</slot>
+ <slot access="protected">okClicked()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/iconvieweditorimpl.cpp b/kdevdesigner/designer/iconvieweditorimpl.cpp
new file mode 100644
index 00000000..10e2fb7d
--- /dev/null
+++ b/kdevdesigner/designer/iconvieweditorimpl.cpp
@@ -0,0 +1,165 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "iconvieweditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "pixmapchooser.h"
+
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qiconview.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+
+#include <klocale.h>
+
+IconViewEditor::IconViewEditor( QWidget *parent, QWidget *editWidget, FormWindow *fw )
+ : IconViewEditorBase( parent, 0, TRUE ), formwindow( fw )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ iconview = (QIconView*)editWidget;
+
+ itemText->setText( "" );
+ itemText->setEnabled( FALSE );
+ itemPixmap->setText( "" );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+
+ QIconViewItem *i = 0;
+ for ( i = iconview->firstItem(); i; i = i->nextItem() ) {
+ (void)new QIconViewItem( preview, i->text(), *i->pixmap() );
+ }
+
+ if ( preview->firstItem() )
+ preview->setCurrentItem( preview->firstItem() );
+}
+
+void IconViewEditor::insertNewItem()
+{
+ QIconViewItem *i = new QIconViewItem( preview, i18n( "New Item" ) );
+ preview->setCurrentItem( i );
+ preview->setSelected( i, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void IconViewEditor::deleteCurrentItem()
+{
+ delete preview->currentItem();
+ if ( preview->currentItem() )
+ preview->setSelected( preview->currentItem(), TRUE );
+}
+
+void IconViewEditor::currentItemChanged( QIconViewItem *i )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( "" );
+ itemPixmap->setText( "" );
+ itemText->blockSignals( FALSE );
+
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->blockSignals( TRUE );
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+
+ itemText->setText( i->text() );
+ if ( i->pixmap() )
+ itemPixmap->setPixmap( *i->pixmap() );
+ itemText->blockSignals( FALSE );
+}
+
+void IconViewEditor::currentTextChanged( const QString &txt )
+{
+ if ( !preview->currentItem() )
+ return;
+
+ preview->currentItem()->setText( txt );
+}
+
+void IconViewEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void IconViewEditor::cancelClicked()
+{
+ reject();
+}
+
+void IconViewEditor::applyClicked()
+{
+ QIconViewItem *i = 0;
+ QValueList<PopulateIconViewCommand::Item> items;
+ for ( i = preview->firstItem(); i; i = i->nextItem() ) {
+ PopulateIconViewCommand::Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ items.append( item );
+ }
+
+ PopulateIconViewCommand *cmd = new PopulateIconViewCommand( i18n( "Edit the Items of '%1'" ).arg( iconview->name() ),
+ formwindow, iconview, items );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void IconViewEditor::choosePixmap()
+{
+ if ( !preview->currentItem() )
+ return;
+
+ QPixmap pix;
+ if ( preview->currentItem()->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *preview->currentItem()->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ preview->currentItem()->setPixmap( pix );
+ itemPixmap->setPixmap( pix );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void IconViewEditor::deletePixmap()
+{
+ if ( !preview->currentItem() )
+ return;
+
+ preview->currentItem()->setPixmap( QPixmap() );
+ itemPixmap->setText( "" );
+ itemDeletePixmap->setEnabled( FALSE );
+}
diff --git a/kdevdesigner/designer/iconvieweditorimpl.h b/kdevdesigner/designer/iconvieweditorimpl.h
new file mode 100644
index 00000000..49e17570
--- /dev/null
+++ b/kdevdesigner/designer/iconvieweditorimpl.h
@@ -0,0 +1,58 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ICONVIEWEDITORIMPL_H
+#define ICONVIEWEDITORIMPL_H
+
+#include "iconvieweditor.h"
+
+class FormWindow;
+
+class IconViewEditor : public IconViewEditorBase
+{
+ Q_OBJECT
+
+public:
+ IconViewEditor( QWidget *parent, QWidget *editWidget, FormWindow *fw );
+
+protected slots:
+ void insertNewItem();
+ void deleteCurrentItem();
+ void currentItemChanged( QIconViewItem * );
+ void currentTextChanged( const QString & );
+ void okClicked();
+ void cancelClicked();
+ void applyClicked();
+ void choosePixmap();
+ void deletePixmap();
+
+private:
+ QIconView *iconview;
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/kdevdesigner_part.cpp b/kdevdesigner/designer/kdevdesigner_part.cpp
new file mode 100644
index 00000000..a806dffc
--- /dev/null
+++ b/kdevdesigner/designer/kdevdesigner_part.cpp
@@ -0,0 +1,565 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "kdevdesigner_part.h"
+
+#include <kinstance.h>
+#include <kaction.h>
+#include <kactionclasses.h>
+#include <kstdaction.h>
+#include <kfiledialog.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kiconloader.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qtoolbar.h>
+#include <qmenubar.h>
+#include <qptrlist.h>
+#include <qstatusbar.h>
+
+#include "mainwindow.h"
+#include "designeraction.h"
+#include "formwindow.h"
+
+KDevDesignerPart::KDevDesignerPart( QWidget *parentWidget, const char *// widgetName
+ ,
+ QObject *parent, const char *name, const QStringList &args )
+ : KInterfaceDesigner::Designer(parent, name)
+{
+ setInstance( KDevDesignerPartFactory::instance() );
+
+ m_widget = new MainWindow( this, true );
+ m_widget->reparent(parentWidget, QPoint(0,0));
+ setupDesignerWindow();
+
+ setWidget(m_widget);
+
+ setupActions();
+ if (args.contains("in shell"))
+ setXMLFile("kdevdesigner_part_sh.rc");
+ else
+ setXMLFile("kdevdesigner_part.rc");
+
+ setReadWrite(true);
+ setModified(false);
+
+ connect(m_widget, SIGNAL(formModified(bool )), this, SLOT(formModified(bool)));
+}
+
+void KDevDesignerPart::setupDesignerWindow()
+{
+ m_widget->menuBar()->hide();
+ m_widget->layoutToolBar->hide();
+ m_widget->projectToolBar->hide();
+ m_widget->toolsToolBar->hide();
+ m_widget->statusBar()->hide();
+}
+
+static QIconSet createPartIconSet( const QString &name )
+{
+ QIconSet ic( BarIcon( "" + name, KDevDesignerPartFactory::instance() ) );
+ QString prefix = "designer_";
+ int right = name.length() - prefix.length();
+ ic.setPixmap( BarIcon( prefix + "d_" + name.right( right ), KDevDesignerPartFactory::instance() ),
+ QIconSet::Small, QIconSet::Disabled );
+ return ic;
+}
+
+void KDevDesignerPart::setupActions( )
+{
+ KAction *action;
+ action = KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ action = KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+ action = KStdAction::close(this, SLOT(fileClose()), actionCollection());
+ stateSync(action, m_widget->actionFileClose);
+ action = KStdAction::save(this, SLOT(save()), actionCollection());
+ stateSync(action, m_widget->actionFileSave);
+ action = KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ stateSync(action, m_widget->actionFileSaveAs);
+ action = new KAction(i18n("Save Al&l"), 0, this, SLOT(fileSaveAs()), actionCollection(), "file_saveall");
+ stateSync(action, m_widget->actionFileSaveAll);
+ new KAction(i18n("Create &Template..."), 0, this, SLOT(fileCreateTemplate()), actionCollection(), "file_createtemplate");
+
+ action = KStdAction::undo(this, SLOT(editUndo()), actionCollection());
+ stateSync(action, m_widget->actionEditUndo);
+ action = KStdAction::redo(this, SLOT(editRedo()), actionCollection());
+ stateSync(action, m_widget->actionEditRedo);
+ action = KStdAction::cut(this, SLOT(editCut()), actionCollection());
+ stateSync(action, m_widget->actionEditCut);
+ action = KStdAction::copy(this, SLOT(editCopy()), actionCollection());
+ stateSync(action, m_widget->actionEditCopy);
+ action = KStdAction::paste(this, SLOT(editPaste()), actionCollection());
+ stateSync(action, m_widget->actionEditPaste);
+ action = new KAction(i18n("&Delete"), Key_Delete, this, SLOT(editDelete()), actionCollection(), "edit_delete");
+ stateSync(action, m_widget->actionEditDelete);
+ action = KStdAction::selectAll(this, SLOT(editSelectAll()), actionCollection());
+ stateSync(action, m_widget->actionEditSelectAll);
+ action = new KAction(i18n("Chec&k Accelerators"), ALT + Key_R, this, SLOT(editAccels()), actionCollection(), "edit_accels");
+ stateSync(action, m_widget->actionEditAccels);
+ action = new KAction(i18n("S&lots..."), createPartIconSet("designer_editslots.png"), 0, this, SLOT(editFunctions()), actionCollection(), "edit_functions");
+ stateSync(action, m_widget->actionEditFunctions);
+ action = new KAction(i18n("Co&nnections..."), createPartIconSet("designer_connecttool.png"), 0, this, SLOT(editConnections()), actionCollection(), "edit_connections");
+ stateSync(action, m_widget->actionEditConnections);
+ action = new KAction(i18n("&Form Settings..."), 0, this, SLOT(editFormSettings()), actionCollection(), "edit_formsettings");
+ stateSync(action, m_widget->actionEditFormSettings);
+
+ action = new KAction(i18n("&Add File..."), 0, this, SLOT(projectAddFile()), actionCollection(), "project_addfile");
+ stateSync(action, m_widget->actionProjectAddFile);
+ action = new KAction(i18n("&Image Collection..."), 0, this, SLOT(projectImageCollection()), actionCollection(), "project_imagecollection");
+ stateSync(action, m_widget->actionEditPixmapCollection);
+ action = new KAction(i18n("&Database Connections..."), 0, this, SLOT(projectDatabaseCollections()), actionCollection(), "project_databasecollections");
+ stateSync(action, m_widget->actionEditDatabaseConnections);
+ action = new KAction(i18n("&Designer Project Settings..."), 0, this, SLOT(projectSettings()), actionCollection(), "project_settings");
+ stateSync(action, m_widget->actionEditProjectSettings);
+
+ KRadioAction *toggle;
+ toggle = new KRadioAction(i18n("&Pointer"), createPartIconSet("designer_pointer.png"), Key_F2, actionCollection(), "tools_pointer");
+ setupToolsAction(toggle, m_widget->actionPointerTool);
+ pointerAction = toggle;
+ toggle = new KRadioAction(i18n("&Connect Signal/Slots"), createPartIconSet("designer_connecttool.png"), Key_F3, actionCollection(), "tools_connect");
+ setupToolsAction(toggle, m_widget->actionConnectTool);
+ toggle = new KRadioAction(i18n("Tab &Order"), createPartIconSet("designer_ordertool.png"), Key_F4, actionCollection(), "tools_taborder");
+ setupToolsAction(toggle, m_widget->actionOrderTool);
+ toggle = new KRadioAction(i18n("Set &Buddy"), createPartIconSet("designer_setbuddy.png"), Key_F12, actionCollection(), "tools_setbuddy");
+ setupToolsAction(toggle, m_widget->actionBuddyTool);
+ new KAction(i18n("Configure Toolbox..."), 0, this, SLOT(toolsConfigureToolbox()), actionCollection(), "tools_toolbox");
+ new KAction(i18n("Edit &Custom Widgets..."), 0, this, SLOT(toolsEditCustomWidgets()), actionCollection(), "tools_editcustomwidgets");
+
+ action = new KAction(i18n("Adjust &Size"), createPartIconSet("designer_adjustsize.png"), CTRL + Key_J, this, SLOT(layoutAdjustSize()), actionCollection(), "layout_adjustsize");
+ stateSync(action, m_widget->actionEditAdjustSize);
+ action = new KAction(i18n("Lay Out &Horizontally"), createPartIconSet("designer_edithlayout.png"), CTRL + Key_H, this, SLOT(layoutHLayout()), actionCollection(), "layout_h");
+ stateSync(action, m_widget->actionEditHLayout);
+ action = new KAction(i18n("Lay Out &Vertically"), createPartIconSet("designer_editvlayout.png"), CTRL + Key_V, this, SLOT(layoutVLayout()), actionCollection(), "layout_v");
+ stateSync(action, m_widget->actionEditVLayout);
+ action = new KAction(i18n("Lay Out in &Grid"), createPartIconSet("designer_editgrid.png"), CTRL + Key_G, this, SLOT(layoutGridLayout()), actionCollection(), "layout_grid");
+ stateSync(action, m_widget->actionEditGridLayout);
+ action = new KAction(i18n("Lay Out Horizontally (in S&plitter)"), createPartIconSet("designer_editvlayoutsplit.png"), 0, this, SLOT(layoutSplitHLayout()), actionCollection(), "layout_splith");
+ stateSync(action, m_widget->actionEditSplitHorizontal);
+ action = new KAction(i18n("Lay Out Vertically (in Sp&litter)"), createPartIconSet("designer_edithlayoutsplit.png"), 0, this, SLOT(layoutSplitVLayout()), actionCollection(), "layout_splitv");
+ stateSync(action, m_widget->actionEditSplitVertical);
+ action = new KAction(i18n("&Break Layout"), createPartIconSet("designer_editbreaklayout.png"), CTRL + Key_B, this, SLOT(layoutBreak()), actionCollection(), "layout_break");
+ stateSync(action, m_widget->actionEditBreakLayout);
+ toggle = new KRadioAction(i18n("Add Spacer"), createPartIconSet("designer_spacer.png"), 0, actionCollection(), "layout_spacer");
+ setupToolsAction(toggle, m_widget->actionInsertSpacer);
+
+ action = new KAction(i18n("Preview &Form"), CTRL + Key_T, this, SLOT(windowPreview()), actionCollection(), "window_preview");
+ stateSync(action, m_widget->actionPreview);
+ action = new KAction(i18n("Ne&xt Form"), CTRL + Key_F6, this, SLOT(windowNext()), actionCollection(), "window_next");
+ stateSync(action, m_widget->actionWindowNext);
+ action = new KAction(i18n("Pre&vious Form"), CTRL + SHIFT + Key_F6, this, SLOT(windowPrev()), actionCollection(), "window_prev");
+ stateSync(action, m_widget->actionWindowPrevious);
+
+ action = KStdAction::preferences(this, SLOT(editPreferences()), actionCollection());
+ action->setText(i18n("Configure &KDevDesigner..."));
+ stateSync(action, m_widget->actionEditPreferences);
+}
+
+KDevDesignerPart::~KDevDesignerPart()
+{
+}
+
+void KDevDesignerPart::setReadWrite(bool rw)
+{
+ ReadWritePart::setReadWrite(rw);
+}
+
+void KDevDesignerPart::setModified(bool modified)
+{
+/* KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if (!save)
+ return;
+ if (modified)
+ save->setEnabled(true);
+ else
+ save->setEnabled(false);*/
+
+ ReadWritePart::setModified(modified);
+}
+
+bool KDevDesignerPart::openFile()
+{
+ m_widget->fileOpen("", "", m_file);
+ return true;
+}
+
+bool KDevDesignerPart::saveFile()
+{
+ if (isReadWrite() == false)
+ return false;
+ m_widget->actionFileSaveAll->activate();
+ return true;
+}
+
+void KDevDesignerPart::stateSync( KAction * kaction, QAction * qaction )
+{
+ if (!qaction)
+ return;
+ kaction->setEnabled(qaction->isEnabled());
+ DesignerAction *ac = dynamic_cast<DesignerAction*>(qaction);
+ if (!ac)
+ return;
+ connect(ac, SIGNAL(actionEnabled(bool )), kaction, SLOT(setEnabled(bool )));
+}
+
+void KDevDesignerPart::setupToolsAction( KRadioAction * toggle, QAction * action )
+{
+ if (!action)
+ return;
+
+ toggle->setGroup("tools");
+ toggle->setExclusiveGroup("tools");
+ connect(action, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
+ connect(toggle, SIGNAL(toggled(bool)), this, SLOT(setToggleActionOn(bool)));
+ toggle->setChecked(action->isOn());
+ m_actionMap[action] = toggle;
+ m_actionMap2[toggle] = action;
+}
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+KInstance* KDevDesignerPartFactory::s_instance = 0L;
+KAboutData* KDevDesignerPartFactory::s_about = 0L;
+
+KDevDesignerPartFactory::KDevDesignerPartFactory()
+ : KParts::Factory()
+{
+}
+
+KDevDesignerPartFactory::~KDevDesignerPartFactory()
+{
+ delete s_instance;
+ delete s_about;
+
+ s_instance = 0L;
+}
+
+KParts::Part* KDevDesignerPartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args )
+{
+ // Create an instance of our Part
+ KDevDesignerPart* obj = new KDevDesignerPart( parentWidget, widgetName, parent, name, args );
+
+ // See if we are to be read-write or not
+ if (QCString(classname) == "KParts::ReadOnlyPart")
+ obj->setReadWrite(false);
+
+ return obj;
+}
+
+KInstance* KDevDesignerPartFactory::instance()
+{
+ if( !s_instance )
+ {
+ s_about = new KAboutData("kdevdesignerpart", I18N_NOOP("KDevDesignerPart"), "0.1");
+ s_about->addAuthor("Alexander Dymo", 0, "cloudtemple@mksat.net");
+ s_about->addAuthor("Trolltech AS", 0, "info@trolltech.com");
+ s_instance = new KInstance(s_about);
+ }
+ return s_instance;
+}
+
+extern "C"
+{
+ void* init_libkdevdesignerpart()
+ {
+ return new KDevDesignerPartFactory;
+ }
+}
+
+//actions
+
+void KDevDesignerPart::fileNew( )
+{
+ if (!m_widget->actionNewFile)
+ {
+ qWarning("wrong m_widget->actionNewFile");
+ return;
+ }
+ m_widget->actionNewFile->activate();
+}
+
+void KDevDesignerPart::fileOpen()
+{
+ m_widget->fileOpen();
+}
+
+void KDevDesignerPart::fileSaveAs()
+{
+ m_widget->actionFileSaveAs->activate();
+}
+
+void KDevDesignerPart::fileClose( )
+{
+ m_widget->actionFileClose->activate();
+}
+
+void KDevDesignerPart::fileCreateTemplate( )
+{
+ m_widget->fileCreateTemplate();
+}
+
+void KDevDesignerPart::editUndo( )
+{
+ m_widget->actionEditUndo->activate();
+}
+
+void KDevDesignerPart::editRedo( )
+{
+ m_widget->actionEditRedo->activate();
+}
+
+void KDevDesignerPart::editCut( )
+{
+ m_widget->actionEditCut->activate();
+}
+
+void KDevDesignerPart::editPaste( )
+{
+ m_widget->actionEditPaste->activate();
+}
+
+void KDevDesignerPart::editCopy( )
+{
+ m_widget->actionEditCopy->activate();
+}
+
+void KDevDesignerPart::editDelete( )
+{
+ m_widget->actionEditDelete->activate();
+}
+
+void KDevDesignerPart::editSelectAll( )
+{
+ m_widget->actionEditSelectAll->activate();
+}
+
+void KDevDesignerPart::editAccels( )
+{
+ m_widget->actionEditAccels->activate();
+}
+
+void KDevDesignerPart::editFunctions( )
+{
+ m_widget->actionEditFunctions->activate();
+}
+
+void KDevDesignerPart::editConnections( )
+{
+ m_widget->actionEditConnections->activate();
+}
+
+void KDevDesignerPart::editFormSettings( )
+{
+ m_widget->actionEditFormSettings->activate();
+}
+
+void KDevDesignerPart::editPreferences( )
+{
+ m_widget->actionEditPreferences->activate();
+}
+
+void KDevDesignerPart::projectAddFile( )
+{
+ m_widget->actionProjectAddFile->activate();
+}
+
+void KDevDesignerPart::projectImageCollection( )
+{
+ m_widget->actionEditPixmapCollection->activate();
+}
+
+void KDevDesignerPart::projectDatabaseCollections( )
+{
+ m_widget->actionEditDatabaseConnections->activate();
+}
+
+void KDevDesignerPart::projectSettings( )
+{
+ m_widget->actionEditProjectSettings->activate();
+}
+
+void KDevDesignerPart::toolsConfigureToolbox( )
+{
+ m_widget->toolsConfigure();
+}
+
+void KDevDesignerPart::layoutAdjustSize( )
+{
+ m_widget->actionEditAdjustSize->activate();
+}
+
+void KDevDesignerPart::layoutHLayout( )
+{
+ m_widget->actionEditHLayout->activate();
+}
+
+void KDevDesignerPart::layoutVLayout( )
+{
+ m_widget->actionEditVLayout->activate();
+}
+
+void KDevDesignerPart::layoutGridLayout( )
+{
+ m_widget->actionEditGridLayout->activate();
+}
+
+void KDevDesignerPart::layoutSplitHLayout( )
+{
+ m_widget->actionEditSplitHorizontal->activate();
+}
+
+void KDevDesignerPart::layoutSplitVLayout( )
+{
+ m_widget->actionEditSplitVertical->activate();
+}
+
+void KDevDesignerPart::layoutBreak( )
+{
+ m_widget->actionEditBreakLayout->activate();
+}
+
+void KDevDesignerPart::windowPreview( )
+{
+ m_widget->actionPreview->activate();
+}
+
+void KDevDesignerPart::windowNext( )
+{
+ m_widget->actionWindowNext->activate();
+}
+
+void KDevDesignerPart::windowPrev( )
+{
+ m_widget->actionWindowPrevious->activate();
+}
+
+void KDevDesignerPart::statusMessage( const QString & msg )
+{
+ emit setStatusBarText(msg);
+}
+
+void KDevDesignerPart::setToggleActionChecked( bool b)
+{
+ if (!sender())
+ return;
+ const QAction *action = dynamic_cast<const QAction*>(sender());
+ if (!action)
+ return;
+ if (b)
+ {
+ if (action == m_widget->actionPointerTool)
+ pointerAction->setChecked(true);
+ return;
+ }
+ KRadioAction *kaction = m_actionMap[action];
+ if (!kaction)
+ return;
+// kdDebug() << "untoggle action: " << kaction->text() << endl;
+ kaction->blockSignals(true);
+ kaction->setChecked(b);
+ kaction->blockSignals(false);
+}
+
+void KDevDesignerPart::setToggleActionOn( bool b )
+{
+ if (!sender())
+ return;
+ const KRadioAction *action = dynamic_cast<const KRadioAction *>(sender());
+ if (!action)
+ return;
+// kdDebug() << (b?QString("toggle"):QString("untoggle")) << " action: " << action->text() << endl;
+ QAction *qaction = m_actionMap2[action];
+ if (!qaction)
+ return;
+ disconnect(qaction, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
+ qaction->setOn(b);
+ connect(qaction, SIGNAL(toggled(bool )), this, SLOT(setToggleActionChecked(bool )));
+}
+
+void KDevDesignerPart::openProject( const QString & // projectFile
+ )
+{
+ //TODO: implement
+ return;
+}
+
+KInterfaceDesigner::DesignerType KDevDesignerPart::designerType( )
+{
+ return KInterfaceDesigner::QtDesigner;
+}
+
+void KDevDesignerPart::emitAddedFunction( const QString & form, KInterfaceDesigner::Function func )
+{
+ kdDebug() << "KDevDesignerPart::emitAddedFunction: form " << form << ", function: " << func.function << endl;
+ emit addedFunction(designerType(), form, func);
+}
+
+void KDevDesignerPart::emitRemovedFunction( const QString & form, KInterfaceDesigner::Function func )
+{
+ kdDebug() << "KDevDesignerPart::emitRemovedFunction: form " << form << ", function: " << func.function << endl;
+ emit removedFunction(designerType(), form, func);
+}
+
+void KDevDesignerPart::emitEditedFunction( const QString & form, KInterfaceDesigner::Function oldFunc, KInterfaceDesigner::Function func )
+{
+ kdDebug() << "KDevDesignerPart::emitEditedFunction: form " << form
+ << ", old function: " << oldFunc.function
+ << ", function: " << func.function << endl;
+
+// m_widget->formWindow()->clearSelection(false);
+ emit editedFunction(designerType(), form, oldFunc, func);
+}
+
+void KDevDesignerPart::emitEditFunction(const QString &formName, const QString &functionName)
+{
+ kdDebug() << "KDevDesignerPart::emitEditedFunction: form " << formName
+ << ", function: " << functionName << endl;
+ emit editFunction(designerType(), formName, functionName);
+}
+
+void KDevDesignerPart::formModified(bool b)
+{
+ kdDebug() << "KDevDesignerPart::formModified " << b << endl;
+ setModified(b);
+}
+
+void KDevDesignerPart::emitEditSource(const QString &formName)
+{
+ emit editSource(designerType(), formName);
+}
+
+void KDevDesignerPart::emitNewStatus(const QString &formName, int status)
+{
+ emit newStatus(formName, status);
+}
+
+void KDevDesignerPart::toolsEditCustomWidgets( )
+{
+ m_widget->toolsCustomWidget();
+}
+
+#include "kdevdesigner_part.moc"
diff --git a/kdevdesigner/designer/kdevdesigner_part.desktop b/kdevdesigner/designer/kdevdesigner_part.desktop
new file mode 100644
index 00000000..2451bd55
--- /dev/null
+++ b/kdevdesigner/designer/kdevdesigner_part.desktop
@@ -0,0 +1,16 @@
+[Desktop Entry]
+Name=KDevDesignerPart
+Name[da]=KDevelop Designer-part
+Name[el]=ΤμήμαKDevDesigner
+Name[nds]=Kdevelop-Makerkomponent
+Name[ne]=केडीई विकास डिजाइनर भाग
+Name[sv]=KDevelop designerdel
+Name[ta]=கேமேம்பாட்டு வடிவமைப்பாளர் பகுதி
+Name[tg]=KDevҚисми дизайнгар
+Name[zh_TW]=KDevelop 設計元件
+MimeType=application/x-designer
+ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=libkdevdesignerpart
+Type=Service
+InitialPreference=10
+
diff --git a/kdevdesigner/designer/kdevdesigner_part.h b/kdevdesigner/designer/kdevdesigner_part.h
new file mode 100644
index 00000000..70712210
--- /dev/null
+++ b/kdevdesigner/designer/kdevdesigner_part.h
@@ -0,0 +1,146 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _KDEVDESIGNERPART_H_
+#define _KDEVDESIGNERPART_H_
+
+#include <qmap.h>
+
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+#include "designer.h"
+
+class QWidget;
+class QPainter;
+class KURL;
+class MainWindow;
+class KAction;
+class QAction;
+class KRadioAction;
+
+class KDevDesignerPart : public KInterfaceDesigner::Designer
+{
+ Q_OBJECT
+public:
+ KDevDesignerPart(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList &args);
+ virtual ~KDevDesignerPart();
+
+ virtual void setReadWrite(bool rw);
+ virtual void setModified(bool modified);
+
+ void statusMessage(const QString &msg);
+
+ //KInterfaceDesigner::Designer methods
+ virtual void openProject(const QString &projectFile);
+ virtual KInterfaceDesigner::DesignerType designerType();
+
+ void emitAddedFunction(const QString &form, KInterfaceDesigner::Function func);
+ void emitEditedFunction(const QString &form, KInterfaceDesigner::Function oldFunc, KInterfaceDesigner::Function func);
+ void emitRemovedFunction(const QString &form, KInterfaceDesigner::Function func);
+
+ void emitEditFunction(const QString &formName, const QString &functionName);
+ void emitEditSource(const QString &formName);
+
+ void emitNewStatus(const QString &formName, int status);
+
+protected:
+ virtual bool openFile();
+ virtual bool saveFile();
+
+ void setupDesignerWindow();
+ void setupActions();
+
+ void stateSync(KAction *kaction, QAction *qaction);
+ void setupToolsAction(KRadioAction *toggle, QAction *action);
+
+protected slots:
+ void setToggleActionChecked(bool b);
+ void setToggleActionOn(bool b);
+
+ void fileNew();
+ void fileOpen();
+ void fileClose();
+ void fileSaveAs();
+ void fileCreateTemplate();
+
+ void editUndo();
+ void editRedo();
+ void editCut();
+ void editCopy();
+ void editPaste();
+ void editDelete();
+ void editSelectAll();
+ void editAccels();
+ void editFunctions();
+ void editConnections();
+ void editFormSettings();
+ void editPreferences();
+
+ void projectAddFile();
+ void projectImageCollection();
+ void projectDatabaseCollections();
+ void projectSettings();
+
+ void toolsConfigureToolbox();
+ void toolsEditCustomWidgets();
+
+ void layoutAdjustSize();
+ void layoutHLayout();
+ void layoutVLayout();
+ void layoutGridLayout();
+ void layoutSplitHLayout();
+ void layoutSplitVLayout();
+ void layoutBreak();
+
+ void windowPreview();
+ void windowNext();
+ void windowPrev();
+
+ void formModified(bool b);
+private:
+ MainWindow *m_widget;
+
+ QMap<const QAction*, KRadioAction*> m_actionMap;
+ QMap<const KRadioAction*, QAction*> m_actionMap2;
+ KRadioAction* pointerAction;
+};
+
+class KInstance;
+class KAboutData;
+
+class KDevDesignerPartFactory : public KParts::Factory
+{
+ Q_OBJECT
+public:
+ KDevDesignerPartFactory();
+ virtual ~KDevDesignerPartFactory();
+ virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args );
+ static KInstance* instance();
+
+private:
+ static KInstance* s_instance;
+ static KAboutData* s_about;
+};
+
+#endif // _KDEVDESIGNERPART_H_
diff --git a/kdevdesigner/designer/kdevdesigner_part.rc b/kdevdesigner/designer/kdevdesigner_part.rc
new file mode 100644
index 00000000..71adcdc9
--- /dev/null
+++ b/kdevdesigner/designer/kdevdesigner_part.rc
@@ -0,0 +1,121 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kdevdesigner_part" version="6">
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <Action name="file_createtemplate" group="new_merge"/>
+ <Action name="file_save" group="save_merge"/>
+ <Action name="file_save_as" group="save_merge"/>
+ </Menu>
+
+ <Menu name="edit" noMerge="1"><text>&amp;Edit</text>
+ <Action name="edit_undo" group="edit_undo_merge"/>
+ <Action name="edit_redo" group="edit_undo_merge"/>
+ <Separator group="edit_undo_merge"/>
+ <Action name="edit_cut" group="edit_paste_merge"/>
+ <Action name="edit_copy" group="edit_paste_merge"/>
+ <Action name="edit_paste" group="edit_paste_merge"/>
+ <Separator group="edit_paste_merge"/>
+ <Action name="edit_delete" group="edit_select_merge"/>
+ <Action name="edit_select_all" group="edit_select_merge"/>
+ <Separator group="edit_select_merge"/>
+ <Action name="edit_accels" group="edit_select_merge"/>
+ <Separator group="edit_select_merge"/>
+ <Action name="edit_functions" group="edit_select_merge"/>
+ <Action name="edit_connections" group="edit_select_merge"/>
+ <Action name="edit_formsettings" group="edit_select_merge"/>
+ <Separator group="edit_select_merge"/>
+ </Menu>
+
+ <Menu name="project" noMerge="1"><text>&amp;Project</text>
+ <Action name="project_imagecollection" group="designer_project"/>
+ <Action name="project_databasecollections" group="designer_project"/>
+ <Separator group="designer_project"/>
+ <Action name="project_settings" group="designer_project"/>
+ <Separator group="designer_project"/>
+ </Menu>
+
+ <Menu name="tools" noMerge="1"><text>&amp;Tools</text>
+ <Action name="tools_pointer" group="tools_operations"/>
+ <Action name="tools_connect" group="tools_operations"/>
+ <Action name="tools_taborder" group="tools_operations"/>
+ <Action name="tools_setbuddy" group="tools_operations"/>
+ <Action name="tools_toolbox" group="tools_operations"/>
+ <Action name="tools_editcustomwidgets" group="tools_operations"/>
+ <Separator group="tools_operations"/>
+ </Menu>
+
+ <Menu name="layout" noMerge="1"><text>&amp;Layout</text>
+ <Action name="layout_adjustsize"/>
+ <Separator/>
+ <Action name="layout_h"/>
+ <Action name="layout_v"/>
+ <Action name="layout_grid"/>
+ <Action name="layout_splith"/>
+ <Action name="layout_splitv"/>
+ <Action name="layout_break"/>
+ <Separator/>
+ <Action name="layout_spacer"/>
+ </Menu>
+
+ <Menu name="settings" noMerge="1"><text>&amp;Settings</text>
+ <Action name="options_configure" group="configure_merge"/>
+ </Menu>
+
+ <Menu name="window" noMerge="1"><text>&amp;Window</text>
+ <Action name="window_preview" group="window_operations"/>
+ <Separator group="window_operations"/>
+ <Action name="window_next" group="window_operations"/>
+ <Action name="window_prev" group="window_operations"/>
+ </Menu>
+
+</MenuBar>
+
+<!--<ToolBar name="fileToolBar" noMerge="1"><text>File Toolbar</text>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_save"/>
+</ToolBar>
+
+<ToolBar name="editToolBar" noMerge="1"><text>Edit Toolbar</text>
+ <Action name="edit_undo"/>
+ <Action name="edit_redo"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+</ToolBar> -->
+
+<ToolBar name="mainToolBar" noMerge="1"><text>Main Toolbar</text>
+ <Action name="file_open" group="file_operations"/>
+ <Action name="file_save" group="file_operations"/>
+ <Separator group="file_operations"/>
+ <Action name="edit_undo" group="edit_operations"/>
+ <Action name="edit_redo" group="edit_operations"/>
+ <Separator group="edit_operations"/>
+ <Action name="edit_cut" group="edit_operations"/>
+ <Action name="edit_copy" group="edit_operations"/>
+ <Action name="edit_paste" group="edit_operations"/>
+</ToolBar>
+
+
+<ToolBar name="layoutToolBar" noMerge="1"><text>Layout Toolbar</text>
+ <Action name="layout_adjustsize"/>
+ <Separator/>
+ <Action name="layout_h"/>
+ <Action name="layout_v"/>
+ <Action name="layout_grid"/>
+ <Action name="layout_splith"/>
+ <Action name="layout_splitv"/>
+ <Action name="layout_break"/>
+ <Separator/>
+ <Action name="layout_spacer"/>
+</ToolBar>
+
+<ToolBar name="toolsToolBar" noMerge="1"><text>Tools Toolbar</text>
+ <Action name="tools_pointer"/>
+ <Action name="tools_connect"/>
+ <Action name="tools_taborder"/>
+ <Action name="tools_setbuddy"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/kdevdesigner/designer/kdevdesigner_part_sh.rc b/kdevdesigner/designer/kdevdesigner_part_sh.rc
new file mode 100644
index 00000000..eb6b503b
--- /dev/null
+++ b/kdevdesigner/designer/kdevdesigner_part_sh.rc
@@ -0,0 +1,116 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kdevdesigner_part" version="4">
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <Action name="file_new" group="new_merge"/>
+ <Action name="file_open" group="open_merge"/>
+ <Separator/>
+ <Action name="file_close" group="close_merge"/>
+ <Separator/>
+ <Action name="file_save" group="save_merge"/>
+ <Action name="file_save_as" group="save_merge"/>
+ <Action name="file_saveall" group="save_merge"/>
+ <Separator/>
+ <Action name="file_createtemplate"/>
+ <Separator/>
+ </Menu>
+
+ <Menu name="edit" noMerge="1"><text>&amp;Edit</text>
+ <Action name="edit_undo" group="edit_undo_merge"/>
+ <Action name="edit_redo" group="edit_undo_merge"/>
+ <Separator group="edit_undo_merge"/>
+ <Action name="edit_cut" group="edit_paste_merge"/>
+ <Action name="edit_copy" group="edit_paste_merge"/>
+ <Action name="edit_paste" group="edit_paste_merge"/>
+ <Separator group="edit_paste_merge"/>
+ <Action name="edit_delete" group="edit_select_merge"/>
+ <Action name="edit_select_all" group="edit_select_merge"/>
+ <Separator group="edit_select_merge"/>
+ <Action name="edit_accels"/>
+ <Separator/>
+ <Action name="edit_functions"/>
+ <Action name="edit_connections"/>
+ <Action name="edit_formsettings"/>
+ </Menu>
+
+ <Menu name="project" noMerge="1"><text>&amp;Project</text>
+ <Action name="project_addfile"/>
+ <Action name="project_imagecollection"/>
+ <Action name="project_databasecollections"/>
+ <Separator/>
+ <Action name="project_settings"/>
+ </Menu>
+
+ <Menu name="tools" noMerge="1"><text>&amp;Tools</text>
+ <Action name="tools_pointer" group="tools_operations"/>
+ <Action name="tools_connect" group="tools_operations"/>
+ <Action name="tools_taborder" group="tools_operations"/>
+ <Action name="tools_setbuddy" group="tools_operations"/>
+ <Action name="tools_toolbox" group="tools_operations"/>
+ <Action name="tools_editcustomwidgets" group="tools_operations"/>
+<!-- <Separator/>
+ <Action name="tools_toolbox"/>-->
+ </Menu>
+
+ <Menu name="layout" noMerge="1"><text>&amp;Layout</text>
+ <Action name="layout_adjustsize"/>
+ <Separator/>
+ <Action name="layout_h"/>
+ <Action name="layout_v"/>
+ <Action name="layout_grid"/>
+ <Action name="layout_splith"/>
+ <Action name="layout_splitv"/>
+ <Action name="layout_break"/>
+ <Separator/>
+ <Action name="layout_spacer"/>
+ </Menu>
+
+ <Menu name="settings" noMerge="1"><text>&amp;Settings</text>
+ <Action name="options_configure"/>
+ </Menu>
+
+ <Menu name="window" noMerge="1"><text>&amp;Window</text>
+ <Action name="window_preview" group="window_operations"/>
+ <Separator/>
+ <Action name="window_next" group="window_operations"/>
+ <Action name="window_prev" group="window_operations"/>
+ </Menu>
+
+</MenuBar>
+
+<ToolBar name="fileToolBar" noMerge="1"><text>File Toolbar</text>
+ <Action name="file_new"/>
+ <Action name="file_open"/>
+ <Action name="file_save"/>
+</ToolBar>
+
+<ToolBar name="editToolBar" noMerge="1"><text>Edit Toolbar</text>
+ <Action name="edit_undo"/>
+ <Action name="edit_redo"/>
+ <Separator/>
+ <Action name="edit_cut"/>
+ <Action name="edit_copy"/>
+ <Action name="edit_paste"/>
+</ToolBar>
+
+<ToolBar name="layoutToolBar" noMerge="1"><text>Layout Toolbar</text>
+ <Action name="layout_adjustsize"/>
+ <Separator/>
+ <Action name="layout_h"/>
+ <Action name="layout_v"/>
+ <Action name="layout_grid"/>
+ <Action name="layout_splith"/>
+ <Action name="layout_splitv"/>
+ <Action name="layout_break"/>
+ <Separator/>
+ <Action name="layout_spacer"/>
+</ToolBar>
+
+<ToolBar name="toolsToolBar" noMerge="1"><text>Tools Toolbar</text>
+ <Action name="tools_pointer"/>
+ <Action name="tools_connect"/>
+ <Action name="tools_taborder"/>
+ <Action name="tools_setbuddy"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/kdevdesigner/designer/layout.cpp b/kdevdesigner/designer/layout.cpp
new file mode 100644
index 00000000..2926b4f6
--- /dev/null
+++ b/kdevdesigner/designer/layout.cpp
@@ -0,0 +1,1017 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "layout.h"
+#include <widgetdatabase.h>
+#include "widgetfactory.h"
+
+#include <qlayout.h>
+#include <qevent.h>
+#include <qpainter.h>
+#include <qpen.h>
+#include <qbitmap.h>
+#include <qsplitter.h>
+#include <qvaluevector.h>
+#include <qmainwindow.h>
+
+bool operator<( const QGuardedPtr<QWidget> &p1, const QGuardedPtr<QWidget> &p2 )
+{
+ return p1.operator->() < p2.operator->();
+}
+
+/*!
+ \class Layout layout.h
+ \brief Baseclass for layouting widgets in the Designer
+
+ Classes derived from this abstract base class are used for layouting
+ operations in the Designer.
+
+*/
+
+/*! \a p specifies the parent of the layoutBase \a lb. The parent
+ might be changed in setup(). If the layoutBase is a
+ container, the parent and the layoutBase are the same. Also they
+ always have to be a widget known to the designer (e.g. in the case
+ of the tabwidget parent and layoutBase are the tabwidget and not the
+ page which actually gets laid out. For actual usage the correct
+ widget is found later by Layout.)
+ */
+
+Layout::Layout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter )
+ : widgets( wl ), parent( p ), formWindow( fw ), isBreak( !doSetup ), useSplitter( splitter )
+{
+ widgets.setAutoDelete( FALSE );
+ layoutBase = lb;
+ if ( !doSetup && layoutBase )
+ oldGeometry = layoutBase->geometry();
+}
+
+/*! The widget list we got in the constructor might contain too much
+ widgets (like widgets with different parents, already laid out
+ widgets, etc.). Here we set up the list and so the only the "best"
+ widgets get laid out.
+*/
+
+void Layout::setup()
+{
+ startPoint = QPoint( 32767, 32767 );
+ QValueList<QWidgetList> lists;
+ QWidget *lastParent = 0;
+ QWidgetList *lastList = 0;
+ QWidget *w = 0;
+
+ // Go through all widgets of the list we got. As we can only
+ // layout widgets which have the same parent, we first do some
+ // sorting which means create a list for each parent containing
+ // its child here. After that we keep working on the list of
+ // childs which has the most entries.
+ // Widgets which are already laid out are thrown away here too
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ continue;
+ if ( lastParent != w->parentWidget() ) {
+ lastList = 0;
+ lastParent = w->parentWidget();
+ QValueList<QWidgetList>::Iterator it = lists.begin();
+ for ( ; it != lists.end(); ++it ) {
+ if ( ( *it ).first()->parentWidget() == w->parentWidget() )
+ lastList = &( *it );
+ }
+ if ( !lastList ) {
+ QWidgetList l;
+ l.setAutoDelete( FALSE );
+ lists.append( l );
+ lastList = &lists.last();
+ }
+ }
+ lastList->append( w );
+ }
+
+ // So, now find the list with the most entries
+ lastList = 0;
+ QValueList<QWidgetList>::Iterator it = lists.begin();
+ for ( ; it != lists.end(); ++it ) {
+ if ( !lastList || ( *it ).count() > lastList->count() )
+ lastList = &( *it );
+ }
+
+ // If we found no list (because no widget did fit at all) or the
+ // best list has only one entry and we do not layout a container,
+ // we leave here.
+ if ( !lastList || ( lastList->count() < 2 &&
+ ( !layoutBase ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
+ layoutBase != formWindow->mainContainer() ) )
+ ) ) {
+ widgets.clear();
+ startPoint = QPoint( 0, 0 );
+ return;
+ }
+
+ // Now we have a new and clean widget list, which makes sense
+ // to layout
+ widgets = *lastList;
+ // Also use the only correct parent later, so store it
+ parent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() );
+ // Now calculate the position where the layout-meta-widget should
+ // be placed and connect to widgetDestroyed() signals of the
+ // widgets to get informed if one gets deleted to be able to
+ // handle that and do not crash in this case
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ connect( w, SIGNAL( destroyed() ),
+ this, SLOT( widgetDestroyed() ) );
+ startPoint = QPoint( QMIN( startPoint.x(), w->x() ),
+ QMIN( startPoint.y(), w->y() ) );
+ geometries.insert( w, QRect( w->pos(), w->size() ) );
+ // Change the Z-order, as saving/loading uses the Z-order for
+ // writing/creating widgets and this has to be the same as in
+ // the layout. Else saving + loading will give different results
+ w->raise();
+ }
+}
+
+void Layout::widgetDestroyed()
+{
+ if ( sender() && sender()->isWidgetType() )
+ widgets.removeRef( (QWidget*)sender() );
+}
+
+bool Layout::prepareLayout( bool &needMove, bool &needReparent )
+{
+ if ( !widgets.count() )
+ return FALSE;
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() )
+ w->raise();
+ needMove = !layoutBase;
+ needReparent = needMove || ::qt_cast<QLayoutWidget*>(layoutBase) || ::qt_cast<QSplitter*>(layoutBase);
+ if ( !layoutBase ) {
+ if ( !useSplitter )
+ layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLayoutWidget" ),
+ WidgetFactory::containerOfWidget( parent ) );
+ else
+ layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QSplitter" ),
+ WidgetFactory::containerOfWidget( parent ) );
+ } else {
+ WidgetFactory::deleteLayout( layoutBase );
+ }
+
+ return TRUE;
+}
+
+void Layout::finishLayout( bool needMove, QLayout *layout )
+{
+ if ( needMove )
+ layoutBase->move( startPoint );
+ QRect g( QRect( layoutBase->pos(), layoutBase->size() ) );
+ if ( WidgetFactory::layoutType( layoutBase->parentWidget() ) == WidgetFactory::NoLayout && !isBreak )
+ layoutBase->adjustSize();
+ else if ( isBreak )
+ layoutBase->setGeometry( oldGeometry );
+ oldGeometry = g;
+ layoutBase->show();
+ layout->activate();
+ formWindow->insertWidget( layoutBase );
+ formWindow->selectWidget( layoutBase );
+ QString n = layoutBase->name();
+ if ( n.find( "qt_dead_widget_" ) != -1 ) {
+ n.remove( 0, QString( "qt_dead_widget_" ).length() );
+ layoutBase->setName( n );
+ }
+}
+
+void Layout::undoLayout()
+{
+ if ( !widgets.count() )
+ return;
+ QMap<QGuardedPtr<QWidget>, QRect>::Iterator it = geometries.begin();
+ for ( ; it != geometries.end(); ++it ) {
+ if ( !it.key() )
+ continue;
+ it.key()->reparent( WidgetFactory::containerOfWidget( parent ), 0, ( *it ).topLeft(), it.key()->isVisibleTo( formWindow ) );
+ it.key()->resize( ( *it ).size() );
+ }
+ formWindow->selectWidget( layoutBase, FALSE );
+ WidgetFactory::deleteLayout( layoutBase );
+ if ( parent != layoutBase && !::qt_cast<QMainWindow*>(layoutBase) ) {
+ layoutBase->hide();
+ QString n = layoutBase->name();
+ n.prepend( "qt_dead_widget_" );
+ layoutBase->setName( n );
+ } else {
+ layoutBase->setGeometry( oldGeometry );
+ }
+ if ( widgets.first() )
+ formWindow->selectWidget( widgets.first() );
+ else
+ formWindow->selectWidget( formWindow );
+}
+
+void Layout::breakLayout()
+{
+ QMap<QWidget*, QRect> rects;
+ if ( !widgets.isEmpty() ) {
+ QWidget *w;
+ for ( w = widgets.first(); w; w = widgets.next() )
+ rects.insert( w, w->geometry() );
+ }
+ WidgetFactory::deleteLayout( layoutBase );
+ bool needReparent = qstrcmp( layoutBase->className(), "QLayoutWidget" ) == 0 ||
+ qstrcmp( layoutBase->className(), "QSplitter" ) == 0 ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
+ layoutBase != formWindow->mainContainer() );
+ bool needResize = qstrcmp( layoutBase->className(), "QSplitter" ) == 0;
+ bool add = geometries.isEmpty();
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needReparent )
+ w->reparent( layoutBase->parentWidget(), 0,
+ layoutBase->pos() + w->pos(), TRUE );
+ if ( needResize ) {
+ QMap<QWidget*, QRect>::Iterator it = rects.find( w );
+ if ( it != rects.end() )
+ w->setGeometry( QRect( layoutBase->pos() + (*it).topLeft(), (*it).size() ) );
+ }
+ if ( add )
+ geometries.insert( w, QRect( w->pos(), w->size() ) );
+ }
+ if ( needReparent ) {
+ layoutBase->hide();
+ parent = layoutBase->parentWidget();
+ QString n = layoutBase->name();
+ n.prepend( "qt_dead_widget_" );
+ layoutBase->setName( n );
+ } else {
+ parent = layoutBase;
+ }
+ if ( widgets.first() && widgets.first()->isVisibleTo( formWindow ) )
+ formWindow->selectWidget( widgets.first() );
+ else
+ formWindow->selectWidget( formWindow );
+}
+
+class HorizontalLayoutList : public QWidgetList
+{
+public:
+ HorizontalLayoutList( const QWidgetList &l )
+ : QWidgetList( l ) {}
+
+ int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) {
+ QWidget *w1 = (QWidget*)item1;
+ QWidget *w2 = (QWidget*)item2;
+ if ( w1->x() == w2->x() )
+ return 0;
+ if ( w1->x() > w2->x() )
+ return 1;
+ return -1;
+ }
+
+};
+
+HorizontalLayout::HorizontalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter )
+ : Layout( wl, p, fw, lb, doSetup, splitter )
+{
+ if ( doSetup )
+ setup();
+}
+
+void HorizontalLayout::setup()
+{
+ HorizontalLayoutList l( widgets );
+ l.sort();
+ widgets = l;
+ Layout::setup();
+}
+
+void HorizontalLayout::doLayout()
+{
+ bool needMove, needReparent;
+ if ( !prepareLayout( needMove, needReparent ) )
+ return;
+
+ QHBoxLayout *layout = (QHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox );
+
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needReparent && w->parent() != layoutBase )
+ w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE );
+ if ( !useSplitter ) {
+ if ( qstrcmp( w->className(), "Spacer" ) == 0 )
+ layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
+ else
+ layout->addWidget( w );
+ if ( ::qt_cast<QLayoutWidget*>(w) )
+ ( (QLayoutWidget*)w )->updateSizePolicy();
+ }
+ w->show();
+ }
+
+ if ( ::qt_cast<QSplitter*>(layoutBase) )
+ ( (QSplitter*)layoutBase )->setOrientation( Qt::Horizontal );
+
+ finishLayout( needMove, layout );
+}
+
+
+
+
+class VerticalLayoutList : public QWidgetList
+{
+public:
+ VerticalLayoutList( const QWidgetList &l )
+ : QWidgetList( l ) {}
+
+ int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) {
+ QWidget *w1 = (QWidget*)item1;
+ QWidget *w2 = (QWidget*)item2;
+ if ( w1->y() == w2->y() )
+ return 0;
+ if ( w1->y() > w2->y() )
+ return 1;
+ return -1;
+ }
+
+};
+
+VerticalLayout::VerticalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter )
+ : Layout( wl, p, fw, lb, doSetup, splitter )
+{
+ if ( doSetup )
+ setup();
+}
+
+void VerticalLayout::setup()
+{
+ VerticalLayoutList l( widgets );
+ l.sort();
+ widgets = l;
+ Layout::setup();
+}
+
+void VerticalLayout::doLayout()
+{
+ bool needMove, needReparent;
+ if ( !prepareLayout( needMove, needReparent ) )
+ return;
+
+ QVBoxLayout *layout = (QVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox );
+
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( needReparent && w->parent() != layoutBase )
+ w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE );
+ if ( !useSplitter ) {
+ if ( qstrcmp( w->className(), "Spacer" ) == 0 )
+ layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
+ else
+ layout->addWidget( w );
+ if ( ::qt_cast<QLayoutWidget*>(w) )
+ ( (QLayoutWidget*)w )->updateSizePolicy();
+ }
+ w->show();
+ }
+
+ if ( ::qt_cast<QSplitter*>(layoutBase) )
+ ( (QSplitter*)layoutBase )->setOrientation( Qt::Vertical );
+
+ finishLayout( needMove, layout );
+}
+
+
+
+
+
+class Grid
+{
+public:
+ Grid( int rows, int cols );
+ ~Grid();
+
+ QWidget* cell( int row, int col ) const { return cells[ row * ncols + col]; }
+ void setCell( int row, int col, QWidget* w ) { cells[ row*ncols + col] = w; }
+ void setCells( QRect c, QWidget* w ) {
+ for ( int rows = c.bottom()-c.top(); rows >= 0; rows--)
+ for ( int cols = c.right()-c.left(); cols >= 0; cols--) {
+ setCell(c.top()+rows, c.left()+cols, w);
+ }
+ }
+ int numRows() const { return nrows; }
+ int numCols() const { return ncols; }
+
+ void simplify();
+ bool locateWidget( QWidget* w, int& row, int& col, int& rowspan, int& colspan );
+
+private:
+ void merge();
+ int countRow( int r, int c ) const;
+ int countCol( int r, int c ) const;
+ void setRow( int r, int c, QWidget* w, int count );
+ void setCol( int r, int c, QWidget* w, int count );
+ bool isWidgetStartCol( int c ) const;
+ bool isWidgetEndCol( int c ) const;
+ bool isWidgetStartRow( int r ) const;
+ bool isWidgetEndRow( int r ) const;
+ bool isWidgetTopLeft( int r, int c ) const;
+ void extendLeft();
+ void extendRight();
+ void extendUp();
+ void extendDown();
+ QWidget** cells;
+ bool* cols;
+ bool* rows;
+ int nrows, ncols;
+
+};
+
+Grid::Grid( int r, int c )
+ : nrows( r ), ncols( c )
+{
+ cells = new QWidget*[ r * c ];
+ memset( cells, 0, sizeof( cells ) * r * c );
+ rows = new bool[ r ];
+ cols = new bool[ c ];
+
+}
+
+Grid::~Grid()
+{
+ delete [] cells;
+ delete [] cols;
+ delete [] rows;
+}
+
+int Grid::countRow( int r, int c ) const
+{
+ QWidget* w = cell( r, c );
+ int i = c + 1;
+ while ( i < ncols && cell( r, i ) == w )
+ i++;
+ return i - c;
+}
+
+int Grid::countCol( int r, int c ) const
+{
+ QWidget* w = cell( r, c );
+ int i = r + 1;
+ while ( i < nrows && cell( i, c ) == w )
+ i++;
+ return i - r;
+}
+
+void Grid::setCol( int r, int c, QWidget* w, int count )
+{
+ for (int i = 0; i < count; i++ )
+ setCell( r + i, c, w );
+}
+
+void Grid::setRow( int r, int c, QWidget* w, int count )
+{
+ for (int i = 0; i < count; i++ )
+ setCell( r, c + i, w );
+}
+
+bool Grid::isWidgetStartCol( int c ) const
+{
+ int r;
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) && ( (c==0) || (cell( r, c) != cell( r, c-1) )) ) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetEndCol( int c ) const
+{
+ int r;
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) && ((c == ncols-1) || (cell( r, c) != cell( r, c+1) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetStartRow( int r ) const
+{
+ int c;
+ for ( c = 0; c < ncols; c++ ) {
+ if ( cell( r, c ) && ( (r==0) || (cell( r, c) != cell( r-1, c) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Grid::isWidgetEndRow( int r ) const
+{
+ int c;
+ for ( c = 0; c < ncols; c++ ) {
+ if ( cell( r, c ) && ((r == nrows-1) || (cell( r, c) != cell( r+1, c) )) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+bool Grid::isWidgetTopLeft( int r, int c ) const
+{
+ QWidget* w = cell( r, c );
+ if ( !w )
+ return FALSE;
+ return ( !r || cell( r-1, c) != w ) && (!c || cell( r, c-1) != w);
+}
+
+void Grid::extendLeft()
+{
+ int r,c,i;
+ for ( c = 1; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ QWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cc = countCol( r, c);
+ int stretch = 0;
+ for ( i = c-1; i >= 0; i-- ) {
+ if ( cell( r, i ) )
+ break;
+ if ( countCol( r, i ) < cc )
+ break;
+ if ( isWidgetEndCol( i ) )
+ break;
+ if ( isWidgetStartCol( i ) ) {
+ stretch = c - i;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setCol( r, c-i-1, w, cc );
+ }
+ }
+ }
+}
+
+
+void Grid::extendRight()
+{
+ int r,c,i;
+ for ( c = ncols - 2; c >= 0; c-- ) {
+ for ( r = 0; r < nrows; r++ ) {
+ QWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cc = countCol( r, c);
+ int stretch = 0;
+ for ( i = c+1; i < ncols; i++ ) {
+ if ( cell( r, i ) )
+ break;
+ if ( countCol( r, i ) < cc )
+ break;
+ if ( isWidgetStartCol( i ) )
+ break;
+ if ( isWidgetEndCol( i ) ) {
+ stretch = i - c;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setCol( r, c+i+1, w, cc );
+ }
+ }
+ }
+
+}
+
+void Grid::extendUp()
+{
+ int r,c,i;
+ for ( r = 1; r < nrows; r++ ) {
+ for ( c = 0; c < ncols; c++ ) {
+ QWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cr = countRow( r, c);
+ int stretch = 0;
+ for ( i = r-1; i >= 0; i-- ) {
+ if ( cell( i, c ) )
+ break;
+ if ( countRow( i, c ) < cr )
+ break;
+ if ( isWidgetEndRow( i ) )
+ break;
+ if ( isWidgetStartRow( i ) ) {
+ stretch = r - i;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setRow( r-i-1, c, w, cr );
+ }
+ }
+ }
+}
+
+void Grid::extendDown()
+{
+ int r,c,i;
+ for ( r = nrows - 2; r >= 0; r-- ) {
+ for ( c = 0; c < ncols; c++ ) {
+ QWidget* w = cell( r, c );
+ if ( !w )
+ continue;
+ int cr = countRow( r, c);
+ int stretch = 0;
+ for ( i = r+1; i < nrows; i++ ) {
+ if ( cell( i, c ) )
+ break;
+ if ( countRow( i, c ) < cr )
+ break;
+ if ( isWidgetStartRow( i ) )
+ break;
+ if ( isWidgetEndRow( i ) ) {
+ stretch = i - r;
+ break;
+ }
+ }
+ if ( stretch ) {
+ for ( i = 0; i < stretch; i++ )
+ setRow( r+i+1, c, w, cr );
+ }
+ }
+ }
+
+}
+
+void Grid::simplify()
+{
+ extendLeft();
+ extendRight();
+ extendUp();
+ extendDown();
+ merge();
+}
+
+
+void Grid::merge()
+{
+ int r,c;
+ for ( c = 0; c < ncols; c++ )
+ cols[c] = FALSE;
+
+ for ( r = 0; r < nrows; r++ )
+ rows[r] = FALSE;
+
+ for ( c = 0; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ if ( isWidgetTopLeft( r, c ) ) {
+ rows[r] = TRUE;
+ cols[c] = TRUE;
+ }
+ }
+ }
+}
+
+bool Grid::locateWidget( QWidget* w, int& row, int& col, int& rowspan, int & colspan )
+{
+ int r,c, r2, c2;
+ for ( c = 0; c < ncols; c++ ) {
+ for ( r = 0; r < nrows; r++ ) {
+ if ( cell( r, c ) == w ) {
+ row = 0;
+ for ( r2 = 1; r2 <= r; r2++ ) {
+ if ( rows[ r2-1 ] )
+ row++;
+ }
+ col = 0;
+ for ( c2 = 1; c2 <= c; c2++ ) {
+ if ( cols[ c2-1 ] )
+ col++;
+ }
+ rowspan = 0;
+ for ( r2 = r ; r2 < nrows && cell( r2, c) == w; r2++ ) {
+ if ( rows[ r2 ] )
+ rowspan++;
+ }
+ colspan = 0;
+ for ( c2 = c; c2 < ncols && cell( r, c2) == w; c2++ ) {
+ if ( cols[ c2] )
+ colspan++;
+ }
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+
+
+
+GridLayout::GridLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, const QSize &res, bool doSetup )
+ : Layout( wl, p, fw, lb, doSetup ), resolution( res )
+{
+ grid = 0;
+ if ( doSetup )
+ setup();
+}
+
+GridLayout::~GridLayout()
+{
+ delete grid;
+}
+
+void GridLayout::doLayout()
+{
+ bool needMove, needReparent;
+ if ( !prepareLayout( needMove, needReparent ) )
+ return;
+
+ QDesignerGridLayout *layout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid );
+
+ if ( !grid )
+ buildGrid();
+
+ QWidget* w;
+ int r, c, rs, cs;
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( grid->locateWidget( w, r, c, rs, cs) ) {
+ if ( needReparent && w->parent() != layoutBase )
+ w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE );
+ if ( rs * cs == 1 ) {
+ layout->addWidget( w, r, c, ::qt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
+ } else {
+ layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, ::qt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 );
+ }
+ if ( ::qt_cast<QLayoutWidget*>(w) )
+ ( (QLayoutWidget*)w )->updateSizePolicy();
+ w->show();
+ } else {
+ qWarning("ooops, widget '%s' does not fit in layout", w->name() );
+ }
+ }
+ finishLayout( needMove, layout );
+}
+
+void GridLayout::setup()
+{
+ Layout::setup();
+ buildGrid();
+}
+
+void GridLayout::buildGrid()
+{
+ if ( !widgets.count() )
+ return;
+
+ // Pixel to cell conversion:
+ // By keeping a list of start'n'stop values (x & y) for each widget,
+ // it is possible to create a very small grid of cells to represent
+ // the widget layout.
+ // -----------------------------------------------------------------
+
+ // We need a list of both start and stop values for x- & y-axis
+ QValueVector<int> x( widgets.count()*2 );
+ QValueVector<int> y( widgets.count()*2 );
+
+ // Using push_back would look nicer, but operator[] is much faster
+ int index = 0;
+ QWidget* w = 0;
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ QRect widgetPos = w->geometry();
+ x[index] = widgetPos.left();
+ x[index+1] = widgetPos.right();
+ y[index] = widgetPos.top();
+ y[index+1] = widgetPos.bottom();
+ index += 2;
+ }
+
+ qHeapSort(x);
+ qHeapSort(y);
+
+ // Remove duplicate x enteries (Remove next, if equal to current)
+ if ( !x.empty() ) {
+ for (QValueVector<int>::iterator current = x.begin() ;
+ (current != x.end()) && ((current+1) != x.end()) ; )
+ if ( (*current == *(current+1)) )
+ x.erase(current+1);
+ else
+ current++;
+ }
+
+ // Remove duplicate y enteries (Remove next, if equal to current)
+ if ( !y.empty() ) {
+ for (QValueVector<int>::iterator current = y.begin() ;
+ (current != y.end()) && ((current+1) != y.end()) ; )
+ if ( (*current == *(current+1)) )
+ y.erase(current+1);
+ else
+ current++;
+ }
+
+ // Create the smallest grid possible to represent the current layout
+ // Since no widget will be placed in the last row and column, we'll
+ // skip them to increase speed even further
+ delete grid;
+ grid = new Grid( y.size()-1, x.size()-1 );
+
+ // Mark the cells in the grid that contains a widget
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ QRect c(0,0,0,0), widgetPos = w->geometry();
+ // From left til right (not including)
+ for (uint cw=0; cw<x.size(); cw++) {
+ if ( x[cw] == widgetPos.left() )
+ c.setLeft(cw);
+ if ( x[cw] < widgetPos.right())
+ c.setRight(cw);
+ }
+ // From top til bottom (not including)
+ for (uint ch=0; ch<y.size(); ch++) {
+ if ( y[ch] == widgetPos.top() )
+ c.setTop(ch);
+ if ( y[ch] < widgetPos.bottom() )
+ c.setBottom(ch);
+ }
+ grid->setCells(c, w); // Mark cellblock
+ }
+ grid->simplify();
+}
+
+
+
+
+
+
+
+Spacer::Spacer( QWidget *parent, const char *name )
+ : QWidget( parent, name, WMouseNoMask ),
+ orient( Vertical ), interactive(TRUE), sh( QSize(20,20) )
+{
+ setSizeType( Expanding );
+ setAutoMask( TRUE );
+}
+
+void Spacer::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ p.setPen( Qt::blue );
+
+ if ( orient == Horizontal ) {
+ const int dist = 3;
+ const int amplitude = QMIN( 3, height() / 3 );
+ const int base = height() / 2;
+ int i = 0;
+ p.setPen( white );
+ for ( i = 0; i < width() / 3 +2; ++i )
+ p.drawLine( i * dist, base - amplitude, i * dist + dist / 2, base + amplitude );
+ p.setPen( blue );
+ for ( i = 0; i < width() / 3 +2; ++i )
+ p.drawLine( i * dist + dist / 2, base + amplitude, i * dist + dist, base - amplitude );
+ p.drawLine( 0, 0, 0, height() );
+ p.drawLine( width() - 1, 0, width() - 1, height());
+ } else {
+ const int dist = 3;
+ const int amplitude = QMIN( 3, width() / 3 );
+ const int base = width() / 2;
+ int i = 0;
+ p.setPen( white );
+ for ( i = 0; i < height() / 3 +2; ++i )
+ p.drawLine( base - amplitude, i * dist, base + amplitude,i * dist + dist / 2 );
+ p.setPen( blue );
+ for ( i = 0; i < height() / 3 +2; ++i )
+ p.drawLine( base + amplitude, i * dist + dist / 2, base - amplitude, i * dist + dist );
+ p.drawLine( 0, 0, width(), 0 );
+ p.drawLine( 0, height() - 1, width(), height() - 1 );
+ }
+}
+
+void Spacer::resizeEvent( QResizeEvent* e)
+{
+ QWidget::resizeEvent( e );
+ if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ sh = size();
+}
+
+void Spacer::updateMask()
+{
+ QRegion r( rect() );
+ if ( orient == Horizontal ) {
+ const int amplitude = QMIN( 3, height() / 3 );
+ const int base = height() / 2;
+ r = r.subtract( QRect(1, 0, width() - 2, base - amplitude ) );
+ r = r.subtract( QRect(1, base + amplitude, width() - 2, height() - base - amplitude ) );
+ } else {
+ const int amplitude = QMIN( 3, width() / 3 );
+ const int base = width() / 2;
+ r = r.subtract( QRect(0, 1, base - amplitude, height() - 2 ) );
+ r = r.subtract( QRect( base + amplitude, 1, width() - base - amplitude, height() - 2 ) );
+ }
+ setMask( r );
+}
+
+void Spacer::setSizeType( SizeType t )
+{
+ QSizePolicy sizeP;
+ if ( orient == Vertical )
+ sizeP = QSizePolicy( QSizePolicy::Minimum, (QSizePolicy::SizeType)t );
+ else
+ sizeP = QSizePolicy( (QSizePolicy::SizeType)t, QSizePolicy::Minimum );
+ setSizePolicy( sizeP );
+}
+
+
+Spacer::SizeType Spacer::sizeType() const
+{
+ if ( orient == Vertical )
+ return (SizeType)sizePolicy().verData();
+ return (SizeType)sizePolicy().horData();
+}
+
+int Spacer::alignment() const
+{
+ if ( orient == Vertical )
+ return AlignHCenter;
+ return AlignVCenter;
+}
+
+QSize Spacer::minimumSize() const
+{
+ QSize s = QSize( 20,20 );
+ if ( sizeType() == Expanding )
+ if ( orient == Vertical )
+ s.rheight() = 0;
+ else
+ s.rwidth() = 0;
+ return s;
+}
+
+QSize Spacer::sizeHint() const
+{
+ return sh;
+}
+
+
+void Spacer::setSizeHint( const QSize &s )
+{
+ sh = s;
+ if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ resize( sizeHint() );
+ updateGeometry();
+}
+
+Qt::Orientation Spacer::orientation() const
+{
+ return orient;
+}
+
+void Spacer::setOrientation( Qt::Orientation o )
+{
+ if ( orient == o )
+ return;
+
+ SizeType st = sizeType();
+ orient = o;
+ setSizeType( st );
+ if ( interactive ) {
+ sh = QSize( sh.height(), sh.width() );
+ if (!parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout )
+ resize( height(), width() );
+ }
+ updateMask();
+ update();
+ updateGeometry();
+}
+
+
+void QDesignerGridLayout::addWidget( QWidget *w, int row, int col, int align_ )
+{
+ items.insert( w, Item(row, col, 1, 1) );
+ QGridLayout::addWidget( w, row, col, align_ );
+}
+
+void QDesignerGridLayout::addMultiCellWidget( QWidget *w, int fromRow, int toRow,
+ int fromCol, int toCol, int align_ )
+{
+ items.insert( w, Item(fromRow, fromCol, toRow - fromRow + 1, toCol - fromCol +1) );
+ QGridLayout::addMultiCellWidget( w, fromRow, toRow, fromCol, toCol, align_ );
+}
diff --git a/kdevdesigner/designer/layout.h b/kdevdesigner/designer/layout.h
new file mode 100644
index 00000000..2ead5d0d
--- /dev/null
+++ b/kdevdesigner/designer/layout.h
@@ -0,0 +1,188 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LAYOUT_H
+#define LAYOUT_H
+
+#include <qwidget.h>
+#include <qmap.h>
+#include <qguardedptr.h>
+#include <qobject.h>
+#include <qlayout.h>
+#include <qmap.h>
+#include <qwidgetlist.h>
+
+class FormWindow;
+class QPaintEvent;
+
+class Layout : public QObject
+{
+ Q_OBJECT
+
+public:
+ Layout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+ virtual ~Layout() {}
+
+ virtual void doLayout() = 0;
+ virtual void undoLayout();
+ virtual void breakLayout();
+ virtual bool prepareLayout( bool &needMove, bool &needReparent );
+ virtual void finishLayout( bool needMove, QLayout *layout );
+
+protected:
+ QWidgetList widgets;
+ QWidget *parent;
+ QPoint startPoint;
+ QMap<QGuardedPtr<QWidget>, QRect> geometries;
+ QWidget *layoutBase;
+ FormWindow *formWindow;
+ QRect oldGeometry;
+ bool isBreak;
+ bool useSplitter;
+
+protected:
+ virtual void setup();
+
+protected slots:
+ void widgetDestroyed();
+
+};
+
+class HorizontalLayout : public Layout
+{
+public:
+ HorizontalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+
+ void doLayout();
+
+protected:
+ void setup();
+
+};
+
+class VerticalLayout : public Layout
+{
+public:
+ VerticalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup = TRUE, bool splitter = FALSE );
+
+ void doLayout();
+
+protected:
+ void setup();
+
+};
+
+class Grid;
+
+class GridLayout : public Layout
+{
+public:
+ GridLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, const QSize &res, bool doSetup = TRUE );
+ ~GridLayout();
+
+ void doLayout();
+
+protected:
+ void setup();
+
+protected:
+ void buildGrid();
+ QSize resolution;
+ Grid* grid;
+
+};
+
+class Spacer : public QWidget
+{
+ Q_OBJECT
+
+ Q_OVERRIDE( QCString name )
+ Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
+ Q_ENUMS( SizeType )
+ Q_PROPERTY( SizeType sizeType READ sizeType WRITE setSizeType )
+ Q_PROPERTY( QSize sizeHint READ sizeHint WRITE setSizeHint DESIGNABLE true STORED true )
+ Q_OVERRIDE( QRect geometry DESIGNABLE false )
+
+private:
+ enum { HSize = 6, HMask = 0x3f, VMask = HMask << HSize,
+ MayGrow = 1, ExpMask = 2, MayShrink = 4 };
+
+public:
+ enum SizeType { Fixed = 0,
+ Minimum = MayGrow,
+ Maximum = MayShrink,
+ Preferred = MayGrow|MayShrink ,
+ MinimumExpanding = Minimum|ExpMask,
+ Expanding = MinimumExpanding|MayShrink };
+
+ Spacer( QWidget *parent, const char *name );
+
+ QSize minimumSize() const;
+ QSize sizeHint() const;
+ void setSizeType( SizeType t );
+ SizeType sizeType() const;
+ int alignment() const;
+ Orientation orientation() const;
+ void setOrientation( Orientation o );
+ void setInteraciveMode( bool b ) { interactive = b; };
+ void setSizeHint( const QSize &s );
+
+protected:
+ void paintEvent( QPaintEvent *e );
+ void resizeEvent( QResizeEvent* e );
+ void updateMask();
+ Qt::Orientation orient;
+ bool interactive;
+ QSize sh;
+};
+
+class QDesignerGridLayout : public QGridLayout
+{
+ Q_OBJECT
+public:
+ QDesignerGridLayout( QWidget *parent ) : QGridLayout( parent ){};
+ QDesignerGridLayout( QLayout *parentLayout ) : QGridLayout( parentLayout ){};
+
+ void addWidget( QWidget *, int row, int col, int align = 0 );
+ void addMultiCellWidget( QWidget *, int fromRow, int toRow,
+ int fromCol, int toCol, int align = 0 );
+
+ struct Item
+ {
+ Item(): row(0), column(0),rowspan(1),colspan(1){}
+ Item( int r, int c, int rs, int cs): row(r), column(c), rowspan(rs), colspan(cs){}
+ int row;
+ int column;
+ int rowspan;
+ int colspan;
+ Q_DUMMY_COMPARISON_OPERATOR( Item )
+ };
+
+ QMap<QWidget*, Item> items;
+};
+
+
+#endif
diff --git a/kdevdesigner/designer/listboxdnd.cpp b/kdevdesigner/designer/listboxdnd.cpp
new file mode 100644
index 00000000..a83ace44
--- /dev/null
+++ b/kdevdesigner/designer/listboxdnd.cpp
@@ -0,0 +1,305 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "listboxdnd.h"
+#include <qwidget.h>
+#include <qheader.h>
+#include <qpainter.h>
+#include <qdragobject.h>
+#include <qvaluelist.h>
+
+// The Dragobject Declaration ---------------------------------------
+class ListBoxItemDrag : public QStoredDrag
+{
+public:
+ ListBoxItemDrag( ListBoxItemList & items, bool sendPtr = FALSE, QListBox * parent = 0, const char * name = 0 );
+ ~ListBoxItemDrag() {};
+ static bool canDecode( QDragMoveEvent * event );
+ static bool decode( QDropEvent * event, QListBox * parent, QListBoxItem * insertPoint );
+ enum ItemType { ListBoxText = 1, ListBoxPixmap = 2 };
+};
+// ------------------------------------------------------------------
+
+ListBoxDnd::ListBoxDnd( QListBox * eventSource, const char * name )
+ : ListDnd( eventSource, name ) { }
+
+void ListBoxDnd::confirmDrop( QListBoxItem * )
+{
+ dropConfirmed = TRUE;
+}
+
+bool ListBoxDnd::dropEvent( QDropEvent * event )
+{
+ if ( dragInside ) {
+
+ if ( dMode & NullDrop ) { // combined with Move, a NullDrop will delete an item
+ event->accept();
+ emit dropped( 0 ); // a NullDrop
+ return TRUE;
+ }
+
+ QPoint pos = event->pos();
+ QListBoxItem * after = itemAt( pos );
+
+ if ( ListBoxItemDrag::decode( event, (QListBox *) src, after ) ) {
+ event->accept();
+ QListBox * src = (QListBox *) this->src;
+ QListBoxItem * item = ( after ? after->next() : src->firstItem() );
+ src->setCurrentItem( item );
+ emit dropped( item ); // ###FIX: Supports only one item!
+ }
+ }
+
+ line->hide();
+ dragInside = FALSE;
+
+ return TRUE;
+}
+
+bool ListBoxDnd::mouseMoveEvent( QMouseEvent * event )
+{
+ if ( event->state() & LeftButton ) {
+ if ( ( event->pos() - mousePressPos ).manhattanLength() > 3 ) {
+
+ ListBoxItemList list;
+ buildList( list );
+ ListBoxItemDrag * dragobject = new ListBoxItemDrag( list, (dMode & Internal), (QListBox *) src );
+
+ // Emit signal for all dragged items
+ QListBoxItem * i = list.first();
+ while ( i ) {
+ emit dragged( i );
+ i = list.next();
+ }
+
+ if ( dMode & Move ) {
+ removeList( list ); // "hide" items
+ }
+
+ dragobject->dragCopy();
+
+ if ( dMode & Move ) {
+ if ( dropConfirmed ) {
+ // ###FIX: memleak ? in internal mode, only pointers are transfered...
+ //list.setAutoDelete( TRUE );
+ list.clear();
+ dropConfirmed = FALSE;
+ }
+ insertList( list ); // "show" items
+ }
+ }
+ }
+ return FALSE;
+}
+
+int ListBoxDnd::buildList( ListBoxItemList & list )
+{
+ QListBoxItem * i = ((QListBox *)src)->firstItem();
+ while ( i ) {
+ if ( i->isSelected() ) {
+ ((QListBox *)src)->setSelected( i, FALSE );
+ list.append( i );
+ }
+ i = i->next();
+ }
+ return list.count();
+}
+
+void ListBoxDnd::insertList( ListBoxItemList & list )
+{
+ QListBoxItem * i = list.first();
+ while ( i ) {
+ ((QListBox *)src)->insertItem( i, i->prev() );
+ i = list.next();
+ }
+}
+
+void ListBoxDnd::removeList( ListBoxItemList & list )
+{
+ QListBoxItem * i = list.first();
+ while ( i ) {
+ ((QListBox *)src)->takeItem( i ); // remove item from QListBox
+ i = list.next();
+ }
+}
+
+void ListBoxDnd::updateLine( const QPoint & dragPos )
+{
+ QListBox * src = (QListBox *) this->src;
+ QListBoxItem *item = itemAt( dragPos );
+
+ int ypos = item ?
+ ( src->itemRect( item ).bottom() - ( line->height() / 2 ) ) :
+ ( src->itemRect( ((QListBox *)src)->firstItem() ).top() );
+
+ line->resize( src->viewport()->width(), line->height() );
+ line->move( 0, ypos );
+}
+
+QListBoxItem * ListBoxDnd::itemAt( QPoint pos )
+{
+ QListBox * src = (QListBox *) this->src;
+ QListBoxItem * result = src->itemAt( pos );
+ QListBoxItem * last = src->item( src->count() - 1 );
+ int i = src->index( result );
+
+ if ( result && ( pos.y() < (src->itemRect(result).top() + src->itemHeight(i)/2) ) )
+ result = result->prev();
+ else if ( !result && pos.y() > src->itemRect( last ).bottom() )
+ result = last;
+
+ return result;
+}
+
+bool ListBoxDnd::canDecode( QDragEnterEvent * event )
+{
+ return ListBoxItemDrag::canDecode( event );
+}
+
+
+// ------------------------------------------------------------------
+// The Dragobject Implementation ------------------------------------
+// ------------------------------------------------------------------
+
+ListBoxItemDrag::ListBoxItemDrag( ListBoxItemList & items, bool sendPtr, QListBox * parent, const char * name )
+ : QStoredDrag( "qt/listboxitem", parent, name )
+{
+ // ### FIX!
+ QByteArray data( sizeof( Q_INT32 ) + sizeof( QListBoxItem ) * items.count() );
+ QDataStream stream( data, IO_WriteOnly );
+
+ stream << items.count();
+ stream << (Q_UINT8) sendPtr; // just transfer item pointer; omit data
+
+ QListBoxItem * i = items.first();
+
+ if ( sendPtr ) {
+
+ while ( i ) {
+
+ stream << (Q_ULONG) i; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ i = items.next();
+
+ }
+
+ } else {
+
+ while ( i ) {
+
+ Q_UINT8 b = 0;
+
+ b = (Q_UINT8) ( i->text() != QString::null ); // does item have text ?
+ stream << b;
+ if ( b ) {
+ stream << i->text();
+ }
+
+ b = (Q_UINT8) ( !!i->pixmap() ); // does item have a pixmap ?
+ stream << b;
+ if ( b ) {
+ stream << ( *i->pixmap() );
+ }
+
+ stream << (Q_UINT8) i->isSelectable();
+
+ i = items.next();
+ }
+
+ }
+
+ setEncodedData( data );
+}
+
+bool ListBoxItemDrag::canDecode( QDragMoveEvent * event )
+{
+ return event->provides( "qt/listboxitem" );
+}
+
+bool ListBoxItemDrag::decode( QDropEvent * event, QListBox * parent, QListBoxItem * after )
+{
+ QByteArray data = event->encodedData( "qt/listboxitem" );
+
+ if ( data.size() ) {
+ event->accept();
+ QDataStream stream( data, IO_ReadOnly );
+
+ int count = 0;
+ stream >> count;
+
+ Q_UINT8 recievePtr = 0; // data contains just item pointers; no data
+ stream >> recievePtr;
+
+ QListBoxItem * item = 0;
+
+ if ( recievePtr ) {
+
+ for( int i = 0; i < count; i++ ) {
+
+ Q_ULONG p = 0; //###FIX: demands sizeof(ulong) >= sizeof(void*)
+ stream >> p;
+ item = (QListBoxItem *) p;
+
+ parent->insertItem( item, after );
+
+ }
+
+ } else {
+
+ for ( int i = 0; i < count; i++ ) {
+
+ Q_UINT8 hasText = 0;
+ QString text;
+ stream >> hasText;
+ if ( hasText ) {
+ stream >> text;
+ }
+
+ Q_UINT8 hasPixmap = 0;
+ QPixmap pixmap;
+ stream >> hasPixmap;
+ if ( hasPixmap ) {
+ stream >> pixmap;
+ }
+
+ Q_UINT8 isSelectable = 0;
+ stream >> isSelectable;
+
+ if ( hasPixmap ) {
+ item = new QListBoxPixmap( parent, pixmap, text, after );
+ } else {
+ item = new QListBoxText( parent, text, after );
+ }
+
+ item->setSelectable( isSelectable );
+
+ }
+
+ }
+
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/kdevdesigner/designer/listboxdnd.h b/kdevdesigner/designer/listboxdnd.h
new file mode 100644
index 00000000..c0f91845
--- /dev/null
+++ b/kdevdesigner/designer/listboxdnd.h
@@ -0,0 +1,63 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTBOXDND_H
+#define LISTBOXDND_H
+
+#include <qptrlist.h>
+#include <qlistbox.h>
+#include "listdnd.h"
+
+typedef QPtrList<QListBoxItem> ListBoxItemList;
+
+class ListBoxDnd : public ListDnd
+{
+ Q_OBJECT
+public:
+ // dragModes are enumerated in ListDnd
+ ListBoxDnd( QListBox * eventSource, const char * name = 0 );
+
+signals:
+ void dropped( QListBoxItem * );
+ void dragged( QListBoxItem * );
+
+public slots:
+ void confirmDrop( QListBoxItem * );
+
+protected:
+ virtual bool dropEvent( QDropEvent * event );
+ virtual bool mouseMoveEvent( QMouseEvent * event );
+ virtual void updateLine( const QPoint & pos );
+ virtual bool canDecode( QDragEnterEvent * event );
+
+private:
+ QListBoxItem * itemAt( QPoint pos );
+ int buildList( ListBoxItemList & list );
+ void insertList( ListBoxItemList & list );
+ void removeList( ListBoxItemList & list );
+};
+
+#endif //LISTBOXDND_H
diff --git a/kdevdesigner/designer/listboxeditor.ui b/kdevdesigner/designer/listboxeditor.ui
new file mode 100644
index 00000000..ce3d4b79
--- /dev/null
+++ b/kdevdesigner/designer/listboxeditor.ui
@@ -0,0 +1,457 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ListBoxEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ListBoxEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>229</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Listbox</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Listbox&lt;/b&gt;&lt;p&gt;Add, edit or delete items in the listbox.&lt;/p&gt;&lt;p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new listbox entry, then enter text and choose a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>preview</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of items.</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item's pixmap.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file for the selected item.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Change the selected item's text.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Add a new item.&lt;/b&gt;&lt;p&gt;New items are appended to the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the selected item</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</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>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>itemUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Moves the selected item up.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>itemDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move the selected item down.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>insertNewItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>deleteCurrentItem()</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged( const QString &amp; )</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>choosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>deletePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>itemUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>moveItemUp()</slot>
+ </connection>
+ <connection>
+ <sender>itemDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>moveItemDown()</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentItemChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>preview</sender>
+ <signal>currentChanged( QListBoxItem * )</signal>
+ <receiver>ListBoxEditorBase</receiver>
+ <slot>currentItemChanged(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>preview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemUp</tabstop>
+ <tabstop>itemDown</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>buttonApply</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">insertNewItem()</slot>
+ <slot access="protected">deleteCurrentItem()</slot>
+ <slot access="protected">currentItemChanged( QListBoxItem * )</slot>
+ <slot access="protected">currentTextChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">choosePixmap()</slot>
+ <slot access="protected">deletePixmap()</slot>
+ <slot access="protected">moveItemUp()</slot>
+ <slot access="protected">moveItemDown()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/listboxeditorimpl.cpp b/kdevdesigner/designer/listboxeditorimpl.cpp
new file mode 100644
index 00000000..d19f22b2
--- /dev/null
+++ b/kdevdesigner/designer/listboxeditorimpl.cpp
@@ -0,0 +1,245 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "listboxeditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "pixmapchooser.h"
+#include "command.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <klineedit.h>
+#include <qlabel.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+
+#include <klocale.h>
+
+ListBoxEditor::ListBoxEditor( QWidget *parent, QWidget *editWidget, FormWindow *fw )
+ : ListBoxEditorBase( parent, 0, TRUE ), formwindow( fw )
+{
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ listbox = (QListBox*)editWidget;
+
+ itemText->setText( "" );
+ itemText->setEnabled( FALSE );
+ itemPixmap->setText( "" );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+
+ QListBoxItem *i = 0;
+ for ( i = listbox->firstItem(); i; i = i->next() ) {
+ if ( i->pixmap() )
+ (void)new QListBoxPixmap( preview, *i->pixmap(), i->text() );
+ else
+ (void)new QListBoxText( preview, i->text() );
+ }
+
+ if ( preview->firstItem() )
+ preview->setCurrentItem( preview->firstItem() );
+
+ ListBoxDnd *editorDnd = new ListBoxDnd( preview );
+ editorDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ QObject::connect( editorDnd, SIGNAL( dropped( QListBoxItem * ) ),
+ editorDnd, SLOT( confirmDrop( QListBoxItem * ) ) );
+
+ ListBoxRename *editorRename = new ListBoxRename( preview );
+
+ QObjectList *l = parent->queryList( "QLineEdit", "itemText" );
+ QObjectListIt it( *l );
+ QObject *obj;
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ QObject::connect( editorRename,
+ SIGNAL( itemTextChanged( const QString & ) ),
+ obj,
+ SLOT( setText( const QString & ) ) );
+ }
+ delete l;
+
+}
+
+void ListBoxEditor::insertNewItem()
+{
+ QListBoxItem *i = new QListBoxText( preview, i18n("New Item") );
+ preview->setCurrentItem( i );
+ preview->setSelected( i, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void ListBoxEditor::deleteCurrentItem()
+{
+ delete preview->item( preview->currentItem() );
+ if ( preview->currentItem() != -1 )
+ preview->setSelected( preview->currentItem(), TRUE );
+}
+
+void ListBoxEditor::currentItemChanged( QListBoxItem *i )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( "" );
+ itemPixmap->setText( "" );
+ itemText->blockSignals( FALSE );
+
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->blockSignals( TRUE );
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+
+ itemText->setText( i->text() );
+ if ( i->pixmap() )
+ itemPixmap->setPixmap( *i->pixmap() );
+ itemText->blockSignals( FALSE );
+}
+
+void ListBoxEditor::currentTextChanged( const QString &txt )
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ preview->blockSignals( TRUE );
+ if ( preview->item( preview->currentItem() )->pixmap() )
+ preview->changeItem( *preview->item( preview->currentItem() )->pixmap(), txt, preview->currentItem() );
+ else
+ preview->changeItem( txt, preview->currentItem() );
+ preview->blockSignals( FALSE );
+}
+
+void ListBoxEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void ListBoxEditor::cancelClicked()
+{
+ reject();
+}
+
+void ListBoxEditor::applyClicked()
+{
+ QListBoxItem *i = 0;
+ QValueList<PopulateListBoxCommand::Item> items;
+ for ( i = preview->firstItem(); i; i = i->next() ) {
+ PopulateListBoxCommand::Item item;
+ if ( i->pixmap() )
+ item.pix = *i->pixmap();
+ item.text = i->text();
+ items.append( item );
+ }
+
+ PopulateListBoxCommand *cmd = new PopulateListBoxCommand( i18n( "Edit the Items of '%1'" ).arg( listbox->name() ),
+ formwindow, listbox, items );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void ListBoxEditor::choosePixmap()
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ QPixmap pix;
+ if ( preview->item( preview->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *preview->item( preview->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ QString txt = preview->item( preview->currentItem() )->text();
+ preview->changeItem( pix, txt, preview->currentItem() );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void ListBoxEditor::moveItemUp()
+{
+ if ( preview->currentItem() < 1 )
+ return;
+
+ QListBoxItem *i = preview->item( preview->currentItem() );
+ bool hasPix = (i->pixmap() != 0);
+ QPixmap pix;
+ if ( hasPix )
+ pix = *i->pixmap();
+ QString txt = i->text();
+
+ QListBoxItem *p = i->prev();
+ if ( p->pixmap() )
+ preview->changeItem( *p->pixmap(), p->text(), preview->currentItem() );
+ else
+ preview->changeItem( p->text(), preview->currentItem() );
+
+ if ( hasPix )
+ preview->changeItem( pix, txt, preview->currentItem() - 1 );
+ else
+ preview->changeItem( txt, preview->currentItem() - 1 );
+}
+
+void ListBoxEditor::moveItemDown()
+{
+ if ( preview->currentItem() == -1 || preview->currentItem() > (int)preview->count() - 2 )
+ return;
+
+ QListBoxItem *i = preview->item( preview->currentItem() );
+ bool hasPix = (i->pixmap() != 0);
+ QPixmap pix;
+ if ( hasPix )
+ pix = *i->pixmap();
+ QString txt = i->text();
+
+ QListBoxItem *n = i->next();
+ if ( n->pixmap() )
+ preview->changeItem( *n->pixmap(), n->text(), preview->currentItem() );
+ else
+ preview->changeItem( n->text(), preview->currentItem() );
+
+ if ( hasPix )
+ preview->changeItem( pix, txt, preview->currentItem() + 1 );
+ else
+ preview->changeItem( txt, preview->currentItem() + 1 );
+}
+
+void ListBoxEditor::deletePixmap()
+{
+ if ( preview->currentItem() == -1 )
+ return;
+
+ QListBoxItem *i = preview->item( preview->currentItem() );
+ preview->changeItem( i->text(), preview->currentItem() );
+ itemDeletePixmap->setEnabled( FALSE );
+}
diff --git a/kdevdesigner/designer/listboxeditorimpl.h b/kdevdesigner/designer/listboxeditorimpl.h
new file mode 100644
index 00000000..3719bc59
--- /dev/null
+++ b/kdevdesigner/designer/listboxeditorimpl.h
@@ -0,0 +1,61 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTBOXEDITORIMPL_H
+#define LISTBOXEDITORIMPL_H
+
+class QListBox;
+class FormWindow;
+
+#include "listboxeditor.h"
+
+class ListBoxEditor : public ListBoxEditorBase
+{
+ Q_OBJECT
+
+public:
+ ListBoxEditor( QWidget *parent, QWidget *editWidget, FormWindow *fw );
+
+protected slots:
+ void insertNewItem();
+ void deleteCurrentItem();
+ void currentItemChanged( QListBoxItem * );
+ void currentTextChanged( const QString & );
+ void okClicked();
+ void cancelClicked();
+ void applyClicked();
+ void choosePixmap();
+ void moveItemUp();
+ void moveItemDown();
+ void deletePixmap();
+
+private:
+ QListBox *listbox;
+ FormWindow *formwindow;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/listboxrename.cpp b/kdevdesigner/designer/listboxrename.cpp
new file mode 100644
index 00000000..464ef412
--- /dev/null
+++ b/kdevdesigner/designer/listboxrename.cpp
@@ -0,0 +1,157 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qheader.h>
+#include <qlineedit.h>
+#include <qtimer.h>
+#include "listboxrename.h"
+
+class EditableListBoxItem : public QListBoxItem
+{
+public:
+ void setText( const QString & text )
+ {
+ QListBoxItem::setText( text );
+ }
+};
+
+ListBoxRename::ListBoxRename( QListBox * eventSource, const char * name )
+ : QObject( eventSource, name ),
+ clickedItem( 0 ), activity( FALSE )
+{
+ src = eventSource;
+ src->installEventFilter( this );
+ ed = new QLineEdit( src->viewport() );
+ ed->hide();
+ ed->setFrame( FALSE );
+
+ QObject::connect( ed, SIGNAL( returnPressed() ),
+ this, SLOT( renameClickedItem() ) );
+}
+
+bool ListBoxRename::eventFilter( QObject *, QEvent * event )
+{
+ switch ( event->type() ) {
+
+ case QEvent::MouseButtonPress:
+ {
+ QPoint pos = ((QMouseEvent *) event)->pos();
+
+ if ( clickedItem &&
+ clickedItem->isSelected() &&
+ (clickedItem == src->itemAt( pos )) ) {
+ QTimer::singleShot( 500, this, SLOT( showLineEdit() ) );
+ activity = FALSE; // no drags or clicks for 500 ms before we start the renaming
+ } else { // new item clicked
+ activity = TRUE;
+ clickedItem = src->itemAt( pos );
+ ed->hide();
+ }
+ }
+ break;
+
+ case QEvent::MouseMove:
+
+ if ( ((QMouseEvent *) event)->state() & Qt::LeftButton ) {
+ activity = TRUE; // drag
+ }
+ break;
+
+ case QEvent::KeyPress:
+
+ switch ( ((QKeyEvent *) event)->key() ) {
+
+ case Qt::Key_F2:
+
+ activity = FALSE;
+ clickedItem = src->item( src->currentItem() );
+ showLineEdit();
+ break;
+
+ case Qt::Key_Escape:
+ if ( !ed->isHidden() ) {
+ hideLineEdit(); // abort rename
+ return TRUE;
+ }
+ break;
+
+ case Qt::Key_Up:
+ case Qt::Key_Down:
+ case Qt::Key_PageUp:
+ case Qt::Key_PageDown:
+
+ if ( !ed->isHidden() )
+ return TRUE; // Filter out the keystrokes
+ break;
+
+ }
+ break;
+
+ case QEvent::Resize:
+
+ if ( clickedItem && ed && !ed->isHidden() ) {
+ QRect rect = src->itemRect( clickedItem );
+ ed->resize( rect.right() - rect.left() - 1,
+ rect.bottom() - rect.top() - 1 );
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+void ListBoxRename::showLineEdit()
+{
+ if ( !clickedItem || activity )
+ return;
+ QRect rect = src->itemRect( clickedItem );
+ ed->resize( rect.right() - rect.left() - 1,
+ rect.bottom() - rect.top() - 1 );
+ ed->move( rect.left() + 1, rect.top() + 1 );
+ ed->setText( clickedItem->text() );
+ ed->selectAll();
+ ed->show();
+ ed->setFocus();
+}
+
+void ListBoxRename::hideLineEdit()
+{
+ ed->hide();
+ clickedItem = 0;
+ src->setFocus();
+}
+
+void ListBoxRename::renameClickedItem()
+{
+ if ( clickedItem && ed ) {
+ ( (EditableListBoxItem *) clickedItem )->setText( ed->text() );
+ emit itemTextChanged( ed->text() );
+ }
+ hideLineEdit();
+}
diff --git a/kdevdesigner/designer/listboxrename.h b/kdevdesigner/designer/listboxrename.h
new file mode 100644
index 00000000..cdb6d67b
--- /dev/null
+++ b/kdevdesigner/designer/listboxrename.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTBOXRENAME_H
+#define LISTBOXRENAME_H
+
+#include <qobject.h>
+#include <qlistbox.h>
+
+class QLineEdit;
+
+class ListBoxRename : public QObject
+{
+ Q_OBJECT
+public:
+ ListBoxRename( QListBox * eventSource, const char * name = 0 );
+ bool eventFilter( QObject *, QEvent * event );
+
+signals:
+ void itemTextChanged( const QString & );
+
+public slots:
+ void showLineEdit();
+ void hideLineEdit();
+ void renameClickedItem();
+
+private:
+ QListBoxItem * clickedItem;
+ QListBox * src;
+ QLineEdit * ed;
+ bool activity;
+};
+
+#endif //LISTBOXRENAME_H
diff --git a/kdevdesigner/designer/listdnd.cpp b/kdevdesigner/designer/listdnd.cpp
new file mode 100644
index 00000000..34562e6f
--- /dev/null
+++ b/kdevdesigner/designer/listdnd.cpp
@@ -0,0 +1,142 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "listdnd.h"
+#include <qwidget.h>
+#include <qpainter.h>
+
+ListDnd::ListDnd( QScrollView * eventSource, const char * name )
+ : QObject( eventSource, name ),
+ dragInside( FALSE ), dragDelete( TRUE ), dropConfirmed( FALSE ), dMode( Both )
+{
+ src = eventSource;
+ src->setAcceptDrops( TRUE );
+ src->installEventFilter( this );
+ src->viewport()->installEventFilter( this );
+
+ line = new QWidget( src->viewport(), 0, Qt::WStyle_NoBorder | WStyle_StaysOnTop );
+ line->setBackgroundColor( Qt::black );
+ line->resize( src->viewport()->width(), 2 );
+ line->hide();
+}
+
+void ListDnd::setDragMode( int mode )
+{
+ dMode = mode;
+}
+
+int ListDnd::dragMode() const
+{
+ return dMode;
+}
+
+bool ListDnd::eventFilter( QObject *, QEvent * event )
+{
+ switch ( event->type() ) {
+ case QEvent::DragEnter:
+ return dragEnterEvent( (QDragEnterEvent *) event );
+ case QEvent::DragLeave:
+ return dragLeaveEvent( (QDragLeaveEvent *) event );
+ case QEvent::DragMove:
+ return dragMoveEvent( (QDragMoveEvent *) event );
+ case QEvent::Drop:
+ return dropEvent( (QDropEvent *) event );
+ case QEvent::MouseButtonPress:
+ return mousePressEvent( (QMouseEvent *) event );
+ case QEvent::MouseMove:
+ return mouseMoveEvent( (QMouseEvent *) event );
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+bool ListDnd::dragEnterEvent( QDragEnterEvent * event )
+{
+ if ( dMode == None ) {
+ return TRUE;
+ }
+
+ bool ok = ( ( ( dMode & Both ) == Both ) ||
+ ( ( dMode & Internal ) && ( event->source() == src ) ) ||
+ ( ( dMode & External ) && ( event->source() != src ) ) );
+
+ if ( ok && canDecode( event ) ) {
+ event->accept();
+ dragInside = TRUE;
+ if ( !( dMode & NullDrop ) ) {
+ updateLine( event->pos() );
+ line->show();
+ }
+ }
+ return TRUE;
+}
+
+bool ListDnd::dragLeaveEvent( QDragLeaveEvent * )
+{
+ dragInside = FALSE;
+ line->hide();
+ return TRUE;
+}
+
+bool ListDnd::dragMoveEvent( QDragMoveEvent * event )
+{
+ if ( dragInside && dMode && !( dMode & NullDrop ) ) {
+ updateLine( event->pos() );
+ }
+ return TRUE;
+}
+
+bool ListDnd::dropEvent( QDropEvent * )
+{
+ // do nothing
+ return FALSE;
+}
+
+bool ListDnd::mousePressEvent( QMouseEvent * event )
+{
+ if ( event->button() == LeftButton )
+ mousePressPos = event->pos();
+ return FALSE;
+}
+
+bool ListDnd::mouseMoveEvent( QMouseEvent * )
+{
+ // do nothing
+ return FALSE;
+}
+
+void ListDnd::updateLine( const QPoint & )
+{
+ // do nothing
+}
+
+bool ListDnd::canDecode( QDragEnterEvent * )
+{
+ // do nothing
+ return FALSE;
+}
diff --git a/kdevdesigner/designer/listdnd.h b/kdevdesigner/designer/listdnd.h
new file mode 100644
index 00000000..9e3e6351
--- /dev/null
+++ b/kdevdesigner/designer/listdnd.h
@@ -0,0 +1,63 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTDND_H
+#define LISTDND_H
+
+#include <qobject.h>
+#include <qscrollview.h>
+
+class ListDnd : public QObject
+{
+ Q_OBJECT
+public:
+ enum DragMode { None = 0, External = 1, Internal = 2, Both = 3, Move = 4, NullDrop = 8 };
+ ListDnd( QScrollView * eventSource, const char * name = 0 );
+ void setDragMode( int mode );
+ int dragMode() const;
+ bool eventFilter( QObject *, QEvent * event );
+
+protected:
+ virtual bool dragEnterEvent( QDragEnterEvent * event );
+ virtual bool dragLeaveEvent( QDragLeaveEvent * );
+ virtual bool dragMoveEvent( QDragMoveEvent * event );
+ virtual bool dropEvent( QDropEvent * event );
+ virtual bool mousePressEvent( QMouseEvent * event );
+ virtual bool mouseMoveEvent( QMouseEvent * event );
+ virtual void updateLine( const QPoint & dragPos );
+ virtual bool canDecode( QDragEnterEvent * event );
+
+ QScrollView * src;
+ QWidget * line;
+ QPoint mousePressPos;
+ QPoint dragPos;
+ bool dragInside;
+ bool dragDelete;
+ bool dropConfirmed;
+ int dMode;
+};
+
+#endif // LISTDND_H
diff --git a/kdevdesigner/designer/listeditor.ui b/kdevdesigner/designer/listeditor.ui
new file mode 100644
index 00000000..6118ba2b
--- /dev/null
+++ b/kdevdesigner/designer/listeditor.ui
@@ -0,0 +1,179 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ListEditor</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ListEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>331</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="5" colspan="1">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listview</cstring>
+ </property>
+ <property name="selectionMode">
+ <enum>Extended</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;name</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>PushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</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>
+<connections>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>addItem()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>removeItems()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>listview</sender>
+ <signal>itemRenamed(QListViewItem*,int)</signal>
+ <receiver>ListEditor</receiver>
+ <slot>renamed(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ListEditor</receiver>
+ <slot>renameItem()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">listeditor.ui.h</include>
+</includes>
+<forwards>
+ <forward>class QStringList;</forward>
+</forwards>
+<slots>
+ <slot>init()</slot>
+ <slot>setList( const QStringList &amp; l )</slot>
+ <slot>addItem()</slot>
+ <slot>renamed( QListViewItem * i )</slot>
+ <slot>removeItems()</slot>
+ <slot returnType="QStringList">items()</slot>
+ <slot>renameItem()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/listeditor.ui.h b/kdevdesigner/designer/listeditor.ui.h
new file mode 100644
index 00000000..bba06104
--- /dev/null
+++ b/kdevdesigner/designer/listeditor.ui.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include <qheader.h>
+#include <qapplication.h>
+
+void ListEditor::init()
+{
+ listview->header()->hide();
+ listview->setSorting( -1 );
+ listview->setDefaultRenameAction( QListView::Accept );
+}
+
+void ListEditor::setList( const QStringList &l )
+{
+ QListViewItem *i = 0;
+ for ( QStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) {
+ i = new QListViewItem( listview, i );
+ i->setText( 0, *it );
+ i->setRenameEnabled( 0, TRUE );
+ }
+}
+
+void ListEditor::addItem()
+{
+ QListViewItem *i = new QListViewItem( listview, listview->lastItem() );
+ i->setRenameEnabled( 0, TRUE );
+ qApp->processEvents();
+ i->startRename( 0 );
+}
+
+void ListEditor::renamed( QListViewItem *i )
+{
+ if ( i && i->text( 0 ).isEmpty() )
+ i->startRename( 0 );
+}
+
+void ListEditor::removeItems()
+{
+ QListViewItemIterator it( listview );
+ QListViewItem *i = 0;
+ while ( ( i = it.current() ) ) {
+ ++it;
+ if ( i->isSelected() )
+ delete i;
+ }
+}
+
+QStringList ListEditor::items()
+{
+ QStringList l;
+ QListViewItemIterator it( listview );
+ QListViewItem *i = 0;
+ while ( ( i = it.current() ) ) {
+ ++it;
+ if ( !i->text( 0 ).isEmpty() )
+ l << i->text( 0 );
+ }
+ return l;
+}
+
+void ListEditor::renameItem()
+{
+ QListViewItem *i = listview->currentItem();
+ if ( i )
+ i->startRename( 0 );
+}
diff --git a/kdevdesigner/designer/listviewdnd.cpp b/kdevdesigner/designer/listviewdnd.cpp
new file mode 100644
index 00000000..b4098237
--- /dev/null
+++ b/kdevdesigner/designer/listviewdnd.cpp
@@ -0,0 +1,432 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "listviewdnd.h"
+#include <qwidget.h>
+#include <qheader.h>
+#include <qpainter.h>
+#include <qdragobject.h>
+#include <qvaluelist.h>
+
+// The Dragobject Declaration ---------------------------------------
+class ListViewItemDrag : public QStoredDrag
+{
+public:
+ enum DropRelation { Sibling, Child };
+ ListViewItemDrag( ListViewItemList & items, QWidget * parent = 0, const char * name = 0 );
+ ~ListViewItemDrag() {};
+ static bool canDecode( QDragMoveEvent * event );
+ static bool decode( QDropEvent * event, QListView * parent, QListViewItem * insertPoint, DropRelation dr );
+};
+// ------------------------------------------------------------------
+
+ListViewDnd::ListViewDnd( QListView * eventSource, const char * name )
+ : ListDnd( eventSource, name ) { }
+
+void ListViewDnd::confirmDrop( QListViewItem * )
+{
+ dropConfirmed = TRUE;
+}
+
+bool ListViewDnd::dropEvent( QDropEvent * event )
+{
+ if ( dragInside ) {
+
+ if ( dMode & NullDrop ) { // combined with Move, a NullDrop will delete an item
+ event->accept();
+ emit dropped( 0 ); // a NullDrop
+ return TRUE;
+ }
+
+ QPoint pos = event->pos();
+
+ ListViewItemDrag::DropRelation dr = ListViewItemDrag::Sibling;
+ QListViewItem *item = itemAt( pos );
+ int dpos = dropDepth( item, pos );
+
+ if ( item ) {
+ if ( dpos > item->depth() && !(dMode & Flat) ) {
+ // Child node
+ dr = ListViewItemDrag::Child;
+ } else if ( dpos < item->depth() ) {
+ // Parent(s) Sibling
+ while ( item && (item->depth() > dpos) )
+ item = item->parent();
+ }
+ }
+
+ if ( ListViewItemDrag::decode( event, (QListView *) src, item, dr ) ) {
+ event->accept();
+ emit dropped( 0 ); // Use ID instead of item?
+ }
+ }
+
+ line->hide();
+ dragInside = FALSE;
+
+ return TRUE;
+}
+
+bool ListViewDnd::mouseMoveEvent( QMouseEvent * event )
+{
+ if ( event->state() & LeftButton ) {
+ if ( ( event->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ ListViewItemList list;
+
+ if ( dMode & Flat )
+ buildFlatList( list );
+ else
+ buildTreeList( list );
+
+ ListViewItemDrag * dragobject = new ListViewItemDrag( list, (QListView *) src );
+
+ if ( dMode & Move ) {
+ disabledItems = list;
+ setVisibleItems( FALSE );
+ }
+
+ dragobject->dragCopy();
+
+ if ( dMode & Move ) {
+ // Did the target accept the drop?
+ if ( dropConfirmed ) {
+ // Shouldn't autoDelete handle this?
+ for( list.first(); list.current(); list.next() )
+ delete list.current();
+ dropConfirmed = FALSE;
+ } else {
+ // Reenable disabled items since
+ // drag'n'drop was aborted
+ setVisibleItems( TRUE );
+ }
+ disabledItems.clear();
+ }
+ }
+ }
+ return FALSE;
+}
+
+int ListViewDnd::buildFlatList( ListViewItemList & list )
+{
+ bool addKids = FALSE;
+ QListViewItem *nextSibling = 0;
+ QListViewItem *nextParent = 0;
+ QListViewItemIterator it = ((QListView *)src)->firstChild();
+ for ( ; *it; it++ ) {
+ // Hit the nextSibling, turn of child processing
+ if ( (*it) == nextSibling )
+ addKids = FALSE;
+
+ if ( (*it)->isSelected() ) {
+ if ( (*it)->childCount() == 0 ) {
+ // Selected, no children
+ list.append( *it );
+ } else if ( !addKids ) {
+ // Children processing not set, so set it
+ // Also find the item were we shall quit
+ // processing children...if any such item
+ addKids = TRUE;
+ nextSibling = (*it)->nextSibling();
+ nextParent = (*it)->parent();
+ while ( nextParent && !nextSibling ) {
+ nextSibling = nextParent->nextSibling();
+ nextParent = nextParent->parent();
+ }
+ }
+ } else if ( ((*it)->childCount() == 0) && addKids ) {
+ // Leaf node, and we _do_ process children
+ list.append( *it );
+ }
+ }
+ return list.count();
+}
+
+int ListViewDnd::buildTreeList( ListViewItemList & list )
+{
+ QListViewItemIterator it = ((QListView *)src)->firstChild();
+ for ( ; *it; it++ ) {
+ if ( (*it)->isSelected() )
+ list.append( *it );
+ }
+ return list.count();
+}
+
+void ListViewDnd::setVisibleItems( bool b )
+{
+ if ( disabledItems.isEmpty() )
+ return;
+
+ disabledItems.first();
+ do {
+ disabledItems.current()->setVisible( b );
+ } while ( disabledItems.next() );
+}
+
+void ListViewDnd::updateLine( const QPoint & dragPos )
+{
+ QListViewItem * item = itemAt(dragPos);
+ QListView * src = (QListView *) this->src;
+
+ int ypos = item ?
+ ( src->itemRect( item ).bottom() - ( line->height() / 2 ) ) :
+ ( src->itemRect( src->firstChild() ).top() );
+
+ int xpos = dropDepth( item, dragPos ) * src->treeStepSize();
+ line->resize( src->viewport()->width() - xpos, line->height() );
+ line->move( xpos, ypos );
+}
+
+QListViewItem * ListViewDnd::itemAt( QPoint pos )
+{
+ QListView * src = (QListView *) this->src;
+ int headerHeight = (int)(src->header()->height());
+ pos.ry() -= headerHeight;
+ QListViewItem * result = src->itemAt( pos );
+
+ if ( result && ( pos.ry() < (src->itemPos(result) + result->height()/2) ) )
+ result = result->itemAbove();
+
+ // Wind back if has parent, and we're in flat mode
+ while ( result && result->parent() && (dMode & Flat) )
+ result = result->parent();
+
+ // Wind back if has parent, and we're in flat mode
+ while ( result && !result->isVisible() && result->parent() )
+ result = result->parent();
+
+ if ( !result && src->firstChild() && (pos.y() > src->itemRect(src->firstChild()).bottom()) ) {
+ result = src->lastItem();
+ if ( !result->isVisible() )
+ // Handle special case where last item is actually hidden
+ result = result->itemAbove();
+ }
+
+ return result;
+}
+
+int ListViewDnd::dropDepth( QListViewItem * item, QPoint pos )
+{
+ if ( !item || (dMode & Flat) )
+ return 0;
+
+ int result = 0;
+ int itemDepth = item->depth();
+ int indentSize = ((QListView *)src)->treeStepSize();
+ int itemLeft = indentSize * itemDepth;
+ int childMargin = indentSize*2;
+ if ( pos.x() > itemLeft + childMargin ) {
+ result = itemDepth + 1;
+ } else if ( pos.x() < itemLeft ) {
+ result = pos.x() / indentSize;
+ } else {
+ result = itemDepth;
+ }
+ return result;
+}
+
+bool ListViewDnd::canDecode( QDragEnterEvent * event )
+{
+ return ListViewItemDrag::canDecode( event );
+}
+
+// ------------------------------------------------------------------
+// The Dragobject Implementation ------------------------------------
+// ------------------------------------------------------------------
+
+QDataStream & operator<< ( QDataStream & stream, const QListViewItem & item );
+QDataStream & operator>> ( QDataStream & stream, QListViewItem & item );
+
+ListViewItemDrag::ListViewItemDrag( ListViewItemList & items, QWidget * parent, const char * name )
+ : QStoredDrag( "qt/listviewitem", parent, name )
+{
+ // ### FIX!
+ QByteArray data( sizeof( Q_INT32 ) + sizeof( QListViewItem ) * items.count() );
+ QDataStream stream( data, IO_WriteOnly );
+
+ stream << items.count();
+
+ QListViewItem *i = items.first();
+ while ( i ) {
+ stream << *i;
+ i = items.next();
+ }
+
+ setEncodedData( data );
+}
+
+bool ListViewItemDrag::canDecode( QDragMoveEvent * event )
+{
+ return event->provides( "qt/listviewitem" );
+}
+
+bool ListViewItemDrag::decode( QDropEvent * event, QListView * parent, QListViewItem * insertPoint, DropRelation dr )
+{
+ QByteArray data = event->encodedData( "qt/listviewitem" );
+ QListViewItem* itemParent = insertPoint ? insertPoint->parent() : 0;
+
+ // Change from sibling (default) to child creation
+ if ( insertPoint && dr == Child ) {
+ itemParent = insertPoint;
+ insertPoint = 0;
+ }
+
+ if ( data.size() ) {
+ event->accept();
+ QDataStream stream( data, IO_ReadOnly );
+
+ int count = 0;
+ stream >> count;
+
+ for( int i = 0; i < count; i++ ) {
+ if ( itemParent ) {
+ insertPoint = new QListViewItem( itemParent, insertPoint );
+ itemParent->setOpen( TRUE );
+ } else { // No parent for insertPoint, use QListView
+ insertPoint = new QListViewItem( parent, insertPoint );
+ }
+ stream >> *insertPoint;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+QDataStream & operator<< ( QDataStream & stream, const QListViewItem & item )
+{
+ int columns = item.listView()->columns();
+ stream << columns;
+
+ Q_UINT8 b = 0;
+
+ int i;
+ for ( i = 0; i < columns; i++ ) {
+ b = (Q_UINT8) ( item.text( i ) != QString::null ); // does column i have a string ?
+ stream << b;
+ if ( b ) {
+ stream << item.text( i );
+ }
+ }
+
+ for ( i = 0; i < columns; i++ ) {
+ b = (Q_UINT8) ( !!item.pixmap( i ) ); // does column i have a pixmap ?
+ stream << b;
+ if ( b ) {
+ stream << ( *item.pixmap( i ) );
+ }
+ }
+
+ stream << (Q_UINT8) item.isOpen();
+ stream << (Q_UINT8) item.isSelectable();
+ stream << (Q_UINT8) item.isExpandable();
+ stream << (Q_UINT8) item.dragEnabled();
+ stream << (Q_UINT8) item.dropEnabled();
+ stream << (Q_UINT8) item.isVisible();
+
+ for ( i = 0; i < columns; i++ ) {
+ stream << (Q_UINT8) item.renameEnabled( i );
+ }
+
+ stream << (Q_UINT8) item.multiLinesEnabled();
+ stream << item.childCount();
+
+ if ( item.childCount() > 0 ) {
+ QListViewItem * child = item.firstChild();
+ while ( child ) {
+ stream << ( *child ); // recursive call
+ child = child->nextSibling();
+ }
+ }
+
+ return stream;
+}
+
+QDataStream & operator>> ( QDataStream & stream, QListViewItem & item )
+{
+ Q_INT32 columns;
+ stream >> columns;
+
+ Q_UINT8 b = 0;
+
+ QString text;
+ int i;
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b;
+ if ( b ) { // column i has string ?
+ stream >> text;
+ item.setText( i, text );
+ }
+ }
+
+ QPixmap pixmap;
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b; // column i has pixmap ?
+ if ( b ) {
+ stream >> pixmap;
+ item.setPixmap( i, pixmap );
+ }
+ }
+
+ stream >> b;
+ item.setOpen( b );
+
+ stream >> b;
+ item.setSelectable( b );
+
+ stream >> b;
+ item.setExpandable( b );
+
+ stream >> b;
+ item.setDragEnabled( b );
+
+ stream >> b;
+ item.setDropEnabled( b );
+
+ stream >> b;
+ item.setVisible( b );
+
+ for ( i = 0; i < columns; i++ ) {
+ stream >> b;
+ item.setRenameEnabled( i, b );
+ }
+
+ stream >> b;
+ item.setMultiLinesEnabled( b );
+
+ int childCount;
+ stream >> childCount;
+
+ QListViewItem *child = 0;
+ QListViewItem *prevchild = 0;
+ for ( i = 0; i < childCount; i++ ) {
+ child = new QListViewItem( &item, prevchild );
+ stream >> ( *child );
+ item.insertItem( child );
+ prevchild = child;
+ }
+
+ return stream;
+}
diff --git a/kdevdesigner/designer/listviewdnd.h b/kdevdesigner/designer/listviewdnd.h
new file mode 100644
index 00000000..52b18091
--- /dev/null
+++ b/kdevdesigner/designer/listviewdnd.h
@@ -0,0 +1,66 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTVIEWDND_H
+#define LISTVIEWDND_H
+
+#include <qptrlist.h>
+#include <qlistview.h>
+#include "listdnd.h"
+
+class QWidget;
+class QListView;
+typedef QPtrList<QListViewItem> ListViewItemList;
+
+class ListViewDnd : public ListDnd
+{
+ Q_OBJECT
+public:
+ enum DragMode { Flat = 16 }; // see ListDnd::DragMode
+
+ ListViewDnd( QListView * eventSource, const char * name = 0 );
+
+signals:
+ void dropped( QListViewItem * );
+
+public slots:
+ void confirmDrop( QListViewItem * );
+
+protected:
+ virtual bool dropEvent( QDropEvent * event );
+ virtual bool mouseMoveEvent( QMouseEvent * event );
+ virtual void updateLine( const QPoint & pos );
+ virtual bool canDecode( QDragEnterEvent * event );
+private:
+ QListViewItem * itemAt( QPoint pos );
+ int dropDepth( QListViewItem * item, QPoint pos );
+ int buildFlatList( ListViewItemList & list );
+ int buildTreeList( ListViewItemList & list );
+ void setVisibleItems( bool b );
+ ListViewItemList disabledItems;
+};
+
+#endif //LISTVIEWDND_H
diff --git a/kdevdesigner/designer/listvieweditor.ui b/kdevdesigner/designer/listvieweditor.ui
new file mode 100644
index 00000000..d9e87240
--- /dev/null
+++ b/kdevdesigner/designer/listvieweditor.ui
@@ -0,0 +1,935 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ListViewEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ListViewEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>567</width>
+ <height>398</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Listview</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Listview&lt;/b&gt;&lt;p&gt;Use the controls on the &lt;b&gt;Items&lt;/b&gt;-tab to add, edit or delete items in the listview. Change the column configuration of the listview using the controls on the &lt;b&gt;Columns&lt;/b&gt;-tab.&lt;/p&gt;Click the &lt;b&gt;New Item&lt;/b&gt;-button to create a new item, then enter text and add a pixmap.&lt;/p&gt;&lt;p&gt;Select an item from the list and click the &lt;b&gt;Delete Item&lt;/b&gt;-button to remove the item from the list.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget10</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Items</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>itemDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Deletes the selected item.&lt;/b&gt;&lt;p&gt;Any sub-items are also deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="2" rowspan="8" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Item Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pi&amp;xmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemText</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>itemText</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Change the text of the item.&lt;/b&gt;&lt;p&gt;The text will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>itemColumn</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select the current column.&lt;/b&gt;&lt;p&gt;The item's text and pixmap will be changed for the current column&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label4</cstring>
+ </property>
+ <property name="text">
+ <string>Colu&amp;mn:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemColumn</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>itemPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemDeletePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>itemNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Item</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add an item</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Adds a new item to the list.&lt;/b&gt;&lt;p&gt;The item will be inserted at the top of the list and can be moved using the up- and down-buttons.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="0" column="0" rowspan="8" colspan="1">
+ <property name="name">
+ <cstring>itemsPreview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of items.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>itemNewSub</cstring>
+ </property>
+ <property name="text">
+ <string>New &amp;Subitem</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add a subitem</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create a new sub-item for the selected item.&lt;/b&gt;&lt;p&gt;New sub-items are inserted at the top of the list of sub-items, and new levels are created automatically.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing1</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>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>itemUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The item will be moved within its level in the hierarchy.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>itemDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The item will be moved within its level in the hierarchy.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>itemLeft</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_left.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move left</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item one level up.&lt;/b&gt;&lt;p&gt;This will also change the level of the item's sub-items.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>itemRight</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_right.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move right</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item one level down.&lt;/b&gt;&lt;p&gt;This will also change the level of the item's sub-items.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget11</cstring>
+ </property>
+ <attribute name="title">
+ <string>Co&amp;lumns</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="2" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Column Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>colPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>colDeletePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Delete the pixmap of the selected column.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>colChoosePixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the selected column.&lt;/b&gt;&lt;p&gt;The pixmap will be displayed in the header of the listview.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colText</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>colText</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter column text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter the text for the selected column.&lt;/b&gt;&lt;p&gt;The text will be displayed in the header of the listview.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>colClickable</cstring>
+ </property>
+ <property name="text">
+ <string>Clicka&amp;ble</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this option is checked, the selected column will react to mouse clicks on the header.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>colResizable</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;sizable</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The column's width will be resizable if this option is checked.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>colDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Column</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Deletes the selected Column.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>colDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column in the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>colNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Column</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add a Column</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create a new column.&lt;/b&gt;&lt;p&gt;New columns are appended at the end of (right of) the list and may be moved using the up- and down-buttons.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>colUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column in the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>colPreview</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The list of columns.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Vertical Spacing2</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>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>applyButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>itemNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemNewClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemDeleteClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemColumn</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemColChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>itemText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>itemDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemPixmapDeleted()</slot>
+ </connection>
+ <connection>
+ <sender>itemChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemPixmapChoosen()</slot>
+ </connection>
+ <connection>
+ <sender>colNew</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>newColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colDelete</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>deleteColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colUp</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colDown</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>colDeletePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnPixmapDeleted()</slot>
+ </connection>
+ <connection>
+ <sender>colChoosePixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnPixmapChosen()</slot>
+ </connection>
+ <connection>
+ <sender>colResizable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnResizable(bool)</slot>
+ </connection>
+ <connection>
+ <sender>colClickable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>columnClickable(bool)</slot>
+ </connection>
+ <connection>
+ <sender>tabWidget</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>initTabPage(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>applyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>colPreview</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentColumnChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>colPreview</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentColumnChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemsPreview</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemsPreview</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>itemNewSub</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemNewSubClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemLeft</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemLeftClicked()</slot>
+ </connection>
+ <connection>
+ <sender>itemRight</sender>
+ <signal>clicked()</signal>
+ <receiver>ListViewEditorBase</receiver>
+ <slot>itemRightClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>itemsPreview</tabstop>
+ <tabstop>itemNew</tabstop>
+ <tabstop>itemNewSub</tabstop>
+ <tabstop>itemDelete</tabstop>
+ <tabstop>itemUp</tabstop>
+ <tabstop>itemDown</tabstop>
+ <tabstop>itemLeft</tabstop>
+ <tabstop>itemRight</tabstop>
+ <tabstop>itemColumn</tabstop>
+ <tabstop>itemText</tabstop>
+ <tabstop>itemDeletePixmap</tabstop>
+ <tabstop>itemChoosePixmap</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>applyButton</tabstop>
+ <tabstop>colPreview</tabstop>
+ <tabstop>colNew</tabstop>
+ <tabstop>colDelete</tabstop>
+ <tabstop>colUp</tabstop>
+ <tabstop>colDown</tabstop>
+ <tabstop>colText</tabstop>
+ <tabstop>colDeletePixmap</tabstop>
+ <tabstop>colChoosePixmap</tabstop>
+ <tabstop>colClickable</tabstop>
+ <tabstop>colResizable</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">columnClickable(bool)</slot>
+ <slot access="protected">columnDownClicked()</slot>
+ <slot access="protected">columnPixmapChosen()</slot>
+ <slot access="protected">columnPixmapDeleted()</slot>
+ <slot access="protected">columnResizable(bool)</slot>
+ <slot access="protected">columnTextChanged(const QString &amp;)</slot>
+ <slot access="protected">columnUpClicked()</slot>
+ <slot access="protected">currentColumnChanged(QListBoxItem*)</slot>
+ <slot access="protected">currentItemChanged(QListViewItem*)</slot>
+ <slot access="protected">deleteColumnClicked()</slot>
+ <slot access="protected">initTabPage(const QString &amp;)</slot>
+ <slot access="protected">itemColChanged(int)</slot>
+ <slot access="protected">itemDeleteClicked()</slot>
+ <slot access="protected">itemDownClicked()</slot>
+ <slot access="protected">itemLeftClicked()</slot>
+ <slot access="protected">itemNewClicked()</slot>
+ <slot access="protected">itemNewSubClicked()</slot>
+ <slot access="protected">itemPixmapChoosen()</slot>
+ <slot access="protected">itemPixmapDeleted()</slot>
+ <slot access="protected">itemTextChanged(const QString &amp;)</slot>
+ <slot access="protected">itemUpClicked()</slot>
+ <slot access="protected">newColumnClicked()</slot>
+ <slot access="protected">itemRightClicked()</slot>
+ <slot access="protected">okClicked()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/listvieweditorimpl.cpp b/kdevdesigner/designer/listvieweditorimpl.cpp
new file mode 100644
index 00000000..78055f92
--- /dev/null
+++ b/kdevdesigner/designer/listvieweditorimpl.cpp
@@ -0,0 +1,650 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "listvieweditorimpl.h"
+#include "pixmapchooser.h"
+#include "command.h"
+#include "listviewdnd.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <qlistview.h>
+#include <qheader.h>
+#include <qlistbox.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qtabwidget.h>
+#include <qspinbox.h>
+#include <qpushbutton.h>
+#include <qptrstack.h>
+
+#include <klocale.h>
+
+ListViewEditor::ListViewEditor( QWidget *parent, QListView *lv, FormWindow *fw )
+ : ListViewEditorBase( parent, 0, TRUE ), listview( lv ), formwindow( fw )
+{
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+
+ setupColumns();
+ PopulateListViewCommand::transferItems( listview, itemsPreview );
+ setupItems();
+
+ itemsPreview->setShowSortIndicator( listview->showSortIndicator() );
+ itemsPreview->setAllColumnsShowFocus( listview->allColumnsShowFocus() );
+ itemsPreview->setRootIsDecorated( listview->rootIsDecorated() );
+
+ if ( itemsPreview->firstChild() ) {
+ itemsPreview->setCurrentItem( itemsPreview->firstChild() );
+ itemsPreview->setSelected( itemsPreview->firstChild(), TRUE );
+ }
+
+ // Clamp on drag and drop to QListView
+ ListViewDnd *itemsDnd = new ListViewDnd( itemsPreview );
+ itemsDnd->setDragMode( ListViewDnd::Internal | ListViewDnd::Move );
+ QObject::connect( itemsDnd, SIGNAL( dropped( QListViewItem * ) ),
+ itemsDnd, SLOT( confirmDrop( QListViewItem * ) ) );
+
+ // Enable rename for all QListViewItems
+ QListViewItemIterator it = ((QListView *)itemsPreview)->firstChild();
+ for ( ; *it; it++ )
+ (*it)->setRenameEnabled( 0, TRUE );
+
+ // Connect listview signal to signal-relay
+ QObject::connect( itemsPreview,
+ SIGNAL( itemRenamed( QListViewItem*, int, const QString & ) ),
+ this,
+ SLOT( emitItemRenamed(QListViewItem*, int, const QString&) ) );
+
+ // Connect signal-relay to QLineEdit "itemText"
+ QObjectList *l = parent->queryList( "QLineEdit", "itemText" );
+ QObject *obj;
+ QObjectListIt itemsLineEditIt( *l );
+ while ( (obj = itemsLineEditIt.current()) != 0 ) {
+ ++itemsLineEditIt;
+ QObject::connect( this,
+ SIGNAL( itemRenamed( const QString & ) ),
+ obj,
+ SLOT( setText( const QString & ) ) );
+ }
+ delete l;
+
+ // Clamp on drag and drop to QListBox
+ ListBoxDnd *columnsDnd = new ListBoxDnd( colPreview );
+ columnsDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ QObject::connect( columnsDnd, SIGNAL( dropped( QListBoxItem * ) ),
+ columnsDnd, SLOT( confirmDrop( QListBoxItem * ) ) );
+
+ // Clamp on rename to QListBox
+ ListBoxRename *columnsRename = new ListBoxRename( colPreview );
+ QObject::connect( columnsRename,
+ SIGNAL( itemTextChanged( const QString & ) ),
+ this,
+ SLOT( columnTextChanged( const QString & ) ) );
+
+ // Find QLineEdit "colText" and connect
+ l = parent->queryList( "QLineEdit", "colText" );
+ QObjectListIt columnsLineEditIt( *l );
+ while ( (obj = columnsLineEditIt.current()) != 0 ) {
+ ++columnsLineEditIt;
+ QObject::connect( columnsRename,
+ SIGNAL( itemTextChanged( const QString & ) ),
+ obj,
+ SLOT( setText( const QString & ) ) );
+ }
+ delete l;
+}
+
+void ListViewEditor::applyClicked()
+{
+ setupItems();
+ PopulateListViewCommand *cmd = new PopulateListViewCommand( i18n( "Edit the Items and Columns of '%1'" ).arg( listview->name() ),
+ formwindow, listview, itemsPreview );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void ListViewEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void ListViewEditor::columnClickable( bool b )
+{
+ Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+ c->clickable = b;
+}
+
+void ListViewEditor::columnDownClicked()
+{
+ if ( colPreview->currentItem() == -1 ||
+ colPreview->currentItem() > (int)colPreview->count() - 2 )
+ return;
+
+ colPreview->clearSelection();
+ QListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ QListBoxItem *below = i->next();
+
+ colPreview->takeItem( i );
+ colPreview->insertItem( i, below );
+
+ colPreview->setCurrentItem( i );
+ colPreview->setSelected( i, TRUE );
+}
+
+void ListViewEditor::columnPixmapChosen()
+{
+ Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ QPixmap pix;
+ if ( colPixmap->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *colPixmap->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ c->pixmap = pix;
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPixmap->setPixmap( c->pixmap );
+ colPreview->blockSignals( FALSE );
+ colDeletePixmap->setEnabled( TRUE );
+}
+
+void ListViewEditor::columnPixmapDeleted()
+{
+ Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ c->pixmap = QPixmap();
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPixmap->setText( "" );
+ colPreview->blockSignals( FALSE );
+ colDeletePixmap->setEnabled( FALSE );
+}
+
+void ListViewEditor::columnResizable( bool b )
+{
+ Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+ c->resizable = b;
+}
+
+void ListViewEditor::columnTextChanged( const QString &txt )
+{
+ Column *c = findColumn( colPreview->item( colPreview->currentItem() ) );
+ if ( !c )
+ return;
+
+ c->text = txt;
+ colPreview->blockSignals( TRUE );
+ if ( !c->pixmap.isNull() )
+ colPreview->changeItem( c->pixmap, c->text, colPreview->index( c->item ) );
+ else
+ colPreview->changeItem( c->text, colPreview->index( c->item ) );
+ c->item = colPreview->item( colPreview->currentItem() );
+ colPreview->blockSignals( FALSE );
+}
+
+void ListViewEditor::columnUpClicked()
+{
+ if ( colPreview->currentItem() <= 0 )
+ return;
+
+ colPreview->clearSelection();
+ QListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ QListBoxItem *above = i->prev();
+
+ colPreview->takeItem( above );
+ colPreview->insertItem( above, i );
+
+ colPreview->setCurrentItem( i );
+ colPreview->setSelected( i, TRUE );
+}
+
+void ListViewEditor::currentColumnChanged( QListBoxItem *i )
+{
+ Column *c = findColumn( i );
+ if ( !i || !c ) {
+ colText->setEnabled( FALSE );
+ colPixmap->setEnabled( FALSE );
+ colDeletePixmap->setEnabled( FALSE );
+ colText->blockSignals( TRUE );
+ colText->setText( "" );
+ colText->blockSignals( FALSE );
+ colClickable->setEnabled( FALSE );
+ colResizable->setEnabled( FALSE );
+ return;
+ }
+
+ colText->setEnabled( TRUE );
+ colPixmap->setEnabled( TRUE );
+ colDeletePixmap->setEnabled( i->pixmap() && !i->pixmap()->isNull() );
+ colClickable->setEnabled( TRUE );
+ colResizable->setEnabled( TRUE );
+
+ colText->blockSignals( TRUE );
+ colText->setText( c->text );
+ colText->blockSignals( FALSE );
+ if ( !c->pixmap.isNull() )
+ colPixmap->setPixmap( c->pixmap );
+ else
+ colPixmap->setText( "" );
+ colClickable->setChecked( c->clickable );
+ colResizable->setChecked( c->resizable );
+}
+
+void ListViewEditor::newColumnClicked()
+{
+ Column col;
+ col.text = i18n( "New Column" );
+ col.pixmap = QPixmap();
+ col.clickable = TRUE;
+ col.resizable = TRUE;
+ if ( !col.pixmap.isNull() )
+ col.item = new QListBoxPixmap( colPreview, col.pixmap, col.text );
+ else
+ col.item = new QListBoxText( colPreview, col.text );
+ columns.append( col );
+ colPreview->setCurrentItem( col.item );
+ colPreview->setSelected( col.item, TRUE );
+}
+
+void ListViewEditor::deleteColumnClicked()
+{
+ QListBoxItem *i = colPreview->item( colPreview->currentItem() );
+ if ( !i )
+ return;
+
+ for ( QValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ if ( ( *it ).item == i ) {
+ delete (*it).item;
+ columns.remove( it );
+ break;
+ }
+ }
+
+ if ( colPreview->currentItem() != -1 )
+ colPreview->setSelected( colPreview->currentItem(), TRUE );
+}
+
+void ListViewEditor::currentItemChanged( QListViewItem *i )
+{
+ if ( !i ) {
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+ return;
+ }
+
+ itemText->setEnabled( TRUE );
+ itemChoosePixmap->setEnabled( TRUE );
+ itemDeletePixmap->setEnabled( i->pixmap( itemColumn->value() ) &&
+ !i->pixmap( itemColumn->value() )->isNull() );
+ itemColumn->setEnabled( TRUE );
+
+ displayItem( i, itemColumn->value() );
+}
+
+void ListViewEditor::displayItem( QListViewItem *i, int col )
+{
+ itemText->blockSignals( TRUE );
+ itemText->setText( i->text( col ) );
+ itemText->blockSignals( FALSE );
+
+ itemPixmap->blockSignals( TRUE );
+ if ( i->pixmap( col ) )
+ itemPixmap->setPixmap( *i->pixmap( col ) );
+ else
+ itemPixmap->setText( "" );
+ itemPixmap->blockSignals( FALSE );
+}
+
+void ListViewEditor::itemColChanged( int col )
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ displayItem( i, col );
+ itemDeletePixmap->setEnabled( i->pixmap( col ) && !i->pixmap( col )->isNull() );
+}
+
+void ListViewEditor::itemDeleteClicked()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ delete i;
+ if ( itemsPreview->firstChild() ) {
+ itemsPreview->setCurrentItem( itemsPreview->firstChild() );
+ itemsPreview->setSelected( itemsPreview->firstChild(), TRUE );
+ }
+}
+
+void ListViewEditor::itemDownClicked()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ it++;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ it++;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ i->moveItem( other );
+}
+
+void ListViewEditor::itemNewClicked()
+{
+ QListViewItem *item = new QListViewItem( itemsPreview );
+ item->setText( 0, i18n( "Item" ) );
+ item->setRenameEnabled( 0, TRUE );
+ itemsPreview->setCurrentItem( item );
+ itemsPreview->setSelected( item, TRUE );
+ itemText->setFocus();
+ itemText->selectAll();
+}
+
+void ListViewEditor::itemNewSubClicked()
+{
+ QListViewItem *parent = itemsPreview->currentItem();
+ QListViewItem *item = 0;
+ if ( parent ) {
+ item = new QListViewItem( parent );
+ parent->setOpen( TRUE );
+ } else {
+ item = new QListViewItem( itemsPreview );
+ }
+ item->setText( 0, i18n( "Subitem" ) );
+ item->setRenameEnabled( 0, TRUE );
+ itemsPreview->setCurrentItem( item );
+ itemsPreview->setSelected( item, TRUE );
+}
+
+void ListViewEditor::itemPixmapChoosen()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ QPixmap pix;
+ if ( itemPixmap->pixmap() )
+ pix = qChoosePixmap( this, formwindow, *itemPixmap->pixmap() );
+ else
+ pix = qChoosePixmap( this, formwindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+ i->setPixmap( itemColumn->value(), QPixmap( pix ) );
+ itemPixmap->setPixmap( pix );
+ itemDeletePixmap->setEnabled( TRUE );
+}
+
+void ListViewEditor::itemPixmapDeleted()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ i->setPixmap( itemColumn->value(), QPixmap() );
+ itemPixmap->setText( "" );
+ itemDeletePixmap->setEnabled( FALSE );
+}
+
+void ListViewEditor::itemTextChanged( const QString &txt )
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+ i->setText( itemColumn->value(), txt );
+}
+
+void ListViewEditor::itemUpClicked()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ --it;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ --it;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ other->moveItem( i );
+}
+
+void ListViewEditor::itemRightClicked()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ parent = parent ? parent->firstChild() : itemsPreview->firstChild();
+ if ( !parent )
+ return;
+ it++;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ it++;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ for ( int c = 0; c < itemsPreview->columns(); ++c ) {
+ QString s = i->text( c );
+ i->setText( c, other->text( c ) );
+ other->setText( c, s );
+ QPixmap pix;
+ if ( i->pixmap( c ) )
+ pix = *i->pixmap( c );
+ if ( other->pixmap( c ) )
+ i->setPixmap( c, *other->pixmap( c ) );
+ else
+ i->setPixmap( c, QPixmap() );
+ other->setPixmap( c, pix );
+ }
+
+ itemsPreview->setCurrentItem( other );
+ itemsPreview->setSelected( other, TRUE );
+}
+
+void ListViewEditor::itemLeftClicked()
+{
+ QListViewItem *i = itemsPreview->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ if ( !parent )
+ return;
+ parent = parent->parent();
+ --it;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ --it;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ for ( int c = 0; c < itemsPreview->columns(); ++c ) {
+ QString s = i->text( c );
+ i->setText( c, other->text( c ) );
+ other->setText( c, s );
+ QPixmap pix;
+ if ( i->pixmap( c ) )
+ pix = *i->pixmap( c );
+ if ( other->pixmap( c ) )
+ i->setPixmap( c, *other->pixmap( c ) );
+ else
+ i->setPixmap( c, QPixmap() );
+ other->setPixmap( c, pix );
+ }
+
+ itemsPreview->setCurrentItem( other );
+ itemsPreview->setSelected( other, TRUE );
+}
+
+void ListViewEditor::setupColumns()
+{
+ QHeader *h = listview->header();
+ for ( int i = 0; i < (int)h->count(); ++i ) {
+ Column col;
+ col.text = h->label( i );
+ col.pixmap = QPixmap();
+ if ( h->iconSet( i ) )
+ col.pixmap = h->iconSet( i )->pixmap();
+ col.clickable = h->isClickEnabled( i );
+ col.resizable = h->isResizeEnabled( i );
+ if ( !col.pixmap.isNull() )
+ col.item = new QListBoxPixmap( colPreview, col.pixmap, col.text );
+ else
+ col.item = new QListBoxText( colPreview, col.text );
+ columns.append( col );
+ }
+
+ colText->setEnabled( FALSE );
+ colPixmap->setEnabled( FALSE );
+ colClickable->setEnabled( FALSE );
+ colResizable->setEnabled( FALSE );
+
+ if ( colPreview->firstItem() )
+ colPreview->setCurrentItem( colPreview->firstItem() );
+ numColumns = colPreview->count();
+}
+
+void ListViewEditor::setupItems()
+{
+ itemColumn->setMinValue( 0 );
+ itemColumn->setMaxValue( QMAX( numColumns - 1, 0 ) );
+ int i = 0;
+ QHeader *header = itemsPreview->header();
+ for ( QListBoxItem *item = colPreview->firstItem(); item; item = item->next() ) {
+ Column *col = findColumn( item );
+ if ( !col )
+ continue;
+ if ( i >= itemsPreview->columns() )
+ itemsPreview->addColumn( col->text );
+ header->setLabel( i, col->pixmap, col->text );
+ header->setResizeEnabled( col->resizable, i );
+ header->setClickEnabled( col->clickable, i );
+ ++i;
+ }
+ while ( itemsPreview->columns() > i )
+ itemsPreview->removeColumn( i );
+
+ itemColumn->setValue( QMIN( numColumns - 1, itemColumn->value() ) );
+}
+
+ListViewEditor::Column *ListViewEditor::findColumn( QListBoxItem *i )
+{
+ if ( !i )
+ return 0;
+
+ for ( QValueList<Column>::Iterator it = columns.begin(); it != columns.end(); ++it ) {
+ if ( ( *it ).item == i )
+ return &( *it );
+ }
+
+ return 0;
+}
+
+void ListViewEditor::initTabPage( const QString &page )
+{
+ numColumns = colPreview->count();
+ if ( page == i18n( "&Items" ) ) {
+ setupItems();
+ if ( numColumns == 0 ) {
+ itemNew->setEnabled( FALSE );
+ itemNewSub->setEnabled( FALSE );
+ itemText->setEnabled( FALSE );
+ itemChoosePixmap->setEnabled( FALSE );
+ itemDeletePixmap->setEnabled( FALSE );
+ itemColumn->setEnabled( FALSE );
+ } else {
+ itemNew->setEnabled( TRUE );
+ itemNewSub->setEnabled( TRUE );
+ }
+ }
+}
+
+void ListViewEditor::emitItemRenamed( QListViewItem *, int, const QString & text )
+{
+ emit itemRenamed( text ); // Relay signal ( to QLineEdit )
+}
diff --git a/kdevdesigner/designer/listvieweditorimpl.h b/kdevdesigner/designer/listvieweditorimpl.h
new file mode 100644
index 00000000..476e47ca
--- /dev/null
+++ b/kdevdesigner/designer/listvieweditorimpl.h
@@ -0,0 +1,102 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LISTVIEWEDITORIMPL_H
+#define LISTVIEWEDITORIMPL_H
+
+#include "listvieweditor.h"
+
+#include <qmap.h>
+#include <qpixmap.h>
+#include <qvaluelist.h>
+
+class FormWindow;
+
+class ListViewEditor : public ListViewEditorBase
+{
+ Q_OBJECT
+
+public:
+ ListViewEditor( QWidget *parent, QListView *lv, FormWindow *fw );
+
+signals:
+ void itemRenamed(const QString &);
+
+protected slots:
+ void applyClicked();
+ void columnClickable(bool);
+ void columnDownClicked();
+ void columnPixmapChosen();
+ void columnPixmapDeleted();
+ void columnResizable(bool);
+ void columnTextChanged(const QString &);
+ void columnUpClicked();
+ void currentColumnChanged(QListBoxItem*);
+ void currentItemChanged(QListViewItem*);
+ void deleteColumnClicked();
+ void itemColChanged(int);
+ void itemDeleteClicked();
+ void itemDownClicked();
+ void itemNewClicked();
+ void itemNewSubClicked();
+ void itemPixmapChoosen();
+ void itemPixmapDeleted();
+ void itemTextChanged(const QString &);
+ void itemUpClicked();
+ void itemLeftClicked();
+ void itemRightClicked();
+ void newColumnClicked();
+ void okClicked();
+ void initTabPage(const QString &page);
+ void emitItemRenamed(QListViewItem*, int, const QString&); // signal relay
+
+private:
+ struct Column
+ {
+ QListBoxItem *item;
+ QString text;
+ QPixmap pixmap;
+ bool clickable, resizable;
+ Q_DUMMY_COMPARISON_OPERATOR( Column )
+ };
+
+private:
+ void setupColumns();
+ void setupItems();
+ Column *findColumn( QListBoxItem *i );
+ void transferItems( QListView *from, QListView *to );
+ void displayItem( QListViewItem *i, int col );
+
+private:
+ QListView *listview;
+ QValueList<Column> columns;
+ int numColumns;
+ FormWindow *formwindow;
+
+};
+
+
+#endif
diff --git a/kdevdesigner/designer/mainwindow.cpp b/kdevdesigner/designer/mainwindow.cpp
new file mode 100644
index 00000000..530d9b07
--- /dev/null
+++ b/kdevdesigner/designer/mainwindow.cpp
@@ -0,0 +1,3784 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "designerappiface.h"
+#include "designerapp.h"
+
+#include "mainwindow.h"
+#include "defs.h"
+#include "globaldefs.h"
+#include "formwindow.h"
+#include "widgetdatabase.h"
+#include "widgetfactory.h"
+#include "propertyeditor.h"
+#include "metadatabase.h"
+#include "resource.h"
+#include "hierarchyview.h"
+#include "newformimpl.h"
+#include "workspace.h"
+#include "about.h"
+#include "multilineeditorimpl.h"
+#include "wizardeditorimpl.h"
+#include "outputwindow.h"
+#include "actioneditorimpl.h"
+#include "actiondnd.h"
+#include "project.h"
+#include "projectsettingsimpl.h"
+#include "qwidgetfactory.h"
+#include "pixmapcollection.h"
+#include "qcompletionedit.h"
+#include "sourcefile.h"
+#include "orderindicator.h"
+#include <qtoolbox.h>
+#include "widgetaction.h"
+#include "propertyobject.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+#include "startdialog.h"
+#include "createtemplate.h"
+#include "editfunctions.h"
+//#include "connectionviewer.h"
+#include "formsettings.h"
+#include "preferences.h"
+#include "pixmapcollectioneditor.h"
+#ifndef QT_NO_SQL
+#include "dbconnectionimpl.h"
+#endif
+//#include "connectioneditor.h"
+#include "customwidgeteditorimpl.h"
+#include "paletteeditorimpl.h"
+#include "listboxeditorimpl.h"
+#include "listvieweditorimpl.h"
+#include "iconvieweditorimpl.h"
+#include "tableeditorimpl.h"
+#include "multilineeditor.h"
+#include "finddialog.h"
+#include "replacedialog.h"
+#include "gotolinedialog.h"
+#include "designeraction.h"
+
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include <qinputdialog.h>
+#include <qtoolbar.h>
+#include <qfeatures.h>
+#include <qmetaobject.h>
+#include <qaction.h>
+#include <qpixmap.h>
+#include <qworkspace.h>
+#include <qfiledialog.h>
+#include <qclipboard.h>
+#include <qmessagebox.h>
+#include <qbuffer.h>
+#include <qdir.h>
+#include <qstyle.h>
+#include <qlabel.h>
+#include <qstatusbar.h>
+#include <qfile.h>
+#include <qcheckbox.h>
+#include <qwhatsthis.h>
+#include <qwizard.h>
+#include <qtimer.h>
+#include <qlistbox.h>
+#include <qdockwindow.h>
+#include <qstylefactory.h>
+#include <qvbox.h>
+#include <qprocess.h>
+#include <qsettings.h>
+#include <qaccel.h>
+#include <qtooltip.h>
+#include <qsizegrip.h>
+#include <qtextview.h>
+#include <qassistantclient.h>
+#include <stdlib.h>
+
+#include "kdevdesigner_part.h"
+
+static bool mblockNewForms = FALSE;
+extern QMap<QWidget*, QString> *qwf_forms;
+extern QString *qwf_language;
+extern bool qwf_execute_code;
+extern bool qwf_stays_on_top;
+extern void set_splash_status( const QString &txt );
+extern QObject* qwf_form_object;
+extern QString *qwf_plugin_dir;
+
+MainWindow *MainWindow::self = 0;
+
+QString assistantPath()
+{
+ QString path = QDir::cleanDirPath( QString( qInstallPathBins() ) +
+ QDir::separator() );
+ return path;
+}
+
+
+static QString textNoAccel( const QString& text)
+{
+ QString t = text;
+ int i;
+ while ( (i = t.find('&') )>= 0 ) {
+ t.remove(i,1);
+ }
+ return t;
+}
+
+
+MainWindow::MainWindow( KDevDesignerPart *part, bool asClient, bool single, const QString &plgDir )
+ : QMainWindow( 0, "designer_mainwindow"/*, WType_TopLevel | (single ? 0 : WDestructiveClose) | WGroupLeader*/ ),
+ grd( 10, 10 ), sGrid( TRUE ), snGrid( TRUE ), restoreConfig( TRUE ), splashScreen( TRUE ),
+ fileFilter( i18n( "Qt User-Interface Files (*.ui)" ) ), client( asClient ),
+ previewing( FALSE ), databaseAutoEdit( FALSE ), autoSaveEnabled( FALSE ), autoSaveInterval( 1800 ), m_part(part)
+{
+// extern void qInitImages_designercore();
+// qInitImages_designercore();
+
+ self = this;
+ setPluginDirectory( plgDir );
+ customWidgetToolBar = customWidgetToolBar2 = 0;
+ guiStuffVisible = TRUE;
+ editorsReadOnly = FALSE;
+ sSignalHandlers = TRUE;
+ init_colors();
+ shStartDialog = FALSE;
+
+ desInterface = new DesignerInterfaceImpl( this );
+ desInterface->addRef();
+ inDebugMode = FALSE;
+ savePluginPaths = FALSE;
+
+ updateFunctionsTimer = new QTimer( this );
+ connect( updateFunctionsTimer, SIGNAL( timeout() ),
+ this, SLOT( doFunctionsChanged() ) );
+
+ autoSaveTimer = new QTimer( this );
+ connect( autoSaveTimer, SIGNAL( timeout() ),
+ this, SLOT( fileSaveAll() ) );
+
+ set_splash_status( "Loading Plugins..." );
+ setupPluginManagers();
+
+/* if ( !single )
+ qApp->setMainWidget( this );*/
+ QWidgetFactory::addWidgetFactory( new CustomWidgetFactory );
+#ifndef Q_WS_MACX
+ setIcon( BarIcon( "designer_appicon.png", KDevDesignerPartFactory::instance() ) );
+#endif
+
+ actionGroupTools = 0;
+ prefDia = 0;
+ windowMenu = 0;
+ hierarchyView = 0;
+ actionEditor = 0;
+ currentProject = 0;
+ wspace = 0;
+ oWindow = 0;
+ singleProject = single;
+
+ statusBar()->clear();
+#if defined(QT_NON_COMMERCIAL)
+ statusBar()->addWidget( new QLabel(i18n("Ready - This is the non-commercial version of Qt - "
+ "For commercial evaluations, use the help menu to register with Trolltech."), statusBar()), 1 );
+#else
+ statusBar()->addWidget( new QLabel("Ready", statusBar()), 1 );
+#endif
+
+
+ set_splash_status( "Setting up GUI..." );
+ setupMDI();
+ setupMenuBar();
+
+ setupToolbox();
+
+ setupFileActions();
+ setupEditActions();
+ setupProjectActions();
+ setupSearchActions();
+ layoutToolBar = new QToolBar( this, "Layout" );
+ layoutToolBar->setCloseMode( QDockWindow::Undocked );
+ addToolBar( layoutToolBar, i18n( "Layout" ) );
+ interpreterPluginManager = 0;
+ setupToolActions();
+ setupLayoutActions();
+ setupPreviewActions();
+ setupOutputWindow();
+ setupActionManager();
+ setupWindowActions();
+
+ setupWorkspace();
+ setupHierarchyView();
+ setupPropertyEditor();
+ setupActionEditor();
+
+ setupHelpActions();
+
+ setupRMBMenus();
+
+ connect( this, SIGNAL( projectChanged() ), this, SLOT( emitProjectSignals() ) );
+ connect( this, SIGNAL( hasActiveWindow(bool) ), this, SLOT( emitProjectSignals() ) );
+
+ emit hasActiveForm( FALSE );
+ emit hasActiveWindow( FALSE );
+
+ lastPressWidget = 0;
+ qApp->installEventFilter( this );
+
+ QSize as( qApp->desktop()->size() );
+ as -= QSize( 30, 30 );
+ resize( QSize( 1200, 1000 ).boundedTo( as ) );
+
+ connect( qApp->clipboard(), SIGNAL( dataChanged() ),
+ this, SLOT( clipboardChanged() ) );
+ clipboardChanged();
+ layoutChilds = FALSE;
+ layoutSelected = FALSE;
+ breakLayout = FALSE;
+ backPix = TRUE;
+
+ set_splash_status( "Loading User Settings..." );
+ readConfig();
+ // hack to make WidgetFactory happy (so it knows QWidget and QDialog for resetting properties)
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QWidget" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QDialog" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLabel" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QTabWidget" ), this, 0, FALSE );
+ delete w;
+ w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QFrame" ), this, 0, FALSE );
+ delete w;
+ setAppropriate( (QDockWindow*)actionEditor->parentWidget(), FALSE );
+ actionEditor->parentWidget()->hide();
+
+ assistant = new QAssistantClient( assistantPath(), this );
+
+ statusBar()->setSizeGripEnabled( TRUE );
+ set_splash_status( "Initialization Done." );
+/* if ( shStartDialog )
+ QTimer::singleShot( 0, this, SLOT( showStartDialog() ));*/
+
+ if ( autoSaveEnabled )
+ autoSaveTimer->start( autoSaveInterval * 1000 );
+
+ setFocusPolicy( StrongFocus );
+}
+
+MainWindow::~MainWindow()
+{
+ QValueList<Tab>::Iterator tit;
+ for ( tit = preferenceTabs.begin(); tit != preferenceTabs.end(); ++tit ) {
+ Tab t = *tit;
+ delete t.w;
+ }
+ for ( tit = projectTabs.begin(); tit != projectTabs.end(); ++tit ) {
+ Tab t = *tit;
+ delete t.w;
+ }
+
+ QMap< QAction*, Project* >::Iterator it = projects.begin();
+ while ( it != projects.end() ) {
+ Project *p = *it;
+ ++it;
+ delete p;
+ }
+ projects.clear();
+
+ delete oWindow;
+ oWindow = 0;
+
+ desInterface->release();
+ desInterface = 0;
+
+ delete actionPluginManager;
+ delete preferencePluginManager;
+ delete projectSettingsPluginManager;
+ delete interpreterPluginManager;
+ delete templateWizardPluginManager;
+ delete editorPluginManager;
+ delete sourceTemplatePluginManager;
+
+ MetaDataBase::clearDataBase();
+ if(self == this)
+ self = 0;
+}
+
+void MainWindow::setupMDI()
+{
+ QVBox *vbox = new QVBox( this );
+ setCentralWidget( vbox );
+ vbox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ vbox->setMargin( 1 );
+ vbox->setLineWidth( 1 );
+ qworkspace = new QWorkspace( vbox );
+ qworkspace->setPaletteBackgroundPixmap( UserIcon( "designer_background.png", KDevDesignerPartFactory::instance() ) );
+ qworkspace->setScrollBarsEnabled( TRUE );
+ connect( qworkspace, SIGNAL( windowActivated( QWidget * ) ),
+ this, SLOT( activeWindowChanged( QWidget * ) ) );
+ lastActiveFormWindow = 0;
+ qworkspace->setAcceptDrops( TRUE );
+}
+
+void MainWindow::setupMenuBar()
+{
+ menubar = menuBar();
+}
+
+void MainWindow::setupPropertyEditor()
+{
+ QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ propertyEditor = new PropertyEditor( dw );
+ addToolBar( dw, Qt::DockRight );
+ dw->setWidget( propertyEditor );
+ dw->setFixedExtentWidth( 250 );
+ dw->setCaption( i18n( "Property Editor/Signal Handlers" ) );
+ QWhatsThis::add( propertyEditor,
+ i18n("<b>The Property Editor</b>"
+ "<p>You can change the appearance and behavior of the selected widget in the "
+ "property editor.</p>"
+ "<p>You can set properties for components and forms at design time and see the "
+ "immediately see the effects of the changes. "
+ "Each property has its own editor which (depending on the property) can be used "
+ "to enter "
+ "new values, open a special dialog, or to select values from a predefined list. "
+ "Click <b>F1</b> to get detailed help for the selected property.</p>"
+ "<p>You can resize the columns of the editor by dragging the separators in the "
+ "list's header.</p>"
+ "<p><b>Signal Handlers</b></p>"
+ "<p>In the Signal Handlers tab you can define connections between "
+ "the signals emitted by widgets and the slots in the form. "
+ "(These connections can also be made using the connection tool.)" ) );
+ dw->show();
+}
+
+void MainWindow::setupOutputWindow()
+{
+ QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ addToolBar( dw, Qt::DockBottom );
+ oWindow = new OutputWindow( dw );
+ dw->setWidget( oWindow );
+ dw->setFixedExtentHeight( 150 );
+ dw->setCaption( i18n( "Output Window" ) );
+}
+
+void MainWindow::setupHierarchyView()
+{
+ if ( hierarchyView )
+ return;
+ QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ hierarchyView = new HierarchyView( dw );
+ addToolBar( dw, Qt::DockRight );
+ dw->setWidget( hierarchyView );
+
+ dw->setCaption( i18n( "Object Explorer" ) );
+ dw->setFixedExtentWidth( 250 );
+ QWhatsThis::add( hierarchyView,
+ i18n("<b>The Object Explorer</b>"
+ "<p>The Object Explorer provides an overview of the relationships "
+ "between the widgets in a form. You can use the clipboard functions using "
+ "a context menu for each item in the view. It is also useful for selecting widgets "
+ "in forms that have complex layouts.</p>"
+ "<p>The columns can be resized by dragging the separator in the list's header.</p>"
+ "<p>The second tab shows all the form's slots, class variables, includes, etc.</p>") );
+ dw->show();
+}
+
+void MainWindow::setupWorkspace()
+{
+ QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ QVBox *vbox = new QVBox( dw );
+ QCompletionEdit *edit = new QCompletionEdit( vbox );
+ QToolTip::add( edit, i18n( "Start typing the buffer you want to switch to here (ALT+B)" ) );
+ QAccel *a = new QAccel( this );
+ a->connectItem( a->insertItem( ALT + Key_B ), edit, SLOT( setFocus() ) );
+ wspace = new Workspace( vbox, this );
+ wspace->setBufferEdit( edit );
+ wspace->setCurrentProject( currentProject );
+ addToolBar( dw, Qt::DockRight );
+ dw->setWidget( vbox );
+
+ dw->setCaption( i18n( "Project Overview" ) );
+ QWhatsThis::add( wspace, i18n("<b>The Project Overview Window</b>"
+ "<p>The Project Overview Window displays all the current "
+ "project, including forms and source files.</p>"
+ "<p>Use the search field to rapidly switch between files.</p>"));
+ dw->setFixedExtentHeight( 100 );
+ dw->show();
+}
+
+void MainWindow::setupActionEditor()
+{
+ QDockWindow *dw = new QDockWindow( QDockWindow::OutsideDock, this, 0 );
+ addDockWindow( dw, Qt::DockTornOff );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ actionEditor = new ActionEditor( dw );
+ dw->setWidget( actionEditor );
+ actionEditor->show();
+ dw->setCaption( i18n( "Action Editor" ) );
+ QWhatsThis::add( actionEditor, i18n("<b>The Action Editor</b>"
+ "<p>The Action Editor is used to add actions and action groups to "
+ "a form, and to connect actions to slots. Actions and action "
+ "groups can be dragged into menus and into toolbars, and may "
+ "feature keyboard shortcuts and tooltips. If actions have pixmaps "
+ "these are displayed on toolbar buttons and besides their names in "
+ "menus.</p>" ) );
+ dw->hide();
+ setAppropriate( dw, FALSE );
+}
+
+void MainWindow::setupToolbox()
+{
+ QDockWindow *dw = new QDockWindow( QDockWindow::InDock, this );
+ dw->setResizeEnabled( TRUE );
+ dw->setCloseMode( QDockWindow::Always );
+ addToolBar( dw, Qt::DockLeft );
+ toolBox = new QToolBox( dw );
+ dw->setWidget( toolBox );
+ dw->setFixedExtentWidth( 160 );
+ dw->setCaption( i18n( "Toolbox" ) );
+ dw->show();
+ setDockEnabled( dw, Qt::DockTop, FALSE );
+ setDockEnabled( dw, Qt::DockBottom, FALSE );
+ commonWidgetsToolBar = new QToolBar( "Common Widgets", 0, toolBox, FALSE, "Common Widgets" );
+ commonWidgetsToolBar->setFrameStyle( QFrame::NoFrame );
+ commonWidgetsToolBar->setOrientation( Qt::Vertical );
+ commonWidgetsToolBar->setBackgroundMode(PaletteBase);
+ toolBox->addItem( commonWidgetsToolBar, "Common Widgets" );
+}
+
+void MainWindow::setupRMBMenus()
+{
+ rmbWidgets = new QPopupMenu( this );
+ actionEditCut->addTo( rmbWidgets );
+ actionEditCopy->addTo( rmbWidgets );
+ actionEditPaste->addTo( rmbWidgets );
+ actionEditDelete->addTo( rmbWidgets );
+#if 0
+ rmbWidgets->insertSeparator();
+ actionEditLower->addTo( rmbWidgets );
+ actionEditRaise->addTo( rmbWidgets );
+#endif
+ rmbWidgets->insertSeparator();
+ actionEditAdjustSize->addTo( rmbWidgets );
+ actionEditHLayout->addTo( rmbWidgets );
+ actionEditVLayout->addTo( rmbWidgets );
+ actionEditGridLayout->addTo( rmbWidgets );
+ actionEditSplitHorizontal->addTo( rmbWidgets );
+ actionEditSplitVertical->addTo( rmbWidgets );
+ actionEditBreakLayout->addTo( rmbWidgets );
+ rmbWidgets->insertSeparator();
+ if ( !singleProjectMode() )
+ actionEditConnections->addTo( rmbWidgets );
+ actionEditSource->addTo( rmbWidgets );
+
+ rmbFormWindow = new QPopupMenu( this );
+ actionEditPaste->addTo( rmbFormWindow );
+ actionEditSelectAll->addTo( rmbFormWindow );
+ actionEditAccels->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ actionEditAdjustSize->addTo( rmbFormWindow );
+ actionEditHLayout->addTo( rmbFormWindow );
+ actionEditVLayout->addTo( rmbFormWindow );
+ actionEditGridLayout->addTo( rmbFormWindow );
+ actionEditBreakLayout->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ if ( !singleProjectMode() ) {
+ actionEditFunctions->addTo( rmbFormWindow );
+ actionEditConnections->addTo( rmbFormWindow );
+ }
+ actionEditSource->addTo( rmbFormWindow );
+ rmbFormWindow->insertSeparator();
+ actionEditFormSettings->addTo( rmbFormWindow );
+}
+
+void MainWindow::toolSelected( QAction* action )
+{
+ actionCurrentTool = action;
+ emit currentToolChanged();
+ if ( formWindow() )
+ formWindow()->commandHistory()->emitUndoRedo();
+}
+
+int MainWindow::currentTool() const
+{
+ if ( !actionCurrentTool )
+ return POINTER_TOOL;
+ return QString::fromLatin1(actionCurrentTool->name()).toInt();
+}
+
+void MainWindow::runProjectPrecondition()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ e->save();
+ e->saveBreakPoints();
+ }
+ fileSaveProject();
+
+ if ( currentTool() == ORDER_TOOL )
+ resetTool();
+ oWindow->clearErrorMessages();
+ oWindow->clearDebug();
+ oWindow->showDebugTab();
+ previewing = TRUE;
+}
+
+void MainWindow::runProjectPostcondition( QObjectList *l )
+{
+ inDebugMode = TRUE;
+ debuggingForms = *l;
+ enableAll( FALSE );
+ for ( SourceEditor *e2 = sourceEditors.first(); e2; e2 = sourceEditors.next() ) {
+ if ( e2->project() == currentProject )
+ e2->editorInterface()->setMode( EditorInterface::Debugging );
+ }
+}
+
+QWidget* MainWindow::previewFormInternal( QStyle* style, QPalette* palet )
+{
+ qwf_execute_code = FALSE;
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->save();
+ if ( currentTool() == ORDER_TOOL )
+ resetTool();
+
+ FormWindow *fw = formWindow();
+ if ( !fw )
+ return 0;
+
+ QStringList databases;
+ QPtrDictIterator<QWidget> wit( *fw->widgets() );
+ while ( wit.current() ) {
+ QStringList lst = MetaDataBase::fakeProperty( wit.current(), "database" ).toStringList();
+ if ( !lst.isEmpty() )
+ databases << lst [ 0 ];
+ ++wit;
+ }
+
+ if ( fw->project() ) {
+ QStringList::ConstIterator it;
+ for ( it = databases.begin(); it != databases.end(); ++it )
+ fw->project()->openDatabase( *it, FALSE );
+ }
+ QApplication::setOverrideCursor( WaitCursor );
+
+ QCString s;
+ QBuffer buffer( s );
+ buffer.open( IO_WriteOnly );
+ Resource resource( this );
+ resource.setWidget( fw );
+ QValueList<Resource::Image> images;
+ resource.save( &buffer );
+
+ buffer.close();
+ buffer.open( IO_ReadOnly );
+
+ QWidget *w = QWidgetFactory::create( &buffer );
+ if ( w ) {
+ previewedForm = w;
+ if ( palet ) {
+ if ( style )
+ style->polish( *palet );
+ w->setPalette( *palet );
+ }
+
+ if ( style )
+ w->setStyle( style );
+
+ QObjectList *l = w->queryList( "QWidget" );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( style )
+ ( (QWidget*)o )->setStyle( style );
+ }
+ delete l;
+
+ w->move( fw->mapToGlobal( QPoint(0,0) ) );
+ ((MainWindow*)w )->setWFlags( WDestructiveClose );
+ previewing = TRUE;
+ w->show();
+ previewing = FALSE;
+ QApplication::restoreOverrideCursor();
+ return w;
+ }
+ QApplication::restoreOverrideCursor();
+ return 0;
+}
+
+void MainWindow::previewForm()
+{
+ QWidget* w = previewFormInternal();
+ if ( w )
+ w->show();
+}
+
+void MainWindow::previewForm( const QString & style )
+{
+ QStyle* st = QStyleFactory::create( style );
+ QWidget* w = 0;
+ if ( style == "Motif" ) {
+ QPalette p( QColor( 192, 192, 192 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "Windows" ) {
+ QPalette p( QColor( 212, 208, 200 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "Platinum" ) {
+ QPalette p( QColor( 220, 220, 220 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "CDE" ) {
+ QPalette p( QColor( 75, 123, 130 ) );
+ p.setColor( QPalette::Active, QColorGroup::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Inactive, QColorGroup::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Disabled, QColorGroup::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Active, QColorGroup::Highlight, Qt::white );
+ p.setColor( QPalette::Active, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Inactive, QColorGroup::Highlight, Qt::white );
+ p.setColor( QPalette::Inactive, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Disabled, QColorGroup::Highlight, Qt::white );
+ p.setColor( QPalette::Disabled, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Active, QColorGroup::Foreground, Qt::white );
+ p.setColor( QPalette::Active, QColorGroup::Text, Qt::white );
+ p.setColor( QPalette::Active, QColorGroup::ButtonText, Qt::white );
+ p.setColor( QPalette::Inactive, QColorGroup::Foreground, Qt::white );
+ p.setColor( QPalette::Inactive, QColorGroup::Text, Qt::white );
+ p.setColor( QPalette::Inactive, QColorGroup::ButtonText, Qt::white );
+ p.setColor( QPalette::Disabled, QColorGroup::Foreground, Qt::lightGray );
+ p.setColor( QPalette::Disabled, QColorGroup::Text, Qt::lightGray );
+ p.setColor( QPalette::Disabled, QColorGroup::ButtonText, Qt::lightGray );
+
+ w = previewFormInternal( st, &p );
+ } else if ( style == "SGI" ) {
+ QPalette p( QColor( 220, 220, 220 ) );
+ w = previewFormInternal( st, &p );
+ } else if ( style == "MotifPlus" ) {
+ QColor gtkfg(0x00, 0x00, 0x00);
+ QColor gtkdf(0x75, 0x75, 0x75);
+ QColor gtksf(0xff, 0xff, 0xff);
+ QColor gtkbs(0xff, 0xff, 0xff);
+ QColor gtkbg(0xd6, 0xd6, 0xd6);
+ QColor gtksl(0x00, 0x00, 0x9c);
+ QColorGroup active(gtkfg, // foreground
+ gtkbg, // button
+ gtkbg.light(), // light
+ gtkbg.dark(142), // dark
+ gtkbg.dark(110), // mid
+ gtkfg, // text
+ gtkfg, // bright text
+ gtkbs, // base
+ gtkbg), // background
+ disabled(gtkdf, // foreground
+ gtkbg, // button
+ gtkbg.light(), // light
+ gtkbg.dark(156), // dark
+ gtkbg.dark(110), // mid
+ gtkdf, // text
+ gtkdf, // bright text
+ gtkbs, // base
+ gtkbg); // background
+
+ QPalette pal(active, disabled, active);
+
+ pal.setColor(QPalette::Active, QColorGroup::Highlight,
+ gtksl);
+ pal.setColor(QPalette::Active, QColorGroup::HighlightedText,
+ gtksf);
+ pal.setColor(QPalette::Inactive, QColorGroup::Highlight,
+ gtksl);
+ pal.setColor(QPalette::Inactive, QColorGroup::HighlightedText,
+ gtksf);
+ pal.setColor(QPalette::Disabled, QColorGroup::Highlight,
+ gtksl);
+ pal.setColor(QPalette::Disabled, QColorGroup::HighlightedText,
+ gtkdf);
+ w = previewFormInternal( st, &pal );
+ } else {
+ w = previewFormInternal( st );
+ }
+
+ if ( !w )
+ return;
+ w->insertChild( st );
+ w->show();
+}
+
+void MainWindow::helpContents()
+{
+ QWidget *focusWidget = qApp->focusWidget();
+ bool showClassDocu = TRUE;
+ while ( focusWidget ) {
+ if ( focusWidget->isA( "PropertyList" ) ) {
+ showClassDocu = FALSE;
+ break;
+ }
+ focusWidget = focusWidget->parentWidget();
+ }
+
+ QString source = "designer-manual.html";
+ if ( propertyDocumentation.isEmpty() ) {
+ QString indexFile = documentationPath() + "/propertyindex";
+ QFile f( indexFile );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ while ( !ts.eof() ) {
+ QString s = ts.readLine();
+ int from = s.find( "\"" );
+ if ( from == -1 )
+ continue;
+ int to = s.findRev( "\"" );
+ if ( to == -1 )
+ continue;
+ propertyDocumentation[ s.mid( from + 1, to - from - 1 ) ] = s.mid( to + 2 ) + "-prop";
+ }
+ f.close();
+ }
+ }
+
+ if ( propertyEditor->widget() && !showClassDocu ) {
+ if ( !propertyEditor->currentProperty().isEmpty() ) {
+ QMetaObject* mo = propertyEditor->metaObjectOfCurrentProperty();
+ QString s;
+ QString cp = propertyEditor->currentProperty();
+ if ( cp == "layoutMargin" ) {
+ source = propertyDocumentation[ "QLayout/margin" ];
+ } else if ( cp == "layoutSpacing" ) {
+ source = propertyDocumentation[ "QLayout/spacing" ];
+ } else if ( cp == "toolTip" ) {
+ source = "qtooltip.html#details";
+ } else if ( mo && qstrcmp( mo->className(), "Spacer" ) == 0 ) {
+ if ( cp != "name" )
+ source = "qsizepolicy.html#SizeType";
+ else
+ source = propertyDocumentation[ "QObject/name" ];
+ } else {
+ while ( mo && !propertyDocumentation.contains( ( s = QString( mo->className() ) + "/" + cp ) ) )
+ mo = mo->superClass();
+ if ( mo )
+ source = "p:" + propertyDocumentation[s];
+ }
+ }
+
+ QString classname = WidgetFactory::classNameOf( propertyEditor->widget() );
+ if ( source.isEmpty() || source == "designer-manual.html" ) {
+ if ( classname.lower() == "spacer" )
+ source = "qspaceritem.html#details";
+ else if ( classname == "QLayoutWidget" )
+ source = "layout.html";
+ else
+ source = QString( WidgetFactory::classNameOf( propertyEditor->widget() ) ).lower() + ".html#details";
+ }
+ } else if ( propertyEditor->widget() ) {
+ source = QString( WidgetFactory::classNameOf( propertyEditor->widget() ) ).lower() + ".html#details";
+ }
+
+ if ( !source.isEmpty() )
+ assistant->showPage( documentationPath() + source );
+}
+
+void MainWindow::helpManual()
+{
+ assistant->showPage( documentationPath() + "/designer-manual.html" );
+}
+
+void MainWindow::helpAbout()
+{
+ AboutDialog dlg( this, 0, TRUE );
+ if ( singleProjectMode() ) {
+ dlg.aboutPixmap->setText( "" );
+ dlg.aboutVersion->setText( "" );
+ dlg.aboutCopyright->setText( "" );
+ LanguageInterface *iface = MetaDataBase::languageInterface( eProject->language() );
+ dlg.aboutLicense->setText( iface->aboutText() );
+ }
+ dlg.aboutVersion->setText(QString("Version ") + QString(QT_VERSION_STR));
+ dlg.resize( dlg.width(), dlg.layout()->heightForWidth(dlg.width()) );
+ dlg.exec();
+}
+
+void MainWindow::helpAboutQt()
+{
+ QMessageBox::aboutQt( this, "Qt Designer" );
+}
+
+#if defined(_WS_WIN_)
+#include <qt_windows.h>
+#include <qprocess.h>
+#endif
+
+void MainWindow::helpRegister()
+{
+#if defined(_WS_WIN_)
+ HKEY key;
+ HKEY subkey;
+ long res;
+ DWORD type;
+ DWORD size = 255;
+ QString command;
+ QString sub( "htmlfile\\shell" );
+#if defined(UNICODE)
+ if ( QApplication::winVersion() & Qt::WV_NT_based ) {
+ unsigned char data[256];
+ res = RegOpenKeyExW( HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, &key );
+ res = RegOpenKeyExW( key, (TCHAR*)sub.ucs2(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExW( subkey, NULL, NULL, &type, data, &size );
+ command = qt_winQString( data ) + "\\command";
+ size = 255;
+ res = RegOpenKeyExW( subkey, (TCHAR*)command.ucs2(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExW( subkey, NULL, NULL, &type, data, &size );
+ command = qt_winQString( data );
+ } else
+#endif
+ {
+ unsigned char data[256];
+ res = RegOpenKeyExA( HKEY_CLASSES_ROOT, NULL, 0, KEY_READ, &key );
+ res = RegOpenKeyExA( key, sub.local8Bit(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExA( subkey, NULL, NULL, &type, data, &size );
+ command = QString::fromLocal8Bit( (const char*) data ) + "\\command";
+ size = 255;
+ res = RegOpenKeyExA( subkey, command.local8Bit(), 0, KEY_READ, &subkey );
+ res = RegQueryValueExA( subkey, NULL, NULL, &type, data, &size );
+ command = QString::fromLocal8Bit( (const char*) data );
+ }
+
+ res = RegCloseKey( subkey );
+ res = RegCloseKey( key );
+
+ QProcess process( command + " www.trolltech.com/products/download/eval/evaluation.html" );
+ if ( !process.start() )
+ QMessageBox::information( this, "Register Qt", "Launching your web browser failed.\n"
+ "To register Qt, point your browser to www.trolltech.com/products/download/eval/evaluation.html" );
+#endif
+}
+
+void MainWindow::showProperties( QObject *o )
+{
+ if ( !o->isWidgetType() ) {
+ propertyEditor->setWidget( o, lastActiveFormWindow );
+ if ( lastActiveFormWindow )
+ hierarchyView->setFormWindow( lastActiveFormWindow, lastActiveFormWindow->mainContainer() );
+ else
+ hierarchyView->setFormWindow( 0, 0 );
+ return;
+ }
+ QWidget *w = (QWidget*)o;
+ setupHierarchyView();
+ FormWindow *fw = (FormWindow*)isAFormWindowChild( w );
+ if ( fw ) {
+ if ( fw->numSelectedWidgets() > 1 ) {
+ QWidgetList wl = fw->selectedWidgets();
+ if ( wl.first() != w ) {
+ wl.removeRef( w );
+ wl.insert( 0, w );
+ }
+ propertyEditor->setWidget( new PropertyObject( wl ), fw );
+ } else {
+ propertyEditor->setWidget( w, fw );
+ }
+ hierarchyView->setFormWindow( fw, w );
+ } else {
+ propertyEditor->setWidget( 0, 0 );
+ hierarchyView->setFormWindow( 0, 0 );
+ }
+
+ if ( currentTool() == POINTER_TOOL && fw &&
+ ( !qworkspace->activeWindow() || !::qt_cast<SourceEditor*>(qworkspace->activeWindow()) ) )
+ fw->setFocus();
+}
+
+void MainWindow::resetTool()
+{
+ actionPointerTool->setOn( TRUE );
+}
+
+void MainWindow::updateProperties( QObject * )
+{
+ if ( propertyEditor )
+ propertyEditor->refetchData();
+}
+
+bool MainWindow::eventFilter( QObject *o, QEvent *e )
+{
+ if ( ::qt_cast<MenuBarEditor*>(o) || ::qt_cast<PopupMenuEditor*>(o) ||
+ ( o &&
+ ( ::qt_cast<MenuBarEditor*>(o->parent()) ||
+ ::qt_cast<PopupMenuEditor*>(o->parent()) ) ) ) {
+
+ if ( e->type() == QEvent::Accel && ::qt_cast<PopupMenuEditor*>(o) ) {
+ return TRUE; // consume accel events
+ } else if ( e->type() == QEvent::MouseButtonPress && ::qt_cast<MenuBarEditor*>(o) ) {
+ QPoint pos = ((QMouseEvent*)e)->pos();
+ MenuBarEditor *m = ::qt_cast<MenuBarEditor*>(o);
+ showProperties( o );
+ if ( m->findItem( pos ) >= m->count() )
+ m->setFocus();
+ } else if ( e->type() == QEvent::MouseButtonPress && ::qt_cast<PopupMenuEditor*>(o) ) {
+ PopupMenuEditor *m = ::qt_cast<PopupMenuEditor*>(o);
+ PopupMenuEditorItem *i = m->at( ((QMouseEvent*)e)->pos() );
+ if ( m->find( i->action() ) != -1 && !i->isSeparator() )
+ showProperties( i->action() );
+ }
+ return QMainWindow::eventFilter( o, e );
+ }
+
+ if ( !o || !e || !o->isWidgetType() )
+ return QMainWindow::eventFilter( o, e );
+
+ QWidget *w = 0;
+ bool passiveInteractor;
+ switch ( e->type() ) {
+ case QEvent::AccelOverride:
+ if ( ( (QKeyEvent*)e )->key() == Key_F1 &&
+ ( ( (QKeyEvent*)e )->state() & ShiftButton ) != ShiftButton ) {
+ w = (QWidget*)o;
+ while ( w ) {
+ if ( ::qt_cast<PropertyList*>(w) )
+ break;
+ w = w->parentWidget( TRUE );
+ }
+ if ( w ) {
+ propertyEditor->propertyList()->showCurrentWhatsThis();
+ ( (QKeyEvent*)e )->accept();
+ return TRUE;
+ }
+ }
+ break;
+ case QEvent::Accel:
+ if ( ( ( (QKeyEvent*)e )->key() == Key_A ||
+ ( (QKeyEvent*)e )->key() == Key_E ) &&
+ ( (QKeyEvent*)e )->state() & ControlButton ) {
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (QKeyEvent*)e )->ignore();
+ return TRUE;
+ }
+ }
+ break;
+ case QEvent::ContextMenu:
+ case QEvent::MouseButtonPress:
+ if ( o && currentTool() == POINTER_TOOL &&
+ ( ::qt_cast<MenuBarEditor*>(o) ||
+ ::qt_cast<PopupMenuEditor*>(o) ||
+ ::qt_cast<QDesignerToolBar*>(o) ||
+ ( ::qt_cast<QComboBox*>(o) ||
+ ::qt_cast<QToolButton*>(o) ||
+ ::qt_cast<QDesignerToolBarSeparator*>(o) ) &&
+ o->parent()
+ && ( ::qt_cast<QDesignerToolBar*>(o->parent())
+ || ::qt_cast<QDesignerWidgetStack*>(o->parent())) ) ) {
+ QWidget *w = (QWidget*)o;
+ if ( ::qt_cast<QToolButton*>(w) ||
+ ::qt_cast<QComboBox*>(w) ||
+ ::qt_cast<PopupMenuEditor*>(w) ||
+ ::qt_cast<QDesignerToolBarSeparator*>(w) )
+ w = w->parentWidget();
+ QWidget *pw = w->parentWidget();
+ while ( pw ) {
+ if ( ::qt_cast<FormWindow*>(pw) ) {
+ ( (FormWindow*)pw )->emitShowProperties( w );
+ if ( !::qt_cast<QDesignerToolBar*>(o) )
+ return ( !::qt_cast<QToolButton*>(o) &&
+ !::qt_cast<MenuBarEditor*>(o) &&
+ !::qt_cast<QComboBox*>(o) &&
+ !::qt_cast<QDesignerToolBarSeparator*>(o) );
+ }
+ pw = pw->parentWidget();
+ }
+ }
+ if ( o && ( ::qt_cast<QDesignerToolBar*>(o) || o->inherits("QDockWindowHandle") )
+ && e->type() == QEvent::ContextMenu )
+ break;
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ if ( ::qt_cast<QSizeGrip*>(o) )
+ break;
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ if ( !w->hasFocus() )
+ w->setFocus();
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor || currentTool() != ORDER_TOOL ) {
+ if( e->type() == QEvent::ContextMenu ) {
+ ( (FormWindow*)w )->handleContextMenu( (QContextMenuEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return TRUE;
+ } else {
+ ( (FormWindow*)w )->handleMousePress( (QMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ }
+ }
+ lastPressWidget = (QWidget*)o;
+ if ( passiveInteractor )
+ QTimer::singleShot( 0, formWindow(), SLOT( visibilityChanged() ) );
+ if ( currentTool() == CONNECT_TOOL || currentTool() == BUDDY_TOOL )
+ return TRUE;
+ return !passiveInteractor;
+ case QEvent::MouseButtonRelease:
+ lastPressWidget = 0;
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ if ( ::qt_cast<QSizeGrip*>(o) )
+ break;
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor )
+ ( (FormWindow*)w )->handleMouseRelease( (QMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ if ( passiveInteractor ) {
+ QTimer::singleShot( 0, this, SLOT( selectionChanged() ) );
+ QTimer::singleShot( 0, formWindow(), SLOT( visibilityChanged() ) );
+ }
+ return !passiveInteractor;
+ case QEvent::MouseMove:
+ if ( isAToolBarChild( o ) && currentTool() != CONNECT_TOOL && currentTool() != BUDDY_TOOL )
+ break;
+ w = isAFormWindowChild( o );
+ if ( lastPressWidget != (QWidget*)o && w &&
+ !::qt_cast<SizeHandle*>(o) && !::qt_cast<OrderIndicator*>(o) &&
+ !::qt_cast<PopupMenuEditor*>(o) && !::qt_cast<QMenuBar*>(o) &&
+ !::qt_cast<QSizeGrip*>(o) )
+ return TRUE;
+ if ( o && ::qt_cast<QSizeGrip*>(o) )
+ break;
+ if ( lastPressWidget != (QWidget*)o ||
+ ( !w || ::qt_cast<SizeHandle*>(o) ) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ passiveInteractor = WidgetFactory::isPassiveInteractor( o );
+ if ( !passiveInteractor )
+ ( (FormWindow*)w )->handleMouseMove( (QMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return !passiveInteractor;
+ case QEvent::KeyPress:
+ if ( ( (QKeyEvent*)e )->key() == Key_Escape && currentTool() != POINTER_TOOL ) {
+ resetTool();
+ return FALSE;
+ }
+ if ( ( (QKeyEvent*)e )->key() == Key_Escape && incrementalSearch->hasFocus() ) {
+ if ( ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ qWorkspace()->activeWindow()->setFocus();
+ return TRUE;
+ }
+ }
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ ( (FormWindow*)w )->handleKeyPress( (QKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
+ if ( ((QKeyEvent*)e)->isAccepted() )
+ return TRUE;
+ break;
+ case QEvent::MouseButtonDblClick:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) ) {
+ if ( ::qt_cast<QToolButton*>(o) && ((QToolButton*)o)->isOn() &&
+ o->parent() && ::qt_cast<QToolBar*>(o->parent()) && formWindow() )
+ formWindow()->setToolFixed();
+ break;
+ }
+ if ( currentTool() == ORDER_TOOL ) {
+ ( (FormWindow*)w )->handleMouseDblClick( (QMouseEvent*)e,
+ ( (FormWindow*)w )->designerWidget( o ) );
+ return TRUE;
+ }
+ if ( !WidgetFactory::isPassiveInteractor( o ) && ( (FormWindow*)w )->formFile() )
+ return openEditor( ( (FormWindow*)w )->designerWidget( o ), (FormWindow*)w );
+ return TRUE;
+ case QEvent::KeyRelease:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ ( (FormWindow*)w )->handleKeyRelease( (QKeyEvent*)e, ( (FormWindow*)w )->designerWidget( o ) );
+ if ( ((QKeyEvent*)e)->isAccepted() )
+ return TRUE;
+ break;
+ case QEvent::Hide:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ if ( ( (FormWindow*)w )->isWidgetSelected( (QWidget*)o ) )
+ ( (FormWindow*)w )->selectWidget( (QWidget*)o, FALSE );
+ break;
+ case QEvent::Enter:
+ case QEvent::Leave:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) ||
+ ::qt_cast<MenuBarEditor*>(o) )
+ break;
+ return TRUE;
+ case QEvent::Resize:
+ case QEvent::Move:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ if ( WidgetFactory::layoutType( (QWidget*)o->parent() ) != WidgetFactory::NoLayout ) {
+ ( (FormWindow*)w )->updateSelection( (QWidget*)o );
+ if ( e->type() != QEvent::Resize )
+ ( (FormWindow*)w )->updateChildSelections( (QWidget*)o );
+ }
+ break;
+ case QEvent::Close:
+ if ( o->isWidgetType() && (QWidget*)o == (QWidget*)previewedForm ) {
+ if ( lastActiveFormWindow && lastActiveFormWindow->project() ) {
+ QStringList lst =
+ MetaDataBase::fakeProperty( lastActiveFormWindow, "database" ).toStringList();
+ lastActiveFormWindow->project()->closeDatabase( lst[ 0 ] );
+ }
+ }
+ break;
+ case QEvent::DragEnter:
+ if ( o == qWorkspace() || o == workspace() || o == workspace()->viewport() ) {
+ workspace()->contentsDragEnterEvent( (QDragEnterEvent*)e );
+ return TRUE;
+ }
+ break;
+ case QEvent::DragMove:
+ if ( o == qWorkspace() || o == workspace() || o == workspace()->viewport() ) {
+ workspace()->contentsDragMoveEvent( (QDragMoveEvent*)e );
+ return TRUE;
+ }
+ break;
+ case QEvent::Drop:
+ if ( o == qWorkspace() || o == workspace() || o == workspace()->viewport() ) {
+ workspace()->contentsDropEvent( (QDropEvent*)e );
+ return TRUE;
+ }
+ break;
+ case QEvent::Show:
+ if ( o != this )
+ break;
+ if ( ((QShowEvent*)e)->spontaneous() )
+ break;
+ QApplication::sendPostedEvents( qworkspace, QEvent::ChildInserted );
+ showEvent( (QShowEvent*)e );
+ checkTempFiles();
+ return TRUE;
+ case QEvent::Wheel:
+ if ( !( w = isAFormWindowChild( o ) ) ||
+ ::qt_cast<SizeHandle*>(o) ||
+ ::qt_cast<OrderIndicator*>(o) )
+ break;
+ return TRUE;
+ case QEvent::FocusIn:
+ if ( !::qt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
+ return TRUE; //FIXME
+ if ( hierarchyView->formDefinitionView()->isRenaming()
+ && ( o->inherits( "Editor" ) || ::qt_cast<FormWindow*>(o) ) )
+ QApplication::sendPostedEvents();
+ if ( o->inherits( "Editor" ) ) {
+ QWidget *w = (QWidget*)o;
+ while ( w ) {
+ if ( ::qt_cast<SourceEditor*>(w) )
+ break;
+ w = w->parentWidget( TRUE );
+ }
+ if ( ::qt_cast<SourceEditor*>(w) )
+ ( (SourceEditor*)w )->checkTimeStamp();
+ } else if ( ::qt_cast<FormWindow*>(o) ) {
+ FormWindow *fw = (FormWindow*)o;
+ if ( fw->formFile() && fw->formFile()->editor() )
+ fw->formFile()->editor()->checkTimeStamp();
+ }
+ break;
+ case QEvent::FocusOut:
+ if ( !::qt_cast<FormWindow*>(o) && isAFormWindowChild( o ) )
+ return TRUE;
+ break;
+ default:
+ return QMainWindow::eventFilter( o, e );
+ }
+
+ return QMainWindow::eventFilter( o, e );
+}
+
+QWidget *MainWindow::isAFormWindowChild( QObject *o ) const
+{
+ if ( ::qt_cast<QWizard*>(o->parent()) && !::qt_cast<QPushButton*>(o) )
+ return 0;
+ while ( o ) {
+ if ( ::qt_cast<FormWindow*>(o) )
+ return (QWidget*)o;
+ o = o->parent();
+ }
+ return 0;
+}
+
+QWidget *MainWindow::isAToolBarChild( QObject *o ) const
+{
+ while ( o ) {
+ if ( ::qt_cast<QDesignerToolBar*>(o) )
+ return (QWidget*)o;
+ if ( ::qt_cast<FormWindow*>(o) )
+ return 0;
+ o = o->parent();
+ }
+ return 0;
+}
+
+FormWindow *MainWindow::formWindow()
+{
+ if ( qworkspace->activeWindow() ) {
+ FormWindow *fw = 0;
+ if ( ::qt_cast<FormWindow*>(qworkspace->activeWindow()) )
+ fw = (FormWindow*)qworkspace->activeWindow();
+ else if ( lastActiveFormWindow &&
+ qworkspace->windowList().find( lastActiveFormWindow ) != -1)
+ fw = lastActiveFormWindow;
+ return fw;
+ }
+ return 0;
+}
+
+void MainWindow::emitProjectSignals()
+{
+ emit hasNonDummyProject( !currentProject->isDummy() );
+ emit hasActiveWindowOrProject( !!qworkspace->activeWindow() || !currentProject->isDummy() );
+}
+
+void MainWindow::insertFormWindow( FormWindow *fw )
+{
+ if ( fw )
+ QWhatsThis::add( fw, i18n( "<b>The Form Window</b>"
+ "<p>Use the various tools to add widgets or to change the layout "
+ "and behavior of the components in the form. Select one or multiple "
+ "widgets to move them or lay them out. If a single widget is chosen it can "
+ "be resized using the resize handles.</p>"
+ "<p>Changes in the <b>Property Editor</b> are visible at design time, "
+ "and you can preview the form in different styles.</p>"
+ "<p>You can change the grid resolution, or turn the grid off in the "
+ "<b>Preferences</b> dialog in the <b>Edit</b> menu."
+ "<p>You can have several forms open, and all open forms are listed "
+ "in the <b>Form List</b>.") );
+
+ connect( fw, SIGNAL( showProperties( QObject * ) ),
+ this, SLOT( showProperties( QObject * ) ) );
+ connect( fw, SIGNAL( updateProperties( QObject * ) ),
+ this, SLOT( updateProperties( QObject * ) ) );
+ connect( this, SIGNAL( currentToolChanged() ),
+ fw, SLOT( currentToolChanged() ) );
+ connect( fw, SIGNAL( selectionChanged() ),
+ this, SLOT( selectionChanged() ) );
+ connect( fw, SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ),
+ this, SLOT( updateUndoRedo( bool, bool, const QString &, const QString & ) ) );
+
+ if ( !mblockNewForms ) {
+ } else {
+ fw->setProject( currentProject );
+ }
+ fw->show();
+ fw->currentToolChanged();
+ if ( fw->caption().isEmpty() && qstrlen( fw->name() ) )
+ fw->setCaption( fw->name() );
+ fw->mainContainer()->setCaption( fw->caption() );
+ WidgetFactory::saveDefaultProperties( fw->mainContainer(),
+ WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( fw->mainContainer() ) ) );
+ activeWindowChanged( fw );
+ emit formWindowsChanged();
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == fw->project() )
+ e->resetContext();
+ }
+}
+
+void MainWindow::createNewProject( const QString &lang )
+{
+ Project *pro = new Project( "", "", projectSettingsPluginManager );
+ pro->setLanguage( lang );
+
+
+ if ( !openProjectSettings( pro ) ) {
+ delete pro;
+ return;
+ }
+
+ if ( !pro->isValid() ) {
+ QMessageBox::information( this, i18n("New Project"), i18n( "Cannot create an invalid project." ) );
+ delete pro;
+ return;
+ }
+
+ QAction *a = new QAction( pro->makeRelative( pro->fileName() ),
+ pro->makeRelative( pro->fileName() ), 0, actionGroupProjects, 0, TRUE );
+ projects.insert( a, pro );
+ addRecentlyOpened( pro->makeAbsolute( pro->fileName() ), recentlyProjects );
+ projectSelected( a );
+}
+
+
+bool MainWindow::unregisterClient( FormWindow *w )
+{
+ propertyEditor->closed( w );
+ objectHierarchy()->closed( w );
+ if ( w == lastActiveFormWindow )
+ lastActiveFormWindow = 0;
+
+ QPtrList<SourceEditor> waitingForDelete;
+ waitingForDelete.setAutoDelete( TRUE );
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->object() == w )
+ waitingForDelete.append( e );
+ }
+
+ if ( actionEditor->form() == w ) {
+ actionEditor->setFormWindow( 0 );
+ actionEditor->parentWidget()->hide();
+ }
+
+ return TRUE;
+}
+
+void MainWindow::activeWindowChanged( QWidget *w )
+{
+ QWidget *old = formWindow();
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ FormWindow *fw = (FormWindow*)w;
+ FormWindow *ofw = lastActiveFormWindow;
+ lastActiveFormWindow = fw;
+ lastActiveFormWindow->updateUndoInfo();
+ emit hasActiveForm( TRUE );
+ if ( formWindow() ) {
+ formWindow()->emitShowProperties();
+ emit formModified( formWindow()->commandHistory()->isModified() );
+ if ( currentTool() != POINTER_TOOL )
+ formWindow()->clearSelection();
+ }
+ workspace()->activeFormChanged( fw );
+ setAppropriate( (QDockWindow*)actionEditor->parentWidget(),
+ ::qt_cast<QMainWindow*>(lastActiveFormWindow->mainContainer()) );
+ if ( appropriate( (QDockWindow*)actionEditor->parentWidget() ) ) {
+ if ( actionEditor->wantToBeShown() )
+ actionEditor->parentWidget()->show();
+ } else {
+ QWidget *mc = 0;
+ if ( ofw && (mc = ofw->mainContainer()) && ::qt_cast<QMainWindow*>(mc) )
+ actionEditor->setWantToBeShown( !actionEditor->parentWidget()->isHidden() );
+ actionEditor->parentWidget()->hide();
+ }
+
+ actionEditor->setFormWindow( lastActiveFormWindow );
+ if ( wspace && fw->project() && fw->project() != currentProject ) {
+ for ( QMap<QAction*, Project *>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == fw->project() ) {
+ projectSelected( it.key() );
+ break;
+ }
+ }
+ }
+ emit formWindowChanged();
+
+ } else if ( w == propertyEditor ) {
+ propertyEditor->resetFocus();
+ } else if ( !lastActiveFormWindow ) {
+ emit formWindowChanged();
+ emit hasActiveForm( FALSE );
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ }
+
+ if ( !w ) {
+ emit formWindowChanged();
+ emit hasActiveForm( FALSE );
+ propertyEditor->clear();
+ hierarchyView->clear();
+ updateUndoRedo( FALSE, FALSE, QString::null, QString::null );
+ }
+
+ selectionChanged();
+
+ if ( ::qt_cast<SourceEditor*>(w) ) {
+ SourceEditor *se = (SourceEditor*)w;
+ QGuardedPtr<FormWindow> fw = se->formWindow();
+ if ( se->formWindow() &&
+ lastActiveFormWindow != fw ) {
+ activeWindowChanged( se->formWindow() );
+ }
+ actionSearchFind->setEnabled( TRUE );
+ actionSearchIncremetal->setEnabled( TRUE );
+ actionSearchReplace->setEnabled( TRUE );
+ actionSearchGotoLine->setEnabled( TRUE );
+ incrementalSearch->setEnabled( TRUE );
+
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ actionEditCut->setEnabled( TRUE );
+ actionEditCopy->setEnabled( TRUE );
+ actionEditPaste->setEnabled( TRUE );
+ actionEditSelectAll->setEnabled( TRUE );
+ actionEditUndo->setMenuText( i18n( "&Undo" ) );
+ actionEditUndo->setToolTip( textNoAccel( actionEditUndo->menuText()) );
+ actionEditRedo->setMenuText( i18n( "&Redo" ) );
+ actionEditRedo->setToolTip( textNoAccel( actionEditRedo->menuText()) );
+ if ( hierarchyView->sourceEditor() != w )
+ hierarchyView->showClasses( se );
+ actionEditor->setFormWindow( 0 );
+ if ( wspace && se->project() && se->project() != currentProject ) {
+ for ( QMap<QAction*, Project *>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == se->project() ) {
+ projectSelected( it.key() );
+ break;
+ }
+ }
+ }
+ workspace()->activeEditorChanged( se );
+ } else {
+ actionSearchFind->setEnabled( FALSE );
+ actionSearchIncremetal->setEnabled( FALSE );
+ actionSearchReplace->setEnabled( FALSE );
+ actionSearchGotoLine->setEnabled( FALSE );
+ incrementalSearch->setEnabled( FALSE );
+ }
+
+ if ( currentTool() == ORDER_TOOL && w != old )
+ emit currentToolChanged();
+
+ emit hasActiveWindow( !!qworkspace->activeWindow() );
+}
+
+void MainWindow::updateUndoRedo( bool undoAvailable, bool redoAvailable,
+ const QString &undoCmd, const QString &redoCmd )
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return; // do not set a formWindow related command
+ actionEditUndo->setEnabled( undoAvailable );
+ actionEditRedo->setEnabled( redoAvailable );
+ if ( !undoCmd.isEmpty() )
+ actionEditUndo->setMenuText( i18n( "&Undo: %1" ).arg( undoCmd ) );
+ else
+ actionEditUndo->setMenuText( i18n( "&Undo: Not Available" ) );
+ if ( !redoCmd.isEmpty() )
+ actionEditRedo->setMenuText( i18n( "&Redo: %1" ).arg( redoCmd ) );
+ else
+ actionEditRedo->setMenuText( i18n( "&Redo: Not Available" ) );
+
+ actionEditUndo->setToolTip( textNoAccel( actionEditUndo->menuText()) );
+ actionEditRedo->setToolTip( textNoAccel( actionEditRedo->menuText()) );
+
+ if ( currentTool() == ORDER_TOOL ) {
+ actionEditUndo->setEnabled( FALSE );
+ actionEditRedo->setEnabled( FALSE );
+ }
+}
+
+void MainWindow::updateEditorUndoRedo()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *editor = (SourceEditor*)qWorkspace()->activeWindow();
+ actionEditUndo->setEnabled( editor->editIsUndoAvailable() );
+ actionEditRedo->setEnabled( editor->editIsRedoAvailable() );
+}
+
+QWorkspace *MainWindow::qWorkspace() const
+{
+ return qworkspace;
+}
+
+void MainWindow::popupFormWindowMenu( const QPoint & gp, FormWindow *fw )
+{
+ QValueList<uint> ids;
+ QMap<QString, int> commands;
+
+ setupRMBSpecialCommands( ids, commands, fw );
+ setupRMBProperties( ids, commands, fw );
+
+ qApp->processEvents();
+ int r = rmbFormWindow->exec( gp );
+
+ handleRMBProperties( r, commands, fw );
+ handleRMBSpecialCommands( r, commands, fw );
+
+ for ( QValueList<uint>::ConstIterator i = ids.begin(); i != ids.end(); ++i )
+ rmbFormWindow->removeItem( *i );
+}
+
+void MainWindow::popupWidgetMenu( const QPoint &gp, FormWindow * /*fw*/, QWidget * w)
+{
+ QValueList<uint> ids;
+ QMap<QString, int> commands;
+
+ setupRMBSpecialCommands( ids, commands, w );
+ setupRMBProperties( ids, commands, w );
+
+ qApp->processEvents();
+ int r = rmbWidgets->exec( gp );
+
+ handleRMBProperties( r, commands, w );
+ handleRMBSpecialCommands( r, commands, w );
+
+ for ( QValueList<uint>::ConstIterator i = ids.begin(); i != ids.end(); ++i )
+ rmbWidgets->removeItem( *i );
+}
+
+void MainWindow::setupRMBProperties( QValueList<uint> &ids, QMap<QString, int> &props, QWidget *w )
+{
+ const QMetaProperty* text = w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE );
+ if ( text && qstrcmp( text->type(), "QString") != 0 )
+ text = 0;
+ const QMetaProperty* title = w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE );
+ if ( title && qstrcmp( title->type(), "QString") != 0 )
+ title = 0;
+ const QMetaProperty* pagetitle =
+ w->metaObject()->property( w->metaObject()->findProperty( "pageTitle", TRUE ), TRUE );
+ if ( pagetitle && qstrcmp( pagetitle->type(), "QString") != 0 )
+ pagetitle = 0;
+ const QMetaProperty* pixmap =
+ w->metaObject()->property( w->metaObject()->findProperty( "pixmap", TRUE ), TRUE );
+ if ( pixmap && qstrcmp( pixmap->type(), "QPixmap") != 0 )
+ pixmap = 0;
+
+ if ( text && text->designable(w) ||
+ title && title->designable(w) ||
+ pagetitle && pagetitle->designable(w) ||
+ pixmap && pixmap->designable(w) ) {
+ int id = 0;
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator(0);
+ if ( pixmap && pixmap->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Choose Pixmap..."), -1, 0) );
+ props.insert( "pixmap", id );
+ }
+ if ( text && text->designable(w) && !::qt_cast<QTextEdit*>(w) ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Edit Text..."), -1, 0) );
+ props.insert( "text", id );
+ }
+ if ( title && title->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Edit Title..."), -1, 0) );
+ props.insert( "title", id );
+ }
+ if ( pagetitle && pagetitle->designable(w) ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Edit Page Title..."), -1, 0) );
+ props.insert( "pagetitle", id );
+ }
+ }
+}
+
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+static QWidgetContainerInterfacePrivate *containerWidgetInterface( QWidget *w )
+{
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( WidgetFactory::classNameOf( w ), &iface );
+ if ( !iface )
+ return 0;
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return 0;
+ iface->release();
+ return iface2;
+}
+#endif
+
+void MainWindow::setupRMBSpecialCommands( QValueList<uint> &ids,
+ QMap<QString, int> &commands, QWidget *w )
+{
+ int id;
+
+ if ( ::qt_cast<QTabWidget*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (QDesignerTabWidget*)w )->count() > 1) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ } else if ( ::qt_cast<QDesignerWidgetStack*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (QDesignerWidgetStack*)w )->count() > 1) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Previous Page"), -1, 0 ) );
+ commands.insert( "prevpage", id );
+ ids << ( id = rmbWidgets->insertItem( i18n("Next Page"), -1, 0 ) );
+ ids << rmbWidgets->insertSeparator( 0 );
+ commands.insert( "nextpage", id );
+ ids << ( id = rmbWidgets->insertItem( i18n("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ } else if ( ::qt_cast<QToolBox*>(w) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ if ( ( (QToolBox*)w )->count() > 1 ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( WidgetDatabase::
+ isCustomPluginWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ QWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface && iface->supportsPages( WidgetFactory::classNameOf( w ) ) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+
+ if ( iface->count( WidgetFactory::classNameOf( w ), w ) > 1 ) {
+ ids << ( id = rmbWidgets->insertItem( i18n( "Delete Page" ), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+ ids << ( id = rmbWidgets->insertItem( i18n("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+ if ( iface->currentIndex( WidgetFactory::classNameOf( w ), w ) != -1 ) {
+ ids << ( id = rmbWidgets->insertItem( i18n("Rename Current Page..."), -1, 0 ) );
+ commands.insert( "rename", id );
+ }
+ }
+ if ( iface )
+ iface->release();
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ }
+
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), w ) ) {
+ if ( ids.isEmpty() )
+ ids << rmbWidgets->insertSeparator( 0 );
+ ids << ( id = rmbWidgets->insertItem( i18n("Edit..."), -1, 0 ) );
+ commands.insert( "edit", id );
+ }
+}
+
+void MainWindow::setupRMBSpecialCommands( QValueList<uint> &ids,
+ QMap<QString, int> &commands, FormWindow *fw )
+{
+ int id;
+
+ if ( ::qt_cast<QWizard*>(fw->mainContainer()) ) {
+ if ( ids.isEmpty() )
+ ids << rmbFormWindow->insertSeparator( 0 );
+
+ if ( ( (QWizard*)fw->mainContainer() )->pageCount() > 1) {
+ ids << ( id = rmbFormWindow->insertItem( i18n("Delete Page"), -1, 0 ) );
+ commands.insert( "remove", id );
+ }
+
+ ids << ( id = rmbFormWindow->insertItem( i18n("Add Page"), -1, 0 ) );
+ commands.insert( "add", id );
+
+ ids << ( id = rmbFormWindow->insertItem( i18n("Edit Page Title..."), -1, 0 ) );
+ commands.insert( "rename", id );
+
+ ids << ( id = rmbFormWindow->insertItem( i18n("Edit Pages..."), -1, 0 ) );
+ commands.insert( "edit", id );
+
+ } else if ( ::qt_cast<QMainWindow*>(fw->mainContainer()) ) {
+ if ( ids.isEmpty() )
+ ids << rmbFormWindow->insertSeparator( 0 );
+ ids << ( id = rmbFormWindow->insertItem( i18n( "Add Menu Item" ), -1, 0 ) );
+ commands.insert( "add_menu_item", id );
+ ids << ( id = rmbFormWindow->insertItem( i18n( "Add Toolbar" ), -1, 0 ) );
+ commands.insert( "add_toolbar", id );
+ }
+}
+
+void MainWindow::handleRMBProperties( int id, QMap<QString, int> &props, QWidget *w )
+{
+ if ( id == props[ "text" ] ) {
+ bool ok = FALSE;
+ bool oldDoWrap = FALSE;
+ if ( ::qt_cast<QLabel*>(w) ) {
+ int align = w->property( "alignment" ).toInt();
+ if ( align & WordBreak )
+ oldDoWrap = TRUE;
+ }
+ bool doWrap = oldDoWrap;
+
+ QString text;
+ if ( ::qt_cast<QTextView*>(w) || ::qt_cast<QLabel*>(w) || ::qt_cast<QButton*>(w) ) {
+ text = MultiLineEditor::getText( this, w->property( "text" ).toString(), !::qt_cast<QButton*>(w), &doWrap );
+ ok = !text.isNull();
+ } else {
+ text = QInputDialog::getText( i18n("Text"), i18n( "New text" ),
+ QLineEdit::Normal, w->property("text").toString(), &ok, this );
+ }
+ if ( ok ) {
+ if ( oldDoWrap != doWrap ) {
+ QString pn( i18n( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "wordwrap", QVariant( oldDoWrap, 0 ),
+ QVariant( doWrap, 0 ), QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
+ }
+
+ QString pn( i18n( "Set the 'text' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "text", w->property( "text" ),
+ text, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "text", TRUE );
+ }
+ } else if ( id == props[ "title" ] ) {
+ bool ok = FALSE;
+ QString title = QInputDialog::getText( i18n("Title"), i18n( "New title" ),
+ QLineEdit::Normal, w->property("title").toString(), &ok, this );
+ if ( ok ) {
+ QString pn( i18n( "Set the 'title' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "title", w->property( "title" ),
+ title, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "title", TRUE );
+ }
+ } else if ( id == props[ "pagetitle" ] ) {
+ bool ok = FALSE;
+ QString text = QInputDialog::getText( i18n("Page Title"), i18n( "New page title" ),
+ QLineEdit::Normal, w->property("pageTitle").toString(), &ok, this );
+ if ( ok ) {
+ QString pn( i18n( "Set the 'pageTitle' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "pageTitle",
+ w->property( "pageTitle" ),
+ text, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "pageTitle", TRUE );
+ }
+ } else if ( id == props[ "pixmap" ] ) {
+ QPixmap oldPix = w->property( "pixmap" ).toPixmap();
+ QPixmap pix = qChoosePixmap( this, formWindow(), oldPix );
+ if ( !pix.isNull() ) {
+ QString pn( i18n( "Set the 'pixmap' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "pixmap", w->property( "pixmap" ),
+ pix, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "pixmap", TRUE );
+ }
+ }
+}
+
+void MainWindow::handleRMBSpecialCommands( int id, QMap<QString, int> &commands, QWidget *w )
+{
+ if ( ::qt_cast<QTabWidget*>(w) ) {
+ QTabWidget *tw = (QTabWidget*)w;
+ if ( id == commands[ "add" ] ) {
+ AddTabPageCommand *cmd =
+ new AddTabPageCommand( i18n( "Add Page to %1" ).arg( tw->name() ), formWindow(),
+ tw, "Tab" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( tw->currentPage() ) {
+ QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw;
+ DeleteTabPageCommand *cmd =
+ new DeleteTabPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( dtw->pageTitle() ).arg( tw->name() ),
+ formWindow(), tw, tw->currentPage() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::qt_cast<QToolBox*>(w) ) {
+ QToolBox *tb = (QToolBox*)w;
+ if ( id == commands[ "add" ] ) {
+ AddToolBoxPageCommand *cmd =
+ new AddToolBoxPageCommand( i18n( "Add Page to %1" ).arg( tb->name() ),
+ formWindow(),
+ tb, "Page" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( tb->currentItem() ) {
+ DeleteToolBoxPageCommand *cmd =
+ new DeleteToolBoxPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( tb->itemLabel( tb->currentIndex() ) ).
+ arg( tb->name() ),
+ formWindow(), tb, tb->currentItem() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::qt_cast<QWidgetStack*>(w) ) {
+ QDesignerWidgetStack *ws = (QDesignerWidgetStack*)w;
+ if ( id == commands[ "add" ] ) {
+ AddWidgetStackPageCommand *cmd =
+ new AddWidgetStackPageCommand( i18n( "Add Page to %1" ).arg( ws->name() ),
+ formWindow(), ws );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( ws->visibleWidget() ) {
+ DeleteWidgetStackPageCommand *cmd =
+ new DeleteWidgetStackPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( ws->currentPage() ).arg( ws->name() ),
+ formWindow(), ws, ws->visibleWidget() );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( id == commands[ "nextpage" ] ) {
+ int currentPage = w->property( "currentPage" ).toInt();
+ QString pn( i18n( "Raise next page of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd =
+ new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "currentPage", currentPage,
+ currentPage + 1, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "currentPage", TRUE );
+ } else if ( id == commands[ "prevpage" ] ) {
+ int currentPage = w->property( "currentPage" ).toInt();
+ QString pn( i18n( "Raise previous page of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd =
+ new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "currentPage", currentPage,
+ currentPage -1, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "currentPage", TRUE );
+ }
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( WidgetDatabase::
+ isCustomPluginWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) ) ) {
+ if ( id == commands[ "add" ] ) {
+ AddContainerPageCommand *cmd =
+ new AddContainerPageCommand( i18n( "Add Page to %1" ).arg( w->name() ),
+ formWindow(), w, "Page" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ QWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface ) {
+ QString wClassName = WidgetFactory::classNameOf( w );
+ int index = iface->currentIndex( wClassName, w );
+ DeleteContainerPageCommand *cmd =
+ new DeleteContainerPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( iface->pageLabel( wClassName,
+ w, index ) ).
+ arg( w->name() ),
+ formWindow(), w, index );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ iface->release();
+ }
+ } else if ( id == commands[ "rename" ] ) {
+ QWidgetContainerInterfacePrivate *iface = containerWidgetInterface( w );
+ if ( iface ) {
+ bool ok = FALSE;
+ QString wClassName = WidgetFactory::classNameOf( w );
+ int index = iface->currentIndex( wClassName, w );
+ QString text = QInputDialog::getText( i18n("Page Title"), i18n( "New page title" ),
+ QLineEdit::Normal,
+ iface->pageLabel( wClassName, w,
+ index ),
+ &ok, this );
+ if ( ok ) {
+ RenameContainerPageCommand *cmd =
+ new RenameContainerPageCommand( i18n( "Rename Page %1 to %2" ).
+ arg( iface->
+ pageLabel( wClassName, w,
+ index ) ).
+ arg( text ), formWindow(),
+ w, index, text );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ iface->release();
+ }
+ }
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ }
+
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), w ) ) {
+ if ( id == commands[ "edit" ] )
+ WidgetFactory::editWidget( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), this, w, formWindow() );
+ }
+}
+
+void MainWindow::handleRMBSpecialCommands( int id, QMap<QString, int> &commands, FormWindow *fw )
+{
+ if ( ::qt_cast<QWizard*>(fw->mainContainer()) ) {
+ QWizard *wiz = (QWizard*)fw->mainContainer();
+ if ( id == commands[ "add" ] ) {
+ AddWizardPageCommand *cmd =
+ new AddWizardPageCommand( i18n( "Add Page to %1" ).arg( wiz->name() ),
+ formWindow(), wiz, "WizardPage" );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "remove" ] ) {
+ if ( wiz->currentPage() ) {
+ QDesignerWizard *dw = (QDesignerWizard*)wiz;
+ DeleteWizardPageCommand *cmd =
+ new DeleteWizardPageCommand( i18n( "Delete Page %1 of %2" ).
+ arg( dw->pageTitle() ).arg( wiz->name() ),
+ formWindow(), wiz,
+ wiz->indexOf( wiz->currentPage() ) );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ } else if ( id == commands[ "edit" ] ) {
+ WizardEditor *e = new WizardEditor( this, wiz, fw );
+ e->exec();
+ delete e;
+ } else if ( id == commands[ "rename" ] ) {
+
+ bool ok = FALSE;
+ QDesignerWizard *dw = (QDesignerWizard*)wiz;
+ QString text = QInputDialog::getText( i18n("Page Title"), i18n( "New page title" ),
+ QLineEdit::Normal, dw->pageTitle(), &ok, this );
+ if ( ok ) {
+ QString pn( i18n( "Rename page %1 of %2" ).arg( dw->pageTitle() ).arg( wiz->name() ) );
+ RenameWizardPageCommand *cmd =
+ new RenameWizardPageCommand( pn, formWindow()
+ , wiz, wiz->indexOf( wiz->currentPage() ), text );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+ } else if ( ::qt_cast<QMainWindow*>(fw->mainContainer()) ) {
+ QMainWindow *mw = (QMainWindow*)fw->mainContainer();
+ if ( id == commands[ "add_toolbar" ] ) {
+ AddToolBarCommand *cmd =
+ new AddToolBarCommand( i18n( "Add Toolbar to '%1'" ).arg( formWindow()->name() ),
+ formWindow(), mw );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( id == commands[ "add_menu_item" ] ) {
+ AddMenuCommand *cmd =
+ new AddMenuCommand( i18n( "Add Menu to '%1'" ).arg( formWindow()->name() ),
+ formWindow(), mw );
+ formWindow()->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ }
+}
+
+void MainWindow::clipboardChanged()
+{
+ QString text( qApp->clipboard()->text() );
+ QString start( "<!DOCTYPE UI-SELECTION>" );
+ actionEditPaste->setEnabled( text.left( start.length() ) == start );
+}
+
+void MainWindow::selectionChanged()
+{
+ layoutChilds = FALSE;
+ layoutSelected = FALSE;
+ breakLayout = FALSE;
+ if ( !formWindow() ) {
+ actionEditCut->setEnabled( FALSE );
+ actionEditCopy->setEnabled( FALSE );
+ actionEditDelete->setEnabled( FALSE );
+ actionEditAdjustSize->setEnabled( FALSE );
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+ actionEditSplitVertical->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ actionEditLower->setEnabled( FALSE );
+ actionEditRaise->setEnabled( FALSE );
+ actionEditAdjustSize->setEnabled( FALSE );
+ return;
+ }
+
+ int selectedWidgets = formWindow()->numSelectedWidgets();
+ bool enable = selectedWidgets > 0;
+ actionEditCut->setEnabled( enable );
+ actionEditCopy->setEnabled( enable );
+ actionEditDelete->setEnabled( enable );
+ actionEditLower->setEnabled( enable );
+ actionEditRaise->setEnabled( enable );
+
+ actionEditAdjustSize->setEnabled( FALSE );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+ actionEditSplitVertical->setEnabled( FALSE );
+
+ enable = FALSE;
+ QWidgetList widgets = formWindow()->selectedWidgets();
+ if ( selectedWidgets > 1 ) {
+ int unlaidout = 0;
+ int laidout = 0;
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ if ( !w->parentWidget() || WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout )
+ unlaidout++;
+ else
+ laidout++;
+ }
+ actionEditHLayout->setEnabled( unlaidout > 1 );
+ actionEditVLayout->setEnabled( unlaidout > 1 );
+ actionEditSplitHorizontal->setEnabled( unlaidout > 1 );
+ actionEditSplitVertical->setEnabled( unlaidout > 1 );
+ actionEditGridLayout->setEnabled( unlaidout > 1 );
+ actionEditBreakLayout->setEnabled( laidout > 0 );
+ actionEditAdjustSize->setEnabled( laidout > 0 );
+ layoutSelected = unlaidout > 1;
+ breakLayout = laidout > 0;
+ } else if ( selectedWidgets == 1 ) {
+ QWidget *w = widgets.first();
+ bool isContainer = WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) ||
+ w == formWindow()->mainContainer();
+ actionEditAdjustSize->setEnabled( !w->parentWidget() ||
+ WidgetFactory::layoutType( w->parentWidget() ) == WidgetFactory::NoLayout );
+
+ if ( !isContainer ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ } else {
+ actionEditBreakLayout->setEnabled( FALSE );
+ }
+ } else {
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ if ( !formWindow()->hasInsertedChildren( w ) ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ } else {
+ actionEditHLayout->setEnabled( TRUE );
+ actionEditVLayout->setEnabled( TRUE );
+ actionEditGridLayout->setEnabled( TRUE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ layoutChilds = TRUE;
+ }
+ if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( !isAToolBarChild( w ) );
+ breakLayout = TRUE;
+ }
+ }
+ } else if ( selectedWidgets == 0 ) {
+ actionEditAdjustSize->setEnabled( TRUE );
+ QWidget *w = formWindow()->mainContainer();
+ if ( WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ if ( !formWindow()->hasInsertedChildren( w ) ) {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ } else {
+ actionEditHLayout->setEnabled( TRUE );
+ actionEditVLayout->setEnabled( TRUE );
+ actionEditGridLayout->setEnabled( TRUE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ layoutChilds = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( TRUE );
+ breakLayout = TRUE;
+ }
+ } else {
+ actionEditHLayout->setEnabled( FALSE );
+ actionEditVLayout->setEnabled( FALSE );
+ actionEditGridLayout->setEnabled( FALSE );
+ actionEditBreakLayout->setEnabled( FALSE );
+ }
+}
+
+static QString fixArgs( const QString &s2 )
+{
+ QString s = s2;
+ return s.replace( ',', ';' );
+}
+
+void MainWindow::writeConfig()
+{
+ QSettings config;
+
+ // No search path for unix, only needs application name
+ config.insertSearchPath( QSettings::Windows, "/Trolltech" );
+
+ QString keybase = DesignerApplication::settingsKey();
+
+ if (savePluginPaths) {
+ QStringList pluginPaths = QApplication::libraryPaths();
+ config.writeEntry( keybase + "PluginPaths", pluginPaths );
+ }
+ config.writeEntry( keybase + "RestoreWorkspace", restoreConfig );
+ config.writeEntry( keybase + "SplashScreen", splashScreen );
+ config.writeEntry( keybase + "ShowStartDialog", shStartDialog );
+ config.writeEntry( keybase + "FileFilter", fileFilter );
+ config.writeEntry( keybase + "TemplatePath", templPath );
+ config.writeEntry( keybase + "RecentlyOpenedFiles", recentlyFiles );
+ config.writeEntry( keybase + "RecentlyOpenedProjects", recentlyProjects );
+ config.writeEntry( keybase + "DatabaseAutoEdit", databaseAutoEdit );
+
+ config.writeEntry( keybase + "AutoSave/Enabled", autoSaveEnabled );
+ config.writeEntry( keybase + "AutoSave/Interval", autoSaveInterval );
+
+ config.writeEntry( keybase + "Grid/Snap", snGrid );
+ config.writeEntry( keybase + "Grid/Show", sGrid );
+ config.writeEntry( keybase + "Grid/x", grid().x() );
+ config.writeEntry( keybase + "Grid/y", grid().y() );
+ config.writeEntry( keybase + "LastToolPage",
+ toolBox->itemLabel( toolBox->currentIndex() ) );
+
+ config.writeEntry( keybase + "Background/UsePixmap", backPix );
+ config.writeEntry( keybase + "Background/Color", (int)qworkspace->backgroundColor().rgb() );
+ if ( qworkspace->backgroundPixmap() )
+ qworkspace->backgroundPixmap()->save( QDir::home().absPath() + "/.designer/" + "background.xpm", "PNG" );
+
+ config.writeEntry( keybase + "Geometries/MainwindowX", x() );
+ config.writeEntry( keybase + "Geometries/MainwindowY", y() );
+ config.writeEntry( keybase + "Geometries/MainwindowWidth", width() );
+ config.writeEntry( keybase + "Geometries/MainwindowHeight", height() );
+ config.writeEntry( keybase + "Geometries/MainwindowMaximized", isMaximized() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorX", propertyEditor->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorY", propertyEditor->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorWidth", propertyEditor->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/PropertyEditorHeight", propertyEditor->parentWidget()->height() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewX", hierarchyView->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewY", hierarchyView->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewWidth", hierarchyView->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/HierarchyViewHeight", hierarchyView->parentWidget()->height() );
+ config.writeEntry( keybase + "Geometries/WorkspaceX", wspace->parentWidget()->x() );
+ config.writeEntry( keybase + "Geometries/WorkspaceY", wspace->parentWidget()->y() );
+ config.writeEntry( keybase + "Geometries/WorkspaceWidth", wspace->parentWidget()->width() );
+ config.writeEntry( keybase + "Geometries/WorkspaceHeight", wspace->parentWidget()->height() );
+
+ config.writeEntry( keybase + "View/TextLabels", usesTextLabel() );
+ config.writeEntry( keybase + "View/BigIcons", usesBigPixmaps() );
+
+ QString mwlKey = "MainwindowLayout";
+ if ( singleProjectMode() )
+ mwlKey += "S";
+ QString mainWindowLayout;
+ QTextStream ts( &mainWindowLayout, IO_WriteOnly );
+ ts << *this;
+ config.writeEntry( keybase + mwlKey, mainWindowLayout );
+
+
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ config.writeEntry( keybase + "CustomWidgets/num", (int)lst->count() );
+ int j = 0;
+ QDir::home().mkdir( ".designer" );
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ QStringList l;
+ l << w->className;
+ l << w->includeFile;
+ l << QString::number( (int)w->includePolicy );
+ l << QString::number( w->sizeHint.width() );
+ l << QString::number( w->sizeHint.height() );
+ l << QString::number( w->lstSignals.count() );
+ for ( QValueList<QCString>::ConstIterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ l << QString( fixArgs( *it ) );
+ l << QString::number( w->lstSlots.count() );
+ for ( QValueList<MetaDataBase::Function>::ConstIterator it2 = w->lstSlots.begin(); it2 != w->lstSlots.end(); ++it2 ) {
+ l << fixArgs( (*it2).function );
+ l << (*it2).access;
+ }
+ l << QString::number( w->lstProperties.count() );
+ for ( QValueList<MetaDataBase::Property>::ConstIterator it3 = w->lstProperties.begin(); it3 != w->lstProperties.end(); ++it3 ) {
+ l << (*it3).property;
+ l << (*it3).type;
+ }
+ l << QString::number( size_type_to_int( w->sizePolicy.horData() ) );
+ l << QString::number( size_type_to_int( w->sizePolicy.verData() ) );
+ l << QString::number( (int)w->isContainer );
+ config.writeEntry( keybase + "CustomWidgets/Widget" + QString::number( j++ ), l, ',' );
+ w->pixmap->save( QDir::home().absPath() + "/.designer/" + w->className, "XPM" );
+ }
+
+ QStringList l;
+ for ( QAction *a = commonWidgetsPage.first(); a; a = commonWidgetsPage.next() )
+ l << a->text();
+ config.writeEntry( keybase + "ToolBox/CommonWidgets", l );
+}
+
+static QString fixArgs2( const QString &s2 )
+{
+ QString s = s2;
+ return s.replace( ';', ',' );
+}
+
+void MainWindow::readConfig()
+{
+ QString keybase = DesignerApplication::settingsKey();
+ QSettings config;
+ config.insertSearchPath( QSettings::Windows, "/Trolltech" );
+
+ bool ok;
+ bool readPreviousConfig = FALSE;
+ QString backPixName( QDir::home().absPath() + "/.designer/" + "background.xpm" );
+ restoreConfig = config.readBoolEntry( keybase + "RestoreWorkspace", TRUE, &ok );
+ if ( !ok ) {
+ keybase = DesignerApplication::oldSettingsKey();
+ restoreConfig = config.readBoolEntry( keybase + "RestoreWorkspace", TRUE, &ok );
+ if ( !ok ) {
+ if ( oWindow ) {
+ oWindow->shuttingDown();
+ ( (QDockWindow*)oWindow->parent() )->hide();
+ }
+ QPixmap pix;
+ pix.load( backPixName );
+ if ( !pix.isNull() )
+ qworkspace->setBackgroundPixmap( pix );
+ return;
+ }
+ readPreviousConfig = TRUE;
+ }
+ if ( !readPreviousConfig ) {
+ fileFilter = config.readEntry( keybase + "FileFilter", fileFilter );
+ templPath = config.readEntry( keybase + "TemplatePath", QString::null );
+ databaseAutoEdit = config.readBoolEntry( keybase + "DatabaseAutoEdit", databaseAutoEdit );
+ shStartDialog = config.readBoolEntry( keybase + "ShowStartDialog", shStartDialog );
+ autoSaveEnabled = config.readBoolEntry( keybase + "AutoSave/Enabled", autoSaveEnabled );
+ autoSaveInterval = config.readNumEntry( keybase + "AutoSave/Interval", autoSaveInterval );
+ }
+
+ if ( restoreConfig || readPreviousConfig ) {
+ QString s = config.readEntry( keybase + "LastToolPage" );
+ for ( int i = 0; i < toolBox->count(); ++i ) {
+ if ( toolBox->itemLabel(i) == s ) {
+ toolBox->setCurrentIndex( i );
+ break;
+ }
+ }
+ // We know that the oldSettingsKey() will return 3.1
+ if ( keybase == DesignerApplication::oldSettingsKey() ) {
+ if (keybase.contains("3.1"))
+ recentlyFiles = config.readListEntry( keybase + "RecentlyOpenedFiles", ',' );
+ else
+ recentlyFiles = config.readListEntry(keybase + "RecentlyOpenedFiles");
+
+ if ( recentlyFiles.count() == 1 && recentlyFiles[0].isNull() )
+ recentlyFiles.clear();
+ if (keybase.contains("3.1"))
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects", ',' );
+ else
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects");
+ if ( recentlyProjects.count() == 1 && recentlyProjects[0].isNull() )
+ recentlyProjects.clear();
+ } else {
+ recentlyFiles = config.readListEntry( keybase + "RecentlyOpenedFiles" );
+ recentlyProjects = config.readListEntry( keybase + "RecentlyOpenedProjects" );
+ }
+
+ backPix = config.readBoolEntry( keybase + "Background/UsePixmap", TRUE ) | readPreviousConfig;
+ if ( backPix ) {
+ QPixmap pix;
+ pix.load( backPixName );
+ if ( !pix.isNull() )
+ qworkspace->setBackgroundPixmap( pix );
+ } else {
+ qworkspace->setBackgroundColor( QColor( (QRgb)config.readNumEntry( keybase + "Background/Color" ) ) );
+ }
+
+ if ( !readPreviousConfig ) {
+ splashScreen = config.readBoolEntry( keybase + "SplashScreen", TRUE );
+
+ sGrid = config.readBoolEntry( keybase + "Grid/Show", TRUE );
+ snGrid = config.readBoolEntry( keybase + "Grid/Snap", TRUE );
+ grd.setX( config.readNumEntry( keybase + "Grid/x", 10 ) );
+ grd.setY( config.readNumEntry( keybase + "Grid/y", 10 ) );
+
+ if ( !config.readBoolEntry( DesignerApplication::settingsKey() + "Geometries/MainwindowMaximized", FALSE ) ) {
+ QRect r( pos(), size() );
+ r.setX( config.readNumEntry( keybase + "Geometries/MainwindowX", r.x() ) );
+ r.setY( config.readNumEntry( keybase + "Geometries/MainwindowY", r.y() ) );
+ r.setWidth( config.readNumEntry( keybase + "Geometries/MainwindowWidth", r.width() ) );
+ r.setHeight( config.readNumEntry( keybase + "Geometries/MainwindowHeight", r.height() ) );
+
+ QRect desk = QApplication::desktop()->geometry();
+ QRect inter = desk.intersect( r );
+ resize( r.size() );
+ if ( inter.width() * inter.height() > ( r.width() * r.height() / 20 ) ) {
+ move( r.topLeft() );
+ }
+ }
+ setUsesTextLabel( config.readBoolEntry( keybase + "View/TextLabels", FALSE ) );
+ setUsesBigPixmaps( FALSE /*config.readBoolEntry( "BigIcons", FALSE )*/ ); // ### disabled for now
+ }
+ }
+ int num = config.readNumEntry( keybase + "CustomWidgets/num" );
+ for ( int j = 0; j < num; ++j ) {
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ QStringList l = config.readListEntry( keybase + "CustomWidgets/Widget" + QString::number( j ), ',' );
+ w->className = l[ 0 ];
+ w->includeFile = l[ 1 ];
+ w->includePolicy = (MetaDataBase::CustomWidget::IncludePolicy)l[ 2 ].toInt();
+ w->sizeHint.setWidth( l[ 3 ].toInt() );
+ w->sizeHint.setHeight( l[ 4 ].toInt() );
+ uint c = 5;
+ if ( l.count() > c ) {
+ int numSignals = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numSignals; ++i, c++ )
+ w->lstSignals.append( fixArgs2( l[ c ] ).latin1() );
+ }
+ if ( l.count() > c ) {
+ int numSlots = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numSlots; ++i ) {
+ MetaDataBase::Function slot;
+ slot.function = fixArgs2( l[ c ] );
+ c++;
+ slot.access = l[ c ];
+ c++;
+ w->lstSlots.append( slot );
+ }
+ }
+ if ( l.count() > c ) {
+ int numProperties = l[ c ].toInt();
+ c++;
+ for ( int i = 0; i < numProperties; ++i ) {
+ MetaDataBase::Property prop;
+ prop.property = l[ c ];
+ c++;
+ prop.type = l[ c ];
+ c++;
+ w->lstProperties.append( prop );
+ }
+ } if ( l.count() > c ) {
+ QSizePolicy::SizeType h, v;
+ h = int_to_size_type( l[ c++ ].toInt() );
+ v = int_to_size_type( l[ c++ ].toInt() );
+ w->sizePolicy = QSizePolicy( h, v );
+ }
+ if ( l.count() > c ) {
+ w->isContainer = (bool)l[ c++ ].toInt();
+ }
+ w->pixmap = new QPixmap( BarIcon( QDir::home().absPath() + "/.designer/" + w->className , KDevDesignerPartFactory::instance()) );
+ MetaDataBase::addCustomWidget( w );
+ }
+ if ( num > 0 )
+ rebuildCustomWidgetGUI();
+
+ if ( !restoreConfig )
+ return;
+
+#ifndef Q_WS_MAC
+ /* I'm sorry to make this not happen on the Mac, but it seems to hang somewhere deep
+ in QLayout, it gets into a very large loop - and seems it has to do with clever
+ things the designer does ###Sam */
+ QApplication::sendPostedEvents();
+#endif
+
+ if ( !readPreviousConfig ) {
+ QString mwlKey = "MainwindowLayout";
+ if ( singleProjectMode() )
+ mwlKey += "S";
+ QString mainWindowLayout = config.readEntry( keybase + mwlKey );
+ QTextStream ts( &mainWindowLayout, IO_ReadOnly );
+ ts >> *this;
+ }
+ if ( readPreviousConfig && oWindow ) {
+ oWindow->shuttingDown();
+ ( (QDockWindow*)oWindow->parent() )->hide();
+ }
+
+ rebuildCustomWidgetGUI();
+
+ QStringList l = config.readListEntry( keybase + "ToolBox/CommonWidgets" );
+ if ( !l.isEmpty() ) {
+ QPtrList<QAction> lst;
+ commonWidgetsPage.clear();
+ for ( QStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) {
+ for ( QAction *a = toolActions.first(); a; a = toolActions.next() ) {
+ if ( *it == a->text() ) {
+ lst.append( a );
+ break;
+ }
+ }
+ }
+ if ( lst != commonWidgetsPage ) {
+ commonWidgetsPage = lst;
+ rebuildCommonWidgetsToolBoxPage();
+ }
+ }
+}
+
+HierarchyView *MainWindow::objectHierarchy() const
+{
+ if ( !hierarchyView )
+ ( (MainWindow*)this )->setupHierarchyView();
+ return hierarchyView;
+}
+
+QPopupMenu *MainWindow::setupNormalHierarchyMenu( QWidget *parent )
+{
+ QPopupMenu *menu = new QPopupMenu( parent );
+
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+
+ return menu;
+}
+
+QPopupMenu *MainWindow::setupTabWidgetHierarchyMenu( QWidget *parent, const char *addSlot, const char *removeSlot )
+{
+ QPopupMenu *menu = new QPopupMenu( parent );
+
+ menu->insertItem( i18n( "Add Page" ), parent, addSlot );
+ menu->insertItem( i18n( "Delete Page" ), parent, removeSlot );
+ menu->insertSeparator();
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+
+ return menu;
+}
+
+void MainWindow::closeEvent( QCloseEvent *e )
+{
+ if ( singleProject ) {
+ hide();
+ e->ignore();
+ return;
+ }
+
+ QWidgetList windows = qWorkspace()->windowList();
+ QWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ QWidget *w = wit.current();
+ ++wit;
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ if ( ( (FormWindow*)w )->formFile()->formWindow() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->formWindow() );
+ if ( !( (FormWindow*)w )->formFile()->close() ) {
+ e->ignore();
+ return;
+ }
+ } else if ( ::qt_cast<SourceEditor*>(w) ) {
+ if ( !( (SourceEditor*)w )->close() ) {
+ e->ignore();
+ return;
+ }
+ }
+ w->close();
+ }
+
+ QMapConstIterator<QAction*, Project*> it = projects.begin();
+ while( it != projects.end() ) {
+ Project *pro = it.data();
+ ++it;
+ if ( pro->isModified() ) {
+ switch ( QMessageBox::warning( this, i18n( "Save Project Settings" ),
+ i18n( "Save changes to '%1'?" ).arg( pro->fileName() ),
+ i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ pro->save();
+ break;
+ case 1: // don't save
+ break;
+ case 2: // cancel
+ e->ignore();
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+ writeConfig();
+ hide();
+ e->accept();
+
+ if ( client ) {
+ QDir home( QDir::homeDirPath() );
+ home.remove( ".designerpid" );
+ }
+}
+
+Workspace *MainWindow::workspace() const
+{
+ if ( !wspace )
+ ( (MainWindow*)this )->setupWorkspace();
+ return wspace;
+}
+
+PropertyEditor *MainWindow::propertyeditor() const
+{
+ if ( !propertyEditor )
+ ( (MainWindow*)this )->setupPropertyEditor();
+ return propertyEditor;
+}
+
+ActionEditor *MainWindow::actioneditor() const
+{
+ if ( !actionEditor )
+ ( (MainWindow*)this )->setupActionEditor();
+ return actionEditor;
+}
+
+bool MainWindow::openEditor( QWidget *w, FormWindow *f )
+{
+ if ( f && !f->project()->isCpp() && !WidgetFactory::isPassiveInteractor( w ) ) {
+ QString defSignal = WidgetFactory::defaultSignal( w );
+ if ( defSignal.isEmpty() ) {
+ editSource();
+ } else {
+ QString s = QString( w->name() ) + "_" + defSignal;
+ LanguageInterface *iface = MetaDataBase::languageInterface( f->project()->language() );
+ if ( iface ) {
+ QStrList sigs = iface->signalNames( w );
+ QString fullSignal;
+ for ( int i = 0; i < (int)sigs.count(); ++i ) {
+ QString sig = sigs.at( i );
+ if ( sig.left( sig.find( '(' ) ) == defSignal ) {
+ fullSignal = sig;
+ break;
+ }
+ }
+
+ if ( !fullSignal.isEmpty() ) {
+ QString signl = fullSignal;
+ fullSignal = fullSignal.mid( fullSignal.find( '(' ) + 1 );
+ fullSignal.remove( (int)fullSignal.length() - 1, 1 );
+ fullSignal = iface->createArguments( fullSignal.simplifyWhiteSpace() );
+ s += "(" + fullSignal + ")";
+ if ( !MetaDataBase::hasFunction( f, s.latin1() ) )
+ MetaDataBase::addFunction( f, s.latin1(), "", "public", "slot",
+ f->project()->language(), "void" );
+ s = s.left( s.find( '(' ) ).latin1();
+ if ( !MetaDataBase::hasConnection( f, w, defSignal.latin1(), f->mainContainer(), s.latin1() ) ) {
+ MetaDataBase::Connection conn;
+ conn.sender = w;
+ conn.receiver = f->mainContainer();
+ conn.signal = signl;
+ conn.slot = s;
+ AddConnectionCommand *cmd =
+ new AddConnectionCommand( i18n( "Add Connection" ), f, conn );
+ f->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ f->formFile()->setModified( TRUE );
+ }
+ }
+ }
+ editFunction( s, TRUE );
+ }
+ return TRUE;
+ }
+ if ( WidgetFactory::hasSpecialEditor( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ), w ) ) {
+ statusMessage( i18n( "Edit %1..." ).arg( w->className() ) );
+ WidgetFactory::editWidget( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ),
+ this, w, formWindow() );
+ statusBar()->clear();
+ return TRUE;
+ }
+
+ const QMetaProperty* text = w->metaObject()->property( w->metaObject()->findProperty( "text", TRUE ), TRUE );
+ const QMetaProperty* title = w->metaObject()->property( w->metaObject()->findProperty( "title", TRUE ), TRUE );
+ if ( text && text->designable(w) ) {
+ bool ok = FALSE;
+ bool oldDoWrap = FALSE;
+ if ( ::qt_cast<QLabel*>(w) ) {
+ int align = w->property( "alignment" ).toInt();
+ if ( align & WordBreak )
+ oldDoWrap = TRUE;
+ }
+ bool doWrap = oldDoWrap;
+
+ QString text;
+ if ( ::qt_cast<QTextEdit*>(w) || ::qt_cast<QLabel*>(w) || ::qt_cast<QButton*>(w) ) {
+ text = MultiLineEditor::getText( this, w->property( "text" ).toString(),
+ !::qt_cast<QButton*>(w), &doWrap );
+ ok = !text.isNull();
+ } else {
+ text = QInputDialog::getText( i18n("Text"), i18n( "New text" ),
+ QLineEdit::Normal, w->property("text").toString(), &ok, this );
+ }
+ if ( ok ) {
+ if ( oldDoWrap != doWrap ) {
+ QString pn( i18n( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "wordwrap", QVariant( oldDoWrap, 0 ),
+ QVariant( doWrap, 0 ), QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
+ }
+
+ QString pn( i18n( "Set the 'text' of '%1'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "text", w->property( "text" ),
+ text, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "text", TRUE );
+ }
+ return TRUE;
+ }
+ if ( title && title->designable(w) ) {
+ bool ok = FALSE;
+ QString text;
+ text = QInputDialog::getText( i18n("Title"), i18n( "New title" ), QLineEdit::Normal, w->property("title").toString(), &ok, this );
+ if ( ok ) {
+ QString pn( i18n( "Set the 'title' of '%2'" ).arg( w->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
+ "title", w->property( "title" ),
+ text, QString::null, QString::null );
+ cmd->execute();
+ formWindow()->commandHistory()->addCommand( cmd );
+ MetaDataBase::setPropertyChanged( w, "title", TRUE );
+ }
+ return TRUE;
+ }
+
+ if ( !WidgetFactory::isPassiveInteractor( w ) )
+ editSource();
+
+ return TRUE;
+}
+
+void MainWindow::rebuildCustomWidgetGUI()
+{
+ customWidgetToolBar->clear();
+ customWidgetMenu->clear();
+ customWidgetToolBar2->clear();
+ int count = 0;
+
+ QPtrListIterator<QAction> it( toolActions );
+ QAction *action;
+ while ( ( action = it.current() ) ) {
+ ++it;
+ if ( ( (WidgetAction*)action )->group() == "Custom Widgets" )
+ delete action;
+ }
+
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+
+ actionToolsCustomWidget->addTo( customWidgetMenu );
+ customWidgetMenu->insertSeparator();
+
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ WidgetAction* a = new WidgetAction( "Custom Widgets", actionGroupTools, QString::number( w->id ).latin1() );
+ a->setToggleAction( TRUE );
+ a->setText( w->className );
+ a->setIconSet( *w->pixmap );
+ a->setStatusTip( i18n( "Insert a %1 (custom widget)" ).arg( w->className ) );
+ a->setWhatsThis( i18n("<b>%1 (custom widget)</b>"
+ "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> menu to "
+ "add and change custom widgets. You can add properties as well as "
+ "signals and slots to integrate them into Qt Designer, "
+ "and provide a pixmap which will be used to represent the widget on the form.</p>").arg( w->className ) );
+
+ a->addTo( customWidgetToolBar );
+ a->addTo( customWidgetToolBar2 );
+ a->addTo( customWidgetMenu );
+ count++;
+ }
+ QWidget *wid;
+ customWidgetToolBar2->setStretchableWidget( ( wid = new QWidget( customWidgetToolBar2 ) ) );
+ wid->setBackgroundMode( customWidgetToolBar2->backgroundMode() );
+
+ if ( count == 0 )
+ customWidgetToolBar->hide();
+ else if ( customWidgetToolBar->isVisible() )
+ customWidgetToolBar->show();
+}
+
+void MainWindow::rebuildCommonWidgetsToolBoxPage()
+{
+ toolBox->setUpdatesEnabled( FALSE );
+ commonWidgetsToolBar->setUpdatesEnabled( FALSE );
+ commonWidgetsToolBar->clear();
+ for ( QAction *a = commonWidgetsPage.first(); a; a = commonWidgetsPage.next() )
+ a->addTo( commonWidgetsToolBar );
+ QWidget *w;
+ commonWidgetsToolBar->setStretchableWidget( ( w = new QWidget( commonWidgetsToolBar ) ) );
+ w->setBackgroundMode( commonWidgetsToolBar->backgroundMode() );
+ toolBox->setUpdatesEnabled( TRUE );
+ commonWidgetsToolBar->setUpdatesEnabled( TRUE );
+}
+
+bool MainWindow::isCustomWidgetUsed( MetaDataBase::CustomWidget *wid )
+{
+ QWidgetList windows = qWorkspace()->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->isCustomWidgetUsed( wid ) )
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void MainWindow::setGrid( const QPoint &p )
+{
+ if ( p == grd )
+ return;
+ grd = p;
+ QWidgetList windows = qWorkspace()->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( !::qt_cast<FormWindow*>(w) )
+ continue;
+ ( (FormWindow*)w )->mainContainer()->update();
+ }
+}
+
+void MainWindow::setShowGrid( bool b )
+{
+ if ( b == sGrid )
+ return;
+ sGrid = b;
+ QWidgetList windows = qWorkspace()->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( !::qt_cast<FormWindow*>(w) )
+ continue;
+ ( (FormWindow*)w )->mainContainer()->update();
+ }
+}
+
+void MainWindow::setSnapGrid( bool b )
+{
+ if ( b == snGrid )
+ return;
+ snGrid = b;
+}
+
+QString MainWindow::documentationPath() const
+{
+ return QString( qInstallPathDocs() ) + "/html/";
+}
+
+void MainWindow::windowsMenuActivated( int id )
+{
+ QWidget* w = qworkspace->windowList().at( id );
+ if ( w )
+ w->setFocus();
+}
+
+void MainWindow::projectSelected( QAction *a )
+{
+ a->setOn( TRUE );
+ if ( currentProject )
+ currentProject->setActive( FALSE );
+ Project *p = *projects.find( a );
+ p->setActive( TRUE );
+ if ( currentProject == p )
+ return;
+ currentProject = p;
+ if ( wspace )
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::openProject( const QString &fn )
+{
+ for ( QMap<QAction*, Project*>::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->fileName() == fn ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+ QApplication::setOverrideCursor( waitCursor );
+ Project *pro = new Project( fn, "", projectSettingsPluginManager );
+ pro->setModified( FALSE );
+ QAction *a = new QAction( pro->projectName(), pro->projectName(), 0, actionGroupProjects, 0, TRUE );
+ projects.insert( a, pro );
+ projectSelected( a );
+ QApplication::restoreOverrideCursor();
+}
+
+void MainWindow::checkTempFiles()
+{
+ QString s = QDir::homeDirPath() + "/.designer";
+ QString baseName = s+ "/saved-form-";
+ if ( !QFile::exists( baseName + "1.ui" ) )
+ return;
+ DesignerApplication::closeSplash();
+ QDir d( s );
+ d.setNameFilter( "*.ui" );
+ QStringList lst = d.entryList();
+ QApplication::restoreOverrideCursor();
+ bool load = QMessageBox::information( this, i18n( "Restoring Last Session" ),
+ i18n( "Qt Designer found some temporary saved files, which were\n"
+ "written when Qt Designer crashed last time. Do you want to\n"
+ "load these files?" ), i18n( "&Yes" ), i18n( "&No" ) ) == 0;
+ QApplication::setOverrideCursor( waitCursor );
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( load )
+ openFormWindow( s + "/" + *it, FALSE );
+ d.remove( *it );
+ }
+}
+
+void MainWindow::showDialogHelp()
+{
+ QWidget *w = (QWidget*)sender();
+ w = w->topLevelWidget();
+
+ QString link = documentationPath() + "/designer-manual-13.html#";
+
+ if ( ::qt_cast<NewFormBase*>(w) || ::qt_cast<StartDialogBase*>(w) ) // own doc for startdialog?
+ link += "dialog-file-new";
+ else if ( ::qt_cast<CreateTemplate*>(w) )
+ link += "dialog-file-create-template";
+ else if ( ::qt_cast<EditFunctionsBase*>(w) )
+ link += "dialog-edit-functions";
+// else if ( ::qt_cast<ConnectionViewerBase*>(w) )
+ else if ( w->inherits("ConnectionViewerBase") )
+ link += "dialog-view-connections";
+ else if ( ::qt_cast<FormSettingsBase*>(w) )
+ link += "dialog-edit-form-settings";
+ else if ( ::qt_cast<Preferences*>(w) )
+ link += "dialog-edit-preferences";
+ else if ( ::qt_cast<PixmapCollectionEditor*>(w) )
+ link += "dialog-image-collection";
+// else if ( ::qt_cast<DatabaseConnectionBase*>(w) )
+ else if ( w->inherits( "DatabaseConnectionBase" ) )
+ link += "dialog-edit-database-connections";
+ else if ( ::qt_cast<ProjectSettingsBase*>(w) )
+ link += "dialog-project-settings";
+ else if ( ::qt_cast<FindDialog*>(w) )
+ link += "dialog-find-text";
+ else if ( ::qt_cast<ReplaceDialog*>(w) )
+ link += "dialog-replace-text";
+ else if ( ::qt_cast<GotoLineDialog*>(w) )
+ link += "dialog-go-to-line";
+// else if ( ::qt_cast<ConnectionEditorBase*>(w) )
+ else if ( w->inherits("ConnectionEditorBase") )
+ link += "dialog-edit-connections";
+ else if ( ::qt_cast<CustomWidgetEditorBase*>(w) )
+ link += "dialog-edit-custom-widgets";
+ else if ( ::qt_cast<PaletteEditorBase*>(w) )
+ link += "dialog-edit-palette";
+ else if ( ::qt_cast<ListBoxEditorBase*>(w) )
+ link += "dialog-edit-listbox";
+ else if ( ::qt_cast<ListViewEditorBase*>(w) )
+ link += "dialog-edit-listview";
+ else if ( ::qt_cast<IconViewEditorBase*>(w) )
+ link += "dialog-edit-iconview";
+ else if ( ::qt_cast<TableEditorBase*>(w) )
+ link += "dialog-edit-table";
+ else if ( ::qt_cast<MultiLineEditor*>(w) )
+ link += "dialog-text";
+
+ else {
+ QMessageBox::information( this, i18n( "Help" ),
+ i18n( "There is no help available for this dialog at the moment." ) );
+ return;
+ }
+
+ assistant->showPage( link );
+}
+
+void MainWindow::setupActionManager()
+{
+ actionPluginManager = new QPluginManager<ActionInterface>( IID_Action, QApplication::libraryPaths(), pluginDirectory() );
+
+ QStringList lst = actionPluginManager->featureList();
+ for ( QStringList::ConstIterator ait = lst.begin(); ait != lst.end(); ++ait ) {
+ ActionInterface *iface = 0;
+ actionPluginManager->queryInterface( *ait, &iface );
+ if ( !iface )
+ continue;
+
+ iface->connectTo( desInterface );
+ QAction *a = iface->create( *ait, this );
+ if ( !a )
+ continue;
+
+ QString grp = iface->group( *ait );
+ if ( grp.isEmpty() )
+ grp = "3rd party actions";
+ QPopupMenu *menu = 0;
+ QToolBar *tb = 0;
+
+ if ( !( menu = (QPopupMenu*)child( grp.latin1(), "QPopupMenu" ) ) ) {
+ menu = new QPopupMenu( this, grp.latin1() );
+ menuBar()->insertItem( i18n( grp ), menu );
+ }
+ if ( !( tb = (QToolBar*)child( grp.latin1(), "QToolBar" ) ) ) {
+ tb = new QToolBar( this, grp.latin1() );
+ tb->setCloseMode( QDockWindow::Undocked );
+ addToolBar( tb, grp );
+ }
+
+ if ( iface->location( *ait, ActionInterface::Menu ) )
+ a->addTo( menu );
+ if ( iface->location( *ait, ActionInterface::Toolbar ) )
+ a->addTo( tb );
+
+ iface->release();
+ }
+}
+
+void MainWindow::editFunction( const QString &func, bool rereadSource )
+{
+ if ( !formWindow() )
+ return;
+
+ if ( formWindow()->formFile()->codeFileState() != FormFile::Ok )
+ if ( !formWindow()->formFile()->setupUihFile(FALSE) )
+ return;
+
+ QString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ QMessageBox::information( this, i18n( "Edit Source" ),
+ i18n( "There is no plugin for editing %1 code installed.\n"
+ "Note: Plugins are not available in static Qt configurations." ).arg( lang ) );
+ return;
+ }
+
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->language() == lang && e->formWindow() == formWindow() ) {
+ e->show();
+ e->setFunction( func );
+ return;
+ }
+ }
+
+ createSourceEditor( formWindow(), formWindow()->project(), lang, func, rereadSource );
+}
+
+void MainWindow::setupRecentlyFilesMenu()
+{
+ recentlyFilesMenu->clear();
+ int id = 0;
+ for ( QStringList::ConstIterator it = recentlyFiles.begin(); it != recentlyFiles.end(); ++it ) {
+ recentlyFilesMenu->insertItem( *it, id );
+ id++;
+ }
+}
+
+void MainWindow::setupRecentlyProjectsMenu()
+{
+ recentlyProjectsMenu->clear();
+ int id = 0;
+ for ( QStringList::ConstIterator it = recentlyProjects.begin(); it != recentlyProjects.end(); ++it ) {
+ recentlyProjectsMenu->insertItem( *it, id );
+ id++;
+ }
+}
+
+QPtrList<DesignerProject> MainWindow::projectList() const
+{
+ QPtrList<DesignerProject> list;
+ QMapConstIterator<QAction*, Project*> it = projects.begin();
+
+ while( it != projects.end() ) {
+ Project *p = it.data();
+ ++it;
+ list.append( p->iFace() );
+ }
+
+ return list;
+}
+
+QStringList MainWindow::projectNames() const
+{
+ QStringList res;
+ for ( QMap<QAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it )
+ res << (*it)->projectName();
+ return res;
+}
+
+QStringList MainWindow::projectFileNames() const
+{
+ QStringList res;
+ for ( QMap<QAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it )
+ res << (*it)->makeRelative( (*it)->fileName() );
+ return res;
+}
+
+Project *MainWindow::findProject( const QString &projectName ) const
+{
+ for ( QMap<QAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->projectName() == projectName )
+ return *it;
+ }
+ return 0;
+}
+
+void MainWindow::setCurrentProject( Project *pro )
+{
+ for ( QMap<QAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( *it == pro ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+}
+
+void MainWindow::setCurrentProjectByFilename( const QString& proFilename )
+{
+ for ( QMap<QAction*, Project* >::ConstIterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( (*it)->makeRelative( (*it)->fileName() ) == proFilename ) {
+ projectSelected( it.key() );
+ return;
+ }
+ }
+}
+
+
+void MainWindow::recentlyFilesMenuActivated( int id )
+{
+ if ( id != -1 ) {
+ if ( !QFile::exists( *recentlyFiles.at( id ) ) ) {
+ QMessageBox::warning( this, i18n( "Open File" ),
+ i18n( "Could not open '%1'. File does not exist." ).
+ arg( *recentlyFiles.at( id ) ) );
+ recentlyFiles.remove( recentlyFiles.at( id ) );
+ return;
+ }
+ fileOpen( "", "", *recentlyFiles.at( id ) );
+ QString fn( *recentlyFiles.at( id ) );
+ addRecentlyOpened( fn, recentlyFiles );
+ }
+}
+
+void MainWindow::recentlyProjectsMenuActivated( int id )
+{
+ if ( id != -1 ) {
+ if ( !QFile::exists( *recentlyProjects.at( id ) ) ) {
+ QMessageBox::warning( this, i18n( "Open Project" ),
+ i18n( "Could not open '%1'. File does not exist." ).
+ arg( *recentlyProjects.at( id ) ) );
+ recentlyProjects.remove( recentlyProjects.at( id ) );
+ return;
+ }
+ openProject( *recentlyProjects.at( id ) );
+ QString fn( *recentlyProjects.at( id ) );
+ addRecentlyOpened( fn, recentlyProjects );
+ }
+}
+
+void MainWindow::addRecentlyOpened( const QString &fn, QStringList &lst )
+{
+ QFileInfo fi( fn );
+ fi.convertToAbs();
+ QString f = fi.filePath();
+ if ( lst.find( f ) != lst.end() )
+ lst.remove( f );
+ if ( lst.count() >= 10 )
+ lst.pop_back();
+ lst.prepend( f );
+}
+
+TemplateWizardInterface * MainWindow::templateWizardInterface( const QString& className )
+{
+ TemplateWizardInterface* iface = 0;
+ templateWizardPluginManager->queryInterface( className, & iface );
+ return iface;
+}
+
+void MainWindow::setupPluginManagers()
+{
+ editorPluginManager = new QPluginManager<EditorInterface>( IID_Editor, QApplication::libraryPaths(), "/kdevdesigner" );
+ MetaDataBase::setEditor( editorPluginManager->featureList() );
+
+ templateWizardPluginManager =
+ new QPluginManager<TemplateWizardInterface>( IID_TemplateWizard, QApplication::libraryPaths(), pluginDirectory() );
+
+ MetaDataBase::setupInterfaceManagers( "/designer" );
+ preferencePluginManager =
+ new QPluginManager<PreferenceInterface>( IID_Preference, QApplication::libraryPaths(), pluginDirectory() );
+ projectSettingsPluginManager =
+ new QPluginManager<ProjectSettingsInterface>( IID_ProjectSettings, QApplication::libraryPaths(), pluginDirectory() );
+ sourceTemplatePluginManager =
+ new QPluginManager<SourceTemplateInterface>( IID_SourceTemplate, QApplication::libraryPaths(), pluginDirectory() );
+
+ if ( preferencePluginManager ) {
+ QStringList lst = preferencePluginManager->featureList();
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ PreferenceInterface *i = 0;
+ preferencePluginManager->queryInterface( *it, &i );
+ if ( !i )
+ continue;
+ i->connectTo( designerInterface() );
+ PreferenceInterface::Preference *pf = i->preference();
+ if ( pf )
+ addPreferencesTab( pf->tab, pf->title, pf->receiver, pf->init_slot, pf->accept_slot );
+ i->deletePreferenceObject( pf );
+
+ i->release();
+ }
+ }
+ if ( projectSettingsPluginManager ) {
+ QStringList lst = projectSettingsPluginManager->featureList();
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ ProjectSettingsInterface *i = 0;
+ projectSettingsPluginManager->queryInterface( *it, &i );
+ if ( !i )
+ continue;
+ i->connectTo( designerInterface() );
+
+ ProjectSettingsInterface::ProjectSettings *pf = i->projectSetting();
+ if ( pf )
+ addProjectTab( pf->tab, pf->title, pf->receiver, pf->init_slot, pf->accept_slot );
+ i->deleteProjectSettingsObject( pf );
+ i->release();
+ }
+ }
+}
+
+void MainWindow::addPreferencesTab( QWidget *tab, const QString &title, QObject *receiver, const char *init_slot, const char *accept_slot )
+{
+ Tab t;
+ t.w = tab;
+ t.title = title;
+ t.receiver = receiver;
+ t.init_slot = init_slot;
+ t.accept_slot = accept_slot;
+ preferenceTabs << t;
+}
+
+void MainWindow::addProjectTab( QWidget *tab, const QString &title, QObject *receiver, const char *init_slot, const char *accept_slot )
+{
+ Tab t;
+ t.w = tab;
+ t.title = title;
+ t.receiver = receiver;
+ t.init_slot = init_slot;
+ t.accept_slot = accept_slot;
+ projectTabs << t;
+}
+
+void MainWindow::setModified( bool b, QWidget *window )
+{
+ QWidget *w = window;
+ while ( w ) {
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ ( (FormWindow*)w )->modificationChanged( b );
+ return;
+ } else if ( ::qt_cast<SourceEditor*>(w) ) {
+ FormWindow *fw = ( (SourceEditor*)w )->formWindow();
+ if ( fw && !fw->isFake() ) {
+ //fw->commandHistory()->setModified( b );
+ //fw->modificationChanged( b );
+ fw->formFile()->setModified( b, FormFile::WFormCode );
+ wspace->update( fw->formFile() );
+ } else {
+ wspace->update();
+ }
+ return;
+ }
+ w = w->parentWidget( TRUE );
+ }
+}
+
+void MainWindow::editorClosed( SourceEditor *e )
+{
+ sourceEditors.take( sourceEditors.findRef( e ) );
+}
+
+void MainWindow::functionsChanged()
+{
+ updateFunctionsTimer->start( 0, TRUE );
+}
+
+void MainWindow::doFunctionsChanged()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->refresh( FALSE );
+ hierarchyView->formDefinitionView()->refresh();
+}
+
+void MainWindow::updateFunctionList()
+{
+ if ( !qWorkspace()->activeWindow() || !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *se = (SourceEditor*)qWorkspace()->activeWindow();
+ se->save();
+ hierarchyView->formDefinitionView()->refresh();
+ if ( !currentProject->isCpp() && se->formWindow() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( currentProject->language() );
+ if ( !iface )
+ return;
+ QValueList<LanguageInterface::Connection> conns;
+ iface->connections( se->text(), &conns );
+ MetaDataBase::setupConnections( se->formWindow(), conns );
+ propertyEditor->eventList()->setup();
+ }
+}
+
+void MainWindow::updateWorkspace()
+{
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::showDebugStep( QObject *o, int line )
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->clearStep();
+ if ( !o || line == -1 )
+ return;
+ showSourceLine( o, line, Step );
+}
+
+void MainWindow::showStackFrame( QObject *o, int line )
+{
+ if ( !o || line == -1 )
+ return;
+ showSourceLine( o, line, StackFrame );
+}
+
+void MainWindow::showErrorMessage( QObject *o, int errorLine, const QString &errorMessage )
+{
+ if ( o ) {
+ errorLine--; // ######
+ QValueList<uint> l;
+ l << ( errorLine + 1 );
+ QStringList l2;
+ l2 << errorMessage;
+ QObjectList ol;
+ ol.append( o );
+ QStringList ll;
+ ll << currentProject->locationOfObject( o );
+ oWindow->setErrorMessages( l2, l, TRUE, ll, ol );
+ showSourceLine( o, errorLine, Error );
+ }
+}
+
+void MainWindow::finishedRun()
+{
+ inDebugMode = FALSE;
+ previewing = FALSE;
+ debuggingForms.clear();
+ enableAll( TRUE );
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == currentProject )
+ e->editorInterface()->setMode( EditorInterface::Editing );
+ e->clearStackFrame();
+ }
+ outputWindow()->clearErrorMessages();
+}
+
+void MainWindow::enableAll( bool enable )
+{
+ menuBar()->setEnabled( enable );
+ QObjectList *l = queryList( "QDockWindow" );
+ for ( QObject *o = l->first(); o; o = l->next() ) {
+ if ( o == wspace->parentWidget() ||
+ o == oWindow->parentWidget() ||
+ o == hierarchyView->parentWidget() )
+ continue;
+ ( (QWidget*)o )->setEnabled( enable );
+ }
+ delete l;
+}
+
+void MainWindow::showSourceLine( QObject *o, int line, LineMode lm )
+{
+ QWidgetList windows = qworkspace->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ FormWindow *fw = 0;
+ SourceEditor *se = 0;
+ SourceFile *sf = 0;
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ fw = (FormWindow*)w;
+ } else if ( ::qt_cast<SourceEditor*>(w) ) {
+ se = (SourceEditor*)w;
+ if ( !se->object() )
+ continue;
+ if ( se->formWindow() )
+ fw = se->formWindow();
+ else
+ sf = se->sourceFile();
+ }
+
+ if ( fw ) {
+ if ( fw->project() != currentProject )
+ continue;
+ if ( qstrcmp( fw->name(), o->name() ) == 0 ||
+ fw->isFake() && currentProject->objectForFakeForm( fw ) == o ) {
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ } else {
+ fw->showNormal();
+ fw->setFocus();
+ lastActiveFormWindow = fw;
+ qApp->processEvents();
+ se = editSource();
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ }
+ }
+ }
+ } else if ( se ) {
+ if ( o != sf )
+ continue;
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ return;
+ }
+ }
+
+ if ( ::qt_cast<SourceFile*>(o) ) {
+ for ( QPtrListIterator<SourceFile> sources = currentProject->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ if ( f == o ) {
+ SourceEditor *se = editSource( f );
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ }
+ return;
+ }
+ }
+ }
+
+ FormFile *ff = currentProject->fakeFormFileFor( o );
+ FormWindow *fw = 0;
+ if ( ff )
+ fw = ff->formWindow();
+
+ if ( !fw && !qwf_forms ) {
+ qWarning( "MainWindow::showSourceLine: qwf_forms is NULL!" );
+ return;
+ }
+
+ mblockNewForms = TRUE;
+ if ( !fw )
+ openFormWindow( currentProject->makeAbsolute( *qwf_forms->find( (QWidget*)o ) ) );
+ else
+ fw->formFile()->showEditor( FALSE );
+ qApp->processEvents(); // give all views the chance to get the formwindow
+ SourceEditor *se = editSource();
+ if ( se ) {
+ switch ( lm ) {
+ case Error:
+ se->editorInterface()->setError( line );
+ break;
+ case Step:
+ se->editorInterface()->setStep( line );
+ break;
+ case StackFrame:
+ se->editorInterface()->setStackFrame( line );
+ break;
+ }
+ }
+ mblockNewForms = FALSE;
+}
+
+
+QObject *MainWindow::findRealObject( QObject *o )
+{
+ QWidgetList windows = qWorkspace()->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( ::qt_cast<FormWindow*>(w) && QString( w->name() ) == QString( o->name() ) )
+ return w;
+ else if ( ::qt_cast<SourceEditor*>(w) && ( (SourceEditor*)w )->formWindow() &&
+ QString( ( (SourceEditor*)w )->formWindow()->name() ) == QString( o->name() ) )
+ return w;
+ else if ( ::qt_cast<SourceFile*>(w) && ( (SourceEditor*)w )->sourceFile() &&
+ ( (SourceEditor*)w )->sourceFile() == o )
+ return o;
+ }
+ return 0;
+}
+
+void MainWindow::formNameChanged( FormWindow *fw )
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->object() == fw )
+ e->refresh( TRUE );
+ if ( e->project() == fw->project() )
+ e->resetContext();
+ }
+}
+
+void MainWindow::breakPointsChanged()
+{
+ if ( !inDebugMode )
+ return;
+ if ( !qWorkspace()->activeWindow() || !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+ SourceEditor *e = (SourceEditor*)qWorkspace()->activeWindow();
+ if ( !e->object() || !e->project() )
+ return;
+ if ( e->project() != currentProject )
+ return;
+
+ if ( !interpreterPluginManager ) {
+ interpreterPluginManager =
+ new QPluginManager<InterpreterInterface>( IID_Interpreter,
+ QApplication::libraryPaths(),
+ "/qsa" );
+ }
+
+ InterpreterInterface *iiface = 0;
+ if ( interpreterPluginManager ) {
+ QString lang = currentProject->language();
+ iiface = 0;
+ interpreterPluginManager->queryInterface( lang, &iiface );
+ if ( !iiface )
+ return;
+ }
+
+ e->saveBreakPoints();
+
+ for ( QObject *o = debuggingForms.first(); o; o = debuggingForms.next() ) {
+ if ( qstrcmp( o->name(), e->object()->name() ) == 0 ) {
+ iiface->setBreakPoints( o, MetaDataBase::breakPoints( e->object() ) );
+ break;
+ }
+ }
+
+ for ( e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->project() == currentProject && e->sourceFile() ) {
+ QValueList<uint> bps = MetaDataBase::breakPoints( e->sourceFile() );
+ iiface->setBreakPoints( e->object(), bps );
+ }
+ }
+
+ iiface->release();
+}
+
+int MainWindow::currentLayoutDefaultSpacing() const
+{
+ if ( ( (MainWindow*)this )->formWindow() )
+ return ( (MainWindow*)this )->formWindow()->layoutDefaultSpacing();
+ return BOXLAYOUT_DEFAULT_SPACING;
+}
+
+int MainWindow::currentLayoutDefaultMargin() const
+{
+ if ( ( (MainWindow*)this )->formWindow() )
+ return ( (MainWindow*)this )->formWindow()->layoutDefaultMargin();
+ return BOXLAYOUT_DEFAULT_MARGIN;
+}
+
+void MainWindow::saveAllBreakPoints()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ e->save();
+ e->saveBreakPoints();
+ }
+}
+
+void MainWindow::resetBreakPoints()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->resetBreakPoints();
+}
+
+SourceFile *MainWindow::sourceFile()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( qworkspace->activeWindow() == e ) {
+ if ( e->sourceFile() )
+ return e->sourceFile();
+ }
+ }
+ return 0;
+}
+
+bool MainWindow::openProjectSettings( Project *pro )
+{
+ ProjectSettings dia( pro, this, 0, TRUE );
+ SenderObject *senderObject = new SenderObject( designerInterface() );
+ QValueList<Tab>::ConstIterator it;
+ for ( it = projectTabs.begin(); it != projectTabs.end(); ++it ) {
+ Tab t = *it;
+ if ( t.title != pro->language() )
+ continue;
+ dia.tabWidget->addTab( t.w, t.title );
+ if ( t.receiver ) {
+ connect( dia.buttonOk, SIGNAL( clicked() ), senderObject, SLOT( emitAcceptSignal() ) );
+ connect( senderObject, SIGNAL( acceptSignal( QUnknownInterface * ) ), t.receiver, t.accept_slot );
+ connect( senderObject, SIGNAL( initSignal( QUnknownInterface * ) ), t.receiver, t.init_slot );
+ senderObject->emitInitSignal();
+ disconnect( senderObject, SIGNAL( initSignal( QUnknownInterface * ) ), t.receiver, t.init_slot );
+ }
+ }
+
+ if ( singleProject )
+ dia.tabWidget->setTabEnabled( dia.tabSettings, FALSE );
+
+ int res = dia.exec();
+
+ delete senderObject;
+
+ for ( it = projectTabs.begin(); it != projectTabs.end(); ++it ) {
+ Tab t = *it;
+ dia.tabWidget->removePage( t.w );
+ t.w->reparent( 0, QPoint(0,0), FALSE );
+ }
+
+ return res == QDialog::Accepted;
+}
+
+void MainWindow::popupProjectMenu( const QPoint &pos )
+{
+ projectMenu->exec( pos );
+}
+
+QStringList MainWindow::sourceTemplates() const
+{
+ return sourceTemplatePluginManager->featureList();
+}
+
+SourceTemplateInterface* MainWindow::sourceTemplateInterface( const QString& templ )
+{
+ SourceTemplateInterface *iface = 0;
+ sourceTemplatePluginManager->queryInterface( templ, &iface);
+ return iface;
+}
+
+QString MainWindow::whatsThisFrom( const QString &key )
+{
+ if ( menuHelpFile.isEmpty() ) {
+ QString fn( documentationPath() );
+ fn += "/designer-manual-11.html";
+ QFile f( fn );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ menuHelpFile = ts.read();
+ }
+ }
+
+ int i = menuHelpFile.find( key );
+ if ( i == -1 )
+ return QString::null;
+ int start = i;
+ int end = i;
+ start = menuHelpFile.findRev( "<li>", i ) + 4;
+ end = menuHelpFile.find( '\n', i ) - 1;
+ return menuHelpFile.mid( start, end - start + 1 );
+}
+
+void MainWindow::setSingleProject( Project *pro )
+{
+ if ( eProject ) {
+ Project *pro = eProject;
+ pro->save();
+ QWidgetList windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( TRUE );
+ QWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ QWidget *w = wit.current();
+ ++wit;
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->project() == pro ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ ( (FormWindow*)w )->formFile()->close();
+ }
+ } else if ( ::qt_cast<SourceEditor*>(w) ) {
+ ( (SourceEditor*)w )->close();
+ }
+ }
+ hierarchyView->clear();
+ windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( FALSE );
+ currentProject = 0;
+ updateUndoRedo( FALSE, FALSE, QString::null, QString::null );
+ }
+
+ singleProject = TRUE;
+ projects.clear();
+ QAction *a = new QAction( i18n( pro->name() ), i18n( pro->name() ), 0,
+ actionGroupProjects, 0, TRUE );
+ eProject = pro;
+ projects.insert( a, eProject );
+ a->setOn( TRUE );
+ actionGroupProjects->removeFrom( projectMenu );
+ actionGroupProjects->removeFrom( projectToolBar );
+ currentProject = eProject;
+ currentProject->designerCreated();
+}
+
+void MainWindow::shuttingDown()
+{
+ outputWindow()->shuttingDown();
+}
+
+void MainWindow::showGUIStuff( bool b )
+{
+ if ( (bool)guiStuffVisible == b )
+ return;
+ guiStuffVisible = b;
+ if ( !b ) {
+ setAppropriate( (QDockWindow*)toolBox->parentWidget(), FALSE );
+ toolBox->parentWidget()->hide();
+ for ( QToolBar *tb = widgetToolBars.first(); tb; tb = widgetToolBars.next() ) {
+ tb->hide();
+ setAppropriate( tb, FALSE );
+ }
+ propertyEditor->setPropertyEditorEnabled( FALSE );
+ setAppropriate( layoutToolBar, FALSE );
+ layoutToolBar->hide();
+ setAppropriate( toolsToolBar, FALSE );
+ toolsToolBar->hide();
+ menubar->removeItem( toolsMenuId );
+ menubar->removeItem( toolsMenuId + 1 );
+ menubar->removeItem( toolsMenuId + 2 );
+ disconnect( this, SIGNAL( hasActiveForm(bool) ), actionEditAccels, SLOT( setEnabled(bool) ) );
+ disconnect( this, SIGNAL( hasActiveForm(bool) ), actionEditFunctions, SLOT( setEnabled(bool) ) );
+ disconnect( this, SIGNAL( hasActiveForm(bool) ), actionEditConnections, SLOT( setEnabled(bool) ) );
+ disconnect( this, SIGNAL( hasActiveForm(bool) ), actionEditSource, SLOT( setEnabled(bool) ) );
+ disconnect( this, SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, SLOT( setEnabled(bool) ) );
+ actionEditFormSettings->setEnabled( FALSE );
+ actionEditSource->setEnabled( FALSE );
+ actionEditConnections->setEnabled( FALSE );
+ actionEditFunctions->setEnabled( FALSE );
+ actionEditAccels->setEnabled( FALSE );
+ ( (QDockWindow*)propertyEditor->parentWidget() )->
+ setCaption( i18n( "Signal Handlers" ) );
+ actionGroupNew->removeFrom( fileMenu );
+ actionGroupNew->removeFrom( projectToolBar );
+ actionFileSave->removeFrom( fileMenu );
+ actionFileSave->removeFrom( projectToolBar );
+ actionFileExit->removeFrom( fileMenu );
+ actionNewFile->addTo( fileMenu );
+ actionNewFile->addTo( projectToolBar );
+ actionFileSave->addTo( fileMenu );
+ actionFileSave->addTo( projectToolBar );
+ actionFileExit->addTo( fileMenu );
+ } else {
+ setAppropriate( (QDockWindow*)toolBox->parentWidget(), TRUE );
+ toolBox->parentWidget()->show();
+ for ( QToolBar *tb = widgetToolBars.first(); tb; tb = widgetToolBars.next() ) {
+ setAppropriate( tb, TRUE );
+ tb->hide();
+ }
+ propertyEditor->setPropertyEditorEnabled( TRUE );
+ setAppropriate( layoutToolBar, TRUE );
+ layoutToolBar->show();
+ setAppropriate( toolsToolBar, TRUE );
+ toolsToolBar->show();
+ menubar->insertItem( i18n( "&Tools" ), toolsMenu, toolsMenuId, toolsMenuIndex );
+ menubar->insertItem( i18n( "&Layout" ), layoutMenu, toolsMenuId + 1, toolsMenuIndex + 1 );
+ menubar->insertItem( i18n( "&Preview" ), previewMenu, toolsMenuId + 2, toolsMenuIndex + 2 );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditAccels, SLOT( setEnabled(bool) ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditFunctions, SLOT( setEnabled(bool) ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditConnections, SLOT( setEnabled(bool) ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditSource, SLOT( setEnabled(bool) ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, SLOT( setEnabled(bool) ) );
+ actionEditFormSettings->setEnabled( TRUE );
+ actionEditSource->setEnabled( TRUE );
+ actionEditConnections->setEnabled( TRUE );
+ actionEditFunctions->setEnabled( TRUE );
+ actionEditAccels->setEnabled( TRUE );
+ ( (QDockWindow*)propertyEditor->parentWidget() )->
+ setCaption( i18n( "Property Editor/Signal Handlers" ) );
+ actionFileSave->removeFrom( fileMenu );
+ actionFileSave->removeFrom( projectToolBar );
+ actionFileExit->removeFrom( fileMenu );
+ actionGroupNew->addTo( fileMenu );
+ actionGroupNew->addTo( projectToolBar );
+ actionFileSave->addTo( fileMenu );
+ actionFileSave->addTo( projectToolBar );
+ actionFileExit->addTo( fileMenu );
+ }
+}
+
+void MainWindow::setEditorsReadOnly( bool b )
+{
+ editorsReadOnly = b;
+}
+
+void MainWindow::setPluginDirectory( const QString &pd )
+{
+ pluginDir = pd;
+ if ( !qwf_plugin_dir )
+ qwf_plugin_dir = new QString( pd );
+ else
+ *qwf_plugin_dir = pd;
+}
+
+void MainWindow::toggleSignalHandlers( bool show )
+{
+ if ( sSignalHandlers == show )
+ return;
+ sSignalHandlers = show;
+ propertyEditor->setSignalHandlersEnabled( show );
+}
+
+void MainWindow::statusMessage( const QString &msg )
+{
+ m_part->statusMessage(msg);
+}
diff --git a/kdevdesigner/designer/mainwindow.h b/kdevdesigner/designer/mainwindow.h
new file mode 100644
index 00000000..43a4974a
--- /dev/null
+++ b/kdevdesigner/designer/mainwindow.h
@@ -0,0 +1,511 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include "metadatabase.h"
+#include "../interfaces/actioninterface.h" // for GCC 2.7.* compatibility
+#include "../interfaces/editorinterface.h"
+#include "../interfaces/templatewizardiface.h"
+#include "../interfaces/languageinterface.h"
+#include "../interfaces/filterinterface.h"
+#include "../interfaces/interpreterinterface.h"
+#include "../interfaces/preferenceinterface.h"
+#include "../interfaces/projectsettingsiface.h"
+#include "../interfaces/sourcetemplateiface.h"
+#include "sourceeditor.h"
+
+#include <qaction.h>
+#include <qmainwindow.h>
+#include <qmap.h>
+#include <qguardedptr.h>
+#include <private/qpluginmanager_p.h>
+#include <qobjectlist.h>
+
+class QToolBox;
+class PropertyEditor;
+class QWorkspace;
+class QMenuBar;
+class FormWindow;
+class QPopupMenu;
+class HierarchyView;
+class QCloseEvent;
+class Workspace;
+class ActionEditor;
+class Project;
+class OutputWindow;
+class QTimer;
+class FindDialog;
+struct DesignerProject;
+class ReplaceDialog;
+class GotoLineDialog;
+class SourceFile;
+class FormFile;
+class QAssistantClient;
+class DesignerAction;
+
+#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
+#include <qtoolbar.h>
+#else
+class QToolBar;
+#endif
+class Preferences;
+
+class KDevDesignerPart;
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ enum LineMode { Error, Step, StackFrame };
+
+ MainWindow( KDevDesignerPart *part, bool asClient, bool single = FALSE, const QString &plgDir = "/designer" );
+ ~MainWindow();
+
+ HierarchyView *objectHierarchy() const;
+ Workspace *workspace() const;
+ PropertyEditor *propertyeditor() const;
+ ActionEditor *actioneditor() const;
+
+ void resetTool();
+ int currentTool() const;
+
+ FormWindow *formWindow();
+
+ bool unregisterClient( FormWindow *w );
+ void editorClosed( SourceEditor *e );
+ QWidget *isAFormWindowChild( QObject *o ) const;
+ QWidget *isAToolBarChild( QObject *o ) const;
+
+ void insertFormWindow( FormWindow *fw );
+ QWorkspace *qWorkspace() const;
+
+ void popupFormWindowMenu( const QPoint &gp, FormWindow *fw );
+ void popupWidgetMenu( const QPoint &gp, FormWindow *fw, QWidget *w );
+
+ QPopupMenu *setupNormalHierarchyMenu( QWidget *parent );
+ QPopupMenu *setupTabWidgetHierarchyMenu( QWidget *parent, const char *addSlot, const char *removeSlot );
+
+ FormWindow *openFormWindow( const QString &fn, bool validFileName = TRUE, FormFile *ff = 0 );
+ bool isCustomWidgetUsed( MetaDataBase::CustomWidget *w );
+
+ void setGrid( const QPoint &p );
+ void setShowGrid( bool b );
+ void setSnapGrid( bool b );
+ QPoint grid() const { return grd; }
+ bool showGrid() const { return sGrid; }
+ bool snapGrid() const { return snGrid && sGrid; }
+
+ QString documentationPath() const;
+
+ static MainWindow *self;
+
+ QString templatePath() const { return templPath; }
+
+ void editFunction( const QString &func, bool rereadSource = FALSE );
+
+ bool isPreviewing() const { return previewing; }
+
+ Project *currProject() const { return currentProject; }
+
+ FormWindow *activeForm() const { return lastActiveFormWindow; }
+
+ TemplateWizardInterface* templateWizardInterface( const QString& className );
+ QStringList sourceTemplates() const;
+ SourceTemplateInterface* sourceTemplateInterface( const QString& templ );
+ QUnknownInterface* designerInterface() const { return desInterface; }
+ QPtrList<DesignerProject> projectList() const;
+ QStringList projectNames() const;
+ QStringList projectFileNames() const;
+ Project *findProject( const QString &projectName ) const;
+ void setCurrentProject( Project *pro );
+ void setCurrentProjectByFilename( const QString& proFilename );
+ OutputWindow *outputWindow() const { return oWindow; }
+ void addPreferencesTab( QWidget *tab, const QString &title, QObject *receiver, const char *init_slot, const char *accept_slot );
+ void addProjectTab( QWidget *tab, const QString &title, QObject *receiver, const char *init_slot, const char *accept_slot );
+ void setModified( bool b, QWidget *window );
+ void functionsChanged();
+ void updateFunctionList();
+ void updateWorkspace();
+ void runProjectPrecondition();
+ void runProjectPostcondition( QObjectList *l );
+
+ void formNameChanged( FormWindow *fw );
+
+ int currentLayoutDefaultSpacing() const;
+ int currentLayoutDefaultMargin() const;
+
+ void saveAllBreakPoints();
+ void resetBreakPoints();
+
+ SourceFile *sourceFile();
+ void createNewProject( const QString &lang );
+
+ void popupProjectMenu( const QPoint &pos );
+ QObject *findRealObject( QObject *o );
+
+ void setSingleProject( Project *pro );
+ bool singleProjectMode() const { return singleProject; }
+
+ void showSourceLine( QObject *o, int line, LineMode lm );
+
+ void shuttingDown();
+ void showGUIStuff( bool b );
+ void setEditorsReadOnly( bool b );
+ bool areEditorsReadOnly() const { return editorsReadOnly; }
+ void toggleSignalHandlers( bool show );
+ bool showSignalHandlers() const { return sSignalHandlers; }
+ void writeConfig();
+
+ void openProject( const QString &fn );
+ void setPluginDirectory( const QString &pd );
+ QString pluginDirectory() const { return pluginDir; }
+
+ QAssistantClient* assistantClient() const { return assistant; }
+
+ void addRecentlyOpenedFile( const QString &fn ) { addRecentlyOpened( fn, recentlyFiles ); }
+
+ void statusMessage(const QString &msg);
+
+ //integration
+ KDevDesignerPart *part() const { return m_part; }
+
+public slots:
+ void showProperties( QObject *w );
+ void updateProperties( QObject *w );
+ void showDialogHelp();
+ void showDebugStep( QObject *o, int line );
+ void showStackFrame( QObject *o, int line );
+ void showErrorMessage( QObject *o, int line, const QString &errorMessage );
+ void finishedRun();
+ void breakPointsChanged();
+
+signals:
+ void currentToolChanged();
+ void hasActiveForm( bool );
+ void hasActiveWindow( bool );
+ void hasActiveWindowOrProject( bool );
+ void hasNonDummyProject( bool );
+ void formModified( bool );
+ void formWindowsChanged();
+ void formWindowChanged();
+ void projectChanged();
+ void editorChanged();
+
+protected:
+ bool eventFilter( QObject *o, QEvent *e );
+ void closeEvent( QCloseEvent *e );
+
+public slots:
+ void fileNew();
+ void fileNewDialog();
+ void fileNewFile();
+ void fileClose();
+ void fileQuit();
+ void fileCloseProject(); // not visible in menu, called from fileClose
+ void fileOpen();
+ void fileOpen( const QString &filter, const QString &extension, const QString &filename = "" , bool inProject = TRUE );
+ bool fileSave();
+ bool fileSaveForm(); // not visible in menu, called from fileSave
+ bool fileSaveProject(); // not visible in menu, called from fileSaveProject
+ bool fileSaveAs();
+ void fileSaveAll();
+ void fileCreateTemplate();
+
+public slots:
+ void editUndo();
+ void editRedo();
+ void editCut();
+ void editCopy();
+ void editPaste();
+ void editDelete();
+ void editSelectAll();
+ void editLower();
+ void editRaise();
+ void editAdjustSize();
+ void editLayoutHorizontal();
+ void editLayoutVertical();
+ void editLayoutHorizontalSplit();
+ void editLayoutVerticalSplit();
+ void editLayoutGrid();
+ void editLayoutContainerHorizontal();
+ void editLayoutContainerVertical();
+ void editLayoutContainerGrid();
+ void editBreakLayout();
+ void editAccels();
+ void editFunctions();
+ void editConnections();
+ SourceEditor *editSource();
+ SourceEditor *editSource( SourceFile *f );
+ SourceEditor *openSourceEditor();
+ SourceEditor *createSourceEditor( QObject *object, Project *project,
+ const QString &lang = QString::null,
+ const QString &func = QString::null,
+ bool rereadSource = FALSE );
+ void editFormSettings();
+ void editProjectSettings();
+ void editPixmapCollection();
+ void editDatabaseConnections();
+ void editPreferences();
+
+ void projectInsertFile();
+
+ void searchFind();
+ void searchIncremetalFindMenu();
+ void searchIncremetalFind();
+ void searchIncremetalFindNext();
+ void searchReplace();
+ void searchGotoLine();
+
+ void previewForm();
+ void previewForm( const QString& );
+
+ void toolsCustomWidget();
+ void toolsConfigure();
+
+ void helpContents();
+ void helpManual();
+ void helpAbout();
+ void helpAboutQt();
+ void helpRegister();
+
+private slots:
+ void activeWindowChanged( QWidget *w );
+ void updateUndoRedo( bool, bool, const QString &, const QString & );
+ void updateEditorUndoRedo();
+
+ void toolSelected( QAction* );
+
+ void clipboardChanged();
+ void selectionChanged();
+
+ void windowsMenuActivated( int id );
+ void setupWindowActions();
+
+ void createNewTemplate();
+ void projectSelected( QAction *a );
+
+ void setupRecentlyFilesMenu();
+ void setupRecentlyProjectsMenu();
+ void recentlyFilesMenuActivated( int id );
+ void recentlyProjectsMenuActivated( int id );
+
+ void emitProjectSignals();
+
+ void showStartDialog();
+
+private:
+ void setupMDI();
+ void setupMenuBar();
+ void setupEditActions();
+ void setupProjectActions();
+ void setupSearchActions();
+ void setupToolActions();
+ void setupLayoutActions();
+ void setupFileActions();
+ void setupPreviewActions();
+ void setupHelpActions();
+ void setupRMBMenus();
+
+ void setupPropertyEditor();
+ void setupHierarchyView();
+ void setupWorkspace();
+ void setupActionEditor();
+ void setupOutputWindow();
+ void setupToolbox();
+
+ void setupActionManager();
+ void setupPluginManagers();
+
+ void enableAll( bool enable );
+
+ QWidget* previewFormInternal( QStyle* style = 0, QPalette* pal = 0 );
+
+ void readConfig();
+
+ void setupRMBProperties( QValueList<uint> &ids, QMap<QString, int> &props, QWidget *w );
+ void handleRMBProperties( int id, QMap<QString, int> &props, QWidget *w );
+ void setupRMBSpecialCommands( QValueList<uint> &ids, QMap<QString, int> &commands, QWidget *w );
+ void handleRMBSpecialCommands( int id, QMap<QString, int> &commands, QWidget *w );
+ void setupRMBSpecialCommands( QValueList<uint> &ids, QMap<QString, int> &commands, FormWindow *w );
+ void handleRMBSpecialCommands( int id, QMap<QString, int> &commands, FormWindow *w );
+ bool openEditor( QWidget *w, FormWindow *fw );
+ void rebuildCustomWidgetGUI();
+ void rebuildCommonWidgetsToolBoxPage();
+ void checkTempFiles();
+
+ void addRecentlyOpened( const QString &fn, QStringList &lst );
+
+ QString whatsThisFrom( const QString &key );
+
+private slots:
+ void doFunctionsChanged();
+ bool openProjectSettings( Project *pro );
+
+private:
+ struct Tab
+ {
+ QWidget *w;
+ QString title;
+ QObject *receiver;
+ const char *init_slot, *accept_slot;
+ Q_DUMMY_COMPARISON_OPERATOR( Tab )
+ };
+
+private:
+ PropertyEditor *propertyEditor;
+ HierarchyView *hierarchyView;
+ Workspace *wspace;
+ QWidget *lastPressWidget;
+ QWorkspace *qworkspace;
+ QMenuBar *menubar;
+ QGuardedPtr<FormWindow> lastActiveFormWindow;
+ bool breakLayout, layoutChilds, layoutSelected;
+ QPoint grd;
+ bool sGrid, snGrid;
+ bool restoreConfig;
+ bool backPix;
+ bool splashScreen;
+ QString fileFilter;
+
+ QMap<QAction*, Project*> projects;
+ DesignerAction *actionEditUndo, *actionEditRedo, *actionEditCut, *actionEditCopy,
+ *actionEditPaste, *actionEditDelete,
+ *actionEditAdjustSize,
+ *actionEditHLayout, *actionEditVLayout, *actionEditGridLayout,
+ *actionEditSplitHorizontal, *actionEditSplitVertical,
+ *actionEditSelectAll, *actionEditBreakLayout, *actionEditFunctions, *actionEditConnections,
+ *actionEditLower, *actionEditRaise;
+ QAction *actionInsertSpacer;
+ QActionGroup *actionGroupTools, *actionGroupProjects;
+ QAction* actionPointerTool, *actionConnectTool, *actionOrderTool, *actionBuddyTool;
+ QAction* actionCurrentTool;
+ DesignerAction *actionHelpContents, *actionHelpAbout, *actionHelpAboutQt, *actionHelpWhatsThis;
+ DesignerAction *actionHelpManual;
+#if defined(QT_NON_COMMERCIAL)
+ DesignerAction *actionHelpRegister;
+#endif
+ DesignerAction *actionToolsCustomWidget, *actionEditPreferences;
+ DesignerAction *actionWindowTile, *actionWindowCascade, *actionWindowClose, *actionWindowCloseAll;
+ DesignerAction *actionWindowNext, *actionWindowPrevious;
+ DesignerAction *actionEditFormSettings, *actionEditAccels;
+ DesignerAction *actionEditSource, *actionNewFile, *actionFileSave, *actionFileExit;
+ DesignerAction *actionFileClose, *actionFileSaveAs, *actionFileSaveAll;
+ DesignerAction *actionSearchFind, *actionSearchIncremetal, *actionSearchReplace, *actionSearchGotoLine;
+ DesignerAction *actionProjectAddFile, *actionEditPixmapCollection, *actionEditDatabaseConnections,
+ *actionEditProjectSettings, *actionPreview;
+ QActionGroup *actionGroupNew;
+
+ QPopupMenu *rmbWidgets;
+ QPopupMenu *rmbFormWindow;
+ QPopupMenu *customWidgetMenu, *windowMenu, *fileMenu, *recentlyFilesMenu, *recentlyProjectsMenu;
+ QPopupMenu *toolsMenu, *layoutMenu, *previewMenu;
+ QToolBar *customWidgetToolBar, *layoutToolBar, *projectToolBar, *customWidgetToolBar2, *toolsToolBar;
+ QToolBar *commonWidgetsToolBar;
+ QPtrList<QToolBar> widgetToolBars;
+
+ Preferences *prefDia;
+ QMap<QString,QString> propertyDocumentation;
+ bool client;
+ QString templPath;
+ ActionEditor *actionEditor;
+ Project *currentProject;
+ QPluginManager<ActionInterface> *actionPluginManager;
+ QPluginManager<EditorInterface> *editorPluginManager;
+ QPluginManager<TemplateWizardInterface> *templateWizardPluginManager;
+ QPluginManager<InterpreterInterface> *interpreterPluginManager;
+ QPluginManager<PreferenceInterface> *preferencePluginManager;
+ QPluginManager<ProjectSettingsInterface> *projectSettingsPluginManager;
+ QPluginManager<SourceTemplateInterface> *sourceTemplatePluginManager;
+ QPtrList<SourceEditor> sourceEditors;
+ bool previewing;
+ QUnknownInterface *desInterface;
+ QStringList recentlyFiles;
+ QStringList recentlyProjects;
+ OutputWindow *oWindow;
+ QValueList<Tab> preferenceTabs;
+ QValueList<Tab> projectTabs;
+ bool databaseAutoEdit;
+ QTimer *updateFunctionsTimer;
+ QTimer *autoSaveTimer;
+ bool autoSaveEnabled;
+ int autoSaveInterval;
+ QLineEdit *incrementalSearch;
+ QGuardedPtr<FindDialog> findDialog;
+ QGuardedPtr<ReplaceDialog> replaceDialog;
+ QGuardedPtr<GotoLineDialog> gotoLineDialog;
+ Project *eProject;
+ bool inDebugMode;
+ QObjectList debuggingForms;
+ QString lastOpenFilter;
+ QGuardedPtr<QWidget> previewedForm;
+ QPopupMenu *projectMenu;
+ QString menuHelpFile;
+ bool singleProject;
+ QToolBox *toolBox;
+ int toolsMenuId, toolsMenuIndex;
+ uint guiStuffVisible : 1;
+ uint editorsReadOnly : 1;
+ uint savePluginPaths : 1;
+ QAssistantClient *assistant;
+ bool shStartDialog;
+ QString pluginDir;
+ bool sSignalHandlers;
+
+ KDevDesignerPart *m_part;
+
+public:
+ QString lastSaveFilter;
+ QPtrList<QAction> toolActions;
+ QPtrList<QAction> commonWidgetsPage;
+
+friend class KDevDesignerPart;
+};
+
+class SenderObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ SenderObject( QUnknownInterface *i ) : iface( i ) { iface->addRef(); }
+ ~SenderObject() { iface->release(); }
+
+public slots:
+ void emitInitSignal() { emit initSignal( iface ); }
+ void emitAcceptSignal() { emit acceptSignal( iface ); }
+
+signals:
+ void initSignal( QUnknownInterface * );
+ void acceptSignal( QUnknownInterface * );
+
+private:
+ QUnknownInterface *iface;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/mainwindowactions.cpp b/kdevdesigner/designer/mainwindowactions.cpp
new file mode 100644
index 00000000..d6ed0982
--- /dev/null
+++ b/kdevdesigner/designer/mainwindowactions.cpp
@@ -0,0 +1,2067 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "mainwindow.h"
+
+#include <kiconloader.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <klineedit.h>
+
+#include <stdlib.h>
+#include <qaction.h>
+#include <qwhatsthis.h>
+#include <qpopupmenu.h>
+#include <qmenubar.h>
+#include <qtooltip.h>
+#include <qapplication.h>
+#include <qsignalmapper.h>
+#include <qstylefactory.h>
+#include <qworkspace.h>
+#include <qmessagebox.h>
+#include <qstatusbar.h>
+#include <qlistbox.h>
+#include <qclipboard.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qinputdialog.h>
+#include <qdatetimeedit.h>
+#include <qtextedit.h>
+
+#include "defs.h"
+#include "project.h"
+#include "widgetdatabase.h"
+#include "widgetfactory.h"
+#include "preferences.h"
+#include "formwindow.h"
+#include "newformimpl.h"
+#include "resource.h"
+#include "projectsettingsimpl.h"
+#include "workspace.h"
+#include "createtemplate.h"
+#include "hierarchyview.h"
+#include "editfunctionsimpl.h"
+#include "finddialog.h"
+#include "replacedialog.h"
+#include "gotolinedialog.h"
+#include "formsettingsimpl.h"
+#include "pixmapcollectioneditor.h"
+#include "styledbutton.h"
+#include "customwidgeteditorimpl.h"
+#ifndef QT_NO_SQL
+#include "dbconnectionsimpl.h"
+#include "dbconnectionimpl.h"
+#endif
+#include "widgetaction.h"
+#include <qtoolbox.h>
+#include "startdialogimpl.h"
+#include "designerappiface.h"
+#include "connectiondialog.h"
+#include "configtoolboxdialog.h"
+#include "designeraction.h"
+
+#include "kdevdesigner_part.h"
+
+static const char * whatsthis_image[] = {
+ "16 16 3 1",
+ " c None",
+ "o c #000000",
+ "a c #000080",
+ "o aaaaa ",
+ "oo aaa aaa ",
+ "ooo aaa aaa",
+ "oooo aa aa",
+ "ooooo aa aa",
+ "oooooo a aaa",
+ "ooooooo aaa ",
+ "oooooooo aaa ",
+ "ooooooooo aaa ",
+ "ooooo aaa ",
+ "oo ooo ",
+ "o ooo aaa ",
+ " ooo aaa ",
+ " ooo ",
+ " ooo ",
+ " ooo "};
+
+const QString toolbarHelp = "<p>Toolbars contain a number of buttons to "
+"provide quick access to often used functions.%1"
+"<br>Click on the toolbar handle to hide the toolbar, "
+"or drag and place the toolbar to a different location.</p>";
+
+static QIconSet createIconSet( const QString &name )
+{
+ QIconSet ic( BarIcon( "" + name, KDevDesignerPartFactory::instance() ) );
+ QString prefix = "designer_";
+ int right = name.length() - prefix.length();
+ ic.setPixmap( BarIcon( prefix + "d_" + name.right( right ), KDevDesignerPartFactory::instance() ),
+ QIconSet::Small, QIconSet::Disabled );
+ return ic;
+}
+
+void MainWindow::setupEditActions()
+{
+ actionEditUndo = new DesignerAction( i18n("Undo"), createIconSet( "designer_undo.png" ),i18n("&Undo: Not Available"), CTRL + Key_Z, this, 0 );
+ actionEditUndo->setStatusTip( i18n( "Undoes the last action" ) );
+ actionEditUndo->setWhatsThis( whatsThisFrom( "Edit|Undo" ) );
+ connect( actionEditUndo, SIGNAL( activated() ), this, SLOT( editUndo() ) );
+ actionEditUndo->setEnabled( FALSE );
+
+ actionEditRedo = new DesignerAction( i18n( "Redo" ), createIconSet("designer_redo.png"), i18n( "&Redo: Not Available" ), CTRL + Key_Y, this, 0 );
+ actionEditRedo->setStatusTip( i18n( "Redoes the last undone operation") );
+ actionEditRedo->setWhatsThis( whatsThisFrom( "Edit|Redo" ) );
+ connect( actionEditRedo, SIGNAL( activated() ), this, SLOT( editRedo() ) );
+ actionEditRedo->setEnabled( FALSE );
+
+ actionEditCut = new DesignerAction( i18n( "Cut" ), createIconSet("designer_editcut.png"), i18n( "Cu&t" ), CTRL + Key_X, this, 0 );
+ actionEditCut->setStatusTip( i18n( "Cuts the selected widgets and puts them on the clipboard" ) );
+ actionEditCut->setWhatsThis( whatsThisFrom( "Edit|Cut" ) );
+ connect( actionEditCut, SIGNAL( activated() ), this, SLOT( editCut() ) );
+ actionEditCut->setEnabled( FALSE );
+
+ actionEditCopy = new DesignerAction( i18n( "Copy" ), createIconSet("designer_editcopy.png"), i18n( "&Copy" ), CTRL + Key_C, this, 0 );
+ actionEditCopy->setStatusTip( i18n( "Copies the selected widgets to the clipboard" ) );
+ actionEditCopy->setWhatsThis( whatsThisFrom( "Edit|Copy" ) );
+ connect( actionEditCopy, SIGNAL( activated() ), this, SLOT( editCopy() ) );
+ actionEditCopy->setEnabled( FALSE );
+
+ actionEditPaste = new DesignerAction( i18n( "Paste" ), createIconSet("designer_editpaste.png"), i18n( "&Paste" ), CTRL + Key_V, this, 0 );
+ actionEditPaste->setStatusTip( i18n( "Pastes the clipboard's contents" ) );
+ actionEditPaste->setWhatsThis( whatsThisFrom( "Edit|Paste" ) );
+ connect( actionEditPaste, SIGNAL( activated() ), this, SLOT( editPaste() ) );
+ actionEditPaste->setEnabled( FALSE );
+
+ actionEditDelete = new DesignerAction( i18n( "Delete" ), QPixmap(), i18n( "&Delete" ), Key_Delete, this, 0 );
+ actionEditDelete->setStatusTip( i18n( "Deletes the selected widgets" ) );
+ actionEditDelete->setWhatsThis( whatsThisFrom( "Edit|Delete" ) );
+ connect( actionEditDelete, SIGNAL( activated() ), this, SLOT( editDelete() ) );
+ actionEditDelete->setEnabled( FALSE );
+#ifdef Q_WS_MAC
+ QAction *macDelete = new DesignerAction( i18n( "Delete" ), QPixmap(), i18n( "&Delete" ), Key_Backspace, this, 0 );
+ connect( macDelete, SIGNAL( activated() ), this, SLOT( editDelete() ) );
+#endif
+
+ actionEditSelectAll = new DesignerAction( i18n( "Select All" ), QPixmap(), i18n( "Select &All" ), CTRL + Key_A, this, 0 );
+ actionEditSelectAll->setStatusTip( i18n( "Selects all widgets" ) );
+ actionEditSelectAll->setWhatsThis( whatsThisFrom( "Edit|Select All" ) );
+ connect( actionEditSelectAll, SIGNAL( activated() ), this, SLOT( editSelectAll() ) );
+ actionEditSelectAll->setEnabled( TRUE );
+
+ actionEditRaise = new DesignerAction( i18n( "Bring to Front" ), createIconSet("designer_editraise.png"), i18n( "Bring to &Front" ), 0, this, 0 );
+ actionEditRaise->setStatusTip( i18n( "Raises the selected widgets" ) );
+ actionEditRaise->setWhatsThis( i18n( "Raises the selected widgets" ) );
+ connect( actionEditRaise, SIGNAL( activated() ), this, SLOT( editRaise() ) );
+ actionEditRaise->setEnabled( FALSE );
+
+ actionEditLower = new DesignerAction( i18n( "Send to Back" ), createIconSet("designer_editlower.png"), i18n( "Send to &Back" ), 0, this, 0 );
+ actionEditLower->setStatusTip( i18n( "Lowers the selected widgets" ) );
+ actionEditLower->setWhatsThis( i18n( "Lowers the selected widgets" ) );
+ connect( actionEditLower, SIGNAL( activated() ), this, SLOT( editLower() ) );
+ actionEditLower->setEnabled( FALSE );
+
+ actionEditAccels = new DesignerAction( i18n( "Check Accelerators" ), QPixmap(),
+ i18n( "Chec&k Accelerators" ), ALT + Key_R, this, 0 );
+ actionEditAccels->setStatusTip( i18n("Checks if the accelerators used in the form are unique") );
+ actionEditAccels->setWhatsThis( whatsThisFrom( "Edit|Check Accelerator" ) );
+ connect( actionEditAccels, SIGNAL( activated() ), this, SLOT( editAccels() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditAccels, SLOT( setEnabled(bool) ) );
+
+ actionEditFunctions = new DesignerAction( i18n( "Slots" ), createIconSet("designer_editslots.png"),
+ i18n( "S&lots..." ), 0, this, 0 );
+ actionEditFunctions->setStatusTip( i18n("Opens a dialog for editing slots") );
+ actionEditFunctions->setWhatsThis( whatsThisFrom( "Edit|Slots" ) );
+ connect( actionEditFunctions, SIGNAL( activated() ), this, SLOT( editFunctions() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditFunctions, SLOT( setEnabled(bool) ) );
+
+ actionEditConnections = new DesignerAction( i18n( "Connections" ), createIconSet("designer_connecttool.png"),
+ i18n( "Co&nnections..." ), 0, this, 0 );
+ actionEditConnections->setStatusTip( i18n("Opens a dialog for editing connections") );
+ actionEditConnections->setWhatsThis( whatsThisFrom( "Edit|Connections" ) );
+ connect( actionEditConnections, SIGNAL( activated() ), this, SLOT( editConnections() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditConnections, SLOT( setEnabled(bool) ) );
+
+ actionEditSource = new DesignerAction( i18n( "Source" ), QIconSet(),
+ i18n( "&Source..." ), CTRL + Key_E, this, 0 );
+ actionEditSource->setStatusTip( i18n("Opens an editor to edit the form's source code") );
+ actionEditSource->setWhatsThis( whatsThisFrom( "Edit|Source" ) );
+ connect( actionEditSource, SIGNAL( activated() ), this, SLOT( editSource() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditSource, SLOT( setEnabled(bool) ) );
+
+ actionEditFormSettings = new DesignerAction( i18n( "Form Settings" ), QPixmap(),
+ i18n( "&Form Settings..." ), 0, this, 0 );
+ actionEditFormSettings->setStatusTip( i18n("Opens a dialog to change the form's settings") );
+ actionEditFormSettings->setWhatsThis( whatsThisFrom( "Edit|Form Settings" ) );
+ connect( actionEditFormSettings, SIGNAL( activated() ), this, SLOT( editFormSettings() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), actionEditFormSettings, SLOT( setEnabled(bool) ) );
+
+ actionEditPreferences = new DesignerAction( i18n( "Preferences" ), QPixmap(),
+ i18n( "Preferences..." ), 0, this, 0 );
+ actionEditPreferences->setStatusTip( i18n("Opens a dialog to change preferences") );
+ actionEditPreferences->setWhatsThis( whatsThisFrom( "Edit|Preferences" ) );
+ connect( actionEditPreferences, SIGNAL( activated() ), this, SLOT( editPreferences() ) );
+
+/* QToolBar *tb = new QToolBar( this, "Edit" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ QWhatsThis::add( tb, i18n( "<b>The Edit toolbar</b>%1").arg(i18n(toolbarHelp).arg("")) );
+ addToolBar( tb, i18n( "Edit" ) );
+ actionEditUndo->addTo( tb );
+ actionEditRedo->addTo( tb );
+ tb->addSeparator();
+ actionEditCut->addTo( tb );
+ actionEditCopy->addTo( tb );
+ actionEditPaste->addTo( tb );*/
+#if 0
+ tb->addSeparator();
+ actionEditLower->addTo( tb );
+ actionEditRaise->addTo( tb );
+#endif
+
+ QPopupMenu *menu = new QPopupMenu( this, "Edit" );
+ connect( menu, SIGNAL( aboutToShow() ), this, SLOT( updateEditorUndoRedo() ) );
+ menubar->insertItem( i18n( "&Edit" ), menu );
+ actionEditUndo->addTo( menu );
+ actionEditRedo->addTo( menu );
+ menu->insertSeparator();
+ actionEditCut->addTo( menu );
+ actionEditCopy->addTo( menu );
+ actionEditPaste->addTo( menu );
+ actionEditDelete->addTo( menu );
+ actionEditSelectAll->addTo( menu );
+ actionEditAccels->addTo( menu );
+#if 0
+ menu->insertSeparator();
+ actionEditLower->addTo( menu );
+ actionEditRaise->addTo( menu );
+#endif
+ menu->insertSeparator();
+ if ( !singleProjectMode() ) {
+ actionEditFunctions->addTo( menu );
+ actionEditConnections->addTo( menu );
+ }
+ actionEditFormSettings->addTo( menu );
+ menu->insertSeparator();
+ actionEditPreferences->addTo( menu );
+}
+
+void MainWindow::setupSearchActions()
+{
+ actionSearchFind = new DesignerAction( i18n( "Find" ), createIconSet( "designer_searchfind.png" ),
+ i18n( "&Find..." ), CTRL + Key_F, this, 0 );
+ connect( actionSearchFind, SIGNAL( activated() ), this, SLOT( searchFind() ) );
+ actionSearchFind->setEnabled( FALSE );
+ actionSearchFind->setWhatsThis( whatsThisFrom( "Search|Find" ) );
+
+ actionSearchIncremetal = new DesignerAction( i18n( "Find Incremental" ), QIconSet(),
+ i18n( "Find &Incremental" ), ALT + Key_I, this, 0 );
+ connect( actionSearchIncremetal, SIGNAL( activated() ), this, SLOT( searchIncremetalFindMenu() ) );
+ actionSearchIncremetal->setEnabled( FALSE );
+ actionSearchIncremetal->setWhatsThis( whatsThisFrom( "Search|Find Incremental" ) );
+
+ actionSearchReplace = new DesignerAction( i18n( "Replace" ), QIconSet(),
+ i18n( "&Replace..." ), CTRL + Key_R, this, 0 );
+ connect( actionSearchReplace, SIGNAL( activated() ), this, SLOT( searchReplace() ) );
+ actionSearchReplace->setEnabled( FALSE );
+ actionSearchReplace->setWhatsThis( whatsThisFrom( "Search|Replace" ) );
+
+ actionSearchGotoLine = new DesignerAction( i18n( "Goto Line" ), QIconSet(),
+ i18n( "&Goto Line..." ), ALT + Key_G, this, 0 );
+ connect( actionSearchGotoLine, SIGNAL( activated() ), this, SLOT( searchGotoLine() ) );
+ actionSearchGotoLine->setEnabled( FALSE );
+ actionSearchGotoLine->setWhatsThis( whatsThisFrom( "Search|Goto line" ) );
+
+/* QToolBar *tb = new QToolBar( this, "Search" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ addToolBar( tb, i18n( "Search" ) );
+
+ actionSearchFind->addTo( tb );*/
+ incrementalSearch = new QLineEdit( 0 );
+ incrementalSearch->hide();
+ QToolTip::add( incrementalSearch, i18n( "Incremental search (Alt+I)" ) );
+ connect( incrementalSearch, SIGNAL( textChanged( const QString & ) ),
+ this, SLOT( searchIncremetalFind() ) );
+ connect( incrementalSearch, SIGNAL( returnPressed() ),
+ this, SLOT( searchIncremetalFindNext() ) );
+ incrementalSearch->setEnabled( FALSE );
+
+ QPopupMenu *menu = new QPopupMenu( this, "Search" );
+ menubar->insertItem( i18n( "&Search" ), menu );
+ actionSearchFind->addTo( menu );
+ actionSearchIncremetal->addTo( menu );
+ actionSearchReplace->addTo( menu );
+ menu->insertSeparator();
+ actionSearchGotoLine->addTo( menu );
+}
+
+void MainWindow::setupLayoutActions()
+{
+ if ( !actionGroupTools ) {
+ actionGroupTools = new QActionGroup( this );
+ actionGroupTools->setExclusive( TRUE );
+ connect( actionGroupTools, SIGNAL( selected(QAction*) ), this, SLOT( toolSelected(QAction*) ) );
+ }
+
+ actionEditAdjustSize = new DesignerAction( i18n( "Adjust Size" ), createIconSet("designer_adjustsize.png"),
+ i18n( "Adjust &Size" ), CTRL + Key_J, this, 0 );
+ actionEditAdjustSize->setStatusTip(i18n("Adjusts the size of the selected widget") );
+ actionEditAdjustSize->setWhatsThis( whatsThisFrom( "Layout|Adjust Size" ) );
+ connect( actionEditAdjustSize, SIGNAL( activated() ), this, SLOT( editAdjustSize() ) );
+ actionEditAdjustSize->setEnabled( FALSE );
+
+ actionEditHLayout = new DesignerAction( i18n( "Lay Out Horizontally" ), createIconSet("designer_edithlayout.png"),
+ i18n( "Lay Out &Horizontally" ), CTRL + Key_H, this, 0 );
+ actionEditHLayout->setStatusTip(i18n("Lays out the selected widgets horizontally") );
+ actionEditHLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out Horizontally" ) );
+ connect( actionEditHLayout, SIGNAL( activated() ), this, SLOT( editLayoutHorizontal() ) );
+ actionEditHLayout->setEnabled( FALSE );
+
+ actionEditVLayout = new DesignerAction( i18n( "Lay Out Vertically" ), createIconSet("designer_editvlayout.png"),
+ i18n( "Lay Out &Vertically" ), CTRL + Key_L, this, 0 );
+ actionEditVLayout->setStatusTip(i18n("Lays out the selected widgets vertically") );
+ actionEditVLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out Vertically" ) );
+ connect( actionEditVLayout, SIGNAL( activated() ), this, SLOT( editLayoutVertical() ) );
+ actionEditVLayout->setEnabled( FALSE );
+
+ actionEditGridLayout = new DesignerAction( i18n( "Lay Out in a Grid" ), createIconSet("designer_editgrid.png"),
+ i18n( "Lay Out in a &Grid" ), CTRL + Key_G, this, 0 );
+ actionEditGridLayout->setStatusTip(i18n("Lays out the selected widgets in a grid") );
+ actionEditGridLayout->setWhatsThis( whatsThisFrom( "Layout|Lay Out in a Grid" ) );
+ connect( actionEditGridLayout, SIGNAL( activated() ), this, SLOT( editLayoutGrid() ) );
+ actionEditGridLayout->setEnabled( FALSE );
+
+ actionEditSplitHorizontal = new DesignerAction( i18n( "Lay Out Horizontally (in Splitter)" ), createIconSet("designer_editvlayoutsplit.png"),
+ i18n( "Lay Out Horizontally (in S&plitter)" ), 0, this, 0 );
+ actionEditSplitHorizontal->setStatusTip(i18n("Lays out the selected widgets horizontally in a splitter") );
+ actionEditSplitHorizontal->setWhatsThis( whatsThisFrom( "Layout|Lay Out Horizontally (in Splitter)" ) );
+ connect( actionEditSplitHorizontal, SIGNAL( activated() ), this, SLOT( editLayoutHorizontalSplit() ) );
+ actionEditSplitHorizontal->setEnabled( FALSE );
+
+ actionEditSplitVertical = new DesignerAction( i18n( "Lay Out Vertically (in Splitter)" ), createIconSet("designer_edithlayoutsplit.png"),
+ i18n( "Lay Out Vertically (in Sp&litter)" ), 0, this, 0 );
+ actionEditSplitVertical->setStatusTip(i18n("Lays out the selected widgets vertically in a splitter") );
+ actionEditSplitVertical->setWhatsThis( whatsThisFrom( "Layout|Lay Out Vertically (in Splitter)" ) );
+ connect( actionEditSplitVertical, SIGNAL( activated() ), this, SLOT( editLayoutVerticalSplit() ) );
+ actionEditSplitVertical->setEnabled( FALSE );
+
+ actionEditBreakLayout = new DesignerAction( i18n( "Break Layout" ), createIconSet("designer_editbreaklayout.png"),
+ i18n( "&Break Layout" ), CTRL + Key_B, this, 0 );
+ actionEditBreakLayout->setStatusTip(i18n("Breaks the selected layout") );
+ actionEditBreakLayout->setWhatsThis( whatsThisFrom( "Layout|Break Layout" ) );
+ connect( actionEditBreakLayout, SIGNAL( activated() ), this, SLOT( editBreakLayout() ) );
+ actionEditBreakLayout->setEnabled( FALSE );
+
+ int id = WidgetDatabase::idFromClassName( "Spacer" );
+ actionInsertSpacer = new WidgetAction( i18n( "Layout" ), actionGroupTools, QString::number( id ).latin1() );
+ actionInsertSpacer->setToggleAction( TRUE );
+ actionInsertSpacer->setText( WidgetDatabase::className( id ) );
+ actionInsertSpacer->setMenuText( i18n( "Add %1").arg( WidgetDatabase::className( id ) ) );
+ actionInsertSpacer->setIconSet( WidgetDatabase::iconSet( id ) );
+ actionInsertSpacer->setToolTip( WidgetDatabase::toolTip( id ) );
+ actionInsertSpacer->setStatusTip( i18n( "Insert a %1").arg(WidgetDatabase::toolTip( id )) );
+ actionInsertSpacer->setWhatsThis( i18n("<b>A %1</b><p>%2</p>"
+ "<p>Click to insert a single %3,"
+ "or double click to keep the tool selected.")
+ .arg(WidgetDatabase::toolTip( id ))
+ .arg(WidgetDatabase::whatsThis( id ))
+ .arg(WidgetDatabase::toolTip( id ) ));
+
+ actionInsertSpacer->addTo( commonWidgetsToolBar );
+ commonWidgetsPage.append( actionInsertSpacer );
+ QWidget *w;
+ commonWidgetsToolBar->setStretchableWidget( ( w = new QWidget( commonWidgetsToolBar ) ) );
+ w->setBackgroundMode( commonWidgetsToolBar->backgroundMode() );
+ QWhatsThis::add( layoutToolBar, i18n( "<b>The Layout toolbar</b>%1" ).arg(i18n(toolbarHelp).arg("")) );
+ actionEditAdjustSize->addTo( layoutToolBar );
+ layoutToolBar->addSeparator();
+ actionEditHLayout->addTo( layoutToolBar );
+ actionEditVLayout->addTo( layoutToolBar );
+ actionEditGridLayout->addTo( layoutToolBar );
+ actionEditSplitHorizontal->addTo( layoutToolBar );
+ actionEditSplitVertical->addTo( layoutToolBar );
+ actionEditBreakLayout->addTo( layoutToolBar );
+ layoutToolBar->addSeparator();
+ actionInsertSpacer->addTo( layoutToolBar );
+
+ QPopupMenu *menu = new QPopupMenu( this, "Layout" );
+ layoutMenu = menu;
+ menubar->insertItem( i18n( "&Layout" ), menu, toolsMenuId + 1 );
+ actionEditAdjustSize->addTo( menu );
+ menu->insertSeparator();
+ actionEditHLayout->addTo( menu );
+ actionEditVLayout->addTo( menu );
+ actionEditGridLayout->addTo( menu );
+ actionEditSplitHorizontal->addTo( menu );
+ actionEditSplitVertical->addTo( menu );
+ actionEditBreakLayout->addTo( menu );
+ menu->insertSeparator();
+ actionInsertSpacer->addTo( menu );
+}
+
+void MainWindow::setupToolActions()
+{
+ if ( !actionGroupTools ) {
+ actionGroupTools = new QActionGroup( this );
+ actionGroupTools->setExclusive( TRUE );
+ connect( actionGroupTools, SIGNAL( selected(QAction*) ),
+ this, SLOT( toolSelected(QAction*) ) );
+ }
+
+ actionPointerTool = new DesignerAction( i18n("Pointer"), createIconSet("designer_pointer.png"),
+ i18n("&Pointer"), Key_F2,
+ actionGroupTools,
+ QString::number(POINTER_TOOL).latin1(), TRUE );
+ actionPointerTool->setStatusTip( i18n("Selects the pointer tool") );
+ actionPointerTool->setWhatsThis( whatsThisFrom( "Tools|Pointer" ) );
+
+ actionConnectTool = new DesignerAction( i18n("Connect Signal/Slots"),
+ createIconSet("designer_connecttool.png"),
+ i18n("&Connect Signal/Slots"),
+ singleProjectMode() ? 0 : Key_F3,
+ actionGroupTools,
+ QString::number(CONNECT_TOOL).latin1(), TRUE );
+ actionConnectTool->setStatusTip( i18n("Selects the connection tool") );
+ actionConnectTool->setWhatsThis( whatsThisFrom( "Tools|Connect Signals and Slots" ) );
+
+ actionOrderTool = new DesignerAction( i18n("Tab Order"), createIconSet("designer_ordertool.png"),
+ i18n("Tab &Order"), Key_F4,
+ actionGroupTools,
+ QString::number(ORDER_TOOL).latin1(), TRUE );
+ actionOrderTool->setStatusTip( i18n("Selects the tab order tool") );
+ actionOrderTool->setWhatsThis( whatsThisFrom( "Tools|Tab Order" ) );
+
+ actionBuddyTool = new DesignerAction( i18n( "Set Buddy" ), createIconSet( "designer_setbuddy.png" ),
+ i18n( "Set &Buddy" ), Key_F12,
+ actionGroupTools, QString::number( BUDDY_TOOL ).latin1(),
+ TRUE );
+ actionBuddyTool->setStatusTip( i18n( "Sets a buddy to a label" ) );
+ actionBuddyTool->setWhatsThis( whatsThisFrom( "Tools|Set Buddy" ) );
+
+ QToolBar *tb = new QToolBar( this, "Tools" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ toolsToolBar = tb;
+ QWhatsThis::add( tb, i18n( "<b>The Tools toolbar</b>%1" ).arg(i18n(toolbarHelp).arg("")) );
+
+ addToolBar( tb, i18n( "Tools" ), QMainWindow::DockTop, FALSE );
+ actionPointerTool->addTo( tb );
+ if ( !singleProjectMode() )
+ actionConnectTool->addTo( tb );
+ actionOrderTool->addTo( tb );
+ actionBuddyTool->addTo( tb );
+
+ QPopupMenu *mmenu = new QPopupMenu( this, "Tools" );
+ toolsMenu = mmenu;
+ toolsMenuId = 100;
+ menubar->insertItem( i18n( "&Tools" ), mmenu, toolsMenuId );
+ toolsMenuIndex = menubar->indexOf( toolsMenuId );
+ actionPointerTool->addTo( mmenu );
+ if ( !singleProjectMode() )
+ actionConnectTool->addTo( mmenu );
+ actionOrderTool->addTo( mmenu );
+ actionBuddyTool->addTo( mmenu );
+ mmenu->insertSeparator();
+
+ customWidgetToolBar = 0;
+ customWidgetMenu = 0;
+
+ actionToolsCustomWidget = new DesignerAction( i18n("Custom Widgets"),
+ createIconSet( "designer_customwidget.png" ),
+ i18n("Edit &Custom Widgets..."), 0, this, 0 );
+ actionToolsCustomWidget->setStatusTip( i18n("Opens a dialog to add and change "
+ "custom widgets") );
+ actionToolsCustomWidget->setWhatsThis( whatsThisFrom( "Tools|Custom|Edit Custom"
+ "Widgets" ) );
+ connect( actionToolsCustomWidget, SIGNAL( activated() ),
+ this, SLOT( toolsCustomWidget() ) );
+
+ for ( int j = 0; j < WidgetDatabase::numWidgetGroups(); ++j ) {
+ QString grp = WidgetDatabase::widgetGroup( j );
+ if ( !WidgetDatabase::isGroupVisible( grp ) ||
+ WidgetDatabase::isGroupEmpty( grp ) )
+ continue;
+ QToolBar *tb = new QToolBar( this, grp.latin1() );
+ tb->setCloseMode( QDockWindow::Undocked );
+ widgetToolBars.append( tb );
+ bool plural = grp[(int)grp.length()-1] == 's';
+ if ( plural ) {
+ QWhatsThis::add( tb, i18n( "<b>The %1</b>%2" ).arg(grp).arg(i18n(toolbarHelp).
+ arg( i18n(" Click on a button to insert a single widget, "
+ "or double click to insert multiple %1.") ).arg(grp)) );
+ } else {
+ QWhatsThis::add( tb, i18n( "<b>The %1 Widgets</b>%2" ).arg(grp).arg(i18n(toolbarHelp).
+ arg( i18n(" Click on a button to insert a single %1 widget, "
+ "or double click to insert multiple widgets.") ).arg(grp)) );
+ }
+ addToolBar( tb, grp );
+ tb->hide();
+ QPopupMenu *menu = new QPopupMenu( this, grp.latin1() );
+ mmenu->insertItem( grp, menu );
+
+ QToolBar *tb2 = new QToolBar( grp, 0, toolBox, FALSE, grp.latin1() );
+ tb2->setFrameStyle( QFrame::NoFrame );
+ tb2->setOrientation( Qt::Vertical );
+ tb2->setBackgroundMode( PaletteBase );
+ toolBox->addItem( tb2, grp );
+
+ if ( grp == "Custom" ) {
+ if ( !customWidgetMenu )
+ actionToolsCustomWidget->addTo( menu );
+ else
+ menu->insertSeparator();
+ customWidgetMenu = menu;
+ customWidgetToolBar = tb;
+ }
+
+ for ( int i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::group( i ) != grp )
+ continue; // only widgets, i.e. not forms and temp stuff
+ WidgetAction* a =
+ new WidgetAction( grp, actionGroupTools, QString::number( i ).latin1() );
+ a->setToggleAction( TRUE );
+ QString atext = WidgetDatabase::className( i );
+ if ( atext[0] == 'Q' )
+ atext = atext.mid(1);
+ while ( atext.length() && atext[0] >= 'a' && atext[0] <= 'z' )
+ atext = atext.mid(1);
+ if ( atext.isEmpty() )
+ atext = WidgetDatabase::className( i );
+ a->setText( atext );
+ QString ttip = WidgetDatabase::toolTip( i );
+ a->setIconSet( WidgetDatabase::iconSet( i ) );
+ a->setToolTip( ttip );
+ if ( !WidgetDatabase::isWhatsThisLoaded() )
+ WidgetDatabase::loadWhatsThis( documentationPath() );
+ a->setStatusTip( i18n( "Insert a %1").arg(WidgetDatabase::className( i )) );
+
+ QString whats = i18n("<b>A %1</b>").arg( WidgetDatabase::className( i ) );
+ if ( !WidgetDatabase::whatsThis( i ).isEmpty() )
+ whats += QString("<p>%1</p>").arg(WidgetDatabase::whatsThis( i ));
+ a->setWhatsThis( whats+ i18n("<p>Double click on this tool to keep it selected.</p>") );
+
+ if ( grp != "KDE" )
+ a->addTo( tb );
+ a->addTo( menu );
+ a->addTo( tb2 );
+ if ( WidgetDatabase::isCommon( i ) ) {
+ a->addTo( commonWidgetsToolBar );
+ commonWidgetsPage.append( a );
+ }
+ }
+ QWidget *w;
+ tb2->setStretchableWidget( ( w = new QWidget( tb2 ) ) );
+ w->setBackgroundMode( tb2->backgroundMode() );
+ }
+
+ if ( !customWidgetToolBar ) {
+ QToolBar *tb = new QToolBar( this, "Custom Widgets" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ QWhatsThis::add( tb, i18n( "<b>The Custom Widgets toolbar</b>%1"
+ "<p>Click <b>Edit Custom Widgets...</b>"
+ "in the <b>Tools|Custom</b> menu to "
+ "add and change custom widgets</p>" ).
+ arg(i18n(toolbarHelp).
+ arg( i18n(" Click on the buttons to insert a single widget, "
+ "or double click to insert multiple widgets.") )) );
+ addToolBar( tb, i18n( "Custom" ) );
+ tb->hide();
+ widgetToolBars.append( tb );
+ customWidgetToolBar = tb;
+ QPopupMenu *menu = new QPopupMenu( this, "Custom Widgets" );
+ mmenu->insertItem( "Custom", menu );
+ customWidgetMenu = menu;
+ customWidgetToolBar->hide();
+ actionToolsCustomWidget->addTo( customWidgetMenu );
+ customWidgetMenu->insertSeparator();
+ QToolBar *tb2 = new QToolBar( "Custom Widgets", 0,
+ toolBox, FALSE, "Custom Widgets" );
+ tb2->setBackgroundMode(PaletteBase);
+ tb2->setOrientation( Qt::Vertical );
+ tb2->setFrameStyle( QFrame::NoFrame );
+ toolBox->addItem( tb2, "Custom Widgets" );
+ customWidgetToolBar2 = tb2;
+ }
+
+ QAction *a = new DesignerAction( i18n( "Configure Toolbox" ), i18n( "Configure Toolbox..." ), 0, this );
+ a->setStatusTip( i18n( "Opens a dialog to configure the common "
+ "widgets page of the toolbox") );
+ connect( a, SIGNAL( activated() ), this, SLOT( toolsConfigure() ) );
+ mmenu->insertSeparator();
+ a->addTo( mmenu );
+ resetTool();
+}
+
+void MainWindow::setupFileActions()
+{
+ QToolBar* tb = new QToolBar( this, "File" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ projectToolBar = tb;
+
+ QWhatsThis::add( tb, i18n( "<b>The File toolbar</b>%1" ).arg(i18n(toolbarHelp).arg("")) );
+ addToolBar( tb, i18n( "File" ) );
+ fileMenu = new QPopupMenu( this, "File" );
+ menubar->insertItem( i18n( "&File" ), fileMenu );
+
+ DesignerAction *a = 0;
+
+ if ( !singleProject ) {
+ DesignerAction *a = new DesignerAction( this, 0 );
+ a->setText( i18n( "New" ) );
+ a->setToolTip( i18n( "New dialog or file" ) );
+ a->setMenuText( i18n( "&New..." ) );
+ a->setIconSet( createIconSet("designer_filenew.png") );
+ a->setAccel( CTRL + Key_N );
+ a->setStatusTip( i18n( "Creates a new project, form or source file." ) );
+ a->setWhatsThis( whatsThisFrom( "File|New" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
+ a->addTo( tb );
+ a->addTo( fileMenu );
+ actionNewFile = a;
+ } else {
+ actionGroupNew = new QActionGroup( this, 0, FALSE );
+ QActionGroup* a = actionGroupNew;
+ ( (QActionGroup*)a )->setUsesDropDown( TRUE );
+ a->setText( i18n( "New" ) );
+ a->setMenuText( i18n( "&New..." ) );
+ a->setIconSet( createIconSet("designer_form.png") );
+ a->setStatusTip( i18n( "Creates a new dialog or file" ) );
+ a->setWhatsThis( whatsThisFrom( "File|New" ) );
+
+ QAction *newForm = new DesignerAction( a, 0 );
+ newForm->setText( i18n( "New Dialog" ) );
+ newForm->setMenuText( i18n( "&Dialog..." ) );
+ newForm->setIconSet( createIconSet("designer_form.png") );
+ newForm->setAccel( CTRL + Key_N );
+ newForm->setStatusTip( i18n( "Creates a new dialog." ) );
+ connect( newForm, SIGNAL( activated() ), this, SLOT( fileNewDialog() ) );
+
+ DesignerAction *newFile = new DesignerAction( a, 0 );
+ newFile->setText( i18n( "New File" ) );
+ newFile->setMenuText( i18n( "&File..." ) );
+ newFile->setIconSet( createIconSet("designer_filenew.png") );
+ newFile->setAccel( ALT + Key_N );
+ newFile->setStatusTip( i18n( "Creates a new file." ) );
+ connect( newFile, SIGNAL( activated() ), this, SLOT( fileNewFile() ) );
+ actionNewFile = newFile;
+
+ a->addTo( tb );
+ a->addTo( fileMenu );
+
+ fileMenu->insertSeparator();
+ }
+
+ a = new DesignerAction( this, 0 );
+ a->setText( i18n( "Open" ) );
+ a->setMenuText( i18n( "&Open..." ) );
+ a->setIconSet( createIconSet("designer_fileopen.png") );
+ a->setAccel( CTRL + Key_O );
+ a->setStatusTip( i18n( "Opens an existing project, form or source file ") );
+ a->setWhatsThis( whatsThisFrom( "File|Open" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
+ if ( !singleProject ) {
+ a->addTo( tb );
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+
+ a = new DesignerAction( this, 0 );
+ actionFileClose = a;
+ a->setText( i18n( "Close" ) );
+ a->setMenuText( i18n( "&Close" ) );
+ a->setStatusTip( i18n( "Closes the current project or document" ) );
+ a->setWhatsThis(whatsThisFrom( "File|Close" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileClose() ) );
+ connect( this, SIGNAL( hasActiveWindowOrProject(bool) ), a, SLOT( setEnabled(bool) ) );
+ if ( !singleProject ) {
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+ a = new DesignerAction( this, 0 );
+ actionFileSave = a;
+ a->setText( i18n( "Save" ) );
+ a->setMenuText( i18n( "&Save" ) );
+ a->setIconSet( createIconSet("designer_filesave.png") );
+ a->setAccel( CTRL + Key_S );
+ a->setStatusTip( i18n( "Saves the current project or document" ) );
+ a->setWhatsThis(whatsThisFrom( "File|Save" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) );
+ connect( this, SIGNAL( hasActiveWindowOrProject(bool) ), a, SLOT( setEnabled(bool) ) );
+ a->addTo( tb );
+ a->addTo( fileMenu );
+
+ a = new DesignerAction( this, 0 );
+ actionFileSaveAs = a;
+ a->setText( i18n( "Save As" ) );
+ a->setMenuText( i18n( "Save &As..." ) );
+ a->setStatusTip( i18n( "Saves the current form with a new filename" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Save As" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
+ connect( this, SIGNAL( hasActiveWindow(bool) ), a, SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ a->addTo( fileMenu );
+
+ a = new DesignerAction( this, 0 );
+ actionFileSaveAll = a;
+ a->setText( i18n( "Save All" ) );
+ a->setMenuText( i18n( "Sa&ve All" ) );
+ a->setStatusTip( i18n( "Saves all open documents" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Save All" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAll() ) );
+ connect( this, SIGNAL( hasActiveWindowOrProject(bool) ), a, SLOT( setEnabled(bool) ) );
+ if ( !singleProject ) {
+ a->addTo( fileMenu );
+ fileMenu->insertSeparator();
+ }
+
+ a = new DesignerAction( this, 0 );
+ a->setText( i18n( "Create Template" ) );
+ a->setMenuText( i18n( "Create &Template..." ) );
+ a->setStatusTip( i18n( "Creates a new template" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Create Template" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( fileCreateTemplate() ) );
+ if ( !singleProject )
+ a->addTo( fileMenu );
+
+ if ( !singleProject )
+ fileMenu->insertSeparator();
+
+ recentlyFilesMenu = new QPopupMenu( this );
+ recentlyProjectsMenu = new QPopupMenu( this );
+
+ if ( !singleProject ) {
+ fileMenu->insertItem( i18n( "Recently Opened Files " ), recentlyFilesMenu );
+ fileMenu->insertItem( i18n( "Recently Opened Projects" ), recentlyProjectsMenu );
+ }
+
+ connect( recentlyFilesMenu, SIGNAL( aboutToShow() ),
+ this, SLOT( setupRecentlyFilesMenu() ) );
+ connect( recentlyProjectsMenu, SIGNAL( aboutToShow() ),
+ this, SLOT( setupRecentlyProjectsMenu() ) );
+ connect( recentlyFilesMenu, SIGNAL( activated( int ) ),
+ this, SLOT( recentlyFilesMenuActivated( int ) ) );
+ connect( recentlyProjectsMenu, SIGNAL( activated( int ) ),
+ this, SLOT( recentlyProjectsMenuActivated( int ) ) );
+
+ if ( !singleProject )
+ fileMenu->insertSeparator();
+
+ a = new DesignerAction( this, 0 );
+ actionFileExit = a;
+ if ( !singleProjectMode() ) {
+ a->setText( i18n( "Exit" ) );
+ a->setMenuText( i18n( "E&xit" ) );
+ a->setStatusTip( i18n( "Quits the application and prompts to save any changed forms, source files or project settings" ) );
+ a->setWhatsThis( whatsThisFrom( "File|Exit" ) );
+ } else {
+ a->setText( i18n( "Close" ) );
+ a->setMenuText( i18n( "&Close" ) );
+ }
+ connect( a, SIGNAL( activated() ), this, SLOT( fileQuit() ) );
+ a->addTo( fileMenu );
+}
+
+void MainWindow::setupProjectActions()
+{
+ projectMenu = new QPopupMenu( this, "Project" );
+ menubar->insertItem( i18n( "Pr&oject" ), projectMenu );
+
+ QActionGroup *ag = new QActionGroup( this, 0 );
+ ag->setText( i18n( "Active Project" ) );
+ ag->setMenuText( i18n( "Active Project" ) );
+ ag->setExclusive( TRUE );
+ ag->setUsesDropDown( TRUE );
+ connect( ag, SIGNAL( selected( QAction * ) ), this, SLOT( projectSelected( QAction * ) ) );
+ connect( ag, SIGNAL( selected( QAction * ) ), this, SIGNAL( projectChanged() ) );
+ DesignerAction *a = new DesignerAction( i18n( "<No Project>" ), i18n( "<No Project>" ), 0, ag, 0, TRUE );
+ eProject = new Project( "", i18n( "<No Project>" ), projectSettingsPluginManager, TRUE );
+ projects.insert( a, eProject );
+ a->setOn( TRUE );
+ ag->addTo( projectMenu );
+ ag->addTo( projectToolBar );
+ actionGroupProjects = ag;
+
+ if ( !singleProject )
+ projectMenu->insertSeparator();
+
+ a = new DesignerAction( i18n( "Add File" ), QPixmap(), i18n( "&Add File..." ), 0, this, 0 );
+ actionProjectAddFile = a;
+ a->setStatusTip( i18n("Adds a file to the current project") );
+ a->setWhatsThis( whatsThisFrom( "Project|Add File" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( projectInsertFile() ) );
+ a->setEnabled( FALSE );
+ connect( this, SIGNAL( hasNonDummyProject(bool) ), a, SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ a->addTo( projectMenu );
+
+ actionEditPixmapCollection = new DesignerAction( i18n( "Image Collection..." ), QPixmap(),
+ i18n( "&Image Collection..." ), 0, this, 0 );
+ actionEditPixmapCollection->setStatusTip( i18n("Opens a dialog for editing the current project's image collection") );
+ actionEditPixmapCollection->setWhatsThis( whatsThisFrom( "Project|Image Collection" ) );
+ connect( actionEditPixmapCollection, SIGNAL( activated() ), this, SLOT( editPixmapCollection() ) );
+ actionEditPixmapCollection->setEnabled( FALSE );
+ connect( this, SIGNAL( hasNonDummyProject(bool) ), actionEditPixmapCollection, SLOT( setEnabled(bool) ) );
+ actionEditPixmapCollection->addTo( projectMenu );
+
+#ifndef QT_NO_SQL
+ actionEditDatabaseConnections = new DesignerAction( i18n( "Database Connections..." ), QPixmap(),
+ i18n( "&Database Connections..." ), 0, this, 0 );
+ actionEditDatabaseConnections->setStatusTip( i18n("Opens a dialog for editing the current project's database connections") );
+ actionEditDatabaseConnections->setWhatsThis( whatsThisFrom( "Project|Database Connections" ) );
+ connect( actionEditDatabaseConnections, SIGNAL( activated() ), this, SLOT( editDatabaseConnections() ) );
+ //actionEditDatabaseConnections->setEnabled( FALSE );
+ //connect( this, SIGNAL( hasNonDummyProject(bool) ), actionEditDatabaseConnections, SLOT( setEnabled(bool) ) );
+ if ( !singleProject )
+ actionEditDatabaseConnections->addTo( projectMenu );
+#endif
+
+ actionEditProjectSettings = new DesignerAction( i18n( "Project Settings..." ), QPixmap(),
+ i18n( "&Project Settings..." ), 0, this, 0 );
+ actionEditProjectSettings->setStatusTip( i18n("Opens a dialog to change the project's settings") );
+ actionEditProjectSettings->setWhatsThis( whatsThisFrom( "Project|Project Settings" ) );
+ connect( actionEditProjectSettings, SIGNAL( activated() ), this, SLOT( editProjectSettings() ) );
+ actionEditProjectSettings->setEnabled( FALSE );
+ connect( this, SIGNAL( hasNonDummyProject(bool) ), actionEditProjectSettings, SLOT( setEnabled(bool) ) );
+ actionEditProjectSettings->addTo( projectMenu );
+
+}
+
+void MainWindow::setupPreviewActions()
+{
+ DesignerAction* a = 0;
+ QPopupMenu *menu = new QPopupMenu( this, "Preview" );
+ layoutMenu = menu;
+ menubar->insertItem( i18n( "&Preview" ), menu, toolsMenuId + 2 );
+
+ a = new DesignerAction( i18n( "Preview Form" ), QPixmap(), i18n( "Preview &Form" ), 0, this, 0 );
+ actionPreview = a;
+ a->setAccel( CTRL + Key_T );
+ a->setStatusTip( i18n("Opens a preview") );
+ a->setWhatsThis( whatsThisFrom( "Preview|Preview Form" ) );
+ connect( a, SIGNAL( activated() ), this, SLOT( previewForm() ) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), a, SLOT( setEnabled(bool) ) );
+ a->addTo( menu );
+
+ menu->insertSeparator();
+
+ QSignalMapper *mapper = new QSignalMapper( this );
+ connect( mapper, SIGNAL(mapped(const QString&)), this, SLOT(previewForm(const QString&)) );
+ QStringList styles = QStyleFactory::keys();
+ for ( QStringList::Iterator it = styles.begin(); it != styles.end(); ++it ) {
+ QString info;
+ if ( *it == "Motif" )
+ info = i18n( "The preview will use the Motif look and feel which is used as the default style on most UNIX systems." );
+ else if ( *it == "Windows" )
+ info = i18n( "The preview will use the Windows look and feel." );
+ else if ( *it == "Platinum" )
+ info = i18n( "The preview will use the Platinum look and feel which is similar to the Macintosh GUI style." );
+ else if ( *it == "CDE" )
+ info = i18n( "The preview will use the CDE look and feel which is similar to some versions of the Common Desktop Environment." );
+ else if ( *it == "SGI" )
+ info = i18n( "The preview will use the Motif look and feel which is used as the default style on SGI systems." );
+ else if ( *it == "MotifPlus" )
+ info = i18n( "The preview will use the advanced Motif look and feel used by the GIMP toolkit (GTK) on Linux." );
+
+ a = new DesignerAction( i18n( "Preview Form in %1 Style" ).arg( *it ), QPixmap(),
+ i18n( "... in %1 Style" ).arg( *it ), 0, this, 0 );
+ a->setStatusTip( i18n("Opens a preview in %1 style").arg( *it ) );
+ a->setWhatsThis( i18n("<b>Open a preview in %1 style.</b>"
+ "<p>Use the preview to test the design and "
+ "signal-slot connections of the current form. %2</p>").arg( *it ).arg( info ) );
+ mapper->setMapping( a, *it );
+ connect( a, SIGNAL(activated()), mapper, SLOT(map()) );
+ connect( this, SIGNAL( hasActiveForm(bool) ), a, SLOT( setEnabled(bool) ) );
+ a->addTo( menu );
+ }
+}
+
+void MainWindow::setupWindowActions()
+{
+/* static bool windowActionsSetup = FALSE;
+ if ( !windowActionsSetup ) {
+ windowActionsSetup = TRUE;
+*/
+ actionWindowTile = new DesignerAction( i18n( "Tile" ), i18n( "&Tile" ), 0, this );
+ actionWindowTile->setStatusTip( i18n("Tiles the windows so that they are all visible") );
+ actionWindowTile->setWhatsThis( whatsThisFrom( "Window|Tile" ) );
+ connect( actionWindowTile, SIGNAL( activated() ), qworkspace, SLOT( tile() ) );
+ actionWindowCascade = new DesignerAction( i18n( "Cascade" ), i18n( "&Cascade" ), 0, this );
+ actionWindowCascade->setStatusTip( i18n("Cascades the windows so that all their title bars are visible") );
+ actionWindowCascade->setWhatsThis( whatsThisFrom( "Window|Cascade" ) );
+ connect( actionWindowCascade, SIGNAL( activated() ), qworkspace, SLOT( cascade() ) );
+
+ actionWindowClose = new DesignerAction( i18n( "Close" ), i18n( "Cl&ose" ), CTRL + Key_F4, this );
+ actionWindowClose->setStatusTip( i18n( "Closes the active window") );
+ actionWindowClose->setWhatsThis( whatsThisFrom( "Window|Close" ) );
+ connect( actionWindowClose, SIGNAL( activated() ), qworkspace, SLOT( closeActiveWindow() ) );
+
+ actionWindowCloseAll = new DesignerAction( i18n( "Close All" ), i18n( "Close Al&l" ), 0, this );
+ actionWindowCloseAll->setStatusTip( i18n( "Closes all form windows") );
+ actionWindowCloseAll->setWhatsThis( whatsThisFrom( "Window|Close All" ) );
+ connect( actionWindowCloseAll, SIGNAL( activated() ), qworkspace, SLOT( closeAllWindows() ) );
+
+ actionWindowNext = new DesignerAction( i18n( "Next" ), i18n( "Ne&xt" ), CTRL + Key_F6, this );
+ actionWindowNext->setStatusTip( i18n( "Activates the next window" ) );
+ actionWindowNext->setWhatsThis( whatsThisFrom( "Window|Next" ) );
+ connect( actionWindowNext, SIGNAL( activated() ), qworkspace, SLOT( activateNextWindow() ) );
+
+ actionWindowPrevious = new DesignerAction( i18n( "Previous" ), i18n( "Pre&vious" ), CTRL + SHIFT + Key_F6, this );
+ actionWindowPrevious->setStatusTip( i18n( "Activates the previous window" ) );
+ actionWindowPrevious->setWhatsThis( whatsThisFrom( "Window|Previous" ) );
+ connect( actionWindowPrevious, SIGNAL( activated() ), qworkspace, SLOT( activatePreviousWindow() ) );
+ // }
+
+ if ( !windowMenu ) {
+ windowMenu = new QPopupMenu( this, "Window" );
+ menubar->insertItem( i18n( "&Window" ), windowMenu );
+ connect( windowMenu, SIGNAL( aboutToShow() ),
+ this, SLOT( setupWindowActions() ) );
+ } else {
+ windowMenu->clear();
+ }
+
+ actionWindowClose->addTo( windowMenu );
+ actionWindowCloseAll->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ actionWindowNext->addTo( windowMenu );
+ actionWindowPrevious->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ actionWindowTile->addTo( windowMenu );
+ actionWindowCascade->addTo( windowMenu );
+ windowMenu->insertSeparator();
+ windowMenu->insertItem( i18n( "Vie&ws" ), createDockWindowMenu( NoToolBars ) );
+ windowMenu->insertItem( i18n( "Tool&bars" ), createDockWindowMenu( OnlyToolBars ) );
+ QWidgetList windows = qworkspace->windowList();
+ if ( windows.count() && formWindow() )
+ windowMenu->insertSeparator();
+ int j = 0;
+ for ( int i = 0; i < int( windows.count() ); ++i ) {
+ QWidget *w = windows.at( i );
+ if ( !::qt_cast<FormWindow*>(w) && !::qt_cast<SourceEditor*>(w) )
+ continue;
+ if ( ::qt_cast<FormWindow*>(w) && ( ( (FormWindow*)w )->isFake() ) )
+ continue;
+ j++;
+ QString itemText;
+ if ( j < 10 )
+ itemText = QString("&%1 ").arg( j );
+ if ( ::qt_cast<FormWindow*>(w) )
+ itemText += w->name();
+ else
+ itemText += w->caption();
+
+ int id = windowMenu->insertItem( itemText, this, SLOT( windowsMenuActivated( int ) ) );
+ windowMenu->setItemParameter( id, i );
+ windowMenu->setItemChecked( id, qworkspace->activeWindow() == windows.at( i ) );
+ }
+}
+
+void MainWindow::setupHelpActions()
+{
+ actionHelpContents = new DesignerAction( i18n( "Contents" ), i18n( "&Contents" ), Key_F1, this, 0 );
+ actionHelpContents->setStatusTip( i18n("Opens the online help") );
+ actionHelpContents->setWhatsThis( whatsThisFrom( "Help|Contents" ) );
+ connect( actionHelpContents, SIGNAL( activated() ), this, SLOT( helpContents() ) );
+
+ actionHelpManual = new DesignerAction( i18n( "Manual" ), i18n( "&Manual" ), CTRL + Key_M, this, 0 );
+ actionHelpManual->setStatusTip( i18n("Opens the Qt Designer manual") );
+ actionHelpManual->setWhatsThis( whatsThisFrom( "Help|Manual" ) );
+ connect( actionHelpManual, SIGNAL( activated() ), this, SLOT( helpManual() ) );
+
+ actionHelpAbout = new DesignerAction( i18n("About"), QPixmap(), i18n("&About"), 0, this, 0 );
+ actionHelpAbout->setStatusTip( i18n("Displays information about Qt Designer") );
+ actionHelpAbout->setWhatsThis( whatsThisFrom( "Help|About" ) );
+ connect( actionHelpAbout, SIGNAL( activated() ), this, SLOT( helpAbout() ) );
+
+ actionHelpAboutQt = new DesignerAction( i18n("About Qt"), QPixmap(), i18n("About &Qt"), 0, this, 0 );
+ actionHelpAboutQt->setStatusTip( i18n("Displays information about the Qt Toolkit") );
+ actionHelpAboutQt->setWhatsThis( whatsThisFrom( "Help|About Qt" ) );
+ connect( actionHelpAboutQt, SIGNAL( activated() ), this, SLOT( helpAboutQt() ) );
+
+#if 0 //defined(QT_NON_COMMERCIAL)
+ // ### not used anymore -- should be deleted?
+ actionHelpRegister = new DesignerAction( i18n("Register Qt"), QPixmap(), i18n("&Register Qt..."), 0, this, 0 );
+ actionHelpRegister->setStatusTip( i18n("Opens a web browser at the evaluation form on www.trolltech.com") );
+ actionHelpRegister->setWhatsThis( i18n("Register with Trolltech") );
+ connect( actionHelpRegister, SIGNAL( activated() ), this, SLOT( helpRegister() ) );
+#endif
+
+ actionHelpWhatsThis = new DesignerAction( i18n("What's This?"), QIconSet( whatsthis_image, whatsthis_image ),
+ i18n("What's This?"), SHIFT + Key_F1, this, 0 );
+ actionHelpWhatsThis->setStatusTip( i18n("\"What's This?\" context sensitive help") );
+ actionHelpWhatsThis->setWhatsThis( whatsThisFrom( "Help|What's This?" ) );
+ connect( actionHelpWhatsThis, SIGNAL( activated() ), this, SLOT( whatsThis() ) );
+
+/* QToolBar *tb = new QToolBar( this, "Help" );
+ tb->setCloseMode( QDockWindow::Undocked );
+ QWhatsThis::add( tb, i18n( "<b>The Help toolbar</b>%1" ).arg(i18n(toolbarHelp).arg("") ));
+ addToolBar( tb, i18n( "Help" ) );
+ actionHelpWhatsThis->addTo( tb );*/
+
+ QPopupMenu *menu = new QPopupMenu( this, "Help" );
+ menubar->insertSeparator();
+ menubar->insertItem( i18n( "&Help" ), menu );
+ actionHelpContents->addTo( menu );
+ actionHelpManual->addTo( menu );
+ menu->insertSeparator();
+ actionHelpAbout->addTo( menu );
+ actionHelpAboutQt->addTo( menu );
+#if 0 //defined(QT_NON_COMMERCIAL)
+ // ### not used anymore -- should be deleted?
+ actionHelpRegister->addTo( menu );
+#endif
+
+ menu->insertSeparator();
+ actionHelpWhatsThis->addTo( menu );
+}
+
+void MainWindow::fileNew()
+{
+ statusMessage( i18n( "Create a new project, form or source file...") );
+ NewForm dlg( this, projectNames(), currentProject->projectName(), templatePath() );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::fileNewDialog()
+{
+ static int forms = 0;
+ QString n = "Dialog" + QString::number( ++forms );
+ while ( currentProject->findFormFile( n + ".ui" ) )
+ n = "Dialog" + QString::number( ++forms );
+ FormWindow *fw = 0;
+ FormFile *ff = new FormFile( n + ".ui", FALSE, currentProject );
+ fw = new FormWindow( ff, MainWindow::self, MainWindow::self->qWorkspace(), n );
+ ff->setModified( TRUE );
+ currentProject->setModified( TRUE );
+ workspace()->update();
+ fw->setProject( currentProject );
+ MetaDataBase::addEntry( fw );
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QDialog" ), fw, n.latin1() );
+ fw->setMainContainer( w );
+ fw->setCaption( n );
+ fw->resize( 600, 480 );
+ insertFormWindow( fw );
+ fw->killAccels( fw );
+ fw->project()->setModified( TRUE );
+ fw->setFocus();
+ fw->setSavePixmapInProject( TRUE );
+ fw->setSavePixmapInline( FALSE );
+}
+
+void MainWindow::fileNewFile()
+{
+ QString name = QInputDialog::getText( i18n( "Name of File" ), i18n( "Enter the name of the new source file:" ) );
+ if ( name.isEmpty() )
+ return;
+ if ( name.right( 3 ) != ".qs" )
+ name += ".qs";
+ SourceFile *f = new SourceFile( name, FALSE, currentProject );
+ MainWindow::self->editSource( f );
+ f->setModified( TRUE );
+ currentProject->setModified( TRUE );
+ workspace()->update();
+}
+
+void MainWindow::fileQuit()
+{
+ close();
+ if ( !singleProjectMode() )
+ qApp->closeAllWindows();
+}
+
+void MainWindow::fileClose()
+{
+ if ( !currentProject->isDummy() ) {
+ fileCloseProject();
+ } else {
+ QWidget *w = qworkspace->activeWindow();
+ if ( w ) {
+ if ( ::qt_cast<FormWindow*>(w) )
+ ( (FormWindow*)w )->formFile()->close();
+ else if ( ::qt_cast<SourceEditor*>(w) )
+ ( (SourceEditor*)w )->close();
+ }
+ }
+}
+
+
+void MainWindow::fileCloseProject()
+{
+ if ( currentProject->isDummy() )
+ return;
+ Project *pro = currentProject;
+ QAction* a = 0;
+ QAction* lastValid = 0;
+ for ( QMap<QAction*, Project* >::Iterator it = projects.begin(); it != projects.end(); ++it ) {
+ if ( it.data() == pro ) {
+ a = it.key();
+ if ( lastValid )
+ break;
+ }
+ lastValid = it.key();
+ }
+ if ( a ) {
+ if ( pro->isModified() ) {
+ switch ( QMessageBox::warning( this, i18n( "Save Project Settings" ),
+ i18n( "Save changes to '%1'?" ).arg( pro->fileName() ),
+ i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ pro->save();
+ break;
+ case 1: // don't save
+ break;
+ case 2: // cancel
+ return;
+ default:
+ break;
+ }
+ }
+
+ QWidgetList windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( TRUE );
+ QWidgetListIt wit( windows );
+ while ( wit.current() ) {
+ QWidget *w = wit.current();
+ ++wit;
+ if ( ::qt_cast<FormWindow*>(w) ) {
+ if ( ( (FormWindow*)w )->project() == pro ) {
+ if ( ( (FormWindow*)w )->formFile()->editor() )
+ windows.removeRef( ( (FormWindow*)w )->formFile()->editor() );
+ if ( !( (FormWindow*)w )->formFile()->close() )
+ return;
+ }
+ } else if ( ::qt_cast<SourceEditor*>(w) ) {
+ if ( !( (SourceEditor*)w )->close() )
+ return;
+ }
+ }
+ hierarchyView->clear();
+ windows = qWorkspace()->windowList();
+ qWorkspace()->blockSignals( FALSE );
+ actionGroupProjects->removeChild( a );
+ projects.remove( a );
+ delete a;
+ currentProject = 0;
+ if ( lastValid ) {
+ projectSelected( lastValid );
+ statusMessage( i18n( "Selected project '%1'" ).arg( currentProject->projectName() ) );
+ }
+ if ( !windows.isEmpty() ) {
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ if ( !::qt_cast<FormWindow*>(w) )
+ continue;
+ w->setFocus();
+ activeWindowChanged( w );
+ break;
+ }
+ } else {
+ emit hasActiveWindow( FALSE );
+ emit hasActiveForm( FALSE );
+ updateUndoRedo( FALSE, FALSE, QString::null, QString::null );
+ }
+ }
+}
+
+void MainWindow::fileOpen() // as called by the menu
+{
+ fileOpen( "", "", "", FALSE );
+}
+
+void MainWindow::projectInsertFile()
+{
+ fileOpen( "", "" );
+}
+
+void MainWindow::fileOpen( const QString &filter, const QString &extension, const QString &fn, bool inProject )
+{
+ statusMessage( i18n( "Open a file...") );
+
+ QPluginManager<ImportFilterInterface> manager( IID_ImportFilter, QApplication::libraryPaths(), pluginDirectory() );
+
+ Project* project = inProject ? currentProject : eProject;
+
+ QStringList additionalSources;
+
+ {
+ QStringList filterlist;
+ if ( filter.isEmpty() ) {
+ if ( !inProject )
+ filterlist << i18n( "*.ui *.pro|Designer Files" );
+ filterlist << i18n( "*.ui|Qt User-Interface Files" );
+ if ( !inProject )
+ filterlist << i18n( "*.pro|QMAKE Project Files" );
+ QStringList list = manager.featureList();
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ filterlist << *it;
+ LanguageInterface *iface = MetaDataBase::languageInterface( project->language() );
+ if ( iface ) {
+ filterlist += iface->fileFilterList();
+ additionalSources += iface->fileExtensionList();
+ }
+ filterlist << i18n( "*|All Files" );
+ } else {
+ filterlist << filter;
+ }
+
+ QString filters = filterlist.join( "\n" );
+
+ QStringList filenames;
+ if ( fn.isEmpty() ) {
+ if ( !inProject ) {
+ QString f = KFileDialog::getOpenFileName( QString::null, filters, this, /*0,*/
+ i18n("Open" )/*, &lastOpenFilter */);
+ filenames << f;
+ } else {
+ filenames = KFileDialog::getOpenFileNames( QString::null, filters, this, /*0,*/
+ i18n("Add")/*, &lastOpenFilter */);
+ }
+ } else {
+ filenames << fn;
+ }
+
+ for ( QStringList::Iterator fit = filenames.begin(); fit != filenames.end(); ++fit ) {
+ QString filename = *fit;
+ if ( !filename.isEmpty() ) {
+ QFileInfo fi( filename );
+
+ if ( fi.extension( FALSE ) == "pro" && ( extension.isEmpty() || extension.find( ";pro" ) != -1 ) ) {
+ addRecentlyOpened( filename, recentlyProjects );
+ openProject( filename );
+ } else if ( fi.extension( FALSE ) == "ui" && ( extension.isEmpty() || extension.find( ";ui" ) != -1 ) ) {
+ if ( !inProject )
+ setCurrentProject( eProject );
+ openFormWindow( filename );
+ addRecentlyOpened( filename, recentlyFiles );
+ } else if ( !extension.isEmpty() && extension.find( ";" + fi.extension( FALSE ) ) != -1 ||
+ additionalSources.find( fi.extension( FALSE ) ) != additionalSources.end() ) {
+ SourceFile *sf = project->findSourceFile( project->makeRelative( filename ) );
+ if ( !sf )
+ sf = new SourceFile( project->makeRelative( filename ), FALSE, project );
+ editSource( sf );
+ } else if ( extension.isEmpty() ) {
+ QString filter;
+ for ( QStringList::Iterator it2 = filterlist.begin(); it2 != filterlist.end(); ++it2 ) {
+ if ( (*it2).contains( "." + fi.extension( FALSE ), FALSE ) ) {
+ filter = *it2;
+ break;
+ }
+ }
+
+ ImportFilterInterface* iface = 0;
+ manager.queryInterface( filter, &iface );
+ if ( !iface ) {
+ statusMessage( i18n( "No import filter is available to import '%1'").
+ arg( filename )/*, 3000*/ );
+ return;
+ }
+ statusMessage( i18n( "Importing '%1' using import filter ...").arg( filename ) );
+ QStringList list = iface->import( filter, filename );
+ iface->release();
+ if ( list.isEmpty() ) {
+ statusMessage( i18n( "Nothing to load in '%1'").arg( filename )/*, 3000*/ );
+ return;
+ }
+ if ( !inProject )
+ setCurrentProject( eProject );
+ addRecentlyOpened( filename, recentlyFiles );
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ openFormWindow( *it, FALSE );
+ QFile::remove( *it );
+ }
+ statusBar()->clear();
+ }
+ }
+ }
+ }
+}
+
+FormWindow *MainWindow::openFormWindow( const QString &filename, bool validFileName, FormFile *ff )
+{
+ if ( filename.isEmpty() )
+ return 0;
+
+ bool makeNew = FALSE;
+
+ if ( !QFile::exists( filename ) ) {
+ makeNew = TRUE;
+ } else {
+ QFile f( filename );
+ f.open( IO_ReadOnly );
+ QTextStream ts( &f );
+ makeNew = ts.read().length() < 2;
+ }
+ if ( makeNew ) {
+ fileNew();
+ if ( formWindow() )
+ formWindow()->setFileName( filename );
+ return formWindow();
+ }
+
+ statusMessage( i18n( "Reading file '%1'...").arg( filename ) );
+ FormFile *ff2 = currentProject->findFormFile( currentProject->makeRelative(filename) );
+ if ( ff2 && ff2->formWindow() ) {
+ ff2->formWindow()->setFocus();
+ return ff2->formWindow();
+ }
+
+ if ( ff2 )
+ ff = ff2;
+ QApplication::setOverrideCursor( WaitCursor );
+ Resource resource( this );
+ if ( !ff )
+ ff = new FormFile( currentProject->makeRelative( filename ), FALSE, currentProject );
+ bool b = resource.load( ff ) && (FormWindow*)resource.widget();
+ if ( !validFileName && resource.widget() )
+ ( (FormWindow*)resource.widget() )->setFileName( QString::null );
+ QApplication::restoreOverrideCursor();
+ if ( b ) {
+ rebuildCustomWidgetGUI();
+ statusMessage( i18n( "Loaded file '%1'").arg( filename )/*, 3000 */);
+ } else {
+ statusMessage( i18n( "Failed to load file '%1'").arg( filename )/*, 5000 */);
+ QMessageBox::information( this, i18n("Load File"), i18n("Could not load file '%1'.").arg( filename ) );
+ delete ff;
+ }
+ return (FormWindow*)resource.widget();
+}
+
+bool MainWindow::fileSave()
+{
+
+ if ( !currentProject->isDummy() )
+ return fileSaveProject();
+ return fileSaveForm();
+}
+
+bool MainWindow::fileSaveForm()
+{
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->object() == formWindow() || e == qWorkspace()->activeWindow() ) {
+ e->save();
+ }
+ }
+
+ FormWindow *fw = 0;
+
+ QWidget *w = qWorkspace()->activeWindow();
+ if ( w ) {
+ if ( ::qt_cast<SourceEditor*>(w) ) {
+ SourceEditor *se = (SourceEditor*)w;
+ if ( se->formWindow() )
+ fw = se->formWindow();
+ else if ( se->sourceFile() ) {
+ se->sourceFile()->save();
+ return TRUE;
+ }
+ }
+ }
+
+ if ( !fw )
+ fw = formWindow();
+ if ( !fw || !fw->formFile()->save() )
+ return FALSE;
+ QApplication::restoreOverrideCursor();
+ return TRUE;
+}
+
+bool MainWindow::fileSaveProject()
+{
+ currentProject->save();
+ statusMessage( i18n( "Project '%1' saved.").arg( currentProject->projectName() )/*, 3000 */);
+ return TRUE;
+}
+
+bool MainWindow::fileSaveAs()
+{
+ statusMessage( i18n( "Enter a filename..." ) );
+
+ QWidget *w = qworkspace->activeWindow();
+ if ( !w )
+ return TRUE;
+ if ( ::qt_cast<FormWindow*>(w) )
+ return ( (FormWindow*)w )->formFile()->saveAs();
+ else if ( ::qt_cast<SourceEditor*>(w) )
+ return ( (SourceEditor*)w )->saveAs();
+ return FALSE;
+}
+
+void MainWindow::fileSaveAll()
+{
+ for ( QMap<QAction*, Project* >::Iterator it = projects.begin(); it != projects.end(); ++it )
+ (*it)->save();
+}
+
+void MainWindow::fileCreateTemplate()
+{
+ CreateTemplate dia( this, 0, TRUE );
+
+ int i = 0;
+ for ( i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::isForm( i ) && WidgetDatabase::group( i ) != "Temp") {
+ dia.listClass->insertItem( WidgetDatabase::className( i ) );
+ }
+ }
+ for ( i = 0; i < WidgetDatabase::count(); ++i ) {
+ if ( WidgetDatabase::isContainer( i ) && !WidgetDatabase::isForm(i) &&
+ WidgetDatabase::className( i ) != "QTabWidget" && WidgetDatabase::group( i ) != "Temp" ) {
+ dia.listClass->insertItem( WidgetDatabase::className( i ) );
+ }
+ }
+
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ if ( w->isContainer )
+ dia.listClass->insertItem( w->className );
+ }
+
+ dia.editName->setText( i18n( "NewTemplate" ) );
+ connect( dia.buttonCreate, SIGNAL( clicked() ),
+ this, SLOT( createNewTemplate() ) );
+ dia.exec();
+}
+
+void MainWindow::createNewTemplate()
+{
+ CreateTemplate *dia = (CreateTemplate*)sender()->parent();
+ QString fn = dia->editName->text();
+ QString cn = dia->listClass->currentText();
+ if ( fn.isEmpty() || cn.isEmpty() ) {
+ QMessageBox::information( this, i18n( "Create Template" ), i18n( "Could not create the template." ) );
+ return;
+ }
+
+ QStringList templRoots;
+ const char *qtdir = getenv( "QTDIR" );
+ if(qtdir)
+ templRoots << qtdir;
+ templRoots << qInstallPathData();
+ if(qtdir) //try the tools/designer directory last!
+ templRoots << (QString(qtdir) + "/tools/designer");
+ QFile f;
+ for ( QStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
+ if ( QFile::exists( (*it) + "/templates/" )) {
+ QString tmpfn = (*it) + "/templates/" + fn + ".ui";
+ f.setName(tmpfn);
+ if(f.open(IO_WriteOnly))
+ break;
+ }
+ }
+ if ( !f.isOpen() ) {
+ QMessageBox::information( this, i18n( "Create Template" ), i18n( "Could not create the template." ) );
+ return;
+ }
+ QTextStream ts( &f );
+
+ ts << "<!DOCTYPE UI><UI>" << endl;
+ ts << "<widget>" << endl;
+ ts << "<class>" << cn << "</class>" << endl;
+ ts << "<property stdset=\"1\">" << endl;
+ ts << " <name>name</name>" << endl;
+ ts << " <cstring>" << cn << "Form</cstring>" << endl;
+ ts << "</property>" << endl;
+ ts << "<property stdset=\"1\">" << endl;
+ ts << " <name>geometry</name>" << endl;
+ ts << " <rect>" << endl;
+ ts << " <width>300</width>" << endl;
+ ts << " <height>400</height>" << endl;
+ ts << " </rect>" << endl;
+ ts << "</property>" << endl;
+ ts << "</widget>" << endl;
+ ts << "</UI>" << endl;
+
+ dia->editName->setText( i18n( "NewTemplate" ) );
+
+ f.close();
+}
+
+void MainWindow::editUndo()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editUndo();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->undo();
+}
+
+void MainWindow::editRedo()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editRedo();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->redo();
+}
+
+void MainWindow::editCut()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editCut();
+ return;
+ }
+ editCopy();
+ editDelete();
+}
+
+void MainWindow::editCopy()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editCopy();
+ return;
+ }
+ if ( formWindow() )
+ qApp->clipboard()->setText( formWindow()->copy() );
+}
+
+void MainWindow::editPaste()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editPaste();
+ return;
+ }
+ if ( !formWindow() )
+ return;
+
+ QWidget *w = formWindow()->mainContainer();
+ QWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 ) {
+ w = l.first();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) ) &&
+ w != formWindow()->mainContainer() ) )
+ w = formWindow()->mainContainer();
+ }
+
+ if ( w && WidgetFactory::layoutType( w ) == WidgetFactory::NoLayout ) {
+ formWindow()->paste( qApp->clipboard()->text(), WidgetFactory::containerOfWidget( w ) );
+ hierarchyView->widgetInserted( 0 );
+ formWindow()->commandHistory()->setModified( TRUE );
+ } else {
+ QMessageBox::information( this, i18n( "Paste Error" ),
+ i18n( "Cannot paste widgets. Designer could not find a container\n"
+ "to paste into which does not contain a layout. Break the layout\n"
+ "of the container you want to paste into and select this container\n"
+ "and then paste again." ) );
+ }
+}
+
+void MainWindow::editDelete()
+{
+ if ( formWindow() )
+ formWindow()->deleteWidgets();
+}
+
+void MainWindow::editSelectAll()
+{
+ if ( qWorkspace()->activeWindow() &&
+ ::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) ) {
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editSelectAll();
+ return;
+ }
+ if ( formWindow() )
+ formWindow()->selectAll();
+}
+
+
+void MainWindow::editLower()
+{
+ if ( formWindow() )
+ formWindow()->lowerWidgets();
+}
+
+void MainWindow::editRaise()
+{
+ if ( formWindow() )
+ formWindow()->raiseWidgets();
+}
+
+void MainWindow::editAdjustSize()
+{
+ if ( formWindow() )
+ formWindow()->editAdjustSize();
+}
+
+void MainWindow::editLayoutHorizontal()
+{
+ if ( layoutChilds )
+ editLayoutContainerHorizontal();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutHorizontal();
+}
+
+void MainWindow::editLayoutVertical()
+{
+ if ( layoutChilds )
+ editLayoutContainerVertical();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutVertical();
+}
+
+void MainWindow::editLayoutHorizontalSplit()
+{
+ if ( layoutChilds )
+ ; // no way to do that
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutHorizontalSplit();
+}
+
+void MainWindow::editLayoutVerticalSplit()
+{
+ if ( layoutChilds )
+ ; // no way to do that
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutVerticalSplit();
+}
+
+void MainWindow::editLayoutGrid()
+{
+ if ( layoutChilds )
+ editLayoutContainerGrid();
+ else if ( layoutSelected && formWindow() )
+ formWindow()->layoutGrid();
+}
+
+void MainWindow::editLayoutContainerVertical()
+{
+ if ( !formWindow() )
+ return;
+ QWidget *w = formWindow()->mainContainer();
+ QWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutVerticalContainer( w );
+}
+
+void MainWindow::editLayoutContainerHorizontal()
+{
+ if ( !formWindow() )
+ return;
+ QWidget *w = formWindow()->mainContainer();
+ QWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutHorizontalContainer( w );
+}
+
+void MainWindow::editLayoutContainerGrid()
+{
+ if ( !formWindow() )
+ return;
+ QWidget *w = formWindow()->mainContainer();
+ QWidgetList l( formWindow()->selectedWidgets() );
+ if ( l.count() == 1 )
+ w = l.first();
+ if ( w )
+ formWindow()->layoutGridContainer( w );
+}
+
+void MainWindow::editBreakLayout()
+{
+ if ( !formWindow() || !breakLayout )
+ return;
+ QWidget *w = formWindow()->mainContainer();
+ if ( formWindow()->currentWidget() )
+ w = formWindow()->currentWidget();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) {
+ formWindow()->breakLayout( w );
+ return;
+ } else {
+ QWidgetList widgets = formWindow()->selectedWidgets();
+ for ( w = widgets.first(); w; w = widgets.next() ) {
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ break;
+ }
+ if ( w ) {
+ formWindow()->breakLayout( w );
+ return;
+ }
+ }
+
+ w = formWindow()->mainContainer();
+ if ( WidgetFactory::layoutType( w ) != WidgetFactory::NoLayout ||
+ w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
+ formWindow()->breakLayout( w );
+}
+
+void MainWindow::editAccels()
+{
+ if ( !formWindow() )
+ return;
+ formWindow()->checkAccels();
+}
+
+void MainWindow::editFunctions()
+{
+ if ( !formWindow() )
+ return;
+
+ statusMessage( i18n( "Edit the current form's slots..." ) );
+ EditFunctions dlg( this, formWindow(), TRUE );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::editConnections()
+{
+ if ( !formWindow() )
+ return;
+
+ statusMessage( i18n( "Edit the current form's connections..." ) );
+ ConnectionDialog dlg( this );
+ dlg.exec();
+
+ statusBar()->clear();
+}
+
+SourceEditor *MainWindow::editSource()
+{
+ if ( !formWindow() )
+ return 0;
+ return formWindow()->formFile()->showEditor();
+}
+
+SourceEditor *MainWindow::openSourceEditor()
+{
+ if ( !formWindow() )
+ return 0;
+
+ QString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ QMessageBox::information( this, i18n( "Edit Source" ),
+ i18n( "There is no plugin for editing %1 code installed.\n"
+ "Note: Plugins are not available in static Qt configurations." ).arg( lang ) );
+ return 0;
+ }
+
+ SourceEditor *editor = 0;
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() ) {
+ if ( e->language() == lang && e->formWindow() == formWindow() ) {
+ editor = e;
+ break;
+ }
+ }
+
+ if ( !editor )
+ editor = createSourceEditor( formWindow(), formWindow()->project(), lang );
+ return editor;
+}
+
+SourceEditor *MainWindow::editSource( SourceFile *f )
+{
+ QString lang = currentProject->language();
+ if ( !MetaDataBase::hasEditor( lang ) ) {
+ QMessageBox::information( this, i18n( "Edit Source" ),
+ i18n( "There is no plugin for editing %1 code installed.\n"
+ "Note: Plugins are not available in static Qt configurations." ).arg( lang ) );
+ return 0;
+ }
+
+ SourceEditor *editor = 0;
+ if ( f )
+ editor = f->editor();
+ if ( !editor )
+ editor = createSourceEditor( f, currentProject, lang );
+ editor->setActiveWindow();
+ editor->setFocus();
+ return editor;
+}
+
+SourceEditor *MainWindow::createSourceEditor( QObject *object, Project *project,
+ const QString &lang, const QString &func,
+ bool rereadSource )
+{
+ SourceEditor *editor = 0;
+ EditorInterface *eIface = 0;
+ editorPluginManager->queryInterface( lang, &eIface );
+ if ( !eIface )
+ return 0;
+ LanguageInterface *lIface = MetaDataBase::languageInterface( lang );
+ if ( !lIface )
+ return 0;
+ QApplication::setOverrideCursor( WaitCursor );
+ editor = new SourceEditor( qWorkspace(), eIface, lIface );
+ eIface->release();
+ lIface->release();
+
+ editor->setLanguage( lang );
+ sourceEditors.append( editor );
+ QApplication::restoreOverrideCursor();
+
+ if ( editor->object() != object )
+ editor->setObject( object, project );
+ else if ( rereadSource )
+ editor->refresh( FALSE );
+
+ editor->show();
+ editor->setFocus();
+ if ( !func.isEmpty() )
+ editor->setFunction( func );
+ emit editorChanged();
+
+ return editor;
+}
+
+void MainWindow::editFormSettings()
+{
+ if ( !formWindow() )
+ return;
+
+ statusMessage( i18n( "Edit the current form's settings..." ) );
+ FormSettings dlg( this, formWindow() );
+ dlg.exec();
+ statusBar()->clear();
+}
+
+void MainWindow::editProjectSettings()
+{
+ openProjectSettings( currentProject );
+ wspace->setCurrentProject( currentProject );
+}
+
+void MainWindow::editPixmapCollection()
+{
+ PixmapCollectionEditor dia( this, 0, TRUE );
+ dia.setProject( currentProject );
+ dia.exec();
+}
+
+void MainWindow::editDatabaseConnections()
+{
+#ifndef QT_NO_SQL
+ DatabaseConnectionsEditor dia( currentProject, this, 0, TRUE );
+ dia.exec();
+#endif
+}
+
+void MainWindow::editPreferences()
+{
+ statusMessage( i18n( "Edit preferences..." ) );
+ Preferences *dia = new Preferences( this, 0, TRUE );
+ prefDia = dia;
+ connect( dia->helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ dia->buttonColor->setEditor( StyledButton::ColorEditor );
+ dia->buttonPixmap->setEditor( StyledButton::PixmapEditor );
+ dia->groupBoxGrid->setChecked( sGrid );
+ dia->checkBoxSnapGrid->setChecked( snGrid );
+ dia->spinGridX->setValue( grid().x() );
+ dia->spinGridY->setValue( grid().y() );
+ dia->checkBoxWorkspace->setChecked( restoreConfig );
+ dia->checkBoxTextLabels->setChecked( usesTextLabel() );
+ dia->buttonColor->setColor( qworkspace->backgroundColor() );
+ QString pluginPaths = QApplication::libraryPaths().join("\n");
+ dia->textEditPluginPaths->setText(pluginPaths);
+ if ( qworkspace->backgroundPixmap() )
+ dia->buttonPixmap->setPixmap( *qworkspace->backgroundPixmap() );
+ if ( backPix )
+ dia->radioPixmap->setChecked( TRUE );
+ else
+ dia->radioColor->setChecked( TRUE );
+ dia->checkBoxSplash->setChecked( splashScreen );
+ dia->checkAutoEdit->setChecked( !databaseAutoEdit );
+ dia->checkBoxStartDialog->setChecked( shStartDialog );
+ dia->checkBoxAutoSave->setChecked( autoSaveEnabled );
+ int h = autoSaveInterval / 3600;
+ int m = ( autoSaveInterval - h * 3600 ) / 60;
+ int s = autoSaveInterval - ( h * 3600 + m * 60 );
+ QTime t( h, m, s );
+ dia->timeEditAutoSave->setTime( t );
+
+ SenderObject *senderObject = new SenderObject( designerInterface() );
+ QValueList<Tab>::Iterator it;
+ for ( it = preferenceTabs.begin(); it != preferenceTabs.end(); ++it ) {
+ Tab t = *it;
+ dia->tabWidget->addTab( t.w, t.title );
+ if ( t.receiver ) {
+ connect( dia->buttonOk, SIGNAL( clicked() ), senderObject, SLOT( emitAcceptSignal() ) );
+ connect( senderObject, SIGNAL( acceptSignal( QUnknownInterface * ) ), t.receiver, t.accept_slot );
+ connect( senderObject, SIGNAL( initSignal( QUnknownInterface * ) ), t.receiver, t.init_slot );
+ senderObject->emitInitSignal();
+ disconnect( senderObject, SIGNAL( initSignal( QUnknownInterface * ) ), t.receiver, t.init_slot );
+ }
+ }
+
+ if ( dia->exec() == QDialog::Accepted ) {
+ setSnapGrid( dia->checkBoxSnapGrid->isChecked() );
+ setShowGrid( dia->groupBoxGrid->isChecked() );
+ setGrid( QPoint( dia->spinGridX->value(),
+ dia->spinGridY->value() ) );
+ restoreConfig = dia->checkBoxWorkspace->isChecked();
+ setUsesTextLabel( dia->checkBoxTextLabels->isChecked() );
+ if (dia->textEditPluginPaths->isModified()) {
+ pluginPaths = dia->textEditPluginPaths->text();
+ QApplication::setLibraryPaths(QStringList::split("\n", pluginPaths));
+ savePluginPaths = TRUE;
+ }
+
+ if ( dia->radioPixmap->isChecked() && dia->buttonPixmap->pixmap() ) {
+ qworkspace->setBackgroundPixmap( *dia->buttonPixmap->pixmap() );
+ backPix = TRUE;
+ } else {
+ qworkspace->setBackgroundColor( dia->buttonColor->color() );
+ backPix = FALSE;
+ }
+ splashScreen = dia->checkBoxSplash->isChecked();
+ databaseAutoEdit = !dia->checkAutoEdit->isChecked();
+ shStartDialog = dia->checkBoxStartDialog->isChecked();
+ autoSaveEnabled = dia->checkBoxAutoSave->isChecked();
+ QTime time = dia->timeEditAutoSave->time();
+ autoSaveInterval = time.hour() * 3600 + time.minute() * 60 + time.second();
+ if ( autoSaveEnabled )
+ autoSaveTimer->start( autoSaveInterval * 1000 );
+ else
+ autoSaveTimer->stop();
+ }
+ delete senderObject;
+ for ( it = preferenceTabs.begin(); it != preferenceTabs.end(); ++it ) {
+ Tab t = *it;
+ dia->tabWidget->removePage( t.w );
+ t.w->reparent( 0, QPoint(0,0), FALSE );
+ }
+
+ for ( SourceEditor *e = sourceEditors.first(); e; e = sourceEditors.next() )
+ e->configChanged();
+
+ delete dia;
+ prefDia = 0;
+ statusBar()->clear();
+}
+
+void MainWindow::searchFind()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !findDialog )
+ findDialog = new FindDialog( this, 0, FALSE );
+ findDialog->show();
+ findDialog->raise();
+ findDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface(),
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->object() );
+ findDialog->comboFind->setFocus();
+ findDialog->comboFind->lineEdit()->selectAll();
+}
+
+void MainWindow::searchIncremetalFindMenu()
+{
+ incrementalSearch->selectAll();
+ incrementalSearch->setFocus();
+}
+
+void MainWindow::searchIncremetalFind()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(),
+ FALSE, FALSE, TRUE, FALSE );
+}
+
+void MainWindow::searchIncremetalFindNext()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface()->find( incrementalSearch->text(),
+ FALSE, FALSE, TRUE, TRUE );
+}
+
+void MainWindow::searchReplace()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !replaceDialog )
+ replaceDialog = new ReplaceDialog( this, 0, FALSE );
+ replaceDialog->show();
+ replaceDialog->raise();
+ replaceDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface(),
+ ( (SourceEditor*)qWorkspace()->activeWindow() )->object() );
+ replaceDialog->comboFind->setFocus();
+ replaceDialog->comboFind->lineEdit()->selectAll();
+}
+
+void MainWindow::searchGotoLine()
+{
+ if ( !qWorkspace()->activeWindow() ||
+ !::qt_cast<SourceEditor*>(qWorkspace()->activeWindow()) )
+ return;
+
+ if ( !gotoLineDialog )
+ gotoLineDialog = new GotoLineDialog( this, 0, FALSE );
+ gotoLineDialog->show();
+ gotoLineDialog->raise();
+ gotoLineDialog->setEditor( ( (SourceEditor*)qWorkspace()->activeWindow() )->editorInterface() );
+ gotoLineDialog->spinLine->setFocus();
+ gotoLineDialog->spinLine->setMinValue( 1 );
+ gotoLineDialog->spinLine->setMaxValue( ( (SourceEditor*)qWorkspace()->activeWindow() )->numLines() );
+ gotoLineDialog->spinLine->selectAll();
+}
+
+void MainWindow::toolsCustomWidget()
+{
+ statusMessage( i18n( "Edit custom widgets..." ) );
+ CustomWidgetEditor edit( this, this );
+ edit.exec();
+ rebuildCustomWidgetGUI();
+ statusBar()->clear();
+}
+
+void MainWindow::toolsConfigure()
+{
+ ConfigToolboxDialog dlg( this );
+ if ( dlg.exec() != QDialog::Accepted )
+ return;
+ rebuildCommonWidgetsToolBoxPage();
+}
+
+void MainWindow::showStartDialog()
+{
+ if ( singleProjectMode() )
+ return;
+ for ( int i = 1; i < qApp->argc(); ++i ) {
+ QString arg = qApp->argv()[i];
+ if ( arg[0] != '-' )
+ return;
+ }
+ StartDialog *sd = new StartDialog( this, templatePath() );
+ sd->setRecentlyFiles( recentlyFiles );
+ sd->setRecentlyProjects( recentlyProjects );
+ sd->exec();
+ shStartDialog = sd->showDialogInFuture();
+}
diff --git a/kdevdesigner/designer/menubareditor.cpp b/kdevdesigner/designer/menubareditor.cpp
new file mode 100644
index 00000000..33cf923e
--- /dev/null
+++ b/kdevdesigner/designer/menubareditor.cpp
@@ -0,0 +1,1129 @@
+/**********************************************************************
+** Copyright (C) 2003 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qaction.h>
+#include <qapplication.h>
+#include <qbitmap.h>
+#include <qdragobject.h>
+#include <qlineedit.h>
+#include <qmainwindow.h>
+#include <qpainter.h>
+#include <qstyle.h>
+#include "command.h"
+#include "formwindow.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+#include <klocale.h>
+
+extern void find_accel( const QString &txt, QMap<QChar, QWidgetList > &accels, QWidget *w );
+
+// Drag Object Declaration -------------------------------------------
+
+class MenuBarEditorItemPtrDrag : public QStoredDrag
+{
+public:
+ MenuBarEditorItemPtrDrag( MenuBarEditorItem * item,
+ QWidget * parent = 0,
+ const char * name = 0 );
+ ~MenuBarEditorItemPtrDrag() {};
+ static bool canDecode( QDragMoveEvent * e );
+ static bool decode( QDropEvent * e, MenuBarEditorItem ** i );
+};
+
+// Drag Object Implementation ---------------------------------------
+
+MenuBarEditorItemPtrDrag::MenuBarEditorItemPtrDrag( MenuBarEditorItem * item,
+ QWidget * parent,
+ const char * name )
+ : QStoredDrag( "qt/menubareditoritemptr", parent, name )
+{
+ QByteArray data( sizeof( Q_LONG ) );
+ QDataStream stream( data, IO_WriteOnly );
+ stream << ( Q_LONG ) item;
+ setEncodedData( data );
+}
+
+bool MenuBarEditorItemPtrDrag::canDecode( QDragMoveEvent * e )
+{
+ return e->provides( "qt/menubareditoritemptr" );
+}
+
+bool MenuBarEditorItemPtrDrag::decode( QDropEvent * e, MenuBarEditorItem ** i )
+{
+ QByteArray data = e->encodedData( "qt/menubareditoritemptr" );
+ QDataStream stream( data, IO_ReadOnly );
+
+ if ( !data.size() )
+ return FALSE;
+
+ Q_LONG p = 0;
+ stream >> p;
+ *i = ( MenuBarEditorItem *) p;
+
+ return TRUE;
+}
+
+// MenuBarEditorItem ---------------------------------------------------
+
+MenuBarEditorItem::MenuBarEditorItem( MenuBarEditor * bar, QObject * parent, const char * name )
+ : QObject( parent, name ),
+ menuBar( bar ),
+ popupMenu( 0 ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( FALSE )
+{ }
+
+MenuBarEditorItem::MenuBarEditorItem( PopupMenuEditor * menu, MenuBarEditor * bar,
+ QObject * parent, const char * name )
+ : QObject( parent, name ),
+ menuBar( bar ),
+ popupMenu( menu ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ text = menu->name();
+}
+
+MenuBarEditorItem::MenuBarEditorItem( QActionGroup * actionGroup, MenuBarEditor * bar,
+ QObject * parent, const char * name )
+ : QObject( parent, name ),
+ menuBar( bar ),
+ popupMenu( 0 ),
+ visible( TRUE ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ text = actionGroup->menuText();
+ popupMenu = new PopupMenuEditor( menuBar->formWindow(), menuBar );
+ popupMenu->insert( actionGroup );
+}
+
+MenuBarEditorItem::MenuBarEditorItem( MenuBarEditorItem * item, QObject * parent, const char * name )
+ : QObject( parent, name ),
+ menuBar( item->menuBar ),
+ popupMenu( 0 ),
+ text( item->text ),
+ visible( item->visible ),
+ separator( item->separator ),
+ removable( item->removable )
+{
+ popupMenu = new PopupMenuEditor( menuBar->formWindow(), item->popupMenu, menuBar );
+}
+
+// MenuBarEditor --------------------------------------------------------
+
+int MenuBarEditor::clipboardOperation = 0;
+MenuBarEditorItem * MenuBarEditor::clipboardItem = 0;
+
+MenuBarEditor::MenuBarEditor( FormWindow * fw, QWidget * parent, const char * name )
+ : QMenuBar( parent, name ),
+ formWnd( fw ),
+ draggedItem( 0 ),
+ currentIndex( 0 ),
+ itemHeight( 0 ),
+ separatorWidth( 32 ),
+ hideWhenEmpty( TRUE ),
+ hasSeparator( FALSE )
+{
+ setAcceptDrops( TRUE );
+ setFocusPolicy( StrongFocus );
+
+ addItem.setMenuText( i18n("new menu") );
+ addSeparator.setMenuText( i18n("new separator") );
+
+ lineEdit = new QLineEdit( this, "menubar lineedit" );
+ lineEdit->hide();
+ lineEdit->setFrameStyle(QFrame::Plain | QFrame::NoFrame);
+ lineEdit->polish();
+ lineEdit->setBackgroundMode(PaletteButton);
+ lineEdit->setBackgroundOrigin(ParentOrigin);
+ lineEdit->installEventFilter( this );
+
+ dropLine = new QWidget( this, "menubar dropline", Qt::WStyle_NoBorder | WStyle_StaysOnTop );
+ dropLine->setBackgroundColor( Qt::red );
+ dropLine->hide();
+
+ setMinimumHeight( fontMetrics().height() + 2 * borderSize() );
+}
+
+MenuBarEditor::~MenuBarEditor()
+{
+ itemList.setAutoDelete( TRUE );
+}
+
+FormWindow * MenuBarEditor::formWindow()
+{
+ return formWnd;
+}
+
+MenuBarEditorItem * MenuBarEditor::createItem( int index, bool addToCmdStack )
+{
+ MenuBarEditorItem * i =
+ new MenuBarEditorItem( new PopupMenuEditor( formWnd, ( QWidget * ) parent() ), this );
+ if ( addToCmdStack ) {
+ AddMenuCommand * cmd = new AddMenuCommand( i18n( "Add Menu" ), formWnd, this, i, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else {
+ AddMenuCommand cmd( i18n( "Add Menu" ), formWnd, this, i, index );
+ cmd.execute();
+ }
+ return i;
+}
+
+void MenuBarEditor::insertItem( MenuBarEditorItem * item, int index )
+{
+ item->menu()->parentMenu = this;
+
+ if ( index != -1 )
+ itemList.insert( index, item );
+ else
+ itemList.append( item );
+
+ if ( hideWhenEmpty && itemList.count() == 1 )
+ show(); // calls resizeInternals();
+ else
+ resizeInternals();
+
+ if ( isVisible() )
+ update();
+}
+
+void MenuBarEditor::insertItem( QString text, PopupMenuEditor * menu, int index )
+{
+ MenuBarEditorItem * item = new MenuBarEditorItem( menu, this );
+ if ( !text.isNull() )
+ item->setMenuText( text );
+ insertItem( item, index );
+}
+
+void MenuBarEditor::insertItem( QString text, QActionGroup * group, int index )
+{
+ MenuBarEditorItem * item = new MenuBarEditorItem( group, this );
+ if ( !text.isNull() )
+ item->setMenuText( text );
+ insertItem( item, index );
+}
+
+
+void MenuBarEditor::insertSeparator( int index )
+{
+ if ( hasSeparator )
+ return;
+
+ MenuBarEditorItem * i = createItem( index );
+ i->setSeparator( TRUE );
+ i->setMenuText( i18n( "separator" ) );
+ hasSeparator = TRUE;
+}
+
+void MenuBarEditor::removeItemAt( int index )
+{
+ removeItem( item( index ) );
+}
+
+void MenuBarEditor::removeItem( MenuBarEditorItem * item )
+{
+ if ( item &&
+ item->isRemovable() &&
+ itemList.removeRef( item ) ) {
+
+ if ( item->isSeparator() )
+ hasSeparator = FALSE;
+
+ if ( hideWhenEmpty && itemList.count() == 0 )
+ hide();
+ else
+ resizeInternals();
+
+ int n = count() + 1;
+ if ( currentIndex >= n )
+ currentIndex = n;
+
+ if ( isVisible() )
+ update();
+ }
+}
+
+int MenuBarEditor::findItem( MenuBarEditorItem * item )
+{
+ return itemList.findRef( item );
+}
+
+int MenuBarEditor::findItem( PopupMenuEditor * menu )
+{
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+ if ( i->menu() == menu )
+ return itemList.at();
+ i = itemList.next();
+ }
+
+ return -1;
+}
+
+int MenuBarEditor::findItem( QPoint & pos )
+{
+ int x = borderSize();
+ int dx = 0;
+ int y = 0;
+ int w = width();
+ QSize s;
+ QRect r;
+
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+
+ if ( i->isVisible() ) {
+
+ s = itemSize( i );
+ dx = s.width();
+
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ r = QRect( x, y, s.width(), s.height() );
+
+ if ( r.contains( pos ) )
+ return itemList.at();
+
+ addItemSizeToCoords( i, x, y, w );
+ }
+
+ i = itemList.next();
+ }
+
+ // check add item
+ s = itemSize( &addItem );
+ dx = s.width();
+
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ r = QRect( x, y, s.width(), s.height() );
+
+ if ( r.contains( pos ) )
+ return itemList.count();
+
+ return itemList.count() + 1;
+}
+
+MenuBarEditorItem * MenuBarEditor::item( int index )
+{
+ if ( index == -1 )
+ return itemList.at( currentIndex );
+
+ int c = itemList.count();
+ if ( index == c )
+ return &addItem;
+ else if ( index > c )
+ return &addSeparator;
+
+ return itemList.at( index );
+}
+
+int MenuBarEditor::count()
+{
+ return itemList.count();
+}
+
+int MenuBarEditor::current()
+{
+ return currentIndex;
+}
+
+void MenuBarEditor::cut( int index )
+{
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Cut;
+ clipboardItem = itemList.at( index );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ return; // do nothing
+ }
+
+ RemoveMenuCommand * cmd = new RemoveMenuCommand( i18n( "Cut Menu" ), formWnd, this, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void MenuBarEditor::copy( int index )
+{
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Copy;
+ clipboardItem = itemList.at( index );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ }
+}
+
+void MenuBarEditor::paste( int index )
+{
+ if ( clipboardItem && clipboardOperation ) {
+ MenuBarEditorItem * i = new MenuBarEditorItem( clipboardItem );
+ AddMenuCommand * cmd = new AddMenuCommand( i18n( "Paste Menu" ), formWnd, this, i, index );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void MenuBarEditor::exchange( int a, int b )
+{
+ MenuBarEditorItem * ia = itemList.at( a );
+ MenuBarEditorItem * ib = itemList.at( b );
+ if ( !ia || !ib ||
+ ia == &addItem || ia == &addSeparator ||
+ ib == &addItem || ib == &addSeparator )
+ return; // do nothing
+ itemList.replace( b, ia );
+ itemList.replace( a, ib );
+}
+
+void MenuBarEditor::showLineEdit( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ MenuBarEditorItem * i = 0;
+
+ if ( (uint) index >= itemList.count() )
+ i = &addItem;
+ else
+ i = itemList.at( index );
+
+ if ( i && i->isSeparator() )
+ return;
+
+ // open edit field for item name
+ lineEdit->setText( i->menuText() );
+ lineEdit->selectAll();
+ QPoint pos = itemPos( index );
+ lineEdit->move( pos.x() + borderSize(), pos.y() - ( borderSize() / 2 ) );
+ lineEdit->resize( itemSize( i ) );
+ lineEdit->show();
+ lineEdit->setFocus();
+}
+
+void MenuBarEditor::showItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ MenuBarEditorItem * i = itemList.at( index );
+ if ( i->isSeparator() || draggedItem )
+ return;
+ PopupMenuEditor * m = i->menu();
+ QPoint pos = itemPos( index );
+ m->move( pos.x(), pos.y() + itemHeight - 1 );
+ m->raise();
+ m->show();
+ setFocus();
+ }
+}
+
+void MenuBarEditor::hideItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ PopupMenuEditor * m = itemList.at( index )->menu();
+ m->hideSubMenu();
+ m->hide();
+ }
+}
+
+void MenuBarEditor::focusItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ PopupMenuEditor * m = itemList.at( index )->menu();
+ m->setFocus();
+ m->update();
+ update();
+ }
+}
+
+void MenuBarEditor::deleteItem( int index )
+{
+ if ( index == -1 )
+ index = currentIndex;
+
+ if ( (uint)index < itemList.count() ) {
+ RemoveMenuCommand * cmd = new RemoveMenuCommand( i18n( "Delete Menu" ),
+ formWnd,
+ this,
+ currentIndex );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+QSize MenuBarEditor::sizeHint() const
+{
+ return QSize( parentWidget()->width(), heightForWidth( parentWidget()->width() ) );
+}
+
+int MenuBarEditor::heightForWidth( int max_width ) const
+{
+ MenuBarEditor * that = ( MenuBarEditor * ) this;
+ int x = borderSize();
+ int y = 0;
+
+ QPainter p( this );
+ that->itemHeight = that->itemSize( &(that->addItem) ).height();
+
+ MenuBarEditorItem * i = that->itemList.first();
+ while ( i ) {
+ if ( i->isVisible() )
+ that->addItemSizeToCoords( i, x, y, max_width );
+ i = that->itemList.next();
+ }
+
+ that->addItemSizeToCoords( &(that->addItem), x, y, max_width );
+ that->addItemSizeToCoords( &(that->addSeparator), x, y, max_width );
+
+ return y + itemHeight;
+}
+
+void MenuBarEditor::show()
+{
+ QWidget::show();
+ resizeInternals();
+
+ QResizeEvent e( parentWidget()->size(), parentWidget()->size() );
+ QApplication::sendEvent( parentWidget(), &e );
+}
+
+void MenuBarEditor::checkAccels( QMap<QChar, QWidgetList > &accels )
+{
+ QString t;
+ MenuBarEditorItem * i = itemList.first();
+ while ( i ) {
+ t = i->menuText();
+ find_accel( t, accels, this );
+ // do not check the accelerators in the popup menus
+ i = itemList.next();
+ }
+}
+
+// public slots
+
+void MenuBarEditor::cut()
+{
+ cut( currentIndex );
+}
+
+void MenuBarEditor::copy()
+{
+ copy( currentIndex );
+}
+
+void MenuBarEditor::paste()
+{
+ paste( currentIndex );
+}
+
+// protected
+
+bool MenuBarEditor::eventFilter( QObject * o, QEvent * e )
+{
+ if ( o == lineEdit && e->type() == QEvent::FocusOut ) {
+ leaveEditMode();
+ lineEdit->hide();
+ update();
+ } else if ( e->type() == QEvent::LayoutHint ) {
+ resize( sizeHint() );
+ }
+ return QMenuBar::eventFilter( o, e );
+}
+
+void MenuBarEditor::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ QRect r = rect();
+ style().drawPrimitive( QStyle::PE_PanelMenuBar, &p,
+ r, colorGroup() );
+ drawItems( p );
+}
+
+void MenuBarEditor::mousePressEvent( QMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ hideItem();
+ lineEdit->hide();
+ currentIndex = findItem( mousePressPos );
+ showItem();
+ update();
+ e->accept();
+}
+
+void MenuBarEditor::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ currentIndex = findItem( mousePressPos );
+ lineEdit->hide();
+ if ( currentIndex > (int)itemList.count() ) {
+ insertSeparator();
+ update();
+ } else {
+ showLineEdit();
+ }
+}
+
+void MenuBarEditor::mouseMoveEvent( QMouseEvent * e )
+{
+ if ( e->state() & Qt::LeftButton ) {
+ if ( ( e->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ bool itemCreated = FALSE;
+ bool isSeparator = FALSE;
+ draggedItem = item( findItem( mousePressPos ) );
+ if ( draggedItem == &addItem ) {
+ draggedItem = createItem();
+ itemCreated = TRUE;
+ } else if ( draggedItem == &addSeparator ) {
+ if (hasSeparator) // we can only have one separator
+ return;
+ draggedItem = createItem();
+ draggedItem->setSeparator( TRUE );
+ draggedItem->setMenuText( "separator" );
+ isSeparator = TRUE;
+ itemCreated = TRUE;
+ } else {
+ isSeparator = draggedItem->isSeparator();
+ }
+
+ MenuBarEditorItemPtrDrag * d =
+ new MenuBarEditorItemPtrDrag( draggedItem, this );
+ d->setPixmap( createTextPixmap( draggedItem->menuText() ) );
+ hideItem();
+ draggedItem->setVisible( FALSE );
+ update();
+
+ // If the item is dropped in the same list,
+ // we will have two instances of the same pointer
+ // in the list.
+ itemList.find( draggedItem );
+ QLNode * node = itemList.currentNode();
+ dropConfirmed = FALSE;
+ d->dragCopy(); // dragevents and stuff happens
+ if ( draggedItem ) { // item was not dropped
+ if ( itemCreated ) {
+ removeItem( draggedItem );
+ } else {
+ hideItem();
+ draggedItem->setVisible( TRUE );
+ draggedItem = 0;
+ showItem();
+ }
+ } else if ( dropConfirmed ) { // item was dropped
+ dropConfirmed = FALSE;
+ hideItem();
+ itemList.takeNode( node )->setVisible( TRUE );
+ hasSeparator = isSeparator || hasSeparator;
+ showItem();
+ } else {
+ hasSeparator = isSeparator || hasSeparator;
+ }
+ update();
+ }
+ }
+}
+
+void MenuBarEditor::dragEnterEvent( QDragEnterEvent * e )
+{
+ if ( MenuBarEditorItemPtrDrag::canDecode( e ) ) {
+ e->accept();
+ dropLine->show();
+ }
+}
+
+void MenuBarEditor::dragLeaveEvent( QDragLeaveEvent * )
+{
+ dropLine->hide();
+}
+
+void MenuBarEditor::dragMoveEvent( QDragMoveEvent * e )
+{
+
+ QPoint pos = e->pos();
+ dropLine->move( snapToItem( pos ) );
+
+ int idx = findItem( pos );
+ if ( currentIndex != idx ) {
+ hideItem();
+ currentIndex = idx;
+ showItem();
+ }
+}
+
+void MenuBarEditor::dropEvent( QDropEvent * e )
+{
+ MenuBarEditorItem * i = 0;
+
+ if ( MenuBarEditorItemPtrDrag::decode( e, &i ) ) {
+ draggedItem = 0;
+ hideItem();
+ dropInPlace( i, e->pos() );
+ e->accept();
+ }
+
+ dropLine->hide();
+}
+
+void MenuBarEditor::keyPressEvent( QKeyEvent * e )
+{
+ if ( lineEdit->isHidden() ) { // In navigation mode
+ switch ( e->key() ) {
+
+ case Qt::Key_Delete:
+ hideItem();
+ deleteItem();
+ showItem();
+ break;
+
+ case Qt::Key_Left:
+ e->accept();
+ navigateLeft( e->state() & Qt::ControlButton );
+ return;
+
+ case Qt::Key_Right:
+ e->accept();
+ navigateRight( e->state() & Qt::ControlButton );
+ return; // no update
+
+ case Qt::Key_Down:
+ e->accept();
+ focusItem();
+ return; // no update
+
+ case Qt::Key_PageUp:
+ currentIndex = 0;
+ break;
+
+ case Qt::Key_PageDown:
+ currentIndex = itemList.count();
+ break;
+
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_F2:
+ e->accept();
+ enterEditMode();
+ return; // no update
+
+ case Qt::Key_Up:
+ case Qt::Key_Alt:
+ case Qt::Key_Shift:
+ case Qt::Key_Control:
+ case Qt::Key_Escape:
+ e->ignore();
+ setFocus(); // FIXME: this is because some other widget get the focus when CTRL is pressed
+ return; // no update
+
+ case Qt::Key_C:
+ if ( e->state() & Qt::ControlButton && currentIndex < (int)itemList.count() ) {
+ copy( currentIndex );
+ break;
+ }
+
+ case Qt::Key_X:
+ if ( e->state() & Qt::ControlButton && currentIndex < (int)itemList.count() ) {
+ hideItem();
+ cut( currentIndex );
+ showItem();
+ break;
+ }
+
+ case Qt::Key_V:
+ if ( e->state() & Qt::ControlButton ) {
+ hideItem();
+ paste( currentIndex < (int)itemList.count() ? currentIndex + 1: itemList.count() );
+ showItem();
+ break;
+ }
+
+ default:
+ if ( e->ascii() >= 32 || e->ascii() == 0 ) {
+ showLineEdit();
+ QApplication::sendEvent( lineEdit, e );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ return;
+ }
+ } else { // In edit mode
+
+ switch ( e->key() ) {
+ case Qt::Key_Control:
+ e->ignore();
+ return;
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ leaveEditMode();
+ case Qt::Key_Escape:
+ lineEdit->hide();
+ setFocus();
+ break;
+ }
+ }
+ e->accept();
+ update();
+}
+
+void MenuBarEditor::focusOutEvent( QFocusEvent * e )
+{
+ QWidget * fw = qApp->focusWidget();
+ if ( e->lostFocus() && !::qt_cast<PopupMenuEditor*>(fw) )
+ hideItem();
+ update();
+}
+
+void MenuBarEditor::resizeInternals()
+{
+ dropLine->resize( 2, itemHeight );
+ updateGeometry();
+}
+
+void MenuBarEditor::drawItems( QPainter & p )
+{
+ QPoint pos( borderSize(), 0 );
+ uint c = 0;
+
+ p.setPen( colorGroup().buttonText() );
+
+ MenuBarEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->isVisible() )
+ drawItem( p, i, c++, pos ); // updates x y
+ i = itemList.next();
+ }
+
+ p.setPen( darkBlue );
+ drawItem( p, &addItem, c++, pos );
+ if ( !hasSeparator )
+ drawItem( p, &addSeparator, c, pos );
+}
+
+void MenuBarEditor::drawItem( QPainter & p,
+ MenuBarEditorItem * i,
+ int idx,
+ QPoint & pos )
+{
+ int w = itemSize( i ).width();
+
+ // If the item passes the right border, and it is not the first item on the line
+ if ( pos.x() + w > width() && pos.x() > borderSize() ) { // wrap
+ pos.ry() += itemHeight;
+ pos.setX( borderSize() );
+ }
+
+ if ( i->isSeparator() ) {
+ drawSeparator( p, pos );
+ } else {
+ int flags = QPainter::AlignLeft | QPainter::AlignVCenter |
+ Qt::ShowPrefix | Qt::SingleLine;
+ p.drawText( pos.x() + borderSize(), pos.y(), w - borderSize(), itemHeight,
+ flags, i->menuText() );
+ }
+
+ if ( hasFocus() && idx == currentIndex && !draggedItem )
+ p.drawWinFocusRect( pos.x(), pos.y() + 1, w, itemHeight - 2 );
+
+ pos.rx() += w;
+}
+
+void MenuBarEditor::drawSeparator( QPainter & p, QPoint & pos )
+{
+ p.save();
+ p.setPen( darkBlue );
+
+ int left = pos.x();
+ int top = pos.y() + 2;
+ int right = left + separatorWidth - 1;
+ int bottom = pos.y() + itemHeight - 4;
+
+ p.drawLine( left, top, left, bottom );
+ p.drawLine( right, top, right, bottom );
+
+ p.fillRect( left, pos.y() + borderSize() * 2,
+ separatorWidth - 1, itemHeight - borderSize() * 4,
+ QBrush( darkBlue, Qt::Dense5Pattern ) );
+
+ p.restore();
+}
+
+QSize MenuBarEditor::itemSize( MenuBarEditorItem * i )
+{
+ if ( i->isSeparator() )
+ return QSize( separatorWidth, itemHeight );
+ QRect r = fontMetrics().boundingRect( i->menuText().remove( "&") );
+ return QSize( r.width() + borderSize() * 2, r.height() + borderSize() * 4 );
+}
+
+void MenuBarEditor::addItemSizeToCoords( MenuBarEditorItem * i, int & x, int & y, int w )
+{
+ int dx = itemSize( i ).width();
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ x += dx;
+}
+
+QPoint MenuBarEditor::itemPos( int index )
+{
+ int x = borderSize();
+ int y = 0;
+ int w = width();
+ int dx = 0;
+ int c = 0;
+
+ MenuBarEditorItem * i = itemList.first();
+
+ while ( i ) {
+ if ( i->isVisible() ) {
+ dx = itemSize( i ).width();
+ if ( x + dx > w && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( c == index )
+ return QPoint( x, y );
+ x += dx;
+ c++;
+ }
+ i = itemList.next();
+ }
+ dx = itemSize( &addItem ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+
+ return QPoint( x, y );
+}
+
+QPoint MenuBarEditor::snapToItem( const QPoint & pos )
+{
+ int x = borderSize();
+ int y = 0;
+ int dx = 0;
+
+ MenuBarEditorItem * n = itemList.first();
+
+ while ( n ) {
+ if ( n->isVisible() ) {
+ dx = itemSize( n ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( pos.y() > y &&
+ pos.y() < y + itemHeight &&
+ pos.x() < x + dx / 2 ) {
+ return QPoint( x, y );
+ }
+ x += dx;
+ }
+ n = itemList.next();
+ }
+
+ return QPoint( x, y );
+}
+
+void MenuBarEditor::dropInPlace( MenuBarEditorItem * i, const QPoint & pos )
+{
+ int x = borderSize();
+ int y = 0;
+ int dx = 0;
+ int idx = 0;
+
+ MenuBarEditorItem * n = itemList.first();
+
+ while ( n ) {
+ if ( n->isVisible() ) {
+ dx = itemSize( n ).width();
+ if ( x + dx > width() && x > borderSize() ) {
+ y += itemHeight;
+ x = borderSize();
+ }
+ if ( pos.y() > y &&
+ pos.y() < y + itemHeight &&
+ pos.x() < x + dx / 2 )
+ break;
+ x += dx;
+ }
+ n = itemList.next();
+ idx++;
+ }
+
+ hideItem();
+ Command * cmd = 0;
+ int iidx = itemList.findRef( i );
+ if ( iidx != -1 ) { // internal dnd
+ cmd = new MoveMenuCommand( i18n( "Item Dragged" ), formWnd, this, iidx, idx );
+ item( iidx )->setVisible( TRUE );
+ } else {
+ cmd = new AddMenuCommand( i18n( "Add Menu" ), formWnd, this, i, idx );
+ dropConfirmed = TRUE; // let mouseMoveEvent set the item visible
+ }
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ currentIndex = ( iidx >= 0 && iidx < idx ) ? idx - 1 : idx;
+ showItem();
+}
+
+
+void MenuBarEditor::safeDec()
+{
+ do {
+ currentIndex--;
+ } while ( currentIndex > 0 && !( item( currentIndex )->isVisible() ) );
+}
+
+void MenuBarEditor::safeInc()
+{
+ int max = (int)itemList.count();
+ if ( !hasSeparator )
+ max += 1;
+ if ( currentIndex < max ) {
+ do {
+ currentIndex++;
+ // skip invisible items
+ } while ( currentIndex < max && !( item( currentIndex )->isVisible() ) );
+ }
+}
+
+void MenuBarEditor::navigateLeft( bool ctrl )
+{
+ // FIXME: handle invisible items
+ if ( currentIndex > 0 ) {
+ hideItem();
+ if ( ctrl ) {
+ ExchangeMenuCommand * cmd = new ExchangeMenuCommand( i18n( "Move Menu Left" ),
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex - 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeDec();
+ } else {
+ safeDec();
+ }
+ showItem();
+ }
+ update();
+}
+
+void MenuBarEditor::navigateRight( bool ctrl )
+{
+// FIXME: handle invisible items
+ hideItem();
+ if ( ctrl ) {
+ if ( currentIndex < ( (int)itemList.count() - 1 ) ) {
+ ExchangeMenuCommand * cmd = new ExchangeMenuCommand( i18n( "Move Menu Right" ),
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex + 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeInc();
+ }
+ } else {
+ safeInc();
+ }
+ showItem();
+ update();
+}
+
+void MenuBarEditor::enterEditMode()
+{
+ if ( currentIndex > (int)itemList.count() ) {
+ insertSeparator();
+ } else {
+ showLineEdit();
+ }
+}
+
+void MenuBarEditor::leaveEditMode()
+{
+ MenuBarEditorItem * i = 0;
+ if ( currentIndex >= (int)itemList.count() ) {
+ i = createItem();
+ // do not put rename on cmd stack
+ RenameMenuCommand rename( i18n( "Rename Menu" ), formWnd, this, lineEdit->text(), i );
+ rename.execute();
+ } else {
+ i = itemList.at( currentIndex );
+ RenameMenuCommand * cmd =
+ new RenameMenuCommand( i18n( "Rename Menu" ), formWnd, this, lineEdit->text(), i );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ showItem();
+}
+
+QPixmap MenuBarEditor::createTextPixmap( const QString &text )
+{
+ QSize sz( fontMetrics().boundingRect( text ).size() );
+ QPixmap pix( sz.width() + 20, sz.height() * 2 );
+ pix.fill( white );
+ QPainter p( &pix, this );
+ p.drawText( 2, 0, pix.width(), pix.height(), 0, text );
+ p.end();
+ QBitmap bm( pix.size() );
+ bm.fill( color0 );
+ p.begin( &bm );
+ p.setPen( color1 );
+ p.drawText( 2, 0, pix.width(), pix.height(), 0, text );
+ p.end();
+ pix.setMask( bm );
+ return pix;
+}
diff --git a/kdevdesigner/designer/menubareditor.h b/kdevdesigner/designer/menubareditor.h
new file mode 100644
index 00000000..c8dc2b63
--- /dev/null
+++ b/kdevdesigner/designer/menubareditor.h
@@ -0,0 +1,198 @@
+/**********************************************************************
+** Copyright (C) 2003 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef MENUBAREDITOR_H
+#define MENUBAREDITOR_H
+
+#include <qmenubar.h>
+#include <qptrlist.h>
+
+class PopupMenuEditor;
+class MenuBarEditor;
+class QActionGroup;
+
+class MenuBarEditorItem : public QObject
+{
+ Q_OBJECT
+
+ friend class MenuBarEditor;
+
+ MenuBarEditorItem( MenuBarEditor * bar = 0, QObject * parent = 0, const char * name = 0 );
+
+public:
+ MenuBarEditorItem( PopupMenuEditor * menu, MenuBarEditor * bar,
+ QObject * parent = 0, const char * name = 0);
+ MenuBarEditorItem( QActionGroup * actionGroup, MenuBarEditor * bar,
+ QObject * parent = 0, const char * name = 0);
+ MenuBarEditorItem( MenuBarEditorItem * item,
+ QObject * parent = 0, const char * name = 0);
+ ~MenuBarEditorItem() { };
+
+ PopupMenuEditor * menu() { return popupMenu; }
+
+ void setMenuText( const QString t ) { text = t; };
+ QString menuText() { return text; }
+
+ void setVisible( bool enable ) { visible = enable; }
+ bool isVisible() { return visible; }
+
+ void setRemovable( bool enable ) { removable = enable; }
+ bool isRemovable() { return removable; }
+
+ bool isSeparator() { return separator; }
+protected:
+ void setSeparator( bool enable ) { separator = enable; }
+
+private:
+ MenuBarEditor * menuBar;
+ PopupMenuEditor * popupMenu;
+ QString text;
+ uint visible : 1;
+ uint separator : 1;
+ uint removable : 1;
+};
+
+class QLineEdit;
+class FormWindow;
+
+class MenuBarEditor : public QMenuBar
+{
+ Q_OBJECT
+
+public:
+ MenuBarEditor( FormWindow * fw, QWidget * parent = 0, const char * name = 0 );
+ ~MenuBarEditor();
+
+ FormWindow * formWindow();
+
+ MenuBarEditorItem * createItem( int index = -1, bool addToCmdStack = TRUE );
+ void insertItem( MenuBarEditorItem * item, int index = -1 );
+ void insertItem( QString text, PopupMenuEditor * menu, int index = -1 );
+ void insertItem( QString text, QActionGroup * group, int index = -1 );
+
+ void insertSeparator( int index = -1 );
+
+ void removeItemAt( int index );
+ void removeItem( MenuBarEditorItem * item );
+
+ int findItem( MenuBarEditorItem * item );
+ int findItem( PopupMenuEditor * menu );
+ int findItem( QPoint & pos );
+
+ MenuBarEditorItem * item( int index = -1 );
+
+ int count();
+ int current();
+
+ void cut( int index );
+ void copy( int index );
+ void paste( int index );
+ void exchange( int a, int b );
+
+ void showLineEdit( int index = -1);
+ void showItem( int index = -1 );
+ void hideItem( int index = -1 );
+ void focusItem( int index = -1 );
+ void deleteItem( int index = -1 );
+
+ QSize sizeHint() const;
+ QSize minimumSize() const { return sizeHint(); }
+ QSize minimumSizeHint() const { return sizeHint(); }
+ int heightForWidth( int max_width ) const;
+
+ void show();
+
+ void checkAccels( QMap<QChar, QWidgetList > &accels );
+
+public slots:
+ void cut();
+ void copy();
+ void paste();
+
+protected:
+ bool eventFilter( QObject * o, QEvent * e );
+ void paintEvent( QPaintEvent * e );
+ void mousePressEvent( QMouseEvent * e );
+ void mouseDoubleClickEvent( QMouseEvent * e );
+ void mouseMoveEvent( QMouseEvent * e );
+ void dragEnterEvent( QDragEnterEvent * e );
+ void dragLeaveEvent( QDragLeaveEvent * e );
+ void dragMoveEvent( QDragMoveEvent * e );
+ void dropEvent( QDropEvent * e );
+ void keyPressEvent( QKeyEvent * e );
+ void focusOutEvent( QFocusEvent * e );
+ void resizeEvent( QResizeEvent * e ) { QFrame::resizeEvent( e ); }
+
+ void resizeInternals();
+
+ void drawItems( QPainter & p );
+ void drawItem( QPainter & p, MenuBarEditorItem * i, int idx, QPoint & pos );
+ void drawSeparator( QPainter & p, QPoint & pos );
+
+ QSize itemSize( MenuBarEditorItem * i );
+ void addItemSizeToCoords( MenuBarEditorItem * i, int & x, int & y, int w );
+
+ QPoint itemPos( int index );
+ QPoint snapToItem( const QPoint & pos );
+ void dropInPlace( MenuBarEditorItem * i, const QPoint & pos );
+
+ void safeDec();
+ void safeInc();
+
+ void navigateLeft( bool ctrl );
+ void navigateRight( bool ctrl );
+ void enterEditMode();
+ void leaveEditMode();
+
+ QPixmap createTextPixmap( const QString &text );
+ int borderSize() const { return margin() + 4; } // add 4 pixels to the margin
+
+private:
+ FormWindow * formWnd;
+ QLineEdit * lineEdit;
+ QWidget * dropLine;
+ QPtrList<MenuBarEditorItem> itemList;
+ MenuBarEditorItem addItem;
+ MenuBarEditorItem addSeparator;
+ MenuBarEditorItem * draggedItem;
+ QPoint mousePressPos;
+ int currentIndex;
+ int itemHeight;
+ int separatorWidth;
+ bool hideWhenEmpty;
+ bool hasSeparator;
+ bool dropConfirmed;
+
+ enum ClipboardOperation {
+ None = 0,
+ Cut = 1,
+ Copy = 2
+ };
+ static int clipboardOperation;
+ static MenuBarEditorItem * clipboardItem;
+};
+
+#endif //MENUBAREDITOR_H
diff --git a/kdevdesigner/designer/metadatabase.cpp b/kdevdesigner/designer/metadatabase.cpp
new file mode 100644
index 00000000..3a97b680
--- /dev/null
+++ b/kdevdesigner/designer/metadatabase.cpp
@@ -0,0 +1,1692 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "metadatabase.h"
+#include "widgetfactory.h"
+#include "formwindow.h"
+#include "parser.h"
+#include "widgetdatabase.h"
+#include "formfile.h"
+#include "propertyobject.h"
+#include "project.h"
+#include "mainwindow.h"
+
+#include "kdevdesigner_part.h"
+
+#include <kiconloader.h>
+#include <kapplication.h>
+#include <kstandarddirs.h>
+
+#include <qapplication.h>
+#include <qobject.h>
+#include <qlayout.h>
+#include <qptrdict.h>
+#include <qobjectlist.h>
+#include <qstrlist.h>
+#include <qmetaobject.h>
+#include <qwidgetlist.h>
+#include <qmainwindow.h>
+#include <qregexp.h>
+#include <private/qpluginmanager_p.h>
+#include <qdatetime.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+
+#include <stdlib.h>
+
+class MetaDataBaseRecord
+{
+public:
+ QObject *object;
+ QStringList changedProperties;
+ QMap<QString,QVariant> fakeProperties;
+ QMap<QString, QString> propertyComments;
+ int spacing, margin;
+ QString resizeMode;
+ QValueList<MetaDataBase::Connection> connections;
+ QValueList<MetaDataBase::Function> functionList;
+ QValueList<MetaDataBase::Include> includes;
+ QValueList<MetaDataBase::Variable> variables;
+ QStringList forwards, sigs;
+ QWidgetList tabOrder;
+ MetaDataBase::MetaInfo metaInfo;
+ QCursor cursor;
+ QMap<int, QString> pixmapArguments;
+ QMap<int, QString> pixmapKeys;
+ QMap<QString, QString> columnFields;
+ QValueList<uint> breakPoints;
+ QMap<int, QString> breakPointConditions;
+ QString exportMacro;
+};
+
+static QPtrDict<MetaDataBaseRecord> *db = 0;
+static QPtrList<MetaDataBase::CustomWidget> *cWidgets = 0;
+static bool doUpdate = TRUE;
+static QStringList langList;
+static QStringList editorLangList;
+static QPluginManager<LanguageInterface> *languageInterfaceManager = 0;
+
+/*!
+ \class MetaDataBase metadatabase.h
+ \brief Database which stores meta data of widgets
+
+ The MetaDataBase stores meta information of widgets, which are not
+ stored directly in widgets (properties). This is e.g. the
+ information which properties have been modified.
+*/
+
+MetaDataBase::MetaDataBase()
+{
+}
+
+inline void setupDataBase()
+{
+ if ( !db || !cWidgets ) {
+ db = new QPtrDict<MetaDataBaseRecord>( 1481 );
+ db->setAutoDelete( TRUE );
+ cWidgets = new QPtrList<MetaDataBase::CustomWidget>;
+ cWidgets->setAutoDelete( TRUE );
+ }
+}
+
+void MetaDataBase::clearDataBase()
+{
+ delete db;
+ db = 0;
+ delete cWidgets;
+ cWidgets = 0;
+}
+
+void MetaDataBase::addEntry( QObject *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( db->find( o ) )
+ return;
+ MetaDataBaseRecord *r = new MetaDataBaseRecord;
+ r->object = o;
+ r->spacing = r->margin = -1;
+ db->insert( (void*)o, r );
+
+ WidgetFactory::initChangedProperties( o );
+}
+
+void MetaDataBase::removeEntry( QObject *o )
+{
+ setupDataBase();
+ db->remove( o );
+}
+
+void MetaDataBase::setPropertyChanged( QObject *o, const QString &property, bool changed )
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdPropertyChanged( property, changed );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ if ( changed ) {
+ if ( r->changedProperties.findIndex( property ) == -1 )
+ r->changedProperties.append( property );
+ } else {
+ if ( r->changedProperties.findIndex( property ) != -1 )
+ r->changedProperties.remove( property );
+ }
+
+ if ( doUpdate &&
+ ( property == "hAlign" || property == "vAlign" || property == "wordwrap" ) ) {
+ doUpdate = FALSE;
+ setPropertyChanged( o, "alignment", changed ||
+ isPropertyChanged( o, "hAlign" ) ||
+ isPropertyChanged( o, "vAlign" ) ||
+ isPropertyChanged( o, "wordwrap" ) );
+ doUpdate = TRUE;
+ }
+
+ if ( doUpdate && property == "alignment" ) {
+ doUpdate = FALSE;
+ setPropertyChanged( o, "hAlign", changed );
+ setPropertyChanged( o, "vAlign", changed );
+ setPropertyChanged( o, "wordwrap", changed );
+ doUpdate = TRUE;
+ }
+}
+
+bool MetaDataBase::isPropertyChanged( QObject *o, const QString &property )
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdIsPropertyChanged( property );
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ return r->changedProperties.findIndex( property ) != -1;
+}
+
+QStringList MetaDataBase::changedProperties( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QStringList();
+ }
+
+ QStringList lst( r->changedProperties );
+ return lst;
+}
+
+void MetaDataBase::setPropertyComment( QObject *o, const QString &property, const QString &comment )
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetPropertyComment( property, comment );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->propertyComments.insert( property, comment );
+}
+
+QString MetaDataBase::propertyComment( QObject *o, const QString &property )
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdPropertyComment( property );
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+
+ return *r->propertyComments.find( property );
+}
+
+void MetaDataBase::setFakeProperty( QObject *o, const QString &property, const QVariant& value )
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetFakeProperty( property, value );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ r->fakeProperties[property] = value;
+}
+
+QVariant MetaDataBase::fakeProperty( QObject * o, const QString &property)
+{
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdFakeProperty( property );
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QVariant();
+ }
+ QMap<QString, QVariant>::Iterator it = r->fakeProperties.find( property );
+ if ( it != r->fakeProperties.end() )
+ return r->fakeProperties[property];
+ return WidgetFactory::defaultValue( o, property );
+
+}
+
+QMap<QString,QVariant>* MetaDataBase::fakeProperties( QObject* o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return 0;
+ }
+ return &r->fakeProperties;
+}
+
+void MetaDataBase::setSpacing( QObject *o, int spacing )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->spacing = spacing;
+ QLayout * layout = 0;
+ WidgetFactory::layoutType( (QWidget*)o, layout );
+ if ( layout ) {
+ int spadef = 6;
+ if ( MainWindow::self->formWindow() )
+ spadef = MainWindow::self->formWindow()->layoutDefaultSpacing();
+ if ( spacing == -1 )
+ layout->setSpacing( spadef );
+ else
+ layout->setSpacing( spacing );
+ }
+}
+
+int MetaDataBase::spacing( QObject *o )
+{
+ if ( !o )
+ return -1;
+ setupDataBase();
+ if ( ::qt_cast<QMainWindow*>(o) )
+ o = ( (QMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return -1;
+ }
+
+ return r->spacing;
+}
+
+void MetaDataBase::setMargin( QObject *o, int margin )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->margin = margin;
+ QLayout * layout = 0;
+ WidgetFactory::layoutType( (QWidget*)o, layout );
+
+ bool isInnerLayout = TRUE;
+
+ QWidget *widget = (QWidget*)o;
+ if ( widget && !::qt_cast<QLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
+ widget && widget->parentWidget() && ::qt_cast<FormWindow*>(widget->parentWidget()) ) )
+ isInnerLayout = FALSE;
+
+
+ if ( layout ) {
+ int mardef = 11;
+ if ( MainWindow::self->formWindow() )
+ mardef = MainWindow::self->formWindow()->layoutDefaultMargin();
+ if ( margin == -1 ) {
+ if ( isInnerLayout )
+ layout->setMargin( 1 );
+ else
+ layout->setMargin( QMAX( 1, mardef ) );
+ }
+ else
+ layout->setMargin( QMAX( 1, margin ) );
+ }
+}
+
+int MetaDataBase::margin( QObject *o )
+{
+ if ( !o )
+ return -1;
+ setupDataBase();
+ if ( ::qt_cast<QMainWindow*>(o) )
+ o = ( (QMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return -1;
+ }
+ return r->margin;
+}
+
+void MetaDataBase::setResizeMode( QObject *o, const QString &mode )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->resizeMode = mode;
+}
+
+QString MetaDataBase::resizeMode( QObject *o )
+{
+ if ( !o )
+ return QString::null;
+ setupDataBase();
+ if ( ::qt_cast<QMainWindow*>(o) )
+ o = ( (QMainWindow*)o )->centralWidget();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r || !o->isWidgetType() ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+ return r->resizeMode;
+}
+
+void MetaDataBase::addConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot, bool addCode )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ if ( !(sender && receiver) )
+ return;
+ Connection conn;
+ conn.sender = sender;
+ conn.signal = signal;
+ conn.receiver = receiver;
+ conn.slot = slot;
+ r->connections.append( conn );
+ if ( addCode ) {
+ QString rec = receiver->name();
+ if ( ::qt_cast<FormWindow*>(o) && receiver == ( (FormWindow*)o )->mainContainer() )
+ rec = "this";
+ QString sen = sender->name();
+ if ( ::qt_cast<FormWindow*>(o) && sender == ( (FormWindow*)o )->mainContainer() )
+ sen = "this";
+ FormFile *ff = 0;
+ if ( ::qt_cast<FormFile*>(o) )
+ ff = (FormFile*)o;
+ else if ( ::qt_cast<FormWindow*>(o) )
+ ff = ( (FormWindow*)o )->formFile();
+ ff->addConnection( sen, signal, rec, slot );
+ }
+}
+
+void MetaDataBase::removeConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ if ( !(sender && receiver) )
+ return;
+ for ( QValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( conn.sender == sender &&
+ conn.signal == signal &&
+ conn.receiver == receiver &&
+ conn.slot == slot ) {
+ r->connections.remove( it );
+ break;
+ }
+ }
+ if ( ::qt_cast<FormWindow*>(o) ) {
+ QString rec = receiver->name();
+ if ( receiver == ( (FormWindow*)o )->mainContainer() )
+ rec = "this";
+ ( (FormWindow*)o )->formFile()->removeConnection( sender->name(), signal, rec, slot );
+ }
+}
+
+void MetaDataBase::setupConnections( QObject *o, const QValueList<LanguageInterface::Connection> &conns )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ if ( !::qt_cast<FormFile*>(o) )
+ return;
+
+ FormFile *formfile = (FormFile*)o;
+
+ r->connections.clear();
+
+ for ( QValueList<LanguageInterface::Connection>::ConstIterator cit = conns.begin();
+ cit != conns.end(); ++cit ) {
+ // #### get the correct sender object out of Bla.Blub.sender
+ QString senderName = (*cit).sender;
+ if ( senderName.find( '.' ) != -1 )
+ senderName = senderName.mid( senderName.findRev( '.' ) + 1 );
+ QObject *sender = 0;
+ if ( formfile->formWindow() )
+ sender = formfile->formWindow()->child( senderName );
+ if ( !sender && formfile->isFake() )
+ sender = formfile->project()->objectForFakeFormFile( formfile );
+ if ( !sender && senderName == "this" )
+ sender = formfile->formWindow() ?
+ formfile->formWindow()->mainContainer() :
+ formfile->project()->objectForFakeFormFile( formfile );
+ if ( !sender )
+ continue;
+ MetaDataBase::addConnection( formfile->formWindow() ?
+ (QObject*)formfile->formWindow() :
+ (QObject*)formfile,
+ sender,
+ (*cit).signal.latin1(),
+ formfile->formWindow() ?
+ formfile->formWindow()->mainContainer() :
+ formfile->project()->objectForFakeFormFile( formfile ),
+ (*cit).slot.latin1(),
+ FALSE );
+ }
+}
+
+bool MetaDataBase::hasConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ for ( QValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( conn.sender == sender &&
+ conn.signal == signal &&
+ conn.receiver == receiver &&
+ conn.slot == slot )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+QValueList<MetaDataBase::Connection> MetaDataBase::connections( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Connection>();
+ }
+ return r->connections;
+}
+
+QValueList<MetaDataBase::Connection> MetaDataBase::connections( QObject *o, QObject *sender,
+ QObject *receiver )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Connection>();
+ }
+ QValueList<Connection>::Iterator it = r->connections.begin();
+ QValueList<Connection> ret;
+ QValueList<Connection>::Iterator conn;
+ while ( ( conn = it ) != r->connections.end() ) {
+ ++it;
+ if ( (*conn).sender == sender &&
+ (*conn).receiver == receiver )
+ ret << *conn;
+ }
+
+ return ret;
+}
+
+QValueList<MetaDataBase::Connection> MetaDataBase::connections( QObject *o, QObject *object )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Connection>();
+ }
+ QValueList<Connection>::Iterator it = r->connections.begin();
+ QValueList<Connection> ret;
+ QValueList<Connection>::Iterator conn;
+ while ( ( conn = it ) != r->connections.end() ) {
+ ++it;
+ if ( (*conn).sender == object ||
+ (*conn).receiver == object )
+ ret << *conn;
+ }
+ return ret;
+}
+
+void MetaDataBase::doConnections( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ QObject *sender = 0, *receiver = 0;
+ QObjectList *l = 0;
+ QValueList<Connection>::Iterator it = r->connections.begin();
+ for ( ; it != r->connections.end(); ++it ) {
+ Connection conn = *it;
+ if ( qstrcmp( conn.sender->name(), o->name() ) == 0 ) {
+ sender = o;
+ } else {
+ l = o->queryList( 0, conn.sender->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ continue;
+ }
+ sender = l->first();
+ delete l;
+ }
+ if ( qstrcmp( conn.receiver->name(), o->name() ) == 0 ) {
+ receiver = o;
+ } else {
+ l = o->queryList( 0, conn.receiver->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ continue;
+ }
+ receiver = l->first();
+ delete l;
+ }
+ QString s = "2""%1";
+ s = s.arg( conn.signal );
+ QString s2 = "1""%1";
+ s2 = s2.arg( conn.slot );
+
+ QStrList signalList = sender->metaObject()->signalNames( TRUE );
+ QStrList slotList = receiver->metaObject()->slotNames( TRUE );
+
+ // avoid warnings
+ if ( signalList.find( conn.signal ) == -1 ||
+ slotList.find( conn.slot ) == -1 )
+ continue;
+
+ QObject::connect( sender, s, receiver, s2 );
+ }
+}
+
+bool MetaDataBase::hasSlot( QObject *o, const QCString &slot, bool onlyCustom )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ if ( !onlyCustom ) {
+ QStrList slotList = o->metaObject()->slotNames( TRUE );
+ if ( slotList.find( slot ) != -1 )
+ return TRUE;
+
+ if ( ::qt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ slotList = o->metaObject()->slotNames( TRUE );
+ if ( slotList.find( slot ) != -1 )
+ return TRUE;
+ }
+
+ //if ( ::qt_cast<CustomWidget*>(o) ) {
+ if ( o->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
+ for ( QValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
+ QCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ if ( s == slot )
+ return TRUE;
+ }
+ }
+ }
+
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( slot ) && f.type == "slot" )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool MetaDataBase::isSlotUsed( QObject *o, const QCString &slot )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ QValueList<Connection> conns = connections( o );
+ for ( QValueList<Connection>::Iterator it = conns.begin(); it != conns.end(); ++it ) {
+ if ( (*it).slot == slot )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+void MetaDataBase::addFunction( QObject *o, const QCString &function, const QString &specifier,
+ const QString &access, const QString &type, const QString &language,
+ const QString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ Function f;
+ f.function = function;
+ f.specifier = specifier;
+ f.access = access;
+ f.type = type;
+ f.language = language;
+ f.returnType = returnType;
+ QValueList<MetaDataBase::Function>::Iterator it = r->functionList.find( f );
+ if ( it != r->functionList.end() )
+ r->functionList.remove( it );
+ r->functionList.append( f );
+ ( (FormWindow*)o )->formFile()->addFunctionCode( f );
+}
+
+void MetaDataBase::setFunctionList( QObject *o, const QValueList<Function> &functionList )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ r->functionList = functionList;
+}
+
+void MetaDataBase::removeFunction( QObject *o, const QCString &function, const QString &specifier,
+ const QString &access, const QString &type, const QString &language,
+ const QString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( MetaDataBase::normalizeFunction( (*it).function ) ==
+ MetaDataBase::normalizeFunction( function ) &&
+ (*it).specifier == specifier &&
+ (*it).access == access &&
+ (*it).type == type &&
+ ( language.isEmpty() || (*it).language == language ) &&
+ ( returnType.isEmpty() || (*it).returnType == returnType ) ) {
+ ( (FormWindow*)o )->formFile()->removeFunctionCode( *it );
+ r->functionList.remove( it );
+ break;
+ }
+ }
+}
+
+void MetaDataBase::removeFunction( QObject *o, const QString &function )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( normalizeFunction( (*it).function ) == normalizeFunction( function ) ) {
+ ( (FormWindow*)o )->formFile()->removeFunctionCode( *it );
+ r->functionList.remove( it );
+ break;
+ }
+ }
+}
+
+QValueList<MetaDataBase::Function> MetaDataBase::functionList( QObject *o, bool onlyFunctions )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Function>();
+ }
+ if ( !onlyFunctions )
+ return r->functionList;
+ QValueList<Function> fList;
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( (*it).type == "function" )
+ fList.append( *it );
+ }
+ return fList;
+}
+
+QValueList<MetaDataBase::Function> MetaDataBase::slotList( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Function>();
+ }
+ QValueList<Function> slotList;
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( (*it).type == "slot" )
+ slotList.append( *it );
+ }
+ return slotList;
+}
+
+void MetaDataBase::changeFunction( QObject *o, const QString &function, const QString &newName,
+ const QString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( function ) ) {
+ (*it).function = newName;
+ if ( !returnType.isNull() )
+ (*it).returnType = returnType;
+ return;
+ }
+ }
+}
+
+void MetaDataBase::changeFunctionAttributes( QObject *o, const QString &oldName, const QString &newName,
+ const QString &specifier, const QString &access,
+ const QString &type, const QString &language,
+ const QString &returnType )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( oldName ) ) {
+ (*it).function = newName;
+ (*it).specifier = specifier;
+ (*it).access = access;
+ (*it).type = type;
+ (*it).language = language;
+ (*it).returnType = returnType;
+ return;
+ }
+ }
+}
+
+bool MetaDataBase::hasFunction( QObject *o, const QCString &function, bool onlyCustom )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ if ( !onlyCustom ) {
+ QStrList functionList = o->metaObject()->slotNames( TRUE );
+ if ( functionList.find( function ) != -1 )
+ return TRUE;
+
+ if ( ::qt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ functionList = o->metaObject()->slotNames( TRUE );
+ if ( functionList.find( function ) != -1 )
+ return TRUE;
+ }
+
+ //if ( ::qt_cast<CustomWidget*>(o) ) {
+ if ( o->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
+ for ( QValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
+ QCString s = (*it).function;
+ if ( !s.data() )
+ continue;
+ if ( s == function )
+ return TRUE;
+ }
+ }
+ }
+
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ Function f = *it;
+ if ( normalizeFunction( f.function ) == normalizeFunction( function ) )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+QString MetaDataBase::languageOfFunction( QObject *o, const QCString &function )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+
+ QString fu = normalizeFunction( function );
+ for ( QValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
+ if ( fu == normalizeFunction( (*it).function ) )
+ return (*it).language;
+ }
+ return QString::null;
+}
+
+bool MetaDataBase::addCustomWidget( CustomWidget *wid )
+{
+ setupDataBase();
+
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( *wid == *w ) {
+ for ( QValueList<QCString>::ConstIterator it = wid->lstSignals.begin(); it != wid->lstSignals.end(); ++it ) {
+ if ( !w->hasSignal( *it ) )
+ w->lstSignals.append( *it );
+ }
+ for ( QValueList<Function>::ConstIterator it2 = wid->lstSlots.begin(); it2 != wid->lstSlots.end(); ++it2 ) {
+ if ( !w->hasSlot( MetaDataBase::normalizeFunction( (*it2).function ).latin1() ) )
+ w->lstSlots.append( *it2 );
+ }
+ for ( QValueList<Property>::ConstIterator it3 = wid->lstProperties.begin(); it3 != wid->lstProperties.end(); ++it3 ) {
+ if ( !w->hasProperty( (*it3).property ) )
+ w->lstProperties.append( *it3 );
+ }
+ delete wid;
+ return FALSE;
+ }
+ }
+
+
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ r->name = wid->className;
+ r->group = WidgetDatabase::widgetGroup( "Custom" );
+ r->toolTip = wid->className;
+ r->icon = new QIconSet( *wid->pixmap, *wid->pixmap );
+ r->isContainer = wid->isContainer;
+ wid->id = WidgetDatabase::addCustomWidget( r );
+ cWidgets->append( wid );
+ return TRUE;
+}
+
+void MetaDataBase::removeCustomWidget( CustomWidget *w )
+{
+ cWidgets->removeRef( w );
+}
+
+QPtrList<MetaDataBase::CustomWidget> *MetaDataBase::customWidgets()
+{
+ setupDataBase();
+ return cWidgets;
+}
+
+MetaDataBase::CustomWidget *MetaDataBase::customWidget( int id )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( id == w->id )
+ return w;
+ }
+ return 0;
+}
+
+bool MetaDataBase::isWidgetNameUsed( CustomWidget *wid )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( w == wid )
+ continue;
+ if ( wid->className == w->className )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::hasCustomWidget( const QString &className )
+{
+ for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
+ if ( w->className == className )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void MetaDataBase::setTabOrder( QWidget *w, const QWidgetList &order )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*) w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return;
+ }
+
+ r->tabOrder = order;
+}
+
+QWidgetList MetaDataBase::tabOrder( QWidget *w )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*) w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return QWidgetList();
+ }
+
+ return r->tabOrder;
+}
+
+void MetaDataBase::setIncludes( QObject *o, const QValueList<Include> &incs )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->includes = incs;
+}
+
+QValueList<MetaDataBase::Include> MetaDataBase::includes( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<Include>();
+ }
+
+ return r->includes;
+}
+
+void MetaDataBase::setForwards( QObject *o, const QStringList &fwds )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->forwards = fwds;
+}
+
+QStringList MetaDataBase::forwards( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QStringList();
+ }
+
+ return r->forwards;
+}
+
+void MetaDataBase::setVariables( QObject *o, const QValueList<Variable> &vars )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->variables = vars;
+}
+
+void MetaDataBase::addVariable( QObject *o, const QString &name, const QString &access )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ Variable v;
+ v.varName = name;
+ v.varAccess = access;
+ r->variables << v;
+}
+
+void MetaDataBase::removeVariable( QObject *o, const QString &name )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ QValueList<Variable>::Iterator it = r->variables.begin();
+ for ( ; it != r->variables.end(); ++it ) {
+ if ( (*it).varName == name ) {
+ r->variables.remove( it );
+ break;
+ }
+ }
+}
+
+QValueList<MetaDataBase::Variable> MetaDataBase::variables( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<MetaDataBase::Variable>();
+ }
+
+ return r->variables;
+}
+
+bool MetaDataBase::hasVariable( QObject *o, const QString &name )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return FALSE;
+ }
+
+ QValueList<Variable>::Iterator it = r->variables.begin();
+ for ( ; it != r->variables.end(); ++it ) {
+ if ( extractVariableName( name ) == extractVariableName( (*it).varName ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+QString MetaDataBase::extractVariableName( const QString &name )
+{
+ QString n = name.right( name.length() - name.findRev( ' ' ) - 1 );
+ if ( n[ 0 ] == '*' || n[ 0 ] == '&' )
+ n[ 0 ] = ' ';
+ if ( n[ (int)n.length() - 1 ] == ';' )
+ n[ (int)n.length() - 1 ] = ' ';
+ return n.simplifyWhiteSpace();
+}
+
+void MetaDataBase::setSignalList( QObject *o, const QStringList &sigs )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->sigs.clear();
+
+ for ( QStringList::ConstIterator it = sigs.begin(); it != sigs.end(); ++it ) {
+ QString s = (*it).simplifyWhiteSpace();
+ bool hasSemicolon = s.endsWith( ";" );
+ if ( hasSemicolon )
+ s = s.left( s.length() - 1 );
+ int p = s.find( '(' );
+ if ( p < 0 )
+ p = s.length();
+ int sp = s.find( ' ' );
+ if ( sp >= 0 && sp < p ) {
+ s = s.mid( sp+1 );
+ p -= sp + 1;
+ }
+ if ( p == (int) s.length() )
+ s += "()";
+ if ( hasSemicolon )
+ s += ";";
+ r->sigs << s;
+ }
+}
+
+QStringList MetaDataBase::signalList( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QStringList();
+ }
+
+ return r->sigs;
+}
+
+void MetaDataBase::setMetaInfo( QObject *o, MetaInfo mi )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->metaInfo = mi;
+}
+
+MetaDataBase::MetaInfo MetaDataBase::metaInfo( QObject *o )
+{
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return MetaInfo();
+ }
+
+ return r->metaInfo;
+}
+
+
+
+
+MetaDataBase::CustomWidget::CustomWidget()
+{
+ className = "MyCustomWidget";
+ includeFile = "mywidget.h";
+ includePolicy = Local;
+ sizeHint = QSize( -1, -1 );
+ pixmap = new QPixmap( BarIcon( "designer_customwidget.png", KDevDesignerPartFactory::instance() ) );
+ id = -1;
+ sizePolicy = QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+ isContainer = FALSE;
+}
+
+MetaDataBase::CustomWidget::CustomWidget( const CustomWidget &w )
+{
+ className = w.className;
+ includeFile = w.includeFile;
+ includePolicy = w.includePolicy;
+ sizeHint = w.sizeHint;
+ if ( w.pixmap )
+ pixmap = new QPixmap( *w.pixmap );
+ else
+ pixmap = 0;
+ id = w.id;
+ isContainer = w.isContainer;
+}
+
+void MetaDataBase::setCursor( QWidget *w, const QCursor &c )
+{
+ setupDataBase();
+ if ( w->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)w )->mdSetCursor( c );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)w );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ w, w->name(), w->className() );
+ return;
+ }
+
+ r->cursor = c;
+}
+
+QCursor MetaDataBase::cursor( QWidget *w )
+{
+ setupDataBase();
+ if ( w->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)w )->mdCursor();
+ MetaDataBaseRecord *r = db->find( (void*)w );
+ if ( !r ) {
+ w->unsetCursor();
+ return w->cursor();
+ }
+
+ return r->cursor;
+}
+
+bool MetaDataBase::CustomWidget::operator==( const CustomWidget &w ) const
+{
+ return className == w.className;
+}
+
+MetaDataBase::CustomWidget &MetaDataBase::CustomWidget::operator=( const CustomWidget &w )
+{
+ delete pixmap;
+ className = w.className;
+ includeFile = w.includeFile;
+ includePolicy = w.includePolicy;
+ sizeHint = w.sizeHint;
+ if ( w.pixmap )
+ pixmap = new QPixmap( *w.pixmap );
+ else
+ pixmap = 0;
+ lstSignals = w.lstSignals;
+ lstSlots = w.lstSlots;
+ lstProperties = w.lstProperties;
+ id = w.id;
+ isContainer = w.isContainer;
+ return *this;
+}
+
+bool MetaDataBase::CustomWidget::hasSignal( const QCString &signal ) const
+{
+ QStrList sigList = QWidget::staticMetaObject()->signalNames( TRUE );
+ if ( sigList.find( signal ) != -1 )
+ return TRUE;
+ for ( QValueList<QCString>::ConstIterator it = lstSignals.begin(); it != lstSignals.end(); ++it ) {
+ if ( normalizeFunction( *it ) == normalizeFunction( signal ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::CustomWidget::hasSlot( const QCString &slot ) const
+{
+ QStrList slotList = QWidget::staticMetaObject()->slotNames( TRUE );
+ if ( slotList.find( normalizeFunction( slot ) ) != -1 )
+ return TRUE;
+
+ for ( QValueList<MetaDataBase::Function>::ConstIterator it = lstSlots.begin(); it != lstSlots.end(); ++it ) {
+ if ( normalizeFunction( (*it).function ) == normalizeFunction( slot ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool MetaDataBase::CustomWidget::hasProperty( const QCString &prop ) const
+{
+ QStrList propList = QWidget::staticMetaObject()->propertyNames( TRUE );
+ if ( propList.find( prop ) != -1 )
+ return TRUE;
+
+ for ( QValueList<MetaDataBase::Property>::ConstIterator it = lstProperties.begin(); it != lstProperties.end(); ++it ) {
+ if ( (*it).property == prop )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void MetaDataBase::setPixmapArgument( QObject *o, int pixmap, const QString &arg )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->pixmapArguments.remove( pixmap );
+ r->pixmapArguments.insert( pixmap, arg );
+}
+
+QString MetaDataBase::pixmapArgument( QObject *o, int pixmap )
+{
+ if ( !o )
+ return QString::null;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+
+ return *r->pixmapArguments.find( pixmap );
+}
+
+void MetaDataBase::clearPixmapArguments( QObject *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->pixmapArguments.clear();
+}
+
+
+void MetaDataBase::setPixmapKey( QObject *o, int pixmap, const QString &arg )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetPixmapKey( pixmap, arg );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->pixmapKeys.remove( pixmap );
+ r->pixmapKeys.insert( pixmap, arg );
+}
+
+QString MetaDataBase::pixmapKey( QObject *o, int pixmap )
+{
+ if ( !o )
+ return QString::null;
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdPixmapKey( pixmap );
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+
+ QString s = *r->pixmapKeys.find( pixmap );
+ if ( !s.isNull() )
+ return s;
+ if ( !o->isWidgetType() )
+ return s;
+ QWidget *w = (QWidget*)o;
+ if ( w->icon() )
+ return *r->pixmapKeys.find( w->icon()->serialNumber() );
+ return s;
+}
+
+void MetaDataBase::clearPixmapKeys( QObject *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->pixmapKeys.clear();
+}
+
+
+
+void MetaDataBase::setColumnFields( QObject *o, const QMap<QString, QString> &columnFields )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->columnFields = columnFields;
+}
+
+QMap<QString, QString> MetaDataBase::columnFields( QObject *o )
+{
+ if ( !o )
+ return QMap<QString, QString>();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QMap<QString, QString>();
+ }
+
+ return r->columnFields;
+}
+
+void MetaDataBase::setEditor( const QStringList &langs )
+{
+ editorLangList = langs;
+}
+
+bool MetaDataBase::hasEditor( const QString &lang )
+{
+ return editorLangList.find( lang ) != editorLangList.end();
+}
+
+void MetaDataBase::setupInterfaceManagers( const QString &plugDir )
+{
+ if ( !languageInterfaceManager ) {
+ languageInterfaceManager =
+ new QPluginManager<LanguageInterface>( IID_Language,
+ QApplication::libraryPaths(),
+// kapp->dirs()->resourceDirs("qtplugins"),
+ plugDir );
+
+ langList = languageInterfaceManager->featureList();
+ langList.remove( "C++" );
+ langList << "C++";
+ }
+}
+
+QStringList MetaDataBase::languages()
+{
+ return langList;
+}
+
+QString MetaDataBase::normalizeFunction( const QString &f )
+{
+ return Parser::cleanArgs( f );
+}
+
+LanguageInterface *MetaDataBase::languageInterface( const QString &lang )
+{
+ LanguageInterface* iface = 0;
+ languageInterfaceManager->queryInterface( lang, &iface );
+ return iface;
+}
+
+void MetaDataBase::clear( QObject *o )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ db->remove( (void*)o );
+ for ( QPtrDictIterator<QWidget> it( *( (FormWindow*)o )->widgets() ); it.current(); ++it )
+ db->remove( (void*)it.current() );
+}
+
+void MetaDataBase::setBreakPoints( QObject *o, const QValueList<uint> &l )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->breakPoints = l;
+
+ QMap<int, QString>::Iterator it = r->breakPointConditions.begin();
+ while ( it != r->breakPointConditions.end() ) {
+ int line = it.key();
+ ++it;
+ if ( r->breakPoints.find( line ) == r->breakPoints.end() )
+ r->breakPointConditions.remove( r->breakPointConditions.find( line ) );
+ }
+}
+
+QValueList<uint> MetaDataBase::breakPoints( QObject *o )
+{
+ if ( !o )
+ return QValueList<uint>();
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QValueList<uint>();
+ }
+
+ return r->breakPoints;
+}
+
+void MetaDataBase::setBreakPointCondition( QObject *o, int line, const QString &condition )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+ r->breakPointConditions.replace( line, condition );
+}
+
+QString MetaDataBase::breakPointCondition( QObject *o, int line )
+{
+ if ( !o )
+ return QString::null;
+ setupDataBase();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return QString::null;
+ }
+ QMap<int, QString>::Iterator it = r->breakPointConditions.find( line );
+ if ( it == r->breakPointConditions.end() )
+ return QString::null;
+ return *it;
+}
+
+void MetaDataBase::setExportMacro( QObject *o, const QString &macro )
+{
+ if ( !o )
+ return;
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) ) {
+ ( (PropertyObject*)o )->mdSetExportMacro( macro );
+ return;
+ }
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return;
+ }
+
+ r->exportMacro = macro;
+}
+
+QString MetaDataBase::exportMacro( QObject *o )
+{
+ if ( !o )
+ return "";
+ setupDataBase();
+ if ( o->isA( "PropertyObject" ) )
+ return ( (PropertyObject*)o )->mdExportMacro();
+ MetaDataBaseRecord *r = db->find( (void*)o );
+ if ( !r ) {
+ qWarning( "No entry for %p (%s, %s) found in MetaDataBase",
+ o, o->name(), o->className() );
+ return "";
+ }
+
+ return r->exportMacro;
+}
+
+bool MetaDataBase::hasObject( QObject *o )
+{
+ return !!db->find( o );
+}
diff --git a/kdevdesigner/designer/metadatabase.h b/kdevdesigner/designer/metadatabase.h
new file mode 100644
index 00000000..f7ce5088
--- /dev/null
+++ b/kdevdesigner/designer/metadatabase.h
@@ -0,0 +1,269 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef METADATABASE_H
+#define METADATABASE_H
+
+#include <qvariant.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include <qptrlist.h>
+#include <qsizepolicy.h>
+#include <qsize.h>
+#include <qwidgetlist.h>
+#include <qcursor.h>
+
+#include "pixmapchooser.h"
+#include "../interfaces/languageinterface.h"
+
+class QObject;
+class QPixmap;
+struct LanguageInterface;
+
+class MetaDataBase
+{
+public:
+ struct Connection
+ {
+ QObject *sender, *receiver;
+ QCString signal, slot;
+ bool operator==( const Connection &c ) const {
+ return sender == c.sender && receiver == c.receiver &&
+ signal == c.signal && slot == c.slot ;
+ }
+ };
+
+ struct Function
+ {
+ QString returnType;
+ QCString function;
+ QString specifier;
+ QString access;
+ QString type;
+ QString language;
+ bool operator==( const Function &f ) const {
+ return ( returnType == f.returnType &&
+ function == f.function &&
+ specifier == f.specifier &&
+ access == f.access &&
+ type == f.type &&
+ language == f.language
+ );
+ }
+ };
+
+ struct Property
+ {
+ QCString property;
+ QString type;
+ bool operator==( const Property &p ) const {
+ return property == p.property &&
+ type == p.type;
+ }
+ };
+
+ struct CustomWidget
+ {
+ CustomWidget();
+ CustomWidget( const CustomWidget &w );
+ ~CustomWidget() { delete pixmap; } // inlined to work around 2.7.2.3 bug
+ bool operator==( const CustomWidget &w ) const;
+ CustomWidget &operator=( const CustomWidget &w );
+
+ bool hasSignal( const QCString &signal ) const;
+ bool hasSlot( const QCString &slot ) const;
+ bool hasProperty( const QCString &prop ) const;
+
+ enum IncludePolicy { Global, Local };
+ QString className;
+ QString includeFile;
+ IncludePolicy includePolicy;
+ QSize sizeHint;
+ QSizePolicy sizePolicy;
+ QPixmap *pixmap;
+ QValueList<QCString> lstSignals;
+ QValueList<Function> lstSlots;
+ QValueList<Property> lstProperties;
+ int id;
+ bool isContainer;
+ };
+
+ struct Include
+ {
+ Include() : header(), location(), implDecl( "in implementation" ) {}
+ QString header;
+ QString location;
+ bool operator==( const Include &i ) const {
+ return header == i.header && location == i.location;
+ }
+ QString implDecl;
+ };
+
+ struct Variable
+ {
+ QString varName;
+ QString varAccess;
+ bool operator==( const Variable &v ) const {
+ return varName == v.varName &&
+ varAccess == v.varAccess;
+ }
+ };
+
+ struct MetaInfo
+ {
+ MetaInfo() : classNameChanged( FALSE ) { }
+ QString className;
+ bool classNameChanged;
+ QString comment;
+ QString author;
+ };
+
+ MetaDataBase();
+ static void clearDataBase();
+
+ static void addEntry( QObject *o );
+ static void removeEntry( QObject *o );
+ static void setPropertyChanged( QObject *o, const QString &property, bool changed );
+ static bool isPropertyChanged( QObject *o, const QString &property );
+ static void setPropertyComment( QObject *o, const QString &property, const QString &comment );
+ static QString propertyComment( QObject *o, const QString &property );
+ static QStringList changedProperties( QObject *o );
+
+ static void setFakeProperty( QObject *o, const QString &property, const QVariant& value );
+ static QVariant fakeProperty( QObject * o, const QString &property );
+ static QMap<QString,QVariant>* fakeProperties( QObject* o );
+
+ static void setSpacing( QObject *o, int spacing );
+ static int spacing( QObject *o );
+ static void setMargin( QObject *o, int margin );
+ static int margin( QObject *o );
+
+ static void setResizeMode( QObject *o, const QString &mode );
+ static QString resizeMode( QObject *o );
+
+ static void addConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot, bool addCode = TRUE );
+ static void removeConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot );
+ static bool hasConnection( QObject *o, QObject *sender, const QCString &signal,
+ QObject *receiver, const QCString &slot );
+ static void setupConnections( QObject *o, const QValueList<LanguageInterface::Connection> &conns );
+ static QValueList<Connection> connections( QObject *o );
+ static QValueList<Connection> connections( QObject *o, QObject *sender, QObject *receiver );
+ static QValueList<Connection> connections( QObject *o, QObject *object );
+ static void doConnections( QObject *o );
+
+ static void addFunction( QObject *o, const QCString &function, const QString &specifier,
+ const QString &access, const QString &type, const QString &language,
+ const QString &returnType );
+ static void removeFunction( QObject *o, const QCString &function, const QString &specifier,
+ const QString &access, const QString &type, const QString &language,
+ const QString &returnType );
+ static void removeFunction( QObject *o, const QString &function );
+ static QValueList<Function> functionList( QObject *o, bool onlyFunctions = FALSE );
+ static QValueList<Function> slotList( QObject *o );
+ static bool isSlotUsed( QObject *o, const QCString &slot );
+ static bool hasFunction( QObject *o, const QCString &function, bool onlyCustom = FALSE );
+ static bool hasSlot( QObject *o, const QCString &slot, bool onlyCustom = FALSE );
+ static void changeFunction( QObject *o, const QString &function, const QString &newName,
+ const QString &returnType );
+ static void changeFunctionAttributes( QObject *o, const QString &oldName, const QString &newName,
+ const QString &specifier, const QString &access,
+ const QString &type, const QString &language,
+ const QString &returnType );
+ static QString languageOfFunction( QObject *o, const QCString &function );
+ static void setFunctionList( QObject *o, const QValueList<Function> &functionList );
+
+
+ static bool addCustomWidget( CustomWidget *w );
+ static void removeCustomWidget( CustomWidget *w );
+ static QPtrList<CustomWidget> *customWidgets();
+ static CustomWidget *customWidget( int id );
+ static bool isWidgetNameUsed( CustomWidget *w );
+ static bool hasCustomWidget( const QString &className );
+
+ static void setTabOrder( QWidget *w, const QWidgetList &order );
+ static QWidgetList tabOrder( QWidget *w );
+
+ static void setIncludes( QObject *o, const QValueList<Include> &incs );
+ static QValueList<Include> includes( QObject *o );
+
+ static void setForwards( QObject *o, const QStringList &fwds );
+ static QStringList forwards( QObject *o );
+
+ static void setVariables( QObject *o, const QValueList<Variable> &vars );
+ static void addVariable( QObject *o, const QString &name, const QString &access );
+ static void removeVariable( QObject *o, const QString &name );
+ static QValueList<Variable> variables( QObject *o );
+ static bool hasVariable( QObject *o, const QString &name );
+ static QString extractVariableName( const QString &name );
+
+ static void setSignalList( QObject *o, const QStringList &sigs );
+ static QStringList signalList( QObject *o );
+
+ static void setMetaInfo( QObject *o, MetaInfo mi );
+ static MetaInfo metaInfo( QObject *o );
+
+ static void setCursor( QWidget *w, const QCursor &c );
+ static QCursor cursor( QWidget *w );
+
+ static void setPixmapArgument( QObject *o, int pixmap, const QString &arg );
+ static QString pixmapArgument( QObject *o, int pixmap );
+ static void clearPixmapArguments( QObject *o );
+
+ static void setPixmapKey( QObject *o, int pixmap, const QString &arg );
+ static QString pixmapKey( QObject *o, int pixmap );
+ static void clearPixmapKeys( QObject *o );
+
+ static void setColumnFields( QObject *o, const QMap<QString, QString> &columnFields );
+ static QMap<QString, QString> columnFields( QObject *o );
+
+ static void setEditor( const QStringList &langs );
+ static bool hasEditor( const QString &lang );
+
+ static void setupInterfaceManagers( const QString &plugDir );
+ static QStringList languages();
+
+ static LanguageInterface *languageInterface( const QString &lang );
+
+ static QString normalizeFunction( const QString &f );
+
+ static void clear( QObject *o );
+
+ static void setBreakPoints( QObject *o, const QValueList<uint> &l );
+ static void setBreakPointCondition( QObject *o, int line, const QString &condition );
+ static QValueList<uint> breakPoints( QObject *o );
+ static QString breakPointCondition( QObject *o, int line );
+
+ static void setExportMacro( QObject *o, const QString &macro );
+ static QString exportMacro( QObject *o );
+
+ static bool hasObject( QObject *o );
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/multilineeditor.ui b/kdevdesigner/designer/multilineeditor.ui
new file mode 100644
index 00000000..3a28f795
--- /dev/null
+++ b/kdevdesigner/designer/multilineeditor.ui
@@ -0,0 +1,181 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>MultiLineEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QMainWindow">
+ <property name="name">
+ <cstring>MultiLineEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>598</width>
+ <height>307</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Text</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Multiline Edit&lt;/b&gt;&lt;p&gt;This is a simple richtext editor. To improve its usability it provides toolbar items for the most common html tags: by clicking on a toolbar item, the corresponding tag will be written to the editor, where you can insert your text. If you have already written some text and want to format it, hilight it and click on the desired button. To improve visualization this editor also supports a simple html-syntax-highlighting scheme.</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>OkButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="on">
+ <bool>false</bool>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>applyButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menuBar</cstring>
+ </property>
+</menubar>
+<toolbars>
+</toolbars>
+<connections>
+ <connection>
+ <sender>OkButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>applyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>MultiLineEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>applyClicked()</slot>
+ <slot>okClicked()</slot>
+ <slot>cancelClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/multilineeditorimpl.cpp b/kdevdesigner/designer/multilineeditorimpl.cpp
new file mode 100644
index 00000000..3d7f5afc
--- /dev/null
+++ b/kdevdesigner/designer/multilineeditorimpl.cpp
@@ -0,0 +1,415 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "multilineeditorimpl.h"
+#include "formwindow.h"
+#include "command.h"
+#include "mainwindow.h"
+#include "richtextfontdialog.h"
+#include "syntaxhighlighter_html.h"
+#include "widgetfactory.h"
+
+#include <kiconloader.h>
+#include "kdevdesigner_part.h"
+
+#include <qtextedit.h>
+#include <./private/qrichtext_p.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <qapplication.h>
+#include <qaction.h>
+#include <qmetaobject.h>
+
+#include <klocale.h>
+
+ToolBarItem::ToolBarItem( QWidget *parent, QWidget *toolBar,
+ const QString &label, const QString &tagstr,
+ const QIconSet &icon, const QKeySequence &key )
+ : QAction( parent )
+{
+ setIconSet( icon );
+ setText( label );
+ setAccel( key );
+ addTo( toolBar );
+ tag = tagstr;
+ connect( this, SIGNAL( activated() ), this, SLOT( wasActivated() ) );
+}
+
+ToolBarItem::~ToolBarItem()
+{
+
+}
+
+void ToolBarItem::wasActivated()
+{
+ emit clicked( tag );
+}
+
+TextEdit::TextEdit( QWidget *parent, const char *name )
+ : QTextEdit( parent, name )
+{
+ setTextFormat( Qt::PlainText );
+}
+
+QTextParagraph* TextEdit::paragraph()
+{
+ QTextCursor *tc = new QTextCursor( QTextEdit::document() );
+ return tc->paragraph();
+}
+
+
+MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, QWidget *parent, QWidget *editWidget,
+ FormWindow *fw, const QString &text )
+ : MultiLineEditorBase( parent, 0, WType_Dialog | WShowModal ), formwindow( fw ), doWrap( FALSE )
+{
+ callStatic = call_static;
+
+ if ( callStatic )
+ applyButton->hide();
+
+ textEdit = new TextEdit( centralWidget(), "textedit" );
+ Layout4->insertWidget( 0, textEdit );
+
+ if ( richtextMode ) {
+ QPopupMenu *stylesMenu = new QPopupMenu( this );
+ menuBar->insertItem( i18n( "&Styles" ), stylesMenu );
+
+ basicToolBar = new QToolBar( i18n( "Basics" ), this, DockTop );
+
+ ToolBarItem *it = new ToolBarItem( this, basicToolBar, i18n( "Italic" ),
+ "i", BarIcon( "designer_textitalic.png", KDevDesignerPartFactory::instance() ), CTRL+Key_I );
+ it->addTo( stylesMenu );
+ connect( it, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *b = new ToolBarItem( this, basicToolBar, i18n( "Bold" ),
+ "b", BarIcon( "designer_textbold.png", KDevDesignerPartFactory::instance() ), CTRL+Key_B );
+ b->addTo( stylesMenu );
+ connect( b, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *ul = new ToolBarItem( this, basicToolBar, i18n( "Underline" ),
+ "u", BarIcon( "designer_textunderline.png" , KDevDesignerPartFactory::instance()), CTRL+Key_U );
+ ul->addTo( stylesMenu );
+ connect( ul, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *tt = new ToolBarItem( this, basicToolBar, i18n( "Typewriter" ),
+ "tt", BarIcon( "designer_textteletext.png", KDevDesignerPartFactory::instance() ) );
+ tt->addTo( stylesMenu );
+ connect( tt, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ basicToolBar->addSeparator();
+
+ QPopupMenu *layoutMenu = new QPopupMenu( this );
+ menuBar->insertItem( i18n( "&Layout" ), layoutMenu );
+
+ QAction *brAction = new QAction( this );
+ brAction->setIconSet( BarIcon( "designer_textlinebreak.png", KDevDesignerPartFactory::instance() ) );
+ brAction->setText( i18n("Break" ) );
+ brAction->addTo( basicToolBar );
+ brAction->addTo( layoutMenu );
+ connect( brAction, SIGNAL( activated() ) , this, SLOT( insertBR() ) );
+
+ ToolBarItem *p = new ToolBarItem( this, basicToolBar, i18n( "Paragraph" ),
+ "p", BarIcon( "designer_textparagraph.png", KDevDesignerPartFactory::instance() ) );
+ p->addTo( layoutMenu );
+ connect( p, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+ layoutMenu->insertSeparator();
+ basicToolBar->addSeparator();
+
+ ToolBarItem *al = new ToolBarItem( this, basicToolBar, i18n( "Align left" ),
+ "p align=\"left\"", BarIcon( "designer_textleft.png", KDevDesignerPartFactory::instance() ) );
+ al->addTo( layoutMenu );
+ connect( al, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *ac = new ToolBarItem( this, basicToolBar, i18n( "Align center" ),
+ "p align=\"center\"", BarIcon( "designer_textcenter.png", KDevDesignerPartFactory::instance() ) );
+ ac->addTo( layoutMenu );
+ connect( ac, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *ar = new ToolBarItem( this, basicToolBar, i18n( "Align right" ),
+ "p align=\"right\"", BarIcon( "designer_textright.png", KDevDesignerPartFactory::instance() ) );
+ ar->addTo( layoutMenu );
+ connect( ar, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *block = new ToolBarItem( this, basicToolBar, i18n( "Blockquote" ),
+ "blockquote", BarIcon( "designer_textjustify.png", KDevDesignerPartFactory::instance() ) );
+ block->addTo( layoutMenu );
+ connect( block, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+
+ QPopupMenu *fontMenu = new QPopupMenu( this );
+ menuBar->insertItem( i18n( "&Font" ), fontMenu );
+
+ fontToolBar = new QToolBar( "Fonts", this, DockTop );
+
+ QAction *fontAction = new QAction( this );
+ fontAction->setIconSet( BarIcon( "designer_textfont.png", KDevDesignerPartFactory::instance() ) );
+ fontAction->setText( i18n("Font" ) );
+ fontAction->addTo( fontToolBar );
+ fontAction->addTo( fontMenu );
+ connect( fontAction, SIGNAL( activated() ) , this, SLOT( showFontDialog() ) );
+
+
+ ToolBarItem *fp1 = new ToolBarItem( this, fontToolBar, i18n( "Fontsize +1" ),
+ "font size=\"+1\"", BarIcon( "designer_textlarger.png", KDevDesignerPartFactory::instance() ) );
+ connect( fp1, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *fm1 = new ToolBarItem( this, fontToolBar, i18n( "Fontsize -1" ),
+ "font size=\"-1\"", BarIcon( "designer_textsmaller.png", KDevDesignerPartFactory::instance() ) );
+ connect( fm1, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *h1 = new ToolBarItem( this, fontToolBar, i18n( "Headline 1" ),
+ "h1", BarIcon( "designer_texth1.png", KDevDesignerPartFactory::instance() ) );
+ connect( h1, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *h2 = new ToolBarItem( this, fontToolBar, i18n( "Headline 2" ),
+ "h2", BarIcon( "designer_texth2.png", KDevDesignerPartFactory::instance() ) );
+ connect( h2, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ ToolBarItem *h3 = new ToolBarItem( this, fontToolBar, i18n( "Headline 3" ),
+ "h3", BarIcon( "designer_texth3.png", KDevDesignerPartFactory::instance() ) );
+ connect( h3, SIGNAL( clicked( const QString& ) ),
+ this, SLOT( insertTags( const QString& )));
+
+ QPopupMenu *optionsMenu = new QPopupMenu( this );
+ menuBar->insertItem( i18n( "O&ptions" ), optionsMenu );
+
+ optionsToolBar = new QToolBar( "Options", this, DockTop );
+ wrapAction = new QAction( this );
+ wrapAction->setToggleAction( TRUE );
+ wrapAction->setIconSet( BarIcon( "designer_wordwrap.png", KDevDesignerPartFactory::instance() ) );
+ wrapAction->setText( i18n( "Word Wrapping" ) );
+ wrapAction->addTo( optionsToolBar );
+ wrapAction->addTo( optionsMenu );
+ connect( wrapAction, SIGNAL( toggled( bool ) ), this, SLOT( changeWrapMode( bool ) ) );
+
+ oldDoWrap = doWrap;
+ wrapAction->setOn( doWrap );
+
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ textEdit->document()->setFormatter( new QTextFormatterBreakInWords );
+ textEdit->document()->setUseFormatCollection( FALSE );
+ textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML );
+
+ if ( !callStatic && ::qt_cast<QTextEdit*>(editWidget) ) {
+ mlined = (QTextEdit*)editWidget;
+ mlined->setReadOnly( TRUE );
+
+ const QMetaProperty *wordWrap = mlined->metaObject()->property(
+ mlined->metaObject()->findProperty( "wordWrap", TRUE ), TRUE );
+ oldWrapMode = 0;
+ oldWrapString = "NoWrap";
+ if ( wordWrap ) {
+ oldWrapMode = mlined->property( "wordWrap" );
+ oldWrapString = QString( wordWrap->valueToKey( oldWrapMode.toInt() ) );
+ if ( oldWrapString != "NoWrap" )
+ doWrap = TRUE;
+ }
+ textEdit->setAlignment( mlined->alignment() );
+ textEdit->setWordWrap( mlined->wordWrap() );
+ textEdit->setWrapColumnOrWidth( mlined->wrapColumnOrWidth() );
+ textEdit->setWrapPolicy( mlined->wrapPolicy() );
+ textEdit->setText( mlined->text() );
+ if ( !mlined->text().isEmpty() )
+ textEdit->selectAll();
+ } else {
+ textEdit->setText( text );
+ textEdit->selectAll();
+ }
+ } else {
+ textEdit->setText( text );
+ textEdit->selectAll();
+ }
+ textEdit->setFocus();
+}
+
+int MultiLineEditor::exec()
+{
+ res = 1;
+ show();
+ qApp->enter_loop();
+ return res;
+}
+
+void MultiLineEditor::okClicked()
+{
+ applyClicked();
+ close();
+}
+
+void MultiLineEditor::applyClicked()
+{
+ if ( !callStatic ) {
+ PopulateMultiLineEditCommand *cmd = new PopulateMultiLineEditCommand( i18n( "Set the Text of '%1'" ).arg( mlined->name() ),
+ formwindow, mlined, textEdit->text() );
+ cmd->execute();
+ formwindow->commandHistory()->addCommand( cmd );
+
+ if ( oldDoWrap != doWrap ) {
+ QString pn( i18n( "Set 'wordWrap' of '%2'" ).arg( mlined->name() ) );
+ SetPropertyCommand *propcmd;
+ if ( doWrap )
+ propcmd = new SetPropertyCommand( pn, formwindow,
+ mlined, MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ QVariant( 1 ), "WidgetWidth", oldWrapString );
+ else
+ propcmd = new SetPropertyCommand( pn, formwindow,
+ mlined, MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ QVariant( 0 ), "NoWrap", oldWrapString );
+
+ propcmd->execute();
+ formwindow->commandHistory()->addCommand( propcmd, TRUE );
+ }
+ textEdit->setFocus();
+ }
+ else {
+ staticText = textEdit->text();
+ }
+}
+
+void MultiLineEditor::cancelClicked()
+{
+ res = 0;
+ close();
+}
+
+void MultiLineEditor::closeEvent( QCloseEvent *e )
+{
+ qApp->exit_loop();
+ MultiLineEditorBase::closeEvent( e );
+}
+
+void MultiLineEditor::insertTags( const QString &tag )
+{
+ int pfrom, pto, ifrom, ito;
+ QString tagend( tag.simplifyWhiteSpace() );
+ tagend.remove( tagend.find( ' ', 0 ), tagend.length() );
+ if ( textEdit->hasSelectedText() ) {
+ textEdit->getSelection( &pfrom, &ifrom, &pto, &ito );
+ QString buf = textEdit->selectedText();
+ buf = QString( "<%1>%3</%2>" ).arg( tag ).arg( tagend ).arg( buf );
+ textEdit->removeSelectedText();
+ textEdit->insertAt( buf, pfrom, ifrom );
+ textEdit->setCursorPosition( pto, ito + 2 + tag.length() );
+ }
+ else {
+ int para, index;
+ textEdit->getCursorPosition( &para, &index );
+ textEdit->insert( QString( "<%1></%2>" ).arg( tag ).arg( tagend ) );
+ index += 2 + tag.length();
+ textEdit->setCursorPosition( para, index );
+ }
+}
+
+void MultiLineEditor::insertBR()
+{
+ textEdit->insert( "<br>" );
+}
+
+void MultiLineEditor::showFontDialog()
+{
+ bool selText = FALSE;
+ int pfrom, pto, ifrom, ito;
+ if ( textEdit->hasSelectedText() ) {
+ textEdit->getSelection( &pfrom, &ifrom, &pto, &ito );
+ selText = TRUE;
+ }
+ RichTextFontDialog *fd = new RichTextFontDialog( this );
+ if ( fd->exec() == QDialog::Accepted ) {
+ QString size, font;
+ if ( fd->getSize() != "0" )
+ size = "size=\"" + fd->getSize() + "\"";
+ QString color;
+ if ( !fd->getColor().isEmpty() && fd->getColor() != "#000000" )
+ color = "color=\"" + fd->getColor() + "\"";
+ if ( fd->getFont() != "default" )
+ font = "face=\"" + fd->getFont() + "\"";
+ QString tag( QString( "font %1 %2 %3" )
+ .arg( color ).arg( size ).arg( font ) );
+
+ if ( selText )
+ textEdit->setSelection( pfrom, ifrom, pto, ito );
+ insertTags( tag.simplifyWhiteSpace() );
+ }
+ else if ( selText )
+ textEdit->setSelection( pfrom, ifrom, pto, ito );
+}
+
+QString MultiLineEditor::getStaticText()
+{
+ return staticText.stripWhiteSpace();
+}
+
+QString MultiLineEditor::getText( QWidget *parent, const QString &text, bool richtextMode, bool *useWrap )
+{
+ MultiLineEditor medit( TRUE, richtextMode, parent, 0, 0, text );
+ if ( richtextMode )
+ medit.setUseWrapping( *useWrap );
+ if ( medit.exec() == QDialog::Accepted ) {
+ *useWrap = medit.useWrapping();
+ return medit.getStaticText();
+ }
+ return QString::null;
+}
+
+void MultiLineEditor::changeWrapMode( bool b )
+{
+ doWrap = b;
+ if ( doWrap && !callStatic ) {
+ if ( oldDoWrap )
+ textEdit->setProperty( "wordWrap", oldWrapMode );
+ else
+ textEdit->setWordWrap( QTextEdit::WidgetWidth );
+ } else {
+ textEdit->setWordWrap( QTextEdit::NoWrap );
+ }
+}
+
+bool MultiLineEditor::useWrapping() const
+{
+ return doWrap;
+}
+
+void MultiLineEditor::setUseWrapping( bool b )
+{
+ doWrap = b;
+ wrapAction->setOn( doWrap );
+}
diff --git a/kdevdesigner/designer/multilineeditorimpl.h b/kdevdesigner/designer/multilineeditorimpl.h
new file mode 100644
index 00000000..5abf5339
--- /dev/null
+++ b/kdevdesigner/designer/multilineeditorimpl.h
@@ -0,0 +1,109 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef MULTILINEEDITORIMPL_H
+#define MULTILINEEDITORIMPL_H
+
+#include <qaction.h>
+#include <qtextedit.h>
+#include <private/qrichtext_p.h>
+#include "multilineeditor.h"
+
+class FormWindow;
+class QToolBar;
+class QTextDocument;
+
+class TextEdit : public QTextEdit
+{
+ Q_OBJECT
+
+public:
+ TextEdit( QWidget *parent = 0, const char *name = 0 );
+ QTextDocument *document() const { return QTextEdit::document(); }
+ QTextParagraph *paragraph();
+
+};
+
+class ToolBarItem : public QAction
+{
+ Q_OBJECT
+
+public:
+ ToolBarItem( QWidget *parent, QWidget *toolBar,
+ const QString &label, const QString &tagstr,
+ const QIconSet &icon, const QKeySequence &key = 0 );
+ ~ToolBarItem();
+signals:
+ void clicked( const QString &t );
+
+protected slots:
+ void wasActivated();
+private:
+ QString tag;
+};
+
+
+class MultiLineEditor : public MultiLineEditorBase
+{
+ Q_OBJECT
+
+public:
+ MultiLineEditor( bool call_static, bool richtextMode, QWidget *parent, QWidget *editWidget,
+ FormWindow *fw, const QString &text = QString::null );
+ bool useWrapping() const;
+ void setUseWrapping( bool );
+ static QString getText( QWidget *parent, const QString &text, bool richtextMode, bool *useWrap );
+ int exec();
+
+protected slots:
+ void okClicked();
+ void applyClicked();
+ void cancelClicked();
+ void insertTags( const QString& );
+ void insertBR();
+ void showFontDialog();
+ void changeWrapMode( bool );
+
+ void closeEvent( QCloseEvent *e );
+
+private:
+ QString getStaticText();
+ TextEdit *textEdit;
+ QTextEdit *mlined;
+ FormWindow *formwindow;
+ QToolBar *basicToolBar;
+ QToolBar *fontToolBar;
+ QToolBar *optionsToolBar;
+ QAction *wrapAction;
+ int res;
+ QString staticText;
+ bool callStatic;
+ bool oldDoWrap, doWrap;
+ QVariant oldWrapMode;
+ QString oldWrapString;
+};
+
+#endif
diff --git a/kdevdesigner/designer/myiconloader.cpp b/kdevdesigner/designer/myiconloader.cpp
new file mode 100644
index 00000000..b33a6299
--- /dev/null
+++ b/kdevdesigner/designer/myiconloader.cpp
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "myiconloader.h"
+#include "kdevdesigner_part.h"
+#include <kiconloader.h>
+
+QPixmap BarIcon2( const QString & name )
+{
+ return BarIcon(name, KDevDesignerPartFactory::instance());
+}
+
+QPixmap SmallIcon2( const QString & name)
+{
+ return SmallIcon(name, KDevDesignerPartFactory::instance());
+}
diff --git a/kdevdesigner/designer/myiconloader.h b/kdevdesigner/designer/myiconloader.h
new file mode 100644
index 00000000..f93dee16
--- /dev/null
+++ b/kdevdesigner/designer/myiconloader.h
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef MY_ICON_LOADER
+#define MY_ICON_LOADER
+
+#include <qpixmap.h>
+#include <qstring.h>
+
+class KInstance;
+
+QPixmap BarIcon2 (const QString &name);
+QPixmap SmallIcon2 (const QString &name);
+
+
+#endif
diff --git a/kdevdesigner/designer/newform.ui b/kdevdesigner/designer/newform.ui
new file mode 100644
index 00000000..cdfae7e4
--- /dev/null
+++ b/kdevdesigner/designer/newform.ui
@@ -0,0 +1,238 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>NewFormBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>NewFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>557</width>
+ <height>436</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New File</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;New Form&lt;/b&gt;&lt;p&gt;Select a template for the new form and click the &lt;b&gt;OK&lt;/b&gt;-button to create it.&lt;/p&gt;</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Create a new form using the selected template.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog without creating a new form.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QIconView" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>templateView</cstring>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ <property name="wordWrapIconText">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displays a list of the available templates.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelProject</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert into:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>projectCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>projectCombo</cstring>
+ </property>
+ </widget>
+ <spacer row="0" column="2">
+ <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>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>projectCombo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>projectChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>currentChanged(QIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>itemChanged(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>doubleClicked(QIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>returnPressed(QIconViewItem*)</signal>
+ <receiver>NewFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>templateView</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">itemChanged( QIconViewItem * )</slot>
+ <slot access="protected">projectChanged( const QString &amp; )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/newformimpl.cpp b/kdevdesigner/designer/newformimpl.cpp
new file mode 100644
index 00000000..9ff44d01
--- /dev/null
+++ b/kdevdesigner/designer/newformimpl.cpp
@@ -0,0 +1,414 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "newformimpl.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+#include "widgetdatabase.h"
+#include "actioneditorimpl.h"
+#include "hierarchyview.h"
+#include "resource.h"
+#include "projectsettingsimpl.h"
+#include "sourcefile.h"
+
+#include <kiconloader.h>
+#include "kdevdesigner_part.h"
+#include <klocale.h>
+
+#include <qiconview.h>
+#include <qlabel.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qpushbutton.h>
+#include <stdlib.h>
+#include <qcombobox.h>
+#include <qworkspace.h>
+#include <qmessagebox.h>
+
+static int forms = 0;
+
+ProjectItem::ProjectItem( QIconView *view, const QString &text )
+ : NewItem( view, text )
+{
+}
+
+void ProjectItem::insert( Project * )
+{
+ MainWindow::self->createNewProject( lang );
+}
+
+
+
+FormItem::FormItem( QIconView *view, const QString &text )
+ : NewItem( view, text )
+{
+}
+
+void FormItem::insert( Project *pro )
+{
+ QString n = "Form" + QString::number( ++forms );
+ FormWindow *fw = 0;
+ FormFile *ff = new FormFile( FormFile::createUnnamedFileName(), TRUE, pro );
+ fw = new FormWindow( ff, MainWindow::self, MainWindow::self->qWorkspace(), n );
+ fw->setProject( pro );
+ MetaDataBase::addEntry( fw );
+ if ( fType == Widget ) {
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QWidget" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == Dialog ) {
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QDialog" ), fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == Wizard ) {
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QWizard" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ } else if ( fType == MainWindow ) {
+ QWidget *w = WidgetFactory::create( WidgetDatabase::idFromClassName( "QMainWindow" ),
+ fw, n.latin1() );
+ fw->setMainContainer( w );
+ }
+
+ fw->setCaption( n );
+ fw->resize( 600, 480 );
+ MainWindow::self->insertFormWindow( fw );
+
+ TemplateWizardInterface *iface =
+ MainWindow::self->templateWizardInterface( fw->mainContainer()->className() );
+ if ( iface ) {
+ iface->setup( fw->mainContainer()->className(), fw->mainContainer(),
+ fw->iFace(), MainWindow::self->designerInterface() );
+ iface->release();
+ }
+
+ // the wizard might have changed a lot, lets update everything
+ MainWindow::self->actioneditor()->setFormWindow( fw );
+ MainWindow::self->objectHierarchy()->setFormWindow( fw, fw );
+ MainWindow::self->objectHierarchy()->formDefinitionView()->refresh();
+ MainWindow::self->objectHierarchy()->rebuild();
+ fw->killAccels( fw );
+ fw->project()->setModified( TRUE );
+ fw->setFocus();
+ if ( !pro->isDummy() ) {
+ fw->setSavePixmapInProject( TRUE );
+ fw->setSavePixmapInline( FALSE );
+ }
+}
+
+
+
+CustomFormItem::CustomFormItem( QIconView *view, const QString &text )
+ : NewItem( view, text )
+{
+}
+
+static void unifyFormName( FormWindow *fw, QWorkspace *qworkspace )
+{
+ QStringList lst;
+ QWidgetList windows = qworkspace->windowList();
+ for ( QWidget *w =windows.first(); w; w = windows.next() ) {
+ if ( w == fw )
+ continue;
+ lst << w->name();
+ }
+
+ if ( lst.findIndex( fw->name() ) == -1 )
+ return;
+ QString origName = fw->name();
+ QString n = origName;
+ int i = 1;
+ while ( lst.findIndex( n ) != -1 ) {
+ n = origName + QString::number( i++ );
+ }
+ fw->setName( n );
+ fw->setCaption( n );
+}
+
+void CustomFormItem::insert( Project *pro )
+{
+ QString filename = templateFileName();
+ if ( !filename.isEmpty() && QFile::exists( filename ) ) {
+ Resource resource( MainWindow::self );
+ FormFile *ff = new FormFile( filename, TRUE, pro );
+ if ( !resource.load( ff ) ) {
+ QMessageBox::information( MainWindow::self, i18n("Load Template"),
+ i18n("Could not load form description from template '%1'" ).arg( filename ) );
+ delete ff;
+ return;
+ }
+ ff->setFileName( QString::null );
+ if ( MainWindow::self->formWindow() ) {
+ MainWindow::self->formWindow()->setFileName( QString::null );
+ unifyFormName( MainWindow::self->formWindow(), MainWindow::self->qWorkspace() );
+ if ( !pro->isDummy() ) {
+ MainWindow::self->formWindow()->setSavePixmapInProject( TRUE );
+ MainWindow::self->formWindow()->setSavePixmapInline( FALSE );
+ }
+ }
+ }
+}
+
+
+
+SourceFileItem::SourceFileItem( QIconView *view, const QString &text )
+ : NewItem( view, text ), visible( TRUE )
+{
+}
+
+void SourceFileItem::insert( Project *pro )
+{
+ SourceFile *f = new SourceFile( SourceFile::createUnnamedFileName( ext ), TRUE, pro );
+ MainWindow::self->editSource( f );
+}
+
+void SourceFileItem::setProject( Project *pro )
+{
+ QIconView *iv = iconView();
+ bool v = lang == pro->language();
+ if ( !iv || v == visible )
+ return;
+ visible = v;
+ if ( !visible )
+ iv->takeItem( this );
+ else
+ iv->insertItem( this );
+}
+
+
+
+SourceTemplateItem::SourceTemplateItem( QIconView *view, const QString &text )
+ : NewItem( view, text ), visible( TRUE )
+{
+}
+
+void SourceTemplateItem::insert( Project *pro )
+{
+ SourceTemplateInterface *siface = MainWindow::self->sourceTemplateInterface( text() );
+ if ( !siface )
+ return;
+ SourceTemplateInterface::Source src = siface->create( text(), MainWindow::self->designerInterface() );
+ SourceFile *f = 0;
+ if ( src.type == SourceTemplateInterface::Source::Invalid )
+ return;
+ if ( src.type == SourceTemplateInterface::Source::FileName )
+ f = new SourceFile( src.filename, FALSE, pro );
+ else
+ f = new SourceFile( SourceFile::createUnnamedFileName( src.extension ), TRUE, pro );
+ if ( f->isAccepted()) {
+ f->setText( src.code );
+ MainWindow::self->editSource( f );
+ f->setModified( TRUE );
+ } else {
+ delete f;
+ }
+}
+
+void SourceTemplateItem::setProject( Project *pro )
+{
+ QIconView *iv = iconView();
+ bool v = !pro->isDummy() && lang == pro->language();
+ if ( !iv || v == visible )
+ return;
+ visible = v;
+ if ( !visible )
+ iv->takeItem( this );
+ else
+ iv->insertItem( this );
+}
+
+void NewForm::insertTemplates( QIconView *tView,
+ const QString &templatePath )
+{
+ QStringList::Iterator it;
+ QStringList languages = MetaDataBase::languages();
+ if ( !MainWindow::self->singleProjectMode() ) {
+ for ( it = languages.begin(); it != languages.end(); ++it ) {
+ ProjectItem *pi = new ProjectItem( tView, i18n("%1 Project" ).arg( *it ) );
+ allItems.append( pi );
+ pi->setLanguage( *it );
+ pi->setPixmap( BarIcon( "designer_project.png" , KDevDesignerPartFactory::instance()) );
+ pi->setDragEnabled( FALSE );
+ }
+ }
+ QIconViewItem *cur = 0;
+ FormItem *fi = new FormItem( tView,i18n( "Dialog" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Dialog );
+ fi->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
+ fi->setDragEnabled( FALSE );
+ cur = fi;
+ if ( !MainWindow::self->singleProjectMode() ) {
+ fi = new FormItem( tView,i18n( "Wizard" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Wizard );
+ fi->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
+ fi->setDragEnabled( FALSE );
+ fi = new FormItem( tView, i18n( "Widget" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::Widget );
+ fi->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
+ fi->setDragEnabled( FALSE );
+ fi = new FormItem( tView, i18n( "Main Window" ) );
+ allItems.append( fi );
+ fi->setFormType( FormItem::MainWindow );
+ fi->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
+ fi->setDragEnabled( FALSE );
+
+ QString templPath = templatePath;
+ QStringList templRoots;
+ const char *qtdir = getenv( "QTDIR" );
+ if(qtdir)
+ templRoots << qtdir;
+ templRoots << qInstallPathData();
+ if(qtdir) //try the tools/designer directory last!
+ templRoots << (QString(qtdir) + "/tools/designer");
+ for ( QStringList::Iterator it = templRoots.begin(); it != templRoots.end(); ++it ) {
+ QString path = (*it) + "/templates";
+ if ( QFile::exists( path )) {
+ templPath = path;
+ break;
+ }
+ }
+ if ( !templPath.isEmpty() ) {
+ QDir dir( templPath );
+ const QFileInfoList *filist = dir.entryInfoList( QDir::DefaultFilter, QDir::DirsFirst | QDir::Name );
+ if ( filist ) {
+ QFileInfoListIterator it( *filist );
+ QFileInfo *fi;
+ while ( ( fi = it.current() ) != 0 ) {
+ ++it;
+ if ( !fi->isFile() || fi->extension() != "ui" )
+ continue;
+ QString name = fi->baseName();
+ name = name.replace( '_', ' ' );
+ CustomFormItem *ci = new CustomFormItem( tView, name );
+ allItems.append( ci );
+ ci->setDragEnabled( FALSE );
+ ci->setPixmap( BarIcon( "designer_newform.png" , KDevDesignerPartFactory::instance()) );
+ ci->setTemplateFile( fi->absFilePath() );
+ }
+ }
+ }
+ }
+
+ for ( it = languages.begin(); it != languages.end(); ++it ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( *it );
+ if ( iface ) {
+ QMap<QString, QString> extensionMap;
+ iface->preferedExtensions( extensionMap );
+ for ( QMap<QString, QString>::Iterator eit = extensionMap.begin();
+ eit != extensionMap.end(); ++eit ) {
+ SourceFileItem * si = new SourceFileItem( tView, *eit );
+ allItems.append( si );
+ si->setExtension( eit.key() );
+ si->setLanguage( *it );
+ si->setPixmap( BarIcon( "designer_filenew.png", KDevDesignerPartFactory::instance() ) );
+ si->setDragEnabled( FALSE );
+ }
+ iface->release();
+ }
+ }
+
+ if ( !MainWindow::self->singleProjectMode() ) {
+ QStringList sourceTemplates = MainWindow::self->sourceTemplates();
+ for ( QStringList::Iterator sit = sourceTemplates.begin(); sit != sourceTemplates.end(); ++sit ) {
+ SourceTemplateInterface *siface = MainWindow::self->sourceTemplateInterface( *sit );
+ if ( !siface )
+ continue;
+ SourceTemplateItem * si = new SourceTemplateItem( tView, *sit );
+ allItems.append( si );
+ si->setTemplate( *sit );
+ si->setLanguage( siface->language( *sit ) );
+ si->setPixmap( BarIcon( "designer_filenew.png", KDevDesignerPartFactory::instance() ) );
+ si->setDragEnabled( FALSE );
+ siface->release();
+ }
+ }
+
+ tView->viewport()->setFocus();
+ tView->setCurrentItem( cur );
+
+ if ( MainWindow::self->singleProjectMode() )
+ adjustSize();
+}
+
+NewForm::NewForm( QIconView *templateView, const QString &templatePath )
+{
+ insertTemplates( templateView, templatePath );
+ projectChanged( i18n( "<No Project>" ) );
+}
+
+NewForm::NewForm( QWidget *parent, const QStringList& projects,
+ const QString& currentProject, const QString &templatePath )
+ : NewFormBase( parent, 0, TRUE )
+{
+ connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+
+ projectCombo->insertStringList( projects );
+ projectCombo->setCurrentText( currentProject );
+
+ insertTemplates( templateView, templatePath );
+
+ projectChanged( projectCombo->currentText() );
+}
+
+void NewForm::accept()
+{
+ if ( !templateView->currentItem() )
+ return;
+ Project *pro = MainWindow::self->findProject( projectCombo->currentText() );
+ if ( !pro )
+ return;
+ MainWindow::self->setCurrentProject( pro );
+ NewFormBase::accept();
+ ( (NewItem*)templateView->currentItem() )->insert( pro );
+}
+
+void NewForm::projectChanged( const QString &project )
+{
+ Project *pro = MainWindow::self->findProject( project );
+ if ( !pro )
+ return;
+ QIconViewItem *i;
+ for ( i = allItems.first(); i; i = allItems.next() )
+ ( (NewItem*)i )->setProject( pro );
+ templateView->setCurrentItem( templateView->firstItem() );
+ templateView->arrangeItemsInGrid( TRUE );
+}
+
+void NewForm::itemChanged( QIconViewItem *item )
+{
+ labelProject->setEnabled( item->rtti() != NewItem::ProjectType );
+ projectCombo->setEnabled( item->rtti() != NewItem::ProjectType );
+}
+
+QPtrList<QIconViewItem> NewForm::allViewItems()
+{
+ return allItems;
+}
diff --git a/kdevdesigner/designer/newformimpl.h b/kdevdesigner/designer/newformimpl.h
new file mode 100644
index 00000000..acd597bf
--- /dev/null
+++ b/kdevdesigner/designer/newformimpl.h
@@ -0,0 +1,164 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef NEWFORMIMPL_H
+#define NEWFORMIMPL_H
+
+#include "newform.h"
+#include <qiconview.h>
+
+class Project;
+
+class NewItem : public QIconViewItem
+{
+public:
+ enum Type {
+ ProjectType,
+ Form,
+ CustomForm,
+ SourceFileType,
+ SourceTemplateType
+ };
+
+ NewItem( QIconView *view, const QString &text )
+ : QIconViewItem( view, text ) {}
+ virtual void insert( Project *pro ) = 0;
+ virtual void setProject( Project * ) {}
+
+};
+
+class ProjectItem : public NewItem
+{
+public:
+ ProjectItem( QIconView *view, const QString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)ProjectType; }
+
+ void setLanguage( const QString &l ) { lang = l; }
+ QString language() const { return lang; }
+
+private:
+ QString lang;
+
+};
+
+class FormItem : public NewItem
+{
+public:
+ enum FormType {
+ Widget,
+ Dialog,
+ Wizard,
+ MainWindow
+ };
+
+ FormItem( QIconView *view, const QString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)Form; }
+
+ void setFormType( FormType ft ) { fType = ft; }
+ FormType formType() const { return fType; }
+
+private:
+ FormType fType;
+
+};
+
+class CustomFormItem : public NewItem
+{
+public:
+ CustomFormItem( QIconView *view, const QString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)CustomForm; }
+
+ void setTemplateFile( const QString &tf ) { templFile = tf; }
+ QString templateFileName() const { return templFile; }
+
+private:
+ QString templFile;
+
+};
+
+class SourceFileItem : public NewItem
+{
+public:
+ SourceFileItem( QIconView *view, const QString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)SourceFileType; }
+
+ void setExtension( const QString &e ) { ext = e; }
+ QString extension() const { return ext; }
+ void setLanguage( const QString &l ) { lang = l; }
+ void setProject( Project *pro );
+
+private:
+ QString ext;
+ QString lang;
+ bool visible;
+
+};
+
+class SourceTemplateItem : public NewItem
+{
+public:
+ SourceTemplateItem( QIconView *view, const QString &text );
+ void insert( Project *pro );
+ int rtti() const { return (int)SourceTemplateType; }
+
+ void setTemplate( const QString &t ) { templ = t; }
+ QString tenplate() const { return templ; }
+ void setLanguage( const QString &l ) { lang = l; }
+ void setProject( Project *pro );
+
+private:
+ QString templ;
+ QString lang;
+ bool visible;
+
+};
+
+class NewForm : public NewFormBase
+{
+ Q_OBJECT
+
+public:
+ NewForm( QIconView *templateView, const QString &templatePath );
+ NewForm( QWidget *parent, const QStringList& projects,
+ const QString& currentProject, const QString &templatePath );
+ void insertTemplates( QIconView*, const QString& );
+ void accept();
+ QPtrList<QIconViewItem> allViewItems();
+
+protected slots:
+ void projectChanged( const QString &project );
+ void itemChanged( QIconViewItem *item );
+
+private:
+ QPtrList<QIconViewItem> allItems;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/orderindicator.cpp b/kdevdesigner/designer/orderindicator.cpp
new file mode 100644
index 00000000..08ed16b8
--- /dev/null
+++ b/kdevdesigner/designer/orderindicator.cpp
@@ -0,0 +1,112 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler need this here
+
+#include "orderindicator.h"
+#include "formwindow.h"
+
+#include <qpainter.h>
+#include <qbitmap.h>
+#include <qapplication.h>
+
+OrderIndicator::OrderIndicator( int i, QWidget* w, FormWindow *fw )
+ : QWidget( fw, "order_indicator", WMouseNoMask ), formWindow( fw )
+{
+ order = -1;
+ widget = w;
+ setBackgroundMode( NoBackground );
+ setAutoMask( TRUE );
+ setOrder( i, w );
+}
+
+
+OrderIndicator::~OrderIndicator()
+{
+}
+
+
+void OrderIndicator::setOrder( int i, QWidget* wid )
+{
+ if ( widget != wid )
+ return;
+ if ( !wid->isVisibleTo( formWindow ) ) {
+ hide();
+ return;
+ }
+
+ if ( order == i ) {
+ show();
+ raise();
+ return;
+ }
+ order = i;
+ int w = fontMetrics().width( QString::number( i ) ) + 10;
+ int h = fontMetrics().lineSpacing() * 3 / 2;
+ QFont f( font() );
+ f.setBold( TRUE );
+ setFont( f );
+ resize( QMAX( w, h ), h );
+ update(); // in case the size didn't change
+ reposition();
+ show();
+ raise();
+}
+
+void OrderIndicator::reposition()
+{
+ QPoint p =parentWidget()->mapFromGlobal( widget->mapToGlobal( widget->rect().topLeft() ) );
+ move( p - QPoint( width()/3, height()/3 ) );
+}
+
+
+void OrderIndicator::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ p.setPen( white );
+ p.setBrush( blue );
+ p.drawEllipse( rect() );
+ p.drawText( rect(), AlignCenter, QString::number( order ) );
+}
+
+
+void OrderIndicator::updateMask()
+{
+ QBitmap bm( size() );
+ bm.fill( color0 );
+ {
+ QPainter p( &bm, this );
+ p.setPen( color1 );
+ p.setBrush( color1 );
+ p.drawEllipse( rect() );
+ }
+ setMask( bm );
+}
+
+void OrderIndicator::mousePressEvent( QMouseEvent *e )
+{
+ QApplication::sendEvent( widget, e );
+}
diff --git a/kdevdesigner/designer/orderindicator.h b/kdevdesigner/designer/orderindicator.h
new file mode 100644
index 00000000..35962b7a
--- /dev/null
+++ b/kdevdesigner/designer/orderindicator.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ORDERINDICATOR_H
+#define ORDERINDICATOR_H
+
+#include <qwidget.h>
+
+class FormWindow;
+
+class OrderIndicator : public QWidget
+{
+ Q_OBJECT
+
+public:
+ OrderIndicator( int i, QWidget* w, FormWindow* fw );
+ ~OrderIndicator();
+
+ void setOrder( int i, QWidget* w );
+ void reposition();
+
+protected:
+ void paintEvent( QPaintEvent * );
+ void mousePressEvent( QMouseEvent *e );
+ void updateMask();
+
+private:
+ int order;
+ QWidget* widget;
+ FormWindow *formWindow;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/outputwindow.cpp b/kdevdesigner/designer/outputwindow.cpp
new file mode 100644
index 00000000..f51a54a3
--- /dev/null
+++ b/kdevdesigner/designer/outputwindow.cpp
@@ -0,0 +1,209 @@
+/**********************************************************************
+** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "outputwindow.h"
+#include "designerappiface.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+
+#include <qlistview.h>
+#include <qtextedit.h>
+#include <qapplication.h>
+#include <qheader.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <qpainter.h>
+
+#include <klocale.h>
+
+static QTextEdit *debugoutput = 0;
+bool debugToStderr = FALSE;
+
+QtMsgHandler OutputWindow::oldMsgHandler = 0;
+
+OutputWindow::OutputWindow( QWidget *parent )
+ : QTabWidget( parent, "output_window" ), debugView( 0 ), errorView( 0 )
+{
+ setupDebug();
+ setupError();
+ iface = new DesignerOutputDockImpl( this );
+}
+
+OutputWindow::~OutputWindow()
+{
+ debugoutput = debugView = 0;
+ errorView = 0;
+ if ( !debugToStderr )
+ qInstallMsgHandler( oldMsgHandler );
+ delete iface;
+}
+
+void OutputWindow::shuttingDown()
+{
+ if ( !debugToStderr )
+ qInstallMsgHandler( oldMsgHandler );
+}
+
+void OutputWindow::setupError()
+{
+ errorView = new QListView( this, "OutputWindow::errorView" );
+ errorView->setSorting( -1 );
+ connect( errorView, SIGNAL( currentChanged( QListViewItem* ) ),
+ this, SLOT( currentErrorChanged( QListViewItem* ) ) );
+ connect( errorView, SIGNAL( clicked( QListViewItem* ) ),
+ this, SLOT( currentErrorChanged( QListViewItem* ) ) );
+
+ if ( MetaDataBase::languages().count() > 1 )
+ addTab( errorView, i18n( "Warnings/Errors" ) );
+ else
+ errorView->hide();
+ errorView->addColumn( i18n( "Type" ) );
+ errorView->addColumn( i18n( "Message" ) );
+ errorView->addColumn( i18n( "Line" ) );
+ errorView->addColumn( i18n( "Location" ) );
+ errorView->setResizeMode( QListView::LastColumn );
+ errorView->setColumnWidth( 0, errorView->fontMetrics().width( "WARNING1234" ) );
+ errorView->setColumnWidth( 1, errorView->fontMetrics().width( "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOP" ) );
+ errorView->setColumnWidth( 2, errorView->fontMetrics().width( "9999999" ) );
+ errorView->setColumnAlignment( 2, Qt::AlignRight );
+ errorView->setAllColumnsShowFocus( TRUE );
+}
+
+static void debugMessageOutput( QtMsgType type, const char *msg )
+{
+ QString s( msg );
+ s += "\n";
+
+ if ( type != QtFatalMsg ) {
+ if ( debugoutput && debugoutput->isVisible() )
+ debugoutput->append( s );
+ else if ( OutputWindow::oldMsgHandler && OutputWindow::oldMsgHandler != debugMessageOutput )
+ (*OutputWindow::oldMsgHandler)( type, msg );
+ else
+ fputs( s.latin1(), stderr );
+ } else {
+ fputs( s.latin1(), stderr );
+ abort();
+ }
+
+ qApp->flush();
+}
+
+void OutputWindow::setupDebug()
+{
+ debugoutput = debugView = new QTextEdit( this, "OutputWindow::debugView" );
+ //debugView->setReadOnly( TRUE );
+ addTab( debugView, "Debug Output" );
+
+ if ( !debugToStderr )
+ oldMsgHandler = qInstallMsgHandler( debugMessageOutput );
+}
+
+void OutputWindow::setErrorMessages( const QStringList &errors, const QValueList<uint> &lines,
+ bool clear, const QStringList &locations,
+ const QObjectList &locationObjects )
+{
+ if ( clear )
+ errorView->clear();
+ QStringList::ConstIterator mit = errors.begin();
+ QValueList<uint>::ConstIterator lit = lines.begin();
+ QStringList::ConstIterator it = locations.begin();
+ QObjectList objects = (QObjectList)locationObjects;
+ QObject *o = objects.first();
+ QListViewItem *after = 0;
+ for ( ; lit != lines.end() && mit != errors.end(); ++lit, ++mit, ++it, o = objects.next() )
+ after = new ErrorItem( errorView, after, *mit, *lit, *it, o );
+ setCurrentPage( 1 );
+}
+
+DesignerOutputDock *OutputWindow::iFace()
+{
+ return iface;
+}
+
+void OutputWindow::appendDebug( const QString &text )
+{
+ debugView->append( text + "\n" );
+}
+
+void OutputWindow::clearErrorMessages()
+{
+ errorView->clear();
+}
+
+void OutputWindow::clearDebug()
+{
+ debugView->clear();
+}
+
+void OutputWindow::showDebugTab()
+{
+ showPage( debugView );
+}
+
+void OutputWindow::currentErrorChanged( QListViewItem *i )
+{
+ if ( !i )
+ return;
+ ErrorItem *ei = (ErrorItem*)i;
+ ei->setRead( TRUE );
+ MainWindow::self->showSourceLine( ei->location(), ei->line() - 1, MainWindow::Error );
+}
+
+
+
+ErrorItem::ErrorItem( QListView *parent, QListViewItem *after, const QString &message, int line,
+ const QString &locationString, QObject *locationObject )
+ : QListViewItem( parent, after )
+{
+ setMultiLinesEnabled( TRUE );
+ QString m( message );
+ type = m.startsWith( "Warning: " ) ? Warning : Error;
+ m = m.mid( m.find( ':' ) + 1 );
+ setText( 0, type == Error ? "Error" : "Warning" );
+ setText( 1, m );
+ setText( 2, QString::number( line ) );
+ setText( 3, locationString );
+ object = locationObject;
+ read = !after;
+ if ( !after ) {
+ parent->setSelected( this, TRUE );
+ parent->setCurrentItem( this );
+ }
+}
+
+void ErrorItem::paintCell( QPainter *p, const QColorGroup & cg,
+ int column, int width, int alignment )
+{
+ QColorGroup g( cg );
+ g.setColor( QColorGroup::Text, type == Error ? Qt::red : Qt::darkYellow );
+ if ( !read ) {
+ QFont f( p->font() );
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+ QListViewItem::paintCell( p, g, column, width, alignment );
+}
diff --git a/kdevdesigner/designer/outputwindow.h b/kdevdesigner/designer/outputwindow.h
new file mode 100644
index 00000000..e61c92c0
--- /dev/null
+++ b/kdevdesigner/designer/outputwindow.h
@@ -0,0 +1,98 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef OUTPUTWINDOW_H
+#define OUTPUTWINDOW_H
+
+#include <qtabwidget.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include <qlistview.h>
+
+struct DesignerOutputDock;
+class QTextEdit;
+class QListView;
+
+class ErrorItem : public QListViewItem
+{
+public:
+ enum Type { Error, Warning };
+
+ ErrorItem( QListView *parent, QListViewItem *after, const QString &message, int line,
+ const QString &locationString, QObject *locationObject );
+
+ void paintCell( QPainter *, const QColorGroup & cg,
+ int column, int width, int alignment );
+
+ void setRead( bool b ) { read = b; repaint(); }
+
+ QObject *location() const { return object; }
+ int line() const { return text( 2 ).toInt(); }
+
+private:
+ QObject *object;
+ Type type;
+ bool read;
+
+};
+
+class OutputWindow : public QTabWidget
+{
+ Q_OBJECT
+
+public:
+ OutputWindow( QWidget *parent );
+ ~OutputWindow();
+
+ void setErrorMessages( const QStringList &errors, const QValueList<uint> &lines,
+ bool clear, const QStringList &locations,
+ const QObjectList &locationObjects );
+ void appendDebug( const QString& );
+ void clearErrorMessages();
+ void clearDebug();
+ void showDebugTab();
+
+ DesignerOutputDock *iFace();
+
+ void shuttingDown();
+
+ static QtMsgHandler oldMsgHandler;
+
+private slots:
+ void currentErrorChanged( QListViewItem *i );
+
+private:
+ void setupError();
+ void setupDebug();
+
+ QTextEdit *debugView;
+ QListView *errorView;
+
+ DesignerOutputDock *iface;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/paletteeditor.ui b/kdevdesigner/designer/paletteeditor.ui
new file mode 100644
index 00000000..8a87f0ea
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditor.ui
@@ -0,0 +1,496 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PaletteEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PaletteEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>449</width>
+ <height>443</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Edit Palette</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupAutoPalette</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Build Palette</string>
+ </property>
+ <property name="alignment">
+ <set>AlignAuto</set>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelMainColor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>&amp;3-D effects:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignAuto|AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonMainColor</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the effect-color for the generated palette.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelMainColor2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string>Back&amp;ground:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignAuto|AlignVCenter</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonMainColor2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the background color for the generated palette.</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>btnAdvanced</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Tune Palette...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox126</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Preview</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Select &amp;palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="PreviewFrame">
+ <property name="name">
+ <cstring>previewFrame</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing11</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>"image0"</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+ <customwidget>
+ <class>PreviewFrame</class>
+ <header location="local">previewframe.h</header>
+ <sizehint>
+ <width>200</width>
+ <height>200</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>"image1"</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonMainColor2</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChoose2ndMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>btnAdvanced</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onTune()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor</sender>
+ <signal>changed()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChooseMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChooseMainColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonMainColor2</sender>
+ <signal>changed()</signal>
+ <receiver>PaletteEditorBase</receiver>
+ <slot>onChoose2ndMainColor()</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">onTune()</slot>
+ <slot access="protected" language="C++" returnType="void">onChoose2ndMainColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseMainColor()</slot>
+ <slot access="protected" language="C++" returnType="void">paletteSelected(int)</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>buttonMainColor</tabstop>
+ <tabstop>buttonMainColor2</tabstop>
+ <tabstop>btnAdvanced</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/kdevdesigner/designer/paletteeditoradvanced.ui b/kdevdesigner/designer/paletteeditoradvanced.ui
new file mode 100644
index 00000000..faa211c1
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditoradvanced.ui
@@ -0,0 +1,748 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PaletteEditorAdvancedBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PaletteEditorAdvancedBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>327</width>
+ <height>341</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tune Palette</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Edit Palette&lt;/b&gt;&lt;p&gt;Change the current widget or form's palette.&lt;/p&gt;&lt;p&gt;Use a generated palette or select colors for each color group and each color role.&lt;/p&gt;&lt;p&gt;The palette can be tested with different widget layouts in the preview section.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="text">
+ <string>Select &amp;palette:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Auto</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBuildInactive</cstring>
+ </property>
+ <property name="text">
+ <string>Build the &amp;inactive palette from the active palette</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBuildDisabled</cstring>
+ </property>
+ <property name="text">
+ <string>Build the &amp;disabled palette from the active palette</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupCentral</cstring>
+ </property>
+ <property name="title">
+ <string>Central Color Roles</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Background</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Foreground</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Base</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BrightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ButtonText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Highlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>HighlightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Link</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LinkVisited</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboCentral</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose the central color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central color roles are: &lt;ul&gt; &lt;li&gt;Background - general background color.&lt;/li&gt; &lt;li&gt;Foreground - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as the background color for example, for text entry widgets; it is usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the forground color used with Base. Usually this is the same as the Foreground, in which case it must provide good contrast both with the Background and with the Base. &lt;/li&gt; &lt;li&gt;Button - general button background color; useful where buttons need a background different from Background, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color used to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from Foreground and contrasts well with, for example, black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing1</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>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Choose pi&amp;xmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file for the selected central color role.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&amp;Select color:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonCentral</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonCentral</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected central color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupEffect</cstring>
+ </property>
+ <property name="title">
+ <string>3-D Shadow Effects</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout32_3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBuildEffect</cstring>
+ </property>
+ <property name="text">
+ <string>Build &amp;from button color:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Generate shadings</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to let 3D-effect colors be calculated from the button-color.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Light</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Midlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mid</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dark</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shadow</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>comboEffect</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose 3D-effect color role</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a color effect role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout31_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing3</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>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Select co&amp;lor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>buttonEffect</cstring>
+ </property>
+ </widget>
+ <widget class="StyledButton">
+ <property name="name">
+ <cstring>buttonEffect</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a color for the selected effect color role.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal_Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ </sizepolicy>
+ <pixmap>"image0"</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>paletteCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>paletteSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>comboCentral</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onCentral(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChoosePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCentral</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseCentralColor()</slot>
+ </connection>
+ <connection>
+ <sender>buttonEffect</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onChooseEffectColor()</slot>
+ </connection>
+ <connection>
+ <sender>comboEffect</sender>
+ <signal>activated(int)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onEffect(int)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildEffects(bool)</slot>
+ </connection>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>showHelp()</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildInactive</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildInactive(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBuildDisabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>PaletteEditorAdvancedBase</receiver>
+ <slot>onToggleBuildDisabled(bool)</slot>
+ </connection>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildDisabled(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onCentral(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseCentralColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChooseEffectColor()</slot>
+ <slot access="protected" language="C++" returnType="void">onChoosePixmap()</slot>
+ <slot access="protected" language="C++" returnType="void">onEffect(int)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildEffects(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">onToggleBuildInactive(bool)</slot>
+ <slot access="protected" language="C++" returnType="void">paletteSelected(int)</slot>
+ <slot access="public" language="C++" returnType="void">showHelp()</slot>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>paletteCombo</tabstop>
+ <tabstop>checkBuildInactive</tabstop>
+ <tabstop>checkBuildDisabled</tabstop>
+ <tabstop>comboCentral</tabstop>
+ <tabstop>buttonPixmap</tabstop>
+ <tabstop>buttonCentral</tabstop>
+ <tabstop>checkBuildEffect</tabstop>
+ <tabstop>comboEffect</tabstop>
+ <tabstop>buttonEffect</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+</UI>
diff --git a/kdevdesigner/designer/paletteeditoradvancedimpl.cpp b/kdevdesigner/designer/paletteeditoradvancedimpl.cpp
new file mode 100644
index 00000000..8faebba4
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditoradvancedimpl.cpp
@@ -0,0 +1,643 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "paletteeditoradvancedimpl.h"
+#include "styledbutton.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qapplication.h>
+#include <qpushbutton.h>
+#include <qlistbox.h>
+#include <qpainter.h>
+#include <qgroupbox.h>
+
+/*!
+ Class used by PaletteEditor for bold combobox items
+*/
+
+class BoldListBoxText : public QListBoxText
+{
+public:
+ BoldListBoxText( QString text, QListBox* lb = 0 );
+
+protected:
+ virtual void paint( QPainter* );
+};
+
+BoldListBoxText::BoldListBoxText( QString text, QListBox* lb )
+ : QListBoxText( lb )
+{
+ setText( text );
+}
+
+void BoldListBoxText::paint( QPainter* painter )
+{
+ QFont f = painter->font();
+ f.setBold( TRUE );
+ painter->setFont( f );
+
+ QListBoxText::paint( painter );
+}
+
+PaletteEditorAdvanced::PaletteEditorAdvanced( FormWindow *fw, QWidget * parent,
+ const char * name, bool modal, WFlags f )
+ : PaletteEditorAdvancedBase( parent, name, modal, f ), formWindow( fw ), selectedPalette(0)
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+
+ buttonPixmap->setEditor( StyledButton::PixmapEditor );
+
+ editPalette = QApplication::palette();
+ setPreviewPalette( editPalette );
+
+ buttonPixmap->setFormWindow( formWindow );
+
+ // force toggle event
+ checkBuildEffect->setChecked(FALSE);
+ checkBuildEffect->setChecked(TRUE);
+}
+
+PaletteEditorAdvanced::~PaletteEditorAdvanced()
+{
+}
+
+void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
+{
+ if (selectedPalette == 1) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildInactive();
+ updateStyledButtons();
+ }
+}
+
+void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
+{
+ if (selectedPalette == 2) {
+ groupCentral->setDisabled(v);
+ groupEffect->setDisabled(v);
+ }
+
+ if (v) {
+ buildDisabled();
+ updateStyledButtons();
+ }
+}
+
+void PaletteEditorAdvanced::paletteSelected(int p)
+{
+ selectedPalette = p;
+
+ if(p == 1) { // inactive
+ groupCentral->setDisabled(checkBuildInactive->isChecked());
+ groupEffect->setDisabled(checkBuildInactive->isChecked());
+ }
+ else if (p == 2) { // disabled
+ groupCentral->setDisabled(checkBuildDisabled->isChecked());
+ groupEffect->setDisabled(checkBuildDisabled->isChecked());
+ }
+ else {
+ groupCentral->setEnabled(TRUE);
+ groupEffect->setEnabled(TRUE);
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChooseCentralColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveCentralRole( buttonCentral->color() );
+ break;
+ case 1:
+ mapToInactiveCentralRole( buttonCentral->color() );
+ break;
+ case 2:
+ mapToDisabledCentralRole( buttonCentral->color() );
+ break;
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChooseEffectColor()
+{
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActiveEffectRole( buttonEffect->color() );
+ break;
+ case 1:
+ mapToInactiveEffectRole( buttonEffect->color() );
+ break;
+ case 2:
+ mapToDisabledEffectRole( buttonEffect->color() );
+ break;
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onChoosePixmap()
+{
+ if (buttonPixmap->pixmap()) {
+ switch(selectedPalette) {
+ case 0:
+ default:
+ mapToActivePixmapRole( *buttonPixmap->pixmap() );
+ break;
+ case 1:
+ mapToInactivePixmapRole( *buttonPixmap->pixmap() );
+ break;
+ case 2:
+ mapToDisabledPixmapRole( *buttonPixmap->pixmap() );
+ break;
+ }
+ }
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::onToggleBuildEffects( bool on )
+{
+ if (!on) return;
+ buildActiveEffect();
+ buildInactiveEffect();
+ buildDisabledEffect();
+}
+
+QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return QColorGroup::Background;
+ case 1:
+ return QColorGroup::Foreground;
+ case 2:
+ return QColorGroup::Button;
+ case 3:
+ return QColorGroup::Base;
+ case 4:
+ return QColorGroup::Text;
+ case 5:
+ return QColorGroup::BrightText;
+ case 6:
+ return QColorGroup::ButtonText;
+ case 7:
+ return QColorGroup::Highlight;
+ case 8:
+ return QColorGroup::HighlightedText;
+ case 9:
+ return QColorGroup::Link;
+ case 10:
+ return QColorGroup::LinkVisited;
+ default:
+ return QColorGroup::NColorRoles;
+ }
+}
+
+QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
+{
+ switch( item ) {
+ case 0:
+ return QColorGroup::Light;
+ case 1:
+ return QColorGroup::Midlight;
+ case 2:
+ return QColorGroup::Mid;
+ case 3:
+ return QColorGroup::Dark;
+ case 4:
+ return QColorGroup::Shadow;
+ default:
+ return QColorGroup::NColorRoles;
+ }
+}
+
+void PaletteEditorAdvanced::onCentral( int item )
+{
+ QPixmap* p = 0;
+ QColor c;
+
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( centralFromItem(item) );
+ p = editPalette.active().brush( centralFromItem(item) ).pixmap();
+ break;
+ case 1:
+ c = editPalette.inactive().color( centralFromItem(item) );
+ p = editPalette.inactive().brush( centralFromItem(item) ).pixmap();
+ break;
+ case 2:
+ c = editPalette.disabled().color( centralFromItem(item) );
+ p = editPalette.disabled().brush( centralFromItem(item) ).pixmap();
+ break;
+ }
+
+ buttonCentral->setColor(c);
+
+ if (p)
+ buttonPixmap->setPixmap( *p );
+ else
+ buttonPixmap->setPixmap( QPixmap() );
+}
+
+void PaletteEditorAdvanced::onEffect( int item )
+{
+ QColor c;
+ switch(selectedPalette) {
+ case 0:
+ default:
+ c = editPalette.active().color( effectFromItem(item) );
+ break;
+ case 1:
+ editPalette.inactive().color( effectFromItem(item) );
+ break;
+ case 2:
+ editPalette.disabled().color( effectFromItem(item) );
+ break;
+ }
+ buttonEffect->setColor(c);
+}
+
+void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.active();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setActive( cg );
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.active();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setActive( cg );
+
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm )
+{
+ QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ QColorGroup cg = editPalette.active();
+ if ( !pm.isNull() )
+ cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, QBrush( cg.color( role ) ) );
+ editPalette.setActive( cg );
+
+
+ buildActiveEffect();
+ if(checkBuildInactive->isChecked())
+ buildInactive();
+ if(checkBuildDisabled->isChecked())
+ buildDisabled();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.inactive();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ buildInactiveEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.inactive();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm )
+{
+ QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ QColorGroup cg = editPalette.inactive();
+ if ( !pm.isNull() )
+ cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, QBrush( cg.color( role ) ) );
+ editPalette.setInactive( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.disabled();
+ cg.setColor( centralFromItem(comboCentral->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c )
+{
+ QColorGroup cg = editPalette.disabled();
+ cg.setColor( effectFromItem(comboEffect->currentItem()), c );
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm )
+{
+ QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ QColorGroup cg = editPalette.disabled();
+ if ( !pm.isNull() )
+ cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ else
+ cg.setBrush( role, QBrush( cg.color( role ) ) );
+
+ editPalette.setDisabled( cg );
+
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditorAdvanced::buildActiveEffect()
+{
+ QColorGroup cg = editPalette.active();
+ QColor btn = cg.color( QColorGroup::Button );
+
+ QPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ buildInactiveEffect();
+}
+
+void PaletteEditorAdvanced::buildInactiveEffect()
+{
+ QColorGroup cg = editPalette.inactive();
+
+ QColor light, midlight, mid, dark, shadow;
+ QColor btn = cg.color( QColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = black;
+
+ cg.setColor( QColorGroup::Light, light );
+ cg.setColor( QColorGroup::Midlight, midlight );
+ cg.setColor( QColorGroup::Mid, mid );
+ cg.setColor( QColorGroup::Dark, dark );
+ cg.setColor( QColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::buildDisabled()
+{
+ QColorGroup cg = editPalette.active();
+ cg.setColor( QColorGroup::ButtonText, darkGray );
+ cg.setColor( QColorGroup::Foreground, darkGray );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+}
+
+void PaletteEditorAdvanced::buildDisabledEffect()
+{
+ QColorGroup cg = editPalette.disabled();
+
+ QColor light, midlight, mid, dark, shadow;
+ QColor btn = cg.color( QColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = black;
+
+ cg.setColor( QColorGroup::Light, light );
+ cg.setColor( QColorGroup::Midlight, midlight );
+ cg.setColor( QColorGroup::Mid, mid );
+ cg.setColor( QColorGroup::Dark, dark );
+ cg.setColor( QColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal )
+{
+ QColorGroup cg;
+
+ switch (selectedPalette) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+}
+
+void PaletteEditorAdvanced::updateStyledButtons()
+{
+ QColor central, effect;
+ QPixmap *pm = 0;
+ switch (selectedPalette) {
+ case 0:
+ default:
+ central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.active().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ case 1:
+ central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.inactive().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ case 2:
+ central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) );
+ effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) );
+ pm = editPalette.disabled().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap();
+ break;
+ }
+
+ buttonCentral->setColor(central);
+ buttonEffect->setColor(effect);
+ if ( pm && !pm->isNull() )
+ buttonPixmap->setPixmap( *pm );
+ else
+ buttonPixmap->setPixmap(QPixmap());
+}
+
+void PaletteEditorAdvanced::setPal( const QPalette& pal )
+{
+ editPalette = pal;
+ setPreviewPalette( pal );
+ updateStyledButtons();
+}
+
+QPalette PaletteEditorAdvanced::pal() const
+{
+ return editPalette;
+}
+
+void PaletteEditorAdvanced::setupBackgroundMode( BackgroundMode mode )
+{
+ int initRole = 0;
+
+ switch( mode ) {
+ case PaletteBackground:
+ initRole = 0;
+ break;
+ case PaletteForeground:
+ initRole = 1;
+ break;
+ case PaletteButton:
+ initRole = 2;
+ break;
+ case PaletteBase:
+ initRole = 3;
+ break;
+ case PaletteText:
+ initRole = 4;
+ break;
+ case PaletteBrightText:
+ initRole = 5;
+ break;
+ case PaletteButtonText:
+ initRole = 6;
+ break;
+ case PaletteHighlight:
+ initRole = 7;
+ break;
+ case PaletteHighlightedText:
+ initRole = 8;
+ break;
+ case PaletteLight:
+ initRole = 9;
+ break;
+ case PaletteMidlight:
+ initRole = 10;
+ break;
+ case PaletteDark:
+ initRole = 11;
+ break;
+ case PaletteMid:
+ initRole = 12;
+ break;
+ case PaletteShadow:
+ initRole = 13;
+ break;
+ default:
+ initRole = -1;
+ break;
+ }
+
+ if ( initRole <= -1 ) return;
+
+ if (initRole > 8 ) {
+ comboEffect->setCurrentItem( initRole - 9 );
+ if ( comboEffect->listBox() ) {
+ QString text = comboEffect->currentText();
+ comboEffect->listBox()->changeItem( new BoldListBoxText( text ), initRole - 9 );
+ }
+ }
+ else {
+ comboCentral->setCurrentItem( initRole );
+ if ( comboCentral->listBox() ) {
+ QString text = comboCentral->currentText();
+ comboCentral->listBox()->changeItem( new BoldListBoxText( text ), initRole );
+ }
+ }
+}
+
+QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init,
+ BackgroundMode mode, QWidget* parent,
+ const char* name, FormWindow *fw )
+{
+ PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( fw, parent, name, TRUE );
+ dlg->setupBackgroundMode( mode );
+
+ if ( init != QPalette() )
+ dlg->setPal( init );
+ int resultCode = dlg->exec();
+
+ QPalette result = init;
+ if ( resultCode == QDialog::Accepted ) {
+ if ( ok )
+ *ok = TRUE;
+ result = dlg->pal();
+ } else {
+ if ( ok )
+ *ok = FALSE;
+ }
+ delete dlg;
+ return result;
+}
diff --git a/kdevdesigner/designer/paletteeditoradvancedimpl.h b/kdevdesigner/designer/paletteeditoradvancedimpl.h
new file mode 100644
index 00000000..4f7076df
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditoradvancedimpl.h
@@ -0,0 +1,96 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PALETTEEDITORADVANCEDIMPL_H
+#define PALETTEEDITORADVANCEDIMPL_H
+
+#include "paletteeditoradvanced.h"
+
+class FormWindow;
+
+class PaletteEditorAdvanced : public PaletteEditorAdvancedBase
+{
+ Q_OBJECT
+public:
+ PaletteEditorAdvanced( FormWindow *fw, QWidget * parent=0, const char * name=0,
+ bool modal=FALSE, WFlags f=0 );
+ ~PaletteEditorAdvanced();
+
+ static QPalette getPalette( bool *ok, const QPalette &pal, BackgroundMode mode = PaletteBackground,
+ QWidget* parent = 0, const char* name = 0, FormWindow *fw = 0 );
+
+protected slots:
+ void paletteSelected(int);
+
+ void onCentral( int );
+ void onEffect( int );
+
+ void onChooseCentralColor();
+ void onChooseEffectColor();
+ void onChoosePixmap();
+
+ void onToggleBuildEffects( bool );
+ void onToggleBuildInactive( bool );
+ void onToggleBuildDisabled( bool );
+
+protected:
+ void mapToActiveCentralRole( const QColor& );
+ void mapToActiveEffectRole( const QColor& );
+ void mapToActivePixmapRole( const QPixmap& );
+ void mapToInactiveCentralRole( const QColor& );
+ void mapToInactiveEffectRole( const QColor& );
+ void mapToInactivePixmapRole( const QPixmap& );
+ void mapToDisabledCentralRole( const QColor& );
+ void mapToDisabledEffectRole( const QColor& );
+ void mapToDisabledPixmapRole( const QPixmap& );
+
+
+ void buildPalette();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+private:
+ void setPreviewPalette( const QPalette& );
+ void updateStyledButtons();
+ void setupBackgroundMode( BackgroundMode );
+
+ QPalette pal() const;
+ void setPal( const QPalette& );
+
+ QColorGroup::ColorRole centralFromItem( int );
+ QColorGroup::ColorRole effectFromItem( int );
+ QPalette editPalette;
+ QPalette previewPalette;
+
+ FormWindow *formWindow;
+
+ int selectedPalette;
+};
+
+#endif
diff --git a/kdevdesigner/designer/paletteeditorimpl.cpp b/kdevdesigner/designer/paletteeditorimpl.cpp
new file mode 100644
index 00000000..56e6fd2f
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditorimpl.cpp
@@ -0,0 +1,304 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "paletteeditorimpl.h"
+#include "paletteeditoradvancedimpl.h"
+#include "previewframe.h"
+#include "styledbutton.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qapplication.h>
+#include <qpushbutton.h>
+
+PaletteEditor::PaletteEditor( FormWindow *fw, QWidget * parent, const char * name, bool modal, WFlags f )
+ : PaletteEditorBase( parent, name, modal, f ), formWindow( fw )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+
+ editPalette = QApplication::palette();
+ setPreviewPalette( editPalette );
+
+ buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button ) );
+ buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Background ) );
+}
+
+PaletteEditor::~PaletteEditor()
+{
+}
+
+void PaletteEditor::onTune()
+{
+ bool ok;
+ QPalette pal = PaletteEditorAdvanced::getPalette( &ok, editPalette, backgroundMode, this, "tune_palette", formWindow);
+ if (!ok) return;
+
+ editPalette = pal;
+ setPreviewPalette( editPalette );
+}
+
+void PaletteEditor::onChooseMainColor()
+{
+ buildPalette();
+}
+
+void PaletteEditor::onChoose2ndMainColor()
+{
+ buildPalette();
+}
+
+void PaletteEditor::paletteSelected(int)
+{
+ setPreviewPalette(editPalette);
+}
+
+QColorGroup::ColorRole PaletteEditor::centralFromItem( int item )
+{
+ switch( item )
+ {
+ case 0:
+ return QColorGroup::Background;
+ case 1:
+ return QColorGroup::Foreground;
+ case 2:
+ return QColorGroup::Button;
+ case 3:
+ return QColorGroup::Base;
+ case 4:
+ return QColorGroup::Text;
+ case 5:
+ return QColorGroup::BrightText;
+ case 6:
+ return QColorGroup::ButtonText;
+ case 7:
+ return QColorGroup::Highlight;
+ case 8:
+ return QColorGroup::HighlightedText;
+ default:
+ return QColorGroup::NColorRoles;
+ }
+}
+
+QColorGroup::ColorRole PaletteEditor::effectFromItem( int item )
+{
+ switch( item )
+ {
+ case 0:
+ return QColorGroup::Light;
+ case 1:
+ return QColorGroup::Midlight;
+ case 2:
+ return QColorGroup::Mid;
+ case 3:
+ return QColorGroup::Dark;
+ case 4:
+ return QColorGroup::Shadow;
+ default:
+ return QColorGroup::NColorRoles;
+ }
+}
+
+void PaletteEditor::buildPalette()
+{
+ int i;
+ QColorGroup cg;
+ QColor btn = buttonMainColor->color();
+ QColor back = buttonMainColor2->color();
+ QPalette automake( btn, back );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ buildActiveEffect();
+
+ cg = editPalette.inactive();
+
+ QPalette temp( editPalette.active().color( QColorGroup::Button ),
+ editPalette.active().color( QColorGroup::Background ) );
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) );
+
+ editPalette.setInactive( cg );
+ buildInactiveEffect();
+
+ cg = editPalette.disabled();
+
+ for (i = 0; i<9; i++)
+ cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) );
+
+ editPalette.setDisabled( cg );
+ buildDisabledEffect();
+
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildActiveEffect()
+{
+ QColorGroup cg = editPalette.active();
+ QColor btn = cg.color( QColorGroup::Button );
+
+ QPalette temp( btn, btn );
+
+ for (int i = 0; i<5; i++)
+ cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
+
+ editPalette.setActive( cg );
+ setPreviewPalette( editPalette );
+
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildInactive()
+{
+ editPalette.setInactive( editPalette.active() );
+ buildInactiveEffect();
+}
+
+void PaletteEditor::buildInactiveEffect()
+{
+ QColorGroup cg = editPalette.inactive();
+
+ QColor light, midlight, mid, dark, shadow;
+ QColor btn = cg.color( QColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = black;
+
+ cg.setColor( QColorGroup::Light, light );
+ cg.setColor( QColorGroup::Midlight, midlight );
+ cg.setColor( QColorGroup::Mid, mid );
+ cg.setColor( QColorGroup::Dark, dark );
+ cg.setColor( QColorGroup::Shadow, shadow );
+
+ editPalette.setInactive( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditor::buildDisabled()
+{
+ QColorGroup cg = editPalette.active();
+ cg.setColor( QColorGroup::ButtonText, darkGray );
+ cg.setColor( QColorGroup::Foreground, darkGray );
+ editPalette.setDisabled( cg );
+
+ buildDisabledEffect();
+}
+
+void PaletteEditor::buildDisabledEffect()
+{
+ QColorGroup cg = editPalette.disabled();
+
+ QColor light, midlight, mid, dark, shadow;
+ QColor btn = cg.color( QColorGroup::Button );
+
+ light = btn.light(150);
+ midlight = btn.light(115);
+ mid = btn.dark(150);
+ dark = btn.dark();
+ shadow = black;
+
+ cg.setColor( QColorGroup::Light, light );
+ cg.setColor( QColorGroup::Midlight, midlight );
+ cg.setColor( QColorGroup::Mid, mid );
+ cg.setColor( QColorGroup::Dark, dark );
+ cg.setColor( QColorGroup::Shadow, shadow );
+
+ editPalette.setDisabled( cg );
+ setPreviewPalette( editPalette );
+ updateStyledButtons();
+}
+
+void PaletteEditor::setPreviewPalette( const QPalette& pal )
+{
+ QColorGroup cg;
+
+ switch (paletteCombo->currentItem()) {
+ case 0:
+ default:
+ cg = pal.active();
+ break;
+ case 1:
+ cg = pal.inactive();
+ break;
+ case 2:
+ cg = pal.disabled();
+ break;
+ }
+ previewPalette.setActive( cg );
+ previewPalette.setInactive( cg );
+ previewPalette.setDisabled( cg );
+
+ previewFrame->setPreviewPalette(previewPalette);
+}
+
+void PaletteEditor::updateStyledButtons()
+{
+ buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button ));
+ buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Background ));
+}
+
+void PaletteEditor::setPal( const QPalette& pal )
+{
+ editPalette = pal;
+ setPreviewPalette( pal );
+ updateStyledButtons();
+}
+
+QPalette PaletteEditor::pal() const
+{
+ return editPalette;
+}
+
+QPalette PaletteEditor::getPalette( bool *ok, const QPalette &init, BackgroundMode mode,
+ QWidget* parent, const char* name, FormWindow *fw )
+{
+ PaletteEditor* dlg = new PaletteEditor( fw, parent, name, TRUE );
+ dlg->setupBackgroundMode( mode );
+
+ if ( init != QPalette() )
+ dlg->setPal( init );
+ int resultCode = dlg->exec();
+
+ QPalette result = init;
+ if ( resultCode == QDialog::Accepted ) {
+ if ( ok )
+ *ok = TRUE;
+ result = dlg->pal();
+ } else {
+ if ( ok )
+ *ok = FALSE;
+ }
+ delete dlg;
+ return result;
+}
diff --git a/kdevdesigner/designer/paletteeditorimpl.h b/kdevdesigner/designer/paletteeditorimpl.h
new file mode 100644
index 00000000..fc3ee231
--- /dev/null
+++ b/kdevdesigner/designer/paletteeditorimpl.h
@@ -0,0 +1,76 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PALETTEEDITORIMPL_H
+#define PALETTEEDITORIMPL_H
+
+#include "paletteeditor.h"
+
+class FormWindow;
+
+class PaletteEditor : public PaletteEditorBase
+{
+ Q_OBJECT
+
+public:
+ PaletteEditor( FormWindow *fw, QWidget * parent=0, const char * name=0, bool modal=FALSE, WFlags f=0 );
+ ~PaletteEditor();
+
+ static QPalette getPalette( bool *ok, const QPalette &pal, BackgroundMode mode = PaletteBackground,
+ QWidget* parent = 0, const char* name = 0, FormWindow *fw = 0 );
+
+protected slots:
+ void onChooseMainColor();
+ void onChoose2ndMainColor();
+ void onTune();
+ void paletteSelected(int);
+
+protected:
+ void buildPalette();
+ void buildActiveEffect();
+ void buildInactive();
+ void buildInactiveEffect();
+ void buildDisabled();
+ void buildDisabledEffect();
+
+private:
+ void setPreviewPalette( const QPalette& );
+ void updateStyledButtons();
+ void setupBackgroundMode( BackgroundMode mode ) { backgroundMode = mode; }
+
+ QPalette pal() const;
+ void setPal( const QPalette& );
+
+ QColorGroup::ColorRole centralFromItem( int );
+ QColorGroup::ColorRole effectFromItem( int );
+ QPalette editPalette;
+ QPalette previewPalette;
+
+ FormWindow *formWindow;
+ BackgroundMode backgroundMode;
+};
+
+#endif
diff --git a/kdevdesigner/designer/pics/Makefile.am b/kdevdesigner/designer/pics/Makefile.am
new file mode 100644
index 00000000..8749186b
--- /dev/null
+++ b/kdevdesigner/designer/pics/Makefile.am
@@ -0,0 +1,2 @@
+picsdirdir = $(kde_datadir)/kdevdesignerpart/pics
+picsdir_DATA = designer_adjustsize.png designer_appicon.png designer_arrow.png designer_background.png designer_book.png designer_buttongroup.png designer_checkbox.png designer_combobox.png designer_connecttool.png designer_cross.png designer_customwidget.png designer_d_adjustsize.png designer_d_book.png designer_d_buttongroup.png designer_d_checkbox.png designer_d_combobox.png designer_d_connecttool.png designer_d_customwidget.png designer_d_databrowser.png designer_d_datatable.png designer_d_dataview.png designer_d_dateedit.png designer_d_datetimeedit.png designer_d_dial.png designer_d_down.png designer_d_editbreaklayout.png designer_d_editcopy.png designer_d_editcut.png designer_d_editdelete.png designer_d_editgrid.png designer_d_edithlayout.png designer_d_edithlayoutsplit.png designer_d_editlower.png designer_d_editpaste.png designer_d_editraise.png designer_d_editslots.png designer_d_editvlayout.png designer_d_editvlayoutsplit.png designer_d_filenew.png designer_d_fileopen.png designer_d_filesave.png designer_d_folder.png designer_d_form.png designer_d_frame.png designer_d_groupbox.png designer_d_help.png designer_d_home.png designer_d_iconview.png designer_d_image.png designer_d_label.png designer_d_layout.png designer_d_lcdnumber.png designer_d_left.png designer_d_line.png designer_d_lineedit.png designer_d_listbox.png designer_d_listview.png designer_d_multilineedit.png designer_d_newform.png designer_d_ordertool.png designer_d_pixlabel.png designer_d_pointer.png designer_d_print.png designer_d_progress.png designer_d_project.png designer_d_pushbutton.png designer_d_radiobutton.png designer_d_redo.png designer_d_richtextedit.png designer_d_right.png designer_d_scrollbar.png designer_d_searchfind.png designer_d_setbuddy.png designer_d_slider.png designer_d_spacer.png designer_d_spinbox.png designer_d_table.png designer_d_tabwidget.png designer_d_textbold.png designer_d_textbrowser.png designer_d_textcenter.png designer_d_textedit.png designer_d_textfont.png designer_d_texth1.png designer_d_texth2.png designer_d_texth3.png designer_d_textitalic.png designer_d_textjustify.png designer_d_textlarger.png designer_d_textleft.png designer_d_textlinebreak.png designer_d_textparagraph.png designer_d_textright.png designer_d_textsmaller.png designer_d_textteletext.png designer_d_textunderline.png designer_d_textview.png designer_d_timeedit.png designer_d_toolbox.png designer_d_toolbutton.png designer_d_undo.png designer_d_up.png designer_d_widgetstack.png designer_d_wizarddata.png designer_d_wizarddialog.png designer_d_wordwrap.png designer_databrowser.png designer_datatable.png designer_dataview.png designer_dateedit.png designer_datetimeedit.png designer_dial.png designer_down.png designer_editbreaklayout.png designer_editcopy.png designer_editcut.png designer_editdelete.png designer_editgrid.png designer_edithlayout.png designer_edithlayoutsplit.png designer_editlower.png designer_editpaste.png designer_editraise.png designer_editslots.png designer_editvlayout.png designer_editvlayoutsplit.png designer_filenew.png designer_fileopen.png designer_filesave.png designer_folder.png designer_form.png designer_frame.png designer_groupbox.png designer_hand.png designer_help.png designer_home.png designer_hsplit.png designer_ibeam.png designer_iconview.png designer_image.png designer_label.png designer_layout.png designer_lcdnumber.png designer_left.png designer_line.png designer_lineedit.png designer_listbox.png designer_listview.png designer_multilineedit.png designer_newform.png designer_no.png designer_object.png designer_ordertool.png designer_pixlabel.png designer_pointer.png designer_print.png designer_progress.png designer_project.png designer_pushbutton.png designer_qtlogo.png designer_radiobutton.png designer_redo.png designer_resetproperty.png designer_richtextedit.png designer_right.png designer_s_down.png designer_s_editcut.png designer_s_left.png designer_s_right.png designer_s_up.png designer_scrollbar.png designer_searchfind.png designer_setbuddy.png designer_sizeall.png designer_sizeb.png designer_sizef.png designer_sizeh.png designer_sizev.png designer_slider.png designer_spacer.png designer_spinbox.png designer_splash.png designer_table.png designer_tabwidget.png designer_textbold.png designer_textbrowser.png designer_textcenter.png designer_textedit.png designer_textfont.png designer_texth1.png designer_texth2.png designer_texth3.png designer_textitalic.png designer_textjustify.png designer_textlarger.png designer_textleft.png designer_textlinebreak.png designer_textparagraph.png designer_textright.png designer_textsmaller.png designer_textteletext.png designer_textunderline.png designer_textview.png designer_timeedit.png designer_toolbox.png designer_toolbutton.png designer_undo.png designer_up.png designer_uparrow.png designer_vsplit.png designer_wait.png designer_widgetstack.png designer_wizarddata.png designer_wizarddialog.png designer_wordwrap.png
diff --git a/kdevdesigner/designer/pics/designer_adjustsize.png b/kdevdesigner/designer/pics/designer_adjustsize.png
new file mode 100644
index 00000000..6ade1e22
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_adjustsize.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_appicon.png b/kdevdesigner/designer/pics/designer_appicon.png
new file mode 100644
index 00000000..7aadcbad
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_appicon.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_arrow.png b/kdevdesigner/designer/pics/designer_arrow.png
new file mode 100644
index 00000000..53921d83
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_arrow.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_background.png b/kdevdesigner/designer/pics/designer_background.png
new file mode 100644
index 00000000..27d2e997
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_background.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_book.png b/kdevdesigner/designer/pics/designer_book.png
new file mode 100644
index 00000000..dd850abb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_book.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_buttongroup.png b/kdevdesigner/designer/pics/designer_buttongroup.png
new file mode 100644
index 00000000..d89e28fd
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_buttongroup.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_checkbox.png b/kdevdesigner/designer/pics/designer_checkbox.png
new file mode 100644
index 00000000..ab6f53e0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_checkbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_combobox.png b/kdevdesigner/designer/pics/designer_combobox.png
new file mode 100644
index 00000000..7d4890a7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_combobox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_connecttool.png b/kdevdesigner/designer/pics/designer_connecttool.png
new file mode 100644
index 00000000..fca6748f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_connecttool.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_cross.png b/kdevdesigner/designer/pics/designer_cross.png
new file mode 100644
index 00000000..d5e9f0c7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_cross.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_customwidget.png b/kdevdesigner/designer/pics/designer_customwidget.png
new file mode 100644
index 00000000..ab790e1f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_customwidget.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_adjustsize.png b/kdevdesigner/designer/pics/designer_d_adjustsize.png
new file mode 100644
index 00000000..d61ca7af
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_adjustsize.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_book.png b/kdevdesigner/designer/pics/designer_d_book.png
new file mode 100644
index 00000000..5517f0c4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_book.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_buttongroup.png b/kdevdesigner/designer/pics/designer_d_buttongroup.png
new file mode 100644
index 00000000..1e451a88
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_buttongroup.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_checkbox.png b/kdevdesigner/designer/pics/designer_d_checkbox.png
new file mode 100644
index 00000000..1415eabb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_checkbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_combobox.png b/kdevdesigner/designer/pics/designer_d_combobox.png
new file mode 100644
index 00000000..5fb44eff
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_combobox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_connecttool.png b/kdevdesigner/designer/pics/designer_d_connecttool.png
new file mode 100644
index 00000000..76a3b5f5
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_connecttool.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_customwidget.png b/kdevdesigner/designer/pics/designer_d_customwidget.png
new file mode 100644
index 00000000..5ea648fb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_customwidget.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_databrowser.png b/kdevdesigner/designer/pics/designer_d_databrowser.png
new file mode 100644
index 00000000..c1155c8c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_databrowser.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_datatable.png b/kdevdesigner/designer/pics/designer_d_datatable.png
new file mode 100644
index 00000000..7060dc3a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_datatable.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_dataview.png b/kdevdesigner/designer/pics/designer_d_dataview.png
new file mode 100644
index 00000000..c507d416
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_dataview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_dateedit.png b/kdevdesigner/designer/pics/designer_d_dateedit.png
new file mode 100644
index 00000000..162e63a8
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_dateedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_datetimeedit.png b/kdevdesigner/designer/pics/designer_d_datetimeedit.png
new file mode 100644
index 00000000..83dc2fc3
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_datetimeedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_dial.png b/kdevdesigner/designer/pics/designer_d_dial.png
new file mode 100644
index 00000000..a84869e4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_dial.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_down.png b/kdevdesigner/designer/pics/designer_d_down.png
new file mode 100644
index 00000000..57b407e4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_down.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editbreaklayout.png b/kdevdesigner/designer/pics/designer_d_editbreaklayout.png
new file mode 100644
index 00000000..2a36d67d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editbreaklayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editcopy.png b/kdevdesigner/designer/pics/designer_d_editcopy.png
new file mode 100644
index 00000000..500758d4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editcopy.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editcut.png b/kdevdesigner/designer/pics/designer_d_editcut.png
new file mode 100644
index 00000000..8d50ae0a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editcut.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editdelete.png b/kdevdesigner/designer/pics/designer_d_editdelete.png
new file mode 100644
index 00000000..f4d0f7a1
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editdelete.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editgrid.png b/kdevdesigner/designer/pics/designer_d_editgrid.png
new file mode 100644
index 00000000..ad2b87b9
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editgrid.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_edithlayout.png b/kdevdesigner/designer/pics/designer_d_edithlayout.png
new file mode 100644
index 00000000..dacaf82e
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_edithlayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_edithlayoutsplit.png b/kdevdesigner/designer/pics/designer_d_edithlayoutsplit.png
new file mode 100644
index 00000000..00a96055
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_edithlayoutsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editlower.png b/kdevdesigner/designer/pics/designer_d_editlower.png
new file mode 100644
index 00000000..a0a16b40
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editlower.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editpaste.png b/kdevdesigner/designer/pics/designer_d_editpaste.png
new file mode 100644
index 00000000..d31071e9
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editpaste.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editraise.png b/kdevdesigner/designer/pics/designer_d_editraise.png
new file mode 100644
index 00000000..5f7f04b9
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editraise.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editslots.png b/kdevdesigner/designer/pics/designer_d_editslots.png
new file mode 100644
index 00000000..cd791b43
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editslots.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editvlayout.png b/kdevdesigner/designer/pics/designer_d_editvlayout.png
new file mode 100644
index 00000000..ed202af7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editvlayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_editvlayoutsplit.png b/kdevdesigner/designer/pics/designer_d_editvlayoutsplit.png
new file mode 100644
index 00000000..54ee44c0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_editvlayoutsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_filenew.png b/kdevdesigner/designer/pics/designer_d_filenew.png
new file mode 100644
index 00000000..d5e7061b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_filenew.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_fileopen.png b/kdevdesigner/designer/pics/designer_d_fileopen.png
new file mode 100644
index 00000000..343f0039
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_fileopen.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_filesave.png b/kdevdesigner/designer/pics/designer_d_filesave.png
new file mode 100644
index 00000000..5d1476d2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_filesave.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_folder.png b/kdevdesigner/designer/pics/designer_d_folder.png
new file mode 100644
index 00000000..4bed3caf
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_folder.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_form.png b/kdevdesigner/designer/pics/designer_d_form.png
new file mode 100644
index 00000000..9f89d654
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_form.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_frame.png b/kdevdesigner/designer/pics/designer_d_frame.png
new file mode 100644
index 00000000..09b21b21
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_frame.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_groupbox.png b/kdevdesigner/designer/pics/designer_d_groupbox.png
new file mode 100644
index 00000000..e7e01083
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_groupbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_help.png b/kdevdesigner/designer/pics/designer_d_help.png
new file mode 100644
index 00000000..8f9d1826
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_help.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_home.png b/kdevdesigner/designer/pics/designer_d_home.png
new file mode 100644
index 00000000..b3906a4f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_home.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_iconview.png b/kdevdesigner/designer/pics/designer_d_iconview.png
new file mode 100644
index 00000000..a07b2b75
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_iconview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_image.png b/kdevdesigner/designer/pics/designer_d_image.png
new file mode 100644
index 00000000..f7cb29c3
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_image.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_label.png b/kdevdesigner/designer/pics/designer_d_label.png
new file mode 100644
index 00000000..bfbd5b88
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_label.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_layout.png b/kdevdesigner/designer/pics/designer_d_layout.png
new file mode 100644
index 00000000..090b4bb2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_layout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_lcdnumber.png b/kdevdesigner/designer/pics/designer_d_lcdnumber.png
new file mode 100644
index 00000000..786747e6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_lcdnumber.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_left.png b/kdevdesigner/designer/pics/designer_d_left.png
new file mode 100644
index 00000000..50d03bbe
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_left.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_line.png b/kdevdesigner/designer/pics/designer_d_line.png
new file mode 100644
index 00000000..25b0daeb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_line.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_lineedit.png b/kdevdesigner/designer/pics/designer_d_lineedit.png
new file mode 100644
index 00000000..9d34ce97
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_lineedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_listbox.png b/kdevdesigner/designer/pics/designer_d_listbox.png
new file mode 100644
index 00000000..d80c7900
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_listbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_listview.png b/kdevdesigner/designer/pics/designer_d_listview.png
new file mode 100644
index 00000000..c5d9be3e
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_listview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_multilineedit.png b/kdevdesigner/designer/pics/designer_d_multilineedit.png
new file mode 100644
index 00000000..a62e6622
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_multilineedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_newform.png b/kdevdesigner/designer/pics/designer_d_newform.png
new file mode 100644
index 00000000..ace61302
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_newform.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_ordertool.png b/kdevdesigner/designer/pics/designer_d_ordertool.png
new file mode 100644
index 00000000..61bdc7ef
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_ordertool.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_pixlabel.png b/kdevdesigner/designer/pics/designer_d_pixlabel.png
new file mode 100644
index 00000000..21e1f492
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_pixlabel.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_pointer.png b/kdevdesigner/designer/pics/designer_d_pointer.png
new file mode 100644
index 00000000..e6903eb6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_pointer.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_print.png b/kdevdesigner/designer/pics/designer_d_print.png
new file mode 100644
index 00000000..6a72a764
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_print.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_progress.png b/kdevdesigner/designer/pics/designer_d_progress.png
new file mode 100644
index 00000000..25d857a6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_progress.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_project.png b/kdevdesigner/designer/pics/designer_d_project.png
new file mode 100644
index 00000000..b265eae0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_project.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_pushbutton.png b/kdevdesigner/designer/pics/designer_d_pushbutton.png
new file mode 100644
index 00000000..635f35cb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_pushbutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_radiobutton.png b/kdevdesigner/designer/pics/designer_d_radiobutton.png
new file mode 100644
index 00000000..e86eb8c1
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_radiobutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_redo.png b/kdevdesigner/designer/pics/designer_d_redo.png
new file mode 100644
index 00000000..6e993cc6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_redo.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_richtextedit.png b/kdevdesigner/designer/pics/designer_d_richtextedit.png
new file mode 100644
index 00000000..ba7ada19
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_richtextedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_right.png b/kdevdesigner/designer/pics/designer_d_right.png
new file mode 100644
index 00000000..9dbf2dd6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_right.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_scrollbar.png b/kdevdesigner/designer/pics/designer_d_scrollbar.png
new file mode 100644
index 00000000..9a818970
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_scrollbar.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_searchfind.png b/kdevdesigner/designer/pics/designer_d_searchfind.png
new file mode 100644
index 00000000..e85e33fe
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_searchfind.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_setbuddy.png b/kdevdesigner/designer/pics/designer_d_setbuddy.png
new file mode 100644
index 00000000..fe816aa2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_setbuddy.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_slider.png b/kdevdesigner/designer/pics/designer_d_slider.png
new file mode 100644
index 00000000..a1ad5d5b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_slider.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_spacer.png b/kdevdesigner/designer/pics/designer_d_spacer.png
new file mode 100644
index 00000000..15319d99
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_spacer.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_spinbox.png b/kdevdesigner/designer/pics/designer_d_spinbox.png
new file mode 100644
index 00000000..cafbe012
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_spinbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_table.png b/kdevdesigner/designer/pics/designer_d_table.png
new file mode 100644
index 00000000..a95bde12
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_table.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_tabwidget.png b/kdevdesigner/designer/pics/designer_d_tabwidget.png
new file mode 100644
index 00000000..0f0bad0d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_tabwidget.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textbold.png b/kdevdesigner/designer/pics/designer_d_textbold.png
new file mode 100644
index 00000000..6e8a5cf5
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textbold.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textbrowser.png b/kdevdesigner/designer/pics/designer_d_textbrowser.png
new file mode 100644
index 00000000..b4315f90
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textbrowser.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textcenter.png b/kdevdesigner/designer/pics/designer_d_textcenter.png
new file mode 100644
index 00000000..7a66036d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textcenter.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textedit.png b/kdevdesigner/designer/pics/designer_d_textedit.png
new file mode 100644
index 00000000..69314141
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textfont.png b/kdevdesigner/designer/pics/designer_d_textfont.png
new file mode 100644
index 00000000..beb2112b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textfont.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_texth1.png b/kdevdesigner/designer/pics/designer_d_texth1.png
new file mode 100644
index 00000000..87d7e157
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_texth1.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_texth2.png b/kdevdesigner/designer/pics/designer_d_texth2.png
new file mode 100644
index 00000000..e90437b2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_texth2.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_texth3.png b/kdevdesigner/designer/pics/designer_d_texth3.png
new file mode 100644
index 00000000..1c7eefe5
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_texth3.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textitalic.png b/kdevdesigner/designer/pics/designer_d_textitalic.png
new file mode 100644
index 00000000..d2c07fad
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textitalic.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textjustify.png b/kdevdesigner/designer/pics/designer_d_textjustify.png
new file mode 100644
index 00000000..3fb3cc34
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textjustify.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textlarger.png b/kdevdesigner/designer/pics/designer_d_textlarger.png
new file mode 100644
index 00000000..ecc35f54
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textlarger.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textleft.png b/kdevdesigner/designer/pics/designer_d_textleft.png
new file mode 100644
index 00000000..90dc0248
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textleft.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textlinebreak.png b/kdevdesigner/designer/pics/designer_d_textlinebreak.png
new file mode 100644
index 00000000..4566f59e
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textlinebreak.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textparagraph.png b/kdevdesigner/designer/pics/designer_d_textparagraph.png
new file mode 100644
index 00000000..a7ef75c7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textparagraph.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textright.png b/kdevdesigner/designer/pics/designer_d_textright.png
new file mode 100644
index 00000000..ee89b93b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textright.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textsmaller.png b/kdevdesigner/designer/pics/designer_d_textsmaller.png
new file mode 100644
index 00000000..d4251de0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textsmaller.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textteletext.png b/kdevdesigner/designer/pics/designer_d_textteletext.png
new file mode 100644
index 00000000..d80af143
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textteletext.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textunderline.png b/kdevdesigner/designer/pics/designer_d_textunderline.png
new file mode 100644
index 00000000..cab0b788
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textunderline.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_textview.png b/kdevdesigner/designer/pics/designer_d_textview.png
new file mode 100644
index 00000000..05ce9c69
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_textview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_timeedit.png b/kdevdesigner/designer/pics/designer_d_timeedit.png
new file mode 100644
index 00000000..955144ec
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_timeedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_toolbox.png b/kdevdesigner/designer/pics/designer_d_toolbox.png
new file mode 100644
index 00000000..e1f84471
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_toolbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_toolbutton.png b/kdevdesigner/designer/pics/designer_d_toolbutton.png
new file mode 100644
index 00000000..08e309a7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_toolbutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_undo.png b/kdevdesigner/designer/pics/designer_d_undo.png
new file mode 100644
index 00000000..22ac97f2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_undo.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_up.png b/kdevdesigner/designer/pics/designer_d_up.png
new file mode 100644
index 00000000..4c3ab7c9
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_up.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_widgetstack.png b/kdevdesigner/designer/pics/designer_d_widgetstack.png
new file mode 100644
index 00000000..c62f8e15
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_widgetstack.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_wizarddata.png b/kdevdesigner/designer/pics/designer_d_wizarddata.png
new file mode 100644
index 00000000..fb540b87
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_wizarddata.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_wizarddialog.png b/kdevdesigner/designer/pics/designer_d_wizarddialog.png
new file mode 100644
index 00000000..b83ca7e6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_wizarddialog.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_d_wordwrap.png b/kdevdesigner/designer/pics/designer_d_wordwrap.png
new file mode 100644
index 00000000..8a299033
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_d_wordwrap.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_databrowser.png b/kdevdesigner/designer/pics/designer_databrowser.png
new file mode 100644
index 00000000..1dd95782
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_databrowser.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_datatable.png b/kdevdesigner/designer/pics/designer_datatable.png
new file mode 100644
index 00000000..5b3bfc76
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_datatable.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_dataview.png b/kdevdesigner/designer/pics/designer_dataview.png
new file mode 100644
index 00000000..5f6aad33
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_dataview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_dateedit.png b/kdevdesigner/designer/pics/designer_dateedit.png
new file mode 100644
index 00000000..48286bec
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_dateedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_datetimeedit.png b/kdevdesigner/designer/pics/designer_datetimeedit.png
new file mode 100644
index 00000000..68a56737
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_datetimeedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_dial.png b/kdevdesigner/designer/pics/designer_dial.png
new file mode 100644
index 00000000..260033c2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_dial.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_down.png b/kdevdesigner/designer/pics/designer_down.png
new file mode 100644
index 00000000..3269deca
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_down.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editbreaklayout.png b/kdevdesigner/designer/pics/designer_editbreaklayout.png
new file mode 100644
index 00000000..badbb8e7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editbreaklayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editcopy.png b/kdevdesigner/designer/pics/designer_editcopy.png
new file mode 100644
index 00000000..2f931cb2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editcopy.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editcut.png b/kdevdesigner/designer/pics/designer_editcut.png
new file mode 100644
index 00000000..a911482d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editcut.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editdelete.png b/kdevdesigner/designer/pics/designer_editdelete.png
new file mode 100644
index 00000000..9f0491dd
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editdelete.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editgrid.png b/kdevdesigner/designer/pics/designer_editgrid.png
new file mode 100644
index 00000000..f2b18e8a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editgrid.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_edithlayout.png b/kdevdesigner/designer/pics/designer_edithlayout.png
new file mode 100644
index 00000000..1a2b1504
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_edithlayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_edithlayoutsplit.png b/kdevdesigner/designer/pics/designer_edithlayoutsplit.png
new file mode 100644
index 00000000..cba102bc
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_edithlayoutsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editlower.png b/kdevdesigner/designer/pics/designer_editlower.png
new file mode 100644
index 00000000..50605f27
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editlower.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editpaste.png b/kdevdesigner/designer/pics/designer_editpaste.png
new file mode 100644
index 00000000..b1b7f853
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editpaste.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editraise.png b/kdevdesigner/designer/pics/designer_editraise.png
new file mode 100644
index 00000000..f1572517
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editraise.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editslots.png b/kdevdesigner/designer/pics/designer_editslots.png
new file mode 100644
index 00000000..b86bddb6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editslots.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editvlayout.png b/kdevdesigner/designer/pics/designer_editvlayout.png
new file mode 100644
index 00000000..f4cd3f9c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editvlayout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_editvlayoutsplit.png b/kdevdesigner/designer/pics/designer_editvlayoutsplit.png
new file mode 100644
index 00000000..0180cf5a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_editvlayoutsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_filenew.png b/kdevdesigner/designer/pics/designer_filenew.png
new file mode 100644
index 00000000..9520080e
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_filenew.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_fileopen.png b/kdevdesigner/designer/pics/designer_fileopen.png
new file mode 100644
index 00000000..30052901
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_fileopen.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_filesave.png b/kdevdesigner/designer/pics/designer_filesave.png
new file mode 100644
index 00000000..c137165b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_filesave.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_folder.png b/kdevdesigner/designer/pics/designer_folder.png
new file mode 100644
index 00000000..bab6df0f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_folder.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_form.png b/kdevdesigner/designer/pics/designer_form.png
new file mode 100644
index 00000000..08268bf7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_form.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_frame.png b/kdevdesigner/designer/pics/designer_frame.png
new file mode 100644
index 00000000..c070b9c4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_frame.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_groupbox.png b/kdevdesigner/designer/pics/designer_groupbox.png
new file mode 100644
index 00000000..4025b4dc
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_groupbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_hand.png b/kdevdesigner/designer/pics/designer_hand.png
new file mode 100644
index 00000000..ac01ee60
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_hand.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_help.png b/kdevdesigner/designer/pics/designer_help.png
new file mode 100644
index 00000000..2ab2c25d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_help.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_home.png b/kdevdesigner/designer/pics/designer_home.png
new file mode 100644
index 00000000..806d11d2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_home.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_hsplit.png b/kdevdesigner/designer/pics/designer_hsplit.png
new file mode 100644
index 00000000..232faf14
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_hsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_ibeam.png b/kdevdesigner/designer/pics/designer_ibeam.png
new file mode 100644
index 00000000..6074c89f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_ibeam.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_iconview.png b/kdevdesigner/designer/pics/designer_iconview.png
new file mode 100644
index 00000000..13b8f153
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_iconview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_image.png b/kdevdesigner/designer/pics/designer_image.png
new file mode 100644
index 00000000..29854df6
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_image.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_label.png b/kdevdesigner/designer/pics/designer_label.png
new file mode 100644
index 00000000..5d7d7b4c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_label.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_layout.png b/kdevdesigner/designer/pics/designer_layout.png
new file mode 100644
index 00000000..168eb1f8
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_layout.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_lcdnumber.png b/kdevdesigner/designer/pics/designer_lcdnumber.png
new file mode 100644
index 00000000..64eda5e4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_lcdnumber.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_left.png b/kdevdesigner/designer/pics/designer_left.png
new file mode 100644
index 00000000..e58177f4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_left.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_line.png b/kdevdesigner/designer/pics/designer_line.png
new file mode 100644
index 00000000..5c64dfb5
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_line.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_lineedit.png b/kdevdesigner/designer/pics/designer_lineedit.png
new file mode 100644
index 00000000..75fc890f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_lineedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_listbox.png b/kdevdesigner/designer/pics/designer_listbox.png
new file mode 100644
index 00000000..d467fc9f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_listbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_listview.png b/kdevdesigner/designer/pics/designer_listview.png
new file mode 100644
index 00000000..d71cc1c9
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_listview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_multilineedit.png b/kdevdesigner/designer/pics/designer_multilineedit.png
new file mode 100644
index 00000000..e2f08995
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_multilineedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_newform.png b/kdevdesigner/designer/pics/designer_newform.png
new file mode 100644
index 00000000..37779c13
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_newform.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_no.png b/kdevdesigner/designer/pics/designer_no.png
new file mode 100644
index 00000000..8bacc044
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_no.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_object.png b/kdevdesigner/designer/pics/designer_object.png
new file mode 100644
index 00000000..cc4192ed
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_object.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_ordertool.png b/kdevdesigner/designer/pics/designer_ordertool.png
new file mode 100644
index 00000000..ad122839
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_ordertool.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_pixlabel.png b/kdevdesigner/designer/pics/designer_pixlabel.png
new file mode 100644
index 00000000..32b90d82
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_pixlabel.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_pointer.png b/kdevdesigner/designer/pics/designer_pointer.png
new file mode 100644
index 00000000..67e38a36
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_pointer.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_print.png b/kdevdesigner/designer/pics/designer_print.png
new file mode 100644
index 00000000..57e3e532
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_print.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_progress.png b/kdevdesigner/designer/pics/designer_progress.png
new file mode 100644
index 00000000..44ae094e
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_progress.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_project.png b/kdevdesigner/designer/pics/designer_project.png
new file mode 100644
index 00000000..6a0fb96f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_project.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_pushbutton.png b/kdevdesigner/designer/pics/designer_pushbutton.png
new file mode 100644
index 00000000..61f779ce
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_pushbutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_qtlogo.png b/kdevdesigner/designer/pics/designer_qtlogo.png
new file mode 100644
index 00000000..4e1a1472
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_qtlogo.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_radiobutton.png b/kdevdesigner/designer/pics/designer_radiobutton.png
new file mode 100644
index 00000000..10c1d8c3
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_radiobutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_redo.png b/kdevdesigner/designer/pics/designer_redo.png
new file mode 100644
index 00000000..abdad26c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_redo.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_resetproperty.png b/kdevdesigner/designer/pics/designer_resetproperty.png
new file mode 100644
index 00000000..cc0d6a26
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_resetproperty.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_richtextedit.png b/kdevdesigner/designer/pics/designer_richtextedit.png
new file mode 100644
index 00000000..73573a8a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_richtextedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_right.png b/kdevdesigner/designer/pics/designer_right.png
new file mode 100644
index 00000000..5f2f7036
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_right.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_s_down.png b/kdevdesigner/designer/pics/designer_s_down.png
new file mode 100644
index 00000000..908e55e1
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_s_down.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_s_editcut.png b/kdevdesigner/designer/pics/designer_s_editcut.png
new file mode 100644
index 00000000..7cf5a9eb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_s_editcut.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_s_left.png b/kdevdesigner/designer/pics/designer_s_left.png
new file mode 100644
index 00000000..e6e19f8f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_s_left.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_s_right.png b/kdevdesigner/designer/pics/designer_s_right.png
new file mode 100644
index 00000000..bfccda6b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_s_right.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_s_up.png b/kdevdesigner/designer/pics/designer_s_up.png
new file mode 100644
index 00000000..97705d47
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_s_up.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_scrollbar.png b/kdevdesigner/designer/pics/designer_scrollbar.png
new file mode 100644
index 00000000..466c58de
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_scrollbar.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_searchfind.png b/kdevdesigner/designer/pics/designer_searchfind.png
new file mode 100644
index 00000000..3f369fdb
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_searchfind.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_setbuddy.png b/kdevdesigner/designer/pics/designer_setbuddy.png
new file mode 100644
index 00000000..c1edb89b
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_setbuddy.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_sizeall.png b/kdevdesigner/designer/pics/designer_sizeall.png
new file mode 100644
index 00000000..fa2a266a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_sizeall.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_sizeb.png b/kdevdesigner/designer/pics/designer_sizeb.png
new file mode 100644
index 00000000..ac5235b0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_sizeb.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_sizef.png b/kdevdesigner/designer/pics/designer_sizef.png
new file mode 100644
index 00000000..28a30c29
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_sizef.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_sizeh.png b/kdevdesigner/designer/pics/designer_sizeh.png
new file mode 100644
index 00000000..7b8abd3a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_sizeh.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_sizev.png b/kdevdesigner/designer/pics/designer_sizev.png
new file mode 100644
index 00000000..80b3d8b2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_sizev.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_slider.png b/kdevdesigner/designer/pics/designer_slider.png
new file mode 100644
index 00000000..525bd1ca
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_slider.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_spacer.png b/kdevdesigner/designer/pics/designer_spacer.png
new file mode 100644
index 00000000..926e8afc
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_spacer.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_spinbox.png b/kdevdesigner/designer/pics/designer_spinbox.png
new file mode 100644
index 00000000..7ae20630
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_spinbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_splash.png b/kdevdesigner/designer/pics/designer_splash.png
new file mode 100644
index 00000000..d3b62a17
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_splash.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_table.png b/kdevdesigner/designer/pics/designer_table.png
new file mode 100644
index 00000000..4bbd9c2d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_table.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_tabwidget.png b/kdevdesigner/designer/pics/designer_tabwidget.png
new file mode 100644
index 00000000..1254bb63
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_tabwidget.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textbold.png b/kdevdesigner/designer/pics/designer_textbold.png
new file mode 100644
index 00000000..7f4f7344
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textbold.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textbrowser.png b/kdevdesigner/designer/pics/designer_textbrowser.png
new file mode 100644
index 00000000..090e2f84
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textbrowser.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textcenter.png b/kdevdesigner/designer/pics/designer_textcenter.png
new file mode 100644
index 00000000..5c68b09c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textcenter.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textedit.png b/kdevdesigner/designer/pics/designer_textedit.png
new file mode 100644
index 00000000..823d0818
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textfont.png b/kdevdesigner/designer/pics/designer_textfont.png
new file mode 100644
index 00000000..a4de87a4
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textfont.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_texth1.png b/kdevdesigner/designer/pics/designer_texth1.png
new file mode 100644
index 00000000..1c3aa2fd
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_texth1.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_texth2.png b/kdevdesigner/designer/pics/designer_texth2.png
new file mode 100644
index 00000000..ba73121d
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_texth2.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_texth3.png b/kdevdesigner/designer/pics/designer_texth3.png
new file mode 100644
index 00000000..1d9f8732
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_texth3.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textitalic.png b/kdevdesigner/designer/pics/designer_textitalic.png
new file mode 100644
index 00000000..68e2b44c
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textitalic.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textjustify.png b/kdevdesigner/designer/pics/designer_textjustify.png
new file mode 100644
index 00000000..6e746c80
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textjustify.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textlarger.png b/kdevdesigner/designer/pics/designer_textlarger.png
new file mode 100644
index 00000000..89960939
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textlarger.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textleft.png b/kdevdesigner/designer/pics/designer_textleft.png
new file mode 100644
index 00000000..72b27652
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textleft.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textlinebreak.png b/kdevdesigner/designer/pics/designer_textlinebreak.png
new file mode 100644
index 00000000..081a49e0
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textlinebreak.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textparagraph.png b/kdevdesigner/designer/pics/designer_textparagraph.png
new file mode 100644
index 00000000..dcd0b3ea
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textparagraph.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textright.png b/kdevdesigner/designer/pics/designer_textright.png
new file mode 100644
index 00000000..d7186722
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textright.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textsmaller.png b/kdevdesigner/designer/pics/designer_textsmaller.png
new file mode 100644
index 00000000..10953d9a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textsmaller.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textteletext.png b/kdevdesigner/designer/pics/designer_textteletext.png
new file mode 100644
index 00000000..c0204636
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textteletext.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textunderline.png b/kdevdesigner/designer/pics/designer_textunderline.png
new file mode 100644
index 00000000..3477ccb3
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textunderline.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_textview.png b/kdevdesigner/designer/pics/designer_textview.png
new file mode 100644
index 00000000..ec2270c3
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_textview.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_timeedit.png b/kdevdesigner/designer/pics/designer_timeedit.png
new file mode 100644
index 00000000..01b37888
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_timeedit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_toolbox.png b/kdevdesigner/designer/pics/designer_toolbox.png
new file mode 100644
index 00000000..2ab71dc7
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_toolbox.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_toolbutton.png b/kdevdesigner/designer/pics/designer_toolbutton.png
new file mode 100644
index 00000000..25d240a1
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_toolbutton.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_undo.png b/kdevdesigner/designer/pics/designer_undo.png
new file mode 100644
index 00000000..839a823f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_undo.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_up.png b/kdevdesigner/designer/pics/designer_up.png
new file mode 100644
index 00000000..e4373122
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_up.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_uparrow.png b/kdevdesigner/designer/pics/designer_uparrow.png
new file mode 100644
index 00000000..eefe4a00
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_uparrow.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_vsplit.png b/kdevdesigner/designer/pics/designer_vsplit.png
new file mode 100644
index 00000000..b820c19f
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_vsplit.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_wait.png b/kdevdesigner/designer/pics/designer_wait.png
new file mode 100644
index 00000000..5d8cfed2
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_wait.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_widgetstack.png b/kdevdesigner/designer/pics/designer_widgetstack.png
new file mode 100644
index 00000000..c326de81
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_widgetstack.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_wizarddata.png b/kdevdesigner/designer/pics/designer_wizarddata.png
new file mode 100644
index 00000000..9493e3b1
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_wizarddata.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_wizarddialog.png b/kdevdesigner/designer/pics/designer_wizarddialog.png
new file mode 100644
index 00000000..a22dc88a
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_wizarddialog.png
Binary files differ
diff --git a/kdevdesigner/designer/pics/designer_wordwrap.png b/kdevdesigner/designer/pics/designer_wordwrap.png
new file mode 100644
index 00000000..29513c32
--- /dev/null
+++ b/kdevdesigner/designer/pics/designer_wordwrap.png
Binary files differ
diff --git a/kdevdesigner/designer/pixmapchooser.cpp b/kdevdesigner/designer/pixmapchooser.cpp
new file mode 100644
index 00000000..aaac22c0
--- /dev/null
+++ b/kdevdesigner/designer/pixmapchooser.cpp
@@ -0,0 +1,231 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler needs this here
+
+#include <kiconloader.h>
+#include <kimageio.h>
+#include <kfiledialog.h>
+#include <kimagefilepreview.h>
+#include <klineedit.h>
+
+#include "kdevdesigner_part.h"
+
+#include "pixmapchooser.h"
+#include "formwindow.h"
+#if defined(DESIGNER) && !defined(RESOURCE)
+#include "pixmapfunction.h"
+#endif
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "pixmapcollectioneditor.h"
+#include "pixmapcollection.h"
+#include "project.h"
+
+#include <qapplication.h>
+#include <qimage.h>
+#include <qpainter.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qiconview.h>
+
+#if defined(DESIGNER)
+static ImageIconProvider *imageIconProvider = 0;
+#endif
+
+PixmapView::PixmapView( QWidget *parent )
+ : QScrollView( parent )
+{
+ viewport()->setBackgroundMode( PaletteBase );
+}
+
+void PixmapView::setPixmap( const QPixmap &pix )
+{
+ pixmap = pix;
+ resizeContents( pixmap.size().width(), pixmap.size().height() );
+ viewport()->repaint( FALSE );
+}
+
+void PixmapView::drawContents( QPainter *p, int cx, int cy, int cw, int ch )
+{
+ p->fillRect( cx, cy, cw, ch, colorGroup().brush( QColorGroup::Base ) );
+ p->drawPixmap( 0, 0, pixmap );
+}
+
+void PixmapView::previewUrl( const QUrl &u )
+{
+ if ( u.isLocalFile() ) {
+ QString path = u.path();
+ QPixmap pix( path );
+ if ( !pix.isNull() )
+ setPixmap( pix );
+ } else {
+ qWarning( "Previewing remote files not supported." );
+ }
+}
+
+static void buildImageFormatList( QString &filter, QString &all )
+{
+ all = qApp->translate( "qChoosePixmap", "All Pixmaps (" );
+ for ( uint i = 0; i < QImageIO::outputFormats().count(); i++ ) {
+ QString outputFormat = QImageIO::outputFormats().at( i );
+ QString outputExtension;
+ if ( outputFormat != "JPEG" )
+ outputExtension = outputFormat.lower();
+ else
+ outputExtension = "jpg;*.jpeg";
+ filter += qApp->translate( "qChoosePixmap", "%1-Pixmaps (%2)\n" ).
+ arg( outputFormat ).arg( "*." + outputExtension);
+ all += "*." + outputExtension + ";";
+ }
+ filter.prepend( all + qApp->translate( "qChoosePixmap", ")\n" ) );
+ filter += qApp->translate( "qChoosePixmap", "All Files (*)" );
+
+}
+QStringList qChoosePixmaps( QWidget *parent )
+{
+/* if ( !imageIconProvider && !QFileDialog::iconProvider() )
+ QFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
+
+ QString filter;
+ QString all;
+ buildImageFormatList( filter, all );
+
+ QFileDialog fd( QString::null, filter, parent, 0, TRUE );
+ fd.setMode( QFileDialog::ExistingFiles );
+ fd.setContentsPreviewEnabled( TRUE );
+ PixmapView *pw = new PixmapView( &fd );
+ fd.setContentsPreview( pw, pw );
+ fd.setViewMode( QFileDialog::List );
+ fd.setPreviewMode( QFileDialog::Contents );
+ fd.setCaption( qApp->translate( "qChoosePixmap", "Choose Images..." ) );
+ if ( fd.exec() == QDialog::Accepted )
+ return fd.selectedFiles();
+ return QStringList();*/
+ QStringList mimetypes = KImageIO::mimeTypes( KImageIO::Reading );
+ KFileDialog dlg(QString::null, mimetypes.join(" "), parent, "filedialog", true);
+ dlg.setOperationMode( KFileDialog::Opening );
+ dlg.setCaption( qApp->translate( "qChoosePixmap", "Choose Images..." ) );
+ dlg.setMode( KFile::Files );
+ KImageFilePreview *ip = new KImageFilePreview( &dlg );
+ dlg.setPreviewWidget( ip );
+ if (dlg.exec())
+ return dlg.selectedFiles();
+ return QStringList();
+}
+
+QPixmap qChoosePixmap( QWidget *parent, FormWindow *fw, const QPixmap &old, QString *fn )
+{
+#if defined(DESIGNER)
+ if ( !fw || fw->savePixmapInline() ) {
+/* if ( !imageIconProvider && !QFileDialog::iconProvider() )
+ QFileDialog::setIconProvider( ( imageIconProvider = new ImageIconProvider ) );
+
+ QString filter;
+ QString all;
+ buildImageFormatList( filter, all );
+
+ QFileDialog fd( QString::null, filter, parent, 0, TRUE );
+ fd.setContentsPreviewEnabled( TRUE );
+ PixmapView *pw = new PixmapView( &fd );
+ fd.setContentsPreview( pw, pw );
+ fd.setViewMode( QFileDialog::List );
+ fd.setPreviewMode( QFileDialog::Contents );
+ fd.setCaption( qApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
+ if ( fd.exec() == QDialog::Accepted ) {
+ QPixmap pix( fd.selectedFile() );
+ if ( fn )
+ *fn = fd.selectedFile();
+ MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), fd.selectedFile() );
+ return pix;
+ }*/
+ QStringList mimetypes = KImageIO::mimeTypes( KImageIO::Reading );
+ KFileDialog dlg(QString::null, mimetypes.join(" "), parent, "filedialog", true);
+ dlg.setOperationMode( KFileDialog::Opening );
+ dlg.setCaption( qApp->translate( "qChoosePixmap", "Choose Pixmap" ) );
+ dlg.setMode( KFile::File );
+ KImageFilePreview *ip = new KImageFilePreview( &dlg );
+ dlg.setPreviewWidget( ip );
+ if (dlg.exec())
+ {
+ QPixmap pix( dlg.selectedURL().path() );
+ if ( fn )
+ *fn = dlg.selectedURL().path();
+ MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), dlg.selectedURL().path() );
+ return pix;
+ }
+ } else if ( fw && fw->savePixmapInProject() ) {
+ PixmapCollectionEditor dia( parent, 0, TRUE );
+ dia.setProject( fw->project() );
+ dia.setChooserMode( TRUE );
+ dia.setCurrentItem( MetaDataBase::pixmapKey( fw, old.serialNumber() ) );
+ if ( dia.exec() == QDialog::Accepted ) {
+ QPixmap pix( fw->project()->pixmapCollection()->pixmap( dia.viewPixmaps->currentItem()->text() ) );
+ MetaDataBase::setPixmapKey( fw, pix.serialNumber(), dia.viewPixmaps->currentItem()->text() );
+ return pix;
+ }
+ } else {
+ PixmapFunction dia( parent, 0, TRUE );
+ QObject::connect( dia.helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ dia.labelFunction->setText( fw->pixmapLoaderFunction() + "(" );
+ dia.editArguments->setText( MetaDataBase::pixmapArgument( fw, old.serialNumber() ) );
+ dia.editArguments->setFocus();
+ if ( dia.exec() == QDialog::Accepted ) {
+ QPixmap pix;
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ).convertToImage() );
+
+ MetaDataBase::setPixmapArgument( fw, pix.serialNumber(), dia.editArguments->text() );
+ return pix;
+ }
+ }
+#else
+ Q_UNUSED( parent );
+ Q_UNUSED( fw );
+ Q_UNUSED( old );
+#endif
+ return QPixmap();
+}
+
+ImageIconProvider::ImageIconProvider( QWidget *parent, const char *name )
+ : QFileIconProvider( parent, name ), imagepm( BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ) )
+{
+ fmts = QImage::inputFormats();
+}
+
+ImageIconProvider::~ImageIconProvider()
+{
+}
+
+const QPixmap * ImageIconProvider::pixmap( const QFileInfo &fi )
+{
+ QString ext = fi.extension().upper();
+ if ( fmts.contains( ext ) ) {
+ return &imagepm;
+ } else {
+ return QFileIconProvider::pixmap( fi );
+ }
+}
diff --git a/kdevdesigner/designer/pixmapchooser.h b/kdevdesigner/designer/pixmapchooser.h
new file mode 100644
index 00000000..cea45bfd
--- /dev/null
+++ b/kdevdesigner/designer/pixmapchooser.h
@@ -0,0 +1,72 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PIXMAPCHOOSER_H
+#define PIXMAPCHOOSER_H
+
+#include <qfiledialog.h>
+#include <qscrollview.h>
+#include <qpixmap.h>
+#include <qurl.h>
+
+class FormWindow;
+
+class PixmapView : public QScrollView,
+ public QFilePreview
+{
+ Q_OBJECT
+
+public:
+ PixmapView( QWidget *parent );
+ void setPixmap( const QPixmap &pix );
+ void drawContents( QPainter *p, int, int, int, int );
+ void previewUrl( const QUrl &u );
+
+private:
+ QPixmap pixmap;
+
+};
+
+class ImageIconProvider : public QFileIconProvider
+{
+ Q_OBJECT
+
+public:
+ ImageIconProvider( QWidget *parent = 0, const char *name = 0 );
+ ~ImageIconProvider();
+
+ const QPixmap *pixmap( const QFileInfo &fi );
+
+private:
+ QStrList fmts;
+ QPixmap imagepm;
+
+};
+
+QPixmap qChoosePixmap( QWidget *parent, FormWindow *fw = 0, const QPixmap &old = QPixmap(), QString *fn = 0 );
+QStringList qChoosePixmaps( QWidget *parent );
+
+#endif
diff --git a/kdevdesigner/designer/pixmapcollection.cpp b/kdevdesigner/designer/pixmapcollection.cpp
new file mode 100644
index 00000000..c8b14ffa
--- /dev/null
+++ b/kdevdesigner/designer/pixmapcollection.cpp
@@ -0,0 +1,180 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "pixmapcollection.h"
+#include "project.h"
+#include "mainwindow.h"
+#include <qmime.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qimage.h>
+
+PixmapCollection::PixmapCollection( Project *pro )
+ : project( pro )
+{
+ iface = new DesignerPixmapCollectionImpl( this );
+ mimeSourceFactory = new QMimeSourceFactory();
+}
+
+PixmapCollection::~PixmapCollection()
+{
+ delete mimeSourceFactory;
+ delete iface;
+}
+
+bool PixmapCollection::addPixmap( const Pixmap &pix, bool force )
+{
+ Pixmap pixmap = pix;
+ savePixmap( pixmap );
+
+ if ( !force ) {
+ for ( QValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == pixmap.name )
+ return FALSE;
+ }
+ }
+
+ pixList.append( pixmap );
+ mimeSourceFactory->setPixmap( pixmap.name, pixmap.pix );
+ project->setModified( TRUE );
+ return TRUE;
+}
+
+void PixmapCollection::removePixmap( const QString &name )
+{
+ for ( QValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == name ) {
+ pixList.remove( it );
+ break;
+ }
+ }
+ project->setModified( TRUE );
+}
+
+QValueList<PixmapCollection::Pixmap> PixmapCollection::pixmaps() const
+{
+ return pixList;
+}
+
+QString PixmapCollection::unifyName( const QString &n )
+{
+ QString name = n;
+ bool restart = FALSE;
+ int added = 1;
+
+ for ( QValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( restart )
+ it = pixList.begin();
+ restart = FALSE;
+ if ( name == (*it).name ) {
+ name = n;
+ name += "_" + QString::number( added );
+ ++added;
+ restart = TRUE;
+ }
+ }
+
+ return name;
+}
+
+void PixmapCollection::setActive( bool b )
+{
+ if ( b )
+ QMimeSourceFactory::defaultFactory()->addFactory( mimeSourceFactory );
+ else
+ QMimeSourceFactory::defaultFactory()->removeFactory( mimeSourceFactory );
+}
+
+QPixmap PixmapCollection::pixmap( const QString &name )
+{
+ for ( QValueList<Pixmap>::Iterator it = pixList.begin(); it != pixList.end(); ++it ) {
+ if ( (*it).name == name )
+ return (*it).pix;
+ }
+ return QPixmap();
+}
+
+void PixmapCollection::savePixmap( Pixmap &pix )
+{
+ if ( pix.absname == imageDir() + "/" + pix.name )
+ return; // no need to save, it is already there
+ QString rel = project->makeRelative( pix.absname );
+ if ( rel[0] == '/' || ( rel[1] == ':' && rel[2] == '/' ) ) { // only save if file is outside the project
+ mkdir();
+ pix.name = unifyName( QFileInfo( pix.absname ).baseName() ) + ".png";
+ pix.absname = imageDir() + "/" + pix.name;
+ pix.pix.save( pix.absname, "PNG" );
+ } else if ( rel.isEmpty() ) {
+ mkdir();
+ pix.name = unifyName( pix.name );
+ pix.absname = imageDir() + "/" + pix.name;
+ pix.pix.save( pix.absname, "PNG" );
+ }
+}
+
+QString PixmapCollection::imageDir() const
+{
+ return QFileInfo( project->fileName() ).dirPath( TRUE ) + "/images";
+}
+
+void PixmapCollection::mkdir()
+{
+ QString f = project->fileName();
+ QDir d( QFileInfo( f ).dirPath( TRUE ) );
+ d.mkdir( "images" );
+}
+
+void PixmapCollection::load( const QString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+ QString absfile;
+ if ( filename[0] == '/' )
+ absfile = filename;
+ else
+ absfile = QFileInfo( project->fileName() ).dirPath( TRUE ) + "/" + filename;
+
+ QPixmap pm( absfile );
+ if ( pm.isNull() )
+ return;
+
+ Pixmap pix;
+ pix.name = QFileInfo( absfile ).fileName();
+ pix.absname = absfile;
+ pix.pix = pm;
+ addPixmap( pix, TRUE );
+}
+
+DesignerPixmapCollection *PixmapCollection::iFace()
+{
+ return iface;
+}
+
+bool PixmapCollection::isEmpty() const
+{
+ return pixList.isEmpty();
+}
diff --git a/kdevdesigner/designer/pixmapcollection.h b/kdevdesigner/designer/pixmapcollection.h
new file mode 100644
index 00000000..ed36ecb8
--- /dev/null
+++ b/kdevdesigner/designer/pixmapcollection.h
@@ -0,0 +1,80 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PIXMAPCOLLECTION_H
+#define PIXMAPCOLLECTION_H
+
+#include <qstring.h>
+#include <qpixmap.h>
+#include <qvaluelist.h>
+#include "designerappiface.h"
+
+class QMimeSourceFactory;
+class Project;
+
+class PixmapCollection
+{
+public:
+ struct Pixmap
+ {
+ QPixmap pix;
+ QString name;
+ QString absname;
+ Q_DUMMY_COMPARISON_OPERATOR( Pixmap )
+ };
+
+ PixmapCollection( Project *pro );
+ ~PixmapCollection();
+
+ bool addPixmap( const Pixmap &pix, bool force = TRUE );
+ void removePixmap( const QString &name );
+ QPixmap pixmap( const QString &name );
+
+ QValueList<Pixmap> pixmaps() const;
+ bool isEmpty() const;
+
+ void setActive( bool b );
+
+ void load( const QString& filename );
+
+ DesignerPixmapCollection *iFace();
+
+private:
+ QString unifyName( const QString &n );
+ void savePixmap( Pixmap &pix );
+
+ QString imageDir() const;
+ void mkdir();
+
+private:
+ QValueList<Pixmap> pixList;
+ QMimeSourceFactory *mimeSourceFactory;
+ Project *project;
+ DesignerPixmapCollectionImpl *iface;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/pixmapcollectioneditor.ui b/kdevdesigner/designer/pixmapcollectioneditor.ui
new file mode 100644
index 00000000..c4888193
--- /dev/null
+++ b/kdevdesigner/designer/pixmapcollectioneditor.ui
@@ -0,0 +1,218 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PixmapCollectionEditor</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PixmapCollectionEditor</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>455</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Manage Image Collection</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QIconView">
+ <property name="name">
+ <cstring>viewPixmaps</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonClose</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lose</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>addPixmap()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>removePixmap()</slot>
+ </connection>
+ <connection>
+ <sender>viewPixmaps</sender>
+ <signal>currentChanged(QIconViewItem*)</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>currentChanged(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonClose</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapCollectionEditor</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>PushButton3</tabstop>
+ <tabstop>viewPixmaps</tabstop>
+ <tabstop>buttonClose</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">pixmapcollection.h</include>
+ <include location="local" impldecl="in implementation">pixmapchooser.h</include>
+ <include location="local" impldecl="in implementation">project.h</include>
+ <include location="global" impldecl="in implementation">qfileinfo.h</include>
+ <include location="global" impldecl="in implementation">qimage.h</include>
+ <include location="global" impldecl="in declaration">qpixmap.h</include>
+ <include location="local" impldecl="in implementation">pixmapcollectioneditor.ui.h</include>
+</includes>
+<forwards>
+ <forward>class Project;</forward>
+</forwards>
+<variables>
+ <variable>Project *project;</variable>
+ <variable>bool chooser;</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>addPixmap()</slot>
+ <slot>removePixmap()</slot>
+ <slot>updateView()</slot>
+ <slot>currentChanged(QIconViewItem * i)</slot>
+ <slot>setChooserMode(bool c)</slot>
+ <slot>setCurrentItem(const QString &amp; name)</slot>
+ <slot>setProject(Project * pro)</slot>
+ <slot returnType="QPixmap">scaledPixmap(const QPixmap &amp; p)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/pixmapcollectioneditor.ui.h b/kdevdesigner/designer/pixmapcollectioneditor.ui.h
new file mode 100644
index 00000000..4d82f3f3
--- /dev/null
+++ b/kdevdesigner/designer/pixmapcollectioneditor.ui.h
@@ -0,0 +1,150 @@
+#include <klocale.h>
+/**********************************************************************
+** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+void PixmapCollectionEditor::init()
+{
+ project = 0;
+ setChooserMode( FALSE );
+}
+
+void PixmapCollectionEditor::destroy()
+{
+}
+
+void PixmapCollectionEditor::addPixmap()
+{
+ if ( !project )
+ return;
+
+ QString f;
+ QStringList pixmaps = qChoosePixmaps( this );
+ if ( pixmaps.isEmpty() )
+ return;
+
+ QString lastName;
+ for ( QStringList::ConstIterator it = pixmaps.begin(); it != pixmaps.end(); ++it ) {
+ QPixmap pm( *it );
+ if ( pm.isNull() )
+ continue;
+ PixmapCollection::Pixmap pixmap;
+ pixmap.pix = pm;
+ QFileInfo fi ( *it );
+ pixmap.name = fi.fileName();
+ pixmap.absname = fi.filePath();
+ if ( !project->pixmapCollection()->addPixmap( pixmap, FALSE ) )
+ continue;
+ lastName = pixmap.name;
+ }
+
+ updateView();
+ QIconViewItem *item = viewPixmaps->findItem( lastName );
+ if ( item ) {
+ viewPixmaps->setCurrentItem( item );
+ viewPixmaps->ensureItemVisible( item );
+ }
+
+}
+
+void PixmapCollectionEditor::removePixmap()
+{
+ if ( !project || !viewPixmaps->currentItem() )
+ return;
+ project->pixmapCollection()->removePixmap( viewPixmaps->currentItem()->text() );
+ updateView();
+}
+
+void PixmapCollectionEditor::updateView()
+{
+ if ( !project )
+ return;
+
+ viewPixmaps->clear();
+
+ QValueList<PixmapCollection::Pixmap> pixmaps = project->pixmapCollection()->pixmaps();
+ for ( QValueList<PixmapCollection::Pixmap>::Iterator it = pixmaps.begin(); it != pixmaps.end(); ++it ) {
+ // #### might need to scale down the pixmap
+ QIconViewItem *item = new QIconViewItem( viewPixmaps, (*it).name, scaledPixmap( (*it).pix ) );
+ //item->setRenameEnabled( TRUE ); // this will be a bit harder to implement
+ item->setDragEnabled( FALSE );
+ item->setDropEnabled( FALSE );
+ }
+ viewPixmaps->setCurrentItem( viewPixmaps->firstItem() );
+ currentChanged( viewPixmaps->firstItem() );
+}
+
+void PixmapCollectionEditor::currentChanged( QIconViewItem * i )
+{
+ buttonOk->setEnabled( !!i );
+}
+
+void PixmapCollectionEditor::setChooserMode( bool c )
+{
+ chooser = c;
+ if ( chooser ) {
+ buttonClose->hide();
+ buttonOk->show();
+ buttonCancel->show();
+ buttonOk->setEnabled( FALSE );
+ buttonOk->setDefault( TRUE );
+ connect( viewPixmaps, SIGNAL( doubleClicked( QIconViewItem * ) ), buttonOk, SIGNAL( clicked() ) );
+ connect( viewPixmaps, SIGNAL( returnPressed( QIconViewItem * ) ), buttonOk, SIGNAL( clicked() ) );
+ setCaption( i18n( "Choose Image" ) );
+ } else {
+ buttonClose->show();
+ buttonOk->hide();
+ buttonCancel->hide();
+ buttonClose->setDefault( TRUE );
+ }
+ updateView();
+}
+
+void PixmapCollectionEditor::setCurrentItem( const QString & name )
+{
+ QIconViewItem *i = viewPixmaps->findItem( name );
+ if ( i ) {
+ viewPixmaps->setCurrentItem( i );
+ currentChanged( i );
+ }
+}
+
+void PixmapCollectionEditor::setProject( Project * pro )
+{
+ project = pro;
+ updateView();
+}
+
+QPixmap PixmapCollectionEditor::scaledPixmap( const QPixmap & p )
+{
+ QPixmap pix( p );
+ if ( pix.width() < 50 && pix.height() < 50 )
+ return pix;
+ QImage img;
+ img = pix;
+ img = img.smoothScale( 50, 50 );
+ pix.convertFromImage( img );
+ return pix;
+}
diff --git a/kdevdesigner/designer/pixmapfunction.ui b/kdevdesigner/designer/pixmapfunction.ui
new file mode 100644
index 00000000..7eb5fb94
--- /dev/null
+++ b/kdevdesigner/designer/pixmapfunction.ui
@@ -0,0 +1,976 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PixmapFunction</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PixmapFunction</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>305</width>
+ <height>120</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose Pixmap</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enter arguments for loading the pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editArguments</cstring>
+ </property>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>Frame9</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="layoutMargin" stdset="0">
+ </property>
+ <property name="layoutSpacing" stdset="0">
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelFunction</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="text">
+ <string>QPixmap(</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>editArguments</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>170</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="frame">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>233</red>
+ <green>233</green>
+ <blue>233</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>211</red>
+ <green>211</green>
+ <blue>211</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>242</red>
+ <green>242</green>
+ <blue>242</blue>
+ </color>
+ <color>
+ <red>105</red>
+ <green>105</green>
+ <blue>105</blue>
+ </color>
+ <color>
+ <red>140</red>
+ <green>140</green>
+ <blue>140</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="text">
+ <string>)</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</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>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapFunction</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>PixmapFunction</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kdevdesigner/designer/popupmenueditor.cpp b/kdevdesigner/designer/popupmenueditor.cpp
new file mode 100644
index 00000000..198880f9
--- /dev/null
+++ b/kdevdesigner/designer/popupmenueditor.cpp
@@ -0,0 +1,1469 @@
+/**********************************************************************
+** Copyright (C) 2003 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qapplication.h>
+#include <qcstring.h>
+#include <qdatastream.h>
+#include <qdragobject.h>
+#include <qlineedit.h>
+#include <qobjectlist.h>
+#include <qpainter.h>
+#include <qpopupmenu.h>
+#include <qrect.h>
+#include <qsize.h>
+#include <qstyle.h>
+#include <qtimer.h>
+#include "actiondnd.h"
+#include "actioneditorimpl.h"
+#include "command.h"
+#include "formfile.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "metadatabase.h"
+#include "pixmapchooser.h"
+#include "popupmenueditor.h"
+#include "menubareditor.h"
+
+#include <klocale.h>
+
+// Drag Object Declaration -------------------------------------------
+
+class PopupMenuEditorItemPtrDrag : public QStoredDrag
+{
+public:
+ PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item, QWidget * parent = 0,
+ const char * name = 0 );
+ ~PopupMenuEditorItemPtrDrag() {};
+ static bool canDecode( QDragMoveEvent * e );
+ static bool decode( QDropEvent * e, PopupMenuEditorItem ** i );
+};
+
+// Drag Object Implementation ---------------------------------------
+
+PopupMenuEditorItemPtrDrag::PopupMenuEditorItemPtrDrag( PopupMenuEditorItem * item,
+ QWidget * parent, const char * name )
+ : QStoredDrag( "qt/popupmenueditoritemptr", parent, name )
+{
+ QByteArray data( sizeof( Q_LONG ) );
+ QDataStream stream( data, IO_WriteOnly );
+ stream << ( Q_LONG ) item;
+ setEncodedData( data );
+}
+
+bool PopupMenuEditorItemPtrDrag::canDecode( QDragMoveEvent * e )
+{
+ return e->provides( "qt/popupmenueditoritemptr" );
+}
+
+bool PopupMenuEditorItemPtrDrag::decode( QDropEvent * e, PopupMenuEditorItem ** i )
+{
+ QByteArray data = e->encodedData( "qt/popupmenueditoritemptr" );
+ QDataStream stream( data, IO_ReadOnly );
+
+ if ( !data.size() )
+ return FALSE;
+
+ Q_LONG p = 0;
+ stream >> p;
+ *i = ( PopupMenuEditorItem *) p;
+
+ return TRUE;
+}
+
+// PopupMenuEditorItem Implementation -----------------------------------
+
+PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditor * menu, QObject * parent, const char * name )
+ : QObject( parent, name ),
+ a( 0 ),
+ s( 0 ),
+ m( menu ),
+ separator( FALSE ),
+ removable( FALSE )
+{
+ init();
+ a = new QAction( this );
+ QObject::connect( a, SIGNAL( destroyed() ), this, SLOT( selfDestruct() ) );
+}
+
+
+PopupMenuEditorItem::PopupMenuEditorItem( QAction * action, PopupMenuEditor * menu,
+ QObject * parent, const char * name )
+ : QObject( parent, name ),
+ a( action ),
+ s( 0 ),
+ m( menu ),
+ separator( FALSE ),
+ removable( TRUE )
+{
+ init();
+ if ( /*a->name() == "qt_separator_action" ||*/ ::qt_cast<QSeparatorAction*>(a) )
+ separator = TRUE;
+ if ( a && a->children() )
+ a->installEventFilter( this );
+}
+
+PopupMenuEditorItem::PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuEditor * menu,
+ QObject * parent, const char * name )
+ : QObject( parent, name ),
+ a( item->a ),
+ s( 0 ),
+ m( menu ),
+ separator( item->separator ),
+ removable( item->removable )
+{
+ init();
+ if ( ::qt_cast<QActionGroup*>(a) )
+ a->installEventFilter( this );
+}
+
+PopupMenuEditorItem::~PopupMenuEditorItem()
+{
+
+}
+
+void PopupMenuEditorItem::init()
+{
+ if ( a ) {
+ QObject::connect( a, SIGNAL( destroyed() ), this, SLOT( selfDestruct() ) );
+ if ( m && !isSeparator() ) {
+ s = new PopupMenuEditor( m->formWindow(), m );
+ QString n = "PopupMenuEditor";
+ m->formWindow()->unify( s, n, TRUE );
+ s->setName( n );
+ MetaDataBase::addEntry( s );
+ }
+ }
+}
+
+PopupMenuEditorItem::ItemType PopupMenuEditorItem::type() const
+{
+ if ( separator )
+ return Separator;
+ else if ( a )
+ return Action;
+ return Unknown;
+}
+
+void PopupMenuEditorItem::setVisible( bool enable )
+{
+ if ( a )
+ a->setVisible( enable );
+}
+
+bool PopupMenuEditorItem::isVisible() const
+{
+ QActionGroup *g = ::qt_cast<QActionGroup*>(a);
+ if ( g )
+ return ( g->isVisible() && g->usesDropDown() );
+ else if ( a )
+ return a->isVisible();
+ return FALSE;
+}
+
+void PopupMenuEditorItem::showMenu( int x, int y )
+{
+ if ( ( !separator ) && s ) {
+ s->move( x, y );
+ s->show();
+ s->raise();
+ }
+}
+
+void PopupMenuEditorItem::hideMenu()
+{
+ if ( s ) {
+ s->hideSubMenu();
+ s->hide();
+ }
+}
+
+void PopupMenuEditorItem::focusOnMenu()
+{
+ if ( s ) {
+ s->showSubMenu();
+ s->setFocus();
+ }
+}
+
+int PopupMenuEditorItem::count() const
+{
+ if ( s ) {
+ return s->count();
+ } else if ( ::qt_cast<QActionGroup*>(a) ) {
+ const QObjectList * l = a->children();
+ if ( l )
+ return l->count();
+ }
+ return 0;
+}
+
+bool PopupMenuEditorItem::eventFilter( QObject * o, QEvent * event )
+{
+ if ( ! ::qt_cast<QActionGroup*>( o ) )
+ return FALSE;
+ if ( event->type() == QEvent::ChildInserted ) {
+ QChildEvent * ce = ( QChildEvent * ) event;
+ QObject * c = ce->child();
+ QAction * action = ::qt_cast<QAction*>( c );
+ if ( s->find( action ) != -1 ) // avoid duplicates
+ return FALSE;
+ QActionGroup * actionGroup = ::qt_cast<QActionGroup*>( c );
+ if ( actionGroup )
+ s->insert( actionGroup );
+ else if ( action )
+ s->insert( action );
+ }
+ return FALSE;
+}
+
+void PopupMenuEditorItem::selfDestruct()
+{
+ hideMenu();
+ int i = m->find( s );
+ if ( i != -1 && i < m->count() )
+ m->remove( i ); // remove this item
+ a = 0; // the selfDestruct call was caused by the deletion of the action
+ delete this;
+}
+
+// PopupMenuEditor Implementation -----------------------------------
+
+PopupMenuEditorItem * PopupMenuEditor::draggedItem = 0;
+int PopupMenuEditor::clipboardOperation = 0;
+PopupMenuEditorItem * PopupMenuEditor::clipboardItem = 0;
+
+PopupMenuEditor::PopupMenuEditor( FormWindow * fw, QWidget * parent, const char * name )
+ : QWidget( 0, name, WStyle_Customize | WStyle_NoBorder | WRepaintNoErase | WResizeNoErase ),
+ formWnd( fw ),
+ parentMenu( parent ),
+ iconWidth( 0 ),
+ textWidth( 0 ),
+ accelWidth( 0 ),
+ arrowWidth( 30 ),
+ borderSize( 2 ),
+ currentField( 1 ),
+ currentIndex( 0 )
+{
+ init();
+}
+
+PopupMenuEditor::PopupMenuEditor( FormWindow * fw, PopupMenuEditor * menu,
+ QWidget * parent, const char * name )
+ : QWidget( 0, name, WStyle_Customize | WStyle_NoBorder | WRepaintNoErase ),
+ formWnd( fw ),
+ parentMenu( parent ),
+ iconWidth( menu->iconWidth ),
+ textWidth( menu->textWidth ),
+ accelWidth( menu->accelWidth ),
+ arrowWidth( menu->arrowWidth ),
+ borderSize( menu->borderSize ),
+ currentField( menu->currentField ),
+ currentIndex( menu->currentIndex )
+{
+ init();
+ PopupMenuEditorItem * i;
+ for ( i = menu->itemList.first(); i; i = menu->itemList.next() ) {
+ PopupMenuEditorItem * n = new PopupMenuEditorItem( i, this );
+ itemList.append( n );
+ }
+}
+
+PopupMenuEditor::~PopupMenuEditor()
+{
+ itemList.setAutoDelete( TRUE );
+}
+
+void PopupMenuEditor::init()
+{
+ reparent( ( QMainWindow * ) formWnd->mainContainer(), pos() );
+
+ addItem.action()->setMenuText( i18n("new item") );
+ addSeparator.action()->setMenuText( i18n("new separator") );
+
+ setAcceptDrops( TRUE );
+ setFocusPolicy( StrongFocus );
+
+ lineEdit = new QLineEdit( this );
+ lineEdit->hide();
+ lineEdit->setFrameStyle(QFrame::Plain | QFrame::NoFrame);
+ lineEdit->polish();
+ lineEdit->setBackgroundOrigin(ParentOrigin);
+ lineEdit->setBackgroundMode(PaletteButton);
+ lineEdit->installEventFilter( this );
+
+ dropLine = new QWidget( this, 0, Qt::WStyle_NoBorder | WStyle_StaysOnTop );
+ dropLine->setBackgroundColor( Qt::red );
+ dropLine->hide();
+
+ hide();
+}
+
+void PopupMenuEditor::insert( PopupMenuEditorItem * item, int index )
+{
+ if ( !item )
+ return;
+ if ( index == -1 ) {
+ itemList.append( item );
+ if ( isVisible() )
+ currentIndex = itemList.count() - 1;
+ } else {
+ itemList.insert( index, item );
+ if ( isVisible() )
+ currentIndex = index;
+ }
+ item->m = this;
+ item->s->parentMenu = this;
+ resizeToContents();
+ if ( isVisible() && parentMenu )
+ parentMenu->update(); // draw arrow in parent menu
+ emit inserted( item->action() );
+}
+
+void PopupMenuEditor::insert( QAction * action, int index )
+{
+ if ( !action )
+ return;
+ insert( new PopupMenuEditorItem( action, this, 0, action->name() ), index );
+}
+
+void PopupMenuEditor::insert( QActionGroup * actionGroup, int index )
+{
+ if ( !actionGroup )
+ return;
+ bool dropdown = actionGroup->usesDropDown();
+ PopupMenuEditorItem *i = new PopupMenuEditorItem( (QAction *)actionGroup, this, 0,
+ QString( actionGroup->name() ) + "Menu" );
+ QActionGroup *g = 0;
+ QObjectList *l = actionGroup->queryList( "QAction", 0, FALSE, FALSE );
+ QObjectListIterator it( *l );
+ insert( i, index );
+ for ( ; it.current(); ++it ) {
+ g = ::qt_cast<QActionGroup*>(it.current());
+ if ( g ) {
+ if ( dropdown )
+ i->s->insert( g );
+ else
+ insert( g );
+ } else {
+ i->s->insert( (QAction*)it.current() );
+ }
+ }
+ delete l;
+}
+
+int PopupMenuEditor::find( const QAction * action )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->action() == action )
+ return itemList.at();
+ i = itemList.next();
+ }
+ return -1;
+}
+
+int PopupMenuEditor::find( PopupMenuEditor * menu )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->subMenu() == menu )
+ return itemList.at();
+ i = itemList.next();
+ }
+ return -1;
+}
+
+int PopupMenuEditor::count()
+{
+ return itemList.count();
+}
+
+PopupMenuEditorItem * PopupMenuEditor::at( int index )
+{
+ return itemList.at( index );
+}
+
+void PopupMenuEditor::exchange( int a, int b )
+{
+ PopupMenuEditorItem * ia = itemList.at( a );
+ PopupMenuEditorItem * ib = itemList.at( b );
+ if ( !ia || !ib ||
+ ia == &addItem || ia == &addSeparator ||
+ ib == &addItem || ib == &addSeparator )
+ return; // do nothing
+ itemList.replace( b, ia );
+ itemList.replace( a, ib );
+}
+
+void PopupMenuEditor::cut( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Cut;
+ clipboardItem = itemList.at( idx );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ return; // do nothing
+ }
+
+ RemoveActionFromPopupCommand * cmd =
+ new RemoveActionFromPopupCommand( i18n( "Cut Item" ), formWnd, this, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+}
+
+void PopupMenuEditor::copy( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( clipboardItem && clipboardOperation == Cut )
+ delete clipboardItem;
+
+ clipboardOperation = Copy;
+ clipboardItem = itemList.at( idx );
+
+ if ( clipboardItem == &addItem || clipboardItem == &addSeparator ) {
+ clipboardOperation = None;
+ clipboardItem = 0;
+ }
+}
+
+void PopupMenuEditor::paste( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( clipboardItem && clipboardOperation ) {
+ PopupMenuEditorItem * n = new PopupMenuEditorItem( clipboardItem, this );
+ AddActionToPopupCommand * cmd =
+ new AddActionToPopupCommand( i18n( "Paste Item" ), formWnd, this, n, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+}
+
+void PopupMenuEditor::insertedActions( QPtrList<QAction> & list )
+{
+ QAction * a = 0;
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ a = i->action();
+ if ( a )
+ list.append( a );
+ i = itemList.next();
+ }
+}
+
+void PopupMenuEditor::show()
+{
+ resizeToContents();
+ QWidget::show();
+}
+
+void PopupMenuEditor::choosePixmap( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ PopupMenuEditorItem * i = 0;
+ QAction * a = 0;
+
+ if ( idx < (int)itemList.count() ) {
+ i = itemList.at( idx );
+ a = i->action();
+ } else {
+ createItem();
+ }
+
+ hide(); // qChoosePixmap hides the menu
+ QIconSet icons( qChoosePixmap( 0, formWnd, 0, 0 ) );
+ SetActionIconsCommand * cmd =
+ new SetActionIconsCommand( i18n( "Set Icon" ), formWnd, a, this, icons );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ show();
+ setFocus();
+}
+
+void PopupMenuEditor::showLineEdit( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+
+ PopupMenuEditorItem * i = 0;
+
+ if ( idx >= (int)itemList.count() )
+ i = &addItem;
+ else
+ i = itemList.at( idx );
+
+ // open edit currentField for item name
+ lineEdit->setText( i->action()->menuText() );
+ lineEdit->selectAll();
+ lineEdit->setGeometry( borderSize + iconWidth, borderSize + itemPos( i ),
+ textWidth, itemHeight( i ) );
+ lineEdit->show();
+ lineEdit->setFocus();
+}
+
+void PopupMenuEditor::setAccelerator( int key, Qt::ButtonState state, int index )
+{
+ // FIXME: make this a command
+
+ int idx = ( index == -1 ? currentIndex : index );
+
+ if ( key == Qt::Key_Shift ||
+ key == Qt::Key_Control ||
+ key == Qt::Key_Alt ||
+ key == Qt::Key_Meta ||
+ key == Qt::Key_unknown )
+ return; // ignore these keys when they are pressed
+
+ PopupMenuEditorItem * i = 0;
+
+ if ( idx >= (int)itemList.count() )
+ i = createItem();
+ else
+ i = itemList.at( idx );
+
+ int shift = ( state & Qt::ShiftButton ? Qt::SHIFT : 0 );
+ int ctrl = ( state & Qt::ControlButton ? Qt::CTRL : 0 );
+ int alt = ( state & Qt::AltButton ? Qt::ALT : 0 );
+ int meta = ( state & Qt::MetaButton ? Qt::META : 0 );
+
+ QAction * a = i->action();
+ QKeySequence ks = a->accel();
+ int keys[4] = { ks[0], ks[1], ks[2], ks[3] };
+ int n = 0;
+ while ( n < 4 && ks[n++] );
+ n--;
+ if ( n < 4 )
+ keys[n] = key | shift | ctrl | alt | meta;
+ a->setAccel( QKeySequence( keys[0], keys[1], keys[2], keys[3] ) );
+ MetaDataBase::setPropertyChanged( a, "accel", TRUE );
+ resizeToContents();
+}
+
+void PopupMenuEditor::resizeToContents()
+{
+ QSize s = contentsSize();
+ dropLine->resize( s.width(), 2 );
+ s.rwidth() += borderSize * 2;
+ s.rheight() += borderSize * 2;
+ resize( s );
+}
+
+void PopupMenuEditor::showSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() ) {
+ itemList.at( currentIndex )->showMenu( pos().x() + width() - borderSize * 3,
+ pos().y() + itemPos( at( currentIndex ) ) +
+ borderSize * 2 );
+ setFocus(); // Keep focus in this widget
+ }
+}
+
+void PopupMenuEditor::hideSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() )
+ itemList.at( currentIndex )->hideMenu();
+}
+
+void PopupMenuEditor::focusOnSubMenu()
+{
+ if ( currentIndex < (int)itemList.count() )
+ itemList.at( currentIndex )->focusOnMenu();
+}
+
+// This function has no undo. It is only here to remove an item when its action was
+// removed from the action editor.
+// Use removeItem to put the command on the command stack.
+void PopupMenuEditor::remove( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+ PopupMenuEditorItem * i = itemList.at( idx );
+ if ( i && i->isRemovable() ) {
+ itemList.remove( idx );
+ int n = itemList.count() + 1;
+ if ( currentIndex >= n )
+ currentIndex = itemList.count() + 1;
+ emit removed( i->action() );
+ resizeToContents();
+ }
+}
+
+PopupMenuEditorItem * PopupMenuEditor::createItem( QAction * a )
+{
+ ActionEditor * ae = (ActionEditor *) formWindow()->mainWindow()->child( 0, "ActionEditor" );
+ if ( !a )
+ a = ae->newActionEx();
+ PopupMenuEditorItem * i = new PopupMenuEditorItem( a, this );
+ QString n = QString( a->name() ) + "Item";
+ formWindow()->unify( i, n, FALSE );
+ i->setName( n );
+ AddActionToPopupCommand * cmd =
+ new AddActionToPopupCommand( i18n( "Add Item" ), formWnd, this, i );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ return i;
+}
+
+void PopupMenuEditor::removeItem( int index )
+{
+ int idx = ( index == -1 ? currentIndex : index );
+ if ( idx < (int)itemList.count() ) {
+ RemoveActionFromPopupCommand * cmd = new RemoveActionFromPopupCommand( i18n( "Remove Item" ),
+ formWnd,
+ this,
+ idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ if ( itemList.count() == 0 && parentMenu )
+ parentMenu->update();
+ resizeToContents();
+ }
+}
+
+PopupMenuEditorItem * PopupMenuEditor::currentItem()
+{
+ int count = itemList.count();
+ if ( currentIndex < count )
+ return itemList.at( currentIndex );
+ else if ( currentIndex == count )
+ return &addItem;
+ return &addSeparator;
+}
+
+PopupMenuEditorItem * PopupMenuEditor::itemAt( int y )
+{
+ PopupMenuEditorItem * i = itemList.first();
+ int iy = 0;
+
+ while ( i ) {
+ iy += itemHeight( i );
+ if ( iy > y )
+ return i;
+ i = itemList.next();
+ }
+ iy += itemHeight( &addItem );
+ if ( iy > y )
+ return &addItem;
+ return &addSeparator;
+}
+
+void PopupMenuEditor::setFocusAt( const QPoint & pos )
+{
+ hideSubMenu();
+ lineEdit->hide();
+
+ currentIndex = 0;
+ int iy = 0;
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ iy += itemHeight( i );
+ if ( iy > pos.y() )
+ break;
+ i = itemList.next();
+ currentIndex++;
+ }
+
+ iy += itemHeight( &addItem );
+ if ( iy <= pos.y() )
+ currentIndex++;
+
+ if ( currentIndex < (int)itemList.count() ) {
+ if ( pos.x() < iconWidth )
+ currentField = 0;
+ else if ( pos.x() < iconWidth + textWidth )
+ currentField = 1;
+ else
+ currentField = 2;
+ } else {
+ currentField = 1;
+ }
+
+ showSubMenu();
+}
+
+bool PopupMenuEditor::eventFilter( QObject * o, QEvent * e )
+{
+ if ( o == lineEdit && e->type() == QEvent::FocusOut ) {
+ leaveEditMode( 0 );
+ update();
+ }
+ return QWidget::eventFilter( o, e );
+}
+
+void PopupMenuEditor::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ p.save();
+ QRegion reg( rect() );
+ QRegion mid( borderSize, borderSize,
+ rect().width() - borderSize * 2, rect().height() - borderSize * 2 );
+ reg -= mid;
+ p.setClipRegion( reg );
+ style().drawPrimitive( QStyle::PE_PanelPopup, &p, rect(), colorGroup() );
+ p.restore();
+ drawItems( &p );
+}
+
+void PopupMenuEditor::mousePressEvent( QMouseEvent * e )
+{
+ mousePressPos = e->pos();
+ setFocusAt( mousePressPos );
+ e->accept();
+ update();
+}
+
+void PopupMenuEditor::mouseDoubleClickEvent( QMouseEvent * )
+{
+ setFocusAt( mousePressPos );
+ if ( currentItem() == &addSeparator ) {
+ PopupMenuEditorItem * i = createItem( new QSeparatorAction( 0 ) );
+ i->setSeparator( TRUE );
+ return;
+ }
+ if ( currentField == 0 ) {
+ choosePixmap();
+ resizeToContents();
+ } else if ( currentField == 1 ) {
+ showLineEdit();
+ }
+}
+
+void PopupMenuEditor::mouseMoveEvent( QMouseEvent * e )
+{
+ if ( e->state() & Qt::LeftButton ) {
+ if ( ( e->pos() - mousePressPos ).manhattanLength() > 3 ) {
+ draggedItem = itemAt( mousePressPos.y() );
+ if ( draggedItem == &addItem ) {
+ draggedItem = createItem();
+ RenameActionCommand cmd( i18n( "Rename Item" ), formWnd, draggedItem->action(),
+ this, "Unnamed" );
+ cmd.execute();
+ // FIXME: start rename after drop
+ } else if ( draggedItem == &addSeparator ) {
+ draggedItem = createItem( new QSeparatorAction( 0 ) );
+ draggedItem->setSeparator( TRUE );
+ }
+
+ PopupMenuEditorItemPtrDrag * d =
+ new PopupMenuEditorItemPtrDrag( draggedItem, this );
+
+ hideSubMenu();
+
+ draggedItem->setVisible( FALSE );
+ resizeToContents();
+
+ // If the item is dropped in the same list,
+ // we will have two instances of the same pointer
+ // in the list. We use node instead.
+ int idx = itemList.find( draggedItem );
+ QLNode * node = itemList.currentNode();
+
+ d->dragCopy(); // dragevents and stuff happens
+
+ if ( draggedItem ) { // item was not dropped
+ draggedItem->setVisible( TRUE );
+ draggedItem = 0;
+ if ( hasFocus() ) {
+ hideSubMenu();
+ resizeToContents();
+ showSubMenu();
+ }
+ } else { // item was dropped
+ itemList.takeNode( node )->setVisible( TRUE );
+ if ( currentIndex > 0 && currentIndex > idx )
+ --currentIndex;
+ // the drop might happen in another menu, so we'll resize
+ // and show the submenu there
+ }
+ }
+ }
+}
+
+void PopupMenuEditor::dragEnterEvent( QDragEnterEvent * e )
+{
+ if ( e->provides( "qt/popupmenueditoritemptr" ) ||
+ e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ) {
+ e->accept();
+ dropLine->show();
+ }
+}
+
+void PopupMenuEditor::dragLeaveEvent( QDragLeaveEvent * )
+{
+ dropLine->hide();
+}
+
+void PopupMenuEditor::dragMoveEvent( QDragMoveEvent * e )
+{
+ QPoint pos = e->pos();
+ dropLine->move( borderSize, snapToItem( pos.y() ) );
+
+ if ( currentItem() != itemAt( pos.y() ) ) {
+ hideSubMenu();
+ setFocusAt( pos );
+ showSubMenu();
+ }
+}
+
+void PopupMenuEditor::dropEvent( QDropEvent * e )
+{
+ if ( !( e->provides( "qt/popupmenueditoritemptr" ) ||
+ e->provides( "application/x-designer-actions" ) ||
+ e->provides( "application/x-designer-actiongroup" ) ) )
+ return;
+
+ // Hide the sub menu of the current item, but do it later
+ if ( currentIndex < (int)itemList.count() ) {
+ PopupMenuEditor *s = itemList.at( currentIndex )->s;
+ QTimer::singleShot( 0, s, SLOT( hide() ) );
+ }
+
+ draggedItem = 0;
+ PopupMenuEditorItem * i = 0;
+
+ if ( e->provides( "qt/popupmenueditoritemptr" ) ) {
+ PopupMenuEditorItemPtrDrag::decode( e, &i );
+ } else {
+ if ( e->provides( "application/x-designer-actiongroup" ) ) {
+ QActionGroup * g = ::qt_cast<QDesignerActionGroup*>(ActionDrag::action());
+ if ( g->usesDropDown() ) {
+ i = new PopupMenuEditorItem( g, this );
+ QString n = QString( g->name() ) + "Item";
+ formWindow()->unify( i, n, FALSE );
+ i->setName( n );
+ QObjectList *l = g->queryList( "QAction", 0, FALSE, FALSE );
+ QObjectListIterator it( *l );
+ for ( ; it.current(); ++it ) {
+ g = ::qt_cast<QActionGroup*>(it.current());
+ if ( g )
+ i->s->insert( g );
+ else
+ i->s->insert( (QAction*)it.current() );
+ }
+ delete l;
+ } else {
+ dropInPlace( g, e->pos().y() );
+ }
+ } else if ( e->provides( "application/x-designer-actions" ) ) {
+ QAction *a = ::qt_cast<QDesignerAction*>(ActionDrag::action());
+ i = new PopupMenuEditorItem( a, this );
+ }
+ }
+
+ if ( i ) {
+ dropInPlace( i, e->pos().y() );
+ QTimer::singleShot( 0, this, SLOT( resizeToContents() ) );
+ }
+
+ QTimer::singleShot( 0, this, SLOT( showSubMenu() ) );
+ QTimer::singleShot( 0, this, SLOT( setFocus() ) );
+ dropLine->hide();
+ e->accept();
+}
+
+void PopupMenuEditor::keyPressEvent( QKeyEvent * e )
+{
+ if ( lineEdit->isHidden() ) { // In navigation mode
+
+ switch ( e->key() ) {
+
+ case Qt::Key_Delete:
+ hideSubMenu();
+ removeItem();
+ showSubMenu();
+ break;
+
+ case Qt::Key_Backspace:
+ clearCurrentField();
+ break;
+
+ case Qt::Key_Up:
+ navigateUp( e->state() & Qt::ControlButton );
+ break;
+
+ case Qt::Key_Down:
+ navigateDown( e->state() & Qt::ControlButton );
+ break;
+
+ case Qt::Key_Left:
+ navigateLeft();
+ break;
+
+ case Qt::Key_Right:
+ navigateRight();
+ break;
+
+ case Qt::Key_PageUp:
+ currentIndex = 0;
+ break;
+
+ case Qt::Key_PageDown:
+ currentIndex = itemList.count();
+ break;
+
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_F2:
+ enterEditMode( e );
+ // move on
+ case Qt::Key_Alt:
+ case Qt::Key_Shift:
+ case Qt::Key_Control:
+ // do nothing
+ return;
+
+ case Qt::Key_Escape:
+ currentField = 0;
+ navigateLeft();
+ break;
+
+ case Qt::Key_C:
+ if ( e->state() & Qt::ControlButton &&
+ currentIndex < (int)itemList.count() ) {
+ copy( currentIndex );
+ break;
+ }
+
+ case Qt::Key_X:
+ if ( e->state() & Qt::ControlButton &&
+ currentIndex < (int)itemList.count() ) {
+ hideSubMenu();
+ cut( currentIndex );
+ showSubMenu();
+ break;
+ }
+
+ case Qt::Key_V:
+ if ( e->state() & Qt::ControlButton ) {
+ hideSubMenu();
+ paste( currentIndex < (int)itemList.count() ? currentIndex + 1: itemList.count() );
+ showSubMenu();
+ break;
+ }
+
+ default:
+ if ( currentItem()->isSeparator() )
+ return;
+ if ( currentField == 1 ) {
+ showLineEdit();
+ QApplication::sendEvent( lineEdit, e );
+ e->accept();
+ return;
+ } else if ( currentField == 2 ) {
+ setAccelerator( e->key(), e->state() );
+ showSubMenu();
+ }
+ break;
+
+ }
+
+ } else { // In edit mode
+ switch ( e->key() ) {
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_Escape:
+ leaveEditMode( e );
+ e->accept();
+ return;
+ }
+ }
+ update();
+}
+
+void PopupMenuEditor::focusInEvent( QFocusEvent * )
+{
+ showSubMenu();
+ update();
+ parentMenu->update();
+}
+
+void PopupMenuEditor::focusOutEvent( QFocusEvent * )
+{
+ QWidget * fw = qApp->focusWidget();
+ if ( !fw || ( !::qt_cast<PopupMenuEditor*>(fw) && fw != lineEdit ) ) {
+ hideSubMenu();
+ if ( fw && ::qt_cast<MenuBarEditor*>(fw) )
+ return;
+ QWidget * w = this;
+ while ( w && w != fw && ::qt_cast<PopupMenuEditor*>(w) ) { // hide all popups
+ w->hide();
+ w = ((PopupMenuEditor *)w)->parentEditor();
+ }
+ }
+}
+
+void PopupMenuEditor::drawItem( QPainter * p, PopupMenuEditorItem * i,
+ const QRect & r, int f ) const
+{
+ int x = r.x();
+ int y = r.y();
+ int h = r.height();
+
+ p->fillRect( r, colorGroup().brush( QColorGroup::Background ) );
+
+ if ( i->isSeparator() ) {
+ style().drawPrimitive( QStyle::PE_Separator, p,
+ QRect( r.x(), r.y() + 2, r.width(), 1 ),
+ colorGroup(), QStyle::Style_Sunken | f );
+ return;
+ }
+
+ const QAction * a = i->action();
+ if ( a->isToggleAction() && a->isOn() ) {
+ style().drawPrimitive( QStyle::PE_CheckMark, p,
+ QRect( x , y, iconWidth, h ),
+ colorGroup(), f );
+ } else {
+ QPixmap icon = a->iconSet().pixmap( QIconSet::Automatic, QIconSet::Normal );
+ p->drawPixmap( x + ( iconWidth - icon.width() ) / 2,
+ y + ( h - icon.height() ) / 2,
+ icon );
+ }
+ x += iconWidth;
+ p->drawText( x, y, textWidth, h,
+ QPainter::AlignLeft |
+ QPainter::AlignVCenter |
+ Qt::ShowPrefix |
+ Qt::SingleLine,
+ a->menuText() );
+
+ x += textWidth + borderSize * 3;
+ p->drawText( x, y, accelWidth, h,
+ QPainter::AlignLeft | QPainter::AlignVCenter,
+ a->accel() );
+ if ( i->count() ) // Item has submenu
+ style().drawPrimitive( QStyle::PE_ArrowRight, p,
+ QRect( r.width() - arrowWidth, r.y(), arrowWidth, r.height() ),
+ colorGroup(), f );
+}
+
+void PopupMenuEditor::drawWinFocusRect( QPainter * p, const QRect & r ) const
+{
+ if ( currentIndex < (int)itemList.count() &&
+ ((PopupMenuEditor*)this)->itemList.at( currentIndex )->isSeparator() ) {
+ p->drawWinFocusRect( borderSize, r.y(), width() - borderSize * 2, r.height() );
+ return;
+ }
+ int y = r.y();
+ int h = r.height();
+ if ( currentField == 0 )
+ p->drawWinFocusRect( borderSize + 1, y, iconWidth - 2, h );
+ else if ( currentField == 1 )
+ p->drawWinFocusRect( borderSize + iconWidth, y, textWidth, h );
+ else if ( currentField == 2 )
+ p->drawWinFocusRect( borderSize + iconWidth + textWidth +
+ borderSize * 3, y, accelWidth, h );
+}
+
+void PopupMenuEditor::drawItems( QPainter * p )
+{
+ int flags = 0;
+ int idx = 0;
+
+ QColorGroup enabled = colorGroup();
+ QColorGroup disabled = palette().disabled();
+ QRect focus;
+ QRect rect( borderSize, borderSize, width() - borderSize * 2, 0 );
+
+ PopupMenuEditorItem * i = itemList.first();
+ while ( i ) {
+ if ( i->isVisible() ) {
+ rect.setHeight( itemHeight( i ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ if ( i->action()->isEnabled() ) {
+ flags = QStyle::Style_Enabled;
+ p->setPen( enabled.buttonText() );
+ } else {
+ flags = QStyle::Style_Default;
+ p->setPen( disabled.buttonText() );
+ }
+ drawItem( p, i, rect, flags );
+ rect.moveBy( 0, rect.height() );
+ }
+ i = itemList.next();
+ idx++;
+ }
+
+ // Draw the "add item" and "add separator" items
+ p->setPen( darkBlue );
+ rect.setHeight( itemHeight( &addItem ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ drawItem( p, &addItem, rect, QStyle::Style_Default );
+ rect.moveBy( 0, rect.height() );
+ idx++;
+ rect.setHeight( itemHeight( &addSeparator ) );
+ if ( idx == currentIndex )
+ focus = rect;
+ drawItem( p, &addSeparator, rect, QStyle::Style_Default );
+ idx++;
+
+ if ( hasFocus() && !draggedItem )
+ drawWinFocusRect( p, focus );
+}
+
+QSize PopupMenuEditor::contentsSize()
+{
+ QRect textRect = fontMetrics().boundingRect( addSeparator.action()->menuText() );
+ textWidth = textRect.width();
+ accelWidth = textRect.height(); // default size
+ iconWidth = textRect.height();
+
+ int w = 0;
+ int h = itemHeight( &addItem ) + itemHeight( &addSeparator );
+ PopupMenuEditorItem * i = itemList.first();
+ QAction * a = 0;
+ while ( i ) {
+ if ( i->isVisible() ) {
+ if ( !i->isSeparator() ) {
+ a = i->action();
+ w = a->iconSet().pixmap( QIconSet::Automatic, QIconSet::Normal ).rect().width() +
+ borderSize; // padding
+ iconWidth = QMAX( iconWidth, w );
+ w = fontMetrics().boundingRect( a->menuText() ).width();
+ textWidth = QMAX( textWidth, w );
+ w = fontMetrics().boundingRect( a->accel() ).width() + 2; // added padding?
+ accelWidth = QMAX( accelWidth, w );
+ }
+ h += itemHeight( i );
+ }
+ i = itemList.next();
+ }
+
+ int width = iconWidth + textWidth + borderSize * 3 + accelWidth + arrowWidth;
+ return QSize( width, h );
+}
+
+int PopupMenuEditor::itemHeight( const PopupMenuEditorItem * item ) const
+{
+ if ( !item || ( item && !item->isVisible() ) )
+ return 0;
+ if ( item->isSeparator() )
+ return 4; // FIXME: hardcoded ( get from styles )r
+ int padding = + borderSize * 6;
+ QAction * a = item->action();
+ int h = a->iconSet().pixmap( QIconSet::Automatic, QIconSet::Normal ).rect().height();
+ h = QMAX( h, fontMetrics().boundingRect( a->menuText() ).height() + padding );
+ h = QMAX( h, fontMetrics().boundingRect( a->accel() ).height() + padding );
+ return h;
+}
+
+int PopupMenuEditor::itemPos( const PopupMenuEditorItem * item ) const
+{
+ PopupMenuEditor * that = ( PopupMenuEditor * ) this;
+ int y = 0;
+ PopupMenuEditorItem * i = that->itemList.first();
+ while ( i ) {
+ if ( i == item )
+ return y;
+ y += itemHeight( i );
+ i = that->itemList.next();
+ }
+ return y;
+}
+
+int PopupMenuEditor::snapToItem( int y )
+{
+ int iy = 0;
+ int dy = 0;
+
+ PopupMenuEditorItem * i = itemList.first();
+
+ while ( i ) {
+ dy = itemHeight( i );
+ if ( iy + dy / 2 > y )
+ return iy;
+ iy += dy;
+ i = itemList.next();
+ }
+
+ return iy;
+}
+
+void PopupMenuEditor::dropInPlace( PopupMenuEditorItem * i, int y )
+{
+ int iy = 0;
+ int dy = 0;
+ int idx = 0;
+
+ PopupMenuEditorItem * n = itemList.first();
+
+ while ( n ) {
+ dy = itemHeight( n );
+ if ( iy + dy / 2 > y )
+ break;
+ iy += dy;
+ idx++;
+ n = itemList.next();
+ }
+ int same = itemList.findRef( i );
+ AddActionToPopupCommand * cmd = new AddActionToPopupCommand( i18n( "Drop Item" ), formWnd, this, i, idx );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ currentIndex = ( same >= 0 && same < idx ) ? idx - 1 : idx;
+ currentField = 1;
+}
+
+void PopupMenuEditor::dropInPlace( QActionGroup * g, int y )
+{
+ if (!g->children())
+ return;
+ QObjectList l = *g->children();
+ for ( int i = 0; i < (int)l.count(); ++i ) {
+ QAction *a = ::qt_cast<QAction*>(l.at(i));
+ QActionGroup *g = ::qt_cast<QActionGroup*>(l.at(i));
+ if ( g )
+ dropInPlace( g, y );
+ else if ( a )
+ dropInPlace( new PopupMenuEditorItem( a, this ), y );
+ }
+}
+
+void PopupMenuEditor::safeDec()
+{
+ do {
+ currentIndex--;
+ } while ( currentIndex > 0 && !currentItem()->isVisible() );
+ if ( currentIndex == 0 &&
+ !currentItem()->isVisible() &&
+ parentMenu ) {
+ parentMenu->setFocus();
+ }
+}
+
+void PopupMenuEditor::safeInc()
+{
+ int max = itemList.count() + 1;
+ if ( currentIndex < max ) {
+ do {
+ currentIndex++;
+ } while ( currentIndex < max && !currentItem()->isVisible() ); // skip invisible items
+ }
+}
+
+void PopupMenuEditor::clearCurrentField()
+{
+ if ( currentIndex >= (int)itemList.count() )
+ return; // currentIndex is addItem or addSeparator
+ PopupMenuEditorItem * i = currentItem();
+ hideSubMenu();
+ if ( i->isSeparator() )
+ return;
+ if ( currentField == 0 ) {
+ QIconSet icons( 0 );
+ SetActionIconsCommand * cmd = new SetActionIconsCommand( i18n( "Remove Icon" ),
+ formWnd,
+ i->action(),
+ this,
+ icons );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ } else if ( currentField == 2 ) {
+ i->action()->setAccel( 0 );
+ }
+ resizeToContents();
+ showSubMenu();
+ return;
+}
+
+void PopupMenuEditor::navigateUp( bool ctrl )
+{
+ if ( currentIndex > 0 ) {
+ hideSubMenu();
+ if ( ctrl ) {
+ ExchangeActionInPopupCommand * cmd =
+ new ExchangeActionInPopupCommand( i18n( "Move Item Up" ),
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex - 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeDec();
+ } else {
+ safeDec();
+ }
+ showSubMenu();
+ } else if ( parentMenu ) {
+ parentMenu->setFocus();
+ parentMenu->update();
+ }
+}
+
+void PopupMenuEditor::navigateDown( bool ctrl )
+{
+ hideSubMenu();
+ if ( ctrl ) {
+ if ( currentIndex < ( (int)itemList.count() - 1 ) ) { // safe index
+ ExchangeActionInPopupCommand * cmd =
+ new ExchangeActionInPopupCommand( i18n( "Move Item Down" ),
+ formWnd,
+ this,
+ currentIndex,
+ currentIndex + 1 );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ safeInc();
+ }
+ } else { // ! Ctrl
+ safeInc();
+ }
+ if ( currentIndex >= (int)itemList.count() )
+ currentField = 1;
+ showSubMenu();
+}
+
+void PopupMenuEditor::navigateLeft()
+{
+ if ( currentItem()->isSeparator() ||
+ currentIndex >= (int)itemList.count() ||
+ currentField == 0 ) {
+ if ( parentMenu ) {
+ hideSubMenu();
+ parentMenu->setFocus();
+ } else if ( !currentItem()->isSeparator() ) {
+ currentField = 2;
+ }
+ } else {
+ currentField--;
+ }
+}
+
+void PopupMenuEditor::navigateRight()
+{
+ if ( !currentItem()->isSeparator() &&
+ currentIndex < (int)itemList.count() ) {
+ if ( currentField == 2 ) {
+ focusOnSubMenu();
+ } else {
+ currentField++;
+ currentField %= 3;
+ }
+ }
+}
+
+void PopupMenuEditor::enterEditMode( QKeyEvent * e )
+{
+ PopupMenuEditorItem * i = currentItem();
+
+ if ( i == &addSeparator ) {
+ i = createItem( new QSeparatorAction( 0 ) );
+ } else if ( i->isSeparator() ) {
+ return;
+ } else if ( currentField == 0 ) {
+ choosePixmap();
+ } else if ( currentField == 1 ) {
+ showLineEdit();
+ return;
+ } else {// currentField == 2
+ setAccelerator( e->key(), e->state() );
+ }
+ showSubMenu();
+ return;
+}
+
+void PopupMenuEditor::leaveEditMode( QKeyEvent * e )
+{
+ setFocus();
+ lineEdit->hide();
+
+ PopupMenuEditorItem * i = 0;
+ if ( e && e->key() == Qt::Key_Escape ) {
+ update();
+ return;
+ }
+
+ if ( currentIndex >= (int)itemList.count() ) {
+ // new item was created
+ QAction * a = formWnd->mainWindow()->actioneditor()->newActionEx();
+ QString actionText = lineEdit->text();
+ actionText.replace("&&", "&");
+ QString menuText = lineEdit->text();
+ a->setText( actionText );
+ a->setMenuText( menuText );
+ i = createItem( a );
+ QString n = constructName( i );
+ formWindow()->unify( a, n, TRUE );
+ a->setName( n );
+ MetaDataBase::addEntry( a );
+ MetaDataBase::setPropertyChanged( a, "menuText", TRUE );
+ ActionEditor *ae = (ActionEditor*)formWindow()->mainWindow()->child( 0, "ActionEditor" );
+ if ( ae )
+ ae->updateActionName( a );
+ } else {
+ i = itemList.at( currentIndex );
+ RenameActionCommand * cmd = new RenameActionCommand( i18n( "Rename Item" ),
+ formWnd,
+ i->action(),
+ this,
+ lineEdit->text() );
+ formWnd->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ }
+ resizeToContents();
+
+ if ( !i )
+ return;
+
+ if ( i->isSeparator() )
+ hideSubMenu();
+ else
+ showSubMenu();
+}
+
+QString PopupMenuEditor::constructName( PopupMenuEditorItem *item )
+{
+ QString s;
+ QString name = item->action()->menuText();
+ QWidget *e = parentEditor();
+ PopupMenuEditor *p = ::qt_cast<PopupMenuEditor*>(e);
+ if ( p ) {
+ int idx = p->find( item->m );
+ PopupMenuEditorItem * i = ( idx > -1 ? p->at( idx ) : 0 );
+ s = ( i ? QString( i->action()->name() ).remove( "Action" ) : QString( "" ) );
+ } else {
+ MenuBarEditor *b = ::qt_cast<MenuBarEditor*>(e);
+ if ( b ) {
+ int idx = b->findItem( item->m );
+ MenuBarEditorItem * i = ( idx > -1 ? b->item( idx ) : 0 );
+ s = ( i ? i->menuText().lower() : QString( "" ) );
+ }
+ }
+ // replace illegal characters
+
+ return ( RenameMenuCommand::makeLegal( s ) +
+ RenameMenuCommand::makeLegal( name ) + "Action" );
+}
diff --git a/kdevdesigner/designer/popupmenueditor.h b/kdevdesigner/designer/popupmenueditor.h
new file mode 100644
index 00000000..ca14205b
--- /dev/null
+++ b/kdevdesigner/designer/popupmenueditor.h
@@ -0,0 +1,235 @@
+/**********************************************************************
+** Copyright (C) 2003 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef POPUPMENUEDITOR_H
+#define POPUPMENUEDITOR_H
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qaction.h>
+
+class PopupMenuEditor;
+class QMenuItem;
+
+class PopupMenuEditorItem : public QObject
+{
+ Q_OBJECT
+
+ friend class PopupMenuEditor;
+
+ PopupMenuEditorItem( PopupMenuEditor * menu = 0, QObject * parent = 0, const char * name = 0 );
+
+public:
+ enum ItemType {
+ Unknown = -1,
+ Separator = 0,
+ Action = 1
+ };
+
+ PopupMenuEditorItem( QAction * action, PopupMenuEditor * menu,
+ QObject * parent = 0, const char * name = 0 );
+ PopupMenuEditorItem( PopupMenuEditorItem * item, PopupMenuEditor * menu,
+ QObject * parent = 0, const char * name = 0 );
+ ~PopupMenuEditorItem();
+
+ void init();
+
+ ItemType type() const;
+ QAction * action() const { return a; }
+
+ void setVisible( bool enable );
+ bool isVisible() const;
+
+ void setSeparator( bool enable ) { separator = enable; }
+ bool isSeparator() const { return separator; }
+
+ void setRemovable( bool enable ) { removable = enable; }
+ bool isRemovable() const { return removable; }
+
+ void showMenu( int x, int y );
+ void hideMenu();
+ void focusOnMenu();
+ PopupMenuEditor * subMenu() const { return s; }
+
+ int count() const;
+
+ bool eventFilter( QObject *, QEvent * event );
+
+public slots:
+ void selfDestruct();
+
+protected:
+
+private:
+ QAction * a;
+ PopupMenuEditor * s;
+ PopupMenuEditor * m;
+ uint separator : 1;
+ uint removable : 1;
+};
+
+class FormWindow;
+class MainWindow;
+class QLineEdit;
+
+#include <qpopupmenu.h>
+
+class PopupMenuEditor : public QWidget
+{
+ Q_OBJECT
+
+ friend class PopupMenuEditorItem;
+ friend class MenuBarEditor;
+ friend class Resource;
+
+public:
+ PopupMenuEditor( FormWindow * fw, QWidget * parent = 0, const char * name = 0 );
+ PopupMenuEditor( FormWindow * fw, PopupMenuEditor * menu, QWidget * parent, const char * name = 0 );
+ ~PopupMenuEditor();
+
+ void init();
+
+ void insert( PopupMenuEditorItem * item, int index = -1 );
+ void insert( QAction * action, int index = -1 );
+ void insert( QActionGroup * actionGroup, int index = -1 );
+ int find( const QAction * action );
+ int find( PopupMenuEditor * menu );
+ int count();
+ PopupMenuEditorItem * at( int index );
+ PopupMenuEditorItem * at( QPoint pos ) { return itemAt( pos.y() ); }
+ void exchange( int a, int b );
+
+ void cut( int index );
+ void copy( int index );
+ void paste( int index );
+
+ void insertedActions( QPtrList<QAction> & list );
+
+ void show();
+ void choosePixmap( int index = -1 );
+ void showLineEdit( int index = -1);
+ void setAccelerator( int key, Qt::ButtonState state, int index = -1 );
+
+ FormWindow * formWindow() { return formWnd; }
+ bool isCreatingAccelerator() { return ( currentField == 2 ); }
+
+ QPtrList<PopupMenuEditorItem> * items() { return &itemList; }
+
+ QWidget * parentEditor() { return parentMenu; }
+
+signals:
+ void inserted( QAction * );
+ void removed( QAction * );
+
+public slots:
+
+ void cut() { cut( currentIndex ); }
+ void copy() { copy( currentIndex ); }
+ void paste() { paste( currentIndex ); }
+
+ void remove( int index );
+ void remove( QAction * a ) { remove( find( a ) ); }
+
+ void resizeToContents();
+ void showSubMenu();
+ void hideSubMenu();
+ void focusOnSubMenu();
+
+protected:
+ PopupMenuEditorItem * createItem( QAction * a = 0 );
+ void removeItem( int index = -1 );
+ PopupMenuEditorItem * currentItem();
+ PopupMenuEditorItem * itemAt( int y );
+ void setFocusAt( const QPoint & pos );
+
+ bool eventFilter( QObject * o, QEvent * e );
+ void paintEvent( QPaintEvent * e );
+ void mousePressEvent( QMouseEvent * e );
+ void mouseDoubleClickEvent( QMouseEvent * e );
+ void mouseMoveEvent( QMouseEvent * e );
+ void dragEnterEvent( QDragEnterEvent * e );
+ void dragLeaveEvent( QDragLeaveEvent * e );
+ void dragMoveEvent( QDragMoveEvent * e );
+ void dropEvent( QDropEvent * e );
+ void keyPressEvent( QKeyEvent * e );
+ void focusInEvent( QFocusEvent * e );
+ void focusOutEvent( QFocusEvent * e );
+
+ void drawItems( QPainter * p );
+ void drawItem( QPainter * p, PopupMenuEditorItem * i, const QRect & r, int f ) const;
+ void drawWinFocusRect( QPainter * p, const QRect & r ) const;
+
+ QSize contentsSize();
+ int itemHeight( const PopupMenuEditorItem * item ) const;
+ int itemPos( const PopupMenuEditorItem * item ) const;
+
+ int snapToItem( int y );
+ void dropInPlace( PopupMenuEditorItem * i, int y );
+ void dropInPlace( QActionGroup * g, int y );
+
+ void safeDec();
+ void safeInc();
+
+ void clearCurrentField();
+ void navigateUp( bool ctrl );
+ void navigateDown( bool ctrl );
+ void navigateLeft();
+ void navigateRight();
+ void enterEditMode( QKeyEvent * e );
+ void leaveEditMode( QKeyEvent * e );
+
+ QString constructName( PopupMenuEditorItem *item );
+
+private:
+ FormWindow * formWnd;
+ QLineEdit * lineEdit;
+ QWidget * dropLine;
+ QPtrList<PopupMenuEditorItem> itemList;
+ PopupMenuEditorItem addItem;
+ PopupMenuEditorItem addSeparator;
+ QWidget * parentMenu;
+
+ int iconWidth;
+ int textWidth;
+ int accelWidth;
+ int arrowWidth;
+ int borderSize;
+
+ int currentField;
+ int currentIndex;
+ QPoint mousePressPos;
+ static PopupMenuEditorItem * draggedItem;
+
+ enum ClipboardOperation {
+ None = 0,
+ Cut = 1,
+ Copy = 2
+ };
+ static int clipboardOperation;
+ static PopupMenuEditorItem * clipboardItem;
+};
+
+#endif //POPUPMENUEDITOR_H
diff --git a/kdevdesigner/designer/preferences.ui b/kdevdesigner/designer/preferences.ui
new file mode 100644
index 00000000..58cc7def
--- /dev/null
+++ b/kdevdesigner/designer/preferences.ui
@@ -0,0 +1,648 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Preferences</class>
+<comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>Preferences</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Preferences</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Preferences&lt;/b&gt;&lt;p&gt;Change the preferences of Qt Designer. There is always one tab with general preferences. There may be additional tabs, depending on which plugins are installed.&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>pageGeneral</cstring>
+ </property>
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="1">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>File Saving</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxAutoSave</cstring>
+ </property>
+ <property name="text">
+ <string>Enable auto sa&amp;ve</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabelAutoSave</cstring>
+ </property>
+ <property name="text">
+ <string>Auto save &amp;interval:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>timeEditAutoSave</cstring>
+ </property>
+ </widget>
+ <widget class="QTimeEdit">
+ <property name="name">
+ <cstring>timeEditAutoSave</cstring>
+ </property>
+ <property name="time">
+ <time>
+ <hour>0</hour>
+ <minute>30</minute>
+ <second>0</second>
+ </time>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Plu&amp;gin Paths</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>textEditPluginPaths</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer3</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>
+ <property name="whatsThis" stdset="0">
+ <string>A splash screen is displayed when starting Qt Designer if this option is checked.</string>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>GroupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Ge&amp;neral</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxWorkspace</cstring>
+ </property>
+ <property name="text">
+ <string>Restore last &amp;workspace on startup</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Restore last workspace</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The current workspace settings will be restored the next time you start Qt Designer if this option is checked.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxSplash</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;splash screen on startup</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Show Splashscreen</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A splash screen is displayed when starting Qt Designer if this option is checked.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxStartDialog</cstring>
+ </property>
+ <property name="text">
+ <string>Show start &amp;dialog</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkAutoEdit</cstring>
+ </property>
+ <property name="text">
+ <string>Disable data&amp;base auto-edit in preview</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxTextLabels</cstring>
+ </property>
+ <property name="text">
+ <string>Show toolbutton lab&amp;els</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Text Labels</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Text labels will be used in the toolbars if this is checked.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>groupBoxGrid</cstring>
+ </property>
+ <property name="title">
+ <string>G&amp;rid</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBoxSnapGrid</cstring>
+ </property>
+ <property name="text">
+ <string>Sn&amp;ap to grid</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Snap to the grid</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Snap to Grid&lt;/b&gt; is checked, the widgets snap to the grid using the the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>spinGridX</cstring>
+ </property>
+ <property name="maxValue">
+ <number>50</number>
+ </property>
+ <property name="minValue">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Grid resolution</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>spinGridY</cstring>
+ </property>
+ <property name="maxValue">
+ <number>50</number>
+ </property>
+ <property name="minValue">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Grid resolution</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Customize the grid-settings for all forms.&lt;/b&gt;&lt;p&gt;When &lt;b&gt;Show Grid&lt;/b&gt; is checked, a grid is shown on all forms using the X/Y resolution.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>Label1</cstring>
+ </property>
+ <property name="text">
+ <string>Grid-&amp;X:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinGridX</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Grid-&amp;Y:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinGridY</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Backgro&amp;und</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="StyledButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonColor</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose a color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select a color in the color dialog.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radioColor</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Co&amp;lor</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a background color</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use a background color.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radioPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Pixmap</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a background pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use a background pixmap.</string>
+ </property>
+ </widget>
+ <widget class="StyledButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonPixmap</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="scale" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose a pixmap file.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>helpButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>StyledButton</class>
+ <header location="local">styledbutton.h</header>
+ <sizehint>
+ <width>40</width>
+ <height>25</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>"image0"</pixmap>
+ <signal>clicked()</signal>
+ <signal>changed()</signal>
+ <property type="Color">color</property>
+ <property type="Pixmap">pixmap</property>
+ <property type="Bool">scale</property>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1112">789c9dd2cb8e9b301406e07d9e0225bba89a09601350d505302c5b7559a9eac23e6672b363620c0ca9faeef53949da2e2a55eab123f9e38f2f217e5e475f3e7f8cd6cf8bde0b7f8008f6c2456b3518337ffdf6e1fb62992451e8691ac5cb778be55304d1277b6e71fc12c6ab0d157222e61bd8e4c812196f6216535a13f318624a6764b2495842e99558249014c81e99c6294b69d3376291424ae9806431638cd28628183081f4489e70ce13e4852878c129ad905992f18cd291283295517a466ed32ddfa64847945bb595c80e99a739cf29d54499ab9c528b2c58c10b86344428540148400a26b8a0541241b482d215523299494a0551c9562ae409091c32e0c82351410b942aa4e22a53941e882d36e41ed966d8903b2215f215f99a6143b6442afaafff5aff485658622584a091941256948443d1cabbdd6ebf3f28753c09a9e9cdc1fe703c9e4ea19f689a0430fa4c8908082be093d08d016bbb0bbd5e7ceafade5b30de19d083b3fa9e008cd39b9fafd69495b473af7fcfb15325c1d61eea0afaf005ddf97b5295c658a866338f97591babef7340fa396c6c5ca9e7fe650807d0bf566b4262299986ba335a3b4a2cc84b69ac85b1b673037d8fabf95b023a9c09cc7530e104dd5419ed6e27083fb09a7c752db5a9bd31cde4ec634ed8a39aebbe337618c3f6fdc5dee6d8b0bb0d6b5b8b1fad43d78fe4e14e3f6aace8e29d9d736777fea3c686eee0138c9726d4d00c548df7a315ff750f7ebc5ffc04a0e5308d</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>Preferences</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>Preferences</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>radioColor</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonColor</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>radioPixmap</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonPixmap</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>radioColor</tabstop>
+ <tabstop>radioPixmap</tabstop>
+ <tabstop>buttonColor</tabstop>
+ <tabstop>buttonPixmap</tabstop>
+ <tabstop>checkBoxSnapGrid</tabstop>
+ <tabstop>spinGridX</tabstop>
+ <tabstop>spinGridY</tabstop>
+ <tabstop>checkBoxWorkspace</tabstop>
+ <tabstop>checkBoxSplash</tabstop>
+ <tabstop>checkBoxStartDialog</tabstop>
+ <tabstop>checkAutoEdit</tabstop>
+ <tabstop>checkBoxTextLabels</tabstop>
+ <tabstop>helpButton</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>styledbutton.h</includehint>
+ <includehint>styledbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kdevdesigner/designer/previewframe.cpp b/kdevdesigner/designer/previewframe.cpp
new file mode 100644
index 00000000..2d14fb7b
--- /dev/null
+++ b/kdevdesigner/designer/previewframe.cpp
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvbox.h>
+#include <qpainter.h>
+
+#include "previewframe.h"
+
+PreviewFrame::PreviewFrame( QWidget *parent, const char *name )
+ : QVBox( parent, name )
+{
+ setMinimumSize(200, 200);
+ setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
+ setLineWidth(1);
+
+ PreviewWorkspace * w = new PreviewWorkspace( this );
+ w->setEraseColor(colorGroup().dark());
+ previewWidget = new PreviewWidget( w );
+ previewWidget->move( 10, 10 );
+}
+
+void PreviewFrame::setPreviewPalette(QPalette pal)
+{
+ previewWidget->setPalette(pal);
+}
+
+void PreviewWorkspace::paintEvent( QPaintEvent* )
+{
+ QPainter p ( this );
+ p.setPen( QPen( white ) );
+ p.drawText ( 0, height() / 2, width(), height(), AlignHCenter,
+ "The moose in the noose\nate the goose who was loose." );
+}
+
diff --git a/kdevdesigner/designer/previewframe.h b/kdevdesigner/designer/previewframe.h
new file mode 100644
index 00000000..632e8b9a
--- /dev/null
+++ b/kdevdesigner/designer/previewframe.h
@@ -0,0 +1,59 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PREVIEWFRAME_H
+#define PREVIEWFRAME_H
+
+#include <qvbox.h>
+#include <qworkspace.h>
+
+#include "previewwidgetimpl.h"
+
+class PreviewWorkspace : public QWorkspace
+{
+ Q_OBJECT
+public:
+ PreviewWorkspace( QWidget* parent = 0, const char* name = 0 )
+ : QWorkspace( parent, name ) {}
+ ~PreviewWorkspace() {}
+
+protected:
+ void paintEvent( QPaintEvent* );
+};
+
+class PreviewFrame : public QVBox
+{
+ Q_OBJECT
+
+public:
+ PreviewFrame( QWidget *parent = 0, const char *name = 0 );
+ void setPreviewPalette(QPalette);
+
+private:
+ PreviewWidget *previewWidget;
+};
+
+#endif
diff --git a/kdevdesigner/designer/previewwidget.ui b/kdevdesigner/designer/previewwidget.ui
new file mode 100644
index 00000000..f297d2d4
--- /dev/null
+++ b/kdevdesigner/designer/previewwidget.ui
@@ -0,0 +1,304 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PreviewWidgetBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PreviewWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>378</width>
+ <height>236</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Preview Window</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout17</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RadioButton1</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RadioButton2</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton2</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RadioButton3</cstring>
+ </property>
+ <property name="text">
+ <string>RadioButton3</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>ButtonGroup2</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>CheckBox1</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox1</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>CheckBox2</cstring>
+ </property>
+ <property name="text">
+ <string>CheckBox2</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QProgressBar">
+ <property name="name">
+ <cstring>ProgressBar1</cstring>
+ </property>
+ <property name="progress">
+ <number>50</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>LineEdit1</cstring>
+ </property>
+ <property name="text">
+ <string>LineEdit</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>ComboBox</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>ComboBox1</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>SpinBox1</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QScrollBar">
+ <property name="name">
+ <cstring>ScrollBar1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>Slider1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QTextView">
+ <property name="name">
+ <cstring>textView</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>50</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;
+&lt;a href="http://www.trolltech.com/"&gt;http://www.trolltech.com&lt;/a&gt;
+&lt;/p&gt;
+&lt;p&gt;
+&lt;a href="http://www.kde.org/"&gt;http://www.kde.org&lt;/a&gt;
+&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <slot access="protected" language="C++" returnType="void">init()</slot>
+ <slot access="protected" language="C++" returnType="void">destroy()</slot>
+</connections>
+</UI>
diff --git a/kdevdesigner/designer/previewwidgetimpl.cpp b/kdevdesigner/designer/previewwidgetimpl.cpp
new file mode 100644
index 00000000..2c2c6528
--- /dev/null
+++ b/kdevdesigner/designer/previewwidgetimpl.cpp
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "qobjectlist.h"
+#include "previewwidgetimpl.h"
+
+PreviewWidget::PreviewWidget( QWidget *parent, const char *name )
+ : PreviewWidgetBase( parent, name )
+{
+ // install event filter on child widgets
+ QObjectList *l = queryList("QWidget");
+ QObjectListIt it(*l);
+ QObject * obj;
+ while ((obj = it.current()) != 0) {
+ ++it;
+ obj->installEventFilter(this);
+ ((QWidget*)obj)->setFocusPolicy(NoFocus);
+ }
+}
+
+void PreviewWidget::closeEvent(QCloseEvent *e)
+{
+ e->ignore();
+}
+
+bool PreviewWidget::eventFilter(QObject *, QEvent *e)
+{
+ switch ( e->type() ) {
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ case QEvent::Enter:
+ case QEvent::Leave:
+ return TRUE; // ignore;
+ default:
+ break;
+ }
+ return FALSE;
+}
diff --git a/kdevdesigner/designer/previewwidgetimpl.h b/kdevdesigner/designer/previewwidgetimpl.h
new file mode 100644
index 00000000..63227cdd
--- /dev/null
+++ b/kdevdesigner/designer/previewwidgetimpl.h
@@ -0,0 +1,43 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PREVIEWWIDGETIMPL_H
+#define PREVIEWWIDGETIMPL_H
+
+#include "previewwidget.h"
+
+class PreviewWidget : public PreviewWidgetBase
+{
+ Q_OBJECT
+
+public:
+ PreviewWidget( QWidget *parent = 0, const char *name = 0 );
+
+ void closeEvent(QCloseEvent *);
+ bool eventFilter(QObject *, QEvent *);
+};
+
+#endif
diff --git a/kdevdesigner/designer/project.cpp b/kdevdesigner/designer/project.cpp
new file mode 100644
index 00000000..2a261d20
--- /dev/null
+++ b/kdevdesigner/designer/project.cpp
@@ -0,0 +1,1558 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+**1 This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "project.h"
+#include "formwindow.h"
+#include "designerappiface.h"
+#include "../interfaces/languageinterface.h"
+#include "pixmapcollection.h"
+#ifndef QT_NO_SQL
+#include "dbconnectionimpl.h"
+#endif
+#include "resource.h"
+#include <qwidgetfactory.h>
+#include "outputwindow.h"
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qurl.h>
+#include <qobjectlist.h>
+#include <qfeatures.h>
+#include <qtextcodec.h>
+#include <qdom.h>
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include "mainwindow.h"
+#include <qworkspace.h>
+
+#ifndef QT_NO_SQL
+#include <qsqldatabase.h>
+#include <qsqlrecord.h>
+#include <qdatatable.h>
+#endif
+
+#include <stdlib.h>
+#ifdef Q_OS_UNIX
+# include <unistd.h>
+#endif
+
+#include <klocale.h>
+
+#ifndef QT_NO_SQL
+DatabaseConnection::~DatabaseConnection()
+{
+ delete iface;
+}
+
+bool DatabaseConnection::refreshCatalog()
+{
+#ifndef QT_NO_SQL
+ if ( loaded )
+ return TRUE;
+ if ( !open() )
+ return FALSE;
+ tbls = conn->tables( QSql::TableType( QSql::Tables | QSql::Views ) );
+ flds.clear();
+ for ( QStringList::Iterator it = tbls.begin(); it != tbls.end(); ++it ) {
+ QSqlRecord fil = conn->record( *it );
+ QStringList lst;
+ for ( uint j = 0; j < fil.count(); ++j )
+ lst << fil.field( j )->name();
+ flds.insert( *it, lst );
+ }
+ loaded = TRUE;
+ conn->close();
+ return loaded;
+#else
+ return FALSE;
+#endif
+}
+
+#ifndef QT_NO_SQL
+void DatabaseConnection::remove()
+{
+ if ( nm == "(default)" )
+ QSqlDatabase::removeDatabase( QSqlDatabase::defaultConnection );
+ else
+ QSqlDatabase::removeDatabase( nm );
+ // the above will effectively delete the current connection
+ conn = 0;
+}
+#endif
+
+bool DatabaseConnection::open( bool suppressDialog )
+{
+#ifndef QT_NO_SQL
+ // register our name, if nec
+ if ( nm == "(default)" ) {
+ if ( !QSqlDatabase::contains() ) // default doesn't exists?
+ conn = QSqlDatabase::addDatabase( drv );
+ else
+ conn = QSqlDatabase::database();
+ } else {
+ if ( !QSqlDatabase::contains( nm ) )
+ conn = QSqlDatabase::addDatabase( drv, nm );
+ else
+ conn = QSqlDatabase::database( nm );
+ }
+ conn->setDatabaseName( dbName );
+ conn->setUserName( uname );
+ conn->setPassword( pword );
+ conn->setHostName( hname );
+ conn->setPort( prt );
+ bool success = conn->open();
+ for( ; suppressDialog == FALSE ; ) {
+ bool done = FALSE;
+ if ( !success ) {
+ DatabaseConnectionEditor dia( this, 0 , 0 , TRUE );
+ switch( dia.exec() ) {
+ case QDialog::Accepted:
+ done = FALSE;
+ break;
+ case QDialog::Rejected:
+ done = TRUE;
+ break;
+ }
+ }
+ if ( done )
+ break;
+ conn->setUserName( uname );
+ conn->setPassword( pword );
+ conn->setHostName( hname );
+ conn->setPort( prt );
+ success = conn->open();
+ if ( !success ) {
+ switch( QMessageBox::warning( project->messageBoxParent(), i18n( "Connection" ),
+ i18n( "Could not connect to the database.\n"
+ "Press 'OK' to continue or 'Cancel' to "
+ "specify different\nconnection information.\n" )
+ + QString( "[" + conn->lastError().driverText() + "\n" +
+ conn->lastError().databaseText() + "]\n" ),
+ i18n( "&OK" ),
+ i18n( "&Cancel" ), QString::null, 0, 1 ) ) {
+ case 0: // OK or Enter
+ continue;
+ case 1: // Cancel or Escape
+ done = TRUE;
+ break;
+ }
+ } else
+ break;
+ if ( done )
+ break;
+ }
+ if ( !success ) {
+ dbErr = conn->lastError().driverText() + "\n" + conn->lastError().databaseText();
+ remove();
+ }
+ return success;
+#else
+ return FALSE;
+#endif
+}
+
+void DatabaseConnection::close()
+{
+ if ( !loaded )
+ return;
+#ifndef QT_NO_SQL
+ if ( conn ) {
+ conn->close();
+ }
+#endif
+}
+
+DesignerDatabase *DatabaseConnection::iFace()
+{
+ if ( !iface )
+ iface = new DesignerDatabaseImpl( this );
+ return iface;
+}
+
+#endif
+
+////////
+
+bool Project::isDummy() const
+{
+ return isDummyProject;
+}
+
+Project::Project( const QString &fn, const QString &pName,
+ QPluginManager<ProjectSettingsInterface> *pm, bool isDummy,
+ const QString &l )
+ : proName( pName ), projectSettingsPluginManager( pm ), isDummyProject( isDummy )
+{
+ modified = TRUE;
+ pixCollection = new PixmapCollection( this );
+ iface = 0;
+ lang = l;
+ is_cpp = lang == "C++";
+ cfg.insert( "(all)", "qt warn_on release" );
+ templ = "app";
+ setFileName( fn );
+ if ( !pName.isEmpty() )
+ proName = pName;
+ sourcefiles.setAutoDelete( TRUE );
+ modified = FALSE;
+ objs.setAutoDelete( FALSE );
+ fakeFormFiles.setAutoDelete( FALSE );
+}
+
+Project::~Project()
+{
+ if ( singleProjectMode() )
+ removeTempProject();
+ delete iface;
+ delete pixCollection;
+}
+
+void Project::setModified( bool b )
+{
+ modified = b;
+ emit projectModified();
+}
+
+#ifndef QT_NO_SQL
+DatabaseConnection *Project::databaseConnection( const QString &name )
+{
+ for ( DatabaseConnection *conn = dbConnections.first();
+ conn;
+ conn = dbConnections.next() ) {
+ if ( conn->name() == name )
+ return conn;
+ }
+ return 0;
+}
+#endif
+
+void Project::setFileName( const QString &fn, bool doClear )
+{
+ if ( fn == filename )
+ return;
+
+ if ( singleProjectMode() ) {
+ QString qsa = QString( getenv( "HOME" ) ) + QString( "/.qsa" );
+ if ( !QFile::exists( qsa ) ) {
+ QDir d;
+ d.mkdir( qsa );
+ }
+ if ( fn == singleProFileName )
+ return;
+ singleProFileName = fn;
+ static int counter = 0;
+ QString str_counter = QString::number( counter++ );
+ str_counter = "/.qsa/" + str_counter;
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ filename = QString( getenv( "HOME" ) + str_counter + QString( "tmp_" ) +
+ QFileInfo( fn ).baseName() + "/" + QFileInfo( fn ).baseName() + ".pro" );
+ removeTempProject();
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) ) {
+ filename = iface->uncompressProject( makeAbsolute( singleProFileName ),
+ QString( getenv( "HOME" ) +
+ str_counter + QString( "tmp_" ) +
+ QFileInfo( fn ).baseName() ) );
+ proName = makeAbsolute( singleProFileName );
+ }
+ } else {
+ filename = fn;
+ if ( !filename.endsWith( ".pro" ) )
+ filename += ".pro";
+ proName = filename;
+ }
+
+
+ if ( proName.contains( '.' ) )
+ proName = proName.left( proName.find( '.' ) );
+
+ if ( !doClear )
+ return;
+ clear();
+ if ( QFile::exists( filename ) )
+ parse();
+}
+
+QString Project::fileName( bool singlePro ) const
+{
+ if ( singlePro )
+ return singleProFileName;
+ return filename;
+}
+
+QString Project::databaseDescription() const
+{
+ return dbFile;
+}
+
+QString Project::projectName() const
+{
+ return proName;
+}
+
+static QString parse_part( const QString &part )
+{
+ QString res;
+ bool inName = FALSE;
+ QString currName;
+ for ( int i = 0; i < (int)part.length(); ++i ) {
+ QChar c = part[ i ];
+ if ( !inName ) {
+ if ( c != ' ' && c != '\t' && c != '\n' && c != '=' && c != '\\' && c != '+' )
+ inName = TRUE;
+ else
+ continue;
+ }
+ if ( inName ) {
+ if ( c == '\n' )
+ break;
+ res += c;
+ }
+ }
+ return res;
+}
+
+QStringList parse_multiline_part( const QString &contents, const QString &key, int *start = 0 )
+{
+ if ( start )
+ *start = -1;
+ QString lastWord;
+ // Account for things like win32: SOURCES
+ int extraWhiteSpaceCount = 0;
+ int braceCount = 0;
+ for ( int i = 0; i < (int)contents.length(); ++i ) {
+ QChar c( contents[ i ] );
+ switch ( c ) {
+ case '{':
+ braceCount++;
+ lastWord = "";
+ break;
+ case '}':
+ braceCount--;
+ lastWord = "";
+ break;
+ case ' ': case '\t':
+ if (!key.startsWith(lastWord)) {
+ lastWord = "";
+ extraWhiteSpaceCount = 0;
+ } else {
+ extraWhiteSpaceCount++;
+ }
+ break;
+ case '\\': case '\n':
+ lastWord = "";
+ break;
+ default:
+ lastWord += c;
+ }
+
+ // ### we should read the 'bla { SOURCES= ... }' stuff as well (braceCount > 0)
+ if ( lastWord == key && braceCount == 0 ) {
+ if ( start )
+ *start = i - lastWord.length() - extraWhiteSpaceCount + 1;
+ QStringList lst;
+ bool inName = FALSE;
+ QString currName;
+ bool hadEqual = FALSE;
+ for ( ; i < (int)contents.length(); ++i ) {
+ c = contents[ i ];
+ if ( !hadEqual && c != '=' )
+ continue;
+ if ( !hadEqual ) {
+ hadEqual = TRUE;
+ continue;
+ }
+ if ( ( c.isLetter() || c.isDigit() || c == '.' || c == '/' || c == '_' || c == '\\' ||
+ c == '\"' || c == '\'' || c == '=' ||
+ c == '$' || c == '-' || c == '(' || c == ')' || c == ':' || c == '+' || c == ',' || c == '~' ) &&
+ c != ' ' && c != '\t' && c != '\n' ) {
+ if ( !inName )
+ currName = QString::null;
+ if ( c != '\\' || contents[i+1] != '\n' ) {
+ currName += c;
+ inName = TRUE;
+ }
+ } else {
+ if ( inName ) {
+ inName = FALSE;
+ if ( currName.simplifyWhiteSpace() != "\\" )
+ lst.append( currName );
+ }
+ if ( c == '\n' && i > 0 && contents[ (int)i - 1 ] != '\\' )
+ break;
+ }
+ }
+ return lst;
+ }
+ }
+
+ return QStringList();
+}
+
+void Project::parse()
+{
+ QFile f( filename );
+ if ( !f.exists() || !f.open( IO_ReadOnly ) )
+ return;
+ QTextStream ts( &f );
+ QString contents = ts.read();
+ f.close();
+
+ proName = QFileInfo( filename ).baseName();
+
+ QStringList::ConstIterator it;
+
+ int i = contents.find( "LANGUAGE" );
+ if ( i != -1 ) {
+ lang = "";
+ is_cpp = FALSE;
+ QString part = contents.mid( i + QString( "LANGUAGE" ).length() );
+ lang = parse_part( part );
+ is_cpp = lang == "C++";
+ }
+
+ i = contents.find( "DBFILE" );
+ if ( i != -1 ) {
+ dbFile = "";
+ QString part = contents.mid( i + QString( "DBFILE" ).length() );
+ dbFile = parse_part( part );
+ }
+
+ QStringList uifiles = parse_multiline_part( contents, "FORMS" );
+ uifiles += parse_multiline_part( contents, "INTERFACES" ); // compatibility
+ for ( it = uifiles.begin(); it != uifiles.end(); ++it ) {
+ if ( (*it).startsWith( "__APPOBJ" ) )
+ continue;
+ (void) new FormFile( *it, FALSE, this );
+ }
+
+
+ i = contents.find( "TEMPLATE" );
+ if ( i != -1 ) {
+ templ = "";
+ QString part = contents.mid( i + QString( "TEMPLATE" ).length() );
+ templ = parse_part( part );
+ }
+
+ readPlatformSettings( contents, "CONFIG", cfg );
+ readPlatformSettings( contents, "LIBS", lbs );
+ readPlatformSettings( contents, "INCLUDEPATH", inclPath );
+ readPlatformSettings( contents, "DEFINES", defs );
+ readPlatformSettings( contents, "SOURCES", sources );
+ readPlatformSettings( contents, "HEADERS", headers );
+
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if ( iface ) {
+ QStringList sourceKeys;
+ iface->sourceProjectKeys( sourceKeys );
+ for ( QStringList::Iterator it = sourceKeys.begin(); it != sourceKeys.end(); ++it ) {
+ QStringList lst = parse_multiline_part( contents, *it );
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ (void) new SourceFile( *it, FALSE, this );
+ }
+ }
+
+ updateCustomSettings();
+
+ for ( it = csList.begin(); it != csList.end(); ++it ) {
+ i = contents.find( *it );
+ if ( i != -1 ) {
+ QString val = "";
+ QString part = contents.mid( i + QString( *it ).length() );
+ val = parse_part( part );
+ customSettings.replace( *it, val );
+ }
+ }
+
+ loadConnections();
+
+ QStringList images = parse_multiline_part( contents, "IMAGES" );
+
+ // ### remove that for the final - this is beta-compatibility
+ if ( images.isEmpty() && QDir( QFileInfo( filename ).dirPath( TRUE ) + "/images" ).exists() ) {
+ images = QDir( QFileInfo( filename ).dirPath( TRUE ) + "/images" ).entryList();
+ for ( int i = 0; i < (int)images.count(); ++i )
+ images[ i ].prepend( "images/" );
+ modified = TRUE;
+ }
+
+ for ( QStringList::ConstIterator pit = images.begin(); pit != images.end(); ++pit )
+ pixCollection->load( *pit );
+}
+
+void Project::clear()
+{
+ dbFile = "";
+ proName = "unnamed";
+ desc = "";
+}
+
+bool Project::removeSourceFile( SourceFile *sf )
+{
+ if ( !sourcefiles.containsRef( sf ) )
+ return FALSE;
+ if ( !sf->close() )
+ return FALSE;
+ sourcefiles.removeRef( sf );
+ modified = TRUE;
+ emit sourceFileRemoved( sf );
+ return TRUE;
+}
+
+void Project::setDatabaseDescription( const QString &db )
+{
+ dbFile = db;
+}
+
+void Project::setDescription( const QString &s )
+{
+ desc = s;
+}
+
+QString Project::description() const
+{
+ return desc;
+}
+
+
+bool Project::isValid() const
+{
+ // #### do more checking here?
+ if ( filename.isEmpty() || proName.isEmpty() )
+ return FALSE;
+
+ return TRUE;
+}
+
+QString Project::makeAbsolute( const QString &f )
+{
+ if ( isDummy() )
+ return f;
+ QString encodedUrl = QFileInfo( filename ).dirPath( TRUE );
+ QUrl::encode( encodedUrl );
+ QUrl u( encodedUrl, f );
+ return u.path();
+}
+
+QString Project::makeRelative( const QString &f )
+{
+ if ( isDummy() )
+ return f;
+ QString p = QFileInfo( filename ).dirPath( TRUE );
+ QString f2 = f;
+ if ( f2.left( p.length() ) == p )
+ f2.remove( 0, p.length() + 1 );
+ return f2;
+}
+
+static void remove_contents( QString &contents, const QString &s )
+{
+ int i = contents.find( s );
+ if ( i != -1 ) {
+ int start = i;
+ int end = contents.find( '\n', i );
+ if ( end == -1 )
+ end = contents.length() - 1;
+ contents.remove( start, end - start + 1 );
+ }
+}
+
+static void remove_multiline_contents( QString &contents, const QString &s, int *strt = 0 )
+{
+ int i = contents.find( s );
+ if ( strt )
+ *strt = i;
+ int start = i;
+ bool lastWasBackspash = FALSE;
+ if ( i != -1 && ( i == 0 || contents[ i - 1 ] != '{' || contents[ i - 1 ] != ':' ) ) {
+ for ( ; i < (int)contents.length(); ++i ) {
+ if ( contents[ i ] == '\n' && !lastWasBackspash )
+ break;
+ lastWasBackspash = ( contents[ i ] == '\\' ||
+ lastWasBackspash && ( contents[ i ] == ' ' || contents[ i ] == '\t' ) );
+ }
+ contents.remove( start, i - start + 1 );
+ }
+}
+
+void Project::save( bool onlyProjectFile )
+{
+ bool anythingModified = FALSE;
+
+ // save sources and forms
+ if ( !onlyProjectFile ) {
+
+ saveConnections();
+
+ for ( SourceFile *sf = sourcefiles.first(); sf; sf = sourcefiles.next() ) {
+ anythingModified = anythingModified || sf->isModified();
+ if ( !sf->save() )
+ return;
+ }
+
+ for ( FormFile *ff = formfiles.first(); ff; ff = formfiles.next() ) {
+ anythingModified = anythingModified || ff->isModified();
+ if ( !ff->save() )
+ return;
+ }
+ }
+
+ if ( isDummy() || filename.isEmpty() )
+ return;
+
+ if ( !modified ) {
+ if ( singleProjectMode() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) )
+ iface->compressProject( makeAbsolute( filename ), singleProFileName, anythingModified );
+ }
+ return;
+ }
+
+ QFile f( filename );
+ QString original = "";
+
+ // read the existing file
+ bool hasPreviousContents = FALSE;
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ original = ts.read();
+ f.close();
+ hasPreviousContents = TRUE;
+ remove_contents( original, "{SOURCES+=" ); // ### compatibility with early 3.0 betas
+ remove_contents( original, "DBFILE" );
+ remove_contents( original, "LANGUAGE" );
+ remove_contents( original, "TEMPLATE" );
+ removePlatformSettings( original, "CONFIG" );
+ removePlatformSettings( original, "DEFINES" );
+ removePlatformSettings( original, "LIBS" );
+ removePlatformSettings( original, "INCLUDEPATH" );
+ removePlatformSettings( original, "SOURCES" );
+ removePlatformSettings( original, "HEADERS" );
+ remove_multiline_contents( original, "FORMS" );
+ remove_multiline_contents( original, "INTERFACES" ); // compatibility
+ remove_multiline_contents( original, "IMAGES" );
+ for ( QStringList::Iterator it = csList.begin(); it != csList.end(); ++it )
+ remove_contents( original, *it );
+ }
+
+ // the contents of the saved file
+ QString contents;
+
+ // template
+ contents += "TEMPLATE\t= " + templ + "\n";
+
+ // language
+ contents += "LANGUAGE\t= " + lang + "\n";
+ contents += "\n";
+
+ // config
+ writePlatformSettings( contents, "CONFIG", cfg );
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if ( iface ) {
+ QStringList sourceKeys;
+ iface->sourceProjectKeys( sourceKeys );
+ for ( QStringList::Iterator spit = sourceKeys.begin(); spit != sourceKeys.end(); ++spit )
+ remove_multiline_contents( contents, *spit );
+ }
+ contents += "\n";
+
+ // libs, defines, includes
+ writePlatformSettings( contents, "LIBS", lbs );
+ writePlatformSettings( contents, "DEFINES", defs );
+ writePlatformSettings( contents, "INCLUDEPATH", inclPath );
+ writePlatformSettings( contents, "SOURCES", sources );
+ writePlatformSettings( contents, "HEADERS", headers );
+
+ // unix
+ if ( !hasPreviousContents ) {
+ contents +=
+ "unix {\n"
+ " UI_DIR = .ui\n"
+ " MOC_DIR = .moc\n"
+ " OBJECTS_DIR = .obj\n"
+ "}\n";
+ }
+ contents += "\n";
+
+ // sources
+ if ( !sourcefiles.isEmpty() && iface ) {
+ QMap<QString, QStringList> sourceToKey;
+ for ( SourceFile *f = sourcefiles.first(); f; f = sourcefiles.next() ) {
+ QString key = iface->projectKeyForExtension( QFileInfo( f->fileName() ).extension() );
+ QStringList lst = sourceToKey[ key ];
+ lst << makeRelative( f->fileName() );
+ sourceToKey.replace( key, lst );
+ }
+
+ for ( QMap<QString, QStringList>::Iterator skit = sourceToKey.begin();
+ skit != sourceToKey.end(); ++skit ) {
+ QString part = skit.key() + "\t+= ";
+ QStringList lst = *skit;
+ for ( QStringList::Iterator sit = lst.begin(); sit != lst.end(); ++sit ) {
+ part += *sit;
+ part += ++sit != lst.end() ? " \\\n\t" : "";
+ --sit;
+ }
+ part += "\n";
+ contents += part;
+ }
+ }
+
+ // forms and interfaces
+ if ( !formfiles.isEmpty() ) {
+ contents += "FORMS\t= ";
+ for ( QPtrListIterator<FormFile> fit = formfiles; fit.current(); ++fit ) {
+ contents += fit.current()->fileName() +
+ (fit != formfiles.last() ? " \\\n\t" : "");
+ }
+ contents += "\n";
+ }
+
+ // images
+ if ( !pixCollection->isEmpty() ) {
+ contents += "IMAGES\t= ";
+ QValueList<PixmapCollection::Pixmap> pixmaps = pixCollection->pixmaps();
+ for ( QValueList<PixmapCollection::Pixmap>::Iterator it = pixmaps.begin();
+ it != pixmaps.end(); ++it ) {
+ contents += makeRelative( (*it).absname );
+ contents += ++it != pixmaps.end() ? " \\\n\t" : "";
+ --it;
+ }
+ contents += "\n";
+ }
+
+ // database
+ if ( !dbFile.isEmpty() )
+ contents += "DBFILE\t= " + dbFile + "\n";
+ contents += "\n";
+
+ // custom settings
+ for ( QStringList::Iterator it = csList.begin(); it != csList.end(); ++it ) {
+ QString val = *customSettings.find( *it );
+ if ( !val.isEmpty() )
+ contents += *it + "\t= " + val + "\n";
+ }
+
+ if ( !f.open( IO_WriteOnly | IO_Translate ) ) {
+ QMessageBox::warning( messageBoxParent(),
+ "Save Project Failed", "Couldn't write project file " + filename );
+ return;
+ }
+
+ QTextStream os( &f );
+ os << contents;
+ if (hasPreviousContents)
+ os << original;
+
+ f.close();
+
+ setModified( FALSE );
+
+ if ( singleProjectMode() ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( iface && iface->supports( LanguageInterface::CompressProject ) )
+ iface->compressProject( makeAbsolute( filename ), singleProFileName, TRUE );
+ }
+}
+
+#ifndef QT_NO_SQL
+QPtrList<DatabaseConnection> Project::databaseConnections() const
+{
+ return dbConnections;
+}
+#endif
+
+#ifndef QT_NO_SQL
+void Project::setDatabaseConnections( const QPtrList<DatabaseConnection> &lst )
+{
+ dbConnections = lst;
+}
+#endif
+
+#ifndef QT_NO_SQL
+void Project::addDatabaseConnection( DatabaseConnection *conn )
+{
+ dbConnections.append( conn );
+ modified = TRUE;
+}
+#endif
+
+#ifndef QT_NO_SQL
+void Project::removeDatabaseConnection( const QString &c )
+{
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() ) {
+ if ( conn->name() == c ) {
+ conn->remove();
+ dbConnections.removeRef( conn );
+ delete conn;
+ return;
+ }
+ }
+}
+#endif
+
+#ifndef QT_NO_SQL
+QStringList Project::databaseConnectionList()
+{
+ QStringList lst;
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() )
+ lst << conn->name();
+ return lst;
+}
+#endif
+
+#ifndef QT_NO_SQL
+QStringList Project::databaseTableList( const QString &connection )
+{
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( !conn ) {
+ return QStringList();
+ }
+ return conn->tables();
+}
+#endif
+
+#ifndef QT_NO_SQL
+QStringList Project::databaseFieldList( const QString &connection, const QString &table )
+{
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( !conn )
+ return QStringList();
+ return conn->fields( table );
+}
+#endif
+
+#ifndef QT_NO_SQL
+static QString makeIndent( int indent )
+{
+ QString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+#endif
+
+#ifndef QT_NO_SQL
+static void saveSingleProperty( QTextStream &ts, const QString& name, const QString& value, int indent )
+{
+ ts << makeIndent( indent ) << "<property name=\"" << name << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<string>" << value << "</string>" << endl;
+ --indent;
+ ts << makeIndent( indent ) << "</property>" << endl;
+}
+#endif
+
+void Project::saveConnections()
+{
+#ifndef QT_NO_SQL
+ if ( dbFile.isEmpty() ) {
+ QFileInfo fi( fileName() );
+ setDatabaseDescription( fi.baseName() + ".db" );
+ }
+
+ QFile f( makeAbsolute( dbFile ) );
+
+ if ( dbConnections.isEmpty() ) {
+ if ( f.exists() )
+ f.remove();
+ setDatabaseDescription( "" );
+ modified = TRUE;
+ return;
+ }
+
+ /* .db xml */
+ if ( f.open( IO_WriteOnly | IO_Translate ) ) {
+ QTextStream ts( &f );
+ ts.setCodec( QTextCodec::codecForName( "UTF-8" ) );
+ ts << "<!DOCTYPE DB><DB version=\"1.0\">" << endl;
+
+ /* db connections */
+ int indent = 0;
+ for ( DatabaseConnection *conn = dbConnections.first(); conn; conn = dbConnections.next() ) {
+ ts << makeIndent( indent ) << "<connection>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", conn->name(), indent );
+ saveSingleProperty( ts, "driver", conn->driver(), indent );
+ saveSingleProperty( ts, "database", conn->database(), indent );
+ saveSingleProperty( ts, "username", conn->username(), indent );
+ saveSingleProperty( ts, "hostname", conn->hostname(), indent );
+ saveSingleProperty( ts, "port", QString::number( conn->port() ), indent );
+
+ /* connection tables */
+ QStringList tables = conn->tables();
+ for ( QStringList::Iterator it = tables.begin();
+ it != tables.end(); ++it ) {
+ ts << makeIndent( indent ) << "<table>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", (*it), indent );
+
+ /* tables fields */
+ QStringList fields = conn->fields( *it );
+ for ( QStringList::Iterator it2 = fields.begin();
+ it2 != fields.end(); ++it2 ) {
+ ts << makeIndent( indent ) << "<field>" << endl;
+ ++indent;
+ saveSingleProperty( ts, "name", (*it2), indent );
+ --indent;
+ ts << makeIndent( indent ) << "</field>" << endl;
+ }
+
+ --indent;
+ ts << makeIndent( indent ) << "</table>" << endl;
+ }
+
+ --indent;
+ ts << makeIndent( indent ) << "</connection>" << endl;
+ }
+
+ ts << "</DB>" << endl;
+ f.close();
+ }
+#endif
+}
+
+#ifndef QT_NO_SQL
+static QDomElement loadSingleProperty( QDomElement e, const QString& name )
+{
+ QDomElement n;
+ for ( n = e.firstChild().toElement();
+ !n.isNull();
+ n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" && n.toElement().attribute("name") == name )
+ return n;
+ }
+ return n;
+}
+#endif
+
+void Project::loadConnections()
+{
+#ifndef QT_NO_SQL
+ if ( dbFile.isEmpty() || !QFile::exists( makeAbsolute( dbFile ) ) )
+ return;
+
+ QFile f( makeAbsolute( dbFile ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+ if ( doc.setContent( &f, &errMsg, &errLine ) ) {
+ QDomElement e;
+ e = doc.firstChild().toElement();
+
+ /* connections */
+ QDomNodeList connections = e.toElement().elementsByTagName( "connection" );
+ for ( uint i = 0; i < connections.length(); i++ ) {
+ QDomElement connection = connections.item(i).toElement();
+ QDomElement connectionName = loadSingleProperty( connection, "name" );
+ QDomElement connectionDriver = loadSingleProperty( connection, "driver" );
+ QDomElement connectionDatabase = loadSingleProperty( connection,
+ "database" );
+ QDomElement connectionUsername = loadSingleProperty( connection,
+ "username" );
+ QDomElement connectionHostname = loadSingleProperty( connection,
+ "hostname" );
+ QDomElement connectionPort = loadSingleProperty( connection,
+ "port" );
+
+ DatabaseConnection *conn = new DatabaseConnection( this );
+ conn->setName( connectionName.firstChild().firstChild().toText().data() );
+ conn->setDriver( connectionDriver.firstChild().firstChild().toText().data() );
+ conn->setDatabase( connectionDatabase.firstChild().firstChild().toText().data() );
+ conn->setUsername( connectionUsername.firstChild().firstChild().toText().data() );
+ conn->setHostname( connectionHostname.firstChild().firstChild().toText().data() );
+ conn->setPort( QString( connectionPort.firstChild().firstChild().toText().data() ).toInt() );
+
+ /* connection tables */
+ QDomNodeList tables = connection.toElement().elementsByTagName( "table" );
+ for ( uint j = 0; j < tables.length(); j++ ) {
+ QDomElement table = tables.item(j).toElement();
+ QDomElement tableName = loadSingleProperty( table, "name" );
+ conn->addTable( tableName.firstChild().firstChild().toText().data() );
+
+ /* table fields */
+ QStringList fieldList;
+ QDomNodeList fields = table.toElement().elementsByTagName( "field" );
+ for ( uint k = 0; k < fields.length(); k++ ) {
+ QDomElement field = fields.item(k).toElement();
+ QDomElement fieldName = loadSingleProperty( field, "name" );
+ fieldList.append( fieldName.firstChild().firstChild().toText().data() );
+ }
+ conn->setFields( tableName.firstChild().firstChild().toText().data(),
+ fieldList );
+ }
+
+ dbConnections.append( conn );
+ }
+ } else {
+ qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine );
+ }
+ f.close();
+ }
+#endif
+}
+
+/*! Opens the database \a connection. The connection remains open and
+can be closed again with closeDatabase().
+*/
+
+bool Project::openDatabase( const QString &connection, bool suppressDialog )
+{
+#ifndef QT_NO_SQL
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( connection.isEmpty() && !conn )
+ conn = databaseConnection( "(default)" );
+ if ( !conn )
+ return FALSE;
+ bool b = conn->open( suppressDialog );
+ return b;
+#else
+ Q_UNUSED( connection );
+ Q_UNUSED( suppressDialog );
+ return FALSE;
+#endif
+}
+
+/*! Closes the database \a connection.
+*/
+void Project::closeDatabase( const QString &connection )
+{
+#ifndef QT_NO_SQL
+ DatabaseConnection *conn = databaseConnection( connection );
+ if ( connection.isEmpty() && !conn )
+ conn = databaseConnection( "(default)" );
+ if ( !conn )
+ return;
+ conn->close();
+#else
+ Q_UNUSED( connection );
+#endif
+}
+
+// void Project::formClosed( FormWindow *fw )
+// {
+// formWindows.remove( fw );
+// }
+
+QObjectList *Project::formList( bool resolveFakeObjects ) const
+{
+ QObjectList *l = new QObjectList;
+ for ( QPtrListIterator<FormFile> forms(formfiles); forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->formWindow() ) {
+ if ( resolveFakeObjects && f->formWindow()->isFake() )
+ l->append( objectForFakeForm( f->formWindow() ) );
+ else
+ l->append( f->formWindow()->child( 0, "QWidget" ) );
+ } else if ( f->isFake() ) {
+ l->append( objectForFakeFormFile( f ) );
+ }
+ }
+ return l;
+}
+
+DesignerProject *Project::iFace()
+{
+ if ( !iface )
+ iface = new DesignerProjectImpl( this );
+ return iface;
+}
+
+void Project::setLanguage( const QString &l )
+{
+ if ( l == lang )
+ return;
+ lang = l;
+ is_cpp = lang == "C++";
+ updateCustomSettings();
+ modified = TRUE;
+}
+
+QString Project::language() const
+{
+ return lang;
+}
+
+void Project::setCustomSetting( const QString &key, const QString &value )
+{
+ customSettings.remove( key );
+ customSettings.insert( key, value );
+ modified = TRUE;
+}
+
+QString Project::customSetting( const QString &key ) const
+{
+ return *customSettings.find( key );
+}
+
+void Project::updateCustomSettings()
+{
+ if ( !projectSettingsPluginManager )
+ return;
+
+/*
+ ProjectSettingsInterface *iface = 0;
+ projectSettingsPluginManager->queryInterface( lang, (QUnknownInterface**)&iface );
+ if ( !iface )
+ return;
+ csList = iface->projectSettings();
+ iface->release();
+*/
+
+ QInterfacePtr<ProjectSettingsInterface> iface;
+ projectSettingsPluginManager->queryInterface( lang, &iface );
+ if ( !iface )
+ return;
+ csList = iface->projectSettings();
+ customSettings.clear();
+
+}
+
+void Project::setActive( bool b )
+{
+ pixCollection->setActive( b );
+}
+
+void Project::addSourceFile( SourceFile *sf )
+{
+ sourcefiles.append( sf );
+ modified = TRUE;
+ emit sourceFileAdded( sf );
+}
+
+
+SourceFile* Project::findSourceFile( const QString& filename, SourceFile *ignore ) const
+{
+ QPtrListIterator<SourceFile> it(sourcefiles);
+ while ( it.current() ) {
+ if ( it.current() != ignore && it.current()->fileName() == filename )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+FormFile* Project::findFormFile( const QString& filename, FormFile *ignore ) const
+{
+ QPtrListIterator<FormFile> it(formfiles);
+ while ( it.current() ) {
+ if ( it.current() != ignore && it.current()->fileName() == filename )
+ return it.current();
+ ++it;
+ }
+ return 0;
+}
+
+void Project::setIncludePath( const QString &platform, const QString &path )
+{
+ if ( inclPath[platform] == path )
+ return;
+ inclPath.replace( platform, path );
+ modified = TRUE;
+}
+
+void Project::setLibs( const QString &platform, const QString &path )
+{
+ lbs.replace( platform, path );
+}
+
+void Project::setDefines( const QString &platform, const QString &path )
+{
+ defs.replace( platform, path );
+}
+
+void Project::setConfig( const QString &platform, const QString &config )
+{
+ cfg.replace( platform, config );
+}
+
+QString Project::config( const QString &platform ) const
+{
+ return cfg[ platform ];
+}
+
+QString Project::libs( const QString &platform ) const
+{
+ return lbs[ platform ];
+}
+
+QString Project::defines( const QString &platform ) const
+{
+ return defs[ platform ];
+}
+
+QString Project::includePath( const QString &platform ) const
+{
+ return inclPath[ platform ];
+}
+
+QString Project::templte() const
+{
+ return templ;
+}
+
+void Project::setTemplate( const QString &t )
+{
+ templ = t;
+}
+
+void Project::readPlatformSettings( const QString &contents,
+ const QString &setting,
+ QMap<QString, QString> &res )
+{
+ const QString platforms[] = { "", "win32", "unix", "mac", QString::null };
+ for ( int i = 0; platforms[ i ] != QString::null; ++i ) {
+ QString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ QStringList lst = parse_multiline_part( contents, p + setting );
+ QString s = lst.join( " " );
+ QString key = platforms[ i ];
+ if ( key.isEmpty() )
+ key = "(all)";
+ res.replace( key, s );
+ }
+}
+
+void Project::removePlatformSettings( QString &contents, const QString &setting )
+{
+ const QString platforms[] = { "win32", "unix", "mac", "", QString::null };
+ for ( int i = 0; platforms[ i ] != QString::null; ++i ) {
+ QString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ remove_multiline_contents( contents, p + setting );
+ }
+}
+
+void Project::writePlatformSettings( QString &contents, const QString &setting,
+ const QMap<QString, QString> &input )
+{
+ const QString platforms[] = { "", "win32", "unix", "mac", QString::null };
+ int i;
+ LanguageInterface *iface = MetaDataBase::languageInterface( lang );
+ if (iface && (setting == "SOURCES" || setting == "HEADERS")) // The (all) part will be saved later on
+ i = 1;
+ else
+ i = 0;
+ for (; platforms[ i ] != QString::null; ++i ) {
+ QString p = platforms[ i ];
+ if ( !p.isEmpty() )
+ p += ":";
+ QString key = platforms[ i ];
+ if ( key.isEmpty() )
+ key = "(all)";
+ QMap<QString, QString>::ConstIterator it = input.find( key );
+ if ( it == input.end() || (*it).isEmpty() )
+ continue;
+ contents += p + setting + "\t+= " + *it + "\n";
+ }
+}
+
+void Project::addFormFile( FormFile *ff )
+{
+ formfiles.append( ff );
+ modified = TRUE;
+ emit formFileAdded( ff );
+}
+
+bool Project::removeFormFile( FormFile *ff )
+{
+ if ( !formfiles.containsRef( ff ) )
+ return FALSE;
+ if ( !ff->close() )
+ return FALSE;
+ formfiles.removeRef( ff );
+ modified = TRUE;
+ emit formFileRemoved( ff );
+ return TRUE;
+}
+
+void Project::addObject( QObject *o )
+{
+ bool wasModified = modified;
+ objs.append( o );
+ FormFile *ff = new FormFile( "", FALSE, this, "qt_fakewindow" );
+ ff->setFileName( "__APPOBJ" + QString( o->name() ) + ".ui" );
+ fakeFormFiles.insert( (void*)o, ff );
+ MetaDataBase::addEntry( o );
+ if ( hasGUI() ) {
+ QWidget *parent = MainWindow::self ? MainWindow::self->qWorkspace() : 0;
+ FormWindow *fw = new FormWindow( ff, MainWindow::self, parent, "qt_fakewindow" );
+ fw->setProject( this );
+ if ( QFile::exists( ff->absFileName() ) )
+ Resource::loadExtraSource( ff, ff->absFileName(),
+ MetaDataBase::languageInterface( language() ), FALSE );
+ if ( MainWindow::self )
+ fw->setMainWindow( MainWindow::self );
+ if ( MainWindow::self ) {
+ QApplication::sendPostedEvents( MainWindow::self->qWorkspace(), QEvent::ChildInserted );
+ connect( fw,
+ SIGNAL( undoRedoChanged( bool, bool, const QString &, const QString & ) ),
+ MainWindow::self,
+ SLOT( updateUndoRedo( bool, bool, const QString &, const QString & ) )
+ );
+ }
+ if ( fw->parentWidget() ) {
+ fw->parentWidget()->setFixedSize( 1, 1 );
+ fw->show();
+ }
+ } else {
+ if ( QFile::exists( ff->absFileName() ) )
+ Resource::loadExtraSource( ff, ff->absFileName(),
+ MetaDataBase::languageInterface( language() ), FALSE );
+ }
+ emit objectAdded( o );
+ modified = wasModified;
+}
+
+void Project::setObjects( const QObjectList &ol )
+{
+ for ( QObjectListIt it( ol ); it.current(); ++it )
+ addObject( it.current() );
+}
+
+void Project::removeObject( QObject *o )
+{
+ bool wasModified = modified;
+ objs.removeRef( o );
+ MetaDataBase::removeEntry( o );
+ fakeFormFiles.remove( (void*)o );
+ emit objectRemoved( o );
+ modified = wasModified;
+}
+
+QObjectList Project::objects() const
+{
+ return objs;
+}
+
+FormFile *Project::fakeFormFileFor( QObject *o ) const
+{
+ return fakeFormFiles.find( (void*)o );
+}
+
+QObject *Project::objectForFakeForm( FormWindow *fw ) const
+{
+ for ( QPtrDictIterator<FormFile> it( fakeFormFiles ); it.current(); ++it ) {
+ if ( it.current()->formWindow() == fw ||
+ it.current() == fw->formFile() )
+ return (QObject*)it.currentKey();
+ }
+ return 0;
+}
+
+QObject *Project::objectForFakeFormFile( FormFile *ff ) const
+{
+ for ( QPtrDictIterator<FormFile> it( fakeFormFiles ); it.current(); ++it ) {
+ if ( it.current() == ff )
+ return (QObject*)it.currentKey();
+ }
+ return 0;
+}
+
+void Project::removeTempProject()
+{
+ if ( !singleProjectMode() )
+ return;
+ QDir d( QFileInfo( filename ).dirPath() );
+ if ( !d.exists( QFileInfo( filename ).dirPath() ) )
+ return;
+ QStringList files = d.entryList( QDir::Files );
+ QStringList::Iterator it;
+ for ( it = files.begin(); it != files.end(); ++it ) {
+ d.remove( *it );
+ }
+ if ( d.exists( QFileInfo( filename ).dirPath() + "/images" ) ) {
+ d = QDir( QFileInfo( filename ).dirPath() + "/images" );
+ files = d.entryList( QDir::Files );
+ for ( it = files.begin(); it != files.end(); ++it )
+ d.remove( *it );
+ d = QDir( QFileInfo( filename ).dirPath() );
+ d.remove( "images" );
+ }
+ d.remove( QFileInfo( filename ).dirPath() );
+#if defined(Q_OS_UNIX)
+ // ##### implement for all platforms, ideally should be in Qt
+ ::rmdir( QFile::encodeName( d.absPath() ) );
+#endif
+}
+
+void Project::addAndEditFunction( const QString &function, const QString &functionBody, bool openDeveloper )
+{
+ for ( SourceFile *f = sourcefiles.first(); f; f = sourcefiles.next() ) {
+ if ( QFileInfo( f->fileName() ).baseName() == "main" ) {
+ QValueList<LanguageInterface::Function> funcs;
+ LanguageInterface *iface = MetaDataBase::languageInterface( language() );
+ if ( !iface )
+ return;
+ iface->functions( f->text(), &funcs );
+ QString func = function;
+ int i = func.find( '(' );
+ if ( i != -1 )
+ func = func.left( i );
+
+ bool found = FALSE;
+ for ( QValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
+ it != funcs.end(); ++it ) {
+ if ( (*it).name.left( (*it).name.find( '(' ) ) == func ) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if ( !found ) {
+ QString code = f->text();
+ if ( functionBody.isEmpty() )
+ code += "\n\n" + iface->createFunctionStart( "", func, "", "" ) + "()\n{\n\n}\n";
+ else
+ code += "\n\n" + iface->createFunctionStart( "", func, "", "" ) +
+ "()\n" + functionBody + "\n";
+ f->setText( code );
+ if ( f->editor() )
+ f->editor()->refresh( FALSE );
+ }
+
+ if ( openDeveloper ) {
+ if ( MainWindow::self )
+ MainWindow::self->editSource( f );
+ f->editor()->setFunction( func, "" );
+ }
+
+ break;
+ }
+ }
+}
+
+bool Project::hasParentObject( QObject *o )
+{
+ for ( QObject *p = objs.first(); p; p = objs.next() ) {
+ QObject *c = p->child( o->name(), o->className() );
+ if ( c )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+QString Project::qualifiedName( QObject *o )
+{
+ QString name = o->name();
+ QObject *p = o->parent();
+ while ( p ) {
+ name.prepend( QString( p->name() ) + "." );
+ if ( objs.findRef( p ) != -1 )
+ break;
+ p = p->parent();
+ }
+ return name;
+}
+
+bool Project::singleProjectMode() const
+{
+ return !MainWindow::self || MainWindow::self->singleProjectMode();
+}
+
+QWidget *Project::messageBoxParent() const
+{
+ return MainWindow::self;
+}
+
+void Project::designerCreated()
+{
+ for ( FormFile *ff = formfiles.first(); ff; ff = formfiles.next() ) {
+ FormWindow *fw = ff->formWindow();
+ if ( !fw || fw->mainWindow() )
+ continue;
+ fw->setMainWindow( MainWindow::self );
+ connect( fw, SIGNAL( undoRedoChanged( bool, bool, const QString &,
+ const QString & ) ),
+ MainWindow::self, SLOT( updateUndoRedo( bool, bool,
+ const QString &, const QString & ) ) );
+ fw->reparent( MainWindow::self->qWorkspace(), QPoint( 0, 0 ), FALSE );
+ QApplication::sendPostedEvents( MainWindow::self->qWorkspace(),
+ QEvent::ChildInserted );
+ fw->parentWidget()->setFixedSize( 1, 1 );
+ fw->show();
+ }
+}
+
+void Project::formOpened( FormWindow *fw )
+{
+ if ( fw->isFake() )
+ return;
+ emit newFormOpened( fw );
+}
+
+QString Project::locationOfObject( QObject *o )
+{
+ if ( !o )
+ return QString::null;
+
+ if ( MainWindow::self ) {
+ QWidgetList windows = MainWindow::self->qWorkspace()->windowList();
+ for ( QWidget *w = windows.first(); w; w = windows.next() ) {
+ FormWindow *fw = ::qt_cast<FormWindow*>(w);
+ SourceEditor *se = ::qt_cast<SourceEditor*>(w);
+ if ( fw ) {
+ if ( fw->isFake() )
+ return objectForFakeForm( fw )->name() + QString( " [Source]" );
+ else
+ return fw->name() + QString( " [Source]" );
+ } else if ( se ) {
+ if ( !se->object() )
+ continue;
+ if ( se->formWindow() )
+ return se->formWindow()->name() + QString( " [Source]" );
+ else
+ return makeRelative( se->sourceFile()->fileName() );
+ }
+ }
+ }
+
+ if ( ::qt_cast<SourceFile*>(o) ) {
+ for ( QPtrListIterator<SourceFile> sources = sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ if ( f == o )
+ return makeRelative( f->fileName() );
+ }
+ }
+
+ extern QMap<QWidget*, QString> *qwf_forms;
+ if ( !qwf_forms ) {
+ qWarning( "Project::locationOfObject: qwf_forms is NULL!" );
+ return QString::null;
+ }
+
+ QString s = makeRelative( *qwf_forms->find( (QWidget*)o ) );
+ s += " [Source]";
+ return s;
+}
+
+bool Project::hasGUI() const
+{
+ return qApp->type() != QApplication::Tty;
+}
diff --git a/kdevdesigner/designer/project.h b/kdevdesigner/designer/project.h
new file mode 100644
index 00000000..a2606ffa
--- /dev/null
+++ b/kdevdesigner/designer/project.h
@@ -0,0 +1,273 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PROJECT_H
+#define PROJECT_H
+
+#include <qfeatures.h>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qmap.h>
+#include <private/qpluginmanager_p.h>
+#include "../interfaces/projectsettingsiface.h"
+#include "sourcefile.h"
+#include "formfile.h"
+#include <qobjectlist.h>
+#include <qptrdict.h>
+#include "formfile.h"
+
+class QObjectList;
+struct DesignerProject;
+struct DesignerDatabase;
+class PixmapCollection;
+class Project;
+
+#ifndef QT_NO_SQL
+class QSqlDatabase;
+
+class DatabaseConnection
+{
+public:
+ DatabaseConnection( Project *p ) :
+#ifndef QT_NO_SQL
+ conn( 0 ),
+#endif
+ project( p ), loaded( FALSE ), iface( 0 ) {}
+ ~DatabaseConnection();
+
+ bool refreshCatalog();
+ bool open( bool suppressDialog = TRUE );
+ void close();
+ DesignerDatabase *iFace();
+
+ bool isLoaded() const { return loaded; }
+ void setName( const QString& n ) { nm = n; }
+ QString name() const { return nm; }
+ void setDriver( const QString& d ) { drv = d; }
+ QString driver() const { return drv; }
+ void setDatabase( const QString& db ) { dbName = db; }
+ QString database() const { return dbName; }
+ void setUsername( const QString& u ) { uname = u; }
+ QString username() const { return uname; }
+ void setPassword( const QString& p ) { pword = p; }
+ QString password() const { return pword; }
+ void setHostname( const QString& h ) { hname = h; }
+ QString hostname() const { return hname; }
+ void setPort( int p ) { prt = p; }
+ int port() const { return prt; }
+ QString lastError() const { return dbErr; }
+ void addTable( const QString& t ) { tbls.append(t); }
+ void setFields( const QString& t, const QStringList& f ) { flds[t] = f; }
+ QStringList tables() const { return tbls; }
+ QStringList fields( const QString& t ) { return flds[t]; }
+ QMap<QString, QStringList> fields() { return flds; }
+#ifndef QT_NO_SQL
+ QSqlDatabase* connection() const { return conn; }
+ void remove();
+#endif
+
+private:
+ QString nm;
+ QString drv, dbName, uname, pword, hname;
+ QString dbErr;
+ int prt;
+ QStringList tbls;
+ QMap<QString, QStringList> flds;
+#ifndef QT_NO_SQL
+ QSqlDatabase *conn;
+#endif
+ Project *project;
+ bool loaded;
+ DesignerDatabase *iface;
+};
+
+#endif
+
+class Project : public QObject
+{
+ Q_OBJECT
+ friend class DatabaseConnection;
+
+public:
+ Project( const QString &fn, const QString &pName = QString::null,
+ QPluginManager<ProjectSettingsInterface> *pm = 0, bool isDummy = FALSE,
+ const QString &l = "C++" );
+ ~Project();
+
+ void setFileName( const QString &fn, bool doClear = TRUE );
+ QString fileName( bool singlePro = FALSE ) const;
+ QString projectName() const;
+
+ void setDatabaseDescription( const QString &db );
+ QString databaseDescription() const;
+
+ void setDescription( const QString &s );
+ QString description() const;
+
+ void setLanguage( const QString &l );
+ QString language() const;
+
+
+ bool isValid() const;
+
+ // returns TRUE if this project is the <No Project> project
+ bool isDummy() const;
+
+ QString makeAbsolute( const QString &f );
+ QString makeRelative( const QString &f );
+
+ void save( bool onlyProjectFile = FALSE );
+
+#ifndef QT_NO_SQL
+ QPtrList<DatabaseConnection> databaseConnections() const;
+ void setDatabaseConnections( const QPtrList<DatabaseConnection> &lst );
+ void addDatabaseConnection( DatabaseConnection *conn );
+ void removeDatabaseConnection( const QString &conn );
+ DatabaseConnection *databaseConnection( const QString &name );
+ QStringList databaseConnectionList();
+ QStringList databaseTableList( const QString &connection );
+ QStringList databaseFieldList( const QString &connection, const QString &table );
+#endif
+ void saveConnections();
+ void loadConnections();
+
+ bool openDatabase( const QString &connection, bool suppressDialog = TRUE );
+ void closeDatabase( const QString &connection );
+
+ QObjectList *formList( bool resolveFakeObjects = FALSE ) const;
+
+ DesignerProject *iFace();
+
+ void setCustomSetting( const QString &key, const QString &value );
+ QString customSetting( const QString &key ) const;
+
+ PixmapCollection *pixmapCollection() const { return pixCollection; }
+
+ void setActive( bool b );
+
+ QPtrListIterator<SourceFile> sourceFiles() const { return QPtrListIterator<SourceFile>(sourcefiles); }
+ void addSourceFile( SourceFile *sf );
+ bool removeSourceFile( SourceFile *sf );
+ SourceFile* findSourceFile( const QString& filename, SourceFile *ignore = 0 ) const;
+
+ QPtrListIterator<FormFile> formFiles() const { return QPtrListIterator<FormFile>(formfiles); }
+ void addFormFile( FormFile *ff );
+ bool removeFormFile( FormFile *ff );
+ FormFile* findFormFile( const QString& filename, FormFile *ignore = 0 ) const;
+
+ void setIncludePath( const QString &platform, const QString &path );
+ void setLibs( const QString &platform, const QString &path );
+ void setDefines( const QString &platform, const QString &path );
+ void setConfig( const QString &platform, const QString &config );
+ void setTemplate( const QString &t );
+
+ QString config( const QString &platform ) const;
+ QString libs( const QString &platform ) const;
+ QString defines( const QString &platform ) const;
+ QString includePath( const QString &platform ) const;
+ QString templte() const;
+
+ bool isModified() const { return !isDummy() && modified; }
+ void setModified( bool b );
+
+ void addObject( QObject *o );
+ void setObjects( const QObjectList &ol );
+ void removeObject( QObject *o );
+ QObjectList objects() const;
+ FormFile *fakeFormFileFor( QObject *o ) const;
+ QObject *objectForFakeForm( FormWindow *fw ) const;
+ QObject *objectForFakeFormFile( FormFile *ff ) const;
+
+ void addAndEditFunction( const QString &functionName, const QString &functionBody,
+ bool openDeveloper );
+
+ void removeTempProject();
+ bool hasParentObject( QObject *o );
+ QString qualifiedName( QObject *o );
+
+ bool isCpp() const { return is_cpp; }
+
+ void designerCreated();
+
+ void formOpened( FormWindow *fw );
+
+ QString locationOfObject( QObject *o );
+
+ bool hasGUI() const;
+
+signals:
+ void projectModified();
+ void sourceFileAdded( SourceFile* );
+ void sourceFileRemoved( SourceFile* );
+ void formFileAdded( FormFile* );
+ void formFileRemoved( FormFile* );
+ void objectAdded( QObject * );
+ void objectRemoved( QObject * );
+ void newFormOpened( FormWindow *fw );
+
+private:
+ void parse();
+ void clear();
+ void updateCustomSettings();
+ void readPlatformSettings( const QString &contents,
+ const QString &setting,
+ QMap<QString, QString> &res );
+ void removePlatformSettings( QString &contents, const QString &setting );
+ void writePlatformSettings( QString &contents, const QString &setting,
+ const QMap<QString, QString> &input );
+ bool singleProjectMode() const;
+ QWidget *messageBoxParent() const;
+
+private:
+ QString filename;
+ QString proName;
+ QString desc;
+ QString dbFile;
+#ifndef QT_NO_SQL
+ QPtrList<DatabaseConnection> dbConnections;
+#endif
+ QString lang;
+ DesignerProject *iface;
+ QMap<QString, QString> customSettings;
+ QStringList csList;
+ QPluginManager<ProjectSettingsInterface> *projectSettingsPluginManager;
+ PixmapCollection *pixCollection;
+ QPtrList<SourceFile> sourcefiles;
+ QPtrList<FormFile> formfiles;
+ QMap<QString, QString> inclPath, defs, lbs, cfg, sources, headers;
+ QString templ;
+ bool isDummyProject;
+ bool modified;
+ QObjectList objs;
+ QPtrDict<FormFile> fakeFormFiles;
+ QString singleProFileName;
+ bool is_cpp;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/projectsettings.ui b/kdevdesigner/designer/projectsettings.ui
new file mode 100644
index 00000000..258b7739
--- /dev/null
+++ b/kdevdesigner/designer/projectsettings.ui
@@ -0,0 +1,301 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ProjectSettingsBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ProjectSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>375</width>
+ <height>224</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Project Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tabSettings</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Settings</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Project file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editProjectFile</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Language:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboLanguage</cstring>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="2" column="2">
+ <property name="name">
+ <cstring>buttonDatabaseFile_2</cstring>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editDatabaseFile</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Database file:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editDatabaseFile</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>comboLanguage</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>editProjectFile</cstring>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>buttonProject</cstring>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonProject</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>chooseProjectFile()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>helpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>comboLanguage</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>ProjectSettingsBase</receiver>
+ <slot>languageChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>editProjectFile</tabstop>
+ <tabstop>comboLanguage</tabstop>
+ <tabstop>buttonHelp</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">chooseDatabaseFile()</slot>
+ <slot access="protected">chooseProjectFile()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">helpClicked()</slot>
+ <slot access="protected">init()</slot>
+ <slot access="protected">languageChanged( const QString &amp; )</slot>
+ <slot access="protected">okClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/projectsettingsimpl.cpp b/kdevdesigner/designer/projectsettingsimpl.cpp
new file mode 100644
index 00000000..a1a2b6b1
--- /dev/null
+++ b/kdevdesigner/designer/projectsettingsimpl.cpp
@@ -0,0 +1,126 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "projectsettingsimpl.h"
+#include "project.h"
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "asciivalidator.h"
+#include "mainwindow.h"
+#include "sourcefile.h"
+#include "workspace.h"
+
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <klineedit.h>
+
+#include <qtextedit.h>
+#include <qcheckbox.h>
+#include <qfiledialog.h>
+#include <qcombobox.h>
+#include <qobjectlist.h>
+#include <qheader.h>
+#include <qpushbutton.h>
+#include <qlabel.h>
+
+/*
+ * Constructs a ProjectSettings which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+ProjectSettings::ProjectSettings( Project *pro, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : ProjectSettingsBase( parent, name, modal, fl ), project( pro )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+
+ editProjectFile->setFocus();
+
+ if ( project->isDummy() ) {
+ editProjectFile->setEnabled( FALSE );
+ editProjectFile->setText( project->projectName() );
+ } else {
+ if ( project->fileName().isEmpty() || project->fileName() == ".pro" ) {
+ editProjectFile->setText( tr( "unnamed.pro" ) );
+ editProjectFile->selectAll();
+ } else {
+ editProjectFile->setText( project->fileName() );
+ }
+ }
+
+ editDatabaseFile->setText( project->databaseDescription() );
+
+ comboLanguage->insertStringList( MetaDataBase::languages() );
+ for ( int j = 0; j < (int)comboLanguage->count(); ++j ) {
+ if ( project->language() == comboLanguage->text( j ) ) {
+ comboLanguage->setCurrentItem( j );
+ break;
+ }
+ }
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+ProjectSettings::~ProjectSettings()
+{
+}
+
+void ProjectSettings::chooseDatabaseFile()
+{
+ QString fn = KFileDialog::getSaveFileName( editDatabaseFile->text(), i18n( "*.db|Database Files\n*|All Files" ), this );
+ if ( fn.isEmpty() )
+ return;
+ editDatabaseFile->setText( fn );
+}
+
+void ProjectSettings::chooseProjectFile()
+{
+ QString fn = KFileDialog::getSaveFileName( editDatabaseFile->text(), i18n( "*.pro|Project Files\n*|All Files" ), this );
+ if ( fn.isEmpty() )
+ return;
+ editProjectFile->setText( fn );
+}
+
+void ProjectSettings::helpClicked()
+{
+}
+
+void ProjectSettings::okClicked()
+{
+ // ### check for validity
+ project->setFileName( editProjectFile->text(), FALSE );
+ project->setDatabaseDescription( editDatabaseFile->text() );
+ project->setLanguage( comboLanguage->text( comboLanguage->currentItem() ) );
+ project->setModified( TRUE );
+ accept();
+}
+
+void ProjectSettings::languageChanged( const QString & )
+{
+}
diff --git a/kdevdesigner/designer/projectsettingsimpl.h b/kdevdesigner/designer/projectsettingsimpl.h
new file mode 100644
index 00000000..3833d813
--- /dev/null
+++ b/kdevdesigner/designer/projectsettingsimpl.h
@@ -0,0 +1,56 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PROJECTSETTINGSIMPL_H
+#define PROJECTSETTINGSIMPL_H
+
+#include "projectsettings.h"
+
+class Project;
+class QListViewItem;
+class FormWindow;
+class SourceFile;
+
+class ProjectSettings : public ProjectSettingsBase
+{
+ Q_OBJECT
+
+public:
+ ProjectSettings( Project *pro, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ProjectSettings();
+
+protected slots:
+ void chooseDatabaseFile();
+ void chooseProjectFile();
+ void helpClicked();
+ void okClicked();
+ void languageChanged( const QString &lang );
+
+private:
+ Project *project;
+};
+
+#endif
diff --git a/kdevdesigner/designer/propertyeditor.cpp b/kdevdesigner/designer/propertyeditor.cpp
new file mode 100644
index 00000000..06b8f93b
--- /dev/null
+++ b/kdevdesigner/designer/propertyeditor.cpp
@@ -0,0 +1,4332 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler needs this here
+
+#include "propertyeditor.h"
+#include "formwindow.h"
+#include "command.h"
+#include "metadatabase.h"
+#include "propertyobject.h"
+#include <widgetdatabase.h>
+#include "widgetfactory.h"
+#include "globaldefs.h"
+#include "defs.h"
+#include "asciivalidator.h"
+#include "paletteeditorimpl.h"
+#include "multilineeditorimpl.h"
+#include "mainwindow.h"
+#include "project.h"
+#include "hierarchyview.h"
+#include "database.h"
+#include "menubareditor.h"
+
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include "kdevdesigner_part.h"
+
+#include <qpainter.h>
+#include <qpalette.h>
+#include <qapplication.h>
+#include <qheader.h>
+#include <qlineedit.h>
+#include <qstrlist.h>
+#include <qmetaobject.h>
+#include <qcombobox.h>
+#include <qpushbutton.h>
+#include <qhbox.h>
+#include <qfontdialog.h>
+#include <qspinbox.h>
+#include <qevent.h>
+#include <qobjectlist.h>
+#include <qlistbox.h>
+#include <qfontdatabase.h>
+#include <qcolor.h>
+#include <qcolordialog.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qsizepolicy.h>
+#include <qbitmap.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qaccel.h>
+#include <qworkspace.h>
+#include <qtimer.h>
+#include <qdragobject.h>
+#include <qdom.h>
+#include <qprocess.h>
+#include <qstyle.h>
+#include <qdatetimeedit.h>
+#include <qassistantclient.h>
+#include <qdrawutil.h>
+#include <qmultilineedit.h> // FIXME: obsolete
+#include <qsplitter.h>
+#include <qdatatable.h>
+#include <qtextview.h>
+
+#include <limits.h>
+
+
+static QFontDatabase *fontDataBase = 0;
+QString assistantPath();
+
+#ifdef Q_WS_MAC
+#include <qwindowsstyle.h>
+static void setupStyle(QWidget *w)
+{
+ static QStyle *windowsStyle = 0;
+ if(!windowsStyle)
+ windowsStyle = new QWindowsStyle;
+ w->setStyle(windowsStyle);
+}
+#else
+#define setupStyle(x)
+#endif
+
+static void cleanupFontDatabase()
+{
+ delete fontDataBase;
+ fontDataBase = 0;
+}
+
+static QStringList getFontList()
+{
+ if ( !fontDataBase ) {
+ fontDataBase = new QFontDatabase;
+ qAddPostRoutine( cleanupFontDatabase );
+ }
+ return fontDataBase->families();
+}
+
+
+class PropertyWhatsThis : public QWhatsThis
+{
+public:
+ PropertyWhatsThis( PropertyList *l );
+ QString text( const QPoint &pos );
+ bool clicked( const QString& href );
+
+private:
+ PropertyList *propertyList;
+
+};
+
+PropertyWhatsThis::PropertyWhatsThis( PropertyList *l )
+ : QWhatsThis( l->viewport() ), propertyList( l )
+{
+}
+
+QString PropertyWhatsThis::text( const QPoint &pos )
+{
+ return propertyList->whatsThisAt( pos );
+}
+
+bool PropertyWhatsThis::clicked( const QString& href )
+{
+ if ( !href.isEmpty() ) {
+ QAssistantClient *ac = MainWindow::self->assistantClient();
+ ac->showPage( QString( qInstallPathDocs() ) + "/html/" + href );
+ }
+ return FALSE; // do not hide window
+}
+
+
+/*!
+ \class PropertyItem propertyeditor.h
+ \brief Base class for all property items
+
+ This is the base class for each property item for the
+ PropertyList. A simple property item has just a name and a value to
+ provide an editor for a datatype. But more complex datatypes might
+ provide an expandable item for editing single parts of the
+ datatype. See hasSubItems(), initChildren() for that.
+*/
+
+/*! If this item should be a child of another property item, specify
+ \a prop as the parent item.
+*/
+
+PropertyItem::PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : QListViewItem( l, after ), listview( l ), property( prop ), propertyName( propName )
+{
+ setSelectable( FALSE );
+ open = FALSE;
+ setText( 0, propertyName );
+ changed = FALSE;
+ setText( 1, "" );
+ resetButton = 0;
+}
+
+PropertyItem::~PropertyItem()
+{
+ if ( resetButton )
+ delete resetButton->parentWidget();
+ resetButton = 0;
+}
+
+void PropertyItem::toggle()
+{
+}
+
+void PropertyItem::updateBackColor()
+{
+ if ( itemAbove() && this != listview->firstChild() ) {
+ if ( ( ( PropertyItem*)itemAbove() )->backColor == *backColor1 )
+ backColor = *backColor2;
+ else
+ backColor = *backColor1;
+ } else {
+ backColor = *backColor1;
+ }
+ if ( listview->firstChild() == this )
+ backColor = *backColor1;
+}
+
+QColor PropertyItem::backgroundColor()
+{
+ updateBackColor();
+ if ( (QListViewItem*)this == listview->currentItem() )
+ return *selectedBack;
+ return backColor;
+}
+
+/*! If a subclass is a expandable item, this is called when the child
+items should be created.
+*/
+
+void PropertyItem::createChildren()
+{
+}
+
+/*! If a subclass is a expandable item, this is called when the child
+items should be initialized.
+*/
+
+void PropertyItem::initChildren()
+{
+}
+
+void PropertyItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
+{
+ QColorGroup g( cg );
+ g.setColor( QColorGroup::Base, backgroundColor() );
+ g.setColor( QColorGroup::Foreground, Qt::black );
+ g.setColor( QColorGroup::Text, Qt::black );
+ int indent = 0;
+ if ( column == 0 ) {
+ indent = 20 + ( property ? 20 : 0 );
+ p->fillRect( 0, 0, width, height(), backgroundColor() );
+ p->save();
+ p->translate( indent, 0 );
+ }
+
+ if ( isChanged() && column == 0 ) {
+ p->save();
+ QFont f = p->font();
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ if ( !hasCustomContents() || column != 1 ) {
+ QListViewItem::paintCell( p, g, column, width - indent, align );
+ } else {
+ p->fillRect( 0, 0, width, height(), backgroundColor() );
+ drawCustomContents( p, QRect( 0, 0, width, height() ) );
+ }
+
+ if ( isChanged() && column == 0 )
+ p->restore();
+ if ( column == 0 )
+ p->restore();
+ if ( hasSubItems() && column == 0 ) {
+ p->save();
+ p->setPen( cg.foreground() );
+ p->setBrush( cg.base() );
+ p->drawRect( 5, height() / 2 - 4, 9, 9 );
+ p->drawLine( 7, height() / 2, 11, height() / 2 );
+ if ( !isOpen() )
+ p->drawLine( 9, height() / 2 - 2, 9, height() / 2 + 2 );
+ p->restore();
+ }
+ p->save();
+ p->setPen( QPen( cg.dark(), 1 ) );
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+
+ if ( listview->currentItem() == this && column == 0 &&
+ !listview->hasFocus() && !listview->viewport()->hasFocus() )
+ paintFocus( p, cg, QRect( 0, 0, width, height() ) );
+}
+
+void PropertyItem::paintBranches( QPainter * p, const QColorGroup & cg,
+ int w, int y, int h )
+{
+ QColorGroup g( cg );
+ g.setColor( QColorGroup::Base, backgroundColor() );
+ QListViewItem::paintBranches( p, g, w, y, h );
+}
+
+void PropertyItem::paintFocus( QPainter *p, const QColorGroup &cg, const QRect &r )
+{
+ p->save();
+ QApplication::style().drawPrimitive(QStyle::PE_Panel, p, r, cg,
+ QStyle::Style_Sunken, QStyleOption(1,1) );
+ p->restore();
+}
+
+/*! Subclasses which are expandable items have to return TRUE
+ here. Default is FALSE.
+*/
+
+bool PropertyItem::hasSubItems() const
+{
+ return FALSE;
+}
+
+/*! Returns the parent property item here if this is a child or 0
+ otherwise.
+ */
+
+PropertyItem *PropertyItem::propertyParent() const
+{
+ return property;
+}
+
+bool PropertyItem::isOpen() const
+{
+ return open;
+}
+
+void PropertyItem::setOpen( bool b )
+{
+ if ( b == open )
+ return;
+ open = b;
+
+ if ( !open ) {
+ children.setAutoDelete( TRUE );
+ children.clear();
+ children.setAutoDelete( FALSE );
+ qApp->processEvents();
+ listview->updateEditorSize();
+ return;
+ }
+
+ createChildren();
+ initChildren();
+ qApp->processEvents();
+ listview->updateEditorSize();
+}
+
+/*! Subclasses have to show the editor of the item here
+*/
+
+void PropertyItem::showEditor()
+{
+ createResetButton();
+ resetButton->parentWidget()->show();
+}
+
+/*! Subclasses have to hide the editor of the item here
+*/
+
+void PropertyItem::hideEditor()
+{
+ createResetButton();
+ resetButton->parentWidget()->hide();
+}
+
+/*! This is called to init the value of the item. Reimplement in
+ subclasses to init the editor
+*/
+
+void PropertyItem::setValue( const QVariant &v )
+{
+ val = v;
+}
+
+QVariant PropertyItem::value() const
+{
+ return val;
+}
+
+bool PropertyItem::isChanged() const
+{
+ return changed;
+}
+
+void PropertyItem::setChanged( bool b, bool updateDb )
+{
+ if ( propertyParent() )
+ return;
+ if ( changed == b )
+ return;
+ changed = b;
+ repaint();
+ if ( updateDb ) {
+ MetaDataBase::setPropertyChanged( listview->propertyEditor()->widget(), name(), changed );
+ }
+ updateResetButtonState();
+}
+
+QString PropertyItem::name() const
+{
+ return propertyName;
+}
+
+void PropertyItem::createResetButton()
+{
+ if ( resetButton ) {
+ resetButton->parentWidget()->lower();
+ return;
+ }
+ const QPixmap DesignerResetPix = SmallIcon( "designer_resetproperty.png" , KDevDesignerPartFactory::instance());
+
+ QHBox *hbox = new QHBox( listview->viewport() );
+ hbox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ hbox->setLineWidth( 1 );
+ resetButton = new QPushButton( hbox );
+ setupStyle( resetButton );
+ resetButton->setPixmap( DesignerResetPix );
+ resetButton->setFixedWidth( resetButton->sizeHint().width() );
+ hbox->layout()->setAlignment( Qt::AlignRight );
+ listview->addChild( hbox );
+ hbox->hide();
+ QObject::connect( resetButton, SIGNAL( clicked() ),
+ listview, SLOT( resetProperty() ) );
+ QToolTip::add( resetButton, i18n( "Reset the property to its default value" ) );
+ QWhatsThis::add( resetButton, i18n( "Click this button to reset the property to its default value" ) );
+ updateResetButtonState();
+}
+
+void PropertyItem::updateResetButtonState()
+{
+ if ( !resetButton )
+ return;
+ if ( propertyParent() || !WidgetFactory::canResetProperty( listview->propertyEditor()->widget(), name() ) )
+ resetButton->setEnabled( FALSE );
+ else
+ resetButton->setEnabled( isChanged() );
+}
+
+/*! Call this to place/resize the item editor correctly (normally
+ call it from showEditor())
+*/
+
+void PropertyItem::placeEditor( QWidget *w )
+{
+ createResetButton();
+ QRect r = listview->itemRect( this );
+ if ( !r.size().isValid() ) {
+ listview->ensureItemVisible( this );
+#if defined(Q_WS_WIN)
+ listview->repaintContents( FALSE );
+#endif
+ r = listview->itemRect( this );
+ }
+ r.setX( listview->header()->sectionPos( 1 ) );
+ r.setWidth( listview->header()->sectionSize( 1 ) - 1 );
+ r.setWidth( r.width() - resetButton->width() - 2 );
+ r = QRect( listview->viewportToContents( r.topLeft() ), r.size() );
+ w->resize( r.size() );
+ listview->moveChild( w, r.x(), r.y() );
+ resetButton->parentWidget()->resize( resetButton->sizeHint().width() + 10, r.height() );
+ listview->moveChild( resetButton->parentWidget(), r.x() + r.width() - 8, r.y() );
+ resetButton->setFixedHeight( QMAX( 0, r.height() - 3 ) );
+}
+
+/*! This should be called by subclasses if the user changed the value
+ of the property and this value should be applied to the widget property
+*/
+
+void PropertyItem::notifyValueChange()
+{
+ if ( !propertyParent() ) {
+ listview->valueChanged( this );
+ setChanged( TRUE );
+ if ( hasSubItems() )
+ initChildren();
+ } else {
+ propertyParent()->childValueChanged( this );
+ setChanged( TRUE );
+ }
+}
+
+/*! If a subclass is a expandable item reimplement this as this is
+ always called if a child item changed its value. So update the
+ display of the item here then.
+*/
+
+void PropertyItem::childValueChanged( PropertyItem * )
+{
+}
+
+/*! When adding a child item, call this (normally from addChildren()
+*/
+
+void PropertyItem::addChild( PropertyItem *i )
+{
+ children.append( i );
+}
+
+int PropertyItem::childCount() const
+{
+ return children.count();
+}
+
+PropertyItem *PropertyItem::child( int i ) const
+{
+ // ARRRRRRRRG
+ return ( (PropertyItem*)this )->children.at( i );
+}
+
+/*! If the contents of the item is not displayable with a text, but
+ you want to draw it yourself (using drawCustomContents()), return
+ TRUE here.
+*/
+
+bool PropertyItem::hasCustomContents() const
+{
+ return FALSE;
+}
+
+/*!
+ \sa hasCustomContents()
+*/
+
+void PropertyItem::drawCustomContents( QPainter *, const QRect & )
+{
+}
+
+QString PropertyItem::currentItem() const
+{
+ return QString::null;
+}
+
+int PropertyItem::currentIntItem() const
+{
+ return -1;
+}
+
+void PropertyItem::setCurrentItem( const QString & )
+{
+}
+
+void PropertyItem::setCurrentItem( int )
+{
+}
+
+int PropertyItem::currentIntItemFromObject() const
+{
+ return -1;
+}
+
+QString PropertyItem::currentItemFromObject() const
+{
+ return QString::null;
+}
+
+void PropertyItem::setFocus( QWidget *w )
+{
+ if ( !qApp->focusWidget() ||
+ listview->propertyEditor()->formWindow() &&
+ ( !MainWindow::self->isAFormWindowChild( qApp->focusWidget() ) &&
+ !qApp->focusWidget()->inherits( "Editor" ) ) )
+ w->setFocus();
+}
+
+void PropertyItem::setText( int col, const QString &t )
+{
+ QString txt( t );
+ if ( col == 1 )
+ txt = txt.replace( "\n", " " );
+ QListViewItem::setText( col, txt );
+}
+
+// --------------------------------------------------------------
+
+PropertyTextItem::PropertyTextItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool comment, bool multiLine, bool ascii, bool a )
+ : PropertyItem( l, after, prop, propName ), withComment( comment ),
+ hasMultiLines( multiLine ), asciiOnly( ascii ), accel( a )
+{
+ lin = 0;
+ box = 0;
+}
+
+QLineEdit *PropertyTextItem::lined()
+{
+ if ( lin )
+ return lin;
+ if ( hasMultiLines ) {
+ box = new QHBox( listview->viewport() );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ box->hide();
+ }
+
+ lin = 0;
+ if ( hasMultiLines )
+ lin = new QLineEdit( box );
+ else
+ lin = new QLineEdit( listview->viewport() );
+
+ if ( asciiOnly ) {
+ if ( PropertyItem::name() == "name" ) {
+ lin->setValidator( new AsciiValidator( QString(":"), lin, "ascii_validator" ) );
+ if ( listview->propertyEditor()->formWindow()->isFake() )
+ lin->setEnabled( FALSE );
+ } else {
+ lin->setValidator( new AsciiValidator( QString("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
+ "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9"
+ "\xaa\xab\xac\xad\xae\xaf\xb1\xb2\xb3"
+ "\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc"
+ "\xbd\xbe\xbf"), lin, "ascii_validator" ) );
+ }
+ } if ( !hasMultiLines ) {
+ lin->hide();
+ } else {
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( getText() ) );
+ lin->setFrame( FALSE );
+ }
+ connect( lin, SIGNAL( returnPressed() ),
+ this, SLOT( setValue() ) );
+ connect( lin, SIGNAL( textChanged( const QString & ) ),
+ this, SLOT( setValue() ) );
+ if ( PropertyItem::name() == "name" || PropertyItem::name() == "itemName" )
+ connect( lin, SIGNAL( returnPressed() ),
+ listview->propertyEditor()->formWindow()->commandHistory(),
+ SLOT( checkCompressedCommand() ) );
+ lin->installEventFilter( listview );
+ return lin;
+}
+
+PropertyTextItem::~PropertyTextItem()
+{
+ delete (QLineEdit*)lin;
+ lin = 0;
+ delete (QHBox*)box;
+ box = 0;
+}
+
+void PropertyTextItem::setChanged( bool b, bool updateDb )
+{
+ PropertyItem::setChanged( b, updateDb );
+ if ( withComment && childCount() > 0 )
+ ( (PropertyTextItem*)PropertyItem::child( 0 ) )->lined()->setEnabled( b );
+}
+
+bool PropertyTextItem::hasSubItems() const
+{
+ return withComment;
+}
+
+void PropertyTextItem::childValueChanged( PropertyItem *child )
+{
+ if ( PropertyItem::name() != "name" )
+ MetaDataBase::setPropertyComment( listview->propertyEditor()->widget(),
+ PropertyItem::name(), child->value().toString() );
+ else
+ MetaDataBase::setExportMacro( listview->propertyEditor()->widget(), child->value().toString() );
+ listview->propertyEditor()->formWindow()->commandHistory()->setModified( TRUE );
+}
+
+void PropertyTextItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin || lin->text().length() == 0 ) {
+ lined()->blockSignals( TRUE );
+ lined()->setText( value().toString() );
+ lined()->blockSignals( FALSE );
+ }
+
+ QWidget* w;
+ if ( hasMultiLines )
+ w = box;
+ else
+ w= lined();
+
+ placeEditor( w );
+ if ( !w->isVisible() || !lined()->hasFocus() ) {
+ w->show();
+ setFocus( lined() );
+ }
+}
+
+void PropertyTextItem::createChildren()
+{
+ PropertyTextItem *i = new PropertyTextItem( listview, this, this,
+ PropertyItem::name() == "name" ?
+ "export macro" : "comment", FALSE, FALSE,
+ PropertyItem::name() == "name" );
+ i->lined()->setEnabled( isChanged() );
+ addChild( i );
+}
+
+void PropertyTextItem::initChildren()
+{
+ if ( !childCount() )
+ return;
+ PropertyItem *item = PropertyItem::child( 0 );
+ if ( item ) {
+ if ( PropertyItem::name() != "name" )
+ item->setValue( MetaDataBase::propertyComment( listview->propertyEditor()->widget(),
+ PropertyItem::name() ) );
+ else
+ item->setValue( MetaDataBase::exportMacro( listview->propertyEditor()->widget() ) );
+ }
+}
+
+void PropertyTextItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ QWidget* w;
+ if ( hasMultiLines )
+ w = box;
+ else
+ w = lined();
+
+ w->hide();
+}
+
+void PropertyTextItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ int oldCursorPos;
+ oldCursorPos = lin->cursorPosition();
+ lined()->setText( v.toString() );
+ if ( oldCursorPos < (int)lin->text().length() )
+ lin->setCursorPosition( oldCursorPos );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toString() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyTextItem::setValue()
+{
+ setText( 1, lined()->text() );
+ QVariant v;
+ if ( accel ) {
+ v = QVariant( QKeySequence( lined()->text() ) );
+ if ( v.toString().isNull() )
+ return; // not yet valid input
+ } else {
+ v = lined()->text();
+ }
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+void PropertyTextItem::getText()
+{
+ bool richText = !::qt_cast<QButton*>(listview->propertyEditor()->widget()) ||
+ ( text( 0 ) == "whatsThis" );
+ bool doWrap = FALSE;
+ QString txt = MultiLineEditor::getText( listview, value().toString(), richText, &doWrap );
+ if ( !txt.isEmpty() ) {
+ setText( 1, txt );
+ PropertyItem::setValue( txt );
+ notifyValueChange();
+ lined()->blockSignals( TRUE );
+ lined()->setText( txt );
+ lined()->blockSignals( FALSE );
+ }
+}
+
+// --------------------------------------------------------------
+
+PropertyDoubleItem::PropertyDoubleItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+QLineEdit *PropertyDoubleItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QLineEdit( listview->viewport() );
+ lin->setValidator( new QDoubleValidator( lin, "double_validator" ) );
+
+ connect( lin, SIGNAL( returnPressed() ),
+ this, SLOT( setValue() ) );
+ connect( lin, SIGNAL( textChanged( const QString & ) ),
+ this, SLOT( setValue() ) );
+ lin->installEventFilter( listview );
+ return lin;
+}
+
+PropertyDoubleItem::~PropertyDoubleItem()
+{
+ delete (QLineEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDoubleItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setText( QString::number( value().toDouble() ) );
+ lined()->blockSignals( FALSE );
+ }
+ QWidget* w = lined();
+
+ placeEditor( w );
+ if ( !w->isVisible() || !lined()->hasFocus() ) {
+ w->show();
+ setFocus( lined() );
+ }
+}
+
+
+void PropertyDoubleItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ QWidget* w = lined();
+ w->hide();
+}
+
+void PropertyDoubleItem::setValue( const QVariant &v )
+{
+ if ( value() == v )
+ return;
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ int oldCursorPos;
+ oldCursorPos = lin->cursorPosition();
+ lined()->setText( QString::number( v.toDouble() ) );
+ if ( oldCursorPos < (int)lin->text().length() )
+ lin->setCursorPosition( oldCursorPos );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, QString::number( v.toDouble() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDoubleItem::setValue()
+{
+ setText( 1, lined()->text() );
+ QVariant v = lined()->text().toDouble();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+
+// --------------------------------------------------------------
+
+PropertyDateItem::PropertyDateItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+QDateEdit *PropertyDateItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QDateEdit( listview->viewport() );
+ QObjectList *l = lin->queryList( "QLineEdit" );
+ for ( QObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ connect( lin, SIGNAL( valueChanged( const QDate & ) ),
+ this, SLOT( setValue() ) );
+ return lin;
+}
+
+PropertyDateItem::~PropertyDateItem()
+{
+ delete (QDateEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDateItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setDate( value().toDate() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyDateItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyDateItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->date() != v.toDate() )
+ lined()->setDate( v.toDate() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toDate().toString( ::Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDateItem::setValue()
+{
+ setText( 1, lined()->date().toString( ::Qt::ISODate ) );
+ QVariant v;
+ v = lined()->date();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyTimeItem::PropertyTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+QTimeEdit *PropertyTimeItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QTimeEdit( listview->viewport() );
+ connect( lin, SIGNAL( valueChanged( const QTime & ) ),
+ this, SLOT( setValue() ) );
+ QObjectList *l = lin->queryList( "QLineEdit" );
+ for ( QObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ return lin;
+}
+
+PropertyTimeItem::~PropertyTimeItem()
+{
+ delete (QTimeEdit*)lin;
+ lin = 0;
+}
+
+void PropertyTimeItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setTime( value().toTime() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyTimeItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyTimeItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->time() != v.toTime() )
+ lined()->setTime( v.toTime() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toTime().toString( ::Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyTimeItem::setValue()
+{
+ setText( 1, lined()->time().toString( ::Qt::ISODate ) );
+ QVariant v;
+ v = lined()->time();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyDateTimeItem::PropertyDateTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+QDateTimeEdit *PropertyDateTimeItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QDateTimeEdit( listview->viewport() );
+ connect( lin, SIGNAL( valueChanged( const QDateTime & ) ),
+ this, SLOT( setValue() ) );
+ QObjectList *l = lin->queryList( "QLineEdit" );
+ for ( QObject *o = l->first(); o; o = l->next() )
+ o->installEventFilter( listview );
+ delete l;
+ return lin;
+}
+
+PropertyDateTimeItem::~PropertyDateTimeItem()
+{
+ delete (QDateTimeEdit*)lin;
+ lin = 0;
+}
+
+void PropertyDateTimeItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin ) {
+ lined()->blockSignals( TRUE );
+ lined()->setDateTime( value().toDateTime() );
+ lined()->blockSignals( FALSE );
+ }
+ placeEditor( lin );
+ if ( !lin->isVisible() ) {
+ lin->show();
+ setFocus( lin );
+ }
+}
+
+void PropertyDateTimeItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ if ( lin )
+ lin->hide();
+}
+
+void PropertyDateTimeItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( lin ) {
+ lined()->blockSignals( TRUE );
+ if ( lined()->dateTime() != v.toDateTime() )
+ lined()->setDateTime( v.toDateTime() );
+ lined()->blockSignals( FALSE );
+ }
+ setText( 1, v.toDateTime().toString( ::Qt::ISODate ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyDateTimeItem::setValue()
+{
+ setText( 1, lined()->dateTime().toString( ::Qt::ISODate ) );
+ QVariant v;
+ v = lined()->dateTime();
+ PropertyItem::setValue( v );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyBoolItem::PropertyBoolItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ comb = 0;
+}
+
+QComboBox *PropertyBoolItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new QComboBox( FALSE, listview->viewport() );
+ comb->hide();
+ comb->insertItem( i18n( "False" ) );
+ comb->insertItem( i18n( "True" ) );
+ connect( comb, SIGNAL( activated( int ) ),
+ this, SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ return comb;
+}
+
+PropertyBoolItem::~PropertyBoolItem()
+{
+ delete (QComboBox*)comb;
+ comb = 0;
+}
+
+void PropertyBoolItem::toggle()
+{
+ bool b = value().toBool();
+ setValue( QVariant( !b, 0 ) );
+ setValue();
+}
+
+void PropertyBoolItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ if ( value().toBool() )
+ combo()->setCurrentItem( 1 );
+ else
+ combo()->setCurrentItem( 0 );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyBoolItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyBoolItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( comb ) {
+ combo()->blockSignals( TRUE );
+ if ( v.toBool() )
+ combo()->setCurrentItem( 1 );
+ else
+ combo()->setCurrentItem( 0 );
+ combo()->blockSignals( FALSE );
+ }
+ QString tmp = i18n( "True" );
+ if ( !v.toBool() )
+ tmp = i18n( "False" );
+ setText( 1, tmp );
+ PropertyItem::setValue( v );
+}
+
+void PropertyBoolItem::setValue()
+{
+ if ( !comb )
+ return;
+ setText( 1, combo()->currentText() );
+ bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE;
+ PropertyItem::setValue( QVariant( b, 0 ) );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyIntItem::PropertyIntItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool s )
+ : PropertyItem( l, after, prop, propName ), signedValue( s )
+{
+ spinBx = 0;
+}
+
+QSpinBox *PropertyIntItem::spinBox()
+{
+ if ( spinBx )
+ return spinBx;
+ if ( signedValue )
+ spinBx = new QSpinBox( -INT_MAX, INT_MAX, 1, listview->viewport() );
+ else
+ spinBx = new QSpinBox( 0, INT_MAX, 1, listview->viewport() );
+ spinBx->hide();
+ spinBx->installEventFilter( listview );
+ QObjectList *ol = spinBx->queryList( "QLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ connect( spinBx, SIGNAL( valueChanged( int ) ),
+ this, SLOT( setValue() ) );
+ return spinBx;
+}
+
+PropertyIntItem::~PropertyIntItem()
+{
+ delete (QSpinBox*)spinBx;
+ spinBx = 0;
+}
+
+void PropertyIntItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ if ( signedValue )
+ spinBox()->setValue( value().toInt() );
+ else
+ spinBox()->setValue( value().toUInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+ placeEditor( spinBox() );
+ if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) {
+ spinBox()->show();
+ setFocus( spinBox() );
+ }
+}
+
+void PropertyIntItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ spinBox()->hide();
+}
+
+void PropertyIntItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ if ( spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ if ( signedValue )
+ spinBox()->setValue( v.toInt() );
+ else
+ spinBox()->setValue( v.toUInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+
+ if ( signedValue )
+ setText( 1, QString::number( v.toInt() ) );
+ else
+ setText( 1, QString::number( v.toUInt() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyIntItem::setValue()
+{
+ if ( !spinBx )
+ return;
+ setText( 1, QString::number( spinBox()->value() ) );
+ if ( signedValue )
+ PropertyItem::setValue( spinBox()->value() );
+ else
+ PropertyItem::setValue( (uint)spinBox()->value() );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyLayoutItem::PropertyLayoutItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ spinBx = 0;
+}
+
+PropertyLayoutItem::~PropertyLayoutItem()
+{
+ delete (QSpinBox*)spinBx;
+ spinBx = 0;
+}
+
+QSpinBox* PropertyLayoutItem::spinBox()
+{
+ if ( spinBx )
+ return spinBx;
+ spinBx = new QSpinBox( -1, INT_MAX, 1, listview->viewport() );
+ spinBx->setSpecialValueText( i18n( "default" ) );
+ spinBx->hide();
+ spinBx->installEventFilter( listview );
+ QObjectList *ol = spinBx->queryList( "QLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ connect( spinBx, SIGNAL( valueChanged( int ) ),
+ this, SLOT( setValue() ) );
+ return spinBx;
+}
+
+void PropertyLayoutItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ spinBox()->setValue( value().toInt() );
+ spinBox()->blockSignals( TRUE );
+ }
+ placeEditor( spinBox() );
+ if ( !spinBox()->isVisible() || !spinBox()->hasFocus() ) {
+ spinBox()->show();
+ setFocus( spinBox() );
+ }
+}
+
+void PropertyLayoutItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ spinBox()->hide();
+}
+
+void PropertyLayoutItem::setValue( const QVariant &v )
+{
+ if ( spinBx ) {
+ spinBox()->blockSignals( TRUE );
+ spinBox()->setValue( v.toInt() );
+ spinBox()->blockSignals( FALSE );
+ }
+ QString s = v.toString();
+ if ( v.toInt() == -1 )
+ s = spinBox()->specialValueText();
+ setText( 1, s );
+ PropertyItem::setValue( v );
+}
+
+void PropertyLayoutItem::setValue()
+{
+ if ( !spinBx )
+ return;
+ PropertyItem::setValue( spinBox()->value() );
+ notifyValueChange();
+}
+
+
+// --------------------------------------------------------------
+
+PropertyListItem::PropertyListItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool e )
+ : PropertyItem( l, after, prop, propName ), editable( e )
+{
+ comb = 0;
+ oldInt = -1;
+}
+
+QComboBox *PropertyListItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new QComboBox( editable, listview->viewport() );
+ comb->hide();
+ connect( comb, SIGNAL( activated( int ) ),
+ this, SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ if ( editable ) {
+ QObjectList *ol = comb->queryList( "QLineEdit" );
+ if ( ol && ol->first() )
+ ol->first()->installEventFilter( listview );
+ delete ol;
+ }
+ return comb;
+}
+
+PropertyListItem::~PropertyListItem()
+{
+ delete (QComboBox*)comb;
+ comb = 0;
+}
+
+void PropertyListItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyListItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyListItem::setValue( const QVariant &v )
+{
+ if ( comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( v.toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ setText( 1, v.toStringList().first() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyListItem::setValue()
+{
+ if ( !comb )
+ return;
+ setText( 1, combo()->currentText() );
+ QStringList lst;
+ for ( uint i = 0; i < combo()->listBox()->count(); ++i )
+ lst << combo()->listBox()->item( i )->text();
+ PropertyItem::setValue( lst );
+ notifyValueChange();
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+QString PropertyListItem::currentItem() const
+{
+ return ( (PropertyListItem*)this )->combo()->currentText();
+}
+
+void PropertyListItem::setCurrentItem( const QString &s )
+{
+ if ( comb && currentItem().lower() == s.lower() )
+ return;
+
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ for ( uint i = 0; i < combo()->listBox()->count(); ++i ) {
+ if ( combo()->listBox()->item( i )->text().lower() == s.lower() ) {
+ combo()->setCurrentItem( i );
+ setText( 1, combo()->currentText() );
+ break;
+ }
+ }
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+void PropertyListItem::addItem( const QString &s )
+{
+ combo()->insertItem( s );
+}
+
+void PropertyListItem::setCurrentItem( int i )
+{
+ if ( comb && i == combo()->currentItem() )
+ return;
+
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->clear();
+ combo()->insertStringList( value().toStringList() );
+ combo()->blockSignals( FALSE );
+ }
+ combo()->setCurrentItem( i );
+ setText( 1, combo()->currentText() );
+ oldInt = currentIntItem();
+ oldString = currentItem();
+}
+
+int PropertyListItem::currentIntItem() const
+{
+ return ( (PropertyListItem*)this )->combo()->currentItem();
+}
+
+int PropertyListItem::currentIntItemFromObject() const
+{
+ return oldInt;
+}
+
+QString PropertyListItem::currentItemFromObject() const
+{
+ return oldString;
+}
+
+// --------------------------------------------------------------
+
+PropertyCoordItem::PropertyCoordItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, Type t )
+ : PropertyItem( l, after, prop, propName ), typ( t )
+{
+ lin = 0;
+
+}
+
+QLineEdit *PropertyCoordItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QLineEdit( listview->viewport() );
+ lin->setReadOnly( TRUE );
+ lin->installEventFilter( listview );
+ lin->hide();
+ return lin;
+}
+
+void PropertyCoordItem::createChildren()
+{
+ PropertyItem *i = this;
+ if ( typ == Rect || typ == Point ) {
+ i = new PropertyIntItem( listview, i, this, i18n( "x" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "y" ), TRUE );
+ addChild( i );
+ }
+ if ( typ == Rect || typ == Size ) {
+ i = new PropertyIntItem( listview, i, this, i18n( "width" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "height" ), TRUE );
+ addChild( i );
+ }
+}
+
+void PropertyCoordItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == i18n( "x" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().x() );
+ else if ( typ == Point )
+ item->setValue( val.toPoint().x() );
+ } else if ( item->name() == i18n( "y" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().y() );
+ else if ( typ == Point )
+ item->setValue( val.toPoint().y() );
+ } else if ( item->name() == i18n( "width" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().width() );
+ else if ( typ == Size )
+ item->setValue( val.toSize().width() );
+ } else if ( item->name() == i18n( "height" ) ) {
+ if ( typ == Rect )
+ item->setValue( val.toRect().height() );
+ else if ( typ == Size )
+ item->setValue( val.toSize().height() );
+ }
+ }
+}
+
+PropertyCoordItem::~PropertyCoordItem()
+{
+ delete (QLineEdit*)lin;
+ lin = 0;
+}
+
+void PropertyCoordItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !lin )
+ lined()->setText( text( 1 ) );
+ placeEditor( lined() );
+ if ( !lined()->isVisible() || !lined()->hasFocus() ) {
+ lined()->show();
+ setFocus( lined() );
+ }
+}
+
+void PropertyCoordItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ lined()->hide();
+}
+
+void PropertyCoordItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ QString s;
+ if ( typ == Rect )
+ s = "[ " + QString::number( v.toRect().x() ) + ", " + QString::number( v.toRect().y() ) + ", " +
+ QString::number( v.toRect().width() ) + ", " + QString::number( v.toRect().height() ) + " ]";
+ else if ( typ == Point )
+ s = "[ " + QString::number( v.toPoint().x() ) + ", " +
+ QString::number( v.toPoint().y() ) + " ]";
+ else if ( typ == Size )
+ s = "[ " + QString::number( v.toSize().width() ) + ", " +
+ QString::number( v.toSize().height() ) + " ]";
+ setText( 1, s );
+ if ( lin )
+ lined()->setText( s );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyCoordItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyCoordItem::childValueChanged( PropertyItem *child )
+{
+ if ( typ == Rect ) {
+ QRect r = value().toRect();
+ if ( child->name() == i18n( "x" ) )
+ r.moveBy( -r.x() + child->value().toInt(), 0 );
+ else if ( child->name() == i18n( "y" ) )
+ r.moveBy( 0, -r.y() + child->value().toInt() );
+ else if ( child->name() == i18n( "width" ) )
+ r.setWidth( child->value().toInt() );
+ else if ( child->name() == i18n( "height" ) )
+ r.setHeight( child->value().toInt() );
+ setValue( r );
+ } else if ( typ == Point ) {
+ QPoint r = value().toPoint();
+ if ( child->name() == i18n( "x" ) )
+ r.setX( child->value().toInt() );
+ else if ( child->name() == i18n( "y" ) )
+ r.setY( child->value().toInt() );
+ setValue( r );
+ } else if ( typ == Size ) {
+ QSize r = value().toSize();
+ if ( child->name() == i18n( "width" ) )
+ r.setWidth( child->value().toInt() );
+ else if ( child->name() == i18n( "height" ) )
+ r.setHeight( child->value().toInt() );
+ setValue( r );
+ }
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyPixmapItem::PropertyPixmapItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, Type t )
+ : PropertyItem( l, after, prop, propName ), type( t )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ pixPrev = new QLabel( box );
+ pixPrev->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Minimum ) );
+ pixPrev->setBackgroundColor( pixPrev->colorGroup().color( QColorGroup::Base ) );
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ pixPrev->setFrameStyle( QFrame::NoFrame );
+ box->installEventFilter( listview );
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( getPixmap() ) );
+}
+
+PropertyPixmapItem::~PropertyPixmapItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyPixmapItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyPixmapItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyPixmapItem::setValue( const QVariant &v )
+{
+ QString s;
+ if ( type == Pixmap )
+ pixPrev->setPixmap( v.toPixmap() );
+ else if ( type == IconSet )
+ pixPrev->setPixmap( v.toIconSet().pixmap() );
+ else
+ pixPrev->setPixmap( v.toImage() );
+ PropertyItem::setValue( v );
+ repaint();
+}
+
+void PropertyPixmapItem::getPixmap()
+{
+ QPixmap pix = qChoosePixmap( listview, listview->propertyEditor()->formWindow(), value().toPixmap() );
+ if ( !pix.isNull() ) {
+ if ( type == Pixmap )
+ setValue( pix );
+ else if ( type == IconSet )
+ setValue( QIconSet( pix ) );
+ else
+ setValue( pix.convertToImage() );
+
+ notifyValueChange();
+ }
+}
+
+bool PropertyPixmapItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyPixmapItem::drawCustomContents( QPainter *p, const QRect &r )
+{
+ QPixmap pix;
+ if ( type == Pixmap )
+ pix = value().toPixmap();
+ else if ( type == IconSet )
+ pix = value().toIconSet().pixmap();
+ else
+ pix = value().toImage();
+
+ if ( !pix.isNull() ) {
+ p->save();
+ p->setClipRect( QRect( QPoint( (int)(p->worldMatrix().dx() + r.x()),
+ (int)(p->worldMatrix().dy() + r.y()) ),
+ r.size() ) );
+ p->drawPixmap( r.x(), r.y() + ( r.height() - pix.height() ) / 2, pix );
+ p->restore();
+ }
+}
+
+
+// --------------------------------------------------------------
+
+PropertyColorItem::PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool children )
+ : PropertyItem( l, after, prop, propName ), withChildren( children )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ colorPrev = new QFrame( box );
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ colorPrev->setFrameStyle( QFrame::Plain | QFrame::Box );
+ colorPrev->setLineWidth( 2 );
+ QPalette pal = colorPrev->palette();
+ QColorGroup cg = pal.active();
+ cg.setColor( QColorGroup::Foreground, cg.color( QColorGroup::Base ) );
+ pal.setActive( cg );
+ pal.setInactive( cg );
+ pal.setDisabled( cg );
+ colorPrev->setPalette( pal );
+ box->installEventFilter( listview );
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( getColor() ) );
+}
+
+void PropertyColorItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyIntItem( listview, i, this, i18n( "Red" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "Green" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "Blue" ), TRUE );
+ addChild( i );
+}
+
+void PropertyColorItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == i18n( "Red" ) )
+ item->setValue( val.toColor().red() );
+ else if ( item->name() == i18n( "Green" ) )
+ item->setValue( val.toColor().green() );
+ else if ( item->name() == i18n( "Blue" ) )
+ item->setValue( val.toColor().blue() );
+ }
+}
+
+PropertyColorItem::~PropertyColorItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyColorItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyColorItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyColorItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ QString s;
+ setText( 1, v.toColor().name() );
+ colorPrev->setBackgroundColor( v.toColor() );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyColorItem::hasSubItems() const
+{
+ return withChildren;
+}
+
+void PropertyColorItem::childValueChanged( PropertyItem *child )
+{
+ QColor c( val.toColor() );
+ if ( child->name() == i18n( "Red" ) )
+ c.setRgb( child->value().toInt(), c.green(), c.blue() );
+ else if ( child->name() == i18n( "Green" ) )
+ c.setRgb( c.red(), child->value().toInt(), c.blue() );
+ else if ( child->name() == i18n( "Blue" ) )
+ c.setRgb( c.red(), c.green(), child->value().toInt() );
+ setValue( c );
+ notifyValueChange();
+}
+
+void PropertyColorItem::getColor()
+{
+ QColor c = QColorDialog::getColor( val.asColor(), listview );
+ if ( c.isValid() ) {
+ setValue( c );
+ notifyValueChange();
+ }
+}
+
+bool PropertyColorItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyColorItem::drawCustomContents( QPainter *p, const QRect &r )
+{
+ p->save();
+ p->setPen( QPen( black, 1 ) );
+ p->setBrush( val.toColor() );
+ p->drawRect( r.x() + 2, r.y() + 2, r.width() - 5, r.height() - 5 );
+ p->restore();
+}
+
+// --------------------------------------------------------------
+
+PropertyFontItem::PropertyFontItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ lined = new QLineEdit( box );
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ lined->setFrame( FALSE );
+ lined->setReadOnly( TRUE );
+ box->setFocusProxy( lined );
+ box->installEventFilter( listview );
+ lined->installEventFilter( listview );
+ button->installEventFilter( listview );
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( getFont() ) );
+}
+
+void PropertyFontItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, i18n( "Family" ), FALSE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "Point Size" ), TRUE );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, i18n( "Bold" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, i18n( "Italic" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, i18n( "Underline" ) );
+ addChild( i );
+ i = new PropertyBoolItem( listview, i, this, i18n( "Strikeout" ) );
+ addChild( i );
+}
+
+void PropertyFontItem::initChildren()
+{
+ PropertyItem *item = 0;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == i18n( "Family" ) ) {
+ ( (PropertyListItem*)item )->setValue( getFontList() );
+ ( (PropertyListItem*)item )->setCurrentItem( val.toFont().family() );
+ } else if ( item->name() == i18n( "Point Size" ) )
+ item->setValue( val.toFont().pointSize() );
+ else if ( item->name() == i18n( "Bold" ) )
+ item->setValue( QVariant( val.toFont().bold(), 0 ) );
+ else if ( item->name() == i18n( "Italic" ) )
+ item->setValue( QVariant( val.toFont().italic(), 0 ) );
+ else if ( item->name() == i18n( "Underline" ) )
+ item->setValue( QVariant( val.toFont().underline(), 0 ) );
+ else if ( item->name() == i18n( "Strikeout" ) )
+ item->setValue( QVariant( val.toFont().strikeOut(), 0 ) );
+ }
+}
+
+PropertyFontItem::~PropertyFontItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyFontItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() || !lined->hasFocus() ) {
+ box->show();
+ setFocus( lined );
+ }
+}
+
+void PropertyFontItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyFontItem::setValue( const QVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ setText( 1, v.toFont().family() + "-" + QString::number( v.toFont().pointSize() ) );
+ lined->setText( v.toFont().family() + "-" + QString::number( v.toFont().pointSize() ) );
+ PropertyItem::setValue( v );
+}
+
+void PropertyFontItem::getFont()
+{
+ bool ok = FALSE;
+ QFont f = QFontDialog::getFont( &ok, val.toFont(), listview );
+ if ( ok && f != val.toFont() ) {
+ setValue( f );
+ notifyValueChange();
+ }
+}
+
+bool PropertyFontItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyFontItem::childValueChanged( PropertyItem *child )
+{
+ QFont f = val.toFont();
+ if ( child->name() == i18n( "Family" ) )
+ f.setFamily( ( (PropertyListItem*)child )->currentItem() );
+ else if ( child->name() == i18n( "Point Size" ) )
+ f.setPointSize( child->value().toInt() );
+ else if ( child->name() == i18n( "Bold" ) )
+ f.setBold( child->value().toBool() );
+ else if ( child->name() == i18n( "Italic" ) )
+ f.setItalic( child->value().toBool() );
+ else if ( child->name() == i18n( "Underline" ) )
+ f.setUnderline( child->value().toBool() );
+ else if ( child->name() == i18n( "Strikeout" ) )
+ f.setStrikeOut( child->value().toBool() );
+ setValue( f );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyDatabaseItem::PropertyDatabaseItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool wField )
+ : PropertyItem( l, after, prop, propName ), withField( wField )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ lined = new QLineEdit( box );
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ lined->setFrame( FALSE );
+ lined->setReadOnly( TRUE );
+ box->setFocusProxy( lined );
+ box->installEventFilter( listview );
+ lined->installEventFilter( listview );
+ button->installEventFilter( listview );
+}
+
+void PropertyDatabaseItem::createChildren()
+{
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, i18n( "Connection" ), TRUE );
+ addChild( i );
+ i = new PropertyListItem( listview, i, this, i18n( "Table" ), TRUE );
+ addChild( i );
+ if ( withField ) {
+ i = new PropertyListItem( listview, i, this, i18n( "Field" ), TRUE );
+ addChild( i );
+ }
+}
+
+void PropertyDatabaseItem::initChildren()
+{
+#ifndef QT_NO_SQL
+ PropertyItem *item = 0;
+ QStringList lst = value().toStringList();
+ QString conn, table;
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == i18n( "Connection" ) ) {
+ QStringList cl = listview->propertyEditor()->formWindow()->project()->databaseConnectionList();
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 0 )
+ item->setValue( QStringList( lst[ 0 ] ) );
+ else if ( withField )
+ item->setValue( QStringList( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(),
+ "database" ).toStringList()[ 0 ] ) );
+
+ if ( lst.count() > 0 && !lst[ 0 ].isEmpty() )
+ item->setCurrentItem( lst[ 0 ] );
+ else if ( !isChanged() && withField )
+ item->setCurrentItem( MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(),
+ "database" ).toStringList()[ 0 ] );
+ else
+ item->setCurrentItem( 0 );
+ conn = item->currentItem();
+ } else if ( item->name() == i18n( "Table" ) ) {
+ QStringList cl = listview->propertyEditor()->formWindow()->project()->databaseTableList( conn );
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 1 )
+ item->setValue( QStringList( lst[ 1 ] ) );
+ else if ( withField ) {
+ QStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList();
+ if ( fakeLst.count() > 1 )
+ item->setValue( fakeLst[ 1 ] );
+ }
+
+ if ( lst.count() > 1 && !lst[ 1 ].isEmpty() )
+ item->setCurrentItem( lst[ 1 ] );
+ else if ( !isChanged() && withField ) {
+ QStringList fakeLst = MetaDataBase::fakeProperty( listview->propertyEditor()->formWindow()->mainContainer(), "database" ).toStringList();
+ if ( fakeLst.count() > 1 )
+ item->setCurrentItem( fakeLst[ 1 ] );
+ else
+ item->setCurrentItem( 0 );
+ } else
+ item->setCurrentItem( 0 );
+ table = item->currentItem();
+ } else if ( item->name() == i18n( "Field" ) ) {
+ QStringList cl = listview->propertyEditor()->formWindow()->project()->databaseFieldList( conn, table );
+ if ( !cl.isEmpty() )
+ item->setValue( cl );
+ else if ( lst.count() > 2 )
+ item->setValue( QStringList( lst[ 2 ] ) );
+ if ( lst.count() > 2 && !lst[ 2 ].isEmpty() )
+ item->setCurrentItem( lst[ 2 ] );
+ else
+ item->setCurrentItem( 0 );
+ }
+ }
+#endif
+}
+
+PropertyDatabaseItem::~PropertyDatabaseItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyDatabaseItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() || !lined->hasFocus() ) {
+ box->show();
+ setFocus( lined );
+ }
+}
+
+void PropertyDatabaseItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyDatabaseItem::setValue( const QVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ QStringList lst = v.toStringList();
+ QString s = lst.join( "." );
+ setText( 1, s );
+ lined->setText( s );
+ PropertyItem::setValue( v );
+}
+
+bool PropertyDatabaseItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+void PropertyDatabaseItem::childValueChanged( PropertyItem *c )
+{
+#ifndef QT_NO_SQL
+ QStringList lst;
+ lst << ( (PropertyListItem*)PropertyItem::child( 0 ) )->currentItem()
+ << ( (PropertyListItem*)PropertyItem::child( 1 ) )->currentItem();
+ if ( withField )
+ lst << ( (PropertyListItem*)PropertyItem::child( 2 ) )->currentItem();
+ if ( c == PropertyItem::child( 0 ) ) { // if the connection changed
+ lst[ 0 ] = ( (PropertyListItem*)c )->currentItem();
+ PropertyItem::child( 1 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseTableList( lst[ 0 ] ) );
+ if ( withField )
+ PropertyItem::child( 2 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] ) );
+ } else if ( withField && c == PropertyItem::child( 1 ) ) { // if the table changed
+ lst[ 1 ] = ( (PropertyListItem*)c )->currentItem();
+ if ( withField )
+ PropertyItem::child( 2 )->setValue( listview->propertyEditor()->formWindow()->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] ) );
+ }
+ lst.clear();
+ lst << ( (PropertyListItem*)PropertyItem::child( 0 ) )->currentItem()
+ << ( (PropertyListItem*)PropertyItem::child( 1 ) )->currentItem();
+ if ( withField )
+ lst << ( (PropertyListItem*)PropertyItem::child( 2 ) )->currentItem();
+ setValue( lst );
+ notifyValueChange();
+#else
+ Q_UNUSED( c );
+#endif
+}
+
+// --------------------------------------------------------------
+
+PropertySizePolicyItem::PropertySizePolicyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ lin = 0;
+}
+
+QLineEdit *PropertySizePolicyItem::lined()
+{
+ if ( lin )
+ return lin;
+ lin = new QLineEdit( listview->viewport() );
+ lin->hide();
+ lin->setReadOnly( TRUE );
+ return lin;
+}
+
+void PropertySizePolicyItem::createChildren()
+{
+ QStringList lst;
+ lst << "Fixed" << "Minimum" << "Maximum" << "Preferred" << "MinimumExpanding" << "Expanding" << "Ignored";
+
+ PropertyItem *i = this;
+ i = new PropertyListItem( listview, i, this, i18n( "hSizeType" ), FALSE );
+ i->setValue( lst );
+ addChild( i );
+ i = new PropertyListItem( listview, i, this, i18n( "vSizeType" ), FALSE );
+ i->setValue( lst );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "horizontalStretch" ), TRUE );
+ addChild( i );
+ i = new PropertyIntItem( listview, i, this, i18n( "verticalStretch" ), TRUE );
+ addChild( i );
+}
+
+void PropertySizePolicyItem::initChildren()
+{
+ PropertyItem *item = 0;
+ QSizePolicy sp = val.toSizePolicy();
+ for ( int i = 0; i < childCount(); ++i ) {
+ item = PropertyItem::child( i );
+ if ( item->name() == i18n( "hSizeType" ) )
+ ( (PropertyListItem*)item )->setCurrentItem( size_type_to_int( sp.horData() ) );
+ else if ( item->name() == i18n( "vSizeType" ) )
+ ( (PropertyListItem*)item )->setCurrentItem( size_type_to_int( sp.verData() ) );
+ else if ( item->name() == i18n( "horizontalStretch" ) )
+ ( (PropertyIntItem*)item )->setValue( sp.horStretch() );
+ else if ( item->name() == i18n( "verticalStretch" ) )
+ ( (PropertyIntItem*)item )->setValue( sp.verStretch() );
+ }
+}
+
+PropertySizePolicyItem::~PropertySizePolicyItem()
+{
+ delete (QLineEdit*)lin;
+}
+
+void PropertySizePolicyItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( lined() );
+ if ( !lined()->isVisible() || !lined()->hasFocus() ) {
+ lined()->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertySizePolicyItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ lined()->hide();
+}
+
+void PropertySizePolicyItem::setValue( const QVariant &v )
+{
+ if ( value() == v )
+ return;
+
+ QString s = i18n( "%1/%2/%3/%4" );
+ s = s.arg( size_type_to_string( v.toSizePolicy().horData() ) ).
+ arg( size_type_to_string( v.toSizePolicy().verData() ) ).
+ arg( v.toSizePolicy().horStretch() ).
+ arg( v.toSizePolicy().verStretch() );
+ setText( 1, s );
+ lined()->setText( s );
+ PropertyItem::setValue( v );
+}
+
+void PropertySizePolicyItem::childValueChanged( PropertyItem *child )
+{
+ QSizePolicy sp = val.toSizePolicy();
+ if ( child->name() == i18n( "hSizeType" ) )
+ sp.setHorData( int_to_size_type( ( ( PropertyListItem*)child )->currentIntItem() ) );
+ else if ( child->name() == i18n( "vSizeType" ) )
+ sp.setVerData( int_to_size_type( ( ( PropertyListItem*)child )->currentIntItem() ) );
+ else if ( child->name() == i18n( "horizontalStretch" ) )
+ sp.setHorStretch( ( ( PropertyIntItem*)child )->value().toInt() );
+ else if ( child->name() == i18n( "verticalStretch" ) )
+ sp.setVerStretch( ( ( PropertyIntItem*)child )->value().toInt() );
+ setValue( sp );
+ notifyValueChange();
+}
+
+bool PropertySizePolicyItem::hasSubItems() const
+{
+ return TRUE;
+}
+
+// --------------------------------------------------------------
+
+PropertyPaletteItem::PropertyPaletteItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ palettePrev = new QLabel( box );
+ button = new QPushButton( "...", box );
+ setupStyle( button );
+ button->setFixedWidth( 20 );
+ box->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ box->setLineWidth( 2 );
+ palettePrev->setFrameStyle( QFrame::NoFrame );
+ box->installEventFilter( listview );
+ connect( button, SIGNAL( clicked() ),
+ this, SLOT( getPalette() ) );
+}
+PropertyPaletteItem::~PropertyPaletteItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyPaletteItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ listView()->viewport()->setFocus();
+ }
+}
+
+void PropertyPaletteItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyPaletteItem::setValue( const QVariant &v )
+{
+ QString s;
+ palettePrev->setPalette( v.toPalette() );
+ PropertyItem::setValue( v );
+ repaint();
+}
+
+void PropertyPaletteItem::getPalette()
+{
+ if ( !listview->propertyEditor()->widget()->isWidgetType() )
+ return;
+ bool ok = FALSE;
+ QWidget *w = (QWidget*)listview->propertyEditor()->widget();
+ if ( ::qt_cast<QScrollView*>(w) )
+ w = ( (QScrollView*)w )->viewport();
+ QPalette pal = PaletteEditor::getPalette( &ok, val.toPalette(),
+#if defined(QT_NON_COMMERCIAL)
+ w->backgroundMode(), listview->topLevelWidget(),
+#else
+ w->backgroundMode(), listview,
+#endif
+ "choose_palette", listview->propertyEditor()->formWindow() );
+ if ( !ok )
+ return;
+ setValue( pal );
+ notifyValueChange();
+}
+
+bool PropertyPaletteItem::hasCustomContents() const
+{
+ return TRUE;
+}
+
+void PropertyPaletteItem::drawCustomContents( QPainter *p, const QRect &r )
+{
+ QPalette pal( value().toPalette() );
+ p->save();
+ p->setClipRect( QRect( QPoint( (int)(p->worldMatrix().dx() + r.x()),
+ (int)(p->worldMatrix().dy() + r.y()) ),
+ r.size() ) );
+ QRect r2( r );
+ r2.setX( r2.x() + 2 );
+ r2.setY( r2.y() + 2 );
+ r2.setWidth( r2.width() - 3 );
+ r2.setHeight( r2.height() - 3 );
+ p->setPen( QPen( black, 1 ) );
+ p->setBrush( pal.active().background() );
+ p->drawRect( r2 );
+ p->restore();
+}
+
+// --------------------------------------------------------------
+
+PropertyCursorItem::PropertyCursorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ comb = 0;
+}
+
+QComboBox *PropertyCursorItem::combo()
+{
+ if ( comb )
+ return comb;
+ comb = new QComboBox( FALSE, listview->viewport() );
+ comb->hide();
+ QBitmap cur;
+
+ const QPixmap ArrowPix = SmallIcon( "designer_arrow.png" , KDevDesignerPartFactory::instance());
+ const QPixmap UpArrowPix = SmallIcon( "designer_uparrow.png" , KDevDesignerPartFactory::instance());
+ const QPixmap CrossPix = SmallIcon( "designer_cross.png" , KDevDesignerPartFactory::instance());
+ const QPixmap WaitPix = SmallIcon( "designer_wait.png" , KDevDesignerPartFactory::instance());
+ const QPixmap IBeamPix = SmallIcon( "designer_ibeam.png" , KDevDesignerPartFactory::instance());
+ const QPixmap SizeVPix = SmallIcon( "designer_sizev.png" , KDevDesignerPartFactory::instance());
+ const QPixmap SizeHPix = SmallIcon( "designer_sizeh.png" , KDevDesignerPartFactory::instance());
+ const QPixmap SizeFPix = SmallIcon( "designer_sizef.png" , KDevDesignerPartFactory::instance());
+ const QPixmap SizeBPix = SmallIcon( "designer_sizeb.png" , KDevDesignerPartFactory::instance());
+ const QPixmap SizeAllPix = SmallIcon( "designer_sizeall.png" , KDevDesignerPartFactory::instance());
+ const QPixmap VSplitPix = SmallIcon( "designer_vsplit.png" , KDevDesignerPartFactory::instance());
+ const QPixmap HSplitPix = SmallIcon( "designer_hsplit.png" , KDevDesignerPartFactory::instance());
+ const QPixmap HandPix = SmallIcon( "designer_hand.png" , KDevDesignerPartFactory::instance());
+ const QPixmap NoPix = SmallIcon( "designer_no.png" , KDevDesignerPartFactory::instance());
+
+ comb->insertItem( ArrowPix, i18n("Arrow"), QObject::ArrowCursor);
+ comb->insertItem( UpArrowPix, i18n("Up-Arrow"), QObject::UpArrowCursor );
+ comb->insertItem( CrossPix, i18n("Cross"), QObject::CrossCursor );
+ comb->insertItem( WaitPix, i18n("Waiting"), QObject::WaitCursor );
+ comb->insertItem( IBeamPix, i18n("iBeam"), QObject::IbeamCursor );
+ comb->insertItem( SizeVPix, i18n("Size Vertical"), QObject::SizeVerCursor );
+ comb->insertItem( SizeHPix, i18n("Size Horizontal"), QObject::SizeHorCursor );
+ comb->insertItem( SizeFPix, i18n("Size Slash"), QObject::SizeBDiagCursor );
+ comb->insertItem( SizeBPix, i18n("Size Backslash"), QObject::SizeFDiagCursor );
+ comb->insertItem( SizeAllPix, i18n("Size All"), QObject::SizeAllCursor );
+ cur = QBitmap( 25, 25, 1 );
+ cur.setMask( cur );
+ comb->insertItem( cur, i18n("Blank"), QObject::BlankCursor );
+ comb->insertItem( VSplitPix, i18n("Split Vertical"), QObject::SplitVCursor );
+ comb->insertItem( HSplitPix, i18n("Split Horizontal"), QObject::SplitHCursor );
+ comb->insertItem( HandPix, i18n("Pointing Hand"), QObject::PointingHandCursor );
+ comb->insertItem( NoPix, i18n("Forbidden"), QObject::ForbiddenCursor );
+
+ connect( comb, SIGNAL( activated( int ) ),
+ this, SLOT( setValue() ) );
+ comb->installEventFilter( listview );
+ return comb;
+}
+
+PropertyCursorItem::~PropertyCursorItem()
+{
+ delete (QComboBox*)comb;
+}
+
+void PropertyCursorItem::showEditor()
+{
+ PropertyItem::showEditor();
+ if ( !comb ) {
+ combo()->blockSignals( TRUE );
+ combo()->setCurrentItem( (int)value().toCursor().shape() );
+ combo()->blockSignals( FALSE );
+ }
+ placeEditor( combo() );
+ if ( !combo()->isVisible() || !combo()->hasFocus() ) {
+ combo()->show();
+ setFocus( combo() );
+ }
+}
+
+void PropertyCursorItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ combo()->hide();
+}
+
+void PropertyCursorItem::setValue( const QVariant &v )
+{
+ if ( ( !hasSubItems() || !isOpen() )
+ && value() == v )
+ return;
+
+ combo()->blockSignals( TRUE );
+ combo()->setCurrentItem( (int)v.toCursor().shape() );
+ combo()->blockSignals( FALSE );
+ setText( 1, combo()->currentText() );
+ PropertyItem::setValue( v );
+}
+
+void PropertyCursorItem::setValue()
+{
+ if ( !comb )
+ return;
+ if ( QVariant( QCursor( combo()->currentItem() ) ) == val )
+ return;
+ setText( 1, combo()->currentText() );
+ PropertyItem::setValue( QCursor( combo()->currentItem() ) );
+ notifyValueChange();
+}
+
+// --------------------------------------------------------------
+
+PropertyKeysequenceItem::PropertyKeysequenceItem( PropertyList *l,
+ PropertyItem *after,
+ PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName ),
+ k1( 0 ), k2( 0 ), k3( 0 ), k4( 0 ), num( 0 ), mouseEnter( FALSE )
+{
+ box = new QHBox( listview->viewport() );
+ box->hide();
+ sequence = new QLineEdit( box );
+ connect( sequence, SIGNAL(textChanged( const QString & )),
+ this, SLOT(setValue()) );
+ sequence->installEventFilter( this );
+}
+
+PropertyKeysequenceItem::~PropertyKeysequenceItem()
+{
+ delete (QHBox*)box;
+}
+
+void PropertyKeysequenceItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ sequence->setFocus();
+ }
+}
+
+void PropertyKeysequenceItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+bool PropertyKeysequenceItem::eventFilter( QObject *o, QEvent *e )
+{
+ Q_UNUSED( o );
+ if ( e->type() == QEvent::KeyPress ) {
+ QKeyEvent *k = (QKeyEvent *)e;
+ if ( !mouseEnter &&
+ (k->key() == QObject::Key_Up ||
+ k->key() == QObject::Key_Down) )
+ return FALSE;
+ handleKeyEvent( k );
+ return TRUE;
+ } else if ( (e->type() == QEvent::FocusIn) ||
+ (e->type() == QEvent::MouseButtonPress) ) {
+ mouseEnter = ( listview->lastEvent() == PropertyList::MouseEvent ) ||
+ (e->type() == QEvent::MouseButtonPress);
+ return TRUE;
+ }
+
+ // Lets eat accelerators now..
+ if ( e->type() == QEvent::Accel ||
+ e->type() == QEvent::AccelOverride ||
+ e->type() == QEvent::KeyRelease )
+ return TRUE;
+ return FALSE;
+}
+
+void PropertyKeysequenceItem::handleKeyEvent( QKeyEvent *e )
+{
+ int nextKey = e->key();
+
+ if ( num > 3 ||
+ nextKey == QObject::Key_Control ||
+ nextKey == QObject::Key_Shift ||
+ nextKey == QObject::Key_Meta ||
+ nextKey == QObject::Key_Alt )
+ return;
+
+ nextKey |= translateModifiers( e->state() );
+ switch( num ) {
+ case 0:
+ k1 = nextKey;
+ break;
+ case 1:
+ k2 = nextKey;
+ break;
+ case 2:
+ k3 = nextKey;
+ break;
+ case 3:
+ k4 = nextKey;
+ break;
+ default:
+ break;
+ }
+ num++;
+ QKeySequence ks( k1, k2, k3, k4 );
+ sequence->setText( ks );
+}
+
+int PropertyKeysequenceItem::translateModifiers( int state )
+{
+ int result = 0;
+ if ( state & QObject::ShiftButton )
+ result |= QObject::SHIFT;
+ if ( state & QObject::ControlButton )
+ result |= QObject::CTRL;
+ if ( state & QObject::MetaButton )
+ result |= QObject::META;
+ if ( state & QObject::AltButton )
+ result |= QObject::ALT;
+ return result;
+}
+
+void PropertyKeysequenceItem::setValue()
+{
+ QVariant v;
+ v = QVariant( QKeySequence(sequence->text()) );
+ if ( v.toString().isNull() )
+ return;
+ setText( 1, sequence->text() );
+ PropertyItem::setValue( v );
+ if ( sequence->hasFocus() )
+ notifyValueChange();
+ setChanged( TRUE );
+}
+
+void PropertyKeysequenceItem::setValue( const QVariant &v )
+{
+ QKeySequence ks = v.toKeySequence();
+ if ( sequence ) {
+ sequence->setText( ks );
+ }
+ num = ks.count();
+ k1 = ks[0];
+ k2 = ks[1];
+ k3 = ks[2];
+ k4 = ks[3];
+ setText( 1, ks );
+ PropertyItem::setValue( v );
+}
+
+// --------------------------------------------------------------
+
+EnumPopup::EnumPopup( QWidget *parent, const char *name, WFlags f )
+ : QFrame( parent, name, f )
+{
+ setLineWidth( 1 );
+ setFrameStyle( Panel | Plain );
+ setPaletteBackgroundColor( Qt::white );
+ popLayout = new QVBoxLayout( this, 3 );
+ checkBoxList.setAutoDelete( TRUE );
+}
+
+EnumPopup::~EnumPopup()
+{
+}
+
+void EnumPopup::insertEnums( QValueList<EnumItem> lst )
+{
+ while ( checkBoxList.count() )
+ checkBoxList.removeFirst();
+
+ itemList = lst;
+ QCheckBox *cb;
+ QValueListConstIterator<EnumItem> it = itemList.begin();
+ for ( ; it != itemList.end(); ++it ) {
+ cb = new QCheckBox( this );
+ cb->setText( (*it).key );
+ cb->setChecked( (*it).selected );
+ if ( it == itemList.begin() )
+ cb->setFocus();
+ checkBoxList.append( cb );
+ cb->resize( width(), cb->height() );
+ popLayout->addWidget( cb );
+ }
+}
+
+void EnumPopup::keyPressEvent( QKeyEvent *e )
+{
+ if ( e->key() == Key_Escape ) {
+ hide();
+ emit hidden();
+ } else if ( e->key() == Key_Enter || e->key() == Key_Return ) {
+ closeWidget();
+ }
+}
+
+void EnumPopup::closeWidget()
+{
+ QPtrListIterator<QCheckBox> it( checkBoxList );
+ int i = 0;
+ while ( it.current() != 0 ) {
+ itemList[i].selected = (*it)->isChecked();
+ ++it;
+ ++i;
+ }
+ close();
+ emit closed();
+}
+
+QValueList<EnumItem> EnumPopup::enumList() const
+{
+ return itemList;
+}
+
+EnumBox::EnumBox( QWidget *parent, const char *name )
+ : QComboBox( parent, name )
+{
+ pop = new EnumPopup( this, "popup", QObject::WType_Popup );
+ connect( pop, SIGNAL( hidden() ), this, SLOT( popupHidden() ) );
+ connect( pop, SIGNAL( closed() ), this, SLOT( popupClosed() ) );
+ popupShown = FALSE;
+ arrowDown = FALSE;
+}
+
+void EnumBox::popupHidden()
+{
+ popupShown = FALSE;
+}
+
+void EnumBox::popupClosed()
+{
+ popupShown = FALSE;
+ emit valueChanged();
+}
+
+void EnumBox::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ const QColorGroup & g = colorGroup();
+ p.setPen(g.text());
+
+ QStyle::SFlags flags = QStyle::Style_Default;
+ if (isEnabled())
+ flags |= QStyle::Style_Enabled;
+ if (hasFocus())
+ flags |= QStyle::Style_HasFocus;
+
+ if ( width() < 5 || height() < 5 ) {
+ qDrawShadePanel( &p, rect().x(), rect().y(), rect().width(), rect().height(), g, FALSE, 2,
+ &g.brush( QColorGroup::Button ) );
+ return;
+ }
+ style().drawComplexControl( QStyle::CC_ComboBox, &p, this, rect(), g,
+ flags, QStyle::SC_All,
+ (arrowDown ?
+ QStyle::SC_ComboBoxArrow :
+ QStyle::SC_None ));
+
+ QRect re = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxEditField );
+ re = QStyle::visualRect(re, this);
+ p.setClipRect( re );
+
+ if ( !str.isNull() ) {
+ p.save();
+ p.setFont(font());
+ QFontMetrics fm(font());
+ int x = re.x(), y = re.y() + fm.ascent();
+ p.drawText( x, y, str );
+ p.restore();
+ }
+}
+
+void EnumBox::insertEnums( QValueList<EnumItem> lst )
+{
+ pop->insertEnums( lst );
+}
+
+QValueList<EnumItem> EnumBox::enumList() const
+{
+ return pop->enumList();
+}
+
+void EnumBox::popup()
+{
+ if ( popupShown ) {
+ pop->closeWidget();
+ popupShown = FALSE;
+ return;
+ }
+ pop->move( ((QWidget*)parent())->mapToGlobal( geometry().bottomLeft() ) );
+ pop->setMinimumWidth( width() );
+ emit aboutToShowPopup();
+ pop->show();
+ popupShown = TRUE;
+}
+
+void EnumBox::mousePressEvent( QMouseEvent *e )
+{
+ if ( e->button() != LeftButton )
+ return;
+
+ QRect arrowRect = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxArrow);
+ arrowRect = QStyle::visualRect(arrowRect, this);
+
+ arrowRect.setHeight( QMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) );
+
+ if ( arrowRect.contains( e->pos() ) ) {
+ arrowDown = TRUE;
+ repaint( FALSE );
+ }
+
+ popup();
+ QTimer::singleShot( 100, this, SLOT( restoreArrow() ) );
+}
+
+void EnumBox::keyPressEvent( QKeyEvent *e )
+{
+ if ( e->key() == Key_Space ) {
+ popup();
+ QTimer::singleShot( 100, this, SLOT( restoreArrow() ) );
+ } else if ( e->key() == Key_Enter || e->key() == Key_Return ) {
+ popup();
+ }
+}
+
+void EnumBox::restoreArrow()
+{
+ arrowDown = FALSE;
+ repaint( FALSE );
+}
+
+void EnumBox::setText( const QString &text )
+{
+ str = text;
+ repaint( FALSE );
+}
+
+
+
+PropertyEnumItem::PropertyEnumItem( PropertyList *l,
+ PropertyItem *after,
+ PropertyItem *prop,
+ const QString &propName )
+ : PropertyItem( l, after, prop, propName )
+{
+ box = new EnumBox( listview->viewport() );
+ box->hide();
+ box->installEventFilter( listview );
+ connect( box, SIGNAL( aboutToShowPopup() ), this, SLOT( insertEnums() ) );
+ connect( box, SIGNAL( valueChanged() ), this, SLOT( setValue() ) );
+}
+
+PropertyEnumItem::~PropertyEnumItem()
+{
+ delete (EnumBox*)box;
+}
+
+void PropertyEnumItem::showEditor()
+{
+ PropertyItem::showEditor();
+ placeEditor( box );
+ if ( !box->isVisible() ) {
+ box->show();
+ box->setText( enumString );
+ listView()->viewport()->setFocus();
+ }
+ box->setFocus();
+}
+
+void PropertyEnumItem::hideEditor()
+{
+ PropertyItem::hideEditor();
+ box->hide();
+}
+
+void PropertyEnumItem::setValue( const QVariant &v )
+{
+ enumString = "";
+ enumList.clear();
+ QStringList lst = v.toStringList();
+ QValueListConstIterator<QString> it = lst.begin();
+ for ( ; it != lst.end(); ++it )
+ enumList.append( EnumItem( *it, FALSE ) );
+ enumList.first().selected = TRUE;
+ enumString = enumList.first().key;
+ box->setText( enumString );
+ setText( 1, enumString );
+ PropertyItem::setValue( v );
+}
+
+void PropertyEnumItem::insertEnums()
+{
+ box->insertEnums( enumList );
+}
+
+void PropertyEnumItem::setValue()
+{
+ enumList = box->enumList();
+ enumString = "";
+ QValueListConstIterator<EnumItem> it = enumList.begin();
+ for ( ; it != enumList.end(); ++it ) {
+ if ( (*it).selected )
+ enumString += "|" + (*it).key;
+ }
+ if ( !enumString.isEmpty() )
+ enumString.replace( 0, 1, "" );
+
+ box->setText( enumString );
+ setText( 1, enumString );
+ notifyValueChange();
+}
+
+void PropertyEnumItem::setCurrentValues( QStrList lst )
+{
+ enumString ="";
+ QStrList::ConstIterator it = lst.begin();
+ QValueList<EnumItem>::Iterator eit = enumList.begin();
+ for ( ; eit != enumList.end(); ++eit ) {
+ (*eit).selected = FALSE;
+ for ( it = lst.begin(); it != lst.end(); ++it ) {
+ if ( QString( *it ) == (*eit).key ) {
+ (*eit).selected = TRUE;
+ enumString += "|" + (*eit).key;
+ break;
+ }
+ }
+ }
+ if ( !enumString.isEmpty() )
+ enumString.replace( 0, 1, "" );
+ box->setText( enumString );
+ setText( 1, enumString );
+}
+
+QString PropertyEnumItem::currentItem() const
+{
+ return enumString;
+}
+
+QString PropertyEnumItem::currentItemFromObject() const
+{
+ return enumString;
+}
+
+// --------------------------------------------------------------
+
+/*!
+ \class PropertyList propertyeditor.h
+ \brief PropertyList is a QListView derived class which is used for editing widget properties
+
+ This class is used for widget properties. It has to be child of a
+ PropertyEditor.
+
+ To initialize it for editing a widget call setupProperties() which
+ iterates through the properties of the current widget (see
+ PropertyEditor::widget()) and builds the list.
+
+ To update the item values, refetchData() can be called.
+
+ If the value of an item has been changed by the user, and this
+ change should be applied to the widget's property, valueChanged()
+ has to be called.
+
+ To set the value of an item, setPropertyValue() has to be called.
+*/
+
+PropertyList::PropertyList( PropertyEditor *e )
+ : QListView( e ), editor( e )
+{
+ init_colors();
+
+ whatsThis = new PropertyWhatsThis( this );
+ showSorted = FALSE;
+ header()->setMovingEnabled( FALSE );
+ header()->setStretchEnabled( TRUE );
+ setResizePolicy( QScrollView::Manual );
+ viewport()->setAcceptDrops( TRUE );
+ viewport()->installEventFilter( this );
+ addColumn( i18n( "Property" ) );
+ addColumn( i18n( "Value" ) );
+ connect( header(), SIGNAL( sizeChange( int, int, int ) ),
+ this, SLOT( updateEditorSize() ) );
+ disconnect( header(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( changeSortColumn( int ) ) );
+ connect( header(), SIGNAL( sectionClicked( int ) ),
+ this, SLOT( toggleSort() ) );
+ connect( this, SIGNAL( pressed( QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( itemPressed( QListViewItem *, const QPoint &, int ) ) );
+ connect( this, SIGNAL( doubleClicked( QListViewItem * ) ),
+ this, SLOT( toggleOpen( QListViewItem * ) ) );
+ setSorting( -1 );
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ setColumnWidthMode( 1, Manual );
+ mousePressed = FALSE;
+ pressItem = 0;
+ theLastEvent = MouseEvent;
+ header()->installEventFilter( this );
+}
+
+void PropertyList::toggleSort()
+{
+ showSorted = !showSorted;
+ editor->clear();
+ editor->setup();
+}
+
+void PropertyList::resizeEvent( QResizeEvent *e )
+{
+ QListView::resizeEvent( e );
+ if ( currentItem() )
+ ( ( PropertyItem* )currentItem() )->showEditor();
+}
+
+static QVariant::Type type_to_variant( const QString &s )
+{
+ if ( s == "Invalid " )
+ return QVariant::Invalid;
+ if ( s == "Map" )
+ return QVariant::Map;
+ if ( s == "List" )
+ return QVariant::List;
+ if ( s == "String" )
+ return QVariant::String;
+ if ( s == "StringList" )
+ return QVariant::StringList;
+ if ( s == "Font" )
+ return QVariant::Font;
+ if ( s == "Pixmap" )
+ return QVariant::Pixmap;
+ if ( s == "Brush" )
+ return QVariant::Brush;
+ if ( s == "Rect" )
+ return QVariant::Rect;
+ if ( s == "Size" )
+ return QVariant::Size;
+ if ( s == "Color" )
+ return QVariant::Color;
+ if ( s == "Palette" )
+ return QVariant::Palette;
+ if ( s == "ColorGroup" )
+ return QVariant::ColorGroup;
+ if ( s == "IconSet" )
+ return QVariant::IconSet;
+ if ( s == "Point" )
+ return QVariant::Point;
+ if ( s == "Image" )
+ return QVariant::Image;
+ if ( s == "Int" )
+ return QVariant::Int;
+ if ( s == "UInt" )
+ return QVariant::UInt;
+ if ( s == "Bool" )
+ return QVariant::Bool;
+ if ( s == "Double" )
+ return QVariant::Double;
+ if ( s == "CString" )
+ return QVariant::CString;
+ if ( s == "PointArray" )
+ return QVariant::PointArray;
+ if ( s == "Region" )
+ return QVariant::Region;
+ if ( s == "Bitmap" )
+ return QVariant::Bitmap;
+ if ( s == "Cursor" )
+ return QVariant::Cursor;
+ if ( s == "SizePolicy" )
+ return QVariant::SizePolicy;
+ if ( s == "Date" )
+ return QVariant::Date;
+ if ( s == "Time" )
+ return QVariant::Time;
+ if ( s == "DateTime" )
+ return QVariant::DateTime;
+ return QVariant::Invalid;
+}
+
+#ifndef QT_NO_SQL
+static bool parent_is_data_aware( QWidget *w )
+{
+ QWidget *p = w ? w->parentWidget() : 0;
+ while ( p && !p->isTopLevel() ) {
+ if ( ::qt_cast<QDesignerDataBrowser*>(p) || ::qt_cast<QDesignerDataView*>(p) )
+ return TRUE;
+ p = p->parentWidget();
+ }
+ return FALSE;
+}
+#endif
+
+/*! Sets up the property list by adding an item for each designable
+property of the widget which is just edited.
+*/
+
+void PropertyList::setupProperties()
+{
+ if ( !editor->widget() )
+ return;
+ bool allProperties = !::qt_cast<Spacer*>(editor->widget());
+ QStrList lst = editor->widget()->metaObject()->propertyNames( allProperties );
+ PropertyItem *item = 0;
+ QMap<QString, bool> unique;
+ QObject *w = editor->widget();
+ QStringList valueSet;
+ bool parentHasLayout =
+ w->isWidgetType() &&
+ !editor->formWindow()->isMainContainer( (QWidget*)w ) && ( (QWidget*)w )->parentWidget() &&
+ WidgetFactory::layoutType( ( (QWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
+ for ( QPtrListIterator<char> it( lst ); it.current(); ++it ) {
+ const QMetaProperty* p =
+ editor->widget()->metaObject()->
+ property( editor->widget()->metaObject()->findProperty( it.current(), allProperties), allProperties );
+ if ( !p )
+ continue;
+ if ( unique.contains( QString::fromLatin1( it.current() ) ) )
+ continue;
+ if ( ::qt_cast<QDesignerToolBar*>(editor->widget()) ||
+ ::qt_cast<MenuBarEditor*>(editor->widget()) ) {
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "sizePolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumSize" ) == 0 )
+ continue;
+ }
+ unique.insert( QString::fromLatin1( it.current() ), TRUE );
+ if ( editor->widget()->isWidgetType() &&
+ editor->formWindow()->isMainContainer( (QWidget*)editor->widget() ) ) {
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ } else { // hide some toplevel-only stuff
+ if ( qstrcmp( p->name(), "icon" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "iconText" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "caption" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "sizeIncrement" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "baseSize" ) == 0 )
+ continue;
+ if ( parentHasLayout && qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( ::qt_cast<QLayoutWidget*>(w) || ::qt_cast<Spacer*>(w) ) {
+ if ( qstrcmp( p->name(), "sizePolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "geometry" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumSize" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "enabled" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteForegroundColor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteBackgroundColor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "paletteBackgroundPixmap" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "palette" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "font" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "cursor" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "mouseTracking" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "focusPolicy" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "acceptDrops" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "autoMask" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "backgroundOrigin" ) == 0 )
+ continue;
+ }
+ }
+ if ( ::qt_cast<QActionGroup*>(w) ) {
+ if ( qstrcmp( p->name(), "usesDropDown" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "toggleAction" ) == 0 )
+ continue;
+ }
+ if ( qstrcmp( p->name(), "minimumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "minimumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumHeight" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "maximumWidth" ) == 0 )
+ continue;
+ if ( qstrcmp( p->name(), "buttonGroupId" ) == 0 ) { // #### remove this when designable in Q_PROPERTY can take a function (isInButtonGroup() in this case)
+ if ( !editor->widget()->isWidgetType() ||
+ !editor->widget()->parent() ||
+ !::qt_cast<QButtonGroup*>(editor->widget()->parent()) )
+ continue;
+ }
+
+ bool isPropertyObject = w->isA( "PropertyObject" );
+
+ if ( ( p->designable(w) ||
+ isPropertyObject && p->designable( ( (PropertyObject*)w )->widgetList().first() ) ) &&
+ ( !isPropertyObject || qstrcmp( p->name(), "name" ) != 0 ) ) {
+ if ( p->isSetType() ) {
+ if ( QString( p->name() ) == "alignment" ) {
+ QStringList lst;
+ lst << p->valueToKey( AlignAuto )
+ << p->valueToKey( AlignLeft )
+ << p->valueToKey( AlignHCenter )
+ << p->valueToKey( AlignRight )
+ << p->valueToKey( AlignJustify );
+ item = new PropertyListItem( this, item, 0, "hAlign", FALSE );
+ item->setValue( lst );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "hAlign" ) )
+ item->setChanged( TRUE, FALSE );
+ if ( !::qt_cast<QMultiLineEdit*>(editor->widget()) ) {
+ lst.clear();
+ lst << p->valueToKey( AlignTop )
+ << p->valueToKey( AlignVCenter )
+ << p->valueToKey( AlignBottom );
+ item = new PropertyListItem( this, item, 0, "vAlign", FALSE );
+ item->setValue( lst );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "vAlign" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyBoolItem( this, item, 0, "wordwrap" );
+ if ( ::qt_cast<QGroupBox*>(w) )
+ item->setVisible( FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "wordwrap" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ } else {
+ QStrList lst( p->enumKeys() );
+ QStringList l;
+ QPtrListIterator<char> it( lst );
+ while ( it.current() != 0 ) {
+ l << QString(*it);
+ ++it;
+ }
+ item = new PropertyEnumItem( this, item, 0, p->name() );
+ item->setValue( l );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ } else if ( p->isEnumType() ) {
+ QStrList l = p->enumKeys();
+ QStringList lst;
+ for ( uint i = 0; i < l.count(); ++i ) {
+ QString k = l.at( i );
+ // filter out enum-masks
+ if ( k[0] == 'M' && k[1].category() == QChar::Letter_Uppercase )
+ continue;
+ lst << k;
+ }
+ item = new PropertyListItem( this, item, 0, p->name(), FALSE );
+ item->setValue( lst );
+ } else {
+ QVariant::Type t = QVariant::nameToType( p->type() );
+ if ( !addPropertyItem( item, p->name(), t ) )
+ continue;
+ }
+ }
+ if ( item && !p->isSetType() ) {
+ if ( valueSet.findIndex( item->name() ) == -1 ) {
+ setPropertyValue( item );
+ valueSet << item->name();
+ }
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), p->name() ) )
+ item->setChanged( TRUE, FALSE );
+ }
+ }
+
+ if ( !::qt_cast<QSplitter*>(w) && !::qt_cast<MenuBarEditor*>(w) && !::qt_cast<QDesignerToolBar*>(w) &&
+ w->isWidgetType() && WidgetFactory::layoutType( (QWidget*)w ) != WidgetFactory::NoLayout ) {
+ item = new PropertyLayoutItem( this, item, 0, "layoutSpacing" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutSpacing" )
+ || MetaDataBase::spacing( editor->widget() ) != -1 )
+ layoutInitValue( item, TRUE );
+ else
+ layoutInitValue( item );
+ item = new PropertyLayoutItem( this, item, 0, "layoutMargin" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "layoutMargin" )
+ || MetaDataBase::margin( editor->widget() ) != -1 )
+ layoutInitValue( item, TRUE );
+ else
+ layoutInitValue( item );
+ QWidget *widget = (QWidget*)w;
+ if ( ( !::qt_cast<QLayoutWidget*>(widget) &&
+ widget->parentWidget() && ::qt_cast<FormWindow*>(widget->parentWidget()) ) ) {
+ item = new PropertyListItem( this, item, 0, "resizeMode", FALSE );
+ QStringList lst;
+ lst << "Auto" << "FreeResize" << "Minimum" << "Fixed";
+ item->setValue( lst );
+ setPropertyValue( item );
+ QString resizeMod = MetaDataBase::resizeMode( editor->widget() );
+ if ( !resizeMod.isEmpty() &&
+ resizeMod != WidgetFactory::defaultCurrentItem( editor->widget(), "resizeMode" ) ) {
+ item->setChanged( TRUE, FALSE );
+ MetaDataBase::setPropertyChanged( editor->widget(), "resizeMode", TRUE );
+ }
+ }
+ }
+
+ if ( !::qt_cast<Spacer*>(w) && !::qt_cast<QLayoutWidget*>(w) &&
+ !::qt_cast<MenuBarEditor*>(w) && !::qt_cast<QDesignerToolBar*>(w) ) {
+ item = new PropertyTextItem( this, item, 0, "toolTip", TRUE, FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "toolTip" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyTextItem( this, item, 0, "whatsThis", TRUE, TRUE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "whatsThis" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+
+#ifndef QT_NO_SQL
+ if ( !::qt_cast<QDataTable*>(editor->widget()) && !::qt_cast<QDataBrowser*>(editor->widget()) &&
+ !::qt_cast<QDataView*>(editor->widget()) && parent_is_data_aware( ::qt_cast<QWidget*>(editor->widget()) ) ) {
+ item = new PropertyDatabaseItem( this, item, 0, "database", editor->formWindow()->mainContainer() != w );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+
+ if ( ::qt_cast<QDataTable*>(editor->widget()) || ::qt_cast<QDataBrowser*>(editor->widget()) ||
+ ::qt_cast<QDataView*>(editor->widget()) ) {
+ item = new PropertyDatabaseItem( this, item, 0, "database", FALSE );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "database" ) )
+ item->setChanged( TRUE, FALSE );
+ item = new PropertyBoolItem( this, item, 0, "frameworkCode" );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), "frameworkCode" ) )
+ item->setChanged( TRUE, FALSE );
+ }
+#endif
+
+ if ( w->isA("PropertyObject") ) {
+ const QWidgetList wl = ( (PropertyObject*)w )->widgetList();
+ QPtrListIterator<QWidget> wIt( wl );
+ while ( *wIt ) {
+ if ( (*wIt)->inherits("CustomWidget") ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)*wIt )->customWidget();
+ setupCusWidgetProperties( cw, unique, item );
+ }
+ ++wIt;
+ }
+ } else if ( w->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)w )->customWidget();
+ setupCusWidgetProperties( cw, unique, item );
+ }
+
+ setCurrentItem( firstChild() );
+
+ if ( showSorted ) {
+ setSorting( 0 );
+ sort();
+ setSorting( -1 );
+ setCurrentItem( firstChild() );
+ qApp->processEvents();
+ }
+
+ updateEditorSize();
+}
+
+void PropertyList::setupCusWidgetProperties( MetaDataBase::CustomWidget *cw,
+ QMap<QString, bool> &unique,
+ PropertyItem *&item )
+{
+ if ( !cw )
+ return;
+
+ for ( QValueList<MetaDataBase::Property>::Iterator it =
+ cw->lstProperties.begin(); it != cw->lstProperties.end(); ++it ) {
+ if ( unique.contains( QString( (*it).property ) ) )
+ continue;
+ unique.insert( QString( (*it).property ), TRUE );
+ addPropertyItem( item, (*it).property, type_to_variant( (*it).type ) );
+ setPropertyValue( item );
+ if ( MetaDataBase::isPropertyChanged( editor->widget(), (*it).property ) )
+ item->setChanged( TRUE, FALSE );
+ }
+}
+
+bool PropertyList::addPropertyItem( PropertyItem *&item, const QCString &name, QVariant::Type t )
+{
+ if ( name == "buddy" ) {
+ PropertyListItem *itm = new PropertyListItem( this, item, 0, name, TRUE );
+ QPtrDict<QWidget> *widgets = editor->formWindow()->widgets();
+ QPtrDictIterator<QWidget> it( *widgets );
+ QStringList l;
+ l << "";
+ while ( it.current() ) {
+ if ( editor->formWindow()->canBeBuddy( it.current() ) ) {
+ if ( l.find( it.current()->name() ) == l.end() )
+ l << it.current()->name();
+ }
+ ++it;
+ }
+ l.sort();
+ itm->setValue( l );
+ item = itm;
+ return TRUE;
+ }
+
+ switch ( t ) {
+ case QVariant::String:
+ item = new PropertyTextItem( this, item, 0, name, TRUE,
+ ::qt_cast<QLabel*>(editor->widget()) ||
+ ::qt_cast<QTextView*>(editor->widget()) ||
+ ::qt_cast<QButton*>(editor->widget()) );
+ break;
+ case QVariant::CString:
+ item = new PropertyTextItem( this, item, 0,
+ name, name == "name" &&
+ editor->widget() == editor->formWindow()->mainContainer(),
+ FALSE, TRUE );
+ break;
+ case QVariant::Bool:
+ item = new PropertyBoolItem( this, item, 0, name );
+ break;
+ case QVariant::Font:
+ item = new PropertyFontItem( this, item, 0, name );
+ break;
+ case QVariant::Int:
+ if ( name == "accel" )
+ item = new PropertyTextItem( this, item, 0, name, FALSE, FALSE, FALSE, TRUE );
+ else if ( name == "layoutSpacing" || name == "layoutMargin" )
+ item = new PropertyLayoutItem( this, item, 0, name );
+ else if ( name == "resizeMode" )
+ item = new PropertyListItem( this, item, 0, name, TRUE );
+ else
+ item = new PropertyIntItem( this, item, 0, name, TRUE );
+ break;
+ case QVariant::Double:
+ item = new PropertyDoubleItem( this, item, 0, name );
+ break;
+ case QVariant::KeySequence:
+ item = new PropertyKeysequenceItem( this, item, 0, name );
+ break;
+ case QVariant::UInt:
+ item = new PropertyIntItem( this, item, 0, name, FALSE );
+ break;
+ case QVariant::StringList:
+ item = new PropertyListItem( this, item, 0, name, TRUE );
+ break;
+ case QVariant::Rect:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Rect );
+ break;
+ case QVariant::Point:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Point );
+ break;
+ case QVariant::Size:
+ item = new PropertyCoordItem( this, item, 0, name, PropertyCoordItem::Size );
+ break;
+ case QVariant::Color:
+ item = new PropertyColorItem( this, item, 0, name, TRUE );
+ break;
+ case QVariant::Pixmap:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::Pixmap );
+ break;
+ case QVariant::IconSet:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::IconSet );
+ break;
+ case QVariant::Image:
+ item = new PropertyPixmapItem( this, item, 0, name, PropertyPixmapItem::Image );
+ break;
+ case QVariant::SizePolicy:
+ item = new PropertySizePolicyItem( this, item, 0, name );
+ break;
+ case QVariant::Palette:
+ item = new PropertyPaletteItem( this, item, 0, name );
+ break;
+ case QVariant::Cursor:
+ item = new PropertyCursorItem( this, item, 0, name );
+ break;
+ case QVariant::Date:
+ item = new PropertyDateItem( this, item, 0, name );
+ break;
+ case QVariant::Time:
+ item = new PropertyTimeItem( this, item, 0, name );
+ break;
+ case QVariant::DateTime:
+ item = new PropertyDateTimeItem( this, item, 0, name );
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+void PropertyList::paintEmptyArea( QPainter *p, const QRect &r )
+{
+ p->fillRect( r, *backColor2 );
+}
+
+void PropertyList::setCurrentItem( QListViewItem *i )
+{
+ if ( !i )
+ return;
+
+ if ( currentItem() )
+ ( (PropertyItem*)currentItem() )->hideEditor();
+ QListView::setCurrentItem( i );
+ ( (PropertyItem*)currentItem() )->showEditor();
+}
+
+void PropertyList::updateEditorSize()
+{
+ if ( currentItem() )
+ ( ( PropertyItem* )currentItem() )->showEditor();
+}
+
+/*! This has to be called if the value if \a i should be set as
+ property to the currently edited widget.
+*/
+
+void PropertyList::valueChanged( PropertyItem *i )
+{
+ if ( !editor->widget() )
+ return;
+ QString pn( i18n( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), WidgetFactory::property( editor->widget(), i->name() ),
+ i->value(), i->currentItem(), i->currentItemFromObject() );
+
+ cmd->execute();
+ editor->formWindow()->commandHistory()->addCommand( cmd, TRUE );
+}
+
+void PropertyList::layoutInitValue( PropertyItem *i, bool changed )
+{
+ if ( !editor->widget() )
+ return;
+ QString pn( i18n( "Set '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), WidgetFactory::property( editor->widget(), i->name() ),
+ i->value(), i->currentItem(), i->currentItemFromObject() );
+ cmd->execute();
+ if ( i->value().toString() != "-1" )
+ changed = TRUE;
+ i->setChanged( changed );
+}
+
+void PropertyList::itemPressed( QListViewItem *i, const QPoint &p, int c )
+{
+ if ( !i )
+ return;
+ PropertyItem *pi = (PropertyItem*)i;
+ if ( !pi->hasSubItems() )
+ return;
+
+ if ( c == 0 && viewport()->mapFromGlobal( p ).x() < 20 )
+ toggleOpen( i );
+}
+
+void PropertyList::toggleOpen( QListViewItem *i )
+{
+ if ( !i )
+ return;
+ PropertyItem *pi = (PropertyItem*)i;
+ if ( pi->hasSubItems() ) {
+ pi->setOpen( !pi->isOpen() );
+ } else {
+ pi->toggle();
+ }
+}
+
+bool PropertyList::eventFilter( QObject *o, QEvent *e )
+{
+ if ( !o || !e )
+ return TRUE;
+
+ PropertyItem *i = (PropertyItem*)currentItem();
+ if ( e->type() == QEvent::KeyPress )
+ theLastEvent = KeyEvent;
+ else if ( e->type() == QEvent::MouseButtonPress )
+ theLastEvent = MouseEvent;
+
+ if ( o != this &&e->type() == QEvent::KeyPress ) {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if ( ( ke->key() == Key_Up || ke->key() == Key_Down ) &&
+ ( o != this || o != viewport() ) &&
+ !( ke->state() & ControlButton ) ) {
+ QApplication::sendEvent( this, (QKeyEvent*)e );
+ return TRUE;
+ } else if ( ( !::qt_cast<QLineEdit*>(o) ||
+ ( ::qt_cast<QLineEdit*>(o) && ( (QLineEdit*)o )->isReadOnly() ) ) &&
+ i && i->hasSubItems() ) {
+ if ( !i->isOpen() &&
+ ( ke->key() == Key_Plus ||
+ ke->key() == Key_Right ))
+ i->setOpen( TRUE );
+ else if ( i->isOpen() &&
+ ( ke->key() == Key_Minus ||
+ ke->key() == Key_Left ) )
+ i->setOpen( FALSE );
+ } else if ( ( ke->key() == Key_Return || ke->key() == Key_Enter ) && ::qt_cast<QComboBox*>(o) ) {
+ QKeyEvent ke2( QEvent::KeyPress, Key_Space, 0, 0 );
+ QApplication::sendEvent( o, &ke2 );
+ return TRUE;
+ }
+ } else if ( e->type() == QEvent::FocusOut && ::qt_cast<QLineEdit*>(o) && editor->formWindow() ) {
+ QTimer::singleShot( 100, editor->formWindow()->commandHistory(), SLOT( checkCompressedCommand() ) );
+ } else if ( o == viewport() ) {
+ QMouseEvent *me;
+ PropertyListItem* i;
+ switch ( e->type() ) {
+ case QEvent::MouseButtonPress:
+ me = (QMouseEvent*)e;
+ i = (PropertyListItem*) itemAt( me->pos() );
+ if ( i && ( ::qt_cast<PropertyColorItem*>(i) || ::qt_cast<PropertyPixmapItem*>(i) ) ) {
+ pressItem = i;
+ pressPos = me->pos();
+ mousePressed = TRUE;
+ }
+ break;
+ case QEvent::MouseMove:
+ me = (QMouseEvent*)e;
+ if ( me && me->state() & LeftButton && mousePressed) {
+
+ i = (PropertyListItem*) itemAt( me->pos() );
+ if ( i && i == pressItem ) {
+
+ if (( pressPos - me->pos() ).manhattanLength() > QApplication::startDragDistance() ){
+ if ( ::qt_cast<PropertyColorItem*>(i) ) {
+ QColor col = i->value().asColor();
+ QColorDrag *drg = new QColorDrag( col, this );
+ QPixmap pix( 25, 25 );
+ pix.fill( col );
+ QPainter p( &pix );
+ p.drawRect( 0, 0, pix.width(), pix.height() );
+ p.end();
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ else if ( ::qt_cast<PropertyPixmapItem*>(i) ) {
+ QPixmap pix = i->value().asPixmap();
+ if( !pix.isNull() ) {
+ QImage img = pix.convertToImage();
+ QImageDrag *drg = new QImageDrag( img, this );
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ }
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ } else if ( o == header() ) {
+ if ( e->type() == QEvent::ContextMenu ) {
+ ((QContextMenuEvent *)e)->accept();
+ QPopupMenu menu( 0 );
+ menu.setCheckable( TRUE );
+ const int cat_id = 1;
+ const int alpha_id = 2;
+ menu.insertItem( i18n( "Sort &Categorized" ), cat_id );
+ int alpha = menu.insertItem( i18n( "Sort &Alphabetically" ), alpha_id );
+ if ( showSorted )
+ menu.setItemChecked( alpha_id, TRUE );
+ else
+ menu.setItemChecked( cat_id, TRUE );
+ int res = menu.exec( ( (QContextMenuEvent*)e )->globalPos() );
+ if ( res != -1 ) {
+ bool newShowSorted = ( res == alpha );
+ if ( showSorted != newShowSorted ) {
+ showSorted = newShowSorted;
+ editor->clear();
+ editor->setup();
+ }
+ }
+ return TRUE;
+ }
+ }
+
+ return QListView::eventFilter( o, e );
+}
+
+/*! This method re-initializes each item of the property list.
+*/
+
+void PropertyList::refetchData()
+{
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ PropertyItem *i = (PropertyItem*)it.current();
+ if ( !i->propertyParent() )
+ setPropertyValue( i );
+ if ( i->hasSubItems() )
+ i->initChildren();
+ bool changed = MetaDataBase::isPropertyChanged( editor->widget(), i->name() );
+ if ( ( i->name() == "layoutSpacing" || i->name() == "layoutMargin" ) ) {
+ if ( i->value().toString() != "-1" )
+ i->setChanged( TRUE, FALSE );
+ else
+ i->setChanged( FALSE, FALSE );
+ }
+ else if ( changed != i->isChanged() )
+ i->setChanged( changed, FALSE );
+ }
+ updateEditorSize();
+}
+
+static void clearAlignList( QStrList &l )
+{
+ if ( l.count() == 1 )
+ return;
+ if ( l.find( "AlignAuto" ) != -1 )
+ l.remove( "AlignAuto" );
+ if ( l.find( "WordBreak" ) != -1 )
+ l.remove( "WordBreak" );
+}
+
+/*! This method initializes the value of the item \a i to the value
+ of the corresponding property.
+*/
+
+void PropertyList::setPropertyValue( PropertyItem *i )
+{
+ const QMetaProperty *p =
+ editor->widget()->metaObject()->
+ property( editor->widget()->metaObject()->findProperty( i->name(), TRUE), TRUE );
+ if ( !p ) {
+ if ( i->name() == "hAlign" ) {
+ int align = editor->widget()->property( "alignment" ).toInt();
+ p = editor->widget()->metaObject()->
+ property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE );
+ align &= ~AlignVertical_Mask;
+ QStrList l = p->valueToKeys( align );
+ clearAlignList( l );
+ ( (PropertyListItem*)i )->setCurrentItem( l.last() );
+ } else if ( i->name() == "vAlign" ) {
+ int align = editor->widget()->property( "alignment" ).toInt();
+ p = editor->widget()->metaObject()->
+ property( editor->widget()->metaObject()->findProperty( "alignment", TRUE ), TRUE );
+ align &= ~AlignHorizontal_Mask;
+ ( (PropertyListItem*)i )->setCurrentItem( p->valueToKeys( align ).last() );
+ } else if ( i->name() == "wordwrap" ) {
+ int align = editor->widget()->property( "alignment" ).toInt();
+ if ( align & WordBreak )
+ i->setValue( QVariant( TRUE, 0 ) );
+ else
+ i->setValue( QVariant( FALSE, 0 ) );
+ } else if ( i->name() == "layoutSpacing" ) {
+ ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "layoutMargin" ) {
+ ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::margin( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "resizeMode" ) {
+ ( (PropertyListItem*)i )->setCurrentItem( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( (QWidget*)editor->widget() ) ) );
+ } else if ( i->name() == "toolTip" || i->name() == "whatsThis" || i->name() == "database" || i->name() == "frameworkCode" ) {
+ i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) );
+ } else if ( editor->widget()->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)editor->widget() )->customWidget();
+ if ( !cw )
+ return;
+ i->setValue( MetaDataBase::fakeProperty( editor->widget(), i->name() ) );
+ }
+ return;
+ }
+ if ( p->isSetType() )
+ ( (PropertyEnumItem*)i )->setCurrentValues( p->valueToKeys( editor->widget()->property( i->name() ).toInt() ) );
+ else if ( p->isEnumType() )
+ ( (PropertyListItem*)i )->setCurrentItem( p->valueToKey( editor->widget()->property( i->name() ).toInt() ) );
+ else if ( qstrcmp( p->name(), "buddy" ) == 0 )
+ ( (PropertyListItem*)i )->setCurrentItem( editor->widget()->property( i->name() ).toString() );
+ else
+ i->setValue( editor->widget()->property( i->name() ) );
+}
+
+void PropertyList::setCurrentProperty( const QString &n )
+{
+ if ( currentItem() && currentItem()->text( 0 ) == n ||
+ currentItem() && ( (PropertyItem*)currentItem() )->propertyParent() &&
+ ( (PropertyItem*)currentItem() )->propertyParent()->text( 0 ) == n )
+ return;
+
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->text( 0 ) == n ) {
+ setCurrentItem( it.current() );
+ break;
+ }
+ }
+}
+
+PropertyEditor *PropertyList::propertyEditor() const
+{
+ return editor;
+}
+
+void PropertyList::resetProperty()
+{
+ if ( !currentItem() )
+ return;
+ PropertyItem *i = (PropertyItem*)currentItem();
+ if ( !MetaDataBase::isPropertyChanged( editor->widget(), i->PropertyItem::name() ) )
+ return;
+ QString pn( i18n( "Reset '%1' of '%2'" ).arg( i->name() ).arg( editor->widget()->name() ) );
+ SetPropertyCommand *cmd = new SetPropertyCommand( pn, editor->formWindow(),
+ editor->widget(), editor,
+ i->name(), i->value(),
+ WidgetFactory::defaultValue( editor->widget(), i->name() ),
+ WidgetFactory::defaultCurrentItem( editor->widget(), i->name() ),
+ i->currentItem(), TRUE );
+ cmd->execute();
+ editor->formWindow()->commandHistory()->addCommand( cmd, FALSE );
+ if ( i->hasSubItems() )
+ i->initChildren();
+}
+
+void PropertyList::viewportDragEnterEvent( QDragEnterEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::qt_cast<PropertyColorItem*>(i) && QColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( ::qt_cast<PropertyPixmapItem*>(i) && QImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void PropertyList::viewportDragMoveEvent ( QDragMoveEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::qt_cast<PropertyColorItem*>(i) && QColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( ::qt_cast<PropertyPixmapItem*>(i) && QImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void PropertyList::viewportDropEvent ( QDropEvent *e )
+{
+ PropertyListItem *i = (PropertyListItem*) itemAt( e->pos() );
+ if( !i ) {
+ e->ignore();
+ return;
+ }
+
+ if ( ::qt_cast<PropertyColorItem*>(i) && QColorDrag::canDecode( e ) ) {
+ QColor color;
+ QColorDrag::decode( e, color );
+ i->setValue( QVariant( color ) );
+ valueChanged( i );
+ e->accept();
+ }
+ else if ( ::qt_cast<PropertyPixmapItem*>(i) && QImageDrag::canDecode( e ) ) {
+ QImage img;
+ QImageDrag::decode( e, img );
+ QPixmap pm;
+ pm.convertFromImage( img );
+ i->setValue( QVariant( pm ) );
+ valueChanged( i );
+ e->accept();
+ }
+ else
+ e->ignore();
+}
+
+QString PropertyList::whatsThisAt( const QPoint &p )
+{
+ return whatsThisText( itemAt( p ) );
+}
+
+void PropertyList::showCurrentWhatsThis()
+{
+ if ( !currentItem() )
+ return;
+ QPoint p( 0, currentItem()->itemPos() );
+ p = viewport()->mapToGlobal( contentsToViewport( p ) );
+ QWhatsThis::display( whatsThisText( currentItem() ), p, viewport() );
+}
+
+QString PropertyList::whatsThisText( QListViewItem *i )
+{
+ if ( !i || !editor->widget() )
+ return QString::null;
+ readPropertyDocs();
+ if ( ( (PropertyItem*)i )->propertyParent() )
+ i = ( (PropertyItem*)i )->propertyParent();
+
+ const QMetaObject *mo = editor->widget()->metaObject();
+ QString prop = ( (PropertyItem*)i )->name();
+ while ( mo ) {
+ QString s;
+ s = QString( mo->className() ) + "::" + prop;
+ QMap<QString, QString>::Iterator it;
+ if ( ( it = propertyDocs.find( s ) ) != propertyDocs.end() ) {
+ return *it;
+ }
+ mo = mo->superClass();
+ }
+
+ return i18n( "<p><b>QWidget::%1</b></p><p>There is no documentation available for this property.</p>" ).arg( prop );
+}
+
+void PropertyList::readPropertyDocs()
+{
+ if ( !propertyDocs.isEmpty() )
+ return;
+
+ QString docFile = MainWindow::self->documentationPath() + "/propertydocs";
+ QFile f( docFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+ if ( !doc.setContent( &f, &errMsg, &errLine ) )
+ return;
+ QDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ for ( ; !e.isNull(); e = e.nextSibling().toElement() ) {
+ QDomElement n = e.firstChild().toElement();
+ QString name;
+ QString doc;
+ for ( ; !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "name" )
+ name = n.firstChild().toText().data();
+ else if ( n.tagName() == "doc" )
+ doc = n.firstChild().toText().data();
+ }
+ doc.insert( 0, "<p><b>" + name + "</b></p>" );
+ propertyDocs.insert( name, doc );
+ }
+}
+
+PropertyList::LastEventType PropertyList::lastEvent()
+{
+ return theLastEvent;
+}
+// ------------------------------------------------------------
+
+EventList::EventList( QWidget *parent, FormWindow *fw, PropertyEditor *e )
+ : HierarchyList( parent, fw, TRUE ), editor( e )
+{
+ header()->hide();
+ removeColumn( 1 );
+ setRootIsDecorated( TRUE );
+ connect( this, SIGNAL( itemRenamed( QListViewItem *, int, const QString & ) ),
+ this, SLOT( renamed( QListViewItem * ) ) );
+}
+
+QString clean_arguments( const QString &s )
+{
+ QString slot = s;
+ QString arg = slot.mid( slot.find( '(' ) + 1 );
+ arg = arg.left( arg.findRev( ')' ) );
+ QStringList args = QStringList::split( ',', arg );
+ slot = slot.left( slot.find( '(' ) + 1 );
+ int num = 0;
+ for ( QStringList::Iterator it = args.begin(); it != args.end(); ++it, ++num ) {
+ QString a = *it;
+ int i;
+ if ( ( i =a.find( ':' ) ) == -1 )
+ slot += a.simplifyWhiteSpace();
+ else
+ slot += a.mid( i + 1 ).simplifyWhiteSpace();
+ if ( num < (int)args.count() - 1 )
+ slot += ",";
+ }
+
+ slot += ")";
+
+ return slot;
+}
+
+
+void EventList::setup()
+{
+ clear();
+
+ if ( !formWindow )
+ return;
+ LanguageInterface *iface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ const QPixmap DesignerEditSlotsPix = SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance());
+ QStrList sigs;
+ if ( iface )
+ {
+ sigs = iface->signalNames( editor->widget() );
+ }
+ QStrListIterator it( sigs );
+ while ( it.current() ) {
+ HierarchyItem *eventItem = new HierarchyItem( HierarchyItem::Event, this, (HierarchyItem*)0,
+ it.current(), QString::null, QString::null );
+ eventItem->setOpen( TRUE );
+ QValueList<MetaDataBase::Connection> conns =
+ MetaDataBase::connections( formWindow, editor->widget(), formWindow->mainContainer() );
+ HierarchyItem *item = 0;
+ for ( QValueList<MetaDataBase::Connection>::Iterator cit = conns.begin();
+ cit != conns.end(); ++cit ) {
+ QString s = it.current();
+ if ( MetaDataBase::normalizeFunction( clean_arguments( QString( (*cit).signal ) ) ) !=
+ MetaDataBase::normalizeFunction( clean_arguments( s ) ) )
+ continue;
+ item = new HierarchyItem( HierarchyItem::EventFunction, eventItem, item,
+ (*cit).slot, QString::null, QString::null );
+ item->setPixmap( 0, DesignerEditSlotsPix );
+ }
+ ++it;
+ }
+}
+
+extern QListViewItem *newItem;
+
+void EventList::contentsMouseDoubleClickEvent( QMouseEvent *e )
+{
+ QListViewItem *i = itemAt( contentsToViewport( e->pos() ) );
+ if ( !i || i->parent() )
+ return;
+ QString s;
+ if ( !formWindow->project()->isCpp() ) {
+ QString s1 = i->text( 0 );
+ int pt = s1.find( "(" );
+ if ( pt != -1 )
+ s1 = s1.left( pt );
+ s = QString( editor->widget()->name() ) + "_" + s1;
+ } else {
+ s = QString( editor->widget()->name() ) + "_" + i->text( 0 );
+ }
+
+ const QPixmap DesignerEditSlotsPix = SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance());
+ insertEntry( i, DesignerEditSlotsPix , s );
+}
+
+void EventList::setCurrent( QWidget * )
+{
+}
+
+void EventList::objectClicked( QListViewItem *i )
+{
+ if ( !i || !i->parent() )
+ return;
+// formWindow->clearSelection(false);
+ formWindow->mainWindow()->part()->emitEditFunction(formWindow->fileName(), i->text( 0 ));
+// formWindow->mainWindow()->editFunction( i->text( 0 ) );
+}
+
+void EventList::showRMBMenu( QListViewItem *i, const QPoint &pos )
+{
+ if ( !i )
+ return;
+ QPopupMenu menu;
+ const int NEW_ITEM = 1;
+ const int DEL_ITEM = 2;
+ menu.insertItem( SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()), i18n( "New Signal Handler" ), NEW_ITEM );
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()), i18n( "Delete Signal Handler" ), DEL_ITEM );
+ int res = menu.exec( pos );
+ if ( res == NEW_ITEM ) {
+ QString s;
+ if ( !formWindow->project()->isCpp() ) {
+ QString s1 = ( i->parent() ? i->parent() : i )->text( 0 );
+ int pt = s1.find( "(" );
+ if ( pt != -1 )
+ s1 = s1.left( pt );
+ s = QString( editor->widget()->name() ) + "_" + s1;
+ } else {
+ s = QString( editor->widget()->name() ) + "_" + ( i->parent() ? i->parent() : i )->text( 0 );
+ }
+ insertEntry( i->parent() ? i->parent() : i, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()), s );
+ } else if ( res == DEL_ITEM && i->parent() ) {
+ MetaDataBase::Connection conn;
+ conn.sender = editor->widget();
+ conn.receiver = formWindow->mainContainer();
+ conn.signal = i->parent()->text( 0 );
+ conn.slot = i->text( 0 );
+ delete i;
+ RemoveConnectionCommand *cmd = new RemoveConnectionCommand( i18n( "Remove Connection" ),
+ formWindow,
+ conn );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ }
+}
+
+void EventList::renamed( QListViewItem *i )
+{
+ if ( newItem == i )
+ newItem = 0;
+ if ( !i->parent() )
+ return;
+ QListViewItem *itm = i->parent()->firstChild();
+ bool del = FALSE;
+ while ( itm ) {
+ if ( itm != i && itm->text( 0 ) == i->text( 0 ) ) {
+ del = TRUE;
+ break;
+ }
+ itm = itm->nextSibling();
+ }
+ i->setRenameEnabled( 0, FALSE );
+ if ( del ) {
+ delete i;
+ } else {
+ MetaDataBase::Connection conn;
+ conn.sender = editor->widget();
+ conn.receiver = formWindow->mainContainer();
+ conn.signal = i->parent()->text( 0 );
+ conn.slot = i->text( 0 );
+ AddConnectionCommand *cmd = new AddConnectionCommand( i18n( "Add Connection" ),
+ formWindow,
+ conn );
+ formWindow->commandHistory()->addCommand( cmd );
+ // #### we should look if the specified slot already
+ // exists and if we can connect to this one
+ QString funcname = i->text( 0 ).latin1();
+ if ( funcname.find( '(' ) == -1 ) { // try to create a signature
+ QString sig = i->parent()->text( 0 );
+ sig = sig.mid( sig.find( '(' ) + 1 );
+ sig.remove( (int)sig.length() - 1, 1 );
+ LanguageInterface *iface = MetaDataBase::languageInterface( formWindow->project()->language() );
+ if ( iface )
+ sig = iface->createArguments( sig.simplifyWhiteSpace() );
+ funcname += "(" + sig + ")";
+ }
+
+ //normally add a function in kdevdesigner
+ AddFunctionCommand *cmd2 = new AddFunctionCommand( i18n( "Add Function" ),
+ formWindow, funcname.latin1(), "virtual",
+ "public",
+ "slot", formWindow->project()->language(),
+ "void" );
+
+/* MetaDataBase::addFunction( formWindow, funcname.latin1(), "virtual", "public",
+ "slot", formWindow->project()->language(), "void" );
+ editor->formWindow()->mainWindow()->
+ editFunction( i->text( 0 ).left( i->text( 0 ).find( "(" ) ), TRUE );*/
+ cmd->execute();
+ cmd2->execute();
+ editor->formWindow()->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ editor->formWindow()->formFile()->setModified( TRUE );
+ }
+}
+
+void EventList::save( QListViewItem *p )
+{
+ QStringList lst;
+ QListViewItem *i = p->firstChild();
+ while ( i ) {
+ lst << i->text( 0 );
+ i = i->nextSibling();
+ }
+}
+
+// --------------------------------------------------------------
+
+/*!
+ \class PropertyEditor propertyeditor.h
+ \brief PropertyEdior toplevel window
+
+ This is the toplevel window of the property editor which contains a
+ listview for editing properties.
+*/
+
+PropertyEditor::PropertyEditor( QWidget *parent )
+ : QTabWidget( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
+ WStyle_StaysOnTop | WStyle_Tool |WStyle_MinMax | WStyle_SysMenu )
+{
+ setCaption( i18n( "Property Editor" ) );
+ wid = 0;
+ formwindow = 0;
+ listview = new PropertyList( this );
+ addTab( listview, i18n( "P&roperties" ) );
+ eList = new EventList( this, formWindow(), this );
+ addTab( eList, i18n( "Signa&l Handlers" ) );
+}
+
+QObject *PropertyEditor::widget() const
+{
+ return wid;
+}
+
+void PropertyEditor::setWidget( QObject *w, FormWindow *fw )
+{
+ if ( fw && fw->isFake() )
+ w = fw->project()->objectForFakeForm( fw );
+ eList->setFormWindow( fw );
+ if ( w && w == wid ) {
+ // if there is no properties displayed then we really should show them.
+ // to do this check the number of properties in the list.
+ bool ret = (listview->childCount() > 0) ? TRUE : FALSE;
+ if ( wid->isWidgetType() && WidgetFactory::layoutType( (QWidget*)wid ) != WidgetFactory::NoLayout ) {
+ QListViewItemIterator it( listview );
+ ret = FALSE;
+ while ( it.current() ) {
+ if ( it.current()->text( 0 ) == "layoutSpacing" || it.current()->text( 0 ) == "layoutMargin" ) {
+ ret = TRUE;
+ break;
+ }
+ ++it;
+ }
+ }
+ if ( ret )
+ return;
+ }
+
+ if ( !w || !fw ) {
+ setCaption( i18n( "Property Editor" ) );
+ clear();
+ wid = 0;
+ formwindow = 0;
+ return;
+ }
+
+ wid = w;
+ formwindow = fw;
+ setCaption( i18n( "Property Editor (%1)" ).arg( formwindow->name() ) );
+ listview->viewport()->setUpdatesEnabled( FALSE );
+ listview->setUpdatesEnabled( FALSE );
+ clear();
+ listview->viewport()->setUpdatesEnabled( TRUE );
+ listview->setUpdatesEnabled( TRUE );
+ setup();
+}
+
+void PropertyEditor::clear()
+{
+ listview->setContentsPos( 0, 0 );
+ listview->clear();
+ eList->setContentsPos( 0, 0 );
+ eList->clear();
+}
+
+void PropertyEditor::setup()
+{
+ if ( !formwindow || !wid )
+ return;
+ listview->viewport()->setUpdatesEnabled( FALSE );
+ listview->setupProperties();
+ listview->viewport()->setUpdatesEnabled( TRUE );
+ listview->updateEditorSize();
+
+ if ( !wid->isA( "PropertyObject" ) ) {
+ eList->viewport()->setUpdatesEnabled( FALSE );
+ eList->setup();
+ eList->viewport()->setUpdatesEnabled( TRUE );
+ }
+}
+
+void PropertyEditor::refetchData()
+{
+ listview->refetchData();
+}
+
+void PropertyEditor::emitWidgetChanged()
+{
+ if ( formwindow && wid )
+ formwindow->widgetChanged( wid );
+}
+
+void PropertyEditor::closed( FormWindow *w )
+{
+ if ( w == formwindow ) {
+ formwindow = 0;
+ wid = 0;
+ clear();
+ }
+}
+
+void PropertyEditor::closeEvent( QCloseEvent *e )
+{
+ emit hidden();
+ e->accept();
+}
+
+PropertyList *PropertyEditor::propertyList() const
+{
+ return listview;
+}
+
+FormWindow *PropertyEditor::formWindow() const
+{
+ return formwindow;
+}
+
+QString PropertyEditor::currentProperty() const
+{
+ if ( !wid )
+ return QString::null;
+ if ( ( (PropertyItem*)listview->currentItem() )->propertyParent() )
+ return ( (PropertyItem*)listview->currentItem() )->propertyParent()->name();
+ return ( (PropertyItem*)listview->currentItem() )->name();
+}
+
+QString PropertyEditor::classOfCurrentProperty() const
+{
+ if ( !wid )
+ return QString::null;
+ QObject *o = wid;
+ QString curr = currentProperty();
+ QMetaObject *mo = o->metaObject();
+ while ( mo ) {
+ QStrList props = mo->propertyNames( FALSE );
+ if ( props.find( curr.latin1() ) != -1 )
+ return mo->className();
+ mo = mo->superClass();
+ }
+ return QString::null;
+}
+
+QMetaObject* PropertyEditor::metaObjectOfCurrentProperty() const
+{
+ if ( !wid )
+ return 0;
+ return wid->metaObject();
+}
+
+void PropertyEditor::resetFocus()
+{
+ if ( listview->currentItem() )
+ ( (PropertyItem*)listview->currentItem() )->showEditor();
+}
+
+EventList *PropertyEditor::eventList() const
+{
+ return eList;
+}
+
+void PropertyEditor::setPropertyEditorEnabled( bool b )
+{
+ if ( !b )
+ removePage( listview );
+ else
+ insertTab( listview, i18n( "Property Editor" ), 0 );
+ updateWindow();
+}
+
+void PropertyEditor::setSignalHandlersEnabled( bool b )
+{
+ if ( !b )
+ removePage( eList );
+ else
+ insertTab( eList, i18n( "Signal Handlers" ), 0 );
+ updateWindow();
+}
+
+void PropertyEditor::updateWindow()
+{
+ if ( isHidden() && count() ) {
+ parentWidget()->show();
+ MainWindow::self->setAppropriate( (QDockWindow*)parentWidget(), TRUE );
+ } else if ( isShown() && !count() ) {
+ parentWidget()->hide();
+ MainWindow::self->setAppropriate( (QDockWindow*)parentWidget(), FALSE );
+ }
+}
diff --git a/kdevdesigner/designer/propertyeditor.h b/kdevdesigner/designer/propertyeditor.h
new file mode 100644
index 00000000..3bdc19e3
--- /dev/null
+++ b/kdevdesigner/designer/propertyeditor.h
@@ -0,0 +1,867 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PROPERTYEDITOR_H
+#define PROPERTYEDITOR_H
+
+#include <qfeatures.h>
+#include <qvariant.h>
+#include <qlistview.h>
+#include <qptrlist.h>
+#include <qguardedptr.h>
+#include <qtabwidget.h>
+#include <qmodules.h>
+#include <qptrlist.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include "hierarchyview.h"
+#include "metadatabase.h"
+
+class PropertyList;
+class PropertyEditor;
+class QPainter;
+class QColorGroup;
+class QLineEdit;
+class QPushButton;
+class QHBox;
+class QSpinBox;
+class QLabel;
+class QFrame;
+class FormWindow;
+class QCloseEvent;
+class QResizeEvent;
+class PropertyWhatsThis;
+class QDateEdit;
+class QTimeEdit;
+class QDateTimeEdit;
+
+class PropertyItem : public QListViewItem
+{
+public:
+ PropertyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyItem();
+
+ void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
+ void paintBranches( QPainter * p, const QColorGroup & cg,
+ int w, int y, int h );
+ void paintFocus( QPainter *p, const QColorGroup &cg, const QRect &r );
+
+ virtual bool hasSubItems() const;
+ virtual void createChildren();
+ virtual void initChildren();
+
+ bool isOpen() const;
+ void setOpen( bool b );
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ QVariant value() const;
+ QString name() const;
+ virtual void notifyValueChange();
+
+ virtual void setChanged( bool b, bool updateDb = TRUE );
+ bool isChanged() const;
+
+ virtual void placeEditor( QWidget *w );
+
+ virtual PropertyItem *propertyParent() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ void addChild( PropertyItem *i );
+ int childCount() const;
+ PropertyItem *child( int i ) const;
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( QPainter *p, const QRect &r );
+
+ void updateBackColor();
+
+ void setup() { QListViewItem::setup(); setHeight( QListViewItem::height() + 2 ); }
+
+ virtual QString currentItem() const;
+ virtual int currentIntItem() const;
+ virtual void setCurrentItem( const QString &s );
+ virtual void setCurrentItem( int i );
+ virtual int currentIntItemFromObject() const;
+ virtual QString currentItemFromObject() const;
+
+ void setFocus( QWidget *w );
+
+ virtual void toggle();
+ void setText( int col, const QString &txt );
+
+protected:
+ PropertyList *listview;
+ QVariant val;
+
+private:
+ QColor backgroundColor();
+ void createResetButton();
+ void updateResetButtonState();
+
+private:
+ bool open, changed;
+ PropertyItem *property;
+ QString propertyName;
+ QPtrList<PropertyItem> children;
+ QColor backColor;
+ QPushButton *resetButton;
+
+};
+
+class PropertyTextItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyTextItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool comment, bool multiLine, bool ascii = FALSE, bool a = FALSE );
+ ~PropertyTextItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ virtual void setChanged( bool b, bool updateDb = TRUE );
+
+private slots:
+ void setValue();
+ void getText();
+
+private:
+ QLineEdit *lined();
+ QGuardedPtr<QLineEdit> lin;
+ QGuardedPtr<QHBox> box;
+ QPushButton *button;
+ bool withComment, hasMultiLines, asciiOnly, accel;
+
+};
+
+
+class PropertyBoolItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyBoolItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyBoolItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual void toggle();
+
+private slots:
+ void setValue();
+
+private:
+ QComboBox *combo();
+ QGuardedPtr<QComboBox> comb;
+
+};
+
+class PropertyIntItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyIntItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool s );
+ ~PropertyIntItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QSpinBox *spinBox();
+ QGuardedPtr<QSpinBox> spinBx;
+ bool signedValue;
+
+};
+
+class PropertyLayoutItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyLayoutItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyLayoutItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QSpinBox *spinBox();
+ QGuardedPtr<QSpinBox> spinBx;
+
+};
+
+class PropertyDoubleItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyDoubleItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyDoubleItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QLineEdit *lined();
+ QGuardedPtr<QLineEdit> lin;
+};
+
+class PropertyListItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyListItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool editable );
+ ~PropertyListItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+ QString currentItem() const;
+ int currentIntItem() const;
+ void setCurrentItem( const QString &s );
+ void setCurrentItem( int i );
+ int currentIntItemFromObject() const;
+ QString currentItemFromObject() const;
+ void addItem( const QString &s );
+
+private slots:
+ void setValue();
+
+private:
+ QComboBox *combo();
+ QGuardedPtr<QComboBox> comb;
+ int oldInt;
+ bool editable;
+ QString oldString;
+
+};
+
+class PropertyFontItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyFontItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyFontItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private slots:
+ void getFont();
+
+private:
+ QGuardedPtr<QLineEdit> lined;
+ QGuardedPtr<QPushButton> button;
+ QGuardedPtr<QHBox> box;
+
+};
+
+class PropertyCoordItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ enum Type { Rect, Size, Point };
+
+ PropertyCoordItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, Type t );
+ ~PropertyCoordItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ QLineEdit *lined();
+ QGuardedPtr<QLineEdit> lin;
+ Type typ;
+
+};
+
+class PropertyColorItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyColorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, bool children );
+ ~PropertyColorItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( QPainter *p, const QRect &r );
+
+private slots:
+ void getColor();
+
+private:
+ QGuardedPtr<QHBox> box;
+ QGuardedPtr<QFrame> colorPrev;
+ QGuardedPtr<QPushButton> button;
+ bool withChildren;
+
+};
+
+class PropertyPixmapItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ enum Type { Pixmap, IconSet, Image };
+
+ PropertyPixmapItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName, Type t );
+ ~PropertyPixmapItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( QPainter *p, const QRect &r );
+
+private slots:
+ void getPixmap();
+
+private:
+ QGuardedPtr<QHBox> box;
+ QGuardedPtr<QLabel> pixPrev;
+ QPushButton *button;
+ Type type;
+
+};
+
+
+class PropertySizePolicyItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertySizePolicyItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertySizePolicyItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ QLineEdit *lined();
+ QGuardedPtr<QLineEdit> lin;
+
+};
+
+class PropertyPaletteItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyPaletteItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyPaletteItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+ virtual bool hasCustomContents() const;
+ virtual void drawCustomContents( QPainter *p, const QRect &r );
+
+private slots:
+ void getPalette();
+
+private:
+ QGuardedPtr<QHBox> box;
+ QGuardedPtr<QLabel> palettePrev;
+ QGuardedPtr<QPushButton> button;
+
+};
+
+class PropertyCursorItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyCursorItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyCursorItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QComboBox *combo();
+ QGuardedPtr<QComboBox> comb;
+
+};
+
+class PropertyKeysequenceItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyKeysequenceItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyKeysequenceItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ bool eventFilter( QObject *o, QEvent *e );
+ void handleKeyEvent( QKeyEvent *e );
+ int translateModifiers( int state );
+
+ QGuardedPtr<QLineEdit> sequence;
+ QGuardedPtr<QHBox> box;
+ int k1,k2,k3,k4;
+ int num;
+ bool mouseEnter;
+};
+
+class PropertyDatabaseItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyDatabaseItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName, bool wField );
+ ~PropertyDatabaseItem();
+
+ virtual void createChildren();
+ virtual void initChildren();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+ virtual bool hasSubItems() const;
+ virtual void childValueChanged( PropertyItem *child );
+
+private:
+ QGuardedPtr<QLineEdit> lined;
+ QGuardedPtr<QPushButton> button;
+ QGuardedPtr<QHBox> box;
+ bool withField;
+
+};
+
+struct EnumItem {
+ EnumItem( const QString &k, bool s )
+ : key( k ), selected( s ) {}
+ EnumItem() : key( QString::null ), selected( FALSE ) {}
+ bool operator==( const EnumItem &item ) const {
+ return key == item.key;
+ }
+ QString key;
+ bool selected;
+};
+
+class EnumPopup : public QFrame
+{
+ Q_OBJECT
+
+public:
+ EnumPopup( QWidget *parent, const char *name, WFlags f=0 );
+ ~EnumPopup();
+ void insertEnums( QValueList<EnumItem> lst );
+ QValueList<EnumItem> enumList() const;
+ void closeWidget();
+
+signals:
+ void closed();
+ void hidden();
+
+protected:
+ void keyPressEvent( QKeyEvent *e );
+
+private:
+ QValueList<EnumItem> itemList;
+ QPtrList<QCheckBox> checkBoxList;
+ QVBoxLayout *popLayout;
+};
+
+class EnumBox : public QComboBox
+{
+ Q_OBJECT
+
+public:
+ EnumBox( QWidget *parent, const char *name = 0 );
+ ~EnumBox() {}
+ void setText( const QString &text );
+ void insertEnums( QValueList<EnumItem> lst );
+ QValueList<EnumItem> enumList() const;
+
+signals:
+ void aboutToShowPopup();
+ void valueChanged();
+
+protected:
+ void paintEvent( QPaintEvent * );
+ void mousePressEvent( QMouseEvent *e );
+ void keyPressEvent( QKeyEvent *e );
+
+protected slots:
+ void restoreArrow();
+ void popupHidden();
+ void popupClosed();
+
+private:
+ void popup();
+ bool arrowDown;
+ QString str;
+ bool popupShown;
+ EnumPopup *pop;
+
+};
+class PropertyEnumItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyEnumItem( PropertyList *l, PropertyItem *after, PropertyItem *prop,
+ const QString &propName );
+ ~PropertyEnumItem();
+
+ void showEditor();
+ void hideEditor();
+ void setValue( const QVariant &v );
+ QString currentItem() const;
+ QString currentItemFromObject() const;
+ void setCurrentValues( QStrList lst );
+
+private slots:
+ void setValue();
+ void insertEnums();
+
+private:
+ QGuardedPtr<EnumBox> box;
+ QValueList<EnumItem> enumList;
+ QString enumString;
+};
+
+class PropertyList : public QListView
+{
+ Q_OBJECT
+
+public:
+ PropertyList( PropertyEditor *e );
+
+ virtual void setupProperties();
+
+ virtual void setCurrentItem( QListViewItem *i );
+ virtual void valueChanged( PropertyItem *i );
+ virtual void refetchData();
+ virtual void setPropertyValue( PropertyItem *i );
+ virtual void setCurrentProperty( const QString &n );
+
+ void layoutInitValue( PropertyItem *i, bool changed = FALSE );
+ PropertyEditor *propertyEditor() const;
+ QString whatsThisAt( const QPoint &p );
+ void showCurrentWhatsThis();
+
+ enum LastEventType { KeyEvent, MouseEvent };
+ LastEventType lastEvent();
+
+public slots:
+ void updateEditorSize();
+ void resetProperty();
+ void toggleSort();
+
+private slots:
+ void itemPressed( QListViewItem *i, const QPoint &p, int c );
+ void toggleOpen( QListViewItem *i );
+ bool eventFilter( QObject *o, QEvent *e );
+
+protected:
+ void resizeEvent( QResizeEvent *e );
+ void paintEmptyArea( QPainter *p, const QRect &r );
+ bool addPropertyItem( PropertyItem *&item, const QCString &name, QVariant::Type t );
+
+ void viewportDragEnterEvent( QDragEnterEvent * );
+ void viewportDragMoveEvent ( QDragMoveEvent * );
+ void viewportDropEvent ( QDropEvent * );
+
+protected:
+ PropertyEditor *editor;
+
+private:
+ void readPropertyDocs();
+ void setupCusWidgetProperties( MetaDataBase::CustomWidget *cw,
+ QMap<QString, bool> &unique,
+ PropertyItem *&item );
+ QString whatsThisText( QListViewItem *i );
+
+private:
+ PropertyListItem* pressItem;
+ QPoint pressPos;
+ bool mousePressed;
+ bool showSorted;
+ QMap<QString, QString> propertyDocs;
+ PropertyWhatsThis *whatsThis;
+ LastEventType theLastEvent;
+};
+
+class EventList : public HierarchyList
+{
+ Q_OBJECT
+
+public:
+ EventList( QWidget *parent, FormWindow *fw, PropertyEditor *e );
+
+ void setup();
+ void setCurrent( QWidget *w );
+
+protected:
+ void contentsMouseDoubleClickEvent( QMouseEvent *e );
+
+private:
+ void save( QListViewItem *p );
+
+private slots:
+ void objectClicked( QListViewItem *i );
+ void showRMBMenu( QListViewItem *, const QPoint & );
+ void renamed( QListViewItem *i );
+
+private:
+ PropertyEditor *editor;
+
+};
+
+
+class PropertyEditor : public QTabWidget
+{
+ Q_OBJECT
+
+public:
+ PropertyEditor( QWidget *parent );
+
+ QObject *widget() const;
+
+ void clear();
+ void setup();
+
+ void emitWidgetChanged();
+ void refetchData();
+
+ void closed( FormWindow *w );
+
+ PropertyList *propertyList() const;
+ FormWindow *formWindow() const;
+ EventList *eventList() const;
+
+ QString currentProperty() const;
+ QString classOfCurrentProperty() const;
+ QMetaObject* metaObjectOfCurrentProperty() const;
+
+ void resetFocus();
+
+ void setPropertyEditorEnabled( bool b );
+ void setSignalHandlersEnabled( bool b );
+
+signals:
+ void hidden();
+
+public slots:
+ void setWidget( QObject *w, FormWindow *fw );
+
+protected:
+ void closeEvent( QCloseEvent *e );
+
+private:
+ void updateWindow();
+
+private:
+ QObject *wid;
+ PropertyList *listview;
+ EventList *eList;
+ FormWindow *formwindow;
+
+};
+
+class PropertyDateItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyDateItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyDateItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QDateEdit *lined();
+ QGuardedPtr<QDateEdit> lin;
+
+};
+
+class PropertyTimeItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyTimeItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QTimeEdit *lined();
+ QGuardedPtr<QTimeEdit> lin;
+
+};
+
+class PropertyDateTimeItem : public QObject,
+ public PropertyItem
+{
+ Q_OBJECT
+
+public:
+ PropertyDateTimeItem( PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName );
+ ~PropertyDateTimeItem();
+
+ virtual void showEditor();
+ virtual void hideEditor();
+
+ virtual void setValue( const QVariant &v );
+
+private slots:
+ void setValue();
+
+private:
+ QDateTimeEdit *lined();
+ QGuardedPtr<QDateTimeEdit> lin;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/propertyobject.cpp b/kdevdesigner/designer/propertyobject.cpp
new file mode 100644
index 00000000..8687033e
--- /dev/null
+++ b/kdevdesigner/designer/propertyobject.cpp
@@ -0,0 +1,158 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "propertyobject.h"
+#include "metadatabase.h"
+#include <qptrvector.h>
+#include <qptrlist.h>
+#include <qmetaobject.h>
+#include <qvariant.h>
+
+PropertyObject::PropertyObject( const QWidgetList &objs )
+ : QObject(), objects( objs ), mobj( 0 )
+{
+ QPtrVector<QPtrList<QMetaObject> > v;
+ v.resize( objects.count() );
+ v.setAutoDelete( TRUE );
+
+ for ( QObject *o = objects.first(); o; o = objects.next() ) {
+ const QMetaObject *m = o->metaObject();
+ QPtrList<QMetaObject> *mol = new QPtrList<QMetaObject>;
+ while ( m ) {
+ mol->insert( 0, m );
+ m = m->superClass();
+ }
+ v.insert( v.count(), mol );
+ }
+
+ int numObjects = objects.count();
+ int minDepth = v[0]->count();
+ int depth = minDepth;
+
+ for ( int i = 0; i < numObjects; ++i ) {
+ depth = (int)v[i]->count();
+ if ( depth < minDepth )
+ minDepth = depth;
+ }
+
+ const QMetaObject *m = v[0]->at( --minDepth );
+
+ for ( int j = 0; j < numObjects; ++j ) {
+ if ( v[j]->at( minDepth ) != m ) {
+ m = v[0]->at( --minDepth );
+ j = 0;
+ }
+ }
+
+ mobj = m;
+
+ Q_ASSERT( mobj );
+}
+
+bool PropertyObject::setProperty( const char *name, const QVariant& value )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ o->setProperty( name, value );
+
+ return TRUE;
+}
+
+QVariant PropertyObject::property( const char *name ) const
+{
+ return ( (PropertyObject*)this )->objects.first()->property( name );
+}
+
+void PropertyObject::mdPropertyChanged( const QString &property, bool changed )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPropertyChanged( o, property, changed );
+}
+
+bool PropertyObject::mdIsPropertyChanged( const QString &property )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() ) {
+ if ( MetaDataBase::isPropertyChanged( o, property ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void PropertyObject::mdSetPropertyComment( const QString &property, const QString &comment )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPropertyComment( o, property, comment );
+}
+
+QString PropertyObject::mdPropertyComment( const QString &property )
+{
+ return MetaDataBase::propertyComment( objects.first(), property );
+}
+
+void PropertyObject::mdSetFakeProperty( const QString &property, const QVariant &value )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setFakeProperty( o, property, value );
+}
+
+QVariant PropertyObject::mdFakeProperty( const QString &property )
+{
+ return MetaDataBase::fakeProperty( objects.first(), property );
+}
+
+void PropertyObject::mdSetCursor( const QCursor &c )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() ) {
+ if ( o->isWidgetType() )
+ MetaDataBase::setCursor( (QWidget*)o, c );
+ }
+}
+
+QCursor PropertyObject::mdCursor()
+{
+ return MetaDataBase::cursor( objects.first() );
+}
+
+void PropertyObject::mdSetPixmapKey( int pixmap, const QString &arg )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setPixmapKey( o, pixmap, arg );
+}
+
+QString PropertyObject::mdPixmapKey( int pixmap )
+{
+ return MetaDataBase::pixmapKey( objects.first(), pixmap );
+}
+
+void PropertyObject::mdSetExportMacro( const QString &macro )
+{
+ for ( QObject *o = objects.first(); o; o = objects.next() )
+ MetaDataBase::setExportMacro( o, macro );
+}
+
+QString PropertyObject::mdExportMacro()
+{
+ return MetaDataBase::exportMacro( objects.first() );
+}
diff --git a/kdevdesigner/designer/propertyobject.h b/kdevdesigner/designer/propertyobject.h
new file mode 100644
index 00000000..c8445239
--- /dev/null
+++ b/kdevdesigner/designer/propertyobject.h
@@ -0,0 +1,43 @@
+#ifndef PROPERTYOBJECT_H
+#define PROPERTYOBJECT_H
+
+#include <qobject.h>
+#include <qwidgetlist.h>
+#include <qcursor.h>
+
+class PropertyObject : public QObject
+{
+public:
+ QMetaObject *metaObject() const { return (QMetaObject*)mobj; }
+ const char *className() const { return "PropertyObject"; }
+ QObject* qObject() { return (QObject*)this; }
+private:
+ static QMetaObject *metaObj;
+
+public:
+ PropertyObject( const QWidgetList &objs );
+
+ bool setProperty( const char *name, const QVariant& value );
+ QVariant property( const char *name ) const;
+
+ void mdPropertyChanged( const QString &property, bool changed );
+ bool mdIsPropertyChanged( const QString &property );
+ void mdSetPropertyComment( const QString &property, const QString &comment );
+ QString mdPropertyComment( const QString &property );
+ void mdSetFakeProperty( const QString &property, const QVariant &value );
+ QVariant mdFakeProperty( const QString &property );
+ void mdSetCursor( const QCursor &c );
+ QCursor mdCursor();
+ void mdSetPixmapKey( int pixmap, const QString &arg );
+ QString mdPixmapKey( int pixmap );
+ void mdSetExportMacro( const QString &macro );
+ QString mdExportMacro();
+ QWidgetList widgetList() const { return objects; }
+
+private:
+ QWidgetList objects;
+ const QMetaObject *mobj;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/qcompletionedit.cpp b/kdevdesigner/designer/qcompletionedit.cpp
new file mode 100644
index 00000000..9c735577
--- /dev/null
+++ b/kdevdesigner/designer/qcompletionedit.cpp
@@ -0,0 +1,210 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "qcompletionedit.h"
+#include <qlistbox.h>
+#include <qsizegrip.h>
+#include <qapplication.h>
+#include <qvbox.h>
+
+QCompletionEdit::QCompletionEdit( QWidget *parent, const char *name )
+ : QLineEdit( parent, name ), aAdd( FALSE ), caseSensitive( FALSE )
+{
+ popup = new QVBox( 0, 0, WType_Popup );
+ popup->setFrameStyle( QFrame::Box | QFrame::Plain );
+ popup->setLineWidth( 1 );
+ popup->hide();
+
+ listbox = new QListBox( popup );
+ listbox->setFrameStyle( QFrame::NoFrame );
+ listbox->setLineWidth( 1 );
+ listbox->installEventFilter( this );
+ listbox->setHScrollBarMode( QScrollView::AlwaysOn );
+ listbox->setVScrollBarMode( QScrollView::AlwaysOn );
+ listbox->setCornerWidget( new QSizeGrip( listbox, "completion sizegrip" ) );
+ connect( this, SIGNAL( textChanged( const QString & ) ),
+ this, SLOT( textDidChange( const QString & ) ) );
+ popup->setFocusProxy( listbox );
+ installEventFilter( this );
+}
+
+bool QCompletionEdit::autoAdd() const
+{
+ return aAdd;
+}
+
+QStringList QCompletionEdit::completionList() const
+{
+ return compList;
+}
+
+void QCompletionEdit::setCompletionList( const QStringList &l )
+{
+ compList = l;
+}
+
+void QCompletionEdit::setAutoAdd( bool add )
+{
+ aAdd = add;
+}
+
+void QCompletionEdit::textDidChange( const QString &text )
+{
+ if ( text.isEmpty() ) {
+ popup->close();
+ return;
+ }
+ updateListBox();
+ placeListBox();
+}
+
+void QCompletionEdit::placeListBox()
+{
+ if ( listbox->count() == 0 ) {
+ popup->close();
+ return;
+ }
+
+ popup->resize( QMAX( listbox->sizeHint().width() + listbox->verticalScrollBar()->width() + 4, width() ),
+ listbox->sizeHint().height() + listbox->horizontalScrollBar()->height() + 4 );
+
+ QPoint p( mapToGlobal( QPoint( 0, 0 ) ) );
+ if ( p.y() + height() + popup->height() <= QApplication::desktop()->height() )
+ popup->move( p.x(), p.y() + height() );
+ else
+ popup->move( p.x(), p.y() - listbox->height() );
+ popup->show();
+ listbox->setCurrentItem( 0 );
+ listbox->setSelected( 0, TRUE );
+ setFocus();
+}
+
+void QCompletionEdit::updateListBox()
+{
+ listbox->clear();
+ if ( compList.isEmpty() )
+ return;
+ for ( QStringList::Iterator it = compList.begin(); it != compList.end(); ++it ) {
+ if ( caseSensitive && (*it).left( text().length() ) == text() ||
+ !caseSensitive && (*it).left( text().length() ).lower() == text().lower() )
+ listbox->insertItem( *it );
+ }
+}
+
+bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
+{
+ if ( o == popup || o == listbox || o == listbox->viewport() ) {
+ if ( e->type() == QEvent::KeyPress ) {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if ( ke->key() == Key_Enter || ke->key() == Key_Return || ke->key() == Key_Tab ) {
+ if ( ke->key() == Key_Tab && listbox->count() > 1 &&
+ listbox->currentItem() < (int)listbox->count() - 1 ) {
+ listbox->setCurrentItem( listbox->currentItem() + 1 );
+ return TRUE;
+ }
+ popup->close();
+ setFocus();
+ blockSignals( TRUE );
+ setText( listbox->currentText() );
+ blockSignals( FALSE );
+ emit chosen( text() );
+ return TRUE;
+ } else if ( ke->key() == Key_Left || ke->key() == Key_Right ||
+ ke->key() == Key_Up || ke->key() == Key_Down ||
+ ke->key() == Key_Home || ke->key() == Key_End ||
+ ke->key() == Key_Prior || ke->key() == Key_Next ) {
+ return FALSE;
+ } else if ( ke->key() == Key_Escape ) {
+ popup->close();
+ setFocus();
+ } else if ( ke->key() != Key_Shift && ke->key() != Key_Control &&
+ ke->key() != Key_Alt ) {
+ updateListBox();
+ if ( listbox->count() == 0 || text().length() == 0 ) {
+ popup->close();
+ setFocus();
+ }
+ QApplication::sendEvent( this, e );
+ return TRUE;
+ }
+ } else if ( e->type() == QEvent::MouseButtonDblClick ) {
+ popup->close();
+ setFocus();
+ blockSignals( TRUE );
+ setText( listbox->currentText() );
+ blockSignals( FALSE );
+ emit chosen( text() );
+ return TRUE;
+ }
+ } else if ( o == this ) {
+ if ( e->type() == QEvent::KeyPress ) {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if ( ke->key() == Key_Up ||
+ ke->key() == Key_Down ||
+ ke->key() == Key_Prior ||
+ ke->key() == Key_Next ||
+ ke->key() == Key_Return ||
+ ke->key() == Key_Enter ||
+ ke->key() == Key_Tab ||
+ ke->key() == Key_Escape ) {
+ QApplication::sendEvent( listbox, e );
+ return TRUE;
+ }
+ }
+ }
+ return QLineEdit::eventFilter( o, e );
+}
+
+void QCompletionEdit::addCompletionEntry( const QString &entry )
+{
+ if ( compList.find( entry ) == compList.end() ) {
+ compList << entry;
+ compList.sort();
+ }
+}
+
+void QCompletionEdit::removeCompletionEntry( const QString &entry )
+{
+ QStringList::Iterator it = compList.find( entry );
+ if ( it != compList.end() )
+ compList.remove( it );
+}
+
+void QCompletionEdit::setCaseSensitive( bool b )
+{
+ caseSensitive = b;
+}
+
+bool QCompletionEdit::isCaseSensitive() const
+{
+ return caseSensitive;
+}
+
+void QCompletionEdit::clear()
+{
+ QLineEdit::clear();
+ compList.clear();
+}
diff --git a/kdevdesigner/designer/qcompletionedit.h b/kdevdesigner/designer/qcompletionedit.h
new file mode 100644
index 00000000..426e7202
--- /dev/null
+++ b/kdevdesigner/designer/qcompletionedit.h
@@ -0,0 +1,79 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef QCOMPLETIONEDIT_H
+#define QCOMPLETIONEDIT_H
+
+#include <qlineedit.h>
+#include <qstringlist.h>
+
+class QListBox;
+class QVBox;
+
+class QCompletionEdit : public QLineEdit
+{
+ Q_OBJECT
+ Q_PROPERTY( bool autoAdd READ autoAdd WRITE setAutoAdd )
+ Q_PROPERTY( bool caseSensitive READ isCaseSensitive WRITE setCaseSensitive )
+
+public:
+ QCompletionEdit( QWidget *parent = 0, const char *name = 0 );
+
+ bool autoAdd() const;
+ QStringList completionList() const;
+ bool eventFilter( QObject *o, QEvent *e );
+ bool isCaseSensitive() const;
+
+public slots:
+ void setCompletionList( const QStringList &l );
+ void setAutoAdd( bool add );
+ void clear();
+ void addCompletionEntry( const QString &entry );
+ void removeCompletionEntry( const QString &entry );
+ void setCaseSensitive( bool b );
+
+signals:
+ void chosen( const QString &text );
+
+private slots:
+ void textDidChange( const QString &text );
+
+private:
+ void placeListBox();
+ void updateListBox();
+
+private:
+ bool aAdd;
+ QStringList compList;
+ QListBox *listbox;
+ QVBox *popup;
+ bool caseSensitive;
+
+};
+
+
+
+#endif
diff --git a/kdevdesigner/designer/replacedialog.ui b/kdevdesigner/designer/replacedialog.ui
new file mode 100644
index 00000000..41a211ea
--- /dev/null
+++ b/kdevdesigner/designer/replacedialog.ui
@@ -0,0 +1,318 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>ReplaceDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ReplaceDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>286</width>
+ <height>217</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Replace Text</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;eplace:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboReplace</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFind</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>comboFind</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboReplace</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonReplace</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Replace</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonReplaceAll</cstring>
+ </property>
+ <property name="text">
+ <string>Replace &amp;All</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkWords</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Whole words only</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkCase</cstring>
+ </property>
+ <property name="text">
+ <string>Case &amp;sensitive</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBegin</cstring>
+ </property>
+ <property name="text">
+ <string>Start at &amp;beginning</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="1">
+ <property name="name">
+ <cstring>ButtonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Direction</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioForward</cstring>
+ </property>
+ <property name="text">
+ <string>Forwar&amp;d</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioBackward</cstring>
+ </property>
+ <property name="text">
+ <string>Bac&amp;kward</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonReplace</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>doReplace()</slot>
+ </connection>
+ <connection>
+ <sender>buttonReplaceAll</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>doReplaceAll()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>comboFind</tabstop>
+ <tabstop>comboReplace</tabstop>
+ <tabstop>checkWords</tabstop>
+ <tabstop>checkCase</tabstop>
+ <tabstop>checkBegin</tabstop>
+ <tabstop>radioForward</tabstop>
+ <tabstop>radioBackward</tabstop>
+ <tabstop>buttonReplace</tabstop>
+ <tabstop>buttonReplaceAll</tabstop>
+ <tabstop>PushButton2</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">../interfaces/editorinterface.h</include>
+ <include location="global" impldecl="in implementation">qlineedit.h</include>
+ <include location="local" impldecl="in implementation">replacedialog.ui.h</include>
+</includes>
+<forwards>
+ <forward>struct EditorInterface;</forward>
+</forwards>
+<variables>
+ <variable>EditorInterface *editor;</variable>
+ <variable>QObject *formWindow;</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>doReplace()</slot>
+ <slot>doReplaceAll()</slot>
+ <slot>setEditor( EditorInterface * e, QObject * fw )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/replacedialog.ui.h b/kdevdesigner/designer/replacedialog.ui.h
new file mode 100644
index 00000000..9fa0f546
--- /dev/null
+++ b/kdevdesigner/designer/replacedialog.ui.h
@@ -0,0 +1,75 @@
+/**********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+
+void ReplaceDialog::init()
+{
+ editor = 0;
+ formWindow = 0;
+}
+
+void ReplaceDialog::destroy()
+{
+ if ( editor )
+ editor->release();
+ editor = 0;
+ formWindow = 0;
+}
+
+void ReplaceDialog::doReplace()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->replace( comboFind->currentText(), comboReplace->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked(), FALSE ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+}
+
+void ReplaceDialog::doReplaceAll()
+{
+ if ( !editor )
+ return;
+
+ if ( !editor->replace( comboFind->currentText(), comboReplace->currentText(), checkCase->isChecked(),
+ checkWords->isChecked(), radioForward->isChecked(), !checkBegin->isChecked(), TRUE ) )
+ checkBegin->setChecked( TRUE );
+ else
+ checkBegin->setChecked( FALSE );
+}
+
+void ReplaceDialog::setEditor( EditorInterface * e, QObject * fw )
+{
+ if ( fw != formWindow )
+ checkBegin->setChecked( TRUE );
+ formWindow = fw;
+ if ( editor )
+ editor->release();
+ editor = e;
+ editor->addRef();
+}
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp
new file mode 100644
index 00000000..ca983a42
--- /dev/null
+++ b/kdevdesigner/designer/resource.cpp
@@ -0,0 +1,3327 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "actiondnd.h"
+#include "command.h"
+#ifndef QT_NO_SQL
+#include "database.h"
+#endif
+#include "formfile.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "menubareditor.h"
+#include "metadatabase.h"
+#include "pixmapcollection.h"
+#include "popupmenueditor.h"
+#include "project.h"
+#include "resource.h"
+#include "widgetfactory.h"
+
+#include <domtool.h>
+#include <widgetdatabase.h>
+
+#include <qaccel.h>
+#include <qapplication.h>
+#include <qbuffer.h>
+#include <qcombobox.h>
+#include <qdatetime.h>
+#include <qdom.h>
+#include <qfeatures.h>
+#include <qfile.h>
+#include <qheader.h>
+#include <qiconview.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qlistview.h>
+#include <qmenudata.h>
+#include <qmessagebox.h>
+#include <qmetaobject.h>
+#include <qobject.h>
+#include <qobjectlist.h>
+#include <qtabbar.h>
+#ifndef QT_NO_TABLE
+#include <qtable.h>
+#include <qdatatable.h>
+#endif
+#include <qtabwidget.h>
+#include <qtabwidget.h>
+#include <qtextcodec.h>
+#include <qtextstream.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qwidget.h>
+#include <qwidgetstack.h>
+#include <qwizard.h>
+#include <qworkspace.h>
+#include <qworkspace.h>
+#include <qsplitter.h>
+#include <private/qucom_p.h>
+
+#include <kiconloader.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+
+#include "kdevdesigner_part.h"
+
+static QString makeIndent( int indent )
+{
+ QString s;
+ s.fill( ' ', indent * 4 );
+ return s;
+}
+
+static QString entitize( const QString &s, bool attribute = FALSE )
+{
+ QString s2 = s;
+ s2 = s2.replace( "&", "&amp;" );
+ s2 = s2.replace( ">", "&gt;" );
+ s2 = s2.replace( "<", "&lt;" );
+ if ( attribute ) {
+ s2 = s2.replace( "\"", "&quot;" );
+ s2 = s2.replace( "'", "&apos;" );
+ }
+ return s2;
+}
+
+#ifdef Q_WS_MACX
+static struct {
+ int key;
+ const char* name;
+} keyname[] = {
+ { Qt::Key_Space, QT_TRANSLATE_NOOP( "QAccel", "Space" ) },
+ { Qt::Key_Escape, QT_TRANSLATE_NOOP( "QAccel", "Esc" ) },
+ { Qt::Key_Tab, QT_TRANSLATE_NOOP( "QAccel", "Tab" ) },
+ { Qt::Key_Backtab, QT_TRANSLATE_NOOP( "QAccel", "Backtab" ) },
+ { Qt::Key_Backspace, QT_TRANSLATE_NOOP( "QAccel", "Backspace" ) },
+ { Qt::Key_Return, QT_TRANSLATE_NOOP( "QAccel", "Return" ) },
+ { Qt::Key_Enter, QT_TRANSLATE_NOOP( "QAccel", "Enter" ) },
+ { Qt::Key_Insert, QT_TRANSLATE_NOOP( "QAccel", "Ins" ) },
+ { Qt::Key_Delete, QT_TRANSLATE_NOOP( "QAccel", "Del" ) },
+ { Qt::Key_Pause, QT_TRANSLATE_NOOP( "QAccel", "Pause" ) },
+ { Qt::Key_Print, QT_TRANSLATE_NOOP( "QAccel", "Print" ) },
+ { Qt::Key_SysReq, QT_TRANSLATE_NOOP( "QAccel", "SysReq" ) },
+ { Qt::Key_Home, QT_TRANSLATE_NOOP( "QAccel", "Home" ) },
+ { Qt::Key_End, QT_TRANSLATE_NOOP( "QAccel", "End" ) },
+ { Qt::Key_Left, QT_TRANSLATE_NOOP( "QAccel", "Left" ) },
+ { Qt::Key_Up, QT_TRANSLATE_NOOP( "QAccel", "Up" ) },
+ { Qt::Key_Right, QT_TRANSLATE_NOOP( "QAccel", "Right" ) },
+ { Qt::Key_Down, QT_TRANSLATE_NOOP( "QAccel", "Down" ) },
+ { Qt::Key_Prior, QT_TRANSLATE_NOOP( "QAccel", "PgUp" ) },
+ { Qt::Key_Next, QT_TRANSLATE_NOOP( "QAccel", "PgDown" ) },
+ { Qt::Key_CapsLock, QT_TRANSLATE_NOOP( "QAccel", "CapsLock" ) },
+ { Qt::Key_NumLock, QT_TRANSLATE_NOOP( "QAccel", "NumLock" ) },
+ { Qt::Key_ScrollLock, QT_TRANSLATE_NOOP( "QAccel", "ScrollLock" ) },
+ { Qt::Key_Menu, QT_TRANSLATE_NOOP( "QAccel", "Menu" ) },
+ { Qt::Key_Help, QT_TRANSLATE_NOOP( "QAccel", "Help" ) },
+
+ // Multimedia keys
+ { Qt::Key_Back, QT_TRANSLATE_NOOP( "QAccel", "Back" ) },
+ { Qt::Key_Forward, QT_TRANSLATE_NOOP( "QAccel", "Forward" ) },
+ { Qt::Key_Stop, QT_TRANSLATE_NOOP( "QAccel", "Stop" ) },
+ { Qt::Key_Refresh, QT_TRANSLATE_NOOP( "QAccel", "Refresh" ) },
+ { Qt::Key_VolumeDown, QT_TRANSLATE_NOOP( "QAccel", "Volume Down" ) },
+ { Qt::Key_VolumeMute, QT_TRANSLATE_NOOP( "QAccel", "Volume Mute" ) },
+ { Qt::Key_VolumeUp, QT_TRANSLATE_NOOP( "QAccel", "Volume Up" ) },
+ { Qt::Key_BassBoost, QT_TRANSLATE_NOOP( "QAccel", "Bass Boost" ) },
+ { Qt::Key_BassUp, QT_TRANSLATE_NOOP( "QAccel", "Bass Up" ) },
+ { Qt::Key_BassDown, QT_TRANSLATE_NOOP( "QAccel", "Bass Down" ) },
+ { Qt::Key_TrebleUp, QT_TRANSLATE_NOOP( "QAccel", "Treble Up" ) },
+ { Qt::Key_TrebleDown, QT_TRANSLATE_NOOP( "QAccel", "Treble Down" ) },
+ { Qt::Key_MediaPlay, QT_TRANSLATE_NOOP( "QAccel", "Media Play" ) },
+ { Qt::Key_MediaStop, QT_TRANSLATE_NOOP( "QAccel", "Media Stop" ) },
+ { Qt::Key_MediaPrev, QT_TRANSLATE_NOOP( "QAccel", "Media Previous" ) },
+ { Qt::Key_MediaNext, QT_TRANSLATE_NOOP( "QAccel", "Media Next" ) },
+ { Qt::Key_MediaRecord, QT_TRANSLATE_NOOP( "QAccel", "Media Record" ) },
+ { Qt::Key_HomePage, QT_TRANSLATE_NOOP( "QAccel", "Home" ) },
+ { Qt::Key_Favorites, QT_TRANSLATE_NOOP( "QAccel", "Favorites" ) },
+ { Qt::Key_Search, QT_TRANSLATE_NOOP( "QAccel", "Search" ) },
+ { Qt::Key_Standby, QT_TRANSLATE_NOOP( "QAccel", "Standby" ) },
+ { Qt::Key_OpenUrl, QT_TRANSLATE_NOOP( "QAccel", "Open URL" ) },
+ { Qt::Key_LaunchMail, QT_TRANSLATE_NOOP( "QAccel", "Launch Mail" ) },
+ { Qt::Key_LaunchMedia, QT_TRANSLATE_NOOP( "QAccel", "Launch Media" ) },
+ { Qt::Key_Launch0, QT_TRANSLATE_NOOP( "QAccel", "Launch (0)" ) },
+ { Qt::Key_Launch1, QT_TRANSLATE_NOOP( "QAccel", "Launch (1)" ) },
+ { Qt::Key_Launch2, QT_TRANSLATE_NOOP( "QAccel", "Launch (2)" ) },
+ { Qt::Key_Launch3, QT_TRANSLATE_NOOP( "QAccel", "Launch (3)" ) },
+ { Qt::Key_Launch4, QT_TRANSLATE_NOOP( "QAccel", "Launch (4)" ) },
+ { Qt::Key_Launch5, QT_TRANSLATE_NOOP( "QAccel", "Launch (5)" ) },
+ { Qt::Key_Launch6, QT_TRANSLATE_NOOP( "QAccel", "Launch (6)" ) },
+ { Qt::Key_Launch7, QT_TRANSLATE_NOOP( "QAccel", "Launch (7)" ) },
+ { Qt::Key_Launch8, QT_TRANSLATE_NOOP( "QAccel", "Launch (8)" ) },
+ { Qt::Key_Launch9, QT_TRANSLATE_NOOP( "QAccel", "Launch (9)" ) },
+ { Qt::Key_LaunchA, QT_TRANSLATE_NOOP( "QAccel", "Launch (A)" ) },
+ { Qt::Key_LaunchB, QT_TRANSLATE_NOOP( "QAccel", "Launch (B)" ) },
+ { Qt::Key_LaunchC, QT_TRANSLATE_NOOP( "QAccel", "Launch (C)" ) },
+ { Qt::Key_LaunchD, QT_TRANSLATE_NOOP( "QAccel", "Launch (D)" ) },
+ { Qt::Key_LaunchE, QT_TRANSLATE_NOOP( "QAccel", "Launch (E)" ) },
+ { Qt::Key_LaunchF, QT_TRANSLATE_NOOP( "QAccel", "Launch (F)" ) },
+
+ // --------------------------------------------------------------
+ // More consistent namings
+ { Qt::Key_Print, QT_TRANSLATE_NOOP( "QAccel", "Print Screen" ) },
+ { Qt::Key_Prior, QT_TRANSLATE_NOOP( "QAccel", "Page Up" ) },
+ { Qt::Key_Next, QT_TRANSLATE_NOOP( "QAccel", "Page Down" ) },
+ { Qt::Key_CapsLock, QT_TRANSLATE_NOOP( "QAccel", "Caps Lock" ) },
+ { Qt::Key_NumLock, QT_TRANSLATE_NOOP( "QAccel", "Num Lock" ) },
+ { Qt::Key_NumLock, QT_TRANSLATE_NOOP( "QAccel", "Number Lock" ) },
+ { Qt::Key_ScrollLock, QT_TRANSLATE_NOOP( "QAccel", "Scroll Lock" ) },
+ { Qt::Key_Insert, QT_TRANSLATE_NOOP( "QAccel", "Insert" ) },
+ { Qt::Key_Delete, QT_TRANSLATE_NOOP( "QAccel", "Delete" ) },
+ { Qt::Key_Escape, QT_TRANSLATE_NOOP( "QAccel", "Escape" ) },
+ { Qt::Key_SysReq, QT_TRANSLATE_NOOP( "QAccel", "System Request" ) },
+
+ { 0, 0 }
+};
+#endif
+static QString platformNeutralKeySequence(const QKeySequence &ks)
+{
+#ifndef Q_WS_MACX
+ return QString(ks);
+#else
+ uint k;
+ QString str;
+ QString p;
+ for (k = 0; k < ks.count(); ++k) {
+ int keycombo = ks[k];
+ int basekey = keycombo & ~(Qt::SHIFT | Qt::CTRL | Qt::ALT | Qt::META);
+ if (keycombo & Qt::CTRL)
+ str += "Ctrl+";
+ if (keycombo & Qt::ALT)
+ str += "Alt+";
+ if (keycombo & Qt::META)
+ str += "Meta+";
+ if (keycombo & Qt::SHIFT)
+ str += "Shift+";
+
+ // begin copy and paste from QKeySequence :(
+ if (basekey & Qt::UNICODE_ACCEL) {
+ // Note: This character should NOT be upper()'ed, since
+ // the encoded string should indicate EXACTLY what the
+ // key represents! Hence a 'Ctrl+Shift+c' is posible to
+ // represent, but is clearly impossible to trigger...
+ p = QChar(basekey & 0xffff);
+ } else if ( basekey >= Qt::Key_F1 && basekey <= Qt::Key_F35 ) {
+ p = QAccel::tr( "F%1" ).arg(basekey - Qt::Key_F1 + 1);
+ } else if ( basekey > Qt::Key_Space && basekey <= Qt::Key_AsciiTilde ) {
+ p.sprintf( "%c", basekey );
+ } else {
+ int i = 0;
+ while (keyname[i].name) {
+ if (basekey == keyname[i].key) {
+ p = QAccel::tr(keyname[i].name);
+ break;
+ }
+ ++i;
+ }
+ // If we can't find the actual translatable keyname,
+ // fall back on the unicode representation of it...
+ // Or else characters like Key_aring may not get displayed
+ // ( Really depends on you locale )
+ if ( !keyname[i].name )
+ // Note: This character should NOT be upper()'ed, see above!
+ p = QChar(basekey & 0xffff);
+ }
+ // end copy...
+ str += p + ", ";
+ }
+ str.truncate(str.length() - 2);
+ return str;
+#endif
+}
+
+static QString mkBool( bool b )
+{
+ return b? "true" : "false";
+}
+
+/*!
+ \class Resource resource.h
+ \brief Class for saving/loading, etc. forms
+
+ This class is used for saving and loading forms, code generation,
+ transferring data of widgets over the clipboard, etc..
+
+*/
+
+
+Resource::Resource()
+{
+ mainwindow = 0;
+ formwindow = 0;
+ toplevel = 0;
+ copying = FALSE;
+ pasting = FALSE;
+ hadGeometry = FALSE;
+ langIface = 0;
+ hasFunctions = FALSE;
+}
+
+Resource::Resource( MainWindow* mw )
+ : mainwindow( mw )
+{
+ formwindow = 0;
+ toplevel = 0;
+ copying = FALSE;
+ pasting = FALSE;
+ hadGeometry = FALSE;
+ langIface = 0;
+ hasFunctions = FALSE;
+}
+
+Resource::~Resource()
+{
+ if ( langIface )
+ langIface->release();
+}
+
+void Resource::setWidget( FormWindow *w )
+{
+ formwindow = w;
+ toplevel = w;
+}
+
+QWidget *Resource::widget() const
+{
+ return toplevel;
+}
+
+bool Resource::load( FormFile *ff, Project *defProject )
+{
+ if ( !ff || ff->absFileName().isEmpty() )
+ return FALSE;
+ currFileName = ff->absFileName();
+ mainContainerSet = FALSE;
+
+ QFile f( ff->absFileName() );
+ f.open( IO_ReadOnly | IO_Translate );
+
+ bool b = load( ff, &f, defProject );
+ f.close();
+
+ return b;
+}
+
+#undef signals
+#undef slots
+
+bool Resource::load( FormFile *ff, QIODevice* dev, Project *defProject )
+{
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+ if ( !doc.setContent( dev, &errMsg, &errLine ) ) {
+ return FALSE;
+ }
+
+ DomTool::fixDocument( doc );
+
+ QWidget *p = mainwindow ? mainwindow->qWorkspace() : 0;
+ toplevel = formwindow = new FormWindow( ff, p, 0 );
+ if ( defProject )
+ formwindow->setProject( defProject );
+ else if ( MainWindow::self )
+ formwindow->setProject( MainWindow::self->currProject() );
+ if ( mainwindow )
+ formwindow->setMainWindow( mainwindow );
+ MetaDataBase::addEntry( formwindow );
+
+ if ( !langIface ) {
+ QString lang = "Qt Script";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+
+ uiFileVersion = doc.firstChild().toElement().attribute("version");
+ QDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ QDomElement forwards = e;
+ while ( forwards.tagName() != "forwards" && !forwards.isNull() )
+ forwards = forwards.nextSibling().toElement();
+
+ QDomElement includes = e;
+ while ( includes.tagName() != "includes" && !includes.isNull() )
+ includes = includes.nextSibling().toElement();
+
+ QDomElement variables = e;
+ while ( variables.tagName() != "variables" && !variables.isNull() )
+ variables = variables.nextSibling().toElement();
+
+ QDomElement signals = e;
+ while ( signals.tagName() != "signals" && !signals.isNull() )
+ signals = signals.nextSibling().toElement();
+
+ QDomElement slots = e;
+ while ( slots.tagName() != "slots" && !slots.isNull() )
+ slots = slots.nextSibling().toElement();
+
+ QDomElement functions = e;
+ while ( functions.tagName() != "functions" && !functions.isNull() )
+ functions = functions.nextSibling().toElement();
+
+ QDomElement connections = e;
+ while ( connections.tagName() != "connections" && !connections.isNull() )
+ connections = connections.nextSibling().toElement();
+
+ QDomElement imageCollection = e;
+ images.clear();
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ QDomElement customWidgets = e;
+ while ( customWidgets.tagName() != "customwidgets" && !customWidgets.isNull() )
+ customWidgets = customWidgets.nextSibling().toElement();
+
+ QDomElement tabOrder = e;
+ while ( tabOrder.tagName() != "tabstops" && !tabOrder.isNull() )
+ tabOrder = tabOrder.nextSibling().toElement();
+
+ QDomElement actions = e;
+ while ( actions.tagName() != "actions" && !actions.isNull() )
+ actions = actions.nextSibling().toElement();
+
+ QDomElement toolbars = e;
+ while ( toolbars.tagName() != "toolbars" && !toolbars.isNull() )
+ toolbars = toolbars.nextSibling().toElement();
+
+ QDomElement menubar = e;
+ while ( menubar.tagName() != "menubar" && !menubar.isNull() )
+ menubar = menubar.nextSibling().toElement();
+
+ QDomElement widget;
+ while ( !e.isNull() ) {
+ if ( e.tagName() == "widget" ) {
+ widgets.clear();
+ widget = e;
+ } else if ( e.tagName() == "include" ) { // compatibility with 2.x
+ MetaDataBase::Include inc;
+ inc.location = "global";
+ if ( e.attribute( "location" ) == "local" )
+ inc.location = "local";
+ inc.implDecl = "in declaration";
+ if ( e.attribute( "impldecl" ) == "in implementation" )
+ inc.implDecl = "in implementation";
+ inc.header = e.firstChild().toText().data();
+ if ( inc.header.right( 5 ) != ".ui.h" ) {
+ metaIncludes.append( inc );
+ } else {
+ if ( formwindow->formFile() )
+ formwindow->formFile()->setCodeFileState( FormFile::Ok );
+ }
+ } else if ( e.tagName() == "comment" ) {
+ metaInfo.comment = e.firstChild().toText().data();
+ } else if ( e.tagName() == "forward" ) { // compatibility with old betas
+ metaForwards << e.firstChild().toText().data();
+ } else if ( e.tagName() == "variable" ) { // compatibility with old betas
+ MetaDataBase::Variable v;
+ v.varName = e.firstChild().toText().data();
+ v.varAccess = "protected";
+ metaVariables << v;
+ } else if ( e.tagName() == "author" ) {
+ metaInfo.author = e.firstChild().toText().data();
+ } else if ( e.tagName() == "class" ) {
+ metaInfo.className = e.firstChild().toText().data();
+ } else if ( e.tagName() == "pixmapfunction" ) {
+ if ( formwindow ) {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( FALSE );
+ formwindow->setPixmapLoaderFunction( e.firstChild().toText().data() );
+ }
+ } else if ( e.tagName() == "pixmapinproject" ) {
+ if ( formwindow ) {
+ formwindow->setSavePixmapInline( FALSE );
+ formwindow->setSavePixmapInProject( TRUE );
+ }
+ } else if ( e.tagName() == "exportmacro" ) {
+ exportMacro = e.firstChild().toText().data();
+ } else if ( e.tagName() == "layoutdefaults" ) {
+ formwindow->setLayoutDefaultSpacing( e.attribute( "spacing", QString::number( formwindow->layoutDefaultSpacing() ) ).toInt() );
+ formwindow->setLayoutDefaultMargin( e.attribute( "margin", QString::number( formwindow->layoutDefaultMargin() ) ).toInt() );
+ } else if ( e.tagName() == "layoutfunctions" ) {
+ formwindow->setSpacingFunction( e.attribute( "spacing" ) );
+ formwindow->setMarginFunction( e.attribute( "margin" ) );
+ if ( !formwindow->marginFunction().isEmpty() || !formwindow->spacingFunction().isEmpty() )
+ formwindow->hasLayoutFunctions( TRUE );
+ }
+
+ e = e.nextSibling().toElement();
+ }
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+ if ( !customWidgets.isNull() )
+ loadCustomWidgets( customWidgets, this );
+
+#if defined (QT_NON_COMMERCIAL)
+ bool previewMode = MainWindow::self ? MainWindow::self->isPreviewing() : FALSE;
+ QWidget *w = (QWidget*)createObject( widget, !previewMode ? (QWidget*)formwindow : MainWindow::self );
+ if ( !w )
+ return FALSE;
+ if ( previewMode )
+ w->reparent( MainWindow::self, Qt::WType_TopLevel, w->pos(), TRUE );
+#else
+ if ( !createObject( widget, formwindow) )
+ return FALSE;
+#endif
+
+ if ( !forwards.isNull() ) {
+ for ( QDomElement n = forwards.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "forward" )
+ metaForwards << n.firstChild().toText().data();
+ }
+
+ if ( !includes.isNull() ) {
+ for ( QDomElement n = includes.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "include" ) {
+ if ( n.tagName() == "include" ) {
+ MetaDataBase::Include inc;
+ inc.location = "global";
+ if ( n.attribute( "location" ) == "local" )
+ inc.location = "local";
+ inc.implDecl = "in declaration";
+ if ( n.attribute( "impldecl" ) == "in implementation" )
+ inc.implDecl = "in implementation";
+ inc.header = n.firstChild().toText().data();
+ if ( inc.header.right( 5 ) != ".ui.h" ) {
+ metaIncludes.append( inc );
+ } else {
+ if ( formwindow->formFile() )
+ formwindow->formFile()->setCodeFileState( FormFile::Ok );
+ }
+ }
+ }
+ }
+
+ if ( !variables.isNull() ) {
+ for ( QDomElement n = variables.firstChild().toElement(); !n.isNull();
+ n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "variable" ) {
+ MetaDataBase::Variable v;
+ v.varName = n.firstChild().toText().data();
+ v.varAccess = n.attribute( "access", "protected" );
+ if ( v.varAccess.isEmpty() )
+ v.varAccess = "protected";
+ metaVariables << v;
+ }
+ }
+ }
+ if ( !signals.isNull() ) {
+ for ( QDomElement n = signals.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "signal" )
+ metaSignals << n.firstChild().toText().data();
+ }
+ if ( !slots.isNull() ) {
+ for ( QDomElement n = slots.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ if ( n.tagName() == "slot" ) {
+ MetaDataBase::Function function;
+ function.specifier = n.attribute( "specifier", "virtual" );
+ if ( function.specifier.isEmpty() )
+ function.specifier = "virtual";
+ function.access = n.attribute( "access", "public" );
+ if ( function.access.isEmpty() )
+ function.access = "public";
+ function.language = n.attribute( "language", "C++" );
+ function.returnType = n.attribute( "returnType", "void" );
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ function.type = "slot";
+ function.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, function.function, function.specifier,
+ function.access, "slot", function.language, function.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function,
+ function.specifier, function.access,
+ "slot", function.language,
+ function.returnType );
+ }
+ }
+
+ if ( !functions.isNull() ) {
+ for ( QDomElement n = functions.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "function" ) {
+ MetaDataBase::Function function;
+ function.specifier = n.attribute( "specifier", "virtual" );
+ if ( function.specifier.isEmpty() )
+ function.specifier = "virtual";
+ function.access = n.attribute( "access", "public" );
+ if ( function.access.isEmpty() )
+ function.access = "public";
+ function.type = n.attribute( "type", "function" );
+ function.type = "function";
+ function.language = n.attribute( "language", "C++" );
+ function.returnType = n.attribute( "returnType", "void" );
+ if ( function.returnType.isEmpty() )
+ function.returnType = "void";
+ function.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, function.function, function.specifier,
+ function.access, function.type, function.language,
+ function.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function,
+ function.specifier, function.access,
+ function.type, function.language, function.returnType );
+ }
+ }
+ }
+
+ if ( !actions.isNull() )
+ loadActions( actions );
+ if ( !toolbars.isNull() )
+ loadToolBars( toolbars );
+ if ( !menubar.isNull() )
+ loadMenuBar( menubar );
+
+ if ( !connections.isNull() )
+ loadConnections( connections );
+
+ if ( !tabOrder.isNull() )
+ loadTabOrder( tabOrder );
+
+ if ( formwindow ) {
+ MetaDataBase::setIncludes( formwindow, metaIncludes );
+ MetaDataBase::setForwards( formwindow, metaForwards );
+ MetaDataBase::setVariables( formwindow, metaVariables );
+ MetaDataBase::setSignalList( formwindow, metaSignals );
+ metaInfo.classNameChanged = metaInfo.className != QString( formwindow->name() );
+ MetaDataBase::setMetaInfo( formwindow, metaInfo );
+ MetaDataBase::setExportMacro( formwindow->mainContainer(), exportMacro );
+ }
+
+ loadExtraSource( formwindow->formFile(), currFileName, langIface, hasFunctions );
+
+ if ( mainwindow && formwindow )
+ mainwindow->insertFormWindow( formwindow );
+
+ if ( formwindow ) {
+ formwindow->killAccels( formwindow );
+ if ( formwindow->layout() )
+ formwindow->layout()->activate();
+ if ( hadGeometry )
+ formwindow->resize( formwindow->size().expandedTo( formwindow->minimumSize().
+ expandedTo( formwindow->minimumSizeHint() ) ) );
+ else
+ formwindow->resize( formwindow->size().expandedTo( formwindow->sizeHint() ) );
+ }
+
+ return TRUE;
+}
+
+static bool saveCode( const QString &filename, const QString &code )
+{
+ QFile f( filename );
+ if ( f.open(IO_WriteOnly | IO_Translate) ) {
+ QTextStream ts( &f );
+ ts << code;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+bool Resource::save( const QString& filename, bool formCodeOnly )
+{
+ if ( !formwindow || filename.isEmpty() )
+ return FALSE;
+ if (!langIface) {
+ QString lang = "Qt Script";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+ if ( formCodeOnly && langIface ) {
+ if ( saveFormCode(formwindow->formFile(), langIface) )
+ return TRUE;
+ bool breakout = FALSE;
+ FormFile *ff = formwindow->formFile();
+ QString codeFile = ff->project()->makeAbsolute( ff->codeFile() );
+ QString filter = langIface->fileFilterList().join("\n");
+ while ( !breakout ) {
+ QString fn = KFileDialog::getSaveFileName( codeFile, filter );
+ breakout = fn.isEmpty();
+ if ( !breakout ) {
+ if ( saveCode(fn, ff->code()) )
+ return TRUE;
+ }
+ }
+ }
+ currFileName = filename;
+
+ QFile f( filename );
+ if ( !f.open( IO_WriteOnly | IO_Translate ) )
+ return FALSE;
+ bool b = save( &f );
+ f.close();
+ return b;
+}
+
+bool Resource::save( QIODevice* dev )
+{
+ if ( !formwindow )
+ return FALSE;
+
+ if ( !langIface ) {
+ QString lang = "C++";
+ if ( mainwindow )
+ lang = mainwindow->currProject()->language();
+ langIface = MetaDataBase::languageInterface( lang );
+ if ( langIface )
+ langIface->addRef();
+ }
+
+ QTextStream ts( dev );
+ ts.setCodec( QTextCodec::codecForName( "UTF-8" ) );
+
+ ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl;
+ saveMetaInfoBefore( ts, 0 );
+ saveObject( formwindow->mainContainer(), 0, ts, 0 );
+ if ( ::qt_cast<QMainWindow*>(formwindow->mainContainer()) ) {
+ saveMenuBar( (QMainWindow*)formwindow->mainContainer(), ts, 0 );
+ saveToolBars( (QMainWindow*)formwindow->mainContainer(), ts, 0 );
+ }
+ if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() )
+ saveCustomWidgets( ts, 0 );
+ if ( ::qt_cast<QMainWindow*>(formwindow->mainContainer()) )
+ saveActions( formwindow->actionList(), ts, 0 );
+ if ( !images.isEmpty() )
+ saveImageCollection( ts, 0 );
+ if ( !MetaDataBase::connections( formwindow ).isEmpty() ||
+ !MetaDataBase::slotList( formwindow ).isEmpty() )
+ saveConnections( ts, 0 );
+ saveTabOrder( ts, 0 );
+ saveMetaInfoAfter( ts, 0 );
+ saveIncludeHints( ts, 0 );
+ ts << "</UI>" << endl;
+ bool ok = saveFormCode( formwindow->formFile(), langIface );
+ images.clear();
+
+ return ok;
+}
+
+QString Resource::copy()
+{
+ if ( !formwindow )
+ return QString::null;
+
+ copying = TRUE;
+ QString s;
+ QTextOStream ts( &s );
+
+ ts << "<!DOCTYPE UI-SELECTION><UI-SELECTION>" << endl;
+ QWidgetList widgets = formwindow->selectedWidgets();
+ QWidgetList tmp( widgets );
+ for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
+ QWidget *p = w->parentWidget();
+ bool save = TRUE;
+ while ( p ) {
+ if ( tmp.findRef( p ) != -1 ) {
+ save = FALSE;
+ break;
+ }
+ p = p->parentWidget();
+ }
+ if ( save )
+ saveObject( w, 0, ts, 0 );
+ }
+ if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() )
+ saveCustomWidgets( ts, 0 );
+ if ( !images.isEmpty() )
+ saveImageCollection( ts, 0 );
+ ts << "</UI-SELECTION>" << endl;
+
+ return s;
+}
+
+
+void Resource::paste( const QString &cb, QWidget *parent )
+{
+ if ( !formwindow )
+ return;
+ mainContainerSet = TRUE;
+
+ pasting = TRUE;
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+ doc.setContent( cb, &errMsg, &errLine );
+
+ QDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement();
+
+ QDomElement imageCollection = firstWidget;
+ images.clear();
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ QDomElement customWidgets = firstWidget;
+ while ( customWidgets.tagName() != "customwidgets" && !customWidgets.isNull() )
+ customWidgets = customWidgets.nextSibling().toElement();
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+ if ( !customWidgets.isNull() )
+ loadCustomWidgets( customWidgets, this );
+
+ QWidgetList widgets;
+ formwindow->clearSelection( FALSE );
+ formwindow->setPropertyShowingBlocked( TRUE );
+ formwindow->clearSelection( FALSE );
+ while ( !firstWidget.isNull() ) {
+ if ( firstWidget.tagName() == "widget" ) {
+ QWidget *w = (QWidget*)createObject( firstWidget, parent, 0 );
+ if ( !w )
+ continue;
+ widgets.append( w );
+ int x = w->x() + formwindow->grid().x();
+ int y = w->y() + formwindow->grid().y();
+ if ( w->x() + w->width() > parent->width() )
+ x = QMAX( 0, parent->width() - w->width() );
+ if ( w->y() + w->height() > parent->height() )
+ y = QMAX( 0, parent->height() - w->height() );
+ if ( x != w->x() || y != w->y() )
+ w->move( x, y );
+ formwindow->selectWidget( w );
+ } else if ( firstWidget.tagName() == "spacer" ) {
+ QWidget *w = createSpacer( firstWidget, parent, 0, firstWidget.tagName() == "vspacer" ? Qt::Vertical : Qt::Horizontal );
+ if ( !w )
+ continue;
+ widgets.append( w );
+ int x = w->x() + formwindow->grid().x();
+ int y = w->y() + formwindow->grid().y();
+ if ( w->x() + w->width() > parent->width() )
+ x = QMAX( 0, parent->width() - w->width() );
+ if ( w->y() + w->height() > parent->height() )
+ y = QMAX( 0, parent->height() - w->height() );
+ if ( x != w->x() || y != w->y() )
+ w->move( x, y );
+ formwindow->selectWidget( w );
+ }
+ firstWidget = firstWidget.nextSibling().toElement();
+ }
+ formwindow->setPropertyShowingBlocked( FALSE );
+ formwindow->emitShowProperties();
+
+ PasteCommand *cmd = new PasteCommand( i18n( "Paste" ), formwindow, widgets );
+ formwindow->commandHistory()->addCommand( cmd );
+}
+
+void Resource::saveObject( QObject *obj, QDesignerGridLayout* grid, QTextStream &ts, int indent )
+{
+ if ( obj && obj->isWidgetType() && ( (QWidget*)obj )->isHidden() )
+ return;
+ QString closeTag;
+ const char* className = WidgetFactory::classNameOf( obj );
+ int classID = WidgetDatabase::idFromClassName( className );
+ bool isPlugin = WidgetDatabase::isCustomPluginWidget( classID );
+ if ( obj->isWidgetType() ) {
+ if ( obj->isA("CustomWidget") || isPlugin ) {
+ usedCustomWidgets << QString( className );
+ includeHints << WidgetDatabase::includeFile( classID );
+ }
+
+ if ( obj != formwindow && !formwindow->widgets()->find( (QWidget*)obj ) )
+ return; // we don't know anything about this thing
+
+ QString attributes;
+ if ( grid ) {
+ QDesignerGridLayout::Item item = grid->items[ (QWidget*)obj ];
+ attributes += QString(" row=\"") + QString::number(item.row) + "\"";
+ attributes += QString(" column=\"") + QString::number(item.column) + "\"";
+ if ( item.rowspan * item.colspan != 1 ) {
+ attributes += QString(" rowspan=\"") + QString::number(item.rowspan) + "\"";
+ attributes += QString(" colspan=\"") + QString::number(item.colspan) + "\"";
+ }
+ }
+
+ if ( qstrcmp( className, "Spacer" ) == 0 ) {
+ closeTag = makeIndent( indent ) + "</spacer>\n";
+ ts << makeIndent( indent ) << "<spacer" << attributes << ">" << endl;
+ ++indent;
+ } else {
+ closeTag = makeIndent( indent ) + "</widget>\n";
+ ts << makeIndent( indent ) << "<widget class=\"" << className << "\"" << attributes << ">" << endl;
+ ++indent;
+ }
+ if ( WidgetFactory::hasItems(classID, obj) )
+ saveItems( obj, ts, indent );
+ saveObjectProperties( obj, ts, indent );
+ } else {
+ // test for other objects we created. Nothing so far.
+ return;
+ }
+
+ QDesignerWidgetStack* ws = 0;
+
+ if ( ::qt_cast<QTabWidget*>(obj) ) {
+ QTabWidget* tw = (QTabWidget*) obj;
+ QObjectList* tmpl = tw->queryList( "QWidgetStack" );
+ QWidgetStack *ws = (QWidgetStack*)tmpl->first();
+ QTabBar *tb = ( (QDesignerTabWidget*)obj )->tabBar();
+ for ( int i = 0; i < tb->count(); ++i ) {
+ QTab *t = tb->tabAt( i );
+ if ( !t )
+ continue;
+ QWidget *w = ws->widget( t->identifier() );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"QWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+
+ ts << makeIndent( indent ) << "<attribute name=\"title\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( t->text() ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ delete tmpl;
+ } else if ( (ws = ::qt_cast<QDesignerWidgetStack*>(obj)) != 0 ) {
+ for ( int i = 0; i < ws->count(); ++i ) {
+ QWidget *w = ws->page( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"QWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"id\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<number>" << QString::number(i) << "</number>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::qt_cast<QToolBox*>(obj) ) {
+ QToolBox* tb = (QToolBox*)obj;
+ for ( int i = 0; i < tb->count(); ++i ) {
+ QWidget *w = tb->item( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"QWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<property name=\"backgroundMode\">" << endl;
+ indent++;
+ saveEnumProperty( w, "backgroundMode", QVariant::Invalid, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( tb->itemLabel( tb->indexOf(w) ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::qt_cast<QWizard*>(obj) ) {
+ QWizard* wiz = (QWizard*)obj;
+ for ( int i = 0; i < wiz->pageCount(); ++i ) {
+ QWidget *w = wiz->page( i );
+ if ( !w )
+ continue;
+ if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\"QWidget\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() ) << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+
+ ts << makeIndent( indent ) << "<attribute name=\"title\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( wiz->title( w ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ } else if ( ::qt_cast<QMainWindow*>(obj) ) {
+ saveChildrenOf( ( (QMainWindow*)obj )->centralWidget(), ts, indent );
+ } else {
+ bool saved = FALSE;
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ if ( isPlugin ) {
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( className, &iface );
+ if ( iface ) {
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ if ( iface2->supportsPages( className ) ) {
+ QWidgetList containers = iface2->pages( className, (QWidget*)obj );
+ if ( !containers.isEmpty() ) {
+ saved = TRUE;
+ int i = 0;
+ for ( QWidget *w = containers.first(); w; w = containers.next(), ++i ) {
+ if ( WidgetDatabase::
+ idFromClassName( WidgetFactory::classNameOf( w ) ) == -1 )
+ continue; // we don't know this widget
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w )
+ << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>"
+ << entitize( iface2->pageLabel( className, (QWidget*)obj, i ) )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</attribute>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ }
+ } else {
+ saved = TRUE;
+ QWidget *w = iface2->containerOfWidget( className, (QWidget*)obj );
+ if ( obj != w ) {
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w )
+ << "\">" << endl;
+ ++indent;
+ ts << makeIndent( indent ) << "<property name=\"name\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<cstring>" << entitize( w->name() )
+ << "</cstring>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ saveChildrenOf( w, ts, indent );
+ --indent;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ }
+ // Create a custom widget and then store it in the database
+ // so we can save the custom widgets.
+ MetaDataBase::CustomWidget *cw = new MetaDataBase::CustomWidget;
+ cw->className = className;
+ cw->includeFile = WidgetDatabase::includeFile( classID );
+ QStrList lst = w->metaObject()->signalNames( TRUE );
+ for ( QPtrListIterator<char> it(lst); it.current(); ++it )
+ cw->lstSignals.append(it.current());
+
+ int i;
+ int total = w->metaObject()->numProperties( TRUE );
+ for ( i = 0; i < total; i++ ) {
+ const QMetaProperty *p = w->metaObject()->property( i, TRUE );
+ if ( p->designable(w) ) {
+ MetaDataBase::Property prop;
+ prop.property = p->name();
+ QString pType = p->type();
+ // *sigh* designer types are not normal types
+ // Handle most cases, the ones it misses are
+ // probably too difficult to deal with anyway...
+ if ( pType.startsWith("Q") ) {
+ pType = pType.right( pType.length() - 1 );
+ } else {
+ pType[0] = pType[0].upper();
+ }
+ prop.type = pType;
+ cw->lstProperties.append( prop );
+ }
+ }
+
+ total = w->metaObject()->numSlots( TRUE );
+ for ( i = 0; i < total; i++ ) {
+ const QMetaData *md = w->metaObject()->slot( i, TRUE );
+ MetaDataBase::Function funky;
+ // Find out if we have a return type.
+ if ( md->method->count > 0 ) {
+ const QUParameter p = md->method->parameters[0];
+ if ( p.inOut == QUParameter::InOut )
+ funky.returnType = p.type->desc();
+ }
+
+ funky.function = md->name;
+ funky.language = "C++";
+ switch ( md->access ) {
+ case QMetaData::Public:
+ funky.access = "public";
+ break;
+ case QMetaData::Protected:
+ funky.access = "protected";
+ break;
+ case QMetaData::Private:
+ funky.access = "private";
+ break;
+ }
+ cw->lstSlots.append( funky );
+ }
+ MetaDataBase::addCustomWidget( cw );
+ }
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ if ( !saved )
+ saveChildrenOf( obj, ts, indent );
+ }
+
+ indent--;
+ ts << closeTag;
+}
+
+void Resource::saveItems( QObject *obj, QTextStream &ts, int indent )
+{
+ if ( ::qt_cast<QListBox*>(obj) || ::qt_cast<QComboBox*>(obj) ) {
+ QListBox *lb = 0;
+ if ( ::qt_cast<QListBox*>(obj) )
+ lb = (QListBox*)obj;
+ else
+ lb = ( (QComboBox*)obj )->listBox();
+
+ QListBoxItem *i = lb->firstItem();
+ for ( ; i; i = i->next() ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+ QStringList text;
+ text << i->text();
+ QPtrList<QPixmap> pixmaps;
+ if ( i->pixmap() )
+ pixmaps.append( i->pixmap() );
+ saveItem( text, pixmaps, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ } else if ( ::qt_cast<QIconView*>(obj) ) {
+ QIconView *iv = (QIconView*)obj;
+
+ QIconViewItem *i = iv->firstItem();
+ for ( ; i; i = i->nextItem() ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+ QStringList text;
+ text << i->text();
+ QPtrList<QPixmap> pixmaps;
+ if ( i->pixmap() )
+ pixmaps.append( i->pixmap() );
+ saveItem( text, pixmaps, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ } else if ( ::qt_cast<QListView*>(obj) ) {
+ QListView *lv = (QListView*)obj;
+ int i;
+ for ( i = 0; i < lv->header()->count(); ++i ) {
+ ts << makeIndent( indent ) << "<column>" << endl;
+ indent++;
+ QStringList l;
+ l << lv->header()->label( i );
+ QPtrList<QPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( lv->header()->iconSet( i ) )
+ pix.append( new QPixmap( lv->header()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ ts << makeIndent( indent ) << "<property name=\"clickable\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<bool>" << mkBool( lv->header()->isClickEnabled( i ) )<< "</bool>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ ts << makeIndent( indent ) << "<property name=\"resizable\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<bool>" << mkBool( lv->header()->isResizeEnabled( i ) ) << "</bool>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</column>" << endl;
+ }
+ saveItem( lv->firstChild(), ts, indent - 1 );
+ }
+#if !defined (QT_NO_TABLE)
+ else if ( ::qt_cast<QTable*>(obj) ) {
+ QTable *table = (QTable*)obj;
+ int i;
+ QMap<QString, QString> columnFields = MetaDataBase::columnFields( table );
+# ifndef QT_NO_SQL
+ bool isDataTable = ::qt_cast<QDataTable*>(table);
+# else
+ bool isDataTable = false;
+# endif
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ if ( !table->horizontalHeader()->label( i ).isNull() &&
+ table->horizontalHeader()->label( i ).toInt() != i + 1 ||
+ table->horizontalHeader()->iconSet( i ) ||
+ isDataTable ) {
+ ts << makeIndent( indent ) << "<column>" << endl;
+ indent++;
+ QStringList l;
+ l << table->horizontalHeader()->label( i );
+ QPtrList<QPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ pix.append( new QPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ if ( isDataTable && !columnFields.isEmpty() ) {
+ ts << makeIndent( indent ) << "<property name=\"field\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( *columnFields.find( l[ 0 ] ) ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</column>" << endl;
+ }
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ if ( !table->verticalHeader()->label( i ).isNull() &&
+ table->verticalHeader()->label( i ).toInt() != i + 1 ||
+ table->verticalHeader()->iconSet( i ) ) {
+ ts << makeIndent( indent ) << "<row>" << endl;
+ indent++;
+ QStringList l;
+ l << table->verticalHeader()->label( i );
+ QPtrList<QPixmap> pix;
+ pix.setAutoDelete( TRUE );
+ if ( table->verticalHeader()->iconSet( i ) )
+ pix.append( new QPixmap( table->verticalHeader()->iconSet( i )->pixmap() ) );
+ saveItem( l, pix, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</row>" << endl;
+ }
+ }
+ }
+#endif
+}
+
+void Resource::saveItem( QListViewItem *i, QTextStream &ts, int indent )
+{
+ QListView *lv = i->listView();
+ while ( i ) {
+ ts << makeIndent( indent ) << "<item>" << endl;
+ indent++;
+
+ QPtrList<QPixmap> pixmaps;
+ QStringList textes;
+ for ( int c = 0; c < lv->columns(); ++c ) {
+ pixmaps.append( i->pixmap( c ) );
+ textes << i->text( c );
+ }
+ saveItem( textes, pixmaps, ts, indent );
+
+ if ( i->firstChild() )
+ saveItem( i->firstChild(), ts, indent );
+
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ i = i->nextSibling();
+ }
+}
+
+void Resource::savePixmap( const QPixmap &p, QTextStream &ts, int indent, const QString &tagname )
+{
+ if ( p.isNull() ) {
+ ts << makeIndent( indent ) << "<" << tagname << "></" << tagname << ">" << endl;
+ return;
+ }
+
+ if ( formwindow && formwindow->savePixmapInline() )
+ ts << makeIndent( indent ) << "<" << tagname << ">" << saveInCollection( p ) << "</" << tagname << ">" << endl;
+ else if ( formwindow && formwindow->savePixmapInProject() )
+ ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( formwindow, p.serialNumber() )
+ << "</" << tagname << ">" << endl;
+ else
+ ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( formwindow, p.serialNumber() )
+ << "</" << tagname << ">" << endl;
+}
+
+QPixmap Resource::loadPixmap( const QDomElement &e, const QString &/*tagname*/ )
+{
+ QString arg = e.firstChild().toText().data();
+
+ if ( formwindow && formwindow->savePixmapInline() ) {
+ QImage img = loadFromCollection( arg );
+ QPixmap pix;
+ pix.convertFromImage( img );
+ MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg );
+ return pix;
+ } else if ( formwindow && formwindow->savePixmapInProject() ) {
+ QPixmap pix;
+ if ( mainwindow && mainwindow->currProject() ) {
+ pix = mainwindow->currProject()->pixmapCollection()->pixmap( arg );
+ } else {
+ pix = BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() );
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( pix.convertToImage() );
+ }
+
+ MetaDataBase::setPixmapKey( formwindow, pix.serialNumber(), arg );
+ return pix;
+ }
+ QPixmap pix = BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() );
+ // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that
+ pix.convertFromImage( pix.convertToImage() );
+ MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg );
+ return pix;
+}
+
+void Resource::saveItem( const QStringList &text,
+ const QPtrList<QPixmap> &pixmaps, QTextStream &ts,
+ int indent )
+{
+ QStringList::ConstIterator it = text.begin();
+ for ( ; it != text.end(); ++it ) {
+ ts << makeIndent( indent ) << "<property name=\"text\">" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<string>" << entitize( *it ) << "</string>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+
+ for ( int i = 0; i < (int)pixmaps.count(); ++i ) {
+ QPixmap *p = ( (QPtrList<QPixmap>)pixmaps ).at( i );
+ ts << makeIndent( indent ) << "<property name=\"pixmap\">" << endl;
+ indent++;
+ if ( p )
+ savePixmap( *p, ts, indent );
+ else
+ savePixmap( QPixmap(), ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+}
+
+void Resource::saveChildrenOf( QObject* obj, QTextStream &ts, int indent )
+{
+ const QObjectList *l = obj->children();
+ if ( !l )
+ return; // no children to save
+
+ QString closeTag;
+ // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer
+ QLayout *layout = 0;
+ QDesignerGridLayout* grid = 0;
+ if ( !::qt_cast<QSplitter*>(obj) &&
+ WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) &&
+ obj->isWidgetType() &&
+ WidgetFactory::layoutType( (QWidget*)obj, layout ) != WidgetFactory::NoLayout ) {
+ WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (QWidget*)obj, layout );
+ switch ( lay ) {
+ case WidgetFactory::HBox:
+ closeTag = makeIndent( indent ) + "</hbox>";
+ ts << makeIndent( indent ) << "<hbox>" << endl;
+ ++indent;
+ break;
+ case WidgetFactory::VBox:
+ closeTag = makeIndent( indent ) + "</vbox>";
+ ts << makeIndent( indent ) << "<vbox>" << endl;
+ ++indent;
+ break;
+ case WidgetFactory::Grid:
+ closeTag = makeIndent( indent ) + "</grid>";
+ ts << makeIndent( indent ) << "<grid>" << endl;
+ ++indent;
+ grid = (QDesignerGridLayout*) layout;
+ break;
+ default:
+ break;
+ }
+
+ // save properties of layout
+ if ( lay != WidgetFactory::NoLayout )
+ saveObjectProperties( layout, ts, indent );
+
+ }
+
+ QObject *o = 0;
+ for ( QPtrListIterator<QObject> it ( *l ); ( o = it.current() ); ++it )
+ if ( !QString( o->name() ).startsWith( "qt_dead_widget_" ) )
+ saveObject( o, grid, ts, indent );
+ if ( !closeTag.isEmpty() ) {
+ indent--;
+ ts << closeTag << endl;
+ }
+}
+
+void Resource::saveObjectProperties( QObject *w, QTextStream &ts, int indent )
+{
+ QStringList saved;
+ QStringList changed;
+ changed = MetaDataBase::changedProperties( w );
+ if ( w->isWidgetType() ) {
+ if ( ::qt_cast<Spacer*>(w) ) {
+ if ( !changed.contains( "sizeHint" ) )
+ changed << "sizeHint";
+ if ( !changed.contains( "geometry" ) )
+ changed << "geometry";
+ } else {
+ QToolButton *tb = ::qt_cast<QToolButton*>(w);
+ if ( tb && !tb->iconSet().isNull() ) {
+ changed << "iconSet";
+ }
+ }
+ } else if ( ::qt_cast<QLayout*>(w) ) {
+ if ( MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) ) > -1 )
+ changed << "spacing";
+ if ( MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) ) > -1 )
+ changed << "margin";
+ if ( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) ) != "Auto"
+ && !MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) ).isEmpty() )
+ changed << "resizeMode";
+ }
+
+ if ( w == formwindow->mainContainer() ) {
+ if ( changed.findIndex( "geometry" ) == -1 )
+ changed << "geometry";
+ if ( changed.findIndex( "caption" ) == -1 )
+ changed << "caption";
+ }
+
+ if ( changed.isEmpty() )
+ return;
+
+ bool inLayout = w != formwindow->mainContainer() && !copying && w->isWidgetType() && ( (QWidget*)w )->parentWidget() &&
+ WidgetFactory::layoutType( ( (QWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout;
+
+ QStrList lst = w->metaObject()->propertyNames( !::qt_cast<Spacer*>(w) );
+ for ( QPtrListIterator<char> it( lst ); it.current(); ++it ) {
+ if ( changed.find( QString::fromLatin1( it.current() ) ) == changed.end() )
+ continue;
+ if ( saved.find( QString::fromLatin1( it.current() ) ) != saved.end() )
+ continue;
+ saved << QString::fromLatin1( it.current() );
+ const QMetaProperty* p = w->metaObject()->
+ property( w->metaObject()->findProperty( it.current(), TRUE ), TRUE );
+ if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) )
+ continue;
+ if ( ::qt_cast<QLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 &&
+ ( !( (QLabel*)w )->pixmap() || ( (QLabel*)w )->pixmap()->isNull() ) )
+ continue;
+ if ( ::qt_cast<MenuBarEditor*>(w) &&
+ ( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 ||
+ qstrcmp( p->name(), "itemText" ) == 0 ) )
+ continue;
+ if ( qstrcmp( p->name(), "name" ) == 0 )
+ knownNames << w->property( "name" ).toString();
+ if ( !p->isSetType() && !p->isEnumType() && !w->property( p->name() ).isValid() )
+ continue;
+ ts << makeIndent( indent ) << "<property";
+ ts << " name=\"" << it.current() << "\"";
+ if ( !p->stdSet() )
+ ts << " stdset=\"0\"";
+ ts << ">" << endl;
+ indent++;
+ if ( strcmp( it.current(), "resizeMode" ) == 0 && ::qt_cast<QLayout*>(w) ) {
+ saveProperty( w, it.current(), "", QVariant::String, ts, indent );
+ } else if ( p->isSetType() ) {
+ saveSetProperty( w, it.current(), QVariant::nameToType( p->type() ), ts, indent );
+ } else if ( p->isEnumType() ) {
+ saveEnumProperty( w, it.current(), QVariant::nameToType( p->type() ), ts, indent );
+ } else {
+ saveProperty( w, it.current(), w->property( p->name() ), QVariant::nameToType( p->type() ), ts, indent );
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+
+ if ( w->isWidgetType() && MetaDataBase::fakeProperties( w ) ) {
+ QMap<QString, QVariant>* fakeProperties = MetaDataBase::fakeProperties( w );
+ for ( QMap<QString, QVariant>::Iterator fake = fakeProperties->begin();
+ fake != fakeProperties->end(); ++fake ) {
+ if ( MetaDataBase::isPropertyChanged( w, fake.key() ) ) {
+ if ( w->inherits("CustomWidget") ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)w )->customWidget();
+ if ( cw && !cw->hasProperty( fake.key().latin1() ) && fake.key() != "toolTip" && fake.key() != "whatsThis" )
+ continue;
+ }
+
+ ts << makeIndent( indent ) << "<property name=\"" << fake.key() << "\" stdset=\"0\">" << endl;
+ indent++;
+ saveProperty( w, fake.key(), *fake, (*fake).type(), ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</property>" << endl;
+ }
+ }
+ }
+}
+
+void Resource::saveSetProperty( QObject *w, const QString &name, QVariant::Type, QTextStream &ts, int indent )
+{
+ const QMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, TRUE ), TRUE );
+ QStrList l( p->valueToKeys( w->property( name ).toInt() ) );
+ QString v;
+ for ( uint i = 0; i < l.count(); ++i ) {
+ v += l.at( i );
+ if ( i < l.count() - 1 )
+ v += "|";
+ }
+ ts << makeIndent( indent ) << "<set>" << v << "</set>" << endl;
+}
+
+void Resource::saveEnumProperty( QObject *w, const QString &name, QVariant::Type, QTextStream &ts, int indent )
+{
+ const QMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, TRUE ), TRUE );
+ ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl;
+}
+
+void Resource::saveProperty( QObject *w, const QString &name, const QVariant &value, QVariant::Type t, QTextStream &ts, int indent )
+{
+ if ( name == "hAlign" || name =="vAlign" || name == "wordwrap" ||
+ name == "layoutMargin" || name =="layoutSpacing" )
+ return;
+ int num;
+ uint unum;
+ double dob;
+ QString comment;
+ if ( w && formwindow->widgets()->find( (QWidget*)w ) || formwindow->actionList().find( (QAction*)w ) )
+ comment = MetaDataBase::propertyComment( w, name );
+ switch ( t ) {
+ case QVariant::String:
+ if ( name == "resizeMode" ) {
+ QString resmod = MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) );
+ if ( !resmod.isNull() && resmod != "Auto" ) {
+ ts << makeIndent( indent ) << "<enum>";
+ ts << resmod;
+ ts << "</enum>" << endl;
+ }
+
+ } else {
+ ts << makeIndent( indent ) << "<string>" << entitize( value.toString() ) << "</string>" << endl;
+ if ( !comment.isEmpty() )
+ ts << makeIndent( indent ) << "<comment>" << entitize( comment ) << "</comment>" << endl;
+ }
+ break;
+ case QVariant::CString:
+ ts << makeIndent( indent ) << "<cstring>" << entitize( value.toCString() ).latin1() << "</cstring>" << endl;
+ break;
+ case QVariant::Bool:
+ ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl;
+ break;
+ case QVariant::Int:
+ if ( ::qt_cast<QLayout*>(w) ) {
+ num = -1;
+ if ( name == "spacing" )
+ num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) );
+ else if ( name == "margin" )
+ num = MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)w ) ) );
+ if ( num != -1 )
+ ts << makeIndent( indent ) << "<number>" << QString::number( num ) << "</number>" << endl;
+ } else {
+ num = value.toInt();
+ ts << makeIndent( indent ) << "<number>" << QString::number( num ) << "</number>" << endl;
+ }
+ break;
+ case QVariant::Double:
+ dob = value.toDouble();
+ ts << makeIndent( indent ) << "<number>" << QString::number( dob ) << "</number>" << endl;
+ break;
+ case QVariant::KeySequence:
+ ts << makeIndent( indent ) << "<string>"
+ << entitize(platformNeutralKeySequence(value.toKeySequence())) << "</string>" << endl;
+ break;
+ case QVariant::UInt:
+ unum = value.toUInt();
+ ts << makeIndent( indent ) << "<number>" << QString::number( unum ) << "</number>" << endl;
+ break;
+ case QVariant::Rect: {
+ QVariant v( value );
+ ts << makeIndent( indent ) << "<rect>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<x>" << QString::number( v.toRect().x() ) << "</x>" << endl;
+ ts << makeIndent( indent ) << "<y>" << QString::number( v.toRect().y() ) << "</y>" << endl;
+ ts << makeIndent( indent ) << "<width>" << QString::number( v.toRect().width() ) << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << QString::number( v.toRect().height() ) << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</rect>" << endl;
+ } break;
+ case QVariant::Point: {
+ QVariant v( value );
+ ts << makeIndent( indent ) << "<point>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<x>" << QString::number( v.toPoint().x() ) << "</x>" << endl;
+ ts << makeIndent( indent ) << "<y>" << QString::number( v.toPoint().y() ) << "</y>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</point>" << endl;
+ } break;
+ case QVariant::Size: {
+ QVariant v( value );
+ ts << makeIndent( indent ) << "<size>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<width>" << QString::number( v.toSize().width() ) << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << QString::number( v.toSize().height() ) << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</size>" << endl;
+ } break;
+ case QVariant::Color: {
+ QVariant v( value );
+ ts << makeIndent( indent ) << "<color>" << endl;
+ indent++;
+ saveColor( ts, indent, v.toColor() );
+ indent--;
+ ts << makeIndent( indent ) << "</color>" << endl;
+ } break;
+ case QVariant::Font: {
+ QVariant v( value );
+ ts << makeIndent( indent ) << "<font>" << endl;
+ QFont f( qApp->font() );
+ if ( w && w->isWidgetType() && ((QWidget*)w)->parentWidget() )
+ f = ((QWidget*)w)->parentWidget()->font();
+ QFont f2( v.toFont() );
+ indent++;
+ if ( f.family() != f2.family() )
+ ts << makeIndent( indent ) << "<family>" << f2.family() << "</family>" << endl;
+ if ( f.pointSize() != f2.pointSize() )
+ ts << makeIndent( indent ) << "<pointsize>" << QString::number( f2.pointSize() ) << "</pointsize>" << endl;
+ if ( f.bold() != f2.bold() )
+ ts << makeIndent( indent ) << "<bold>" << QString::number( (int)f2.bold() ) << "</bold>" << endl;
+ if ( f.italic() != f2.italic() )
+ ts << makeIndent( indent ) << "<italic>" << QString::number( (int)f2.italic() ) << "</italic>" << endl;
+ if ( f.underline() != f2.underline() )
+ ts << makeIndent( indent ) << "<underline>" << QString::number( (int)f2.underline() ) << "</underline>" << endl;
+ if ( f.strikeOut() != f2.strikeOut() )
+ ts << makeIndent( indent ) << "<strikeout>" << QString::number( (int)f2.strikeOut() ) << "</strikeout>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</font>" << endl;
+ } break;
+ case QVariant::SizePolicy: {
+ QSizePolicy sp( value.toSizePolicy() );
+ ts << makeIndent( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hsizetype>" << (int)sp.horData() << "</hsizetype>" << endl;
+ ts << makeIndent( indent ) << "<vsizetype>" << (int)sp.verData() << "</vsizetype>" << endl;
+ ts << makeIndent( indent ) << "<horstretch>" << (int)sp.horStretch() << "</horstretch>" << endl;
+ ts << makeIndent( indent ) << "<verstretch>" << (int)sp.verStretch() << "</verstretch>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizepolicy>" << endl;
+ break;
+ }
+ case QVariant::Pixmap:
+ savePixmap( value.toPixmap(), ts, indent );
+ break;
+ case QVariant::IconSet:
+ savePixmap( value.toIconSet().pixmap(), ts, indent, "iconset" );
+ break;
+ case QVariant::Image:
+ ts << makeIndent( indent ) << "<image>" << saveInCollection( value.toImage() ) << "</image>" << endl;
+ break;
+ case QVariant::Palette: {
+ QPalette p( value.toPalette() );
+ ts << makeIndent( indent ) << "<palette>" << endl;
+ indent++;
+
+ ts << makeIndent( indent ) << "<active>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.active() );
+ indent--;
+ ts << makeIndent( indent ) << "</active>" << endl;
+
+ ts << makeIndent( indent ) << "<disabled>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.disabled() );
+ indent--;
+ ts << makeIndent( indent ) << "</disabled>" << endl;
+
+ ts << makeIndent( indent ) << "<inactive>" << endl;
+ indent++;
+ saveColorGroup( ts, indent, p.inactive() );
+ indent--;
+ ts << makeIndent( indent ) << "</inactive>" << endl;
+
+ indent--;
+ ts << makeIndent( indent ) << "</palette>" << endl;
+ } break;
+ case QVariant::Cursor:
+ ts << makeIndent( indent ) << "<cursor>" << value.toCursor().shape() << "</cursor>" << endl;
+ break;
+ case QVariant::StringList: {
+ QStringList lst = value.toStringList();
+ uint i = 0;
+ ts << makeIndent( indent ) << "<stringlist>" << endl;
+ indent++;
+ if ( !lst.isEmpty() ) {
+ for ( i = 0; i < lst.count(); ++i )
+ ts << makeIndent( indent ) << "<string>" << entitize( lst[ i ] ) << "</string>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</stringlist>" << endl;
+ } break;
+ case QVariant::Date: {
+ QDate d = value.toDate();
+ ts << makeIndent( indent ) << "<date>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<year>" << d.year() << "</year>" << endl;
+ ts << makeIndent( indent ) << "<month>" << d.month() << "</month>" << endl;
+ ts << makeIndent( indent ) << "<day>" << d.day() << "</day>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</date>" << endl;
+ break;
+ }
+ case QVariant::Time: {
+ QTime t = value.toTime();
+ ts << makeIndent( indent ) << "<time>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hour>" << t.hour() << "</hour>" << endl;
+ ts << makeIndent( indent ) << "<minute>" << t.minute() << "</minute>" << endl;
+ ts << makeIndent( indent ) << "<second>" << t.second() << "</second>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</time>" << endl;
+ break;
+ }
+ case QVariant::DateTime: {
+ QDateTime dt = value.toDateTime();
+ ts << makeIndent( indent ) << "<datetime>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<year>" << dt.date().year() << "</year>" << endl;
+ ts << makeIndent( indent ) << "<month>" << dt.date().month() << "</month>" << endl;
+ ts << makeIndent( indent ) << "<day>" << dt.date().day() << "</day>" << endl;
+ ts << makeIndent( indent ) << "<hour>" << dt.time().hour() << "</hour>" << endl;
+ ts << makeIndent( indent ) << "<minute>" << dt.time().minute() << "</minute>" << endl;
+ ts << makeIndent( indent ) << "<second>" << dt.time().second() << "</second>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</datetime>" << endl;
+ break;
+ }
+ default:
+ qWarning( "saving the property %s of type %d not supported yet", name.latin1(), (int)t );
+ }
+}
+
+void Resource::saveColorGroup( QTextStream &ts, int indent, const QColorGroup &cg )
+{
+ for( int r = 0 ; r < QColorGroup::NColorRoles ; r++ ) {
+ ts << makeIndent( indent ) << "<color>" << endl;
+ indent++;
+ saveColor( ts, indent, cg.color( (QColorGroup::ColorRole)r ) );
+ indent--;
+ ts << makeIndent( indent ) << "</color>" << endl;
+ QPixmap* pm = cg.brush( (QColorGroup::ColorRole)r ).pixmap();
+ if ( pm && !pm->isNull() )
+ savePixmap( *pm, ts, indent );
+ }
+}
+
+void Resource::saveColor( QTextStream &ts, int indent, const QColor &c )
+{
+ ts << makeIndent( indent ) << "<red>" << QString::number( c.red() ) << "</red>" << endl;
+ ts << makeIndent( indent ) << "<green>" << QString::number( c.green() ) << "</green>" << endl;
+ ts << makeIndent( indent ) << "<blue>" << QString::number( c.blue() ) << "</blue>" << endl;
+}
+
+QObject *Resource::createObject( const QDomElement &e, QWidget *parent, QLayout* layout )
+{
+ lastItem = 0;
+ QDomElement n = e.firstChild().toElement();
+ QWidget *w = 0; // the widget that got created
+ QObject *obj = 0; // gets the properties
+
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ QString className = e.attribute( "class", "QWidget" );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ QString parentClassName = WidgetFactory::classNameOf( parent );
+ bool isPlugin =
+ WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( parentClassName ) );
+ if ( isPlugin )
+ qWarning( "####### loading custom container widgets without page support not implemented!" );
+ // ### TODO loading for custom container widgets without pages
+#endif
+ if ( !className.isNull() ) {
+ obj = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE );
+ if ( !obj ) {
+ QMessageBox::critical( MainWindow::self, i18n( "Loading File" ),
+ i18n( "Error loading %1.\n"
+ "The widget %2 could not be created." ).
+ arg( currFileName ).arg( className ) );
+ return 0;
+ }
+ if ( !mainContainerSet ) {
+ if ( formwindow )
+ formwindow->setMainContainer( (QWidget*)obj );
+ mainContainerSet = TRUE;
+ }
+ w = (QWidget*)obj;
+ if ( ::qt_cast<QMainWindow*>(w) )
+ w = ( (QMainWindow*)w )->centralWidget();
+ if ( layout ) {
+ switch ( WidgetFactory::layoutType( layout ) ) {
+ case WidgetFactory::HBox:
+ ( (QHBoxLayout*)layout )->addWidget( w );
+ break;
+ case WidgetFactory::VBox:
+ ( (QVBoxLayout*)layout )->addWidget( w );
+ break;
+ case WidgetFactory::Grid:
+ ( (QDesignerGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ col, col + colspan - 1 );
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ( !toplevel )
+ toplevel = w;
+ layout = 0;
+
+ if ( w && formwindow ) {
+ if ( !parent ||
+ ( !::qt_cast<QTabWidget*>(parent) &&
+ !::qt_cast<QWidgetStack*>(parent) &&
+ !::qt_cast<QToolBox*>(parent) &&
+ !::qt_cast<QWizard*>(parent)
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ && !isPlugin
+#endif
+ ) )
+ formwindow->insertWidget( w, pasting );
+ else if ( parent &&
+ ( ::qt_cast<QTabWidget*>(parent) ||
+ ::qt_cast<QWidgetStack*>(parent) ||
+ ::qt_cast<QToolBox*>(parent) ||
+ ::qt_cast<QWizard*>(parent)
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ || isPlugin
+#endif
+ ) )
+ MetaDataBase::addEntry( w );
+ }
+ }
+
+ QDomElement sizePolicyElement;
+ QObject *sizePolicyObject = 0;
+
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "spacer" ) {
+ createSpacer( n, w, layout, Qt::Horizontal );
+ } else if ( n.tagName() == "widget" ) {
+ createObject( n, w, layout );
+ } else if ( n.tagName() == "hbox" ) {
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox );
+ obj = layout;
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "grid" ) {
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid );
+ obj = layout;
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "vbox" ) {
+ layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox );
+ obj = layout;
+ n = n.firstChild().toElement();
+ continue;
+ } else if ( n.tagName() == "property" && obj ) {
+ if ( n.attribute( "name" ) == "sizePolicy" ) {
+ // ### Evil hack ### Delay setting sizePolicy so it won't be overridden by other properties.
+ sizePolicyElement = n;
+ sizePolicyObject = obj;
+ } else {
+ setObjectProperty( obj, n.attribute( "name" ), n.firstChild().toElement() );
+ }
+ } else if ( n.tagName() == "attribute" && w ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( ::qt_cast<QTabWidget*>(parent) ) {
+ if ( attrib == "title" )
+ ( (QTabWidget*)parent )->insertTab( w, v.toString() );
+ } else if ( ::qt_cast<QWidgetStack*>(parent) ) {
+ if ( attrib == "id" )
+ ( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() );
+ } else if ( ::qt_cast<QToolBox*>(parent) ) {
+ if ( attrib == "label" )
+ ( (QToolBox*)parent )->addItem( w, v.toString() );
+ } else if ( ::qt_cast<QWizard*>(parent) ) {
+ if ( attrib == "title" )
+ ( (QWizard*)parent )->addPage( w, v.toString() );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( isPlugin ) {
+ if ( attrib == "label" ) {
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( parentClassName, &iface );
+ if ( iface ) {
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->insertPage( parentClassName,
+ (QWidget*)parent, v.toString(), -1, w );
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ }
+ } else if ( n.tagName() == "item" ) {
+ createItem( n, w );
+ } else if ( n.tagName() == "column" || n.tagName() =="row" ) {
+ createColumn( n, w );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ // ### Evil hack ### See description above.
+ if ( !sizePolicyElement.isNull() ) {
+ setObjectProperty( sizePolicyObject,
+ sizePolicyElement.attribute( "name" ),
+ sizePolicyElement.firstChild().toElement() );
+ }
+
+ if ( w->isWidgetType() )
+ widgets.insert( w->name(), w );
+
+ return w;
+}
+
+void Resource::createColumn( const QDomElement &e, QWidget *widget )
+{
+ if ( !widget )
+ return;
+
+ if ( ::qt_cast<QListView*>(widget) && e.tagName() == "column" ) {
+ QListView *lv = (QListView*)widget;
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ bool clickable = TRUE, resizable = TRUE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ hasPixmap = !pix.isNull();
+ } else if ( attrib == "clickable" )
+ clickable = v.toBool();
+ else if ( attrib == "resizable" )
+ resizable = v.toBool();
+ }
+ n = n.nextSibling().toElement();
+ }
+ lv->addColumn( txt );
+ int i = lv->header()->count() - 1;
+ if ( hasPixmap ) {
+ lv->header()->setLabel( i, pix, txt );
+ }
+ if ( !clickable )
+ lv->header()->setClickEnabled( clickable, i );
+ if ( !resizable )
+ lv->header()->setResizeEnabled( resizable, i );
+ }
+#ifndef QT_NO_TABLE
+ else if ( ::qt_cast<QTable*>(widget) ) {
+ QTable *table = (QTable*)widget;
+ bool isRow;
+ if ( ( isRow = e.tagName() == "row" ) )
+ table->setNumRows( table->numRows() + 1 );
+ else
+ table->setNumCols( table->numCols() + 1 );
+
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ QString field;
+ QMap<QString, QString> fieldMap = MetaDataBase::columnFields( table );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ hasPixmap = !n.firstChild().firstChild().toText().data().isEmpty();
+ if ( hasPixmap )
+ pix = loadPixmap( n.firstChild().toElement() );
+ } else if ( attrib == "field" )
+ field = v.toString();
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ int i = isRow ? table->numRows() - 1 : table->numCols() - 1;
+ QHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader();
+ if ( hasPixmap )
+ h->setLabel( i, pix, txt );
+ else
+ h->setLabel( i, txt );
+ if ( !isRow && !field.isEmpty() )
+ fieldMap.insert( txt, field );
+ MetaDataBase::setColumnFields( table, fieldMap );
+ }
+#endif
+}
+
+void Resource::loadItem( const QDomElement &e, QPixmap &pix, QString &txt, bool &hasPixmap )
+{
+ QDomElement n = e;
+ hasPixmap = FALSE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = v.toString();
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement() );
+ hasPixmap = !pix.isNull();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::createItem( const QDomElement &e, QWidget *widget, QListViewItem *i )
+{
+ if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ), widget ) )
+ return;
+
+ if ( ::qt_cast<QListBox*>(widget) || ::qt_cast<QComboBox*>(widget) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ QListBox *lb = 0;
+ if ( ::qt_cast<QListBox*>(widget) )
+ lb = (QListBox*)widget;
+ else
+ lb = ( (QComboBox*)widget)->listBox();
+ if ( hasPixmap ) {
+ new QListBoxPixmap( lb, pix, txt );
+ } else {
+ new QListBoxText( lb, txt );
+ }
+ } else if ( ::qt_cast<QIconView*>(widget) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ QIconView *iv = (QIconView*)widget;
+ if ( hasPixmap )
+ new QIconViewItem( iv, txt, pix );
+ else
+ new QIconViewItem( iv, txt );
+ } else if ( ::qt_cast<QListView*>(widget) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ QValueList<QPixmap> pixmaps;
+ QStringList textes;
+ QListViewItem *item = 0;
+ QListView *lv = (QListView*)widget;
+ if ( i )
+ item = new QListViewItem( i, lastItem );
+ else
+ item = new QListViewItem( lv, lastItem );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ textes << v.toString();
+ else if ( attrib == "pixmap" ) {
+ QString s = v.toString();
+ if ( s.isEmpty() ) {
+ pixmaps << QPixmap();
+ } else {
+ pix = loadPixmap( n.firstChild().toElement() );
+ pixmaps << pix;
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ item->setOpen( TRUE );
+ createItem( n, widget, item );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ for ( int i = 0; i < lv->columns(); ++i ) {
+ item->setText( i, textes[ i ] );
+ item->setPixmap( i, pixmaps[ i ] );
+ }
+ lastItem = item;
+ }
+}
+
+QWidget *Resource::createSpacer( const QDomElement &e, QWidget *parent, QLayout *layout, Qt::Orientation o )
+{
+ QDomElement n = e.firstChild().toElement();
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ Spacer *spacer = (Spacer*) WidgetFactory::create( WidgetDatabase::idFromClassName("Spacer"),
+ parent, "spacer", FALSE);
+ spacer->setOrientation( o );
+ spacer->setInteraciveMode( FALSE );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" )
+ setObjectProperty( spacer, n.attribute( "name" ), n.firstChild().toElement() );
+ n = n.nextSibling().toElement();
+ }
+ spacer->setInteraciveMode( TRUE );
+ if ( formwindow )
+ formwindow->insertWidget( spacer, pasting );
+ if ( layout ) {
+ if ( ::qt_cast<QBoxLayout*>(layout) )
+ ( (QBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() );
+ else
+ ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1,
+ spacer->alignment() );
+ }
+ return spacer;
+}
+
+/*!
+ Attention: this function has to be in sync with Uic::setObjectProperty(). If you change one, change both.
+*/
+void Resource::setObjectProperty( QObject* obj, const QString &prop, const QDomElement &e )
+{
+ const QMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, TRUE ), TRUE );
+
+ if ( !::qt_cast<QLayout*>(obj) ) {// no layouts in metadatabase... (RS)
+ if ( obj->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget();
+ if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" )
+ return;
+ }
+ MetaDataBase::setPropertyChanged( obj, prop, TRUE );
+ }
+
+ QVariant defVarient;
+ if ( e.tagName() == "font" ) {
+ QFont f( qApp->font() );
+ if ( obj->isWidgetType() && ( (QWidget*)obj )->parentWidget() )
+ f = ( (QWidget*)obj )->parentWidget()->font();
+ defVarient = QVariant( f );
+ }
+
+ QString comment;
+ QVariant v( DomTool::elementToVariant( e, defVarient, comment ) );
+
+ if ( !comment.isEmpty() ) {
+ MetaDataBase::addEntry( obj );
+ MetaDataBase::setPropertyComment( obj, prop, comment );
+ }
+
+ if ( e.tagName() == "pixmap" ) {
+ QPixmap pix = loadPixmap( e );
+ if ( pix.isNull() )
+ return;
+ v = QVariant( pix );
+ } else if ( e.tagName() == "iconset" ) {
+ QPixmap pix = loadPixmap( e, "iconset" );
+ if ( pix.isNull() )
+ return;
+ v = QVariant( QIconSet( pix ) );
+ } else if ( e.tagName() == "image" ) {
+ v = QVariant( loadFromCollection( v.toString() ) );
+ }
+
+ if ( !p ) {
+ MetaDataBase::setFakeProperty( obj, prop, v );
+ if ( obj->isWidgetType() ) {
+ if ( prop == "database" && obj != toplevel ) {
+ QStringList lst = MetaDataBase::fakeProperty( obj, "database" ).toStringList();
+ if ( lst.count() > 2 )
+ dbControls.insert( obj->name(), lst[ 2 ] );
+ else if ( lst.count() == 2 )
+ dbTables.insert( obj->name(), lst );
+ }
+ return;
+ }
+ }
+
+ if ( e.tagName() == "palette" ) {
+ QDomElement n = e.firstChild().toElement();
+ QPalette p;
+ while ( !n.isNull() ) {
+ QColorGroup cg;
+ if ( n.tagName() == "active" ) {
+ cg = loadColorGroup( n );
+ p.setActive( cg );
+ } else if ( n.tagName() == "inactive" ) {
+ cg = loadColorGroup( n );
+ p.setInactive( cg );
+ } else if ( n.tagName() == "disabled" ) {
+ cg = loadColorGroup( n );
+ p.setDisabled( cg );
+ }
+ n = n.nextSibling().toElement();
+ }
+ v = QPalette( p );
+ } else if ( e.tagName() == "enum" && p && p->isEnumType() && prop != "resizeMode" ) {
+ QString key( v.toString() );
+ int vi = p->keyToValue( key );
+ if ( p->valueToKey( vi ) != key )
+ return; // ignore invalid properties
+ v = QVariant( vi );
+ } else if ( e.tagName() == "set" && p && p->isSetType() ) {
+ QString keys( v.toString() );
+ QStringList lst = QStringList::split( '|', keys );
+ QStrList l;
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ l.append( *it );
+ v = QVariant( p->keysToValue( l ) );
+ }
+
+ if ( prop == "caption" ) {
+ QCString s1 = v.toCString();
+ QString s2 = v.toString();
+ if ( !s2.isEmpty() )
+ formwindow->setCaption( s2 );
+ else if ( !s1.isEmpty() )
+ formwindow->setCaption( s1 );
+ }
+ if ( prop == "icon" ) {
+ formwindow->setIcon( v.toPixmap() );
+ QString pmk = MetaDataBase::pixmapKey( formwindow, v.toPixmap().serialNumber() );
+ MetaDataBase::setPixmapKey( formwindow,
+ formwindow->icon()->serialNumber(), pmk );
+ }
+
+ if ( prop == "geometry" ) {
+ if ( obj == toplevel ) {
+ hadGeometry = TRUE;
+ toplevel->resize( v.toRect().size() );
+ return;
+ } else if ( obj == formwindow->mainContainer() ) {
+ hadGeometry = TRUE;
+ formwindow->resize( v.toRect().size() );
+ return;
+ }
+ }
+
+ if ( ::qt_cast<QLayout*>(obj) ) {
+ if ( prop == "spacing" ) {
+ MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)obj ) ), v.toInt() );
+ return;
+ } else if ( prop == "margin" ) {
+ MetaDataBase::setMargin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)obj ) ), v.toInt() );
+ return;
+ } else if ( e.tagName() == "enum" && prop == "resizeMode" ) {
+ MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (QLayout*)obj ) ), v.toString() );
+ return;
+ }
+ }
+
+ if ( prop == "name" ) {
+ if ( pasting ) {
+ QString s = v.toString();
+ formwindow->unify( (QWidget*)obj, s, TRUE );
+ obj->setName( s );
+ return;
+ } else if ( formwindow && obj == formwindow->mainContainer() ) {
+ formwindow->setName( v.toCString() );
+ }
+ }
+
+ if ( prop == "sizePolicy" ) {
+ QSizePolicy sp = v.toSizePolicy();
+ sp.setHeightForWidth( ( (QWidget*)obj )->sizePolicy().hasHeightForWidth() );
+ }
+
+ if ( prop == "cursor" )
+ MetaDataBase::setCursor( (QWidget*)obj, v.toCursor() );
+
+ obj->setProperty( prop, v );
+}
+
+
+QString Resource::saveInCollection( const QImage &img )
+{
+ QString imgName = "none";
+ QValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( img == ( *it ).img ) {
+ imgName = ( *it ).name;
+ break;
+ }
+ }
+
+ if ( imgName == "none" ) {
+ Image i;
+ imgName = "image" + QString::number( images.count() );
+ i.name = imgName;
+ i.img = img;
+ images.append( i );
+ }
+ return imgName;
+}
+
+void Resource::saveImageData( const QImage &img, QTextStream &ts, int indent )
+{
+ QByteArray ba;
+ QBuffer buf( ba );
+ buf.open( IO_WriteOnly | IO_Translate );
+ QString format;
+ bool compress = FALSE;
+ if (img.hasAlphaBuffer()) {
+ format = "PNG";
+ } else {
+ format = img.depth() > 1 ? "XPM" : "XBM";
+ compress = TRUE;
+ }
+ QImageIO iio( &buf, format );
+ iio.setImage( img );
+ iio.write();
+ buf.close();
+ QByteArray bazip = ba;
+ int i = 0;
+ if (compress) {
+ bazip = qCompress( ba );
+ format += ".GZ";
+ // The first 4 bytes in qCompress() are the length of the unzipped
+ // format. The XPM.GZ format does not use these.
+ i = 4;
+ }
+ ulong len = bazip.size();
+ ts << makeIndent( indent ) << "<data format=\"" + format + "\" length=\"" << ba.size() << "\">";
+ static const char hexchars[] = "0123456789abcdef";
+ for (; i < (int)len; ++i ) {
+ uchar s = (uchar) bazip[i];
+ ts << hexchars[s >> 4];
+ ts << hexchars[s & 0x0f];
+ }
+ ts << "</data>" << endl;
+}
+
+void Resource::saveImageCollection( QTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<images>" << endl;
+ indent++;
+
+ QValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ ts << makeIndent( indent ) << "<image name=\"" << (*it).name << "\">" << endl;
+ indent++;
+ saveImageData( (*it).img, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</image>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent( indent ) << "</images>" << endl;
+}
+
+static QImage loadImageData( QDomElement &n2 )
+{
+ QImage img;
+ QString data = n2.firstChild().toText().data();
+ const int lengthOffset = 4;
+ int baSize = data.length() / 2 + lengthOffset;
+ uchar *ba = new uchar[ baSize ];
+ for ( int i = lengthOffset; i < baSize; ++i ) {
+ char h = data[ 2 * (i-lengthOffset) ].latin1();
+ char l = data[ 2 * (i-lengthOffset) + 1 ].latin1();
+ uchar r = 0;
+ if ( h <= '9' )
+ r += h - '0';
+ else
+ r += h - 'a' + 10;
+ r = r << 4;
+ if ( l <= '9' )
+ r += l - '0';
+ else
+ r += l - 'a' + 10;
+ ba[ i ] = r;
+ }
+ QString format = n2.attribute( "format", "PNG" );
+ if ( format == "XPM.GZ" || format == "XBM.GZ" ) {
+ ulong len = n2.attribute( "length" ).toULong();
+ if ( len < data.length() * 5 )
+ len = data.length() * 5;
+ // qUncompress() expects the first 4 bytes to be the expected length of
+ // the uncompressed data
+ ba[0] = ( len & 0xff000000 ) >> 24;
+ ba[1] = ( len & 0x00ff0000 ) >> 16;
+ ba[2] = ( len & 0x0000ff00 ) >> 8;
+ ba[3] = ( len & 0x000000ff );
+ QByteArray baunzip = qUncompress( ba, baSize );
+ img.loadFromData( (const uchar*)baunzip.data(), baunzip.size(), format.left(format.find('.')) );
+ } else {
+ img.loadFromData( (const uchar*)ba+lengthOffset, baSize-lengthOffset, format );
+ }
+ delete [] ba;
+ return img;
+}
+
+void Resource::loadImageCollection( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "image" ) {
+ Image img;
+ img.name = n.attribute( "name" );
+ QDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "data" )
+ img.img = loadImageData( n2 );
+ n2 = n2.nextSibling().toElement();
+ }
+ images.append( img );
+ n = n.nextSibling().toElement();
+ }
+ }
+}
+
+QImage Resource::loadFromCollection( const QString &name )
+{
+ QValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( ( *it ).name == name )
+ return ( *it ).img;
+ }
+ return QImage();
+}
+
+void Resource::saveConnections( QTextStream &ts, int indent )
+{
+ QValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( formwindow );
+ if ( connections.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<connections>" << endl;
+ indent++;
+ QValueList<MetaDataBase::Connection>::Iterator it = connections.begin();
+ for ( ; it != connections.end(); ++it ) {
+ MetaDataBase::Connection conn = *it;
+ if ( ( knownNames.findIndex( QString( conn.sender->name() ) ) == -1 &&
+ qstrcmp( conn.sender->name(), "this" ) != 0 ) ||
+ ( knownNames.findIndex( QString( conn.receiver->name() ) ) == -1 &&
+ qstrcmp( conn.receiver->name(), "this" ) != 0 ) )
+ continue;
+ if ( formwindow->isMainContainer( (QWidget*)(*it).receiver ) &&
+ !MetaDataBase::hasSlot( formwindow, MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) )
+ continue;
+
+ if ( conn.sender->inherits( "CustomWidget" ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)conn.sender )->customWidget();
+ if ( cw && !cw->hasSignal( conn.signal ) )
+ continue;
+ }
+
+ if ( conn.receiver->inherits( "CustomWidget" ) && !formwindow->isMainContainer( conn.receiver ) ) {
+ MetaDataBase::CustomWidget *cw = ( (CustomWidget*)conn.receiver )->customWidget();
+ if ( cw && !cw->hasSlot( MetaDataBase::normalizeFunction( conn.slot ).latin1() ) )
+ continue;
+ }
+
+ ts << makeIndent( indent ) << "<connection>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<sender>" << entitize( conn.sender->name() ) << "</sender>" << endl;
+ ts << makeIndent( indent ) << "<signal>" << entitize( conn.signal ) << "</signal>" << endl;
+ ts << makeIndent( indent ) << "<receiver>" << entitize( conn.receiver->name() ) << "</receiver>" << endl;
+ ts << makeIndent( indent ) << "<slot>" << entitize( MetaDataBase::normalizeFunction( conn.slot ) ) << "</slot>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</connection>" << endl;
+ }
+
+ QString lang = formwindow->project()->language();
+ indent--;
+ ts << makeIndent( indent ) << "</connections>" << endl;
+}
+
+void Resource::loadConnections( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "connection" ) {
+ QString lang = n.attribute( "language", "C++" );
+ QDomElement n2 = n.firstChild().toElement();
+ MetaDataBase::Connection conn;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "sender" ) {
+ conn.sender = 0;
+ QString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.sender = toplevel;
+ } else {
+ if ( name == "this" )
+ name = toplevel->name();
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.sender = l->first();
+ delete l;
+ l = 0;
+ }
+ if ( !conn.sender )
+ conn.sender = formwindow->findAction( name );
+ }
+ } else if ( n2.tagName() == "signal" ) {
+ conn.signal = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "receiver" ) {
+ conn.receiver = 0;
+ QString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.receiver = toplevel;
+ } else {
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.receiver = l->first();
+ delete l;
+ l = 0;
+ }
+ if ( !conn.receiver )
+ conn.receiver = formwindow->findAction( name );
+ }
+ } else if ( n2.tagName() == "slot" ) {
+ conn.slot = n2.firstChild().toText().data();
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( formwindow ) {
+ if ( conn.sender == formwindow )
+ conn.sender = formwindow->mainContainer();
+ if ( conn.receiver == formwindow )
+ conn.receiver = formwindow->mainContainer();
+ }
+ if ( conn.sender && conn.receiver ) {
+ if ( lang == "C++" ) {
+ MetaDataBase::addConnection( formwindow ? formwindow : toplevel,
+ conn.sender, conn.signal, conn.receiver, conn.slot );
+ }
+ }
+ } else if ( n.tagName() == "slot" ) { // compatibility with 2.x
+ MetaDataBase::Function slot;
+ slot.specifier = n.attribute( "specifier", "virtual" );
+ if ( slot.specifier.isEmpty() )
+ slot.specifier = "virtual";
+ slot.access = n.attribute( "access", "public" );
+ if ( slot.access.isEmpty() )
+ slot.access = "public";
+ slot.language = n.attribute( "language", "C++" );
+ slot.returnType = n.attribute( "returnType", "void" );
+ if ( slot.returnType.isEmpty() )
+ slot.returnType = "void";
+ slot.function = n.firstChild().toText().data();
+ if ( !MetaDataBase::hasFunction( formwindow, slot.function, TRUE ) )
+ MetaDataBase::addFunction( formwindow, slot.function, slot.specifier,
+ slot.access, "slot", slot.language, slot.returnType );
+ else
+ MetaDataBase::changeFunctionAttributes( formwindow, slot.function, slot.function,
+ slot.specifier, slot.access,
+ "slot", slot.language, slot.returnType );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveCustomWidgets( QTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<customwidgets>" << endl;
+ indent++;
+
+ QPtrList<MetaDataBase::CustomWidget> *lst = MetaDataBase::customWidgets();
+ for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) {
+ if ( usedCustomWidgets.findIndex( w->className ) == -1 )
+ continue;
+ ts << makeIndent( indent ) << "<customwidget>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<class>" << w->className << "</class>" << endl;
+ ts << makeIndent( indent ) << "<header location=\""
+ << ( w->includePolicy == MetaDataBase::CustomWidget::Local ? "local" : "global" )
+ << "\">" << w->includeFile << "</header>" << endl;
+ ts << makeIndent( indent ) << "<sizehint>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<width>" << w->sizeHint.width() << "</width>" << endl;
+ ts << makeIndent( indent ) << "<height>" << w->sizeHint.height() << "</height>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizehint>" << endl;
+ ts << makeIndent( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl;
+ ts << makeIndent( indent ) << "<sizepolicy>" << endl;
+ indent++;
+ ts << makeIndent( indent ) << "<hordata>" << (int)w->sizePolicy.horData() << "</hordata>" << endl;
+ ts << makeIndent( indent ) << "<verdata>" << (int)w->sizePolicy.verData() << "</verdata>" << endl;
+ ts << makeIndent( indent ) << "<horstretch>" << (int)w->sizePolicy.horStretch() << "</horstretch>" << endl;
+ ts << makeIndent( indent ) << "<verstretch>" << (int)w->sizePolicy.verStretch() << "</verstretch>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</sizepolicy>" << endl;
+ ts << makeIndent( indent ) << "<pixmap>" << saveInCollection( w->pixmap->convertToImage() ) << "</pixmap>" << endl;
+ if ( !w->lstSignals.isEmpty() ) {
+ for ( QValueList<QCString>::Iterator it = w->lstSignals.begin(); it != w->lstSignals.end(); ++it )
+ ts << makeIndent( indent ) << "<signal>" << entitize( *it ) << "</signal>" << endl;
+ }
+ if ( !w->lstSlots.isEmpty() ) {
+ for ( QValueList<MetaDataBase::Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it )
+ ts << makeIndent( indent ) << "<slot access=\"" << (*it).access << "\" specifier=\""
+ << (*it).specifier << "\">" << entitize( (*it).function ) << "</slot>" << endl;
+ }
+ if ( !w->lstProperties.isEmpty() ) {
+ for ( QValueList<MetaDataBase::Property>::Iterator it = w->lstProperties.begin(); it != w->lstProperties.end(); ++it )
+ ts << makeIndent( indent ) << "<property type=\"" << (*it).type << "\">" << entitize( (*it).property ) << "</property>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</customwidget>" << endl;
+ }
+
+
+ indent--;
+ ts << makeIndent( indent ) << "</customwidgets>" << endl;
+}
+
+void Resource::loadCustomWidgets( const QDomElement &e, Resource *r )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "customwidget" ) {
+ QDomElement n2 = n.firstChild().toElement();
+ MetaDataBase::CustomWidget *w = new MetaDataBase::CustomWidget;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "class" ) {
+ w->className = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "header" ) {
+ w->includeFile = n2.firstChild().toText().data();
+ QString s = n2.attribute( "location" );
+ if ( s != "local" )
+ w->includePolicy = MetaDataBase::CustomWidget::Global;
+ else
+ w->includePolicy = MetaDataBase::CustomWidget::Local;
+ } else if ( n2.tagName() == "sizehint" ) {
+ QDomElement n3 = n2.firstChild().toElement();
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ w->sizeHint.setWidth( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "height" )
+ w->sizeHint.setHeight( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ } else if ( n2.tagName() == "sizepolicy" ) {
+ QDomElement n3 = n2.firstChild().toElement();
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hordata" )
+ w->sizePolicy.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verdata" )
+ w->sizePolicy.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "horstretch" )
+ w->sizePolicy.setHorStretch( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verstretch" )
+ w->sizePolicy.setVerStretch( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ } else if ( n2.tagName() == "pixmap" ) {
+ QPixmap pix;
+ if ( r ) {
+ pix = r->loadPixmap( n2 );
+ } else {
+ QDomElement n3 = n2.firstChild().toElement();
+ QImage img;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "data" ) {
+ img = loadImageData( n3 );
+ }
+ n3 = n3.nextSibling().toElement();
+ }
+ pix.convertFromImage( img );
+ }
+ w->pixmap = new QPixmap( pix );
+ } else if ( n2.tagName() == "signal" ) {
+ w->lstSignals.append( n2.firstChild().toText().data().latin1() );
+ } else if ( n2.tagName() == "container" ) {
+ w->isContainer = (bool)n2.firstChild().toText().data().toInt();
+ } else if ( n2.tagName() == "slot" ) {
+ MetaDataBase::Function function;
+ function.function = n2.firstChild().toText().data().latin1();
+ function.access = n2.attribute( "access" );
+ function.type = "slot";
+ w->lstSlots.append( function );
+ } else if ( n2.tagName() == "property" ) {
+ MetaDataBase::Property property;
+ property.property = n2.firstChild().toText().data().latin1();
+ property.type = n2.attribute( "type" );
+ w->lstProperties.append( property );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ MetaDataBase::addCustomWidget( w );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveTabOrder( QTextStream &ts, int indent )
+{
+ QWidgetList l = MetaDataBase::tabOrder( toplevel );
+ if ( l.isEmpty() )
+ return;
+
+ ts << makeIndent( indent ) << "<tabstops>" << endl;
+ indent++;
+
+ for ( QWidget *w = l.first(); w; w = l.next() ) {
+ if ( w->testWState( Qt::WState_ForceHide ) || knownNames.findIndex( w->name() ) == -1 )
+ continue;
+ ts << makeIndent( indent ) << "<tabstop>" << w->name() << "</tabstop>" << endl;
+ }
+
+ indent--;
+ ts << makeIndent( indent ) << "</tabstops>" << endl;
+}
+
+void Resource::loadTabOrder( const QDomElement &e )
+{
+ QWidget *last = 0;
+ QDomElement n = e.firstChild().toElement();
+ QWidgetList widgets;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "tabstop" ) {
+ QString name = n.firstChild().toText().data();
+ if ( name.isEmpty() )
+ continue;
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() ) {
+ QWidget *w = (QWidget*)l->first();
+ widgets.append( w );
+ if ( last )
+ toplevel->setTabOrder( last, w );
+ last = w;
+ }
+ delete l;
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( !widgets.isEmpty() )
+ MetaDataBase::setTabOrder( toplevel, widgets );
+}
+
+void Resource::saveMetaInfoBefore( QTextStream &ts, int indent )
+{
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow );
+ QString cn;
+ if ( info.classNameChanged && !info.className.isEmpty() )
+ cn = info.className;
+ else
+ cn = formwindow->name();
+ ts << makeIndent( indent ) << "<class>" << entitize( cn ) << "</class>" << endl;
+ if ( !info.comment.isEmpty() )
+ ts << makeIndent( indent ) << "<comment>" << entitize( info.comment ) << "</comment>" << endl;
+ if ( !info.author.isEmpty() )
+ ts << makeIndent( indent ) << "<author>" << entitize( info.author ) << "</author>" << endl;
+}
+
+void Resource::saveMetaInfoAfter( QTextStream &ts, int indent )
+{
+ MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow );
+ if ( !langIface || formwindow->project()->isCpp() ) {
+ QValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow );
+ QString extensionInclude;
+ bool needExtensionInclude = FALSE;
+ if ( langIface &&
+ formwindow->formFile()->hasFormCode() &&
+ formwindow->formFile()->codeFileState() != FormFile::Deleted ) {
+ extensionInclude = QFileInfo( currFileName ).fileName() + langIface->formCodeExtension();
+ needExtensionInclude = TRUE;
+ }
+ if ( !includes.isEmpty() || needExtensionInclude ) {
+ ts << makeIndent( indent ) << "<includes>" << endl;
+ indent++;
+
+ for ( QValueList<MetaDataBase::Include>::Iterator it = includes.begin(); it != includes.end(); ++it ) {
+ ts << makeIndent( indent ) << "<include location=\"" << (*it).location
+ << "\" impldecl=\"" << (*it).implDecl << "\">" << (*it).header << "</include>" << endl;
+ if ( needExtensionInclude )
+ needExtensionInclude = (*it).header != extensionInclude;
+ }
+
+ if ( needExtensionInclude )
+ ts << makeIndent( indent ) << "<include location=\"local\" impldecl=\"in implementation\">"
+ << extensionInclude << "</include>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</includes>" << endl;
+ }
+
+ QStringList forwards = MetaDataBase::forwards( formwindow );
+ if ( !forwards.isEmpty() ) {
+ ts << makeIndent( indent ) << "<forwards>" << endl;
+ indent++;
+ for ( QStringList::Iterator it2 = forwards.begin(); it2 != forwards.end(); ++it2 )
+ ts << makeIndent( indent ) << "<forward>" << entitize( *it2 ) << "</forward>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</forwards>" << endl;
+ }
+ QValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formwindow );
+ if ( !varLst.isEmpty() ) {
+ ts << makeIndent( indent ) << "<variables>" << endl;
+ indent++;
+
+ QValueList<MetaDataBase::Variable>::Iterator it = varLst.begin();
+ for ( ; it != varLst.end(); ++it ) {
+ ts << makeIndent( indent ) << "<variable";
+ if ( (*it).varAccess != "protected" )
+ ts << " access=\"" << (*it).varAccess << "\"";
+
+ ts << ">" << entitize( (*it).varName ) << "</variable>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</variables>" << endl;
+ }
+ QStringList sigs = MetaDataBase::signalList( formwindow );
+ if ( !sigs.isEmpty() ) {
+ ts << makeIndent( indent ) << "<signals>" << endl;
+ indent++;
+ for ( QStringList::Iterator it3 = sigs.begin(); it3 != sigs.end(); ++it3 )
+ ts << makeIndent( indent ) << "<signal>" << entitize( *it3 ) << "</signal>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</signals>" << endl;
+ }
+
+ QValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( formwindow );
+ if ( !slotList.isEmpty() ) {
+ ts << makeIndent( indent ) << "<slots>" << endl;
+ indent++;
+ QString lang = formwindow->project()->language();
+ QValueList<MetaDataBase::Function>::Iterator it = slotList.begin();
+ for ( ; it != slotList.end(); ++it ) {
+ MetaDataBase::Function function = *it;
+ ts << makeIndent( indent ) << "<slot";
+ if ( function.access != "public" )
+ ts << " access=\"" << function.access << "\"";
+ if ( function.specifier != "virtual" )
+ ts << " specifier=\"" << function.specifier << "\"";
+ if ( function.language != "C++" )
+ ts << " language=\"" << function.language<< "\"";
+ if ( function.returnType != "void" )
+ ts << " returnType=\"" << entitize( function.returnType ) << "\"";
+ ts << ">" << entitize( function.function ) << "</slot>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</slots>" << endl;
+ }
+
+ QValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formwindow, TRUE );
+ if ( !functionList.isEmpty() ) {
+ ts << makeIndent( indent ) << "<functions>" << endl;
+ indent++;
+ QString lang = formwindow->project()->language();
+ QValueList<MetaDataBase::Function>::Iterator it = functionList.begin();
+ for ( ; it != functionList.end(); ++it ) {
+ MetaDataBase::Function function = *it;
+ ts << makeIndent( indent ) << "<function";
+ if ( function.access != "public" )
+ ts << " access=\"" << function.access << "\"";
+ if ( function.specifier != "virtual" )
+ ts << " specifier=\"" << function.specifier << "\"";
+ if ( function.language != "C++" )
+ ts << " language=\"" << function.language<< "\"";
+ if ( function.returnType != "void" )
+ ts << " returnType=\"" << entitize( function.returnType ) << "\"";
+ ts << ">" << entitize( function.function ) << "</function>" << endl;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</functions>" << endl;
+ }
+ }
+
+ if ( formwindow && formwindow->savePixmapInline() )
+ ;
+ else if ( formwindow && formwindow->savePixmapInProject() )
+ ts << makeIndent( indent ) << "<pixmapinproject/>" << endl;
+ else
+ ts << makeIndent( indent ) << "<pixmapfunction>" << formwindow->pixmapLoaderFunction() << "</pixmapfunction>" << endl;
+ if ( !( exportMacro = MetaDataBase::exportMacro( formwindow->mainContainer() ) ).isEmpty() )
+ ts << makeIndent( indent ) << "<exportmacro>" << exportMacro << "</exportmacro>" << endl;
+ if ( formwindow ) {
+ ts << makeIndent( indent ) << "<layoutdefaults spacing=\"" << formwindow->layoutDefaultSpacing()
+ << "\" margin=\"" << formwindow->layoutDefaultMargin() << "\"/>" << endl;
+ if ( formwindow->hasLayoutFunctions() ) {
+ QString s = "";
+ QString m = "";
+ if ( !formwindow->spacingFunction().isEmpty() )
+ s = QString( " spacing=\"%1\"" ).arg( formwindow->spacingFunction() );
+ if ( !formwindow->marginFunction().isEmpty() )
+ m = QString( " margin=\"%1\"" ).arg( formwindow->marginFunction() );
+ ts << makeIndent( indent ) << "<layoutfunctions" << s << m << "/>" << endl;
+ }
+ }
+}
+
+void Resource::saveIncludeHints( QTextStream &ts, int indent )
+{
+ if ( includeHints.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<includehints>" << endl;
+ indent++;
+ for ( QStringList::Iterator it = includeHints.begin(); it != includeHints.end(); ++it )
+ ts << makeIndent( indent ) << "<includehint>" << *it << "</includehint>" << endl;
+ indent--;
+ ts << makeIndent( indent ) << "</includehints>" << endl;
+}
+
+QColorGroup Resource::loadColorGroup( const QDomElement &e )
+{
+ QColorGroup cg;
+ int r = -1;
+ QDomElement n = e.firstChild().toElement();
+ QColor col;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ } else if ( n.tagName() == "pixmap" ) {
+ QPixmap pix = loadPixmap( n );
+ cg.setBrush( (QColorGroup::ColorRole)r, QBrush( col, pix ) );
+ }
+ n = n.nextSibling().toElement();
+ }
+ return cg;
+}
+
+void Resource::saveChildActions( QAction *a, QTextStream &ts, int indent )
+{
+ if ( !a->children() )
+ return;
+ QObjectListIt it( *a->children() );
+ while ( it.current() ) {
+ QObject *o = it.current();
+ ++it;
+ if ( !::qt_cast<QAction*>(o) )
+ continue;
+ QAction *ac = (QAction*)o;
+ bool isGroup = ::qt_cast<QActionGroup*>(ac);
+ if ( isGroup )
+ ts << makeIndent( indent ) << "<actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "<action>" << endl;
+ indent++;
+ saveObjectProperties( ac, ts, indent );
+ indent--;
+ if ( isGroup ) {
+ indent++;
+ saveChildActions( ac, ts, indent );
+ indent--;
+ }
+ if ( isGroup )
+ ts << makeIndent( indent ) << "</actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "</action>" << endl;
+ }
+}
+
+void Resource::saveActions( const QPtrList<QAction> &actions, QTextStream &ts, int indent )
+{
+ if ( actions.isEmpty() )
+ return;
+ ts << makeIndent( indent ) << "<actions>" << endl;
+ indent++;
+ QPtrListIterator<QAction> it( actions );
+ while ( it.current() ) {
+ QAction *a = it.current();
+ bool isGroup = ::qt_cast<QActionGroup*>(a);
+ if ( isGroup )
+ ts << makeIndent( indent ) << "<actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "<action>" << endl;
+ indent++;
+ saveObjectProperties( a, ts, indent );
+ indent--;
+ if ( isGroup ) {
+ indent++;
+ saveChildActions( a, ts, indent );
+ indent--;
+ }
+ if ( isGroup )
+ ts << makeIndent( indent ) << "</actiongroup>" << endl;
+ else
+ ts << makeIndent( indent ) << "</action>" << endl;
+ ++it;
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</actions>" << endl;
+}
+
+void Resource::loadChildAction( QObject *parent, const QDomElement &e )
+{
+ QDomElement n = e;
+ QAction *a = 0;
+ if ( n.tagName() == "action" ) {
+ a = new QDesignerAction( parent );
+ MetaDataBase::addEntry( a );
+ QDomElement n2 = n.firstChild().toElement();
+ bool hasMenuText = FALSE;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ QDomElement n3(n2); // don't modify n2
+ QString prop = n3.attribute( "name" );
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ QDomElement value(n3.firstChild().toElement());
+ setObjectProperty( a, prop, value );
+ if (!hasMenuText && uiFileVersion < "3.3" && prop == "text")
+ setObjectProperty( a, "menuText", value );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !::qt_cast<QAction*>(parent) )
+ formwindow->actionList().append( a );
+ } else if ( n.tagName() == "actiongroup" ) {
+ a = new QDesignerActionGroup( parent );
+ MetaDataBase::addEntry( a );
+ QDomElement n2 = n.firstChild().toElement();
+ bool hasMenuText = FALSE;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ QDomElement n3(n2); // don't modify n2
+ QString prop = n3.attribute( "name" );
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ QDomElement value = n3.firstChild().toElement();
+ setObjectProperty( a, prop, value );
+ if (!hasMenuText && uiFileVersion < "3.3" && prop == "text")
+ setObjectProperty( a, "menuText", value );
+ } else if ( n2.tagName() == "action" ||
+ n2.tagName() == "actiongroup" ) {
+ loadChildAction( a, n2 );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !::qt_cast<QAction*>(parent) )
+ formwindow->actionList().append( a );
+ }
+}
+
+void Resource::loadActions( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" ) {
+ loadChildAction( formwindow, n );
+ } else if ( n.tagName() == "actiongroup" ) {
+ loadChildAction( formwindow, n );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::saveToolBars( QMainWindow *mw, QTextStream &ts, int indent )
+{
+ ts << makeIndent( indent ) << "<toolbars>" << endl;
+ indent++;
+
+ QPtrList<QToolBar> tbList;
+ for ( int i = 0; i <= (int)Qt::DockMinimized; ++i ) {
+ tbList = mw->toolBars( (Qt::Dock)i );
+ if ( tbList.isEmpty() )
+ continue;
+ for ( QToolBar *tb = tbList.first(); tb; tb = tbList.next() ) {
+ if ( tb->isHidden() )
+ continue;
+ ts << makeIndent( indent ) << "<toolbar dock=\"" << i << "\">" << endl;
+ indent++;
+ saveObjectProperties( tb, ts, indent );
+ QPtrList<QAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions();
+ for ( QAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( ::qt_cast<QSeparatorAction*>(a) ) {
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ } else {
+ if ( ::qt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) {
+ QWidget *w = ( (QDesignerAction*)a )->widget();
+ ts << makeIndent( indent ) << "<widget class=\""
+ << WidgetFactory::classNameOf( w ) << "\">" << endl;
+ indent++;
+ const char *className = WidgetFactory::classNameOf( w );
+ if ( w->isA( "CustomWidget" ) )
+ usedCustomWidgets << QString( className );
+ if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ), w ) )
+ saveItems( w, ts, indent );
+ saveObjectProperties( w, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</widget>" << endl;
+ } else {
+ ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl;
+ }
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</toolbar>" << endl;
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</toolbars>" << endl;
+}
+
+void Resource::saveMenuBar( QMainWindow *mw, QTextStream &ts, int indent )
+{
+ MenuBarEditor *mb = (MenuBarEditor *)mw->child( 0, "MenuBarEditor" );
+ if ( !mb )
+ return;
+ ts << makeIndent( indent ) << "<menubar>" << endl;
+ indent++;
+ MetaDataBase::setPropertyChanged( mb, "name", TRUE ); // FIXME: remove
+ saveObjectProperties( mb, ts, indent );
+
+ for ( int i = 0; i < (int)mb->count(); ++i ) {
+ MenuBarEditorItem *m = mb->item( i );
+ if ( !m )
+ continue;
+ if ( m->isSeparator() ) {
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ } else {
+ ts << makeIndent( indent ) << "<item text=\"" << entitize( m->menuText() )
+ << "\" name=\"" << entitize( m->menu()->name() ) << "\">" << endl;
+ indent++;
+ savePopupMenu( m->menu(), mw, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+ indent--;
+ ts << makeIndent( indent ) << "</menubar>" << endl;
+}
+
+void Resource::savePopupMenu( PopupMenuEditor *pm, QMainWindow *mw, QTextStream &ts, int indent )
+{
+ for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) {
+ QAction *a = i->action();
+ if ( ::qt_cast<QSeparatorAction*>(a) )
+ ts << makeIndent( indent ) << "<separator/>" << endl;
+ else if ( ::qt_cast<QDesignerAction*>(a) )
+ ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl;
+ else if ( ::qt_cast<QDesignerActionGroup*>(a) )
+ ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl;
+ PopupMenuEditor *s = i->subMenu();
+ if ( s && s->count() ) {
+ QString n = s->name();
+ ts << makeIndent( indent ) << "<item text=\"" << entitize( a->menuText() )
+ << "\" name=\"" << entitize( n )
+ << "\" accel=\"" << entitize( a->accel() )
+ << "\">" << endl;
+ indent++;
+ savePopupMenu( s, mw, ts, indent );
+ indent--;
+ ts << makeIndent( indent ) << "</item>" << endl;
+ }
+ }
+}
+
+void Resource::loadToolBars( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ QMainWindow *mw = ( (QMainWindow*)formwindow->mainContainer() );
+ QDesignerToolBar *tb = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "toolbar" ) {
+ Qt::Dock dock = (Qt::Dock)n.attribute( "dock" ).toInt();
+ tb = new QDesignerToolBar( mw, dock );
+ QDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "action" ) {
+ QAction *a = formwindow->findAction( n2.attribute( "name" ) );
+ if ( a ) {
+ a->addTo( tb );
+ tb->addAction( a );
+ }
+ } else if ( n2.tagName() == "separator" ) {
+ QAction *a = new QSeparatorAction( 0 );
+ a->addTo( tb );
+ tb->addAction( a );
+ } else if ( n2.tagName() == "widget" ) {
+ QWidget *w = (QWidget*)createObject( n2, tb );
+ QDesignerAction *a = new QDesignerAction( w, tb );
+ a->addTo( tb );
+ tb->addAction( a );
+ tb->installEventFilters( w );
+ } else if ( n2.tagName() == "property" ) {
+ setObjectProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::loadMenuBar( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ QMainWindow *mw = (QMainWindow*)formwindow->mainContainer();
+ MenuBarEditor *mb = new MenuBarEditor( formwindow, mw );
+ MetaDataBase::addEntry( mb );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "item" ) {
+ PopupMenuEditor * popup = new PopupMenuEditor( formwindow, mw );
+ loadPopupMenu( popup, n );
+ popup->setName( n.attribute( "name" ) );
+ mb->insertItem( n.attribute( "text" ), popup );
+ MetaDataBase::addEntry( popup );
+ } else if ( n.tagName() == "property" ) {
+ setObjectProperty( mb, n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "separator" ) {
+ mb->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void Resource::loadPopupMenu( PopupMenuEditor *p, const QDomElement &e )
+{
+ MetaDataBase::addEntry( p );
+ QDomElement n = e.firstChild().toElement();
+ QAction *a = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" || n.tagName() == "actiongroup") {
+ a = formwindow->findAction( n.attribute( "name" ) );
+ if ( a )
+ p->insert( a );
+ }
+ if ( n.tagName() == "item" ) {
+ PopupMenuEditorItem *i = p->at( p->find( a ) );
+ if ( i ) {
+ QString name = n.attribute( "name" );
+ formwindow->unify( i, name, TRUE );
+ i->setName( name );
+ MetaDataBase::addEntry( i );
+ loadPopupMenu( i->subMenu(), n );
+ }
+ } else if ( n.tagName() == "separator" ) {
+ a = new QSeparatorAction( 0 );
+ p->insert( a );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+bool Resource::saveFormCode( FormFile *formfile, LanguageInterface * /*langIface*/ )
+{
+ QString lang = formfile->project()->language();
+ if ( formfile->hasTempFileName() ||
+ formfile->code().isEmpty() ||
+ !formfile->hasFormCode() ||
+ !formfile->isModified(FormFile::WFormCode) )
+ return TRUE; // There is no code to be saved.
+ return saveCode( formfile->project()->makeAbsolute(formfile->codeFile()),
+ formfile->code() );
+}
+
+void Resource::loadExtraSource( FormFile *formfile, const QString &currFileName,
+ LanguageInterface *langIface, bool hasFunctions )
+{
+ QString lang = "Qt Script";
+ if ( MainWindow::self )
+ lang = MainWindow::self->currProject()->language();
+ LanguageInterface *iface = langIface;
+ if ( hasFunctions || !iface )
+ return;
+ QValueList<LanguageInterface::Function> functions;
+ QStringList forwards;
+ QStringList includesImpl;
+ QStringList includesDecl;
+ QStringList vars;
+ QValueList<LanguageInterface::Connection> connections;
+
+ iface->loadFormCode( formfile->formName(),
+ currFileName + iface->formCodeExtension(),
+ functions,
+ vars,
+ connections );
+
+ QFile f( formfile->project()->makeAbsolute( formfile->codeFile() ) );
+ QString code;
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ code = ts.read();
+ }
+ formfile->setCode( code );
+
+ if ( !MainWindow::self || !MainWindow::self->currProject()->isCpp() )
+ MetaDataBase::setupConnections( formfile, connections );
+
+ for ( QValueList<LanguageInterface::Function>::Iterator fit = functions.begin();
+ fit != functions.end(); ++fit ) {
+
+ if ( MetaDataBase::hasFunction( formfile->formWindow() ?
+ (QObject*)formfile->formWindow() :
+ (QObject*)formfile,
+ (*fit).name.latin1() ) ) {
+ QString access = (*fit).access;
+ if ( !MainWindow::self || !MainWindow::self->currProject()->isCpp() )
+ MetaDataBase::changeFunction( formfile->formWindow() ?
+ (QObject*)formfile->formWindow() :
+ (QObject*)formfile,
+ (*fit).name,
+ (*fit).name,
+ QString::null );
+ } else {
+ QString access = (*fit).access;
+ if ( access.isEmpty() )
+ access = "protected";
+ QString type = "function";
+ if ( (*fit).returnType == "void" )
+ type = "slot";
+ MetaDataBase::addFunction( formfile->formWindow() ?
+ (QObject*)formfile->formWindow() :
+ (QObject*)formfile,
+ (*fit).name.latin1(), "virtual", (*fit).access,
+ type, lang, (*fit).returnType );
+ }
+ }
+}
diff --git a/kdevdesigner/designer/resource.h b/kdevdesigner/designer/resource.h
new file mode 100644
index 00000000..abf21cc2
--- /dev/null
+++ b/kdevdesigner/designer/resource.h
@@ -0,0 +1,165 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef RESOURCE_H
+#define RESOURCE_H
+
+#include <qstring.h>
+#include <qtextstream.h>
+#include <qvariant.h>
+#include <qvaluelist.h>
+#include <qimage.h>
+#include "actiondnd.h"
+
+#include "metadatabase.h"
+
+class QWidget;
+class QObject;
+class QLayout;
+class QStyle;
+class QPalette;
+class FormWindow;
+class MainWindow;
+class QDomElement;
+class QDesignerGridLayout;
+class QListViewItem;
+class QMainWindow;
+struct LanguageInterface;
+class FormFile;
+class Project;
+class PopupMenuEditor;
+
+class Resource
+{
+public:
+ struct Image {
+ QImage img;
+ QString name;
+ bool operator==( const Image &i ) const {
+ return ( i.name == name &&
+ i.img == img );
+ }
+ };
+
+ Resource();
+ Resource( MainWindow* mw );
+ ~Resource();
+
+ void setWidget( FormWindow *w );
+ QWidget *widget() const;
+
+ bool load( FormFile *ff, Project *defProject = 0 );
+ bool load( FormFile *ff, QIODevice*, Project *defProject = 0 );
+ QString copy();
+
+ bool save( const QString& filename, bool formCodeOnly = FALSE);
+ bool save( QIODevice* );
+ void paste( const QString &cb, QWidget *parent );
+
+ static void saveImageData( const QImage &img, QTextStream &ts, int indent );
+ static void loadCustomWidgets( const QDomElement &e, Resource *r );
+ static void loadExtraSource( FormFile *formfile, const QString &currFileName,
+ LanguageInterface *langIface, bool hasFunctions );
+ static bool saveFormCode( FormFile *formfile, LanguageInterface *langIface );
+
+private:
+ void saveObject( QObject *obj, QDesignerGridLayout* grid, QTextStream &ts, int indent );
+ void saveChildrenOf( QObject* obj, QTextStream &ts, int indent );
+ void saveObjectProperties( QObject *w, QTextStream &ts, int indent );
+ void saveSetProperty( QObject *w, const QString &name, QVariant::Type t, QTextStream &ts, int indent );
+ void saveEnumProperty( QObject *w, const QString &name, QVariant::Type t, QTextStream &ts, int indent );
+ void saveProperty( QObject *w, const QString &name, const QVariant &value, QVariant::Type t, QTextStream &ts, int indent );
+ void saveProperty( const QVariant &value, QTextStream &ts, int indent );
+ void saveItems( QObject *obj, QTextStream &ts, int indent );
+ void saveItem( const QStringList &text, const QPtrList<QPixmap> &pixmaps, QTextStream &ts, int indent );
+ void saveItem( QListViewItem *i, QTextStream &ts, int indent );
+ void saveConnections( QTextStream &ts, int indent );
+ void saveCustomWidgets( QTextStream &ts, int indent );
+ void saveTabOrder( QTextStream &ts, int indent );
+ void saveColorGroup( QTextStream &ts, int indent, const QColorGroup &cg );
+ void saveColor( QTextStream &ts, int indent, const QColor &c );
+ void saveMetaInfoBefore( QTextStream &ts, int indent );
+ void saveMetaInfoAfter( QTextStream &ts, int indent );
+ void saveIncludeHints( QTextStream &ts, int indent );
+ void savePixmap( const QPixmap &p, QTextStream &ts, int indent, const QString &tagname = "pixmap" );
+ void saveActions( const QPtrList<QAction> &actions, QTextStream &ts, int indent );
+ void saveChildActions( QAction *a, QTextStream &ts, int indent );
+ void saveToolBars( QMainWindow *mw, QTextStream &ts, int indent );
+ void saveMenuBar( QMainWindow *mw, QTextStream &ts, int indent );
+ void savePopupMenu( PopupMenuEditor *pm, QMainWindow *mw, QTextStream &ts, int indent );
+
+ QObject *createObject( const QDomElement &e, QWidget *parent, QLayout* layout = 0 );
+ QWidget *createSpacer( const QDomElement &e, QWidget *parent, QLayout *layout, Qt::Orientation o );
+ void createItem( const QDomElement &e, QWidget *widget, QListViewItem *i = 0 );
+ void createColumn( const QDomElement &e, QWidget *widget );
+ void setObjectProperty( QObject* widget, const QString &prop, const QDomElement &e);
+ QString saveInCollection( const QImage &img );
+ QString saveInCollection( const QPixmap &pix ) { return saveInCollection( pix.convertToImage() ); }
+ QImage loadFromCollection( const QString &name );
+ void saveImageCollection( QTextStream &ts, int indent );
+ void loadImageCollection( const QDomElement &e );
+ void loadConnections( const QDomElement &e );
+ void loadTabOrder( const QDomElement &e );
+ void loadItem( const QDomElement &n, QPixmap &pix, QString &txt, bool &hasPixmap );
+ void loadActions( const QDomElement &n );
+ void loadChildAction( QObject *parent, const QDomElement &e );
+ void loadToolBars( const QDomElement &n );
+ void loadMenuBar( const QDomElement &n );
+ void loadPopupMenu( PopupMenuEditor *pm, const QDomElement &e );
+ QColorGroup loadColorGroup( const QDomElement &e );
+ QPixmap loadPixmap( const QDomElement &e, const QString &tagname = "pixmap" );
+
+private:
+ MainWindow *mainwindow;
+ FormWindow *formwindow;
+ QWidget* toplevel;
+ QValueList<Image> images;
+ bool copying, pasting;
+ bool mainContainerSet;
+ QStringList knownNames;
+ QStringList usedCustomWidgets;
+ QListViewItem *lastItem;
+
+ QValueList<MetaDataBase::Include> metaIncludes;
+ QValueList<MetaDataBase::Variable> metaVariables;
+ QStringList metaForwards;
+ QStringList metaSignals;
+ MetaDataBase::MetaInfo metaInfo;
+ QMap<QString, QString> dbControls;
+ QMap<QString, QStringList> dbTables;
+ QMap<QString, QWidget*> widgets;
+ QString exportMacro;
+ bool hadGeometry;
+ QMap<QString, QValueList<MetaDataBase::Connection> > langConnections;
+ QString currFileName;
+ LanguageInterface *langIface;
+ bool hasFunctions;
+ QStringList includeHints;
+
+ QString uiFileVersion;
+};
+
+#endif
diff --git a/kdevdesigner/designer/richtextfontdialog.ui b/kdevdesigner/designer/richtextfontdialog.ui
new file mode 100644
index 00000000..c55343ad
--- /dev/null
+++ b/kdevdesigner/designer/richtextfontdialog.ui
@@ -0,0 +1,347 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>RichTextFontDialog</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>RichTextFontDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>255</width>
+ <height>158</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Font Properties</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>default</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fontCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Rel. &amp;size:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fontSizeCombo</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer13</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>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;olor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>colorButton</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1" rowspan="1" colspan="2">
+ <item>
+ <property name="text">
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-4</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>-1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+1</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+2</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>+4</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>fontSizeCombo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="insertionPolicy">
+ <enum>AtTop</enum>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="2" column="1">
+ <property name="name">
+ <cstring>colorButton</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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="paletteBackgroundColor">
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer14</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="Line" row="2" column="0">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout15</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer12</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>colorButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>selectColor()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>RichTextFontDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>fontCombo</tabstop>
+ <tabstop>fontSizeCombo</tabstop>
+ <tabstop>colorButton</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">richtextfontdialog.ui.h</include>
+</includes>
+<variables>
+ <variable>QString font</variable>
+ <variable>QColor color</variable>
+ <variable>QString size</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>selectColor()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+ <slot returnType="QString">getSize()</slot>
+ <slot returnType="QString">getColor()</slot>
+ <slot returnType="QString">getFont()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/richtextfontdialog.ui.h b/kdevdesigner/designer/richtextfontdialog.ui.h
new file mode 100644
index 00000000..8a3dd4c8
--- /dev/null
+++ b/kdevdesigner/designer/richtextfontdialog.ui.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+#include <qcolordialog.h>
+#include <qfontdatabase.h>
+
+void RichTextFontDialog::init()
+{
+ QFontDatabase *db = new QFontDatabase();
+ fontCombo->insertStringList( db->families() );
+}
+
+void RichTextFontDialog::selectColor()
+{
+ color = QColorDialog::getColor( "", this );
+ if( color.isValid() )
+ colorButton->setPaletteBackgroundColor( color );
+}
+
+void RichTextFontDialog::accept()
+{
+ size = fontSizeCombo->currentText();
+ font = fontCombo->currentText();
+ done( Accepted );
+}
+
+void RichTextFontDialog::reject()
+{
+ done( Rejected );
+}
+
+QString RichTextFontDialog::getSize()
+{
+ return size;
+}
+
+QString RichTextFontDialog::getColor()
+{
+ return color.name();
+}
+
+QString RichTextFontDialog::getFont()
+{
+ return font;
+}
diff --git a/kdevdesigner/designer/sizehandle.cpp b/kdevdesigner/designer/sizehandle.cpp
new file mode 100644
index 00000000..a63a3404
--- /dev/null
+++ b/kdevdesigner/designer/sizehandle.cpp
@@ -0,0 +1,388 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler needs this here
+
+#include "sizehandle.h"
+#include "formwindow.h"
+#include "widgetfactory.h"
+
+#include <qwidget.h>
+#include <qapplication.h>
+#include <qlabel.h>
+#include <klocale.h>
+
+SizeHandle::SizeHandle( FormWindow *parent, Direction d, WidgetSelection *s )
+ : QWidget( parent )
+{
+ active = TRUE;
+ setBackgroundMode( active ? PaletteText : PaletteDark );
+ setFixedSize( 6, 6 );
+ widget = 0;
+ dir =d ;
+ setMouseTracking( FALSE );
+ formWindow = parent;
+ sel = s;
+ updateCursor();
+}
+
+void SizeHandle::updateCursor()
+{
+ if ( !active ) {
+ setCursor( arrowCursor );
+ return;
+ }
+
+ switch ( dir ) {
+ case LeftTop:
+ setCursor( sizeFDiagCursor );
+ break;
+ case Top:
+ setCursor( sizeVerCursor );
+ break;
+ case RightTop:
+ setCursor( sizeBDiagCursor );
+ break;
+ case Right:
+ setCursor( sizeHorCursor );
+ break;
+ case RightBottom:
+ setCursor( sizeFDiagCursor );
+ break;
+ case Bottom:
+ setCursor( sizeVerCursor );
+ break;
+ case LeftBottom:
+ setCursor( sizeBDiagCursor );
+ break;
+ case Left:
+ setCursor( sizeHorCursor );
+ break;
+ }
+}
+
+void SizeHandle::setActive( bool a )
+{
+ active = a;
+ setBackgroundMode( active ? PaletteText : PaletteDark );
+ updateCursor();
+}
+
+void SizeHandle::setWidget( QWidget *w )
+{
+ widget = w;
+}
+
+void SizeHandle::paintEvent( QPaintEvent * )
+{
+ if ( ( (FormWindow*)parentWidget() )->currentWidget() != widget )
+ return;
+ QPainter p( this );
+ p.setPen( blue );
+ p.drawRect( 0, 0, width(), height() );
+}
+
+void SizeHandle::mousePressEvent( QMouseEvent *e )
+{
+ if ( !widget || e->button() != LeftButton || !active )
+ return;
+ oldPressPos = e->pos();
+ geom = origGeom = QRect( widget->pos(), widget->size() );
+}
+
+void SizeHandle::mouseMoveEvent( QMouseEvent *e )
+{
+ if ( !widget || ( e->state() & LeftButton ) != LeftButton || !active )
+ return;
+ QPoint rp = mapFromGlobal( e->globalPos() );
+ QPoint d = oldPressPos - rp;
+ oldPressPos = rp;
+ QPoint checkPos = widget->parentWidget()->mapFromGlobal( e->globalPos() );
+ QRect pr = widget->parentWidget()->rect();
+
+ // ##### move code around a bit to reduce duplicated code here
+ switch ( dir ) {
+ case LeftTop: {
+ if ( checkPos.x() > pr.width() - 2 * width() || checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dx = widget->width() - w;
+ int dy = widget->height() - h;
+ trySetGeometry( widget, widget->x() + dx, widget->y() + dy, w, h );
+ } break;
+ case Top: {
+ if ( checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dy = widget->height() - h;
+ trySetGeometry( widget, widget->x(), widget->y() + dy, widget->width(), h );
+ } break;
+ case RightTop: {
+ if ( checkPos.x() < 2 * width() || checkPos.y() > pr.height() - 2 * height() )
+ return;
+ int h = geom.height() + d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ int dy = widget->height() - h;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ trySetGeometry( widget, widget->x(), widget->y() + dy, w, h );
+ } break;
+ case Right: {
+ if ( checkPos.x() < 2 * width() )
+ return;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ tryResize( widget, w, widget->height() );
+ } break;
+ case RightBottom: {
+ if ( checkPos.x() < 2 * width() || checkPos.y() < 2 * height() )
+ return;
+ int w = geom.width() - d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ tryResize( widget, w, h );
+ } break;
+ case Bottom: {
+ if ( checkPos.y() < 2 * height() )
+ return;
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ tryResize( widget, widget->width(), h );
+ } break;
+ case LeftBottom: {
+ if ( checkPos.x() > pr.width() - 2 * width() || checkPos.y() < 2 * height() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int dx = widget->width() - w;
+ int h = geom.height() - d.y();
+ geom.setHeight( h );
+ h = ( h / formWindow->grid().y() ) * formWindow->grid().y();
+ trySetGeometry( widget, widget->x() + dx, widget->y(), w, h );
+ } break;
+ case Left: {
+ if ( checkPos.x() > pr.width() - 2 * width() )
+ return;
+ int w = geom.width() + d.x();
+ geom.setWidth( w );
+ w = ( w / formWindow->grid().x() ) * formWindow->grid().x();
+ int dx = widget->width() - w;
+ trySetGeometry( widget, widget->x() + dx, widget->y(), w, widget->height() );
+ } break;
+ }
+
+ QPoint p = pos();
+ sel->updateGeometry();
+ oldPressPos += ( p - pos() );
+
+ formWindow->sizePreview()->setText( i18n( "%1/%2" ).arg( widget->width() ).arg( widget->height() ) );
+ formWindow->sizePreview()->adjustSize();
+ QRect lg( formWindow->mapFromGlobal( e->globalPos() ) + QPoint( 16, 16 ),
+ formWindow->sizePreview()->size() );
+ formWindow->checkPreviewGeometry( lg );
+ formWindow->sizePreview()->setGeometry( lg );
+ formWindow->sizePreview()->show();
+ formWindow->sizePreview()->raise();
+ if ( WidgetFactory::layoutType( widget ) != WidgetFactory::NoLayout )
+ formWindow->updateChildSelections( widget );
+}
+
+void SizeHandle::mouseReleaseEvent( QMouseEvent *e )
+{
+ if ( e->button() != LeftButton || !active )
+ return;
+
+ formWindow->sizePreview()->hide();
+ if ( geom != widget->geometry() )
+ formWindow->commandHistory()->addCommand( new ResizeCommand( i18n( "Resize" ),
+ formWindow,
+ widget, origGeom,
+ widget->geometry() ) );
+ formWindow->emitUpdateProperties( widget );
+}
+
+void SizeHandle::trySetGeometry( QWidget *w, int x, int y, int width, int height )
+{
+ int minw = QMAX( w->minimumSizeHint().width(), w->minimumSize().width() );
+ minw = QMAX( minw, 2 * formWindow->grid().x() );
+ int minh = QMAX( w->minimumSizeHint().height(), w->minimumSize().height() );
+ minh = QMAX( minh, 2 * formWindow->grid().y() );
+ if ( QMAX( minw, width ) > w->maximumWidth() ||
+ QMAX( minh, height ) > w->maximumHeight() )
+ return;
+ if ( width < minw && x != w->x() )
+ x -= minw - width;
+ if ( height < minh && y != w->y() )
+ y -= minh - height;
+ w->setGeometry( x, y, QMAX( minw, width ), QMAX( minh, height ) );
+}
+
+void SizeHandle::tryResize( QWidget *w, int width, int height )
+{
+ int minw = QMAX( w->minimumSizeHint().width(), w->minimumSize().width() );
+ minw = QMAX( minw, 16 );
+ int minh = QMAX( w->minimumSizeHint().height(), w->minimumSize().height() );
+ minh = QMAX( minh, 16 );
+ w->resize( QMAX( minw, width ), QMAX( minh, height ) );
+}
+
+// ------------------------------------------------------------------------
+
+WidgetSelection::WidgetSelection( FormWindow *parent, QPtrDict<WidgetSelection> *selDict )
+ : selectionDict( selDict )
+{
+ formWindow = parent;
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ handles.insert( i, new SizeHandle( formWindow, (SizeHandle::Direction)i, this ) );
+ }
+ hide();
+}
+
+void WidgetSelection::setWidget( QWidget *w, bool updateDict )
+{
+ if ( !w ) {
+ hide();
+ if ( updateDict )
+ selectionDict->remove( wid );
+ wid = 0;
+ return;
+ }
+
+ wid = w;
+ bool active = !wid->parentWidget() || WidgetFactory::layoutType( wid->parentWidget() ) == WidgetFactory::NoLayout;
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h ) {
+ h->setWidget( wid );
+ h->setActive( active );
+ }
+ }
+ updateGeometry();
+ show();
+ if ( updateDict )
+ selectionDict->insert( w, this );
+}
+
+bool WidgetSelection::isUsed() const
+{
+ return wid != 0;
+}
+
+void WidgetSelection::updateGeometry()
+{
+ if ( !wid || !wid->parentWidget() )
+ return;
+
+ QPoint p = wid->parentWidget()->mapToGlobal( wid->pos() );
+ p = formWindow->mapFromGlobal( p );
+ QRect r( p, wid->size() );
+
+ int w = 6;
+ int h = 6;
+
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *hndl = handles[ i ];
+ if ( !hndl )
+ continue;
+ switch ( i ) {
+ case SizeHandle::LeftTop:
+ hndl->move( r.x() - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::Top:
+ hndl->move( r.x() + r.width() / 2 - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::RightTop:
+ hndl->move( r.x() + r.width() - w / 2, r.y() - h / 2 );
+ break;
+ case SizeHandle::Right:
+ hndl->move( r.x() + r.width() - w / 2, r.y() + r.height() / 2 - h / 2 );
+ break;
+ case SizeHandle::RightBottom:
+ hndl->move( r.x() + r.width() - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::Bottom:
+ hndl->move( r.x() + r.width() / 2 - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::LeftBottom:
+ hndl->move( r.x() - w / 2, r.y() + r.height() - h / 2 );
+ break;
+ case SizeHandle::Left:
+ hndl->move( r.x() - w / 2, r.y() + r.height() / 2 - h / 2 );
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void WidgetSelection::hide()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h )
+ h->hide();
+ }
+}
+
+void WidgetSelection::show()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h ) {
+ h->show();
+ h->raise();
+ }
+ }
+}
+
+void WidgetSelection::update()
+{
+ for ( int i = SizeHandle::LeftTop; i <= SizeHandle::Left; ++i ) {
+ SizeHandle *h = handles[ i ];
+ if ( h )
+ h->update();
+ }
+}
+
+QWidget *WidgetSelection::widget() const
+{
+ return wid;
+}
diff --git a/kdevdesigner/designer/sizehandle.h b/kdevdesigner/designer/sizehandle.h
new file mode 100644
index 00000000..8d53977c
--- /dev/null
+++ b/kdevdesigner/designer/sizehandle.h
@@ -0,0 +1,97 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SIZEHANDLE_H
+#define SIZEHANDLE_H
+
+#include <qwidget.h>
+#include <qintdict.h>
+#include <qptrdict.h>
+
+class QMouseEvent;
+class FormWindow;
+class WidgetSelection;
+class QPaintEvent;
+
+class SizeHandle : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum Direction { LeftTop, Top, RightTop, Right, RightBottom, Bottom, LeftBottom, Left };
+
+ SizeHandle( FormWindow *parent, Direction d, WidgetSelection *s );
+ void setWidget( QWidget *w );
+ void setActive( bool a );
+ void updateCursor();
+
+ void setEnabled( bool ) {}
+
+protected:
+ void paintEvent( QPaintEvent *e );
+ void mousePressEvent( QMouseEvent *e );
+ void mouseMoveEvent( QMouseEvent *e );
+ void mouseReleaseEvent( QMouseEvent *e );
+
+private:
+ void trySetGeometry( QWidget *w, int x, int y, int width, int height );
+ void tryResize( QWidget *w, int width, int height );
+
+private:
+ QWidget *widget;
+ Direction dir;
+ QPoint oldPressPos;
+ FormWindow *formWindow;
+ WidgetSelection *sel;
+ QRect geom, origGeom;
+ bool active;
+
+};
+
+class WidgetSelection
+{
+public:
+ WidgetSelection( FormWindow *parent, QPtrDict<WidgetSelection> *selDict );
+
+ void setWidget( QWidget *w, bool updateDict = TRUE );
+ bool isUsed() const;
+
+ void updateGeometry();
+ void hide();
+ void show();
+ void update();
+
+ QWidget *widget() const;
+
+protected:
+ QIntDict<SizeHandle> handles;
+ QWidget *wid;
+ FormWindow *formWindow;
+ QPtrDict<WidgetSelection> *selectionDict;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/sourceeditor.cpp b/kdevdesigner/designer/sourceeditor.cpp
new file mode 100644
index 00000000..f3a035b5
--- /dev/null
+++ b/kdevdesigner/designer/sourceeditor.cpp
@@ -0,0 +1,320 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include <kiconloader.h>
+
+#include "sourceeditor.h"
+
+#include "formwindow.h"
+#include "metadatabase.h"
+#include "project.h"
+#include "mainwindow.h"
+#include "../interfaces/languageinterface.h"
+#include <qregexp.h>
+#include "project.h"
+#include "sourcefile.h"
+#include "hierarchyview.h"
+#include <qmessagebox.h>
+#include <qtextstream.h>
+#include "kdevdesigner_part.h"
+
+SourceEditor::SourceEditor( QWidget *parent, EditorInterface *iface, LanguageInterface *liface )
+ : QVBox( parent, 0, WDestructiveClose ), iFace( iface ), lIface( liface ), obj( 0 ), pro( 0 )
+{
+ iFace->addRef();
+ lIface->addRef();
+ editor = iFace->editor( MainWindow::self->areEditorsReadOnly(),
+ this, MainWindow::self->designerInterface() );
+ iFace->onBreakPointChange( MainWindow::self, SLOT( breakPointsChanged() ) );
+ resize( 600, 400 );
+ setIcon( SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()) );
+}
+
+SourceEditor::~SourceEditor()
+{
+ saveBreakPoints();
+ editor = 0;
+ if ( formWindow() ) {
+ formWindow()->formFile()->setCodeEdited( FALSE );
+ formWindow()->formFile()->setEditor( 0 );
+ } else if ( sourceFile() ) {
+ sourceFile()->setEditor( 0 );
+ if ( MainWindow::self->objectHierarchy()->sourceEditor() == this )
+ MainWindow::self->objectHierarchy()->setFormWindow( 0, 0 );
+ }
+ iFace->release();
+ lIface->release();
+ MainWindow::self->editorClosed( this );
+}
+
+void SourceEditor::setObject( QObject *o, Project *p )
+{
+ if ( sourceFile() )
+ sourceFile()->setEditor( 0 );
+ if ( formWindow() ) {
+ formWindow()->formFile()->setCodeEdited( FALSE );
+ formWindow()->formFile()->setEditor( 0 );
+ }
+ if ( ::qt_cast<FormWindow*>(o) )
+ ( (FormWindow*)o )->formFile()->setCodeEdited( TRUE );
+ save();
+ bool changed = FALSE;
+ if ( &(*obj) != o ) {
+ saveBreakPoints();
+ changed = TRUE;
+ }
+ obj = o;
+ pro = p;
+ if ( formWindow() ) {
+ if ( formWindow()->isFake() )
+ setCaption( formWindow()->project()->objectForFakeForm( formWindow() )->name() );
+ else
+ setCaption( obj->name() );
+ } else {
+ setCaption( sourceFile()->fileName() );
+ }
+ if ( sourceFile() )
+ sourceFile()->setEditor( this );
+ else if ( formWindow() )
+ formWindow()->formFile()->setEditor( this );
+ iFace->setText( sourceOfObject( obj, lang, iFace, lIface ) );
+ if ( pro && formWindow() ) {
+ if ( formWindow()->isFake() )
+ iFace->setContext( pro->objectForFakeFormFile( formWindow()->formFile() ) );
+ else
+ iFace->setContext( formWindow()->mainContainer() );
+ } else {
+ iFace->setContext( 0 );
+ }
+ if ( changed || sourceFile() )
+ iFace->setBreakPoints( MetaDataBase::breakPoints( o ) );
+ MainWindow::self->objectHierarchy()->showClasses( this );
+}
+
+QString SourceEditor::sourceOfObject( QObject *o, const QString &,
+ EditorInterface *, LanguageInterface * )
+{
+ QString txt;
+ if ( !o )
+ return txt;
+ if ( ::qt_cast<FormWindow*>(o) )
+ txt = ( (FormWindow*)o )->formFile()->code();
+ else if ( ::qt_cast<SourceFile*>(o) )
+ txt = ( (SourceFile*)o )->text();
+ return txt;
+}
+
+void SourceEditor::setFunction( const QString &func, const QString &clss )
+{
+ iFace->scrollTo( lIface->createFunctionStart( obj->name(), func, "", "" ), clss );
+}
+
+void SourceEditor::setClass( const QString &clss )
+{
+ iFace->scrollTo( clss, QString::null );
+}
+
+void SourceEditor::closeEvent( QCloseEvent *e )
+{
+ e->accept();
+ if ( !obj )
+ return;
+ if ( formWindow() ) {
+ save();
+ formWindow()->formFile()->cm = formWindow()->formFile()->isModified();
+ } else {
+ if ( !sourceFile()->closeEvent() )
+ e->ignore();
+ }
+}
+
+void SourceEditor::save()
+{
+ if ( !obj )
+ return;
+ if ( formWindow() )
+ formWindow()->formFile()->syncCode();
+ else if ( sourceFile() && sourceFile()->editor() )
+ sourceFile()->setText( iFace->text() );
+}
+
+QString SourceEditor::language() const
+{
+ return lang;
+}
+
+void SourceEditor::setLanguage( const QString &l )
+{
+ lang = l;
+}
+
+void SourceEditor::editCut()
+{
+ iFace->cut();
+}
+
+void SourceEditor::editCopy()
+{
+ iFace->copy();
+}
+
+void SourceEditor::editPaste()
+{
+ iFace->paste();
+}
+
+bool SourceEditor::editIsUndoAvailable()
+{
+ return iFace->isUndoAvailable();
+}
+
+bool SourceEditor::editIsRedoAvailable()
+{
+ return iFace->isRedoAvailable();
+}
+
+void SourceEditor::editUndo()
+{
+ iFace->undo();
+}
+
+void SourceEditor::editRedo()
+{
+ iFace->redo();
+}
+
+void SourceEditor::editSelectAll()
+{
+ iFace->selectAll();
+}
+
+void SourceEditor::configChanged()
+{
+ iFace->readSettings();
+}
+
+void SourceEditor::setModified( bool b )
+{
+ iFace->setModified( b );
+}
+
+void SourceEditor::refresh( bool allowSave )
+{
+ if ( allowSave )
+ save();
+ bool oldMod = iFace->isModified();
+ iFace->setText( sourceOfObject( obj, lang, iFace, lIface ) );
+ iFace->setModified( oldMod );
+}
+
+void SourceEditor::resetContext()
+{
+ if ( pro && formWindow() ) {
+ if ( formWindow()->isFake() )
+ iFace->setContext( pro->objectForFakeFormFile( formWindow()->formFile() ) );
+ else
+ iFace->setContext( formWindow()->mainContainer() );
+ } else {
+ iFace->setContext( 0 );
+ }
+}
+
+void SourceEditor::setFocus()
+{
+ if ( formWindow() )
+ formWindow()->formFile()->setCodeEdited( TRUE );
+ if ( editor )
+ editor->setFocus();
+}
+
+int SourceEditor::numLines() const
+{
+ return iFace->numLines();
+}
+
+void SourceEditor::saveBreakPoints()
+{
+ if ( !obj )
+ return;
+ QValueList<uint> l;
+ iFace->breakPoints( l );
+ MetaDataBase::setBreakPoints( obj, l );
+}
+
+void SourceEditor::clearStep()
+{
+ iFace->clearStep();
+}
+
+void SourceEditor::clearStackFrame()
+{
+ iFace->clearStackFrame();
+}
+
+void SourceEditor::resetBreakPoints()
+{
+ iFace->setBreakPoints( MetaDataBase::breakPoints( obj ) );
+}
+
+QString SourceEditor::text() const
+{
+ return iFace->text();
+}
+
+bool SourceEditor::isModified() const
+{
+ return iFace->isModified();
+}
+
+void SourceEditor::checkTimeStamp()
+{
+ if ( formWindow() )
+ formWindow()->formFile()->checkTimeStamp();
+ else if ( sourceFile() )
+ sourceFile()->checkTimeStamp();
+}
+
+bool SourceEditor::saveAs()
+{
+ if ( formWindow() )
+ return formWindow()->formFile()->saveAs();
+ else if ( sourceFile() )
+ return sourceFile()->saveAs();
+ return FALSE;
+}
+
+SourceFile *SourceEditor::sourceFile() const
+{
+ if ( !::qt_cast<SourceFile*>((QObject *)obj) )
+ return 0;
+ return (SourceFile*)(QObject*)obj;
+}
+
+FormWindow *SourceEditor::formWindow() const
+{
+ if ( !::qt_cast<FormWindow*>((QObject *)obj) )
+ return 0;
+ return (FormWindow*)(QObject*)obj;
+}
diff --git a/kdevdesigner/designer/sourceeditor.h b/kdevdesigner/designer/sourceeditor.h
new file mode 100644
index 00000000..a554b80c
--- /dev/null
+++ b/kdevdesigner/designer/sourceeditor.h
@@ -0,0 +1,106 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SOURCEEDITOR_H
+#define SOURCEEDITOR_H
+
+#include "../interfaces/editorinterface.h"
+#include <qvbox.h>
+#include <qguardedptr.h>
+
+class FormWindow;
+class QCloseEvent;
+struct LanguageInterface;
+class Project;
+class SourceFile;
+
+class SourceEditor : public QVBox
+{
+ Q_OBJECT
+
+public:
+ SourceEditor( QWidget *parent, EditorInterface *iface, LanguageInterface *liface );
+ ~SourceEditor();
+
+ void setObject( QObject *fw, Project *p );
+ QObject *object() const { return obj; }
+ Project *project() const { return pro; }
+ void setFunction( const QString &func, const QString &clss = QString::null );
+ void setClass( const QString &clss );
+ void save();
+ bool saveAs();
+ void setModified( bool b );
+ bool isModified() const;
+
+ static QString sourceOfObject( QObject *fw, const QString &lang, EditorInterface *iface, LanguageInterface *lIface );
+
+ QString language() const;
+ void setLanguage( const QString &l );
+
+ void editCut();
+ void editCopy();
+ void editPaste();
+ bool editIsUndoAvailable();
+ bool editIsRedoAvailable();
+ void editUndo();
+ void editRedo();
+ void editSelectAll();
+
+ void configChanged();
+ void refresh( bool allowSave );
+ void resetContext();
+
+ EditorInterface *editorInterface() const { return iFace; }
+
+ void setFocus();
+ int numLines() const;
+ void saveBreakPoints();
+ void clearStep();
+ void clearStackFrame();
+ void resetBreakPoints();
+
+ QString text() const;
+
+ void checkTimeStamp();
+
+ SourceFile *sourceFile() const;
+ FormWindow *formWindow() const;
+
+protected:
+ void closeEvent( QCloseEvent *e );
+
+
+private:
+ EditorInterface *iFace;
+ LanguageInterface *lIface;
+ QGuardedPtr<QObject> obj;
+ Project *pro;
+ QString lang;
+ QGuardedPtr<QWidget> editor;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/sourcefile.cpp b/kdevdesigner/designer/sourcefile.cpp
new file mode 100644
index 00000000..327dc58c
--- /dev/null
+++ b/kdevdesigner/designer/sourcefile.cpp
@@ -0,0 +1,298 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "sourcefile.h"
+#include <qfile.h>
+#include <qtextstream.h>
+#include "designerappiface.h"
+#include "sourceeditor.h"
+#include "metadatabase.h"
+#include "../interfaces/languageinterface.h"
+#include <qfiledialog.h>
+#include <qmessagebox.h>
+#include "mainwindow.h"
+#include "workspace.h"
+#include <stdlib.h>
+
+#include <kfiledialog.h>
+#include <klocale.h>
+
+SourceFile::SourceFile( const QString &fn, bool temp, Project *p )
+ : filename( fn ), ed( 0 ), fileNameTemp( temp ),
+ timeStamp( 0, p->makeAbsolute( fn ) ), pro( p ), pkg( FALSE )
+ , accepted( TRUE )
+{
+ iface = 0;
+
+ if ( !temp )
+ accepted = checkFileName( TRUE );
+
+ if (accepted) {
+ load();
+ pro->addSourceFile( this );
+ MetaDataBase::addEntry( this );
+ }
+
+}
+
+SourceFile::~SourceFile()
+{
+ if (iface)
+ delete iface;
+}
+
+QString SourceFile::text() const
+{
+ return txt;
+}
+
+void SourceFile::setText( const QString &s )
+{
+ txt = s;
+}
+
+bool SourceFile::save( bool ignoreModified )
+{
+ if ( fileNameTemp )
+ return saveAs();
+ if ( !ignoreModified && !isModified() )
+ return TRUE;
+ if ( ed )
+ ed->save();
+
+ if ( QFile::exists( pro->makeAbsolute( filename ) ) ) {
+ QString fn( pro->makeAbsolute( filename ) );
+#if defined(Q_OS_WIN32)
+ fn += ".bak";
+#else
+ fn += "~";
+#endif
+ QFile f( pro->makeAbsolute( filename ) );
+ if ( f.open( IO_ReadOnly ) ) {
+ QFile f2( fn );
+ if ( f2.open( IO_WriteOnly | IO_Translate ) ) {
+ QCString data( f.size() );
+ f.readBlock( data.data(), f.size() );
+ f2.writeBlock( data );
+ }
+ }
+ }
+
+ QFile f( pro->makeAbsolute( filename ) );
+ if ( !f.open( IO_WriteOnly | IO_Translate ) )
+ return saveAs();
+
+ QTextStream ts( &f );
+ ts << txt;
+ timeStamp.update();
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool SourceFile::saveAs( bool ignoreModified )
+{
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ QString filter;
+ if ( iface )
+ filter = iface->fileFilterList().join("\n");
+
+ QString old = filename;
+ QString initFn = pro->makeAbsolute( filename );
+ if ( ignoreModified ) {
+ QString dir = QStringList::split( ':', project()->iFace()->customSetting( "QTSCRIPT_PACKAGES" ) ).first();
+ initFn = QFileInfo( initFn ).fileName();
+ initFn.prepend( dir + "/" );
+ }
+ QString fn = KFileDialog::getSaveFileName( initFn, filter );
+ if ( fn.isEmpty() )
+ return FALSE;
+ fileNameTemp = FALSE;
+ filename = pro->makeRelative( fn );
+ if ( !checkFileName( TRUE ) ) {
+ filename = old;
+ return FALSE;
+ }
+ pro->setModified( TRUE );
+ timeStamp.setFileName( pro->makeAbsolute( filename ) );
+ if ( ed )
+ ed->setCaption( i18n( "Edit %1" ).arg( filename ) );
+ setModified( TRUE );
+ if ( pro->isDummy() ) {
+ QObject *o = ed->parent();
+ while ( o && !o->isA( "MainWindow" ) )
+ o = o->parent();
+ if ( o )
+ ((MainWindow *)o)->addRecentlyOpenedFile( fn );
+ }
+ return save( ignoreModified );
+}
+
+bool SourceFile::load()
+{
+ QFile f( pro->makeAbsolute( filename ) );
+ if ( !f.open( IO_ReadOnly ) )
+ return FALSE;
+ QTextStream ts( &f );
+ txt = ts.read();
+ timeStamp.update();
+ return TRUE;
+}
+
+DesignerSourceFile *SourceFile::iFace()
+{
+ if ( !iface )
+ iface = new DesignerSourceFileImpl( this );
+ return iface;
+}
+
+void SourceFile::setEditor( SourceEditor *e )
+{
+ ed = e;
+}
+
+bool SourceFile::isModified() const
+{
+ if ( !ed )
+ return FALSE;
+ return ed->isModified();
+}
+
+static QMap<QString, int> *extensionCounter;
+QString SourceFile::createUnnamedFileName( const QString &extension )
+{
+ if ( !extensionCounter )
+ extensionCounter = new QMap<QString, int>;
+ int count = -1;
+ QMap<QString, int>::Iterator it;
+ if ( ( it = extensionCounter->find( extension ) ) != extensionCounter->end() ) {
+ count = *it;
+ ++count;
+ extensionCounter->replace( extension, count );
+ } else {
+ count = 1;
+ extensionCounter->insert( extension, count );
+ }
+
+ return "unnamed" + QString::number( count ) + "." + extension;
+}
+
+void SourceFile::setModified( bool m )
+{
+ if ( !ed )
+ return;
+ ed->setModified( m );
+}
+
+bool SourceFile::closeEvent()
+{
+ if ( !isModified() && fileNameTemp ) {
+ pro->removeSourceFile( this );
+ return TRUE;
+ }
+
+ if ( !isModified() )
+ return TRUE;
+
+ if ( ed )
+ ed->save();
+
+ switch ( QMessageBox::warning( MainWindow::self, i18n( "Save Code" ),
+ i18n( "Save changes to '%1'?" ).arg( filename ),
+ i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
+ case 0: // save
+ if ( !save() )
+ return FALSE;
+ break;
+ case 1: // don't save
+ load();
+ if ( ed )
+ ed->editorInterface()->setText( txt );
+ if ( fileNameTemp ) {
+ pro->removeSourceFile( this );
+ return TRUE;
+ }
+ if ( MainWindow::self )
+ MainWindow::self->workspace()->update();
+ break;
+ case 2: // cancel
+ return FALSE;
+ default:
+ break;
+ }
+ setModified( FALSE );
+ return TRUE;
+}
+
+bool SourceFile::close()
+{
+ if ( !ed )
+ return TRUE;
+ return ed->close();
+}
+
+Project *SourceFile::project() const
+{
+ return pro;
+}
+
+void SourceFile::checkTimeStamp()
+{
+ if ( timeStamp.isUpToDate() )
+ return;
+ timeStamp.update();
+ if ( QMessageBox::information( MainWindow::self, i18n( "Qt Designer" ),
+ i18n( "File '%1' has been changed outside Qt Designer.\n"
+ "Do you want to reload it?" ).arg( filename ),
+ i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) {
+ load();
+ if ( ed )
+ ed->editorInterface()->setText( txt );
+ }
+}
+
+bool SourceFile::checkFileName( bool allowBreak )
+{
+ SourceFile *sf = pro->findSourceFile( filename, this );
+ if ( sf )
+ QMessageBox::warning( MainWindow::self, i18n( "Invalid Filename" ),
+ i18n( "The project already contains a source file with \n"
+ "filename '%1'. Please choose a new filename." ).arg( filename ) );
+ while ( sf ) {
+ LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
+ QString filter;
+ if ( iface )
+ filter = iface->fileFilterList().join("\n");
+ QString fn;
+ while ( fn.isEmpty() ) {
+ fn = KFileDialog::getSaveFileName( pro->makeAbsolute( filename ), filter );
+ if ( allowBreak && fn.isEmpty() )
+ return FALSE;
+ }
+ filename = pro->makeRelative( fn );
+ sf = pro->findSourceFile( filename, this );
+ }
+ return TRUE;
+}
diff --git a/kdevdesigner/designer/sourcefile.h b/kdevdesigner/designer/sourcefile.h
new file mode 100644
index 00000000..438d9b4c
--- /dev/null
+++ b/kdevdesigner/designer/sourcefile.h
@@ -0,0 +1,86 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SOURCEFILE_H
+#define SOURCEFILE_H
+
+#include <qobject.h>
+#include "timestamp.h"
+
+struct DesignerSourceFile;
+class SourceEditor;
+class Project;
+
+class SourceFile : public QObject
+{
+ Q_OBJECT
+
+public:
+ SourceFile( const QString &fn, bool temp, Project *p );
+ ~SourceFile();
+
+ void setText( const QString &s );
+ void setModified( bool m );
+
+ bool save( bool ignoreModified = FALSE );
+ bool saveAs( bool ignoreModified = FALSE );
+ bool load();
+ bool close();
+ bool closeEvent();
+ Project *project() const;
+
+ QString text() const;
+ QString fileName() const { return filename; }
+ bool isModified() const;
+
+ void checkTimeStamp();
+
+ DesignerSourceFile *iFace();
+
+ void setEditor( SourceEditor *e );
+ SourceEditor *editor() const { return ed; }
+
+ static QString createUnnamedFileName( const QString &extension );
+
+ bool isAccepted() const { return accepted; }
+
+private:
+ bool checkFileName( bool allowBreak );
+
+private:
+ QString filename;
+ QString txt;
+ DesignerSourceFile *iface;
+ SourceEditor *ed;
+ bool fileNameTemp;
+ TimeStamp timeStamp;
+ Project *pro;
+ bool pkg;
+ bool accepted;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/startdialog.ui b/kdevdesigner/designer/startdialog.ui
new file mode 100644
index 00000000..1301a20a
--- /dev/null
+++ b/kdevdesigner/designer/startdialog.ui
@@ -0,0 +1,324 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>StartDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>StartDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>576</width>
+ <height>420</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>Qt Designer - New/Open</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget8</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;New File/Project</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QIconView" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>templateView</cstring>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Open File/Project</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ </hbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget9</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Recently Opened</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QIconView" row="0" column="0">
+ <property name="name">
+ <cstring>recentView</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ <property name="gridX">
+ <number>120</number>
+ </property>
+ <property name="resizeMode">
+ <enum>Adjust</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>fileInfoLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>2</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkShowInFuture</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do not show this dialog in the future</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <number>4144</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <number>0</number>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>doubleClicked(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>templateView</sender>
+ <signal>returnPressed(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>doubleClicked(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>onItem(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>recentItemChanged(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>onViewport()</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>clearFileInfo()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>returnPressed(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>recentView</sender>
+ <signal>selectionChanged(QIconViewItem*)</signal>
+ <receiver>StartDialogBase</receiver>
+ <slot>recentItemChanged(QIconViewItem*)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>recentItemChanged( QIconViewItem * )</slot>
+ <slot>clearFileInfo()</slot>
+ <slot>accept()</slot>
+ <slot>reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/startdialogimpl.cpp b/kdevdesigner/designer/startdialogimpl.cpp
new file mode 100644
index 00000000..e408e8a5
--- /dev/null
+++ b/kdevdesigner/designer/startdialogimpl.cpp
@@ -0,0 +1,182 @@
+#include <kiconloader.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qiconview.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qfiledialog.h>
+#include <qtabwidget.h>
+#include <qpoint.h>
+#include <qobjectlist.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qfileinfo.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qapplication.h>
+#include <qcheckbox.h>
+#include <qurl.h>
+
+#include "kdevdesigner_part.h"
+
+#include "mainwindow.h"
+#include "startdialogimpl.h"
+#include "designerapp.h"
+
+#include <klocale.h>
+
+FileDialog::FileDialog( const QString &dir, QWidget *parent )
+ : QFileDialog( dir, QString::null, parent )
+{
+}
+
+void FileDialog::accept()
+{
+ emit fileSelected();
+}
+
+
+StartDialog::StartDialog( QWidget *parent, const QString &templatePath )
+ : StartDialogBase( parent, 0 )
+{
+ newForm = new NewForm( templateView, templatePath );
+ recentFiles.clear();
+ initFileOpen();
+ showInFuture = TRUE;
+
+ connect( buttonHelp, SIGNAL( clicked() ),
+ MainWindow::self, SLOT( showDialogHelp() ) );
+ connect( recentView, SIGNAL( doubleClicked(QIconViewItem*) ),
+ this, SLOT( accept() ) );
+ connect( recentView, SIGNAL( returnPressed(QIconViewItem*) ),
+ this, SLOT( accept() ) );
+ connect( fd, SIGNAL( fileSelected() ), this, SLOT( accept() ) );
+}
+
+void StartDialog::accept()
+{
+ hide();
+ showInFuture = !checkShowInFuture->isChecked(); // means don't show it anymore
+
+ int tabindex = tabWidget->currentPageIndex();
+ QString filename;
+ if( !tabindex ) {
+ if ( !templateView->currentItem() )
+ return;
+ Project *pro = MainWindow::self->findProject( i18n( "<No Project>" ) );
+ if ( !pro )
+ return;
+ MainWindow::self->setCurrentProject( pro );
+ ( (NewItem*)templateView->currentItem() )->insert( pro );
+ } else if ( tabindex == 1 ) {
+ filename = fd->selectedFile();
+ } else if ( tabindex == 2 ) {
+ filename = recentFiles[recentView->currentItem()->index()];
+ }
+ if ( tabindex ) {
+ if ( !filename.isEmpty() ) {
+ QFileInfo fi( filename );
+ if ( fi.extension() == "pro" )
+ MainWindow::self->openProject( filename );
+ else
+ MainWindow::self->fileOpen( "", "", filename );
+ }
+ }
+
+ done( Accepted );
+}
+
+void StartDialog::reject()
+{
+ done( Rejected );
+}
+
+void StartDialog::recentItemChanged( QIconViewItem *item )
+{
+ QString msg( recentFiles[item->index()] );
+ QFileInfo f( recentFiles[item->index()] );
+ uint s = f.size();
+ QString unit( "B" );
+ if( s > 1024 ) {
+ s /= 1024;
+ unit = "KB";
+ }
+ if ( s > 1024 ) {
+ s /= 1024;
+ unit = "MB";
+ }
+ QDateTime dt( f.lastModified() );
+ QString date( dt.toString( "MMMM dd hh:mm" ));
+ msg = QString( "%1 (%2 %3) %4" ).arg(msg).arg(s).arg(unit).arg(date);
+ fileInfoLabel->setText( msg );
+}
+
+void StartDialog::clearFileInfo()
+{
+ fileInfoLabel->clear();
+}
+
+void StartDialog::setRecentlyFiles( QStringList &files )
+{
+ insertRecentItems( files, FALSE );
+}
+
+void StartDialog::setRecentlyProjects( QStringList &projects )
+{
+ insertRecentItems( projects, TRUE );
+}
+
+void StartDialog::insertRecentItems( QStringList &files, bool isProject )
+{
+ QString iconName = "designer_newform.png";
+ if ( isProject )
+ iconName = "designer_project.png";
+ QIconViewItem *item;
+ QStringList::iterator it = files.begin();
+ for( ; it != files.end(); ++it ) {
+ QFileInfo fi( *it );
+ item = new QIconViewItem( recentView, fi.fileName() );
+ recentFiles[recentView->index( item )] = *it;
+ item->setPixmap( BarIcon( iconName, KDevDesignerPartFactory::instance() ) );
+ item->setDragEnabled( FALSE );
+ }
+}
+
+void StartDialog::initFileOpen()
+{
+ QString encode = QDir::currentDirPath();
+ QUrl::encode( encode );
+ fd = new FileDialog( encode, this );
+ QPoint point( 0, 0 );
+ fd->reparent( tab, point );
+
+ QObjectList *l = fd->queryList( "QPushButton" );
+ QObjectListIt it( *l );
+ QObject *obj;
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ ((QPushButton*)obj)->hide();
+ }
+ delete l;
+
+ fd->setSizeGripEnabled ( FALSE );
+ tabLayout->addWidget( fd );
+
+ QPluginManager<ImportFilterInterface> manager( IID_ImportFilter, QApplication::libraryPaths(),
+ MainWindow::self->pluginDirectory() );
+ QStringList filterlist;
+ filterlist << i18n( "Designer Files (*.ui *.pro)" );
+ filterlist << i18n( "Qt User-Interface Files (*.ui)" );
+ filterlist << i18n( "QMAKE Project Files (*.pro)" );
+
+ QStringList list = manager.featureList();
+ for ( QStringList::Iterator it2 = list.begin(); it2 != list.end(); ++it2 )
+ filterlist << *it2;
+
+ filterlist << i18n( "All Files (*)" );
+ QString filters = filterlist.join( ";;" );
+ fd->setFilters( filters );
+
+ fd->show();
+}
diff --git a/kdevdesigner/designer/startdialogimpl.h b/kdevdesigner/designer/startdialogimpl.h
new file mode 100644
index 00000000..b29b5bf1
--- /dev/null
+++ b/kdevdesigner/designer/startdialogimpl.h
@@ -0,0 +1,80 @@
+/**********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef STARTDIALOGIMPL_H
+#define STARTDIALOGIMPL_H
+
+#include <qiconview.h>
+#include <qlistview.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfiledialog.h>
+#include <qmap.h>
+
+#include "newformimpl.h"
+#include "startdialog.h"
+
+class FileDialog : public QFileDialog
+{
+ Q_OBJECT
+
+public:
+ FileDialog( const QString &dir, QWidget *parent );
+
+protected slots:
+ void accept();
+
+signals:
+ void fileSelected();
+};
+
+
+class StartDialog : public StartDialogBase
+{
+ Q_OBJECT
+
+public:
+ StartDialog( QWidget *parent, const QString &templatePath );
+ void setRecentlyFiles( QStringList& );
+ void setRecentlyProjects( QStringList& );
+ bool showDialogInFuture() const { return showInFuture; }
+
+protected slots:
+ void recentItemChanged( QIconViewItem *item );
+ void clearFileInfo();
+ void accept();
+ void reject();
+
+private:
+ void initFileOpen();
+ void insertRecentItems( QStringList &files, bool isProject );
+ NewForm *newForm;
+ FileDialog *fd;
+ QMap<int, QString> recentFiles;
+ bool showInFuture;
+};
+
+#endif
diff --git a/kdevdesigner/designer/styledbutton.cpp b/kdevdesigner/designer/styledbutton.cpp
new file mode 100644
index 00000000..41389684
--- /dev/null
+++ b/kdevdesigner/designer/styledbutton.cpp
@@ -0,0 +1,295 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler needs this here
+#include "styledbutton.h"
+#include "formwindow.h"
+#include "pixmapchooser.h"
+#include <qcolordialog.h>
+#include <qpalette.h>
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qapplication.h>
+#include <qdragobject.h>
+#include <qstyle.h>
+
+StyledButton::StyledButton(QWidget* parent, const char* name)
+ : QButton( parent, name ), pix( 0 ), spix( 0 ), s( 0 ), formWindow( 0 ), mousePressed( FALSE )
+{
+ setMinimumSize( minimumSizeHint() );
+ setAcceptDrops( TRUE );
+
+ connect( this, SIGNAL(clicked()), SLOT(onEditor()));
+
+ setEditor( ColorEditor );
+}
+
+StyledButton::StyledButton( const QBrush& b, QWidget* parent, const char* name, WFlags f )
+ : QButton( parent, name, f ), spix( 0 ), s( 0 ), formWindow( 0 )
+{
+ col = b.color();
+ pix = b.pixmap();
+ setMinimumSize( minimumSizeHint() );
+}
+
+StyledButton::~StyledButton()
+{
+}
+
+void StyledButton::setEditor( EditorType e )
+{
+ if ( edit == e )
+ return;
+
+ edit = e;
+ update();
+}
+
+StyledButton::EditorType StyledButton::editor() const
+{
+ return edit;
+}
+
+void StyledButton::setColor( const QColor& c )
+{
+ col = c;
+ update();
+}
+
+void StyledButton::setPixmap( const QPixmap & pm )
+{
+ if ( !pm.isNull() ) {
+ delete pix;
+ pix = new QPixmap( pm );
+ } else {
+ delete pix;
+ pix = 0;
+ }
+ scalePixmap();
+}
+
+QColor StyledButton::color() const
+{
+ return col;
+}
+
+QPixmap* StyledButton::pixmap() const
+{
+ return pix;
+}
+
+bool StyledButton::scale() const
+{
+ return s;
+}
+
+void StyledButton::setScale( bool on )
+{
+ if ( s == on )
+ return;
+
+ s = on;
+ scalePixmap();
+}
+
+QSize StyledButton::sizeHint() const
+{
+ return QSize( 50, 25 );
+}
+
+QSize StyledButton::minimumSizeHint() const
+{
+ return QSize( 50, 25 );
+}
+
+void StyledButton::scalePixmap()
+{
+ delete spix;
+
+ if ( pix ) {
+ spix = new QPixmap( 6*width()/8, 6*height()/8 );
+ QImage img = pix->convertToImage();
+
+ spix->convertFromImage( s? img.smoothScale( 6*width()/8, 6*height()/8 ) : img );
+ } else {
+ spix = 0;
+ }
+
+ update();
+}
+
+void StyledButton::resizeEvent( QResizeEvent* e )
+{
+ scalePixmap();
+ QButton::resizeEvent( e );
+}
+
+void StyledButton::drawButton( QPainter *paint )
+{
+ style().drawPrimitive(QStyle::PE_ButtonBevel, paint, rect(), colorGroup(),
+ isDown() ? QStyle::Style_Sunken : QStyle::Style_Raised);
+ drawButtonLabel(paint);
+
+ if (hasFocus())
+ style().drawPrimitive(QStyle::PE_FocusRect, paint,
+ style().subRect(QStyle::SR_PushButtonFocusRect, this),
+ colorGroup(), QStyle::Style_Default);
+}
+
+void StyledButton::drawButtonLabel( QPainter *paint )
+{
+ QColor pen = isEnabled() ?
+ hasFocus() ? palette().active().buttonText() : palette().inactive().buttonText()
+ : palette().disabled().buttonText();
+ paint->setPen( pen );
+
+ if(!isEnabled()) {
+ paint->setBrush( QBrush( colorGroup().button() ) );
+ }
+ else if ( edit == PixmapEditor && spix ) {
+ paint->setBrush( QBrush( col, *spix ) );
+ paint->setBrushOrigin( width()/8, height()/8 );
+ } else
+ paint->setBrush( QBrush( col ) );
+
+ paint->drawRect( width()/8, height()/8, 6*width()/8, 6*height()/8 );
+}
+
+void StyledButton::onEditor()
+{
+ switch (edit) {
+ case ColorEditor: {
+ QColor c = QColorDialog::getColor( palette().active().background(), this );
+ if ( c.isValid() ) {
+ setColor( c );
+ emit changed();
+ }
+ } break;
+ case PixmapEditor: {
+ QPixmap p;
+ if ( pixmap() )
+ p = qChoosePixmap( this, formWindow, *pixmap() );
+ else
+ p = qChoosePixmap( this, formWindow, QPixmap() );
+ if ( !p.isNull() ) {
+ setPixmap( p );
+ emit changed();
+ }
+ } break;
+ default:
+ break;
+ }
+}
+
+void StyledButton::mousePressEvent(QMouseEvent* e)
+{
+ QButton::mousePressEvent(e);
+ mousePressed = TRUE;
+ pressPos = e->pos();
+}
+
+void StyledButton::mouseMoveEvent(QMouseEvent* e)
+{
+ QButton::mouseMoveEvent( e );
+#ifndef QT_NO_DRAGANDDROP
+ if ( !mousePressed )
+ return;
+ if ( ( pressPos - e->pos() ).manhattanLength() > QApplication::startDragDistance() ) {
+ if ( edit == ColorEditor ) {
+ QColorDrag *drg = new QColorDrag( col, this );
+ QPixmap pix( 25, 25 );
+ pix.fill( col );
+ QPainter p( &pix );
+ p.drawRect( 0, 0, pix.width(), pix.height() );
+ p.end();
+ drg->setPixmap( pix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ else if ( edit == PixmapEditor && pix && !pix->isNull() ) {
+ QImage img = pix->convertToImage();
+ QImageDrag *drg = new QImageDrag( img, this );
+ if(spix)
+ drg->setPixmap( *spix );
+ mousePressed = FALSE;
+ drg->dragCopy();
+ }
+ }
+#endif
+}
+
+#ifndef QT_NO_DRAGANDDROP
+void StyledButton::dragEnterEvent( QDragEnterEvent *e )
+{
+ setFocus();
+ if ( edit == ColorEditor && QColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( edit == PixmapEditor && QImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void StyledButton::dragLeaveEvent( QDragLeaveEvent * )
+{
+ if ( hasFocus() )
+ parentWidget()->setFocus();
+}
+
+void StyledButton::dragMoveEvent( QDragMoveEvent *e )
+{
+ if ( edit == ColorEditor && QColorDrag::canDecode( e ) )
+ e->accept();
+ else if ( edit == PixmapEditor && QImageDrag::canDecode( e ) )
+ e->accept();
+ else
+ e->ignore();
+}
+
+void StyledButton::dropEvent( QDropEvent *e )
+{
+ if ( edit == ColorEditor && QColorDrag::canDecode( e ) ) {
+ QColor color;
+ QColorDrag::decode( e, color );
+ setColor(color);
+ emit changed();
+ e->accept();
+ }
+ else if ( edit == PixmapEditor && QImageDrag::canDecode( e ) ) {
+ QImage img;
+ QImageDrag::decode( e, img );
+ QPixmap pm;
+ pm.convertFromImage(img);
+ setPixmap(pm);
+ emit changed();
+ e->accept();
+ } else {
+ e->ignore();
+ }
+}
+#endif // QT_NO_DRAGANDDROP
diff --git a/kdevdesigner/designer/styledbutton.h b/kdevdesigner/designer/styledbutton.h
new file mode 100644
index 00000000..882090c7
--- /dev/null
+++ b/kdevdesigner/designer/styledbutton.h
@@ -0,0 +1,103 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef STYLEDBUTTON_H
+#define STYLEDBUTTON_H
+
+#include <qbutton.h>
+#include <qpixmap.h>
+
+class QColor;
+class QBrush;
+class FormWindow;
+
+class StyledButton : public QButton
+{
+ Q_OBJECT
+
+ Q_PROPERTY( QColor color READ color WRITE setColor )
+ Q_PROPERTY( QPixmap pixmap READ pixmap WRITE setPixmap )
+ Q_PROPERTY( EditorType editor READ editor WRITE setEditor )
+ Q_PROPERTY( bool scale READ scale WRITE setScale )
+
+ Q_ENUMS( EditorType )
+
+public:
+ enum EditorType { ColorEditor, PixmapEditor };
+
+ StyledButton( QWidget* parent = 0, const char* name = 0 );
+ StyledButton( const QBrush& b, QWidget* parent = 0, const char* name = 0, WFlags f = 0 );
+ ~StyledButton();
+
+ void setEditor( EditorType );
+ EditorType editor() const;
+
+ void setColor( const QColor& );
+ void setPixmap( const QPixmap& );
+
+ QPixmap* pixmap() const;
+ QColor color() const;
+
+ void setScale( bool );
+ bool scale() const;
+
+ QSize sizeHint() const;
+ QSize minimumSizeHint() const;
+
+ void setFormWindow( FormWindow *fw ) { formWindow = fw; }
+
+public slots:
+ virtual void onEditor();
+
+signals:
+ void changed();
+
+protected:
+ void mousePressEvent(QMouseEvent*);
+ void mouseMoveEvent(QMouseEvent*);
+#ifndef QT_NO_DRAGANDDROP
+ void dragEnterEvent ( QDragEnterEvent * );
+ void dragMoveEvent ( QDragMoveEvent * );
+ void dragLeaveEvent ( QDragLeaveEvent * );
+ void dropEvent ( QDropEvent * );
+#endif // QT_NO_DRAGANDDROP
+ void drawButton( QPainter* );
+ void drawButtonLabel( QPainter* );
+ void resizeEvent( QResizeEvent* );
+ void scalePixmap();
+
+private:
+ QPixmap* pix;
+ QPixmap* spix; // the pixmap scaled down to fit into the button
+ QColor col;
+ EditorType edit;
+ bool s;
+ FormWindow *formWindow;
+ QPoint pressPos;
+ bool mousePressed;
+};
+
+#endif //STYLEDBUTTON_H
diff --git a/kdevdesigner/designer/syntaxhighlighter_html.cpp b/kdevdesigner/designer/syntaxhighlighter_html.cpp
new file mode 100644
index 00000000..cd0c2760
--- /dev/null
+++ b/kdevdesigner/designer/syntaxhighlighter_html.cpp
@@ -0,0 +1,160 @@
+/**********************************************************************
+**
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "syntaxhighlighter_html.h"
+#include "qstring.h"
+#include "qmap.h"
+#include "qapplication.h"
+
+
+SyntaxHighlighter_HTML::SyntaxHighlighter_HTML()
+ : QTextPreProcessor(), lastFormat( 0 ), lastFormatId( -1 )
+{
+ QFont f( qApp->font() );
+
+ addFormat(Standard, new QTextFormat(f, qApp->palette().color(QPalette::Active, QColorGroup::Text)));
+ addFormat(Keyword, new QTextFormat(f, qApp->palette().color(QPalette::Active, QColorGroup::Dark)));
+ addFormat(Attribute, new QTextFormat(f, qApp->palette().color(QPalette::Active, QColorGroup::Link)));
+ addFormat(AttribValue, new QTextFormat(f, qApp->palette().color(QPalette::Active, QColorGroup::LinkVisited)));
+}
+
+SyntaxHighlighter_HTML::~SyntaxHighlighter_HTML()
+{
+}
+
+void SyntaxHighlighter_HTML::process( QTextDocument *doc, QTextParagraph *string, int, bool invalidate )
+{
+
+ QTextFormat *formatStandard = format( Standard );
+ QTextFormat *formatKeyword = format( Keyword );
+ QTextFormat *formatAttribute = format( Attribute );
+ QTextFormat *formatAttribValue = format( AttribValue );
+
+ const int StateStandard = 0;
+ const int StateTag = 1;
+ const int StateAttribute = 2;
+ const int StateAttribVal = 3;
+
+ QString buffer = "";
+
+ int state = StateStandard;
+
+
+ if ( string->prev() ) {
+ if ( string->prev()->endState() == -1 )
+ process( doc, string->prev(), 0, FALSE );
+ state = string->prev()->endState();
+ }
+
+
+ int i = 0;
+ for ( ;; ) {
+ QChar c = string->at( i )->c;
+
+ if ( c == '<' ) {
+ if ( state != StateStandard )
+ string->setFormat( i - buffer.length(), buffer.length(), formatStandard, FALSE );
+ buffer = c;
+ state = StateTag;
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ }
+ else if ( c == '>' && ( state != StateStandard ) ) {
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ buffer = "";
+ state = StateStandard;
+ }
+ else if ( c == ' ' && state == StateTag ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( c == '=' && state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( c == '\"' && state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribVal;
+ }
+ else if ( c == '\"' && state == StateAttribVal ) {
+ buffer += c;
+ string->setFormat( i, 1, formatStandard, FALSE );
+ state = StateAttribute;
+ }
+ else if ( state == StateAttribute ) {
+ buffer += c;
+ string->setFormat( i, 1, formatAttribute, FALSE );
+ }
+ else if ( state == StateAttribVal ) {
+ buffer += c;
+ string->setFormat( i, 1, formatAttribValue, FALSE );
+ }
+ else if ( state == StateTag ) {
+ string->setFormat( i, 1, formatKeyword, FALSE );
+ buffer += c;
+ }
+ else if ( state == StateStandard ) {
+ string->setFormat( i, 1, formatStandard, FALSE );
+ }
+
+ i++;
+ if ( i >= string->length() )
+ break;
+ }
+
+ string->setEndState( state );
+ string->setFirstPreProcess( FALSE );
+
+ if ( invalidate && string->next() &&
+ !string->next()->firstPreProcess() && string->next()->endState() != -1 ) {
+ QTextParagraph *p = string->next();
+ while ( p ) {
+ if ( p->endState() == -1 )
+ return;
+ p->setEndState( -1 );
+ p = p->next();
+ }
+ }
+}
+
+QTextFormat *SyntaxHighlighter_HTML::format( int id )
+{
+ if ( lastFormatId == id && lastFormat )
+ return lastFormat;
+
+ QTextFormat *f = formats[ id ];
+ lastFormat = f ? f : formats[ 0 ];
+ lastFormatId = id;
+ return lastFormat;
+}
+
+void SyntaxHighlighter_HTML::addFormat( int id, QTextFormat *f )
+{
+ formats.insert( id, f );
+}
diff --git a/kdevdesigner/designer/syntaxhighlighter_html.h b/kdevdesigner/designer/syntaxhighlighter_html.h
new file mode 100644
index 00000000..4a135671
--- /dev/null
+++ b/kdevdesigner/designer/syntaxhighlighter_html.h
@@ -0,0 +1,57 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SYNTAXHIGHLIGHTER_HTML_H
+#define SYNTAXHIGHLIGHTER_HTML_H
+
+#include <./private/qrichtext_p.h>
+
+class SyntaxHighlighter_HTML : public QTextPreProcessor
+{
+public:
+
+ enum HTML {
+ Standard = 1,
+ Keyword,
+ Attribute,
+ AttribValue
+ };
+
+ SyntaxHighlighter_HTML();
+ virtual ~SyntaxHighlighter_HTML();
+ void process( QTextDocument *doc, QTextParagraph *string, int start, bool invalidate = TRUE );
+ QTextFormat *format( int id );
+
+private:
+ void addFormat( int id, QTextFormat *f );
+
+ QTextFormat *lastFormat;
+ int lastFormatId;
+ QIntDict<QTextFormat> formats;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/tableeditor.ui b/kdevdesigner/designer/tableeditor.ui
new file mode 100644
index 00000000..a6f10312
--- /dev/null
+++ b/kdevdesigner/designer/tableeditor.ui
@@ -0,0 +1,828 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>TableEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>TableEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>484</width>
+ <height>406</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Table</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTable" row="0" column="0">
+ <property name="name">
+ <cstring>table</cstring>
+ </property>
+ <property name="numRows">
+ <number>1</number>
+ </property>
+ <property name="numCols">
+ <number>1</number>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget" row="0" column="1">
+ <property name="name">
+ <cstring>TabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>columns_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Co&amp;lumns</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="2">
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QListBox" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>listColumns</cstring>
+ </property>
+ </widget>
+ <spacer row="3" 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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonColumnUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonColumnDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteColumn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Column</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewColumn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Column</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>labelTable</cstring>
+ </property>
+ <property name="text">
+ <string>Table:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="1">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelColumnPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonDeleteColPixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonChooseColPixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Label:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editColumnText</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>Label2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>labelFields</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Field:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboFields</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editColumnText</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboFields</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>labelTableValue</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;no table&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>rows_tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Rows</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="4" column="2">
+ <property name="name">
+ <cstring>Spacer3_2</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>
+ <widget class="QPushButton" row="4" column="1">
+ <property name="name">
+ <cstring>buttonRowUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item up.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="6" colspan="1">
+ <property name="name">
+ <cstring>listRows</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>buttonRowDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Move the selected item down.&lt;/b&gt;&lt;p&gt;The top-most column will be the first column of the list.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2_2</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>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>buttonNewRow</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Row</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonDeleteRow</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Row</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout7_2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Label:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editRowText</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>Label2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Pixmap:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemChoosePixmap</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout2_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelRowPixmap</cstring>
+ </property>
+ <property name="text">
+ <string>Label4</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonDeleteRowPixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_editcut.png"</pixmap>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Delete Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete the selected item's pixmap.&lt;/b&gt;&lt;p&gt;The pixmap in the current column of the selected item will be deleted.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonChooseRowPixmap</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>30</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select a Pixmap</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Select a pixmap file for the item.&lt;/b&gt;&lt;p&gt;The pixmap will be changed in the current column of the selected item.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editRowText</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listColumns</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentColumnChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listColumns</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentColumnChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>editColumnText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewColumn</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>newColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteColumn</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteColumnClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonColumnUp</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonColumnDown</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>columnDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>comboFields</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentFieldChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>listRows</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentRowChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>listRows</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>currentRowChanged(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>buttonNewRow</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>newRowClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteRow</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteRowClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRowUp</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowUpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRowDown</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowDownClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseRowPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>chooseRowPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteColPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteColPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editRowText</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>rowTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonChooseColPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>chooseColPixmapClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDeleteRowPixmap</sender>
+ <signal>clicked()</signal>
+ <receiver>TableEditorBase</receiver>
+ <slot>deleteRowPixmapClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>table</tabstop>
+ <tabstop>TabWidget</tabstop>
+ <tabstop>listColumns</tabstop>
+ <tabstop>buttonNewColumn</tabstop>
+ <tabstop>buttonDeleteColumn</tabstop>
+ <tabstop>comboFields</tabstop>
+ <tabstop>editColumnText</tabstop>
+ <tabstop>buttonDeleteColPixmap</tabstop>
+ <tabstop>buttonChooseColPixmap</tabstop>
+ <tabstop>buttonColumnUp</tabstop>
+ <tabstop>buttonColumnDown</tabstop>
+ <tabstop>buttonApply</tabstop>
+ <tabstop>listRows</tabstop>
+ <tabstop>buttonNewRow</tabstop>
+ <tabstop>buttonDeleteRow</tabstop>
+ <tabstop>editRowText</tabstop>
+ <tabstop>buttonDeleteRowPixmap</tabstop>
+ <tabstop>buttonChooseRowPixmap</tabstop>
+ <tabstop>buttonRowUp</tabstop>
+ <tabstop>buttonRowDown</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">qtable.h</include>
+</includes>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">chooseRowPixmapClicked()</slot>
+ <slot access="protected">columnTextChanged( const QString &amp; )</slot>
+ <slot access="protected">columnUpClicked()</slot>
+ <slot access="protected">currentColumnChanged( QListBoxItem * )</slot>
+ <slot access="protected">currentFieldChanged( const QString &amp; )</slot>
+ <slot access="protected">currentRowChanged( QListBoxItem * )</slot>
+ <slot access="protected">deleteColPixmapClicked()</slot>
+ <slot access="protected">deleteColumnClicked()</slot>
+ <slot access="protected">deleteRowClicked()</slot>
+ <slot access="protected">deleteRowPixmapClicked()</slot>
+ <slot access="protected">newColumnClicked()</slot>
+ <slot access="protected">newRowClicked()</slot>
+ <slot access="protected">chooseColPixmapClicked()</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">rowDownClicked()</slot>
+ <slot access="protected">rowTextChanged( const QString &amp; )</slot>
+ <slot access="protected">rowUpClicked()</slot>
+ <slot access="protected">columnDownClicked()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/tableeditorimpl.cpp b/kdevdesigner/designer/tableeditorimpl.cpp
new file mode 100644
index 00000000..b2a440de
--- /dev/null
+++ b/kdevdesigner/designer/tableeditorimpl.cpp
@@ -0,0 +1,494 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "tableeditorimpl.h"
+#ifndef QT_NO_TABLE
+#include <qtable.h>
+#endif
+#include "formwindow.h"
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qheader.h>
+#include <qlistbox.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include "pixmapchooser.h"
+#include "command.h"
+#include <qvaluelist.h>
+#include <qtabwidget.h>
+#include <qdatatable.h>
+#include "project.h"
+#include "metadatabase.h"
+#include "mainwindow.h"
+
+#include <klocale.h>
+
+TableEditor::TableEditor( QWidget* parent, QWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl )
+ : TableEditorBase( parent, name, modal, fl ),
+#ifndef QT_NO_TABLE
+ editTable( (QTable*)editWidget ),
+#endif
+ formWindow( fw )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+#ifndef QT_NO_TABLE
+ labelColumnPixmap->setText( "" );
+ labelRowPixmap->setText( "" );
+
+#ifndef QT_NO_SQL
+ if ( !::qt_cast<QDataTable*>(editTable) )
+#endif
+ {
+ labelFields->hide();
+ comboFields->hide();
+ labelTable->hide();
+ labelTableValue->hide();
+ }
+#ifndef QT_NO_SQL
+ if ( ::qt_cast<QDataTable*>(editTable) ) {
+ // ## why does this behave weird?
+ // TabWidget->removePage( rows_tab );
+ // rows_tab->hide();
+ // ## do this in the meantime...
+ TabWidget->setTabEnabled( rows_tab, FALSE );
+ }
+
+ if ( formWindow->project() && ::qt_cast<QDataTable*>(editTable) ) {
+ QStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
+ if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) {
+ QStringList fields;
+ fields << "<no field>";
+ fields += formWindow->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] );
+ comboFields->insertStringList( fields );
+ }
+ if ( !lst[ 1 ].isEmpty() )
+ labelTableValue->setText( lst[ 1 ] );
+ }
+#endif
+
+ readFromTable();
+#endif
+}
+
+TableEditor::~TableEditor()
+{
+}
+
+void TableEditor::columnDownClicked()
+{
+ if ( listColumns->currentItem() == -1 ||
+ listColumns->currentItem() == (int)listColumns->count() - 1 ||
+ listColumns->count() < 2 )
+ return;
+ saveFieldMap();
+ int index = listColumns->currentItem() + 1;
+ QListBoxItem *i = listColumns->item( listColumns->currentItem() );
+ listColumns->takeItem( i );
+ listColumns->insertItem( i, index );
+ listColumns->setCurrentItem( i );
+ readColumns();
+ restoreFieldMap();
+ currentColumnChanged( i );
+}
+
+void TableEditor::columnTextChanged( const QString &s )
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ listColumns->blockSignals( TRUE );
+ listColumns->changeItem( s, listColumns->currentItem() );
+ listColumns->blockSignals( FALSE );
+#ifndef QT_NO_TABLE
+ if ( table->horizontalHeader()->iconSet( listColumns->currentItem() ) )
+ table->horizontalHeader()->setLabel( listColumns->currentItem(),
+ *table->horizontalHeader()->iconSet( listColumns->currentItem() ), s );
+ else
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), s );
+#endif
+}
+
+void TableEditor::columnUpClicked()
+{
+ if ( listColumns->currentItem() <= 0 ||
+ listColumns->count() < 2 )
+ return;
+ saveFieldMap();
+ int index = listColumns->currentItem() - 1;
+ QListBoxItem *i = listColumns->item( listColumns->currentItem() );
+ listColumns->takeItem( i );
+ listColumns->insertItem( i, index );
+ listColumns->setCurrentItem( i );
+ readColumns();
+ restoreFieldMap();
+ currentColumnChanged( i );
+}
+
+void TableEditor::currentColumnChanged( QListBoxItem *i )
+{
+ if ( !i )
+ return;
+ editColumnText->blockSignals( TRUE );
+ editColumnText->setText( i->text() );
+ if ( i->pixmap() )
+ labelColumnPixmap->setPixmap( *i->pixmap() );
+ else
+ labelColumnPixmap->setText( "" );
+ editColumnText->blockSignals( FALSE );
+
+#ifndef QT_NO_SQL
+ if ( ::qt_cast<QDataTable*>(editTable) ) {
+ QString s = *fieldMap.find( listColumns->index( i ) );
+ if ( s.isEmpty() )
+ comboFields->setCurrentItem( 0 );
+ else if ( comboFields->listBox()->findItem( s ) )
+ comboFields->setCurrentItem( comboFields->listBox()->index( comboFields->listBox()->findItem( s ) ) );
+ else
+ comboFields->lineEdit()->setText( s );
+ }
+#endif
+}
+
+void TableEditor::currentFieldChanged( const QString &s )
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ fieldMap.remove( listColumns->currentItem() );
+ fieldMap.insert( listColumns->currentItem(), s );
+ editColumnText->blockSignals( TRUE ); //## necessary
+ QString newColText = s.mid(0,1).upper() + s.mid(1);
+ editColumnText->setText( newColText );
+ columnTextChanged( newColText );
+ editColumnText->blockSignals( FALSE );
+}
+
+void TableEditor::currentRowChanged( QListBoxItem *i )
+{
+ if ( !i )
+ return;
+ editRowText->blockSignals( TRUE );
+ editRowText->setText( i->text() );
+ if ( i->pixmap() )
+ labelRowPixmap->setPixmap( *i->pixmap() );
+ else
+ labelRowPixmap->setText( "" );
+ editRowText->blockSignals( FALSE );
+}
+
+void TableEditor::deleteColumnClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+#ifndef QT_NO_TABLE
+ table->setNumCols( table->numCols() - 1 );
+ delete listColumns->item( listColumns->currentItem() );
+ readColumns();
+ if ( listColumns->firstItem() ) {
+ listColumns->setCurrentItem( listColumns->firstItem() );
+ listColumns->setSelected( listColumns->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::deleteRowClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef QT_NO_TABLE
+ table->setNumRows( table->numRows() - 1 );
+ delete listRows->item( listRows->currentItem() );
+ readRows();
+ if ( listRows->firstItem() ) {
+ listRows->setCurrentItem( listRows->firstItem() );
+ listRows->setSelected( listRows->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::newColumnClicked()
+{
+#ifndef QT_NO_TABLE
+ table->setNumCols( table->numCols() + 1 );
+ QMap<QString, bool> m;
+ for ( int i = 0; i < table->numCols() - 1; ++i )
+ m.insert( table->horizontalHeader()->label( i ), TRUE );
+ int n = table->numCols() - 1;
+ QString t = QString::number( n );
+ while ( m.find( t ) != m.end() )
+ t = QString::number( ++n );
+ table->horizontalHeader()->setLabel( table->numCols() - 1, t );
+ listColumns->insertItem( t );
+ QListBoxItem *item = listColumns->item( listColumns->count() - 1 );
+ listColumns->setCurrentItem( item );
+ listColumns->setSelected( item, TRUE );
+#ifndef QT_NO_SQL
+ if ( ::qt_cast<QDataTable*>(editTable) ) {
+ comboFields->setFocus();
+ } else
+#endif
+ {
+ editColumnText->setFocus();
+ editColumnText->selectAll();
+ }
+#endif
+}
+
+void TableEditor::newRowClicked()
+{
+#ifndef QT_NO_TABLE
+ table->setNumRows( table->numRows() + 1 );
+ QMap<QString, bool> m;
+ for ( int i = 0; i < table->numRows() - 1; ++i )
+ m.insert( table->verticalHeader()->label( i ), TRUE );
+ int n = table->numRows() - 1;
+ QString t = QString::number( n );
+ while ( m.find( t ) != m.end() )
+ t = QString::number( ++n );
+ table->verticalHeader()->setLabel( table->numRows() - 1, t );
+ listRows->insertItem( t );
+ QListBoxItem *item = listRows->item( listRows->count() - 1 );
+ listRows->setCurrentItem( item );
+ listRows->setSelected( item, TRUE );
+#endif
+}
+
+void TableEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void TableEditor::rowDownClicked()
+{
+ if ( listRows->currentItem() == -1 ||
+ listRows->currentItem() == (int)listRows->count() - 1 ||
+ listRows->count() < 2 )
+ return;
+ int index = listRows->currentItem() + 1;
+ QListBoxItem *i = listRows->item( listRows->currentItem() );
+ listRows->takeItem( i );
+ listRows->insertItem( i, index );
+ listRows->setCurrentItem( i );
+ readRows();
+}
+
+void TableEditor::rowTextChanged( const QString &s )
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef QT_NO_TABLE
+ listRows->changeItem( s, listRows->currentItem() );
+ if ( table->verticalHeader()->iconSet( listRows->currentItem() ) )
+ table->verticalHeader()->setLabel( listRows->currentItem(),
+ *table->verticalHeader()->iconSet( listRows->currentItem() ), s );
+ else
+ table->verticalHeader()->setLabel( listRows->currentItem(), s );
+#endif
+}
+
+void TableEditor::rowUpClicked()
+{
+ if ( listRows->currentItem() <= 0 ||
+ listRows->count() < 2 )
+ return;
+ int index = listRows->currentItem() - 1;
+ QListBoxItem *i = listRows->item( listRows->currentItem() );
+ listRows->takeItem( i );
+ listRows->insertItem( i, index );
+ listRows->setCurrentItem( i );
+ readRows();
+}
+
+void TableEditor::applyClicked()
+{
+ QValueList<PopulateTableCommand::Row> rows;
+ QValueList<PopulateTableCommand::Column> cols;
+
+ int i = 0;
+#ifndef QT_NO_TABLE
+ for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
+ PopulateTableCommand::Column col;
+ col.text = table->horizontalHeader()->label( i );
+ if ( table->horizontalHeader()->iconSet( i ) )
+ col.pix = table->horizontalHeader()->iconSet( i )->pixmap();
+ col.field = *fieldMap.find( i );
+ cols.append( col );
+ }
+ for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
+ PopulateTableCommand::Row row;
+ row.text = table->verticalHeader()->label( i );
+ if ( table->verticalHeader()->iconSet( i ) )
+ row.pix = table->verticalHeader()->iconSet( i )->pixmap();
+ rows.append( row );
+ }
+ PopulateTableCommand *cmd = new PopulateTableCommand( i18n( "Edit the Rows and Columns of '%1' " ).arg( editTable->name() ),
+ formWindow, editTable, rows, cols );
+ cmd->execute();
+ formWindow->commandHistory()->addCommand( cmd );
+#endif
+}
+
+void TableEditor::chooseRowPixmapClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+ QPixmap pix;
+ if ( listRows->item( listRows->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formWindow, *listRows->item( listRows->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formWindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+
+#ifndef QT_NO_TABLE
+ table->verticalHeader()->setLabel( listRows->currentItem(), pix, table->verticalHeader()->label( listRows->currentItem() ) );
+ listRows->changeItem( pix, listRows->currentText(), listRows->currentItem() );
+#endif
+}
+
+void TableEditor::deleteRowPixmapClicked()
+{
+ if ( listRows->currentItem() == -1 )
+ return;
+#ifndef QT_NO_TABLE
+ table->verticalHeader()->setLabel( listRows->currentItem(), QPixmap(), table->verticalHeader()->label( listRows->currentItem() ) );
+ listRows->changeItem( listRows->currentText(), listRows->currentItem() );
+#endif
+}
+
+void TableEditor::chooseColPixmapClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+ QPixmap pix;
+ if ( listColumns->item( listColumns->currentItem() )->pixmap() )
+ pix = qChoosePixmap( this, formWindow, *listColumns->item( listColumns->currentItem() )->pixmap() );
+ else
+ pix = qChoosePixmap( this, formWindow, QPixmap() );
+
+ if ( pix.isNull() )
+ return;
+#ifndef QT_NO_TABLE
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), pix, table->horizontalHeader()->label( listColumns->currentItem() ) );
+ listColumns->changeItem( pix, listColumns->currentText(), listColumns->currentItem() );
+#endif
+}
+
+void TableEditor::deleteColPixmapClicked()
+{
+ if ( listColumns->currentItem() == -1 )
+ return;
+#ifndef QT_NO_TABLE
+ table->horizontalHeader()->setLabel( listColumns->currentItem(), QPixmap(), table->horizontalHeader()->label( listColumns->currentItem() ) );
+ listColumns->changeItem( listColumns->currentText(), listColumns->currentItem() );
+#endif
+}
+
+void TableEditor::readFromTable()
+{
+#ifndef QT_NO_TABLE
+ QHeader *cols = editTable->horizontalHeader();
+ table->setNumCols( cols->count() );
+ QMap<QString, QString> columnFields = MetaDataBase::columnFields( editTable );
+ for ( int i = 0; i < cols->count(); ++i ) {
+ if ( editTable->horizontalHeader()->iconSet( i ) ) {
+ table->horizontalHeader()->setLabel( i, *editTable->horizontalHeader()->iconSet( i ),
+ editTable->horizontalHeader()->label( i ) );
+ listColumns->insertItem( editTable->horizontalHeader()->iconSet( i )->pixmap(),
+ editTable->horizontalHeader()->label( i ) );
+ } else {
+ table->horizontalHeader()->setLabel( i, editTable->horizontalHeader()->label( i ) );
+ listColumns->insertItem( editTable->horizontalHeader()->label( i ) );
+ }
+ QString cf = *columnFields.find( editTable->horizontalHeader()->label( i ) );
+ fieldMap.insert( i, cf );
+ }
+
+ if ( listColumns->firstItem() ) {
+ listColumns->setCurrentItem( listColumns->firstItem() );
+ listColumns->setSelected( listColumns->firstItem(), TRUE );
+ }
+
+ QHeader *rows = editTable->verticalHeader();
+ table->setNumRows( rows->count() );
+ for ( int j = 0; j < rows->count(); ++j ) {
+ if ( editTable->verticalHeader()->iconSet( j ) ) {
+ table->verticalHeader()->setLabel( j, *editTable->verticalHeader()->iconSet( j ),
+ editTable->verticalHeader()->label( j ) );
+ listRows->insertItem( editTable->verticalHeader()->iconSet( j )->pixmap(),
+ editTable->verticalHeader()->label( j ) );
+ } else {
+ table->verticalHeader()->setLabel( j, editTable->verticalHeader()->label( j ) );
+ listRows->insertItem( editTable->verticalHeader()->label( j ) );
+ }
+ }
+
+ if ( listRows->firstItem() ) {
+ listRows->setCurrentItem( listRows->firstItem() );
+ listRows->setSelected( listRows->firstItem(), TRUE );
+ }
+#endif
+}
+
+void TableEditor::readColumns()
+{
+ int j = 0;
+#ifndef QT_NO_TABLE
+ for ( QListBoxItem *i = listColumns->firstItem(); i; i = i->next(), ++j ) {
+ if ( i->pixmap() )
+ table->horizontalHeader()->setLabel( j, *i->pixmap(), i->text() );
+ else
+ table->horizontalHeader()->setLabel( j, i->text() );
+ }
+#endif
+}
+
+void TableEditor::readRows()
+{
+ int j = 0;
+#ifndef QT_NO_TABLE
+ for ( QListBoxItem *i = listRows->firstItem(); i; i = i->next(), ++j ) {
+ if ( i->pixmap() )
+ table->verticalHeader()->setLabel( j, *i->pixmap(), i->text() );
+ else
+ table->verticalHeader()->setLabel( j, i->text() );
+ }
+#endif
+}
+
+void TableEditor::saveFieldMap()
+{
+ tmpFieldMap.clear();
+ for ( QMap<int, QString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it )
+ tmpFieldMap.insert( listColumns->item( it.key() ), *it );
+}
+
+void TableEditor::restoreFieldMap()
+{
+ fieldMap.clear();
+ for ( QMap<QListBoxItem*, QString>::Iterator it = tmpFieldMap.begin(); it != tmpFieldMap.end(); ++it )
+ fieldMap.insert( listColumns->index( it.key() ), *it );
+}
diff --git a/kdevdesigner/designer/tableeditorimpl.h b/kdevdesigner/designer/tableeditorimpl.h
new file mode 100644
index 00000000..8d5ed20d
--- /dev/null
+++ b/kdevdesigner/designer/tableeditorimpl.h
@@ -0,0 +1,82 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef TABLEEDITORIMPL_H
+#define TABLEEDITORIMPL_H
+
+#include "tableeditor.h"
+#include <qmap.h>
+
+class QListBoxItem;
+class QTable;
+class FormWindow;
+
+class TableEditor : public TableEditorBase
+{
+ Q_OBJECT
+
+public:
+ TableEditor( QWidget* parent = 0, QWidget *editWidget = 0, FormWindow *fw = 0,
+ const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~TableEditor();
+
+protected slots:
+ void columnDownClicked();
+ void columnTextChanged( const QString & );
+ void columnUpClicked();
+ void currentColumnChanged( QListBoxItem * );
+ void currentFieldChanged( const QString & );
+ void currentRowChanged( QListBoxItem * );
+ void deleteColumnClicked();
+ void deleteRowClicked();
+ void newColumnClicked();
+ void newRowClicked();
+ void okClicked();
+ void rowDownClicked();
+ void rowTextChanged( const QString & );
+ void rowUpClicked();
+ void applyClicked();
+ void chooseRowPixmapClicked();
+ void deleteRowPixmapClicked();
+ void chooseColPixmapClicked();
+ void deleteColPixmapClicked();
+
+private:
+ void readFromTable();
+ void readColumns();
+ void readRows();
+ void saveFieldMap();
+ void restoreFieldMap();
+
+private:
+ QTable *editTable;
+ FormWindow *formWindow;
+ QMap<int, QString> fieldMap;
+ QMap<QListBoxItem*, QString> tmpFieldMap;
+
+};
+
+#endif // TABLEEDITOR_H
diff --git a/kdevdesigner/designer/timestamp.cpp b/kdevdesigner/designer/timestamp.cpp
new file mode 100644
index 00000000..9cda96e6
--- /dev/null
+++ b/kdevdesigner/designer/timestamp.cpp
@@ -0,0 +1,86 @@
+ /**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "timestamp.h"
+#include <qfile.h>
+#include <qfileinfo.h>
+
+class QTimer;
+
+TimeStamp::TimeStamp( QObject *parent, const QString &f )
+ : QObject( parent ), filename( f ), autoCheck( FALSE )
+{
+ timer = new QTimer( this );
+ connect( timer, SIGNAL( timeout() ), this, SLOT( autoCheckTimeStamp() ) );
+ update();
+}
+
+void TimeStamp::setFileName( const QString &f )
+{
+ filename = f;
+ update();
+}
+
+QString TimeStamp::fileName() const
+{
+ return filename;
+}
+
+void TimeStamp::setAutoCheckEnabled( bool a )
+{
+ autoCheck = a;
+ if ( autoCheck )
+ timer->start( 5000 );
+ else
+ timer->stop();
+}
+
+void TimeStamp::update()
+{
+ QFile f( filename );
+ if ( !f.exists() )
+ return;
+ lastTimeStamp = QFileInfo( f ).lastModified();
+}
+
+bool TimeStamp::isUpToDate() const
+{
+ QFile f( filename );
+ if ( !f.exists() )
+ return TRUE;
+ return lastTimeStamp == QFileInfo( f ).lastModified();
+}
+
+bool TimeStamp::isAutoCheckEnabled() const
+{
+ return autoCheck;
+}
+
+void TimeStamp::autoCheckTimeStamp()
+{
+ if ( !isUpToDate() )
+ emit timeStampChanged();
+}
diff --git a/kdevdesigner/designer/timestamp.h b/kdevdesigner/designer/timestamp.h
new file mode 100644
index 00000000..373fb884
--- /dev/null
+++ b/kdevdesigner/designer/timestamp.h
@@ -0,0 +1,63 @@
+ /**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef TIMESTAMP_H
+#define TIMESTAMP_H
+
+#include <qobject.h>
+#include <qdatetime.h>
+#include <qtimer.h>
+
+class TimeStamp : public QObject
+{
+ Q_OBJECT
+
+public:
+ TimeStamp( QObject *parent, const QString &f );
+
+ void setFileName( const QString &f );
+ QString fileName() const;
+ void setAutoCheckEnabled( bool a );
+ void update();
+
+ bool isUpToDate() const;
+ bool isAutoCheckEnabled() const;
+
+signals:
+ void timeStampChanged();
+
+private slots:
+ void autoCheckTimeStamp();
+
+private:
+ QDateTime lastTimeStamp;
+ QString filename;
+ bool autoCheck;
+ QTimer *timer;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/variabledialog.ui b/kdevdesigner/designer/variabledialog.ui
new file mode 100644
index 00000000..a38954af
--- /dev/null
+++ b/kdevdesigner/designer/variabledialog.ui
@@ -0,0 +1,294 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>VariableDialogBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>VariableDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>276</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="4">
+ <column>
+ <property name="text">
+ <string>Variable</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>varView</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>deleteButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>propBox</cstring>
+ </property>
+ <property name="title">
+ <string>Variable Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Acc&amp;ess:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>accessCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Variable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>varName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>varName</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>public</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>protected</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>private</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>accessCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0" rowspan="1" colspan="2">
+ <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>0</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="3" column="3">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <spacer row="3" column="0">
+ <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>0</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>addButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>addVariable()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>varName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>nameChanged()</slot>
+ </connection>
+ <connection>
+ <sender>deleteButton</sender>
+ <signal>clicked()</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>deleteVariable()</slot>
+ </connection>
+ <connection>
+ <sender>accessCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>accessChanged()</slot>
+ </connection>
+ <connection>
+ <sender>varView</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>varView</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>VariableDialogBase</receiver>
+ <slot>currentItemChanged(QListViewItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>varView</tabstop>
+ <tabstop>addButton</tabstop>
+ <tabstop>deleteButton</tabstop>
+ <tabstop>varName</tabstop>
+ <tabstop>accessCombo</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<slots>
+ <slot>addVariable()</slot>
+ <slot>deleteVariable()</slot>
+ <slot>accessChanged()</slot>
+ <slot>nameChanged()</slot>
+ <slot>okClicked()</slot>
+ <slot>currentItemChanged( QListViewItem * i )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/variabledialogimpl.cpp b/kdevdesigner/designer/variabledialogimpl.cpp
new file mode 100644
index 00000000..abaa7c68
--- /dev/null
+++ b/kdevdesigner/designer/variabledialogimpl.cpp
@@ -0,0 +1,180 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qlistview.h>
+#include <qgroupbox.h>
+#include <klineedit.h>
+#include <qcombobox.h>
+#include <qmessagebox.h>
+
+#include "metadatabase.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "hierarchyview.h"
+#include "command.h"
+#include "variabledialogimpl.h"
+
+#include <klocale.h>
+
+
+VariableDialog::VariableDialog( FormWindow *fw, QWidget *parent )
+ : VariableDialogBase( parent ), formWindow( fw )
+{
+ varView->setSorting( -1 );
+ QValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formWindow );
+ QValueList<MetaDataBase::Variable>::Iterator it = varLst.begin();
+ for ( ; it != varLst.end(); ++it ) {
+ QListViewItem *i = new QListViewItem( varView );
+ i->setText( 0, (*it).varName );
+ i->setText( 1, (*it).varAccess );
+ }
+
+ if ( varView->firstChild() )
+ varView->setCurrentItem( varView->firstChild() );
+ else
+ propBox->setEnabled( FALSE );
+}
+
+VariableDialog::~VariableDialog()
+{
+}
+
+void VariableDialog::setCurrentItem( QString text )
+{
+ QListViewItem *i = varView->findItem( text, 0 );
+ if ( i )
+ varView->setCurrentItem( i );
+}
+
+void VariableDialog::okClicked()
+{
+ QValueList<MetaDataBase::Variable> lst;
+
+ QListViewItemIterator it( varView );
+ while ( it.current() != 0 ) {
+ MetaDataBase::Variable v;
+ v.varName = it.current()->text( 0 ).simplifyWhiteSpace();
+ if ( v.varName[ (int)v.varName.length() - 1 ] != ';' )
+ v.varName += ";";
+ v.varAccess = it.current()->text( 1 );
+ lst << v;
+ ++it;
+ }
+
+ if ( !lst.isEmpty() ) {
+ QValueList<MetaDataBase::Variable> invalidLst;
+ QValueList<MetaDataBase::Variable>::Iterator it1 = lst.begin();
+ QValueList<MetaDataBase::Variable>::Iterator it2;
+ for ( ; it1 != lst.end(); ++it1 ) {
+ it2 = it1;
+ ++it2;
+ for ( ; it2 != lst.end(); ++it2 ) {
+ if ( MetaDataBase::extractVariableName( (*it1).varName ) ==
+ MetaDataBase::extractVariableName( (*it2).varName ) ) {
+ invalidLst << (*it1);
+ break;
+ }
+ }
+ }
+ if ( !invalidLst.isEmpty() ) {
+ if ( QMessageBox::information( this, i18n( "Edit Variables" ),
+ i18n( "One variable has been declared twice.\n"
+ "Remove this variable?" ), i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) {
+ for ( it2 = invalidLst.begin(); it2 != invalidLst.end(); ++it2 ) {
+ it = varView->firstChild();
+ while ( it.current() != 0 ) {
+ if ( MetaDataBase::extractVariableName( (*it)->text( 0 ).simplifyWhiteSpace() ) ==
+ MetaDataBase::extractVariableName( (*it2).varName ) ) {
+ delete (*it);
+ break;
+ }
+ ++it;
+ }
+ }
+ }
+ formWindow->mainWindow()->objectHierarchy()->updateFormDefinitionView();
+ return;
+ }
+ }
+ Command *cmd = new SetVariablesCommand( i18n( "Edit Variables" ), formWindow, lst );
+ formWindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ accept();
+}
+
+void VariableDialog::addVariable()
+{
+ QListViewItem *i = new QListViewItem( varView, varView->lastItem() );
+ i->setText( 0, "int newVariable" );
+ i->setText( 1, "protected" );
+ varView->setCurrentItem( i );
+ varView->setSelected( i, TRUE );
+ varName->setFocus();
+ varName->selectAll();
+}
+
+void VariableDialog::deleteVariable()
+{
+ QListViewItem *i = varView->selectedItem();
+ if ( !i )
+ return;
+ delete i;
+ i = 0;
+ if ( varView->firstChild() )
+ varView->setSelected( varView->firstChild(), TRUE );
+}
+
+void VariableDialog::currentItemChanged( QListViewItem *i )
+{
+ if ( !i ) {
+ varName->clear();
+ accessCombo->setCurrentItem( 1 );
+ propBox->setEnabled( FALSE );
+ return;
+ }
+ varName->setText( i->text( 0 ) );
+ if ( i->text( 1 ) == "public" )
+ accessCombo->setCurrentItem( 0 );
+ else if ( i->text( 1 ) == "protected" )
+ accessCombo->setCurrentItem( 1 );
+ else
+ accessCombo->setCurrentItem( 2 );
+ propBox->setEnabled( TRUE );
+}
+
+void VariableDialog::nameChanged()
+{
+ if ( !varView->currentItem() )
+ return;
+ varView->currentItem()->setText( 0, varName->text() );
+}
+
+void VariableDialog::accessChanged()
+{
+ if ( !varView->currentItem() )
+ return;
+ varView->currentItem()->setText( 1, accessCombo->currentText() );
+}
diff --git a/kdevdesigner/designer/variabledialogimpl.h b/kdevdesigner/designer/variabledialogimpl.h
new file mode 100644
index 00000000..975e18d7
--- /dev/null
+++ b/kdevdesigner/designer/variabledialogimpl.h
@@ -0,0 +1,56 @@
+/**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef VARIABLEDIALOGIMPL_H
+#define VARIABLEDIALOGIMPL_H
+
+#include "variabledialog.h"
+
+class FormWindow;
+class QListView;
+
+class VariableDialog : public VariableDialogBase
+{
+ Q_OBJECT
+public:
+ VariableDialog( FormWindow *fw, QWidget* parent = 0 );
+ ~VariableDialog();
+
+ void setCurrentItem( QString text );
+
+protected slots:
+ void okClicked();
+ void addVariable();
+ void deleteVariable();
+ void nameChanged();
+ void accessChanged();
+ void currentItemChanged( QListViewItem *i );
+
+private:
+ FormWindow *formWindow;
+};
+
+#endif
diff --git a/kdevdesigner/designer/widgetaction.cpp b/kdevdesigner/designer/widgetaction.cpp
new file mode 100644
index 00000000..36a9c14c
--- /dev/null
+++ b/kdevdesigner/designer/widgetaction.cpp
@@ -0,0 +1,58 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "widgetaction.h"
+#include <qwidget.h>
+#include <qtoolbutton.h>
+#include "mainwindow.h"
+#include <qstylefactory.h>
+#include <qstyle.h>
+
+static QStyle *windowsStyle = 0;
+
+void WidgetAction::addedTo( QWidget *w, QWidget *container )
+{
+ if ( ::qt_cast<QToolButton*>(w) && ::qt_cast<QScrollView*>(container->parent()->parent()) ) {
+ if ( !windowsStyle )
+ windowsStyle = QStyleFactory::create( "windows" );
+ w->setStyle( windowsStyle );
+ ( (QToolButton*)w )->setUsesTextLabel( TRUE );
+ ( (QToolButton*)w )->setTextPosition( QToolButton::Right );
+ w->setBackgroundMode( container->backgroundMode() );
+ }
+}
+
+WidgetAction::~WidgetAction()
+{
+ if ( MainWindow::self )
+ MainWindow::self->toolActions.removeRef( this );
+}
+
+void WidgetAction::init( const QString &g )
+{
+ MainWindow::self->toolActions.append( this );
+ grp = g;
+}
diff --git a/kdevdesigner/designer/widgetaction.h b/kdevdesigner/designer/widgetaction.h
new file mode 100644
index 00000000..6215d88d
--- /dev/null
+++ b/kdevdesigner/designer/widgetaction.h
@@ -0,0 +1,65 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WIDGETACTION_H
+#define WIDGETACTION_H
+
+#include <qaction.h>
+
+class WidgetAction : public QAction
+{
+ Q_OBJECT
+
+public:
+ WidgetAction( const QString &grp, QObject* parent,
+ const char* name = 0, bool toggle = FALSE )
+ : QAction( parent, name, toggle ) { init( grp ); }
+ WidgetAction( const QString &grp, const QString& text,
+ const QIconSet& icon, const QString& menuText, QKeySequence accel,
+ QObject* parent, const char* name = 0, bool toggle = FALSE )
+ : QAction( text, icon, menuText, accel, parent, name, toggle ) { init( grp ); }
+ WidgetAction( const QString &grp, const QString& text,
+ const QString& menuText, QKeySequence accel, QObject* parent,
+ const char* name = 0, bool toggle = FALSE )
+ : QAction( text, menuText, accel, parent, name, toggle ) { init( grp ); }
+ ~WidgetAction();
+
+#if !defined(Q_NO_USING_KEYWORD)
+ using QAction::addedTo;
+#endif
+ void addedTo( QWidget *, QWidget * );
+
+ QString group() const { return grp; }
+
+private:
+ void init( const QString &g );
+
+private:
+ QString grp;
+
+};
+
+#endif
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp
new file mode 100644
index 00000000..191fbb1f
--- /dev/null
+++ b/kdevdesigner/designer/widgetfactory.cpp
@@ -0,0 +1,1797 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler need this here
+#include "widgetfactory.h"
+#include <widgetdatabase.h>
+#include "metadatabase.h"
+#include "mainwindow.h"
+#include "formwindow.h"
+#include "propertyeditor.h"
+#include "layout.h"
+#include "listboxeditorimpl.h"
+#include "listvieweditorimpl.h"
+#include "iconvieweditorimpl.h"
+#include "formwindow.h"
+#include "multilineeditorimpl.h"
+#include "../interfaces/widgetinterface.h"
+#ifndef QT_NO_TABLE
+#include "tableeditorimpl.h"
+#endif
+#include "project.h"
+#include "menubareditor.h"
+#include "popupmenueditor.h"
+
+#include "kdevdesigner_part.h"
+
+#include <kiconloader.h>
+
+#include <qfeatures.h>
+
+#include <qpixmap.h>
+#include <qgroupbox.h>
+#include <qiconview.h>
+#ifndef QT_NO_TABLE
+#include <qtable.h>
+#endif
+#ifndef QT_NO_SQL
+#include <qdatatable.h>
+#endif
+#include <qdatetimeedit.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qmultilineedit.h>
+#include <qtextedit.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qwidgetstack.h>
+#include <qcombobox.h>
+#include <qtabbar.h>
+#include <qlistbox.h>
+#include <qlistview.h>
+#include <qobjectlist.h>
+#include <qlcdnumber.h>
+#include <qslider.h>
+#include <qdial.h>
+#include <qprogressbar.h>
+#include <qtextview.h>
+#include <qtextbrowser.h>
+#include <qframe.h>
+#include <qmetaobject.h>
+#include <qwidgetstack.h>
+#include <qwizard.h>
+#include <qvaluelist.h>
+#include <qtimer.h>
+#include <qscrollbar.h>
+#include <qmainwindow.h>
+#include <qmenubar.h>
+#include <qapplication.h>
+#include <qsplitter.h>
+#include <qtoolbox.h>
+#include <qsizegrip.h>
+#ifndef QT_NO_SQL
+#include "database.h"
+#endif
+
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <qobject.h>
+
+#include <klocale.h>
+
+FormWindow *find_formwindow( QWidget *w )
+{
+ if ( !w )
+ return 0;
+ for (;;) {
+ if ( ::qt_cast<FormWindow*>(w) )
+ return (FormWindow*)w;
+ if ( !w->parentWidget() )
+ return 0;
+ w = w->parentWidget();
+ }
+}
+
+void QLayoutWidget::paintEvent( QPaintEvent* )
+{
+ QPainter p ( this );
+ p.setPen( red );
+ p.drawRect( rect() );
+}
+
+
+QDesignerTabWidget::QDesignerTabWidget( QWidget *parent, const char *name )
+ : QTabWidget( parent, name ), dropIndicator( 0 ), dragPage( 0 ), mousePressed( FALSE )
+{
+ tabBar()->setAcceptDrops( TRUE );
+ tabBar()->installEventFilter( this );
+}
+
+int QDesignerTabWidget::currentPage() const
+{
+ return tabBar()->currentTab();
+}
+
+void QDesignerTabWidget::setCurrentPage( int i )
+{
+ tabBar()->setCurrentTab( i );
+}
+
+QString QDesignerTabWidget::pageTitle() const
+{
+ return ((QTabWidget*)this)->tabLabel( QTabWidget::currentPage() );
+}
+
+void QDesignerTabWidget::setPageTitle( const QString& title )
+{
+ changeTab( QTabWidget::currentPage(), title );
+}
+
+void QDesignerTabWidget::setPageName( const QCString& name )
+{
+ if ( QTabWidget::currentPage() )
+ QTabWidget::currentPage()->setName( name );
+}
+
+QCString QDesignerTabWidget::pageName() const
+{
+ if ( !QTabWidget::currentPage() )
+ return 0;
+ return QTabWidget::currentPage()->name();
+}
+
+int QDesignerTabWidget::count() const
+{
+ return tabBar()->count();
+}
+
+bool QDesignerTabWidget::eventFilter( QObject *o, QEvent *e )
+{
+ if ( o != tabBar() ) return FALSE;
+
+ switch ( e->type() ) {
+ case QEvent::MouseButtonPress: {
+ mousePressed = TRUE;
+ QMouseEvent *me = (QMouseEvent*)e;
+ pressPoint = me->pos();
+ }
+ break;
+ case QEvent::MouseMove: {
+ QMouseEvent *me = (QMouseEvent*)e;
+ if ( mousePressed && ( pressPoint - me->pos()).manhattanLength() > QApplication::startDragDistance() ) {
+ QTextDrag *drg = new QTextDrag( QString::number( (long) this ) , this );
+ mousePressed = FALSE;
+ dragPage = QTabWidget::currentPage();
+ dragLabel = QTabWidget::tabLabel( dragPage );
+
+ int index = indexOf( dragPage );
+
+ removePage( dragPage );
+ if ( !drg->dragMove() ) {
+ insertTab( dragPage, dragLabel, index );
+ showPage( dragPage );
+ }
+ if ( dropIndicator )
+ dropIndicator->hide();
+ }
+ }
+ break;
+ case QEvent::DragLeave: {
+ if ( dropIndicator )
+ dropIndicator->hide();
+ }
+ break;
+ case QEvent::DragMove: {
+ QDragEnterEvent *de = (QDragEnterEvent*) e;
+ if ( QTextDrag::canDecode( de ) ) {
+ QString text;
+ QTextDrag::decode( de, text );
+ if ( text == QString::number( (long)this ) )
+ de->accept();
+ else
+ return FALSE;
+ }
+
+ int index = 0;
+ QRect rect;
+ for ( ; index < tabBar()->count(); index++ ) {
+ if ( tabBar()->tabAt( index )->rect().contains( de->pos() ) ) {
+ rect = tabBar()->tabAt( index )->rect();
+ break;
+ }
+ }
+
+ if ( index == tabBar()->count() -1 ) {
+ QRect rect2 = rect;
+ rect2.setLeft( rect2.left() + rect2.width() / 2 );
+ if ( rect2.contains( de->pos() ) )
+ index++;
+ }
+
+ if ( ! dropIndicator ) {
+ dropIndicator = new QWidget( this );
+ dropIndicator->setBackgroundColor( red );
+ }
+
+ QPoint pos;
+ if ( index == tabBar()->count() )
+ pos = tabBar()->mapToParent( QPoint( rect.x() + rect.width(), rect.y() ) );
+ else
+ pos = tabBar()->mapToParent( QPoint( rect.x(), rect.y() ) );
+
+ dropIndicator->setGeometry( pos.x(), pos.y() , 3, rect.height() );
+ dropIndicator->show();
+ }
+ break;
+ case QEvent::Drop: {
+ QDragEnterEvent *de = (QDragEnterEvent*) e;
+ if ( QTextDrag::canDecode( de ) ) {
+ QString text;
+ QTextDrag::decode( de, text );
+ if ( text == QString::number( (long)this ) ) {
+
+ int newIndex = 0;
+ for ( ; newIndex < tabBar()->count(); newIndex++ ) {
+ if ( tabBar()->tabAt( newIndex )->rect().contains( de->pos() ) )
+ break;
+ }
+
+ if ( newIndex == tabBar()->count() -1 ) {
+ QRect rect2 = tabBar()->tabAt( newIndex )->rect();
+ rect2.setLeft( rect2.left() + rect2.width() / 2 );
+ if ( rect2.contains( de->pos() ) )
+ newIndex++;
+ }
+
+ int oldIndex = 0;
+ for ( ; oldIndex < tabBar()->count(); oldIndex++ ) {
+ if ( tabBar()->tabAt( oldIndex )->rect().contains( pressPoint ) )
+ break;
+ }
+
+ FormWindow *fw = find_formwindow( this );
+ MoveTabPageCommand *cmd =
+ new MoveTabPageCommand( i18n( "Move Tab Page" ), fw, this,
+ dragPage, dragLabel, newIndex, oldIndex );
+ fw->commandHistory()->addCommand( cmd );
+ cmd->execute();
+ de->accept();
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
+
+QDesignerWidgetStack::QDesignerWidgetStack( QWidget *parent, const char *name )
+ : QWidgetStack( parent, name )
+{
+ prev = new QToolButton( Qt::LeftArrow, this, "designer_wizardstack_button" );
+ prev->setAutoRaise( TRUE );
+ prev->setAutoRepeat( TRUE );
+ prev->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ) );
+ next = new QToolButton( Qt::RightArrow, this, "designer_wizardstack_button" );
+ next->setAutoRaise( TRUE );
+ next->setAutoRepeat( TRUE );
+ next->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ) );
+ connect( prev, SIGNAL( clicked() ), this, SLOT( prevPage() ) );
+ connect( next, SIGNAL( clicked() ), this, SLOT( nextPage() ) );
+ updateButtons();
+}
+
+void QDesignerWidgetStack::updateButtons()
+{
+ prev->setGeometry( width() - 31, 1, 15, 15 );
+ next->setGeometry( width() - 16, 1, 15, 15 );
+ prev->show();
+ next->show();
+ prev->raise();
+ next->raise();
+}
+
+void QDesignerWidgetStack::prevPage()
+{
+ setCurrentPage( currentPage() - 1 );
+}
+
+void QDesignerWidgetStack::nextPage()
+{
+ setCurrentPage( currentPage() + 1 );
+}
+
+int QDesignerWidgetStack::currentPage() const
+{
+ QDesignerWidgetStack* that = (QDesignerWidgetStack*) this;
+ return that->pages.find( visibleWidget() );
+}
+
+void QDesignerWidgetStack::setCurrentPage( int i )
+{
+ // help next/prev page commands
+ if ( i < 0 )
+ i += count();
+ if ( i >= count() )
+ i -= count();
+
+ if ( i < 0 || i >= count() )
+ return;
+ raiseWidget( pages.at( i ) );
+ updateButtons();
+}
+
+QCString QDesignerWidgetStack::pageName() const
+{
+ if ( !visibleWidget() )
+ return 0;
+ return visibleWidget()->name();
+}
+
+void QDesignerWidgetStack::setPageName( const QCString& name )
+{
+ if ( visibleWidget() )
+ visibleWidget()->setName( name );
+}
+
+int QDesignerWidgetStack::count() const
+{
+ return pages.count();
+}
+
+QWidget* QDesignerWidgetStack::page( int i ) const
+{
+ if ( i < 0 || i >= count() )
+ return 0;
+ QDesignerWidgetStack* that = (QDesignerWidgetStack*) this;
+ return that->pages.at( i );
+}
+
+
+int QDesignerWidgetStack::insertPage( QWidget *p, int i )
+{
+ if ( i < 0 )
+ pages.append( p );
+ else
+ pages.insert( (uint) i, p );
+ addWidget( p );
+ p->show();
+ raiseWidget( p );
+ QApplication::sendPostedEvents();
+ updateButtons();
+ return pages.find( p );
+}
+
+int QDesignerWidgetStack::removePage( QWidget *p )
+{
+ int i = pages.find( p );
+ pages.remove( p );
+ removeWidget( p );
+ setCurrentPage( 0 );
+ updateButtons();
+ return i;
+}
+
+
+int QDesignerWizard::currentPageNum() const
+{
+ for ( int i = 0; i < pageCount(); ++i ) {
+ if ( page( i ) == currentPage() )
+ return i;
+ }
+ return 0;
+}
+
+
+
+
+
+void QDesignerWizard::setCurrentPage( int i )
+{
+ if ( i < currentPageNum() ) {
+ while ( i < currentPageNum() ) {
+ if ( currentPageNum() == 0 )
+ break;
+ back();
+ }
+
+ } else {
+ while ( i > currentPageNum() ) {
+ if ( currentPageNum() == pageCount() - 1 )
+ break;
+ next();
+ }
+ }
+}
+
+QString QDesignerWizard::pageTitle() const
+{
+ return title( currentPage() );
+}
+
+void QDesignerWizard::setPageTitle( const QString& title )
+{
+ setTitle( currentPage(), title );
+}
+
+void QDesignerWizard::setPageName( const QCString& name )
+{
+ if ( QWizard::currentPage() )
+ QWizard::currentPage()->setName( name );
+}
+
+QCString QDesignerWizard::pageName() const
+{
+ if ( !QWizard::currentPage() )
+ return 0;
+ return QWizard::currentPage()->name();
+}
+
+int QDesignerWizard::pageNum( QWidget *p )
+{
+ for ( int i = 0; i < pageCount(); ++i ) {
+ if ( page( i ) == p )
+ return i;
+ }
+ return -1;
+}
+
+void QDesignerWizard::addPage( QWidget *p, const QString &t )
+{
+ QWizard::addPage( p, t );
+ if ( removedPages.find( p ) )
+ removedPages.remove( p );
+}
+
+void QDesignerWizard::removePage( QWidget *p )
+{
+ QWizard::removePage( p );
+ removedPages.insert( p, p );
+}
+
+void QDesignerWizard::insertPage( QWidget *p, const QString &t, int index )
+{
+ QWizard::insertPage( p, t, index );
+ if ( removedPages.find( p ) )
+ removedPages.remove( p );
+}
+
+QMap< int, QMap< QString, QVariant> > *defaultProperties = 0;
+QMap< int, QStringList > *changedProperties = 0;
+
+/*!
+ \class WidgetFactory widgetfactory.h
+ \brief Set of static functions for creating widgets, layouts and do other stuff
+
+ The widget factory offers functions to create widgets, create and
+ delete layouts find out other details - all based on the
+ WidgetDatabase's data. So the functions that use ids use the same
+ ids as in the WidgetDatabase.
+*/
+
+
+void WidgetFactory::saveDefaultProperties( QObject *w, int id )
+{
+ QMap< QString, QVariant> propMap;
+ QStrList lst = w->metaObject()->propertyNames( TRUE );
+ for ( uint i = 0; i < lst.count(); ++i ) {
+ QVariant var = w->property( lst.at( i ) );
+ if ( !var.isValid() && qstrcmp( "pixmap", lst.at( i ) ) == 0 )
+ var = QVariant( QPixmap() );
+ else if ( !var.isValid() && qstrcmp( "iconSet", lst.at( i ) ) == 0 )
+ var = QVariant( QIconSet() );
+ propMap.replace( lst.at( i ), var );
+ }
+ defaultProperties->replace( id, propMap );
+}
+
+void WidgetFactory::saveChangedProperties( QObject *w, int id )
+{
+ QStringList l = MetaDataBase::changedProperties( w );
+ changedProperties->insert( id, l );
+}
+
+/*! Creates a widget of the type which is registered as \a id as
+ child of \a parent. The \a name is optional. If \a init is TRUE, the
+ widget is initialized with some defaults, else the plain widget is
+ created.
+*/
+
+QWidget *WidgetFactory::create( int id, QWidget *parent, const char *name, bool init, const QRect *r, Qt::Orientation orient )
+{
+ QString n = WidgetDatabase::className( id );
+ if ( n.isEmpty() )
+ return 0;
+
+ if ( !defaultProperties ) {
+ defaultProperties = new QMap< int, QMap< QString, QVariant> >();
+ changedProperties = new QMap< int, QStringList >();
+ }
+
+ QWidget *w = 0;
+ QString str = WidgetDatabase::createWidgetName( id );
+ const char *s = str.latin1();
+ w = createWidget( n, parent, name ? name : s, init, r, orient );
+ if ( ::qt_cast<QScrollView*>(w) )
+ ( (QScrollView*)w )->disableSizeHintCaching();
+ if ( !w && WidgetDatabase::isCustomWidget( id ) )
+ w = createCustomWidget( parent, name ? name : s, MetaDataBase::customWidget( id ) );
+ if ( !w )
+ return 0;
+ MetaDataBase::addEntry( w );
+
+ if ( !defaultProperties->contains( id ) )
+ saveDefaultProperties( w, id );
+ if ( !changedProperties->contains( id ) )
+ saveChangedProperties( w, id );
+
+ return w;
+}
+
+/*! Creates a layout on the widget \a widget of the type \a type
+ which can be \c HBox, \c VBox or \c Grid.
+*/
+
+QLayout *WidgetFactory::createLayout( QWidget *widget, QLayout *layout, LayoutType type )
+{
+ int spacing = MainWindow::self->currentLayoutDefaultSpacing();
+ int margin = 0;
+
+ int metaspacing = MetaDataBase::spacing( widget );
+ int metamargin = MetaDataBase::margin( widget );
+
+ if ( ::qt_cast<QLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
+ widget && ::qt_cast<FormWindow*>(widget->parentWidget()) ) )
+ margin = MainWindow::self->currentLayoutDefaultMargin();
+
+ if ( !layout && ::qt_cast<QTabWidget*>(widget) )
+ widget = ((QTabWidget*)widget)->currentPage();
+
+ if ( !layout && ::qt_cast<QWizard*>(widget) )
+ widget = ((QWizard*)widget)->currentPage();
+
+ if ( !layout && ::qt_cast<QMainWindow*>(widget) )
+ widget = ((QMainWindow*)widget)->centralWidget();
+
+ if ( !layout && ::qt_cast<QWidgetStack*>(widget) )
+ widget = ((QWidgetStack*)widget)->visibleWidget();
+
+ if ( !layout && ::qt_cast<QToolBox*>(widget) )
+ widget = ((QToolBox*)widget)->currentItem();
+
+ MetaDataBase::addEntry( widget );
+
+ QLayout *l = 0;
+ int align = 0;
+ if ( !layout && ::qt_cast<QGroupBox*>(widget) ) {
+ QGroupBox *gb = (QGroupBox*)widget;
+ gb->setColumnLayout( 0, Qt::Vertical );
+ layout = gb->layout();
+ layout->setMargin( 0 );
+ layout->setSpacing( 0 );
+ switch ( type ) {
+ case HBox:
+ l = new QHBoxLayout( layout );
+ break;
+ case VBox:
+ l = new QVBoxLayout( layout );
+ break;
+ case Grid:
+ l = new QDesignerGridLayout( layout );
+ break;
+ default:
+ return 0;
+ }
+ align = Qt::AlignTop;
+ MetaDataBase::setMargin( gb, metamargin );
+ MetaDataBase::setSpacing( gb, metaspacing );
+ } else {
+ if ( layout ) {
+ switch ( type ) {
+ case HBox:
+ l = new QHBoxLayout( layout );
+ break;
+ case VBox:
+ l = new QVBoxLayout( layout );
+ break;
+ case Grid:
+ l = new QDesignerGridLayout( layout );
+ break;
+ default:
+ return 0;
+ }
+ MetaDataBase::addEntry( l );
+ l->setSpacing( spacing );
+ l->setMargin( margin );
+ } else {
+ switch ( type ) {
+ case HBox:
+ l = new QHBoxLayout( widget );
+ break;
+ case VBox:
+ l = new QVBoxLayout( widget );
+ break;
+ case Grid:
+ l = new QDesignerGridLayout( widget );
+ break;
+ default:
+ return 0;
+ }
+ MetaDataBase::addEntry( l );
+ if ( widget ) {
+ MetaDataBase::setMargin( widget, metamargin );
+ MetaDataBase::setSpacing( widget, metaspacing );
+ } else {
+ l->setMargin( margin );
+ l->setSpacing( spacing );
+ }
+ }
+ }
+ l->setAlignment( align );
+ MetaDataBase::addEntry( l );
+ return l;
+}
+
+void WidgetFactory::deleteLayout( QWidget *widget )
+{
+ if ( !widget )
+ return;
+
+ if ( ::qt_cast<QTabWidget*>(widget) )
+ widget = ((QTabWidget*)widget)->currentPage();
+ if ( ::qt_cast<QWizard*>(widget) )
+ widget = ((QWizard*)widget)->currentPage();
+ if ( ::qt_cast<QMainWindow*>(widget) )
+ widget = ((QMainWindow*)widget)->centralWidget();
+ if ( ::qt_cast<QWidgetStack*>(widget) )
+ widget = ((QWidgetStack*)widget)->visibleWidget();
+ if ( ::qt_cast<QToolBox*>(widget) )
+ widget = ((QToolBox*)widget)->currentItem();
+ delete widget->layout();
+}
+
+/*! Factory functions for creating a widget of the type \a className
+ as child of \a parent with the name \a name.
+
+ If \a init is TRUE, some initial default properties are set. This
+ has to be in sync with the initChangedProperties() function!
+*/
+
+QWidget *WidgetFactory::createWidget( const QString &className, QWidget *parent, const char *name, bool init,
+ const QRect *r, Qt::Orientation orient )
+{
+ if ( className == "QPushButton" ) {
+ QPushButton *b = 0;
+ if ( init ) {
+ b = new QDesignerPushButton( parent, name );
+ b->setText( QString::fromLatin1( name ) );
+ } else {
+ b = new QDesignerPushButton( parent, name );
+ }
+ QWidget *w = find_formwindow( b );
+ b->setAutoDefault( w && ::qt_cast<QDialog*>(((FormWindow*)w)->mainContainer()) );
+ return b;
+ } else if ( className == "QToolButton" ) {
+ if ( init ) {
+ QDesignerToolButton *tb = new QDesignerToolButton( parent, name );
+ if ( ::qt_cast<QToolBox*>(widgetOfContainer(parent))) {
+ tb->setUsesTextLabel(TRUE);
+ tb->setTextLabel("...");
+ tb->setAutoRaise(TRUE);
+ tb->setTextPosition(QToolButton::BesideIcon);
+ } else {
+ tb->setText( "..." );
+ }
+ return tb;
+ }
+ return new QDesignerToolButton( parent, name );
+ } else if ( className == "QCheckBox" ) {
+ if ( init ) {
+ QDesignerCheckBox *cb = new QDesignerCheckBox( parent, name );
+ cb->setText( QString::fromLatin1( name ) );
+ return cb;
+ }
+ return new QDesignerCheckBox( parent, name );
+ } else if ( className == "QRadioButton" ) {
+ if ( init ) {
+ QDesignerRadioButton *rb = new QDesignerRadioButton( parent, name );
+ rb->setText( QString::fromLatin1( name ) );
+ return rb;
+ }
+ return new QDesignerRadioButton( parent, name );
+ } else if ( className == "QGroupBox" ) {
+ if ( init )
+ return new QGroupBox( QString::fromLatin1( name ), parent, name );
+ return new QGroupBox( parent, name );
+ } else if ( className == "QButtonGroup" ) {
+ if ( init )
+ return new QButtonGroup( QString::fromLatin1( name ), parent, name );
+ return new QButtonGroup( parent, name );
+ } else if ( className == "QIconView" ) {
+#if !defined(QT_NO_ICONVIEW)
+ QIconView* iv = new QIconView( parent, name );
+ if ( init )
+ (void) new QIconViewItem( iv, i18n( "New Item" ) );
+ return iv;
+#else
+ return 0;
+#endif
+ } else if ( className == "QTable" ) {
+#if !defined(QT_NO_TABLE)
+ if ( init )
+ return new QTable( 3, 3, parent, name );
+ return new QTable( parent, name );
+#else
+ return 0;
+#endif
+#ifndef QT_NO_SQL
+ } else if ( className == "QDataTable" ) {
+ return new QDataTable( parent, name );
+#endif //QT_NO_SQL
+ } else if ( className == "QDateEdit" ) {
+ return new QDateEdit( parent, name );
+ } else if ( className == "QTimeEdit" ) {
+ return new QTimeEdit( parent, name );
+ } else if ( className == "QDateTimeEdit" ) {
+ return new QDateTimeEdit( parent, name );
+ }
+ else if ( className == "QListBox" ) {
+ QListBox* lb = new QListBox( parent, name );
+ if ( init ) {
+ lb->insertItem( i18n( "New Item" ) );
+ lb->setCurrentItem( 0 );
+ }
+ return lb;
+ } else if ( className == "QListView" ) {
+ QListView *lv = new QListView( parent, name );
+ lv->setSorting( -1 );
+ if ( init ) {
+ lv->addColumn( i18n( "Column 1" ) );
+ lv->setCurrentItem( new QListViewItem( lv, i18n( "New Item" ) ) );
+ }
+ return lv;
+ } else if ( className == "QLineEdit" )
+ return new QLineEdit( parent, name );
+ else if ( className == "QSpinBox" )
+ return new QSpinBox( parent, name );
+ else if ( className == "QSplitter" )
+ return new QSplitter( parent, name );
+ else if ( className == "QMultiLineEdit" )
+ return new QMultiLineEdit( parent, name );
+ else if ( className == "QTextEdit" )
+ return new QTextEdit( parent, name );
+ else if ( className == "QLabel" || className == "TextLabel" ) {
+ QDesignerLabel *l = new QDesignerLabel( parent, name );
+ if ( init ) {
+ l->setText( QString::fromLatin1( name ) );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "text", TRUE );
+ }
+ return l;
+ } else if ( className == "PixmapLabel" ) {
+ QDesignerLabel *l = new QDesignerLabel( parent, name );
+ if ( init ) {
+ l->setPixmap( BarIcon( "designer_qtlogo.png", KDevDesignerPartFactory::instance() ) );
+ l->setScaledContents( TRUE );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "pixmap", TRUE );
+ MetaDataBase::setPropertyChanged( l, "scaledContents", TRUE );
+ }
+ return l;
+ } else if ( className == "QLayoutWidget" )
+ return new QLayoutWidget( parent, name );
+ else if ( className == "QTabWidget" ) {
+ QTabWidget *tw = new QDesignerTabWidget( parent, name );
+ if ( init ) {
+ FormWindow *fw = find_formwindow( parent );
+ QWidget *w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new QWidget( tw, "tab" );
+ tw->addTab( w, i18n("Tab 1") );
+ MetaDataBase::addEntry( w );
+ w = fw ? new QDesignerWidget( fw, tw, "tab" ) : new QWidget( tw, "tab" );
+ tw->addTab( w, i18n("Tab 2") );
+ MetaDataBase::addEntry( tw );
+ MetaDataBase::addEntry( w );
+ }
+ return tw;
+ } else if ( className == "QWidgetStack" ) {
+ QDesignerWidgetStack *ws = new QDesignerWidgetStack( parent, name );
+ if ( init ) {
+ FormWindow *fw = find_formwindow( parent );
+ QWidget *w = fw ? new QDesignerWidget( fw, ws, "WStackPage" ) : new QWidget( ws, "WStackPage" );
+ ws->insertPage( w );
+ MetaDataBase::addEntry( w );
+ MetaDataBase::addEntry( ws );
+ }
+ return ws;
+ } else if ( className == "QComboBox" ) {
+ return new QComboBox( FALSE, parent, name );
+ } else if ( className == "QWidget" ) {
+ if ( parent &&
+ ( ::qt_cast<FormWindow*>(parent) ||
+ ::qt_cast<QWizard*>(parent) ||
+ ::qt_cast<QTabWidget*>(parent) ||
+ ::qt_cast<QWidgetStack*>(parent) ||
+ ::qt_cast<QToolBox*>(parent) ||
+ ::qt_cast<QMainWindow*>(parent) ) ) {
+ FormWindow *fw = find_formwindow( parent );
+ if ( fw ) {
+ QDesignerWidget *dw = new QDesignerWidget( fw, parent, name );
+ MetaDataBase::addEntry( dw );
+ return dw;
+ }
+ }
+ return new QWidget( parent, name );
+ } else if ( className == "QDialog" ) {
+ QDialog *dia = 0;
+ if ( ::qt_cast<FormWindow*>(parent) )
+ dia = new QDesignerDialog( (FormWindow*)parent, parent, name );
+ else
+ dia = new QDialog( parent, name );
+#if defined(QT_NON_COMMERCIAL)
+ if ( ::qt_cast<MainWindow*>(parent) )
+#else
+ if ( parent )
+#endif
+ dia->reparent( parent, QPoint( 0, 0 ), TRUE );
+ return dia;
+ } else if ( className == "QWizard" ) {
+ QWizard *wiz = new QDesignerWizard( parent, name );
+#if defined(QT_NON_COMMERCIAL)
+ if ( ::qt_cast<MainWindow*>(parent) )
+#else
+ if ( parent )
+#endif
+ wiz->reparent( parent, QPoint( 0, 0 ), TRUE );
+ if ( init && ::qt_cast<FormWindow*>(parent) ) {
+ QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, wiz, "WizardPage" );
+ MetaDataBase::addEntry( dw );
+ wiz->addPage( dw, i18n( "Page" ) );
+ QTimer::singleShot( 0, wiz, SLOT( next() ) );
+ }
+ return wiz;
+ } else if ( className == "Spacer" ) {
+ Spacer *s = new Spacer( parent, name );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( s, "sizeType", TRUE );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() < r->height() )
+ s->setOrientation( Qt::Vertical );
+ else
+ s->setOrientation( Qt::Horizontal );
+ return s;
+ } else if ( className == "QLCDNumber" )
+ return new QLCDNumber( parent, name );
+ else if ( className == "QProgressBar" )
+ return new QProgressBar( parent, name );
+ else if ( className == "QTextView" )
+ return new QTextView( parent, name );
+ else if ( className == "QTextBrowser" )
+ return new QTextBrowser( parent, name );
+ else if ( className == "QDial" )
+ return new QDial( parent, name );
+ else if ( className == "QSlider" ) {
+ QSlider *s = new QSlider( parent, name );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() > r->height() )
+ s->setOrientation( Qt::Horizontal );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ return s;
+ } else if ( className == "QScrollBar" ) {
+ QScrollBar *s = new QScrollBar( parent, name );
+ if ( !r )
+ return s;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ s->setOrientation( orient );
+ else if ( r->width() > r->height() )
+ s->setOrientation( Qt::Horizontal );
+ MetaDataBase::addEntry( s );
+ MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
+ return s;
+ } else if ( className == "QFrame" ) {
+ if ( !init )
+ return new QFrame( parent, name );
+ QFrame *f = new QFrame( parent, name );
+ f->setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
+ return f;
+ } else if ( className == "Line" ) {
+ Line *l = new Line( parent, name );
+ MetaDataBase::addEntry( l );
+ MetaDataBase::setPropertyChanged( l, "orientation", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( l, "frameShape", TRUE );
+ if ( !r )
+ return l;
+ if ( !r->isValid() || r->width() < 2 && r->height() < 2 )
+ l->setOrientation( orient );
+ else if ( r->width() < r->height() )
+ l->setOrientation( Qt::Vertical );
+ return l;
+ } else if ( className == "QMainWindow" ) {
+ QMainWindow *mw = new QMainWindow( parent, name, 0 );
+ mw->setDockEnabled( Qt::DockMinimized, FALSE );
+ QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, mw, "central widget" );
+ mw->setDockMenuEnabled( FALSE );
+ MetaDataBase::addEntry( dw );
+ mw->setCentralWidget( dw );
+ (void)mw->statusBar();
+ dw->show();
+ return mw;
+ } else if ( className == "QToolBox" ) {
+ if ( !init )
+ return new QDesignerToolBox( parent, name );
+ QToolBox *tb = new QDesignerToolBox( parent, name );
+ FormWindow *fw = find_formwindow( parent );
+ QWidget *w = fw ? new QDesignerWidget( fw, tb, "page1" ) :
+ new QWidget( tb, "page1" );
+ tb->addItem( w, i18n("Page 1") );
+ MetaDataBase::addEntry( w );
+ w = fw ? new QDesignerWidget( fw, tb, "page2" ) : new QWidget( tb, "page2" );
+ tb->addItem( w, i18n("Page 2") );
+ MetaDataBase::addEntry( tb );
+ MetaDataBase::addEntry( w );
+ return tb;
+ }
+#ifndef QT_NO_SQL
+ else if ( className == "QDataBrowser" ) {
+ QWidget *w = new QDesignerDataBrowser( parent, name );
+ if ( parent )
+ w->reparent( parent, QPoint( 0, 0 ), TRUE );
+ return w;
+ } else if ( className == "QDataView" ) {
+ QWidget *w = new QDesignerDataView( parent, name );
+ if ( parent )
+ w->reparent( parent, QPoint( 0, 0 ), TRUE );
+ return w;
+ }
+#endif
+
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( className, &iface );
+ if ( !iface )
+ return 0;
+
+ QWidget *w = iface->create( className, parent, name );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ if ( init && WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( className ) ) ) {
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->addPage( className, w, "Page", -1 );
+ iface2->release();
+ }
+ }
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ iface->release();
+ return w;
+}
+
+
+
+/*! Find out which type the layout of the widget is. Returns \c HBox,
+ \c VBox, \c Grid or \c NoLayout. \a layout points to this
+ QWidget::layout() of \a w or to 0 after the function call.
+*/
+
+WidgetFactory::LayoutType WidgetFactory::layoutType( QWidget *w, QLayout *&layout )
+{
+ layout = 0;
+
+ if ( ::qt_cast<QTabWidget*>(w) )
+ w = ((QTabWidget*)w)->currentPage();
+ if ( ::qt_cast<QWizard*>(w) )
+ w = ((QWizard*)w)->currentPage();
+ if ( ::qt_cast<QMainWindow*>(w) )
+ w = ((QMainWindow*)w)->centralWidget();
+ if ( ::qt_cast<QWidgetStack*>(w) )
+ w = ((QWidgetStack*)w)->visibleWidget();
+ if ( ::qt_cast<QToolBox*>(w) )
+ w = ((QToolBox*)w)->currentItem();
+
+ if ( ::qt_cast<QSplitter*>(w) )
+ return ( (QSplitter*)w )->orientation() == Horizontal ? HBox : VBox;
+
+ if ( !w || !w->layout() )
+ return NoLayout;
+ QLayout *lay = w->layout();
+
+ if ( ::qt_cast<QGroupBox*>(w) ) {
+ QObjectList *l = lay->queryList( "QLayout" );
+ if ( l && l->first() )
+ lay = (QLayout*)l->first();
+ delete l;
+ }
+ layout = lay;
+
+ if ( ::qt_cast<QHBoxLayout*>(lay) )
+ return HBox;
+ else if ( ::qt_cast<QVBoxLayout*>(lay) )
+ return VBox;
+ else if ( ::qt_cast<QGridLayout*>(lay) )
+ return Grid;
+ return NoLayout;
+}
+
+/*!
+ \overload
+*/
+WidgetFactory::LayoutType WidgetFactory::layoutType( QLayout *layout )
+{
+ if ( ::qt_cast<QHBoxLayout*>(layout) )
+ return HBox;
+ else if ( ::qt_cast<QVBoxLayout*>(layout) )
+ return VBox;
+ else if ( ::qt_cast<QGridLayout*>(layout) )
+ return Grid;
+ return NoLayout;
+}
+
+/*!
+ \overload
+*/
+WidgetFactory::LayoutType WidgetFactory::layoutType( QWidget *w )
+{
+ QLayout *l = 0;
+ return layoutType( w, l );
+}
+
+
+QWidget *WidgetFactory::layoutParent( QLayout *layout )
+{
+ QObject *o = layout;
+ while ( o ) {
+ if ( o->isWidgetType() )
+ return (QWidget*)o;
+ o = o->parent();
+ }
+ return 0;
+}
+
+/*! Returns the widget into which children should be inserted when \a
+ w is a container known to the designer.
+
+ Usually that is \a w itself, sometimes it is different (e.g. a
+ tabwidget is known to the designer as a container but the child
+ widgets should be inserted into the current page of the
+ tabwidget. So in this case this function returns the current page of
+ the tabwidget.)
+ */
+QWidget* WidgetFactory::containerOfWidget( QWidget *w )
+{
+ if ( !w )
+ return w;
+ if ( ::qt_cast<QTabWidget*>(w) )
+ return ((QTabWidget*)w)->currentPage();
+ if ( ::qt_cast<QWizard*>(w) )
+ return ((QWizard*)w)->currentPage();
+ if ( ::qt_cast<QWidgetStack*>(w) )
+ return ((QWidgetStack*)w)->visibleWidget();
+ if ( ::qt_cast<QToolBox*>(w) )
+ return ((QToolBox*)w)->currentItem();
+ if ( ::qt_cast<QMainWindow*>(w) )
+ return ((QMainWindow*)w)->centralWidget();
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ if ( !WidgetDatabase::isCustomPluginWidget( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) )
+ return w;
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( classNameOf( w ), &iface );
+ if ( !iface )
+ return w;
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return w;
+ QWidget *c = iface2->containerOfWidget( w->className(), w );
+ iface2->release();
+ iface->release();
+ if ( c )
+ return c;
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ return w;
+}
+
+/*! Returns the actual designer widget of the container \a w. This is
+ normally \a w itself, but might be a parent or grand parent of \a w
+ (e.g. when working with a tabwidget and \a w is the container which
+ contains and layouts childs, but the actual widget known to the
+ designer is the tabwidget which is the parent of \a w. So this
+ function returns the tabwidget then.)
+*/
+
+QWidget* WidgetFactory::widgetOfContainer( QWidget *w )
+{
+ if ( w && ::qt_cast<QWidgetStack*>(w->parentWidget()) )
+ w = w->parentWidget();
+ if ( w->parentWidget() && w->parentWidget()->parentWidget() &&
+ w->parentWidget()->parentWidget()->parentWidget() &&
+ ::qt_cast<QToolBox*>(w->parentWidget()->parentWidget()->parentWidget()) )
+ return w->parentWidget()->parentWidget()->parentWidget();
+ while ( w ) {
+ int id = WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) );
+ if ( WidgetDatabase::isContainer( id ) ||
+ w && ::qt_cast<FormWindow*>(w->parentWidget()) )
+ return w;
+ w = w->parentWidget();
+ }
+ return w;
+}
+
+/*!
+ Returns whether \a o is a passive interactor or not.
+ */
+
+bool WidgetFactory::lastWasAPassiveInteractor = FALSE;
+QGuardedPtr<QObject> *WidgetFactory::lastPassiveInteractor = new QGuardedPtr<QObject>();
+
+bool WidgetFactory::isPassiveInteractor( QObject* o )
+{
+ if ( lastPassiveInteractor && *lastPassiveInteractor && (QObject*)(*lastPassiveInteractor) == o )
+ return lastWasAPassiveInteractor;
+ lastWasAPassiveInteractor = FALSE;
+ (*lastPassiveInteractor) = o;
+ if ( QApplication::activePopupWidget() ) // if a popup is open, we have to make sure that this one is closed, else X might do funny things
+ return ( lastWasAPassiveInteractor = TRUE );
+
+ if ( ::qt_cast<QTabBar*>(o) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::qt_cast<QSizeGrip*>(o) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::qt_cast<QButton*>(o) &&
+ ( ::qt_cast<QTabBar*>(o->parent()) || ::qt_cast<QToolBox*>(o->parent()) ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::qt_cast<QPushButton*>(o) && ::qt_cast<QWizard*>(o->parent()) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( ::qt_cast<QMenuBar*>(o) && ::qt_cast<QMainWindow*>(o->parent()) )
+ return ( lastWasAPassiveInteractor = TRUE );
+// else if ( ::qt_cast<QDockWindowHandle*>(o) )
+ else if ( o->inherits( "QDockWindowHandle" ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+// else if ( ::qt_cast<QHideDock*>(o) )
+ else if ( o->inherits( "QHideDock" ) )
+ return ( lastWasAPassiveInteractor = TRUE );
+ else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 )
+ return ( lastWasAPassiveInteractor = TRUE );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ if ( !o->isWidgetType() )
+ return ( lastWasAPassiveInteractor = FALSE );
+ WidgetInterface *iface = 0;
+ QWidget *w = (QWidget*)o;
+ while ( !iface && w && !::qt_cast<FormWindow*>(w) ) {
+ widgetManager()->queryInterface( classNameOf( w ), &iface );
+ w = w->parentWidget();
+ }
+ if ( !iface )
+ return ( lastWasAPassiveInteractor = FALSE );
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer, (QUnknownInterface**)&iface2 );
+ if ( !iface2 )
+ return ( lastWasAPassiveInteractor = FALSE );
+ QWidget *fw = MainWindow::self->isAFormWindowChild( (QWidget*)o );
+ if ( !fw )
+ return ( lastWasAPassiveInteractor = FALSE );
+ QWidget *dw = ( (FormWindow*)fw )->designerWidget( (QWidget*)o );
+ if ( !dw )
+ return ( lastWasAPassiveInteractor = FALSE );
+ lastWasAPassiveInteractor = iface2->isPassiveInteractor( dw->className(), (QWidget*)o );
+ iface2->release();
+ iface->release();
+#endif // QT_CONTAINER_CUSTOM_WIDGETS
+ return lastWasAPassiveInteractor;
+}
+
+
+/*!
+ Returns the class name of object \a o that should be used for externally (i.e. for saving)
+ */
+const char* WidgetFactory::classNameOf( QObject* o )
+{
+ if ( o->isA( "PropertyObject" ) )
+ return o->className();
+ if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className())))
+ return o->className();
+ else if ( ::qt_cast<QDesignerTabWidget*>(o) )
+ return "QTabWidget";
+ else if ( ::qt_cast<QDesignerWidgetStack*>(o) )
+ return "QWidgetStack";
+ else if ( ::qt_cast<QWidgetStack*>(o) )
+ return "QWeDoNotWantToBreakTabWidget";
+ else if ( ::qt_cast<QDesignerDialog*>(o) )
+ return "QDialog";
+ else if ( ::qt_cast<QDesignerWidget*>(o) )
+ return "QWidget";
+ else if ( o->inherits( "CustomWidget" ) )
+ return ( (CustomWidget*)o )->realClassName().latin1();
+ else if ( ::qt_cast<QDesignerLabel*>(o) )
+ return "QLabel";
+ else if ( ::qt_cast<QDesignerWizard*>(o) )
+ return "QWizard";
+ else if ( ::qt_cast<QDesignerPushButton*>(o) )
+ return "QPushButton";
+ else if ( ::qt_cast<QDesignerToolButton*>(o) )
+ return "QToolButton";
+ else if ( ::qt_cast<QDesignerRadioButton*>(o) )
+ return "QRadioButton";
+ else if ( ::qt_cast<QDesignerCheckBox*>(o) )
+ return "QCheckBox";
+ else if ( ::qt_cast<MenuBarEditor*>(o) )
+ return "QMenuBar";
+ else if ( ::qt_cast<QDesignerToolBar*>(o) )
+ return "QToolBar";
+ else if ( ::qt_cast<QDesignerAction*>(o) )
+ return "QAction";
+ else if ( ::qt_cast<QDesignerActionGroup*>(o) )
+ return "QActionGroup";
+ else if ( ::qt_cast<PopupMenuEditor*>(o) )
+ return "QPopupMenu";
+ else if ( ::qt_cast<QDesignerToolBox*>(o) )
+ return "QToolBox";
+#ifndef QT_NO_SQL
+ else if ( ::qt_cast<QDesignerDataBrowser*>(o) )
+ return "QDataBrowser";
+ else if ( ::qt_cast<QDesignerDataView*>(o) )
+ return "QDataView";
+#endif
+ return o->className();
+}
+
+QString WidgetFactory::defaultSignal( QObject *w )
+{
+ if ( ::qt_cast<QRadioButton*>(w) || ::qt_cast<QCheckBox*>(w) )
+ return "toggled";
+ else if ( ::qt_cast<QButton*>(w) || ::qt_cast<QButtonGroup*>(w) )
+ return "clicked";
+ else if ( ::qt_cast<QTextBrowser*>(w) )
+ return "linkClicked";
+ else if ( ::qt_cast<QLineEdit*>(w) || ::qt_cast<QTextEdit*>(w) )
+ return "textChanged";
+ else if ( ::qt_cast<QListView*>(w) || ::qt_cast<QIconView*>(w) ||
+ ::qt_cast<QListBox*>(w) || ::qt_cast<QTable*>(w) )
+ return "selectionChanged";
+ else if ( ::qt_cast<QTabWidget*>(w) )
+ return "selected";
+ else if ( ::qt_cast<QToolBox*>(w) )
+ return "currentChanged";
+ else if ( ::qt_cast<QWidgetStack*>(w) )
+ return "aboutToShow";
+ else if ( ::qt_cast<QSpinBox*>(w) || ::qt_cast<QSlider*>(w) ||
+ ::qt_cast<QScrollBar*>(w) || ::qt_cast<QDateEdit*>(w) ||
+ ::qt_cast<QTimeEdit*>(w) || ::qt_cast<QDateTimeEdit*>(w) ||
+ ::qt_cast<QDial*>(w) )
+ return "valueChanged";
+ else if ( ::qt_cast<QComboBox*>(w) )
+ return "activated";
+ return QString::null;
+}
+
+/*! As some properties are set by default when creating a widget this
+ functions markes this properties as changed. Has to be in sync with
+ createWidget()!
+*/
+
+void WidgetFactory::initChangedProperties( QObject *o )
+{
+ if ( MainWindow::self && MainWindow::self->currProject() &&
+ MainWindow::self->currProject()->fakeFormFileFor( o ) )
+ return;
+ MetaDataBase::setPropertyChanged( o, "name", TRUE );
+ if ( !::qt_cast<QDesignerToolBar*>(o) && !::qt_cast<MenuBarEditor*>(o) )
+ MetaDataBase::setPropertyChanged( o, "geometry", TRUE );
+
+ if ( ::qt_cast<QPushButton*>(o) ||
+ ::qt_cast<QRadioButton*>(o) ||
+ ::qt_cast<QCheckBox*>(o) ||
+ ::qt_cast<QToolButton*>(o) ) {
+ if (::qt_cast<QToolButton*>(o) && ::qt_cast<QToolBox*>(widgetOfContainer((QWidget*)o->parent()))) {
+ MetaDataBase::setPropertyChanged( o, "usesTextLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "textLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "autoRaise", TRUE );
+ MetaDataBase::setPropertyChanged( o, "textPosition", TRUE );
+ } else {
+ MetaDataBase::setPropertyChanged( o, "text", TRUE );
+ }
+ }
+ else if ( ::qt_cast<QGroupBox*>(o) )
+ MetaDataBase::setPropertyChanged( o, "title", TRUE );
+ else if ( o->isA( "QFrame" ) ) {
+ MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE );
+ MetaDataBase::setPropertyChanged( o, "frameShape", TRUE );
+ } else if ( ::qt_cast<QTabWidget*>(o) || ::qt_cast<QWizard*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "pageTitle", TRUE );
+ MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
+ } else if ( ::qt_cast<QWidgetStack*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "currentPage", TRUE );
+ MetaDataBase::setPropertyChanged( o, "pageName", TRUE );
+ } else if ( ::qt_cast<QToolBox*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "currentIndex", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemLabel", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemIconSet", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemToolTip", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemBackgroundMode", TRUE );
+#ifndef QT_NO_TABLE
+ } else if ( ::qt_cast<QTable*>(o) ) {
+# ifndef QT_NO_SQL
+ if (!::qt_cast<QDataTable*>(o) )
+# endif
+ {
+ MetaDataBase::setPropertyChanged( o, "numRows", TRUE );
+ MetaDataBase::setPropertyChanged( o, "numCols", TRUE );
+ QTable *t = (QTable*)o;
+ for ( int i = 0; i < 3; ++i ) {
+ t->horizontalHeader()->setLabel( i, QString::number( i + 1 ) );
+ t->verticalHeader()->setLabel( i, QString::number( i + 1 ) );
+ }
+ }
+#endif
+ } else if ( ::qt_cast<QSplitter*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "orientation", TRUE );
+ } else if ( ::qt_cast<QDesignerToolBar*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "label", TRUE );
+ } else if ( ::qt_cast<MenuBarEditor*>(o) ) {
+ MetaDataBase::setPropertyChanged( o, "itemName", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemNumber", TRUE );
+ MetaDataBase::setPropertyChanged( o, "itemText", TRUE );
+ }
+}
+
+bool WidgetFactory::hasSpecialEditor( int id, QObject *editorWidget )
+{
+ QString className = WidgetDatabase::className( id );
+
+ if ( className.contains( "ListBox" ) )
+ return TRUE;
+ if ( className.contains( "ComboBox" ) )
+ return TRUE;
+ if ( className.contains( "ListView" ) )
+ return TRUE;
+ if ( className.contains( "IconView" ) )
+ return TRUE;
+ if ( className == "QTextEdit" || className == "QMultiLineEdit" )
+ return TRUE;
+ if ( ::qt_cast<QTable*>(editorWidget) != 0 )
+ return TRUE;
+
+ return FALSE;
+}
+
+bool WidgetFactory::hasItems( int id, QObject *editorWidget )
+{
+ QString className = WidgetDatabase::className( id );
+
+ if ( className.contains( "ListBox" ) || className.contains( "ListView" ) ||
+ className.contains( "IconView" ) || className.contains( "ComboBox" ) ||
+ ::qt_cast<QTable*>(editorWidget) != 0 )
+ return TRUE;
+
+ return FALSE;
+}
+
+void WidgetFactory::editWidget( int id, QWidget *parent, QWidget *editWidget, FormWindow *fw )
+{
+ QString className = WidgetDatabase::className( id );
+
+ if ( className.contains( "ListBox" ) ) {
+ if ( !::qt_cast<QListBox*>(editWidget) )
+ return;
+ ListBoxEditor *e = new ListBoxEditor( parent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className.contains( "ComboBox" ) ) {
+ if ( !::qt_cast<QComboBox*>(editWidget) )
+ return;
+ QComboBox *cb = (QComboBox*)editWidget;
+ ListBoxEditor *e = new ListBoxEditor( parent, cb->listBox(), fw );
+ e->exec();
+ delete e;
+ cb->update();
+ return;
+ }
+
+ if ( className.contains( "ListView" ) ) {
+ if ( !::qt_cast<QListView*>(editWidget) )
+ return;
+ QListView *lv = (QListView*)editWidget;
+ ListViewEditor *e = new ListViewEditor( parent, lv, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className.contains( "IconView" ) ) {
+ if ( !::qt_cast<QIconView*>(editWidget) )
+ return;
+ IconViewEditor *e = new IconViewEditor( parent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+
+ if ( className == "QMultiLineEdit" || className == "QTextEdit" ) {
+ MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, parent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+#ifndef QT_NO_TABLE
+ if (::qt_cast<QTable*>(editWidget) != 0) {
+ TableEditor *e = new TableEditor( parent, editWidget, fw );
+ e->exec();
+ delete e;
+ return;
+ }
+#endif
+}
+
+bool WidgetFactory::canResetProperty( QObject *w, const QString &propName )
+{
+ if ( propName == "name" || propName == "geometry" )
+ return FALSE;
+ QStringList l = *changedProperties->find( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ) );
+ return l.findIndex( propName ) == -1;
+}
+
+bool WidgetFactory::resetProperty( QObject *w, const QString &propName )
+{
+ const QMetaProperty *p = w->metaObject()->property( w->metaObject()->
+ findProperty( propName, TRUE ), TRUE );
+ if (!p )
+ return FALSE;
+ return p->reset( w );
+}
+
+QVariant WidgetFactory::defaultValue( QObject *w, const QString &propName )
+{
+ if ( propName == "wordwrap" ) {
+ int v = defaultValue( w, "alignment" ).toInt();
+ return QVariant( ( v & WordBreak ) == WordBreak, 0 );
+ } else if ( propName == "toolTip" || propName == "whatsThis" ) {
+ return QVariant( QString::fromLatin1( "" ) );
+ } else if ( w->inherits( "CustomWidget" ) ) {
+ return QVariant();
+ } else if ( propName == "frameworkCode" ) {
+ return QVariant( TRUE, 0 );
+ } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
+ return QVariant( -1 );
+ }
+
+ return *( *defaultProperties->find( WidgetDatabase::idFromClassName( classNameOf( w ) ) ) ).find( propName );
+}
+
+QString WidgetFactory::defaultCurrentItem( QObject *w, const QString &propName )
+{
+ const QMetaProperty *p = w->metaObject()->
+ property( w->metaObject()->findProperty( propName, TRUE ), TRUE );
+ if ( !p ) {
+ int v = defaultValue( w, "alignment" ).toInt();
+ if ( propName == "hAlign" ) {
+ if ( ( v & AlignAuto ) == AlignAuto )
+ return "AlignAuto";
+ if ( ( v & AlignLeft ) == AlignLeft )
+ return "AlignLeft";
+ if ( ( v & AlignCenter ) == AlignCenter || ( v & AlignHCenter ) == AlignHCenter )
+ return "AlignHCenter";
+ if ( ( v & AlignRight ) == AlignRight )
+ return "AlignRight";
+ if ( ( v & AlignJustify ) == AlignJustify )
+ return "AlignJustify";
+ } else if ( propName == "vAlign" ) {
+ if ( ( v & AlignTop ) == AlignTop )
+ return "AlignTop";
+ if ( ( v & AlignCenter ) == AlignCenter || ( v & AlignVCenter ) == AlignVCenter )
+ return "AlignVCenter";
+ if ( ( v & AlignBottom ) == AlignBottom )
+ return "AlignBottom";
+ } else if ( propName == "resizeMode" ) {
+ return "Auto";
+ }
+ return QString::null;
+
+ }
+ return p->valueToKey( defaultValue( w, propName ).toInt() );
+}
+
+QWidget *WidgetFactory::createCustomWidget( QWidget *parent, const char *name, MetaDataBase::CustomWidget *w )
+{
+ if ( !w )
+ return 0;
+ return new CustomWidget( parent, name, w );
+}
+
+QVariant WidgetFactory::property( QObject *w, const char *name )
+{
+ int id = w->metaObject()->findProperty( name, TRUE );
+ const QMetaProperty* p = w->metaObject()->property( id, TRUE );
+ if ( !p || !p->isValid() )
+ return MetaDataBase::fakeProperty( w, name );
+ return w->property( name );
+}
+
+void QDesignerLabel::updateBuddy()
+{
+
+ if ( myBuddy.isEmpty() )
+ return;
+
+ QObjectList *l = topLevelWidget()->queryList( "QWidget", myBuddy, FALSE, TRUE );
+ if ( !l || !l->first() ) {
+ delete l;
+ return;
+ }
+
+ QLabel::setBuddy( (QWidget*)l->first() );
+ delete l;
+}
+
+
+void QDesignerWidget::resizeEvent( QResizeEvent* e)
+{
+ if ( need_frame ) {
+ QPainter p(this);
+ p.setPen( backgroundColor() );
+ p.drawRect( QRect( QPoint(0,0), e->oldSize() ) );
+ }
+}
+
+void QDesignerWidget::paintEvent( QPaintEvent *e )
+{
+ if ( need_frame ) {
+ QPainter p(this);
+ p.setPen( backgroundColor().dark() );
+ p.drawRect( rect() );
+ }
+ formwindow->paintGrid( this, e );
+}
+
+void QDesignerDialog::paintEvent( QPaintEvent *e )
+{
+ formwindow->paintGrid( this, e );
+}
+
+QSizePolicy QLayoutWidget::sizePolicy() const
+{
+ return sp;
+}
+
+bool QLayoutWidget::event( QEvent *e )
+{
+ if ( e && ( e->type() == QEvent::ChildInserted ||
+ e->type() == QEvent::ChildRemoved ||
+ e->type() == QEvent::LayoutHint ||
+ e->type() == QEvent::Reparent ) )
+ updateSizePolicy();
+ return QWidget::event( e );
+}
+
+/*
+ This function must be called on QLayoutWidget creation and whenever
+ the QLayoutWidget's parent layout changes (e.g., from a QHBoxLayout
+ to a QVBoxLayout), because of the (illogical) way layouting works.
+*/
+void QLayoutWidget::updateSizePolicy()
+{
+ if ( !children() || children()->count() == 0 ) {
+ sp = QWidget::sizePolicy();
+ return;
+ }
+
+ /*
+ QSizePolicy::MayShrink & friends are private. Here we assume the
+ following:
+
+ Fixed = 0
+ Maximum = MayShrink
+ Minimum = MayGrow
+ Preferred = MayShrink | MayGrow
+ */
+
+ int ht = (int) QSizePolicy::Preferred;
+ int vt = (int) QSizePolicy::Preferred;
+
+ if ( layout() ) {
+ /*
+ parentLayout is set to the parent layout if there is one and if it is
+ top level, in which case layouting is illogical.
+ */
+ QLayout *parentLayout = 0;
+ if ( parent() && parent()->isWidgetType() ) {
+ parentLayout = ((QWidget *)parent())->layout();
+ if ( parentLayout &&
+ ::qt_cast<QLayoutWidget*>(parentLayout->mainWidget()) )
+ parentLayout = 0;
+ }
+
+ QObjectListIt it( *children() );
+ QObject *o;
+
+ if ( ::qt_cast<QVBoxLayout*>(layout()) ) {
+ if ( ::qt_cast<QHBoxLayout*>(parentLayout) )
+ vt = QSizePolicy::Minimum;
+ else
+ vt = QSizePolicy::Fixed;
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ continue;
+ QWidget *w = (QWidget*)o;
+
+ if ( !w->sizePolicy().mayGrowHorizontally() )
+ ht &= ~QSizePolicy::Minimum;
+ if ( !w->sizePolicy().mayShrinkHorizontally() )
+ ht &= ~QSizePolicy::Maximum;
+ if ( w->sizePolicy().mayGrowVertically() )
+ vt |= QSizePolicy::Minimum;
+ if ( w->sizePolicy().mayShrinkVertically() )
+ vt |= QSizePolicy::Maximum;
+ }
+ } else if ( ::qt_cast<QHBoxLayout*>(layout()) ) {
+ if ( ::qt_cast<QVBoxLayout*>(parentLayout) )
+ ht = QSizePolicy::Minimum;
+ else
+ ht = QSizePolicy::Fixed;
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ continue;
+ QWidget *w = (QWidget*)o;
+
+ if ( w->sizePolicy().mayGrowHorizontally() )
+ ht |= QSizePolicy::Minimum;
+ if ( w->sizePolicy().mayShrinkHorizontally() )
+ ht |= QSizePolicy::Maximum;
+ if ( !w->sizePolicy().mayGrowVertically() )
+ vt &= ~QSizePolicy::Minimum;
+ if ( !w->sizePolicy().mayShrinkVertically() )
+ vt &= ~QSizePolicy::Maximum;
+ }
+ } else if ( ::qt_cast<QGridLayout*>(layout()) ) {
+ ht = QSizePolicy::Fixed;
+ vt = QSizePolicy::Fixed;
+ if ( parentLayout ) {
+ if ( ::qt_cast<QVBoxLayout*>(parentLayout) )
+ ht = QSizePolicy::Minimum;
+ else if ( ::qt_cast<QHBoxLayout*>(parentLayout) )
+ vt = QSizePolicy::Minimum;
+ }
+
+ while ( ( o = it.current() ) ) {
+ ++it;
+ if ( !o->isWidgetType() || ( (QWidget*)o )->testWState( WState_ForceHide ) )
+ continue;
+ QWidget *w = (QWidget*)o;
+
+ if ( w->sizePolicy().mayGrowHorizontally() )
+ ht |= QSizePolicy::Minimum;
+ if ( w->sizePolicy().mayShrinkHorizontally() )
+ ht |= QSizePolicy::Maximum;
+ if ( w->sizePolicy().mayGrowVertically() )
+ vt |= QSizePolicy::Minimum;
+ if ( w->sizePolicy().mayShrinkVertically() )
+ vt |= QSizePolicy::Maximum;
+ }
+ }
+ if ( layout()->expanding() & QSizePolicy::Horizontally )
+ ht = QSizePolicy::Expanding;
+ if ( layout()->expanding() & QSizePolicy::Vertically )
+ vt = QSizePolicy::Expanding;
+
+ layout()->invalidate();
+ }
+
+ sp = QSizePolicy( (QSizePolicy::SizeType) ht, (QSizePolicy::SizeType) vt );
+ updateGeometry();
+}
+
+void CustomWidget::paintEvent( QPaintEvent *e )
+{
+ if ( ::qt_cast<FormWindow*>(parentWidget()) ) {
+ ( (FormWindow*)parentWidget() )->paintGrid( this, e );
+ } else {
+ QPainter p( this );
+ p.fillRect( rect(), colorGroup().dark() );
+ p.setPen( colorGroup().light() );
+ p.drawText( 2, 2, width() - 4, height() - 4, Qt::AlignAuto | Qt::AlignTop, cusw->className );
+ p.drawPixmap( ( width() - cusw->pixmap->width() ) / 2,
+ ( height() - cusw->pixmap->height() ) / 2,
+ *cusw->pixmap );
+ }
+}
+
+
+CustomWidgetFactory::CustomWidgetFactory()
+{
+}
+
+QWidget *CustomWidgetFactory::createWidget( const QString &className, QWidget *parent, const char *name ) const
+{
+ MetaDataBase::CustomWidget *w = MetaDataBase::customWidget( WidgetDatabase::idFromClassName( className ) );
+ if ( !w )
+ return 0;
+ return WidgetFactory::createCustomWidget( parent, name, w );
+}
+
+
+QDesignerToolBox::QDesignerToolBox( QWidget *parent, const char *name )
+ : QToolBox( parent, name )
+{
+}
+
+QString QDesignerToolBox::itemLabel() const
+{
+ return QToolBox::itemLabel( currentIndex() );
+}
+
+void QDesignerToolBox::setItemLabel( const QString &l )
+{
+ QToolBox::setItemLabel( currentIndex(), l );
+}
+
+QCString QDesignerToolBox::itemName() const
+{
+ return currentItem() ? currentItem()->name() : 0;
+}
+
+void QDesignerToolBox::setItemName( const QCString &n )
+{
+ if (currentItem())
+ currentItem()->setName( n );
+}
+
+
+Qt::BackgroundMode QDesignerToolBox::itemBackgroundMode() const
+{
+ return (item(0) ? item(0)->backgroundMode() : PaletteBackground);
+}
+
+void QDesignerToolBox::setItemBackgroundMode( BackgroundMode bmode )
+{
+ for (int i = 0; i < count(); ++i) {
+ QWidget *w = item(i);
+ w->setBackgroundMode( bmode );
+ w->update();
+ }
+}
+
+void QDesignerToolBox::itemInserted( int index )
+{
+ if (count() > 1)
+ item(index)->setBackgroundMode(item(index>0?0:1)->backgroundMode());
+}
diff --git a/kdevdesigner/designer/widgetfactory.h b/kdevdesigner/designer/widgetfactory.h
new file mode 100644
index 00000000..b235b8f4
--- /dev/null
+++ b/kdevdesigner/designer/widgetfactory.h
@@ -0,0 +1,501 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WIDGETFACTORY_H
+#define WIDGETFACTORY_H
+
+#include <qvariant.h>
+#include <qiconset.h>
+#include <qstring.h>
+#include <qintdict.h>
+#include <qtabwidget.h>
+#include <qpixmap.h>
+#include <qsize.h>
+#include <qpainter.h>
+#include <qevent.h>
+#include <qobjectlist.h>
+#include <qlabel.h>
+#include <qwizard.h>
+#include <qptrdict.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qwidgetstack.h>
+#include <qguardedptr.h>
+#include <qtoolbox.h>
+
+#include "metadatabase.h"
+#include "qwidgetfactory.h"
+
+class QWidget;
+class QLayout;
+class FormWindow;
+
+class CustomWidgetFactory : public QWidgetFactory
+{
+public:
+ CustomWidgetFactory();
+ QWidget *createWidget( const QString &className, QWidget *parent, const char *name ) const;
+
+};
+
+class WidgetFactory : public Qt
+{
+ friend class CustomWidgetFactory;
+
+public:
+ enum LayoutType {
+ HBox,
+ VBox,
+ Grid,
+ NoLayout
+ };
+
+ static QWidget *create( int id, QWidget *parent, const char *name = 0, bool init = TRUE,
+ const QRect *rect = 0, Qt::Orientation orient = Qt::Horizontal );
+ static QLayout *createLayout( QWidget *widget, QLayout* layout, LayoutType type );
+ static void deleteLayout( QWidget *widget );
+
+ static LayoutType layoutType( QWidget *w );
+ static LayoutType layoutType( QWidget *w, QLayout *&layout );
+ static LayoutType layoutType( QLayout *layout );
+ static QWidget *layoutParent( QLayout *layout );
+
+ static QWidget* containerOfWidget( QWidget *w );
+ static QWidget* widgetOfContainer( QWidget *w );
+
+ static bool isPassiveInteractor( QObject* o );
+ static const char* classNameOf( QObject* o );
+
+ static void initChangedProperties( QObject *o );
+
+ static bool hasSpecialEditor( int id, QObject *editorWidget );
+ static bool hasItems( int id, QObject *editorWidget );
+ static void editWidget( int id, QWidget *parent, QWidget *editWidget, FormWindow *fw );
+
+ static bool canResetProperty( QObject *w, const QString &propName );
+ static bool resetProperty( QObject *w, const QString &propName );
+ static QVariant defaultValue( QObject *w, const QString &propName );
+ static QString defaultCurrentItem( QObject *w, const QString &propName );
+
+ static QVariant property( QObject *w, const char *name );
+ static void saveDefaultProperties( QObject *w, int id );
+ static void saveChangedProperties( QObject *w, int id );
+
+ static QString defaultSignal( QObject *w );
+
+private:
+ static QWidget *createWidget( const QString &className, QWidget *parent, const char *name, bool init,
+ const QRect *r = 0, Qt::Orientation orient = Qt::Horizontal );
+ static QWidget *createCustomWidget( QWidget *parent, const char *name, MetaDataBase::CustomWidget *w );
+
+ static QGuardedPtr<QObject> *lastPassiveInteractor;
+ static bool lastWasAPassiveInteractor;
+};
+
+
+class QDesignerTabWidget : public QTabWidget
+{
+ Q_OBJECT
+ Q_PROPERTY( int currentPage READ currentPage WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( QString pageTitle READ pageTitle WRITE setPageTitle STORED false DESIGNABLE true )
+ Q_PROPERTY( QCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+public:
+ QDesignerTabWidget( QWidget *parent, const char *name );
+
+ int currentPage() const;
+ void setCurrentPage( int i );
+ QString pageTitle() const;
+ void setPageTitle( const QString& title );
+ QCString pageName() const;
+ void setPageName( const QCString& name );
+
+ int count() const;
+ QTabBar *tabBar() const { return QTabWidget::tabBar(); }
+
+ bool eventFilter( QObject*, QEvent* );
+
+private:
+ QPoint pressPoint;
+ QWidget *dropIndicator;
+ QWidget *dragPage;
+ QString dragLabel;
+ bool mousePressed;
+};
+
+class QDesignerWidgetStack : public QWidgetStack
+{
+ Q_OBJECT
+ Q_PROPERTY( int currentPage READ currentPage WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( QCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+public:
+ QDesignerWidgetStack( QWidget *parent, const char *name );
+
+ int currentPage() const;
+ void setCurrentPage( int i );
+ QCString pageName() const;
+ void setPageName( const QCString& name );
+
+ int count() const;
+ QWidget* page( int i ) const;
+
+ int insertPage( QWidget *p, int i = -1 );
+ int removePage( QWidget *p );
+
+public slots:
+ void updateButtons();
+
+protected:
+ void resizeEvent( QResizeEvent *e ) {
+ QWidgetStack::resizeEvent( e );
+ updateButtons();
+ }
+
+ void showEvent( QShowEvent *e ) {
+ QWidgetStack::showEvent( e );
+ updateButtons();
+ }
+
+private slots:
+ void prevPage();
+ void nextPage();
+
+private:
+ QPtrList<QWidget> pages;
+ QToolButton *prev, *next;
+
+};
+
+class QDesignerWizard : public QWizard
+{
+ Q_OBJECT
+ Q_PROPERTY( int currentPage READ currentPageNum WRITE setCurrentPage STORED false DESIGNABLE true )
+ Q_PROPERTY( QString pageTitle READ pageTitle WRITE setPageTitle STORED false DESIGNABLE true )
+ Q_PROPERTY( QCString pageName READ pageName WRITE setPageName STORED false DESIGNABLE true )
+ Q_OVERRIDE( bool modal READ isModal WRITE setModal )
+
+public:
+ QDesignerWizard( QWidget *parent, const char *name )
+ : QWizard( parent, name ), modal(FALSE) {}
+
+ int currentPageNum() const;
+ void setCurrentPage( int i );
+ QString pageTitle() const;
+ void setPageTitle( const QString& title );
+ QCString pageName() const;
+ void setPageName( const QCString& name );
+ int pageNum( QWidget *page );
+ void addPage( QWidget *p, const QString & );
+ void removePage( QWidget *p );
+ void insertPage( QWidget *p, const QString &t, int index );
+ bool isPageRemoved( QWidget *p ) { return (removedPages.find( p ) != 0); }
+
+ bool isModal() const { return modal; }
+ void setModal(bool b) { modal = b; }
+
+ void reject() {}
+
+private:
+ struct Page
+ {
+ Page( QWidget *a, const QString &b ) : p( a ), t( b ) {}
+ Page() : p( 0 ), t( QString::null ) {}
+ QWidget *p;
+ QString t;
+ };
+ QPtrDict<QWidget> removedPages;
+ bool modal;
+
+};
+
+class QLayoutWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ QLayoutWidget( QWidget *parent, const char *name ) : QWidget( parent, name ), sp( QWidget::sizePolicy() ) {}
+
+ QSizePolicy sizePolicy() const;
+ void updateSizePolicy();
+
+protected:
+ void paintEvent( QPaintEvent * );
+ bool event( QEvent * );
+ QSizePolicy sp;
+
+};
+
+
+class CustomWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ CustomWidget( QWidget *parent, const char *name, MetaDataBase::CustomWidget *cw )
+ : QWidget( parent, name ), cusw( cw ) {
+ alwaysExpand = parentWidget() && parentWidget()->inherits( "FormWindow" );
+ setSizePolicy( cw->sizePolicy );
+ if ( !alwaysExpand )
+ setBackgroundMode( PaletteDark );
+ }
+
+ QSize sizeHint() const {
+ QSize sh = cusw->sizeHint;
+ if ( sh.isValid() )
+ return sh;
+ return QWidget::sizeHint();
+ }
+
+ QString realClassName() { return cusw->className; }
+ MetaDataBase::CustomWidget *customWidget() const { return cusw; }
+
+protected:
+ void paintEvent( QPaintEvent *e );
+
+ MetaDataBase::CustomWidget *cusw;
+ bool alwaysExpand;
+
+};
+
+
+class Line : public QFrame
+{
+ Q_OBJECT
+
+ Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )
+ Q_OVERRIDE( int frameWidth DESIGNABLE false )
+ Q_OVERRIDE( Shape frameShape DESIGNABLE false )
+ Q_OVERRIDE( QRect frameRect DESIGNABLE false )
+ Q_OVERRIDE( QRect contentsRect DESIGNABLE false )
+public:
+ Line( QWidget *parent, const char *name )
+ : QFrame( parent, name, WMouseNoMask ) {
+ setFrameStyle( HLine | Sunken );
+ }
+
+ void setOrientation( Orientation orient ) {
+ if ( orient == Horizontal )
+ setFrameShape( HLine );
+ else
+ setFrameShape( VLine );
+ }
+ Orientation orientation() const {
+ return frameShape() == HLine ? Horizontal : Vertical;
+ }
+};
+
+class QDesignerLabel : public QLabel
+{
+ Q_OBJECT
+
+ Q_PROPERTY( QCString buddy READ buddyWidget WRITE setBuddyWidget )
+
+public:
+ QDesignerLabel( QWidget *parent = 0, const char *name = 0 )
+ : QLabel( parent, name ) { myBuddy = 0; }
+
+ void setBuddyWidget( const QCString &b ) {
+ myBuddy = b;
+ updateBuddy();
+ }
+ QCString buddyWidget() const {
+ return myBuddy;
+ };
+
+protected:
+ void showEvent( QShowEvent *e ) {
+ QLabel::showEvent( e );
+ updateBuddy();
+ }
+
+
+private:
+ void updateBuddy();
+
+ QCString myBuddy;
+
+};
+
+class QDesignerWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ QDesignerWidget( FormWindow *fw, QWidget *parent, const char *name )
+ : QWidget( parent, name, WResizeNoErase ), formwindow( fw ) {
+ need_frame = parent && parent->inherits("QDesignerWidgetStack" );
+ }
+
+protected:
+ void resizeEvent( QResizeEvent* e);
+ void paintEvent( QPaintEvent *e );
+
+private:
+ FormWindow *formwindow;
+ uint need_frame : 1;
+
+};
+
+class QDesignerDialog : public QDialog
+{
+ Q_OBJECT
+ Q_OVERRIDE( bool modal READ isModal WRITE setModal )
+
+public:
+ QDesignerDialog( FormWindow *fw, QWidget *parent, const char *name )
+ : QDialog( parent, name, FALSE, WResizeNoErase ), formwindow( fw ), modal(FALSE) {}
+
+ bool isModal() const { return modal; }
+ void setModal(bool b) { modal = b; }
+
+protected:
+ void paintEvent( QPaintEvent *e );
+
+private:
+ FormWindow *formwindow;
+ bool modal;
+
+};
+
+class QDesignerToolButton : public QToolButton
+{
+ Q_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ QDesignerToolButton( QWidget *parent, const char *name )
+ : QToolButton( parent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ? ( (QButtonGroup*)parentWidget() )->id( (QButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ) {
+ ( (QButtonGroup*)parentWidget() )->remove( this );
+ ( (QButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+};
+
+class QDesignerRadioButton : public QRadioButton
+{
+ Q_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ QDesignerRadioButton( QWidget *parent, const char *name )
+ : QRadioButton( parent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ? ( (QButtonGroup*)parentWidget() )->id( (QButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ) {
+ ( (QButtonGroup*)parentWidget() )->remove( this );
+ ( (QButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+};
+
+class QDesignerPushButton : public QPushButton
+{
+ Q_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ QDesignerPushButton( QWidget *parent, const char *name )
+ : QPushButton( parent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ? ( (QButtonGroup*)parentWidget() )->id( (QButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ) {
+ ( (QButtonGroup*)parentWidget() )->remove( this );
+ ( (QButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+};
+
+class QDesignerCheckBox : public QCheckBox
+{
+ Q_OBJECT
+ Q_PROPERTY( int buttonGroupId READ buttonGroupId WRITE setButtonGroupId )
+
+public:
+ QDesignerCheckBox( QWidget *parent, const char *name )
+ : QCheckBox( parent, name ) {}
+
+ bool isInButtonGroup() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" );
+ }
+ int buttonGroupId() const {
+ return parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ? ( (QButtonGroup*)parentWidget() )->id( (QButton*)this ) : -1;
+ }
+ void setButtonGroupId( int id ) {
+ if ( parentWidget() && parentWidget()->inherits( "QButtonGroup" ) ) {
+ ( (QButtonGroup*)parentWidget() )->remove( this );
+ ( (QButtonGroup*)parentWidget() )->insert( this, id );
+ }
+ }
+
+};
+
+class QDesignerToolBox : public QToolBox
+{
+ Q_OBJECT
+ Q_PROPERTY( QString itemLabel READ itemLabel WRITE setItemLabel STORED false DESIGNABLE true )
+ Q_PROPERTY( QCString itemName READ itemName WRITE setItemName STORED false DESIGNABLE true )
+ Q_PROPERTY( BackgroundMode itemBackgroundMode READ itemBackgroundMode WRITE setItemBackgroundMode STORED false DESIGNABLE true )
+
+public:
+ QDesignerToolBox( QWidget *parent, const char *name );
+
+ QString itemLabel() const;
+ void setItemLabel( const QString &l );
+ QCString itemName() const;
+ void setItemName( const QCString &n );
+ BackgroundMode itemBackgroundMode() const;
+ void setItemBackgroundMode( BackgroundMode );
+
+protected:
+ void itemInserted( int index );
+};
+
+#endif
diff --git a/kdevdesigner/designer/wizardeditor.ui b/kdevdesigner/designer/wizardeditor.ui
new file mode 100644
index 00000000..45450be2
--- /dev/null
+++ b/kdevdesigner/designer/wizardeditor.ui
@@ -0,0 +1,342 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>WizardEditorBase</class>
+<comment>*********************************************************************
+** Copyright (C) 2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>WizardEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>396</width>
+ <height>233</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Wizard Page Editor</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>pagesLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Wizard pages:</string>
+ </property>
+ </widget>
+ <widget class="QListBox">
+ <property name="name">
+ <cstring>listBox</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout18</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonAdd</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;dd</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonRemove</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonUp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_up.png"</pixmap>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonDown</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>"designer_s_down.png"</pixmap>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and apply all the changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonApply</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Apply</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Apply all changes.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Close the dialog and discard any changes.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>helpClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonApply</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>applyClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonUp</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>upClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonDown</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>downClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>addClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemove</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>removeClicked()</slot>
+ </connection>
+ <connection>
+ <sender>listBox</sender>
+ <signal>selected(int)</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>itemSelected(int)</slot>
+ </connection>
+ <connection>
+ <sender>listBox</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>itemHighlighted(int)</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>okClicked()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>WizardEditorBase</receiver>
+ <slot>cancelClicked()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot access="protected">addClicked()</slot>
+ <slot access="protected">applyClicked()</slot>
+ <slot access="protected">cancelClicked()</slot>
+ <slot access="protected">downClicked()</slot>
+ <slot access="protected">helpClicked()</slot>
+ <slot access="protected">itemHighlighted(int)</slot>
+ <slot access="protected">itemSelected(int)</slot>
+ <slot access="protected">okClicked()</slot>
+ <slot access="protected">removeClicked()</slot>
+ <slot access="protected">upClicked()</slot>
+</slots>
+<includes>
+ <include location="local" impldecl="in implementation">myiconloader.h</include>
+</includes>
+<pixmapfunction>BarIcon2</pixmapfunction>
+
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kdevdesigner/designer/wizardeditorimpl.cpp b/kdevdesigner/designer/wizardeditorimpl.cpp
new file mode 100644
index 00000000..089bf746
--- /dev/null
+++ b/kdevdesigner/designer/wizardeditorimpl.cpp
@@ -0,0 +1,253 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "wizardeditorimpl.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "command.h"
+#include "listboxdnd.h"
+#include "listboxrename.h"
+
+#include <qwizard.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qinputdialog.h>
+
+#include <klocale.h>
+
+WizardEditor::WizardEditor( QWidget *parent, QWizard *w, FormWindow *fw )
+ : WizardEditorBase( parent, 0 ), formwindow( fw ), wizard( w ), draggedItem( 0 )
+{
+ connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ fillListBox();
+
+ // Add drag and drop
+ ListBoxDnd *listBoxDnd = new ListBoxDnd( listBox );
+ listBoxDnd->setDragMode( ListBoxDnd::Internal | ListBoxDnd::Move );
+ QObject::connect( listBoxDnd, SIGNAL( dropped( QListBoxItem * ) ),
+ listBoxDnd, SLOT( confirmDrop( QListBoxItem * ) ) );
+
+ QObject::connect( listBoxDnd, SIGNAL( dragged( QListBoxItem * ) ),
+ this, SLOT( itemDragged( QListBoxItem * ) ) );
+ QObject::connect( listBoxDnd, SIGNAL( dropped( QListBoxItem * ) ),
+ this, SLOT( itemDropped( QListBoxItem * ) ) );
+
+ // Add in-place rename
+ new ListBoxRename( listBox );
+}
+
+WizardEditor::~WizardEditor()
+{
+ commands.setAutoDelete( TRUE );
+}
+
+void WizardEditor::okClicked()
+{
+ applyClicked();
+ accept();
+}
+
+void WizardEditor::cancelClicked()
+{
+ reject();
+}
+
+void WizardEditor::applyClicked()
+{
+ if ( commands.isEmpty() ) return;
+
+ // schedule macro command
+ MacroCommand* cmd = new MacroCommand( i18n( "Edit Wizard Pages" ), formwindow, commands );
+ formwindow->commandHistory()->addCommand( cmd );
+ cmd->execute();
+
+ // clear command list
+ commands.clear();
+
+ // fix wizard buttons
+ for ( int i = 0; i < wizard->pageCount(); i++ ) {
+
+ QWidget * page = wizard->page( i );
+ if ( i == 0 ) { // first page
+
+ wizard->setBackEnabled( page, FALSE );
+ wizard->setNextEnabled( page, TRUE );
+ }
+ else if ( i == wizard->pageCount() - 1 ) { // last page
+
+ wizard->setBackEnabled( page, TRUE );
+ wizard->setNextEnabled( page, FALSE );
+ }
+ else {
+
+ wizard->setBackEnabled( page, TRUE );
+ wizard->setNextEnabled( page, TRUE );
+ }
+ wizard->setFinishEnabled( page, FALSE );
+ }
+
+ // update listbox
+ int index = listBox->currentItem();
+ fillListBox();
+ listBox->setCurrentItem( index );
+
+ // show current page
+ wizard->showPage( wizard->page( 0 ) );
+}
+
+void WizardEditor::helpClicked()
+{
+
+}
+
+void WizardEditor::addClicked()
+{
+ int index = listBox->currentItem() + 1;
+ // update listbox
+ listBox->insertItem( i18n( "Page" ), index );
+
+ // schedule add command
+ AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n( "Add Page to %1" ).arg( wizard->name() ),
+ formwindow, wizard, "Page", index, FALSE);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::removeClicked()
+{
+ if ( listBox->count() < 2 ) return;
+
+ int index = listBox->currentItem();
+
+ // update listbox
+ listBox->removeItem( index );
+
+ // schedule remove command
+ DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( i18n( "Delete Page %1 of %2" )
+ .arg( listBox->text( index ) ).arg( wizard->name() ),
+ formwindow, wizard, index, FALSE );
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::upClicked()
+{
+ int index1 = listBox->currentItem();
+ int index2 = index1 - 1;
+
+ // swap listbox items
+ QString item1 = listBox->text( index1 );
+ listBox->removeItem( index1 );
+ listBox->insertItem( item1, index2 );
+ listBox->setCurrentItem( index2 );
+
+ // schedule swap command
+ SwapWizardPagesCommand *cmd = new SwapWizardPagesCommand( i18n( "Swap Pages %1 and %2 of %3" ).arg( index1 ).arg( index2 )
+ .arg( wizard->name() ), formwindow, wizard, index1, index2);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::downClicked()
+{
+ int index1 = listBox->currentItem();
+ int index2 = index1 + 1;
+
+ // swap listbox items
+ QString item1 = listBox->text( index1 );
+ listBox->removeItem( index1 );
+ listBox->insertItem( item1, index2 );
+ listBox->setCurrentItem( index2 );
+
+ // schedule swap command
+ SwapWizardPagesCommand *cmd = new SwapWizardPagesCommand( i18n( "Swap Pages %1 and %2 of %3" ).arg( index1 ).arg( index2 ).arg( wizard->name() ), formwindow, wizard, index2, index1);
+ commands.append( cmd );
+
+ // update buttons
+ updateButtons();
+}
+
+void WizardEditor::fillListBox()
+{
+ listBox->clear();
+
+ if ( !wizard ) return;
+ for ( int i = 0; i < wizard->pageCount(); i++ )
+ listBox->insertItem( wizard->title( wizard->page( i ) ) );
+
+ updateButtons();
+}
+
+void WizardEditor::itemHighlighted( int )
+{
+ updateButtons();
+}
+
+void WizardEditor::itemSelected( int index )
+{
+ if ( index < 0 ) return;
+ // Called when Qt::Key_Enter was pressed.
+ // ListBoxRename has renamed the list item, so we only need to rename the page to the same name.
+ QString pn( i18n( "Rename page %1 of %2" ).arg( wizard->title( wizard->page( index ) ) ).arg( wizard->name() ) );
+ RenameWizardPageCommand *cmd = new RenameWizardPageCommand( pn, formwindow, wizard, index, listBox->text( index ) );
+ commands.append( cmd );
+}
+
+void WizardEditor::updateButtons()
+{
+ int index = listBox->currentItem();
+
+ buttonUp->setEnabled( index > 0 );
+ buttonDown->setEnabled( index < (int)listBox->count() - 1 );
+ buttonRemove->setEnabled( index >= 0 );
+
+ if ( listBox->count() < 2 )
+ buttonRemove->setEnabled( FALSE );
+}
+
+void WizardEditor::itemDragged( QListBoxItem * i )
+{
+ // Store item index
+ draggedItem = listBox->index( i );
+}
+
+void WizardEditor::itemDropped( QListBoxItem * i )
+{
+ if ( draggedItem < 0 ) return;
+ // The reorder the pages acording to the listBox list of items
+ // Assumes that only one item has been moved.
+ int droppedItem = listBox->index( i );
+
+ //qDebug( "Moving page %d -> %d", draggedItem, droppedItem );
+ MoveWizardPageCommand *cmd = new MoveWizardPageCommand( i18n( "Move Page %1 to %2 in %3" ).arg( draggedItem ).arg( droppedItem ).arg( wizard->name() ), formwindow, wizard, draggedItem, droppedItem );
+ commands.append( cmd );
+}
diff --git a/kdevdesigner/designer/wizardeditorimpl.h b/kdevdesigner/designer/wizardeditorimpl.h
new file mode 100644
index 00000000..0089cb39
--- /dev/null
+++ b/kdevdesigner/designer/wizardeditorimpl.h
@@ -0,0 +1,74 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WIZARDEDITORIMPL_H
+#define WIZARDEDITORIMPL_H
+
+class QWizard;
+class FormWindow;
+
+#include <qptrlist.h>
+
+#include "wizardeditor.h"
+#include "command.h"
+
+class WizardEditor : public WizardEditorBase
+{
+ Q_OBJECT
+
+public:
+ WizardEditor( QWidget *parent, QWizard *wizard, FormWindow *fw );
+ ~WizardEditor();
+
+protected slots:
+ void okClicked();
+ void applyClicked();
+ void cancelClicked();
+ void helpClicked();
+
+ void addClicked();
+ void removeClicked();
+ void upClicked();
+ void downClicked();
+
+ void itemHighlighted( int );
+ void itemSelected( int );
+
+ void itemDragged( QListBoxItem * );
+ void itemDropped( QListBoxItem * );
+
+private:
+ void updateButtons();
+ void fillListBox();
+
+private:
+ FormWindow *formwindow;
+ QWizard *wizard;
+ QPtrList<Command> commands;
+ int draggedItem;
+};
+
+#endif
diff --git a/kdevdesigner/designer/workspace.cpp b/kdevdesigner/designer/workspace.cpp
new file mode 100644
index 00000000..db9bd7be
--- /dev/null
+++ b/kdevdesigner/designer/workspace.cpp
@@ -0,0 +1,711 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qvariant.h> // HP-UX compiler needs this here
+#include "workspace.h"
+#include "formwindow.h"
+#include "mainwindow.h"
+#include "globaldefs.h"
+#include "command.h"
+#include "project.h"
+#include "pixmapcollection.h"
+#include "sourcefile.h"
+#include "sourceeditor.h"
+#include "propertyeditor.h"
+
+#include <kiconloader.h>
+#include "kdevdesigner_part.h"
+
+#include <qheader.h>
+#include <qdragobject.h>
+#include <qfileinfo.h>
+#include <qapplication.h>
+#include <qpainter.h>
+#include <qpen.h>
+#include <qobjectlist.h>
+#include <qworkspace.h>
+#include <qpopupmenu.h>
+#include <qtextstream.h>
+#include "qcompletionedit.h"
+
+#include <klocale.h>
+
+WorkspaceItem::WorkspaceItem( QListView *parent, Project* p )
+ : QListViewItem( parent )
+{
+ init();
+ project = p;
+ t = ProjectType;
+ setPixmap( 0, SmallIcon( "designer_folder.png" , KDevDesignerPartFactory::instance()) );
+ setExpandable( FALSE );
+}
+
+WorkspaceItem::WorkspaceItem( QListViewItem *parent, SourceFile* sf )
+ : QListViewItem( parent )
+{
+ init();
+ sourceFile = sf;
+ t = SourceFileType;
+ setPixmap( 0, SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()) );
+}
+
+WorkspaceItem::WorkspaceItem( QListViewItem *parent, QObject *o, Project *p )
+ : QListViewItem( parent )
+{
+ init();
+ object = o;
+ project = p;
+ t = ObjectType;
+ setPixmap( 0, SmallIcon( "designer_object.png" , KDevDesignerPartFactory::instance()) );
+ QObject::connect( p->fakeFormFileFor( o ), SIGNAL( somethingChanged(FormFile*) ),
+ listView(), SLOT( update() ) );
+}
+
+WorkspaceItem::WorkspaceItem( QListViewItem *parent, FormFile* ff, Type type )
+ : QListViewItem( parent )
+{
+ init();
+ formFile = ff;
+ t = type;
+ if ( type == FormFileType ) {
+ setPixmap( 0, SmallIcon( "designer_form.png" , KDevDesignerPartFactory::instance()) );
+ QObject::connect( ff, SIGNAL( somethingChanged(FormFile*) ), listView(), SLOT( update(FormFile*) ) );
+ if ( formFile->supportsCodeFile() ) {
+ (void) new WorkspaceItem( this, formFile, FormSourceType );
+ }
+ } else if ( type == FormSourceType ) {
+ setPixmap( 0, SmallIcon( "designer_filenew.png" , KDevDesignerPartFactory::instance()) );
+ }
+}
+
+
+void WorkspaceItem::init()
+{
+ autoOpen = FALSE;
+ useOddColor = FALSE;
+ project = 0;
+ sourceFile = 0;
+ formFile = 0;
+}
+
+void WorkspaceItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
+{
+ QColorGroup g( cg );
+ g.setColor( QColorGroup::Base, backgroundColor() );
+ g.setColor( QColorGroup::Foreground, Qt::black );
+
+ if ( type() == FormSourceType &&
+ ( !formFile->hasFormCode() || ( formFile->codeFileState() == FormFile::Deleted && formFile->formWindow() ) ) &&
+ parent() && parent()->parent() && ( (WorkspaceItem*)parent()->parent() )->project &&
+ ( (WorkspaceItem*)parent()->parent() )->project->isCpp() ) {
+ g.setColor( QColorGroup::Text, listView()->palette().disabled().color( QColorGroup::Text) );
+ g.setColor( QColorGroup::HighlightedText, listView()->palette().disabled().color( QColorGroup::Text) );
+ } else {
+ g.setColor( QColorGroup::Text, Qt::black );
+ }
+ p->save();
+
+ if ( isModified() ) {
+ QFont f = p->font();
+ f.setBold( TRUE );
+ p->setFont( f );
+ }
+
+ QListViewItem::paintCell( p, g, column, width, align );
+ p->setPen( QPen( cg.dark(), 1 ) );
+ if ( column == 0 )
+ p->drawLine( 0, 0, 0, height() - 1 );
+ if ( listView()->firstChild() != this ) {
+ if ( nextSibling() != itemBelow() && itemBelow()->depth() < depth() ) {
+ int d = depth() - itemBelow()->depth();
+ p->drawLine( -listView()->treeStepSize() * d, height() - 1, 0, height() - 1 );
+ }
+ }
+ p->drawLine( 0, height() - 1, width, height() - 1 );
+ p->drawLine( width - 1, 0, width - 1, height() );
+ p->restore();
+}
+
+QString WorkspaceItem::text( int column ) const
+{
+ if ( column != 0 )
+ return QListViewItem::text( column );
+ switch( t ) {
+ case ProjectType:
+ if ( project->isDummy() ) {
+ return i18n("<No Project>" );
+ } else if ( MainWindow::self->singleProjectMode() ) {
+ return QFileInfo( project->fileName() ).baseName();
+ }
+ return project->makeRelative( project->fileName() );
+ case FormFileType:
+ if ( !MainWindow::self->singleProjectMode() )
+ return formFile->formName() + ": " + formFile->fileName();
+ return formFile->formName();
+ case FormSourceType:
+ if ( !MainWindow::self->singleProjectMode() )
+ return formFile->codeFile();
+ return formFile->formName() + " [Source]";
+ case SourceFileType:
+ return sourceFile->fileName();
+ case ObjectType:
+ if ( !project->hasParentObject( object ) )
+ return object->name();
+ return project->qualifiedName( object );
+ }
+
+ return QString::null; // shut up compiler
+}
+
+void WorkspaceItem::fillCompletionList( QStringList& completion )
+{
+ switch( t ) {
+ case ProjectType:
+ break;
+ case FormFileType:
+ completion += formFile->formName();
+ completion += formFile->fileName();
+ break;
+ case FormSourceType:
+ completion += formFile->codeFile();
+ break;
+ case SourceFileType:
+ completion += sourceFile->fileName();
+ break;
+ case ObjectType:
+ completion += object->name();
+ }
+}
+
+bool WorkspaceItem::checkCompletion( const QString& completion )
+{
+ switch( t ) {
+ case ProjectType:
+ break;
+ case FormFileType:
+ return completion == formFile->formName()
+ || completion == formFile->fileName();
+ case FormSourceType:
+ return completion == formFile->codeFile();
+ case SourceFileType:
+ return completion == sourceFile->fileName();
+ case ObjectType:
+ return completion == object->name();
+ }
+ return FALSE;
+}
+
+
+bool WorkspaceItem::isModified() const
+{
+ switch( t ) {
+ case ProjectType:
+ return project->isModified();
+ case FormFileType:
+ return formFile->isModified( FormFile::WFormWindow );
+ case FormSourceType:
+ return formFile->isModified( FormFile::WFormCode );
+ case SourceFileType:
+ return sourceFile->isModified();
+ case ObjectType:
+ return project->fakeFormFileFor( object )->isModified();
+ break;
+ }
+ return FALSE; // shut up compiler
+}
+
+QString WorkspaceItem::key( int column, bool ) const
+{
+ QString key = text( column );
+ if ( t == FormFileType )
+ key.prepend( "0" );
+ else if ( t == ObjectType )
+ key.prepend( "a" );
+ else
+ key.prepend( "A" );
+ return key;
+}
+
+QColor WorkspaceItem::backgroundColor()
+{
+ bool b = useOddColor;
+ if ( t == FormSourceType && parent() )
+ b = ( ( WorkspaceItem*)parent() )->useOddColor;
+ return b ? *backColor2 : *backColor1;
+}
+
+
+void WorkspaceItem::setOpen( bool b )
+{
+ QListViewItem::setOpen( b );
+ autoOpen = FALSE;
+}
+
+void WorkspaceItem::setAutoOpen( bool b )
+{
+ QListViewItem::setOpen( b );
+ autoOpen = b;
+}
+
+Workspace::Workspace( QWidget *parent, MainWindow *mw )
+ : QListView( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
+ WStyle_Tool | WStyle_MinMax | WStyle_SysMenu ), mainWindow( mw ),
+ project( 0 ), completionDirty( FALSE )
+{
+ init_colors();
+
+ setDefaultRenameAction( Accept );
+ blockNewForms = FALSE;
+ bufferEdit = 0;
+ header()->setStretchEnabled( TRUE );
+ header()->hide();
+ setSorting( 0 );
+ setResizePolicy( QScrollView::Manual );
+#ifndef Q_WS_MAC
+ QPalette p( palette() );
+ p.setColor( QColorGroup::Base, QColor( *backColor2 ) );
+ (void)*selectedBack; // hack
+ setPalette( p );
+#endif
+ addColumn( i18n( "Files" ) );
+ setAllColumnsShowFocus( TRUE );
+ connect( this, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( itemClicked( int, QListViewItem *, const QPoint& ) ) ),
+ connect( this, SIGNAL( doubleClicked( QListViewItem * ) ),
+ this, SLOT( itemDoubleClicked( QListViewItem * ) ) ),
+ connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( rmbClicked( QListViewItem *, const QPoint& ) ) ),
+ setHScrollBarMode( AlwaysOff );
+ setVScrollBarMode( AlwaysOn );
+ viewport()->setAcceptDrops( TRUE );
+ setAcceptDrops( TRUE );
+ setColumnWidthMode( 1, Manual );
+}
+
+
+void Workspace::projectDestroyed( QObject* o )
+{
+ if ( o == project ) {
+ project = 0;
+ clear();
+ }
+}
+
+void Workspace::setCurrentProject( Project *pro )
+{
+ if ( project == pro )
+ return;
+ if ( project ) {
+ disconnect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
+ disconnect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
+ disconnect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
+ disconnect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
+ disconnect( project, SIGNAL( objectAdded(QObject*) ), this, SLOT( objectAdded(QObject*) ) );
+ disconnect( project, SIGNAL( objectRemoved(QObject*) ), this, SLOT( objectRemoved(QObject*) ) );
+ disconnect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
+ }
+ project = pro;
+ connect( project, SIGNAL( sourceFileAdded(SourceFile*) ), this, SLOT( sourceFileAdded(SourceFile*) ) );
+ connect( project, SIGNAL( sourceFileRemoved(SourceFile*) ), this, SLOT( sourceFileRemoved(SourceFile*) ) );
+ connect( project, SIGNAL( formFileAdded(FormFile*) ), this, SLOT( formFileAdded(FormFile*) ) );
+ connect( project, SIGNAL( formFileRemoved(FormFile*) ), this, SLOT( formFileRemoved(FormFile*) ) );
+ connect( project, SIGNAL( destroyed(QObject*) ), this, SLOT( projectDestroyed(QObject*) ) );
+ connect( project, SIGNAL( objectAdded(QObject*) ), this, SLOT( objectAdded(QObject*) ) );
+ connect( project, SIGNAL( objectRemoved(QObject*) ), this, SLOT( objectRemoved(QObject*) ) );
+ connect( project, SIGNAL( projectModified() ), this, SLOT( update() ) );
+ clear();
+
+ if ( bufferEdit )
+ bufferEdit->clear();
+
+ projectItem = new WorkspaceItem( this, project );
+
+ projectItem->setOpen( TRUE );
+
+ for ( QPtrListIterator<SourceFile> sources = project->sourceFiles();
+ sources.current(); ++sources ) {
+ SourceFile* f = sources.current();
+ (void) new WorkspaceItem( projectItem, f );
+ }
+
+ for ( QPtrListIterator<FormFile> forms = project->formFiles();
+ forms.current(); ++forms ) {
+ FormFile* f = forms.current();
+ if ( f->isFake() )
+ continue;
+
+ (void) new WorkspaceItem( projectItem, f );
+ }
+
+ QObjectList l = project->objects();
+ QObjectListIt objs( l );
+ for ( ;objs.current(); ++objs ) {
+ QObject* o = objs.current();
+ (void) new WorkspaceItem( projectItem, o, project );
+ }
+
+ updateColors();
+ completionDirty = TRUE;
+}
+
+void Workspace::sourceFileAdded( SourceFile* sf )
+{
+ (void) new WorkspaceItem( projectItem, sf );
+ updateColors();
+}
+
+void Workspace::sourceFileRemoved( SourceFile* sf )
+{
+ delete findItem( sf );
+ updateColors();
+}
+
+void Workspace::formFileAdded( FormFile* ff )
+{
+ if ( ff->isFake() )
+ return;
+ (void) new WorkspaceItem( projectItem, ff );
+ updateColors();
+}
+
+void Workspace::formFileRemoved( FormFile* ff )
+{
+ delete findItem( ff );
+ updateColors();
+}
+
+void Workspace::objectAdded( QObject *o )
+{
+ (void) new WorkspaceItem( projectItem, o, project );
+ updateColors();
+}
+
+void Workspace::objectRemoved( QObject *o )
+{
+ delete findItem( o );
+ updateColors();
+}
+
+void Workspace::update()
+{
+ completionDirty = TRUE;
+ triggerUpdate();
+}
+
+void Workspace::update( FormFile* ff )
+{
+ QListViewItem* i = findItem( ff );
+ if ( i ) {
+ i->repaint();
+ if ( (i = i->firstChild()) )
+ i->repaint();
+ }
+}
+
+
+void Workspace::activeFormChanged( FormWindow *fw )
+{
+ WorkspaceItem *i = findItem( fw->formFile() );
+ if ( i ) {
+ setCurrentItem( i );
+ setSelected( i, TRUE );
+ if ( !i->isOpen() )
+ i->setAutoOpen( TRUE );
+ }
+
+ closeAutoOpenItems();
+
+}
+
+void Workspace::activeEditorChanged( SourceEditor *se )
+{
+ if ( !se->object() )
+ return;
+
+ if ( se->formWindow() ) {
+ WorkspaceItem *i = findItem( se->formWindow()->formFile() );
+ if ( i && i->firstChild() ) {
+ if ( !i->isOpen() )
+ i->setAutoOpen( TRUE );
+ setCurrentItem( i->firstChild() );
+ setSelected( i->firstChild(), TRUE );
+ }
+ } else {
+ WorkspaceItem *i = findItem( se->sourceFile() );
+ if ( i ) {
+ setCurrentItem( i );
+ setSelected( i, TRUE );
+ }
+ }
+
+ closeAutoOpenItems();
+}
+
+WorkspaceItem *Workspace::findItem( FormFile* ff)
+{
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->formFile == ff )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+WorkspaceItem *Workspace::findItem( SourceFile *sf )
+{
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->sourceFile == sf )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+WorkspaceItem *Workspace::findItem( QObject *o )
+{
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ if ( ( (WorkspaceItem*)it.current() )->object == o )
+ return (WorkspaceItem*)it.current();
+ }
+ return 0;
+}
+
+void Workspace::closeAutoOpenItems()
+{
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+ WorkspaceItem* i = (WorkspaceItem*) it.current();
+ WorkspaceItem* ip = (WorkspaceItem*) i->parent();
+ if ( i->type() == WorkspaceItem::FormSourceType ) {
+ if ( !i->isSelected() && !ip->isSelected()
+ && ip->isAutoOpen() ) {
+ ip->setAutoOpen( FALSE );
+ }
+ }
+ }
+}
+
+
+void Workspace::closeEvent( QCloseEvent *e )
+{
+ e->accept();
+}
+
+void Workspace::itemDoubleClicked( QListViewItem *i )
+{
+ if ( ( (WorkspaceItem*)i)->type()== WorkspaceItem::ProjectType )
+ i->setOpen( TRUE );
+}
+
+void Workspace::itemClicked( int button, QListViewItem *i, const QPoint& )
+{
+ if ( !i || button != LeftButton )
+ return;
+
+ closeAutoOpenItems();
+
+ WorkspaceItem* wi = (WorkspaceItem*)i;
+ switch( wi->type() ) {
+ case WorkspaceItem::ProjectType:
+ break; // ### TODO
+ case WorkspaceItem::FormFileType:
+ wi->formFile->showFormWindow();
+ break;
+ case WorkspaceItem::FormSourceType:
+ wi->formFile->showEditor( FALSE );
+ break;
+ case WorkspaceItem::SourceFileType:
+ mainWindow->editSource( wi->sourceFile );
+ break;
+ case WorkspaceItem::ObjectType:
+ project->fakeFormFileFor( wi->object )->formWindow()->setFocus();
+ mainWindow->propertyeditor()->setWidget( wi->object,
+ project->fakeFormFileFor( wi->object )->formWindow() );
+ mainWindow->objectHierarchy()->
+ setFormWindow( project->fakeFormFileFor( wi->object )->formWindow(), wi->object );
+ project->fakeFormFileFor( wi->object )->showEditor();
+ break;
+ }
+}
+
+void Workspace::contentsDropEvent( QDropEvent *e )
+{
+ if ( !QUriDrag::canDecode( e ) ) {
+ e->ignore();
+ } else {
+ QStringList files;
+ QUriDrag::decodeLocalFiles( e, files );
+ if ( !files.isEmpty() ) {
+ for ( QStringList::Iterator it = files.begin(); it != files.end(); ++it ) {
+ QString fn = *it;
+ mainWindow->fileOpen( "", "", fn );
+ }
+ }
+ }
+}
+
+void Workspace::contentsDragEnterEvent( QDragEnterEvent *e )
+{
+ if ( !QUriDrag::canDecode( e ) )
+ e->ignore();
+ else
+ e->accept();
+}
+
+void Workspace::contentsDragMoveEvent( QDragMoveEvent *e )
+{
+ if ( !QUriDrag::canDecode( e ) )
+ e->ignore();
+ else
+ e->accept();
+}
+
+void Workspace::rmbClicked( QListViewItem *i, const QPoint& pos )
+{
+ if ( !i )
+ return;
+ WorkspaceItem* wi = (WorkspaceItem*)i;
+ enum { OPEN_SOURCE, REMOVE_SOURCE, OPEN_FORM, REMOVE_FORM,
+ OPEN_FORM_SOURCE, REMOVE_FORM_SOURCE, OPEN_OBJECT_SOURCE };
+ QPopupMenu menu( this );
+ menu.setCheckable( TRUE );
+ switch ( wi->type() ) {
+ case WorkspaceItem::SourceFileType:
+ menu.insertItem( i18n( "&Open Source File" ), OPEN_SOURCE );
+ menu.insertSeparator();
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()),
+ i18n( "&Remove Source File From Project" ), REMOVE_SOURCE );
+ break;
+ case WorkspaceItem::FormFileType:
+ menu.insertItem( i18n( "&Open Form" ), OPEN_FORM );
+ menu.insertSeparator();
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()),
+ i18n( "&Remove Form From Project" ), REMOVE_FORM );
+ break;
+ case WorkspaceItem::FormSourceType:
+ menu.insertItem( i18n( "&Open Form Source" ), OPEN_FORM_SOURCE );
+ menu.insertSeparator();
+ if ( project->isCpp() )
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()),
+ i18n( "&Remove Source File From Form" ), REMOVE_FORM_SOURCE );
+ else
+ menu.insertItem( SmallIcon( "designer_editcut.png" , KDevDesignerPartFactory::instance()),
+ i18n( "&Remove Form From Project" ), REMOVE_FORM );
+ break;
+ case WorkspaceItem::ProjectType:
+ MainWindow::self->popupProjectMenu( pos );
+ return;
+ case WorkspaceItem::ObjectType:
+ menu.insertItem( i18n( "&Open Source" ), OPEN_OBJECT_SOURCE );
+ break;
+ }
+
+ switch ( menu.exec( pos ) ) {
+ case REMOVE_SOURCE:
+ project->removeSourceFile( wi->sourceFile );
+ break;
+ case REMOVE_FORM:
+ project->removeFormFile( wi->formFile );
+ break;
+ case REMOVE_FORM_SOURCE:
+ ( (WorkspaceItem*)i )->formFile->setModified( TRUE );
+ ( (WorkspaceItem*)i )->formFile->setCodeFileState( FormFile::Deleted );
+ delete ( (WorkspaceItem*)i )->formFile->editor();
+ break;
+ case OPEN_OBJECT_SOURCE:
+ case OPEN_SOURCE:
+ case OPEN_FORM:
+ case OPEN_FORM_SOURCE:
+ itemClicked( LeftButton, i, pos );
+ break;
+ }
+}
+
+bool Workspace::eventFilter( QObject *o, QEvent * e )
+{
+ // Reggie, on what type of events do we have to execute updateBufferEdit()
+ if ( o ==bufferEdit && e->type() != QEvent::ChildRemoved )
+ updateBufferEdit();
+ return QListView::eventFilter( o, e );
+}
+
+void Workspace::setBufferEdit( QCompletionEdit *edit )
+{
+ bufferEdit = edit;
+ connect( bufferEdit, SIGNAL( chosen( const QString & ) ),
+ this, SLOT( bufferChosen( const QString & ) ) );
+ bufferEdit->installEventFilter( this );
+}
+
+void Workspace::updateBufferEdit()
+{
+ if ( !bufferEdit || !completionDirty || !MainWindow::self)
+ return;
+ completionDirty = FALSE;
+ QStringList completion = MainWindow::self->projectFileNames();
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ ( (WorkspaceItem*)it.current())->fillCompletionList( completion );
+ ++it;
+ }
+ completion.sort();
+ bufferEdit->setCompletionList( completion );
+}
+
+void Workspace::bufferChosen( const QString &buffer )
+{
+ if ( bufferEdit )
+ bufferEdit->setText( "" );
+
+ if ( MainWindow::self->projectFileNames().contains( buffer ) ) {
+ MainWindow::self->setCurrentProjectByFilename( buffer );
+ return;
+ }
+
+ QListViewItemIterator it( this );
+ while ( it.current() ) {
+ if ( ( (WorkspaceItem*)it.current())->checkCompletion( buffer ) ) {
+ itemClicked( LeftButton, it.current(), QPoint() );
+ break;
+ }
+ ++it;
+ }
+}
+
+void Workspace::updateColors()
+{
+ QListViewItem* i = firstChild();
+ if ( i )
+ i = i->firstChild();
+ bool b = TRUE;
+ while ( i ) {
+ WorkspaceItem* wi = ( WorkspaceItem*) i;
+ i = i->nextSibling();
+ wi->useOddColor = b;
+ b = !b;
+ }
+}
diff --git a/kdevdesigner/designer/workspace.h b/kdevdesigner/designer/workspace.h
new file mode 100644
index 00000000..8e710725
--- /dev/null
+++ b/kdevdesigner/designer/workspace.h
@@ -0,0 +1,151 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WORKSPACE_H
+#define WORKSPACE_H
+
+#include <qlistview.h>
+
+class FormWindow;
+class QResizeEvent;
+class QCloseEvent;
+class QDropEvent;
+class QDragMoveEvent;
+class QDragEnterEvent;
+class MainWindow;
+class Project;
+class SourceFile;
+class FormFile;
+class QCompletionEdit;
+class SourceEditor;
+
+class WorkspaceItem : public QListViewItem
+{
+public:
+ enum Type { ProjectType, FormFileType, FormSourceType, SourceFileType, ObjectType };
+
+ WorkspaceItem( QListView *parent, Project* p );
+ WorkspaceItem( QListViewItem *parent, SourceFile* sf );
+ WorkspaceItem( QListViewItem *parent, FormFile* ff, Type t = FormFileType );
+ WorkspaceItem( QListViewItem *parent, QObject *o, Project *p );
+
+ void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
+
+ Type type() const { return t; }
+
+ bool isModified() const;
+
+ QString text( int ) const;
+
+ void fillCompletionList( QStringList& completion );
+ bool checkCompletion( const QString& completion );
+
+ QString key( int, bool ) const; // column sorting key
+
+ Project* project;
+ SourceFile* sourceFile;
+ FormFile* formFile;
+ QObject *object;
+
+ void setOpen( bool );
+
+ void setAutoOpen( bool );
+ bool isAutoOpen() const { return isOpen() && autoOpen; }
+
+ bool useOddColor;
+
+private:
+ void init();
+ bool autoOpen;
+ QColor backgroundColor();
+ Type t;
+};
+
+class Workspace : public QListView
+{
+ Q_OBJECT
+
+public:
+ Workspace( QWidget *parent , MainWindow *mw );
+
+ void setCurrentProject( Project *pro );
+
+ void contentsDropEvent( QDropEvent *e );
+ void contentsDragEnterEvent( QDragEnterEvent *e );
+ void contentsDragMoveEvent( QDragMoveEvent *e );
+
+ void setBufferEdit( QCompletionEdit *edit );
+
+public slots:
+
+ void update();
+ void update( FormFile* );
+
+ void activeFormChanged( FormWindow *fw );
+ void activeEditorChanged( SourceEditor *se );
+
+protected:
+ void closeEvent( QCloseEvent *e );
+ bool eventFilter( QObject *, QEvent * );
+
+
+private slots:
+ void itemClicked( int, QListViewItem *i, const QPoint& pos );
+ void itemDoubleClicked( QListViewItem *i );
+ void rmbClicked( QListViewItem *i, const QPoint& pos );
+ void bufferChosen( const QString &buffer );
+
+ void projectDestroyed( QObject* );
+
+ void sourceFileAdded( SourceFile* );
+ void sourceFileRemoved( SourceFile* );
+
+ void formFileAdded( FormFile* );
+ void formFileRemoved( FormFile* );
+
+ void objectAdded( QObject* );
+ void objectRemoved( QObject * );
+
+private:
+ WorkspaceItem *findItem( FormFile *ff );
+ WorkspaceItem *findItem( SourceFile *sf );
+ WorkspaceItem *findItem( QObject *o );
+
+ void closeAutoOpenItems();
+
+private:
+ MainWindow *mainWindow;
+ Project *project;
+ WorkspaceItem *projectItem;
+ QCompletionEdit *bufferEdit;
+ bool blockNewForms;
+ void updateBufferEdit();
+ bool completionDirty;
+ void updateColors();
+
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/actioninterface.h b/kdevdesigner/interfaces/actioninterface.h
new file mode 100644
index 00000000..75396f04
--- /dev/null
+++ b/kdevdesigner/interfaces/actioninterface.h
@@ -0,0 +1,78 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef ACTIONINTERFACE_H
+#define ACTIONINTERFACE_H
+
+#include <private/qcom_p.h>
+
+class QAction;
+class QObject;
+
+// {bb206e09-84e5-4777-9fce-706babfab931}
+#ifndef IID_Action
+#define IID_Action QUuid( 0xbb206e09, 0x84e5, 0x4777, 0x9f, 0xce, 0x70, 0x6b, 0xab, 0xfa, 0xb9, 0x31 )
+#endif
+
+/*! To add actions to the Qt Designer menubars and toolbars, implement
+ this interface. You have to implement the create(), group() and
+ connectTo() functions.
+
+ You also have to implement the function featureList() (\sa
+ QFeatureListInterface) to return the names of all actions
+ which this interface provides.
+*/
+
+class ActionInterface : public QFeatureListInterface
+{
+public:
+ enum Location {
+ Toolbar,
+ Menu
+ };
+
+ /*! This functions is called to create the action with the name \a
+ name. \a parent should be used as parent of the action.
+
+ In the implementation return the QAction object for the action
+ \a name.
+ */
+ virtual QAction* create( const QString &name, QObject* parent = 0 ) = 0;
+
+ /*! In the implementation of the interface return the name of the
+ group of the action \a name.
+ */
+ virtual QString group( const QString &name ) const = 0;
+
+ /*! In the implementation of the interface return whether the
+ action \a name should appear in the location \a l */
+ virtual bool location( const QString &name, Location l ) const = 0;
+
+ /*! \internal */
+ virtual void connectTo( QUnknownInterface *appInterface ) = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/classbrowserinterface.h b/kdevdesigner/interfaces/classbrowserinterface.h
new file mode 100644
index 00000000..2db43afe
--- /dev/null
+++ b/kdevdesigner/interfaces/classbrowserinterface.h
@@ -0,0 +1,63 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef CLASSBROWSERINTERFACE_H
+#define CLASSBROWSERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qobject.h>
+class QListView;
+
+// {4ede3c32-ae96-4b7a-9e38-9f1d93592391}
+#ifndef IID_ClassBrowser
+#define IID_ClassBrowser QUuid( 0x4ede3c32, 0xae96, 0x4b7a, 0x9e, 0x38, 0x9f, 0x1d, 0x93, 0x59, 0x23, 0x91 )
+#endif
+
+struct ClassBrowserInterface : public QUnknownInterface
+{
+ enum Type { Class, Function };
+
+ virtual QListView *createClassBrowser( QWidget *parent ) const = 0;
+ virtual void update( const QString &code ) const = 0;
+ virtual void clear() const = 0;
+
+ virtual void onClick( QObject *receiver, const char *slot ) = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/designerinterface.h b/kdevdesigner/interfaces/designerinterface.h
new file mode 100644
index 00000000..de7487e2
--- /dev/null
+++ b/kdevdesigner/interfaces/designerinterface.h
@@ -0,0 +1,261 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DESIGNERINTERFACE_H
+#define DESIGNERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qmap.h>
+#include <qstringlist.h>
+#include <qwidgetlist.h>
+#include <qobjectlist.h>
+
+struct DesignerProject;
+struct DesignerDatabase;
+struct DesignerFormWindow;
+struct DesignerDock;
+struct DesignerOutputDock;
+struct DesignerOutput;
+struct DesignerOutputError;
+struct DesignerPixmapCollection;
+struct DesignerSourceFile;
+
+class QDockWindow;
+class QWidget;
+class QObject;
+class QAction;
+class QIconSet;
+class QSqlDatabase;
+
+// {0e661da-f45c-4830-af47-03ec53eb1633}
+#ifndef IID_Designer
+#define IID_Designer QUuid( 0xa0e661da, 0xf45c, 0x4830, 0xaf, 0x47, 0x3, 0xec, 0x53, 0xeb, 0x16, 0x33 )
+#endif
+
+/*! These are the interfaces implemented by the Qt Designer which should
+ be used by plugins to access and use functionality of the Qt Designer.
+*/
+
+struct DesignerInterface : public QUnknownInterface
+{
+ virtual DesignerProject *currentProject() const = 0;
+ virtual DesignerFormWindow *currentForm() const = 0;
+ virtual DesignerSourceFile *currentSourceFile() const = 0;
+ virtual QPtrList<DesignerProject> projectList() const = 0;
+ virtual void showStatusMessage( const QString &, int ms = 0 ) const = 0;
+ virtual DesignerDock *createDock() const = 0;
+ virtual DesignerOutputDock *outputDock() const = 0;
+ virtual void setModified( bool b, QWidget *window ) = 0;
+ virtual void updateFunctionList() = 0;
+
+ virtual void onProjectChange( QObject *receiver, const char *slot ) = 0;
+ virtual void onFormChange( QObject *receiver, const char *slot ) = 0;
+
+ virtual bool singleProjectMode() const = 0;
+ virtual void showError( QWidget *widget, int line, const QString &message ) = 0;
+ virtual void runFinished() = 0;
+ virtual void showStackFrame( QWidget *w, int line ) = 0;
+ virtual void showDebugStep( QWidget *w, int line ) = 0;
+ virtual void runProjectPrecondition() = 0;
+ virtual void runProjectPostcondition( QObjectList *l ) = 0;
+
+ };
+
+struct DesignerProject
+{
+ virtual QPtrList<DesignerFormWindow> formList() const = 0;
+ virtual QStringList formNames() const = 0;
+ virtual QString formFileName( const QString &form ) const = 0;
+ virtual void addForm( DesignerFormWindow * ) = 0;
+ virtual void removeForm( DesignerFormWindow * ) = 0;
+ virtual QString fileName() const = 0;
+ virtual void setFileName( const QString & ) = 0;
+ virtual QString projectName() const = 0;
+ virtual void setProjectName( const QString & ) = 0;
+ virtual QString databaseFile() const = 0;
+ virtual void setDatabaseFile( const QString & ) = 0;
+ virtual void setupDatabases() const = 0;
+ virtual QPtrList<DesignerDatabase> databaseConnections() const = 0;
+ virtual void addDatabase( DesignerDatabase * ) = 0;
+ virtual void removeDatabase( DesignerDatabase * ) = 0;
+ virtual void save() const = 0;
+ virtual void setLanguage( const QString & ) = 0;
+ virtual QString language() const = 0;
+ virtual void setCustomSetting( const QString &key, const QString &value ) = 0;
+ virtual QString customSetting( const QString &key ) const = 0;
+ virtual DesignerPixmapCollection *pixmapCollection() const = 0;
+ virtual void breakPoints( QMap<QString, QValueList<uint> > &bps ) const = 0;
+ virtual QString breakPointCondition( QObject *o, int line ) const = 0;
+ virtual void setBreakPointCondition( QObject *o, int line, const QString &condition ) = 0;
+ virtual void clearAllBreakpoints() const = 0;
+ virtual void setIncludePath( const QString &platform, const QString &path ) = 0;
+ virtual void setLibs( const QString &platform, const QString &path ) = 0;
+ virtual void setDefines( const QString &platform, const QString &path ) = 0;
+ virtual void setConfig( const QString &platform, const QString &config ) = 0;
+ virtual void setTemplate( const QString &t ) = 0;
+ virtual QString config( const QString &platform ) const = 0;
+ virtual QString libs( const QString &platform ) const = 0;
+ virtual QString defines( const QString &platform ) const = 0;
+ virtual QString includePath( const QString &platform ) const = 0;
+ virtual QString templte() const = 0;
+ virtual bool isGenericObject( QObject *o ) const = 0;
+
+};
+
+struct DesignerDatabase
+{
+ virtual QString name() const = 0;
+ virtual void setName( const QString & ) = 0;
+ virtual QString driver() const = 0;
+ virtual void setDriver( const QString & ) = 0;
+ virtual QString database() const = 0;
+ virtual void setDatabase( const QString & ) = 0;
+ virtual QString userName() const = 0;
+ virtual void setUserName( const QString & ) = 0;
+ virtual QString password() const = 0;
+ virtual void setPassword( const QString & ) = 0;
+ virtual QString hostName() const = 0;
+ virtual void setHostName( const QString & ) = 0;
+ virtual QStringList tables() const = 0;
+ virtual void setTables( const QStringList & ) = 0;
+ virtual QMap<QString, QStringList> fields() const = 0;
+ virtual void setFields( const QMap<QString, QStringList> & ) = 0;
+ virtual void open( bool suppressDialog = FALSE ) const = 0;
+ virtual void close() const = 0;
+ virtual QSqlDatabase* connection() = 0;
+
+};
+
+struct DesignerPixmapCollection
+{
+ virtual void addPixmap( const QPixmap &p, const QString &name, bool force ) = 0;
+ virtual QPixmap pixmap( const QString &name ) const = 0;
+};
+
+struct DesignerFormWindow
+{
+ virtual QString name() const = 0;
+ virtual void setName( const QString &n ) = 0;
+ virtual QString fileName() const = 0;
+ virtual void setFileName( const QString & ) = 0;
+ virtual void save() const = 0;
+ virtual bool isModified() const = 0;
+ virtual void insertWidget( QWidget * ) = 0;
+ virtual void removeWidget( QWidget * ) = 0;
+ virtual QWidget *create( const char *className, QWidget *parent, const char *name ) = 0;
+ virtual QWidgetList widgets() const = 0;
+ virtual void undo() = 0;
+ virtual void redo() = 0;
+ virtual void cut() = 0;
+ virtual void copy() = 0;
+ virtual void paste() = 0;
+ virtual void adjustSize() = 0;
+ virtual void editConnections() = 0;
+ virtual void checkAccels() = 0;
+ virtual void layoutH() = 0;
+ virtual void layoutV() = 0;
+ virtual void layoutHSplit() = 0;
+ virtual void layoutVSplit() = 0;
+ virtual void layoutG() = 0;
+ virtual void layoutHContainer( QWidget* w ) = 0;
+ virtual void layoutVContainer( QWidget* w ) = 0;
+ virtual void layoutGContainer( QWidget* w ) = 0;
+ virtual void breakLayout() = 0;
+ virtual void selectWidget( QWidget * w ) = 0;
+ virtual void selectAll() = 0;
+ virtual void clearSelection() = 0;
+ virtual bool isWidgetSelected( QWidget * ) const = 0;
+ virtual QWidgetList selectedWidgets() const = 0;
+ virtual QWidget *currentWidget() const = 0;
+ virtual QWidget *form() const = 0;
+ virtual void setCurrentWidget( QWidget * ) = 0;
+ virtual QPtrList<QAction> actionList() const = 0;
+ virtual QAction *createAction( const QString& text, const QIconSet& icon, const QString& menuText, int accel,
+ QObject* parent, const char* name = 0, bool toggle = FALSE ) = 0;
+ virtual void addAction( QAction * ) = 0;
+ virtual void removeAction( QAction * ) = 0;
+ virtual void preview() const = 0;
+ virtual void addFunction( const QCString &slot, const QString &specifier, const QString &access,
+ const QString &type, const QString &language, const QString &returnType ) = 0;
+ virtual void addConnection( QObject *sender, const char *signal, QObject *receiver, const char *slot ) = 0;
+ virtual void setProperty( QObject *o, const char *property, const QVariant &value ) = 0;
+ virtual QVariant property( QObject *o, const char *property ) const = 0;
+ virtual void setPropertyChanged( QObject *o, const char *property, bool changed ) = 0;
+ virtual bool isPropertyChanged( QObject *o, const char *property ) const = 0;
+ virtual void setColumnFields( QObject *o, const QMap<QString, QString> & ) = 0;
+ virtual QStringList implementationIncludes() const = 0;
+ virtual QStringList declarationIncludes() const = 0;
+ virtual void setImplementationIncludes( const QStringList &lst ) = 0;
+ virtual void setDeclarationIncludes( const QStringList &lst ) = 0;
+ virtual QStringList forwardDeclarations() const = 0;
+ virtual void setForwardDeclarations( const QStringList &lst ) = 0;
+ virtual QStringList signalList() const = 0;
+ virtual void setSignalList( const QStringList &lst ) = 0;
+ virtual void addMenu( const QString &text, const QString &name ) = 0;
+ virtual void addMenuAction( const QString &menu, QAction *a ) = 0;
+ virtual void addMenuSeparator( const QString &menu ) = 0;
+ virtual void addToolBar( const QString &text, const QString &name ) = 0;
+ virtual void addToolBarAction( const QString &tb, QAction *a ) = 0;
+ virtual void addToolBarSeparator( const QString &tb ) = 0;
+
+ virtual void onModificationChange( QObject *receiver, const char *slot ) = 0;
+};
+
+struct DesignerSourceFile
+{
+ virtual QString fileName() const = 0;
+};
+
+struct DesignerDock
+{
+ virtual QDockWindow *dockWindow() const = 0;
+};
+
+struct DesignerOutputDock
+{
+ virtual QWidget *addView( const QString &pageName ) = 0;
+ virtual void appendDebug( const QString & ) = 0;
+ virtual void clearDebug() = 0;
+ virtual void appendError( const QString &, int ) = 0;
+ virtual void clearError() = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/editorinterface.h b/kdevdesigner/interfaces/editorinterface.h
new file mode 100644
index 00000000..0aff6c4f
--- /dev/null
+++ b/kdevdesigner/interfaces/editorinterface.h
@@ -0,0 +1,102 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef EDITORINTERFACE_H
+#define EDITORINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qmap.h>
+#include <qvaluelist.h>
+
+class QWidget;
+class QObjectList;
+class QObject;
+
+// {8668161a-6037-4220-86b6-ccaa20127df8}
+#ifndef IID_Editor
+#define IID_Editor QUuid( 0x8668161a, 0x6037, 0x4220, 0x86, 0xb6, 0xcc, 0xaa, 0x20, 0x12, 0x7d, 0xf8 )
+#endif
+
+struct EditorInterface : public QUnknownInterface
+{
+ enum Mode
+ {
+ Editing,
+ Debugging
+ };
+
+ virtual QWidget *editor( bool readOnly,
+ QWidget *parent,
+ QUnknownInterface *designerIface ) = 0;
+
+ virtual void setText( const QString &txt ) = 0;
+ virtual QString text() const = 0;
+ virtual bool isUndoAvailable() const = 0;
+ virtual bool isRedoAvailable() const = 0;
+ virtual void undo() = 0;
+ virtual void redo() = 0;
+ virtual void cut() = 0;
+ virtual void copy() = 0;
+ virtual void paste() = 0;
+ virtual void selectAll() = 0;
+ virtual bool find( const QString &expr, bool cs, bool wo, bool forward, bool startAtCursor ) = 0;
+ virtual bool replace( const QString &find, const QString &replace, bool cs, bool wo, bool forward, bool startAtCursor, bool replaceAll ) = 0;
+ virtual void gotoLine( int line ) = 0;
+ virtual void indent() = 0;
+ virtual void scrollTo( const QString &txt, const QString &first ) = 0;
+ virtual void splitView() = 0;
+ virtual void setContext( QObject *this_ ) = 0;
+ virtual void setError( int line ) = 0;
+ virtual void setStep( int line ) = 0;
+ virtual void setStackFrame( int line ) = 0;
+ virtual void clearStep() = 0;
+ virtual void clearStackFrame() = 0;
+ virtual void readSettings() = 0;
+ virtual void setModified( bool m ) = 0;
+ virtual bool isModified() const = 0;
+ virtual int numLines() const = 0;
+ virtual void breakPoints( QValueList<uint> &l ) const = 0;
+ virtual void setBreakPoints( const QValueList<uint> &l ) = 0;
+ virtual void setMode( Mode m ) = 0;
+
+ virtual void onBreakPointChange( QObject *receiver, const char *slot ) = 0;
+
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/filterinterface.h b/kdevdesigner/interfaces/filterinterface.h
new file mode 100644
index 00000000..98abd250
--- /dev/null
+++ b/kdevdesigner/interfaces/filterinterface.h
@@ -0,0 +1,68 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef FILTERINTERFACE_H
+#define FILTERINTERFACE_H
+
+#include <private/qcom_p.h>
+
+// {ea8cb381-59b5-44a8-bae5-9bea8295762a}
+#ifndef IID_ImportFilter
+#define IID_ImportFilter QUuid( 0xea8cb381, 0x59b5, 0x44a8, 0xba, 0xe5, 0x9b, 0xea, 0x82, 0x95, 0x76, 0x2a )
+#endif
+
+/*! If you write a filter plugin to import dialogs or other user
+ interfaces from a different format than .ui into the Qt Designer,
+ implement this interface in that plugin.
+
+ You also have to implement the function featureList() (\sa
+ QFeatureListInterface) and return there all filters (names of it)
+ which this interface provides.
+*/
+
+struct ImportFilterInterface : public QFeatureListInterface
+{
+ /*! This function is called by Qt Designer to open the file \a
+ filename using the filter \a filter. Qt Designer expects to get
+ back one or more .ui files, which it can open then. In the
+ implementation of the interface you have to return these
+ filenames, which the filter created, in this function.*/
+ virtual QStringList import( const QString &filter, const QString &filename ) = 0;
+};
+
+// *************** INTERNAL *************************
+
+// {c32a07e0-b006-471e-afca-d227457a1280}
+#ifndef IID_ExportFilterInterface
+#define IID_ExportFilterInterface QUuid( 0xc32a07e0, 0xb006, 0x471e, 0xaf, 0xca, 0xd2, 0x27, 0x45, 0x7a, 0x12, 0x80 )
+#endif
+
+struct ExportFilterInterface : public QFeatureListInterface
+{
+// virtual QStringList export( const QString& filter, const QString& filename ) = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/interpreterinterface.h b/kdevdesigner/interfaces/interpreterinterface.h
new file mode 100644
index 00000000..8a64e6fc
--- /dev/null
+++ b/kdevdesigner/interfaces/interpreterinterface.h
@@ -0,0 +1,59 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef INTERPRETERINTERFACE_H
+#define INTERPRETERINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+
+class QObject;
+
+// {11cad9ec-4e3c-418b-8e90-e1b8c0c1f48f}
+#ifndef IID_Interpreter
+#define IID_Interpreter QUuid( 0x11cad9ec, 0x4e3c, 0x418b, 0x8e, 0x90, 0xe1, 0xb8, 0xc0, 0xc1, 0xf4, 0x8f )
+#endif
+
+struct InterpreterInterface : public QUnknownInterface
+{
+ virtual void setBreakPoints( QObject *obj, const QValueList<uint> &lst ) = 0;
+};
+
+
+
+#endif
diff --git a/kdevdesigner/interfaces/languageinterface.h b/kdevdesigner/interfaces/languageinterface.h
new file mode 100644
index 00000000..6fc0b8f9
--- /dev/null
+++ b/kdevdesigner/interfaces/languageinterface.h
@@ -0,0 +1,131 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LANGUAGEINTERFACE_H
+#define LANGUAGEINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qvaluelist.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include <qstrlist.h>
+
+// {f208499a-6f69-4883-9219-6e936e55a330}
+#ifndef IID_Language
+#define IID_Language QUuid( 0xf208499a, 0x6f69, 0x4883, 0x92, 0x19, 0x6e, 0x93, 0x6e, 0x55, 0xa3, 0x30 )
+#endif
+
+struct LanguageInterface : public QUnknownInterface
+{
+ struct Function
+ {
+ QString name;
+ QString body;
+ QString returnType;
+ QString comments;
+ int start;
+ int end;
+ QString access;
+ bool operator==( const Function &f ) const {
+ return ( name == f.name &&
+ body == f.body &&
+ returnType == f.returnType &&
+ comments == f.comments );
+ }
+ };
+
+ struct Connection
+ {
+ QString sender;
+ QString signal;
+ QString slot;
+ bool operator==( const Connection &c ) const {
+ return ( sender == c.sender &&
+ signal == c.signal &&
+ slot == c.slot );
+ }
+ };
+
+ enum Support
+ {
+ ReturnType,
+ ConnectionsToCustomSlots,
+ CompressProject
+ };
+
+ virtual void functions( const QString &code, QValueList<Function> *funcs ) const = 0;
+ virtual void connections( const QString &code, QValueList<Connection> *connections ) const = 0;
+ virtual QString createFunctionStart( const QString &className, const QString &func,
+ const QString &returnType, const QString &access ) = 0;
+ virtual QString createArguments( const QString &cpp_signature ) = 0;
+ virtual QString createEmptyFunction() = 0;
+ virtual QStringList definitions() const = 0;
+ virtual QStringList definitionEntries( const QString &definition, QUnknownInterface *designerIface ) const = 0;
+ virtual void setDefinitionEntries( const QString &definition, const QStringList &entries, QUnknownInterface *designerIface ) = 0;
+ virtual bool supports( Support s ) const = 0;
+ virtual QStringList fileFilterList() const = 0;
+ virtual QStringList fileExtensionList() const = 0;
+ virtual void preferedExtensions( QMap<QString, QString> &extensionMap ) const = 0;
+ virtual QString projectKeyForExtension( const QString &extension ) const = 0;
+ virtual void sourceProjectKeys( QStringList &keys ) const = 0;
+ virtual QString cleanSignature( const QString &sig ) = 0;
+ virtual void loadFormCode( const QString &form, const QString &filename,
+ QValueList<Function> &functions,
+ QStringList &vars,
+ QValueList<Connection> &connections ) = 0;
+ virtual QString formCodeExtension() const = 0;
+
+ virtual bool canConnect( const QString &signal, const QString &slot ) = 0;
+
+ virtual void compressProject( const QString &projectFile, const QString &compressedFile,
+ bool withWarning ) = 0;
+ virtual QString uncompressProject( const QString &projectFile, const QString &destDir ) = 0;
+ virtual QString aboutText() const = 0;
+
+ virtual void addConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot,
+ QString *code ) = 0;
+ virtual void removeConnection( const QString &sender, const QString &signal,
+ const QString &receiver, const QString &slot,
+ QString *code ) = 0;
+ virtual QStrList signalNames( QObject *obj ) const = 0;
+
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/preferenceinterface.h b/kdevdesigner/interfaces/preferenceinterface.h
new file mode 100644
index 00000000..880fe285
--- /dev/null
+++ b/kdevdesigner/interfaces/preferenceinterface.h
@@ -0,0 +1,68 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PREFERENCEINTERFACE_H
+#define PREFERENCEINTERFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qwidgetlist.h>
+#include <qcstring.h>
+
+// {5c168ee7-4bee-469f-9995-6afdb04ce5a2}
+#ifndef IID_Preference
+#define IID_Preference QUuid( 0x5c168ee7, 0x4bee, 0x469f, 0x99, 0x95, 0x6a, 0xfd, 0xb0, 0x4c, 0xe5, 0xa2 )
+#endif
+
+struct PreferenceInterface : public QUnknownInterface
+{
+ struct Preference
+ {
+ QWidget *tab;
+ QString title;
+ QObject *receiver;
+ const char *init_slot;
+ const char *accept_slot;
+ };
+
+ virtual Preference *preference() = 0;
+ virtual void connectTo( QUnknownInterface *appInterface ) = 0;
+ virtual void deletePreferenceObject( Preference * ) = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/projectsettingsiface.h b/kdevdesigner/interfaces/projectsettingsiface.h
new file mode 100644
index 00000000..ee571a7b
--- /dev/null
+++ b/kdevdesigner/interfaces/projectsettingsiface.h
@@ -0,0 +1,69 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PROJECTSETTINGSIFACE_H
+#define PROJECTSETTINGSIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qwidgetlist.h>
+#include <qcstring.h>
+
+// {d332785d-17fb-4894-84fe-50dbd0ad9512}
+#ifndef IID_ProjectSettings
+#define IID_ProjectSettings QUuid( 0xd332785d, 0x17fb, 0x4894, 0x84, 0xfe, 0x50, 0xdb, 0xd0, 0xad, 0x95, 0x12 )
+#endif
+
+struct ProjectSettingsInterface : public QUnknownInterface
+{
+ struct ProjectSettings
+ {
+ QWidget *tab;
+ QString title;
+ QObject *receiver;
+ const char *init_slot;
+ const char *accept_slot;
+ };
+
+ virtual ProjectSettings *projectSetting() = 0;
+ virtual QStringList projectSettings() const = 0;
+ virtual void connectTo( QUnknownInterface *appInterface ) = 0;
+ virtual void deleteProjectSettingsObject( ProjectSettings * ) = 0;
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/sourcetemplateiface.h b/kdevdesigner/interfaces/sourcetemplateiface.h
new file mode 100644
index 00000000..c1dc2a74
--- /dev/null
+++ b/kdevdesigner/interfaces/sourcetemplateiface.h
@@ -0,0 +1,65 @@
+ /**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SOURCETEMPLATEIFACE_H
+#define SOURCETEMPLATEIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+#include <qstring.h>
+
+// {1b3446a4-1c71-424b-8789-1f34eb5697d8}
+#ifndef IID_SourceTemplate
+#define IID_SourceTemplate QUuid( 0x1b3446a4, 0x1c71, 0x424b, 0x87, 0x89, 0x1f, 0x34, 0xeb, 0x56, 0x97, 0xd8 )
+#endif
+
+struct SourceTemplateInterface : public QFeatureListInterface
+{
+ struct Source
+ {
+ QString code;
+ enum Type { FileName, Unnamed, Invalid } type;
+ QString filename;
+ QString extension;
+ };
+ virtual Source create( const QString &templ, QUnknownInterface *appIface ) = 0;
+ virtual QString language( const QString &templ ) const = 0;
+
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/templatewizardiface.h b/kdevdesigner/interfaces/templatewizardiface.h
new file mode 100644
index 00000000..82b204da
--- /dev/null
+++ b/kdevdesigner/interfaces/templatewizardiface.h
@@ -0,0 +1,60 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef TEMPLATEWIZARDIFACE_H
+#define TEMPLATEWIZARDIFACE_H
+
+//
+// W A R N I N G -- PRIVATE INTERFACES
+// --------------------------------------
+//
+// This file and the interfaces declared in the file are not
+// public. It exists for internal purpose. This header file and
+// interfaces may change from version to version (even binary
+// incompatible) without notice, or even be removed.
+//
+// We mean it.
+//
+//
+
+#include <private/qcom_p.h>
+
+class QWidget;
+struct DesignerFormWindow;
+
+// {983d3eab-fea3-49cc-97ad-d8cc89b7c17b}
+#ifndef IID_TemplateWizard
+#define IID_TemplateWizard QUuid( 0x983d3eab, 0xfea3, 0x49cc, 0x97, 0xad, 0xd8, 0xcc, 0x89, 0xb7, 0xc1, 0x7b )
+#endif
+
+class TemplateWizardInterface : public QFeatureListInterface
+{
+public:
+ virtual void setup( const QString &templ, QWidget *widget, DesignerFormWindow *fw, QUnknownInterface *appIface ) = 0;
+
+};
+
+#endif
diff --git a/kdevdesigner/interfaces/widgetinterface.h b/kdevdesigner/interfaces/widgetinterface.h
new file mode 100644
index 00000000..9b6d8f8e
--- /dev/null
+++ b/kdevdesigner/interfaces/widgetinterface.h
@@ -0,0 +1,35 @@
+ /**********************************************************************
+** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WIDGETINTERFACE_H
+#define WIDGETINTERFACE_H
+
+#include <private/qwidgetinterface_p.h>
+
+#define WidgetInterface QWidgetFactoryInterface
+#define IID_Widget IID_QWidgetFactory
+
+#endif
diff --git a/kdevdesigner/plugins/Makefile.am b/kdevdesigner/plugins/Makefile.am
new file mode 100644
index 00000000..defe80c4
--- /dev/null
+++ b/kdevdesigner/plugins/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = -I$(top_srcdir)/interfaces $(all_includes)
+METASOURCES = AUTO
+kdevdesignerdir = $(kde_moduledir)/plugins/kdevdesigner
+kdevdesigner_LTLIBRARIES = libkdevdesigner_lang.la
+libkdevdesigner_lang_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+libkdevdesigner_lang_la_SOURCES = languageinterfaceimpl.cpp
+libkdevdesigner_lang_la_LIBADD = $(LIB_QT)
+
diff --git a/kdevdesigner/plugins/languageinterfaceimpl.cpp b/kdevdesigner/plugins/languageinterfaceimpl.cpp
new file mode 100644
index 00000000..37077922
--- /dev/null
+++ b/kdevdesigner/plugins/languageinterfaceimpl.cpp
@@ -0,0 +1,237 @@
+/**********************************************************************
+**
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "languageinterfaceimpl.h"
+#include <qobject.h>
+#include "../interfaces/designerinterface.h"
+#include <qfile.h>
+//#include "yyreg.h"
+#include <qmetaobject.h>
+
+LanguageInterfaceImpl::LanguageInterfaceImpl( QUnknownInterface *outer )
+ : parent( outer ), ref( 0 )
+{
+}
+
+ulong LanguageInterfaceImpl::addRef()
+{
+ return parent ? parent->addRef() : ref++;
+}
+
+ulong LanguageInterfaceImpl::release()
+{
+ if ( parent )
+ return parent->release();
+ if ( !--ref ) {
+ delete this;
+ return 0;
+ }
+ return ref;
+}
+
+QRESULT LanguageInterfaceImpl::queryInterface( const QUuid &uuid, QUnknownInterface** iface )
+{
+ if ( parent )
+ return parent->queryInterface( uuid, iface );
+
+ *iface = 0;
+ if ( uuid == IID_QUnknown )
+ *iface = (QUnknownInterface*)this;
+ else if ( uuid == IID_Language )
+ *iface = (LanguageInterface*)this;
+ else
+ return QE_NOINTERFACE;
+
+ (*iface)->addRef();
+ return QS_OK;
+}
+
+
+class NormalizeObject : public QObject
+{
+public:
+ NormalizeObject() : QObject() {}
+ static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); }
+};
+
+void LanguageInterfaceImpl::functions( const QString &code, QValueList<Function> *functionMap ) const
+{
+/* QValueList<CppFunction> l;
+ extractCppFunctions( code, &l );
+ for ( QValueList<CppFunction>::Iterator it = l.begin(); it != l.end(); ++it ) {
+ Function func;
+ func.name = (*it).prototype();
+ func.name.remove( 0, (*it).returnType().length() );
+ if ( func.name.find( "::" ) == -1 )
+ continue;
+ func.name.remove( (uint)0, func.name.find( "::" ) + 2 );
+ func.body = (*it).body();
+ func.returnType = (*it).returnType();
+ func.start = (*it).functionStartLineNum();
+ func.end = (*it).closingBraceLineNum();
+ functionMap->append( func );
+ }*/
+}
+
+QString LanguageInterfaceImpl::createFunctionStart( const QString &className, const QString &func,
+ const QString &returnType,
+ const QString & )
+{
+ return returnType + " " + className + "::" + func;
+}
+
+QStringList LanguageInterfaceImpl::definitions() const
+{
+ QStringList lst;
+ lst << "Includes (in Implementation)" << "Includes (in Declaration)" << "Forward Declarations" << "Signals";
+ return lst;
+}
+
+QStringList LanguageInterfaceImpl::definitionEntries( const QString &definition, QUnknownInterface *designerIface ) const
+{
+ DesignerInterface *iface = 0;
+ designerIface->queryInterface( IID_Designer, (QUnknownInterface**) &iface );
+ if ( !iface )
+ return QStringList();
+ DesignerFormWindow *fw = iface->currentForm();
+ if ( !fw )
+ return QStringList();
+ QStringList lst;
+ if ( definition == "Includes (in Implementation)" ) {
+ lst = fw->implementationIncludes();
+ } else if ( definition == "Includes (in Declaration)" ) {
+ lst = fw->declarationIncludes();
+ } else if ( definition == "Forward Declarations" ) {
+ lst = fw->forwardDeclarations();
+ } else if ( definition == "Signals" ) {
+ lst = fw->signalList();
+ }
+ iface->release();
+ return lst;
+}
+
+void LanguageInterfaceImpl::setDefinitionEntries( const QString &definition, const QStringList &entries, QUnknownInterface *designerIface )
+{
+ DesignerInterface *iface = 0;
+ designerIface->queryInterface( IID_Designer, (QUnknownInterface**) &iface );
+ if ( !iface )
+ return;
+ DesignerFormWindow *fw = iface->currentForm();
+ if ( !fw )
+ return;
+ if ( definition == "Includes (in Implementation)" ) {
+ fw->setImplementationIncludes( entries );
+ } else if ( definition == "Includes (in Declaration)" ) {
+ fw->setDeclarationIncludes( entries );
+ } else if ( definition == "Forward Declarations" ) {
+ fw->setForwardDeclarations( entries );
+ } else if ( definition == "Signals" ) {
+ fw->setSignalList( entries );
+ }
+ iface->release();
+}
+
+QString LanguageInterfaceImpl::createEmptyFunction()
+{
+ return "{\n\n}\n";
+}
+
+bool LanguageInterfaceImpl::supports( Support s ) const
+{
+ if ( s == ReturnType )
+ return TRUE;
+ if ( s == ConnectionsToCustomSlots )
+ return TRUE;
+ return FALSE;
+}
+
+QStringList LanguageInterfaceImpl::fileFilterList() const
+{
+ QStringList f;
+ f << "C++ Files (*.cpp *.C *.cxx *.c++ *.ocl *.c *.h *.H *.hpp *.hxx)";
+ return f;
+
+}
+QStringList LanguageInterfaceImpl::fileExtensionList() const
+{
+ QStringList f;
+ f << "cpp" << "ocl" << "C" << "cxx" << "c++" << "c" <<"h" << "H" << "hpp" << "hxx";
+ return f;
+}
+
+QString LanguageInterfaceImpl::projectKeyForExtension( const QString &extension ) const
+{
+ if ( extension[ 0 ] == 'c' || extension[ 0 ] == 'C' )
+ return "SOURCES";
+ return "HEADERS";
+}
+
+void LanguageInterfaceImpl::sourceProjectKeys( QStringList &keys ) const
+{
+ keys << "HEADERS" << "SOURCES";
+}
+
+ class CheckObject : public QObject
+{
+public:
+ CheckObject() {}
+ bool checkConnectArgs( const char *signal, const char *member ) { return QObject::checkConnectArgs( signal, 0, member ); }
+
+};
+
+bool LanguageInterfaceImpl::canConnect( const QString &signal, const QString &slot )
+{
+ CheckObject o;
+ return o.checkConnectArgs( signal.latin1(), slot.latin1() );
+}
+
+void LanguageInterfaceImpl::loadFormCode( const QString &, const QString &filename,
+ QValueList<Function> &functions,
+ QStringList &,
+ QValueList<Connection> & )
+{
+ QFile f( filename );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ QTextStream ts( &f );
+ QString code( ts.read() );
+ this->functions( code, &functions );
+}
+
+void LanguageInterfaceImpl::preferedExtensions( QMap<QString, QString> &extensionMap ) const
+{
+ extensionMap.insert( "cpp", "C++ Source File" );
+ extensionMap.insert( "h", "C++ Header File" );
+}
+
+QStrList LanguageInterfaceImpl::signalNames( QObject *obj ) const
+{
+ QStrList sigs;
+ sigs = obj->metaObject()->signalNames( TRUE );
+ sigs.remove( "destroyed()" );
+ return sigs;
+}
diff --git a/kdevdesigner/plugins/languageinterfaceimpl.h b/kdevdesigner/plugins/languageinterfaceimpl.h
new file mode 100644
index 00000000..d8cb9cf2
--- /dev/null
+++ b/kdevdesigner/plugins/languageinterfaceimpl.h
@@ -0,0 +1,83 @@
+/**********************************************************************
+**
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef LANGUAGEINTERFACEIMPL_H
+#define LANGUAGEINTERFACEIMPL_H
+
+#include "../interfaces/languageinterface.h"
+
+class LanguageInterfaceImpl : public LanguageInterface
+{
+public:
+ LanguageInterfaceImpl( QUnknownInterface *outer = 0 );
+
+ ulong addRef();
+ ulong release();
+
+ QRESULT queryInterface( const QUuid&, QUnknownInterface** );
+
+ void functions( const QString &code, QValueList<Function> *funcs ) const;
+ void connections( const QString &, QValueList<Connection> * ) const {};
+ QString createFunctionStart( const QString &className, const QString &func,
+ const QString &returnType, const QString &access );
+ QStringList definitions() const;
+ QStringList definitionEntries( const QString &definition, QUnknownInterface *designerIface ) const;
+ void setDefinitionEntries( const QString &definition, const QStringList &entries, QUnknownInterface *designerIface );
+ QString createArguments( const QString & ) { return QString::null; }
+ QString createEmptyFunction();
+ bool supports( Support s ) const;
+ QStringList fileFilterList() const;
+ QStringList fileExtensionList() const;
+ void preferedExtensions( QMap<QString, QString> &extensionMap ) const;
+ void sourceProjectKeys( QStringList &keys ) const;
+ QString projectKeyForExtension( const QString &extension ) const;
+ QString cleanSignature( const QString &sig ) { return sig; } // #### implement me
+ void loadFormCode( const QString &, const QString &,
+ QValueList<Function> &,
+ QStringList &,
+ QValueList<Connection> & );
+ QString formCodeExtension() const { return ".h"; }
+ bool canConnect( const QString &signal, const QString &slot );
+ void compressProject( const QString &, const QString &, bool ) {}
+ QString uncompressProject( const QString &, const QString & ) { return QString::null; }
+ QString aboutText() const { return ""; }
+
+ void addConnection( const QString &, const QString &,
+ const QString &, const QString &,
+ QString * ) {}
+ void removeConnection( const QString &, const QString &,
+ const QString &, const QString &,
+ QString * ) {}
+ QStrList signalNames( QObject *obj ) const;
+
+private:
+ QUnknownInterface *parent;
+ ulong ref;
+
+};
+
+#endif
diff --git a/kdevdesigner/shared/Makefile.am b/kdevdesigner/shared/Makefile.am
new file mode 100644
index 00000000..ea86ae94
--- /dev/null
+++ b/kdevdesigner/shared/Makefile.am
@@ -0,0 +1,6 @@
+KDE_CXXFLAGS = -UQT_NO_ASCII_CAST
+INCLUDES = -I$(top_srcdir)/lib/interfaces/external $(all_includes)
+METASOURCES = AUTO
+libshared_la_LDFLAGS = $(all_libraries)
+noinst_LTLIBRARIES = libshared.la
+libshared_la_SOURCES = domtool.cpp parser.cpp ui2uib.cpp uib.cpp widgetdatabase.cpp
diff --git a/kdevdesigner/shared/domtool.cpp b/kdevdesigner/shared/domtool.cpp
new file mode 100644
index 00000000..492ce88e
--- /dev/null
+++ b/kdevdesigner/shared/domtool.cpp
@@ -0,0 +1,453 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "domtool.h"
+
+#include <qsizepolicy.h>
+#include <qcolor.h>
+#include <qcursor.h>
+#include <qdatetime.h>
+#include <qrect.h>
+#include <qsize.h>
+#include <qfont.h>
+#include <qdom.h>
+
+/*!
+ \class DomTool domtool.h
+ \brief Tools for the dom
+
+ A collection of static functions used by Resource (part of the
+ designer) and Uic.
+
+*/
+
+/*!
+ Returns the contents of property \a name of object \a e as
+ variant or the variant passed as \a defValue if the property does
+ not exist.
+
+ \sa hasProperty()
+*/
+QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment )
+{
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return elementToVariant( n.firstChild().toElement(), defValue, comment );
+ }
+ }
+ return defValue;
+}
+
+
+/*!
+ \overload
+ */
+QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue )
+{
+ QString comment;
+ return readProperty( e, name, defValue, comment );
+}
+
+/*!
+ Returns wheter object \a e defines property \a name or not.
+
+ \sa readProperty()
+ */
+bool DomTool::hasProperty( const QDomElement& e, const QString& name )
+{
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type )
+{
+ QStringList result;
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "property" ) {
+ QDomElement n2 = n.firstChild().toElement();
+ if ( n2.tagName() == type )
+ result += n.attribute( "name" );
+ }
+ }
+ return result;
+}
+
+
+QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue )
+{
+ QString dummy;
+ return elementToVariant( e, defValue, dummy );
+}
+
+/*!
+ Interprets element \a e as variant and returns the result of the interpretation.
+ */
+QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment )
+{
+ QVariant v;
+ if ( e.tagName() == "rect" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0, w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QRect( x, y, w, h ) );
+ } else if ( e.tagName() == "point" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int x = 0, y = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "x" )
+ x = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "y" )
+ y = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QPoint( x, y ) );
+ } else if ( e.tagName() == "size" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int w = 0, h = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "width" )
+ w = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "height" )
+ h = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QSize( w, h ) );
+ } else if ( e.tagName() == "color" ) {
+ v = QVariant( readColor( e ) );
+ } else if ( e.tagName() == "font" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ QFont f( defValue.toFont() );
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "family" )
+ f.setFamily( n3.firstChild().toText().data() );
+ else if ( n3.tagName() == "pointsize" )
+ f.setPointSize( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "bold" )
+ f.setBold( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "italic" )
+ f.setItalic( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "underline" )
+ f.setUnderline( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "strikeout" )
+ f.setStrikeOut( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( f );
+ } else if ( e.tagName() == "string" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ QDomElement n = e;
+ n = n.nextSibling().toElement();
+ if ( n.tagName() == "comment" )
+ comment = n.firstChild().toText().data();
+ } else if ( e.tagName() == "cstring" ) {
+ v = QVariant( QCString( e.firstChild().toText().data() ) );
+ } else if ( e.tagName() == "number" ) {
+ bool ok = TRUE;
+ v = QVariant( e.firstChild().toText().data().toInt( &ok ) );
+ if ( !ok )
+ v = QVariant( e.firstChild().toText().data().toDouble() );
+ } else if ( e.tagName() == "bool" ) {
+ QString t = e.firstChild().toText().data();
+ v = QVariant( t == "true" || t == "1", 0 );
+ } else if ( e.tagName() == "pixmap" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "iconset" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "image" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "enum" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "set" ) {
+ v = QVariant( e.firstChild().toText().data() );
+ } else if ( e.tagName() == "sizepolicy" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ QSizePolicy sp;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hsizetype" )
+ sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "vsizetype" )
+ sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "horstretch" )
+ sp.setHorStretch( n3.firstChild().toText().data().toInt() );
+ else if ( n3.tagName() == "verstretch" )
+ sp.setVerStretch( n3.firstChild().toText().data().toInt() );
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( sp );
+ } else if ( e.tagName() == "cursor" ) {
+ v = QVariant( QCursor( e.firstChild().toText().data().toInt() ) );
+ } else if ( e.tagName() == "stringlist" ) {
+ QStringList lst;
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() )
+ lst << n.firstChild().toText().data();
+ v = QVariant( lst );
+ } else if ( e.tagName() == "date" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int y, m, d;
+ y = m = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QDate( y, m, d ) );
+ } else if ( e.tagName() == "time" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int h, m, s;
+ h = m = s = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ m = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QTime( h, m, s ) );
+ } else if ( e.tagName() == "datetime" ) {
+ QDomElement n3 = e.firstChild().toElement();
+ int h, mi, s, y, mo, d ;
+ h = mi = s = y = mo = d = 0;
+ while ( !n3.isNull() ) {
+ if ( n3.tagName() == "hour" )
+ h = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "minute" )
+ mi = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "second" )
+ s = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "year" )
+ y = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "month" )
+ mo = n3.firstChild().toText().data().toInt();
+ else if ( n3.tagName() == "day" )
+ d = n3.firstChild().toText().data().toInt();
+ n3 = n3.nextSibling().toElement();
+ }
+ v = QVariant( QDateTime( QDate( y, mo, d ), QTime( h, mi, s ) ) );
+ }
+ return v;
+}
+
+
+/*! Returns the color which is returned in the dom element \a e.
+ */
+
+QColor DomTool::readColor( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ int r= 0, g = 0, b = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "red" )
+ r = n.firstChild().toText().data().toInt();
+ else if ( n.tagName() == "green" )
+ g = n.firstChild().toText().data().toInt();
+ else if ( n.tagName() == "blue" )
+ b = n.firstChild().toText().data().toInt();
+ n = n.nextSibling().toElement();
+ }
+
+ return QColor( r, g, b );
+}
+
+/*!
+ Returns the contents of attribute \a name of object \a e as
+ variant or the variant passed as \a defValue if the attribute does
+ not exist.
+
+ \sa hasAttribute()
+ */
+QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment )
+{
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "attribute" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return elementToVariant( n.firstChild().toElement(), defValue, comment );
+ }
+ }
+ return defValue;
+}
+
+/*!
+ \overload
+*/
+QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue )
+{
+ QString comment;
+ return readAttribute( e, name, defValue, comment );
+}
+
+/*!
+ Returns wheter object \a e defines attribute \a name or not.
+
+ \sa readAttribute()
+ */
+bool DomTool::hasAttribute( const QDomElement& e, const QString& name )
+{
+ QDomElement n;
+ for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
+ if ( n.tagName() == "attribute" ) {
+ if ( n.attribute( "name" ) != name )
+ continue;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static bool toBool( const QString& s )
+{
+ return s == "true" || s.toInt() != 0;
+}
+
+/*!
+ Convert Qt 2.x format to Qt 3.0 format if necessary
+*/
+void DomTool::fixDocument( QDomDocument& doc )
+{
+ QDomElement e;
+ QDomNode n;
+ QDomNodeList nl;
+ int i = 0;
+
+ e = doc.firstChild().toElement();
+ if ( e.tagName() != "UI" )
+ return;
+
+ // latest version, don't do anything
+ if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.0 )
+ return;
+
+ nl = doc.elementsByTagName( "property" );
+
+ // in 3.0, we need to fix a spelling error
+ if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) {
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ QDomElement el = nl.item(i).toElement();
+ QString s = el.attribute( "name" );
+ if ( s == "resizeable" ) {
+ el.removeAttribute( "name" );
+ el.setAttribute( "name", "resizable" );
+ }
+ }
+ return;
+ }
+
+
+ // in versions smaller than 3.0 we need to change more
+ e.setAttribute( "version", 3.0 );
+
+ e.setAttribute("stdsetdef", 1 );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ QString name;
+ QDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ if ( name == "resizeable" )
+ e.setAttribute( "name", "resizable" );
+ else
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ bool stdset = toBool( e.attribute( "stdset" ) );
+ if ( stdset || name == "toolTip" || name == "whatsThis" ||
+ name == "buddy" ||
+ e.parentNode().toElement().tagName() == "item" ||
+ e.parentNode().toElement().tagName() == "spacer" ||
+ e.parentNode().toElement().tagName() == "column"
+ )
+ e.removeAttribute( "stdset" );
+ else
+ e.setAttribute( "stdset", 0 );
+ }
+
+ nl = doc.elementsByTagName( "attribute" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ QString name;
+ QDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ }
+
+ nl = doc.elementsByTagName( "image" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ QString name;
+ QDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "name" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "name", name );
+ e.removeChild( n2 );
+ }
+ }
+
+ nl = doc.elementsByTagName( "widget" );
+ for ( i = 0; i < (int) nl.length(); i++ ) {
+ e = nl.item(i).toElement();
+ QString name;
+ QDomElement n2 = e.firstChild().toElement();
+ if ( n2.tagName() == "class" ) {
+ name = n2.firstChild().toText().data();
+ e.setAttribute( "class", name );
+ e.removeChild( n2 );
+ }
+ }
+
+}
+
diff --git a/kdevdesigner/shared/domtool.h b/kdevdesigner/shared/domtool.h
new file mode 100644
index 00000000..61b4269a
--- /dev/null
+++ b/kdevdesigner/shared/domtool.h
@@ -0,0 +1,53 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DOMTOOL_H
+#define DOMTOOL_H
+
+#include <qvariant.h>
+#include <qnamespace.h>
+
+class QDomElement;
+class QDomDocument;
+
+class DomTool : public Qt
+{
+public:
+ static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue );
+ static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment );
+ static bool hasProperty( const QDomElement& e, const QString& name );
+ static QStringList propertiesOfType( const QDomElement& e, const QString& type );
+ static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue );
+ static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment );
+ static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue );
+ static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment );
+ static bool hasAttribute( const QDomElement& e, const QString& name );
+ static QColor readColor( const QDomElement &e );
+ static void fixDocument( QDomDocument& );
+};
+
+
+#endif // DOMTOOL_H
diff --git a/kdevdesigner/shared/globaldefs.h b/kdevdesigner/shared/globaldefs.h
new file mode 100644
index 00000000..653c4fa5
--- /dev/null
+++ b/kdevdesigner/shared/globaldefs.h
@@ -0,0 +1,62 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef GLOBALDEFS_H
+#define GLOBALDEFS_H
+
+#include <qcolor.h>
+#include <qapplication.h>
+
+#define BOXLAYOUT_DEFAULT_MARGIN 11
+#define BOXLAYOUT_DEFAULT_SPACING 6
+
+#ifndef NO_STATIC_COLORS
+static QColor *backColor1 = 0;
+static QColor *backColor2 = 0;
+static QColor *selectedBack = 0;
+
+static void init_colors()
+{
+ if ( backColor1 )
+ return;
+
+#if 0 // a calculated alternative for backColor1
+ QColorGroup myCg = qApp->palette().active();
+ int h1, s1, v1;
+ int h2, s2, v2;
+ myCg.color( QColorGroup::Base ).hsv( &h1, &s1, &v1 );
+ myCg.color( QColorGroup::Background ).hsv( &h2, &s2, &v2 );
+ QColor c( h1, s1, ( v1 + v2 ) / 2, QColor::Hsv );
+#endif
+
+ backColor1 = new QColor( 250, 248, 235 );
+ backColor2 = new QColor( 255, 255, 255 );
+ selectedBack = new QColor( 230, 230, 230 );
+}
+
+#endif
+
+#endif
diff --git a/kdevdesigner/shared/parser.cpp b/kdevdesigner/shared/parser.cpp
new file mode 100644
index 00000000..e1b54ca1
--- /dev/null
+++ b/kdevdesigner/shared/parser.cpp
@@ -0,0 +1,72 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "parser.h"
+#include <qobject.h>
+#include <qstringlist.h>
+
+class NormalizeObject : public QObject
+{
+public:
+ NormalizeObject() : QObject() {}
+ static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); }
+};
+
+QString Parser::cleanArgs( const QString &func )
+{
+ QString slot( func );
+ int begin = slot.find( "(" ) + 1;
+ QString args = slot.mid( begin );
+ args = args.left( args.find( ")" ) );
+ QStringList lst = QStringList::split( ',', args );
+ QString res = slot.left( begin );
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if ( it != lst.begin() )
+ res += ",";
+ QString arg = *it;
+ int pos = 0;
+ if ( ( pos = arg.find( "&" ) ) != -1 ) {
+ arg = arg.left( pos + 1 );
+ } else if ( ( pos = arg.find( "*" ) ) != -1 ) {
+ arg = arg.left( pos + 1 );
+ } else {
+ arg = arg.simplifyWhiteSpace();
+ if ( ( pos = arg.find( ':' ) ) != -1 )
+ arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace();
+ QStringList l = QStringList::split( ' ', arg );
+ if ( l.count() == 2 ) {
+ if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" )
+ arg = l[ 0 ];
+ } else if ( l.count() == 3 ) {
+ arg = l[ 0 ] + " " + l[ 1 ];
+ }
+ }
+ res += arg;
+ }
+ res += ")";
+
+ return QString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) );
+}
diff --git a/kdevdesigner/shared/parser.h b/kdevdesigner/shared/parser.h
new file mode 100644
index 00000000..10d83027
--- /dev/null
+++ b/kdevdesigner/shared/parser.h
@@ -0,0 +1,39 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include <qstring.h>
+
+class Parser
+{
+public:
+ static QString cleanArgs( const QString &func );
+
+};
+
+#endif
diff --git a/kdevdesigner/shared/ui2uib.cpp b/kdevdesigner/shared/ui2uib.cpp
new file mode 100644
index 00000000..72c09320
--- /dev/null
+++ b/kdevdesigner/shared/ui2uib.cpp
@@ -0,0 +1,893 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "ui2uib.h"
+#include "uib.h"
+
+#include <domtool.h>
+
+#include <qcolor.h>
+#include <qcursor.h>
+#include <qdatetime.h>
+#include <qdom.h>
+#include <qfile.h>
+#include <qfont.h>
+#include <qobject.h>
+#include <qrect.h>
+#include <qsizepolicy.h>
+
+/*
+ The .uib file format is the binary counterpart of the .ui file
+ format. It is generated by the ui2uib converter and understood by
+ QWidgetFactory; in a future version, it might also be understood
+ by a uib2ui converter. Experiments show that .uib files are about
+ 2.5 times faster to load and 6 times smaller than .ui files.
+
+ The .uib format, unlike the .ui format, is internal to Trolltech
+ and is not officially documented; it is assumed that anybody who
+ needs to understand the file format can read the ui2uib and
+ QWidgetFactory source code, with some guidance. And here's some
+ guidance.
+
+ A .uib file starts with a 32-bit magic number that allows
+ QWidgetFactory to determine the file type. The magic number is
+ followed by '\n' (0x0a) and '\r' (0x0d), which ensure that the
+ file wasn't corrupted during transfer between different
+ platforms. For example, transferring a .ui file from Windows to
+ Unix using FTP with type ASCII will produce a file with '\r\n\r'
+ in place of '\n\r'. This is followed by the QDataStream format
+ version number used.
+
+ The rest of the file is made up of blocks, each of which starts
+ with a block type (Block_XXX) and a block length. Block_Intro and
+ Block_Widget are mandatory; the others are optional.
+ QWidgetFactory makes certain assumptions about the order of the
+ blocks; for example, it expects Block_String before any other
+ block that refers to a string and Block_Images before
+ Block_Widget. The order generated by ui2uib is one of the orders
+ that make sense. Just after the last block, a Block_End marker
+ indicates the end of the file.
+
+ The division of .uib files into blocks corresponds grossly to the
+ division of .ui files in top-level XML elements. Thus,
+ Block_Widget corresponds to <widget> and Block_Toolbars to
+ <toolbars>. The internal organization of each block also mimics
+ the organization of the corresponding XML elements.
+
+ These are the major differences, all of which contribute to
+ making .uib files more compact:
+
+ 1. The strings are gathered in Block_Strings, a string-table.
+ When a string is needed later, it is referenced by a 32-bit
+ index into that table. The UicStringTable class makes the
+ whole process of inserting and looking up strings very
+ simple. The advantage of this scheme is that if a string is
+ used more than once, it is stored only once. Also, the
+ string-table is preinitialized with very common strings, so
+ that these need not be stored along with .uib files.
+
+ 2. QObjects are referred to by index in a table rather than by
+ name. The table itself is not stored in the .uib file; it is
+ rather build dynamically by ui2uib and QWidgetFactory as new
+ objects are specified. In ui2uib, the table is represented by
+ a UibIndexMap object; in QWidgetFactory, a plain array of
+ QObject pointers suffices.
+
+ 3. The data is packed to take as little place as possible,
+ without slowing down QLayoutFactory too much. For example, an
+ index into the string-table is a 32-bit integer, but in
+ practice it is rarely above 65534, so only 16 bits are used
+ for them; when an index above 65534 is met, the index is
+ saved as 65535 followed by the 32-bit index, for a total of
+ 48 bits.
+
+ 4. The name of a signal or slot and its signature are saved
+ separately. That way, if a signal 'foo(const QString&)' is
+ connected to a slot 'bar(const QString&)', the string-table
+ will only contain 'foo', 'bar', and '(const QString&)',
+ instead of the longer 'foo(const QString&)' and 'bar(const
+ QString&)'. The signatures are normalized beforehand to
+ ensure that trivial spacing problems don't result in multiple
+ string-table entries.
+
+ 5. In a signal-to-slot connection, a sender, signal, receiver,
+ or slot is not repeated if it's the same as for the previous
+ connection. Bit flags indicate what is repeated and what is
+ specified.
+
+ 6. Some of the information stored in a .ui file is useful only
+ by uic, not to QLayoutFactory. That information is, for now,
+ not taken along in the .uib file. Likewise, needless
+ QLayoutWidget objects are not taken along.
+
+ The arbitrary constants related to the .uib file formats are
+ defined in uib.h. Constants such as Block_Actions and
+ Object_SubWidget are given values such as 'A' and 'W' to make
+ .uib files easier to read in a hexadecimal editor.
+
+ The file format isn't designed to be extensible. Any extension
+ that prevents an older version of QLayoutWidget of reading the
+ file correctly must have a different magic number. The plan is to
+ use UibMagic + 1 for version 2, UibMagic + 2 for version 3, etc.
+*/
+
+static QCString layoutForTag( const QString& tag )
+{
+ if ( tag == "grid" ) {
+ return "QGridLayout";
+ } else if ( tag == "hbox" ) {
+ return "QHBoxLayout";
+ } else if ( tag == "vbox" ) {
+ return "QVBoxLayout";
+ } else {
+ return "QLayout";
+ }
+}
+
+class UibHack : public QObject
+{
+public:
+ static QString normalize( const QString& member ) {
+ return QString::fromUtf8( QObject::normalizeSignalSlot(member.utf8()) );
+ }
+};
+
+class UibIndexMap
+{
+public:
+ UibIndexMap() : next( 0 ) { }
+
+ void insert( const QString& name ) { setName( insert(), name ); }
+ int insert() { return next++; }
+ void setName( int no, const QString& name );
+
+ int find( const QString& name, int deflt = -1 ) const;
+ int count() const { return next; }
+
+private:
+ QMap<QString, int> nameMap;
+ QMap<QString, int> conflicts;
+ int next;
+};
+
+void UibIndexMap::setName( int no, const QString& name )
+{
+ if ( !name.isEmpty() ) {
+ if ( *nameMap.insert(name, no, FALSE) != no )
+ conflicts.insert( name, 0 );
+ }
+}
+
+int UibIndexMap::find( const QString& name, int deflt ) const
+{
+ QMap<QString, int>::ConstIterator no = nameMap.find( name );
+ if ( no == nameMap.end() || conflicts.contains(name) ) {
+ return deflt;
+ } else {
+ return *no;
+ }
+}
+
+static void packUInt16( QDataStream& out, Q_UINT16 n )
+{
+ if ( n < 255 ) {
+ out << (Q_UINT8) n;
+ } else {
+ out << (Q_UINT8) 255;
+ out << n;
+ }
+}
+
+static void packUInt32( QDataStream& out, Q_UINT32 n )
+{
+ if ( n < 65535 ) {
+ out << (Q_UINT16) n;
+ } else {
+ out << (Q_UINT16) 65535;
+ out << n;
+ }
+}
+
+static void packByteArray( QDataStream& out, const QByteArray& array )
+{
+ packUInt32( out, array.size() );
+ out.writeRawBytes( array.data(), array.size() );
+}
+
+static void packCString( UibStrTable& strings, QDataStream& out,
+ const char *cstr )
+{
+ packUInt32( out, strings.insertCString(cstr) );
+}
+
+static void packString( UibStrTable& strings, QDataStream& out,
+ const QString& str )
+{
+ packUInt32( out, strings.insertString(str) );
+}
+
+static void packStringSplit( UibStrTable& strings, QDataStream& out,
+ const QString& str, QChar sep )
+{
+ int pos = str.find( sep );
+ if ( pos == -1 )
+ pos = str.length();
+ packString( strings, out, str.left(pos) );
+ packString( strings, out, str.mid(pos) );
+}
+
+static void packVariant( UibStrTable& strings, QDataStream& out,
+ QVariant value, QString tag = "" )
+{
+ QStringList::ConstIterator s;
+
+ Q_UINT8 type = value.type();
+ if ( tag == "pixmap" ) {
+ type = QVariant::Pixmap;
+ } else if ( tag == "image" ) {
+ type = QVariant::Image;
+ } else if ( tag == "iconset" ) {
+ type = QVariant::IconSet;
+ }
+ out << type;
+
+ switch ( type ) {
+ case QVariant::String:
+ case QVariant::Pixmap:
+ case QVariant::Image:
+ case QVariant::IconSet:
+ packString( strings, out, value.asString() );
+ break;
+ case QVariant::StringList:
+ packUInt16( out, value.asStringList().count() );
+ s = value.asStringList().begin();
+ while ( s != value.asStringList().end() ) {
+ packString( strings, out, *s );
+ ++s;
+ }
+ break;
+ case QVariant::Font:
+ out << value.asFont();
+ break;
+ case QVariant::Rect:
+ packUInt16( out, value.asRect().x() );
+ packUInt16( out, value.asRect().y() );
+ packUInt16( out, value.asRect().width() );
+ packUInt16( out, value.asRect().height() );
+ break;
+ case QVariant::Size:
+ packUInt16( out, value.asSize().width() );
+ packUInt16( out, value.asSize().height() );
+ break;
+ case QVariant::Color:
+ out << value.asColor();
+ break;
+ case QVariant::Point:
+ packUInt16( out, value.asPoint().x() );
+ packUInt16( out, value.asPoint().y() );
+ break;
+ case QVariant::Int:
+ packUInt32( out, value.asInt() );
+ break;
+ case QVariant::Bool:
+ out << (Q_UINT8) value.asBool();
+ break;
+ case QVariant::Double:
+ out << value.asDouble();
+ break;
+ case QVariant::CString:
+ packCString( strings, out, value.asCString() );
+ break;
+ case QVariant::Cursor:
+ out << value.asCursor();
+ break;
+ case QVariant::Date:
+ out << value.asDate();
+ break;
+ case QVariant::Time:
+ out << value.asTime();
+ break;
+ case QVariant::DateTime:
+ out << value.asDateTime();
+ break;
+ default:
+ out << value;
+ }
+}
+
+static void outputProperty( QMap<int, QStringList>& buddies, int objectNo,
+ UibStrTable& strings, QDataStream& out,
+ QDomElement elem )
+{
+ QCString name = elem.attribute( "name" ).latin1();
+ QDomElement f = elem.firstChild().toElement();
+ QString tag = f.tagName();
+ QString comment;
+ QVariant value;
+
+ if ( name == "resizeable" )
+ name = "resizable";
+
+ if ( tag == "font" ) {
+ QString family;
+ Q_UINT16 pointSize = 65535;
+ Q_UINT8 fontFlags = 0;
+
+ QDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ QString text = g.firstChild().toText().data();
+ if ( g.tagName() == "family" ) {
+ fontFlags |= Font_Family;
+ family = text;
+ } else if ( g.tagName() == "pointsize" ) {
+ fontFlags |= Font_PointSize;
+ pointSize = (Q_UINT16) text.toUInt();
+ } else {
+ if ( g.firstChild().toText().data().toInt() != 0 ) {
+ if ( g.tagName() == "bold" ) {
+ fontFlags |= Font_Bold;
+ } else if ( g.tagName() == "italic" ) {
+ fontFlags |= Font_Italic;
+ } else if ( g.tagName() == "underline" ) {
+ fontFlags |= Font_Underline;
+ } else if ( g.tagName() == "strikeout" ) {
+ fontFlags |= Font_StrikeOut;
+ }
+ }
+ }
+ g = g.nextSibling().toElement();
+ }
+
+ out << (Q_UINT8) Object_FontProperty;
+ packCString( strings, out, name );
+ out << fontFlags;
+ if ( fontFlags & Font_Family )
+ packString( strings, out, family );
+ if ( fontFlags & Font_PointSize )
+ packUInt16( out, pointSize );
+ } else if ( tag == "palette" ) {
+ out << (Q_UINT8) Object_PaletteProperty;
+ packCString( strings, out, name );
+
+ QDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ QDomElement h = g.firstChild().toElement();
+ while ( !h.isNull() ) {
+ value = DomTool::elementToVariant( h, Qt::gray );
+ if ( h.tagName() == "color" ) {
+ out << (Q_UINT8) Palette_Color;
+ out << value.asColor();
+ } else if ( h.tagName() == "pixmap" ) {
+ out << (Q_UINT8) Palette_Pixmap;
+ packVariant( strings, out, value, "pixmap" );
+ }
+ h = h.nextSibling().toElement();
+ }
+
+ if ( g.tagName() == "active" ) {
+ out << (Q_UINT8) Palette_Active;
+ } else if ( g.tagName() == "inactive" ) {
+ out << (Q_UINT8) Palette_Inactive;
+ } else {
+ out << (Q_UINT8) Palette_Disabled;
+ }
+ g = g.nextSibling().toElement();
+ }
+ out << (Q_UINT8) Palette_End;
+ } else {
+ value = DomTool::elementToVariant( f, value, comment );
+ if ( value.isValid() ) {
+ if ( name == "buddy" ) {
+ buddies[objectNo] += value.asString();
+ } else {
+ if ( tag == "string" ) {
+ out << (Q_UINT8) Object_TextProperty;
+ packCString( strings, out, name );
+ packCString( strings, out, value.asString().utf8() );
+ packCString( strings, out, comment.utf8() );
+ } else {
+ out << (Q_UINT8) Object_VariantProperty;
+ packCString( strings, out, name );
+ packVariant( strings, out, value, tag );
+ }
+ }
+ }
+ }
+}
+
+static void outputGridCell( QDataStream& out, QDomElement elem )
+{
+ int column = elem.attribute( "column", "0" ).toInt();
+ int row = elem.attribute( "row", "0" ).toInt();
+ int colspan = elem.attribute( "colspan", "1" ).toInt();
+ int rowspan = elem.attribute( "rowspan", "1" ).toInt();
+ if ( colspan < 1 )
+ colspan = 1;
+ if ( rowspan < 1 )
+ rowspan = 1;
+
+ if ( column != 0 || row != 0 || colspan != 1 || rowspan != 1 ) {
+ out << (Q_UINT8) Object_GridCell;
+ packUInt16( out, column );
+ packUInt16( out, row );
+ packUInt16( out, colspan );
+ packUInt16( out, rowspan );
+ }
+}
+
+static int outputObject( QMap<int, QStringList>& buddies,
+ UibIndexMap& objects, UibStrTable& strings,
+ QDataStream& out, QDomElement elem,
+ QCString className = "" );
+
+static void outputLayoutWidgetsSubLayout( QMap<int, QStringList>& buddies,
+ UibIndexMap& objects,
+ UibStrTable& strings,
+ QDataStream& out, QDomElement elem )
+{
+ int subLayoutNo = -1;
+ QCString name;
+ QDomElement nameElem;
+
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ QString tag = f.tagName();
+ if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) {
+ out << (Q_UINT8) Object_SubLayout;
+ subLayoutNo = outputObject( buddies, objects, strings, out, f,
+ layoutForTag(tag) );
+ } else if ( tag == "property" ) {
+ if ( f.attribute("name") == "name" ) {
+ name = DomTool::elementToVariant( f, name ).asCString();
+ nameElem = f;
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+
+ if ( subLayoutNo != -1 ) {
+ /*
+ Remove the sub-layout's Object_End marker, append the grid
+ cell and the correct name property, and put the Object_End
+ marker back.
+ */
+ out.device()->at( out.device()->at() - 1 );
+ outputGridCell( out, elem );
+ outputProperty( buddies, subLayoutNo, strings, out, nameElem );
+ out << (Q_UINT8) Object_End;
+
+ objects.setName( subLayoutNo, name );
+ }
+}
+
+static int outputObject( QMap<int, QStringList>& buddies,
+ UibIndexMap& objects, UibStrTable& strings,
+ QDataStream& out, QDomElement elem,
+ QCString className )
+{
+ bool isQObject = !className.isEmpty();
+
+ if ( className == "QToolBar" )
+ out << (Q_UINT8) elem.attribute( "dock", "0" ).toInt();
+ if ( className == "QWidget" )
+ className = elem.attribute( "class", className ).latin1();
+
+ int objectNo = -1;
+ if ( isQObject ) {
+ packCString( strings, out, className );
+ objectNo = objects.insert();
+ }
+
+ outputGridCell( out, elem );
+
+ // optimization: insert '&Foo' into string-table before 'Foo'
+ if ( className == "QAction" || className == "QActionGroup" ) {
+ QVariant value = DomTool::readProperty( elem, "menuText", QVariant() );
+ if ( value.asString().startsWith("&") )
+ strings.insertString( value.asString() );
+ }
+
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ QString tag = f.tagName();
+ if ( tag == "action" ) {
+ if ( elem.tagName() == "item" || elem.tagName() == "toolbar" ) {
+ QString actionName = f.attribute( "name" );
+ int no = objects.find( actionName );
+ if ( no != -1 ) {
+ out << (Q_UINT8) Object_ActionRef;
+ packUInt16( out, no );
+ }
+ } else {
+ out << (Q_UINT8) Object_SubAction;
+ outputObject( buddies, objects, strings, out, f, "QAction" );
+ }
+ } else if ( tag == "actiongroup" ) {
+ out << (Q_UINT8) Object_SubAction;
+ outputObject( buddies, objects, strings, out, f, "QActionGroup" );
+ } else if ( tag == "attribute" ) {
+ out << (Q_UINT8) Object_Attribute;
+ outputProperty( buddies, objectNo, strings, out, f );
+ } else if ( tag == "column" ) {
+ out << (Q_UINT8) Object_Column;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "event" ) {
+ out << (Q_UINT8) Object_Event;
+ packCString( strings, out, f.attribute("name").latin1() );
+ packVariant( strings, out,
+ QStringList::split(',', f.attribute("functions")) );
+ } else if ( tag == "grid" || tag == "hbox" || tag == "vbox" ) {
+ out << (Q_UINT8) Object_SubLayout;
+ outputObject( buddies, objects, strings, out, f,
+ layoutForTag(tag) );
+ } else if ( tag == "item" ) {
+ if ( elem.tagName() == "menubar" ) {
+ out << (Q_UINT8) Object_MenuItem;
+ packCString( strings, out, f.attribute("name").latin1() );
+ packCString( strings, out, f.attribute("text").utf8() );
+ outputObject( buddies, objects, strings, out, f );
+ } else {
+ out << (Q_UINT8) Object_Item;
+ outputObject( buddies, objects, strings, out, f );
+ }
+ } else if ( tag == "property" ) {
+ outputProperty( buddies, objectNo, strings, out, f );
+ } else if ( tag == "row" ) {
+ out << (Q_UINT8) Object_Row;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "separator" ) {
+ out << (Q_UINT8) Object_Separator;
+ } else if ( tag == "spacer" ) {
+ out << (Q_UINT8) Object_Spacer;
+ outputObject( buddies, objects, strings, out, f );
+ } else if ( tag == "widget" ) {
+ if ( f.attribute("class") == "QLayoutWidget" &&
+ elem.tagName() != "widget" ) {
+ outputLayoutWidgetsSubLayout( buddies, objects, strings, out,
+ f );
+ } else {
+ out << (Q_UINT8) Object_SubWidget;
+ outputObject( buddies, objects, strings, out, f, "QWidget" );
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+ out << (Q_UINT8) Object_End;
+ if ( isQObject )
+ objects.setName( objectNo,
+ DomTool::readProperty(elem, "name", "").asString() );
+ return objectNo;
+}
+
+static void outputBlock( QDataStream& out, BlockTag tag,
+ const QByteArray& data )
+{
+ if ( !data.isEmpty() ) {
+ out << (Q_UINT8) tag;
+ packByteArray( out, data );
+ }
+}
+
+void convertUiToUib( QDomDocument& doc, QDataStream& out )
+{
+ QByteArray introBlock;
+ QByteArray actionsBlock;
+ QByteArray buddiesBlock;
+ QByteArray connectionsBlock;
+ QByteArray functionsBlock;
+ QByteArray imagesBlock;
+ QByteArray menubarBlock;
+ QByteArray slotsBlock;
+ QByteArray tabstopsBlock;
+ QByteArray toolbarsBlock;
+ QByteArray variablesBlock;
+ QByteArray widgetBlock;
+
+ QDomElement actionsElem;
+ QDomElement connectionsElem;
+ QDomElement imagesElem;
+ QDomElement menubarElem;
+ QDomElement tabstopsElem;
+ QDomElement toolbarsElem;
+ QDomElement widgetElem;
+
+ QMap<int, QStringList> buddies;
+ UibStrTable strings;
+ UibIndexMap objects;
+ int widgetNo = -1;
+ QCString className;
+ Q_INT16 defaultMargin = -32768;
+ Q_INT16 defaultSpacing = -32768;
+ Q_UINT8 introFlags = 0;
+
+ QDomElement elem = doc.firstChild().toElement().firstChild().toElement();
+ while ( !elem.isNull() ) {
+ QString tag = elem.tagName();
+
+ switch ( tag[0].latin1() ) {
+ case 'a':
+ if ( tag == "actions" )
+ actionsElem = elem;
+ break;
+ case 'c':
+ if ( tag == "class" ) {
+ className = elem.firstChild().toText().data().latin1();
+ } else if ( tag == "connections" ) {
+ connectionsElem = elem;
+ }
+ break;
+ case 'f':
+ if ( tag == "functions" ) {
+ QDataStream out2( functionsBlock, IO_WriteOnly );
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "function" ) {
+ packStringSplit( strings, out2,
+ f.attribute("name").latin1(), '(' );
+ packString( strings, out2,
+ f.firstChild().toText().data() );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'i':
+ if ( tag == "images" ) {
+ QDataStream out2( imagesBlock, IO_WriteOnly );
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "image" ) {
+ QString name = f.attribute( "name" );
+ QDomElement g = f.firstChild().toElement();
+ if ( g.tagName() == "data" ) {
+ QString format = g.attribute( "format", "PNG" );
+ QString hex = g.firstChild().toText().data();
+ int n = hex.length() / 2;
+ QByteArray data( n );
+ for ( int i = 0; i < n; i++ )
+ data[i] = (char) hex.mid( 2 * i, 2 )
+ .toUInt( 0, 16 );
+
+ packString( strings, out2, name );
+ packString( strings, out2, format );
+ packUInt32( out2, g.attribute("length").toInt() );
+ packByteArray( out2, data );
+ }
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'l':
+ if ( tag == "layoutdefaults" ) {
+ QString margin = elem.attribute( "margin" );
+ if ( !margin.isEmpty() )
+ defaultMargin = margin.toInt();
+ QString spacing = elem.attribute( "spacing" );
+ if ( !spacing.isEmpty() )
+ defaultSpacing = spacing.toInt();
+ }
+ break;
+ case 'm':
+ if ( tag == "menubar" )
+ menubarElem = elem;
+ break;
+ case 'p':
+ if ( tag == "pixmapinproject" )
+ introFlags |= Intro_Pixmapinproject;
+ break;
+ case 's':
+ if ( tag == "slots" ) {
+ QDataStream out2( slotsBlock, IO_WriteOnly );
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "slot" ) {
+ QString language = f.attribute( "language", "C++" );
+ QString slot = UibHack::normalize(
+ f.firstChild().toText().data() );
+ packString( strings, out2, language );
+ packStringSplit( strings, out2, slot, '(' );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 't':
+ if ( tag == "tabstops" ) {
+ tabstopsElem = elem;
+ } else if ( tag == "toolbars" ) {
+ toolbarsElem = elem;
+ }
+ break;
+ case 'v':
+ if ( tag == "variable" ) {
+ QDataStream out2( variablesBlock, IO_WriteOnly | IO_Append );
+ packString( strings, out2, elem.firstChild().toText().data() );
+ } else if ( tag == "variables" ) {
+ QDataStream out2( variablesBlock, IO_WriteOnly );
+ QDomElement f = elem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "variable" )
+ packString( strings, out2,
+ f.firstChild().toText().data() );
+ f = f.nextSibling().toElement();
+ }
+ }
+ break;
+ case 'w':
+ if ( tag == "widget" )
+ widgetElem = elem;
+ }
+ elem = elem.nextSibling().toElement();
+ }
+
+ {
+ QDataStream out2( widgetBlock, IO_WriteOnly );
+ widgetNo = outputObject( buddies, objects, strings, out2, widgetElem,
+ "QWidget" );
+ }
+
+ if ( !tabstopsElem.isNull() ) {
+ QDataStream out2( tabstopsBlock, IO_WriteOnly );
+ QDomElement f = tabstopsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "tabstop" ) {
+ QString widgetName = f.firstChild().toText().data();
+ int no = objects.find( widgetName );
+ if ( no != -1 )
+ packUInt16( out2, no );
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ if ( !actionsElem.isNull() ) {
+ QDataStream out2( actionsBlock, IO_WriteOnly );
+ outputObject( buddies, objects, strings, out2, actionsElem );
+ }
+
+ if ( !menubarElem.isNull() ) {
+ QDataStream out2( menubarBlock, IO_WriteOnly );
+ outputObject( buddies, objects, strings, out2, menubarElem,
+ "QMenuBar" );
+ }
+
+ if ( !toolbarsElem.isNull() ) {
+ QDataStream out2( toolbarsBlock, IO_WriteOnly );
+ QDomElement f = toolbarsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "toolbar" )
+ outputObject( buddies, objects, strings, out2, f, "QToolBar" );
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ if ( !buddies.isEmpty() ) {
+ QDataStream out2( buddiesBlock, IO_WriteOnly );
+ QMap<int, QStringList>::ConstIterator a = buddies.begin();
+ while ( a != buddies.end() ) {
+ QStringList::ConstIterator b = (*a).begin();
+ while ( b != (*a).end() ) {
+ int no = objects.find( *b );
+ if ( no != -1 ) {
+ packUInt16( out2, a.key() );
+ packUInt16( out2, no );
+ }
+ ++b;
+ }
+ ++a;
+ }
+ }
+
+ if ( !connectionsElem.isNull() ) {
+ QString prevLanguage = "C++";
+ int prevSenderNo = 0;
+ QString prevSignal = "clicked()";
+ int prevReceiverNo = 0;
+ QString prevSlot = "accept()";
+
+ QDataStream out2( connectionsBlock, IO_WriteOnly );
+ QDomElement f = connectionsElem.firstChild().toElement();
+ while ( !f.isNull() ) {
+ if ( f.tagName() == "connection" ) {
+ QMap<QString, QString> argMap;
+
+ QDomElement g = f.firstChild().toElement();
+ while ( !g.isNull() ) {
+ argMap[g.tagName()] = g.firstChild().toText().data();
+ g = g.nextSibling().toElement();
+ }
+
+ QString language = f.attribute( "language", "C++" );
+ int senderNo = objects.find( argMap["sender"], widgetNo );
+ int receiverNo = objects.find( argMap["receiver"], widgetNo );
+ QString signal = UibHack::normalize( argMap["signal"] );
+ QString slot = UibHack::normalize( argMap["slot"] );
+
+ Q_UINT8 connectionFlags = 0;
+ if ( language != prevLanguage )
+ connectionFlags |= Connection_Language;
+ if ( senderNo != prevSenderNo )
+ connectionFlags |= Connection_Sender;
+ if ( signal != prevSignal )
+ connectionFlags |= Connection_Signal;
+ if ( receiverNo != prevReceiverNo )
+ connectionFlags |= Connection_Receiver;
+ if ( slot != prevSlot )
+ connectionFlags |= Connection_Slot;
+ out2 << connectionFlags;
+
+ if ( connectionFlags & Connection_Language )
+ packString( strings, out2, language );
+ if ( connectionFlags & Connection_Sender )
+ packUInt16( out2, senderNo );
+ if ( connectionFlags & Connection_Signal )
+ packStringSplit( strings, out2, signal, '(' );
+ if ( connectionFlags & Connection_Receiver )
+ packUInt16( out2, receiverNo );
+ if ( connectionFlags & Connection_Slot )
+ packStringSplit( strings, out2, slot, '(' );
+
+ prevLanguage = language;
+ prevSenderNo = senderNo;
+ prevSignal = signal;
+ prevReceiverNo = receiverNo;
+ prevSlot = slot;
+ } else if ( f.tagName() == "slot" ) {
+ // ###
+ }
+ f = f.nextSibling().toElement();
+ }
+ }
+
+ {
+ QDataStream out2( introBlock, IO_WriteOnly );
+ out2 << introFlags;
+ out2 << defaultMargin;
+ out2 << defaultSpacing;
+ packUInt16( out2, objects.count() );
+ packCString( strings, out2, className );
+ }
+
+ out << UibMagic;
+ out << (Q_UINT8) '\n';
+ out << (Q_UINT8) '\r';
+ out << (Q_UINT8) out.version();
+ outputBlock( out, Block_Strings, strings.block() );
+ outputBlock( out, Block_Intro, introBlock );
+ outputBlock( out, Block_Images, imagesBlock );
+ outputBlock( out, Block_Widget, widgetBlock );
+ outputBlock( out, Block_Slots, slotsBlock );
+ outputBlock( out, Block_Tabstops, tabstopsBlock );
+ outputBlock( out, Block_Actions, actionsBlock );
+ outputBlock( out, Block_Menubar, menubarBlock );
+ outputBlock( out, Block_Toolbars, toolbarsBlock );
+ outputBlock( out, Block_Variables, variablesBlock );
+ outputBlock( out, Block_Functions, functionsBlock );
+ outputBlock( out, Block_Buddies, buddiesBlock );
+ outputBlock( out, Block_Connections, connectionsBlock );
+ out << (Q_UINT8) Block_End;
+}
diff --git a/kdevdesigner/shared/ui2uib.h b/kdevdesigner/shared/ui2uib.h
new file mode 100644
index 00000000..674fd589
--- /dev/null
+++ b/kdevdesigner/shared/ui2uib.h
@@ -0,0 +1,35 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef UI2UIB_H
+#define UI2UIB_H
+
+class QDataStream;
+class QDomDocument;
+
+void convertUiToUib( QDomDocument& doc, QDataStream& out );
+
+#endif
diff --git a/kdevdesigner/shared/uib.cpp b/kdevdesigner/shared/uib.cpp
new file mode 100644
index 00000000..72d73b45
--- /dev/null
+++ b/kdevdesigner/shared/uib.cpp
@@ -0,0 +1,42 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "uib.h"
+
+static const char commonStrings[] =
+ "\0()\0(bool)\0(const QString&)\0(int)\0C++\0Layout1\0PNG\0QCheckBox\0"
+ "QComboBox\0QDialog\0QFrame\0QGridLayout\0QGroupBox\0QHBoxLayout\0QLabel\0"
+ "QLineEdit\0QListView\0QPushButton\0QRadioButton\0QVBoxLayout\0QWidget\0"
+ "TextLabel1\0XPM.GZ\0accept\0autoDefault\0buddy\0caption\0clicked\0"
+ "default\0destroy\0frameShadow\0frameShape\0geometry\0init\0margin\0"
+ "maximumSize\0minimumSize\0name\0reject\0sizePolicy\0spacing\0text\0title\0"
+ "toolTip\0unnamed\0whatsThis";
+
+UibStrTable::UibStrTable()
+ : out( table, IO_WriteOnly ), start( sizeof(commonStrings) )
+{
+ out.writeRawBytes( commonStrings, start );
+}
diff --git a/kdevdesigner/shared/uib.h b/kdevdesigner/shared/uib.h
new file mode 100644
index 00000000..00adac13
--- /dev/null
+++ b/kdevdesigner/shared/uib.h
@@ -0,0 +1,152 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef UIB_H
+#define UIB_H
+
+#include <qdatastream.h>
+
+const Q_UINT32 UibMagic = 0xb77c61d8;
+
+enum BlockTag { Block_End = '$', Block_Actions = 'A', Block_Buddies = 'B',
+ Block_Connections = 'C', Block_Functions = 'F',
+ Block_Images = 'G', Block_Intro = 'I', Block_Menubar = 'M',
+ Block_Slots = 'S', Block_Strings = 'Z', Block_Tabstops = 'T',
+ Block_Toolbars = 'O', Block_Variables = 'V',
+ Block_Widget = 'W' };
+
+enum ObjectTag { Object_End = '$', Object_ActionRef = 'X',
+ Object_Attribute = 'B', Object_Column = 'C',
+ Object_Event = 'E', Object_FontProperty = 'F',
+ Object_GridCell = 'G', Object_Item = 'I',
+ Object_MenuItem = 'M', Object_PaletteProperty = 'P',
+ Object_Row = 'R', Object_Separator = 'S', Object_Spacer = 'Y',
+ Object_SubAction = 'A', Object_SubLayout = 'L',
+ Object_SubWidget = 'W', Object_TextProperty = 'T',
+ Object_VariantProperty = 'V' };
+
+enum PaletteTag { Palette_End = '$', Palette_Active = 'A',
+ Palette_Inactive = 'I', Palette_Disabled = 'D',
+ Palette_Color = 'C', Palette_Pixmap = 'P' };
+
+enum IntroFlag { Intro_Pixmapinproject = 0x1 };
+
+enum FontFlag { Font_Family = 0x1, Font_PointSize = 0x2, Font_Bold = 0x4,
+ Font_Italic = 0x8, Font_Underline = 0x10,
+ Font_StrikeOut = 0x20 };
+
+enum ConnectionFlag { Connection_Language = 0x1, Connection_Sender = 0x2,
+ Connection_Signal = 0x4, Connection_Receiver = 0x8,
+ Connection_Slot = 0x10 };
+
+class UibStrTable
+{
+public:
+ UibStrTable();
+
+ inline int insertCString( const char *cstr );
+ inline int insertString( const QString& str );
+ inline void readBlock( QDataStream& in, int size );
+
+ inline const char *asCString( int offset ) const;
+ inline QString asString( int offset ) const;
+ inline QByteArray block() const;
+
+private:
+ QCString table;
+ QDataStream out;
+ int start;
+};
+
+/*
+ uic uses insertCString(), insertString(), and block();
+ QWidgetFactory uses readBlock(), asCString(), and asString(). By
+ implementing these functions inline, we ensure that the binaries
+ don't contain needless code.
+*/
+
+inline int UibStrTable::insertCString( const char *cstr )
+{
+ if ( cstr == 0 || cstr[0] == 0 ) {
+ return 0;
+ } else {
+ int nextPos = table.size();
+ int len = strlen( cstr );
+ int i;
+ for ( i = 0; i < nextPos - len; i++ ) {
+ if ( memcmp(table.data() + i, cstr, len + 1) == 0 )
+ return i;
+ }
+ for ( i = 0; i < len + 1; i++ )
+ out << (Q_UINT8) cstr[i];
+ return nextPos;
+ }
+}
+
+inline int UibStrTable::insertString( const QString& str )
+{
+ if ( str.contains('\0') || str[0] == QChar(0x7f) ) {
+ int nextPos = table.size();
+ out << (Q_UINT8) 0x7f;
+ out << str;
+ return nextPos;
+ } else {
+ return insertCString( str.utf8() );
+ }
+}
+
+inline void UibStrTable::readBlock( QDataStream& in, int size )
+{
+ table.resize( start + size );
+ in.readRawBytes( table.data() + start, size );
+}
+
+inline QString UibStrTable::asString( int offset ) const
+{
+ if ( table[offset] == 0x7f ) {
+ QDataStream in( table, IO_ReadOnly );
+ in.device()->at( offset + 1 );
+ QString str;
+ in >> str;
+ return str;
+ } else {
+ return QString::fromUtf8( asCString(offset) );
+ }
+}
+
+inline const char *UibStrTable::asCString( int offset ) const
+{
+ return table.data() + offset;
+}
+
+inline QByteArray UibStrTable::block() const
+{
+ QByteArray block;
+ block.duplicate( table.data() + start, table.size() - start );
+ return block;
+}
+
+#endif
diff --git a/kdevdesigner/shared/widgetdatabase.cpp b/kdevdesigner/shared/widgetdatabase.cpp
new file mode 100644
index 00000000..8b80b03f
--- /dev/null
+++ b/kdevdesigner/shared/widgetdatabase.cpp
@@ -0,0 +1,960 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "widgetdatabase.h"
+#include "../interfaces/widgetinterface.h"
+
+#include "../designer/kdevdesigner_part.h"
+
+#include <kiconloader.h>
+#include <kdebug.h>
+
+#include <qapplication.h>
+#define NO_STATIC_COLORS
+#include <globaldefs.h>
+#include <qstrlist.h>
+#include <qdict.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qcleanuphandler.h>
+#include <qfeatures.h>
+
+#include <stdlib.h>
+
+#include <klocale.h>
+
+const int dbsize = 300;
+const int dbcustom = 200;
+const int dbdictsize = 211;
+static WidgetDatabaseRecord* db[ dbsize ];
+static QDict<int> *className2Id = 0;
+static int dbcount = 0;
+static int dbcustomcount = 200;
+static QStrList *wGroups;
+static QStrList *invisibleGroups;
+static bool whatsThisLoaded = FALSE;
+static QPluginManager<WidgetInterface> *widgetPluginManager = 0;
+static bool plugins_set_up = FALSE;
+static bool was_in_setup = FALSE;
+
+QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager;
+
+WidgetDatabaseRecord::WidgetDatabaseRecord()
+{
+ isForm = FALSE;
+ isContainer = FALSE;
+ icon = 0;
+ nameCounter = 0;
+ isCommon = FALSE;
+ isPlugin = FALSE;
+}
+
+WidgetDatabaseRecord::~WidgetDatabaseRecord()
+{
+ delete icon;
+}
+
+
+/*!
+ \class WidgetDatabase widgetdatabase.h
+ \brief The WidgetDatabase class holds information about widgets
+
+ The WidgetDatabase holds information about widgets like toolTip(),
+ iconSet(), ... It works Id-based, so all access functions take the
+ widget id as parameter. To get the id for a widget (classname), use
+ idFromClassName().
+
+ All access functions are static. Having multiple widgetdatabases in
+ one application doesn't make sense anyway and so you don't need more
+ than an instance of the widgetdatabase.
+
+ For creating widgets, layouts, etc. see WidgetFactory.
+*/
+
+/*!
+ Creates widget database. Does nothing.
+*/
+
+WidgetDatabase::WidgetDatabase()
+{
+}
+
+/*! Sets up the widget database. If the static widgetdatabase already
+ exists, the functions returns immediately.
+*/
+
+void WidgetDatabase::setupDataBase( int id )
+{
+ was_in_setup = TRUE;
+#ifndef UIC
+ Q_UNUSED( id )
+ if ( dbcount )
+ return;
+#else
+ if ( dbcount && id != -2 )
+ return;
+ if ( dbcount && !plugins_set_up ) {
+ setupPlugins();
+ return;
+ }
+ if ( dbcount && plugins_set_up)
+ return;
+#endif
+
+ wGroups = new QStrList;
+ invisibleGroups = new QStrList;
+ invisibleGroups->append( "Forms" );
+ invisibleGroups->append( "Temp" );
+ className2Id = new QDict<int>( dbdictsize );
+ className2Id->setAutoDelete( TRUE );
+
+ WidgetDatabaseRecord *r = 0;
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_pushbutton.png";
+ r->name = "QPushButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Push Button";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_toolbutton.png";
+ r->name = "QToolButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Tool Button";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_radiobutton.png";
+ r->name = "QRadioButton";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Radio Button";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_checkbox.png";
+ r->name = "QCheckBox";
+ r->group = widgetGroup( "Buttons" );
+ r->toolTip = "Check Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_groupbox.png";
+ r->name = "QGroupBox";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Group Box";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_buttongroup.png";
+ r->name = "QButtonGroup";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Button Group";
+ r->isContainer = TRUE;
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_frame.png";
+ r->name = "QFrame";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Frame";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "QTabWidget";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Tabwidget";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_widgetstack.png";
+ r->name = "QWidgetStack";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Widget Stack";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_toolbox.png";
+ r->name = "QToolBox";
+ r->group = widgetGroup( "Containers" );
+ r->toolTip = "Tool Box";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_listbox.png";
+ r->name = "QListBox";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "List Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_listview.png";
+ r->name = "QListView";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "List View";
+
+ append( r );
+
+#if !defined(QT_NO_ICONVIEW) || defined(UIC)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_iconview.png";
+ r->name = "QIconView";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "Icon View";
+
+ append( r );
+#endif
+
+#if !defined(QT_NO_TABLE)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_table.png";
+ r->name = "QTable";
+ r->group = widgetGroup( "Views" );
+ r->toolTip = "Table";
+
+ append( r );
+#endif
+
+#if !defined(QT_NO_SQL)
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_datatable.png";
+ r->includeFile = "qdatatable.h";
+ r->name = "QDataTable";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data Table";
+
+ append( r );
+#endif
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_lineedit.png";
+ r->name = "QLineEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Line Edit";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_spinbox.png";
+ r->name = "QSpinBox";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Spin Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_dateedit.png";
+ r->name = "QDateEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Date Edit";
+ r->includeFile = "qdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_timeedit.png";
+ r->name = "QTimeEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Time Edit";
+ r->includeFile = "qdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_datetimeedit.png";
+ r->name = "QDateTimeEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Date-Time Edit";
+ r->includeFile = "qdatetimeedit.h";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_multilineedit.png";
+ r->name = "QMultiLineEdit";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Multi Line Edit";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_richtextedit.png";
+ r->name = "QTextEdit";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Rich Text Edit";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_combobox.png";
+ r->name = "QComboBox";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Combo Box";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_slider.png";
+ r->name = "QSlider";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Slider";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_scrollbar.png";
+ r->name = "QScrollBar";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Scrollbar";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_dial.png";
+ r->name = "QDial";
+ r->group = widgetGroup( "Input" );
+ r->toolTip = "Dial";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_label.png";
+ r->name = "QLabel";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Label";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_label.png";
+ r->name = "TextLabel";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Text Label";
+ r->whatsThis = "The Text Label provides a widget to display static text.";
+ r->isCommon = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_pixlabel.png";
+ r->name = "PixmapLabel";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Pixmap Label";
+ r->whatsThis = "The Pixmap Label provides a widget to display pixmaps.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_lcdnumber.png";
+ r->name = "QLCDNumber";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "LCD Number";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_line.png";
+ r->name = "Line";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Line";
+ r->includeFile = "qframe.h";
+ r->whatsThis = "The Line widget provides horizontal and vertical lines.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_progress.png";
+ r->name = "QProgressBar";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Progress Bar";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_textview.png";
+ r->name = "QTextView";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Text View";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_textbrowser.png";
+ r->name = "QTextBrowser";
+ r->group = widgetGroup( "Display" );
+ r->toolTip = "Text Browser";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_spacer.png";
+ r->name = "Spacer";
+ r->group = widgetGroup( "Temp" );
+ r->toolTip = "Spacer";
+ r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the behaviour of layouts.";
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QWidget";
+ r->isForm = TRUE;
+ r->group = widgetGroup( "Forms" );
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QDialog";
+ r->group = widgetGroup( "Forms" );
+ r->isForm = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QWizard";
+ r->group = widgetGroup( "Forms" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QDesignerWizard";
+ r->group = widgetGroup( "Forms" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QLayoutWidget";
+ r->group = widgetGroup( "Temp" );
+ r->includeFile = "";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->name = "QSplitter";
+ r->group = widgetGroup( "Temp" );
+ r->includeFile = "qsplitter.h";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "QDesignerTabWidget";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "QDesignerWidget";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "designer_tabwidget.png";
+ r->name = "QDesignerDialog";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QMainWindow";
+ r->includeFile = "qmainwindow.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QDesignerAction";
+ r->includeFile = "qaction.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = FALSE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QDesignerActionGroup";
+ r->includeFile = "qaction.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = FALSE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QScrollView";
+ r->includeFile = "qscrollview.h";
+ r->group = widgetGroup( "Temp" );
+ r->isContainer = TRUE;
+
+ append( r );
+
+#ifndef QT_NO_SQL
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QDataBrowser";
+ r->includeFile = "qdatabrowser.h";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data Browser";
+ r->iconSet = "designer_databrowser.png";
+ r->isContainer = TRUE;
+
+ append( r );
+
+ r = new WidgetDatabaseRecord;
+ r->iconSet = "";
+ r->name = "QDataView";
+ r->includeFile = "qdataview.h";
+ r->group = widgetGroup( "Database" );
+ r->toolTip = "Data View";
+ r->iconSet = "designer_dataview.png";
+ r->isContainer = TRUE;
+
+ append( r );
+#endif
+
+#ifndef UIC
+ setupPlugins();
+#endif
+}
+
+void WidgetDatabase::setupPlugins()
+{
+ if ( plugins_set_up )
+ return;
+ plugins_set_up = TRUE;
+ QStringList widgets = widgetManager()->featureList();
+ for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) {
+ if ( hasWidget( *it ) )
+ continue;
+ WidgetDatabaseRecord *r = new WidgetDatabaseRecord;
+ WidgetInterface *iface = 0;
+ widgetManager()->queryInterface( *it, &iface );
+ if ( !iface )
+ continue;
+
+#ifndef UIC
+ QIconSet icon = iface->iconSet( *it );
+ if ( !icon.pixmap().isNull() )
+ r->icon = new QIconSet( icon );
+#endif
+ QString grp = iface->group( *it );
+ if ( grp.isEmpty() )
+ grp = "3rd party widgets";
+ r->group = widgetGroup( grp );
+ r->toolTip = iface->toolTip( *it );
+ r->whatsThis = iface->whatsThis( *it );
+ r->includeFile = iface->includeFile( *it );
+ r->isContainer = iface->isContainer( *it );
+ r->name = *it;
+ r->isPlugin = TRUE;
+ append( r );
+ iface->release();
+ }
+}
+
+/*!
+ Returns the number of elements in the widget database.
+*/
+
+int WidgetDatabase::count()
+{
+ setupDataBase( -1 );
+ return dbcount;
+}
+
+/*!
+ Returns the id at which the ids of custom widgets start.
+*/
+
+int WidgetDatabase::startCustom()
+{
+ setupDataBase( -1 );
+ return dbcustom;
+}
+
+/*!
+ Returns the iconset which represents the class registered as \a id.
+*/
+
+QIconSet WidgetDatabase::iconSet( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QIconSet();
+#if !defined(UIC) && !defined(RESOURCE)
+ if ( !r->icon ) {
+ if ( r->iconSet.isEmpty() )
+ return QIconSet();
+ QPixmap pix = BarIcon( r->iconSet, KDevDesignerPartFactory::instance() );
+ if ( pix.isNull() )
+ pix = QPixmap( r->iconSet );
+ r->icon = new QIconSet( pix );
+ }
+ return *r->icon;
+#else
+ return QIconSet();
+#endif
+}
+
+/*!
+ Returns the classname of the widget which is registered as \a id.
+*/
+
+QString WidgetDatabase::className( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QString::null;
+ return r->name;
+}
+
+/*!
+ Returns the group the widget registered as \a id belongs to.
+*/
+
+QString WidgetDatabase::group( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QString::null;
+ return r->group;
+}
+
+/*!
+ Returns the tooltip text of the widget which is registered as \a id.
+*/
+
+QString WidgetDatabase::toolTip( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QString::null;
+ return r->toolTip;
+}
+
+/*!
+ Returns the what's this? text of the widget which is registered as \a id.
+*/
+
+QString WidgetDatabase::whatsThis( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QString::null;
+ return r->whatsThis;
+}
+
+/*!
+ Returns the include file if the widget which is registered as \a id.
+*/
+
+QString WidgetDatabase::includeFile( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return QString::null;
+ if ( r->includeFile.isNull() )
+ return r->name.lower() + ".h";
+ return r->includeFile;
+}
+
+/*! Returns whether the widget registered as \a id is a form.
+*/
+bool WidgetDatabase::isForm( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isForm;
+}
+
+/*! Returns whether the widget registered as \a id can have children.
+*/
+
+bool WidgetDatabase::isContainer( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isContainer || r->isForm;
+}
+
+bool WidgetDatabase::isCommon( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isCommon;
+}
+
+QString WidgetDatabase::createWidgetName( int id )
+{
+ setupDataBase( id );
+ QString n = className( id );
+ if ( n == "QLayoutWidget" )
+ n = "Layout";
+ if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] )
+ n = n.mid( 1 );
+ int colonColon = n.findRev( "::" );
+ if ( colonColon != -1 )
+ n = n.mid( colonColon + 2 );
+
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return n;
+ n += QString::number( ++r->nameCounter );
+ n[0] = n[0].lower();
+ return n;
+}
+
+/*! Returns the id for \a name or -1 if \a name is unknown.
+ */
+int WidgetDatabase::idFromClassName( const QString &name )
+{
+ setupDataBase( -1 );
+ if ( name.isEmpty() )
+ return 0;
+ int *i = className2Id->find( name );
+ if ( i )
+ return *i;
+ if ( name == "FormWindow" )
+ return idFromClassName( "QLayoutWidget" );
+#ifdef UIC
+ setupDataBase( -2 );
+ i = className2Id->find( name );
+ if ( i )
+ return *i;
+#endif
+ return -1;
+}
+
+bool WidgetDatabase::hasWidget( const QString &name )
+{
+ return className2Id->find( name ) != 0;
+}
+
+WidgetDatabaseRecord *WidgetDatabase::at( int index )
+{
+ if ( index < 0 )
+ return 0;
+ if ( index >= dbcustom && index < dbcustomcount )
+ return db[ index ];
+ if ( index < dbcount )
+ return db[ index ];
+ return 0;
+}
+
+void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r )
+{
+ if ( index < 0 || index >= dbsize )
+ return;
+ db[ index ] = r;
+ className2Id->insert( r->name, new int( index ) );
+ if ( index < dbcustom )
+ dbcount = QMAX( dbcount, index );
+}
+
+void WidgetDatabase::append( WidgetDatabaseRecord *r )
+{
+ if ( !was_in_setup )
+ setupDataBase( -1 );
+ insert( dbcount++, r );
+}
+
+QString WidgetDatabase::widgetGroup( const QString &g )
+{
+ if ( wGroups->find( g ) == -1 )
+ wGroups->append( g );
+ return g;
+}
+
+bool WidgetDatabase::isGroupEmpty( const QString &grp )
+{
+ WidgetDatabaseRecord *r = 0;
+ for ( int i = 0; i < dbcount; ++i ) {
+ if ( !( r = db[ i ] ) )
+ continue;
+ if ( r->group == grp )
+ return FALSE;
+ }
+ return TRUE;
+}
+
+QString WidgetDatabase::widgetGroup( int i )
+{
+ setupDataBase( -1 );
+ if ( i >= 0 && i < (int)wGroups->count() )
+ return wGroups->at( i );
+ return QString::null;
+}
+
+int WidgetDatabase::numWidgetGroups()
+{
+ setupDataBase( -1 );
+ return wGroups->count();
+}
+
+bool WidgetDatabase::isGroupVisible( const QString &g )
+{
+ setupDataBase( -1 );
+ return invisibleGroups->find( g ) == -1;
+}
+
+int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r )
+{
+ insert( dbcustomcount++, r );
+ return dbcustomcount - 1;
+}
+
+void WidgetDatabase::customWidgetClassNameChanged( const QString &oldName,
+ const QString &newName )
+{
+ int id = idFromClassName( oldName );
+ if ( id == -1 )
+ return;
+ WidgetDatabaseRecord *r = db[ id ];
+ r->name = newName;
+ className2Id->remove( oldName );
+ className2Id->insert( newName, new int( id ) );
+}
+
+bool WidgetDatabase::isCustomWidget( int id )
+{
+ if ( id >= dbcustom && id < dbcustomcount )
+ return TRUE;
+ return FALSE;
+}
+
+bool WidgetDatabase::isCustomPluginWidget( int id )
+{
+ setupDataBase( id );
+ WidgetDatabaseRecord *r = at( id );
+ if ( !r )
+ return FALSE;
+ return r->isPlugin;
+}
+
+bool WidgetDatabase::isWhatsThisLoaded()
+{
+ return whatsThisLoaded;
+}
+
+void WidgetDatabase::loadWhatsThis( const QString &docPath )
+{
+ QString whatsthisFile = docPath + "/whatsthis";
+ QFile f( whatsthisFile );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+ QTextStream ts( &f );
+ while ( !ts.atEnd() ) {
+ QString s = ts.readLine();
+ QStringList l = QStringList::split( " | ", s );
+ int id = idFromClassName( l[ 1 ] );
+ WidgetDatabaseRecord *r = at( id );
+ if ( r )
+ r->whatsThis = l[ 0 ];
+ }
+ whatsThisLoaded = TRUE;
+}
+
+
+// ### Qt 3.1: make these publically accessible via QWidgetDatabase API
+#if defined(UIC)
+bool dbnounload = FALSE;
+QStringList *dbpaths = 0;
+#else
+extern QString *qwf_plugin_dir;
+#endif
+
+
+QPluginManager<WidgetInterface> *widgetManager()
+{
+ if ( !widgetPluginManager ) {
+ QString pluginDir = "/designer";
+#if !defined(UIC)
+ if ( qwf_plugin_dir )
+ pluginDir = *qwf_plugin_dir;
+#endif
+ widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), pluginDir );
+ cleanup_manager.add( &widgetPluginManager );
+#if defined(UIC)
+ if ( dbnounload )
+ widgetPluginManager->setAutoUnload( FALSE );
+ if ( dbpaths ) {
+ QStringList::ConstIterator it = dbpaths->begin();
+ for ( ; it != dbpaths->end(); ++it )
+ widgetPluginManager->addLibraryPath( *it );
+ }
+#endif
+ }
+ return widgetPluginManager;
+}
diff --git a/kdevdesigner/shared/widgetdatabase.h b/kdevdesigner/shared/widgetdatabase.h
new file mode 100644
index 00000000..03060fa3
--- /dev/null
+++ b/kdevdesigner/shared/widgetdatabase.h
@@ -0,0 +1,96 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef WIDGETDATABASE_H
+#define WIDGETDATABASE_H
+
+#include <qiconset.h>
+#include <qstring.h>
+#include "../interfaces/widgetinterface.h" // up here for GCC 2.7.* compatibility
+#include <private/qpluginmanager_p.h>
+
+
+extern QPluginManager<WidgetInterface> *widgetManager();
+
+struct WidgetDatabaseRecord
+{
+ WidgetDatabaseRecord();
+ ~WidgetDatabaseRecord();
+ QString iconSet, name, group, toolTip, whatsThis, includeFile;
+ uint isContainer : 1;
+ uint isForm : 1;
+ uint isCommon : 1;
+ uint isPlugin : 1;
+ QIconSet *icon;
+ int nameCounter;
+};
+
+class WidgetDatabase : public Qt
+{
+public:
+ WidgetDatabase();
+ static void setupDataBase( int id );
+ static void setupPlugins();
+
+ static int count();
+ static int startCustom();
+
+ static QIconSet iconSet( int id );
+ static QString className( int id );
+ static QString group( int id );
+ static QString toolTip( int id );
+ static QString whatsThis( int id );
+ static QString includeFile( int id );
+ static bool isForm( int id );
+ static bool isContainer( int id );
+ static bool isCommon( int id );
+
+ static int idFromClassName( const QString &name );
+ static QString createWidgetName( int id );
+
+ static WidgetDatabaseRecord *at( int index );
+ static void insert( int index, WidgetDatabaseRecord *r );
+ static void append( WidgetDatabaseRecord *r );
+
+ static QString widgetGroup( const QString &g );
+ static QString widgetGroup( int i );
+ static int numWidgetGroups();
+ static bool isGroupVisible( const QString &g );
+ static bool isGroupEmpty( const QString &grp );
+
+ static int addCustomWidget( WidgetDatabaseRecord *r );
+ static bool isCustomWidget( int id );
+ static bool isCustomPluginWidget( int id );
+
+ static bool isWhatsThisLoaded();
+ static void loadWhatsThis( const QString &docPath );
+
+ static bool hasWidget( const QString &name );
+ static void customWidgetClassNameChanged( const QString &oldName, const QString &newName );
+
+};
+
+#endif
diff --git a/kdevdesigner/src/Makefile.am b/kdevdesigner/src/Makefile.am
new file mode 100644
index 00000000..f6e1b854
--- /dev/null
+++ b/kdevdesigner/src/Makefile.am
@@ -0,0 +1,47 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = kdevdesigner.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kdevdesigner.pot
+
+
+# this Makefile creates both a KPart application and a KPart
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = kdevdesigner
+
+# the application source, library search path, and link libraries
+kdevdesigner_SOURCES = main.cpp kdevdesigner.cpp
+kdevdesigner_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+kdevdesigner_LDADD = $(LIB_KPARTS)
+
+# this is where the desktop file will go
+#shelldesktopdir = $(kde_appsdir)/Development
+#shelldesktop_DATA = kdevdesigner.desktop
+xdg_apps_DATA = kdevdesigner.desktop
+
+# this is where the shell's XML-GUI resource file goes
+shellrcdir = $(kde_datadir)/kdevdesigner
+shellrc_DATA = kdevdesigner_shell.rc
+
+#########################################################################
+# KPART SECTION
+#########################################################################
+
+# the Part's source, library search path, and link libraries
+
+
+# this is where the desktop file will go
+partdesktopdir = $(kde_servicesdir)
+
+# this is where the part's XML-GUI resource file goes
+partrcdir = $(kde_datadir)/kdevdesignerpart
diff --git a/kdevdesigner/src/kdevdesigner.cpp b/kdevdesigner/src/kdevdesigner.cpp
new file mode 100644
index 00000000..4e2b0d0d
--- /dev/null
+++ b/kdevdesigner/src/kdevdesigner.cpp
@@ -0,0 +1,216 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "kdevdesigner.h"
+
+#include <kxmlguiclient.h>
+#include <kkeydialog.h>
+#include <kfiledialog.h>
+#include <kconfig.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+#include <kedittoolbar.h>
+
+#include <kaction.h>
+#include <kstdaction.h>
+
+#include <klibloader.h>
+#include <kmessagebox.h>
+#include <kstatusbar.h>
+#include <klocale.h>
+
+KDevDesigner::KDevDesigner()
+ : KParts::MainWindow( 0L, "KDevDesigner" )
+{
+ // set the shell's ui resource file
+ setXMLFile("kdevdesigner_shell.rc");
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar()->show();
+
+ // this routine will find and load our Part. it finds the Part by
+ // name which is a bad idea usually.. but it's alright in this
+ // case since our Part is made for this Shell
+ KLibFactory *factory = KLibLoader::self()->factory("libkdevdesignerpart");
+ if (factory)
+ {
+ // now that the Part is loaded, we cast it to a Part to get
+ // our hands on it
+ QStringList args;
+ args.append("in shell");
+ m_part = static_cast<KParts::ReadWritePart *>(factory->create(this,
+ "kdevdesigner_part", "KParts::ReadWritePart", args));
+
+ if (m_part)
+ {
+ // tell the KParts::MainWindow that this is indeed the main widget
+ setCentralWidget(m_part->widget());
+
+ // and integrate the part's GUI with the shell's
+ createGUI(m_part);
+ }
+ }
+ else
+ {
+ // if we couldn't find our Part, we exit since the Shell by
+ // itself can't do anything useful
+ KMessageBox::error(this, i18n("Could not find the KDevDesigner part."));
+ kapp->quit();
+ // we return here, cause kapp->quit() only means "exit the
+ // next time we enter the event loop...
+ return;
+ }
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+}
+
+KDevDesigner::~KDevDesigner()
+{
+}
+
+void KDevDesigner::load(const KURL& url)
+{
+ m_part->openURL( url );
+}
+
+void KDevDesigner::setupActions()
+{
+/* KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());*/
+
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
+}
+
+void KDevDesigner::saveProperties(KConfig* /*config*/)
+{
+ // the 'config' object points to the session managed
+ // config file. anything you write here will be available
+ // later when this app is restored
+}
+
+void KDevDesigner::readProperties(KConfig* /*config*/)
+{
+ // the 'config' object points to the session managed
+ // config file. this function is automatically called whenever
+ // the app is being restored. read in here whatever you wrote
+ // in 'saveProperties'
+}
+
+void KDevDesigner::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here..
+ if ( ! m_part->url().isEmpty() || m_part->isModified() )
+ {
+ (new KDevDesigner)->show();
+ };
+}
+
+
+void KDevDesigner::optionsShowToolbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // toolbar
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void KDevDesigner::optionsShowStatusbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // statusbar
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void KDevDesigner::optionsConfigureKeys()
+{
+ KKeyDialog::configureKeys(m_part->actionCollection(), "kdevdesigner_part.rc");
+}
+
+void KDevDesigner::optionsConfigureToolbars()
+{
+ saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+
+ // use the standard toolbar editor
+ KEditToolbar dlg(factory());
+ connect(&dlg, SIGNAL(newToolbarConfig()),
+ this, SLOT(applyNewToolbarConfig()));
+ dlg.exec();
+}
+
+void KDevDesigner::applyNewToolbarConfig()
+{
+ applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void KDevDesigner::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ KURL url =
+ KFileDialog::getOpenURL( QString::null, QString::null, this );
+
+ if (url.isEmpty() == false)
+ {
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here..
+ if ( m_part->url().isEmpty() && ! m_part->isModified() )
+ {
+ // we open the file in this window...
+ load( url );
+ }
+ else
+ {
+ // we open the file in a new window...
+ KDevDesigner* newWin = new KDevDesigner;
+ newWin->load( url );
+ newWin->show();
+ }
+ }
+}
+
+#include "kdevdesigner.moc"
diff --git a/kdevdesigner/src/kdevdesigner.desktop b/kdevdesigner/src/kdevdesigner.desktop
new file mode 100644
index 00000000..7bced6fb
--- /dev/null
+++ b/kdevdesigner/src/kdevdesigner.desktop
@@ -0,0 +1,96 @@
+[Desktop Entry]
+Name=KDevelop Designer
+Name[el]=Σχεδιαστής KDevelop
+Name[es]=Diseñador de KDevelop
+Name[et]=KDevelopi Disainer
+Name[eu]=KDevelop disenatzailea
+Name[fa]=طراح KDevelop
+Name[fr]=Concepteur KDevelop
+Name[ga]=Dearthóir KDevelop
+Name[it]=Designer di KDevelop
+Name[ja]=KDevelop デザイナー
+Name[ms]=Pereka KDevelop
+Name[nds]=KDevelop-Maker
+Name[ne]=केडीई विकास डिजाइनर
+Name[pl]=Projektant KDevelop
+Name[pt]=Desenhador do KDevelop
+Name[pt_BR]=Designer do KDevelop
+Name[sk]=KDevelop Dizajnér
+Name[sl]=Snovalnik KDevelop
+Name[sv]=KDevelop designer
+Name[ta]=கேமேம்பாட்டு வடிவமைப்பாளர்
+Name[tg]=Дизайнгари KDevelop
+Name[zh_CN]=KDevelop 设计师
+Name[zh_TW]=KDevelop 設計器
+GenericName=Interface Designer
+GenericName[br]=Ergrafer etrefas
+GenericName[ca]=Dissenyador de interfícies
+GenericName[cy]=Dylunydd Rhyngwyneb
+GenericName[de]=Oberflächen-Designer
+GenericName[el]=Σχεδιαστής διασυνδέσεων
+GenericName[es]=Diseñador de interfaces
+GenericName[et]=Liidesedisainer
+GenericName[eu]=Interfazeen diseinatzailea
+GenericName[fa]=طراح واسط
+GenericName[fr]=Concepteur d'interfaces graphiques
+GenericName[ga]=Dearthóir Comhéadain
+GenericName[gl]=Deseñador de interfaces
+GenericName[hu]=Felülettervező
+GenericName[it]=Interfaccia del Designer
+GenericName[ja]=インターフェースデザイナー
+GenericName[lt]=Sąsajos redaktorius
+GenericName[ms]=Pereka Antaramuka
+GenericName[nds]=Böversietmaker
+GenericName[ne]=इन्टरफेस डिजाइनर
+GenericName[pl]=Projektowanie interfejsu
+GenericName[pt]=Editor de Interfaces
+GenericName[pt_BR]=Desenhador de Interface
+GenericName[ru]=Дизайнер пользовательского интерфейса
+GenericName[rw]=Umuhanzi w'Imigaragarire
+GenericName[sk]=Interface Dizajnér
+GenericName[sl]=Snovalnik vmesnikov
+GenericName[sr]=Дизајнер интерфејса
+GenericName[sr@Latn]=Dizajner interfejsa
+GenericName[sv]=Gränssnittsdesign
+GenericName[tr]=Arayüz Tasarlayıcısı
+GenericName[zh_CN]=界面设计师
+GenericName[zh_TW]=介面設計器
+Exec=kdevdesigner %i -caption "%c"
+Icon=kdevdesigner
+Type=Application
+X-DocPath=kdevdesigner/kdevdesigner.html
+Comment=GUI Designer for Qt/KDE
+Comment[ca]=Dissenyador de IGU per Qt/KDE
+Comment[da]=Grafisk brugerfladedesigner til Qt/KDE
+Comment[de]=Auf Qt-Designer basierender GUI-Designer
+Comment[el]=Σχεδιαστής GUI για Qt/KDE
+Comment[es]=Diseñador de interfaces para Qt/KDE
+Comment[et]=Qt/KDE graafilise kasutajaliidese disainer
+Comment[eu]=GUI diseinatzailea Qt/KDE-rako
+Comment[fa]=طراح ونک برای Qt/KDE
+Comment[fr]=Concepteur d'interfaces graphiques pour Qt / KDE
+Comment[ga]=Dearthóir Comhéadan Grafach le haghaidh Qt/KDE
+Comment[gl]=Deseñador GUI para Qt/KDE
+Comment[hu]=Qt/KDE felülettervező
+Comment[it]=Designer di GUI per Qt/KDE
+Comment[ja]=Qt/KDE のための GUI デザイナー
+Comment[ms]=Pereka GUI untuk Qt/KDE
+Comment[nds]=Böversietmaker för Qt/KDE
+Comment[ne]=Qt/KDE का लागि जी यू आई डिजाइनर
+Comment[nl]=GUI Designer voor Qt/KDE
+Comment[pl]=Projektant graficznego interfejsu użytkownika dla Qt/KDE
+Comment[pt]=Editor de Interfaces para Qt/KDE
+Comment[pt_BR]=Designer de GUI para o Qt/KDE
+Comment[ru]=Среда создания графических форм Qt/KDE
+Comment[sk]=GUI Dizajnér pre Qt/KDE
+Comment[sl]=Snovalnik grafičnega vmesnika za Qt/KDE
+Comment[sr]=Дизајнер GUI-ја за Qt/KDE
+Comment[sr@Latn]=Dizajner GUI-ja za Qt/KDE
+Comment[sv]=Grafisk gränssnittsdesign för Qt och KDE
+Comment[ta]=Qtக்கான GUI வடிவமைப்பாளர்
+Comment[tg]=Муҳит барои сохтани Qt/KDE ба шакли графикӣ
+Comment[tr]=Qt/KDE için Arayüz Tasarlayıcısı
+Comment[zh_CN]=Qt/KDE 的 GUI 设计师
+Comment[zh_TW]=Qt/KDE 的使用者介面設計器
+Terminal=false
+Categories=Qt;KDE;Development;GUIDesigner;X-KDE-KDevelopIDE;
diff --git a/kdevdesigner/src/kdevdesigner.h b/kdevdesigner/src/kdevdesigner.h
new file mode 100644
index 00000000..52a5a259
--- /dev/null
+++ b/kdevdesigner/src/kdevdesigner.h
@@ -0,0 +1,96 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _KDEVDESIGNER_H_
+#define _KDEVDESIGNER_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kxmlguiclient.h>
+#include <kapplication.h>
+#include <kparts/mainwindow.h>
+
+class KToggleAction;
+
+/**
+ * This is the application "Shell". It has a menubar, toolbar, and
+ * statusbar but relies on the "Part" to do all the real work.
+ *
+ * @short Application Shell
+ * @author Alexander Dymo <cloudtemple@mksat.net>
+ * @version 0.1
+ */
+class KDevDesigner : public KParts::MainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ KDevDesigner();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~KDevDesigner();
+
+ /**
+ * Use this method to load whatever file/URL you have
+ */
+ void load(const KURL& url);
+
+protected:
+ /**
+ * This method is called when it is time for the app to save its
+ * properties for session management purposes.
+ */
+ void saveProperties(KConfig *);
+
+ /**
+ * This method is called when this app is restored. The KConfig
+ * object points to the session management config file that was saved
+ * with @ref saveProperties
+ */
+ void readProperties(KConfig *);
+
+private slots:
+ void fileNew();
+ void fileOpen();
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+
+ void applyNewToolbarConfig();
+
+private:
+ void setupAccel();
+ void setupActions();
+
+private:
+ KParts::ReadWritePart *m_part;
+
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+};
+
+#endif // _KDEVDESIGNER_H_
diff --git a/kdevdesigner/src/kdevdesigner_shell.rc b/kdevdesigner/src/kdevdesigner_shell.rc
new file mode 100644
index 00000000..1bb33a25
--- /dev/null
+++ b/kdevdesigner/src/kdevdesigner_shell.rc
@@ -0,0 +1,37 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kdevdesigner_shell" version="2">
+<MenuBar>
+ <Menu noMerge="1" name="file"><text>&amp;File</text>
+ <Merge/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+ <Menu noMerge="1" name="edit"><text>&amp;Edit</text>
+ <Merge/>
+ </Menu>
+ <Menu noMerge="1" name="project"><text>&amp;Project</text>
+ <Merge/>
+ </Menu>
+ <Menu noMerge="1" name="tools"><text>&amp;Tools</text>
+ <Merge/>
+ </Menu>
+ <Menu noMerge="1" name="layout"><text>&amp;Layout</text>
+ <Merge/>
+ </Menu>
+ <Menu noMerge="1" name="window"><text>&amp;Window</text>
+ <Merge/>
+ </Menu>
+ <Merge/>
+ <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+ <Action name="options_show_toolbar"/>
+ <Action name="options_show_statusbar"/>
+ <Merge name="show_merge"/>
+ <Separator/>
+ <Action name="options_configure_keybinding"/>
+ <Action name="options_configure_toolbars"/>
+ <Action name="options_configure"/>
+ <Merge name="configure_merge"/>
+ <Separator/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/kdevdesigner/src/main.cpp b/kdevdesigner/src/main.cpp
new file mode 100644
index 00000000..cf432f9d
--- /dev/null
+++ b/kdevdesigner/src/main.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <qsplashscreen.h>
+
+#include <kxmlguiclient.h>
+#include "kdevdesigner.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+static const char description[] =
+ I18N_NOOP("KDE GUI Designer");
+
+static const char version[] = "0.2";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("kdevdesigner", I18N_NOOP("KDevDesigner"), version, description,
+ KAboutData::License_GPL, "KDevDesigner Copyright: (C) 2004-2005 Alexander Dymo\nQt Designer Copyright: (C) 2000-2005 Trolltech AS All Rights Reserved", 0, 0);
+ about.addAuthor( "Trolltech AS", "Qt Designer code (Free Edition)" );
+ about.addAuthor( "Alexander Dymo", "Port to KDE, partification", "adymo@kdevelop.org" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(KDevDesigner);
+ }
+ else
+ {
+ // no session.. just start up normally
+ QSplashScreen * splash = 0;
+ QString splashFile = locate("data", "kdevelop/pics/kdevdesigner-splash.png");
+ if (!splashFile.isNull())
+ {
+ QPixmap pm;
+ pm.load(splashFile);
+ splash = new QSplashScreen( pm );
+ splash->show();
+ }
+
+ app.processEvents();
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if ( args->count() == 0 )
+ {
+ KDevDesigner *widget = new KDevDesigner;
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++ )
+ {
+ KDevDesigner *widget = new KDevDesigner;
+ widget->show();
+ widget->load( args->url( i ) );
+ }
+ }
+ args->clear();
+ if (splash)
+ delete splash;
+ }
+
+ return app.exec();
+}
diff --git a/kdevdesigner/uilib/Makefile.am b/kdevdesigner/uilib/Makefile.am
new file mode 100644
index 00000000..0480cd50
--- /dev/null
+++ b/kdevdesigner/uilib/Makefile.am
@@ -0,0 +1,9 @@
+KDE_CXXFLAGS=-UQT_NO_ASCII_CAST
+
+INCLUDES = -I$(top_srcdir)/kdevdesigner/shared $(all_includes)
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libkdevqui.la
+libkdevqui_la_SOURCES = database.cpp qwidgetfactory.cpp
+
+libkdevqui_la_LDFLAGS = $(all_libraries)
diff --git a/kdevdesigner/uilib/database.cpp b/kdevdesigner/uilib/database.cpp
new file mode 100644
index 00000000..a92a04c8
--- /dev/null
+++ b/kdevdesigner/uilib/database.cpp
@@ -0,0 +1,122 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#if defined(DESIGNER)
+#include "database.h"
+#else
+#include "database2.h"
+#endif
+
+#ifndef QT_NO_SQL
+
+#if defined(DESIGNER)
+#include "formwindow.h"
+#include "mainwindow.h"
+#endif
+
+#include <qsqldatabase.h>
+#include <qsqlform.h>
+#include <qsqlcursor.h>
+#include <qsqlrecord.h>
+
+DatabaseSupport::DatabaseSupport()
+{
+ con = 0;
+ frm = 0;
+ parent = 0;
+}
+
+void DatabaseSupport::initPreview( const QString &connection, const QString &table, QObject *o,
+ const QMap<QString, QString> &databaseControls )
+{
+ tbl = table;
+ dbControls = databaseControls;
+ parent = o;
+
+ if ( connection != "(default)" )
+ con = QSqlDatabase::database( connection );
+ else
+ con = QSqlDatabase::database();
+ frm = new QSqlForm( o, table );
+ for ( QMap<QString, QString>::Iterator it = dbControls.begin(); it != dbControls.end(); ++it ) {
+ QObject *chld = parent->child( it.key(), "QWidget" );
+ if ( !chld )
+ continue;
+ frm->insert( (QWidget*)chld, *it );
+ }
+}
+
+QDesignerDataBrowser::QDesignerDataBrowser( QWidget *parent, const char *name )
+ : QDataBrowser( parent, name )
+{
+}
+
+bool QDesignerDataBrowser::event( QEvent* e )
+{
+ bool b = QDataBrowser::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == QEvent::Show ) {
+ if ( con ) {
+ QSqlCursor* cursor = new QSqlCursor( tbl, TRUE, con );
+ setSqlCursor( cursor, TRUE );
+ setForm( frm );
+ refresh();
+ first();
+ }
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+QDesignerDataView::QDesignerDataView( QWidget *parent, const char *name )
+ : QDataView( parent, name )
+{
+}
+
+bool QDesignerDataView::event( QEvent* e )
+{
+ bool b = QDataView::event( e );
+#if defined(DESIGNER)
+ if ( MainWindow::self->isPreviewing() ) {
+#endif
+ if ( e->type() == QEvent::Show ) {
+ setForm( frm );
+ readFields();
+ return TRUE;
+ }
+#if defined(DESIGNER)
+ }
+#endif
+ return b;
+}
+
+
+#endif
diff --git a/kdevdesigner/uilib/database2.h b/kdevdesigner/uilib/database2.h
new file mode 100644
index 00000000..05a04712
--- /dev/null
+++ b/kdevdesigner/uilib/database2.h
@@ -0,0 +1,88 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef DATABASE2_H
+#define DATABASE2_H
+
+#include "qfeatures.h"
+
+#ifndef QT_NO_SQL
+#include <qdataview.h>
+#include <qdatabrowser.h>
+#include <qsqlcursor.h>
+#include <qstring.h>
+
+class QSqlDatabase;
+class QSqlForm;
+
+class DatabaseSupport2
+{
+public:
+ DatabaseSupport2();
+ virtual ~DatabaseSupport2() {}
+
+ void initPreview( const QString &connection, const QString &table, QObject *o,
+ const QMap<QString, QString> &databaseControls );
+
+protected:
+ QSqlDatabase* con;
+ QSqlForm* frm;
+ QString tbl;
+ QMap<QString, QString> dbControls;
+ QObject *parent;
+
+};
+
+class QDesignerDataBrowser2 : public QDataBrowser, public DatabaseSupport2
+{
+ Q_OBJECT
+
+public:
+ QDesignerDataBrowser2( QWidget *parent, const char *name );
+
+protected:
+ bool event( QEvent* e );
+};
+
+class QDesignerDataView2 : public QDataView, public DatabaseSupport2
+{
+ Q_OBJECT
+
+public:
+ QDesignerDataView2( QWidget *parent, const char *name );
+
+protected:
+ bool event( QEvent* e );
+
+};
+
+#define DatabaseSupport DatabaseSupport2
+#define QDesignerDataBrowser QDesignerDataBrowser2
+#define QDesignerDataView QDesignerDataView2
+
+#endif
+
+#endif
diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp
new file mode 100644
index 00000000..43c7c11e
--- /dev/null
+++ b/kdevdesigner/uilib/qwidgetfactory.cpp
@@ -0,0 +1,2606 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "qwidgetfactory.h"
+
+#include "../interfaces/languageinterface.h"
+#include "../interfaces/widgetinterface.h"
+
+#include <qfeatures.h>
+#include "database2.h"
+#include <qdom.h>
+#include <qdir.h>
+#include <qlayout.h>
+#include <qmetaobject.h>
+#include <domtool.h>
+#include <uib.h>
+#include <qapplication.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qobjectlist.h>
+#include <private/qpluginmanager_p.h>
+#include <qmime.h>
+#include <qdragobject.h>
+
+#ifndef QT_NO_SQL
+#include <qsqlrecord.h>
+#include <qsqldatabase.h>
+#include <qdatatable.h>
+#endif
+
+// include all Qt widgets we support
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qgroupbox.h>
+#include <qbuttongroup.h>
+#include <qiconview.h>
+#include <qheader.h>
+#ifndef QT_NO_TABLE
+#include <qtable.h>
+#endif
+#include <qlistbox.h>
+#include <qlistview.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qmultilineedit.h>
+#include <qlabel.h>
+#include <qwidget.h>
+#include <qtabwidget.h>
+#include <qcombobox.h>
+#include <qdialog.h>
+#include <qwizard.h>
+#include <qlcdnumber.h>
+#include <qprogressbar.h>
+#include <qtextview.h>
+#include <qtextbrowser.h>
+#include <qdial.h>
+#include <qslider.h>
+#include <qframe.h>
+#include <qwidgetstack.h>
+#include <qtoolbox.h>
+#include <qtextedit.h>
+#include <qscrollbar.h>
+#include <qmainwindow.h>
+#include <qsplitter.h>
+#include <qaction.h>
+#include <qpopupmenu.h>
+#include <qmenubar.h>
+#include <qpopupmenu.h>
+#include <qdatetimeedit.h>
+#include <qvbox.h>
+#include <qhbox.h>
+#include <qgrid.h>
+
+#include <stdlib.h>
+
+class QWidgetFactoryPrivate
+{
+public:
+ QCString translationContext;
+ QListViewItem *lastItem;
+ QDict<bool> customWidgets;
+};
+
+static QPtrList<QWidgetFactory> widgetFactories;
+static QPluginManager<LanguageInterface> *languageInterfaceManager = 0;
+static QPluginManager<WidgetInterface> *widgetInterfaceManager = 0;
+
+static QMap<QString, bool> *availableWidgetMap = 0;
+static QStringList *availableWidgetList = 0;
+
+QMap<QWidget*, QString> *qwf_forms = 0;
+QString *qwf_language = 0;
+bool qwf_execute_code = TRUE;
+bool qwf_stays_on_top = FALSE;
+QString qwf_currFileName = "";
+QObject *qwf_form_object = 0;
+QString *qwf_plugin_dir = 0;
+
+static void setupPluginDir()
+{
+ if ( !qwf_plugin_dir )
+ qwf_plugin_dir = new QString( "/designer" );
+}
+
+static void setupWidgetListAndMap()
+{
+ if ( availableWidgetMap )
+ return;
+ setupPluginDir();
+ availableWidgetList = new QStringList;
+ (*availableWidgetList) << "QPushButton" << "QToolButton" << "QCheckBox" << "QRadioButton"
+ << "QGroupBox" << "QButtonGroup" << "QIconView" << "QTable"
+ << "QListBox" << "QListView" << "QLineEdit" << "QSpinBox"
+ << "QMultiLineEdit" << "QLabel" << "TextLabel" << "PixmapLabel"
+ << "QLayoutWidget" << "QTabWidget" << "QComboBox"
+ << "QWidget" << "QDialog" << "QWizard" << "QLCDNumber";
+ // put less stress on the compiler by limiting the template nesting depth
+ (*availableWidgetList) << "QProgressBar" << "QTextView" << "QTextBrowser"
+ << "QDial" << "QSlider" << "QFrame" << "Line" << "QTextEdit"
+ << "QDateEdit" << "QTimeEdit" << "QDateTimeEdit" << "QScrollBar"
+ << "QPopupMenu" << "QWidgetStack" << "QMainWindow"
+ << "QDataTable" << "QDataBrowser" << "QDataView"
+ << "QVBox" << "QHBox" << "QGrid" << "QToolBox";
+
+ if ( !widgetInterfaceManager )
+ widgetInterfaceManager =
+ new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), *qwf_plugin_dir );
+
+ QStringList l = widgetInterfaceManager->featureList();
+ QStringList::Iterator it;
+ for ( it = l.begin(); it != l.end(); ++it )
+ (*availableWidgetList) << *it;
+
+ availableWidgetMap = new QMap<QString, bool>;
+ for ( it = availableWidgetList->begin(); it != availableWidgetList->end(); ++it )
+ availableWidgetMap->insert( *it, TRUE );
+}
+
+static QImage loadImageData( const QString& format, ulong len, QByteArray data )
+{
+ QImage img;
+ if ( format == "XPM.GZ" || format == "XBM.GZ" ) {
+ if ( len < data.size() * 10 )
+ len = data.size() * 10;
+ // qUncompress() expects the first 4 bytes to be the expected length of
+ // the uncompressed data
+ QByteArray dataTmp( data.size() + 4 );
+ memcpy( dataTmp.data()+4, data.data(), data.size() );
+ dataTmp[0] = ( len & 0xff000000 ) >> 24;
+ dataTmp[1] = ( len & 0x00ff0000 ) >> 16;
+ dataTmp[2] = ( len & 0x0000ff00 ) >> 8;
+ dataTmp[3] = ( len & 0x000000ff );
+ QByteArray baunzip = qUncompress( dataTmp );
+ len = baunzip.size();
+ img.loadFromData( (const uchar*)baunzip.data(), len, format.left(format.find('.')) );
+ } else {
+ img.loadFromData( (const uchar*)data.data(), data.size(), format );
+ }
+ return img;
+}
+
+static QSizePolicy::SizeType stringToSizeType( const QString& str )
+{
+ if ( str == "Fixed" ) {
+ return QSizePolicy::Fixed;
+ } else if ( str == "Minimum" ) {
+ return QSizePolicy::Minimum;
+ } else if ( str == "Maximum" ) {
+ return QSizePolicy::Maximum;
+ } else if ( str == "Preferred" ) {
+ return QSizePolicy::Preferred;
+ } else if ( str == "MinimumExpanding" ) {
+ return QSizePolicy::MinimumExpanding;
+ } else if ( str == "Expanding" ) {
+ return QSizePolicy::Expanding;
+ } else {
+ return QSizePolicy::Ignored;
+ }
+}
+
+
+/*!
+ \class QWidgetFactory
+
+ \brief The QWidgetFactory class provides for the dynamic creation of widgets
+ from Qt Designer .ui files.
+
+ This class basically offers two things:
+
+ \list
+
+ \i Dynamically creating widgets from \link designer-manual.book Qt
+ Designer\endlink user interface description files.
+ You can do this using the static function QWidgetFactory::create().
+ This function also performs signal and slot connections, tab
+ ordering, etc., as defined in the .ui file, and returns the
+ top-level widget in the .ui file. After creating the widget you can
+ use QObject::child() and QObject::queryList() to access child
+ widgets of this returned widget.
+
+ \i Adding additional widget factories to be able to create custom
+ widgets. See createWidget() for details.
+
+ \endlist
+
+ This class is not included in the Qt library itself. To use it you
+ must link against \c libqui.so (Unix) or \c qui.lib (Windows), which is
+ built into \c INSTALL/lib if you built \e{Qt Designer} (\c INSTALL is
+ the directory where Qt is installed ).
+
+ See the "Creating Dynamic Dialogs from .ui Files" section of the \link
+ designer-manual.book Qt Designer manual\endlink for an example. See
+ also the \l{QWidgetPlugin} class and the \link plugins-howto.html
+ Plugins documentation\endlink.
+*/
+
+/*! Constructs a QWidgetFactory. */
+
+QWidgetFactory::QWidgetFactory()
+ : d( new QWidgetFactoryPrivate() ), dbControls( 0 ),
+ usePixmapCollection( FALSE ), defMargin( 11 ), defSpacing( 6 )
+{
+ widgetFactories.setAutoDelete( TRUE );
+ d->customWidgets.setAutoDelete( TRUE );
+}
+
+/*! \fn QWidgetFactory::~QWidgetFactory()
+ Destructor.
+*/
+QWidgetFactory::~QWidgetFactory()
+{
+ delete d;
+}
+
+/*!
+
+ Loads the \e{Qt Designer} user interface description file \a uiFile
+ and returns the top-level widget in that description. \a parent and
+ \a name are passed to the constructor of the top-level widget.
+
+ This function also performs signal and slot connections, tab
+ ordering, etc., as described in the .ui file. In \e{Qt Designer} it
+ is possible to add custom slots to a form and connect to them. If
+ you want these connections to be made, you must create a class
+ derived from QObject, which implements all these slots. Then pass an
+ instance of the object as \a connector to this function. If you do
+ this, the connections to the custom slots will be done using the \a
+ connector as slot.
+
+ If something fails, 0 is returned.
+
+ The ownership of the returned widget is passed to the caller.
+*/
+
+QWidget *QWidgetFactory::create( const QString &uiFile, QObject *connector,
+ QWidget *parent, const char *name )
+{
+ setupPluginDir();
+ QFile f( uiFile );
+ bool failed = FALSE;
+ if ( !f.open( IO_ReadOnly ) )
+ failed = TRUE;
+ if ( failed && qApp->type() == QApplication::Tty ) {
+ // for QSA: If we have no GUI, we have no form definition
+ // files, but just the code. So try if only the code exists.
+ f.setName( uiFile + ".qs" );
+ failed = !f.open( IO_ReadOnly );
+ }
+ if ( failed )
+ return 0;
+
+ qwf_currFileName = uiFile;
+ QWidget *w = QWidgetFactory::create( &f, connector, parent, name );
+ if ( !qwf_forms )
+ qwf_forms = new QMap<QWidget*, QString>;
+ qwf_forms->insert( w, uiFile );
+ return w;
+}
+
+#undef slots
+
+/*! \overload
+ Loads the user interface description from device \a dev.
+ */
+
+QWidget *QWidgetFactory::create( QIODevice *dev, QObject *connector, QWidget *parent, const char *name )
+{
+ setupPluginDir();
+ QWidget *w = 0;
+ QDomDocument doc;
+ QString errMsg;
+ int errLine;
+
+ QWidgetFactory *widgetFactory = new QWidgetFactory;
+ widgetFactory->toplevel = 0;
+
+ // If we have no GUI, we only want to load the code
+ if ( qApp->type() != QApplication::Tty ) {
+ QIODevice::Offset start = dev->at();
+ Q_UINT32 magic;
+ QDataStream in( dev );
+ in >> magic;
+ if ( magic == UibMagic ) {
+ w = widgetFactory->createFromUibFile( in, connector, parent, name );
+ } else {
+ in.unsetDevice();
+ dev->at( start );
+ if ( doc.setContent( dev, &errMsg, &errLine ) ) {
+ w = widgetFactory->createFromUiFile( doc, connector, parent, name );
+ } else {
+ // qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine );
+ }
+ }
+ if ( !w ) {
+ delete widgetFactory;
+ return 0;
+ }
+ }
+
+ if ( !languageInterfaceManager )
+ languageInterfaceManager =
+ new QPluginManager<LanguageInterface>( IID_Language, QApplication::libraryPaths(), *qwf_plugin_dir );
+ widgetFactory->loadExtraSource();
+
+ if ( widgetFactory->toplevel ) {
+#ifndef QT_NO_SQL
+ QMap<QWidget*, SqlWidgetConnection>::Iterator cit = widgetFactory->sqlWidgetConnections.begin();
+ for( ; cit != widgetFactory->sqlWidgetConnections.end(); ++cit ) {
+ if ( widgetFactory->noDatabaseWidgets.find( cit.key()->name() ) !=
+ widgetFactory->noDatabaseWidgets.end() )
+ continue;
+ if ( cit.key()->inherits( "QDesignerDataBrowser2" ) )
+ ( (QDesignerDataBrowser2*)cit.key() )->initPreview( (*cit).conn, (*cit).table,
+ cit.key(), *(*cit).dbControls );
+ else if ( cit.key()->inherits( "QDesignerDataView2" ) )
+ ( (QDesignerDataView2*)cit.key() )->initPreview( (*cit).conn, (*cit).table,
+ cit.key(), *(*cit).dbControls );
+ }
+
+ for ( QMap<QString, QStringList>::Iterator it = widgetFactory->dbTables.begin();
+ it != widgetFactory->dbTables.end(); ++it ) {
+ QDataTable *table = (QDataTable*)widgetFactory->toplevel->child( it.key(), "QDataTable" );
+ if ( !table )
+ continue;
+ if ( widgetFactory->noDatabaseWidgets.find( table->name() ) !=
+ widgetFactory->noDatabaseWidgets.end() )
+ continue;
+ QValueList<Field> fieldMap = *widgetFactory->fieldMaps.find( table );
+ QString conn = (*it)[ 0 ];
+ QSqlCursor* c = 0;
+ QSqlDatabase *db = 0;
+ if ( conn.isEmpty() || conn == "(default)" ) {
+ db = QSqlDatabase::database();
+ c = new QSqlCursor( (*it)[ 1 ] );
+ } else {
+ db = QSqlDatabase::database( conn );
+ c = new QSqlCursor( (*it)[ 1 ], TRUE, db );
+ }
+ if ( db ) {
+ table->setSqlCursor( c, fieldMap.isEmpty(), TRUE );
+ table->refresh( QDataTable::RefreshAll );
+ }
+ }
+#endif
+ }
+
+ for ( QMap<QString, QString>::Iterator it = widgetFactory->buddies.begin();
+ it != widgetFactory->buddies.end(); ++it ) {
+ QLabel *label = (QLabel*)widgetFactory->toplevel->child( it.key(), "QLabel" );
+ QWidget *buddy = (QWidget*)widgetFactory->toplevel->child( *it, "QWidget" );
+ if ( label && buddy )
+ label->setBuddy( buddy );
+ }
+
+ delete widgetFactory;
+
+ QApplication::sendPostedEvents();
+
+ return w;
+}
+
+QWidget *QWidgetFactory::createFromUiFile( QDomDocument doc, QObject *connector,
+ QWidget *parent, const char *name )
+{
+ DomTool::fixDocument( doc );
+
+ uiFileVersion = doc.firstChild().toElement().attribute("version");
+ QDomElement e = doc.firstChild().toElement().firstChild().toElement();
+
+ QDomElement variables = e;
+ while ( variables.tagName() != "variables" && !variables.isNull() )
+ variables = variables.nextSibling().toElement();
+
+ QDomElement slots = e;
+ while ( slots.tagName() != "slots" && !slots.isNull() )
+ slots = slots.nextSibling().toElement();
+
+ QDomElement connections = e;
+ while ( connections.tagName() != "connections" && !connections.isNull() )
+ connections = connections.nextSibling().toElement();
+
+ QDomElement imageCollection = e;
+ while ( imageCollection.tagName() != "images" && !imageCollection.isNull() )
+ imageCollection = imageCollection.nextSibling().toElement();
+
+ QDomElement tabOrder = e;
+ while ( tabOrder.tagName() != "tabstops" && !tabOrder.isNull() )
+ tabOrder = tabOrder.nextSibling().toElement();
+
+ QDomElement actions = e;
+ while ( actions.tagName() != "actions" && !actions.isNull() )
+ actions = actions.nextSibling().toElement();
+
+ QDomElement toolbars = e;
+ while ( toolbars.tagName() != "toolbars" && !toolbars.isNull() )
+ toolbars = toolbars.nextSibling().toElement();
+
+ QDomElement menubar = e;
+ while ( menubar.tagName() != "menubar" && !menubar.isNull() )
+ menubar = menubar.nextSibling().toElement();
+
+ QDomElement functions = e;
+ while ( functions.tagName() != "functions" && !functions.isNull() )
+ functions = functions.nextSibling().toElement();
+
+ QDomElement widget;
+ while ( !e.isNull() ) {
+ if ( e.tagName() == "class" ) {
+ d->translationContext = e.firstChild().toText().data();
+ } else if ( e.tagName() == "widget" ) {
+ widget = e;
+ } else if ( e.tagName() == "pixmapinproject" ) {
+ usePixmapCollection = TRUE;
+ } else if ( e.tagName() == "layoutdefaults" ) {
+ defSpacing = e.attribute( "spacing", QString::number( defSpacing ) ).toInt();
+ defMargin = e.attribute( "margin", QString::number( defMargin ) ).toInt();
+ }
+ e = e.nextSibling().toElement();
+ }
+
+ if ( !imageCollection.isNull() )
+ loadImageCollection( imageCollection );
+
+ createWidgetInternal( widget, parent, 0, widget.attribute("class", "QWidget") );
+ QWidget *w = toplevel;
+ if ( !w )
+ return 0;
+
+ if ( !actions.isNull() )
+ loadActions( actions );
+ if ( !toolbars.isNull() )
+ loadToolBars( toolbars );
+ if ( !menubar.isNull() )
+ loadMenuBar( menubar );
+
+ if ( !connections.isNull() )
+ loadConnections( connections, connector );
+ if ( w && name && qstrlen( name ) > 0 )
+ w->setName( name );
+
+ if ( !tabOrder.isNull() )
+ loadTabOrder( tabOrder );
+
+#if 0
+ if ( !functions.isNull() ) // compatibiliy with early 3.0 betas
+ loadFunctions( functions );
+#endif
+
+ return w;
+}
+
+void QWidgetFactory::unpackUInt16( QDataStream& in, Q_UINT16& n )
+{
+ Q_UINT8 half;
+ in >> half;
+ if ( half == 255 ) {
+ in >> n;
+ } else {
+ n = half;
+ }
+}
+
+void QWidgetFactory::unpackUInt32( QDataStream& in, Q_UINT32& n )
+{
+ Q_UINT16 half;
+ in >> half;
+ if ( half == 65535 ) {
+ in >> n;
+ } else {
+ n = half;
+ }
+}
+
+void QWidgetFactory::unpackByteArray( QDataStream& in, QByteArray& array )
+{
+ Q_UINT32 size;
+ unpackUInt32( in, size );
+ array.resize( size );
+ in.readRawBytes( array.data(), size );
+}
+
+void QWidgetFactory::unpackCString( const UibStrTable& strings, QDataStream& in,
+ QCString& cstr )
+{
+ Q_UINT32 n;
+ unpackUInt32( in, n );
+ cstr = strings.asCString( n );
+}
+
+void QWidgetFactory::unpackString( const UibStrTable& strings, QDataStream& in,
+ QString& str )
+{
+ Q_UINT32 n;
+ unpackUInt32( in, n );
+ str = strings.asString( n );
+}
+
+void QWidgetFactory::unpackStringSplit( const UibStrTable& strings,
+ QDataStream& in, QString& str )
+{
+ QString remainder;
+ unpackString( strings, in, str );
+ unpackString( strings, in, remainder );
+ str += remainder;
+}
+
+void QWidgetFactory::unpackVariant( const UibStrTable& strings, QDataStream& in,
+ QVariant& value )
+{
+ QString imageName;
+ Q_UINT32 number;
+ Q_UINT16 count;
+ Q_UINT16 x;
+ Q_UINT16 y;
+ Q_UINT16 width;
+ Q_UINT16 height;
+ Q_UINT8 bit;
+ Q_UINT8 type;
+
+ in >> type;
+
+ switch ( type ) {
+ case QVariant::String:
+ unpackString( strings, in, value.asString() );
+ break;
+ case QVariant::Pixmap:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asPixmap() = QPixmap();
+ } else {
+ value.asPixmap() = loadPixmap( imageName );
+ }
+ break;
+ case QVariant::Image:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asImage() = QImage();
+ } else {
+ value.asImage() = loadFromCollection( imageName );
+ }
+ break;
+ case QVariant::IconSet:
+ unpackString( strings, in, imageName );
+ if ( imageName.isEmpty() ) {
+ value.asIconSet() = QIconSet();
+ } else {
+ value.asIconSet() = QIconSet( loadPixmap(imageName) );
+ }
+ break;
+ case QVariant::StringList:
+ unpackUInt16( in, count );
+ while ( count-- ) {
+ QString str;
+ unpackString( strings, in, str );
+ value.asStringList().append( str );
+ }
+ break;
+ case QVariant::Rect:
+ unpackUInt16( in, x );
+ unpackUInt16( in, y );
+ unpackUInt16( in, width );
+ unpackUInt16( in, height );
+ value = QRect( x, y, width, height );
+ break;
+ case QVariant::Size:
+ unpackUInt16( in, width );
+ unpackUInt16( in, height );
+ value = QSize( width, height );
+ break;
+ case QVariant::Color:
+ in >> value.asColor();
+ break;
+ case QVariant::Point:
+ unpackUInt16( in, x );
+ unpackUInt16( in, y );
+ value = QPoint( x, y );
+ break;
+ case QVariant::Int:
+ unpackUInt32( in, number );
+ value = (int) number;
+ break;
+ case QVariant::Bool:
+ in >> bit;
+ value = QVariant( bit != 0, 0 );
+ break;
+ case QVariant::Double:
+ in >> value.asDouble();
+ break;
+ case QVariant::CString:
+ unpackCString( strings, in, value.asCString() );
+ break;
+ case QVariant::Cursor:
+ in >> value.asCursor();
+ break;
+ case QVariant::Date:
+ in >> value.asDate();
+ break;
+ case QVariant::Time:
+ in >> value.asTime();
+ break;
+ case QVariant::DateTime:
+ in >> value.asDateTime();
+ break;
+ default:
+ in >> value;
+ }
+}
+
+void QWidgetFactory::inputSpacer( const UibStrTable& strings, QDataStream& in,
+ QLayout *parent )
+{
+ QCString name;
+ QVariant value;
+ QCString comment;
+ QSizePolicy::SizeType sizeType = QSizePolicy::Preferred;
+ bool vertical = FALSE;
+ int w = 0;
+ int h = 0;
+ Q_UINT16 column = 0;
+ Q_UINT16 row = 0;
+ Q_UINT16 colspan = 1;
+ Q_UINT16 rowspan = 1;
+ Q_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_GridCell:
+ unpackUInt16( in, column );
+ unpackUInt16( in, row );
+ unpackUInt16( in, colspan );
+ unpackUInt16( in, rowspan );
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "orientation" ) {
+ vertical = ( value == "Vertical" );
+ } else if ( name == "sizeHint" ) {
+ w = value.toSize().width();
+ h = value.toSize().height();
+ } else if ( name == "sizeType" ) {
+ sizeType = stringToSizeType( value.toString() );
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( parent != 0 ) {
+ QSpacerItem *spacer;
+ if ( vertical ) {
+ spacer = new QSpacerItem( w, h, QSizePolicy::Minimum, sizeType );
+ } else {
+ spacer = new QSpacerItem( w, h, sizeType, QSizePolicy::Minimum );
+ }
+
+ if ( parent->inherits("QGridLayout") ) {
+ ((QGridLayout *) parent)->addMultiCell( spacer, row,
+ row + rowspan - 1, column, column + colspan - 1,
+ vertical ? Qt::AlignHCenter : Qt::AlignVCenter );
+ } else {
+ parent->addItem( spacer );
+ }
+ }
+}
+
+void QWidgetFactory::inputColumnOrRow( const UibStrTable& strings,
+ QDataStream& in, QObject *parent,
+ bool isRow )
+{
+ QString text;
+ QPixmap pixmap;
+ QString field;
+ bool clickable = TRUE;
+ bool resizable = TRUE;
+
+ QCString name;
+ QVariant value;
+ QCString comment;
+ QString str;
+ Q_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+ str = translate( value.asCString().data(), comment.data() );
+
+ if ( name == "field" ) {
+ field = str;
+ } else if ( name == "text" ) {
+ text = str;
+ }
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "clickable" ) {
+ clickable = value.toBool();
+ } else if ( name == "pixmap" ) {
+ pixmap = value.asPixmap();
+ } else if ( name == "resizable" ) {
+ resizable = value.toBool();
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( parent != 0 ) {
+ if ( parent->inherits("QListView") ) {
+ createListViewColumn( (QListView *) parent, text, pixmap, clickable,
+ resizable );
+#ifndef QT_NO_TABLE
+ } else if ( parent->inherits("QTable") ) {
+ createTableColumnOrRow( (QTable *) parent, text, pixmap, field,
+ isRow );
+#endif
+ }
+ }
+}
+
+void QWidgetFactory::inputItem( const UibStrTable& strings, QDataStream& in,
+ QObject *parent, QListViewItem *parentItem )
+{
+ QStringList texts;
+ QValueList<QPixmap> pixmaps;
+ QCString name;
+ QVariant value;
+ QCString comment;
+ Q_UINT8 objectTag;
+
+ QListView *listView = 0;
+ if ( parent != 0 && parent->inherits("QListView") )
+ parent = (QListView *) parent;
+ QListViewItem *item = 0;
+ if ( listView != 0 ) {
+ if ( parentItem == 0 ) {
+ item = new QListViewItem( listView, d->lastItem );
+ } else {
+ item = new QListViewItem( parentItem, d->lastItem );
+ }
+ d->lastItem = item;
+ }
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_Item:
+ if ( listView != 0 )
+ d->lastItem->setOpen( TRUE );
+ inputItem( strings, in, parent, item );
+ break;
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+
+ if ( name == "text" )
+ texts << translate( value.asCString().data(), comment.data() );
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( name == "pixmap" )
+ pixmaps << value.asPixmap();
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+
+ if ( listView != 0 ) {
+ int i = 0;
+ QStringList::ConstIterator t = texts.begin();
+ while ( t != texts.end() ) {
+ item->setText( i, *t );
+ ++i;
+ ++t;
+ }
+
+ int j = 0;
+ QValueList<QPixmap>::ConstIterator p = pixmaps.begin();
+ while ( p != pixmaps.end() ) {
+ item->setPixmap( j, *p );
+ ++j;
+ ++p;
+ }
+ } else {
+ QString text = texts.last();
+ QPixmap pixmap = pixmaps.last();
+
+ if ( parent != 0 ) {
+ if ( parent->inherits("QComboBox") ||
+ parent->inherits("QListBox") ) {
+ QListBox *listBox = (QListBox *) parent->qt_cast( "QListBox" );
+ if ( listBox == 0 )
+ listBox = ((QComboBox *) parent)->listBox();
+
+ if ( pixmap.isNull() ) {
+ (void) new QListBoxText( listBox, text );
+ } else {
+ (void) new QListBoxPixmap( listBox, pixmap, text );
+ }
+ #ifndef QT_NO_ICONVIEW
+ } else if ( parent->inherits("QIconView") ) {
+ (void) new QIconViewItem( (QIconView *) parent, text, pixmap );
+ #endif
+ }
+ }
+ }
+}
+
+void QWidgetFactory::inputMenuItem( QObject **objects,
+ const UibStrTable& strings, QDataStream& in,
+ QMenuBar *menuBar )
+{
+ QCString name;
+ QCString text;
+ Q_UINT16 actionNo;
+ Q_UINT8 objectTag;
+
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, text );
+
+ QPopupMenu *popupMenu = new QPopupMenu( menuBar->parentWidget(), name );
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_ActionRef:
+ unpackUInt16( in, actionNo );
+ ((QAction *) objects[actionNo])->addTo( popupMenu );
+ break;
+ case Object_Separator:
+ popupMenu->insertSeparator();
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ }
+ menuBar->insertItem( translate(text.data()), popupMenu );
+}
+
+QObject *QWidgetFactory::inputObject( QObject **objects, int& numObjects,
+ const UibStrTable& strings,
+ QDataStream& in, QWidget *ancestorWidget,
+ QObject *parent, QCString className )
+{
+ QObject *obj = 0;
+ QWidget *widget = 0;
+ QLayout *layout = 0;
+ QWidget *parentWidget = 0;
+ QLayout *parentLayout = 0;
+
+ bool isQObject = !className.isEmpty();
+ if ( isQObject ) {
+ if ( parent != 0 ) {
+ if ( parent->isWidgetType() ) {
+ if ( parent->inherits("QMainWindow") ) {
+ parentWidget = ((QMainWindow *) parent)->centralWidget();
+ } else {
+ parentWidget = (QWidget *) parent;
+ }
+ } else if ( parent->inherits("QLayout") ) {
+ parentLayout = (QLayout *) parent;
+ parentWidget = ancestorWidget;
+ }
+ }
+
+ if ( className == "QAction" ) {
+ unpackCString( strings, in, className );
+ if ( className == "QActionGroup" ) {
+ obj = new QActionGroup( parent );
+ } else {
+ obj = new QAction( parent );
+ }
+ } else if ( className == "QLayout" ) {
+ unpackCString( strings, in, className );
+ LayoutType type = Grid;
+ if ( className == "QHBoxLayout" ) {
+ type = HBox;
+ } else if ( className == "QVBoxLayout" ) {
+ type = VBox;
+ }
+ if ( parentLayout != 0 && parentLayout->inherits("QGridLayout") ) {
+ layout = createLayout( 0, 0, type );
+ } else {
+ layout = createLayout( parentWidget, parentLayout, type );
+ }
+ obj = layout;
+ } else if ( className == "QMenuBar" ) {
+ unpackCString( strings, in, className );
+ widget = ((QMainWindow *) parent)->menuBar();
+ obj = widget;
+ } else if ( className == "QToolBar" ) {
+ Q_UINT8 dock;
+ in >> dock;
+ unpackCString( strings, in, className );
+ widget = new QToolBar( QString::null, (QMainWindow *) parent,
+ (Qt::Dock) dock );
+ obj = widget;
+ } else if ( className == "QWidget" ) {
+ unpackCString( strings, in, className );
+ widget = createWidget( className, parentWidget, 0 );
+ obj = widget;
+ }
+
+ if ( widget != 0 )
+ ancestorWidget = widget;
+ d->lastItem = 0;
+ objects[numObjects++] = obj;
+ }
+
+ QCString name;
+ QVariant value;
+ QCString comment;
+ QString str;
+ Q_UINT16 actionNo;
+ int metAttribute = 0;
+ Q_UINT16 column = 0;
+ Q_UINT16 row = 0;
+ Q_UINT16 colspan = 1;
+ Q_UINT16 rowspan = 1;
+ Q_UINT8 paletteTag;
+ Q_UINT8 objectTag;
+
+ in >> objectTag;
+ while ( !in.atEnd() && objectTag != Object_End ) {
+ switch ( objectTag ) {
+ case Object_ActionRef:
+ unpackUInt16( in, actionNo );
+ ((QAction *) objects[actionNo])->addTo( (QToolBar *) widget );
+ break;
+ case Object_Attribute:
+ metAttribute = 2;
+ break;
+ case Object_Column:
+ inputColumnOrRow( strings, in, obj, FALSE );
+ break;
+ case Object_Event:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+ // ### do something with value.asStringList()
+ break;
+ case Object_FontProperty:
+ {
+ QFont font;
+ QString family;
+ Q_UINT16 pointSize;
+ Q_UINT8 fontFlags;
+
+ unpackCString( strings, in, name );
+ in >> fontFlags;
+
+ if ( fontFlags & Font_Family ) {
+ unpackString( strings, in, family );
+ font.setFamily( family );
+ }
+ if ( fontFlags & Font_PointSize ) {
+ unpackUInt16( in, pointSize );
+ font.setPointSize( pointSize );
+ }
+ if ( fontFlags & Font_Bold )
+ font.setBold( TRUE );
+ if ( fontFlags & Font_Italic )
+ font.setItalic( TRUE );
+ if ( fontFlags & Font_Underline )
+ font.setUnderline( TRUE );
+ if ( fontFlags & Font_StrikeOut )
+ font.setStrikeOut( TRUE );
+
+ if ( obj != 0 )
+ setProperty( obj, name, font );
+ }
+ break;
+ case Object_GridCell:
+ unpackUInt16( in, column );
+ unpackUInt16( in, row );
+ unpackUInt16( in, colspan );
+ unpackUInt16( in, rowspan );
+ break;
+ case Object_Item:
+ inputItem( strings, in, obj );
+ break;
+ case Object_MenuItem:
+ inputMenuItem( objects, strings, in, (QMenuBar *) widget );
+ break;
+ case Object_PaletteProperty:
+ {
+ QPalette palette;
+ QColorGroup colorGroup;
+ QColor color;
+ int role = -1;
+
+ unpackCString( strings, in, name );
+
+ in >> paletteTag;
+ while ( !in.atEnd() && paletteTag != Palette_End ) {
+ switch ( paletteTag ) {
+ case Palette_Active:
+ palette.setActive( colorGroup );
+ role = -1;
+ break;
+ case Palette_Inactive:
+ palette.setInactive( colorGroup );
+ role = -1;
+ break;
+ case Palette_Disabled:
+ palette.setDisabled( colorGroup );
+ role = -1;
+ break;
+ case Palette_Color:
+ role++;
+ in >> color;
+ colorGroup.setColor( (QColorGroup::ColorRole) role,
+ color );
+ break;
+ case Palette_Pixmap:
+ unpackVariant( strings, in, value );
+ colorGroup.setBrush( (QColorGroup::ColorRole) role,
+ QBrush(color, value.asPixmap()) );
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> paletteTag;
+ }
+ if ( obj != 0 )
+ setProperty( obj, name, palette );
+ }
+ break;
+ case Object_Row:
+ inputColumnOrRow( strings, in, obj, TRUE );
+ break;
+ case Object_Spacer:
+ inputSpacer( strings, in, layout );
+ break;
+ case Object_Separator:
+ ((QToolBar *) widget)->addSeparator();
+ break;
+ case Object_SubAction:
+ inputObject( objects, numObjects, strings, in, parentWidget,
+ obj != 0 ? obj : parent, "QAction" );
+ break;
+ case Object_SubLayout:
+ inputObject( objects, numObjects, strings, in, parentWidget, obj,
+ "QLayout" );
+ break;
+ case Object_SubWidget:
+ inputObject( objects, numObjects, strings, in, parentWidget, obj,
+ "QWidget" );
+ break;
+ case Object_TextProperty:
+ unpackCString( strings, in, name );
+ unpackCString( strings, in, value.asCString() );
+ unpackCString( strings, in, comment );
+ str = translate( value.asCString().data(), comment.data() );
+
+ if ( metAttribute > 0 ) {
+ if ( name == "title" ) {
+ if ( parent != 0 ) {
+ if ( parent->inherits("QTabWidget") ) {
+ ((QTabWidget *) parent)->insertTab( widget, str );
+ } else if ( parent->inherits("QWizard") ) {
+ ((QWizard *) parent)->addPage( widget, str );
+ }
+ }
+ }
+ } else {
+ if ( obj != 0 )
+ setProperty( obj, name, str );
+ }
+ break;
+ case Object_VariantProperty:
+ unpackCString( strings, in, name );
+ unpackVariant( strings, in, value );
+
+ if ( metAttribute > 0 ) {
+ if ( name == "id" ) {
+ if ( parent != 0 && parent->inherits("QWidgetStack") )
+ ((QWidgetStack *) parent)->addWidget( widget, value.toInt() );
+ }
+ } else {
+ if ( obj != 0 )
+ setProperty( obj, name, value );
+ }
+ break;
+ default:
+ qFatal( "Corrupt" );
+ }
+ in >> objectTag;
+ metAttribute--;
+ }
+
+ if ( parentLayout != 0 ) {
+ if ( widget != 0 ) {
+ if ( parentLayout->inherits("QGridLayout") ) {
+ ((QGridLayout *) parentLayout)->addMultiCellWidget(
+ widget, row, row + rowspan - 1, column,
+ column + colspan - 1 );
+ } else {
+ ((QBoxLayout *) parentLayout)->addWidget( widget );
+ }
+ } else if ( layout != 0 ) {
+ if ( parentLayout->inherits("QGridLayout") ) {
+ ((QGridLayout *) parentLayout)->addMultiCellLayout(
+ layout, row, row + rowspan - 1, column,
+ column + colspan - 1 );
+ }
+ }
+ }
+ return obj;
+}
+
+QWidget *QWidgetFactory::createFromUibFile( QDataStream& in,
+ QObject * /* connector */ , QWidget *parent, const char *name )
+{
+#define END_OF_BLOCK() \
+ ( in.atEnd() || in.device()->at() >= nextBlock )
+
+ Q_UINT8 lf;
+ Q_UINT8 cr;
+ in >> lf;
+ in >> cr;
+ if ( lf != '\n' || cr != '\r' ) {
+ qWarning( "File corrupted" );
+ return 0;
+ }
+
+ Q_UINT8 qdatastreamVersion;
+ in >> qdatastreamVersion;
+ if ( (int) qdatastreamVersion > in.version() ) {
+ qWarning( "Incompatible version of Qt" );
+ return 0;
+ }
+ in.setVersion( qdatastreamVersion );
+
+ UibStrTable strings;
+ QObject **objects = 0;
+ int numObjects = 0;
+
+ Q_UINT8 blockType;
+ Q_UINT32 blockSize;
+
+ in >> blockType;
+ while ( !in.atEnd() && blockType != Block_End ) {
+ unpackUInt32( in, blockSize );
+ QIODevice::Offset nextBlock = in.device()->at() + blockSize;
+
+ switch ( blockType ) {
+ case Block_Actions:
+ inputObject( objects, numObjects, strings, in, toplevel, toplevel );
+ break;
+ case Block_Buddies:
+ {
+ Q_UINT16 labelNo;
+ Q_UINT16 buddyNo;
+
+ do {
+ unpackUInt16( in, labelNo );
+ unpackUInt16( in, buddyNo );
+ QLabel *label =
+ (QLabel *) objects[labelNo]->qt_cast( "QLabel" );
+ if ( label != 0 )
+ label->setBuddy( (QWidget *) objects[buddyNo] );
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Connections:
+ {
+ QString language = "C++";
+ Q_UINT16 senderNo = 0;
+ QString signal = "clicked()";
+ Q_UINT16 receiverNo = 0;
+ QString slot = "accept()";
+ Q_UINT8 connectionFlags;
+
+ do {
+ in >> connectionFlags;
+ if ( connectionFlags & Connection_Language )
+ unpackString( strings, in, language );
+ if ( connectionFlags & Connection_Sender )
+ unpackUInt16( in, senderNo );
+ if ( connectionFlags & Connection_Signal )
+ unpackStringSplit( strings, in, signal );
+ if ( connectionFlags & Connection_Receiver )
+ unpackUInt16( in, receiverNo );
+ if ( connectionFlags & Connection_Slot )
+ unpackStringSplit( strings, in, slot );
+ // ###
+#if 0
+ qWarning( "connect( %p, %s, %p, %s )", objects[senderNo],
+ signal.latin1(), objects[receiverNo],
+ slot.latin1() );
+#endif
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Functions:
+ // ###
+ qWarning( "Block_Functions not supported" );
+ in.device()->at( nextBlock );
+ break;
+ case Block_Images:
+ {
+ QString format;
+ Q_UINT32 length;
+ QByteArray data;
+ Image image;
+
+ do {
+ unpackString( strings, in, image.name );
+ unpackString( strings, in, format );
+ unpackUInt32( in, length );
+ unpackByteArray( in, data );
+ image.img = loadImageData( format, length, data );
+ images += image;
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Intro:
+ {
+ Q_INT16 defaultMargin;
+ Q_INT16 defaultSpacing;
+ Q_UINT16 maxObjects;
+ Q_UINT8 introFlags;
+
+ in >> introFlags;
+ in >> defaultMargin;
+ in >> defaultSpacing;
+ unpackUInt16( in, maxObjects );
+ unpackCString( strings, in, d->translationContext );
+
+ if ( introFlags & Intro_Pixmapinproject )
+ usePixmapCollection = TRUE;
+ if ( defaultMargin != -32768 )
+ defMargin = defaultMargin;
+ if ( defaultSpacing != -32768 )
+ defSpacing = defaultSpacing;
+ objects = new QObject *[maxObjects];
+ }
+ break;
+ case Block_Menubar:
+ inputObject( objects, numObjects, strings, in, toplevel, toplevel,
+ "QMenuBar" );
+ break;
+ case Block_Slots:
+ {
+ QString language;
+ QString slot;
+
+ do {
+ unpackString( strings, in, language );
+ unpackStringSplit( strings, in, slot );
+ } while ( !END_OF_BLOCK() );
+ }
+ break;
+ case Block_Strings:
+ strings.readBlock( in, blockSize );
+ break;
+ case Block_Tabstops:
+ {
+ Q_UINT16 beforeNo;
+ Q_UINT16 afterNo;
+
+ unpackUInt16( in, beforeNo );
+ while ( !END_OF_BLOCK() ) {
+ unpackUInt16( in, afterNo );
+ toplevel->setTabOrder( (QWidget *) objects[beforeNo],
+ (QWidget *) objects[afterNo] );
+ beforeNo = afterNo;
+ }
+ }
+ break;
+ case Block_Toolbars:
+ do {
+ inputObject( objects, numObjects, strings, in, toplevel,
+ toplevel, "QToolBar" );
+ } while ( !END_OF_BLOCK() );
+ break;
+ case Block_Variables:
+ // ###
+ qWarning( "Block_Variables not supported" );
+ in.device()->at( nextBlock );
+ break;
+ case Block_Widget:
+ toplevel = (QWidget *)
+ inputObject( objects, numObjects, strings, in, toplevel, parent,
+ "QWidget" );
+ if ( toplevel != 0 )
+ toplevel->setName( name );
+ break;
+ default:
+ qWarning( "Version error" );
+ return 0;
+ }
+ in >> blockType;
+ }
+ delete[] objects;
+ return toplevel;
+}
+
+/*! Installs a widget factory \a factory, which normally contains
+ additional widgets that can then be created using a QWidgetFactory.
+ See createWidget() for further details.
+*/
+
+void QWidgetFactory::addWidgetFactory( QWidgetFactory *factory )
+{
+ widgetFactories.append( factory );
+}
+
+/*!
+ Creates a widget of the type \a className passing \a parent and \a
+ name to its constructor.
+
+ If \a className is a widget in the Qt library, it is directly
+ created by this function. If the widget isn't in the Qt library,
+ each of the installed widget plugins is asked, in turn, to create
+ the widget. As soon as a plugin says it can create the widget it
+ is asked to do so. It may occur that none of the plugins can
+ create the widget, in which case each installed widget factory is
+ asked to create the widget (see addWidgetFactory()). If the widget
+ cannot be created by any of these means, 0 is returned.
+
+ If you have a custom widget, and want it to be created using the
+ widget factory, there are two approaches you can use:
+
+ \list 1
+
+ \i Write a widget plugin. This allows you to use the widget in
+ \e{Qt Designer} and in this QWidgetFactory. See the widget plugin
+ documentation for further details. (See the "Creating Custom
+ Widgets with Plugins" section of the \link designer-manual.book Qt
+ Designer manual\endlink for an example.
+
+ \i Subclass QWidgetFactory. Then reimplement this function to
+ create and return an instance of your custom widget if \a
+ className equals the name of your widget, otherwise return 0. Then
+ at the beginning of your program where you want to use the widget
+ factory to create widgets do a:
+ \code
+ QWidgetFactory::addWidgetFactory( new MyWidgetFactory );
+ \endcode
+ where MyWidgetFactory is your QWidgetFactory subclass.
+
+ \endlist
+*/
+
+QWidget *QWidgetFactory::createWidget( const QString &className, QWidget *parent,
+ const char *name ) const
+{
+ // create widgets we know
+ if ( className == "QPushButton" ) {
+ return new QPushButton( parent, name );
+ } else if ( className == "QToolButton" ) {
+ return new QToolButton( parent, name );
+ } else if ( className == "QCheckBox" ) {
+ return new QCheckBox( parent, name );
+ } else if ( className == "QRadioButton" ) {
+ return new QRadioButton( parent, name );
+ } else if ( className == "QGroupBox" ) {
+ return new QGroupBox( parent, name );
+ } else if ( className == "QButtonGroup" ) {
+ return new QButtonGroup( parent, name );
+ } else if ( className == "QIconView" ) {
+#if !defined(QT_NO_ICONVIEW)
+ return new QIconView( parent, name );
+#endif
+ } else if ( className == "QTable" ) {
+#if !defined(QT_NO_TABLE)
+ return new QTable( parent, name );
+#endif
+ } else if ( className == "QListBox" ) {
+ return new QListBox( parent, name );
+ } else if ( className == "QListView" ) {
+ return new QListView( parent, name );
+ } else if ( className == "QLineEdit" ) {
+ return new QLineEdit( parent, name );
+ } else if ( className == "QSpinBox" ) {
+ return new QSpinBox( parent, name );
+ } else if ( className == "QMultiLineEdit" ) {
+ return new QMultiLineEdit( parent, name );
+ } else if ( className == "QLabel" || className == "TextLabel" || className == "PixmapLabel" ) {
+ return new QLabel( parent, name );
+ } else if ( className == "QLayoutWidget" ) {
+ return new QWidget( parent, name );
+ } else if ( className == "QTabWidget" ) {
+ return new QTabWidget( parent, name );
+ } else if ( className == "QComboBox" ) {
+ return new QComboBox( FALSE, parent, name );
+ } else if ( className == "QWidget" ) {
+ if ( !qwf_stays_on_top )
+ return new QWidget( parent, name );
+ return new QWidget( parent, name, Qt::WStyle_StaysOnTop );
+ } else if ( className == "QDialog" ) {
+ if ( !qwf_stays_on_top )
+ return new QDialog( parent, name );
+ return new QDialog( parent, name, FALSE, Qt::WStyle_StaysOnTop );
+ } else if ( className == "QWizard" ) {
+ return new QWizard( parent, name );
+ } else if ( className == "QLCDNumber" ) {
+ return new QLCDNumber( parent, name );
+ } else if ( className == "QProgressBar" ) {
+ return new QProgressBar( parent, name );
+ } else if ( className == "QTextView" ) {
+ return new QTextView( parent, name );
+ } else if ( className == "QTextBrowser" ) {
+ return new QTextBrowser( parent, name );
+ } else if ( className == "QDial" ) {
+ return new QDial( parent, name );
+ } else if ( className == "QSlider" ) {
+ return new QSlider( parent, name );
+ } else if ( className == "QFrame" ) {
+ return new QFrame( parent, name );
+ } else if ( className == "QSplitter" ) {
+ return new QSplitter( parent, name );
+ } else if ( className == "Line" ) {
+ QFrame *f = new QFrame( parent, name );
+ f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ return f;
+ } else if ( className == "QTextEdit" ) {
+ return new QTextEdit( parent, name );
+ } else if ( className == "QDateEdit" ) {
+ return new QDateEdit( parent, name );
+ } else if ( className == "QTimeEdit" ) {
+ return new QTimeEdit( parent, name );
+ } else if ( className == "QDateTimeEdit" ) {
+ return new QDateTimeEdit( parent, name );
+ } else if ( className == "QScrollBar" ) {
+ return new QScrollBar( parent, name );
+ } else if ( className == "QPopupMenu" ) {
+ return new QPopupMenu( parent, name );
+ } else if ( className == "QWidgetStack" ) {
+ return new QWidgetStack( parent, name );
+ } else if ( className == "QToolBox" ) {
+ return new QToolBox( parent, name );
+ } else if ( className == "QVBox" ) {
+ return new QVBox( parent, name );
+ } else if ( className == "QHBox" ) {
+ return new QHBox( parent, name );
+ } else if ( className == "QGrid" ) {
+ return new QGrid( 4, parent, name );
+ } else if ( className == "QMainWindow" ) {
+ QMainWindow *mw = 0;
+ if ( !qwf_stays_on_top )
+ mw = new QMainWindow( parent, name );
+ else
+ mw = new QMainWindow( parent, name, Qt::WType_TopLevel | Qt::WStyle_StaysOnTop );
+ mw->setCentralWidget( new QWidget( mw, "qt_central_widget" ) );
+ mw->centralWidget()->show();
+ (void)mw->statusBar();
+ return mw;
+
+ }
+#if !defined(QT_NO_SQL)
+ else if ( className == "QDataTable" ) {
+ return new QDataTable( parent, name );
+ } else if ( className == "QDataBrowser" ) {
+ return new QDesignerDataBrowser2( parent, name );
+ } else if ( className == "QDataView" ) {
+ return new QDesignerDataView2( parent, name );
+ }
+#endif
+
+ setupPluginDir();
+ // try to create it using the loaded widget plugins
+ if ( !widgetInterfaceManager )
+ widgetInterfaceManager =
+ new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(),
+ *qwf_plugin_dir );
+
+ QInterfacePtr<WidgetInterface> iface = 0;
+ widgetInterfaceManager->queryInterface( className, &iface );
+ if ( iface ) {
+ QWidget *w = iface->create( className, parent, name );
+ if ( w ) {
+ d->customWidgets.replace( className.latin1(), new bool(TRUE) );
+ return w;
+ }
+ }
+
+ // hope we have a factory which can do it
+ for ( QWidgetFactory* f = widgetFactories.first(); f; f = widgetFactories.next() ) {
+ QWidget *w = f->createWidget( className, parent, name );
+ if ( w )
+ return w;
+ }
+
+ // no success
+ return 0;
+}
+
+/*! Returns the names of the widgets, which this facory can create. */
+
+QStringList QWidgetFactory::widgets()
+{
+ setupWidgetListAndMap();
+ return *availableWidgetList;
+}
+
+/*! Returns whether this widget factory can create the widget \a
+ widget */
+
+bool QWidgetFactory::supportsWidget( const QString &widget )
+{
+ setupWidgetListAndMap();
+ return ( availableWidgetMap->find( widget ) != availableWidgetMap->end() );
+}
+
+QWidget *QWidgetFactory::createWidgetInternal( const QDomElement &e, QWidget *parent,
+ QLayout* layout, const QString &classNameArg )
+{
+ d->lastItem = 0;
+ QDomElement n = e.firstChild().toElement();
+ QWidget *w = 0; // the widget that got created
+ QObject *obj = 0; // gets the properties
+
+ QString className = classNameArg;
+
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+
+ bool isQLayoutWidget = FALSE;
+
+ if ( !className.isEmpty() ) {
+ if ( !layout && className == "QLayoutWidget" ) {
+ className = "QWidget";
+ isQLayoutWidget = TRUE;
+ }
+ if ( layout && className == "QLayoutWidget" ) {
+ // hide layout widgets
+ w = parent;
+ } else {
+ obj = QWidgetFactory::createWidget( className, parent, 0 );
+ if ( !obj )
+ return 0;
+ w = (QWidget*)obj;
+ if ( !toplevel )
+ toplevel = w;
+ if ( w->inherits( "QMainWindow" ) )
+ w = ( (QMainWindow*)w )->centralWidget();
+ if ( layout ) {
+ switch( layoutType( layout ) ) {
+ case HBox:
+ ( (QHBoxLayout*)layout )->addWidget( w );
+ break;
+ case VBox:
+ ( (QVBoxLayout*)layout )->addWidget( w );
+ break;
+ case Grid:
+ ( (QGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1,
+ col, col + colspan - 1 );
+ break;
+ default:
+ break;
+ }
+ }
+
+ layout = 0;
+ }
+ }
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ QString parentClassName = parent ? parent->className() : 0;
+ bool isPlugin = parent ? !!d->customWidgets.find( parent->className() ) : FALSE;
+ if ( isPlugin )
+ qWarning( "####### loading custom container widgets without page support not implemented!" );
+ // ### TODO loading for custom container widgets without pages
+#endif
+
+ int idx = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "spacer" ) {
+ createSpacer( n, layout );
+ } else if ( n.tagName() == "widget" ) {
+ QMap< QString, QString> *oldDbControls = dbControls;
+ createWidgetInternal( n, w, layout, n.attribute( "class", "QWidget" ) );
+ dbControls = oldDbControls;
+ } else if ( n.tagName() == "hbox" ) {
+ QLayout *parentLayout = layout;
+ if ( layout && layout->inherits( "QGridLayout" ) )
+ layout = createLayout( 0, 0, QWidgetFactory::HBox, isQLayoutWidget );
+ else
+ layout = createLayout( w, layout, QWidgetFactory::HBox, isQLayoutWidget );
+ obj = layout;
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "QGridLayout" ) )
+ ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "grid" ) {
+ QLayout *parentLayout = layout;
+ if ( layout && layout->inherits( "QGridLayout" ) )
+ layout = createLayout( 0, 0, QWidgetFactory::Grid, isQLayoutWidget );
+ else
+ layout = createLayout( w, layout, QWidgetFactory::Grid, isQLayoutWidget );
+ obj = layout;
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "QGridLayout" ) )
+ ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "vbox" ) {
+ QLayout *parentLayout = layout;
+ if ( layout && layout->inherits( "QGridLayout" ) )
+ layout = createLayout( 0, 0, QWidgetFactory::VBox, isQLayoutWidget );
+ else
+ layout = createLayout( w, layout, QWidgetFactory::VBox, isQLayoutWidget );
+ obj = layout;
+ n = n.firstChild().toElement();
+ if ( parentLayout && parentLayout->inherits( "QGridLayout" ) )
+ ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
+ row + rowspan - 1, col, col + colspan - 1 );
+ continue;
+ } else if ( n.tagName() == "property" && obj ) {
+ setProperty( obj, n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "attribute" && w ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( parent ) {
+ if ( parent->inherits( "QTabWidget" ) ) {
+ if ( attrib == "title" )
+ ( (QTabWidget*)parent )->insertTab( w, translate( v.toString() ) );
+ } else if ( parent->inherits( "QWidgetStack" ) ) {
+ if ( attrib == "id" )
+ ( (QWidgetStack*)parent )->addWidget( w, v.toInt() );
+ } else if ( parent->inherits( "QToolBox" ) ) {
+ if ( attrib == "label" )
+ ( (QToolBox*)parent )->addItem( w, v.toString() );
+ } else if ( parent->inherits( "QWizard" ) ) {
+ if ( attrib == "title" )
+ ( (QWizard*)parent )->addPage( w, translate( v.toString() ) );
+#ifdef QT_CONTAINER_CUSTOM_WIDGETS
+ } else if ( isPlugin ) {
+ if ( attrib == "label" ) {
+ WidgetInterface *iface = 0;
+ widgetInterfaceManager->queryInterface( parentClassName, &iface );
+ if ( iface ) {
+ QWidgetContainerInterfacePrivate *iface2 = 0;
+ iface->queryInterface( IID_QWidgetContainer,
+ (QUnknownInterface**)&iface2 );
+ if ( iface2 ) {
+ iface2->insertPage( parentClassName,
+ (QWidget*)parent, translate( v.toString() ), -1, w );
+ iface2->release();
+ }
+ iface->release();
+ }
+ }
+#endif
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ createItem( n, w );
+ } else if ( n.tagName() == "column" || n.tagName() == "row" ) {
+ createColumn( n, w );
+ }
+
+ n = n.nextSibling().toElement();
+ idx++;
+ }
+
+ return w;
+}
+
+QLayout *QWidgetFactory::createLayout( QWidget *widget, QLayout* layout,
+ LayoutType type, bool isQLayoutWidget )
+{
+ int spacing = defSpacing;
+ int margin = defMargin;
+
+ if ( layout || !widget || isQLayoutWidget )
+ margin = 0;
+
+ if ( !layout && widget && widget->inherits( "QTabWidget" ) )
+ widget = ((QTabWidget*)widget)->currentPage();
+
+ if ( !layout && widget && widget->inherits( "QWizard" ) )
+ widget = ((QWizard*)widget)->currentPage();
+
+ if ( !layout && widget && widget->inherits( "QWidgetStack" ) )
+ widget = ((QWidgetStack*)widget)->visibleWidget();
+
+ if ( !layout && widget && widget->inherits( "QToolBox" ) )
+ widget = ((QToolBox*)widget)->currentItem();
+
+ QLayout *l = 0;
+ int align = 0;
+ if ( !layout && widget && widget->inherits( "QGroupBox" ) ) {
+ QGroupBox *gb = (QGroupBox*)widget;
+ gb->setColumnLayout( 0, Qt::Vertical );
+ layout = gb->layout();
+ layout->setMargin( 0 );
+ layout->setSpacing( 0 );
+ align = Qt::AlignTop;
+ }
+ if ( layout ) {
+ switch ( type ) {
+ case HBox:
+ l = new QHBoxLayout( layout );
+ break;
+ case VBox:
+ l = new QVBoxLayout( layout );
+ break;
+ case Grid:
+ l = new QGridLayout( layout );
+ break;
+ default:
+ return 0;
+ }
+ } else {
+ switch ( type ) {
+ case HBox:
+ l = new QHBoxLayout( widget );
+ break;
+ case VBox:
+ l = new QVBoxLayout( widget );
+ break;
+ case Grid:
+ l = new QGridLayout( widget );
+ break;
+ default:
+ return 0;
+ }
+ }
+ l->setAlignment( align );
+ l->setMargin( margin );
+ l->setSpacing( spacing );
+ return l;
+}
+
+QWidgetFactory::LayoutType QWidgetFactory::layoutType( QLayout *layout ) const
+{
+ if ( layout->inherits( "QHBoxLayout" ) )
+ return HBox;
+ else if ( layout->inherits( "QVBoxLayout" ) )
+ return VBox;
+ else if ( layout->inherits( "QGridLayout" ) )
+ return Grid;
+ return NoLayout;
+}
+
+void QWidgetFactory::setProperty( QObject* obj, const QString &prop,
+ QVariant value )
+{
+ int offset = obj->metaObject()->findProperty( prop, TRUE );
+
+ if ( offset != -1 ) {
+ if ( prop == "geometry" && obj == toplevel ) {
+ toplevel->resize( value.toRect().size() );
+ } else if ( prop == "accel" ) {
+ obj->setProperty( prop, value.toKeySequence() );
+ } else {
+ if ( value.type() == QVariant::String ||
+ value.type() == QVariant::CString ) {
+ const QMetaProperty *metaProp =
+ obj->metaObject()->property( offset, TRUE );
+ if ( metaProp != 0 && metaProp->isEnumType() ) {
+ if ( metaProp->isSetType() ) {
+ QStrList flagsCStr;
+ QStringList flagsStr =
+ QStringList::split( '|', value.asString() );
+ QStringList::ConstIterator f = flagsStr.begin();
+ while ( f != flagsStr.end() ) {
+ flagsCStr.append( *f );
+ ++f;
+ }
+ value = QVariant( metaProp->keysToValue(flagsCStr) );
+ } else {
+ QCString key = value.toCString();
+ value = QVariant( metaProp->keyToValue(key) );
+ }
+ }
+ }
+ obj->setProperty( prop, value );
+ }
+ } else {
+ if ( obj->isWidgetType() ) {
+ if ( prop == "toolTip" ) {
+ if ( !value.toString().isEmpty() )
+ QToolTip::add( (QWidget*)obj, translate( value.toString() ) );
+ } else if ( prop == "whatsThis" ) {
+ if ( !value.toString().isEmpty() )
+ QWhatsThis::add( (QWidget*)obj, translate( value.toString() ) );
+ } else if ( prop == "buddy" ) {
+ buddies.insert( obj->name(), value.toCString() );
+ } else if ( prop == "buttonGroupId" ) {
+ if ( obj->inherits( "QButton" ) && obj->parent()->inherits( "QButtonGroup" ) )
+ ( (QButtonGroup*)obj->parent() )->insert( (QButton*)obj, value.toInt() );
+#ifndef QT_NO_SQL
+ } else if ( prop == "database" && !obj->inherits( "QDataView" )
+ && !obj->inherits( "QDataBrowser" ) ) {
+ const QStringList& lst = value.asStringList();
+ if ( lst.count() > 2 ) {
+ if ( dbControls )
+ dbControls->insert( obj->name(), lst[ 2 ] );
+ } else if ( lst.count() == 2 ) {
+ dbTables.insert( obj->name(), lst );
+ }
+ } else if ( prop == "database" ) {
+ const QStringList& lst = value.asStringList();
+ if ( lst.count() == 2 && obj->inherits( "QWidget" ) ) {
+ SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
+ sqlWidgetConnections.insert( (QWidget*)obj, conn );
+ dbControls = conn.dbControls;
+ }
+#endif
+ } else if ( prop == "frameworkCode" ) {
+ if ( value.isValid() && !value.toBool() )
+ noDatabaseWidgets << obj->name();
+ }
+ }
+ }
+}
+
+void QWidgetFactory::setProperty( QObject* widget, const QString &prop, const QDomElement &e )
+{
+ QString comment;
+ QVariant value( DomTool::elementToVariant( e, QVariant(), comment ) );
+
+ if ( e.tagName() == "string" ) {
+ value = translate( value.asString(), comment );
+ } else if ( e.tagName() == "pixmap" ) {
+ QPixmap pix = loadPixmap( value.toString() );
+ if ( !pix.isNull() )
+ value = pix;
+ } else if ( e.tagName() == "iconset" ) {
+ QPixmap pix = loadPixmap( value.toString() );
+ if ( !pix.isNull() )
+ value = QIconSet( pix );
+ } else if ( e.tagName() == "image" ) {
+ value = loadFromCollection( value.toString() );
+ } else if ( e.tagName() == "palette" ) {
+ QDomElement n = e.firstChild().toElement();
+ QPalette p;
+ while ( !n.isNull() ) {
+ QColorGroup cg;
+ if ( n.tagName() == "active" ) {
+ cg = loadColorGroup( n );
+ p.setActive( cg );
+ } else if ( n.tagName() == "inactive" ) {
+ cg = loadColorGroup( n );
+ p.setInactive( cg );
+ } else if ( n.tagName() == "disabled" ) {
+ cg = loadColorGroup( n );
+ p.setDisabled( cg );
+ }
+ n = n.nextSibling().toElement();
+ }
+ value = p;
+ }
+ setProperty( widget, prop, value );
+}
+
+void QWidgetFactory::createSpacer( const QDomElement &e, QLayout *layout )
+{
+ QDomElement n = e.firstChild().toElement();
+ int row = e.attribute( "row" ).toInt();
+ int col = e.attribute( "column" ).toInt();
+ int rowspan = e.attribute( "rowspan" ).toInt();
+ int colspan = e.attribute( "colspan" ).toInt();
+
+ Qt::Orientation orient = Qt::Horizontal;
+ int w = 0, h = 0;
+ QSizePolicy::SizeType sizeType = QSizePolicy::Preferred;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString prop = n.attribute( "name" );
+ if ( prop == "orientation" ) {
+ if ( n.firstChild().firstChild().toText().data() == "Horizontal" )
+ orient = Qt::Horizontal;
+ else
+ orient = Qt::Vertical;
+ } else if ( prop == "sizeType" ) {
+ sizeType = stringToSizeType( n.firstChild().firstChild().toText().data() );
+ } else if ( prop == "sizeHint" ) {
+ w = n.firstChild().firstChild().firstChild().toText().data().toInt();
+ h = n.firstChild().firstChild().nextSibling().firstChild().toText().data().toInt();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+
+ if ( rowspan < 1 )
+ rowspan = 1;
+ if ( colspan < 1 )
+ colspan = 1;
+ QSpacerItem *item = new QSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : QSizePolicy::Minimum,
+ orient == Qt::Vertical ? sizeType : QSizePolicy::Minimum );
+ if ( layout ) {
+ if ( layout->inherits( "QBoxLayout" ) )
+ ( (QBoxLayout*)layout )->addItem( item );
+ else
+ ( (QGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
+ orient == Qt::Horizontal ? Qt::AlignVCenter : Qt::AlignHCenter );
+ }
+}
+
+static QImage loadImageData( QDomElement &n2 )
+{
+ QString format = n2.attribute( "format", "PNG" );
+ QString hex = n2.firstChild().toText().data();
+ int n = hex.length() / 2;
+ QByteArray data( n );
+ for ( int i = 0; i < n; i++ )
+ data[i] = (char) hex.mid( 2 * i, 2 ).toUInt( 0, 16 );
+ return loadImageData( format, n2.attribute("length").toULong(), data );
+}
+
+void QWidgetFactory::loadImageCollection( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "image" ) {
+ Image img;
+ img.name = n.attribute( "name" );
+ QDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "data" )
+ img.img = loadImageData( n2 );
+ n2 = n2.nextSibling().toElement();
+ }
+ images.append( img );
+ n = n.nextSibling().toElement();
+ }
+ }
+}
+
+QImage QWidgetFactory::loadFromCollection( const QString &name )
+{
+ QValueList<Image>::Iterator it = images.begin();
+ for ( ; it != images.end(); ++it ) {
+ if ( ( *it ).name == name )
+ return ( *it ).img;
+ }
+ return QImage();
+}
+
+QPixmap QWidgetFactory::loadPixmap( const QString& name )
+{
+ QPixmap pix;
+ if ( usePixmapCollection ) {
+ const QMimeSource *m = QMimeSourceFactory::defaultFactory()->data( name );
+ if ( m )
+ QImageDrag::decode( m, pix );
+ } else {
+ pix.convertFromImage( loadFromCollection(name) );
+ }
+ return pix;
+}
+
+QPixmap QWidgetFactory::loadPixmap( const QDomElement &e )
+{
+ return loadPixmap( e.firstChild().toText().data() );
+}
+
+QColorGroup QWidgetFactory::loadColorGroup( const QDomElement &e )
+{
+ QColorGroup cg;
+ int r = -1;
+ QDomElement n = e.firstChild().toElement();
+ QColor col;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "color" ) {
+ r++;
+ cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) );
+ } else if ( n.tagName() == "pixmap" ) {
+ QPixmap pix = loadPixmap( n );
+ cg.setBrush( (QColorGroup::ColorRole)r, QBrush( col, pix ) );
+ }
+ n = n.nextSibling().toElement();
+ }
+ return cg;
+}
+
+struct Connection
+{
+ QObject *sender, *receiver;
+ QCString signal, slot;
+ bool operator==( const Connection &c ) const {
+ return sender == c.sender && receiver == c.receiver &&
+ signal == c.signal && slot == c.slot ;
+ }
+
+ Connection() : sender( 0 ), receiver( 0 ) { }
+};
+
+class NormalizeObject : public QObject
+{
+public:
+ NormalizeObject() : QObject() {}
+ static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); }
+};
+
+void QWidgetFactory::loadConnections( const QDomElement &e, QObject *connector )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "connection" ) {
+ QString lang = n.attribute( "language", "C++" );
+ QDomElement n2 = n.firstChild().toElement();
+ Connection conn;
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "sender" ) {
+ QString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.sender = toplevel;
+ } else {
+ if ( name == "this" )
+ name = toplevel->name();
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.sender = l->first();
+ delete l;
+ }
+ }
+ if ( !conn.sender )
+ conn.sender = findAction( name );
+ } else if ( n2.tagName() == "signal" ) {
+ conn.signal = n2.firstChild().toText().data();
+ } else if ( n2.tagName() == "receiver" ) {
+ QString name = n2.firstChild().toText().data();
+ if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) {
+ conn.receiver = toplevel;
+ } else {
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() )
+ conn.receiver = l->first();
+ delete l;
+ }
+ }
+ } else if ( n2.tagName() == "slot" ) {
+ conn.slot = n2.firstChild().toText().data();
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+
+ conn.signal = NormalizeObject::normalizeSignalSlot( conn.signal );
+ conn.slot = NormalizeObject::normalizeSignalSlot( conn.slot );
+
+ if ( !conn.sender || !conn.receiver ) {
+ n = n.nextSibling().toElement();
+ continue;
+ }
+
+ QObject *sender = 0, *receiver = 0;
+ QObjectList *l = toplevel->queryList( 0, conn.sender->name(), FALSE );
+ if ( qstrcmp( conn.sender->name(), toplevel->name() ) == 0 ) {
+ sender = toplevel;
+ } else {
+ if ( !l || !l->first() ) {
+ delete l;
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ sender = l->first();
+ delete l;
+ }
+ if ( !sender )
+ sender = findAction( conn.sender->name() );
+
+ if ( qstrcmp( conn.receiver->name(), toplevel->name() ) == 0 ) {
+ receiver = toplevel;
+ } else {
+ l = toplevel->queryList( 0, conn.receiver->name(), FALSE );
+ if ( !l || !l->first() ) {
+ delete l;
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ receiver = l->first();
+ delete l;
+ }
+
+ QString s = "2""%1";
+ s = s.arg( conn.signal );
+ QString s2 = "1""%1";
+ s2 = s2.arg( conn.slot );
+
+ QStrList signalList = sender->metaObject()->signalNames( TRUE );
+ QStrList slotList = receiver->metaObject()->slotNames( TRUE );
+
+ // if this is a connection to a custom slot and we have a connector, try this as receiver
+ if ( slotList.find( conn.slot ) == -1 && receiver == toplevel && connector ) {
+ slotList = connector->metaObject()->slotNames( TRUE );
+ receiver = connector;
+ }
+
+ // avoid warnings
+ if ( signalList.find( conn.signal ) == -1 ||
+ slotList.find( conn.slot ) == -1 ) {
+ n = n.nextSibling().toElement();
+ continue;
+ }
+ QObject::connect( sender, s, receiver, s2 );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::loadTabOrder( const QDomElement &e )
+{
+ QWidget *last = 0;
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "tabstop" ) {
+ QString name = n.firstChild().toText().data();
+ QObjectList *l = toplevel->queryList( 0, name, FALSE );
+ if ( l ) {
+ if ( l->first() ) {
+ QWidget *w = (QWidget*)l->first();
+ if ( last )
+ toplevel->setTabOrder( last, w );
+ last = w;
+ }
+ delete l;
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::createListViewColumn( QListView *lv, const QString& txt,
+ const QPixmap& pix, bool clickable,
+ bool resizable )
+{
+ if ( pix.isNull() ) {
+ lv->addColumn( txt );
+ } else {
+ lv->addColumn( pix, txt );
+ }
+
+ int i = lv->header()->count() - 1;
+ if ( !pix.isNull() )
+ lv->header()->setLabel( i, pix, txt );
+ if ( !clickable )
+ lv->header()->setClickEnabled( clickable, i );
+ if ( !resizable )
+ lv->header()->setResizeEnabled( resizable, i );
+}
+
+#ifndef QT_NO_TABLE
+void QWidgetFactory::createTableColumnOrRow( QTable *table, const QString& txt,
+ const QPixmap& pix,
+ const QString& field, bool isRow )
+{
+#ifndef QT_NO_SQL
+ bool isSql = table->inherits( "QDataTable" );
+#endif
+ if ( isRow )
+ table->setNumRows( table->numRows() + 1 );
+ else {
+#ifndef QT_NO_SQL
+ if ( !isSql )
+#endif
+ table->setNumCols( table->numCols() + 1 );
+ }
+
+ QValueList<Field> fieldMap;
+ if ( fieldMaps.find( table ) != fieldMaps.end() ) {
+ fieldMap = *fieldMaps.find( table );
+ fieldMaps.remove( table );
+ }
+
+ int i = isRow ? table->numRows() - 1 : table->numCols() - 1;
+ QHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader();
+ if ( !pix.isNull() ) {
+#ifndef QT_NO_SQL
+ if ( isSql )
+ ((QDataTable*)table)->addColumn( field, txt, -1, pix );
+ else
+#endif
+ h->setLabel( i, pix, txt );
+ } else {
+#ifndef QT_NO_SQL
+ if ( isSql )
+ ((QDataTable*)table)->addColumn( field, txt );
+ else
+#endif
+ h->setLabel( i, txt );
+ }
+ if ( !isRow && !field.isEmpty() ) {
+ fieldMap.append( Field( txt, pix, field ) );
+ fieldMaps.insert( table, fieldMap );
+ }
+
+}
+#endif
+
+void QWidgetFactory::createColumn( const QDomElement &e, QWidget *widget )
+{
+ if ( widget->inherits( "QListView" ) && e.tagName() == "column" ) {
+ QListView *lv = (QListView*)widget;
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ QString txt;
+ bool clickable = TRUE, resizable = TRUE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" )
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ else if ( attrib == "clickable" )
+ clickable = v.toBool();
+ else if ( attrib == "resizable" || attrib == "resizeable" )
+ resizable = v.toBool();
+ }
+ n = n.nextSibling().toElement();
+ }
+ createListViewColumn( lv, txt, pix, clickable, resizable );
+ }
+#ifndef QT_NO_TABLE
+ else if ( widget->inherits( "QTable" ) ) {
+ QTable *table = (QTable*)widget;
+
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ QString txt;
+ QString field;
+
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ if ( !n.firstChild().firstChild().toText().data().isEmpty() )
+ pix = loadPixmap( n.firstChild().toElement().toElement() );
+ } else if ( attrib == "field" )
+ field = translate( v.toString() );
+ }
+ n = n.nextSibling().toElement();
+ }
+ createTableColumnOrRow( table, txt, pix, field, e.tagName() == "row" );
+ }
+#endif
+}
+
+void QWidgetFactory::loadItem( const QDomElement &e, QPixmap &pix, QString &txt, bool &hasPixmap )
+{
+ QDomElement n = e;
+ hasPixmap = FALSE;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ txt = translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ pix = loadPixmap( n.firstChild().toElement() );
+ hasPixmap = !pix.isNull();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::createItem( const QDomElement &e, QWidget *widget, QListViewItem *i )
+{
+ if ( widget->inherits( "QListBox" ) || widget->inherits( "QComboBox" ) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ loadItem( n, pix, txt, hasPixmap );
+ QListBox *lb = 0;
+ if ( widget->inherits( "QListBox" ) )
+ lb = (QListBox*)widget;
+ else
+ lb = ( (QComboBox*)widget)->listBox();
+ if ( hasPixmap ) {
+ new QListBoxPixmap( lb, pix, txt );
+ } else {
+ new QListBoxText( lb, txt );
+ }
+#ifndef QT_NO_ICONVIEW
+ } else if ( widget->inherits( "QIconView" ) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ bool hasPixmap = FALSE;
+ QString txt;
+ loadItem( n, pix, txt, hasPixmap );
+
+ QIconView *iv = (QIconView*)widget;
+ new QIconViewItem( iv, txt, pix );
+#endif
+ } else if ( widget->inherits( "QListView" ) ) {
+ QDomElement n = e.firstChild().toElement();
+ QPixmap pix;
+ QValueList<QPixmap> pixmaps;
+ QStringList textes;
+ QListViewItem *item = 0;
+ QListView *lv = (QListView*)widget;
+ if ( i )
+ item = new QListViewItem( i, d->lastItem );
+ else
+ item = new QListViewItem( lv, d->lastItem );
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "property" ) {
+ QString attrib = n.attribute( "name" );
+ QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() );
+ if ( attrib == "text" )
+ textes << translate( v.toString() );
+ else if ( attrib == "pixmap" ) {
+ QString s = v.toString();
+ if ( s.isEmpty() ) {
+ pixmaps << QPixmap();
+ } else {
+ pix = loadPixmap( n.firstChild().toElement() );
+ pixmaps << pix;
+ }
+ }
+ } else if ( n.tagName() == "item" ) {
+ item->setOpen( TRUE );
+ createItem( n, widget, item );
+ }
+
+ n = n.nextSibling().toElement();
+ }
+
+ for ( int i = 0; i < lv->columns(); ++i ) {
+ item->setText( i, textes[ i ] );
+ item->setPixmap( i, pixmaps[ i ] );
+ }
+ d->lastItem = item;
+ }
+}
+
+
+
+void QWidgetFactory::loadChildAction( QObject *parent, const QDomElement &e )
+{
+ QDomElement n = e;
+ QAction *a = 0;
+ bool hasMenuText = FALSE;
+ if ( n.tagName() == "action" ) {
+ a = new QAction( parent );
+ QDomElement n2 = n.firstChild().toElement();
+
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ QString prop(n2.attribute("name"));
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ setProperty( a, prop, n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !parent->inherits( "QAction" ) )
+ actionList.append( a );
+ } else if ( n.tagName() == "actiongroup" ) {
+ a = new QActionGroup( parent );
+ QDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "property" ) {
+ QString prop(n2.attribute("name"));
+ if (prop == "menuText")
+ hasMenuText = TRUE;
+ setProperty( a, prop, n2.firstChild().toElement() );
+ } else if ( n2.tagName() == "action" ||
+ n2.tagName() == "actiongroup" ) {
+ loadChildAction( a, n2 );
+
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ if ( !parent->inherits( "QAction" ) )
+ actionList.append( a );
+ }
+
+ if (a && !hasMenuText && !a->text().isEmpty() && uiFileVersion < "3.3")
+ a->setMenuText(a->text());
+}
+
+void QWidgetFactory::loadActions( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" ) {
+ loadChildAction( toplevel, n );
+ } else if ( n.tagName() == "actiongroup" ) {
+ loadChildAction( toplevel, n );
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::loadToolBars( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ QMainWindow *mw = ( (QMainWindow*)toplevel );
+ QToolBar *tb = 0;
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "toolbar" ) {
+ Qt::Dock dock = (Qt::Dock)n.attribute( "dock" ).toInt();
+ tb = new QToolBar( QString::null, mw, dock );
+ tb->setLabel( n.attribute( "label" ) );
+ tb->setName( n.attribute( "name" ) );
+ QDomElement n2 = n.firstChild().toElement();
+ while ( !n2.isNull() ) {
+ if ( n2.tagName() == "action" ) {
+ QAction *a = findAction( n2.attribute( "name" ) );
+ if ( a )
+ a->addTo( tb );
+ } else if ( n2.tagName() == "separator" ) {
+ tb->addSeparator();
+ } else if ( n2.tagName() == "widget" ) {
+ (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "QWidget" ) );
+ } else if ( n2.tagName() == "property" ) {
+ setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() );
+ }
+ n2 = n2.nextSibling().toElement();
+ }
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::loadMenuBar( const QDomElement &e )
+{
+ QDomElement n = e.firstChild().toElement();
+ QMainWindow *mw = ( (QMainWindow*)toplevel );
+ QMenuBar *mb = mw->menuBar();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "item" ) {
+ QPopupMenu *popup = new QPopupMenu( mw );
+ loadPopupMenu( popup, n );
+ popup->setName( n.attribute( "name" ) );
+ mb->insertItem( translate( n.attribute( "text" ) ), popup );
+ } else if ( n.tagName() == "property" ) {
+ setProperty( mb, n.attribute( "name" ), n.firstChild().toElement() );
+ } else if ( n.tagName() == "separator" ) {
+ mb->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+void QWidgetFactory::loadPopupMenu( QPopupMenu *p, const QDomElement &e )
+{
+ QMainWindow *mw = ( (QMainWindow*)toplevel );
+ QDomElement n = e.firstChild().toElement();
+ while ( !n.isNull() ) {
+ if ( n.tagName() == "action" ) {
+ QAction *a = findAction( n.attribute( "name" ) );
+ QDomElement n2 = n.nextSibling().toElement();
+ if ( n2.tagName() == "item") { // load submenu
+ QPopupMenu *popup = new QPopupMenu( mw );
+ popup->setName( n2.attribute( "name" ) );
+ if ( a ) {
+ p->setAccel( a->accel(), p->insertItem( a->iconSet(),
+ translate( n2.attribute( "text" ).utf8().data() ),
+ popup ) );
+ } else {
+ p->insertItem( translate( n2.attribute( "text" ).utf8().data() ), popup );
+ }
+ loadPopupMenu( popup, n2 );
+ n = n2;
+ } else {
+ if ( a ) {
+ a->addTo( p );
+ }
+ }
+ a = 0;
+ } else if ( n.tagName() == "separator" ) {
+ p->insertSeparator();
+ }
+ n = n.nextSibling().toElement();
+ }
+}
+
+// compatibility with early 3.0 betas
+// ### remove for 4.0
+void QWidgetFactory::loadFunctions( const QDomElement & )
+{
+}
+
+QAction *QWidgetFactory::findAction( const QString &name )
+{
+ for ( QAction *a = actionList.first(); a; a = actionList.next() ) {
+ if ( QString( a->name() ) == name )
+ return a;
+ QAction *ac = (QAction*)a->child( name.latin1(), "QAction" );
+ if ( ac )
+ return ac;
+ }
+ return 0;
+}
+
+/*!
+ If you use a pixmap collection (which is the default for new
+ projects) rather than saving the pixmaps within the .ui XML file,
+ you must load the pixmap collection. QWidgetFactory looks in the
+ default QMimeSourceFactory for the pixmaps. Either add it there
+ manually, or call this function and specify the directory where
+ the images can be found, as \a dir. This is normally the
+ directory called \c images in the project's directory.
+*/
+
+void QWidgetFactory::loadImages( const QString &dir )
+{
+ QDir d( dir );
+ QStringList l = d.entryList( QDir::Files );
+ for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it )
+ QMimeSourceFactory::defaultFactory()->setPixmap( *it, QPixmap( d.path() + "/" + *it, "PNG" ) );
+
+}
+
+void QWidgetFactory::loadExtraSource()
+{
+ if ( !qwf_language || !languageInterfaceManager )
+ return;
+ QString lang = *qwf_language;
+ LanguageInterface *iface = 0;
+ languageInterfaceManager->queryInterface( lang, &iface );
+ if ( !iface )
+ return;
+ QFile f( qwf_currFileName + iface->formCodeExtension() );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ code = ts.read();
+ }
+}
+
+QString QWidgetFactory::translate( const QString& sourceText, const QString& comment )
+{
+ return qApp->translate( d->translationContext, sourceText.utf8(), comment.utf8(),
+ QApplication::UnicodeUTF8 );
+}
+
+QString QWidgetFactory::translate( const char *sourceText, const char *comment )
+{
+ return qApp->translate( d->translationContext, sourceText, comment,
+ QApplication::UnicodeUTF8 );
+}
diff --git a/kdevdesigner/uilib/qwidgetfactory.h b/kdevdesigner/uilib/qwidgetfactory.h
new file mode 100644
index 00000000..9146e9a7
--- /dev/null
+++ b/kdevdesigner/uilib/qwidgetfactory.h
@@ -0,0 +1,180 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qt Designer.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
+** licenses may use this file in accordance with the Qt Commercial License
+** Agreement provided with the Software.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
+** information about Qt Commercial License Agreements.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef QWIDGETFACTORY_H
+#define QWIDGETFACTORY_H
+
+#ifndef QT_H
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+#include <qaction.h>
+#endif // QT_H
+
+class QDomDocument;
+class QDomElement;
+class QLayout;
+class QListView;
+class QListViewItem;
+class QMenuBar;
+class QTable;
+class QWidget;
+class QWidgetFactoryPrivate;
+class UibStrTable;
+
+class QWidgetFactory
+{
+public:
+ QWidgetFactory();
+ virtual ~QWidgetFactory();
+
+ static QWidget *create( const QString &uiFile, QObject *connector = 0, QWidget *parent = 0, const char *name = 0 );
+ static QWidget *create( QIODevice *dev, QObject *connector = 0, QWidget *parent = 0, const char *name = 0 );
+ static void addWidgetFactory( QWidgetFactory *factory );
+ static void loadImages( const QString &dir );
+
+ virtual QWidget *createWidget( const QString &className, QWidget *parent, const char *name ) const;
+ static QStringList widgets();
+ static bool supportsWidget( const QString &widget );
+
+private:
+ enum LayoutType { HBox, VBox, Grid, NoLayout };
+ void loadImageCollection( const QDomElement &e );
+ void loadConnections( const QDomElement &e, QObject *connector );
+ void loadTabOrder( const QDomElement &e );
+ QWidget *createWidgetInternal( const QDomElement &e, QWidget *parent, QLayout* layout, const QString &classNameArg );
+ QLayout *createLayout( QWidget *widget, QLayout* layout, LayoutType type, bool isQLayoutWidget = FALSE );
+ LayoutType layoutType( QLayout *l ) const;
+ void setProperty( QObject* widget, const QString &prop, QVariant value );
+ void setProperty( QObject* widget, const QString &prop, const QDomElement &e );
+ void createSpacer( const QDomElement &e, QLayout *layout );
+ QImage loadFromCollection( const QString &name );
+ QPixmap loadPixmap( const QString &name );
+ QPixmap loadPixmap( const QDomElement &e );
+ QColorGroup loadColorGroup( const QDomElement &e );
+ void createListViewColumn( QListView *lv, const QString& txt,
+ const QPixmap& pix, bool clickable,
+ bool resizable );
+#ifndef QT_NO_TABLE
+ void createTableColumnOrRow( QTable *table, const QString& txt,
+ const QPixmap& pix, const QString& field,
+ bool isRow );
+#endif
+ void createColumn( const QDomElement &e, QWidget *widget );
+ void loadItem( const QDomElement &e, QPixmap &pix, QString &txt, bool &hasPixmap );
+ void createItem( const QDomElement &e, QWidget *widget, QListViewItem *i = 0 );
+ void loadChildAction( QObject *parent, const QDomElement &e );
+ void loadActions( const QDomElement &e );
+ void loadToolBars( const QDomElement &e );
+ void loadMenuBar( const QDomElement &e );
+ void loadPopupMenu( QPopupMenu *p, const QDomElement &e );
+ void loadFunctions( const QDomElement &e );
+ QAction *findAction( const QString &name );
+ void loadExtraSource();
+ QString translate( const char *sourceText, const char *comment = "" );
+ QString translate( const QString& sourceText, const QString& comment = QString::null );
+
+ void unpackUInt16( QDataStream& in, Q_UINT16& n );
+ void unpackUInt32( QDataStream& in, Q_UINT32& n );
+ void unpackByteArray( QDataStream& in, QByteArray& array );
+ void unpackCString( const UibStrTable& strings, QDataStream& in,
+ QCString& cstr );
+ void unpackString( const UibStrTable& strings, QDataStream& in,
+ QString& str );
+ void unpackStringSplit( const UibStrTable& strings, QDataStream& in,
+ QString& str );
+ void unpackVariant( const UibStrTable& strings, QDataStream& in,
+ QVariant& value );
+ void inputSpacer( const UibStrTable& strings, QDataStream& in,
+ QLayout *parent );
+ void inputColumnOrRow( const UibStrTable& strings, QDataStream& in,
+ QObject *parent, bool isRow );
+ void inputItem( const UibStrTable& strings, QDataStream& in,
+ QObject *parent, QListViewItem *parentItem = 0 );
+ void inputMenuItem( QObject **objects, const UibStrTable& strings,
+ QDataStream& in, QMenuBar *menuBar );
+ QObject *inputObject( QObject **objects, int& numObjects,
+ const UibStrTable& strings, QDataStream& in,
+ QWidget *ancestorWidget, QObject *parent,
+ QCString className = "" );
+ QWidget *createFromUiFile( QDomDocument doc, QObject *connector,
+ QWidget *parent, const char *name );
+ QWidget *createFromUibFile( QDataStream& in, QObject *connector,
+ QWidget *parent, const char *name );
+
+private:
+ struct Image {
+ QImage img;
+ QString name;
+ bool operator==( const Image &i ) const {
+ return ( i.name == name &&
+ i.img == img );
+ }
+ };
+
+ struct Field
+ {
+ Field() {}
+ Field( const QString &s1, const QPixmap &p, const QString &s2 ) : name( s1 ), pix( p ), field( s2 ) {}
+ QString name;
+ QPixmap pix;
+ QString field;
+ Q_DUMMY_COMPARISON_OPERATOR( Field )
+ };
+
+ struct SqlWidgetConnection
+ {
+ SqlWidgetConnection() {}
+ SqlWidgetConnection( const QString &c, const QString &t )
+ : conn( c ), table( t ), dbControls( new QMap<QString, QString>() ) {}
+ QString conn;
+ QString table;
+ QMap<QString, QString> *dbControls;
+ Q_DUMMY_COMPARISON_OPERATOR( SqlWidgetConnection )
+ };
+
+ QValueList<Image> images;
+ QWidget *toplevel;
+ QWidgetFactoryPrivate *d;
+ QMap<QString, QString> *dbControls;
+ QMap<QString, QStringList> dbTables;
+ QMap<QWidget*, SqlWidgetConnection> sqlWidgetConnections;
+ QMap<QString, QString> buddies;
+ QMap<QTable*, QValueList<Field> > fieldMaps;
+ QPtrList<QAction> actionList;
+ QMap<QString, QString> languageSlots;
+ QStringList noDatabaseWidgets;
+ bool usePixmapCollection;
+ int defMargin;
+ int defSpacing;
+ QString code;
+ QString uiFileVersion;
+};
+
+#endif
diff --git a/kdevelop.desktop b/kdevelop.desktop
new file mode 100644
index 00000000..8a8435c2
--- /dev/null
+++ b/kdevelop.desktop
@@ -0,0 +1,52 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevelop %u
+MimeType=application/x-kdevelop;
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop: Multilanguage
+Name[br]=KDevelop : meur a yezh
+Name[ca]=KDevelop: Multi llenguatge
+Name[da]=KDevelop: Mange sprog
+Name[de]=KDevelop: Mehrsprachenunterstützung
+Name[el]=KDevelop: πολλές γλώσσες
+Name[es]=KDevelop: multilenguaje
+Name[et]=KDevelop: mitmekeelne arendus
+Name[eu]=KDevelop: Hizkuntza anitz
+Name[fa]=KDevelop: چند زبانه
+Name[fr]=KDevelop : multi-langage
+Name[ga]=KDevelop: Ilteangach
+Name[gl]=KDevelop: Multilinguaxe
+Name[hu]=KDevelop: nyelvtámogatás
+Name[it]=KDevelop: multilinguaggio
+Name[ja]=KDevelop: 多言語
+Name[ms]=KDevelop: Pelbagai bahasa
+Name[nds]=KDevelop - Verscheden Spraken
+Name[ne]=केडीई विकास: बहुभाषा
+Name[nl]=KDevelop: meertalig
+Name[pl]=KDevelop: wielojęzyczność
+Name[pt]=KDevelop: Múltiplas Linguagens
+Name[pt_BR]=KDevelop: Multi-Linguagem
+Name[ru]=KDevelop: Разработка на нескольких языках
+Name[sk]=KDevelop: viac jazykov
+Name[sl]=KDevelop: Večjezičnost
+Name[sr]=KDevelop: Вишејезички
+Name[sr@Latn]=KDevelop: Višejezički
+Name[sv]=KDevelop: Flera språk
+Name[tr]=KDevelop: Çokludil
+Name[zh_CN]=KDevelop:多语言
+Name[zh_TW]=KDevelop:多重語言
+GenericName=IDE
+GenericName[da]=Integreret udviklingsmiljø
+GenericName[fr]=EDI
+GenericName[hu]=Fejlesztőkörnyezet
+GenericName[nds]=Programmsmeed
+GenericName[ne]=आईडी ई
+GenericName[ru]=Интегрированная среда разработки
+GenericName[sv]=Utvecklingsmiljö
+GenericName[tr]=Bütünleşik Geliştirme Ortamı
+GenericName[zh_TW]=整合開發環境
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;IDE;X-KDE-KDevelopIDE;
+
diff --git a/kdevelop.lsm b/kdevelop.lsm
new file mode 100644
index 00000000..fedd4ec5
--- /dev/null
+++ b/kdevelop.lsm
@@ -0,0 +1,11 @@
+Begin4
+Title: kdevelop
+Version: 3.5.4
+Entered-date: 2008-12-18
+Description: Integrated Development Environment for KDE
+Keywords: KDE X11 desktop Qt
+Author: http://bugs.kde.org/ (KDE Bugtracking System)
+Primary-site: http://www.kdevelop.org/index.html?filename=download.html
+Platforms: Unix, Qt
+Copying-policy: GPL, Artistic
+End
diff --git a/kdevelop.m4.in b/kdevelop.m4.in
new file mode 100644
index 00000000..90e88204
--- /dev/null
+++ b/kdevelop.m4.in
@@ -0,0 +1,501 @@
+dnl
+dnl Check location of Qt documentation
+dnl
+AC_DEFUN([KDEV_PATH_QTDOC],
+[
+AC_MSG_CHECKING([for Qt documentation])
+
+ac_qt_docdirs=""
+AC_ARG_WITH(qtdoc_dir,
+[ --with-qtdoc-dir=DIR where the Qt documentation is installed ],
+ac_qt_docdirs=""
+qt_docdirs=""
+[
+ ac_qt_docdirs=$withval
+],
+)
+
+dnl
+dnl not currently used
+dnl
+qt_docdirs="/usr/doc/qt-doc/html /usr/local/qt/html /usr/local/lib/qt/html /usr/lib/qt/doc/html /usr/X11/lib/qt/html /usr/X11/lib/qt/doc/html /usr/X11R6/share/doc/qt/html /usr/share/doc/packages/qt/html"
+test -n "$QTDIR" && qt_docdirs="$QTDIR/html $QTDIR/doc/html $QTDIR/doc $qt_docdirs"
+qt_docdirs="$ac_qt_docdirs $qt_docdirs"
+AC_FIND_FILE(classes.html, $qt_docdirs, qt_docdir)
+AC_MSG_RESULT($qt_docdir)
+if test "$qt_docdir" = NO; then
+ qt_docdir=""
+fi
+AC_DEFINE_UNQUOTED(QT_DOCDIR, "$qt_docdir", [Where the Qt documentation is installed])
+])
+
+
+dnl
+dnl Check location of kdelibs documentation generated by Doxygen
+dnl
+AC_DEFUN([KDEV_PATH_KDELIBSDOXY],
+[
+AC_MSG_CHECKING([for kdelibs documentation generated by Doxygen])
+
+ac_kdelibs_doxydirs=""
+AC_ARG_WITH(kdelibsdoxy_dir,
+[ --with-kdelibsdoxy-dir=DIR where the kdelibs documentation is installed ],
+ac_kdelibs_doxydirs=""
+kdelibs_doxydirs=""
+[
+ ac_kdelibs_doxydirs=$withval
+],
+)
+
+if test "${prefix}" = NONE; then
+ ac_kde_htmldir="$ac_default_prefix"/share/doc/HTML
+else
+ ac_kde_htmldir="$prefix"/share/doc/HTML
+fi
+
+kdelibs_doxydirs="$ac_kdelibs_doxydirs $ac_kde_htmldir/default/kdelibs-apidocs $ac_kde_htmldir/en/kdelibs-apidocs"
+AC_FIND_FILE(kdecore/html/classKApplication.html, $kdelibs_doxydirs, kdelibs_doxydir)
+AC_MSG_RESULT($kdelibs_doxydir)
+if test "$kdelibs_doxydir" = NO; then
+ kdelibs_doxydir=""
+fi
+AC_DEFINE_UNQUOTED(KDELIBS_DOXYDIR, "$kdelibs_doxydir", [where KDE documentation is installed])
+])
+AC_SUBST(kdelibs_doxydir)
+
+
+dnl
+dnl Check location of kdelibs documentation
+dnl
+AC_DEFUN([KDEV_PATH_KDELIBSDOC],
+[
+AC_MSG_CHECKING([for kdelibs documentation])
+
+ac_kdelibs_docdirs=""
+AC_ARG_WITH(kdelibsdoc_dir,
+[ --with-kdelibsdoc-dir=DIR where the kdelibs documentation is installed ],
+ac_kdelibs_docdirs=""
+kdelibs_docdirs=""
+[
+ ac_kdelibs_docdirs=$withval
+],
+)
+
+if test "${prefix}" = NONE; then
+ ac_kde_htmldir="$ac_default_prefix"/share/doc/HTML
+else
+ ac_kde_htmldir="$prefix"/share/doc/HTML
+fi
+
+kdelibs_docdirs="/usr/doc/kdelibs-doc/html"
+if test "$ac_kde_htmldir" != ""; then
+ kdelibs_docdirs="$kdelibs_docdirs $ac_kde_htmldir/default/kdelibs $ac_kde_htmldir/en/kdelibs"
+fi
+kdelibs_docdirs="$ac_kdelibs_docdirs $kdelibs_docdirs"
+AC_FIND_FILE(kdecore/index.html, $kdelibs_docdirs, kdelibs_docdir)
+AC_MSG_RESULT($kdelibs_docdir)
+if test "$kdelibs_docdir" = NO; then
+ kdelibs_docdir=""
+fi
+AC_DEFINE_UNQUOTED(KDELIBS_DOCDIR, "$kdelibs_docdir", [where KDE documentation is installed])
+])
+
+
+dnl
+dnl Check whether we support Debian docbase
+dnl
+AC_DEFUN([KDEV_CHECK_DOCBASE],
+[
+AC_MSG_CHECKING(for docbase)
+AC_ARG_ENABLE(docbase,
+[ --enable-docbase enable Debian docbase support],
+[if test "$enableval" = yes; then
+ enable_docbase=yes
+fi],
+enable_docbase=no)
+AC_MSG_RESULT($enable_docbase)
+
+if test "$enable_docbase" = "yes"; then
+ AC_DEFINE_UNQUOTED(WITH_DOCBASE, 1, [If Debian docbase should be supported])
+fi
+])
+
+
+dnl
+dnl Check whether we support Python scripting
+dnl
+AC_DEFUN([KDEV_CHECK_SCRIPTING],
+[
+AC_MSG_CHECKING(if scripting enabled)
+AC_ARG_ENABLE(scripting,
+[ --enable-scripting enable python scripting support],
+[if test "$enableval" = yes; then
+ enable_scripting=yes
+fi],
+enable_scripting=no)
+AC_MSG_RESULT($enable_scripting)
+
+SCRIPTING=
+if test "$enable_scripting" = "yes"; then
+ KDE_CHECK_PYTHON(1.5, [
+ AC_MSG_ERROR([You enabled scripting but have no python installed.])
+ ])
+ SCRIPTING=scripting
+fi
+ AC_SUBST(SCRIPTING)
+ AM_CONDITIONAL(include_scripting, test -n "$SCRIPTING")
+])
+
+
+dnl
+dnl Check for Python documentation dir
+dnl
+AC_DEFUN([KDEV_PATH_PYTHONDOCDIR],
+[
+AC_MSG_CHECKING(for Python documentation directory)
+AC_ARG_WITH(pythondocdir,
+ [ --with-pythondocdir=pythondocdir where the Python documentation is installed ],
+ kdev_pythondocdir=$withval,
+ kdev_pythondocdir=/usr/local/python2.0/html
+)
+
+AC_CACHE_VAL(kdev_cv_pythondocdir,
+[
+ pythondocdirs="/usr/share/doc/packages/python/html /usr/share/doc/python-docs-2.0 /usr/share/doc/python/html $kdev_pythondocdir"
+ AC_FIND_FILE(ref/comparisons.html, $pythondocdirs, kdev_cv_pythondocdir)
+])
+
+AC_MSG_RESULT($kdev_cv_pythondocdir)
+PYTHONDOCDIR=$kdev_cv_pythondocdir
+AC_SUBST(PYTHONDOCDIR)
+])
+
+
+dnl
+dnl Check for Python documentation dir
+dnl
+AC_DEFUN([KDEV_PATH_PHPDOCDIR],
+[
+AC_MSG_CHECKING(for PHP documentation directory)
+AC_ARG_WITH(phpdocdir,
+ [ --with-phpdocdir=phpdocdir where the PHP documentation is installed ],
+ kdev_phpdocdir=$withval,
+ kdev_phpdocdir=/usr/local/php/doc/manual
+)
+
+AC_CACHE_VAL(kdev_cv_phpdocdir,
+[
+ phpdocdirs="/usr/share/doc/packages/phpdoc/manual /usr/share/doc/php3-doc/html $kdev_phpdocdir"
+ AC_FIND_FILE(ref.ftp.html, $phpdocdirs, kdev_cv_phpdocdir)
+])
+
+AC_MSG_RESULT($kdev_cv_phpdocdir)
+PHPDOCDIR=$kdev_cv_phpdocdir
+AC_SUBST(PHPDOCDIR)
+])
+
+
+dnl
+dnl Check for GNUstep documentation
+dnl
+AC_DEFUN([KDEV_PATH_GNUSTEPDOCDIR],
+[
+AC_MSG_CHECKING([for GNUstep documentation])
+if test -z ${GNUSTEP_SYSTEM_ROOT:-""} ; then
+GNUSTEPDOCDIR=
+AC_MSG_RESULT(not found)
+else
+GNUSTEPDOCDIR=$GNUSTEP_SYSTEM_ROOT/Documentation/Developer
+AC_MSG_RESULT($GNUSTEPDOCDIR)
+fi
+AC_SUBST(GNUSTEPDOCDIR)
+AM_CONDITIONAL(GNUSTEPDOCS, test x$GNUSTEPDOCDIR != x)
+])
+
+
+dnl
+dnl Check for Gtk documentation dirs
+dnl
+AC_DEFUN([KDEV_PATH_GTKDOCDIR],
+[
+AC_ARG_WITH(glibdocdir,
+ [ --with-glibdocdir=glibdocdir where the glib documentation is installed ],
+ kdev_glibdocdir=$withval,
+ kdev_glibdocdir=""
+)
+AC_ARG_WITH(gdkdocdir,
+ [ --with-gdkdocdir=gdkdocdir where the gdk documentation is installed ],
+ kdev_gdkdocdir=$withval,
+ kdev_gdkdocdir=""
+)
+AC_ARG_WITH(gdkpbdocdir,
+ [ --with-gdkpbdocdir=gdkpbdocdir where the gdk-pixbuf documentation is installed ],
+ kdev_gdkpbdocdir=$withval,
+ kdev_gdkpbdocdir=""
+)
+AC_ARG_WITH(gtkdocdir,
+ [ --with-gtkdocdir=gtkdocdir where the gtk documentation is installed ],
+ kdev_gtkdocdir=$withval,
+ kdev_gtkdocdir=""
+)
+AC_ARG_WITH(gnomedocdir,
+ [ --with-gnomedocdir=gnomedocdir where the gnome documentation is installed ],
+ kdev_gnomedocdir=$withval,
+ kdev_gnomedocdir=""
+)
+AC_ARG_WITH(gnomeuidocdir,
+ [ --with-gnomeuidocdir=gnomeuidocdir where the gnomeui documentation is installed ],
+ kdev_gnomeuidocdir=$withval,
+ kdev_gnomeuidocdir=""
+)
+
+AC_MSG_CHECKING(for GLib documentation directory)
+AC_CACHE_VAL(kdev_cv_glibdocdir,
+[
+ glibdocdirs="/usr/share/doc/packages/glib $kdev_glibdocdir"
+ AC_FIND_FILE(glib-arrays.html, $glibdocdirs, kdev_cv_glibdocdir)
+])
+AC_MSG_RESULT($kdev_cv_glibdocdir)
+AC_MSG_CHECKING(for Gdk documentation directory)
+AC_CACHE_VAL(kdev_cv_gdkdocdir,
+[
+ gdkdocdirs="/usr/share/doc/packages/gdk $kdev_gdkdocdir"
+ AC_FIND_FILE(gdk-events.html, $gdkdocdirs, kdev_cv_gdkdocdir)
+])
+AC_MSG_RESULT($kdev_cv_gdkdocdir)
+AC_MSG_CHECKING(for Gdk-Pixbuf documentation directory)
+AC_CACHE_VAL(kdev_cv_gdkpbdocdir,
+[
+ gdkpbdocdirs="/usr/share/doc/packages/gdk-pixbuf/html $kdev_gdkpbdocdir"
+ AC_FIND_FILE(gdk-pixbuf-rendering.html, $gdkpbdocdirs, kdev_cv_gdkpbdocdir)
+])
+AC_MSG_RESULT($kdev_cv_gdkpbdocdir)
+AC_MSG_CHECKING(for Gtk documentation directory)
+AC_CACHE_VAL(kdev_cv_gtkdocdir,
+[
+ gtkdocdirs="/usr/share/doc/packages/gtk $kdev_gtkdocdir"
+ AC_FIND_FILE(gtkcombo.html, $gtkdocdirs, kdev_cv_gtkdocdir)
+])
+AC_MSG_RESULT($kdev_cv_gtkdocdir)
+AC_MSG_CHECKING(for libgnome documentation directory)
+AC_CACHE_VAL(kdev_cv_gnomedocdir,
+[
+ gnomedocdirs="/usr/share/doc/packages/gnome-libs-devel/devel-docs/gnome/html $kdev_gnomedocdir"
+ AC_FIND_FILE(libgnome.html, $gnomedocdirs, kdev_cv_gnomedocdir)
+])
+AC_MSG_RESULT($kdev_cv_gnomedocdir)
+AC_MSG_CHECKING(for libgnomeui documentation directory)
+AC_CACHE_VAL(kdev_cv_gnomeuidocdir,
+[
+ gnomeuidocdirs="/usr/share/doc/packages/gnome-libs-devel/devel-docs/gnomeui/html $kdev_gnomeuidocdir"
+ AC_FIND_FILE(libgnomeui.html, $gnomeuidocdirs, kdev_cv_gnomeuidocdir)
+])
+AC_MSG_RESULT($kdev_cv_gnomeuidocdir)
+
+dnl We need all directories or none
+
+if test "$kdev_cv_glibdocdir" = NO; then
+ kdev_cv_glib_docdir=""
+fi
+if test "$kdev_cv_gdkdocdir" = NO; then
+ kdev_cv_glib_docdir=""
+ kdev_cv_gdk_docdir=""
+fi
+if test "$kdev_cv_gdkpbdocdir" = NO; then
+ kdev_cv_glib_docdir=""
+ kdev_cv_gdkpb_docdir=""
+fi
+if test "$kdev_cv_gtkdocdir" = NO; then
+ kdev_cv_glib_docdir=""
+ kdev_cv_gtk_docdir=""
+fi
+if test "$kdev_cv_gnomedocdir" = NO; then
+ kdev_cv_glib_docdir=""
+ kdev_cv_gnome_docdir=""
+fi
+if test "$kdev_cv_gnomeuidocdir" = NO; then
+ kdev_cv_glib_docdir=""
+ kdev_cv_gnomeui_docdir=""
+fi
+
+GLIBDOCDIR=$kdev_cv_glibdocdir
+AC_SUBST(GLIBDOCDIR)
+GDKDOCDIR=$kdev_cv_gdkdocdir
+AC_SUBST(GDKDOCDIR)
+GDKPBDOCDIR=$kdev_cv_gdkpbdocdir
+AC_SUBST(GDKPBDOCDIR)
+GTKDOCDIR=$kdev_cv_gtkdocdir
+AC_SUBST(GTKDOCDIR)
+GNOMEDOCDIR=$kdev_cv_gnomedocdir
+AC_SUBST(GNOMEDOCDIR)
+GNOMEUIDOCDIR=$kdev_cv_gnomeuidocdir
+AC_SUBST(GNOMEUIDOCDIR)
+AM_CONDITIONAL(GTKDOCS, test x$kdev_cv_glibdocdir != x)
+])
+
+
+dnl
+dnl Check whether we support Java
+dnl
+AC_DEFUN([KDEV_CHECK_JAVA],
+[
+AC_MSG_CHECKING(if javasupport enabled)
+AC_ARG_ENABLE(javasupport,
+[ --enable-javasupport enable java support],
+[if test "$enableval" = yes; then
+ enable_javasupport=yes
+fi],
+enable_javasupport=no)
+AC_MSG_RESULT($enable_javasupport)
+
+JAVASUPPORT_SUBDIR=
+if test "$enable_javasupport" = "yes"; then
+ KDE_CHECK_JAVA_DIR
+ if test "x$kde_cv_java_bindir" = xno; then
+ AC_MSG_RESULT([not found -- parts/javasupport will NOT be built])
+ JAVA_SUBDIRS=""
+ else
+ JAVA_SUBDIRS="javasupport javadebugger"
+ fi
+fi
+AC_SUBST(JAVA_SUBDIRS)
+])
+
+dnl **********
+dnl Simple Check for Berkeley DB >= 3
+dnl **********
+
+AC_DEFUN([KDEV_CHECK_BDB],
+[
+ ac_db_includedir=""
+ ac_db_libdir=""
+ ac_db_lib="db"
+ AC_ARG_WITH(db_includedir,
+[ --with-db-includedir=DIR
+ where the DB4 headers are installed ],
+[
+ ac_db_includedir="-I$withval"
+],
+ ac_db_includedir=""
+)
+ AC_ARG_WITH(db_libdir,
+[ --with-db-libdir=DIR where the DB4 libraries are installed ],
+[
+ ac_db_libdir="-L$withval"
+],
+ ac_db_libdir=""
+)
+ AC_ARG_WITH(db_lib,
+[ --with-db-lib=LIB library name for the DB4 library ],
+[
+ ac_db_lib=$withval
+],
+ac_db_lib=db
+)
+
+ AC_MSG_CHECKING(for Berkeley DB >= 4.1)
+
+ AC_CACHE_VAL(ac_cv_bdb,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ save_CXXFLAGS="$CXXFLAGS"
+
+ CXXFLAGS="$CXXFLAGS $ac_db_includedir $ac_db_libdir -l$ac_db_lib"
+
+ AC_TRY_LINK([
+ #include <db.h>
+ ],
+ [
+ #if DB_VERSION_MAJOR < 4 && DB_VERSION_MINOR < 1
+ choke me
+ #else
+ DB *db;
+ db->open( db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644 );
+ #endif
+ ],
+ ac_cv_bdb=yes,
+ ac_cv_bdb=no
+ )
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ if test "$ac_cv_bdb" = "no"; then
+ AC_MSG_ERROR(no - please install Berkeley DB >= 4.1)
+ else
+ AC_MSG_RESULT([yes])
+ fi
+
+DB3LIB="$ac_db_lib"
+DB3INCLUDES="$ac_db_includedir"
+DB3LDFLAGS="$ac_db_libdir"
+AC_SUBST(DB3LIB)
+AC_SUBST(DB3INCLUDES)
+AC_SUBST(DB3LDFLAGS)
+])
+
+dnl **********
+dnl check wether KDE is at least version 3.4.0
+dnl **********
+AC_DEFUN([KDEV_CHECK_KDE_VERSION],
+[
+ AC_MSG_CHECKING(for KDE >= 3.4.0)
+
+
+ AC_CACHE_VAL(ac_cv_kde_version_check,
+ [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ save_CXXFLAGS="$CXXFLAGS"
+
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES -I$ac_kde_includes"
+
+ AC_TRY_COMPILE([
+ #include <kdeversion.h>
+ ],
+ [
+ #if KDE_IS_VERSION(3,4,0)
+ #else
+ KDE_choke me
+ #endif
+ ],
+ ac_cv_kde_version_check=yes,
+ ac_cv_kde_version_check=no
+ )
+ CXXFLAGS="$save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ if test "$ac_cv_kde_version_check" = "yes"; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_ERROR(Installed KDE needs to be version 3.4.0 or later)
+ fi
+])
+
+
+dnl **********
+dnl check for new valgrind version (>= 2.1.0)
+dnl **********
+
+AC_DEFUN([KDEV_CHECK_VALGRIND],
+[
+ AC_CHECK_PROG(ac_have_valgrind, [valgrind], [yes])
+ if test "yes" == $ac_have_valgrind; then
+ AC_MSG_CHECKING(valgrind version)
+ if test "valgrind-20" == `valgrind --version | $AWK -F \. '{print @S|@1@S|@2}'`; then
+ ac_valgrind_ver=20
+ AC_MSG_RESULT(< 2.1.0)
+ elif test "valgrind-1" == `valgrind --version | $AWK -F \. '{print @S|@1}'`; then
+ ac_valgrind_ver=20
+ AC_MSG_RESULT(< 2.1.0)
+ else
+ ac_valgrind_ver=21
+ AC_MSG_RESULT(>= 2.1.0)
+ fi
+ fi
+ AC_DEFINE_UNQUOTED(VALGRIND_VERSION, $ac_valgrind_ver, [valgrind version number - 20 for older and 21 for newer])
+])
diff --git a/kdevelop_c_cpp.desktop b/kdevelop_c_cpp.desktop
new file mode 100644
index 00000000..a0db141f
--- /dev/null
+++ b/kdevelop_c_cpp.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevelop --profile CandCppIDE %u
+MimeType=application/x-kdevelop;
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop: C/C++
+Name[br]=KDevelop : C/C++
+Name[fr]=KDevelop : C / C++
+Name[nds]=KDevelop - C/C++
+Name[ne]=केडीई विकास: C/C++
+Name[zh_CN]=KDevelop:C/C++
+Name[zh_TW]=KDevelop:C/C++
+GenericName=IDE for C/C++
+GenericName[ca]=IDE per a C/C++
+GenericName[cs]=IDE pro C/C++
+GenericName[da]=Integreret udviklingsmiljø for C/C++
+GenericName[de]=IDE für C/C++
+GenericName[el]=IDE για C/C++
+GenericName[es]=IDE para C/C++
+GenericName[et]=C/C++ IDE
+GenericName[eu]=C/C++ IDE-a
+GenericName[fa]=IDE برای C/C++
+GenericName[fr]=EDI pour le C / C++
+GenericName[ga]=IDE le haghaidh C/C++
+GenericName[gl]=IDE para C/C++
+GenericName[hu]=C/C++ fejlesztőkörnyezet
+GenericName[it]=IDE per C/C++
+GenericName[ja]=C/C++ のための統合開発環境
+GenericName[ms]=IDE untuk C/C++
+GenericName[nds]=C/C++-Programmsmeed
+GenericName[ne]=C/C++ का लागि आईडी ई
+GenericName[nl]=IDE voor C/C++
+GenericName[pl]=IDE dla C/C++
+GenericName[pt]=IDE para C/C++
+GenericName[pt_BR]=IDE para o C/C++
+GenericName[ru]=Среда разработки на C/C++
+GenericName[sk]=IDE pre C/C++
+GenericName[sl]=IDE za C/C++
+GenericName[sr]=IDE за C
+GenericName[sr@Latn]=IDE za C
+GenericName[sv]=Utvecklingsmiljö för C/C++
+GenericName[tg]=IDE барои C/C++
+GenericName[tr]=C/C++ için Bütünleşik Geliştirme Ortamı
+GenericName[zh_CN]=C/C++ 的 IDE
+GenericName[zh_TW]=C/C++ 整合開發環境
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;IDE;X-KDE-KDevelopIDE;
diff --git a/kdevelop_kde_cpp.desktop b/kdevelop_kde_cpp.desktop
new file mode 100644
index 00000000..2f9657e9
--- /dev/null
+++ b/kdevelop_kde_cpp.desktop
@@ -0,0 +1,48 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevelop --profile KDECppIDE %u
+MimeType=application/x-kdevelop;
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop: KDE/C++
+Name[br]=KDevelop : KDE/C++
+Name[fr]=KDevelop : KDE / C++
+Name[nds]=KDevelop - KDE/C++
+Name[ne]=केडीई विकास: KDE/C++
+Name[zh_CN]=KDevelop:KDE/C++
+Name[zh_TW]=KDevelop:KDE/C++
+GenericName=IDE for KDE Development
+GenericName[ca]=IDE per al desenvolupament de KDE
+GenericName[cs]=IDE pro vývoj KDE
+GenericName[da]=Integreret udviklingsmiljø for KDE
+GenericName[de]=IDE für KDE-Softwareentwicklung
+GenericName[el]=IDE για προγραμματισμό KDE
+GenericName[es]=IDE para desarrollo en KDE
+GenericName[et]=KDE arendamise IDE
+GenericName[eu]=KDE-ren garapenerako IDE-a
+GenericName[fa]=IDE برای توسعۀ KDE
+GenericName[fr]=EDI pour le développement pour KDE
+GenericName[ga]=IDE le haghaidh fhorbairt KDE
+GenericName[gl]=IDE para desenvolvemento KDE
+GenericName[hu]=Fejlesztőkörnyezet a KDE-hez
+GenericName[it]=IDE per lo sviluppo di KDE
+GenericName[ja]=KDE のための統合開発環境
+GenericName[nds]=KDE-Programmsmeed
+GenericName[ne]=केडीई विकासका लागि आईडी ई
+GenericName[nl]=IDE voor KDE Development
+GenericName[pl]=IDE do tworzenia programów dla KDE
+GenericName[pt]=IDE para Desenvolvimento KDE
+GenericName[pt_BR]=IDE para Desenvolvimento no KDE
+GenericName[ru]=Среда разработки KDE-приложений
+GenericName[sk]=IDE pre vývoj KDE
+GenericName[sl]=IDE za razvijanje KDE
+GenericName[sr]=IDE за KDE развој
+GenericName[sr@Latn]=IDE za KDE razvoj
+GenericName[sv]=Utvecklingsmiljö för KDE
+GenericName[tr]=KDE Geliştirmek için Bütünleşik Geliştirme Ortamı
+GenericName[zh_CN]=KDE 开发的 IDE
+GenericName[zh_TW]=KDE 整合開發環境
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;IDE;X-KDE-KDevelopIDE;
+
diff --git a/kdevelop_ruby.desktop b/kdevelop_ruby.desktop
new file mode 100644
index 00000000..b5bc3c3f
--- /dev/null
+++ b/kdevelop_ruby.desktop
@@ -0,0 +1,51 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevelop --profile RubyIDE %u
+MimeType=application/x-kdevelop;
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop: Ruby
+Name[br]=KDevelop : Ruby
+Name[fa]=KDevelop: رابی
+Name[fr]=KDevelop : Ruby
+Name[nds]=KDevelop - Ruby
+Name[ne]=केडीई विकास: रूबी
+Name[zh_CN]=KDevelop:Ruby
+Name[zh_TW]=KDevelop:Ruby
+GenericName=IDE for Ruby
+GenericName[ca]=IDE per a Ruby
+GenericName[cs]=IDE pro Ruby
+GenericName[da]=Integreret udviklingsmiljø for Ruby
+GenericName[de]=IDE für Ruby
+GenericName[el]=IDE για Ruby
+GenericName[es]=IDE para Ruby
+GenericName[et]=Ruby IDE
+GenericName[eu]=Ruby-rako IDE-a
+GenericName[fa]=IDE برای رابی
+GenericName[fr]=EDI pour Ruby
+GenericName[ga]=IDE le haghaidh Ruby
+GenericName[gl]=IDE para Ruby
+GenericName[hu]=Fejlesztőkörnyezet a Rubyhoz
+GenericName[it]=IDE per Ruby
+GenericName[ja]=Ruby のための統合開発環境
+GenericName[ms]=IDE untuk Ruby
+GenericName[nds]=Ruby-Programmsmeed
+GenericName[ne]=रूबीका लागि आईडी ई
+GenericName[nl]=IDE voor Ruby
+GenericName[pl]=IDE dla języka Ruby
+GenericName[pt]=IDE para Ruby
+GenericName[pt_BR]=IDE para o Ruby
+GenericName[ru]=Среда разработки на Ruby
+GenericName[sk]=IDE pre Ruby
+GenericName[sl]=IDE za Ruby
+GenericName[sr]=IDE за Ruby
+GenericName[sr@Latn]=IDE za Ruby
+GenericName[sv]=Utvecklingsmiljö för Ruby
+GenericName[tg]=IDE барои Ruby
+GenericName[tr]=Ruby için Bütünleşik Geliştirme Ortamı
+GenericName[zh_CN]=Ruby 的 IDE
+GenericName[zh_TW]=Ruby 的整合開發環境
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;IDE;X-KDE-KDevelopIDE;
+
diff --git a/kdevelop_scripting.desktop b/kdevelop_scripting.desktop
new file mode 100644
index 00000000..fde95daf
--- /dev/null
+++ b/kdevelop_scripting.desktop
@@ -0,0 +1,69 @@
+[Desktop Entry]
+Type=Application
+Exec=kdevelop --profile ScriptingLanguageIDE %u
+MimeType=application/x-kdevelop;
+Icon=kdevelop
+X-DocPath=kdevelop/index.html
+Terminal=false
+Name=KDevelop: Scripting
+Name[ca]=KDevelop: Scripts
+Name[cs]=KDevelop: skriptování
+Name[da]=KDevelop: Scriptning
+Name[de]=KDevelop: Skripten
+Name[el]=KDevelop: γραφή σεναρίων
+Name[et]=KDevelop: skriptikeeled
+Name[eu]=KDevelop: Script-ak
+Name[fa]=KDevelop: دست‌نوشته
+Name[fr]=KDevelop : scriptage
+Name[ga]=KDevelop: Scriptiú
+Name[hu]=KDevelop: Szkriptkészítő
+Name[it]=KDevelop: scripting
+Name[ja]=KDevelop: スクリプティング
+Name[ms]=KDevelop: Penskriptan
+Name[nds]=KDevelop - Skripten
+Name[ne]=केडीई विकास: स्क्रिप्टिङ
+Name[pl]=KDevelop: Skrypty
+Name[pt]=KDevelop: 'Scripting'
+Name[ru]=KDevelop: Сценарии
+Name[sk]=KDevelop: Skriptovanie
+Name[sl]=KDevelop: Skriptiranje
+Name[sr]=KDevelop: Скриптовање
+Name[sr@Latn]=KDevelop: Skriptovanje
+Name[sv]=KDevelop: skript
+Name[tr]=KDevelop: Betik
+Name[zh_CN]=KDevelop:脚本
+Name[zh_TW]=KDevelop:文稿
+GenericName=IDE for Scripting Language
+GenericName[ca]=IDE per al llenguatge d'scripts
+GenericName[cs]=IDE pro skriptovací jazyky
+GenericName[da]=Integreret udviklingsmiljø for scriptsprog
+GenericName[de]=IDE für Skript-Sprachen
+GenericName[el]=IDE για γλώσσα γραφής σεναρίων
+GenericName[es]=IDE para lenguaje de guiones
+GenericName[et]=Skriptikeelte IDE
+GenericName[eu]=Script lengoaientzatko IDE-a
+GenericName[fa]=IDE برای زبانهای دست‌نوشته‌ای
+GenericName[fr]=EDI pour les langages de scripts
+GenericName[ga]=IDE le haghaidh teanga scriptithe
+GenericName[gl]=IDE para linguaxes de scripting
+GenericName[hu]=Fejlesztőkörnyezet szkriptnyelvekhez
+GenericName[it]=IDE per linguaggi di scripting
+GenericName[ja]=スクリプト言語のための統合開発環境
+GenericName[nds]=Skriptspraak-Programmsmeed
+GenericName[ne]=स्क्रिप्टिङ भाषाका लागि आईडी ई
+GenericName[nl]=IDE voor Scripting Language
+GenericName[pl]=IDE dla języków skryptowych
+GenericName[pt]=IDE para Linguagens de 'Scripting'
+GenericName[pt_BR]=IDE para Linguagem de Script
+GenericName[ru]=Среда разработки на интерпретируемых языках
+GenericName[sk]=IDE pre skriptovací jazyk
+GenericName[sl]=IDE za skriptni jezik
+GenericName[sr]=IDE за скриптне језике
+GenericName[sr@Latn]=IDE za skriptne jezike
+GenericName[sv]=Utvecklingsmiljö för skriptspråk
+GenericName[tr]=Betik Dili için Bütünleşik Geliştirme Ortamı
+GenericName[zh_CN]=脚本语言的 IDE
+GenericName[zh_TW]=文稿語言的整合開發環境
+X-DCOP-ServiceType=Multi
+Categories=Qt;KDE;Development;IDE;X-KDE-KDevelopIDE;
+
diff --git a/kdevprj2kdevelop b/kdevprj2kdevelop
new file mode 100755
index 00000000..124c2d99
--- /dev/null
+++ b/kdevprj2kdevelop
@@ -0,0 +1,299 @@
+#!/usr/bin/perl
+
+if ($#ARGV != 0) {
+ die "Need one argument";
+}
+
+$filename = $ARGV[0];
+unless ($filename =~ /\.kdevprj/) {
+ die "Not a .kdevprj file";
+}
+
+
+$ingeneral = 0;
+$inlfvgroups = 0;
+
+open(FILE, "<$filename") || die "File not found";
+while (<FILE>) {
+ if (/\[General\]/) {
+ $ingeneral = 1;
+ $inlfvgroups = 0;
+ $inbin = 0;
+ } elsif (/\[LFV Groups\]/) {
+ $ingeneral = 0;
+ $inlfvgroups = 1;
+ $inbin = 0;
+ } elsif (/\[Config for BinMakefileAm\]/) {
+ $ingeneral = 0;
+ $inlfvgroups = 0;
+ $inbin = 1;
+ } elsif (/\[(.*)\]/) {
+ push(@sourcefiles, $1);
+ $ingeneral = 0;
+ $inlfvgroups = 0;
+ $inbin = 0;
+ }
+
+ if ($ingeneral) {
+ if (/^author=(.*)/) {
+ $author = $1;
+ } elsif (/^configure_args=(.*)/) {
+ $configure_args = $1;
+ } elsif (/^email=(.*)/) {
+ $email = $1;
+ } elsif (/^make_options=(.*)/) {
+ $make_options = $1;
+ if ($makeoptions =~ /-n/) {
+ $dontact = "true";
+ }
+ if ($makeoptions =~ /-j([0-9]+)/) {
+ $numberofjobs = $1;
+ }
+ if ($makeoptions =~ /-f/) {
+ $abortonerror = "true";
+ }
+ } elsif (/^project_name=(.*)/) {
+ $project_name = $1;
+ } elsif (/^project_type=(.*)/) {
+ $project_type = $1;
+ } elsif (/^sub_dir=([^\/]*)/) {
+ $subdir = $1;
+ }
+ }
+
+ if ($inlfvgroups) {
+ if (/^groups=(.*)/) {
+ $lfvgroups = $1;
+ } elsif (/(.*)=(.*)/) {
+ $group = $1;
+ $pattern = $2;
+ $pattern =~ s/^(.*),$/$1/;
+ $lfvgrouppattern{$group} = $pattern;
+ }
+ }
+
+ if ($inbin) {
+ if (/^bin_program=(.*)/) {
+ $bin_program = $1;
+ } elsif (/^path_to_bin_program=(.*)/) {
+ $path_to_bin_program = $1;
+ $path_to_bin_program =~ s#^\./(.*)$#$1#;
+ $path_to_bin_program =~ s#^(.*)/#$1#;
+ $path_to_bin_program = $path_to_bin_program . "/";
+ } elsif (/^cflags=(.*)/) {
+ $cflags = $1;
+ } elsif (/^cxxflags=(.*)/) {
+ $cxxflags = $1;
+ }
+ }
+
+}
+close FILE;
+
+# Choose language support
+$primarylanguage = "C++";
+if ($project_type eq "normal_c"
+ || $project_type eq "normal_gnome") {
+ $primarylanguage = "C";
+}
+
+# Choose project management
+$projectmanagement = "KDevCustomProject";
+if ($project_type =~ /normal_kde|mini_kde|normalogl_kde|normal_kde2|mini_kde2|mdi_kde2/
+ || $project_type =~ /kde2_normal|kicker_app|kio_slave|kc_module|kpart_plugin|ktheme/) {
+ $projectmanagement = "KDevKDEAutoProject";
+}
+if ($project_type =~ /normal_cpp/) {
+ $projectmanagement = "KDevAutoProject";
+}
+
+# Keywords
+if ($project_type =~ /normal_kde|mini_kde|normalogl_kde|normal_kde2|mini_kde2|mdi_kde2/
+ || $project_type =~ /kde2_normal|kicker_app|kio_slave|kc_module|kpart_plugin|ktheme/) {
+ $keywords = $keywords . ",KDE";
+}
+if ($project_type =~ /normal_kde|mini_kde|normalogl_kde|normal_kde2|mini_kde2|mdi_kde2/
+ || $project_type =~ /kde2_normal|kicker_app|kio_slave|kc_module|kpart_plugin|ktheme/
+ || $project_type =~ /normal_qt|normal_qt2|mdi_qt2|mdi_qextmdi/) {
+ $keywords = $keywords . ",Qt";
+}
+
+
+##
+## Let's go: write project file
+##
+
+$projectfilename = $filename;
+$projectfilename =~ s/^(.*)\.kdevprj$/$1.kdevelop/;
+open(FILE, ">$projectfilename");
+
+print FILE <<EOF;
+<!DOCTYPE kdevelop>
+<kdevelop>
+ <general>
+ <author>$author</author>
+ <email>$email</email>
+ <projectmanagement>$projectmanagement</projectmanagement>
+ <primarylanguage>$primarylanguage</primarylanguage>
+ <keywords>
+EOF
+
+foreach $key (split(/,/, $keywords)) {
+ next if ($key eq "");
+ print FILE <<EOF;
+ <keyword>$key</keyword>
+EOF
+}
+
+print FILE <<EOF;
+ </keywords>
+ </general>
+EOF
+
+# auto project specific
+
+if ($projectmanagement eq "KDevAutoProject" || $projectmanagement eq "KDevKDEAutoProject") {
+ print FILE <<EOF;
+ <kdevautoproject>
+ <general>
+ <mainprogram>$path_to_bin_program$bin_program</mainprogram>
+ </general>
+ <configure>
+ <configargs>$configure_args</configargs>
+ </configure>
+ <make>
+ <abortonerror>$abortonerror</abortonerror>
+ <numberofjobs>$numberofjobs</numberofjobs>
+ <dontact>$dontact</dontact>
+ <makebin/>
+ </make>
+ <compiler>
+ <cflags>$cflags</cflags>
+ <cxxflags>$cxxflags</cxxflags>
+ </compiler>
+ </kdevautoproject>
+EOF
+}
+
+if ($project_management eq "KDevCustomProject") {
+ print FILE <<EOF;
+ <kdevcustomproject>
+ <general>
+ <mainprogram>$path_to_bin_program/$bin_program</mainprogram>
+ </general>
+ <make>
+ <abortonerror>$abortonerror</abortonerror>
+ <numberofjobs>$numberofjobs</numberofjobs>
+ <dontact>$dontact</dontact>
+ <makebin/>
+ </make>
+ </kdevcustomproject>
+EOF
+}
+
+
+# file view
+print FILE <<EOF;
+ <kdevfileview>
+ <groups>
+EOF
+
+for $group (split /,/, $lfvgroups) {
+ next if ($group eq "");
+ $pattern = $lfvgrouppattern{$group};
+ $pattern =~ s/,/;/g;
+ print FILE <<EOF;
+ <group pattern="$pattern" name="$group" />
+EOF
+}
+
+print FILE <<EOF;
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+EOF
+
+if ($projectmanagement eq "KDevAutoProject"
+ || $projectmanagement eq "KDevKDEAutoProject") {
+ print FILE <<EOF;
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+EOF
+}
+
+print FILE <<EOF;
+</kdevelop>
+EOF
+close FILE;
+
+
+##
+## Write file list
+##
+
+if ($projectmanagement eq "KDevCustomProject") {
+ $filelistfilename = $filename;
+ $filelistfilename =~ s/^(.*).kdevprj$/$1.filelist/;
+ open(FILE, ">$filelistfilename");
+ for $file (@sourcefiles) {
+ print FILE "$file\n";
+ }
+ close FILE;
+}
+
+
+##
+## Convert templates
+##
+
+$projectdir = "";
+if ($filename =~ m#(.*/)[^/]*#) {
+ $projectdir = $1;
+}
+
+$oldtemplatedir = "${projectdir}$subdir/templates";
+
+if (open(FILE, "$oldtemplatedir/cpp_template")) {
+ mkdir "${projectdir}templates";
+ if (open(OFILE, ">${projectdir}templates/cpp")) {
+ while(<FILE>) {
+ s/\|EMAIL\|/\$EMAIL\$/;
+ s/\|AUTHOR\|/\$AUTHOR\$/;
+ s/\|VERSION\|/\$VERSION\$/;
+ s/\|DATE\|/\$DATE\$/;
+ s/\|YEAR\|/\$YEAR\$/;
+ s/\|FILENAME\|/\$FILENAME\$/;
+ print OFILE $_;
+ }
+ close OFILE;
+ }
+ close FILE;
+}
+
+if (open(FILE, "$oldtemplatedir/header_template")) {
+ mkdir "${projectdir}templates";
+ if (open(OFILE, ">${projectdir}templates/h")) {
+ while(<FILE>) {
+ s/\|EMAIL\|/\$EMAIL\$/;
+ s/\|AUTHOR\|/\$AUTHOR\$/;
+ s/\|VERSION\|/\$VERSION\$/;
+ s/\|DATE\|/\$DATE\$/;
+ s/\|YEAR\|/\$YEAR\$/;
+ s/\|FILENAME\|/\$FILENAME\$/;
+ print OFILE $_;
+ }
+ close OFILE;
+ }
+ close FILE;
+}
diff --git a/languages/Makefile.am b/languages/Makefile.am
new file mode 100644
index 00000000..1172b71c
--- /dev/null
+++ b/languages/Makefile.am
@@ -0,0 +1,74 @@
+##
+## Do NOT remove the comments that start with "kdevelop:"
+## They are actually directives to the kdevelop plugin system
+##
+## The include_xxxx variables are controlled by configure.in.in
+##
+
+if include_ada
+ADA_LANGUAGE = ada
+endif
+
+if include_bash
+BASH_LANGUAGE = bash
+endif
+
+if include_cpp
+CPP_LANGUAGE = cpp
+endif
+
+if include_fortran
+FORTRAN_LANGUAGE = fortran
+endif
+
+if include_java
+JAVA_LANGUAGE = java
+endif
+
+if include_csharp
+CSHARP_LANGUAGE = csharp
+endif
+
+if include_pascal
+PASCAL_LANGUAGE = pascal
+endif
+
+if include_perl
+PERL_LANGUAGE = perl
+endif
+
+if include_php
+PHP_LANGUAGE = php
+endif
+
+if include_python
+PYTHON_LANGUAGE = python
+endif
+
+if include_ruby
+RUBY_LANGUAGE = ruby
+endif
+
+if include_sql
+SQL_LANGUAGE = sql
+endif
+
+#kdevelop: ADA_LANGUAGE = ada
+#kdevelop: BASH_LANGUAGE = bash
+#kdevelop: CPP_LANGUAGE = cpp
+#kdevelop: FORTRAN_LANGUAGE = fortran
+#kdevelop: JAVA_LANGUAGE = java
+#kdevelop: CSHARP_LANGUAGE = csharp
+#kdevelop: PASCAL_LANGUAGE = pascal
+#kdevelop: PERL_LANGUAGE = perl
+#kdevelop: PHP_LANGUAGE = php
+#kdevelop: PYTHON_LANGUAGE = python
+#kdevelop: RUBY_LANGUAGE = ruby
+#kdevelop: SQL_LANGUAGE = sql
+
+SUBDIRS = lib $(ADA_LANGUAGE) $(BASH_LANGUAGE) $(CPP_LANGUAGE) $(CSHARP_LANGUAGE) \
+ $(FORTRAN_LANGUAGE) $(JAVA_LANGUAGE) $(PASCAL_LANGUAGE) \
+ $(PERL_LANGUAGE) $(PHP_LANGUAGE) $(PYTHON_LANGUAGE) $(RUBY_LANGUAGE) $(SQL_LANGUAGE)
+
+DOXYGEN_EMPTY = YES
+include ../Doxyfile.am
diff --git a/languages/ada/AdaAST.hpp b/languages/ada/AdaAST.hpp
new file mode 100644
index 00000000..1bb2bd07
--- /dev/null
+++ b/languages/ada/AdaAST.hpp
@@ -0,0 +1,77 @@
+#ifndef ADAAST_HPP
+#define ADAAST_HPP
+
+#include <antlr/CommonAST.hpp>
+
+class AdaAST;
+typedef antlr::ASTRefCount<AdaAST> RefAdaAST;
+
+class AdaAST : public antlr::CommonAST {
+public:
+ AdaAST() : m_line (0), m_column (0) {}
+
+ ~AdaAST() {}
+
+ int getLine () const { return m_line; }
+ void setLine (int line) { m_line = line; }
+
+ int getColumn () const { return m_column; }
+ void setColumn (int column) { m_column = column; }
+
+ void initialize (antlr::RefToken t) {
+ antlr::CommonAST::initialize (t);
+ m_line = t->getLine () - 1;
+ m_column = t->getColumn () - 1;
+ }
+
+ void initialize (int t, const std::string& txt) {
+ setType (t);
+ setText (txt);
+ m_line = 0;
+ m_column = 0;
+ }
+
+ RefAdaAST duplicate (void) const {
+ AdaAST *ast = new AdaAST (*this);
+ return RefAdaAST (ast);
+ }
+
+ void set (int t, const std::string& txt) {
+ setType (t);
+ setText (txt);
+ }
+
+ void addChild (RefAdaAST c) {
+ antlr::RefAST n( c.get() );
+ antlr::BaseAST::addChild (n);
+ }
+
+ RefAdaAST down () const {
+ return RefAdaAST (antlr::BaseAST::getFirstChild ());
+ }
+
+ RefAdaAST right () const {
+ return RefAdaAST (antlr::BaseAST::getNextSibling ());
+ }
+
+ /* bool equals(RefAdaAST t) const {
+ return ((antlr::BaseAST*)this)->equals (t);
+ } */
+
+ static antlr::RefAST factory (void) {
+ RefAdaAST n( new AdaAST );
+ return n.get();
+ }
+
+ static const RefAdaAST nullAdaAST;
+
+private:
+ int m_line;
+ int m_column;
+};
+
+#define Set(n, t) (n)->set(t, #t)
+// for Java compatibility:
+#define boolean bool
+
+#endif
diff --git a/languages/ada/AdaLexer.cpp b/languages/ada/AdaLexer.cpp
new file mode 100644
index 00000000..2ac19416
--- /dev/null
+++ b/languages/ada/AdaLexer.cpp
@@ -0,0 +1,1507 @@
+/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.cpp"$ */
+#include "AdaLexer.hpp"
+#include <antlr/CharBuffer.hpp>
+#include <antlr/TokenStreamException.hpp>
+#include <antlr/TokenStreamIOException.hpp>
+#include <antlr/TokenStreamRecognitionException.hpp>
+#include <antlr/CharStreamException.hpp>
+#include <antlr/CharStreamIOException.hpp>
+#include <antlr/NoViableAltForCharException.hpp>
+
+#line 1531 "ada.g"
+
+#include "preambles.h"
+
+#line 16 "AdaLexer.cpp"
+AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),false)
+{
+ initLiterals();
+}
+
+AdaLexer::AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,false)
+{
+ initLiterals();
+}
+
+AdaLexer::AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,false)
+{
+ initLiterals();
+}
+
+void AdaLexer::initLiterals()
+{
+ literals["until"] = 78;
+ literals["xor"] = 86;
+ literals["abstract"] = 40;
+ literals["reverse"] = 71;
+ literals["use"] = 13;
+ literals["requeue"] = 84;
+ literals["with"] = 11;
+ literals["task"] = 42;
+ literals["at"] = 49;
+ literals["for"] = 47;
+ literals["else"] = 68;
+ literals["is"] = 23;
+ literals["of"] = 55;
+ literals["range"] = 16;
+ literals["and"] = 85;
+ literals["begin"] = 62;
+ literals["procedure"] = 24;
+ literals["separate"] = 39;
+ literals["private"] = 20;
+ literals["pragma"] = 4;
+ literals["delay"] = 77;
+ literals["abort"] = 80;
+ literals["function"] = 25;
+ literals["digits"] = 17;
+ literals["declare"] = 72;
+ literals["raise"] = 83;
+ literals["not"] = 87;
+ literals["record"] = 38;
+ literals["all"] = 30;
+ literals["in"] = 32;
+ literals["generic"] = 61;
+ literals["terminate"] = 82;
+ literals["subtype"] = 51;
+ literals["delta"] = 18;
+ literals["when"] = 58;
+ literals["null"] = 37;
+ literals["entry"] = 46;
+ literals["elsif"] = 67;
+ literals["case"] = 57;
+ literals["others"] = 27;
+ literals["do"] = 76;
+ literals["abs"] = 100;
+ literals["constant"] = 53;
+ literals["renames"] = 34;
+ literals["then"] = 66;
+ literals["exception"] = 52;
+ literals["protected"] = 43;
+ literals["accept"] = 75;
+ literals["or"] = 81;
+ literals["if"] = 65;
+ literals["aliased"] = 56;
+ literals["loop"] = 69;
+ literals["return"] = 41;
+ literals["limited"] = 60;
+ literals["new"] = 26;
+ literals["array"] = 54;
+ literals["rem"] = 99;
+ literals["end"] = 48;
+ literals["body"] = 22;
+ literals["mod"] = 50;
+ literals["goto"] = 74;
+ literals["tagged"] = 59;
+ literals["select"] = 79;
+ literals["while"] = 70;
+ literals["package"] = 21;
+ literals["type"] = 14;
+ literals["access"] = 19;
+ literals["out"] = 33;
+ literals["exit"] = 73;
+}
+
+ANTLR_USE_NAMESPACE(antlr)RefToken AdaLexer::nextToken()
+{
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ for (;;) {
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ int _ttype = ANTLR_USE_NAMESPACE(antlr)Token::INVALID_TYPE;
+ resetText();
+ try { // for lexical and char stream error handling
+ switch ( LA(1)) {
+ case 0x7c /* '|' */ :
+ {
+ mPIPE(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x26 /* '&' */ :
+ {
+ mCONCAT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x2b /* '+' */ :
+ {
+ mPLUS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x28 /* '(' */ :
+ {
+ mLPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x29 /* ')' */ :
+ {
+ mRPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x2c /* ',' */ :
+ {
+ mCOMMA(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x3b /* ';' */ :
+ {
+ mSEMI(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ mIDENTIFIER(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x27 /* '\'' */ :
+ {
+ mTIC_OR_CHARACTER_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x22 /* '\"' */ :
+ {
+ mCHAR_STRING(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ mNUMERIC_LIT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ case 0xa /* '\n' */ :
+ case 0xc /* '\14' */ :
+ case 0xd /* '\r' */ :
+ case 0x20 /* ' ' */ :
+ {
+ mWS_(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ default:
+ if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff))) {
+ mCOMMENT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ ) && (true)) {
+ mCOMMENT_INTRO(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x2e /* '.' */ )) {
+ mDOT_DOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3c /* '<' */ )) {
+ mLT_LT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3e /* '>' */ )) {
+ mOX(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ )) {
+ mGT_GT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) {
+ mRIGHT_SHAFT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mNE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mLE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mGE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (LA(2) == 0x2a /* '*' */ )) {
+ mEXPON(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2e /* '.' */ ) && (true)) {
+ mDOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
+ mEQ(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
+ mLT_(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
+ mGT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (true)) {
+ mMINUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (true)) {
+ mSTAR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (true)) {
+ mDIV(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3a /* ':' */ ) && (true)) {
+ mCOLON(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR)
+ {
+ uponEOF();
+ _returnToken = makeToken(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE);
+ }
+ else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ if ( !_returnToken )
+ goto tryAgain; // found SKIP token
+
+ _ttype = _returnToken->getType();
+ _returnToken->setType(_ttype);
+ return _returnToken;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamIOException& csie) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamIOException(csie.io);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamException& cse) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamException(cse.getMessage());
+ }
+tryAgain:;
+ }
+}
+
+void AdaLexer::mCOMMENT_INTRO(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMENT_INTRO;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("--");
+#line 1888 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 345 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mDOT_DOT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DOT_DOT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("..");
+#line 1889 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 362 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mLT_LT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LT_LT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<<");
+#line 1890 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 379 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mOX(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = OX;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<>");
+#line 1891 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 396 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mGT_GT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GT_GT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">>");
+#line 1892 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 413 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(":=");
+#line 1893 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 430 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mRIGHT_SHAFT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RIGHT_SHAFT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("=>");
+#line 1894 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 447 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mNE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("/=");
+#line 1895 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 464 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mLE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<=");
+#line 1896 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 481 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mGE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">=");
+#line 1897 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 498 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mEXPON(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EXPON;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("**");
+#line 1898 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 515 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mPIPE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PIPE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('|' /* charlit */ );
+#line 1899 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 532 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mCONCAT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = CONCAT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('&' /* charlit */ );
+#line 1900 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 549 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mDOT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DOT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('.' /* charlit */ );
+#line 1901 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 566 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mEQ(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EQ;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('=' /* charlit */ );
+#line 1902 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 583 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mLT_(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LT_;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('<' /* charlit */ );
+#line 1903 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 600 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mGT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('>' /* charlit */ );
+#line 1904 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 617 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mPLUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PLUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('+' /* charlit */ );
+#line 1905 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 634 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mMINUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MINUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('-' /* charlit */ );
+#line 1906 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 651 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mSTAR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STAR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('*' /* charlit */ );
+#line 1907 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 668 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mDIV(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DIV;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('/' /* charlit */ );
+#line 1908 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 685 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mLPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('(' /* charlit */ );
+#line 1909 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 702 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mRPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(')' /* charlit */ );
+#line 1910 "ada.g"
+ lastTokenWasTicCompatible=true;
+#line 719 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mCOLON(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COLON;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(':' /* charlit */ );
+#line 1911 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 736 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mCOMMA(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMA;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(',' /* charlit */ );
+#line 1912 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 753 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mSEMI(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SEMI;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(';' /* charlit */ );
+#line 1913 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 770 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mIDENTIFIER(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = IDENTIFIER;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ matchRange('a','z');
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_0.member(LA(1)))) {
+ {
+ switch ( LA(1)) {
+ case 0x5f /* '_' */ :
+ {
+ match('_' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ matchRange('0','9');
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ }
+ else {
+ goto _loop512;
+ }
+
+ }
+ _loop512:;
+ } // ( ... )*
+ _ttype = testLiteralsTable(_ttype);
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mTIC_OR_CHARACTER_LITERAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = TIC_OR_CHARACTER_LITERAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ _saveIndex = text.length();
+ match("\'");
+ text.erase(_saveIndex);
+#line 1927 "ada.g"
+ _ttype = TIC;
+#line 921 "AdaLexer.cpp"
+ {
+ if ((((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)))&&( ! lastTokenWasTicCompatible )) {
+ matchNot(EOF/*_CHAR*/);
+ _saveIndex = text.length();
+ match("\'");
+ text.erase(_saveIndex);
+#line 1929 "ada.g"
+ _ttype = CHARACTER_LITERAL;
+#line 930 "AdaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+#line 1931 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 938 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mCHAR_STRING(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = CHAR_STRING;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ _saveIndex = text.length();
+ match('\"' /* charlit */ );
+ text.erase(_saveIndex);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0x22 /* '\"' */ ) && (LA(2) == 0x22 /* '\"' */ )) {
+ match("\"\"");
+ }
+ else if ((_tokenSet_1.member(LA(1)))) {
+ {
+ match(_tokenSet_1);
+ }
+ }
+ else {
+ goto _loop518;
+ }
+
+ }
+ _loop518:;
+ } // ( ... )*
+ _saveIndex = text.length();
+ match('\"' /* charlit */ );
+ text.erase(_saveIndex);
+#line 1934 "ada.g"
+ lastTokenWasTicCompatible=true;
+#line 977 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mNUMERIC_LIT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NUMERIC_LIT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ { // ( ... )+
+ int _cnt521=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt521>=1 ) { goto _loop521; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt521++;
+ }
+ _loop521:;
+ } // ( ... )+
+ {
+ switch ( LA(1)) {
+ case 0x23 /* '#' */ :
+ {
+ match('#' /* charlit */ );
+ mBASED_INTEGER(false);
+ {
+ switch ( LA(1)) {
+ case 0x2e /* '.' */ :
+ {
+ match('.' /* charlit */ );
+ mBASED_INTEGER(false);
+ break;
+ }
+ case 0x23 /* '#' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ match('#' /* charlit */ );
+ break;
+ }
+ case 0x5f /* '_' */ :
+ {
+ { // ( ... )+
+ int _cnt527=0;
+ for (;;) {
+ if ((LA(1) == 0x5f /* '_' */ )) {
+ match('_' /* charlit */ );
+ { // ( ... )+
+ int _cnt526=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt526>=1 ) { goto _loop526; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt526++;
+ }
+ _loop526:;
+ } // ( ... )+
+ }
+ else {
+ if ( _cnt527>=1 ) { goto _loop527; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt527++;
+ }
+ _loop527:;
+ } // ( ... )+
+ break;
+ }
+ default:
+ {
+ }
+ }
+ }
+ {
+ if (((LA(1) == 0x2e /* '.' */ || LA(1) == 0x65 /* 'e' */ ))&&( LA(2)!='.' )) {
+ {
+ switch ( LA(1)) {
+ case 0x2e /* '.' */ :
+ {
+ match('.' /* charlit */ );
+ { // ( ... )+
+ int _cnt531=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt531>=1 ) { goto _loop531; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt531++;
+ }
+ _loop531:;
+ } // ( ... )+
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0x5f /* '_' */ )) {
+ match('_' /* charlit */ );
+ { // ( ... )+
+ int _cnt534=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt534>=1 ) { goto _loop534; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt534++;
+ }
+ _loop534:;
+ } // ( ... )+
+ }
+ else {
+ goto _loop535;
+ }
+
+ }
+ _loop535:;
+ } // ( ... )*
+ {
+ if ((LA(1) == 0x65 /* 'e' */ )) {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ case 0x65 /* 'e' */ :
+ {
+ mEXPONENT(false);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ }
+ else {
+ }
+
+ }
+#line 1945 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 1144 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mDIGIT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DIGIT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ matchRange('0','9');
+ }
+#line 1950 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 1163 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mBASED_INTEGER(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BASED_INTEGER;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ mEXTENDED_DIGIT(false);
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_2.member(LA(1)))) {
+ {
+ switch ( LA(1)) {
+ case 0x5f /* '_' */ :
+ {
+ match('_' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ mEXTENDED_DIGIT(false);
+ }
+ else {
+ goto _loop550;
+ }
+
+ }
+ _loop550:;
+ } // ( ... )*
+#line 1959 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 1226 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mEXPONENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EXPONENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ match('e' /* charlit */ );
+ }
+ {
+ switch ( LA(1)) {
+ case 0x2b /* '+' */ :
+ {
+ match('+' /* charlit */ );
+ break;
+ }
+ case 0x2d /* '-' */ :
+ {
+ match('-' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt543=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ mDIGIT(false);
+ }
+ else {
+ if ( _cnt543>=1 ) { goto _loop543; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt543++;
+ }
+ _loop543:;
+ } // ( ... )+
+#line 1953 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 1290 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mEXTENDED_DIGIT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EXTENDED_DIGIT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ mDIGIT(false);
+ break;
+ }
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ {
+ matchRange('a','f');
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1956 "ada.g"
+ lastTokenWasTicCompatible=false;
+#line 1338 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mWS_(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = WS_;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x20 /* ' ' */ :
+ {
+ match(' ' /* charlit */ );
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ {
+ match('\t' /* charlit */ );
+ break;
+ }
+ case 0xc /* '\14' */ :
+ {
+ match('\14' /* charlit */ );
+ break;
+ }
+ case 0xa /* '\n' */ :
+ case 0xd /* '\r' */ :
+ {
+ {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ )) {
+ match("\r\n");
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && (true)) {
+ match('\r' /* charlit */ );
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+#line 1971 "ada.g"
+ newline();
+#line 1389 "AdaLexer.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1973 "ada.g"
+ _ttype = antlr::Token::SKIP;
+#line 1400 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void AdaLexer::mCOMMENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ mCOMMENT_INTRO(false);
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_3.member(LA(1)))) {
+ {
+ match(_tokenSet_3);
+ }
+ }
+ else {
+ goto _loop557;
+ }
+
+ }
+ _loop557:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case 0xa /* '\n' */ :
+ {
+ match('\n' /* charlit */ );
+ break;
+ }
+ case 0xd /* '\r' */ :
+ {
+ match('\r' /* charlit */ );
+ {
+ if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1978 "ada.g"
+ _ttype = antlr::Token::SKIP;
+ newline();
+ lastTokenWasTicCompatible=false;
+#line 1459 "AdaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+
+const unsigned long AdaLexer::_tokenSet_0_data_[] = { 0UL, 67043328UL, 2147483648UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0 1 2 3 4 5 6 7 8 9 _ a b c d e f g h i j k l m n o p q r s t u v w
+// x y z
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_0(_tokenSet_0_data_,10);
+const unsigned long AdaLexer::_tokenSet_1_data_[] = { 4294967288UL, 4294967291UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
+// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! # $
+// % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
+// G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g
+// h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83
+// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91
+// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f
+// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad
+// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb
+// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9
+// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7
+// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5
+// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3
+// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_1(_tokenSet_1_data_,16);
+const unsigned long AdaLexer::_tokenSet_2_data_[] = { 0UL, 67043328UL, 2147483648UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0 1 2 3 4 5 6 7 8 9 _ a b c d e f
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_2(_tokenSet_2_data_,10);
+const unsigned long AdaLexer::_tokenSet_3_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
+// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! \" # $ %
+// & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
+// H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h
+// i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83
+// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91
+// 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f
+// 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac 0xad
+// 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba 0xbb
+// 0xbc 0xbd 0xbe 0xbf 0xc0 0xc1 0xc2 0xc3 0xc4 0xc5 0xc6 0xc7 0xc8 0xc9
+// 0xca 0xcb 0xcc 0xcd 0xce 0xcf 0xd0 0xd1 0xd2 0xd3 0xd4 0xd5 0xd6 0xd7
+// 0xd8 0xd9 0xda 0xdb 0xdc 0xdd 0xde 0xdf 0xe0 0xe1 0xe2 0xe3 0xe4 0xe5
+// 0xe6 0xe7 0xe8 0xe9 0xea 0xeb 0xec 0xed 0xee 0xef 0xf0 0xf1 0xf2 0xf3
+// 0xf4 0xf5 0xf6 0xf7 0xf8 0xf9 0xfa 0xfb 0xfc 0xfd 0xfe 0xff
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaLexer::_tokenSet_3(_tokenSet_3_data_,16);
+
diff --git a/languages/ada/AdaLexer.hpp b/languages/ada/AdaLexer.hpp
new file mode 100644
index 00000000..795c7bba
--- /dev/null
+++ b/languages/ada/AdaLexer.hpp
@@ -0,0 +1,86 @@
+#ifndef INC_AdaLexer_hpp_
+#define INC_AdaLexer_hpp_
+
+#line 29 "ada.g"
+
+#include <antlr/SemanticException.hpp> // antlr wants this
+#include "AdaAST.hpp"
+#include "preambles.h"
+
+#line 11 "AdaLexer.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaLexer.hpp"$ */
+#include <antlr/CommonToken.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/BitSet.hpp>
+#include "AdaTokenTypes.hpp"
+#include <antlr/CharScanner.hpp>
+class CUSTOM_API AdaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public AdaTokenTypes
+{
+#line 1879 "ada.g"
+
+ ANTLR_LEXER_PREAMBLE
+ private:
+ bool lastTokenWasTicCompatible;
+#line 22 "AdaLexer.hpp"
+private:
+ void initLiterals();
+public:
+ bool getCaseSensitiveLiterals() const
+ {
+ return false;
+ }
+public:
+ AdaLexer(ANTLR_USE_NAMESPACE(std)istream& in);
+ AdaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib);
+ AdaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state);
+ ANTLR_USE_NAMESPACE(antlr)RefToken nextToken();
+ public: void mCOMMENT_INTRO(bool _createToken);
+ public: void mDOT_DOT(bool _createToken);
+ public: void mLT_LT(bool _createToken);
+ public: void mOX(bool _createToken);
+ public: void mGT_GT(bool _createToken);
+ public: void mASSIGN(bool _createToken);
+ public: void mRIGHT_SHAFT(bool _createToken);
+ public: void mNE(bool _createToken);
+ public: void mLE(bool _createToken);
+ public: void mGE(bool _createToken);
+ public: void mEXPON(bool _createToken);
+ public: void mPIPE(bool _createToken);
+ public: void mCONCAT(bool _createToken);
+ public: void mDOT(bool _createToken);
+ public: void mEQ(bool _createToken);
+ public: void mLT_(bool _createToken);
+ public: void mGT(bool _createToken);
+ public: void mPLUS(bool _createToken);
+ public: void mMINUS(bool _createToken);
+ public: void mSTAR(bool _createToken);
+ public: void mDIV(bool _createToken);
+ public: void mLPAREN(bool _createToken);
+ public: void mRPAREN(bool _createToken);
+ public: void mCOLON(bool _createToken);
+ public: void mCOMMA(bool _createToken);
+ public: void mSEMI(bool _createToken);
+ public: void mIDENTIFIER(bool _createToken);
+ public: void mTIC_OR_CHARACTER_LITERAL(bool _createToken);
+ public: void mCHAR_STRING(bool _createToken);
+ public: void mNUMERIC_LIT(bool _createToken);
+ protected: void mDIGIT(bool _createToken);
+ protected: void mBASED_INTEGER(bool _createToken);
+ protected: void mEXPONENT(bool _createToken);
+ protected: void mEXTENDED_DIGIT(bool _createToken);
+ public: void mWS_(bool _createToken);
+ public: void mCOMMENT(bool _createToken);
+private:
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+};
+
+#endif /*INC_AdaLexer_hpp_*/
diff --git a/languages/ada/AdaParser.cpp b/languages/ada/AdaParser.cpp
new file mode 100644
index 00000000..e783595e
--- /dev/null
+++ b/languages/ada/AdaParser.cpp
@@ -0,0 +1,12283 @@
+/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.cpp"$ */
+#include "AdaParser.hpp"
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/ASTFactory.hpp>
+#line 1 "ada.g"
+#line 8 "AdaParser.cpp"
+AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,k)
+{
+}
+
+AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,2)
+{
+}
+
+AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,k)
+{
+}
+
+AdaParser::AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,2)
+{
+}
+
+AdaParser::AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(state,2)
+{
+}
+
+void AdaParser::compilation_unit() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST compilation_unit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ context_items_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case GENERIC:
+ {
+ library_item();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEPARATE:
+ {
+ subunit();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PRAGMA)) {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop4;
+ }
+
+ }
+ _loop4:;
+ } // ( ... )*
+ compilation_unit_AST = RefAdaAST(currentAST.root);
+ returnAST = compilation_unit_AST;
+}
+
+void AdaParser::context_items_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST context_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case WITH:
+ {
+ with_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case USE:
+ {
+ use_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop14;
+ }
+ }
+ }
+ _loop14:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ context_items_opt_AST = RefAdaAST(currentAST.root);
+#line 86 "ada.g"
+ context_items_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CONTEXT_CLAUSE,"CONTEXT_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(context_items_opt_AST))));
+#line 135 "AdaParser.cpp"
+ currentAST.root = context_items_opt_AST;
+ if ( context_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ context_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = context_items_opt_AST->getFirstChild();
+ else
+ currentAST.child = context_items_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ context_items_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = context_items_opt_AST;
+}
+
+void AdaParser::library_item() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST library_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ private_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case PACKAGE:
+ {
+ lib_pkg_spec_or_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ subprog_decl_or_rename_or_inst_or_body(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case GENERIC:
+ {
+ generic_decl(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ library_item_AST = RefAdaAST(currentAST.root);
+#line 133 "ada.g"
+ library_item_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LIBRARY_ITEM,"LIBRARY_ITEM")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(library_item_AST))));
+#line 194 "AdaParser.cpp"
+ currentAST.root = library_item_AST;
+ if ( library_item_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ library_item_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = library_item_AST->getFirstChild();
+ else
+ currentAST.child = library_item_AST;
+ currentAST.advanceChildToEnd();
+ }
+ library_item_AST = RefAdaAST(currentAST.root);
+ returnAST = library_item_AST;
+}
+
+void AdaParser::subunit() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subunit_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken sep = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST sep_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ sep = LT(1);
+ if ( inputState->guessing == 0 ) {
+ sep_AST = astFactory->create(sep);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(sep_AST));
+ }
+ match(SEPARATE);
+ match(LPAREN);
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 1497 "ada.g"
+ Set(sep_AST, SUBUNIT);
+#line 229 "AdaParser.cpp"
+ }
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ subprogram_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PACKAGE:
+ {
+ package_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case TASK:
+ {
+ task_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROTECTED:
+ {
+ protected_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subunit_AST = RefAdaAST(currentAST.root);
+ returnAST = subunit_AST;
+}
+
+void AdaParser::pragma() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST pragma_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp3_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp3_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp3_AST));
+ }
+ match(PRAGMA);
+ RefAdaAST tmp4_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp4_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp4_AST));
+ }
+ match(IDENTIFIER);
+ pragma_args_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ pragma_AST = RefAdaAST(currentAST.root);
+ returnAST = pragma_AST;
+}
+
+void AdaParser::pragma_args_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST pragma_args_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ pragma_arg();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ pragma_arg();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop9;
+ }
+
+ }
+ _loop9:;
+ } // ( ... )*
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ pragma_args_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = pragma_args_opt_AST;
+}
+
+void AdaParser::pragma_arg() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST pragma_arg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ if ((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT)) {
+ RefAdaAST tmp9_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp9_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST));
+ }
+ match(IDENTIFIER);
+ RefAdaAST tmp10_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp10_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST));
+ }
+ match(RIGHT_SHAFT);
+ }
+ else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ pragma_arg_AST = RefAdaAST(currentAST.root);
+ returnAST = pragma_arg_AST;
+}
+
+void AdaParser::expression() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken o = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST o_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ relation();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case AND:
+ {
+ a = LT(1);
+ if ( inputState->guessing == 0 ) {
+ a_AST = astFactory->create(a);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST));
+ }
+ match(AND);
+ {
+ switch ( LA(1)) {
+ case THEN:
+ {
+ match(THEN);
+ if ( inputState->guessing==0 ) {
+#line 1417 "ada.g"
+ Set (a_AST, AND_THEN);
+#line 416 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relation();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case OR:
+ {
+ o = LT(1);
+ if ( inputState->guessing == 0 ) {
+ o_AST = astFactory->create(o);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(o_AST));
+ }
+ match(OR);
+ {
+ switch ( LA(1)) {
+ case ELSE:
+ {
+ match(ELSE);
+ if ( inputState->guessing==0 ) {
+#line 1418 "ada.g"
+ Set (o_AST, OR_ELSE);
+#line 462 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relation();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case XOR:
+ {
+ RefAdaAST tmp13_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp13_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST));
+ }
+ match(XOR);
+ relation();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop450;
+ }
+ }
+ }
+ _loop450:;
+ } // ( ... )*
+ expression_AST = RefAdaAST(currentAST.root);
+ returnAST = expression_AST;
+}
+
+void AdaParser::with_clause() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST with_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ w = LT(1);
+ if ( inputState->guessing == 0 ) {
+ w_AST = astFactory->create(w);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST));
+ }
+ match(WITH);
+ c_name_list();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 94 "ada.g"
+ Set(w_AST, WITH_CLAUSE);
+#line 539 "AdaParser.cpp"
+ }
+ with_clause_AST = RefAdaAST(currentAST.root);
+ returnAST = with_clause_AST;
+}
+
+void AdaParser::use_clause() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST use_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken u = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST u_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ u = LT(1);
+ if ( inputState->guessing == 0 ) {
+ u_AST = astFactory->create(u);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(u_AST));
+ }
+ match(USE);
+ {
+ switch ( LA(1)) {
+ case TYPE:
+ {
+ match(TYPE);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop25;
+ }
+
+ }
+ _loop25:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+#line 108 "ada.g"
+ Set(u_AST, USE_TYPE_CLAUSE);
+#line 586 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ c_name_list();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 109 "ada.g"
+ Set(u_AST, USE_CLAUSE);
+#line 599 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ use_clause_AST = RefAdaAST(currentAST.root);
+ returnAST = use_clause_AST;
+}
+
+void AdaParser::c_name_list() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST c_name_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop18;
+ }
+
+ }
+ _loop18:;
+ } // ( ... )*
+ c_name_list_AST = RefAdaAST(currentAST.root);
+ returnAST = c_name_list_AST;
+}
+
+void AdaParser::compound_name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST compound_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp19_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp19_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST));
+ }
+ match(IDENTIFIER);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == DOT)) {
+ RefAdaAST tmp20_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp20_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST));
+ }
+ match(DOT);
+ RefAdaAST tmp21_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp21_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST));
+ }
+ match(IDENTIFIER);
+ }
+ else {
+ goto _loop21;
+ }
+
+ }
+ _loop21:;
+ } // ( ... )*
+ compound_name_AST = RefAdaAST(currentAST.root);
+ returnAST = compound_name_AST;
+}
+
+void AdaParser::subtype_mark() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subtype_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case TIC:
+ {
+ RefAdaAST tmp22_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp22_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST));
+ }
+ match(TIC);
+ attribute_id();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case LPAREN:
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case USE:
+ case RANGE:
+ case DIGITS:
+ case DELTA:
+ case IS:
+ case PIPE:
+ case DOT_DOT:
+ case RENAMES:
+ case ASSIGN:
+ case AT:
+ case THEN:
+ case LOOP:
+ case OR:
+ case AND:
+ case XOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subtype_mark_AST = RefAdaAST(currentAST.root);
+ returnAST = subtype_mark_AST;
+}
+
+void AdaParser::attribute_id() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST attribute_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case RANGE:
+ {
+ RefAdaAST tmp23_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp23_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST));
+ }
+ match(RANGE);
+ attribute_id_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case DIGITS:
+ {
+ RefAdaAST tmp24_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp24_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST));
+ }
+ match(DIGITS);
+ attribute_id_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case DELTA:
+ {
+ RefAdaAST tmp25_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp25_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST));
+ }
+ match(DELTA);
+ attribute_id_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case ACCESS:
+ {
+ RefAdaAST tmp26_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp26_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST));
+ }
+ match(ACCESS);
+ attribute_id_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp27_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp27_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST));
+ }
+ match(IDENTIFIER);
+ attribute_id_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = attribute_id_AST;
+}
+
+void AdaParser::private_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ RefAdaAST tmp28_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp28_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST));
+ }
+ match(PRIVATE);
+ break;
+ }
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case GENERIC:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ private_opt_AST = RefAdaAST(currentAST.root);
+#line 137 "ada.g"
+ private_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_opt_AST))));
+#line 843 "AdaParser.cpp"
+ currentAST.root = private_opt_AST;
+ if ( private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = private_opt_AST->getFirstChild();
+ else
+ currentAST.child = private_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ private_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = private_opt_AST;
+}
+
+void AdaParser::lib_pkg_spec_or_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST lib_pkg_spec_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ pkg = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pkg_AST = astFactory->create(pkg);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST));
+ }
+ match(PACKAGE);
+ {
+ switch ( LA(1)) {
+ case BODY:
+ {
+ match(BODY);
+ def_id(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ pkg_body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 143 "ada.g"
+ Set(pkg_AST, PACKAGE_BODY);
+#line 887 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ def_id(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ spec_decl_part(pkg_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ lib_pkg_spec_or_body_AST = RefAdaAST(currentAST.root);
+ returnAST = lib_pkg_spec_or_body_AST;
+}
+
+void AdaParser::subprog_decl_or_rename_or_inst_or_body(
+ boolean lib_level
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 944 "ada.g"
+ RefAdaAST t;
+#line 925 "AdaParser.cpp"
+
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROCEDURE);
+ def_id(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ if ((LA(1) == IS) && (LA(2) == NEW)) {
+ generic_subp_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 948 "ada.g"
+ Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION);
+#line 949 "AdaParser.cpp"
+ }
+ }
+ else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 950 "ada.g"
+ Set(p_AST, PROCEDURE_RENAMING_DECLARATION);
+#line 968 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IS:
+ {
+ match(IS);
+ {
+ switch ( LA(1)) {
+ case SEPARATE:
+ case ABSTRACT:
+ {
+ separate_or_abstract(p_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ case BEGIN:
+ {
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 952 "ada.g"
+ Set(p_AST, PROCEDURE_BODY);
+#line 1007 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 954 "ada.g"
+ pop_def_id();
+ Set(p_AST, PROCEDURE_DECLARATION);
+#line 1025 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FUNCTION);
+ def_designator(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ generic_subp_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 961 "ada.g"
+ Set(f_AST, GENERIC_FUNCTION_INSTANTIATION);
+#line 1068 "AdaParser.cpp"
+ }
+ break;
+ }
+ case LPAREN:
+ case RETURN:
+ {
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 963 "ada.g"
+ Set(f_AST, FUNCTION_RENAMING_DECLARATION);
+#line 1090 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IS:
+ {
+ match(IS);
+ {
+ switch ( LA(1)) {
+ case SEPARATE:
+ case ABSTRACT:
+ {
+ separate_or_abstract(f_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ case BEGIN:
+ {
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 965 "ada.g"
+ Set(f_AST, FUNCTION_BODY);
+#line 1129 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 967 "ada.g"
+ pop_def_id();
+ Set(f_AST, FUNCTION_DECLARATION);
+#line 1147 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subprog_decl_or_rename_or_inst_or_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = subprog_decl_or_rename_or_inst_or_body_AST;
+}
+
+void AdaParser::generic_decl(
+ boolean lib_level
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST generic_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken g = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST g_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ g = LT(1);
+ if ( inputState->guessing == 0 ) {
+ g_AST = astFactory->create(g);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(g_AST));
+ }
+ match(GENERIC);
+ generic_formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case PACKAGE:
+ {
+ match(PACKAGE);
+ def_id(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 865 "ada.g"
+ Set(g_AST, GENERIC_PACKAGE_RENAMING);
+#line 1216 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IS:
+ {
+ match(IS);
+ pkg_spec_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 866 "ada.g"
+ Set(g_AST, GENERIC_PACKAGE_DECLARATION);
+#line 1230 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case PROCEDURE:
+ {
+ match(PROCEDURE);
+ def_id(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 869 "ada.g"
+ Set(g_AST, GENERIC_PROCEDURE_RENAMING);
+#line 1264 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 872 "ada.g"
+ Set(g_AST, GENERIC_PROCEDURE_DECLARATION); pop_def_id();
+#line 1273 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case FUNCTION:
+ {
+ match(FUNCTION);
+ def_designator(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 875 "ada.g"
+ Set(g_AST, GENERIC_FUNCTION_RENAMING);
+#line 1307 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 878 "ada.g"
+ Set(g_AST, GENERIC_FUNCTION_DECLARATION); pop_def_id();
+#line 1316 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ generic_decl_AST = RefAdaAST(currentAST.root);
+ returnAST = generic_decl_AST;
+}
+
+void AdaParser::def_id(
+ boolean lib_level
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST def_id_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST cn_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if (((LA(1) == IDENTIFIER) && (_tokenSet_4.member(LA(2))))&&( lib_level )) {
+ compound_name();
+ if (inputState->guessing==0) {
+ cn_AST = returnAST;
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 171 "ada.g"
+ push_def_id(cn_AST);
+#line 1358 "AdaParser.cpp"
+ }
+ def_id_AST = RefAdaAST(currentAST.root);
+ }
+ else if (((LA(1) == IDENTIFIER) && (_tokenSet_5.member(LA(2))))&&( !lib_level )) {
+ n = LT(1);
+ if ( inputState->guessing == 0 ) {
+ n_AST = astFactory->create(n);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST));
+ }
+ match(IDENTIFIER);
+ if ( inputState->guessing==0 ) {
+#line 172 "ada.g"
+ push_def_id(n_AST);
+#line 1372 "AdaParser.cpp"
+ }
+ def_id_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = def_id_AST;
+}
+
+void AdaParser::pkg_body_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST pkg_body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ declarative_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ block_body_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ pkg_body_part_AST = RefAdaAST(currentAST.root);
+ returnAST = pkg_body_part_AST;
+}
+
+void AdaParser::spec_decl_part(
+ RefAdaAST pkg
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST spec_decl_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ {
+ switch ( LA(1)) {
+ case NEW:
+ {
+ generic_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 364 "ada.g"
+ Set(pkg, GENERIC_PACKAGE_INSTANTIATION);
+#line 1427 "AdaParser.cpp"
+ }
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PRIVATE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case END:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ pkg_spec_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 365 "ada.g"
+ Set(pkg, PACKAGE_SPECIFICATION);
+#line 1453 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 367 "ada.g"
+ Set(pkg, PACKAGE_RENAMING_DECLARATION);
+#line 1474 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ spec_decl_part_AST = RefAdaAST(currentAST.root);
+ returnAST = spec_decl_part_AST;
+}
+
+void AdaParser::subprog_decl(
+ boolean lib_level
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subprog_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 148 "ada.g"
+ RefAdaAST t;
+#line 1501 "AdaParser.cpp"
+
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROCEDURE);
+ def_id(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ if ((LA(1) == IS) && (LA(2) == NEW)) {
+ generic_subp_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 152 "ada.g"
+ Set(p_AST, GENERIC_PROCEDURE_INSTANTIATION);
+#line 1525 "AdaParser.cpp"
+ }
+ }
+ else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_6.member(LA(2)))) {
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 154 "ada.g"
+ Set(p_AST, PROCEDURE_RENAMING_DECLARATION);
+#line 1544 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ case IS:
+ {
+ is_separate_or_abstract_or_decl(p_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ subprog_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FUNCTION);
+ def_designator(lib_level);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ generic_subp_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 161 "ada.g"
+ Set(f_AST, GENERIC_FUNCTION_INSTANTIATION);
+#line 1596 "AdaParser.cpp"
+ }
+ break;
+ }
+ case LPAREN:
+ case RETURN:
+ {
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RENAMES:
+ {
+ renames();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 163 "ada.g"
+ Set(f_AST, FUNCTION_RENAMING_DECLARATION);
+#line 1618 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ case IS:
+ {
+ is_separate_or_abstract_or_decl(f_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subprog_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = subprog_decl_AST;
+}
+
+void AdaParser::generic_subp_inst() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST generic_subp_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(IS);
+ generic_inst();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ generic_subp_inst_AST = RefAdaAST(currentAST.root);
+ returnAST = generic_subp_inst_AST;
+}
+
+void AdaParser::formal_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ parameter_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ parameter_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop70;
+ }
+
+ }
+ _loop70:;
+ } // ( ... )*
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ case IS:
+ case RENAMES:
+ case WHEN:
+ case DO:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ formal_part_opt_AST = RefAdaAST(currentAST.root);
+#line 235 "ada.g"
+ formal_part_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(formal_part_opt_AST))));
+#line 1723 "AdaParser.cpp"
+ currentAST.root = formal_part_opt_AST;
+ if ( formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = formal_part_opt_AST->getFirstChild();
+ else
+ currentAST.child = formal_part_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ formal_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = formal_part_opt_AST;
+}
+
+void AdaParser::renames() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST renames_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 258 "ada.g"
+ RefAdaAST dummy;
+#line 1742 "AdaParser.cpp"
+
+ match(RENAMES);
+ {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CHAR_STRING:
+ {
+ dummy=definable_operator_symbol();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 262 "ada.g"
+ pop_def_id();
+#line 1772 "AdaParser.cpp"
+ }
+ renames_AST = RefAdaAST(currentAST.root);
+ returnAST = renames_AST;
+}
+
+void AdaParser::is_separate_or_abstract_or_decl(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST is_separate_or_abstract_or_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ separate_or_abstract(t);
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 305 "ada.g"
+ pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, PROCEDURE_DECLARATION);
+ else
+ Set(t, FUNCTION_DECLARATION);
+
+#line 1802 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = is_separate_or_abstract_or_decl_AST;
+}
+
+void AdaParser::def_designator(
+ boolean lib_level
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST def_designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 330 "ada.g"
+ RefAdaAST d;
+#line 1823 "AdaParser.cpp"
+
+ if (((LA(1) == IDENTIFIER) && (_tokenSet_7.member(LA(2))))&&( lib_level )) {
+ compound_name();
+ if (inputState->guessing==0) {
+ n_AST = returnAST;
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 332 "ada.g"
+ push_def_id(n_AST);
+#line 1834 "AdaParser.cpp"
+ }
+ def_designator_AST = RefAdaAST(currentAST.root);
+ }
+ else if (((LA(1) == IDENTIFIER || LA(1) == CHAR_STRING) && (LA(2) == LPAREN || LA(2) == IS || LA(2) == RETURN))&&( !lib_level )) {
+ d=designator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 333 "ada.g"
+ push_def_id(d);
+#line 1846 "AdaParser.cpp"
+ }
+ def_designator_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = def_designator_AST;
+}
+
+void AdaParser::function_tail() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST function_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ func_formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RETURN);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail_AST = RefAdaAST(currentAST.root);
+ returnAST = function_tail_AST;
+}
+
+void AdaParser::generic_inst() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST generic_inst_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(NEW);
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 179 "ada.g"
+ pop_def_id();
+#line 1910 "AdaParser.cpp"
+ }
+ generic_inst_AST = RefAdaAST(currentAST.root);
+ returnAST = generic_inst_AST;
+}
+
+void AdaParser::value_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST value_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ value();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ value();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop445;
+ }
+
+ }
+ _loop445:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ value_s_AST = RefAdaAST(currentAST.root);
+#line 1405 "ada.g"
+ value_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VALUES,"VALUES")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(value_s_AST))));
+#line 1945 "AdaParser.cpp"
+ currentAST.root = value_s_AST;
+ if ( value_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ value_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = value_s_AST->getFirstChild();
+ else
+ currentAST.child = value_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ value_s_AST = RefAdaAST(currentAST.root);
+ returnAST = value_s_AST;
+}
+
+void AdaParser::parenth_values() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST parenth_values_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(LPAREN);
+ value();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ value();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop46;
+ }
+
+ }
+ _loop46:;
+ } // ( ... )*
+ match(RPAREN);
+ parenth_values_AST = RefAdaAST(currentAST.root);
+ returnAST = parenth_values_AST;
+}
+
+void AdaParser::value() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST value_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case OTHERS:
+ {
+ RefAdaAST tmp60_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp60_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp60_AST));
+ }
+ match(OTHERS);
+ match(RIGHT_SHAFT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ ranged_expr_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RIGHT_SHAFT:
+ {
+ RefAdaAST tmp62_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp62_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp62_AST));
+ }
+ match(RIGHT_SHAFT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case COMMA:
+ case RPAREN:
+ case WITH:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ value_AST = RefAdaAST(currentAST.root);
+ returnAST = value_AST;
+}
+
+void AdaParser::ranged_expr_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST ranged_expr_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ ranged_expr();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PIPE)) {
+ RefAdaAST tmp63_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp63_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp63_AST));
+ }
+ match(PIPE);
+ ranged_expr();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop52;
+ }
+
+ }
+ _loop52:;
+ } // ( ... )*
+ ranged_expr_s_AST = RefAdaAST(currentAST.root);
+ returnAST = ranged_expr_s_AST;
+}
+
+void AdaParser::ranged_expr() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST ranged_expr_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case DOT_DOT:
+ {
+ RefAdaAST tmp64_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp64_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp64_AST));
+ }
+ match(DOT_DOT);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RANGE:
+ {
+ RefAdaAST tmp65_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp65_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp65_AST));
+ }
+ match(RANGE);
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case PIPE:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ ranged_expr_AST = RefAdaAST(currentAST.root);
+ returnAST = ranged_expr_AST;
+}
+
+void AdaParser::simple_expression() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST simple_expression_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ signed_term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ RefAdaAST tmp66_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp66_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp66_AST));
+ }
+ match(PLUS);
+ signed_term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case MINUS:
+ {
+ RefAdaAST tmp67_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp67_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp67_AST));
+ }
+ match(MINUS);
+ signed_term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CONCAT:
+ {
+ RefAdaAST tmp68_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp68_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp68_AST));
+ }
+ match(CONCAT);
+ signed_term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop458;
+ }
+ }
+ }
+ _loop458:;
+ } // ( ... )*
+ simple_expression_AST = RefAdaAST(currentAST.root);
+ returnAST = simple_expression_AST;
+}
+
+void AdaParser::range() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched59 = false;
+ if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) {
+ int _m59 = mark();
+ synPredMatched59 = true;
+ inputState->guessing++;
+ try {
+ {
+ range_dots();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched59 = false;
+ }
+ rewind(_m59);
+ inputState->guessing--;
+ }
+ if ( synPredMatched59 ) {
+ range_dots();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENTIFIER) && (LA(2) == LPAREN || LA(2) == DOT || LA(2) == TIC)) {
+ range_attrib_ref();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ range_AST = RefAdaAST(currentAST.root);
+ returnAST = range_AST;
+}
+
+void AdaParser::range_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(RANGE);
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 203 "ada.g"
+ Set(r_AST, RANGE_CONSTRAINT);
+#line 2287 "AdaParser.cpp"
+ }
+ range_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = range_constraint_AST;
+}
+
+void AdaParser::range_dots() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_dots_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ RefAdaAST tmp69_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp69_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp69_AST));
+ }
+ match(DOT_DOT);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_dots_AST = RefAdaAST(currentAST.root);
+ returnAST = range_dots_AST;
+}
+
+void AdaParser::range_attrib_ref() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_attrib_ref_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ prefix();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(TIC);
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(RANGE);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case RANGE:
+ case DIGITS:
+ case IS:
+ case PIPE:
+ case DOT_DOT:
+ case ASSIGN:
+ case THEN:
+ case LOOP:
+ case OR:
+ case AND:
+ case XOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 219 "ada.g"
+ Set(r_AST, RANGE_ATTRIBUTE_REFERENCE);
+#line 2374 "AdaParser.cpp"
+ }
+ range_attrib_ref_AST = RefAdaAST(currentAST.root);
+ returnAST = range_attrib_ref_AST;
+}
+
+void AdaParser::prefix() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prefix_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp73_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp73_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp73_AST));
+ }
+ match(IDENTIFIER);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ RefAdaAST tmp74_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp74_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp74_AST));
+ }
+ match(DOT);
+ {
+ switch ( LA(1)) {
+ case ALL:
+ {
+ RefAdaAST tmp75_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp75_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp75_AST));
+ }
+ match(ALL);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp76_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp76_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp76_AST));
+ }
+ match(IDENTIFIER);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LPAREN);
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 228 "ada.g"
+ Set(p_AST, INDEXED_COMPONENT);
+#line 2450 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop66;
+ }
+ }
+ }
+ _loop66:;
+ } // ( ... )*
+ prefix_AST = RefAdaAST(currentAST.root);
+ returnAST = prefix_AST;
+}
+
+void AdaParser::parameter_specification() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST parameter_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ def_ids_colon();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ mode_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ parameter_specification_AST = RefAdaAST(currentAST.root);
+#line 240 "ada.g"
+ parameter_specification_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(parameter_specification_AST))));
+#line 2492 "AdaParser.cpp"
+ currentAST.root = parameter_specification_AST;
+ if ( parameter_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ parameter_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = parameter_specification_AST->getFirstChild();
+ else
+ currentAST.child = parameter_specification_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameter_specification_AST = RefAdaAST(currentAST.root);
+ returnAST = parameter_specification_AST;
+}
+
+void AdaParser::def_ids_colon() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST def_ids_colon_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ defining_identifier_list();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ def_ids_colon_AST = RefAdaAST(currentAST.root);
+ returnAST = def_ids_colon_AST;
+}
+
+void AdaParser::mode_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST mode_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case IN:
+ {
+ RefAdaAST tmp79_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp79_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp79_AST));
+ }
+ match(IN);
+ {
+ switch ( LA(1)) {
+ case OUT:
+ {
+ RefAdaAST tmp80_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp80_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp80_AST));
+ }
+ match(OUT);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case OUT:
+ {
+ RefAdaAST tmp81_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp81_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp81_AST));
+ }
+ match(OUT);
+ break;
+ }
+ case ACCESS:
+ {
+ RefAdaAST tmp82_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp82_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp82_AST));
+ }
+ match(ACCESS);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ mode_opt_AST = RefAdaAST(currentAST.root);
+#line 255 "ada.g"
+ mode_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mode_opt_AST))));
+#line 2592 "AdaParser.cpp"
+ currentAST.root = mode_opt_AST;
+ if ( mode_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ mode_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = mode_opt_AST->getFirstChild();
+ else
+ currentAST.child = mode_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ mode_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = mode_opt_AST;
+}
+
+void AdaParser::init_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST init_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ match(ASSIGN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ init_opt_AST = RefAdaAST(currentAST.root);
+#line 468 "ada.g"
+ init_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(INIT_OPT,"INIT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(init_opt_AST))));
+#line 2636 "AdaParser.cpp"
+ currentAST.root = init_opt_AST;
+ if ( init_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ init_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = init_opt_AST->getFirstChild();
+ else
+ currentAST.child = init_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ init_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = init_opt_AST;
+}
+
+void AdaParser::defining_identifier_list() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST defining_identifier_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp84_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp84_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp84_AST));
+ }
+ match(IDENTIFIER);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ RefAdaAST tmp86_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp86_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp86_AST));
+ }
+ match(IDENTIFIER);
+ }
+ else {
+ goto _loop75;
+ }
+
+ }
+ _loop75:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ defining_identifier_list_AST = RefAdaAST(currentAST.root);
+#line 249 "ada.g"
+ defining_identifier_list_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DEFINING_IDENTIFIER_LIST,"DEFINING_IDENTIFIER_LIST")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(defining_identifier_list_AST))));
+#line 2683 "AdaParser.cpp"
+ currentAST.root = defining_identifier_list_AST;
+ if ( defining_identifier_list_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ defining_identifier_list_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = defining_identifier_list_AST->getFirstChild();
+ else
+ currentAST.child = defining_identifier_list_AST;
+ currentAST.advanceChildToEnd();
+ }
+ defining_identifier_list_AST = RefAdaAST(currentAST.root);
+ returnAST = defining_identifier_list_AST;
+}
+
+void AdaParser::name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 265 "ada.g"
+ RefAdaAST dummy;
+#line 2704 "AdaParser.cpp"
+
+ RefAdaAST tmp87_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp87_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp87_AST));
+ }
+ match(IDENTIFIER);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ RefAdaAST tmp88_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp88_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp88_AST));
+ }
+ match(DOT);
+ {
+ switch ( LA(1)) {
+ case ALL:
+ {
+ RefAdaAST tmp89_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp89_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp89_AST));
+ }
+ match(ALL);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp90_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp90_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp90_AST));
+ }
+ match(IDENTIFIER);
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp91_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp91_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp91_AST));
+ }
+ match(CHARACTER_LITERAL);
+ break;
+ }
+ case CHAR_STRING:
+ {
+ dummy=is_operator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LPAREN);
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 273 "ada.g"
+ Set(p_AST, INDEXED_COMPONENT);
+#line 2787 "AdaParser.cpp"
+ }
+ break;
+ }
+ case TIC:
+ {
+ RefAdaAST tmp93_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp93_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp93_AST));
+ }
+ match(TIC);
+ attribute_id();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop84;
+ }
+ }
+ }
+ _loop84:;
+ } // ( ... )*
+ name_AST = RefAdaAST(currentAST.root);
+ returnAST = name_AST;
+}
+
+RefAdaAST AdaParser::definable_operator_symbol() {
+#line 285 "ada.g"
+ RefAdaAST d;
+#line 2820 "AdaParser.cpp"
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST definable_operator_symbol_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if (!( definable_operator(LT(1)->getText().c_str()) ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" definable_operator(LT(1)->getText().c_str()) ");
+ op = LT(1);
+ if ( inputState->guessing == 0 ) {
+ op_AST = astFactory->create(op);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST));
+ }
+ match(CHAR_STRING);
+ if ( inputState->guessing==0 ) {
+#line 287 "ada.g"
+ op_AST->setType(OPERATOR_SYMBOL); d=op_AST;
+#line 2838 "AdaParser.cpp"
+ }
+ definable_operator_symbol_AST = RefAdaAST(currentAST.root);
+ returnAST = definable_operator_symbol_AST;
+ return d;
+}
+
+RefAdaAST AdaParser::is_operator() {
+#line 280 "ada.g"
+ RefAdaAST d;
+#line 2848 "AdaParser.cpp"
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST is_operator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken op = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST op_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if (!( is_operator_symbol(LT(1)->getText().c_str()) ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(LT(1)->getText().c_str()) ");
+ op = LT(1);
+ if ( inputState->guessing == 0 ) {
+ op_AST = astFactory->create(op);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(op_AST));
+ }
+ match(CHAR_STRING);
+ if ( inputState->guessing==0 ) {
+#line 282 "ada.g"
+ op_AST->setType(OPERATOR_SYMBOL); d=op_AST;
+#line 2866 "AdaParser.cpp"
+ }
+ is_operator_AST = RefAdaAST(currentAST.root);
+ returnAST = is_operator_AST;
+ return d;
+}
+
+void AdaParser::parenthesized_primary() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST parenthesized_primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pp = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pp_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ pp = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pp_AST = astFactory->create(pp);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pp_AST));
+ }
+ match(LPAREN);
+ {
+ if ((LA(1) == NuLL) && (LA(2) == RECORD)) {
+ RefAdaAST tmp94_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp94_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp94_AST));
+ }
+ match(NuLL);
+ match(RECORD);
+ }
+ else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2)))) {
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ extension_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 295 "ada.g"
+ Set(pp_AST, PARENTHESIZED_PRIMARY);
+#line 2915 "AdaParser.cpp"
+ }
+ parenthesized_primary_AST = RefAdaAST(currentAST.root);
+ returnAST = parenthesized_primary_AST;
+}
+
+void AdaParser::extension_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST extension_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case WITH:
+ {
+ match(WITH);
+ {
+ if ((LA(1) == NuLL) && (LA(2) == RECORD)) {
+ RefAdaAST tmp98_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp98_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp98_AST));
+ }
+ match(NuLL);
+ match(RECORD);
+ }
+ else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_11.member(LA(2)))) {
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ extension_opt_AST = RefAdaAST(currentAST.root);
+#line 299 "ada.g"
+ extension_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXTENSION_OPT,"EXTENSION_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(extension_opt_AST))));
+#line 2969 "AdaParser.cpp"
+ currentAST.root = extension_opt_AST;
+ if ( extension_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ extension_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = extension_opt_AST->getFirstChild();
+ else
+ currentAST.child = extension_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ extension_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = extension_opt_AST;
+}
+
+void AdaParser::separate_or_abstract(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST separate_or_abstract_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case SEPARATE:
+ {
+ match(SEPARATE);
+ if ( inputState->guessing==0 ) {
+#line 315 "ada.g"
+ pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, PROCEDURE_BODY_STUB);
+ else
+ Set(t, FUNCTION_BODY_STUB);
+
+#line 3001 "AdaParser.cpp"
+ }
+ break;
+ }
+ case ABSTRACT:
+ {
+ match(ABSTRACT);
+ if ( inputState->guessing==0 ) {
+#line 322 "ada.g"
+ pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, ABSTRACT_PROCEDURE_DECLARATION);
+ else
+ Set(t, ABSTRACT_FUNCTION_DECLARATION);
+
+#line 3016 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = separate_or_abstract_AST;
+}
+
+RefAdaAST AdaParser::designator() {
+#line 336 "ada.g"
+ RefAdaAST d;
+#line 3031 "AdaParser.cpp"
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST designator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 336 "ada.g"
+ RefAdaAST op;
+#line 3039 "AdaParser.cpp"
+
+ switch ( LA(1)) {
+ case CHAR_STRING:
+ {
+ op=definable_operator_symbol();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 338 "ada.g"
+ d = op;
+#line 3051 "AdaParser.cpp"
+ }
+ designator_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ n = LT(1);
+ if ( inputState->guessing == 0 ) {
+ n_AST = astFactory->create(n);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST));
+ }
+ match(IDENTIFIER);
+ if ( inputState->guessing==0 ) {
+#line 339 "ada.g"
+ d = n_AST;
+#line 3067 "AdaParser.cpp"
+ }
+ designator_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = designator_AST;
+ return d;
+}
+
+void AdaParser::func_formal_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST func_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ func_param();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ func_param();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop100;
+ }
+
+ }
+ _loop100:;
+ } // ( ... )*
+ match(RPAREN);
+ break;
+ }
+ case RETURN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ func_formal_part_opt_AST = RefAdaAST(currentAST.root);
+#line 348 "ada.g"
+ func_formal_part_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FORMAL_PART_OPT,"FORMAL_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_formal_part_opt_AST))));
+#line 3129 "AdaParser.cpp"
+ currentAST.root = func_formal_part_opt_AST;
+ if ( func_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ func_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = func_formal_part_opt_AST->getFirstChild();
+ else
+ currentAST.child = func_formal_part_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ func_formal_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = func_formal_part_opt_AST;
+}
+
+void AdaParser::func_param() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST func_param_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ def_ids_colon();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ in_access_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ func_param_AST = RefAdaAST(currentAST.root);
+#line 354 "ada.g"
+ func_param_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_SPECIFICATION,"PARAMETER_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(func_param_AST))));
+#line 3168 "AdaParser.cpp"
+ currentAST.root = func_param_AST;
+ if ( func_param_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ func_param_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = func_param_AST->getFirstChild();
+ else
+ currentAST.child = func_param_AST;
+ currentAST.advanceChildToEnd();
+ }
+ func_param_AST = RefAdaAST(currentAST.root);
+ returnAST = func_param_AST;
+}
+
+void AdaParser::in_access_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST in_access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case IN:
+ {
+ RefAdaAST tmp105_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp105_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp105_AST));
+ }
+ match(IN);
+ break;
+ }
+ case ACCESS:
+ {
+ RefAdaAST tmp106_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp106_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp106_AST));
+ }
+ match(ACCESS);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ in_access_opt_AST = RefAdaAST(currentAST.root);
+#line 360 "ada.g"
+ in_access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(in_access_opt_AST))));
+#line 3222 "AdaParser.cpp"
+ currentAST.root = in_access_opt_AST;
+ if ( in_access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ in_access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = in_access_opt_AST->getFirstChild();
+ else
+ currentAST.child = in_access_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ in_access_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = in_access_opt_AST;
+}
+
+void AdaParser::pkg_spec_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST pkg_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ basic_declarative_items_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ private_declarative_items_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ pkg_spec_part_AST = RefAdaAST(currentAST.root);
+ returnAST = pkg_spec_part_AST;
+}
+
+void AdaParser::basic_declarative_items_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST basic_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ basic_decl_item();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop114;
+ }
+ }
+ }
+ _loop114:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ basic_declarative_items_opt_AST = RefAdaAST(currentAST.root);
+#line 385 "ada.g"
+ basic_declarative_items_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_opt_AST))));
+#line 3303 "AdaParser.cpp"
+ currentAST.root = basic_declarative_items_opt_AST;
+ if ( basic_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ basic_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = basic_declarative_items_opt_AST->getFirstChild();
+ else
+ currentAST.child = basic_declarative_items_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ basic_declarative_items_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = basic_declarative_items_opt_AST;
+}
+
+void AdaParser::private_declarative_items_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST private_declarative_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ basic_decl_item();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop111;
+ }
+ }
+ }
+ _loop111:;
+ } // ( ... )*
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ private_declarative_items_opt_AST = RefAdaAST(currentAST.root);
+#line 378 "ada.g"
+ private_declarative_items_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_DECLARATIVE_ITEMS_OPT,"PRIVATE_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_declarative_items_opt_AST))));
+#line 3380 "AdaParser.cpp"
+ currentAST.root = private_declarative_items_opt_AST;
+ if ( private_declarative_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ private_declarative_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = private_declarative_items_opt_AST->getFirstChild();
+ else
+ currentAST.child = private_declarative_items_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ private_declarative_items_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = private_declarative_items_opt_AST;
+}
+
+void AdaParser::end_id_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST end_id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ e = LT(1);
+ if ( inputState->guessing == 0 ) {
+ e_AST = astFactory->create(e);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST));
+ }
+ match(END);
+ id_opt_aux();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1176 "ada.g"
+ Set(e_AST, END_ID_OPT);
+#line 3413 "AdaParser.cpp"
+ }
+ end_id_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = end_id_opt_AST;
+}
+
+void AdaParser::basic_decl_item() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST basic_decl_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case PACKAGE:
+ {
+ pkg = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pkg_AST = astFactory->create(pkg);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST));
+ }
+ match(PACKAGE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ spec_decl_part(pkg_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ basic_decl_item_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case TASK:
+ {
+ tsk = LT(1);
+ if ( inputState->guessing == 0 ) {
+ tsk_AST = astFactory->create(tsk);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST));
+ }
+ match(TASK);
+ task_type_or_single_decl(tsk_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ basic_decl_item_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PROTECTED:
+ {
+ pro = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pro_AST = astFactory->create(pro);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST));
+ }
+ match(PROTECTED);
+ prot_type_or_single_decl(pro_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ basic_decl_item_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ subprog_decl(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ basic_decl_item_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ decl_common();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ basic_decl_item_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = basic_decl_item_AST;
+}
+
+void AdaParser::basic_declarative_items() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST basic_declarative_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )+
+ int _cnt117=0;
+ for (;;) {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ basic_decl_item();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ if ( _cnt117>=1 ) { goto _loop117; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt117++;
+ }
+ _loop117:;
+ } // ( ... )+
+ if ( inputState->guessing==0 ) {
+ basic_declarative_items_AST = RefAdaAST(currentAST.root);
+#line 392 "ada.g"
+ basic_declarative_items_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BASIC_DECLARATIVE_ITEMS_OPT,"BASIC_DECLARATIVE_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(basic_declarative_items_AST))));
+#line 3562 "AdaParser.cpp"
+ currentAST.root = basic_declarative_items_AST;
+ if ( basic_declarative_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ basic_declarative_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = basic_declarative_items_AST->getFirstChild();
+ else
+ currentAST.child = basic_declarative_items_AST;
+ currentAST.advanceChildToEnd();
+ }
+ basic_declarative_items_AST = RefAdaAST(currentAST.root);
+ returnAST = basic_declarative_items_AST;
+}
+
+void AdaParser::task_type_or_single_decl(
+ RefAdaAST tsk
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST task_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case TYPE:
+ {
+ match(TYPE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrim_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ task_definition_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 408 "ada.g"
+ Set(tsk, TASK_TYPE_DECLARATION);
+#line 3601 "AdaParser.cpp"
+ }
+ task_type_or_single_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ task_definition_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 410 "ada.g"
+ Set(tsk, SINGLE_TASK_DECLARATION);
+#line 3619 "AdaParser.cpp"
+ }
+ task_type_or_single_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = task_type_or_single_decl_AST;
+}
+
+void AdaParser::prot_type_or_single_decl(
+ RefAdaAST pro
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_type_or_single_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case TYPE:
+ {
+ match(TYPE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrim_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ protected_definition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 539 "ada.g"
+ Set(pro, PROTECTED_TYPE_DECLARATION);
+#line 3658 "AdaParser.cpp"
+ }
+ prot_type_or_single_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ protected_definition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 541 "ada.g"
+ Set(pro, SINGLE_PROTECTED_DECLARATION);
+#line 3676 "AdaParser.cpp"
+ }
+ prot_type_or_single_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = prot_type_or_single_decl_AST;
+}
+
+void AdaParser::decl_common() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST decl_common_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken erd = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST erd_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken ord = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST ord_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken od = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST od_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case TYPE:
+ {
+ t = LT(1);
+ if ( inputState->guessing == 0 ) {
+ t_AST = astFactory->create(t);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST));
+ }
+ match(TYPE);
+ RefAdaAST tmp111_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp111_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp111_AST));
+ }
+ match(IDENTIFIER);
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ type_def(t_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case LPAREN:
+ {
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ discrim_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ derived_or_private_or_record(t_AST, true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 587 "ada.g"
+ Set(t_AST, INCOMPLETE_TYPE_DECLARATION);
+#line 3759 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ empty_discrim_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 590 "ada.g"
+ Set(t_AST, INCOMPLETE_TYPE_DECLARATION);
+#line 3780 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ decl_common_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case SUBTYPE:
+ {
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(SUBTYPE);
+ RefAdaAST tmp115_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp115_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp115_AST));
+ }
+ match(IDENTIFIER);
+ match(IS);
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 604 "ada.g"
+ Set(s_AST, SUBTYPE_DECLARATION);
+#line 3825 "AdaParser.cpp"
+ }
+ decl_common_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case GENERIC:
+ {
+ generic_decl(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ decl_common_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case USE:
+ {
+ use_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ decl_common_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FOR:
+ {
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(FOR);
+ {
+ bool synPredMatched184 = false;
+ if (((LA(1) == IDENTIFIER) && (LA(2) == USE))) {
+ int _m184 = mark();
+ synPredMatched184 = true;
+ inputState->guessing++;
+ try {
+ {
+ local_enum_name();
+ match(USE);
+ match(LPAREN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched184 = false;
+ }
+ rewind(_m184);
+ inputState->guessing--;
+ }
+ if ( synPredMatched184 ) {
+ local_enum_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(USE);
+ enumeration_aggregate();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 609 "ada.g"
+ Set(r_AST, ENUMERATION_REPESENTATION_CLAUSE);
+#line 3888 "AdaParser.cpp"
+ }
+ }
+ else if ((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == USE || LA(2) == TIC)) {
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(USE);
+ rep_spec_part(r_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ match(SEMI);
+ decl_common_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ bool synPredMatched186 = false;
+ if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) {
+ int _m186 = mark();
+ synPredMatched186 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(IDENTIFIER);
+ match(COLON);
+ match(EXCEPTION);
+ match(RENAMES);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched186 = false;
+ }
+ rewind(_m186);
+ inputState->guessing--;
+ }
+ if ( synPredMatched186 ) {
+ RefAdaAST tmp121_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp121_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp121_AST));
+ }
+ match(IDENTIFIER);
+ erd = LT(1);
+ if ( inputState->guessing == 0 ) {
+ erd_AST = astFactory->create(erd);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(erd_AST));
+ }
+ match(COLON);
+ match(EXCEPTION);
+ match(RENAMES);
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 615 "ada.g"
+ Set(erd_AST, EXCEPTION_RENAMING_DECLARATION);
+#line 3954 "AdaParser.cpp"
+ }
+ decl_common_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched188 = false;
+ if (((LA(1) == IDENTIFIER) && (LA(2) == COLON))) {
+ int _m188 = mark();
+ synPredMatched188 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(IDENTIFIER);
+ match(COLON);
+ subtype_mark();
+ match(RENAMES);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched188 = false;
+ }
+ rewind(_m188);
+ inputState->guessing--;
+ }
+ if ( synPredMatched188 ) {
+ RefAdaAST tmp125_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp125_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp125_AST));
+ }
+ match(IDENTIFIER);
+ ord = LT(1);
+ if ( inputState->guessing == 0 ) {
+ ord_AST = astFactory->create(ord);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(ord_AST));
+ }
+ match(COLON);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RENAMES);
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 618 "ada.g"
+ Set(ord_AST, OBJECT_RENAMING_DECLARATION);
+#line 4004 "AdaParser.cpp"
+ }
+ decl_common_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENTIFIER) && (LA(2) == COMMA || LA(2) == COLON)) {
+ defining_identifier_list();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ od = LT(1);
+ if ( inputState->guessing == 0 ) {
+ od_AST = astFactory->create(od);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(od_AST));
+ }
+ match(COLON);
+ {
+ if ((LA(1) == EXCEPTION)) {
+ match(EXCEPTION);
+ if ( inputState->guessing==0 ) {
+#line 621 "ada.g"
+ Set(od_AST, EXCEPTION_DECLARATION);
+#line 4025 "AdaParser.cpp"
+ }
+ }
+ else {
+ bool synPredMatched191 = false;
+ if (((LA(1) == CONSTANT) && (LA(2) == ASSIGN))) {
+ int _m191 = mark();
+ synPredMatched191 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(CONSTANT);
+ match(ASSIGN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched191 = false;
+ }
+ rewind(_m191);
+ inputState->guessing--;
+ }
+ if ( synPredMatched191 ) {
+ match(CONSTANT);
+ match(ASSIGN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 623 "ada.g"
+ Set(od_AST, NUMBER_DECLARATION);
+#line 4056 "AdaParser.cpp"
+ }
+ }
+ else if ((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2)))) {
+ aliased_constant_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case ARRAY:
+ {
+ array_type_definition(od_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 626 "ada.g"
+ Set(od_AST, ARRAY_OBJECT_DECLARATION);
+#line 4079 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 630 "ada.g"
+ Set(od_AST, OBJECT_DECLARATION);
+#line 4096 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ decl_common_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }}
+ returnAST = decl_common_AST;
+}
+
+void AdaParser::discrim_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrim_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ discrim_part_text();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case IS:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ discrim_part_opt_AST = RefAdaAST(currentAST.root);
+#line 420 "ada.g"
+ discrim_part_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_opt_AST))));
+#line 4153 "AdaParser.cpp"
+ currentAST.root = discrim_part_opt_AST;
+ if ( discrim_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discrim_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discrim_part_opt_AST->getFirstChild();
+ else
+ currentAST.child = discrim_part_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discrim_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = discrim_part_opt_AST;
+}
+
+void AdaParser::task_definition_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST task_definition_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ task_items_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ private_task_items_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ task_definition_opt_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 415 "ada.g"
+ pop_def_id();
+#line 4197 "AdaParser.cpp"
+ }
+ task_definition_opt_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = task_definition_opt_AST;
+}
+
+void AdaParser::task_items_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PRAGMA)) {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop138;
+ }
+
+ }
+ _loop138:;
+ } // ( ... )*
+ entrydecls_repspecs_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ task_items_opt_AST = RefAdaAST(currentAST.root);
+#line 473 "ada.g"
+ task_items_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TASK_ITEMS_OPT,"TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(task_items_opt_AST))));
+#line 4239 "AdaParser.cpp"
+ currentAST.root = task_items_opt_AST;
+ if ( task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = task_items_opt_AST->getFirstChild();
+ else
+ currentAST.child = task_items_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ task_items_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = task_items_opt_AST;
+}
+
+void AdaParser::private_task_items_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST private_task_items_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PRAGMA)) {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop163;
+ }
+
+ }
+ _loop163:;
+ } // ( ... )*
+ entrydecls_repspecs_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ private_task_items_opt_AST = RefAdaAST(currentAST.root);
+#line 530 "ada.g"
+ private_task_items_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PRIVATE_TASK_ITEMS_OPT,"PRIVATE_TASK_ITEMS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(private_task_items_opt_AST))));
+#line 4298 "AdaParser.cpp"
+ currentAST.root = private_task_items_opt_AST;
+ if ( private_task_items_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ private_task_items_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = private_task_items_opt_AST->getFirstChild();
+ else
+ currentAST.child = private_task_items_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ private_task_items_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = private_task_items_opt_AST;
+}
+
+void AdaParser::discrim_part_text() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrim_part_text_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(LPAREN);
+ {
+ switch ( LA(1)) {
+ case BOX:
+ {
+ RefAdaAST tmp137_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp137_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp137_AST));
+ }
+ match(BOX);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ discriminant_specifications();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RPAREN);
+ discrim_part_text_AST = RefAdaAST(currentAST.root);
+ returnAST = discrim_part_text_AST;
+}
+
+void AdaParser::discriminant_specifications() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminant_specifications_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ discriminant_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ discriminant_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop130;
+ }
+
+ }
+ _loop130:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ discriminant_specifications_AST = RefAdaAST(currentAST.root);
+#line 450 "ada.g"
+ discriminant_specifications_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATIONS,"DISCRIMINANT_SPECIFICATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specifications_AST))));
+#line 4378 "AdaParser.cpp"
+ currentAST.root = discriminant_specifications_AST;
+ if ( discriminant_specifications_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discriminant_specifications_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discriminant_specifications_AST->getFirstChild();
+ else
+ currentAST.child = discriminant_specifications_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discriminant_specifications_AST = RefAdaAST(currentAST.root);
+ returnAST = discriminant_specifications_AST;
+}
+
+void AdaParser::known_discrim_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST known_discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(LPAREN);
+ discriminant_specifications();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+ known_discrim_part_AST = RefAdaAST(currentAST.root);
+#line 430 "ada.g"
+ known_discrim_part_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(known_discrim_part_AST))));
+#line 4407 "AdaParser.cpp"
+ currentAST.root = known_discrim_part_AST;
+ if ( known_discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ known_discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = known_discrim_part_AST->getFirstChild();
+ else
+ currentAST.child = known_discrim_part_AST;
+ currentAST.advanceChildToEnd();
+ }
+ known_discrim_part_AST = RefAdaAST(currentAST.root);
+ returnAST = known_discrim_part_AST;
+}
+
+void AdaParser::empty_discrim_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST empty_discrim_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if ( inputState->guessing==0 ) {
+ empty_discrim_opt_AST = RefAdaAST(currentAST.root);
+#line 436 "ada.g"
+ empty_discrim_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_discrim_opt_AST))));
+#line 4430 "AdaParser.cpp"
+ currentAST.root = empty_discrim_opt_AST;
+ if ( empty_discrim_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ empty_discrim_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = empty_discrim_opt_AST->getFirstChild();
+ else
+ currentAST.child = empty_discrim_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ empty_discrim_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = empty_discrim_opt_AST;
+}
+
+void AdaParser::discrim_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrim_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ discrim_part_text();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ discrim_part_AST = RefAdaAST(currentAST.root);
+#line 443 "ada.g"
+ discrim_part_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIM_PART_OPT,"DISCRIM_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrim_part_AST))));
+#line 4457 "AdaParser.cpp"
+ currentAST.root = discrim_part_AST;
+ if ( discrim_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discrim_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discrim_part_AST->getFirstChild();
+ else
+ currentAST.child = discrim_part_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discrim_part_AST = RefAdaAST(currentAST.root);
+ returnAST = discrim_part_AST;
+}
+
+void AdaParser::discriminant_specification() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminant_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ def_ids_colon();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ access_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ discriminant_specification_AST = RefAdaAST(currentAST.root);
+#line 457 "ada.g"
+ discriminant_specification_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_SPECIFICATION,"DISCRIMINANT_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_specification_AST))));
+#line 4496 "AdaParser.cpp"
+ currentAST.root = discriminant_specification_AST;
+ if ( discriminant_specification_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discriminant_specification_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discriminant_specification_AST->getFirstChild();
+ else
+ currentAST.child = discriminant_specification_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discriminant_specification_AST = RefAdaAST(currentAST.root);
+ returnAST = discriminant_specification_AST;
+}
+
+void AdaParser::access_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST access_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ACCESS:
+ {
+ RefAdaAST tmp142_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp142_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp142_AST));
+ }
+ match(ACCESS);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ access_opt_AST = RefAdaAST(currentAST.root);
+#line 464 "ada.g"
+ access_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(access_opt_AST))));
+#line 4540 "AdaParser.cpp"
+ currentAST.root = access_opt_AST;
+ if ( access_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ access_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = access_opt_AST->getFirstChild();
+ else
+ currentAST.child = access_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ access_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = access_opt_AST;
+}
+
+void AdaParser::entrydecls_repspecs_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entrydecls_repspecs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == ENTRY)) {
+ entry_declaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case FOR:
+ {
+ rep_spec();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop142;
+ }
+ }
+ }
+ _loop142:;
+ } // ( ... )*
+ }
+ else {
+ goto _loop143;
+ }
+
+ }
+ _loop143:;
+ } // ( ... )*
+ entrydecls_repspecs_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = entrydecls_repspecs_opt_AST;
+}
+
+void AdaParser::entry_declaration() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_declaration_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ e = LT(1);
+ if ( inputState->guessing == 0 ) {
+ e_AST = astFactory->create(e);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST));
+ }
+ match(ENTRY);
+ RefAdaAST tmp143_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp143_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp143_AST));
+ }
+ match(IDENTIFIER);
+ discrete_subtype_def_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 482 "ada.g"
+ Set (e_AST, ENTRY_DECLARATION);
+#line 4635 "AdaParser.cpp"
+ }
+ entry_declaration_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_declaration_AST;
+}
+
+void AdaParser::rep_spec() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST rep_spec_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(FOR);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(USE);
+ rep_spec_part(r_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ rep_spec_AST = RefAdaAST(currentAST.root);
+ returnAST = rep_spec_AST;
+}
+
+void AdaParser::discrete_subtype_def_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrete_subtype_def_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched148 = false;
+ if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) {
+ int _m148 = mark();
+ synPredMatched148 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ discrete_subtype_definition();
+ match(RPAREN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched148 = false;
+ }
+ rewind(_m148);
+ inputState->guessing--;
+ }
+ if ( synPredMatched148 ) {
+ match(LPAREN);
+ discrete_subtype_definition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ }
+ else if ((LA(1) == SEMI || LA(1) == LPAREN) && (_tokenSet_14.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root);
+#line 489 "ada.g"
+ discrete_subtype_def_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRETE_SUBTYPE_DEF_OPT,"DISCRETE_SUBTYPE_DEF_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discrete_subtype_def_opt_AST))));
+#line 4712 "AdaParser.cpp"
+ currentAST.root = discrete_subtype_def_opt_AST;
+ if ( discrete_subtype_def_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discrete_subtype_def_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discrete_subtype_def_opt_AST->getFirstChild();
+ else
+ currentAST.child = discrete_subtype_def_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discrete_subtype_def_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = discrete_subtype_def_opt_AST;
+}
+
+void AdaParser::discrete_subtype_definition() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrete_subtype_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched152 = false;
+ if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) {
+ int _m152 = mark();
+ synPredMatched152 = true;
+ inputState->guessing++;
+ try {
+ {
+ range();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched152 = false;
+ }
+ rewind(_m152);
+ inputState->guessing--;
+ }
+ if ( synPredMatched152 ) {
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENTIFIER) && (_tokenSet_15.member(LA(2)))) {
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ discrete_subtype_definition_AST = RefAdaAST(currentAST.root);
+ returnAST = discrete_subtype_definition_AST;
+}
+
+void AdaParser::subtype_ind() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subtype_ind_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constraint_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ subtype_ind_AST = RefAdaAST(currentAST.root);
+#line 693 "ada.g"
+ subtype_ind_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SUBTYPE_INDICATION,"SUBTYPE_INDICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(subtype_ind_AST))));
+#line 4785 "AdaParser.cpp"
+ currentAST.root = subtype_ind_AST;
+ if ( subtype_ind_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ subtype_ind_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = subtype_ind_AST->getFirstChild();
+ else
+ currentAST.child = subtype_ind_AST;
+ currentAST.advanceChildToEnd();
+ }
+ subtype_ind_AST = RefAdaAST(currentAST.root);
+ returnAST = subtype_ind_AST;
+}
+
+void AdaParser::rep_spec_part(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST rep_spec_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case RECORD:
+ {
+ match(RECORD);
+ align_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ comp_loc_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(RECORD);
+ if ( inputState->guessing==0 ) {
+#line 512 "ada.g"
+ Set(t, RECORD_REPRESENTATION_CLAUSE);
+#line 4822 "AdaParser.cpp"
+ }
+ rep_spec_part_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case AT:
+ {
+ match(AT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 514 "ada.g"
+ Set(t, AT_CLAUSE);
+#line 4837 "AdaParser.cpp"
+ }
+ rep_spec_part_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 517 "ada.g"
+ Set(t, ATTRIBUTE_DEFINITION_CLAUSE);
+#line 4861 "AdaParser.cpp"
+ }
+ rep_spec_part_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = rep_spec_part_AST;
+}
+
+void AdaParser::align_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST align_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case AT:
+ {
+ match(AT);
+ match(MOD);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ align_opt_AST = RefAdaAST(currentAST.root);
+#line 521 "ada.g"
+ align_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MOD_CLAUSE_OPT,"MOD_CLAUSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(align_opt_AST))));
+#line 4908 "AdaParser.cpp"
+ currentAST.root = align_opt_AST;
+ if ( align_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ align_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = align_opt_AST->getFirstChild();
+ else
+ currentAST.child = align_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ align_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = align_opt_AST;
+}
+
+void AdaParser::comp_loc_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST comp_loc_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(AT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RANGE);
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ goto _loop159;
+ }
+ }
+ }
+ _loop159:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ comp_loc_s_AST = RefAdaAST(currentAST.root);
+#line 525 "ada.g"
+ comp_loc_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_CLAUSES_OPT,"COMPONENT_CLAUSES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_loc_s_AST))));
+#line 4968 "AdaParser.cpp"
+ currentAST.root = comp_loc_s_AST;
+ if ( comp_loc_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ comp_loc_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = comp_loc_s_AST->getFirstChild();
+ else
+ currentAST.child = comp_loc_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ comp_loc_s_AST = RefAdaAST(currentAST.root);
+ returnAST = comp_loc_s_AST;
+}
+
+void AdaParser::protected_definition() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST protected_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(IS);
+ prot_op_decl_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ prot_private_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ protected_definition_AST = RefAdaAST(currentAST.root);
+ returnAST = protected_definition_AST;
+}
+
+void AdaParser::prot_private_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_private_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ case PROCEDURE:
+ case FUNCTION:
+ case ENTRY:
+ case FOR:
+ {
+ prot_op_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ comp_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop168;
+ }
+ }
+ }
+ _loop168:;
+ } // ( ... )*
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ prot_private_opt_AST = RefAdaAST(currentAST.root);
+#line 545 "ada.g"
+ prot_private_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_PRIVATE_OPT,"PROT_PRIVATE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_private_opt_AST))));
+#line 5061 "AdaParser.cpp"
+ currentAST.root = prot_private_opt_AST;
+ if ( prot_private_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ prot_private_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = prot_private_opt_AST->getFirstChild();
+ else
+ currentAST.child = prot_private_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ prot_private_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = prot_private_opt_AST;
+}
+
+void AdaParser::prot_op_decl() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_op_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case ENTRY:
+ {
+ entry_declaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ prot_op_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PROCEDURE:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROCEDURE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 561 "ada.g"
+ pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION);
+#line 5113 "AdaParser.cpp"
+ }
+ prot_op_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FUNCTION);
+ def_designator(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 563 "ada.g"
+ pop_def_id(); Set(f_AST, FUNCTION_DECLARATION);
+#line 5138 "AdaParser.cpp"
+ }
+ prot_op_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FOR:
+ {
+ rep_spec();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ prot_op_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ prot_op_decl_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = prot_op_decl_AST;
+}
+
+void AdaParser::comp_decl() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST comp_decl_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ def_ids_colon();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ component_subtype_def();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ init_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+ comp_decl_AST = RefAdaAST(currentAST.root);
+#line 575 "ada.g"
+ comp_decl_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_DECLARATION,"COMPONENT_DECLARATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(comp_decl_AST))));
+#line 5192 "AdaParser.cpp"
+ currentAST.root = comp_decl_AST;
+ if ( comp_decl_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ comp_decl_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = comp_decl_AST->getFirstChild();
+ else
+ currentAST.child = comp_decl_AST;
+ currentAST.advanceChildToEnd();
+ }
+ comp_decl_AST = RefAdaAST(currentAST.root);
+ returnAST = comp_decl_AST;
+}
+
+void AdaParser::prot_op_decl_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_op_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_16.member(LA(1)))) {
+ prot_op_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop172;
+ }
+
+ }
+ _loop172:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ prot_op_decl_s_AST = RefAdaAST(currentAST.root);
+#line 555 "ada.g"
+ prot_op_decl_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_DECLARATIONS,"PROT_OP_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_decl_s_AST))));
+#line 5229 "AdaParser.cpp"
+ currentAST.root = prot_op_decl_s_AST;
+ if ( prot_op_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ prot_op_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = prot_op_decl_s_AST->getFirstChild();
+ else
+ currentAST.child = prot_op_decl_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ prot_op_decl_s_AST = RefAdaAST(currentAST.root);
+ returnAST = prot_op_decl_s_AST;
+}
+
+void AdaParser::prot_member_decl_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_member_decl_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ case PROCEDURE:
+ case FUNCTION:
+ case ENTRY:
+ case FOR:
+ {
+ prot_op_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ comp_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop176;
+ }
+ }
+ }
+ _loop176:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ prot_member_decl_s_AST = RefAdaAST(currentAST.root);
+#line 569 "ada.g"
+ prot_member_decl_s_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_MEMBER_DECLARATIONS,"PROT_MEMBER_DECLARATIONS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_member_decl_s_AST))));
+#line 5283 "AdaParser.cpp"
+ currentAST.root = prot_member_decl_s_AST;
+ if ( prot_member_decl_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ prot_member_decl_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = prot_member_decl_s_AST->getFirstChild();
+ else
+ currentAST.child = prot_member_decl_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ prot_member_decl_s_AST = RefAdaAST(currentAST.root);
+ returnAST = prot_member_decl_s_AST;
+}
+
+void AdaParser::component_subtype_def() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST component_subtype_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ aliased_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ component_subtype_def_AST = RefAdaAST(currentAST.root);
+ returnAST = component_subtype_def_AST;
+}
+
+void AdaParser::type_def(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST type_def_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ enum_id_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 638 "ada.g"
+ Set(t, ENUMERATION_TYPE_DECLARATION);
+#line 5332 "AdaParser.cpp"
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case RANGE:
+ {
+ match(RANGE);
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 640 "ada.g"
+ Set(t, SIGNED_INTEGER_TYPE_DECLARATION);
+#line 5347 "AdaParser.cpp"
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case MOD:
+ {
+ match(MOD);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 642 "ada.g"
+ Set(t, MODULAR_TYPE_DECLARATION);
+#line 5362 "AdaParser.cpp"
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case DIGITS:
+ {
+ match(DIGITS);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_constraint_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 644 "ada.g"
+ Set(t, FLOATING_POINT_DECLARATION);
+#line 5381 "AdaParser.cpp"
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case DELTA:
+ {
+ match(DELTA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case RANGE:
+ {
+ match(RANGE);
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 647 "ada.g"
+ Set(t, ORDINARY_FIXED_POINT_DECLARATION);
+#line 5405 "AdaParser.cpp"
+ }
+ break;
+ }
+ case DIGITS:
+ {
+ match(DIGITS);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_constraint_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 649 "ada.g"
+ Set(t, DECIMAL_FIXED_POINT_DECLARATION);
+#line 5423 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case ARRAY:
+ {
+ array_type_definition(t);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case ACCESS:
+ {
+ access_type_definition(t);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PRIVATE:
+ case NEW:
+ case NuLL:
+ case RECORD:
+ case ABSTRACT:
+ case TAGGED:
+ case LIMITED:
+ {
+ empty_discrim_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ derived_or_private_or_record(t, false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_def_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = type_def_AST;
+}
+
+void AdaParser::derived_or_private_or_record(
+ RefAdaAST t, boolean has_discrim
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST derived_or_private_or_record_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ bool synPredMatched246 = false;
+ if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) {
+ int _m246 = mark();
+ synPredMatched246 = true;
+ inputState->guessing++;
+ try {
+ {
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ match(ABSTRACT);
+ break;
+ }
+ case NEW:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(NEW);
+ subtype_ind();
+ match(WITH);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched246 = false;
+ }
+ rewind(_m246);
+ inputState->guessing--;
+ }
+ if ( synPredMatched246 ) {
+ abstract_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(NEW);
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(WITH);
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ if ( inputState->guessing==0 ) {
+#line 772 "ada.g"
+ Set(t, PRIVATE_EXTENSION_DECLARATION);
+#line 5542 "AdaParser.cpp"
+ }
+ break;
+ }
+ case NuLL:
+ case RECORD:
+ {
+ record_definition(has_discrim);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 774 "ada.g"
+ Set(t, DERIVED_RECORD_EXTENSION);
+#line 5556 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ derived_or_private_or_record_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) {
+ match(NEW);
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 776 "ada.g"
+ Set(t, ORDINARY_DERIVED_TYPE_DECLARATION);
+#line 5577 "AdaParser.cpp"
+ }
+ derived_or_private_or_record_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) {
+ abstract_tagged_limited_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ if ( inputState->guessing==0 ) {
+#line 778 "ada.g"
+ Set(t, PRIVATE_TYPE_DECLARATION);
+#line 5594 "AdaParser.cpp"
+ }
+ break;
+ }
+ case NuLL:
+ case RECORD:
+ {
+ record_definition(has_discrim);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 780 "ada.g"
+ Set(t, RECORD_TYPE_DECLARATION);
+#line 5608 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ derived_or_private_or_record_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = derived_or_private_or_record_AST;
+}
+
+void AdaParser::local_enum_name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST local_enum_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp177_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp177_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp177_AST));
+ }
+ match(IDENTIFIER);
+ local_enum_name_AST = RefAdaAST(currentAST.root);
+ returnAST = local_enum_name_AST;
+}
+
+void AdaParser::enumeration_aggregate() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST enumeration_aggregate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ parenth_values();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ enumeration_aggregate_AST = RefAdaAST(currentAST.root);
+ returnAST = enumeration_aggregate_AST;
+}
+
+void AdaParser::aliased_constant_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST aliased_constant_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ALIASED:
+ {
+ RefAdaAST tmp178_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp178_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp178_AST));
+ }
+ match(ALIASED);
+ break;
+ }
+ case IDENTIFIER:
+ case CONSTANT:
+ case ARRAY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case CONSTANT:
+ {
+ RefAdaAST tmp179_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp179_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp179_AST));
+ }
+ match(CONSTANT);
+ break;
+ }
+ case IDENTIFIER:
+ case ARRAY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ aliased_constant_opt_AST = RefAdaAST(currentAST.root);
+#line 858 "ada.g"
+ aliased_constant_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_constant_opt_AST))));
+#line 5712 "AdaParser.cpp"
+ currentAST.root = aliased_constant_opt_AST;
+ if ( aliased_constant_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ aliased_constant_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = aliased_constant_opt_AST->getFirstChild();
+ else
+ currentAST.child = aliased_constant_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ aliased_constant_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = aliased_constant_opt_AST;
+}
+
+void AdaParser::array_type_definition(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST array_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(ARRAY);
+ match(LPAREN);
+ index_or_discrete_range_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ match(OF);
+ component_subtype_def();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 669 "ada.g"
+ Set(t, ARRAY_TYPE_DECLARATION);
+#line 5747 "AdaParser.cpp"
+ }
+ array_type_definition_AST = RefAdaAST(currentAST.root);
+ returnAST = array_type_definition_AST;
+}
+
+void AdaParser::enum_id_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST enum_id_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ enumeration_literal_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ enumeration_literal_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop197;
+ }
+
+ }
+ _loop197:;
+ } // ( ... )*
+ enum_id_s_AST = RefAdaAST(currentAST.root);
+ returnAST = enum_id_s_AST;
+}
+
+void AdaParser::range_constraint_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case RANGE:
+ {
+ range_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case WITH:
+ case ASSIGN:
+ case LOOP:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ range_constraint_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = range_constraint_opt_AST;
+}
+
+void AdaParser::access_type_definition(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST access_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(ACCESS);
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ case PROTECTED:
+ {
+ protected_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ match(PROCEDURE);
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 751 "ada.g"
+ Set(t, ACCESS_TO_PROCEDURE_DECLARATION);
+#line 5846 "AdaParser.cpp"
+ }
+ break;
+ }
+ case FUNCTION:
+ {
+ match(FUNCTION);
+ func_formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RETURN);
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 753 "ada.g"
+ Set(t, ACCESS_TO_FUNCTION_DECLARATION);
+#line 5865 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case ALL:
+ case CONSTANT:
+ {
+ constant_all_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 756 "ada.g"
+ Set(t, ACCESS_TO_OBJECT_DECLARATION);
+#line 5892 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ access_type_definition_AST = RefAdaAST(currentAST.root);
+ returnAST = access_type_definition_AST;
+}
+
+void AdaParser::enumeration_literal_specification() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST enumeration_literal_specification_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp189_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp189_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp189_AST));
+ }
+ match(IDENTIFIER);
+ enumeration_literal_specification_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp190_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp190_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp190_AST));
+ }
+ match(CHARACTER_LITERAL);
+ enumeration_literal_specification_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = enumeration_literal_specification_AST;
+}
+
+void AdaParser::index_or_discrete_range_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST index_or_discrete_range_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ index_or_discrete_range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ RefAdaAST tmp191_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp191_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp191_AST));
+ }
+ match(COMMA);
+ index_or_discrete_range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop204;
+ }
+
+ }
+ _loop204:;
+ } // ( ... )*
+ index_or_discrete_range_s_AST = RefAdaAST(currentAST.root);
+ returnAST = index_or_discrete_range_s_AST;
+}
+
+void AdaParser::index_or_discrete_range() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST index_or_discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case DOT_DOT:
+ {
+ RefAdaAST tmp192_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp192_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp192_AST));
+ }
+ match(DOT_DOT);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RANGE:
+ {
+ RefAdaAST tmp193_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp193_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp193_AST));
+ }
+ match(RANGE);
+ {
+ switch ( LA(1)) {
+ case BOX:
+ {
+ RefAdaAST tmp194_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp194_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp194_AST));
+ }
+ match(BOX);
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case COMMA:
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ index_or_discrete_range_AST = RefAdaAST(currentAST.root);
+ returnAST = index_or_discrete_range_AST;
+}
+
+void AdaParser::aliased_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST aliased_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ALIASED:
+ {
+ RefAdaAST tmp195_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp195_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp195_AST));
+ }
+ match(ALIASED);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ aliased_opt_AST = RefAdaAST(currentAST.root);
+#line 689 "ada.g"
+ aliased_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(aliased_opt_AST))));
+#line 6093 "AdaParser.cpp"
+ currentAST.root = aliased_opt_AST;
+ if ( aliased_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ aliased_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = aliased_opt_AST->getFirstChild();
+ else
+ currentAST.child = aliased_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ aliased_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = aliased_opt_AST;
+}
+
+void AdaParser::constraint_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST constraint_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case RANGE:
+ {
+ range_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DIGITS:
+ {
+ digits_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DELTA:
+ {
+ delta_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case WITH:
+ case ASSIGN:
+ case LOOP:
+ {
+ break;
+ }
+ default:
+ bool synPredMatched215 = false;
+ if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) {
+ int _m215 = mark();
+ synPredMatched215 = true;
+ inputState->guessing++;
+ try {
+ {
+ index_constraint();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched215 = false;
+ }
+ rewind(_m215);
+ inputState->guessing--;
+ }
+ if ( synPredMatched215 ) {
+ index_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2)))) {
+ discriminant_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ constraint_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = constraint_opt_AST;
+}
+
+void AdaParser::digits_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST digits_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ d = LT(1);
+ if ( inputState->guessing == 0 ) {
+ d_AST = astFactory->create(d);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST));
+ }
+ match(DIGITS);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_constraint_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 706 "ada.g"
+ Set(d_AST, DIGITS_CONSTRAINT);
+#line 6208 "AdaParser.cpp"
+ }
+ digits_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = digits_constraint_AST;
+}
+
+void AdaParser::delta_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST delta_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ d = LT(1);
+ if ( inputState->guessing == 0 ) {
+ d_AST = astFactory->create(d);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST));
+ }
+ match(DELTA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_constraint_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 710 "ada.g"
+ Set(d_AST, DELTA_CONSTRAINT);
+#line 6238 "AdaParser.cpp"
+ }
+ delta_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = delta_constraint_AST;
+}
+
+void AdaParser::index_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST index_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LPAREN);
+ discrete_range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ discrete_range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop220;
+ }
+
+ }
+ _loop220:;
+ } // ( ... )*
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 714 "ada.g"
+ Set(p_AST, INDEX_CONSTRAINT);
+#line 6281 "AdaParser.cpp"
+ }
+ index_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = index_constraint_AST;
+}
+
+void AdaParser::discriminant_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminant_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LPAREN);
+ discriminant_association();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ discriminant_association();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop226;
+ }
+
+ }
+ _loop226:;
+ } // ( ... )*
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 724 "ada.g"
+ Set(p_AST, DISCRIMINANT_CONSTRAINT);
+#line 6324 "AdaParser.cpp"
+ }
+ discriminant_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = discriminant_constraint_AST;
+}
+
+void AdaParser::discrete_range() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrete_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ bool synPredMatched223 = false;
+ if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) {
+ int _m223 = mark();
+ synPredMatched223 = true;
+ inputState->guessing++;
+ try {
+ {
+ range();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched223 = false;
+ }
+ rewind(_m223);
+ inputState->guessing--;
+ }
+ if ( synPredMatched223 ) {
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrete_range_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENTIFIER) && (_tokenSet_19.member(LA(2)))) {
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrete_range_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = discrete_range_AST;
+}
+
+void AdaParser::discriminant_association() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminant_association_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ selector_names_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ discriminant_association_AST = RefAdaAST(currentAST.root);
+#line 728 "ada.g"
+ discriminant_association_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DISCRIMINANT_ASSOCIATION,"DISCRIMINANT_ASSOCIATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(discriminant_association_AST))));
+#line 6390 "AdaParser.cpp"
+ currentAST.root = discriminant_association_AST;
+ if ( discriminant_association_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ discriminant_association_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = discriminant_association_AST->getFirstChild();
+ else
+ currentAST.child = discriminant_association_AST;
+ currentAST.advanceChildToEnd();
+ }
+ discriminant_association_AST = RefAdaAST(currentAST.root);
+ returnAST = discriminant_association_AST;
+}
+
+void AdaParser::selector_names_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST selector_names_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched231 = false;
+ if (((LA(1) == IDENTIFIER) && (LA(2) == RIGHT_SHAFT || LA(2) == PIPE))) {
+ int _m231 = mark();
+ synPredMatched231 = true;
+ inputState->guessing++;
+ try {
+ {
+ association_head();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched231 = false;
+ }
+ rewind(_m231);
+ inputState->guessing--;
+ }
+ if ( synPredMatched231 ) {
+ association_head();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ selector_names_opt_AST = RefAdaAST(currentAST.root);
+#line 736 "ada.g"
+ selector_names_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SELECTOR_NAMES_OPT,"SELECTOR_NAMES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(selector_names_opt_AST))));
+#line 6443 "AdaParser.cpp"
+ currentAST.root = selector_names_opt_AST;
+ if ( selector_names_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ selector_names_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = selector_names_opt_AST->getFirstChild();
+ else
+ currentAST.child = selector_names_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ selector_names_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = selector_names_opt_AST;
+}
+
+void AdaParser::association_head() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST association_head_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ selector_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PIPE)) {
+ match(PIPE);
+ selector_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop234;
+ }
+
+ }
+ _loop234:;
+ } // ( ... )*
+ match(RIGHT_SHAFT);
+ association_head_AST = RefAdaAST(currentAST.root);
+ returnAST = association_head_AST;
+}
+
+void AdaParser::selector_name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST selector_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp202_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp202_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp202_AST));
+ }
+ match(IDENTIFIER);
+ selector_name_AST = RefAdaAST(currentAST.root);
+ returnAST = selector_name_AST;
+}
+
+void AdaParser::protected_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST protected_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PROTECTED:
+ {
+ RefAdaAST tmp203_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp203_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp203_AST));
+ }
+ match(PROTECTED);
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ protected_opt_AST = RefAdaAST(currentAST.root);
+#line 761 "ada.g"
+ protected_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(protected_opt_AST))));
+#line 6533 "AdaParser.cpp"
+ currentAST.root = protected_opt_AST;
+ if ( protected_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ protected_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = protected_opt_AST->getFirstChild();
+ else
+ currentAST.child = protected_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ protected_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = protected_opt_AST;
+}
+
+void AdaParser::constant_all_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST constant_all_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case CONSTANT:
+ {
+ RefAdaAST tmp204_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp204_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp204_AST));
+ }
+ match(CONSTANT);
+ break;
+ }
+ case ALL:
+ {
+ RefAdaAST tmp205_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp205_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp205_AST));
+ }
+ match(ALL);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ constant_all_opt_AST = RefAdaAST(currentAST.root);
+#line 765 "ada.g"
+ constant_all_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(constant_all_opt_AST))));
+#line 6588 "AdaParser.cpp"
+ currentAST.root = constant_all_opt_AST;
+ if ( constant_all_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ constant_all_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = constant_all_opt_AST->getFirstChild();
+ else
+ currentAST.child = constant_all_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ constant_all_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = constant_all_opt_AST;
+}
+
+void AdaParser::abstract_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST abstract_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ RefAdaAST tmp206_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp206_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp206_AST));
+ }
+ match(ABSTRACT);
+ break;
+ }
+ case NEW:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ abstract_opt_AST = RefAdaAST(currentAST.root);
+#line 785 "ada.g"
+ abstract_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_opt_AST))));
+#line 6632 "AdaParser.cpp"
+ currentAST.root = abstract_opt_AST;
+ if ( abstract_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ abstract_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = abstract_opt_AST->getFirstChild();
+ else
+ currentAST.child = abstract_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ abstract_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = abstract_opt_AST;
+}
+
+void AdaParser::record_definition(
+ boolean has_discrim
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST record_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case RECORD:
+ {
+ match(RECORD);
+ component_list(has_discrim);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(RECORD);
+ record_definition_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case NuLL:
+ {
+ match(NuLL);
+ match(RECORD);
+ record_definition_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = record_definition_AST;
+}
+
+void AdaParser::abstract_tagged_limited_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST abstract_tagged_limited_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ RefAdaAST tmp212_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp212_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp212_AST));
+ }
+ match(ABSTRACT);
+ match(TAGGED);
+ break;
+ }
+ case TAGGED:
+ {
+ RefAdaAST tmp214_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp214_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp214_AST));
+ }
+ match(TAGGED);
+ break;
+ }
+ case PRIVATE:
+ case NuLL:
+ case RECORD:
+ case LIMITED:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case LIMITED:
+ {
+ RefAdaAST tmp215_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp215_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp215_AST));
+ }
+ match(LIMITED);
+ break;
+ }
+ case PRIVATE:
+ case NuLL:
+ case RECORD:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root);
+#line 847 "ada.g"
+ abstract_tagged_limited_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abstract_tagged_limited_opt_AST))));
+#line 6750 "AdaParser.cpp"
+ currentAST.root = abstract_tagged_limited_opt_AST;
+ if ( abstract_tagged_limited_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ abstract_tagged_limited_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = abstract_tagged_limited_opt_AST->getFirstChild();
+ else
+ currentAST.child = abstract_tagged_limited_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ abstract_tagged_limited_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = abstract_tagged_limited_opt_AST;
+}
+
+void AdaParser::component_list(
+ boolean has_discrim
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST component_list_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case NuLL:
+ {
+ match(NuLL);
+ match(SEMI);
+ component_list_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ {
+ component_items();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case CASE:
+ {
+ variant_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if (!( has_discrim ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim ");
+ break;
+ }
+ case END:
+ case WHEN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ component_list_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case CASE:
+ {
+ empty_component_items();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ variant_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if (!( has_discrim ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" has_discrim ");
+ component_list_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = component_list_AST;
+}
+
+void AdaParser::component_items() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )+
+ int _cnt256=0;
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ comp_decl();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ if ( _cnt256>=1 ) { goto _loop256; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt256++;
+ }
+ _loop256:;
+ } // ( ... )+
+ if ( inputState->guessing==0 ) {
+ component_items_AST = RefAdaAST(currentAST.root);
+#line 800 "ada.g"
+ component_items_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(component_items_AST))));
+#line 6873 "AdaParser.cpp"
+ currentAST.root = component_items_AST;
+ if ( component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = component_items_AST->getFirstChild();
+ else
+ currentAST.child = component_items_AST;
+ currentAST.advanceChildToEnd();
+ }
+ component_items_AST = RefAdaAST(currentAST.root);
+ returnAST = component_items_AST;
+}
+
+void AdaParser::variant_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST variant_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ c = LT(1);
+ if ( inputState->guessing == 0 ) {
+ c_AST = astFactory->create(c);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST));
+ }
+ match(CASE);
+ discriminant_direct_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ variant_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(CASE);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 812 "ada.g"
+ Set (c_AST, VARIANT_PART);
+#line 6914 "AdaParser.cpp"
+ }
+ variant_part_AST = RefAdaAST(currentAST.root);
+ returnAST = variant_part_AST;
+}
+
+void AdaParser::empty_component_items() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST empty_component_items_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if ( inputState->guessing==0 ) {
+ empty_component_items_AST = RefAdaAST(currentAST.root);
+#line 806 "ada.g"
+ empty_component_items_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(COMPONENT_ITEMS,"COMPONENT_ITEMS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(empty_component_items_AST))));
+#line 6930 "AdaParser.cpp"
+ currentAST.root = empty_component_items_AST;
+ if ( empty_component_items_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ empty_component_items_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = empty_component_items_AST->getFirstChild();
+ else
+ currentAST.child = empty_component_items_AST;
+ currentAST.advanceChildToEnd();
+ }
+ empty_component_items_AST = RefAdaAST(currentAST.root);
+ returnAST = empty_component_items_AST;
+}
+
+void AdaParser::discriminant_direct_name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminant_direct_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp222_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp222_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp222_AST));
+ }
+ match(IDENTIFIER);
+ discriminant_direct_name_AST = RefAdaAST(currentAST.root);
+ returnAST = discriminant_direct_name_AST;
+}
+
+void AdaParser::variant_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST variant_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )+
+ int _cnt262=0;
+ for (;;) {
+ if ((LA(1) == WHEN)) {
+ variant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt262++;
+ }
+ _loop262:;
+ } // ( ... )+
+ if ( inputState->guessing==0 ) {
+ variant_s_AST = RefAdaAST(currentAST.root);
+#line 819 "ada.g"
+ variant_s_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VARIANTS,"VARIANTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(variant_s_AST))));
+#line 6984 "AdaParser.cpp"
+ currentAST.root = variant_s_AST;
+ if ( variant_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ variant_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = variant_s_AST->getFirstChild();
+ else
+ currentAST.child = variant_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ variant_s_AST = RefAdaAST(currentAST.root);
+ returnAST = variant_s_AST;
+}
+
+void AdaParser::variant() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST variant_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ w = LT(1);
+ if ( inputState->guessing == 0 ) {
+ w_AST = astFactory->create(w);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST));
+ }
+ match(WHEN);
+ choice_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RIGHT_SHAFT);
+ component_list(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 823 "ada.g"
+ Set (w_AST, VARIANT);
+#line 7022 "AdaParser.cpp"
+ }
+ variant_AST = RefAdaAST(currentAST.root);
+ returnAST = variant_AST;
+}
+
+void AdaParser::choice_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ choice();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PIPE)) {
+ RefAdaAST tmp224_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp224_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp224_AST));
+ }
+ match(PIPE);
+ choice();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop266;
+ }
+
+ }
+ _loop266:;
+ } // ( ... )*
+ choice_s_AST = RefAdaAST(currentAST.root);
+ returnAST = choice_s_AST;
+}
+
+void AdaParser::choice() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ if ((LA(1) == OTHERS)) {
+ RefAdaAST tmp225_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp225_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp225_AST));
+ }
+ match(OTHERS);
+ choice_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched269 = false;
+ if (((_tokenSet_0.member(LA(1))) && (_tokenSet_20.member(LA(2))))) {
+ int _m269 = mark();
+ synPredMatched269 = true;
+ inputState->guessing++;
+ try {
+ {
+ discrete_with_range();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched269 = false;
+ }
+ rewind(_m269);
+ inputState->guessing--;
+ }
+ if ( synPredMatched269 ) {
+ discrete_with_range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ choice_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_21.member(LA(2)))) {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ choice_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = choice_AST;
+}
+
+void AdaParser::discrete_with_range() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discrete_with_range_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ bool synPredMatched272 = false;
+ if (((LA(1) == IDENTIFIER) && (LA(2) == DOT || LA(2) == TIC || LA(2) == RANGE))) {
+ int _m272 = mark();
+ synPredMatched272 = true;
+ inputState->guessing++;
+ try {
+ {
+ mark_with_constraint();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched272 = false;
+ }
+ rewind(_m272);
+ inputState->guessing--;
+ }
+ if ( synPredMatched272 ) {
+ mark_with_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrete_with_range_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2)))) {
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrete_with_range_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = discrete_with_range_AST;
+}
+
+void AdaParser::mark_with_constraint() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST mark_with_constraint_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_constraint();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ mark_with_constraint_AST = RefAdaAST(currentAST.root);
+#line 839 "ada.g"
+ mark_with_constraint_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MARK_WITH_CONSTRAINT,"MARK_WITH_CONSTRAINT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mark_with_constraint_AST))));
+#line 7174 "AdaParser.cpp"
+ currentAST.root = mark_with_constraint_AST;
+ if ( mark_with_constraint_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ mark_with_constraint_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = mark_with_constraint_AST->getFirstChild();
+ else
+ currentAST.child = mark_with_constraint_AST;
+ currentAST.advanceChildToEnd();
+ }
+ mark_with_constraint_AST = RefAdaAST(currentAST.root);
+ returnAST = mark_with_constraint_AST;
+}
+
+void AdaParser::generic_formal_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST generic_formal_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case USE:
+ {
+ use_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case WITH:
+ case TYPE:
+ {
+ generic_formal_parameter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop289;
+ }
+ }
+ }
+ _loop289:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ generic_formal_part_opt_AST = RefAdaAST(currentAST.root);
+#line 885 "ada.g"
+ generic_formal_part_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(GENERIC_FORMAL_PART,"GENERIC_FORMAL_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(generic_formal_part_opt_AST))));
+#line 7234 "AdaParser.cpp"
+ currentAST.root = generic_formal_part_opt_AST;
+ if ( generic_formal_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ generic_formal_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = generic_formal_part_opt_AST->getFirstChild();
+ else
+ currentAST.child = generic_formal_part_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ generic_formal_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = generic_formal_part_opt_AST;
+}
+
+void AdaParser::generic_formal_parameter() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST generic_formal_parameter_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case TYPE:
+ {
+ t = LT(1);
+ if ( inputState->guessing == 0 ) {
+ t_AST = astFactory->create(t);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST));
+ }
+ match(TYPE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ match(BOX);
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 895 "ada.g"
+ Set (t_AST, FORMAL_DISCRETE_TYPE_DECLARATION);
+#line 7285 "AdaParser.cpp"
+ }
+ break;
+ }
+ case RANGE:
+ {
+ match(RANGE);
+ match(BOX);
+ if ( inputState->guessing==0 ) {
+#line 897 "ada.g"
+ Set (t_AST, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION);
+#line 7296 "AdaParser.cpp"
+ }
+ break;
+ }
+ case MOD:
+ {
+ match(MOD);
+ match(BOX);
+ if ( inputState->guessing==0 ) {
+#line 899 "ada.g"
+ Set (t_AST, FORMAL_MODULAR_TYPE_DECLARATION);
+#line 7307 "AdaParser.cpp"
+ }
+ break;
+ }
+ case DELTA:
+ {
+ match(DELTA);
+ match(BOX);
+ {
+ switch ( LA(1)) {
+ case DIGITS:
+ {
+ match(DIGITS);
+ match(BOX);
+ if ( inputState->guessing==0 ) {
+#line 902 "ada.g"
+ Set (t_AST, FORMAL_DECIMAL_FIXED_POINT_DECLARATION);
+#line 7324 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 903 "ada.g"
+ Set (t_AST, FORMAL_ORDINARY_FIXED_POINT_DECLARATION);
+#line 7333 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case DIGITS:
+ {
+ match(DIGITS);
+ match(BOX);
+ if ( inputState->guessing==0 ) {
+#line 906 "ada.g"
+ Set (t_AST, FORMAL_FLOATING_POINT_DECLARATION);
+#line 7352 "AdaParser.cpp"
+ }
+ break;
+ }
+ case ARRAY:
+ {
+ array_type_definition(t_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case ACCESS:
+ {
+ access_type_definition(t_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRIVATE:
+ case NEW:
+ case ABSTRACT:
+ case TAGGED:
+ case LIMITED:
+ {
+ empty_discrim_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discriminable_type_definition(t_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ discrim_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ discriminable_type_definition(t_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 913 "ada.g"
+ pop_def_id();
+#line 7418 "AdaParser.cpp"
+ }
+ break;
+ }
+ case WITH:
+ {
+ w = LT(1);
+ if ( inputState->guessing == 0 ) {
+ w_AST = astFactory->create(w);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST));
+ }
+ match(WITH);
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ match(PROCEDURE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subprogram_default_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 915 "ada.g"
+ Set(w_AST, FORMAL_PROCEDURE_DECLARATION);
+#line 7450 "AdaParser.cpp"
+ }
+ break;
+ }
+ case FUNCTION:
+ {
+ match(FUNCTION);
+ def_designator(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subprogram_default_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 917 "ada.g"
+ Set(w_AST, FORMAL_FUNCTION_DECLARATION);
+#line 7472 "AdaParser.cpp"
+ }
+ break;
+ }
+ case PACKAGE:
+ {
+ match(PACKAGE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ match(NEW);
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_package_actual_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 919 "ada.g"
+ Set(w_AST, FORMAL_PACKAGE_DECLARATION);
+#line 7496 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 921 "ada.g"
+ pop_def_id();
+#line 7509 "AdaParser.cpp"
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ parameter_specification();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ generic_formal_parameter_AST = RefAdaAST(currentAST.root);
+ returnAST = generic_formal_parameter_AST;
+}
+
+void AdaParser::discriminable_type_definition(
+ RefAdaAST t
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST discriminable_type_definition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ bool synPredMatched299 = false;
+ if (((LA(1) == NEW || LA(1) == ABSTRACT) && (LA(2) == IDENTIFIER || LA(2) == NEW))) {
+ int _m299 = mark();
+ synPredMatched299 = true;
+ inputState->guessing++;
+ try {
+ {
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ match(ABSTRACT);
+ break;
+ }
+ case NEW:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(NEW);
+ subtype_ind();
+ match(WITH);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched299 = false;
+ }
+ rewind(_m299);
+ inputState->guessing--;
+ }
+ if ( synPredMatched299 ) {
+ abstract_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(NEW);
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(WITH);
+ match(PRIVATE);
+ if ( inputState->guessing==0 ) {
+#line 930 "ada.g"
+ Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION);
+#line 7589 "AdaParser.cpp"
+ }
+ discriminable_type_definition_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((LA(1) == NEW) && (LA(2) == IDENTIFIER)) {
+ match(NEW);
+ subtype_ind();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 932 "ada.g"
+ Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION);
+#line 7602 "AdaParser.cpp"
+ }
+ discriminable_type_definition_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((_tokenSet_22.member(LA(1))) && (_tokenSet_23.member(LA(2)))) {
+ abstract_tagged_limited_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(PRIVATE);
+ if ( inputState->guessing==0 ) {
+#line 934 "ada.g"
+ Set (t, FORMAL_PRIVATE_TYPE_DECLARATION);
+#line 7615 "AdaParser.cpp"
+ }
+ discriminable_type_definition_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = discriminable_type_definition_AST;
+}
+
+void AdaParser::subprogram_default_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subprogram_default_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ {
+ switch ( LA(1)) {
+ case BOX:
+ {
+ RefAdaAST tmp253_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp253_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp253_AST));
+ }
+ match(BOX);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subprogram_default_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = subprogram_default_opt_AST;
+}
+
+void AdaParser::formal_package_actual_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST formal_package_actual_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ {
+ switch ( LA(1)) {
+ case BOX:
+ {
+ RefAdaAST tmp255_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp255_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp255_AST));
+ }
+ match(BOX);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ defining_identifier_list();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ formal_package_actual_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = formal_package_actual_part_opt_AST;
+}
+
+void AdaParser::body_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST body_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ declarative_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ block_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ body_part_AST = RefAdaAST(currentAST.root);
+ returnAST = body_part_AST;
+}
+
+void AdaParser::declarative_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST declarative_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ declarative_item();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop316;
+ }
+ }
+ }
+ _loop316:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ declarative_part_AST = RefAdaAST(currentAST.root);
+#line 978 "ada.g"
+ declarative_part_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARATIVE_PART,"DECLARATIVE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declarative_part_AST))));
+#line 7799 "AdaParser.cpp"
+ currentAST.root = declarative_part_AST;
+ if ( declarative_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ declarative_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = declarative_part_AST->getFirstChild();
+ else
+ currentAST.child = declarative_part_AST;
+ currentAST.advanceChildToEnd();
+ }
+ declarative_part_AST = RefAdaAST(currentAST.root);
+ returnAST = declarative_part_AST;
+}
+
+void AdaParser::block_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST block_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken b = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST b_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ b = LT(1);
+ if ( inputState->guessing == 0 ) {
+ b_AST = astFactory->create(b);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(b_AST));
+ }
+ match(BEGIN);
+ handled_stmt_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1058 "ada.g"
+ Set(b_AST, BLOCK_BODY);
+#line 7832 "AdaParser.cpp"
+ }
+ block_body_AST = RefAdaAST(currentAST.root);
+ returnAST = block_body_AST;
+}
+
+void AdaParser::declarative_item() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST declarative_item_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pkg = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pkg_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken tsk = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST tsk_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken pro = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST pro_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PACKAGE:
+ {
+ pkg = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pkg_AST = astFactory->create(pkg);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pkg_AST));
+ }
+ match(PACKAGE);
+ {
+ switch ( LA(1)) {
+ case BODY:
+ {
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case SEPARATE:
+ {
+ separate();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 986 "ada.g"
+ Set(pkg_AST, PACKAGE_BODY_STUB);
+#line 7878 "AdaParser.cpp"
+ }
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case END:
+ case SUBTYPE:
+ case GENERIC:
+ case BEGIN:
+ {
+ pkg_body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 988 "ada.g"
+ Set(pkg_AST, PACKAGE_BODY);
+#line 7904 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ spec_decl_part(pkg_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case TASK:
+ {
+ tsk = LT(1);
+ if ( inputState->guessing == 0 ) {
+ tsk_AST = astFactory->create(tsk);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tsk_AST));
+ }
+ match(TASK);
+ {
+ switch ( LA(1)) {
+ case BODY:
+ {
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case SEPARATE:
+ {
+ separate();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 994 "ada.g"
+ Set(tsk_AST, TASK_BODY_STUB);
+#line 7964 "AdaParser.cpp"
+ }
+ break;
+ }
+ case PRAGMA:
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case PACKAGE:
+ case PROCEDURE:
+ case FUNCTION:
+ case TASK:
+ case PROTECTED:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ case BEGIN:
+ {
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 995 "ada.g"
+ Set(tsk_AST, TASK_BODY);
+#line 7989 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ break;
+ }
+ case IDENTIFIER:
+ case TYPE:
+ {
+ task_type_or_single_decl(tsk_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case PROTECTED:
+ {
+ pro = LT(1);
+ if ( inputState->guessing == 0 ) {
+ pro_AST = astFactory->create(pro);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(pro_AST));
+ }
+ match(PROTECTED);
+ {
+ switch ( LA(1)) {
+ case BODY:
+ {
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case SEPARATE:
+ {
+ separate();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1002 "ada.g"
+ Set(pro_AST, PROTECTED_BODY_STUB);
+#line 8046 "AdaParser.cpp"
+ }
+ break;
+ }
+ case PRAGMA:
+ case PROCEDURE:
+ case FUNCTION:
+ case ENTRY:
+ case END:
+ {
+ prot_op_bodies_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1004 "ada.g"
+ Set(pro_AST, PROTECTED_BODY);
+#line 8067 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case TYPE:
+ {
+ prot_type_or_single_decl(pro_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ subprog_decl_or_rename_or_inst_or_body(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case USE:
+ case TYPE:
+ case FOR:
+ case SUBTYPE:
+ case GENERIC:
+ {
+ decl_common();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ declarative_item_AST = RefAdaAST(currentAST.root);
+ returnAST = declarative_item_AST;
+}
+
+void AdaParser::body_is() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST body_is_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(BODY);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ body_is_AST = RefAdaAST(currentAST.root);
+ returnAST = body_is_AST;
+}
+
+void AdaParser::separate() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST separate_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(SEPARATE);
+ if ( inputState->guessing==0 ) {
+#line 1023 "ada.g"
+ pop_def_id();
+#line 8153 "AdaParser.cpp"
+ }
+ separate_AST = RefAdaAST(currentAST.root);
+ returnAST = separate_AST;
+}
+
+void AdaParser::prot_op_bodies_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST prot_op_bodies_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case ENTRY:
+ {
+ entry_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ subprog_decl_or_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop332;
+ }
+ }
+ }
+ _loop332:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ prot_op_bodies_opt_AST = RefAdaAST(currentAST.root);
+#line 1039 "ada.g"
+ prot_op_bodies_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PROT_OP_BODIES_OPT,"PROT_OP_BODIES_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(prot_op_bodies_opt_AST))));
+#line 8205 "AdaParser.cpp"
+ currentAST.root = prot_op_bodies_opt_AST;
+ if ( prot_op_bodies_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ prot_op_bodies_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = prot_op_bodies_opt_AST->getFirstChild();
+ else
+ currentAST.child = prot_op_bodies_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ prot_op_bodies_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = prot_op_bodies_opt_AST;
+}
+
+void AdaParser::block_body_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST block_body_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ {
+ match(BEGIN);
+ handled_stmt_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ block_body_opt_AST = RefAdaAST(currentAST.root);
+#line 1030 "ada.g"
+ block_body_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_BODY_OPT,"BLOCK_BODY_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_body_opt_AST))));
+#line 8249 "AdaParser.cpp"
+ currentAST.root = block_body_opt_AST;
+ if ( block_body_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ block_body_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = block_body_opt_AST->getFirstChild();
+ else
+ currentAST.child = block_body_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ block_body_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = block_body_opt_AST;
+}
+
+void AdaParser::handled_stmt_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST handled_stmt_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ except_handler_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ handled_stmt_s_AST = RefAdaAST(currentAST.root);
+#line 1062 "ada.g"
+ handled_stmt_s_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_SEQUENCE_OF_STATEMENTS,"HANDLED_SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmt_s_AST))));
+#line 8280 "AdaParser.cpp"
+ currentAST.root = handled_stmt_s_AST;
+ if ( handled_stmt_s_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ handled_stmt_s_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = handled_stmt_s_AST->getFirstChild();
+ else
+ currentAST.child = handled_stmt_s_AST;
+ currentAST.advanceChildToEnd();
+ }
+ handled_stmt_s_AST = RefAdaAST(currentAST.root);
+ returnAST = handled_stmt_s_AST;
+}
+
+void AdaParser::entry_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST e_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ e = LT(1);
+ if ( inputState->guessing == 0 ) {
+ e_AST = astFactory->create(e);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(e_AST));
+ }
+ match(ENTRY);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ entry_body_formal_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ entry_barrier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1236 "ada.g"
+ Set (e_AST, ENTRY_BODY);
+#line 8327 "AdaParser.cpp"
+ }
+ entry_body_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_body_AST;
+}
+
+void AdaParser::subprog_decl_or_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subprog_decl_or_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROCEDURE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1046 "ada.g"
+ Set(p_AST, PROCEDURE_BODY);
+#line 8371 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 1047 "ada.g"
+ pop_def_id(); Set(p_AST, PROCEDURE_DECLARATION);
+#line 8380 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ subprog_decl_or_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FUNCTION);
+ def_designator(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IS:
+ {
+ match(IS);
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1051 "ada.g"
+ Set(f_AST, FUNCTION_BODY);
+#line 8422 "AdaParser.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 1052 "ada.g"
+ pop_def_id(); Set(f_AST, FUNCTION_DECLARATION);
+#line 8431 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ subprog_decl_or_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = subprog_decl_or_body_AST;
+}
+
+void AdaParser::statements() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST statements_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )+
+ int _cnt342=0;
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case NuLL:
+ case RETURN:
+ case FOR:
+ case CASE:
+ case BEGIN:
+ case LT_LT:
+ case IF:
+ case LOOP:
+ case WHILE:
+ case DECLARE:
+ case EXIT:
+ case GOTO:
+ case ACCEPT:
+ case DELAY:
+ case SELECT:
+ case ABORT:
+ case RAISE:
+ case REQUEUE:
+ {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ if ( _cnt342>=1 ) { goto _loop342; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+ }
+ _cnt342++;
+ }
+ _loop342:;
+ } // ( ... )+
+ if ( inputState->guessing==0 ) {
+ statements_AST = RefAdaAST(currentAST.root);
+#line 1074 "ada.g"
+ statements_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SEQUENCE_OF_STATEMENTS,"SEQUENCE_OF_STATEMENTS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statements_AST))));
+#line 8509 "AdaParser.cpp"
+ currentAST.root = statements_AST;
+ if ( statements_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ statements_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = statements_AST->getFirstChild();
+ else
+ currentAST.child = statements_AST;
+ currentAST.advanceChildToEnd();
+ }
+ statements_AST = RefAdaAST(currentAST.root);
+ returnAST = statements_AST;
+}
+
+void AdaParser::except_handler_part_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST except_handler_part_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case EXCEPTION:
+ {
+ match(EXCEPTION);
+ { // ( ... )+
+ int _cnt429=0;
+ for (;;) {
+ if ((LA(1) == WHEN)) {
+ exception_handler();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt429>=1 ) { goto _loop429; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt429++;
+ }
+ _loop429:;
+ } // ( ... )+
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ except_handler_part_opt_AST = RefAdaAST(currentAST.root);
+#line 1365 "ada.g"
+ except_handler_part_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXCEPT_HANDLER_PART_OPT,"EXCEPT_HANDLER_PART_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(except_handler_part_opt_AST))));
+#line 8566 "AdaParser.cpp"
+ currentAST.root = except_handler_part_opt_AST;
+ if ( except_handler_part_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ except_handler_part_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = except_handler_part_opt_AST->getFirstChild();
+ else
+ currentAST.child = except_handler_part_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ except_handler_part_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = except_handler_part_opt_AST;
+}
+
+void AdaParser::handled_stmts_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST handled_stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case PRAGMA:
+ case IDENTIFIER:
+ case NuLL:
+ case RETURN:
+ case FOR:
+ case CASE:
+ case BEGIN:
+ case LT_LT:
+ case IF:
+ case LOOP:
+ case WHILE:
+ case DECLARE:
+ case EXIT:
+ case GOTO:
+ case ACCEPT:
+ case DELAY:
+ case SELECT:
+ case ABORT:
+ case RAISE:
+ case REQUEUE:
+ {
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ except_handler_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ handled_stmts_opt_AST = RefAdaAST(currentAST.root);
+#line 1068 "ada.g"
+ handled_stmts_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(HANDLED_STMTS_OPT,"HANDLED_STMTS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(handled_stmts_opt_AST))));
+#line 8632 "AdaParser.cpp"
+ currentAST.root = handled_stmts_opt_AST;
+ if ( handled_stmts_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ handled_stmts_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = handled_stmts_opt_AST->getFirstChild();
+ else
+ currentAST.child = handled_stmts_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ handled_stmts_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = handled_stmts_opt_AST;
+}
+
+void AdaParser::statement() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST statement_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ def_label_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case NuLL:
+ {
+ null_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case EXIT:
+ {
+ exit_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RETURN:
+ {
+ return_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case GOTO:
+ {
+ goto_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DELAY:
+ {
+ delay_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case ABORT:
+ {
+ abort_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RAISE:
+ {
+ raise_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case REQUEUE:
+ {
+ requeue_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case ACCEPT:
+ {
+ accept_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SELECT:
+ {
+ select_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IF:
+ {
+ if_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CASE:
+ {
+ case_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case FOR:
+ case LOOP:
+ case WHILE:
+ {
+ loop_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case BEGIN:
+ case DECLARE:
+ {
+ block();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(SEMI);
+ break;
+ }
+ default:
+ if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) {
+ statement_identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case FOR:
+ case LOOP:
+ case WHILE:
+ {
+ loop_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case BEGIN:
+ case DECLARE:
+ {
+ block();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else if ((LA(1) == IDENTIFIER) && (_tokenSet_24.member(LA(2)))) {
+ call_or_assignment();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ statement_AST = RefAdaAST(currentAST.root);
+#line 1100 "ada.g"
+ statement_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(STATEMENT,"STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(statement_AST))));
+#line 8833 "AdaParser.cpp"
+ currentAST.root = statement_AST;
+ if ( statement_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ statement_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = statement_AST->getFirstChild();
+ else
+ currentAST.child = statement_AST;
+ currentAST.advanceChildToEnd();
+ }
+ statement_AST = RefAdaAST(currentAST.root);
+ returnAST = statement_AST;
+}
+
+void AdaParser::def_label_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST def_label_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case LT_LT:
+ {
+ match(LT_LT);
+ RefAdaAST tmp277_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp277_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp277_AST));
+ }
+ match(IDENTIFIER);
+ match(GT_GT);
+ break;
+ }
+ case IDENTIFIER:
+ case NuLL:
+ case RETURN:
+ case FOR:
+ case CASE:
+ case BEGIN:
+ case IF:
+ case LOOP:
+ case WHILE:
+ case DECLARE:
+ case EXIT:
+ case GOTO:
+ case ACCEPT:
+ case DELAY:
+ case SELECT:
+ case ABORT:
+ case RAISE:
+ case REQUEUE:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ def_label_opt_AST = RefAdaAST(currentAST.root);
+#line 1104 "ada.g"
+ def_label_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(LABEL_OPT,"LABEL_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(def_label_opt_AST))));
+#line 8896 "AdaParser.cpp"
+ currentAST.root = def_label_opt_AST;
+ if ( def_label_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ def_label_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = def_label_opt_AST->getFirstChild();
+ else
+ currentAST.child = def_label_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ def_label_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = def_label_opt_AST;
+}
+
+void AdaParser::null_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST null_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(NuLL);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1108 "ada.g"
+ Set(s_AST, NULL_STATEMENT);
+#line 8926 "AdaParser.cpp"
+ }
+ null_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = null_stmt_AST;
+}
+
+void AdaParser::exit_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST exit_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(EXIT);
+ {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ label_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case WHEN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case WHEN:
+ {
+ RefAdaAST tmp280_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp280_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp280_AST));
+ }
+ match(WHEN);
+ condition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1206 "ada.g"
+ Set(s_AST, EXIT_STATEMENT);
+#line 8996 "AdaParser.cpp"
+ }
+ exit_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = exit_stmt_AST;
+}
+
+void AdaParser::return_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST return_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(RETURN);
+ {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1213 "ada.g"
+ Set(s_AST, RETURN_STATEMENT);
+#line 9049 "AdaParser.cpp"
+ }
+ return_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = return_stmt_AST;
+}
+
+void AdaParser::goto_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST goto_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(GOTO);
+ label_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1217 "ada.g"
+ Set(s_AST, GOTO_STATEMENT);
+#line 9076 "AdaParser.cpp"
+ }
+ goto_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = goto_stmt_AST;
+}
+
+void AdaParser::delay_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST delay_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken d = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST d_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ d = LT(1);
+ if ( inputState->guessing == 0 ) {
+ d_AST = astFactory->create(d);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST));
+ }
+ match(DELAY);
+ until_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1282 "ada.g"
+ Set (d_AST, DELAY_STATEMENT);
+#line 9107 "AdaParser.cpp"
+ }
+ delay_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = delay_stmt_AST;
+}
+
+void AdaParser::abort_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST abort_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ a = LT(1);
+ if ( inputState->guessing == 0 ) {
+ a_AST = astFactory->create(a);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST));
+ }
+ match(ABORT);
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop425;
+ }
+
+ }
+ _loop425:;
+ } // ( ... )*
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1361 "ada.g"
+ Set (a_AST, ABORT_STATEMENT);
+#line 9150 "AdaParser.cpp"
+ }
+ abort_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = abort_stmt_AST;
+}
+
+void AdaParser::raise_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST raise_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(RAISE);
+ {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1389 "ada.g"
+ Set (r_AST, RAISE_STATEMENT);
+#line 9193 "AdaParser.cpp"
+ }
+ raise_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = raise_stmt_AST;
+}
+
+void AdaParser::requeue_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST requeue_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken r = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST r_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ r = LT(1);
+ if ( inputState->guessing == 0 ) {
+ r_AST = astFactory->create(r);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(r_AST));
+ }
+ match(REQUEUE);
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case WITH:
+ {
+ match(WITH);
+ RefAdaAST tmp289_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp289_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp289_AST));
+ }
+ match(ABORT);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1393 "ada.g"
+ Set (r_AST, REQUEUE_STATEMENT);
+#line 9243 "AdaParser.cpp"
+ }
+ requeue_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = requeue_stmt_AST;
+}
+
+void AdaParser::accept_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST accept_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken a = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST a_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ a = LT(1);
+ if ( inputState->guessing == 0 ) {
+ a_AST = astFactory->create(a);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(a_AST));
+ }
+ match(ACCEPT);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ entry_index_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case DO:
+ {
+ match(DO);
+ handled_stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1264 "ada.g"
+ pop_def_id();
+#line 9296 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 1266 "ada.g"
+ Set (a_AST, ACCEPT_STATEMENT);
+#line 9309 "AdaParser.cpp"
+ }
+ accept_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = accept_stmt_AST;
+}
+
+void AdaParser::select_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST select_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(SELECT);
+ {
+ bool synPredMatched403 = false;
+ if (((LA(1) == IDENTIFIER || LA(1) == DELAY) && (_tokenSet_25.member(LA(2))))) {
+ int _m403 = mark();
+ synPredMatched403 = true;
+ inputState->guessing++;
+ try {
+ {
+ triggering_alternative();
+ match(THEN);
+ match(ABORT);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched403 = false;
+ }
+ rewind(_m403);
+ inputState->guessing--;
+ }
+ if ( synPredMatched403 ) {
+ triggering_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(THEN);
+ match(ABORT);
+ abortable_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1297 "ada.g"
+ Set (s_AST, ASYNCHRONOUS_SELECT);
+#line 9361 "AdaParser.cpp"
+ }
+ }
+ else if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) {
+ selective_accept();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1299 "ada.g"
+ Set (s_AST, SELECTIVE_ACCEPT);
+#line 9372 "AdaParser.cpp"
+ }
+ }
+ else if ((LA(1) == IDENTIFIER) && (_tokenSet_28.member(LA(2)))) {
+ entry_call_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case OR:
+ {
+ match(OR);
+ delay_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1301 "ada.g"
+ Set (s_AST, TIMED_ENTRY_CALL);
+#line 9392 "AdaParser.cpp"
+ }
+ break;
+ }
+ case ELSE:
+ {
+ match(ELSE);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1302 "ada.g"
+ Set (s_AST, CONDITIONAL_ENTRY_CALL);
+#line 9406 "AdaParser.cpp"
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ match(END);
+ match(SELECT);
+ match(SEMI);
+ select_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = select_stmt_AST;
+}
+
+void AdaParser::if_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST if_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(IF);
+ cond_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ elsifs_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ else_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(IF);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1114 "ada.g"
+ Set(s_AST, IF_STATEMENT);
+#line 9460 "AdaParser.cpp"
+ }
+ if_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = if_stmt_AST;
+}
+
+void AdaParser::case_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST case_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(CASE);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ alternative_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(CASE);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1134 "ada.g"
+ Set(s_AST, CASE_STATEMENT);
+#line 9494 "AdaParser.cpp"
+ }
+ case_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = case_stmt_AST;
+}
+
+void AdaParser::loop_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST loop_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken l = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST l_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ iteration_scheme_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ l = LT(1);
+ if ( inputState->guessing == 0 ) {
+ l_AST = astFactory->create(l);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(l_AST));
+ }
+ match(LOOP);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(LOOP);
+ if ( inputState->guessing==0 ) {
+#line 1146 "ada.g"
+ Set(l_AST, LOOP_STATEMENT);
+#line 9526 "AdaParser.cpp"
+ }
+ loop_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = loop_stmt_AST;
+}
+
+void AdaParser::block() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST block_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ declare_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ block_body();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ block_AST = RefAdaAST(currentAST.root);
+#line 1198 "ada.g"
+ block_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(BLOCK_STATEMENT,"BLOCK_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(block_AST))));
+#line 9549 "AdaParser.cpp"
+ currentAST.root = block_AST;
+ if ( block_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ block_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = block_AST->getFirstChild();
+ else
+ currentAST.child = block_AST;
+ currentAST.advanceChildToEnd();
+ }
+ block_AST = RefAdaAST(currentAST.root);
+ returnAST = block_AST;
+}
+
+void AdaParser::statement_identifier() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST statement_identifier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ n = LT(1);
+ if ( inputState->guessing == 0 ) {
+ n_AST = astFactory->create(n);
+ }
+ match(IDENTIFIER);
+ match(COLON);
+ if ( inputState->guessing==0 ) {
+#line 1186 "ada.g"
+ push_def_id(n_AST);
+#line 9578 "AdaParser.cpp"
+ }
+ returnAST = statement_identifier_AST;
+}
+
+void AdaParser::id_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST id_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ id_opt_aux();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ id_opt_AST = RefAdaAST(currentAST.root);
+#line 1172 "ada.g"
+ id_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ID_OPT,"ID_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_opt_AST))));
+#line 9596 "AdaParser.cpp"
+ currentAST.root = id_opt_AST;
+ if ( id_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ id_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = id_opt_AST->getFirstChild();
+ else
+ currentAST.child = id_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ id_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = id_opt_AST;
+}
+
+void AdaParser::call_or_assignment() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST call_or_assignment_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ match(ASSIGN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ call_or_assignment_AST = RefAdaAST(currentAST.root);
+#line 1222 "ada.g"
+ call_or_assignment_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ASSIGNMENT_STATEMENT,"ASSIGNMENT_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST))));
+#line 9632 "AdaParser.cpp"
+ currentAST.root = call_or_assignment_AST;
+ if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = call_or_assignment_AST->getFirstChild();
+ else
+ currentAST.child = call_or_assignment_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+ call_or_assignment_AST = RefAdaAST(currentAST.root);
+#line 1225 "ada.g"
+ call_or_assignment_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CALL_STATEMENT,"CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(call_or_assignment_AST))));
+#line 9650 "AdaParser.cpp"
+ currentAST.root = call_or_assignment_AST;
+ if ( call_or_assignment_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ call_or_assignment_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = call_or_assignment_AST->getFirstChild();
+ else
+ currentAST.child = call_or_assignment_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ call_or_assignment_AST = RefAdaAST(currentAST.root);
+ returnAST = call_or_assignment_AST;
+}
+
+void AdaParser::cond_clause() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST cond_clause_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST c_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ condition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ c = LT(1);
+ if ( inputState->guessing == 0 ) {
+ c_AST = astFactory->create(c);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST));
+ }
+ match(THEN);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1118 "ada.g"
+ Set(c_AST, COND_CLAUSE);
+#line 9696 "AdaParser.cpp"
+ }
+ cond_clause_AST = RefAdaAST(currentAST.root);
+ returnAST = cond_clause_AST;
+}
+
+void AdaParser::elsifs_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST elsifs_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == ELSIF)) {
+ match(ELSIF);
+ cond_clause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop354;
+ }
+
+ }
+ _loop354:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ elsifs_opt_AST = RefAdaAST(currentAST.root);
+#line 1126 "ada.g"
+ elsifs_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSIFS_OPT,"ELSIFS_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(elsifs_opt_AST))));
+#line 9727 "AdaParser.cpp"
+ currentAST.root = elsifs_opt_AST;
+ if ( elsifs_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ elsifs_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = elsifs_opt_AST->getFirstChild();
+ else
+ currentAST.child = elsifs_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ elsifs_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = elsifs_opt_AST;
+}
+
+void AdaParser::else_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST else_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case ELSE:
+ {
+ match(ELSE);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ else_opt_AST = RefAdaAST(currentAST.root);
+#line 1130 "ada.g"
+ else_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELSE_OPT,"ELSE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(else_opt_AST))));
+#line 9770 "AdaParser.cpp"
+ currentAST.root = else_opt_AST;
+ if ( else_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ else_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = else_opt_AST->getFirstChild();
+ else
+ currentAST.child = else_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ else_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = else_opt_AST;
+}
+
+void AdaParser::condition() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST condition_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ condition_AST = RefAdaAST(currentAST.root);
+ returnAST = condition_AST;
+}
+
+void AdaParser::alternative_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST alternative_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )+
+ int _cnt360=0;
+ for (;;) {
+ if ((LA(1) == WHEN)) {
+ case_statement_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt360>=1 ) { goto _loop360; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt360++;
+ }
+ _loop360:;
+ } // ( ... )+
+ alternative_s_AST = RefAdaAST(currentAST.root);
+ returnAST = alternative_s_AST;
+}
+
+void AdaParser::case_statement_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST case_statement_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(WHEN);
+ choice_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RIGHT_SHAFT);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1141 "ada.g"
+ Set(s_AST, CASE_STATEMENT_ALTERNATIVE);
+#line 9847 "AdaParser.cpp"
+ }
+ case_statement_alternative_AST = RefAdaAST(currentAST.root);
+ returnAST = case_statement_alternative_AST;
+}
+
+void AdaParser::iteration_scheme_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST iteration_scheme_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case WHILE:
+ {
+ RefAdaAST tmp316_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp316_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp316_AST));
+ }
+ match(WHILE);
+ condition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case FOR:
+ {
+ RefAdaAST tmp317_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp317_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp317_AST));
+ }
+ match(FOR);
+ RefAdaAST tmp318_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp318_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp318_AST));
+ }
+ match(IDENTIFIER);
+ match(IN);
+ reverse_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ discrete_subtype_definition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LOOP:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ iteration_scheme_opt_AST = RefAdaAST(currentAST.root);
+#line 1152 "ada.g"
+ iteration_scheme_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ITERATION_SCHEME_OPT,"ITERATION_SCHEME_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(iteration_scheme_opt_AST))));
+#line 9914 "AdaParser.cpp"
+ currentAST.root = iteration_scheme_opt_AST;
+ if ( iteration_scheme_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ iteration_scheme_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = iteration_scheme_opt_AST->getFirstChild();
+ else
+ currentAST.child = iteration_scheme_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ iteration_scheme_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = iteration_scheme_opt_AST;
+}
+
+void AdaParser::reverse_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST reverse_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case REVERSE:
+ {
+ RefAdaAST tmp320_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp320_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp320_AST));
+ }
+ match(REVERSE);
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ reverse_opt_AST = RefAdaAST(currentAST.root);
+#line 1158 "ada.g"
+ reverse_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(reverse_opt_AST))));
+#line 9968 "AdaParser.cpp"
+ currentAST.root = reverse_opt_AST;
+ if ( reverse_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ reverse_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = reverse_opt_AST->getFirstChild();
+ else
+ currentAST.child = reverse_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ reverse_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = reverse_opt_AST;
+}
+
+void AdaParser::id_opt_aux() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST id_opt_aux_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 1161 "ada.g"
+ RefAdaAST endid;
+#line 9988 "AdaParser.cpp"
+
+ switch ( LA(1)) {
+ case CHAR_STRING:
+ {
+ endid=definable_operator_symbol();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if (!( end_id_matches_def_id (endid) ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (endid) ");
+ id_opt_aux_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ compound_name();
+ if (inputState->guessing==0) {
+ n_AST = returnAST;
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if (!( end_id_matches_def_id (n_AST) ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" end_id_matches_def_id (n_AST) ");
+ id_opt_aux_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case SEMI:
+ {
+ if ( inputState->guessing==0 ) {
+#line 1168 "ada.g"
+ pop_def_id();
+#line 10019 "AdaParser.cpp"
+ }
+ id_opt_aux_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = id_opt_aux_AST;
+}
+
+void AdaParser::declare_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST declare_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case DECLARE:
+ {
+ match(DECLARE);
+ declarative_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case BEGIN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ declare_opt_AST = RefAdaAST(currentAST.root);
+#line 1202 "ada.g"
+ declare_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DECLARE_OPT,"DECLARE_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(declare_opt_AST))));
+#line 10062 "AdaParser.cpp"
+ currentAST.root = declare_opt_AST;
+ if ( declare_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ declare_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = declare_opt_AST->getFirstChild();
+ else
+ currentAST.child = declare_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ declare_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = declare_opt_AST;
+}
+
+void AdaParser::label_name() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST label_name_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ RefAdaAST tmp322_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp322_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp322_AST));
+ }
+ match(IDENTIFIER);
+ label_name_AST = RefAdaAST(currentAST.root);
+ returnAST = label_name_AST;
+}
+
+void AdaParser::entry_body_formal_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_body_formal_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ entry_index_spec_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ entry_body_formal_part_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_body_formal_part_AST;
+}
+
+void AdaParser::entry_barrier() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_barrier_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(WHEN);
+ condition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ entry_barrier_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_barrier_AST;
+}
+
+void AdaParser::entry_index_spec_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_index_spec_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched388 = false;
+ if (((LA(1) == LPAREN) && (LA(2) == FOR))) {
+ int _m388 = mark();
+ synPredMatched388 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ match(FOR);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched388 = false;
+ }
+ rewind(_m388);
+ inputState->guessing--;
+ }
+ if ( synPredMatched388 ) {
+ match(LPAREN);
+ match(FOR);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IN);
+ discrete_subtype_definition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ }
+ else if ((LA(1) == LPAREN || LA(1) == WHEN) && (_tokenSet_0.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ entry_index_spec_opt_AST = RefAdaAST(currentAST.root);
+#line 1247 "ada.g"
+ entry_index_spec_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_SPECIFICATION,"ENTRY_INDEX_SPECIFICATION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_spec_opt_AST))));
+#line 10170 "AdaParser.cpp"
+ currentAST.root = entry_index_spec_opt_AST;
+ if ( entry_index_spec_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ entry_index_spec_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = entry_index_spec_opt_AST->getFirstChild();
+ else
+ currentAST.child = entry_index_spec_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ entry_index_spec_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_index_spec_opt_AST;
+}
+
+void AdaParser::entry_call_stmt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_call_stmt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+ entry_call_stmt_AST = RefAdaAST(currentAST.root);
+#line 1257 "ada.g"
+ entry_call_stmt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_STATEMENT,"ENTRY_CALL_STATEMENT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_stmt_AST))));
+#line 10198 "AdaParser.cpp"
+ currentAST.root = entry_call_stmt_AST;
+ if ( entry_call_stmt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ entry_call_stmt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = entry_call_stmt_AST->getFirstChild();
+ else
+ currentAST.child = entry_call_stmt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ entry_call_stmt_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_call_stmt_AST;
+}
+
+void AdaParser::entry_index_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_index_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ bool synPredMatched396 = false;
+ if (((LA(1) == LPAREN) && (_tokenSet_0.member(LA(2))))) {
+ int _m396 = mark();
+ synPredMatched396 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ expression();
+ match(RPAREN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched396 = false;
+ }
+ rewind(_m396);
+ inputState->guessing--;
+ }
+ if ( synPredMatched396 ) {
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ }
+ else if ((LA(1) == SEMI || LA(1) == LPAREN || LA(1) == DO) && (_tokenSet_29.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ entry_index_opt_AST = RefAdaAST(currentAST.root);
+#line 1276 "ada.g"
+ entry_index_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_INDEX_OPT,"ENTRY_INDEX_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_index_opt_AST))));
+#line 10255 "AdaParser.cpp"
+ currentAST.root = entry_index_opt_AST;
+ if ( entry_index_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ entry_index_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = entry_index_opt_AST->getFirstChild();
+ else
+ currentAST.child = entry_index_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ entry_index_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_index_opt_AST;
+}
+
+void AdaParser::until_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST until_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case UNTIL:
+ {
+ RefAdaAST tmp331_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp331_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp331_AST));
+ }
+ match(UNTIL);
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ until_opt_AST = RefAdaAST(currentAST.root);
+#line 1286 "ada.g"
+ until_opt_AST = RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(until_opt_AST))));
+#line 10309 "AdaParser.cpp"
+ currentAST.root = until_opt_AST;
+ if ( until_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ until_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = until_opt_AST->getFirstChild();
+ else
+ currentAST.child = until_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ until_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = until_opt_AST;
+}
+
+void AdaParser::triggering_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST triggering_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case DELAY:
+ {
+ delay_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ {
+ entry_call_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ triggering_alternative_AST = RefAdaAST(currentAST.root);
+#line 1310 "ada.g"
+ triggering_alternative_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TRIGGERING_ALTERNATIVE,"TRIGGERING_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(triggering_alternative_AST))));
+#line 10360 "AdaParser.cpp"
+ currentAST.root = triggering_alternative_AST;
+ if ( triggering_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ triggering_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = triggering_alternative_AST->getFirstChild();
+ else
+ currentAST.child = triggering_alternative_AST;
+ currentAST.advanceChildToEnd();
+ }
+ triggering_alternative_AST = RefAdaAST(currentAST.root);
+ returnAST = triggering_alternative_AST;
+}
+
+void AdaParser::abortable_part() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST abortable_part_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ abortable_part_AST = RefAdaAST(currentAST.root);
+#line 1316 "ada.g"
+ abortable_part_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ABORTABLE_PART,"ABORTABLE_PART")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(abortable_part_AST))));
+#line 10387 "AdaParser.cpp"
+ currentAST.root = abortable_part_AST;
+ if ( abortable_part_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ abortable_part_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = abortable_part_AST->getFirstChild();
+ else
+ currentAST.child = abortable_part_AST;
+ currentAST.advanceChildToEnd();
+ }
+ abortable_part_AST = RefAdaAST(currentAST.root);
+ returnAST = abortable_part_AST;
+}
+
+void AdaParser::selective_accept() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST selective_accept_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ guard_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ select_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ or_select_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ else_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ selective_accept_AST = RefAdaAST(currentAST.root);
+ returnAST = selective_accept_AST;
+}
+
+void AdaParser::entry_call_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST entry_call_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ entry_call_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ entry_call_alternative_AST = RefAdaAST(currentAST.root);
+#line 1322 "ada.g"
+ entry_call_alternative_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ENTRY_CALL_ALTERNATIVE,"ENTRY_CALL_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(entry_call_alternative_AST))));
+#line 10443 "AdaParser.cpp"
+ currentAST.root = entry_call_alternative_AST;
+ if ( entry_call_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ entry_call_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = entry_call_alternative_AST->getFirstChild();
+ else
+ currentAST.child = entry_call_alternative_AST;
+ currentAST.advanceChildToEnd();
+ }
+ entry_call_alternative_AST = RefAdaAST(currentAST.root);
+ returnAST = entry_call_alternative_AST;
+}
+
+void AdaParser::delay_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST delay_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ delay_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ delay_alternative_AST = RefAdaAST(currentAST.root);
+#line 1347 "ada.g"
+ delay_alternative_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(DELAY_ALTERNATIVE,"DELAY_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(delay_alternative_AST))));
+#line 10474 "AdaParser.cpp"
+ currentAST.root = delay_alternative_AST;
+ if ( delay_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ delay_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = delay_alternative_AST->getFirstChild();
+ else
+ currentAST.child = delay_alternative_AST;
+ currentAST.advanceChildToEnd();
+ }
+ delay_alternative_AST = RefAdaAST(currentAST.root);
+ returnAST = delay_alternative_AST;
+}
+
+void AdaParser::stmts_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST stmts_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case PRAGMA:
+ {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case NuLL:
+ case RETURN:
+ case FOR:
+ case CASE:
+ case BEGIN:
+ case LT_LT:
+ case IF:
+ case LOOP:
+ case WHILE:
+ case DECLARE:
+ case EXIT:
+ case GOTO:
+ case ACCEPT:
+ case DELAY:
+ case SELECT:
+ case ABORT:
+ case RAISE:
+ case REQUEUE:
+ {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop419;
+ }
+ }
+ }
+ _loop419:;
+ } // ( ... )*
+ stmts_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = stmts_opt_AST;
+}
+
+void AdaParser::guard_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST guard_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case WHEN:
+ {
+ w = LT(1);
+ if ( inputState->guessing == 0 ) {
+ w_AST = astFactory->create(w);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST));
+ }
+ match(WHEN);
+ condition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RIGHT_SHAFT);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PRAGMA)) {
+ pragma();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop413;
+ }
+
+ }
+ _loop413:;
+ } // ( ... )*
+ break;
+ }
+ case ACCEPT:
+ case DELAY:
+ case TERMINATE:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+#line 1331 "ada.g"
+ Set(w_AST, GUARD_OPT);
+#line 10595 "AdaParser.cpp"
+ }
+ guard_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = guard_opt_AST;
+}
+
+void AdaParser::select_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST select_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case ACCEPT:
+ {
+ accept_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ select_alternative_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case DELAY:
+ {
+ delay_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ select_alternative_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case TERMINATE:
+ {
+ t = LT(1);
+ if ( inputState->guessing == 0 ) {
+ t_AST = astFactory->create(t);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST));
+ }
+ match(TERMINATE);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1337 "ada.g"
+ Set(t_AST, TERMINATE_ALTERNATIVE);
+#line 10639 "AdaParser.cpp"
+ }
+ select_alternative_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = select_alternative_AST;
+}
+
+void AdaParser::or_select_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST or_select_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == OR)) {
+ match(OR);
+ guard_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ select_alternative();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop422;
+ }
+
+ }
+ _loop422:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ or_select_opt_AST = RefAdaAST(currentAST.root);
+#line 1356 "ada.g"
+ or_select_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(OR_SELECT_OPT,"OR_SELECT_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(or_select_opt_AST))));
+#line 10682 "AdaParser.cpp"
+ currentAST.root = or_select_opt_AST;
+ if ( or_select_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ or_select_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = or_select_opt_AST->getFirstChild();
+ else
+ currentAST.child = or_select_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ or_select_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = or_select_opt_AST;
+}
+
+void AdaParser::accept_alternative() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST accept_alternative_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ accept_stmt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stmts_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ accept_alternative_AST = RefAdaAST(currentAST.root);
+#line 1341 "ada.g"
+ accept_alternative_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ACCEPT_ALTERNATIVE,"ACCEPT_ALTERNATIVE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(accept_alternative_AST))));
+#line 10713 "AdaParser.cpp"
+ currentAST.root = accept_alternative_AST;
+ if ( accept_alternative_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ accept_alternative_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = accept_alternative_AST->getFirstChild();
+ else
+ currentAST.child = accept_alternative_AST;
+ currentAST.advanceChildToEnd();
+ }
+ accept_alternative_AST = RefAdaAST(currentAST.root);
+ returnAST = accept_alternative_AST;
+}
+
+void AdaParser::exception_handler() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST exception_handler_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken w = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST w_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ w = LT(1);
+ if ( inputState->guessing == 0 ) {
+ w_AST = astFactory->create(w);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(w_AST));
+ }
+ match(WHEN);
+ identifier_colon_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ except_choice_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RIGHT_SHAFT);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1372 "ada.g"
+ Set (w_AST, EXCEPTION_HANDLER);
+#line 10755 "AdaParser.cpp"
+ }
+ exception_handler_AST = RefAdaAST(currentAST.root);
+ returnAST = exception_handler_AST;
+}
+
+void AdaParser::identifier_colon_opt() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST identifier_colon_opt_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ if ((LA(1) == IDENTIFIER) && (LA(2) == COLON)) {
+ RefAdaAST tmp336_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp336_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp336_AST));
+ }
+ match(IDENTIFIER);
+ match(COLON);
+ }
+ else if ((LA(1) == IDENTIFIER || LA(1) == OTHERS) && (LA(2) == RIGHT_SHAFT || LA(2) == DOT || LA(2) == PIPE)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ identifier_colon_opt_AST = RefAdaAST(currentAST.root);
+#line 1376 "ada.g"
+ identifier_colon_opt_AST =
+ RefAdaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(IDENTIFIER_COLON_OPT,"IDENTIFIER_COLON_OPT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(identifier_colon_opt_AST))));
+#line 10788 "AdaParser.cpp"
+ currentAST.root = identifier_colon_opt_AST;
+ if ( identifier_colon_opt_AST!=RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ identifier_colon_opt_AST->getFirstChild() != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = identifier_colon_opt_AST->getFirstChild();
+ else
+ currentAST.child = identifier_colon_opt_AST;
+ currentAST.advanceChildToEnd();
+ }
+ identifier_colon_opt_AST = RefAdaAST(currentAST.root);
+ returnAST = identifier_colon_opt_AST;
+}
+
+void AdaParser::except_choice_s() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST except_choice_s_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ exception_choice();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PIPE)) {
+ RefAdaAST tmp338_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp338_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp338_AST));
+ }
+ match(PIPE);
+ exception_choice();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop435;
+ }
+
+ }
+ _loop435:;
+ } // ( ... )*
+ except_choice_s_AST = RefAdaAST(currentAST.root);
+ returnAST = except_choice_s_AST;
+}
+
+void AdaParser::exception_choice() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST exception_choice_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ compound_name();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exception_choice_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case OTHERS:
+ {
+ RefAdaAST tmp339_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp339_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp339_AST));
+ }
+ match(OTHERS);
+ exception_choice_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = exception_choice_AST;
+}
+
+void AdaParser::operator_call() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST operator_call_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ cs = LT(1);
+ if ( inputState->guessing == 0 ) {
+ cs_AST = astFactory->create(cs);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST));
+ }
+ match(CHAR_STRING);
+ operator_call_tail(cs_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ operator_call_AST = RefAdaAST(currentAST.root);
+ returnAST = operator_call_AST;
+}
+
+void AdaParser::operator_call_tail(
+ RefAdaAST opstr
+) {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST operator_call_tail_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ match(LPAREN);
+ if (!( is_operator_symbol(opstr->getText().c_str()) ))
+ throw ANTLR_USE_NAMESPACE(antlr)SemanticException(" is_operator_symbol(opstr->getText().c_str()) ");
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 1401 "ada.g"
+ opstr->setType(OPERATOR_SYMBOL);
+#line 10908 "AdaParser.cpp"
+ }
+ operator_call_tail_AST = RefAdaAST(currentAST.root);
+ returnAST = operator_call_tail_AST;
+}
+
+void AdaParser::relation() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST relation_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case IN:
+ {
+ RefAdaAST tmp342_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp342_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp342_AST));
+ }
+ match(IN);
+ range_or_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case NOT:
+ {
+ n = LT(1);
+ if ( inputState->guessing == 0 ) {
+ n_AST = astFactory->create(n);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST));
+ }
+ match(NOT);
+ match(IN);
+ range_or_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1425 "ada.g"
+ Set (n_AST, NOT_IN);
+#line 10957 "AdaParser.cpp"
+ }
+ break;
+ }
+ case EQ:
+ {
+ RefAdaAST tmp344_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp344_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp344_AST));
+ }
+ match(EQ);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case NE:
+ {
+ RefAdaAST tmp345_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp345_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp345_AST));
+ }
+ match(NE);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LT_:
+ {
+ RefAdaAST tmp346_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp346_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp346_AST));
+ }
+ match(LT_);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LE:
+ {
+ RefAdaAST tmp347_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp347_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp347_AST));
+ }
+ match(LE);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case GT:
+ {
+ RefAdaAST tmp348_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp348_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp348_AST));
+ }
+ match(GT);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case GE:
+ {
+ RefAdaAST tmp349_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp349_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp349_AST));
+ }
+ match(GE);
+ simple_expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case RANGE:
+ case DIGITS:
+ case IS:
+ case PIPE:
+ case DOT_DOT:
+ case ASSIGN:
+ case THEN:
+ case LOOP:
+ case OR:
+ case AND:
+ case XOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relation_AST = RefAdaAST(currentAST.root);
+ returnAST = relation_AST;
+}
+
+void AdaParser::range_or_mark() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST range_or_mark_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ bool synPredMatched455 = false;
+ if (((_tokenSet_0.member(LA(1))) && (_tokenSet_8.member(LA(2))))) {
+ int _m455 = mark();
+ synPredMatched455 = true;
+ inputState->guessing++;
+ try {
+ {
+ range();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched455 = false;
+ }
+ rewind(_m455);
+ inputState->guessing--;
+ }
+ if ( synPredMatched455 ) {
+ range();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_or_mark_AST = RefAdaAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENTIFIER) && (_tokenSet_30.member(LA(2)))) {
+ subtype_mark();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ range_or_mark_AST = RefAdaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ returnAST = range_or_mark_AST;
+}
+
+void AdaParser::signed_term() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST signed_term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken m = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST m_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PLUS);
+ term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1447 "ada.g"
+ Set(p_AST, UNARY_PLUS);
+#line 11141 "AdaParser.cpp"
+ }
+ signed_term_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case MINUS:
+ {
+ m = LT(1);
+ if ( inputState->guessing == 0 ) {
+ m_AST = astFactory->create(m);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(m_AST));
+ }
+ match(MINUS);
+ term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1448 "ada.g"
+ Set(m_AST, UNARY_MINUS);
+#line 11161 "AdaParser.cpp"
+ }
+ signed_term_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case ABS:
+ case NUMERIC_LIT:
+ {
+ term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ signed_term_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = signed_term_AST;
+}
+
+void AdaParser::term() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST term_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case STAR:
+ {
+ RefAdaAST tmp350_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp350_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp350_AST));
+ }
+ match(STAR);
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DIV:
+ {
+ RefAdaAST tmp351_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp351_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp351_AST));
+ }
+ match(DIV);
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case MOD:
+ {
+ RefAdaAST tmp352_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp352_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp352_AST));
+ }
+ match(MOD);
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case REM:
+ {
+ RefAdaAST tmp353_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp353_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp353_AST));
+ }
+ match(REM);
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop462;
+ }
+ }
+ }
+ _loop462:;
+ } // ( ... )*
+ term_AST = RefAdaAST(currentAST.root);
+ returnAST = term_AST;
+}
+
+void AdaParser::factor() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST factor_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case NOT:
+ {
+ RefAdaAST tmp354_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp354_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp354_AST));
+ }
+ match(NOT);
+ primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case ABS:
+ {
+ RefAdaAST tmp355_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp355_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp355_AST));
+ }
+ match(ABS);
+ primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case LPAREN:
+ case NEW:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NUMERIC_LIT:
+ {
+ primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case EXPON:
+ {
+ RefAdaAST tmp356_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp356_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp356_AST));
+ }
+ match(EXPON);
+ primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case RANGE:
+ case DIGITS:
+ case IS:
+ case PIPE:
+ case DOT_DOT:
+ case IN:
+ case ASSIGN:
+ case MOD:
+ case THEN:
+ case LOOP:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ factor_AST = RefAdaAST(currentAST.root);
+ returnAST = factor_AST;
+}
+
+void AdaParser::primary() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST primary_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken cs = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST cs_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ {
+ switch ( LA(1)) {
+ case IDENTIFIER:
+ {
+ name_or_qualified();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ parenthesized_primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case NEW:
+ {
+ allocator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case NuLL:
+ {
+ RefAdaAST tmp357_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp357_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp357_AST));
+ }
+ match(NuLL);
+ break;
+ }
+ case NUMERIC_LIT:
+ {
+ RefAdaAST tmp358_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp358_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp358_AST));
+ }
+ match(NUMERIC_LIT);
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp359_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp359_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp359_AST));
+ }
+ match(CHARACTER_LITERAL);
+ break;
+ }
+ case CHAR_STRING:
+ {
+ cs = LT(1);
+ if ( inputState->guessing == 0 ) {
+ cs_AST = astFactory->create(cs);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(cs_AST));
+ }
+ match(CHAR_STRING);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ operator_call_tail(cs_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ case RPAREN:
+ case RIGHT_SHAFT:
+ case WITH:
+ case RANGE:
+ case DIGITS:
+ case IS:
+ case PIPE:
+ case DOT_DOT:
+ case IN:
+ case ASSIGN:
+ case MOD:
+ case THEN:
+ case LOOP:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case EXPON:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ primary_AST = RefAdaAST(currentAST.root);
+ returnAST = primary_AST;
+}
+
+void AdaParser::name_or_qualified() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST name_or_qualified_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+#line 1479 "ada.g"
+ RefAdaAST dummy;
+#line 11528 "AdaParser.cpp"
+
+ RefAdaAST tmp360_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp360_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp360_AST));
+ }
+ match(IDENTIFIER);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ RefAdaAST tmp361_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp361_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp361_AST));
+ }
+ match(DOT);
+ {
+ switch ( LA(1)) {
+ case ALL:
+ {
+ RefAdaAST tmp362_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp362_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp362_AST));
+ }
+ match(ALL);
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp363_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp363_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp363_AST));
+ }
+ match(IDENTIFIER);
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp364_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp364_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp364_AST));
+ }
+ match(CHARACTER_LITERAL);
+ break;
+ }
+ case CHAR_STRING:
+ {
+ dummy=is_operator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LPAREN);
+ value_s();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 1487 "ada.g"
+ Set(p_AST, INDEXED_COMPONENT);
+#line 11611 "AdaParser.cpp"
+ }
+ break;
+ }
+ case TIC:
+ {
+ RefAdaAST tmp366_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp366_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp366_AST));
+ }
+ match(TIC);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ parenthesized_primary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENTIFIER:
+ case RANGE:
+ case DIGITS:
+ case DELTA:
+ case ACCESS:
+ {
+ attribute_id();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop473;
+ }
+ }
+ }
+ _loop473:;
+ } // ( ... )*
+ name_or_qualified_AST = RefAdaAST(currentAST.root);
+ returnAST = name_or_qualified_AST;
+}
+
+void AdaParser::allocator() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST allocator_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken n = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST n_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ n = LT(1);
+ if ( inputState->guessing == 0 ) {
+ n_AST = astFactory->create(n);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST));
+ }
+ match(NEW);
+ name_or_qualified();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+#line 1493 "ada.g"
+ Set(n_AST, ALLOCATOR);
+#line 11685 "AdaParser.cpp"
+ }
+ allocator_AST = RefAdaAST(currentAST.root);
+ returnAST = allocator_AST;
+}
+
+void AdaParser::subprogram_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST subprogram_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST f_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROCEDURE);
+ def_id(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formal_part_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1507 "ada.g"
+ pop_def_id(); Set(p_AST, PROCEDURE_BODY);
+#line 11726 "AdaParser.cpp"
+ }
+ subprogram_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FUNCTION);
+ def_designator(false);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ function_tail();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(IS);
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1509 "ada.g"
+ pop_def_id(); Set(f_AST, FUNCTION_BODY);
+#line 11756 "AdaParser.cpp"
+ }
+ subprogram_body_AST = RefAdaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = subprogram_body_AST;
+}
+
+void AdaParser::package_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST package_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PACKAGE);
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ pkg_body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1513 "ada.g"
+ Set(p_AST, PACKAGE_BODY);
+#line 11794 "AdaParser.cpp"
+ }
+ package_body_AST = RefAdaAST(currentAST.root);
+ returnAST = package_body_AST;
+}
+
+void AdaParser::task_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST task_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST t_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ t = LT(1);
+ if ( inputState->guessing == 0 ) {
+ t_AST = astFactory->create(t);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(t_AST));
+ }
+ match(TASK);
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ body_part();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1517 "ada.g"
+ Set(t_AST, TASK_BODY);
+#line 11825 "AdaParser.cpp"
+ }
+ task_body_AST = RefAdaAST(currentAST.root);
+ returnAST = task_body_AST;
+}
+
+void AdaParser::protected_body() {
+ returnAST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefAdaAST protected_body_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefAdaAST p_AST = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(PROTECTED);
+ body_is();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ prot_op_bodies_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ end_id_opt();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 1521 "ada.g"
+ Set(p_AST, PROTECTED_BODY);
+#line 11860 "AdaParser.cpp"
+ }
+ protected_body_AST = RefAdaAST(currentAST.root);
+ returnAST = protected_body_AST;
+}
+
+void AdaParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
+{
+ factory.setMaxNodeType(289);
+}
+const char* AdaParser::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "\"pragma\"",
+ "IDENTIFIER",
+ "SEMI",
+ "LPAREN",
+ "COMMA",
+ "RPAREN",
+ "RIGHT_SHAFT",
+ "\"with\"",
+ "DOT",
+ "\"use\"",
+ "\"type\"",
+ "TIC",
+ "\"range\"",
+ "\"digits\"",
+ "\"delta\"",
+ "\"access\"",
+ "\"private\"",
+ "\"package\"",
+ "\"body\"",
+ "\"is\"",
+ "\"procedure\"",
+ "\"function\"",
+ "\"new\"",
+ "\"others\"",
+ "PIPE",
+ "DOT_DOT",
+ "\"all\"",
+ "COLON",
+ "\"in\"",
+ "\"out\"",
+ "\"renames\"",
+ "CHARACTER_LITERAL",
+ "CHAR_STRING",
+ "\"null\"",
+ "\"record\"",
+ "\"separate\"",
+ "\"abstract\"",
+ "\"return\"",
+ "\"task\"",
+ "\"protected\"",
+ "BOX",
+ "ASSIGN",
+ "\"entry\"",
+ "\"for\"",
+ "\"end\"",
+ "\"at\"",
+ "\"mod\"",
+ "\"subtype\"",
+ "\"exception\"",
+ "\"constant\"",
+ "\"array\"",
+ "\"of\"",
+ "\"aliased\"",
+ "\"case\"",
+ "\"when\"",
+ "\"tagged\"",
+ "\"limited\"",
+ "\"generic\"",
+ "\"begin\"",
+ "LT_LT",
+ "GT_GT",
+ "\"if\"",
+ "\"then\"",
+ "\"elsif\"",
+ "\"else\"",
+ "\"loop\"",
+ "\"while\"",
+ "\"reverse\"",
+ "\"declare\"",
+ "\"exit\"",
+ "\"goto\"",
+ "\"accept\"",
+ "\"do\"",
+ "\"delay\"",
+ "\"until\"",
+ "\"select\"",
+ "\"abort\"",
+ "\"or\"",
+ "\"terminate\"",
+ "\"raise\"",
+ "\"requeue\"",
+ "\"and\"",
+ "\"xor\"",
+ "\"not\"",
+ "EQ",
+ "NE",
+ "LT_",
+ "LE",
+ "GT",
+ "GE",
+ "PLUS",
+ "MINUS",
+ "CONCAT",
+ "STAR",
+ "DIV",
+ "\"rem\"",
+ "\"abs\"",
+ "EXPON",
+ "NUMERIC_LIT",
+ "ABORTABLE_PART",
+ "ABORT_STATEMENT",
+ "ACCEPT_ALTERNATIVE",
+ "ACCEPT_STATEMENT",
+ "ALLOCATOR",
+ "ASSIGNMENT_STATEMENT",
+ "ASYNCHRONOUS_SELECT",
+ "ATTRIBUTE_DEFINITION_CLAUSE",
+ "AT_CLAUSE",
+ "BLOCK_STATEMENT",
+ "CASE_STATEMENT",
+ "CASE_STATEMENT_ALTERNATIVE",
+ "CODE_STATEMENT",
+ "COMPONENT_DECLARATION",
+ "CONDITIONAL_ENTRY_CALL",
+ "CONTEXT_CLAUSE",
+ "DECLARATIVE_PART",
+ "DEFINING_IDENTIFIER_LIST",
+ "DELAY_ALTERNATIVE",
+ "DELAY_STATEMENT",
+ "DELTA_CONSTRAINT",
+ "DIGITS_CONSTRAINT",
+ "DISCRIMINANT_ASSOCIATION",
+ "DISCRIMINANT_CONSTRAINT",
+ "DISCRIMINANT_SPECIFICATION",
+ "ENTRY_BODY",
+ "ENTRY_CALL_ALTERNATIVE",
+ "ENTRY_CALL_STATEMENT",
+ "ENTRY_DECLARATION",
+ "ENTRY_INDEX_SPECIFICATION",
+ "ENUMERATION_REPESENTATION_CLAUSE",
+ "EXCEPTION_DECLARATION",
+ "EXCEPTION_HANDLER",
+ "EXCEPTION_RENAMING_DECLARATION",
+ "EXIT_STATEMENT",
+ "FORMAL_PACKAGE_DECLARATION",
+ "GENERIC_FORMAL_PART",
+ "GENERIC_PACKAGE_DECLARATION",
+ "GOTO_STATEMENT",
+ "HANDLED_SEQUENCE_OF_STATEMENTS",
+ "HANDLED_STMTS_OPT",
+ "IF_STATEMENT",
+ "INCOMPLETE_TYPE_DECLARATION",
+ "INDEXED_COMPONENT",
+ "INDEX_CONSTRAINT",
+ "LIBRARY_ITEM",
+ "LOOP_STATEMENT",
+ "NAME",
+ "NULL_STATEMENT",
+ "NUMBER_DECLARATION",
+ "OBJECT_DECLARATION",
+ "OBJECT_RENAMING_DECLARATION",
+ "OPERATOR_SYMBOL",
+ "PACKAGE_BODY",
+ "PACKAGE_BODY_STUB",
+ "PACKAGE_RENAMING_DECLARATION",
+ "PACKAGE_SPECIFICATION",
+ "PARAMETER_SPECIFICATION",
+ "PRIVATE_EXTENSION_DECLARATION",
+ "PRIVATE_TYPE_DECLARATION",
+ "PROTECTED_BODY",
+ "PROTECTED_BODY_STUB",
+ "PROTECTED_TYPE_DECLARATION",
+ "RAISE_STATEMENT",
+ "RANGE_ATTRIBUTE_REFERENCE",
+ "RECORD_REPRESENTATION_CLAUSE",
+ "REQUEUE_STATEMENT",
+ "RETURN_STATEMENT",
+ "SELECTIVE_ACCEPT",
+ "SEQUENCE_OF_STATEMENTS",
+ "SINGLE_PROTECTED_DECLARATION",
+ "SINGLE_TASK_DECLARATION",
+ "STATEMENT",
+ "SUBTYPE_DECLARATION",
+ "SUBTYPE_INDICATION",
+ "SUBTYPE_MARK",
+ "SUBUNIT",
+ "TASK_BODY",
+ "TASK_BODY_STUB",
+ "TASK_TYPE_DECLARATION",
+ "TERMINATE_ALTERNATIVE",
+ "TIMED_ENTRY_CALL",
+ "TRIGGERING_ALTERNATIVE",
+ "USE_CLAUSE",
+ "USE_TYPE_CLAUSE",
+ "VARIANT",
+ "VARIANT_PART",
+ "WITH_CLAUSE",
+ "ABSTRACT_FUNCTION_DECLARATION",
+ "ABSTRACT_PROCEDURE_DECLARATION",
+ "ACCESS_TO_FUNCTION_DECLARATION",
+ "ACCESS_TO_OBJECT_DECLARATION",
+ "ACCESS_TO_PROCEDURE_DECLARATION",
+ "ARRAY_OBJECT_DECLARATION",
+ "ARRAY_TYPE_DECLARATION",
+ "AND_THEN",
+ "BASIC_DECLARATIVE_ITEMS_OPT",
+ "BLOCK_BODY",
+ "BLOCK_BODY_OPT",
+ "CALL_STATEMENT",
+ "COMPONENT_CLAUSES_OPT",
+ "COMPONENT_ITEMS",
+ "COND_CLAUSE",
+ "DECIMAL_FIXED_POINT_DECLARATION",
+ "DECLARE_OPT",
+ "DERIVED_RECORD_EXTENSION",
+ "DISCRETE_SUBTYPE_DEF_OPT",
+ "DISCRIMINANT_SPECIFICATIONS",
+ "DISCRIM_PART_OPT",
+ "ELSE_OPT",
+ "ELSIFS_OPT",
+ "END_ID_OPT",
+ "ENTRY_INDEX_OPT",
+ "ENUMERATION_TYPE_DECLARATION",
+ "EXCEPT_HANDLER_PART_OPT",
+ "EXTENSION_OPT",
+ "FLOATING_POINT_DECLARATION",
+ "FORMAL_DECIMAL_FIXED_POINT_DECLARATION",
+ "FORMAL_DISCRETE_TYPE_DECLARATION",
+ "FORMAL_FLOATING_POINT_DECLARATION",
+ "FORMAL_FUNCTION_DECLARATION",
+ "FORMAL_MODULAR_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_FIXED_POINT_DECLARATION",
+ "FORMAL_PART_OPT",
+ "FORMAL_PRIVATE_EXTENSION_DECLARATION",
+ "FORMAL_PRIVATE_TYPE_DECLARATION",
+ "FORMAL_PROCEDURE_DECLARATION",
+ "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION",
+ "FUNCTION_BODY",
+ "FUNCTION_BODY_STUB",
+ "FUNCTION_DECLARATION",
+ "FUNCTION_RENAMING_DECLARATION",
+ "GENERIC_FUNCTION_DECLARATION",
+ "GENERIC_FUNCTION_INSTANTIATION",
+ "GENERIC_FUNCTION_RENAMING",
+ "GENERIC_PACKAGE_INSTANTIATION",
+ "GENERIC_PACKAGE_RENAMING",
+ "GENERIC_PROCEDURE_DECLARATION",
+ "GENERIC_PROCEDURE_INSTANTIATION",
+ "GENERIC_PROCEDURE_RENAMING",
+ "GUARD_OPT",
+ "IDENTIFIER_COLON_OPT",
+ "ID_OPT",
+ "INIT_OPT",
+ "ITERATION_SCHEME_OPT",
+ "LABEL_OPT",
+ "MARK_WITH_CONSTRAINT",
+ "MODIFIERS",
+ "MODULAR_TYPE_DECLARATION",
+ "MOD_CLAUSE_OPT",
+ "NOT_IN",
+ "ORDINARY_DERIVED_TYPE_DECLARATION",
+ "ORDINARY_FIXED_POINT_DECLARATION",
+ "OR_ELSE",
+ "OR_SELECT_OPT",
+ "PARENTHESIZED_PRIMARY",
+ "PRIVATE_DECLARATIVE_ITEMS_OPT",
+ "PRIVATE_TASK_ITEMS_OPT",
+ "PROCEDURE_BODY",
+ "PROCEDURE_BODY_STUB",
+ "PROCEDURE_DECLARATION",
+ "PROCEDURE_RENAMING_DECLARATION",
+ "PROT_MEMBER_DECLARATIONS",
+ "PROT_OP_BODIES_OPT",
+ "PROT_OP_DECLARATIONS",
+ "PROT_PRIVATE_OPT",
+ "RANGED_EXPRS",
+ "RANGE_CONSTRAINT",
+ "RECORD_TYPE_DECLARATION",
+ "SELECTOR_NAMES_OPT",
+ "SIGNED_INTEGER_TYPE_DECLARATION",
+ "TASK_ITEMS_OPT",
+ "UNARY_MINUS",
+ "UNARY_PLUS",
+ "VALUE",
+ "VALUES",
+ "VARIANTS",
+ "COMMENT_INTRO",
+ "OX",
+ "TIC_OR_CHARACTER_LITERAL",
+ "DIGIT",
+ "EXPONENT",
+ "EXTENDED_DIGIT",
+ "BASED_INTEGER",
+ "WS_",
+ "COMMENT",
+ 0
+};
+
+const unsigned long AdaParser::_tokenSet_0_data_[] = { 67109024UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "not" PLUS
+// MINUS "abs" NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_0(_tokenSet_0_data_,10);
+const unsigned long AdaParser::_tokenSet_1_data_[] = { 201364384UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN COMMA RPAREN DOT TIC "new" "others" "in" CHARACTER_LITERAL
+// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS
+// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_1(_tokenSet_1_data_,10);
+const unsigned long AdaParser::_tokenSet_2_data_[] = { 8388800UL, 4UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN "is" "renames"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_2(_tokenSet_2_data_,10);
+const unsigned long AdaParser::_tokenSet_3_data_[] = { 52453426UL, 1611238800UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "pragma" IDENTIFIER "use" "type" "package" "procedure" "function"
+// CHAR_STRING "separate" "abstract" "task" "protected" "for" "end" "subtype"
+// "generic" "begin"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_3(_tokenSet_3_data_,10);
+const unsigned long AdaParser::_tokenSet_4_data_[] = { 8392896UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN DOT "is" "in" "renames" "when" "do"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_4(_tokenSet_4_data_,10);
+const unsigned long AdaParser::_tokenSet_5_data_[] = { 8388800UL, 67108869UL, 4096UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN "is" "in" "renames" "when" "do"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_5(_tokenSet_5_data_,10);
+const unsigned long AdaParser::_tokenSet_6_data_[] = { 53502002UL, 537496976UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "pragma" IDENTIFIER "use" "type" "private" "package" "procedure"
+// "function" CHAR_STRING "separate" "abstract" "task" "protected" "for"
+// "end" "subtype" "generic"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_6(_tokenSet_6_data_,10);
+const unsigned long AdaParser::_tokenSet_7_data_[] = { 8392832UL, 512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN DOT "is" "return"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_7(_tokenSet_7_data_,10);
+const unsigned long AdaParser::_tokenSet_8_data_[] = { 738234528UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN DOT TIC "new" "others" DOT_DOT CHARACTER_LITERAL CHAR_STRING
+// "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_8(_tokenSet_8_data_,10);
+const unsigned long AdaParser::_tokenSet_9_data_[] = { 201326752UL, 56UL, 3229614080UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN "new" "others" CHARACTER_LITERAL CHAR_STRING "null"
+// "not" PLUS MINUS "abs" NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_9(_tokenSet_9_data_,10);
+const unsigned long AdaParser::_tokenSet_10_data_[] = { 1006739360UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "new"
+// "others" PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod"
+// "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV
+// "rem" "abs" EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_10(_tokenSet_10_data_,10);
+const unsigned long AdaParser::_tokenSet_11_data_[] = { 1006737312UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN COMMA RPAREN RIGHT_SHAFT DOT TIC "range" "new" "others"
+// PIPE DOT_DOT "in" CHARACTER_LITERAL CHAR_STRING "null" "mod" "or" "and"
+// "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR DIV "rem" "abs"
+// EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_11(_tokenSet_11_data_,10);
+const unsigned long AdaParser::_tokenSet_12_data_[] = { 32UL, 23068672UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER "constant" "array" "aliased"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_12(_tokenSet_12_data_,10);
+const unsigned long AdaParser::_tokenSet_13_data_[] = { 495840UL, 6299648UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER SEMI LPAREN DOT TIC "range" "digits" "delta" ASSIGN "constant"
+// "array"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_13(_tokenSet_13_data_,10);
+const unsigned long AdaParser::_tokenSet_14_data_[] = { 51380274UL, 114688UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "pragma" IDENTIFIER "private" "procedure" "function" "entry" "for"
+// "end"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_14(_tokenSet_14_data_,10);
+const unsigned long AdaParser::_tokenSet_15_data_[] = { 496256UL, 0UL, 32UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN RPAREN DOT TIC "range" "digits" "delta" "loop"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_15(_tokenSet_15_data_,10);
+const unsigned long AdaParser::_tokenSet_16_data_[] = { 50331664UL, 49152UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "pragma" "procedure" "function" "entry" "for"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_16(_tokenSet_16_data_,10);
+const unsigned long AdaParser::_tokenSet_17_data_[] = { 1048576UL, 402653536UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "private" "null" "record" "abstract" "tagged" "limited"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_17(_tokenSet_17_data_,10);
+const unsigned long AdaParser::_tokenSet_18_data_[] = { 1048688UL, 436207712UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "pragma" IDENTIFIER SEMI "private" "null" "record" "case" "tagged" "limited"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_18(_tokenSet_18_data_,10);
+const unsigned long AdaParser::_tokenSet_19_data_[] = { 496512UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN COMMA RPAREN DOT TIC "range" "digits" "delta"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_19(_tokenSet_19_data_,10);
+const unsigned long AdaParser::_tokenSet_20_data_[] = { 738300064UL, 262200UL, 3229614080UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN DOT TIC "range" "new" "others" DOT_DOT CHARACTER_LITERAL
+// CHAR_STRING "null" "mod" "not" PLUS MINUS CONCAT STAR DIV "rem" "abs"
+// EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_20(_tokenSet_20_data_,10);
+const unsigned long AdaParser::_tokenSet_21_data_[] = { 469800096UL, 262201UL, 4293001216UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER LPAREN RIGHT_SHAFT DOT TIC "new" "others" PIPE "in" CHARACTER_LITERAL
+// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS
+// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_21(_tokenSet_21_data_,10);
+const unsigned long AdaParser::_tokenSet_22_data_[] = { 1048576UL, 402653440UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "private" "abstract" "tagged" "limited"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_22(_tokenSet_22_data_,10);
+const unsigned long AdaParser::_tokenSet_23_data_[] = { 1048640UL, 402653184UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "private" "tagged" "limited"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_23(_tokenSet_23_data_,10);
+const unsigned long AdaParser::_tokenSet_24_data_[] = { 37056UL, 8192UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN DOT TIC ASSIGN
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_24(_tokenSet_24_data_,10);
+const unsigned long AdaParser::_tokenSet_25_data_[] = { 67145952UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER SEMI LPAREN DOT TIC "new" CHARACTER_LITERAL CHAR_STRING "null"
+// "until" "not" PLUS MINUS "abs" NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_25(_tokenSet_25_data_,10);
+const unsigned long AdaParser::_tokenSet_26_data_[] = { 0UL, 67108864UL, 272384UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "when" "accept" "delay" "terminate"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_26(_tokenSet_26_data_,10);
+const unsigned long AdaParser::_tokenSet_27_data_[] = { 67109088UL, 56UL, 3229630464UL, 80UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER SEMI LPAREN "new" CHARACTER_LITERAL CHAR_STRING "null" "until"
+// "not" PLUS MINUS "abs" NUMERIC_LIT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_27(_tokenSet_27_data_,10);
+const unsigned long AdaParser::_tokenSet_28_data_[] = { 37056UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN DOT TIC
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_28(_tokenSet_28_data_,10);
+const unsigned long AdaParser::_tokenSet_29_data_[] = { 48UL, 3323036192UL, 1814398UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "pragma" IDENTIFIER "null" "return" "for" "end" "exception" "case" "when"
+// "begin" LT_LT "if" "then" "elsif" "else" "loop" "while" "declare" "exit"
+// "goto" "accept" "delay" "select" "abort" "or" "raise" "requeue"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_29(_tokenSet_29_data_,10);
+const unsigned long AdaParser::_tokenSet_30_data_[] = { 813932352UL, 8192UL, 6422564UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI COMMA RPAREN RIGHT_SHAFT "with" DOT TIC "range" "digits" "is" PIPE
+// DOT_DOT ASSIGN "then" "loop" "or" "and" "xor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaParser::_tokenSet_30(_tokenSet_30_data_,10);
+
+
diff --git a/languages/ada/AdaParser.hpp b/languages/ada/AdaParser.hpp
new file mode 100644
index 00000000..0074c820
--- /dev/null
+++ b/languages/ada/AdaParser.hpp
@@ -0,0 +1,389 @@
+#ifndef INC_AdaParser_hpp_
+#define INC_AdaParser_hpp_
+
+#line 29 "ada.g"
+
+#include <antlr/SemanticException.hpp> // antlr wants this
+#include "AdaAST.hpp"
+#include "preambles.h"
+
+#line 11 "AdaParser.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaParser.hpp"$ */
+#include <antlr/TokenStream.hpp>
+#include <antlr/TokenBuffer.hpp>
+#include "AdaTokenTypes.hpp"
+#include <antlr/LLkParser.hpp>
+
+class CUSTOM_API AdaParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public AdaTokenTypes
+{
+#line 53 "ada.g"
+
+ ANTLR_PARSER_PREAMBLE
+
+public:
+ // Ada support stuff
+ void push_def_id (const RefAdaAST& defid);
+ const RefAdaAST& pop_def_id ();
+ bool end_id_matches_def_id (const RefAdaAST& endid);
+ bool definable_operator (const char *string); // operator_symbol sans "/="
+ bool is_operator_symbol (const char *string);
+#line 22 "AdaParser.hpp"
+public:
+ void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+protected:
+ AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k);
+public:
+ AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf);
+protected:
+ AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k);
+public:
+ AdaParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer);
+ AdaParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state);
+ int getNumTokens() const
+ {
+ return AdaParser::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return AdaParser::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return AdaParser::tokenNames;
+ }
+ public: void compilation_unit();
+ public: void context_items_opt();
+ public: void library_item();
+ public: void subunit();
+ public: void pragma();
+ public: void pragma_args_opt();
+ public: void pragma_arg();
+ public: void expression();
+ public: void with_clause();
+ public: void use_clause();
+ public: void c_name_list();
+ public: void compound_name();
+ public: void subtype_mark();
+ public: void attribute_id();
+ public: void private_opt();
+ public: void lib_pkg_spec_or_body();
+ public: void subprog_decl_or_rename_or_inst_or_body(
+ boolean lib_level
+ );
+ public: void generic_decl(
+ boolean lib_level
+ );
+ public: void def_id(
+ boolean lib_level
+ );
+ public: void pkg_body_part();
+ public: void spec_decl_part(
+ RefAdaAST pkg
+ );
+ public: void subprog_decl(
+ boolean lib_level
+ );
+ public: void generic_subp_inst();
+ public: void formal_part_opt();
+ public: void renames();
+ public: void is_separate_or_abstract_or_decl(
+ RefAdaAST t
+ );
+ public: void def_designator(
+ boolean lib_level
+ );
+ public: void function_tail();
+ public: void generic_inst();
+ public: void value_s();
+ public: void parenth_values();
+ public: void value();
+ public: void ranged_expr_s();
+ public: void ranged_expr();
+ public: void simple_expression();
+ public: void range();
+ public: void range_constraint();
+ public: void range_dots();
+ public: void range_attrib_ref();
+ public: void prefix();
+ public: void parameter_specification();
+ public: void def_ids_colon();
+ public: void mode_opt();
+ public: void init_opt();
+ public: void defining_identifier_list();
+ public: void name();
+ public: RefAdaAST definable_operator_symbol();
+ public: RefAdaAST is_operator();
+ public: void parenthesized_primary();
+ public: void extension_opt();
+ public: void separate_or_abstract(
+ RefAdaAST t
+ );
+ public: RefAdaAST designator();
+ public: void func_formal_part_opt();
+ public: void func_param();
+ public: void in_access_opt();
+ public: void pkg_spec_part();
+ public: void basic_declarative_items_opt();
+ public: void private_declarative_items_opt();
+ public: void end_id_opt();
+ public: void basic_decl_item();
+ public: void basic_declarative_items();
+ public: void task_type_or_single_decl(
+ RefAdaAST tsk
+ );
+ public: void prot_type_or_single_decl(
+ RefAdaAST pro
+ );
+ public: void decl_common();
+ public: void discrim_part_opt();
+ public: void task_definition_opt();
+ public: void task_items_opt();
+ public: void private_task_items_opt();
+ public: void discrim_part_text();
+ public: void discriminant_specifications();
+ public: void known_discrim_part();
+ public: void empty_discrim_opt();
+ public: void discrim_part();
+ public: void discriminant_specification();
+ public: void access_opt();
+ public: void entrydecls_repspecs_opt();
+ public: void entry_declaration();
+ public: void rep_spec();
+ public: void discrete_subtype_def_opt();
+ public: void discrete_subtype_definition();
+ public: void subtype_ind();
+ public: void rep_spec_part(
+ RefAdaAST t
+ );
+ public: void align_opt();
+ public: void comp_loc_s();
+ public: void protected_definition();
+ public: void prot_private_opt();
+ public: void prot_op_decl();
+ public: void comp_decl();
+ public: void prot_op_decl_s();
+ public: void prot_member_decl_s();
+ public: void component_subtype_def();
+ public: void type_def(
+ RefAdaAST t
+ );
+ public: void derived_or_private_or_record(
+ RefAdaAST t, boolean has_discrim
+ );
+ public: void local_enum_name();
+ public: void enumeration_aggregate();
+ public: void aliased_constant_opt();
+ public: void array_type_definition(
+ RefAdaAST t
+ );
+ public: void enum_id_s();
+ public: void range_constraint_opt();
+ public: void access_type_definition(
+ RefAdaAST t
+ );
+ public: void enumeration_literal_specification();
+ public: void index_or_discrete_range_s();
+ public: void index_or_discrete_range();
+ public: void aliased_opt();
+ public: void constraint_opt();
+ public: void digits_constraint();
+ public: void delta_constraint();
+ public: void index_constraint();
+ public: void discriminant_constraint();
+ public: void discrete_range();
+ public: void discriminant_association();
+ public: void selector_names_opt();
+ public: void association_head();
+ public: void selector_name();
+ public: void protected_opt();
+ public: void constant_all_opt();
+ public: void abstract_opt();
+ public: void record_definition(
+ boolean has_discrim
+ );
+ public: void abstract_tagged_limited_opt();
+ public: void component_list(
+ boolean has_discrim
+ );
+ public: void component_items();
+ public: void variant_part();
+ public: void empty_component_items();
+ public: void discriminant_direct_name();
+ public: void variant_s();
+ public: void variant();
+ public: void choice_s();
+ public: void choice();
+ public: void discrete_with_range();
+ public: void mark_with_constraint();
+ public: void generic_formal_part_opt();
+ public: void generic_formal_parameter();
+ public: void discriminable_type_definition(
+ RefAdaAST t
+ );
+ public: void subprogram_default_opt();
+ public: void formal_package_actual_part_opt();
+ public: void body_part();
+ public: void declarative_part();
+ public: void block_body();
+ public: void declarative_item();
+ public: void body_is();
+ public: void separate();
+ public: void prot_op_bodies_opt();
+ public: void block_body_opt();
+ public: void handled_stmt_s();
+ public: void entry_body();
+ public: void subprog_decl_or_body();
+ public: void statements();
+ public: void except_handler_part_opt();
+ public: void handled_stmts_opt();
+ public: void statement();
+ public: void def_label_opt();
+ public: void null_stmt();
+ public: void exit_stmt();
+ public: void return_stmt();
+ public: void goto_stmt();
+ public: void delay_stmt();
+ public: void abort_stmt();
+ public: void raise_stmt();
+ public: void requeue_stmt();
+ public: void accept_stmt();
+ public: void select_stmt();
+ public: void if_stmt();
+ public: void case_stmt();
+ public: void loop_stmt();
+ public: void block();
+ public: void statement_identifier();
+ public: void id_opt();
+ public: void call_or_assignment();
+ public: void cond_clause();
+ public: void elsifs_opt();
+ public: void else_opt();
+ public: void condition();
+ public: void alternative_s();
+ public: void case_statement_alternative();
+ public: void iteration_scheme_opt();
+ public: void reverse_opt();
+ public: void id_opt_aux();
+ public: void declare_opt();
+ public: void label_name();
+ public: void entry_body_formal_part();
+ public: void entry_barrier();
+ public: void entry_index_spec_opt();
+ public: void entry_call_stmt();
+ public: void entry_index_opt();
+ public: void until_opt();
+ public: void triggering_alternative();
+ public: void abortable_part();
+ public: void selective_accept();
+ public: void entry_call_alternative();
+ public: void delay_alternative();
+ public: void stmts_opt();
+ public: void guard_opt();
+ public: void select_alternative();
+ public: void or_select_opt();
+ public: void accept_alternative();
+ public: void exception_handler();
+ public: void identifier_colon_opt();
+ public: void except_choice_s();
+ public: void exception_choice();
+ public: void operator_call();
+ public: void operator_call_tail(
+ RefAdaAST opstr
+ );
+ public: void relation();
+ public: void range_or_mark();
+ public: void signed_term();
+ public: void term();
+ public: void factor();
+ public: void primary();
+ public: void name_or_qualified();
+ public: void allocator();
+ public: void subprogram_body();
+ public: void package_body();
+ public: void task_body();
+ public: void protected_body();
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefAdaAST returnAST;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 290;
+#else
+ enum {
+ NUM_TOKENS = 290
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+ static const unsigned long _tokenSet_5_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
+ static const unsigned long _tokenSet_6_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
+ static const unsigned long _tokenSet_7_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7;
+ static const unsigned long _tokenSet_8_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8;
+ static const unsigned long _tokenSet_9_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9;
+ static const unsigned long _tokenSet_10_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10;
+ static const unsigned long _tokenSet_11_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11;
+ static const unsigned long _tokenSet_12_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12;
+ static const unsigned long _tokenSet_13_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13;
+ static const unsigned long _tokenSet_14_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14;
+ static const unsigned long _tokenSet_15_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15;
+ static const unsigned long _tokenSet_16_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16;
+ static const unsigned long _tokenSet_17_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17;
+ static const unsigned long _tokenSet_18_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18;
+ static const unsigned long _tokenSet_19_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19;
+ static const unsigned long _tokenSet_20_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20;
+ static const unsigned long _tokenSet_21_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21;
+ static const unsigned long _tokenSet_22_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22;
+ static const unsigned long _tokenSet_23_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23;
+ static const unsigned long _tokenSet_24_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24;
+ static const unsigned long _tokenSet_25_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25;
+ static const unsigned long _tokenSet_26_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26;
+ static const unsigned long _tokenSet_27_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27;
+ static const unsigned long _tokenSet_28_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28;
+ static const unsigned long _tokenSet_29_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29;
+ static const unsigned long _tokenSet_30_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30;
+};
+
+#endif /*INC_AdaParser_hpp_*/
diff --git a/languages/ada/AdaStoreWalker.cpp b/languages/ada/AdaStoreWalker.cpp
new file mode 100644
index 00000000..167d671c
--- /dev/null
+++ b/languages/ada/AdaStoreWalker.cpp
@@ -0,0 +1,9439 @@
+/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.cpp"$ */
+#include "AdaStoreWalker.hpp"
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/BitSet.hpp>
+#line 1 "expandedada.store.g"
+#line 11 "AdaStoreWalker.cpp"
+AdaStoreWalker::AdaStoreWalker()
+ : ANTLR_USE_NAMESPACE(antlr)TreeParser() {
+}
+
+void AdaStoreWalker::compilation_unit(RefAdaAST _t) {
+ RefAdaAST compilation_unit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+#line 116 "expandedada.store.g"
+ init();
+#line 22 "AdaStoreWalker.cpp"
+ context_items_opt(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LIBRARY_ITEM:
+ {
+ library_item(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBUNIT:
+ {
+ subunit(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == PRAGMA)) {
+ pragma(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop4;
+ }
+
+ }
+ _loop4:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::context_items_opt(RefAdaAST _t) {
+ RefAdaAST context_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t70 = _t;
+ RefAdaAST tmp1_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONTEXT_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case WITH_CLAUSE:
+ {
+ with_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop72;
+ }
+ }
+ }
+ _loop72:;
+ } // ( ... )*
+ _t = __t70;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::library_item(RefAdaAST _t) {
+ RefAdaAST library_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST pb = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST gpi = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefAdaAST prd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefAdaAST __t17 = _t;
+ RefAdaAST tmp2_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIBRARY_ITEM);
+ _t = _t->getFirstChild();
+ RefAdaAST __t18 = _t;
+ RefAdaAST tmp3_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRIVATE:
+ {
+ RefAdaAST tmp4_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE);
+ _t = _t->getNextSibling();
+#line 132 "expandedada.store.g"
+ m_currentAccess = CodeModelItem::Protected;
+#line 149 "AdaStoreWalker.cpp"
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t18;
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ lib_subprog_decl_or_rename_or_inst_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ RefAdaAST __t21 = _t;
+ RefAdaAST tmp5_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ pb = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t21;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ RefAdaAST __t22 = _t;
+ RefAdaAST tmp6_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ gpi = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+#line 136 "expandedada.store.g"
+
+ defineScope( gpi );
+
+#line 213 "AdaStoreWalker.cpp"
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t22;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_SPECIFICATION:
+ {
+ RefAdaAST __t23 = _t;
+ RefAdaAST tmp7_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION);
+ _t = _t->getFirstChild();
+ ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+#line 142 "expandedada.store.g"
+
+ NamespaceDom psc = defineScope( ps );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+
+#line 236 "AdaStoreWalker.cpp"
+ pkg_spec_part(_t);
+ _t = _retTree;
+#line 149 "expandedada.store.g"
+
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0) {
+ kdDebug() << "adastore: m_scopeStack is empty!" << endl;
+ m_scopeStack.append( m_model->globalNamespace() );
+ }
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setEndPosition (endLine, 0);
+ m_addToStore = false;
+
+#line 250 "AdaStoreWalker.cpp"
+ _t = __t23;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t24 = _t;
+ RefAdaAST tmp8_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ prd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+#line 161 "expandedada.store.g"
+
+ defineScope( prd );
+
+#line 268 "AdaStoreWalker.cpp"
+ renames(_t);
+ _t = _retTree;
+ _t = __t24;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ generic_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t17;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subunit(RefAdaAST _t) {
+ RefAdaAST subunit_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t521 = _t;
+ RefAdaAST tmp9_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBUNIT);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FUNCTION_BODY:
+ case PROCEDURE_BODY:
+ {
+ subprogram_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ package_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case TASK_BODY:
+ {
+ task_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_BODY:
+ {
+ protected_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t521;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::pragma(RefAdaAST _t) {
+ RefAdaAST pragma_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t64 = _t;
+ RefAdaAST tmp10_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRAGMA);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp11_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_0.member(_t->getType()))) {
+ pragma_arg(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop66;
+ }
+
+ }
+ _loop66:;
+ } // ( ... )*
+ _t = __t64;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::with_clause(RefAdaAST _t) {
+ RefAdaAST with_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t6 = _t;
+ RefAdaAST tmp12_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WITH_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt8=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) {
+ compound_name(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt8>=1 ) { goto _loop8; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt8++;
+ }
+ _loop8:;
+ } // ( ... )+
+ _t = __t6;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::compound_name(RefAdaAST _t) {
+ RefAdaAST compound_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp13_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefAdaAST __t74 = _t;
+ RefAdaAST tmp14_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ RefAdaAST tmp15_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ _t = __t74;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::use_clause(RefAdaAST _t) {
+ RefAdaAST use_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST c = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case USE_TYPE_CLAUSE:
+ {
+ RefAdaAST __t10 = _t;
+ RefAdaAST tmp16_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_TYPE_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt12=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) {
+ subtype_mark(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt12>=1 ) { goto _loop12; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt12++;
+ }
+ _loop12:;
+ } // ( ... )+
+ _t = __t10;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case USE_CLAUSE:
+ {
+ RefAdaAST __t13 = _t;
+ RefAdaAST tmp17_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USE_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt15=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) {
+ c = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ compound_name(_t);
+ _t = _retTree;
+#line 127 "expandedada.store.g"
+ m_imports.back ().push_back (qtext (c));
+#line 527 "AdaStoreWalker.cpp"
+ }
+ else {
+ if ( _cnt15>=1 ) { goto _loop15; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt15++;
+ }
+ _loop15:;
+ } // ( ... )+
+ _t = __t13;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subtype_mark(RefAdaAST _t) {
+ RefAdaAST subtype_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case TIC:
+ {
+ RefAdaAST __t76 = _t;
+ RefAdaAST tmp18_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ attribute_id(_t);
+ _t = _retTree;
+ _t = __t76;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) {
+ RefAdaAST lib_subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+#line 310 "expandedada.store.g"
+ m_addToStore = true;
+#line 603 "AdaStoreWalker.cpp"
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+#line 315 "expandedada.store.g"
+ m_addToStore = false;
+#line 643 "AdaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::def_id(RefAdaAST _t) {
+ RefAdaAST def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ compound_name(_t);
+ _t = _retTree;
+#line 189 "expandedada.store.g"
+
+ // kdDebug() << "cn:compound_name started " << endl;
+ if (m_addToStore) {
+ // kdDebug() << "cn:compound_name m_addToStore " << endl;
+ if (m_isSubprogram) {
+ // kdDebug() << "cn:compound_name m_isSubprogram " << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName (qtext (cn));
+ method->setFileName(m_fileName);
+ // kdDebug() << "cn:compound_name method->setStartPosition(" << endl;
+ method->setStartPosition(cn->getLine(), cn->getColumn());
+
+ if (m_currentContainer == m_model->globalNamespace())
+ m_file->addFunction(method);
+ else
+ m_currentContainer->addFunction(method);
+ //FIXME: adymo: is this valid for CodeModel
+ /* ParsedMethod *old = m_currentContainer->getMethod (method);
+ if (old) {
+ delete (method);
+ method = old;
+ } else {
+ m_currentContainer->addMethod (method);
+ }*/
+ } else {
+ // TBC: what about other declarations?
+ }
+ }
+
+#line 691 "AdaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::pkg_body_part(RefAdaAST _t) {
+ RefAdaAST pkg_body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ declarative_part(_t);
+ _t = _retTree;
+ block_body_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::generic_inst(RefAdaAST _t) {
+ RefAdaAST generic_inst_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ compound_name(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::pkg_spec_part(RefAdaAST _t) {
+ RefAdaAST pkg_spec_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ basic_declarative_items_opt(_t);
+ _t = _retTree;
+ private_declarative_items_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::renames(RefAdaAST _t) {
+ RefAdaAST renames_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CHARACTER_STRING:
+ {
+ RefAdaAST tmp19_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_STRING);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ RefAdaAST tmp20_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::generic_decl(RefAdaAST _t) {
+ RefAdaAST generic_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST gpd = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PACKAGE_RENAMING:
+ {
+ RefAdaAST __t49 = _t;
+ RefAdaAST tmp21_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t49;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ {
+ RefAdaAST __t50 = _t;
+ RefAdaAST tmp22_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ gpd = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+#line 284 "expandedada.store.g"
+
+ NamespaceDom psc = defineScope( gpd );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+
+#line 860 "AdaStoreWalker.cpp"
+ pkg_spec_part(_t);
+ _t = _retTree;
+#line 291 "expandedada.store.g"
+
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0)
+ m_scopeStack.append( m_model->globalNamespace() );
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setDeclarationEndsOnLine (endLine);
+ m_addToStore = false;
+
+#line 872 "AdaStoreWalker.cpp"
+ _t = __t50;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ RefAdaAST __t51 = _t;
+ RefAdaAST tmp23_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t51;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t52 = _t;
+ RefAdaAST tmp24_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t52;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_RENAMING:
+ {
+ RefAdaAST __t53 = _t;
+ RefAdaAST tmp25_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t53;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t54 = _t;
+ RefAdaAST tmp26_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ subprog_def_id(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t54;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprog_def_id(RefAdaAST _t) {
+ RefAdaAST subprog_def_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+#line 171 "expandedada.store.g"
+ m_isSubprogram = true;
+#line 965 "AdaStoreWalker.cpp"
+ def_id(_t);
+ _t = _retTree;
+#line 173 "expandedada.store.g"
+ m_isSubprogram = false;
+#line 970 "AdaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprog_decl(RefAdaAST _t) {
+ RefAdaAST subprog_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ {
+ RefAdaAST __t27 = _t;
+ RefAdaAST tmp27_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PROCEDURE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t27;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t28 = _t;
+ RefAdaAST tmp28_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t28;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t29 = _t;
+ RefAdaAST tmp29_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t29;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_BODY_STUB:
+ {
+ RefAdaAST __t30 = _t;
+ RefAdaAST tmp30_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY_STUB);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t30;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t31 = _t;
+ RefAdaAST tmp31_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t31;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_INSTANTIATION:
+ {
+ RefAdaAST __t32 = _t;
+ RefAdaAST tmp32_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FUNCTION_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t32;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t33 = _t;
+ RefAdaAST tmp33_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t33;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t34 = _t;
+ RefAdaAST tmp34_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t34;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_BODY_STUB:
+ {
+ RefAdaAST __t35 = _t;
+ RefAdaAST tmp35_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t35;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t36 = _t;
+ RefAdaAST tmp36_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t36;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::formal_part_opt(RefAdaAST _t) {
+ RefAdaAST formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t112 = _t;
+ RefAdaAST tmp37_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PART_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == PARAMETER_SPECIFICATION)) {
+ parameter_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop114;
+ }
+
+ }
+ _loop114:;
+ } // ( ... )*
+ _t = __t112;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::def_designator(RefAdaAST _t) {
+ RefAdaAST def_designator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST cn = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ cn = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ compound_name(_t);
+ _t = _retTree;
+#line 221 "expandedada.store.g"
+
+ // kdDebug() << "def_designator cn:compound_name started" << endl;
+ if (m_addToStore) {
+ // kdDebug() << "def_designator cn:compound_name m_addToStore" << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName (qtext (cn));
+ method->setFileName(m_fileName);
+ // kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl;
+ method->setStartPosition(cn->getLine(), cn->getColumn());
+
+ if (m_currentContainer == m_model->globalNamespace())
+ m_file->addFunction(method);
+ else
+ m_currentContainer->addFunction(method);
+ //FIXME: adymo: is this valid for CodeModel
+ /* ParsedMethod *old = m_currentContainer->getMethod (method);
+ if (old) {
+ delete method;
+ method = old;
+ } else {
+ m_currentContainer->addMethod (method);
+ }*/
+ }
+
+#line 1218 "AdaStoreWalker.cpp"
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ definable_operator_symbol(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::function_tail(RefAdaAST _t) {
+ RefAdaAST function_tail_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ formal_part_opt(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::definable_operator_symbol(RefAdaAST _t) {
+ RefAdaAST definable_operator_symbol_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp38_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::spec_decl_part(RefAdaAST _t) {
+ RefAdaAST spec_decl_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST ps = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ RefAdaAST __t40 = _t;
+ RefAdaAST tmp39_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_PACKAGE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t40;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_SPECIFICATION:
+ {
+ RefAdaAST __t41 = _t;
+ RefAdaAST tmp40_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_SPECIFICATION);
+ _t = _t->getFirstChild();
+ ps = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+#line 250 "expandedada.store.g"
+
+ NamespaceDom psc = defineScope( ps );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+
+#line 1312 "AdaStoreWalker.cpp"
+ pkg_spec_part(_t);
+ _t = _retTree;
+#line 257 "expandedada.store.g"
+
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0) {
+ kdDebug() << "adastore: m_scopeStack is empty!" << endl;
+ m_scopeStack.append( m_model->globalNamespace() );
+ }
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setDeclarationEndsOnLine (endLine);
+ m_addToStore = false;
+
+#line 1326 "AdaStoreWalker.cpp"
+ _t = __t41;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t42 = _t;
+ RefAdaAST tmp41_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t42;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::basic_declarative_items_opt(RefAdaAST _t) {
+ RefAdaAST basic_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t136 = _t;
+ RefAdaAST tmp42_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BASIC_DECLARATIVE_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_1.member(_t->getType()))) {
+ basic_decl_item(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop138;
+ }
+
+ }
+ _loop138:;
+ } // ( ... )*
+ _t = __t136;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::private_declarative_items_opt(RefAdaAST _t) {
+ RefAdaAST private_declarative_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case PROTECTED_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SINGLE_PROTECTED_DECLARATION:
+ case SINGLE_TASK_DECLARATION:
+ case SUBTYPE_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+#line 276 "expandedada.store.g"
+ m_currentAccess = CodeModelItem::Protected;
+#line 1457 "AdaStoreWalker.cpp"
+ { // ( ... )+
+ int _cnt47=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case PROTECTED_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SINGLE_PROTECTED_DECLARATION:
+ case SINGLE_TASK_DECLARATION:
+ case SUBTYPE_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ basic_decl_item(_t);
+ _t = _retTree;
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ if ( _cnt47>=1 ) { goto _loop47; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+ }
+ _cnt47++;
+ }
+ _loop47:;
+ } // ( ... )+
+#line 278 "expandedada.store.g"
+ m_currentAccess = CodeModelItem::Public;
+#line 1538 "AdaStoreWalker.cpp"
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::end_id_opt(RefAdaAST _t) {
+ RefAdaAST end_id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t86 = _t;
+ RefAdaAST tmp43_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),END);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case OPERATOR_SYMBOL:
+ {
+ def_designator(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t86;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::basic_decl_item(RefAdaAST _t) {
+ RefAdaAST basic_decl_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ spec_decl_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ {
+ task_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_TYPE_DECLARATION:
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ prot_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SUBTYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ decl_common(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::generic_formal_part_opt(RefAdaAST _t) {
+ RefAdaAST generic_formal_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t295 = _t;
+ RefAdaAST tmp44_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GENERIC_FORMAL_PART);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case FORMAL_PACKAGE_DECLARATION:
+ case PARAMETER_SPECIFICATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case FORMAL_DECIMAL_FIXED_POINT_DECLARATION:
+ case FORMAL_DISCRETE_TYPE_DECLARATION:
+ case FORMAL_FLOATING_POINT_DECLARATION:
+ case FORMAL_FUNCTION_DECLARATION:
+ case FORMAL_MODULAR_TYPE_DECLARATION:
+ case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION:
+ case FORMAL_ORDINARY_FIXED_POINT_DECLARATION:
+ case FORMAL_PRIVATE_EXTENSION_DECLARATION:
+ case FORMAL_PRIVATE_TYPE_DECLARATION:
+ case FORMAL_PROCEDURE_DECLARATION:
+ case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ generic_formal_parameter(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop297;
+ }
+ }
+ }
+ _loop297:;
+ } // ( ... )*
+ _t = __t295;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::procedure_body(RefAdaAST _t) {
+ RefAdaAST procedure_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t319 = _t;
+ RefAdaAST tmp45_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t319;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::function_body(RefAdaAST _t) {
+ RefAdaAST function_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t321 = _t;
+ RefAdaAST tmp46_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_BODY);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t321;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t) {
+ RefAdaAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprog_decl_or_body(RefAdaAST _t) {
+ RefAdaAST subprog_decl_or_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t59 = _t;
+ RefAdaAST tmp47_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ subprog_def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t59;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t60 = _t;
+ RefAdaAST tmp48_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t60;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::package_body(RefAdaAST _t) {
+ RefAdaAST package_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefAdaAST id = RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefAdaAST __t62 = _t;
+ RefAdaAST tmp49_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ id = (_t == ASTNULL) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t62;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::pragma_arg(RefAdaAST _t) {
+ RefAdaAST pragma_arg_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RIGHT_SHAFT:
+ {
+ RefAdaAST __t68 = _t;
+ RefAdaAST tmp50_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp51_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ _t = __t68;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::expression(RefAdaAST _t) {
+ RefAdaAST expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case AND:
+ {
+ RefAdaAST __t479 = _t;
+ RefAdaAST tmp52_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t479;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AND_THEN:
+ {
+ RefAdaAST __t480 = _t;
+ RefAdaAST tmp53_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND_THEN);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t480;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OR:
+ {
+ RefAdaAST __t481 = _t;
+ RefAdaAST tmp54_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t481;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OR_ELSE:
+ {
+ RefAdaAST __t482 = _t;
+ RefAdaAST tmp55_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_ELSE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t482;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case XOR:
+ {
+ RefAdaAST __t483 = _t;
+ RefAdaAST tmp56_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),XOR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t483;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case NOT_IN:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ relation(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::attribute_id(RefAdaAST _t) {
+ RefAdaAST attribute_id_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE:
+ {
+ RefAdaAST tmp57_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIGITS:
+ {
+ RefAdaAST tmp58_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DELTA:
+ {
+ RefAdaAST tmp59_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS:
+ {
+ RefAdaAST tmp60_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp61_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::modifiers(RefAdaAST _t) {
+ RefAdaAST modifiers_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t79 = _t;
+ RefAdaAST tmp62_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT:
+ {
+ RefAdaAST tmp63_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS:
+ {
+ RefAdaAST tmp64_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ALIASED:
+ {
+ RefAdaAST tmp65_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALIASED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ALL:
+ {
+ RefAdaAST tmp66_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONSTANT:
+ {
+ RefAdaAST tmp67_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONSTANT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IN:
+ {
+ RefAdaAST tmp68_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LIMITED:
+ {
+ RefAdaAST tmp69_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LIMITED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OUT:
+ {
+ RefAdaAST tmp70_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OUT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE:
+ {
+ RefAdaAST tmp71_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED:
+ {
+ RefAdaAST tmp72_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case REVERSE:
+ {
+ RefAdaAST tmp73_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REVERSE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TAGGED:
+ {
+ RefAdaAST tmp74_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TAGGED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ goto _loop81;
+ }
+ }
+ }
+ _loop81:;
+ } // ( ... )*
+ _t = __t79;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::id_opt(RefAdaAST _t) {
+ RefAdaAST id_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t83 = _t;
+ RefAdaAST tmp75_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ID_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case OPERATOR_SYMBOL:
+ {
+ def_designator(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t83;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::value_s(RefAdaAST _t) {
+ RefAdaAST value_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t475 = _t;
+ RefAdaAST tmp76_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VALUES);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt477=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_2.member(_t->getType()))) {
+ value(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt477>=1 ) { goto _loop477; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt477++;
+ }
+ _loop477:;
+ } // ( ... )+
+ _t = __t475;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::value(RefAdaAST _t) {
+ RefAdaAST value_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case OTHERS:
+ {
+ RefAdaAST __t91 = _t;
+ RefAdaAST tmp77_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ _t = __t91;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RIGHT_SHAFT:
+ {
+ RefAdaAST __t92 = _t;
+ RefAdaAST tmp78_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RIGHT_SHAFT);
+ _t = _t->getFirstChild();
+ ranged_expr_s(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t92;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case PIPE:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ ranged_expr_s(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::ranged_expr_s(RefAdaAST _t) {
+ RefAdaAST ranged_expr_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ RefAdaAST __t94 = _t;
+ RefAdaAST tmp79_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE);
+ _t = _t->getFirstChild();
+ ranged_expr_s(_t);
+ _t = _retTree;
+ ranged_expr(_t);
+ _t = _retTree;
+ _t = __t94;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ ranged_expr(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::ranged_expr(RefAdaAST _t) {
+ RefAdaAST ranged_expr_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ RefAdaAST __t96 = _t;
+ RefAdaAST tmp80_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t96;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RANGE:
+ {
+ RefAdaAST __t97 = _t;
+ RefAdaAST tmp81_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ _t = __t97;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::simple_expression(RefAdaAST _t) {
+ RefAdaAST simple_expression_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PLUS:
+ {
+ RefAdaAST __t495 = _t;
+ RefAdaAST tmp82_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t495;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS:
+ {
+ RefAdaAST __t496 = _t;
+ RefAdaAST tmp83_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t496;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONCAT:
+ {
+ RefAdaAST __t497 = _t;
+ RefAdaAST tmp84_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONCAT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t497;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ signed_term(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range(RefAdaAST _t) {
+ RefAdaAST range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ range_dots(_t);
+ _t = _retTree;
+ break;
+ }
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range_attrib_ref(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range_constraint(RefAdaAST _t) {
+ RefAdaAST range_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t99 = _t;
+ RefAdaAST tmp85_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_CONSTRAINT);
+ _t = _t->getFirstChild();
+ range(_t);
+ _t = _retTree;
+ _t = __t99;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range_dots(RefAdaAST _t) {
+ RefAdaAST range_dots_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t103 = _t;
+ RefAdaAST tmp86_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t103;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range_attrib_ref(RefAdaAST _t) {
+ RefAdaAST range_attrib_ref_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t105 = _t;
+ RefAdaAST tmp87_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE_ATTRIBUTE_REFERENCE);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t105;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prefix(RefAdaAST _t) {
+ RefAdaAST prefix_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp88_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefAdaAST __t108 = _t;
+ RefAdaAST tmp89_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ RefAdaAST tmp90_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp91_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t108;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ RefAdaAST __t110 = _t;
+ RefAdaAST tmp92_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t110;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::parameter_specification(RefAdaAST _t) {
+ RefAdaAST parameter_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t116 = _t;
+ RefAdaAST tmp93_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARAMETER_SPECIFICATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t116;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::defining_identifier_list(RefAdaAST _t) {
+ RefAdaAST defining_identifier_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t118 = _t;
+ RefAdaAST tmp94_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DEFINING_IDENTIFIER_LIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt120=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER)) {
+ RefAdaAST tmp95_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ else {
+ if ( _cnt120>=1 ) { goto _loop120; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt120++;
+ }
+ _loop120:;
+ } // ( ... )+
+ _t = __t118;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::init_opt(RefAdaAST _t) {
+ RefAdaAST init_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t154 = _t;
+ RefAdaAST tmp96_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INIT_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t154;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::name(RefAdaAST _t) {
+ RefAdaAST name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp97_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefAdaAST __t123 = _t;
+ RefAdaAST tmp98_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ RefAdaAST tmp99_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp100_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp101_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ RefAdaAST tmp102_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t123;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ RefAdaAST __t125 = _t;
+ RefAdaAST tmp103_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t125;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIC:
+ {
+ RefAdaAST __t126 = _t;
+ RefAdaAST tmp104_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ attribute_id(_t);
+ _t = _retTree;
+ _t = __t126;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::parenthesized_primary(RefAdaAST _t) {
+ RefAdaAST parenthesized_primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t129 = _t;
+ RefAdaAST tmp105_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARENTHESIZED_PRIMARY);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NuLL:
+ {
+ RefAdaAST tmp106_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ extension_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t129;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::extension_opt(RefAdaAST _t) {
+ RefAdaAST extension_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t132 = _t;
+ RefAdaAST tmp107_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXTENSION_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NuLL:
+ {
+ RefAdaAST tmp108_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t132;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::task_type_or_single_decl(RefAdaAST _t) {
+ RefAdaAST task_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case TASK_TYPE_DECLARATION:
+ {
+ RefAdaAST __t141 = _t;
+ RefAdaAST tmp109_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ task_definition_opt(_t);
+ _t = _retTree;
+ _t = __t141;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ {
+ RefAdaAST __t142 = _t;
+ RefAdaAST tmp110_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_TASK_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ task_definition_opt(_t);
+ _t = _retTree;
+ _t = __t142;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_type_or_single_decl(RefAdaAST _t) {
+ RefAdaAST prot_type_or_single_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROTECTED_TYPE_DECLARATION:
+ {
+ RefAdaAST __t182 = _t;
+ RefAdaAST tmp111_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ protected_definition(_t);
+ _t = _retTree;
+ _t = __t182;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ RefAdaAST __t183 = _t;
+ RefAdaAST tmp112_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SINGLE_PROTECTED_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ protected_definition(_t);
+ _t = _retTree;
+ _t = __t183;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::decl_common(RefAdaAST _t) {
+ RefAdaAST decl_common_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENUMERATION_TYPE_DECLARATION:
+ {
+ RefAdaAST __t202 = _t;
+ RefAdaAST tmp113_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp114_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ enum_id_s(_t);
+ _t = _retTree;
+ _t = __t202;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ RefAdaAST __t203 = _t;
+ RefAdaAST tmp115_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SIGNED_INTEGER_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp116_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ range(_t);
+ _t = _retTree;
+ _t = __t203;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MODULAR_TYPE_DECLARATION:
+ {
+ RefAdaAST __t204 = _t;
+ RefAdaAST tmp117_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODULAR_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp118_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ _t = __t204;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FLOATING_POINT_DECLARATION:
+ {
+ RefAdaAST __t205 = _t;
+ RefAdaAST tmp119_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FLOATING_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp120_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t205;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ {
+ RefAdaAST __t206 = _t;
+ RefAdaAST tmp121_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp122_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ _t = __t206;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ {
+ RefAdaAST __t207 = _t;
+ RefAdaAST tmp123_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECIMAL_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp124_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t207;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_TYPE_DECLARATION:
+ {
+ array_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ access_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case INCOMPLETE_TYPE_DECLARATION:
+ {
+ RefAdaAST __t208 = _t;
+ RefAdaAST tmp125_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INCOMPLETE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp126_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrim_part_opt(_t);
+ _t = _retTree;
+ _t = __t208;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE_EXTENSION_DECLARATION:
+ {
+ RefAdaAST __t209 = _t;
+ RefAdaAST tmp127_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_EXTENSION_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t209;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DERIVED_RECORD_EXTENSION:
+ {
+ RefAdaAST __t210 = _t;
+ RefAdaAST tmp128_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DERIVED_RECORD_EXTENSION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ record_definition(_t);
+ _t = _retTree;
+ _t = __t210;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ {
+ RefAdaAST __t211 = _t;
+ RefAdaAST tmp129_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ORDINARY_DERIVED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t211;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE_TYPE_DECLARATION:
+ {
+ RefAdaAST __t212 = _t;
+ RefAdaAST tmp130_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ _t = __t212;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RECORD_TYPE_DECLARATION:
+ {
+ RefAdaAST __t213 = _t;
+ RefAdaAST tmp131_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ record_definition(_t);
+ _t = _retTree;
+ _t = __t213;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SUBTYPE_DECLARATION:
+ {
+ RefAdaAST __t214 = _t;
+ RefAdaAST tmp132_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp133_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t214;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ generic_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ case EXCEPTION_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t215 = _t;
+ RefAdaAST tmp134_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ compound_name(_t);
+ _t = _retTree;
+ _t = __t215;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OBJECT_RENAMING_DECLARATION:
+ {
+ RefAdaAST __t216 = _t;
+ RefAdaAST tmp135_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ name(_t);
+ _t = _retTree;
+ _t = __t216;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EXCEPTION_DECLARATION:
+ {
+ RefAdaAST __t217 = _t;
+ RefAdaAST tmp136_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ _t = __t217;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUMBER_DECLARATION:
+ {
+ RefAdaAST __t218 = _t;
+ RefAdaAST tmp137_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMBER_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t218;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_OBJECT_DECLARATION:
+ {
+ RefAdaAST __t219 = _t;
+ RefAdaAST tmp138_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ array_type_definition(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t219;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OBJECT_DECLARATION:
+ {
+ RefAdaAST __t220 = _t;
+ RefAdaAST tmp139_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t220;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discrim_part_opt(RefAdaAST _t) {
+ RefAdaAST discrim_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t145 = _t;
+ RefAdaAST tmp140_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIM_PART_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ RefAdaAST tmp141_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DISCRIMINANT_SPECIFICATIONS:
+ {
+ discriminant_specifications(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t145;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::task_definition_opt(RefAdaAST _t) {
+ RefAdaAST task_definition_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ task_items_opt(_t);
+ _t = _retTree;
+ private_task_items_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::task_items_opt(RefAdaAST _t) {
+ RefAdaAST task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t157 = _t;
+ RefAdaAST tmp142_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ entrydecls_repspecs_opt(_t);
+ _t = _retTree;
+ _t = __t157;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::private_task_items_opt(RefAdaAST _t) {
+ RefAdaAST private_task_items_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t180 = _t;
+ RefAdaAST tmp143_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PRIVATE_TASK_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ entrydecls_repspecs_opt(_t);
+ _t = _retTree;
+ _t = __t180;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discriminant_specifications(RefAdaAST _t) {
+ RefAdaAST discriminant_specifications_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t148 = _t;
+ RefAdaAST tmp144_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) {
+ discriminant_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop150;
+ }
+
+ }
+ _loop150:;
+ } // ( ... )*
+ _t = __t148;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discriminant_specification(RefAdaAST _t) {
+ RefAdaAST discriminant_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t152 = _t;
+ RefAdaAST tmp145_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_SPECIFICATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t152;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entrydecls_repspecs_opt(RefAdaAST _t) {
+ RefAdaAST entrydecls_repspecs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENTRY_DECLARATION:
+ {
+ entry_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop160;
+ }
+ }
+ }
+ _loop160:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_declaration(RefAdaAST _t) {
+ RefAdaAST entry_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t162 = _t;
+ RefAdaAST tmp146_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp147_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrete_subtype_def_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t162;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::rep_spec(RefAdaAST _t) {
+ RefAdaAST rep_spec_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ RefAdaAST __t168 = _t;
+ RefAdaAST tmp148_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD_REPRESENTATION_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ align_opt(_t);
+ _t = _retTree;
+ comp_loc_s(_t);
+ _t = _retTree;
+ _t = __t168;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AT_CLAUSE:
+ {
+ RefAdaAST __t169 = _t;
+ RefAdaAST tmp149_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AT_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t169;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ {
+ RefAdaAST __t170 = _t;
+ RefAdaAST tmp150_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ATTRIBUTE_DEFINITION_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t170;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ {
+ RefAdaAST __t171 = _t;
+ RefAdaAST tmp151_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENUMERATION_REPESENTATION_CLAUSE);
+ _t = _t->getFirstChild();
+ local_enum_name(_t);
+ _t = _retTree;
+ enumeration_aggregate(_t);
+ _t = _retTree;
+ _t = __t171;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discrete_subtype_def_opt(RefAdaAST _t) {
+ RefAdaAST discrete_subtype_def_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t164 = _t;
+ RefAdaAST tmp152_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRETE_SUBTYPE_DEF_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case SUBTYPE_INDICATION:
+ {
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t164;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discrete_subtype_definition(RefAdaAST _t) {
+ RefAdaAST discrete_subtype_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBTYPE_INDICATION:
+ {
+ subtype_ind(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subtype_ind(RefAdaAST _t) {
+ RefAdaAST subtype_ind_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t239 = _t;
+ RefAdaAST tmp153_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SUBTYPE_INDICATION);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ constraint_opt(_t);
+ _t = _retTree;
+ _t = __t239;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::align_opt(RefAdaAST _t) {
+ RefAdaAST align_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t173 = _t;
+ RefAdaAST tmp154_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD_CLAUSE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t173;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::comp_loc_s(RefAdaAST _t) {
+ RefAdaAST comp_loc_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t176 = _t;
+ RefAdaAST tmp155_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_CLAUSES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ {
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop178;
+ }
+ }
+ }
+ _loop178:;
+ } // ( ... )*
+ _t = __t176;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::local_enum_name(RefAdaAST _t) {
+ RefAdaAST local_enum_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp156_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::enumeration_aggregate(RefAdaAST _t) {
+ RefAdaAST enumeration_aggregate_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_2.member(_t->getType()))) {
+ value(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop293;
+ }
+
+ }
+ _loop293:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::protected_definition(RefAdaAST _t) {
+ RefAdaAST protected_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ prot_op_decl_s(_t);
+ _t = _retTree;
+ prot_private_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_private_opt(RefAdaAST _t) {
+ RefAdaAST prot_private_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t185 = _t;
+ RefAdaAST tmp157_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_PRIVATE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROT_MEMBER_DECLARATIONS:
+ {
+ prot_member_decl_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t185;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_member_decl_s(RefAdaAST _t) {
+ RefAdaAST prot_member_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t196 = _t;
+ RefAdaAST tmp158_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_MEMBER_DECLARATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENTRY_DECLARATION:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case FUNCTION_DECLARATION:
+ case PROCEDURE_DECLARATION:
+ {
+ prot_op_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMPONENT_DECLARATION:
+ {
+ comp_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop198;
+ }
+ }
+ }
+ _loop198:;
+ } // ( ... )*
+ _t = __t196;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_op_decl_s(RefAdaAST _t) {
+ RefAdaAST prot_op_decl_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t189 = _t;
+ RefAdaAST tmp159_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_DECLARATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_3.member(_t->getType()))) {
+ prot_op_decl(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop191;
+ }
+
+ }
+ _loop191:;
+ } // ( ... )*
+ _t = __t189;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_op_decl(RefAdaAST _t) {
+ RefAdaAST prot_op_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENTRY_DECLARATION:
+ {
+ entry_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t193 = _t;
+ RefAdaAST tmp160_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t193;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t194 = _t;
+ RefAdaAST tmp161_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t194;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::comp_decl(RefAdaAST _t) {
+ RefAdaAST comp_decl_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t200 = _t;
+ RefAdaAST tmp162_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ component_subtype_def(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t200;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::component_subtype_def(RefAdaAST _t) {
+ RefAdaAST component_subtype_def_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::enum_id_s(RefAdaAST _t) {
+ RefAdaAST enum_id_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt224=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) {
+ enumeration_literal_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt224>=1 ) { goto _loop224; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt224++;
+ }
+ _loop224:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range_constraint_opt(RefAdaAST _t) {
+ RefAdaAST range_constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE_CONSTRAINT:
+ {
+ range_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::array_type_declaration(RefAdaAST _t) {
+ RefAdaAST array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t230 = _t;
+ RefAdaAST tmp163_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp164_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ array_type_definition(_t);
+ _t = _retTree;
+ _t = __t230;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::access_type_declaration(RefAdaAST _t) {
+ RefAdaAST access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t263 = _t;
+ RefAdaAST tmp165_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp166_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t263;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t264 = _t;
+ RefAdaAST tmp167_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp168_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t264;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS_TO_OBJECT_DECLARATION:
+ {
+ RefAdaAST __t265 = _t;
+ RefAdaAST tmp169_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCESS_TO_OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp170_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t265;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::id_and_discrim(RefAdaAST _t) {
+ RefAdaAST id_and_discrim_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp171_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrim_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::record_definition(RefAdaAST _t) {
+ RefAdaAST record_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case COMPONENT_ITEMS:
+ {
+ component_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::array_type_definition(RefAdaAST _t) {
+ RefAdaAST array_type_definition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ index_or_discrete_range_s(_t);
+ _t = _retTree;
+ component_subtype_def(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::enumeration_literal_specification(RefAdaAST _t) {
+ RefAdaAST enumeration_literal_specification_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp172_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp173_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::index_or_discrete_range_s(RefAdaAST _t) {
+ RefAdaAST index_or_discrete_range_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case DOT_DOT:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ index_or_discrete_range(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMMA:
+ {
+ RefAdaAST __t232 = _t;
+ RefAdaAST tmp174_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMMA);
+ _t = _t->getFirstChild();
+ index_or_discrete_range_s(_t);
+ _t = _retTree;
+ index_or_discrete_range(_t);
+ _t = _retTree;
+ _t = __t232;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::index_or_discrete_range(RefAdaAST _t) {
+ RefAdaAST index_or_discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ RefAdaAST __t234 = _t;
+ RefAdaAST tmp175_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT_DOT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t234;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RANGE:
+ {
+ RefAdaAST __t235 = _t;
+ RefAdaAST tmp176_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RANGE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ RefAdaAST tmp177_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t235;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ simple_expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::constraint_opt(RefAdaAST _t) {
+ RefAdaAST constraint_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE_CONSTRAINT:
+ {
+ range_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DIGITS_CONSTRAINT:
+ {
+ digits_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELTA_CONSTRAINT:
+ {
+ delta_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case INDEX_CONSTRAINT:
+ {
+ index_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DISCRIMINANT_CONSTRAINT:
+ {
+ discriminant_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::digits_constraint(RefAdaAST _t) {
+ RefAdaAST digits_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t243 = _t;
+ RefAdaAST tmp178_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIGITS_CONSTRAINT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t243;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::delta_constraint(RefAdaAST _t) {
+ RefAdaAST delta_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t245 = _t;
+ RefAdaAST tmp179_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELTA_CONSTRAINT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t245;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::index_constraint(RefAdaAST _t) {
+ RefAdaAST index_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t247 = _t;
+ RefAdaAST tmp180_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEX_CONSTRAINT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt249=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) {
+ discrete_range(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt249>=1 ) { goto _loop249; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt249++;
+ }
+ _loop249:;
+ } // ( ... )+
+ _t = __t247;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discriminant_constraint(RefAdaAST _t) {
+ RefAdaAST discriminant_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t252 = _t;
+ RefAdaAST tmp181_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_CONSTRAINT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt254=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) {
+ discriminant_association(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt254>=1 ) { goto _loop254; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt254++;
+ }
+ _loop254:;
+ } // ( ... )+
+ _t = __t252;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discrete_range(RefAdaAST _t) {
+ RefAdaAST discrete_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBTYPE_INDICATION:
+ {
+ subtype_ind(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discriminant_association(RefAdaAST _t) {
+ RefAdaAST discriminant_association_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t256 = _t;
+ RefAdaAST tmp182_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DISCRIMINANT_ASSOCIATION);
+ _t = _t->getFirstChild();
+ selector_names_opt(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t256;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::selector_names_opt(RefAdaAST _t) {
+ RefAdaAST selector_names_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t258 = _t;
+ RefAdaAST tmp183_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTOR_NAMES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER)) {
+ selector_name(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop260;
+ }
+
+ }
+ _loop260:;
+ } // ( ... )*
+ _t = __t258;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::selector_name(RefAdaAST _t) {
+ RefAdaAST selector_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp184_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::component_list(RefAdaAST _t) {
+ RefAdaAST component_list_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ component_items(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VARIANT_PART:
+ {
+ variant_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::component_items(RefAdaAST _t) {
+ RefAdaAST component_items_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t271 = _t;
+ RefAdaAST tmp185_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COMPONENT_ITEMS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMPONENT_DECLARATION:
+ {
+ comp_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop273;
+ }
+ }
+ }
+ _loop273:;
+ } // ( ... )*
+ _t = __t271;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::variant_part(RefAdaAST _t) {
+ RefAdaAST variant_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t275 = _t;
+ RefAdaAST tmp186_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_PART);
+ _t = _t->getFirstChild();
+ discriminant_direct_name(_t);
+ _t = _retTree;
+ variant_s(_t);
+ _t = _retTree;
+ _t = __t275;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discriminant_direct_name(RefAdaAST _t) {
+ RefAdaAST discriminant_direct_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp187_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::variant_s(RefAdaAST _t) {
+ RefAdaAST variant_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t278 = _t;
+ RefAdaAST tmp188_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANTS);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt280=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == VARIANT)) {
+ variant(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt280>=1 ) { goto _loop280; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt280++;
+ }
+ _loop280:;
+ } // ( ... )+
+ _t = __t278;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::variant(RefAdaAST _t) {
+ RefAdaAST variant_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t282 = _t;
+ RefAdaAST tmp189_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case COMPONENT_ITEMS:
+ {
+ component_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t282;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::choice_s(RefAdaAST _t) {
+ RefAdaAST choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ RefAdaAST __t285 = _t;
+ RefAdaAST tmp190_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ choice(_t);
+ _t = _retTree;
+ _t = __t285;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case OTHERS:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case AND_THEN:
+ case MARK_WITH_CONSTRAINT:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ choice(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::choice(RefAdaAST _t) {
+ RefAdaAST choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case OTHERS:
+ {
+ RefAdaAST tmp191_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case MARK_WITH_CONSTRAINT:
+ {
+ discrete_with_range(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::discrete_with_range(RefAdaAST _t) {
+ RefAdaAST discrete_with_range_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case MARK_WITH_CONSTRAINT:
+ {
+ mark_with_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::mark_with_constraint(RefAdaAST _t) {
+ RefAdaAST mark_with_constraint_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t289 = _t;
+ RefAdaAST tmp192_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MARK_WITH_CONSTRAINT);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ range_constraint(_t);
+ _t = _retTree;
+ _t = __t289;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::generic_formal_parameter(RefAdaAST _t) {
+ RefAdaAST generic_formal_parameter_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FORMAL_DISCRETE_TYPE_DECLARATION:
+ {
+ RefAdaAST __t299 = _t;
+ RefAdaAST tmp193_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DISCRETE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t299;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ RefAdaAST __t300 = _t;
+ RefAdaAST tmp194_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_SIGNED_INTEGER_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t300;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_MODULAR_TYPE_DECLARATION:
+ {
+ RefAdaAST __t301 = _t;
+ RefAdaAST tmp195_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_MODULAR_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t301;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_DECIMAL_FIXED_POINT_DECLARATION:
+ {
+ RefAdaAST __t302 = _t;
+ RefAdaAST tmp196_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_DECIMAL_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t302;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_ORDINARY_FIXED_POINT_DECLARATION:
+ {
+ RefAdaAST __t303 = _t;
+ RefAdaAST tmp197_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t303;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_FLOATING_POINT_DECLARATION:
+ {
+ RefAdaAST __t304 = _t;
+ RefAdaAST tmp198_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FLOATING_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t304;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_TYPE_DECLARATION:
+ {
+ formal_array_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ formal_access_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case FORMAL_PRIVATE_TYPE_DECLARATION:
+ {
+ RefAdaAST __t305 = _t;
+ RefAdaAST tmp199_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ _t = __t305;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION:
+ {
+ RefAdaAST __t306 = _t;
+ RefAdaAST tmp200_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t306;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PRIVATE_EXTENSION_DECLARATION:
+ {
+ RefAdaAST __t307 = _t;
+ RefAdaAST tmp201_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PRIVATE_EXTENSION_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t307;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PROCEDURE_DECLARATION:
+ {
+ RefAdaAST __t308 = _t;
+ RefAdaAST tmp202_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ subprogram_default_opt(_t);
+ _t = _retTree;
+ _t = __t308;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_FUNCTION_DECLARATION:
+ {
+ RefAdaAST __t309 = _t;
+ RefAdaAST tmp203_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ subprogram_default_opt(_t);
+ _t = _retTree;
+ _t = __t309;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PACKAGE_DECLARATION:
+ {
+ RefAdaAST __t310 = _t;
+ RefAdaAST tmp204_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FORMAL_PACKAGE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ compound_name(_t);
+ _t = _retTree;
+ formal_package_actual_part_opt(_t);
+ _t = _retTree;
+ _t = __t310;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PARAMETER_SPECIFICATION:
+ {
+ parameter_specification(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::formal_array_type_declaration(RefAdaAST _t) {
+ RefAdaAST formal_array_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ array_type_declaration(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::formal_access_type_declaration(RefAdaAST _t) {
+ RefAdaAST formal_access_type_declaration_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ access_type_declaration(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::id_part(RefAdaAST _t) {
+ RefAdaAST id_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprogram_default_opt(RefAdaAST _t) {
+ RefAdaAST subprogram_default_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ RefAdaAST tmp205_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::formal_package_actual_part_opt(RefAdaAST _t) {
+ RefAdaAST formal_package_actual_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ RefAdaAST tmp206_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DEFINING_IDENTIFIER_LIST:
+ {
+ defining_identifier_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::body_part(RefAdaAST _t) {
+ RefAdaAST body_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ declarative_part(_t);
+ _t = _retTree;
+ block_body(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::declarative_part(RefAdaAST _t) {
+ RefAdaAST declarative_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t324 = _t;
+ RefAdaAST tmp207_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARATIVE_PART);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PACKAGE_BODY:
+ case PACKAGE_BODY_STUB:
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case PROTECTED_BODY:
+ case PROTECTED_BODY_STUB:
+ case PROTECTED_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SINGLE_PROTECTED_DECLARATION:
+ case SINGLE_TASK_DECLARATION:
+ case SUBTYPE_DECLARATION:
+ case TASK_BODY:
+ case TASK_BODY_STUB:
+ case TASK_TYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ declarative_item(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop326;
+ }
+ }
+ }
+ _loop326:;
+ } // ( ... )*
+ _t = __t324;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::block_body(RefAdaAST _t) {
+ RefAdaAST block_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t343 = _t;
+ RefAdaAST tmp208_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY);
+ _t = _t->getFirstChild();
+ handled_stmt_s(_t);
+ _t = _retTree;
+ _t = __t343;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::declarative_item(RefAdaAST _t) {
+ RefAdaAST declarative_item_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKAGE_BODY_STUB:
+ {
+ RefAdaAST __t328 = _t;
+ RefAdaAST tmp209_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t328;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ RefAdaAST __t329 = _t;
+ RefAdaAST tmp210_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t329;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ spec_decl_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case TASK_BODY_STUB:
+ {
+ RefAdaAST __t330 = _t;
+ RefAdaAST tmp211_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t330;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TASK_BODY:
+ {
+ RefAdaAST __t331 = _t;
+ RefAdaAST tmp212_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t331;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ {
+ task_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_BODY_STUB:
+ {
+ RefAdaAST __t332 = _t;
+ RefAdaAST tmp213_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t332;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED_BODY:
+ {
+ RefAdaAST __t333 = _t;
+ RefAdaAST tmp214_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ prot_op_bodies_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t333;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED_TYPE_DECLARATION:
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ prot_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl_or_rename_or_inst_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SUBTYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ decl_common(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::prot_op_bodies_opt(RefAdaAST _t) {
+ RefAdaAST prot_op_bodies_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t339 = _t;
+ RefAdaAST tmp215_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROT_OP_BODIES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ENTRY_BODY:
+ {
+ entry_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ case FUNCTION_DECLARATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_DECLARATION:
+ {
+ subprog_decl_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop341;
+ }
+ }
+ }
+ _loop341:;
+ } // ( ... )*
+ _t = __t339;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::block_body_opt(RefAdaAST _t) {
+ RefAdaAST block_body_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t336 = _t;
+ RefAdaAST tmp216_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_BODY_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case HANDLED_SEQUENCE_OF_STATEMENTS:
+ {
+ handled_stmt_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t336;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::handled_stmt_s(RefAdaAST _t) {
+ RefAdaAST handled_stmt_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t345 = _t;
+ RefAdaAST tmp217_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_SEQUENCE_OF_STATEMENTS);
+ _t = _t->getFirstChild();
+ statements(_t);
+ _t = _retTree;
+ except_handler_part_opt(_t);
+ _t = _retTree;
+ _t = __t345;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_body(RefAdaAST _t) {
+ RefAdaAST entry_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t405 = _t;
+ RefAdaAST tmp218_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ entry_body_formal_part(_t);
+ _t = _retTree;
+ entry_barrier(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t405;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::statements(RefAdaAST _t) {
+ RefAdaAST statements_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t350 = _t;
+ RefAdaAST tmp219_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SEQUENCE_OF_STATEMENTS);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt352=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case STATEMENT:
+ {
+ statement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ if ( _cnt352>=1 ) { goto _loop352; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+ }
+ _cnt352++;
+ }
+ _loop352:;
+ } // ( ... )+
+ _t = __t350;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::except_handler_part_opt(RefAdaAST _t) {
+ RefAdaAST except_handler_part_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t455 = _t;
+ RefAdaAST tmp220_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPT_HANDLER_PART_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == EXCEPTION_HANDLER)) {
+ exception_handler(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop457;
+ }
+
+ }
+ _loop457:;
+ } // ( ... )*
+ _t = __t455;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::handled_stmts_opt(RefAdaAST _t) {
+ RefAdaAST handled_stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t347 = _t;
+ RefAdaAST tmp221_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),HANDLED_STMTS_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SEQUENCE_OF_STATEMENTS:
+ {
+ statements(_t);
+ _t = _retTree;
+ except_handler_part_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t347;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::statement(RefAdaAST _t) {
+ RefAdaAST statement_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t354 = _t;
+ RefAdaAST tmp222_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STATEMENT);
+ _t = _t->getFirstChild();
+ def_label_opt(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NULL_STATEMENT:
+ {
+ null_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case EXIT_STATEMENT:
+ {
+ exit_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case RETURN_STATEMENT:
+ {
+ return_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case GOTO_STATEMENT:
+ {
+ goto_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELAY_STATEMENT:
+ {
+ delay_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABORT_STATEMENT:
+ {
+ abort_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case RAISE_STATEMENT:
+ {
+ raise_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case REQUEUE_STATEMENT:
+ {
+ requeue_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCEPT_STATEMENT:
+ {
+ accept_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ASYNCHRONOUS_SELECT:
+ case CONDITIONAL_ENTRY_CALL:
+ case SELECTIVE_ACCEPT:
+ case TIMED_ENTRY_CALL:
+ {
+ select_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case IF_STATEMENT:
+ {
+ if_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case CASE_STATEMENT:
+ {
+ case_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case LOOP_STATEMENT:
+ {
+ loop_stmt(_t);
+ _t = _retTree;
+ id_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case BLOCK_STATEMENT:
+ {
+ block(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ASSIGNMENT_STATEMENT:
+ case CALL_STATEMENT:
+ {
+ call_or_assignment(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t354;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::def_label_opt(RefAdaAST _t) {
+ RefAdaAST def_label_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t357 = _t;
+ RefAdaAST tmp223_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LABEL_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp224_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t357;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::null_stmt(RefAdaAST _t) {
+ RefAdaAST null_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp225_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NULL_STATEMENT);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::exit_stmt(RefAdaAST _t) {
+ RefAdaAST exit_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t392 = _t;
+ RefAdaAST tmp226_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXIT_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ label_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ case WHEN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case WHEN:
+ {
+ RefAdaAST tmp227_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHEN);
+ _t = _t->getNextSibling();
+ condition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t392;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::return_stmt(RefAdaAST _t) {
+ RefAdaAST return_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t397 = _t;
+ RefAdaAST tmp228_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RETURN_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t397;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::goto_stmt(RefAdaAST _t) {
+ RefAdaAST goto_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t400 = _t;
+ RefAdaAST tmp229_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GOTO_STATEMENT);
+ _t = _t->getFirstChild();
+ label_name(_t);
+ _t = _retTree;
+ _t = __t400;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::delay_stmt(RefAdaAST _t) {
+ RefAdaAST delay_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t419 = _t;
+ RefAdaAST tmp230_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_STATEMENT);
+ _t = _t->getFirstChild();
+ modifiers(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t419;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::abort_stmt(RefAdaAST _t) {
+ RefAdaAST abort_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t451 = _t;
+ RefAdaAST tmp231_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT_STATEMENT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt453=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_4.member(_t->getType()))) {
+ name(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt453>=1 ) { goto _loop453; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt453++;
+ }
+ _loop453:;
+ } // ( ... )+
+ _t = __t451;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::raise_stmt(RefAdaAST _t) {
+ RefAdaAST raise_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t467 = _t;
+ RefAdaAST tmp232_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RAISE_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t467;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::requeue_stmt(RefAdaAST _t) {
+ RefAdaAST requeue_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t470 = _t;
+ RefAdaAST tmp233_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REQUEUE_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABORT:
+ {
+ RefAdaAST tmp234_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t470;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::accept_stmt(RefAdaAST _t) {
+ RefAdaAST accept_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t414 = _t;
+ RefAdaAST tmp235_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_STATEMENT);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ entry_index_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ handled_stmts_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t414;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::select_stmt(RefAdaAST _t) {
+ RefAdaAST select_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASYNCHRONOUS_SELECT:
+ {
+ RefAdaAST __t421 = _t;
+ RefAdaAST tmp236_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASYNCHRONOUS_SELECT);
+ _t = _t->getFirstChild();
+ triggering_alternative(_t);
+ _t = _retTree;
+ abortable_part(_t);
+ _t = _retTree;
+ _t = __t421;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SELECTIVE_ACCEPT:
+ {
+ RefAdaAST __t422 = _t;
+ RefAdaAST tmp237_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SELECTIVE_ACCEPT);
+ _t = _t->getFirstChild();
+ selective_accept(_t);
+ _t = _retTree;
+ _t = __t422;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIMED_ENTRY_CALL:
+ {
+ RefAdaAST __t423 = _t;
+ RefAdaAST tmp238_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIMED_ENTRY_CALL);
+ _t = _t->getFirstChild();
+ entry_call_alternative(_t);
+ _t = _retTree;
+ delay_alternative(_t);
+ _t = _retTree;
+ _t = __t423;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONDITIONAL_ENTRY_CALL:
+ {
+ RefAdaAST __t424 = _t;
+ RefAdaAST tmp239_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONDITIONAL_ENTRY_CALL);
+ _t = _t->getFirstChild();
+ entry_call_alternative(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t424;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::if_stmt(RefAdaAST _t) {
+ RefAdaAST if_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t361 = _t;
+ RefAdaAST tmp240_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IF_STATEMENT);
+ _t = _t->getFirstChild();
+ cond_clause(_t);
+ _t = _retTree;
+ elsifs_opt(_t);
+ _t = _retTree;
+ else_opt(_t);
+ _t = _retTree;
+ _t = __t361;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::case_stmt(RefAdaAST _t) {
+ RefAdaAST case_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t373 = _t;
+ RefAdaAST tmp241_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ alternative_s(_t);
+ _t = _retTree;
+ _t = __t373;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::loop_stmt(RefAdaAST _t) {
+ RefAdaAST loop_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t380 = _t;
+ RefAdaAST tmp242_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LOOP_STATEMENT);
+ _t = _t->getFirstChild();
+ iteration_scheme_opt(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t380;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::block(RefAdaAST _t) {
+ RefAdaAST block_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t387 = _t;
+ RefAdaAST tmp243_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK_STATEMENT);
+ _t = _t->getFirstChild();
+ declare_opt(_t);
+ _t = _retTree;
+ block_body(_t);
+ _t = _retTree;
+ _t = __t387;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::call_or_assignment(RefAdaAST _t) {
+ RefAdaAST call_or_assignment_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASSIGNMENT_STATEMENT:
+ {
+ RefAdaAST __t402 = _t;
+ RefAdaAST tmp244_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGNMENT_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t402;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CALL_STATEMENT:
+ {
+ RefAdaAST __t403 = _t;
+ RefAdaAST tmp245_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CALL_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ _t = __t403;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::cond_clause(RefAdaAST _t) {
+ RefAdaAST cond_clause_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t363 = _t;
+ RefAdaAST tmp246_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COND_CLAUSE);
+ _t = _t->getFirstChild();
+ condition(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t363;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::elsifs_opt(RefAdaAST _t) {
+ RefAdaAST elsifs_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t366 = _t;
+ RefAdaAST tmp247_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSIFS_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == COND_CLAUSE)) {
+ cond_clause(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop368;
+ }
+
+ }
+ _loop368:;
+ } // ( ... )*
+ _t = __t366;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::else_opt(RefAdaAST _t) {
+ RefAdaAST else_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t370 = _t;
+ RefAdaAST tmp248_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELSE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SEQUENCE_OF_STATEMENTS:
+ {
+ statements(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t370;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::condition(RefAdaAST _t) {
+ RefAdaAST condition_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ expression(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::alternative_s(RefAdaAST _t) {
+ RefAdaAST alternative_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt376=0;
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) {
+ case_statement_alternative(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt376>=1 ) { goto _loop376; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt376++;
+ }
+ _loop376:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::case_statement_alternative(RefAdaAST _t) {
+ RefAdaAST case_statement_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t378 = _t;
+ RefAdaAST tmp249_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_STATEMENT_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t378;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::iteration_scheme_opt(RefAdaAST _t) {
+ RefAdaAST iteration_scheme_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t382 = _t;
+ RefAdaAST tmp250_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ITERATION_SCHEME_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case WHILE:
+ {
+ RefAdaAST __t384 = _t;
+ RefAdaAST tmp251_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHILE);
+ _t = _t->getFirstChild();
+ condition(_t);
+ _t = _retTree;
+ _t = __t384;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FOR:
+ {
+ RefAdaAST __t385 = _t;
+ RefAdaAST tmp252_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR);
+ _t = _t->getFirstChild();
+ RefAdaAST tmp253_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ _t = __t385;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t382;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::declare_opt(RefAdaAST _t) {
+ RefAdaAST declare_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t389 = _t;
+ RefAdaAST tmp254_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DECLARE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DECLARATIVE_PART:
+ {
+ declarative_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t389;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::label_name(RefAdaAST _t) {
+ RefAdaAST label_name_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST tmp255_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_body_formal_part(RefAdaAST _t) {
+ RefAdaAST entry_body_formal_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ entry_index_spec_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_barrier(RefAdaAST _t) {
+ RefAdaAST entry_barrier_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ condition(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_index_spec_opt(RefAdaAST _t) {
+ RefAdaAST entry_index_spec_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t408 = _t;
+ RefAdaAST tmp256_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_SPECIFICATION);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ def_id(_t);
+ _t = _retTree;
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t408;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_call_stmt(RefAdaAST _t) {
+ RefAdaAST entry_call_stmt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t412 = _t;
+ RefAdaAST tmp257_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ _t = __t412;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_index_opt(RefAdaAST _t) {
+ RefAdaAST entry_index_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t416 = _t;
+ RefAdaAST tmp258_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_INDEX_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t416;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::triggering_alternative(RefAdaAST _t) {
+ RefAdaAST triggering_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t426 = _t;
+ RefAdaAST tmp259_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TRIGGERING_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DELAY_STATEMENT:
+ {
+ delay_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ENTRY_CALL_STATEMENT:
+ {
+ entry_call_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t426;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::abortable_part(RefAdaAST _t) {
+ RefAdaAST abortable_part_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t429 = _t;
+ RefAdaAST tmp260_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABORTABLE_PART);
+ _t = _t->getFirstChild();
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t429;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::selective_accept(RefAdaAST _t) {
+ RefAdaAST selective_accept_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ guard_opt(_t);
+ _t = _retTree;
+ select_alternative(_t);
+ _t = _retTree;
+ or_select_opt(_t);
+ _t = _retTree;
+ else_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::entry_call_alternative(RefAdaAST _t) {
+ RefAdaAST entry_call_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t431 = _t;
+ RefAdaAST tmp261_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ENTRY_CALL_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ entry_call_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t431;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::delay_alternative(RefAdaAST _t) {
+ RefAdaAST delay_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t442 = _t;
+ RefAdaAST tmp262_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DELAY_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ delay_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t442;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::stmts_opt(RefAdaAST _t) {
+ RefAdaAST stmts_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case STATEMENT:
+ {
+ statement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop445;
+ }
+ }
+ }
+ _loop445:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::guard_opt(RefAdaAST _t) {
+ RefAdaAST guard_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t434 = _t;
+ RefAdaAST tmp263_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GUARD_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ condition(_t);
+ _t = _retTree;
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == PRAGMA)) {
+ pragma(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop437;
+ }
+
+ }
+ _loop437:;
+ } // ( ... )*
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t434;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::select_alternative(RefAdaAST _t) {
+ RefAdaAST select_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ACCEPT_ALTERNATIVE:
+ {
+ accept_alternative(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELAY_ALTERNATIVE:
+ {
+ delay_alternative(_t);
+ _t = _retTree;
+ break;
+ }
+ case TERMINATE_ALTERNATIVE:
+ {
+ RefAdaAST tmp264_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TERMINATE_ALTERNATIVE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::or_select_opt(RefAdaAST _t) {
+ RefAdaAST or_select_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t447 = _t;
+ RefAdaAST tmp265_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR_SELECT_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == GUARD_OPT)) {
+ guard_opt(_t);
+ _t = _retTree;
+ select_alternative(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop449;
+ }
+
+ }
+ _loop449:;
+ } // ( ... )*
+ _t = __t447;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::accept_alternative(RefAdaAST _t) {
+ RefAdaAST accept_alternative_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t440 = _t;
+ RefAdaAST tmp266_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ACCEPT_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ accept_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t440;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::exception_handler(RefAdaAST _t) {
+ RefAdaAST exception_handler_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t459 = _t;
+ RefAdaAST tmp267_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXCEPTION_HANDLER);
+ _t = _t->getFirstChild();
+ identifier_colon_opt(_t);
+ _t = _retTree;
+ except_choice_s(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t459;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::identifier_colon_opt(RefAdaAST _t) {
+ RefAdaAST identifier_colon_opt_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t461 = _t;
+ RefAdaAST tmp268_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER_COLON_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp269_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t461;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::except_choice_s(RefAdaAST _t) {
+ RefAdaAST except_choice_s_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ RefAdaAST __t464 = _t;
+ RefAdaAST tmp270_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PIPE);
+ _t = _t->getFirstChild();
+ except_choice_s(_t);
+ _t = _retTree;
+ exception_choice(_t);
+ _t = _retTree;
+ _t = __t464;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case OTHERS:
+ {
+ exception_choice(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::exception_choice(RefAdaAST _t) {
+ RefAdaAST exception_choice_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case OTHERS:
+ {
+ RefAdaAST tmp271_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OTHERS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::operator_call(RefAdaAST _t) {
+ RefAdaAST operator_call_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t473 = _t;
+ RefAdaAST tmp272_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL);
+ _t = _t->getFirstChild();
+ value_s(_t);
+ _t = _retTree;
+ _t = __t473;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::relation(RefAdaAST _t) {
+ RefAdaAST relation_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IN:
+ {
+ RefAdaAST __t485 = _t;
+ RefAdaAST tmp273_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ range_or_mark(_t);
+ _t = _retTree;
+ _t = __t485;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NOT_IN:
+ {
+ RefAdaAST __t486 = _t;
+ RefAdaAST tmp274_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT_IN);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ range_or_mark(_t);
+ _t = _retTree;
+ _t = __t486;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EQ:
+ {
+ RefAdaAST __t487 = _t;
+ RefAdaAST tmp275_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQ);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t487;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NE:
+ {
+ RefAdaAST __t488 = _t;
+ RefAdaAST tmp276_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t488;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LT_:
+ {
+ RefAdaAST __t489 = _t;
+ RefAdaAST tmp277_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LT_);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t489;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LE:
+ {
+ RefAdaAST __t490 = _t;
+ RefAdaAST tmp278_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t490;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GT:
+ {
+ RefAdaAST __t491 = _t;
+ RefAdaAST tmp279_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t491;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GE:
+ {
+ RefAdaAST __t492 = _t;
+ RefAdaAST tmp280_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t492;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ simple_expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::range_or_mark(RefAdaAST _t) {
+ RefAdaAST range_or_mark_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ {
+ subtype_mark(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::signed_term(RefAdaAST _t) {
+ RefAdaAST signed_term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case UNARY_PLUS:
+ {
+ RefAdaAST __t499 = _t;
+ RefAdaAST tmp281_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_PLUS);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ _t = __t499;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case UNARY_MINUS:
+ {
+ RefAdaAST __t500 = _t;
+ RefAdaAST tmp282_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_MINUS);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ _t = __t500;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ term(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::term(RefAdaAST _t) {
+ RefAdaAST term_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case STAR:
+ {
+ RefAdaAST __t502 = _t;
+ RefAdaAST tmp283_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t502;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIV:
+ {
+ RefAdaAST __t503 = _t;
+ RefAdaAST tmp284_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t503;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MOD:
+ {
+ RefAdaAST __t504 = _t;
+ RefAdaAST tmp285_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t504;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case REM:
+ {
+ RefAdaAST __t505 = _t;
+ RefAdaAST tmp286_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REM);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t505;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ factor(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::factor(RefAdaAST _t) {
+ RefAdaAST factor_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NOT:
+ {
+ RefAdaAST __t507 = _t;
+ RefAdaAST tmp287_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ _t = __t507;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABS:
+ {
+ RefAdaAST __t508 = _t;
+ RefAdaAST tmp288_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABS);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ _t = __t508;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EXPON:
+ {
+ RefAdaAST __t509 = _t;
+ RefAdaAST tmp289_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXPON);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ primary(_t);
+ _t = _retTree;
+ _t = __t509;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ primary(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::primary(RefAdaAST _t) {
+ RefAdaAST primary_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name_or_qualified(_t);
+ _t = _retTree;
+ break;
+ }
+ case PARENTHESIZED_PRIMARY:
+ {
+ parenthesized_primary(_t);
+ _t = _retTree;
+ break;
+ }
+ case ALLOCATOR:
+ {
+ allocator(_t);
+ _t = _retTree;
+ break;
+ }
+ case NuLL:
+ {
+ RefAdaAST tmp290_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUMERIC_LIT:
+ {
+ RefAdaAST tmp291_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUMERIC_LIT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp292_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHAR_STRING:
+ {
+ RefAdaAST tmp293_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHAR_STRING);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ operator_call(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::name_or_qualified(RefAdaAST _t) {
+ RefAdaAST name_or_qualified_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp294_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefAdaAST __t513 = _t;
+ RefAdaAST tmp295_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ RefAdaAST tmp296_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ RefAdaAST tmp297_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ RefAdaAST tmp298_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ RefAdaAST tmp299_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t513;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ RefAdaAST __t515 = _t;
+ RefAdaAST tmp300_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t515;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIC:
+ {
+ RefAdaAST __t516 = _t;
+ RefAdaAST tmp301_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TIC);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ {
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PARENTHESIZED_PRIMARY:
+ {
+ parenthesized_primary(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case RANGE:
+ case DIGITS:
+ case DELTA:
+ case ACCESS:
+ {
+ attribute_id(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t516;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::allocator(RefAdaAST _t) {
+ RefAdaAST allocator_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t519 = _t;
+ RefAdaAST tmp302_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ALLOCATOR);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ _t = __t519;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::subprogram_body(RefAdaAST _t) {
+ RefAdaAST subprogram_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::task_body(RefAdaAST _t) {
+ RefAdaAST task_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t525 = _t;
+ RefAdaAST tmp303_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TASK_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t525;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::protected_body(RefAdaAST _t) {
+ RefAdaAST protected_body_AST_in = (_t == RefAdaAST(ASTNULL)) ? RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefAdaAST __t527 = _t;
+ RefAdaAST tmp304_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROTECTED_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ prot_op_bodies_opt(_t);
+ _t = _retTree;
+ _t = __t527;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefAdaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaStoreWalker::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& )
+{
+}
+const char* AdaStoreWalker::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "\"pragma\"",
+ "IDENTIFIER",
+ "SEMI",
+ "LPAREN",
+ "COMMA",
+ "RPAREN",
+ "RIGHT_SHAFT",
+ "\"with\"",
+ "DOT",
+ "\"use\"",
+ "\"type\"",
+ "TIC",
+ "\"range\"",
+ "\"digits\"",
+ "\"delta\"",
+ "\"access\"",
+ "\"private\"",
+ "\"package\"",
+ "\"body\"",
+ "\"is\"",
+ "\"procedure\"",
+ "\"function\"",
+ "\"new\"",
+ "\"others\"",
+ "PIPE",
+ "DOT_DOT",
+ "\"all\"",
+ "COLON",
+ "\"in\"",
+ "\"out\"",
+ "\"renames\"",
+ "CHARACTER_LITERAL",
+ "CHAR_STRING",
+ "\"null\"",
+ "\"record\"",
+ "\"separate\"",
+ "\"abstract\"",
+ "\"return\"",
+ "\"task\"",
+ "\"protected\"",
+ "BOX",
+ "ASSIGN",
+ "\"entry\"",
+ "\"for\"",
+ "\"end\"",
+ "\"at\"",
+ "\"mod\"",
+ "\"subtype\"",
+ "\"exception\"",
+ "\"constant\"",
+ "\"array\"",
+ "\"of\"",
+ "\"aliased\"",
+ "\"case\"",
+ "\"when\"",
+ "\"tagged\"",
+ "\"limited\"",
+ "\"generic\"",
+ "\"begin\"",
+ "LT_LT",
+ "GT_GT",
+ "\"if\"",
+ "\"then\"",
+ "\"elsif\"",
+ "\"else\"",
+ "\"loop\"",
+ "\"while\"",
+ "\"reverse\"",
+ "\"declare\"",
+ "\"exit\"",
+ "\"goto\"",
+ "\"accept\"",
+ "\"do\"",
+ "\"delay\"",
+ "\"until\"",
+ "\"select\"",
+ "\"abort\"",
+ "\"or\"",
+ "\"terminate\"",
+ "\"raise\"",
+ "\"requeue\"",
+ "\"and\"",
+ "\"xor\"",
+ "\"not\"",
+ "EQ",
+ "NE",
+ "LT_",
+ "LE",
+ "GT",
+ "GE",
+ "PLUS",
+ "MINUS",
+ "CONCAT",
+ "STAR",
+ "DIV",
+ "\"rem\"",
+ "\"abs\"",
+ "EXPON",
+ "NUMERIC_LIT",
+ "ABORTABLE_PART",
+ "ABORT_STATEMENT",
+ "ACCEPT_ALTERNATIVE",
+ "ACCEPT_STATEMENT",
+ "ALLOCATOR",
+ "ASSIGNMENT_STATEMENT",
+ "ASYNCHRONOUS_SELECT",
+ "ATTRIBUTE_DEFINITION_CLAUSE",
+ "AT_CLAUSE",
+ "BLOCK_STATEMENT",
+ "CASE_STATEMENT",
+ "CASE_STATEMENT_ALTERNATIVE",
+ "CODE_STATEMENT",
+ "COMPONENT_DECLARATION",
+ "CONDITIONAL_ENTRY_CALL",
+ "CONTEXT_CLAUSE",
+ "DECLARATIVE_PART",
+ "DEFINING_IDENTIFIER_LIST",
+ "DELAY_ALTERNATIVE",
+ "DELAY_STATEMENT",
+ "DELTA_CONSTRAINT",
+ "DIGITS_CONSTRAINT",
+ "DISCRIMINANT_ASSOCIATION",
+ "DISCRIMINANT_CONSTRAINT",
+ "DISCRIMINANT_SPECIFICATION",
+ "ENTRY_BODY",
+ "ENTRY_CALL_ALTERNATIVE",
+ "ENTRY_CALL_STATEMENT",
+ "ENTRY_DECLARATION",
+ "ENTRY_INDEX_SPECIFICATION",
+ "ENUMERATION_REPESENTATION_CLAUSE",
+ "EXCEPTION_DECLARATION",
+ "EXCEPTION_HANDLER",
+ "EXCEPTION_RENAMING_DECLARATION",
+ "EXIT_STATEMENT",
+ "FORMAL_PACKAGE_DECLARATION",
+ "GENERIC_FORMAL_PART",
+ "GENERIC_PACKAGE_DECLARATION",
+ "GOTO_STATEMENT",
+ "HANDLED_SEQUENCE_OF_STATEMENTS",
+ "HANDLED_STMTS_OPT",
+ "IF_STATEMENT",
+ "INCOMPLETE_TYPE_DECLARATION",
+ "INDEXED_COMPONENT",
+ "INDEX_CONSTRAINT",
+ "LIBRARY_ITEM",
+ "LOOP_STATEMENT",
+ "NAME",
+ "NULL_STATEMENT",
+ "NUMBER_DECLARATION",
+ "OBJECT_DECLARATION",
+ "OBJECT_RENAMING_DECLARATION",
+ "OPERATOR_SYMBOL",
+ "PACKAGE_BODY",
+ "PACKAGE_BODY_STUB",
+ "PACKAGE_RENAMING_DECLARATION",
+ "PACKAGE_SPECIFICATION",
+ "PARAMETER_SPECIFICATION",
+ "PRIVATE_EXTENSION_DECLARATION",
+ "PRIVATE_TYPE_DECLARATION",
+ "PROTECTED_BODY",
+ "PROTECTED_BODY_STUB",
+ "PROTECTED_TYPE_DECLARATION",
+ "RAISE_STATEMENT",
+ "RANGE_ATTRIBUTE_REFERENCE",
+ "RECORD_REPRESENTATION_CLAUSE",
+ "REQUEUE_STATEMENT",
+ "RETURN_STATEMENT",
+ "SELECTIVE_ACCEPT",
+ "SEQUENCE_OF_STATEMENTS",
+ "SINGLE_PROTECTED_DECLARATION",
+ "SINGLE_TASK_DECLARATION",
+ "STATEMENT",
+ "SUBTYPE_DECLARATION",
+ "SUBTYPE_INDICATION",
+ "SUBTYPE_MARK",
+ "SUBUNIT",
+ "TASK_BODY",
+ "TASK_BODY_STUB",
+ "TASK_TYPE_DECLARATION",
+ "TERMINATE_ALTERNATIVE",
+ "TIMED_ENTRY_CALL",
+ "TRIGGERING_ALTERNATIVE",
+ "USE_CLAUSE",
+ "USE_TYPE_CLAUSE",
+ "VARIANT",
+ "VARIANT_PART",
+ "WITH_CLAUSE",
+ "ABSTRACT_FUNCTION_DECLARATION",
+ "ABSTRACT_PROCEDURE_DECLARATION",
+ "ACCESS_TO_FUNCTION_DECLARATION",
+ "ACCESS_TO_OBJECT_DECLARATION",
+ "ACCESS_TO_PROCEDURE_DECLARATION",
+ "ARRAY_OBJECT_DECLARATION",
+ "ARRAY_TYPE_DECLARATION",
+ "AND_THEN",
+ "BASIC_DECLARATIVE_ITEMS_OPT",
+ "BLOCK_BODY",
+ "BLOCK_BODY_OPT",
+ "CALL_STATEMENT",
+ "COMPONENT_CLAUSES_OPT",
+ "COMPONENT_ITEMS",
+ "COND_CLAUSE",
+ "DECIMAL_FIXED_POINT_DECLARATION",
+ "DECLARE_OPT",
+ "DERIVED_RECORD_EXTENSION",
+ "DISCRETE_SUBTYPE_DEF_OPT",
+ "DISCRIMINANT_SPECIFICATIONS",
+ "DISCRIM_PART_OPT",
+ "ELSE_OPT",
+ "ELSIFS_OPT",
+ "END_ID_OPT",
+ "ENTRY_INDEX_OPT",
+ "ENUMERATION_TYPE_DECLARATION",
+ "EXCEPT_HANDLER_PART_OPT",
+ "EXTENSION_OPT",
+ "FLOATING_POINT_DECLARATION",
+ "FORMAL_DECIMAL_FIXED_POINT_DECLARATION",
+ "FORMAL_DISCRETE_TYPE_DECLARATION",
+ "FORMAL_FLOATING_POINT_DECLARATION",
+ "FORMAL_FUNCTION_DECLARATION",
+ "FORMAL_MODULAR_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_FIXED_POINT_DECLARATION",
+ "FORMAL_PART_OPT",
+ "FORMAL_PRIVATE_EXTENSION_DECLARATION",
+ "FORMAL_PRIVATE_TYPE_DECLARATION",
+ "FORMAL_PROCEDURE_DECLARATION",
+ "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION",
+ "FUNCTION_BODY",
+ "FUNCTION_BODY_STUB",
+ "FUNCTION_DECLARATION",
+ "FUNCTION_RENAMING_DECLARATION",
+ "GENERIC_FUNCTION_DECLARATION",
+ "GENERIC_FUNCTION_INSTANTIATION",
+ "GENERIC_FUNCTION_RENAMING",
+ "GENERIC_PACKAGE_INSTANTIATION",
+ "GENERIC_PACKAGE_RENAMING",
+ "GENERIC_PROCEDURE_DECLARATION",
+ "GENERIC_PROCEDURE_INSTANTIATION",
+ "GENERIC_PROCEDURE_RENAMING",
+ "GUARD_OPT",
+ "IDENTIFIER_COLON_OPT",
+ "ID_OPT",
+ "INIT_OPT",
+ "ITERATION_SCHEME_OPT",
+ "LABEL_OPT",
+ "MARK_WITH_CONSTRAINT",
+ "MODIFIERS",
+ "MODULAR_TYPE_DECLARATION",
+ "MOD_CLAUSE_OPT",
+ "NOT_IN",
+ "ORDINARY_DERIVED_TYPE_DECLARATION",
+ "ORDINARY_FIXED_POINT_DECLARATION",
+ "OR_ELSE",
+ "OR_SELECT_OPT",
+ "PARENTHESIZED_PRIMARY",
+ "PRIVATE_DECLARATIVE_ITEMS_OPT",
+ "PRIVATE_TASK_ITEMS_OPT",
+ "PROCEDURE_BODY",
+ "PROCEDURE_BODY_STUB",
+ "PROCEDURE_DECLARATION",
+ "PROCEDURE_RENAMING_DECLARATION",
+ "PROT_MEMBER_DECLARATIONS",
+ "PROT_OP_BODIES_OPT",
+ "PROT_OP_DECLARATIONS",
+ "PROT_PRIVATE_OPT",
+ "RANGED_EXPRS",
+ "RANGE_CONSTRAINT",
+ "RECORD_TYPE_DECLARATION",
+ "SELECTOR_NAMES_OPT",
+ "SIGNED_INTEGER_TYPE_DECLARATION",
+ "TASK_ITEMS_OPT",
+ "UNARY_MINUS",
+ "UNARY_PLUS",
+ "VALUE",
+ "VALUES",
+ "VARIANTS",
+ "COMMENT_INTRO",
+ "OX",
+ "TIC_OR_CHARACTER_LITERAL",
+ "DIGIT",
+ "EXPONENT",
+ "EXTENDED_DIGIT",
+ "BASED_INTEGER",
+ "WS_",
+ "COMMENT",
+ "CHARACTER_STRING",
+ 0
+};
+
+const unsigned long AdaStoreWalker::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null"
+// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR
+// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL
+// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_0(_tokenSet_0_data_,20);
+const unsigned long AdaStoreWalker::_tokenSet_1_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE
+// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION
+// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION
+// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION
+// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE
+// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION
+// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION
+// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION
+// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION
+// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION
+// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION
+// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING
+// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION
+// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION
+// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB
+// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION
+// SIGNED_INTEGER_TYPE_DECLARATION
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_1(_tokenSet_1_data_,20);
+const unsigned long AdaStoreWalker::_tokenSet_2_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL
+// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS
+// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT
+// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS
+// UNARY_PLUS
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_2(_tokenSet_2_data_,20);
+const unsigned long AdaStoreWalker::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE
+// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_3(_tokenSet_3_data_,20);
+const unsigned long AdaStoreWalker::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER DOT TIC INDEXED_COMPONENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaStoreWalker::_tokenSet_4(_tokenSet_4_data_,12);
+
+
diff --git a/languages/ada/AdaStoreWalker.hpp b/languages/ada/AdaStoreWalker.hpp
new file mode 100644
index 00000000..6f108ff6
--- /dev/null
+++ b/languages/ada/AdaStoreWalker.hpp
@@ -0,0 +1,350 @@
+#ifndef INC_AdaStoreWalker_hpp_
+#define INC_AdaStoreWalker_hpp_
+
+#line 1 "expandedada.store.g"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+
+#include <codemodel.h>
+#include "AdaAST.hpp"
+#include "ada_utils.hpp"
+
+#line 15 "AdaStoreWalker.hpp"
+#include <antlr/config.hpp>
+#include "AdaStoreWalkerTokenTypes.hpp"
+/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalker.hpp"$ */
+#include <antlr/TreeParser.hpp>
+
+#line 10 "expandedada.store.g"
+
+#include <codemodel.h>
+#include <kdebug.h>
+
+#line 26 "AdaStoreWalker.hpp"
+class CUSTOM_API AdaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaStoreWalkerTokenTypes
+{
+#line 25 "expandedada.store.g"
+
+private:
+ QString m_fileName;
+ QValueList<NamespaceDom> m_scopeStack;
+ CodeModel* m_model;
+ QValueList<QStringList> m_imports;
+ NamespaceDom m_currentContainer;
+ int m_currentAccess;
+ bool m_addToStore; /* auxiliary variable: for the moment, this is `true'
+ only when we are in specs, not bodies. */
+ bool m_isSubprogram; // auxiliary to def_id()
+ FileDom m_file;
+
+public:
+ void setCodeModel (CodeModel* model) { m_model = model; }
+ CodeModel* codeModel () { return m_model; }
+ const CodeModel* codeModel () const { return m_model; }
+
+ QString fileName () const { return m_fileName; }
+ void setFileName (const QString& fileName) { m_fileName = fileName; }
+
+ void init () {
+ m_scopeStack.clear ();
+ m_imports.clear ();
+ m_currentContainer = m_model->globalNamespace ();
+ m_scopeStack.append (m_currentContainer);
+ m_currentAccess = CodeModelItem::Public;
+ m_addToStore = false;
+ m_isSubprogram = false;
+ if (m_model->hasFile(m_fileName))
+ m_model->removeFile (m_model->fileByName(m_fileName));
+ m_file = m_model->create<FileModel>();
+ m_file->setName(m_fileName);
+ m_model->addFile(m_file);
+ }
+
+ void wipeout () { m_model->wipeout (); }
+// void out () { m_store->out (); }
+ void removeWithReferences (const QString& fileName) {
+ m_model->removeFile (m_model->fileByName(fileName));
+ }
+ NamespaceDom insertScopeContainer
+ (NamespaceDom scope, const QStringList & scopes ) {
+ QStringList::ConstIterator it = scopes.begin();
+ QString prefix( *it );
+ NamespaceDom ns = scope->namespaceByName( prefix );
+// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl;
+ if (!ns.data()) {
+// kdDebug() << "insertScopeContainer: ns is empty" << endl;
+ ns = m_model->create<NamespaceModel>();
+// kdDebug() << "insertScopeContainer: ns created" << endl;
+ ns->setName( prefix );
+// kdDebug() << "insertScopeContainer: ns name set" << endl;
+ scope->addNamespace( ns );
+// kdDebug() << "insertScopeContainer: ns added to a scope" << endl;
+
+ if (scope == m_model->globalNamespace())
+ m_file->addNamespace( ns );
+ }
+// kdDebug() << "insertScopeContainer: while" << endl;
+ while ( ++it != scopes.end() ) {
+ QString nameSegment( *it );
+ prefix += "." + nameSegment;
+// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl;
+ NamespaceDom inner = scope->namespaceByName( prefix );
+ if (!inner.data() ) {
+// kdDebug() << "insertScopeContainer: inner is empty " << endl;
+ inner = m_model->create<NamespaceModel>();
+// kdDebug() << "insertScopeContainer: inner created " << endl;
+ inner->setName( nameSegment );
+ ns->addNamespace( inner );
+// kdDebug() << "insertScopeContainer: inner added " << endl;
+ }
+ ns = inner;
+ }
+ return ns;
+ }
+ NamespaceDom defineScope( RefAdaAST namenode ) {
+ QStringList scopes( qnamelist( namenode ) );
+// kdDebug() << "defineScope: " << scopes.join(" ") << endl;
+ NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes );
+// kdDebug() << "defineScope psc created" << endl;
+ psc->setStartPosition(namenode->getLine(), namenode->getColumn());
+// kdDebug() << "defineScope start position set" << endl;
+ psc->setFileName(m_fileName);
+// kdDebug() << "defineScope file name set" << endl;
+ // psc->setEndPosition (endLine, 0);
+// kdDebug() << "defineScope return" << endl;
+ return psc;
+ }
+#line 30 "AdaStoreWalker.hpp"
+public:
+ AdaStoreWalker();
+ static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+ int getNumTokens() const
+ {
+ return AdaStoreWalker::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return AdaStoreWalker::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return AdaStoreWalker::tokenNames;
+ }
+ public: void compilation_unit(RefAdaAST _t);
+ public: void context_items_opt(RefAdaAST _t);
+ public: void library_item(RefAdaAST _t);
+ public: void subunit(RefAdaAST _t);
+ public: void pragma(RefAdaAST _t);
+ public: void with_clause(RefAdaAST _t);
+ public: void compound_name(RefAdaAST _t);
+ public: void use_clause(RefAdaAST _t);
+ public: void subtype_mark(RefAdaAST _t);
+ public: void lib_subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t);
+ public: void def_id(RefAdaAST _t);
+ public: void pkg_body_part(RefAdaAST _t);
+ public: void generic_inst(RefAdaAST _t);
+ public: void pkg_spec_part(RefAdaAST _t);
+ public: void renames(RefAdaAST _t);
+ public: void generic_decl(RefAdaAST _t);
+ public: void subprog_def_id(RefAdaAST _t);
+ public: void subprog_decl(RefAdaAST _t);
+ public: void formal_part_opt(RefAdaAST _t);
+ public: void def_designator(RefAdaAST _t);
+ public: void function_tail(RefAdaAST _t);
+ public: void definable_operator_symbol(RefAdaAST _t);
+ public: void spec_decl_part(RefAdaAST _t);
+ public: void basic_declarative_items_opt(RefAdaAST _t);
+ public: void private_declarative_items_opt(RefAdaAST _t);
+ public: void end_id_opt(RefAdaAST _t);
+ public: void basic_decl_item(RefAdaAST _t);
+ public: void generic_formal_part_opt(RefAdaAST _t);
+ public: void procedure_body(RefAdaAST _t);
+ public: void function_body(RefAdaAST _t);
+ public: void subprog_decl_or_rename_or_inst_or_body(RefAdaAST _t);
+ public: void subprog_decl_or_body(RefAdaAST _t);
+ public: void package_body(RefAdaAST _t);
+ public: void pragma_arg(RefAdaAST _t);
+ public: void expression(RefAdaAST _t);
+ public: void attribute_id(RefAdaAST _t);
+ public: void modifiers(RefAdaAST _t);
+ public: void id_opt(RefAdaAST _t);
+ public: void value_s(RefAdaAST _t);
+ public: void value(RefAdaAST _t);
+ public: void ranged_expr_s(RefAdaAST _t);
+ public: void ranged_expr(RefAdaAST _t);
+ public: void simple_expression(RefAdaAST _t);
+ public: void range(RefAdaAST _t);
+ public: void range_constraint(RefAdaAST _t);
+ public: void range_dots(RefAdaAST _t);
+ public: void range_attrib_ref(RefAdaAST _t);
+ public: void prefix(RefAdaAST _t);
+ public: void parameter_specification(RefAdaAST _t);
+ public: void defining_identifier_list(RefAdaAST _t);
+ public: void init_opt(RefAdaAST _t);
+ public: void name(RefAdaAST _t);
+ public: void parenthesized_primary(RefAdaAST _t);
+ public: void extension_opt(RefAdaAST _t);
+ public: void task_type_or_single_decl(RefAdaAST _t);
+ public: void prot_type_or_single_decl(RefAdaAST _t);
+ public: void decl_common(RefAdaAST _t);
+ public: void discrim_part_opt(RefAdaAST _t);
+ public: void task_definition_opt(RefAdaAST _t);
+ public: void task_items_opt(RefAdaAST _t);
+ public: void private_task_items_opt(RefAdaAST _t);
+ public: void discriminant_specifications(RefAdaAST _t);
+ public: void discriminant_specification(RefAdaAST _t);
+ public: void entrydecls_repspecs_opt(RefAdaAST _t);
+ public: void entry_declaration(RefAdaAST _t);
+ public: void rep_spec(RefAdaAST _t);
+ public: void discrete_subtype_def_opt(RefAdaAST _t);
+ public: void discrete_subtype_definition(RefAdaAST _t);
+ public: void subtype_ind(RefAdaAST _t);
+ public: void align_opt(RefAdaAST _t);
+ public: void comp_loc_s(RefAdaAST _t);
+ public: void local_enum_name(RefAdaAST _t);
+ public: void enumeration_aggregate(RefAdaAST _t);
+ public: void protected_definition(RefAdaAST _t);
+ public: void prot_private_opt(RefAdaAST _t);
+ public: void prot_member_decl_s(RefAdaAST _t);
+ public: void prot_op_decl_s(RefAdaAST _t);
+ public: void prot_op_decl(RefAdaAST _t);
+ public: void comp_decl(RefAdaAST _t);
+ public: void component_subtype_def(RefAdaAST _t);
+ public: void enum_id_s(RefAdaAST _t);
+ public: void range_constraint_opt(RefAdaAST _t);
+ public: void array_type_declaration(RefAdaAST _t);
+ public: void access_type_declaration(RefAdaAST _t);
+ public: void id_and_discrim(RefAdaAST _t);
+ public: void record_definition(RefAdaAST _t);
+ public: void array_type_definition(RefAdaAST _t);
+ public: void enumeration_literal_specification(RefAdaAST _t);
+ public: void index_or_discrete_range_s(RefAdaAST _t);
+ public: void index_or_discrete_range(RefAdaAST _t);
+ public: void constraint_opt(RefAdaAST _t);
+ public: void digits_constraint(RefAdaAST _t);
+ public: void delta_constraint(RefAdaAST _t);
+ public: void index_constraint(RefAdaAST _t);
+ public: void discriminant_constraint(RefAdaAST _t);
+ public: void discrete_range(RefAdaAST _t);
+ public: void discriminant_association(RefAdaAST _t);
+ public: void selector_names_opt(RefAdaAST _t);
+ public: void selector_name(RefAdaAST _t);
+ public: void component_list(RefAdaAST _t);
+ public: void component_items(RefAdaAST _t);
+ public: void variant_part(RefAdaAST _t);
+ public: void discriminant_direct_name(RefAdaAST _t);
+ public: void variant_s(RefAdaAST _t);
+ public: void variant(RefAdaAST _t);
+ public: void choice_s(RefAdaAST _t);
+ public: void choice(RefAdaAST _t);
+ public: void discrete_with_range(RefAdaAST _t);
+ public: void mark_with_constraint(RefAdaAST _t);
+ public: void generic_formal_parameter(RefAdaAST _t);
+ public: void formal_array_type_declaration(RefAdaAST _t);
+ public: void formal_access_type_declaration(RefAdaAST _t);
+ public: void id_part(RefAdaAST _t);
+ public: void subprogram_default_opt(RefAdaAST _t);
+ public: void formal_package_actual_part_opt(RefAdaAST _t);
+ public: void body_part(RefAdaAST _t);
+ public: void declarative_part(RefAdaAST _t);
+ public: void block_body(RefAdaAST _t);
+ public: void declarative_item(RefAdaAST _t);
+ public: void prot_op_bodies_opt(RefAdaAST _t);
+ public: void block_body_opt(RefAdaAST _t);
+ public: void handled_stmt_s(RefAdaAST _t);
+ public: void entry_body(RefAdaAST _t);
+ public: void statements(RefAdaAST _t);
+ public: void except_handler_part_opt(RefAdaAST _t);
+ public: void handled_stmts_opt(RefAdaAST _t);
+ public: void statement(RefAdaAST _t);
+ public: void def_label_opt(RefAdaAST _t);
+ public: void null_stmt(RefAdaAST _t);
+ public: void exit_stmt(RefAdaAST _t);
+ public: void return_stmt(RefAdaAST _t);
+ public: void goto_stmt(RefAdaAST _t);
+ public: void delay_stmt(RefAdaAST _t);
+ public: void abort_stmt(RefAdaAST _t);
+ public: void raise_stmt(RefAdaAST _t);
+ public: void requeue_stmt(RefAdaAST _t);
+ public: void accept_stmt(RefAdaAST _t);
+ public: void select_stmt(RefAdaAST _t);
+ public: void if_stmt(RefAdaAST _t);
+ public: void case_stmt(RefAdaAST _t);
+ public: void loop_stmt(RefAdaAST _t);
+ public: void block(RefAdaAST _t);
+ public: void call_or_assignment(RefAdaAST _t);
+ public: void cond_clause(RefAdaAST _t);
+ public: void elsifs_opt(RefAdaAST _t);
+ public: void else_opt(RefAdaAST _t);
+ public: void condition(RefAdaAST _t);
+ public: void alternative_s(RefAdaAST _t);
+ public: void case_statement_alternative(RefAdaAST _t);
+ public: void iteration_scheme_opt(RefAdaAST _t);
+ public: void declare_opt(RefAdaAST _t);
+ public: void label_name(RefAdaAST _t);
+ public: void entry_body_formal_part(RefAdaAST _t);
+ public: void entry_barrier(RefAdaAST _t);
+ public: void entry_index_spec_opt(RefAdaAST _t);
+ public: void entry_call_stmt(RefAdaAST _t);
+ public: void entry_index_opt(RefAdaAST _t);
+ public: void triggering_alternative(RefAdaAST _t);
+ public: void abortable_part(RefAdaAST _t);
+ public: void selective_accept(RefAdaAST _t);
+ public: void entry_call_alternative(RefAdaAST _t);
+ public: void delay_alternative(RefAdaAST _t);
+ public: void stmts_opt(RefAdaAST _t);
+ public: void guard_opt(RefAdaAST _t);
+ public: void select_alternative(RefAdaAST _t);
+ public: void or_select_opt(RefAdaAST _t);
+ public: void accept_alternative(RefAdaAST _t);
+ public: void exception_handler(RefAdaAST _t);
+ public: void identifier_colon_opt(RefAdaAST _t);
+ public: void except_choice_s(RefAdaAST _t);
+ public: void exception_choice(RefAdaAST _t);
+ public: void operator_call(RefAdaAST _t);
+ public: void relation(RefAdaAST _t);
+ public: void range_or_mark(RefAdaAST _t);
+ public: void signed_term(RefAdaAST _t);
+ public: void term(RefAdaAST _t);
+ public: void factor(RefAdaAST _t);
+ public: void primary(RefAdaAST _t);
+ public: void name_or_qualified(RefAdaAST _t);
+ public: void allocator(RefAdaAST _t);
+ public: void subprogram_body(RefAdaAST _t);
+ public: void task_body(RefAdaAST _t);
+ public: void protected_body(RefAdaAST _t);
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefAdaAST returnAST;
+ RefAdaAST _retTree;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 291;
+#else
+ enum {
+ NUM_TOKENS = 291
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+};
+
+#endif /*INC_AdaStoreWalker_hpp_*/
diff --git a/languages/ada/AdaStoreWalkerTokenTypes.hpp b/languages/ada/AdaStoreWalkerTokenTypes.hpp
new file mode 100644
index 00000000..daaa4b21
--- /dev/null
+++ b/languages/ada/AdaStoreWalkerTokenTypes.hpp
@@ -0,0 +1,307 @@
+#ifndef INC_AdaStoreWalkerTokenTypes_hpp_
+#define INC_AdaStoreWalkerTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20070609): "expandedada.store.g" -> "AdaStoreWalkerTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API AdaStoreWalkerTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ PRAGMA = 4,
+ IDENTIFIER = 5,
+ SEMI = 6,
+ LPAREN = 7,
+ COMMA = 8,
+ RPAREN = 9,
+ RIGHT_SHAFT = 10,
+ WITH = 11,
+ DOT = 12,
+ USE = 13,
+ TYPE = 14,
+ TIC = 15,
+ RANGE = 16,
+ DIGITS = 17,
+ DELTA = 18,
+ ACCESS = 19,
+ PRIVATE = 20,
+ PACKAGE = 21,
+ BODY = 22,
+ IS = 23,
+ PROCEDURE = 24,
+ FUNCTION = 25,
+ NEW = 26,
+ OTHERS = 27,
+ PIPE = 28,
+ DOT_DOT = 29,
+ ALL = 30,
+ COLON = 31,
+ IN = 32,
+ OUT = 33,
+ RENAMES = 34,
+ CHARACTER_LITERAL = 35,
+ CHAR_STRING = 36,
+ NuLL = 37,
+ RECORD = 38,
+ SEPARATE = 39,
+ ABSTRACT = 40,
+ RETURN = 41,
+ TASK = 42,
+ PROTECTED = 43,
+ BOX = 44,
+ ASSIGN = 45,
+ ENTRY = 46,
+ FOR = 47,
+ END = 48,
+ AT = 49,
+ MOD = 50,
+ SUBTYPE = 51,
+ EXCEPTION = 52,
+ CONSTANT = 53,
+ ARRAY = 54,
+ OF = 55,
+ ALIASED = 56,
+ CASE = 57,
+ WHEN = 58,
+ TAGGED = 59,
+ LIMITED = 60,
+ GENERIC = 61,
+ BEGIN = 62,
+ LT_LT = 63,
+ GT_GT = 64,
+ IF = 65,
+ THEN = 66,
+ ELSIF = 67,
+ ELSE = 68,
+ LOOP = 69,
+ WHILE = 70,
+ REVERSE = 71,
+ DECLARE = 72,
+ EXIT = 73,
+ GOTO = 74,
+ ACCEPT = 75,
+ DO = 76,
+ DELAY = 77,
+ UNTIL = 78,
+ SELECT = 79,
+ ABORT = 80,
+ OR = 81,
+ TERMINATE = 82,
+ RAISE = 83,
+ REQUEUE = 84,
+ AND = 85,
+ XOR = 86,
+ NOT = 87,
+ EQ = 88,
+ NE = 89,
+ LT_ = 90,
+ LE = 91,
+ GT = 92,
+ GE = 93,
+ PLUS = 94,
+ MINUS = 95,
+ CONCAT = 96,
+ STAR = 97,
+ DIV = 98,
+ REM = 99,
+ ABS = 100,
+ EXPON = 101,
+ NUMERIC_LIT = 102,
+ ABORTABLE_PART = 103,
+ ABORT_STATEMENT = 104,
+ ACCEPT_ALTERNATIVE = 105,
+ ACCEPT_STATEMENT = 106,
+ ALLOCATOR = 107,
+ ASSIGNMENT_STATEMENT = 108,
+ ASYNCHRONOUS_SELECT = 109,
+ ATTRIBUTE_DEFINITION_CLAUSE = 110,
+ AT_CLAUSE = 111,
+ BLOCK_STATEMENT = 112,
+ CASE_STATEMENT = 113,
+ CASE_STATEMENT_ALTERNATIVE = 114,
+ CODE_STATEMENT = 115,
+ COMPONENT_DECLARATION = 116,
+ CONDITIONAL_ENTRY_CALL = 117,
+ CONTEXT_CLAUSE = 118,
+ DECLARATIVE_PART = 119,
+ DEFINING_IDENTIFIER_LIST = 120,
+ DELAY_ALTERNATIVE = 121,
+ DELAY_STATEMENT = 122,
+ DELTA_CONSTRAINT = 123,
+ DIGITS_CONSTRAINT = 124,
+ DISCRIMINANT_ASSOCIATION = 125,
+ DISCRIMINANT_CONSTRAINT = 126,
+ DISCRIMINANT_SPECIFICATION = 127,
+ ENTRY_BODY = 128,
+ ENTRY_CALL_ALTERNATIVE = 129,
+ ENTRY_CALL_STATEMENT = 130,
+ ENTRY_DECLARATION = 131,
+ ENTRY_INDEX_SPECIFICATION = 132,
+ ENUMERATION_REPESENTATION_CLAUSE = 133,
+ EXCEPTION_DECLARATION = 134,
+ EXCEPTION_HANDLER = 135,
+ EXCEPTION_RENAMING_DECLARATION = 136,
+ EXIT_STATEMENT = 137,
+ FORMAL_PACKAGE_DECLARATION = 138,
+ GENERIC_FORMAL_PART = 139,
+ GENERIC_PACKAGE_DECLARATION = 140,
+ GOTO_STATEMENT = 141,
+ HANDLED_SEQUENCE_OF_STATEMENTS = 142,
+ HANDLED_STMTS_OPT = 143,
+ IF_STATEMENT = 144,
+ INCOMPLETE_TYPE_DECLARATION = 145,
+ INDEXED_COMPONENT = 146,
+ INDEX_CONSTRAINT = 147,
+ LIBRARY_ITEM = 148,
+ LOOP_STATEMENT = 149,
+ NAME = 150,
+ NULL_STATEMENT = 151,
+ NUMBER_DECLARATION = 152,
+ OBJECT_DECLARATION = 153,
+ OBJECT_RENAMING_DECLARATION = 154,
+ OPERATOR_SYMBOL = 155,
+ PACKAGE_BODY = 156,
+ PACKAGE_BODY_STUB = 157,
+ PACKAGE_RENAMING_DECLARATION = 158,
+ PACKAGE_SPECIFICATION = 159,
+ PARAMETER_SPECIFICATION = 160,
+ PRIVATE_EXTENSION_DECLARATION = 161,
+ PRIVATE_TYPE_DECLARATION = 162,
+ PROTECTED_BODY = 163,
+ PROTECTED_BODY_STUB = 164,
+ PROTECTED_TYPE_DECLARATION = 165,
+ RAISE_STATEMENT = 166,
+ RANGE_ATTRIBUTE_REFERENCE = 167,
+ RECORD_REPRESENTATION_CLAUSE = 168,
+ REQUEUE_STATEMENT = 169,
+ RETURN_STATEMENT = 170,
+ SELECTIVE_ACCEPT = 171,
+ SEQUENCE_OF_STATEMENTS = 172,
+ SINGLE_PROTECTED_DECLARATION = 173,
+ SINGLE_TASK_DECLARATION = 174,
+ STATEMENT = 175,
+ SUBTYPE_DECLARATION = 176,
+ SUBTYPE_INDICATION = 177,
+ SUBTYPE_MARK = 178,
+ SUBUNIT = 179,
+ TASK_BODY = 180,
+ TASK_BODY_STUB = 181,
+ TASK_TYPE_DECLARATION = 182,
+ TERMINATE_ALTERNATIVE = 183,
+ TIMED_ENTRY_CALL = 184,
+ TRIGGERING_ALTERNATIVE = 185,
+ USE_CLAUSE = 186,
+ USE_TYPE_CLAUSE = 187,
+ VARIANT = 188,
+ VARIANT_PART = 189,
+ WITH_CLAUSE = 190,
+ ABSTRACT_FUNCTION_DECLARATION = 191,
+ ABSTRACT_PROCEDURE_DECLARATION = 192,
+ ACCESS_TO_FUNCTION_DECLARATION = 193,
+ ACCESS_TO_OBJECT_DECLARATION = 194,
+ ACCESS_TO_PROCEDURE_DECLARATION = 195,
+ ARRAY_OBJECT_DECLARATION = 196,
+ ARRAY_TYPE_DECLARATION = 197,
+ AND_THEN = 198,
+ BASIC_DECLARATIVE_ITEMS_OPT = 199,
+ BLOCK_BODY = 200,
+ BLOCK_BODY_OPT = 201,
+ CALL_STATEMENT = 202,
+ COMPONENT_CLAUSES_OPT = 203,
+ COMPONENT_ITEMS = 204,
+ COND_CLAUSE = 205,
+ DECIMAL_FIXED_POINT_DECLARATION = 206,
+ DECLARE_OPT = 207,
+ DERIVED_RECORD_EXTENSION = 208,
+ DISCRETE_SUBTYPE_DEF_OPT = 209,
+ DISCRIMINANT_SPECIFICATIONS = 210,
+ DISCRIM_PART_OPT = 211,
+ ELSE_OPT = 212,
+ ELSIFS_OPT = 213,
+ END_ID_OPT = 214,
+ ENTRY_INDEX_OPT = 215,
+ ENUMERATION_TYPE_DECLARATION = 216,
+ EXCEPT_HANDLER_PART_OPT = 217,
+ EXTENSION_OPT = 218,
+ FLOATING_POINT_DECLARATION = 219,
+ FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220,
+ FORMAL_DISCRETE_TYPE_DECLARATION = 221,
+ FORMAL_FLOATING_POINT_DECLARATION = 222,
+ FORMAL_FUNCTION_DECLARATION = 223,
+ FORMAL_MODULAR_TYPE_DECLARATION = 224,
+ FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225,
+ FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226,
+ FORMAL_PART_OPT = 227,
+ FORMAL_PRIVATE_EXTENSION_DECLARATION = 228,
+ FORMAL_PRIVATE_TYPE_DECLARATION = 229,
+ FORMAL_PROCEDURE_DECLARATION = 230,
+ FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231,
+ FUNCTION_BODY = 232,
+ FUNCTION_BODY_STUB = 233,
+ FUNCTION_DECLARATION = 234,
+ FUNCTION_RENAMING_DECLARATION = 235,
+ GENERIC_FUNCTION_DECLARATION = 236,
+ GENERIC_FUNCTION_INSTANTIATION = 237,
+ GENERIC_FUNCTION_RENAMING = 238,
+ GENERIC_PACKAGE_INSTANTIATION = 239,
+ GENERIC_PACKAGE_RENAMING = 240,
+ GENERIC_PROCEDURE_DECLARATION = 241,
+ GENERIC_PROCEDURE_INSTANTIATION = 242,
+ GENERIC_PROCEDURE_RENAMING = 243,
+ GUARD_OPT = 244,
+ IDENTIFIER_COLON_OPT = 245,
+ ID_OPT = 246,
+ INIT_OPT = 247,
+ ITERATION_SCHEME_OPT = 248,
+ LABEL_OPT = 249,
+ MARK_WITH_CONSTRAINT = 250,
+ MODIFIERS = 251,
+ MODULAR_TYPE_DECLARATION = 252,
+ MOD_CLAUSE_OPT = 253,
+ NOT_IN = 254,
+ ORDINARY_DERIVED_TYPE_DECLARATION = 255,
+ ORDINARY_FIXED_POINT_DECLARATION = 256,
+ OR_ELSE = 257,
+ OR_SELECT_OPT = 258,
+ PARENTHESIZED_PRIMARY = 259,
+ PRIVATE_DECLARATIVE_ITEMS_OPT = 260,
+ PRIVATE_TASK_ITEMS_OPT = 261,
+ PROCEDURE_BODY = 262,
+ PROCEDURE_BODY_STUB = 263,
+ PROCEDURE_DECLARATION = 264,
+ PROCEDURE_RENAMING_DECLARATION = 265,
+ PROT_MEMBER_DECLARATIONS = 266,
+ PROT_OP_BODIES_OPT = 267,
+ PROT_OP_DECLARATIONS = 268,
+ PROT_PRIVATE_OPT = 269,
+ RANGED_EXPRS = 270,
+ RANGE_CONSTRAINT = 271,
+ RECORD_TYPE_DECLARATION = 272,
+ SELECTOR_NAMES_OPT = 273,
+ SIGNED_INTEGER_TYPE_DECLARATION = 274,
+ TASK_ITEMS_OPT = 275,
+ UNARY_MINUS = 276,
+ UNARY_PLUS = 277,
+ VALUE = 278,
+ VALUES = 279,
+ VARIANTS = 280,
+ COMMENT_INTRO = 281,
+ OX = 282,
+ TIC_OR_CHARACTER_LITERAL = 283,
+ DIGIT = 284,
+ EXPONENT = 285,
+ EXTENDED_DIGIT = 286,
+ BASED_INTEGER = 287,
+ WS_ = 288,
+ COMMENT = 289,
+ CHARACTER_STRING = 290,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_AdaStoreWalkerTokenTypes_hpp_*/
diff --git a/languages/ada/AdaStoreWalkerTokenTypes.txt b/languages/ada/AdaStoreWalkerTokenTypes.txt
new file mode 100644
index 00000000..e9ba489c
--- /dev/null
+++ b/languages/ada/AdaStoreWalkerTokenTypes.txt
@@ -0,0 +1,289 @@
+// $ANTLR 2.7.7 (20070609): expandedada.store.g -> AdaStoreWalkerTokenTypes.txt$
+AdaStoreWalker // output token vocab name
+PRAGMA="pragma"=4
+IDENTIFIER=5
+SEMI=6
+LPAREN=7
+COMMA=8
+RPAREN=9
+RIGHT_SHAFT=10
+WITH="with"=11
+DOT=12
+USE="use"=13
+TYPE="type"=14
+TIC=15
+RANGE="range"=16
+DIGITS="digits"=17
+DELTA="delta"=18
+ACCESS="access"=19
+PRIVATE="private"=20
+PACKAGE="package"=21
+BODY="body"=22
+IS="is"=23
+PROCEDURE="procedure"=24
+FUNCTION="function"=25
+NEW="new"=26
+OTHERS="others"=27
+PIPE=28
+DOT_DOT=29
+ALL="all"=30
+COLON=31
+IN="in"=32
+OUT="out"=33
+RENAMES="renames"=34
+CHARACTER_LITERAL=35
+CHAR_STRING=36
+NuLL="null"=37
+RECORD="record"=38
+SEPARATE="separate"=39
+ABSTRACT="abstract"=40
+RETURN="return"=41
+TASK="task"=42
+PROTECTED="protected"=43
+BOX=44
+ASSIGN=45
+ENTRY="entry"=46
+FOR="for"=47
+END="end"=48
+AT="at"=49
+MOD="mod"=50
+SUBTYPE="subtype"=51
+EXCEPTION="exception"=52
+CONSTANT="constant"=53
+ARRAY="array"=54
+OF="of"=55
+ALIASED="aliased"=56
+CASE="case"=57
+WHEN="when"=58
+TAGGED="tagged"=59
+LIMITED="limited"=60
+GENERIC="generic"=61
+BEGIN="begin"=62
+LT_LT=63
+GT_GT=64
+IF="if"=65
+THEN="then"=66
+ELSIF="elsif"=67
+ELSE="else"=68
+LOOP="loop"=69
+WHILE="while"=70
+REVERSE="reverse"=71
+DECLARE="declare"=72
+EXIT="exit"=73
+GOTO="goto"=74
+ACCEPT="accept"=75
+DO="do"=76
+DELAY="delay"=77
+UNTIL="until"=78
+SELECT="select"=79
+ABORT="abort"=80
+OR="or"=81
+TERMINATE="terminate"=82
+RAISE="raise"=83
+REQUEUE="requeue"=84
+AND="and"=85
+XOR="xor"=86
+NOT="not"=87
+EQ=88
+NE=89
+LT_=90
+LE=91
+GT=92
+GE=93
+PLUS=94
+MINUS=95
+CONCAT=96
+STAR=97
+DIV=98
+REM="rem"=99
+ABS="abs"=100
+EXPON=101
+NUMERIC_LIT=102
+ABORTABLE_PART=103
+ABORT_STATEMENT=104
+ACCEPT_ALTERNATIVE=105
+ACCEPT_STATEMENT=106
+ALLOCATOR=107
+ASSIGNMENT_STATEMENT=108
+ASYNCHRONOUS_SELECT=109
+ATTRIBUTE_DEFINITION_CLAUSE=110
+AT_CLAUSE=111
+BLOCK_STATEMENT=112
+CASE_STATEMENT=113
+CASE_STATEMENT_ALTERNATIVE=114
+CODE_STATEMENT=115
+COMPONENT_DECLARATION=116
+CONDITIONAL_ENTRY_CALL=117
+CONTEXT_CLAUSE=118
+DECLARATIVE_PART=119
+DEFINING_IDENTIFIER_LIST=120
+DELAY_ALTERNATIVE=121
+DELAY_STATEMENT=122
+DELTA_CONSTRAINT=123
+DIGITS_CONSTRAINT=124
+DISCRIMINANT_ASSOCIATION=125
+DISCRIMINANT_CONSTRAINT=126
+DISCRIMINANT_SPECIFICATION=127
+ENTRY_BODY=128
+ENTRY_CALL_ALTERNATIVE=129
+ENTRY_CALL_STATEMENT=130
+ENTRY_DECLARATION=131
+ENTRY_INDEX_SPECIFICATION=132
+ENUMERATION_REPESENTATION_CLAUSE=133
+EXCEPTION_DECLARATION=134
+EXCEPTION_HANDLER=135
+EXCEPTION_RENAMING_DECLARATION=136
+EXIT_STATEMENT=137
+FORMAL_PACKAGE_DECLARATION=138
+GENERIC_FORMAL_PART=139
+GENERIC_PACKAGE_DECLARATION=140
+GOTO_STATEMENT=141
+HANDLED_SEQUENCE_OF_STATEMENTS=142
+HANDLED_STMTS_OPT=143
+IF_STATEMENT=144
+INCOMPLETE_TYPE_DECLARATION=145
+INDEXED_COMPONENT=146
+INDEX_CONSTRAINT=147
+LIBRARY_ITEM=148
+LOOP_STATEMENT=149
+NAME=150
+NULL_STATEMENT=151
+NUMBER_DECLARATION=152
+OBJECT_DECLARATION=153
+OBJECT_RENAMING_DECLARATION=154
+OPERATOR_SYMBOL=155
+PACKAGE_BODY=156
+PACKAGE_BODY_STUB=157
+PACKAGE_RENAMING_DECLARATION=158
+PACKAGE_SPECIFICATION=159
+PARAMETER_SPECIFICATION=160
+PRIVATE_EXTENSION_DECLARATION=161
+PRIVATE_TYPE_DECLARATION=162
+PROTECTED_BODY=163
+PROTECTED_BODY_STUB=164
+PROTECTED_TYPE_DECLARATION=165
+RAISE_STATEMENT=166
+RANGE_ATTRIBUTE_REFERENCE=167
+RECORD_REPRESENTATION_CLAUSE=168
+REQUEUE_STATEMENT=169
+RETURN_STATEMENT=170
+SELECTIVE_ACCEPT=171
+SEQUENCE_OF_STATEMENTS=172
+SINGLE_PROTECTED_DECLARATION=173
+SINGLE_TASK_DECLARATION=174
+STATEMENT=175
+SUBTYPE_DECLARATION=176
+SUBTYPE_INDICATION=177
+SUBTYPE_MARK=178
+SUBUNIT=179
+TASK_BODY=180
+TASK_BODY_STUB=181
+TASK_TYPE_DECLARATION=182
+TERMINATE_ALTERNATIVE=183
+TIMED_ENTRY_CALL=184
+TRIGGERING_ALTERNATIVE=185
+USE_CLAUSE=186
+USE_TYPE_CLAUSE=187
+VARIANT=188
+VARIANT_PART=189
+WITH_CLAUSE=190
+ABSTRACT_FUNCTION_DECLARATION=191
+ABSTRACT_PROCEDURE_DECLARATION=192
+ACCESS_TO_FUNCTION_DECLARATION=193
+ACCESS_TO_OBJECT_DECLARATION=194
+ACCESS_TO_PROCEDURE_DECLARATION=195
+ARRAY_OBJECT_DECLARATION=196
+ARRAY_TYPE_DECLARATION=197
+AND_THEN=198
+BASIC_DECLARATIVE_ITEMS_OPT=199
+BLOCK_BODY=200
+BLOCK_BODY_OPT=201
+CALL_STATEMENT=202
+COMPONENT_CLAUSES_OPT=203
+COMPONENT_ITEMS=204
+COND_CLAUSE=205
+DECIMAL_FIXED_POINT_DECLARATION=206
+DECLARE_OPT=207
+DERIVED_RECORD_EXTENSION=208
+DISCRETE_SUBTYPE_DEF_OPT=209
+DISCRIMINANT_SPECIFICATIONS=210
+DISCRIM_PART_OPT=211
+ELSE_OPT=212
+ELSIFS_OPT=213
+END_ID_OPT=214
+ENTRY_INDEX_OPT=215
+ENUMERATION_TYPE_DECLARATION=216
+EXCEPT_HANDLER_PART_OPT=217
+EXTENSION_OPT=218
+FLOATING_POINT_DECLARATION=219
+FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220
+FORMAL_DISCRETE_TYPE_DECLARATION=221
+FORMAL_FLOATING_POINT_DECLARATION=222
+FORMAL_FUNCTION_DECLARATION=223
+FORMAL_MODULAR_TYPE_DECLARATION=224
+FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225
+FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226
+FORMAL_PART_OPT=227
+FORMAL_PRIVATE_EXTENSION_DECLARATION=228
+FORMAL_PRIVATE_TYPE_DECLARATION=229
+FORMAL_PROCEDURE_DECLARATION=230
+FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231
+FUNCTION_BODY=232
+FUNCTION_BODY_STUB=233
+FUNCTION_DECLARATION=234
+FUNCTION_RENAMING_DECLARATION=235
+GENERIC_FUNCTION_DECLARATION=236
+GENERIC_FUNCTION_INSTANTIATION=237
+GENERIC_FUNCTION_RENAMING=238
+GENERIC_PACKAGE_INSTANTIATION=239
+GENERIC_PACKAGE_RENAMING=240
+GENERIC_PROCEDURE_DECLARATION=241
+GENERIC_PROCEDURE_INSTANTIATION=242
+GENERIC_PROCEDURE_RENAMING=243
+GUARD_OPT=244
+IDENTIFIER_COLON_OPT=245
+ID_OPT=246
+INIT_OPT=247
+ITERATION_SCHEME_OPT=248
+LABEL_OPT=249
+MARK_WITH_CONSTRAINT=250
+MODIFIERS=251
+MODULAR_TYPE_DECLARATION=252
+MOD_CLAUSE_OPT=253
+NOT_IN=254
+ORDINARY_DERIVED_TYPE_DECLARATION=255
+ORDINARY_FIXED_POINT_DECLARATION=256
+OR_ELSE=257
+OR_SELECT_OPT=258
+PARENTHESIZED_PRIMARY=259
+PRIVATE_DECLARATIVE_ITEMS_OPT=260
+PRIVATE_TASK_ITEMS_OPT=261
+PROCEDURE_BODY=262
+PROCEDURE_BODY_STUB=263
+PROCEDURE_DECLARATION=264
+PROCEDURE_RENAMING_DECLARATION=265
+PROT_MEMBER_DECLARATIONS=266
+PROT_OP_BODIES_OPT=267
+PROT_OP_DECLARATIONS=268
+PROT_PRIVATE_OPT=269
+RANGED_EXPRS=270
+RANGE_CONSTRAINT=271
+RECORD_TYPE_DECLARATION=272
+SELECTOR_NAMES_OPT=273
+SIGNED_INTEGER_TYPE_DECLARATION=274
+TASK_ITEMS_OPT=275
+UNARY_MINUS=276
+UNARY_PLUS=277
+VALUE=278
+VALUES=279
+VARIANTS=280
+COMMENT_INTRO=281
+OX=282
+TIC_OR_CHARACTER_LITERAL=283
+DIGIT=284
+EXPONENT=285
+EXTENDED_DIGIT=286
+BASED_INTEGER=287
+WS_=288
+COMMENT=289
+CHARACTER_STRING=290
diff --git a/languages/ada/AdaTokenTypes.hpp b/languages/ada/AdaTokenTypes.hpp
new file mode 100644
index 00000000..918b1cfd
--- /dev/null
+++ b/languages/ada/AdaTokenTypes.hpp
@@ -0,0 +1,306 @@
+#ifndef INC_AdaTokenTypes_hpp_
+#define INC_AdaTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20070609): "ada.g" -> "AdaTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API AdaTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ PRAGMA = 4,
+ IDENTIFIER = 5,
+ SEMI = 6,
+ LPAREN = 7,
+ COMMA = 8,
+ RPAREN = 9,
+ RIGHT_SHAFT = 10,
+ WITH = 11,
+ DOT = 12,
+ USE = 13,
+ TYPE = 14,
+ TIC = 15,
+ RANGE = 16,
+ DIGITS = 17,
+ DELTA = 18,
+ ACCESS = 19,
+ PRIVATE = 20,
+ PACKAGE = 21,
+ BODY = 22,
+ IS = 23,
+ PROCEDURE = 24,
+ FUNCTION = 25,
+ NEW = 26,
+ OTHERS = 27,
+ PIPE = 28,
+ DOT_DOT = 29,
+ ALL = 30,
+ COLON = 31,
+ IN = 32,
+ OUT = 33,
+ RENAMES = 34,
+ CHARACTER_LITERAL = 35,
+ CHAR_STRING = 36,
+ NuLL = 37,
+ RECORD = 38,
+ SEPARATE = 39,
+ ABSTRACT = 40,
+ RETURN = 41,
+ TASK = 42,
+ PROTECTED = 43,
+ BOX = 44,
+ ASSIGN = 45,
+ ENTRY = 46,
+ FOR = 47,
+ END = 48,
+ AT = 49,
+ MOD = 50,
+ SUBTYPE = 51,
+ EXCEPTION = 52,
+ CONSTANT = 53,
+ ARRAY = 54,
+ OF = 55,
+ ALIASED = 56,
+ CASE = 57,
+ WHEN = 58,
+ TAGGED = 59,
+ LIMITED = 60,
+ GENERIC = 61,
+ BEGIN = 62,
+ LT_LT = 63,
+ GT_GT = 64,
+ IF = 65,
+ THEN = 66,
+ ELSIF = 67,
+ ELSE = 68,
+ LOOP = 69,
+ WHILE = 70,
+ REVERSE = 71,
+ DECLARE = 72,
+ EXIT = 73,
+ GOTO = 74,
+ ACCEPT = 75,
+ DO = 76,
+ DELAY = 77,
+ UNTIL = 78,
+ SELECT = 79,
+ ABORT = 80,
+ OR = 81,
+ TERMINATE = 82,
+ RAISE = 83,
+ REQUEUE = 84,
+ AND = 85,
+ XOR = 86,
+ NOT = 87,
+ EQ = 88,
+ NE = 89,
+ LT_ = 90,
+ LE = 91,
+ GT = 92,
+ GE = 93,
+ PLUS = 94,
+ MINUS = 95,
+ CONCAT = 96,
+ STAR = 97,
+ DIV = 98,
+ REM = 99,
+ ABS = 100,
+ EXPON = 101,
+ NUMERIC_LIT = 102,
+ ABORTABLE_PART = 103,
+ ABORT_STATEMENT = 104,
+ ACCEPT_ALTERNATIVE = 105,
+ ACCEPT_STATEMENT = 106,
+ ALLOCATOR = 107,
+ ASSIGNMENT_STATEMENT = 108,
+ ASYNCHRONOUS_SELECT = 109,
+ ATTRIBUTE_DEFINITION_CLAUSE = 110,
+ AT_CLAUSE = 111,
+ BLOCK_STATEMENT = 112,
+ CASE_STATEMENT = 113,
+ CASE_STATEMENT_ALTERNATIVE = 114,
+ CODE_STATEMENT = 115,
+ COMPONENT_DECLARATION = 116,
+ CONDITIONAL_ENTRY_CALL = 117,
+ CONTEXT_CLAUSE = 118,
+ DECLARATIVE_PART = 119,
+ DEFINING_IDENTIFIER_LIST = 120,
+ DELAY_ALTERNATIVE = 121,
+ DELAY_STATEMENT = 122,
+ DELTA_CONSTRAINT = 123,
+ DIGITS_CONSTRAINT = 124,
+ DISCRIMINANT_ASSOCIATION = 125,
+ DISCRIMINANT_CONSTRAINT = 126,
+ DISCRIMINANT_SPECIFICATION = 127,
+ ENTRY_BODY = 128,
+ ENTRY_CALL_ALTERNATIVE = 129,
+ ENTRY_CALL_STATEMENT = 130,
+ ENTRY_DECLARATION = 131,
+ ENTRY_INDEX_SPECIFICATION = 132,
+ ENUMERATION_REPESENTATION_CLAUSE = 133,
+ EXCEPTION_DECLARATION = 134,
+ EXCEPTION_HANDLER = 135,
+ EXCEPTION_RENAMING_DECLARATION = 136,
+ EXIT_STATEMENT = 137,
+ FORMAL_PACKAGE_DECLARATION = 138,
+ GENERIC_FORMAL_PART = 139,
+ GENERIC_PACKAGE_DECLARATION = 140,
+ GOTO_STATEMENT = 141,
+ HANDLED_SEQUENCE_OF_STATEMENTS = 142,
+ HANDLED_STMTS_OPT = 143,
+ IF_STATEMENT = 144,
+ INCOMPLETE_TYPE_DECLARATION = 145,
+ INDEXED_COMPONENT = 146,
+ INDEX_CONSTRAINT = 147,
+ LIBRARY_ITEM = 148,
+ LOOP_STATEMENT = 149,
+ NAME = 150,
+ NULL_STATEMENT = 151,
+ NUMBER_DECLARATION = 152,
+ OBJECT_DECLARATION = 153,
+ OBJECT_RENAMING_DECLARATION = 154,
+ OPERATOR_SYMBOL = 155,
+ PACKAGE_BODY = 156,
+ PACKAGE_BODY_STUB = 157,
+ PACKAGE_RENAMING_DECLARATION = 158,
+ PACKAGE_SPECIFICATION = 159,
+ PARAMETER_SPECIFICATION = 160,
+ PRIVATE_EXTENSION_DECLARATION = 161,
+ PRIVATE_TYPE_DECLARATION = 162,
+ PROTECTED_BODY = 163,
+ PROTECTED_BODY_STUB = 164,
+ PROTECTED_TYPE_DECLARATION = 165,
+ RAISE_STATEMENT = 166,
+ RANGE_ATTRIBUTE_REFERENCE = 167,
+ RECORD_REPRESENTATION_CLAUSE = 168,
+ REQUEUE_STATEMENT = 169,
+ RETURN_STATEMENT = 170,
+ SELECTIVE_ACCEPT = 171,
+ SEQUENCE_OF_STATEMENTS = 172,
+ SINGLE_PROTECTED_DECLARATION = 173,
+ SINGLE_TASK_DECLARATION = 174,
+ STATEMENT = 175,
+ SUBTYPE_DECLARATION = 176,
+ SUBTYPE_INDICATION = 177,
+ SUBTYPE_MARK = 178,
+ SUBUNIT = 179,
+ TASK_BODY = 180,
+ TASK_BODY_STUB = 181,
+ TASK_TYPE_DECLARATION = 182,
+ TERMINATE_ALTERNATIVE = 183,
+ TIMED_ENTRY_CALL = 184,
+ TRIGGERING_ALTERNATIVE = 185,
+ USE_CLAUSE = 186,
+ USE_TYPE_CLAUSE = 187,
+ VARIANT = 188,
+ VARIANT_PART = 189,
+ WITH_CLAUSE = 190,
+ ABSTRACT_FUNCTION_DECLARATION = 191,
+ ABSTRACT_PROCEDURE_DECLARATION = 192,
+ ACCESS_TO_FUNCTION_DECLARATION = 193,
+ ACCESS_TO_OBJECT_DECLARATION = 194,
+ ACCESS_TO_PROCEDURE_DECLARATION = 195,
+ ARRAY_OBJECT_DECLARATION = 196,
+ ARRAY_TYPE_DECLARATION = 197,
+ AND_THEN = 198,
+ BASIC_DECLARATIVE_ITEMS_OPT = 199,
+ BLOCK_BODY = 200,
+ BLOCK_BODY_OPT = 201,
+ CALL_STATEMENT = 202,
+ COMPONENT_CLAUSES_OPT = 203,
+ COMPONENT_ITEMS = 204,
+ COND_CLAUSE = 205,
+ DECIMAL_FIXED_POINT_DECLARATION = 206,
+ DECLARE_OPT = 207,
+ DERIVED_RECORD_EXTENSION = 208,
+ DISCRETE_SUBTYPE_DEF_OPT = 209,
+ DISCRIMINANT_SPECIFICATIONS = 210,
+ DISCRIM_PART_OPT = 211,
+ ELSE_OPT = 212,
+ ELSIFS_OPT = 213,
+ END_ID_OPT = 214,
+ ENTRY_INDEX_OPT = 215,
+ ENUMERATION_TYPE_DECLARATION = 216,
+ EXCEPT_HANDLER_PART_OPT = 217,
+ EXTENSION_OPT = 218,
+ FLOATING_POINT_DECLARATION = 219,
+ FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220,
+ FORMAL_DISCRETE_TYPE_DECLARATION = 221,
+ FORMAL_FLOATING_POINT_DECLARATION = 222,
+ FORMAL_FUNCTION_DECLARATION = 223,
+ FORMAL_MODULAR_TYPE_DECLARATION = 224,
+ FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225,
+ FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226,
+ FORMAL_PART_OPT = 227,
+ FORMAL_PRIVATE_EXTENSION_DECLARATION = 228,
+ FORMAL_PRIVATE_TYPE_DECLARATION = 229,
+ FORMAL_PROCEDURE_DECLARATION = 230,
+ FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231,
+ FUNCTION_BODY = 232,
+ FUNCTION_BODY_STUB = 233,
+ FUNCTION_DECLARATION = 234,
+ FUNCTION_RENAMING_DECLARATION = 235,
+ GENERIC_FUNCTION_DECLARATION = 236,
+ GENERIC_FUNCTION_INSTANTIATION = 237,
+ GENERIC_FUNCTION_RENAMING = 238,
+ GENERIC_PACKAGE_INSTANTIATION = 239,
+ GENERIC_PACKAGE_RENAMING = 240,
+ GENERIC_PROCEDURE_DECLARATION = 241,
+ GENERIC_PROCEDURE_INSTANTIATION = 242,
+ GENERIC_PROCEDURE_RENAMING = 243,
+ GUARD_OPT = 244,
+ IDENTIFIER_COLON_OPT = 245,
+ ID_OPT = 246,
+ INIT_OPT = 247,
+ ITERATION_SCHEME_OPT = 248,
+ LABEL_OPT = 249,
+ MARK_WITH_CONSTRAINT = 250,
+ MODIFIERS = 251,
+ MODULAR_TYPE_DECLARATION = 252,
+ MOD_CLAUSE_OPT = 253,
+ NOT_IN = 254,
+ ORDINARY_DERIVED_TYPE_DECLARATION = 255,
+ ORDINARY_FIXED_POINT_DECLARATION = 256,
+ OR_ELSE = 257,
+ OR_SELECT_OPT = 258,
+ PARENTHESIZED_PRIMARY = 259,
+ PRIVATE_DECLARATIVE_ITEMS_OPT = 260,
+ PRIVATE_TASK_ITEMS_OPT = 261,
+ PROCEDURE_BODY = 262,
+ PROCEDURE_BODY_STUB = 263,
+ PROCEDURE_DECLARATION = 264,
+ PROCEDURE_RENAMING_DECLARATION = 265,
+ PROT_MEMBER_DECLARATIONS = 266,
+ PROT_OP_BODIES_OPT = 267,
+ PROT_OP_DECLARATIONS = 268,
+ PROT_PRIVATE_OPT = 269,
+ RANGED_EXPRS = 270,
+ RANGE_CONSTRAINT = 271,
+ RECORD_TYPE_DECLARATION = 272,
+ SELECTOR_NAMES_OPT = 273,
+ SIGNED_INTEGER_TYPE_DECLARATION = 274,
+ TASK_ITEMS_OPT = 275,
+ UNARY_MINUS = 276,
+ UNARY_PLUS = 277,
+ VALUE = 278,
+ VALUES = 279,
+ VARIANTS = 280,
+ COMMENT_INTRO = 281,
+ OX = 282,
+ TIC_OR_CHARACTER_LITERAL = 283,
+ DIGIT = 284,
+ EXPONENT = 285,
+ EXTENDED_DIGIT = 286,
+ BASED_INTEGER = 287,
+ WS_ = 288,
+ COMMENT = 289,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_AdaTokenTypes_hpp_*/
diff --git a/languages/ada/AdaTokenTypes.txt b/languages/ada/AdaTokenTypes.txt
new file mode 100644
index 00000000..2415ea0c
--- /dev/null
+++ b/languages/ada/AdaTokenTypes.txt
@@ -0,0 +1,288 @@
+// $ANTLR 2.7.7 (20070609): ada.g -> AdaTokenTypes.txt$
+Ada // output token vocab name
+PRAGMA="pragma"=4
+IDENTIFIER=5
+SEMI=6
+LPAREN=7
+COMMA=8
+RPAREN=9
+RIGHT_SHAFT=10
+WITH="with"=11
+DOT=12
+USE="use"=13
+TYPE="type"=14
+TIC=15
+RANGE="range"=16
+DIGITS="digits"=17
+DELTA="delta"=18
+ACCESS="access"=19
+PRIVATE="private"=20
+PACKAGE="package"=21
+BODY="body"=22
+IS="is"=23
+PROCEDURE="procedure"=24
+FUNCTION="function"=25
+NEW="new"=26
+OTHERS="others"=27
+PIPE=28
+DOT_DOT=29
+ALL="all"=30
+COLON=31
+IN="in"=32
+OUT="out"=33
+RENAMES="renames"=34
+CHARACTER_LITERAL=35
+CHAR_STRING=36
+NuLL="null"=37
+RECORD="record"=38
+SEPARATE="separate"=39
+ABSTRACT="abstract"=40
+RETURN="return"=41
+TASK="task"=42
+PROTECTED="protected"=43
+BOX=44
+ASSIGN=45
+ENTRY="entry"=46
+FOR="for"=47
+END="end"=48
+AT="at"=49
+MOD="mod"=50
+SUBTYPE="subtype"=51
+EXCEPTION="exception"=52
+CONSTANT="constant"=53
+ARRAY="array"=54
+OF="of"=55
+ALIASED="aliased"=56
+CASE="case"=57
+WHEN="when"=58
+TAGGED="tagged"=59
+LIMITED="limited"=60
+GENERIC="generic"=61
+BEGIN="begin"=62
+LT_LT=63
+GT_GT=64
+IF="if"=65
+THEN="then"=66
+ELSIF="elsif"=67
+ELSE="else"=68
+LOOP="loop"=69
+WHILE="while"=70
+REVERSE="reverse"=71
+DECLARE="declare"=72
+EXIT="exit"=73
+GOTO="goto"=74
+ACCEPT="accept"=75
+DO="do"=76
+DELAY="delay"=77
+UNTIL="until"=78
+SELECT="select"=79
+ABORT="abort"=80
+OR="or"=81
+TERMINATE="terminate"=82
+RAISE="raise"=83
+REQUEUE="requeue"=84
+AND="and"=85
+XOR="xor"=86
+NOT="not"=87
+EQ=88
+NE=89
+LT_=90
+LE=91
+GT=92
+GE=93
+PLUS=94
+MINUS=95
+CONCAT=96
+STAR=97
+DIV=98
+REM="rem"=99
+ABS="abs"=100
+EXPON=101
+NUMERIC_LIT=102
+ABORTABLE_PART=103
+ABORT_STATEMENT=104
+ACCEPT_ALTERNATIVE=105
+ACCEPT_STATEMENT=106
+ALLOCATOR=107
+ASSIGNMENT_STATEMENT=108
+ASYNCHRONOUS_SELECT=109
+ATTRIBUTE_DEFINITION_CLAUSE=110
+AT_CLAUSE=111
+BLOCK_STATEMENT=112
+CASE_STATEMENT=113
+CASE_STATEMENT_ALTERNATIVE=114
+CODE_STATEMENT=115
+COMPONENT_DECLARATION=116
+CONDITIONAL_ENTRY_CALL=117
+CONTEXT_CLAUSE=118
+DECLARATIVE_PART=119
+DEFINING_IDENTIFIER_LIST=120
+DELAY_ALTERNATIVE=121
+DELAY_STATEMENT=122
+DELTA_CONSTRAINT=123
+DIGITS_CONSTRAINT=124
+DISCRIMINANT_ASSOCIATION=125
+DISCRIMINANT_CONSTRAINT=126
+DISCRIMINANT_SPECIFICATION=127
+ENTRY_BODY=128
+ENTRY_CALL_ALTERNATIVE=129
+ENTRY_CALL_STATEMENT=130
+ENTRY_DECLARATION=131
+ENTRY_INDEX_SPECIFICATION=132
+ENUMERATION_REPESENTATION_CLAUSE=133
+EXCEPTION_DECLARATION=134
+EXCEPTION_HANDLER=135
+EXCEPTION_RENAMING_DECLARATION=136
+EXIT_STATEMENT=137
+FORMAL_PACKAGE_DECLARATION=138
+GENERIC_FORMAL_PART=139
+GENERIC_PACKAGE_DECLARATION=140
+GOTO_STATEMENT=141
+HANDLED_SEQUENCE_OF_STATEMENTS=142
+HANDLED_STMTS_OPT=143
+IF_STATEMENT=144
+INCOMPLETE_TYPE_DECLARATION=145
+INDEXED_COMPONENT=146
+INDEX_CONSTRAINT=147
+LIBRARY_ITEM=148
+LOOP_STATEMENT=149
+NAME=150
+NULL_STATEMENT=151
+NUMBER_DECLARATION=152
+OBJECT_DECLARATION=153
+OBJECT_RENAMING_DECLARATION=154
+OPERATOR_SYMBOL=155
+PACKAGE_BODY=156
+PACKAGE_BODY_STUB=157
+PACKAGE_RENAMING_DECLARATION=158
+PACKAGE_SPECIFICATION=159
+PARAMETER_SPECIFICATION=160
+PRIVATE_EXTENSION_DECLARATION=161
+PRIVATE_TYPE_DECLARATION=162
+PROTECTED_BODY=163
+PROTECTED_BODY_STUB=164
+PROTECTED_TYPE_DECLARATION=165
+RAISE_STATEMENT=166
+RANGE_ATTRIBUTE_REFERENCE=167
+RECORD_REPRESENTATION_CLAUSE=168
+REQUEUE_STATEMENT=169
+RETURN_STATEMENT=170
+SELECTIVE_ACCEPT=171
+SEQUENCE_OF_STATEMENTS=172
+SINGLE_PROTECTED_DECLARATION=173
+SINGLE_TASK_DECLARATION=174
+STATEMENT=175
+SUBTYPE_DECLARATION=176
+SUBTYPE_INDICATION=177
+SUBTYPE_MARK=178
+SUBUNIT=179
+TASK_BODY=180
+TASK_BODY_STUB=181
+TASK_TYPE_DECLARATION=182
+TERMINATE_ALTERNATIVE=183
+TIMED_ENTRY_CALL=184
+TRIGGERING_ALTERNATIVE=185
+USE_CLAUSE=186
+USE_TYPE_CLAUSE=187
+VARIANT=188
+VARIANT_PART=189
+WITH_CLAUSE=190
+ABSTRACT_FUNCTION_DECLARATION=191
+ABSTRACT_PROCEDURE_DECLARATION=192
+ACCESS_TO_FUNCTION_DECLARATION=193
+ACCESS_TO_OBJECT_DECLARATION=194
+ACCESS_TO_PROCEDURE_DECLARATION=195
+ARRAY_OBJECT_DECLARATION=196
+ARRAY_TYPE_DECLARATION=197
+AND_THEN=198
+BASIC_DECLARATIVE_ITEMS_OPT=199
+BLOCK_BODY=200
+BLOCK_BODY_OPT=201
+CALL_STATEMENT=202
+COMPONENT_CLAUSES_OPT=203
+COMPONENT_ITEMS=204
+COND_CLAUSE=205
+DECIMAL_FIXED_POINT_DECLARATION=206
+DECLARE_OPT=207
+DERIVED_RECORD_EXTENSION=208
+DISCRETE_SUBTYPE_DEF_OPT=209
+DISCRIMINANT_SPECIFICATIONS=210
+DISCRIM_PART_OPT=211
+ELSE_OPT=212
+ELSIFS_OPT=213
+END_ID_OPT=214
+ENTRY_INDEX_OPT=215
+ENUMERATION_TYPE_DECLARATION=216
+EXCEPT_HANDLER_PART_OPT=217
+EXTENSION_OPT=218
+FLOATING_POINT_DECLARATION=219
+FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220
+FORMAL_DISCRETE_TYPE_DECLARATION=221
+FORMAL_FLOATING_POINT_DECLARATION=222
+FORMAL_FUNCTION_DECLARATION=223
+FORMAL_MODULAR_TYPE_DECLARATION=224
+FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225
+FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226
+FORMAL_PART_OPT=227
+FORMAL_PRIVATE_EXTENSION_DECLARATION=228
+FORMAL_PRIVATE_TYPE_DECLARATION=229
+FORMAL_PROCEDURE_DECLARATION=230
+FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231
+FUNCTION_BODY=232
+FUNCTION_BODY_STUB=233
+FUNCTION_DECLARATION=234
+FUNCTION_RENAMING_DECLARATION=235
+GENERIC_FUNCTION_DECLARATION=236
+GENERIC_FUNCTION_INSTANTIATION=237
+GENERIC_FUNCTION_RENAMING=238
+GENERIC_PACKAGE_INSTANTIATION=239
+GENERIC_PACKAGE_RENAMING=240
+GENERIC_PROCEDURE_DECLARATION=241
+GENERIC_PROCEDURE_INSTANTIATION=242
+GENERIC_PROCEDURE_RENAMING=243
+GUARD_OPT=244
+IDENTIFIER_COLON_OPT=245
+ID_OPT=246
+INIT_OPT=247
+ITERATION_SCHEME_OPT=248
+LABEL_OPT=249
+MARK_WITH_CONSTRAINT=250
+MODIFIERS=251
+MODULAR_TYPE_DECLARATION=252
+MOD_CLAUSE_OPT=253
+NOT_IN=254
+ORDINARY_DERIVED_TYPE_DECLARATION=255
+ORDINARY_FIXED_POINT_DECLARATION=256
+OR_ELSE=257
+OR_SELECT_OPT=258
+PARENTHESIZED_PRIMARY=259
+PRIVATE_DECLARATIVE_ITEMS_OPT=260
+PRIVATE_TASK_ITEMS_OPT=261
+PROCEDURE_BODY=262
+PROCEDURE_BODY_STUB=263
+PROCEDURE_DECLARATION=264
+PROCEDURE_RENAMING_DECLARATION=265
+PROT_MEMBER_DECLARATIONS=266
+PROT_OP_BODIES_OPT=267
+PROT_OP_DECLARATIONS=268
+PROT_PRIVATE_OPT=269
+RANGED_EXPRS=270
+RANGE_CONSTRAINT=271
+RECORD_TYPE_DECLARATION=272
+SELECTOR_NAMES_OPT=273
+SIGNED_INTEGER_TYPE_DECLARATION=274
+TASK_ITEMS_OPT=275
+UNARY_MINUS=276
+UNARY_PLUS=277
+VALUE=278
+VALUES=279
+VARIANTS=280
+COMMENT_INTRO=281
+OX=282
+TIC_OR_CHARACTER_LITERAL=283
+DIGIT=284
+EXPONENT=285
+EXTENDED_DIGIT=286
+BASED_INTEGER=287
+WS_=288
+COMMENT=289
diff --git a/languages/ada/AdaTreeParserSuper.cpp b/languages/ada/AdaTreeParserSuper.cpp
new file mode 100644
index 00000000..be5f0623
--- /dev/null
+++ b/languages/ada/AdaTreeParserSuper.cpp
@@ -0,0 +1,9050 @@
+/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.cpp"$ */
+#include "AdaTreeParserSuper.hpp"
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/BitSet.hpp>
+#line 1 "ada.tree.g"
+#line 11 "AdaTreeParserSuper.cpp"
+AdaTreeParserSuper::AdaTreeParserSuper()
+ : ANTLR_USE_NAMESPACE(antlr)TreeParser() {
+}
+
+void AdaTreeParserSuper::compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST compilation_unit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ context_items_opt(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LIBRARY_ITEM:
+ {
+ library_item(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBUNIT:
+ {
+ subunit(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == PRAGMA)) {
+ pragma(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop4;
+ }
+
+ }
+ _loop4:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST context_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t12 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp1_AST_in = _t;
+ match(_t,CONTEXT_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case WITH_CLAUSE:
+ {
+ with_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop14;
+ }
+ }
+ }
+ _loop14:;
+ } // ( ... )*
+ _t = __t12;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST library_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t32 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp2_AST_in = _t;
+ match(_t,LIBRARY_ITEM);
+ _t = _t->getFirstChild();
+ modifiers(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl_or_rename_or_inst_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t34 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp3_AST_in = _t;
+ match(_t,PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t34;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t35 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp4_AST_in = _t;
+ match(_t,GENERIC_PACKAGE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t35;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_SPECIFICATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t36 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp5_AST_in = _t;
+ match(_t,PACKAGE_SPECIFICATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_spec_part(_t);
+ _t = _retTree;
+ _t = __t36;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t37 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp6_AST_in = _t;
+ match(_t,PACKAGE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t37;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ generic_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t32;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subunit_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t514 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp7_AST_in = _t;
+ match(_t,SUBUNIT);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FUNCTION_BODY:
+ case PROCEDURE_BODY:
+ {
+ subprogram_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ package_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case TASK_BODY:
+ {
+ task_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_BODY:
+ {
+ protected_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t514;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST pragma_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t6 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp8_AST_in = _t;
+ match(_t,PRAGMA);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp9_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_0.member(_t->getType()))) {
+ pragma_arg(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop8;
+ }
+
+ }
+ _loop8:;
+ } // ( ... )*
+ _t = __t6;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST pragma_arg_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RIGHT_SHAFT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t10 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp10_AST_in = _t;
+ match(_t,RIGHT_SHAFT);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp11_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ _t = __t10;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case AND:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t472 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp12_AST_in = _t;
+ match(_t,AND);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t472;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AND_THEN:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t473 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp13_AST_in = _t;
+ match(_t,AND_THEN);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t473;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OR:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t474 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp14_AST_in = _t;
+ match(_t,OR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t474;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OR_ELSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t475 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp15_AST_in = _t;
+ match(_t,OR_ELSE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t475;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case XOR:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t476 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp16_AST_in = _t;
+ match(_t,XOR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ relation(_t);
+ _t = _retTree;
+ _t = __t476;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case NOT_IN:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ relation(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST with_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t16 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp17_AST_in = _t;
+ match(_t,WITH_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt18=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) {
+ compound_name(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt18>=1 ) { goto _loop18; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt18++;
+ }
+ _loop18:;
+ } // ( ... )+
+ _t = __t16;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST use_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case USE_TYPE_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t22 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp18_AST_in = _t;
+ match(_t,USE_TYPE_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt24=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT || _t->getType() == TIC)) {
+ subtype_mark(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt24>=1 ) { goto _loop24; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt24++;
+ }
+ _loop24:;
+ } // ( ... )+
+ _t = __t22;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case USE_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t25 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp19_AST_in = _t;
+ match(_t,USE_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt27=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == DOT)) {
+ compound_name(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt27>=1 ) { goto _loop27; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt27++;
+ }
+ _loop27:;
+ } // ( ... )+
+ _t = __t25;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST compound_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t20 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp21_AST_in = _t;
+ match(_t,DOT);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp22_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ _t = __t20;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subtype_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case TIC:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t29 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp23_AST_in = _t;
+ match(_t,TIC);
+ _t = _t->getFirstChild();
+ compound_name(_t);
+ _t = _retTree;
+ attribute_id(_t);
+ _t = _retTree;
+ _t = __t29;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST attribute_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST_in = _t;
+ match(_t,RANGE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIGITS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp25_AST_in = _t;
+ match(_t,DIGITS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DELTA:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp26_AST_in = _t;
+ match(_t,DELTA);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp27_AST_in = _t;
+ match(_t,ACCESS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp28_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST modifiers_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t39 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp29_AST_in = _t;
+ match(_t,MODIFIERS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp30_AST_in = _t;
+ match(_t,ABSTRACT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp31_AST_in = _t;
+ match(_t,ACCESS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ALIASED:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp32_AST_in = _t;
+ match(_t,ALIASED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp33_AST_in = _t;
+ match(_t,ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONSTANT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp34_AST_in = _t;
+ match(_t,CONSTANT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IN:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp35_AST_in = _t;
+ match(_t,IN);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LIMITED:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp36_AST_in = _t;
+ match(_t,LIMITED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OUT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp37_AST_in = _t;
+ match(_t,OUT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp38_AST_in = _t;
+ match(_t,PRIVATE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp39_AST_in = _t;
+ match(_t,PROTECTED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case REVERSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST_in = _t;
+ match(_t,REVERSE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TAGGED:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp41_AST_in = _t;
+ match(_t,TAGGED);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ goto _loop41;
+ }
+ }
+ }
+ _loop41:;
+ } // ( ... )*
+ _t = __t39;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_rename_or_inst_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST def_id_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ compound_name(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST pkg_body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ declarative_part(_t);
+ _t = _retTree;
+ block_body_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST generic_inst_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ compound_name(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST pkg_spec_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ basic_declarative_items_opt(_t);
+ _t = _retTree;
+ private_declarative_items_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST renames_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CHARACTER_STRING:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp42_AST_in = _t;
+ match(_t,CHARACTER_STRING);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST_in = _t;
+ match(_t,OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST generic_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PACKAGE_RENAMING:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t277 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp44_AST_in = _t;
+ match(_t,GENERIC_PACKAGE_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t277;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t278 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp45_AST_in = _t;
+ match(_t,GENERIC_PACKAGE_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ pkg_spec_part(_t);
+ _t = _retTree;
+ _t = __t278;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t279 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp46_AST_in = _t;
+ match(_t,GENERIC_PROCEDURE_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t279;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t280 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp47_AST_in = _t;
+ match(_t,GENERIC_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t280;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_RENAMING:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t281 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp48_AST_in = _t;
+ match(_t,GENERIC_FUNCTION_RENAMING);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t281;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t282 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST_in = _t;
+ match(_t,GENERIC_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ generic_formal_part_opt(_t);
+ _t = _retTree;
+ def_id(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t282;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t43 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp50_AST_in = _t;
+ match(_t,ID_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case OPERATOR_SYMBOL:
+ {
+ def_designator(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t43;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST def_designator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ definable_operator_symbol(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST end_id_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t46 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp51_AST_in = _t;
+ match(_t,END);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case OPERATOR_SYMBOL:
+ {
+ def_designator(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t46;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t49 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST_in = _t;
+ match(_t,GENERIC_PROCEDURE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t49;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t50 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp53_AST_in = _t;
+ match(_t,PROCEDURE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t50;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t51 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp54_AST_in = _t;
+ match(_t,PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t51;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE_BODY_STUB:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t52 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp55_AST_in = _t;
+ match(_t,PROCEDURE_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t52;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t53 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp56_AST_in = _t;
+ match(_t,ABSTRACT_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t53;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_FUNCTION_INSTANTIATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t54 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp57_AST_in = _t;
+ match(_t,GENERIC_FUNCTION_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t54;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t55 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp58_AST_in = _t;
+ match(_t,FUNCTION_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t55;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t56 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp59_AST_in = _t;
+ match(_t,FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t56;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_BODY_STUB:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t57 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp60_AST_in = _t;
+ match(_t,FUNCTION_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t57;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t58 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST_in = _t;
+ match(_t,ABSTRACT_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t58;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t84 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp62_AST_in = _t;
+ match(_t,FORMAL_PART_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == PARAMETER_SPECIFICATION)) {
+ parameter_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop86;
+ }
+
+ }
+ _loop86:;
+ } // ( ... )*
+ _t = __t84;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST function_tail_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ formal_part_opt(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST value_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t468 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp63_AST_in = _t;
+ match(_t,VALUES);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt470=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_1.member(_t->getType()))) {
+ value(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt470>=1 ) { goto _loop470; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt470++;
+ }
+ _loop470:;
+ } // ( ... )+
+ _t = __t468;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::value(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST value_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case OTHERS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t63 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp64_AST_in = _t;
+ match(_t,OTHERS);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ _t = __t63;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RIGHT_SHAFT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t64 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST_in = _t;
+ match(_t,RIGHT_SHAFT);
+ _t = _t->getFirstChild();
+ ranged_expr_s(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t64;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case PIPE:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ ranged_expr_s(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t66 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp66_AST_in = _t;
+ match(_t,PIPE);
+ _t = _t->getFirstChild();
+ ranged_expr_s(_t);
+ _t = _retTree;
+ ranged_expr(_t);
+ _t = _retTree;
+ _t = __t66;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ ranged_expr(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST ranged_expr_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t68 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp67_AST_in = _t;
+ match(_t,DOT_DOT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t68;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RANGE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t69 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp68_AST_in = _t;
+ match(_t,RANGE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ _t = __t69;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST simple_expression_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PLUS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t488 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST_in = _t;
+ match(_t,PLUS);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t488;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t489 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST_in = _t;
+ match(_t,MINUS);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t489;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONCAT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t490 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST_in = _t;
+ match(_t,CONCAT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ signed_term(_t);
+ _t = _retTree;
+ _t = __t490;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ signed_term(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ range_dots(_t);
+ _t = _retTree;
+ break;
+ }
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range_attrib_ref(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t71 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST_in = _t;
+ match(_t,RANGE_CONSTRAINT);
+ _t = _t->getFirstChild();
+ range(_t);
+ _t = _retTree;
+ _t = __t71;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_dots_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t75 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp73_AST_in = _t;
+ match(_t,DOT_DOT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t75;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_attrib_ref_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t77 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp74_AST_in = _t;
+ match(_t,RANGE_ATTRIBUTE_REFERENCE);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t77;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prefix_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp75_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t80 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp76_AST_in = _t;
+ match(_t,DOT);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp77_AST_in = _t;
+ match(_t,ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp78_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t80;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t82 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp79_AST_in = _t;
+ match(_t,INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ prefix(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t82;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST parameter_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t88 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp80_AST_in = _t;
+ match(_t,PARAMETER_SPECIFICATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t88;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST defining_identifier_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t90 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp81_AST_in = _t;
+ match(_t,DEFINING_IDENTIFIER_LIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt92=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER)) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp82_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ else {
+ if ( _cnt92>=1 ) { goto _loop92; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt92++;
+ }
+ _loop92:;
+ } // ( ... )+
+ _t = __t90;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST init_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t136 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp83_AST_in = _t;
+ match(_t,INIT_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t136;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp84_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t95 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp85_AST_in = _t;
+ match(_t,DOT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp86_AST_in = _t;
+ match(_t,ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp87_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp88_AST_in = _t;
+ match(_t,CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp89_AST_in = _t;
+ match(_t,OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t95;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t97 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp90_AST_in = _t;
+ match(_t,INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t97;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIC:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t98 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp91_AST_in = _t;
+ match(_t,TIC);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ attribute_id(_t);
+ _t = _retTree;
+ _t = __t98;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST definable_operator_symbol_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp92_AST_in = _t;
+ match(_t,OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST parenthesized_primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t101 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp93_AST_in = _t;
+ match(_t,PARENTHESIZED_PRIMARY);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NuLL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp94_AST_in = _t;
+ match(_t,NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ extension_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t101;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST extension_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t104 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp95_AST_in = _t;
+ match(_t,EXTENSION_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NuLL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp96_AST_in = _t;
+ match(_t,NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case VALUES:
+ {
+ value_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t104;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST spec_decl_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t109 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp97_AST_in = _t;
+ match(_t,GENERIC_PACKAGE_INSTANTIATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ generic_inst(_t);
+ _t = _retTree;
+ _t = __t109;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_SPECIFICATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t110 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp98_AST_in = _t;
+ match(_t,PACKAGE_SPECIFICATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_spec_part(_t);
+ _t = _retTree;
+ _t = __t110;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t111 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp99_AST_in = _t;
+ match(_t,PACKAGE_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ renames(_t);
+ _t = _retTree;
+ _t = __t111;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST basic_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t114 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp100_AST_in = _t;
+ match(_t,BASIC_DECLARATIVE_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_2.member(_t->getType()))) {
+ basic_decl_item(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop116;
+ }
+
+ }
+ _loop116:;
+ } // ( ... )*
+ _t = __t114;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST private_declarative_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t118 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp101_AST_in = _t;
+ match(_t,PRIVATE_DECLARATIVE_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_2.member(_t->getType()))) {
+ basic_decl_item(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop120;
+ }
+
+ }
+ _loop120:;
+ } // ( ... )*
+ _t = __t118;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST basic_decl_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ spec_decl_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ {
+ task_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_TYPE_DECLARATION:
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ prot_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SUBTYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ decl_common(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST task_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case TASK_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t123 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp102_AST_in = _t;
+ match(_t,TASK_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ task_definition_opt(_t);
+ _t = _retTree;
+ _t = __t123;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t124 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp103_AST_in = _t;
+ match(_t,SINGLE_TASK_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ task_definition_opt(_t);
+ _t = _retTree;
+ _t = __t124;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_type_or_single_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROTECTED_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t164 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp104_AST_in = _t;
+ match(_t,PROTECTED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ protected_definition(_t);
+ _t = _retTree;
+ _t = __t164;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t165 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp105_AST_in = _t;
+ match(_t,SINGLE_PROTECTED_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ protected_definition(_t);
+ _t = _retTree;
+ _t = __t165;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST decl_common_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENUMERATION_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t184 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp106_AST_in = _t;
+ match(_t,ENUMERATION_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp107_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ enum_id_s(_t);
+ _t = _retTree;
+ _t = __t184;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t185 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp108_AST_in = _t;
+ match(_t,SIGNED_INTEGER_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp109_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ range(_t);
+ _t = _retTree;
+ _t = __t185;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MODULAR_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t186 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp110_AST_in = _t;
+ match(_t,MODULAR_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp111_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ _t = __t186;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FLOATING_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t187 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp112_AST_in = _t;
+ match(_t,FLOATING_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp113_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t187;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t188 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp114_AST_in = _t;
+ match(_t,ORDINARY_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp115_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ _t = __t188;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t189 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp116_AST_in = _t;
+ match(_t,DECIMAL_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp117_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t189;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_TYPE_DECLARATION:
+ {
+ array_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ access_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case INCOMPLETE_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t190 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp118_AST_in = _t;
+ match(_t,INCOMPLETE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp119_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrim_part_opt(_t);
+ _t = _retTree;
+ _t = __t190;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE_EXTENSION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t191 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp120_AST_in = _t;
+ match(_t,PRIVATE_EXTENSION_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t191;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DERIVED_RECORD_EXTENSION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t192 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp121_AST_in = _t;
+ match(_t,DERIVED_RECORD_EXTENSION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ record_definition(_t);
+ _t = _retTree;
+ _t = __t192;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t193 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp122_AST_in = _t;
+ match(_t,ORDINARY_DERIVED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t193;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PRIVATE_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t194 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp123_AST_in = _t;
+ match(_t,PRIVATE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ _t = __t194;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RECORD_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t195 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp124_AST_in = _t;
+ match(_t,RECORD_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_and_discrim(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ record_definition(_t);
+ _t = _retTree;
+ _t = __t195;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SUBTYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t196 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp125_AST_in = _t;
+ match(_t,SUBTYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp126_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t196;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GENERIC_PACKAGE_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ {
+ generic_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ case EXCEPTION_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t197 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp127_AST_in = _t;
+ match(_t,EXCEPTION_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ compound_name(_t);
+ _t = _retTree;
+ _t = __t197;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OBJECT_RENAMING_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t198 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp128_AST_in = _t;
+ match(_t,OBJECT_RENAMING_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ name(_t);
+ _t = _retTree;
+ _t = __t198;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EXCEPTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t199 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp129_AST_in = _t;
+ match(_t,EXCEPTION_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ _t = __t199;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUMBER_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t200 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp130_AST_in = _t;
+ match(_t,NUMBER_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t200;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_OBJECT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t201 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp131_AST_in = _t;
+ match(_t,ARRAY_OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ array_type_definition(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t201;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OBJECT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t202 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp132_AST_in = _t;
+ match(_t,OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t202;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discrim_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t127 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp133_AST_in = _t;
+ match(_t,DISCRIM_PART_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp134_AST_in = _t;
+ match(_t,BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DISCRIMINANT_SPECIFICATIONS:
+ {
+ discriminant_specifications(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t127;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST task_definition_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ task_items_opt(_t);
+ _t = _retTree;
+ private_task_items_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t139 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp135_AST_in = _t;
+ match(_t,TASK_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ entrydecls_repspecs_opt(_t);
+ _t = _retTree;
+ _t = __t139;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST private_task_items_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t162 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp136_AST_in = _t;
+ match(_t,PRIVATE_TASK_ITEMS_OPT);
+ _t = _t->getFirstChild();
+ entrydecls_repspecs_opt(_t);
+ _t = _retTree;
+ _t = __t162;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specifications_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t130 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp137_AST_in = _t;
+ match(_t,DISCRIMINANT_SPECIFICATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == DISCRIMINANT_SPECIFICATION)) {
+ discriminant_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop132;
+ }
+
+ }
+ _loop132:;
+ } // ( ... )*
+ _t = __t130;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t134 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp138_AST_in = _t;
+ match(_t,DISCRIMINANT_SPECIFICATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_mark(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t134;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entrydecls_repspecs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENTRY_DECLARATION:
+ {
+ entry_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop142;
+ }
+ }
+ }
+ _loop142:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t144 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp139_AST_in = _t;
+ match(_t,ENTRY_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp140_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrete_subtype_def_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t144;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST rep_spec_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t150 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp141_AST_in = _t;
+ match(_t,RECORD_REPRESENTATION_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ align_opt(_t);
+ _t = _retTree;
+ comp_loc_s(_t);
+ _t = _retTree;
+ _t = __t150;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AT_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t151 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp142_AST_in = _t;
+ match(_t,AT_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t151;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t152 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp143_AST_in = _t;
+ match(_t,ATTRIBUTE_DEFINITION_CLAUSE);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t152;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t153 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp144_AST_in = _t;
+ match(_t,ENUMERATION_REPESENTATION_CLAUSE);
+ _t = _t->getFirstChild();
+ local_enum_name(_t);
+ _t = _retTree;
+ enumeration_aggregate(_t);
+ _t = _retTree;
+ _t = __t153;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_def_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t146 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp145_AST_in = _t;
+ match(_t,DISCRETE_SUBTYPE_DEF_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case SUBTYPE_INDICATION:
+ {
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t146;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discrete_subtype_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBTYPE_INDICATION:
+ {
+ subtype_ind(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subtype_ind_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t221 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp146_AST_in = _t;
+ match(_t,SUBTYPE_INDICATION);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ constraint_opt(_t);
+ _t = _retTree;
+ _t = __t221;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST align_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t155 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp147_AST_in = _t;
+ match(_t,MOD_CLAUSE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t155;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST comp_loc_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t158 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp148_AST_in = _t;
+ match(_t,COMPONENT_CLAUSES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ {
+ subtype_mark(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop160;
+ }
+ }
+ }
+ _loop160:;
+ } // ( ... )*
+ _t = __t158;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST local_enum_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp149_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_aggregate_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_1.member(_t->getType()))) {
+ value(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop275;
+ }
+
+ }
+ _loop275:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST protected_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ prot_op_decl_s(_t);
+ _t = _retTree;
+ prot_private_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_private_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t167 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp150_AST_in = _t;
+ match(_t,PROT_PRIVATE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROT_MEMBER_DECLARATIONS:
+ {
+ prot_member_decl_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t167;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_member_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t178 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp151_AST_in = _t;
+ match(_t,PROT_MEMBER_DECLARATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENTRY_DECLARATION:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case FUNCTION_DECLARATION:
+ case PROCEDURE_DECLARATION:
+ {
+ prot_op_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMPONENT_DECLARATION:
+ {
+ comp_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop180;
+ }
+ }
+ }
+ _loop180:;
+ } // ( ... )*
+ _t = __t178;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t171 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp152_AST_in = _t;
+ match(_t,PROT_OP_DECLARATIONS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_3.member(_t->getType()))) {
+ prot_op_decl(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop173;
+ }
+
+ }
+ _loop173:;
+ } // ( ... )*
+ _t = __t171;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ENTRY_DECLARATION:
+ {
+ entry_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t175 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp153_AST_in = _t;
+ match(_t,PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t175;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t176 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp154_AST_in = _t;
+ match(_t,FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t176;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case RECORD_REPRESENTATION_CLAUSE:
+ {
+ rep_spec(_t);
+ _t = _retTree;
+ break;
+ }
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST comp_decl_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t182 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp155_AST_in = _t;
+ match(_t,COMPONENT_DECLARATION);
+ _t = _t->getFirstChild();
+ defining_identifier_list(_t);
+ _t = _retTree;
+ component_subtype_def(_t);
+ _t = _retTree;
+ init_opt(_t);
+ _t = _retTree;
+ _t = __t182;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST component_subtype_def_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST enum_id_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt206=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER || _t->getType() == CHARACTER_LITERAL)) {
+ enumeration_literal_specification(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt206>=1 ) { goto _loop206; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt206++;
+ }
+ _loop206:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE_CONSTRAINT:
+ {
+ range_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t212 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp156_AST_in = _t;
+ match(_t,ARRAY_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp157_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ array_type_definition(_t);
+ _t = _retTree;
+ _t = __t212;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t245 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp158_AST_in = _t;
+ match(_t,ACCESS_TO_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp159_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t245;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t246 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp160_AST_in = _t;
+ match(_t,ACCESS_TO_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp161_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t246;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ACCESS_TO_OBJECT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t247 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp162_AST_in = _t;
+ match(_t,ACCESS_TO_OBJECT_DECLARATION);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp163_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t247;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST id_and_discrim_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp164_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ discrim_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST record_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case COMPONENT_ITEMS:
+ {
+ component_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST array_type_definition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ index_or_discrete_range_s(_t);
+ _t = _retTree;
+ component_subtype_def(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST enumeration_literal_specification_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp165_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp166_AST_in = _t;
+ match(_t,CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case RANGE:
+ case DOT_DOT:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ index_or_discrete_range(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMMA:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t214 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp167_AST_in = _t;
+ match(_t,COMMA);
+ _t = _t->getFirstChild();
+ index_or_discrete_range_s(_t);
+ _t = _retTree;
+ index_or_discrete_range(_t);
+ _t = _retTree;
+ _t = __t214;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST index_or_discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t216 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp168_AST_in = _t;
+ match(_t,DOT_DOT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t216;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case RANGE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t217 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp169_AST_in = _t;
+ match(_t,RANGE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp170_AST_in = _t;
+ match(_t,BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t217;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ simple_expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST constraint_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case RANGE_CONSTRAINT:
+ {
+ range_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DIGITS_CONSTRAINT:
+ {
+ digits_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELTA_CONSTRAINT:
+ {
+ delta_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case INDEX_CONSTRAINT:
+ {
+ index_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DISCRIMINANT_CONSTRAINT:
+ {
+ discriminant_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST digits_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t225 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp171_AST_in = _t;
+ match(_t,DIGITS_CONSTRAINT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t225;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST delta_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t227 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp172_AST_in = _t;
+ match(_t,DELTA_CONSTRAINT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ range_constraint_opt(_t);
+ _t = _retTree;
+ _t = __t227;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST index_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t229 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp173_AST_in = _t;
+ match(_t,INDEX_CONSTRAINT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt231=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == DOT_DOT || _t->getType() == RANGE_ATTRIBUTE_REFERENCE || _t->getType() == SUBTYPE_INDICATION)) {
+ discrete_range(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt231>=1 ) { goto _loop231; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt231++;
+ }
+ _loop231:;
+ } // ( ... )+
+ _t = __t229;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t234 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp174_AST_in = _t;
+ match(_t,DISCRIMINANT_CONSTRAINT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt236=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == DISCRIMINANT_ASSOCIATION)) {
+ discriminant_association(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt236>=1 ) { goto _loop236; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt236++;
+ }
+ _loop236:;
+ } // ( ... )+
+ _t = __t234;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discrete_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case SUBTYPE_INDICATION:
+ {
+ subtype_ind(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_association_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t238 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp175_AST_in = _t;
+ match(_t,DISCRIMINANT_ASSOCIATION);
+ _t = _t->getFirstChild();
+ selector_names_opt(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t238;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST selector_names_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t240 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp176_AST_in = _t;
+ match(_t,SELECTOR_NAMES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENTIFIER)) {
+ selector_name(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop242;
+ }
+
+ }
+ _loop242:;
+ } // ( ... )*
+ _t = __t240;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST selector_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp177_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST component_list_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ component_items(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VARIANT_PART:
+ {
+ variant_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST component_items_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t253 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp178_AST_in = _t;
+ match(_t,COMPONENT_ITEMS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case COMPONENT_DECLARATION:
+ {
+ comp_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop255;
+ }
+ }
+ }
+ _loop255:;
+ } // ( ... )*
+ _t = __t253;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST variant_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t257 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp179_AST_in = _t;
+ match(_t,VARIANT_PART);
+ _t = _t->getFirstChild();
+ discriminant_direct_name(_t);
+ _t = _retTree;
+ variant_s(_t);
+ _t = _retTree;
+ _t = __t257;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discriminant_direct_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp180_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST variant_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t260 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp181_AST_in = _t;
+ match(_t,VARIANTS);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt262=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == VARIANT)) {
+ variant(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt262>=1 ) { goto _loop262; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt262++;
+ }
+ _loop262:;
+ } // ( ... )+
+ _t = __t260;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST variant_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t264 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp182_AST_in = _t;
+ match(_t,VARIANT);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case COMPONENT_ITEMS:
+ {
+ component_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t264;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t267 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp183_AST_in = _t;
+ match(_t,PIPE);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ choice(_t);
+ _t = _retTree;
+ _t = __t267;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case OTHERS:
+ case DOT_DOT:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case AND_THEN:
+ case MARK_WITH_CONSTRAINT:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ choice(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case OTHERS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp184_AST_in = _t;
+ match(_t,OTHERS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ case MARK_WITH_CONSTRAINT:
+ {
+ discrete_with_range(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST discrete_with_range_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case MARK_WITH_CONSTRAINT:
+ {
+ mark_with_constraint(_t);
+ _t = _retTree;
+ break;
+ }
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST mark_with_constraint_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t271 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp185_AST_in = _t;
+ match(_t,MARK_WITH_CONSTRAINT);
+ _t = _t->getFirstChild();
+ subtype_mark(_t);
+ _t = _retTree;
+ range_constraint(_t);
+ _t = _retTree;
+ _t = __t271;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t284 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp186_AST_in = _t;
+ match(_t,GENERIC_FORMAL_PART);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ {
+ use_clause(_t);
+ _t = _retTree;
+ break;
+ }
+ case FORMAL_PACKAGE_DECLARATION:
+ case PARAMETER_SPECIFICATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case FORMAL_DECIMAL_FIXED_POINT_DECLARATION:
+ case FORMAL_DISCRETE_TYPE_DECLARATION:
+ case FORMAL_FLOATING_POINT_DECLARATION:
+ case FORMAL_FUNCTION_DECLARATION:
+ case FORMAL_MODULAR_TYPE_DECLARATION:
+ case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION:
+ case FORMAL_ORDINARY_FIXED_POINT_DECLARATION:
+ case FORMAL_PRIVATE_EXTENSION_DECLARATION:
+ case FORMAL_PRIVATE_TYPE_DECLARATION:
+ case FORMAL_PROCEDURE_DECLARATION:
+ case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ generic_formal_parameter(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop286;
+ }
+ }
+ }
+ _loop286:;
+ } // ( ... )*
+ _t = __t284;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST generic_formal_parameter_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FORMAL_DISCRETE_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t288 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp187_AST_in = _t;
+ match(_t,FORMAL_DISCRETE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t288;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t289 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp188_AST_in = _t;
+ match(_t,FORMAL_SIGNED_INTEGER_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t289;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_MODULAR_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t290 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp189_AST_in = _t;
+ match(_t,FORMAL_MODULAR_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t290;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_DECIMAL_FIXED_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t291 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp190_AST_in = _t;
+ match(_t,FORMAL_DECIMAL_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t291;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_ORDINARY_FIXED_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t292 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp191_AST_in = _t;
+ match(_t,FORMAL_ORDINARY_FIXED_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t292;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_FLOATING_POINT_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t293 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp192_AST_in = _t;
+ match(_t,FORMAL_FLOATING_POINT_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t293;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY_TYPE_DECLARATION:
+ {
+ formal_array_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ {
+ formal_access_type_declaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case FORMAL_PRIVATE_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t294 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp193_AST_in = _t;
+ match(_t,FORMAL_PRIVATE_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ _t = __t294;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t295 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp194_AST_in = _t;
+ match(_t,FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t295;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PRIVATE_EXTENSION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t296 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp195_AST_in = _t;
+ match(_t,FORMAL_PRIVATE_EXTENSION_DECLARATION);
+ _t = _t->getFirstChild();
+ id_part(_t);
+ _t = _retTree;
+ modifiers(_t);
+ _t = _retTree;
+ subtype_ind(_t);
+ _t = _retTree;
+ _t = __t296;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t297 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp196_AST_in = _t;
+ match(_t,FORMAL_PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ subprogram_default_opt(_t);
+ _t = _retTree;
+ _t = __t297;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t298 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp197_AST_in = _t;
+ match(_t,FORMAL_FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ subprogram_default_opt(_t);
+ _t = _retTree;
+ _t = __t298;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FORMAL_PACKAGE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t299 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp198_AST_in = _t;
+ match(_t,FORMAL_PACKAGE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ compound_name(_t);
+ _t = _retTree;
+ formal_package_actual_part_opt(_t);
+ _t = _retTree;
+ _t = __t299;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PARAMETER_SPECIFICATION:
+ {
+ parameter_specification(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST formal_array_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ array_type_declaration(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST formal_access_type_declaration_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ access_type_declaration(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST id_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ def_id(_t);
+ _t = _retTree;
+ discrim_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_default_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp199_AST_in = _t;
+ match(_t,BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST formal_package_actual_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BOX:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp200_AST_in = _t;
+ match(_t,BOX);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DEFINING_IDENTIFIER_LIST:
+ {
+ defining_identifier_list(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST procedure_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t309 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp201_AST_in = _t;
+ match(_t,PROCEDURE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t309;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST function_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t311 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp202_AST_in = _t;
+ match(_t,FUNCTION_BODY);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t311;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST body_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ declarative_part(_t);
+ _t = _retTree;
+ block_body(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST declarative_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t314 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp203_AST_in = _t;
+ match(_t,DECLARATIVE_PART);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PACKAGE_BODY:
+ case PACKAGE_BODY_STUB:
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case PROTECTED_BODY:
+ case PROTECTED_BODY_STUB:
+ case PROTECTED_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SINGLE_PROTECTED_DECLARATION:
+ case SINGLE_TASK_DECLARATION:
+ case SUBTYPE_DECLARATION:
+ case TASK_BODY:
+ case TASK_BODY_STUB:
+ case TASK_TYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ declarative_item(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop316;
+ }
+ }
+ }
+ _loop316:;
+ } // ( ... )*
+ _t = __t314;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST block_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t336 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp204_AST_in = _t;
+ match(_t,BLOCK_BODY);
+ _t = _t->getFirstChild();
+ handled_stmt_s(_t);
+ _t = _retTree;
+ _t = __t336;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST declarative_item_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKAGE_BODY_STUB:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t318 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp205_AST_in = _t;
+ match(_t,PACKAGE_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t318;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_BODY:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t319 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp206_AST_in = _t;
+ match(_t,PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t319;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PACKAGE_RENAMING_DECLARATION:
+ case PACKAGE_SPECIFICATION:
+ case GENERIC_PACKAGE_INSTANTIATION:
+ {
+ spec_decl_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case TASK_BODY_STUB:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t320 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp207_AST_in = _t;
+ match(_t,TASK_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t320;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TASK_BODY:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t321 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp208_AST_in = _t;
+ match(_t,TASK_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t321;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SINGLE_TASK_DECLARATION:
+ case TASK_TYPE_DECLARATION:
+ {
+ task_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROTECTED_BODY_STUB:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t322 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp209_AST_in = _t;
+ match(_t,PROTECTED_BODY_STUB);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ _t = __t322;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED_BODY:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t323 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp210_AST_in = _t;
+ match(_t,PROTECTED_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ prot_op_bodies_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t323;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROTECTED_TYPE_DECLARATION:
+ case SINGLE_PROTECTED_DECLARATION:
+ {
+ prot_type_or_single_decl(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABSTRACT_FUNCTION_DECLARATION:
+ case ABSTRACT_PROCEDURE_DECLARATION:
+ case FUNCTION_BODY:
+ case FUNCTION_BODY_STUB:
+ case FUNCTION_DECLARATION:
+ case FUNCTION_RENAMING_DECLARATION:
+ case GENERIC_FUNCTION_INSTANTIATION:
+ case GENERIC_PROCEDURE_INSTANTIATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_BODY_STUB:
+ case PROCEDURE_DECLARATION:
+ case PROCEDURE_RENAMING_DECLARATION:
+ {
+ subprog_decl_or_rename_or_inst_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case ATTRIBUTE_DEFINITION_CLAUSE:
+ case AT_CLAUSE:
+ case ENUMERATION_REPESENTATION_CLAUSE:
+ case EXCEPTION_DECLARATION:
+ case EXCEPTION_RENAMING_DECLARATION:
+ case GENERIC_PACKAGE_DECLARATION:
+ case INCOMPLETE_TYPE_DECLARATION:
+ case NUMBER_DECLARATION:
+ case OBJECT_DECLARATION:
+ case OBJECT_RENAMING_DECLARATION:
+ case PRIVATE_EXTENSION_DECLARATION:
+ case PRIVATE_TYPE_DECLARATION:
+ case RECORD_REPRESENTATION_CLAUSE:
+ case SUBTYPE_DECLARATION:
+ case USE_CLAUSE:
+ case USE_TYPE_CLAUSE:
+ case ACCESS_TO_FUNCTION_DECLARATION:
+ case ACCESS_TO_OBJECT_DECLARATION:
+ case ACCESS_TO_PROCEDURE_DECLARATION:
+ case ARRAY_OBJECT_DECLARATION:
+ case ARRAY_TYPE_DECLARATION:
+ case DECIMAL_FIXED_POINT_DECLARATION:
+ case DERIVED_RECORD_EXTENSION:
+ case ENUMERATION_TYPE_DECLARATION:
+ case FLOATING_POINT_DECLARATION:
+ case GENERIC_FUNCTION_DECLARATION:
+ case GENERIC_FUNCTION_RENAMING:
+ case GENERIC_PACKAGE_RENAMING:
+ case GENERIC_PROCEDURE_DECLARATION:
+ case GENERIC_PROCEDURE_RENAMING:
+ case MODULAR_TYPE_DECLARATION:
+ case ORDINARY_DERIVED_TYPE_DECLARATION:
+ case ORDINARY_FIXED_POINT_DECLARATION:
+ case RECORD_TYPE_DECLARATION:
+ case SIGNED_INTEGER_TYPE_DECLARATION:
+ {
+ decl_common(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST prot_op_bodies_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t329 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp211_AST_in = _t;
+ match(_t,PROT_OP_BODIES_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case ENTRY_BODY:
+ {
+ entry_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ case FUNCTION_DECLARATION:
+ case PROCEDURE_BODY:
+ case PROCEDURE_DECLARATION:
+ {
+ subprog_decl_or_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop331;
+ }
+ }
+ }
+ _loop331:;
+ } // ( ... )*
+ _t = __t329;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST block_body_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t326 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp212_AST_in = _t;
+ match(_t,BLOCK_BODY_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case HANDLED_SEQUENCE_OF_STATEMENTS:
+ {
+ handled_stmt_s(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t326;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmt_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t338 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp213_AST_in = _t;
+ match(_t,HANDLED_SEQUENCE_OF_STATEMENTS);
+ _t = _t->getFirstChild();
+ statements(_t);
+ _t = _retTree;
+ except_handler_part_opt(_t);
+ _t = _retTree;
+ _t = __t338;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t398 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp214_AST_in = _t;
+ match(_t,ENTRY_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ entry_body_formal_part(_t);
+ _t = _retTree;
+ entry_barrier(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t398;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subprog_decl_or_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t333 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp215_AST_in = _t;
+ match(_t,PROCEDURE_DECLARATION);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ _t = __t333;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_DECLARATION:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t334 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp216_AST_in = _t;
+ match(_t,FUNCTION_DECLARATION);
+ _t = _t->getFirstChild();
+ def_designator(_t);
+ _t = _retTree;
+ function_tail(_t);
+ _t = _retTree;
+ _t = __t334;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST statements_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t343 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp217_AST_in = _t;
+ match(_t,SEQUENCE_OF_STATEMENTS);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt345=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case STATEMENT:
+ {
+ statement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ if ( _cnt345>=1 ) { goto _loop345; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+ }
+ _cnt345++;
+ }
+ _loop345:;
+ } // ( ... )+
+ _t = __t343;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST except_handler_part_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t448 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp218_AST_in = _t;
+ match(_t,EXCEPT_HANDLER_PART_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == EXCEPTION_HANDLER)) {
+ exception_handler(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop450;
+ }
+
+ }
+ _loop450:;
+ } // ( ... )*
+ _t = __t448;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST handled_stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t340 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp219_AST_in = _t;
+ match(_t,HANDLED_STMTS_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SEQUENCE_OF_STATEMENTS:
+ {
+ statements(_t);
+ _t = _retTree;
+ except_handler_part_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t340;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST statement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t347 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp220_AST_in = _t;
+ match(_t,STATEMENT);
+ _t = _t->getFirstChild();
+ def_label_opt(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NULL_STATEMENT:
+ {
+ null_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case EXIT_STATEMENT:
+ {
+ exit_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case RETURN_STATEMENT:
+ {
+ return_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case GOTO_STATEMENT:
+ {
+ goto_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELAY_STATEMENT:
+ {
+ delay_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ABORT_STATEMENT:
+ {
+ abort_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case RAISE_STATEMENT:
+ {
+ raise_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case REQUEUE_STATEMENT:
+ {
+ requeue_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ACCEPT_STATEMENT:
+ {
+ accept_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ASYNCHRONOUS_SELECT:
+ case CONDITIONAL_ENTRY_CALL:
+ case SELECTIVE_ACCEPT:
+ case TIMED_ENTRY_CALL:
+ {
+ select_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case IF_STATEMENT:
+ {
+ if_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case CASE_STATEMENT:
+ {
+ case_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case LOOP_STATEMENT:
+ {
+ loop_stmt(_t);
+ _t = _retTree;
+ id_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case BLOCK_STATEMENT:
+ {
+ block(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ASSIGNMENT_STATEMENT:
+ case CALL_STATEMENT:
+ {
+ call_or_assignment(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t347;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST def_label_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t350 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp221_AST_in = _t;
+ match(_t,LABEL_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp222_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t350;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST null_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp223_AST_in = _t;
+ match(_t,NULL_STATEMENT);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST exit_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t385 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp224_AST_in = _t;
+ match(_t,EXIT_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ label_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ case WHEN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case WHEN:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp225_AST_in = _t;
+ match(_t,WHEN);
+ _t = _t->getNextSibling();
+ condition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t385;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST return_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t390 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp226_AST_in = _t;
+ match(_t,RETURN_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t390;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST goto_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t393 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp227_AST_in = _t;
+ match(_t,GOTO_STATEMENT);
+ _t = _t->getFirstChild();
+ label_name(_t);
+ _t = _retTree;
+ _t = __t393;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST delay_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t412 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp228_AST_in = _t;
+ match(_t,DELAY_STATEMENT);
+ _t = _t->getFirstChild();
+ modifiers(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t412;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST abort_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t444 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp229_AST_in = _t;
+ match(_t,ABORT_STATEMENT);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt446=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_tokenSet_4.member(_t->getType()))) {
+ name(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt446>=1 ) { goto _loop446; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt446++;
+ }
+ _loop446:;
+ } // ( ... )+
+ _t = __t444;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST raise_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t460 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp230_AST_in = _t;
+ match(_t,RAISE_STATEMENT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t460;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST requeue_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t463 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp231_AST_in = _t;
+ match(_t,REQUEUE_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ABORT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp232_AST_in = _t;
+ match(_t,ABORT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t463;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST accept_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t407 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp233_AST_in = _t;
+ match(_t,ACCEPT_STATEMENT);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ entry_index_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ handled_stmts_opt(_t);
+ _t = _retTree;
+ end_id_opt(_t);
+ _t = _retTree;
+ _t = __t407;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST select_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASYNCHRONOUS_SELECT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t414 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp234_AST_in = _t;
+ match(_t,ASYNCHRONOUS_SELECT);
+ _t = _t->getFirstChild();
+ triggering_alternative(_t);
+ _t = _retTree;
+ abortable_part(_t);
+ _t = _retTree;
+ _t = __t414;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SELECTIVE_ACCEPT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t415 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp235_AST_in = _t;
+ match(_t,SELECTIVE_ACCEPT);
+ _t = _t->getFirstChild();
+ selective_accept(_t);
+ _t = _retTree;
+ _t = __t415;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIMED_ENTRY_CALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t416 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp236_AST_in = _t;
+ match(_t,TIMED_ENTRY_CALL);
+ _t = _t->getFirstChild();
+ entry_call_alternative(_t);
+ _t = _retTree;
+ delay_alternative(_t);
+ _t = _retTree;
+ _t = __t416;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CONDITIONAL_ENTRY_CALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t417 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp237_AST_in = _t;
+ match(_t,CONDITIONAL_ENTRY_CALL);
+ _t = _t->getFirstChild();
+ entry_call_alternative(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t417;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST if_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t354 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp238_AST_in = _t;
+ match(_t,IF_STATEMENT);
+ _t = _t->getFirstChild();
+ cond_clause(_t);
+ _t = _retTree;
+ elsifs_opt(_t);
+ _t = _retTree;
+ else_opt(_t);
+ _t = _retTree;
+ _t = __t354;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST case_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t366 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp239_AST_in = _t;
+ match(_t,CASE_STATEMENT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ alternative_s(_t);
+ _t = _retTree;
+ _t = __t366;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST loop_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t373 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp240_AST_in = _t;
+ match(_t,LOOP_STATEMENT);
+ _t = _t->getFirstChild();
+ iteration_scheme_opt(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t373;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::block(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST block_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t380 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp241_AST_in = _t;
+ match(_t,BLOCK_STATEMENT);
+ _t = _t->getFirstChild();
+ declare_opt(_t);
+ _t = _retTree;
+ block_body(_t);
+ _t = _retTree;
+ _t = __t380;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST call_or_assignment_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASSIGNMENT_STATEMENT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t395 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp242_AST_in = _t;
+ match(_t,ASSIGNMENT_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t395;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CALL_STATEMENT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t396 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp243_AST_in = _t;
+ match(_t,CALL_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ _t = __t396;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST cond_clause_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t356 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp244_AST_in = _t;
+ match(_t,COND_CLAUSE);
+ _t = _t->getFirstChild();
+ condition(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t356;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST elsifs_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t359 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp245_AST_in = _t;
+ match(_t,ELSIFS_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == COND_CLAUSE)) {
+ cond_clause(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop361;
+ }
+
+ }
+ _loop361:;
+ } // ( ... )*
+ _t = __t359;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST else_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t363 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp246_AST_in = _t;
+ match(_t,ELSE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SEQUENCE_OF_STATEMENTS:
+ {
+ statements(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t363;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST condition_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ expression(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST alternative_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt369=0;
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == CASE_STATEMENT_ALTERNATIVE)) {
+ case_statement_alternative(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt369>=1 ) { goto _loop369; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
+ }
+
+ _cnt369++;
+ }
+ _loop369:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST case_statement_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t371 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp247_AST_in = _t;
+ match(_t,CASE_STATEMENT_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ choice_s(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t371;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST iteration_scheme_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t375 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp248_AST_in = _t;
+ match(_t,ITERATION_SCHEME_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case WHILE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t377 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp249_AST_in = _t;
+ match(_t,WHILE);
+ _t = _t->getFirstChild();
+ condition(_t);
+ _t = _retTree;
+ _t = __t377;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FOR:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t378 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp250_AST_in = _t;
+ match(_t,FOR);
+ _t = _t->getFirstChild();
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp251_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ modifiers(_t);
+ _t = _retTree;
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ _t = __t378;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t375;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST declare_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t382 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp252_AST_in = _t;
+ match(_t,DECLARE_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DECLARATIVE_PART:
+ {
+ declarative_part(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t382;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST label_name_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp253_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_body_formal_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ entry_index_spec_opt(_t);
+ _t = _retTree;
+ formal_part_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_barrier_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ condition(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_spec_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t401 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp254_AST_in = _t;
+ match(_t,ENTRY_INDEX_SPECIFICATION);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ def_id(_t);
+ _t = _retTree;
+ discrete_subtype_definition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t401;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_stmt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t405 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp255_AST_in = _t;
+ match(_t,ENTRY_CALL_STATEMENT);
+ _t = _t->getFirstChild();
+ name(_t);
+ _t = _retTree;
+ _t = __t405;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_index_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t409 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp256_AST_in = _t;
+ match(_t,ENTRY_INDEX_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t409;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST triggering_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t419 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp257_AST_in = _t;
+ match(_t,TRIGGERING_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DELAY_STATEMENT:
+ {
+ delay_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ case ENTRY_CALL_STATEMENT:
+ {
+ entry_call_stmt(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t419;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST abortable_part_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t422 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp258_AST_in = _t;
+ match(_t,ABORTABLE_PART);
+ _t = _t->getFirstChild();
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t422;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST selective_accept_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ guard_opt(_t);
+ _t = _retTree;
+ select_alternative(_t);
+ _t = _retTree;
+ or_select_opt(_t);
+ _t = _retTree;
+ else_opt(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST entry_call_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t424 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp259_AST_in = _t;
+ match(_t,ENTRY_CALL_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ entry_call_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t424;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST delay_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t435 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp260_AST_in = _t;
+ match(_t,DELAY_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ delay_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t435;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST stmts_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PRAGMA:
+ {
+ pragma(_t);
+ _t = _retTree;
+ break;
+ }
+ case STATEMENT:
+ {
+ statement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ goto _loop438;
+ }
+ }
+ }
+ _loop438:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST guard_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t427 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp261_AST_in = _t;
+ match(_t,GUARD_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case IN:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case OR:
+ case AND:
+ case XOR:
+ case NOT:
+ case EQ:
+ case NE:
+ case LT_:
+ case LE:
+ case GT:
+ case GE:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case AND_THEN:
+ case NOT_IN:
+ case OR_ELSE:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ condition(_t);
+ _t = _retTree;
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == PRAGMA)) {
+ pragma(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop430;
+ }
+
+ }
+ _loop430:;
+ } // ( ... )*
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t427;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST select_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ACCEPT_ALTERNATIVE:
+ {
+ accept_alternative(_t);
+ _t = _retTree;
+ break;
+ }
+ case DELAY_ALTERNATIVE:
+ {
+ delay_alternative(_t);
+ _t = _retTree;
+ break;
+ }
+ case TERMINATE_ALTERNATIVE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp262_AST_in = _t;
+ match(_t,TERMINATE_ALTERNATIVE);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST or_select_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t440 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp263_AST_in = _t;
+ match(_t,OR_SELECT_OPT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ if ((_t->getType() == GUARD_OPT)) {
+ guard_opt(_t);
+ _t = _retTree;
+ select_alternative(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop442;
+ }
+
+ }
+ _loop442:;
+ } // ( ... )*
+ _t = __t440;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST accept_alternative_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t433 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp264_AST_in = _t;
+ match(_t,ACCEPT_ALTERNATIVE);
+ _t = _t->getFirstChild();
+ accept_stmt(_t);
+ _t = _retTree;
+ stmts_opt(_t);
+ _t = _retTree;
+ _t = __t433;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST exception_handler_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t452 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp265_AST_in = _t;
+ match(_t,EXCEPTION_HANDLER);
+ _t = _t->getFirstChild();
+ identifier_colon_opt(_t);
+ _t = _retTree;
+ except_choice_s(_t);
+ _t = _retTree;
+ statements(_t);
+ _t = _retTree;
+ _t = __t452;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST identifier_colon_opt_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t454 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp266_AST_in = _t;
+ match(_t,IDENTIFIER_COLON_OPT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp267_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t454;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST except_choice_s_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PIPE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t457 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp268_AST_in = _t;
+ match(_t,PIPE);
+ _t = _t->getFirstChild();
+ except_choice_s(_t);
+ _t = _retTree;
+ exception_choice(_t);
+ _t = _retTree;
+ _t = __t457;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case OTHERS:
+ {
+ exception_choice(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST exception_choice_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ {
+ compound_name(_t);
+ _t = _retTree;
+ break;
+ }
+ case OTHERS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp269_AST_in = _t;
+ match(_t,OTHERS);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST operator_call_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t466 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp270_AST_in = _t;
+ match(_t,OPERATOR_SYMBOL);
+ _t = _t->getFirstChild();
+ value_s(_t);
+ _t = _retTree;
+ _t = __t466;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST relation_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IN:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t478 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp271_AST_in = _t;
+ match(_t,IN);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ range_or_mark(_t);
+ _t = _retTree;
+ _t = __t478;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NOT_IN:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t479 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp272_AST_in = _t;
+ match(_t,NOT_IN);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ range_or_mark(_t);
+ _t = _retTree;
+ _t = __t479;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EQ:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t480 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp273_AST_in = _t;
+ match(_t,EQ);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t480;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t481 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp274_AST_in = _t;
+ match(_t,NE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t481;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LT_:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t482 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp275_AST_in = _t;
+ match(_t,LT_);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t482;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t483 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp276_AST_in = _t;
+ match(_t,LE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t483;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t484 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp277_AST_in = _t;
+ match(_t,GT);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t484;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GE:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t485 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp278_AST_in = _t;
+ match(_t,GE);
+ _t = _t->getFirstChild();
+ simple_expression(_t);
+ _t = _retTree;
+ simple_expression(_t);
+ _t = _retTree;
+ _t = __t485;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case PLUS:
+ case MINUS:
+ case CONCAT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ {
+ simple_expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST range_or_mark_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOT_DOT:
+ case RANGE_ATTRIBUTE_REFERENCE:
+ {
+ range(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ {
+ subtype_mark(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST signed_term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case UNARY_PLUS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t492 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp279_AST_in = _t;
+ match(_t,UNARY_PLUS);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ _t = __t492;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case UNARY_MINUS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t493 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp280_AST_in = _t;
+ match(_t,UNARY_MINUS);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ _t = __t493;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case MOD:
+ case NOT:
+ case STAR:
+ case DIV:
+ case REM:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ term(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::term(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST term_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case STAR:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t495 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp281_AST_in = _t;
+ match(_t,STAR);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t495;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIV:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t496 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp282_AST_in = _t;
+ match(_t,DIV);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t496;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MOD:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t497 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp283_AST_in = _t;
+ match(_t,MOD);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t497;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case REM:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t498 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp284_AST_in = _t;
+ match(_t,REM);
+ _t = _t->getFirstChild();
+ term(_t);
+ _t = _retTree;
+ factor(_t);
+ _t = _retTree;
+ _t = __t498;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NOT:
+ case ABS:
+ case EXPON:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ factor(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST factor_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t500 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp285_AST_in = _t;
+ match(_t,NOT);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ _t = __t500;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABS:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t501 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp286_AST_in = _t;
+ match(_t,ABS);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ _t = __t501;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EXPON:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t502 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp287_AST_in = _t;
+ match(_t,EXPON);
+ _t = _t->getFirstChild();
+ primary(_t);
+ _t = _retTree;
+ primary(_t);
+ _t = _retTree;
+ _t = __t502;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case CHARACTER_LITERAL:
+ case CHAR_STRING:
+ case NuLL:
+ case NUMERIC_LIT:
+ case ALLOCATOR:
+ case INDEXED_COMPONENT:
+ case OPERATOR_SYMBOL:
+ case PARENTHESIZED_PRIMARY:
+ {
+ primary(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST primary_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ case DOT:
+ case TIC:
+ case INDEXED_COMPONENT:
+ {
+ name_or_qualified(_t);
+ _t = _retTree;
+ break;
+ }
+ case PARENTHESIZED_PRIMARY:
+ {
+ parenthesized_primary(_t);
+ _t = _retTree;
+ break;
+ }
+ case ALLOCATOR:
+ {
+ allocator(_t);
+ _t = _retTree;
+ break;
+ }
+ case NuLL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp288_AST_in = _t;
+ match(_t,NuLL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUMERIC_LIT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp289_AST_in = _t;
+ match(_t,NUMERIC_LIT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp290_AST_in = _t;
+ match(_t,CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHAR_STRING:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp291_AST_in = _t;
+ match(_t,CHAR_STRING);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ operator_call(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST name_or_qualified_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp292_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t506 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp293_AST_in = _t;
+ match(_t,DOT);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ALL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp294_AST_in = _t;
+ match(_t,ALL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENTIFIER:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp295_AST_in = _t;
+ match(_t,IDENTIFIER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHARACTER_LITERAL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp296_AST_in = _t;
+ match(_t,CHARACTER_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OPERATOR_SYMBOL:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp297_AST_in = _t;
+ match(_t,OPERATOR_SYMBOL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t506;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEXED_COMPONENT:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t508 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp298_AST_in = _t;
+ match(_t,INDEXED_COMPONENT);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ value_s(_t);
+ _t = _retTree;
+ _t = __t508;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TIC:
+ {
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t509 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp299_AST_in = _t;
+ match(_t,TIC);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ {
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PARENTHESIZED_PRIMARY:
+ {
+ parenthesized_primary(_t);
+ _t = _retTree;
+ break;
+ }
+ case IDENTIFIER:
+ case RANGE:
+ case DIGITS:
+ case DELTA:
+ case ACCESS:
+ {
+ attribute_id(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ _t = __t509;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST allocator_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t512 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp300_AST_in = _t;
+ match(_t,ALLOCATOR);
+ _t = _t->getFirstChild();
+ name_or_qualified(_t);
+ _t = _retTree;
+ _t = __t512;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST subprogram_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROCEDURE_BODY:
+ {
+ procedure_body(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION_BODY:
+ {
+ function_body(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST package_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t518 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp301_AST_in = _t;
+ match(_t,PACKAGE_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ pkg_body_part(_t);
+ _t = _retTree;
+ _t = __t518;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST task_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t520 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp302_AST_in = _t;
+ match(_t,TASK_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ body_part(_t);
+ _t = _retTree;
+ _t = __t520;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
+ ANTLR_USE_NAMESPACE(antlr)RefAST protected_body_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
+
+ try { // for error handling
+ ANTLR_USE_NAMESPACE(antlr)RefAST __t522 = _t;
+ ANTLR_USE_NAMESPACE(antlr)RefAST tmp303_AST_in = _t;
+ match(_t,PROTECTED_BODY);
+ _t = _t->getFirstChild();
+ def_id(_t);
+ _t = _retTree;
+ prot_op_bodies_opt(_t);
+ _t = _retTree;
+ _t = __t522;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void AdaTreeParserSuper::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& )
+{
+}
+const char* AdaTreeParserSuper::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "\"pragma\"",
+ "IDENTIFIER",
+ "SEMI",
+ "LPAREN",
+ "COMMA",
+ "RPAREN",
+ "RIGHT_SHAFT",
+ "\"with\"",
+ "DOT",
+ "\"use\"",
+ "\"type\"",
+ "TIC",
+ "\"range\"",
+ "\"digits\"",
+ "\"delta\"",
+ "\"access\"",
+ "\"private\"",
+ "\"package\"",
+ "\"body\"",
+ "\"is\"",
+ "\"procedure\"",
+ "\"function\"",
+ "\"new\"",
+ "\"others\"",
+ "PIPE",
+ "DOT_DOT",
+ "\"all\"",
+ "COLON",
+ "\"in\"",
+ "\"out\"",
+ "\"renames\"",
+ "CHARACTER_LITERAL",
+ "CHAR_STRING",
+ "\"null\"",
+ "\"record\"",
+ "\"separate\"",
+ "\"abstract\"",
+ "\"return\"",
+ "\"task\"",
+ "\"protected\"",
+ "BOX",
+ "ASSIGN",
+ "\"entry\"",
+ "\"for\"",
+ "\"end\"",
+ "\"at\"",
+ "\"mod\"",
+ "\"subtype\"",
+ "\"exception\"",
+ "\"constant\"",
+ "\"array\"",
+ "\"of\"",
+ "\"aliased\"",
+ "\"case\"",
+ "\"when\"",
+ "\"tagged\"",
+ "\"limited\"",
+ "\"generic\"",
+ "\"begin\"",
+ "LT_LT",
+ "GT_GT",
+ "\"if\"",
+ "\"then\"",
+ "\"elsif\"",
+ "\"else\"",
+ "\"loop\"",
+ "\"while\"",
+ "\"reverse\"",
+ "\"declare\"",
+ "\"exit\"",
+ "\"goto\"",
+ "\"accept\"",
+ "\"do\"",
+ "\"delay\"",
+ "\"until\"",
+ "\"select\"",
+ "\"abort\"",
+ "\"or\"",
+ "\"terminate\"",
+ "\"raise\"",
+ "\"requeue\"",
+ "\"and\"",
+ "\"xor\"",
+ "\"not\"",
+ "EQ",
+ "NE",
+ "LT_",
+ "LE",
+ "GT",
+ "GE",
+ "PLUS",
+ "MINUS",
+ "CONCAT",
+ "STAR",
+ "DIV",
+ "\"rem\"",
+ "\"abs\"",
+ "EXPON",
+ "NUMERIC_LIT",
+ "ABORTABLE_PART",
+ "ABORT_STATEMENT",
+ "ACCEPT_ALTERNATIVE",
+ "ACCEPT_STATEMENT",
+ "ALLOCATOR",
+ "ASSIGNMENT_STATEMENT",
+ "ASYNCHRONOUS_SELECT",
+ "ATTRIBUTE_DEFINITION_CLAUSE",
+ "AT_CLAUSE",
+ "BLOCK_STATEMENT",
+ "CASE_STATEMENT",
+ "CASE_STATEMENT_ALTERNATIVE",
+ "CODE_STATEMENT",
+ "COMPONENT_DECLARATION",
+ "CONDITIONAL_ENTRY_CALL",
+ "CONTEXT_CLAUSE",
+ "DECLARATIVE_PART",
+ "DEFINING_IDENTIFIER_LIST",
+ "DELAY_ALTERNATIVE",
+ "DELAY_STATEMENT",
+ "DELTA_CONSTRAINT",
+ "DIGITS_CONSTRAINT",
+ "DISCRIMINANT_ASSOCIATION",
+ "DISCRIMINANT_CONSTRAINT",
+ "DISCRIMINANT_SPECIFICATION",
+ "ENTRY_BODY",
+ "ENTRY_CALL_ALTERNATIVE",
+ "ENTRY_CALL_STATEMENT",
+ "ENTRY_DECLARATION",
+ "ENTRY_INDEX_SPECIFICATION",
+ "ENUMERATION_REPESENTATION_CLAUSE",
+ "EXCEPTION_DECLARATION",
+ "EXCEPTION_HANDLER",
+ "EXCEPTION_RENAMING_DECLARATION",
+ "EXIT_STATEMENT",
+ "FORMAL_PACKAGE_DECLARATION",
+ "GENERIC_FORMAL_PART",
+ "GENERIC_PACKAGE_DECLARATION",
+ "GOTO_STATEMENT",
+ "HANDLED_SEQUENCE_OF_STATEMENTS",
+ "HANDLED_STMTS_OPT",
+ "IF_STATEMENT",
+ "INCOMPLETE_TYPE_DECLARATION",
+ "INDEXED_COMPONENT",
+ "INDEX_CONSTRAINT",
+ "LIBRARY_ITEM",
+ "LOOP_STATEMENT",
+ "NAME",
+ "NULL_STATEMENT",
+ "NUMBER_DECLARATION",
+ "OBJECT_DECLARATION",
+ "OBJECT_RENAMING_DECLARATION",
+ "OPERATOR_SYMBOL",
+ "PACKAGE_BODY",
+ "PACKAGE_BODY_STUB",
+ "PACKAGE_RENAMING_DECLARATION",
+ "PACKAGE_SPECIFICATION",
+ "PARAMETER_SPECIFICATION",
+ "PRIVATE_EXTENSION_DECLARATION",
+ "PRIVATE_TYPE_DECLARATION",
+ "PROTECTED_BODY",
+ "PROTECTED_BODY_STUB",
+ "PROTECTED_TYPE_DECLARATION",
+ "RAISE_STATEMENT",
+ "RANGE_ATTRIBUTE_REFERENCE",
+ "RECORD_REPRESENTATION_CLAUSE",
+ "REQUEUE_STATEMENT",
+ "RETURN_STATEMENT",
+ "SELECTIVE_ACCEPT",
+ "SEQUENCE_OF_STATEMENTS",
+ "SINGLE_PROTECTED_DECLARATION",
+ "SINGLE_TASK_DECLARATION",
+ "STATEMENT",
+ "SUBTYPE_DECLARATION",
+ "SUBTYPE_INDICATION",
+ "SUBTYPE_MARK",
+ "SUBUNIT",
+ "TASK_BODY",
+ "TASK_BODY_STUB",
+ "TASK_TYPE_DECLARATION",
+ "TERMINATE_ALTERNATIVE",
+ "TIMED_ENTRY_CALL",
+ "TRIGGERING_ALTERNATIVE",
+ "USE_CLAUSE",
+ "USE_TYPE_CLAUSE",
+ "VARIANT",
+ "VARIANT_PART",
+ "WITH_CLAUSE",
+ "ABSTRACT_FUNCTION_DECLARATION",
+ "ABSTRACT_PROCEDURE_DECLARATION",
+ "ACCESS_TO_FUNCTION_DECLARATION",
+ "ACCESS_TO_OBJECT_DECLARATION",
+ "ACCESS_TO_PROCEDURE_DECLARATION",
+ "ARRAY_OBJECT_DECLARATION",
+ "ARRAY_TYPE_DECLARATION",
+ "AND_THEN",
+ "BASIC_DECLARATIVE_ITEMS_OPT",
+ "BLOCK_BODY",
+ "BLOCK_BODY_OPT",
+ "CALL_STATEMENT",
+ "COMPONENT_CLAUSES_OPT",
+ "COMPONENT_ITEMS",
+ "COND_CLAUSE",
+ "DECIMAL_FIXED_POINT_DECLARATION",
+ "DECLARE_OPT",
+ "DERIVED_RECORD_EXTENSION",
+ "DISCRETE_SUBTYPE_DEF_OPT",
+ "DISCRIMINANT_SPECIFICATIONS",
+ "DISCRIM_PART_OPT",
+ "ELSE_OPT",
+ "ELSIFS_OPT",
+ "END_ID_OPT",
+ "ENTRY_INDEX_OPT",
+ "ENUMERATION_TYPE_DECLARATION",
+ "EXCEPT_HANDLER_PART_OPT",
+ "EXTENSION_OPT",
+ "FLOATING_POINT_DECLARATION",
+ "FORMAL_DECIMAL_FIXED_POINT_DECLARATION",
+ "FORMAL_DISCRETE_TYPE_DECLARATION",
+ "FORMAL_FLOATING_POINT_DECLARATION",
+ "FORMAL_FUNCTION_DECLARATION",
+ "FORMAL_MODULAR_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION",
+ "FORMAL_ORDINARY_FIXED_POINT_DECLARATION",
+ "FORMAL_PART_OPT",
+ "FORMAL_PRIVATE_EXTENSION_DECLARATION",
+ "FORMAL_PRIVATE_TYPE_DECLARATION",
+ "FORMAL_PROCEDURE_DECLARATION",
+ "FORMAL_SIGNED_INTEGER_TYPE_DECLARATION",
+ "FUNCTION_BODY",
+ "FUNCTION_BODY_STUB",
+ "FUNCTION_DECLARATION",
+ "FUNCTION_RENAMING_DECLARATION",
+ "GENERIC_FUNCTION_DECLARATION",
+ "GENERIC_FUNCTION_INSTANTIATION",
+ "GENERIC_FUNCTION_RENAMING",
+ "GENERIC_PACKAGE_INSTANTIATION",
+ "GENERIC_PACKAGE_RENAMING",
+ "GENERIC_PROCEDURE_DECLARATION",
+ "GENERIC_PROCEDURE_INSTANTIATION",
+ "GENERIC_PROCEDURE_RENAMING",
+ "GUARD_OPT",
+ "IDENTIFIER_COLON_OPT",
+ "ID_OPT",
+ "INIT_OPT",
+ "ITERATION_SCHEME_OPT",
+ "LABEL_OPT",
+ "MARK_WITH_CONSTRAINT",
+ "MODIFIERS",
+ "MODULAR_TYPE_DECLARATION",
+ "MOD_CLAUSE_OPT",
+ "NOT_IN",
+ "ORDINARY_DERIVED_TYPE_DECLARATION",
+ "ORDINARY_FIXED_POINT_DECLARATION",
+ "OR_ELSE",
+ "OR_SELECT_OPT",
+ "PARENTHESIZED_PRIMARY",
+ "PRIVATE_DECLARATIVE_ITEMS_OPT",
+ "PRIVATE_TASK_ITEMS_OPT",
+ "PROCEDURE_BODY",
+ "PROCEDURE_BODY_STUB",
+ "PROCEDURE_DECLARATION",
+ "PROCEDURE_RENAMING_DECLARATION",
+ "PROT_MEMBER_DECLARATIONS",
+ "PROT_OP_BODIES_OPT",
+ "PROT_OP_DECLARATIONS",
+ "PROT_PRIVATE_OPT",
+ "RANGED_EXPRS",
+ "RANGE_CONSTRAINT",
+ "RECORD_TYPE_DECLARATION",
+ "SELECTOR_NAMES_OPT",
+ "SIGNED_INTEGER_TYPE_DECLARATION",
+ "TASK_ITEMS_OPT",
+ "UNARY_MINUS",
+ "UNARY_PLUS",
+ "VALUE",
+ "VALUES",
+ "VARIANTS",
+ "COMMENT_INTRO",
+ "OX",
+ "TIC_OR_CHARACTER_LITERAL",
+ "DIGIT",
+ "EXPONENT",
+ "EXTENDED_DIGIT",
+ "BASED_INTEGER",
+ "WS_",
+ "COMMENT",
+ "CHARACTER_STRING",
+ 0
+};
+
+const unsigned long AdaTreeParserSuper::_tokenSet_0_data_[] = { 37920UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER RIGHT_SHAFT DOT TIC "in" CHARACTER_LITERAL CHAR_STRING "null"
+// "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS MINUS CONCAT STAR
+// DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT OPERATOR_SYMBOL
+// AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS UNARY_PLUS
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_0(_tokenSet_0_data_,20);
+const unsigned long AdaTreeParserSuper::_tokenSet_1_data_[] = { 939627552UL, 262201UL, 4293001216UL, 2175UL, 134479872UL, 0UL, 64UL, 1073741824UL, 3145738UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER RIGHT_SHAFT DOT TIC "range" "others" PIPE DOT_DOT "in" CHARACTER_LITERAL
+// CHAR_STRING "null" "mod" "or" "and" "xor" "not" EQ NE LT_ LE GT GE PLUS
+// MINUS CONCAT STAR DIV "rem" "abs" EXPON NUMERIC_LIT ALLOCATOR INDEXED_COMPONENT
+// OPERATOR_SYMBOL AND_THEN NOT_IN OR_ELSE PARENTHESIZED_PRIMARY UNARY_MINUS
+// UNARY_PLUS
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_1(_tokenSet_1_data_,20);
+const unsigned long AdaTreeParserSuper::_tokenSet_2_data_[] = { 0UL, 0UL, 0UL, 49152UL, 3338801504UL, 2353094950UL, 151076927UL, 2416967168UL, 328577UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENUMERATION_REPESENTATION_CLAUSE
+// EXCEPTION_DECLARATION EXCEPTION_RENAMING_DECLARATION GENERIC_PACKAGE_DECLARATION
+// INCOMPLETE_TYPE_DECLARATION NUMBER_DECLARATION OBJECT_DECLARATION OBJECT_RENAMING_DECLARATION
+// PACKAGE_RENAMING_DECLARATION PACKAGE_SPECIFICATION PRIVATE_EXTENSION_DECLARATION
+// PRIVATE_TYPE_DECLARATION PROTECTED_TYPE_DECLARATION RECORD_REPRESENTATION_CLAUSE
+// SINGLE_PROTECTED_DECLARATION SINGLE_TASK_DECLARATION SUBTYPE_DECLARATION
+// TASK_TYPE_DECLARATION USE_CLAUSE USE_TYPE_CLAUSE ABSTRACT_FUNCTION_DECLARATION
+// ABSTRACT_PROCEDURE_DECLARATION ACCESS_TO_FUNCTION_DECLARATION ACCESS_TO_OBJECT_DECLARATION
+// ACCESS_TO_PROCEDURE_DECLARATION ARRAY_OBJECT_DECLARATION ARRAY_TYPE_DECLARATION
+// DECIMAL_FIXED_POINT_DECLARATION DERIVED_RECORD_EXTENSION ENUMERATION_TYPE_DECLARATION
+// FLOATING_POINT_DECLARATION FUNCTION_BODY_STUB FUNCTION_DECLARATION FUNCTION_RENAMING_DECLARATION
+// GENERIC_FUNCTION_DECLARATION GENERIC_FUNCTION_INSTANTIATION GENERIC_FUNCTION_RENAMING
+// GENERIC_PACKAGE_INSTANTIATION GENERIC_PACKAGE_RENAMING GENERIC_PROCEDURE_DECLARATION
+// GENERIC_PROCEDURE_INSTANTIATION GENERIC_PROCEDURE_RENAMING MODULAR_TYPE_DECLARATION
+// ORDINARY_DERIVED_TYPE_DECLARATION ORDINARY_FIXED_POINT_DECLARATION PROCEDURE_BODY_STUB
+// PROCEDURE_DECLARATION PROCEDURE_RENAMING_DECLARATION RECORD_TYPE_DECLARATION
+// SIGNED_INTEGER_TYPE_DECLARATION
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_2(_tokenSet_2_data_,20);
+const unsigned long AdaTreeParserSuper::_tokenSet_3_data_[] = { 16UL, 0UL, 0UL, 49152UL, 40UL, 256UL, 0UL, 1024UL, 256UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "pragma" ATTRIBUTE_DEFINITION_CLAUSE AT_CLAUSE ENTRY_DECLARATION ENUMERATION_REPESENTATION_CLAUSE
+// RECORD_REPRESENTATION_CLAUSE FUNCTION_DECLARATION PROCEDURE_DECLARATION
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_3(_tokenSet_3_data_,20);
+const unsigned long AdaTreeParserSuper::_tokenSet_4_data_[] = { 36896UL, 0UL, 0UL, 0UL, 262144UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENTIFIER DOT TIC INDEXED_COMPONENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet AdaTreeParserSuper::_tokenSet_4(_tokenSet_4_data_,12);
+
+
diff --git a/languages/ada/AdaTreeParserSuper.hpp b/languages/ada/AdaTreeParserSuper.hpp
new file mode 100644
index 00000000..a4d164f0
--- /dev/null
+++ b/languages/ada/AdaTreeParserSuper.hpp
@@ -0,0 +1,241 @@
+#ifndef INC_AdaTreeParserSuper_hpp_
+#define INC_AdaTreeParserSuper_hpp_
+
+#include <antlr/config.hpp>
+#include "AdaTreeParserSuperTokenTypes.hpp"
+/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuper.hpp"$ */
+#include <antlr/TreeParser.hpp>
+
+class CUSTOM_API AdaTreeParserSuper : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public AdaTreeParserSuperTokenTypes
+{
+#line 1 "ada.tree.g"
+#line 13 "AdaTreeParserSuper.hpp"
+public:
+ AdaTreeParserSuper();
+ static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+ int getNumTokens() const
+ {
+ return AdaTreeParserSuper::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return AdaTreeParserSuper::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return AdaTreeParserSuper::tokenNames;
+ }
+ public: void compilation_unit(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void context_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void library_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subunit(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void pragma(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void pragma_arg(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void with_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void use_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void compound_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subtype_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void attribute_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void modifiers(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subprog_decl_or_rename_or_inst_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void def_id(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void pkg_body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void generic_inst(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void pkg_spec_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void renames(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void generic_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void def_designator(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void end_id_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subprog_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void function_tail(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void value_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void value(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void ranged_expr_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void ranged_expr(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void simple_expression(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range_dots(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range_attrib_ref(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prefix(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void parameter_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void defining_identifier_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void init_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void definable_operator_symbol(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void parenthesized_primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void extension_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void spec_decl_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void basic_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void private_declarative_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void basic_decl_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void task_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_type_or_single_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void decl_common(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discrim_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void task_definition_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void private_task_items_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discriminant_specifications(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discriminant_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entrydecls_repspecs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void rep_spec(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discrete_subtype_def_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discrete_subtype_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subtype_ind(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void align_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void comp_loc_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void local_enum_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void enumeration_aggregate(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void protected_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_private_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_member_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_op_decl_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_op_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void comp_decl(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void component_subtype_def(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void enum_id_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range_constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void id_and_discrim(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void record_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void array_type_definition(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void enumeration_literal_specification(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void index_or_discrete_range_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void index_or_discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void constraint_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void digits_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void delta_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void index_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discriminant_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discrete_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discriminant_association(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void selector_names_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void selector_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void component_list(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void component_items(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void variant_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discriminant_direct_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void variant_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void variant(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void discrete_with_range(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void mark_with_constraint(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void generic_formal_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void generic_formal_parameter(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void formal_array_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void formal_access_type_declaration(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void id_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subprogram_default_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void formal_package_actual_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void procedure_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void function_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void body_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void declarative_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void block_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void declarative_item(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void prot_op_bodies_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void block_body_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void handled_stmt_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subprog_decl_or_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void statements(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void except_handler_part_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void handled_stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void def_label_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void null_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void exit_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void return_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void goto_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void delay_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void abort_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void raise_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void requeue_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void accept_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void select_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void if_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void case_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void loop_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void block(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void call_or_assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void cond_clause(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void elsifs_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void else_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void condition(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void alternative_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void case_statement_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void iteration_scheme_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void declare_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void label_name(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_body_formal_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_barrier(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_index_spec_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_call_stmt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_index_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void triggering_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void abortable_part(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void selective_accept(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void entry_call_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void delay_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void stmts_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void guard_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void select_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void or_select_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void accept_alternative(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void exception_handler(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void identifier_colon_opt(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void except_choice_s(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void exception_choice(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void operator_call(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void relation(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void range_or_mark(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void signed_term(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void term(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void factor(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void primary(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void name_or_qualified(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void allocator(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void subprogram_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void package_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void task_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+ public: void protected_body(ANTLR_USE_NAMESPACE(antlr)RefAST _t);
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return returnAST;
+ }
+
+protected:
+ ANTLR_USE_NAMESPACE(antlr)RefAST returnAST;
+ ANTLR_USE_NAMESPACE(antlr)RefAST _retTree;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 291;
+#else
+ enum {
+ NUM_TOKENS = 291
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+};
+
+#endif /*INC_AdaTreeParserSuper_hpp_*/
diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.hpp b/languages/ada/AdaTreeParserSuperTokenTypes.hpp
new file mode 100644
index 00000000..924b7415
--- /dev/null
+++ b/languages/ada/AdaTreeParserSuperTokenTypes.hpp
@@ -0,0 +1,307 @@
+#ifndef INC_AdaTreeParserSuperTokenTypes_hpp_
+#define INC_AdaTreeParserSuperTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20070609): "ada.tree.g" -> "AdaTreeParserSuperTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API AdaTreeParserSuperTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ PRAGMA = 4,
+ IDENTIFIER = 5,
+ SEMI = 6,
+ LPAREN = 7,
+ COMMA = 8,
+ RPAREN = 9,
+ RIGHT_SHAFT = 10,
+ WITH = 11,
+ DOT = 12,
+ USE = 13,
+ TYPE = 14,
+ TIC = 15,
+ RANGE = 16,
+ DIGITS = 17,
+ DELTA = 18,
+ ACCESS = 19,
+ PRIVATE = 20,
+ PACKAGE = 21,
+ BODY = 22,
+ IS = 23,
+ PROCEDURE = 24,
+ FUNCTION = 25,
+ NEW = 26,
+ OTHERS = 27,
+ PIPE = 28,
+ DOT_DOT = 29,
+ ALL = 30,
+ COLON = 31,
+ IN = 32,
+ OUT = 33,
+ RENAMES = 34,
+ CHARACTER_LITERAL = 35,
+ CHAR_STRING = 36,
+ NuLL = 37,
+ RECORD = 38,
+ SEPARATE = 39,
+ ABSTRACT = 40,
+ RETURN = 41,
+ TASK = 42,
+ PROTECTED = 43,
+ BOX = 44,
+ ASSIGN = 45,
+ ENTRY = 46,
+ FOR = 47,
+ END = 48,
+ AT = 49,
+ MOD = 50,
+ SUBTYPE = 51,
+ EXCEPTION = 52,
+ CONSTANT = 53,
+ ARRAY = 54,
+ OF = 55,
+ ALIASED = 56,
+ CASE = 57,
+ WHEN = 58,
+ TAGGED = 59,
+ LIMITED = 60,
+ GENERIC = 61,
+ BEGIN = 62,
+ LT_LT = 63,
+ GT_GT = 64,
+ IF = 65,
+ THEN = 66,
+ ELSIF = 67,
+ ELSE = 68,
+ LOOP = 69,
+ WHILE = 70,
+ REVERSE = 71,
+ DECLARE = 72,
+ EXIT = 73,
+ GOTO = 74,
+ ACCEPT = 75,
+ DO = 76,
+ DELAY = 77,
+ UNTIL = 78,
+ SELECT = 79,
+ ABORT = 80,
+ OR = 81,
+ TERMINATE = 82,
+ RAISE = 83,
+ REQUEUE = 84,
+ AND = 85,
+ XOR = 86,
+ NOT = 87,
+ EQ = 88,
+ NE = 89,
+ LT_ = 90,
+ LE = 91,
+ GT = 92,
+ GE = 93,
+ PLUS = 94,
+ MINUS = 95,
+ CONCAT = 96,
+ STAR = 97,
+ DIV = 98,
+ REM = 99,
+ ABS = 100,
+ EXPON = 101,
+ NUMERIC_LIT = 102,
+ ABORTABLE_PART = 103,
+ ABORT_STATEMENT = 104,
+ ACCEPT_ALTERNATIVE = 105,
+ ACCEPT_STATEMENT = 106,
+ ALLOCATOR = 107,
+ ASSIGNMENT_STATEMENT = 108,
+ ASYNCHRONOUS_SELECT = 109,
+ ATTRIBUTE_DEFINITION_CLAUSE = 110,
+ AT_CLAUSE = 111,
+ BLOCK_STATEMENT = 112,
+ CASE_STATEMENT = 113,
+ CASE_STATEMENT_ALTERNATIVE = 114,
+ CODE_STATEMENT = 115,
+ COMPONENT_DECLARATION = 116,
+ CONDITIONAL_ENTRY_CALL = 117,
+ CONTEXT_CLAUSE = 118,
+ DECLARATIVE_PART = 119,
+ DEFINING_IDENTIFIER_LIST = 120,
+ DELAY_ALTERNATIVE = 121,
+ DELAY_STATEMENT = 122,
+ DELTA_CONSTRAINT = 123,
+ DIGITS_CONSTRAINT = 124,
+ DISCRIMINANT_ASSOCIATION = 125,
+ DISCRIMINANT_CONSTRAINT = 126,
+ DISCRIMINANT_SPECIFICATION = 127,
+ ENTRY_BODY = 128,
+ ENTRY_CALL_ALTERNATIVE = 129,
+ ENTRY_CALL_STATEMENT = 130,
+ ENTRY_DECLARATION = 131,
+ ENTRY_INDEX_SPECIFICATION = 132,
+ ENUMERATION_REPESENTATION_CLAUSE = 133,
+ EXCEPTION_DECLARATION = 134,
+ EXCEPTION_HANDLER = 135,
+ EXCEPTION_RENAMING_DECLARATION = 136,
+ EXIT_STATEMENT = 137,
+ FORMAL_PACKAGE_DECLARATION = 138,
+ GENERIC_FORMAL_PART = 139,
+ GENERIC_PACKAGE_DECLARATION = 140,
+ GOTO_STATEMENT = 141,
+ HANDLED_SEQUENCE_OF_STATEMENTS = 142,
+ HANDLED_STMTS_OPT = 143,
+ IF_STATEMENT = 144,
+ INCOMPLETE_TYPE_DECLARATION = 145,
+ INDEXED_COMPONENT = 146,
+ INDEX_CONSTRAINT = 147,
+ LIBRARY_ITEM = 148,
+ LOOP_STATEMENT = 149,
+ NAME = 150,
+ NULL_STATEMENT = 151,
+ NUMBER_DECLARATION = 152,
+ OBJECT_DECLARATION = 153,
+ OBJECT_RENAMING_DECLARATION = 154,
+ OPERATOR_SYMBOL = 155,
+ PACKAGE_BODY = 156,
+ PACKAGE_BODY_STUB = 157,
+ PACKAGE_RENAMING_DECLARATION = 158,
+ PACKAGE_SPECIFICATION = 159,
+ PARAMETER_SPECIFICATION = 160,
+ PRIVATE_EXTENSION_DECLARATION = 161,
+ PRIVATE_TYPE_DECLARATION = 162,
+ PROTECTED_BODY = 163,
+ PROTECTED_BODY_STUB = 164,
+ PROTECTED_TYPE_DECLARATION = 165,
+ RAISE_STATEMENT = 166,
+ RANGE_ATTRIBUTE_REFERENCE = 167,
+ RECORD_REPRESENTATION_CLAUSE = 168,
+ REQUEUE_STATEMENT = 169,
+ RETURN_STATEMENT = 170,
+ SELECTIVE_ACCEPT = 171,
+ SEQUENCE_OF_STATEMENTS = 172,
+ SINGLE_PROTECTED_DECLARATION = 173,
+ SINGLE_TASK_DECLARATION = 174,
+ STATEMENT = 175,
+ SUBTYPE_DECLARATION = 176,
+ SUBTYPE_INDICATION = 177,
+ SUBTYPE_MARK = 178,
+ SUBUNIT = 179,
+ TASK_BODY = 180,
+ TASK_BODY_STUB = 181,
+ TASK_TYPE_DECLARATION = 182,
+ TERMINATE_ALTERNATIVE = 183,
+ TIMED_ENTRY_CALL = 184,
+ TRIGGERING_ALTERNATIVE = 185,
+ USE_CLAUSE = 186,
+ USE_TYPE_CLAUSE = 187,
+ VARIANT = 188,
+ VARIANT_PART = 189,
+ WITH_CLAUSE = 190,
+ ABSTRACT_FUNCTION_DECLARATION = 191,
+ ABSTRACT_PROCEDURE_DECLARATION = 192,
+ ACCESS_TO_FUNCTION_DECLARATION = 193,
+ ACCESS_TO_OBJECT_DECLARATION = 194,
+ ACCESS_TO_PROCEDURE_DECLARATION = 195,
+ ARRAY_OBJECT_DECLARATION = 196,
+ ARRAY_TYPE_DECLARATION = 197,
+ AND_THEN = 198,
+ BASIC_DECLARATIVE_ITEMS_OPT = 199,
+ BLOCK_BODY = 200,
+ BLOCK_BODY_OPT = 201,
+ CALL_STATEMENT = 202,
+ COMPONENT_CLAUSES_OPT = 203,
+ COMPONENT_ITEMS = 204,
+ COND_CLAUSE = 205,
+ DECIMAL_FIXED_POINT_DECLARATION = 206,
+ DECLARE_OPT = 207,
+ DERIVED_RECORD_EXTENSION = 208,
+ DISCRETE_SUBTYPE_DEF_OPT = 209,
+ DISCRIMINANT_SPECIFICATIONS = 210,
+ DISCRIM_PART_OPT = 211,
+ ELSE_OPT = 212,
+ ELSIFS_OPT = 213,
+ END_ID_OPT = 214,
+ ENTRY_INDEX_OPT = 215,
+ ENUMERATION_TYPE_DECLARATION = 216,
+ EXCEPT_HANDLER_PART_OPT = 217,
+ EXTENSION_OPT = 218,
+ FLOATING_POINT_DECLARATION = 219,
+ FORMAL_DECIMAL_FIXED_POINT_DECLARATION = 220,
+ FORMAL_DISCRETE_TYPE_DECLARATION = 221,
+ FORMAL_FLOATING_POINT_DECLARATION = 222,
+ FORMAL_FUNCTION_DECLARATION = 223,
+ FORMAL_MODULAR_TYPE_DECLARATION = 224,
+ FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION = 225,
+ FORMAL_ORDINARY_FIXED_POINT_DECLARATION = 226,
+ FORMAL_PART_OPT = 227,
+ FORMAL_PRIVATE_EXTENSION_DECLARATION = 228,
+ FORMAL_PRIVATE_TYPE_DECLARATION = 229,
+ FORMAL_PROCEDURE_DECLARATION = 230,
+ FORMAL_SIGNED_INTEGER_TYPE_DECLARATION = 231,
+ FUNCTION_BODY = 232,
+ FUNCTION_BODY_STUB = 233,
+ FUNCTION_DECLARATION = 234,
+ FUNCTION_RENAMING_DECLARATION = 235,
+ GENERIC_FUNCTION_DECLARATION = 236,
+ GENERIC_FUNCTION_INSTANTIATION = 237,
+ GENERIC_FUNCTION_RENAMING = 238,
+ GENERIC_PACKAGE_INSTANTIATION = 239,
+ GENERIC_PACKAGE_RENAMING = 240,
+ GENERIC_PROCEDURE_DECLARATION = 241,
+ GENERIC_PROCEDURE_INSTANTIATION = 242,
+ GENERIC_PROCEDURE_RENAMING = 243,
+ GUARD_OPT = 244,
+ IDENTIFIER_COLON_OPT = 245,
+ ID_OPT = 246,
+ INIT_OPT = 247,
+ ITERATION_SCHEME_OPT = 248,
+ LABEL_OPT = 249,
+ MARK_WITH_CONSTRAINT = 250,
+ MODIFIERS = 251,
+ MODULAR_TYPE_DECLARATION = 252,
+ MOD_CLAUSE_OPT = 253,
+ NOT_IN = 254,
+ ORDINARY_DERIVED_TYPE_DECLARATION = 255,
+ ORDINARY_FIXED_POINT_DECLARATION = 256,
+ OR_ELSE = 257,
+ OR_SELECT_OPT = 258,
+ PARENTHESIZED_PRIMARY = 259,
+ PRIVATE_DECLARATIVE_ITEMS_OPT = 260,
+ PRIVATE_TASK_ITEMS_OPT = 261,
+ PROCEDURE_BODY = 262,
+ PROCEDURE_BODY_STUB = 263,
+ PROCEDURE_DECLARATION = 264,
+ PROCEDURE_RENAMING_DECLARATION = 265,
+ PROT_MEMBER_DECLARATIONS = 266,
+ PROT_OP_BODIES_OPT = 267,
+ PROT_OP_DECLARATIONS = 268,
+ PROT_PRIVATE_OPT = 269,
+ RANGED_EXPRS = 270,
+ RANGE_CONSTRAINT = 271,
+ RECORD_TYPE_DECLARATION = 272,
+ SELECTOR_NAMES_OPT = 273,
+ SIGNED_INTEGER_TYPE_DECLARATION = 274,
+ TASK_ITEMS_OPT = 275,
+ UNARY_MINUS = 276,
+ UNARY_PLUS = 277,
+ VALUE = 278,
+ VALUES = 279,
+ VARIANTS = 280,
+ COMMENT_INTRO = 281,
+ OX = 282,
+ TIC_OR_CHARACTER_LITERAL = 283,
+ DIGIT = 284,
+ EXPONENT = 285,
+ EXTENDED_DIGIT = 286,
+ BASED_INTEGER = 287,
+ WS_ = 288,
+ COMMENT = 289,
+ CHARACTER_STRING = 290,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_AdaTreeParserSuperTokenTypes_hpp_*/
diff --git a/languages/ada/AdaTreeParserSuperTokenTypes.txt b/languages/ada/AdaTreeParserSuperTokenTypes.txt
new file mode 100644
index 00000000..dfd0b0df
--- /dev/null
+++ b/languages/ada/AdaTreeParserSuperTokenTypes.txt
@@ -0,0 +1,289 @@
+// $ANTLR 2.7.7 (20070609): ada.tree.g -> AdaTreeParserSuperTokenTypes.txt$
+AdaTreeParserSuper // output token vocab name
+PRAGMA="pragma"=4
+IDENTIFIER=5
+SEMI=6
+LPAREN=7
+COMMA=8
+RPAREN=9
+RIGHT_SHAFT=10
+WITH="with"=11
+DOT=12
+USE="use"=13
+TYPE="type"=14
+TIC=15
+RANGE="range"=16
+DIGITS="digits"=17
+DELTA="delta"=18
+ACCESS="access"=19
+PRIVATE="private"=20
+PACKAGE="package"=21
+BODY="body"=22
+IS="is"=23
+PROCEDURE="procedure"=24
+FUNCTION="function"=25
+NEW="new"=26
+OTHERS="others"=27
+PIPE=28
+DOT_DOT=29
+ALL="all"=30
+COLON=31
+IN="in"=32
+OUT="out"=33
+RENAMES="renames"=34
+CHARACTER_LITERAL=35
+CHAR_STRING=36
+NuLL="null"=37
+RECORD="record"=38
+SEPARATE="separate"=39
+ABSTRACT="abstract"=40
+RETURN="return"=41
+TASK="task"=42
+PROTECTED="protected"=43
+BOX=44
+ASSIGN=45
+ENTRY="entry"=46
+FOR="for"=47
+END="end"=48
+AT="at"=49
+MOD="mod"=50
+SUBTYPE="subtype"=51
+EXCEPTION="exception"=52
+CONSTANT="constant"=53
+ARRAY="array"=54
+OF="of"=55
+ALIASED="aliased"=56
+CASE="case"=57
+WHEN="when"=58
+TAGGED="tagged"=59
+LIMITED="limited"=60
+GENERIC="generic"=61
+BEGIN="begin"=62
+LT_LT=63
+GT_GT=64
+IF="if"=65
+THEN="then"=66
+ELSIF="elsif"=67
+ELSE="else"=68
+LOOP="loop"=69
+WHILE="while"=70
+REVERSE="reverse"=71
+DECLARE="declare"=72
+EXIT="exit"=73
+GOTO="goto"=74
+ACCEPT="accept"=75
+DO="do"=76
+DELAY="delay"=77
+UNTIL="until"=78
+SELECT="select"=79
+ABORT="abort"=80
+OR="or"=81
+TERMINATE="terminate"=82
+RAISE="raise"=83
+REQUEUE="requeue"=84
+AND="and"=85
+XOR="xor"=86
+NOT="not"=87
+EQ=88
+NE=89
+LT_=90
+LE=91
+GT=92
+GE=93
+PLUS=94
+MINUS=95
+CONCAT=96
+STAR=97
+DIV=98
+REM="rem"=99
+ABS="abs"=100
+EXPON=101
+NUMERIC_LIT=102
+ABORTABLE_PART=103
+ABORT_STATEMENT=104
+ACCEPT_ALTERNATIVE=105
+ACCEPT_STATEMENT=106
+ALLOCATOR=107
+ASSIGNMENT_STATEMENT=108
+ASYNCHRONOUS_SELECT=109
+ATTRIBUTE_DEFINITION_CLAUSE=110
+AT_CLAUSE=111
+BLOCK_STATEMENT=112
+CASE_STATEMENT=113
+CASE_STATEMENT_ALTERNATIVE=114
+CODE_STATEMENT=115
+COMPONENT_DECLARATION=116
+CONDITIONAL_ENTRY_CALL=117
+CONTEXT_CLAUSE=118
+DECLARATIVE_PART=119
+DEFINING_IDENTIFIER_LIST=120
+DELAY_ALTERNATIVE=121
+DELAY_STATEMENT=122
+DELTA_CONSTRAINT=123
+DIGITS_CONSTRAINT=124
+DISCRIMINANT_ASSOCIATION=125
+DISCRIMINANT_CONSTRAINT=126
+DISCRIMINANT_SPECIFICATION=127
+ENTRY_BODY=128
+ENTRY_CALL_ALTERNATIVE=129
+ENTRY_CALL_STATEMENT=130
+ENTRY_DECLARATION=131
+ENTRY_INDEX_SPECIFICATION=132
+ENUMERATION_REPESENTATION_CLAUSE=133
+EXCEPTION_DECLARATION=134
+EXCEPTION_HANDLER=135
+EXCEPTION_RENAMING_DECLARATION=136
+EXIT_STATEMENT=137
+FORMAL_PACKAGE_DECLARATION=138
+GENERIC_FORMAL_PART=139
+GENERIC_PACKAGE_DECLARATION=140
+GOTO_STATEMENT=141
+HANDLED_SEQUENCE_OF_STATEMENTS=142
+HANDLED_STMTS_OPT=143
+IF_STATEMENT=144
+INCOMPLETE_TYPE_DECLARATION=145
+INDEXED_COMPONENT=146
+INDEX_CONSTRAINT=147
+LIBRARY_ITEM=148
+LOOP_STATEMENT=149
+NAME=150
+NULL_STATEMENT=151
+NUMBER_DECLARATION=152
+OBJECT_DECLARATION=153
+OBJECT_RENAMING_DECLARATION=154
+OPERATOR_SYMBOL=155
+PACKAGE_BODY=156
+PACKAGE_BODY_STUB=157
+PACKAGE_RENAMING_DECLARATION=158
+PACKAGE_SPECIFICATION=159
+PARAMETER_SPECIFICATION=160
+PRIVATE_EXTENSION_DECLARATION=161
+PRIVATE_TYPE_DECLARATION=162
+PROTECTED_BODY=163
+PROTECTED_BODY_STUB=164
+PROTECTED_TYPE_DECLARATION=165
+RAISE_STATEMENT=166
+RANGE_ATTRIBUTE_REFERENCE=167
+RECORD_REPRESENTATION_CLAUSE=168
+REQUEUE_STATEMENT=169
+RETURN_STATEMENT=170
+SELECTIVE_ACCEPT=171
+SEQUENCE_OF_STATEMENTS=172
+SINGLE_PROTECTED_DECLARATION=173
+SINGLE_TASK_DECLARATION=174
+STATEMENT=175
+SUBTYPE_DECLARATION=176
+SUBTYPE_INDICATION=177
+SUBTYPE_MARK=178
+SUBUNIT=179
+TASK_BODY=180
+TASK_BODY_STUB=181
+TASK_TYPE_DECLARATION=182
+TERMINATE_ALTERNATIVE=183
+TIMED_ENTRY_CALL=184
+TRIGGERING_ALTERNATIVE=185
+USE_CLAUSE=186
+USE_TYPE_CLAUSE=187
+VARIANT=188
+VARIANT_PART=189
+WITH_CLAUSE=190
+ABSTRACT_FUNCTION_DECLARATION=191
+ABSTRACT_PROCEDURE_DECLARATION=192
+ACCESS_TO_FUNCTION_DECLARATION=193
+ACCESS_TO_OBJECT_DECLARATION=194
+ACCESS_TO_PROCEDURE_DECLARATION=195
+ARRAY_OBJECT_DECLARATION=196
+ARRAY_TYPE_DECLARATION=197
+AND_THEN=198
+BASIC_DECLARATIVE_ITEMS_OPT=199
+BLOCK_BODY=200
+BLOCK_BODY_OPT=201
+CALL_STATEMENT=202
+COMPONENT_CLAUSES_OPT=203
+COMPONENT_ITEMS=204
+COND_CLAUSE=205
+DECIMAL_FIXED_POINT_DECLARATION=206
+DECLARE_OPT=207
+DERIVED_RECORD_EXTENSION=208
+DISCRETE_SUBTYPE_DEF_OPT=209
+DISCRIMINANT_SPECIFICATIONS=210
+DISCRIM_PART_OPT=211
+ELSE_OPT=212
+ELSIFS_OPT=213
+END_ID_OPT=214
+ENTRY_INDEX_OPT=215
+ENUMERATION_TYPE_DECLARATION=216
+EXCEPT_HANDLER_PART_OPT=217
+EXTENSION_OPT=218
+FLOATING_POINT_DECLARATION=219
+FORMAL_DECIMAL_FIXED_POINT_DECLARATION=220
+FORMAL_DISCRETE_TYPE_DECLARATION=221
+FORMAL_FLOATING_POINT_DECLARATION=222
+FORMAL_FUNCTION_DECLARATION=223
+FORMAL_MODULAR_TYPE_DECLARATION=224
+FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION=225
+FORMAL_ORDINARY_FIXED_POINT_DECLARATION=226
+FORMAL_PART_OPT=227
+FORMAL_PRIVATE_EXTENSION_DECLARATION=228
+FORMAL_PRIVATE_TYPE_DECLARATION=229
+FORMAL_PROCEDURE_DECLARATION=230
+FORMAL_SIGNED_INTEGER_TYPE_DECLARATION=231
+FUNCTION_BODY=232
+FUNCTION_BODY_STUB=233
+FUNCTION_DECLARATION=234
+FUNCTION_RENAMING_DECLARATION=235
+GENERIC_FUNCTION_DECLARATION=236
+GENERIC_FUNCTION_INSTANTIATION=237
+GENERIC_FUNCTION_RENAMING=238
+GENERIC_PACKAGE_INSTANTIATION=239
+GENERIC_PACKAGE_RENAMING=240
+GENERIC_PROCEDURE_DECLARATION=241
+GENERIC_PROCEDURE_INSTANTIATION=242
+GENERIC_PROCEDURE_RENAMING=243
+GUARD_OPT=244
+IDENTIFIER_COLON_OPT=245
+ID_OPT=246
+INIT_OPT=247
+ITERATION_SCHEME_OPT=248
+LABEL_OPT=249
+MARK_WITH_CONSTRAINT=250
+MODIFIERS=251
+MODULAR_TYPE_DECLARATION=252
+MOD_CLAUSE_OPT=253
+NOT_IN=254
+ORDINARY_DERIVED_TYPE_DECLARATION=255
+ORDINARY_FIXED_POINT_DECLARATION=256
+OR_ELSE=257
+OR_SELECT_OPT=258
+PARENTHESIZED_PRIMARY=259
+PRIVATE_DECLARATIVE_ITEMS_OPT=260
+PRIVATE_TASK_ITEMS_OPT=261
+PROCEDURE_BODY=262
+PROCEDURE_BODY_STUB=263
+PROCEDURE_DECLARATION=264
+PROCEDURE_RENAMING_DECLARATION=265
+PROT_MEMBER_DECLARATIONS=266
+PROT_OP_BODIES_OPT=267
+PROT_OP_DECLARATIONS=268
+PROT_PRIVATE_OPT=269
+RANGED_EXPRS=270
+RANGE_CONSTRAINT=271
+RECORD_TYPE_DECLARATION=272
+SELECTOR_NAMES_OPT=273
+SIGNED_INTEGER_TYPE_DECLARATION=274
+TASK_ITEMS_OPT=275
+UNARY_MINUS=276
+UNARY_PLUS=277
+VALUE=278
+VALUES=279
+VARIANTS=280
+COMMENT_INTRO=281
+OX=282
+TIC_OR_CHARACTER_LITERAL=283
+DIGIT=284
+EXPONENT=285
+EXTENDED_DIGIT=286
+BASED_INTEGER=287
+WS_=288
+COMMENT=289
+CHARACTER_STRING=290
diff --git a/languages/ada/Makefile.am b/languages/ada/Makefile.am
new file mode 100644
index 00000000..4a7eb0c1
--- /dev/null
+++ b/languages/ada/Makefile.am
@@ -0,0 +1,41 @@
+# Here resides the Ada support part.
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+INCLUDES = -I$(top_srcdir)/lib/antlr -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = app_templates file_templates doc
+
+
+kde_module_LTLIBRARIES = libkdevadasupport.la
+libkdevadasupport_la_LDFLAGS = $(LEXLIB) $(all_libraries) $(KDE_PLUGIN)
+libkdevadasupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/antlr/src/libantlr.la
+
+libkdevadasupport_la_SOURCES = adasupportpart.cpp problemreporter.cpp backgroundparser.cpp addclassdlg.ui addclass.cpp configproblemreporter.ui ada_utils.cpp adasupport.cpp AdaLexer.cpp AdaParser.cpp AdaTreeParserSuper.cpp AdaStoreWalker.cpp
+
+METASOURCES = AUTO
+
+EXTRA_DIST = ada.g ada.tree.g ada.store.g
+
+## The following three rules assume that you have Java installed,
+## ANTLR installed, and you have the antlr jar in your CLASSPATH.
+
+#AdaLexer.hpp AdaLexer.cpp AdaParser.hpp AdaParser.cpp: ada.g
+# antlr ada.g
+
+#AdaTreeParserSuper.hpp AdaTreeParserSuper.cpp: ada.tree.g
+# antlr ada.tree.g
+
+#AdaStoreWalker.hpp AdaStoreWalker.cpp: ada.store.g
+# antlr -glib ada.tree.g ada.store.g
+
+genparser:
+ antlr ada.g && antlr ada.tree.g && antlr -glib ada.tree.g ada.store.g
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevadasupport.desktop
+
+rcdir = $(kde_datadir)/kdevadasupport
+rc_DATA = kdevadasupport.rc
+
+KDE_OPTIONS = nofinal
diff --git a/languages/ada/README b/languages/ada/README
new file mode 100644
index 00000000..0146b60f
--- /dev/null
+++ b/languages/ada/README
@@ -0,0 +1 @@
+Please read the README.dox file. \ No newline at end of file
diff --git a/languages/ada/README.dox b/languages/ada/README.dox
new file mode 100644
index 00000000..e71e6d45
--- /dev/null
+++ b/languages/ada/README.dox
@@ -0,0 +1,31 @@
+/** \class AdaSupportPart
+Ada Language Support
+
+The ANTLR Ada core support files are:
+ - ada.g -- contains AdaLexer and AdaParser, requires AdaAST.hpp and adasupport.cpp
+ - ada.tree.g -- contains the AdaTreeParserSuper
+ - AdaAST.hpp -- definition of the AST node used by ada.g
+ - adasupport.hpp -- general purpose utilities
+ - adasupport.cpp -- implementation of general purpose utilities and implementation of AdaParser class methods from ada.g
+
+These are ANTLR master files.
+They only depend on the ANTLR C++ runtime support and on the C++ STL.
+They should be kept free of all other dependencies.
+In particular, they do not depend on Kdevelop, KDE, or Qt.
+
+In order to generate the parser by hand, antlr v2.7.2 is required.
+There are parser compilation errors with some gcc versions. To avoid
+them, replace file antlr/CppCodeGenerator.java in the antlr source code tree
+with the one from <a href="ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz">ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz</a>.
+
+\unmaintained This part is currently un-maintained.
+
+\authors <a href="mailto:okellogg AT users.sourceforge.net">Oliver Kellogg</a>
+\authors <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\requirement Ada compiler
+
+*/
diff --git a/languages/ada/ada.g b/languages/ada/ada.g
new file mode 100644
index 00000000..5f97952b
--- /dev/null
+++ b/languages/ada/ada.g
@@ -0,0 +1,1982 @@
+/*
+ * Ada95 Grammar for ANTLR, target language C++
+ *
+ * Copyright (C) 2003 Oliver M. Kellogg <okellogg@users.sourceforge.net>
+ * Modifications (C) 2005 Daniel Zuberbuehler <dzubi@users.sourceforge.net>
+ *
+ * Adapted from lexer9x.l/grammar9x.y,
+ *
+ ******* A YACC grammar for Ada 9X *********************************
+ * Copyright (C) Intermetrics, Inc. 1994 Cambridge, MA USA *
+ * Copying permitted if accompanied by this statement. *
+ * Derivative works are permitted if accompanied by this statement.*
+ * This grammar is thought to be correct as of May 1, 1994 *
+ * but as usual there is *no warranty* to that effect. *
+ *******************************************************************
+ *
+ * $Id$
+ *
+ * Not all rules from the Ada95 Reference Manual (RM) Annex P,
+ * Syntax Summary, are mirrored as rules here.
+ * The tree nodes follow the RM grammar as closely as sensible.
+ * This applies in particular to the terminals. OTOH, trivially
+ * reconstructable non-terminal rules are not reflected in the tree.
+ * FIXME: Document the exact rationale of the tree design.
+ *
+ */
+
+
+header "pre_include_hpp" {
+#include <antlr/SemanticException.hpp> // antlr wants this
+#include "AdaAST.hpp"
+#include "preambles.h"
+}
+
+options {
+ language="Cpp";
+}
+
+//-----------------------------------------------------------------------------
+// Define a Parser, calling it AdaParser
+//-----------------------------------------------------------------------------
+class AdaParser extends Parser;
+options {
+ k = 2; // token lookahead
+ exportVocab=Ada; // Call its vocabulary "Ada"
+ // codeGenMakeSwitchThreshold = 2; // Some optimizations
+ // codeGenBitsetTestThreshold = 3;
+ defaultErrorHandler = false; // Generate parser error handlers
+ buildAST = true;
+ ASTLabelType = "RefAdaAST";
+}
+
+{
+ ANTLR_PARSER_PREAMBLE
+
+public:
+ // Ada support stuff
+ void push_def_id (const RefAdaAST& defid);
+ const RefAdaAST& pop_def_id ();
+ bool end_id_matches_def_id (const RefAdaAST& endid);
+ bool definable_operator (const char *string); // operator_symbol sans "/="
+ bool is_operator_symbol (const char *string);
+}
+
+// Compilation Unit: This is the start rule for this parser.
+// The rules in this grammar are listed in the order in which
+// compilation_unit introduces them, depth first, with the
+// exception of the expression related rules which are listed
+// towards the end.
+compilation_unit
+ : context_items_opt ( library_item | subunit ) ( pragma )*
+ ;
+
+// The pragma related rules are pulled up here to get them out of the way.
+
+pragma : PRAGMA^ IDENTIFIER pragma_args_opt SEMI!
+ ;
+
+pragma_args_opt : ( LPAREN! pragma_arg ( COMMA! pragma_arg )* RPAREN! )?
+ ;
+
+pragma_arg : ( IDENTIFIER RIGHT_SHAFT^ )? expression
+ ;
+
+context_items_opt : ( pragma | with_clause | use_clause )*
+ { #context_items_opt =
+ #(#[CONTEXT_CLAUSE, "CONTEXT_CLAUSE"], #context_items_opt); }
+ // RM Annex P neglects pragmas; we include them.
+ // The node should really be named CONTEXT_ITEMS_OPT but we
+ // stick with the RM wording.
+ ;
+
+with_clause : w:WITH^ c_name_list SEMI!
+ { Set(#w, WITH_CLAUSE); }
+ ;
+
+c_name_list : compound_name ( COMMA! compound_name )*
+ ;
+
+compound_name : IDENTIFIER ( DOT^ IDENTIFIER )*
+ // Strangely, the RM never defines this rule, which however is
+ // required for tightening up the syntax of certain names
+ // (library unit names etc.)
+ ;
+
+use_clause : u:USE^
+ ( TYPE! subtype_mark ( COMMA! subtype_mark )*
+ { Set(#u, USE_TYPE_CLAUSE); }
+ | c_name_list { Set(#u, USE_CLAUSE); }
+ )
+ SEMI!
+ ;
+
+subtype_mark : compound_name ( TIC^ attribute_id )?
+ // { #subtype_mark = #(#[SUBTYPE_MARK, "SUBTYPE_MARK"], #subtype_mark); }
+ ;
+
+attribute_id : RANGE
+ | DIGITS
+ | DELTA
+ | ACCESS
+ | IDENTIFIER
+ ;
+
+library_item : private_opt
+ /* Slightly loose; PRIVATE can only precede
+ {generic|package|subprog}_decl.
+ Semantic check required to ensure it.*/
+ ( lib_pkg_spec_or_body
+ | subprog_decl_or_rename_or_inst_or_body[true]
+ | generic_decl[true]
+ )
+ { #library_item = #(#[LIBRARY_ITEM, "LIBRARY_ITEM"], #library_item); }
+ ;
+
+private_opt : ( PRIVATE )?
+ { #private_opt = #(#[MODIFIERS, "MODIFIERS"], #private_opt); }
+ ;
+
+lib_pkg_spec_or_body
+ : pkg:PACKAGE^
+ ( BODY! def_id[true] IS! pkg_body_part SEMI!
+ { Set(#pkg, PACKAGE_BODY); }
+ | def_id[true] spec_decl_part[#pkg]
+ )
+ ;
+
+subprog_decl [boolean lib_level]
+ { RefAdaAST t; }
+ : p:PROCEDURE^ def_id[lib_level]
+ ( generic_subp_inst
+ { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); }
+ | formal_part_opt
+ ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); }
+ | is_separate_or_abstract_or_decl[#p]
+ )
+ SEMI!
+ )
+ | f:FUNCTION^ def_designator[lib_level]
+ ( generic_subp_inst
+ { Set(#f, GENERIC_FUNCTION_INSTANTIATION); }
+ | function_tail
+ ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); }
+ | is_separate_or_abstract_or_decl[#f]
+ )
+ SEMI!
+ )
+ ;
+
+def_id [boolean lib_level]
+ : { lib_level }? cn:compound_name { push_def_id(#cn); }
+ | { !lib_level }? n:IDENTIFIER { push_def_id(#n); }
+ ;
+
+generic_subp_inst : IS! generic_inst SEMI!
+ ;
+
+generic_inst : NEW! compound_name ( LPAREN! value_s RPAREN! )?
+ { pop_def_id(); }
+ ;
+
+parenth_values : LPAREN! value ( COMMA! value )* RPAREN!
+ ;
+
+value : ( OTHERS^ RIGHT_SHAFT! expression
+ | ranged_expr_s ( RIGHT_SHAFT^ expression )?
+ )
+ // { #value = #(#[VALUE, "VALUE"], #value); }
+ ;
+
+ranged_expr_s : ranged_expr ( PIPE^ ranged_expr )*
+ // { #ranged_expr_s =
+ // #(#[RANGED_EXPRS, "RANGED_EXPRS"], #ranged_expr_s); }
+ ;
+
+ranged_expr : expression
+ ( DOT_DOT^ simple_expression
+ | RANGE^ range
+ )?
+ ;
+
+range_constraint : r:RANGE^ range
+ { Set(#r, RANGE_CONSTRAINT); }
+ ;
+
+range : ( (range_dots) => range_dots
+ | range_attrib_ref
+ )
+ // Current assumption is we don't need an extra node for range,
+ // otherwise uncomment the following line:
+ // { #range = #(#[RANGE_EXPR, "RANGE_EXPR"], #range); }
+ ;
+
+range_dots : simple_expression DOT_DOT^ simple_expression
+ ;
+
+range_attrib_ref : // "name TIC RANGE" is ambiguous; instead:
+ prefix TIC! r:RANGE^ ( LPAREN! expression RPAREN! )?
+ { Set(#r, RANGE_ATTRIBUTE_REFERENCE); }
+ ;
+
+// Here, the definition of `prefix' deviates from the RM.
+// This gives us some more strictness than `name' (which the RM uses to
+// define `prefix'.)
+prefix : IDENTIFIER
+ ( DOT^ ( ALL | IDENTIFIER )
+ | p:LPAREN^ value_s RPAREN!
+ { Set(#p, INDEXED_COMPONENT); }
+ )*
+ ;
+
+formal_part_opt : ( LPAREN! parameter_specification
+ ( SEMI! parameter_specification )*
+ RPAREN! )?
+ { #formal_part_opt = #([FORMAL_PART_OPT, "FORMAL_PART_OPT"],
+ #formal_part_opt); }
+ ;
+
+parameter_specification : def_ids_colon mode_opt subtype_mark init_opt
+ { #parameter_specification =
+ #(#[PARAMETER_SPECIFICATION,
+ "PARAMETER_SPECIFICATION"], #parameter_specification); }
+ ;
+
+def_ids_colon : defining_identifier_list COLON!
+ ;
+
+defining_identifier_list : IDENTIFIER ( COMMA! IDENTIFIER )*
+ { #defining_identifier_list =
+ #(#[DEFINING_IDENTIFIER_LIST,
+ "DEFINING_IDENTIFIER_LIST"], #defining_identifier_list); }
+ ;
+
+mode_opt : ( IN ( OUT )? | OUT | ACCESS )?
+ { #mode_opt = #(#[MODIFIERS, "MODIFIERS"], #mode_opt); }
+ ;
+
+renames { RefAdaAST dummy; }
+ : RENAMES! ( name
+ | dummy=definable_operator_symbol
+ )
+ { pop_def_id(); }
+ ;
+
+name { RefAdaAST dummy; }
+ : IDENTIFIER
+ ( DOT^ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | dummy=is_operator
+ )
+ | p:LPAREN^ value_s RPAREN!
+ { Set(#p, INDEXED_COMPONENT); }
+ | TIC^ attribute_id // must be in here because of e.g.
+ // Character'Pos (x)
+ )*
+ // { #name = #(#[NAME, "NAME"], #name); }
+ ;
+
+is_operator returns [RefAdaAST d]
+ : { is_operator_symbol(LT(1)->getText().c_str()) }?
+ op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; }
+ ;
+
+definable_operator_symbol returns [RefAdaAST d]
+ : { definable_operator(LT(1)->getText().c_str()) }?
+ op:CHAR_STRING { #op->setType(OPERATOR_SYMBOL); d=#op; }
+ ;
+
+parenthesized_primary : pp:LPAREN^
+ ( NuLL RECORD!
+ | value_s extension_opt
+ )
+ RPAREN!
+ { Set(#pp, PARENTHESIZED_PRIMARY); }
+ ;
+
+extension_opt : ( WITH! ( NuLL RECORD! | value_s ) )?
+ { #extension_opt =
+ #(#[EXTENSION_OPT, "EXTENSION_OPT"], #extension_opt); }
+ ;
+
+is_separate_or_abstract_or_decl! [RefAdaAST t]
+ : IS! separate_or_abstract[t]
+ | { pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, PROCEDURE_DECLARATION);
+ else
+ Set(t, FUNCTION_DECLARATION);
+ }
+ ;
+
+separate_or_abstract! [RefAdaAST t]
+ : SEPARATE!
+ { pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, PROCEDURE_BODY_STUB);
+ else
+ Set(t, FUNCTION_BODY_STUB);
+ }
+ | ABSTRACT!
+ { pop_def_id();
+ if (t->getType() == AdaTokenTypes::PROCEDURE)
+ Set(t, ABSTRACT_PROCEDURE_DECLARATION);
+ else
+ Set(t, ABSTRACT_FUNCTION_DECLARATION);
+ }
+ ;
+
+def_designator [boolean lib_level]
+ { RefAdaAST d; }
+ : { lib_level }? n:compound_name { push_def_id(#n); }
+ | { !lib_level }? d=designator { push_def_id(d); }
+ ;
+
+designator returns [RefAdaAST d]
+ { RefAdaAST op; }
+ : op=definable_operator_symbol { d = op; }
+ | n:IDENTIFIER { d = #n; }
+ ;
+
+function_tail : func_formal_part_opt RETURN! subtype_mark
+ ;
+
+// formal_part_opt is not strict enough for functions, i.e. it permits
+// "in out" and "out" as modes, thus we make an extra rule:
+func_formal_part_opt : ( LPAREN! func_param ( SEMI! func_param )* RPAREN! )?
+ { #func_formal_part_opt =
+ #([FORMAL_PART_OPT,
+ "FORMAL_PART_OPT"], #func_formal_part_opt); }
+ ;
+
+func_param : def_ids_colon in_access_opt subtype_mark init_opt
+ { #func_param =
+ #(#[PARAMETER_SPECIFICATION,
+ "PARAMETER_SPECIFICATION"], #func_param); }
+ ;
+
+in_access_opt : ( IN | ACCESS )?
+ { #in_access_opt = #(#[MODIFIERS, "MODIFIERS"], #in_access_opt); }
+ ;
+
+spec_decl_part [RefAdaAST pkg]
+ : ( IS! ( generic_inst { Set(pkg, GENERIC_PACKAGE_INSTANTIATION); }
+ | pkg_spec_part { Set(pkg, PACKAGE_SPECIFICATION); }
+ )
+ | renames { Set(pkg, PACKAGE_RENAMING_DECLARATION); }
+ )
+ SEMI!
+ ;
+
+pkg_spec_part : basic_declarative_items_opt
+ private_declarative_items_opt
+ end_id_opt
+ ;
+
+private_declarative_items_opt : ( PRIVATE! ( basic_decl_item | pragma )* )?
+ { #private_declarative_items_opt =
+ #(#[PRIVATE_DECLARATIVE_ITEMS_OPT,
+ "PRIVATE_DECLARATIVE_ITEMS_OPT"],
+ #private_declarative_items_opt); }
+ ;
+
+basic_declarative_items_opt : ( basic_decl_item | pragma )*
+ { #basic_declarative_items_opt =
+ #(#[BASIC_DECLARATIVE_ITEMS_OPT,
+ "BASIC_DECLARATIVE_ITEMS_OPT"],
+ #basic_declarative_items_opt); }
+ ;
+
+basic_declarative_items : ( basic_decl_item | pragma )+
+ { #basic_declarative_items =
+ #(#[BASIC_DECLARATIVE_ITEMS_OPT,
+ "BASIC_DECLARATIVE_ITEMS_OPT"],
+ #basic_declarative_items); }
+ ;
+
+basic_decl_item
+ : pkg:PACKAGE^ def_id[false] spec_decl_part[#pkg]
+ | tsk:TASK^ task_type_or_single_decl[#tsk]
+ | pro:PROTECTED^ prot_type_or_single_decl[#pro] SEMI!
+ | subprog_decl[false]
+ | decl_common
+ ;
+
+task_type_or_single_decl [RefAdaAST tsk]
+ : TYPE! def_id[false] discrim_part_opt task_definition_opt
+ { Set(tsk, TASK_TYPE_DECLARATION); }
+ | def_id[false] task_definition_opt
+ { Set(tsk, SINGLE_TASK_DECLARATION); }
+ ;
+
+task_definition_opt
+ : IS! task_items_opt private_task_items_opt end_id_opt SEMI!
+ | SEMI! { pop_def_id(); }
+ ;
+
+discrim_part_opt
+ : ( discrim_part_text )?
+ { #discrim_part_opt =
+ #(#[DISCRIM_PART_OPT,
+ "DISCRIM_PART_OPT"], #discrim_part_opt); }
+ ;
+
+discrim_part_text : LPAREN! (BOX | discriminant_specifications) RPAREN!
+ ;
+
+known_discrim_part
+ : LPAREN! discriminant_specifications RPAREN!
+ { #known_discrim_part =
+ #(#[DISCRIM_PART_OPT,
+ "DISCRIM_PART_OPT"], #known_discrim_part); }
+ ;
+
+empty_discrim_opt : /* empty */
+ { #empty_discrim_opt =
+ #(#[DISCRIM_PART_OPT,
+ "DISCRIM_PART_OPT"], #empty_discrim_opt); }
+ ;
+
+discrim_part
+ : discrim_part_text
+ { #discrim_part =
+ #(#[DISCRIM_PART_OPT,
+ "DISCRIM_PART_OPT"], #discrim_part); }
+ ;
+
+discriminant_specifications : discriminant_specification
+ ( SEMI! discriminant_specification )*
+ { #discriminant_specifications =
+ #(#[DISCRIMINANT_SPECIFICATIONS,
+ "DISCRIMINANT_SPECIFICATIONS"],
+ #discriminant_specifications); }
+ ;
+
+discriminant_specification : def_ids_colon access_opt subtype_mark init_opt
+ { #discriminant_specification =
+ #(#[DISCRIMINANT_SPECIFICATION,
+ "DISCRIMINANT_SPECIFICATION"],
+ #discriminant_specification); }
+ ;
+
+access_opt : ( ACCESS )?
+ { #access_opt = #(#[MODIFIERS, "MODIFIERS"], #access_opt); }
+ ;
+
+init_opt : ( ASSIGN! expression )?
+ { #init_opt = #(#[INIT_OPT, "INIT_OPT"], #init_opt); }
+ ; // `expression' is of course much too loose;
+ // semantic checks are required in the usage contexts.
+
+task_items_opt : ( pragma )* entrydecls_repspecs_opt
+ { #task_items_opt =
+ #(#[TASK_ITEMS_OPT, "TASK_ITEMS_OPT"], #task_items_opt); }
+ ;
+
+entrydecls_repspecs_opt : ( entry_declaration ( pragma | rep_spec )* )*
+ ;
+
+entry_declaration : e:ENTRY^ IDENTIFIER
+ discrete_subtype_def_opt formal_part_opt SEMI!
+ { Set (#e, ENTRY_DECLARATION); }
+ ;
+
+discrete_subtype_def_opt : ( (LPAREN discrete_subtype_definition RPAREN) =>
+ LPAREN! discrete_subtype_definition RPAREN!
+ | /* empty */
+ )
+ { #discrete_subtype_def_opt =
+ #(#[DISCRETE_SUBTYPE_DEF_OPT,
+ "DISCRETE_SUBTYPE_DEF_OPT"], #discrete_subtype_def_opt); }
+ ;
+
+discrete_subtype_definition : ( (range) => range
+ | subtype_ind
+ )
+ // Looks alot like discrete_range, but it's not
+ // (as soon as we start doing semantics.)
+ /* TBC: No need for extra node, just use the inner nodes?
+ { #discrete_subtype_definition =
+ #(#[DISCRETE_SUBTYPE_DEFINITION,
+ "DISCRETE_SUBTYPE_DEFINITION"],
+ #discrete_subtype_definition); }
+ */
+ ;
+
+rep_spec : r:FOR^ subtype_mark USE! rep_spec_part[#r] SEMI!
+ ;
+
+rep_spec_part [RefAdaAST t]
+ : RECORD! align_opt comp_loc_s END! RECORD! // record_type_spec
+ { Set(t, RECORD_REPRESENTATION_CLAUSE); }
+ | AT! expression // address_spec (Ada83)
+ { Set(t, AT_CLAUSE); }
+ | expression // attrib_def. Semantic check must ensure that the
+ // respective subtype_mark contains an attribute reference.
+ { Set(t, ATTRIBUTE_DEFINITION_CLAUSE); }
+ ;
+
+align_opt : ( AT! MOD! expression SEMI! )?
+ { #align_opt = #(#[MOD_CLAUSE_OPT, "MOD_CLAUSE_OPT"], #align_opt); }
+ ;
+
+comp_loc_s : ( pragma | subtype_mark AT! expression RANGE! range SEMI! )*
+ { #comp_loc_s = #(#[COMPONENT_CLAUSES_OPT, "COMPONENT_CLAUSES_OPT"],
+ #comp_loc_s); }
+ ;
+
+private_task_items_opt : ( PRIVATE! ( pragma )* entrydecls_repspecs_opt )?
+ { #private_task_items_opt =
+ #(#[PRIVATE_TASK_ITEMS_OPT,
+ "PRIVATE_TASK_ITEMS_OPT"], #private_task_items_opt); }
+ // Maybe we could just reuse TASK_ITEMS_OPT here instead of
+ // making a separate node type.
+ ;
+
+prot_type_or_single_decl [RefAdaAST pro]
+ : TYPE! def_id[false] discrim_part_opt protected_definition
+ { Set(pro, PROTECTED_TYPE_DECLARATION); }
+ | def_id[false] protected_definition
+ { Set(pro, SINGLE_PROTECTED_DECLARATION); }
+ ;
+
+prot_private_opt : ( PRIVATE! ( prot_op_decl | comp_decl )* )?
+ { #prot_private_opt =
+ #(#[PROT_PRIVATE_OPT,
+ "PROT_PRIVATE_OPT"], #prot_private_opt); }
+ ;
+
+protected_definition
+ : IS! prot_op_decl_s prot_private_opt end_id_opt
+ ;
+
+prot_op_decl_s : ( prot_op_decl )*
+ { #prot_op_decl_s = #(#[PROT_OP_DECLARATIONS,
+ "PROT_OP_DECLARATIONS"], #prot_op_decl_s); }
+ ;
+
+prot_op_decl : entry_declaration
+ | p:PROCEDURE^ def_id[false] formal_part_opt SEMI!
+ { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); }
+ | f:FUNCTION^ def_designator[false] function_tail SEMI!
+ { pop_def_id(); Set(#f, FUNCTION_DECLARATION); }
+ | rep_spec
+ | pragma
+ ;
+
+prot_member_decl_s : ( prot_op_decl | comp_decl )*
+ { #prot_member_decl_s =
+ #(#[PROT_MEMBER_DECLARATIONS,
+ "PROT_MEMBER_DECLARATIONS"], #prot_member_decl_s); }
+ ;
+
+comp_decl : def_ids_colon component_subtype_def init_opt SEMI!
+ { #comp_decl =
+ #(#[COMPONENT_DECLARATION,
+ "COMPONENT_DECLARATION"], #comp_decl); }
+ ;
+
+// decl_common is shared between declarative_item and basic_decl_item.
+// decl_common only contains specifications.
+decl_common
+ : t:TYPE^ IDENTIFIER
+ ( IS! type_def[#t]
+ | ( discrim_part
+ ( IS! derived_or_private_or_record[#t, true]
+ | { Set(#t, INCOMPLETE_TYPE_DECLARATION); }
+ )
+ | empty_discrim_opt
+ { Set(#t, INCOMPLETE_TYPE_DECLARATION); }
+ // NB: In this case, the discrim_part_opt does not
+ // appear in the INCOMPLETE_TYPE_DECLARATION node.
+ )
+ /* The artificial derived_or_private_or_record rule
+ gives us some syntax-level control over where a
+ discrim_part may appear.
+ However, a semantic check is still necessary to make
+ sure the discrim_part is not given for a derived type
+ of an elementary type, or for the full view of a
+ private type that turns out to be such. */
+ )
+ SEMI!
+ | s:SUBTYPE^ IDENTIFIER IS! subtype_ind SEMI! // subtype_decl
+ { Set(#s, SUBTYPE_DECLARATION); }
+ | generic_decl[false]
+ | use_clause
+ | r:FOR^ ( (local_enum_name USE LPAREN) => local_enum_name USE!
+ enumeration_aggregate
+ { Set(#r, ENUMERATION_REPESENTATION_CLAUSE); }
+ | subtype_mark USE! rep_spec_part[#r]
+ )
+ SEMI!
+ | (IDENTIFIER COLON EXCEPTION RENAMES) =>
+ IDENTIFIER erd:COLON^ EXCEPTION! RENAMES! compound_name SEMI!
+ { Set(#erd, EXCEPTION_RENAMING_DECLARATION); }
+ | (IDENTIFIER COLON subtype_mark RENAMES) =>
+ IDENTIFIER ord:COLON^ subtype_mark RENAMES! name SEMI!
+ { Set(#ord, OBJECT_RENAMING_DECLARATION); }
+ | defining_identifier_list od:COLON^ // object_declaration
+ ( EXCEPTION!
+ { Set(#od, EXCEPTION_DECLARATION); }
+ | (CONSTANT ASSIGN) => CONSTANT! ASSIGN! expression
+ { Set(#od, NUMBER_DECLARATION); }
+ | aliased_constant_opt
+ ( array_type_definition[#od] init_opt
+ { Set(#od, ARRAY_OBJECT_DECLARATION); }
+ // Not an RM rule, but simplifies distinction
+ // from the non-array object_declaration.
+ | subtype_ind init_opt
+ { Set(#od, OBJECT_DECLARATION); }
+ )
+ )
+ SEMI!
+ ;
+
+type_def [RefAdaAST t]
+ : LPAREN! enum_id_s RPAREN!
+ { Set(t, ENUMERATION_TYPE_DECLARATION); }
+ | RANGE! range
+ { Set(t, SIGNED_INTEGER_TYPE_DECLARATION); }
+ | MOD! expression
+ { Set(t, MODULAR_TYPE_DECLARATION); }
+ | DIGITS! expression range_constraint_opt
+ { Set(t, FLOATING_POINT_DECLARATION); }
+ | DELTA! expression
+ ( RANGE! range
+ { Set(t, ORDINARY_FIXED_POINT_DECLARATION); }
+ | DIGITS! expression range_constraint_opt
+ { Set(t, DECIMAL_FIXED_POINT_DECLARATION); }
+ )
+ | array_type_definition[t]
+ | access_type_definition[t]
+ | empty_discrim_opt derived_or_private_or_record[t, false]
+ ;
+
+enum_id_s : enumeration_literal_specification
+ ( COMMA! enumeration_literal_specification )*
+ ;
+
+enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL
+ ;
+
+range_constraint_opt : ( range_constraint )?
+ ;
+
+array_type_definition [RefAdaAST t]
+ : ARRAY! LPAREN! index_or_discrete_range_s RPAREN!
+ OF! component_subtype_def
+ { Set(t, ARRAY_TYPE_DECLARATION); }
+ ;
+
+index_or_discrete_range_s
+ : index_or_discrete_range ( COMMA^ index_or_discrete_range )*
+ ;
+
+index_or_discrete_range
+ : simple_expression
+ ( DOT_DOT^ simple_expression // constrained
+ | RANGE^ ( BOX // unconstrained
+ | range // constrained
+ )
+ )?
+ ;
+
+component_subtype_def : aliased_opt subtype_ind
+ ;
+
+aliased_opt : ( ALIASED )?
+ { #aliased_opt = #(#[MODIFIERS, "MODIFIERS"], #aliased_opt); }
+ ;
+
+subtype_ind : subtype_mark constraint_opt
+ { #subtype_ind = #(#[SUBTYPE_INDICATION, "SUBTYPE_INDICATION"],
+ #subtype_ind); }
+ ;
+
+constraint_opt : ( range_constraint
+ | digits_constraint
+ | delta_constraint
+ | (index_constraint) => index_constraint
+ | discriminant_constraint
+ )?
+ ;
+
+digits_constraint : d:DIGITS^ expression range_constraint_opt
+ { Set(#d, DIGITS_CONSTRAINT); }
+ ;
+
+delta_constraint : d:DELTA^ expression range_constraint_opt
+ { Set(#d, DELTA_CONSTRAINT); }
+ ;
+
+index_constraint : p:LPAREN^ discrete_range ( COMMA! discrete_range )* RPAREN!
+ { Set(#p, INDEX_CONSTRAINT); }
+ ;
+
+discrete_range
+ : (range) => range
+ | subtype_ind
+ ;
+
+discriminant_constraint : p:LPAREN^ discriminant_association
+ ( COMMA! discriminant_association )* RPAREN!
+ { Set(#p, DISCRIMINANT_CONSTRAINT); }
+ ;
+
+discriminant_association : selector_names_opt expression
+ { #discriminant_association =
+ #(#[DISCRIMINANT_ASSOCIATION,
+ "DISCRIMINANT_ASSOCIATION"], #discriminant_association); }
+ ;
+
+selector_names_opt : ( (association_head) => association_head
+ | /* empty */
+ )
+ { #selector_names_opt =
+ #(#[SELECTOR_NAMES_OPT,
+ "SELECTOR_NAMES_OPT"], #selector_names_opt); }
+ ;
+
+association_head : selector_name ( PIPE! selector_name )* RIGHT_SHAFT!
+ ;
+
+selector_name : IDENTIFIER // TBD: sem pred
+ ;
+
+access_type_definition [RefAdaAST t]
+ : ACCESS!
+ ( protected_opt
+ ( PROCEDURE! formal_part_opt
+ { Set(t, ACCESS_TO_PROCEDURE_DECLARATION); }
+ | FUNCTION! func_formal_part_opt RETURN! subtype_mark
+ { Set(t, ACCESS_TO_FUNCTION_DECLARATION); }
+ )
+ | constant_all_opt subtype_ind
+ { Set(t, ACCESS_TO_OBJECT_DECLARATION); }
+ )
+ ;
+
+protected_opt : ( PROTECTED )?
+ { #protected_opt = #(#[MODIFIERS, "MODIFIERS"], #protected_opt); }
+ ;
+
+constant_all_opt : ( CONSTANT | ALL )?
+ { #constant_all_opt =
+ #(#[MODIFIERS, "MODIFIERS"], #constant_all_opt); }
+ ;
+
+derived_or_private_or_record [RefAdaAST t, boolean has_discrim]
+ : ( ( ABSTRACT )? NEW subtype_ind WITH ) =>
+ abstract_opt NEW! subtype_ind WITH!
+ ( PRIVATE! { Set(t, PRIVATE_EXTENSION_DECLARATION); }
+ | record_definition[has_discrim]
+ { Set(t, DERIVED_RECORD_EXTENSION); }
+ )
+ | NEW! subtype_ind { Set(t, ORDINARY_DERIVED_TYPE_DECLARATION); }
+ | abstract_tagged_limited_opt
+ ( PRIVATE! { Set(t, PRIVATE_TYPE_DECLARATION); }
+ | record_definition[has_discrim]
+ { Set(t, RECORD_TYPE_DECLARATION); }
+ )
+ ;
+
+abstract_opt : ( ABSTRACT )?
+ { #abstract_opt = #(#[MODIFIERS, "MODIFIERS"], #abstract_opt); }
+ ;
+
+record_definition [boolean has_discrim]
+ : RECORD! component_list[has_discrim] END! RECORD!
+ | NuLL! RECORD! // Thus the component_list is optional in the tree.
+ ;
+
+component_list [boolean has_discrim]
+ : NuLL! SEMI! // Thus the component_list is optional in the tree.
+ | component_items ( variant_part { has_discrim }? )?
+ | empty_component_items variant_part { has_discrim }?
+ ;
+
+component_items : ( pragma | comp_decl )+
+ { #component_items =
+ #(#[COMPONENT_ITEMS,
+ "COMPONENT_ITEMS"], #component_items); }
+ ;
+
+empty_component_items :
+ { #empty_component_items =
+ #(#[COMPONENT_ITEMS,
+ "COMPONENT_ITEMS"], #empty_component_items); }
+ ;
+
+variant_part : c:CASE^ discriminant_direct_name IS! variant_s END! CASE! SEMI!
+ { Set (#c, VARIANT_PART); }
+ ;
+
+discriminant_direct_name : IDENTIFIER // TBD: symtab lookup.
+ ;
+
+variant_s : ( variant )+
+ { #variant_s = #(#[VARIANTS, "VARIANTS"], #variant_s); }
+ ;
+
+variant : w:WHEN^ choice_s RIGHT_SHAFT! component_list[true]
+ { Set (#w, VARIANT); }
+ ;
+
+choice_s : choice ( PIPE^ choice )*
+ ;
+
+choice : OTHERS
+ | (discrete_with_range) => discrete_with_range
+ | expression // ( DOT_DOT^ simple_expression )?
+ ; // No, that's already in discrete_with_range
+
+discrete_with_range : (mark_with_constraint) => mark_with_constraint
+ | range
+ ;
+
+mark_with_constraint : subtype_mark range_constraint
+ { #mark_with_constraint =
+ #(#[MARK_WITH_CONSTRAINT,
+ "MARK_WITH_CONSTRAINT"], #mark_with_constraint); }
+ ;
+
+abstract_tagged_limited_opt
+ : ( ABSTRACT TAGGED! | TAGGED )?
+ ( LIMITED )?
+ { #abstract_tagged_limited_opt =
+ #(#[MODIFIERS, "MODIFIERS"], #abstract_tagged_limited_opt); }
+ ;
+
+local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup
+ ;
+
+enumeration_aggregate : parenth_values
+ ;
+
+aliased_constant_opt : ( ALIASED )? ( CONSTANT )?
+ { #aliased_constant_opt =
+ #(#[MODIFIERS, "MODIFIERS"], #aliased_constant_opt); }
+ ;
+
+generic_decl [boolean lib_level]
+ : g:GENERIC^ generic_formal_part_opt
+ ( PACKAGE! def_id[lib_level]
+ ( renames { Set(#g, GENERIC_PACKAGE_RENAMING); }
+ | IS! pkg_spec_part { Set(#g, GENERIC_PACKAGE_DECLARATION); }
+ )
+ | PROCEDURE! def_id[lib_level] formal_part_opt
+ ( renames { Set(#g, GENERIC_PROCEDURE_RENAMING); }
+ // ^^^ Semantic check must ensure that the (generic_formal)*
+ // after GENERIC is not given here.
+ | { Set(#g, GENERIC_PROCEDURE_DECLARATION); pop_def_id(); }
+ )
+ | FUNCTION! def_designator[lib_level] function_tail
+ ( renames { Set(#g, GENERIC_FUNCTION_RENAMING); }
+ // ^^^ Semantic check must ensure that the (generic_formal)*
+ // after GENERIC is not given here.
+ | { Set(#g, GENERIC_FUNCTION_DECLARATION); pop_def_id(); }
+ )
+ )
+ SEMI!
+ ;
+
+generic_formal_part_opt : ( use_clause | pragma | generic_formal_parameter )*
+ { #generic_formal_part_opt =
+ #(#[GENERIC_FORMAL_PART,
+ "GENERIC_FORMAL_PART"],
+ #generic_formal_part_opt); }
+ ;
+
+generic_formal_parameter :
+ ( t:TYPE^ def_id[false]
+ ( IS!
+ ( LPAREN! BOX! RPAREN!
+ { Set (#t, FORMAL_DISCRETE_TYPE_DECLARATION); }
+ | RANGE! BOX!
+ { Set (#t, FORMAL_SIGNED_INTEGER_TYPE_DECLARATION); }
+ | MOD! BOX!
+ { Set (#t, FORMAL_MODULAR_TYPE_DECLARATION); }
+ | DELTA! BOX!
+ ( DIGITS! BOX!
+ { Set (#t, FORMAL_DECIMAL_FIXED_POINT_DECLARATION); }
+ | { Set (#t, FORMAL_ORDINARY_FIXED_POINT_DECLARATION); }
+ )
+ | DIGITS! BOX!
+ { Set (#t, FORMAL_FLOATING_POINT_DECLARATION); }
+ | array_type_definition[#t]
+ | access_type_definition[#t]
+ | empty_discrim_opt discriminable_type_definition[#t]
+ )
+ | discrim_part IS! discriminable_type_definition[#t]
+ )
+ { pop_def_id(); }
+ | w:WITH^ ( PROCEDURE! def_id[false] formal_part_opt subprogram_default_opt
+ { Set(#w, FORMAL_PROCEDURE_DECLARATION); }
+ | FUNCTION! def_designator[false] function_tail subprogram_default_opt
+ { Set(#w, FORMAL_FUNCTION_DECLARATION); }
+ | PACKAGE! def_id[false] IS! NEW! compound_name formal_package_actual_part_opt
+ { Set(#w, FORMAL_PACKAGE_DECLARATION); }
+ )
+ { pop_def_id(); }
+ | parameter_specification
+ )
+ SEMI!
+ ;
+
+discriminable_type_definition [RefAdaAST t]
+ : ( ( ABSTRACT )? NEW subtype_ind WITH ) =>
+ abstract_opt NEW! subtype_ind WITH! PRIVATE!
+ { Set (t, FORMAL_PRIVATE_EXTENSION_DECLARATION); }
+ | NEW! subtype_ind
+ { Set (t, FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION); }
+ | abstract_tagged_limited_opt PRIVATE!
+ { Set (t, FORMAL_PRIVATE_TYPE_DECLARATION); }
+ ;
+
+subprogram_default_opt : ( IS! ( BOX | name ) )?
+ ;
+
+formal_package_actual_part_opt
+ : ( LPAREN! ( BOX | defining_identifier_list ) RPAREN! )?
+ ;
+
+subprog_decl_or_rename_or_inst_or_body [boolean lib_level]
+ { RefAdaAST t; }
+ : p:PROCEDURE^ def_id[lib_level]
+ ( generic_subp_inst
+ { Set(#p, GENERIC_PROCEDURE_INSTANTIATION); }
+ | formal_part_opt
+ ( renames { Set(#p, PROCEDURE_RENAMING_DECLARATION); }
+ | IS! ( separate_or_abstract[#p]
+ | body_part { Set(#p, PROCEDURE_BODY); }
+ )
+ | { pop_def_id();
+ Set(#p, PROCEDURE_DECLARATION); }
+ )
+ SEMI!
+ )
+ | f:FUNCTION^ def_designator[lib_level]
+ ( generic_subp_inst
+ { Set(#f, GENERIC_FUNCTION_INSTANTIATION); }
+ | function_tail
+ ( renames { Set(#f, FUNCTION_RENAMING_DECLARATION); }
+ | IS! ( separate_or_abstract[#f]
+ | body_part { Set(#f, FUNCTION_BODY); }
+ )
+ | { pop_def_id();
+ Set(#f, FUNCTION_DECLARATION); }
+ )
+ SEMI!
+ )
+ ;
+
+body_part : declarative_part block_body end_id_opt
+ ;
+
+declarative_part : ( pragma | declarative_item )*
+ { #declarative_part =
+ #(#[DECLARATIVE_PART, "DECLARATIVE_PART"],
+ #declarative_part); }
+ ;
+
+// A declarative_item may appear in the declarative part of any body.
+declarative_item :
+ ( pkg:PACKAGE^ ( body_is
+ ( separate { Set(#pkg, PACKAGE_BODY_STUB); }
+ | pkg_body_part
+ { Set(#pkg, PACKAGE_BODY); }
+ )
+ SEMI!
+ | def_id[false] spec_decl_part[#pkg]
+ )
+ | tsk:TASK^ ( body_is
+ ( separate { Set(#tsk, TASK_BODY_STUB); }
+ | body_part { Set(#tsk, TASK_BODY); }
+ )
+ SEMI!
+ | task_type_or_single_decl[#tsk]
+ )
+ | pro:PROTECTED^
+ ( body_is
+ ( separate { Set(#pro, PROTECTED_BODY_STUB); }
+ | prot_op_bodies_opt end_id_opt
+ { Set(#pro, PROTECTED_BODY); }
+ )
+ | prot_type_or_single_decl[#pro]
+ )
+ SEMI!
+ | subprog_decl_or_rename_or_inst_or_body[false]
+ | decl_common
+ )
+ /* DECLARATIVE_ITEM is just a pass-thru node so we omit it.
+ Objections anybody?
+ { #declarative_item =
+ #(#[DECLARATIVE_ITEM,
+ "DECLARATIVE_ITEM"], #declarative_item); }
+ */
+ ;
+
+body_is : BODY! def_id[false] IS!
+ ;
+
+separate : SEPARATE! { pop_def_id(); }
+ ;
+
+pkg_body_part : declarative_part block_body_opt end_id_opt
+ ;
+
+block_body_opt : ( BEGIN! handled_stmt_s )?
+ { #block_body_opt =
+ #(#[BLOCK_BODY_OPT,
+ "BLOCK_BODY_OPT"], #block_body_opt); }
+ ;
+
+prot_op_bodies_opt : ( entry_body
+ | subprog_decl_or_body
+ | pragma
+ )*
+ { #prot_op_bodies_opt =
+ #(#[PROT_OP_BODIES_OPT,
+ "PROT_OP_BODIES_OPT"], #prot_op_bodies_opt); }
+ ;
+
+subprog_decl_or_body
+ : p:PROCEDURE^ def_id[false] formal_part_opt
+ ( IS! body_part { Set(#p, PROCEDURE_BODY); }
+ | { pop_def_id(); Set(#p, PROCEDURE_DECLARATION); }
+ )
+ SEMI!
+ | f:FUNCTION^ def_designator[false] function_tail
+ ( IS! body_part { Set(#f, FUNCTION_BODY); }
+ | { pop_def_id(); Set(#f, FUNCTION_DECLARATION); }
+ )
+ SEMI!
+ ;
+
+block_body : b:BEGIN^ handled_stmt_s
+ { Set(#b, BLOCK_BODY); }
+ ;
+
+handled_stmt_s : statements except_handler_part_opt
+ { #handled_stmt_s =
+ #(#[HANDLED_SEQUENCE_OF_STATEMENTS,
+ "HANDLED_SEQUENCE_OF_STATEMENTS"], #handled_stmt_s); }
+ ;
+
+handled_stmts_opt : ( statements except_handler_part_opt )?
+ { #handled_stmts_opt =
+ #(#[HANDLED_STMTS_OPT,
+ "HANDLED_STMTS_OPT"], #handled_stmts_opt); }
+ ;
+
+statements : ( pragma | statement )+
+ { #statements = #(#[SEQUENCE_OF_STATEMENTS,
+ "SEQUENCE_OF_STATEMENTS"], #statements); }
+ ;
+
+statement : def_label_opt
+ ( null_stmt
+ | exit_stmt
+ | return_stmt
+ | goto_stmt
+ | delay_stmt
+ | abort_stmt
+ | raise_stmt
+ | requeue_stmt
+ | accept_stmt
+ | select_stmt
+ | if_stmt
+ | case_stmt
+ | loop_stmt SEMI!
+ | block END! SEMI!
+ | statement_identifier
+ ( loop_stmt id_opt SEMI!
+ | block end_id_opt SEMI!
+ )
+ | call_or_assignment
+ // | code_stmt // TBD: resolve ambiguity
+ )
+ { #statement = #(#[STATEMENT, "STATEMENT"], #statement); }
+ ;
+
+def_label_opt : ( LT_LT! IDENTIFIER GT_GT! )?
+ { #def_label_opt = #(#[LABEL_OPT, "LABEL_OPT"], #def_label_opt); }
+ ;
+
+null_stmt : s:NuLL SEMI!
+ { Set(#s, NULL_STATEMENT); }
+ ;
+
+if_stmt : s:IF^ cond_clause elsifs_opt
+ else_opt
+ END! IF! SEMI!
+ { Set(#s, IF_STATEMENT); }
+ ;
+
+cond_clause : condition c:THEN^ statements
+ { Set(#c, COND_CLAUSE); }
+ ;
+
+condition : expression
+ // { #condition = #(#[CONDITION, "CONDITION"], #condition); }
+ ;
+
+elsifs_opt : ( ELSIF! cond_clause )*
+ { #elsifs_opt = #(#[ELSIFS_OPT, "ELSIFS_OPT"], #elsifs_opt); }
+ ;
+
+else_opt : ( ELSE! statements )?
+ { #else_opt = #(#[ELSE_OPT, "ELSE_OPT"], #else_opt); }
+ ;
+
+case_stmt : s:CASE^ expression IS! alternative_s END! CASE! SEMI!
+ { Set(#s, CASE_STATEMENT); }
+ ;
+
+alternative_s : ( case_statement_alternative )+
+ ;
+
+case_statement_alternative : s:WHEN^ choice_s RIGHT_SHAFT! statements
+ { Set(#s, CASE_STATEMENT_ALTERNATIVE); }
+ ;
+
+loop_stmt : iteration_scheme_opt
+ l:LOOP^ statements END! LOOP! // basic_loop
+ { Set(#l, LOOP_STATEMENT); }
+ ;
+
+iteration_scheme_opt : ( WHILE^ condition
+ | FOR^ IDENTIFIER IN! reverse_opt discrete_subtype_definition
+ )?
+ { #iteration_scheme_opt =
+ #(#[ITERATION_SCHEME_OPT,
+ "ITERATION_SCHEME_OPT"], #iteration_scheme_opt); }
+ ;
+
+reverse_opt : ( REVERSE )?
+ { #reverse_opt = #(#[MODIFIERS, "MODIFIERS"], #reverse_opt); }
+ ;
+
+id_opt_aux { RefAdaAST endid; } :
+ endid=definable_operator_symbol { end_id_matches_def_id (endid) }?
+ | n:compound_name { end_id_matches_def_id (#n) }?
+ /* Ordinarily we would need to be stricter here, i.e.
+ match compound_name only for the library-level case
+ (and IDENTIFIER otherwise), but end_id_matches_def_id
+ does the right thing for us. */
+ | { pop_def_id(); }
+ ;
+
+id_opt : id_opt_aux
+ { #id_opt = #(#[ID_OPT, "ID_OPT"], #id_opt); }
+ ;
+
+end_id_opt : e:END^ id_opt_aux
+ { Set(#e, END_ID_OPT); }
+ ;
+
+/* Note: This rule should really be `statement_identifier_opt'.
+ However, manual disambiguation of `loop_stmt' from `block'
+ in the presence of the statement_identifier in `statement'
+ results in this rule. The case of loop_stmt/block given
+ without the statement_identifier is directly coded in
+ `statement'. */
+statement_identifier! : n:IDENTIFIER COLON!
+ { push_def_id(#n); }
+ ;
+
+/*
+statement_identifier_opt : ( n:IDENTIFIER COLON! { push_def_id(#n); } )?
+ { #statement_identifier_opt =
+ #(#[STATEMENT_IDENTIFIER_OPT,
+ "STATEMENT_IDENTIFIER_OPT"], #statement_identifier_opt); }
+ ;
+ */
+
+block : declare_opt block_body
+ { #block = #(#[BLOCK_STATEMENT, "BLOCK_STATEMENT"], #block); }
+ ;
+
+declare_opt : ( DECLARE! declarative_part )?
+ { #declare_opt = #(#[DECLARE_OPT, "DECLARE_OPT"], #declare_opt); }
+ ;
+
+exit_stmt : s:EXIT^ ( label_name )? ( WHEN condition )? SEMI!
+ { Set(#s, EXIT_STATEMENT); }
+ ;
+
+label_name : IDENTIFIER
+ ;
+
+return_stmt : s:RETURN^ ( expression )? SEMI!
+ { Set(#s, RETURN_STATEMENT); }
+ ;
+
+goto_stmt : s:GOTO^ label_name SEMI!
+ { Set(#s, GOTO_STATEMENT); }
+ ;
+
+call_or_assignment : // procedure_call is in here.
+ name ( ASSIGN! expression
+ { #call_or_assignment =
+ #(#[ASSIGNMENT_STATEMENT,
+ "ASSIGNMENT_STATEMENT"], #call_or_assignment); }
+ | { #call_or_assignment =
+ #(#[CALL_STATEMENT,
+ "CALL_STATEMENT"], #call_or_assignment); }
+ /* Preliminary. Use semantic analysis to produce
+ {PROCEDURE|ENTRY}_CALL_STATEMENT. */
+ )
+ SEMI!
+ ;
+
+entry_body : e:ENTRY^ def_id[false] entry_body_formal_part entry_barrier IS!
+ body_part SEMI!
+ { Set (#e, ENTRY_BODY); }
+ ;
+
+entry_body_formal_part : entry_index_spec_opt formal_part_opt
+ ;
+
+entry_index_spec_opt :
+ ( (LPAREN FOR) =>
+ LPAREN! FOR! def_id[false] IN! discrete_subtype_definition RPAREN!
+ | /* empty */
+ )
+ { #entry_index_spec_opt =
+ #(#[ENTRY_INDEX_SPECIFICATION,
+ "ENTRY_INDEX_SPECIFICATION"], #entry_index_spec_opt); }
+ ;
+
+entry_barrier : WHEN! condition
+ ;
+
+entry_call_stmt : name SEMI! // Semantic analysis required, for example
+ // to ensure `name' is an entry.
+ { #entry_call_stmt =
+ #(#[ENTRY_CALL_STATEMENT,
+ "ENTRY_CALL_STATEMENT"], #entry_call_stmt); }
+ ;
+
+accept_stmt : a:ACCEPT^ def_id[false] entry_index_opt formal_part_opt
+ ( DO! handled_stmts_opt end_id_opt SEMI!
+ | SEMI! { pop_def_id(); }
+ )
+ { Set (#a, ACCEPT_STATEMENT); }
+ ;
+
+entry_index_opt : ( (LPAREN expression RPAREN) => LPAREN! expression RPAREN!
+ // Looks alot like parenthesized_expr_opt, but it's not.
+ // We need the syn pred for the usage context in accept_stmt.
+ // The formal_part_opt that follows the entry_index_opt there
+ // creates ambiguity (due to the opening LPAREN.)
+ | /* empty */
+ )
+ { #entry_index_opt =
+ #(#[ENTRY_INDEX_OPT,
+ "ENTRY_INDEX_OPT"], #entry_index_opt); }
+ ;
+
+delay_stmt : d:DELAY^ until_opt expression SEMI!
+ { Set (#d, DELAY_STATEMENT); }
+ ;
+
+until_opt : ( UNTIL )?
+ { #until_opt = #(#[MODIFIERS, "MODIFIERS"], #until_opt); }
+ ;
+
+// SELECT_STATEMENT itself is not modeled since it is trivially
+// reconstructed:
+// select_statement ::= selective_accept | timed_entry_call
+// | conditional_entry_call | asynchronous_select
+//
+select_stmt : s:SELECT^
+ ( (triggering_alternative THEN ABORT) =>
+ triggering_alternative THEN! ABORT! abortable_part
+ { Set (#s, ASYNCHRONOUS_SELECT); }
+ | selective_accept
+ { Set (#s, SELECTIVE_ACCEPT); }
+ | entry_call_alternative
+ ( OR! delay_alternative { Set (#s, TIMED_ENTRY_CALL); }
+ | ELSE! statements { Set (#s, CONDITIONAL_ENTRY_CALL); }
+ )
+ )
+ END! SELECT! SEMI!
+ // { Set (#s, SELECT_STATEMENT); }
+ ;
+
+triggering_alternative : ( delay_stmt | entry_call_stmt ) stmts_opt
+ { #triggering_alternative =
+ #(#[TRIGGERING_ALTERNATIVE,
+ "TRIGGERING_ALTERNATIVE"], #triggering_alternative); }
+ ;
+
+abortable_part : stmts_opt
+ { #abortable_part =
+ #(#[ABORTABLE_PART,
+ "ABORTABLE_PART"], #abortable_part); }
+ ;
+
+entry_call_alternative : entry_call_stmt stmts_opt
+ { #entry_call_alternative =
+ #(#[ENTRY_CALL_ALTERNATIVE,
+ "ENTRY_CALL_ALTERNATIVE"], #entry_call_alternative); }
+ ;
+
+selective_accept : guard_opt select_alternative or_select_opt else_opt
+ ;
+
+guard_opt : ( w:WHEN^ condition RIGHT_SHAFT! ( pragma )* )?
+ { Set(#w, GUARD_OPT); }
+ ;
+
+select_alternative // Not modeled since it's just a pass-through.
+ : accept_alternative
+ | delay_alternative
+ | t:TERMINATE SEMI! { Set(#t, TERMINATE_ALTERNATIVE); }
+ ;
+
+accept_alternative : accept_stmt stmts_opt
+ { #accept_alternative =
+ #(#[ACCEPT_ALTERNATIVE,
+ "ACCEPT_ALTERNATIVE"], #accept_alternative); }
+ ;
+
+delay_alternative : delay_stmt stmts_opt
+ { #delay_alternative =
+ #(#[DELAY_ALTERNATIVE,
+ "DELAY_ALTERNATIVE"], #delay_alternative); }
+ ;
+
+stmts_opt : ( pragma | statement )*
+ ;
+
+or_select_opt : ( OR! guard_opt select_alternative )*
+ { #or_select_opt =
+ #(#[OR_SELECT_OPT, "OR_SELECT_OPT"], #or_select_opt); }
+ ;
+
+abort_stmt : a:ABORT^ name ( COMMA! name )* SEMI!
+ { Set (#a, ABORT_STATEMENT); }
+ ;
+
+except_handler_part_opt : ( EXCEPTION! ( exception_handler )+ )?
+ { #except_handler_part_opt =
+ #(#[EXCEPT_HANDLER_PART_OPT,
+ "EXCEPT_HANDLER_PART_OPT"], #except_handler_part_opt); }
+ ;
+
+exception_handler : w:WHEN^ identifier_colon_opt except_choice_s RIGHT_SHAFT!
+ statements
+ { Set (#w, EXCEPTION_HANDLER); }
+ ;
+
+identifier_colon_opt : ( IDENTIFIER COLON! )?
+ { #identifier_colon_opt =
+ #(#[IDENTIFIER_COLON_OPT,
+ "IDENTIFIER_COLON_OPT"], #identifier_colon_opt); }
+ ;
+
+except_choice_s : exception_choice ( PIPE^ exception_choice )*
+ ;
+
+exception_choice : compound_name
+ | OTHERS
+ ;
+
+raise_stmt : r:RAISE^ ( compound_name )? SEMI!
+ { Set (#r, RAISE_STATEMENT); }
+ ;
+
+requeue_stmt : r:REQUEUE^ name ( WITH! ABORT )? SEMI!
+ { Set (#r, REQUEUE_STATEMENT); }
+ ;
+
+operator_call : cs:CHAR_STRING^ operator_call_tail[#cs]
+ ;
+
+operator_call_tail [RefAdaAST opstr]
+ : LPAREN! { is_operator_symbol(opstr->getText().c_str()) }?
+ value_s RPAREN! { opstr->setType(OPERATOR_SYMBOL); }
+ ;
+
+value_s : value ( COMMA! value )*
+ { #value_s = #(#[VALUES, "VALUES"], #value_s); }
+ ;
+
+/*
+literal : NUMERIC_LIT
+ | CHARACTER_LITERAL
+ | CHAR_STRING
+ | NuLL
+ ;
+ */
+
+expression : relation
+ ( a:AND^ ( THEN! { Set (#a, AND_THEN); } )? relation
+ | o:OR^ ( ELSE! { Set (#o, OR_ELSE); } )? relation
+ | XOR^ relation
+ )*
+ ;
+
+relation : simple_expression
+ ( IN^ range_or_mark
+ | n:NOT^ IN! range_or_mark { Set (#n, NOT_IN); }
+ | EQ^ simple_expression
+ | NE^ simple_expression
+ | LT_^ simple_expression
+ | LE^ simple_expression
+ | GT^ simple_expression
+ | GE^ simple_expression
+ )?
+ ;
+
+range_or_mark : (range) => range
+ | subtype_mark
+ ;
+
+simple_expression : signed_term
+ ( PLUS^ signed_term
+ | MINUS^ signed_term
+ | CONCAT^ signed_term
+ )*
+ ;
+
+signed_term
+ : p:PLUS^ term { Set(#p, UNARY_PLUS); }
+ | m:MINUS^ term { Set(#m, UNARY_MINUS); }
+ | term
+ ;
+
+term : factor ( STAR^ factor
+ | DIV^ factor
+ | MOD^ factor
+ | REM^ factor
+ )*
+ ;
+
+factor : ( NOT^ primary
+ | ABS^ primary
+ | primary ( EXPON^ primary )?
+ )
+ ;
+
+primary : ( name_or_qualified
+ | parenthesized_primary
+ | allocator
+ | NuLL
+ | NUMERIC_LIT
+ | CHARACTER_LITERAL
+ | cs:CHAR_STRING^ ( operator_call_tail[#cs] )?
+ )
+ ;
+
+// Temporary, to be turned into just `qualified'.
+// We get away with it because `qualified' is always mentioned
+// together with `name'.
+// Only exception: `code_stmt', which is not yet implemented.
+name_or_qualified { RefAdaAST dummy; }
+ : IDENTIFIER
+ ( DOT^ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | dummy=is_operator
+ )
+ | p:LPAREN^ value_s RPAREN!
+ { Set(#p, INDEXED_COMPONENT); }
+ | TIC^ ( parenthesized_primary | attribute_id )
+ )*
+ ;
+
+allocator : n:NEW^ name_or_qualified
+ { Set(#n, ALLOCATOR); }
+ ;
+
+subunit : sep:SEPARATE^ LPAREN! compound_name RPAREN!
+ { Set(#sep, SUBUNIT); }
+ ( subprogram_body
+ | package_body
+ | task_body
+ | protected_body
+ )
+ ;
+
+subprogram_body
+ : p:PROCEDURE^ def_id[false] formal_part_opt IS! body_part SEMI!
+ { pop_def_id(); Set(#p, PROCEDURE_BODY); }
+ | f:FUNCTION^ def_designator[false] function_tail IS! body_part SEMI!
+ { pop_def_id(); Set(#f, FUNCTION_BODY); }
+ ;
+
+package_body : p:PACKAGE^ body_is pkg_body_part SEMI!
+ { Set(#p, PACKAGE_BODY); }
+ ;
+
+task_body : t:TASK^ body_is body_part SEMI!
+ { Set(#t, TASK_BODY); }
+ ;
+
+protected_body : p:PROTECTED^ body_is prot_op_bodies_opt end_id_opt SEMI!
+ { Set(#p, PROTECTED_BODY); }
+ ;
+
+// TBD
+// code_stmt : qualified SEMI!
+// ;
+
+//----------------------------------------------------------------------------
+// The Ada scanner
+//----------------------------------------------------------------------------
+{
+#include "preambles.h"
+}
+class AdaLexer extends Lexer;
+
+options {
+ charVocabulary = '\3'..'\377';
+ exportVocab = Ada; // call the vocabulary "Ada"
+ testLiterals = false; // don't automatically test for literals
+ k = 4; // number of characters of lookahead
+ caseSensitive = false;
+ caseSensitiveLiterals = false;
+ ///defaultErrorHandler = true;
+}
+
+tokens {
+ // part 1: keywords
+ ABORT = "abort" ;
+ ABS = "abs" ;
+ ABSTRACT = "abstract" ;
+ ACCEPT = "accept" ;
+ ACCESS = "access" ;
+ ALIASED = "aliased" ;
+ ALL = "all" ;
+ AND = "and" ;
+ ARRAY = "array" ;
+ AT = "at" ;
+ BEGIN = "begin" ;
+ BODY = "body" ;
+ CASE = "case" ;
+ CONSTANT = "constant" ;
+ DECLARE = "declare" ;
+ DELAY = "delay" ;
+ DELTA = "delta" ;
+ DIGITS = "digits" ;
+ DO = "do" ;
+ ELSE = "else" ;
+ ELSIF = "elsif" ;
+ END = "end" ;
+ ENTRY = "entry" ;
+ EXCEPTION = "exception" ;
+ EXIT = "exit" ;
+ FOR = "for" ;
+ FUNCTION = "function" ;
+ GENERIC = "generic" ;
+ GOTO = "goto" ;
+ IF = "if" ;
+ IN = "in" ;
+ IS = "is" ;
+ LIMITED = "limited" ;
+ LOOP = "loop" ;
+ MOD = "mod" ;
+ NEW = "new" ;
+ NOT = "not" ;
+ NuLL = "null" ;
+ OF = "of" ;
+ OR = "or" ;
+ OTHERS = "others" ;
+ OUT = "out" ;
+ PACKAGE = "package" ;
+ PRAGMA = "pragma" ;
+ PRIVATE = "private" ;
+ PROCEDURE = "procedure" ;
+ PROTECTED = "protected" ;
+ RAISE = "raise" ;
+ RANGE = "range" ;
+ RECORD = "record" ;
+ REM = "rem" ;
+ RENAMES = "renames" ;
+ REQUEUE = "requeue" ;
+ RETURN = "return" ;
+ REVERSE = "reverse" ;
+ SELECT = "select" ;
+ SEPARATE = "separate" ;
+ SUBTYPE = "subtype" ;
+ TAGGED = "tagged" ;
+ TASK = "task" ;
+ TERMINATE = "terminate" ;
+ THEN = "then" ;
+ TYPE = "type" ;
+ UNTIL = "until" ;
+ USE = "use" ;
+ WHEN = "when" ;
+ WHILE = "while" ;
+ WITH = "with" ;
+ XOR = "xor" ;
+
+ // part 2: RM tokens (synthetic)
+ ABORTABLE_PART;
+ ABORT_STATEMENT;
+ /*ABSTRACT_SUBPROGRAM_DECLARATION; =>
+ ABSTRACT_{FUNCTION|PROCEDURE}_DECLARATION */
+ ACCEPT_ALTERNATIVE;
+ ACCEPT_STATEMENT;
+ /* ACCESS_TO_FUNCTION_DEFINITION => ACCESS_TO_FUNCTION_DECLARATION */
+ /* ACCESS_TO_OBJECT_DEFINITION => ACCESS_TO_OBJECT_DECLARATION */
+ /* ACCESS_TO_PROCEDURE_DEFINITION => ACCESS_TO_PROCEDURE_DECLARATION */
+ /* ACCESS_TYPE_DEFINITION => ACCESS_TYPE_DECLARATION */
+ ALLOCATOR;
+ /* ARRAY_TYPE_DEFINITION => ARRAY_TYPE_DECLARATION */
+ ASSIGNMENT_STATEMENT;
+ ASYNCHRONOUS_SELECT;
+ ATTRIBUTE_DEFINITION_CLAUSE;
+ AT_CLAUSE;
+ BLOCK_STATEMENT;
+ CASE_STATEMENT;
+ CASE_STATEMENT_ALTERNATIVE;
+ CODE_STATEMENT;
+ COMPONENT_DECLARATION;
+ // COMPONENT_LIST; // not currently used as an explicit node
+ // CONDITION; // not currently used
+ CONDITIONAL_ENTRY_CALL;
+ CONTEXT_CLAUSE;
+ /* DECIMAL_FIXED_POINT_DEFINITION => DECIMAL_FIXED_POINT_DECLARATION */
+ // DECLARATIVE_ITEM; // not currently used
+ DECLARATIVE_PART;
+ DEFINING_IDENTIFIER_LIST;
+ DELAY_ALTERNATIVE;
+ DELAY_STATEMENT;
+ DELTA_CONSTRAINT;
+ /* DERIVED_TYPE_DEFINITION; =>
+ DERIVED_RECORD_EXTENSION, ORDINARY_DERIVED_TYPE_DECLARATION */
+ DIGITS_CONSTRAINT;
+ // DISCRETE_RANGE; // Not used; instead, directly use its RHS alternatives.
+ DISCRIMINANT_ASSOCIATION;
+ DISCRIMINANT_CONSTRAINT;
+ DISCRIMINANT_SPECIFICATION;
+ ENTRY_BODY;
+ ENTRY_CALL_ALTERNATIVE;
+ ENTRY_CALL_STATEMENT;
+ ENTRY_DECLARATION;
+ ENTRY_INDEX_SPECIFICATION;
+ ENUMERATION_REPESENTATION_CLAUSE;
+ /* ENUMERATION_TYPE_DEFINITION => ENUMERATION_TYPE_DECLARATION */
+ EXCEPTION_DECLARATION;
+ EXCEPTION_HANDLER;
+ EXCEPTION_RENAMING_DECLARATION;
+ EXIT_STATEMENT;
+ /* FLOATING_POINT_DEFINITION => FLOATING_POINT_DECLARATION */
+ /* FORMAL_ACCESS_TYPE_DEFINITION => FORMAL_ACCESS_TYPE_DECLARATION */
+ /* FORMAL_ARRAY_TYPE_DEFINITION => FORMAL_ARRAY_TYPE_DECLARATION */
+ /* FORMAL_DECIMAL_FIXED_POINT_DEFINITION =>
+ FORMAL_DECIMAL_FIXED_POINT_DECLARATION */
+ /* FORMAL_DERIVED_TYPE_DEFINITION =>
+ FORMAL_{ORDINARY_DERIVED_TYPE|PRIVATE_EXTENSION}_DECLARATION */
+ /* FORMAL_DISCRETE_TYPE_DEFINITION => FORMAL_DISCRETE_TYPE_DECLARATION */
+ /* FORMAL_FLOATING_POINT_DEFINITION =>
+ FORMAL_FLOATING_POINT_DECLARATION */
+ /* FORMAL_MODULAR_TYPE_DEFINITION => FORMAL_MODULAR_TYPE_DECLARATION */
+ /* FORMAL_ORDINARY_FIXED_POINT_DEFINITION =>
+ FORMAL_ORDINARY_FIXED_POINT_DECLARATION */
+ FORMAL_PACKAGE_DECLARATION;
+ /* FORMAL_PRIVATE_TYPE_DEFINITION => FORMAL_PRIVATE_TYPE_DECLARATION */
+ /* FORMAL_SIGNED_INTEGER_TYPE_DEFINITION =>
+ FORMAL_SIGNED_INTEGER_TYPE_DECLARATION */
+ /* FORMAL_SUBPROGRAM_DECLARATION; =>
+ FORMAL_{FUNCTION|PROCEDURE}_DECLARATION */
+ /* FORMAL_TYPE_DECLARATION; not used, replaced by the corresponding
+ finer grained declarations */
+ /* FORMAL_TYPE_DEFINITION; not used at all; we use declarations
+ not definitions */
+ /* FULL_TYPE_DECLARATION; not used, replaced by the corresponding
+ finer grained declarations */
+ GENERIC_FORMAL_PART;
+ /* GENERIC_INSTANTIATION; =>
+ GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_INSTANTIATION */
+ GENERIC_PACKAGE_DECLARATION;
+ /* GENERIC_RENAMING_DECLARATION; =>
+ GENERIC_{FUNCTION|PACKAGE|PROCEDURE}_RENAMING */
+ /* GENERIC_SUBPROGRAM_DECLARATION; =>
+ GENERIC_{FUNCTION|PROCEDURE}_DECLARATION */
+ GOTO_STATEMENT;
+ HANDLED_SEQUENCE_OF_STATEMENTS;
+ HANDLED_STMTS_OPT;
+ IF_STATEMENT;
+ INCOMPLETE_TYPE_DECLARATION;
+ INDEXED_COMPONENT;
+ INDEX_CONSTRAINT;
+ LIBRARY_ITEM;
+ LOOP_STATEMENT;
+ /* MODULAR_TYPE_DEFINITION => MODULAR_TYPE_DECLARATION */
+ NAME;
+ NULL_STATEMENT;
+ NUMBER_DECLARATION;
+ OBJECT_DECLARATION;
+ OBJECT_RENAMING_DECLARATION;
+ OPERATOR_SYMBOL;
+ /* ORDINARY_FIXED_POINT_DEFINITION => ORDINARY_FIXED_POINT_DECLARATION */
+ PACKAGE_BODY;
+ PACKAGE_BODY_STUB;
+ PACKAGE_RENAMING_DECLARATION;
+ PACKAGE_SPECIFICATION;
+ PARAMETER_SPECIFICATION;
+ // PREFIX; // not used
+ // PRIMARY; // not used
+ PRIVATE_EXTENSION_DECLARATION;
+ PRIVATE_TYPE_DECLARATION;
+ // PROCEDURE_CALL_STATEMENT; // NYI, using CALL_STATEMENT for now.
+ PROTECTED_BODY;
+ PROTECTED_BODY_STUB;
+ PROTECTED_TYPE_DECLARATION;
+ RAISE_STATEMENT;
+ RANGE_ATTRIBUTE_REFERENCE;
+ RECORD_REPRESENTATION_CLAUSE;
+ /* RECORD_TYPE_DEFINITION => RECORD_TYPE_DECLARATION */
+ REQUEUE_STATEMENT;
+ RETURN_STATEMENT;
+ SELECTIVE_ACCEPT;
+ /* SELECT_ALTERNATIVE; Not used - instead, we use the finer grained rules
+ ACCEPT_ALTERNATIVE | DELAY_ALTERNATIVE
+ | TERMINATE_ALTERNATIVE */
+ /* SELECT_STATEMENT; Not used - instead, we use the finer grained rules
+ SELECTIVE_ACCEPT | TIMED_ENTRY_CALL
+ | CONDITIONAL_ENTRY_CALL | ASYNCHRONOUS_SELECT */
+ SEQUENCE_OF_STATEMENTS;
+ /* SIGNED_INTEGER_TYPE_DEFINITION => SIGNED_INTEGER_TYPE_DECLARATION */
+ SINGLE_PROTECTED_DECLARATION;
+ SINGLE_TASK_DECLARATION;
+ STATEMENT;
+ /* SUBPROGRAM_BODY; => {FUNCTION|PROCEDURE}_BODY */
+ /* SUBPROGRAM_BODY_STUB; => {FUNCTION|PROCEDURE}_BODY_STUB */
+ /* SUBPROGRAM_DECLARATION; => {FUNCTION|PROCEDURE}_DECLARATION */
+ /* SUBPROGRAM_RENAMING_DECLARATION; =>
+ {FUNCTION|PROCEDURE}_RENAMING_DECLARATION */
+ SUBTYPE_DECLARATION;
+ SUBTYPE_INDICATION;
+ SUBTYPE_MARK;
+ SUBUNIT;
+ TASK_BODY;
+ TASK_BODY_STUB;
+ TASK_TYPE_DECLARATION;
+ TERMINATE_ALTERNATIVE;
+ TIMED_ENTRY_CALL;
+ TRIGGERING_ALTERNATIVE;
+ /* TYPE_DECLARATION; not used, replaced by the corresponding
+ finer grained declarations */
+ USE_CLAUSE;
+ USE_TYPE_CLAUSE;
+ VARIANT;
+ VARIANT_PART;
+ WITH_CLAUSE;
+
+ // part 3: Non-RM synthetic tokens.
+ // They exist mainly to normalize the node structure with respect to
+ // optional items. (Without them, the presence or absence of an optional
+ // item would change the node layout, but we want a fixed layout.)
+ ABSTRACT_FUNCTION_DECLARATION;
+ ABSTRACT_PROCEDURE_DECLARATION;
+ ACCESS_TO_FUNCTION_DECLARATION;
+ ACCESS_TO_OBJECT_DECLARATION;
+ ACCESS_TO_PROCEDURE_DECLARATION;
+ /* ACCESS_TYPE_DECLARATION; not used, replaced by
+ ACCESS_TO_{FUNCTION|OBJECT|PROCEDURE}_DECLARATION
+ */
+ ARRAY_OBJECT_DECLARATION;
+ ARRAY_TYPE_DECLARATION;
+ AND_THEN;
+ BASIC_DECLARATIVE_ITEMS_OPT;
+ BLOCK_BODY;
+ BLOCK_BODY_OPT;
+ CALL_STATEMENT; // See {PROCEDURE|ENTRY}_CALL_STATEMENT
+ COMPONENT_CLAUSES_OPT;
+ COMPONENT_ITEMS;
+ COND_CLAUSE;
+ DECIMAL_FIXED_POINT_DECLARATION;
+ DECLARE_OPT;
+ DERIVED_RECORD_EXTENSION;
+ // DERIVED_TYPE_DECLARATION; // not used
+ DISCRETE_SUBTYPE_DEF_OPT;
+ DISCRIMINANT_SPECIFICATIONS;
+ DISCRIM_PART_OPT;
+ ELSE_OPT;
+ ELSIFS_OPT;
+ END_ID_OPT;
+ ENTRY_INDEX_OPT;
+ ENUMERATION_TYPE_DECLARATION;
+ EXCEPT_HANDLER_PART_OPT;
+ EXTENSION_OPT;
+ FLOATING_POINT_DECLARATION;
+ /* FORMAL_ACCESS_TYPE_DECLARATION => ACCESS_TYPE_DECLARATION */
+ /* FORMAL_ARRAY_TYPE_DECLARATION => ARRAY_TYPE_DECLARATION */
+ FORMAL_DECIMAL_FIXED_POINT_DECLARATION;
+ FORMAL_DISCRETE_TYPE_DECLARATION;
+ FORMAL_FLOATING_POINT_DECLARATION;
+ FORMAL_FUNCTION_DECLARATION;
+ FORMAL_MODULAR_TYPE_DECLARATION;
+ FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION;
+ FORMAL_ORDINARY_FIXED_POINT_DECLARATION;
+ FORMAL_PART_OPT;
+ FORMAL_PRIVATE_EXTENSION_DECLARATION;
+ FORMAL_PRIVATE_TYPE_DECLARATION;
+ FORMAL_PROCEDURE_DECLARATION;
+ FORMAL_SIGNED_INTEGER_TYPE_DECLARATION;
+ FUNCTION_BODY;
+ FUNCTION_BODY_STUB;
+ FUNCTION_DECLARATION;
+ FUNCTION_RENAMING_DECLARATION;
+ GENERIC_FUNCTION_DECLARATION;
+ GENERIC_FUNCTION_INSTANTIATION;
+ GENERIC_FUNCTION_RENAMING;
+ GENERIC_PACKAGE_INSTANTIATION;
+ GENERIC_PACKAGE_RENAMING;
+ GENERIC_PROCEDURE_DECLARATION;
+ GENERIC_PROCEDURE_INSTANTIATION;
+ GENERIC_PROCEDURE_RENAMING;
+ GUARD_OPT;
+ IDENTIFIER_COLON_OPT;
+ ID_OPT;
+ INIT_OPT;
+ ITERATION_SCHEME_OPT;
+ LABEL_OPT;
+ MARK_WITH_CONSTRAINT;
+ MODIFIERS; /* Possible values: abstract access aliased all constant in
+ limited out private protected reverse tagged */
+ MODULAR_TYPE_DECLARATION;
+ MOD_CLAUSE_OPT;
+ // NAME_OR_QUALIFIED;
+ NOT_IN;
+ ORDINARY_DERIVED_TYPE_DECLARATION;
+ ORDINARY_FIXED_POINT_DECLARATION;
+ OR_ELSE;
+ OR_SELECT_OPT;
+ PARENTHESIZED_PRIMARY;
+ // PARENTHESIZED_VALUES;
+ // PARENTHESIZED_VALUES_OPT;
+ PRIVATE_DECLARATIVE_ITEMS_OPT;
+ PRIVATE_TASK_ITEMS_OPT;
+ PROCEDURE_BODY;
+ PROCEDURE_BODY_STUB;
+ PROCEDURE_DECLARATION;
+ PROCEDURE_RENAMING_DECLARATION;
+ PROT_MEMBER_DECLARATIONS;
+ PROT_OP_BODIES_OPT;
+ PROT_OP_DECLARATIONS;
+ PROT_PRIVATE_OPT;
+ RANGED_EXPRS; // ugh, what an ugly name
+ RANGE_CONSTRAINT;
+ RECORD_TYPE_DECLARATION;
+ SELECTOR_NAMES_OPT;
+ SIGNED_INTEGER_TYPE_DECLARATION;
+ TASK_ITEMS_OPT;
+ UNARY_MINUS;
+ UNARY_PLUS;
+ VALUE;
+ VALUES;
+ VARIANTS;
+}
+
+{
+ ANTLR_LEXER_PREAMBLE
+ private:
+ bool lastTokenWasTicCompatible;
+}
+
+//----------------------------------------------------------------------------
+// OPERATORS
+//----------------------------------------------------------------------------
+COMMENT_INTRO : "--" {lastTokenWasTicCompatible=false;};
+DOT_DOT : ".." {lastTokenWasTicCompatible=false;};
+LT_LT : "<<" {lastTokenWasTicCompatible=false;};
+OX : "<>" {lastTokenWasTicCompatible=false;};
+GT_GT : ">>" {lastTokenWasTicCompatible=false;};
+ASSIGN : ":=" {lastTokenWasTicCompatible=false;};
+RIGHT_SHAFT : "=>" {lastTokenWasTicCompatible=false;};
+NE : "/=" {lastTokenWasTicCompatible=false;};
+LE : "<=" {lastTokenWasTicCompatible=false;};
+GE : ">=" {lastTokenWasTicCompatible=false;};
+EXPON : "**" {lastTokenWasTicCompatible=false;};
+PIPE : '|' {lastTokenWasTicCompatible=false;};
+CONCAT : '&' {lastTokenWasTicCompatible=false;};
+DOT : '.' {lastTokenWasTicCompatible=false;};
+EQ : '=' {lastTokenWasTicCompatible=false;};
+LT_ : '<' {lastTokenWasTicCompatible=false;};
+GT : '>' {lastTokenWasTicCompatible=false;};
+PLUS : '+' {lastTokenWasTicCompatible=false;};
+MINUS : '-' {lastTokenWasTicCompatible=false;};
+STAR : '*' {lastTokenWasTicCompatible=false;};
+DIV : '/' {lastTokenWasTicCompatible=false;};
+LPAREN : '(' {lastTokenWasTicCompatible=false;};
+RPAREN : ')' {lastTokenWasTicCompatible=true;};
+COLON : ':' {lastTokenWasTicCompatible=false;};
+COMMA : ',' {lastTokenWasTicCompatible=false;};
+SEMI : ';' {lastTokenWasTicCompatible=false;};
+
+
+// Literals.
+
+// Rule for IDENTIFIER: testLiterals is set to true. This means that
+// after we match the rule, we look in the literals table to see if
+// it's a keyword or really an identifier.
+IDENTIFIER
+ options {testLiterals=true;}
+ : ( 'a'..'z' ) ( ('_')? ( 'a'..'z'|'0'..'9' ) )*
+ ;
+
+TIC_OR_CHARACTER_LITERAL :
+ "'"! { $setType(TIC); } (
+ { ! lastTokenWasTicCompatible }? . "'"!
+ { $setType(CHARACTER_LITERAL); }
+ )?
+ {lastTokenWasTicCompatible=false;};
+
+CHAR_STRING : '"'! ("\"\"" | ~('"'))* '"'!
+ {lastTokenWasTicCompatible=true;};
+
+NUMERIC_LIT : ( DIGIT )+
+ ( '#' BASED_INTEGER ( '.' BASED_INTEGER )? '#'
+ | ( '_' ( DIGIT )+ )+ // INTEGER
+ )?
+ ( { LA(2)!='.' }? //&& LA(3)!='.' }?
+ ( '.' ( DIGIT )+ ( '_' ( DIGIT )+ )* ( EXPONENT )?
+ | EXPONENT
+ )
+ )?
+ {lastTokenWasTicCompatible=false;};
+
+// a couple protected methods to assist in matching the various numbers
+
+protected
+DIGIT : ( '0'..'9' ) {lastTokenWasTicCompatible=false;};
+
+protected
+EXPONENT : ('e') ('+'|'-')? ( DIGIT )+ {lastTokenWasTicCompatible=false;};
+
+protected
+EXTENDED_DIGIT : ( DIGIT | 'a'..'f' ) {lastTokenWasTicCompatible=false;};
+
+protected
+BASED_INTEGER : ( EXTENDED_DIGIT ) ( ('_')? EXTENDED_DIGIT )* {lastTokenWasTicCompatible=false;};
+
+
+// Whitespace -- ignored
+WS_ : ( ' '
+ | '\t'
+ | '\f'
+ // handle newlines
+ | ( "\r\n" // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ { newline(); }
+ )
+ { $setType(antlr::Token::SKIP); }
+ ;
+
+// Single-line comments
+COMMENT : COMMENT_INTRO (~('\n'|'\r'))* ('\n'|'\r'('\n')?)
+ { $setType(antlr::Token::SKIP);
+ newline();
+ lastTokenWasTicCompatible=false; }
+ ;
+
diff --git a/languages/ada/ada.store.g b/languages/ada/ada.store.g
new file mode 100644
index 00000000..dbca7312
--- /dev/null
+++ b/languages/ada/ada.store.g
@@ -0,0 +1,610 @@
+/* $Id$
+ * ANTLR Ada tree walker for building the Kdevelop class store
+ * Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net>
+ */
+
+header "pre_include_hpp" {
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+
+#include <codemodel.h>
+#include "AdaAST.hpp"
+#include "ada_utils.hpp"
+}
+
+header "post_include_hpp" {
+#include <codemodel.h>
+#include <kdebug.h>
+}
+
+options {
+ language="Cpp";
+}
+
+class AdaStoreWalker extends AdaTreeParserSuper;
+options {
+ importVocab = Ada;
+ ASTLabelType = "RefAdaAST";
+}
+
+{
+private:
+ QString m_fileName;
+ QValueList<NamespaceDom> m_scopeStack;
+ CodeModel* m_model;
+ QValueList<QStringList> m_imports;
+ NamespaceDom m_currentContainer;
+ int m_currentAccess;
+ bool m_addToStore; /* auxiliary variable: for the moment, this is `true'
+ only when we are in specs, not bodies. */
+ bool m_isSubprogram; // auxiliary to def_id()
+ FileDom m_file;
+
+public:
+ void setCodeModel (CodeModel* model) { m_model = model; }
+ CodeModel* codeModel () { return m_model; }
+ const CodeModel* codeModel () const { return m_model; }
+
+ QString fileName () const { return m_fileName; }
+ void setFileName (const QString& fileName) { m_fileName = fileName; }
+
+ void init () {
+ m_scopeStack.clear ();
+ m_imports.clear ();
+ m_currentContainer = m_model->globalNamespace ();
+ m_scopeStack.append (m_currentContainer);
+ m_currentAccess = CodeModelItem::Public;
+ m_addToStore = false;
+ m_isSubprogram = false;
+ if (m_model->hasFile(m_fileName))
+ m_model->removeFile (m_model->fileByName(m_fileName));
+ m_file = m_model->create<FileModel>();
+ m_file->setName(m_fileName);
+ m_model->addFile(m_file);
+ }
+
+ void wipeout () { m_model->wipeout (); }
+// void out () { m_store->out (); }
+ void removeWithReferences (const QString& fileName) {
+ m_model->removeFile (m_model->fileByName(fileName));
+ }
+ NamespaceDom insertScopeContainer
+ (NamespaceDom scope, const QStringList & scopes ) {
+ QStringList::ConstIterator it = scopes.begin();
+ QString prefix( *it );
+ NamespaceDom ns = scope->namespaceByName( prefix );
+// kdDebug() << "insertScopeContainer begin with prefix " << prefix << endl;
+ if (!ns.data()) {
+// kdDebug() << "insertScopeContainer: ns is empty" << endl;
+ ns = m_model->create<NamespaceModel>();
+// kdDebug() << "insertScopeContainer: ns created" << endl;
+ ns->setName( prefix );
+// kdDebug() << "insertScopeContainer: ns name set" << endl;
+ scope->addNamespace( ns );
+// kdDebug() << "insertScopeContainer: ns added to a scope" << endl;
+
+ if (scope == m_model->globalNamespace())
+ m_file->addNamespace( ns );
+ }
+// kdDebug() << "insertScopeContainer: while" << endl;
+ while ( ++it != scopes.end() ) {
+ QString nameSegment( *it );
+ prefix += "." + nameSegment;
+// kdDebug() << "insertScopeContainer: while prefix = " << prefix << endl;
+ NamespaceDom inner = scope->namespaceByName( prefix );
+ if (!inner.data() ) {
+// kdDebug() << "insertScopeContainer: inner is empty " << endl;
+ inner = m_model->create<NamespaceModel>();
+// kdDebug() << "insertScopeContainer: inner created " << endl;
+ inner->setName( nameSegment );
+ ns->addNamespace( inner );
+// kdDebug() << "insertScopeContainer: inner added " << endl;
+ }
+ ns = inner;
+ }
+ return ns;
+ }
+ NamespaceDom defineScope( RefAdaAST namenode ) {
+ QStringList scopes( qnamelist( namenode ) );
+// kdDebug() << "defineScope: " << scopes.join(" ") << endl;
+ NamespaceDom psc = insertScopeContainer( m_currentContainer, scopes );
+// kdDebug() << "defineScope psc created" << endl;
+ psc->setStartPosition(namenode->getLine(), namenode->getColumn());
+// kdDebug() << "defineScope start position set" << endl;
+ psc->setFileName(m_fileName);
+// kdDebug() << "defineScope file name set" << endl;
+ // psc->setEndPosition (endLine, 0);
+// kdDebug() << "defineScope return" << endl;
+ return psc;
+ }
+}
+
+/*
+ * Only those rules that require specific action for the kdevelop
+ * class store are overloaded here.
+ */
+
+compilation_unit
+ : { init(); }
+ context_items_opt ( library_item | subunit ) ( pragma )*
+ ;
+
+
+with_clause
+ : #(WITH_CLAUSE ( compound_name
+ // TBD: slurp in the actual files
+ )+ )
+ ;
+
+/*
+compound_name
+ : IDENTIFIER
+ | #(DOT compound_name IDENTIFIER)
+ ;
+ */
+
+use_clause
+ : #(USE_TYPE_CLAUSE ( subtype_mark )+ )
+ | #(USE_CLAUSE ( c:compound_name
+ { m_imports.back ().push_back (qtext (#c)); }
+ )+ )
+ ;
+
+
+library_item :
+ #(LIBRARY_ITEM
+ #(MODIFIERS ( PRIVATE { m_currentAccess = CodeModelItem::Protected; } )? )
+ ( lib_subprog_decl_or_rename_or_inst_or_body
+ | #(PACKAGE_BODY pb:def_id pkg_body_part)
+ | #(GENERIC_PACKAGE_INSTANTIATION gpi:def_id
+ {
+ defineScope( #gpi );
+ }
+ generic_inst
+ )
+ | #(PACKAGE_SPECIFICATION ps:def_id
+ {
+ NamespaceDom psc = defineScope( #ps );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+ }
+ pkg_spec_part
+ {
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0) {
+ kdDebug() << "adastore: m_scopeStack is empty!" << endl;
+ m_scopeStack.append( m_model->globalNamespace() );
+ }
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setEndPosition (endLine, 0);
+ m_addToStore = false;
+ }
+ )
+ | #(PACKAGE_RENAMING_DECLARATION prd:def_id
+ {
+ defineScope( #prd );
+ }
+ renames
+ )
+ | generic_decl
+ )
+ )
+ ;
+
+
+subprog_def_id
+ : { m_isSubprogram = true; }
+ def_id
+ { m_isSubprogram = false; }
+ ;
+
+subprog_decl
+ : #(GENERIC_PROCEDURE_INSTANTIATION subprog_def_id generic_inst)
+ | #(PROCEDURE_RENAMING_DECLARATION subprog_def_id formal_part_opt renames)
+ | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt)
+ | #(PROCEDURE_BODY_STUB subprog_def_id formal_part_opt)
+ | #(ABSTRACT_PROCEDURE_DECLARATION subprog_def_id formal_part_opt)
+ | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst)
+ | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames)
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ | #(FUNCTION_BODY_STUB def_designator function_tail)
+ | #(ABSTRACT_FUNCTION_DECLARATION subprog_def_id function_tail)
+ ;
+
+
+def_id
+ : cn:compound_name
+ {
+// kdDebug() << "cn:compound_name started " << endl;
+ if (m_addToStore) {
+// kdDebug() << "cn:compound_name m_addToStore " << endl;
+ if (m_isSubprogram) {
+// kdDebug() << "cn:compound_name m_isSubprogram " << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName (qtext (cn));
+ method->setFileName(m_fileName);
+// kdDebug() << "cn:compound_name method->setStartPosition(" << endl;
+ method->setStartPosition(#cn->getLine(), #cn->getColumn());
+
+ if (m_currentContainer == m_model->globalNamespace())
+ m_file->addFunction(method);
+ else
+ m_currentContainer->addFunction(method);
+ //FIXME: adymo: is this valid for CodeModel
+/* ParsedMethod *old = m_currentContainer->getMethod (method);
+ if (old) {
+ delete (method);
+ method = old;
+ } else {
+ m_currentContainer->addMethod (method);
+ }*/
+ } else {
+ // TBC: what about other declarations?
+ }
+ }
+ }
+ ;
+
+/*
+generic_inst : compound_name ( value_s )?
+ ;
+ */
+
+/*
+formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* )
+ ;
+ */
+
+/*
+parameter_specification
+ : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers
+ subtype_mark init_opt)
+ ;
+ */
+
+/*
+defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ )
+ ;
+ */
+
+/*
+renames : CHARACTER_STRING // CHARACTER_STRING should not really be there.
+ | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead.
+ | name
+ ;
+ */
+
+/*
+name : IDENTIFIER
+ | #(DOT name
+ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | OPERATOR_SYMBOL
+ )
+ )
+ | #(INDEXED_COMPONENT name value_s)
+ | #(TIC name attribute_id)
+ ;
+ */
+
+def_designator
+ : cn:compound_name
+ {
+// kdDebug() << "def_designator cn:compound_name started" << endl;
+ if (m_addToStore) {
+// kdDebug() << "def_designator cn:compound_name m_addToStore" << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName (qtext (cn));
+ method->setFileName(m_fileName);
+// kdDebug() << "def_designator cn:compound_name method->setStartPosition(" << endl;
+ method->setStartPosition(#cn->getLine(), #cn->getColumn());
+
+ if (m_currentContainer == m_model->globalNamespace())
+ m_file->addFunction(method);
+ else
+ m_currentContainer->addFunction(method);
+ //FIXME: adymo: is this valid for CodeModel
+/* ParsedMethod *old = m_currentContainer->getMethod (method);
+ if (old) {
+ delete method;
+ method = old;
+ } else {
+ m_currentContainer->addMethod (method);
+ }*/
+ }
+ }
+ | definable_operator_symbol
+ ;
+
+/*
+function_tail : formal_part_opt subtype_mark
+ ;
+ */
+
+spec_decl_part
+ : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst)
+ | #(PACKAGE_SPECIFICATION ps:def_id
+ {
+ NamespaceDom psc = defineScope( #ps );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+ }
+ pkg_spec_part
+ {
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0) {
+ kdDebug() << "adastore: m_scopeStack is empty!" << endl;
+ m_scopeStack.append( m_model->globalNamespace() );
+ }
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setDeclarationEndsOnLine (endLine);
+ m_addToStore = false;
+ }
+ )
+ | #(PACKAGE_RENAMING_DECLARATION def_id renames)
+ ;
+
+pkg_spec_part :
+ basic_declarative_items_opt
+ private_declarative_items_opt
+ end_id_opt
+ ;
+
+private_declarative_items_opt
+ : ( { m_currentAccess = CodeModelItem::Protected; }
+ ( basic_decl_item | pragma )+
+ { m_currentAccess = CodeModelItem::Public; }
+ )?
+ ;
+
+/*
+task_type_or_single_decl
+ : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt)
+ | #(SINGLE_TASK_DECLARATION def_id task_definition_opt)
+ ;
+ */
+
+/*
+discriminant_specification
+ : #(DISCRIMINANT_SPECIFICATION defining_identifier_list
+ modifiers subtype_mark init_opt)
+ ;
+ */
+
+/*
+entry_declaration
+ : #(ENTRY_DECLARATION IDENTIFIER
+ discrete_subtype_def_opt formal_part_opt)
+ ;
+ */
+
+/*
+prot_op_decl
+ : entry_declaration
+ | #(PROCEDURE_DECLARATION def_id formal_part_opt)
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ | rep_spec
+ | pragma
+ ;
+ */
+
+/*
+prot_member_decl_s
+ : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* )
+ ;
+
+comp_decl
+ : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt)
+ ;
+ */
+
+/*
+// decl_common is shared between declarative_item and basic_decl_item.
+// decl_common only contains specifications.
+decl_common
+ : // type_def:
+ #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s)
+ | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range)
+ | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression)
+ | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt)
+ | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range)
+ | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt)
+ | array_type_declaration
+ | access_type_declaration
+ //
+ | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt)
+ // derived_or_private_or_record
+ | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind)
+ | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition)
+ | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind)
+ | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers)
+ | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition)
+ //
+ | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind)
+ | generic_decl
+ | use_clause
+ | rep_spec // enumeration_representation_clause only
+ | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name)
+ | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name)
+ | #(EXCEPTION_DECLARATION defining_identifier_list)
+ | #(NUMBER_DECLARATION defining_identifier_list expression)
+ | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers
+ array_type_definition init_opt)
+ | #(OBJECT_DECLARATION defining_identifier_list modifiers
+ subtype_ind init_opt)
+ ;
+ */
+
+/*
+id_and_discrim
+ : IDENTIFIER discrim_part_opt
+ ;
+ */
+
+/*
+enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL
+ ;
+ */
+
+/*
+array_type_declaration
+ : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition)
+ ;
+ */
+
+/*
+access_type_declaration
+ : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt)
+ | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail)
+ | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind)
+ ;
+ */
+
+
+generic_decl
+ : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames)
+ | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt gpd:def_id
+ {
+ NamespaceDom psc = defineScope( #gpd );
+ m_currentContainer = psc;
+ m_scopeStack.append( psc );
+ m_addToStore = true;
+ }
+ pkg_spec_part
+ {
+ m_scopeStack.remove(m_scopeStack.last());
+ if (m_scopeStack.count() == 0)
+ m_scopeStack.append( m_model->globalNamespace() );
+ m_currentContainer = m_scopeStack.last();
+ // m_currentContainer->setDeclarationEndsOnLine (endLine);
+ m_addToStore = false;
+ }
+ )
+ | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id
+ formal_part_opt renames)
+ | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt subprog_def_id
+ formal_part_opt)
+ | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator
+ function_tail renames)
+ | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt subprog_def_id
+ function_tail)
+ ;
+
+/*
+generic_formal_part_opt
+ : #(GENERIC_FORMAL_PART
+ ( pragma | use_clause | generic_formal_parameter )*
+ )
+ ;
+ */
+
+/*
+generic_formal_parameter
+ : // FORMAL_TYPE_DECLARATIONs:
+ #(FORMAL_DISCRETE_TYPE_DECLARATION def_id)
+ | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id)
+ | #(FORMAL_MODULAR_TYPE_DECLARATION def_id)
+ | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id)
+ | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id)
+ | #(FORMAL_FLOATING_POINT_DECLARATION def_id)
+ | formal_array_type_declaration
+ | formal_access_type_declaration
+ | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers)
+ | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind)
+ | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind)
+ | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt
+ subprogram_default_opt)
+ | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail
+ subprogram_default_opt)
+ | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt)
+ | parameter_specification
+ ;
+ */
+
+lib_subprog_decl_or_rename_or_inst_or_body
+ : { m_addToStore = true; }
+ ( subprog_decl
+ | procedure_body
+ | function_body
+ )
+ { m_addToStore = false; }
+ ;
+
+subprog_decl_or_rename_or_inst_or_body
+ : subprog_decl
+ | procedure_body
+ | function_body
+ ;
+
+
+/*
+// A declarative_item may appear in the declarative part of any body.
+declarative_item
+ : #(PACKAGE_BODY_STUB def_id)
+ | #(PACKAGE_BODY def_id pkg_body_part)
+ | spec_decl_part
+ | #(TASK_BODY_STUB def_id)
+ | #(TASK_BODY def_id body_part)
+ | task_type_or_single_decl
+ | #(PROTECTED_BODY_STUB def_id)
+ | #(PROTECTED_BODY def_id prot_op_bodies_opt)
+ | prot_type_or_single_decl
+ | subprog_decl_or_rename_or_inst_or_body
+ | decl_common
+ ;
+ */
+
+
+subprog_decl_or_body
+ : procedure_body
+ | #(PROCEDURE_DECLARATION subprog_def_id formal_part_opt)
+ | function_body
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ ;
+
+/*
+// Temporary, to be turned into just `qualified'.
+// We get away with it because `qualified' is always mentioned
+// together with `name'.
+// Only exception: `code_stmt', which is not yet implemented.
+name_or_qualified
+ : IDENTIFIER
+ | #(DOT name_or_qualified
+ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | OPERATOR_SYMBOL
+ )
+ )
+ | #(INDEXED_COMPONENT name_or_qualified value_s)
+ | #(TIC name_or_qualified
+ ( parenthesized_primary
+ | attribute_id
+ )
+ )
+ ;
+ */
+
+package_body
+ : #(PACKAGE_BODY id:def_id
+ /* TBD
+ { QString name (qtext (id));
+ }
+ */
+ pkg_body_part)
+ ;
+
+/*
+task_body : #(TASK_BODY def_id body_part)
+ ;
+ */
+
+/*
+protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt)
+ ;
+ */
+
diff --git a/languages/ada/ada.tree.g b/languages/ada/ada.tree.g
new file mode 100644
index 00000000..df167dcd
--- /dev/null
+++ b/languages/ada/ada.tree.g
@@ -0,0 +1,964 @@
+/*
+ * ANTLR Ada95 tree super grammar (base class)
+ *
+ * Oliver M. Kellogg <okellogg@users.sourceforge.net>
+ *
+ * $Id$
+ *
+ */
+
+
+options {
+ language="Cpp";
+}
+
+class AdaTreeParserSuper extends TreeParser;
+options {
+ importVocab=Ada;
+}
+
+// Compilation Unit: This is the start rule.
+
+compilation_unit
+ : context_items_opt ( library_item | subunit ) ( pragma )*
+ ;
+
+pragma : #(PRAGMA IDENTIFIER ( pragma_arg )* )
+ ;
+
+pragma_arg
+ : #(RIGHT_SHAFT IDENTIFIER expression)
+ | expression
+ ;
+
+context_items_opt
+ : #(CONTEXT_CLAUSE ( pragma | with_clause | use_clause )* )
+ ;
+
+with_clause
+ : #(WITH_CLAUSE ( compound_name )+ )
+ ;
+
+compound_name
+ : IDENTIFIER
+ | #(DOT compound_name IDENTIFIER)
+ ;
+
+use_clause
+ : #(USE_TYPE_CLAUSE ( subtype_mark )+ )
+ | #(USE_CLAUSE ( compound_name )+ )
+ ;
+
+subtype_mark
+ : compound_name
+ | #(TIC compound_name attribute_id)
+ ;
+
+attribute_id : RANGE
+ | DIGITS
+ | DELTA
+ | ACCESS
+ | IDENTIFIER
+ ;
+
+library_item :
+ #(LIBRARY_ITEM modifiers
+ ( subprog_decl_or_rename_or_inst_or_body
+ | #(PACKAGE_BODY def_id pkg_body_part)
+ | #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst)
+ | #(PACKAGE_SPECIFICATION def_id pkg_spec_part)
+ | #(PACKAGE_RENAMING_DECLARATION def_id renames)
+ | generic_decl
+ )
+ )
+ ;
+
+modifiers : #(MODIFIERS
+ ( ABSTRACT
+ | ACCESS
+ | ALIASED
+ | ALL
+ | CONSTANT
+ | IN
+ | LIMITED
+ | OUT
+ | PRIVATE
+ | PROTECTED
+ | REVERSE
+ | TAGGED
+ )*
+ // We can afford to be this loose because the parser
+ // has already fended off illegal usages, i.e. we can
+ // be sure that we are only dealing with permissible
+ // values for each usage context here.
+ // Only exception: PRIVATE as the prefix of private
+ // {generic|package|subprogram} library-level decl.
+ // The parser has let this in for bodies as well
+ // (which is not legal), so we need a semantic check.
+ )
+ ;
+
+id_opt : #(ID_OPT ( def_designator )? )
+ ;
+
+end_id_opt : #(END ( def_designator )? )
+ ;
+
+subprog_decl
+ : #(GENERIC_PROCEDURE_INSTANTIATION def_id generic_inst)
+ | #(PROCEDURE_RENAMING_DECLARATION def_id formal_part_opt renames)
+ | #(PROCEDURE_DECLARATION def_id formal_part_opt)
+ | #(PROCEDURE_BODY_STUB def_id formal_part_opt)
+ | #(ABSTRACT_PROCEDURE_DECLARATION def_id formal_part_opt)
+ | #(GENERIC_FUNCTION_INSTANTIATION def_designator generic_inst)
+ | #(FUNCTION_RENAMING_DECLARATION def_designator function_tail renames)
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ | #(FUNCTION_BODY_STUB def_designator function_tail)
+ | #(ABSTRACT_FUNCTION_DECLARATION def_id function_tail)
+ ;
+
+def_id : compound_name // Can afford looseness because parser is tight.
+ ;
+
+generic_inst : compound_name ( value_s )?
+ ;
+
+value : #(OTHERS expression)
+ | #(RIGHT_SHAFT ranged_expr_s expression)
+ | ranged_expr_s
+ ;
+
+ranged_expr_s
+ : #(PIPE ranged_expr_s ranged_expr)
+ | ranged_expr
+ ;
+
+ranged_expr
+ : #(DOT_DOT expression simple_expression)
+ | #(RANGE expression range)
+ | expression
+ ;
+
+range_constraint : #(RANGE_CONSTRAINT range)
+ ;
+
+range : ( range_dots
+ | range_attrib_ref
+ )
+ ;
+
+range_dots : #(DOT_DOT simple_expression simple_expression)
+ ;
+
+range_attrib_ref : #(RANGE_ATTRIBUTE_REFERENCE prefix ( expression )? )
+ ;
+
+prefix : IDENTIFIER
+ | #(DOT prefix ( ALL | IDENTIFIER ) )
+ | #(INDEXED_COMPONENT prefix value_s )
+ ;
+
+formal_part_opt : #(FORMAL_PART_OPT ( parameter_specification )* )
+ ;
+
+parameter_specification
+ : #(PARAMETER_SPECIFICATION defining_identifier_list modifiers
+ subtype_mark init_opt)
+ ;
+
+defining_identifier_list : #(DEFINING_IDENTIFIER_LIST ( IDENTIFIER )+ )
+ ;
+
+renames : CHARACTER_STRING // CHARACTER_STRING should not really be there.
+ | OPERATOR_SYMBOL // OPERATOR_SYMBOL should be used instead.
+ | name
+ ;
+
+name : IDENTIFIER
+ | #(DOT name
+ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | OPERATOR_SYMBOL
+ )
+ )
+ | #(INDEXED_COMPONENT name value_s)
+ | #(TIC name attribute_id)
+ ;
+
+definable_operator_symbol : OPERATOR_SYMBOL
+ ;
+
+parenthesized_primary
+ : #(PARENTHESIZED_PRIMARY ( NuLL | value_s extension_opt ) )
+ ;
+
+extension_opt : #(EXTENSION_OPT ( NuLL | value_s )? )
+ ;
+
+def_designator
+ : compound_name
+ | definable_operator_symbol
+ ;
+
+function_tail : formal_part_opt subtype_mark
+ ;
+
+spec_decl_part
+ : #(GENERIC_PACKAGE_INSTANTIATION def_id generic_inst)
+ | #(PACKAGE_SPECIFICATION def_id pkg_spec_part)
+ | #(PACKAGE_RENAMING_DECLARATION def_id renames)
+ ;
+
+pkg_spec_part
+ : basic_declarative_items_opt
+ private_declarative_items_opt
+ end_id_opt
+ ;
+
+basic_declarative_items_opt
+ : #(BASIC_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* )
+ ;
+
+private_declarative_items_opt
+ : #(PRIVATE_DECLARATIVE_ITEMS_OPT ( basic_decl_item )* )
+ ;
+
+basic_decl_item
+ : spec_decl_part
+ | task_type_or_single_decl
+ | prot_type_or_single_decl
+ | subprog_decl
+ | decl_common
+ ;
+
+task_type_or_single_decl
+ : #(TASK_TYPE_DECLARATION def_id discrim_part_opt task_definition_opt)
+ | #(SINGLE_TASK_DECLARATION def_id task_definition_opt)
+ ;
+
+task_definition_opt
+ : task_items_opt private_task_items_opt
+ ;
+
+discrim_part_opt
+ : #(DISCRIM_PART_OPT ( BOX | discriminant_specifications )? )
+ ;
+
+discriminant_specifications
+ : #(DISCRIMINANT_SPECIFICATIONS ( discriminant_specification )* )
+ ;
+
+discriminant_specification
+ : #(DISCRIMINANT_SPECIFICATION defining_identifier_list
+ modifiers subtype_mark init_opt)
+ ;
+
+init_opt : #(INIT_OPT ( expression )? )
+ ; // `expression' is of course much too loose;
+ // semantic checks are required in the usage contexts.
+
+task_items_opt
+ : #(TASK_ITEMS_OPT entrydecls_repspecs_opt)
+ ;
+
+entrydecls_repspecs_opt
+ : ( entry_declaration | pragma | rep_spec )*
+ ;
+
+entry_declaration
+ : #(ENTRY_DECLARATION IDENTIFIER
+ discrete_subtype_def_opt formal_part_opt)
+ ;
+
+discrete_subtype_def_opt
+ : #(DISCRETE_SUBTYPE_DEF_OPT ( discrete_subtype_definition )? )
+ ;
+
+discrete_subtype_definition // TBD
+ : range
+ | subtype_ind
+ ;
+
+rep_spec : #(RECORD_REPRESENTATION_CLAUSE subtype_mark align_opt comp_loc_s)
+ | #(AT_CLAUSE subtype_mark expression)
+ | #(ATTRIBUTE_DEFINITION_CLAUSE subtype_mark expression)
+ // attrib_def. Semantic check must ensure that the
+ // subtype_mark contains an attribute reference.
+ | #(ENUMERATION_REPESENTATION_CLAUSE local_enum_name enumeration_aggregate)
+ ;
+
+align_opt : #(MOD_CLAUSE_OPT ( expression )? )
+ ;
+
+comp_loc_s
+ : #(COMPONENT_CLAUSES_OPT
+ ( pragma
+ | subtype_mark expression range
+ )*
+ )
+ ;
+
+private_task_items_opt
+ : #(PRIVATE_TASK_ITEMS_OPT entrydecls_repspecs_opt )
+ ;
+
+prot_type_or_single_decl
+ : #(PROTECTED_TYPE_DECLARATION def_id discrim_part_opt protected_definition)
+ | #(SINGLE_PROTECTED_DECLARATION def_id protected_definition)
+ ;
+
+prot_private_opt : #(PROT_PRIVATE_OPT ( prot_member_decl_s )? )
+ ;
+
+protected_definition
+ : prot_op_decl_s prot_private_opt end_id_opt
+ ;
+
+prot_op_decl_s
+ : #(PROT_OP_DECLARATIONS ( prot_op_decl )* )
+ ;
+
+prot_op_decl
+ : entry_declaration
+ | #(PROCEDURE_DECLARATION def_id formal_part_opt)
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ | rep_spec
+ | pragma
+ ;
+
+prot_member_decl_s
+ : #(PROT_MEMBER_DECLARATIONS ( prot_op_decl | comp_decl )* )
+ ;
+
+comp_decl
+ : #(COMPONENT_DECLARATION defining_identifier_list component_subtype_def init_opt)
+ ;
+
+// decl_common is shared between declarative_item and basic_decl_item.
+// decl_common only contains specifications.
+decl_common
+ : // type_def:
+ #(ENUMERATION_TYPE_DECLARATION IDENTIFIER enum_id_s)
+ | #(SIGNED_INTEGER_TYPE_DECLARATION IDENTIFIER range)
+ | #(MODULAR_TYPE_DECLARATION IDENTIFIER expression)
+ | #(FLOATING_POINT_DECLARATION IDENTIFIER expression range_constraint_opt)
+ | #(ORDINARY_FIXED_POINT_DECLARATION IDENTIFIER expression range)
+ | #(DECIMAL_FIXED_POINT_DECLARATION IDENTIFIER expression expression range_constraint_opt)
+ | array_type_declaration
+ | access_type_declaration
+ //
+ | #(INCOMPLETE_TYPE_DECLARATION IDENTIFIER discrim_part_opt)
+ // derived_or_private_or_record
+ | #(PRIVATE_EXTENSION_DECLARATION id_and_discrim modifiers subtype_ind)
+ | #(DERIVED_RECORD_EXTENSION id_and_discrim modifiers subtype_ind record_definition)
+ | #(ORDINARY_DERIVED_TYPE_DECLARATION id_and_discrim subtype_ind)
+ | #(PRIVATE_TYPE_DECLARATION id_and_discrim modifiers)
+ | #(RECORD_TYPE_DECLARATION id_and_discrim modifiers record_definition)
+ //
+ | #(SUBTYPE_DECLARATION IDENTIFIER subtype_ind)
+ | generic_decl
+ | use_clause
+ | rep_spec // enumeration_representation_clause only
+ | #(EXCEPTION_RENAMING_DECLARATION def_id compound_name)
+ | #(OBJECT_RENAMING_DECLARATION def_id subtype_mark name)
+ | #(EXCEPTION_DECLARATION defining_identifier_list)
+ | #(NUMBER_DECLARATION defining_identifier_list expression)
+ | #(ARRAY_OBJECT_DECLARATION defining_identifier_list modifiers
+ array_type_definition init_opt)
+ | #(OBJECT_DECLARATION defining_identifier_list modifiers
+ subtype_ind init_opt)
+ ;
+
+id_and_discrim
+ : IDENTIFIER discrim_part_opt
+ ;
+
+enum_id_s : ( enumeration_literal_specification )+
+ ;
+
+enumeration_literal_specification : IDENTIFIER | CHARACTER_LITERAL
+ ;
+
+array_type_definition
+ : index_or_discrete_range_s component_subtype_def
+ ;
+
+range_constraint_opt : ( range_constraint )?
+ ;
+
+array_type_declaration
+ : #(ARRAY_TYPE_DECLARATION IDENTIFIER array_type_definition)
+ ;
+
+index_or_discrete_range_s
+ : index_or_discrete_range
+ | #(COMMA index_or_discrete_range_s index_or_discrete_range)
+ ;
+
+index_or_discrete_range
+ : #(DOT_DOT simple_expression simple_expression)
+ | #(RANGE simple_expression ( BOX | range) )
+ | simple_expression
+ ;
+
+component_subtype_def : modifiers subtype_ind // mod=aliased_opt
+ ;
+
+subtype_ind
+ : #(SUBTYPE_INDICATION subtype_mark constraint_opt)
+ ;
+
+constraint_opt
+ : ( range_constraint
+ | digits_constraint
+ | delta_constraint
+ | index_constraint
+ | discriminant_constraint
+ )?
+ ;
+
+digits_constraint
+ : #(DIGITS_CONSTRAINT expression range_constraint_opt)
+ ;
+
+delta_constraint
+ : #(DELTA_CONSTRAINT expression range_constraint_opt)
+ ;
+
+index_constraint
+ : #(INDEX_CONSTRAINT ( discrete_range )+ )
+ ;
+
+discrete_range
+ : range
+ | subtype_ind
+ ;
+
+discriminant_constraint
+ : #(DISCRIMINANT_CONSTRAINT ( discriminant_association )+ )
+ ;
+
+discriminant_association
+ : #(DISCRIMINANT_ASSOCIATION selector_names_opt expression)
+ ;
+
+selector_names_opt
+ : #(SELECTOR_NAMES_OPT ( selector_name )* )
+ ;
+
+selector_name : IDENTIFIER // TBD: sem pred
+ ;
+
+access_type_declaration
+ : #(ACCESS_TO_PROCEDURE_DECLARATION IDENTIFIER modifiers formal_part_opt)
+ | #(ACCESS_TO_FUNCTION_DECLARATION IDENTIFIER modifiers function_tail)
+ | #(ACCESS_TO_OBJECT_DECLARATION IDENTIFIER modifiers subtype_ind)
+ ;
+
+record_definition : ( component_list )?
+ ;
+
+component_list
+ : component_items ( variant_part )?
+ ;
+
+component_items
+ : #(COMPONENT_ITEMS ( pragma | comp_decl )* )
+ ;
+
+variant_part
+ : #(VARIANT_PART discriminant_direct_name variant_s)
+ ;
+
+discriminant_direct_name : IDENTIFIER // TBD: symtab lookup.
+ ;
+
+variant_s : #(VARIANTS ( variant )+ )
+ ;
+
+variant : #(VARIANT choice_s ( component_list )? )
+ ;
+
+choice_s : #(PIPE choice_s choice )
+ | choice
+ ;
+
+choice : OTHERS
+ | discrete_with_range
+ | expression
+ ;
+
+discrete_with_range : mark_with_constraint | range
+ ;
+
+mark_with_constraint
+ : #(MARK_WITH_CONSTRAINT subtype_mark range_constraint)
+ ;
+
+local_enum_name : IDENTIFIER // to be refined: do a symbol table lookup
+ ;
+
+enumeration_aggregate : ( value )*
+ ;
+
+generic_decl
+ : #(GENERIC_PACKAGE_RENAMING generic_formal_part_opt def_id renames)
+ | #(GENERIC_PACKAGE_DECLARATION generic_formal_part_opt def_id
+ pkg_spec_part)
+ | #(GENERIC_PROCEDURE_RENAMING generic_formal_part_opt def_id
+ formal_part_opt renames)
+ | #(GENERIC_PROCEDURE_DECLARATION generic_formal_part_opt def_id
+ formal_part_opt)
+ | #(GENERIC_FUNCTION_RENAMING generic_formal_part_opt def_designator
+ function_tail renames)
+ | #(GENERIC_FUNCTION_DECLARATION generic_formal_part_opt def_id
+ function_tail)
+ ;
+
+generic_formal_part_opt
+ : #(GENERIC_FORMAL_PART
+ ( pragma | use_clause | generic_formal_parameter )*
+ )
+ ;
+
+generic_formal_parameter
+ : // FORMAL_TYPE_DECLARATIONs:
+ #(FORMAL_DISCRETE_TYPE_DECLARATION def_id)
+ | #(FORMAL_SIGNED_INTEGER_TYPE_DECLARATION def_id)
+ | #(FORMAL_MODULAR_TYPE_DECLARATION def_id)
+ | #(FORMAL_DECIMAL_FIXED_POINT_DECLARATION def_id)
+ | #(FORMAL_ORDINARY_FIXED_POINT_DECLARATION def_id)
+ | #(FORMAL_FLOATING_POINT_DECLARATION def_id)
+ | formal_array_type_declaration
+ | formal_access_type_declaration
+ | #(FORMAL_PRIVATE_TYPE_DECLARATION id_part modifiers)
+ | #(FORMAL_ORDINARY_DERIVED_TYPE_DECLARATION id_part subtype_ind)
+ | #(FORMAL_PRIVATE_EXTENSION_DECLARATION id_part modifiers subtype_ind)
+ | #(FORMAL_PROCEDURE_DECLARATION def_id formal_part_opt
+ subprogram_default_opt)
+ | #(FORMAL_FUNCTION_DECLARATION def_designator function_tail
+ subprogram_default_opt)
+ | #(FORMAL_PACKAGE_DECLARATION def_id compound_name formal_package_actual_part_opt)
+ | parameter_specification
+ ;
+
+
+id_part : def_id discrim_part_opt
+ ;
+
+formal_array_type_declaration : array_type_declaration
+ ;
+
+formal_access_type_declaration : access_type_declaration
+ ;
+
+subprogram_default_opt : ( BOX | name )?
+ // #(SUBPROGRAM_DEFAULT_OPT ( BOX | name )? )
+ ;
+
+formal_package_actual_part_opt
+ : ( BOX | defining_identifier_list )?
+ ;
+
+subprog_decl_or_rename_or_inst_or_body
+ : subprog_decl
+ | procedure_body
+ | function_body
+ ;
+
+procedure_body
+ : #(PROCEDURE_BODY def_id formal_part_opt body_part)
+ ;
+
+function_body
+ : #(FUNCTION_BODY def_designator function_tail body_part)
+ ;
+
+body_part : declarative_part block_body end_id_opt
+ ;
+
+declarative_part
+ : #(DECLARATIVE_PART ( pragma | declarative_item )* )
+ ;
+
+// A declarative_item may appear in the declarative part of any body.
+declarative_item
+ : #(PACKAGE_BODY_STUB def_id)
+ | #(PACKAGE_BODY def_id pkg_body_part)
+ | spec_decl_part
+ | #(TASK_BODY_STUB def_id)
+ | #(TASK_BODY def_id body_part end_id_opt)
+ | task_type_or_single_decl
+ | #(PROTECTED_BODY_STUB def_id)
+ | #(PROTECTED_BODY def_id prot_op_bodies_opt end_id_opt)
+ | prot_type_or_single_decl
+ | subprog_decl_or_rename_or_inst_or_body
+ | decl_common
+ ;
+
+pkg_body_part : declarative_part block_body_opt end_id_opt
+ ;
+
+block_body_opt
+ : #(BLOCK_BODY_OPT ( handled_stmt_s )? )
+ ;
+
+prot_op_bodies_opt
+ : #(PROT_OP_BODIES_OPT
+ ( pragma | entry_body | subprog_decl_or_body )*
+ )
+ ;
+
+subprog_decl_or_body
+ : procedure_body
+ | #(PROCEDURE_DECLARATION def_id formal_part_opt)
+ | function_body
+ | #(FUNCTION_DECLARATION def_designator function_tail)
+ ;
+
+block_body : #(BLOCK_BODY handled_stmt_s)
+ ;
+
+handled_stmt_s
+ : #(HANDLED_SEQUENCE_OF_STATEMENTS statements except_handler_part_opt)
+ ;
+
+handled_stmts_opt
+ : #(HANDLED_STMTS_OPT ( statements except_handler_part_opt )? )
+ ;
+
+statements
+ : #(SEQUENCE_OF_STATEMENTS ( pragma | statement )+ )
+ ;
+
+statement : #(STATEMENT def_label_opt
+ ( null_stmt
+ | exit_stmt
+ | return_stmt
+ | goto_stmt
+ | delay_stmt
+ | abort_stmt
+ | raise_stmt
+ | requeue_stmt
+ | accept_stmt
+ | select_stmt
+ | if_stmt
+ | case_stmt
+ | loop_stmt id_opt
+ | block end_id_opt
+ | call_or_assignment
+ // | code_stmt // not yet implemented in parser
+ )
+ )
+ ;
+
+def_label_opt : #(LABEL_OPT ( IDENTIFIER )? )
+ ;
+
+null_stmt : NULL_STATEMENT
+ ;
+
+if_stmt : #(IF_STATEMENT cond_clause elsifs_opt else_opt)
+ ;
+
+cond_clause : #(COND_CLAUSE condition statements)
+ ;
+
+condition : expression
+ ;
+
+elsifs_opt : #(ELSIFS_OPT ( cond_clause )* )
+ ;
+
+else_opt : #(ELSE_OPT ( statements )? )
+ ;
+
+case_stmt : #(CASE_STATEMENT expression alternative_s)
+ ;
+
+alternative_s : ( case_statement_alternative )+
+ ;
+
+case_statement_alternative
+ : #(CASE_STATEMENT_ALTERNATIVE choice_s statements)
+ ;
+
+loop_stmt
+ : #(LOOP_STATEMENT iteration_scheme_opt statements)
+ ;
+
+iteration_scheme_opt
+ : #(ITERATION_SCHEME_OPT
+ ( #(WHILE condition)
+ | #(FOR IDENTIFIER modifiers discrete_subtype_definition)
+ )? // mod=reverse_opt
+ )
+ ;
+
+block : #(BLOCK_STATEMENT declare_opt block_body)
+ ;
+
+declare_opt
+ : #(DECLARE_OPT ( declarative_part )? )
+ ;
+
+exit_stmt
+ : #(EXIT_STATEMENT ( label_name )? ( WHEN condition )? ) // TBD !!!
+ ;
+
+label_name : IDENTIFIER
+ ;
+
+return_stmt
+ : #(RETURN_STATEMENT ( expression )? )
+ ;
+
+goto_stmt : #(GOTO_STATEMENT label_name)
+ ;
+
+call_or_assignment
+ : #(ASSIGNMENT_STATEMENT name expression)
+ | #(CALL_STATEMENT name)
+ ;
+
+entry_body
+ : #(ENTRY_BODY def_id entry_body_formal_part entry_barrier body_part)
+ ;
+
+entry_body_formal_part : entry_index_spec_opt formal_part_opt
+ ;
+
+entry_index_spec_opt
+ : #(ENTRY_INDEX_SPECIFICATION ( def_id discrete_subtype_definition )? )
+ ;
+
+entry_barrier : condition
+ ;
+
+entry_call_stmt
+ : #(ENTRY_CALL_STATEMENT name)
+ ;
+
+accept_stmt
+ : #(ACCEPT_STATEMENT def_id entry_index_opt formal_part_opt
+ handled_stmts_opt end_id_opt )
+ ;
+
+entry_index_opt
+ : #(ENTRY_INDEX_OPT ( expression )? )
+ ;
+
+delay_stmt
+ : #(DELAY_STATEMENT modifiers expression) //mod=until_opt
+ ;
+
+// SELECT_STATEMENT itself is not modeled since it is trivially
+// reconstructed:
+// select_statement ::= selective_accept | timed_entry_call
+// | conditional_entry_call | asynchronous_select
+//
+select_stmt
+ : #(ASYNCHRONOUS_SELECT triggering_alternative abortable_part)
+ | #(SELECTIVE_ACCEPT selective_accept)
+ | #(TIMED_ENTRY_CALL entry_call_alternative delay_alternative)
+ | #(CONDITIONAL_ENTRY_CALL entry_call_alternative statements)
+ ;
+
+triggering_alternative
+ : #(TRIGGERING_ALTERNATIVE
+ ( delay_stmt | entry_call_stmt ) stmts_opt
+ )
+ ;
+
+abortable_part
+ : #(ABORTABLE_PART stmts_opt)
+ ;
+
+entry_call_alternative
+ : #(ENTRY_CALL_ALTERNATIVE entry_call_stmt stmts_opt)
+ ;
+
+selective_accept : guard_opt select_alternative or_select_opt else_opt
+ ;
+
+guard_opt : #(GUARD_OPT ( condition ( pragma )* )? )
+ ;
+
+select_alternative
+ : accept_alternative
+ | delay_alternative
+ | TERMINATE_ALTERNATIVE
+ ;
+
+accept_alternative
+ : #(ACCEPT_ALTERNATIVE accept_stmt stmts_opt)
+ ;
+
+delay_alternative
+ : #(DELAY_ALTERNATIVE delay_stmt stmts_opt)
+ ;
+
+stmts_opt : ( pragma | statement )*
+ ;
+
+or_select_opt
+ : #(OR_SELECT_OPT ( guard_opt select_alternative )* )
+ ;
+
+abort_stmt
+ : #(ABORT_STATEMENT ( name )+ )
+ ;
+
+except_handler_part_opt
+ : #(EXCEPT_HANDLER_PART_OPT ( exception_handler )* )
+ ;
+
+exception_handler
+ : #(EXCEPTION_HANDLER identifier_colon_opt except_choice_s
+ statements
+ )
+ ;
+
+identifier_colon_opt
+ : #(IDENTIFIER_COLON_OPT ( IDENTIFIER )? )
+ ;
+
+except_choice_s
+ : #(PIPE except_choice_s exception_choice)
+ | exception_choice
+ ;
+
+exception_choice : compound_name
+ | OTHERS
+ ;
+
+raise_stmt
+ : #(RAISE_STATEMENT ( compound_name )? )
+ ;
+
+requeue_stmt
+ : #(REQUEUE_STATEMENT name ( ABORT )? )
+ ;
+
+operator_call : #(OPERATOR_SYMBOL value_s)
+ ;
+
+value_s : #(VALUES ( value )+ )
+ ;
+
+expression
+ : #(AND expression relation)
+ | #(AND_THEN expression relation)
+ | #(OR expression relation)
+ | #(OR_ELSE expression relation)
+ | #(XOR expression relation)
+ | relation
+ ;
+
+relation
+ : #(IN simple_expression range_or_mark)
+ | #(NOT_IN simple_expression range_or_mark)
+ | #(EQ simple_expression simple_expression)
+ | #(NE simple_expression simple_expression)
+ | #(LT_ simple_expression simple_expression)
+ | #(LE simple_expression simple_expression)
+ | #(GT simple_expression simple_expression)
+ | #(GE simple_expression simple_expression)
+ | simple_expression
+ ;
+
+range_or_mark
+ : range
+ | subtype_mark
+ ;
+
+simple_expression
+ : #(PLUS simple_expression signed_term)
+ | #(MINUS simple_expression signed_term)
+ | #(CONCAT simple_expression signed_term)
+ | signed_term
+ ;
+
+signed_term
+ : #(UNARY_PLUS term)
+ | #(UNARY_MINUS term)
+ | term
+ ;
+
+term : #(STAR term factor)
+ | #(DIV term factor)
+ | #(MOD term factor)
+ | #(REM term factor)
+ | factor
+ ;
+
+factor : #(NOT primary)
+ | #(ABS primary)
+ | #(EXPON primary primary)
+ | primary
+ ;
+
+primary :
+ ( name_or_qualified
+ | parenthesized_primary
+ | allocator
+ | NuLL
+ | NUMERIC_LIT
+ | CHARACTER_LITERAL
+ | CHAR_STRING
+ | operator_call
+ )
+ ;
+
+// Temporary, to be turned into just `qualified'.
+// We get away with it because `qualified' is always mentioned
+// together with `name'.
+// Only exception: `code_stmt', which is not yet implemented.
+name_or_qualified
+ : IDENTIFIER
+ | #(DOT name_or_qualified
+ ( ALL
+ | IDENTIFIER
+ | CHARACTER_LITERAL
+ | OPERATOR_SYMBOL
+ )
+ )
+ | #(INDEXED_COMPONENT name_or_qualified value_s)
+ | #(TIC name_or_qualified
+ ( parenthesized_primary
+ | attribute_id
+ )
+ )
+ ;
+
+allocator : #(ALLOCATOR name_or_qualified)
+ ;
+
+subunit : #(SUBUNIT compound_name
+ ( subprogram_body
+ | package_body
+ | task_body
+ | protected_body
+ )
+ )
+ ;
+
+subprogram_body
+ : procedure_body
+ | function_body
+ ;
+
+package_body : #(PACKAGE_BODY def_id pkg_body_part)
+ ;
+
+task_body : #(TASK_BODY def_id body_part)
+ ;
+
+protected_body : #(PROTECTED_BODY def_id prot_op_bodies_opt)
+ ;
+
+// TBD
+// code_stmt : #(CODE_STATEMENT qualified)
+// ;
+
diff --git a/languages/ada/ada_utils.cpp b/languages/ada/ada_utils.cpp
new file mode 100644
index 00000000..9630f058
--- /dev/null
+++ b/languages/ada/ada_utils.cpp
@@ -0,0 +1,69 @@
+/*
+ */
+#include <stdlib.h>
+#include <unistd.h>
+#include <iostream>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfile.h>
+#include <qregexp.h>
+
+#include <kdebug.h>
+
+#include "ada_utils.hpp"
+#include "adasupport.hpp"
+
+QString qtext (const RefAdaAST& n)
+{
+ return QString::fromLatin1 (text (n).c_str ());
+}
+
+QStringList qnamelist (const RefAdaAST& n)
+{
+ QString txt = qtext (n);
+ // kdDebug() << "qnamelist: input is " << txt << endl;
+ return QStringList::split ('.', txt);
+}
+
+QString ada_spec_filename (const QString& comp_unit_name)
+{
+ QString fn (comp_unit_name.lower ());
+
+ fn.replace (QRegExp("."), "-");
+ fn += ".ads";
+ return fn;
+}
+
+QString fq_specfilename (const QString& comp_unit_name)
+{
+ QString fname = ada_spec_filename (comp_unit_name);
+
+ if (QFile::exists (fname))
+ return fname;
+
+ QString adaincpath = getenv ("ADA_INCLUDE_PATH");
+ if (adaincpath.isNull ())
+ return QString::null;
+
+ QStringList dirs = QStringList::split (':', adaincpath);
+ QString fq_filename;
+ for (QStringList::Iterator it = dirs.begin (); it != dirs.end (); it++) {
+ fq_filename = *it;
+ if (! fq_filename.endsWith ("/"))
+ fq_filename += "/";
+ fq_filename += fname;
+ if (QFile::exists (fq_filename))
+ return fq_filename;
+ }
+ if (fname.startsWith ("ada-") ||
+ fname.startsWith ("text_io") ||
+ fname.startsWith ("system") ||
+ fname.startsWith ("unchecked_")) {
+ kdDebug () << "resolution of Ada predefined library is TBD" << endl;
+ } else {
+ kdDebug () << "Cannot find file " << fname << endl;
+ }
+ return QString::null;
+}
+
diff --git a/languages/ada/ada_utils.hpp b/languages/ada/ada_utils.hpp
new file mode 100644
index 00000000..b1df43dd
--- /dev/null
+++ b/languages/ada/ada_utils.hpp
@@ -0,0 +1,15 @@
+/*
+ */
+#ifndef ADA_UTILS_H
+#define ADA_UTILS_H
+
+#include <qstring.h>
+#include "AdaAST.hpp"
+
+QString qtext (const RefAdaAST& n);
+QStringList qnamelist (const RefAdaAST& n);
+QString ada_spec_filename (const QString& comp_unit_name);
+QString fq_specfilename (const QString& comp_unit_name);
+
+#endif
+
diff --git a/languages/ada/adasupport.cpp b/languages/ada/adasupport.cpp
new file mode 100644
index 00000000..6b877b7b
--- /dev/null
+++ b/languages/ada/adasupport.cpp
@@ -0,0 +1,168 @@
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stack>
+#include <string>
+#include <antlr/AST.hpp>
+#include "AdaParser.hpp"
+#include "AdaTokenTypes.hpp"
+#include "adasupport.hpp"
+
+#define eq !strcmp
+
+using namespace std;
+
+const RefAdaAST AdaAST::nullAdaAST(antlr::nullAST.get() );
+
+using namespace std;
+
+string text (const RefAdaAST& n)
+{
+ if (n == 0 || n == AdaAST::nullAdaAST)
+ return "";
+ string retval;
+ int type = n->getType();
+ if (type == AdaTokenTypes::DOT) {
+ const RefAdaAST& sibs = n->down ();
+ retval = text (sibs);
+ retval.append (".");
+ retval.append (text (sibs->right()));
+ } else {
+ retval = n->getText();
+ }
+ /*
+ const RefAdaAST& r = n->right();
+ if (r != 0 && r->getType () == AdaTokenTypes::DOT) {
+ retval.append (".");
+ retval.append (text (r->right()));
+ }
+ */
+ return retval;
+}
+
+int txteq (RefAdaAST n1, RefAdaAST n2)
+{
+ if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST)
+ return 0;
+ const char* s1 = n1->getText().c_str();
+ const char* s2 = n2->getText().c_str();
+ if (strcasecmp (s1, s2) != 0)
+ return 0;
+ n1 = n1->right ();
+ n2 = n2->right ();
+ if (!n1 || !n2 || n1 == antlr::nullAST || n2 == antlr::nullAST)
+ return 1;
+ if (n1->getType () == AdaTokenTypes::DOT)
+ if (n2->getType () == AdaTokenTypes::DOT)
+ return txteq (n1->right (), n2->right ());
+ else
+ return 0;
+ else if (n2->getType () == AdaTokenTypes::DOT)
+ return 0;
+ return 1;
+}
+
+std::stack<RefAdaAST> defid_stack;
+
+void AdaParser::push_def_id (const RefAdaAST& defid)
+{
+#ifdef __DEBUG__
+ string txt (text (defid));
+ printf ("push_def_id: pushing %s\n", txt.c_str());
+#endif
+ defid_stack.push (defid);
+}
+
+const RefAdaAST& AdaParser::pop_def_id ()
+{
+ if (defid_stack.size() == 0) {
+ fprintf (stderr, "pop_def_id() called on empty stack\n");
+ // return static_cast<RefAdaAST>(antlr::nullAST);
+ return AdaAST::nullAdaAST;
+ }
+ RefAdaAST& top = defid_stack.top ();
+#ifdef __DEBUG__
+ string txt (text (top));
+ printf ("pop_def_id: popping %s\n", txt.c_str());
+#endif
+ defid_stack.pop ();
+ return top;
+}
+
+bool AdaParser::end_id_matches_def_id (const RefAdaAST& endid)
+{
+ if (defid_stack.size() == 0)
+ return false;
+ RefAdaAST& top = defid_stack.top ();
+ string defid (text (top));
+ defid_stack.pop();
+ if (endid == 0 || endid == antlr::nullAST)
+ return false;
+ string txt (text (endid));
+ if (strcasecmp (defid.c_str (), txt.c_str ()) != 0) {
+ string errtxt ("End id ");
+ errtxt.append (txt);
+ errtxt.append (" does not match ");
+ errtxt.append (defid);
+ reportError (errtxt);
+ return false;
+ }
+#ifdef __DEBUG__
+ printf ("end_id_matches_def_id: popped %s\n", txt.c_str());
+#endif
+ return true;
+}
+
+char * strtolower (char *string)
+{
+ char *p = string;
+ if (!p)
+ return NULL;
+ while (*p)
+ {
+ if (isupper (*p))
+ *p = tolower (*p);
+ p++;
+ }
+ return string;
+}
+
+char * extracted_operator (const char *string)
+{
+ int len = strlen (string);
+ static char op[10];
+
+ if (len < 4 && len > 5 || *string != '"' || *(string + len - 1) != '"')
+ return NULL;
+
+ strcpy (op, string + 1);
+ op[len - 2] = '\0'; /* discard ending quotation mark */
+ strtolower (op);
+ return op;
+}
+
+bool AdaParser::definable_operator (const char *string)
+{ // operator_symbol sans "/="
+ char *op = extracted_operator (string);
+ if (op == NULL)
+ return false;
+ return
+ (eq (op, "=") ||
+ eq (op, "<") || eq (op, ">") ||
+ eq (op, "<=") || eq (op, ">=") ||
+ eq (op, "&") || eq (op, "**") ||
+ eq (op, "*") || eq (op, "/") || eq (op, "+") || eq (op, "-") ||
+ eq (op, "abs") || eq (op, "rem") || eq (op, "mod") ||
+ eq (op, "and") || eq (op, "or") || eq (op, "xor") || eq (op, "not"));
+}
+
+bool AdaParser::is_operator_symbol (const char *string)
+{
+ char *op;
+ if (definable_operator (string))
+ return true;
+ op = extracted_operator (string);
+ return (eq (op, "/="));
+}
+
diff --git a/languages/ada/adasupport.hpp b/languages/ada/adasupport.hpp
new file mode 100644
index 00000000..9d65e0e5
--- /dev/null
+++ b/languages/ada/adasupport.hpp
@@ -0,0 +1,13 @@
+/*
+ */
+#ifndef ADASUPPORT_H
+#define ADASUPPORT_H
+
+#include <string>
+#include "AdaAST.hpp"
+
+std::string text (const RefAdaAST& n);
+int txteq (RefAdaAST n1, RefAdaAST n2);
+
+#endif
+
diff --git a/languages/ada/adasupportpart.cpp b/languages/ada/adasupportpart.cpp
new file mode 100644
index 00000000..39ead02a
--- /dev/null
+++ b/languages/ada/adasupportpart.cpp
@@ -0,0 +1,376 @@
+
+#include <qfileinfo.h>
+#include <qlistview.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <qprogressbar.h>
+#include <qwhatsthis.h>
+
+#include <kgenericfactory.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+
+#include <fstream>
+#include <sstream>
+
+#include "kdevgenericfactory.h"
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "codemodel.h"
+#include "adasupportpart.h"
+#include "problemreporter.h"
+#include "backgroundparser.h"
+
+#include "AdaLexer.hpp"
+#include "AdaParser.hpp"
+#include "AdaStoreWalker.hpp"
+#include "AdaAST.hpp"
+
+#include <kdevplugininfo.h>
+
+enum { KDEV_DB_VERSION = 6 };
+enum { KDEV_PCS_VERSION = 6 };
+
+typedef KDevGenericFactory<AdaSupportPart> AdaSupportPartFactory;
+
+static const KDevPluginInfo data("kdevadasupport");
+K_EXPORT_COMPONENT_FACTORY (libkdevadasupport, AdaSupportPartFactory (data))
+
+
+struct AdaSupportPartData {
+ ProblemReporter* problemReporter;
+
+ AdaSupportPartData () : problemReporter (0) {}
+};
+
+AdaSupportPart::AdaSupportPart (QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport (&data, parent, name ? name : "AdaSupportPart"), d (new AdaSupportPartData())
+{
+ setInstance (AdaSupportPartFactory::instance ());
+
+ d->problemReporter = new ProblemReporter (this);
+// connect (core (), SIGNAL (configWidget (KDialogBase*)),
+// d->problemReporter, SLOT (configWidget (KDialogBase*)));
+ d->problemReporter->setIcon( SmallIcon("info") );
+ mainWindow( )->embedOutputView( d->problemReporter, i18n("Problems"), i18n("Problem reporter"));
+ QWhatsThis::add(d->problemReporter, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. "
+ "It displays errors reported by a language parser."));
+
+ setXMLFile ("adasupportpart.rc");
+
+ connect (core (), SIGNAL (projectOpened ()), this, SLOT (projectOpened ()));
+ connect (core (), SIGNAL (projectClosed ()), this, SLOT (projectClosed ()));
+
+ connect (partController (), SIGNAL (savedFile (const KURL&)),
+ this, SLOT (savedFile (const KURL&)));
+
+// connect (core (), SIGNAL (configWidget (KDialogBase*)), this, SLOT (configWidget (KDialogBase*)));
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ d->problemReporter, SLOT(configWidget(KDialogBase*)) );
+
+ // a small hack (robe)
+ //classStore ()->globalScope ()->setName ("(default packages)");
+ //classStore ()->addScope (classStore ()->globalScope ());
+ //classStore ()->globalScope ()->setName (QString::null);
+}
+
+
+AdaSupportPart::~AdaSupportPart ()
+{
+ mainWindow ()->removeView (d->problemReporter);
+ delete (d->problemReporter);
+ d->problemReporter = 0;
+
+ delete (d);
+ d = 0;
+}
+
+
+KDevLanguageSupport::Features AdaSupportPart::features ()
+{
+ return KDevLanguageSupport::Features
+ ( // TBD: Classes |
+ Functions | Namespaces);
+}
+
+void AdaSupportPart::projectOpened ()
+{
+ connect (project (), SIGNAL (addedFilesToProject (const QStringList &)),
+ this, SLOT (addedFilesToProject (const QStringList &)));
+ connect (project (), SIGNAL (removedFilesFromProject (const QStringList &)),
+ this, SLOT (removedFilesFromProject (const QStringList &)));
+ connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ),
+ this, SLOT( changedFilesInProject( const QStringList & ) ) );
+
+ QTimer::singleShot (0, this, SLOT (initialParse ()));
+}
+
+
+void AdaSupportPart::projectClosed ()
+{
+ saveProjectSourceInfo();
+}
+
+
+void AdaSupportPart::initialParse ()
+{
+ kdDebug () << "------------------------------------------> initialParse ()" << endl;
+
+ if (project ())
+ {
+ mainWindow()->statusBar()->message( i18n("Updating...") );
+ kapp->processEvents( );
+ kapp->setOverrideCursor (waitCursor);
+
+ int n = 0;
+ QStringList files = project ()->allFiles ();
+
+ QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow( )->statusBar( )->addWidget( bar );
+ bar->show( );
+
+ for (QStringList::Iterator it = files.begin (); it != files.end (); ++it) {
+ bar->setProgress( n++ );
+
+ QString fn = project ()->projectDirectory () + "/" + *it;
+ maybeParse (fn);
+ kapp->processEvents (500);
+ }
+
+ emit updatedSourceInfo();
+
+ mainWindow( )->statusBar( )->removeWidget( bar );
+ delete bar;
+
+ kapp->restoreOverrideCursor ();
+ mainWindow( )->statusBar( )->message( i18n( "Done" ), 2000 );
+/* mainWindow ()->statusBar ()->message
+ (i18n ("Found 1 problem", "Found %n problems", d->problemReporter->childCount ()));*/
+ }
+}
+
+QStringList AdaSupportPart::fileExtensions ()
+{
+ return QStringList () << "ads" << "adb";
+}
+
+void AdaSupportPart::maybeParse (const QString &fileName)
+{
+ kdDebug () << "AdaSupportPart::maybeParse: " << fileName << endl;
+
+ if (!fileExtensions ().contains (QFileInfo (fileName).extension ()))
+ return;
+
+// mainWindow ()->statusBar ()->message (i18n ("Parsing file: %1").arg (fileName));
+ parse (fileName);
+}
+
+
+void AdaSupportPart::addedFilesToProject (const QStringList &fileList)
+{
+ QStringList::ConstIterator it;
+
+ for (it = fileList.begin (); it != fileList.end (); ++it)
+ {
+ QString path = project ()->projectDirectory () + "/" + (*it);
+ maybeParse (path);
+ emit addedSourceInfo( path );
+ }
+}
+
+
+void AdaSupportPart::removedFilesFromProject (const QStringList &fileList)
+{
+ QStringList::ConstIterator it;
+
+ for (it = fileList.begin (); it != fileList.end (); ++it)
+ {
+ kdDebug () << "AdaSupportPart::removedFileFromProject () -- " << (*it) << endl;
+ QString path = project ()->projectDirectory () + "/" + (*it);
+
+ if( codeModel()->hasFile(path) )
+ {
+ emit aboutToRemoveSourceInfo( path );
+ codeModel()->removeFile( codeModel()->fileByName(path) );
+ }
+ }
+
+// emit updatedSourceInfo();
+}
+
+
+void AdaSupportPart::parse (const QString &fileName)
+{
+ kdDebug () << "AdaSupportPart::parse () -- " << fileName << endl;
+
+ std::ifstream stream (QFile::encodeName( fileName ).data());
+ QCString _fn = fileName.utf8 ();
+ std::string fn (_fn.data ());
+
+ AdaLexer lexer (stream);
+ lexer.setFilename (fn);
+ lexer.setProblemReporter (d->problemReporter);
+
+ AdaParser parser (lexer);
+ parser.setFilename (fn);
+ parser.setProblemReporter (d->problemReporter);
+
+ // make an ast factory
+ antlr::ASTFactory ast_factory;
+ // initialize and put it in the parser...
+ parser.initializeASTFactory (ast_factory);
+ parser.setASTFactory (&ast_factory);
+ // parser.setASTNodeType ("RefAdaAST");
+
+ try {
+ // old: parser.setASTNodeFactory (AdaAST::factory);
+ lexer.resetErrors ();
+ parser.resetErrors ();
+
+ parser.compilation_unit ();
+ int errors = lexer.numberOfErrors () + parser.numberOfErrors ();
+
+ RefAdaAST ast = RefAdaAST (parser.getAST ());
+
+ if (errors == 0 && ast != antlr::nullAST) {
+ kdDebug () << "-------------------> start StoreWalker" << endl;
+ AdaStoreWalker walker;
+ walker.setFileName (fileName);
+ walker.setCodeModel (codeModel ());
+ walker.compilation_unit (ast);
+ }
+ } catch (antlr::ANTLRException& ex) {
+ kdDebug () << "*exception*: " << ex.toString ().c_str () << endl;
+ d->problemReporter->reportError (QString::fromLatin1( ex.getMessage ().c_str() ),
+ fileName,
+ lexer.getLine (),
+ lexer.getColumn ());
+ }
+}
+
+void AdaSupportPart::parseContents (const QString& contents, const QString& fileName)
+{
+ kdDebug () << "AdaSupportPart::parseContents () -- " << fileName << endl;
+
+ QCString _fn = QFile::encodeName (fileName);
+ std::string fn (_fn.data ());
+
+ QCString text = contents.utf8 ();
+ std::istringstream stream ((const char *)text);
+
+ AdaLexer lexer (stream);
+ lexer.setFilename (fn);
+ lexer.setProblemReporter (d->problemReporter);
+
+ AdaParser parser (lexer);
+ parser.setFilename (fn);
+ parser.setProblemReporter (d->problemReporter);
+
+ try {
+ lexer.resetErrors ();
+ parser.resetErrors ();
+
+ parser.compilation_unit ();
+ int errors = lexer.numberOfErrors () + parser.numberOfErrors ();
+ Q_UNUSED( errors );
+
+ } catch (antlr::ANTLRException& ex) {
+ kdDebug () << "*exception*: " << ex.toString ().c_str () << endl;
+ d->problemReporter->reportError (QString::fromLatin1( ex.getMessage().c_str() ),
+ fileName,
+ lexer.getLine (),
+ lexer.getColumn ());
+ }
+}
+
+
+
+void AdaSupportPart::savedFile (const KURL& fileName)
+{
+ kdDebug () << "AdaSupportPart::savedFile ()" << endl;
+
+ if (project ()->allFiles ().contains (fileName.path().mid (project ()->projectDirectory ().length () + 1))) {
+ maybeParse (fileName.path());
+ emit updatedSourceInfo();
+ }
+}
+
+KMimeType::List AdaSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+
+ list << KMimeType::mimeType( "text/x-adasrc" );
+
+ return list;
+}
+
+//@todo adymo: implement source info loading and saving
+//hint: check javasupport for an example
+// and modify initialParse() method
+void AdaSupportPart::saveProjectSourceInfo( )
+{
+/* const FileList fileList = codeModel()->fileList();
+
+ if( !project() || fileList.isEmpty() )
+ return;
+
+ QFile f( project()->projectDirectory() + "/" + project()->projectName() + ".pcs" );
+ if( !f.open( IO_WriteOnly ) )
+ return;
+
+ QDataStream stream( &f );
+ QMap<QString, Q_ULONG> offsets;
+
+ QString pcs( "PCS" );
+ stream << pcs << KDEV_PCS_VERSION;
+
+ stream << int( fileList.size() );
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
+ const FileDom dom = (*it);
+#if QT_VERSION >= 0x030100
+ stream << dom->name() << m_timestamp[ dom->name() ].toTime_t();
+#else
+ stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]);
+#endif
+ offsets.insert( dom->name(), stream.device()->at() );
+ stream << (Q_ULONG)0; // dummy offset
+ }
+
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
+ const FileDom dom = (*it);
+ int offset = stream.device()->at();
+
+ dom->write( stream );
+
+ int end = stream.device()->at();
+
+ stream.device()->at( offsets[dom->name()] );
+ stream << offset;
+ stream.device()->at( end );
+ }*/
+}
+
+void AdaSupportPart::changedFilesInProject( const QStringList & fileList )
+{
+ QStringList files = fileList;
+
+ for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString path = project ()->projectDirectory () + "/" + *it ;
+
+ maybeParse( path );
+ emit addedSourceInfo( path );
+ }
+}
+
+
+#include "adasupportpart.moc"
diff --git a/languages/ada/adasupportpart.h b/languages/ada/adasupportpart.h
new file mode 100644
index 00000000..d9f2c45d
--- /dev/null
+++ b/languages/ada/adasupportpart.h
@@ -0,0 +1,50 @@
+//
+#ifndef __ADASUPPORTPART_H__
+#define __ADASUPPORTPART_H__
+
+#include "kdevlanguagesupport.h"
+
+#include <qwaitcondition.h>
+
+class AdaSupportPartData;
+class KDialogBase;
+class QStringList;
+
+class AdaSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+public:
+ AdaSupportPart (QObject *parent, const char *name, const QStringList &);
+ ~AdaSupportPart ();
+
+ void parseContents (const QString& contents, const QString& fileName);
+
+protected:
+ Features features ();
+ KMimeType::List mimeTypes ();
+ QStringList fileExtensions ();
+
+private slots:
+ void projectOpened ();
+ void projectClosed ();
+
+ void addedFilesToProject (const QStringList &fileList);
+ void removedFilesFromProject (const QStringList &fileList);
+ void changedFilesInProject( const QStringList &fileList );
+
+ void initialParse ();
+ void savedFile (const KURL&);
+
+private:
+ void maybeParse (const QString &fileName);
+ void parse (const QString &fileName);
+
+ void saveProjectSourceInfo( );
+private:
+ AdaSupportPartData* d;
+
+friend class ProblemReporter;
+};
+
+
+#endif
diff --git a/languages/ada/addclass.cpp b/languages/ada/addclass.cpp
new file mode 100644
index 00000000..5a5ccb13
--- /dev/null
+++ b/languages/ada/addclass.cpp
@@ -0,0 +1,351 @@
+#include <sys/stat.h>
+#include <sys/types.h>
+
+
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qtextedit.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+
+
+#include <klineedit.h>
+#include <kcombobox.h>
+#include <keditlistbox.h>
+#include <kdebug.h>
+
+
+#include "addclassdlg.h"
+
+
+#include "addclass.h"
+
+
+AddClassInfo::AddClassInfo()
+ : interfaceOpt(false), abstractOpt(false), finalOpt(false),
+ createConstructor(true), createMain(false)
+{
+}
+
+
+QString AddClassInfo::adaFileName() const
+{
+ QString dest = className;
+ dest.replace(QRegExp("\\."), "/");
+ return sourceDir + "/" + dest + ".ada";
+}
+
+
+AddClass::AddClass()
+{
+}
+
+
+void AddClass::setInfo(const AddClassInfo &info)
+{
+ m_info = info;
+}
+
+
+AddClassInfo &AddClass::info()
+{
+ return m_info;
+}
+
+
+void AddClass::setBaseClasses(const QStringList &classes)
+{
+ m_baseClasses = classes;
+}
+
+
+bool AddClass::showDialog()
+{
+ AddClassDlg dlg;
+
+ QString dir = m_info.projectDir;
+ if (m_info.sourceDir.isEmpty())
+ m_info.sourceDir = "src";
+ if (dir.isEmpty())
+ dir = m_info.sourceDir;
+ else
+ dir = dir + "/" + m_info.sourceDir;
+
+ dlg.SourcePath->setText(dir);
+ dlg.ClassName->setText(m_info.className);
+ dlg.Extends->insertStringList(m_baseClasses);
+ dlg.Extends->setEditText(m_info.extends);
+ dlg.Interface->setChecked(m_info.interfaceOpt);
+ dlg.Abstract->setChecked(m_info.abstractOpt);
+ dlg.Final->setChecked(m_info.finalOpt);
+
+ switch (m_info.visibility)
+ {
+ case AddClassInfo::ProtectedClass:
+ dlg.Protected->setChecked(true);
+ break;
+ case AddClassInfo::PrivateClass:
+ dlg.Private->setChecked(true);
+ break;
+ default:
+ dlg.Public->setChecked(true);
+ break;
+ }
+
+ dlg.Implements->insertStringList(m_info.implements);
+ dlg.Constructor->setChecked(m_info.createConstructor);
+ dlg.Main->setChecked(m_info.createMain);
+ dlg.Documentation->setText(m_info.documentation);
+ dlg.License->setEditText(m_info.license);
+
+ if (dlg.exec() == QDialog::Accepted)
+ {
+ m_info.projectDir = "";
+ m_info.sourceDir = dlg.SourcePath->text();
+ m_info.className = dlg.ClassName->text();
+ m_info.extends = dlg.Extends->currentText();
+ m_info.interfaceOpt = dlg.Interface->isChecked();
+ m_info.abstractOpt = dlg.Abstract->isChecked();
+ m_info.finalOpt = dlg.Final->isChecked();
+
+ if (dlg.Protected->isChecked())
+ m_info.visibility = AddClassInfo::ProtectedClass;
+ else if (dlg.Private->isChecked())
+ m_info.visibility = AddClassInfo::PrivateClass;
+ else
+ m_info.visibility = AddClassInfo::PublicClass;
+
+ m_info.implements = dlg.Implements->items();
+ m_info.createConstructor = dlg.Constructor->isChecked();
+ m_info.createMain = dlg.Main->isChecked();
+ m_info.documentation = dlg.Documentation->text();
+ m_info.license = dlg.License->currentText();
+
+ return true;
+ }
+
+ return false;
+}
+
+
+static bool makeDirs(const QString &dest)
+{
+ QStringList dirs = QStringList::split("/", dest);
+
+ QString d = "";
+
+ for (QStringList::Iterator it=dirs.begin(); it != dirs.end(); ++it)
+ {
+ d = d + "/" + *it;
+
+ QFileInfo fi(d);
+
+ if (fi.exists() && !fi.isDir())
+ {
+ /// @todo message to user!
+ return false;
+ }
+
+ if (!fi.exists())
+ if (::mkdir(QFile::encodeName(d), 0755) != 0)
+ return false;
+ }
+
+ return true;
+}
+
+
+bool AddClass::generate()
+{
+ QString code;
+
+ // license
+
+ if (!m_info.license.isEmpty())
+ {
+ code += "/*\n";
+
+ if (m_info.license == "GPL")
+ {
+ code +=
+ " * This program is free software; you can redistribute it and/or modify\n"
+ " * it under the terms of the GNU General Public License as published by\n"
+ " * the Free Software Foundation; either version 2 of the License, or\n"
+ " * (at your option) any later version.\n";
+ }
+ else if (m_info.license == "LGPL")
+ {
+ code +=
+ " * This program is free software; you can redistribute it and/or modify\n"
+ " * it under the terms of the GNU Library General Public License as\n"
+ " * published by the Free Software Foundation; either version 2 of the\n"
+ " * License, or (at your option) any later version.\n";
+ }
+ else if (m_info.license == "QPL")
+ {
+ code +=
+ " * This program may be distributed under the terms of the Q Public\n"
+ " * License as defined by Trolltech AS of Norway and appearing in the\n"
+ " * file LICENSE.QPL included in the packaging of this file.\n"
+ " *\n"
+ " * This program is distributed in the hope that it will be useful,\n"
+ " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+ }
+ else
+ {
+ code += " * This program is licensed under the " + m_info.license + ".\n";
+ code += " * Please see the documentation for details.\n";
+ }
+
+ code += " */\n\n\n";
+ }
+
+ // find class and package name
+ QString className, packageName;
+
+ int i = m_info.className.findRev('.');
+ if (i == -1)
+ {
+ packageName = "";
+ className = m_info.className;
+ }
+ else
+ {
+ packageName = m_info.className.left(i);
+ className = m_info.className.mid(i+1);
+ }
+
+ // package
+ if (!packageName.isEmpty())
+ code += "package " + packageName + ";\n\n\n";
+
+ // documentation
+
+ if (!m_info.documentation.isEmpty())
+ {
+ code += "/**\n";
+
+ QTextStream ts(&m_info.documentation, IO_ReadOnly);
+
+ while (!ts.eof())
+ code += " * " + ts.readLine() + "\n";
+
+ code += " */\n\n";
+ }
+
+ // visibility
+
+ switch (m_info.visibility)
+ {
+ case AddClassInfo::PrivateClass:
+ code += "private";
+ break;
+ case AddClassInfo::ProtectedClass:
+ code += "protected";
+ break;
+ default:
+ code += "public";
+ break;
+ }
+
+ // abstract, final
+
+ if (!m_info.interfaceOpt)
+ {
+ if (m_info.abstractOpt)
+ code += " abstract";
+ if (m_info.finalOpt)
+ code += " final";
+ }
+
+ // generate class/interface declaration
+
+ if (m_info.interfaceOpt)
+ code += " interface ";
+ else
+ code += " class ";
+
+ // classname
+
+ code += className;
+
+ // extends
+
+ if (!m_info.extends.isEmpty())
+ code += " extends " + m_info.extends;
+
+ // implements
+
+ if ((m_info.implements.count() > 0) && !m_info.interfaceOpt)
+ {
+ code += " implements ";
+ unsigned int c=0;
+ for (QStringList::Iterator it = m_info.implements.begin(); it != m_info.implements.end(); ++it, c++)
+ {
+ code += *it;
+ if (c+1 < m_info.implements.count())
+ code += ", ";
+ }
+ }
+
+ // body start
+
+ code += "\n{\n\n";
+
+ // default constructor
+
+ if (m_info.createConstructor && !m_info.interfaceOpt)
+ {
+ code += " " + className + "()\n";
+ code += " {\n";
+ if (!m_info.extends.isEmpty())
+ code += " super();\n";
+ code += " }\n\n";
+ }
+
+ // main method
+
+ if (m_info.createMain && !m_info.interfaceOpt)
+ {
+ code += " public static void main(String[] args)\n";
+ code += " {\n";
+ code += " }\n\n";
+ }
+
+ // body end
+
+ code += "};\n";
+
+ // create directories
+
+ QString dest = packageName;
+ dest.replace(QRegExp("\\."), "/");
+ dest = m_info.sourceDir + "/" + dest;
+
+ if (!makeDirs(dest))
+ return false;
+
+ // write out the file
+
+ if (QFile::exists(m_info.adaFileName()))
+ {
+ /// @todo ask before overwriting!
+ }
+
+ QFile of(m_info.adaFileName());
+ if (!of.open(IO_WriteOnly))
+ {
+ /// @todo message to user
+ return false;
+ }
+
+ QTextStream os(&of);
+ os << code;
+
+ of.close();
+
+ return true;
+}
diff --git a/languages/ada/addclass.h b/languages/ada/addclass.h
new file mode 100644
index 00000000..7bcfd370
--- /dev/null
+++ b/languages/ada/addclass.h
@@ -0,0 +1,55 @@
+#ifndef __ADDCLASS_H__
+#define __ADDCLASS_H__
+
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+
+class AddClassInfo
+{
+public:
+
+ AddClassInfo();
+
+ enum Visibility { PublicClass, ProtectedClass, PrivateClass};
+
+ QString className;
+ QString extends;
+ bool interfaceOpt, abstractOpt, finalOpt;
+ QString projectDir, sourceDir;
+ Visibility visibility;
+ QStringList implements;
+ bool createConstructor, createMain;
+ QString documentation;
+ QString license;
+
+ QString adaFileName() const;
+
+};
+
+
+class AddClass
+{
+public:
+
+ AddClass();
+
+ void setInfo(const AddClassInfo &info);
+ AddClassInfo &info();
+
+ void setBaseClasses(const QStringList &classes);
+ bool showDialog();
+
+ bool generate();
+
+
+private:
+
+ AddClassInfo m_info;
+ QStringList m_baseClasses;
+
+};
+
+
+#endif
diff --git a/languages/ada/addclassdlg.ui b/languages/ada/addclassdlg.ui
new file mode 100644
index 00000000..49900786
--- /dev/null
+++ b/languages/ada/addclassdlg.ui
@@ -0,0 +1,434 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>AddClassDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddClassDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>656</width>
+ <height>684</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Class</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KEditListBox" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Implements</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="title">
+ <string>&amp;Implements</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Class</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="KComboBox" row="2" column="1" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>Extends</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer row="4" column="4" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="3" column="2">
+ <property name="name">
+ <cstring>Abstract</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Abstract</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="1">
+ <property name="name">
+ <cstring>Interface</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Interface</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ClassName</cstring>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>ButtonGroup1</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Public</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Public</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Protected</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;rotected</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Private</cstring>
+ </property>
+ <property name="text">
+ <string>Pri&amp;vate</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="3" column="3">
+ <property name="name">
+ <cstring>Final</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Final</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>ClassName</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="4" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Extends:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>Extends</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="5">
+ <property name="name">
+ <cstring>BrowseSourcePath</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>SourcePath</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Source path:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>SourcePath</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Options</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Constructor</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create default constructor</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Main</cstring>
+ </property>
+ <property name="text">
+ <string>Create &amp;main method</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;License:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>License</cstring>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>LGPL</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>GPL</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>QPL</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>License</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Documentation</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="Line" row="4" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="3">
+ <property name="name">
+ <cstring>PushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ </widget>
+ <spacer row="5" column="2">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="5" column="0">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>Interface</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Abstract</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Interface</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Final</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>PushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>AddClassDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>PushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>AddClassDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>Interface</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Constructor</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Interface</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Main</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Interface</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Implements</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>SourcePath</tabstop>
+ <tabstop>BrowseSourcePath</tabstop>
+ <tabstop>ClassName</tabstop>
+ <tabstop>Extends</tabstop>
+ <tabstop>Interface</tabstop>
+ <tabstop>Abstract</tabstop>
+ <tabstop>Final</tabstop>
+ <tabstop>Public</tabstop>
+ <tabstop>Protected</tabstop>
+ <tabstop>Private</tabstop>
+ <tabstop>Constructor</tabstop>
+ <tabstop>Main</tabstop>
+ <tabstop>License</tabstop>
+ <tabstop>PushButton1</tabstop>
+ <tabstop>PushButton2</tabstop>
+ <tabstop>PushButton3</tabstop>
+</tabstops>
+<slots>
+ <slot>Public_toggled( bool )</slot>
+</slots>
+<includes>
+ <include location="global" impldecl="in implementation">keditlistbox.h</include>
+ <include location="global" impldecl="in implementation">kcombobox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/ada/app_templates/Makefile.am b/languages/ada/app_templates/Makefile.am
new file mode 100644
index 00000000..3da5006f
--- /dev/null
+++ b/languages/ada/app_templates/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = adahello
+
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/AdaIDE
+profiles_DATA = ada.appwizard
+
diff --git a/languages/ada/app_templates/ada.appwizard b/languages/ada/app_templates/ada.appwizard
new file mode 100644
index 00000000..2c31ec96
--- /dev/null
+++ b/languages/ada/app_templates/ada.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=adahello
diff --git a/languages/ada/app_templates/adahello/.kdev_ignore b/languages/ada/app_templates/adahello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/ada/app_templates/adahello/.kdev_ignore
diff --git a/languages/ada/app_templates/adahello/Makefile.am b/languages/ada/app_templates/adahello/Makefile.am
new file mode 100644
index 00000000..45e04df7
--- /dev/null
+++ b/languages/ada/app_templates/adahello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.adb app.kdevelop ada-Makefile app.kdevelop.filelist
+
+### no need to change below:
+template_DATA = adahello.kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+adahello.tar.gz:
+ $(TAR) -cf adahello.tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 adahello.tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = adahello.tar.gz adahello.png
+
+CLEANFILES = *.tar.gz
+
diff --git a/languages/ada/app_templates/adahello/ada-Makefile b/languages/ada/app_templates/adahello/ada-Makefile
new file mode 100644
index 00000000..134ffab6
--- /dev/null
+++ b/languages/ada/app_templates/adahello/ada-Makefile
@@ -0,0 +1,2 @@
+all:
+ gnatmake src/%{APPNAMELC}.adb -o %{APPNAMELC}
diff --git a/languages/ada/app_templates/adahello/ada-Makefile.am b/languages/ada/app_templates/adahello/ada-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/ada/app_templates/adahello/ada-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/ada/app_templates/adahello/ada-Makefile.cvs b/languages/ada/app_templates/adahello/ada-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/ada/app_templates/adahello/ada-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/ada/app_templates/adahello/adahello b/languages/ada/app_templates/adahello/adahello
new file mode 100644
index 00000000..73d82f8d
--- /dev/null
+++ b/languages/ada/app_templates/adahello/adahello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[fr]=Un simple programme de test Hello world
+Icon=adahello.png
+Category=Ada
+Comment=Generates a simple Hello world program in Ada
+Comment[fr]=Gnre un simple programme de test du type Hello world dans le language ADA.
+FileTemplates=adb,AdaStyle
+ShowFilesAfterGeneration=src/APPNAMELC.adb
diff --git a/languages/ada/app_templates/adahello/adahello.kdevtemplate b/languages/ada/app_templates/adahello/adahello.kdevtemplate
new file mode 100644
index 00000000..380f739b
--- /dev/null
+++ b/languages/ada/app_templates/adahello/adahello.kdevtemplate
@@ -0,0 +1,132 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[ca]=Simple programa Hello world
+Name[da]=Simpelt Goddag verden program
+Name[de]=Ein einfaches "Hello World"-Programm
+Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo» sencillo
+Name[et]=Lihtne "Tere, maailm" programm
+Name[eu]="Kaixo mundua" programa sinplea
+Name[fa]=برنامۀ سادۀ Hello world
+Name[fr]=Programme « Bonjour monde » simple
+Name[ga]=Ríomhchlár simplí "Hello World"
+Name[gl]=Programa sinxelo Ola mundo
+Name[hu]=Egyszerű Hello world program
+Name[it]=Semplice programma di "Hello world"
+Name[ja]=簡単な Hello world プログラム
+Name[ms]=Program Hello World mudah
+Name[nds]=En eenfach "Moin Welt"-Programm
+Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Eenvoudig 'Hello World' programma
+Name[pl]=Prosty program witaj świecie
+Name[pt]=Programa simples Olá Mundo
+Name[pt_BR]=Programa simples Olá Mundo
+Name[ru]=Простая программа Hello world
+Name[sk]=Jednoduchý "Ahoj svet" program
+Name[sl]=Preprost program Hello world
+Name[sr]=Једноставан „Здраво свете“ програм
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program
+Name[sv]=Enkelt Hello world-program
+Name[tr]=Basit Merhaba dünya programı
+Name[zh_CN]=简单的 Hello world 程序
+Name[zh_TW]=簡單的 Hello world 程式
+Icon=adahello.png
+Category=Ada
+Comment=Generates a simple Hello world program in Ada
+Comment[ca]=Genera un simple programa de Hello world en Ada
+Comment[da]=Genererer et simpelt Goddag verden program i Ada
+Comment[de]=Erstellt ein einfaches "Hello World"-Program in Ada
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε Ada
+Comment[es]=Genera un programa «Hola mundo» sencillo en Ada
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine ADA-s
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Adan
+Comment[fa]=یک برنامۀ سادۀ Hello world در آدا تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Ada
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí "Hello World" in Ada
+Comment[gl]=Xera un programa sinxelo Hello world en Ada
+Comment[hu]=Létrehoz egy egyszerű Hello world programot ADA nyelven
+Comment[it]=Genera un semplice programma di "Hello world" in Ada
+Comment[ja]=Ada で簡単な Hello world プログラムを作成します
+Comment[ms]=Menjana program Hello World mudah dalam Ada
+Comment[nds]=Stellt in Ada en eenfach "Moin Welt"-Programm op
+Comment[ne]=एडामा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig Hello World programma in Ada
+Comment[pl]=Generuje prosty program Witaj świecie w Adzie
+Comment[pt]=Gera um programa simples de Olá Mundo em Ada
+Comment[pt_BR]=Gera um programa simples de Olá Mundo em Ada
+Comment[ru]=Создание простой программы Hello world на Ada
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Ada
+Comment[sl]=Ustvari preprost program Hello world v Adi
+Comment[sr]=Прави једноставан „Здраво свете“ у Ada-и
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Ada-i
+Comment[sv]=Skapar ett enkelt Hello world-program i Ada
+Comment[tr]=Ada dilinde basit bir Merhaba Dünya programı üretir.
+Comment[zh_CN]=以 Ada 语言生成简单的 Hello world 程序
+Comment[zh_TW]=產生 Ada 的 Hello world 程式
+FileTemplates=adb,AdaStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.adb
+Archive=adahello.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/ada-Makefile
+Dest=%{dest}/Makefile
+
+[FILE3]
+Type=install
+Source=%{src}/app.kdevelop.filelist
+Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE4]
+Type=install
+Source=%{src}/main.adb
+Dest=%{dest}/src/%{APPNAMELC}.adb
+
+[MSG]
+Type=message
+Comment=A simple "Hello world" program in ADA was created in %{dest}
+Comment[ca]=Un simple programa de "Hello world" en ADA ha estat creat en %{dest}
+Comment[da]=Et simpelt "Goddag verden" program i ADA blev oprettet i %{dest}
+Comment[de]=Ein einfaches "Hello world" Programm in Ada wurde in %{dest} erstellt
+Comment[el]=Ένα απλό πρόγραμμα "Γεια σου Κόσμε" σε ADA δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» sencillo en ADA ha sido creado en %{dest}
+Comment[et]=Lihtne "Tere, maailm" programm ADA-s loodi asukohta %{dest}
+Comment[eu]="Kaixo mundua" programa sinple bat sortu da ADAn hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در آدا در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » simple en ADA a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" ADA i %{dest}
+Comment[gl]=Creouse un programa sinxelo "Ola mundo" en ADA en %{dest}
+Comment[hu]=Létrejött egy egyszerű Hello world program ADA nyelven itt: %{dest}
+Comment[it]=È stato creato un semplice programma di "Hello world" in ADA in %{dest}
+Comment[ja]=Ada で記述された "Hello world" プログラムを %{dest} に作成しました
+Comment[ms]=Program "Hello World" mudah dalam ada telah dicipta dalam %{dest}
+Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Ada opstellt
+Comment[ne]=एउटा साधारण "हेल्लो वोल्ड" कार्यक्रम एडामा %{dest} सिर्जना गरिएको थियो
+Comment[nl]=Een eenvoudig "Hello World" programma in Ada is aangemaakt in %{dest}
+Comment[pl]=Prosty program "Witaj świecie" w języku ADA został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples "Olá mundo" em ADA em %{dest}
+Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em ADA em %{dest}
+Comment[ru]=Простая программа "Hello world" на ADA создана в %{dest}
+Comment[sk]=Jednoduchý "Ahoj svet" program v Ada bol vytvorený v %{dest}
+Comment[sl]=Preprost program »Hello world« v jeziku ADA je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан „Здраво свете“ програм у Ada-и је направљен у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo svete“ program u Ada-i je napravljen u %{dest}
+Comment[sv]=Ett enkelt "Hello world"-program in Ada skapades i %{dest}
+Comment[tr]=ADA'da basit bir "Merhaba Dünya" programı %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了 Ada 语言的“Hello world”程序
+Comment[zh_TW]=Ada 的 Hello world 程式已產生在 ${dest}
diff --git a/languages/ada/app_templates/adahello/adahello.png b/languages/ada/app_templates/adahello/adahello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/ada/app_templates/adahello/adahello.png
Binary files differ
diff --git a/languages/ada/app_templates/adahello/app.kdevelop b/languages/ada/app_templates/adahello/app.kdevelop
new file mode 100644
index 00000000..b430f6e8
--- /dev/null
+++ b/languages/ada/app_templates/adahello/app.kdevelop
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Ada</primarylanguage>
+ <keywords>
+ <keyword>Ada</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <directoryradio>build</directoryradio>
+ <customdirectory>/</customdirectory>
+ <mainprogram>%{APPNAMELC}</mainprogram>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>false</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ </kdevcustomproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ads"/>
+ <type ext="adb"/>
+ <type ext="ada"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/ada/app_templates/adahello/app.kdevelop.filelist b/languages/ada/app_templates/adahello/app.kdevelop.filelist
new file mode 100644
index 00000000..e5b69ca2
--- /dev/null
+++ b/languages/ada/app_templates/adahello/app.kdevelop.filelist
@@ -0,0 +1 @@
+src/%{APPNAMELC}.adb \ No newline at end of file
diff --git a/languages/ada/app_templates/adahello/configure.in b/languages/ada/app_templates/adahello/configure.in
new file mode 100644
index 00000000..a8f81958
--- /dev/null
+++ b/languages/ada/app_templates/adahello/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AM_CONFIG_HEADER(config.h)
+
+AC_LANG_ADA
+AC_PROG_ADA
+AC_ADA_LIBRARY_LDFLAGS
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/ada/app_templates/adahello/main.adb b/languages/ada/app_templates/adahello/main.adb
new file mode 100644
index 00000000..e2c6f5da
--- /dev/null
+++ b/languages/ada/app_templates/adahello/main.adb
@@ -0,0 +1,8 @@
+with Text_IO;
+
+procedure Main is
+
+begin
+ Text_IO.Put_Line ("Hello World");
+end Main;
+
diff --git a/languages/ada/app_templates/adahello/src-Makefile.am b/languages/ada/app_templates/adahello/src-Makefile.am
new file mode 100644
index 00000000..06291dbf
--- /dev/null
+++ b/languages/ada/app_templates/adahello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.adb
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/ada/backgroundparser.cpp b/languages/ada/backgroundparser.cpp
new file mode 100644
index 00000000..f94f3216
--- /dev/null
+++ b/languages/ada/backgroundparser.cpp
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "backgroundparser.h"
+#include "problemreporter.h"
+#include "AdaLexer.hpp"
+#include "AdaParser.hpp"
+#include "AdaAST.hpp"
+#include <kdebug.h>
+#include <qfile.h>
+
+#include <config.h>
+
+#include <sstream>
+
+BackgroundParser::BackgroundParser( ProblemReporter* reporter,
+ const QString& source,
+ const QString& filename )
+ : m_reporter( reporter ),
+ m_source( source.unicode(), source.length() ),
+ m_fileName( filename )
+{
+}
+
+BackgroundParser::~BackgroundParser()
+{
+}
+
+void BackgroundParser::run()
+{
+ QCString _fn = QFile::encodeName(m_fileName);
+ std::string fn( _fn.data() );
+
+ std::istringstream stream( m_source.utf8().data() );
+
+ AdaLexer lexer( stream );
+ lexer.setFilename( fn );
+ lexer.setProblemReporter( m_reporter );
+
+ AdaParser parser( lexer );
+ parser.setFilename( fn );
+ parser.setProblemReporter( m_reporter );
+
+ // make an ast factory
+ antlr::ASTFactory ast_factory;
+ // initialize and put it in the parser...
+ parser.initializeASTFactory (ast_factory);
+ parser.setASTFactory (&ast_factory);
+ // parser.setASTNodeType ("RefAdaAST");
+
+ try{
+ lexer.resetErrors();
+ parser.resetErrors();
+
+ parser.compilation_unit();
+
+ } catch( antlr::ANTLRException& ex ){
+ kdDebug() << "*exception*: " << ex.toString().c_str() << endl;
+ m_reporter->reportError( QString::fromLatin1( ex.getMessage().c_str() ),
+ m_fileName,
+ lexer.getLine(),
+ lexer.getColumn() );
+ }
+
+ kdDebug() << "BackgroundParser::run() FINISHED." << endl;
+}
+
+
+
diff --git a/languages/ada/backgroundparser.h b/languages/ada/backgroundparser.h
new file mode 100644
index 00000000..0b4eef16
--- /dev/null
+++ b/languages/ada/backgroundparser.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2002 by Roberto Raggi
+ * roberto@kdevelop.org
+ * Copyright (C) 2003 Oliver Kellogg
+ * okellogg@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.
+ */
+
+#ifndef BACKGROUNDPARSER_H
+#define BACKGROUNDPARSER_H
+
+#include <qthread.h>
+#include <qstring.h>
+#include <kdebug.h>
+
+class ProblemReporter;
+
+class BackgroundParser: public QThread{
+public:
+ BackgroundParser( ProblemReporter* reporter,
+ const QString& source,
+ const QString& filename );
+ virtual ~BackgroundParser();
+
+ virtual void run();
+
+private:
+ ProblemReporter* m_reporter;
+ QString m_source;
+ QString m_fileName;
+};
+
+#endif
diff --git a/languages/ada/configproblemreporter.ui b/languages/ada/configproblemreporter.ui
new file mode 100644
index 00000000..75f35b1f
--- /dev/null
+++ b/languages/ada/configproblemreporter.ui
@@ -0,0 +1,89 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConfigureProblemReporter</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigureProblemReporter</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>390</width>
+ <height>304</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>bgParserCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable background parsing</string>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>delaySlider</cstring>
+ </property>
+ <property name="maxValue">
+ <number>2000</number>
+ </property>
+ <property name="lineStep">
+ <number>250</number>
+ </property>
+ <property name="pageStep">
+ <number>500</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Right</enum>
+ </property>
+ <property name="tickInterval">
+ <number>250</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>bgParserCheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>bgParserCheckbox_toggled(bool)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">configproblemreporter.ui.h</include>
+</includes>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>accept()</slot>
+ <slot>bgParserCheckbox_toggled( bool b )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/ada/configproblemreporter.ui.h b/languages/ada/configproblemreporter.ui.h
new file mode 100644
index 00000000..a336965c
--- /dev/null
+++ b/languages/ada/configproblemreporter.ui.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include <kconfig.h>
+#include <kapplication.h>
+
+void ConfigureProblemReporter::init()
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ bgParserCheckbox->setChecked( config->readBoolEntry("EnableAdaBgParser", true) );
+ delaySlider->setEnabled( bgParserCheckbox->isChecked() );
+ delaySlider->setValue( config->readNumEntry("BgParserDelay", 500) );
+}
+
+void ConfigureProblemReporter::destroy()
+{
+}
+
+void ConfigureProblemReporter::accept()
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ config->writeEntry( "EnableAdaBgParser", bgParserCheckbox->isChecked() );
+ if( bgParserCheckbox->isChecked() )
+ config->writeEntry( "BgParserDelay", delaySlider->value() );
+ config->sync();
+}
+
+
+void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b )
+{
+ delaySlider->setEnabled( b );
+}
diff --git a/languages/ada/configure.in.in b/languages/ada/configure.in.in
new file mode 100644
index 00000000..be677e4b
--- /dev/null
+++ b/languages/ada/configure.in.in
@@ -0,0 +1,4 @@
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADERS(sstream)
+AC_LANG_RESTORE
diff --git a/languages/ada/doc/Makefile.am b/languages/ada/doc/Makefile.am
new file mode 100644
index 00000000..ff5f8a32
--- /dev/null
+++ b/languages/ada/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = ada.toc ada_bugs_gcc.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/ada/doc/ada.toc b/languages/ada/doc/ada.toc
new file mode 100644
index 00000000..434a5b6a
--- /dev/null
+++ b/languages/ada/doc/ada.toc
@@ -0,0 +1,130 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Ada</title>
+<base href="http://www.adahome.com/rm95"/>
+<tocsect1 name="General" url="rm9x-01.html">
+ <tocsect2 name="Scope" url="rm9x-01-01.html"></tocsect2>
+ <tocsect2 name="Normative References" url="rm9x-01-02.html"></tocsect2>
+ <tocsect2 name="Definitions" url="rm9x-01-03.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Lexical Elements" url="rm9x-02.html">
+ <tocsect2 name="Character Set" url="rm9x-02-01.html"></tocsect2>
+ <tocsect2 name="Lexical Elements, Separators, and Delimiters" url="rm9x-02-02.html"></tocsect2>
+ <tocsect2 name="Identifiers" url="rm9x-02-03.html"></tocsect2>
+ <tocsect2 name="Numeric Literals" url="rm9x-02-04.html"></tocsect2>
+ <tocsect2 name="Character Literals" url="rm9x-02-05.html"></tocsect2>
+ <tocsect2 name="String Literals" url="rm9x-02-06.html"></tocsect2>
+ <tocsect2 name="Comments" url="rm9x-02-07.html"></tocsect2>
+ <tocsect2 name="Pragmas" url="rm9x-02-08.html"></tocsect2>
+ <tocsect2 name="Reserved Words" url="rm9x-02-09.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Declarations and Types" url="rm9x-03.html">
+ <tocsect2 name="Declarations" url="rm9x-03-01.html"></tocsect2>
+ <tocsect2 name="Types and Subtypes" url="rm9x-03-02.html"></tocsect2>
+ <tocsect2 name="Objects and Named Numbers" url="rm9x-03-03.html"></tocsect2>
+ <tocsect2 name="Derived Types and Classes" url="rm9x-03-04.html"></tocsect2>
+ <tocsect2 name="Scalar Types" url="rm9x-03-05.html"></tocsect2>
+ <tocsect2 name="Array Types" url="rm9x-03-06.html"></tocsect2>
+ <tocsect2 name="Discriminants" url="rm9x-03-07.html"></tocsect2>
+ <tocsect2 name="Record Types" url="rm9x-03-08.html"></tocsect2>
+ <tocsect2 name="Tagged Types and Type Extensions" url="rm9x-03-09.html"></tocsect2>
+ <tocsect2 name="Access Types" url="rm9x-03-10.html"></tocsect2>
+ <tocsect2 name="Declarative Parts" url="rm9x-03-11.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Names and Expressions" url="rm9x-04.html">
+ <tocsect2 name="Names" url="rm9x-04-01.html"></tocsect2>
+ <tocsect2 name="Literals" url="rm9x-04-02.html"></tocsect2>
+ <tocsect2 name="Aggregates" url="rm9x-04-03.html"></tocsect2>
+ <tocsect2 name="Expressions" url="rm9x-04-04.html"></tocsect2>
+ <tocsect2 name="Operators and Expression Evaluation" url="rm9x-04-05.html"></tocsect2>
+ <tocsect2 name="Type Conversions" url="rm9x-04-06.html"></tocsect2>
+ <tocsect2 name="Qualified Expressions" url="rm9x-04-07.html"></tocsect2>
+ <tocsect2 name="Allocators" url="rm9x-04-08.html"></tocsect2>
+ <tocsect2 name="Static Expressions and Static Subtypes" url="rm9x-04-09.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Statements" url="rm9x-05.html">
+ <tocsect2 name="Simple and Compound Statements - Sequences of Statements" url="rm9x-05-01.html"></tocsect2>
+ <tocsect2 name="Assignment Statements" url="rm9x-05-02.html"></tocsect2>
+ <tocsect2 name="If Statements" url="rm9x-05-03.html"></tocsect2>
+ <tocsect2 name="Case Statements" url="rm9x-05-04.html"></tocsect2>
+ <tocsect2 name="Loop Statements" url="rm9x-05-05.html"></tocsect2>
+ <tocsect2 name="Block Statements" url="rm9x-05-06.html"></tocsect2>
+ <tocsect2 name="Exit Statements" url="rm9x-05-07.html"></tocsect2>
+ <tocsect2 name="Goto Statements" url="rm9x-05-08.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Subprograms" url="rm9x-06.html">
+ <tocsect2 name="Subprogram Declarations" url="rm9x-06-01.html"></tocsect2>
+ <tocsect2 name="Formal Parameter Modes" url="rm9x-06-02.html"></tocsect2>
+ <tocsect2 name="Subprogram Bodies" url="rm9x-06-03.html"></tocsect2>
+ <tocsect2 name="Subprogram Calls" url="rm9x-06-04.html"></tocsect2>
+ <tocsect2 name="Return Statements" url="rm9x-06-05.html"></tocsect2>
+ <tocsect2 name="Overloading of Operators" url="rm9x-06-06.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Packages" url="rm9x-07.html">
+ <tocsect2 name="Package Specifications and Declarations" url="rm9x-07-01.html"></tocsect2>
+ <tocsect2 name="Package Bodies" url="rm9x-07-02.html"></tocsect2>
+ <tocsect2 name="Private Types and Private Extensions" url="rm9x-07-03.html"></tocsect2>
+ <tocsect2 name="Deferred Constants" url="rm9x-07-04.html"></tocsect2>
+ <tocsect2 name="Limited Types" url="rm9x-07-05.html"></tocsect2>
+ <tocsect2 name="User-Defined Assignment and Finalization" url="rm9x-07-06.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Visibility Rules" url="rm9x-08.html">
+ <tocsect2 name="Declarative Region" url="rm9x-08-01.html"></tocsect2>
+ <tocsect2 name="Scope of Declarations" url="rm9x-08-02.html"></tocsect2>
+ <tocsect2 name="Visibility" url="rm9x-08-03.html"></tocsect2>
+ <tocsect2 name="Use Clauses" url="rm9x-08-04.html"></tocsect2>
+ <tocsect2 name="Renaming Declarations" url="rm9x-08-05.html"></tocsect2>
+ <tocsect2 name="The Context of Overload Resolution" url="rm9x-08-06.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Tasks and Synchronization" url="rm9x-09.html">
+ <tocsect2 name="Task Units and Task Objects" url="rm9x-09-01.html"></tocsect2>
+ <tocsect2 name="Task Execution - Task Activation" url="rm9x-09-02.html"></tocsect2>
+ <tocsect2 name="Task Dependence - Termination of Tasks" url="rm9x-09-03.html"></tocsect2>
+ <tocsect2 name="Protected Units and Protected Objects" url="rm9x-09-04.html"></tocsect2>
+ <tocsect2 name="Intertask Communication" url="rm9x-09-05.html"></tocsect2>
+ <tocsect2 name="Delay Statements, Duration, and Time" url="rm9x-09-06.html"></tocsect2>
+ <tocsect2 name="Select Statements" url="rm9x-09-07.html"></tocsect2>
+ <tocsect2 name="Abort of a Task - Abort of a Sequence of Statements" url="rm9x-09-08.html"></tocsect2>
+ <tocsect2 name="Task and Entry Attributes" url="rm9x-09-09.html"></tocsect2>
+ <tocsect2 name="Shared Variables" url="rm9x-09-10.html"></tocsect2>
+ <tocsect2 name="Example of Tasking and Synchronization " url="rm9x-09-11.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Program Structure and Compilation Issues" url="rm9x-10.html">
+ <tocsect2 name="Separate Compilation" url="rm9x-10-01.html"></tocsect2>
+ <tocsect2 name="Program Execution" url="rm9x-10-02.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Exceptions" url="rm9x-11.html">
+ <tocsect2 name="Exception Declarations" url="rm9x-11-01.html"></tocsect2>
+ <tocsect2 name="Exception Handlers" url="rm9x-11-02.html"></tocsect2>
+ <tocsect2 name="Raise Statements" url="rm9x-11-03.html"></tocsect2>
+ <tocsect2 name="Exception Handling" url="rm9x-11-04.html"></tocsect2>
+ <tocsect2 name="Suppressing Checks" url="rm9x-11-05.html"></tocsect2>
+ <tocsect2 name="Exceptions and Optimization" url="rm9x-11-06.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Generic Units" url="rm9x-12.html">
+ <tocsect2 name="Generic Declarations" url="rm9x-12-01.html"></tocsect2>
+ <tocsect2 name="Generic Bodies" url="rm9x-12-02.html"></tocsect2>
+ <tocsect2 name="Generic Instantiation" url="rm9x-12-03.html"></tocsect2>
+ <tocsect2 name="Formal Objects" url="rm9x-12-04.html"></tocsect2>
+ <tocsect2 name="Formal Types" url="rm9x-12-05.html"></tocsect2>
+ <tocsect2 name="Formal Subprograms" url="rm9x-12-06.html"></tocsect2>
+ <tocsect2 name="Formal Packages" url="rm9x-12-07.html"></tocsect2>
+ <tocsect2 name="Example of a Generic Package" url="rm9x-12-08.html"></tocsect2>
+</tocsect1>
+<tocsect1 name="Representation Issues" url="rm9x-13.html">
+ <tocsect2 name="Representation Items" url="rm9x-13-01.html"></tocsect2>
+ <tocsect2 name="Pragma Pack" url="rm9x-13" url="rm9x-13-02.html"></tocsect2>
+ <tocsect2 name="Representation Attributes" url="rm9x-13-03.html"></tocsect2>
+ <tocsect2 name="Enumeration Representation Clauses" url="rm9x-13-04.html"></tocsect2>
+ <tocsect2 name="Record Layout" url="rm9x-13-05.html"></tocsect2>
+ <tocsect2 name="Change of Representation" url="rm9x-13-06.html"></tocsect2>
+ <tocsect2 name="The Package System" url="rm9x-13-07.html"></tocsect2>
+ <tocsect2 name="Machine Code Insertions" url="rm9x-13-08.html"></tocsect2>
+ <tocsect2 name="Unchecked Type Conversions" url="rm9x-13-09.html"></tocsect2>
+ <tocsect2 name="Unchecked Access Value Creation" url="rm9x-13-10.html"></tocsect2>
+ <tocsect2 name="Storage Management" url="rm9x-13-11.html"></tocsect2>
+ <tocsect2 name="Pragma Restrictions" url="rm9x-13-12.html"></tocsect2>
+ <tocsect2 name="Streams" url="rm9x-13-13.html"></tocsect2>
+ <tocsect2 name="Freezing Rules" url="rm9x-13-14.html"></tocsect2>
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/ada/doc/ada_bugs_gcc.toc b/languages/ada/doc/ada_bugs_gcc.toc
new file mode 100644
index 00000000..9c543f0c
--- /dev/null
+++ b/languages/ada/doc/ada_bugs_gcc.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Ada bugs (GCC)</title>
+<base href="http://gcc.gnu.org/bugzilla/"/>
+<tocsect1 name="Query" url="query.cgi">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/ada/file_templates/Makefile.am b/languages/ada/file_templates/Makefile.am
new file mode 100644
index 00000000..58bbd907
--- /dev/null
+++ b/languages/ada/file_templates/Makefile.am
@@ -0,0 +1,3 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = adb ads
+
diff --git a/languages/ada/file_templates/adb b/languages/ada/file_templates/adb
new file mode 100644
index 00000000..0306105a
--- /dev/null
+++ b/languages/ada/file_templates/adb
@@ -0,0 +1,12 @@
+--
+--
+-- Ada Body: $MODULE$
+--
+-- Description:
+--
+--
+-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+--
+-- Copyright: See COPYING file that comes with this distribution
+--
+--
diff --git a/languages/ada/file_templates/ads b/languages/ada/file_templates/ads
new file mode 100644
index 00000000..46463d47
--- /dev/null
+++ b/languages/ada/file_templates/ads
@@ -0,0 +1,12 @@
+--
+--
+-- Ada Spec: $MODULE$
+--
+-- Description:
+--
+--
+-- Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+--
+-- Copyright: See COPYING file that comes with this distribution
+--
+--
diff --git a/languages/ada/kdevadasupport.desktop b/languages/ada/kdevadasupport.desktop
new file mode 100644
index 00000000..4f99e10c
--- /dev/null
+++ b/languages/ada/kdevadasupport.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Ada Language Support
+Comment[ca]=Suport per al llenguatge Ada
+Comment[da]=Ada sprogunderstøttelse
+Comment[de]=Sprachunterstützung für Ada
+Comment[el]=Υποστήριξη γλώσσας Ada
+Comment[es]=Soporte para lenguaje Ada
+Comment[et]=ADA keele toetus
+Comment[eu]=Ada lenguaiaren euskarria
+Comment[fa]=پشتیبانی زبان آدا
+Comment[fr]=Prise en charge du langage ADA
+Comment[ga]=Tacaíocht Ada
+Comment[gl]=Soporte da linguaxe Ada
+Comment[hi]=एडीए भाषा समर्थन
+Comment[hu]=Ada nyelvi támogatás
+Comment[is]=Stuðningur við Ada forritunarmálið
+Comment[it]=Supporto al linguaggio Ada
+Comment[ja]=Ada 言語サポート
+Comment[ms]=Sokongan Bahasa Ada
+Comment[nds]=Spraakünnerstütten för Ada
+Comment[ne]=एडा भाषा समर्थन
+Comment[nl]=Ondersteuning voor Ada
+Comment[pl]=Obsługa języka Ada
+Comment[pt]=Suporte à Linguagem Ada
+Comment[pt_BR]=Suporte à Linguagem Ada
+Comment[ru]=Поддержка языка Ada
+Comment[sk]=Podpora jazyka Ada
+Comment[sl]=Podpora jeziku ada
+Comment[sr]=Ada језичка подршка
+Comment[sr@Latn]=Ada jezička podrška
+Comment[sv]=Stöd för språket Ada
+Comment[ta]=அடா மொழி ஆதரவு
+Comment[tg]=Ёри намудани забони Ada
+Comment[tr]=Ada Dil Desteği
+Comment[zh_CN]=Ada 语言支持
+Comment[zh_TW]=Ada 語言支援
+Name=KDevAdaSupport
+Name[da]=KDevelop Ada-understøttelse
+Name[de]=Unterstützung für Ada (KDevelop)
+Name[hi]=के-डेव-एडीए-समर्थन
+Name[nds]=Ada-Ünnerstütten för KDevelop
+Name[ne]=केडीई विकास एडा समर्थन
+Name[pl]=KDevObsługaAdy
+Name[sk]=KDevAdaPodpora
+Name[sv]=KDevelop Ada-stöd
+Name[ta]=கெடெவ் அடா ஆதரவு
+Name[zh_TW]=KDevelop Ada 支援
+GenericName=Ada Language Support
+GenericName[ca]=Suport per al llenguatge Ada
+GenericName[da]=Ada sprogunderstøttelse
+GenericName[de]=Sprachunterstützung für Ada
+GenericName[el]=Υποστήριξη γλώσσας Ada
+GenericName[es]=Soporte para lenguaje Ada
+GenericName[et]=ADA keele toetus
+GenericName[eu]=Ada lenguaiaren euskarria
+GenericName[fa]=پشتیبانی زبان آدا
+GenericName[fr]=Prise en charge du langage ADA
+GenericName[ga]=Tacaíocht Ada
+GenericName[gl]=Soporte da linguaxe Ada
+GenericName[hi]=एडीए भाषा समर्थन
+GenericName[hu]=Ada-támogatás
+GenericName[it]=Supporto al linguaggio Ada
+GenericName[ja]=Ada 言語サポート
+GenericName[ms]=Sokongan Bahasa Ada
+GenericName[nds]=Ünnerstütten för de Spraak Ada
+GenericName[ne]=एडा भाषा समर्थन
+GenericName[nl]=Ondersteuning voor Ada
+GenericName[pl]=Obsługa języka Ada
+GenericName[pt]=Suporte à Linguagem Ada
+GenericName[pt_BR]=Suporte à Linguagem Ada
+GenericName[ru]=Поддержка языка Ada
+GenericName[sk]=Podpora jazyka Ada
+GenericName[sl]=Podpora jeziku ada
+GenericName[sr]=Ada језичка подршка
+GenericName[sr@Latn]=Ada jezička podrška
+GenericName[sv]=Stöd för språket Ada
+GenericName[ta]=அடா மொழி ஆதரவு
+GenericName[tg]=Ёри намудани забони Ada
+GenericName[tr]=Ada Dil Desteği
+GenericName[zh_CN]=Ada 语言支持
+GenericName[zh_TW]=Ada 語言支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevadasupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Ada
diff --git a/languages/ada/kdevadasupport.rc b/languages/ada/kdevadasupport.rc
new file mode 100644
index 00000000..23b705db
--- /dev/null
+++ b/languages/ada/kdevadasupport.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="KDevAdaSupport" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="plugin_action"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="plugin_action"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/ada/preambles.h b/languages/ada/preambles.h
new file mode 100644
index 00000000..e9ea460b
--- /dev/null
+++ b/languages/ada/preambles.h
@@ -0,0 +1,89 @@
+/*
+ * Two macros are defined here: ANTLR_PARSER_PREAMBLE and ANTLR_LEXER_PREAMBLE.
+ * They encapsulate the application specific extensions for the classes
+ * AdaParser and AdaLexer which are defined in ada.g.
+ * This keeps ada.g independent of the application.
+ *
+ * Kdevelop version:
+ * (C) 2003 Oliver M. Kellogg (okellogg@users.sourceforge.net)
+ */
+#ifndef _PREAMBLES_H_
+#define _PREAMBLES_H_
+
+#include <string>
+#include "problemreporter.h"
+
+#define ANTLR_PARSER_PREAMBLE \
+ private: \
+ unsigned int m_numberOfErrors; \
+ ProblemReporter* m_problemReporter; \
+ \
+ public: \
+ void resetErrors () { m_numberOfErrors = 0; } \
+ unsigned int numberOfErrors () const { return m_numberOfErrors; } \
+ void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \
+ \
+ void reportError (const antlr::RecognitionException& ex) { \
+ m_problemReporter->reportError \
+ (ex.toString().c_str (), \
+ ex.getFilename().c_str (), \
+ ex.getLine (), \
+ ex.getColumn ()); \
+ ++m_numberOfErrors; \
+ } \
+ \
+ void reportError (const std::string& errorMessage) { \
+ m_problemReporter->reportError \
+ (errorMessage.c_str(), \
+ getFilename ().c_str(), \
+ LT(1)->getLine (), \
+ LT(1)->getColumn ()); \
+ ++m_numberOfErrors; \
+ } \
+ \
+ void reportMessage (const std::string& message) { \
+ m_problemReporter->reportMessage \
+ (message.c_str (), \
+ getFilename ().c_str (), \
+ LT(1)->getLine (), \
+ LT(1)->getColumn ()); \
+ }
+
+#define ANTLR_LEXER_PREAMBLE \
+ private: \
+ unsigned int m_numberOfErrors; \
+ ProblemReporter* m_problemReporter; \
+ \
+ public: \
+ void resetErrors () { m_numberOfErrors = 0; } \
+ unsigned int numberOfErrors () const { return m_numberOfErrors; } \
+ void setProblemReporter (ProblemReporter* r) { m_problemReporter = r; } \
+ \
+ void reportError (const antlr::RecognitionException& ex) { \
+ m_problemReporter->reportError \
+ (ex.toString ().c_str (), \
+ ex.getFilename ().c_str (), \
+ ex.getLine (), \
+ ex.getColumn ()); \
+ ++m_numberOfErrors; \
+ } \
+ \
+ void reportError (const std::string& errorMessage) { \
+ m_problemReporter->reportError \
+ (errorMessage.c_str (), \
+ getFilename().c_str (), \
+ getLine (), \
+ getColumn ()); \
+ ++m_numberOfErrors; \
+ } \
+ \
+ void reportWarning (const std::string& warnMessage) { \
+ m_problemReporter->reportWarning \
+ (warnMessage.c_str (), \
+ getFilename ().c_str (), \
+ getLine (), \
+ getColumn ()); \
+ }
+
+#endif // _PREAMBLES_H_
+
diff --git a/languages/ada/problemreporter.cpp b/languages/ada/problemreporter.cpp
new file mode 100644
index 00000000..36ac6186
--- /dev/null
+++ b/languages/ada/problemreporter.cpp
@@ -0,0 +1,282 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "problemreporter.h"
+#include "adasupportpart.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "configproblemreporter.h"
+#include "backgroundparser.h"
+
+#include <qfileinfo.h>
+
+#include <kdeversion.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/markinterface.h>
+
+#include <ktexteditor/markinterfaceextension.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+
+#include <kconfig.h>
+
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <kdialogbase.h>
+
+
+class ProblemItem: public QListViewItem{
+public:
+ ProblemItem( QListView* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : QListViewItem( parent, level, problem, file, line, column ) {}
+
+ ProblemItem( QListViewItem* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : QListViewItem( parent, level, problem, file, line, column ) {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const {
+ if( column == 3 || column == 4 ){
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if( a == b )
+ return 0;
+ return( a > b ? -1 : 1 );
+ }
+ return QListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+ProblemReporter::ProblemReporter( AdaSupportPart* part, QWidget* parent, const char* name )
+ : QListView( parent, name ),
+ m_adaSupport( part ),
+ m_editor( 0 ),
+ m_document( 0 ),
+ m_markIface( 0 ),
+ m_bgParser( 0 )
+{
+ QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows errors reported by a language parser."));
+
+ addColumn( i18n("Level") );
+ addColumn( i18n("Problem") );
+ addColumn( i18n("File") );
+ addColumn( i18n("Line") );
+ //addColumn( i18n("Column") );
+ setAllColumnsShowFocus( TRUE );
+
+ m_timer = new QTimer( this );
+
+ connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partAdded(KParts::Part*)),
+ this, SLOT(slotPartAdded(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)),
+ this, SLOT(slotPartRemoved(KParts::Part*)) );
+
+ connect( m_timer, SIGNAL(timeout()), this, SLOT(reparse()) );
+
+ connect( this, SIGNAL(doubleClicked(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+
+ configure();
+}
+
+ProblemReporter::~ProblemReporter()
+{
+ if( m_bgParser ) {
+ m_bgParser->wait();
+ }
+
+ delete( m_bgParser );
+ m_bgParser = 0;
+}
+
+void ProblemReporter::slotActivePartChanged( KParts::Part* part )
+{
+ if( !part )
+ return;
+
+ if( m_editor )
+ reparse();
+
+ m_document = dynamic_cast<KTextEditor::Document*>( part );
+ if( m_document ){
+ m_filename = m_document->url().path();
+ }
+
+ m_editor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ if( m_editor )
+ connect( m_document, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+
+ m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part );
+
+ m_timer->changeInterval( m_delay );
+}
+
+void ProblemReporter::slotTextChanged()
+{
+ if( m_active )
+ m_timer->changeInterval( m_delay );
+}
+
+void ProblemReporter::reparse()
+{
+ kdDebug() << "ProblemReporter::reparse()" << endl;
+
+ if( !m_editor )
+ return;
+
+ m_timer->stop();
+
+ if( m_bgParser ) {
+ if( m_bgParser->running() ) {
+ m_timer->changeInterval( m_delay );
+ return;
+ }
+
+ delete( m_bgParser );
+ m_bgParser = 0;
+ }
+
+ QListViewItem* current = firstChild();
+ while( current ){
+ QListViewItem* i = current;
+ current = current->nextSibling();
+
+ if( i->text(2) == m_filename )
+ delete( i );
+ }
+
+ if( m_markIface ){
+ QPtrList<KTextEditor::Mark> marks = m_markIface->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while( it.current() ){
+ m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 );
+ ++it;
+ }
+ }
+
+/* Temporarily deactivated (crashes)*/
+ if (!m_adaSupport->fileExtensions ().contains (QFileInfo (m_filename).extension ()))
+ {
+ m_bgParser = new BackgroundParser( this, m_editor->text(), m_filename );
+ m_bgParser->start();
+ }
+ /**/
+}
+
+void ProblemReporter::slotSelected( QListViewItem* item )
+{
+ KURL url( item->text(2) );
+ int line = item->text( 3 ).toInt();
+ // int column = item->text( 4 ).toInt();
+ m_adaSupport->partController()->editDocument( url, line-1 );
+}
+
+void ProblemReporter::reportError( QString message,
+ QString filename,
+ int line, int column )
+{
+ if( m_markIface ){
+ m_markIface->addMark( line-1, KTextEditor::MarkInterface::markType07 );
+ }
+
+ new ProblemItem( this,
+ "error",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::reportWarning( QString message,
+ QString filename,
+ int line, int column )
+{
+ new ProblemItem( this,
+ "warning",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::reportMessage( QString message,
+ QString filename,
+ int line, int column )
+{
+ new QListViewItem( this,
+ "message",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::configure()
+{
+ kdDebug() << "ProblemReporter::configure()" << endl;
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ m_active = config->readBoolEntry( "EnableAdaBgParser", TRUE );
+ m_delay = config->readNumEntry( "BgParserDelay", 500 );
+}
+
+void ProblemReporter::configWidget( KDialogBase* dlg )
+{
+ kdDebug() << "ProblemReporter::configWidget()" << endl;
+ QVBox *vbox = dlg->addVBoxPage(i18n("Ada Parsing"), i18n("Ada Parsing"), BarIcon( "source", KIcon::SizeMedium ));
+ ConfigureProblemReporter* w = new ConfigureProblemReporter( vbox );
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ connect(dlg, SIGNAL(okClicked()), this, SLOT(configure()));
+}
+
+void ProblemReporter::slotPartAdded( KParts::Part* part )
+{
+ KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part );
+
+ if( !iface )
+ return;
+
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+}
+
+void ProblemReporter::slotPartRemoved( KParts::Part* part )
+{
+ kdDebug() << "ProblemReporter::slotPartRemoved()" << endl;
+ if( part == m_document ){
+ m_document = 0;
+ m_editor = 0;
+ m_timer->stop();
+ }
+}
+
+#include "problemreporter.moc"
diff --git a/languages/ada/problemreporter.h b/languages/ada/problemreporter.h
new file mode 100644
index 00000000..b42a6ad3
--- /dev/null
+++ b/languages/ada/problemreporter.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Oliver Kellogg <okellogg@users.sourceforge.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PROBLEMSREPORTER_H
+#define PROBLEMSREPORTER_H
+
+#include <qlistview.h>
+
+class AdaSupportPart;
+class QTimer;
+class KDialogBase;
+class BackgroundParser;
+
+namespace KParts{
+ class Part;
+}
+
+namespace KTextEditor{
+ class EditInterface;
+ class MarkInterface;
+ class Document;
+}
+
+class ProblemReporter: public QListView{
+ Q_OBJECT
+public:
+ ProblemReporter( AdaSupportPart* part, QWidget* parent=0, const char* name=0 );
+ virtual ~ProblemReporter();
+
+ virtual void reportError( QString message, QString filename,
+ int line, int column );
+
+ virtual void reportWarning( QString message, QString filename,
+ int line, int column );
+
+ virtual void reportMessage( QString message, QString filename,
+ int line, int column );
+
+public slots:
+ void reparse();
+ void configure();
+ void configWidget( KDialogBase* );
+
+private slots:
+ void slotPartAdded( KParts::Part* );
+ void slotPartRemoved( KParts::Part* );
+ void slotActivePartChanged( KParts::Part* );
+ void slotTextChanged();
+ void slotSelected( QListViewItem* );
+
+private:
+ AdaSupportPart* m_adaSupport;
+ KTextEditor::EditInterface* m_editor;
+ KTextEditor::Document* m_document;
+ KTextEditor::MarkInterface* m_markIface;
+ QTimer* m_timer;
+ QString m_filename;
+ int m_active;
+ int m_delay;
+ BackgroundParser* m_bgParser;
+};
+
+#endif
diff --git a/languages/bash/Makefile.am b/languages/bash/Makefile.am
new file mode 100644
index 00000000..90b94689
--- /dev/null
+++ b/languages/bash/Makefile.am
@@ -0,0 +1,20 @@
+#Here resides the Bash Shell support part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = app_templates doc
+
+kde_module_LTLIBRARIES = libkdevbashsupport.la
+libkdevbashsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevbashsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevbashsupport_la_SOURCES = bashsupport_part.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevbashsupport.desktop
+
+rcdir = $(kde_datadir)/kdevbashsupport
+rc_DATA = kdevbashsupport.rc
diff --git a/languages/bash/README.dox b/languages/bash/README.dox
new file mode 100644
index 00000000..95765f0a
--- /dev/null
+++ b/languages/bash/README.dox
@@ -0,0 +1,15 @@
+/** \class BashSupportPart
+
+Supports bash language
+
+\authors <a href="mailto:geiseri AT kde.org">Ian Reinhart Geiser</a>
+
+\maintainer <a href="mailto:geiseri AT kde.org">Ian Reinhart Geiser</a>
+
+\feature function browser support
+\feature runs bash script in external terminal
+\feature syntax highlighting and code folding via katepart
+\feature Code completion works for variables
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+*/
diff --git a/languages/bash/app_templates/Makefile.am b/languages/bash/app_templates/Makefile.am
new file mode 100644
index 00000000..7dbe86af
--- /dev/null
+++ b/languages/bash/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = bashhello
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/ShellIDE
+profiles_DATA = bash.appwizard
diff --git a/languages/bash/app_templates/bash.appwizard b/languages/bash/app_templates/bash.appwizard
new file mode 100644
index 00000000..2e4473b0
--- /dev/null
+++ b/languages/bash/app_templates/bash.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=bashhello
diff --git a/languages/bash/app_templates/bashhello/.kdev_ignore b/languages/bash/app_templates/bashhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/.kdev_ignore
diff --git a/languages/bash/app_templates/bashhello/Makefile.am b/languages/bash/app_templates/bashhello/Makefile.am
new file mode 100644
index 00000000..45e403b8
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.sh app.kdevelop
+templateName = bashhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/bash/app_templates/bashhello/app.kdevelop b/languages/bash/app_templates/bashhello/app.kdevelop
new file mode 100644
index 00000000..40e783a4
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/app.kdevelop
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Bash</primarylanguage>
+ <keywords>
+ <keyword>Bash</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevdistpart</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir>src</activedir>
+ <includepatterns>*.sh</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.sh" name="Scripts" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="sh"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/bash/app_templates/bashhello/app.sh b/languages/bash/app_templates/bashhello/app.sh
new file mode 100644
index 00000000..9e70bd5f
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/app.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# $Id$
+# %{APPNAME} - Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
+
+
+hello()
+{
+ echo "Hello $NAME"
+}
+
+echo "This is a test"
+
+LST="Ian Ben Rook Kaz"
+for NAME in $LST
+do
+ hello
+done
diff --git a/languages/bash/app_templates/bashhello/bashhello b/languages/bash/app_templates/bashhello/bashhello
new file mode 100644
index 00000000..7c9b9222
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/bashhello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple Bash Shell Script
+Name[fr]=Un simple script de test Hello world
+Category=Shell
+Category[fr]=Interprteur BASH
+Comment=This generates a simplistic 'Hello world' program in Bash shell
+Comment[fr]=Gnre un simple script de test du type Hello world pour l'interprteur BASH.
+FileTemplates=sh,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.sh
diff --git a/languages/bash/app_templates/bashhello/bashhello.kdevtemplate b/languages/bash/app_templates/bashhello/bashhello.kdevtemplate
new file mode 100644
index 00000000..e62b1514
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/bashhello.kdevtemplate
@@ -0,0 +1,111 @@
+# KDE Config File
+[General]
+Name=Simple Bash Shell Script
+Name[ca]=Simple script de l'intèrpret de comandaments Bash
+Name[da]=Simpelt Bash skal-script
+Name[de]=Ein einfaches Shell-Skript für Bash
+Name[el]=Απλό σενάριο κελύφους Bash
+Name[es]=Guión sencillo para el intérprete de órdenes Bash
+Name[et]=Lihtne bash'i shelliskript
+Name[eu]=Bash shell-aren script sinplea
+Name[fa]=دست‌نوشتۀ سادۀ پوستۀ Bash
+Name[fr]=Script shell Bash simple
+Name[ga]=Script Shimplí Bhlaoisce Bash
+Name[gl]=Script sinxelo en Bash Shell
+Name[hu]=Egyszerű Bash-szkript
+Name[it]=Semplice script shell Bash
+Name[ja]=簡単な Bash シェルスクリプト
+Name[nds]=En eenfach Konsoolskript för Bash
+Name[ne]=साधारण ब्यास शेल स्क्रिप्ट
+Name[nl]=Eenvoudig Bash-shellscript
+Name[pl]=Prosty skrypt powłoki Bash
+Name[pt]=Programa Simples da 'Shell' Bash
+Name[pt_BR]=Programa Simples da 'Shell' Bash
+Name[ru]=Простой скрипт Bash
+Name[sk]=Jednoduchý skript pre Bash Shell
+Name[sl]=Preprost skript za lupino Bash
+Name[sr]=Једноставна скрипта шкољке Bash
+Name[sr@Latn]=Jednostavna skripta školjke Bash
+Name[sv]=Enkelt Bash-skalskript
+Name[tr]=Basit Bash Kabuk Betiği
+Name[zh_CN]=简单的 Bash Shell 脚本
+Name[zh_TW]=簡單的 Bash shell 文稿
+Category=Shell
+Category[fr]=Interprteur BASH
+Comment=This generates a simplistic 'Hello world' program in Bash shell
+Comment[ca]=Genera un simple programa de 'Hello world' en l'intèrpret de comandaments Bash
+Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i en Bash skal
+Comment[de]=Generiert ein einfaches "Hello world"-Programm für die Bash-Shell
+Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα 'Γεια σου κόσμε' στο κέλυφος Bash
+Comment[es]=Genera un sencillo programa «Hola mundo» para el intérprete de órdenes Bash
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine bash'i shellis
+Comment[eu]=Honek "Kaixo mundua" programa sinple bat sortzen du Bash shell-erako
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در پوستۀ Bash تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » des plus simples en shell Bash
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i mblaosc Bash
+Comment[gl]=Xera un programa sinxelo 'Ola mundo' en Bash shell
+Comment[hu]=Létrehoz egy egyszerű Hello world programot a Bash parancsértelmezőhöz
+Comment[it]=Questo genera un semplice programma shell di "Hello world" in Bash
+Comment[ja]=簡単な Hello world プログラムを Bash シェルで記述します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm för de Bash-Konsool op
+Comment[ne]=यसले ब्यास शेलमा साधारण 'हेल्डो वोल्डकार' कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een eenvoudig "Hello World" programma in Bash-shell
+Comment[pl]=Generuje prosty program 'Witaj świecie' jako skrypt powłoki Bash
+Comment[pt]=Isto gera um programa simplista 'Olá mundo' para a linha de comandos Bash
+Comment[pt_BR]=Isto gera um programa simplista 'Olá mundo' para a linha de comandos Bash
+Comment[ru]=Создание простой программы 'Hello world' на Bash
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Bash Shell
+Comment[sl]=Ustvari preprost program 'Dobrodošel svet' v lupini Bash
+Comment[sr]=Ово прави једноставан „Здраво свете“ програм за шкољку Bash
+Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ program za školjku Bash
+Comment[sv]=Detta skapar ett förenklat 'Hello world'-program för Bash-skalet
+Comment[tr]=Bu, Bash kabuğunda basit bir "Merhaba Dünya" programı üretir.
+Comment[zh_CN]=这将生成 Bash shell 中可以使用的“Hello world”程序
+Comment[zh_TW]=這會產生一個簡單的 Bash shell 的 hello world 程式
+FileTemplates=sh,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.sh
+Archive=bashhello.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.sh
+Dest=%{dest}/%{APPNAMELC}.sh
+
+[MSG]
+Type=message
+Comment=A simple bash shell script project was created in %{dest}
+Comment[ca]=Un simple script de l'intèrpret de comandaments Bash ha estat creat en %{dest}
+Comment[da]=Et simpelt bash skalscript-projekt blev oprettet i %{dest}
+Comment[de]=Ein einfaches Shell-Skript-Projekt für Bash wurde in %{dest} erstellt
+Comment[el]=Ένα απλό σενάριο κελύφους bash δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo proyecto de guión de intérprete de órdenes ha sido creado en %{dest}
+Comment[et]=Lihtne bash'i shelliskript loodi asukohta %{dest}
+Comment[eu]=Bash shell-erako proiektu sinple bat sortu da hemen:%{dest}
+Comment[fa]=یک پروژۀ دست‌نوشتۀ پوستۀ bash ساده در %{dest} ایجاد شد
+Comment[fr]=Un projet de script shell Bash simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh tionscadal simplí bash i %{dest}
+Comment[gl]=Creouse un proxecto de script sinxelo en bash shell en %{dest}
+Comment[hu]=Létrejött egy egyszerű Bash-szkript (projekt) itt: %{dest}
+Comment[it]=È stato creato un semplice progetto di script shell in Bash in %{dest}
+Comment[ja]=簡単な bash シェルスクリプトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Konsoolskript-Projekt för Bash opstellt
+Comment[ne]=एउटा साधारण शेल स्क्रिप्ट परियोजना %{dest} मा सिर्जना गरिएको थियो
+Comment[nl]=Een eenvoudig Bash-shellscript is aangemaakt in %{dest}
+Comment[pl]=Prosty skrypt powłoki został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples "Olá mundo" em Bash em %{dest}
+Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em Bash em %{dest}
+Comment[ru]=Простая программа "Hello world" на Bash создана в %{dest}
+Comment[sk]=Jednoduchý Bash Shell projekt bol vytvorený v %{dest}
+Comment[sl]=Projekt s preprostim skriptom za lupino Bash je bil ustvarjen v %{dest}
+Comment[sr]=Пројекат једноставне скрипте за шкољку Bash направљен је у %{dest}
+Comment[sr@Latn]=Projekat jednostavne skripte za školjku Bash napravljen je u %{dest}
+Comment[sv]=Ett enkelt Bash skalskriptprojekt skapades i %{dest}
+Comment[tr]=Basit bir bash betik projesi %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了简单的 Bash Shell 脚本工程
+Comment[zh_TW]=Bash shell 的 Hello world 程式已產生在 ${dest}
diff --git a/languages/bash/app_templates/bashhello/bashhello.png b/languages/bash/app_templates/bashhello/bashhello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/bash/app_templates/bashhello/bashhello.png
Binary files differ
diff --git a/languages/bash/bashsupport_part.cpp b/languages/bash/bashsupport_part.cpp
new file mode 100644
index 00000000..389c0a70
--- /dev/null
+++ b/languages/bash/bashsupport_part.cpp
@@ -0,0 +1,442 @@
+/*
+* Copyright (C) 2003 Ian Reinhart Geiser <geiseri@kde.org>
+*/
+#include "bashsupport_part.h"
+
+#include <qwhatsthis.h>
+
+#include <qfileinfo.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <kapplication.h>
+#include <qregexp.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kprocess.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdialogbase.h>
+
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevlanguagesupport.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <kdevappfrontend.h>
+#include <kdevplugininfo.h>
+#include <domutil.h>
+#include <codemodel.h>
+
+typedef KDevGenericFactory<BashSupportPart> BashSupportFactory;
+static const KDevPluginInfo data("kdevbashsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevbashsupport, BashSupportFactory( data ) )
+
+BashSupportPart::BashSupportPart(QObject *parent, const char *name, const QStringList& )
+: KDevLanguageSupport (&data, parent, name ? name : "BashSupportPart" )
+{
+ setInstance(BashSupportFactory::instance());
+ setXMLFile("kdevbashsupport.rc");
+
+ KAction *action;
+ action = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Run"));
+ action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));
+
+ kdDebug() << "Creating BashSupportPart" << endl;
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) );
+ connect(partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part *)));
+
+ m_cc = new BashCodeCompletion();
+}
+
+
+BashSupportPart::~BashSupportPart()
+{
+ delete( m_cc );
+ m_cc = 0;
+}
+
+
+void BashSupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ Q_UNUSED( dlg );
+// QVBox *vbox = dlg->addVBoxPage(i18n("Bash"));
+// RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "Bash config widget");
+// connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+void BashSupportPart::projectOpened()
+{
+ kdDebug(9014) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(parse()));
+}
+
+
+void BashSupportPart::projectClosed()
+{
+
+}
+
+void BashSupportPart::slotRun ()
+{
+ QString file;
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if(ro_part)
+ file = ro_part->url().path();
+
+ QString cmd = interpreter() + " " + file;
+ startApplication(cmd);
+}
+
+QString BashSupportPart::interpreter()
+{
+ QString prog = DomUtil::readEntry(*projectDom(), "/kdevrbashsupport/run/interpreter");
+ if (prog.isEmpty())
+ prog = "bash";
+ return prog;
+}
+
+void BashSupportPart::parse()
+{
+ kdDebug(9014) << "initialParse()" << endl;
+
+ if (project())
+ {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it)
+ {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ parse(project()->projectDirectory() + "/" + *it);
+ }
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug(9014) << "No project" << endl;
+ }
+}
+
+void BashSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+kdDebug(9014) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ parse(project()->projectDirectory() + "/" + ( *it ) );
+ }
+
+ emit updatedSourceInfo();
+}
+
+
+void BashSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9014) << "removedFilesFromProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+ }
+
+ //emit updatedSourceInfo();
+}
+
+void BashSupportPart::savedFile(const KURL &fileName)
+{
+ kdDebug(9014) << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 )))
+ {
+ parse(fileName.path());
+ emit addedSourceInfo( fileName.path() );
+ }
+}
+
+void BashSupportPart::startApplication(const QString &program)
+{
+ kdDebug() << "starting application" << program << endl;
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, TRUE);
+}
+
+
+KDevLanguageSupport::Features BashSupportPart::features()
+{
+ return Features(Variables | Functions);
+}
+
+void BashSupportPart::parse(const QString &fileName)
+{
+ QFileInfo fi(fileName);
+ m_vars.clear();
+ if (fi.extension() == "sh")
+ {
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+
+ FileDom m_file = codeModel()->create<FileModel>();
+ m_file->setName( fileName );
+
+ m_vars.clear();
+ QFile f(QFile::encodeName(fileName));
+ if (!f.open(IO_ReadOnly))
+ return;
+ QString rawline;
+ QString line;
+ uint lineNo = 0;
+ //KRegExp methodre("\\b([\\d\\w]+[\\s]*)\\([\\s]*\\)");
+ QRegExp methodre("^\\s*(\\w+)\\s*\\(\\s*\\)");
+ QRegExp varre( "^\\s*(\\w+)[=]" );
+ QRegExp expvarre( "^export\\s*(\\w+)[=]" );
+ QRegExp forvarre("\\bfor[\\s]+([\\d\\w]+)[\\s]+in[\\s]+");
+
+ QTextStream stream(&f);
+ while (!stream.atEnd())
+ {
+ rawline = stream.readLine();
+ line = rawline.stripWhiteSpace().local8Bit();
+ kdDebug() << "Trying line: " << line << endl;
+ if (methodre.search(line) != -1)
+ {
+ FunctionDom method = codeModel()->create<FunctionModel>();
+ method->setName(methodre.cap(1));
+ method->setFileName(fileName);
+ method->setStartPosition(lineNo, 0);
+
+ if( !m_file->hasFunction(method->name()) ){
+ kdDebug() << "Add global method " << method->name() << endl;
+ m_file->addFunction( method );
+ }
+ }
+ else if(varre.search(line) != -1)
+ {
+ addAttribute(varre.cap(1), m_file, lineNo);
+ }
+ else if(expvarre.search(line) != -1)
+ {
+ addAttribute(expvarre.cap(1), m_file, lineNo);
+ }
+ else if(forvarre.search(line) != -1)
+ {
+ addAttribute(forvarre.cap(1), m_file, lineNo);
+ }
+ ++lineNo;
+ }
+ f.close();
+
+ kdDebug() << "Trying to add list..." << endl;
+ codeModel()->addFile( m_file );
+ VariableList attrList = codeModel()->globalNamespace()->variableList();
+ for (VariableList::Iterator it = attrList.begin(); it != attrList.end(); ++it)
+ {
+ kdDebug() << "Adding " << (*it)->name() << endl;
+ m_vars.append((*it)->name());
+ }
+ m_cc->setVars(m_vars);
+
+ codeModel()->addFile( m_file );
+ }
+
+}
+
+void BashSupportPart::slotActivePartChanged(KParts::Part *part)
+{
+ kdDebug() << "Changeing part..." << endl;
+ m_cc->setActiveEditorPart(part);
+}
+
+void BashSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo)
+{
+ VariableDom var = codeModel()->create<VariableModel>();
+ var->setName(name);
+ var->setFileName(file->name());
+ var->setStartPosition( lineNo, 0 );
+ var->setType(i18n("Variable"));
+
+ if( !file->hasVariable(var->name()) ){
+ kdDebug() << "Add global attribute " << var->name() << endl;
+ file->addVariable(var);
+ }
+}
+
+BashCodeCompletion::BashCodeCompletion()
+{
+ m_argWidgetShow = false;
+ m_completionBoxShow=false;
+}
+
+BashCodeCompletion::~BashCodeCompletion()
+{
+
+}
+
+void BashCodeCompletion::setActiveEditorPart(KParts::Part *part)
+{
+ if (!part || !part->widget())
+ return;
+
+ kdDebug() << "BashCodeCompletion::setActiveEditorPart" << endl;
+
+// We need to think about this
+// if(!(m_config->getCodeCompletion() || m_config->getCodeHinting())){
+// return; // no help
+// }
+
+ m_editInterface = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!m_editInterface)
+ {
+ kdDebug() << "editor doesn't support the EditDocumentIface" << endl;
+ return;
+ }
+
+ m_cursorInterface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (!m_cursorInterface)
+ {
+ kdDebug() << "editor does not support the ViewCursorInterface" << endl;
+ return;
+ }
+
+ m_codeInterface = dynamic_cast<KTextEditor::CodeCompletionInterface*>(part->widget());
+ if (!m_codeInterface) { // no CodeCompletionDocument available
+ kdDebug() << "editor doesn't support the CodeCompletionDocumentIface" << endl;
+ return;
+ }
+
+ disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice
+ connect(part->widget(), SIGNAL(cursorPositionChanged()),
+ this, SLOT(cursorPositionChanged()));
+ connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHidden()));
+ connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxAbort()));
+ connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHidden()));
+
+}
+
+void BashCodeCompletion::setVars(QStringList lst)
+{
+ m_vars = lst;
+}
+
+QValueList<KTextEditor::CompletionEntry> BashCodeCompletion::getVars(const QString &startText)
+{
+ kdDebug() << "getVars for " << startText << endl;
+ QValueList<KTextEditor::CompletionEntry> varList;
+ QValueList<QString>::ConstIterator it;
+ for (it = m_vars.begin(); it != m_vars.end(); ++it) {
+ QString var = "$" + (*it);
+ kdDebug() << "Compair " << var << endl;
+ if( var.startsWith( startText ))
+ {
+ KTextEditor::CompletionEntry e;
+ e.text = var;
+ //e.postfix ="";
+ //e.prefix ="";
+ kdDebug() << "getVar: " << var << endl;
+ varList.append(e);
+ }
+ }
+
+ return varList;
+}
+
+void BashCodeCompletion::cursorPositionChanged()
+{
+ uint line, col;
+ m_cursorInterface->cursorPositionReal(&line, &col);
+ kdDebug() << "BashCodeCompletion::cursorPositionChanged:" << line << ":" << col << endl;
+
+ QString lineStr = m_editInterface->textLine(line);
+ if(lineStr.isNull() || lineStr.isEmpty()){
+ kdDebug() << "No Text..." << endl;
+ return; // nothing to do
+ }
+// if(m_config->getCodeCompletion())
+// {
+ QString restLine = lineStr.mid(col);
+ QString prevText = lineStr.mid(0,col);
+
+ if(restLine.left(1) != " " && restLine.left(1) != "\t" && !restLine.isNull())
+ {
+ kdDebug() << "no codecompletion because no empty character after cursor:" << restLine << ":" << endl;
+ return;
+ }
+
+ QRegExp prevReg("[$][\\d\\w]*\\b$");
+
+ int pos = prevReg.search( prevText );
+ if (pos > -1 )
+ {
+ // We are in completion mode
+ QString startMatch = prevReg.cap(0);
+ kdDebug() << "Matching: " << startMatch << endl;
+ m_completionBoxShow=true;
+ m_codeInterface->showCompletionBox(getVars(startMatch),2);
+ }
+ else
+ {
+ kdDebug() << "no vars in: " << prevText << endl;
+ return;
+ }
+
+// }
+
+}
+
+void BashCodeCompletion::completionBoxHidden()
+{
+ kdDebug() << "Complete..." << endl;
+ m_completionBoxShow=false;
+/* uint line, col, start;
+ m_cursorInterface->cursorPositionReal(&line, &col);
+ QString lineStr = m_editInterface->textLine(line);
+
+ start = lineStr.findRev(QRegExp("[$][\\d\\w]*\\b$"));
+ m_editInterface->removeText ( start, col, line, col );
+*/
+}
+
+void BashCodeCompletion::completionBoxAbort()
+{
+ kdDebug() << "aborted..." << endl;
+ m_completionBoxShow=false;
+}
+
+KMimeType::List BashSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-shellscript" );
+ if( mime )
+ list << mime;
+
+ return list;
+}
+#include "bashsupport_part.moc"
diff --git a/languages/bash/bashsupport_part.h b/languages/bash/bashsupport_part.h
new file mode 100644
index 00000000..20c11c4e
--- /dev/null
+++ b/languages/bash/bashsupport_part.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2003 Ian Reinhart Geiser <geiseri@kde.org>
+ */
+
+
+#ifndef __KDEVPART_BASHSUPPORT_H__
+#define __KDEVPART_BASHSUPPORT_H__
+
+
+#include <qguardedptr.h>
+
+#include <kprocess.h>
+#include <kdialogbase.h>
+
+#include <codemodel.h>
+#include <kdevplugin.h>
+#include <kdevlanguagesupport.h>
+
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+
+//class BashSupportWidget;
+
+class BashCodeCompletion : QObject
+{
+ Q_OBJECT
+ public:
+ BashCodeCompletion();
+ ~BashCodeCompletion();
+ void setActiveEditorPart(KParts::Part*);
+ void setVars(QStringList);
+ QValueList<KTextEditor::CompletionEntry> getVars(const QString& textHint);
+
+ public slots:
+ void cursorPositionChanged();
+ void completionBoxHidden();
+ void completionBoxAbort();
+
+ private:
+ QStringList m_vars;
+ bool m_argWidgetShow;
+ bool m_completionBoxShow;
+ KTextEditor::EditInterface *m_editInterface;
+ KTextEditor::CodeCompletionInterface *m_codeInterface;
+ KTextEditor::ViewCursorInterface *m_cursorInterface;
+};
+
+class BashSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+ public:
+ BashSupportPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~BashSupportPart();
+
+ protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+ private slots:
+ void slotRun();
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void parse();
+ void slotActivePartChanged(KParts::Part *part);
+
+ private:
+ void startApplication(const QString &program);
+ QString interpreter();
+ void parse(const QString &fileName);
+ void addAttribute(const QString &name, FileDom file, uint line);
+ BashCodeCompletion *m_cc;
+ QStringList m_vars;
+
+};
+
+#endif
diff --git a/languages/bash/doc/Makefile.am b/languages/bash/doc/Makefile.am
new file mode 100644
index 00000000..1474d939
--- /dev/null
+++ b/languages/bash/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = bash.toc bash_bugs.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/bash/doc/bash.toc b/languages/bash/doc/bash.toc
new file mode 100644
index 00000000..060c59c7
--- /dev/null
+++ b/languages/bash/doc/bash.toc
@@ -0,0 +1,80 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Bash Reference Manual</title>
+<base href="http://bashdb.sourceforge.net/"/>
+<tocsect1 name="Introduction" url="bashref.html#SEC1">
+ <tocsect2 name="What is Bash?" url="bashref.html#SEC2"/>
+ <tocsect2 name="What is a Shell?" url="bashref.html#SEC3"/>
+</tocsect1>
+<tocsect1 name="Definitions" url="bashref.html#SEC4"></tocsect1>
+<tocsect1 name="Basic Shell Features" url="bashref.html#SEC5">
+ <tocsect2 name="Shell Syntax" url="bashref.html#SEC6"/>
+ <tocsect2 name="Shell Commands" url="bashref.html#SEC15"/>
+ <tocsect2 name="Shell Functions" url="bashref.html#SEC22"/>
+ <tocsect2 name="Shell Parameters" url="bashref.html#SEC23"/>
+ <tocsect2 name="Shell Expansions" url="bashref.html#SEC26"/>
+ <tocsect2 name="Shell Redirections" url="bashref.html#SEC37"/>
+ <tocsect2 name="Executeing Commands" url="bashref.html#SEC47"/>
+ <tocsect2 name="Shell Scripts" url="bashref.html#SEC54"/>
+</tocsect1>
+<tocsect1 name="Shell Builtin Commands" url="bashref.html#SEC55">
+ <tocsect2 name="Bourne Shell Builtins" url="bashref.html#SEC56"/>
+ <tocsect2 name="Bash Builtin Commands" url="bashref.html#SEC57"/>
+ <tocsect2 name="The Set Builtin" url="bashref.html#SEC58"/>
+ <tocsect2 name="Special Builtins" url="bashref.html#SEC59"/>
+</tocsect1>
+<tocsect1 name="Shell Variables" url="bashref.html#SEC60">
+ <tocsect2 name="Bourne Shell Variables" url="bashref.html#SEC61"/>
+ <tocsect2 name="Bash Variables" url="bashref.html#SEC62"/>
+</tocsect1>
+<tocsect1 name="Bash Features" url="bashref.html#SEC63">
+ <tocsect2 name="Invoking Bash" url="bashref.html#SEC64"/>
+ <tocsect2 name="Bash Startup Files" url="bashref.html#SEC65"/>
+ <tocsect2 name="Bash Conditional Expressions" url="bashref.html#SEC77"/>
+ <tocsect2 name="Shell Arithmetic" url="bashref.html#SEC78"/>
+ <tocsect2 name="Aliases" url="bashref.html#SEC79"/>
+ <tocsect2 name="Arrays" url="bashref.html#SEC80"/>
+ <tocsect2 name="The Directory Stack" url="bashref.html#SEC81"/>
+ <tocsect2 name="Controlling the Prompt" url="bashref.html#SEC83"/>
+ <tocsect2 name="The Restricted Shell" url="bashref.html#SEC84"/>
+ <tocsect2 name="Bash POSIX Mode" url="bashref.html#SEC85"/>
+</tocsect1>
+<tocsect1 name="Job Control" url="bashref.html#SEC86">
+ <tocsect2 name="Job Control Basics" url="bashref.html#SEC87"/>
+ <tocsect2 name="Job Control Builtins" url="bashref.html#SEC88"/>
+ <tocsect2 name="Job Control Variables" url="bashref.html#SEC89"/>
+</tocsect1>
+<tocsect1 name="Using History Interactively" url="bashref.html#SEC114">
+ <tocsect2 name="Bash History Facilities" url="bashref.html#SEC115"/>
+ <tocsect2 name="Bash Hisotry Builtins" url="bashref.html#SEC116"/>
+ <tocsect2 name="History Expansion" url="bashref.html#SEC117"/>
+</tocsect1>
+<tocsect1 name="Command Line Editing" url="bashref.html#SEC90">
+ <tocsect2 name="Introduciton to Line Editing" url="bashref.html#SEC91"/>
+ <tocsect2 name="Readline Interaction" url="bashref.html#SEC92"/>
+ <tocsect2 name="Readline Init File" url="bashref.html#SEC98"/>
+ <tocsect2 name="Bindable Readline Commands" url="bashref.html#SEC102"/>
+ <tocsect2 name="Readline VI Mode" url="bashref.html#SEC111"/>
+ <tocsect2 name="Programmable Completion" url="bashref.html#SEC112"/>
+ <tocsect2 name="Programmable Completion Builtins" url="bashref.html#SEC113"/>
+</tocsect1>
+<tocsect1 name="Installing Bash" url="bashref.html#SEC121">
+ <tocsect2 name="Basic Installation" url="bashref.html#SEC122"/>
+ <tocsect2 name="Compilers and Options" url="bashref.html#SEC123"/>
+ <tocsect2 name="Compileing for Multiple Architectures" url="bashref.html#SEC124"/>
+ <tocsect2 name="Installation Names" url="bashref.html#SEC125"/>
+ <tocsect2 name="Specifying the System Type" url="bashref.html#SEC126"/>
+ <tocsect2 name="Shareing Defaults" url="bashref.html#SEC127"/>
+ <tocsect2 name="Operation Controls" url="bashref.html#SEC128"/>
+ <tocsect2 name="Operational Features" url="bashref.html#SEC129"/>
+</tocsect1>
+<tocsect1 name="Reporting Bugs" url="bashref.html#SEC130"></tocsect1>
+<tocsect1 name="Major Differences From The Bourne Shell" url="bashref.html#SEC131"></tocsect1>
+<tocsect1 name="Enhancements to BASH 2.05b" url="bashref.html#SEC133"></tocsect1>
+<tocsect1 name="Index of Shell Builtin Commands" url="bashref.html#SEC134"></tocsect1>
+<tocsect1 name="Index of Shell Reserved Words" url="bashref.html#SEC135"></tocsect1>
+<tocsect1 name="Parameter and Variable Index" url="bashref.html#SEC136"></tocsect1>
+<tocsect1 name="Function Index" url="bashref.html#SEC137"></tocsect1>
+<tocsect1 name="Concept Index" url="bashref.html#SEC138"></tocsect1>
+</kdeveloptoc>
+
diff --git a/languages/bash/doc/bash_bugs.toc b/languages/bash/doc/bash_bugs.toc
new file mode 100644
index 00000000..aa7b42e3
--- /dev/null
+++ b/languages/bash/doc/bash_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Bash bugs</title>
+<base href="http://groups.google.com/"/>
+<tocsect1 name="Query" url="groups?group=gnu.bash.bug">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/bash/kdevbashsupport.desktop b/languages/bash/kdevbashsupport.desktop
new file mode 100644
index 00000000..f46b99eb
--- /dev/null
+++ b/languages/bash/kdevbashsupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Bash Support
+Comment[ca]=Suport per a Bash
+Comment[da]=Bash understøttelse
+Comment[de]=Unterstützung für Bash
+Comment[el]=Υποστήριξη Bash
+Comment[es]=Soporte para Bash
+Comment[et]=Bash'i toetus
+Comment[eu]=Bash-en euskarria
+Comment[fa]=پشتیبانی Bash
+Comment[fr]=Prise en charge de BASH
+Comment[ga]=Tacaíocht Bash
+Comment[gl]=Soporte de Bash
+Comment[hi]=बैश समर्थन
+Comment[hu]=Bash-támogatás
+Comment[is]=Bash stuðnigur
+Comment[it]=Supporto per Bash
+Comment[ja]=Bash サポート
+Comment[nds]=Bash-Ünnerstütten
+Comment[ne]=ब्यास समर्थन
+Comment[nl]=Ondersteuning voor Bash
+Comment[pl]=Obsługa bash-a
+Comment[pt]=Suporte a Bash
+Comment[pt_BR]=Suporte ao Bash
+Comment[ru]=Поддержка языка Bash
+Comment[sk]=Podpora Bash
+Comment[sl]=Podpora bash
+Comment[sr]=Bash подршка
+Comment[sr@Latn]=Bash podrška
+Comment[sv]=Bash-stöd
+Comment[ta]=பாஷ் ஆதரவு
+Comment[tg]=Ёри намудани забони Bash
+Comment[tr]=Bash Desteği
+Comment[zh_CN]=Bash 支持
+Comment[zh_TW]=Bash 支援
+Name=KDevBashSupport
+Name[da]=KDevelop Bash-understøttelse
+Name[de]=Unterstützung für Bash (KDevelop)
+Name[hi]=के-डेव-बैश-समर्थन
+Name[nds]=Bash-Ünnerstütten för KDevelop
+Name[ne]=केडीई विकास ब्यास समर्थन
+Name[pl]=KDevObsługaBasha
+Name[sk]=KDevBashPodpora
+Name[sv]=KDevelop Bash-stöd
+Name[ta]=கெடெவ்பாஷ் ஆதரவு
+Name[zh_TW]=KDevelop Bash 支援
+GenericName=Bash Support
+GenericName[ca]=Suport per a Bash
+GenericName[da]=Bash-understøttelse
+GenericName[de]=Unterstützung für Bash
+GenericName[el]=Υποστήριξη Bash
+GenericName[es]=Soporte para Bash
+GenericName[et]=Bash'i toetus
+GenericName[eu]=Bash-en euskarria
+GenericName[fa]=پشتیبانی Bash
+GenericName[fr]=Prise en charge de BASH
+GenericName[ga]=Tacaíocht Bash
+GenericName[gl]=Soporte de Bash
+GenericName[hi]=बैश समर्थन
+GenericName[hu]=Bash-támogatás
+GenericName[it]=Supporto Bash
+GenericName[ja]=Bash サポート
+GenericName[nds]=Ünnerstütten för Bash
+GenericName[ne]=ब्यास समर्थन
+GenericName[nl]=Ondersteuning voor Bash
+GenericName[pl]=Obsługa bash-a
+GenericName[pt]=Suporte de Bash
+GenericName[pt_BR]=Suporte ao Bash
+GenericName[ru]=Поддержка языка Bash
+GenericName[sk]=Podpora Bash
+GenericName[sl]=Podpora bash
+GenericName[sr]=Bash подршка
+GenericName[sr@Latn]=Bash podrška
+GenericName[sv]=Bash-stöd
+GenericName[ta]=பாஷ் ஆதரவு
+GenericName[tg]=Ёри намудани забони Bash
+GenericName[tr]=Bash Desteği
+GenericName[zh_CN]=Bash 支持
+GenericName[zh_TW]=Bash 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevbashsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Bash
diff --git a/languages/bash/kdevbashsupport.rc b/languages/bash/kdevbashsupport.rc
new file mode 100644
index 00000000..d4592d6b
--- /dev/null
+++ b/languages/bash/kdevbashsupport.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevBashSupport" version="2">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar">
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/KDevCppSupportIface.cpp b/languages/cpp/KDevCppSupportIface.cpp
new file mode 100644
index 00000000..f5af83c9
--- /dev/null
+++ b/languages/cpp/KDevCppSupportIface.cpp
@@ -0,0 +1,24 @@
+
+#include "KDevCppSupportIface.h"
+#include "cppsupportpart.h"
+
+KDevCppSupportIface::KDevCppSupportIface( CppSupportPart* cppSupport )
+ : QObject( cppSupport ), DCOPObject( "KDevCppSupport" ), m_cppSupport( cppSupport )
+{
+}
+
+KDevCppSupportIface::~KDevCppSupportIface()
+{
+}
+
+void KDevCppSupportIface::addClass()
+{
+ m_cppSupport->slotNewClass();
+}
+
+void KDevCppSupportIface::parseProject()
+{
+ m_cppSupport->parseProject();
+}
+
+#include "KDevCppSupportIface.moc"
diff --git a/languages/cpp/KDevCppSupportIface.h b/languages/cpp/KDevCppSupportIface.h
new file mode 100644
index 00000000..34780d8c
--- /dev/null
+++ b/languages/cpp/KDevCppSupportIface.h
@@ -0,0 +1,27 @@
+
+#ifndef KDEVCPPSUPPORTIFACE_H
+#define KDEVCPPSUPPORTIFACE_H
+
+#include <qobject.h>
+#include <dcopobject.h>
+
+class CppSupportPart;
+
+class KDevCppSupportIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+public:
+ KDevCppSupportIface( CppSupportPart* cppSupport );
+ ~KDevCppSupportIface();
+
+k_dcop:
+ void addClass();
+ void parseProject();
+
+private:
+ CppSupportPart* m_cppSupport;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/Makefile.am b/languages/cpp/Makefile.am
new file mode 100644
index 00000000..30ba6d44
--- /dev/null
+++ b/languages/cpp/Makefile.am
@@ -0,0 +1,59 @@
+# Here resides the C/C++ support part.
+
+SUBDIRS = templates subclassing_template newclass_templates file_templates \
+ app_templates compiler pcsimporter debugger doc
+
+INCLUDES = -I$(top_srcdir)/languages/lib/designer_integration \
+ -I$(top_srcdir)/languages/lib/interfaces -I$(top_srcdir)/lib/catalog -I$(top_srcdir)/lib/compat \
+ -I$(top_srcdir)/lib/cppparser -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ -I$(top_builddir)/languages/lib/designer_integration -I$(top_builddir)/bdb/build_unix -I$(top_srcdir)/bdb/include \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevcppsupport.la
+libkdevcppsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevcppsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/catalog/libkdevcatalog.la $(top_builddir)/lib/cppparser/libkdevcppparser.la \
+ $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la \
+ $(top_builddir)/languages/lib/designer_integration/libdesignerintegration.la $(top_builddir)/lib/interfaces/libkdevinterfaces.la
+
+libkdevcppsupport_la_SOURCES = KDevCppSupportIface.cpp KDevCppSupportIface.skel \
+ addattributedialog.cpp addattributedialogbase.ui addmethoddialog.cpp addmethoddialogbase.ui \
+ ast_utils.cpp backgroundparser.cpp ccconfigwidget.cpp ccconfigwidgetbase.ui \
+ classgeneratorconfig.cpp classgeneratorconfigbase.ui codeinformationrepository.cpp \
+ completiondebug.cpp configproblemreporter.ui cppcodecompletion.cpp \
+ cppcodecompletionconfig.cpp cppevaluation.cpp cppimplementationwidget.cpp cppnewclassdlg.cpp \
+ cppnewclassdlgbase.ui cppsplitheadersourceconfig.cpp cppsupport_utils.cpp \
+ cppsupportfactory.cpp cppsupportpart.cpp creategettersetter.ui \
+ creategettersetterconfiguration.cpp creategettersetterconfiguration.h creategettersetterdialog.cpp \
+ creategettersetterdialog.h createpcsdialog.cpp createpcsdialogbase.ui doxydoc.cpp includefiles.cpp \
+ includepathresolver.cpp kdevdriver.cpp problemreporter.cpp qtbuildconfig.cpp \
+ qtdesignercppintegration.cpp setuphelper.cpp simplecontext.cpp simpletype.cpp simpletypecatalog.cpp \
+ simpletypefunction.cpp simpletypenamespace.cpp store_walker.cpp storeconverter.cpp \
+ stringhelpers.cpp subclassingdlg.cpp subclassingdlgbase.ui tag_creator.cpp typedesc.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevcppsupport.desktop kdevcsupport.desktop
+
+rcdir = $(kde_datadir)/kdevcppsupport
+rc_DATA = kdevcppsupport.rc
+
+templatedir = ${kde_datadir}/kdevabbrev/templates
+template_DATA = cpptemplates
+
+configurationdir = ${kde_datadir}/kdevcppsupport
+configuration_DATA = configuration
+
+AM_CXXFLAGS = -DAST_DEBUG
+
+#bin_PROGRAMS = r++
+#r___LDFLAGS = $(all_libraries)
+#r___SOURCES = main.cpp
+#r___DEPENDENCIES = libkdevcppsupport.la
+#r___LDADD = libkdevcppsupport.la $(top_builddir)/lib/catalog/libkdevcatalog.la $(top_builddir)/lib/cppparser/libkdevcppparser.la
+noinst_HEADERS = cppevaluation.h cppimplementationwidget.h \
+ cppsplitheadersourceconfig.h declarationinfo.h expressioninfo.h includefiles.h includepathresolver.h \
+ qtdesignercppintegration.h setuphelper.h simplecontext.h simpletypecatalog.h simpletypefunction.h \
+ simpletypenamespace.h storeconverter.h
diff --git a/languages/cpp/README.dox b/languages/cpp/README.dox
new file mode 100644
index 00000000..ba1fbc05
--- /dev/null
+++ b/languages/cpp/README.dox
@@ -0,0 +1,34 @@
+/** \class CppSupportPart
+Provides C/C++ language support for KDevelop.
+
+Well the first thing you should read is lib/catalog it contains the source of the persistant class store
+after that languages/cpp/tag_creator.*
+it is the component that stores the informations collected by the c++ parser into the PCS
+then you can play with KDevPCSImporter the code of the dialog is in languages/cpp/createpcsdialog* and languages/cpp/pcsimporter/*
+and of course lib/interfaces/kdevpcsimporter.*
+and if you want play with the c++ parser go to lib/cppparser/, the best is to start to read driver.*
+
+\authors <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+
+\maintainer <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+
+\feature supports C/C++ language
+\feature can do code completion
+\feature has presistent class store
+\feature code highlight
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=cppsupport&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">cppsupport component at Bugzilla database</a>
+
+\faq <b>How can I have documentation on functions when using codecompletion ?</b>
+ -# Create the xml-output with <a href="http://www.doxygen.org">Doxygen</a> of the files you want to add to the classstore
+ -# Create the new PCS-database with r++. Now you have to use the -d command line switch of r++ to have it include the documentation.
+ It is used like -d/path/of/doxygen/xml/output (notice that there is _no_ whitespace between -d and the path!).
+ You can use it multiple times to have r++ search for the informations in different directories.
+ r++ -d has to be used (like every other commandline switch) before you write the directories you want r++ to create the PCSdatabase from.
+ -# Activate your newly created Database in the Project->Project Options...->C++ Specific->Code Completion...
+ .
+\faq <b>How does this work ?</b> I have no clue. Ask roberto! :)
+\faq <b>How does r++ work ?</b> I have no clue. Ask roberto! :)
+
+*/
diff --git a/languages/cpp/addattributedialog.cpp b/languages/cpp/addattributedialog.cpp
new file mode 100644
index 00000000..408b2ff8
--- /dev/null
+++ b/languages/cpp/addattributedialog.cpp
@@ -0,0 +1,265 @@
+/*
+* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public
+* License as published by the Free Software Foundation; either
+* version 2 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; see the file COPYING.LIB. If not, write to
+* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+*/
+
+#include "addattributedialog.h"
+#include "cppsupportpart.h"
+#include "backgroundparser.h"
+#include "cppsupport_utils.h"
+
+#include <kdevpartcontroller.h>
+
+#include <codemodel.h>
+
+#include <kfiledialog.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <klineedit.h>
+
+#include <qfileinfo.h>
+#include <qcombobox.h>
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qtextstream.h>
+
+AddAttributeDialog::AddAttributeDialog( CppSupportPart* cppSupport, ClassDom klass,
+ QWidget* parent, const char* name, bool modal, WFlags fl )
+: AddAttributeDialogBase( parent, name, modal, fl ), m_cppSupport( cppSupport ), m_klass( klass ), m_count( 0 )
+{
+ access->insertStringList( QStringList() << "Public" << "Protected" << "Private" );
+
+ storage->insertStringList( QStringList() << "Normal" << "Static" );
+
+ returnType->setAutoCompletion( true );
+ returnType->insertStringList( QStringList()
+ << "void"
+ << "char"
+ << "wchar_t"
+ << "bool"
+ << "short"
+ << "int"
+ << "long"
+ << "signed"
+ << "unsigned"
+ << "float"
+ << "double" );
+
+ returnType->insertStringList( typeNameList( m_cppSupport->codeModel() ) );
+
+ updateGUI();
+ addAttribute();
+}
+
+AddAttributeDialog::~AddAttributeDialog()
+{}
+
+void AddAttributeDialog::reject()
+{
+ QDialog::reject();
+}
+
+void AddAttributeDialog::accept()
+{
+ m_cppSupport->partController()->editDocument( KURL( m_klass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_cppSupport->partController() ->activePart() );
+ if ( !editIface )
+ {
+ /// @todo show messagebox
+ QDialog::accept();
+ return ;
+ }
+
+ int line, column;
+ m_klass->getEndPosition( &line, &column );
+
+ // compute the insertion point map
+ QMap<QString, QPair<int, int> > points;
+ QStringList accessList;
+
+ const VariableList variableList = m_klass->variableList();
+ for ( VariableList::ConstIterator it = variableList.begin(); it != variableList.end(); ++it )
+ {
+ int varEndLine, varEndColumn;
+ ( *it ) ->getEndPosition( &varEndLine, &varEndColumn );
+ QString access = accessID( *it );
+ QPair<int, int> varEndPoint = qMakePair( varEndLine, varEndColumn );
+
+ if ( !points.contains( access ) || points[ access ] < varEndPoint )
+ {
+ accessList.remove( access );
+ accessList.push_back( access ); // move 'access' at the end of the list
+
+ points[ access ] = varEndPoint;
+ }
+ }
+
+ int insertedLine = 0;
+
+ accessList += newAccessList( accessList );
+
+ for ( QStringList::iterator it = accessList.begin(); it != accessList.end(); ++it )
+ {
+ QListViewItem* item = attributes->firstChild();
+ while ( item )
+ {
+ QListViewItem * currentItem = item;
+
+ item = item->nextSibling();
+
+ if ( currentItem->text( 0 ) != *it )
+ continue;
+
+ QString access = ( *it ).lower();
+
+ QString str = variableDeclaration( currentItem );
+
+ QPair<int, int> pt;
+ if ( points.contains( *it ) )
+ {
+ pt = points[ *it ];
+ }
+ else
+ {
+ str.prepend( access + ":\n" );
+ points[ *it ] = qMakePair( line - 1, 0 );
+ pt = points[ *it ]; // end of class declaration
+ }
+
+ editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str );
+ insertedLine += str.contains( QChar( '\n' ) );
+ }
+ }
+
+ m_cppSupport->backgroundParser() ->addFile( m_klass->fileName() );
+
+ QDialog::accept();
+}
+
+QString AddAttributeDialog::variableDeclaration( QListViewItem* item ) const
+{
+ QString str;
+ QTextStream stream( &str, IO_WriteOnly );
+ QString ind;
+ ind.fill( QChar( ' ' ), 4 );
+
+ stream << ind;
+ if ( item->text( 1 ) == "Static" )
+ stream << "static ";
+ stream << item->text( 2 ) << " " << item->text( 3 );
+ stream << ";\n";
+
+ return str;
+}
+
+
+void AddAttributeDialog::updateGUI()
+{
+ bool enable = attributes->selectedItem() != 0;
+
+ returnType->setEnabled( enable );
+ declarator->setEnabled( enable );
+ access->setEnabled( enable );
+ storage->setEnabled( enable );
+
+ deleteAttributeButton->setEnabled( enable );
+
+ if ( enable )
+ {
+ QListViewItem * item = attributes->selectedItem();
+ item->setText( 0, access->currentText() );
+ item->setText( 1, storage->currentText() );
+ item->setText( 2, returnType->currentText() );
+ item->setText( 3, declarator->text() );
+ }
+}
+
+void AddAttributeDialog::addAttribute()
+{
+ QListViewItem * item = new QListViewItem( attributes, "Protected", "Normal",
+ "int", QString( "attribute_%1" ).arg( ++m_count ) );
+ attributes->setCurrentItem( item );
+ attributes->setSelected( item, true );
+
+ returnType->setFocus();
+}
+
+void AddAttributeDialog::deleteCurrentAttribute()
+{
+ delete( attributes->currentItem() );
+}
+
+void AddAttributeDialog::currentChanged( QListViewItem* item )
+{
+ if ( item )
+ {
+ QString _access = item->text( 0 );
+ QString _storage = item->text( 1 );
+ QString _returnType = item->text( 2 );
+ QString _declarator = item->text( 3 );
+
+ access->setCurrentText( _access );
+ storage->setCurrentText( _storage );
+ returnType->setCurrentText( _returnType );
+ declarator->setText( _declarator );
+ }
+
+ updateGUI();
+}
+
+QStringList AddAttributeDialog::newAccessList( const QStringList& accessList ) const
+{
+ QStringList newAccessList;
+
+ QListViewItem* item = attributes->firstChild();
+ while ( item )
+ {
+ QListViewItem * currentItem = item;
+
+ item = item->nextSibling();
+
+ QString access = currentItem->text( 0 );
+ if ( !( accessList.contains( access ) || newAccessList.contains( access ) ) )
+ newAccessList.push_back( access );
+ }
+
+ return newAccessList;
+}
+
+QString AddAttributeDialog::accessID( VariableDom var ) const
+{
+ switch ( var->access() )
+ {
+ case CodeModelItem::Public:
+ return QString::fromLatin1( "Public" );
+
+ case CodeModelItem::Protected:
+ return QString::fromLatin1( "Protected" );
+
+ case CodeModelItem::Private:
+ return QString::fromLatin1( "Private" );
+ }
+
+ return QString::null;
+}
+
+#include "addattributedialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
diff --git a/languages/cpp/addattributedialog.h b/languages/cpp/addattributedialog.h
new file mode 100644
index 00000000..18818ef7
--- /dev/null
+++ b/languages/cpp/addattributedialog.h
@@ -0,0 +1,60 @@
+/*
+* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public
+* License as published by the Free Software Foundation; either
+* version 2 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; see the file COPYING.LIB. If not, write to
+* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef ADDATTRIBUTEDIALOG_H
+#define ADDATTRIBUTEDIALOG_H
+
+#include "addattributedialogbase.h"
+#include <codemodel.h>
+
+class CppSupportPart;
+
+class AddAttributeDialog : public AddAttributeDialogBase
+{
+ Q_OBJECT
+public:
+ AddAttributeDialog( CppSupportPart* cppSupport, ClassDom klass,
+ QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~AddAttributeDialog();
+
+ virtual void addAttribute();
+ virtual void deleteCurrentAttribute();
+ virtual void currentChanged( QListViewItem* item );
+ virtual void updateGUI();
+
+protected:
+ virtual void reject();
+ virtual void accept();
+
+private:
+ QString accessID( VariableDom var ) const;
+ QStringList newAccessList( const QStringList& accessList ) const;
+ QString variableDeclaration( QListViewItem* item ) const;
+
+private:
+ CppSupportPart* m_cppSupport;
+ ClassDom m_klass;
+ int m_count;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
diff --git a/languages/cpp/addattributedialogbase.ui b/languages/cpp/addattributedialogbase.ui
new file mode 100644
index 00000000..eabd89fe
--- /dev/null
+++ b/languages/cpp/addattributedialogbase.ui
@@ -0,0 +1,375 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddAttributeDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddAttributeDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>619</width>
+ <height>413</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Attribute</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Storage</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Declarator</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>attributes</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>111</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addAttributeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Attribute</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>deleteAttributeButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Attribute</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Attribute Properties</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>T&amp;ype:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>returnType</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="0">
+ <property name="name">
+ <cstring>returnType</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>declarator</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;eclarator:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>declarator</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>storage</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;torage:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>storage</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Acce&amp;ss:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>access</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="0">
+ <property name="name">
+ <cstring>access</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>addAttributeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>addAttribute()</slot>
+ </connection>
+ <connection>
+ <sender>deleteAttributeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>deleteCurrentAttribute()</slot>
+ </connection>
+ <connection>
+ <sender>attributes</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>currentChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>returnType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>declarator</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>access</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>storage</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>returnType</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddAttributeDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>attributes</tabstop>
+ <tabstop>addAttributeButton</tabstop>
+ <tabstop>deleteAttributeButton</tabstop>
+ <tabstop>returnType</tabstop>
+ <tabstop>declarator</tabstop>
+ <tabstop>access</tabstop>
+ <tabstop>storage</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot>addAttribute()</slot>
+ <slot>deleteCurrentAttribute()</slot>
+ <slot>currentChanged(QListViewItem*)</slot>
+ <slot>updateGUI()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/addmethoddialog.cpp b/languages/cpp/addmethoddialog.cpp
new file mode 100644
index 00000000..943f15d7
--- /dev/null
+++ b/languages/cpp/addmethoddialog.cpp
@@ -0,0 +1,420 @@
+/*
+* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public
+* License as published by the Free Software Foundation; either
+* version 2 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; see the file COPYING.LIB. If not, write to
+* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+*/
+
+#include "addmethoddialog.h"
+#include "cppsupportpart.h"
+#include "backgroundparser.h"
+#include "cppsupport_utils.h"
+#include "domutil.h"
+
+#include <kdevpartcontroller.h>
+#include <kdevcreatefile.h>
+
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <kdebug.h>
+#include <klineedit.h>
+
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qcombobox.h>
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qtextstream.h>
+
+AddMethodDialog::AddMethodDialog( CppSupportPart* cppSupport, ClassDom klass,
+ QWidget* parent, const char* name, bool modal, WFlags fl )
+: AddMethodDialogBase( parent, name, modal, fl ), m_cppSupport( cppSupport ), m_klass( klass ), m_count( 0 )
+{
+ QString fileName = m_klass->fileName();
+
+ access->insertStringList( QStringList() << "Public" << "Protected" << "Private" << "Signals" <<
+ "Public Slots" << "Protected Slots" << "Private Slots" );
+
+ storage->insertStringList( QStringList() << "Normal" << "Static" << "Virtual" << "Pure Virtual" << "Friend" );
+
+ // setup sourceFile combo
+ QMap<QString, bool> m;
+#if 0 /// \FIXME ROBE
+
+ FunctionList l = m_klass->functionList();
+ {
+ for ( FunctionList::Iterator it = l.begin(); it != l.end(); ++it )
+ {
+ if ( ( *it ) ->hasImplementation() )
+ m.insert( ( *it ) ->implementedInFile(), true );
+ }
+ }
+#endif
+
+ {
+ QStringList headers = QStringList::split( ",", "h,H,hh,hxx,hpp,inl,tlh,diff,ui.h" );
+ QStringList fileList;
+ QMap<QString, bool>::Iterator it = m.begin();
+ while ( it != m.end() )
+ {
+ QString ext = QFileInfo( it.key() ).extension();
+ if ( !headers.contains( ext ) )
+ sourceFile->insertItem( it.key() );
+ ++it;
+ }
+
+ if ( sourceFile->count() == 0 )
+ {
+ QFileInfo info( fileName );
+ QString impl = DomUtil::readEntry( *cppSupport->projectDom(), "/cppsupportpart/filetemplates/implementationsuffix", "cpp" );
+ sourceFile->insertItem( info.dirPath( true ) + "/" + info.baseName() + impl );
+ }
+ }
+
+ returnType->setAutoCompletion( true );
+ returnType->insertStringList( QStringList()
+ << "void"
+ << "char"
+ << "wchar_t"
+ << "bool"
+ << "short"
+ << "int"
+ << "long"
+ << "signed"
+ << "unsigned"
+ << "float"
+ << "double" );
+
+ returnType->insertStringList( typeNameList( m_cppSupport->codeModel() ) );
+
+ updateGUI();
+ addMethod();
+}
+
+AddMethodDialog::~AddMethodDialog()
+{}
+
+void AddMethodDialog::reject()
+{
+ QDialog::reject();
+}
+
+QString AddMethodDialog::accessID( FunctionDom fun ) const
+{
+ if ( fun->isSignal() )
+ return QString::fromLatin1( "Signals" );
+
+ switch ( fun->access() )
+ {
+ case CodeModelItem::Public:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "Public Slots" );
+ return QString::fromLatin1( "Public" );
+
+ case CodeModelItem::Protected:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "Protected Slots" );
+ return QString::fromLatin1( "Protected" );
+
+ case CodeModelItem::Private:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "Private Slots" );
+ return QString::fromLatin1( "Private" );
+ }
+
+ return QString::null;
+}
+
+void AddMethodDialog::accept()
+{
+ m_cppSupport->partController() ->editDocument( KURL( m_klass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_cppSupport->partController() ->activePart() );
+ if ( !editIface )
+ {
+ /// @todo show messagebox
+ QDialog::accept();
+ return ;
+ }
+
+ int line, column;
+ m_klass->getEndPosition( &line, &column );
+
+ // compute the insertion point map
+ QMap<QString, QPair<int, int> > points;
+ QStringList accessList;
+
+ const FunctionList functionList = m_klass->functionList();
+ for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it )
+ {
+ int funEndLine, funEndColumn;
+ ( *it ) ->getEndPosition( &funEndLine, &funEndColumn );
+ QString access = accessID( *it );
+ QPair<int, int> funEndPoint = qMakePair( funEndLine, funEndColumn );
+
+ if ( !points.contains( access ) || points[ access ] < funEndPoint )
+ {
+ accessList.remove( access );
+ accessList.push_back( access ); // move 'access' at the end of the list
+
+ points[ access ] = funEndPoint;
+ }
+ }
+
+ int insertedLine = 0;
+
+ accessList += newAccessList( accessList );
+
+ for ( QStringList::iterator it = accessList.begin(); it != accessList.end(); ++it )
+ {
+ QListViewItem* item = methods->firstChild();
+ while ( item )
+ {
+ QListViewItem * currentItem = item;
+
+ item = item->nextSibling();
+
+ if ( currentItem->text( 1 ) != *it )
+ continue;
+
+ QString access = ( *it ).lower();
+
+ bool isInline = currentItem->text( 0 ) == "True";
+ QString str = isInline ? functionDefinition( currentItem ) : functionDeclaration( currentItem );
+
+ QPair<int, int> pt;
+ if ( points.contains( *it ) )
+ {
+ pt = points[ *it ];
+ }
+ else
+ {
+ str.prepend( access + ":\n" );
+ points[ *it ] = qMakePair( line - 1, 0 );
+ pt = points[ *it ]; // end of class declaration
+ }
+
+ editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str );
+ insertedLine += str.contains( QChar( '\n' ) );
+ }
+ }
+
+ m_cppSupport->backgroundParser() ->addFile( m_klass->fileName() );
+
+ QString str;
+ QListViewItem* item = methods->firstChild();
+ while ( item )
+ {
+ QListViewItem * currentItem = item;
+
+ item = item->nextSibling();
+
+ QString str = functionDefinition( currentItem );
+ if ( str.isEmpty() )
+ continue;
+
+ QString implementationFile = currentItem->text( 5 );
+ if ( currentItem->text( 0 ) == "True" )
+ implementationFile = m_klass->fileName();
+
+ QFileInfo fileInfo( implementationFile );
+ if ( !QFile::exists( fileInfo.absFilePath() ) )
+ {
+ if ( KDevCreateFile * createFileSupp = m_cppSupport->extension<KDevCreateFile>( "KDevelop/CreateFile" ) )
+ createFileSupp->createNewFile( fileInfo.extension(), fileInfo.dirPath( true ), fileInfo.baseName() );
+ }
+
+ m_cppSupport->partController() ->editDocument( KURL( implementationFile ) );
+ editIface = dynamic_cast<KTextEditor::EditInterface*>( m_cppSupport->partController() ->activePart() );
+ if ( !editIface )
+ continue;
+
+ bool isInline = currentItem->text( 0 ) == "True";
+ if ( !isInline )
+ {
+ editIface->insertLine( editIface->numLines(), QString::fromLatin1( "" ) );
+ editIface->insertText( editIface->numLines() - 1, 0, str );
+ m_cppSupport->backgroundParser() ->addFile( implementationFile );
+ }
+ }
+
+ QDialog::accept();
+}
+
+void AddMethodDialog::updateGUI()
+{
+ bool enable = methods->selectedItem() != 0;
+
+ returnType->setEnabled( enable );
+ declarator->setEnabled( enable );
+ access->setEnabled( enable );
+ storage->setEnabled( enable );
+ isInline->setEnabled( enable );
+
+ sourceFile->setEnabled( enable );
+ browseButton->setEnabled( enable );
+
+ deleteMethodButton->setEnabled( enable );
+
+ if ( enable )
+ {
+ QListViewItem * item = methods->selectedItem();
+ item->setText( 0, isInline->isChecked() ? "True" : "False" );
+ item->setText( 1, access->currentText() );
+ item->setText( 2, storage->currentText() );
+ item->setText( 3, returnType->currentText() );
+ item->setText( 4, declarator->text() );
+ item->setText( 5, sourceFile->currentText() );
+
+ if ( isInline->isChecked() || storage->currentText() == "Friend" || storage->currentText() == "Pure Virtual" )
+ {
+ sourceFile->setEnabled( false );
+ browseButton->setEnabled( false );
+ }
+ }
+}
+
+void AddMethodDialog::addMethod()
+{
+ QListViewItem * item = new QListViewItem( methods, "False", "Public", "Normal",
+ "void", QString( "method_%1()" ).arg( ++m_count ),
+ sourceFile->currentText() );
+ methods->setCurrentItem( item );
+ methods->setSelected( item, true );
+
+ returnType->setFocus();
+}
+
+void AddMethodDialog::deleteCurrentMethod()
+{
+ delete( methods->currentItem() );
+ updateGUI();
+}
+
+void AddMethodDialog::currentChanged( QListViewItem* item )
+{
+ if ( item )
+ {
+ QString _isInline = item->text( 0 );
+ QString _access = item->text( 1 );
+ QString _storage = item->text( 2 );
+ QString _returnType = item->text( 3 );
+ QString _declarator = item->text( 4 );
+ QString _sourceFile = item->text( 5 );
+
+ isInline->setChecked( _isInline == "True" ? true : false );
+ access->setCurrentText( _access );
+ storage->setCurrentText( _storage );
+ returnType->setCurrentText( _returnType );
+ declarator->setText( _declarator );
+ sourceFile->setCurrentText( _sourceFile );
+ }
+
+ updateGUI();
+}
+
+void AddMethodDialog::browseImplementationFile()
+{
+ QString fileName = KFileDialog::getOpenFileName();
+ sourceFile->setCurrentText( fileName );
+ updateGUI();
+}
+
+QString AddMethodDialog::functionDeclaration( QListViewItem * item ) const
+{
+ QString str;
+ QTextStream stream( &str, IO_WriteOnly );
+
+ QString access = item->text( 1 ).lower();
+
+ stream << " "; /// @todo use AStyle
+ if ( item->text( 2 ) == "Virtual" || item->text( 2 ) == "Pure Virtual" )
+ stream << "virtual ";
+ else if ( item->text( 2 ) == "Friend" )
+ stream << "friend ";
+ else if ( item->text( 2 ) == "Static" )
+ stream << "static ";
+ stream << item->text( 3 ) << " " << item->text( 4 );
+ if ( item->text( 2 ) == "Pure Virtual" )
+ stream << " = 0";
+ stream << ";\n";
+
+ return str;
+}
+
+QString AddMethodDialog::functionDefinition( QListViewItem* item ) const
+{
+ if ( item->text( 1 ) == "Signals" || item->text( 2 ) == "Pure Virtual" ||
+ item->text( 2 ) == "Friend" )
+ {
+ return QString::null;
+ }
+
+ QString className = m_klass->name();
+ QString fullName = m_klass->scope().join( "::" );
+ if ( !fullName.isEmpty() )
+ fullName += "::";
+ fullName += className;
+
+ QString str;
+ QTextStream stream( &str, IO_WriteOnly );
+
+ bool isInline = item->text( 0 ) == "True";
+
+ QString ind;
+ if ( isInline )
+ ind.fill( QChar( ' ' ), 4 );
+
+ stream << "\n"
+ << ind << "/*!\n"
+ << ind << " \\fn " << fullName << "::" << item->text( 4 ) << "\n"
+ << ind << " */\n";
+
+ stream
+ << ind << item->text( 3 ) << " " << ( isInline ? QString::fromLatin1( "" ) : fullName + "::" )
+ << item->text( 4 ) << "\n"
+ << ind << "{\n"
+ << ind << " /// @todo implement me\n"
+ << ind << "}\n";
+
+ return str;
+}
+
+QStringList AddMethodDialog::newAccessList( const QStringList& accessList ) const
+{
+ QStringList newAccessList;
+
+ QListViewItem* item = methods->firstChild();
+ while ( item )
+ {
+ QListViewItem * currentItem = item;
+
+ item = item->nextSibling();
+
+ QString access = currentItem->text( 1 );
+ if ( !( accessList.contains( access ) || newAccessList.contains( access ) ) )
+ newAccessList.push_back( access );
+ }
+
+ return newAccessList;
+}
+
+#include "addmethoddialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
diff --git a/languages/cpp/addmethoddialog.h b/languages/cpp/addmethoddialog.h
new file mode 100644
index 00000000..695ddc80
--- /dev/null
+++ b/languages/cpp/addmethoddialog.h
@@ -0,0 +1,62 @@
+/*
+* Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public
+* License as published by the Free Software Foundation; either
+* version 2 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; see the file COPYING.LIB. If not, write to
+* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+* Boston, MA 02111-1307, USA.
+*
+*/
+
+#ifndef ADDMETHODDIALOG_H
+#define ADDMETHODDIALOG_H
+
+#include "addmethoddialogbase.h"
+#include <codemodel.h>
+
+class CppSupportPart;
+
+class AddMethodDialog : public AddMethodDialogBase
+{
+ Q_OBJECT
+public:
+ AddMethodDialog( CppSupportPart* cppSupport, ClassDom klass,
+ QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~AddMethodDialog();
+
+ virtual void addMethod();
+ virtual void deleteCurrentMethod();
+ virtual void currentChanged( QListViewItem* item );
+ virtual void updateGUI();
+ virtual void browseImplementationFile();
+
+protected:
+ virtual void reject();
+ virtual void accept();
+
+private:
+ QString accessID( FunctionDom fun ) const;
+ QString functionDeclaration( QListViewItem* item ) const;
+ QString functionDefinition( QListViewItem* item ) const;
+ QStringList newAccessList( const QStringList& accessList ) const;
+
+private:
+ CppSupportPart* m_cppSupport;
+ ClassDom m_klass;
+ int m_count;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
diff --git a/languages/cpp/addmethoddialogbase.ui b/languages/cpp/addmethoddialogbase.ui
new file mode 100644
index 00000000..5ab3f769
--- /dev/null
+++ b/languages/cpp/addmethoddialogbase.ui
@@ -0,0 +1,459 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddMethodDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddMethodDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>613</width>
+ <height>568</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Method</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Inline</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Storage</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Return Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Declarator</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>methods</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>111</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addMethodButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Method</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>deleteMethodButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete Method</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Method Properties</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Return t&amp;ype:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>returnType</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="0">
+ <property name="name">
+ <cstring>returnType</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>declarator</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>D&amp;eclarator:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>declarator</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>storage</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;torage:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>storage</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>isInline</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Inline</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Acce&amp;ss:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>access</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="0">
+ <property name="name">
+ <cstring>access</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>I&amp;mplementation File</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>sourceFile</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>browseButton</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>addMethodButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>addMethod()</slot>
+ </connection>
+ <connection>
+ <sender>deleteMethodButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>deleteCurrentMethod()</slot>
+ </connection>
+ <connection>
+ <sender>methods</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>currentChanged(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>returnType</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>declarator</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>access</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>isInline</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>storage</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>returnType</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>sourceFile</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>sourceFile</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>updateGUI()</slot>
+ </connection>
+ <connection>
+ <sender>browseButton</sender>
+ <signal>clicked()</signal>
+ <receiver>AddMethodDialogBase</receiver>
+ <slot>browseImplementationFile()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>methods</tabstop>
+ <tabstop>addMethodButton</tabstop>
+ <tabstop>deleteMethodButton</tabstop>
+ <tabstop>returnType</tabstop>
+ <tabstop>declarator</tabstop>
+ <tabstop>access</tabstop>
+ <tabstop>storage</tabstop>
+ <tabstop>isInline</tabstop>
+ <tabstop>sourceFile</tabstop>
+ <tabstop>browseButton</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">init()</slot>
+ <slot access="protected">destroy()</slot>
+ <slot>addMethod()</slot>
+ <slot>deleteCurrentMethod()</slot>
+ <slot>currentChanged(QListViewItem*)</slot>
+ <slot>updateGUI()</slot>
+ <slot>browseImplementationFile()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/app_templates/Makefile.am b/languages/cpp/app_templates/Makefile.am
new file mode 100644
index 00000000..a075677f
--- /dev/null
+++ b/languages/cpp/app_templates/Makefile.am
@@ -0,0 +1,10 @@
+SUBDIRS = kapp kpartapp kpartplugin kcmodule kicker kioslave kdevpart kdevpart2 chello cpphello kscreensaver kofficepart chello_gba dcopservice konqnavpanel qmakesimple qmakeapp qt4makeapp khello khello2 kateplugin kateplugin2 qtopiaapp kdedcop wxhello cppsdlhello kconfig35 kdevlang noatunvisual noatunui kmod kfileplugin clanlib opieapp opieapplet opieinput opiemenu opienet opietoday kxt gtk2mmapp cppcurseshello win32hello win32gui cmakesimple cmakesimplec cmakelibcpp cmakelibc kscons_kxt kscons_kmdi qt4hello qmakeempty automakeempty makefileempty qtopia4app kde4app
+
+profilescdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE
+profilesc_DATA = c.appwizard
+
+profilescppdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE
+profilescpp_DATA = cpp.appwizard
+
+profileskdecppdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE
+profileskdecpp_DATA = kdecpp.appwizard
diff --git a/languages/cpp/app_templates/automakeempty/Makefile.am b/languages/cpp/app_templates/automakeempty/Makefile.am
new file mode 100644
index 00000000..461e4322
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = automakeempty-Makefile.am automakeempty-Makefile.cvs \
+ configure.in automakeempty.png app.kdevelop
+templateName = automakeempty
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/automakeempty/app.kdevelop b/languages/cpp/app_templates/automakeempty/app.kdevelop
new file mode 100644
index 00000000..6cadd049
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/app.kdevelop
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ </general>
+ <run>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.am
@@ -0,0 +1 @@
+
diff --git a/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/automakeempty-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate b/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate
new file mode 100644
index 00000000..db3cdd13
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/automakeempty.kdevtemplate
@@ -0,0 +1,99 @@
+# KDE Config File
+[General]
+Name=Empty Autotools Template
+Name[ca]=Plantilla Autotools buida
+Name[da]=Tom Autotools-skabelon
+Name[de]=Leere Autotools-Vorlage
+Name[el]=Κενό πρότυπο των Autotools
+Name[es]=Plantilla Autotools vacía
+Name[et]=Tühi autotoolsi mall
+Name[hu]=Üres Autotools sablon
+Name[it]=Modello di autotools vuoto
+Name[nds]=Leddig Vörlaag för Automake un sien Kanuten
+Name[nl]=Leeg Autotools-sjabloon
+Name[pl]=Pusty szablon Autotools
+Name[pt]=Modelo de Autotools Vazio
+Name[pt_BR]=Modelo de Autotools Vazio
+Name[ru]=Пустой шаблон autotools
+Name[sk]=Prázdna šablóna Autotools
+Name[sr]=Празан шаблон Autotools-а
+Name[sr@Latn]=Prazan šablon Autotools-a
+Name[sv]=Tom mall för Autotools
+Name[zh_TW]=空的 Autotools 樣板
+Icon=automakeempty.png
+Category=C++/Automake project
+Comment=Generate an empty Automake based application
+Comment[ca]=Genera una aplicació buida basada en Automake
+Comment[da]=Opretter et tomt Automake-baseret program
+Comment[de]=Erstellt eine leere auf Automake basierende Anwendung
+Comment[el]=Δημιουργία μίας κενής εφαρμογής βασισμένης στο Automake
+Comment[es]=Genera una aplicación vacía basada en Automake
+Comment[et]=Tühja rakenduse loomine Automake'i põhjal
+Comment[hu]=Létrehoz egy üres Automake-alapú alkalmazást
+Comment[it]=Genera un'applicazione basata su un Automake vuoto
+Comment[nds]=Stellt en leddig Programm op, dat op Automake opbuut
+Comment[nl]=Genereer een leeg op Automake gebaseerd programma
+Comment[pl]=Generuje pusty program używający Automake
+Comment[pt]=Gera uma aplicação vazia baseada no Automake
+Comment[pt_BR]=Gera uma aplicação vazia baseada no Automake
+Comment[ru]=Создать пустое приложение, использующее Automake
+Comment[sk]=Vygeneruje prázdnu aplikáciu založenú na Automake
+Comment[sr]=Прави празан програм на основу Automake-а
+Comment[sr@Latn]=Pravi prazan program na osnovu Automake-a
+Comment[sv]=Skapar ett tomt Automake-baserat program
+Comment[zh_TW]=產生一個空的使用 Automake 的應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+Archive=automakeempty.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE2]
+Type=install
+Source=%{src}/automakeempty-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/automakeempty-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[MSG]
+Type=message
+Comment=An Automake based application was created in %{dest}
+Comment[ca]=S'ha creat una aplicació basada en Automake en %{dest}
+Comment[da]=Et Automake-baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf Automake basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μία εφαρμογή βασισμένη στο Automake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en Automake ha sido creada en %{dest}
+Comment[et]=Rakendus Automake'i põhjal loodi asukohta %{dest}
+Comment[hu]=Létrejött egy Automake-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su automake in %{dest}
+Comment[nds]=In %{dest} wöör en op Automake opbuut Programm opstellt
+Comment[nl]=Een Automake-gebaseerd programma is aangemaakt in %{dest}
+Comment[pl]=Program używający Automake został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada no Automake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada no Automake em %{dest}
+Comment[ru]=Использующее Automake приложение создано в %{dest}
+Comment[sk]=Aplikácia založená na Automake bola vytvorená v %{dest}
+Comment[sr]=Програм на основи Automake-а направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovi Automake-a napravljen je u %{dest}
+Comment[sv]=Ett Automake-baserat program skapades i %{dest}
+Comment[zh_TW]=一個以 Automake 為基礎的應用程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/automakeempty/automakeempty.png b/languages/cpp/app_templates/automakeempty/automakeempty.png
new file mode 100644
index 00000000..519c007b
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/automakeempty.png
Binary files differ
diff --git a/languages/cpp/app_templates/automakeempty/configure.in b/languages/cpp/app_templates/automakeempty/configure.in
new file mode 100644
index 00000000..7464579b
--- /dev/null
+++ b/languages/cpp/app_templates/automakeempty/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_CPLUSPLUS
+AC_PROG_CXX
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile)
diff --git a/languages/cpp/app_templates/c.appwizard b/languages/cpp/app_templates/c.appwizard
new file mode 100644
index 00000000..14009287
--- /dev/null
+++ b/languages/cpp/app_templates/c.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=chello,chellogba,cmakelibc,cmakesimplec,kmod,prc-tool
diff --git a/languages/cpp/app_templates/chello/.kdev_ignore b/languages/cpp/app_templates/chello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/chello/.kdev_ignore
diff --git a/languages/cpp/app_templates/chello/Makefile.am b/languages/cpp/app_templates/chello/Makefile.am
new file mode 100644
index 00000000..f7c9742a
--- /dev/null
+++ b/languages/cpp/app_templates/chello/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.c src-Makefile.am c-Makefile.am c-Makefile.cvs \
+ configure.in chello.png app.kdevelop
+
+templateName = chello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/chello/app.kdevelop b/languages/cpp/app_templates/chello/app.kdevelop
new file mode 100644
index 00000000..521c9f89
--- /dev/null
+++ b/languages/cpp/app_templates/chello/app.kdevelop
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <keywords>
+ <keyword>C</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O2 -g0 %{CFLAGS}</cflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O0 -g3 %{CFLAGS}</cflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="c"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.c" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/chello/c-Makefile.am b/languages/cpp/app_templates/chello/c-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/chello/c-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/chello/c-Makefile.cvs b/languages/cpp/app_templates/chello/c-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/chello/c-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/chello/chello.kdevtemplate b/languages/cpp/app_templates/chello/chello.kdevtemplate
new file mode 100644
index 00000000..8f2ea5dc
--- /dev/null
+++ b/languages/cpp/app_templates/chello/chello.kdevtemplate
@@ -0,0 +1,253 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[ca]=Simple programa Hello world
+Name[da]=Simpelt Goddag verden program
+Name[de]=Ein einfaches "Hello World"-Programm
+Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo» sencillo
+Name[et]=Lihtne "Tere, maailm" programm
+Name[eu]="Kaixo mundua" programa sinplea
+Name[fa]=برنامۀ سادۀ Hello world
+Name[fr]=Programme « Bonjour monde » simple
+Name[ga]=Ríomhchlár simplí "Hello World"
+Name[gl]=Programa sinxelo Ola mundo
+Name[hu]=Egyszerű Hello world program
+Name[it]=Semplice programma di "Hello world"
+Name[ja]=簡単な Hello world プログラム
+Name[ms]=Program Hello World mudah
+Name[nds]=En eenfach "Moin Welt"-Programm
+Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Eenvoudig 'Hello World' programma
+Name[pl]=Prosty program witaj świecie
+Name[pt]=Programa simples Olá Mundo
+Name[pt_BR]=Programa simples Olá Mundo
+Name[ru]=Простая программа Hello world
+Name[sk]=Jednoduchý "Ahoj svet" program
+Name[sl]=Preprost program Hello world
+Name[sr]=Једноставан „Здраво свете“ програм
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program
+Name[sv]=Enkelt Hello world-program
+Name[tr]=Basit Merhaba dünya programı
+Name[zh_CN]=简单的 Hello world 程序
+Name[zh_TW]=簡單的 Hello world 程式
+Icon=chello.png
+Category=C
+Comment=Generates a simple Hello world program in C
+Comment[ca]=Genera un simple programa de Hello world en C
+Comment[da]=Genererer et simpelt Goddag verden program i C
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C
+Comment[es]=Genera un sencillo programa «Hola mundo» en C
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C-s
+Comment[eu]="Kaixo mundua" programa sinplea bat sortzen du C lengoaian
+Comment[fa]=یک برنامۀ سادۀ Hello world در سی تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en C
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C
+Comment[gl]=Xera un programa sinxelo Ola mundo en C
+Comment[hu]=Létrehoz egy egyszerű Hello world programot C nyelven
+Comment[it]=Genera un semplice programma di "Hello world" in C
+Comment[ja]=簡単な Hello world プログラムを C で記述します
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C op
+Comment[ne]=सी मा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig Hello World programma in C
+Comment[pl]=Tworzy prosty program 'Witaj świecie' w języku C
+Comment[pt]=Gera um programa simples de Olá mundo em C
+Comment[pt_BR]=Gera um programa simples de Olá mundo em C
+Comment[ru]=Создание простого приложения Hello world на C
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C
+Comment[sl]=Ustvari preprost program Hello world v C-ju
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C-u
+Comment[sv]=Skapar ett enkelt Hello world-program i C
+Comment[tr]=C'de basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成 C 语言的 Hello world 程序
+Comment[zh_TW]=產生 C 語言的 Hello world 程式
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.c
+Archive=chello.tar.gz
+
+[LIBS]
+Type = value
+ValueType=QString
+Value= OPT_LIBS
+Comment= Optional libraries to link to.
+Comment[ca]= Biblioteques opcionals per enllaçar.
+Comment[da]= Mulige biblioteker at linke til.
+Comment[de]= Optionale Bibliotheken, die eingebunden werden sollen.
+Comment[el]= Προαιρετικές βιβλιοθήκες για σύνδεση με αυτές.
+Comment[es]=Bibliotecas opcionales para enlazar.
+Comment[et]=Täiendavad lingitavad teegid.
+Comment[eu]= Estekatzeko aukerako liburutegiak.
+Comment[fa]= کتابخانه‌های اختیاری برای پیوند کردن.
+Comment[fr]=Bibliothèques optionnelles à lier.
+Comment[ga]= Comhadlanna roghnacha ar féidir nascadh leo.
+Comment[gl]= Librerías opcionais a enlazar.
+Comment[hu]=Linkelési programkönyvtárak (opcionális).
+Comment[it]= librerie opzionali da collegare.
+Comment[ja]=リンクする他のライブラリ
+Comment[nds]= Optschonaal Bibliotheken, na de linkt warrn schall
+Comment[ne]= लिङ्क सिर्जना गर्न वैकल्पिक लाइब्रेरी
+Comment[nl]=Optionele bibliotheken om naar te linken
+Comment[pl]= Opcjonalne biblioteki, z którymi ma być łączony.
+Comment[pt]= Bibliotecas opcionais com as quais compilar.
+Comment[pt_BR]= Bibliotecas opcionais com as quais compilar.
+Comment[ru]=Дополнительные библиотеки для сборки.
+Comment[sk]=Voliteľné knižnice pre linkovanie.
+Comment[sl]=Dodatne knjižnice, do katerih se naj poveže.
+Comment[sr]=Опционе библиотеке за повезивање.
+Comment[sr@Latn]=Opcione biblioteke za povezivanje.
+Comment[sv]= Valfria bibliotek att länka till.
+Comment[tr]=Bağlanılacak isteğe bağlı kütüphaneler.
+Comment[zh_CN]=可选的链接库。
+Comment[zh_TW]=要連結的函式庫
+Default= -lm
+
+[INCLUDES]
+Type = value
+ValueType=QString
+Value= OPT_INCS
+Comment= Optional include path.
+Comment[ca]= Ruta opcional per a incloure.
+Comment[da]= Mulig include-sti.
+Comment[de]= Optionaler Include-Pfad.
+Comment[el]= Προαιρετική διαδρομή ενσωμάτωσης.
+Comment[es]=Ruta opcional para incluir.
+Comment[et]=Täiendavate päisefailide asukoht.
+Comment[eu]= Aukerako goiburuen bide-izena.
+Comment[fa]=include path اختیاری.
+Comment[fr]=Chemin d'inclusion optionnel.
+Comment[ga]= Conair roghnach ceanntásca.
+Comment[gl]= Ruta opcional de cabeceiras.
+Comment[hu]=Include fájlok könyvtárai (opcionális).
+Comment[it]= percorso opzionale di inclusione.
+Comment[ja]=ヘッダファイルを読み込む他のパス
+Comment[nds]= Optschonaal Koppdatei-Padd
+Comment[ne]= मार्ग सहितको विकल्प
+Comment[nl]=Optioneel Include-pad
+Comment[pl]= Opcjonalna ścieżka do plików dołączanych.
+Comment[pt]= Localização opcional dos ficheiros de inclusão.
+Comment[pt_BR]= Localização opcional dos ficheiros de inclusão.
+Comment[ru]=Дополнительные пути для заголовочных файлов.
+Comment[sk]=Voliteľná cesta pre include.
+Comment[sl]=Neobvezna pot za vstavke.
+Comment[sr]=Опциона путања за укључивања.
+Comment[sr@Latn]=Opciona putanja za uključivanja.
+Comment[sv]= Valfri sökväg till deklarationsfiler.
+Comment[tr]=İsteğe bağlı include yolu.
+Comment[zh_CN]=可选的包含路径。
+Comment[zh_TW]=引入檔路徑
+Default= -I/usr/include
+
+[CFLAGS]
+Type = value
+ValueType=QString
+Value= CFLAGS
+Comment= Optional CFLAGS to define in the makefile.
+Comment[ca]= CFLAGS opcionals per a definir en el fitxer de make.
+Comment[da]= Mulige CFLAGS at definere i makefile.
+Comment[de]= Optionale CFLAGS, die im Makefile definiert werden.
+Comment[el]= Προαιρετικές CFLAGS για ορισμό μέσα στο makefile.
+Comment[es]=CFLAGS opcionales a definir en el makefile.
+Comment[et]=Täiendavad Makefile'is defineeritavad CFLAGS'id.
+Comment[eu]= Aukerako makefile-ean definitzeko CFLAGS-ak.
+Comment[fa]= CFLAGS اختیاری برای تعریف در makefile.
+Comment[fr]=CFLAGS optionnels à définir dans le Makefile.
+Comment[ga]= CFLAGS roghnacha le socrú sa makefile.
+Comment[gl]= CFLAGS opcionais a definir no makefile.
+Comment[hu]=A Makefile-hoz definiálható CFLAGS információ (opcionális).
+Comment[it]= CFLAGS opzionale da definire nel makefile.
+Comment[ja]=Makefile に定義する他の CFLAGS
+Comment[nds]= Optschonaal CFLAGS, de in de "Make"-Datei fastleggt warrt.
+Comment[ne]= मेकफाइलमा परिभाषित गर्न CFLAGS विकल्प
+Comment[nl]=Optionele CFLAGS om te definiëren in het makefile.
+Comment[pl]= Opcjonalna wartość zmiennej CFLAGS do zdefiniowania w pliku makefile.
+Comment[pt]= CFLAGS opcionais a definir na Makefile.
+Comment[pt_BR]= CFLAGS opcionais a definir na Makefile.
+Comment[ru]=Дополнительные параметры CFLAGS для Makefile.
+Comment[sk]=Voliteľné nastavenie CFLAGS v makefile.
+Comment[sl]=Dodaten CFLAGS za definicijo v datoteki makefile.
+Comment[sr]=Опциона CFLAGS дефинисана у справифајлу.
+Comment[sr@Latn]=Opciona CFLAGS definisana u spravifajlu.
+Comment[sv]= Valfria CFLAGS att definiera i byggfilen.
+Comment[tr]=Makefile'da tanımlanacak isteğe bağlı CFLAGS değerleri
+Comment[zh_CN]=在 Makefile 中定义的可选 CFLAGS。
+Comment[zh_TW]=makefile 中定義的 CFLAGS
+Default=
+
+[MGS]
+Type=message
+Comment=A simple C project was created in %{dest}.
+Comment[ca]=A simple projecte en C ha estat creat en %{dest}.
+Comment[da]=Et simpelt C projekt blev oprette i %{dest}.
+Comment[de]=Ein einfaches C-Project wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό έργο C δημιουργήθηκε στο %{dest}.
+Comment[es]=Un sencillo proyecto de C ha sido creado en %{dest}.
+Comment[et]=Lihtne C-projekt loodi asukohta %{dest}.
+Comment[eu]=C proiektu sinple bat sortu da hemen: %{dest}.
+Comment[fa]=یک پروژۀ سادۀ سی در %{dest} ایجاد شد.
+Comment[fr]=Un projet en langage C simple a été créé dans %{dest}.
+Comment[ga]=Cruthaíodh tionscadal simplí C i %{dest}
+Comment[gl]=Creouse un proxecto sinxelo en C en %{dest}.
+Comment[hu]=Létrejött egy egyszerű C-projekt itt: %{dest}.
+Comment[it]=È stato creato un semplice progetto C in %{dest}.
+Comment[ja]=簡単な C プロジェクトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach C-Projekt opstellt.
+Comment[ne]=एउटा साधारण सी परियोजना %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig C-project is aangemaakt in %{dest}.
+Comment[pl]=Prosty projekt w języku C został utworzony w %{dest}.
+Comment[pt]=Foi criado um programa simples "Olá mundo" em C em %{dest}.
+Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em C em %{dest}.
+Comment[ru]=Простое приложение "Hello world" на C создано в %{dest}
+Comment[sk]=Jednoduchý C projekt bol vytvorený v %{dest}.
+Comment[sl]=Preprost projekt v C-ju je bil ustvarjen v %{dest}.
+Comment[sr]=Једноставан пројекат у C-у направљен је у %{dest}.
+Comment[sr@Latn]=Jednostavan projekat u C-u napravljen je u %{dest}.
+Comment[sv]=Ett enkelt C-projekt skapades i %{dest}.
+Comment[tr]=Basit bir C projesi %{dest} içinde oluşturuldu.
+Comment[zh_CN]=在 %{dest} 中创建了简单的 C 工程。
+Comment[zh_TW]=一個簡單的 C 專案已建立在 %{dest}。
+Archive=chello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/c-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/c-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/main.c
+Dest=%{dest}/src/%{APPNAMELC}.c
+
diff --git a/languages/cpp/app_templates/chello/chello.png b/languages/cpp/app_templates/chello/chello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/cpp/app_templates/chello/chello.png
Binary files differ
diff --git a/languages/cpp/app_templates/chello/configure.in b/languages/cpp/app_templates/chello/configure.in
new file mode 100644
index 00000000..3715e0c8
--- /dev/null
+++ b/languages/cpp/app_templates/chello/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_C
+AC_PROG_CC
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/chello/main.c b/languages/cpp/app_templates/chello/main.c
new file mode 100644
index 00000000..3ac8c330
--- /dev/null
+++ b/languages/cpp/app_templates/chello/main.c
@@ -0,0 +1,15 @@
+%{C_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ printf("Hello, world!\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/chello/src-Makefile.am b/languages/cpp/app_templates/chello/src-Makefile.am
new file mode 100644
index 00000000..51e7609f
--- /dev/null
+++ b/languages/cpp/app_templates/chello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.c
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/cpp/app_templates/chello_gba/.kdev_ignore b/languages/cpp/app_templates/chello_gba/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/.kdev_ignore
diff --git a/languages/cpp/app_templates/chello_gba/Makefile.am b/languages/cpp/app_templates/chello_gba/Makefile.am
new file mode 100644
index 00000000..2a72573e
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.c font.raw.c master.pal.c src-Makefile.am c-Makefile.am \
+ c-Makefile.cvs configure.in chellogba.png app.kdevelop \
+ main.h gba.h font.bmp README.devel
+templateName = chellogba
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/chello_gba/README.devel b/languages/cpp/app_templates/chello_gba/README.devel
new file mode 100644
index 00000000..a7cdcc75
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/README.devel
@@ -0,0 +1,30 @@
+***Description***
+
+This is a small demo program for the Gameboy Advance.
+It use a custom font to display strings in MODE 0 on Background 2, but contains only capitalized letters at the moment.
+The tiles & color palette for the font were generated from the bitmap "font.bmp"
+with following commandline.
+
+"gfx2gba -M -t8 -fsrc font.bmp"
+
+You can get a compiled version for Linux from http://gbadev.org/files/gfx2gba06.zip,
+but you don't need it to run the program.
+
+
+***Compiling and Running***
+
+To compile the code please install the DevKitAdvance for Linux/Unix. It contains a gcc 3.x configured as a cross compiler
+for the GBA platform. You can download a precompiled version from http://www.doc.ic.ac.uk/~tb100/
+
+To build the program KDevelop use
+"CC=arm-agb-elf-gcc CXX=arm-agb-elf-g++ ./configure --host=arm-gcc-elf --build=i386"
+as default,but you can change that in the project options if you want.
+
+To start your binary you can use an emulator or buy a flash card (http://www.lik-sang.com).
+KDevelop already contains a plugin to run your GBA program with the VisualBoy Advance emulator.
+You can download the emulator from: http://vboy.emuhq.com/
+
+Have fun!
+
+Please report bugs,wishes,problems.. to smeier@kdevelop.org (Sandy Meier)
+
diff --git a/languages/cpp/app_templates/chello_gba/app.kdevelop b/languages/cpp/app_templates/chello_gba/app.kdevelop
new file mode 100644
index 00000000..0025fd02
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/app.kdevelop
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <keywords>
+ <keyword>C</keyword>
+ <keyword>GBA</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ </general>
+ <run>
+ <disable_default>true</disable_default>
+ </run>
+ <configurations>
+ <default>
+ <configargs>--host=arm-gcc-elf --build=i386</configargs>
+ <ldflags>-T lnkscript crt0.o</ldflags>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <ccompilerbinary>arm-agb-elf-gcc</ccompilerbinary>
+ <cxxcompilerbinary>arm-agb-elf-g++</cxxcompilerbinary>
+ <cflags>-nostartfiles</cflags>
+ </default>
+ </configurations>
+ </kdevautoproject>
+ <kdevvisualadvance>
+ <binary>src/%{APPNAMELC}.gba</binary>
+ </kdevvisualadvance>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="c"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/chello_gba/c-Makefile.am b/languages/cpp/app_templates/chello_gba/c-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/c-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/chello_gba/c-Makefile.cvs b/languages/cpp/app_templates/chello_gba/c-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/c-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate b/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate
new file mode 100644
index 00000000..7a3ba857
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/chellogba.kdevtemplate
@@ -0,0 +1,173 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[ca]=Programa Hello world
+Name[da]=Goddag verden program
+Name[de]="Hello World"-Programm
+Name[el]=Πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo»
+Name[et]="Tere,maailm" programm
+Name[eu]="Kaixo mundua" programa
+Name[fa]=برنامۀ Hello world
+Name[fr]=Programme « Bonjour monde »
+Name[ga]=Ríomhchlár "Hello world"
+Name[gl]=Programa Ola mundo
+Name[it]=Programma di "Hello world"
+Name[ja]=Hello world プログラム
+Name[nds]="Moin Welt"-Programm
+Name[ne]=हेल्डो वोल्ड कार्यक्रम
+Name[nl]=Hello World-programma
+Name[pl]=Program 'Witaj świecie'
+Name[pt]=Programa 'Olá mundo'
+Name[pt_BR]=Programa 'Olá mundo'
+Name[ru]=Программа Hello world
+Name[sk]=Ahoj svet program
+Name[sl]=Program Hello world
+Name[sr]=Програм „Здраво свете“
+Name[sr@Latn]=Program „Zdravo svete“
+Name[sv]=Hello world-program
+Name[tr]=Merhaba Dünya Programı
+Name[zh_CN]=Hello world 程序
+Name[zh_TW]=Hello world 程式
+Icon=chellogba.png
+Category=C/GBA
+Comment=Generates a simple "Hello world" program for the Gameboy Advance. You will need the "devkitadvance" to compile it. See README.devel for more details.
+Comment[ca]=Genera un simple programa de "Hello world" per a la Gameboy Advance. Necessitareu "devkitadvance" per a compilar-lo. Consulteu el README.devel per a més detalls.
+Comment[da]=Genererer et simpelt "Goddag verden" program for Gameboy Advance. Du vil skulle bruge "devkitadvance" for at kompilere det. Se README.devel for flere detaljer.
+Comment[de]=Erstellt ein einfaches "Hello world"-Programm für den Gameboy Advance. Sie benötigen zum Kompilieren das "devkitadvance". Weitere Einzelheiten finden Sie in der Datei README.devel.
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα "Γεια σου κόσμε" για το Gameboy Advance. Θα χρειαστείτε το "devkitadvance" για τη μεταγλώττισή του. Ανατρέξτε στο README.devel για περισσότερες πληροφορίες.
+Comment[es]=Genera un sencillo programa «Hola mundo» para Gameboy Advance. Necesitará «devkitadvance» para compilarlo. Vea README.devel para más detalles.
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Gameboy Advance'i jaoks. Kompileerimiseks on vajalik "devkitadvance". Täpsemalt räägib sellest fail README.devel.
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Gameboy Advance-erako. "devkitadvance" behar duzu konpilatzeko. Ikusi README.devel xehetasun gehiagorako.
+Comment[fa]=یک برنامۀ سادۀ «Hello world» برای Gameboy Advance تولید می‌کند. برای ترجمۀ آن به »devkitadvance« نیاز دارید. برای جزئیات بیشتر، README.devel را ببینید.
+Comment[fr]=Génère un programme « Bonjour monde » simple pour la Gameboy Advance. Vous aurez besoin de « devkitadvance » pour le compiler. Consultez le fichier README.devel pour plus de détails.
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" le haghaidh an Gameboy Advance. Tá gá le "devkitadvance" chun é a thiomsú. Féach ar README.devel chun tuilleadh sonraí a fháil.
+Comment[gl]=Xera un programa sinxelo "Ola mundo" para Gameboy Advance. Necesitará "devkitadvance" para compilalo. Consulte README.devel para máis detalles.
+Comment[hu]=Létrehoz egy egyszerű Hello world programot a Gameboy Advance-hoz. Lefordításához szükség van a "devkitadvance" csomag telepítésére. További információ a README.devel fájlban található.
+Comment[it]=Genera un semplice programma di "Hello world" per il Gameboy Advance. Serve il "devkitadvance" per compilarlo. Guarda un po' README.devel per ulteriori dettagli.
+Comment[ja]=Gameboy Advance のための Hello world プログラムを作成します。コンパイルするには devkitadvance が必要です。詳しくは README.devel をご覧ください。
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm för "Gameboy Advance" op. För't Kompileren deit "devkitadvance" noot. Mehr Enkelheiten laat sik binnen "README.devel" finnen.
+Comment[ne]=गेमब्याए एडभान्सका लागि साधारण "हेल्लो वोल्ड नमस्कार" उत्पन्न गर्दछ । यसलाई कम्पाइल गर्न तपाईँलाई "devkitadvance" आवश्यक पर्दछ । बढी जानकारीका लागि README.devel हेर्नुहोस् ।
+Comment[nl]=Genereert een eenvoudig "Hello World" programma voor de Gameboy Advance. U hebt "devkitadvance" nodig om het te kunnen compileren. Zie het bestand README.devel voor meer informatie.
+Comment[pl]=Generuje prosty program "Witaj świecie" na konsolę Gameboy Advance. Do skompilowania go potrzebny jest "devkitadvance". Więcej informacji można znaleźć w pliku README.devel.
+Comment[pt]=Gera um programa simples "Olá mundo" para o Gameboy Advance. Irá necessitar do "devkitadvance" para o compilar. Veja o README.devel para mais detalhes.
+Comment[pt_BR]=Gera um programa simples "Olá mundo" para o Gameboy Advance. Irá necessitar do "devkitadvance" para o compilar. Veja o README.devel para mais detalhes.
+Comment[ru]=Создание простой программы "Hello world" на Gameboy Advance. Вам необходима программа "devkitadvance" для её сборки. Прочтите файл README.devel.
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program pre Gameboy Advance.Budete potrebovať "devkitadvance" na to, aby ste ho skompilovali.Pozrite súbor README.devel pre viac detailov.
+Comment[sl]=Ustvari preprost program »Pozdravljen svet« za Gameboy Advance. Za prevajanje boste potrebovali »devkitadvance«. Podrobnosti si lahko ogledate v README.devel.
+Comment[sr]=Прави једноставан „Здраво свете“ програм за Gameboy Advance. Требаће вам „devkitadvance“ да бисте га превели. Погледајте README.devel за више детаља.
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program za Gameboy Advance. Trebaće vam „devkitadvance“ da biste ga preveli. Pogledajte README.devel za više detalja.
+Comment[sv]=Skapar ett enkelt "Hello world"-program för Gameboy Advance. Du behöver "devkitadvance" för att kompilera det. Se filen README.devel för mer information.
+Comment[tr]=Gameboy Advance için basit bir "Merhaba Dünya" programı üretir. Derlemek için "devkitadvance" paketine ihtiyacınız olacak. Daha fazla bilgi için README.devel dosyasına bakın.
+Comment[zh_CN]=生成 Gameboy Advance 下的“Hello world”程序。您需要“devkitadvane”才能编译。请查看 README.devel 中的细节。
+Comment[zh_TW]=產生一個簡單的 Gameboy Advance 的 Hello world 程式。您需要 "devkitadvance" 來編譯。詳情請參考 README.devel。
+ShowFileAfterGeneration=README.devel
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=%{dest}/src/main.c
+Archive=chellogba.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/README.devel
+Dest=%{dest}/README.devel
+
+[FILE3]
+Type=install
+Source=%{src}/c-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE4]
+Type=install
+Source=%{src}/c-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE5]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{src}/main.c
+Dest=%{dest}/src/main.c
+
+[FILE8]
+Type=install
+Source=%{src}/main.h
+Dest=%{dest}/src/main.h
+
+[FILE9]
+Type=install
+Source=%{src}/gba.h
+Dest=%{dest}/src/gba.h
+
+[FILE10]
+Type=install
+Source=%{src}/font.bmp
+Dest=%{dest}/src/font.bmp
+
+[FILE11]
+Type=install
+Source=%{src}/font.raw.c
+Dest=%{dest}/src/font.raw.c
+
+[FILE12]
+Type=install
+Source=%{src}/master.pal.c
+Dest=%{dest}/src/master.pal.c
+
+[MSG]
+Type=message
+Comment=A Hello World program was created in %{dest}
+Comment[ca]=A programa de Hello World ha estat creat en %{dest}
+Comment[da]=Et Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein "Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» ha sido creado en %{dest}
+Comment[et]="Tere, maailm" programm loodi asukohta %{dest}
+Comment[eu]="Kaixo mundua" programa bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ Hello World در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár "Hello World" i %{dest}
+Comment[gl]=Creouse un programa Ola mundo en %{dest}
+Comment[hu]=Létrejött egy Hello World program itt: %{dest}
+Comment[it]=È stato creato un programma di "Hello World" in %{dest}
+Comment[ja]=Hello World プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en "Moin Welt"-Programm opstellt
+Comment[ne]=एउटा हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Program 'Witaj świecie' utworzony w %{dest}.
+Comment[pt]=Foi criado um programa Olá Mundo em %{dest}
+Comment[pt_BR]=Foi criado um programa Olá Mundo em %{dest}
+Comment[ru]=Простое приложение Hello World создано в %{dest}
+Comment[sk]=Ahoj svet program bol vytvorený v %{dest}
+Comment[sl]=Program »Pozdravljen svet« je bil ustvarjen v %{dest}
+Comment[sr]=„Здраво свете“ је направљен у %{dest}
+Comment[sr@Latn]=„Zdravo svete“ je napravljen u %{dest}
+Comment[sv]=Ett Hello World-program skapades i %{dest}
+Comment[tr]=Bir Merhaba Dünya programı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 Hello world 程序
+Comment[zh_TW]=一個 Hello World 程式已經建立在 %{dest}
diff --git a/languages/cpp/app_templates/chello_gba/chellogba.png b/languages/cpp/app_templates/chello_gba/chellogba.png
new file mode 100644
index 00000000..81bba90a
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/chellogba.png
Binary files differ
diff --git a/languages/cpp/app_templates/chello_gba/configure.in b/languages/cpp/app_templates/chello_gba/configure.in
new file mode 100644
index 00000000..3715e0c8
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_C
+AC_PROG_CC
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/chello_gba/font.bmp b/languages/cpp/app_templates/chello_gba/font.bmp
new file mode 100644
index 00000000..28b8c669
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/font.bmp
Binary files differ
diff --git a/languages/cpp/app_templates/chello_gba/font.raw.c b/languages/cpp/app_templates/chello_gba/font.raw.c
new file mode 100644
index 00000000..8efbf1dd
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/font.raw.c
@@ -0,0 +1,123 @@
+const unsigned char font_Tiles[1920]={
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
diff --git a/languages/cpp/app_templates/chello_gba/gba.h b/languages/cpp/app_templates/chello_gba/gba.h
new file mode 100644
index 00000000..9e57c8f8
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/gba.h
@@ -0,0 +1,204 @@
+%{H_TEMPLATE}
+// gba.h by eloist
+
+#ifndef GBA_HEADER
+#define GBA_HEADER
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned long u32;
+
+typedef signed char s8;
+typedef signed short s16;
+typedef signed long s32;
+
+typedef unsigned char byte;
+typedef unsigned short hword;
+typedef unsigned long word;
+
+#define OAMmem (u32*)0x7000000
+#define VideoBuffer (u16*)0x6000000
+#define OAMdata (u16*)0x6100000
+#define BGPaletteMem (u16*)0x5000000
+#define OBJPaletteMem (u16*)0x5000200
+
+#define REG_INTERUPT *(u32*)0x3007FFC
+#define REG_DISPCNT *(u32*)0x4000000
+#define REG_DISPCNT_L *(u16*)0x4000000
+#define REG_DISPCNT_H *(u16*)0x4000002
+#define REG_DISPSTAT *(u16*)0x4000004
+#define REG_VCOUNT *(u16*)0x4000006
+#define REG_BG0CNT *(u16*)0x4000008
+#define REG_BG1CNT *(u16*)0x400000A
+#define REG_BG2CNT *(u16*)0x400000C
+#define REG_BG3CNT *(u16*)0x400000E
+#define REG_BG0HOFS *(u16*)0x4000010
+#define REG_BG0VOFS *(u16*)0x4000012
+#define REG_BG1HOFS *(u16*)0x4000014
+#define REG_BG1VOFS *(u16*)0x4000016
+#define REG_BG2HOFS *(u16*)0x4000018
+#define REG_BG2VOFS *(u16*)0x400001A
+#define REG_BG3HOFS *(u16*)0x400001C
+#define REG_BG3VOFS *(u16*)0x400001E
+#define REG_BG2PA *(u16*)0x4000020
+#define REG_BG2PB *(u16*)0x4000022
+#define REG_BG2PC *(u16*)0x4000024
+#define REG_BG2PD *(u16*)0x4000026
+#define REG_BG2X *(u32*)0x4000028
+#define REG_BG2X_L *(u16*)0x4000028
+#define REG_BG2X_H *(u16*)0x400002A
+#define REG_BG2Y *(u32*)0x400002C
+#define REG_BG2Y_L *(u16*)0x400002C
+#define REG_BG2Y_H *(u16*)0x400002E
+#define REG_BG3PA *(u16*)0x4000030
+#define REG_BG3PB *(u16*)0x4000032
+#define REG_BG3PC *(u16*)0x4000034
+#define REG_BG3PD *(u16*)0x4000036
+#define REG_BG3X *(u32*)0x4000038
+#define REG_BG3X_L *(u16*)0x4000038
+#define REG_BG3X_H *(u16*)0x400003A
+#define REG_BG3Y *(u32*)0x400003C
+#define REG_BG3Y_L *(u16*)0x400003C
+#define REG_BG3Y_H *(u16*)0x400003E
+#define REG_WIN0H *(u16*)0x4000040
+#define REG_WIN1H *(u16*)0x4000042
+#define REG_WIN0V *(u16*)0x4000044
+#define REG_WIN1V *(u16*)0x4000046
+#define REG_WININ *(u16*)0x4000048
+#define REG_WINOUT *(u16*)0x400004A
+#define REG_MOSAIC *(u32*)0x400004C
+#define REG_MOSAIC_L *(u32*)0x400004C
+#define REG_MOSAIC_H *(u32*)0x400004E
+#define REG_BLDMOD *(u16*)0x4000050
+#define REG_COLEV *(u16*)0x4000052
+#define REG_COLEY *(u16*)0x4000054
+#define REG_SG10 *(u32*)0x4000060
+#define REG_SG10_L *(u16*)0x4000060
+#define REG_SG10_H *(u16*)0x4000062
+#define REG_SG11 *(u16*)0x4000064
+#define REG_SG20 *(u16*)0x4000068
+#define REG_SG21 *(u16*)0x400006C
+#define REG_SG30 *(u32*)0x4000070
+#define REG_SG30_L *(u16*)0x4000070
+#define REG_SG30_H *(u16*)0x4000072
+#define REG_SG31 *(u16*)0x4000074
+#define REG_SG40 *(u16*)0x4000078
+#define REG_SG41 *(u16*)0x400007C
+#define REG_SGCNT0 *(u32*)0x4000080
+#define REG_SGCNT0_L *(u16*)0x4000080
+#define REG_SGCNT0_H *(u16*)0x4000082
+#define REG_SGCNT1 *(u16*)0x4000084
+#define REG_SGBIAS *(u16*)0x4000088
+#define REG_SGWR0 *(u32*)0x4000090
+#define REG_SGWR0_L *(u16*)0x4000090
+#define REG_SGWR0_H *(u16*)0x4000092
+#define REG_SGWR1 *(u32*)0x4000094
+#define REG_SGWR1_L *(u16*)0x4000094
+#define REG_SGWR1_H *(u16*)0x4000096
+#define REG_SGWR2 *(u32*)0x4000098
+#define REG_SGWR2_L *(u16*)0x4000098
+#define REG_SGWR2_H *(u16*)0x400009A
+#define REG_SGWR3 *(u32*)0x400009C
+#define REG_SGWR3_L *(u16*)0x400009C
+#define REG_SGWR3_H *(u16*)0x400009E
+#define REG_SGFIF0A *(u32*)0x40000A0
+#define REG_SGFIFOA_L *(u16*)0x40000A0
+#define REG_SGFIFOA_H *(u16*)0x40000A2
+#define REG_SGFIFOB *(u32*)0x40000A4
+#define REG_SGFIFOB_L *(u16*)0x40000A4
+#define REG_SGFIFOB_H *(u16*)0x40000A6
+#define REG_DM0SAD *(u32*)0x40000B0
+#define REG_DM0SAD_L *(u16*)0x40000B0
+#define REG_DM0SAD_H *(u16*)0x40000B2
+#define REG_DM0DAD *(u32*)0x40000B4
+#define REG_DM0DAD_L *(u16*)0x40000B4
+#define REG_DM0DAD_H *(u16*)0x40000B6
+#define REG_DM0CNT *(u32*)0x40000B8
+#define REG_DM0CNT_L *(u16*)0x40000B8
+#define REG_DM0CNT_H *(u16*)0x40000BA
+#define REG_DM1SAD *(u32*)0x40000BC
+#define REG_DM1SAD_L *(u16*)0x40000BC
+#define REG_DM1SAD_H *(u16*)0x40000BE
+#define REG_DM1DAD *(u32*)0x40000C0
+#define REG_DM1DAD_L *(u16*)0x40000C0
+#define REG_DM1DAD_H *(u16*)0x40000C2
+#define REG_DM1CNT *(u32*)0x40000C4
+#define REG_DM1CNT_L *(u16*)0x40000C4
+#define REG_DM1CNT_H *(u16*)0x40000C6
+#define REG_DM2SAD *(u32*)0x40000C8
+#define REG_DM2SAD_L *(u16*)0x40000C8
+#define REG_DM2SAD_H *(u16*)0x40000CA
+#define REG_DM2DAD *(u32*)0x40000CC
+#define REG_DM2DAD_L *(u16*)0x40000CC
+#define REG_DM2DAD_H *(u16*)0x40000CE
+#define REG_DM2CNT *(u32*)0x40000D0
+#define REG_DM2CNT_L *(u16*)0x40000D0
+#define REG_DM2CNT_H *(u16*)0x40000D2
+#define REG_DM3SAD *(u32*)0x40000D4
+#define REG_DM3SAD_L *(u16*)0x40000D4
+#define REG_DM3SAD_H *(u16*)0x40000D6
+#define REG_DM3DAD *(u32*)0x40000D8
+#define REG_DM3DAD_L *(u16*)0x40000D8
+#define REG_DM3DAD_H *(u16*)0x40000DA
+#define REG_DM3CNT *(u32*)0x40000DC
+#define REG_DM3CNT_L *(u16*)0x40000DC
+#define REG_DM3CNT_H *(u16*)0x40000DE
+#define REG_TM0D *(u16*)0x4000100
+#define REG_TM0CNT *(u16*)0x4000102
+#define REG_TM1D *(u16*)0x4000104
+#define REG_TM1CNT *(u16*)0x4000106
+#define REG_TM2D *(u16*)0x4000108
+#define REG_TM2CNT *(u16*)0x400010A
+#define REG_TM3D *(u16*)0x400010C
+#define REG_TM3CNT *(u16*)0x400010E
+#define REG_SCD0 *(u16*)0x4000120
+#define REG_SCD1 *(u16*)0x4000122
+#define REG_SCD2 *(u16*)0x4000124
+#define REG_SCD3 *(u16*)0x4000126
+#define REG_SCCNT *(u32*)0x4000128
+#define REG_SCCNT_L *(u16*)0x4000128
+#define REG_SCCNT_H *(u16*)0x400012A
+#define REG_P1 *(u16*)0x4000130
+#define REG_P1CNT *(u16*)0x4000132
+#define REG_R *(u16*)0x4000134
+#define REG_HS_CTRL *(u16*)0x4000140
+#define REG_JOYRE *(u32*)0x4000150
+#define REG_JOYRE_L *(u16*)0x4000150
+#define REG_JOYRE_H *(u16*)0x4000152
+#define REG_JOYTR *(u32*)0x4000154
+#define REG_JOYTR_L *(u16*)0x4000154
+#define REG_JOYTR_H *(u16*)0x4000156
+#define REG_JSTAT *(u32*)0x4000158
+#define REG_JSTAT_L *(u16*)0x4000158
+#define REG_JSTAT_H *(u16*)0x400015A
+#define REG_IE *(u16*)0x4000200
+#define REG_IF *(u16*)0x4000202
+#define REG_WSCNT *(u16*)0x4000204
+#define REG_IME *(u16*)0x4000208
+#define REG_PAUSE *(u16*)0x4000300
+
+///REG_DISPCNT Defines////
+#define BG0_ENABLE 0x100 //these are just the flags for enabling backgrounds and sprites
+#define BG1_ENABLE 0x200
+#define BG2_ENABLE 0x400
+#define BG3_ENABLE 0x800
+#define OBJ_ENABLE 0x1000
+#define WIN0_ENABLE 0x2000
+#define WIN1_ENABLE 0x4000
+#define WINOBJ_ENABLE 0x8000
+
+
+#define OBJ_MAP_LINEAR 0x40 //I'll talk about this when i talk about hardware sprites
+#define OBJ_MAP_2D 0x0
+#define BACK_BUFFER 0x10 //this is the flag that controlls wich buffer is being rendered
+
+
+#define MODE0 0x0 //these are the modes
+#define MODE1 0x1
+#define MODE2 0x2
+#define MODE3 0x3
+#define MODE4 0x4
+#define MODE5 0x5
+
+#endif
+
diff --git a/languages/cpp/app_templates/chello_gba/main.c b/languages/cpp/app_templates/chello_gba/main.c
new file mode 100644
index 00000000..354b4fd8
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/main.c
@@ -0,0 +1,50 @@
+%{CPP_TEMPLATE}
+
+#include "main.h"
+
+int main(){
+ initTextMode();
+ print("HELLO WORLD",9,9);
+ while(1){} //loop forever
+
+}
+
+
+void print(char* text,u16 x,u16 y){
+ u16 i=0;
+ u16* ScreenBase = (u16*)0x6004000;
+ ScreenBase = ScreenBase + x + y*32;
+ while ( *text != '\0' ){
+
+ *ScreenBase++ = (u16)*text-'A'+1;
+ i++;
+ text++;
+ }
+}
+
+void initTextMode(){
+ REG_DISPCNT = (MODE0 | BG2_ENABLE); //this sets the screen mode to mode 0 and enables background 2
+
+ // 256 colors and charscreenbase 0, screenbase 8
+ // default size is 256x256 pixel
+ REG_BG2CNT = (1 << 7 | 0 << 2 | 8 << 8);
+
+
+ u16* palDest=(u16*)BGPaletteMem; //0x5000000
+ u16* palSource = (u16*)Master_Palette;
+ // copy the palette info (256 colors a 15/16 Bit) into the desired address
+ u16 i=0;
+ for (;i<256;i++) {
+ *palDest++ = *palSource++;
+ }
+
+ // copy the tiles to charbase 0, (0x6000000 start of the videobuffer)
+ u16* fontDest = (u16*)VideoBuffer; //this is the start of video memory
+ u16* fontSource = (u16*)font_Tiles;
+ i=0;
+ for(;i<1920;i=i+2){
+ *fontDest++ = *fontSource++;
+ }
+}
+
+
diff --git a/languages/cpp/app_templates/chello_gba/main.h b/languages/cpp/app_templates/chello_gba/main.h
new file mode 100644
index 00000000..c84f48bb
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/main.h
@@ -0,0 +1,12 @@
+%{H_TEMPLATE}
+
+// gba.h has all the register definitions
+#include "gba.h"
+
+extern u16 font_Tiles[]; // the letters as 8x8 tiles
+extern u16 Master_Palette[]; // the color palette
+
+void print(char* text,u16 x,u16 y);
+void initTextMode();
+
+
diff --git a/languages/cpp/app_templates/chello_gba/master.pal.c b/languages/cpp/app_templates/chello_gba/master.pal.c
new file mode 100644
index 00000000..a24fde37
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/master.pal.c
@@ -0,0 +1,35 @@
+const unsigned short Master_Palette[256]={
+0x0000, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
+};
+
diff --git a/languages/cpp/app_templates/chello_gba/src-Makefile.am b/languages/cpp/app_templates/chello_gba/src-Makefile.am
new file mode 100644
index 00000000..a41e883a
--- /dev/null
+++ b/languages/cpp/app_templates/chello_gba/src-Makefile.am
@@ -0,0 +1,13 @@
+all: %{APPNAMELC}.gba
+
+%{APPNAMELC}.gba: %{APPNAMELC}
+ arm-agb-elf-objcopy -O binary %{APPNAMELC} %{APPNAMELC}.gba
+
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = main.h main.c font.raw.c master.pal.c
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/cpp/app_templates/clanlib/.kdev_ignore b/languages/cpp/app_templates/clanlib/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/.kdev_ignore
diff --git a/languages/cpp/app_templates/clanlib/Makefile.am b/languages/cpp/app_templates/clanlib/Makefile.am
new file mode 100644
index 00000000..f4a650af
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = src-Makefile.am app-Makefile.am main.cpp app.kdevelop \
+ app-configure.in app-autogen.sh
+templateName = clanlib
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz $(templateName).png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/clanlib/app-Makefile.am b/languages/cpp/app_templates/clanlib/app-Makefile.am
new file mode 100644
index 00000000..af437a64
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/app-Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/clanlib/app-autogen.sh b/languages/cpp/app_templates/clanlib/app-autogen.sh
new file mode 100644
index 00000000..2b285d79
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/app-autogen.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+aclocal && autoconf && automake --add-missing --copy
diff --git a/languages/cpp/app_templates/clanlib/app-configure.in b/languages/cpp/app_templates/clanlib/app-configure.in
new file mode 100644
index 00000000..c1518570
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/app-configure.in
@@ -0,0 +1,22 @@
+AC_INIT()
+AM_INIT_AUTOMAKE(%{APPNAMELC},%{VERSION})
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+AC_CHECK_HEADER([ClanLib/application.h], [],
+ AC_MSG_ERROR([Couldn't find Clanlib headers.]))
+
+AC_CHECK_LIB(clanApp, main, , AC_ERROR([Couldn't find Clanlib libraries]), -lclanCore -lclanSignals -ldl)
+
+AC_LANG_RESTORE
+
+
+AC_OUTPUT(Makefile src/Makefile)
+
diff --git a/languages/cpp/app_templates/clanlib/app.kdevelop b/languages/cpp/app_templates/clanlib/app.kdevelop
new file mode 100644
index 00000000..c0d5c286
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/app.kdevelop
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>ClanLib</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ <configurations>
+ <default>
+ <ldflags></ldflags>
+ </default>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate b/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate
new file mode 100644
index 00000000..1e7b2677
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/clanlib.kdevtemplate
@@ -0,0 +1,138 @@
+# KDE Config File
+[General]
+Name=Simple ClanLib application
+Name[ca]=Una simple aplicació de ClanLib
+Name[da]=Simpelt ClanLib program
+Name[de]=Eine einfache ClanLib-Anwendung
+Name[el]=Μια απλή εφαρμογή ClanLib
+Name[es]=Una sencilla aplicación de ClanLib
+Name[et]=Lihtne ClanLib rakendus
+Name[eu]=ClanLib aplikazio simple bat
+Name[fa]=کاربرد سادۀ ClanLib
+Name[fr]=Application ClanLib simple
+Name[ga]=Feidhmchlár simplí ClanLib
+Name[gl]=Aplicación sinxela ClanLib
+Name[hu]=Egyszerű Clanlib-alkalmazás
+Name[it]=semplice applicazione ClanLib
+Name[ja]=簡単な ClanLib アプリケーション
+Name[nds]=En eenfach ClanLib-Programm
+Name[ne]=साधारण ClanLib अनुप्रयोग
+Name[nl]=Eenvoudige ClanLib-toepassing
+Name[pl]=Prosty program używający ClanLib
+Name[pt]=Aplicação simples da ClanLib
+Name[pt_BR]=Aplicação simples da ClanLib
+Name[ru]=Простое приложение ClanLib
+Name[sk]=Jednoduchá ClanLib aplikácia
+Name[sl]=Preprost program ClanLib
+Name[sr]=Једноставан ClanLib програм
+Name[sr@Latn]=Jednostavan ClanLib program
+Name[sv]=Enkelt ClanLib-program
+Name[tr]=Basit ClanLib uygulaması
+Name[zh_CN]=简单的 ClanLib 应用程序
+Name[zh_TW]=簡單的 ClanLib 應用程式
+Category=C++
+Icon=clanlib.png
+Comment=Generates a simple ClanLib application.
+Comment[ca]=Genera una simple aplicació de ClanLib.
+Comment[da]=Genererer et simpelt ClanLib program
+Comment[de]=Erstellt eine einfache ClanLib-Anwendung.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή ClanLib.
+Comment[es]=Genera una sencilla aplicación de ClanLib.
+Comment[et]=Lihtsa ClanLib'i rakenduse loomine.
+Comment[eu]=ClanLib aplikazio simple bat sortzen du.
+Comment[fa]=یک کاربرد سادۀ ClanLib تولید می‌کند.
+Comment[fr]=Génère une application ClanLib simple.
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí ClanLib.
+Comment[gl]=Xera una aplicación sinxela ClanLib.
+Comment[hu]=Létrehoz egy egyszerű Clanlib-alkalmazást.
+Comment[it]=Genera una semplice applicazione ClanLib.
+Comment[ja]=簡単な ClanLib アプリケーションを作成します
+Comment[nds]=Stellt en eenfach ClanLib-Programm op.
+Comment[ne]=साधारण ClanLib अनुप्रयोग सिर्जना गर्दछ ।
+Comment[nl]=Genereert een eenvoudige ClanLib-toepassing
+Comment[pl]=Generuje prosty program używający ClanLib.
+Comment[pt]=Gera uma aplicação simples com o ClanLib.
+Comment[pt_BR]=Gera uma aplicação simples com o ClanLib.
+Comment[ru]=Создание простого приложения ClanLib.
+Comment[sk]=Vygeneruje jednoduchú ClanLib aplikáciu.
+Comment[sl]=Ustvari preprost program ClanLib.
+Comment[sr]=Прави једноставан ClanLib програм.
+Comment[sr@Latn]=Pravi jednostavan ClanLib program.
+Comment[sv]=Skapar ett enkelt ClanLib-program.
+Comment[tr]=Basit bir ClanLib uygulaması yaratır.
+Comment[zh_CN]=生成简单的 ClanLib 应用程序。
+Comment[zh_TW]=產生簡單的 ClanLib 應用程式。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/main.cpp
+Archive=clanlib.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/app-configure.in
+Dest=%{dest}/configure.in
+
+[FILE4]
+Type=install
+Source=%{src}/app-autogen.sh
+Dest=%{dest}/autogen.sh
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[MSG]
+Type=message
+Comment=A simple clanlib application was created in %{dest}
+Comment[ca]=Una simple aplicació de clanlib ha estat creada en %{dest}
+Comment[da]=Et simpelt clanlib program blev oprettet i %{dest}
+Comment[de]=Eine einfache ClanLib-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια απλή εφαρμογή clanlib δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación de ClanLib sencilla ha sido creada en %{dest}
+Comment[et]=Lihtne ClanLib'i rakendus loodi asukohta %{dest}
+Comment[eu]=clanlib aplikazio simple bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد سادۀ clanlib در %{dest} ایجاد شد
+Comment[fr]=Une application Clanlib simple a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár simplí clanlib i %{dest}
+Comment[gl]=Creouse una apliación sinxela clanlib en %{dest}
+Comment[hu]=Létrejött egy egyszerű Clanlib-alkalmazás itt: %{dest}
+Comment[it]=È stata creata una semplice applicazione clanlib in %{dest}
+Comment[ja]=簡単な clanlib アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach ClanLib-Programm opstellt
+Comment[ne]=साधारण clanlib अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een voorbeeld ClanLib-toepassing is aangemaakt in %{dest}
+Comment[pl]=Prosty program używający ClanLib został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação simples da ClanLib em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação simples da ClanLib em %{dest}
+Comment[ru]=Простое приложение ClanLib создано в %{dest}
+Comment[sk]=Jednoduchá ClanLib aplikácia bola vytvorená v %{dest}
+Comment[sl]=Preprost program clanlib je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан clanlib програм је направљен у %{dest}
+Comment[sr@Latn]=Jednostavan clanlib program je napravljen u %{dest}
+Comment[sv]=Ett enkelt ClanLib-program skapades i %{dest}
+Comment[zh_CN]=在 %{dest} 中创建了一个简单的 clanlib 程序
+Comment[zh_TW]=一個簡單的 clanlib 應用程式已經建立在 %{dest}
diff --git a/languages/cpp/app_templates/clanlib/clanlib.png b/languages/cpp/app_templates/clanlib/clanlib.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/clanlib.png
Binary files differ
diff --git a/languages/cpp/app_templates/clanlib/main.cpp b/languages/cpp/app_templates/clanlib/main.cpp
new file mode 100644
index 00000000..962e1452
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/main.cpp
@@ -0,0 +1,29 @@
+%{CPP_TEMPLATE}
+
+#include <ClanLib/application.h>
+#include <ClanLib/core.h>
+#include <ClanLib/display.h>
+#include <ClanLib/gl.h>
+#include <ClanLib/sound.h>
+
+class %{APPNAME}Application : public CL_ClanApplication
+{
+public:
+ virtual int main(int argc, char** argv)
+ {
+ CL_SetupCore::init();
+ CL_SetupDisplay::init();
+ CL_SetupGL::init();
+ CL_SetupSound::init();
+
+ // Code here
+
+ CL_SetupSound::deinit();
+ CL_SetupGL::deinit();
+ CL_SetupDisplay::deinit();
+ CL_SetupCore::deinit();
+
+ return 0;
+ }
+} app;
+
diff --git a/languages/cpp/app_templates/clanlib/src-Makefile.am b/languages/cpp/app_templates/clanlib/src-Makefile.am
new file mode 100644
index 00000000..085f4f76
--- /dev/null
+++ b/languages/cpp/app_templates/clanlib/src-Makefile.am
@@ -0,0 +1,4 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = main.cpp
+%{APPNAMELC}_LDADD = -lclanCore -lclanApp -lclanDisplay -lclanGL -lclanSound -lclanSignals
+
diff --git a/languages/cpp/app_templates/cmakelibc/CMakeLists.txt b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt
new file mode 100644
index 00000000..fad51df5
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt
@@ -0,0 +1,7 @@
+PROJECT(%{APPNAMELC})
+
+#if you don't want the full compiler output, remove the following line
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+SUBDIRS(src)
+
diff --git a/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src
new file mode 100644
index 00000000..d2fabc7a
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/CMakeLists.txt.src
@@ -0,0 +1,19 @@
+#this is just a basic CMakeLists.txt, for more information see the cmake manpage
+
+#add definitions, compiler switches, etc.
+ADD_DEFINITIONS(-Wall -O2)
+
+#build a shared library
+ADD_LIBRARY(%{APPNAMELC} SHARED %{APPNAMELC}.c)
+
+#for testing the shared library you probably need some test app too
+ADD_EXECUTABLE(%{APPNAMELC}test %{APPNAMELC}test.c)
+
+#need to link to some other libraries ? just add them here
+TARGET_LINK_LIBRARIES(%{APPNAMELC}test %{APPNAMELC})
+
+#add an install target here
+#INSTALL_FILES(...)
+#INSTALL_PROGRAMS(...)
+#INSTALL_TARGET(...)
+
diff --git a/languages/cpp/app_templates/cmakelibc/Makefile.am b/languages/cpp/app_templates/cmakelibc/Makefile.am
new file mode 100644
index 00000000..c10e704a
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = test.c lib.h lib.c cmakelibc.png CMakeLists.txt CMakeLists.txt.src
+templateName = cmakelibc
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc b/languages/cpp/app_templates/cmakelibc/cmakelibc
new file mode 100644
index 00000000..ae927b61
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/cmakelibc
@@ -0,0 +1,7 @@
+# KDE Config File
+[General]
+Name=A shared library template
+Icon=cmakelibc.png
+Category=C/CMake based projects
+Comment=Generates a shared library template including a test application in C. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+ShowFilesAfterGeneration=src/%{APPNAMELC}.c
diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate b/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate
new file mode 100644
index 00000000..cd3783f7
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/cmakelibc.kdevtemplate
@@ -0,0 +1,139 @@
+# KDE Config File
+[General]
+Name=A shared library template
+Name[ca]=Una plantilla de biblioteca compartida
+Name[da]=En delt biblitekskabelon
+Name[de]=Vorlage für eine Shared Library
+Name[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης
+Name[es]=Una plantilla de biblioteca compartida
+Name[et]=Jagatud teegi mall
+Name[eu]=Liburutegi partekatu baten txantiloia
+Name[fa]=قالب کتابخانۀ مشترک
+Name[fr]=Un modèle de bibliothèque partagée
+Name[ga]=Teimpléad comhleabharlainne
+Name[gl]=Plantilla de biblioteca compartida
+Name[hu]=Osztott programkönyvtár-sablon
+Name[it]=Un modello di libreria condivisa
+Name[ja]=共有ライブラリのテンプレート
+Name[nds]=Vörlaag för deelt Bibliotheek
+Name[ne]=साझेदारी गरिएको लाइब्रेरी टेम्प्लेट
+Name[nl]=Een gedeelde-bibliotheek-sjabloon
+Name[pl]=Szablon współdzielonej biblioteki
+Name[pt]=Um modelo de uma biblioteca dinâmica
+Name[pt_BR]=Um modelo de uma biblioteca dinâmica
+Name[ru]=Шаблон разделяемой библиотеки
+Name[sk]=Šablóna pre zdieľanú knižnicu
+Name[sl]=Predloga deljene knjižnice
+Name[sr]=Шаблон дељене библиотеке
+Name[sr@Latn]=Šablon deljene biblioteke
+Name[sv]=En mall för ett delat bibliotek
+Name[tr]=Bir paylaşılan kütüphane şablonu
+Name[zh_CN]=共享库模板
+Name[zh_TW]=共享函式庫樣本
+Icon=cmakelibc.png
+Category=C/CMake based projects
+FileTemplates=h,CStyle,c,CStyle
+Comment=Generates a shared library template including a test application in C. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+Comment[ca]=Genera una plantilla de biblioteca compartida incloguen una aplicació de prova en C. Es compila usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2.
+Comment[da]=Genererer en delt skabelon for et bibliotek inklusive et testprogram i C. Det kompilerer ved brug af CMake's byggeværktøj i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse.
+Comment[de]=Erstellt eine Vorlage für eine Shared Library inklusive einer Testanwendung in C. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake.
+Comment[el]=Δημιουργεί ένα πρότυπο κοινόχρηστης βιβλιοθήκης που περιλαμβάνει και μια εφαρμογή δοκιμής σε C. Μεταγλωττίζεται χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2.
+Comment[es]=Genera una plantilla de biblioteca compartida incluyendo una aplicación de prueba en C. Se compila usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2.
+Comment[et]=Jagatud teegi malli loomine, kaasa arvatud testrakendus C-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2.
+Comment[eu]=Liburutegi partekatu baten txantiloia sortzen du C lengoaian idatzitako probarako aplikazio batekin. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2.
+Comment[fa]=یک قالب کتابخانۀ مشترک شامل کاربرد آزمایشی در سی تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند. به cmake 2.1 )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد.
+Comment[fr]=Génère un modèle de bibliothèque partagée comprenant une application de test en C. La compilation s'effectue à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite CMake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir.
+Comment[ga]=Cruthaigh teimpléad comhleabharlainne le feidhmchlár tástála i C. Tiomsaítear é le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht.
+Comment[gl]=Xera unha plantilla de biblioteca compartida e máis unha aplicación de proba en C. Compílase usando a ferramenta CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2.
+Comment[hu]=Létrehoz egy alap osztott programkönyvtárat és egy hozzá tartozó tesztprogramot C nyelven. A fordítási környezet a CMake-re fog alapulni (az automake/autoconf/libtool kombináció helyett). A CMake 2.1 (elérhető a CMake CVS-ben) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá.
+Comment[it]=Genera un modello di libreria condivisa includente un'applicazione test in C. Compila usando CMake invece della combinazione automake/autoconf/libtool. Richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire di cmake 2.2.
+Comment[ja]=共有ライブラリのテンプレートを作成します。同時に C でテストアプリケーションも作成します。コンパイルには、automake/autoconf/libtool ではなく CMake (2.1 または 2.2) が必要です。
+Comment[nds]=Stellt en Vörlaag för en deelt Bibliotheek mit en Testprogramm in C op. Dat Kompileren bruukt ansteed vun de "automake/autoconf/libtool"-Kombinatschoon "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav).
+Comment[ne]=C मा परीक्षण अनुप्रयोग सहितको साझेदारी टेम्प्लेट उत्पन्न गर्दछ । यसले automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर कम्पाइल गर्दछ । यसका लागि cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा अब आउने cmake 2.2 उत्पादन आवश्यक पर्दछ ।
+Comment[nl]=Genereert een gedeelde-bibliotheek-sjabloon inclusief een testtoepassing in C. Het compileert met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (beschikbaar in het cvs van cmake) of de aankomende cmake 2.2-uitgave.
+Comment[pl]=Generuje szablon współdzielonej biblioteki zawierający także program testowy w języku C. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2.
+Comment[pt]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[pt_BR]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[ru]=Создание шаблона разделяемой библиотеки, включая тестовую программу на C. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2.
+Comment[sk]=Vygeneruje šablónu pre zdieľanú knižnicu vrátane testovacej aplikácie v C.Kompiluje sa pomocou nástroja CMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release.
+Comment[sl]=Ustvari predlogo za deljeno knjižnico in testni program v C. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2.
+Comment[sr]=Прави шаблон дељене библиотеке, укључујући и пробни програм у C-у. Преводи се помоћу алата CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2.
+Comment[sr@Latn]=Pravi šablon deljene biblioteke, uključujući i probni program u C-u. Prevodi se pomoću alata CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2.
+Comment[sv]=Skapar en mall för ett delat bibliotek inklusive ett testprogram i C. Det kompileras med byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2.
+Comment[tr]=C'de bir test uygulaması içeren bir paylaşılan kütüphane uygulaması yaratır. automake/autoconf/libtool birleşimini değil, CMake aracını kullanarak derlenir. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar.
+Comment[zh_CN]=生成一个共享库模板,其中包含一个 C 的测试应用程序。该模板使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该模板需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。
+Comment[zh_TW]=產生一個共享函式庫樣本,包括一個 C 的測試程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.c
+Archive=cmakelibc.tar.gz
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[FILE2]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt.src
+Dest=%{dest}/src/CMakeLists.txt
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/test.c
+Dest=%{dest}/src/%{APPNAMELC}test.c
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/lib.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE5]
+Type=install
+EscapeXML=true
+Source=%{src}/lib.c
+Dest=%{dest}/src/%{APPNAMELC}.c
+
+[CMAKE]
+Type=finishcmd
+Command=cmake ./ -GKDevelop3
+Directory=%{dest}
+
+[MSG]
+Type=message
+Comment=A CMake based shared library template was created in %{dest}
+Comment[ca]=Una plantilla de biblioteca compartida basada en CMake ha estat creada en %{dest}
+Comment[da]=En CMake baseret skabelon for et delt bibliotek blev oprettet i %{dest}
+Comment[de]=Eine auf CMake basierende Vorlage für eine Shared Library wurde in %{dest} erstellt.
+Comment[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης βασισμένο στο CMake δημιουργήθηκε στο %{dest}
+Comment[es]=Una plantilla de biblioteca compartida basada en CMake ha sido creada en %{dest}
+Comment[et]=Jagatud teegi mall CMake'i põhjal loodi asukohta %{dest}
+Comment[eu]=CMake-en oinarritutako liburutegi partekatu baten txantiloia sortu da hemen: %{dest}
+Comment[fa]=یک قالب کتابخانۀ مشترک بر مبنای CMake در %{dest} ایجاد شد
+Comment[fr]=Un modèle de bibliothèque partagée basée sur CMake a été créé dans %{dest}
+Comment[ga]=Cruthaíodh teimpléad comhleabharlainne bunaithe ar CMake i %{dest}
+Comment[gl]=Creouse una plantilla de biblioteca compartida baseada en CMake en %{dest}
+Comment[hu]=Létrejött egy CMake-alapú osztott programkönyvtár-sablon itt: %{dest}
+Comment[it]=È stato creato un modello di librerie condivise basate su CMake in %{dest}
+Comment[ja]=CMake ベースの共有ライブラリテンプレートを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op CMake opbuut Vörlaag för en deelt Bibliotheek opstellt
+Comment[ne]=एउटा CMake आधारित साझेदारी लाइब्रेरी टेम्प्लेट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een op Cmake gebaseerde bibliotheeksjabloon is aangemaakt in %{dest}
+Comment[pl]=Używający CMake szablon biblioteki współdzielonej został utworzony w %{dest}
+Comment[pt]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest}
+Comment[pt_BR]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest}
+Comment[ru]=Основанный на CMake шаблон разделяемой библиотеки создан в %{dest}
+Comment[sk]=Šablóna zdieľanej knižnice založenej na CMake bola vytvorená v %{dest}
+Comment[sl]=Predloga deljene knjižnice, ki uporablja CMake, je bila ustvarjena v %{dest}
+Comment[sr]=Шаблон дељене библиотеке на основу CMake-а направљен је у %{dest}
+Comment[sr@Latn]=Šablon deljene biblioteke na osnovu CMake-a napravljen je u %{dest}
+Comment[sv]=En CMake-baserad mall för ett delat bibliotek skapades i %{dest}
+Comment[tr]=CMake tabanlı paylaşılan kütüphane şablonu %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了基于 CMake 的共享库
+Comment[zh_TW]=以 CMake 為基礎的共享函式庫樣本已建立在 %{dest}
diff --git a/languages/cpp/app_templates/cmakelibc/cmakelibc.png b/languages/cpp/app_templates/cmakelibc/cmakelibc.png
new file mode 100644
index 00000000..158d3ce7
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/cmakelibc.png
Binary files differ
diff --git a/languages/cpp/app_templates/cmakelibc/lib.c b/languages/cpp/app_templates/cmakelibc/lib.c
new file mode 100644
index 00000000..4d285882
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/lib.c
@@ -0,0 +1,13 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "%{APPNAMELC}.h"
+
+
+void do_something()
+{
+ printf("Hello world !\n");
+}
+
+
diff --git a/languages/cpp/app_templates/cmakelibc/lib.h b/languages/cpp/app_templates/cmakelibc/lib.h
new file mode 100644
index 00000000..1b326544
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/lib.h
@@ -0,0 +1,7 @@
+#ifndef %{APPNAMELC}_H
+#define %{APPNAMELC}_H
+
+void do_something();
+
+
+#endif
diff --git a/languages/cpp/app_templates/cmakelibc/test.c b/languages/cpp/app_templates/cmakelibc/test.c
new file mode 100644
index 00000000..fb13e866
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibc/test.c
@@ -0,0 +1,8 @@
+
+#include "%{APPNAMELC}.h"
+
+int main(int argc, char** argv)
+{
+ do_something();
+ return 0;
+}
diff --git a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt
new file mode 100644
index 00000000..8f172103
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+PROJECT(%{APPNAMELC})
+
+#if you don't want the full compiler output, remove the following line
+
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+SUBDIRS(src)
diff --git a/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src
new file mode 100644
index 00000000..ee2bb832
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/CMakeLists.txt.src
@@ -0,0 +1,19 @@
+#this is just a basic CMakeLists.txt, for more information see the cmake manpage
+
+#add definitions, compiler switches, etc.
+ADD_DEFINITIONS(-Wall -O2)
+
+#build a shared library
+ADD_LIBRARY(%{APPNAMELC} SHARED %{APPNAMELC}.cpp)
+
+#for testing the shared library you probably need some test app too
+ADD_EXECUTABLE(%{APPNAMELC}test %{APPNAMELC}test.cpp)
+
+#need to link to some other libraries ? just add them here
+TARGET_LINK_LIBRARIES(%{APPNAMELC}test %{APPNAMELC})
+
+#add an install target here
+#INSTALL_FILES(...)
+#INSTALL_PROGRAMS(...)
+#INSTALL_TARGET(...)
+
diff --git a/languages/cpp/app_templates/cmakelibcpp/Makefile.am b/languages/cpp/app_templates/cmakelibcpp/Makefile.am
new file mode 100644
index 00000000..395bb107
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = test.cpp lib.h lib.cpp cmakelibcpp.png CMakeLists.txt CMakeLists.txt.src
+templateName = cmakelibcpp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp
new file mode 100644
index 00000000..c68119c5
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp
@@ -0,0 +1,7 @@
+# KDE Config File
+[General]
+Name=A shared library template
+Icon=cmakelibcpp.png
+Category=C++/CMake based projects
+Comment=Generates a shared library template including a test application in C++. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp
diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate
new file mode 100644
index 00000000..e6e6ac44
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.kdevtemplate
@@ -0,0 +1,139 @@
+# KDE Config File
+[General]
+Name=A shared library template
+Name[ca]=Una plantilla de biblioteca compartida
+Name[da]=En delt biblitekskabelon
+Name[de]=Vorlage für eine Shared Library
+Name[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης
+Name[es]=Una plantilla de biblioteca compartida
+Name[et]=Jagatud teegi mall
+Name[eu]=Liburutegi partekatu baten txantiloia
+Name[fa]=قالب کتابخانۀ مشترک
+Name[fr]=Un modèle de bibliothèque partagée
+Name[ga]=Teimpléad comhleabharlainne
+Name[gl]=Plantilla de biblioteca compartida
+Name[hu]=Osztott programkönyvtár-sablon
+Name[it]=Un modello di libreria condivisa
+Name[ja]=共有ライブラリのテンプレート
+Name[nds]=Vörlaag för deelt Bibliotheek
+Name[ne]=साझेदारी गरिएको लाइब्रेरी टेम्प्लेट
+Name[nl]=Een gedeelde-bibliotheek-sjabloon
+Name[pl]=Szablon współdzielonej biblioteki
+Name[pt]=Um modelo de uma biblioteca dinâmica
+Name[pt_BR]=Um modelo de uma biblioteca dinâmica
+Name[ru]=Шаблон разделяемой библиотеки
+Name[sk]=Šablóna pre zdieľanú knižnicu
+Name[sl]=Predloga deljene knjižnice
+Name[sr]=Шаблон дељене библиотеке
+Name[sr@Latn]=Šablon deljene biblioteke
+Name[sv]=En mall för ett delat bibliotek
+Name[tr]=Bir paylaşılan kütüphane şablonu
+Name[zh_CN]=共享库模板
+Name[zh_TW]=共享函式庫樣本
+Icon=cmakelibcpp.png
+Category=C++/CMake based projects
+FileTemplates=h,CStyle,cpp,CStyle
+Comment=Generates a shared library template including a test application in C++. It compiles using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+Comment[ca]=Genera una plantilla de biblioteca compartida incloguen una aplicació de prova en C++. Es compila usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2.
+Comment[da]=Genererer skabelon for delt bibliotek inklusive et testprogram i C++. Det kompileres ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse.
+Comment[de]=Erstellt eine Vorlage für eine Shared Library inklusive einer Testanwendung in C++. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake.
+Comment[el]=Δημιουργεί ένα πρότυπο κοινόχρηστης βιβλιοθήκης που περιλαμβάνει και μια εφαρμογή δοκιμής σε C++. Μεταγλωττίζεται χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2.
+Comment[es]=Genera una plantilla de biblioteca compartida incluyendo una aplicación de prueba en C++. Se compila usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2.
+Comment[et]=Jagatud teegi malli loomine, kaasa arvatud testrakendus C++-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2.
+Comment[eu]=Liburutegi partekatu baten txantiloia sortzen du C++ lengoaian idatzitako probarako aplikazio batekin. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2.
+Comment[fa]=یک قالب کتابخانۀ مشترک شامل کاربرد آزمایشی در C++ تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند. به cmake 2.1 )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد.
+Comment[fr]=Génère un modèle de bibliothèque partagée incluant une application de test en C++. La compilation s'effectue à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite CMake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir.
+Comment[ga]=Cruthaigh teimpléad comhleabharlainne le feidhmchlár tástála i C++. Tiomsaítear é le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht.
+Comment[gl]=Xera unha plantilla de biblioteca compartida e máis unha aplicación de proba en C++. Compílase usando a ferramenta CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2.
+Comment[hu]=Létrehoz egy alap osztott programkönyvtárat és egy hozzá tartozó tesztprogramot C++ nyelven. A fordítási környezet a CMake-re fog alapulni (az automake/autoconf/libtool kombináció helyett). A CMake 2.1 (elérhető a CMake CVS-ben) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá.
+Comment[it]=Genera un modello di libreria condivisa che include una applicazione test in C++. Compila usando CMake invece della combinazione automake/autoconf/libtool. Richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire cmake 2.2.
+Comment[ja]=共有ライブラリのテンプレートを作成します。同時に C++ でテストアプリケーションも作成します。コンパイルには、automake/autoconf/libtool ではなく CMake (2.1 または 2.2) が必要です。
+Comment[nds]=Stellt en Vörlaag för en deelt Bibliotheek mit en Testprogramm in C++ op. Dat Kompileren bruukt ansteed vun de "automake/autoconf/libtool"-Kombinatschoon "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav).
+Comment[ne]=C++ मा परीक्षण अनुप्रयोग सहितको साझेदारी टेम्प्लेट उत्पन्न गर्दछ । यसले automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर कम्पाइल गर्दछ । यसका लागि cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा अब आउने cmake 2.2 उत्पादन आवश्यक पर्दछ ।
+Comment[nl]=Genereert een gedeelde-bibliotheek-sjabloon inclusief een testtoepassing in C++. Het compileert met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (uit het cvs van cmake) of de aankomende cmake 2.2-uitgave.
+Comment[pl]=Generuje szablon współdzielonej biblioteki zawierający także program testowy w języku C++. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2.
+Comment[pt]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C++. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[pt_BR]=Gera um modelo de uma biblioteca dinâmica, que inclui uma aplicação de testes em C++. Ele é compilado com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[ru]=Создание шаблона разделяемой библиотеки, включая тестовую программу на C++. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2.
+Comment[sk]=Vygeneruje šablónu zdieľanej knižnice vrátane testovacej aplikácie v C++.Kompiluje sa pomocou nástroja CMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release.
+Comment[sl]=Ustvari predlogo za deljeno knjižnico in testni program v C++. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2.
+Comment[sr]=Прави шаблон дељене библиотеке укључујући и пробни програм у C++-у. Преводи се помоћу алата CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2.
+Comment[sr@Latn]=Pravi šablon deljene biblioteke uključujući i probni program u C++-u. Prevodi se pomoću alata CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2.
+Comment[sv]=Skapar en mall för ett delat bibliotek inklusive ett testprogram i C++. Det kompileras med byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2.
+Comment[tr]=C++'da bir test uygulaması içeren bir paylaşılan kütüphane uygulaması yaratır. automake/autoconf/libtool birleşimini değil, CMake aracını kullanarak derlenir. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar.
+Comment[zh_CN]=生成一个共享库模板,其中包含一个 C++ 的测试应用程序。该模板使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该模板需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。
+Comment[zh_TW]=產生一個包括 C++ 測試程式的共享函式庫樣本。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=cmakelibcpp.tar.gz
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[FILE2]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt.src
+Dest=%{dest}/src/CMakeLists.txt
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/test.cpp
+Dest=%{dest}/src/%{APPNAMELC}test.cpp
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/lib.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE5]
+Type=install
+EscapeXML=true
+Source=%{src}/lib.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[CMAKE]
+Type=finishcmd
+Command=cmake ./ -GKDevelop3
+Directory=%{dest}
+
+[MSG]
+Type=message
+Comment=A CMake based shared library template was created in %{dest}
+Comment[ca]=Una plantilla de biblioteca compartida basada en CMake ha estat creada en %{dest}
+Comment[da]=En CMake baseret skabelon for et delt bibliotek blev oprettet i %{dest}
+Comment[de]=Eine auf CMake basierende Vorlage für eine Shared Library wurde in %{dest} erstellt.
+Comment[el]=Ένα πρότυπο κοινόχρηστης βιβλιοθήκης βασισμένο στο CMake δημιουργήθηκε στο %{dest}
+Comment[es]=Una plantilla de biblioteca compartida basada en CMake ha sido creada en %{dest}
+Comment[et]=Jagatud teegi mall CMake'i põhjal loodi asukohta %{dest}
+Comment[eu]=CMake-en oinarritutako liburutegi partekatu baten txantiloia sortu da hemen: %{dest}
+Comment[fa]=یک قالب کتابخانۀ مشترک بر مبنای CMake در %{dest} ایجاد شد
+Comment[fr]=Un modèle de bibliothèque partagée basée sur CMake a été créé dans %{dest}
+Comment[ga]=Cruthaíodh teimpléad comhleabharlainne bunaithe ar CMake i %{dest}
+Comment[gl]=Creouse una plantilla de biblioteca compartida baseada en CMake en %{dest}
+Comment[hu]=Létrejött egy CMake-alapú osztott programkönyvtár-sablon itt: %{dest}
+Comment[it]=È stato creato un modello di librerie condivise basate su CMake in %{dest}
+Comment[ja]=CMake ベースの共有ライブラリテンプレートを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op CMake opbuut Vörlaag för en deelt Bibliotheek opstellt
+Comment[ne]=एउटा CMake आधारित साझेदारी लाइब्रेरी टेम्प्लेट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een op Cmake gebaseerde bibliotheeksjabloon is aangemaakt in %{dest}
+Comment[pl]=Używający CMake szablon biblioteki współdzielonej został utworzony w %{dest}
+Comment[pt]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest}
+Comment[pt_BR]=Foi criado um modelo de uma biblioteca dinâmica do CMake em %{dest}
+Comment[ru]=Основанный на CMake шаблон разделяемой библиотеки создан в %{dest}
+Comment[sk]=Šablóna zdieľanej knižnice založenej na CMake bola vytvorená v %{dest}
+Comment[sl]=Predloga deljene knjižnice, ki uporablja CMake, je bila ustvarjena v %{dest}
+Comment[sr]=Шаблон дељене библиотеке на основу CMake-а направљен је у %{dest}
+Comment[sr@Latn]=Šablon deljene biblioteke na osnovu CMake-a napravljen je u %{dest}
+Comment[sv]=En CMake-baserad mall för ett delat bibliotek skapades i %{dest}
+Comment[tr]=CMake tabanlı paylaşılan kütüphane şablonu %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了基于 CMake 的共享库
+Comment[zh_TW]=以 CMake 為基礎的共享函式庫樣本已建立在 %{dest}
diff --git a/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png
new file mode 100644
index 00000000..158d3ce7
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/cmakelibcpp.png
Binary files differ
diff --git a/languages/cpp/app_templates/cmakelibcpp/lib.cpp b/languages/cpp/app_templates/cmakelibcpp/lib.cpp
new file mode 100644
index 00000000..7dc4b57d
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/lib.cpp
@@ -0,0 +1,17 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "%{APPNAMELC}.h"
+
+
+Foo::Foo()
+{
+}
+
+void Foo::doSomething()
+{
+ printf("Hello world !\n");
+}
+
+
diff --git a/languages/cpp/app_templates/cmakelibcpp/lib.h b/languages/cpp/app_templates/cmakelibcpp/lib.h
new file mode 100644
index 00000000..5a434cdb
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/lib.h
@@ -0,0 +1,12 @@
+#ifndef %{APPNAMELC}_H
+#define %{APPNAMELC}_H
+
+class Foo
+{
+ public:
+ Foo();
+ void doSomething();
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/cmakelibcpp/test.cpp b/languages/cpp/app_templates/cmakelibcpp/test.cpp
new file mode 100644
index 00000000..b2464709
--- /dev/null
+++ b/languages/cpp/app_templates/cmakelibcpp/test.cpp
@@ -0,0 +1,9 @@
+
+#include "%{APPNAMELC}.h"
+
+int main(int argc, char** argv)
+{
+ Foo foo;
+ foo.doSomething();
+ return 0;
+}
diff --git a/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt
new file mode 100644
index 00000000..819d0a7e
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+PROJECT(%{APPNAMELC})
+
+# at least cmake version 2.4.0 is required
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
+
+# uncomment the following line if you require a special version of Qt
+# and adjust it accordingly
+# SET(QT_MIN_VERSION "3.0.0")
+
+# try to find Qt 3
+FIND_PACKAGE(Qt3 REQUIRED)
+
+ADD_SUBDIRECTORY(src)
diff --git a/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src
new file mode 100644
index 00000000..c4ce3e70
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/CMakeLists.txt.src
@@ -0,0 +1,28 @@
+# this is just a basic CMakeLists.txt
+# for more information see the cmake man page
+
+# add definitions, compiler switches, etc.
+ADD_DEFINITIONS(${QT_DEFINITIONS} -Wall -O2 -g)
+
+# add the Qt include dir to the include path
+INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
+
+# list all source files in a variable
+SET(%{APPNAMELC}_SRCS main.cpp %{APPNAMELC}.cpp)
+
+# specify the headers which have to be processed by moc
+# and collect the results in the variable given above
+QT_WRAP_CPP (%{APPNAMELC} %{APPNAMELC}_SRCS %{APPNAMELC}.h)
+
+# create tan executable from the list of source files
+ADD_EXECUTABLE(%{APPNAMELC} ${%{APPNAMELC}_SRCS})
+
+# link the application to the Qt libs
+TARGET_LINK_LIBRARIES(%{APPNAMELC} ${QT_LIBRARIES} )
+
+# create an install rule for the executable
+INSTALL(TARGETS %{APPNAMELC} DESTINATION bin )
+
+# if you need to install more things, take a look at the install() command
+# in the cmake man page
+
diff --git a/languages/cpp/app_templates/cmakeqt3app/Makefile.am b/languages/cpp/app_templates/cmakeqt3app/Makefile.am
new file mode 100644
index 00000000..c5fca50a
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.cpp cmakeqt3app.cpp cmakeqt3app.h cmakeqt3app.png \
+ filesave.xpm fileopen.xpm fileprint.xpm CMakeLists.txt CMakeLists.txt.src
+
+templateName = cmakeqt3app
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app
new file mode 100644
index 00000000..6ef2974f
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app
@@ -0,0 +1,8 @@
+# QMake application
+[General]
+Name=Qt3 Application
+Icon=cmakeqt3app.png
+Category=C++/CMake based projects
+Comment=Generate a CMake based Qt3 application
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp
new file mode 100644
index 00000000..841f88d4
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.cpp
@@ -0,0 +1,283 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qpopupmenu.h>
+#include <qmenubar.h>
+#include <qtextedit.h>
+#include <qfile.h>
+#include <qfiledialog.h>
+#include <qstatusbar.h>
+#include <qmessagebox.h>
+#include <qprinter.h>
+#include <qapplication.h>
+#include <qaccel.h>
+#include <qtextstream.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qwhatsthis.h>
+
+#include "filesave.xpm"
+#include "fileopen.xpm"
+#include "fileprint.xpm"
+
+%{APPNAME}::%{APPNAME}()
+ : QMainWindow( 0, "%{APPNAME}", WDestructiveClose )
+{
+ printer = new QPrinter;
+ QPixmap openIcon, saveIcon, printIcon;
+
+ QToolBar * fileTools = new QToolBar( this, "file operations" );
+ fileTools->setLabel( tr("File Operations") );
+
+ openIcon = QPixmap( fileopen );
+ QToolButton * fileOpen
+ = new QToolButton( openIcon, tr("Open File"), QString::null,
+ this, SLOT(choose()), fileTools, "open file" );
+
+ saveIcon = QPixmap( filesave );
+ QToolButton * fileSave
+ = new QToolButton( saveIcon, tr("Save File"), QString::null,
+ this, SLOT(save()), fileTools, "save file" );
+
+ printIcon = QPixmap( fileprint );
+ QToolButton * filePrint
+ = new QToolButton( printIcon, tr("Print File"), QString::null,
+ this, SLOT(print()), fileTools, "print file" );
+
+
+ (void)QWhatsThis::whatsThisButton( fileTools );
+
+ QString fileOpenText = tr("<p><img source=\"fileopen\"> "
+ "Click this button to open a <em>new file</em>. <br>"
+ "You can also select the <b>Open</b> command "
+ "from the <b>File</b> menu.</p>");
+
+ QWhatsThis::add( fileOpen, fileOpenText );
+
+ QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon );
+
+ QString fileSaveText = tr("<p>Click this button to save the file you "
+ "are editing. You will be prompted for a file name.\n"
+ "You can also select the <b>Save</b> command "
+ "from the <b>File</b> menu.</p>");
+
+ QWhatsThis::add( fileSave, fileSaveText );
+
+ QString filePrintText = tr("Click this button to print the file you "
+ "are editing.\n You can also select the Print "
+ "command from the File menu.");
+
+ QWhatsThis::add( filePrint, filePrintText );
+
+
+ QPopupMenu * file = new QPopupMenu( this );
+ menuBar()->insertItem( tr("&File"), file );
+
+
+ file->insertItem( tr("&New"), this, SLOT(newDoc()), CTRL+Key_N );
+
+ int id;
+ id = file->insertItem( openIcon, tr("&Open..."),
+ this, SLOT(choose()), CTRL+Key_O );
+ file->setWhatsThis( id, fileOpenText );
+
+ id = file->insertItem( saveIcon, tr("&Save"),
+ this, SLOT(save()), CTRL+Key_S );
+ file->setWhatsThis( id, fileSaveText );
+
+ id = file->insertItem( tr("Save &As..."), this, SLOT(saveAs()) );
+ file->setWhatsThis( id, fileSaveText );
+
+ file->insertSeparator();
+
+ id = file->insertItem( printIcon, tr("&Print..."),
+ this, SLOT(print()), CTRL+Key_P );
+ file->setWhatsThis( id, filePrintText );
+
+ file->insertSeparator();
+
+ file->insertItem( tr("&Close"), this, SLOT(close()), CTRL+Key_W );
+
+ file->insertItem( tr("&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q );
+
+ menuBar()->insertSeparator();
+
+ QPopupMenu * help = new QPopupMenu( this );
+ menuBar()->insertItem( tr("&Help"), help );
+
+ help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
+ help->insertItem( tr("About &Qt"), this, SLOT(aboutQt()) );
+ help->insertSeparator();
+ help->insertItem( tr("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 );
+
+ e = new QTextEdit( this, "editor" );
+ e->setFocus();
+ setCentralWidget( e );
+ statusBar()->message( tr("Ready"), 2000 );
+
+ resize( 450, 600 );
+}
+
+
+%{APPNAME}::~%{APPNAME}()
+{
+ delete printer;
+}
+
+
+
+void %{APPNAME}::newDoc()
+{
+ %{APPNAME} *ed = new %{APPNAME};
+ ed->setCaption(tr("Qt Example - Application"));
+ ed->show();
+}
+
+void %{APPNAME}::choose()
+{
+ QString fn = QFileDialog::getOpenFileName( QString::null, QString::null,
+ this);
+ if ( !fn.isEmpty() )
+ load( fn );
+ else
+ statusBar()->message( tr("Loading aborted"), 2000 );
+}
+
+
+void %{APPNAME}::load( const QString &fileName )
+{
+ QFile f( fileName );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+
+ QTextStream ts( &f );
+ e->setText( ts.read() );
+ e->setModified( FALSE );
+ setCaption( fileName );
+ statusBar()->message( tr("Loaded document %1").arg(fileName), 2000 );
+}
+
+
+void %{APPNAME}::save()
+{
+ if ( filename.isEmpty() ) {
+ saveAs();
+ return;
+ }
+
+ QString text = e->text();
+ QFile f( filename );
+ if ( !f.open( IO_WriteOnly ) ) {
+ statusBar()->message( tr("Could not write to %1").arg(filename),
+ 2000 );
+ return;
+ }
+
+ QTextStream t( &f );
+ t << text;
+ f.close();
+
+ e->setModified( FALSE );
+
+ setCaption( filename );
+
+ statusBar()->message( tr( "File %1 saved" ).arg( filename ), 2000 );
+}
+
+
+void %{APPNAME}::saveAs()
+{
+ QString fn = QFileDialog::getSaveFileName( QString::null, QString::null,
+ this );
+ if ( !fn.isEmpty() ) {
+ filename = fn;
+ save();
+ } else {
+ statusBar()->message( tr("Saving aborted"), 2000 );
+ }
+}
+
+
+void %{APPNAME}::print()
+{
+ // ###### Rewrite to use QSimpleRichText to print here as well
+ const int Margin = 10;
+ int pageNo = 1;
+
+ if ( printer->setup(this) ) { // printer dialog
+ statusBar()->message( tr("Printing...") );
+ QPainter p;
+ if( !p.begin( printer ) ) // paint on printer
+ return;
+
+ p.setFont( e->font() );
+ int yPos = 0; // y-position for each line
+ QFontMetrics fm = p.fontMetrics();
+ QPaintDeviceMetrics metrics( printer ); // need width/height
+ // of printer surface
+ for( int i = 0 ; i < e->lines() ; i++ ) {
+ if ( Margin + yPos > metrics.height() - Margin ) {
+ QString msg( "Printing (page " );
+ msg += QString::number( ++pageNo );
+ msg += ")...";
+ statusBar()->message( msg );
+ printer->newPage(); // no more room on this page
+ yPos = 0; // back to top of page
+ }
+ p.drawText( Margin, Margin + yPos,
+ metrics.width(), fm.lineSpacing(),
+ ExpandTabs | DontClip,
+ e->text( i ) );
+ yPos = yPos + fm.lineSpacing();
+ }
+ p.end(); // send job to printer
+ statusBar()->message( tr("Printing completed"), 2000 );
+ } else {
+ statusBar()->message( tr("Printing aborted"), 2000 );
+ }
+}
+
+void %{APPNAME}::closeEvent( QCloseEvent* ce )
+{
+ if ( !e->isModified() ) {
+ ce->accept();
+ return;
+ }
+
+ switch( QMessageBox::information( this, tr("Qt Application Example"),
+ tr("Do you want to save the changes"
+ " to the document?"),
+ tr("Yes"), tr("No"), tr("Cancel"),
+ 0, 1 ) ) {
+ case 0:
+ save();
+ ce->accept();
+ break;
+ case 1:
+ ce->accept();
+ break;
+ case 2:
+ default: // just for sanity
+ ce->ignore();
+ break;
+ }
+}
+
+
+void %{APPNAME}::about()
+{
+ QMessageBox::about( this, tr("Qt Application Example"),
+ tr("This example demonstrates simple use of "
+ "QMainWindow,\nQMenuBar and QToolBar."));
+}
+
+
+void %{APPNAME}::aboutQt()
+{
+ QMessageBox::aboutQt( this, tr("Qt Application Example") );
+}
diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h
new file mode 100644
index 00000000..2d372da9
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.h
@@ -0,0 +1,39 @@
+%{H_TEMPLATE}
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#include <qmainwindow.h>
+
+class QTextEdit;
+
+class %{APPNAME}: public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}();
+ ~%{APPNAME}();
+
+protected:
+ void closeEvent( QCloseEvent* );
+
+private slots:
+ void newDoc();
+ void choose();
+ void load( const QString &fileName );
+ void save();
+ void saveAs();
+ void print();
+
+ void about();
+ void aboutQt();
+
+private:
+ QPrinter *printer;
+ QTextEdit *e;
+ QString filename;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate
new file mode 100644
index 00000000..ff69203c
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.kdevtemplate
@@ -0,0 +1,126 @@
+# KDE Config File
+[General]
+Name=Qt3 Application
+Name[br]=Meziant Qt3
+Name[ca]=Aplicació Qt3
+Name[da]=Qt3-Program
+Name[de]=Qt3-Anwendung
+Name[el]=Εφαρμογή Qt3
+Name[es]=Aplicación Qt3
+Name[et]=Qt3 rakendus
+Name[fr]=Application Qt3
+Name[hu]=Qt3-alapú alkalmazások
+Name[it]=Applicazione Qt3
+Name[ja]=Qt3 アプリケーション
+Name[nds]=Qt3-Programm
+Name[nl]=Qt3-toepassing
+Name[pl]=Program Qt3
+Name[pt]=Aplicação do Qt3
+Name[pt_BR]=Aplicação do Qt3
+Name[ru]=Приложение Qt 3
+Name[sk]=Qt3 aplikácia
+Name[sr]=Qt3 програм
+Name[sr@Latn]=Qt3 program
+Name[sv]=Qt3-program
+Name[zh_TW]=Qt3 應用程式
+Icon=cmakeqt3app.png
+Category=C++/CMake based projects
+Comment=Generate a CMake based Qt3 application
+Comment[ca]=Genera una aplicació Qt3 basada en CMake
+Comment[da]=Opretter et CMake-baseret Qt3-program
+Comment[de]=Erstellt eine auf CMake basierende Qt3-Anwendung
+Comment[el]=Δημιουργία μιας εφαρμογής Qt3 με βάση το CMake
+Comment[es]=Genera una aplicación Qt3 basada en CMake
+Comment[et]=Qt3 rakenduse loomine CMake'i põhjal
+Comment[fr]=Génère une application Qt3 basée sur CMake
+Comment[hu]=Létrehoz egy CMake-alapú Qt3-alkalmazást
+Comment[it]=Genera un'applicazione Qt3 basata su CMake
+Comment[ja]=CMake ベースの Qt3 アプリケーションを作成
+Comment[nds]=Stellt en op CMake opbuut Qt3-Programm op
+Comment[nl]=Genereer een CMake-gebaseerde Qt3-toepassing
+Comment[pl]=Generuje program Qt3 używający CMake
+Comment[pt]=Gera uma aplicação em Qt3 baseada no CMake
+Comment[pt_BR]=Gera uma aplicação em Qt3 baseada no CMake
+Comment[ru]=Создание основанного на CMake приложения Qt 3
+Comment[sk]=Vygeneruje Qt3 aplikáciu založenú na CMake
+Comment[sr]=Прави Qt3 програм на основу CMake-а
+Comment[sr@Latn]=Pravi Qt3 program na osnovu CMake-a
+Comment[sv]=Skapar ett CMake-baserat Qt3-program
+Comment[zh_TW]=產生使用 CMake 的 Qt3 應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=cmakeqt3app.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE2]
+Type=install
+Source=%{src}/CMakeLists.txt.src
+Dest=%{dest}/src/CMakeLists.txt
+
+[FILE3]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE4]
+Type=install
+Source=%{src}/cmakeqt3app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/cmakeqt3app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE6]
+Type=install
+Source=%{src}/fileopen.xpm
+Dest=%{dest}/src/fileopen.xpm
+
+[FILE7]
+Type=install
+Source=%{src}/filesave.xpm
+Dest=%{dest}/src/filesave.xpm
+
+[FILE8]
+Type=install
+Source=%{src}/fileprint.xpm
+Dest=%{dest}/src/fileprint.xpm
+
+[CMAKE]
+Type=finishcmd
+Command=cmake ./ -GKDevelop3
+Directory=%{dest}
+
+[MSG]
+Type=message
+Comment=A CMake based Qt3 application was created in %{dest}
+Comment[ca]=Una aplicació Qt3 basada en CMake ha estat creada en %{dest}
+Comment[da]=Et CMake-baseret Qt3-program blev oprettet i %{dest}
+Comment[de]=Eine auf CMake basierende Qt3-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Qt3 βασισμένη στο Qmake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Qt3 basada en CMake ha sido creada en %{dest}
+Comment[et]=Qt3 rakendus CMake'i põhjal loodi asukohta %{dest}
+Comment[fr]=Une application Qt3 basée sur CMake a été créée dans %{dest}
+Comment[hu]=Létrejött egy CMake-alapú Qt3-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Qt3 basata su CMake in %{dest}
+Comment[ja]=CMake ベースの Qt3 アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op CMake opbuut Qt3-Programm opstellt
+Comment[nl]=Een Cmake-gebaseerde Qt3-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program Qt3 oparty na CMake został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Qt3 baseada no CMake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Qt3 baseada no CMake em %{dest}
+Comment[ru]=Использующее CMake приложение Qt 3 создано в %{dest}
+Comment[sk]=Qt3 aplikácia založená na CMake bola vytvorená v %{dest}
+Comment[sr]=Qt3 програм на основу CMake-а направљен је у %{dest}
+Comment[sr@Latn]=Qt3 program na osnovu CMake-a napravljen je u %{dest}
+Comment[sv]=Ett CMake-baserat Qt3-program skapades i %{dest}
+Comment[zh_TW]=一個以 Cmake 為基礎的 Qt3 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png
new file mode 100644
index 00000000..dda0a10b
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/cmakeqt3app.png
Binary files differ
diff --git a/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm b/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm
new file mode 100644
index 00000000..880417ee
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/fileopen.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *fileopen[] = {
+" 16 13 5 1",
+". c #040404",
+"# c #808304",
+"a c None",
+"b c #f3f704",
+"c c #f3f7f3",
+"aaaaaaaaa...aaaa",
+"aaaaaaaa.aaa.a.a",
+"aaaaaaaaaaaaa..a",
+"a...aaaaaaaa...a",
+".bcb.......aaaaa",
+".cbcbcbcbc.aaaaa",
+".bcbcbcbcb.aaaaa",
+".cbcb...........",
+".bcb.#########.a",
+".cb.#########.aa",
+".b.#########.aaa",
+"..#########.aaaa",
+"...........aaaaa"
+};
diff --git a/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm b/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm
new file mode 100644
index 00000000..6ada912f
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/fileprint.xpm
@@ -0,0 +1,24 @@
+/* XPM */
+static const char *fileprint[] = {
+" 16 14 6 1",
+". c #000000",
+"# c #848284",
+"a c #c6c3c6",
+"b c #ffff00",
+"c c #ffffff",
+"d c None",
+"ddddd.........dd",
+"dddd.cccccccc.dd",
+"dddd.c.....c.ddd",
+"ddd.cccccccc.ddd",
+"ddd.c.....c....d",
+"dd.cccccccc.a.a.",
+"d..........a.a..",
+".aaaaaaaaaa.a.a.",
+".............aa.",
+".aaaaaa###aa.a.d",
+".aaaaaabbbaa...d",
+".............a.d",
+"d.aaaaaaaaa.a.dd",
+"dd...........ddd"
+};
diff --git a/languages/cpp/app_templates/cmakeqt3app/filesave.xpm b/languages/cpp/app_templates/cmakeqt3app/filesave.xpm
new file mode 100644
index 00000000..bd6870f4
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/filesave.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *filesave[] = {
+" 14 14 4 1",
+". c #040404",
+"# c #808304",
+"a c #bfc2bf",
+"b c None",
+"..............",
+".#.aaaaaaaa.a.",
+".#.aaaaaaaa...",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".##........##.",
+".############.",
+".##.........#.",
+".##......aa.#.",
+".##......aa.#.",
+".##......aa.#.",
+"b............."
+};
diff --git a/languages/cpp/app_templates/cmakeqt3app/main.cpp b/languages/cpp/app_templates/cmakeqt3app/main.cpp
new file mode 100644
index 00000000..bd26f19a
--- /dev/null
+++ b/languages/cpp/app_templates/cmakeqt3app/main.cpp
@@ -0,0 +1,13 @@
+%{CPP_TEMPLATE}
+
+#include <qapplication.h>
+#include "%{APPNAMELC}.h"
+
+int main( int argc, char ** argv ) {
+ QApplication a( argc, argv );
+ %{APPNAME} * mw = new %{APPNAME}();
+ mw->setCaption( "%{APPNAME}" );
+ mw->show();
+ a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
+ return a.exec();
+}
diff --git a/languages/cpp/app_templates/cmakesimple/CMakeLists.txt b/languages/cpp/app_templates/cmakesimple/CMakeLists.txt
new file mode 100644
index 00000000..c8087165
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+PROJECT(%{APPNAMELC})
+
+#if you don't want the full compiler output, remove the following line
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+#add definitions, compiler switches, etc.
+ADD_DEFINITIONS(-Wall -O2)
+
+#list all source files here
+ADD_EXECUTABLE(%{APPNAMELC} main.cpp)
+
+#need to link to some other libraries ? just add them here
+#TARGET_LINK_LIBRARIES(%{APPNAMELC} png jpeg)
+
diff --git a/languages/cpp/app_templates/cmakesimple/Makefile.am b/languages/cpp/app_templates/cmakesimple/Makefile.am
new file mode 100644
index 00000000..243ed01d
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.cpp cmakesimple.png CMakeLists.txt README
+templateName = cmakesimple
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/cmakesimple/README b/languages/cpp/app_templates/cmakesimple/README
new file mode 100644
index 00000000..1a96a1e8
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/README
@@ -0,0 +1,30 @@
+-----------------------------------------------
+Simple C++ Hello World template based on cmake
+QStart
+Author: Anne-Marie Mahfouf
+Date: 2006-12-06
+-----------------------------------------------
+
+This README file explains you basic things for starting with
+this application template.
+
+-----------------------------------------------
+* REQUIREMENTS *
+- Qt version might be 3.3.4 or 3.3.5
+- kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template.
+- cmake (http://www.cmake.org/) version 2.1 or 2.2 in your PATH
+-----------------------------------------------
+
+-----------------------------------------------
+* Building and running *
+- cmake will run after the template is loaded provided cmake is in your PATH. If not, you will see an error message in the terminal
+and you will need to install cmake in your PATH.
+- In the Build menu in KDevelop, click on Build Project (or use the F8 shortcut) in order to build your project.
+- Run your project using the Build menu -> Execute Program. Note that default makes your program run in KDevelop integrated terminal. You can run your program in an external terminal by changing the project options (Project -> Project Options -> Run options and check at the bottom "Start in external terminal")
+-----------------------------------------------
+
+-----------------------------------------------
+* Useful link *
+
+CMake Documentation: http://www.cmake.org/HTML/Documentation.html
+
diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple b/languages/cpp/app_templates/cmakesimple/cmakesimple
new file mode 100644
index 00000000..a0793d8f
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/cmakesimple
@@ -0,0 +1,7 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Icon=cmakesimple.png
+Category=C++/CMake based projects
+Comment=Generates a simple Hello world program in C++ using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+ShowFilesAfterGeneration=main.cpp
diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate b/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate
new file mode 100644
index 00000000..2e6032e8
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/cmakesimple.kdevtemplate
@@ -0,0 +1,112 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[ca]=Programa Hello world
+Name[da]=Goddag verden program
+Name[de]="Hello World"-Programm
+Name[el]=Πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo»
+Name[et]="Tere,maailm" programm
+Name[eu]="Kaixo mundua" programa
+Name[fa]=برنامۀ Hello world
+Name[fr]=Programme « Bonjour monde »
+Name[ga]=Ríomhchlár "Hello world"
+Name[gl]=Programa Ola mundo
+Name[it]=Programma di "Hello world"
+Name[ja]=Hello world プログラム
+Name[nds]="Moin Welt"-Programm
+Name[ne]=हेल्डो वोल्ड कार्यक्रम
+Name[nl]=Hello World-programma
+Name[pl]=Program 'Witaj świecie'
+Name[pt]=Programa 'Olá mundo'
+Name[pt_BR]=Programa 'Olá mundo'
+Name[ru]=Программа Hello world
+Name[sk]=Ahoj svet program
+Name[sl]=Program Hello world
+Name[sr]=Програм „Здраво свете“
+Name[sr@Latn]=Program „Zdravo svete“
+Name[sv]=Hello world-program
+Name[tr]=Merhaba Dünya Programı
+Name[zh_CN]=Hello world 程序
+Name[zh_TW]=Hello world 程式
+Icon=cmakesimple.png
+Category=C++/CMake based projects
+Comment=Generates a simple Hello world program in C++ using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 or cmake 2.2.
+Comment[ca]=Genera un simple programa de Hello world en C++ usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 o cmake 2.2.
+Comment[da]=Genererer et simpelt Goddag verden program i C++ ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1eller cmake 2.2.
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake.
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα 'Γεια σου Κόσμε' σε C++, χρησιμοποιώντας το εργαλείο κατασκευής CMake αντί του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 ή το cmake 2.2.
+Comment[es]=Genera un sencillo programa «Hola mundo» en C++ usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 o cmake 2.2.
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 või 2.2.
+Comment[fr]=Génère un programme « Bonjour monde » simple en C++ à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite cmake 2.1 (disponible sur le CVS de CMake) ou cmake 2.2.
+Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot C++ nyelven a CMake segítségével (az automake/autoconf/libtool kombináció helyett). CMake 2.1 vagy 2.2 szükséges hozzá.
+Comment[it]=Genera un semplice programma di "Hello world" in C++ che usa CMake invece della combinazione automake/autoconf/libtool. Si richiede cmake 2.1 o la versione 2.2.
+Comment[ja]=ビルドに automake/autoconf/libtool ではなく CMake を使った簡単な Hello World プログラムを C++ で作成します。CMake 2.1 または 2.2 が必要です。
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op, mit "CMake" ansteed vun de "automake/autoconf/libtool"-Reeg. Nödig is Verschoon 2.1 oder 2.2 vun CMake.
+Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 of cmake 2.2.
+Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake w wersji 2.1 lub 2.2.
+Comment[pt]=Gera um programa simples Olá Mundo em C++, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 ou do cmake 2.2.
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 ou do cmake 2.2.
+Comment[ru]=Создание простого приложения Hello world на C++. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake версии 2.1 или 2.2.
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++ s využitím nástroja CMake namiesto kombinácie automake/autoconf/libtool. Vyžaduje cmake 2.1 alebo cmake 2.2.
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у користећи алат CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 или 2.2.
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u koristeći alat CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 ili 2.2.
+Comment[sv]=Skapar ett enkelt Hello world-program i C++ med användning av byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 eller cmake 2.2.
+Comment[zh_TW]=它產生一個簡單的 C++ Hello world 程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1 或是 2.2 版以上。
+#FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/main.cpp,%{dest}/README
+Archive=cmakesimple.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[FILE2]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/main.cpp
+
+[FILE3]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/README
+
+[CMAKE]
+Type=finishcmd
+Command=cmake ./ -GKDevelop3
+Directory=%{dest}
+
+[MSG]
+Type=message
+Comment=A CMake based hello world program was created in %{dest}
+Comment[ca]=Un programa de hello world basat en CMake ha estat creat en %{dest}
+Comment[da]=Et CMake-baseret Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein auf CMake basierendes "Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε βασισμένο στο CMake δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» basado en CMake ha sido creado en %{dest}
+Comment[et]="Tere, maailm" programm CMake'i põhjal loodi asukohta %{dest}
+Comment[eu]=CMake-en oinarritutako "kaixo mundua" programa bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ Hello World بر مبنای CMake در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » basé sur CMake a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár "Hello World" bunaithe ar CMake i %{dest}
+Comment[gl]=Creouse un programa Ola mundo baseado en CMake en %{dest}
+Comment[hu]=Létrejött egy CMake-alapú Hello world program itt: %{dest}
+Comment[it]=È stato creato un programma di "hello world" basato su CMake in %{dest}
+Comment[ja]=CMake ベースの hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op CMake opbuut "Moin Welt"-Programm opstellt
+Comment[ne]=CMake आधारित हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een CMake-gebaseerd Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Używający CMake program 'Witaj świecie' został utworzony w %{dest}
+Comment[pt]=Foi criado um programa Olá Mundo baseado no CMake em %{dest}
+Comment[pt_BR]=Foi criado um programa Olá Mundo baseado no CMake em %{dest}
+Comment[ru]=Основанное на CMake приложение создано в %{dest}
+Comment[sk]=Ahoj svet program založený na nástroji CMake bol vytvorený v %{dest}
+Comment[sl]=Program hello world na osnovi CMake je bil ustvarjen v %{dest}
+Comment[sr]=„Здраво свете“ на основу CMake-а направљен је у %{dest}
+Comment[sr@Latn]=„Zdravo svete“ na osnovu CMake-a napravljen je u %{dest}
+Comment[sv]=Ett CMake-baserat Hello world-program skapades i %{dest}
+Comment[tr]=Bir CMake tabanlı Merhaba Dünya programı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个基于 CMake 的 hello world 程序
+Comment[zh_TW]=以 CMake 為基礎的 hello world 程式已建立在 %{dest}
diff --git a/languages/cpp/app_templates/cmakesimple/cmakesimple.png b/languages/cpp/app_templates/cmakesimple/cmakesimple.png
new file mode 100644
index 00000000..d1a90c3a
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/cmakesimple.png
Binary files differ
diff --git a/languages/cpp/app_templates/cmakesimple/main.cpp b/languages/cpp/app_templates/cmakesimple/main.cpp
new file mode 100644
index 00000000..296f9324
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimple/main.cpp
@@ -0,0 +1,14 @@
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ printf("Hello, world!\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt b/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt
new file mode 100644
index 00000000..812fc007
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/CMakeLists.txt
@@ -0,0 +1,14 @@
+PROJECT(%{APPNAMELC})
+
+#if you don't want the full compiler output, remove the following line
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+
+#add definitions, compiler switches, etc.
+ADD_DEFINITIONS(-Wall -O2)
+
+#list all source files here
+ADD_EXECUTABLE(%{APPNAMELC} main.c)
+
+#need to link to some other libraries ? just add them here
+#TARGET_LINK_LIBRARIES(%{APPNAMELC} png jpeg)
+
diff --git a/languages/cpp/app_templates/cmakesimplec/Makefile.am b/languages/cpp/app_templates/cmakesimplec/Makefile.am
new file mode 100644
index 00000000..f5a1c3e7
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.c cmakesimplec.png CMakeLists.txt
+templateName = cmakesimplec
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec b/languages/cpp/app_templates/cmakesimplec/cmakesimplec
new file mode 100644
index 00000000..c0bc6fe2
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/cmakesimplec
@@ -0,0 +1,7 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Icon=cmakesimple.png
+Category=C/CMake based projects
+Comment=Generates a simple Hello world program in C using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+ShowFilesAfterGeneration=main.c
diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate
new file mode 100644
index 00000000..3fc09047
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.kdevtemplate
@@ -0,0 +1,115 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[ca]=Programa Hello world
+Name[da]=Goddag verden program
+Name[de]="Hello World"-Programm
+Name[el]=Πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo»
+Name[et]="Tere,maailm" programm
+Name[eu]="Kaixo mundua" programa
+Name[fa]=برنامۀ Hello world
+Name[fr]=Programme « Bonjour monde »
+Name[ga]=Ríomhchlár "Hello world"
+Name[gl]=Programa Ola mundo
+Name[it]=Programma di "Hello world"
+Name[ja]=Hello world プログラム
+Name[nds]="Moin Welt"-Programm
+Name[ne]=हेल्डो वोल्ड कार्यक्रम
+Name[nl]=Hello World-programma
+Name[pl]=Program 'Witaj świecie'
+Name[pt]=Programa 'Olá mundo'
+Name[pt_BR]=Programa 'Olá mundo'
+Name[ru]=Программа Hello world
+Name[sk]=Ahoj svet program
+Name[sl]=Program Hello world
+Name[sr]=Програм „Здраво свете“
+Name[sr@Latn]=Program „Zdravo svete“
+Name[sv]=Hello world-program
+Name[tr]=Merhaba Dünya Programı
+Name[zh_CN]=Hello world 程序
+Name[zh_TW]=Hello world 程式
+Icon=cmakesimplec.png
+Category=C/CMake based projects
+Comment=Generates a simple Hello world program in C using the CMake build tool instead of the automake/autoconf/libtool combination. It requires cmake 2.1 (available from cmake cvs) or the upcoming cmake 2.2 release.
+Comment[ca]=Genera un simple programa de Hello world en C usant l'eina de construcció CMake en comptes de la combinació automake/autoconf/libtool. Requereix cmake 2.1 (disponible en el cvs de cmake) o la propera versió 2.2.
+Comment[da]=Genererer et simpelt Goddag verden program i C ved brug af CMake byggeværktøjet i stedet for automake/autoconf/libtool kombinationen. Det kræver cmake 2.1 (tilgængelig fra cmake cvs) eller den fremtidige cmake 2.2 udgivelse.
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C. Der Kompiliervorgang wird mit CMake anstelle der Kombination automake/autoconf/libtool durchgeführt und erfordert CMake 2.1 (das über das CVS-Archiv von CMake verfügbar ist) oder die kommende Version 2.2 von CMake.
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C, χρησιμοποιώντας το εργαλείο κατασκευής CMake στη θέση του συνδυασμού automake/autoconf/libtool. Χρειάζεται το cmake 2.1 (διαθέσιμο από το cmake cvs) ή την επερχόμενη έκδοση cmake 2.2.
+Comment[es]=Genera un sencillo programa «Hola mundo» en C usando la herramienta CMake en lugar de la combinación automake/autoconf/libtool. Requiere cmake 2.1 (disponible en el cvs de cmake) o la próxima cmake 2.2.
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C-s. See kompileeritakse CMake'i ehitamistööriistaga, mitte automake/autoconf/libtool'i kombinatsiooniga. Selleks on vajalik CMake 2.1 (saadaval CMake'i CVSis) või peatne CMake'i versioon 2.2.
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C lengoaian. CMake tresna erabiliz konpilatzen du automake/autoconf/libtool taldea erabili ordez. cmake 2.1 behar du (cmake cvs-an eskuragarri) edo hurrengo cmake 2.2.
+Comment[fa]=یک برنامۀ سادۀ Hello world در سی تولید می‌کند. با استفاده از ابزار ساختن CMake به جای ترکیب automake/autoconf/libtool، ترجمه می‌کند.به cmake 2.1 دارد )از cmake cvs قابل دسترس است( یا نشر cmake 2.2 در آیندۀ نزدیک، نیاز دارد.
+Comment[fr]=Génère un programme « Bonjour monde » simple en C à l'aide de l'outil de construction CMake au lieu de la combinaison automake / autoconf / libtool. Nécessite cmake 2.1 (disponible sur le CVS de CMake) ou la version 2.2 de CMake à venir.
+Comment[ga]=Cruthaigh ríomhchlár simplí "Hello World" i C a thiomsaítear le huirlis tógála CMake in ionad automake/autoconf/libtool. Tá cmake 2.1 de dhíth (ar fáil ó cmake cvs) nó leagan 2.2 cmake atá le teacht.
+Comment[gl]=Xera un program sinxelo Ola mundo en C usando a ferramenta de compilación CMake no lugar da combinación automake/autoconf/libtool. Require cmake 2.1 (dispoñíbel no cvs de cmake) ou a próxima versión cmake 2.2.
+Comment[hu]=Létrehoz egy egyszerű Hello world programot C nyelven a CMake fordítóeszköz segítségével (az automake/autoconf/libtool kombináció helyett). CMake 2.1 (a CMake CVS-ben elérhető) vagy a rövidesen megjelenő CMake 2.2 szükséges hozzá.
+Comment[it]=Genera un semplice programma di "Hello world" in C che usa CMake invece della combinazione automake/autoconf/libtool. Si richiede cmake 2.1 (disponibile dal CVS di cmake) o la versione a venire cmake 2.2.
+Comment[ja]=ビルドに automake/autoconf/libtool ではなく CMake を使った簡単な Hello World プログラムを C で作成します。CMake 2.1 または 2.2 が必要です。
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C op mit "CMake" in de Verschoon 2.1 (ut dat cmake-CVS) oder 2.2 (de tokamen Utgaav) ansteed vun de "automake/autoconf/libtool"-Kombinatschoon.
+Comment[ne]= automake/autoconf/libtool संयोजनको सट्टामा CMake निर्माण उपकरण प्रयोग गरेर C मा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ । यसलाई cmake 2.1 (cmake cvs बाट उपलब्ध हुन्छ) वा आउदै गरेको cmake 2.2 उत्पादन आवश्यक हुन्छ ।
+Comment[nl]=Genereert een eenvoudig Hello World-programma in C met behulp van de CMake build tool in plaats van de combinatie automake/autoconf/libtool. Het vereist cmake 2.1 (uit het cvs van cmake) of de aankomende cmake 2.2-uitgave.
+Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C. Kompilacja odbywa sie za pomocą narzędzia CMake zamiast kombinacji automake/autoconf/libtool. Wymaga cmake 2.1 (dostępnego z cvs-u cmake) lub nadchodzącej wersji 2.2.
+Comment[pt]=Gera um programa simples Olá Mundo em C, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C, com a ferramenta CMake em vez da combinação automake/autoconf/libtool. Necessita do cmake 2.1 (disponível no CVS do 'cmake') ou da próxima versão cmake 2.2.
+Comment[ru]=Создание простого приложения Hello world на C. Для сборки потребуется CMake вместо комбинации automake/autoconf/libtool. Потребуется cmake 2.1 (из CVS cmake) или релиз cmake 2.2.
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C s využitím nástrojaCMake namiesto kombinácie automake/autoconf/libtool.Vyžaduje cmake 2.1 (dostupné v cmake cvs) alebo nadchádzajúci cmake 2.2 release.
+Comment[sl]=Ustvari preprost program »Pozdravljen svet« v C. Za prevajanje se namesto kombinacije automake/autoconf/libtool uporabi orodje za gradnjo CMake. Potreben je CMake 2.1 ali CMake 2.2.
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C-у користећи алат CMake уместо комбинације Automake/Autoconf/Libtool. Захтева CMake 2.1 (доступан у CVS-у CMake-а) или надолазеће издање CMake 2.2.
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C-u koristeći alat CMake umesto kombinacije Automake/Autoconf/Libtool. Zahteva CMake 2.1 (dostupan u CVS-u CMake-a) ili nadolazeće izdanje CMake 2.2.
+Comment[sv]=Skapar ett enkelt Hello world-program i C med användning av byggverktyget CMake istället för kombinationen automake/autoconf/libtool. Det kräver cmake 2.1 (tillgängligt från cmake CVS-arkiv) eller den förestående utgåvan av cmake 2.2.
+Comment[tr]=automake/autoconf/libtool birleşimi yerine CMake aracını kullanarak C'de basit bir Merhaba Dünya programı yaratır. cmake 2.1( cmake cvs'inden edinilebilir) veya yakında gelecek olan 2.2 sürümüne ihtiyaç duyar.
+Comment[zh_CN]=生成一个 C 的 Hello world 程序。该程序使用 CMake 编译工具编译,而不是使用 automake/autoconf/libtool 的组合。该程序需要 cmake 2.1 (可从 cmake cvs 中获得)或即将发布的 cmake 2.2 版本。
+Comment[zh_TW]=它產生一個簡單的 C 的 Hello world 程式。它要用 CMake 建立工具來編譯,而不是用 automake/autoconf/libtool 等。它需要 cmake 2.1(可以從 cmake cvs 中取得),或是以後的版本。
+#FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/main.c
+Archive=cmakesimplec.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[FILE2]
+Type=install
+Source=%{src}/main.c
+Dest=%{dest}/main.c
+
+[CMAKE]
+Type=finishcmd
+Command=cmake ./ -GKDevelop3
+Directory=%{dest}
+
+[MSG]
+Type=message
+Comment=A CMake based hello world program was created in %{dest}
+Comment[ca]=Un programa de hello world basat en CMake ha estat creat en %{dest}
+Comment[da]=Et CMake-baseret Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein auf CMake basierendes "Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε βασισμένο στο CMake δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» basado en CMake ha sido creado en %{dest}
+Comment[et]="Tere, maailm" programm CMake'i põhjal loodi asukohta %{dest}
+Comment[eu]=CMake-en oinarritutako "kaixo mundua" programa bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ Hello World بر مبنای CMake در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » basé sur CMake a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár "Hello World" bunaithe ar CMake i %{dest}
+Comment[gl]=Creouse un programa Ola mundo baseado en CMake en %{dest}
+Comment[hu]=Létrejött egy CMake-alapú Hello world program itt: %{dest}
+Comment[it]=È stato creato un programma di "hello world" basato su CMake in %{dest}
+Comment[ja]=CMake ベースの hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op CMake opbuut "Moin Welt"-Programm opstellt
+Comment[ne]=CMake आधारित हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een CMake-gebaseerd Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Używający CMake program 'Witaj świecie' został utworzony w %{dest}
+Comment[pt]=Foi criado um programa Olá Mundo baseado no CMake em %{dest}
+Comment[pt_BR]=Foi criado um programa Olá Mundo baseado no CMake em %{dest}
+Comment[ru]=Основанное на CMake приложение создано в %{dest}
+Comment[sk]=Ahoj svet program založený na nástroji CMake bol vytvorený v %{dest}
+Comment[sl]=Program hello world na osnovi CMake je bil ustvarjen v %{dest}
+Comment[sr]=„Здраво свете“ на основу CMake-а направљен је у %{dest}
+Comment[sr@Latn]=„Zdravo svete“ na osnovu CMake-a napravljen je u %{dest}
+Comment[sv]=Ett CMake-baserat Hello world-program skapades i %{dest}
+Comment[tr]=Bir CMake tabanlı Merhaba Dünya programı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个基于 CMake 的 hello world 程序
+Comment[zh_TW]=以 CMake 為基礎的 hello world 程式已建立在 %{dest}
diff --git a/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png
new file mode 100644
index 00000000..158d3ce7
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/cmakesimplec.png
Binary files differ
diff --git a/languages/cpp/app_templates/cmakesimplec/main.c b/languages/cpp/app_templates/cmakesimplec/main.c
new file mode 100644
index 00000000..296f9324
--- /dev/null
+++ b/languages/cpp/app_templates/cmakesimplec/main.c
@@ -0,0 +1,14 @@
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ printf("Hello, world!\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/cpp.appwizard b/languages/cpp/app_templates/cpp.appwizard
new file mode 100644
index 00000000..dc233269
--- /dev/null
+++ b/languages/cpp/app_templates/cpp.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=opiemenu,win32hello,cppcurseshello,gtk2mmapp,opienet,wxhello,cpphello,opietoday,clanlib,cppsdlhello,qmakeapp,qt4hello,qt4makeapp,cmakelibcpp,opieapp,qmakesimple,cmakesimple,generichello,opieapplet,qtopiaapp,gnome2mmapp,opieinput,win32gui,cmakeqt3app,qmakeempty,automakeempty,makefileempty,qtopia4app
diff --git a/languages/cpp/app_templates/cppcurseshello/.kdev_ignore b/languages/cpp/app_templates/cppcurseshello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/.kdev_ignore
diff --git a/languages/cpp/app_templates/cppcurseshello/Makefile.am b/languages/cpp/app_templates/cppcurseshello/Makefile.am
new file mode 100644
index 00000000..3f6f64af
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs\
+ app-configure.in app.kdevelop
+templateName = cppcurseshello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/cppcurseshello/app-configure.in b/languages/cpp/app_templates/cppcurseshello/app-configure.in
new file mode 100644
index 00000000..b7c83189
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/app-configure.in
@@ -0,0 +1,21 @@
+AC_INIT()
+AM_INIT_AUTOMAKE(%{APPNAMELC},%{VERSION})
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+AC_CHECK_HEADER([ncurses.h], [],
+ AC_MSG_ERROR([Couldn't find ncurses headers.]))
+
+AC_CHECK_LIB(ncurses, refresh, , AC_ERROR([Couldn't find ncurses library]), -lncurses, -ldl)
+
+AC_LANG_RESTORE
+
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/cppcurseshello/app.kdevelop b/languages/cpp/app_templates/cppcurseshello/app.kdevelop
new file mode 100644
index 00000000..c7498e39
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/app.kdevelop
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs
new file mode 100644
index 00000000..935cee02
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/cpp-Makefile.cvs
@@ -0,0 +1,7 @@
+default: all
+
+all:
+ aclocal
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello b/languages/cpp/app_templates/cppcurseshello/cppcurseshello
new file mode 100644
index 00000000..40fa8bce
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/cppcurseshello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple ncurses Hello world program
+Name[de]=Einfaches ncurses Hallo-Welt Programm
+Icon=
+Category=C++
+Comment=Generates a simple ncurses based Hello world program in C++
+Comment[de]=Erstellt ein einfaches Hallo Welt programm fr C++ basierend auf der ncurses Bibliothek
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate
new file mode 100644
index 00000000..451999a3
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.kdevtemplate
@@ -0,0 +1,143 @@
+# KDE Config File
+[General]
+Name=Simple ncurses Hello world program
+Name[ca]=Simple programa de Hello world per a ncurses
+Name[da]=Simpelt ncurses Goddag verden program
+Name[de]=Einfaches auf NCurses basierendes "Hello World"-Programm
+Name[el]=Απλό ncurses πρόγραμμα Γεια σου κόσμε
+Name[es]=Programa «Hola mundo» sencillo en ncurses
+Name[et]=Lihtne "Tere, maailm" programm ncurses'i põhjal
+Name[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat
+Name[fa]=برنامۀ سادۀ ncurses Hello world
+Name[fr]=Programme « Bonjour monde » simple en ncurses
+Name[ga]=Ríomhchlár simplí "Hello World" le ncurses
+Name[gl]=Programa sinxelo ncurses Ola mundo
+Name[hu]=Egyszerű, Ncurses-alapú Hello world program
+Name[it]=Semplice programma "Hello world" realizzato con ncurses
+Name[ja]=ncurses を使った簡単な Hello World プログラム
+Name[nds]=Eenfach ncurses-"Moin Welt"-Programm
+Name[ne]=साधारण ncurses हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Een eenvoudig ncurses Hello World-programma
+Name[pl]=Prosty program 'Witaj świecie' używający ncurses
+Name[pt]=Programa simples Olá Mundo em ncurses
+Name[pt_BR]=Programa simples Olá Mundo em ncurses
+Name[ru]=Простое приложение Hello world на ncurses
+Name[sk]=Jednoduchý "Ahoj svet" ncurses program
+Name[sl]=Preprost program Hello world na osnovi ncurses
+Name[sr]=Једноставан „Здраво свете“ програм за ncurses
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program za ncurses
+Name[sv]=Enkelt ncurses Hello world-program
+Name[tr]=Basit ncurses Merhaba Dünya programı
+Name[zh_CN]=简单的 ncurses Hello world 程序
+Name[zh_TW]=簡單的 ncurses Hello world 程式
+Icon=
+Category=C++
+Comment=Generates a simple ncurses based Hello world program in C++
+Comment[ca]=Genera un simple programa de Hello world en C++ i basat en ncurses
+Comment[da]=Genererer et simpelt ncurses baseret Goddag verden program in C++
+Comment[de]=Erstellt ein einfaches, auf NCurses basierendes "Hello World"-Programm in C++
+Comment[el]=Δημιουργεί ένα απλό βασισμένο σε ncurses πρόγραμμα Γεια σου κόσμε σε C++
+Comment[es]=Genera un sencillo programa «Hola mundo» en C++ basado en ncurses
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine ncurses'i põhjal C++-s
+Comment[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat C++ lengoaian
+Comment[fa]=یک برنامۀ سادۀ Hello world در C++ بر مبنای ncurses تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple basé sur ncurses en C++
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" bunaithe ar ncurses, i C++
+Comment[gl]=Xera un programa sinxelo Ola mundo baseado en ncurses en C++
+Comment[hu]=Létrehoz egy egyszerű, Ncurses-alapú Hello world programot C++-ban
+Comment[it]=Genera un semplice programma di "Hello world" in C++ realizzato con ncurses
+Comment[ja]=ncurses を使った簡単な Hello World プログラムを C++ で作成します
+Comment[nds]=Stellt en eenfach op "ncurses" opbuut "Moin Welt"-Programm in C++ op
+Comment[ne]=C++ मा हेल्लो वोल्ड कार्यक्रम आधारित साधारण ncurses उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig ncurses-gebaseerd Hello World-programma in C++
+Comment[pl]=Generuje prosty program 'Witaj świecie' używający ncurses i języka C++.
+Comment[pt]=Gera um programa simples Olá Mundo em C++, baseado no 'ncurses'
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, baseado no 'ncurses'
+Comment[ru]=Создание простого приложения Hello world на ncurses и C++
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" ncurses program v C++
+Comment[sl]=Ustvari preprost program Hello world na osnovi ncurses v C++
+Comment[sr]=Прави једноставан „Здраво свете“ програм на основу ncurses, у C++-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program na osnovu ncurses, u C++-u
+Comment[sv]=Skapar ett enkelt ncurses-baserat Hello world-program i C++
+Comment[tr]=C++'da ncurses tabanlı basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成一个基于 ncurses 的 C++ Hello world 程序
+Comment[zh_TW]=產生一個簡單的用 C++ 語言與 ncurses 函式庫的 Hello world 程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=cppcurseshello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/cpp-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/cpp-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/app-configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=A simple hello world program using ncurses was created in %{dest}
+Comment[ca]=Un simple programa de hello world usant ncurses ha estat creat en %{dest}
+Comment[da]=Et simpelt Goddag verden program ved brug af ncurses blev oprettet i %{dest}
+Comment[de]=Ein einfaches "Hello World"-Programm unter Verwendung von NCurses wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα Γεια σου Κόσμε χρησιμοποιώντας το ncurses δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa «Hola mundo» que usa ncurses ha sido creado en %{dest}
+Comment[et]=Lihtne "Tere, maailm" programm ncurses'i põhjas loodi asukohta %{dest}
+Comment[eu]=ncurses-en oinarritako "Kaixo mundua" programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ hello world با استفاده از ncurses در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » simple utilisant ncurses a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" le ncurses i %{dest}
+Comment[gl]=Creouse un programa sinxelo ola mundo usando ncurses en in %{dest}
+Comment[hu]=Létrejött egy egyszerű, Ncurses-alapú Hello world program itt: %{dest}
+Comment[it]=È stato creato un programma di "hello world" che usa ncurses in %{dest}
+Comment[ja]=ncurses を使った簡単な Hello World プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm opstellt, dat "ncurses" bruukt
+Comment[ne]=ncurses प्रयोग गरेर एउटा हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Hallo Wereld-programma gebruikmakend van ncurses is aangemaakt in %{dest}
+Comment[pl]=Prosty program 'Witaj świecie' używający ncurses został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples Olá Mundo que usa o ncurses em %{dest}
+Comment[pt_BR]=Foi criado um programa simples Olá Mundo que usa o ncurses em %{dest}
+Comment[ru]=Простое приложение Hello world на ncurses создано в %{dest}
+Comment[sk]=Jednoduchý "Ahoj svet" ncurses program bol vytvorený v %{dest}
+Comment[sl]=Preprost program Hello world na osnovi ncurses je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан „Здраво свете“ на основу ncurses направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo svete“ na osnovu ncurses napravljen je u %{dest}
+Comment[sv]=Ett enkelt Hello world-program som använder ncurses skapades i %{dest}
+Comment[tr]=ncurses kullanan basit bir merhaba dünya programı %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了一个使用 ncurses 的 hello world 程序
+Comment[zh_TW]=一個簡單的使用 ncurses 函式庫的 hello world 程式已建立在 %{dest}
diff --git a/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/cppcurseshello.png
Binary files differ
diff --git a/languages/cpp/app_templates/cppcurseshello/main.cpp b/languages/cpp/app_templates/cppcurseshello/main.cpp
new file mode 100644
index 00000000..3e23a5df
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/main.cpp
@@ -0,0 +1,49 @@
+%{CPP_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <ncurses.h>
+
+void create_box(int y, int x, int w, int h)
+{
+ mvaddch(y, x, '+');
+ mvaddch(y, x + w, '+');
+ mvaddch(y + h, x, '+');
+ mvaddch(y + h, x + w, '+');
+ mvhline(y, x + 1, '-', w - 1);
+ mvhline(y + h, x + 1, '-', w - 1);
+ mvvline(y + 1, x, '|', h - 1);
+ mvvline(y + 1, x + w, '|', h - 1);
+}
+
+int main()
+{
+ int startx, starty, height, width;
+
+ initscr();
+ start_color();
+ cbreak();
+ keypad(stdscr, TRUE);
+ noecho();
+
+ init_pair(1, COLOR_BLACK, COLOR_CYAN);
+
+ height = 2;
+ width = 30;
+ starty = (LINES - height)/2;
+ startx = (COLS - width)/2;
+
+ attron(COLOR_PAIR(1));
+
+ create_box(starty, startx, width, height);
+ mvprintw(starty, startx + 3, " Hello World! " );
+ mvprintw(starty+1,startx+1," Type any char to exit ");
+ mvprintw(0,0,"");
+ refresh();
+ getch();
+
+ endwin();
+ return 0;
+}
diff --git a/languages/cpp/app_templates/cppcurseshello/src-Makefile.am b/languages/cpp/app_templates/cppcurseshello/src-Makefile.am
new file mode 100644
index 00000000..23de27fb
--- /dev/null
+++ b/languages/cpp/app_templates/cppcurseshello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/cpp/app_templates/cpphello/.kdev_ignore b/languages/cpp/app_templates/cpphello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/.kdev_ignore
diff --git a/languages/cpp/app_templates/cpphello/Makefile.am b/languages/cpp/app_templates/cpphello/Makefile.am
new file mode 100644
index 00000000..49bd1b67
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs \
+ configure.in cpphello.png app.kdevelop
+templateName = cpphello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/cpphello/app.kdevelop b/languages/cpp/app_templates/cpphello/app.kdevelop
new file mode 100644
index 00000000..c7498e39
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/app.kdevelop
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/cpphello/configure.in b/languages/cpp/app_templates/cpphello/configure.in
new file mode 100644
index 00000000..612ce0d5
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_CPLUSPLUS
+AC_PROG_CXX
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/cpphello/cpp-Makefile.am b/languages/cpp/app_templates/cpphello/cpp-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/cpp-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs b/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/cpp-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate b/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate
new file mode 100644
index 00000000..0b5b9367
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/cpphello.kdevtemplate
@@ -0,0 +1,145 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[ca]=Simple programa Hello world
+Name[da]=Simpelt Goddag verden program
+Name[de]=Ein einfaches "Hello World"-Programm
+Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo» sencillo
+Name[et]=Lihtne "Tere, maailm" programm
+Name[eu]="Kaixo mundua" programa sinplea
+Name[fa]=برنامۀ سادۀ Hello world
+Name[fr]=Programme « Bonjour monde » simple
+Name[ga]=Ríomhchlár simplí "Hello World"
+Name[gl]=Programa sinxelo Ola mundo
+Name[hu]=Egyszerű Hello world program
+Name[it]=Semplice programma di "Hello world"
+Name[ja]=簡単な Hello world プログラム
+Name[ms]=Program Hello World mudah
+Name[nds]=En eenfach "Moin Welt"-Programm
+Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Eenvoudig 'Hello World' programma
+Name[pl]=Prosty program witaj świecie
+Name[pt]=Programa simples Olá Mundo
+Name[pt_BR]=Programa simples Olá Mundo
+Name[ru]=Простая программа Hello world
+Name[sk]=Jednoduchý "Ahoj svet" program
+Name[sl]=Preprost program Hello world
+Name[sr]=Једноставан „Здраво свете“ програм
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program
+Name[sv]=Enkelt Hello world-program
+Name[tr]=Basit Merhaba dünya programı
+Name[zh_CN]=简单的 Hello world 程序
+Name[zh_TW]=簡單的 Hello world 程式
+Icon=cpphello.png
+Category=C++
+Comment=Generates a simple Hello world program in C++
+Comment[ca]=Genera un simple programa de Hello world en C++
+Comment[da]=Genererer et simpelt Goddag verden program in C++
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C++
+Comment[es]=Genera un sencillo programa «Hola mundo» en C++
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C++ lengoaian
+Comment[fa]=یک برنامۀ سادۀ Hello world در C++ تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en C++
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C++
+Comment[gl]=Xera un programa sinxelo Ola mundo en C++
+Comment[hu]=Létrehoz egy egyszerű Hello world programot C++-ban
+Comment[it]=Genera un semplice programma di "Hello world" in C++
+Comment[ja]=簡単な Hello World プログラムを C++ で作成します
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op
+Comment[ne]=C++ मा एउटा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig Hello World-programma in C++
+Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++
+Comment[pt]=Gera um programa simples Olá Mundo em C++
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C++
+Comment[ru]=Создание простого приложения Hello world на C++
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++
+Comment[sl]=Ustvari preprost program Hello world v C++
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u
+Comment[sv]=Skapar ett enkelt Hello world-program i C++
+Comment[tr]=C++'da basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成 C++ 的 Hello world 程序
+Comment[zh_TW]=產生一個簡單的 C++ 的 Hello world 程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=cpphello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/cpp-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/cpp-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=A Simple Hello World program was created in %{dest}
+Comment[ca]=Un simple programa de Hello World ha estat creat en %{dest}
+Comment[da]=Et simpelt Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein einfaches "Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα Γεια σου Κόσμε δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa «Hola mundo» ha sido creado en %{dest}
+Comment[et]=Lihtne "Tere, maailm" programm loodi asukohta %{dest}
+Comment[eu]="Kaixo mundua" programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ Hello World در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár simplí "Hello World" i %{dest}
+Comment[gl]=Creouse un programa sinxelo Ola mundo en %{dest}
+Comment[hu]=Létrejött egy egyszerű Hello world program itt: %{dest}
+Comment[it]=È stato creato un semplice programma di "Hello World" in %{dest}
+Comment[ja]=簡単な Hello World プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm opstellt
+Comment[ne]=एउटा साधारण हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Prosty program 'Witaj świecie' został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples Olá Mundo em %{dest}
+Comment[pt_BR]=Foi criado um programa simples Olá Mundo em %{dest}
+Comment[ru]=Простое приложение Hello world на C++ создано в %{dest}
+Comment[sk]=Jednoduchý "Ahoj svet" program bol vytvorený v %{dest}
+Comment[sl]=Preprost program Hello World je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан „Здраво свете“ програм направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo svete“ program napravljen je u %{dest}
+Comment[sv]=Ett enkelt Hello world-program skapades i %{dest}
+Comment[tr]=Basit bir Merhaba Dünya programı %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了 Hello world 程序
+Comment[zh_TW]=一個簡單的 Hello World 程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/cpphello/cpphello.png b/languages/cpp/app_templates/cpphello/cpphello.png
new file mode 100644
index 00000000..519c007b
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/cpphello.png
Binary files differ
diff --git a/languages/cpp/app_templates/cpphello/main.cpp b/languages/cpp/app_templates/cpphello/main.cpp
new file mode 100644
index 00000000..f97c8417
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/main.cpp
@@ -0,0 +1,17 @@
+%{CPP_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ cout << "Hello, world!" << endl;
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/cpphello/src-Makefile.am b/languages/cpp/app_templates/cpphello/src-Makefile.am
new file mode 100644
index 00000000..23de27fb
--- /dev/null
+++ b/languages/cpp/app_templates/cpphello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/cpp/app_templates/cppsdlhello/.kdev_ignore b/languages/cpp/app_templates/cppsdlhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/.kdev_ignore
diff --git a/languages/cpp/app_templates/cppsdlhello/Makefile.am b/languages/cpp/app_templates/cppsdlhello/Makefile.am
new file mode 100644
index 00000000..e17785a4
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.cpp src-Makefile.am cpp-Makefile.am cpp-Makefile.cvs configure.in cppsdlhello.png app.kdevelop acinclude.m4
+templateName = cppsdlhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/cppsdlhello/README b/languages/cpp/app_templates/cppsdlhello/README
new file mode 100644
index 00000000..bc4e1d15
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/README
@@ -0,0 +1,11 @@
+This template configures KDevelop to be used with libSDL
+
+Got it working using this tutorial:
+http://www.geekcomix.com/snh/files/docs/sdl-kdev/sdl-kdev-mini-how2.html
+and not to forget -lSDL has to get passed to ld :)
+
+This was submitted via a whishlist:
+http://bugs.kde.org/show_bug.cgi?id=53702
+
+Thanks to: Mrten Woxberg < marwo264 (at) student.liu.se >
+For supplying this template.
diff --git a/languages/cpp/app_templates/cppsdlhello/acinclude.m4 b/languages/cpp/app_templates/cppsdlhello/acinclude.m4
new file mode 100644
index 00000000..9681a33a
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/acinclude.m4
@@ -0,0 +1,167 @@
+# Configure paths for SDLmm
+# David Hedbor, 2000-07-22
+# stolen from SDL
+# stolen from Manish Singh
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_SDLMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for SDLmm, and define SDLMM_CXXFLAGS and SDLMM_LIBS
+dnl
+AC_DEFUN(AM_PATH_SDLMM,
+[dnl
+dnl Get the cflags and libraries from the ismap-config script
+dnl
+AC_ARG_WITH(sdlmm-prefix,[ --with-sdlmm-prefix=PFX Prefix where SDLmm is installed (optional)],
+ sdlmm_prefix="$withval", sdlmm_prefix="")
+AC_ARG_WITH(sdlmm-exec-prefix,[ --with-sdlmm-exec-prefix=PFX Exec prefix where SDLmm is installed (optional)],
+ sdlmm_exec_prefix="$withval", sdlmm_exec_prefix="")
+AC_ARG_ENABLE(sdlmmtest, [ --disable-sdlmmtest Do not try to compile and run a test SDLmm program],
+ , enable_sdlmmtest=yes)
+
+ if test x$sdlmm_exec_prefix != x ; then
+ sdlmm_args="$sdlmm_args --exec-prefix=$sdlmm_exec_prefix"
+ if test x${SDLMM_CONFIG+set} != xset ; then
+ SDLMM_CONFIG=$sdlmm_exec_prefix/bin/sdlmm-config
+ fi
+ fi
+ if test x$sdlmm_prefix != x ; then
+ sdlmm_args="$sdlmm_args --prefix=$sdlmm_prefix"
+ if test x${SDLMM_CONFIG+set} != xset ; then
+ SDLMM_CONFIG=$sdlmm_prefix/bin/sdlmm-config
+ fi
+ fi
+
+ AC_PATH_PROG(SDLMM_CONFIG, sdlmm-config, no)
+ min_sdlmm_version=ifelse([$1], ,0.11.0,$1)
+ AC_MSG_CHECKING(for SDLmm version >= $min_sdlmm_version)
+ no_sdlmm=""
+ if test "$SDLMM_CONFIG" = "no" ; then
+ no_sdlmm=yes
+ else
+ SDLMM_CXXFLAGS=`$SDLMM_CONFIG $sdlmmconf_args --cflags`
+ SDLMM_LIBS=`$SDLMM_CONFIG $sdlmmconf_args --libs`
+
+ sdlmm_major_version=`$SDLMM_CONFIG $sdlmm_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ sdlmm_minor_version=`$SDLMM_CONFIG $sdlmm_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ sdlmm_micro_version=`$SDLMM_CONFIG $sdlmm_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_sdlmmtest" = "xyes" ; then
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ ac_save_LIBS="$LIBS"
+ CXXFLAGS="$CXXFLAGS $SDLMM_CXXFLAGS"
+ LIBS="$LIBS $SDLMM_LIBS"
+dnl
+dnl Now check if the installed SDLmm is sufficiently new. (Also sanity
+dnl checks the results of sdlmm-config to some extent
+dnl
+ rm -f conf.sdlmmtest
+ AC_TRY_RUN([
+#include <cstdio>
+#include <cstring>
+#include "SDLmm/sdlmm.h"
+char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = (char *)malloc ((std::strlen (str) + 1) * sizeof(char));
+ std::strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main (int argc, char *argv[])
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ /* This hangs on some systems (?)
+ system ("touch conf.sdlmmtest");
+ */
+ { FILE *fp = fopen("conf.sdlmmtest", "a"); if ( fp ) fclose(fp); }
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_sdlmm_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_sdlmm_version");
+ return 1;
+ }
+
+ if (($sdlmm_major_version > major) ||
+ (($sdlmm_major_version == major) && ($sdlmm_minor_version > minor)) ||
+ (($sdlmm_major_version == major) && ($sdlmm_minor_version == minor) && ($sdlmm_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'sdlmm-config --version' returned %d.%d.%d, but the minimum version\n", $sdlmm_major_version, $sdlmm_minor_version, $sdlmm_micro_version);
+ printf("*** of SDLmm required is %d.%d.%d. If sdlmm-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If sdlmm-config was wrong, set the environment variable SDLMM_CONFIG\n");
+ printf("*** to point to the correct copy of sdlmm-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+}
+
+],, no_sdlmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_sdlmm" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$SDLMM_CONFIG" = "no" ; then
+ echo "*** The sdlmm-config script installed by SDLmm could not be found"
+ echo "*** If SDLmm was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the SDLMM_CONFIG environment variable to the"
+ echo "*** full path to sdlmm-config."
+ else
+ if test -f conf.sdlmmtest ; then
+ :
+ else
+ echo "*** Could not run SDLmm test program, checking why..."
+ CXXFLAGS="$CXXFLAGS $SDLMM_CXXFLAGS"
+ LIBS="$LIBS $SDLMM_LIBS"
+ AC_TRY_LINK([
+#include <cstdio>
+#include "sdlmm.h"
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding SDLmm or finding the wrong"
+ echo "*** version of SDLmm. If it is not finding SDLmm, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means SDLmm was incorrectly installed"
+ echo "*** or that you have moved SDLmm since it was installed. In the latter case, you"
+ echo "*** may want to edit the sdlmm-config script: $SDLMM_CONFIG" ])
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ SDLMM_CXXFLAGS=""
+ SDLMM_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(SDLMM_CXXFLAGS)
+ AC_SUBST(SDLMM_LIBS)
+ rm -f conf.sdlmmtest
+])
diff --git a/languages/cpp/app_templates/cppsdlhello/app.kdevelop b/languages/cpp/app_templates/cppsdlhello/app.kdevelop
new file mode 100644
index 00000000..fadfbadc
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/app.kdevelop
@@ -0,0 +1,103 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>SDL</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ <configurations>
+ <default>
+ <ldflags>-lSDL</ldflags>
+ </default>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/cppsdlhello/configure.in b/languages/cpp/app_templates/cppsdlhello/configure.in
new file mode 100644
index 00000000..440c2e44
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/configure.in
@@ -0,0 +1,90 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_CPLUSPLUS
+AC_PROG_CXX
+AM_PROG_LIBTOOL
+
+dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
+dnl if-not-found, test-parameter)
+AC_DEFUN(KDE_FIND_PATH,
+[
+ AC_MSG_CHECKING([for $1])
+ if test -n "$$2"; then
+ kde_cv_path="$$2";
+ else
+ kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+ AC_CACHE_VAL(kde_cv_path_$kde_cache,
+ [
+ kde_cv_path="NONE"
+ dirs="$3"
+ kde_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$kde_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"
+ then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ else
+ kde_cv_path="$dir/$1"
+ break
+ fi
+ fi
+ done
+
+ eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+ ])
+
+ eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+ fi
+
+ if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($kde_cv_path)
+ $2=$kde_cv_path
+
+ fi
+])
+
+KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
+ AC_MSG_WARN([Could not find libsdl anywhere, check http://www.sdl.org])
+])
+
+if test -n "$LIBSDL_CONFIG"; then
+ LIBSDL_LIBS="`$LIBSDL_CONFIG --libs`"
+ LIBSDL_RPATH=
+ for args in $LIBSDL_LIBS; do
+ case $args in
+ -L*)
+ LIBSDL_RPATH="$LIBSDL_RPATH $args"
+ ;;
+ esac
+ done
+ LIBSDL_RPATH=`echo $LIBSDL_RPATH | sed -e "s/-L/-R/g"`
+ LIBSDL_CFLAGS="`$LIBSDL_CONFIG --cflags`"
+
+ AC_DEFINE_UNQUOTED(HAVE_LIBSDL, 1, [Defines if your system has the LIBSDL library])
+fi
+
+
+AC_SUBST(LIBSDL_LIBS)
+AC_SUBST(LIBSDL_CFLAGS)
+AC_SUBST(LIBSDL_RPATH)
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/cpp-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello b/languages/cpp/app_templates/cppsdlhello/cppsdlhello
new file mode 100644
index 00000000..fd64358b
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/cppsdlhello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple SDL program
+Name[fr]=Un simple programme avec SDL
+Icon=cppsdl.png
+Category=C++
+Comment=Generates a simple SDL program in C++
+Comment[fr]=Gnre un simple programme de test avec la bibliothque SDL dans le language C++.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate
new file mode 100644
index 00000000..ec4e94b3
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.kdevtemplate
@@ -0,0 +1,150 @@
+# KDE Config File
+[General]
+Name=Simple SDL program
+Name[ca]=Simple programa per a SDL
+Name[da]=Simpelt SDL-program
+Name[de]=Einfaches SDL-Programm
+Name[el]=Απλό πρόγραμμα SDL
+Name[es]=Programa SDL sencillo
+Name[et]=Lihtne SDL programm
+Name[eu]=SDL programa sinplea
+Name[fa]=برنامۀ سادۀ SDL
+Name[fr]=Programme SDL simple
+Name[ga]=Ríomhchlár simplí SDL
+Name[gl]=Programa sinxelo SDL
+Name[hu]=Egyszerű SDL-alkalmazás
+Name[it]=Semplice programma SDL
+Name[ja]=簡単な SDL プログラム
+Name[nds]=Eenfach SDL-Programm
+Name[ne]=साधारण SDL कार्यक्रम
+Name[nl]=Eenvoudig SDL-programma
+Name[pl]=Prosty program używający SDL
+Name[pt]=Programa simples do SDL
+Name[pt_BR]=Programa simples do SDL
+Name[ru]=Простое приложение SDL
+Name[sk]=Jednoduchý SDL program
+Name[sl]=Preprost program SDL
+Name[sr]=Једноставан SDL програм
+Name[sr@Latn]=Jednostavan SDL program
+Name[sv]=Enkelt SDL-program
+Name[tg]=Барноманависии SDL
+Name[tr]=Basit bir SDL Programı
+Name[zh_CN]=简单的 SDL 程序
+Name[zh_TW]=簡單的 SDL 程式
+Icon=cppsdl.png
+Category=C++
+Comment=Generates a simple SDL program in C++
+Comment[ca]=Genera un simple programa en SDL en C++
+Comment[da]=Genererer et simpelt SDL program i C++
+Comment[de]=Erstellt ein einfaches SDL-Programm in C++
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα SDL σε C++
+Comment[es]=Genera un sencillo programa SDL en C++
+Comment[et]=Lihtsa SDL programmi loomise C++-s
+Comment[eu]=SDL programa sinple bat sortzen du C++ lengoaian
+Comment[fa]=یک برنامۀ سادۀ SDL در C++ تولید می‌کند
+Comment[fr]=Génère un programme SDL simple en C++
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí SDL i C++
+Comment[gl]=Xera un programa sinxelo SDL en C++
+Comment[hu]=Létrehoz egy egyszerű SDL-alkalmazást C++-ban
+Comment[it]=Genera un semplice programma SDL in C++
+Comment[ja]=簡単な SDL プログラムを C++ で作成します
+Comment[nds]=Stellt en eenfach SDL-Programm in C++ op
+Comment[ne]= C++ मा साधारण SDL कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig SDL-programma in C++
+Comment[pl]=Generuje prosty program używający SDL w C++
+Comment[pt]=Gera um programa simples de SDL em C++
+Comment[pt_BR]=Gera um programa simples de SDL em C++
+Comment[ru]=Создание простого приложения SDL на C++
+Comment[sk]=Vygeneruje jednoduchý SDL program v C++
+Comment[sl]=Ustvari preprost program SDL v C++
+Comment[sr]=Прави једноставан SDL програм у C++-у
+Comment[sr@Latn]=Pravi jednostavan SDL program u C++-u
+Comment[sv]=Skapar ett enkelt SDL-program i C++
+Comment[tr]=C++'da basit bir SDL programı yaratır
+Comment[zh_CN]=生成 C++ 的简单 SDL 程序
+Comment[zh_TW]=產生一個簡單的 C++ SDL 程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=cppsdlhello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/cpp-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/cpp-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[FILE5]
+Type=install
+Source=%{src}/acinclude.m4
+Dest=%{dest}/acinclude.m4
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+
+[MSG]
+Type=message
+Comment=A simple SDL program was created in %{dest}
+Comment[ca]=Un simple programa en SDL ha estat creat en %{dest}
+Comment[da]=Et simpelt SDL-program blev oprettet i %{dest}
+Comment[de]=Ein einfaches SDL-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα SDL δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa SDL ha sido creado en %{dest}
+Comment[et]=Lihtne SDL programm loodi asukohta %{dest}
+Comment[eu]=SDL programa sinple bat soru da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ SDL در %{dest} ایجاد شد
+Comment[fr]=Un programme SDL simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár simplí SDL i %{dest}
+Comment[gl]=Creouse un programa sinxelo SDL en %{dest}
+Comment[hu]=Létrejött egy egyszerű SDL-alkalmazás itt: %{dest}
+Comment[it]=È stato creato un semplice programma SDL in %{dest}
+Comment[ja]=簡単な SDL プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach SDL-Programm opstellt
+Comment[ne]=एउटा साधारण SDL कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig SDL-programma is aangemaakt in %{dest}
+Comment[pl]=Prosty program używający SDL został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação simples em SDL em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação simples em SDL em %{dest}
+Comment[ru]=Простое приложение SDL создано в %{dest}
+Comment[sk]=Jednoduchý SDL program bol vytvorený v %{dest}
+Comment[sl]=Preprost program SDL je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан SDL програм направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan SDL program napravljen je u %{dest}
+Comment[sv]=Ett enkelt SDL-program skapades i %{dest}
+Comment[tr]=Basit bir SDL programı %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了简单的 SDL 程序
+Comment[zh_TW]=一個簡單的 SDL 程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/cppsdlhello.png
Binary files differ
diff --git a/languages/cpp/app_templates/cppsdlhello/main.cpp b/languages/cpp/app_templates/cppsdlhello/main.cpp
new file mode 100644
index 00000000..89e3ba30
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/main.cpp
@@ -0,0 +1,29 @@
+%{CPP_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <stdlib.h>
+#include "SDL.h"
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ cout <<"Initializing SDL." << endl;
+ /* Initializes Audio and the CDROM, add SDL_INIT_VIDEO for Video */
+ if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_CDROM)< 0) {
+ cout <<"Could not initialize SDL:" << SDL_GetError() << endl;
+ SDL_Quit();
+ } else {
+ cout << "Audio & CDROM initialized correctly" << endl;;
+ /* Trying to read number of CD devices on system */
+ cout << "Drives available :" << SDL_CDNumDrives() << endl;
+ for(int i=0; i < SDL_CDNumDrives(); ++i) {
+ cout << "Drive " << i << "\"" << SDL_CDName(i) << "\"";
+ }
+ }
+ SDL_Quit();
+}
diff --git a/languages/cpp/app_templates/cppsdlhello/src-Makefile.am b/languages/cpp/app_templates/cppsdlhello/src-Makefile.am
new file mode 100644
index 00000000..3f9fd8bf
--- /dev/null
+++ b/languages/cpp/app_templates/cppsdlhello/src-Makefile.am
@@ -0,0 +1,9 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# set the include path found by configure
+AM_CPPFLAGS = $(LIBSDL_CFLAGS) $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(LIBSDL_RPATH)
+%{APPNAMELC}_LDADD = $(LIBSDL_LIBS)
diff --git a/languages/cpp/app_templates/dcopservice/.kdev_ignore b/languages/cpp/app_templates/dcopservice/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/.kdev_ignore
diff --git a/languages/cpp/app_templates/dcopservice/Makefile.am b/languages/cpp/app_templates/dcopservice/Makefile.am
new file mode 100644
index 00000000..00875115
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = dcopservice.desktop dcopservice.png dcopservice.h \
+ src-Makefile.am main.cpp dcopservice.cpp dcopservice.kdevelop \
+ subdirs
+templateName = dcopservice
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice b/languages/cpp/app_templates/dcopservice/dcopservice
new file mode 100644
index 00000000..ff62f5ab
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=KDE DCOP Service
+Name[fr]=Un service DCOP pour KDE
+Icon=kdcop.png
+Category=C++/KDE
+Comment=Generates a framework for a KDE dcop service and client access library.
+Comment[fr]=Gnre un squelette de programme pour la gestion d'un service DCOP pour KDE et un programme d'accs au bibliothque.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.cpp b/languages/cpp/app_templates/dcopservice/dcopservice.cpp
new file mode 100644
index 00000000..a23da01b
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.cpp
@@ -0,0 +1,49 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kdebug.h>
+#include <kapplication.h>
+
+%{APPNAME}::%{APPNAME}() : DCOPObject("serviceInterface")
+{
+ kdDebug() << "Starting new service... " << endl;
+ m_List = QStringList();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+ kdDebug() << "Going away... " << endl;
+}
+
+QString %{APPNAME}::string(int idx)
+{
+ return *m_List.at(idx);
+}
+
+QStringList %{APPNAME}::list()
+{
+ return m_List;
+}
+
+void %{APPNAME}::add(QString arg)
+{
+ kdDebug() << "Adding " << arg << " to the list" << endl;
+ m_List << arg;
+}
+
+bool %{APPNAME}::remove(QString arg)
+{
+ QStringList::Iterator it = m_List.find(arg);
+ if (it != m_List.end())
+ {
+ m_List.remove(it);
+ }
+ else
+ return false;
+ return true;
+}
+
+bool %{APPNAME}::exit()
+{
+ kapp->quit();
+}
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.desktop b/languages/cpp/app_templates/dcopservice/dcopservice.desktop
new file mode 100644
index 00000000..2ee5220f
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Type=Service
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+X-DCOP-ServiceType=Unique
+X-KDE-StartupNotify=false
+Comment=Template for dcop services
+Comment[br]=Patrom evit servijoù dcop
+Comment[ca]=Plantilla per als serveis dcop
+Comment[cy]=Patrymlun ar gyfer gwasanaethau dcop
+Comment[da]=Skabelon for DCOP-tjenester
+Comment[de]=Vorlage für DCOP-Dienste
+Comment[el]=Πρότυπο για υπηρεσίες dcop
+Comment[es]=Plantilla para servicios DCOP
+Comment[et]=DCOP-teenuste mall
+Comment[eu]=DCOP zerbitzuentzako plantilla
+Comment[fa]=قالب برای خدمات dcop
+Comment[fr]=Modèle pour les services DCOP
+Comment[ga]=Teimpléad i gcomhair seirbhísí DCOP
+Comment[gl]=Modelo para servizos dcop
+Comment[hi]=डीसीओपी सेवाओं के लिए टेम्प्लेट
+Comment[hu]=Sablon DCOP-szolgáltatásokhoz
+Comment[is]=Snið fyrir dcop þjónustur
+Comment[it]=Modello per servizi dcop
+Comment[ja]=dcop サービスのためのテンプレート
+Comment[nds]=Vörlaag för DCOP-Deensten
+Comment[ne]=dcop सेवाका लागि टेम्प्लेट
+Comment[nl]=Sjabloon voor DCOP-services
+Comment[pl]=Szablon dla usług dcop
+Comment[pt]=Modelo para serviços dcop
+Comment[pt_BR]=Modelo para serviços dcop
+Comment[ru]=Шаблон для сервисов DCOP
+Comment[sk]=Šablóna pre DCOP služby
+Comment[sl]=Predloga za storitve DCOP
+Comment[sr]=Шаблон за dcop сервисе
+Comment[sr@Latn]=Šablon za dcop servise
+Comment[sv]=Mall för DCOP-tjänster
+Comment[ta]=டிகாப்சேவைக்கான மாதரி உரு
+Comment[tg]=Қолиб барои хидмадгори DCOP
+Comment[tr]=dcop hizmetleri için şablon
+Comment[zh_CN]=dcop 服务模板
+Comment[zh_TW]=DCOP 服務樣本
+
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.h b/languages/cpp/app_templates/dcopservice/dcopservice.h
new file mode 100644
index 00000000..4e9eda87
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.h
@@ -0,0 +1,35 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAME}_H
+#define _%{APPNAME}_H
+
+#include <qstringlist.h>
+#include <qstring.h>
+#include <dcopobject.h>
+
+class %{APPNAME} : public DCOPObject
+{
+ K_DCOP
+
+ private:
+ QStringList m_List;
+
+ public:
+ %{APPNAME}();
+
+ ~%{APPNAME}();
+
+ k_dcop:
+ QString string(int);
+
+ QStringList list();
+
+ void add(QString);
+
+ bool remove(QString);
+
+ bool exit();
+
+
+};
+#endif
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop b/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop
new file mode 100644
index 00000000..22681e00
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.kdevelop
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>kioslave</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevautoproject>
+ <general>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate b/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate
new file mode 100644
index 00000000..dd950d6d
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.kdevtemplate
@@ -0,0 +1,202 @@
+# KDE Config File
+[General]
+Name=KDE DCOP Service
+Name[br]=Servij DCOP KDE
+Name[ca]=Servei DCOP per al KDE
+Name[da]=KDE DCOP-service
+Name[de]=KDE-DCOP-Dienst
+Name[el]=Υπηρεσία KDE DCOP
+Name[es]=Servicio DCOP de KDE
+Name[et]=KDE DCOP-teenus
+Name[eu]=KDE-ren DCOP zerbitzua
+Name[fa]=خدمت KDE DCOP
+Name[fr]=Service DCOP KDE
+Name[ga]=Seirbhís DCOP KDE
+Name[gl]=Servicio DCOP de KDE
+Name[hu]=KDE DCOP-szolgáltatás
+Name[it]=Servizio DCOP di KDE
+Name[ja]=KDE DCOP サービス
+Name[nds]=KDE-DCOP-Deenst
+Name[ne]=KDE DCOP सेवा
+Name[nl]=KDE DCOP-service
+Name[pl]=Usługa KDE DCOP
+Name[pt]=Serviço de DCOP do KDE
+Name[pt_BR]=Serviço de DCOP do KDE
+Name[ru]=Сервис DCOP
+Name[sk]=KDE DCOP služba
+Name[sl]=Storitev DCOP za KDE
+Name[sr]=KDE DCOP сервис
+Name[sr@Latn]=KDE DCOP servis
+Name[sv]=KDE:s DCOP-tjänst
+Name[tg]=Хизмати KDE DCOP
+Name[tr]=KDE DCOP Hizmeti
+Name[zh_CN]=KDE DCOP 服务
+Name[zh_TW]=KDE DCOP 服務
+Icon=kdcop.png
+Category=C++/KDE
+Comment=Generates a framework for a KDE DCOP service and client access library.
+Comment[ca]=Genera una infraestructura per a un servei DCOP de KDE i la biblioteca d'accés del client.
+Comment[da]=Genererer et skelet for en KDE dcop-tjeneste og klientadgangsbibliotek.
+Comment[de]=Erstellt das Grundgerüst für einen KDE-DCOP-Dienst und eine Bibliothek für den Client-Zugriff.
+Comment[el]=Δημιουργεί ένα πλαίσιο για μια υπηρεσία KDE DCOP και μια βιβλιοθήκη πρόσβασης πελάτη.
+Comment[es]=Genera una infraestructura para un servicio DCOP de KDE y una biblioteca de acceso cliente.
+Comment[et]=KDE DCOP-teenuse raamistiku ja kliendi ligipääsu teegi loomine.
+Comment[eu]=KDE-ren DCOP zerbitzu baterako lan-marko bat eta bezero liburutegi bat sortzen ditu.
+Comment[fa]=چارچوبی برای خدمت KDE DCOP و کتابخانۀ دستیابی کارخواه تولید می‌کند.
+Comment[fr]=Génère une infrastructure pour un service DCOP KDE et une bibliothèque d'accès client.
+Comment[ga]=Cruthaigh creatlach do sheirbhís DCOP KDE agus leabharlann rochtana cliaint.
+Comment[gl]=Xera un contorno de traballo para un servizo DCOP de KDE e unha biblioteca de acceso para clientes.
+Comment[hu]=Létrehoz egy alap KDE DCOP-szolgáltatást és klienselérési programkönyvtárat.
+Comment[it]=Genera l'infrastruttura per un servizio DCOP di KDE e una libreria per l'accesso da client.
+Comment[ja]=KDE DCOP サービスとクライアントアクセスライブラリのためのフレームワークを作成します
+Comment[nds]=Stellt en Rahmenwark för en KDE-DCOP-Deenst un en Clienttogriep-Bibliotheek op.
+Comment[ne]=KDE DCOP सेवा र ग्राहक पहुँच लाइब्रेरीका लागि फ्रेमवर्क उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een framework voor een KDE DCOP-service- en client-bibliotheek.
+Comment[pl]=Generuje schemat dla usługi KDE DCOP i biblioteki dostępu użytkownika.
+Comment[pt]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes.
+Comment[pt_BR]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes.
+Comment[ru]=Создание сервиса DCOP и библиотеки клиента.
+Comment[sk]=Vygeneruje framework pre KDE DCOP službu a klientskú prístupovú knižnicu.
+Comment[sr]=Прави једноставан радни оквир за KDE DCOP сервис и приступну библиотеку клијента.
+Comment[sr@Latn]=Pravi jednostavan radni okvir za KDE DCOP servis i pristupnu biblioteku klijenta.
+Comment[sv]=Skapar ett ramverk för en KDE DCOP-tjänst och klientåtkomstbibliotek.
+Comment[tr]=Bir KDE DCOP hizmeti ve istemci erişim kütüphanesi için bir çatı yaratır.
+Comment[zh_CN]=生成一个 KDE DCOP 服务和客户访问库的框架。
+Comment[zh_TW]=產生一個 KDE DCOP 服務的架構,以及客戶端存取的函式庫。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=dcopservice.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/dcopservice.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/dcopservice.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/dcopservice.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/dcopservice.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE15]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[MSG]
+Type=message
+Comment=A KDE DCOP Service was created in %{dest}
+Comment[ca]=Un servei DCOP de KDE ha estat creada en %{dest}
+Comment[da]=En KDE DCOP tjeneste blev oprettet i %{dest}
+Comment[de]=Ein KDE-DCOP-Dienst wurde in %{dest} erstellt.
+Comment[el]=Μια υπηρεσία KDE DCOP δημιουργήθηκε στο %{dest}
+Comment[es]=Un servicio DCOP de KDE ha sido creado en %{dest}
+Comment[et]=KDE DCOP-teenus loodi asukohta %{dest}
+Comment[eu]=KDE-ren DCOP zerbitzu bat sortu da hemen: %{dest}
+Comment[fa]=یک خدمت KDE DCOP در %{dest} ایجاد شد
+Comment[fr]=Un service DCOP KDE a été créé dans %{dest}
+Comment[ga]=Cruthaíodh Seirbhís DCOP KDE i %{dest}
+Comment[gl]=Creouse un servizo DCOP de KDE en %{dest}
+Comment[hu]=Létrejött egy KDE DCOP-szolgáltatás itt: %{dest}
+Comment[it]=È stato creato un servizio DCOP di KDE in %{dest}
+Comment[ja]=KDE DCOP サービスを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-DCOP-Deenst opstellt
+Comment[ne]=KDE DCOP सेवा %{dest} मा सिर्जना गरियो
+Comment[nl]=Een DCOP-service is aangemaakt in %{dest}
+Comment[pl]=Usługa KDE DCOP została utworzona w %{dest}
+Comment[pt]=Foi criado um serviço de DCOP do KDE em %{dest}
+Comment[pt_BR]=Foi criado um serviço de DCOP do KDE em %{dest}
+Comment[ru]=Сервис DCOP создан в %{dest}
+Comment[sk]=KDE DCOP služba bola vytvorená v %{dest}
+Comment[sl]=Storitev DCOP za KDE je bila ustvarjena v %{dest}
+Comment[sr]=KDE DCOP сервис направљен је у %{dest}
+Comment[sr@Latn]=KDE DCOP servis napravljen je u %{dest}
+Comment[sv]=En KDE DCOP-tjänst skapades i %{dest}
+Comment[tr]=Bir KDE DCOP Hizmeti %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KDE DCOP 服务
+Comment[zh_TW]=KDE DCOP 服務已建立於 %{dest}
diff --git a/languages/cpp/app_templates/dcopservice/dcopservice.png b/languages/cpp/app_templates/dcopservice/dcopservice.png
new file mode 100644
index 00000000..2cb4f1f3
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/dcopservice.png
Binary files differ
diff --git a/languages/cpp/app_templates/dcopservice/main.cpp b/languages/cpp/app_templates/dcopservice/main.cpp
new file mode 100644
index 00000000..55509560
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/main.cpp
@@ -0,0 +1,47 @@
+%{CPP_TEMPLATE}
+
+#include <kuniqueapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <dcopclient.h>
+#include "%{APPNAMELC}.h"
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "0.1";
+
+static KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+};
+
+int main (int argc, char *argv[])
+{
+ KLocale::setMainCatalogue("kdelibs");
+ KAboutData aboutdata("%{APPNAMELC}", I18N_NOOP("KDE"),
+ version, description,
+ KAboutData::License_GPL, "(C) %{YEAR}, %{AUTHOR}");
+ aboutdata.addAuthor("%{AUTHOR}",I18N_NOOP("Developer"),"%{EMAIL}");
+
+ KCmdLineArgs::init( argc, argv, &aboutdata );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KUniqueApplication::addCmdLineOptions();
+
+ if (!KUniqueApplication::start())
+ {
+ kdDebug() << "%{APPNAMELC} is already running!" << endl;
+ return (0);
+ }
+
+ KUniqueApplication app;
+ kdDebug() << "starting %{APPNAMELC} " << endl;
+ // This app is started automatically, no need for session management
+ app.disableSessionManagement();
+ %{APPNAME} *service = new %{APPNAME};
+ kdDebug() << "starting %{APPNAMELC} " << endl;
+ return app.exec();
+
+}
diff --git a/languages/cpp/app_templates/dcopservice/src-Makefile.am b/languages/cpp/app_templates/dcopservice/src-Makefile.am
new file mode 100644
index 00000000..63b5b8ed
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/src-Makefile.am
@@ -0,0 +1,17 @@
+bin_PROGRAMS = %{APPNAMELC}
+INCLUDES = $(all_includes)
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+%{APPNAMELC}_LDADD = $(LIB_KIO)
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}.skel
+
+
+noinst_HEADERS = %{APPNAMELC}.h
+
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+
+service_DATA = %{APPNAMELC}.desktop
+servicedir = $(kde_servicesdir)
diff --git a/languages/cpp/app_templates/dcopservice/subdirs b/languages/cpp/app_templates/dcopservice/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/dcopservice/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/generichello/.kdev_ignore b/languages/cpp/app_templates/generichello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/.kdev_ignore
diff --git a/languages/cpp/app_templates/generichello/Makefile.am b/languages/cpp/app_templates/generichello/Makefile.am
new file mode 100644
index 00000000..b558eecd
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = main.cpp cpphello.png app.kdevelop app.prj
+templateName = cppgenerichello
+
+# BELOW is not the GENERIC Template-Template;
+# png-filename differs from archive file name
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz cpphello.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/generichello/app.kdevelop b/languages/cpp/app_templates/generichello/app.kdevelop
new file mode 100644
index 00000000..c0b6cc1e
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/app.kdevelop
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevGenericProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevgenericproject>
+ <backend>ShellScript</backend>
+ <project>%{APPNAMELC}.prj</project>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevgenericproject>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/generichello/app.prj b/languages/cpp/app_templates/generichello/app.prj
new file mode 100644
index 00000000..a1eeca82
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/app.prj
@@ -0,0 +1,8 @@
+<kdevproject>
+ <group name = "src">
+ <target name = "cpphello">
+ <file name = "%{APPNAMELC}.cpp"/>
+ <attribute name = "buildscript">gcc -o %{APPNAMELC} %{APPNAMELC}.cpp</attribute>
+ </target>
+ </group>
+</kdevproject>
diff --git a/languages/cpp/app_templates/generichello/cpphello.png b/languages/cpp/app_templates/generichello/cpphello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/cpphello.png
Binary files differ
diff --git a/languages/cpp/app_templates/generichello/generichello.kdevtemplate b/languages/cpp/app_templates/generichello/generichello.kdevtemplate
new file mode 100644
index 00000000..787140ff
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/generichello.kdevtemplate
@@ -0,0 +1,92 @@
+# KDE Config File
+[General]
+Name=C++ program (shell script build system)
+Name[ca]=Programa C++ (sistema de construcció basat en scripts de shell)
+Name[da]=C++ program (skalscript byggesystem)
+Name[de]=C++-Programm (Shell-Skript basiertes Erstellungssystem)
+Name[el]=Πρόγραμμα C++ (σύστημα κατασκευής σενάριο κελύφους)
+Name[es]=Programa en C++ (con sistema de construcción basado en guión de órdenes)
+Name[et]=C++ programm (shelliskripti ehitussüsteem)
+Name[eu]=C++ programa (shell script-en bidez eraikia)
+Name[fa]=برنامۀ ++C )سیستم ساخت دست‌نوشتۀ پوسته(
+Name[fr]=Programme C++ (système de construction en script shell)
+Name[ga]=Ríomhchlár C++ (córas tógála bunaithe ar scripteanna blaoisce
+Name[gl]=Programa C++ (sistema de compilación shell script)
+Name[hu]=C++-program (parancssoros fordítási szkripttel)
+Name[it]=Programma C++ (sistema di compilazione con script di shell)
+Name[ja]=C++ プログラム (シェルスクリプトベースのビルドシステム)
+Name[nds]=C++-Programm (Konsoolskript-Opstellsystem)
+Name[ne]=C++ कार्यक्रम (शेल स्क्रिप्ट निर्माण प्रणाली)
+Name[nl]=C++-programma (shellscript build system)
+Name[pl]=Program w C++ (system budowania za pomocą skryptów powłoki)
+Name[pt]=Programa em C++ (sistema de compilação em 'shell script')
+Name[pt_BR]=Programa em C++ (sistema de compilação em 'shell script')
+Name[ru]=Приложение C++ (сборка на скриптах командной оболочки)
+Name[sk]=C++ program (shell skript build system)
+Name[sl]=Program v C++ (sistem grajenja lupinskega skripta)
+Name[sr]=C++ програм (скрипта шкољке као систем за градњу)
+Name[sr@Latn]=C++ program (skripta školjke kao sistem za gradnju)
+Name[sv]=C++ program (skalskript byggsystem)
+Name[tr]=C++ programı (kabuk betiği kurulum sistemi)
+Name[zh_CN]=C++ 程序(Shell 脚本创建系统)
+Name[zh_TW]=C++ 程式(shell 文稿建立系統)
+Icon=cpphello.png
+Category=C++/Generic
+Comment=Generates a simple Hello world program in C++
+Comment[ca]=Genera un simple programa de Hello world en C++
+Comment[da]=Genererer et simpelt Goddag verden program in C++
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε C++
+Comment[es]=Genera un sencillo programa «Hola mundo» en C++
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du C++ lengoaian
+Comment[fa]=یک برنامۀ سادۀ Hello world در C++ تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en C++
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello World" i C++
+Comment[gl]=Xera un programa sinxelo Ola mundo en C++
+Comment[hu]=Létrehoz egy egyszerű Hello world programot C++-ban
+Comment[it]=Genera un semplice programma di "Hello world" in C++
+Comment[ja]=簡単な Hello World プログラムを C++ で作成します
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in C++ op
+Comment[ne]=C++ मा एउटा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig Hello World-programma in C++
+Comment[pl]=Generuje prosty program 'Witaj świecie' w języku C++
+Comment[pt]=Gera um programa simples Olá Mundo em C++
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C++
+Comment[ru]=Создание простого приложения Hello world на C++
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v C++
+Comment[sl]=Ustvari preprost program Hello world v C++
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u
+Comment[sv]=Skapar ett enkelt Hello world-program i C++
+Comment[tr]=C++'da basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成 C++ 的 Hello world 程序
+Comment[zh_TW]=產生一個簡單的 C++ 的 Hello world 程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=generichello.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.prj
+Dest=%{dest}/%{APPNAMELC}.prj
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
diff --git a/languages/cpp/app_templates/generichello/main.cpp b/languages/cpp/app_templates/generichello/main.cpp
new file mode 100644
index 00000000..f97c8417
--- /dev/null
+++ b/languages/cpp/app_templates/generichello/main.cpp
@@ -0,0 +1,17 @@
+%{CPP_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ cout << "Hello, world!" << endl;
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/gnome2mmapp/.kdev_ignore b/languages/cpp/app_templates/gnome2mmapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/gnome2mmapp/Makefile.am b/languages/cpp/app_templates/gnome2mmapp/Makefile.am
new file mode 100644
index 00000000..f86ae76c
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = acconfig.h autogen.sh gnome2mm.glade main_window.cc \
+ main_window_glade.hh Makefile.am app-Makefile.am \
+ configure.in gnome2mm.gladep main_window.hh \
+ app.kdevelop gnome2mm.cc gnome2mmapp main_window_glade.cc\
+ src-Makefile.am config.h gnome2mmapp.png
+
+templateName = gnome2mmapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/gnome2mmapp/acconfig.h b/languages/cpp/app_templates/gnome2mmapp/acconfig.h
new file mode 100644
index 00000000..c7231ddc
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/acconfig.h
@@ -0,0 +1,23 @@
+// generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none)
+// using glademm V2.0.0
+
+/* acconfig.h
+ * This file is in the public domain.
+ *
+ * Descriptive text for the C preprocessor macros that
+ * the distributed Autoconf macros can define.
+ * These entries are sometimes used by macros
+ * which glade-- uses.
+ */
+#undef PACKAGE
+#undef VERSION
+#undef ENABLE_NLS
+#undef HAVE_CATGETS
+#undef HAVE_GETTEXT
+#undef HAVE_LC_MESSAGES
+#undef HAVE_STPCPY
+#undef HAVE_LIBSM
+#undef PACKAGE_LOCALE_DIR
+#undef GETTEXT_PACKAGE
+#undef PACKAGE_DATA_DIR
+#undef PACKAGE_SOURCE_DIR
diff --git a/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am b/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am
new file mode 100644
index 00000000..1d95370d
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/app-Makefile.am
@@ -0,0 +1,4 @@
+
+SUBDIRS = src
+
+EXTRA_DIST = AUTHORS TODO README configure
diff --git a/languages/cpp/app_templates/gnome2mmapp/app.kdevelop b/languages/cpp/app_templates/gnome2mmapp/app.kdevelop
new file mode 100644
index 00000000..8ccf488a
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/app.kdevelop
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>GNOME</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O2 -g0</cflags>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O0 -g3</cflags>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.h" name="Sources" />
+ <group pattern="*.glade" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/gnome2mmapp/autogen.sh b/languages/cpp/app_templates/gnome2mmapp/autogen.sh
new file mode 100755
index 00000000..30e9875b
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/autogen.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none)
+# using glademm V2.0.0
+# I didn't want to put a copy of 'macros' in every generated package
+# so I try to find them at autogen.sh time and copy them here.
+# (Normally if you have access to a cvs repository a copy of macros is
+# put into your directory at checkout time. E.g. cvs.gnome.org/gnome-common)
+if [ ! -e macros ]
+then
+ GLADE_MACROS=`which glade | sed -e 's-bin/glade-share/glade-'`
+ if [ -r $GLADE_MACROS/gnome/gnome.m4 ]
+ then
+ if cp --dereference /dev/null /dev/zero
+ then
+ cp -r --dereference $GLADE_MACROS/gnome macros
+ else
+ cp -r $GLADE_MACROS/gnome macros
+ fi
+ else
+ echo "I can't find glade's gnome m4 macros. Please copy them to ./macros and retry."
+ exit 2
+ fi
+fi
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="%{APPNAMELC}"
+
+(test -f $srcdir/configure.in \
+## put other tests here
+) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+export ACLOCAL_FLAGS="-I `pwd`/macros $ACLOCAL_FLAGS"
+. $srcdir/macros/autogen.sh
diff --git a/languages/cpp/app_templates/gnome2mmapp/config.h b/languages/cpp/app_templates/gnome2mmapp/config.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/config.h
diff --git a/languages/cpp/app_templates/gnome2mmapp/configure.in b/languages/cpp/app_templates/gnome2mmapp/configure.in
new file mode 100644
index 00000000..d25f4fbd
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/configure.in
@@ -0,0 +1,57 @@
+# generated 2004/4/12 12:12:12 EDT by amp8165@localhost.(none)
+# using glademm V2.0.0
+
+AC_INIT(configure.in)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AM_CONFIG_HEADER(config.h)
+
+dnl Pick up the Gnome macros.
+AM_ACLOCAL_INCLUDE(macros)
+AM_MAINTAINER_MODE
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_CXXCPP
+AM_PROG_LIBTOOL
+
+# GNOME--:
+# (These macros are in the 'macros' directory)
+# GNOME_INIT sets the GNOME_CONFIG variable, among other things:
+GNOME_INIT
+GNOME_COMMON_INIT
+GNOME_COMPILE_WARNINGS
+dnl *************************************************
+dnl gettext support
+dnl *************************************************
+
+GETTEXT_PACKAGE=gnome2mm
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
+
+dnl Add the languages which your application supports here.
+ALL_LINGUAS=""
+AM_GLIB_GNU_GETTEXT
+
+dnl Set PACKAGE_LOCALE_DIR in config.h.
+if test "x${prefix}" = "xNONE"; then
+ AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
+else
+ AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
+fi
+
+AC_LANG_CPLUSPLUS
+
+AM_PATH_GNOMEMM(1.2.2,, AC_MSG_ERROR(Cannot find a matching GNOME-- library: Please install version 1.2.2 or newer))
+
+# GNOME-CONFIG script knows about gnomemm:
+# ('gnome-config' is installed by GNOME)
+#GNOMEMM_CFLAGS="`$GNOME_CONFIG --cflags gnomemm gnomeui`"
+#GNOMEMM_LIBS="`$GNOME_CONFIG --libs gnomemm gnomeui`"
+#AC_SUBST(GNOMEMM_CFLAGS)
+#AC_SUBST(GNOMEMM_LIBS)
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc
new file mode 100644
index 00000000..8a33b9ff
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.cc
@@ -0,0 +1,22 @@
+%{CC_TEMPLATE}
+
+#include <config.h>
+#include <gnome--/main.h>
+#include <libgnome/gnome-i18n.h>
+
+#include "main_window.hh"
+
+int main(int argc, char **argv)
+{
+#if defined(ENABLE_NLS)
+ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+ textdomain (GETTEXT_PACKAGE);
+#endif //ENABLE_NLS
+
+ Gnome::Main m(PACKAGE, VERSION, argc, argv);
+
+ main_window *main_window = new class main_window();
+ m.run();
+ delete main_window;
+ return 0;
+}
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade
new file mode 100644
index 00000000..4c0370aa
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.glade
@@ -0,0 +1,24 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+<requires lib="gnome"/>
+
+<widget class="GtkWindow" id="main_window">
+ <property agent="glademm" name="cxx_separate_class">True</property>
+ <property agent="glademm" name="cxx_visibility">public</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">%{APPNAME} Project</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <signal name="delete_event" handler="quit"/>
+
+ <child>
+ <placeholder/>
+ </child>
+</widget>
+
+</glade-interface>
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep
new file mode 100644
index 00000000..b7da0659
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mm.gladep
@@ -0,0 +1,8 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+ <name>Gnome2mm</name>
+ <program_name>gnome2mm</program_name>
+ <language>C++</language>
+</glade-project>
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp
new file mode 100644
index 00000000..8593bc68
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Name=GNOME-- Application framework
+Category=C++/GTK+
+Icon=gnome2mmapp.png
+Comment=Generates a simple GNOME-- application. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required.
+FileTemplates=hh,CStyle,cc,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate
new file mode 100644
index 00000000..ec101c69
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.kdevtemplate
@@ -0,0 +1,186 @@
+# KDE Config File
+[General]
+Name=GNOME-- Application framework
+Name[ca]=Infraestructura d'aplicació per a GNOME
+Name[da]=GNOME-- Programskelet
+Name[de]="GNOME--"-Anwendungsgrundgerüst
+Name[el]=GNOME-- Πλαίσιο εφαρμογής
+Name[es]=Infraestructura para aplicación GNOME--
+Name[et]=GNOME-- rakenduse raamistik
+Name[eu]=GNOME-- Aplikazioen lan-markoa
+Name[fa]=چارچوب کاربرد GNOME--
+Name[fr]=Infrastructure d'application GNOME--
+Name[ga]=Creatlach feidhmchláir GNOME--
+Name[gl]=Entorno de traballo para aplicación GNOME
+Name[hu]=GNOME - Alkalmazás-keretrendszer
+Name[it]=Infrastruttura per applicazioni GNOME--
+Name[ja]=GNOME-- アプリケーションフレームワーク
+Name[nds]=Programmrahmenwark för "GNOME--"
+Name[ne]=GNOME-- अनुप्रयोग फ्रेमवर्क
+Name[nl]=GNOME-- Applicationframework
+Name[pl]=GNOME-- Szablon programu
+Name[pt]=Plataforma de aplicações GNOME--
+Name[pt_BR]=Plataforma de aplicações GNOME--
+Name[ru]=Приложение GNOME--
+Name[sk]=GNOME-- aplikačný framework
+Name[sl]=Ogrodje programa za GNOME--
+Name[sr]=Радни оквир GNOME-- програма
+Name[sr@Latn]=Radni okvir GNOME-- programa
+Name[sv]=GNOME-- programramverk
+Name[tr]=GNOME-- Uygulama Çatısı
+Name[zh_CN]=GNOME-- 应用程序框架
+Name[zh_TW]=GNOME-- 應用程式框架
+Category=C++/GTK+
+Icon=gnome2mmapp.png
+Comment=Generates a simple GNOME-- application. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required.
+Comment[ca]=Genera una simple aplicació GNOME. Gnomemm, Gtkmm >= 1.2.8 i < 1.3.0 haurien d'estar instal·lats. Per editar el fitxer glade es requereix (http://home.wtal.de/petig/Gtk/).
+Comment[da]=Genererer et simpelt GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 og < 1.3.0 skal være installeret. For at redigere glade file glade-- kræves (http://home.wtal.de/petig/Gtk/).
+Comment[de]=Erstellt eine einfache GNOME-Anwendung. Gnomemm, Gtkmm >= 1.2.8 und < 1.3.0 sollten installiert sein. Zum Bearbeiten der glade-Datei ist glade-- (http://home.wtal.de/petig/Gtk/) erforderlich.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή GNOME. Τα Gnomemm, Gtkmm >= 1.2.8 και < 1.3.0 πρέπει να είναι εγκατεστημένα. Για την επεξεργασία του αρχείου glade απαιτείται το glade (http://home.wtal.de/petig/Gtk/).
+Comment[es]=Genera una sencilla aplicación GNOME--. Debe tener instalados Gnomemm, Gtkmm >= 1.2.8 y < 1.3.0. Para editar archivos glade se necesita glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[et]=Lihtsa GNOME-- rakenduse loomine. Paigaldatud peavad olema Gnomemm, Gtkmm >= 1.2.8 ja < 1.3.0. Glade-faili redigeerimiseks on vajalik glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[eu]=GNOME-- applicazio sinple bat sortzen du. Gnomemm, Gtkmm >= 1.2.8 and < 1.3.0 instalatu behar dira. Glade fitxategia editatzeko glade-- (http://home.wtal.de/petig/Gtk/) behar da.
+Comment[fa]=یک کاربرد سادۀ GNOME-- تولید می‌کند. Gnomemm، Gtkmm >= ۱.۲.۸ و < ۱.۳.۰ باید نصب شده باشد. برای ویرایش پروندۀ glade، glade-- (http://home.wtal.de/petig/Gtk/) نیاز است.
+Comment[fr]=Génère une application GNOME-- simple. Gnomemm et Gtkmm >= 1.2.8 et < 1.3.0 devront être installés. Pour modifier le fichier glade, glade-- (http://home.wtal.de/petig/Gtk/) est requis.
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí GNOME--. Ba chóir Gnomemm, Gtkmm >= 1.2.8 agus < 1.3.0 a bheith suiteáilte. Chun comhad glade a chur in eagar, tá glade-- (http://home.wtal.de/petig/Gtk/) de dhíth ort.
+Comment[gl]=Xera una aplicación sinxela GNOME. Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0 deben estar instalados. Para editar un arquivo glade é necesario glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[hu]=Létrehoz egy egyszerű GNOME--os -alkalmazást. A Gnomemm, a Gtkmm (>= 1.2.8 és < 1.3.0) szükséges hozzá. Glade-fájl szerkesztéséhez a glade-- (http://home.wtal.de/petig/Gtk/) is szükséges.
+Comment[it]=Genera una semplice applicazione GNOME--. Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0 dovrebbero essere installati. Si richiede glade per modificare i file di glade -- (http://home.wtal.de/petig/Gtk/).
+Comment[ja]=簡単な GNOME-- アプリケーションを作成します。Gnomemm, Gtkmm >= 1.2.8 かつ < 1.3.0 が必要です。glade ファイルを編集するには glade-- (http://home.wtal.de/petig/Gtk/) が必要です。
+Comment[nds]=Stellt en eenfach "GNOME--"-Programm op. "Gnomemm", "Gtkmm" >= 1.2.8 un < 1.3.0 schöölt installeert wesen. För't Bewerken vun de glade-Datei deit "glade--" (http://home.wtal.de/petig/Gtk/) noot.
+Comment[ne]=साधारण जिनोम-- अनुप्रयोग उत्पन्न गर्दछ । Gnomemm, Gtkmm >= 1.2.8 र < 1.3.0 स्थापना गर्नु पर्दछ । ग्लेड फाइल सम्पादन गर्नका लागि ग्लेड-- (http://home.wtal.de/petig/Gtk/) आवश्यक पर्दछ ।
+Comment[nl]=Genereert een eenvoudige GNOME-- toepassing. Gnomemm, Gtkmm >= 1.2.8 en < 1.3.0 dienen te zijn geïnstalleerd. Voor het bewerken van glade file is glade-- (http://home.wtal.de/petig/Gtk/) nodig.
+Comment[pl]=Generuje prosty program dla środowiska GNOME--. Gnomemm i Gtkmm w wersji >= 1.2.8 i < 1.3.0 powinny być zainstalowane. Do edycji pliku glade konieczny jest program glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[pt]=Gera uma aplicação simples em GNOME--. Deverão estar instalados o Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[pt_BR]=Gera uma aplicação simples em GNOME--. Deverão estar instalados o Gnomemm, Gtkmm >= 1.2.8 e < 1.3.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[ru]=Создание простого приложения GNOME--. Требуются Gnomemm, Gtkmm >= 1.2.8 и < 1.3.0. Для редактирования файла glade нужна соответствующая программа (http://home.wtal.de/petig/Gtk/).
+Comment[sk]=Vygeneruje jednoduchú GNOME-- aplikáciu. Vyžaduje nainštalovanéGnomemm, Gtkmm >= 1.2.8 a < 1.3.0. Na editovanie glade súboru he potrebnýglade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sr]=Прави једноставан GNOME-- програм. Gnomemm, Gtkmm >= 1.2.8 и < 1.3.0 требало би да су инсталирани. Да бисте уређивали glade фајл, неопходан је glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sr@Latn]=Pravi jednostavan GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 i < 1.3.0 trebalo bi da su instalirani. Da biste uređivali glade fajl, neophodan je glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sv]=Skapar ett enkelt GNOME-- program. Gnomemm, Gtkmm >= 1.2.8 och < 1.3.0 måste vara installerat. För att redigera glade-filer krävs glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[tr]=Basit bir GNOME-- uygulaması yaratır. Gnomemm, Gtkmm>=1.28 ve <1.3.0 yüklü olmalıdır. Glade dosyasını düzenlemek için glade-- (http://home.wtal.de/petig/Gtk/) gereklidir.
+Comment[zh_CN]=生成简单的 GNOME-- 应用程序。必须安装 Gnomemm、1.2.8 到 1.3.0 之间的 Gtkmm。要编辑 glade 文件,需要使用 glade-- (http://home.wtal.de/petig/Gtk/)。
+Comment[zh_TW]=產生一個簡單的 GNOME-- 應用程式。要先安裝 Gnomemm,Gtkmm 版本 >= 1.2.8 且 < 1.3.0。要編輯 glade 檔則要先安裝 glade-- (http://home.wtal.de/petig/Gtk/)。
+FileTemplates=hh,CStyle,cc,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=gnome2mmapp.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNOME2]
+Type=include
+File=%{kdevelop}/template-common/gnome2.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[FILE4]
+Type=install
+Source=%{src}/acconfig.h
+Dest=%{dest}/acconfig.h
+
+[FILE5]
+Type=install
+Source=%{src}/config.h
+Dest=%{dest}/config.h
+
+[FILE6]
+Type=install
+Source=%{src}/autogen.sh
+Dest=%{dest}/autogen.sh
+
+[FILE7]
+Type=install
+Source=%{src}/gnome2mm.glade
+Dest=%{dest}/%{APPNAMELC}.glade
+
+[FILE8]
+Type=install
+Source=%{src}/gnome2mm.gladep
+Dest=%{dest}/%{APPNAMELC}.gladep
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE9]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/gnome2mm.cc
+Dest=%{dest}/src/%{APPNAMELC}.cc
+
+[FILE11]
+Type=install
+Source=%{src}/main_window.hh
+Dest=%{dest}/src/main_window.hh
+
+[FILE12]
+Type=install
+Source=%{src}/main_window.cc
+Dest=%{dest}/src/main_window.cc
+
+[FILE13]
+Type=install
+Source=%{src}/main_window_glade.hh
+Dest=%{dest}/src/main_window_glade.hh
+
+[FILE14]
+Type=install
+Source=%{src}/main_window_glade.cc
+Dest=%{dest}/src/main_window_glade.cc
+
+[MSG]
+Type=message
+Comment=A GNOME-- application framework was created in %{dest}
+Comment[ca]=Una infraestructura d'aplicació per a GNOME ha estat creada en %{dest}
+Comment[da]=Et GNOME-- programskelet blev oprettet i %{dest}
+Comment[de]=Ein GNOME-Anwendungsgerüst wurde in %{dest} erstellt.
+Comment[el]=Ένα πλαίσιο εφαρμογής GNOME δημιουργήθηκε στο %{dest}
+Comment[es]=Una infraestructura de aplicación GNOME-- ha sido creada en %{dest}
+Comment[et]=GNOME-- rakenduse raamistik loodi asukohta %{dest}
+Comment[eu]=GNOME-- applicazioen lan-marko bat sortu da hemen: %{dest}
+Comment[fa]=یک چارچوب کاربرد GNOME-- در %{dest} ایجاد شد
+Comment[fr]=Une infrastructure d'application GNOME-- a été créée dans %{dest}
+Comment[ga]=Cruthaíodh creatlach feidhmchláir GNOME-- i %{dest}
+Comment[gl]=Creouse un contorno de traballo para aplicación GNOME en %{dest}
+Comment[hu]=Létrejött egy GNOME-s alkalmazás-keretrendszer itt: %{dest}
+Comment[it]=È stato creata l'infrastruttura per un'applicazione GNOME in %{dest}
+Comment[ja]=GNOME-- アプリケーションフレームワークを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Programmrahmenwark för "GNOME--" opstellt
+Comment[ne]= जिनोम-- अनुप्रयोग फ्रेमवर्क %{dest} मा सिर्जना गरियो
+Comment[nl]=Een GNOME-- applicationframework is aangemaakt in %{dest}
+Comment[pl]=Szablon programu dla GNOME-- został utworzony w %{dest}
+Comment[pt]=Foi criada a plataforma de uma aplicação GNOME-- em %{dest}
+Comment[pt_BR]=Foi criada a plataforma de uma aplicação GNOME-- em %{dest}
+Comment[ru]=Простое приложение GNOME-- создано в %{dest}
+Comment[sk]=GNOME-- aplikačný framework bol vytvorený v %{dest}
+Comment[sl]=Ogrodje programa za GNOME-- je bilo ustvarjeno v %{dest}
+Comment[sr]=Радни оквир GNOME-- програма направљен је у %{dest}
+Comment[sr@Latn]=Radni okvir GNOME-- programa napravljen je u %{dest}
+Comment[sv]=Ett GNOME-- programramverk skapades i %{dest}
+Comment[tr]=Bir GNOME-- uygulama çatısı %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了 GNOME-- 应用程序框架
+Comment[zh_TW]=GNOME-- 應用程式框架已建立於 %{dest}
diff --git a/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png
new file mode 100644
index 00000000..253a6229
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/gnome2mmapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window.cc b/languages/cpp/app_templates/gnome2mmapp/main_window.cc
new file mode 100644
index 00000000..4c73911b
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/main_window.cc
@@ -0,0 +1,16 @@
+%{CC_TEMPLATE}
+
+// newer (non customized) versions of this file go to main_window.cc_new
+
+// This file is for your program, I won't touch it again!
+
+#include "config.h"
+#include "main_window.hh"
+
+#include <gtk--/main.h>
+
+gint main_window::quit(GdkEventAny *ev)
+{
+ Gtk::Main::quit();
+}
+
diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window.hh b/languages/cpp/app_templates/gnome2mmapp/main_window.hh
new file mode 100644
index 00000000..ae93336b
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/main_window.hh
@@ -0,0 +1,19 @@
+%{HH_TEMPLATE}
+
+// newer (non customized) versions of this file go to main_window.hh_new
+
+// you might replace
+// class foo : public foo_glade { ... };
+// by
+// typedef foo_glade foo;
+// if you didn't make any modifications to the widget
+
+#ifndef _MAIN_WINDOW_HH
+# include "main_window_glade.hh"
+# define _MAIN_WINDOW_HH
+class main_window : public main_window_glade
+{
+protected:
+ virtual gint quit(GdkEventAny *ev);
+};
+#endif
diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc
new file mode 100644
index 00000000..bea6c857
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.cc
@@ -0,0 +1,30 @@
+%{CC_TEMPLATE}
+
+// DO NOT EDIT THIS FILE ! It was created using
+// glade-- /home/amp8165/Projects/gnome2mm/gnome2mm.glade
+// for gtk 2.2.4 and gtkmm 1.2.10
+//
+// Please modify the corresponding derived classes in ./src/main_window.cc
+
+#include "config.h"
+#include <libgnome/libgnome.h>
+#include "main_window_glade.hh"
+#include <gdk/gdkkeysyms.h>
+#include <gtk--/accelgroup.h>
+
+main_window_glade::main_window_glade(
+) : Gtk::Window(GTK_WINDOW_TOPLEVEL)
+{ main_window = this;
+
+ Gtk::AccelGroup *main_window_accgrp = Gtk::AccelGroup::create();
+ gmm_data = new GlademmData(main_window_accgrp);
+ main_window->set_title(_("%{APPNAME} Project"));
+ main_window->set_modal(false);
+ main_window->add_accel_group(*(gmm_data->getAccelGroup()));
+ main_window->show();
+ main_window->delete_event.connect(SigC::slot(this, &main_window_glade::quit));
+}
+
+main_window_glade::~main_window_glade()
+{ delete gmm_data;
+}
diff --git a/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh
new file mode 100644
index 00000000..97a9302f
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/main_window_glade.hh
@@ -0,0 +1,49 @@
+%{HH_TEMPLATE}
+
+// DO NOT EDIT THIS FILE ! It was created using
+// glade-- /home/amp8165/Projects/gnome2mm/gnome2mm.glade
+// for gtk 2.2.4 and gtkmm 1.2.10
+//
+// Please modify the corresponding derived classes in ./src/main_window.hh and./src/main_window.cc
+
+#ifndef _MAIN_WINDOW_GLADE_HH
+# define _MAIN_WINDOW_GLADE_HH
+
+
+#if !defined(GLADEMM_DATA)
+#define GLADEMM_DATA
+#include <gtk--/accelgroup.h>
+
+class GlademmData
+{
+
+ Gtk::AccelGroup *accgrp;
+public:
+
+ GlademmData(Gtk::AccelGroup *ag) : accgrp(ag)
+ {
+ }
+
+ Gtk::AccelGroup * getAccelGroup()
+ { return accgrp;
+ }
+};
+#endif //GLADEMM_DATA
+
+#include <gtk--/window.h>
+
+class main_window_glade : public Gtk::Window
+{
+
+ GlademmData *gmm_data;
+public:
+ class Gtk::Window *main_window;
+protected:
+
+ main_window_glade();
+
+ ~main_window_glade();
+
+ virtual gint quit(GdkEventAny *ev) = 0;
+};
+#endif
diff --git a/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am b/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am
new file mode 100644
index 00000000..fe5ec32c
--- /dev/null
+++ b/languages/cpp/app_templates/gnome2mmapp/src-Makefile.am
@@ -0,0 +1,14 @@
+bin_PROGRAMS = %{APPNAMELC}
+
+%{APPNAMELC}_SOURCES = \
+ %{APPNAMELC}.cc\
+ main_window_glade.cc \
+ main_window.cc
+
+noinst_HEADERS = \
+ main_window_glade.hh \
+ main_window.hh
+
+AM_CXXFLAGS = @CXXFLAGS@ @GNOMEMM_CFLAGS@
+
+%{APPNAMELC}_LDADD = @LIBS@ @GNOMEMM_LIBS@
diff --git a/languages/cpp/app_templates/gtk2mmapp/.kdev_ignore b/languages/cpp/app_templates/gtk2mmapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/gtk2mmapp/Makefile.am b/languages/cpp/app_templates/gtk2mmapp/Makefile.am
new file mode 100644
index 00000000..2069ade7
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = acconfig.h autogen.sh gtk2mm.glade main_window.cc \
+ main_window_glade.hh Makefile.am app-Makefile.am \
+ configure.in gtk2mm.gladep main_window.hh \
+ app.kdevelop gtk2mm.cc main_window_glade.cc\
+ src-Makefile.am config.h gtk2mmapp.png
+
+templateName = gtk2mmapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/gtk2mmapp/acconfig.h b/languages/cpp/app_templates/gtk2mmapp/acconfig.h
new file mode 100644
index 00000000..a3f4402e
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/acconfig.h
@@ -0,0 +1,10 @@
+/* acconfig.h
+ * This file is in the public domain.
+ *
+ * Descriptive text for the C preprocessor macros that
+ * the distributed Autoconf macros can define.
+ * These entries are sometimes used by macros
+ * which glade-- uses.
+ */
+#undef PACKAGE
+#undef VERSION
diff --git a/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am b/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am
new file mode 100644
index 00000000..1d95370d
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/app-Makefile.am
@@ -0,0 +1,4 @@
+
+SUBDIRS = src
+
+EXTRA_DIST = AUTHORS TODO README configure
diff --git a/languages/cpp/app_templates/gtk2mmapp/app.kdevelop b/languages/cpp/app_templates/gtk2mmapp/app.kdevelop
new file mode 100644
index 00000000..47330ca2
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/app.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>GTK</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O2 -g0</cflags>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cflags>-O0 -g3</cflags>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.h" name="Sources" />
+ <group pattern="*.glade" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnustep</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/gtk2mmapp/autogen.sh b/languages/cpp/app_templates/gtk2mmapp/autogen.sh
new file mode 100755
index 00000000..231521ba
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/autogen.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# generated 2004/4/12 11:58:47 EDT by amp8165@localhost.(none)
+# using glademm V2.0.0
+
+if test ! -f install-sh ; then touch install-sh ; fi
+
+MAKE=`which gnumake`
+if test ! -x "$MAKE" ; then MAKE=`which gmake` ; fi
+if test ! -x "$MAKE" ; then MAKE=`which make` ; fi
+HAVE_GNU_MAKE=`$MAKE --version|grep -c "Free Software Foundation"`
+
+if test "$HAVE_GNU_MAKE" != "1"; then
+echo Using non GNU Make at $MAKE
+else
+echo Found GNU Make at $MAKE ... good.
+fi
+
+echo This script runs configure and make...
+echo You did remember necessary arguments for configure, right?
+
+if test ! -x `which aclocal`
+then echo you need autoconfig and automake to generate the Makefile
+fi
+if test ! -x `which automake`
+then echo you need automake to generate the Makefile
+fi
+
+libtoolize --force --copy
+autoheader
+aclocal
+automake --add-missing --copy --gnu
+autoconf
+#./configure $* && $MAKE
diff --git a/languages/cpp/app_templates/gtk2mmapp/config.h b/languages/cpp/app_templates/gtk2mmapp/config.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/config.h
diff --git a/languages/cpp/app_templates/gtk2mmapp/configure.in b/languages/cpp/app_templates/gtk2mmapp/configure.in
new file mode 100644
index 00000000..cec72218
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/configure.in
@@ -0,0 +1,19 @@
+
+AC_INIT(configure.in)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_CONFIG_HEADER(config.h)
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_PROG_CXXCPP
+AM_PROG_LIBTOOL
+
+AC_LANG_CPLUSPLUS
+
+PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.8.0])
+
+AC_OUTPUT(Makefile src/Makefile )
diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc
new file mode 100644
index 00000000..9845fede
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.cc
@@ -0,0 +1,15 @@
+%{CC_TEMPLATE}
+
+#include <gtkmm/main.h>
+
+#include "main_window.hh"
+
+int main(int argc, char **argv)
+{
+
+ Gtk::Main m(&argc, &argv);
+
+ main_window main_window;
+ Gtk::Main::run(main_window);
+ return 0;
+}
diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade
new file mode 100644
index 00000000..ef4f1b18
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.glade
@@ -0,0 +1,30 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="main_window">
+ <property agent="glademm" name="cxx_separate_class">True</property>
+ <property agent="glademm" name="cxx_separate_file">True</property>
+ <property agent="glademm" name="cxx_visibility">public</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">%{APPNAME} Project</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <signal name="delete_event" handler="quit"/>
+
+ <child>
+ <placeholder/>
+ </child>
+</widget>
+
+</glade-interface>
diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep
new file mode 100644
index 00000000..f09912ac
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mm.gladep
@@ -0,0 +1,10 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+ <name>%{APPNAME}</name>
+ <program_name>%{APPNAMELC}</program_name>
+ <language>C++</language>
+ <gnome_support>FALSE</gnome_support>
+ <gettext_support>FALSE</gettext_support>
+</glade-project>
diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate
new file mode 100644
index 00000000..6d52c9bd
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.kdevtemplate
@@ -0,0 +1,174 @@
+# KDE Config File
+[General]
+Name=Gtk-- Application framework
+Name[ca]=Infraestructura d'aplicació per a Gtk--
+Name[da]=Gtk-- programskelet
+Name[de]="Gtk--"-Anwendungsgrundgerüst
+Name[el]=Gtk-- πλαίσιο εφαρμογής
+Name[es]=Infraestructura de aplicación Gtk--
+Name[et]=Gtk-- rakenduse raamistik
+Name[eu]=Gtk-- Applicazioen lan-markoa
+Name[fa]=چارچوب کاربرد Gtk--
+Name[fr]=Infrastructure d'application Gtk--
+Name[ga]=Creatlach feidhmchláir Gtk--
+Name[hu]=Gtk-- - alkalmazás-keretrendszer
+Name[it]=Infrastruttura per un'applicazione Gtk--
+Name[ja]=Gtk-- アプリケーションフレームワーク
+Name[nds]="Gtk--"-Programmrahmenwark
+Name[ne]=Gtk-- अनुप्रयोग फ्रेमवर्क
+Name[nl]=Gtk-- Applicationframework
+Name[pl]=Szablon programu Gtk--
+Name[pt]=Plataforma de aplicações em Gtk--
+Name[pt_BR]=Plataforma de aplicações em Gtk--
+Name[ru]=Приложение Gtk--
+Name[sk]=Gtk-- aplikačný framework
+Name[sl]=Ogrodje programa za Gtk--
+Name[sr]=Радни оквир Gtk-- програма
+Name[sr@Latn]=Radni okvir Gtk-- programa
+Name[sv]=Gtk-- programramverk
+Name[tr]=Gtk-- Uygulama Çatısı
+Name[zh_CN]=Gtk-- 应用程序框架
+Name[zh_TW]=Gtk-- 應用程式框架
+Category=C++/GTK+
+Icon=gtk2mmapp.png
+Comment=Generates a simple Gtk-- application. Gtkmm >= 2.8.0 should be installed. To edit glade file glade-- (http://home.wtal.de/petig/Gtk/) is required.
+Comment[ca]=Genera una simple aplicació Gtk. Gtkmm >= 2.8.0 hauria d'estar instal·lat. Per editar el fitxer glade es requereix glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[da]=Genererer et simpelt Gtk-- program. Gtkmm >= 2.8.0 skal være installeret. For at redigere glade file glade-- kræves (http://home.wtal.de/petig/Gtk/).
+Comment[de]=Erstellt eine einfache Gtk-Anwendung. Gtkmm >= 1.2.8 und < 1.3.0 sollte installiert sein. Zum Bearbeiten der glade-Datei ist glade-- (http://home.wtal.de/petig/Gtk/) erforderlich.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή Gtk. Το Gtkmm >= 2.8.0 πρέπει να είναι εγκατεστημένο. Για την επεξεργασία του αρχείου glade απαιτείται το glade (http://home.wtal.de/petig/Gtk/).
+Comment[es]=Genera una sencilla aplicación Gtk--. Debe tener instalado Gtkmm >= 2.8.0. Para editar archivos glade se necesita glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[et]=Lihtsa Gtk-- rakenduse loomine. Paigaldatud peab olema Gtkmm >= 2.8.0. Glade-faili redigeerimiseks on vajalik glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[fr]=Génère une application Gtk-- simple. Gtkmm >= 2.8.0 devra être installé. Pour modifier le fichier glade, glade-- (http://home.wtal.de/petig/Gtk/) est requis.
+Comment[hu]=Létrehoz egy egyszerű Gtk---alapú alkalmazást. Gtkmm >= 2.8.0 szükséges hozzá. Glade-fájl szerkesztéséhez glade-- (http://home.wtal.de/petig/Gtk/) szükséges.
+Comment[it]=Genera una semplice applicazione Gtk--. Dovrebbe essere installato Gtkmm >= 2.8.0. Per modificare il file di glade bisogna avere glade-- installato (http://home.wtal.de/petig/Gtk/).
+Comment[ja]=簡単な Gtk-- アプリケーションを作成します。Gtkmm >= 2.8.0 が必要です。Glade ファイルを編集するには glade (http://home.wtal.de/petig/Gtk/) が必要です。
+Comment[nds]=Stellt en eenfach "Gtk--"-Programm op. Gtkmm >= 2.8.0 schull installeert wesen. För't Bewerken vun de glade-Datei deit "glade--" (http://home.wtal.de/petig/Gtk/) noot.
+Comment[nl]=Genereert een eenvoudige Gtk-- toepassing. Gtkmm >= 2.8.0 dient te zijn geïnstalleerd. Om het glade-bestand te kunnen bewerken hebt u glade-- (http://home.wtal.de/petig/Gtk/) nodig.
+Comment[pl]=Generuje prosty program Gtk--. Powinno być zainstalowane Gtkmm w wersji >= 2.8.0. Do modyfikacji plików glade konieczne jest glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[pt]=Gera uma aplicação simples em Gtk--. Deverá estar instalado o Gtkmm >= 2.8.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[pt_BR]=Gera uma aplicação simples em Gtk--. Deverá estar instalado o Gtkmm >= 2.8.0. Para editar o ficheiro do Glade,, é necessário o glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[ru]=Создание простого приложения Gtk--. Требуется Gtkmm >= 1.2.8 и < 1.3.0. Для редактирования файла glade нужна соответствующая программа (http://home.wtal.de/petig/Gtk/).
+Comment[sk]=Vygeneruje jednoduchú Gtk-- aplikáciu. Vyžaduje nainštalované Gtkmm >= 2.8.0. Na editovanie glade súboru he potrebný glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sr]=Прави једноставан Gtk-- програм. Gtkmm >= 2.8.0 требало би да је инсталиран. Да бисте уређивали glade фајл, неопходан је glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sr@Latn]=Pravi jednostavan Gtk-- program. Gtkmm >= 2.8.0 trebalo bi da je instaliran. Da biste uređivali glade fajl, neophodan je glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[sv]=Skapar ett enkelt Gtk-- program. Gtkmm >= 2.8.0 måste vara installerat. För att redigera glade-filer krävs glade-- (http://home.wtal.de/petig/Gtk/).
+Comment[zh_TW]=產生一個簡單的 Gtk-- 應用程式。要先安裝 Gtkmm 版本 >= 2.8.0。要編輯 glade 檔則要先安裝 glade-- (http://home.wtal.de/petig/Gtk/)。
+FileTemplates=hh,CStyle,cc,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=gtk2mmapp.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[FILE4]
+Type=install
+Source=%{src}/acconfig.h
+Dest=%{dest}/acconfig.h
+
+[FILE5]
+Type=install
+Source=%{src}/config.h
+Dest=%{dest}/config.h
+
+[FILE6]
+Type=install
+Source=%{src}/autogen.sh
+Dest=%{dest}/autogen.sh
+
+[FILE7]
+Type=install
+Source=%{src}/gtk2mm.glade
+Dest=%{dest}/%{APPNAMELC}.glade
+
+[FILE8]
+Type=install
+Source=%{src}/gtk2mm.gladep
+Dest=%{dest}/%{APPNAMELC}.gladep
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE9]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/gtk2mm.cc
+Dest=%{dest}/src/%{APPNAMELC}.cc
+
+[FILE11]
+Type=install
+Source=%{src}/main_window.hh
+Dest=%{dest}/src/main_window.hh
+
+[FILE12]
+Type=install
+Source=%{src}/main_window.cc
+Dest=%{dest}/src/main_window.cc
+
+[FILE13]
+Type=install
+Source=%{src}/main_window_glade.hh
+Dest=%{dest}/src/main_window_glade.hh
+
+[FILE14]
+Type=install
+Source=%{src}/main_window_glade.cc
+Dest=%{dest}/src/main_window_glade.cc
+
+[MSG]
+Type=message
+Comment=A Gtk-- application framework was created in %{dest}
+Comment[ca]=Una infraestructura d'aplicació Gtk-- ha estat creada en %{dest}
+Comment[da]=Et Gtk-- programskelet blev oprettet i %{dest}
+Comment[de]=Ein Gtk-Anwendungsgerüst wurde in %{dest} erstellt.
+Comment[el]=Ένα πλαίσιο εφαρμογής Gtk δημιουργήθηκε στο %{dest}
+Comment[es]=Una infraestructura de aplicación Gtk-- ha sido creada en %{dest}
+Comment[et]=Gtk-- rakenduse raamistik loodi asukohta %{dest}
+Comment[eu]=Gtk-- aplikazioen lan-marko bat sortu da hemen: %{dest}
+Comment[fa]=یک چارچوب کاربرد Gtk-- در %{dest} ایجاد شد
+Comment[fr]=Une infrastructure d'application Gtk-- a été créée dans %{dest}
+Comment[ga]=Cruthaíodh creatlach feidhmchláir Gtk-- i %{dest}
+Comment[gl]=Creouse un contorno de traballo para aplicación Gtk en %{dest}
+Comment[hu]=Létrejött egy Gtk-s alkalmazás-keretrendszer itt: %{dest}
+Comment[it]=È stata creata l'infrastruttura per un'applicazione Gtk-- in %{dest}
+Comment[ja]=Gtk-- アプリケーションフレームワークを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en "Gtk-- "-Programmrahmenwark opstellt
+Comment[ne]=Gtk-- अनुप्रयोग फ्रेमवर्क %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Gtk-- toepassing is aangemaakt in %{dest}
+Comment[pl]=Szablon programu Gtk-- został utworzony w %{dest}
+Comment[pt]=Foi criada a plataforma de uma aplicação Gtk-- em %{dest}
+Comment[pt_BR]=Foi criada a plataforma de uma aplicação Gtk-- em %{dest}
+Comment[ru]=Приложение Gtk-- создано в %{dest}
+Comment[sk]=Gtk-- aplikačný framework bol vytvorený v %{dest}
+Comment[sl]=Ogrodje za program v Gtk-- je bil ustvarjen v %{dest}
+Comment[sr]=Радни оквир Gtk-- програма направљен је у %{dest}
+Comment[sr@Latn]=Radni okvir Gtk-- programa napravljen je u %{dest}
+Comment[sv]=Ett Gtk-- programramverk skapades i %{dest}
+Comment[tr]=Bir Gtk-- uygulama çatısı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个 Gtk-- 应用程序框架
+Comment[zh_TW]=一個 Gtk-- 應用程式框架已建立於 %{dest}
diff --git a/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png
new file mode 100644
index 00000000..253a6229
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/gtk2mmapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window.cc b/languages/cpp/app_templates/gtk2mmapp/main_window.cc
new file mode 100644
index 00000000..ad36b327
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/main_window.cc
@@ -0,0 +1,12 @@
+%{CC_TEMPLATE}
+
+// newer (non customized) versions of this file go to main_window.cc_new
+
+// This file is for your program, I won't touch it again!
+
+#include "config.h"
+#include "main_window.hh"
+
+bool main_window::quit(GdkEventAny *ev)
+{ return 0;
+}
diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window.hh b/languages/cpp/app_templates/gtk2mmapp/main_window.hh
new file mode 100644
index 00000000..640e1461
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/main_window.hh
@@ -0,0 +1,19 @@
+%{HH_TEMPLATE}
+
+// newer (non customized) versions of this file go to main_window.hh_new
+
+// you might replace
+// class foo : public foo_glade { ... };
+// by
+// typedef foo_glade foo;
+// if you didn't make any modifications to the widget
+
+#ifndef _MAIN_WINDOW_HH
+# include "main_window_glade.hh"
+# define _MAIN_WINDOW_HH
+class main_window : public main_window_glade
+{
+
+ bool quit(GdkEventAny *ev);
+};
+#endif
diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc
new file mode 100644
index 00000000..829855a8
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.cc
@@ -0,0 +1,40 @@
+%{CC_TEMPLATE}
+
+// DO NOT EDIT THIS FILE ! It was created using glade--
+// for gtk 2.8.3 and gtkmm 2.8.0
+//
+// Please modify the corresponding derived classes in ./src/main_window.cc
+
+
+#if defined __GNUC__ && __GNUC__ < 3
+#error This program will crash if compiled with g++ 2.x
+// see the dynamic_cast bug in the gtkmm FAQ
+#endif //
+#include "config.h"
+#include <gtkmmconfig.h>
+#if GTKMM_MAJOR_VERSION==2 && GTKMM_MINOR_VERSION>2
+#include <sigc++/compatibility.h>
+#define GMM_GTKMM_22_24(a,b) b
+#else //gtkmm 2.2
+#define GMM_GTKMM_22_24(a,b) a
+#endif //
+#include "main_window_glade.hh"
+#include <gdk/gdkkeysyms.h>
+#include <gtkmm/accelgroup.h>
+
+main_window_glade::main_window_glade(
+) : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
+{ main_window = this;
+ gmm_data = new GlademmData(get_accel_group());
+ main_window->set_title("%{APPNAME} Project");
+ main_window->set_modal(false);
+ main_window->property_window_position().set_value(Gtk::WIN_POS_CENTER);
+ main_window->set_resizable(true);
+ main_window->property_destroy_with_parent().set_value(false);
+ main_window->show();
+ main_window->signal_delete_event().connect(SigC::slot(*this, &main_window_glade::quit), false);
+}
+
+main_window_glade::~main_window_glade()
+{ delete gmm_data;
+}
diff --git a/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh
new file mode 100644
index 00000000..3c0cc27a
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/main_window_glade.hh
@@ -0,0 +1,48 @@
+%{HH_TEMPLATE}
+
+// DO NOT EDIT THIS FILE ! It was created using glade--
+// for gtk 2.8.3 and gtkmm 2.8.0
+//
+// Please modify the corresponding derived classes in ./src/main_window.hh and./src/main_window.cc
+
+#ifndef _MAIN_WINDOW_GLADE_HH
+# define _MAIN_WINDOW_GLADE_HH
+
+
+#if !defined(GLADEMM_DATA)
+#define GLADEMM_DATA
+#include <gtkmm/accelgroup.h>
+
+class GlademmData
+{
+
+ Glib::RefPtr<Gtk::AccelGroup> accgrp;
+public:
+
+ GlademmData(Glib::RefPtr<Gtk::AccelGroup> ag) : accgrp(ag)
+ {
+ }
+
+ Glib::RefPtr<Gtk::AccelGroup> getAccelGroup()
+ { return accgrp;
+ }
+};
+#endif //GLADEMM_DATA
+
+#include <gtkmm/window.h>
+
+class main_window_glade : public Gtk::Window
+{
+
+ GlademmData *gmm_data;
+public:
+ class Gtk::Window * main_window;
+protected:
+
+ main_window_glade();
+
+ ~main_window_glade();
+private:
+ virtual bool quit(GdkEventAny *ev) = 0;
+};
+#endif
diff --git a/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am b/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am
new file mode 100644
index 00000000..a8c856e9
--- /dev/null
+++ b/languages/cpp/app_templates/gtk2mmapp/src-Makefile.am
@@ -0,0 +1,14 @@
+bin_PROGRAMS = %{APPNAMELC}
+
+%{APPNAMELC}_SOURCES = \
+ %{APPNAMELC}.cc\
+ main_window_glade.cc \
+ main_window.cc
+
+noinst_HEADERS = \
+ main_window_glade.hh \
+ main_window.hh
+
+AM_CXXFLAGS = @CXXFLAGS@ @GTKMM_CFLAGS@
+
+%{APPNAMELC}_LDADD = @LIBS@ @GTKMM_LIBS@
diff --git a/languages/cpp/app_templates/kapp/.kdev_ignore b/languages/cpp/app_templates/kapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/kapp/Makefile.am b/languages/cpp/app_templates/kapp/Makefile.am
new file mode 100644
index 00000000..efe532d3
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = app.cpp app.h pref.cpp pref.h appview.cpp appview.h \
+ appiface.h app_client.cpp main.cpp appui.rc src-Makefile.am \
+ kapp.png app.kdevelop subdirs README
+
+templateName = kapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kapp/README b/languages/cpp/app_templates/kapp/README
new file mode 100644
index 00000000..f04a5635
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/README
@@ -0,0 +1,81 @@
+-----------------------------------------------
+Kde application framework template quickstart
+Author: Thomas Nagy
+Date: 2004-03-22
+-----------------------------------------------
+
+This README file explains you basic things for starting with
+this application template.
+
+
+** Building and installing **
+
+* Build the configure script by "make -f Makefile.cvs"
+
+* To clean, use "make clean", and to clean everything
+(remove the makefiles, etc), use "make distclean"
+
+* To distribute your program, try "make dist".
+This will make a compact tarball archive of your release with the
+necessary scripts inside.
+
+* Modifying the auto-tools scripts
+for automake scripts there is an excellent tutorial there :
+http://developer.kde.org/documentation/other/makefile_am_howto.html
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+./configure --prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For more details, consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
+
+
diff --git a/languages/cpp/app_templates/kapp/app.cpp b/languages/cpp/app_templates/kapp/app.cpp
new file mode 100644
index 00000000..5460bba9
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app.cpp
@@ -0,0 +1,247 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include "pref.h"
+
+#include <qdragobject.h>
+#include <kprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+#include <kstatusbar.h>
+#include <kaccel.h>
+#include <kio/netaccess.h>
+#include <kfiledialog.h>
+#include <kconfig.h>
+#include <kurl.h>
+#include <kurldrag.h>
+#include <kurlrequesterdlg.h>
+
+#include <kstdaccel.h>
+#include <kaction.h>
+#include <kstdaction.h>
+
+%{APPNAME}::%{APPNAME}()
+ : KMainWindow( 0, "%{APPNAME}" ),
+ m_view(new %{APPNAME}View(this)),
+ m_printer(0)
+{
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KMainWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar()->show();
+
+ // Apply the create the main window and ask the mainwindow to
+ // automatically save settings if changed: window size, toolbar
+ // position, icon size, etc. Also to add actions for the statusbar
+ // toolbar, and keybindings if necessary.
+ setupGUI();
+
+ // allow the view to change the statusbar and caption
+ connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
+ this, SLOT(changeStatusbar(const QString&)));
+ connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
+ this, SLOT(changeCaption(const QString&)));
+
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+void %{APPNAME}::load(const KURL& url)
+{
+ QString target;
+ // the below code is what you should normally do. in this
+ // example case, we want the url to our own. you probably
+ // want to use this code instead for your app
+
+ #if 0
+ // download the contents
+ if (KIO::NetAccess::download(url, target))
+ {
+ // set our caption
+ setCaption(url);
+
+ // load in the file (target is always local)
+ loadFile(target);
+
+ // and remove the temp file
+ KIO::NetAccess::removeTempFile(target);
+ }
+ #endif
+
+ setCaption(url.prettyURL());
+ m_view->openURL(url);
+}
+
+void %{APPNAME}::setupActions()
+{
+ KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+ KStdAction::save(this, SLOT(fileSave()), actionCollection());
+ KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ KStdAction::print(this, SLOT(filePrint()), actionCollection());
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ // this doesn't do anything useful. it's just here to illustrate
+ // how to insert a custom menu and menu item
+ KAction *custom = new KAction(i18n("Cus&tom Menuitem"), 0,
+ this, SLOT(optionsPreferences()),
+ actionCollection(), "custom_action");
+}
+
+void %{APPNAME}::saveProperties(KConfig *config)
+{
+ // the 'config' object points to the session managed
+ // config file. anything you write here will be available
+ // later when this app is restored
+
+ if (!m_view->currentURL().isEmpty()) {
+#if KDE_IS_VERSION(3,1,3)
+ config->writePathEntry("lastURL", m_view->currentURL());
+#else
+ config->writeEntry("lastURL", m_view->currentURL());
+#endif
+ }
+}
+
+void %{APPNAME}::readProperties(KConfig *config)
+{
+ // the 'config' object points to the session managed
+ // config file. this function is automatically called whenever
+ // the app is being restored. read in here whatever you wrote
+ // in 'saveProperties'
+
+ QString url = config->readPathEntry("lastURL");
+
+ if (!url.isEmpty())
+ m_view->openURL(KURL(url));
+}
+
+void %{APPNAME}::dragEnterEvent(QDragEnterEvent *event)
+{
+ // accept uri drops only
+ event->accept(KURLDrag::canDecode(event));
+}
+
+void %{APPNAME}::dropEvent(QDropEvent *event)
+{
+ // this is a very simplistic implementation of a drop event. we
+ // will only accept a dropped URL. the Qt dnd code can do *much*
+ // much more, so please read the docs there
+ KURL::List urls;
+
+ // see if we can decode a URI.. if not, just ignore it
+ if (KURLDrag::decode(event, urls) && !urls.isEmpty())
+ {
+ // okay, we have a URI.. process it
+ const KURL &url = urls.first();
+
+ // load in the file
+ load(url);
+ }
+}
+
+void %{APPNAME}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAME})->show();
+}
+
+void %{APPNAME}::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+/*
+ // this brings up the generic open dialog
+ KURL url = KURLRequesterDlg::getURL(QString::null, this, i18n("Open Location") );
+*/
+ // standard filedialog
+ KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Open Location"));
+ if (!url.isEmpty())
+ m_view->openURL(url);
+}
+
+void %{APPNAME}::fileSave()
+{
+ // this slot is called whenever the File->Save menu is selected,
+ // the Save shortcut is pressed (usually CTRL+S) or the Save toolbar
+ // button is clicked
+
+ // save the current file
+}
+
+void %{APPNAME}::fileSaveAs()
+{
+ // this slot is called whenever the File->Save As menu is selected,
+ KURL file_url = KFileDialog::getSaveURL();
+ if (!file_url.isEmpty() && file_url.isValid())
+ {
+ // save your info, here
+ }
+}
+
+void %{APPNAME}::filePrint()
+{
+ // this slot is called whenever the File->Print menu is selected,
+ // the Print shortcut is pressed (usually CTRL+P) or the Print toolbar
+ // button is clicked
+ if (!m_printer) m_printer = new KPrinter;
+ if (m_printer->setup(this))
+ {
+ // setup the printer. with Qt, you always "print" to a
+ // QPainter.. whether the output medium is a pixmap, a screen,
+ // or paper
+ QPainter p;
+ p.begin(m_printer);
+
+ // we let our view do the actual printing
+ QPaintDeviceMetrics metrics(m_printer);
+ m_view->print(&p, metrics.height(), metrics.width());
+
+ // and send the result to the printer
+ p.end();
+ }
+}
+
+void %{APPNAME}::optionsPreferences()
+{
+ // popup some sort of preference dialog, here
+ %{APPNAME}Preferences dlg;
+ if (dlg.exec())
+ {
+ // redo your settings
+ }
+}
+
+void %{APPNAME}::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text);
+}
+
+void %{APPNAME}::changeCaption(const QString& text)
+{
+ // display the text on the caption
+ setCaption(text);
+}
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kapp/app.desktop b/languages/cpp/app_templates/kapp/app.desktop
new file mode 100644
index 00000000..7389904a
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC} %i -caption "%c"
+Icon=%{APPNAMELC}
+Type=Application
+X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html
+Comment=A KDE KPart Application
+Comment[br]=Ur meziant Kpart evit KDE
+Comment[ca]=Una aplicació KPart per al KDE
+Comment[cy]=Cymhwysiad KPart KDE
+Comment[da]=Et KDE KPart-program
+Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung
+Comment[el]=Μια εφαρμογή KPart του KDE
+Comment[es]=Una aplicación KPart de KDE
+Comment[et]=KDE KPart rakendus
+Comment[eu]=KDE KPart aplikazio bat
+Comment[fa]=یک کاربرد KDE KPart
+Comment[fr]=Une application KPart pour KDE
+Comment[ga]=Feidhmchlár KPart KDE
+Comment[gl]=Unha aplicación KPart de KDE
+Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग
+Comment[hu]=KPart-alapú KDE-alkalmazás
+Comment[is]=KDE KPart forrit
+Comment[it]=Applicazione KPart di KDE
+Comment[ja]=KDE KPart アプリケーション
+Comment[lt]=KDE KPart programa
+Comment[nds]=En KPart-Deelprogramm för KDE
+Comment[ne]=एउटा केडीई KPart अनुप्रयोग
+Comment[nl]=Een KDE KPart-toepassing
+Comment[pl]=Osadzalny element KPart KDE
+Comment[pt]=Uma Aplicação KPart do KDE
+Comment[pt_BR]=Um Aplicativo KPart do KDE
+Comment[ru]=Приложение KPart для KDE
+Comment[sk]=KDE KPart aplikácia
+Comment[sl]=Program KPart za KDE
+Comment[sr]=KDE KPart програм
+Comment[sr@Latn]=KDE KPart program
+Comment[sv]=Ett KDE Kpart-program
+Comment[ta]=கெடி கெபார்ட் பயன்பாடு
+Comment[tg]=Ба кор андохтани KPart барои KDE
+Comment[tr]=Bir KDE KPart Uygulaması
+Comment[zh_CN]=一个 KDE KPart 应用程序
+Comment[zh_TW]=KDE KPart 應用程式
+Terminal=false
diff --git a/languages/cpp/app_templates/kapp/app.h b/languages/cpp/app_templates/kapp/app.h
new file mode 100644
index 00000000..45c65f4b
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app.h
@@ -0,0 +1,89 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kmainwindow.h>
+
+#include "%{APPNAMELC}view.h"
+
+class KPrinter;
+class KURL;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+
+ /**
+ * Use this method to load whatever file/URL you have
+ */
+ void load(const KURL& url);
+
+protected:
+ /**
+ * Overridden virtuals for Qt drag 'n drop (XDND)
+ */
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+
+protected:
+ /**
+ * This function is called when it is time for the app to save its
+ * properties for session management purposes.
+ */
+ void saveProperties(KConfig *);
+
+ /**
+ * This function is called when this app is restored. The KConfig
+ * object points to the session management config file that was saved
+ * with @ref saveProperties
+ */
+ void readProperties(KConfig *);
+
+
+private slots:
+ void fileNew();
+ void fileOpen();
+ void fileSave();
+ void fileSaveAs();
+ void filePrint();
+ void optionsPreferences();
+
+ void changeStatusbar(const QString& text);
+ void changeCaption(const QString& text);
+
+private:
+ void setupAccel();
+ void setupActions();
+
+private:
+ %{APPNAME}View *m_view;
+
+ KPrinter *m_printer;
+};
+
+#endif // _%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/kapp/app.kdevelop b/languages/cpp/app_templates/kapp/app.kdevelop
new file mode 100644
index 00000000..07cf3f0f
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app.kdevelop
@@ -0,0 +1,168 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kapp/app.kdevses b/languages/cpp/app_templates/kapp/app.kdevses
new file mode 100644
index 00000000..dcd1c8c1
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app.kdevses
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE KDevPrjSession>
+<KDevPrjSession>
+ <DocsAndViews NumberOfDocuments="0" />
+ <pluginList>
+ <kdevbookmarks>
+ <bookmarks/>
+ </kdevbookmarks>
+ <kdevdebugger>
+ <breakpointList/>
+ </kdevdebugger>
+ </pluginList>
+</KDevPrjSession>
diff --git a/languages/cpp/app_templates/kapp/app_client.cpp b/languages/cpp/app_templates/kapp/app_client.cpp
new file mode 100644
index 00000000..5c062077
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/app_client.cpp
@@ -0,0 +1,26 @@
+%{CPP_TEMPLATE}
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <qdatastream.h>
+#include <qstring.h>
+
+int main(int argc, char **argv)
+{
+ KApplication app(argc, argv, "%{APPNAMELC}_client", false);
+
+ // get our DCOP client and attach so that we may use it
+ DCOPClient *client = app.dcopClient();
+ client->attach();
+
+ // do a 'send' for now
+ QByteArray data;
+ QDataStream ds(data, IO_WriteOnly);
+ if (argc > 1)
+ ds << QString(argv[1]);
+ else
+ ds << QString("http://www.kde.org");
+ client->send("%{APPNAMELC}", "%{APPNAME}Iface", "openURL(QString)", data);
+
+ return app.exec();
+}
diff --git a/languages/cpp/app_templates/kapp/appiface.h b/languages/cpp/app_templates/kapp/appiface.h
new file mode 100644
index 00000000..4a24ae7f
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/appiface.h
@@ -0,0 +1,17 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}IFACE_H_
+#define _%{APPNAMEUC}IFACE_H_
+
+#include <dcopobject.h>
+
+class %{APPNAME}Iface : virtual public DCOPObject
+{
+ K_DCOP
+public:
+
+k_dcop:
+ virtual void openURL(QString url) = 0;
+};
+
+#endif // _%{APPNAMEUC}IFACE_H_
diff --git a/languages/cpp/app_templates/kapp/appui.rc b/languages/cpp/app_templates/kapp/appui.rc
new file mode 100644
index 00000000..ceb4f14e
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="custom"><text>C&amp;ustom</text>
+ <Action name="custom_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kapp/appview.cpp b/languages/cpp/app_templates/kapp/appview.cpp
new file mode 100644
index 00000000..a57adbf3
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/appview.cpp
@@ -0,0 +1,107 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}view.h"
+
+#include <qpainter.h>
+#include <qlayout.h>
+
+#include <kurl.h>
+
+#include <ktrader.h>
+#include <klibloader.h>
+#include <kmessagebox.h>
+#include <krun.h>
+#include <klocale.h>
+
+%{APPNAME}View::%{APPNAME}View(QWidget *parent)
+ : QWidget(parent),
+ DCOPObject("%{APPNAME}Iface")
+{
+ // setup our layout manager to automatically add our widgets
+ QHBoxLayout *top_layout = new QHBoxLayout(this);
+ top_layout->setAutoAdd(true);
+
+ // we want to look for all components that satisfy our needs. the
+ // trader will actually search through *all* registered KDE
+ // applications and components -- not just KParts. So we have to
+ // specify two things: a service type and a constraint
+ //
+ // the service type is like a mime type. we say that we want all
+ // applications and components that can handle HTML -- 'text/html'
+ //
+ // however, by itself, this will return such things as Netscape..
+ // not what we wanted. so we constrain it by saying that the
+ // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes
+ // field. with this, only components of the type we want will be
+ // returned.
+ KTrader::OfferList offers = KTrader::self()->query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes");
+
+ KLibFactory *factory = 0;
+ // in theory, we only care about the first one.. but let's try all
+ // offers just in case the first can't be loaded for some reason
+ KTrader::OfferList::Iterator it(offers.begin());
+ for( ; it != offers.end(); ++it)
+ {
+ KService::Ptr ptr = (*it);
+
+ // we now know that our offer can handle HTML and is a part.
+ // since it is a part, it must also have a library... let's try to
+ // load that now
+ factory = KLibLoader::self()->factory( ptr->library() );
+ if (factory)
+ {
+ m_html = static_cast<KParts::ReadOnlyPart *>(factory->create(this, ptr->name(), "KParts::ReadOnlyPart"));
+ break;
+ }
+ }
+
+ // if our factory is invalid, then we never found our component
+ // and we might as well just exit now
+ if (!factory)
+ {
+ KMessageBox::error(this, i18n("Could not find a suitable HTML component"));
+ return;
+ }
+
+ connect(m_html, SIGNAL(setWindowCaption(const QString&)),
+ this, SLOT(slotSetTitle(const QString&)));
+ connect(m_html, SIGNAL(setStatusBarText(const QString&)),
+ this, SLOT(slotOnURL(const QString&)));
+
+}
+
+%{APPNAME}View::~%{APPNAME}View()
+{
+}
+
+void %{APPNAME}View::print(QPainter *p, int height, int width)
+{
+ // do the actual printing, here
+ // p->drawText(etc..)
+}
+
+QString %{APPNAME}View::currentURL()
+{
+ return m_html->url().url();
+}
+
+void %{APPNAME}View::openURL(QString url)
+{
+ openURL(KURL(url));
+}
+
+void %{APPNAME}View::openURL(const KURL& url)
+{
+ m_html->openURL(url);
+}
+
+void %{APPNAME}View::slotOnURL(const QString& url)
+{
+ emit signalChangeStatusbar(url);
+}
+
+void %{APPNAME}View::slotSetTitle(const QString& title)
+{
+ emit signalChangeCaption(title);
+}
+#include "%{APPNAMELC}view.moc"
diff --git a/languages/cpp/app_templates/kapp/appview.h b/languages/cpp/app_templates/kapp/appview.h
new file mode 100644
index 00000000..ae0c6b6d
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/appview.h
@@ -0,0 +1,77 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}VIEW_H_
+#define _%{APPNAMEUC}VIEW_H_
+
+#include <qwidget.h>
+#include <kparts/part.h>
+#include <%{APPNAMELC}iface.h>
+
+class QPainter;
+class KURL;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * This %{APPNAMELC} uses an HTML component as an example.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME}View : public QWidget, public %{APPNAME}Iface
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAME}View(QWidget *parent);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAME}View();
+
+ /**
+ * Random 'get' function
+ */
+ QString currentURL();
+
+ /**
+ * Random 'set' function accessed by DCOP
+ */
+ virtual void openURL(QString url);
+
+ /**
+ * Random 'set' function
+ */
+ virtual void openURL(const KURL& url);
+
+ /**
+ * Print this view to any medium -- paper or not
+ */
+ void print(QPainter *, int height, int width);
+
+signals:
+ /**
+ * Use this signal to change the content of the statusbar
+ */
+ void signalChangeStatusbar(const QString& text);
+
+ /**
+ * Use this signal to change the content of the caption
+ */
+ void signalChangeCaption(const QString& text);
+
+private slots:
+ void slotOnURL(const QString& url);
+ void slotSetTitle(const QString& title);
+
+private:
+ KParts::ReadOnlyPart *m_html;
+};
+
+#endif // _%{APPNAMEUC}VIEW_H_
diff --git a/languages/cpp/app_templates/kapp/kapp.kdevtemplate b/languages/cpp/app_templates/kapp/kapp.kdevtemplate
new file mode 100644
index 00000000..7865c973
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/kapp.kdevtemplate
@@ -0,0 +1,253 @@
+# KDE Config File
+[General]
+Name=Application framework
+Name[ca]=Infraestructura d'aplicacions
+Name[da]=Programskelet
+Name[de]=Anwendungsgrundgerüst
+Name[el]=Πλαίσιο εφαρμογής
+Name[es]=Infraestructura de aplicación
+Name[et]=Rakenduse raamistik
+Name[eu]=Aplikazioen lan-markoa
+Name[fa]=چارچوب کاربرد
+Name[fr]=Infrastructure d'application
+Name[ga]=Creatlach feidhmchláir
+Name[gl]=Entorno de traballo para aplicación
+Name[hu]=Alkalmazás-keretrendszer
+Name[it]=Infrastruttura applicativa
+Name[ja]=アプリケーションフレームワーク
+Name[nds]=Programmrahmenwark
+Name[ne]=अनुप्रयोग फ्रेमवर्क
+Name[nl]=Applicationframework
+Name[pl]=Szablon programu
+Name[pt]=Plataforma de aplicações
+Name[pt_BR]=Plataforma de aplicações
+Name[ru]=Приложение KDE
+Name[sk]=Aplikačný framework
+Name[sl]=Ogrodje programa
+Name[sr]=Радни оквир програма
+Name[sr@Latn]=Radni okvir programa
+Name[sv]=Programramverk
+Name[tr]=Uygulama Çatısı
+Name[zh_CN]=应用程序框架
+Name[zh_TW]=應用程式框架
+Icon=kapp.png
+Category=C++/KDE
+Comment=Generates a simple KDE application with one toplevel window, menus and toolbars. A DCOP interface is also provided, so that your application can provide a scripting interface
+Comment[ca]=Genera una simple aplicació per al KDE amb una finestra principal, menús i barres d'eines. També es proveeix la interfície DCOP, de manera que la vostra aplicació podrà proveir d'una interfície per a scripts
+Comment[da]=Genererer et simpelt KDE program med et vindue på topniveau, menuer og værktøjslinjer. Der sørges også for en DCOP-grænseflade, så dit program kan sørge for en script-grænseflade
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. Dazu kommt eine DCOP-Schnittstelle, so dass Ihre Anwendung eine Schnittstelle für Skripte anbieten kann.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα ανώτερο παράθυρο, μενού και γραμμές εργαλείων. Μια διασύνδεση DCOP προσφέρεται επίσης, έτσι ώστε η εφαρμογή σας να προσφέρει ένα περιβάλλον γραφής σεναρίων
+Comment[es]=Genera una sencilla aplicación de KDE con una ventana de nivel superior, menús y barras de herramientas. También se proporciona una interfaz DCOP para que su aplicación pueda proporcionar una interfaz para guiones de órdenes.
+Comment[et]=Lihtsa KDE rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. Lisatakse ka DCOP-liides, mis võimaldab pakkuda rakenduses ka skriptikeelte tuge.
+Comment[eu]=KDE aplikazio sinple bat sortzen du menu eta tresna-barradun goi-mailako lehio batekin. DCOP interfaze bat ere eskeintzen zaio aplikazioari, zure aplikazioak script interfaze bat izan dezan
+Comment[fa]=یک کاربرد سادۀ KDE با یک پنجرۀ سطح بالا، گزینگان و میله ابزارها تولید می‌کند. همچنین یک واسط DCOP فراهم است. بنابراین، کاربرد شما یک واسط دست‌نوشته‌ای را می‌تواند فراهم کند
+Comment[fr]=Génère une application KDE simple comprenant une fenêtre de premier niveau, des menus et des barres d'outils. Une interface DCOP est également prévue, afin que votre application puisse offrir une interface de scriptage
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le príomhfhuinneog amháin, roghchláir agus barraí uirlisí. Soláthraítear comhéadan DCOP freisin, d'fhonn is féidir comhéadan scriptithe a chur ar fáil
+Comment[gl]=Xera unha aplicación KDE sinxela cunha xanela principal, menús e barras de ferramentas. Tamén se proporciona unha interface DCOP de modo que a súa aplicación poida proveer unha interface de scripting.
+Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy főablakkal, menükkel és eszköztárakkal. DCOP-felület is létre lesz hozva, ezért az alkalmazás szkriptelési felületet is biztosíthat.
+Comment[it]=Genera una semplice applicazione KDE con una finestra toplevel, menu e barre degli strumenti. È anche fornita un'interfaccia DCOP così l'applicazione avrà un'interfaccia per lo scripting
+Comment[ja]=簡単な KDE アプリケーションを作成します。アプリケーションには、トップレベルのウィンドウ、メニュー、ツールバーがあります。スクリプト化をサポートするために DCOP のインターフェースも用意してあります。
+Comment[nds]=Stellt en eenfach KDE-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op. Ok warrt noch en DCOP-Koppelsteed praatstellt, so dat Dien Programm en Skriptkoppelsteed anbeden kann
+Comment[ne]=एउटा उच्चतह सञ्झ्याल, मेनु र उपकरणपट्टीसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । DCOP पनि प्रदान गरिन्छ, जसले गर्दा तपाईँको अनुप्रयोगले स्क्रिप्टिङ इन्टरफेस प्रदान गर्न सक्दछ
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één toplevel window, menu's en toolbars. Er wordt ook een DCOP-interface aangeleverd, zodat uw toepassing een scripting interface kan aanleveren.
+Comment[pl]=Generuje prosty program dla KDE z oknem, menu i paskami narzędzi. Dostępny jest także interfejs DCOP, więc Twoje programy mogą zawierać interfejs do skryptów
+Comment[pt]=Gera uma aplicação simples do KDE com uma janela de topo, menus e barras de ferramentas. Também é oferecida uma interface de DCOP, para que a sua aplicação possa fornecer uma interface de programação
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela de topo, menus e barras de ferramentas. Também é oferecida uma interface de DCOP, para que a sua aplicação possa fornecer uma interface de programação
+Comment[ru]=Создание простого приложения KDE с окном, меню и панелями инструментов. Кроме того, в нём содержится интерфейс DCOP для автоматизации работы с помощью пользовательских скриптов
+Comment[sk]=Vygenruje jednoduchú KDE aplikáciu s jedným oknom, menu apanelom nástrojov. Taktiež bude poskytnuté DCOP rozhranie, takže aj aplikáciamôže poskytnúť skriptovacie rozhranie
+Comment[sr]=Прави једноставан KDE програм, са једним прозором највишег нивоа, менијима и тракама са алатом. Дат је и DCOP интерфејс, тако да ваш програм може да омогући скриптовање
+Comment[sr@Latn]=Pravi jednostavan KDE program, sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. Dat je i DCOP interfejs, tako da vaš program može da omogući skriptovanje
+Comment[sv]=Skapar ett enkelt KDE-program med ett toppnivåfönster, menyer och verktygsrader. Ett DCOP-gränssnitt tillhandahålls också, så att programmet kan tillhandahålla ett skriptgränssnitt.
+Comment[tr]=Bir üst seviye penceresi, menüleri ve araç çubukları olan basit bir KDE uygulaması yaratır. Bir DCOP arayüzü sağlanır, böylece uygulama bir betik arayüzü sağlayabilir.
+Comment[zh_CN]=生成一个带一个顶层窗口、菜单和工具栏的简单 KDE 应用程序。另外还提供了 DCOP 接口,这样您的应用也可同时提供脚本接口。
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含頂層視窗、選單與工具列。另外提供一個 DCOP 介面,讓您的應用程式可以提供文稿介面。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}view.cpp,%{dest}/src/README
+Archive=kapp.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE17]
+Type=install
+Source=%{src}/appview.cpp
+Dest=%{dest}/src/%{APPNAMELC}view.cpp
+
+[FILE18]
+Type=install
+Source=%{src}/appview.h
+Dest=%{dest}/src/%{APPNAMELC}view.h
+
+[FILE19]
+Type=install
+Source=%{src}/appiface.h
+Dest=%{dest}/src/%{APPNAMELC}iface.h
+
+[FILE20]
+Type=install
+Source=%{src}/app_client.cpp
+Dest=%{dest}/src/%{APPNAMELC}_client.cpp
+
+[FILE21]
+Type=install
+Source=%{src}/pref.cpp
+Dest=%{dest}/src/pref.cpp
+
+[FILE22]
+Type=install
+Source=%{src}/pref.h
+Dest=%{dest}/src/pref.h
+
+[FILE23]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE24]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE25]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[MSG]
+Type=message
+Comment=A KDE Application was created at %{dest}
+Comment[ca]=Una aplicació per al KDE ha estat creada a %{dest}
+Comment[da]=Et KDE program blev oprettet i %{dest}
+Comment[de]=Eine KDE-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación de KDE ha sido creada en %{dest}
+Comment[et]=KDE rakendus loodi asukohta %{dest}
+Comment[eu]=A KDE aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KDE در %{dest} فراهم شد
+Comment[fr]=Une application KDE a été créée dans %{dest}
+Comment[ga]=Cruthaíodh Feidhmchlár KDE ag %{dest}
+Comment[gl]=Creouse unha aplicación KDE en %{dest}
+Comment[hu]=Létrejött egy KDE-s alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE in %{dest}
+Comment[ja]=KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-Programm opstellt
+Comment[ne]=KDE अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KDE-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program dla KDE został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE em %{dest}
+Comment[ru]=Приложение KDE создано в %{dest}
+Comment[sk]=KDE aplikácia bola vytvorená v %{dest}
+Comment[sl]=Program za KDE je bil ustvarjen v %{dest}
+Comment[sr]=KDE програм је направљен у %{dest}
+Comment[sr@Latn]=KDE program je napravljen u %{dest}
+Comment[sv]=Ett KDE-program skapades i %{dest}
+Comment[tr]=Bir KDE Uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KDE 应用程序
+Comment[zh_TW]=一個 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kapp/kapp.png b/languages/cpp/app_templates/kapp/kapp.png
new file mode 100644
index 00000000..a421a664
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/kapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/kapp/main.cpp b/languages/cpp/app_templates/kapp/main.cpp
new file mode 100644
index 00000000..60c161e8
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/main.cpp
@@ -0,0 +1,61 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+
+ // register ourselves as a dcop client
+ app.dcopClient()->registerAs(app.name(), false);
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count() == 0)
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++)
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ widget->load(args->url(i));
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
diff --git a/languages/cpp/app_templates/kapp/pref.cpp b/languages/cpp/app_templates/kapp/pref.cpp
new file mode 100644
index 00000000..ee647b1c
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/pref.cpp
@@ -0,0 +1,42 @@
+%{CPP_TEMPLATE}
+
+#include "pref.h"
+
+#include <klocale.h>
+
+#include <qlayout.h>
+#include <qlabel.h>
+
+%{APPNAME}Preferences::%{APPNAME}Preferences()
+ : KDialogBase(TreeList, i18n("%{APPNAME} Preferences"),
+ Help|Default|Ok|Apply|Cancel, Ok)
+{
+ // this is the base class for your preferences dialog. it is now
+ // a Treelist dialog.. but there are a number of other
+ // possibilities (including Tab, Swallow, and just Plain)
+ QFrame *frame;
+ frame = addPage(i18n("First Page"), i18n("Page One Options"));
+ m_pageOne = new %{APPNAME}PrefPageOne(frame);
+
+ frame = addPage(i18n("Second Page"), i18n("Page Two Options"));
+ m_pageTwo = new %{APPNAME}PrefPageTwo(frame);
+}
+
+%{APPNAME}PrefPageOne::%{APPNAME}PrefPageOne(QWidget *parent)
+ : QFrame(parent)
+{
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ layout->setAutoAdd(true);
+
+ new QLabel(i18n("Add something here"), this);
+}
+
+%{APPNAME}PrefPageTwo::%{APPNAME}PrefPageTwo(QWidget *parent)
+ : QFrame(parent)
+{
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ layout->setAutoAdd(true);
+
+ new QLabel(i18n("Add something here"), this);
+}
+#include "pref.moc"
diff --git a/languages/cpp/app_templates/kapp/pref.h b/languages/cpp/app_templates/kapp/pref.h
new file mode 100644
index 00000000..11aec821
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/pref.h
@@ -0,0 +1,37 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}PREF_H_
+#define _%{APPNAMEUC}PREF_H_
+
+#include <kdialogbase.h>
+#include <qframe.h>
+
+class %{APPNAME}PrefPageOne;
+class %{APPNAME}PrefPageTwo;
+
+class %{APPNAME}Preferences : public KDialogBase
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Preferences();
+
+private:
+ %{APPNAME}PrefPageOne *m_pageOne;
+ %{APPNAME}PrefPageTwo *m_pageTwo;
+};
+
+class %{APPNAME}PrefPageOne : public QFrame
+{
+ Q_OBJECT
+public:
+ %{APPNAME}PrefPageOne(QWidget *parent = 0);
+};
+
+class %{APPNAME}PrefPageTwo : public QFrame
+{
+ Q_OBJECT
+public:
+ %{APPNAME}PrefPageTwo(QWidget *parent = 0);
+};
+
+#endif // _%{APPNAMEUC}PREF_H_
diff --git a/languages/cpp/app_templates/kapp/src-Makefile.am b/languages/cpp/app_templates/kapp/src-Makefile.am
new file mode 100644
index 00000000..51cb1973
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/src-Makefile.am
@@ -0,0 +1,43 @@
+## Makefile.am for %{APPNAMELC}
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC} %{APPNAMELC}_client
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+
+# the libraries to link against.
+%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT)
+
+# which sources should be compiled for %{APPNAMELC}
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}view.cpp \
+ pref.cpp %{APPNAMELC}iface.skel
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}view.h pref.h
+
+# client stuff
+%{APPNAMELC}_client_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+%{APPNAMELC}_client_LDADD = $(LIB_KDECORE)
+%{APPNAMELC}_client_SOURCES = %{APPNAMELC}_client.cpp
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
diff --git a/languages/cpp/app_templates/kapp/subdirs b/languages/cpp/app_templates/kapp/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kapp/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kateplugin/.kdev_ignore b/languages/cpp/app_templates/kateplugin/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/.kdev_ignore
diff --git a/languages/cpp/app_templates/kateplugin/Makefile.am b/languages/cpp/app_templates/kateplugin/Makefile.am
new file mode 100644
index 00000000..62da4d60
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/Makefile.am
@@ -0,0 +1,19 @@
+templateName = kateplugin
+dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h\
+ plugin_app.rc hi16-action-plugin.png \
+ hi22-action-plugin.png kateplugin.png \
+ plugin.kdevelop subdirs plugin.desktop
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png b/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png
new file mode 100644
index 00000000..e2d7bab8
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/hi16-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png b/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png
new file mode 100644
index 00000000..4082bf10
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/hi22-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate b/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate
new file mode 100644
index 00000000..767a0a57
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/kateplugin.kdevtemplate
@@ -0,0 +1,213 @@
+# KDE Config File
+[General]
+Name=Kate plugin
+Name[br]=Lugent Kate
+Name[ca]=Connector per a Kate
+Name[de]=Kate-Modul
+Name[el]=Πρόσθετο Kate
+Name[es]=Complemento para Kate
+Name[eu]=Kate plugina
+Name[fa]=وصلۀ Kate
+Name[fr]=Module externe pour Kate
+Name[ga]=Breiseán Kate
+Name[gl]=Extensión para Kate
+Name[hu]=Kate-bővítőmodul
+Name[it]=Plugin per Kate
+Name[ja]=Kate プラグイン
+Name[nds]=Kate-Moduul
+Name[ne]=केट प्लगइन
+Name[nl]=Kate-plugin
+Name[pl]=Wtyczka do Kate
+Name[pt]='Plugin' do Kate
+Name[pt_BR]='Plugin' do Kate
+Name[ru]=Модуль Kate
+Name[sk]=Kate modul
+Name[sl]=Vstavek za Kate
+Name[sr]=Прикључак за Kate
+Name[sr@Latn]=Priključak za Kate
+Name[sv]=Kate-insticksprogram
+Name[tr]=Kate eklentisi
+Name[zh_CN]=Kate 插件
+Name[zh_TW]=Kate 外掛程式
+Icon=kateplugin.png
+Category=C++/KDE
+Comment=Generates a plugin for Kate the text editor.
+Comment[ca]=Genera un connector per a l'editor de text Kate.
+Comment[da]=Genererer et plugin for teksteditoren kate
+Comment[de]=Erstellt ein Modul für den Texteditor Kate
+Comment[el]=Δημιουργεί ένα πρόσθετο για το Kate τον επεξεργαστή κειμένου.
+Comment[es]=Genera un complemento para el editor de texto Kate.
+Comment[et]=Plugina loomine tekstiredaktorile Kate.
+Comment[eu]=Plugin bat sortzen du Kate testu-editorearentzat.
+Comment[fa]=وصله‌ای برای ویرایشگر متن Kate تولید می‌کند.
+Comment[fr]=Génère un module externe pour l'éditeur de texte Kate.
+Comment[ga]=Cruthaíonn sé seo breiseán le haghaidh eagarthóir téacs Kate.
+Comment[gl]=Xera unha extensión para o editor de textos Kate.
+Comment[hu]=Létrehoz egy bővítőmodult a Kate szövegszerkesztőhöz.
+Comment[it]=Genera un plugin per l'editor di testo Kate.
+Comment[ja]=Kate テキストエディタのためのプラグインを作成します
+Comment[nds]=Stellt en Moduul för den Texteditor "Kate" op.
+Comment[ne]=केट पाठ सम्पादकका लागि प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een plugin voor de Kate-teksteditor
+Comment[pl]=Generuje wtyczkę do edytora tekstu Kate
+Comment[pt]=Gera um 'plugin' para o Kate, o editor de texto.
+Comment[pt_BR]=Gera um 'plugin' para o Kate, o editor de texto.
+Comment[ru]=Создание модуля для текстового редактора Kate.
+Comment[sk]=Vygeneruje modul pre textový editor Kate.
+Comment[sl]=Ustvari vstavek za urejevalnik besedil Kate.
+Comment[sr]=Прави прикључак за уређивач текста Kate.
+Comment[sr@Latn]=Pravi priključak za uređivač teksta Kate.
+Comment[sv]=Skapar ett insticksprogram för texteditorn Kate.
+Comment[tr]=Kate metin düzenleyicisi için bir eklenti yaratır.
+Comment[zh_CN]=生成 Kate 文本编辑器的插件。
+Comment[zh_TW]=產生一個 Kate 文字編輯器的外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp
+Archive=kateplugin.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/plugin.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE13]
+Type=install
+Source=%{src}/plugin_app.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp
+
+[FILE14]
+Type=install
+Source=%{src}/plugin_app.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}.h
+
+[FILE15]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin_app.rc
+Dest=%{dest}/src/plugin_%{APPNAMELC}.rc
+
+[FILE16]
+Type=install
+Source=%{src}/hi16-action-plugin.png
+Dest=%{dest}/src/hi16-action-plugin.png
+Process=false
+
+[FILE17]
+Type=install
+Source=%{src}/hi22-action-plugin.png
+Dest=%{dest}/src/hi32-action-plugin.png
+Process=false
+
+[MSG]
+Type=message
+Comment=A plugin for Kate was created at %{dest}
+Comment[ca]=Un connector per a Kate ha estat creat a %{dest}
+Comment[da]=Et plugin for Kate blev oprettet på %{dest}
+Comment[de]=Ein Modul für Kate wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο για το Kate δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para Kate ha sido creado en %{dest}
+Comment[et]=Kate plugin loodi asukohta %{dest}
+Comment[eu]=Kate plugin bat sortu da hemen: %{dest}
+Comment[fa]=وصله‌ای برای Kate در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour Kate a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán Kate ag %{dest}
+Comment[gl]=Creouse unha extensión para Kate en %{dest}
+Comment[hu]=Létrejött egy Kate-bővítőmodul itt: %{dest}
+Comment[it]=È stato creato un plugin per Kate in %{dest}
+Comment[ja]=Kate のプラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Moduul för "Kate" opstellt
+Comment[ne]=केटका लागि प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een plugin voor Kate is aangemaakt in %{dest}
+Comment[pl]=Wtyczka dla Kate została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' para o Kate em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' para o Kate em %{dest}
+Comment[ru]=Модуль Kate создан в %{dest}
+Comment[sk]=Modul pre Kate bol vytvorený v %{dest}
+Comment[sl]=Vstavek za Kate je bil ustvarjen v %{dest}
+Comment[sr]=Прикључак за Kate направљен је у %{dest}
+Comment[sr@Latn]=Priključak za Kate napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för Kate skapades i %{dest}
+Comment[tr]=Kate için bir eklenti %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 Kate 的插件
+Comment[zh_TW]=一個 Kate 外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kateplugin/kateplugin.png b/languages/cpp/app_templates/kateplugin/kateplugin.png
new file mode 100644
index 00000000..b442a706
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/kateplugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin/plugin.desktop b/languages/cpp/app_templates/kateplugin/plugin.desktop
new file mode 100644
index 00000000..761ac763
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/plugin.desktop
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=Kate/Plugin
+X-KDE-Library=lib%{APPNAMELC}plugin
+X-Kate-Version=2.2
+Name=My First Kate Plugin
+Name[br]=Ma lugent Kate kentañ
+Name[ca]=El meu primer connector per a Kate
+Name[cy]=F'ategyn cyntaf Kate
+Name[da]=Mit første Kate plugin
+Name[de]=Mein erstes Kate-Modul
+Name[el]=Το πρώτο μου πρόσθετο για το Kate
+Name[es]=Mi primer complemento para Kate
+Name[et]=Minu esimene Kate plugin
+Name[eu]=Nire lehenengo Kate plugina
+Name[fa]=اولین وصلۀ Kate من
+Name[fr]=Mon premier module externe pour Kate
+Name[ga]=Mo Chéad Bhreiseán Kate
+Name[gl]=A miña primeira extensión para Kate
+Name[hu]=Mintapélda Kate-bővítőmodulra
+Name[it]=Il mio primo plugin di Kate
+Name[ja]=はじめての Kate プラグイン
+Name[ms]=Plugin Kate Pertama Saya
+Name[nds]=Mien eerst Kate-Moduul
+Name[ne]=मेरो पहिलो केट प्लगइन
+Name[nl]=Mijn eerste Kate-plugin
+Name[pl]=Moja pierwsza wtyczka do Kate
+Name[pt]=O Meu Primeiro 'Plugin' para o Kate
+Name[pt_BR]=Meu Primeiro Plug-in do Kate
+Name[ru]=Мой первый модуль к Kate
+Name[sk]=Môj prvý Kate modul
+Name[sl]=Moj prvi vstavek za Kate
+Name[sr]=Мој први прикључак за Kate
+Name[sr@Latn]=Moj prvi priključak za Kate
+Name[sv]=Mitt första insticksprogram för Kate
+Name[tr]=İlk Kate Eklentim
+Name[zh_CN]=我的第一个 Kate 插件
+Name[zh_TW]=我的第一個 Kate 外掛程式
+Comment=Your short description about the plugin goes here
+Comment[ca]=Aquí va la descripció curta referent al connector
+Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma
+Comment[da]=Din korte beskrivelse af plugin skal være her
+Comment[de]=Hierhin gehört eine kurze Beschreibung des Moduls
+Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο πηγαίνει εδώ
+Comment[es]=Aquí va la descripción corta sobre el complemento
+Comment[et]=Sinu plugina lühikirjeldus
+Comment[eu]=Hemen dihoa plugin-aren buruzko zure deskribapen motza
+Comment[fa]=توصیف کوتاه شما در مورد وصله در اینجا می‌آید
+Comment[fr]=Une courte description de votre module externe s'insère ici
+Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo
+Comment[gl]=A súa descrición breve sobre a extensión vai aquí.
+Comment[hi]=प्लगइन के बारे में आपका छोटा सा वर्णन यहाँ जाएगा
+Comment[hu]=Itt lehet egy rövid leírást adni a bővítőmodulról
+Comment[is]=Hér ætti að vera smá lýsing á viðbótinni
+Comment[it]=La tua breve descrizione sui plugin va qui
+Comment[ja]=プラグインに関する短い説明をここに記述します。
+Comment[lt]=Čia turėtų būti trumpas priedo aprašymas
+Comment[ms]=Huraian ringkas anda tentang plugin anda di sini
+Comment[nds]=Hier kannst Du en kort Moduulbeschrieven ingeven
+Comment[ne]=प्लगइनका बारेमा तपाईँको छोटो भनाइ यस्तो छ
+Comment[nl]=Hier kunt u een korte omschrijving opgeven
+Comment[pl]=Tu powinien się pojawić krótki opis wtyczki
+Comment[pt]=Aqui deverá colocar uma descrição do 'plugin'
+Comment[pt_BR]=Sua descrição sumária sobre o plug-in vai aqui
+Comment[ru]=Здесь располагается краткое описание модуля
+Comment[sk]=Sem vložte krátky popis modulu
+Comment[sl]=Tukaj je kratek opis o vstavku
+Comment[sr]=Овде иде ваш кратак опис прикључка
+Comment[sr@Latn]=Ovde ide vaš kratak opis priključka
+Comment[sv]=En kort beskrivningen av vad insticksprogrammet gör
+Comment[ta]=உங்கள் சொருகின் சிறு விவரம் இங்கிருக்கும்
+Comment[tg]=Дар инҷо тасвири кӯтоҳи модул ҷойгир аст
+Comment[tr]=Eklenti hakkında kısa bir tanımı buraya yazın.
+Comment[zh_CN]=关于这个插件的简短描述
+Comment[zh_TW]=您對此外掛程式的描述寫在這裡
+author=%{AUTHOR}, %{EMAIL}
diff --git a/languages/cpp/app_templates/kateplugin/plugin.kdevelop b/languages/cpp/app_templates/kateplugin/plugin.kdevelop
new file mode 100644
index 00000000..9f0b4ede
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/plugin.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+<kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}plugin.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.cpp b/languages/cpp/app_templates/kateplugin/plugin_app.cpp
new file mode 100644
index 00000000..9fd4a694
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/plugin_app.cpp
@@ -0,0 +1,89 @@
+%{CPP_TEMPLATE}
+
+#include "plugin_%{APPNAMELC}.h"
+
+#include <kaction.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+class PluginView : public KXMLGUIClient
+{
+ friend class KatePlugin%{APPNAME};
+
+ public:
+ Kate::MainWindow *win;
+};
+
+extern "C"
+{
+ void* init_lib%{APPNAMELC}plugin()
+ {
+ KGlobal::locale()->insertCatalogue("kate%{APPNAMELC}");
+ return new KatePluginFactory;
+ }
+}
+
+KatePluginFactory::KatePluginFactory()
+{
+ s_instance = new KInstance( "kate" );
+}
+
+KatePluginFactory::~KatePluginFactory()
+{
+ delete s_instance;
+}
+
+QObject* KatePluginFactory::createObject( QObject* parent, const char* name, const char*, const QStringList & )
+{
+ return new KatePlugin%{APPNAME}( parent, name );
+}
+
+KInstance* KatePluginFactory::s_instance = 0L;
+
+KatePlugin%{APPNAME}::KatePlugin%{APPNAME}( QObject* parent, const char* name )
+ : Kate::Plugin ( (Kate::Application*)parent, name )
+{
+}
+
+KatePlugin%{APPNAME}::~KatePlugin%{APPNAME}()
+{
+}
+
+void KatePlugin%{APPNAME}::addView(Kate::MainWindow *win)
+{
+ /// @todo doesn't this have to be deleted?
+ PluginView *view = new PluginView ();
+
+ (void) new KAction ( i18n("Insert Hello World"), 0, this,
+ SLOT( slotInsertHello() ), view->actionCollection(),
+ "edit_insert_%{APPNAMELC}" );
+
+ view->setInstance (new KInstance("kate"));
+ view->setXMLFile("plugins/%{APPNAMELC}/plugin_%{APPNAMELC}.rc");
+ win->guiFactory()->addClient (view);
+ view->win = win;
+
+ m_views.append (view);
+}
+void KatePlugin%{APPNAME}::removeView(Kate::MainWindow *win)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ if (m_views.at(z)->win == win)
+ {
+ PluginView *view = m_views.at(z);
+ m_views.remove (view);
+ win->guiFactory()->removeClient (view);
+ delete view;
+ }
+}
+
+void KatePlugin%{APPNAME}::slotInsertHello()
+{
+ Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView();
+
+ if (kv)
+ kv->insertText ("Hello World");
+}
+
+#include "plugin_%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.h b/languages/cpp/app_templates/kateplugin/plugin_app.h
new file mode 100644
index 00000000..8cc5b237
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/plugin_app.h
@@ -0,0 +1,49 @@
+%{H_TEMPLATE}
+
+#ifndef _PLUGIN_%{APPNAMEUC}_H_
+#define _PLUGIN_%{APPNAMEUC}_H_
+
+#include <kate/application.h>
+#include <kate/documentmanager.h>
+#include <kate/document.h>
+#include <kate/mainwindow.h>
+#include <kate/plugin.h>
+#include <kate/view.h>
+#include <kate/viewmanager.h>
+
+#include <klibloader.h>
+#include <klocale.h>
+
+class KatePluginFactory : public KLibFactory
+{
+ Q_OBJECT
+
+ public:
+ KatePluginFactory();
+ virtual ~KatePluginFactory();
+
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() );
+
+ private:
+ static KInstance* s_instance;
+};
+
+class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface
+{
+ Q_OBJECT
+
+ public:
+ KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 );
+ virtual ~KatePlugin%{APPNAME}();
+
+ void addView (Kate::MainWindow *win);
+ void removeView (Kate::MainWindow *win);
+
+ public slots:
+ void slotInsertHello();
+
+ private:
+ QPtrList<class PluginView> m_views;
+};
+
+#endif // _PLUGIN_%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/kateplugin/plugin_app.rc b/languages/cpp/app_templates/kateplugin/plugin_app.rc
new file mode 100644
index 00000000..fe98416f
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/plugin_app.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="%{APPNAMELC}" library="lib%{APPNAMELC}plugin" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="edit_insert_%{APPNAMELC}"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="edit_insert_%{APPNAMELC}"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/cpp/app_templates/kateplugin/src-Makefile.am b/languages/cpp/app_templates/kateplugin/src-Makefile.am
new file mode 100644
index 00000000..88ba33a8
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/src-Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la
+
+lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp
+lib%{APPNAMELC}plugin_la_LIBADD = -lkateinterfaces
+lib%{APPNAMELC}plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+pluginsdir = $(kde_datadir)/kate/plugins/%{APPNAMELC}
+plugins_DATA = plugin_%{APPNAMELC}.rc
+
+kde_services_DATA = %{APPNAMELC}.desktop
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kateplugin/subdirs b/languages/cpp/app_templates/kateplugin/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kateplugin2/.kdev_ignore b/languages/cpp/app_templates/kateplugin2/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/.kdev_ignore
diff --git a/languages/cpp/app_templates/kateplugin2/Makefile.am b/languages/cpp/app_templates/kateplugin2/Makefile.am
new file mode 100644
index 00000000..29aea978
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \
+ plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \
+ kateplugin2.png plugin.kdevelop subdirs plugin.desktop
+
+templateName = kateplugin2
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png
new file mode 100644
index 00000000..e2d7bab8
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png
new file mode 100644
index 00000000..4082bf10
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate
new file mode 100644
index 00000000..b98ab94f
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate
@@ -0,0 +1,214 @@
+# KDE Config File
+[General]
+Name=Kate plugin with config page
+Name[ca]=Connector per a Kate amb pàgina de configuració
+Name[da]=Kate plugin med indstillingsside
+Name[de]=Kate-Modul mit Einstellungsseite
+Name[el]=Πρόσθετο Kate με σελίδα ρύθμισης
+Name[es]=Complemento para Kate con página de configuración
+Name[et]=Kate plugin seadistustedialoogiga
+Name[eu]=Konfigurazio orridun Kate plugina
+Name[fa]=وصلۀ Kate با صفحۀ پیکربندی
+Name[fr]=Module externe pour Kate comprenant une page de configuration
+Name[ga]=Breiseán Kate le leathanach cumraíochta
+Name[gl]=Extensión para Kate con páxina de configuración
+Name[hu]=Kate-bővítőmodul beállítólappal
+Name[it]=Plugin per Kate con pagina di configurazione
+Name[ja]=設定ページのある Kate プラグイン
+Name[nds]=Kate-Moduul mit Instellensiet
+Name[ne]=कन्फिग पृष्ठसँग केट प्लगइन
+Name[nl]=Kate-plugin met config page
+Name[pl]=Wtyczka do Kate ze stroną konfiguracyjną
+Name[pt]='Plugin' do Kate com página de configuração
+Name[pt_BR]='Plugin' do Kate com página de configuração
+Name[ru]=Модуль Kate с диалогом настройки
+Name[sk]=Kate modul s konfiguračnou stránkou
+Name[sl]=Vstavek z nastavitveno stranjo za Kate
+Name[sr]=Прикључак за Kate са страном за подешавања
+Name[sr@Latn]=Priključak za Kate sa stranom za podešavanja
+Name[sv]=Kate-insticksprogram med inställningssida
+Name[tr]=Ayar sayfası olan bir Kate eklentisi
+Name[zh_CN]=带配置页的 Kate 插件
+Name[zh_TW]=Kate 外掛程式,內含設定頁面
+Icon=kateplugin2.png
+Category=C++/KDE
+Comment=Generates a plugin with config page for Kate the text editor.
+Comment[ca]=Genera un connector amb pàgina de configuració per a l'editor de text Kate.
+Comment[da]=Generere et plugin med indstillingsside for teksteditoren Kate.
+Comment[de]=Erstellt ein Modul mit Konfigurationsseite für den Texteditor Kate.
+Comment[el]=Δημιουργεί ένα πρόσθετο με σελίδα ρύθμισης για το Kate τον επεξεργαστή κειμένου.
+Comment[es]=Genera un complemento con página de configuración para el editor de texto Kate.
+Comment[et]=Seadistustedialoogiga plugina loomine tekstiredaktorile Kate.
+Comment[eu]=Konfigurazio orridun Kate plugin bat sortzen du.
+Comment[fa]=وصله‌ای با صفحۀ پیکربندی ویرایشگر متن Kate تولید می‌کند.
+Comment[fr]=Génère un module externe comprenant une page de configuration pour l'éditeur de texte Kate.
+Comment[ga]=Cruthaíodh breiseán le leathanach cumraíochta le haghaidh eagarthóra téacs Kate.
+Comment[gl]=Xera unha extensión con páxina de configuración para o editor de textos Kate.
+Comment[hu]=Létrehoz egy bővítőmodult beállítólappal a Kate szövegszerkesztőhöz.
+Comment[it]=Genera un plugin con pagina di configurazione per l'editor di testo Kate.
+Comment[ja]=テキストエディタ Kate のための設定ページのあるプラグインを作成します。
+Comment[nds]=Stellt en Moduul mit Instellensiet för den Texteditor "Kate" op.
+Comment[ne]=केट पाठ सम्पादकका लागि कन्फिग पृष्ठसँग प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een plugin met een config page voor de Kate-teksteditor
+Comment[pl]=Generuje wtyczke wraz ze stroną konfiguracyjną do edytora tekstu Kate.
+Comment[pt]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto.
+Comment[pt_BR]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto.
+Comment[ru]=Создание модуля для текстового редактора Kate с диалогом настройки.
+Comment[sk]=Vygeneruje modul s konfiguračnou stránkou pre textový editor Kate.
+Comment[sl]=Ustvari vstavek z nastavitveno stranjo za urejevalnik besedil Kate.
+Comment[sr]=Прави прикључак са страном за подешавање за уређивач текста Kate.
+Comment[sr@Latn]=Pravi priključak sa stranom za podešavanje za uređivač teksta Kate.
+Comment[sv]=Skapar ett insticksprogram för texteditorn Kate med en inställningssida.
+Comment[tr]=Kate metin düzenleyicisi için ayar sayfası olan bir eklenti yaratır.
+Comment[zh_CN]=生成带配置页的 Kate 文本编辑器插件。
+Comment[zh_TW]=產生一個 Kate 文字編輯器的外掛程式,內含設定頁面。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp
+Archive=kateplugin2.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/plugin.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE13]
+Type=install
+Source=%{src}/plugin_app.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp
+
+[FILE14]
+Type=install
+Source=%{src}/plugin_app.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}.h
+
+[FILE15]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin_app.rc
+Dest=%{dest}/src/plugin_%{APPNAMELC}.rc
+
+[FILE16]
+Type=install
+Source=%{src}/hi16-action-plugin.png
+Dest=%{dest}/src/hi16-action-plugin.png
+Process=false
+
+[FILE17]
+Type=install
+Source=%{src}/hi22-action-plugin.png
+Dest=%{dest}/src/hi32-action-plugin.png
+Process=false
+
+[MSG]
+Type=message
+Comment=A plugin for Kate with a config page was created in %{dest}
+Comment[ca]=Un connector per a Kate amb pàgina de configuració ha estat creat en %{dest}
+Comment[da]=Et plugin for Kate med en indstillingsside blev oprettet i %{dest}
+Comment[de]=Ein Modul für Kate mit Konfigurationsseite wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο για το Kate με μια σελίδα ρύθμισης δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para Kate con una página de configuración ha sido creado en %{dest}
+Comment[et]=Seadistustedialoogiga Kate plugin loodi asukohta %{dest}
+Comment[eu]=Konfigurazio orridun Kate plugin bat sortu da hemen:%{dest}
+Comment[fa]=وصله‌ای برای Kate با یک صفحۀ پیکربندی در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour Kate comprenant une page de configuration a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán Kate le leathanach cumraíochta i %{dest}
+Comment[gl]=Creouse unha extensión para Kate con páxina de configuración en %{dest}
+Comment[hu]=Létrejött egy Kate-bővítőmodul (beállítólappal) itt: %{dest}
+Comment[it]=È stato creato un plugin per Kate con pagina di configurazione in %{dest}
+Comment[ja]=設定ページのある Kate プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Moduul för Kate mit Instellensiet opstellt
+Comment[ne]=कन्फिग पृष्ठसँग केटका लागि प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een plugin voor Kate met een config page is aangemaakt in %{dest}
+Comment[pl]=Wtyczka do Kate wraz ze stroną konfiguracyjną została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest}
+Comment[ru]=Модуль Kate с диалогом настройки создан в %{dest}
+Comment[sk]=Modul pre Kate s konfiguračnou stránkou bol vytvorený v %{dest}
+Comment[sl]=Vstavek z nastavitveno stranjo za Kate je bil ustvarjen v %{dest}
+Comment[sr]=Прикључак за Kate са страном за подешавања направљен је у %{dest}
+Comment[sr@Latn]=Priključak za Kate sa stranom za podešavanja napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för Kate med en inställningssida skapades i %{dest}
+Comment[tr]=Kate için ayar sayfası olan bir eklenti %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个带配置页的 Kate 插件
+Comment[zh_TW]=一個內含設定頁面的 Kate 外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.png b/languages/cpp/app_templates/kateplugin2/kateplugin2.png
new file mode 100644
index 00000000..b442a706
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/kateplugin2.png
Binary files differ
diff --git a/languages/cpp/app_templates/kateplugin2/plugin.desktop b/languages/cpp/app_templates/kateplugin2/plugin.desktop
new file mode 100644
index 00000000..761ac763
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/plugin.desktop
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+ServiceTypes=Kate/Plugin
+X-KDE-Library=lib%{APPNAMELC}plugin
+X-Kate-Version=2.2
+Name=My First Kate Plugin
+Name[br]=Ma lugent Kate kentañ
+Name[ca]=El meu primer connector per a Kate
+Name[cy]=F'ategyn cyntaf Kate
+Name[da]=Mit første Kate plugin
+Name[de]=Mein erstes Kate-Modul
+Name[el]=Το πρώτο μου πρόσθετο για το Kate
+Name[es]=Mi primer complemento para Kate
+Name[et]=Minu esimene Kate plugin
+Name[eu]=Nire lehenengo Kate plugina
+Name[fa]=اولین وصلۀ Kate من
+Name[fr]=Mon premier module externe pour Kate
+Name[ga]=Mo Chéad Bhreiseán Kate
+Name[gl]=A miña primeira extensión para Kate
+Name[hu]=Mintapélda Kate-bővítőmodulra
+Name[it]=Il mio primo plugin di Kate
+Name[ja]=はじめての Kate プラグイン
+Name[ms]=Plugin Kate Pertama Saya
+Name[nds]=Mien eerst Kate-Moduul
+Name[ne]=मेरो पहिलो केट प्लगइन
+Name[nl]=Mijn eerste Kate-plugin
+Name[pl]=Moja pierwsza wtyczka do Kate
+Name[pt]=O Meu Primeiro 'Plugin' para o Kate
+Name[pt_BR]=Meu Primeiro Plug-in do Kate
+Name[ru]=Мой первый модуль к Kate
+Name[sk]=Môj prvý Kate modul
+Name[sl]=Moj prvi vstavek za Kate
+Name[sr]=Мој први прикључак за Kate
+Name[sr@Latn]=Moj prvi priključak za Kate
+Name[sv]=Mitt första insticksprogram för Kate
+Name[tr]=İlk Kate Eklentim
+Name[zh_CN]=我的第一个 Kate 插件
+Name[zh_TW]=我的第一個 Kate 外掛程式
+Comment=Your short description about the plugin goes here
+Comment[ca]=Aquí va la descripció curta referent al connector
+Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma
+Comment[da]=Din korte beskrivelse af plugin skal være her
+Comment[de]=Hierhin gehört eine kurze Beschreibung des Moduls
+Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο πηγαίνει εδώ
+Comment[es]=Aquí va la descripción corta sobre el complemento
+Comment[et]=Sinu plugina lühikirjeldus
+Comment[eu]=Hemen dihoa plugin-aren buruzko zure deskribapen motza
+Comment[fa]=توصیف کوتاه شما در مورد وصله در اینجا می‌آید
+Comment[fr]=Une courte description de votre module externe s'insère ici
+Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo
+Comment[gl]=A súa descrición breve sobre a extensión vai aquí.
+Comment[hi]=प्लगइन के बारे में आपका छोटा सा वर्णन यहाँ जाएगा
+Comment[hu]=Itt lehet egy rövid leírást adni a bővítőmodulról
+Comment[is]=Hér ætti að vera smá lýsing á viðbótinni
+Comment[it]=La tua breve descrizione sui plugin va qui
+Comment[ja]=プラグインに関する短い説明をここに記述します。
+Comment[lt]=Čia turėtų būti trumpas priedo aprašymas
+Comment[ms]=Huraian ringkas anda tentang plugin anda di sini
+Comment[nds]=Hier kannst Du en kort Moduulbeschrieven ingeven
+Comment[ne]=प्लगइनका बारेमा तपाईँको छोटो भनाइ यस्तो छ
+Comment[nl]=Hier kunt u een korte omschrijving opgeven
+Comment[pl]=Tu powinien się pojawić krótki opis wtyczki
+Comment[pt]=Aqui deverá colocar uma descrição do 'plugin'
+Comment[pt_BR]=Sua descrição sumária sobre o plug-in vai aqui
+Comment[ru]=Здесь располагается краткое описание модуля
+Comment[sk]=Sem vložte krátky popis modulu
+Comment[sl]=Tukaj je kratek opis o vstavku
+Comment[sr]=Овде иде ваш кратак опис прикључка
+Comment[sr@Latn]=Ovde ide vaš kratak opis priključka
+Comment[sv]=En kort beskrivningen av vad insticksprogrammet gör
+Comment[ta]=உங்கள் சொருகின் சிறு விவரம் இங்கிருக்கும்
+Comment[tg]=Дар инҷо тасвири кӯтоҳи модул ҷойгир аст
+Comment[tr]=Eklenti hakkında kısa bir tanımı buraya yazın.
+Comment[zh_CN]=关于这个插件的简短描述
+Comment[zh_TW]=您對此外掛程式的描述寫在這裡
+author=%{AUTHOR}, %{EMAIL}
diff --git a/languages/cpp/app_templates/kateplugin2/plugin.kdevelop b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop
new file mode 100644
index 00000000..cbed4cac
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+<kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}plugin.la</activetarget>
+
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.cpp b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp
new file mode 100644
index 00000000..99d78eff
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp
@@ -0,0 +1,140 @@
+%{CPP_TEMPLATE}
+
+#include "plugin_%{APPNAMELC}.h"
+
+#include <kaction.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kfiledialog.h>
+
+#include <qlayout.h>
+#include <qlabel.h>
+
+class PluginView : public KXMLGUIClient
+{
+ friend class KatePlugin%{APPNAME};
+
+public:
+ Kate::MainWindow *win;
+};
+
+extern "C"
+{
+ void* init_lib%{APPNAMELC}plugin()
+ {
+ KGlobal::locale()->insertCatalogue("kate%{APPNAMELC}");
+ return new KatePluginFactory;
+ }
+}
+
+KatePluginFactory::KatePluginFactory()
+{
+ s_instance = new KInstance( "kate" );
+}
+
+KatePluginFactory::~KatePluginFactory()
+{
+ delete s_instance;
+}
+
+QObject* KatePluginFactory::createObject( QObject* parent, const char* name, const char*, const QStringList & )
+{
+ return new KatePlugin%{APPNAME}( parent, name );
+}
+
+KInstance* KatePluginFactory::s_instance = 0L;
+
+KatePlugin%{APPNAME}::KatePlugin%{APPNAME}( QObject* parent, const char* name )
+ : Kate::Plugin ( (Kate::Application*)parent, name )
+{
+}
+
+KatePlugin%{APPNAME}::~KatePlugin%{APPNAME}()
+{
+}
+
+void KatePlugin%{APPNAME}::addView(Kate::MainWindow *win)
+{
+ /// @todo doesn't this have to be deleted?
+ PluginView *view = new PluginView ();
+
+ (void) new KAction ( i18n("Insert Hello World"), 0, this,
+ SLOT( slotInsertHello() ), view->actionCollection(),
+ "edit_insert_%{APPNAMELC}" );
+
+ view->setInstance (new KInstance("kate"));
+ view->setXMLFile("plugins/%{APPNAMELC}/plugin_%{APPNAMELC}.rc");
+ win->guiFactory()->addClient (view);
+ view->win = win;
+
+ m_views.append (view);
+}
+
+void KatePlugin%{APPNAME}::removeView(Kate::MainWindow *win)
+{
+ for (uint z=0; z < m_views.count(); z++)
+ if (m_views.at(z)->win == win)
+ {
+ PluginView *view = m_views.at(z);
+ m_views.remove (view);
+ win->guiFactory()->removeClient (view);
+ delete view;
+ }
+}
+
+void KatePlugin%{APPNAME}::slotInsertHello()
+{
+ Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView();
+
+ if (kv)
+ kv->insertText ("Hello World");
+}
+
+Kate::PluginConfigPage* KatePlugin%{APPNAME}::configPage (uint, QWidget *w, const char* name)
+{
+ %{APPNAME}ConfigPage* p = new %{APPNAME}ConfigPage(this, w);
+ initConfigPage( p );
+ connect( p, SIGNAL(configPageApplyRequest(%{APPNAME}ConfigPage*)), this, SLOT(slotApplyConfig(%{APPNAME}ConfigPage*)) );
+ return (Kate::PluginConfigPage*)p;
+}
+
+void KatePlugin%{APPNAME}::initConfigPage( %{APPNAME}ConfigPage* p )
+{
+ // TODO: initialize %{APPNAME}ConfigPage here
+ // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage
+}
+
+void KatePlugin%{APPNAME}::slotApplyConfig( %{APPNAME}ConfigPage* p )
+{
+ // TODO: save %{APPNAME}ConfigPage here
+ // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage
+}
+
+
+/**
+ * %{APPNAME}ConfigPage
+ */
+%{APPNAME}ConfigPage::%{APPNAME}ConfigPage (QObject* parent /*= 0L*/, QWidget *parentWidget /*= 0L*/)
+ : Kate::PluginConfigPage( parentWidget )
+{
+ QVBoxLayout* lo = new QVBoxLayout( this, 0, 0, "config_page_layout" );
+ lo->setSpacing(KDialogBase::spacingHint());
+
+ QLabel* lab = new QLabel("KatePlugin%{APPNAME}'s config page", this);
+
+ lo->addWidget(lab);
+
+ // TODO: add connection to emit SLOT( changed() )
+}
+
+%{APPNAME}ConfigPage::~%{APPNAME}ConfigPage()
+{
+}
+
+void %{APPNAME}ConfigPage::apply()
+{
+ emit configPageApplyRequest( this );
+}
+
+#include "plugin_%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.h b/languages/cpp/app_templates/kateplugin2/plugin_app.h
new file mode 100644
index 00000000..e4f97d00
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/plugin_app.h
@@ -0,0 +1,91 @@
+%{H_TEMPLATE}
+
+#ifndef _PLUGIN_%{APPNAMEUC}_H_
+#define _PLUGIN_%{APPNAMEUC}_H_
+
+#include <kate/application.h>
+#include <kate/documentmanager.h>
+#include <kate/document.h>
+#include <kate/mainwindow.h>
+#include <kate/plugin.h>
+#include <kate/view.h>
+#include <kate/viewmanager.h>
+#include <kate/pluginconfiginterface.h>
+#include <kate/pluginconfiginterfaceextension.h>
+
+#include <klibloader.h>
+#include <klocale.h>
+
+class %{APPNAME}ConfigPage;
+
+class KatePluginFactory : public KLibFactory
+{
+ Q_OBJECT
+
+public:
+ KatePluginFactory();
+ virtual ~KatePluginFactory();
+
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() );
+
+private:
+ static KInstance* s_instance;
+};
+
+class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension
+{
+ Q_OBJECT
+
+public:
+ KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 );
+ virtual ~KatePlugin%{APPNAME}();
+
+ void addView (Kate::MainWindow *win);
+ void removeView (Kate::MainWindow *win);
+
+ /** overwrite some functions */
+ uint configPages () const { return 1; }
+ Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0);
+ QString configPageName(uint) const { return i18n("%{APPNAME}"); };
+ QString configPageFullName(uint) const { return i18n("Configure KatePlugin%{APPNAME}"); };
+ QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; };
+
+public slots:
+ void slotInsertHello();
+ void slotApplyConfig(%{APPNAME}ConfigPage*);
+
+private:
+ void initConfigPage( %{APPNAME}ConfigPage* );
+
+private:
+ QPtrList<class PluginView> m_views;
+};
+
+
+class %{APPNAME}ConfigPage : public Kate::PluginConfigPage
+{
+ Q_OBJECT
+ friend class KatePlugin%{APPNAME};
+
+public:
+ %{APPNAME}ConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L);
+ ~%{APPNAME}ConfigPage ();
+
+ /** Reimplemented from Kate::PluginConfigPage; just emits configPageApplyRequest( this ). */
+ virtual void apply();
+
+ virtual void reset () { ; };
+ virtual void defaults () { ; };
+
+signals:
+ /** Ask the plugin to set initial values */
+ void configPageApplyRequest( %{APPNAME}ConfigPage* );
+ /** Ask the plugin to apply changes */
+ void configPageInitRequest( %{APPNAME}ConfigPage* );
+
+private: // variables
+
+};
+
+#endif // _PLUGIN_%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.rc b/languages/cpp/app_templates/kateplugin2/plugin_app.rc
new file mode 100644
index 00000000..fe98416f
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/plugin_app.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="%{APPNAMELC}" library="lib%{APPNAMELC}plugin" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="edit_insert_%{APPNAMELC}"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="edit_insert_%{APPNAMELC}"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/cpp/app_templates/kateplugin2/src-Makefile.am b/languages/cpp/app_templates/kateplugin2/src-Makefile.am
new file mode 100644
index 00000000..2dbd9367
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/src-Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la
+
+lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp
+lib%{APPNAMELC}plugin_la_LIBADD = -lkateinterfaces
+lib%{APPNAMELC}plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+
+pluginsdir = $(kde_datadir)/kate/plugins/%{APPNAMELC}
+plugins_DATA = plugin_%{APPNAMELC}.rc
+
+kde_services_DATA = %{APPNAMELC}.desktop
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
diff --git a/languages/cpp/app_templates/kateplugin2/subdirs b/languages/cpp/app_templates/kateplugin2/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kateplugin2/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kcmodule/.kdev_ignore b/languages/cpp/app_templates/kcmodule/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/.kdev_ignore
diff --git a/languages/cpp/app_templates/kcmodule/Makefile.am b/languages/cpp/app_templates/kcmodule/Makefile.am
new file mode 100644
index 00000000..66173b12
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = module.cpp module.h module.desktop module.kdevelop \
+ src-Makefile.am kcmodule.png subdirs
+templateName = kcmodule
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate b/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate
new file mode 100644
index 00000000..c551eeb5
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/kcmodule.kdevtemplate
@@ -0,0 +1,197 @@
+# KDE Config File
+[General]
+Name=Control Center module
+Name[ca]=Mòdul per al Centre de control
+Name[da]=Kontrolcenter-modul
+Name[de]=Kontrollzentrum-Modul
+Name[el]=Άρθρωμα κέντρου ελέγχου
+Name[en_GB]=Control Centre module
+Name[es]=Módulo para el Centro de control
+Name[et]=Juhtimiskeskuse moodul
+Name[eu]=Kontrol-gunearen modulua
+Name[fa]=پیمانۀ مرکز کنترل
+Name[fr]=Module du centre de configuration
+Name[ga]=Modúl Lárionad Rialaithe
+Name[gl]=Módulo para Centro de control
+Name[hu]=KControl-beállítómodul
+Name[it]=Modulo del Centro di controllo
+Name[ja]=コントロールセンターモジュール
+Name[nds]=Kuntrullzentrum-Moduul
+Name[ne]=नियन्त्रण केन्द्र मोड्युल
+Name[nl]=Configuratiemodule
+Name[pl]=Moduł Centrum Sterowania
+Name[pt]=Módulo do Centro de Controlo
+Name[pt_BR]=Módulo do Centro de Controlo
+Name[ru]=Модуль Центра управления
+Name[sk]=Control Center modul
+Name[sl]=Modul nadzornega središča
+Name[sr]=Модул Контролног центра
+Name[sr@Latn]=Modul Kontrolnog centra
+Name[sv]=Modul i inställningscentralen
+Name[tr]=Kontrol Merkezi Birimi
+Name[zh_CN]=控制中心模块
+Name[zh_TW]=控制中心模組
+Icon=kcmodule.png
+Category=C++/KDE
+Comment=Generates a framework for a module which can be embedded into the KDE Control Center.
+Comment[ca]=Genera una infraestructura per a un mòdul que es pugui encastar al Centre de control de KDE.
+Comment[da]=Genererer et skelet for et modul som kan indlejres i KDE's kontrolcenter.
+Comment[de]=Erstellt das Gerüst für ein Modul, das in das KDE-Kontrollzentrum integriert werden kann.
+Comment[el]=Δημιουργεί ένα πλαίσιο για ένα άρθρωμα το οποίο μπορεί να ενσωματωθεί το κέντρο ελέγχου του KDE.
+Comment[en_GB]=Generates a framework for a module which can be embedded into the KDE Control Centre.
+Comment[es]=Genera una infraestructura para un módulo que se puede empotrar en el Centro de control de KDE.
+Comment[et]=Mooduli raamistiku loomine, mida saab põimida KDE juhtimiskeskusse.
+Comment[eu]=KDE-ren kontrol-gunean kapsula daitekeen modulu baten lan-marko bat sortzen du.
+Comment[fa]=چارچوبی برای پیمانه‌ای که در مرکز کنترل KDE می‌تواند نهفته شود، تولید می‌کند.
+Comment[fr]=Génère une infrastructure pour un module qui peut être intégré dans le centre de configuration de KDE.
+Comment[ga]=Cruthaigh creatlach de mhodúl is féidir leabú i Lárionad Rialaithe KDE.
+Comment[gl]=Xera un contorno de traballo para un módulo que pode incrustarse no Centro de control de KDE.
+Comment[hu]=Létrehoz egy kiindulási KDE vezérlőpult-beállítómodult
+Comment[it]=Genera l'infrastruttura per un modulo che può essere integrato nel Centro di controllo di KDE.
+Comment[ja]=KDE のコントロールセンターに取り込めるモジュールのフレームワークを作成します。
+Comment[nds]=Stellt en Rahmenwark för en Moduul op, dat sik na dat KDE-Kuntrullzentrum inbetten lett.
+Comment[ne]=केडीई नियन्त्रण केन्द्रमा सम्मिलित गर्न सकिने मोड्युलका लागि फ्रेमवर्क उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een framework voor een module die kan worden ingebed in het configuratiecentrum van KDE.
+Comment[pl]=Generuje szablon modułu, który może zostać włączony w Centrum Sterowania KDE.
+Comment[pt]=Gera a plataforma para um módulo que possa ser incorporado no Centro de Controlo do KDE.
+Comment[pt_BR]=Gera a plataforma para um módulo que possa ser incorporado no Centro de Controlo do KDE.
+Comment[ru]=Создание модуля для Центра управления KDE.
+Comment[sk]=Vygeneruje framework pre modul, ktorý môže byť vložený do KDE Control Center.
+Comment[sr]=Прави радни оквир за модул који се може уградити у Контролни центар KDE-а.
+Comment[sr@Latn]=Pravi radni okvir za modul koji se može ugraditi u Kontrolni centar KDE-a.
+Comment[sv]=Skapar ett ramverk för en modul som kan inbäddas i KDE:s inställningscentral.
+Comment[tr]=KDE Kontrol Merkezine gömülebilen bir birim için bir çatı yaratır.
+Comment[zh_CN]=生成一个可嵌入 KDE 控制中心的模块框架。
+Comment[zh_TW]=產生一個可以嵌入 KDE 控制中心的模組框架。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kcmodule.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/module.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE9]
+Type=install
+Source=%{src}/module.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/module.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/module.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/module.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A control center module was created in %{dest}
+Comment[ca]=A mòdul per al centre de control ha estat creat en %{dest}
+Comment[da]=Et kontrolcenter-modul blev oprettet i %{dest}
+Comment[de]=Ein Kontrollzentrum-Modul wurde in %{dest} erstellt.
+Comment[el]=Ένα άρθρωμα κέντρου ελέγχου δημιουργήθηκε στο %{dest}
+Comment[en_GB]=A control centre module was created in %{dest}
+Comment[es]=Un módulo para el Centro de control ha sido creado en %{dest}
+Comment[et]=Juhtimiskeskuse moodul loodi asukohta %{dest}
+Comment[eu]=Kontrol-gunearen modulu bat sortu da hemen: {dest}
+Comment[fa]=یک پیمانۀ مرکز کنترل در %{dest} ایجاد شد
+Comment[fr]=Un module du centre de configuration a été créé dans %{dest}
+Comment[ga]=Cruthaíodh modúl lárionad rialaithe i %{dest}
+Comment[gl]=Creouse un módulo para o centro de control en %{dest}
+Comment[hu]=Létrejött egy KControl-beállítómodul itt: %{dest}
+Comment[it]=È stato creato un modulo del Centro di controllo in %{dest}
+Comment[ja]=コントロールセンターのモジュールを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Kuntrullzentrum-Moduul opstellt
+Comment[ne]=नियन्त्रण केन्द्र मोड्युल %{dest} मा सिर्जना गरियो
+Comment[nl]=Een configuratiemodule is aangemaakt in %{dest}
+Comment[pl]=Moduł Centrum Sterowania został utworzony w %{dest}
+Comment[pt]=Foi criado um módulo do Centro de Controlo em %{dest}
+Comment[pt_BR]=Foi criado um módulo do Centro de Controlo em %{dest}
+Comment[ru]=Модуль Центра управления KDE создан в %{dest}
+Comment[sk]=Control center modul bol vytvorený v %{dest}
+Comment[sl]=Modul nadzornega središča je bil ustvarjen v %{dest}
+Comment[sr]=Модул Контролног центра направљен је у %{dest}
+Comment[sr@Latn]=Modul Kontrolnog centra napravljen je u %{dest}
+Comment[sv]=En modul i inställningscentralen skapades i %{dest}
+Comment[zh_CN]=在 %{dest} 中创建了一个控制中心模块
+Comment[zh_TW]=一個控制中心模組已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kcmodule/kcmodule.png b/languages/cpp/app_templates/kcmodule/kcmodule.png
new file mode 100644
index 00000000..dbab73a3
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/kcmodule.png
Binary files differ
diff --git a/languages/cpp/app_templates/kcmodule/module.cpp b/languages/cpp/app_templates/kcmodule/module.cpp
new file mode 100644
index 00000000..69e87692
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/module.cpp
@@ -0,0 +1,66 @@
+%{CPP_TEMPLATE}
+
+#include <qlayout.h>
+
+#include <klocale.h>
+#include <kglobal.h>
+#include <kparts/genericfactory.h>
+
+#include "%{APPNAMELC}.h"
+
+typedef KGenericFactory<%{APPNAME}, QWidget> %{APPNAME}Factory;
+K_EXPORT_COMPONENT_FACTORY( kcm_%{APPNAME}, %{APPNAME}Factory("kcm%{APPNAMELC}"))
+
+%{APPNAME}::%{APPNAME}(QWidget *parent, const char *name, const QStringList&)
+ : KCModule(parent, name), myAboutData(0)
+{
+ // place widgets here
+ load();
+};
+
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+
+void %{APPNAME}::load()
+{
+ // insert your loading code here...
+}
+
+
+void %{APPNAME}::defaults()
+{
+ // insert your default settings code here...
+ emit changed(true);
+}
+
+
+void %{APPNAME}::save()
+{
+ // insert your saving code here...
+ emit changed(true);
+}
+
+
+int %{APPNAME}::buttons()
+{
+ return KCModule::Default|KCModule::Apply|KCModule::Help;
+}
+
+
+void %{APPNAME}::configChanged()
+{
+ // insert your saving code here...
+ emit changed(true);
+}
+
+
+QString %{APPNAME}::quickHelp() const
+{
+ return i18n("Helpful information about the %{APPNAMELC} module.");
+}
+
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kcmodule/module.desktop b/languages/cpp/app_templates/kcmodule/module.desktop
new file mode 100644
index 00000000..662b3b2f
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/module.desktop
@@ -0,0 +1,81 @@
+[Desktop Entry]
+Exec=kcmshell %{APPNAMELC}
+Icon=misc
+Type=Application
+
+X-KDE-ModuleType=Library
+X-KDE-Library=%{APPNAMELC}
+X-KDE-HasReadOnlyMode=false
+X-KDE-ParentApp=kcontrol
+
+
+
+[Desktop Entry]
+Comment=%{APPNAME} - a kcontrol module
+Comment[br]=%{APPNAME} - ur mollad kcontrol
+Comment[ca]=%{APPNAME} - un mòdul per a kcontrol
+Comment[da]=%{APPNAME} - et kcontrol-modul
+Comment[de]=%{APPNAME} - ein KControl-Modul
+Comment[el]=%{APPNAME} - ένα άρθρωμα kcontrol
+Comment[es]=%{APPNAME} - un módulo de kcontrol
+Comment[et]=%{APPNAME} - KDE juhtimiskeskuse moodul
+Comment[eu]=%{APPNAME} - kcontrol modulu bat
+Comment[fa]=%{APPNAME} - یک پیمانۀ kcontrol
+Comment[fr]=%{APPNAME} - un module kcontrol
+Comment[ga]=%{APPNAME} - modúl kcontrol
+Comment[gl]=%{APPNAME} - un módulo de kcontrol
+Comment[hu]=%{APPNAME} - beállítómodul
+Comment[it]=%{APPNAME} - un modulo per kcontrol
+Comment[ja]=%{APPNAME} kcontrol モジュール
+Comment[nds]=%{APPNAME} - en KControl-Moduul
+Comment[ne]=%{APPNAME} - एउटा केडीई नियन्त्रण मोड्युल
+Comment[nl]=%{APPNAME} - een kcontrol module
+Comment[pl]=Moduł Centrum Sterowania dla %{APPNAME}
+Comment[pt]=%{APPNAME} - um módulo do kcontrol
+Comment[pt_BR]=%{APPNAME} - um módulo do kcontrol
+Comment[ru]=%{APPNAME} - модуль kcontrol
+Comment[sk]=%{APPNAME} - a kcontrol modul
+Comment[sl]=%{APPNAME} - modul za kcontrol
+Comment[sr]=%{APPNAME} — модул за kcontrol
+Comment[sr@Latn]=%{APPNAME} — modul za kcontrol
+Comment[sv]=%{APPNAME} - en modul i Inställningscentralen
+Comment[ta]=%{APPNAME} - ஒரு கேகன்ட்ரோல் கூறு
+Comment[tg]=%{APPNAME} - модули kcontrol
+Comment[tr]=%{APPNAME} - bir kcontrol birimi
+Comment[zh_CN]=%{APPNAME} - 一个 KDE 控制中心模块
+Comment[zh_TW]=%{APPNAME} - KDE 控制中心模組
+Keywords=%{APPNAME},%{APPNAMELC}
+Name=The %{APPNAME} Applet
+Name[br]=An arloadig %{APPNAME}
+Name[ca]=La miniaplicació %{APPNAME}
+Name[da]=%{APPNAME}-appletten
+Name[de]=Das Miniprogramm %{APPNAME}
+Name[el]=Η μικροεφαρμογή %{APPNAME}
+Name[es]=Applet %{APPNAME}
+Name[et]=%{APPNAME} aplett
+Name[eu]=%{APPNAME} applet-a
+Name[fa]=برنامک %{APPNAME}
+Name[fr]=L'applet %{APPNAME}
+Name[ga]=An Feidhmchláirín %{APPNAME}
+Name[gl]=Applet %{APPNAME}
+Name[hu]=%{APPNAME} kisalkalmazás
+Name[it]=L'applet %{APPNAME}
+Name[ja]=%{APPNAME} アプレット
+Name[nds]=Dat Lüttprogramm %{APPNAME}
+Name[ne]= %{APPNAME} एप्लेट
+Name[nl]=De %{APPNAME}-applet
+Name[pl]=Aplet %{APPNAME}
+Name[pt]='Applet' %{APPNAME}
+Name[pt_BR]=O Mini-Aplicativo %{APPNAME}
+Name[ru]=Аплет %{APPNAME}
+Name[sk]=%{APPNAME} applet
+Name[sl]=Vstavek za %{APPNAME}
+Name[sr]=%{APPNAME} аплет
+Name[sr@Latn]=%{APPNAME} aplet
+Name[sv]=Miniprogram %{APPNAME}
+Name[tr]=%{APPNAME} Küçük Uygulaması
+Name[zh_CN]=%{APPNAME} 小程序
+Name[zh_TW]=%{APPNAME} 小程式
+
+
+Categories=Qt;KDE;X-KDE-settings-components;
diff --git a/languages/cpp/app_templates/kcmodule/module.h b/languages/cpp/app_templates/kcmodule/module.h
new file mode 100644
index 00000000..cebf0f48
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/module.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#include <kcmodule.h>
+#include <kaboutdata.h>
+
+class %{APPNAME}: public KCModule
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}( QWidget *parent=0, const char *name=0, const QStringList& = QStringList() );
+ ~%{APPNAME}();
+
+ virtual void load();
+ virtual void save();
+ virtual void defaults();
+ virtual int buttons();
+ virtual QString quickHelp() const;
+ virtual const KAboutData *aboutData()const
+ { return myAboutData; };
+
+public slots:
+ void configChanged();
+
+private:
+ KAboutData *myAboutData;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kcmodule/module.kdevelop b/languages/cpp/app_templates/kcmodule/module.kdevelop
new file mode 100644
index 00000000..76412de2
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/module.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kcmodule/src-Makefile.am b/languages/cpp/app_templates/kcmodule/src-Makefile.am
new file mode 100644
index 00000000..e5d30776
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/src-Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = kcm_%{APPNAMELC}.la
+
+kcm_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp
+kcm_%{APPNAMELC}_la_LIBADD = $(LIB_KDEUI)
+kcm_%{APPNAMELC}_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined
+
+
+xdg_apps_DATA = %{APPNAMELC}.desktop
+
+
+messages: rc.cpp
+ $(EXTRACTRC) `find -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kcm%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kcmodule/subdirs b/languages/cpp/app_templates/kcmodule/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kcmodule/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kconfig35/Makefile.am b/languages/cpp/app_templates/kconfig35/Makefile.am
new file mode 100644
index 00000000..f5f8132d
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \
+ subdirs app.desktop kxt35.png appview.h appview.cpp appview_base.ui \
+ prefs-base.ui prefs.cpp prefs.h app.kcfg settings.kcfgc README \
+ src-configure.in.in
+templateName= kconfig35
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kconfig35/README b/languages/cpp/app_templates/kconfig35/README
new file mode 100644
index 00000000..527ce518
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/README
@@ -0,0 +1,90 @@
+-----------------------------------------------
+Kde templates quickstart
+Author: Thomas Nagy
+Date: 2004-03-22
+-----------------------------------------------
+
+This README file explains you basic things for starting with
+this application template.
+
+-----------------------------------------------
+--NOTE--: you need kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template.
+Qt version might be 3.3.4 or 3.3.5
+-----------------------------------------------
+
+** Building and installing **
+
+* Build the configure script by "make -f Makefile.cvs"
+
+* To clean, use "make clean", and to clean everything
+(remove the makefiles, etc), use "make distclean"
+
+* To distribute your program, try "make dist".
+This will make a compact tarball archive of your release with the
+necessary scripts inside.
+
+* Modifying the auto-tools scripts
+for automake scripts there is an excellent tutorial there :
+http://developer.kde.org/documentation/other/makefile_am_howto.html
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+./configure --prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For that, you will need to write two simple configuration files
+in the src directory : <myproject>.kcfg and a <settings>.kcfgc
+The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0)
+into #MIN_CONFIG(3.2.0)
+
+Take an example on the many apps found in the kdegames source package and consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
+
+
diff --git a/languages/cpp/app_templates/kconfig35/app.cpp b/languages/cpp/app_templates/kconfig35/app.cpp
new file mode 100644
index 00000000..e32e28b5
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/app.cpp
@@ -0,0 +1,105 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include "settings.h"
+#include "prefs.h"
+
+#include <qdragobject.h>
+
+#include <kaction.h>
+#include <kconfigdialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kprinter.h>
+#include <kstatusbar.h>
+
+%{APPNAMELC}::%{APPNAMELC}()
+ : KMainWindow( 0, "%{APPNAMELC}" ),
+ m_view(new %{APPNAMELC}View(this)),
+ m_printer(0)
+{
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KMainWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+ // and a status bar
+ statusBar()->show();
+ // then, setup our actions
+ setupActions();
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+
+ // allow the view to change the statusbar and caption
+ connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
+ this, SLOT(changeStatusbar(const QString&)));
+ connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
+ this, SLOT(changeCaption(const QString&)));
+
+}
+
+%{APPNAMELC}::~%{APPNAMELC}()
+{
+}
+
+void %{APPNAMELC}::setupActions()
+{
+ KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ // custom menu and menu item
+ KAction *custom = new KAction(i18n("Swi&tch Colors"), 0,
+ m_view, SLOT(switchColors()),
+ actionCollection(), "switch_action");
+
+ setupGUI();
+}
+
+void %{APPNAMELC}::newToolbarConfig()
+{
+ // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
+ // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
+ setupGUI();
+}
+
+void %{APPNAMELC}::optionsPreferences()
+{
+ // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow);
+ dialog->addPage(new Prefs(), i18n("General"), "package_settings");
+ connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged()));
+ dialog->show();
+}
+
+void %{APPNAMELC}::changeCaption(const QString& text)
+{
+ // display the text on the caption
+ setCaption(text);
+}
+
+void %{APPNAMELC}::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text);
+}
+
+void %{APPNAMELC}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAMELC})->show();
+}
+
+#include "%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kconfig35/app.desktop b/languages/cpp/app_templates/kconfig35/app.desktop
new file mode 100644
index 00000000..8b36e6e0
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/app.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple KDE Application
+Comment[br]=Ur meziant eeun evit KDE
+Comment[ca]=Una simple aplicació per al KDE
+Comment[da]=Et simpelt KDE program
+Comment[de]=Eine einfache KDE-Anwendung
+Comment[el]=Μια απλή εφαρμογή του KDE
+Comment[es]=Una aplicación de KDE sencilla
+Comment[et]=Lihtne KDE rakendus
+Comment[eu]=KDE aplikazio simple bat
+Comment[fa]=یک کاربرد سادۀ KDE
+Comment[fr]=Une application simple pour KDE
+Comment[ga]=Feidhmchlár Simplí KDE
+Comment[gl]=Unha aplicación KDE sinxela
+Comment[hi]=एक सादा केडीई अनुप्रयोग
+Comment[hu]=Egyszerű KDE-alkalmazás
+Comment[is]=Einfalt KDE forrit
+Comment[it]=Una semplice applicazione KDE
+Comment[ja]=簡単な KDE アプリケーション
+Comment[nds]=En eenfach KDE-Programm
+Comment[ne]=एउटा साधारण केडीई अनुप्रयोग
+Comment[nl]=Een eenvoudige KDE-toepassing
+Comment[pl]=Prosty program KDE
+Comment[pt]=Uma aplicação simples do KDE
+Comment[pt_BR]=Um simples Aplicativo do KDE
+Comment[ru]=Простое приложение KDE
+Comment[sk]=Jednoduchá KDE aplikácia
+Comment[sl]=Preprost program za KDE
+Comment[sr]=Једноставан KDE програм
+Comment[sr@Latn]=Jednostavan KDE program
+Comment[sv]=Ett enkelt KDE-program
+Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு
+Comment[tg]=Гузориши оддиKDE
+Comment[tr]=Basit bir KDE Uygulaması
+Comment[zh_CN]=一个简单的 KDE 应用程序
+Comment[zh_TW]=簡單的 KDE 應用程式
diff --git a/languages/cpp/app_templates/kconfig35/app.h b/languages/cpp/app_templates/kconfig35/app.h
new file mode 100644
index 00000000..abfd6c09
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/app.h
@@ -0,0 +1,60 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kmainwindow.h>
+
+#include "%{APPNAMELC}view.h"
+
+class KPrinter;
+class KURL;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAMELC} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAMELC}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAMELC}();
+
+private slots:
+
+ void fileNew();
+ void optionsPreferences();
+ void newToolbarConfig();
+
+ void changeStatusbar(const QString& text);
+ void changeCaption(const QString& text);
+
+private:
+
+ void setupActions();
+
+private:
+ %{APPNAMELC}View *m_view;
+
+ KPrinter *m_printer;
+};
+
+#endif // _%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/kconfig35/app.kcfg b/languages/cpp/app_templates/kconfig35/app.kcfg
new file mode 100644
index 00000000..686f25f2
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/app.kcfg
@@ -0,0 +1,21 @@
+<?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" >
+ <kcfgfile name="%{APPNAMELC}rc"/>
+ <group name="Preferences">
+ <entry name="col_background" type="Color">
+ <label>color of the background</label>
+ <default>black</default>
+ </entry>
+ <entry name="col_foreground" type="Color">
+ <label>color of the foreground</label>
+ <default>yellow</default>
+ </entry>
+ <entry name="val_time" type="Int">
+ <label>size of a ball</label>
+ <default>2</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kconfig35/app.kdevelop b/languages/cpp/app_templates/kconfig35/app.kdevelop
new file mode 100644
index 00000000..07cf3f0f
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/app.kdevelop
@@ -0,0 +1,168 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kconfig35/appui.rc b/languages/cpp/app_templates/kconfig35/appui.rc
new file mode 100644
index 00000000..06549878
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="move"><text>&amp;Move</text>
+ <Action name="switch_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kconfig35/appview.cpp b/languages/cpp/app_templates/kconfig35/appview.cpp
new file mode 100644
index 00000000..35e23682
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/appview.cpp
@@ -0,0 +1,41 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}view.h"
+#include "settings.h"
+
+#include <klocale.h>
+#include <qlabel.h>
+
+%{APPNAMELC}View::%{APPNAMELC}View(QWidget *parent)
+ : %{APPNAMELC}view_base(parent)
+{
+ settingsChanged();
+}
+
+%{APPNAMELC}View::~%{APPNAMELC}View()
+{
+
+}
+
+void %{APPNAMELC}View::switchColors()
+{
+ // switch the foreground/background colors of the label
+ QColor color = Settings::col_background();
+ Settings::setCol_background( Settings::col_foreground() );
+ Settings::setCol_foreground( color );
+
+ settingsChanged();
+}
+
+void %{APPNAMELC}View::settingsChanged()
+{
+ sillyLabel->setPaletteBackgroundColor( Settings::col_background() );
+ sillyLabel->setPaletteForegroundColor( Settings::col_foreground() );
+
+ // i18n : internationalization
+ sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) );
+ emit signalChangeStatusbar( i18n("Settings changed") );
+}
+
+#include "%{APPNAMELC}view.moc"
+
diff --git a/languages/cpp/app_templates/kconfig35/appview.h b/languages/cpp/app_templates/kconfig35/appview.h
new file mode 100644
index 00000000..45a10de7
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/appview.h
@@ -0,0 +1,52 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}VIEW_H_
+#define _%{APPNAMEUC}VIEW_H_
+
+#include <qwidget.h>
+
+#include "%{APPNAMELC}view_base.h"
+
+class QPainter;
+class KURL;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAMELC}View : public %{APPNAMELC}view_base
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAMELC}View(QWidget *parent);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAMELC}View();
+
+signals:
+ /**
+ * Use this signal to change the content of the statusbar
+ */
+ void signalChangeStatusbar(const QString& text);
+
+ /**
+ * Use this signal to change the content of the caption
+ */
+ void signalChangeCaption(const QString& text);
+
+private slots:
+ void switchColors();
+ void settingsChanged();
+};
+
+#endif // _%{APPNAMEUC}VIEW_H_
diff --git a/languages/cpp/app_templates/kconfig35/appview_base.ui b/languages/cpp/app_templates/kconfig35/appview_base.ui
new file mode 100644
index 00000000..626d95df
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/appview_base.ui
@@ -0,0 +1,33 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAMELC}view_base</class>
+<widget class="QWidget">
+<property name="name">
+<cstring>%{APPNAMELC}view_base</cstring>
+</property>
+<property name="geometry">
+<rect>
+<x>0</x>
+<y>0</y>
+<width>268</width>
+<height>164</height>
+</rect>
+</property>
+<property name="caption">
+<string>%{APPNAMELC}_base</string>
+</property>
+<grid>
+<property name="name">
+<cstring>unnamed</cstring>
+</property>
+<widget class="QLabel" row="0" column="0">
+<property name="name">
+<cstring>sillyLabel</cstring>
+</property>
+<property name="text">
+<string>hello, world</string>
+</property>
+</widget>
+</grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate
new file mode 100644
index 00000000..0aa709f4
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/kconfig35.kdevtemplate
@@ -0,0 +1,245 @@
+# KDE Config File
+[General]
+Name=KConfig XT for KDE 3.5
+Name[ca]=KConfig XT per a KDE 3.5
+Name[de]=KConfigXT-Anwendung für KDE 3.5
+Name[el]=Εφαρμογή KConfig XT για το KDE 3.5
+Name[es]=KConfig XT para KDE 3.5
+Name[et]=KConfig XT KDE 3.5 jaoks
+Name[fr]=Application KConfig XT pour KDE 3.5
+Name[hu]=KConfig XT a KDE 3.5-höz
+Name[it]=KConfig XT per KDE 3.5
+Name[ja]=KDE 3.5 用 KConfig XT
+Name[nds]=KConfig-XT-Programm för KDE 3.5
+Name[nl]=KConfig XT voor KDE 3.5
+Name[pl]=Program KConfig XT dla KDE 3.5
+Name[pt]=Aplicação do KConfig XT para o KDE 3.5
+Name[pt_BR]=Aplicação do KConfig XT para o KDE 3.5
+Name[ru]=Приложение KDE 3.5 с KConfig XT
+Name[sk]=KConfig XT pre KDE 3.5
+Name[sr]=KConfig XT програм за KDE 3.5
+Name[sr@Latn]=KConfig XT program za KDE 3.5
+Name[sv]=KConfig XT för KDE 3.5
+Name[zh_TW]=KDE 3.5 的 KConfig XT 應用程式
+Category=C++/KDE
+Icon=kxt.png
+Comment=Generates a simple KDE application with one widget and a configuration dialog compatible with KDE 3.5 only
+Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració compatible només amb KDE 3.5.
+Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog der kun er kompatibelt med KDE 3.5
+Comment[de]=Erstellt eine einfache KDE-Anwendung für KDE 3.5 mit einem Widget und einem Einstellungsdialog.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης συμβατό μόνο με το KDE 3.5
+Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue compatible with KDE 3.5 only
+Comment[es]=Genera una sencilla aplicación para KDE con un widget y un diálogo de configuración compatible solo con KDE 3.5
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja vaid KDE 3.5-ga ühilduva seadistustedialoogiga.
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique et une boîte de dialogue de configuration compatible avec KDE 3.5 uniquement
+Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal, csak a KDE 3.5-tel kompatibilis
+Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione compatibile solo con KDE 3.5
+Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します (KDE 3.5 用)
+Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op, de bloots mit KDE 3.5 kompatibel is.
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog die alleen met KDE 3.5 compatible is
+Comment[pl]=Generuje prosty program KDE z jednym widżetem i oknem konfiguracyjnym zgodnym z KDE 3.5
+Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração, apenas para o KDE 3.5
+Comment[ru]=Создание простого приложения KDE с одним виджетом и диалогом конфигурации, совместимое только с KDE 3.5.
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom kompatibilnú len s KDE 3.5
+Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање, компатибилан само са KDE-ом 3.5
+Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje, kompatibilan samo sa KDE-om 3.5
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta, som bara fungerar med KDE 3.5
+Comment[zh_TW]=產生一個簡單的 KDE 3.5 上的應用程式,內含一個元件與一個設定對話框。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp,%{dest}/README
+Archive=kconfig35.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE17]
+Type=install
+EscapeXML=true
+Source=%{src}/appview_base.ui
+Dest=%{dest}/src/%{APPNAMELC}view_base.ui
+
+[FILE18]
+Type=install
+Source=%{src}/appview.cpp
+Dest=%{dest}/src/%{APPNAMELC}view.cpp
+
+[FILE19]
+Type=install
+Source=%{src}/appview.h
+Dest=%{dest}/src/%{APPNAMELC}view.h
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/prefs-base.ui
+Dest=%{dest}/src/prefs-base.ui
+
+[FILE21]
+Type=install
+Source=%{src}/prefs.cpp
+Dest=%{dest}/src/prefs.cpp
+
+[FILE22]
+Type=install
+Source=%{src}/prefs.h
+Dest=%{dest}/src/prefs.h
+
+[FILE23]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE24]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE25]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/README
+
+[FILE26]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE27]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[FILE28]
+Type=install
+Source=%{src}/src-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MSG]
+Type=message
+Comment=A KDE 3.5 KConfig XT application was created in %{dest}
+Comment[ca]=Una aplicació KConfig XT per al KDE ha estat creada en %{dest}
+Comment[da]=Et KDE 3.5 KConfig XT-program blev oprettet i %{dest}
+Comment[de]=Eine KConfig-XT-Anwendung für KDE 3.5 wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KConfig XT του KDE 3.5 δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación KConfig XT para KDE 3.5 ha sido creada en %{dest}
+Comment[et]=KDE 3.5 KConfig XT rakendus loodi asukohta %{dest}
+Comment[fr]=Une application KConfig XT pour KDE 3.5 a été créée dans %{dest}
+Comment[hu]=Létrejött egy KConfig XT-alapú KDE 3.5-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KConfig XT per KDE 3.5 in %{dest}
+Comment[ja]=KDE 3.5 用 KConfig XT アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KConfig-XT-Programm för KDE 3.5 opstellt
+Comment[nl]=Een KDE 3.5 KConfig XT-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program KConfig XT dla KDE 3.5 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KConfig XT para o KDE 3.5 em %{dest}
+Comment[ru]=Приложение KDE с KConfig XT создано в %{dest}
+Comment[sk]=KConfig XT pre KDE 3.5 bola vytvorená v %{dest}
+Comment[sr]=KConfig XT програм за KDE 3.5 направљен је у %{dest}
+Comment[sr@Latn]=KConfig XT program za KDE 3.5 napravljen je u %{dest}
+Comment[sv]=Ett KDE 3.5 KConfig XT-program skapades i %{dest}
+Comment[zh_TW]=一個 KDE 3.5 上的 KConfig XT 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kconfig35/kconfig35.png b/languages/cpp/app_templates/kconfig35/kconfig35.png
new file mode 100644
index 00000000..a3866883
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/kconfig35.png
Binary files differ
diff --git a/languages/cpp/app_templates/kconfig35/kxt35.png b/languages/cpp/app_templates/kconfig35/kxt35.png
new file mode 100644
index 00000000..a3866883
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/kxt35.png
Binary files differ
diff --git a/languages/cpp/app_templates/kconfig35/main.cpp b/languages/cpp/app_templates/kconfig35/main.cpp
new file mode 100644
index 00000000..66f038c9
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/main.cpp
@@ -0,0 +1,57 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAMELC});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count() == 0)
+ {
+ %{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++)
+ {
+ %{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kconfig35/prefs-base.ui b/languages/cpp/app_templates/kconfig35/prefs-base.ui
new file mode 100644
index 00000000..5c0fc860
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/prefs-base.ui
@@ -0,0 +1,127 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Prefs_base</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Prefs_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>282</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Background color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_col_background</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Project age:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Foreground color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_col_foreground</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="0" 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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_val_time</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/app_templates/kconfig35/prefs.cpp b/languages/cpp/app_templates/kconfig35/prefs.cpp
new file mode 100644
index 00000000..e7a46ddf
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/prefs.cpp
@@ -0,0 +1,12 @@
+%{CPP_TEMPLATE}
+
+#include "prefs.h"
+#include <kdebug.h>
+
+Prefs::Prefs()
+ : Prefs_base()
+{
+// debugging :
+// kdWarning()<<"creating a pref dialog"<<endl;
+}
+
diff --git a/languages/cpp/app_templates/kconfig35/prefs.h b/languages/cpp/app_templates/kconfig35/prefs.h
new file mode 100644
index 00000000..9106fe59
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/prefs.h
@@ -0,0 +1,11 @@
+%{H_TEMPLATE}
+
+#include "prefs-base.h"
+
+
+class Prefs : public Prefs_base
+{
+ public:
+ Prefs();
+};
+
diff --git a/languages/cpp/app_templates/kconfig35/settings.kcfgc b/languages/cpp/app_templates/kconfig35/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kconfig35/src-Makefile.am b/languages/cpp/app_templates/kconfig35/src-Makefile.am
new file mode 100644
index 00000000..5f7936da
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/src-Makefile.am
@@ -0,0 +1,41 @@
+## Makefile.am for %{APPNAMELC}
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+
+# the libraries to link against.
+%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT)
+
+# which sources should be compiled for %{APPNAMELC}
+%{APPNAMELC}_SOURCES = settings.kcfgc main.cpp %{APPNAMELC}.cpp %{APPNAMELC}view.cpp \
+ %{APPNAMELC}view_base.ui prefs-base.ui prefs.cpp
+
+xdg_apps_DATA = %{APPNAMELC}.desktop
+kde_kcfg_DATA = %{APPNAMELC}.kcfg
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}view.h prefs.h
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
diff --git a/languages/cpp/app_templates/kconfig35/src-configure.in.in b/languages/cpp/app_templates/kconfig35/src-configure.in.in
new file mode 100644
index 00000000..61d4a7fd
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/src-configure.in.in
@@ -0,0 +1,7 @@
+
+#MIN_CONFIG(3.2.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
diff --git a/languages/cpp/app_templates/kconfig35/subdirs b/languages/cpp/app_templates/kconfig35/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kconfig35/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kde4app/CMakeLists.txt b/languages/cpp/app_templates/kde4app/CMakeLists.txt
new file mode 100644
index 00000000..2544a271
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/CMakeLists.txt
@@ -0,0 +1,31 @@
+project(%{APPNAME})
+find_package(KDE4 REQUIRED)
+include (KDE4Defaults)
+include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
+
+set(%{APPNAMELC}_SRCS
+ %{APPNAMELC}.cpp
+ main.cpp
+ %{APPNAMELC}view.cpp
+ )
+
+#kde4_automoc(${%{APPNAMELC}_SRCS})
+
+kde4_add_ui_files(%{APPNAMELC}_SRCS %{APPNAMELC}view_base.ui prefs_base.ui)
+
+kde4_add_kcfg_files(%{APPNAMELC}_SRCS settings.kcfgc )
+
+kde4_add_executable(%{APPNAMELC} ${%{APPNAMELC}_SRCS})
+
+target_link_libraries(%{APPNAMELC} ${KDE4_KDEUI_LIBS} )
+
+install(TARGETS %{APPNAMELC} DESTINATION ${BIN_INSTALL_DIR} )
+
+
+########### install files ###############
+
+install( FILES %{APPNAMELC}.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+install( FILES %{APPNAMELC}.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
+install( FILES %{APPNAMELC}ui.rc DESTINATION ${DATA_INSTALL_DIR}/%{APPNAMELC} )
+
+
diff --git a/languages/cpp/app_templates/kde4app/Makefile.am b/languages/cpp/app_templates/kde4app/Makefile.am
new file mode 100644
index 00000000..2b39fcb4
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = kapp4.cpp kapp4.h prefs_base.ui kapp4view.cpp kapp4view.h kapp4view_base.ui \
+ main.cpp kde4appui.rc CMakeLists.txt kapp4.desktop kapp4.kcfg settings.kcfgc \
+ kde4app.png README kde4app.kdevelop kde4app.kdevelop.filelist
+
+templateName = kde4app
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kde4app/README b/languages/cpp/app_templates/kde4app/README
new file mode 100644
index 00000000..a5f3a307
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/README
@@ -0,0 +1,15 @@
+!!!!!ATTENTION!!!!!
+
+Before starting the build you may need to setup the KDE4 environment variables.
+To do this open Project->Project Options and then look at the "Run" and the "Make"
+pages. Each of these two has an environment variables widget in which you have
+to fill in the right values for the variables already listed.
+
+After setting up the variables you'll also need to run cmake inside the build
+directory. This can not be done by kdevelop as a KDE4 environment is needed
+when running cmake to find KDE4. Open the integrated konsole and change to the build
+subdirectory. Then setup a KDE4 environment and run "cmake ../".
+
+More information how to setup a KDE4 development environment can be found on
+http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts
+
diff --git a/languages/cpp/app_templates/kde4app/kapp4.cpp b/languages/cpp/app_templates/kde4app/kapp4.cpp
new file mode 100644
index 00000000..c11a58d1
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4.cpp
@@ -0,0 +1,90 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include "%{APPNAMELC}view.h"
+#include "settings.h"
+
+#include <QtGui/QDropEvent>
+#include <QtGui/QPainter>
+
+#include <kconfigdialog.h>
+#include <kstatusbar.h>
+
+#include <kaction.h>
+#include <kactioncollection.h>
+#include <kstandardaction.h>
+
+#include <KDE/KLocale>
+
+%{APPNAME}::%{APPNAME}()
+ : KXmlGuiWindow(),
+ m_view(new %{APPNAME}View(this)),
+ m_printer(0)
+{
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KXmlGuiWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+
+ // then, setup our actions
+ setupActions();
+
+ // add a status bar
+ statusBar()->show();
+
+ // a call to KXmlGuiWindow::setupGUI() populates the GUI
+ // with actions, using KXMLGUI.
+ // It also applies the saved mainwindow settings, if any, and ask the
+ // mainwindow to automatically save settings if changed: window size,
+ // toolbar position, icon size, etc.
+ setupGUI();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+void %{APPNAME}::setupActions()
+{
+ KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStandardAction::quit(qApp, SLOT(quit()), actionCollection());
+
+ KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ // custom menu and menu item - the slot is in the class %{APPNAME}View
+ KAction *custom = new KAction(KIcon("colorize"), i18n("Swi&tch Colors"), this);
+ actionCollection()->addAction( QLatin1String("switch_action"), custom );
+ connect(custom, SIGNAL(triggered(bool)), m_view, SLOT(switchColors()));
+}
+
+void %{APPNAME}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAME})->show();
+}
+
+void %{APPNAME}::optionsPreferences()
+{
+ // The preference dialog is derived from prefs_base.ui
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ //avoid to have 2 dialogs shown
+ if ( KConfigDialog::showDialog( "settings" ) ) {
+ return;
+ }
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self());
+ QWidget *generalSettingsDlg = new QWidget;
+ ui_prefs_base.setupUi(generalSettingsDlg);
+ dialog->addPage(generalSettingsDlg, i18n("General"), "package_setting");
+ connect(dialog, SIGNAL(settingsChanged(QString)), m_view, SLOT(settingsChanged()));
+ dialog->setAttribute( Qt::WA_DeleteOnClose );
+ dialog->show();
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kde4app/kapp4.desktop b/languages/cpp/app_templates/kde4app/kapp4.desktop
new file mode 100644
index 00000000..008fad44
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4.desktop
@@ -0,0 +1,30 @@
+[Desktop Entry]
+Name=KApp4
+Name[nds]=KProg4
+Name[sv]=KDE 4-program
+Name[zh_TW]=KApp4 程式
+Exec=kapp4 %i -caption "%c"
+Icon=kapp4
+Type=Application
+X-DocPath=kapp4/kapp4.html
+GenericName=A KDE4 Application
+GenericName[ca]=Una aplicació del KDE4
+GenericName[da]=Et KDE4-program
+GenericName[de]=Eine KDE 4-Anwendung
+GenericName[el]=Μία εφαρμογή του KDE4
+GenericName[es]=Una aplicación para KDE4
+GenericName[et]=KDE4 rakendus
+GenericName[hu]=KDE4-alapú alkalmazás
+GenericName[it]=Applicazione KDE4
+GenericName[nds]=En KDE4-Programm
+GenericName[nl]=Een KDE4-programma
+GenericName[pl]=Program dla KDE4
+GenericName[pt]=Uma Aplicação do KDE4
+GenericName[pt_BR]=Uma Aplicação do KDE4
+GenericName[ru]=Приложение KDE 4
+GenericName[sk]=KDE4 aplikácia
+GenericName[sr]=KDE4 програм
+GenericName[sr@Latn]=KDE4 program
+GenericName[sv]=Ett KDE 4-program
+GenericName[zh_TW]=KDE4 應用程式
+Terminal=false
diff --git a/languages/cpp/app_templates/kde4app/kapp4.h b/languages/cpp/app_templates/kde4app/kapp4.h
new file mode 100644
index 00000000..fb059fde
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4.h
@@ -0,0 +1,53 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+
+#include <kxmlguiwindow.h>
+
+#include "ui_prefs_base.h"
+
+class %{APPNAME}View;
+class KPrinter;
+class KToggleAction;
+class KUrl;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author Andreas Pakulat <apaku@gmx.de>
+ * @version 0.1
+ */
+class %{APPNAME} : public KXmlGuiWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+
+private slots:
+ void fileNew();
+ void optionsPreferences();
+
+private:
+ void setupActions();
+
+private:
+ Ui::prefs_base ui_prefs_base ;
+ %{APPNAME}View *m_view;
+
+ KPrinter *m_printer;
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+};
+
+#endif // _%{APPNAMELC}_H_
diff --git a/languages/cpp/app_templates/kde4app/kapp4.kcfg b/languages/cpp/app_templates/kde4app/kapp4.kcfg
new file mode 100644
index 00000000..6040f769
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4.kcfg
@@ -0,0 +1,21 @@
+<?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" >
+ <kcfgfile name="%{APPNAMELC}rc"/>
+ <group name="Preferences">
+ <entry name="col_background" type="Color">
+ <label>color of the background</label>
+ <default>black</default>
+ </entry>
+ <entry name="col_foreground" type="Color">
+ <label>color of the foreground</label>
+ <default>yellow</default>
+ </entry>
+ <entry name="val_time" type="Int">
+ <label>size of a ball</label>
+ <default>2</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kde4app/kapp4view.cpp b/languages/cpp/app_templates/kde4app/kapp4view.cpp
new file mode 100644
index 00000000..256f6bcb
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4view.cpp
@@ -0,0 +1,42 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}view.h"
+#include "settings.h"
+
+#include <klocale.h>
+#include <QtGui/QLabel>
+
+%{APPNAME}View::%{APPNAME}View(QWidget *)
+{
+ ui_%{APPNAMELC}view_base.setupUi(this);
+ settingsChanged();
+ setAutoFillBackground(true);
+}
+
+%{APPNAME}View::~%{APPNAME}View()
+{
+
+}
+
+void %{APPNAME}View::switchColors()
+{
+ // switch the foreground/background colors of the label
+ QColor color = Settings::col_background();
+ Settings::setCol_background( Settings::col_foreground() );
+ Settings::setCol_foreground( color );
+
+ settingsChanged();
+}
+
+void %{APPNAME}View::settingsChanged()
+{
+ QPalette pal;
+ pal.setColor( QPalette::Window, Settings::col_background());
+ pal.setColor( QPalette::WindowText, Settings::col_foreground());
+ ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setPalette( pal );
+
+ // i18n : internationalization
+ ui_%{APPNAMELC}view_base.kcfg_sillyLabel->setText( i18n("This project is %1 days old",Settings::val_time()) );
+ emit signalChangeStatusbar( i18n("Settings changed") );
+}
+
+#include "%{APPNAMELC}view.moc"
diff --git a/languages/cpp/app_templates/kde4app/kapp4view.h b/languages/cpp/app_templates/kde4app/kapp4view.h
new file mode 100644
index 00000000..ab08445f
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4view.h
@@ -0,0 +1,55 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMELC}VIEW_H
+#define %{APPNAMELC}VIEW_H
+
+#include <QtGui/QWidget>
+
+#include "ui_%{APPNAMELC}view_base.h"
+
+class QPainter;
+class KUrl;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+
+class %{APPNAME}View : public QWidget, public Ui::%{APPNAMELC}view_base
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAME}View(QWidget *parent);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAME}View();
+
+private:
+ Ui::%{APPNAMELC}view_base ui_%{APPNAMELC}view_base;
+
+signals:
+ /**
+ * Use this signal to change the content of the statusbar
+ */
+ void signalChangeStatusbar(const QString& text);
+
+ /**
+ * Use this signal to change the content of the caption
+ */
+ void signalChangeCaption(const QString& text);
+
+private slots:
+ void switchColors();
+ void settingsChanged();
+};
+
+#endif // %{APPNAME}VIEW_H
diff --git a/languages/cpp/app_templates/kde4app/kapp4view_base.ui b/languages/cpp/app_templates/kde4app/kapp4view_base.ui
new file mode 100644
index 00000000..eb6a254a
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kapp4view_base.ui
@@ -0,0 +1,213 @@
+<ui version="4.0" >
+<class>%{APPNAMELC}view_base</class>
+<widget class="QWidget" name="%{APPNAMELC}view_base" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>315</width>
+ <height>233</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>%{APPNAMELC}_base</string>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>11</number>
+ </property>
+ <property name="topMargin" >
+ <number>11</number>
+ </property>
+ <property name="rightMargin" >
+ <number>11</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>11</number>
+ </property>
+ <property name="horizontalSpacing" >
+ <number>6</number>
+ </property>
+ <property name="verticalSpacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="kcfg_sillyLabel" >
+ <property name="palette" >
+ <palette>
+ <active>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </active>
+ <inactive>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>255</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </inactive>
+ <disabled>
+ <colorrole role="WindowText" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>119</red>
+ <green>119</green>
+ <blue>119</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Button" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Base" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="Window" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ <colorrole role="AlternateBase" >
+ <brush brushstyle="SolidPattern" >
+ <color alpha="255" >
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </brush>
+ </colorrole>
+ </disabled>
+ </palette>
+ </property>
+ <property name="font" >
+ <font>
+ <family>Sans Serif</family>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground" >
+ <bool>true</bool>
+ </property>
+ <property name="text" >
+ <string>hello, world</string>
+ </property>
+ <property name="scaledContents" >
+ <bool>true</bool>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop b/languages/cpp/app_templates/kde4app/kde4app.kdevelop
new file mode 100644
index 00000000..d36a9536
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop
@@ -0,0 +1,205 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectname>%{APPNAMELC}</projectname>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>%{dest}/build/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>false</autocompile>
+ <envvars>
+ <envvar value="" name="KDEDIRS" />
+ <envvar value="" name="KDEHOME" />
+ <envvar value="" name="LD_LIBRARY_PATH" />
+ <envvar value="" name="PATH" />
+ <envvar value="" name="PKG_CONFIG_PATH" />
+ <envvar value="" name="QT_PLUGIN_PATH" />
+ </envvars>
+ <autoinstall>false</autoinstall>
+ <autokdesu>false</autokdesu>
+ <globaldebugarguments/>
+ <useglobalprogram>true</useglobalprogram>
+ <globalcwd>%{dest}</globalcwd>
+ <directoryradio>executable</directoryradio>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir>%{dest}/build</builddir>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin>make</makebin>
+ <defaulttarget/>
+ <makeoptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default>
+ <envvar value="" name="KDEDIRS" />
+ <envvar value="" name="KDEHOME" />
+ <envvar value="" name="LD_LIBRARY_PATH" />
+ <envvar value="" name="PATH" />
+ <envvar value="" name="PKG_CONFIG_PATH" />
+ <envvar value="" name="QT_PLUGIN_PATH" />
+ </default>
+ </environments>
+ </make>
+ <filetypes>
+ <filetype>*.h</filetype>
+ <filetype>*.cpp</filetype>
+ <filetype>CMakeLists.txt</filetype>
+ <filetype>*.desktop</filetype>
+ <filetype>*.kcfg*</filetype>
+ <filetype>*.ui</filetype>
+ <filetype>Doxyfile</filetype>
+ <filetype>*.dox</filetype>
+ <filetype>*.rc</filetype>
+ <filetype>*.cmake</filetype>
+ </filetypes>
+ <other>
+ <prio>0</prio>
+ <otherbin/>
+ <defaulttarget/>
+ <otheroptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </other>
+ <blacklist>
+ <path>build</path>
+ </blacklist>
+ </kdevcustomproject>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>4</version>
+ <includestyle>4</includestyle>
+ <designerintegration>ExternalDesigner</designerintegration>
+ <designer>/usr/bin/designer-qt4</designer>
+ <root>/usr/lib/qt4</root>
+ </qt>
+ </kdevcppsupport>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist
new file mode 100644
index 00000000..5235563f
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kde4app.kdevelop.filelist
@@ -0,0 +1,13 @@
+# KDevelop Custom Project File List
+CMakeLists.txt
+main.cpp
+prefs_base.ui
+settings.kcfgc
+%{APPNAMELC}.cpp
+%{APPNAMELC}.desktop
+%{APPNAMELC}.h
+%{APPNAMELC}.kcfg
+%{APPNAMELC}ui.rc
+%{APPNAMELC}view.cpp
+%{APPNAMELC}view.h
+%{APPNAMELC}view_base.ui
diff --git a/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate
new file mode 100644
index 00000000..2a7269fd
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kde4app.kdevtemplate
@@ -0,0 +1,155 @@
+# KDE Config File
+[General]
+Name=KDE4 Application framework
+Name[ca]=Entorn de treball d'aplicacions pel KDE4
+Name[da]=KDE4 program-framework
+Name[de]=KDE 4-Anwendungsgrundgerüst
+Name[el]=Πλαίσιο εφαρμογής του KDE4
+Name[es]=Infraestructura de aplicación para KDE4
+Name[et]=KDE4 rakenduse raamistik
+Name[hu]=Keretrendszer KDE4-alapú alkalmazáshoz
+Name[it]=Infrastruttura per applicazioni KDE4
+Name[nds]=KDE4-Programmrahmenwark
+Name[nl]=KDE4-programmaframewerk
+Name[pl]=Szablon programu dla KDE4
+Name[pt]=Plataforma de aplicações do KDE4
+Name[pt_BR]=Plataforma de aplicações do KDE4
+Name[ru]=Инструментарий для создания приложений KDE 4
+Name[sk]=KDE4 aplikačný framework
+Name[sr]=Радни оквир KDE4 програма
+Name[sr@Latn]=Radni okvir KDE4 programa
+Name[sv]=KDE 4-programramverk
+Name[zh_TW]=KDE4 應用程式框架
+Icon=kde4app.png
+Category=C++/KDE4
+Comment=Generates a simple KDE4 application with one toplevel window, menus and toolbars.
+Comment[ca]=Genera una aplicació senzilla per al KDE4 amb una finestra principal, menús i barres d'eines.
+Comment[da]=Genererer et simpelt KDE4-program med et vindue på topniveau, menuer og værktøjslinjer.
+Comment[de]=Erstellt eine einfache KDE 4-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή του KDE4 με ένα ανώτερο παράθυρο, μενού, και γραμμές εργαλείων.
+Comment[es]=Genera una sencilla aplicación para KDE4 con una ventana principal, menús y barras de herramientas.
+Comment[et]=Lihtsa KDE4 rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega.
+Comment[hu]=Létrehoz egy egyszerű KDE4-alkalmazást egy főablakkal, menükkel és eszköztárakkal.
+Comment[it]=Genera una semplice applicazione KDE4 con una finestra toplevel, menu e barre degli strumenti.
+Comment[nds]=Stellt en eenfach KDE4-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op.
+Comment[nl]=Genereert een eenvoudig KDE4-programma met een topniveauvenster, menu's en werkbalken.
+Comment[pl]=Generuje prosty program dla KDE4 posiadający okno, menu i paski narzędzi.
+Comment[pt]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas.
+Comment[pt_BR]=Gera uma aplicação para KDE4 simples, com uma janela de topo, menus e barras de ferramentas.
+Comment[ru]=Создание простого приложения KDE 4 с одним окном верхнего уровня, меню и панелями инструментов.
+Comment[sk]=Vygeneruje jednoduchú KDE4 aplikáciu s jedným oknom, menu a panelom nástrojov.
+Comment[sr]=Прави једноставан KDE4 програм са једним прозором највишег нивоа, менијима и тракама са алатом.
+Comment[sr@Latn]=Pravi jednostavan KDE4 program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom.
+Comment[sv]=Skapar ett enkelt KDE 4-program med ett toppnivåfönster, menyer och verktygsrader.
+Comment[zh_TW]=產生一個簡單的 KDE4 應用程式,內含頂層視窗、選單與工具列。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/README
+Archive=kde4app.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/CMakeLists.txt
+Dest=%{dest}/CMakeLists.txt
+
+[FILE2]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/main.cpp
+
+[FILE3]
+Type=install
+Source=%{src}/kapp4.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE4]
+Type=install
+Source=%{src}/kapp4.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[FILE5]
+Type=install
+Source=%{src}/kapp4view.cpp
+Dest=%{dest}/%{APPNAMELC}view.cpp
+
+
+[FILE6]
+Type=install
+Source=%{src}/kapp4view.h
+Dest=%{dest}/%{APPNAMELC}view.h
+
+
+[FILE7]
+Type=install
+Source=%{src}/kde4appui.rc
+Dest=%{dest}/%{APPNAMELC}ui.rc
+
+
+[FILE8]
+Type=install
+Source=%{src}/kapp4view_base.ui
+Dest=%{dest}/%{APPNAMELC}view_base.ui
+
+
+[FILE9]
+Type=install
+Source=%{src}/kapp4.desktop
+Dest=%{dest}/%{APPNAMELC}.desktop
+
+[FILE10]
+Type=install
+Source=%{src}/kapp4.kcfg
+Dest=%{dest}/%{APPNAMELC}.kcfg
+
+
+[FILE11]
+Type=install
+Source=%{src}/prefs_base.ui
+Dest=%{dest}/prefs_base.ui
+
+
+[FILE12]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/settings.kcfgc
+
+[FILE13]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/README
+
+[FILE14]
+Type=install
+Source=%{src}/kde4app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE15]
+Type=install
+Source=%{src}/kde4app.kdevelop.filelist
+Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist
+
+[MKDIR1]
+Type=mkdir
+Dir=%{dest}/build
+
+[MSG]
+Type=message
+Comment=A KDE4 Application was created at %{dest}
+Comment[ca]=S'ha creat una aplicació per al KDE4 a %{dest}
+Comment[da]=Et KDE4-program blev oprettet i %{dest}
+Comment[de]=Eine KDE 4-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE4 δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para KDE4 ha sido creada en %{dest}
+Comment[et]=KDE4 rakendus loodi asukohta %{dest}
+Comment[hu]=Létrejött egy KDE4-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE4 in %{dest}
+Comment[nds]=In %{dest} wöör en KDE4-Programm opstellt
+Comment[nl]=Een KDE4-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program dla KDE4 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE4 em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE4 em %{dest}
+Comment[ru]=Приложение KDE 4 создано в %{dest}
+Comment[sk]=KDE4 aplikácia bola vytvorená v %{dest}
+Comment[sr]=KDE4 програм је направљен у %{dest}
+Comment[sr@Latn]=KDE4 program je napravljen u %{dest}
+Comment[sv]=Ett KDE 4-program skapades i %{dest}
+Comment[zh_TW]=一個 KDE4 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kde4app/kde4app.png b/languages/cpp/app_templates/kde4app/kde4app.png
new file mode 100644
index 00000000..a421a664
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kde4app.png
Binary files differ
diff --git a/languages/cpp/app_templates/kde4app/kde4appui.rc b/languages/cpp/app_templates/kde4app/kde4appui.rc
new file mode 100644
index 00000000..406bccc6
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/kde4appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KApp4" version="1">
+<MenuBar>
+ <Menu name="move"><text>&amp;Move</text>
+ <Action name="switch_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kde4app/main.cpp b/languages/cpp/app_templates/kde4app/main.cpp
new file mode 100644
index 00000000..2bb5b6bf
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/main.cpp
@@ -0,0 +1,55 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <KDE/KLocale>
+
+static const char description[] =
+ I18N_NOOP("A KDE 4 Application");
+
+static const char version[] = "%{VERSION}";
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", 0, ki18n("%{APPNAME}"), version, ki18n(description),
+ KAboutData::License_%{LICENSE}, ki18n("(C) %{YEAR} %{AUTHOR}"), KLocalizedString(), 0, "%{EMAIL}");
+ about.addAuthor( ki18n("%{AUTHOR}"), KLocalizedString(), "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+
+ KCmdLineOptions options;
+ options.add("+[URL]", ki18n( "Document to open" ));
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+
+ %{APPNAME} *widget = new %{APPNAME};
+
+ // see if we are starting with session management
+ if (app.isSessionRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count() == 0)
+ {
+ //%{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++)
+ {
+ //%{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
diff --git a/languages/cpp/app_templates/kde4app/prefs_base.ui b/languages/cpp/app_templates/kde4app/prefs_base.ui
new file mode 100644
index 00000000..ea400f02
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/prefs_base.ui
@@ -0,0 +1,155 @@
+<ui version="4.0" >
+ <class>prefs_base</class>
+ <widget class="QWidget" name="prefs_base" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>282</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="textLabel2_2" >
+ <property name="text" >
+ <string>Background color:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="KColorButton" name="kcfg_col_background" >
+ <property name="toolTip" >
+ <string>Choose a new background color</string>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the &lt;span style=" font-weight:600;">background&lt;/span> color by clicking here and choose the new &lt;span style=" color:#ff0000;">color&lt;/span> in the &lt;span style=" font-style:italic;">color dialog&lt;/span>.&lt;/p>&lt;/body>&lt;/html></string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="textLabel1" >
+ <property name="text" >
+ <string>Project age:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="textLabel2" >
+ <property name="text" >
+ <string>Foreground color:</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="KColorButton" name="kcfg_col_foreground" >
+ <property name="toolTip" >
+ <string>Choose a new foreground color</string>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Change the &lt;span style=" font-weight:600;">foreground&lt;/span> color by clicking here and choose the new &lt;span style=" color:#ff0000;">color&lt;/span> in the &lt;span style=" font-style:italic;">color dialog&lt;/span>.&lt;/p>&lt;/body>&lt;/html></string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="kcfg_val_time" >
+ <property name="toolTip" >
+ <string>Set the project age (in days)</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Change the project age (in days) by choosing a new number of days.</string>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="value" >
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <customwidgets>
+ <customwidget>
+ <class>KColorButton</class>
+ <extends>QPushButton</extends>
+ <header>kcolorbutton.h</header>
+ </customwidget>
+ </customwidgets>
+ <includes>
+ <include location="local" >kcolorbutton.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/languages/cpp/app_templates/kde4app/settings.kcfgc b/languages/cpp/app_templates/kde4app/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kde4app/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kdecpp.appwizard b/languages/cpp/app_templates/kdecpp.appwizard
new file mode 100644
index 00000000..aa36123a
--- /dev/null
+++ b/languages/cpp/app_templates/kdecpp.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=kdedcop,kioslave,kxt,kdevlang,kmake,kapp,kconfig35,kdevlang,kdevpart,kateplugin,kdevpart2,kopart,noatunui,kateplugin2,kfileplugin,konqnavpanel,noatunvisual,dcopservice,khello,kpartapp,khello2,kpartplugin,kcmodule,kicker,kscreensaver,kscons_kxt,kscons_kmdi
diff --git a/languages/cpp/app_templates/kdedcop/.kdev_ignore b/languages/cpp/app_templates/kdedcop/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/.kdev_ignore
diff --git a/languages/cpp/app_templates/kdedcop/Makefile.am b/languages/cpp/app_templates/kdedcop/Makefile.am
new file mode 100644
index 00000000..87697fcd
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = app.cpp app.h app_iface.h app.kdevelop main.cpp mainclass.cpp \
+ mainclass.h kdedcop.png src-Makefile.am subdirs
+
+templateName = kdedcop
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kdedcop/app.cpp b/languages/cpp/app_templates/kdedcop/app.cpp
new file mode 100644
index 00000000..e295253a
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/app.cpp
@@ -0,0 +1,21 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+
+#include <qlabel.h>
+
+#include <kmainwindow.h>
+#include <klocale.h>
+
+%{APPNAME}::%{APPNAME}()
+ : KMainWindow( 0, "%{APPNAME}" )
+{
+ m_mainClass = new MainClass();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+ if (m_mainClass) delete m_mainClass;
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kdedcop/app.h b/languages/cpp/app_templates/kdedcop/app.h
new file mode 100644
index 00000000..b908b62c
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/app.h
@@ -0,0 +1,36 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kmainwindow.h>
+
+#include "mainclass.h"
+
+/**
+ * @short Application Main Window
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version 0.1
+ */
+class %{APPNAME} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+private:
+ MainClass *m_mainClass;
+};
+
+#endif // _%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/kdedcop/app.kdevelop b/languages/cpp/app_templates/kdedcop/app.kdevelop
new file mode 100644
index 00000000..496a3838
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/app.kdevelop
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>DCOP</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kdedcop/app_iface.h b/languages/cpp/app_templates/kdedcop/app_iface.h
new file mode 100644
index 00000000..57bfb059
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/app_iface.h
@@ -0,0 +1,19 @@
+%{H_TEMPLATE}
+
+#include <dcopobject.h>
+
+class DCOPDemoIface : virtual public DCOPObject
+{
+ K_DCOP
+ k_dcop:
+
+
+ // Here you should place your DCOP interface.
+ // Below are four example methods.
+ virtual QString strVal() const = 0;
+ virtual int intVal() const = 0;
+
+ virtual void setIntVal( int num ) = 0;
+ virtual void setStrVal( const QString &str ) = 0;
+
+};
diff --git a/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate b/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate
new file mode 100644
index 00000000..99f6e28d
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/kdedcop.kdevtemplate
@@ -0,0 +1,227 @@
+# KDE Config File
+[General]
+Name=Simple DCOP server
+Name[ca]=Simple servidor DCOP
+Name[da]=Simpel DCOP-server
+Name[de]=Einfacher DCOP-Server
+Name[el]=Απλός εξυπηρετητής DCOP
+Name[es]=Sencillo servidor DCOP
+Name[et]=Lihtne DCOP-server
+Name[eu]=DCOP zerbitzari sinple bat
+Name[fa]=کارساز سادۀ DCOP
+Name[fr]=Serveur DCOP simple
+Name[ga]=Freastalaí simplí DCOP
+Name[gl]=Servidor sinxelo DCOP
+Name[hu]=Egyszerű DCOP-kiszolgáló
+Name[it]=Semplice server DCOP
+Name[ja]=簡単な DCOP サーバ
+Name[nds]=Eenfach DCOP-Server
+Name[ne]=साधारण DCOP सर्भर
+Name[nl]=Eenvoudige DCOP-server
+Name[pl]=Prosty serwer DCOP
+Name[pt]=Servidor de DCOP simples
+Name[pt_BR]=Servidor de DCOP simples
+Name[ru]=Сервер DCOP
+Name[sk]=Jednoduchý DCOP server
+Name[sl]=Preprost strežnik DCOP
+Name[sr]=Једноставан DCOP сервер
+Name[sr@Latn]=Jednostavan DCOP server
+Name[sv]=Enkel DCOP-server
+Name[tr]=Basit DCOP Sunucusu
+Name[zh_CN]=简单的 DCOP 服务器
+Name[zh_TW]=簡單的 DCOP 伺服器
+Icon=kdedcop.png
+Category=C++/KDE
+Comment=Generates a basic KDE DCOP server. This is an ideal starting point for a DCOP server that does not require a GUI interface.
+Comment[ca]=Genera un servidor bàsic DCOP per al KDE. Aquest és un idoni punt de partida per a un servidor DCOP que no requereixi d'una IGU.
+Comment[da]=Genererer en basal KDE DCOP-server. Dette er et ideelt startpunkt for en DCOP-server der ikke kræver en GUI-grænseflade.
+Comment[de]=Erstellt einen einfachen KDE-DCOP-Server. Dies ist ein idealer Ausgangspunkt für einen DCOP-Server, der keine Benutzeroberfläche erfordert.
+Comment[el]=Δημιουργεί ένα βασικό εξυπηρετητή KDE DCOP. Αυτό είναι ένα ιδανικό σημείο αρχής για έναν εξυπηρετητή DCOP ο οποίος δε χρειάζεται ένα γραφικό περιβάλλον.
+Comment[es]=Genera un servidor básico DCOP para KDE. Es un punto de comienzo ideal para un servidor DCOP que no requiera una interfaz gráfica.
+Comment[et]=Lihtsa KDE DCOP-serveri loomine. See on ideaalne algus DCOP-serverile, mis ei eelda graafilist kasutajaliidest.
+Comment[eu]=DCOP zerbitzari sinple bat sortzen du. Hau GUI interfazerik behar ez duen DCOP zerbitzari baterako hasierako puntu aparta da.
+Comment[fa]=یک کارساز پایۀ KDE DCOP تولید می‌کند. این یک نقطۀ شروع دلخواه برای یک کارساز DCOP است، که نیازی به یک واسط ونک ندارد.
+Comment[fr]=Génère un serveur DCOP KDE de base. C'est un bon point de départ pour un serveur DCOP qui ne requiert pas d'interface graphique.
+Comment[gl]=Xera un servidor básico DCOP para KDE. Este é un punto de comezo ideal para un servidor DCOP que non require unha interface GUI.
+Comment[hu]=Létrehoz egy egyszerű KDE DCOP-os kiszolgálót. Jó kiindulópont grafikus felület nélküli DCOP-kiszolgáló készítéséhez.
+Comment[it]=Genera un semplice server DCOP per KDE. È un punto di partenza ideale per un server DCOP che non richiede un'interfaccia GUI.
+Comment[ja]=基本的な KDE DCOP サーバを作成します。GUI を必要としない DCOP サーバの理想的な開始点です。
+Comment[nds]=Stellt en eenfach DCOP-Server op. Dat is en goot Anfang för en DCOP-Server ahn Böversiet.
+Comment[ne]=आधारभूत KDE DCOP सर्भर उत्पन्न गर्दछ । यो DCOP सर्भरका लागि उपयुक्त सुरुआत बिन्दु हो जसलाई जी यू आई इन्टरफेस आवश्यक पर्दैन ।
+Comment[nl]=Genereert een basis KDE DCOP-server. Dit is een ideaal startpunt voor een DCOP-server die geen GUI-interface vereist.
+Comment[pl]=Generuje prosty serwer KDE DCOP. Dobry punkt startu dla serwera DCOP, który nie potrzebuje interfejsu graficznego.
+Comment[pt]=Gera um servidor básico de DCOP para o KDE. Este é um ponto de partida ideal para um servidor de DCOP que não necessite de uma interface gráfica.
+Comment[pt_BR]=Gera um servidor básico de DCOP para o KDE. Este é um ponto de partida ideal para um servidor de DCOP que não necessite de uma interface gráfica.
+Comment[ru]=Создание простого сервера DCOP. Идеальная стартовая точка для разработки сервера DCOP без графического интерфейса.
+Comment[sk]=Vygeneruje základný KDE DCOP server. Toto je ideálny štartovací bod pre DCOP server, ktorý nepotrebuje GUI rozhranie.
+Comment[sl]=Ustvari osnovni strežnik DCOP za KDE. To je idealno začetno mesto za strežnik DCOP, ki ne potrebuje grafičnega vmesnika.
+Comment[sr]=Прави основан KDE DCOP сервер. Ово је идеална почетна тачка за DCOP сервер који не захтева GUI.
+Comment[sr@Latn]=Pravi osnovan KDE DCOP server. Ovo je idealna početna tačka za DCOP server koji ne zahteva GUI.
+Comment[sv]=Skapar en grundläggande KDE DCOP-server. Detta är en idealisk utgångspunkt för en DCOP-server som inte kräver ett grafiskt användargränssnitt.
+Comment[tr]=Basit bir KDE DCOP sunucusu yaratır. Bu grafik arayüz gerektirmeyen bir DCOP sunucusuna başlamak için uygun bir noktadır.
+Comment[zh_CN]=生成简单的 KDE DCOP 服务器。这是不需要图形界面的 DCOP 服务器的良好开端。
+Comment[zh_TW]=產生一個基本的 KDE DCOP 伺服器。這個是開發一個不需使用者介面的 DCOP 伺服器的一個好起點。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/main.cpp
+Archive=kdedcop.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE17]
+Type=install
+Source=%{src}/mainclass.cpp
+Dest=%{dest}/src/mainclass.cpp
+
+[FILE18]
+Type=install
+Source=%{src}/mainclass.h
+Dest=%{dest}/src/mainclass.h
+
+[FILE19]
+Type=install
+Source=%{src}/app_iface.h
+Dest=%{dest}/src/%{APPNAMELC}_iface.h
+
+[FILE20]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[MSG]
+Type=message
+Comment=A simple DCOP server was created in %{dest}
+Comment[ca]=Un simple servidor DCOP ha estat creat en %{dest}
+Comment[da]=En simpel DCOP-server blev oprettet i %{dest}
+Comment[de]=Ein einfacher DCOP-Server wurde in %{dest} erstellt.
+Comment[el]=Ένας απλός εξυπηρετητής DCOP δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo servidor DCOP ha sido creado en %{dest}
+Comment[et]=Lihtne DCOP-server loodi asukohta %{dest}
+Comment[eu]=DCOP zerbitzari sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک کارساز سادۀ DCOP در %{dest} ایجاد شد
+Comment[fr]=Un serveur DCOP simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh freastalaí simplí DCOP i %{dest}
+Comment[gl]=Creouse un servidor DCOP sinxelo en %{dest}
+Comment[hu]=Létrejött egy egyszerű DCOP-kiszolgáló itt: %{dest}
+Comment[it]=È stato creato un semplice server DCOP in %{dest}
+Comment[ja]=簡単な DCOP サーバを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach DCOP-Server opstellt
+Comment[ne]=साधारण DCOP सर्भर %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudige DCOP-server is aangemaakt in %{dest}
+Comment[pl]=Prosty serwer DCOP został utworzony w %{dest}
+Comment[pt]=Foi criado um servidor de DCOP simples em %{dest}
+Comment[pt_BR]=Foi criado um servidor de DCOP simples em %{dest}
+Comment[ru]=Простой сервер DCOP создан в %{dest}
+Comment[sk]=Jednoduchý DCOP server bol vytvorený v %{dest}
+Comment[sl]=Preprost strežnik DCOP je bil ustvarjen v %{dest}
+Comment[sr]=Једноставан DCOP сервер направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan DCOP server napravljen je u %{dest}
+Comment[sv]=En enkel DCOP-server skapades i %{dest}
+Comment[tr]=Basit bir DCOP sunucusu %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了简单的 DCOP 服务器
+Comment[zh_TW]=一個簡單的 DCOP 伺服器已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kdedcop/kdedcop.png b/languages/cpp/app_templates/kdedcop/kdedcop.png
new file mode 100644
index 00000000..1d25362b
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/kdedcop.png
Binary files differ
diff --git a/languages/cpp/app_templates/kdedcop/main.cpp b/languages/cpp/app_templates/kdedcop/main.cpp
new file mode 100644
index 00000000..5bfcf8ae
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/main.cpp
@@ -0,0 +1,52 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "0.1";
+
+static KCmdLineOptions options[] =
+{
+// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+ %{APPNAME} *mainWin = 0;
+
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ /// @todo do something with the command line args here
+
+ mainWin = new %{APPNAME}();
+ app.setMainWidget( mainWin );
+ mainWin->show();
+
+ args->clear();
+ }
+
+ int ret = app.exec();
+
+ delete mainWin;
+ return ret;
+}
diff --git a/languages/cpp/app_templates/kdedcop/mainclass.cpp b/languages/cpp/app_templates/kdedcop/mainclass.cpp
new file mode 100644
index 00000000..8f334114
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/mainclass.cpp
@@ -0,0 +1,31 @@
+%{CPP_TEMPLATE}
+
+#include "mainclass.h"
+
+
+MainClass::MainClass()
+ : DCOPDemoIface(),
+ DCOPObject("mainclass"), /* this is the object name DCOP will expose */
+ m_intValue(0)
+{
+}
+
+MainClass::~MainClass()
+{
+}
+
+void MainClass::setStrVal(const QString & str) {
+ m_strValue = str;
+}
+
+void MainClass::setIntVal(int val) {
+ m_intValue = val;
+}
+
+QString MainClass::strVal() const {
+ return m_strValue;
+}
+
+int MainClass::intVal() const {
+ return m_intValue;
+}
diff --git a/languages/cpp/app_templates/kdedcop/mainclass.h b/languages/cpp/app_templates/kdedcop/mainclass.h
new file mode 100644
index 00000000..ca37f2ad
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/mainclass.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef MAINCLASS_H
+#define MAINCLASS_H
+
+#include "%{APPNAMELC}_iface.h"
+
+/**
+ *
+ * @author %{AUTHOR}
+ **/
+class MainClass : virtual public DCOPDemoIface
+{
+public:
+ MainClass();
+
+ ~MainClass();
+
+
+ // Here is the implementation of the example DCOP interface methods.
+ virtual void setStrVal(const QString &);
+ virtual void setIntVal(int);
+ virtual QString strVal() const;
+ virtual int intVal() const;
+
+private:
+ QString m_strValue;
+ int m_intValue;
+
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdedcop/src-Makefile.am b/languages/cpp/app_templates/kdedcop/src-Makefile.am
new file mode 100644
index 00000000..dc26ec93
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/src-Makefile.am
@@ -0,0 +1,23 @@
+## Makefile.am for %{APPNAMELC}
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# the application source, library search path, and link libraries
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}_iface.skel mainclass.cpp
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+%{APPNAMELC}_LDADD = $(LIB_KDEUI)
diff --git a/languages/cpp/app_templates/kdedcop/subdirs b/languages/cpp/app_templates/kdedcop/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kdedcop/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kdevlang/.kdev_ignore b/languages/cpp/app_templates/kdevlang/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/.kdev_ignore
diff --git a/languages/cpp/app_templates/kdevlang/Makefile.am b/languages/cpp/app_templates/kdevlang/Makefile.am
new file mode 100644
index 00000000..972dd511
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = src-Makefile.am kdevlang_part.cpp kdevlang_part.h kdevlang.rc \
+ kdevlang.desktop app.kdevelop kdevlang-configure.in.in README.dox
+templateName = kdevlang
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kdevlang/README.dox b/languages/cpp/app_templates/kdevlang/README.dox
new file mode 100644
index 00000000..86968add
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/README.dox
@@ -0,0 +1,55 @@
+/** \class %{APPNAME}
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=YOUR_COMPONENT_NAME&
+bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">
+YOUR_COMPONENT_NAME at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/cpp/app_templates/kdevlang/app.kdevelop b/languages/cpp/app_templates/kdevlang/app.kdevelop
new file mode 100644
index 00000000..7a0e573b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/app.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>KDevelop</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in b/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in
new file mode 100644
index 00000000..78ed2275
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang-configure.in.in
@@ -0,0 +1,10 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+KDE_CHECK_HEADERS([kdevelop/kdevcore.h])
+KDE_CHECK_LIB([kdevelop],main,
+ [LIBKDEVELOP="-lkdevelop"])
+AC_SUBST(LIBKDEVELOP)
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.desktop b/languages/cpp/app_templates/kdevlang/kdevlang.desktop
new file mode 100644
index 00000000..d8f320a3
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=%{APPNAME}
+Comment[pt]=%{APPNAME$}
+Name=KDev%{APPNAME}
+Name[nds]=KDev%{ProgNaam}
+Name[sv]=KDevelop %{APPNAME}
+Name[ta]=கெடெவ்%{APPNAME}
+Icon=kdevelop
+ServiceTypes=KDevelop/LanguageSupport
+X-KDevelop-Language=ChangeMe
+X-KDE-Library=libkdev%{APPNAMELC}
+X-KDevelop-Version=3
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate b/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate
new file mode 100644
index 00000000..c3ad93bf
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang.kdevtemplate
@@ -0,0 +1,157 @@
+# KDE Config File
+[General]
+Name=KDevelop Language Support Plugin (Standalone build)
+Name[ca]=Connector per al suport de llenguatge a KDevelop (de construcció aïllada)
+Name[da]=KDevelop plugin for sprogstøttet (alenestående bygning)
+Name[de]=KDevelop-Modul für Sprachunterstützung (Unabhängige Erstellung)
+Name[el]=Πρόσθετο υποστήριξης γλώσσας του KDevelop (αυτόνομη κατασκευή)
+Name[es]=Complemento de implementación de lenguaje para KDevelop (construcción independiente)
+Name[et]=KDevelopi keeletoetuse plugin (autonoomne)
+Name[eu]=KDevelop-en lengoaien euskarrien interfazea (eraikuntza autonomoak)
+Name[fa]=وصلۀ پشتیبانی زبان KDevelop )ساخت خوداتکا(
+Name[fr]=Module externe de prise en charge de langage de KDevelop (construction autonome)
+Name[ga]=Breiseán Tacaíochta Teanga le haghaidh KDevelop (Tógáil Shaorsheasaimh)
+Name[gl]=Extensión de soporte de linguaxes para KDevelop (compilación independente)
+Name[hu]=KDevelop nyelvtámogató modul (önálló)
+Name[it]=Plugin di supporto per linguaggio di KDevelop (compilazione indipendente)
+Name[ja]=KDevelop 言語サポートプラグイン (スタンダローンビルド)
+Name[nds]=KDevelop-Moduul för Spraakünnerstütten (Enkelprogramm)
+Name[ne]=केडीई विकास भाषा समर्थन प्लगइन (स्ट्यान्डअलोन निर्माण)
+Name[nl]=KDEvelop Taalondersteuning Plugin (Standalone build)
+Name[pl]=Wtyczka KDevelopa do obsługi języka (budowana oddzielnie)
+Name[pt]='Plugin' de Suporte a Linguagens do KDevelop (compilação autónoma)
+Name[pt_BR]='Plugin' de Suporte a Linguagens do KDevelop (compilação autónoma)
+Name[ru]=Интерфейс языковой поддержки для KDevelop (внешний)
+Name[sk]=KDevelop modul pre jazykovú podporu (samostatný build)
+Name[sl]=Vstavek jezikovne podpore za KDevelop (samostojna izgradnja)
+Name[sr]=KDevelop-ов интерфејс за језичку подршку (самостална градња)
+Name[sr@Latn]=KDevelop-ov interfejs za jezičku podršku (samostalna gradnja)
+Name[sv]=KDevelop-insticksprogram för språkstöd (att bygga fristående)
+Name[tr]=KDevelop Dil Desteği Eklentisi (Kendi başına çalışabilen kurulum)
+Name[zh_CN]=KDevelop 语言支持插件(独立编译)
+Name[zh_TW]=KDevelop 語言支援外掛程式(單獨建立)
+Category=C++/KDevelop/
+Comment=This generates a language support plugin for KDevelop, to be built outside of the KDevelop source tree.
+Comment[ca]=Genera un connector per al suport de llenguatge a KDevelop, per a que es construeixi fora de l'arbre de fonts de KDevelop.
+Comment[da]=Dette genererer en sprogstøtte-plugin for KDevelop, der skal bygges udenfor KDevelop's kildetræ.
+Comment[de]=Hiermit wird ein Sprachunterstützungsmodul für KDevelop generiert, das außerhalb des Quelltextbaumes von KDevelop erstellt wird.
+Comment[el]=Αυτό δημιουργεί ένα πρόσθετο υποστήριξης γλώσσας για το KDevelop, για την κατασκευή του έξω από το δέντρο πηγαίου κώδικα του KDevelop.
+Comment[es]=Genera un complemento de implementación de lenguaje para KDevelop, para ser construido fuera del árbol de código fuente de KDevelop.
+Comment[et]=KDevelopi keeletoetuse plugina loomine, mida saab ehitada väljaspool KDevelopi lähtekoodipuud.
+Comment[eu]=Honek KDevelop-en lengoai-euskarrirako plugin bat sortzen du, KDevelop-en iturburu zuhaitzetik at eraikitzeko.
+Comment[fa]=یک وصلۀ پشتیبان برای KDevelop تولید می‌کند، تا در بیرون درخت منبع KDevelop ساخته شود.
+Comment[fr]=Génère un module externe de prise en charge de langage pour KDevelop, à construire en dehors de l'arborescence des sources de KDevelop.
+Comment[gl]=Isto xera unha extensión de soporte de linguaxes para KDevelop que se compilará fóra da árbore de código de KDevelop.
+Comment[hu]=Létrehoz egy nyelvtámogató modult a KDevelophoz, mely a KDevelopos forráskönyvtáron kívül fordítható le.
+Comment[it]=Genera un plugin di supporto per linguaggio per KDevelop, deve essere compilato fuori dell'albero sorgente di KDevelop.
+Comment[nds]=Dit stellt en Spraakünnerstütten-Moduul för KDevelop op, dat buten den KDevelop-Bornboom kompileert warrt.
+Comment[ne]=यसले केडीई विकासका लागि केडीई विकास स्रोत ट्रीको बाहिर निर्माण गर्न, भाषा समर्थन प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Dit genereert een taalondersteuningsplugin voor KDEvelop, welke buiten de KDevelop sourcetree wordt gebouwd.
+Comment[pl]=Generuje wtyczkę do obsługi języka w KDevelopie. Wtyczka jest budowana poza drzewem źródłowym KDevelopa.
+Comment[pt]=Isto gera um 'plugin' de suporte de linguagens para o KDevelop, que possa ser compilado fora da árvore de código do KDevelop.
+Comment[pt_BR]=Isto gera um 'plugin' de suporte de linguagens para o KDevelop, que possa ser compilado fora da árvore de código do KDevelop.
+Comment[ru]=Создание интерфейса языковой поддержки для KDevelop со сборкой вне исходного кода KDevelop.
+Comment[sk]=Vygeneruje modul pre jazykovú podporu pre KDevelop, tak aby ho bolo možné kompilovať mimo zdrojového stromu KDevelop.
+Comment[sr]=Ово прави прикључак за језичку подршку за KDevelop, који се гради ван KDevelop-овог изворног стабла.
+Comment[sr@Latn]=Ovo pravi priključak za jezičku podršku za KDevelop, koji se gradi van KDevelop-ovog izvornog stabla.
+Comment[sv]=Detta skapar ett KDevelop-insticksprogram för språkstöd, att bygga utanför KDevelops källkodsträd.
+Comment[tr]=Bu KDevelop için, KDevelop kaynak ağacının dışında olacak, bir dil desteği eklentisi yaratır.
+Comment[zh_CN]=这将生成 KDevelop 的语言支持插件,可以在 KDevelop 源代码树之外编译。
+Comment[zh_TW]=產生一個 KDevelop 語言支援外掛程式,建立在 KDevelop 程式源碼樹之外。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp
+Archive=kdevlang.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE5]
+Type=install
+Source=%{src}/kdevlang-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{src}/kdevlang_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}_part.cpp
+
+[FILE8]
+Type=install
+Source=%{src}/kdevlang_part.h
+Dest=%{dest}/src/%{APPNAMELC}_part.h
+
+[FILE9]
+Type=install
+EscapeXML=true
+Source=%{src}/kdevlang.rc
+Dest=%{dest}/src/kdev%{APPNAMELC}.rc
+
+[FILE10]
+Type=install
+Source=%{src}/kdevlang.desktop
+Dest=%{dest}/src/kdev%{APPNAMELC}.desktop
+
+[FILE11]
+Type=install
+Source=%{src}/README.dox
+Dest=%{dest}/src/README.dox
+
+[MSG]
+Type=message
+Comment=A language plugin for KDevelop for standalone build was created in %{dest}
+Comment[ca]=Un connector per a llenguatge a KDevelop i de construcció aïllada ha estat creat en %{dest}
+Comment[da]=Et sprog-plugin for KDevelop for alenestående bygning blev oprettet i %{dest}
+Comment[de]=Ein Sprachunterstützungsmodul für KDevelop (unabhängige Erstellung) wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο γλώσσας για το KDevelop για αυτόνομη κατασκευή δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento de lenguaje para KDevelop de construcción independiente ha sido creado en %{dest}
+Comment[et]=KDevelopi autonoomne keeleplugin loodi asukohta %{dest}
+Comment[eu]=KDevelop-en hizkuntza plugin autonomo bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ زبان برای KDevelop جهت ساخت خوداتکا در %{dest} ایجاد شد
+Comment[fr]=Un module externe de langage pour KDevelop à construire de façon autonome a été créé dans %{dest}
+Comment[gl]=Creouse unha extensión de linguaxe para KDevelop a compilar de forma independente en %{dest}
+Comment[hu]=Létrejött egy KDevelopos nyelvtámogató modul (önálló lefordításra) itt: %{dest}
+Comment[it]=È stato creato un plugin di linguaggio per KDevelop per compilazione indipendente %{dest}
+Comment[nds]=In %{dest} wöör en Spraakünnerstütten-Moduul för KDevelop (Enkelprogramm) opstellt
+Comment[ne]=स्ट्यान्डअलोन निर्माण गर्न केडीई विकासका लागि भाषा प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een taalplugin voor KDevelop voor standalone build is aangemaakt in %{dest}
+Comment[pl]=Wtyczka języka dla KDevelopa do budowy oddzielnie została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' de linguagens de compilação autónoma para o KDevelop em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' de linguagens de compilação autónoma para o KDevelop em %{dest}
+Comment[ru]=Внешний интерфейс языковой поддержки для KDevelop создан в %{dest}
+Comment[sk]=Modul pre jazykovú podporu pre KDevelop bol vutvorený v %{dest}
+Comment[sr]=Језички прикључак за KDevelop за самосталну градњу направљен је у %{dest}
+Comment[sr@Latn]=Jezički priključak za KDevelop za samostalnu gradnju napravljen je u %{dest}
+Comment[sv]=Ett KDevelop-insticksprogram för språkstöd att bygga fristående skapades i %{dest}
+Comment[tr]=Kendi başına çalışabilen bir KDevelop dil eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个独立编译的 KDevelop 语言插件
+Comment[zh_TW]=一個單獨建立的 KDevelop 語言外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.png b/languages/cpp/app_templates/kdevlang/kdevlang.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang.png
Binary files differ
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang.rc b/languages/cpp/app_templates/kdevlang/kdevlang.rc
new file mode 100644
index 00000000..b4e153fa
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevBashSupport" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp b/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp
new file mode 100644
index 00000000..9d5cadcf
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang_part.cpp
@@ -0,0 +1,154 @@
+%{CPP_TEMPLATE}
+
+#include <qwhatsthis.h>
+#include <qtimer.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+#include <kdevcore.h>
+#include <kdevpartcontroller.h>
+#include <kdevplugininfo.h>
+#include <kdevproject.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+//#include "%{APPNAMELC}_widget.h"
+#include "%{APPNAMELC}_part.h"
+
+typedef KGenericFactory<%{APPNAME}Part> %{APPNAME}Factory;
+K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( "kdev%{APPNAMELC}" ) );
+static const KDevPluginInfo data("kdev%{APPNAMELC}");
+
+%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList& )
+: KDevLanguageSupport(&data, parent, name ? name : "%{APPNAME}Part" )
+{
+ setInstance(%{APPNAME}Factory::instance());
+ setXMLFile("kdevlang_%{APPNAMELC}.rc");
+
+
+ m_build = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" );
+
+ kdDebug() << "Creating %{APPNAMELC} Part" << endl;
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)), this, SLOT(savedFile(const KURL&)) );
+ connect(partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part *)));
+}
+
+
+%{APPNAME}Part::~%{APPNAME}Part()
+{
+ delete m_build;
+}
+
+KDevLanguageSupport::Features %{APPNAME}Part::features()
+{
+ return Features(Variables | Functions);
+}
+KMimeType::List %{APPNAME}Part::mimeTypes()
+{
+ KMimeType::List list;
+
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-shellscript" );
+ if( mime )
+ list << mime;
+
+ return list;
+}
+void %{APPNAME}Part::slotRun()
+{
+ // Execute the application here.
+}
+void %{APPNAME}Part::projectConfigWidget(KDialogBase *dlg)
+{
+ Q_UNUSED( dlg );
+ // Create your config dialog here.
+}
+void %{APPNAME}Part::projectOpened()
+{
+ kdDebug(9014) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(parse()));
+}
+void %{APPNAME}Part::projectClosed()
+{
+
+}
+void %{APPNAME}Part::savedFile(const KURL &fileName)
+{
+
+
+ if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 )))
+ {
+ kdDebug(9014) << "parse file " << fileName.path() << endl;
+ emit addedSourceInfo( fileName.path() );
+ }
+}
+void %{APPNAME}Part::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9014) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + ( *it ) << endl;
+ }
+
+ emit updatedSourceInfo();
+}
+void %{APPNAME}Part::removedFilesFromProject(const QStringList &fileList)
+{
+
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ if( codeModel()->hasFile(fileName) )
+ {
+ kdDebug(9014) << "removed " << fileName << endl;
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+ }
+
+}
+void %{APPNAME}Part::parse()
+{
+ kdDebug(9014) << "initialParse()" << endl;
+
+ if (project())
+ {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it)
+ {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ }
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug(9014) << "No project" << endl;
+ }
+}
+void %{APPNAME}Part::slotActivePartChanged(KParts::Part *part)
+{
+ kdDebug() << "Changeing active part..." << endl;
+}
+
+#include "%{APPNAMELC}_part.moc"
diff --git a/languages/cpp/app_templates/kdevlang/kdevlang_part.h b/languages/cpp/app_templates/kdevlang/kdevlang_part.h
new file mode 100644
index 00000000..25721d64
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/kdevlang_part.h
@@ -0,0 +1,43 @@
+%{H_TEMPLATE}
+
+#ifndef __KDEVPART_%{APPNAMEUC}_H__
+#define __KDEVPART_%{APPNAMEUC}_H__
+
+
+#include <kdevplugin.h>
+#include <codemodel.h>
+#include <kdevlanguagesupport.h>
+#include <qstringlist.h>
+#include <kdialogbase.h>
+
+class KAction;
+
+/*
+ Please read the README.dox file for more info about this part
+ */
+class %{APPNAME}Part : public KDevLanguageSupport
+{
+ Q_OBJECT
+ public:
+ %{APPNAME}Part(QObject *parent, const char *name, const QStringList &);
+ ~%{APPNAME}Part();
+ protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+ private slots:
+ void slotRun();
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void parse();
+ void slotActivePartChanged(KParts::Part *part);
+ private:
+ KAction *m_build;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/kdevlang/src-Makefile.am b/languages/cpp/app_templates/kdevlang/src-Makefile.am
new file mode 100644
index 00000000..325352ad
--- /dev/null
+++ b/languages/cpp/app_templates/kdevlang/src-Makefile.am
@@ -0,0 +1,14 @@
+AM_CPPFLAGS = -I$(kde_includes)/kdevelop/interfaces -I$(kde_includes)/kdevelop/util -I$(kde_includes)/kinterfacedesigner $(all_includes)
+
+kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la
+libkdev%{APPNAMELC}_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdev%{APPNAMELC}_la_LIBADD = -lkdevelop
+libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}_part.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdev%{APPNAMELC}.desktop
+
+rcdir = $(kde_datadir)/kdev%{APPNAMELC}
+rc_DATA = kdev%{APPNAMELC}.rc
diff --git a/languages/cpp/app_templates/kdevpart/.kdev_ignore b/languages/cpp/app_templates/kdevpart/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/.kdev_ignore
diff --git a/languages/cpp/app_templates/kdevpart/Makefile.am b/languages/cpp/app_templates/kdevpart/Makefile.am
new file mode 100644
index 00000000..d1541685
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = src-Makefile.am kdevpart_part.cpp kdevpart_part.h \
+ kdevpart_widget.h kdevpart_widget.cpp kdevpart_part.rc \
+ kdevpart.desktop app.kdevelop README.dox globalconfigbase.ui globalconfig.h \
+ globalconfig.cpp projectconfigbase.ui projectconfig.h projectconfig.cpp
+templateName = kdevpart
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kdevpart/README.dox b/languages/cpp/app_templates/kdevpart/README.dox
new file mode 100644
index 00000000..86968add
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/README.dox
@@ -0,0 +1,55 @@
+/** \class %{APPNAME}
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=YOUR_COMPONENT_NAME&
+bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">
+YOUR_COMPONENT_NAME at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/cpp/app_templates/kdevpart/app.kdevelop b/languages/cpp/app_templates/kdevpart/app.kdevelop
new file mode 100644
index 00000000..29beaf21
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/app.kdevelop
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>KDevelop</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+</kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kdevpart/globalconfig.cpp b/languages/cpp/app_templates/kdevpart/globalconfig.cpp
new file mode 100644
index 00000000..12396fec
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/globalconfig.cpp
@@ -0,0 +1,15 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}globalconfig.h"
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}GlobalConfig::%{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent, const char *name)
+ : %{APPNAME}GlobalConfigBase(parent, name), m_part(part)
+{
+}
+
+void %{APPNAME}GlobalConfig::accept()
+{
+}
+
+#include "%{APPNAMELC}globalconfig.moc"
diff --git a/languages/cpp/app_templates/kdevpart/globalconfig.h b/languages/cpp/app_templates/kdevpart/globalconfig.h
new file mode 100644
index 00000000..1b321cd2
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/globalconfig.h
@@ -0,0 +1,22 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_GLOBAL_CONFIG_H
+#define %{APPNAMEUC}_GLOBAL_CONFIG_H
+
+#include "%{APPNAMELC}globalconfigbase.h"
+
+class %{APPNAME}Part;
+
+class %{APPNAME}GlobalConfig: public %{APPNAME}GlobalConfigBase
+{
+ Q_OBJECT
+public:
+ %{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart/globalconfigbase.ui b/languages/cpp/app_templates/kdevpart/globalconfigbase.ui
new file mode 100644
index 00000000..c16bd90d
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/globalconfigbase.ui
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}GlobalConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAME}GlobalConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAME}</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.desktop b/languages/cpp/app_templates/kdevpart/kdevpart.desktop
new file mode 100644
index 00000000..eb61eef9
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart.desktop
@@ -0,0 +1,83 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Name=KDev%{APPNAME}
+Name[nds]=KDev%{ProgNaam}
+Name[sv]=KDevelop %{APPNAME}
+Name[ta]=கெடெவ்%{APPNAME}
+GenericName=%{APPNAME} Plugin
+GenericName[br]=Lugent %{APPNAME}
+GenericName[ca]=Connector per a %{APPNAME}
+GenericName[da]=%{APPNAME} plugin
+GenericName[de]=%{APPNAME}-Modul
+GenericName[el]=Πρόσθετο %{APPNAME}
+GenericName[es]=Complemento %{APPNAME}
+GenericName[et]=%{APPNAME} plugin
+GenericName[eu]=%{APPNAME} plugina
+GenericName[fa]=وصلۀ %{APPNAME}
+GenericName[fr]=Module externe pour %{APPNAME}
+GenericName[ga]=Breiseán %{APPNAME}
+GenericName[gl]=Extensión %{APPNAME}
+GenericName[hu]=%{APPNAME}-bővítőmodul
+GenericName[it]=Plugin %{APPNAME}
+GenericName[ja]=%{APPNAME} プラグイン
+GenericName[nds]=%{APPNAME}-Moduul
+GenericName[ne]=%{APPNAME} प्लगइन
+GenericName[nl]=%{APPNAME}-plugin
+GenericName[pl]=Wtyczka %{APPNAME}
+GenericName[pt]='Plugin' %{APPNAME}
+GenericName[pt_BR]=Plug-in do %{APPNAME}
+GenericName[ru]=Модуль %{APPNAME}
+GenericName[sk]=%{APPNAME} modul
+GenericName[sl]=Vstavek za %{APPNAME}
+GenericName[sr]=%{APPNAME} прикључак
+GenericName[sr@Latn]=%{APPNAME} priključak
+GenericName[sv]=%{APPNAME} insticksprogram
+GenericName[tr]=%{APPNAME} Eklentisi
+GenericName[zh_CN]=%{APPNAME} 插件
+GenericName[zh_TW]=%{APPNAME} 外掛程式
+Comment=%{APPNAME} Description
+Comment[br]=Deskrivadur %{APPNAME}
+Comment[ca]=Descripció per a %{APPNAME}
+Comment[da]=%{APPNAME} beskrivelse
+Comment[de]=%{APPNAME} Beschreibung
+Comment[el]=Περιγραφή %{APPNAME}
+Comment[es]=Descripción de %{APPNAME}
+Comment[et]=%{APPNAME} kirjeldus
+Comment[eu]=%{APPNAME} deskribapena
+Comment[fa]=توصیف %{APPNAME}
+Comment[fr]=Description pour %{APPNAME}
+Comment[ga]=Cur Síos %{APPNAME}
+Comment[gl]=Descripción de %{APPNAME}
+Comment[hu]=%{APPNAME} leírása
+Comment[it]=Descrizione %{APPNAME}
+Comment[ja]=%{APPNAME} 概説
+Comment[nds]=%{APPNAME}-Beschrieven
+Comment[ne]=%{APPNAME} वर्णन
+Comment[nl]=%{APPNAME} omschrijving
+Comment[pl]=Opis %{APPNAME}
+Comment[pt]=Descrição de %{APPNAME$}
+Comment[pt_BR]=Descrição do %{APPNAME}
+Comment[ru]=Описание %{APPNAME}
+Comment[sk]=%{APPNAME} popis
+Comment[sl]=Opis za %{APPNAME}
+Comment[sr]=Опис за %{APPNAME}
+Comment[sr@Latn]=Opis za %{APPNAME}
+Comment[sv]=%{APPNAME} beskrivning
+Comment[tr]=%{APPNAME} Tanımı
+Comment[zh_CN]=%{APPNAME} 描述
+Comment[zh_TW]=%{APPNAME} 描述
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+
+X-KDevelop-Plugin-Version=1
+X-KDevelop-Plugin-Homepage=
+X-KDevelop-Plugin-BugsEmailAddress=%{EMAIL}
+X-KDevelop-Plugin-Copyright=(C) by %{AUTHOR}
+
+X-KDevelop-Args=
+
+X-KDevelop-Scope=%{SCOPE}
+X-KDE-Library=libkdev%{APPNAMELC}
+X-KDevelop-Version=3
+X-KDevelop-Properties=%{PROPS}
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate b/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate
new file mode 100644
index 00000000..bc7becbf
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart.kdevtemplate
@@ -0,0 +1,242 @@
+# KDE Config File
+[General]
+Name=KDevelop Plugin (KDevelop source tree build)
+Name[ca]=Connector per a KDevelop (de construcció a l'arbre de fonts de KDevelop)
+Name[da]=KDevelop Plugin (KDevelop kildetræ bygning)
+Name[de]=KDevelop-Modul (Erstellung im KDevelop-Quelltextbaum)
+Name[el]=Πρόσθετο KDevelop (κατασκευή με το δέντρο πηγαίου κώδικα του KDevelop)
+Name[es]=Complemento para KDevelop (construcción en árbol de código fuente de KDevelop)
+Name[et]=KDevelopi plugin (Kdevelopi lähtekoodipuus)
+Name[eu]=KDevelop plugina (KDevelop-en iturburu zuhaitzean erakitzeko)
+Name[fa]=وصلۀ KDevelop )ساخت درخت منبع KDevelop(
+Name[fr]=Module externe de KDevelop (construction dans l'arborescence des sources de KDevelop)
+Name[gl]=Extensión para KDevelop (compilación na árbore de código de KDevelop)
+Name[hu]=KDevelop-bővítőmodul (KDevelopos forráskönyvtáron belül)
+Name[it]=Plugin di KDevelop (compila l'albero sorgente di KDevelop)
+Name[ja]=KDevelop プラグイン (KDevelop ソースツリービルド)
+Name[nds]=KDevelop-Moduul (KDevelop-Bornboomprogramm)
+Name[ne]=केडीई विकास प्लगइन (केडीई विकास स्रोत ट्री निर्माण)
+Name[nl]=KDevelop-plugin (KDevelop source tree build)
+Name[pl]=Wtyczka KDevelopa (budowa w drzewie źródłowym KDevelopa)
+Name[pt]='Plugin' do KDevelop (compilação na árvore de código do KDevelop)
+Name[pt_BR]='Plugin' do KDevelop (compilação na árvore de código do KDevelop)
+Name[ru]=Модуль KDevelop (в исходном коде KDevelop)
+Name[sk]=KDevelop modul (KDevelop zdrojový strom build)
+Name[sr]=Прикључак за KDevelop (градња у изворном стаблу KDevelop-а)
+Name[sr@Latn]=Priključak za KDevelop (gradnja u izvornom stablu KDevelop-a)
+Name[sv]=KDevelop-insticksprogram (att bygga i KDevelops källkodsträd)
+Name[tr]=KDevelop Eklentisi (KDevelop kaynak ağacı kurulumu)
+Name[zh_CN]=KDevelop 插件(KDevelop 源代码树编译)
+Name[zh_TW]=KDevelop 外掛程式(KDevelop 程式源碼樹內建立)
+Category=C++/KDevelop/
+Comment=This generates a plugin for KDevelop, for building within the KDevelop source tree
+Comment[ca]=Genera un connector per a KDevelop, per a que es construeixi en l'arbre de fonts de KDevelop
+Comment[da]=Dette genererer et plugin for KDevelop, til at bygges indenfor KDevelop's kildetræ
+Comment[de]=Hiermit wird ein Modul für KDevelop erstellt, dessen Erstellung innerhalb des Quelltextbaumes von KDevelop erfolgt.
+Comment[el]=Αυτό δημιουργεί ένα πρόσθετο για το KDevelop, για κατασκευή του μέσα στο δέντρο πηγαίου κώδικα του KDevelop
+Comment[es]=Genera un complemento para KDevelop, para ser construido en el árbol de código fuente de KDevelop
+Comment[et]=KDevelopi plugina loomine, mis ehitatakse KDevelopi lähtekoodipuus.
+Comment[eu]=Honek KDevelop-erako plugin bat sortzen du, KDevelop-en iturburu-zuhaitzean eraikitzeko
+Comment[fa]=وصله‌ای برای KDevelop، برای ساختن در درخت منبع KDevelop تولید می‌کند
+Comment[fr]=Génère un module externe pour KDevelop, à construire dans l'arborescence des sources de KDevelop
+Comment[gl]=Isto xera unha extensión para KDevelop que se compilará dentro da árbore de código de KDevelop
+Comment[hu]=Létrehoz egy KDevelop-bővítőmodult, mely a KDevelopos forráskönyvtáron belül fordítható le
+Comment[it]=Genera un plugin per KDevelop, per compilarlo assieme all'albero sorgente di KDevelop
+Comment[nds]=Dit stellt en KDevelop-Moduul för't Kompileren binnen den KDevelop-Bornboom op
+Comment[ne]=यसले केडीई विकास स्रोत ट्री भित्र निर्माण गर्न, केडीई विकासका लागि प्लगइन उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een plugin voor KDevelop, om te bouwen binnen de KDevelop sourcetree
+Comment[pl]=Generuje wtyczkę do KDevelopa, która jest budowana w jego drzewie źródłowym
+Comment[pt]=Isto gera um 'plugin' para o KDevelop, para uma compilação dentro da árvore de código do KDevelop
+Comment[pt_BR]=Isto gera um 'plugin' para o KDevelop, para uma compilação dentro da árvore de código do KDevelop
+Comment[ru]=Создание модуля KDevelop в исходном коде KDevelop
+Comment[sk]=Vygeneruje modul pre KDevelop, ktorý sa bude kompilovať v rámci KDevelop zdrojového stromu
+Comment[sr]=Ово прави прикључак за KDevelop, за градњу у оквиру KDevelop-овог изворног стабла
+Comment[sr@Latn]=Ovo pravi priključak za KDevelop, za gradnju u okviru KDevelop-ovog izvornog stabla
+Comment[sv]=Det här skapar ett insticksprogram för KDevelop, att byggas inne i KDevelops källkodsträd.
+Comment[tr]=Bu KDevelop için, KDevelop kaynak ağacınında olacak, bir eklenti yaratır.
+Comment[zh_CN]=这将生成 KDevelop 的插件,该插件需要与 KDevelop 源代码树一起编译
+Comment[zh_TW]=產生一個 KDevelop 外掛程式,建立於 KDevelop 程式源碼樹內。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}part.cpp
+Archive=kdevpart.tar.gz
+
+[SCOPE]
+Type = value
+ValueType=QString
+Value= SCOPE
+Comment= The scope of a plugin (Global, Project, Core)
+Comment[ca]= L'àmbit d'un connector (Global, Project, Core)
+Comment[da]= Et plugins omfang (Globalt, Projekt, Kerne)
+Comment[de]= Gültigkeitsbereich eines Moduls (Global, Projekt, Kern)
+Comment[el]= Η εμβέλεια ενός πρόσθετου (Καθολική, Έργο, Πυρήνας)
+Comment[es]=El alcance de un complemento (global, proyecto, núcleo)
+Comment[et]=Plugina skoop (globaalne, projekt, tuum)
+Comment[eu]= Pluginaren barrutia (Globala, Projektua, Nukleoa)
+Comment[fa]=دامنۀ یک وصله )سراسری، پروژه، هسته(
+Comment[fr]= La portée d'un module externe (globale, projet, core)
+Comment[ga]= Scóip an bhreiseáin (Comhchoiteann, Tionscadal, Ceartlár)
+Comment[gl]=Ámbito da extensión (Global, Proxecto, Núcleo)
+Comment[hu]=A modul hatóköre (globális, projektszintű, alap)
+Comment[it]=Il contesto di un plugin (Globale, Progetto, Core)
+Comment[nds]= Dat Rebeet vun en Moduul (Globaal, Projekt, Karn)
+Comment[ne]= प्लगइनको क्षेत्र (विश्वव्यापी, परियोजना, कोर)
+Comment[nl]=Het bereik van een plugin (globaal, project, core)
+Comment[pl]=Przynależność wtyczki (globalna, projekt, część główna)
+Comment[pt]=O âmbito de um 'plugin' (Global, Projecto, Núcleo)
+Comment[pt_BR]=O âmbito de um 'plugin' (Global, Projecto, Núcleo)
+Comment[ru]=Тип модуля (Global, Project, Core)
+Comment[sk]=Rozsah module (globálny, projektový, jadrový)
+Comment[sr]=Опсег прикључка (глобални, пројекат, језгро)
+Comment[sr@Latn]=Opseg priključka (globalni, projekat, jezgro)
+Comment[sv]=Insticksprogrammets omfattning (Global, Projekt, Kärna)
+Comment[tr]=Bir eklentinin alanı (Genel, Proje, İç)
+Comment[zh_CN]=插件的范围(全局、工程、核心)
+Comment[zh_TW]=外掛程式的範圍(全域、專案、核心)
+Default= Global
+
+[PROPS]
+Type = value
+ValueType=QString
+Value= PROPS
+Comment= The list of supported KDevelop properties
+Comment[ca]= La llista de propietats suportades del KDevelop
+Comment[da]= Listen af understøttede KDevelop-egenskaber
+Comment[de]= Die Liste der unterstützten KDevelop-Eigenschaften
+Comment[el]= Η λίστα των υποστηριζόμενων ιδιοτήτων του KDevelop
+Comment[es]=La lista de propiedades de KDevelop soportadas
+Comment[et]= KDevelopi toetatud omaduste nimekiri
+Comment[eu]= Onartzen diren KDevelop-en propietateen zerrenda
+Comment[fa]=فهرست ویژگیهای پشتیبانی‌شدۀ KDevelop
+Comment[fr]= La liste des propriétés de KDevelop prises en charge
+Comment[ga]= Liosta d'airíonna KDevelop a dtacaítear leo
+Comment[gl]=Lista das propiedades de KDevelop soportadas
+Comment[hu]=A támogatott KDevelop-tulajdonságok
+Comment[it]=Lista delle proprietà supportate da KDevelop
+Comment[nds]= De List mit ünnerstütt KDevelop-Egenschappen
+Comment[ne]= केडीई विकास समर्थन गर्ने गुणको सूची
+Comment[nl]=De lijst met ondersteunde KDevelop-properties
+Comment[pl]= Lista obsługiwanych właściwości KDevelopa
+Comment[pt]= A lista de propriedades do KDevelop suportadas
+Comment[pt_BR]= A lista de propriedades do KDevelop suportadas
+Comment[ru]=Список поддерживаемых типов модулей для KDevelop
+Comment[sk]=Zoznam podporovaných vlastností KDevelop
+Comment[sl]=Seznam podprtih lastnosti KDevelop
+Comment[sr]=Листа подржаних KDevelop-ових својстава
+Comment[sr@Latn]=Lista podržanih KDevelop-ovih svojstava
+Comment[sv]=Listan med egenskaper i KDevelop som stöds
+Comment[tr]=Desteklenen KDevelop özellikleri
+Comment[zh_CN]=列出支持的 KDevelop 属性
+Comment[zh_TW]=支援的 KDevelop 屬性列表
+Default=
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/kdevpart_part.cpp
+Dest=%{dest}/%{APPNAMELC}part.cpp
+
+[FILE4]
+Type=install
+Source=%{src}/kdevpart_part.h
+Dest=%{dest}/%{APPNAMELC}part.h
+
+[FILE5]
+Type=install
+Source=%{src}/kdevpart_widget.cpp
+Dest=%{dest}/%{APPNAMELC}widget.cpp
+
+[FILE6]
+Type=install
+Source=%{src}/kdevpart_widget.h
+Dest=%{dest}/%{APPNAMELC}widget.h
+
+[FILE7]
+Type=install
+EscapeXML=true
+Source=%{src}/kdevpart_part.rc
+Dest=%{dest}/kdev%{APPNAMELC}.rc
+
+[FILE71]
+Type=install
+EscapeXML=true
+Source=%{src}/globalconfigbase.ui
+Dest=%{dest}/%{APPNAMELC}globalconfigbase.ui
+
+[FILE711]
+Type=install
+Source=%{src}/globalconfig.h
+Dest=%{dest}/%{APPNAMELC}globalconfig.h
+
+[FILE712]
+Type=install
+Source=%{src}/globalconfig.cpp
+Dest=%{dest}/%{APPNAMELC}globalconfig.cpp
+
+[FILE72]
+Type=install
+EscapeXML=true
+Source=%{src}/projectconfigbase.ui
+Dest=%{dest}/%{APPNAMELC}projectconfigbase.ui
+
+[FILE721]
+Type=install
+Source=%{src}/projectconfig.h
+Dest=%{dest}/%{APPNAMELC}projectconfig.h
+
+[FILE722]
+Type=install
+Source=%{src}/projectconfig.cpp
+Dest=%{dest}/%{APPNAMELC}projectconfig.cpp
+
+[FILE8]
+Type=install
+Source=%{src}/kdevpart.desktop
+Dest=%{dest}/kdev%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{src}/README.dox
+Dest=%{dest}/README.dox
+
+[MSG]
+Type=message
+Comment=A KDevelop plugin was created in %{dest}
+Comment[ca]=Un connector per a KDevelop ha estat creat en %{dest}
+Comment[da]=Et KDevelop plugin blev oprettet i %{dest}
+Comment[de]=Ein KDevelop-Modul wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο του KDevelop δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para KDevelop ha sido creado en %{dest}
+Comment[et]=KDevelopi plugin loodi asukohta %{dest}
+Comment[eu]=KDevelop plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ KDevelop در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour KDevelop a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán KDevelop i %{dest}
+Comment[gl]=Creouse unha extensión para KDevelop en %{dest}
+Comment[hu]=Létrejött egy KDevelop-bővítőmodul itt: %{dest}
+Comment[it]=È stato creato un plugin per KDevelop in %{dest}
+Comment[ja]=KDevelop プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDevelop-Moduul opstellt
+Comment[ne]=केडीई विकास प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Er is een KDevelop-plugin aangemaakt in %{dest}
+Comment[pl]=Wtyczka do KDevelopa została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' do KDevelop em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' do KDevelop em %{dest}
+Comment[ru]=Модуль KDevelop создан в %{dest}
+Comment[sk]=KDevelop modul bol vytvorený v %{dest}
+Comment[sl]=Vstavek za KDevelop je bil ustvarjen v %{dest}
+Comment[sr]=Прикључак за KDevelop направљен је у %{dest}
+Comment[sr@Latn]=Priključak za KDevelop napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för KDevelop skapades i %{dest}
+Comment[tr]=Bir KDevelop eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了 KDevelop 插件
+Comment[zh_TW]=一個 KDevelop 外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart.png b/languages/cpp/app_templates/kdevpart/kdevpart.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart.png
Binary files differ
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp b/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp
new file mode 100644
index 00000000..dd86843d
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.cpp
@@ -0,0 +1,183 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}part.h"
+
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kdevplugininfo.h>
+#include <kdevgenericfactory.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <configwidgetproxy.h>
+
+#include "%{APPNAMELC}widget.h"
+#include "%{APPNAMELC}globalconfig.h"
+#include "%{APPNAMELC}projectconfig.h"
+
+typedef KDevGenericFactory<%{APPNAME}Part> %{APPNAME}Factory;
+KDevPluginInfo data("kdev%{APPNAMELC}");
+K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( data ) );
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevPlugin(&data, parent, name ? name : "%{APPNAME}Part")
+{
+ setInstance(%{APPNAME}Factory::instance());
+ setXMLFile("kdev%{APPNAMELC}.rc");
+
+ m_widget = new %{APPNAME}Widget(this);
+ m_widget->setCaption("widget caption");
+ m_widget->setIcon(SmallIcon(info()->icon()));
+
+ QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?"));
+
+ // now you decide what should happen to the widget. Take a look at kdevcore.h
+ // or at other plugins how to embed it.
+
+ // if you want to embed your widget as an outputview, simply uncomment
+ // the following line.
+ // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" );
+
+ // if you want to embed your widget as a selectview (at the left), simply uncomment
+ // the following line.
+ // mainWindow()->embedSelectView( m_widget, "name that should appear", "enter a tooltip" );
+
+ // if you want to embed your widget as a selectview (at the right), simply uncomment
+ // the following line.
+ // mainWindow()->embedSelectViewRight( m_widget, "name that should appear", "enter a tooltip" );
+
+ setupActions();
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("%{APPNAME}"), GLOBALDOC_OPTIONS, info()->icon());
+ m_configProxy->createProjectConfigPage(i18n("%{APPNAME}"), PROJECTDOC_OPTIONS, info()->icon());
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+ connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()));
+
+
+ QTimer::singleShot(0, this, SLOT(init()));
+}
+
+%{APPNAME}Part::~%{APPNAME}Part()
+{
+// if you embed a widget, you need to tell the mainwindow when you remove it
+// if ( m_widget )
+// {
+// mainWindow()->removeView( m_widget );
+// }
+ delete m_widget;
+ delete m_configProxy;
+}
+
+void %{APPNAME}Part::init()
+{
+// delayed initialization stuff goes here
+}
+
+void %{APPNAME}Part::setupActions()
+{
+// create XMLGUI actions here
+ action = new KAction(i18n("&Do Something..."), 0,
+ this, SLOT(doSomething()), actionCollection(), "plugin_action" );
+ action->setToolTip(i18n("Do something"));
+ action->setWhatsThis(i18n("<b>Do something</b><p>Describe here what does this action do."));
+}
+
+void %{APPNAME}Part::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+// create configuraton dialogs here
+ switch (pageNo)
+ {
+ case GLOBALDOC_OPTIONS:
+ {
+ %{APPNAME}GlobalConfig *w = new %{APPNAME}GlobalConfig(this, page, "global config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ case PROJECTDOC_OPTIONS:
+ {
+ %{APPNAME}ProjectConfig *w = new %{APPNAME}ProjectConfig(this, page, "project config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+void %{APPNAME}Part::contextMenu(QPopupMenu *popup, const Context *context)
+{
+// put actions into the context menu here
+ if (context->hasType(Context::EditorContext))
+ {
+ // editor context menu
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+
+ // use context and plug actions here
+ action->plug(popup);
+
+ // or create menu items on the fly
+ // int id = -1;
+ // id = popup->insertItem(i18n("Do Something Here"),
+ // this, SLOT(doSomething()) );
+ // popup->setWhatsThis(id, i18n("<b>Do something here</b><p>Describe here what does this action do."
+ }
+ else if (context->hasType(Context::FileContext))
+ {
+ // file context menu
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+
+ //use context and plug actions here
+ }
+ else if (context->hasType(Context::ProjectModelItemContext))
+ {
+ // project tree context menu
+ const ProjectModelItemContext *pcontext = static_cast<const ProjectModelItemContext*>(context);
+
+ // use context and plug actions here
+ }
+ else if (context->hasType(Context::CodeModelItemContext))
+ {
+ // class tree context menu
+ const CodeModelItemContext *mcontext = static_cast<const CodeModelItemContext*>(context);
+
+ // use context and plug actions here
+ }
+ else if (context->hasType(Context::DocumentationContext))
+ {
+ // documentation viewer context menu
+ const DocumentationContext *dcontext = static_cast<const DocumentationContext*>(context);
+
+ // use context and plug actions here
+ }
+}
+
+void %{APPNAME}Part::projectOpened()
+{
+// do something when the project is opened
+}
+
+void %{APPNAME}Part::projectClosed()
+{
+// do something when the project is closed
+}
+
+void %{APPNAME}Part::doSomething()
+{
+// do something useful here instead of showing the message box
+ KMessageBox::information(m_widget, i18n("This action does nothing."), i18n("%{APPNAME} Plugin"));
+}
+
+#include "%{APPNAMELC}part.moc"
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.h b/languages/cpp/app_templates/kdevpart/kdevpart_part.h
new file mode 100644
index 00000000..168b8a40
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.h
@@ -0,0 +1,45 @@
+%{H_TEMPLATE}
+#ifndef KDEV%{APPNAMEUC}_H
+#define KDEV%{APPNAMEUC}_H
+
+#include <kdevplugin.h>
+
+#include <qguardedptr.h>
+
+class QPopupMenu;
+class KAction;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+class %{APPNAME}Widget;
+
+/**
+Please read the README.dox file for more info about this part
+*/
+class %{APPNAME}Part: public KDevPlugin
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Part(QObject *parent, const char *name, const QStringList &args);
+ ~%{APPNAME}Part();
+
+private slots:
+ void init();
+
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void projectOpened();
+ void projectClosed();
+
+ void doSomething();
+
+private:
+ void setupActions();
+
+ KAction *action;
+
+ QGuardedPtr<%{APPNAME}Widget> m_widget;
+ ConfigWidgetProxy *m_configProxy;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_part.rc b/languages/cpp/app_templates/kdevpart/kdevpart_part.rc
new file mode 100644
index 00000000..a38ee14e
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart_part.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="%{APPNAMELC}" library="lib%{APPNAMELC}plugin" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="plugin_action"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="plugin_action"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp b/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp
new file mode 100644
index 00000000..0c05b976
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart_widget.cpp
@@ -0,0 +1,21 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}widget.h"
+
+#include <kurl.h>
+#include <klibloader.h>
+#include <kparts/part.h>
+
+#include <kdevcore.h>
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}Widget::%{APPNAME}Widget(%{APPNAME}Part *part)
+ : QWidget(0, "%{APPNAMELC} widget"), m_part(part)
+{
+}
+
+%{APPNAME}Widget::~%{APPNAME}Widget()
+{
+}
+
+#include "%{APPNAMELC}widget.moc"
diff --git a/languages/cpp/app_templates/kdevpart/kdevpart_widget.h b/languages/cpp/app_templates/kdevpart/kdevpart_widget.h
new file mode 100644
index 00000000..e29e29d2
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/kdevpart_widget.h
@@ -0,0 +1,23 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_WIDGET_H
+#define %{APPNAMEUC}_WIDGET_H
+
+#include <qwidget.h>
+#include <qstring.h>
+
+class KDevProject;
+class %{APPNAME}Part;
+
+class %{APPNAME}Widget: public QWidget
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Widget(%{APPNAME}Part *part);
+ ~%{APPNAME}Widget();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart/projectconfig.cpp b/languages/cpp/app_templates/kdevpart/projectconfig.cpp
new file mode 100644
index 00000000..5f07993b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/projectconfig.cpp
@@ -0,0 +1,15 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}projectconfig.h"
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}ProjectConfig::%{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent, const char *name)
+ : %{APPNAME}ProjectConfigBase(parent, name), m_part(part)
+{
+}
+
+void %{APPNAME}ProjectConfig::accept()
+{
+}
+
+#include "%{APPNAMELC}projectconfig.moc"
diff --git a/languages/cpp/app_templates/kdevpart/projectconfig.h b/languages/cpp/app_templates/kdevpart/projectconfig.h
new file mode 100644
index 00000000..ec3ff4df
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/projectconfig.h
@@ -0,0 +1,22 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_PROJECT_CONFIG_H
+#define %{APPNAMEUC}_PROJECT_CONFIG_H
+
+#include "%{APPNAMELC}projectconfigbase.h"
+
+class %{APPNAME}Part;
+
+class %{APPNAME}ProjectConfig: public %{APPNAME}ProjectConfigBase
+{
+ Q_OBJECT
+public:
+ %{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart/projectconfigbase.ui b/languages/cpp/app_templates/kdevpart/projectconfigbase.ui
new file mode 100644
index 00000000..c733a774
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/projectconfigbase.ui
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}ProjectConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAME}ProjectConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAME}</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kdevpart/src-Makefile.am b/languages/cpp/app_templates/kdevpart/src-Makefile.am
new file mode 100644
index 00000000..5cd25f36
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart/src-Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la
+libkdev%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(KDE_PLUGIN)
+libkdev%{APPNAMELC}_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}part.cpp %{APPNAMELC}widget.cpp \
+ %{APPNAMELC}globalconfigbase.ui %{APPNAMELC}globalconfig.cpp \
+ %{APPNAMELC}projectconfigbase.ui %{APPNAMELC}projectconfig.cpp
+
+METASOURCES = AUTO
+
+appsharedir = $(kde_datadir)/kdev%{APPNAMELC}
+appshare_DATA =
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdev%{APPNAMELC}.desktop
+
+rcdir = $(kde_datadir)/kdev%{APPNAMELC}
+rc_DATA = kdev%{APPNAMELC}.rc
diff --git a/languages/cpp/app_templates/kdevpart2/.kdev_ignore b/languages/cpp/app_templates/kdevpart2/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/.kdev_ignore
diff --git a/languages/cpp/app_templates/kdevpart2/Makefile.am b/languages/cpp/app_templates/kdevpart2/Makefile.am
new file mode 100644
index 00000000..6e58fa02
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = src-Makefile.am kdevpart_part.cpp kdevpart_part.h\
+ kdevpart_widget.h kdevpart_widget.cpp \
+ kdevpart_part.rc kdevpart.desktop app.kdevelop \
+ kdevpart-configure.in.in README.dox subdirs globalconfigbase.ui globalconfig.h \
+ globalconfig.cpp projectconfigbase.ui projectconfig.h projectconfig.cpp
+
+templateName = kdevpart2
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kdevpart2/README.dox b/languages/cpp/app_templates/kdevpart2/README.dox
new file mode 100644
index 00000000..86968add
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/README.dox
@@ -0,0 +1,55 @@
+/** \class %{APPNAME}
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:%{EMAIL}">%{AUTHOR}</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=YOUR_COMPONENT_NAME&
+bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">
+YOUR_COMPONENT_NAME at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/cpp/app_templates/kdevpart2/app.kdevelop b/languages/cpp/app_templates/kdevpart2/app.kdevelop
new file mode 100644
index 00000000..644adcdf
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/app.kdevelop
@@ -0,0 +1,148 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>KDevelop</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <directoryradio>executable</directoryradio>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ </make>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidepatterns></hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <showvcsfields>true</showvcsfields>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <addoptions></addoptions>
+ <logoptions></logoptions>
+ <updateoptions>-dP</updateoptions>
+ <removeoptions>-f</removeoptions>
+ <revertoptions>-C -d -P</revertoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ </codecompletion>
+ </kdevcppsupport>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kdevpart2/globalconfig.cpp b/languages/cpp/app_templates/kdevpart2/globalconfig.cpp
new file mode 100644
index 00000000..12396fec
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/globalconfig.cpp
@@ -0,0 +1,15 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}globalconfig.h"
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}GlobalConfig::%{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent, const char *name)
+ : %{APPNAME}GlobalConfigBase(parent, name), m_part(part)
+{
+}
+
+void %{APPNAME}GlobalConfig::accept()
+{
+}
+
+#include "%{APPNAMELC}globalconfig.moc"
diff --git a/languages/cpp/app_templates/kdevpart2/globalconfig.h b/languages/cpp/app_templates/kdevpart2/globalconfig.h
new file mode 100644
index 00000000..1b321cd2
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/globalconfig.h
@@ -0,0 +1,22 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_GLOBAL_CONFIG_H
+#define %{APPNAMEUC}_GLOBAL_CONFIG_H
+
+#include "%{APPNAMELC}globalconfigbase.h"
+
+class %{APPNAME}Part;
+
+class %{APPNAME}GlobalConfig: public %{APPNAME}GlobalConfigBase
+{
+ Q_OBJECT
+public:
+ %{APPNAME}GlobalConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui b/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui
new file mode 100644
index 00000000..c16bd90d
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/globalconfigbase.ui
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}GlobalConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAME}GlobalConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAME}</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in b/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in
new file mode 100644
index 00000000..06ee70b8
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart-configure.in.in
@@ -0,0 +1,10 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+KDE_CHECK_HEADERS([kdevelop/interfaces/kdevcore.h])
+KDE_CHECK_LIB([kdevelop],main,
+ [LIBKDEVELOP="-lkdevelop"])
+AC_SUBST(LIBKDEVELOP)
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart.desktop b/languages/cpp/app_templates/kdevpart2/kdevpart.desktop
new file mode 100644
index 00000000..eb61eef9
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart.desktop
@@ -0,0 +1,83 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Name=KDev%{APPNAME}
+Name[nds]=KDev%{ProgNaam}
+Name[sv]=KDevelop %{APPNAME}
+Name[ta]=கெடெவ்%{APPNAME}
+GenericName=%{APPNAME} Plugin
+GenericName[br]=Lugent %{APPNAME}
+GenericName[ca]=Connector per a %{APPNAME}
+GenericName[da]=%{APPNAME} plugin
+GenericName[de]=%{APPNAME}-Modul
+GenericName[el]=Πρόσθετο %{APPNAME}
+GenericName[es]=Complemento %{APPNAME}
+GenericName[et]=%{APPNAME} plugin
+GenericName[eu]=%{APPNAME} plugina
+GenericName[fa]=وصلۀ %{APPNAME}
+GenericName[fr]=Module externe pour %{APPNAME}
+GenericName[ga]=Breiseán %{APPNAME}
+GenericName[gl]=Extensión %{APPNAME}
+GenericName[hu]=%{APPNAME}-bővítőmodul
+GenericName[it]=Plugin %{APPNAME}
+GenericName[ja]=%{APPNAME} プラグイン
+GenericName[nds]=%{APPNAME}-Moduul
+GenericName[ne]=%{APPNAME} प्लगइन
+GenericName[nl]=%{APPNAME}-plugin
+GenericName[pl]=Wtyczka %{APPNAME}
+GenericName[pt]='Plugin' %{APPNAME}
+GenericName[pt_BR]=Plug-in do %{APPNAME}
+GenericName[ru]=Модуль %{APPNAME}
+GenericName[sk]=%{APPNAME} modul
+GenericName[sl]=Vstavek za %{APPNAME}
+GenericName[sr]=%{APPNAME} прикључак
+GenericName[sr@Latn]=%{APPNAME} priključak
+GenericName[sv]=%{APPNAME} insticksprogram
+GenericName[tr]=%{APPNAME} Eklentisi
+GenericName[zh_CN]=%{APPNAME} 插件
+GenericName[zh_TW]=%{APPNAME} 外掛程式
+Comment=%{APPNAME} Description
+Comment[br]=Deskrivadur %{APPNAME}
+Comment[ca]=Descripció per a %{APPNAME}
+Comment[da]=%{APPNAME} beskrivelse
+Comment[de]=%{APPNAME} Beschreibung
+Comment[el]=Περιγραφή %{APPNAME}
+Comment[es]=Descripción de %{APPNAME}
+Comment[et]=%{APPNAME} kirjeldus
+Comment[eu]=%{APPNAME} deskribapena
+Comment[fa]=توصیف %{APPNAME}
+Comment[fr]=Description pour %{APPNAME}
+Comment[ga]=Cur Síos %{APPNAME}
+Comment[gl]=Descripción de %{APPNAME}
+Comment[hu]=%{APPNAME} leírása
+Comment[it]=Descrizione %{APPNAME}
+Comment[ja]=%{APPNAME} 概説
+Comment[nds]=%{APPNAME}-Beschrieven
+Comment[ne]=%{APPNAME} वर्णन
+Comment[nl]=%{APPNAME} omschrijving
+Comment[pl]=Opis %{APPNAME}
+Comment[pt]=Descrição de %{APPNAME$}
+Comment[pt_BR]=Descrição do %{APPNAME}
+Comment[ru]=Описание %{APPNAME}
+Comment[sk]=%{APPNAME} popis
+Comment[sl]=Opis za %{APPNAME}
+Comment[sr]=Опис за %{APPNAME}
+Comment[sr@Latn]=Opis za %{APPNAME}
+Comment[sv]=%{APPNAME} beskrivning
+Comment[tr]=%{APPNAME} Tanımı
+Comment[zh_CN]=%{APPNAME} 描述
+Comment[zh_TW]=%{APPNAME} 描述
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+
+X-KDevelop-Plugin-Version=1
+X-KDevelop-Plugin-Homepage=
+X-KDevelop-Plugin-BugsEmailAddress=%{EMAIL}
+X-KDevelop-Plugin-Copyright=(C) by %{AUTHOR}
+
+X-KDevelop-Args=
+
+X-KDevelop-Scope=%{SCOPE}
+X-KDE-Library=libkdev%{APPNAMELC}
+X-KDevelop-Version=3
+X-KDevelop-Properties=%{PROPS}
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate b/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate
new file mode 100644
index 00000000..6b701188
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart2.kdevtemplate
@@ -0,0 +1,276 @@
+# KDE Config File
+[General]
+Name=KDevelop Plugin (Standalone build)
+Name[ca]=Connector per a KDevelop (de construcció aïllada)
+Name[da]=KDevelop plugin (Alenestående)
+Name[de]=KDevelop-Modul (Unabhängige Erstellung)
+Name[el]=Πρόσθετο KDevelop (Αυτόνομη κατασκευή)
+Name[es]=Complemento para KDevelop (construcción independiente)
+Name[et]=KDevelopi plugin (autonoomne)
+Name[eu]=KDevelop plugin-a (eraikuntza autonomoak)
+Name[fa]=وصلۀ KDevelop )ساخت خوداتکا(
+Name[fr]=Module externe pour KDevelop (construction autonome)
+Name[ga]=Breiseán KDevelop (Tógáil Shaorsheasaimh)
+Name[gl]=Extensión para KDevelop (compilación independente)
+Name[hu]=KDevelop-bővítőmodul (önálló)
+Name[it]=Plugin di KDevelop (compilazione indipendente)
+Name[ja]=KDevelop プラグイン (スタンダローンビルド)
+Name[nds]=KDevelop-Moduul (Enkelprogramm)
+Name[ne]=केडीई विकास प्लगइन (स्ट्यान्डअलोन निर्माण)
+Name[nl]=KDevelop-plugin (standalone build)
+Name[pl]=Wtyczka do KDevelopa (budowana oddzielnie)
+Name[pt]='Plugin' do KDevelop (compilação autónoma)
+Name[pt_BR]='Plugin' do KDevelop (compilação autónoma)
+Name[ru]=Модуль KDevelop (внешний)
+Name[sk]=KDevelop modul (samostatný build)
+Name[sl]=Vstavek za KDevelop (samostojna izgradnja)
+Name[sr]=Прикључак за KDevelop
+Name[sr@Latn]=Priključak za KDevelop
+Name[sv]=KDevelop-insticksprogram (att bygga fristående)
+Name[tr]=KDevelop Eklentisi (Kendi başına çalışabilen)
+Name[zh_CN]=KDevelop 插件(独立编译)
+Name[zh_TW]=KDevelop 外掛程式(單獨建立)
+Category=C++/KDevelop/
+Comment=This generates a KPart for KDevelop, to be built outside of the KDevelop source tree.
+Comment[ca]=Genera una KPart per a KDevelop, per a que es construeixi fora de l'arbre de fonts de KDevelop.
+Comment[da]=Dette genererer en KPart for KDevelop, til at bygges udenfor KDevelop's kildetræ.
+Comment[de]=Hiermit wird eine Komponente (KPart) für KDevelop generiert, die außerhalb des Quelltextbaumes von KDevelop erstellt wird.
+Comment[el]=Αυτό δημιουργεί ένα KPart για το KDevelop, για κατασκευή του έξω από το δέντρο πηγαίου κώδικα του KDevelop.
+Comment[es]=Genera un KPart para KDevelop, para ser construido fuera del árbol de código fuente de KDevelop.
+Comment[et]=KDevelopi KPart'i loomine, mida saab ehitada väljaspool KDevelopi lähtekoodipuud.
+Comment[eu]=Honek KDevelop-en KPart bat sortzen du, KDevelop-en iturburu-zuhaitzetik at eraikitzeko.
+Comment[fa]=یک KPart برای KDevelop، برای ساخته شدن در بیرون درخت منبع پروژه تولید می‌کند.
+Comment[fr]=Génère un KPart pour KDevelop, à construire en dehors de l'arborescence des sources de KDevelop.
+Comment[gl]=Isto xera un KPart para KDevelop que se compilará fóra da árbore de código de KDevelop.
+Comment[hu]=Létrehoz egy KDevelop-bővítőmodult, mely a KDevelopos forráskönyvtáron kívül fordítható le.
+Comment[it]=Genera un KPart per KDevelop, da compilare al di fuori dell'albero sorgente di KDevelop.
+Comment[nds]=Dit stellt en KPart-Komponent för KDevelop op, dat buten den KDevelop-Bornboom kompileert warrt.
+Comment[ne]=यसले केडीई विकास स्रोत ट्री बाहिर निर्माण हुने, केडीई विकासका लागि केडीई भाग उत्पन्न गर्दछ ।
+Comment[nl]=Dit genereert een KPart voor KDevelop, welke buiten de KDevelop sourcetree wordt gebouwd.
+Comment[pl]=Generuje KPart dla KDevelopa budowane poza jego drzewem źródłowym.
+Comment[pt]=Isto gera uma KPart para o KDevelop, de modo a ser compilada fora da árvore de código do KDevelop.
+Comment[pt_BR]=Isto gera uma KPart para o KDevelop, de modo a ser compilada fora da árvore de código do KDevelop.
+Comment[ru]=Создание компонента KPart для KDevelop со сборкой вне исходного кода KDevelop.
+Comment[sk]=Vygenruje KPart pre KDevelop, tak aby ho bolo možné kompilovať mimo zdrojový strom KDevelop.
+Comment[sr]=Ово прави KPart за KDevelop, за градњу изван KDevelop-овог изворног стабла.
+Comment[sr@Latn]=Ovo pravi KPart za KDevelop, za gradnju izvan KDevelop-ovog izvornog stabla.
+Comment[sv]=Detta skapar ett KDevelop-delprogram, att bygga utanför KDevelops källkodsträd.
+Comment[tr]=Bu, KDevelop için, KDevelop kaynak ağacının dışında yapılacak, bir KPart yaratır.
+Comment[zh_CN]=这将生成一个 KDevelop 的 KPart,可以在 KDevelop 源代码树之外编译。
+Comment[zh_TW]=產生一個 KDevelop 的 KPart 元件,建立在 KDevelop 程式源碼樹之外。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}_part.cpp
+Archive=kdevpart2.tar.gz
+
+[SCOPE]
+Type = value
+ValueType=QString
+Value= SCOPE
+Comment= The scope of a plugin (Global, Project, Core)
+Comment[ca]= L'àmbit d'un connector (Global, Project, Core)
+Comment[da]= Et plugins omfang (Globalt, Projekt, Kerne)
+Comment[de]= Gültigkeitsbereich eines Moduls (Global, Projekt, Kern)
+Comment[el]= Η εμβέλεια ενός πρόσθετου (Καθολική, Έργο, Πυρήνας)
+Comment[es]=El alcance de un complemento (global, proyecto, núcleo)
+Comment[et]=Plugina skoop (globaalne, projekt, tuum)
+Comment[eu]= Pluginaren barrutia (Globala, Projektua, Nukleoa)
+Comment[fa]=دامنۀ یک وصله )سراسری، پروژه، هسته(
+Comment[fr]= La portée d'un module externe (globale, projet, core)
+Comment[ga]= Scóip an bhreiseáin (Comhchoiteann, Tionscadal, Ceartlár)
+Comment[gl]=Ámbito da extensión (Global, Proxecto, Núcleo)
+Comment[hu]=A modul hatóköre (globális, projektszintű, alap)
+Comment[it]=Il contesto di un plugin (Globale, Progetto, Core)
+Comment[nds]= Dat Rebeet vun en Moduul (Globaal, Projekt, Karn)
+Comment[ne]= प्लगइनको क्षेत्र (विश्वव्यापी, परियोजना, कोर)
+Comment[nl]=Het bereik van een plugin (globaal, project, core)
+Comment[pl]=Przynależność wtyczki (globalna, projekt, część główna)
+Comment[pt]=O âmbito de um 'plugin' (Global, Projecto, Núcleo)
+Comment[pt_BR]=O âmbito de um 'plugin' (Global, Projecto, Núcleo)
+Comment[ru]=Тип модуля (Global, Project, Core)
+Comment[sk]=Rozsah module (globálny, projektový, jadrový)
+Comment[sr]=Опсег прикључка (глобални, пројекат, језгро)
+Comment[sr@Latn]=Opseg priključka (globalni, projekat, jezgro)
+Comment[sv]=Insticksprogrammets omfattning (Global, Projekt, Kärna)
+Comment[tr]=Bir eklentinin alanı (Genel, Proje, İç)
+Comment[zh_CN]=插件的范围(全局、工程、核心)
+Comment[zh_TW]=外掛程式的範圍(全域、專案、核心)
+Default= Global
+
+[PROPS]
+Type = value
+ValueType=QString
+Value= PROPS
+Comment= The list of supported KDevelop properties
+Comment[ca]= La llista de propietats suportades del KDevelop
+Comment[da]= Listen af understøttede KDevelop-egenskaber
+Comment[de]= Die Liste der unterstützten KDevelop-Eigenschaften
+Comment[el]= Η λίστα των υποστηριζόμενων ιδιοτήτων του KDevelop
+Comment[es]=La lista de propiedades de KDevelop soportadas
+Comment[et]= KDevelopi toetatud omaduste nimekiri
+Comment[eu]= Onartzen diren KDevelop-en propietateen zerrenda
+Comment[fa]=فهرست ویژگیهای پشتیبانی‌شدۀ KDevelop
+Comment[fr]= La liste des propriétés de KDevelop prises en charge
+Comment[ga]= Liosta d'airíonna KDevelop a dtacaítear leo
+Comment[gl]=Lista das propiedades de KDevelop soportadas
+Comment[hu]=A támogatott KDevelop-tulajdonságok
+Comment[it]=Lista delle proprietà supportate da KDevelop
+Comment[nds]= De List mit ünnerstütt KDevelop-Egenschappen
+Comment[ne]= केडीई विकास समर्थन गर्ने गुणको सूची
+Comment[nl]=De lijst met ondersteunde KDevelop-properties
+Comment[pl]= Lista obsługiwanych właściwości KDevelopa
+Comment[pt]= A lista de propriedades do KDevelop suportadas
+Comment[pt_BR]= A lista de propriedades do KDevelop suportadas
+Comment[ru]=Список поддерживаемых типов модулей для KDevelop
+Comment[sk]=Zoznam podporovaných vlastností KDevelop
+Comment[sl]=Seznam podprtih lastnosti KDevelop
+Comment[sr]=Листа подржаних KDevelop-ових својстава
+Comment[sr@Latn]=Lista podržanih KDevelop-ovih svojstava
+Comment[sv]=Listan med egenskaper i KDevelop som stöds
+Comment[tr]=Desteklenen KDevelop özellikleri
+Comment[zh_CN]=列出支持的 KDevelop 属性
+Comment[zh_TW]=支援的 KDevelop 屬性列表
+Default=
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE5]
+Type=install
+Source=%{src}/kdevpart-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{src}/kdevpart_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}part.cpp
+
+[FILE71]
+Type=install
+EscapeXML=true
+Source=%{src}/globalconfigbase.ui
+Dest=%{dest}/src/%{APPNAMELC}globalconfigbase.ui
+
+[FILE711]
+Type=install
+Source=%{src}/globalconfig.h
+Dest=%{dest}/src/%{APPNAMELC}globalconfig.h
+
+[FILE712]
+Type=install
+Source=%{src}/globalconfig.cpp
+Dest=%{dest}/src/%{APPNAMELC}globalconfig.cpp
+
+[FILE72]
+Type=install
+EscapeXML=true
+Source=%{src}/projectconfigbase.ui
+Dest=%{dest}/src/%{APPNAMELC}projectconfigbase.ui
+
+[FILE721]
+Type=install
+Source=%{src}/projectconfig.h
+Dest=%{dest}/src/%{APPNAMELC}projectconfig.h
+
+[FILE722]
+Type=install
+Source=%{src}/projectconfig.cpp
+Dest=%{dest}/src/%{APPNAMELC}projectconfig.cpp
+
+[FILE8]
+Type=install
+Source=%{src}/kdevpart_part.h
+Dest=%{dest}/src/%{APPNAMELC}part.h
+
+[FILE9]
+Type=install
+Source=%{src}/kdevpart_widget.cpp
+Dest=%{dest}/src/%{APPNAMELC}widget.cpp
+
+[FILE10]
+Type=install
+Source=%{src}/kdevpart_widget.h
+Dest=%{dest}/src/%{APPNAMELC}widget.h
+
+[FILE11]
+Type=install
+EscapeXML=true
+Source=%{src}/kdevpart_part.rc
+Dest=%{dest}/src/kdev%{APPNAMELC}.rc
+
+[FILE12]
+Type=install
+Source=%{src}/kdevpart.desktop
+Dest=%{dest}/src/kdev%{APPNAMELC}.desktop
+
+[FILE13]
+Type=install
+Source=%{src}/README.dox
+Dest=%{dest}/src/README.dox
+
+[MSG]
+Type=message
+Comment=A KDevelop plugin was created in %{dest}
+Comment[ca]=Un connector per a KDevelop ha estat creat en %{dest}
+Comment[da]=Et KDevelop plugin blev oprettet i %{dest}
+Comment[de]=Ein KDevelop-Modul wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο του KDevelop δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para KDevelop ha sido creado en %{dest}
+Comment[et]=KDevelopi plugin loodi asukohta %{dest}
+Comment[eu]=KDevelop plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ KDevelop در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour KDevelop a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán KDevelop i %{dest}
+Comment[gl]=Creouse unha extensión para KDevelop en %{dest}
+Comment[hu]=Létrejött egy KDevelop-bővítőmodul itt: %{dest}
+Comment[it]=È stato creato un plugin per KDevelop in %{dest}
+Comment[ja]=KDevelop プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDevelop-Moduul opstellt
+Comment[ne]=केडीई विकास प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Er is een KDevelop-plugin aangemaakt in %{dest}
+Comment[pl]=Wtyczka do KDevelopa została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' do KDevelop em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' do KDevelop em %{dest}
+Comment[ru]=Модуль KDevelop создан в %{dest}
+Comment[sk]=KDevelop modul bol vytvorený v %{dest}
+Comment[sl]=Vstavek za KDevelop je bil ustvarjen v %{dest}
+Comment[sr]=Прикључак за KDevelop направљен је у %{dest}
+Comment[sr@Latn]=Priključak za KDevelop napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för KDevelop skapades i %{dest}
+Comment[tr]=Bir KDevelop eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了 KDevelop 插件
+Comment[zh_TW]=一個 KDevelop 外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart2.png b/languages/cpp/app_templates/kdevpart2/kdevpart2.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart2.png
Binary files differ
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp b/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp
new file mode 100644
index 00000000..dd86843d
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.cpp
@@ -0,0 +1,183 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}part.h"
+
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kdevplugininfo.h>
+#include <kdevgenericfactory.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <configwidgetproxy.h>
+
+#include "%{APPNAMELC}widget.h"
+#include "%{APPNAMELC}globalconfig.h"
+#include "%{APPNAMELC}projectconfig.h"
+
+typedef KDevGenericFactory<%{APPNAME}Part> %{APPNAME}Factory;
+KDevPluginInfo data("kdev%{APPNAMELC}");
+K_EXPORT_COMPONENT_FACTORY( libkdev%{APPNAMELC}, %{APPNAME}Factory( data ) );
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+%{APPNAME}Part::%{APPNAME}Part(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevPlugin(&data, parent, name ? name : "%{APPNAME}Part")
+{
+ setInstance(%{APPNAME}Factory::instance());
+ setXMLFile("kdev%{APPNAMELC}.rc");
+
+ m_widget = new %{APPNAME}Widget(this);
+ m_widget->setCaption("widget caption");
+ m_widget->setIcon(SmallIcon(info()->icon()));
+
+ QWhatsThis::add(m_widget, i18n("WHAT DOES THIS PART DO?"));
+
+ // now you decide what should happen to the widget. Take a look at kdevcore.h
+ // or at other plugins how to embed it.
+
+ // if you want to embed your widget as an outputview, simply uncomment
+ // the following line.
+ // mainWindow()->embedOutputView( m_widget, "name that should appear", "enter a tooltip" );
+
+ // if you want to embed your widget as a selectview (at the left), simply uncomment
+ // the following line.
+ // mainWindow()->embedSelectView( m_widget, "name that should appear", "enter a tooltip" );
+
+ // if you want to embed your widget as a selectview (at the right), simply uncomment
+ // the following line.
+ // mainWindow()->embedSelectViewRight( m_widget, "name that should appear", "enter a tooltip" );
+
+ setupActions();
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("%{APPNAME}"), GLOBALDOC_OPTIONS, info()->icon());
+ m_configProxy->createProjectConfigPage(i18n("%{APPNAME}"), PROJECTDOC_OPTIONS, info()->icon());
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+ connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()));
+
+
+ QTimer::singleShot(0, this, SLOT(init()));
+}
+
+%{APPNAME}Part::~%{APPNAME}Part()
+{
+// if you embed a widget, you need to tell the mainwindow when you remove it
+// if ( m_widget )
+// {
+// mainWindow()->removeView( m_widget );
+// }
+ delete m_widget;
+ delete m_configProxy;
+}
+
+void %{APPNAME}Part::init()
+{
+// delayed initialization stuff goes here
+}
+
+void %{APPNAME}Part::setupActions()
+{
+// create XMLGUI actions here
+ action = new KAction(i18n("&Do Something..."), 0,
+ this, SLOT(doSomething()), actionCollection(), "plugin_action" );
+ action->setToolTip(i18n("Do something"));
+ action->setWhatsThis(i18n("<b>Do something</b><p>Describe here what does this action do."));
+}
+
+void %{APPNAME}Part::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+// create configuraton dialogs here
+ switch (pageNo)
+ {
+ case GLOBALDOC_OPTIONS:
+ {
+ %{APPNAME}GlobalConfig *w = new %{APPNAME}GlobalConfig(this, page, "global config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ case PROJECTDOC_OPTIONS:
+ {
+ %{APPNAME}ProjectConfig *w = new %{APPNAME}ProjectConfig(this, page, "project config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+void %{APPNAME}Part::contextMenu(QPopupMenu *popup, const Context *context)
+{
+// put actions into the context menu here
+ if (context->hasType(Context::EditorContext))
+ {
+ // editor context menu
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+
+ // use context and plug actions here
+ action->plug(popup);
+
+ // or create menu items on the fly
+ // int id = -1;
+ // id = popup->insertItem(i18n("Do Something Here"),
+ // this, SLOT(doSomething()) );
+ // popup->setWhatsThis(id, i18n("<b>Do something here</b><p>Describe here what does this action do."
+ }
+ else if (context->hasType(Context::FileContext))
+ {
+ // file context menu
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+
+ //use context and plug actions here
+ }
+ else if (context->hasType(Context::ProjectModelItemContext))
+ {
+ // project tree context menu
+ const ProjectModelItemContext *pcontext = static_cast<const ProjectModelItemContext*>(context);
+
+ // use context and plug actions here
+ }
+ else if (context->hasType(Context::CodeModelItemContext))
+ {
+ // class tree context menu
+ const CodeModelItemContext *mcontext = static_cast<const CodeModelItemContext*>(context);
+
+ // use context and plug actions here
+ }
+ else if (context->hasType(Context::DocumentationContext))
+ {
+ // documentation viewer context menu
+ const DocumentationContext *dcontext = static_cast<const DocumentationContext*>(context);
+
+ // use context and plug actions here
+ }
+}
+
+void %{APPNAME}Part::projectOpened()
+{
+// do something when the project is opened
+}
+
+void %{APPNAME}Part::projectClosed()
+{
+// do something when the project is closed
+}
+
+void %{APPNAME}Part::doSomething()
+{
+// do something useful here instead of showing the message box
+ KMessageBox::information(m_widget, i18n("This action does nothing."), i18n("%{APPNAME} Plugin"));
+}
+
+#include "%{APPNAMELC}part.moc"
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.h b/languages/cpp/app_templates/kdevpart2/kdevpart_part.h
new file mode 100644
index 00000000..168b8a40
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.h
@@ -0,0 +1,45 @@
+%{H_TEMPLATE}
+#ifndef KDEV%{APPNAMEUC}_H
+#define KDEV%{APPNAMEUC}_H
+
+#include <kdevplugin.h>
+
+#include <qguardedptr.h>
+
+class QPopupMenu;
+class KAction;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+class %{APPNAME}Widget;
+
+/**
+Please read the README.dox file for more info about this part
+*/
+class %{APPNAME}Part: public KDevPlugin
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Part(QObject *parent, const char *name, const QStringList &args);
+ ~%{APPNAME}Part();
+
+private slots:
+ void init();
+
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void projectOpened();
+ void projectClosed();
+
+ void doSomething();
+
+private:
+ void setupActions();
+
+ KAction *action;
+
+ QGuardedPtr<%{APPNAME}Widget> m_widget;
+ ConfigWidgetProxy *m_configProxy;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc b/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc
new file mode 100644
index 00000000..a38ee14e
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart_part.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="%{APPNAMELC}" library="lib%{APPNAMELC}plugin" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="plugin_action"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="plugin_action"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp
new file mode 100644
index 00000000..0c05b976
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.cpp
@@ -0,0 +1,21 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}widget.h"
+
+#include <kurl.h>
+#include <klibloader.h>
+#include <kparts/part.h>
+
+#include <kdevcore.h>
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}Widget::%{APPNAME}Widget(%{APPNAME}Part *part)
+ : QWidget(0, "%{APPNAMELC} widget"), m_part(part)
+{
+}
+
+%{APPNAME}Widget::~%{APPNAME}Widget()
+{
+}
+
+#include "%{APPNAMELC}widget.moc"
diff --git a/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h
new file mode 100644
index 00000000..e29e29d2
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/kdevpart_widget.h
@@ -0,0 +1,23 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_WIDGET_H
+#define %{APPNAMEUC}_WIDGET_H
+
+#include <qwidget.h>
+#include <qstring.h>
+
+class KDevProject;
+class %{APPNAME}Part;
+
+class %{APPNAME}Widget: public QWidget
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Widget(%{APPNAME}Part *part);
+ ~%{APPNAME}Widget();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart2/projectconfig.cpp b/languages/cpp/app_templates/kdevpart2/projectconfig.cpp
new file mode 100644
index 00000000..5f07993b
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/projectconfig.cpp
@@ -0,0 +1,15 @@
+%{CPP_TEMPLATE}
+#include "%{APPNAMELC}projectconfig.h"
+
+#include "%{APPNAMELC}part.h"
+
+%{APPNAME}ProjectConfig::%{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent, const char *name)
+ : %{APPNAME}ProjectConfigBase(parent, name), m_part(part)
+{
+}
+
+void %{APPNAME}ProjectConfig::accept()
+{
+}
+
+#include "%{APPNAMELC}projectconfig.moc"
diff --git a/languages/cpp/app_templates/kdevpart2/projectconfig.h b/languages/cpp/app_templates/kdevpart2/projectconfig.h
new file mode 100644
index 00000000..ec3ff4df
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/projectconfig.h
@@ -0,0 +1,22 @@
+%{H_TEMPLATE}
+#ifndef %{APPNAMEUC}_PROJECT_CONFIG_H
+#define %{APPNAMEUC}_PROJECT_CONFIG_H
+
+#include "%{APPNAMELC}projectconfigbase.h"
+
+class %{APPNAME}Part;
+
+class %{APPNAME}ProjectConfig: public %{APPNAME}ProjectConfigBase
+{
+ Q_OBJECT
+public:
+ %{APPNAME}ProjectConfig(%{APPNAME}Part *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ %{APPNAME}Part *m_part;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui b/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui
new file mode 100644
index 00000000..c733a774
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/projectconfigbase.ui
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}ProjectConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAME}ProjectConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAME}</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kdevpart2/src-Makefile.am b/languages/cpp/app_templates/kdevpart2/src-Makefile.am
new file mode 100644
index 00000000..dded12c0
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/src-Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(kde_includes)/kdevelop/interfaces -I$(kde_includes)/kdevelop/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdev%{APPNAMELC}.la
+libkdev%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) $(KDE_PLUGIN)
+libkdev%{APPNAMELC}_la_LIBADD = -lkdevelop
+libkdev%{APPNAMELC}_la_SOURCES = %{APPNAMELC}part.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}globalconfigbase.ui %{APPNAMELC}globalconfig.cpp %{APPNAMELC}projectconfigbase.ui %{APPNAMELC}projectconfig.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdev%{APPNAMELC}.desktop
+
+rcdir = $(kde_datadir)/kdev%{APPNAMELC}
+rc_DATA = kdev%{APPNAMELC}.rc
+
+appsharedir = $(kde_datadir)/kdev%{APPNAMELC}
+appshare_DATA =
diff --git a/languages/cpp/app_templates/kdevpart2/subdirs b/languages/cpp/app_templates/kdevpart2/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kdevpart2/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kfileplugin/.kdev_ignore b/languages/cpp/app_templates/kfileplugin/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/.kdev_ignore
diff --git a/languages/cpp/app_templates/kfileplugin/Makefile.am b/languages/cpp/app_templates/kfileplugin/Makefile.am
new file mode 100644
index 00000000..9ac8003d
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = README.devel kfile_plugin.cpp kfile_plugin.desktop \
+ kfile_plugin.h plugin.kdevelop kfileplugin kfileplugin.png \
+ src-Makefile.am subdirs
+templateName = kfileplugin
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kfileplugin/README.devel b/languages/cpp/app_templates/kfileplugin/README.devel
new file mode 100644
index 00000000..21ee67c7
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/README.devel
@@ -0,0 +1,9 @@
+@todo:
+
+1. add information to src/kfile_%{APPNAMELC}.desktop
+MimeType=
+PreferredGroups=
+PreferredItems=
+
+2. plugin
+Note: Please change to "Optimized" compilation if you want to make a release.
diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp b/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp
new file mode 100644
index 00000000..3e6b849a
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.cpp
@@ -0,0 +1,55 @@
+%{CPP_TEMPLATE}
+
+#include <config.h>
+#include "kfile_%{APPNAMELC}.h"
+
+#include <kgenericfactory.h>
+//#include <kio/global.h>
+
+//#include <qfileinfo.h>
+//#include <qdir.h>
+
+typedef KGenericFactory<%{APPNAME}Plugin> %{APPNAME}Factory;
+
+K_EXPORT_COMPONENT_FACTORY(kfile_%{APPNAME}, %{APPNAME}Factory( "kfile_%{APPNAMELC}" ))
+
+%{APPNAME}Plugin::%{APPNAME}Plugin(QObject *parent, const char *name,
+ const QStringList &args)
+ : KFilePlugin(parent, name, args)
+{
+ //add the mimetype here - example:
+ //KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" );
+ KFileMimeTypeInfo* info = addMimeTypeInfo( "text/html" );
+
+ // our new group
+ KFileMimeTypeInfo::GroupInfo* group = 0L;
+ group = addGroupInfo(info, "%{APPNAME}Info", i18n("%{APPNAME} Information"));
+
+ KFileMimeTypeInfo::ItemInfo* item;
+
+ // our new items in the group
+ item = addItemInfo(group, "Items", i18n("Items"), QVariant::Int);
+ item = addItemInfo(group, "Size", i18n("Size"), QVariant::Int);
+ setUnit(item, KFileMimeTypeInfo::KiloBytes);
+
+ // strings are possible, too:
+ //addItemInfo(group, "Text", i18n("Document Type"), QVariant::String);
+}
+
+bool %{APPNAME}Plugin::readInfo( KFileMetaInfo& info, uint /*what*/)
+{
+ KFileMetaInfoGroup group = appendGroup(info, "%{APPNAME}Info");
+
+ // add your "calculations" here
+ // if something goes wrong, "return false;"
+
+
+ // and finally display it!
+ appendItem(group, "Items", 100);
+ appendItem(group, "Size", int(5000/1024));
+
+ return true;
+}
+
+#include "kfile_%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop b/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop
new file mode 100644
index 00000000..9af8b5e9
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Type=Service
+Name=%{APPNAME} Info
+Name[br]=Titouriñ diwar-benn %{APPNAME}
+Name[ca]=Informació per a %{APPNAME}
+Name[da]=%{APPNAME} info
+Name[el]=Πληροφορίες %{APPNAME}
+Name[es]=Información de %{APPNAME}
+Name[et]=%{APPNAME} info
+Name[eu]=%{APPNAME} informazioa
+Name[fa]=اطلاعات %{APPNAME}
+Name[fr]=Informations sur %{APPNAME}
+Name[ga]=Eolas faoi %{APPNAME}
+Name[gl]=Información de %{APPNAME}
+Name[hu]=%{APPNAME} jellemzői
+Name[it]=Informazioni su %{APPNAME}
+Name[nds]=%{APPNAME}-Info
+Name[ne]=%{APPNAME} सूचना
+Name[pl]=Informacje dla %{APPNAME}
+Name[pt]=Informação do %{APPNAME}
+Name[pt_BR]=Informações de %{APPNAME}
+Name[ru]=Информация о %{APPNAME}
+Name[sk]=%{APPNAME} info
+Name[sl]=Informacije o %{APPNAME}
+Name[sr]=Информације за %{APPNAME}
+Name[sr@Latn]=Informacije za %{APPNAME}
+Name[sv]=%{APPNAME} information
+Name[ta]=%{APPNAME} தகவல்
+Name[tg]=Маълумот дар бораи %{APPNAME}
+Name[zh_CN]=%{APPNAME}的信息
+Name[zh_TW]=%{APPNAME} 資訊
+ServiceTypes=KFilePlugin
+X-KDE-Library=kfile_%{APPNAMELC}
+# change MimeType here! (example: inode/directory)
+MimeType=
+# change PreferredGroups here! (example: FolderInfo)
+PreferredGroups=
+# change PreferredItems here! (example: Items;Size)
+PreferredItems=
diff --git a/languages/cpp/app_templates/kfileplugin/kfile_plugin.h b/languages/cpp/app_templates/kfileplugin/kfile_plugin.h
new file mode 100644
index 00000000..358b4dcb
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfile_plugin.h
@@ -0,0 +1,24 @@
+%{H_TEMPLATE}
+
+#ifndef __KFILE_%{APPNAMEUC}_H__
+#define __KFILE_%{APPNAMEUC}_H__
+
+/**
+ * Note: For further information look into <$KDEDIR/include/kfilemetainfo.h>
+ */
+#include <kfilemetainfo.h>
+
+class QStringList;
+
+class %{APPNAME}Plugin: public KFilePlugin
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}Plugin( QObject *parent, const char *name, const QStringList& args );
+
+ virtual bool readInfo( KFileMetaInfo& info, uint what);
+};
+
+#endif // __KFILE_%{APPNAMEUC}_H__
+
diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin b/languages/cpp/app_templates/kfileplugin/kfileplugin
new file mode 100644
index 00000000..6717cdc2
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfileplugin
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Name=KFile plugin
+Icon=kfileplugin.png
+Category=C++/KDE
+Comment=Generates a KFile plugin for konqueror to display meta information.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=README.devel,src/kfile_APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate b/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate
new file mode 100644
index 00000000..edff2fd4
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfileplugin.kdevtemplate
@@ -0,0 +1,166 @@
+# KDE Config File
+[General]
+Name=KFile plugin
+Name[br]=Lugent KFile
+Name[ca]=Connector KFile
+Name[de]=KFile-Modul
+Name[el]=Πρόσθετο KFile
+Name[es]=Complemento para KFile
+Name[et]=KFile'i plugin
+Name[eu]=KFile plugin-a
+Name[fa]=وصلۀ KFile
+Name[fr]=Module externe KFile
+Name[ga]=Breiseán KFile
+Name[gl]=Extensión para KFile
+Name[hu]=KFile-bővítőmodul
+Name[it]=Plugin KFile
+Name[ja]=KFile プラグイン
+Name[nds]=KFile-Moduul
+Name[ne]=केडीई फाइल प्लगइन
+Name[nl]=KFile-plugin
+Name[pl]=Wtyczka do KFile
+Name[pt]='Plugin' do KFile
+Name[pt_BR]='Plugin' do KFile
+Name[ru]=Модуль KFile
+Name[sk]=KFile modul
+Name[sl]=Vstavek za KFile
+Name[sr]=Прикључак за KFile
+Name[sr@Latn]=Priključak za KFile
+Name[sv]=KFile-insticksprogram
+Name[tr]=KFile Eklentisi
+Name[zh_CN]=KFile 插件
+Name[zh_TW]=KFile 外掛程式
+Icon=kfileplugin.png
+Category=C++/KDE
+Comment=Generates a KFile plugin for konqueror to display meta information.
+Comment[ca]=Genera un connector KFile per al konqueror per a mostrar meta informació.
+Comment[da]=Genererer et KFile-plugin for konqueror til at vise meta-information.
+Comment[de]=Erstellt ein KFile-Modul für Konqueror zur Anzeige von Meta-Daten.
+Comment[el]=Δημιουργεί ένα πρόσθετο KFile για την εμφάνιση μεταπληροφοριών στον konqueror.
+Comment[es]=Genera un complemento de KFile para Konqueror que muestra metainformación.
+Comment[et]=Konquerori KFile'i plugina loomine, mis näitab metainfot.
+Comment[eu]=Meta-informazioa bistaratzeko Konqueror-en KFile plugin bat sortzen du.
+Comment[fa]=یک وصلۀ KFile برای konqueror جهت نمایش فرااطلاعات تولید می‌کند.
+Comment[fr]=Génère un module externe KFile pour que Konqueror affiche des méta-informations.
+Comment[gl]=Xera unha extensión para KFile para permitir a konqueror mostrar metainformación.
+Comment[hu]=Létrehoz egy KFile-bővítőmodult, mellyel a Konquerorban dokumentumjellemzőket lehet megjeleníteni.
+Comment[it]=Genera un plugin KFile per Konqueror per mostrare meta informazioni.
+Comment[nds]=Stellt en KFile-Moduul för Konqueror op, dat Metadaten wiest.
+Comment[ne]=मेटा सूचना देखाउन कन्क्वेररका लागि केडीई फाइल प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een KFile-plugin voor konqueror voor het weergeven van meta-informatie.
+Comment[pl]=Generuje wtyczkę KFile dla Konquerora do wyświetlania informacji meta.
+Comment[pt]=Gera um 'plugin' do KFile para o Konqueror poder mostrar meta-informações.
+Comment[pt_BR]=Gera um 'plugin' do KFile para o Konqueror poder mostrar meta-informações.
+Comment[ru]=Создание модуля KFile для показа метаданных в Konqueror.
+Comment[sk]=Vygeneruje KFile modul pre konqueror na zobrazenie meta informácií.
+Comment[sr]=Прави прикључак за KFile за приказ метаинформација у Konqueror-у.
+Comment[sr@Latn]=Pravi priključak za KFile za prikaz metainformacija u Konqueror-u.
+Comment[sv]=Skapar ett KFile-insticksprogram till Konqueror för att visa metainformation.
+Comment[tr]=Meta bilgisini göstermesi için Konqueror'a bir KFile eklentisi yaratır.
+Comment[zh_CN]=生成一个可显示元信息的 Konqueror KFile 插件。
+Comment[zh_TW]=產生一個 Konqueror 的 KFile 外掛程式,顯示中繼資訊
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=${dest}/README.devel,%{dest}/src/kfile_%{APPNAMELC}.cpp
+Archive=kfileplugin.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/kfile_plugin.desktop
+Dest=%{dest}/src/kfile_%{APPNAMELC}.desktop
+
+[FILE13]
+Type=install
+Source=%{src}/kfile_plugin.cpp
+Dest=%{dest}/src/kfile_%{APPNAMELC}.cpp
+
+[FILE14]
+Type=install
+Source=%{src}/kfile_plugin.h
+Dest=%{dest}/src/kfile_%{APPNAMELC}.h
+
+[FILE15]
+Type=install
+Source=%{src}/README.devel
+Dest=%{dest}/README.devel
+
diff --git a/languages/cpp/app_templates/kfileplugin/kfileplugin.png b/languages/cpp/app_templates/kfileplugin/kfileplugin.png
new file mode 100644
index 00000000..d2a56245
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/kfileplugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kfileplugin/plugin.kdevelop b/languages/cpp/app_templates/kfileplugin/plugin.kdevelop
new file mode 100644
index 00000000..a95b52f9
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/plugin.kdevelop
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+<kdevautoproject>
+ <general>
+ <activetarget>src/kfile_%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kfileplugin/src-Makefile.am b/languages/cpp/app_templates/kfileplugin/src-Makefile.am
new file mode 100644
index 00000000..48ac1c66
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/src-Makefile.am
@@ -0,0 +1,22 @@
+## Makefile.am for folder file meta info plugin
+
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = kfile_%{APPNAMELC}.h
+
+kde_module_LTLIBRARIES = kfile_%{APPNAMELC}.la
+
+kfile_%{APPNAMELC}_la_SOURCES = kfile_%{APPNAMELC}.cpp
+kfile_%{APPNAMELC}_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+kfile_%{APPNAMELC}_la_LIBADD = $(LIB_KIO)
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+services_DATA = kfile_%{APPNAMELC}.desktop
+servicesdir = $(kde_servicesdir)
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kfile_%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kfileplugin/subdirs b/languages/cpp/app_templates/kfileplugin/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kfileplugin/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/khello/.kdev_ignore b/languages/cpp/app_templates/khello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/khello/.kdev_ignore
diff --git a/languages/cpp/app_templates/khello/Makefile.am b/languages/cpp/app_templates/khello/Makefile.am
new file mode 100644
index 00000000..6f788f99
--- /dev/null
+++ b/languages/cpp/app_templates/khello/Makefile.am
@@ -0,0 +1,18 @@
+# all khello data files
+dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \
+ subdirs app.desktop khello.png
+templateName = khello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/khello/app.cpp b/languages/cpp/app_templates/khello/app.cpp
new file mode 100644
index 00000000..44332685
--- /dev/null
+++ b/languages/cpp/app_templates/khello/app.cpp
@@ -0,0 +1,23 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+
+#include <qlabel.h>
+
+#include <kmainwindow.h>
+#include <klocale.h>
+
+%{APPNAME}::%{APPNAME}()
+ : KMainWindow( 0, "%{APPNAME}" )
+{
+ // set the shell's ui resource file
+ setXMLFile("%{APPNAMELC}ui.rc");
+
+ new QLabel( "Hello World", this, "hello label" );
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/khello/app.desktop b/languages/cpp/app_templates/khello/app.desktop
new file mode 100644
index 00000000..8b36e6e0
--- /dev/null
+++ b/languages/cpp/app_templates/khello/app.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple KDE Application
+Comment[br]=Ur meziant eeun evit KDE
+Comment[ca]=Una simple aplicació per al KDE
+Comment[da]=Et simpelt KDE program
+Comment[de]=Eine einfache KDE-Anwendung
+Comment[el]=Μια απλή εφαρμογή του KDE
+Comment[es]=Una aplicación de KDE sencilla
+Comment[et]=Lihtne KDE rakendus
+Comment[eu]=KDE aplikazio simple bat
+Comment[fa]=یک کاربرد سادۀ KDE
+Comment[fr]=Une application simple pour KDE
+Comment[ga]=Feidhmchlár Simplí KDE
+Comment[gl]=Unha aplicación KDE sinxela
+Comment[hi]=एक सादा केडीई अनुप्रयोग
+Comment[hu]=Egyszerű KDE-alkalmazás
+Comment[is]=Einfalt KDE forrit
+Comment[it]=Una semplice applicazione KDE
+Comment[ja]=簡単な KDE アプリケーション
+Comment[nds]=En eenfach KDE-Programm
+Comment[ne]=एउटा साधारण केडीई अनुप्रयोग
+Comment[nl]=Een eenvoudige KDE-toepassing
+Comment[pl]=Prosty program KDE
+Comment[pt]=Uma aplicação simples do KDE
+Comment[pt_BR]=Um simples Aplicativo do KDE
+Comment[ru]=Простое приложение KDE
+Comment[sk]=Jednoduchá KDE aplikácia
+Comment[sl]=Preprost program za KDE
+Comment[sr]=Једноставан KDE програм
+Comment[sr@Latn]=Jednostavan KDE program
+Comment[sv]=Ett enkelt KDE-program
+Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு
+Comment[tg]=Гузориши оддиKDE
+Comment[tr]=Basit bir KDE Uygulaması
+Comment[zh_CN]=一个简单的 KDE 应用程序
+Comment[zh_TW]=簡單的 KDE 應用程式
diff --git a/languages/cpp/app_templates/khello/app.h b/languages/cpp/app_templates/khello/app.h
new file mode 100644
index 00000000..678df7a3
--- /dev/null
+++ b/languages/cpp/app_templates/khello/app.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kmainwindow.h>
+
+/**
+ * @short Application Main Window
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+};
+
+#endif // _%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/khello/app.kdevelop b/languages/cpp/app_templates/khello/app.kdevelop
new file mode 100644
index 00000000..7e6cf8da
--- /dev/null
+++ b/languages/cpp/app_templates/khello/app.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/khello/appui.rc b/languages/cpp/app_templates/khello/appui.rc
new file mode 100644
index 00000000..ceb4f14e
--- /dev/null
+++ b/languages/cpp/app_templates/khello/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="custom"><text>C&amp;ustom</text>
+ <Action name="custom_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/khello/khello.kdevtemplate b/languages/cpp/app_templates/khello/khello.kdevtemplate
new file mode 100644
index 00000000..e401fa5d
--- /dev/null
+++ b/languages/cpp/app_templates/khello/khello.kdevtemplate
@@ -0,0 +1,220 @@
+# KDE Config File
+[General]
+Name=Simple KDE Application
+Name[ca]=Una simple aplicació per al KDE
+Name[da]=Et simpelt KDE program
+Name[de]=Einfache KDE-Anwendung
+Name[el]=Απλή εφαρμογή του KDE
+Name[es]=Aplicación de KDE sencilla
+Name[et]=Lihtne KDE rakendus
+Name[eu]=KDE aplikazio simple bat
+Name[fa]=کاربرد سادۀ KDE
+Name[fr]=Application KDE simple
+Name[ga]=Feidhmchlár Simplí KDE
+Name[gl]=Aplicación KDE sinxela
+Name[hu]=Egyszerű KDE-s alkalmazás
+Name[it]=Una semplice applicazione KDE
+Name[ja]=簡単な KDE アプリケーション
+Name[nds]=Eenfach KDE-Programm
+Name[ne]=साधारण केडीई अनुप्रयोग
+Name[nl]=Eenvoudige KDE-toepassing
+Name[pl]=Prosty program dla KDE
+Name[pt]=Aplicação Simples do KDE
+Name[pt_BR]=Aplicação Simples do KDE
+Name[ru]=Простое приложение KDE
+Name[sk]=Jednoduchá KDE aplikácia
+Name[sl]=Preprost program za KDE
+Name[sr]=Једноставан KDE програм
+Name[sr@Latn]=Jednostavan KDE program
+Name[sv]=Enkelt KDE-program
+Name[tr]=Basit KDE Uygulaması
+Name[zh_CN]=简单的 KDE 应用程序
+Name[zh_TW]=簡單的 KDE 應用程式
+Category=C++/KDE
+Icon=khello.png
+Comment=Generates a simple KDE application with one widget.
+Comment[ca]=Genera una simple aplicació per al KDE amb un estri.
+Comment[da]=Genererer et simpelt KDE program men en kontrol
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Oberflächenelement
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό.
+Comment[es]=Genera una sencilla aplicación para KDE con una ventana.
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidinaga.
+Comment[eu]=Trepeta bakarra duen KDE aplikazio simple bat sortzen du.
+Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر تولید می‌کند.
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget).
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin.
+Comment[gl]=Xera unha aplicación KDE sinxela con un compoñente.
+Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást, egy grafikus elemmel.
+Comment[it]=Genera una semplice applicazione KDE senza elementi grafici.
+Comment[ja]=ウィジェットを一つ含んだ簡単な KDE アプリケーションを作成します。
+Comment[nds]=Stellt en eenfach KDE-Programm mit een Element op.
+Comment[ne]=एउटा विगेटसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget.
+Comment[pl]=Generuje prosty program dla KDE z jednym widgetem.
+Comment[pt]=Gera uma aplicação simples para o KDE com uma janela.
+Comment[pt_BR]=Gera uma aplicação simples para o KDE com uma janela.
+Comment[ru]=Создание простого приложения KDE с одним окном.
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom.
+Comment[sl]=Ustvari preprost program za KDE z enim gradnikom.
+Comment[sr]=Прави једноставан KDE програм са једном контролом.
+Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom.
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent.
+Comment[tr]=Tek parçacıklı basit bir KDE uygulaması yaratır.
+Comment[zh_CN]=生成只有一个部件的 KDE 应用程序。
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=khello.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE9]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[FILE13]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE14]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE16]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE17]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE18]
+Type=install
+Source=%{src}/app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A KDE Hello world program was created in %{dest}
+Comment[ca]=Un programa de Hello world per al KDE ha estat creat en %{dest}
+Comment[da]=Et KDE Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein KDE-"Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόγραμμα Γεια σου Κόσμε του KDE δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» para KDE ha sido creado en %{dest}
+Comment[et]=KDE "Tere, maailm" programm loodi asukohta %{dest}
+Comment[eu]=KDE-ren "Kaixo mundua" programa bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ KDE Hello world در %{dest} ایجاد شد
+Comment[fr]=Un programme KDE « Bonjour monde » a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár "Hello World" KDE i %{dest}
+Comment[gl]=Creouse un programa KDE Ola mundo en %{dest}
+Comment[hu]=Létrejött egy KDE Hello world program itt: %{dest}
+Comment[it]=È stato creato un semplice programma KDE di "Hello world" in %{dest}
+Comment[ja]=KDE Hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en "Moin Welt"-Programm för KDE opstellt
+Comment[ne]=केडीई हेल्लो वोल्ड कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KDE Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Program 'Witaj świecie' dla KDE został utworzony w %{dest}
+Comment[pt]=Foi criado um programa Olá Mundo do KDE em %{dest}
+Comment[pt_BR]=Foi criado um programa Olá Mundo do KDE em %{dest}
+Comment[ru]=Приложение KDE Hello world создано в %{dest}
+Comment[sk]=KDE Ahoj svet program bol vytvorený v %{dest}
+Comment[sl]=Program Hello World za KDE je bil ustvarjen v %{dest}
+Comment[sr]=KDE „Здраво свете“ програм направљен је у %{dest}
+Comment[sr@Latn]=KDE „Zdravo svete“ program napravljen je u %{dest}
+Comment[sv]=Ett KDE Hello world-program skapades i %{dest}
+Comment[tr]=Bir KDE Merhaba Dünya programı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了 KDE Hello world 程序
+Comment[zh_TW]=一個 KDE Hello World 程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/khello/khello.png b/languages/cpp/app_templates/khello/khello.png
new file mode 100644
index 00000000..9fe493f5
--- /dev/null
+++ b/languages/cpp/app_templates/khello/khello.png
Binary files differ
diff --git a/languages/cpp/app_templates/khello/main.cpp b/languages/cpp/app_templates/khello/main.cpp
new file mode 100644
index 00000000..da7c5335
--- /dev/null
+++ b/languages/cpp/app_templates/khello/main.cpp
@@ -0,0 +1,51 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+ %{APPNAME} *mainWin = 0;
+
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ /// @todo do something with the command line args here
+
+ mainWin = new %{APPNAME}();
+ app.setMainWidget( mainWin );
+ mainWin->show();
+
+ args->clear();
+ }
+
+ // mainWin has WDestructiveClose flag by default, so it will delete itself.
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/khello/src-Makefile.am b/languages/cpp/app_templates/khello/src-Makefile.am
new file mode 100644
index 00000000..d9ac7c7a
--- /dev/null
+++ b/languages/cpp/app_templates/khello/src-Makefile.am
@@ -0,0 +1,35 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# the application source, library search path, and link libraries
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+%{APPNAMELC}_LDADD = $(LIB_KDEUI)
+
+# this is where the desktop file will go
+shelldesktopdir = $(kde_appsdir)/Utilities
+shelldesktop_DATA = %{APPNAMELC}.desktop
+
+# this is where the shell's XML-GUI resource file goes
+shellrcdir = $(kde_datadir)/%{APPNAMELC}
+shellrc_DATA = %{APPNAMELC}ui.rc
+
diff --git a/languages/cpp/app_templates/khello/subdirs b/languages/cpp/app_templates/khello/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/khello/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/khello2/.kdev_ignore b/languages/cpp/app_templates/khello2/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/.kdev_ignore
diff --git a/languages/cpp/app_templates/khello2/Makefile.am b/languages/cpp/app_templates/khello2/Makefile.am
new file mode 100644
index 00000000..8ac1b18d
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \
+ subdirs app.desktop khello2.png widget.cpp widget.h widgetbase.ui
+
+templateName = khello2
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/khello2/app.cpp b/languages/cpp/app_templates/khello2/app.cpp
new file mode 100644
index 00000000..948a98fc
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/app.cpp
@@ -0,0 +1,19 @@
+%{CPP_TEMPLATE}
+
+#include <kmainwindow.h>
+#include <klocale.h>
+
+#include "%{APPNAMELC}.h"
+#include "%{APPNAMELC}widget.h"
+
+%{APPNAME}::%{APPNAME}()
+ : KMainWindow( 0, "%{APPNAME}" )
+{
+ setCentralWidget( new %{APPNAME}Widget( this ) );
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/khello2/app.desktop b/languages/cpp/app_templates/khello2/app.desktop
new file mode 100644
index 00000000..8b36e6e0
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/app.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple KDE Application
+Comment[br]=Ur meziant eeun evit KDE
+Comment[ca]=Una simple aplicació per al KDE
+Comment[da]=Et simpelt KDE program
+Comment[de]=Eine einfache KDE-Anwendung
+Comment[el]=Μια απλή εφαρμογή του KDE
+Comment[es]=Una aplicación de KDE sencilla
+Comment[et]=Lihtne KDE rakendus
+Comment[eu]=KDE aplikazio simple bat
+Comment[fa]=یک کاربرد سادۀ KDE
+Comment[fr]=Une application simple pour KDE
+Comment[ga]=Feidhmchlár Simplí KDE
+Comment[gl]=Unha aplicación KDE sinxela
+Comment[hi]=एक सादा केडीई अनुप्रयोग
+Comment[hu]=Egyszerű KDE-alkalmazás
+Comment[is]=Einfalt KDE forrit
+Comment[it]=Una semplice applicazione KDE
+Comment[ja]=簡単な KDE アプリケーション
+Comment[nds]=En eenfach KDE-Programm
+Comment[ne]=एउटा साधारण केडीई अनुप्रयोग
+Comment[nl]=Een eenvoudige KDE-toepassing
+Comment[pl]=Prosty program KDE
+Comment[pt]=Uma aplicação simples do KDE
+Comment[pt_BR]=Um simples Aplicativo do KDE
+Comment[ru]=Простое приложение KDE
+Comment[sk]=Jednoduchá KDE aplikácia
+Comment[sl]=Preprost program za KDE
+Comment[sr]=Једноставан KDE програм
+Comment[sr@Latn]=Jednostavan KDE program
+Comment[sv]=Ett enkelt KDE-program
+Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு
+Comment[tg]=Гузориши оддиKDE
+Comment[tr]=Basit bir KDE Uygulaması
+Comment[zh_CN]=一个简单的 KDE 应用程序
+Comment[zh_TW]=簡單的 KDE 應用程式
diff --git a/languages/cpp/app_templates/khello2/app.h b/languages/cpp/app_templates/khello2/app.h
new file mode 100644
index 00000000..678df7a3
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/app.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kmainwindow.h>
+
+/**
+ * @short Application Main Window
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+};
+
+#endif // _%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/khello2/app.kdevelop b/languages/cpp/app_templates/khello2/app.kdevelop
new file mode 100644
index 00000000..43425791
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/app.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/khello2/appui.rc b/languages/cpp/app_templates/khello2/appui.rc
new file mode 100644
index 00000000..ceb4f14e
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="custom"><text>C&amp;ustom</text>
+ <Action name="custom_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/khello2/khello2.kdevtemplate b/languages/cpp/app_templates/khello2/khello2.kdevtemplate
new file mode 100644
index 00000000..479d7496
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/khello2.kdevtemplate
@@ -0,0 +1,230 @@
+# KDE Config File
+[General]
+Name=Simple Designer based KDE Application
+Name[ca]=Simple aplicació per al KDE basada en el dissenyador
+Name[da]=Simpelt Designer-baseret KDE program
+Name[de]=Einfache, auf Designer basierende KDE-Anwendung
+Name[el]=Απλή εφαρμογή KDE βασισμένη στο σχεδιαστή
+Name[es]=Aplicación para KDE sencilla basada en el diseñador
+Name[et]=Lihtne KDE rakendus Disaineri põhjal
+Name[eu]=Designer-en oinarritutako KDE aplikazio simple bat
+Name[fa]=کاربرد KDE بر مبنای طراح ساده
+Name[fr]=Application KDE simple basée sur Designer
+Name[gl]=Aplicación KDE sinxela baseada no deseñador
+Name[hu]=Egyszerű Qt Designer-alapú KDE-s alkalmazás
+Name[it]=Una semplice applicazione KDE basata su designer
+Name[ja]=Designer ベースの簡単な KDE アプリケーション
+Name[nds]=Eenfach, op "Designer" opbuut KDE-Programm
+Name[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग
+Name[nl]=Eenvoudige Designer-gebaseerde KDE-toepassing
+Name[pl]=Prosty program dla KDE wykonany w Designerze
+Name[pt]=Aplicação Simples do KDE baseada no Qt Designer
+Name[pt_BR]=Aplicação Simples do KDE baseada no Qt Designer
+Name[ru]=Простое приложение KDE с формой
+Name[sk]=Jednoduchý dizajnér založený na KDE aplikácii
+Name[sr]=Једноставан KDE програм на основу Designer-а
+Name[sr@Latn]=Jednostavan KDE program na osnovu Designer-a
+Name[sv]=Enkelt KDE-program baserat på Designer
+Name[tr]=Basit Designer tabanlı KDE Uygulaması
+Name[zh_CN]=基于设计师的简单 KDE 应用程序
+Name[zh_TW]=簡單的設計器 KDE 應用程式
+Category=C++/KDE
+Icon=khello2.png
+Comment=Generates a simple KDE application with one Qt-designer based widget.
+Comment[ca]=Genera una simple aplicació per al KDE basada en el dissenyador de Qt.
+Comment[da]=Genererer et simpelt KDE program med en Qt-designer baseret kontrol.
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem auf Qt-Designer basierenden Widget.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό βασισμένο στο σχεδιαστή Qt.
+Comment[es]=Genera una sencilla aplicación para KDE con una ventana basada en Qt-designer.
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidinaga Qt Disaineri põhjal.
+Comment[eu]=Qt Designer-en oinarritutako trepeta bat duen KDE aplikazio sinple bat sortzen du.
+Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر مبنای طراح Qt تولید می‌کند.
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) basé sur Qt-designer.
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin bunaithe ar Qt-Designer
+Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente baseada en Qt-designer.
+Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást, mely egy Qt Designerrel készített grafikus elemre épül.
+Comment[it]=Genera una semplice applicazione KDE con un elemento grafico basato su Qt-designer.
+Comment[nds]=Stellt en eenfach KDE-Programm mit een op Qt-Designer opbuut Element op.
+Comment[ne]=क्यू टी डिजाइनरमा आधारित विगेटसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één Qt-Designer-gebaseerde widget.
+Comment[pl]=Generuje prosty program dla KDE z jednym widgetem pochodzącym z Qt Designera.
+Comment[pt]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer.
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma interface baseada no Qt-designer.
+Comment[ru]=Создание простого приложения KDE с формой, созданной в Qt Designer.
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom Qt dizajnéra.
+Comment[sr]=Прави једноставан KDE програма са једном контролом на основу Qt-Designer-а.
+Comment[sr@Latn]=Pravi jednostavan KDE programa sa jednom kontrolom na osnovu Qt-Designer-a.
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent baserad på Qt-Designer.
+Comment[tr]=Qt-designer tabanlı bir parçacığı olan basit bir KDE uygulaması yaratır.
+Comment[zh_CN]=生成一个带一个基于 Qt 设计师部件的简单 KDE 应用程序。
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含 Qt 設計器的元件
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=khello2.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE9]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[FILE13]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE14]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE16]
+Type=install
+Source=%{src}/widget.cpp
+Dest=%{dest}/src/%{APPNAMELC}widget.cpp
+
+[FILE17]
+Type=install
+Source=%{src}/widget.h
+Dest=%{dest}/src/%{APPNAMELC}widget.h
+
+[FILE18]
+Type=install
+EscapeXML=true
+Source=%{src}/widgetbase.ui
+Dest=%{dest}/src/%{APPNAMELC}widgetbase.ui
+
+[FILE19]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE21]
+Type=install
+Source=%{src}/app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A simple designer based KDE application was created in %{dest}
+Comment[ca]=A simple aplicació per al KDE basada en el dissenyador ha estat creada en %{dest}
+Comment[da]=Et simpelt designer-baseret KDE program blev oprettet i %{dest}
+Comment[de]=Eine einfache, auf Designer basierende KDE-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια απλή εφαρμογή KDE βασισμένη στο σχεδιαστή δημιουργήθηκε στο %{dest}
+Comment[es]=Una sencilla aplicación para KDE basada en el diseñador ha sido creada en %{dest}
+Comment[et]=Lihtne KDE rakendus Disaineri põhjal loodi asukohta %{dest}
+Comment[eu]=Designer-en oinarritutako KDE aplikazio simple bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد ساده‌ای بر مبنای طراح در %{dest} ایجاد شد
+Comment[fr]=Une application KDE simple basée sur Designer a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár simplí KDE bunaithe ar Qt-Designer i %{dest}
+Comment[gl]=Creouse unha aplicación KDE baseada no deseñador en %{dest}
+Comment[hu]=Létrejött egy egyszerű, Qt Designer-alapú KDE-s alkalmazás itt: %{dest}
+Comment[it]=È stata creata una semplice applicazione KDE basata su designer
+Comment[ja]=Designer ベースの簡単な KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach op "Designer" opbuut KDE-Programm opstellt
+Comment[ne]=साधारण डिजाइनरमा आधारित केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudige Designer-gebaseerde KDE-toepassing is aangemaakt in %{dest}
+Comment[pl]=Prosty program wykorzystujący Qt Designera został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação simples do KDE em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação simples do KDE em %{dest}
+Comment[ru]=Простое приложение KDE с формой создано в %{dest}
+Comment[sk]=Jednoduchý dizajnér založený na KDE aplikácii bol vytvorený v %{dest}
+Comment[sr]=Једноставан KDE програм на основу Designer-а направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan KDE program na osnovu Designer-a napravljen je u %{dest}
+Comment[sv]=Ett enkelt KDE-program baserat på Designer skapades i %{dest}
+Comment[tr]=Designer tabanlı basit bir KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个基于设计师的简单 KDE 应用程序
+Comment[zh_TW]=一個簡單的設計器 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/khello2/khello2.png b/languages/cpp/app_templates/khello2/khello2.png
new file mode 100644
index 00000000..97422793
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/khello2.png
Binary files differ
diff --git a/languages/cpp/app_templates/khello2/main.cpp b/languages/cpp/app_templates/khello2/main.cpp
new file mode 100644
index 00000000..278eef46
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/main.cpp
@@ -0,0 +1,51 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+// { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+ %{APPNAME} *mainWin = 0;
+
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ /// @todo do something with the command line args here
+
+ mainWin = new %{APPNAME}();
+ app.setMainWidget( mainWin );
+ mainWin->show();
+
+ args->clear();
+ }
+
+ // mainWin has WDestructiveClose flag by default, so it will delete itself.
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/khello2/src-Makefile.am b/languages/cpp/app_templates/khello2/src-Makefile.am
new file mode 100644
index 00000000..4664fe84
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/src-Makefile.am
@@ -0,0 +1,35 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# the application source, library search path, and link libraries
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}widgetbase.ui
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+%{APPNAMELC}_LDADD = $(LIB_KDEUI)
+
+# this is where the desktop file will go
+shelldesktopdir = $(kde_appsdir)/Utilities
+shelldesktop_DATA = %{APPNAMELC}.desktop
+
+# this is where the shell's XML-GUI resource file goes
+shellrcdir = $(kde_datadir)/%{APPNAMELC}
+shellrc_DATA = %{APPNAMELC}ui.rc
+
diff --git a/languages/cpp/app_templates/khello2/subdirs b/languages/cpp/app_templates/khello2/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/khello2/widget.cpp b/languages/cpp/app_templates/khello2/widget.cpp
new file mode 100644
index 00000000..6775ac39
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/widget.cpp
@@ -0,0 +1,30 @@
+%{CPP_TEMPLATE}
+
+#include <qlabel.h>
+
+#include "%{APPNAMELC}widget.h"
+
+%{APPNAME}Widget::%{APPNAME}Widget(QWidget* parent, const char* name, WFlags fl)
+ : %{APPNAME}WidgetBase(parent,name,fl)
+{}
+
+%{APPNAME}Widget::~%{APPNAME}Widget()
+{}
+
+/*$SPECIALIZATION$*/
+void %{APPNAME}Widget::button_clicked()
+{
+ if ( label->text().isEmpty() )
+ {
+ label->setText( "Hello World!" );
+ }
+ else
+ {
+ label->clear();
+ }
+}
+
+
+
+#include "%{APPNAMELC}widget.moc"
+
diff --git a/languages/cpp/app_templates/khello2/widget.h b/languages/cpp/app_templates/khello2/widget.h
new file mode 100644
index 00000000..275e13c7
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/widget.h
@@ -0,0 +1,30 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}WIDGET_H_
+#define _%{APPNAMEUC}WIDGET_H_
+
+#include "%{APPNAMELC}widgetbase.h"
+
+class %{APPNAME}Widget : public %{APPNAME}WidgetBase
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}Widget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~%{APPNAME}Widget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void button_clicked();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+};
+
+#endif
+
diff --git a/languages/cpp/app_templates/khello2/widgetbase.ui b/languages/cpp/app_templates/khello2/widgetbase.ui
new file mode 100644
index 00000000..e6f5be3d
--- /dev/null
+++ b/languages/cpp/app_templates/khello2/widgetbase.ui
@@ -0,0 +1,52 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>%{APPNAME}WidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAMELC}widgetbase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>220</width>
+ <height>133</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>button</cstring>
+ </property>
+ <property name="text">
+ <string>Click Me!</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>button</sender>
+ <signal>clicked()</signal>
+ <receiver>%{APPNAMELC}widgetbase</receiver>
+ <slot>button_clicked()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>button_clicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kicker/.kdev_ignore b/languages/cpp/app_templates/kicker/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/.kdev_ignore
diff --git a/languages/cpp/app_templates/kicker/Makefile.am b/languages/cpp/app_templates/kicker/Makefile.am
new file mode 100644
index 00000000..168a93c9
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = applet.cpp applet.h applet.desktop applet.kdevelop \
+ src-Makefile.am kicker.png subdirs
+templateName = kicker
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kicker/applet.cpp b/languages/cpp/app_templates/kicker/applet.cpp
new file mode 100644
index 00000000..5345ac0c
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/applet.cpp
@@ -0,0 +1,72 @@
+%{CPP_TEMPLATE}
+
+#include <qlcdnumber.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+#include "%{APPNAMELC}.h"
+
+
+%{APPNAME}::%{APPNAME}(const QString& configFile, Type type, int actions, QWidget *parent, const char *name)
+ : KPanelApplet(configFile, type, actions, parent, name)
+{
+ // Get the current application configuration handle
+ ksConfig = config();
+ QLCDNumber *w = new QLCDNumber(this);
+ w->display(42);
+
+ mainView = w;
+ mainView->show();
+}
+
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+
+void %{APPNAME}::about()
+{
+ KMessageBox::information(0, i18n("This is an about box"));
+}
+
+
+void %{APPNAME}::help()
+{
+ KMessageBox::information(0, i18n("This is a help box"));
+}
+
+
+void %{APPNAME}::preferences()
+{
+ KMessageBox::information(0, i18n("This is a preferences box"));
+}
+
+int %{APPNAME}::widthForHeight(int height) const
+{
+ return width();
+}
+
+int %{APPNAME}::heightForWidth(int width) const
+{
+ return height();
+}
+
+void %{APPNAME}::resizeEvent(QResizeEvent *e)
+{
+}
+
+
+extern "C"
+{
+ KPanelApplet* init( QWidget *parent, const QString& configFile)
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}(configFile, KPanelApplet::Normal,
+ KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
+ parent, "%{APPNAMELC}");
+ }
+}
diff --git a/languages/cpp/app_templates/kicker/applet.desktop b/languages/cpp/app_templates/kicker/applet.desktop
new file mode 100644
index 00000000..24e47c40
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/applet.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Comment=A panel applet called $NAME$
+Comment[br]=Un arloadig panell a vez graet $NAME$
+Comment[ca]=Una miniaplicació del plafó anomenat $NAME$
+Comment[cy]=Rhaglennig panel o'r enw $NAME$
+Comment[da]=En panel-applet der hedder $NAME$
+Comment[de]=Ein Miniprogramm mit dem Namen $NAME$
+Comment[el]=Μία μικροεφαρμογή πίνακα με όνομα $NAME$
+Comment[es]=Un applet del panel llamado $NAME$
+Comment[et]=Paneeliaplett nimega $NAME$
+Comment[eu]=$NAME$ izeneko panel applet bat
+Comment[fa]=برنامک تابلو، $NAME$ نامیده شد
+Comment[fr]=Un applet pour le tableau de bord nommé $NAME$
+Comment[ga]=Feidhmchláirín painéil darbh ainm $NAME$
+Comment[gl]=Un applet para o panel chamado $NAME$
+Comment[hi]=एक फलक ऐपलेट जो कहलाता है- $NAME$
+Comment[hu]=$NAME$ nevű panel-kisalkalmazás
+Comment[is]=Spjaldforritlingur nefndur $NAME$
+Comment[it]=Un applet per il pannello chiamata $NAME$
+Comment[ja]=$NAME$ と呼ばれるパネルアプレット
+Comment[nds]=En Paneel-Lüttprogramm nöömt $NAME$
+Comment[ne]= $NAME$ भनिने प्यानल एप्लेट
+Comment[nl]=Een paneel-applet met naam $NAME$
+Comment[pl]=Aplet panelu o nazwie $NAME$
+Comment[pt]=Um 'applet' para o painel chamado $NAME$
+Comment[pt_BR]=Uma applet de painel chamada $NAME$
+Comment[ru]=Аплет панели $NAME$
+Comment[sk]=Applet panel s menom $NAME$
+Comment[sl]=Pultni vstavek z imenom $NAME$
+Comment[sr]=Панелни аплет по имену $NAME$
+Comment[sr@Latn]=Panelni aplet po imenu $NAME$
+Comment[sv]=Ett panelminiprogram som kallas $NAME$
+Comment[ta]=ஒரு பானல் ஆப்லெட் $NAME$ என்ற்உ அழைக்கப்படுகிறது
+Comment[tg]=Пайраҳаи апплети $NAME$
+Comment[tr]=$NAME$ adında bir panel küçük uygulaması
+Comment[zh_CN]=一个称作 $NAME$ 的面板小程序
+Comment[zh_TW]=一個名稱為 $NAME$ 的面板小程式
+Name=%{APPNAMELC}
+X-KDE-Library=%{APPNAMELC}_panelapplet
+X-KDE-UniqueApplet = false
diff --git a/languages/cpp/app_templates/kicker/applet.h b/languages/cpp/app_templates/kicker/applet.h
new file mode 100644
index 00000000..b078b2a4
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/applet.h
@@ -0,0 +1,107 @@
+%{H_TEMPLATE}
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kpanelapplet.h>
+#include <qstring.h>
+#include <kconfig.h>
+
+
+class %{APPNAME} : public KPanelApplet
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Construct a @ref KPanelApplet just like any other widget.
+ *
+ * @param configFile The configFile handed over in the factory function.
+ * @param Type The applet @ref type().
+ * @param actions Standard RMB menu actions supported by the applet (see @ref action() ).
+ * @param parent The pointer to the parent widget handed over in the factory function.
+ * @param name A Qt object name for your applet.
+ **/
+ %{APPNAME}(const QString& configFile, Type t = Normal, int actions = 0,
+ QWidget *parent = 0, const char *name = 0);
+ /** destructor */
+ ~%{APPNAME}();
+
+ /**
+ * Retrieve a suggested width for a given height.
+ *
+ * Every applet should reimplement this function.
+ *
+ * Depending on the panel orientation the height (horizontal panel) or the
+ * width (vertical panel) of the applets is fixed.
+ * The exact values of the fixed size component depend on the panel size.
+ *
+ * On a horizontal panel the applet height is fixed, the panel will
+ * call @ref widthForHeight(int height) with @p height
+ * equal to 'the fixed applet height'
+ * when laying out the applets.
+ *
+ * The applet can now choose the other size component (width)
+ * based on the given height.
+ *
+ * The width you return is granted.
+ **/
+ virtual int widthForHeight(int height) const;
+ /**
+ * @return A suggested height for a given width.
+ *
+ * Every applet should reimplement this function.
+ *
+ * Depending on the panel orientation the height (horizontal panel) or the
+ * width (vertical panel) of the applets is fixed.
+ * The exact values of the fixed size component depend on the panel size.
+ *
+ * On a vertical panel the applet width is fixed, the panel will
+ * call @ref heightForWidth(int width) with @p width
+ * equal to 'the fixed applet width'
+ * when laying out the applets.
+ *
+ * The applet can now choose the other size component (height)
+ * based on the given width.
+ *
+ * The height you return is granted.
+ **/
+ virtual int heightForWidth(int width) const;
+ /**
+ * Is called when the user selects "About" from the applets RMB menu.
+ * Reimplement this function to launch a about dialog.
+ *
+ * Note that this is called only when your applet supports the About action.
+ * See @ref Action and @ref KPanelApplet().
+ **/
+ virtual void about();
+ /**
+ * Is called when the user selects "Help" from the applets RMB menu.
+ * Reimplement this function to launch a manual or help page.
+ *
+ * Note that this is called only when your applet supports the Help action.
+ * See @ref Action and @ref KPanelApplet().
+ **/
+ virtual void help();
+ /**
+ * Is called when the user selects "Preferences" from the applets RMB menu.
+ * Reimplement this function to launch a preferences dialog or kcontrol module.
+ *
+ * Note that this is called only when your applet supports the preferences action.
+ * See @ref Action and @ref KPanelApplet().
+ **/
+ virtual void preferences();
+
+protected:
+ void resizeEvent(QResizeEvent *);
+
+private:
+ KConfig *ksConfig;
+ QWidget *mainView;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kicker/applet.kdevelop b/languages/cpp/app_templates/kicker/applet.kdevelop
new file mode 100644
index 00000000..8bb35326
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/applet.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>Kicker</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kicker/kicker.kdevtemplate b/languages/cpp/app_templates/kicker/kicker.kdevtemplate
new file mode 100644
index 00000000..f6f87256
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/kicker.kdevtemplate
@@ -0,0 +1,194 @@
+# KDE Config File
+[General]
+Name=Kicker Applet
+Name[br]=Arloadig Kicker
+Name[ca]=Una miniaplicació per a Kicker
+Name[da]=Kicker-applet
+Name[de]=Kicker-Miniprogramm
+Name[el]=Μικροεφαρμογή Kicker
+Name[es]=Applet para Kicker
+Name[et]=Kickeri aplett
+Name[eu]=Kicker applet-a
+Name[fa]=برنامک Kicker
+Name[fr]=Applet Kicker
+Name[ga]=Feidhmchláirín Kicker
+Name[gl]=Applet para Kicker
+Name[hu]=Panel-kisalkalmazás
+Name[it]=Applet di kicker
+Name[ja]=Kicker アプレット
+Name[nds]=Kicker-Lüttprogramm
+Name[ne]=किकर एप्लेट
+Name[nl]=Kicker-applet
+Name[pl]=Aplet panelu
+Name[pt]='Applet' do Kicker
+Name[pt_BR]='Applet' do Kicker
+Name[ru]=Аплет панели KDE
+Name[sk]=Kicker applet
+Name[sl]=Vstavek za Kicker
+Name[sr]=Аплет за Kicker
+Name[sr@Latn]=Aplet za Kicker
+Name[sv]=Miniprogram för Kicker
+Name[tr]=Kicker Küçük Uygulaması
+Name[zh_CN]=Kicker 小程序
+Name[zh_TW]=Kicker 小程式
+Icon=kicker.png
+Category=C++/KDE
+Comment=Generates a framework for an applet that embeds into the KDE panel
+Comment[ca]=Genera una infraestructura per a una miniaplicació encastada en el plafó de KDE
+Comment[da]=Genererer et skelet for en applet der indlejres i KDE's panel
+Comment[de]=Erstellt das Grundgerüst für ein Miniprogramm, das in die KDE-Kontrollleiste eingebettet wird.
+Comment[el]=Δημιουργεί ένα πλαίσιο για μία μικροεφαρμογή που ενσωματώνεται στον πίνακα του KDE
+Comment[es]=Genera una infraestructura para un applet empotrado en el panel de KDE
+Comment[et]=Apleti raamistiku loomine, mida saab põimida KDE paneelile
+Comment[eu]=KDE-ren panelean kapsulatzen den applet baten lan-marko bat sortzen du
+Comment[fa]=چارچوبی برای برنامک نهفته‌شده در تابلوی KDEتولید می‌کند
+Comment[fr]=Génère une infrastructure pour un applet qui s'intègre dans le tableau de bord de KDE
+Comment[gl]=Xera un contorno de traballo para un applet que se incrusta no panel de KDE.
+Comment[hu]=Létrehoz egy keretprogramot KDE-s panel-kisalkalmazás készítéséhez
+Comment[it]=Genera l'infrastruttura per un'applet che si integra nel pannello di KDE
+Comment[nds]=Stellt dat Rahmenwark för en Lüttprogramm op, dat sik na dat KDE-Paneel inbett
+Comment[ne]=केडीई प्यानलमा सम्मिलित एप्लेटका लागि फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Genereert een framework voor een applet die kan worden ingebed in het KDE-paneel
+Comment[pl]=Generuje szablon apletu, który można wstawić do panelu KDE
+Comment[pt]=Gera a plataforma para uma 'applet' que se incorpore no painel do KDE
+Comment[pt_BR]=Gera a plataforma para uma 'applet' que se incorpore no painel do KDE
+Comment[ru]=Создание аплета панели KDE
+Comment[sk]=Vygeneruje framework pre applet, ktorý sa bude dať vložiť do KDE panelu
+Comment[sr]=Прави радни оквир за аплет који се уграђује у KDE-ов панел
+Comment[sr@Latn]=Pravi radni okvir za aplet koji se ugrađuje u KDE-ov panel
+Comment[sv]=Skapar ett ramverk för ett miniprogram som inbäddas i KDE:s panel
+Comment[tr]=KDE paneline gömülen bir küçük uygulama için bir çatı oluşturur.
+Comment[zh_CN]=生成一个可嵌入 KDE 面板的小程序框架
+Comment[zh_TW]=產生一個嵌入 KDE 面板的小程式框架
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kicker.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/applet.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/applet.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/applet.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/applet.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A Kicker Applet was created in %{dest}
+Comment[ca]=Una miniaplicació per a Kicker ha estat creat en %{dest}
+Comment[da]=En Kicker applet blev oprettet i %{dest}
+Comment[de]=Ein Miniprogramm für Kicker wurde in %{dest} erstellt.
+Comment[el]=Μία μικροεφαρμογή Kicker δημιουργήθηκε στο %{dest}
+Comment[es]=Un applet para Kicker ha sido creado en %{dest}
+Comment[et]=Kickeri aplett loodi asukohta %{dest}
+Comment[eu]=Kicker Applet bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامک Kicker در %{dest} ایجاد شد
+Comment[fr]=Un applet Kicker a été créé dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchláirín Kicker i %{dest}
+Comment[gl]=Creouse un applet para Kicker en %{dest}
+Comment[hu]=Létrejött egy panel-kisalkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applet per kicker in %{dest}
+Comment[ja]=Kicker アプレットを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Kicker-Lüttprogramm opstellt
+Comment[ne]=किकर एप्लेट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Kicker-applet is aangemaakt in %{dest}
+Comment[pl]=Aplet panelu został utworzony w %{dest}
+Comment[pt]=Foi criada uma 'applet' do Kicker em %{dest}
+Comment[pt_BR]=Foi criada uma 'applet' do Kicker em %{dest}
+Comment[ru]=Аплет панели KDE создан в %{dest}
+Comment[sk]=Kicker applet bol vytvorený v %{dest}
+Comment[sl]=Vstavek za Kicker je bil ustvarjen v %{dest}
+Comment[sr]=Аплет за Kicker направљен је у %{dest}
+Comment[sr@Latn]=Aplet za Kicker napravljen je u %{dest}
+Comment[sv]=Ett miniprogram för Kicker skapades i %{dest}
+Comment[tr]=Bir Kicker küçük uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 Kicker 小程序
+Comment[zh_TW]=一個 Kicker 小程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kicker/kicker.png b/languages/cpp/app_templates/kicker/kicker.png
new file mode 100644
index 00000000..5e4f746f
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/kicker.png
Binary files differ
diff --git a/languages/cpp/app_templates/kicker/src-Makefile.am b/languages/cpp/app_templates/kicker/src-Makefile.am
new file mode 100644
index 00000000..424062d1
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/src-Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES= $(all_includes)
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = %{APPNAMELC}_panelapplet.la
+
+%{APPNAMELC}_panelapplet_la_SOURCES = %{APPNAMELC}.cpp
+%{APPNAMELC}_panelapplet_la_LDFLAGS = -module -avoid-version $(all_libraries)
+%{APPNAMELC}_panelapplet_la_LIBADD = $(LIB_KDEUI)
+
+%{APPNAMELC}_DATA = %{APPNAMELC}.desktop
+%{APPNAMELC}dir = $(kde_datadir)/kicker/applets
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kicker/subdirs b/languages/cpp/app_templates/kicker/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kicker/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kioslave/.kdev_ignore b/languages/cpp/app_templates/kioslave/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/.kdev_ignore
diff --git a/languages/cpp/app_templates/kioslave/Makefile.am b/languages/cpp/app_templates/kioslave/Makefile.am
new file mode 100644
index 00000000..5aa5b88e
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = slave.cpp slave.h slave.protocol slave.kdevelop \
+ src-Makefile.am kioslave.png subdirs
+templateName = kioslave
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate b/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate
new file mode 100644
index 00000000..0af80e7b
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/kioslave.kdevtemplate
@@ -0,0 +1,183 @@
+# KDE Config File
+[General]
+Name=KIO slave
+Name[br]=Sklav KIO
+Name[ca]=Esclau KIO
+Name[da]=KIO-slave
+Name[de]=Ein-/Ausgabemodul
+Name[el]=Υπηρέτης KIO
+Name[es]=Esclavo KIO
+Name[et]=KIO-moodul
+Name[eu]=KIO morroia
+Name[fr]=Esclave KIO
+Name[ga]=Sclábhaí KIO
+Name[gl]=Escravo KIO
+Name[hu]=KDE-protokoll (KIOslave)
+Name[it]=Slave KIO
+Name[nds]=In-/Utgaavmoduul
+Name[ne]=KIO स्लेभ
+Name[nl]=KIO-slave
+Name[pt]=KIO Slave
+Name[sk]=KIO otrok
+Name[sv]=I/O-slav
+Icon=kioslave.png
+Category=C++/KDE
+Comment=Generates a framework for an IO slave
+Comment[ca]=Genera una infraestructura per a un esclau IO
+Comment[da]=Genererer et skelet for en IO-slave
+Comment[de]=Erstellt das Grundgerüst für ein Ein-/Ausgabemodul.
+Comment[el]=Δημιουργεί ένα πλαίσιο για έναν υπηρέτη IO
+Comment[es]=Genera una infraestructura para un esclavo de E/S
+Comment[et]=IO-mooduli raamistiku loomine
+Comment[eu]=IO morroi baterako lan-marko bat sortzen du
+Comment[fa]=چارچوبی برای یک IO slave تولید می‌کند
+Comment[fr]=Génère une infrastructure pour un esclave d'entrée / sortie
+Comment[ga]=Cruthaíonn sé seo creatlach le haghaidh sclábhaí IO
+Comment[gl]=Xera un contorno de traballo para un escravo IO
+Comment[hu]=Létrehoz egy kiindulási keretprogramot KIOslave készítéséhez
+Comment[it]=Genera l'infrastruttura per uno slave di I/O
+Comment[ja]=IO slave のフレームワークを作成します
+Comment[nds]=Stellt dat Rahmenwark för en In-/Utgaavmoduul op
+Comment[ne]=IO स्लेभका लागि फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Genereert een framework voor een IO-slave
+Comment[pl]=Generuje szablon dla IO slave
+Comment[pt]=Gera a plataforma para um 'IO slave'
+Comment[pt_BR]=Gera a plataforma para um 'IO slave'
+Comment[ru]=Создание канала IO slave для KDE
+Comment[sk]=Vygeneruje framework pre IO otroka
+Comment[sr]=Прави радни оквир за IO slave
+Comment[sr@Latn]=Pravi radni okvir za IO slave
+Comment[sv]=Skapar ett ramverk för en I/O-slav
+Comment[zh_CN]=生成一个 IO slave 的框架
+Comment[zh_TW]=產生一個 IO slave 的框架
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kioslave.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/slave.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/slave.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/slave.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/slave.protocol
+Dest=%{dest}/src/%{APPNAMELC}.protocol
+
+[MSG]
+Type=message
+Comment=A KIO slave was created in %{dest}
+Comment[ca]=Un esclau KIO ha estat creat en %{dest}
+Comment[da]=En KIO-slave blev oprettet i %{dest}
+Comment[de]=Ein Ein-/Ausgabemodul wurde in %{dest} erstellt.
+Comment[el]=Ένας υπηρέτης KIO δημιουργήθηκε στο %{dest}
+Comment[es]=Un esclavo KIO ha sido creado en %{dest}
+Comment[et]=KIO-moodul loodi asukohta %{dest}
+Comment[eu]=KIO morroi bat sortu da hemen: %{dest}
+Comment[fa]=یک KIO slave در %{dest} ایجاد شد
+Comment[fr]=Un esclave d'entrée / sortie a été créé dans %{dest}
+Comment[ga]=Cruthaíodh sclábhaí KIO i %{dest}
+Comment[gl]=Creouse un escravo KIO en %{dest}
+Comment[hu]=Létrejött egy KIOslave itt: %{dest}
+Comment[it]=È stato generato un slave KIO in %{dest}
+Comment[ja]=KIO slave を %{dest} に作成しました。
+Comment[nds]=In %{dest} wöör en In-/Utgaavmoduul opstellt
+Comment[ne]=KIO स्लेभ %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KIO-slave is aangemaakt in %{dest}
+Comment[pl]=KIO slave został utworzony w %{dest}
+Comment[pt]=Foi criado um 'KIO slave' em %{dest}
+Comment[pt_BR]=Foi criado um 'KIO slave' em %{dest}
+Comment[ru]=Канал KIO slave создан в %{dest}
+Comment[sk]=KIO otrok bol vytvorený v %{dest}
+Comment[sr]=KIO slave је направљен у %{dest}
+Comment[sr@Latn]=KIO slave je napravljen u %{dest}
+Comment[sv]=En I/O-slav skapades i %{dest}
+Comment[tr]=Bir KIO slave'i %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KIO slave
+Comment[zh_TW]=一個 KIO slave 已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kioslave/kioslave.png b/languages/cpp/app_templates/kioslave/kioslave.png
new file mode 100644
index 00000000..f0cd89a8
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/kioslave.png
Binary files differ
diff --git a/languages/cpp/app_templates/kioslave/slave.cpp b/languages/cpp/app_templates/kioslave/slave.cpp
new file mode 100644
index 00000000..df32aebf
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/slave.cpp
@@ -0,0 +1,88 @@
+
+#include <qcstring.h>
+#include <qsocket.h>
+#include <qdatetime.h>
+#include <qbitarray.h>
+
+#include <stdlib.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kinstance.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <ksock.h>
+
+#include "%{APPNAMELC}.h"
+
+using namespace KIO;
+
+
+kio_%{APPNAMELC}Protocol::kio_%{APPNAMELC}Protocol(const QCString &pool_socket, const QCString &app_socket)
+ : SlaveBase("kio_%{APPNAMELC}", pool_socket, app_socket)
+{
+ kdDebug() << "kio_%{APPNAMELC}Protocol::kio_%{APPNAMELC}Protocol()" << endl;
+}
+
+
+kio_%{APPNAMELC}Protocol::~kio_%{APPNAMELC}Protocol()
+{
+ kdDebug() << "kio_%{APPNAMELC}Protocol::~kio_%{APPNAMELC}Protocol()" << endl;
+}
+
+
+void kio_%{APPNAMELC}Protocol::get(const KURL& url )
+{
+ kdDebug() << "kio_%{APPNAMELC}::get(const KURL& url)" << endl ;
+
+ kdDebug() << "Seconds: " << url.query() << endl;
+ QString remoteServer = url.host();
+ int remotePort = url.port();
+ kdDebug() << "myURL: " << url.prettyURL() << endl;
+
+ infoMessage(i18n("Looking for %1...").arg( remoteServer ) );
+ // Send the mimeType as soon as it is known
+ mimeType("text/plain");
+ // Send the data
+ QString theData = "This is a test of kio_%{APPNAMELC}";
+ data(QCString(theData.local8Bit()));
+ data(QByteArray()); // empty array means we're done sending the data
+ finished();
+}
+
+
+void kio_%{APPNAMELC}Protocol::mimetype(const KURL & /*url*/)
+{
+ mimeType("text/plain");
+ finished();
+}
+
+
+extern "C"
+{
+ int kdemain(int argc, char **argv)
+ {
+ KInstance instance( "kio_%{APPNAMELC}" );
+
+ kdDebug(7101) << "*** Starting kio_%{APPNAMELC} " << endl;
+
+ if (argc != 4) {
+ kdDebug(7101) << "Usage: kio_%{APPNAMELC} protocol domain-socket1 domain-socket2" << endl;
+ exit(-1);
+ }
+
+ kio_%{APPNAMELC}Protocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ kdDebug(7101) << "*** kio_%{APPNAMELC} Done" << endl;
+ return 0;
+ }
+}
diff --git a/languages/cpp/app_templates/kioslave/slave.h b/languages/cpp/app_templates/kioslave/slave.h
new file mode 100644
index 00000000..649ead8c
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/slave.h
@@ -0,0 +1,23 @@
+
+#ifndef _%{APPNAMELC}_H_
+#define _%{APPNAMELC}_H_
+
+#include <qstring.h>
+#include <qcstring.h>
+
+#include <kurl.h>
+#include <kio/global.h>
+#include <kio/slavebase.h>
+
+class QCString;
+
+class kio_%{APPNAMELC}Protocol : public KIO::SlaveBase
+{
+public:
+ kio_%{APPNAMELC}Protocol(const QCString &pool_socket, const QCString &app_socket);
+ virtual ~kio_%{APPNAMELC}Protocol();
+ virtual void mimetype(const KURL& url);
+ virtual void get(const KURL& url);
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kioslave/slave.kdevelop b/languages/cpp/app_templates/kioslave/slave.kdevelop
new file mode 100644
index 00000000..a2ca970a
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/slave.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>kioslave</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kioslave/slave.protocol b/languages/cpp/app_templates/kioslave/slave.protocol
new file mode 100644
index 00000000..2e2cc076
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/slave.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_%{APPNAMELC}
+protocol=%{APPNAMELC}
+input=none
+output=stream
+reading=true
+defaultMimetype=text/plain
+Icon=remote
+Description=A kioslave for %{APPNAMELC}
+Description[br]=Ur c'hioslave evit %{APPNAMELC}
+Description[ca]=Un kioslave per a %{APPNAMELC}
+Description[da]=En kioslave til %{APPNAMELC}
+Description[de]=Ein Ein-/Ausgabemodul für %{APPNAMELC}
+Description[el]=Ένα υπηρέτης kio για %{APPNAMELC}
+Description[es]=Un kioslave para %{APPNAMELC}
+Description[et]=%{APPNAMELC} IO-moodul
+Description[eu]=kioslave bat honentzat: %{APPNAMELC}
+Description[fa]=یک kioslave برای %{APPNAMELC}
+Description[fr]=Un esclave d'E/S (kioslave) pour %{APPNAMELC}
+Description[ga]=kioslave le haghaidh %{APPNAMELC}
+Description[gl]=Un kioslave para %{APPNAMELC}
+Description[hu]=%{APPNAMELC}-támogató KIOslave
+Description[it]=Un kioslave per %{APPNAMELC}
+Description[ja]=%{APPNAMELC} のための kioslave
+Description[nds]=En In-/Utgaavmoduul för %{APPNAMELC}
+Description[ne]= %{APPNAMELC} का लागि किवस्लेभ
+Description[nl]=Kioslave voor %{APPNAMELC}
+Description[pl]=kioslave dla %{APPNAMELC}
+Description[pt]=Um 'kioslave' para %{APPNAMELC}
+Description[pt_BR]=Um kioslave para %{APPNAMELC}
+Description[ru]=Канал kioslave для %{APPNAMELC}
+Description[sk]=kioslave pre %{APPNAMELC}
+Description[sl]=kioslave za %{APPNAMELC}
+Description[sr]=KIOSlave за %{APPNAMELC}
+Description[sr@Latn]=KIOSlave za %{APPNAMELC}
+Description[sv]=En I/O-slav för %{APPNAMELC}
+Description[tr]=%{APPNAMELC} için bir kioslave
+Description[zh_CN]=%{APPNAMELC} 的 kioslave
+Description[zh_TW]=%{APPNAMELC} 的 kioslave
diff --git a/languages/cpp/app_templates/kioslave/src-Makefile.am b/languages/cpp/app_templates/kioslave/src-Makefile.am
new file mode 100644
index 00000000..957ec330
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/src-Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kio_%{APPNAMELC}.la
+
+kio_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp
+kio_%{APPNAMELC}_la_LIBADD = -lkio
+kio_%{APPNAMELC}_la_LDFLAGS = -module -avoid-version $(all_libraries) $(KDE_PLUGIN)
+
+protocol_DATA = %{APPNAMELC}.protocol
+protocoldir = $(kde_servicesdir)
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/kio_%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kioslave/subdirs b/languages/cpp/app_templates/kioslave/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kioslave/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kmake/Makefile.am b/languages/cpp/app_templates/kmake/Makefile.am
new file mode 100644
index 00000000..87d660e0
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = appui.rc app.desktop app.cpp mainviewimp.cpp mainviewimp.h mainview.ui app.kdevelop app.pro src.pro
+templateName = kmake
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kmake/app.cpp b/languages/cpp/app_templates/kmake/app.cpp
new file mode 100644
index 00000000..8920b2f0
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/app.cpp
@@ -0,0 +1,33 @@
+
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include "mainviewimp.h"
+
+static const char description[] = I18N_NOOP("A KDE Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+ {
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+ };
+
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAME}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) 2004 %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ KApplication app;
+ MainViewImp *widget = new MainViewImp;
+ app.setMainWidget(widget);
+ widget->show();
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kmake/app.desktop b/languages/cpp/app_templates/kmake/app.desktop
new file mode 100644
index 00000000..7389904a
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/app.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC} %i -caption "%c"
+Icon=%{APPNAMELC}
+Type=Application
+X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html
+Comment=A KDE KPart Application
+Comment[br]=Ur meziant Kpart evit KDE
+Comment[ca]=Una aplicació KPart per al KDE
+Comment[cy]=Cymhwysiad KPart KDE
+Comment[da]=Et KDE KPart-program
+Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung
+Comment[el]=Μια εφαρμογή KPart του KDE
+Comment[es]=Una aplicación KPart de KDE
+Comment[et]=KDE KPart rakendus
+Comment[eu]=KDE KPart aplikazio bat
+Comment[fa]=یک کاربرد KDE KPart
+Comment[fr]=Une application KPart pour KDE
+Comment[ga]=Feidhmchlár KPart KDE
+Comment[gl]=Unha aplicación KPart de KDE
+Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग
+Comment[hu]=KPart-alapú KDE-alkalmazás
+Comment[is]=KDE KPart forrit
+Comment[it]=Applicazione KPart di KDE
+Comment[ja]=KDE KPart アプリケーション
+Comment[lt]=KDE KPart programa
+Comment[nds]=En KPart-Deelprogramm för KDE
+Comment[ne]=एउटा केडीई KPart अनुप्रयोग
+Comment[nl]=Een KDE KPart-toepassing
+Comment[pl]=Osadzalny element KPart KDE
+Comment[pt]=Uma Aplicação KPart do KDE
+Comment[pt_BR]=Um Aplicativo KPart do KDE
+Comment[ru]=Приложение KPart для KDE
+Comment[sk]=KDE KPart aplikácia
+Comment[sl]=Program KPart za KDE
+Comment[sr]=KDE KPart програм
+Comment[sr@Latn]=KDE KPart program
+Comment[sv]=Ett KDE Kpart-program
+Comment[ta]=கெடி கெபார்ட் பயன்பாடு
+Comment[tg]=Ба кор андохтани KPart барои KDE
+Comment[tr]=Bir KDE KPart Uygulaması
+Comment[zh_CN]=一个 KDE KPart 应用程序
+Comment[zh_TW]=KDE KPart 應用程式
+Terminal=false
diff --git a/languages/cpp/app_templates/kmake/app.kdevelop b/languages/cpp/app_templates/kmake/app.kdevelop
new file mode 100644
index 00000000..aa290baa
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/app.kdevelop
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <breakpoints/>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kmake/app.pro b/languages/cpp/app_templates/kmake/app.pro
new file mode 100644
index 00000000..7dc1cc78
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/app.pro
@@ -0,0 +1,7 @@
+# File generated by kdevelop's qmake manager.
+# -------------------------------------------
+# Subdir relative project main directory: .
+# Target is a subdirs project
+
+SUBDIRS += src
+TEMPLATE=subdirs
diff --git a/languages/cpp/app_templates/kmake/appui.rc b/languages/cpp/app_templates/kmake/appui.rc
new file mode 100644
index 00000000..25884e61
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/appui.rc
@@ -0,0 +1,3 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+</kpartgui>
diff --git a/languages/cpp/app_templates/kmake/kmake.kdevtemplate b/languages/cpp/app_templates/kmake/kmake.kdevtemplate
new file mode 100644
index 00000000..3797d8e9
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/kmake.kdevtemplate
@@ -0,0 +1,148 @@
+# KDE Config File
+[General]
+Name=QMake based KDE template
+Name[ca]=Plantilla per al KDE basada en QMake
+Name[da]=QMake baseret KDE-skabelon
+Name[de]=Auf QMake basierende KDE-Vorlage
+Name[el]=Πρότυπο KDE βασισμένο στο QMake
+Name[es]=Plantilla para KDE basada en QMake
+Name[et]=KDE mall QMake'i põhjal
+Name[eu]=QMake-en oinarritutatko KDE txantiloia
+Name[fa]=قالب KDE بر مبنای QMake
+Name[fr]=Modèle KDE basé sur QMake
+Name[ga]=Teimpléad KDE bunaithe ar QMake
+Name[gl]=Modelo de KDE baseado en QMake
+Name[hu]=QMake-alapú KDE-s sablon
+Name[it]=Modello KDE basato su QMake
+Name[ja]=QMake ベースの KDE テンプレート
+Name[nds]=Op QMake opbuut KDE-Vörlaag
+Name[ne]=QMake मा आधारित केडीई टेम्प्लेट
+Name[nl]=Qmake-gebaseerde KDE-jabloon
+Name[pl]=Oparty na QMake szablon dla KDE
+Name[pt]=Modelo do KDE baseado no QMake
+Name[pt_BR]=Modelo do KDE baseado no QMake
+Name[ru]=Приложение KDE как проект QMake
+Name[sk]=Šablóna KDE založená na QMake
+Name[sr]=KDE шаблон на основи QMake-а
+Name[sr@Latn]=KDE šablon na osnovi QMake-a
+Name[sv]=QMake-baserad KDE-mall
+Name[tr]=QMake tabanlı KDE şablonu
+Name[zh_CN]=基于 QMake 的 KDE 模板
+Name[zh_TW]=QMake 為基礎的 KDE 樣本
+Icon=kmake.png
+Category=C++/QMake project
+Comment=Generates a simple KDE application using QMake based project manager
+Comment[ca]=Genera una simple aplicació per al KDE usant un gestor de projectes basat en QMake
+Comment[da]=Genererer et simpelt KDE program ved brug af QMake baseret projekthåndtering
+Comment[de]=Erstellt eine einfache KDE-Anwendung unter Verwendung der QMake-Projektverwaltung
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE χρησιμοποιώντας το διαχειριστή έργου βασισμένο στο QMake
+Comment[es]=Genera una sencilla aplicación para KDE que usa un gestor de proyecto basado en QMake
+Comment[et]=Lihtsa KDE rakenduse loomine projektihalduriga QMake'i põhjal
+Comment[eu]=KDE aplikazio sinple bat sortzen du QMake-en oinarritutako proiektu-kudeatzailea erabiliz
+Comment[fa]=یک کاربرد سادۀ KDE، با استفاده از مدیر پروژۀ بر مبنای QMake تولید می‌کند
+Comment[fr]=Génère une application KDE simple utilisant un gestionnaire de projet basé sur QMake
+Comment[gl]=Xera unha aplicación KDE sinxela usando un xestor de proxectos baseado en QMake
+Comment[hu]=Létrehoz egy egyszerű KDE-s alkalmazást Qmake-alapú projektkezelővel
+Comment[it]=Genera una semplice applicazione KDE che usa QMake basata sul gestore di progetto
+Comment[ja]=QMake ベースのプロジェクトマネージャを使って 簡単な KDE アプリケーションを作成します
+Comment[nds]=Stellt mit den op QMake opbuut Projektpleger en eenfach KDE-Programm op
+Comment[ne]=QMake आधारित परियोजना प्रबन्धक प्रयोग गरेर एउटा साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met behulp van Qmake-gebaseerde projectmanager
+Comment[pl]=Generuje prosty program KDE używający menedżera projektów QMake
+Comment[pt]=Gera uma aplicação simples do KDE, usando o QMake como gestor de projectos
+Comment[pt_BR]=Gera uma aplicação simples do KDE, usando o QMake como gestor de projectos
+Comment[ru]=Создание простого приложения KDE как проекта QMake
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu založenú na QMake projektovom manažéri
+Comment[sr]=Прави једноставан KDE програм помоћу менаџера пројекта на основи QMake-а
+Comment[sr@Latn]=Pravi jednostavan KDE program pomoću menadžera projekta na osnovi QMake-a
+Comment[sv]=Skapar ett enkelt KDE-program baserat på QMake projekthantering
+Comment[tr]=QMake tabanlı proje yöneticisini kullanarak basit bir KDE uygulaması yaratır.
+Comment[zh_CN]=使用基于 QMake的工程管理器生成一个简单的 KDE 应用程序
+Comment[zh_TW]=產生一個使用 QMake 專案管理員的簡單 KDE 應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kmake.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/src.pro
+Dest=%{dest}/src/src.pro
+
+[FILE4]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/mainviewimp.cpp
+Dest=%{dest}/src/mainviewimp.cpp
+
+[FILE7]
+Type=install
+Source=%{src}/mainviewimp.h
+Dest=%{dest}/src/mainviewimp.h
+
+[FILE8]
+Type=install
+EscapeXML=true
+Source=%{src}/mainview.ui
+Dest=%{dest}/src/mainview.ui
+
+[FILE9]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}.rc
+
+[FILE10]
+Type=install
+Source=%{src}/app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A Qmake based KDE application was created in %{dest}
+Comment[ca]=Una aplicació per al KDE basada en QMake ha estat creada en %{dest}
+Comment[da]=Et Qmake baseret KDE program blev oprettet i %{dest}
+Comment[de]=Eine auf Qmake basierende KDE-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE βασισμένη στο Qmake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para KDE basada en QMake ha sido creada en %{dest}
+Comment[et]=KDE rakendus QMake'i põhjal loodi asukohta %{dest}
+Comment[eu]=Qmake-en oinarritutako KDE aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KDE بر مبنای Qmake در %{dest} ایجاد شد
+Comment[fr]=Une application KDE basée sur QMake a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár KDE bunaithe ar Qmake i %{dest}
+Comment[gl]=Creouse unha aplicación KDE baseada en QMake en %{dest}
+Comment[hu]=Létrejött egy Qmake-alapú KDE-s alkalmazás itt: %{dest}
+Comment[it]=È stata creata una semplice applicazione KDE basata su Qmake in %{dest}
+Comment[ja]=QMake ベースの KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op QMake opbuut KDE-Programm opstellt
+Comment[ne]=Qmake आधारित केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Qmake-gebaseerde KDE-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program KDE oparty na QMake został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE baseada no Qmake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE baseada no Qmake em %{dest}
+Comment[ru]=Приложение KDE как проект QMake создано в %{dest}
+Comment[sk]=KDE aplikácia založená na QMake bola vytvorená v %{dest}
+Comment[sr]=KDE програм на основу QMake-а направљен је у %{dest}
+Comment[sr@Latn]=KDE program na osnovu QMake-a napravljen je u %{dest}
+Comment[sv]=Ett Qmake-baserat KDE-program skapades i %{dest}
+Comment[tr]=Bir QMake tabanlı KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了基于 QMake 的 KDE 应用程序
+Comment[zh_TW]=一個以 Qmake 為基礎的 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kmake/kmake.png b/languages/cpp/app_templates/kmake/kmake.png
new file mode 100644
index 00000000..913ebb87
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/kmake.png
Binary files differ
diff --git a/languages/cpp/app_templates/kmake/mainview.ui b/languages/cpp/app_templates/kmake/mainview.ui
new file mode 100644
index 00000000..fea02def
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/mainview.ui
@@ -0,0 +1,76 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MainView</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>124</width>
+ <height>90</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Output</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>helloLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>helloButton</cstring>
+ </property>
+ <property name="text">
+ <string>Hello</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>helloButton</sender>
+ <signal>clicked()</signal>
+ <receiver>Form1</receiver>
+ <slot>slotHelloButtonClicked()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotHelloButtonClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kmake/mainviewimp.cpp b/languages/cpp/app_templates/kmake/mainviewimp.cpp
new file mode 100644
index 00000000..68cb262a
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/mainviewimp.cpp
@@ -0,0 +1,23 @@
+
+#include "mainviewimp.h"
+#include <qlabel.h>
+#include <klocale.h>
+
+MainViewImp::MainViewImp(QWidget* parent, const char* name, WFlags fl)
+: MainView(parent,name,fl)
+{
+}
+
+MainViewImp::~MainViewImp()
+{
+}
+
+void MainViewImp::slotHelloButtonClicked()
+{
+ helloLabel->setText(i18n("Hello there."));
+}
+
+
+
+
+
diff --git a/languages/cpp/app_templates/kmake/mainviewimp.h b/languages/cpp/app_templates/kmake/mainviewimp.h
new file mode 100644
index 00000000..51af1957
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/mainviewimp.h
@@ -0,0 +1,19 @@
+#ifndef MAINVIEWIMP_H
+#define MAINVIEWIMP_H
+
+#include "mainview.h"
+
+class MainViewImp : public MainView
+{
+ Q_OBJECT
+
+public:
+ MainViewImp(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~MainViewImp();
+
+public slots:
+ virtual void slotHelloButtonClicked();
+};
+
+#endif
+
diff --git a/languages/cpp/app_templates/kmake/src.pro b/languages/cpp/app_templates/kmake/src.pro
new file mode 100644
index 00000000..a27a6b13
--- /dev/null
+++ b/languages/cpp/app_templates/kmake/src.pro
@@ -0,0 +1,29 @@
+# File generated by kdevelop's qmake manager.
+# -------------------------------------------
+# Subdir relative project main directory: ./src
+# Target is an application: ../bin/%{APPNAMELC}
+KDELIB=$$system(kde-config --expandvars --install lib)
+KDEBIN=$$system(kde-config --expandvars --install exe)
+KDEAPPS=$$system(kde-config --expandvars --install apps)
+KDEPREFIX=$$system(kde-config --prefix)
+KDEINCLUDE=$$KDEPREFIX/include/kde $$KDEPREFIX/include
+
+TEMPLATE = app
+
+INSTALLS += %{APPNAMELC}_rc \
+ %{APPNAMELC}_desktop \
+ target
+target.path = $$KDEBIN
+%{APPNAMELC}_desktop.files += *.desktop
+%{APPNAMELC}_desktop.path = $$KDEAPPS/Utils
+%{APPNAMELC}_rc.files += *.rc
+%{APPNAMELC}_rc.path = $$KDEAPPDATA/%{APPNAMELC}
+FORMS += mainview.ui
+HEADERS += mainviewimp.h
+SOURCES += %{APPNAMELC}.cpp mainviewimp.cpp
+LIBS += -lkdeui -lkdecore
+INCLUDEPATH = $$KDEINCLUDE
+QMAKE_LIBDIR = $$KDELIB
+TARGET = %{APPNAMELC}
+DESTDIR = ../bin
+CONFIG += release warn_on
diff --git a/languages/cpp/app_templates/kmod/.kdev_ignore b/languages/cpp/app_templates/kmod/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/.kdev_ignore
diff --git a/languages/cpp/app_templates/kmod/Makefile.am b/languages/cpp/app_templates/kmod/Makefile.am
new file mode 100644
index 00000000..76afcd5a
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = src-Makefile kmod.kdevelop kmod-driver.c
+
+templateName = kmod
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kmod/kmod-driver.c b/languages/cpp/app_templates/kmod/kmod-driver.c
new file mode 100644
index 00000000..5ddc7ce6
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/kmod-driver.c
@@ -0,0 +1,22 @@
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+
+MODULE_DESCRIPTION("My kernel module");
+MODULE_AUTHOR("%{AUTHOR} (%{EMAIL})");
+MODULE_LICENSE("$LICENSE$");
+
+static int %{APPNAMELC}_init_module(void)
+{
+ printk( KERN_DEBUG "Module %{APPNAME} init\n" );
+ return 0;
+}
+
+static void %{APPNAMELC}_exit_module(void)
+{
+ printk( KERN_DEBUG "Module %{APPNAME} exit\n" );
+}
+
+module_init(%{APPNAMELC}_init_module);
+module_exit(%{APPNAMELC}_exit_module);
diff --git a/languages/cpp/app_templates/kmod/kmod.kdevelop b/languages/cpp/app_templates/kmod/kmod.kdevelop
new file mode 100644
index 00000000..93c6c0f4
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/kmod.kdevelop
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ <keywords>
+ <keyword>C</keyword>
+ <keyword>Linux</keyword>
+ <keyword>Kernel</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="Makefile" name="Build" />
+ <group pattern="*.c" name="Source" />
+ </groups>
+ </kdevfileview>
+ <kdevcustomproject>
+ <envvars/>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <envvars/>
+ </make>
+ <makeenvvars/>
+ </kdevcustomproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kmod/kmod.kdevtemplate b/languages/cpp/app_templates/kmod/kmod.kdevtemplate
new file mode 100644
index 00000000..03a335cd
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/kmod.kdevtemplate
@@ -0,0 +1,89 @@
+# KDE Config File
+[General]
+Name=Linux Kernel module
+Name[br]=Mollad ar galon Linux
+Name[ca]=Mòdul del nucli Linux
+Name[da]=Linux kernemodul
+Name[de]=Linux-Kernelmodul
+Name[el]=Άρθρωμα πυρήνα Linux
+Name[es]=Módulo para el núcleo de Linux
+Name[et]=Linuxi kerneli moodul
+Name[eu]=Linux Kernel modulua
+Name[fa]=پیمانۀ هستۀ لینوکس
+Name[fr]=Module de noyau Linux
+Name[ga]=Modúl Eithne Linux
+Name[gl]=Módulo para o kernel Linux
+Name[hu]=Linuxos kernelmodul
+Name[it]=Modulo del kernel Linux
+Name[ja]=Linux カーネルモジュール
+Name[nds]=Linux-Kernelmoduul
+Name[ne]=लिनक्स कर्नेल मोड्युल
+Name[nl]=Linux kernelmodule
+Name[pl]=Moduł jądra Linuksa
+Name[pt]=Módulo do 'kernel' do Linux
+Name[pt_BR]=Módulo do 'kernel' do Linux
+Name[ru]=Драйвер ядра Linux
+Name[sk]=Linux kernel modul
+Name[sr]=Модул језгра Linux-а
+Name[sr@Latn]=Modul jezgra Linux-a
+Name[sv]=Modul för Linux kärna
+Name[tr]=Linux Çekirdek Birimi
+Name[zh_CN]=Linux 内核模块
+Name[zh_TW]=Linux 核心模組
+Icon=
+Category=C
+Comment=Generates a template for a Linux kernel module.
+Comment[ca]=Genera una plantilla per a un mòdul del nucli Linux.
+Comment[da]=Genererer en skabelon for en Linux kernemodul.
+Comment[de]=Erstellt eine Vorlage für ein Linux-Kernelmodul.
+Comment[el]=Δημιουργεί ένα πρότυπο για ένα άρθρωμα του πυρήνα του Linux.
+Comment[es]=Genera una plantilla para un módulo del núcleo de Linux.
+Comment[et]=Linuxi kerneli mooduli malli loomine.
+Comment[eu]=Linux kernel modulu batentzat txantiloi bat sortzen du.
+Comment[fa]=قالبی برای پیمانۀ هستۀ لینوکس تولید می‌کند
+Comment[fr]=Génère un modèle pour un module de noyau Linux.
+Comment[gl]=Xera unha modelo dun módulo para o kernel Linux.
+Comment[hu]=Létrehoz egy sablont linuxos kernelmodul készítéséhez.
+Comment[it]=Genera un modello per un modulo del kernel Linux kernel.
+Comment[ja]=Linux カーネルモジュール用のテンプレートを作成します
+Comment[nds]=Stellt en Vörlaag för en Linux-Kernelmoduul op.
+Comment[ne]=लिनक्स कर्नेल मोड्युलका लागि टेम्प्लेट उत्पन्न गर्दछ
+Comment[nl]=Genereert een sjabloon voor een Linux kernelmodule
+Comment[pl]=Generuje szablon dla modułu jądra Linuksa.
+Comment[pt]=Gera um modelo para um módulo do 'kernel' do Linux.
+Comment[pt_BR]=Gera um modelo para um módulo do 'kernel' do Linux.
+Comment[ru]=Создание драйвера ядра Linux.
+Comment[sk]=Vygeneruje šablónu pre Linux kernel modul
+Comment[sr]=Прави шаблон за модул језгра Linux-а.
+Comment[sr@Latn]=Pravi šablon za modul jezgra Linux-a.
+Comment[sv]=Skapar en mall för en modul i Linux kärna.
+Comment[tr]=Bir Linux çekirdek birimi için bir şablon yaratır.
+Comment[zh_CN]=生成一个 Linux 内核模块的模板。
+Comment[zh_TW]=產生一個 Linux 核心模組的樣本
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}-driver.c
+Archive=kmod.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/kmod.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/src-Makefile
+Dest=%{dest}/Makefile
+
+[FILE3]
+Type=install
+Source=%{src}/kmod-driver.c
+Dest=%{dest}/%{APPNAMELC}-driver.c
+
+[MSG]
+Type=message
+Command=A linux kernel module was created in %{dest}
diff --git a/languages/cpp/app_templates/kmod/kmod.png b/languages/cpp/app_templates/kmod/kmod.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/kmod.png
Binary files differ
diff --git a/languages/cpp/app_templates/kmod/src-Makefile b/languages/cpp/app_templates/kmod/src-Makefile
new file mode 100644
index 00000000..92a2b461
--- /dev/null
+++ b/languages/cpp/app_templates/kmod/src-Makefile
@@ -0,0 +1,30 @@
+TARGET = %{APPNAMELC}-driver
+OBJS = %{APPNAMELC}-driver.o
+MDIR = drivers/misc
+
+EXTRA_CFLAGS = -DEXPORT_SYMTAB
+CURRENT = $(shell uname -r)
+KDIR = /lib/modules/$(CURRENT)/build
+PWD = $(shell pwd)
+DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
+
+obj-m := $(TARGET).o
+
+default:
+ make -C $(KDIR) SUBDIRS=$(PWD) modules
+
+$(TARGET).o: $(OBJS)
+ $(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
+
+ifneq (,$(findstring 2.4.,$(CURRENT)))
+install:
+ su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a"
+else
+install:
+ su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
+endif
+
+clean:
+ -rm -f *.o *.ko .*.cmd .*.flags *.mod.c
+
+-include $(KDIR)/Rules.make
diff --git a/languages/cpp/app_templates/kofficepart/.kdev_ignore b/languages/cpp/app_templates/kofficepart/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/.kdev_ignore
diff --git a/languages/cpp/app_templates/kofficepart/Makefile.am b/languages/cpp/app_templates/kofficepart/Makefile.am
new file mode 100644
index 00000000..96280d88
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = kopart.kdevelop kopart_aboutdata.h kopart_part.cpp kopart_view.h \
+ src-Makefile.am kopart.png kopart_factory.cpp kopart_part.h \
+ subdirs kopart.desktop kopart.rc kopart_factory.h \
+ kopart_view.cpp x-kopart.desktop kde-configure.in.in \
+ main.cpp
+
+templateName = kopart
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kofficepart/kde-configure.in.in b/languages/cpp/app_templates/kofficepart/kde-configure.in.in
new file mode 100644
index 00000000..ec8e8bea
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kde-configure.in.in
@@ -0,0 +1,42 @@
+#MIN_CONFIG
+
+AM_INIT_AUTOMAKE(kotest, 0.1)
+
+AC_CHECK_HEADERS(unistd.h sys/param.h floatingpoint.h paths.h)
+KDE_CHECK_KIMGIO
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+dnl AC_DEFINE(USE_QFD, 1, [Define if you prefer the Qt provided file dialog])
+KWMF_INCLUDES='-I$(KDEDIR)/lib/kwmf -I$(KDEDIR)/lib/kwmf'
+AC_SUBST(KWMF_INCLUDES)
+
+KSTORE_INCLUDES='-I$(KDEDIR)/include'
+AC_SUBST(KSTORE_INCLUDES)
+
+KOFFICECORE_INCLUDES='-I$(KDEDIR)/include'
+AC_SUBST(KOFFICECORE_INCLUDES)
+
+KOFFICEUI_INCLUDES='-I$(KDEDIR)/include'
+AC_SUBST(KOFFICEUI_INCLUDES)
+
+LIB_KOFFICEUI='$(KDEDIR)/lib/libkofficeui.la'
+LIB_KOFFICECORE='$(KDEDIR)/lib/libkofficecore.la'
+LIB_KSTORE='$(KDEDIR)/lib/libkstore.la'
+LIB_KWMF='$(KDEDIR)/lib/libkwmf.la'
+AC_SUBST(LIB_KOFFICEUI)
+AC_SUBST(LIB_KOFFICECORE)
+AC_SUBST(LIB_KSTORE)
+AC_SUBST(LIB_KWMF)
+
+KOFFICE_LIBS='$(LIB_KOFFICEUI) $(LIB_KOFFICECORE) $(LIB_KSTORE)'
+AC_SUBST(KOFFICE_LIBS)
+
+KOFFICE_INCLUDES='$(KOFFICEUI_INCLUDES) $(KOFFICECORE_INCLUDES) $(KSTORE_INCLUDES) $(KWMF_INCLUDES)'
+AC_SUBST(KOFFICE_INCLUDES)
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADERS(streambuf streambuf.h)
+AC_LANG_RESTORE
+
diff --git a/languages/cpp/app_templates/kofficepart/kopart.desktop b/languages/cpp/app_templates/kofficepart/kopart.desktop
new file mode 100644
index 00000000..8b2be99e
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+X-KDE-Library=lib%{APPNAMELC}part
+MimeType=application/x-%{APPNAMELC};
+Type=Application
+Icon=%{APPNAMELC}
+ServiceTypes=KOfficePart,KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-NativeMimeType=application/x-%{APPNAMELC}
diff --git a/languages/cpp/app_templates/kofficepart/kopart.kdevelop b/languages/cpp/app_templates/kofficepart/kopart.kdevelop
new file mode 100644
index 00000000..bf70fc63
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>kioslave</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}part.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate b/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate
new file mode 100644
index 00000000..9d5ecba4
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart.kdevtemplate
@@ -0,0 +1,231 @@
+# KDE Config File
+[General]
+Name=KOffice Part
+Name[br]=Perzh KOffice
+Name[ca]=Part per a KOffice
+Name[da]=KOffice part
+Name[de]=KOffice-Komponente
+Name[el]=Τμήμα KOffice
+Name[es]=Part de KOffice
+Name[et]=KOffice'i komponent
+Name[eu]=KOffice zatia
+Name[fa]=جزء KOffice
+Name[fr]=Composant KOffice
+Name[ga]=Páirt KOffice
+Name[gl]='Part' para KOffice
+Name[hu]=KOffice-objektum
+Name[it]=Part di KOffice
+Name[nds]=KOffice-Komponent
+Name[ne]=केडीई अफिस भाग
+Name[nl]=Koffice-part
+Name[pt]=Componente do KOffice
+Name[pt_BR]=Componente do KOffice
+Name[ru]=Приложение KOffice
+Name[sr]=KOffice део
+Name[sr@Latn]=KOffice deo
+Name[sv]=Koffice-delprogram
+Name[tr]=KOffice Bileşeni
+Name[zh_CN]=KOffice 部件
+Name[zh_TW]=KOffice 元件
+Icon=kopart.png
+Category=C++/KDE
+Comment=Generates a framework for a full KOffice Application.
+Comment[ca]=Genera una infraestructura per a una completa aplicació de KOffice.
+Comment[da]=Genererer et skelet for et fuldstændigt KOffice-program.
+Comment[de]=Erstellt ein Grundgerüst für eine vollwertige KOffice-Anwendung
+Comment[el]=Δημιουργεί ένα πλαίσιο για μια πλήρης εφαρμογή του KOffice.
+Comment[es]=Genera una infraestructura para una aplicación completa de KOffice.
+Comment[et]=KOffice'i rakenduse raamistiku loomine.
+Comment[eu]=KOffice-en aplikazio batentzat lan-marko oso bat sortzen du.
+Comment[fa]=چارچوبی را برای کاربرد کامل KOffice تولید می‌کند.
+Comment[fr]=Génère une infrastructure pour une application KOffice complète.
+Comment[gl]=Xera un contorno de traballo para unha aplicación KOffice completa.
+Comment[hu]=Létrehoz egy kiindulási keretprogramot teljes KOffice-alkalmazás készítéséhez.
+Comment[it]=Genera l'infrastruttura per un'applicazione completa di KOffice.
+Comment[nds]=Stellt dat Rahmenwark för en heel KOffice-Programm op.
+Comment[ne]=पूर्ण केडीई अफिस अनुप्रयोगका लागि फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Genereert een framework voor een volledige KOffice-toepassing
+Comment[pl]=Generuje szablon pełnego programu KOffice.
+Comment[pt]=Gera a plataforma para uma aplicação completa do KOffice.
+Comment[pt_BR]=Gera a plataforma para uma aplicação completa do KOffice.
+Comment[ru]=Создание приложения KOffice.
+Comment[sk]=Vygeneruje framework pre kompletnú aplikáciu KOffice.
+Comment[sl]=Ustvari ogrodje za poln program KOffice
+Comment[sr]=Прави радни оквир за пуни KOffice програм.
+Comment[sr@Latn]=Pravi radni okvir za puni KOffice program.
+Comment[sv]=Skapar ett ramverk för ett fullständigt Koffice-program.
+Comment[tr]=Tam bir KOffice Uygulaması için bir çatı yaratır.
+Comment[zh_CN]=生成一个全功能的 KOffice 应用程序框架。
+Comment[zh_TW]=產生一個完整的 KOffice 應用程式的框架
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp
+Archive=kopart.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/kopart.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{src}/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/kopart_view.cpp
+Dest=%{dest}/src/%{APPNAMELC}_view.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/kopart_view.h
+Dest=%{dest}/src/%{APPNAMELC}_view.h
+
+[FILE14]
+Type=install
+Source=%{src}/kopart_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}_part.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/kopart_part.h
+Dest=%{dest}/src/%{APPNAMELC}_part.h
+
+[FILE16]
+Type=install
+Source=%{src}/kopart_factory.cpp
+Dest=%{dest}/src/%{APPNAMELC}_factory.cpp
+
+[FILE17]
+Type=install
+Source=%{src}/kopart_factory.h
+Dest=%{dest}/src/%{APPNAMELC}_factory.h
+
+[FILE18]
+Type=install
+Source=%{src}/kopart_aboutdata.h
+Dest=%{dest}/src/%{APPNAMELC}_aboutdata.h
+
+[FILE19]
+Type=install
+EscapeXML=true
+Source=%{src}/kopart.rc
+Dest=%{dest}/src/%{APPNAMELC}.rc
+
+[FILE20]
+Type=install
+Source=%{src}/kopart.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE21]
+Type=install
+Source=%{src}/x-kopart.desktop
+Dest=%{dest}/src/x-%{APPNAMELC}.desktop
+
+[FILE22]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=A KOffice part was created in %{dest}
+Comment[ca]=Una part per a KOffice ha estat creada en %{dest}
+Comment[da]=En KOffice part blev oprettet i %{dest}
+Comment[de]=Eine KOffice-Komponente wurde in %{dest} erstellt.
+Comment[el]=Ένα τμήμα του KOffice δημιουργήθηκε στο %{dest}
+Comment[es]=Un Part de KOffice ha sido creado en %{dest}
+Comment[et]=KOffice'i komponent loodi asukohta %{dest}
+Comment[eu]=KOffice zati bat sortu da hemen: %{dest}
+Comment[fa]=یک جزء KOffice در %{dest} ایجاد شد
+Comment[fr]=Un composant KOffice a été créé dans %{dest}
+Comment[ga]=Cruthaíodh páirt KDE i %{dest}
+Comment[gl]=Creouse unha 'part' para KOffice en %{dest}
+Comment[hu]=Létrejött egy KOffice-objektum itt: %{dest}
+Comment[it]=È stata creata una part di KOffice in %{dest}
+Comment[ja]=KOffice パートを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KOffice-Komponent opstellt
+Comment[ne]=केडीई अफिस भाग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KOffice-part is aangemaakt in %{dest}
+Comment[pl]=KOffice part została utworzona w %{dest}
+Comment[pt]=Foi criado um componente do KOffice em %{dest}
+Comment[pt_BR]=Foi criado um componente do KOffice em %{dest}
+Comment[ru]=Приложение KOffice создано в %{dest}
+Comment[sk]=KOffice Part bol vytvorený v %{dest}
+Comment[sr]=KOffice део је направљен у %{dest}
+Comment[sr@Latn]=KOffice deo je napravljen u %{dest}
+Comment[sv]=Ett Koffice-delprogram skapades i %{dest}
+Comment[tr]=Bir KOffice bileşeni %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KOffice 部件
+Comment[zh_TW]=一個 KOffice 元件已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kofficepart/kopart.png b/languages/cpp/app_templates/kofficepart/kopart.png
new file mode 100644
index 00000000..fa45e5c3
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart.png
Binary files differ
diff --git a/languages/cpp/app_templates/kofficepart/kopart.rc b/languages/cpp/app_templates/kofficepart/kopart.rc
new file mode 100644
index 00000000..d03230ec
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart.rc
@@ -0,0 +1,10 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd" ><kpartgui name="%{APPNAME}" version="1">
+<MenuBar>
+ <Menu name="Edit"><text>Edit</text>
+ <Action name="cut"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="editToolBar"><Text>Edit</Text>
+ <Action name="cut"/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h b/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h
new file mode 100644
index 00000000..ab66d088
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_aboutdata.h
@@ -0,0 +1,24 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#ifndef %{APPNAME}_ABOUTDATA
+#define %{APPNAME}_ABOUTDATA
+
+#include <kaboutdata.h>
+#include <klocale.h>
+
+static const char description[] = I18N_NOOP("%{APPNAME} KOffice Program");
+static const char version[] = "%{VERSION}";
+
+KAboutData * new%{APPNAME}AboutData()
+{
+ KAboutData * aboutData=new KAboutData( "%{APPNAMELC}", I18N_NOOP("%{APPNAME}"),
+ version, description, KAboutData::License_%{LICENSE},
+ "(c) %{YEAR}, %{AUTHOR}");
+ aboutData->addAuthor("%{AUTHOR}",0, "%{EMAIL}");
+ return aboutData;
+}
+
+#endif
diff --git a/languages/cpp/app_templates/kofficepart/kopart_factory.cpp b/languages/cpp/app_templates/kofficepart/kopart_factory.cpp
new file mode 100644
index 00000000..bd79c317
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_factory.cpp
@@ -0,0 +1,76 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+#include <%{APPNAMELC}_factory.h>
+#include <%{APPNAMELC}_part.h>
+#include <%{APPNAMELC}_aboutdata.h>
+#include <kinstance.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kglobal.h>
+
+extern "C"
+{
+ void* init_lib%{APPNAMELC}part()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}Factory;
+ }
+};
+
+KInstance* %{APPNAME}Factory::s_global = 0L;
+KAboutData* %{APPNAME}Factory::s_aboutData = 0L;
+
+%{APPNAME}Factory::%{APPNAME}Factory( QObject* parent, const char* name )
+ : KoFactory( parent, name )
+{
+ global();
+}
+
+%{APPNAME}Factory::~%{APPNAME}Factory()
+{
+ delete s_aboutData;
+ s_aboutData = 0L;
+ delete s_global;
+ s_global = 0L;
+}
+
+KParts::Part* %{APPNAME}Factory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & )
+{
+ // If classname is "KoDocument", our host is a koffice application
+ // otherwise, the host wants us as a simple part, so switch to readonly and single view.
+ bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
+
+ // parentWidget and widgetName are used by KoDocument for the "readonly+singleView" case.
+ %{APPNAME}Part *part = new %{APPNAME}Part( parentWidget, widgetName, parent, name, !bWantKoDocument );
+
+ if ( !bWantKoDocument )
+ part->setReadWrite( false );
+
+ return part;
+}
+
+KAboutData* %{APPNAME}Factory::aboutData()
+{
+ if ( !s_aboutData )
+ // Change this, of course
+ s_aboutData = new%{APPNAME}AboutData();
+ return s_aboutData;
+}
+
+KInstance* %{APPNAME}Factory::global()
+{
+ if ( !s_global )
+ {
+ s_global = new KInstance( aboutData() );
+ // Add any application-specific resource directories here
+
+ // Tell the iconloader about share/apps/koffice/icons
+ s_global->iconLoader()->addAppDir("koffice");
+ }
+ return s_global;
+}
+
+#include <%{APPNAMELC}_factory.moc>
diff --git a/languages/cpp/app_templates/kofficepart/kopart_factory.h b/languages/cpp/app_templates/kofficepart/kopart_factory.h
new file mode 100644
index 00000000..45f1f649
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_factory.h
@@ -0,0 +1,33 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#ifndef %{APPNAME}_FACTORY_H
+#define %{APPNAME}_FACTORY_H
+
+#include <koFactory.h>
+
+class KInstance;
+class KAboutData;
+
+class %{APPNAME}Factory : public KoFactory
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Factory( QObject* parent = 0, const char* name = 0 );
+ ~%{APPNAME}Factory();
+
+ virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", const QStringList &args = QStringList() );
+
+ static KInstance* global();
+
+ // _Creates_ a KAboutData but doesn't keep ownership
+ static KAboutData* aboutData();
+
+private:
+ static KInstance* s_global;
+ static KAboutData* s_aboutData;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kofficepart/kopart_part.cpp b/languages/cpp/app_templates/kofficepart/kopart_part.cpp
new file mode 100644
index 00000000..500179f3
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_part.cpp
@@ -0,0 +1,69 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#include "%{APPNAMELC}_part.h"
+#include "%{APPNAMELC}_view.h"
+
+#include <qpainter.h>
+
+%{APPNAME}Part::%{APPNAME}Part( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode )
+ : KoDocument( parentWidget, widgetName, parent, name, singleViewMode )
+{
+}
+
+bool %{APPNAME}Part::initDoc( InitDocFlags flags, QWidget* parentWidget )
+{
+ // If nothing is loaded, do initialize here
+ return TRUE;
+}
+
+KoView* %{APPNAME}Part::createViewInstance( QWidget* parent, const char* name )
+{
+ return new %{APPNAME}View( this, parent, name );
+}
+
+bool %{APPNAME}Part::loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, const QDomDocument & settings, KoStore* store )
+{
+ /// @todo load the document using the OASIS format
+ return true;
+}
+
+bool %{APPNAME}Part::loadXML( QIODevice *, const QDomDocument & )
+{
+ /// @todo load the document from the QDomDocument
+ return true;
+}
+
+QDomDocument %{APPNAME}Part::saveXML()
+{
+ /// @todo save the document into a QDomDocument
+ return QDomDocument();
+}
+
+bool %{APPNAME}Part::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
+{
+ /// @todo save the document using the OASIS format
+ return true;
+}
+
+
+void %{APPNAME}Part::paintContent( QPainter& painter, const QRect& rect, bool /*transparent*/,
+ double /*zoomX*/, double /*zoomY*/ )
+{
+ // ####### handle transparency
+
+ // Need to draw only the document rectangle described in the parameter rect.
+ int left = rect.left() / 20;
+ int right = rect.right() / 20 + 1;
+ int top = rect.top() / 20;
+ int bottom = rect.bottom() / 20 + 1;
+
+ for( int x = left; x < right; ++x )
+ painter.drawLine( x * 20, top * 20, x * 20, bottom * 20 );
+ for( int y = left; y < right; ++y )
+ painter.drawLine( left * 20, y * 20, right * 20, y * 20 );
+}
+
+#include "%{APPNAMELC}_part.moc"
diff --git a/languages/cpp/app_templates/kofficepart/kopart_part.h b/languages/cpp/app_templates/kofficepart/kopart_part.h
new file mode 100644
index 00000000..03361ca7
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_part.h
@@ -0,0 +1,30 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#ifndef %{APPNAME}_PART_H
+#define %{APPNAME}_PART_H
+
+#include <koDocument.h>
+
+class %{APPNAME}Part : public KoDocument
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Part( QWidget *parentWidget = 0, const char *widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false );
+
+ virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = FALSE, double zoomX = 1.0, double zoomY = 1.0 );
+
+ virtual bool initDoc( InitDocFlags flags, QWidget* parentWidget = 0 );
+
+ virtual bool loadOasis( const QDomDocument & doc, KoOasisStyles& oasisStyles, const QDomDocument & settings, KoStore* store );
+ virtual bool loadXML( QIODevice *, const QDomDocument & );
+ virtual QDomDocument saveXML();
+ virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
+
+protected:
+ virtual KoView* createViewInstance( QWidget* parent, const char* name );
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kofficepart/kopart_view.cpp b/languages/cpp/app_templates/kofficepart/kopart_view.cpp
new file mode 100644
index 00000000..28c0b42f
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_view.cpp
@@ -0,0 +1,52 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+#include "%{APPNAMELC}_view.h"
+#include "%{APPNAMELC}_factory.h"
+#include "%{APPNAMELC}_part.h"
+
+#include <qpainter.h>
+#include <qiconset.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+%{APPNAME}View::%{APPNAME}View( %{APPNAME}Part* part, QWidget* parent, const char* name )
+ : KoView( part, parent, name )
+{
+ setInstance( %{APPNAME}Factory::global() );
+ setXMLFile( "%{APPNAMELC}.rc" );
+ KStdAction::cut(this, SLOT( cut() ), actionCollection(), "cut" );
+ // Note: Prefer KStdAction::* to any custom action if possible.
+ //m_cut = new KAction( i18n("&Cut"), "editcut", 0, this, SLOT( cut() ),
+ // actionCollection(), "cut");
+}
+
+void %{APPNAME}View::paintEvent( QPaintEvent* ev )
+{
+ QPainter painter;
+ painter.begin( this );
+
+ /// @todo Scaling
+
+ // Let the document do the drawing
+ koDocument()->paintEverything( painter, ev->rect(), FALSE, this );
+
+ painter.end();
+}
+
+void %{APPNAME}View::updateReadWrite( bool /*readwrite*/ )
+{
+#ifdef __GNUC__
+#warning TODO
+#endif
+}
+
+void %{APPNAME}View::cut()
+{
+ kdDebug(31000) << "%{APPNAME}View::cut(): CUT called" << endl;
+}
+
+#include "%{APPNAMELC}_view.moc"
diff --git a/languages/cpp/app_templates/kofficepart/kopart_view.h b/languages/cpp/app_templates/kofficepart/kopart_view.h
new file mode 100644
index 00000000..eb14763f
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/kopart_view.h
@@ -0,0 +1,34 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#ifndef %{APPNAME}_VIEW
+#define %{APPNAME}_VIEW
+
+#include <koView.h>
+
+class KAction;
+class QPaintEvent;
+
+class %{APPNAME}Part;
+
+class %{APPNAME}View : public KoView
+{
+ Q_OBJECT
+public:
+ %{APPNAME}View( %{APPNAME}Part* part, QWidget* parent = 0, const char* name = 0 );
+
+protected slots:
+ void cut();
+
+protected:
+ void paintEvent( QPaintEvent* );
+
+ virtual void updateReadWrite( bool readwrite );
+
+private:
+ //KAction* m_cut;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kofficepart/main.cpp b/languages/cpp/app_templates/kofficepart/main.cpp
new file mode 100644
index 00000000..1561922a
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/main.cpp
@@ -0,0 +1,33 @@
+
+/* This template is based off of the KOffice example written by Torben Weis <weis@kde.org
+ It was converted to a KDevelop template by Ian Reinhart Geiser <geiseri@yahoo.com>
+*/
+
+#include <koApplication.h>
+#include <koDocument.h>
+#include <koMainWindow.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <dcopclient.h>
+#include "%{APPNAMELC}_aboutdata.h"
+
+
+static const KCmdLineOptions options[]=
+{
+ {"+[file]", I18N_NOOP("File to open"),0},
+ KCmdLineLastOption
+};
+
+int main( int argc, char **argv )
+{
+ KCmdLineArgs::init( argc, argv, new%{APPNAME}AboutData() );
+ KCmdLineArgs::addCmdLineOptions( options );
+ KoApplication app;
+
+ app.dcopClient()->attach();
+ app.dcopClient()->registerAs( "%{APPNAMELC}" );
+
+ if (!app.start()) // parses command line args, create initial docs and shells
+ return 1;
+ return app.exec();
+}
diff --git a/languages/cpp/app_templates/kofficepart/src-Makefile.am b/languages/cpp/app_templates/kofficepart/src-Makefile.am
new file mode 100644
index 00000000..19d38267
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/src-Makefile.am
@@ -0,0 +1,41 @@
+
+INCLUDES = $(KOFFICE_INCLUDES) $(all_includes)
+
+## The part
+kde_module_LTLIBRARIES = lib%{APPNAMELC}part.la
+lib%{APPNAMELC}part_la_SOURCES = %{APPNAMELC}_part.cpp \
+ %{APPNAMELC}_view.cpp %{APPNAMELC}_factory.cpp
+lib%{APPNAMELC}part_la_LDFLAGS = $(KDE_PLUGIN)
+lib%{APPNAMELC}part_la_LIBADD = -lkofficeui
+
+## The kdeinit loadable module
+lib_LTLIBRARIES = %{APPNAMELC}.la
+%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp
+%{APPNAMELC}_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+%{APPNAMELC}_la_LIBADD = -lkofficecore
+
+## The executable
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = dummy.cpp
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+%{APPNAMELC}_LDADD = %{APPNAMELC}.la
+
+dummy.cpp:
+ echo > dummy.cpp
+
+METASOURCES = AUTO
+noinst_HEADERS = %{APPNAMELC}_part.h \
+ %{APPNAMELC}_view.h %{APPNAMELC}_factory.h %{APPNAMELC}_aboutdata.h
+
+kdelnk_DATA = %{APPNAMELC}.desktop
+kdelnkdir = $(kde_appsdir)/Office
+
+kdemime_DATA = x-%{APPNAMELC}.desktop
+kdemimedir = $(kde_mimedir)/application
+
+rc_DATA = %{APPNAMELC}.rc
+rcdir = $(kde_datadir)/%{APPNAMELC}
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp %{APPNAMELC}_aboutdata.h -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kofficepart/subdirs b/languages/cpp/app_templates/kofficepart/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kofficepart/x-kopart.desktop b/languages/cpp/app_templates/kofficepart/x-kopart.desktop
new file mode 100644
index 00000000..f4e15e79
--- /dev/null
+++ b/languages/cpp/app_templates/kofficepart/x-kopart.desktop
@@ -0,0 +1,40 @@
+# KDE Config File
+[Desktop Entry]
+MimeType=application/x-%{APPNAMELC}
+Comment= A really awesome KOffice application
+Comment[ca]=Una aplicació de KOffice realment interessant
+Comment[da]=Et helt fantastisk KOffice program
+Comment[de]=Eine wirklich großartige KOffice-Anwendung
+Comment[el]= Μια πραγματικά όμορφη εφαρμογή KOffice
+Comment[es]=Una aplicación de KOffice realmente intesesante
+Comment[et]=Tõesti imeline KOffice'i rakendus
+Comment[eu]=KOffice aplikazio harrigarri bat
+Comment[fa]=کاربرد واقعاً بیمناک KOffice
+Comment[fr]=Une application pour KOffice vraiment superbe
+Comment[ga]= Feidhmchlár sármhaith KOffice
+Comment[gl]=Unha aplicación de KOffice realmente impresionante
+Comment[hu]=Egy bámulatos KOffice-alkalmazás
+Comment[it]=Un'applicazione di KOffice veramente bella
+Comment[nds]=En redig deegt KOffice-Programm
+Comment[ne]= वास्तवमै प्रभावकारी केडीई अफिस अनुप्रयोग
+Comment[nl]=Een fantastische KOffice-toepassing
+Comment[pl]=Wspaniały program KOffice
+Comment[pt]=Uma aplicação fantástica para o KOffice
+Comment[pt_BR]=Um aplicativo realmente do tipo do KOffice
+Comment[ru]=Приложение KOffice
+Comment[sk]=Naozaj hrozná KOffice aplikácia
+Comment[sl]=Sijajen program za KOffice
+Comment[sr]=Стварно сјајан KOffice програм
+Comment[sr@Latn]=Stvarno sjajan KOffice program
+Comment[sv]=Ett riktigt suveränt Koffice-program
+Comment[tr]=Gerçekten harika bir KOffice uygulaması
+Comment[zh_CN]=一个非常杰出的 KOffice 应用程序
+Comment[zh_TW]=一個十分完美的 KOffice 應用程式
+Type=MimeType
+#You need to change the mime type below to match what your application will handle...
+Patterns=*.xmpl;
+X-KDE-AutoEmbed=false
+[Property::X-KDE-NativeExtension]
+Type=QString
+#You need to change the mime type below to match what your application will handle...
+Value=.xmpl
diff --git a/languages/cpp/app_templates/konqnavpanel/.kdev_ignore b/languages/cpp/app_templates/konqnavpanel/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/.kdev_ignore
diff --git a/languages/cpp/app_templates/konqnavpanel/Makefile.am b/languages/cpp/app_templates/konqnavpanel/Makefile.am
new file mode 100644
index 00000000..7a3ae56b
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = konqnavpanel.cpp konqnavpanel.h konqnavpanel.desktop \
+ konqnavpanel.kdevelop src-Makefile.am \
+ konqnavpanel.png subdirs
+templateName = konqnavpanel
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp
new file mode 100644
index 00000000..34515ce2
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.cpp
@@ -0,0 +1,34 @@
+
+#include <qlabel.h>
+#include <kinstance.h>
+#include <qstring.h>
+#include <qwidget.h>
+
+#include "%{APPNAMELC}.h"
+#include "%{APPNAMELC}.moc"
+
+%{APPNAME}::%{APPNAME}(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name):
+ KonqSidebarPlugin(inst,parent,widgetParent,desktopName,name)
+{
+ widget=new QLabel("Init Value",widgetParent);
+}
+
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+void %{APPNAME}::handleURL(const KURL &url)
+{
+ widget->setText(QString("%{APPNAME}")+"::"+url.url());
+}
+
+
+
+extern "C"
+{
+ void* create_konqsidebar_%{APPNAME}(KInstance *instance,QObject *par,QWidget *widp,QString &desktopname,const char *name)
+ {
+ return new %{APPNAME}(instance,par,widp,desktopname,name);
+ }
+};
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop
new file mode 100644
index 00000000..31e23a1a
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Type=Link
+URL=
+Icon=wizard
+Comment=A konqueror navigation panel plugin called $NAME$
+Comment[ca]=Un connector per al plafó de navegació de Konqueror anomenat $NAME$
+Comment[da]=Et Konqueror navigationspanel plugin der hedder $NAME$
+Comment[de]=Ein Modul für den Navigationsbereich von Konqueror mit Namen $NAME$
+Comment[el]=Ένα πρόσθετο του πίνακα πλοήγησης του konqueror με το όνομα $NAME$
+Comment[es]=Un complemento del panel de navegación de Konqueror llamado $NAME$
+Comment[et]=Konquerori liikumispaneeli plugin nimega $NAME$
+Comment[eu]=$NAME$ izeneko konqueror arakatze-paneleko plugin bat
+Comment[fa]=وصلۀ تابلوی ناوش konqueror، $NAME$ نامیده شد
+Comment[fr]=Un module externe pour le panneau de navigation de Konqueror appelé $NAME$
+Comment[ga]=Breiseán painéil nascleanúna konqueror darb ainm $NAME$
+Comment[gl]=Unha extensión para o panel de navegación de konqueror chamado $NAME$
+Comment[hu]=Bővítőmodul a Konqueror navigációs paneljéhez ($NAMES$)
+Comment[it]=Un plugin per il pannello di navigazione di Konqueror chiamato $NAME$
+Comment[ja]=$NAME$ と呼ばれる konqueror ナビゲーションプラグイン
+Comment[nds]=En Sietpaneelmoduul för Konqueror, nöömt $NAME$
+Comment[ne]= $NAME$ भनिने कन्क्वेरर नेभिगेसन प्यानल प्लगइन
+Comment[nl]=Een konqueror navigatiepaneel-plugin met de naam $NAME$
+Comment[pl]=Wtyczka do panelu nawigacyjnego Konquerora o nazwie $NAME$
+Comment[pt]=Um 'plugin' do painel de navegação do konqueror chamado $NAME$
+Comment[pt_BR]=Um plug-in de painel de navegação do konqueror chamado $NAME$
+Comment[ru]=Модуль панели навигации Konqueror $NAME$
+Comment[sk]=Modul pre konqueror navigačný panel s menom $NAME$
+Comment[sl]=Konquerorjev vstavek pulta za navigacijo z imenom $NAME$
+Comment[sr]=Кonqueror-ов прикључак за навигациони панел по имену $NAME$
+Comment[sr@Latn]=Konqueror-ov priključak za navigacioni panel po imenu $NAME$
+Comment[sv]=Ett insticksprogram i Konquerors navigeringspanel som heter $NAME$
+Comment[tr]=$NAME$ adında bir konqueror gezinme paneli eklentisi
+Comment[zh_CN]=一个称作 $NAME$ 的 konqueror 导航面板插件
+Comment[zh_TW]=名稱為 $NAME$ 的 Konqueror 導覽面板外掛程式
+Name=%{APPNAMELC}
+
+Open=false
+X-KDE-KonqSidebarModule=konqsidebar_%{APPNAMELC}
+
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h
new file mode 100644
index 00000000..949c68d3
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.h
@@ -0,0 +1,43 @@
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <konqsidebarplugin.h>
+#include <qstring.h>
+#include <kconfig.h>
+
+
+class %{APPNAME} : public KonqSidebarPlugin
+{
+ Q_OBJECT
+
+public:
+ /**
+ * Construct a @ref KonqSidebarPlugin.
+ *
+ * @param inst The sidebar's kinstance class.
+ * @param parent The sidebar internal button info class responsible for this plugin.
+ * @param widgetParent The container which will contain the plugins widget.
+ * @param desktopName The filename of the configuration file.
+ * @param name A Qt object name for your plugin.
+ **/
+ %{APPNAME}(KInstance *inst,QObject *parent,QWidget *widgetParent, QString &desktopName, const char* name=0);
+
+ /** destructor */
+ ~%{APPNAME}();
+
+ virtual QWidget *getWidget(){return widget;}
+ virtual void *provides(const QString &) {return 0;}
+
+protected:
+ /*Example widget only. You use whichever widget you want. You onl have to care that getWidget returns some kind of widget */
+ QLabel *widget;
+ virtual void handleURL(const KURL &url);
+
+};
+
+#endif
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop
new file mode 100644
index 00000000..8bb35326
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>Kicker</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate
new file mode 100644
index 00000000..4cbc7d5d
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.kdevtemplate
@@ -0,0 +1,192 @@
+# KDE Config File
+[General]
+Name=Konqueror Navigation Panel Plugin
+Name[br]=Lugent panell furchal Konqueror
+Name[ca]=Un connector per al plafó de navegació de Konqueror
+Name[da]=Konqueror navigationspanel plugin
+Name[de]=Modul für den Navigationsbereich von Konqueror
+Name[el]=Πρόσθετο πίνακα πλοήγησης του Konqueror
+Name[es]=Un complemento para el panel de navegación de Konqueror
+Name[et]=Konquerori liikumispaneeli plugin
+Name[eu]=Konqueror arakatze-panel plugina
+Name[fa]=وصلۀ تابلوی ناوش Konqueror
+Name[fr]=Module externe pour le panneau de navigation de Konqueror
+Name[ga]=Breiseán Painéil Nascleanúna Konqueror
+Name[gl]=Extensión para o panel de navegación de Konqueror
+Name[hu]=Konqueroros navigációs bővítőmodul
+Name[it]=Plugin per il pannello di navigazione di Konqueror
+Name[ja]=Konqueror ナビゲーションプラグイン
+Name[nds]=En Sietpaneelmoduul för Konqueror
+Name[ne]=कन्क्वेरर नेभिगेसन प्यानल प्लगइन
+Name[nl]=Konqueror Navigatiepaneel-plugin
+Name[pl]=Wtyczka panelu nawigacji Konquerora
+Name[pt]='Plugin' do Painel de Navegação do Konqueror
+Name[pt_BR]='Plugin' do Painel de Navegação do Konqueror
+Name[ru]=Модуль панели навигации Konqueror
+Name[sk]=Modul pre konqueror navigačný panel
+Name[sr]=Кonqueror-ов прикључак за навигациони панел
+Name[sr@Latn]=Konqueror-ov priključak za navigacioni panel
+Name[sv]=Konqueror-insticksprogram för navigeringspanelen
+Name[tr]=Konqueror Gezinme Paneli Eklentisi
+Name[zh_CN]=Konqueror 导航面板插件
+Name[zh_TW]=Konqueror 導覽面板外掛程式
+Icon=konqnavpanel.png
+Category=C++/KDE
+Comment=Generates a framework for a plugin that embeds into Konqueror's navigation panel
+Comment[ca]=Genera una infraestructura per a un connector que s'encasti al plafó de navegació de Konqueror
+Comment[da]=Genererer et skelet for et plugin der indlejres i Konqueror's navigationspanel
+Comment[de]=Erstellt das Gerüst für ein Modul, das in den Navigationsbereich von Konqueror eingebunden werden kann.
+Comment[el]=Δημιουργεί ένα πλαίσιο για ένα πρόσθετο που ενσωματώνεται στον πίνακα πλοήγησης του Konqueror
+Comment[es]=Genera una infraestructura para un complemento empotrado en el panel de navegación de Konqueror
+Comment[et]=Plugina raamistiku loomine, mida saab põimida Konquerori liikumispaneelile.
+Comment[eu]=Konqueror-en arakatze-panelean kapsulatzen den plugin batentzat lan-marko oso bat sortzen du
+Comment[fa]=چارچوبی را برای یک وصله که در تابلوی ناوش Konqueror نهفته بود، تولید می‌کند
+Comment[fr]=Génère une infrastructure pour un module externe qui s'intègre dans le panneau de navigation de Konqueror
+Comment[gl]=Xera un contorno de traballo para unha extensión que se incrusta no panel de navegación de Konqueror
+Comment[hu]=Létrehoz egy alapprogramot konqueroros navigációs panelmodul készítéséhez
+Comment[it]=Genera l'infrastruttura per un plugin che si integra nel pannello di navigazione di Konqueror
+Comment[nds]=Stellt dat Rahmenwark för en Moduul op, dat sik in't Sietpaneel vun Konqueror inbett
+Comment[ne]=कन्क्वेररको नेभिगेसन प्यानलमा सम्मिलित हुने प्लगइनका लागि फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Genereert een framework voor een plugin die kan worden ingebed in Konqueror's navigatiepaneel.
+Comment[pl]=Generuje wtyczkę, którą można osadzić w panelu nawigacyjnym Konquerora
+Comment[pt]=Gera a plataforma para um 'plugin' que se incorpore no painel de navegação do Konqueror
+Comment[pt_BR]=Gera a plataforma para um 'plugin' que se incorpore no painel de navegação do Konqueror
+Comment[ru]=Создание модуля панели навигации Konqueror
+Comment[sk]=Vygeneruje framework pre modul, ktorý sa bude dať vložiť do konqueror navigačného panelu
+Comment[sr]=Прави радни оквир за прикључак који се уграђује у Konqueror-ов навигациони панел
+Comment[sr@Latn]=Pravi radni okvir za priključak koji se ugrađuje u Konqueror-ov navigacioni panel
+Comment[sv]=Skapar ett ramverk för ett insticksprogram som inbäddas i Konquerors navigeringspanel
+Comment[tr]=Konqueror'un gezinme paneline gömülen bir eklenti için bir çatı oluşturur.
+Comment[zh_CN]=生成可嵌入到 Konqueror 导航面板的插件框架
+Comment[zh_TW]=產生一個嵌入 Konqueror 導覽面板的外掛程式的框架
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=konqnavpanel.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/konqnavpanel.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/konqnavpanel.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/konqnavpanel.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/konqnavpanel.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=A konqueror navigation panel plugin was created in %{dest}
+Comment[ca]=Un connector per al plafó de navegació de Konqueror ha estat creada en %{dest}
+Comment[da]=Et Konqueror navigationspanel plugin blev oprettet i %{dest}
+Comment[de]=Ein Modul für den Navigationsbereich von Konqueror wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο του πίνακα πλοήγησης του konqueror δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para el panel de navegación de Konqueror ha sido creado en %{dest}
+Comment[et]=Konquerori liikumispaneeli plugin loodi asukohta %{dest}
+Comment[eu]=Konqueror-en arakatze-paneleko plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ تابلوی ناوش konqueror در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour le panneau de navigation de Konqueror a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán painéil nascleanúna konqueror i %{dest}
+Comment[gl]=Creouse unha extensión para o panel de navegación en %{dest}
+Comment[hu]=Létrejött egy konqueroros navigációs modul itt: %{dest}
+Comment[it]=È stato creato un plugin per il pannello di navigazione di Konqueror in %{dest}
+Comment[ja]=Konqueror ナビゲーションプラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Sietpaneelmoduul för Konqueror opstellt
+Comment[ne]=कन्क्वेरर नेभिगेसन प्यानल प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Konqueror-navigatiepaneel-plugin is aangemaakt in %{dest}
+Comment[pl]=Wtyczka do panelu nawigacyjnego Konquerora została utworzona w %{dest}
+Comment[pt]=Um 'plugin' do painel de navegação do Konqueror foi criado em %{dest}
+Comment[pt_BR]=Um 'plugin' do painel de navegação do Konqueror foi criado em %{dest}
+Comment[ru]=Модуль панели навигации Konqueror создан в %{dest}
+Comment[sk]=Modul pre konqueror navigačný panel bol vytvorený v %{dest}
+Comment[sr]=Кonqueror-ов прикључак за навигациони панел направљен је у %{dest}
+Comment[sr@Latn]=Konqueror-ov priključak za navigacioni panel napravljen je u %{dest}
+Comment[sv]=Ett Konqueror-insticksprogram för navigeringspanelen skapades i %{dest}
+Comment[tr]=Bir konqueror gezinme paneli eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 konqueror 导航器面板插件
+Comment[zh_TW]=一個 Konqueror 導覽面板外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png
new file mode 100644
index 00000000..dd0d89f3
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/konqnavpanel.png
Binary files differ
diff --git a/languages/cpp/app_templates/konqnavpanel/src-Makefile.am b/languages/cpp/app_templates/konqnavpanel/src-Makefile.am
new file mode 100644
index 00000000..5a9113c5
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/src-Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES= $(all_includes)
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES=konqsidebar_%{APPNAMELC}.la
+
+konqsidebar_%{APPNAMELC}_la_SOURCES = %{APPNAMELC}.cpp
+konqsidebar_%{APPNAMELC}_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -lkonqsidebarplugin
+konqsidebar_%{APPNAMELC}_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE)
+
+%{APPNAMELC}_entry_DATA = %{APPNAMELC}.desktop
+%{APPNAMELC}_entrydir = $(kde_datadir)/konqsidebartng/entries
diff --git a/languages/cpp/app_templates/konqnavpanel/subdirs b/languages/cpp/app_templates/konqnavpanel/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/konqnavpanel/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kpartapp/.kdev_ignore b/languages/cpp/app_templates/kpartapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/kpartapp/Makefile.am b/languages/cpp/app_templates/kpartapp/Makefile.am
new file mode 100644
index 00000000..9b69f17d
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = src-Makefile.am app.cpp app.h app_part.cpp\
+ app_part.h main.cpp app_part.rc app_shell.rc \
+ kpartapp.png app.kdevelop subdirs
+templateName = kpartapp
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kpartapp/app.cpp b/languages/cpp/app_templates/kpartapp/app.cpp
new file mode 100644
index 00000000..68c34ab3
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app.cpp
@@ -0,0 +1,209 @@
+
+#include "%{APPNAMELC}.h"
+
+#include <kkeydialog.h>
+#include <kfiledialog.h>
+#include <kconfig.h>
+#include <kurl.h>
+
+#include <kedittoolbar.h>
+
+#include <kaction.h>
+#include <kstdaction.h>
+
+#include <klibloader.h>
+#include <kmessagebox.h>
+#include <kstatusbar.h>
+#include <klocale.h>
+
+%{APPNAME}::%{APPNAME}()
+ : KParts::MainWindow( 0L, "%{APPNAME}" )
+{
+ // set the shell's ui resource file
+ setXMLFile("%{APPNAMELC}_shell.rc");
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar()->show();
+
+ // this routine will find and load our Part. it finds the Part by
+ // name which is a bad idea usually.. but it's alright in this
+ // case since our Part is made for this Shell
+ KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part");
+ if (factory)
+ {
+ // now that the Part is loaded, we cast it to a Part to get
+ // our hands on it
+ m_part = static_cast<KParts::ReadWritePart *>(factory->create(this,
+ "%{APPNAMELC}_part", "KParts::ReadWritePart" ));
+
+ if (m_part)
+ {
+ // tell the KParts::MainWindow that this is indeed the main widget
+ setCentralWidget(m_part->widget());
+
+ // and integrate the part's GUI with the shell's
+ createGUI(m_part);
+ }
+ }
+ else
+ {
+ // if we couldn't find our Part, we exit since the Shell by
+ // itself can't do anything useful
+ KMessageBox::error(this, i18n("Could not find our part."));
+ kapp->quit();
+ // we return here, cause kapp->quit() only means "exit the
+ // next time we enter the event loop...
+ return;
+ }
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+void %{APPNAME}::load(const KURL& url)
+{
+ m_part->openURL( url );
+}
+
+void %{APPNAME}::setupActions()
+{
+ KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
+}
+
+void %{APPNAME}::saveProperties(KConfig* /*config*/)
+{
+ // the 'config' object points to the session managed
+ // config file. anything you write here will be available
+ // later when this app is restored
+}
+
+void %{APPNAME}::readProperties(KConfig* /*config*/)
+{
+ // the 'config' object points to the session managed
+ // config file. this function is automatically called whenever
+ // the app is being restored. read in here whatever you wrote
+ // in 'saveProperties'
+}
+
+void %{APPNAME}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here..
+ if ( ! m_part->url().isEmpty() || m_part->isModified() )
+ {
+ (new %{APPNAME})->show();
+ };
+}
+
+
+void %{APPNAME}::optionsShowToolbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // toolbar
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void %{APPNAME}::optionsShowStatusbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // statusbar
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void %{APPNAME}::optionsConfigureKeys()
+{
+ KKeyDialog::configure(actionCollection());
+}
+
+void %{APPNAME}::optionsConfigureToolbars()
+{
+#if defined(KDE_MAKE_VERSION)
+# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0)
+ saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+# else
+ saveMainWindowSettings(KGlobal::config() );
+# endif
+#else
+ saveMainWindowSettings(KGlobal::config() );
+#endif
+
+ // use the standard toolbar editor
+ KEditToolbar dlg(factory());
+ connect(&dlg, SIGNAL(newToolbarConfig()),
+ this, SLOT(applyNewToolbarConfig()));
+ dlg.exec();
+}
+
+void %{APPNAME}::applyNewToolbarConfig()
+{
+#if defined(KDE_MAKE_VERSION)
+# if KDE_VERSION >= KDE_MAKE_VERSION(3,1,0)
+ applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+# else
+ applyMainWindowSettings(KGlobal::config());
+# endif
+#else
+ applyMainWindowSettings(KGlobal::config());
+#endif
+}
+
+void %{APPNAME}::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ KURL url =
+ KFileDialog::getOpenURL( QString::null, QString::null, this );
+
+ if (url.isEmpty() == false)
+ {
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here..
+ if ( m_part->url().isEmpty() && ! m_part->isModified() )
+ {
+ // we open the file in this window...
+ load( url );
+ }
+ else
+ {
+ // we open the file in a new window...
+ %{APPNAME}* newWin = new %{APPNAME};
+ newWin->load( url );
+ newWin->show();
+ }
+ }
+}
+
+#include "%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kpartapp/app.desktop b/languages/cpp/app_templates/kpartapp/app.desktop
new file mode 100644
index 00000000..01cc9d37
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app.desktop
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Name=%{APPNAME}Part
+Name[br]=Perzh%{APPNAME}
+Name[ca]=Part per a %{APPNAME}
+Name[el]=Τμήμα%{APPNAME}
+Name[et]=%{APPNAME} komponent
+Name[fa]=جزء %{APPNAME}
+Name[gl]=%{APPNAME} Part
+Name[ja]=%{APPNAME} パート
+Name[ne]=%{APPNAME}भाग
+Name[pt_BR]=Parte %{APPNAME}
+Name[sv]=%{APPNAME}-del
+Name[ta]=%{APPNAME}பாகம்
+Name[tr]=%{APPNAME} Bileşeni
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=lib%{APPNAMELC}part
+Type=Service
diff --git a/languages/cpp/app_templates/kpartapp/app.h b/languages/cpp/app_templates/kpartapp/app.h
new file mode 100644
index 00000000..25cd63bf
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app.h
@@ -0,0 +1,76 @@
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kparts/mainwindow.h>
+
+class KToggleAction;
+
+/**
+ * This is the application "Shell". It has a menubar, toolbar, and
+ * statusbar but relies on the "Part" to do all the real work.
+ *
+ * @short Application Shell
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public KParts::MainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+
+ /**
+ * Use this method to load whatever file/URL you have
+ */
+ void load(const KURL& url);
+
+protected:
+ /**
+ * This method is called when it is time for the app to save its
+ * properties for session management purposes.
+ */
+ void saveProperties(KConfig *);
+
+ /**
+ * This method is called when this app is restored. The KConfig
+ * object points to the session management config file that was saved
+ * with @ref saveProperties
+ */
+ void readProperties(KConfig *);
+
+private slots:
+ void fileNew();
+ void fileOpen();
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+
+ void applyNewToolbarConfig();
+
+private:
+ void setupAccel();
+ void setupActions();
+
+private:
+ KParts::ReadWritePart *m_part;
+
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+};
+
+#endif // _%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/kpartapp/app.kdevelop b/languages/cpp/app_templates/kpartapp/app.kdevelop
new file mode 100644
index 00000000..3adbae9e
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app.kdevelop
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+</kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kpartapp/app_part.cpp b/languages/cpp/app_templates/kpartapp/app_part.cpp
new file mode 100644
index 00000000..bf63557f
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app_part.cpp
@@ -0,0 +1,201 @@
+
+#include "%{APPNAMELC}_part.h"
+
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kfiledialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qmultilineedit.h>
+
+%{APPNAME}Part::%{APPNAME}Part( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name )
+ : KParts::ReadWritePart(parent, name)
+{
+ // we need an instance
+ setInstance( %{APPNAME}PartFactory::instance() );
+
+ // this should be your custom internal widget
+ m_widget = new QMultiLineEdit( parentWidget, widgetName );
+
+ // notify the part that this is our internal widget
+ setWidget(m_widget);
+
+ // create our actions
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+ KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ KStdAction::save(this, SLOT(save()), actionCollection());
+
+ // set our XML-UI resource file
+ setXMLFile("%{APPNAMELC}_part.rc");
+
+ // we are read-write by default
+ setReadWrite(true);
+
+ // we are not modified since we haven't done anything yet
+ setModified(false);
+}
+
+%{APPNAME}Part::~%{APPNAME}Part()
+{
+}
+
+void %{APPNAME}Part::setReadWrite(bool rw)
+{
+ // notify your internal widget of the read-write state
+ m_widget->setReadOnly(!rw);
+ if (rw)
+ connect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ else
+ {
+ disconnect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ }
+
+ ReadWritePart::setReadWrite(rw);
+}
+
+void %{APPNAME}Part::setModified(bool modified)
+{
+ // get a handle on our Save action and make sure it is valid
+ KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if (!save)
+ return;
+
+ // if so, we either enable or disable it based on the current
+ // state
+ if (modified)
+ save->setEnabled(true);
+ else
+ save->setEnabled(false);
+
+ // in any event, we want our parent to do it's thing
+ ReadWritePart::setModified(modified);
+}
+
+bool %{APPNAME}Part::openFile()
+{
+ // m_file is always local so we can use QFile on it
+ QFile file(m_file);
+ if (file.open(IO_ReadOnly) == false)
+ return false;
+
+ // our example widget is text-based, so we use QTextStream instead
+ // of a raw QDataStream
+ QTextStream stream(&file);
+ QString str;
+ while (!stream.eof())
+ str += stream.readLine() + "\n";
+
+ file.close();
+
+ // now that we have the entire file, display it
+ m_widget->setText(str);
+
+ // just for fun, set the status bar
+ emit setStatusBarText( m_url.prettyURL() );
+
+ return true;
+}
+
+bool %{APPNAME}Part::saveFile()
+{
+ // if we aren't read-write, return immediately
+ if (isReadWrite() == false)
+ return false;
+
+ // m_file is always local, so we use QFile
+ QFile file(m_file);
+ if (file.open(IO_WriteOnly) == false)
+ return false;
+
+ // use QTextStream to dump the text to the file
+ QTextStream stream(&file);
+ stream << m_widget->text();
+
+ file.close();
+
+ return true;
+}
+
+void %{APPNAME}Part::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ QString file_name = KFileDialog::getOpenFileName();
+
+ if (file_name.isEmpty() == false)
+ openURL(file_name);
+}
+
+void %{APPNAME}Part::fileSaveAs()
+{
+ // this slot is called whenever the File->Save As menu is selected,
+ QString file_name = KFileDialog::getSaveFileName();
+ if (file_name.isEmpty() == false)
+ saveAs(file_name);
+}
+
+
+// It's usually safe to leave the factory code alone.. with the
+// notable exception of the KAboutData data
+#include <kaboutdata.h>
+#include <klocale.h>
+
+KInstance* %{APPNAME}PartFactory::s_instance = 0L;
+KAboutData* %{APPNAME}PartFactory::s_about = 0L;
+
+%{APPNAME}PartFactory::%{APPNAME}PartFactory()
+ : KParts::Factory()
+{
+}
+
+%{APPNAME}PartFactory::~%{APPNAME}PartFactory()
+{
+ delete s_instance;
+ delete s_about;
+
+ s_instance = 0L;
+}
+
+KParts::Part* %{APPNAME}PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args )
+{
+ // Create an instance of our Part
+ %{APPNAME}Part* obj = new %{APPNAME}Part( parentWidget, widgetName, parent, name );
+
+ // See if we are to be read-write or not
+ if (QCString(classname) == "KParts::ReadOnlyPart")
+ obj->setReadWrite(false);
+
+ return obj;
+}
+
+KInstance* %{APPNAME}PartFactory::instance()
+{
+ if( !s_instance )
+ {
+ s_about = new KAboutData("%{APPNAMELC}part", I18N_NOOP("%{APPNAME}Part"), "%{VERSION}");
+ s_about->addAuthor("%{AUTHOR}", 0, "%{EMAIL}");
+ s_instance = new KInstance(s_about);
+ }
+ return s_instance;
+}
+
+extern "C"
+{
+ void* init_lib%{APPNAMELC}part()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}PartFactory;
+ }
+};
+
+#include "%{APPNAMELC}_part.moc"
diff --git a/languages/cpp/app_templates/kpartapp/app_part.h b/languages/cpp/app_templates/kpartapp/app_part.h
new file mode 100644
index 00000000..37c30189
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app_part.h
@@ -0,0 +1,86 @@
+
+#ifndef _%{APPNAMEUC}PART_H_
+#define _%{APPNAMEUC}PART_H_
+
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+class QWidget;
+class QPainter;
+class KURL;
+class QMultiLineEdit;
+
+/**
+ * This is a "Part". It that does all the real work in a KPart
+ * application.
+ *
+ * @short Main Part
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME}Part : public KParts::ReadWritePart
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAME}Part(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAME}Part();
+
+ /**
+ * This is a virtual function inherited from KParts::ReadWritePart.
+ * A shell will use this to inform this Part if it should act
+ * read-only
+ */
+ virtual void setReadWrite(bool rw);
+
+ /**
+ * Reimplemented to disable and enable Save action
+ */
+ virtual void setModified(bool modified);
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+
+ /**
+ * This must be implemented by each read-write part
+ */
+ virtual bool saveFile();
+
+protected slots:
+ void fileOpen();
+ void fileSaveAs();
+
+private:
+ QMultiLineEdit *m_widget;
+};
+
+class KInstance;
+class KAboutData;
+
+class %{APPNAME}PartFactory : public KParts::Factory
+{
+ Q_OBJECT
+public:
+ %{APPNAME}PartFactory();
+ virtual ~%{APPNAME}PartFactory();
+ virtual KParts::Part* createPartObject( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args );
+ static KInstance* instance();
+
+private:
+ static KInstance* s_instance;
+ static KAboutData* s_about;
+};
+
+#endif // _%{APPNAMEUC}PART_H_
diff --git a/languages/cpp/app_templates/kpartapp/app_part.rc b/languages/cpp/app_templates/kpartapp/app_part.rc
new file mode 100644
index 00000000..cec8ec5c
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app_part.rc
@@ -0,0 +1,17 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_part" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Action name="file_open"/>
+ <Separator/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="file_open"/>
+ <Action name="file_save"/>
+ <Action name="file_print"/>
+ <Separator/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kpartapp/app_shell.rc b/languages/cpp/app_templates/kpartapp/app_shell.rc
new file mode 100644
index 00000000..e0600cda
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/app_shell.rc
@@ -0,0 +1,28 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_shell" version="1">
+<MenuBar>
+ <Menu noMerge="1" name="file"><text>&amp;File</text>
+ <Action name="file_new"/>
+ <Merge/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+ <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+ <Action name="options_show_toolbar"/>
+ <Action name="options_show_statusbar"/>
+ <Merge name="show_merge"/>
+ <Separator/>
+ <Action name="options_configure_keybinding"/>
+ <Action name="options_configure_toolbars"/>
+ <Action name="options_configure"/>
+ <Merge name="configure_merge"/>
+ <Separator/>
+ <Merge/>
+ </Menu>
+</MenuBar>
+<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
+ <Action name="file_new"/>
+ <Merge/>
+ <Action name="help"/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate b/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate
new file mode 100644
index 00000000..03583faa
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/kpartapp.kdevtemplate
@@ -0,0 +1,237 @@
+# KDE Config File
+[General]
+Name=Application framework (KParts)
+Name[ca]=Infraestructura d'aplicació (KParts)
+Name[da]=Programskelet (KParts)
+Name[de]=Anwendungsgerüst (KParts)
+Name[el]=Πλαίσιο εφαρμογής (KParts)
+Name[es]=Infraestructura de aplicación (KParts)
+Name[et]=Rakenduse raamistik (KParts)
+Name[eu]=Aplikazioen lan-markoa (KParts)
+Name[fa]=(KParts)چارچوب کاربرد
+Name[fr]=Infrastructure d'application (KParts)
+Name[ga]=Creatlach feidhmchláir (KParts)
+Name[gl]=Entorno de traballo de aplicación (KParts)
+Name[hu]=Alkalmazás-keretrendszer (objektumokkal)
+Name[it]=Infrastruttura applicativa (KParts)
+Name[ja]=アプリケーションフレームワーク (KParts)
+Name[nds]=Programmrahmenwark (KParts)
+Name[ne]=अनुप्रयोग फ्रेमवर्क (केडीई भाग)
+Name[nl]=Toepassingframework (KParts)
+Name[pl]=Szablon progamu (KParts)
+Name[pt]=Plataforma de aplicações (KParts)
+Name[pt_BR]=Plataforma de aplicações (KParts)
+Name[ru]=Приложение KPart
+Name[sk]=Aplikačný framework (KParts)
+Name[sr]=Радни оквир програма (KParts)
+Name[sr@Latn]=Radni okvir programa (KParts)
+Name[sv]=Programramverk (KParts)
+Name[tr]=Uygulama Çatısı (KParts)
+Name[zh_CN]=应用程序框架(KParts)
+Name[zh_TW]=應用程式框架(KParts)
+Icon=kpartapp.png
+Category=C++/KDE
+Comment=Generates a complex KDE application with a KParts shell and a KPart component.
+Comment[ca]=Genera una complexa aplicació per al KDE amb un intèrpret de comandaments KParts i un component KPart.
+Comment[da]=Genererer et komplekst KDE-program med en KParts-skal og en KPart-komponent.
+Comment[de]=Erstellt eine aufwändige KDE-Anwendung mit einer Shell für KParts und einer KPart-Komponente.
+Comment[el]=Δημιουργεί μια πολύπλοκη εφαρμογή KDE με ένα κέλυφος KParts και ένα συστατικό KPart.
+Comment[es]=Genera una aplicación KDE compleja con un contenedor KParts y un componente KPart.
+Comment[et]=Keerulise KDE rakenduse loomine KParts-shelliga ja KPart-komponendiga.
+Comment[eu]=KDE aplikazio konplexu bat sortzen du KParts shellbat eta KPart osagai batekin.
+Comment[fa]=یک کاربرد پیچیدۀ KDE با یک پوستۀ KParts و یک مؤلفۀ KPart تولید می‌کند.
+Comment[fr]=Génère une application KDE évoluée comprenant un shell KParts et un composant KPart.
+Comment[ga]=Cruthaíonn sé seo feidhmchlár casta KDE le blaosc KParts agus comhpháirt KPart.
+Comment[gl]=Xera unha aplicación KDE complexa cun terminal KPart e unha compoñente KPart.
+Comment[hu]=Létrehoz egy komplex, objektumok használatát támogató KDE-s alkalmazást és egy KPart objektumot.
+Comment[it]=Genera un'applicazione complessa di KDE con una shell di KParts e un componente KPart.
+Comment[nds]=Stellt en vigeliensch KDE-Programm mit en Konsool för KPart un en KPart-Komponent op.
+Comment[ne]=केडीई भाग शेल र केडीई भाग अवयवसँग जटिल केडीई अनुप्रयोग उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een complexe KDE-toepassing met een KParts-shell en een KPart-component.
+Comment[pl]=Generuje złożony program z powłoką KParts i komponentem KPart.
+Comment[pt]=Gera uma aplicação complexa do KDE com uma infra-estrutura de KParts, bem como um componente KPart.
+Comment[pt_BR]=Gera uma aplicação complexa do KDE com uma infra-estrutura de KParts, bem como um componente KPart.
+Comment[ru]=Создание полноценного приложения KDE на базе компонента KPart.
+Comment[sk]=Vygeneruje komplexnú KDE aplikáciu s KParts shell a s KPart komponentom.
+Comment[sr]=Прави сложени KDE програм са KParts шкољком и KPart компонентом.
+Comment[sr@Latn]=Pravi složeni KDE program sa KParts školjkom i KPart komponentom.
+Comment[sv]=Skapar ett komplext KDE-program med ett KPart-skal och en KPart-komponent.
+Comment[tr]=Bir KParts kabuğu ve KParts bileşeni olan karmaşık bir KDE uygulaması yaratır.
+Comment[zh_CN]=生成一个带 KParts 外壳和 KPart 组件的复杂 KDE 应用程序。
+Comment[zh_TW]=產生一個複雜的 KDE 應用程式,內含 KParts shell 與 KPart 元件。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}_part.cpp
+Archive=kpartapp.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-part.desktop
+Dest=%{dest}/src/%{APPNAMELC}_part.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE13]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE14]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE15]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE16]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE17]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE18]
+Type=install
+Source=%{src}/app_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}_part.cpp
+
+[FILE19]
+Type=install
+Source=%{src}/app_part.h
+Dest=%{dest}/src/%{APPNAMELC}_part.h
+
+[FILE20]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE21]
+Type=install
+EscapeXML=true
+Source=%{src}/app_part.rc
+Dest=%{dest}/src/%{APPNAMELC}_part.rc
+
+[FILE22]
+Type=install
+EscapeXML=true
+Source=%{src}/app_shell.rc
+Dest=%{dest}/src/%{APPNAMELC}_shell.rc
+
+[MSG]
+Type=message
+Comment=A complex KDE application using KParts was created in %{dest}
+Comment[ca]=Una complexa aplicació per al KDE usant KParts ha estat creada en %{dest}
+Comment[da]=Et komplekst KDE-program ved brug af KParts blev oprettet i %{dest}
+Comment[de]=Eine aufwändige KDE-Anwendung, die KParts verwendet, wurde in %{dest} erstellt.
+Comment[el]=Μια πολύπλοκη εφαρμογή KDE που χρησιμοποιεί το KParts δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación compleja para KDE que usa KParts ha sido creada en %{dest}
+Comment[et]=KParts'i kasutav keeruline KDE rakendus loodi asukohta %{dest}
+Comment[eu]=KDE aplikazio konplexu bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد پیچیدۀ KDE با استفاده از KParts در %{dest} ایجاد شد
+Comment[fr]=Une application KDE évoluée utilisant KParts a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár casta KDE a úsáideann KParts i %{dest}
+Comment[gl]=Creouse unha aplicación KDE complexa usando KParts en %{dest}
+Comment[hu]=Létrejött egy komplex, objektumok használatát támogató KDE-s alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE complessa usando KParts in %{dest}
+Comment[ja]=KParts を使った複雑な KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en vigeliensch KDE-Programm opstellt, dat "KParts" bruukt.
+Comment[ne]=केडीई भाग प्रयोग गरेर जटिल केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een complexe KDE-toepassing gebruik makend van KParts is aangemaakt in %{dest}
+Comment[pl]=Złożony program KDE używający KParts został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação complexa do KDE, que usa o KParts, em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação complexa do KDE, que usa o KParts, em %{dest}
+Comment[ru]=Приложение KDE на базе компонента KPart создано в %{dest}
+Comment[sk]=Komplexná KDE aplikácia používajúca KParts bola vytvorená v %{dest}
+Comment[sr]=Сложени KDE програм на основу KParts направљен је у %{dest}
+Comment[sr@Latn]=Složeni KDE program na osnovu KParts napravljen je u %{dest}
+Comment[sv]=Ett komplext KDE-program som använder KParts skapades i %{dest}
+Comment[tr]=KParts kullanan karmaşık bir KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个使用 KParts 的复杂 KDE 应用程序
+Comment[zh_TW]=一個使用 KParts 的複雜 KDE 應用程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/kpartapp/kpartapp.png b/languages/cpp/app_templates/kpartapp/kpartapp.png
new file mode 100644
index 00000000..5834ac9f
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/kpartapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/kpartapp/main.cpp b/languages/cpp/app_templates/kpartapp/main.cpp
new file mode 100644
index 00000000..a7c0d2c4
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/main.cpp
@@ -0,0 +1,57 @@
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE KPart Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KApplication app;
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if ( args->count() == 0 )
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++ )
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ widget->load( args->url( i ) );
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
diff --git a/languages/cpp/app_templates/kpartapp/src-Makefile.am b/languages/cpp/app_templates/kpartapp/src-Makefile.am
new file mode 100644
index 00000000..357e2d0b
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/src-Makefile.am
@@ -0,0 +1,53 @@
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}_part.h
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+# this Makefile creates both a KPart application and a KPart
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# the application source, library search path, and link libraries
+%{APPNAMELC}_SOURCES = main.cpp %{APPNAMELC}.cpp
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+%{APPNAMELC}_LDADD = $(LIB_KPARTS)
+
+# this is where the desktop file will go
+shelldesktopdir = $(kde_appsdir)/Utilities
+shelldesktop_DATA = %{APPNAMELC}.desktop
+
+# this is where the shell's XML-GUI resource file goes
+shellrcdir = $(kde_datadir)/%{APPNAMELC}
+shellrc_DATA = %{APPNAMELC}_shell.rc
+
+#########################################################################
+# KPART SECTION
+#########################################################################
+kde_module_LTLIBRARIES = lib%{APPNAMELC}part.la
+
+# the Part's source, library search path, and link libraries
+lib%{APPNAMELC}part_la_SOURCES = %{APPNAMELC}_part.cpp
+lib%{APPNAMELC}part_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_PLUGIN) $(all_libraries)
+lib%{APPNAMELC}part_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE)
+
+# this is where the desktop file will go
+partdesktopdir = $(kde_servicesdir)
+partdesktop_DATA = %{APPNAMELC}_part.desktop
+
+# this is where the part's XML-GUI resource file goes
+partrcdir = $(kde_datadir)/%{APPNAMELC}part
+partrc_DATA = %{APPNAMELC}_part.rc
diff --git a/languages/cpp/app_templates/kpartapp/subdirs b/languages/cpp/app_templates/kpartapp/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kpartapp/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kpartplugin/.kdev_ignore b/languages/cpp/app_templates/kpartplugin/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/.kdev_ignore
diff --git a/languages/cpp/app_templates/kpartplugin/Makefile.am b/languages/cpp/app_templates/kpartplugin/Makefile.am
new file mode 100644
index 00000000..170bdd6d
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \
+ plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \
+ kpartplugin.png plugin.kdevelop subdirs
+
+templateName = kpartplugin
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png
new file mode 100644
index 00000000..e2d7bab8
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png
new file mode 100644
index 00000000..4082bf10
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate
new file mode 100644
index 00000000..f331c6cf
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate
@@ -0,0 +1,204 @@
+# KDE Config File
+[General]
+Name=KHTMLPart plugin
+Name[br]=Lugent KHTMLPart
+Name[ca]=Connector per a KHTMLPart
+Name[de]=KHTMLPart-Modul
+Name[el]=Πρόσθετο KHTMLPart
+Name[es]=Complemento para KHTMLPart
+Name[eu]=KHTMLPart plugina
+Name[fa]=وصلۀ KHTMLPart
+Name[fr]=Module externe pour le composant KHTML
+Name[ga]=Breiseán KHTMLPart
+Name[gl]=Extensión para KHTMLPart
+Name[hu]=KHTML-bővítőmodul
+Name[it]=Plugin KHTMLPart
+Name[ja]=KHTMLPart プラグイン
+Name[nds]=KHTMLPart-Moduul
+Name[ne]=KHTMLPart प्लगइन
+Name[nl]=KHTMLPart-plugin
+Name[pl]=Wtyczka do KHTMLPart
+Name[pt]='Plugin' do KHTMLPart
+Name[pt_BR]='Plugin' do KHTMLPart
+Name[ru]=Модуль KHTMLPart
+Name[sk]=KHTMLPart modul
+Name[sl]=Vstavek za KHTMLPart
+Name[sr]=Прикључак за део KHTML
+Name[sr@Latn]=Priključak za deo KHTML
+Name[sv]=Insticksprogram för KHTML-delprogram
+Name[tr]=KHTMLPart Eklentisi
+Name[zh_CN]=KHTMLPart 插件
+Name[zh_TW]=KHTMLPart 外掛程式
+Icon=kpartplugin.png
+Category=C++/KDE
+Comment=Generates a plugin for the KHTML part.
+Comment[ca]=Genera un connector per a la part KHTML.
+Comment[da]=Genererer et plugin for KHTML parten.
+Comment[de]=Erstellt ein Modul für die Komponente KHTML
+Comment[el]=Δημιουργεί ένα πρόσθετο για το τμήμα KHTML.
+Comment[es]=Genera un complemento para KHTMLPart.
+Comment[et]=KHTML-komponendi plugina loomine.
+Comment[eu]=KHTML zatirako plugin bat sortzen du.
+Comment[fa]=یک وصله برای جزء KHTML تولید می‌کند
+Comment[fr]=Génère un module externe pour le composant KHTML.
+Comment[gl]=Xera unha extensión para o 'part' KHTML.
+Comment[hu]=Létrehoz egy KHTML-bővítőmodult.
+Comment[it]=Genera un plugin per la part KHTML.
+Comment[ja]=KHTML パートのためのプラグインを作成します
+Comment[nds]=Stellt en Moduul för de Komponent KHTML op.
+Comment[ne]=KHTML भागका लागि प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een plugin voor de KHTML-part.
+Comment[pl]=Generuje wtyczkę do KHTML part.
+Comment[pt]=Gera um 'plugin' para a componente KHTML.
+Comment[pt_BR]=Gera um 'plugin' para a componente KHTML.
+Comment[ru]=Создание модуля для компонента KHTML.
+Comment[sk]=Vygeneruje modul pre KHTML part.
+Comment[sr]=Прави прикључак за део KHTML.
+Comment[sr@Latn]=Pravi priključak za deo KHTML.
+Comment[sv]=Skapar ett insticksprogram för KHTML-delprogrammet
+Comment[zh_CN]=生成 KHTML 部件的插件。
+Comment[zh_TW]=產生一個 KHTML part 的外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp
+Archive=kpartplugin.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/plugin_app.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/plugin_app.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin_app.rc
+Dest=%{dest}/src/plugin_%{APPNAMELC}.rc
+
+[FILE15]
+Type=install
+Source=%{src}/hi16-action-plugin.png
+Dest=%{dest}/src/hi16-action-plugin.png
+Process=false
+
+[FILE16]
+Type=install
+Source=%{src}/hi22-action-plugin.png
+Dest=%{dest}/src/hi32-action-plugin.png
+Process=false
+
+[MSG]
+Type=message
+Comment=A KHTMLPart plugin was created in %{dest}
+Comment[ca]=Un connector per a KHTMLPart ha estat creat en %{dest}
+Comment[da]=Et KHTMLPart plugin blev oprettet i %{dest}
+Comment[de]=Ein Modul für die Komponente KHTML wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο τμήμα KHTML δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento para KHTMLPart ha sido creado en %{dest}
+Comment[et]=KHTMLPart plugin loodi asukohta %{dest}
+Comment[eu]=KHTMLPart plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ جزء KHTML در %{dest} ایجاد شد
+Comment[fr]=Un module externe pour KHTMLPart a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán KHTMLPart i %{dest}
+Comment[gl]=Creouse unha extensión para KHTMLPart en %{dest}
+Comment[hu]=Létrejött egy KHTML-bővítőmodul itt: %{dest}
+Comment[it]=È stato creato un plugin KHTMLPart in %{dest}
+Comment[ja]=KHTMLPart プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KHTMLPart-Moduul opstellt
+Comment[ne]=KHTMLPart प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KHTMLPart-plugin is aangemaakt in %{dest}
+Comment[pl]=Wtyczka do KHTMLPart została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' KHTMLPart em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' KHTMLPart em %{dest}
+Comment[ru]=Модуль для компонента KHTML создан в %{dest}
+Comment[sk]=KHTML modul bol vytvorený v %{dest}
+Comment[sr]=Прикључак за део KHTML направљен је у %{dest}
+Comment[sr@Latn]=Priključak za deo KHTML napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för KHTML-delprogrammet skapades i %{dest}
+Comment[tr]=Bir KHTMLPart eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KHTMLPart 插件
+Comment[zh_TW]=一個 KHTML 外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.png b/languages/cpp/app_templates/kpartplugin/kpartplugin.png
new file mode 100644
index 00000000..7d90241a
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/kpartplugin.png
Binary files differ
diff --git a/languages/cpp/app_templates/kpartplugin/plugin.kdevelop b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop
new file mode 100644
index 00000000..dc1b3e25
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+<kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.cpp b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp
new file mode 100644
index 00000000..a9ee55a3
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp
@@ -0,0 +1,109 @@
+
+#include "plugin_%{APPNAMELC}.h"
+
+#include <khtml_part.h>
+#include <kaction.h>
+#include <kinstance.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kglobal.h>
+
+Plugin%{APPNAME}::Plugin%{APPNAME}( QObject* parent, const char* name )
+ : Plugin( parent, name )
+{
+ // Instantiate all of your actions here. These will appear in
+ // Konqueror's menu and toolbars.
+ (void) new KAction( i18n("&Plugin Action"), "%{APPNAMELC}", 0,
+ this, SLOT(slotAction()),
+ actionCollection(), "plugin_action" );
+}
+
+Plugin%{APPNAME}::~Plugin%{APPNAME}()
+{
+}
+
+void Plugin%{APPNAME}::slotAction()
+{
+ // This plugin assumes KHTMLPart. If your plugin can handle more
+ // than this or a different Part than this, simply delete or
+ // change the following block.
+ if ( !parent()->inherits("KHTMLPart") )
+ {
+ QString title( i18n( "Cannot Translate Source" ) );
+ QString text( i18n( "You cannot translate anything except web pages "
+ "with this plugin." ) );
+
+ KMessageBox::sorry( 0, text, title );
+ return;
+ }
+
+ // Get a handle on our parent so we may get the necessary data for
+ // processing
+ KHTMLPart *part = dynamic_cast<KHTMLPart *>(parent());
+
+ // This plugin only uses the URL. You may use whatever data you
+ // need.
+ KURL url( part->url() );
+
+ // This is a standard check to make sure we are dealing with a
+ // valid URL
+ if ( !url.isValid() )
+ {
+ QString title( i18n( "Malformed URL" ) );
+ QString text( i18n( "The URL you entered is not valid, please "
+ "correct it and try again" ) );
+
+ KMessageBox::sorry( 0, text, title );
+ return;
+ }
+
+// The following block is very plugin specific. In this example, we
+// translate the current page with AltaVista's BabelFish. You will
+// definitely want to change this.
+// BEGIN
+ KURL work( "http://babel.altavista.com/translate.dyn" );
+
+ QString query( "urltext=" );
+ query += KURL::encode_string( url.url() );
+ work.setQuery( query );
+// END
+
+ // Finally, execute the request
+ part->openURL( work );
+}
+
+%{APPNAME}Factory::%{APPNAME}Factory()
+ : KLibFactory()
+{
+}
+
+%{APPNAME}Factory::~%{APPNAME}Factory()
+{
+ delete s_instance;
+ s_instance = 0;
+}
+
+QObject* %{APPNAME}Factory::createObject( QObject* parent, const char* name, const char*, const QStringList & )
+{
+ return new Plugin%{APPNAME}( parent, name );
+}
+
+KInstance *%{APPNAME}Factory::instance()
+{
+ if ( !s_instance )
+ s_instance = new KInstance( "%{APPNAMELC}" );
+ return s_instance;
+}
+
+extern "C"
+{
+ void* init_lib%{APPNAMELC}plugin()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}Factory;
+ }
+}
+
+KInstance* %{APPNAME}Factory::s_instance = 0L;
+
+#include "plugin_%{APPNAMELC}.moc"
diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.h b/languages/cpp/app_templates/kpartplugin/plugin_app.h
new file mode 100644
index 00000000..e70ad1c1
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/plugin_app.h
@@ -0,0 +1,34 @@
+
+#ifndef _PLUGIN_%{APPNAMEUC}_H_
+#define _PLUGIN_%{APPNAMEUC}_H_
+
+#include <kparts/plugin.h>
+#include <kparts/factory.h>
+
+class Plugin%{APPNAME} : public KParts::Plugin
+{
+ Q_OBJECT
+public:
+ Plugin%{APPNAME}( QObject* parent = 0, const char* name = 0 );
+ virtual ~Plugin%{APPNAME}();
+
+public slots:
+ void slotAction();
+};
+
+class %{APPNAME}Factory : public KLibFactory
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Factory();
+ virtual ~%{APPNAME}Factory();
+
+ virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() );
+
+ static KInstance* instance();
+
+private:
+ static KInstance* s_instance;
+};
+
+#endif // _PLUGIN_%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.rc b/languages/cpp/app_templates/kpartplugin/plugin_app.rc
new file mode 100644
index 00000000..a38ee14e
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/plugin_app.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="%{APPNAMELC}" library="lib%{APPNAMELC}plugin" version="1">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="plugin_action"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="extraToolBar">
+ <Action name="plugin_action"/>
+</ToolBar>
+</kpartplugin>
diff --git a/languages/cpp/app_templates/kpartplugin/src-Makefile.am b/languages/cpp/app_templates/kpartplugin/src-Makefile.am
new file mode 100644
index 00000000..52e29c09
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/src-Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la
+
+# This is all standard. Remove the LIB_KHTML reference if you are not
+# using the KHTML Part
+lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp
+lib%{APPNAMELC}plugin_la_LIBADD = $(LIB_KPARTS) $(LIB_KHTML)
+lib%{APPNAMELC}plugin_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_PLUGIN) $(all_libraries)
+
+# Install the .rc file in the Part's directory (in this case, the part
+# is KHTMLPart)
+pluginsdir = $(kde_datadir)/khtml/kpartplugins
+plugins_DATA = plugin_%{APPNAMELC}.rc
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kpartplugin/subdirs b/languages/cpp/app_templates/kpartplugin/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kpartplugin/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kscons_kmdi/INSTALL b/languages/cpp/app_templates/kscons_kmdi/INSTALL
new file mode 100644
index 00000000..edeed594
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/INSTALL
@@ -0,0 +1,83 @@
+REQUIREMENTS
+------------
+
+* KDE headers & libraries for kdelibs
+* A Python interpreter for the compilation
+
+scons v0.96.1 or newer is recommended, but it's not required since a
+minimum scons distribution is included in the package.
+
+BUILDING AND INSTALLING
+-----------------------
+
+For configuring, compiling and installing the application and
+if you do have Scons 0.96.1 or newer installed, just run:
+
+$ scons
+$ scons install (as root user)
+
+In case you don't have Scons installed, you can use
+the accompanying minimum scons by running:
+
+$ tar xjvf admin/scons-mini.tar.bz2
+$ ./scons
+$ ./scons install
+
+ADVANCED BUILD FEATURES & DEINSTALLING
+--------------------------------------
+
+In case you want to execute many compilation jobs in parallel (because you
+want to make use of a SMP system or a compile cluster, for instance),
+you can use ('N' is the number of jobs which should be run in parallel):
+
+$ scons -jN
+
+A debug build of the program can be created by running:
+
+$ scons configure debug=1
+$ scons
+
+Finally, the software can be removed from your system by running
+
+$ scons -c install
+
+CONFIGURATION NOTES
+-------------------
+
+The installation scripts are relying on the kde-config program.
+The programs kde-config, qmake, uic and moc must be accesssible
+through your PATH.
+
+Qt and kde may not be installed as expected (in QTDIR and KDEDIR)
+So until kde-config is able to give that information, you may
+have to give those paths. You may also want to tune the build.
+
+In these cases, you must first run "scons configure" with some options
+before running "scons" and "scons install"
+
+Here are some examples :
+On Fedora/Redhat
+$ scons configure kdeincludes=/usr/include/kde/
+On Debian
+$ scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/
+To install in some particular location with additional include paths
+$ scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include
+For AMD64 and platforms where folders are like /usr/lib64
+$ scons configure libsuffix=64
+
+For more options, run
+scons --help
+
+The build system is based on bksys, a build system that replaces
+autoconf, automake and make in a row. Feel free to report your opinion
+about it to the bksys authors.
+
+PACKAGE CREATION
+----------------
+
+RPM packagers can use the DESTDIR environment variable
+$ DESTDIR=/tmp/build-rpm/ scons install
+
+To use checkinstall, pass the following option
+$ checkinstall --fstrans=no --nodoc scons install
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/Makefile.am b/languages/cpp/app_templates/kscons_kmdi/Makefile.am
new file mode 100644
index 00000000..aa6d9b53
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = app.kcfg app.kdevelop appkmdi.cpp appkmdi.h appkmdiView.cpp \
+appkmdiView.h INSTALL kmdikonsole.cpp kmdikonsole.h main.cpp \
+messages.sh prefs.ui QUICKSTART README SConscript-doc SConscript-src \
+SConstruct settings.kcfgc tips VERSION \
+app_part.cpp app_part.h app_part.rc app_shell.rc
+
+templateName= kscons_kmdi
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kscons_kmdi/QUICKSTART b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART
new file mode 100644
index 00000000..ceaf1bda
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/QUICKSTART
@@ -0,0 +1,164 @@
+------------------------------------------
+SUMMARY :
+
+scons
+scons install
+
+
+The online documentation of bksys can be found at:
+http://freehackers.org/~tnagy/bksys_manual.html
+
+ ... and now for the quickstart:
+
+CONFIGURING AND COMPILING THE PROJECT(S)
+SCONS TIPS
+MOC PROCESSING
+SCONS MINIMUM DISTRIBUTION
+MORE TIPS
+
+------------------------------------------
+CONFIGURING AND COMPILING THE PROJECT(S)
+
+The program scons is usually launched as "scons"
+When it is not intalled globally, one can run
+"./scons" instead of "scons" (ie : to use the local scons
+that comes with bksys - see below SCONS MINIMUM DISTRIBUTION
+if you do not have scons already)
+
+To compile the project, you will then only need to launch
+scons on the top-level directory, the scripts find and
+cache the environment detected *automatically* :
+-> scons
+
+To clean the project -> scons -c
+
+To install the project -> scons install
+To install as root user -> su -c 'scons install'
+To uninstall the project -> scons -c install
+To uninstall (as root) -> su -c 'scons -c install'
+To consult the help -> scons -h
+
+To (re)configure the project and give particular arguments, use :
+ -> scons configure debug=1
+
+The variables are saved automatically after the first run
+in files named *.cache.py (look at kde.cache.py, ..)
+
+------------------------------------------
+SCONS TIPS
+
+In a subdirectory, it is necessary to launch scons with the -u flag :
+scons -u
+
+This is annoying and you probably want to add this to your .bashrc
+export SCONSFLAGS=-u
+and forget about it :)
+
+To make .deb or .rpm packages of your program, use :
+checkinstall --fstrans=no --nodoc scons install
+(if you have checkinstall on your system of course)
+
+To make scons run (much) faster, consult ./addons/README in bksys
+
+------------------------------------------
+MOC PROCESSING
+
+In qt programs, when a header 'foo.h' contains a class that has
+signals and slots, then 'foo.h' must contain the macro Q_OBJECT
+in order to compile. foo_moc.cpp is usually generated, and is
+used to produce foo_moc.o which is linked with the
+program or the library.
+
+In kde programs, 'foo.moc' is generated instead of foo_moc.cpp,
+and it must be included at the very end of foo.cpp
+(add #include "foo.moc" : this increases the speed of
+compilation a *lot* and makes less object files.
+
+Both modes are provided though, see test6-mocfiesta/
+
+------------------------------------------
+MINIMUM SCONS DISTRIBUTION
+
+A minimum scons distribution is included in the archive
+for convenience to those who do not have scons packages
+for their operating system or their linux
+distribution. For a full and more recent version of scons,
+please consult http://www.scons.org
+
+Including this scons distribution to your archive will add
+about 63kb (compressed) , while including the necessary
+kdescripts (admin/ directory, configure, autom4 cache stuff,
+Makefile.in) can add easily 500kb (compressed).
+
+To compile with the scons distribution :
+* unpack it with :
+ tar xjvf admin/scons-mini.tar.bz2
+* compile the program with :
+ ./scons (instead of just 'scons')
+* install the program with :
+ ./scons install (instead of just 'scons install')
+
+More options :
+* clean the object files with :
+ ./scons -c
+* uninstall the program with with :
+ ./scons -c install
+* create a package :
+ ./scons dist
+
+------------------------------------------
+MORE TIPS
+
+** static libraries **
+With Makefile.am, one had to make static libraries all the time
+because it did not allow having source code in other directories.
+This is not the case anymore with scons, so you can specify
+sources in other directories relative to the sconscript file, ie:
+ test1_sources = ['mainfiles/main.cpp', 'otherfile/program.cpp']
+ myenv.Program( target = "test1", source = test1_sources )
+To encourage you to switch to the new scheme, the static library
+helper has been omitted (look at the end of kde.py if you need one)
+
+** libtool **
+The LaFile build tool is a cheat that allows klibloader to load
+.so files without complaints. If you need real libtool support
+you can have a look to the libtool directory : it can work but
+remember that libtool is broken on many systems (invalid flags
+among others), so when you can work without libtool
+(small projects especially), just do it.
+
+** moc processing **
+As stated above, you should always add #include "foo.moc"
+for your qt classes (Q_OBJECT) to save precious compilation time.
+
+** using a cache **
+It is a good idea to enable the cache feature in SConstruct,
+especially if you are doing experiments (it saves your computer
+from recompiling the same files over and over again ..).
+
+** threading **
+myenv.AppendUnique( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
+
+** final notes ***
+A medium-sized project containing several targets, libraries and data
+files can be converted very quickly.
+Also, remember that SConscript files are actually python scripts ..
+you can use whatever python feature you want in them, ie: "for" loops,
+this is how the kde helpers work (KDEprogram, KDEshlib ..).
+
+If you are stuck, you can also have a look at more complicated
+bksys-based projects like kdissert or kshaderdesigner
+
+The scons man page and the wiki can be very useful, do not forget to
+consult them when you encounter an issue
+
+------------------------------------------
+
+I hope you will enjoy this alternative to the autotools
+scripts for kde programming, at least as much as I do :
+http://freehackers.org/~tnagy/kdissert/index.html
+
+Happy kde hacking,
+
+Thomas Nagy, 2004, 2005 <tnagyemail-mail@yahoo^fr>
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/README b/languages/cpp/app_templates/kscons_kmdi/README
new file mode 100644
index 00000000..8085c7e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/README
@@ -0,0 +1,111 @@
+-----------------------------------------------
+Kde scons template quickstart
+Author: Thomas Nagy
+Date: 2005-04-04
+-----------------------------------------------
+
+This README file explains basic concepts necessary
+for starting with this application template.
+
+
+** Building and installing **
+
+* To configure the application run "scons configure"
+ In some rare cases you may need to add flags:
+ scons configure qtincludes=/usr/include/qt3/include kdeincludes=/usr/lib/kde3/include
+
+* After building, launch the application and test the dcop
+ interface by using the command (search a bit) :
+ dcop
+ dcop appname-...
+ dcop appname-... instancenumber
+ dcop appname-... instancenumber switch_colors
+ dcop appname switch_colors
+ Or launch kdcop and search in the menus for your program
+ name and double-click on 'switch_colors()'
+
+* The usual targets call the following scons commands :
+ make -> scons
+ make clean -> scons -c
+ make install -> scons install
+ make uninstall -> scons -c install
+ make dist -> scons dist
+
+* To build apps, use KDEprogram, KDEshlib, etc.
+ these functions are documented at the bottom of kde.py
+ More information can be found in the QUICKSTART
+
+* The scons scripts for building kde applications originate
+ from the 'bksys' distribution. It contains several other examples
+ that detail the kpart building and the dcop interface
+ processing :
+ http://www.kde-apps.org/content/show.php?content=19243
+
+* Extending the scons scripts for building the application :
+ The scons scripts are actually python scripts, so all the
+ usual tricks apply : 'for' and 'while' loops, 'if', 'else' ..
+ consult :
+ http://www.python.org for more information about python
+ http://www.scons.org for more informationabout scons
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+scons configure prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For that, you will need to write two simple configuration files
+in the src directory : <myproject>.kcfg and a <settings>.kcfgc
+The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0)
+into #MIN_CONFIG(3.2.0)
+
+Take an example on the many apps found in the kdegames source package and consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+refer to the file po/SConscript and po/messages.sh
+
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-doc b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc
new file mode 100644
index 00000000..6769a359
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-doc
@@ -0,0 +1,92 @@
+#! /usr/bin/env python
+## This script demonstrates to build and install
+## the documentation of a kde program with scons
+##
+## Thomas Nagy, 2005
+
+## This file can be reused freely for any project (see COPYING)
+
+## First load the environment set in the top-level SConstruct file
+Import( 'env' )
+myenv=env.Copy()
+
+## The following looks complicated but it is not
+## We first define a function to install all files as documentation
+## The documentation is of course lying in subfolders from here
+## * normal files are installed under KDEDOC/destination
+## * meinproc files are not installed, but processed into a single
+## index.cache.bz2 which is installed afterwards
+
+## This is far more maintainable to have *one* file than
+## having lots of almost empty SConscript in several folders
+
+###################################################################
+# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS
+###################################################################
+
+import os
+import sys
+import glob
+import SCons.Util
+
+## Define this to 1 if you are writing documentation else to 0 :)
+i_am_a_documentation_writer = 0
+
+## This function uses env imported above
+def processfolder(folder, lang, destination=""):
+ # folder is the folder to process
+ # lang is the language
+ # destination is the subdirectory in KDEDOC
+
+ docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :)
+
+ # warn about errors
+ #if len(lang) != 2:
+ # print "error, lang must be a two-letter string, like 'en'"
+
+ # when the destination is not given, use the folder
+ if len(destination) == 0:
+ destination=folder
+
+ docbook_list = []
+ for file in docfiles:
+
+ # do not process folders
+ if not os.path.isfile(file):
+ continue
+ # do not process the cache file
+ if file == 'index.cache.bz2':
+ continue
+ # ignore invalid files (TODO??)
+ if len( SCons.Util.splitext( file ) ) <= 1 :
+ continue
+
+ ext = SCons.Util.splitext( file )[1]
+
+ # docbook files are processed by meinproc
+ if ext == '.docbook':
+ docbook_list.append( file )
+ continue
+
+ myenv.KDEinstall('KDEDOC', lang+'/'+destination, file)
+
+ # Now process the index.docbook files ..
+ if len(docbook_list) == 0:
+ return
+ if not os.path.isfile( folder+'/index.docbook' ):
+ print "Error, index.docbook was not found in "+folder+'/index.docbook'
+ return
+ if i_am_a_documentation_writer:
+ for file in docbook_list:
+ myenv.Depends( folder+'index.cache.bz2', file )
+ myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' )
+ myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' )
+
+###################################################################
+# TELL WHICH FOLDERS TO PROCESS
+###################################################################
+
+## Use processfolder for each documentation directory
+processfolder('en/', 'en', '%{APPNAMELC}')
+processfolder('fr/', 'fr', '%{APPNAMELC}')
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConscript-src b/languages/cpp/app_templates/kscons_kmdi/SConscript-src
new file mode 100644
index 00000000..746cdf98
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConscript-src
@@ -0,0 +1,60 @@
+#! /usr/bin/env python
+## This script is a quick test to demonstrate (and test)
+## the bksys moc handling '#include "file.moc"' can be added .. or not
+##
+## Thomas Nagy, 2005
+## This file can be reused freely for any project (see COPYING)
+
+Import('env')
+myenv=env.Copy()
+
+## First build : the shell
+## Each tab in it will hold an instance of the part ..
+
+%{APPNAMELC}_sources="""
+main.cpp
+%{APPNAMELC}kmdi.cpp
+%{APPNAMELC}kmdiView.cpp
+kmdikonsole.cpp
+settings.kcfgc
+prefs.ui
+"""
+# Now that we have our list of sources we can build the program
+myenv.KDEprogram( '%{APPNAMELC}', %{APPNAMELC}_sources ) # main program
+myenv.KDEaddpaths_includes( './ ../' ) # additional paths
+myenv.KDEaddlibs( 'qt-mt kdecore kio kparts kmdi' ) # additional libraries
+
+## Next, the kpart library
+## using KDEshlib, the .so and .la are installed automatically when needed
+
+myenv2=env.Copy()
+%{APPNAMELC}part_sources = '%{APPNAMELC}_part.cpp'
+myenv2.KDEshlib( 'lib%{APPNAMELC}part', %{APPNAMELC}part_sources)
+myenv2.KDEaddpaths_includes( './ #/' ) # the '#' means the top-level directory
+myenv2.KDEaddlibs( 'qt-mt kio kdecore kdeprint kparts' )
+# myenv2.KDEaddflags_link( '-DQT_THREAD_SUPPORT' )
+
+#############################
+## Data files to install
+
+## NOTE: KDEinstall( resource_type, subdir, list of files )
+
+## the .kcfg file
+myenv.KDEinstall( 'KDEKCFG', '', '%{APPNAMELC}.kcfg' )
+
+## the program .desktop file
+myenv.KDEinstall( 'KDEMENU', '/Utilities', '%{APPNAMELC}.desktop' )
+
+## the rc file - named *_shell.rc instead of *ui.rc for kpart apps
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', '%{APPNAMELC}_shell.rc' )
+
+## this servicetype desktop file goes in KDEXDG whether the other one goes in KDEMENU
+myenv.KDEinstall( 'KDEXDG', '', '%{APPNAMELC}_part.desktop' )
+
+## the kpart resource file
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}part', '%{APPNAMELC}_part.rc' )
+
+## Installing icons is easy (hi-16-app-%{APPNAMELC}.png, hi-22-app-%{APPNAMELC}.png)
+#myenv.KDEicon()
+
+## do not forget that this is a python script so even loops are allowed... :)
diff --git a/languages/cpp/app_templates/kscons_kmdi/SConstruct b/languages/cpp/app_templates/kscons_kmdi/SConstruct
new file mode 100644
index 00000000..b82de4e1
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/SConstruct
@@ -0,0 +1,112 @@
+#! /usr/bin/env python
+
+"""
+help -> scons -h
+compile -> scons
+clean -> scons -c
+install -> scons install
+uninstall -> scons -c install
+configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local
+
+Run from a subdirectory -> scons -u
+The variables are saved automatically after the first run (look at cache/kde.cache.py, ..)
+"""
+
+###################################################################
+# LOAD THE ENVIRONMENT AND SET UP THE TOOLS
+###################################################################
+
+## Load the builders in config
+env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./', './admin'])
+#env = Environment( tools=['default', 'generic', 'kde', 'othertool'], toolpath=['./', './admin'])
+
+env.KDEuse("environ rpath")
+#env.KDEuse("environ rpath lang_qt thread nohelp")
+
+###################################################################
+# SCRIPTS FOR BUILDING THE TARGETS
+###################################################################
+
+dirs="""
+src
+doc
+"""
+env.subdirs(dirs)
+
+## Process the translations in the po/ directory
+env.KDElang('po/', '%{APPNAMELC}')
+
+###################################################################
+# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean'
+###################################################################
+
+### To make a tarball of your masterpiece, use 'scons dist'
+if 'dist' in COMMAND_LINE_TARGETS:
+
+ ## The target scons dist requires the python module shutil which is in 2.3
+ env.EnsurePythonVersion(2, 3)
+
+ import os
+ APPNAME = 'bksys'
+ VERSION = os.popen("cat VERSION").read().rstrip()
+ FOLDER = APPNAME+'-'+VERSION
+ ARCHIVE = FOLDER+'.tar.bz2'
+
+ ## If your app name and version number are defined in 'version.h', use this instead:
+ ## (contributed by Dennis Schridde devurandom@gmx@net)
+ #import re
+ #INFO = dict( re.findall( '(?m)^#define\s+(\w+)\s+(.*)(?<=\S)', open(r"version.h","rb").read() ) )
+ #APPNAME = INFO['APPNAME']
+ #VERSION = INFO['VERSION']
+
+ import shutil
+ import glob
+
+ ## check if the temporary directory already exists
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+ if os.path.isfile(ARCHIVE):
+ os.remove(ARCHIVE)
+
+ ## create a temporary directory
+ startdir = os.getcwd()
+ shutil.copytree(startdir, FOLDER)
+
+ ## remove our object files first
+ os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f")
+ #os.popen("pushd %s && scons -c " % FOLDER) # TODO
+
+ ## CVS cleanup
+ os.popen("find "+FOLDER+" -name \"CVS\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".cvsignore\" | xargs rm -rf")
+
+ ## Subversion cleanup
+ os.popen("find %s -name .svn -type d | xargs rm -rf" % FOLDER)
+
+ ## GNU Arch cleanup
+ os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".arch-i*\" | xargs rm -rf")
+
+ ## Create the tarball (coloured output)
+ print "\033[92m"+"Writing archive "+ARCHIVE+"\033[0m"
+ os.popen("tar cjf "+ARCHIVE+" "+FOLDER)
+
+ ## Remove the temporary directory
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+
+ env.Default(None)
+ env.Exit(0)
+
+### Emulate "make distclean"
+if 'distclean' in COMMAND_LINE_TARGETS:
+ ## Remove the cache directory
+ import os, shutil
+ if os.path.isdir(env['CACHEDIR']):
+ shutil.rmtree(env['CACHEDIR'])
+ os.popen("find . -name \"*.pyc\" | xargs rm -rf")
+
+ env.Default(None)
+ env.Exit(0)
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/VERSION b/languages/cpp/app_templates/kscons_kmdi/VERSION
new file mode 100644
index 00000000..2e293c30
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/VERSION
@@ -0,0 +1 @@
+%{VERSION}
diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kcfg b/languages/cpp/app_templates/kscons_kmdi/app.kcfg
new file mode 100644
index 00000000..f2c46b64
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app.kcfg
@@ -0,0 +1,12 @@
+<?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" >
+ <kcfgfile name="%{APPNAMELC}rc"/>
+ <group name="Preferences">
+ <entry name="showCloseTabsButton" type="Bool">
+ <default>true</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app.kdevelop b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop
new file mode 100644
index 00000000..e6a14fff
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app.kdevelop
@@ -0,0 +1,169 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.cpp b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp
new file mode 100644
index 00000000..71155138
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp
@@ -0,0 +1,159 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}_part.h"
+
+#include <kparts/genericfactory.h>
+#include <kinstance.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kfiledialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qmultilineedit.h>
+
+typedef KParts::GenericFactory<%{APPNAMELC}Part> %{APPNAMELC}PartFactory;
+K_EXPORT_COMPONENT_FACTORY( lib%{APPNAMELC}part, %{APPNAMELC}PartFactory );
+
+%{APPNAMELC}Part::%{APPNAMELC}Part( QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList & /*args*/)
+ : KParts::ReadWritePart(parent)
+{
+ // we need an instance
+ setInstance( %{APPNAMELC}PartFactory::instance() );
+
+ // this should be your custom internal widget
+ m_widget = new QMultiLineEdit( parentWidget, widgetName );
+
+ // notify the part that this is our internal widget
+ setWidget(m_widget);
+
+ // create our actions
+ KStdAction::open(this, SLOT(fileOpen()), actionCollection());
+ KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ KStdAction::save(this, SLOT(save()), actionCollection());
+
+ // set our XML-UI resource file
+ setXMLFile("%{APPNAMELC}_part.rc");
+
+ // we are read-write by default
+ setReadWrite(true);
+
+ // we are not modified since we haven't done anything yet
+ setModified(false);
+}
+
+%{APPNAMELC}Part::~%{APPNAMELC}Part()
+{
+}
+
+KAboutData *%{APPNAMELC}Part::createAboutData()
+{
+ // The non-i18n name here must be the same as the directory in
+ // which the part's rc file is installed
+ KAboutData *aboutData = new KAboutData("%{APPNAMELC}part", I18N_NOOP("%{APPNAMELC}Part"), "0.0.1");
+ aboutData->addAuthor("%{AUTHOR}", 0, "%{EMAIL}");
+ return aboutData;
+}
+
+void %{APPNAMELC}Part::setReadWrite(bool rw)
+{
+ // notify your internal widget of the read-write state
+ m_widget->setReadOnly(!rw);
+ if (rw)
+ connect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ else
+ {
+ disconnect(m_widget, SIGNAL(textChanged()),
+ this, SLOT(setModified()));
+ }
+
+ ReadWritePart::setReadWrite(rw);
+}
+
+void %{APPNAMELC}Part::setModified(bool modified)
+{
+ // get a handle on our Save action and make sure it is valid
+ KAction *save = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if (!save)
+ return;
+
+ // if so, we either enable or disable it based on the current
+ // state
+ if (modified)
+ save->setEnabled(true);
+ else
+ save->setEnabled(false);
+
+ // in any event, we want our parent to do it's thing
+ ReadWritePart::setModified(modified);
+}
+
+bool %{APPNAMELC}Part::openFile()
+{
+ // m_file is always local so we can use QFile on it
+ QFile file(m_file);
+ if (file.open(IO_ReadOnly) == false)
+ return false;
+
+ // our example widget is text-based, so we use QTextStream instead
+ // of a raw QDataStream
+ QTextStream stream(&file);
+ QString str;
+ while (!stream.eof())
+ str += stream.readLine() + "\n";
+
+ file.close();
+
+ // now that we have the entire file, display it
+ m_widget->setText(str);
+
+ // just for fun, set the status bar
+ emit setStatusBarText( m_url.prettyURL() );
+
+ return true;
+}
+
+bool %{APPNAMELC}Part::saveFile()
+{
+ // if we aren't read-write, return immediately
+ if (isReadWrite() == false)
+ return false;
+
+ // m_file is always local, so we use QFile
+ QFile file(m_file);
+ if (file.open(IO_WriteOnly) == false)
+ return false;
+
+ // use QTextStream to dump the text to the file
+ QTextStream stream(&file);
+ stream << m_widget->text();
+
+ file.close();
+
+ return true;
+}
+
+void %{APPNAMELC}Part::fileOpen()
+{
+ // this slot is called whenever the File->Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ QString file_name = KFileDialog::getOpenFileName();
+
+ if (file_name.isEmpty() == false)
+ openURL(file_name);
+}
+
+void %{APPNAMELC}Part::fileSaveAs()
+{
+ // this slot is called whenever the File->Save As menu is selected,
+ QString file_name = KFileDialog::getSaveFileName();
+ if (file_name.isEmpty() == false)
+ saveAs(file_name);
+}
+
+#include "%{APPNAMELC}_part.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.h b/languages/cpp/app_templates/kscons_kmdi/app_part.h
new file mode 100644
index 00000000..e1dd002b
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.h
@@ -0,0 +1,74 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}PART_H_
+#define _%{APPNAMEUC}PART_H_
+
+#include <kparts/part.h>
+#include <kparts/factory.h>
+
+class QMultiLineEdit;
+class QWidget;
+class QPainter;
+class KURL;
+class KAboutData;
+
+/**
+ * This is a "Part". It that does all the real work in a KPart
+ * application.
+ *
+ * @short Main Part
+ * @author %{AUTHOR}
+ * @version %{VERSION}
+ */
+class %{APPNAMELC}Part : public KParts::ReadWritePart
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAMELC}Part(QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name, const QStringList & /*args*/);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAMELC}Part();
+
+ /**
+ * This is a virtual function inherited from KParts::ReadWritePart.
+ * A shell will use this to inform this Part if it should act
+ * read-only
+ */
+ virtual void setReadWrite(bool rw);
+
+ /**
+ * Reimplemented to disable and enable Save action
+ */
+ virtual void setModified(bool modified);
+
+ /**
+ * About data for the part
+ */
+ static KAboutData *createAboutData();
+
+protected:
+ /**
+ * This must be implemented by each part
+ */
+ virtual bool openFile();
+
+ /**
+ * This must be implemented by each read-write part
+ */
+ virtual bool saveFile();
+
+protected slots:
+ void fileOpen();
+ void fileSaveAs();
+
+private:
+ QMultiLineEdit *m_widget;
+};
+
+#endif // _%{APPNAMEUC}PART_H_
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.rc b/languages/cpp/app_templates/kscons_kmdi/app_part.rc
new file mode 100644
index 00000000..cec8ec5c
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_part.rc
@@ -0,0 +1,17 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_part" version="1">
+<MenuBar>
+ <Menu name="file">
+ <Action name="file_open"/>
+ <Separator/>
+ <Action name="file_save"/>
+ <Action name="file_save_as"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="file_open"/>
+ <Action name="file_save"/>
+ <Action name="file_print"/>
+ <Separator/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kscons_kmdi/app_shell.rc b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc
new file mode 100644
index 00000000..c8b2bb98
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/app_shell.rc
@@ -0,0 +1,33 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}_shell" version="1">
+<MenuBar>
+ <Menu noMerge="1" name="file"><text>&amp;File</text>
+ <Action name="file_new"/>
+ <Merge/>
+ <Separator/>
+ <Action name="file_close"/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+ <Menu name="view" noMerge="1"><text>&amp;View</text>
+ </Menu>
+ <Menu noMerge="1" name="settings"><text>&amp;Settings</text>
+ <Action name="options_show_toolbar"/>
+ <Action name="options_show_statusbar"/>
+ <Merge name="show_merge"/>
+ <Separator/>
+ <Action name="options_configure_keybinding"/>
+ <Action name="options_configure_toolbars"/>
+ <Action name="options_configure"/>
+ <Merge name="configure_merge"/>
+ <Separator/>
+ <Merge/>
+ </Menu>
+</MenuBar>
+<ToolBar noMerge="1" name="mainToolBar"><text>Main Toolbar</text>
+ <Action name="file_new"/>
+ <Action name="file_close"/>
+ <Merge/>
+ <Action name="help"/>
+</ToolBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp
new file mode 100644
index 00000000..be5d8862
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.cpp
@@ -0,0 +1,394 @@
+%{CPP_TEMPLATE}
+
+#include <qdragobject.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qdragobject.h>
+#include <qstatusbar.h>
+#include <qtoolbutton.h>
+
+#include <kdebug.h>
+#include <kglobal.h>
+#include <ktip.h>
+#include <kparts/part.h>
+#include <kparts/partmanager.h>
+
+#include <kio/netaccess.h>
+#include <kurl.h>
+#include <kurldrag.h>
+#include <kurlrequesterdlg.h>
+#include <kconfig.h>
+#include <kconfigdialog.h>
+#include <klibloader.h>
+#include <kaboutdata.h>
+#include <kfiledialog.h>
+#include <kactionclasses.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include <kkeydialog.h>
+#include <kmessagebox.h>
+#include <ktabwidget.h>
+#include <kedittoolbar.h>
+#include <kdeversion.h>
+#include <kstdaccel.h>
+#include <kaction.h>
+#include <kstdaction.h>
+
+#include "settings.h"
+#include "prefs.h"
+#include "%{APPNAMELC}kmdiView.h"
+#include "kmdikonsole.h"
+#include "%{APPNAMELC}kmdi.h"
+
+%{APPNAMELC}kmdi::%{APPNAMELC}kmdi(KMdi::MdiMode mode)
+ : KMdiMainFrm( 0, "%{APPNAMELC}", mode )
+{
+ resize( 800, 600 ); // start at 800x600 the first time
+
+ setManagedDockPositionModeEnabled(true);
+ setStandardMDIMenuEnabled(false);
+
+ m_manager = new KParts::PartManager(this);
+ connect(m_manager, SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(createGUI(KParts::Part*)) );
+
+#if KDE_IS_VERSION(3, 3, 0)
+ setToolviewStyle( KMdi::TextAndIcon );
+ tabWidget()->setHoverCloseButton( false );
+#endif
+
+ setMenuForSDIModeSysButtons( menuBar() );
+ setManagedDockPositionModeEnabled(true);
+
+ m_console = NULL;
+
+ // accept dnd
+ setAcceptDrops(true);
+
+ // then, setup our actions
+ setupActions();
+
+ //createShellGUI( true );
+
+ // and a status bar
+ statusBar()->show();
+
+ connect( this, SIGNAL( viewActivated( KMdiChildView * ) ), this, SLOT( currentChanged( KMdiChildView * ) ) );
+
+ m_console = new kmdikonsole(this, "konsole");
+ m_console->setIcon( SmallIcon("konsole") );
+ m_console->setCaption( i18n("Terminal") );
+ addToolWindow( m_console, KDockWidget::DockBottom, getMainDockWidget(), 20 );
+
+
+#if KDE_IS_VERSION(3, 3, 0)
+ if (Settings::showCloseTabsButton())
+ {
+ QToolButton *but = new QToolButton(tabWidget());
+ but->setIconSet(SmallIcon("tab_remove"));
+ but->adjustSize();
+ but->hide();
+ connect(but, SIGNAL(clicked()), actionCollection()->action( "file_close" ), SIGNAL(activated()));
+ tabWidget()->setCornerWidget(but, TopRight);
+ }
+#endif
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+
+ // Read the dock config only if the app was started at least only once - kmdi is tricky
+ KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc");
+ if (cfg->readNumEntry("%{APPNAMELC}_main_dock_settings", 0) == 1) manager()->readConfig(cfg);
+ cfg->writeEntry("%{APPNAMELC}_main_dock_settings", 1);
+ delete cfg;
+
+ showTipOnStart();
+}
+
+%{APPNAMELC}kmdi::~%{APPNAMELC}kmdi()
+{
+ // Write the dock config on exit
+ KConfig *cfg = new KConfig("%{APPNAMELC}_dockposrc");
+ manager()->writeConfig(cfg);
+ delete cfg;
+ delete m_console;
+}
+
+void %{APPNAMELC}kmdi::setupActions()
+{
+ setXMLFile("%{APPNAMELC}_shell.rc");
+
+ KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection());
+
+ KStdAction::tipOfDay( this, SLOT( showTip() ), actionCollection()
+ )->setWhatsThis(i18n("This shows useful tips on the use of this application."));
+
+ KStdAction::close(this, SLOT(slotFileClose()), actionCollection());
+ KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ KAction* action = KStdAction::configureToolbars(this,
+ SLOT(optionsConfigureToolbars()), actionCollection());
+
+ createGUI( NULL );
+}
+
+void %{APPNAMELC}kmdi::showTip()
+{
+ KTipDialog::showTip(this,QString::null,true);
+}
+
+void %{APPNAMELC}kmdi::showTipOnStart()
+{
+ KTipDialog::showTip(this);
+}
+
+void %{APPNAMELC}kmdi::slotFileNew()
+{
+ %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this);
+ m_manager->addPart( view->part() );
+
+ addWindow( view );
+
+ // add the tree view to the widget stack
+ m_views += view;
+
+ currentChanged( view );
+}
+
+void %{APPNAMELC}kmdi::openURL(const KURL & url)
+{
+ // check if the url is not already opened first
+ QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin();
+ QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end();
+ for (; it != end; ++it)
+ {
+ %{APPNAMELC}kmdiView *view = *it;
+ if (view->part()->url() == url)
+ {
+ activateView(view);
+ return;
+ }
+ }
+
+ %{APPNAMELC}kmdiView *view = new %{APPNAMELC}kmdiView(this);
+ m_manager->addPart( view->part() );
+
+ addWindow( view );
+
+ m_views += view;
+
+ view->part()->openURL(url);
+ currentChanged( view );
+}
+
+void %{APPNAMELC}kmdi::currentChanged( KMdiChildView *current )
+{
+ //kdWarning()<<"current view changed"<<endl;
+ if (!current)
+ {
+ m_manager->setActivePart(NULL);
+ //setCaption("()");
+ return;
+ }
+
+ // switch to the corresponding document
+ if ( m_views.contains( (%{APPNAMELC}kmdiView*) current ) )
+ {
+ %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) current;
+ //view->updateCaption();
+ m_manager->setActivePart( view->part() );
+ }
+}
+
+void %{APPNAMELC}kmdi::slotFileClose()
+{
+ requestClose( activeWindow() );
+}
+
+bool %{APPNAMELC}kmdi::requestClose(KMdiChildView* v)
+{
+ // kdWarning()<<"closing view"<<v<<endl;
+ // if (view == NULL)
+ // return;
+
+ if (v == NULL)
+ {
+ if ( m_views.count() == 1)
+ {
+ %{APPNAMELC}kmdiView *view = m_views[0];
+ if (view->part()->queryClose())
+ {
+ m_manager->removePart( view->part() );
+
+ closeWindow( view );
+ m_views.clear();
+ setCaption("kdissert");
+ return true;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ %{APPNAMELC}kmdiView *view = (%{APPNAMELC}kmdiView*) v;
+ if ( m_views.contains( view ) )
+ {
+ m_views.remove( view );
+ if ( view->part()->queryClose() )
+ {
+ m_manager->removePart( view->part() );
+
+ closeWindow( view );
+ return true;
+ }
+ return false;
+ }
+ return true;
+}
+
+void %{APPNAMELC}kmdi::slotFileQuit()
+{
+ close();
+}
+
+void %{APPNAMELC}kmdi::optionsShowToolbar()
+{
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void %{APPNAMELC}kmdi::optionsShowStatusbar()
+{
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void %{APPNAMELC}kmdi::optionsConfigureKeys()
+{
+ //KKeyDialog::configure(actionCollection());
+ KKeyDialog dlg( false, this );
+ QPtrList<KXMLGUIClient> clients = guiFactory()->clients();
+
+ for( QPtrListIterator<KXMLGUIClient> it( clients ); it.current(); ++it )
+ dlg.insert ( (*it)->actionCollection(), (*it)->instance()->aboutData()->programName() );
+
+ dlg.configure();
+
+ for (int i=0; i<m_views.count(); i++)
+ {
+ m_views[i]->part()->reloadXML();
+ }
+}
+
+void %{APPNAMELC}kmdi::optionsConfigureToolbars()
+{
+ //saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}kmdi::newToolbarConfig()
+{
+ // This slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
+ // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
+ //createGUI();
+ //applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}kmdi::optionsPreferences()
+{
+ // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ if (KConfigDialog::showDialog("settings"))
+ return;
+
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow);
+ dialog->addPage(new prefs(), i18n("General"), "package_settings");
+ connect(dialog, SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
+ dialog->show();
+}
+
+void %{APPNAMELC}kmdi::settingsChanged()
+{
+ // propagate the changes to our views
+ /*QValueList<%{APPNAMELC}kmdiView*>::iterator it = m_views.begin();
+ QValueList<%{APPNAMELC}kmdiView*>::iterator end = m_views.end();
+ for (; it != end; ++it)
+ {
+ %{APPNAMELC}kmdiView *view = *it;
+ view->settingsChanged();
+ }*/
+}
+
+void %{APPNAMELC}kmdi::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text, 2000);
+}
+
+void %{APPNAMELC}kmdi::dragEnterEvent(QDragEnterEvent *event)
+{
+ // accept uri drops only
+ event->accept(KURLDrag::canDecode(event));
+}
+
+void %{APPNAMELC}kmdi::dropEvent(QDropEvent *event)
+{
+ KURL::List urls;
+
+ // see if we can decode a URI.. if not, just ignore it
+ if (KURLDrag::decode(event, urls) && !urls.isEmpty())
+ {
+ // okay, we have a URI.. process it
+ const KURL &url = urls.first();
+
+ // load in the file
+ openURL(url);
+ }
+}
+
+bool %{APPNAMELC}kmdi::queryClose()
+{
+ QValueList<%{APPNAMELC}kmdiView*>::iterator it;
+
+ // check if we can close all documents
+ for (it = m_views.begin(); it != m_views.end(); ++it)
+ {
+ // kdWarning()<<"searching for the part"<<endl;
+ %{APPNAMELC}kmdiView *view = *it;
+ if (!view->part()->queryClose())
+ {
+ return false;
+ }
+ }
+
+ // and now close the documents
+ for (it = m_views.begin(); it != m_views.end(); ++it)
+ {
+ // now close all views
+ %{APPNAMELC}kmdiView *view = *it;
+
+ m_manager->removePart( view->part() );
+ closeWindow( view );
+ }
+
+ return true;
+}
+
+#include "%{APPNAMELC}kmdi.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdi.h b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h
new file mode 100644
index 00000000..370a3034
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdi.h
@@ -0,0 +1,82 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}KMDI_H
+#define _%{APPNAMEUC}KMDI_H
+
+#include <qvaluelist.h>
+
+#include <kapplication.h>
+#include <kmdimainfrm.h>
+#include <kurl.h>
+
+class KToggleAction;
+class KRecentFilesAction;
+
+class kmdikonsole;
+class KMdiChildView;
+class QWidgetStack;
+class %{APPNAMELC}kmdiView;
+class TextProperties;
+class MiscProperties;
+
+/**
+ * This class serves as the main window for %{APPNAMELC}kmdi. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ */
+class %{APPNAMELC}kmdi : public KMdiMainFrm
+{
+ Q_OBJECT
+ public:
+ %{APPNAMELC}kmdi( KMdi::MdiMode mode );
+ virtual ~%{APPNAMELC}kmdi();
+ void showTipOnStart();
+
+ public slots:
+ void openURL( const KURL& );
+
+ protected:
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+ virtual bool queryClose();
+
+ private slots:
+ void slotFileNew();
+ void slotFileClose();
+ void slotFileQuit();
+
+ /// this is called when a new file is saved
+ void showTip();
+
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+ void optionsPreferences();
+ void newToolbarConfig();
+
+
+ void changeStatusbar(const QString& text);
+
+ void currentChanged( KMdiChildView *current );
+ bool requestClose(KMdiChildView* view);
+
+ void settingsChanged();
+
+ private:
+ void setupAccel();
+ void setupActions();
+
+ QValueList<%{APPNAMELC}kmdiView*> m_views;
+
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+
+ KParts::PartManager *m_manager;
+
+ kmdikonsole *m_console;
+};
+
+#endif // _%{APPNAMEUC}KMDI_H
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp
new file mode 100644
index 00000000..c4cfbf65
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.cpp
@@ -0,0 +1,63 @@
+%{CPP_TEMPLATE}
+
+#include <qpixmap.h>
+#include <qlayout.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmdichildview.h>
+#include <kdebug.h>
+#include <klibloader.h>
+#include <kmessagebox.h>
+
+#include "%{APPNAMELC}kmdiView.h"
+
+
+ %{APPNAMELC}kmdiView::%{APPNAMELC}kmdiView( QWidget *parentWidget, const char *name )
+: KMdiChildView( parentWidget, name )
+{
+ m_part = NULL;
+
+ // this routine will find and load our Part. it finds the Part by
+ // name which is a bad idea usually.. but it's alright in this
+ // case since our Part is made for this Shell
+ KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part");
+ //KLibFactory *factory = KLibLoader::self()->factory("libkatepart");
+ if (factory)
+ {
+ // now that the Part is loaded, we cast it to a Part to get
+ // our hands on it
+ m_part = static_cast<KParts::ReadWritePart *>(factory->create(
+ this, "katepart", "KParts::ReadWritePart" ));
+
+ if (m_part)
+ {
+ part()->widget()->setFocus();
+ setFocusProxy(part()->widget());
+
+ QBoxLayout* layout = new QHBoxLayout(this, 0, -1, "kdissertviewlayout" );
+ part()->widget()->reparent( this, QPoint(0, 0) );
+ layout->addWidget( part()->widget() );
+
+ // connect( m_part, SIGNAL(stateChanged()), this, SLOT(updateCaption()) );
+ }
+ else
+ {
+ KMessageBox::error(this, i18n("Could not find our part."));
+ }
+ }
+ else
+ {
+ // if we couldn't find our Part, we exit since the Shell by
+ // itself can't do anything useful
+ KMessageBox::error(this, i18n("Could not find our part."));
+ return;
+ }
+}
+
+%{APPNAMELC}kmdiView::~%{APPNAMELC}kmdiView()
+{
+ delete m_part->widget();
+}
+
+#include "%{APPNAMELC}kmdiView.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h
new file mode 100644
index 00000000..66e5203b
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/appkmdiView.h
@@ -0,0 +1,29 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}KMDIVIEW_H
+#define _%{APPNAMEUC}KMDIVIEW_H
+
+#include <kparts/part.h>
+#include <kmdichildview.h>
+#include <kmdichildfrm.h>
+
+/**
+ * This class serves as the %{APPNAMELC}kmdi view.
+ *
+ * @short main view class
+ */
+class %{APPNAMELC}kmdiView : public KMdiChildView
+{
+ Q_OBJECT
+ public:
+ %{APPNAMELC}kmdiView( QWidget *parentWidget=0L, const char *name=0L );
+ virtual ~%{APPNAMELC}kmdiView();
+
+ KParts::ReadWritePart *part() { return m_part; }
+
+ private:
+ KParts::ReadWritePart *m_part;
+};
+
+#endif // _%{APPNAMEUC}KMDIVIEW_H
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp
new file mode 100644
index 00000000..da41685f
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.cpp
@@ -0,0 +1,76 @@
+%{CPP_TEMPLATE}
+
+#include <qfileinfo.h>
+#include <qframe.h>
+
+#include <kparts/part.h>
+#include <kate/document.h>
+#include <kate/view.h>
+#include <klocale.h>
+#include <klibloader.h>
+#include <kurl.h>
+
+#include "kmdikonsole.h"
+
+kmdikonsole::kmdikonsole(QWidget *parent, const char *name) : QVBox(parent, name)
+{
+ m_haskonsole = false;
+ respawn();
+}
+
+kmdikonsole::~kmdikonsole()
+{
+}
+
+void kmdikonsole::respawn()
+{
+ 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_haskonsole=true;
+ connect( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
+
+ m_part->widget()->show();
+ show();
+}
+
+void kmdikonsole::setDirectory(const QString &dirname)
+{
+ if (m_haskonsole)
+ {
+ KURL url(dirname);
+ if (m_part->url() != url)
+ m_part->openURL(url);
+ }
+}
+
+void kmdikonsole::showEvent(QShowEvent *ev)
+{
+ QWidget::showEvent(ev);
+ activate();
+}
+
+void kmdikonsole::activate()
+{
+ if (m_haskonsole)
+ {
+ m_part->widget()->show();
+ setFocusProxy(m_part->widget());
+ m_part->widget()->setFocus();
+ }
+}
+
+void kmdikonsole::slotDestroyed()
+{
+ m_haskonsole=false;
+ respawn();
+}
+
+#include "kmdikonsole.moc"
diff --git a/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h
new file mode 100644
index 00000000..83adb417
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kmdikonsole.h
@@ -0,0 +1,32 @@
+%{H_TEMPLATE}
+
+#ifndef KMDIKONSOLE_H
+#define KMDIKONSOLE_H
+
+#include <qvbox.h>
+
+class kmdikonsole : public QVBox
+{
+ Q_OBJECT
+
+ public:
+ kmdikonsole( QWidget* parent, const char* name=0);
+ ~kmdikonsole();
+
+ public slots:
+ void setDirectory(const QString & dir);
+ void activate();
+
+ private slots:
+ void slotDestroyed();
+ void respawn();
+
+ protected:
+ void showEvent(QShowEvent *ev);
+
+ private:
+ KParts::ReadOnlyPart *m_part;
+ bool m_haskonsole;
+};
+
+#endif // KMDIKONSOLE_H
diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate
new file mode 100644
index 00000000..4f0f8856
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.kdevtemplate
@@ -0,0 +1,271 @@
+# KDE Config File
+[General]
+Name=Scons-based KMDI application
+Name[ca]=Aplicació per a KMDI basada en Scons
+Name[da]=Scons-baseret KMDI-program
+Name[de]=Auf Scons basierende KMDI-Anwendung
+Name[el]=Μια εφαρμογή KMDI βασισμένης στο Scons
+Name[es]=Aplicación KMDI basada en Scons
+Name[et]=KMDI rakendus Sconsi põhjal
+Name[eu]=Scons-en oinarritutako KMDI aplikazioa
+Name[fa]=کاربرد KMDI بر مبنای Scons
+Name[fr]=Application KMDI basée sur Scons
+Name[ga]=Feidhmchlár KMDI bunaithe ar Scons
+Name[gl]=Aplicación KMDI baseada en Scons
+Name[hu]=Scons-alapú KMDI-alkalmazás
+Name[it]=Applicazione KMDI basata su scons
+Name[ja]=Scons ベースの KMDI アプリケーション
+Name[nds]=Op "scons" opbuut KMDI-Programm
+Name[ne]=स्कोन-आधारित KMDI अनुप्रयोग
+Name[nl]=Scons gebaseerde KMDI-toepassing
+Name[pl]=Program KMDI wykorzystujący Scons
+Name[pt]=Aplicação KMDI usando Scons
+Name[pt_BR]=Aplicação KMDI usando Scons
+Name[ru]=Многооконное приложение KDE на базе Scons
+Name[sk]=KMDI aplikácia založená na Scons
+Name[sr]=KMDI програм на основу Scons-а
+Name[sr@Latn]=KMDI program na osnovu Scons-a
+Name[sv]=Scons-baserat KMDI-program
+Name[tr]=Scons tabanlı KMDI uygulaması
+Name[zh_CN]=基于 Scons 的 KMDI 应用程序
+Name[zh_TW]=Scons 為基礎的 KMDI 應用程式
+Category=C++/KDE
+Icon=kscons_kmdi.png
+Comment=Generates a complex KMDI application. Scons scripts are provided for compiling and installing the application.
+Comment[ca]=Genera una complexa aplicació per a KMDI. Els scripts en Scons són proveïts per a compilar i instal·lar l'aplicació.
+Comment[da]=Genererer et komplekst KDE-program. Der sørges for scons-scripter til at kompilere og installere programmet.
+Comment[de]=Erstellt eine aufwändige KMDI-Anwendung. Scons-Skripte zum Kompilieren und Installieren der Anwendung werden zur Verfügung gestellt.
+Comment[el]=Δημιουργεί μια πολύπλοκη εφαρμογή KMDI. Προσφέρονται σενάρια Scons για τη μεταγλώττιση και εγκατάσταση της εφαρμογής.
+Comment[es]=Genera una aplicación KMDI compleja. Se proporcionan guiones en Scons para compilar e instalar la aplicación.
+Comment[et]=Keerulise KMDI rakenduse loomine. Luuakse ka Sconsi skriptid rakenduse kompileerimiseks ja paigaldamiseks.
+Comment[eu]=KMDI aplikazio konplexu bat sortzen du. Aplikazioak konpilatu eta aplikazioa instalatzeko Scons script-ak sortzen ditu.
+Comment[fa]=یک کاربرد پیچیدۀ KMDI تولید می‌کند. دست‌نوشته‌های Scons برای ترجمه و نصب کاربرد فراهم می‌شوند.
+Comment[fr]=Génère une application KMDI évoluée. Des scripts Scons sont fournis pour compiler et installer l'application.
+Comment[gl]=Xera unha aplicación complexa KMDI. Os scripts Scons proporciónanse para compilar e instalar a aplicación.
+Comment[hu]=Létrehoz egy komplex KMDI alkalmazást. Az alkalmazás lefordításához és telepítéséhez Scons-szkriptek állnak rendelkezésre.
+Comment[it]=Genera una applicazione KMDI complessa. Gli script scons sono forniti per compilare e istallare l'applicazione.
+Comment[nds]=Stellt en vigeliensch KMDI-Programm op. Stellt Scons-Skripten för't Kompileren un Installeren vun't Programm praat.
+Comment[ne]=जटिल KMDI अनुप्रयोग उत्पन्न गर्दछ । स्कोन स्क्रिप्टहरू अनुप्रयोग स्थापना र कम्पाइल गर्नका लागि प्रदान गरिन्छ ।
+Comment[nl]=Genereert een complexe KMDI-applicatie. Scons-scripts worden gebruikt voor compilatie en installatie.
+Comment[pl]=Generuje złożony program z powłoką KMDI. Do kompilacji i instalacji wykorzystywany jest skrypt Scons.
+Comment[pt]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação.
+Comment[pt_BR]=Gera uma aplicação complexa com KMDI. Os ficheiros do Scons são fornecidos para compilar e instalar a aplicação.
+Comment[ru]=Создание полноценного многооконного приложения KDE. Для сборки и установки этого приложения будут использованы скрипты Scons.
+Comment[sk]=Vygeneruje komplexnú KMDI aplikáciu. K dispozícii je Scons skriptna kompiláciu a inštaláciu aplikácie.
+Comment[sr]=Прави сложени KMDI програм. Дате су Scons скрипте за превођење и инсталирање програма.
+Comment[sr@Latn]=Pravi složeni KMDI program. Date su Scons skripte za prevođenje i instaliranje programa.
+Comment[sv]=Skapar ett komplext KMDI-program. Scons-skript tillhandahålls för att kompilera och installera programmet.
+Comment[tr]=Karmaşık bir KMDI uygulaması yaratır. Uygulamayı derlemek ve kurmak için scons betikleri sağlanmıştır.
+Comment[zh_CN]=生成一个复杂的 KMDI 应用程序。此时会提供 Scons 脚本以供编译并安装应用程序。
+Comment[zh_TW]=產生一個複雜的 KMDI 應用程式。Scons 文稿是用於編譯與安裝應用程式。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/QUICKSTART
+Archive=kscons_kmdi.tar.gz
+
+[SCONS]
+Type=include
+File=%{kdevelop}/template-common/scons.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{src}/SConscript-doc
+Dest=%{dest}/doc/SConscript
+
+[FILE2]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE4]
+Type=install
+Source=%{src}/SConstruct
+Dest=%{dest}/SConstruct
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE10]
+Type=install
+Source=%{src}/SConscript-src
+Dest=%{dest}/src/SConscript
+
+[FILE11]
+Type=install
+Source=%{src}/appkmdi.cpp
+Dest=%{dest}/src/%{APPNAMELC}kmdi.cpp
+
+[FILE12]
+Type=install
+Source=%{src}/appkmdi.h
+Dest=%{dest}/src/%{APPNAMELC}kmdi.h
+
+[FILE13]
+Type=install
+EscapeXML=true
+Source=%{src}/prefs.ui
+Dest=%{dest}/src/prefs.ui
+
+[FILE14]
+Type=install
+Source=%{src}/appkmdiView.cpp
+Dest=%{dest}/src/%{APPNAMELC}kmdiView.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/appkmdiView.h
+Dest=%{dest}/src/%{APPNAMELC}kmdiView.h
+
+[FILE19]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/app_shell.rc
+Dest=%{dest}/src/%{APPNAMELC}_shell.rc
+
+[FILE21]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[FILE22]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE23]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[FILE25]
+Type=install
+Source=%{src}/tips
+Dest=%{dest}/src/tips
+
+[FILE27]
+Type=install
+Source=%{src}/VERSION
+Dest=%{dest}/VERSION
+
+[FILE28]
+Type=install
+Source=%{src}/INSTALL
+Dest=%{dest}/INSTALL
+
+[FILE29]
+Type=install
+Source=%{src}/QUICKSTART
+Dest=%{dest}/QUICKSTART
+
+[FILE30]
+Type=install
+Source=%{src}/messages.sh
+Dest=%{dest}/po/messages.sh
+
+[FILE31]
+Type=install
+Source=%{src}/kmdikonsole.cpp
+Dest=%{dest}/src/kmdikonsole.cpp
+
+[FILE32]
+Type=install
+Source=%{src}/kmdikonsole.h
+Dest=%{dest}/src/kmdikonsole.h
+
+[FILE34]
+Type=install
+Source=%{src}/app_part.cpp
+Dest=%{dest}/src/%{APPNAMELC}_part.cpp
+
+[FILE35]
+Type=install
+Source=%{src}/app_part.h
+Dest=%{dest}/src/%{APPNAMELC}_part.h
+
+[FILE36]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE37]
+Type=install
+Source=%{kdevelop}/template-common/kde-part.desktop
+Dest=%{dest}/src/%{APPNAMELC}_part.desktop
+
+[FILE38]
+Type=install
+Source=%{src}/app_part.rc
+Dest=%{dest}/src/%{APPNAMELC}_part.rc
+
+[MSG]
+Type=message
+Comment=A KDE application with scons scripts was created in %{dest}
+Comment[ca]=Una aplicació per al KDE amb scripts en Scons ha estat creada e n %{dest}
+Comment[da]=Et KDE program med scons-scripter blev oprette i %{dest}
+Comment[de]=Eine KDE-Anwendung mit Scons-Skripten wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE με σενάρια scons δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para KDE con guiones de Scons ha sido creada en %{dest}
+Comment[et]=KDE rakendus Sconsi skriptidega loodi asukohta %{dest}
+Comment[eu]=Scons script-dun KDE aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KDE با دست‌نوشته‌های scons در %{dest} ایجاد شد
+Comment[fr]=Une application KDE comprenant des scripts Scons a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár KDE le scripteanna scons i %{dest}
+Comment[gl]=Creouse unha aplicación KDE con scripts scons en %{dest}
+Comment[hu]=Létrejött egy Scons-szkripteket használó KDE-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE con gli script scons in %{dest}
+Comment[ja]=Scons スクリプトを使った KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-Programm mit scons-Skripten opstellt
+Comment[ne]=स्कोन स्क्रिप्टसँग केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KDE applicatie inclusief Scons-scripts is aangemaakt in %{dest}
+Comment[pl]=Program KDE ze skryptami scons utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[ru]=Приложение KDE со скриптами Scons создано в %{dest}
+Comment[sk]=KDE aplikácia so scons skriptom bola vytvorená v %{dest}
+Comment[sr]=KDE програм са scons скриптама направљен је у %{dest}
+Comment[sr@Latn]=KDE program sa scons skriptama napravljen je u %{dest}
+Comment[sv]=Ett KDE-program med Scons-skript skapades i %{dest}
+Comment[tr]=Scons betikleri olan bir KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了带 scons 脚本的 KDE 应用程序
+Comment[zh_TW]=一個內含 scons 文稿的 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png
new file mode 100644
index 00000000..72a347ee
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/kscons_kmdi.png
Binary files differ
diff --git a/languages/cpp/app_templates/kscons_kmdi/main.cpp b/languages/cpp/app_templates/kscons_kmdi/main.cpp
new file mode 100644
index 00000000..7e43b0e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/main.cpp
@@ -0,0 +1,60 @@
+%{CPP_TEMPLATE}
+
+#include <kurl.h>
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+#include "%{APPNAMELC}kmdi.h"
+
+static const char description[] =
+I18N_NOOP("A simple kmdi app");
+
+static const char version[] = "0.0.1";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}" );
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+
+ // warning, utf-8 char
+ //about.addCredit( "bksys authors", "Thomas Nagy, Julien Antille" );
+
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KApplication app;
+
+ // see if we are starting with session management
+ /*if (app.isRestored())
+ {
+ RESTORE((%{APPNAME});
+ } else */
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ %{APPNAMELC}kmdi *widget = new %{APPNAMELC}kmdi( KMdi::IDEAlMode );
+
+ if (args->count() != 0)
+ {
+ for (int i=0; i < args->count(); i++)
+ {
+ widget->openURL( args->url( i ) );
+ }
+ }
+ widget->show();
+ args->clear();
+ }
+
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/messages.sh b/languages/cpp/app_templates/kscons_kmdi/messages.sh
new file mode 100755
index 00000000..a36f5c93
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/messages.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Inspired by Makefile.common from coolo
+# this script is used to update the .po files
+
+# To update the translations, you will need a specific gettext
+# patched for kde and a lot of patience, tenacity, luck, time ..
+
+
+# I guess one should only update the .po files when all .cpp files
+# are generated (after a make or scons)
+
+# If you have a better way to do this, do not keep that info
+# for yourself and help me to improve this script, thanks
+# (tnagyemail-mail tat yahoo d0tt fr)
+
+SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
+TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
+
+KDEDIR=`kde-config --prefix`
+EXTRACTRC=extractrc
+KDEPOT=`kde-config --prefix`/include/kde.pot
+XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "
+
+## check that kde.pot is available
+if ! test -e $KDEPOT; then
+ echo "$KDEPOT does not exist, there is something wrong with your installation!"
+ XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
+fi
+
+> rc.cpp
+
+## extract the strings
+echo "extracting the strings"
+
+# process the .ui and .rc files
+$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
+$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
+echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp
+
+# process the tips - $SRCDIR is supposed to be where the tips are living
+pushd $TIPSDIR; preparetips >tips.cpp; popd
+
+$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
+
+# remove the intermediate files
+rm -f $TIPSDIR/tips.cpp
+rm -f rc.cpp
+rm -f $SRCDIR/_translatorinfo.cpp
+
+## now merge the .po files ..
+echo "merging the .po files"
+
+for i in `ls *.po`; do
+ msgmerge $i kdissert.pot -o $i || exit 1
+done
+
+## finished
+echo "Done"
+
diff --git a/languages/cpp/app_templates/kscons_kmdi/prefs.ui b/languages/cpp/app_templates/kscons_kmdi/prefs.ui
new file mode 100644
index 00000000..5de638ef
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/prefs.ui
@@ -0,0 +1,30 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>prefs</class>
+<widget class="QWidget">
+<property name="name">
+<cstring>prefs</cstring>
+</property>
+<property name="geometry">
+<rect>
+<x>0</x>
+<y>0</y>
+<width>241</width>
+<height>47</height>
+</rect>
+</property>
+<grid>
+<property name="name">
+<cstring>unnamed</cstring>
+</property>
+<widget class="QCheckBox" row="0" column="0">
+<property name="name">
+<cstring>kcfg_showCloseTabsButton</cstring>
+</property>
+<property name="text">
+<string>Show close buttons on the right of tabs</string>
+</property>
+</widget>
+</grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kscons_kmdi/tips b/languages/cpp/app_templates/kscons_kmdi/tips
new file mode 100644
index 00000000..56f29469
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kmdi/tips
@@ -0,0 +1,6 @@
+<tip category="help">
+<html>
+<p>... that automake was not involved in building this kde application ?</p>
+<p>The kdevelop template &quot;kscons_kxt&quot; was used instead.</p>
+</html>
+</tip>
diff --git a/languages/cpp/app_templates/kscons_kxt/INSTALL b/languages/cpp/app_templates/kscons_kxt/INSTALL
new file mode 100644
index 00000000..edeed594
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/INSTALL
@@ -0,0 +1,83 @@
+REQUIREMENTS
+------------
+
+* KDE headers & libraries for kdelibs
+* A Python interpreter for the compilation
+
+scons v0.96.1 or newer is recommended, but it's not required since a
+minimum scons distribution is included in the package.
+
+BUILDING AND INSTALLING
+-----------------------
+
+For configuring, compiling and installing the application and
+if you do have Scons 0.96.1 or newer installed, just run:
+
+$ scons
+$ scons install (as root user)
+
+In case you don't have Scons installed, you can use
+the accompanying minimum scons by running:
+
+$ tar xjvf admin/scons-mini.tar.bz2
+$ ./scons
+$ ./scons install
+
+ADVANCED BUILD FEATURES & DEINSTALLING
+--------------------------------------
+
+In case you want to execute many compilation jobs in parallel (because you
+want to make use of a SMP system or a compile cluster, for instance),
+you can use ('N' is the number of jobs which should be run in parallel):
+
+$ scons -jN
+
+A debug build of the program can be created by running:
+
+$ scons configure debug=1
+$ scons
+
+Finally, the software can be removed from your system by running
+
+$ scons -c install
+
+CONFIGURATION NOTES
+-------------------
+
+The installation scripts are relying on the kde-config program.
+The programs kde-config, qmake, uic and moc must be accesssible
+through your PATH.
+
+Qt and kde may not be installed as expected (in QTDIR and KDEDIR)
+So until kde-config is able to give that information, you may
+have to give those paths. You may also want to tune the build.
+
+In these cases, you must first run "scons configure" with some options
+before running "scons" and "scons install"
+
+Here are some examples :
+On Fedora/Redhat
+$ scons configure kdeincludes=/usr/include/kde/
+On Debian
+$ scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/
+To install in some particular location with additional include paths
+$ scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include
+For AMD64 and platforms where folders are like /usr/lib64
+$ scons configure libsuffix=64
+
+For more options, run
+scons --help
+
+The build system is based on bksys, a build system that replaces
+autoconf, automake and make in a row. Feel free to report your opinion
+about it to the bksys authors.
+
+PACKAGE CREATION
+----------------
+
+RPM packagers can use the DESTDIR environment variable
+$ DESTDIR=/tmp/build-rpm/ scons install
+
+To use checkinstall, pass the following option
+$ checkinstall --fstrans=no --nodoc scons install
+
diff --git a/languages/cpp/app_templates/kscons_kxt/Makefile.am b/languages/cpp/app_templates/kscons_kxt/Makefile.am
new file mode 100644
index 00000000..8cce001c
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/Makefile.am
@@ -0,0 +1,21 @@
+dataFiles = app.cpp app.h main.cpp appui.rc app.kdevelop \
+appview.h appview.cpp appview_base.ui prefs-base.ui \
+prefs.cpp prefs.h app.kcfg settings.kcfgc messages.sh \
+SConstruct SConscript-doc SConscript-src tips VERSION \
+QUICKSTART INSTALL README
+
+templateName= kscons_kxt
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles} ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kscons_kxt/QUICKSTART b/languages/cpp/app_templates/kscons_kxt/QUICKSTART
new file mode 100644
index 00000000..ceaf1bda
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/QUICKSTART
@@ -0,0 +1,164 @@
+------------------------------------------
+SUMMARY :
+
+scons
+scons install
+
+
+The online documentation of bksys can be found at:
+http://freehackers.org/~tnagy/bksys_manual.html
+
+ ... and now for the quickstart:
+
+CONFIGURING AND COMPILING THE PROJECT(S)
+SCONS TIPS
+MOC PROCESSING
+SCONS MINIMUM DISTRIBUTION
+MORE TIPS
+
+------------------------------------------
+CONFIGURING AND COMPILING THE PROJECT(S)
+
+The program scons is usually launched as "scons"
+When it is not intalled globally, one can run
+"./scons" instead of "scons" (ie : to use the local scons
+that comes with bksys - see below SCONS MINIMUM DISTRIBUTION
+if you do not have scons already)
+
+To compile the project, you will then only need to launch
+scons on the top-level directory, the scripts find and
+cache the environment detected *automatically* :
+-> scons
+
+To clean the project -> scons -c
+
+To install the project -> scons install
+To install as root user -> su -c 'scons install'
+To uninstall the project -> scons -c install
+To uninstall (as root) -> su -c 'scons -c install'
+To consult the help -> scons -h
+
+To (re)configure the project and give particular arguments, use :
+ -> scons configure debug=1
+
+The variables are saved automatically after the first run
+in files named *.cache.py (look at kde.cache.py, ..)
+
+------------------------------------------
+SCONS TIPS
+
+In a subdirectory, it is necessary to launch scons with the -u flag :
+scons -u
+
+This is annoying and you probably want to add this to your .bashrc
+export SCONSFLAGS=-u
+and forget about it :)
+
+To make .deb or .rpm packages of your program, use :
+checkinstall --fstrans=no --nodoc scons install
+(if you have checkinstall on your system of course)
+
+To make scons run (much) faster, consult ./addons/README in bksys
+
+------------------------------------------
+MOC PROCESSING
+
+In qt programs, when a header 'foo.h' contains a class that has
+signals and slots, then 'foo.h' must contain the macro Q_OBJECT
+in order to compile. foo_moc.cpp is usually generated, and is
+used to produce foo_moc.o which is linked with the
+program or the library.
+
+In kde programs, 'foo.moc' is generated instead of foo_moc.cpp,
+and it must be included at the very end of foo.cpp
+(add #include "foo.moc" : this increases the speed of
+compilation a *lot* and makes less object files.
+
+Both modes are provided though, see test6-mocfiesta/
+
+------------------------------------------
+MINIMUM SCONS DISTRIBUTION
+
+A minimum scons distribution is included in the archive
+for convenience to those who do not have scons packages
+for their operating system or their linux
+distribution. For a full and more recent version of scons,
+please consult http://www.scons.org
+
+Including this scons distribution to your archive will add
+about 63kb (compressed) , while including the necessary
+kdescripts (admin/ directory, configure, autom4 cache stuff,
+Makefile.in) can add easily 500kb (compressed).
+
+To compile with the scons distribution :
+* unpack it with :
+ tar xjvf admin/scons-mini.tar.bz2
+* compile the program with :
+ ./scons (instead of just 'scons')
+* install the program with :
+ ./scons install (instead of just 'scons install')
+
+More options :
+* clean the object files with :
+ ./scons -c
+* uninstall the program with with :
+ ./scons -c install
+* create a package :
+ ./scons dist
+
+------------------------------------------
+MORE TIPS
+
+** static libraries **
+With Makefile.am, one had to make static libraries all the time
+because it did not allow having source code in other directories.
+This is not the case anymore with scons, so you can specify
+sources in other directories relative to the sconscript file, ie:
+ test1_sources = ['mainfiles/main.cpp', 'otherfile/program.cpp']
+ myenv.Program( target = "test1", source = test1_sources )
+To encourage you to switch to the new scheme, the static library
+helper has been omitted (look at the end of kde.py if you need one)
+
+** libtool **
+The LaFile build tool is a cheat that allows klibloader to load
+.so files without complaints. If you need real libtool support
+you can have a look to the libtool directory : it can work but
+remember that libtool is broken on many systems (invalid flags
+among others), so when you can work without libtool
+(small projects especially), just do it.
+
+** moc processing **
+As stated above, you should always add #include "foo.moc"
+for your qt classes (Q_OBJECT) to save precious compilation time.
+
+** using a cache **
+It is a good idea to enable the cache feature in SConstruct,
+especially if you are doing experiments (it saves your computer
+from recompiling the same files over and over again ..).
+
+** threading **
+myenv.AppendUnique( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
+
+** final notes ***
+A medium-sized project containing several targets, libraries and data
+files can be converted very quickly.
+Also, remember that SConscript files are actually python scripts ..
+you can use whatever python feature you want in them, ie: "for" loops,
+this is how the kde helpers work (KDEprogram, KDEshlib ..).
+
+If you are stuck, you can also have a look at more complicated
+bksys-based projects like kdissert or kshaderdesigner
+
+The scons man page and the wiki can be very useful, do not forget to
+consult them when you encounter an issue
+
+------------------------------------------
+
+I hope you will enjoy this alternative to the autotools
+scripts for kde programming, at least as much as I do :
+http://freehackers.org/~tnagy/kdissert/index.html
+
+Happy kde hacking,
+
+Thomas Nagy, 2004, 2005 <tnagyemail-mail@yahoo^fr>
+
diff --git a/languages/cpp/app_templates/kscons_kxt/README b/languages/cpp/app_templates/kscons_kxt/README
new file mode 100644
index 00000000..8085c7e7
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/README
@@ -0,0 +1,111 @@
+-----------------------------------------------
+Kde scons template quickstart
+Author: Thomas Nagy
+Date: 2005-04-04
+-----------------------------------------------
+
+This README file explains basic concepts necessary
+for starting with this application template.
+
+
+** Building and installing **
+
+* To configure the application run "scons configure"
+ In some rare cases you may need to add flags:
+ scons configure qtincludes=/usr/include/qt3/include kdeincludes=/usr/lib/kde3/include
+
+* After building, launch the application and test the dcop
+ interface by using the command (search a bit) :
+ dcop
+ dcop appname-...
+ dcop appname-... instancenumber
+ dcop appname-... instancenumber switch_colors
+ dcop appname switch_colors
+ Or launch kdcop and search in the menus for your program
+ name and double-click on 'switch_colors()'
+
+* The usual targets call the following scons commands :
+ make -> scons
+ make clean -> scons -c
+ make install -> scons install
+ make uninstall -> scons -c install
+ make dist -> scons dist
+
+* To build apps, use KDEprogram, KDEshlib, etc.
+ these functions are documented at the bottom of kde.py
+ More information can be found in the QUICKSTART
+
+* The scons scripts for building kde applications originate
+ from the 'bksys' distribution. It contains several other examples
+ that detail the kpart building and the dcop interface
+ processing :
+ http://www.kde-apps.org/content/show.php?content=19243
+
+* Extending the scons scripts for building the application :
+ The scons scripts are actually python scripts, so all the
+ usual tricks apply : 'for' and 'while' loops, 'if', 'else' ..
+ consult :
+ http://www.python.org for more information about python
+ http://www.scons.org for more informationabout scons
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+scons configure prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For that, you will need to write two simple configuration files
+in the src directory : <myproject>.kcfg and a <settings>.kcfgc
+The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0)
+into #MIN_CONFIG(3.2.0)
+
+Take an example on the many apps found in the kdegames source package and consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+refer to the file po/SConscript and po/messages.sh
+
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
diff --git a/languages/cpp/app_templates/kscons_kxt/SConscript-doc b/languages/cpp/app_templates/kscons_kxt/SConscript-doc
new file mode 100644
index 00000000..6769a359
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/SConscript-doc
@@ -0,0 +1,92 @@
+#! /usr/bin/env python
+## This script demonstrates to build and install
+## the documentation of a kde program with scons
+##
+## Thomas Nagy, 2005
+
+## This file can be reused freely for any project (see COPYING)
+
+## First load the environment set in the top-level SConstruct file
+Import( 'env' )
+myenv=env.Copy()
+
+## The following looks complicated but it is not
+## We first define a function to install all files as documentation
+## The documentation is of course lying in subfolders from here
+## * normal files are installed under KDEDOC/destination
+## * meinproc files are not installed, but processed into a single
+## index.cache.bz2 which is installed afterwards
+
+## This is far more maintainable to have *one* file than
+## having lots of almost empty SConscript in several folders
+
+###################################################################
+# COMMON PART FOR PROCESSING DOCUMENTATION FOLDERS
+###################################################################
+
+import os
+import sys
+import glob
+import SCons.Util
+
+## Define this to 1 if you are writing documentation else to 0 :)
+i_am_a_documentation_writer = 0
+
+## This function uses env imported above
+def processfolder(folder, lang, destination=""):
+ # folder is the folder to process
+ # lang is the language
+ # destination is the subdirectory in KDEDOC
+
+ docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :)
+
+ # warn about errors
+ #if len(lang) != 2:
+ # print "error, lang must be a two-letter string, like 'en'"
+
+ # when the destination is not given, use the folder
+ if len(destination) == 0:
+ destination=folder
+
+ docbook_list = []
+ for file in docfiles:
+
+ # do not process folders
+ if not os.path.isfile(file):
+ continue
+ # do not process the cache file
+ if file == 'index.cache.bz2':
+ continue
+ # ignore invalid files (TODO??)
+ if len( SCons.Util.splitext( file ) ) <= 1 :
+ continue
+
+ ext = SCons.Util.splitext( file )[1]
+
+ # docbook files are processed by meinproc
+ if ext == '.docbook':
+ docbook_list.append( file )
+ continue
+
+ myenv.KDEinstall('KDEDOC', lang+'/'+destination, file)
+
+ # Now process the index.docbook files ..
+ if len(docbook_list) == 0:
+ return
+ if not os.path.isfile( folder+'/index.docbook' ):
+ print "Error, index.docbook was not found in "+folder+'/index.docbook'
+ return
+ if i_am_a_documentation_writer:
+ for file in docbook_list:
+ myenv.Depends( folder+'index.cache.bz2', file )
+ myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' )
+ myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' )
+
+###################################################################
+# TELL WHICH FOLDERS TO PROCESS
+###################################################################
+
+## Use processfolder for each documentation directory
+processfolder('en/', 'en', '%{APPNAMELC}')
+processfolder('fr/', 'fr', '%{APPNAMELC}')
+
diff --git a/languages/cpp/app_templates/kscons_kxt/SConscript-src b/languages/cpp/app_templates/kscons_kxt/SConscript-src
new file mode 100644
index 00000000..02432be5
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/SConscript-src
@@ -0,0 +1,72 @@
+#! /usr/bin/env python
+# SConscript for %{APPNAMELC} compilation and installation
+
+############################
+## Configuration
+
+## use the environment set in the top-level
+## SConstruct file
+
+Import('env')
+myenv=env.Copy()
+
+#############################
+## Programs to build
+
+%{APPNAMELC}_sources="""
+settings.kcfgc
+main.cpp
+prefs.cpp
+%{APPNAMELC}.skel
+%{APPNAMELC}.cpp
+%{APPNAMELC}view.cpp
+prefs-base.ui
+%{APPNAMELC}view_base.ui
+"""
+
+# Our main program
+# KDEprogram add the file to the install targets automatically,
+# so you do not need to write myenv.KDEinstall( env['KDEBIN'], %{APPNAMELC})
+myenv.KDEprogram( "%{APPNAMELC}", %{APPNAMELC}_sources )
+
+############################
+## Customization
+
+## Additional include paths for compiling the source files
+## Always add '../' (top-level directory) because moc makes code that needs it
+myenv.KDEaddpaths_includes( "./ ../" )
+
+## Necessary libraries to link against
+myenv.KDEaddlibs( "qt-mt kio kdecore kdeprint" )
+
+## This shows how to add other link flags to the program
+# myenv.KDEaddflags_link('-export-dynamic')
+
+## If you are using QThread, add this line
+# myenv.KDEaddflags_link( '-DQT_THREAD_SUPPORT' )
+
+#############################
+## Installation
+
+## NOTE 1: The program is installed automatically
+## NOTE 2: KDEinstall( resource_type, subdirectory, list_of_files )
+
+## The ui.rc file and the tips go into datadir/appname/
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', '%{APPNAMELC}ui.rc' )
+myenv.KDEinstall( 'KDEDATA', '/%{APPNAMELC}', 'tips' )
+
+## The kcfg file is installed in a global kcfg directory
+myenv.KDEinstall( 'KDEKCFG', '', '%{APPNAMELC}.kcfg' )
+
+## Warning : there is a difference between the normal destop file used for the menu
+## and the servicetype desktop file, so they go in different directories
+myenv.KDEinstall( 'KDEMENU', 'Utilities/', '%{APPNAMELC}.desktop' )
+
+## Use this when you need to install a mimetype file
+#myenv.KDEinstall( 'KDEMIME', 'application', 'x-%{APPNAMELC}.desktop' )
+
+## Installing icons is easy (hi-16-app-%{APPNAMELC}.png, hi-22-app-%{APPNAMELC}.png)
+#myenv.KDEicon()
+
+## do not forget that this is a python script so even loops are allowed... :)
+
diff --git a/languages/cpp/app_templates/kscons_kxt/SConstruct b/languages/cpp/app_templates/kscons_kxt/SConstruct
new file mode 100644
index 00000000..b82de4e1
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/SConstruct
@@ -0,0 +1,112 @@
+#! /usr/bin/env python
+
+"""
+help -> scons -h
+compile -> scons
+clean -> scons -c
+install -> scons install
+uninstall -> scons -c install
+configure -> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local
+
+Run from a subdirectory -> scons -u
+The variables are saved automatically after the first run (look at cache/kde.cache.py, ..)
+"""
+
+###################################################################
+# LOAD THE ENVIRONMENT AND SET UP THE TOOLS
+###################################################################
+
+## Load the builders in config
+env = Environment( tools=['default', 'generic', 'kde'], toolpath=['./', './admin'])
+#env = Environment( tools=['default', 'generic', 'kde', 'othertool'], toolpath=['./', './admin'])
+
+env.KDEuse("environ rpath")
+#env.KDEuse("environ rpath lang_qt thread nohelp")
+
+###################################################################
+# SCRIPTS FOR BUILDING THE TARGETS
+###################################################################
+
+dirs="""
+src
+doc
+"""
+env.subdirs(dirs)
+
+## Process the translations in the po/ directory
+env.KDElang('po/', '%{APPNAMELC}')
+
+###################################################################
+# CONVENIENCE FUNCTIONS TO EMULATE 'make dist' and 'make distclean'
+###################################################################
+
+### To make a tarball of your masterpiece, use 'scons dist'
+if 'dist' in COMMAND_LINE_TARGETS:
+
+ ## The target scons dist requires the python module shutil which is in 2.3
+ env.EnsurePythonVersion(2, 3)
+
+ import os
+ APPNAME = 'bksys'
+ VERSION = os.popen("cat VERSION").read().rstrip()
+ FOLDER = APPNAME+'-'+VERSION
+ ARCHIVE = FOLDER+'.tar.bz2'
+
+ ## If your app name and version number are defined in 'version.h', use this instead:
+ ## (contributed by Dennis Schridde devurandom@gmx@net)
+ #import re
+ #INFO = dict( re.findall( '(?m)^#define\s+(\w+)\s+(.*)(?<=\S)', open(r"version.h","rb").read() ) )
+ #APPNAME = INFO['APPNAME']
+ #VERSION = INFO['VERSION']
+
+ import shutil
+ import glob
+
+ ## check if the temporary directory already exists
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+ if os.path.isfile(ARCHIVE):
+ os.remove(ARCHIVE)
+
+ ## create a temporary directory
+ startdir = os.getcwd()
+ shutil.copytree(startdir, FOLDER)
+
+ ## remove our object files first
+ os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f")
+ #os.popen("pushd %s && scons -c " % FOLDER) # TODO
+
+ ## CVS cleanup
+ os.popen("find "+FOLDER+" -name \"CVS\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".cvsignore\" | xargs rm -rf")
+
+ ## Subversion cleanup
+ os.popen("find %s -name .svn -type d | xargs rm -rf" % FOLDER)
+
+ ## GNU Arch cleanup
+ os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf")
+ os.popen("find "+FOLDER+" -name \".arch-i*\" | xargs rm -rf")
+
+ ## Create the tarball (coloured output)
+ print "\033[92m"+"Writing archive "+ARCHIVE+"\033[0m"
+ os.popen("tar cjf "+ARCHIVE+" "+FOLDER)
+
+ ## Remove the temporary directory
+ if os.path.isdir(FOLDER):
+ shutil.rmtree(FOLDER)
+
+ env.Default(None)
+ env.Exit(0)
+
+### Emulate "make distclean"
+if 'distclean' in COMMAND_LINE_TARGETS:
+ ## Remove the cache directory
+ import os, shutil
+ if os.path.isdir(env['CACHEDIR']):
+ shutil.rmtree(env['CACHEDIR'])
+ os.popen("find . -name \"*.pyc\" | xargs rm -rf")
+
+ env.Default(None)
+ env.Exit(0)
+
diff --git a/languages/cpp/app_templates/kscons_kxt/VERSION b/languages/cpp/app_templates/kscons_kxt/VERSION
new file mode 100644
index 00000000..2e293c30
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/VERSION
@@ -0,0 +1 @@
+%{VERSION}
diff --git a/languages/cpp/app_templates/kscons_kxt/app.cpp b/languages/cpp/app_templates/kscons_kxt/app.cpp
new file mode 100644
index 00000000..bc343554
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/app.cpp
@@ -0,0 +1,177 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include "settings.h"
+#include "prefs.h"
+
+#include <qdragobject.h>
+#include <kprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+
+#include <kconfigdialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include <kkeydialog.h>
+#include <ktip.h>
+
+#include <kedittoolbar.h>
+
+#include <kstdaccel.h>
+#include <kaction.h>
+#include <kstdaction.h>
+
+%{APPNAME}::%{APPNAME}()
+ : KMainWindow( 0, "%{APPNAME}" ),
+ m_view(new %{APPNAME}View(this)),
+ m_printer(0)
+{
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KMainWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar()->show();
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+
+ // allow the view to change the statusbar and caption
+ connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
+ this, SLOT(changeStatusbar(const QString&)));
+ connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
+ this, SLOT(changeCaption(const QString&)));
+
+ showTipOnStart();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+}
+
+void %{APPNAME}::setupActions()
+{
+ KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::tipOfDay( this, SLOT( showTip() ), actionCollection()
+ )->setWhatsThis(i18n("This shows useful tips on the use of this application."));
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ // custom menu and menu item - the slot is in the class %{APPNAME}View
+ KAction *custom = new KAction(i18n("Swi&tch Colors"), 0,
+ m_view, SLOT(switchColors()),
+ actionCollection(), "switch_action");
+
+ createGUI();
+}
+
+void %{APPNAME}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAME})->show();
+}
+
+void %{APPNAME}::optionsShowToolbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // toolbar
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void %{APPNAME}::optionsShowStatusbar()
+{
+ // show/hide the statusbar
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void %{APPNAME}::optionsConfigureKeys()
+{
+ KKeyDialog::configure(actionCollection());
+}
+
+void %{APPNAME}::optionsConfigureToolbars()
+{
+ // use the standard toolbar editor
+ saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAME}::newToolbarConfig()
+{
+ // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
+ // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
+ createGUI();
+
+ applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAME}::optionsPreferences()
+{
+ // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow);
+ dialog->addPage(new Prefs(), i18n("General"), "package_settings");
+ connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged()));
+ dialog->show();
+}
+
+void %{APPNAME}::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text, 2000);
+}
+
+void %{APPNAME}::changeCaption(const QString& text)
+{
+ // display the text on the caption
+ setCaption(text);
+}
+
+void %{APPNAME}::showTip()
+{
+ KTipDialog::showTip(this,QString::null,true);
+}
+
+void %{APPNAME}::showTipOnStart()
+{
+ KTipDialog::showTip(this);
+}
+
+void %{APPNAME}::switch_colors()
+{
+ if (!m_view)
+ return;
+ m_view->switchColors();
+}
+
+#include "%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kscons_kxt/app.h b/languages/cpp/app_templates/kscons_kxt/app.h
new file mode 100644
index 00000000..4f855793
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/app.h
@@ -0,0 +1,73 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <dcopobject.h>
+#include <kapplication.h>
+#include <kmainwindow.h>
+
+#include "%{APPNAMELC}view.h"
+
+class KPrinter;
+class KToggleAction;
+class KURL;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME} : public KMainWindow, public DCOPObject
+{
+ K_DCOP
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAME}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAME}();
+
+k_dcop:
+ virtual void switch_colors();
+
+private slots:
+ void fileNew();
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+ void optionsPreferences();
+ void newToolbarConfig();
+ void showTip();
+
+ void changeStatusbar(const QString& text);
+ void changeCaption(const QString& text);
+
+private:
+ void setupAccel();
+ void setupActions();
+ void showTipOnStart();
+
+private:
+ %{APPNAME}View *m_view;
+
+ KPrinter *m_printer;
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+};
+
+#endif // _%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/kscons_kxt/app.kcfg b/languages/cpp/app_templates/kscons_kxt/app.kcfg
new file mode 100644
index 00000000..d5325b92
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/app.kcfg
@@ -0,0 +1,21 @@
+<?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" >
+ <kcfgfile name="%{APPNAME}rc"/>
+ <group name="Preferences">
+ <entry name="col_background" type="Color">
+ <label>color of the background</label>
+ <default>black</default>
+ </entry>
+ <entry name="col_foreground" type="Color">
+ <label>color of the foreground</label>
+ <default>yellow</default>
+ </entry>
+ <entry name="val_time" type="Int">
+ <label>size of a ball</label>
+ <default>2</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kscons_kxt/app.kdevelop b/languages/cpp/app_templates/kscons_kxt/app.kdevelop
new file mode 100644
index 00000000..e6a14fff
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/app.kdevelop
@@ -0,0 +1,169 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kscons_kxt/appui.rc b/languages/cpp/app_templates/kscons_kxt/appui.rc
new file mode 100644
index 00000000..06549878
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="move"><text>&amp;Move</text>
+ <Action name="switch_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kscons_kxt/appview.cpp b/languages/cpp/app_templates/kscons_kxt/appview.cpp
new file mode 100644
index 00000000..7dc99f61
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/appview.cpp
@@ -0,0 +1,41 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}view.h"
+#include "settings.h"
+
+#include <klocale.h>
+#include <qlabel.h>
+
+%{APPNAME}View::%{APPNAME}View(QWidget *parent)
+ : %{APPNAME}view_base(parent)
+{
+ settingsChanged();
+}
+
+%{APPNAME}View::~%{APPNAME}View()
+{
+
+}
+
+void %{APPNAME}View::switchColors()
+{
+ // switch the foreground/background colors of the label
+ QColor color = Settings::col_background();
+ Settings::setCol_background( Settings::col_foreground() );
+ Settings::setCol_foreground( color );
+
+ settingsChanged();
+}
+
+void %{APPNAME}View::settingsChanged()
+{
+ sillyLabel->setPaletteBackgroundColor( Settings::col_background() );
+ sillyLabel->setPaletteForegroundColor( Settings::col_foreground() );
+
+ // i18n : internationalization
+ sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) );
+ emit signalChangeStatusbar( i18n("Settings changed") );
+}
+
+#include "%{APPNAMELC}view.moc"
+
diff --git a/languages/cpp/app_templates/kscons_kxt/appview.h b/languages/cpp/app_templates/kscons_kxt/appview.h
new file mode 100644
index 00000000..86d097a4
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/appview.h
@@ -0,0 +1,52 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}VIEW_H_
+#define _%{APPNAMEUC}VIEW_H_
+
+#include <qwidget.h>
+
+#include "%{APPNAMELC}view_base.h"
+
+class QPainter;
+class KURL;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAME}View : public %{APPNAME}view_base
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAME}View(QWidget *parent);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAME}View();
+
+signals:
+ /**
+ * Use this signal to change the content of the statusbar
+ */
+ void signalChangeStatusbar(const QString& text);
+
+ /**
+ * Use this signal to change the content of the caption
+ */
+ void signalChangeCaption(const QString& text);
+
+public slots:
+ void switchColors();
+ void settingsChanged();
+};
+
+#endif // _%{APPNAMEUC}VIEW_H_
diff --git a/languages/cpp/app_templates/kscons_kxt/appview_base.ui b/languages/cpp/app_templates/kscons_kxt/appview_base.ui
new file mode 100644
index 00000000..6cd36d2c
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/appview_base.ui
@@ -0,0 +1,35 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}view_base</class>
+<comment>%{CPP_TEMPLATE}</comment>
+<author>%{AUTHOR} &lt;%{EMAIL}&gt;</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAME}view_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>268</width>
+ <height>164</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAME}_base</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>sillyLabel</cstring>
+ </property>
+ <property name="text">
+ <string>hello, world</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate
new file mode 100644
index 00000000..6236f905
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.kdevtemplate
@@ -0,0 +1,253 @@
+# KDE Config File
+[General]
+Name=Scons-based KDE application
+Name[ca]=Una aplicació per al KDE basada en Scons
+Name[da]=Scons-baseret KDE program
+Name[de]=Auf Scons basierende KDE-Anwendung
+Name[el]=Μια εφαρμογή KMDI βασισμένης στο Scons
+Name[es]=Aplicación para KDE basada en Scons
+Name[et]=KDE rakendus Sconsi põhjal
+Name[eu]=Scons-en oinarritutako KDE aplikazioa
+Name[fa]=کاربرد KDE بر مبنای Scons
+Name[fr]=Application KDE basée sur Scons
+Name[ga]=Feidhmchlár KDE bunaithe ar Scons
+Name[gl]=Aplicación KDE baseada en Scons
+Name[hu]=Scons-alapú KDE-s alkalmazás
+Name[it]=Un'applicazione KDE basata su scons
+Name[ja]=Scons を使った KDE アプリケーション
+Name[nds]=Op "Scons" opbuut KDE-Programm
+Name[ne]=स्कोन-आधारित केडीई अनुप्रयोग
+Name[nl]=Scons gebaseerde KDE-toepassing
+Name[pl]=Program KDE wykorzystujący Scons
+Name[pt]=Aplicação KDE usando Scons
+Name[pt_BR]=Aplicação KDE usando Scons
+Name[ru]=Приложение KDE на базе Scons
+Name[sk]=KDE aplikácia založená na Scons
+Name[sr]=KDE програм на основу Scons-а
+Name[sr@Latn]=KDE program na osnovu Scons-a
+Name[sv]=Scons-baserat KDE-program
+Name[tr]=Scons-tabanlı KDE Uygulaması
+Name[zh_CN]=基于 Scons 的 KDE 应用程序
+Name[zh_TW]=Scons 為基礎的 KDE 應用程式
+Category=C++/KDE
+Icon=kscons_kxt.png
+Comment=Generates a simple KDE application with one widget, a configuration dialog and a dcop interface. Scons scripts are provided for compiling and installing the application.
+Comment[ca]=Genera una simple aplicació per al KDE amb un estri, un diàleg de configuració i una interfície dcop. Els scripts en Scons són proveïts per a compilar i instal·lar l'aplicació.
+Comment[da]=Genererer et simpelt KDE program med en kontrol, en indstillingsdialog og en dcop-grænseflade. Der sørges for scons-scripter til at kompilere og installere programmet.
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget, einem Einstellungsdialog und einer DCOP-Schnittstelle. Scons-Skripte zum Kompileren und Installieren der Anwendung werden zur Verfügung gestellt.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης και μια διασύνδεση dcop. Προσφέρονται σενάρια Scons για τη μεταγλώττιση και εγκατάσταση της εφαρμογής.
+Comment[en_GB]=Generates a simple KDE application with one widget, a configuration dialogue and a dcop interface. Scons scripts are provided for compiling and installing the application.
+Comment[es]=Genera una sencilla aplicación para KDE con una ventana principal, un diálogo de configuración y una interfaz DCOP. Se proporcionan guiones en Scons para compilar e instalar la aplicación.
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina, seadistusdialoogi ja DCOP-liidesega. Luuakse ka Sconsi skriptid rakenduse kompileerimiseks ja paigaldamiseks.
+Comment[eu]=KDE aplikazio sinple bat sortzen du trepeta bat, konfigurazio-elkarrizketa eta dcop interfaze batekin. Aplikazioa konpilatu eta instalatzeko Scons script-ak sortzen ditu.
+Comment[fa]=یک کاربرد سادۀ KDE با یک عنصر، یک محاورۀ پیکربندی و یک واسط dcop تولید می‌کند. دست‌نوشته‌های Scons برای ترجمه و نصب کاربرد فراهم شده‌اند.
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget), une boîte de dialogue de configuration et une interface DCOP. Des scripts Scons sont fournis pour compiler et installer l'application.
+Comment[gl]=Xera unha aplicación sinxela KDE cunha compoñente, un diálogo de configuración e unha interface dcop. Os scripts scons proporciónanse para compilar e intalar a aplicación.
+Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy főablakkal, beállítóablakkal és DCOP-felülettel. Az alkalmazás lefordításához és telepítéséhez Scons-szkriptek állnak rendelkezésre.
+Comment[it]=Genera una semplice applicazione KDE con un elemento grafico, una finestra di configurazione e un'interfaccia DCOP. Gli script scons sono forniti per compilare e installare l'applicazione.
+Comment[nds]=Stellt en eenfach KDE-Programm mit een Element, en Instelldialoog un en DCOP-Koppelsteed op. Stellt Scons-Skripten för't Kompileren un Installeren vun't Programm praat.
+Comment[ne]=एउटा विगेट, कन्फिगरेसन संवाद र dcop इन्टरफेससँग एउटा साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ । स्कोन स्क्रिप्टहरू अनुप्रयोग स्थापना र कम्पाइल गर्नका लागि प्रदान गरिन्छ ।
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één toplevel widget, een configuratievenster en een DCOP-interface. Scons-scripts worden aangemaakt voor compilatie en installatie.
+Comment[pl]=Generuje prosty program dla KDE widgetem, oknem konfiguracyjnym i interfejsem dcop. Do kompilacji i instalacji programu wykorzystywane są skrypty Scons.
+Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal, uma de configuração e uma interface de DCOP. Os ficheiros do 'scons' são oferecidos para compilar e instalar a aplicação.
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal, uma de configuração e uma interface de DCOP. Os ficheiros do 'scons' são oferecidos para compilar e instalar a aplicação.
+Comment[ru]=Создание простого приложения KDE с одним виджетом, окном настройки и интерфейсом DCOP. Сборка и установка осуществляется с помощью скриптов Scons.
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom, konfiguračným dial=ogom a DCOP rozhraním. K dispozícii je Scons skriptna kompiláciu a inštaláciu aplikácie.
+Comment[sr]=Прави једноставан KDE програм са једном контролом, дијалогом за подешавање и DCOP интерфејсом. Дате су Scons скрипте за превођење и инсталирање програма.
+Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom, dijalogom za podešavanje i DCOP interfejsom. Date su Scons skripte za prevođenje i instaliranje programa.
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent, en inställningsdialogruta och ett DCOP-gränssnitt. Scons-script tillhandahålls för att kompilera och installera programmet.
+Comment[tr]=Bir parçacıklı, ayar pencereli ve bir dcop arayüzü olan basit bir KDE uygulaması yaratır. Uygulamayı derlemek ve kurmak için scons betikleri sağlanmıştır.
+Comment[zh_CN]=生成一个带一个部件、一个配置对话框和一个 DCOP 接口的简单 KDE 应用程序。此时会提供 Scons 脚本以供编译并安装应用程序。
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件,一個設定對話框與一個 DCOP 介面。Scons 文稿可用於編譯與安裝應用程式。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/QUICKSTART
+Archive=kscons_kxt.tar.gz
+
+[SCONS]
+Type=include
+File=%{kdevelop}/template-common/scons.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{src}/SConscript-doc
+Dest=%{dest}/doc/SConscript
+
+[FILE2]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE4]
+Type=install
+Source=%{src}/SConstruct
+Dest=%{dest}/SConstruct
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE10]
+Type=install
+Source=%{src}/SConscript-src
+Dest=%{dest}/src/SConscript
+
+[FILE11]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE12]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE13]
+Type=install
+EscapeXML=true
+Source=%{src}/appview_base.ui
+Dest=%{dest}/src/%{APPNAMELC}view_base.ui
+
+[FILE14]
+Type=install
+Source=%{src}/appview.cpp
+Dest=%{dest}/src/%{APPNAMELC}view.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/appview.h
+Dest=%{dest}/src/%{APPNAMELC}view.h
+
+[FILE16]
+Type=install
+EscapeXML=true
+Source=%{src}/prefs-base.ui
+Dest=%{dest}/src/prefs-base.ui
+
+[FILE17]
+Type=install
+Source=%{src}/prefs.cpp
+Dest=%{dest}/src/prefs.cpp
+
+[FILE18]
+Type=install
+Source=%{src}/prefs.h
+Dest=%{dest}/src/prefs.h
+
+[FILE19]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE21]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[FILE22]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE23]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[FILE24]
+Type=install
+Source=%{src}/tips
+Dest=%{dest}/src/tips
+
+[FILE26]
+Type=install
+Source=%{src}/VERSION
+Dest=%{dest}/VERSION
+
+[FILE29]
+Type=install
+Source=%{src}/INSTALL
+Dest=%{dest}/INSTALL
+
+[FILE30]
+Type=install
+Source=%{src}/QUICKSTART
+Dest=%{dest}/QUICKSTART
+
+[FILE31]
+Type=install
+Source=%{src}/messages.sh
+Dest=%{dest}/po/messages.sh
+
+[MSG]
+Type=message
+Comment=A KDE application with scons scripts was created in %{dest}
+Comment[ca]=Una aplicació per al KDE amb scripts en Scons ha estat creada e n %{dest}
+Comment[da]=Et KDE program med scons-scripter blev oprette i %{dest}
+Comment[de]=Eine KDE-Anwendung mit Scons-Skripten wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή KDE με σενάρια scons δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para KDE con guiones de Scons ha sido creada en %{dest}
+Comment[et]=KDE rakendus Sconsi skriptidega loodi asukohta %{dest}
+Comment[eu]=Scons script-dun KDE aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KDE با دست‌نوشته‌های scons در %{dest} ایجاد شد
+Comment[fr]=Une application KDE comprenant des scripts Scons a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár KDE le scripteanna scons i %{dest}
+Comment[gl]=Creouse unha aplicación KDE con scripts scons en %{dest}
+Comment[hu]=Létrejött egy Scons-szkripteket használó KDE-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KDE con gli script scons in %{dest}
+Comment[ja]=Scons スクリプトを使った KDE アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-Programm mit scons-Skripten opstellt
+Comment[ne]=स्कोन स्क्रिप्टसँग केडीई अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KDE applicatie inclusief Scons-scripts is aangemaakt in %{dest}
+Comment[pl]=Program KDE ze skryptami scons utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KDE com ficheiros do 'scons' em %{dest}
+Comment[ru]=Приложение KDE со скриптами Scons создано в %{dest}
+Comment[sk]=KDE aplikácia so scons skriptom bola vytvorená v %{dest}
+Comment[sr]=KDE програм са scons скриптама направљен је у %{dest}
+Comment[sr@Latn]=KDE program sa scons skriptama napravljen je u %{dest}
+Comment[sv]=Ett KDE-program med Scons-skript skapades i %{dest}
+Comment[tr]=Scons betikleri olan bir KDE uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了带 scons 脚本的 KDE 应用程序
+Comment[zh_TW]=一個內含 scons 文稿的 KDE 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png
new file mode 100644
index 00000000..13e8eeff
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/kscons_kxt.png
Binary files differ
diff --git a/languages/cpp/app_templates/kscons_kxt/main.cpp b/languages/cpp/app_templates/kscons_kxt/main.cpp
new file mode 100644
index 00000000..95e54c47
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/main.cpp
@@ -0,0 +1,57 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAME});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count() == 0)
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++)
+ {
+ %{APPNAME} *widget = new %{APPNAME};
+ widget->show();
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kscons_kxt/messages.sh b/languages/cpp/app_templates/kscons_kxt/messages.sh
new file mode 100755
index 00000000..a36f5c93
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/messages.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Inspired by Makefile.common from coolo
+# this script is used to update the .po files
+
+# To update the translations, you will need a specific gettext
+# patched for kde and a lot of patience, tenacity, luck, time ..
+
+
+# I guess one should only update the .po files when all .cpp files
+# are generated (after a make or scons)
+
+# If you have a better way to do this, do not keep that info
+# for yourself and help me to improve this script, thanks
+# (tnagyemail-mail tat yahoo d0tt fr)
+
+SRCDIR=../test1-kconfigxt # srcdir is the directory containing the source code
+TIPSDIR=$SRCDIR # tipsdir is the directory containing the tips
+
+KDEDIR=`kde-config --prefix`
+EXTRACTRC=extractrc
+KDEPOT=`kde-config --prefix`/include/kde.pot
+XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale -x $KDEPOT "
+
+## check that kde.pot is available
+if ! test -e $KDEPOT; then
+ echo "$KDEPOT does not exist, there is something wrong with your installation!"
+ XGETTEXT="xgettext -C -ki18n -ktr2i18n -kI18N_NOOP -ktranslate -kaliasLocale "
+fi
+
+> rc.cpp
+
+## extract the strings
+echo "extracting the strings"
+
+# process the .ui and .rc files
+$EXTRACTRC `find $SRCDIR -iname *.rc` >> rc.cpp
+$EXTRACTRC `find $SRCDIR -iname *.ui` >> rc.cpp
+echo -e 'i18n("_: NAME OF TRANSLATORS\\n"\n"Your names")\ni18n("_: EMAIL OF TRANSLATORS\\n"\n"Your emails")' > $SRCDIR/_translatorinfo.cpp
+
+# process the tips - $SRCDIR is supposed to be where the tips are living
+pushd $TIPSDIR; preparetips >tips.cpp; popd
+
+$XGETTEXT `find $SRCDIR -name "*.cpp"` -o kdissert.pot
+
+# remove the intermediate files
+rm -f $TIPSDIR/tips.cpp
+rm -f rc.cpp
+rm -f $SRCDIR/_translatorinfo.cpp
+
+## now merge the .po files ..
+echo "merging the .po files"
+
+for i in `ls *.po`; do
+ msgmerge $i kdissert.pot -o $i || exit 1
+done
+
+## finished
+echo "Done"
+
diff --git a/languages/cpp/app_templates/kscons_kxt/prefs-base.ui b/languages/cpp/app_templates/kscons_kxt/prefs-base.ui
new file mode 100644
index 00000000..43ef8a5f
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/prefs-base.ui
@@ -0,0 +1,129 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Prefs_base</class>
+<comment>%{CPP_TEMPLATE}</comment>
+<author>%{AUTHOR} &lt;%{EMAIL}&gt;</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Prefs_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>282</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Background color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_col_background</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Project age:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Foreground color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_col_foreground</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="0" 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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_val_time</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/app_templates/kscons_kxt/prefs.cpp b/languages/cpp/app_templates/kscons_kxt/prefs.cpp
new file mode 100644
index 00000000..e7a46ddf
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/prefs.cpp
@@ -0,0 +1,12 @@
+%{CPP_TEMPLATE}
+
+#include "prefs.h"
+#include <kdebug.h>
+
+Prefs::Prefs()
+ : Prefs_base()
+{
+// debugging :
+// kdWarning()<<"creating a pref dialog"<<endl;
+}
+
diff --git a/languages/cpp/app_templates/kscons_kxt/prefs.h b/languages/cpp/app_templates/kscons_kxt/prefs.h
new file mode 100644
index 00000000..9106fe59
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/prefs.h
@@ -0,0 +1,11 @@
+%{H_TEMPLATE}
+
+#include "prefs-base.h"
+
+
+class Prefs : public Prefs_base
+{
+ public:
+ Prefs();
+};
+
diff --git a/languages/cpp/app_templates/kscons_kxt/settings.kcfgc b/languages/cpp/app_templates/kscons_kxt/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kscons_kxt/tips b/languages/cpp/app_templates/kscons_kxt/tips
new file mode 100644
index 00000000..56f29469
--- /dev/null
+++ b/languages/cpp/app_templates/kscons_kxt/tips
@@ -0,0 +1,6 @@
+<tip category="help">
+<html>
+<p>... that automake was not involved in building this kde application ?</p>
+<p>The kdevelop template &quot;kscons_kxt&quot; was used instead.</p>
+</html>
+</tip>
diff --git a/languages/cpp/app_templates/kscreensaver/.kdev_ignore b/languages/cpp/app_templates/kscreensaver/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/.kdev_ignore
diff --git a/languages/cpp/app_templates/kscreensaver/Makefile.am b/languages/cpp/app_templates/kscreensaver/Makefile.am
new file mode 100644
index 00000000..28747ace
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = kscreensaver.desktop kscreensaver.png kscreensaver.h \
+ kscreensaverui.ui src-Makefile.am kscreensaver.cpp \
+ kscreensaver.kdevelop subdirs
+
+templateName= kscreensaver
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz $(templateName).png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp b/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp
new file mode 100644
index 00000000..f4418571
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.cpp
@@ -0,0 +1,107 @@
+%{CPP_TEMPLATE}
+
+#include <stdlib.h>
+#include <qcheckbox.h>
+#include <qcolor.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include "%{APPNAMELC}.h"
+#include "%{APPNAMELC}ui.h"
+
+//! libkscreensaver interface
+extern "C"
+{
+ const char *kss_applicationName = "%{APPNAMELC}.kss";
+ const char *kss_description = I18N_NOOP( "%{APPNAME}" );
+ const char *kss_version = "2.2.0";
+
+ %{APPNAME} *kss_create( WId id )
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}( id );
+ }
+
+ QDialog *kss_setup()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}Setup();
+ }
+}
+
+//-----------------------------------------------------------------------------
+//! dialog to setup screen saver parameters
+%{APPNAME}Setup::%{APPNAME}Setup( QWidget *parent, const char *name )
+ : %{APPNAME}UI( parent, name, TRUE )
+{
+ /// @todo
+ //Connect your signals and slots here to configure the screen saver.
+ connect( OkayPushButton, SIGNAL( released() ),
+ SLOT( slotOkPressed() ) );
+ connect( CancelPushButton, SIGNAL( released() ),
+ SLOT( slotCancelPressed() ) );
+}
+
+
+//! read settings from config file
+void %{APPNAME}Setup::readSettings()
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup( "Settings" );
+ /// @todo
+ // Add your config options here...
+ CheckBox1->setChecked(config->readBoolEntry( "somesetting", false ));
+}
+
+
+//! Ok pressed - save settings and exit
+void %{APPNAME}Setup::slotOkPressed()
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup( "Settings" );
+ /// @todo
+ // Add your config options here.
+ config->writeEntry( "somesetting", CheckBox1->isChecked() );
+ config->sync();
+
+ accept();
+}
+
+void %{APPNAME}Setup::slotCancelPressed()
+{
+ reject();
+}
+//-----------------------------------------------------------------------------
+
+
+%{APPNAME}::%{APPNAME}( WId id ) : KScreenSaver( id )
+{
+ readSettings();
+ blank();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{}
+
+
+//! read configuration settings from config file
+void %{APPNAME}::readSettings()
+{
+ KConfig *config = KGlobal::config();
+ config->setGroup( "Settings" );
+ /// @todo
+ // Add your config options here...
+ bool somesetting = config->readBoolEntry( "somesetting", false );
+}
+
+
+void %{APPNAME}::blank()
+{
+ /// @todo
+ //Add your code to render the screen.
+ setBackgroundColor( QColor(black) );
+ //
+ erase();
+}
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop b/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop
new file mode 100644
index 00000000..0743cc69
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.desktop
@@ -0,0 +1,124 @@
+[Desktop Entry]
+Exec=%{APPNAMELC}.kss
+Icon=kscreensaver
+Type=Application
+Actions=Setup;InWindow;Root;
+X-KDE-Category=Miscellaneous
+Name=%{APPNAME}
+
+[Desktop Action Setup]
+Exec=%{APPNAMELC}.kss -setup
+Name=Setup...
+Name[br]=Kefluniadur ...
+Name[ca]=Configuració...
+Name[cy]=Gosod ...
+Name[da]=Opsætning...
+Name[de]=Einrichtung ...
+Name[el]=Ρύθμιση...
+Name[es]=Configuración...
+Name[et]=Häälestus...
+Name[eu]=Konfiguratu...
+Name[fa]=برپایی...
+Name[fr]=Configuration...
+Name[ga]=Cumraigh...
+Name[gl]=Configuración...
+Name[hu]=Beállítások...
+Name[it]=Imposta...
+Name[ja]=設定...
+Name[lt]=Nustatymas...
+Name[ms]=Tetapan...
+Name[nds]=Instellen...
+Name[ne]=सेटअप...
+Name[nl]=Instellen...
+Name[pl]=Ustawienia...
+Name[pt]=Configurar...
+Name[pt_BR]=Configurar...
+Name[ru]=Настроить...
+Name[rw]=Iboneza...
+Name[sk]=Nastavenie...
+Name[sl]=Nastavi ...
+Name[sr]=Постављање...
+Name[sr@Latn]=Postavljanje...
+Name[sv]=Inställning...
+Name[tr]=Kurulum...
+Name[zh_CN]=设置...
+Name[zh_TW]=設定...
+Icon=kscreensaver
+
+[Desktop Action InWindow]
+Exec=%{APPNAMELC}.kss -window-id %w
+Name=Display in Specified Window
+Name[br]=Diskwel er prenestr spisaet
+Name[ca]=Mostra a la finestra especificada
+Name[cy]=Dangos mewn Ffenestr Benodol
+Name[da]=Vis i specificeret vindue
+Name[de]=Im angegebenen Fenster anzeigen
+Name[el]=Προβολή στο ορισμένο παράθυρο
+Name[es]=Mostrar en la ventana especificada
+Name[et]=Kuva määratud aknas
+Name[eu]=Bistaratu zehaztutako lehioan
+Name[fa]=نمایش در پنجرۀ مشخص‌شده
+Name[fr]=Afficher dans la fenêtre spécifiée
+Name[ga]=Taispeáin san Fhuinneog Sonraithe
+Name[gl]=Mostrar na xanela especificada
+Name[hu]=Megjelenítés egy adott ablakban
+Name[it]=Mostra in una finestra specificata
+Name[ja]=指定したウィンドウに表示
+Name[lt]=Rodyti nurodytame lange
+Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
+Name[nds]=Binnen angeven Finster wiesen
+Name[ne]=निर्दिष्ट सञ्झ्यालमा प्रर्दशन
+Name[nl]=Weergave in aangegeven venster
+Name[pl]=Pokazywanie w podanym oknie
+Name[pt]=Mostrar na Janela Indicada
+Name[pt_BR]=Exibir na Janela Especificada
+Name[ru]=Показать в указанном окне
+Name[rw]=Kwerekana mu Idirishya Ryihariye
+Name[sk]=Zobraziť v špecifickom okne
+Name[sl]=Prikaži v določenem oknu
+Name[sr]=Прикажи у наведеном прозору
+Name[sr@Latn]=Prikaži u navedenom prozoru
+Name[sv]=Visa i angivet fönster
+Name[tr]=Belirtilen Pencerede Göster
+Name[zh_CN]=在指定窗口中显示
+Name[zh_TW]=顯示在指定視窗
+NoDisplay=true
+
+[Desktop Action Root]
+Exec=%{APPNAMELC}.kss -root
+Name=Display in Root Window
+Name[br]=Diskwel er prenestr gwrizienn
+Name[ca]=Mostra a la finestra arrel
+Name[cy]=Dangos mewn Ffenestr Wraidd
+Name[da]=Vis i rod-vindue
+Name[de]=Im Root-Fenster anzeigen
+Name[el]=Προβολή στο βασικό παράθυρο
+Name[es]=Mostrar en la ventana raíz
+Name[et]=Kuva juuraknas
+Name[eu]=Bistaratu erro-lehioan
+Name[fa]=نمایش در پنجرۀ ریشه
+Name[fr]=Afficher dans la fenêtre racine
+Name[ga]=Taispeáin sa bhFréamhfhuinneog
+Name[gl]=Mostrar na xanela raíz
+Name[hu]=Megjelenítés a gyökérablakban
+Name[it]=Mostra nella finestra radice
+Name[ja]=ルートウィンドウに表示
+Name[lt]=Rodyti root lange
+Name[ms]=Papar dalam Tetingkap Root
+Name[nds]=Binnen Wörtelfinster wiesen
+Name[ne]=रूट सञ्झ्यालमा प्रर्दशन
+Name[nl]=Weergave in hoofdvenster
+Name[pl]=Pokazywanie w głównym oknie
+Name[pt]=Mostrar na Janela de Fundo
+Name[pt_BR]=Exibir na Janela Raiz
+Name[ru]=Показать в главном окне
+Name[rw]=Kwerekana mu Idirishya Umuzi
+Name[sk]=Zobraziť v koreňovom okne
+Name[sl]=Prikaži v korenskem oknu
+Name[sr]=Прикажи у кореном прозору
+Name[sr@Latn]=Prikaži u korenom prozoru
+Name[sv]=Visa i rotfönster
+Name[tr]=Kök Pencerede Göster
+Name[zh_CN]=在根窗口中显示
+Name[zh_TW]=顯示在根視窗
+NoDisplay=true
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.h b/languages/cpp/app_templates/kscreensaver/kscreensaver.h
new file mode 100644
index 00000000..1301083d
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.h
@@ -0,0 +1,35 @@
+%{CPP_TEMPLATE}
+
+#ifndef %{APPNAME}_H__
+#define %{APPNAME}_H__
+
+#include "kscreensaver.h"
+#include "%{APPNAMELC}ui.h"
+
+class %{APPNAME} : public KScreenSaver
+{
+ Q_OBJECT
+public:
+ %{APPNAME}( WId drawable );
+ virtual ~%{APPNAME}();
+private:
+ void readSettings();
+ void blank();
+};
+
+class %{APPNAME}Setup : public %{APPNAME}UI
+{
+ Q_OBJECT
+public:
+ %{APPNAME}Setup( QWidget *parent = NULL, const char *name = NULL );
+
+private slots:
+ void slotOkPressed();
+ void slotCancelPressed();
+
+private:
+ void readSettings();
+ %{APPNAME} *saver;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop
new file mode 100644
index 00000000..e912518f
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ <keyword>kioslave</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+<kdevautoproject>
+ <general>
+ <activetarget>src/lib%{APPNAMELC}.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate
new file mode 100644
index 00000000..027ba4ea
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.kdevtemplate
@@ -0,0 +1,203 @@
+# KDE Config File
+[General]
+Name=KDE Screen Saver
+Name[br]=Damanter skramm KDE
+Name[ca]=Salvapantalles per al KDE
+Name[da]=KDE pauseskærm
+Name[de]=KDE-Bildschirmschoner
+Name[el]=Προφύλαξη οθόνης του KDE
+Name[es]=Salvapantallas para KDE
+Name[et]=KDE ekraanisäästja
+Name[eu]=KDE pantaila-babeslea
+Name[fa]=محافظ صفحۀ KDE
+Name[fr]=Écran de veille KDE
+Name[ga]=Spárálaí Scáileáin KDE
+Name[gl]=Salvapantallas KDE
+Name[hu]=KDE-s képernyővédő
+Name[it]=Salva schermo di KDE
+Name[ja]=KDE スクリーンセーバー
+Name[nds]=KDE-Pausschirm
+Name[ne]=केडीई स्क्रिन सर्भर
+Name[nl]=KDE-schermbeveiliging
+Name[pl]=Wygaszacz ekranu KDE
+Name[pt]=Protector de Ecrã do KDE
+Name[pt_BR]=Protetor de tela do KDE
+Name[ru]=Хранитель экрана для KDE
+Name[sk]=KDE šetrič obrazovky
+Name[sl]=Ohranjevalnik zaslona za KDE
+Name[sr]=KDE чувар екрана
+Name[sr@Latn]=KDE čuvar ekrana
+Name[sv]=KDE-skärmsläckare
+Name[tr]=KDE Ekran Koruyucusu
+Name[zh_CN]= KDE 屏幕保护程序
+Name[zh_TW]=KDE 螢幕保護程式
+Icon=kscreensaver.png
+Category=C++/KDE
+Comment=Generates a framework for a KDE screensaver.
+Comment[ca]=Genera una infraestructura per a un salvapantalles de KDE.
+Comment[da]=Genererer et skelet for en KDE-pauseskærm.
+Comment[de]=Erstellt das Gerüst für einen KDE-Bildschirmschoner.
+Comment[el]=Δημιουργεί ένα πλαίσιο για μια προφύλαξη οθόνης του KDE.
+Comment[es]=Genera una infraestructura para un salvapantallas de KDE
+Comment[et]=KDE ekraanisäästja raamistiku loomine.
+Comment[eu]=KDE-ren pantaila-babesle baten lan-marko bat sortzen du.
+Comment[fa]=چارچوبی برای محافظ صفحۀ KDE تولید می‌کند.
+Comment[fr]=Génère une infrastructure pour un écran de veille KDE.
+Comment[gl]=Xera un contorno de traballo para un salvapantallas KDE.
+Comment[hu]=Létrehoz egy alap KDE-s képernyővédőt.
+Comment[it]=Genera l'infrastruttura per un salvaschermo di KDE.
+Comment[ja]=KDE スクリーンセーバーのフレームワークを作成します
+Comment[nds]=Stellt dat Rahmenwark för en KDE-Pausschirm op.
+Comment[ne]=केडीई स्क्रिनसेभरका लागि फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Genereert een framework voor een KDE-schermbeveiliging.
+Comment[pl]=Generuje szablon wygaszacza ekranu dla KDE.
+Comment[pt]=Gera a plataforma para um protector de ecrã do KDE.
+Comment[pt_BR]=Gera a plataforma para um protector de ecrã do KDE.
+Comment[ru]=Создание инфраструктуры хранителя экрана для KDE.
+Comment[sk]=Vygeneruje framework pre KDE šetrič obrazovky.
+Comment[sl]=Ustvari ogrodje ohranjevalnika zaslona za KDE.
+Comment[sr]=Прави радни оквир за KDE чувар екрана.
+Comment[sr@Latn]=Pravi radni okvir za KDE čuvar ekrana.
+Comment[sv]=Skapar ett ramverk för en KDE-skärmsläckare
+Comment[tr]=Bir KDE ekran koruyucusu için bir çatı oluşturulur.
+Comment[zh_CN]=生成 KDE 屏幕保护程序框架。
+Comment[zh_TW]=產生一個 KDE 螢幕保護程式的框架
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kscreensaver.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/kscreensaver.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/kscreensaver.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/kscreensaver.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/kscreensaver.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE15]
+Type=install
+EscapeXML=true
+Source=%{src}/kscreensaverui.ui
+Dest=%{dest}/src/%{APPNAMELC}ui.ui
+
+[MSG]
+Type=message
+Comment=A screensaver application was created in %{dest}
+Comment[ca]=Una aplicació de salvapantalles ha estat creada en %{dest}
+Comment[da]=Et pauseskærmsprogram blev oprettet i %{dest}
+Comment[de]=Ein Bildschirmschoner wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή προφύλαξης οθόνης δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación salvapantallas ha sido creada en %{dest}
+Comment[et]=Ekraanisäästja rakendus loodi asukohta %{dest}
+Comment[eu]=Pantaila-babesle baten aplikazioa sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد محافظ صفحه در %{dest} ایجاد شد
+Comment[fr]=Une application écran de veille a été créé dans %{dest}
+Comment[ga]=Cruthaíodh spárálaí scáileáin i %{dest}
+Comment[gl]=Creouse unha aplicación salvapantallas en %{dest}
+Comment[hu]=Létrejött egy alap képernyővédő program itt: %{dest}
+Comment[it]=È stata creata un'applicazione salvaschermo in %{dest}
+Comment[ja]=スクリーンセーバーアプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Pausschirm opstellt
+Comment[ne]=स्क्रिनसेभर अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een schermbeveiligingstoepassing is aangemaakt in %{dest}
+Comment[pl]=Program wygaszacza ekranu został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação protectora do ecrã em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação protectora do ecrã em %{dest}
+Comment[ru]=Приложение хранителя экрана создано в %{dest}
+Comment[sk]=Aplikácia šetriča obrazovky bola vytvorená v %{dest}
+Comment[sl]=Program ohranjevalnika zaslona je bil ustvarjen v %{dest}
+Comment[sr]=Програм чувара екрана направљен је у %{dest}
+Comment[sr@Latn]=Program čuvara ekrana napravljen je u %{dest}
+Comment[sv]=Ett skärmsläckarprogram skapades i %{dest}
+Comment[tr]=Bir ekran koruyucusu uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了屏幕保护应用程序
+Comment[zh_TW]=一個螢幕保護程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaver.png b/languages/cpp/app_templates/kscreensaver/kscreensaver.png
new file mode 100644
index 00000000..e91ec2e2
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaver.png
Binary files differ
diff --git a/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui b/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui
new file mode 100644
index 00000000..c4a843d0
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/kscreensaverui.ui
@@ -0,0 +1,79 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>%{APPNAME}UI</class>
+<comment>This is the main UI for setting up your screen saver.</comment>
+<author>Ian Reinhart Geiser</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>%{APPNAMELC}cfg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>257</width>
+ <height>58</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Screen Saver Config</string>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>5</x>
+ <y>0</y>
+ <width>255</width>
+ <height>57</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>CheckBox1</cstring>
+ </property>
+ <property name="text">
+ <string>Set some setting</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>OkayPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>CancelPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/app_templates/kscreensaver/src-Makefile.am b/languages/cpp/app_templates/kscreensaver/src-Makefile.am
new file mode 100644
index 00000000..e19ffb77
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/src-Makefile.am
@@ -0,0 +1,24 @@
+# Makefile.am for %{APPNAMELC}.
+#
+
+AM_CPPFLAGS = -UQT_NO_ASCII_CAST
+METASOURCES = AUTO
+
+INCLUDES = $(all_includes)
+LDFLAGS = $(all_libraries) $(KDE_RPATH)
+LDADD = $(LIB_KDEUI) -lkscreensaver -lm
+bin_PROGRAMS = %{APPNAMELC}.kss
+
+%{APPNAMELC}_kss_SOURCES = %{APPNAMELC}ui.ui %{APPNAMELC}.cpp
+%{APPNAMELC}_kss_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LDADD) $(LIB_KSYCOCA)
+
+#datadir = $(kde_datadir)/%{APPNAMELC}
+
+desktop_DATA = %{APPNAMELC}.desktop
+desktopdir = $(kde_appsdir)/System/ScreenSavers
+
+EXTRA_DIST = $(desktop_DATA)
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/kscreensaver/subdirs b/languages/cpp/app_templates/kscreensaver/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kscreensaver/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/kxt/.kdev_ignore b/languages/cpp/app_templates/kxt/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/.kdev_ignore
diff --git a/languages/cpp/app_templates/kxt/Makefile.am b/languages/cpp/app_templates/kxt/Makefile.am
new file mode 100644
index 00000000..07767961
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = src-Makefile.am app.cpp app.h main.cpp appui.rc app.kdevelop \
+ subdirs app.desktop preview.png appview.h appview.cpp appview_base.ui \
+ prefs-base.ui prefs.cpp prefs.h app.kcfg settings.kcfgc README \
+ src-configure.in.in
+templateName= kxt
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/kxt/README b/languages/cpp/app_templates/kxt/README
new file mode 100644
index 00000000..74e23296
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/README
@@ -0,0 +1,86 @@
+-----------------------------------------------
+Kde templates quickstart
+Author: Thomas Nagy
+Date: 2004-03-22
+-----------------------------------------------
+
+This README file explains you basic things for starting with
+this application template.
+
+
+** Building and installing **
+
+* Build the configure script by "make -f Makefile.cvs"
+
+* To clean, use "make clean", and to clean everything
+(remove the makefiles, etc), use "make distclean"
+
+* To distribute your program, try "make dist".
+This will make a compact tarball archive of your release with the
+necessary scripts inside.
+
+* Modifying the auto-tools scripts
+for automake scripts there is an excellent tutorial there :
+http://developer.kde.org/documentation/other/makefile_am_howto.html
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+./configure --prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For that, you will need to write two simple configuration files
+in the src directory : <myproject>.kcfg and a <settings>.kcfgc
+The configure.in.in will need to be modified : change the line #MIN_CONFIG(3.0.0)
+into #MIN_CONFIG(3.2.0)
+
+Take an example on the many apps found in the kdegames source package and consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
+
+
diff --git a/languages/cpp/app_templates/kxt/app.cpp b/languages/cpp/app_templates/kxt/app.cpp
new file mode 100644
index 00000000..6e2ce524
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/app.cpp
@@ -0,0 +1,154 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include "settings.h"
+#include "prefs.h"
+
+#include <qdragobject.h>
+#include <kprinter.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+
+#include <kconfigdialog.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include <kkeydialog.h>
+
+#include <kedittoolbar.h>
+
+#include <kstdaccel.h>
+#include <kaction.h>
+#include <kstdaction.h>
+
+%{APPNAMELC}::%{APPNAMELC}()
+ : KMainWindow( 0, "%{APPNAMELC}" ),
+ m_view(new %{APPNAMELC}View(this)),
+ m_printer(0)
+{
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KMainWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar()->show();
+
+ // apply the saved mainwindow settings, if any, and ask the mainwindow
+ // to automatically save settings if changed: window size, toolbar
+ // position, icon size, etc.
+ setAutoSaveSettings();
+
+ // allow the view to change the statusbar and caption
+ connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
+ this, SLOT(changeStatusbar(const QString&)));
+ connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
+ this, SLOT(changeCaption(const QString&)));
+
+}
+
+%{APPNAMELC}::~%{APPNAMELC}()
+{
+}
+
+void %{APPNAMELC}::setupActions()
+{
+ KStdAction::openNew(this, SLOT(fileNew()), actionCollection());
+ KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+
+ m_toolbarAction = KStdAction::showToolbar(this, SLOT(optionsShowToolbar()), actionCollection());
+ m_statusbarAction = KStdAction::showStatusbar(this, SLOT(optionsShowStatusbar()), actionCollection());
+
+ KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
+ KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
+ KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
+
+ // custom menu and menu item - the slot is in the class %{APPNAMELC}View
+ KAction *custom = new KAction(i18n("Swi&tch Colors"), 0,
+ m_view, SLOT(switchColors()),
+ actionCollection(), "switch_action");
+
+ createGUI();
+}
+
+void %{APPNAMELC}::fileNew()
+{
+ // this slot is called whenever the File->New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAMELC})->show();
+}
+
+void %{APPNAMELC}::optionsShowToolbar()
+{
+ // this is all very cut and paste code for showing/hiding the
+ // toolbar
+ if (m_toolbarAction->isChecked())
+ toolBar()->show();
+ else
+ toolBar()->hide();
+}
+
+void %{APPNAMELC}::optionsShowStatusbar()
+{
+ // show/hide the statusbar
+ if (m_statusbarAction->isChecked())
+ statusBar()->show();
+ else
+ statusBar()->hide();
+}
+
+void %{APPNAMELC}::optionsConfigureKeys()
+{
+ KKeyDialog::configure(actionCollection());
+}
+
+void %{APPNAMELC}::optionsConfigureToolbars()
+{
+ // use the standard toolbar editor
+ saveMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}::newToolbarConfig()
+{
+ // this slot is called when user clicks "Ok" or "Apply" in the toolbar editor.
+ // recreate our GUI, and re-apply the settings (e.g. "text under icons", etc.)
+ createGUI();
+
+ applyMainWindowSettings(KGlobal::config(), autoSaveGroup());
+}
+
+void %{APPNAMELC}::optionsPreferences()
+{
+ // The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ //
+ // compare the names of the widgets in the .ui file
+ // to the names of the variables in the .kcfg file
+ KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self(), KDialogBase::Swallow);
+ dialog->addPage(new Prefs(), i18n("General"), "package_settings");
+ connect(dialog, SIGNAL(settingsChanged()), m_view, SLOT(settingsChanged()));
+ dialog->show();
+}
+
+void %{APPNAMELC}::changeStatusbar(const QString& text)
+{
+ // display the text on the statusbar
+ statusBar()->message(text, 2000);
+}
+
+void %{APPNAMELC}::changeCaption(const QString& text)
+{
+ // display the text on the caption
+ setCaption(text);
+}
+#include "%{APPNAMELC}.moc"
+
diff --git a/languages/cpp/app_templates/kxt/app.desktop b/languages/cpp/app_templates/kxt/app.desktop
new file mode 100644
index 00000000..8b36e6e0
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/app.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple KDE Application
+Comment[br]=Ur meziant eeun evit KDE
+Comment[ca]=Una simple aplicació per al KDE
+Comment[da]=Et simpelt KDE program
+Comment[de]=Eine einfache KDE-Anwendung
+Comment[el]=Μια απλή εφαρμογή του KDE
+Comment[es]=Una aplicación de KDE sencilla
+Comment[et]=Lihtne KDE rakendus
+Comment[eu]=KDE aplikazio simple bat
+Comment[fa]=یک کاربرد سادۀ KDE
+Comment[fr]=Une application simple pour KDE
+Comment[ga]=Feidhmchlár Simplí KDE
+Comment[gl]=Unha aplicación KDE sinxela
+Comment[hi]=एक सादा केडीई अनुप्रयोग
+Comment[hu]=Egyszerű KDE-alkalmazás
+Comment[is]=Einfalt KDE forrit
+Comment[it]=Una semplice applicazione KDE
+Comment[ja]=簡単な KDE アプリケーション
+Comment[nds]=En eenfach KDE-Programm
+Comment[ne]=एउटा साधारण केडीई अनुप्रयोग
+Comment[nl]=Een eenvoudige KDE-toepassing
+Comment[pl]=Prosty program KDE
+Comment[pt]=Uma aplicação simples do KDE
+Comment[pt_BR]=Um simples Aplicativo do KDE
+Comment[ru]=Простое приложение KDE
+Comment[sk]=Jednoduchá KDE aplikácia
+Comment[sl]=Preprost program za KDE
+Comment[sr]=Једноставан KDE програм
+Comment[sr@Latn]=Jednostavan KDE program
+Comment[sv]=Ett enkelt KDE-program
+Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு
+Comment[tg]=Гузориши оддиKDE
+Comment[tr]=Basit bir KDE Uygulaması
+Comment[zh_CN]=一个简单的 KDE 应用程序
+Comment[zh_TW]=簡單的 KDE 應用程式
diff --git a/languages/cpp/app_templates/kxt/app.h b/languages/cpp/app_templates/kxt/app.h
new file mode 100644
index 00000000..22037de2
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/app.h
@@ -0,0 +1,66 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kmainwindow.h>
+
+#include "%{APPNAMELC}view.h"
+
+class KPrinter;
+class KToggleAction;
+class KURL;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAMELC} : public KMainWindow
+{
+ Q_OBJECT
+public:
+ /**
+ * Default Constructor
+ */
+ %{APPNAMELC}();
+
+ /**
+ * Default Destructor
+ */
+ virtual ~%{APPNAMELC}();
+
+private slots:
+ void fileNew();
+ void optionsShowToolbar();
+ void optionsShowStatusbar();
+ void optionsConfigureKeys();
+ void optionsConfigureToolbars();
+ void optionsPreferences();
+ void newToolbarConfig();
+
+ void changeStatusbar(const QString& text);
+ void changeCaption(const QString& text);
+
+private:
+ void setupAccel();
+ void setupActions();
+
+private:
+ %{APPNAMELC}View *m_view;
+
+ KPrinter *m_printer;
+ KToggleAction *m_toolbarAction;
+ KToggleAction *m_statusbarAction;
+};
+
+#endif // _%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/kxt/app.kcfg b/languages/cpp/app_templates/kxt/app.kcfg
new file mode 100644
index 00000000..686f25f2
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/app.kcfg
@@ -0,0 +1,21 @@
+<?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" >
+ <kcfgfile name="%{APPNAMELC}rc"/>
+ <group name="Preferences">
+ <entry name="col_background" type="Color">
+ <label>color of the background</label>
+ <default>black</default>
+ </entry>
+ <entry name="col_foreground" type="Color">
+ <label>color of the foreground</label>
+ <default>yellow</default>
+ </entry>
+ <entry name="val_time" type="Int">
+ <label>size of a ball</label>
+ <default>2</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/cpp/app_templates/kxt/app.kdevelop b/languages/cpp/app_templates/kxt/app.kdevelop
new file mode 100644
index 00000000..e6a14fff
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/app.kdevelop
@@ -0,0 +1,169 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <ignoreparts/>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>false</terminal>
+ </run>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ </make>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs/>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <runappinappdirectory>true</runappinappdirectory>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions/>
+ <updateoptions>-dP</updateoptions>
+ <addoptions/>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions/>
+ <rshoptions/>
+ </kdevcvs>
+ <cppsupportpart>
+ <codecompletion/>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL/>
+ <implementationURL/>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/kxt/appui.rc b/languages/cpp/app_templates/kxt/appui.rc
new file mode 100644
index 00000000..06549878
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="move"><text>&amp;Move</text>
+ <Action name="switch_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/cpp/app_templates/kxt/appview.cpp b/languages/cpp/app_templates/kxt/appview.cpp
new file mode 100644
index 00000000..35e23682
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/appview.cpp
@@ -0,0 +1,41 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}view.h"
+#include "settings.h"
+
+#include <klocale.h>
+#include <qlabel.h>
+
+%{APPNAMELC}View::%{APPNAMELC}View(QWidget *parent)
+ : %{APPNAMELC}view_base(parent)
+{
+ settingsChanged();
+}
+
+%{APPNAMELC}View::~%{APPNAMELC}View()
+{
+
+}
+
+void %{APPNAMELC}View::switchColors()
+{
+ // switch the foreground/background colors of the label
+ QColor color = Settings::col_background();
+ Settings::setCol_background( Settings::col_foreground() );
+ Settings::setCol_foreground( color );
+
+ settingsChanged();
+}
+
+void %{APPNAMELC}View::settingsChanged()
+{
+ sillyLabel->setPaletteBackgroundColor( Settings::col_background() );
+ sillyLabel->setPaletteForegroundColor( Settings::col_foreground() );
+
+ // i18n : internationalization
+ sillyLabel->setText( i18n("This project is %1 days old").arg(Settings::val_time()) );
+ emit signalChangeStatusbar( i18n("Settings changed") );
+}
+
+#include "%{APPNAMELC}view.moc"
+
diff --git a/languages/cpp/app_templates/kxt/appview.h b/languages/cpp/app_templates/kxt/appview.h
new file mode 100644
index 00000000..45a10de7
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/appview.h
@@ -0,0 +1,52 @@
+%{H_TEMPLATE}
+
+#ifndef _%{APPNAMEUC}VIEW_H_
+#define _%{APPNAMEUC}VIEW_H_
+
+#include <qwidget.h>
+
+#include "%{APPNAMELC}view_base.h"
+
+class QPainter;
+class KURL;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+class %{APPNAMELC}View : public %{APPNAMELC}view_base
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ %{APPNAMELC}View(QWidget *parent);
+
+ /**
+ * Destructor
+ */
+ virtual ~%{APPNAMELC}View();
+
+signals:
+ /**
+ * Use this signal to change the content of the statusbar
+ */
+ void signalChangeStatusbar(const QString& text);
+
+ /**
+ * Use this signal to change the content of the caption
+ */
+ void signalChangeCaption(const QString& text);
+
+private slots:
+ void switchColors();
+ void settingsChanged();
+};
+
+#endif // _%{APPNAMEUC}VIEW_H_
diff --git a/languages/cpp/app_templates/kxt/appview_base.ui b/languages/cpp/app_templates/kxt/appview_base.ui
new file mode 100644
index 00000000..626d95df
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/appview_base.ui
@@ -0,0 +1,33 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAMELC}view_base</class>
+<widget class="QWidget">
+<property name="name">
+<cstring>%{APPNAMELC}view_base</cstring>
+</property>
+<property name="geometry">
+<rect>
+<x>0</x>
+<y>0</y>
+<width>268</width>
+<height>164</height>
+</rect>
+</property>
+<property name="caption">
+<string>%{APPNAMELC}_base</string>
+</property>
+<grid>
+<property name="name">
+<cstring>unnamed</cstring>
+</property>
+<widget class="QLabel" row="0" column="0">
+<property name="name">
+<cstring>sillyLabel</cstring>
+</property>
+<property name="text">
+<string>hello, world</string>
+</property>
+</widget>
+</grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/kxt/kxt.kdevtemplate b/languages/cpp/app_templates/kxt/kxt.kdevtemplate
new file mode 100644
index 00000000..a7a23298
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/kxt.kdevtemplate
@@ -0,0 +1,269 @@
+# KDE Config File
+[General]
+Name=KConfig XT application
+Name[ca]=Aplicació KConfig XT
+Name[da]=KConfig XT program
+Name[de]=KConfigXT-Anwendung
+Name[el]=Εφαρμογή KConfig XT
+Name[es]=Aplicación KConfig XT
+Name[et]=KConfig XT rakendus
+Name[eu]=KConfig XT aplikazioa
+Name[fa]=کاربرد KConfig XT
+Name[fr]=Application KConfig XT
+Name[ga]=Feidhmchlár XT KConfig
+Name[gl]=Aplicación KConfig XT
+Name[hu]=KConfig XT-alapú alkalmazás
+Name[it]=Applicazione KConfig XT
+Name[ja]=KConfig XT アプリケーション
+Name[nds]=KConfig-XT-Programm
+Name[ne]=KConfig XT अनुप्रयोग
+Name[nl]=KConfig XT-toepassing
+Name[pl]=Program KConfig XT
+Name[pt]=Aplicação do KConfig XT
+Name[pt_BR]=Aplicação do KConfig XT
+Name[ru]=Приложение KDE с KConfig XT
+Name[sk]=KConfig XT aplikácia
+Name[sr]=KConfig XT програм
+Name[sr@Latn]=KConfig XT program
+Name[sv]=KConfig XT-program
+Name[tr]=KConfig XT uygulaması
+Name[zh_CN]=KConfig XT 应用程序
+Name[zh_TW]=KConfig XT 應用程式
+Category=C++/KDE
+Icon=kxt.png
+Comment=Generates a simple KDE application with one widget and a configuration dialog
+Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració
+Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget und einem Einstellungsdialog.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης
+Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue
+Comment[es]=Genera una sencilla aplicación para KDE con una ventana y un diálogo de configuración
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja seadistustedialoogiga.
+Comment[eu]=Trepeta bat eta konfigurazio elkarrizketa-koadro bat duen KDE aplikazio sinple bat sortzen du
+Comment[fa]=یک کاربرد سادۀ KDE، با یک عنصر و یک محاورۀ پیکربندی تولید می‌کند
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) et une boîte de dialogue de configuration
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin agus dialóg chumraíochta
+Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente e un diálogo de configuración
+Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal
+Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione
+Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します
+Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op
+Comment[ne]=एउटा विगेट र कन्फिगरेसन संवादसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog
+Comment[pl]=Generuje prosty program KDE z jednym widgetem i oknem konfiguracyjnym
+Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração
+Comment[ru]=Создание приложения KDE с окном конфигурации
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom
+Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање
+Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta
+Comment[tr]=Bir parçacığı ve ayar penceresi olan basit bir KDE uygulaması yaratır.
+Comment[zh_CN]=生成带一个部件和一个配置对话框的简单 KDE 应用程序
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件與一個設定對話框。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=kxt.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE17]
+Type=install
+EscapeXML=true
+Source=%{src}/appview_base.ui
+Dest=%{dest}/src/%{APPNAMELC}view_base.ui
+
+[FILE18]
+Type=install
+Source=%{src}/appview.cpp
+Dest=%{dest}/src/%{APPNAMELC}view.cpp
+
+[FILE19]
+Type=install
+Source=%{src}/appview.h
+Dest=%{dest}/src/%{APPNAMELC}view.h
+
+[FILE20]
+Type=install
+EscapeXML=true
+Source=%{src}/prefs-base.ui
+Dest=%{dest}/src/prefs-base.ui
+
+[FILE21]
+Type=install
+Source=%{src}/prefs.cpp
+Dest=%{dest}/src/prefs.cpp
+
+[FILE22]
+Type=install
+Source=%{src}/prefs.h
+Dest=%{dest}/src/prefs.h
+
+[FILE23]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE24]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE25]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[FILE26]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE27]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[FILE28]
+Type=install
+Source=%{src}/src-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MSG]
+Type=message
+Comment=A KConfig XT application was created in %{dest}
+Comment[ca]=Una aplicació KConfig XT ha estat creada en %{dest}
+Comment[da]=Et KConfig XT-program blev oprettet i %{dest}
+Comment[de]=Eine KConfig-XT-Anwendung wurde in %{dest} erstellt
+Comment[el]=Μια εφαρμογή KConfig XT δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación KConfig XT ha sido creada en %{dest}
+Comment[et]=A KConfig XT rakendus loodi asukohta %{dest}
+Comment[eu]=KConfig XT aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد KConfig XT در %{dest} ایجاد شد
+Comment[fr]=Une application KConfig XT a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár XT KConfig i %{dest}
+Comment[gl]=Creouse unha aplicación KConfig XT en %{dest}
+Comment[hu]=Létrejött egy KConfig XT-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione KConfig XT in %{dest}
+Comment[ja]=KConfig XT アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KConfig-XT-Programm opstellt
+Comment[ne]=KConfig XT अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een KConfig XT-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program KConfig XT został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do KConfig XT em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do KConfig XT em %{dest}
+Comment[ru]=Приложение KDE с KConfig XT создано в %{dest}
+Comment[sk]=KConfig XT aplikácia bola vytvorená v %{dest}
+Comment[sr]=KConfig XT програм је направљен у %{dest}
+Comment[sr@Latn]=KConfig XT program je napravljen u %{dest}
+Comment[sv]=Ett KConfig XT-program skapades i %{dest}
+Comment[tr]=Bir KConfig XT uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了 KConfig XT 应用程序
+Comment[zh_TW]=一個 KConfig XT 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/kxt/kxt.png b/languages/cpp/app_templates/kxt/kxt.png
new file mode 100644
index 00000000..5a4b6359
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/kxt.png
Binary files differ
diff --git a/languages/cpp/app_templates/kxt/main.cpp b/languages/cpp/app_templates/kxt/main.cpp
new file mode 100644
index 00000000..66f038c9
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/main.cpp
@@ -0,0 +1,57 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+
+static const char description[] =
+ I18N_NOOP("A KDE Application");
+
+static const char version[] = "%{VERSION}";
+
+static KCmdLineOptions options[] =
+{
+ { "+[URL]", I18N_NOOP( "Document to open" ), 0 },
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KAboutData::License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", 0, 0, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", 0, "%{EMAIL}" );
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+ KApplication app;
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ {
+ RESTORE(%{APPNAMELC});
+ }
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+ if (args->count() == 0)
+ {
+ %{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args->count(); i++)
+ {
+ %{APPNAMELC} *widget = new %{APPNAMELC};
+ widget->show();
+ }
+ }
+ args->clear();
+ }
+
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/kxt/prefs-base.ui b/languages/cpp/app_templates/kxt/prefs-base.ui
new file mode 100644
index 00000000..5c0fc860
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/prefs-base.ui
@@ -0,0 +1,127 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Prefs_base</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Prefs_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>282</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Background color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_col_background</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Project age:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Foreground color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_col_foreground</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="0" 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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_val_time</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/app_templates/kxt/prefs.cpp b/languages/cpp/app_templates/kxt/prefs.cpp
new file mode 100644
index 00000000..e7a46ddf
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/prefs.cpp
@@ -0,0 +1,12 @@
+%{CPP_TEMPLATE}
+
+#include "prefs.h"
+#include <kdebug.h>
+
+Prefs::Prefs()
+ : Prefs_base()
+{
+// debugging :
+// kdWarning()<<"creating a pref dialog"<<endl;
+}
+
diff --git a/languages/cpp/app_templates/kxt/prefs.h b/languages/cpp/app_templates/kxt/prefs.h
new file mode 100644
index 00000000..9106fe59
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/prefs.h
@@ -0,0 +1,11 @@
+%{H_TEMPLATE}
+
+#include "prefs-base.h"
+
+
+class Prefs : public Prefs_base
+{
+ public:
+ Prefs();
+};
+
diff --git a/languages/cpp/app_templates/kxt/preview.png b/languages/cpp/app_templates/kxt/preview.png
new file mode 100644
index 00000000..e235c9cf
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/preview.png
Binary files differ
diff --git a/languages/cpp/app_templates/kxt/settings.kcfgc b/languages/cpp/app_templates/kxt/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/cpp/app_templates/kxt/src-Makefile.am b/languages/cpp/app_templates/kxt/src-Makefile.am
new file mode 100644
index 00000000..5f7936da
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/src-Makefile.am
@@ -0,0 +1,41 @@
+## Makefile.am for %{APPNAMELC}
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(KDE_RPATH) $(all_libraries)
+
+# the libraries to link against.
+%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT)
+
+# which sources should be compiled for %{APPNAMELC}
+%{APPNAMELC}_SOURCES = settings.kcfgc main.cpp %{APPNAMELC}.cpp %{APPNAMELC}view.cpp \
+ %{APPNAMELC}view_base.ui prefs-base.ui prefs.cpp
+
+xdg_apps_DATA = %{APPNAMELC}.desktop
+kde_kcfg_DATA = %{APPNAMELC}.kcfg
+
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h %{APPNAMELC}view.h prefs.h
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot
+
+KDE_ICON = AUTO
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
diff --git a/languages/cpp/app_templates/kxt/src-configure.in.in b/languages/cpp/app_templates/kxt/src-configure.in.in
new file mode 100644
index 00000000..61d4a7fd
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/src-configure.in.in
@@ -0,0 +1,7 @@
+
+#MIN_CONFIG(3.2.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
diff --git a/languages/cpp/app_templates/kxt/subdirs b/languages/cpp/app_templates/kxt/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/kxt/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/makefileempty/Makefile.am b/languages/cpp/app_templates/makefileempty/Makefile.am
new file mode 100644
index 00000000..87f1db69
--- /dev/null
+++ b/languages/cpp/app_templates/makefileempty/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = makefileempty-Makefile \
+ makefileempty.png app.kdevelop
+templateName = makefileempty
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/makefileempty/app.kdevelop b/languages/cpp/app_templates/makefileempty/app.kdevelop
new file mode 100644
index 00000000..a0b41f59
--- /dev/null
+++ b/languages/cpp/app_templates/makefileempty/app.kdevelop
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ </general>
+ <run>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="cpp"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ </groups>
+ </kdevfileview>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/makefileempty/makefileempty-Makefile b/languages/cpp/app_templates/makefileempty/makefileempty-Makefile
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/makefileempty/makefileempty-Makefile
diff --git a/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate b/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate
new file mode 100644
index 00000000..bacfcae0
--- /dev/null
+++ b/languages/cpp/app_templates/makefileempty/makefileempty.kdevtemplate
@@ -0,0 +1,85 @@
+# KDE Config File
+[General]
+Name=Empty Custom Makefile Template
+Name[ca]=Plantilla Makefile personalitzada buida
+Name[da]=Tom brugertilpasset Makefile-skabelon
+Name[de]=Leere Vorlage für benutzerdefiniertes Makefile
+Name[el]=Κενό προσαρμοσμένο πρότυπο Makefile
+Name[es]=Plantilla vacía para Makefile personalizado
+Name[et]=Tühi kohandatud makefile'i mall
+Name[hu]=Üres egyedi Makefile-ra épülő sablon
+Name[it]=Modello di makefile personalizzato vuoto
+Name[nds]=Egen leddig Makefile-Vörlaag
+Name[nl]=Leeg aangepast Makefile-sjabloon
+Name[pl]=Pusty własny szablon pliku Makefile
+Name[pt]=Modelo de Makefile Personalizada Vazio
+Name[pt_BR]=Modelo de Makefile Personalizada Vazio
+Name[ru]=Пустой шаблон с пользовательским Makefile
+Name[sk]=Prázdna šablóna pre vlastný Makefile
+Name[sr]=Празан шаблон посебног справифајла
+Name[sr@Latn]=Prazan šablon posebnog spravifajla
+Name[sv]=Tom mall för egen byggfil
+Name[zh_TW]=空的自訂 Makefile 樣板
+Icon=makefileempty.png
+Category=C++
+Comment=Generate an empty Custom Makefile based application
+Comment[ca]=Genera una aplicació personalitzada buida basada en Makefile
+Comment[da]=Opretter et tomt brugertilpasset Makefile-baseret program
+Comment[de]=Erstellt eine auf einem benutzerdefinierten Makefile basierende Anwendung
+Comment[el]=Δημιουργία μίας κενής εφαρμογής βασισμένης σε προσαρμοσμένο Makefile
+Comment[es]=Genera una aplicación vacía basada en un Makefile personalizado
+Comment[et]=Tühja rakenduse loomine kohandatud makefile'i põhjal
+Comment[hu]=Létrehoz egy egyedi Makefile-ra épülő alkalmazást
+Comment[it]=Genera un'applicazione basata su makefile personalizzato
+Comment[nds]=Stellt en leddig Programm op, dat op en egen Makefile opbuut
+Comment[nl]=Genereer een leeg op een aangepast Makefile gebaseerd programma
+Comment[pl]=Generuje pusty program z własnym plikiem Makefile
+Comment[pt]=Gera uma aplicação baseada em Makefile's personalizadas
+Comment[pt_BR]=Gera uma aplicação baseada em Makefile's personalizadas
+Comment[ru]=Создание каркаса приложения, использующего пользовательский Makefile
+Comment[sk]=Vygeneruje prázdnu aplikáciu založenú na vlastnom Makefile
+Comment[sr]=Прави програм на основу посебног справифајла
+Comment[sr@Latn]=Pravi program na osnovu posebnog spravifajla
+Comment[sv]=Skapar ett tomt program baserat på en egen byggfil
+Comment[zh_TW]=產生一個空的使用自訂 Makefile 的應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+Archive=makefileempty.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE2]
+Type=install
+Source=%{src}/makefileempty-Makefile
+Dest=%{dest}/Makefile
+
+[MSG]
+Type=message
+Comment=A Custom Makefile based application was created in %{dest}
+Comment[ca]=S'ha creat una aplicació basada en Makefile en %{dest}
+Comment[da]=Et brugertilpasset Makefile-baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf einem benutzerdefinierten Makefile basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Δημιουργήθηκε μία εφαρμογή βασισμένη σε προσαρμοσμένο Makefile στο %{dest}
+Comment[es]=Una aplicación basada en un Makefile personalizado ha sido creada en %{dest}
+Comment[et]=Rakendus kohandatud makefile'i põhjal loodi asukohta %{dest}
+Comment[hu]=Létrejött egy egyedi Makefile-ra épülő alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su un makefile personalizzato in %{dest}
+Comment[nds]=In %{dest} wöör en Programm opstellt, dat op en egen Makefile opbuut
+Comment[nl]=Een op een aangepast Makefile gebaseerd programma is aangemaakt in %{dest}
+Comment[pl]=Program używający własnego Makefile został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada em Makefile's personalizadas em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada em Makefile's personalizadas em %{dest}
+Comment[ru]=Приложение с пользовательским Makefile создано в %{dest}
+Comment[sk]=Aplikácia založená na vlastnom Makefile bola vytvorená v %{dest}
+Comment[sr]=Програм на основу посебног справифајла направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovu posebnog spravifajla napravljen je u %{dest}
+Comment[sv]=Ett program baserat på en egen byggfil skapades i %{dest}
+Comment[zh_TW]=一個以自訂 Makefile 為基礎的應用程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/makefileempty/makefileempty.png b/languages/cpp/app_templates/makefileempty/makefileempty.png
new file mode 100644
index 00000000..519c007b
--- /dev/null
+++ b/languages/cpp/app_templates/makefileempty/makefileempty.png
Binary files differ
diff --git a/languages/cpp/app_templates/noatunui/.kdev_ignore b/languages/cpp/app_templates/noatunui/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/.kdev_ignore
diff --git a/languages/cpp/app_templates/noatunui/Makefile.am b/languages/cpp/app_templates/noatunui/Makefile.am
new file mode 100644
index 00000000..29358f2f
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = src-Makefile.am plugin_app.cpp plugin_impl.cpp plugin_impl.h \
+ noatunui.png plugin.plugin plugin.kdevelop subdirs
+templateName = noatunui
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/noatunui/noatunui b/languages/cpp/app_templates/noatunui/noatunui
new file mode 100644
index 00000000..631c4798
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/noatunui
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Name=Noatun UI plugin
+Icon=noatunui.png
+Category=C++/KDE
+Comment=Generates a simple user interface plugin for noatun.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/plugin_APPNAMELC_impl.cpp
diff --git a/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate
new file mode 100644
index 00000000..394e71ed
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/noatunui.kdevtemplate
@@ -0,0 +1,195 @@
+# KDE Config File
+[General]
+Name=Noatun UI plugin
+Name[ca]=Connector d'interfície d'usuari per a Noatun
+Name[de]=Noatun-UI-Modul
+Name[el]=Πρόσθετο Noatun UI
+Name[es]=Complemento de interfaz de usuario para Noatun
+Name[et]=Noatuni kasutajaliidese plugin
+Name[eu]=Noatun UI plugina
+Name[fa]=وصلۀ Noatun UI
+Name[fr]=Module externe d'interface utilisateur pour Noatun
+Name[ga]=Breiseán Chomhéadan Noatun
+Name[gl]=Extensión para a IU de Noatun
+Name[hu]=Noatun UI-modul
+Name[it]=Plugin UI di noatun
+Name[ja]=Noatun UI プラグイン
+Name[nds]=Böversiet-Moduul för Noatun
+Name[ne]=नोअटन UI plugin
+Name[nl]=Noatun UI-plugin
+Name[pl]=Wtyczka do interfejsu użytkownika Noatun
+Name[pt]='Plugin' de UI do Noatun
+Name[pt_BR]='Plugin' de UI do Noatun
+Name[ru]=Модуль интерфейса Noatun
+Name[sk]=Noatun UI modul
+Name[sr]=UI прикључак за Noatun
+Name[sr@Latn]=UI priključak za Noatun
+Name[sv]=Noatun-insticksprogram för användargränssnitt
+Name[tr]=Noatun Arayüz eklentisi
+Name[zh_CN]=Noatun 界面插件
+Name[zh_TW]=Noatun 使用者介面外掛程式
+Icon=noatunui.png
+Category=C++/KDE
+Comment=Generates a simple user interface plugin for noatun.
+Comment[ca]=Genera un simple connector d'interfície d'usuari per a Noatun.
+Comment[da]=Genererer en simpel brugergrænseflade-plugin for noatun.
+Comment[de]=Erstellt ein einfaches Oberflächen-Modul für Noatun
+Comment[el]=Δημιουργεί ένα απλό πρόσθετο γραφικού περιβάλλοντος για το noatun.
+Comment[es]=Genera un complemento de interfaz de usuario para Noatun.
+Comment[et]=Noatuni lihtsa kasutajaliidese plugina loomine.
+Comment[eu]=Noatun-entzat erabiltzaile-interfazerako plugin sinple bat sortzen du.
+Comment[fa]=یک وصلۀ واسط کاربر ساده برای noatun تولید می‌کند.
+Comment[fr]=Génère un module externe d'interface utilisateur simple pour Noatun.
+Comment[gl]=Xera unha extensión sinxela para a interface de usuario de noatun.
+Comment[hu]=Létrehoz egy egyszerű felületbővítő modult a Noatun programhoz.
+Comment[it]=Genera un semplice plugin di interfaccia per noatun.
+Comment[nds]=Stellt en eenfach Böversietmoduul för Noatun op.
+Comment[ne]=नोअटनका लागि साधारण इन्टरफेस प्लगइन उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een eenvoudige gebruikersinterfaceplugin voor Noatun.
+Comment[pl]=Generuje prostą wtyczkę do interfejsu użytkownika programu Noatun.
+Comment[pt]=Gera um 'plugin' simples para a interface de utilizador do Noatun.
+Comment[pt_BR]=Gera um 'plugin' simples para a interface de utilizador do Noatun.
+Comment[ru]=Создание простого интерфейса для Noatun.
+Comment[sk]=Vygeneruje jednoduchý modul užívateľského rozhrania pre Noatun
+Comment[sr]=Прави једноставан прикључак корисничког интерфејса за Noatun.
+Comment[sr@Latn]=Pravi jednostavan priključak korisničkog interfejsa za Noatun.
+Comment[sv]=Skapar ett enkelt insticksprogram för användargränssnitt till Noatun.
+Comment[tr]=Noatun için basit bir kullanıcı arayüzü eklentisi yaratır.
+Comment[zh_CN]=生成 noatun 的简单用户界面插件。
+Comment[zh_TW]=產生一個簡單的 noatun 的使用者介面外掛程式。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp
+Archive=noatunui.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/plugin_app.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/plugin_impl.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp
+
+[FILE14]
+Type=install
+Source=%{src}/plugin_impl.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.h
+
+[FILE15]
+Type=install
+Source=%{src}/plugin.plugin
+Dest=%{dest}/src/%{APPNAMELC}.plugin
+
+[MSG]
+Type=message
+Comment=A Noatun UI plugin was created in %{dest}
+Comment[ca]=Un connector d'interfície d'usuari per a Noatun ha estat creat en %{dest}
+Comment[da]=Et Noatun UI-plugin blev oprettet i %{dest}
+Comment[de]=Ein Oberflächen-Modul für Noatun wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο Noatun UI δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento de interfaz de usuario para Noatun ha sido creado en %{dest}
+Comment[et]=Noatuni kasutajaliidese plugin loodi asukohta %{dest}
+Comment[eu]=Noatun UI plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ Noatun UI در %{dest} ایجاد شد
+Comment[fr]=Un module externe d'interface utilisateur pour Noatun a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán chomhéadan Noatun i %{dest}
+Comment[gl]=Creouse unha extensión para a IU de Noatun en %{dest}
+Comment[hu]=Létrejött egy Noatun UI-modul itt: %{dest}
+Comment[it]=È stato creato un plugin UI per noatun in %{dest}
+Comment[ja]=Noatun UI プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Noatun-Böversietmoduul opstellt
+Comment[ne]=नोअटन UI प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Noatun UI-plugin is aangemaakt in %{dest}
+Comment[pl]=Wtyczka do interfejsu Noatun została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' da UI do Noatun em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' da UI do Noatun em %{dest}
+Comment[ru]=Модуль интерфейса для Noatun создан в %{dest}
+Comment[sk]=Noatun UI modul bol vytvorený v %{dest}
+Comment[sr]=UI прикључак за Noatun направљен је у %{dest}
+Comment[sr@Latn]=UI priključak za Noatun napravljen je u %{dest}
+Comment[sv]=Ett Noatun-insticksprogram för användargränssnitt skapades i %{dest}
+Comment[tr]=Bir Noatun Arayüz eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 Noatun 界面插件
+Comment[zh_TW]=一個 Noatun 使用者介面外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/noatunui/noatunui.png b/languages/cpp/app_templates/noatunui/noatunui.png
new file mode 100644
index 00000000..0d2c3e30
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/noatunui.png
Binary files differ
diff --git a/languages/cpp/app_templates/noatunui/plugin.kdevelop b/languages/cpp/app_templates/noatunui/plugin.kdevelop
new file mode 100644
index 00000000..f0cda142
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/plugin.kdevelop
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+<kdevautoproject>
+ <general>
+ <activetarget>src/noatun_%{APPNAMELC}plugin.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/noatunui/plugin.plugin b/languages/cpp/app_templates/noatunui/plugin.plugin
new file mode 100644
index 00000000..a7bb9170
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/plugin.plugin
@@ -0,0 +1,8 @@
+Filename=noatun_%{APPNAMELC}plugin.la
+Author=%{AUTHOR}
+Site=http://noatun.kde.org/
+Email=%{EMAIL}
+Type=userinterface
+License=$LICENSE$
+Name=%{APPNAME}
+Comment=A UI for Noatun
diff --git a/languages/cpp/app_templates/noatunui/plugin_app.cpp b/languages/cpp/app_templates/noatunui/plugin_app.cpp
new file mode 100644
index 00000000..23067139
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/plugin_app.cpp
@@ -0,0 +1,15 @@
+
+#include "plugin_%{APPNAMELC}_impl.h"
+
+#include <kglobal.h>
+#include <klocale.h>
+
+extern "C"
+{
+ Plugin *create_plugin()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}UI;
+ }
+}
+
diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.cpp b/languages/cpp/app_templates/noatunui/plugin_impl.cpp
new file mode 100644
index 00000000..1b5eea45
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/plugin_impl.cpp
@@ -0,0 +1,301 @@
+
+#include "plugin_%{APPNAMELC}_impl.h"
+#include "plugin_%{APPNAMELC}_impl.moc"
+
+#include <noatun/playlist.h>
+#include <noatun/stdaction.h>
+#include <noatun/app.h>
+#include <noatun/player.h>
+#include <noatun/controls.h>
+#include <noatun/effects.h>
+
+#include <qpushbutton.h>
+#include <qdragobject.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qobjectlist.h>
+#include <qobjectdict.h>
+
+#include <kpopupmenu.h>
+#include <kstatusbar.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kurldrag.h>
+//#include <kfiledialog.h>
+//#include <kconfig.h>
+
+%{APPNAME}UI::%{APPNAME}UI() : QWidget(0,"%{APPNAME}UI"), UserInterface()
+{
+ setAcceptDrops(true);
+ static const int buttonSize=32;
+
+ mBack=new QPushButton(this);
+ mBack->setFixedSize(buttonSize,buttonSize);
+ mBack->setPixmap(BarIcon("noatunback"));
+ connect(mBack, SIGNAL(clicked()), napp->player(), SLOT(back()));
+ QToolTip::add(mBack,i18n("Back"));
+
+ mStop=new QPushButton(this);
+ mStop->setFixedSize(buttonSize,buttonSize);
+ mStop->setPixmap(BarIcon("noatunstop"));
+ connect(mStop, SIGNAL(clicked()), napp->player(), SLOT(stop()));
+ QToolTip::add(mStop, i18n("Stop"));
+
+ mPlay=new QPushButton(this);
+ mPlay->setToggleButton(true);
+ mPlay->setFixedSize(buttonSize,buttonSize);
+ mPlay->setPixmap(BarIcon("noatunplay"));
+ connect(mPlay, SIGNAL(clicked()), napp->player(), SLOT(playpause()));
+ QToolTip::add(mPlay, i18n("Play"));
+
+ mForward=new QPushButton(this);
+ mForward->setFixedSize(buttonSize,buttonSize);
+ mForward->setPixmap(BarIcon("noatunforward"));
+ connect(mForward, SIGNAL(clicked()), napp->player(), SLOT(forward()));
+ QToolTip::add(mForward, i18n("Forward"));
+
+ mPlaylist=new QPushButton(this);
+ mPlaylist->setToggleButton(true);
+ mPlaylist->setFixedSize(buttonSize,buttonSize);
+ mPlaylist->setPixmap(BarIcon("noatunplaylist"));
+ connect(mPlaylist, SIGNAL(clicked()), napp->player(), SLOT(toggleListView()));
+ QToolTip::add(mPlaylist, i18n("Playlist"));
+
+ mLoop=new QPushButton(this);
+ mLoop->setFixedSize(buttonSize,buttonSize);
+ mLoop->setPixmap(BarIcon("noatunloopnone"));
+ connect(mLoop, SIGNAL(clicked()), napp->player(), SLOT(loop()));
+ QToolTip::add(mLoop, i18n("Change loop style"));
+
+ mPopup=new QPushButton(this);
+ mPopup->setFixedSize(buttonSize,buttonSize);
+ mPopup->setPixmap(BarIcon("noatun"));
+ connect(mPopup, SIGNAL(clicked()), SLOT(popup()));
+
+
+ mVolume=new L33tSlider(0,100,10,0, Horizontal, this);
+ mVolume->setValue(napp->player()->volume());
+ mSeeker=new L33tSlider(0,1000,10,0, Horizontal, this);
+
+ mStatusBar=new KStatusBar(this);
+
+
+ QGridLayout *l=new QGridLayout(this);
+ l->addWidget(mBack,0,0);
+ l->addWidget(mStop,0,1);
+ l->addWidget(mPlay,0,2);
+ l->addWidget(mForward,0,3);
+ l->addWidget(mPlaylist,0,4, Qt::AlignLeft);
+ l->addWidget(mLoop,0,5);
+ l->addWidget(mPopup,0,6);
+ l->addColSpacing(4, buttonSize+8);
+
+ l->addMultiCellWidget(mVolume,1,1,0,6);
+ l->addMultiCellWidget(mSeeker,2,2,0,6);
+ l->addMultiCellWidget(mStatusBar,3,3,0,6);
+
+ statusBar()->message(i18n("No File Loaded"));
+ statusBar()->insertItem("--:--/--:--", 1, 0, true);
+
+ connect(napp, SIGNAL(hideYourself()), this, SLOT(hide()) );
+ connect(napp, SIGNAL(showYourself()), this, SLOT(show()) );
+
+ connect(napp->player(), SIGNAL(playing()), this, SLOT(slotPlaying()));
+ connect(napp->player(), SIGNAL(stopped()), this, SLOT(slotStopped()));
+ connect(napp->player(), SIGNAL(paused()), this, SLOT(slotPaused()));
+ napp->player()->handleButtons();
+
+ connect(napp->player(), SIGNAL(timeout()), this, SLOT(slotTimeout()));
+ connect(napp->player(), SIGNAL(loopTypeChange(int)), this, SLOT(changeLoopType(int)));
+
+ /* This skipToWrapper is needed to pass milliseconds to Player() as everybody
+ * below the GUI is based on milliseconds instead of some unprecise thingy
+ * like seconds or mille */
+ connect(seeker(), SIGNAL(userChanged(int)), this, SLOT(skipToWrapper(int)));
+ connect(this, SIGNAL(skipTo(int)), napp->player(), SLOT(skipTo(int)));
+ connect(seeker(), SIGNAL(sliderMoved(int)), SLOT(sliderMoved(int)));
+
+ connect(mVolume, SIGNAL(sliderMoved(int)), napp->player(), SLOT(setVolume(int)));
+ connect(mVolume, SIGNAL(userChanged(int)), napp->player(), SLOT(setVolume(int)));
+
+
+ connect(napp->player(), SIGNAL(playlistShown()), SLOT(playlistShown()));
+ connect(napp->player(), SIGNAL(playlistHidden()), SLOT(playlistHidden()));
+
+ // Event Filter for the RMB
+ for (QPtrListIterator<QObject> i(*children()); i.current(); ++i)
+ (*i)->installEventFilter(this);
+
+ setCaption("Noatun");
+ setIcon(BarIcon("noatun"));
+ show();
+
+ // What it is now, stay.
+ setFixedSize(minimumSize());
+}
+
+%{APPNAME}UI::~%{APPNAME}UI()
+{
+ /** save settings here */
+}
+
+void %{APPNAME}UI::closeEvent(QCloseEvent*)
+{
+ unload();
+}
+
+void %{APPNAME}UI::showEvent(QShowEvent*e)
+{
+ QWidget::showEvent(e);
+}
+
+void %{APPNAME}UI::dragEnterEvent(QDragEnterEvent *event)
+{
+ // accept uri drops only
+ event->accept(KURLDrag::canDecode(event));
+}
+
+void %{APPNAME}UI::dropEvent(QDropEvent *event)
+{
+ KURL::List uri;
+ if (KURLDrag::decode(event, uri))
+ {
+ for (KURL::List::Iterator i = uri.begin(); i != uri.end(); ++i)
+ napp->player()->openFile(*i, false);
+ }
+}
+
+void %{APPNAME}UI::mouseReleaseEvent(QMouseEvent *e)
+{
+ QWidget::mouseReleaseEvent(e);
+ if (e->button()!=RightButton) return;
+ NoatunStdAction::ContextMenu::showContextMenu();
+}
+
+void %{APPNAME}UI::changeStatusbar(const QString& text, const QString &text2)
+{
+ if (!text2.isNull())
+ statusBar()->changeItem(text2, 1);
+
+ statusBar()->message(!text.isNull() ? text : napp->player()->current().title());
+}
+
+void %{APPNAME}UI::changeCaption(const QString& text)
+{
+ setCaption(text);
+}
+
+void %{APPNAME}UI::popup()
+{
+ NoatunStdAction::ContextMenu::showContextMenu(
+ mapToGlobal(mPopup->geometry().bottomLeft()) );
+}
+
+void %{APPNAME}UI::slotPlaying()
+{
+ changeStatusbar(napp->player()->current().title(), napp->player()->lengthString());
+ mPlay->setOn(true);
+ mStop->setEnabled(true);
+ mPlay->setPixmap(BarIcon("noatunpause"));
+}
+
+void %{APPNAME}UI::slotStopped()
+{
+ if (!napp->player()->current()) return;
+ changeStatusbar(i18n("No File Loaded"), napp->player()->lengthString());
+ mStop->setEnabled(false);
+ mPlay->setOn(false);
+ seeker()->setValue(0);
+ mPlay->setPixmap(BarIcon("noatunplay"));
+}
+
+void %{APPNAME}UI::slotPaused()
+{
+ mStop->setEnabled(true);
+ mPlay->setOn(false);
+ mPlay->setPixmap(BarIcon("noatunplay"));
+}
+
+void %{APPNAME}UI::slotTimeout()
+{
+ mVolume->setValue(napp->player()->volume());
+
+ if (!napp->player()->current()) return;
+ if (static_cast<L33tSlider*>(seeker())->currentlyPressed()) return;
+ if (seeker())
+ {
+ seeker()->setRange ( 0, (int)napp->player()->getLength()/1000 );
+ seeker()->setValue ( (int)napp->player()->getTime()/1000 );
+ }
+ changeStatusbar(0, napp->player()->lengthString());
+}
+
+void %{APPNAME}UI::sliderMoved(int seconds)
+{
+ if (napp->player()->current())
+ changeStatusbar(0, napp->player()->lengthString(seconds*1000));
+}
+
+void %{APPNAME}UI::skipToWrapper(int second)
+{
+ emit skipTo((long)(second*1000));
+}
+
+void %{APPNAME}UI::changeLoopType(int t)
+{
+ static const int time=2000;
+ switch (t)
+ {
+ case(Player::None):
+ statusBar()->message(i18n("No looping"), time);
+ mLoop->setPixmap(BarIcon("noatunloopnone"));
+ break;
+ case(Player::Song):
+ statusBar()->message(i18n("Song looping"), time);
+ mLoop->setPixmap(BarIcon("noatunloopsong"));
+ break;
+ case(Player::Playlist):
+ statusBar()->message(i18n("Playlist looping"), time);
+ mLoop->setPixmap(BarIcon("noatunloopplaylist"));
+ break;
+ case(Player::Random):
+ statusBar()->message(i18n("Random play"), time);
+ mLoop->setPixmap(BarIcon("noatunlooprandom"));
+ }
+}
+
+bool %{APPNAME}UI::eventFilter(QObject *o, QEvent *e)
+{
+ if ((e->type() == QEvent::MouseButtonRelease)
+ && ((static_cast<QMouseEvent*>(e))->button()==RightButton))
+ {
+ mouseReleaseEvent(static_cast<QMouseEvent*>(e));
+ return true;
+ }
+
+ if (e->type() == QEvent::Wheel)
+ {
+ wheelEvent(static_cast<QWheelEvent*>(e));
+ return true;
+ }
+ return QWidget::eventFilter(o, e);
+}
+
+void %{APPNAME}UI::playlistShown()
+{
+ mPlaylist->setOn(true);
+}
+
+void %{APPNAME}UI::playlistHidden()
+{
+ mPlaylist->setOn(false);
+}
+
+void %{APPNAME}UI::wheelEvent(QWheelEvent *e)
+{
+ int delta=e->delta();
+ mVolume->setValue(mVolume->value()+(delta/120));
+ napp->player()->setVolume(mVolume->value()+(delta/120));
+}
+
diff --git a/languages/cpp/app_templates/noatunui/plugin_impl.h b/languages/cpp/app_templates/noatunui/plugin_impl.h
new file mode 100644
index 00000000..970246d4
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/plugin_impl.h
@@ -0,0 +1,78 @@
+
+#ifndef %{APPNAMEUC}_IMPL_H
+#define %{APPNAMEUC}_IMPL_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <noatun/plugin.h>
+#include <noatun/app.h>
+
+// Pref dialog pointer global now for position saving
+#include <noatun/pref.h>
+
+class Player;
+class QSlider;
+class QPushButton;
+class KStatusBar;
+
+/**
+ * @short Main window class
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version 0.1
+ * Note: You can user _every_ widget for implementing your userinterface.
+ */
+class %{APPNAME}UI : public QWidget, public UserInterface
+{
+Q_OBJECT
+public:
+ %{APPNAME}UI();
+ virtual ~%{APPNAME}UI();
+ void load(const QString& url);
+
+protected:
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+ virtual void closeEvent(QCloseEvent*);
+ virtual void showEvent(QShowEvent*e);
+ /** RMB -> context menu */
+ virtual void mouseReleaseEvent(QMouseEvent *);
+ virtual bool eventFilter(QObject*, QEvent*);
+ /** volume control */
+ virtual void wheelEvent(QWheelEvent *e);
+
+protected:
+ QSlider *seeker() const { return mSeeker; }
+ KStatusBar *statusBar() const { return mStatusBar; }
+
+public slots:
+ void slotPlaying();
+ void slotStopped();
+ void slotPaused();
+
+ /** "show/hide playlist" button */
+ void playlistShown();
+ void playlistHidden();
+
+ void slotTimeout();
+ void sliderMoved(int seconds);
+ void changeLoopType(int t);
+ void skipToWrapper(int second);
+
+signals:
+ void skipTo( int ); // emitted by skipToWrapper()
+
+private slots:
+ void changeStatusbar(const QString& text, const QString &text2=0);
+ void changeCaption(const QString& text);
+ void popup();
+
+private:
+ QPushButton *mBack, *mStop, *mPlay, *mForward, *mPlaylist, *mPopup, *mLoop;
+ QSlider *mSeeker, *mVolume;
+ KStatusBar *mStatusBar;
+};
+
+#endif // %{APPNAMEUC}_IMPL_H
+
diff --git a/languages/cpp/app_templates/noatunui/src-Makefile.am b/languages/cpp/app_templates/noatunui/src-Makefile.am
new file mode 100644
index 00000000..95506569
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/src-Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = noatun_%{APPNAMELC}plugin.la
+
+noatun_%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp plugin_%{APPNAMELC}_impl.cpp
+noatun_%{APPNAMELC}plugin_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
+noatun_%{APPNAMELC}plugin_la_LIBADD = $(LIB_KFILE) -lnoatun -lnoatuncontrols \
+ -lqtmcop -lkmedia2_idl -lsoundserver_idl
+
+noinst_HEADERS = plugin_%{APPNAMELC}_impl.h
+
+# noatun_modules_uidir = $(kde_datadir)/noatun
+# noatun_modules_ui_DATA = %{APPNAMELC}.plugin
+
+pluginsdir = $(kde_datadir)/noatun
+plugins_DATA = %{APPNAMELC}.plugin
+
+# kde_services_DATA = %{APPNAMELC}.desktop
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/noatunui/subdirs b/languages/cpp/app_templates/noatunui/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/noatunui/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/noatunvisual/.kdev_ignore b/languages/cpp/app_templates/noatunvisual/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/.kdev_ignore
diff --git a/languages/cpp/app_templates/noatunvisual/Makefile.am b/languages/cpp/app_templates/noatunvisual/Makefile.am
new file mode 100644
index 00000000..0d6a43eb
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h plugin_impl.cpp \
+ plugin_impl.h noatunvisual.png plugin.plugin plugin.kdevelop \
+ subdirs noatunvisual-configure.in.in
+templateName = noatunvisual
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual b/languages/cpp/app_templates/noatunvisual/noatunvisual
new file mode 100644
index 00000000..e0d0f7e0
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/noatunvisual
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Name=Noatun visualization plugin
+Icon=noatunvisual.png
+Category=C++/KDE
+Comment=Generates a visualization plugin for noatun using SDL
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/plugin_APPNAMELC_impl.cpp
diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in b/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in
new file mode 100644
index 00000000..b973abe8
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/noatunvisual-configure.in.in
@@ -0,0 +1,36 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+KDE_CHECK_HEADERS([noatun/plugin.h])
+KDE_CHECK_LIB([noatun],main,
+ [LIB_NOAUTUN="-lnoautun"])
+AC_SUBST(LIB_NOAUTUN)
+
+KDE_FIND_PATH(sdl-config, LIBSDL_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
+ AC_MSG_WARN([Could not find libsdl anywhere, check http://www.sdl.org])
+])
+
+if test -n "$LIBSDL_CONFIG"; then
+ LIBSDL_LIBS="`$LIBSDL_CONFIG --libs`"
+ LIBSDL_RPATH=
+ for args in $LIBSDL_LIBS; do
+ case $args in
+ -L*)
+ LIBSDL_RPATH="$LIBSDL_RPATH $args"
+ ;;
+ esac
+ done
+ LIBSDL_RPATH=`echo $LIBSDL_RPATH | sed -e "s/-L/-R/g"`
+ LIBSDL_CFLAGS="`$LIBSDL_CONFIG --cflags`"
+
+ AC_DEFINE_UNQUOTED(HAVE_LIBSDL, 1, [Defines if your system has the LIBSDL library])
+fi
+
+
+AC_SUBST(LIBSDL_LIBS)
+AC_SUBST(LIBSDL_CFLAGS)
+AC_SUBST(LIBSDL_RPATH)
+
diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate b/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate
new file mode 100644
index 00000000..4c726194
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/noatunvisual.kdevtemplate
@@ -0,0 +1,205 @@
+# KDE Config File
+[General]
+Name=Noatun visualization plugin
+Name[ca]=Connector de visualització per a Noatun
+Name[da]=Noatun visualiserings-plugin
+Name[de]=Noatun-Visualisierungs-Modul
+Name[el]=Οπτικό πρόσθετο Noatun
+Name[en_GB]=Noatun visualisation plugin
+Name[es]=Complemento de visualización para Noatun
+Name[et]=Noatuni visualiseerimisplugin
+Name[eu]=Noatun bistaratze-plugina
+Name[fa]=وصلۀ تجسم Noatun
+Name[fr]=Module externe de visualisation pour Noatun
+Name[ga]=Breiseán amharcléirithe Noatun
+Name[gl]=Extensión de visualización para Noatun
+Name[hu]=Noatun vizualizációs modul
+Name[it]=Plugin di visualizzazione per noatun
+Name[ja]=Noatun ビジュアライゼーションプラグイン
+Name[nds]=Noatun-Filmmakermoduul
+Name[ne]=नोअटन भिजुलाइजेसन प्लगइन
+Name[nl]=Noatun visualisatieplugin
+Name[pl]=Wtyczka wizualizacji do Noatun
+Name[pt]='Plugin' de visualização do Noatun
+Name[pt_BR]='Plugin' de visualização do Noatun
+Name[ru]=Модуль визуализации Noatun
+Name[sk]=Noatun vizualizačný modul
+Name[sr]=Визуелизациони прикључак за Noatun
+Name[sr@Latn]=Vizuelizacioni priključak za Noatun
+Name[sv]=Noatun-insticksprogram för visningar
+Name[tr]=Noatun görsellik eklentisi
+Name[zh_CN]=Noatun 可视化插件
+Name[zh_TW]=Noatun 視覺化外掛程式
+Icon=noatunvisual.png
+Category=C++/KDE
+Comment=Generates a visualization plugin for noatun using SDL
+Comment[ca]=Genera un connector de visualització per a Noatun usant SDL
+Comment[da]=Generere et visualiserings-plugin for noatun ved brug af SDL
+Comment[de]=Erstellt ein Visualisierungs-Modul für Noatun unter Verwendung der SDL.
+Comment[el]=Δημιουργεί ένα οπτικό πρόσθετο για το noatun χρησιμοποιώντας το SDL
+Comment[en_GB]=Generates a visualisation plugin for noatun using SDL
+Comment[es]=Genera un complemento de visualización para Noatun que usa SDL
+Comment[et]=Noatuni visualiseerimisplugina loomine SDL-i abil
+Comment[eu]=SDL erabiliz, bistaratze-plugin bat sortzen du noatun-entzat
+Comment[fa]=یک وصلۀ تجسم برای noatun با استفاده از SDL تولید می‌کند
+Comment[fr]=Génère un module externe de visualisation pour Noatun utilisant SDL
+Comment[ga]=Cruthaíonn sé seo breiseán amharcléirithe noatun le SDL
+Comment[gl]=Xera unha extensión de visualización para noatun usando SDL
+Comment[hu]=Létrehoz egy vizualizációs modult a Noatunhoz, SDL-ben
+Comment[it]=Genera un plugin di visualizzazione per noatun usando SDL
+Comment[nds]=Stellt mit SDL en Filmmakermoduul för Noatun op
+Comment[ne]=SDL प्रयोग गरेर नोअटनका लागि भिजुलाइजेसन प्लगइन उत्पन्न गर्दछ
+Comment[nl]=Genereert een visualisatieplugin voor Noatun met behulp van SDL
+Comment[pl]=Generuje wtyczkę wizualizacji do Noatun. Używany jest SDL.
+Comment[pt]=Gera um 'plugin' de visualização para o Noatun, que usa o SDL
+Comment[pt_BR]=Gera um 'plugin' de visualização para o Noatun, que usa o SDL
+Comment[ru]=Создание модуля визуализации для Noatun на основе SDL
+Comment[sk]=Vygeneruje vizualizačný modul pre Noatun s použitím SDL
+Comment[sr]=Прави визуелизациони прикључак за Noatun користећи SDL
+Comment[sr@Latn]=Pravi vizuelizacioni priključak za Noatun koristeći SDL
+Comment[sv]=Skapar ett Noatun-insticksprogram för visningar som använder SDL
+Comment[tr]=SDL kullanarak noatun için bir görsellik eklentisi yaratır.
+Comment[zh_CN]=使用 SDL 生成 noatun 的可视化插件
+Comment[zh_TW]=產生一個使用 SDL 的 Noatun 視覺化外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp
+Archive=noatunvisual.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+Source=%{src}/plugin.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{src}/noatunvisual-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/plugin_app.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/plugin_app.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/plugin_impl.cpp
+Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.cpp
+
+[FILE15]
+Type=install
+Source=%{src}/plugin_impl.h
+Dest=%{dest}/src/plugin_%{APPNAMELC}_impl.h
+
+[FILE16]
+Type=install
+Source=%{src}/plugin.plugin
+Dest=%{dest}/src/%{APPNAMELC}.plugin
+
+[MSG]
+Type=message
+Comment=A Noatun visualization plugin was created in %{dest}
+Comment[ca]=Un connector de visualització per a Noatun ha estat creat en %{dest}
+Comment[da]=Et Noatun visualiserings-plugin blev oprettet i %{dest}
+Comment[de]=Ein Visualisierungs-Modul für Noatun wurde in %{dest} erstellt.
+Comment[el]=Ένα οπτικό πρόσθετο Noatun δημιουργήθηκε στο %{dest}
+Comment[en_GB]=A Noatun visualisation plugin was created in %{dest}
+Comment[es]=Un complemento de visualización para Noatun ha sido creado en %{dest}
+Comment[et]=Noatuni visualiseerimisplugin loodi asukohta %{dest}
+Comment[eu]=Noatun-en bistaratze-plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ تجسم Noatun در %{dest} ایجاد شد
+Comment[fr]=Un module externe de visualisation pour Noatun a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán amharcléirithe Noatun i %{dest}
+Comment[gl]=Creouse unha extensión de visualización para Noatun en %{dest}
+Comment[hu]=Létrejött egy Noatun vizualizációs modul itt: %{dest}
+Comment[it]=È stato creato un plugin di visualizzazione per noatun in %{dest}
+Comment[ja]=Noatun ビジュアライゼーションプラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Noatun-Filmmakermoduul opstellt
+Comment[ne]=नोअटन भिजुलाइजेसन प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Noatun-visualisatieplugin is aangemaakt in %{dest}
+Comment[pl]=Wtyczka wizualizacji została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' de visualização do Noatun em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' de visualização do Noatun em %{dest}
+Comment[ru]=Модуль визуализации Noatun создан в %{dest}
+Comment[sk]=Noatun vizualizačný modul bol vytvorený v %{dest}
+Comment[sr]=Визуелизациони прикључак за Noatun направљен је у %{dest}
+Comment[sr@Latn]=Vizuelizacioni priključak za Noatun napravljen je u %{dest}
+Comment[sv]=Ett Noatun-insticksprogram för visningar skapades i %{dest}
+Comment[tr]=Bir Noatun görsellik eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了 Noatun 可视化插件
+Comment[zh_TW]=一個 Noatun 視覺化外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/noatunvisual/noatunvisual.png b/languages/cpp/app_templates/noatunvisual/noatunvisual.png
new file mode 100644
index 00000000..4dcfce3d
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/noatunvisual.png
Binary files differ
diff --git a/languages/cpp/app_templates/noatunvisual/plugin.kdevelop b/languages/cpp/app_templates/noatunvisual/plugin.kdevelop
new file mode 100644
index 00000000..281d095e
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin.kdevelop
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+
+<kdevautoproject>
+ <general>
+ <activetarget>src/noatun_%{APPNAMELC}plugin.la</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ <configurations>
+ <default>
+ <ldflags>-lSDL</ldflags>
+ </default>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/noatunvisual/plugin.plugin b/languages/cpp/app_templates/noatunvisual/plugin.plugin
new file mode 100644
index 00000000..9dc32648
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin.plugin
@@ -0,0 +1,8 @@
+Filename=noatun_%{APPNAMELC}plugin.la
+Author=%{AUTHOR}
+Site=http://noatun.kde.org/
+Email=%{EMAIL}
+Type=visualization
+License=$LICENSE$
+Name=%{APPNAME}
+Comment=My scope visualization plugin
diff --git a/languages/cpp/app_templates/noatunvisual/plugin_app.cpp b/languages/cpp/app_templates/noatunvisual/plugin_app.cpp
new file mode 100644
index 00000000..442bdefd
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin_app.cpp
@@ -0,0 +1,58 @@
+
+#include <sys/wait.h>
+#include <sys/types.h>
+
+#include "plugin_%{APPNAMELC}.h"
+#include "plugin_%{APPNAMELC}_impl.h"
+
+#include <kglobal.h>
+#include <klocale.h>
+
+extern "C"
+{
+ Plugin *create_plugin()
+ {
+ KGlobal::locale()->insertCatalogue("%{APPNAMELC}");
+ return new %{APPNAME}Scope();
+ }
+}
+
+%{APPNAME}Scope::%{APPNAME}Scope()
+ : MonoScope(50), Plugin()
+{
+ setSamples(320);
+}
+
+%{APPNAME}Scope::~%{APPNAME}Scope()
+{
+ ::close(mOutFd);
+ wait(0);
+}
+
+void %{APPNAME}Scope::init()
+{
+ int pipes[2];
+ ::pipe(pipes);
+ mOutFd=pipes[1];
+ if (!fork())
+ {
+ ::close(pipes[1]);
+ new %{APPNAME}View(pipes[0]);
+ exit(0);
+ }
+ else
+ {
+ fcntl(mOutFd, F_SETFL, fcntl(mOutFd, F_GETFL) & ~O_NONBLOCK);
+ ::close(pipes[0]);
+ MonoScope::start();
+ }
+}
+
+void %{APPNAME}Scope::scopeEvent(float *d, int size)
+{
+ if (::write(mOutFd, (char *)d, size * sizeof(float))==-1)
+ {
+ MonoScope::stop();
+ unload();
+ }
+}
diff --git a/languages/cpp/app_templates/noatunvisual/plugin_app.h b/languages/cpp/app_templates/noatunvisual/plugin_app.h
new file mode 100644
index 00000000..a3cf91ea
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin_app.h
@@ -0,0 +1,36 @@
+
+/** Note: You only have to change plugin_%{APPNAMELC}_impl.[h,cpp] */
+
+#ifndef _PLUGIN_%{APPNAMEUC}_H_
+#define _PLUGIN_%{APPNAMEUC}_H_
+
+#include <noatun/plugin.h>
+#include <string.h>
+
+extern "C"
+{
+ #include <SDL.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+}
+
+class %{APPNAME}Scope : public MonoScope, public Plugin
+{
+NOATUNPLUGIND
+
+public:
+ %{APPNAME}Scope();
+ virtual ~%{APPNAME}Scope();
+
+ /** @short create a new child process (using fork) with %{APPNAME}View */
+ void init();
+
+protected:
+ virtual void scopeEvent(float *data, int bands);
+
+private:
+ int mOutFd;
+};
+
+#endif // _PLUGIN_%{APPNAMEUC}_H_
+
diff --git a/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp b/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp
new file mode 100644
index 00000000..a25f1fd2
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin_impl.cpp
@@ -0,0 +1,276 @@
+
+#include "plugin_%{APPNAMELC}_impl.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+extern "C"
+{
+ #include <SDL.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+}
+
+#if 0
+#define TEST() cout << "At line " << __LINE__ << endl
+#else
+#define TEST() if(0)
+#endif
+
+#define output ((unsigned char*)data)
+template <class Type>
+inline void Bitmap<Type>::addPixel(int x, int y, int br1, int br2)
+{
+ if (x < 0 || x >= width || y < 0 || y >= height) return;
+
+ register unsigned char *p = output+x*2+y*width*2;
+ if (p[0] < 255-br1) p[0] += br1; else p[0] = 255;
+ if (p[1] < 255-br2) p[1] += br2; else p[1] = 255;
+}
+
+template <class Type>
+void Bitmap<Type>::addVertLine(int x, int y1, int y2, int br1, int br2)
+{
+ if(y1 < y2)
+ {
+ for(int y = y1; y <= y2; y++)
+ addPixel(x,y, br1, br2);
+ }
+ else if(y2 < y1)
+ {
+ for(int y = y2; y <= y1; y++)
+ addPixel(x, y, br1, br2);
+ }
+ else
+ {
+ addPixel(x, y1, br1, br2);
+ }
+}
+
+template <class Type>
+void Bitmap<Type>::fadeStar()
+{
+ register unsigned long *ptr = (unsigned long*)output;
+ int i = width*height*2/4;
+ do
+ {
+ if (*ptr)
+ *(ptr++) -= ((*ptr & 0xf0f0f0f0ul) >> 4) + ((*ptr & 0xe0e0e0e0ul) >> 5);
+ else
+ ptr++;
+ } while(--i > 0);
+}
+
+%{APPNAME}View::%{APPNAME}View(int in) : mFd(in), outputBmp(0), fullscreen(false)
+{
+ surface = 0;
+ width = 320;
+ height = width*6/8;
+ outputBmp.size(width, height);
+ TEST();
+
+ TEST();
+ fcntl(mFd, F_SETFL, fcntl(mFd, F_GETFL) & ~O_NONBLOCK);
+ TEST();
+
+
+ float *data = new float[width];
+ TEST();
+
+ startVideo();
+ setupPalette();
+ TEST();
+
+ while(true)
+ {
+ checkInput();
+
+ if(!surface) exit(0);
+
+ int bytestoread = width * sizeof(float);
+ int pos = 0;
+ while(pos < bytestoread)
+ {
+ char *d = (char *)data;
+ int r = read(mFd, d + pos, bytestoread - pos);
+ if(r > 0) pos += r;
+ else if (r==0) exit(0);
+ }
+
+ outputBmp.fadeStar();
+ outputBmp.fadeStar();
+
+ float *d = data;
+ float *end = data + width;
+ float heightHalf = height / 4.0;
+ int y = height / 2;
+ int x=0;
+ int oldy=(int)(*d * heightHalf);
+ while(d <= end)
+ {
+ int amp = (int)(*d * heightHalf);
+ amp+=y;
+
+ outputBmp.addVertLine(x, oldy, amp, 255, 255);
+ oldy=amp;
+
+ d++;
+ x++;
+ }
+ repaint();
+ }
+}
+
+static SDL_Surface *CreateScreen(Uint16 w, Uint16 h, Uint8 bpp, Uint32 flags)
+{
+ SDL_Surface *screen;
+
+ // Set the video mode
+ screen = SDL_SetVideoMode(w, h, bpp, flags);
+ return screen;
+}
+
+void %{APPNAME}View::startVideo()
+{
+ if(surface)
+ {
+ SDL_FreeSurface(surface);
+ surface = 0;
+ }
+
+ Uint32 videoflags;
+
+ /* Initialize SDL */
+ if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
+ exit(0);
+
+ SDL_WM_SetCaption("%{APPNAME}","%{APPNAMELC}");
+
+ /* See if we try to get a hardware colormap */
+ videoflags = SDL_SWSURFACE | (fullscreen?SDL_FULLSCREEN:0);
+
+ surface = CreateScreen(width, height, 8, videoflags);
+ if (!surface)
+ exit(0);
+
+ SDL_ShowCursor(0);
+
+ if(!surface)
+ SDL_Quit();
+
+ SDL_WM_SetCaption("%{APPNAME}", 0);
+ SDL_ShowCursor(0);
+
+}
+
+void %{APPNAME}View::setupPalette(double)
+{
+#define BOUND(x) ((x) > 255 ? 255 : (x))
+#define PEAKIFY(x) int(BOUND((x) - (x)*(255-(x))/255/2))
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+
+ int redMax=136;
+ int greenMax=136;
+ int blueMax=255;
+
+ SDL_Color sdlPalette[256];
+
+ for(int i=0;i<256;i++)
+ {
+ // i
+ // 255 136
+ sdlPalette[i].r = i*redMax/255;
+ sdlPalette[i].g = i*greenMax/255;
+ sdlPalette[i].b = i*blueMax/255;
+ }
+
+ SDL_SetColors(surface, sdlPalette, 0, 256);
+
+#undef BOUND
+#undef PEAKIFY
+#undef MAX
+}
+
+void %{APPNAME}View::checkInput()
+{
+ SDL_Event myEvent;
+
+ while(SDL_PollEvent(&myEvent))
+ {
+ switch(myEvent.type)
+ {
+ case SDL_KEYDOWN:
+ switch(myEvent.key.keysym.sym)
+ {
+ case SDLK_SPACE:
+// fullscreen ^= true;
+// startVideo();
+ break;
+ default:
+ break;
+ }
+ break;
+
+ case SDL_QUIT:
+ exit(0);
+ break;
+ }
+ }
+}
+
+#define output2 ((unsigned char*)outputBmp.data)
+
+void %{APPNAME}View::repaint()
+{
+ SDL_LockSurface(surface);
+ TEST();
+
+ register unsigned long *ptr2 = (unsigned long*)output2;
+ unsigned long *ptr1 = (unsigned long*)( surface->pixels );
+ int i = width*height/4;
+ TEST();
+
+ do {
+ // Asger Alstrup Nielsen's (alstrup@diku.dk)
+ // optimized 32 bit screen loop
+ register unsigned int const r1 = *(ptr2++);
+ register unsigned int const r2 = *(ptr2++);
+
+ //if (r1 || r2) {
+#ifdef LITTLEENDIAN
+ register unsigned int const v =
+ ((r1 & 0x000000f0ul) >> 4)
+ | ((r1 & 0x0000f000ul) >> 8)
+ | ((r1 & 0x00f00000ul) >> 12)
+ | ((r1 & 0xf0000000ul) >> 16);
+ *(ptr1++) = v |
+ ( ((r2 & 0x000000f0ul) << 12)
+ | ((r2 & 0x0000f000ul) << 8)
+ | ((r2 & 0x00f00000ul) << 4)
+ | ((r2 & 0xf0000000ul)));
+#else
+ register unsigned int const v =
+ ((r2 & 0x000000f0ul) >> 4)
+ | ((r2 & 0x0000f000ul) >> 8)
+ | ((r2 & 0x00f00000ul) >> 12)
+ | ((r2 & 0xf0000000ul) >> 16);
+ *(ptr1++) = v |
+ ( ((r1 & 0x000000f0ul) << 12)
+ | ((r1 & 0x0000f000ul) << 8)
+ | ((r1 & 0x00f00000ul) << 4)
+ | ((r1 & 0xf0000000ul)));
+#endif
+ //} else ptr1++;
+ } while (--i);
+ TEST();
+
+ SDL_UnlockSurface(surface);
+ SDL_UpdateRect(surface, 0, 0, 0, 0);
+ TEST();
+
+}
+
+%{APPNAME}View::~%{APPNAME}View()
+{
+ ::close(mFd);
+}
diff --git a/languages/cpp/app_templates/noatunvisual/plugin_impl.h b/languages/cpp/app_templates/noatunvisual/plugin_impl.h
new file mode 100644
index 00000000..2a7de7b1
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/plugin_impl.h
@@ -0,0 +1,77 @@
+
+#ifndef %{APPNAMEUC}_IMPL_H
+#define %{APPNAMEUC}_IMPL_H
+
+struct SDL_Surface;
+
+/**
+ * @short This class is used for painting and supports some effects.
+ * Note: This is used in Blurscope. Feel free to remove this and
+ * implement your own drawing routines!
+ */
+template<class Pixel> class Bitmap
+{
+public:
+ int width, height, extra;
+ Pixel *data;
+
+ Bitmap(int e=0) : extra(e), data(0) { }
+ ~Bitmap() { delete[] data; }
+
+ inline void addPixel(int x, int y, int bright1, int bright2);
+ void addVertLine(int x, int y, int y2, int br1, int br2);
+
+ void fadeStar();
+
+ void size(int w,int h)
+ {
+ delete[] data;
+ width = w;
+ height = h;
+ data = new Pixel[w*h+extra];
+ clear();
+ }
+
+ void clear()
+ {
+ memset(data,0,sizeof(Pixel)*(width*height+extra));
+ }
+};
+
+/**
+ * @short This class does:
+ * o set up view
+ * o drawing routines.
+ */
+class %{APPNAME}View
+{
+public:
+ %{APPNAME}View(int in);
+ ~%{APPNAME}View();
+
+protected:
+ /** Screen initialization with SDL. Note, that you can initialize OpenGL with SDL! */
+ void startVideo();
+ /** SDL event queue */
+ void checkInput();
+ /** Used in Blurscope. Feel free to implement your own drawing routines! */
+ void setupPalette(double dummy=0.0);
+
+ /** Draw everything. */
+ void repaint();
+
+private:
+ /** used for pipelining */
+ int mFd;
+
+ /** SDL screen surface */
+ SDL_Surface *surface;
+ Bitmap<unsigned short> outputBmp;
+
+ bool fullscreen;
+ int width;
+ int height;
+};
+
+#endif // %{APPNAMEUC}_IMPL_H
+
diff --git a/languages/cpp/app_templates/noatunvisual/src-Makefile.am b/languages/cpp/app_templates/noatunvisual/src-Makefile.am
new file mode 100644
index 00000000..207fd8a8
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/src-Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES= $(all_includes)
+METASOURCES = AUTO
+
+# Install this plugin in the KDE modules directory
+kde_module_LTLIBRARIES = noatun_%{APPNAMELC}plugin.la
+
+noatun_%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp plugin_%{APPNAMELC}_impl.cpp
+noatun_%{APPNAMELC}plugin_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined $(LIBSDL_RPATH)
+noatun_%{APPNAMELC}plugin_la_CXXFLAGS = $(LIBSDL_CFLAGS)
+noatun_%{APPNAMELC}plugin_la_LIBADD = $(LIB_KFILE) $(LIBSDL_LIBS) -lnoatun -lm
+
+pluginsdir = $(kde_datadir)/noatun
+plugins_DATA = %{APPNAMELC}.plugin
+
+# kde_services_DATA = %{APPNAMELC}.desktop
+
+messages: rc.cpp
+ $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
+ $(XGETTEXT) *.cpp *.h -o $(podir)/%{APPNAMELC}.pot
diff --git a/languages/cpp/app_templates/noatunvisual/subdirs b/languages/cpp/app_templates/noatunvisual/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/cpp/app_templates/noatunvisual/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/cpp/app_templates/opieapp/.kdev_ignore b/languages/cpp/app_templates/opieapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/opieapp/Example.png b/languages/cpp/app_templates/opieapp/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieapp/Makefile.am b/languages/cpp/app_templates/opieapp/Makefile.am
new file mode 100644
index 00000000..643a1c29
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = Example.png app.kdevelop example.desktop Makefile.am \
+ app.pro example.cpp example.h examplebase.ui
+
+templateName = opieapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opieapp/app.kdevelop b/languages/cpp/app_templates/opieapp/app.kdevelop
new file mode 100644
index 00000000..69b6f2bc
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/app.kdevelop
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>true</quick_app>
+ </opie>
+ <packaging>
+ <template>0</template>
+ <appcategory>Applications</appcategory>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/application</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>task-opie-minimal</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opieapp/app.pro b/languages/cpp/app_templates/opieapp/app.pro
new file mode 100644
index 00000000..f4111696
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/app.pro
@@ -0,0 +1,38 @@
+TEMPLATE = quick-template
+CONFIG = qt qtopia warn_on release zecke-libqpe zecke-libopie
+HEADERS = %{APPNAMELC}.h
+SOURCES = %{APPNAMELC}.cpp
+INTERFACES = %{APPNAMELC}base.ui
+TARGET = %{APPNAMELC}
+
+QMAKE_LIBDIR = $(OPIEDIR)/lib
+OPIE-SPEC=6
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+zecke-libqpe {
+ INCLUDEPATH += $(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $(OPIEDIR)/include
+ DEPENDPATH += $(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opieapp/example.cpp b/languages/cpp/app_templates/opieapp/example.cpp
new file mode 100644
index 00000000..84f3f9d5
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/example.cpp
@@ -0,0 +1,32 @@
+#include "%{APPNAMELC}.h"
+#include <qpushbutton.h>
+#include <opie/oapplicationfactory.h>
+
+typedef OApplicationFactory<%{APPNAME}> %{APPNAME}Factory;
+OPIE_EXPORT_APP( %{APPNAME}Factory )
+
+/*
+ * Constructs a %{APPNAME} which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+%{APPNAME}::%{APPNAME}( QWidget* parent, const char* name, WFlags fl )
+ : %{APPNAME}Base( parent, name, fl )
+{
+ connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+%{APPNAME}::~%{APPNAME}()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * A simple slot... not very interesting.
+ */
+void %{APPNAME}::goodBye()
+{
+ close();
+}
diff --git a/languages/cpp/app_templates/opieapp/example.desktop b/languages/cpp/app_templates/opieapp/example.desktop
new file mode 100644
index 00000000..f6f04194
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/example.desktop
@@ -0,0 +1,37 @@
+[Desktop Entry]
+Comment=An %{APPNAME} Program
+Comment[ca]=Un programa per a %{APPNAME}
+Comment[da]=Et %{APPNAME} program
+Comment[de]=Ein %{APPNAME}-Program
+Comment[el]=Ένα πρόγραμμα %{APPNAME}
+Comment[es]=Un programa %{APPNAME}
+Comment[et]=%{APPNAME} programm
+Comment[eu]=%{APPNAME} programa bat
+Comment[fa]=برنامۀ %{APPNAME}
+Comment[fr]=Un programme %{APPNAME}
+Comment[ga]=Clár %{APPNAME}
+Comment[gl]=Un programa %{APPNAME}
+Comment[hu]=%{APPNAME} program
+Comment[it]=Un programma per %{APPNAME}
+Comment[ja]=%{APPNAME} プログラム
+Comment[nds]=En %{APPNAME}-Programm
+Comment[ne]= %{APPNAME} कार्यक्रम
+Comment[nl]=Een %{APPNAME} programma
+Comment[pl]=Program %{APPNAME}
+Comment[pt]=Um Programa %{APPNAME}
+Comment[pt_BR]=Um Programa %{APPNAME}
+Comment[ru]=Программа %{APPNAME}
+Comment[sk]=%{APPNAME} program
+Comment[sl]=Program %{APPNAME}
+Comment[sr]=%{APPNAME} програм
+Comment[sr@Latn]=%{APPNAME} program
+Comment[sv]=Ett %{APPNAME}-program
+Comment[ta]=ஒரு %{APPNAME} நிரல்
+Comment[tg]=Барномаи %{APPNAME}
+Comment[tr]=Bir %{APPNAME} Programı
+Comment[zh_CN]=一个 %{APPNAME} 程序
+Comment[zh_TW]=一個 %{APPNAME} 程式
+Exec=%{APPNAMELC}
+Icon=%{APPNAME}
+Type=Application
+Name=%{APPNAME}
diff --git a/languages/cpp/app_templates/opieapp/example.h b/languages/cpp/app_templates/opieapp/example.h
new file mode 100644
index 00000000..1ba8ead7
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/example.h
@@ -0,0 +1,20 @@
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+#include "%{APPNAMELC}base.h"
+
+class %{APPNAME} : public %{APPNAME}Base
+{
+ Q_OBJECT
+
+public:
+ static QString appName() {
+ return QString::fromLatin1("%{APPNAMELC}" );
+ }
+ %{APPNAME}( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~%{APPNAME}();
+
+private slots:
+ void goodBye();
+};
+
+#endif // %{APPNAMEUC}_H
diff --git a/languages/cpp/app_templates/opieapp/examplebase.ui b/languages/cpp/app_templates/opieapp/examplebase.ui
new file mode 100644
index 00000000..b6b81b11
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/examplebase.ui
@@ -0,0 +1,49 @@
+<!DOCTYPE UI><UI>
+<class>%{APPNAME}Base</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>%{APPNAME}Base</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>196</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>%{APPNAME}</string>
+ </property>
+ <vbox>
+
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&lt;p&gt;This is just an &lt;i&gt;%{APPNAMELC}&lt;/i&gt;; it does not do anything interesting at all.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>quit</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Quit</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate b/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate
new file mode 100644
index 00000000..622ec9a6
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/opieapp.kdevtemplate
@@ -0,0 +1,149 @@
+# KDE Config File
+[General]
+Name=Opie Application
+Name[br]=Meziant Opie
+Name[ca]=Aplicació per a Opie
+Name[da]=Opie-program
+Name[de]=Opie-Anwendung
+Name[el]=Εφαρμογή Opie
+Name[es]=Aplicación para Opie
+Name[et]=Opie rakendus
+Name[eu]=Opie aplikazioa
+Name[fa]=کاربرد Opie
+Name[fr]=Application Opie
+Name[ga]=Feidhmchlár Opie
+Name[gl]=Aplicación Opie
+Name[hu]=Opie-alkalmazás
+Name[it]=Applicazione Opie
+Name[ja]=Opie アプリケーション
+Name[nds]=Opie-Programm
+Name[ne]=ओपिइ अनुप्रयोग
+Name[nl]=Opie-toepassing
+Name[pl]=Program Opie
+Name[pt]=Aplicação do Opie
+Name[pt_BR]=Aplicação do Opie
+Name[ru]=Приложение Opie
+Name[sk]=Apie aplikácia
+Name[sl]=Program za Opie
+Name[sr]=Opie програм
+Name[sr@Latn]=Opie program
+Name[sv]=Opie-program
+Name[tr]=Opie Uygulaması
+Name[zh_CN]=Opie 应用程序
+Name[zh_TW]=Opie 應用程式
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie application.
+Comment[ca]=Genera una aplicació per a Opie.
+Comment[da]=Generér et Opie-program.
+Comment[de]=Erstellt eine Opie-Anwendung
+Comment[el]=Δημιουργία μιας εφαρμογής Opie.
+Comment[es]=Genera una aplicación para Opie.
+Comment[et]=Opie rakenduse loomine.
+Comment[eu]=Sortu Opie aplikazio bat.
+Comment[fa]=یک کاربرد Opie تولید می‌کند.
+Comment[fr]=Génère une application Opie.
+Comment[ga]=Cruthaigh feidhmchlár Opie.
+Comment[hu]=Létrehoz egy Opie-alkalmazást.
+Comment[it]=Genera un'applicazione Opie.
+Comment[ja]=Opie アプリケーションを作成
+Comment[nds]=Stellt en Opie-Programm op.
+Comment[ne]=ओपिइ अनुप्रयोग उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Opie-toepassing
+Comment[pl]=Generuje program Opie.
+Comment[pt]=Gera uma aplicação do Opie.
+Comment[pt_BR]=Gera uma aplicação do Opie.
+Comment[ru]=Создание приложение Opie.
+Comment[sk]=Vygeneruje Opie aplikáciu.
+Comment[sl]=Ustvari program za Opie
+Comment[sr]=Прави Opie програм.
+Comment[sr@Latn]=Pravi Opie program.
+Comment[sv]=Skapa ett Opie-program.
+Comment[tr]=Bir Opie uygulaması yarat
+Comment[zh_CN]=生成一个 Opie 应用程序。
+Comment[zh_TW]=產生一個 Opie 應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opieapp.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/example.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/example.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[FILE6]
+Type=install
+Source=%{src}/examplebase.ui
+Dest=%{dest}/%{APPNAMELC}base.ui
+
+[MkDir2]
+Type=mkdir
+Dir=%{dest}/apps
+
+[FILE7]
+Type=install
+Source=%{src}/example.desktop
+Dest=%{dest}/apps/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=An opie application was created in %{dest}
+Comment[ca]=Una aplicació per a Opie ha estat creada en %{dest}
+Comment[da]=Et opie-program blev oprettet i %{dest}
+Comment[de]=Eine Opie-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή opie δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para Opie ha sido creada en %{dest}
+Comment[et]=Opie rakendus loodi asukohta %{dest}
+Comment[eu]=Opie aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد opie در %{dest} ایجاد شد
+Comment[fr]=Une application Opie a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár opie i %{dest}
+Comment[gl]=Creouse unha aplicación opie en %{dest}
+Comment[hu]=Létrejött egy Opie-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Opie in %{dest}
+Comment[ja]=Opie アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Opie-Programm opstellt
+Comment[ne]=ओपिइ अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program Opie został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Opie em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Opie em %{dest}
+Comment[ru]=Приложение Opie создано в %{dest}
+Comment[sk]=Opie aplikácia bola vytvorená v %{dest}
+Comment[sl]=Program za opie je bil ustvarjen v %{dest}
+Comment[sr]=Opie програм је направљен у %{dest}
+Comment[sr@Latn]=Opie program je napravljen u %{dest}
+Comment[sv]=Ett Opie-program skapades i %{dest}
+Comment[tr]=Bir opie uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 应用程序
+Comment[zh_TW]=一個 opie 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/opieapp/opieapp.png b/languages/cpp/app_templates/opieapp/opieapp.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opieapp/opieapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieapplet/.kdev_ignore b/languages/cpp/app_templates/opieapplet/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/.kdev_ignore
diff --git a/languages/cpp/app_templates/opieapplet/Example.png b/languages/cpp/app_templates/opieapplet/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieapplet/Makefile.am b/languages/cpp/app_templates/opieapplet/Makefile.am
new file mode 100644
index 00000000..8faf4e32
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = Makefile.am Example.png app.kdevelop app.pro \
+ simpleimpl.cpp simpleimpl.h
+
+templateName = opieapplet
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opieapplet/app.kdevelop b/languages/cpp/app_templates/opieapplet/app.kdevelop
new file mode 100644
index 00000000..eee2c55a
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/app.kdevelop
@@ -0,0 +1,158 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>true</quick_app>
+ </opie>
+ <packaging>
+ <template>2</template>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/applets</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>task-opie-minimal</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ <scripts>
+ <post>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()"
+else
+ exit 0
+fi
+</post>
+ <post_rem>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()"
+else
+ exit 0
+fi
+</post_rem>
+ </scripts>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opieapplet/app.pro b/languages/cpp/app_templates/opieapplet/app.pro
new file mode 100644
index 00000000..e1cc1e3b
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/app.pro
@@ -0,0 +1,38 @@
+TEMPLATE = lib
+CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-applet
+HEADERS = %{APPNAMELC}.h
+SOURCES = %{APPNAMELC}.cpp
+TARGET = %{APPNAMELC}
+
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+QMAKE_LIBDIR= $$(OPIEDIR)/lib
+OPIE-SPEC=6
+
+zecke-libqpe {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $$(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ DEPENDPATH += $$(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate b/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate
new file mode 100644
index 00000000..7be33a95
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/opieapplet.kdevtemplate
@@ -0,0 +1,135 @@
+# KDE Config File
+[General]
+Name=Opie Applet
+Name[br]=Arloadig Opie
+Name[ca]=Miniaplicació per a Opie
+Name[da]=Opie-applet
+Name[de]=Opie-Miniprogramm (Applet)
+Name[el]=Μικροεφαρμογή Opie
+Name[es]=Applet para Opie
+Name[et]=Opie aplett
+Name[eu]=Opie applet-a
+Name[fa]=برنامک Opie
+Name[fr]=Applet Opie
+Name[ga]=Feidhmchláirín Opie
+Name[gl]=Applet Opie
+Name[hu]=Opie-s kisalkalmazás
+Name[it]=Applet Opie
+Name[ja]=Opie アプレット
+Name[nds]=Opie-Lüttprogramm
+Name[ne]=ओपिइ एप्लेट
+Name[nl]=Opie-applet
+Name[pl]=Aplet Opie
+Name[pt]='Applet' do Opie
+Name[pt_BR]='Applet' do Opie
+Name[ru]=Аплет Opie
+Name[sk]=Opie applet
+Name[sl]=Vstavek za Opie
+Name[sr]=Opie аплет
+Name[sr@Latn]=Opie aplet
+Name[sv]=Opie-miniprogram
+Name[tr]=Opie Küçük Uygulaması
+Name[zh_CN]=Opie 小程序
+Name[zh_TW]=Opie 小程式
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie applet.
+Comment[ca]=Genera una miniaplicació per a Opie.
+Comment[da]=Generér en Opie-applet.
+Comment[de]=Erstellt ein Opie-Miniprogramm (Applet).
+Comment[el]=Δημιουργία μίας μικροεφαρμογής Opie.
+Comment[es]=Genera un applet para Opie.
+Comment[et]=Opie apleti loomine.
+Comment[eu]=Sortu Opie applet bat.
+Comment[fa]=یک برنامک Opie تولید می‌کند.
+Comment[fr]=Génère un applet Opie.
+Comment[ga]=Cruthaigh feidhmchláirín Opie.
+Comment[gl]=Xera un applet Opie.
+Comment[hu]=Létrehoz egy Opie-s kisalkalmazást.
+Comment[it]=Genera un'applet Opie.
+Comment[ja]=Opie アプレットを作成
+Comment[nds]=Stellt en Opie-Lüttprogramm op.
+Comment[ne]=ओपिइ एप्लेट उत्पन्न गर्दछ
+Comment[nl]=Genereert een Opie-applet.
+Comment[pl]=Generuje aplet Opie
+Comment[pt]=Gera uma 'applet' do Opie.
+Comment[pt_BR]=Gera uma 'applet' do Opie.
+Comment[ru]=Создание аплета Opie.
+Comment[sk]=Vygeneruje Opie applet.
+Comment[sl]=Ustvari vstavek za Opie.
+Comment[sr]=Прави Opie аплет.
+Comment[sr@Latn]=Pravi Opie aplet.
+Comment[sv]=Skapa ett Opie-miniprogram.
+Comment[zh_CN]=生成一个 Opie 小程序。
+Comment[zh_TW]=產生一個 Opie 小程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opieapplet.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/simpleimpl.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/simpleimpl.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[MSG]
+Type=message
+Comment=An opie applet was created in %{dest}
+Comment[ca]=Una miniaplicació per a Opie ha estat creat en %{dest}
+Comment[da]=En opie-applet blev oprettet i %{dest}
+Comment[de]=Ein Opie-Miniprogramm (Applet) wurde in %{dest} erstellt.
+Comment[el]=Μία μικροεφαρμογή opie δημιουργήθηκε στο %{dest}
+Comment[es]=Un applet para Opie ha sido creado en %{dest}
+Comment[et]=Opie aplett loodi asukohta %{dest}
+Comment[eu]=Opie applet bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامک opie در %{dest} ایجاد شد
+Comment[fr]=Un applet Opie a été créé dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchláirín opie i %{dest}
+Comment[gl]=Creouse un applet opie en %{dset}
+Comment[hu]=Létrejött egy Opie-s kisalkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applet Opie in %{dest}
+Comment[ja]=Opie アプレットを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Opie-Lüttprogramm opstellt
+Comment[ne]=ओपिइ एप्लेट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie-applet is aangemaakt in %{dest}
+Comment[pl]=Aplet Opie został utworzony w %{dest}
+Comment[pt]=Foi criada uma 'applet' do Opie em %{dest}
+Comment[pt_BR]=Foi criada uma 'applet' do Opie em %{dest}
+Comment[ru]=Аплет Opie создан в %{dest}
+Comment[sk]=Opie applet bol vytvorený v %{dest}
+Comment[sl]=Vstavek za opie je bil ustvarjen v %{dest}
+Comment[sr]=Opie аплет је направљен у %{dest}
+Comment[sr@Latn]=Opie aplet je napravljen u %{dest}
+Comment[sv]=Ett Opie-miniprogram skapades i %{dest}
+Comment[tr]=Bir Opie küçük uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 小程序
+Comment[zh_TW]=一個 Opie 小程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/opieapplet/opieapplet.png b/languages/cpp/app_templates/opieapplet/opieapplet.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/opieapplet.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieapplet/simpleimpl.cpp b/languages/cpp/app_templates/opieapplet/simpleimpl.cpp
new file mode 100644
index 00000000..1474a0e4
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/simpleimpl.cpp
@@ -0,0 +1,162 @@
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qmessagebox.h>
+
+#include <qpe/applnk.h> // for AppLnk
+#include <qpe/resource.h> // for Resource loading
+
+#include "%{APPNAMELC}.h"
+
+
+%{APPNAME}::%{APPNAME}(QWidget *parent)
+ : QWidget( parent, "%{APPNAME} Applet" ) {
+/*
+ * we will load an Image, scale it for the right usage
+ * remember your applet might be used by different
+ * resolutions.
+ * Then we will convert the image back to an Pixmap
+ * and draw this Pimxap. We need to use Image because its
+ * the only class that allows scaling.
+ */
+
+ QImage image = Resource::loadImage("%{APPNAMELC}/%{APPNAMELC}");
+ /*
+ * smooth scale to AppLnk smallIconSize for applest
+ * smallIconSize gets adjusted to the resolution
+ * so on some displays like SIMpad and a C-750 the smallIconSize
+ * is greater than on a iPAQ h3870
+ */
+ image = image.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize() );
+
+ /*
+ * now we need to convert the Image to a Pixmap cause these
+ * can be drawn more easily
+ */
+ m_pix = new QPixmap();
+ m_pix->convertFromImage( image );
+
+ /*
+ * Now we will say that we don't want to be bigger than our
+ * Pixmap
+ */
+ setFixedHeight(AppLnk::smallIconSize() );
+ setFixedWidth( AppLnk::smallIconSize() );
+
+}
+
+%{APPNAME}::~%{APPNAME}() {
+ delete m_pix;
+}
+
+
+/*
+ * here you would normal show or do something
+ * useful. If you want to show a widget at the top left
+ * of your icon you need to map your rect().topLeft() to
+ * global with mapToGlobal(). Then you might also need to
+ * move the widgets so it is visible
+ */
+void %{APPNAME}::mousePressEvent(QMouseEvent* ) {
+ QMessageBox::information(this, tr("No action taken"),
+ tr("<qt>This Plugin does not yet support anything usefule aye.</qt>"),
+ QMessageBox::Ok );
+
+}
+
+void %{APPNAME}::paintEvent( QPaintEvent* ) {
+ QPainter p(this);
+
+ /* simpy draw the pixmap from the start of this widget */
+ p.drawPixmap(0, 0, *m_pix );
+}
+
+/*
+ * Here comes the implementation of the interface
+ */
+%{APPNAME}Impl::%{APPNAME}Impl() {
+}
+/* needed cause until it is only pure virtual */
+%{APPNAME}Impl::~%{APPNAME}Impl() {
+ /*
+ * we will delete our applets as well
+ * setAUtoDelete makes the QList free
+ * the objects behind the pointers
+ */
+ m_applets.setAutoDelete( true );
+ m_applets.clear();
+}
+
+/*
+ * For the taskbar interface return a Widget
+ */
+QWidget* %{APPNAME}Impl::applet( QWidget* parent ) {
+ /*
+ * There are problems with ownership. So we add
+ * our ownlist and clear this;
+ */
+ %{APPNAME}* ap = new %{APPNAME}( parent );
+ m_applets.append( ap );
+
+ return ap;
+}
+
+/*
+ * A small hint where the Applet Should be displayed
+ */
+int %{APPNAME}Impl::position()const {
+ return 1;
+}
+
+
+/*
+ * Now the important QUnkownInterface method without
+ * this one your applet won't load
+ * @param uuid The uuid of the interface
+ * @param iface The pointer to the interface ptr
+ */
+QRESULT %{APPNAME}Impl::queryInterface( const QUuid& uuid, QUnknownInterface** iface) {
+ /* set the pointer to the interface to 0 */
+ *iface = 0;
+
+ /*
+ * we check if we support the requested interface
+ * and then assign to the pointer.
+ * You may alos create another interface here so
+ * *iface = this is only in this simple case true you
+ * could also support more interfaces.
+ * But this example below is the most common use.
+ * Now the caller knows that the Interface Pointer
+ * is valid and the interface supported
+ */
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_TaskbarApplet )
+ *iface = this;
+ else
+ return QS_FALSE;
+
+ if ( *iface )
+ (*iface)->addRef();
+
+ return QS_OK;
+}
+
+
+/*
+ * Finally we need to export the Interface.
+ * CREATE_INSTANCE creates a interface and calls
+ * queryInterface for the QUnknownInterface once
+ * With out this function the applet can't be loaded.
+ *
+ * NOTE: If your applet does not load it's likely you've an
+ * unresolved symbol. Change the .pro TEMPLATE = lib to TEMPLATE= app
+ * and recompile. If the linker only complains about a missing
+ * main method the problem is more complex. In most cases it'll say
+ * you which symbols are missing and you can implement them.
+ * The main(int argc, char* argv[] ) does not need to be
+ * included in a library so it's ok that the linker complains
+ */
+Q_EXPORT_INTERFACE() {
+ Q_CREATE_INSTANCE( %{APPNAME}Impl )
+}
+
diff --git a/languages/cpp/app_templates/opieapplet/simpleimpl.h b/languages/cpp/app_templates/opieapplet/simpleimpl.h
new file mode 100644
index 00000000..19475367
--- /dev/null
+++ b/languages/cpp/app_templates/opieapplet/simpleimpl.h
@@ -0,0 +1,75 @@
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+
+/**
+ * Opie and Qtopia uses a component system called QCOM
+ * which was first part of the Qt 3.0 API but was made
+ * prviate during the betas. Opie and Qtopia still use it
+ * and we're happy with it.
+ * Every starts with the QUnknownInterface. It supports functions
+ * for reference counting and the most important one
+ * is for a query. Every QCOM interface got a global unique id ( GUID,UUID )
+ * query is used to see if a interface is supported by
+ * a dynamic shared object ( dso / plugin )
+ * For tasks like loading Applications, InputMethods, Today, MenuButton,
+ * Taskbar, Style, Email Client there are specefic Interfaces you
+ * need to implement. The interfaces inherits from QUnknownInterface and
+ * you'll need inherit from the interface.
+ * As example we will use the Taskbar interface
+ */
+
+
+/*
+ * The taskbar applet interfaces wants us to implement position() and applet()
+ * additionally we need to implement add(), release() and queryInterface for QUnknownInterface
+ * luckiy there is a macro for the reference counting
+ * We provide an Implementation of the interface.
+ */
+#include <qwidget.h>
+#include <qptrlist.h>
+
+#include <qpe/taskbarappletinterface.h>
+
+
+/*
+ * Because we only draw an Icon in a fixed width and height
+ * we declare and define %{APPNAME} here and you could use QLabel
+ * setPixmap or use QWidget and draw yourself.
+ * You might also want to reimplement mouse*Event to use some simple actions
+ */
+class %{APPNAME} : public QWidget {
+ Q_OBJECT
+public:
+ %{APPNAME}(QWidget *parent);
+ ~%{APPNAME}();
+private:
+ void mousePressEvent( QMouseEvent* );
+ void paintEvent( QPaintEvent* );
+ QPixmap *m_pix;
+};
+
+class %{APPNAME}Impl : public TaskbarAppletInterface {
+public:
+
+ %{APPNAME}Impl();
+ virtual ~%{APPNAME}Impl();
+
+ QRESULT queryInterface( const QUuid&, QUnknownInterface** );
+
+ QWidget *applet( QWidget* parent );
+ int position()const;
+
+ /*
+ * macro for reference countint
+ * if reference drops to zero
+ * delete this is called
+ */
+ Q_REFCOUNT
+
+private:
+ QList<%{APPNAME}> m_applets;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/opieinput/.kdev_ignore b/languages/cpp/app_templates/opieinput/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/.kdev_ignore
diff --git a/languages/cpp/app_templates/opieinput/Example.png b/languages/cpp/app_templates/opieinput/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieinput/Makefile.am b/languages/cpp/app_templates/opieinput/Makefile.am
new file mode 100644
index 00000000..d748092c
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = Makefile.am Example.png app.kdevelop app.pro \
+ simpleimpl.cpp simpleimpl.h
+templateName = opieinput
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opieinput/app.kdevelop b/languages/cpp/app_templates/opieinput/app.kdevelop
new file mode 100644
index 00000000..639a3215
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/app.kdevelop
@@ -0,0 +1,159 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>false</quick_app>
+ </opie>
+ <packaging>
+ <template>3</template>
+ <custom_dest>plugins/inputmethods</custom_dest>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/inputmethods</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>task-opie-minimal</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ <scripts>
+ <post>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()"
+else
+ exit 0
+fi
+</post>
+ <post_rem>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()"
+else
+ exit 0
+fi
+</post_rem>
+ </scripts>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>qpe</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opieinput/app.pro b/languages/cpp/app_templates/opieinput/app.pro
new file mode 100644
index 00000000..1711c78f
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/app.pro
@@ -0,0 +1,38 @@
+TEMPLATE = lib
+CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-input
+HEADERS = %{APPNAMELC}.h
+SOURCES = %{APPNAMELC}.cpp
+TARGET = %{APPNAMELC}
+
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+QMAKE_LIBDIR= $$(OPIEDIR)/lib
+OPIE-SPEC=6
+
+zecke-libqpe {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $$(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ DEPENDPATH += $$(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate
new file mode 100644
index 00000000..39250370
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate
@@ -0,0 +1,129 @@
+# KDE Config File
+[General]
+Name=Opie Input
+Name[ca]=Entrada per a Opie
+Name[da]=Opie-input
+Name[de]=Opie-Eingabe
+Name[el]=Μέθοδος εισαγωγής Opie
+Name[es]=Entrada para Opie
+Name[et]=Opie sisestus
+Name[eu]=Opie sarrera
+Name[fa]=ورودی Opie
+Name[fr]=Entrée Opie
+Name[ga]=Ionchur Opie
+Name[gl]=Entrada Opie
+Name[hu]=Opie-s bemeneti modul
+Name[it]=Input di Opie
+Name[ja]=Opie 入力
+Name[nds]=Opie-Ingaav
+Name[ne]=ओपिइ आगत
+Name[nl]=Opie-invoer
+Name[pl]=Wejście Opie
+Name[pt]=Introdução de Dados do Opie
+Name[pt_BR]=Introdução de Dados do Opie
+Name[ru]=Модуль ввода Opie
+Name[sk]=Opie vstup
+Name[sr]=Opie унос
+Name[sr@Latn]=Opie unos
+Name[sv]=Opie-inmatning
+Name[tr]=Opie Girdisi
+Name[zh_CN]=Opie 输入法
+Name[zh_TW]=Opie 輸入
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie input method plugin.
+Comment[ca]=Genera un connector de mètode d'entrada per a Opie.
+Comment[da]=Generér en Opie input-metode-plugin.
+Comment[de]=Erstellt ein Eingabemethode-Modul für Opie.
+Comment[el]=Δημιουργία ενός πρόσθετου μεθόδου εισαγωγής.
+Comment[es]=Genera un complemento de método de entrada para Opie.
+Comment[et]=Opie sisestusmeetodi plugina loomine.
+Comment[eu]=Sortu Opie-ren sarrera-metodoaren plugin bat.
+Comment[fa]=یک وصلۀ روش ورودی Opie تولید می‌کند.
+Comment[fr]=Génère un module externe de méthode d'entrée Opie.
+Comment[gl]=Xera unha extensión de método de entrada para Opie.
+Comment[hu]=Létrehoz egy Opie-s bemeneti modult.
+Comment[it]=Genera un plugin per il metodo di input Opie.
+Comment[nds]=Stellt en Ingaavmetood-Moduul för Opie op.
+Comment[ne]=ओपिइ आगत विधि प्लगइन उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Opie-invoermethode-plugin.
+Comment[pl]=Generuje wtyczkę z metodą wejściową dla Opie.
+Comment[pt]=Gera um 'plugin' de introdução de dados do Opie.
+Comment[pt_BR]=Gera um 'plugin' de introdução de dados do Opie.
+Comment[ru]=Создание модуля ввода данных для среды Opie.
+Comment[sk]=Vygeneruje Opie vstupný modul.
+Comment[sr]=Прави прикључак за Opie метод уноса.
+Comment[sr@Latn]=Pravi priključak za Opie metod unosa.
+Comment[sv]=Skapa ett insticksprogram för Opie-inmatning.
+Comment[tr]=Bir Opie girdi yöntemi eklentisi yarat
+Comment[zh_CN]=生成一个 Opie 输入法插件。
+Comment[zh_TW]=產生一個 Opie 輸入法外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opieinput.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/simpleimpl.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/simpleimpl.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[MSG]
+Type=message
+Comment=An opie input method plugin was created in %{dest}
+Comment[ca]=Un connector de mètode d'entrada per a Opie ha estat creat en %{dest}
+Comment[da]=At opie input-metode-plugin blev oprettet i %{dest}
+Comment[de]=Ein Eingabemethode-Modul für Opie wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο μεθόδου εισαγωγής opie δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento de método de entrada para Opie ha sido creado en %{dest}
+Comment[et]=Opie sisestusmeetodi plugin loodi asukohta %{dest}
+Comment[eu]=Opie-ren sarrera-metodoaren plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ روش ورودی opie در %{dest} ایجاد شد
+Comment[fr]=Un module externe de méthode d'entrée Opie a été créé dans %{dest}
+Comment[gl]=Creouse unha extensión de método de entrada para opie en %{dest}
+Comment[hu]=Létrejött egy Opie-s bemeneti modul itt: %{dest}
+Comment[it]=È stato creato un plugin per il metodo di input Opie in %{dest}
+Comment[nds]=In %{dest} wöör en Opie-Ingaavmetoodmoduul opstellt
+Comment[ne]=ओपिइ आगत विधि प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie-invoermethode-plugins is aangemaakt in %{dest}
+Comment[pl]=Wtyczka z metodą wejściową dla Opie została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' de introdução de dados em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' de introdução de dados em %{dest}
+Comment[ru]=Модуль ввода Opie создан в %{dest}
+Comment[sk]=Opie vstupný modul bol vytvorený v %{dest}
+Comment[sr]=Прикључак за Opie метод уноса направљен је у %{dest}
+Comment[sr@Latn]=Priključak za Opie metod unosa napravljen je u %{dest}
+Comment[sv]=Ett insticksprogram för Opie-inmatning skapades i %{dest}
+Comment[tr]=Bir opie girdi yöntemi eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 输入法
+Comment[zh_TW]=一個 Opie 輸入法外掛程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/opieinput/opieinput.png b/languages/cpp/app_templates/opieinput/opieinput.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/opieinput.png
Binary files differ
diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.cpp b/languages/cpp/app_templates/opieinput/simpleimpl.cpp
new file mode 100644
index 00000000..6da986eb
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/simpleimpl.cpp
@@ -0,0 +1,157 @@
+#include <qwidget.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <qsignalmapper.h>
+#include <qpushbutton.h>
+#include <qpe/resource.h>
+
+#include "%{APPNAMELC}.h"
+
+%{APPNAME}::%{APPNAME}(QWidget* par, WFlags fl )
+ : QHBox(par, "name", fl )
+{
+ QCheckBox *box1 = new QCheckBox(tr("Alt"),this);
+ connect(box1,SIGNAL(toggled(bool)),
+ this,SLOT(slotAlt(bool)));
+ m_alt = box1;
+ box1 = new QCheckBox(tr("Shift"),this );
+ connect(box1,SIGNAL(toggled(bool)),
+ this,SLOT(slotShift(bool)));
+ m_shi = box1;
+ box1 = new QCheckBox(tr("Ctrl","Control Shortcut on keyboard"),this );
+ connect(box1,SIGNAL(toggled(bool)),
+ this,SLOT(slotCtrl(bool)));
+ m_ctrl = box1;
+
+ QSignalMapper *map = new QSignalMapper(this);
+ QPushButton *btn = new QPushButton("a",this);
+ map->setMapping(btn,0);
+ connect(btn,SIGNAL(clicked()),map,SLOT(map()));
+
+ btn = new QPushButton("b",this);
+ map->setMapping(btn,1);
+ connect(btn,SIGNAL(clicked()),map,SLOT(map()));
+
+ btn = new QPushButton("c",this);
+ map->setMapping(btn,2);
+ connect(btn,SIGNAL(clicked()),map,SLOT(map()));
+
+ connect(map,SIGNAL(mapped(int)),
+ this,SLOT(slotKey(int)));
+ resetState();
+}
+
+%{APPNAME}::~%{APPNAME}(){
+}
+
+void %{APPNAME}::resetState(){
+ m_state = 0;
+ m_shi->setChecked(false);
+ m_ctrl->setChecked(false);
+ m_alt->setChecked(false);
+}
+
+void %{APPNAME}::slotKey(int _ke){
+ int ke = _ke + 0x61; // 0 + 65 = 0x41 == A
+ if(m_state & ShiftButton )
+ ke -= 0x20;
+
+ /*
+ * Send the key
+ * ke is the unicode
+ * _ke + 0x41 is the keycode
+ * m_state Normally the state
+ * down/up
+ * auto repeat
+ */
+ emit key(ke, _ke +0x41,m_state,true,false);
+ emit key(ke, _ke + 0x41,m_state,false,false);
+}
+
+void %{APPNAME}::slotShift(bool b){
+ if(b)
+ m_state |= ShiftButton;
+ else
+ m_state &= ~ShiftButton;
+}
+
+void %{APPNAME}::slotAlt(bool b){
+ if(b)
+ m_state |= AltButton;
+ else
+ m_state &= ~AltButton;
+}
+
+void %{APPNAME}::slotCtrl(bool b){
+ if(b)
+ m_state |= ControlButton;
+ else
+ m_state &= ~ControlButton;
+}
+
+
+
+%{APPNAME}Impl::%{APPNAME}Impl()
+ : m_pickboard(0), m_icn(0)
+{
+}
+
+%{APPNAME}Impl::~%{APPNAME}Impl()
+{
+ delete m_pickboard;
+ delete m_icn;
+}
+
+QWidget *%{APPNAME}Impl::inputMethod( QWidget *parent, Qt::WFlags f )
+{
+ if ( !m_pickboard )
+ m_pickboard = new %{APPNAME}( parent, f );
+ return m_pickboard;
+}
+
+void %{APPNAME}Impl::resetState()
+{
+ if ( m_pickboard )
+ m_pickboard->resetState();
+}
+
+QPixmap *%{APPNAME}Impl::icon()
+{
+ if ( !m_icn )
+ m_icn = new QPixmap(Resource::loadPixmap("Tux"));
+ return m_icn;
+}
+
+QString %{APPNAME}Impl::name()
+{
+ return QObject::tr("Example Input");
+}
+
+void %{APPNAME}Impl::onKeyPress( QObject *receiver, const char *slot )
+{
+ if ( m_pickboard )
+ QObject::connect( m_pickboard, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot );
+}
+
+#ifndef QT_NO_COMPONENT
+QRESULT %{APPNAME}Impl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_InputMethod )
+ *iface = this;
+ else
+ return QS_FALSE;
+
+ if ( *iface )
+ (*iface)->addRef();
+ return QS_OK;
+}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( %{APPNAME}Impl )
+}
+#endif
+
diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.h b/languages/cpp/app_templates/opieinput/simpleimpl.h
new file mode 100644
index 00000000..362e59b3
--- /dev/null
+++ b/languages/cpp/app_templates/opieinput/simpleimpl.h
@@ -0,0 +1,50 @@
+#ifndef %{APPNAME}IMPL_H
+#define %{APPNAME}IMPL_H
+
+#include <qhbox.h>
+
+#include <qpe/inputmethodinterface.h>
+
+class QPixmap;
+class QCheckBox;
+class %{APPNAME} : public QHBox {
+ Q_OBJECT
+public:
+ %{APPNAME}( QWidget *par, WFlags f );
+ ~%{APPNAME}();
+ void resetState();
+private slots:
+ void slotKey(int);
+ void slotShift(bool);
+ void slotAlt(bool);
+ void slotCtrl(bool);
+signals:
+ void key(ushort,ushort,ushort,bool,bool);
+private:
+ int m_state;
+ QCheckBox *m_alt,*m_shi,*m_ctrl;
+};
+
+class %{APPNAME}Impl : public InputMethodInterface
+{
+public:
+ %{APPNAME}Impl();
+ virtual ~%{APPNAME}Impl();
+
+#ifndef QT_NO_COMPONENT
+ QRESULT queryInterface( const QUuid&, QUnknownInterface** );
+ Q_REFCOUNT
+#endif
+
+ virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f );
+ virtual void resetState();
+ virtual QPixmap *icon();
+ virtual QString name();
+ virtual void onKeyPress( QObject *receiver, const char *slot );
+
+private:
+ %{APPNAME} *m_pickboard;
+ QPixmap *m_icn;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opiemenu/.kdev_ignore b/languages/cpp/app_templates/opiemenu/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/.kdev_ignore
diff --git a/languages/cpp/app_templates/opiemenu/Example.png b/languages/cpp/app_templates/opiemenu/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opiemenu/Makefile.am b/languages/cpp/app_templates/opiemenu/Makefile.am
new file mode 100644
index 00000000..c44b3f96
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = Makefile.am Example.png app.kdevelop app.pro \
+ simpleimpl.cpp simpleimpl.h
+
+templateName = opiemenu
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opiemenu/app.kdevelop b/languages/cpp/app_templates/opiemenu/app.kdevelop
new file mode 100644
index 00000000..eee2c55a
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/app.kdevelop
@@ -0,0 +1,158 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>true</quick_app>
+ </opie>
+ <packaging>
+ <template>2</template>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/applets</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>task-opie-minimal</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ <scripts>
+ <post>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()"
+else
+ exit 0
+fi
+</post>
+ <post_rem>#!/bin/sh
+if pidof -s qpe >/dev/null; then
+ /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadApplets()"
+else
+ exit 0
+fi
+</post_rem>
+ </scripts>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opiemenu/app.pro b/languages/cpp/app_templates/opiemenu/app.pro
new file mode 100644
index 00000000..71bc208c
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/app.pro
@@ -0,0 +1,38 @@
+TEMPLATE = lib
+CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-menuapplet
+HEADERS = %{APPNAMELC}.h
+SOURCES = %{APPNAMELC}.cpp
+TARGET = %{APPNAMELC}
+
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+QMAKE_LIBDIR= $$(OPIEDIR)/lib
+OPIE-SPEC=6
+
+zecke-libqpe {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $$(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ DEPENDPATH += $$(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate b/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate
new file mode 100644
index 00000000..b32b13ed
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/opiemenu.kdevtemplate
@@ -0,0 +1,132 @@
+# KDE Config File
+[General]
+Name=Opie Menu Applet
+Name[ca]=Una miniaplicació de menú per a Opie
+Name[da]=Opie menu-applet
+Name[de]=Opie-Menü-Miniprogramm (Applet)
+Name[el]=Μικροεφαρμογή μενού Opie
+Name[es]=Applet de menú para Opie
+Name[et]=Opie menüüaplett
+Name[eu]=Opie-ren menu applet-a
+Name[fa]=برنامک گزینگان Opie
+Name[fr]=Applet de menu Opie
+Name[ga]=Feidhmchláirín Roghchláir Opie
+Name[gl]=Applet de menú Opie
+Name[hu]=Opie-s menü-kisalkalmazás
+Name[it]=Applet di menu Opie
+Name[ja]=Opie メニューアプレット
+Name[nds]=Menü-Lüttprogramm för Opie
+Name[ne]=ओपिइ मेनु एप्लेट
+Name[nl]=Opie-menuapplet
+Name[pl]=Aplet menu Opie
+Name[pt]='Applet' do Menu do Opie
+Name[pt_BR]='Applet' do Menu do Opie
+Name[ru]=Аплет меню Opie
+Name[sk]=Opie menu pplet
+Name[sr]=Opie аплет менија
+Name[sr@Latn]=Opie aplet menija
+Name[sv]=Opie-menyminiprogram
+Name[tr]=Opie Menü Küçük Uygulaması
+Name[zh_CN]=Opie 菜单小程序
+Name[zh_TW]=Opie 選單小程式
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie menu applet.
+Comment[ca]=Genera una miniaplicació de menú per a Opie.
+Comment[da]=Generér en Opie menu-applet.
+Comment[de]=Erstellt ein Opie-Menü-Miniprogramm (Applet).
+Comment[el]=Δημιουργία μίας μικροεφαρμογής μενού Opie.
+Comment[es]=Genera un applet de menú para Opie.
+Comment[et]=Opie menüüapleti loomine.
+Comment[eu]=Sortu Opie-ren menu applet bat.
+Comment[fa]=یک برنامک گزینگان Opie تولید می‌کند.
+Comment[fr]=Génère un applet de menu Opie.
+Comment[gl]=Xera un applet de menu para Opie.
+Comment[hu]=Létrehoz egy Opie-s menü-kisalkalmazást.
+Comment[it]=Genera un'applet di menu Opie.
+Comment[ja]=Opie メニューアプレットを作成
+Comment[nds]=Stellt en Menü-Lüttprogramm för Opie op.
+Comment[ne]=ओपिइ मेनु एप्लेट उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Opie-menuapplet.
+Comment[pl]=Generuje aplet menu Opie
+Comment[pt]=Gera uma 'applet' do menu do Opie.
+Comment[pt_BR]=Gera uma 'applet' do menu do Opie.
+Comment[ru]=Создание аплета меню Opie.
+Comment[sk]=Vygeneruje Opie menu applet.
+Comment[sr]=Прави Opie аплет менија.
+Comment[sr@Latn]=Pravi Opie aplet menija.
+Comment[sv]=Skapa ett Opie-menyminiprogram.
+Comment[tr]=Bir Opie menü küçük uygulaması yarat
+Comment[zh_CN]=生成一个 Opie 菜单小程序。
+Comment[zh_TW]=產生一個 Opie 選單小程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opiemenu.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/simpleimpl.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/simpleimpl.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[MSG]
+Type=message
+Comment=An opie menu applet was created in %{dest}
+Comment[ca]=Una miniaplicació de menú per a Opie ha estat creat en %{dest}
+Comment[da]=En opie menu-applet blev oprettet i %{dest}
+Comment[de]=Ein Opie-Menü-Miniprogramm (Applet) wurde in %{dest} erstellt.
+Comment[el]=Μία μικροεφαρμογή μενού opie δημιουργήθηκε στο %{dest}
+Comment[es]=Un applet de menú para Opie ha sido creado en %{dest}
+Comment[et]=Opie menüüaplett loodi asukohta %{dest}
+Comment[eu]= Opie-ren menu applet bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامک گزینگان opie در %{dest} ایجاد شد
+Comment[fr]=Un applet de menu Opie a été créé dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchláirín roghchláir opie i %{dest}
+Comment[gl]=Creouse un applet de menu para opie en %{dest}
+Comment[hu]=Létrejött egy Opie-s menü-kisalkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applet di menu Opie in %{dest}
+Comment[ja]=Opie メニューアプレットを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Menü-Lüttprogramm för Opie opstellt
+Comment[ne]=ओपिइ मेनु एप्लेट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie-menuapplet is aangemaakt in %{dest}
+Comment[pl]=Aplet menu Opie został utworzony w %{dest}
+Comment[pt]=Foi criada uma 'applet' do menu do Opie em %{dest}
+Comment[pt_BR]=Foi criada uma 'applet' do menu do Opie em %{dest}
+Comment[ru]=Аплет меню Opie создан в %{dest}
+Comment[sk]=Opie menu applet bol vytvorený v %{dest}
+Comment[sr]=Opie аплет менија направљен је у %{dest}
+Comment[sr@Latn]=Opie aplet menija napravljen je u %{dest}
+Comment[sv]=Ett Opie-menyprogram skapades i %{dest}
+Comment[tr]=Bir opie menü küçük uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 菜单小程序
+Comment[zh_TW]=一個 Opie 選單小程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/opiemenu/opiemenu.png b/languages/cpp/app_templates/opiemenu/opiemenu.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/opiemenu.png
Binary files differ
diff --git a/languages/cpp/app_templates/opiemenu/simpleimpl.cpp b/languages/cpp/app_templates/opiemenu/simpleimpl.cpp
new file mode 100644
index 00000000..95245661
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/simpleimpl.cpp
@@ -0,0 +1,78 @@
+#include "%{APPNAMELC}.h"
+
+#include <qpe/applnk.h>
+#include <qpe/resource.h>
+
+/* QT */
+#include <qiconset.h>
+#include <qpopupmenu.h>
+#include <qmessagebox.h>
+
+
+%{APPNAME}::%{APPNAME}()
+ :QObject( 0, "%{APPNAME}" )
+{
+}
+
+%{APPNAME}::~%{APPNAME} ( )
+{}
+
+int %{APPNAME}::position() const
+{
+ return 3;
+}
+
+QString %{APPNAME}::name() const
+{
+ return tr( "MenuApplet Example Name" );
+}
+
+QString %{APPNAME}::text() const
+{
+ return tr( "Click the white rabbit" );
+}
+
+
+QIconSet %{APPNAME}::icon() const
+{
+ QPixmap pix;
+ QImage img = Resource::loadImage( "Tux" );
+ if ( !img.isNull() )
+ pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
+ return pix;
+}
+
+QPopupMenu* %{APPNAME}::popup(QWidget*) const
+{
+ /* no subdir */
+ return 0;
+}
+
+void %{APPNAME}::activated()
+{
+ QMessageBox::information(0,tr("No white rabbit found"),
+ tr("<qt>No white rabbit was seen near Opie."
+ "Only the beautiful OpieZilla is available"
+ "for your pleassure</qt>"));
+}
+
+
+QRESULT %{APPNAME}::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
+{
+ *iface = 0;
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_MenuApplet )
+ *iface = this;
+ else
+ return QS_FALSE;
+
+ if ( *iface )
+ (*iface)->addRef();
+ return QS_OK;
+}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( %{APPNAME} )
+}
diff --git a/languages/cpp/app_templates/opiemenu/simpleimpl.h b/languages/cpp/app_templates/opiemenu/simpleimpl.h
new file mode 100644
index 00000000..3961e3c4
--- /dev/null
+++ b/languages/cpp/app_templates/opiemenu/simpleimpl.h
@@ -0,0 +1,32 @@
+#ifndef %{APPNAME}_MENU_APPLET_H
+#define %{APPNAME}_MENU_APPLET_H
+
+#include <qpe/menuappletinterface.h>
+
+#include <qobject.h>
+
+class %{APPNAME} : public QObject, public MenuAppletInterface
+{
+
+ Q_OBJECT
+
+public:
+ %{APPNAME} ( );
+ virtual ~%{APPNAME} ( );
+
+ QRESULT queryInterface( const QUuid&, QUnknownInterface** );
+ Q_REFCOUNT
+
+ virtual int position() const;
+
+ virtual QString name ( ) const;
+ virtual QIconSet icon ( ) const;
+ virtual QString text ( ) const;
+ /* virtual QString tr( const char* ) const;
+ virtual QString tr( const char*, const char* ) const;
+ */
+ virtual QPopupMenu *popup ( QWidget *parent ) const;
+ virtual void activated ( );
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opienet/.kdev_ignore b/languages/cpp/app_templates/opienet/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/.kdev_ignore
diff --git a/languages/cpp/app_templates/opienet/Example.png b/languages/cpp/app_templates/opienet/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opienet/Makefile.am b/languages/cpp/app_templates/opienet/Makefile.am
new file mode 100644
index 00000000..47dc4231
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = Makefile.am Example.png app.kdevelop app.pro \
+ simpleiface.cpp simpleiface.h simplemodule.h \
+ simplemodule.cpp
+
+templateName = opienet
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opienet/app.kdevelop b/languages/cpp/app_templates/opienet/app.kdevelop
new file mode 100644
index 00000000..660b7bee
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/app.kdevelop
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>false</quick_app>
+ </opie>
+ <packaging>
+ <template>3</template>
+ <custom_dest>plugins/networksettings</custom_dest>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/settings</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>opie-networksettings</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>qpe</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opienet/app.pro b/languages/cpp/app_templates/opienet/app.pro
new file mode 100644
index 00000000..53fb6eea
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/app.pro
@@ -0,0 +1,39 @@
+TEMPLATE = lib
+CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-network
+HEADERS = %{APPNAMELC}module.h %{APPNAMELC}iface.h
+SOURCES = %{APPNAMELC}module.cpp %{APPNAMELC}iface.cpp
+TARGET = %{APPNAMELC}
+LIBS += -linterfaces
+
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+QMAKE_LIBDIR= $$(OPIEDIR)/lib
+OPIE-SPEC=6
+
+zecke-libqpe {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $$(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ DEPENDPATH += $$(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opienet/opienet.kdevtemplate b/languages/cpp/app_templates/opienet/opienet.kdevtemplate
new file mode 100644
index 00000000..4ab9ebbe
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/opienet.kdevtemplate
@@ -0,0 +1,142 @@
+# KDE Config File
+[General]
+Name=Opie Networksettings
+Name[br]=Kefluniadur rouedad Opie
+Name[ca]=Connector de preferències de xarxa per a Opie
+Name[da]=Opie netværksopsætning
+Name[de]=Opie-Netzwerkeinstellungen
+Name[el]=Ρυθμίσεις δικτύου Opie
+Name[es]=Preferencias de red para Opie
+Name[et]=Opie võrguseadustused
+Name[eu]=Opie-ren sare-ezarpenak
+Name[fa]=تنظیمات شبکۀ Opie
+Name[fr]=Paramètres réseau pour Opie
+Name[ga]=Socruithe Líonra Opie
+Name[hu]=Opie-s hálózati beállítómodul
+Name[it]=Impostazioni di rete di Opie
+Name[ja]=Opie ネットワーク設定
+Name[nds]=Opie-Nettwarkinstellen
+Name[ne]=ओपिइ सञ्जाल सेटिङ
+Name[nl]=Opie-netwerkinstellingen
+Name[pl]=Ustawienia sieciowe Opie
+Name[pt]=Configuração de rede do Opie
+Name[pt_BR]=Configuração de rede do Opie
+Name[ru]=Параметры сети Opie
+Name[sk]=Opie sieťové nastavenia
+Name[sr]=Opie мрежна подешавања
+Name[sr@Latn]=Opie mrežna podešavanja
+Name[sv]=Opie nätverksinställningar
+Name[tr]=Opie Ağ Ayarları
+Name[zh_CN]=Opie 网络设置
+Name[zh_TW]=Opie 網路設定
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie network config plugin.
+Comment[ca]=Genera un connector de preferències de xarxa per a Opie.
+Comment[da]=Generér en Opie netværks-config-plugin.
+Comment[de]=Erstellt ein Modul für Opie-Netzwerkeinstellungen.
+Comment[el]=Δημιουργία ενός πρόσθετου ρύθμισης δικτύου Opie.
+Comment[es]=Genera un complemento de configuración de red para Opie.
+Comment[et]=Opie võrguseadistuste plugina loomine.
+Comment[eu]=Sortu Opie-ren sare-ezarpenetarako plugin bat.
+Comment[fa]=یک وصلۀ پیکربندی شبکۀ Opie تولید می‌کند.
+Comment[fr]=Génère un module externe de configuration réseau pour Opie.
+Comment[ga]=Cruthaigh breiseán cumraíochta líonra Opie.
+Comment[gl]=Xera unha extensión de configuración da rede para Opie.
+Comment[hu]=Létrehoz egy Opie-s hálózati beállítómodult.
+Comment[it]=Genera un plugin di configurazione di rete Opie.
+Comment[ja]=Opie ネットワーク設定プラグインを作成
+Comment[nds]=Stellt en Moduul för Opie-Nettwarkinstellen op.
+Comment[ne]=ओपिइ सञ्जाल कन्फिग प्लगइन उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Opie netwerkconfiguratieplugin.
+Comment[pl]=Generuje wtyczkę do ustawień sieciowych Opie
+Comment[pt]=Gera um 'plugin' de configuração da rede do Opie.
+Comment[pt_BR]=Gera um 'plugin' de configuração da rede do Opie.
+Comment[ru]=Создание модуля настройки сети Opie.
+Comment[sk]=Vygeneruje Opie modul pre sieťovú konfiguráciu.
+Comment[sr]=Прави прикључак за Opie мрежна подешавања.
+Comment[sr@Latn]=Pravi priključak za Opie mrežna podešavanja.
+Comment[sv]=Skapa ett Opie-insticksprogram för nätverksinställning.
+Comment[tr]=Opie ağ ayar eklentisi yarat.
+Comment[zh_CN]=生成一个 Opie 网络配置插件。
+Comment[zh_TW]=產生一個 Opie 網路設定外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opienet.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/simplemodule.cpp
+Dest=%{dest}/%{APPNAMELC}module.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/simpleiface.cpp
+Dest=%{dest}/%{APPNAMELC}iface.cpp
+
+[FILE6]
+Type=install
+Source=%{src}/simplemodule.h
+Dest=%{dest}/%{APPNAMELC}module.h
+
+[FILE7]
+Type=install
+Source=%{src}/simpleiface.h
+Dest=%{dest}/%{APPNAMELC}iface.h
+
+[MSG]
+Type=message
+Comment=An opie network settings plugin was created in %{dest}
+Comment[ca]=Un connector de preferències de xarxa per a Opie ha estat creat en %{dest}
+Comment[da]=En opie netværksopsætning-plugin blev oprettet i %{dest}
+Comment[de]=Ein Modul für Opie-Netzwerkeinstellungen wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο ρύθμισης δικτύου του opie δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento de preferencias de red para Opie ha sido creado en %{dest}
+Comment[et]=Opie võrguseadistuste plugin loodi asukohta %{dest}
+Comment[eu]=Opie-ren sare-ezarpenetarako plugin bat sortu da hemen: %{dest}
+Comment[fa]=یک وصلۀ تنظیمات شبکۀ opie در %{dest} ایجاد شد
+Comment[fr]=Un module externe de configuration réseau pour Opie a été créé dans %{dest}
+Comment[gl]=Creouse unha extensión de configuración da rede para opie en %{dest}
+Comment[hu]=Létrejött egy Opie-s hálózati beállítómodul itt: %{dest}
+Comment[it]=È stato creato un plugin per le impostazioni di rete di Opie in %{dest}
+Comment[ja]=Opie ネットワーク設定プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Nettwarkinstellenmoduul för Opie opstellt
+Comment[ne]=ओपिइ सञ्जाल सेटिङ प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie netwerkconfiguratieplugin is aangemaakt in %{dest}
+Comment[pl]=Wtyczka ustawień sieciowych Opie została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' de configuração da rede do Opie em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' de configuração da rede do Opie em %{dest}
+Comment[ru]=Модуль настройки сети Opie создан в %{dest}
+Comment[sk]=Opie module pre sieťové nastavenia bol vytvorený v %{dest}
+Comment[sr]=Прикључак за Opie мрежна подешавања направљен је у %{dest}
+Comment[sr@Latn]=Priključak za Opie mrežna podešavanja napravljen je u %{dest}
+Comment[sv]=Ett Opie-insticksprogram för nätverksinställning skapades i %{dest}
+Comment[tr]=Bir opie ağ ayar eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 网络设置插件
+Comment[zh_TW]=一個 Opie 網路設定外掛程式已建立於 %{dest}
+
diff --git a/languages/cpp/app_templates/opienet/opienet.png b/languages/cpp/app_templates/opienet/opienet.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/opienet.png
Binary files differ
diff --git a/languages/cpp/app_templates/opienet/simmplemodule.h b/languages/cpp/app_templates/opienet/simmplemodule.h
new file mode 100644
index 00000000..9158a7c8
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/simmplemodule.h
@@ -0,0 +1,36 @@
+#ifndef %{APPNAME}_NETWORK_MODULE_H
+#define %{APPNAME}_NETWORK_MODULE_H
+
+#include <module.h>
+
+class VirtualModule : Module {
+
+signals:
+ void updateInterface(Interface* i );
+
+public:
+ VirtualModule();
+ ~VirtualModule();
+
+ const QString type() {return QString::fromLatin1("vpn" );}
+ void setProfile( const QString& ) {}
+ bool isOwner( Interface* );
+ QWidget *configure( Interface* );
+ QWidget *information( Interface* );
+ QList<Interface> getInterfaces();
+ void possibleNewInterfaces( QMap<QString, QString>& );
+ Interface *addNewInterface( const QString& );
+ bool remove( Interface* iface );
+ QString getPixmapName( Interface* ) {return QString::fromLatin1("Tux"); }
+ void receive( const QCString&, const QByteArray& ar ) {} // don't listen
+private:
+ QList<Interface> m_interfaces;
+};
+
+extern "C" {
+ void* create_plugin() {
+ return new VirtualModule();
+ }
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opienet/simpleiface.cpp b/languages/cpp/app_templates/opienet/simpleiface.cpp
new file mode 100644
index 00000000..9182a2f9
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/simpleiface.cpp
@@ -0,0 +1,43 @@
+#include "%{APPNAMELC}iface.h"
+
+%{APPNAME}Interface::%{APPNAME}Interface( QObject* parent,
+ const char* name,
+ bool status )
+ : Interface(parent, name, status )
+{
+}
+
+%{APPNAME}Interface::~%{APPNAME}Interface() {
+}
+
+bool %{APPNAME}Interface::refresh() {
+/* we do VPN over ppp
+ * so replace the interfaceName with
+ * something actual existing
+ * I take wlan0 in my case
+ */
+ QString old = getInterfaceName();
+ qWarning("Interface name was " + old );
+ setInterfaceName( "wlan0" );
+
+ bool b =Interface::refresh();
+ setInterfaceName( old );
+
+/* new and old interface name */
+ emit updateInterface(this);
+ return b;
+}
+
+
+void %{APPNAME}Interface::start() {
+// call pptp
+ setStatus(true);
+ refresh();
+ emit updateMessage("VPN started");
+}
+
+void %{APPNAME}Interface::stop() {
+ setStatus(false );
+ refresh();
+ emit updateMessage("VPN halted");
+}
diff --git a/languages/cpp/app_templates/opienet/simpleiface.h b/languages/cpp/app_templates/opienet/simpleiface.h
new file mode 100644
index 00000000..f235c160
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/simpleiface.h
@@ -0,0 +1,22 @@
+#ifndef EXAMPLE_IFACE_VPN_H
+#define EXAMPLE_IFACE_VPN_H
+
+#include <interfaces/interface.h>
+
+class %{APPNAME}Interface : public Interface {
+ Q_OBJECT
+
+public:
+ %{APPNAME}Interface(QObject* parent, const char* name = "vpn", bool up = false );
+ ~%{APPNAME}Interface();
+
+public slots:
+ bool refresh(); // refresh information
+ void start();
+ void stop();
+
+private:
+ bool m_isUp : 1;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opienet/simplemodule.cpp b/languages/cpp/app_templates/opienet/simplemodule.cpp
new file mode 100644
index 00000000..a67974a8
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/simplemodule.cpp
@@ -0,0 +1,71 @@
+#include <qwidget.h>
+
+#include <interfaces/interfaceinformationimp.h>
+
+#include "%{APPNAMELC}iface.h"
+#include "%{APPNAMELC}module.h"
+
+%{APPNAME}Module::%{APPNAME}Module() {
+ Interface* iface = new %{APPNAME}Interface( 0 );
+ iface->setHardwareName( "vpn" );
+ iface->setInterfaceName( "Test VPN" );
+ m_interfaces.append( iface );
+
+// If we set up VPN via pptp
+// and networksettins was closed and now opened
+// we need to hide the ppp device behind us
+// One can do this by calling setHandledInterfaceNames
+// setHandledInterfaceNames();
+}
+
+%{APPNAME}Module::~%{APPNAME}Module() {
+ m_interfaces.setAutoDelete( true );
+ m_interfaces.clear();
+}
+
+
+/*
+ * We're a VPN module
+ */
+bool %{APPNAME}Module::isOwner( Interface* iface ) {
+ /* check if it is our device */
+ return m_interfaces.find( iface ) != -1;
+}
+
+QWidget* %{APPNAME}Module::configure( Interface* ) {
+/* We don't have any Config for now */
+ return 0l;
+}
+
+QWidget* %{APPNAME}Module::information( Interface* iface ) {
+ return new InterfaceInformationImp(0, "Interface info", iface );
+}
+
+QList<Interface> %{APPNAME}Module::getInterfaces() {
+ return m_interfaces;
+}
+
+void %{APPNAME}Module::possibleNewInterfaces( QMap<QString, QString>& map) {
+ map.insert( QObject::tr("VPN PPTP"),
+ QObject::tr("Add new Point to Point Tunnel Protocol connection" ) );
+}
+
+
+Interface* %{APPNAME}Module::addNewInterface( const QString& ) {
+ /* check the str if we support more interfaces */
+/*
+ Interface* iface = new %{APPNAME}Interface( 0 );
+ iface->setModuleOwner( this );
+ return iface;*/
+
+// if we would support saving interfaces we could add
+// them here
+
+ return 0;
+}
+
+
+bool %{APPNAME}Module::remove( Interface* ) {
+/* we do not support removing our interface */
+ return false;
+}
diff --git a/languages/cpp/app_templates/opienet/simplemodule.h b/languages/cpp/app_templates/opienet/simplemodule.h
new file mode 100644
index 00000000..1b02b688
--- /dev/null
+++ b/languages/cpp/app_templates/opienet/simplemodule.h
@@ -0,0 +1,36 @@
+#ifndef %{APPNAME}_NETWORK_MODULE_H
+#define %{APPNAME}_NETWORK_MODULE_H
+
+#include <module.h>
+
+class %{APPNAME}Module : Module {
+
+signals:
+ void updateInterface(Interface* i );
+
+public:
+ %{APPNAME}Module();
+ ~%{APPNAME}Module();
+
+ const QString type() {return QString::fromLatin1("vpn" );}
+ void setProfile( const QString& ) {}
+ bool isOwner( Interface* );
+ QWidget *configure( Interface* );
+ QWidget *information( Interface* );
+ QList<Interface> getInterfaces();
+ void possibleNewInterfaces( QMap<QString, QString>& );
+ Interface *addNewInterface( const QString& );
+ bool remove( Interface* iface );
+ QString getPixmapName( Interface* ) {return QString::fromLatin1("Tux"); }
+ void receive( const QCString&, const QByteArray& ar ) {} // don't listen
+private:
+ QList<Interface> m_interfaces;
+};
+
+extern "C" {
+ void* create_plugin() {
+ return new %{APPNAME}Module();
+ }
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opietoday/.kdev_ignore b/languages/cpp/app_templates/opietoday/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/.kdev_ignore
diff --git a/languages/cpp/app_templates/opietoday/Example.png b/languages/cpp/app_templates/opietoday/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/opietoday/Makefile.am b/languages/cpp/app_templates/opietoday/Makefile.am
new file mode 100644
index 00000000..8854404d
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = Makefile.am Example.png app.kdevelop app.pro exampleplugin.cpp \
+ examplepluginimpl.cpp examplepluginwidget.cpp exampleplugin.h \
+ examplepluginimpl.h examplepluginwidget.h
+
+templateName = opietoday
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/opietoday/app.kdevelop b/languages/cpp/app_templates/opietoday/app.kdevelop
new file mode 100644
index 00000000..f6e57207
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/app.kdevelop
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>kdev3api</toc>
+ <toc>sdl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>qmake User Guide</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Referrence Documentation</toc>
+ </ignoreqt_xml>
+ <ignoredevhelp>
+ <toc>bonobo-activation</toc>
+ <toc>gconf</toc>
+ <toc>gtksourceview</toc>
+ <toc>libbonobo</toc>
+ <toc>libbonoboui</toc>
+ </ignoredevhelp>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs>-qws</programargs>
+ <gdbpath/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <opie>
+ <quick_app>false</quick_app>
+ </opie>
+ <packaging>
+ <template>3</template>
+ <custom_dest>plugins/today</custom_dest>
+ <owner>
+ <package>%{APPNAMELC}</package>
+ <prio>0</prio>
+ <section>opie/plugins</section>
+ <maintainer>%{AUTHOR} %{EMAIL}</maintainer>
+ <arch>arm</arch>
+ <depends>opie-today</depends>
+ <version>%{VERSION}</version>
+ <desc>Empty</desc>
+ </owner>
+ </packaging>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram></mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/opietoday/app.pro b/languages/cpp/app_templates/opietoday/app.pro
new file mode 100644
index 00000000..152dc6f6
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/app.pro
@@ -0,0 +1,38 @@
+TEMPLATE = lib
+CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-todayplugin
+HEADERS = %{APPNAMELC}.h %{APPNAMELC}widget.h %{APPNAMELC}impl.h
+SOURCES = %{APPNAMELC}.cpp %{APPNAMELC}widget.cpp %{APPNAMELC}impl.cpp
+TARGET = %{APPNAMELC}
+
+
+QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP)
+contains( TEMPLATE, quick-template ){
+ contains( QUICK_SPEC_FOO, quick-app-lib ){
+ message( "foo" )
+ system( rm $$TARGET )
+ system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET)
+ DEFINES += OPIE_APP_INTERFACE
+ TEMPLATE = lib
+ CONFIG += dll
+ }else{
+ LI = $$join( TARGET, "lib", "lib", ".so*" )
+ system( rm $$LI )
+ TEMPLATE = app
+ }
+}
+
+
+QMAKE_LIBDIR= $$(OPIEDIR)/lib
+OPIE-SPEC=6
+
+zecke-libqpe {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ LIBS += -lqpe
+ DEPENDPATH += $$(OPIEDIR)/include
+}
+
+zecke-libopie {
+ INCLUDEPATH += $$(OPIEDIR)/include
+ DEPENDPATH += $$(OPIEDIR)/include
+ LIBS += -lopie
+}
diff --git a/languages/cpp/app_templates/opietoday/exampleplugin.cpp b/languages/cpp/app_templates/opietoday/exampleplugin.cpp
new file mode 100644
index 00000000..3d32b274
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/exampleplugin.cpp
@@ -0,0 +1,60 @@
+
+#include "%{APPNAMELC}.h"
+
+%{APPNAME}::%{APPNAME}() {
+ m_widget = 0l;
+}
+
+%{APPNAME}::~%{APPNAME}() {
+ delete (%{APPNAME}Widget*)m_widget;
+}
+
+QString %{APPNAME}::pluginName() const {
+ return QObject::tr( "%{APPNAME}" );
+}
+
+double %{APPNAME}::versionNumber() const {
+ return 0.1;
+}
+
+// this sets the image that will be shown on the left side of the plugin
+QString %{APPNAME}::pixmapNameWidget() const {
+ return QString::fromLatin1("%{APPNAMELC}/%{APPNAMELC}");
+}
+
+QWidget* %{APPNAME}::widget( QWidget * wid ) {
+ if(!m_widget) {
+ m_widget = new %{APPNAME}Widget( wid, "%{APPNAME}" );
+ }
+ return m_widget;
+}
+
+
+// that would be the icon of the config widget in todays config view
+QString %{APPNAME}::pixmapNameConfig() const {
+ return 0l;
+}
+
+// No config widget yet, look at the datebook plugin for an example of that
+TodayConfigWidget* %{APPNAME}::configWidget( QWidget* /*parent*/ ) {
+ return 0l;
+}
+
+// add the binary name of the app to launch here
+QString %{APPNAME}::appName() const {
+ return QString::null;
+}
+
+// if the plugin should be excluded form the refresh cycles that can be set in the today app
+bool %{APPNAME}::excludeFromRefresh() const {
+ return false;
+}
+
+void %{APPNAME}::refresh() {
+ if ( m_widget ) {
+ m_widget->refresh();
+ }
+}
+
+void %{APPNAME}::reinitialize() {
+}
diff --git a/languages/cpp/app_templates/opietoday/exampleplugin.h b/languages/cpp/app_templates/opietoday/exampleplugin.h
new file mode 100644
index 00000000..b321f434
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/exampleplugin.h
@@ -0,0 +1,34 @@
+#ifndef %{APPNAME}_PLUGIN_H
+#define %{APPNAME}_PLUGIN_H
+
+#include <qwidget.h>
+#include <qguardedptr.h>
+
+#include <opie/todayplugininterface.h>
+#include <opie/todayconfigwidget.h>
+
+#include "%{APPNAMELC}widget.h"
+
+// implementation of the today plugin interface
+class %{APPNAME} : public TodayPluginObject {
+
+public:
+ %{APPNAME}();
+ ~%{APPNAME}();
+
+ QString pluginName() const;
+ double versionNumber() const;
+ QString pixmapNameWidget() const;
+ QWidget* widget(QWidget *);
+ QString pixmapNameConfig() const;
+ TodayConfigWidget* configWidget(QWidget *);
+ QString appName() const;
+ bool excludeFromRefresh() const;
+ void refresh();
+ void reinitialize();
+
+ private:
+ QGuardedPtr<%{APPNAME}Widget> m_widget;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp b/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp
new file mode 100644
index 00000000..3a9481f1
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/examplepluginimpl.cpp
@@ -0,0 +1,30 @@
+#include "%{APPNAMELC}.h"
+#include "%{APPNAMELC}impl.h"
+
+%{APPNAME}Impl::%{APPNAME}Impl() {
+ examplePlugin = new %{APPNAME}();
+}
+
+%{APPNAME}Impl::~%{APPNAME}Impl() {
+ delete examplePlugin;
+}
+
+
+TodayPluginObject* %{APPNAME}Impl::guiPart() {
+ return examplePlugin;
+}
+
+QRESULT %{APPNAME}Impl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) {
+ *iface = 0;
+ if ( ( uuid == IID_QUnknown ) || ( uuid == IID_TodayPluginInterface ) ) {
+ *iface = this, (*iface)->addRef();
+ }else
+ return QS_FALSE;
+
+ return QS_OK;
+
+}
+
+Q_EXPORT_INTERFACE() {
+ Q_CREATE_INSTANCE( %{APPNAME}Impl );
+}
diff --git a/languages/cpp/app_templates/opietoday/examplepluginimpl.h b/languages/cpp/app_templates/opietoday/examplepluginimpl.h
new file mode 100644
index 00000000..ccb7c3b3
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/examplepluginimpl.h
@@ -0,0 +1,23 @@
+#ifndef %{APPNAME}_PLUGIN_IMPL_H
+#define %{APPNAME}_PLUGIN_IMPL_H
+
+#include <opie/todayplugininterface.h>
+
+class %{APPNAME};
+
+class %{APPNAME}Impl : public TodayPluginInterface{
+
+public:
+ %{APPNAME}Impl();
+ virtual ~%{APPNAME}Impl();
+
+ QRESULT queryInterface( const QUuid &, QUnknownInterface** );
+ Q_REFCOUNT
+
+ virtual TodayPluginObject *guiPart();
+
+private:
+ %{APPNAME} *examplePlugin;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp
new file mode 100644
index 00000000..b0cb0dcc
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp
@@ -0,0 +1,55 @@
+#include <qpe/config.h>
+#include <qpe/qcopenvelope_qws.h>
+
+#include "%{APPNAMELC}widget.h"
+
+%{APPNAME}Widget::%{APPNAME}Widget( QWidget *parent, const char* name)
+ : QWidget(parent, name ) {
+
+ m_exampleLabel = 0l;
+ m_layout = 0l;
+
+ if ( m_exampleLabel ) {
+ delete m_exampleLabel;
+ }
+
+ // since here a OClickableLabel is used, the plugin part will be clickable, and the actions
+ // that should be triggered when clicked are defined in slotClicked()
+ // of course also normal widgets can be used.
+ m_exampleLabel = new OClickableLabel( this );
+ connect( m_exampleLabel, SIGNAL( clicked() ), this, SLOT( slotClicked() ) );
+
+ if ( m_layout ) {
+ delete m_layout;
+ }
+ m_layout = new QHBoxLayout( this );
+ m_layout->setAutoAdd( true );
+
+ readConfig();
+ getInfo();
+}
+
+
+%{APPNAME}Widget::~%{APPNAME}Widget() {
+ delete m_exampleLabel;
+ delete m_layout;
+}
+
+
+void %{APPNAME}Widget::readConfig() {
+// we dont have any config entries in this plugin
+// normally this method is used after today config was used
+}
+
+
+void %{APPNAME}Widget::refresh() {
+
+}
+
+void %{APPNAME}Widget::getInfo() {
+ m_exampleLabel->setText( tr("%{APPNAME} text") );
+}
+
+void %{APPNAME}Widget::slotClicked() {
+ getInfo();
+}
diff --git a/languages/cpp/app_templates/opietoday/examplepluginwidget.h b/languages/cpp/app_templates/opietoday/examplepluginwidget.h
new file mode 100644
index 00000000..26a72128
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/examplepluginwidget.h
@@ -0,0 +1,28 @@
+#ifndef %{APPNAME}_PLUGIN_WIDGET_H
+#define %{APPNAME}_PLUGIN_WIDGET_H
+
+#include <qlayout.h>
+
+#include <opie/oclickablelabel.h>
+
+class %{APPNAME}Widget : public QWidget {
+
+ Q_OBJECT
+
+public:
+ %{APPNAME}Widget( QWidget *parent, const char *name );
+ ~%{APPNAME}Widget();
+
+ void refresh();
+
+private slots:
+ void slotClicked();
+
+private:
+ OClickableLabel* m_exampleLabel;
+ QHBoxLayout* m_layout;
+ void readConfig();
+ void getInfo();
+};
+
+#endif
diff --git a/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate b/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate
new file mode 100644
index 00000000..25d8f42d
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/opietoday.kdevtemplate
@@ -0,0 +1,151 @@
+# KDE Config File
+[General]
+Name=Opie Today Plugin
+Name[ca]=Connector de tasques pendents per a Opie
+Name[da]=Opie Today-plugin
+Name[de]=Opie-Today-Modul
+Name[el]=Πρόσθετο Σήμερα του Opie
+Name[es]=Complemento de tareas pendientes para Opie
+Name[et]=Opie Today plugin
+Name[eu]=Opie-ren gaur-plugina
+Name[fa]=وصلۀ Opie Today
+Name[fr]=Module externe Opie « Today »
+Name[ga]=Breiseán Inniu Opie
+Name[gl]=Extensión 'today' para Opie
+Name[hu]=Opie Today-modul
+Name[it]=Plugin today di Opie
+Name[ja]=Opie Today プラグイン
+Name[nds]=Moduul för Opie-Today
+Name[ne]=ओपिइ टुडे प्लगइन
+Name[nl]=Opie Today-plugin
+Name[pl]=Wtyczka Opie Dzisiaj
+Name[pt]='Plugin' de Dados de Hoje do Opie
+Name[pt_BR]='Plugin' de Dados de Hoje do Opie
+Name[ru]=Модуль задач Opie
+Name[sk]=Opie dnešný modul
+Name[sr]=Прикључак за Opie данас
+Name[sr@Latn]=Priključak za Opie danas
+Name[sv]=Opie Idag-insticksprogram
+Name[tr]=Opie Bugün Eklentisi
+Name[zh_CN]=Opie 今日插件
+Name[zh_TW]=Opie 今天外掛程式
+Icon=qmakeapp.png
+Category=C++/Embedded
+Comment=Generate an Opie today plugin.
+Comment[ca]=Genera un connector de tasques pendents per a Opie.
+Comment[da]=Generér et Opie today-plugin.
+Comment[de]=Erstellt ein Opie-Today-Modul
+Comment[el]=Δημιουργία ενός πρόσθετου Σήμερα του Opie.
+Comment[es]=Genera un complemento de tareas pendientes para Opie.
+Comment[et]=Opie Today plugina loomine.
+Comment[eu]=Sortu Opie-ren gaur plugin bat.
+Comment[fa]=یک وصلۀ Opie today تولید می‌کند.
+Comment[fr]=Génère un module externe Opie « Today ».
+Comment[gl]=Xera unha extensión 'today' para Opie
+Comment[hu]=Létrehoz egy Opie Today-modult.
+Comment[it]=Genera un plugin today di Opie.
+Comment[ja]=Opie today プラグインを作成
+Comment[nds]=Stellt en Moduul för Opie-Today op.
+Comment[ne]=ओपिइ टुडे प्लगइन उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Opie today-plugin.
+Comment[pl]=Generuje wtyczkę Opie "Dzisiaj".
+Comment[pt]=Gera um 'plugin' para dados de hoje do Opie.
+Comment[pt_BR]=Gera um 'plugin' para dados de hoje do Opie.
+Comment[ru]=Создание модуля задач Opie.
+Comment[sk]=Vygeneruje Opie dnešný modul.
+Comment[sr]=Прави прикључак за Opie данас.
+Comment[sr@Latn]=Pravi priključak za Opie danas.
+Comment[sv]=Skapar ett Opie Idag-insticksprogram.
+Comment[tr]=Bir Opie bugün eklentisi yarat
+Comment[zh_CN]=生成一个 Opie 今日插件。
+Comment[zh_TW]=產生一個 Opie 今天外掛程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=opietoday.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/pics
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/pics/%{APPNAMELC}
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/exampleplugin.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/examplepluginwidget.cpp
+Dest=%{dest}/%{APPNAMELC}widget.cpp
+
+[FILE6]
+Type=install
+Source=%{src}/examplepluginimpl.cpp
+Dest=%{dest}/%{APPNAMELC}impl.cpp
+
+[FILE7]
+Type=install
+Source=%{src}/exampleplugin.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[FILE8]
+Type=install
+Source=%{src}/examplepluginwidget.h
+Dest=%{dest}/%{APPNAMELC}widget.h
+
+[FILE9]
+Type=install
+Source=%{src}/examplepluginimpl.h
+Dest=%{dest}/%{APPNAMELC}impl.h
+
+[MSG]
+Type=message
+Comment=An opie today plugin was created in %{dest}
+Comment[ca]=Un connector de tasques pendents per a Opie ha estat creat en %{dest}
+Comment[da]=Et opie today-plugin blev oprettet i %{dest}
+Comment[de]=Ein Opie-Today-Modul wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόσθετο Σήμερα του opie δημιουργήθηκε στο %{dest}
+Comment[es]=Un complemento de tareas pendientes para Opie ha sido creado en %{dest}
+Comment[et]=Opie Today plugin loodi asukohta %{dest}
+Comment[eu]=Opie-ren gaur plugin bat sortu da hemen %{dest}
+Comment[fa]=یک وصلۀ opie today در %{dest} ایجاد شد
+Comment[fr]=Un module externe Opie « Today » a été créé dans %{dest}
+Comment[ga]=Cruthaíodh breiseán inniu opie i %{dest}
+Comment[gl]=Creouse unha extensión 'today' para opie en %{dest}
+Comment[hu]=Létrejött egy Opie Today-modul itt: %{dest}
+Comment[it]=È stato creato un plugin today di Opie in %{dest}
+Comment[ja]=Opie today プラグインを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Moduul för Opie-Today opstellt
+Comment[ne]=ओपिइ टुडे प्लगइन %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Opie today-plugins is aangemaakt in %{dest}
+Comment[pl]=Wtyczka Opie Dzisiaj została utworzona w %{dest}
+Comment[pt]=Foi criado um 'plugin' para dados de hoje do Opie em %{dest}
+Comment[pt_BR]=Foi criado um 'plugin' para dados de hoje do Opie em %{dest}
+Comment[ru]=Модуль задач Opie создан в %{dest}
+Comment[sk]=Opie dnešný modul bol vytvorený v %{dest}
+Comment[sr]=Прикључак за opie данас направљен је у %{dest}
+Comment[sr@Latn]=Priključak za opie danas napravljen je u %{dest}
+Comment[sv]=Ett Opie Idag-insticksprogram skapades i %{dest}
+Comment[tr]=Bir Opie bugün eklentisi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了一个 opie 今日插件
+Comment[zh_TW]=一個 Opie 今天外掛程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/opietoday/opietoday.png b/languages/cpp/app_templates/opietoday/opietoday.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/opietoday/opietoday.png
Binary files differ
diff --git a/languages/cpp/app_templates/prc-tool/.kdev_ignore b/languages/cpp/app_templates/prc-tool/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/.kdev_ignore
diff --git a/languages/cpp/app_templates/prc-tool/Makefile.am b/languages/cpp/app_templates/prc-tool/Makefile.am
new file mode 100644
index 00000000..3d4b5610
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = prc-tool.png src-Makefile prc-tool.kdevelop callback.h \
+ palmhello.c palmhello.pbitm palmhello.rcp palmhelloRsc.h
+templateName = prc-tool
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/prc-tool/callback.h b/languages/cpp/app_templates/prc-tool/callback.h
new file mode 100644
index 00000000..bf0ead45
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/callback.h
@@ -0,0 +1,24 @@
+#ifndef __CALLBACK_H__
+#define __CALLBACK_H__
+
+/* This is a workaround for a bug in the current version of gcc:
+
+ gcc assumes that no one will touch %a4 after it is set up in crt0.o.
+ This isn't true if a function is called as a callback by something
+ that wasn't compiled by gcc (like FrmCloseAllForms()). It may also
+ not be true if it is used as a callback by something in a different
+ shared library.
+
+ We really want a function attribute "callback" which will insert this
+ progloue and epilogoue automatically.
+
+ - Ian */
+
+register void *reg_a4 asm("%a4");
+
+#define CALLBACK_PROLOGUE \
+ void *save_a4 = reg_a4; asm("move.l %%a5,%%a4; sub.l #edata,%%a4" : :);
+
+#define CALLBACK_EPILOGUE reg_a4 = save_a4;
+
+#endif
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.c b/languages/cpp/app_templates/prc-tool/palmhello.c
new file mode 100644
index 00000000..0a34b6c4
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.c
@@ -0,0 +1,117 @@
+
+/* Main code for PalmHello */
+
+#include <PalmOS.h>
+#include <PalmCompatibility.h>
+#include "callback.h"
+
+#include "palmhelloRsc.h"
+
+static Boolean MainFormHandleEvent (EventPtr e)
+{
+ Boolean handled = false;
+ FormPtr frm;
+
+ CALLBACK_PROLOGUE
+
+ switch (e->eType) {
+ case frmOpenEvent:
+ frm = FrmGetActiveForm();
+ FrmDrawForm(frm);
+ handled = true;
+ break;
+
+ case menuEvent:
+ MenuEraseStatus(NULL);
+
+ switch(e->data.menu.itemID) {
+ }
+
+ handled = true;
+ break;
+
+ case ctlSelectEvent:
+ switch(e->data.ctlSelect.controlID) {
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ CALLBACK_EPILOGUE
+
+ return handled;
+}
+
+static Boolean ApplicationHandleEvent(EventPtr e)
+{
+ FormPtr frm;
+ Word formId;
+ Boolean handled = false;
+
+ if (e->eType == frmLoadEvent) {
+ formId = e->data.frmLoad.formID;
+ frm = FrmInitForm(formId);
+ FrmSetActiveForm(frm);
+
+ switch(formId) {
+ case MainForm:
+ FrmSetEventHandler(frm, MainFormHandleEvent);
+ break;
+ }
+ handled = true;
+ }
+
+ return handled;
+}
+
+/* Get preferences, open (or create) app database */
+static Word StartApplication(void)
+{
+ FrmGotoForm(MainForm);
+ return 0;
+}
+
+/* Save preferences, close forms, close app database */
+static void StopApplication(void)
+{
+ FrmSaveAllForms();
+ FrmCloseAllForms();
+}
+
+/* The main event loop */
+static void EventLoop(void)
+{
+ Word err;
+ EventType e;
+
+ do {
+ EvtGetEvent(&e, evtWaitForever);
+ if (! SysHandleEvent (&e))
+ if (! MenuHandleEvent (NULL, &e, &err))
+ if (! ApplicationHandleEvent (&e))
+ FrmDispatchEvent (&e);
+ } while (e.eType != appStopEvent);
+}
+
+/* Main entry point; it is unlikely you will need to change this except to
+ handle other launch command codes */
+DWord PilotMain(Word cmd, Ptr cmdPBP, Word launchFlags)
+{
+ Word err;
+
+ if (cmd == sysAppLaunchCmdNormalLaunch) {
+
+ err = StartApplication();
+ if (err) return err;
+
+ EventLoop();
+ StopApplication();
+
+ } else {
+ return sysErrParamErr;
+ }
+
+ return 0;
+}
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.pbitm b/languages/cpp/app_templates/prc-tool/palmhello.pbitm
new file mode 100644
index 00000000..5291d5a4
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.pbitm
@@ -0,0 +1,32 @@
+------------#######-------------
+----------###########-----------
+---------#############----------
+--------###############---------
+-------#################--------
+------###################-------
+------###################-------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+-----#####################------
+------###################-------
+------###################-------
+-------#################--------
+--------###############---------
+---------#############----------
+----------###########-----------
+------------#######-------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
+--------------------------------
diff --git a/languages/cpp/app_templates/prc-tool/palmhello.rcp b/languages/cpp/app_templates/prc-tool/palmhello.rcp
new file mode 100644
index 00000000..0b37e81d
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhello.rcp
@@ -0,0 +1,11 @@
+#include "palmhelloRsc.h"
+
+FORM MainForm 1 1 158 158
+BEGIN
+ TITLE "PalmHello"
+END
+
+APPLICATIONICONNAME 1000 "palmhello"
+ICON "palmhello.pbitm"
+
+VERSION 1 "0.0.1"
diff --git a/languages/cpp/app_templates/prc-tool/palmhelloRsc.h b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h
new file mode 100644
index 00000000..6dde2ec7
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/palmhelloRsc.h
@@ -0,0 +1 @@
+#define MainForm 1000
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool b/languages/cpp/app_templates/prc-tool/prc-tool
new file mode 100644
index 00000000..d856c80b
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool
@@ -0,0 +1,11 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[fr]=Un simple programme de test Hello world
+Icon=chellogba.png
+Category=C/PalmOS
+Comment=Generates a template for palm application
+Comment[fr]=Gnre un modle d'application pour l'environnement PALM.
+#tShowFileAfterGeneration=README.devel
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=APPNAME.c
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop
new file mode 100644
index 00000000..2c5a6c0a
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevelop
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ <keywords>
+ <keyword>C</keyword>
+ <keyword>PalmOS</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="Makefile" name="Build" />
+ <group pattern="*.c" name="Source" />
+ </groups>
+ </kdevfileview>
+<kdevcustomproject>
+ <run>
+ <mainprogram>make test</mainprogram>
+ <programargs/>
+ <terminal>true</terminal>
+ <envvars/>
+ </run>
+ <envvars/>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <envvars/>
+ </make>
+ <makeenvvars/>
+ </kdevcustomproject>
+
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate
new file mode 100644
index 00000000..4216c466
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/prc-tool.kdevtemplate
@@ -0,0 +1,136 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[ca]=Programa Hello world
+Name[da]=Goddag verden program
+Name[de]="Hello World"-Programm
+Name[el]=Πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo»
+Name[et]="Tere,maailm" programm
+Name[eu]="Kaixo mundua" programa
+Name[fa]=برنامۀ Hello world
+Name[fr]=Programme « Bonjour monde »
+Name[ga]=Ríomhchlár "Hello world"
+Name[gl]=Programa Ola mundo
+Name[it]=Programma di "Hello world"
+Name[ja]=Hello world プログラム
+Name[nds]="Moin Welt"-Programm
+Name[ne]=हेल्डो वोल्ड कार्यक्रम
+Name[nl]=Hello World-programma
+Name[pl]=Program 'Witaj świecie'
+Name[pt]=Programa 'Olá mundo'
+Name[pt_BR]=Programa 'Olá mundo'
+Name[ru]=Программа Hello world
+Name[sk]=Ahoj svet program
+Name[sl]=Program Hello world
+Name[sr]=Програм „Здраво свете“
+Name[sr@Latn]=Program „Zdravo svete“
+Name[sv]=Hello world-program
+Name[tr]=Merhaba Dünya Programı
+Name[zh_CN]=Hello world 程序
+Name[zh_TW]=Hello world 程式
+Icon= # got none
+Category=C/PalmOS
+Comment=Generates a template for palm application
+Comment[ca]=Genera una plantilla d'aplicació per a Palm
+Comment[da]=Genererer en skabelon for et palm-program
+Comment[de]=Erstellt das Gerüst für eine Palm-Anwendung
+Comment[el]=Δημιουργία ενός προτύπου εφαρμογής για palm
+Comment[es]=Genera una plantilla para una aplicación Palm
+Comment[et]=Palmi rakenduse malli loomine.
+Comment[eu]=Palm aplikazio baten txantiloi bat sortzen du
+Comment[fa]=قالبی برای کاربرد palm تولید می‌کند
+Comment[fr]=Génère un modèle pour une application Palm
+Comment[gl]=Xera un modelo para aplicación palm
+Comment[hu]=Létrehoz egy Palm-os alkalmazássablont
+Comment[it]=Genera un modello per un'applicazione palm
+Comment[ja]=Palm アプリケーションのためのテンプレートを作成します
+Comment[nds]=Stellt dat Rahmenwark för en Palm-Programm op
+Comment[ne]=पाम अनुप्रयोगका लागि टेम्प्लेट उत्पन्न गर्दछ
+Comment[nl]=Genereert een sjabloon voor een Palm-toepassing
+Comment[pl]=Generuje szablon programu dla Palma
+Comment[pt]=Gera um modelo para aplicações do Palm
+Comment[pt_BR]=Gera um modelo para aplicações do Palm
+Comment[ru]=Создание простого приложения Palm
+Comment[sk]=Vygeneruje šablónu pre Palm aplikáciu
+Comment[sr]=Прави шаблон за palm програм
+Comment[sr@Latn]=Pravi šablon za palm program
+Comment[sv]=Skapar en mall för ett Palm-program
+Comment[tr]=Bir avuçiçi uygulaması için bir şablon yaratır
+Comment[zh_CN]=生成一个 Palm 应用程序的模板
+Comment[zh_TW]=產生一個 palm 應用程式樣本
+FileTemplates=h,CStyle,c,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAME}.c
+Archive=prc-tool.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/prc-tool.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/src-Makefile
+Dest=%{dest}/Makefile
+
+[FILE3]
+Type=install
+Source=%{src}/palmhello.c
+Dest=%{dest}/%{APPNAME}.c
+
+[FILE4]
+Type=install
+Source=%{src}/palmhello.pbitm
+Dest=%{dest}/%{APPNAME}.pbitm
+
+[FILE5]
+Type=install
+Source=%{src}/palmhello.rcp
+Dest=%{dest}/%{APPNAME}.rcp
+
+[FILE6]
+Type=install
+Source=%{src}/palmhelloRsc.h
+Dest=%{dest}/%{APPNAME}Rsc.h
+
+[FILE7]
+Type=install
+Source=%{src}/callback.h
+Dest=%{dest}/callback.h
+
+[MSG]
+Type=message
+Comment=A palm application was created in %{dest}
+Comment[ca]=Una aplicació per a Palm ha estat creada en %{dest}
+Comment[da]=Et palm-program blev oprettet i %{dest}
+Comment[de]=Eine Palm-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή palm δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Palm ha sido creada en %{dest}
+Comment[et]=Palmi rakendus loodi asukohta %{dest}
+Comment[eu]=Palm aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد palm در %{dest} ایجاد شد
+Comment[fr]=Une application Palm a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár Palm i %{dest}
+Comment[gl]=Creouse unha aplicación palm en %{dest}
+Comment[hu]=Létrejött egy Palmos alkalmazássablon itt: %{dest}
+Comment[it]=È stata creata un'applicazione palm in %{dest}
+Comment[ja]=Palm アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Palm-Programm opstellt
+Comment[ne]=पाम अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Palm-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program dla Palma został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Palm em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Palm em %{dest}
+Comment[ru]=Приложение Palm создано в %{dest}
+Comment[sk]=Palm aplikácia bola vytvorená v %{dest}
+Comment[sr]=Palm програм је направљен у %{dest}
+Comment[sr@Latn]=Palm program je napravljen u %{dest}
+Comment[sv]=Ett Palm-program skapades i %{dest}
+Comment[tr]=Bir avuçiçi uygulaması %{dest} içinde yaratıldı
+Comment[zh_CN]=在 %{dest} 中创建了一个 Palme 应用程序
+Comment[zh_TW]=一個 palm 應用程式樣本已建立於 %{dest}
diff --git a/languages/cpp/app_templates/prc-tool/src-Makefile b/languages/cpp/app_templates/prc-tool/src-Makefile
new file mode 100644
index 00000000..a64d5cfa
--- /dev/null
+++ b/languages/cpp/app_templates/prc-tool/src-Makefile
@@ -0,0 +1,63 @@
+## Makefile for PalmHello
+
+TARGET = palmhello
+APPNAME = "PalmHello"
+APPID = "0000"
+
+OBJS = $(TARGET).o
+LIBS =
+
+target=m68k-palmos-
+
+CC = $(target)gcc
+
+CFLAGS = -Wall -g -O2
+
+PILRC = pilrc
+OBJRES = $(target)obj-res
+NM = $(target)nm
+BUILDPRC = build-prc
+PILOTXFER = pilot-xfer
+
+all: $(TARGET).prc
+
+.S.o:
+ $(CC) $(TARGETFLAGS) -c $<
+
+.c.s:
+ $(CC) $(CSFLAGS) $<
+
+$(TARGET).prc: code0000.$(TARGET).grc code0001.$(TARGET).grc data0000.$(TARGET).grc pref0000.$(TARGET).grc rloc0000.$(TARGET).grc bin.res
+ $(BUILDPRC) $(TARGET).prc $(APPNAME) $(APPID) code0001.$(TARGET).grc code0000.$(TARGET).grc data0000.$(TARGET).grc *.bin pref0000.$(TARGET).grc rloc0000.$(TARGET).grc
+
+code0000.$(TARGET).grc: $(TARGET)
+ $(OBJRES) $(TARGET)
+
+code0001.$(TARGET).grc: code0000.$(TARGET).grc
+
+data0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+pref0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+rloc0000.$(TARGET).grc: code0000.$(TARGET).grc
+
+bin.res: $(TARGET).rcp $(TARGET).pbitm
+ $(PILRC) $(TARGET).rcp .
+ touch bin.res
+
+$(TARGET): $(OBJS)
+ $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS)
+ ! $(NM) -u $(TARGET) | grep .
+
+send: $(TARGET).prc
+ $(PILOTXFER) -i $(TARGET).prc
+
+depend:
+ makedepend -Y -I. *.c
+
+clean:
+ -rm -f *.[oa] $(TARGET) *.bin bin.res *.grc Makefile.bak
+
+veryclean: clean
+ -rm -f $(TARGET).prc pilot.ram pilot.scratch
+
diff --git a/languages/cpp/app_templates/qmakeapp/.kdev_ignore b/languages/cpp/app_templates/qmakeapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/qmakeapp/Makefile.am b/languages/cpp/app_templates/qmakeapp/Makefile.am
new file mode 100644
index 00000000..c70050fa
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.cpp qmakeapp.cpp qmakeapp.h qmakeapp.png qmakeapp.kdevelop \
+ qmakeapp.pro src.pro filesave.xpm fileopen.xpm fileprint.xpm
+
+templateName = qmakeapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/qmakeapp/fileopen.xpm b/languages/cpp/app_templates/qmakeapp/fileopen.xpm
new file mode 100644
index 00000000..880417ee
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/fileopen.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *fileopen[] = {
+" 16 13 5 1",
+". c #040404",
+"# c #808304",
+"a c None",
+"b c #f3f704",
+"c c #f3f7f3",
+"aaaaaaaaa...aaaa",
+"aaaaaaaa.aaa.a.a",
+"aaaaaaaaaaaaa..a",
+"a...aaaaaaaa...a",
+".bcb.......aaaaa",
+".cbcbcbcbc.aaaaa",
+".bcbcbcbcb.aaaaa",
+".cbcb...........",
+".bcb.#########.a",
+".cb.#########.aa",
+".b.#########.aaa",
+"..#########.aaaa",
+"...........aaaaa"
+};
diff --git a/languages/cpp/app_templates/qmakeapp/fileprint.xpm b/languages/cpp/app_templates/qmakeapp/fileprint.xpm
new file mode 100644
index 00000000..6ada912f
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/fileprint.xpm
@@ -0,0 +1,24 @@
+/* XPM */
+static const char *fileprint[] = {
+" 16 14 6 1",
+". c #000000",
+"# c #848284",
+"a c #c6c3c6",
+"b c #ffff00",
+"c c #ffffff",
+"d c None",
+"ddddd.........dd",
+"dddd.cccccccc.dd",
+"dddd.c.....c.ddd",
+"ddd.cccccccc.ddd",
+"ddd.c.....c....d",
+"dd.cccccccc.a.a.",
+"d..........a.a..",
+".aaaaaaaaaa.a.a.",
+".............aa.",
+".aaaaaa###aa.a.d",
+".aaaaaabbbaa...d",
+".............a.d",
+"d.aaaaaaaaa.a.dd",
+"dd...........ddd"
+};
diff --git a/languages/cpp/app_templates/qmakeapp/filesave.xpm b/languages/cpp/app_templates/qmakeapp/filesave.xpm
new file mode 100644
index 00000000..bd6870f4
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/filesave.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *filesave[] = {
+" 14 14 4 1",
+". c #040404",
+"# c #808304",
+"a c #bfc2bf",
+"b c None",
+"..............",
+".#.aaaaaaaa.a.",
+".#.aaaaaaaa...",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".##........##.",
+".############.",
+".##.........#.",
+".##......aa.#.",
+".##......aa.#.",
+".##......aa.#.",
+"b............."
+};
diff --git a/languages/cpp/app_templates/qmakeapp/main.cpp b/languages/cpp/app_templates/qmakeapp/main.cpp
new file mode 100644
index 00000000..bd26f19a
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/main.cpp
@@ -0,0 +1,13 @@
+%{CPP_TEMPLATE}
+
+#include <qapplication.h>
+#include "%{APPNAMELC}.h"
+
+int main( int argc, char ** argv ) {
+ QApplication a( argc, argv );
+ %{APPNAME} * mw = new %{APPNAME}();
+ mw->setCaption( "%{APPNAME}" );
+ mw->show();
+ a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
+ return a.exec();
+}
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp b/languages/cpp/app_templates/qmakeapp/qmakeapp
new file mode 100644
index 00000000..51d73e69
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp
@@ -0,0 +1,11 @@
+# QMake application
+[General]
+Name=Application
+Name[fr]=Une Application Qt / QMake
+Icon=qmakeapp.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generate a QMake/Qt based application (crossplatform compatible)
+Comment[fr]=Gnre une application base sur Qt / QMake. Ce programme est multi platte-forme.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp
new file mode 100644
index 00000000..841f88d4
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp
@@ -0,0 +1,283 @@
+%{CPP_TEMPLATE}
+
+#include "%{APPNAMELC}.h"
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qtoolbar.h>
+#include <qtoolbutton.h>
+#include <qpopupmenu.h>
+#include <qmenubar.h>
+#include <qtextedit.h>
+#include <qfile.h>
+#include <qfiledialog.h>
+#include <qstatusbar.h>
+#include <qmessagebox.h>
+#include <qprinter.h>
+#include <qapplication.h>
+#include <qaccel.h>
+#include <qtextstream.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qwhatsthis.h>
+
+#include "filesave.xpm"
+#include "fileopen.xpm"
+#include "fileprint.xpm"
+
+%{APPNAME}::%{APPNAME}()
+ : QMainWindow( 0, "%{APPNAME}", WDestructiveClose )
+{
+ printer = new QPrinter;
+ QPixmap openIcon, saveIcon, printIcon;
+
+ QToolBar * fileTools = new QToolBar( this, "file operations" );
+ fileTools->setLabel( tr("File Operations") );
+
+ openIcon = QPixmap( fileopen );
+ QToolButton * fileOpen
+ = new QToolButton( openIcon, tr("Open File"), QString::null,
+ this, SLOT(choose()), fileTools, "open file" );
+
+ saveIcon = QPixmap( filesave );
+ QToolButton * fileSave
+ = new QToolButton( saveIcon, tr("Save File"), QString::null,
+ this, SLOT(save()), fileTools, "save file" );
+
+ printIcon = QPixmap( fileprint );
+ QToolButton * filePrint
+ = new QToolButton( printIcon, tr("Print File"), QString::null,
+ this, SLOT(print()), fileTools, "print file" );
+
+
+ (void)QWhatsThis::whatsThisButton( fileTools );
+
+ QString fileOpenText = tr("<p><img source=\"fileopen\"> "
+ "Click this button to open a <em>new file</em>. <br>"
+ "You can also select the <b>Open</b> command "
+ "from the <b>File</b> menu.</p>");
+
+ QWhatsThis::add( fileOpen, fileOpenText );
+
+ QMimeSourceFactory::defaultFactory()->setPixmap( "fileopen", openIcon );
+
+ QString fileSaveText = tr("<p>Click this button to save the file you "
+ "are editing. You will be prompted for a file name.\n"
+ "You can also select the <b>Save</b> command "
+ "from the <b>File</b> menu.</p>");
+
+ QWhatsThis::add( fileSave, fileSaveText );
+
+ QString filePrintText = tr("Click this button to print the file you "
+ "are editing.\n You can also select the Print "
+ "command from the File menu.");
+
+ QWhatsThis::add( filePrint, filePrintText );
+
+
+ QPopupMenu * file = new QPopupMenu( this );
+ menuBar()->insertItem( tr("&File"), file );
+
+
+ file->insertItem( tr("&New"), this, SLOT(newDoc()), CTRL+Key_N );
+
+ int id;
+ id = file->insertItem( openIcon, tr("&Open..."),
+ this, SLOT(choose()), CTRL+Key_O );
+ file->setWhatsThis( id, fileOpenText );
+
+ id = file->insertItem( saveIcon, tr("&Save"),
+ this, SLOT(save()), CTRL+Key_S );
+ file->setWhatsThis( id, fileSaveText );
+
+ id = file->insertItem( tr("Save &As..."), this, SLOT(saveAs()) );
+ file->setWhatsThis( id, fileSaveText );
+
+ file->insertSeparator();
+
+ id = file->insertItem( printIcon, tr("&Print..."),
+ this, SLOT(print()), CTRL+Key_P );
+ file->setWhatsThis( id, filePrintText );
+
+ file->insertSeparator();
+
+ file->insertItem( tr("&Close"), this, SLOT(close()), CTRL+Key_W );
+
+ file->insertItem( tr("&Quit"), qApp, SLOT( closeAllWindows() ), CTRL+Key_Q );
+
+ menuBar()->insertSeparator();
+
+ QPopupMenu * help = new QPopupMenu( this );
+ menuBar()->insertItem( tr("&Help"), help );
+
+ help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
+ help->insertItem( tr("About &Qt"), this, SLOT(aboutQt()) );
+ help->insertSeparator();
+ help->insertItem( tr("What's &This"), this, SLOT(whatsThis()), SHIFT+Key_F1 );
+
+ e = new QTextEdit( this, "editor" );
+ e->setFocus();
+ setCentralWidget( e );
+ statusBar()->message( tr("Ready"), 2000 );
+
+ resize( 450, 600 );
+}
+
+
+%{APPNAME}::~%{APPNAME}()
+{
+ delete printer;
+}
+
+
+
+void %{APPNAME}::newDoc()
+{
+ %{APPNAME} *ed = new %{APPNAME};
+ ed->setCaption(tr("Qt Example - Application"));
+ ed->show();
+}
+
+void %{APPNAME}::choose()
+{
+ QString fn = QFileDialog::getOpenFileName( QString::null, QString::null,
+ this);
+ if ( !fn.isEmpty() )
+ load( fn );
+ else
+ statusBar()->message( tr("Loading aborted"), 2000 );
+}
+
+
+void %{APPNAME}::load( const QString &fileName )
+{
+ QFile f( fileName );
+ if ( !f.open( IO_ReadOnly ) )
+ return;
+
+ QTextStream ts( &f );
+ e->setText( ts.read() );
+ e->setModified( FALSE );
+ setCaption( fileName );
+ statusBar()->message( tr("Loaded document %1").arg(fileName), 2000 );
+}
+
+
+void %{APPNAME}::save()
+{
+ if ( filename.isEmpty() ) {
+ saveAs();
+ return;
+ }
+
+ QString text = e->text();
+ QFile f( filename );
+ if ( !f.open( IO_WriteOnly ) ) {
+ statusBar()->message( tr("Could not write to %1").arg(filename),
+ 2000 );
+ return;
+ }
+
+ QTextStream t( &f );
+ t << text;
+ f.close();
+
+ e->setModified( FALSE );
+
+ setCaption( filename );
+
+ statusBar()->message( tr( "File %1 saved" ).arg( filename ), 2000 );
+}
+
+
+void %{APPNAME}::saveAs()
+{
+ QString fn = QFileDialog::getSaveFileName( QString::null, QString::null,
+ this );
+ if ( !fn.isEmpty() ) {
+ filename = fn;
+ save();
+ } else {
+ statusBar()->message( tr("Saving aborted"), 2000 );
+ }
+}
+
+
+void %{APPNAME}::print()
+{
+ // ###### Rewrite to use QSimpleRichText to print here as well
+ const int Margin = 10;
+ int pageNo = 1;
+
+ if ( printer->setup(this) ) { // printer dialog
+ statusBar()->message( tr("Printing...") );
+ QPainter p;
+ if( !p.begin( printer ) ) // paint on printer
+ return;
+
+ p.setFont( e->font() );
+ int yPos = 0; // y-position for each line
+ QFontMetrics fm = p.fontMetrics();
+ QPaintDeviceMetrics metrics( printer ); // need width/height
+ // of printer surface
+ for( int i = 0 ; i < e->lines() ; i++ ) {
+ if ( Margin + yPos > metrics.height() - Margin ) {
+ QString msg( "Printing (page " );
+ msg += QString::number( ++pageNo );
+ msg += ")...";
+ statusBar()->message( msg );
+ printer->newPage(); // no more room on this page
+ yPos = 0; // back to top of page
+ }
+ p.drawText( Margin, Margin + yPos,
+ metrics.width(), fm.lineSpacing(),
+ ExpandTabs | DontClip,
+ e->text( i ) );
+ yPos = yPos + fm.lineSpacing();
+ }
+ p.end(); // send job to printer
+ statusBar()->message( tr("Printing completed"), 2000 );
+ } else {
+ statusBar()->message( tr("Printing aborted"), 2000 );
+ }
+}
+
+void %{APPNAME}::closeEvent( QCloseEvent* ce )
+{
+ if ( !e->isModified() ) {
+ ce->accept();
+ return;
+ }
+
+ switch( QMessageBox::information( this, tr("Qt Application Example"),
+ tr("Do you want to save the changes"
+ " to the document?"),
+ tr("Yes"), tr("No"), tr("Cancel"),
+ 0, 1 ) ) {
+ case 0:
+ save();
+ ce->accept();
+ break;
+ case 1:
+ ce->accept();
+ break;
+ case 2:
+ default: // just for sanity
+ ce->ignore();
+ break;
+ }
+}
+
+
+void %{APPNAME}::about()
+{
+ QMessageBox::about( this, tr("Qt Application Example"),
+ tr("This example demonstrates simple use of "
+ "QMainWindow,\nQMenuBar and QToolBar."));
+}
+
+
+void %{APPNAME}::aboutQt()
+{
+ QMessageBox::aboutQt( this, tr("Qt Application Example") );
+}
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.h b/languages/cpp/app_templates/qmakeapp/qmakeapp.h
new file mode 100644
index 00000000..2d372da9
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.h
@@ -0,0 +1,39 @@
+%{H_TEMPLATE}
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#include <qmainwindow.h>
+
+class QTextEdit;
+
+class %{APPNAME}: public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}();
+ ~%{APPNAME}();
+
+protected:
+ void closeEvent( QCloseEvent* );
+
+private slots:
+ void newDoc();
+ void choose();
+ void load( const QString &fileName );
+ void save();
+ void saveAs();
+ void print();
+
+ void about();
+ void aboutQt();
+
+private:
+ QPrinter *printer;
+ QTextEdit *e;
+ QString filename;
+};
+
+
+#endif
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop
new file mode 100644
index 00000000..ef24a34b
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevelop
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>3</version>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ <root>%{QTDIR}</root>
+ <qmake>%{QMAKE}</qmake>
+ </qt>
+ </kdevcppsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <breakpoints/>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/gdb</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate
new file mode 100644
index 00000000..2fab0758
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.kdevtemplate
@@ -0,0 +1,182 @@
+# KDE Config File
+[General]
+Name=Qt3 Application
+Name[br]=Meziant Qt3
+Name[ca]=Aplicació Qt3
+Name[da]=Qt3-Program
+Name[de]=Qt3-Anwendung
+Name[el]=Εφαρμογή Qt3
+Name[es]=Aplicación Qt3
+Name[et]=Qt3 rakendus
+Name[fr]=Application Qt3
+Name[hu]=Qt3-alapú alkalmazások
+Name[it]=Applicazione Qt3
+Name[ja]=Qt3 アプリケーション
+Name[nds]=Qt3-Programm
+Name[nl]=Qt3-toepassing
+Name[pl]=Program Qt3
+Name[pt]=Aplicação do Qt3
+Name[pt_BR]=Aplicação do Qt3
+Name[ru]=Приложение Qt 3
+Name[sk]=Qt3 aplikácia
+Name[sr]=Qt3 програм
+Name[sr@Latn]=Qt3 program
+Name[sv]=Qt3-program
+Name[zh_TW]=Qt3 應用程式
+Icon=qmakeapp.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generate a QMake/Qt3 based application (crossplatform compatible)
+Comment[ca]=Genera una aplicació basada en QMake/Qt3 (multi plataforma)
+Comment[da]=Generér et QMake/Qt3 baseret program (krydsplatform kompatibel)
+Comment[de]=Erstellt eine auf QMake/Qt3 basierende Anwendung (plattformunabhängig)
+Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt3 (συμβατή με πολλαπλές πλατφόρμες)
+Comment[es]=Genera una aplicación basada en QMake/Qt3 (con compatibilidad multiplataforma)
+Comment[et]=Rakenduse loomine QMake'i/Qt3 põhjal (multiplatvormne)
+Comment[fr]=Génère une application basée sur QMake / Qt3 (compatible multi-plateforme)
+Comment[hu]=Létrehoz egy QMake/Qt3-alapú, keresztfordításra is alkalmas alkalmazást
+Comment[it]=Genera un'applicazione basata su QMake/Qt3 (compatibile multipiattaforma)
+Comment[ja]=QMake/Qt3 ベースのアプリケーションを作成 (クロスプラットフォーム)
+Comment[nds]=Stellt en op QMake/Qt3 opbuut Programm op (över Bedriefümgeven weg kompatibel)
+Comment[nl]=Genereert een Qmake/Qt3-gebaseerde toepassing (crossplatform compatible)
+Comment[pl]=Generuje program używający QMake i Qt3 (wieloplatformowy)
+Comment[pt]=Gera uma aplicação baseada no QMake/Qt3 (compatível com várias plataformas)
+Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt3 (compatível com várias plataformas)
+Comment[ru]=Создание использующее QMake кроссплатформенное приложение Qt 3
+Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt3 (multiplatformovo kompatibilnú)
+Comment[sr]=Прави програм на основи QMake/Qt3 (прекоплатформски компатибилан)
+Comment[sr@Latn]=Pravi program na osnovi QMake/Qt3 (prekoplatformski kompatibilan)
+Comment[sv]=Skapar ett Qmake/Qt3-baserat program (fungerar på andra plattformar)
+Comment[zh_TW]=產生一個 QMake/Qt3 為基礎的應用程式(跨平台相容)
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=qmakeapp.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qmakeapp.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/qmakeapp.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/src.pro
+Dest=%{dest}/src/src.pro
+
+[FILE4]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/qmakeapp.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE6]
+Type=install
+Source=%{src}/qmakeapp.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE7]
+Type=install
+Source=%{src}/fileopen.xpm
+Dest=%{dest}/src/fileopen.xpm
+
+[FILE8]
+Type=install
+Source=%{src}/filesave.xpm
+Dest=%{dest}/src/filesave.xpm
+
+[FILE9]
+Type=install
+Source=%{src}/fileprint.xpm
+Dest=%{dest}/src/fileprint.xpm
+
+[MSG]
+Type=message
+Comment=A Qt3/Qmake based application was created in %{dest}
+Comment[ca]=Una aplicació basada en Qt3/Qmake ha estat creada en %{dest}
+Comment[da]=Et Qt3/Qmake baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf QMake/Qt3 basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή βασισμένη στα Qt3/Qmake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en Qt3/Qmake ha sido creada en %{dest}
+Comment[et]=Rakendus QMake'i põhjal loodi asukohta %{dest}
+Comment[fr]=Une application basée sur Qt3 / Qmake a été créée dans %{dest}
+Comment[hu]=Létrejött egy Qt3/Qmake-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su Qt3/Qmake in %{dest}
+Comment[ja]=Qt3/QMake ベースのアプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op Qt3/Qmake opbuut Programm opstellt
+Comment[nl]=Een Qt3/Qmake-gebaseerde toepassing is aangemaakt in %{dest}
+Comment[pl]=Program używający QMake i Qt3 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada no Qt3/Qmake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada no Qt3/Qmake em %{dest}
+Comment[ru]=Использующее QMake приложение Qt 3 создано в %{dest}
+Comment[sk]=Aplikácia založená na Qt3/Qmake bola vytvorená v %{dest}
+Comment[sr]=Програм на основи Qt3/Qmake направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovi Qt3/Qmake napravljen je u %{dest}
+Comment[sv]=Ett Qmake/Qt3-baserat program skapades i %{dest}
+Comment[zh_TW]=一個 QMake/Qt3 為基礎的應用程式已建立於 %{dest}
+
+[QTDIR]
+Type=value
+ValueType=QString
+Value=QTDIR
+Comment=Directory where Qt3 is installed.
+Comment[ca]=Directori a on està instal·lat Qt3.
+Comment[da]=Katalog hvor Qt3 er installeret.
+Comment[de]=Qt3-Verzeichnis
+Comment[el]=Κατάλογος εγκατάστασης του Qt3.
+Comment[es]=Carpeta donde se ha instalado Qt3.
+Comment[et]=Kataloog, kuhu on paigaldatud Qt3.
+Comment[fr]=Dossier où Qt3 est installé.
+Comment[hu]=A Qt3 telepítési könyvtára
+Comment[it]=Cartella in cui è installato Qt3.
+Comment[ja]=Qt3 がインストールされているディレクトリ
+Comment[nds]=Orner, woneem Qt3 installeert is.
+Comment[nl]=Map waarin Qt3 is geïnstalleerd.
+Comment[pl]=Katalog, w którym zainstalowane jest Qt3.
+Comment[pt]=A pasta onde está instalado o Qt3.
+Comment[pt_BR]=A pasta onde está instalado o Qt3.
+Comment[ru]=Каталог с установленным Qt 3
+Comment[sk]=Priečinok kde je nainštalované Qt3.
+Comment[sr]=Директоријум у коме је Qt3 инсталиран.
+Comment[sr@Latn]=Direktorijum u kome je Qt3 instaliran.
+Comment[sv]=Katalog där Qt3 är installerat.
+Comment[zh_TW]=Qt3 的安裝目錄
+Default=
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake (Qt3).
+Comment[ca]=Ruta absoluta per a QMake (Qt3).
+Comment[da]=Absolut søgesti til QMake (Qt3).
+Comment[de]=Absoluter Pfad für QMake (Qt3).
+Comment[el]=Απόλυτη διαδρομή για το QMake (Qt3).
+Comment[es]=Ruta completa para QMake (Qt3).
+Comment[et]=QMake'i (Qt3) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour QMake (Qt3).
+Comment[hu]=A QMake (Qt3) teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake (Qt3).
+Comment[ja]= QMake (Qt3) の絶対パス
+Comment[nds]=Afsluut Padd för QMake (Qt3)
+Comment[nl]=Absoluut pad naar QMake (Qt3)
+Comment[pl]=Ścieżka bezwzględna do QMake (Qt3).
+Comment[pt]=Localização Absoluta do QMake (Qt3).
+Comment[pt_BR]=Localização Absoluta do QMake (Qt3).
+Comment[ru]=Абсолютный путь к QMake (Qt 3)
+Comment[sk]=Absolútna cesta ku QMake (Qt3).
+Comment[sr]=Апсолутна путања до QMake-ва (Qt3).
+Comment[sr@Latn]=Apsolutna putanja do QMake-va (Qt3).
+Comment[sv]=Absolut sökväg till Qmake (Qt3).
+Comment[zh_TW]=QMake (Qt3) 的絕對路徑
+Default=
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.png b/languages/cpp/app_templates/qmakeapp/qmakeapp.png
new file mode 100644
index 00000000..dda0a10b
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.pro b/languages/cpp/app_templates/qmakeapp/qmakeapp.pro
new file mode 100644
index 00000000..20f1cba4
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.pro
@@ -0,0 +1,6 @@
+SUBDIRS += src
+TEMPLATE = subdirs
+CONFIG += release \
+ warn_on \
+ qt \
+ thread
diff --git a/languages/cpp/app_templates/qmakeapp/src.pro b/languages/cpp/app_templates/qmakeapp/src.pro
new file mode 100644
index 00000000..d72522f9
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeapp/src.pro
@@ -0,0 +1,10 @@
+SOURCES += %{APPNAMELC}.cpp \
+ main.cpp
+HEADERS += %{APPNAMELC}.h
+TEMPLATE = app
+CONFIG += release \
+ warn_on \
+ thread \
+ qt
+TARGET = %{APPNAMELC}
+DESTDIR = ../bin
diff --git a/languages/cpp/app_templates/qmakeempty/Makefile.am b/languages/cpp/app_templates/qmakeempty/Makefile.am
new file mode 100644
index 00000000..57677d88
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeempty/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = qmakeempty.kdevelop \
+ qmakeempty.pro qmakeempty.png
+
+templateName = qmakeempty
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop
new file mode 100644
index 00000000..cd633ede
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>4</version>
+ <includestyle>4</includestyle>
+ <designerintegration>ExternalDesigner</designerintegration>
+ <qmake>%{QMAKE}</qmake>
+ <designer>%{DESIGNER}</designer>
+ </qt>
+ </kdevcppsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <breakpoints/>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/gdb</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ <type ext="qrc" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate
new file mode 100644
index 00000000..cb108705
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.kdevtemplate
@@ -0,0 +1,131 @@
+# KDE Config File
+[General]
+Name=Empty QMake Template
+Name[ca]=Plantilla QMake buida
+Name[da]=Tom QMake-skabelon
+Name[de]=Leere QMake-Vorlage
+Name[el]=Κενό πρότυπο του QMake
+Name[es]=Plantilla QMake vacía
+Name[et]=Tühi QMake'i mall
+Name[hu]=Üres QMake-alapú sablon
+Name[it]=Modello di QMake vuoto
+Name[nds]=Leddig QMake-Vörlaag
+Name[nl]=Leeg QMake-sjabloon
+Name[pl]=Pusty szablon QMake
+Name[pt]=Modelo do QMake Vazio
+Name[pt_BR]=Modelo do QMake Vazio
+Name[ru]=Пустой шаблон QMake
+Name[sk]=Prázdna šablóna založená na QMake
+Name[sr]=Празан шаблон QMake-а
+Name[sr@Latn]=Prazan šablon QMake-a
+Name[sv]=Tom Qmake-mall
+Name[zh_TW]=空的 QMake 樣本
+Icon=qmakeempty.png
+Category=C++/QMake project
+Comment=Generate an empty QMake based application (crossplatform compatible) - Needs Qt
+Comment[ca]=Genera una aplicació buida basada en QMake (compatible plataforma creuada) - Necessita Qt
+Comment[da]=Genererer et tomt QMake-baseret program (krydsplatformskompatibelt) - kræver Qt
+Comment[de]=Erstellt eine leere auf QMake basierende Anwendung (plattformunabhängig). - Benötigt Qt
+Comment[el]=Δημιουργία μιας κενής εφαρμογής βασισμένης στο QMake (crossplatform) - Βασίζεται στην Qt
+Comment[es]=Genera una aplicación vacía basada en QMake (con compatibilidad multiplataforma) - Necesita Qt
+Comment[et]=Tühja rakenduse loomine QMake'i põhjal (multiplatvormne) - vajalik on Qt
+Comment[hu]=Létrehoz egy üres QMake-alapú, keresztfordításra is alkalmas alkalmazást - Qt-t igényel
+Comment[it]=Genera un'applicazione basata su QMake vuoto (compatibile multipiattaforma) - serve Qt
+Comment[nds]=Stellt en op QMake opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt deit noot
+Comment[nl]=Genereer een leeg QMake-gebaseerd programma (crossplatform-compatible) - Heeft Qt nodig
+Comment[pl]=Generuje program używający QMake (wieloplatformowy) - wymaga biblioteki Qt
+Comment[pt]=Gera uma aplicação vazia baseada no QMake (compatível com várias plataformas) - Necessita do Qt4
+Comment[pt_BR]=Gera uma aplicação vazia baseada no QMake (compatível com várias plataformas) - Necessita do Qt4
+Comment[ru]=Создание каркаса кроссплатформенного приложения Qt, использующего QMake.
+Comment[sk]=Vygeneruje aplikáciu založenú na QMake (multiplatformovo kompatibilnú) - vyžaduje Qt
+Comment[sr]=Прави празан шаблон на основи QMake-а (прекоплатформски компатибилан) — захтева Qt
+Comment[sr@Latn]=Pravi prazan šablon na osnovi QMake-a (prekoplatformski kompatibilan) — zahteva Qt
+Comment[sv]=Skapar ett tomt Qmake-baserat program (fungerar på andra plattformar). Kräver Qt.
+Comment[zh_TW]=產生一個空的以 QMake 為基礎的(跨平台相容)應用程式─需要 Qt
+FileTemplates=h,CStyle,cpp,CStyle
+Archive=qmakeempty.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qmakeempty.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/qmakeempty.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MSG]
+Type=message
+Comment=A Qmake based application was created in %{dest}
+Comment[ca]=Una aplicació basada en QMake ha estat creada en %{dest}
+Comment[da]=Et Qmake-baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf Qmake basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Δημιουργήθηκε μια εφαρμογή βασισμένη σε Qmake στο %{dest}
+Comment[es]=Una aplicación basada en QMake ha sido creada en %{dest}
+Comment[et]=Rakendus QMake'i põhjal loodi asukohta %{dest}
+Comment[hu]=Létrejött egy Qmake-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su Qmake in %{dest}
+Comment[nds]=In %{dest} wöör en op QMake opbuut Programm opstellt
+Comment[nl]=Een Qmake-gebaseerd programma is aangemaakt in %{dest}
+Comment[pl]=Program oparty na QMake został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada no Qmake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada no Qmake em %{dest}
+Comment[ru]=Использующее QMake приложение создано в %{dest}
+Comment[sk]=Aplikácia založená na QMake bola vytvorená v %{dest}
+Comment[sr]=Програм на основу QMake-а направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovu QMake-a napravljen je u %{dest}
+Comment[sv]=Ett Qmake-baserat program skapades i %{dest}
+Comment[zh_TW]=一個以 Qmake 為基礎的應用程式已建立於 %{dest}
+
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake.
+Comment[ca]=Ruta absoluta per a QMake.
+Comment[da]=Absolut søgesti til QMake.
+Comment[de]=Absoluter Pfad für QMake.
+Comment[el]=Απόλυτη διαδρομή του QMake.
+Comment[es]=Ruta completa para QMake.
+Comment[et]=QMake absoluutne asukoht.
+Comment[hu]=A QMake teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake.
+Comment[nds]=Afsluut Padd för QMake
+Comment[nl]=Absoluut pad voor Qmake.
+Comment[pl]=Ścieżka bezwzględna do QMake.
+Comment[pt]=Localização Absoluta do QMake.
+Comment[pt_BR]=Localização Absoluta do QMake.
+Comment[ru]=Полный путь к QMake.
+Comment[sk]=Absolútna cesta ku QMake.
+Comment[sr]=Апсолутна путања до QMake-а.
+Comment[sr@Latn]=Apsolutna putanja do QMake-a.
+Comment[sv]=Absolut sökväg till Qmake.
+Comment[zh_TW]=QMake 的絕對路徑
+Default=
+
+[DESIGNER]
+Type=value
+ValueType=QString
+Value=DESIGNER
+Comment=Absolute Path for Designer.
+Comment[ca]=Ruta absoluta per a Designer.
+Comment[da]=Absolut søgesti til Designer
+Comment[de]=Absoluter Pfad für Designer.
+Comment[el]=Απόλυτη διαδρομή του Designer.
+Comment[es]=Ruta completa para Designer.
+Comment[et]=Disaineri absoluutne asukoht.
+Comment[hu]=A Designer teljes elérési útja.
+Comment[it]=Percorso assoluto per Designer.
+Comment[nds]=Afsluut Padd för Designer
+Comment[nl]=Absoluut pad voor Designer.
+Comment[pl]=Ścieżka bezwzględna do Projektanta.
+Comment[pt]=Localização Absoluta do Designer.
+Comment[pt_BR]=Localização Absoluta do Designer.
+Comment[ru]=Полный путь к Designer.
+Comment[sk]=Absolútna cesta ku Designer.
+Comment[sr]=Апсолутна путања до Designer-а.
+Comment[sr@Latn]=Apsolutna putanja do Designer-a.
+Comment[sv]=Absolut sökväg till Designer.
+Comment[zh_TW]=設計家(Designer)的絕對路徑
+Default=
diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.png b/languages/cpp/app_templates/qmakeempty/qmakeempty.png
new file mode 100644
index 00000000..332ea1c0
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.png
Binary files differ
diff --git a/languages/cpp/app_templates/qmakeempty/qmakeempty.pro b/languages/cpp/app_templates/qmakeempty/qmakeempty.pro
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/qmakeempty/qmakeempty.pro
diff --git a/languages/cpp/app_templates/qmakesimple/.kdev_ignore b/languages/cpp/app_templates/qmakesimple/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/.kdev_ignore
diff --git a/languages/cpp/app_templates/qmakesimple/Makefile.am b/languages/cpp/app_templates/qmakesimple/Makefile.am
new file mode 100644
index 00000000..a187172f
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.cpp qmakesimple.png app.kdevelop app.pro src.pro
+templateName = qmakesimple
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/qmakesimple/app.kdevelop b/languages/cpp/app_templates/qmakesimple/app.kdevelop
new file mode 100644
index 00000000..a77f86f3
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/app.kdevelop
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ <root>%{QTDIR}</root>
+ <qmake>%{QMAKE}</qmake>
+ </qt>
+ </kdevcppsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/gdb</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qmakesimple/app.pro b/languages/cpp/app_templates/qmakesimple/app.pro
new file mode 100644
index 00000000..8feb4aa4
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/app.pro
@@ -0,0 +1,2 @@
+TEMPLATE=subdirs
+SUBDIRS=src
diff --git a/languages/cpp/app_templates/qmakesimple/main.cpp b/languages/cpp/app_templates/qmakesimple/main.cpp
new file mode 100644
index 00000000..e91f9f22
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/main.cpp
@@ -0,0 +1,15 @@
+%{CPP_TEMPLATE}
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ printf("Hello, world!\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple b/languages/cpp/app_templates/qmakesimple/qmakesimple
new file mode 100644
index 00000000..e476a7bf
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/qmakesimple
@@ -0,0 +1,11 @@
+# KDE Config File
+[General]
+Name=Hello world program
+Name[fr]=Un simple programme de test Hello world
+Icon=qmakesimple.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generates a simple Hello world program in C++ using QMake based project manager
+Comment[fr]=Gnre un simple programme de test du type Hello world en utilisant QMake.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate b/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate
new file mode 100644
index 00000000..1d7cc7b1
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/qmakesimple.kdevtemplate
@@ -0,0 +1,158 @@
+# KDE Config File
+[General]
+Name=Qt3 Hello world program
+Name[ca]=Programa Hello world per a Qt3
+Name[da]=Qt3 Goddag verden program
+Name[de]="Hello World"-Programm (Qt3)
+Name[el]=Πρόγραμμα 'Γεια σου Κόσμε' για το Qt3
+Name[es]=Programa Qt3 «Hola mundo»
+Name[et]=Qt3 "Tere,maailm" programm
+Name[fr]=Programme « Bonjour monde » en Qt3
+Name[hu]=Qt3-alapú 'Hello world' program
+Name[it]=Programma di "Hello world" fatto in Qt3
+Name[ja]=Qt3 Hello world プログラム
+Name[nds]=Qt3-"Moin Welt"-Programm
+Name[nl]=Qt3 Hello world-programma
+Name[pl]=Program 'Witaj świecie' w Qt3
+Name[pt]=Programa 'Olá mundo' em Qt3
+Name[pt_BR]=Programa 'Olá mundo' em Qt3
+Name[ru]=Программа Qt 3
+Name[sk]=Qt3 Ahoj svet program
+Name[sr]=Програм „Здраво свете“ за Qt3
+Name[sr@Latn]=Program „Zdravo svete“ za Qt3
+Name[sv]=Qt3 Hello world-program
+Name[zh_TW]=Qt3 的 Hello world 程式
+Icon=qmakesimple.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generates a simple Hello world program in C++ using QMake/Qt3 based project manager
+Comment[ca]=Genera un simple programa de Hello world en C++ usant el gestor de projectes basat en QMake/Qt3
+Comment[da]=Genererer et simpelt Goddag verden program in C++ ved brug af QMake/Qt3 baseret projekthåndtering
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in C++ basierend auf dem QMake-Projektmanager und Qt3.
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα 'Γεια σου Κόσμε' σε C++ χρησιμοποιώντας διαχειριστή έργου βασισμένο στο QMake/Qt3
+Comment[es]=Genera un sencillo programa «Hola mundo» en C++ que usa un gestor de proyecto basado en QMake/Qt3
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine C++-s projektihalduriga QMake'i/Qt3 põhjal
+Comment[fr]=Génère un programme « Bonjour monde » simple en C++ utilisant un gestionnaire de projet basé sur QMake / Qt3
+Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot C++-ban, QMake/Qt3-alapú projektkezelővel
+Comment[it]=Genera un semplice programma di "Hello world" in C++ usando il gestore di progetto QMake/Qt3
+Comment[ja]=QMake/Qt3 ベースのプロジェクトマネージャを使って簡単な Hello World プログラムを C++ で作成します
+Comment[nds]=Stellt mit den op Qt3 un QMake opbuut Projektpleger en eenfach "Moin Welt"-Programm in C++ op
+Comment[nl]=Genereert een eenvoudig Hello World-programma in C++ met behulp van de QMake/Qt3-gebaseerde projectbeheerder
+Comment[pl]=Generuje prosty program "Witaj świecie" w C++ używając menedżera projektów QMake i Qt3
+Comment[pt]=Gera um programa simples Olá Mundo em C++, usando o gestor de projectos QMake/Qt3
+Comment[pt_BR]=Gera um programa simples Olá Mundo em C++, usando o gestor de projectos QMake/Qt3
+Comment[ru]=Создание простой программы на C++ с использованием QMake (Qt 3)
+Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v C++ s použitím QMake/Qt3 projektového manažéra
+Comment[sr]=Прави једноставан „Здраво свете“ програм у C++-у помоћу менаџера пројекта на основу QMake/Qt3
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u C++-u pomoću menadžera projekta na osnovu QMake/Qt3
+Comment[sv]=Skapar ett enkelt Hello world-program i C++ baserat på QMake/Qt3 projekthantering
+Comment[zh_TW]=產生一個使用 QMake/Qt3 專案管理員的簡單 C++ Hello world 程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=qmakesimple.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/src.pro
+Dest=%{dest}/src/src.pro
+
+[FILE4]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=A Qmake/Qt3 based hello world program was created in %{dest}
+Comment[ca]=Una programa de hello world basat en QMake/Qt3 ha estat creat en %{dest}
+Comment[da]=et Qmake/Qt3 baseret Goddag verden program blev oprettet i %{dest}
+Comment[de]=Ein auf QMake basierendes "Hello World"-Programm wurde in %{dest} erstellt.
+Comment[el]=Ένα πρόγραμμα 'Γεια σου Κόσμε' βασισμένο στο Qmake/Qt3 δημιουργήθηκε στο %{dest}
+Comment[es]=Un programa «Hola mundo» basado en QMake/Qt3 ha sido creado en %{dest}
+Comment[et]="Tere, maailm" programm QMake'i/Qt3 põhjal loodi asukohta %{dest}
+Comment[fr]=Un programme « Bonjour monde » basé sur QMake / Qt3 a été créé dans %{dest}
+Comment[hu]=Létrejött egy Qmake/Qt3-alapú 'Hello world' program itt: %{dest}
+Comment[it]=È stato creato un programma di "hello world" basato su Qmake/Qt3 in %{dest}
+Comment[ja]=QMake/Qt3 ベースの hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op Qt3 un QMake opbuut "Moin Welt"-Programm opstellt
+Comment[nl]=Een Qmake/Qt3-gebaseerd Hello World-programma is aangemaakt in %{dest}
+Comment[pl]=Prosty program używający Qmake/Qt3 został utworzony w %{dest}
+Comment[pt]=Foi criado um programa Olá Mundo, baseado no Qmake/Qt3, em %{dest}
+Comment[pt_BR]=Foi criado um programa Olá Mundo, baseado no Qmake/Qt3, em %{dest}
+Comment[ru]=Программа на Qt 3, использующая QMake, создана в %{dest}
+Comment[sk]=Ahoj svet program založený na Qmake/Qt3 bol vytvorený v %{dest}
+Comment[sr]=„Здраво свете“ на основу Qmake/Qt3 направљен је у %{dest}
+Comment[sr@Latn]=„Zdravo svete“ na osnovu Qmake/Qt3 napravljen je u %{dest}
+Comment[sv]=Ett Qmake/Qt3-baserat Hello world-program skapades i %{dest}
+Comment[zh_TW]=一個 Qmake/Qt3 為基礎的 hello world 程式已建立於 %{dest}
+
+
+[QTDIR]
+Type=value
+ValueType=QString
+Value=QTDIR
+Comment=Directory where Qt3 is installed.
+Comment[ca]=Directori a on està instal·lat Qt3.
+Comment[da]=Katalog hvor Qt3 er installeret.
+Comment[de]=Qt3-Verzeichnis
+Comment[el]=Κατάλογος εγκατάστασης του Qt3.
+Comment[es]=Carpeta donde se ha instalado Qt3.
+Comment[et]=Kataloog, kuhu on paigaldatud Qt3.
+Comment[fr]=Dossier où Qt3 est installé.
+Comment[hu]=A Qt3 telepítési könyvtára
+Comment[it]=Cartella in cui è installato Qt3.
+Comment[ja]=Qt3 がインストールされているディレクトリ
+Comment[nds]=Orner, woneem Qt3 installeert is.
+Comment[nl]=Map waarin Qt3 is geïnstalleerd.
+Comment[pl]=Katalog, w którym zainstalowane jest Qt3.
+Comment[pt]=A pasta onde está instalado o Qt3.
+Comment[pt_BR]=A pasta onde está instalado o Qt3.
+Comment[ru]=Каталог с установленным Qt 3
+Comment[sk]=Priečinok kde je nainštalované Qt3.
+Comment[sr]=Директоријум у коме је Qt3 инсталиран.
+Comment[sr@Latn]=Direktorijum u kome je Qt3 instaliran.
+Comment[sv]=Katalog där Qt3 är installerat.
+Comment[zh_TW]=Qt3 的安裝目錄
+Default=
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake (Qt3).
+Comment[ca]=Ruta absoluta per a QMake (Qt3).
+Comment[da]=Absolut søgesti til QMake (Qt3).
+Comment[de]=Absoluter Pfad für QMake (Qt3).
+Comment[el]=Απόλυτη διαδρομή για το QMake (Qt3).
+Comment[es]=Ruta completa para QMake (Qt3).
+Comment[et]=QMake'i (Qt3) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour QMake (Qt3).
+Comment[hu]=A QMake (Qt3) teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake (Qt3).
+Comment[ja]= QMake (Qt3) の絶対パス
+Comment[nds]=Afsluut Padd för QMake (Qt3)
+Comment[nl]=Absoluut pad naar QMake (Qt3)
+Comment[pl]=Ścieżka bezwzględna do QMake (Qt3).
+Comment[pt]=Localização Absoluta do QMake (Qt3).
+Comment[pt_BR]=Localização Absoluta do QMake (Qt3).
+Comment[ru]=Абсолютный путь к QMake (Qt 3)
+Comment[sk]=Absolútna cesta ku QMake (Qt3).
+Comment[sr]=Апсолутна путања до QMake-ва (Qt3).
+Comment[sr@Latn]=Apsolutna putanja do QMake-va (Qt3).
+Comment[sv]=Absolut sökväg till Qmake (Qt3).
+Comment[zh_TW]=QMake (Qt3) 的絕對路徑
+Default=
diff --git a/languages/cpp/app_templates/qmakesimple/qmakesimple.png b/languages/cpp/app_templates/qmakesimple/qmakesimple.png
new file mode 100644
index 00000000..494d83da
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/qmakesimple.png
Binary files differ
diff --git a/languages/cpp/app_templates/qmakesimple/src.pro b/languages/cpp/app_templates/qmakesimple/src.pro
new file mode 100644
index 00000000..e7a46a76
--- /dev/null
+++ b/languages/cpp/app_templates/qmakesimple/src.pro
@@ -0,0 +1,4 @@
+SOURCES=%{APPNAMELC}.cpp
+TARGET=%{APPNAMELC}
+DESTDIR=../bin
+TEMPLATE = app
diff --git a/languages/cpp/app_templates/qt4hello/Makefile.am b/languages/cpp/app_templates/qt4hello/Makefile.am
new file mode 100644
index 00000000..b285f781
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.cpp qt4hello.png qt4hello.kdevelop \
+ qt4hello.pro src.pro ReadMe
+
+templateName = qt4hello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/qt4hello/ReadMe b/languages/cpp/app_templates/qt4hello/ReadMe
new file mode 100644
index 00000000..87d23f71
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/ReadMe
@@ -0,0 +1,11 @@
+READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE
+----------------------------------------------
+
+Before compiling, check the Qt Options, go to
+Project->Project Options->C++ Support and open the Qt Options tab.
+
+Check that the Qt installation directory is correct for the Qt version you've chosen.
+
+------------------
+Andreas Pakulat
+July 2006
diff --git a/languages/cpp/app_templates/qt4hello/main.cpp b/languages/cpp/app_templates/qt4hello/main.cpp
new file mode 100644
index 00000000..cbff1d3c
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/main.cpp
@@ -0,0 +1,11 @@
+%{CPP_TEMPLATE}
+
+#include <QCoreApplication>
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+ qDebug("Hello from Qt 4!");
+ return 0;
+}
+
diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop b/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop
new file mode 100644
index 00000000..cd633ede
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/qt4hello.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>4</version>
+ <includestyle>4</includestyle>
+ <designerintegration>ExternalDesigner</designerintegration>
+ <qmake>%{QMAKE}</qmake>
+ <designer>%{DESIGNER}</designer>
+ </qt>
+ </kdevcppsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <breakpoints/>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/gdb</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ <type ext="qrc" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate b/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate
new file mode 100644
index 00000000..d1796a14
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/qt4hello.kdevtemplate
@@ -0,0 +1,160 @@
+# KDE Config File
+[General]
+Name=Basic Qt4 Application
+Name[ca]=Aplicació en Qt4 bàsica
+Name[da]=Basalt Qt4-program
+Name[de]=Einfache Qt4-Anwendung
+Name[el]=Βασική εφαρμογή Qt4
+Name[es]=Aplicación Qt4 básica
+Name[et]=Elementaarne Qt4 rakendus
+Name[fr]=Application Qt4 de base
+Name[hu]=Egyszerű Qt4-alapú alkalmazás
+Name[it]=Applicazione Qt4 base
+Name[ja]=基本的な Qt4 アプリケーション
+Name[nds]=Eenfach Qt4-Programm
+Name[nl]=Basis Qt4-toepassing
+Name[pl]=Prosty program w Qt4
+Name[pt]=Aplicação Básica em Qt4
+Name[pt_BR]=Aplicação Básica em Qt4
+Name[ru]=Простое приложение Qt 4
+Name[sk]=Základná Qt4 aplikácia
+Name[sr]=Основни Qt4 програм
+Name[sr@Latn]=Osnovni Qt4 program
+Name[sv]=Grundläggande Qt4-program
+Name[zh_TW]=基本 Qt4 應用程式
+Icon=qt4hello.png
+Category=C++/QMake project
+Comment=Generate a very simple QMake/Qt4 based application (crossplatform compatible) - Needs Qt4
+Comment[ca]=Genera una aplicació molt simple basada en QMake/Qt4 (multi plataforma) -requereix Qt4-
+Comment[da]=Generér et meget enkelt QMake/Qt4 baseret program (krydsplatform kompatibel) - behøver Qt4
+Comment[de]=Erstellt eine sehr einfache, auf QMake/Qt4 basierende Anwendung (plattformunabhängig). - Benötigt Qt4.
+Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt4 (συμβατή με πολλαπλές πλατφόρμες) -Απαιτεί το Qt4
+Comment[es]=Genera una aplicación muy sencilla basada en QMake/Qt4 (con compatibilidad multiplataforma) - Necesita Qt4
+Comment[et]=Väga lihtsa rakenduse loomine QMake'i/Qt4 põhjal (multiplatvormne) - vajalik on Qt4
+Comment[fr]=Génère une application basée sur QMake / Qt4 très simple (compatible multi-plateforme) - Nécessite Qt4
+Comment[hu]=Létrehoz egy QMake/Qt4-alapú, keresztfordításra is alkalmas alkalmazást - Qt4-et igényel
+Comment[it]=Genera una semplice applicazione basata su QMake/Qt4 (compatibile multipiattaforma) - serve Qt4
+Comment[nds]=Stellt en op QMake un Qt4 opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt4 deit noot
+Comment[nl]=Genereert een heel eenvoudig Qmake/Qt4-gebaseerde toepassing (crossplatform compatible) - heeft Qt4 nodig
+Comment[pl]=Generuje program używający QMake i Qt4 (wieloplatformowy)
+Comment[pt]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4
+Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4
+Comment[ru]=Создание простого кроссплатформенного приложения Qt 4, использующего QMake.
+Comment[sk]=Vygeneruje veľmi jednoduchú aplikáciu založenú na QMake/Qt4 (multiplatformovo kompatibilnú) - vyžaduje Qt4
+Comment[sr]=Прави једноставан програм на основи QMake/Qt4 (прекоплатформски компатибилан) — захтева Qt4
+Comment[sr@Latn]=Pravi jednostavan program na osnovi QMake/Qt4 (prekoplatformski kompatibilan) — zahteva Qt4
+Comment[sv]=Skapar ett mycket enkelt QMake/Qt4-baserat program (fungerar på andra plattformar). Kräver Qt4.
+Comment[zh_TW]=產生一個以 QMake/Qt4 為基礎的簡單應用程式(跨平台相容)─需要使用 Qt4
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/main.cpp,%{dest}/src/ReadMe
+Archive=qt4hello.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qt4hello.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/qt4hello.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/src.pro
+Dest=%{dest}/src/src.pro
+
+[FILE4]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/ReadMe
+Dest=%{dest}/src/ReadMe
+
+[MSG]
+Type=message
+Comment=A Qt4/Qmake based application was created in %{dest}
+Comment[ca]=Una aplicació basada en Qt4/Qmake ha estat creada en %{dest}
+Comment[da]=Et Qt4/Qmake baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf QMake/Qt4 basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή βασισμένη στα Qt4/Qmake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en Qt4/Qmake ha sido creada en %{dest}
+Comment[et]=Rakendus Qt4/QMake'i põhjal loodi asukohta %{dest}
+Comment[fr]=Une application basée sur Qt4 / Qmake a été créée dans %{dest}
+Comment[hu]=Létrejött egy Qt4/Qmake-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su Qt4/Qmake in %{dest}
+Comment[ja]=Qt4/QMake ベースのアプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op Qt4 un Qmake opbuut Programm opstellt
+Comment[nl]=Een Qt4/Qmake gebaseerde toepassing is aangemaakt in %{dest}
+Comment[pl]=Program używający QMake i Qt4 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest}
+Comment[ru]=Приложение Qt 4, использующее Qmake, создано в %{dest}
+Comment[sk]=Aplikácia založená na Qt4/Qmake bola vytvorená v %{dest}
+Comment[sr]=Програм на основу Qt4/Qmake направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovu Qt4/Qmake napravljen je u %{dest}
+Comment[sv]=Ett QMake/Qt4-baserat program skapades i %{dest}
+Comment[zh_TW]=一個 QMake/Qt4 為基礎的應用程式已建立於 %{dest}
+
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake (Qt4).
+Comment[ca]=Ruta absoluta per a QMake (Qt4).
+Comment[da]=Absolut søgesti til QMake (Qt4).
+Comment[de]=Absoluter Pfad für QMake (Qt4).
+Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4).
+Comment[es]=Ruta completa para QMake (Qt4).
+Comment[et]=QMake (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour QMake (Qt4).
+Comment[hu]=A QMake (Qt4) teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake (Qt4).
+Comment[ja]=QMake (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för QMake (Qt4)
+Comment[nl]=Absoluut pad naar QMake (Qt4).
+Comment[pl]=Ścieżka bezwzględna do QMake (Qt4).
+Comment[pt]=Localização Absoluta do QMake (Qt4).
+Comment[pt_BR]=Localização Absoluta do QMake (Qt4).
+Comment[ru]=Полный путь к QMake (Qt 4).
+Comment[sk]=Absolútna cesta ku QMake (Qt4).
+Comment[sr]=Апсолутна путања до QMake-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4).
+Comment[sv]=Absolut sökväg till QMake (Qt4).
+Comment[zh_TW]=QMake(Qt4)的絕對路徑
+Default=
+
+[DESIGNER]
+Type=value
+ValueType=QString
+Value=DESIGNER
+Comment=Absolute Path for Designer (Qt4).
+Comment[ca]=Ruta absoluta per a Designer (Qt4).
+Comment[da]=Absolut søgesti til Designer (Qt4).
+Comment[de]=Absoluter Pfad für Designer (Qt4).
+Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4).
+Comment[es]=Ruta completa para Designer (Qt4).
+Comment[et]=Disaineri (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour Designer (Qt4).
+Comment[hu]=A Designer (Qt4) teljes elérési útja
+Comment[it]=Percorso assoluto del Designer (Qt4).
+Comment[ja]=Designer (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för Designer (Qt4)
+Comment[nl]=Absoluut pad naar Designer (Qt4).
+Comment[pl]=Ścieżka bezwzględna do Designera (Qt4).
+Comment[pt]=Localização Absoluta do Designer (Qt4).
+Comment[pt_BR]=Localização Absoluta do Designer (Qt4).
+Comment[ru]=Полный путь к Designer (Qt 4).
+Comment[sk]=Absolútna cesta ku Designer (Qt4).
+Comment[sr]=Апсолутна путања до Designer-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4).
+Comment[sv]=Absolut sökväg till Designer (Qt4).
+Comment[zh_TW]=設計家(Qt4)的絕對路徑
+Default=
diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.png b/languages/cpp/app_templates/qt4hello/qt4hello.png
new file mode 100644
index 00000000..332ea1c0
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/qt4hello.png
Binary files differ
diff --git a/languages/cpp/app_templates/qt4hello/qt4hello.pro b/languages/cpp/app_templates/qt4hello/qt4hello.pro
new file mode 100644
index 00000000..7177d225
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/qt4hello.pro
@@ -0,0 +1,5 @@
+SUBDIRS += src
+TEMPLATE = subdirs
+CONFIG += warn_on \
+ qt \
+ thread \ No newline at end of file
diff --git a/languages/cpp/app_templates/qt4hello/src.pro b/languages/cpp/app_templates/qt4hello/src.pro
new file mode 100644
index 00000000..ae5bac37
--- /dev/null
+++ b/languages/cpp/app_templates/qt4hello/src.pro
@@ -0,0 +1,8 @@
+SOURCES += main.cpp
+TEMPLATE = app
+CONFIG += warn_on \
+ thread \
+ qt
+TARGET = %{APPNAMELC}
+DESTDIR = ../bin
+QT -= gui
diff --git a/languages/cpp/app_templates/qt4makeapp/Makefile.am b/languages/cpp/app_templates/qt4makeapp/Makefile.am
new file mode 100644
index 00000000..62c4c120
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = main.cpp qt4makeapp.cpp qt4makeapp.h qt4makeapp.png qt4makeapp.kdevelop \
+ qt4makeapp.pro src.pro application.qrc ReadMe filesave.xpm fileopen.xpm filenew.xpm \
+ editcopy.xpm editpaste.xpm editcut.xpm
+
+templateName = qt4makeapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/qt4makeapp/ReadMe b/languages/cpp/app_templates/qt4makeapp/ReadMe
new file mode 100644
index 00000000..87d23f71
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/ReadMe
@@ -0,0 +1,11 @@
+READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE
+----------------------------------------------
+
+Before compiling, check the Qt Options, go to
+Project->Project Options->C++ Support and open the Qt Options tab.
+
+Check that the Qt installation directory is correct for the Qt version you've chosen.
+
+------------------
+Andreas Pakulat
+July 2006
diff --git a/languages/cpp/app_templates/qt4makeapp/application.qrc b/languages/cpp/app_templates/qt4makeapp/application.qrc
new file mode 100644
index 00000000..c35b0695
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/application.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>editcopy.xpm</file>
+ <file>editcut.xpm</file>
+ <file>filenew.xpm</file>
+ <file>fileopen.xpm</file>
+ <file>editpaste.xpm</file>
+ <file>filesave.xpm</file>
+</qresource>
+</RCC> \ No newline at end of file
diff --git a/languages/cpp/app_templates/qt4makeapp/editcopy.xpm b/languages/cpp/app_templates/qt4makeapp/editcopy.xpm
new file mode 100644
index 00000000..8350ed0e
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/editcopy.xpm
@@ -0,0 +1,193 @@
+/* XPM */
+static char *editcopy[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 155 2",
+" c black",
+". c #191000",
+"X c #221700",
+"o c #2E2300",
+"O c #452E00",
+"+ c #433200",
+"@ c #493000",
+"# c #553800",
+"$ c #5D4600",
+"% c #6B5000",
+"& c #724B00",
+"* c #7D5E00",
+"= c #6E694F",
+"- c #7E795F",
+"; c #865900",
+": c #8A5C00",
+"> c #8B6800",
+", c #936200",
+"< c #926D00",
+"1 c #926B1A",
+"2 c #967000",
+"3 c #9B721D",
+"4 c #9B7625",
+"5 c #9E792A",
+"6 c #A47C00",
+"7 c #AA7D00",
+"8 c #A1761A",
+"9 c #A57816",
+"0 c #A4791D",
+"q c #AD8200",
+"w c #B28500",
+"e c #AE8530",
+"r c #B99626",
+"t c #97906D",
+"y c #B18D48",
+"u c #B49049",
+"i c #B89542",
+"p c #BA9C4D",
+"a c #BD9E52",
+"s c #BFA053",
+"d c #B8AE78",
+"f c #BEB47E",
+"g c #C49300",
+"h c #C89600",
+"j c #C19D2C",
+"k c #C1A43F",
+"l c #C09E4E",
+"z c #CFB457",
+"x c #C9B159",
+"c c #CAB573",
+"v c #D4BF7C",
+"b c #FFDF62",
+"n c #FFE064",
+"m c #FFE16D",
+"M c #FFE372",
+"N c #FFE479",
+"B c #A19D8E",
+"V c #ABA89A",
+"C c #BEB580",
+"Z c #BDB488",
+"A c #B8B496",
+"S c #AEADAA",
+"D c #B3AFA1",
+"F c #BCBBB6",
+"G c #BFBFB9",
+"H c #C0B680",
+"J c #C4BA85",
+"K c #C6BD8B",
+"L c #CBB589",
+"P c #C8BE88",
+"I c #C3BC90",
+"U c #CBC18C",
+"Y c #CCC493",
+"T c #D7CB8C",
+"R c #DAC786",
+"E c #D8C789",
+"W c #DAC98B",
+"Q c #D0C690",
+"! c #D4CA94",
+"~ c #D4CC9B",
+"^ c #D8CE98",
+"/ c #DCD29C",
+"( c #C6C3B7",
+") c #C8C6BE",
+"_ c #D5C5A5",
+"` c #DBC8A1",
+"' c #DBD4A2",
+"] c #DED9AE",
+"[ c #D9D5B1",
+"{ c #E0CC82",
+"} c #E8D98B",
+"| c #E8D991",
+" . c #E1D7A1",
+".. c #E5DBA5",
+"X. c #E4DCAB",
+"o. c #E8DDAA",
+"O. c #E1DCB2",
+"+. c #E1DCB8",
+"@. c #FFE683",
+"#. c #FFE78A",
+"$. c #FFE885",
+"%. c #FFE88D",
+"&. c #FFE992",
+"*. c #FFEC9D",
+"=. c #FFF09F",
+"-. c #ECE2AC",
+";. c #E5E0B6",
+":. c #E5E1B8",
+">. c #EBE4B6",
+",. c #EAE5BC",
+"<. c #F0E5A8",
+"1. c #FFEDA3",
+"2. c #FFEDA9",
+"3. c #F1E8B8",
+"4. c #FFEFB1",
+"5. c #FFF1A5",
+"6. c #FFF2AD",
+"7. c #FFF2B4",
+"8. c #FFF2BC",
+"9. c #CAC8C2",
+"0. c #D6D4CB",
+"q. c #DFDAC5",
+"w. c #D4D2D0",
+"e. c #E0D7C5",
+"r. c #E4DAC3",
+"t. c #E8DEC7",
+"y. c #E0DFD3",
+"u. c #E6E2C2",
+"i. c #E8E1C5",
+"p. c #EBE3CB",
+"a. c #EEE9C2",
+"s. c #E8E6DC",
+"d. c #F3EDC3",
+"f. c #F2EDCB",
+"g. c #F7F2CD",
+"h. c #FFF3C3",
+"j. c #FFF4CA",
+"k. c #FFF8C5",
+"l. c #FFF8CD",
+"z. c #FDF5D2",
+"x. c #FFF7D8",
+"c. c #FFF9D4",
+"v. c #FFF9DC",
+"b. c #E9E8E7",
+"n. c #F3EFE3",
+"m. c #F2F0E3",
+"M. c #F4F2EA",
+"N. c #FBF7E6",
+"B. c #FEF9E3",
+"V. c #FFFBEC",
+"C. c #F4F4F3",
+"Z. c #F8F7F6",
+"A. c #FEFCF4",
+"S. c #FEFEFC",
+"D. c None",
+/* pixels */
+"D.D.D.D.D.D.D.D.D.D.D.D.h g g g g g g g g g g w * D.D.D.D.D.",
+"D.D.D.D.D.D.D.D.D.D.D.D.g z.z.g.g.g.g.g.g.z.g.R 2 D.D.D.D.D.",
+"D.D.D.D.D.D.D.D.D.D.D.D.g z.d.3.3.3.3.3.3.>.f.g.z < D.D.D.D.",
+"D.D.D.D.D., : ; , : : : 7 a i a R -.-.-.-.' m.u.g.j > D.D.D.",
+"D.D.D.D., u y y L L L L ` t.t.e.e v -.-.-.Y b.S.+.d.q D.D.D.",
+"D.D.D.D., S.S.S.S.S.S.S.S.Z.b.S.e.i W o.o.K w.S.A.u.q D.D.D.",
+"D.D.D.D., S.S.S.A.S.S.S.S.M.w.S.S._ a E ..K 0.S.S.q.7 D.D.D.",
+"D.D.D.D., S.A.V.A.A.A.V.A.n.9.S.S.C._ a ..Y t = - A 6 D.D.D.",
+"D.D.D.D., A.A.V.A.V.V.V.A.n.9.S.S.S.Z.3 ' ' K Z A ] 7 D.D.D.",
+"D.D.D.D., A.V.B.V.V.B.V.V.n.( F S S G 5 ' | / / X.f.q D.D.D.",
+"D.D.D.D., A.V.x.B.x.V.B.N.B.e.D B V ) 3 / / ^ ^ ' a.q D.D.D.",
+"D.D.D.D., V.N.N.B.B.B.v.v.N.z.p.i.p.n.8 ^ / ! Q ' a.q D.D.D.",
+"D.D.D.D., B.B.x.v.x.z.j.j.x.z.z.c.B.B.0 ! ! ! ^ ' ,.q D.D.D.",
+"D.D.D.D., B.h.h.z.z.x.x.z.z.z.h.j.x.v.0 ! Q Y ! ~ ,.q D.D.D.",
+"D.D.D.D., v.c.k.x.h.j.j.j.z.8.h.k.j.v.0 U T U U ~ ,.q D.D.D.",
+"D.D.D.D., v.k.z.h.h.h.j.8.j.h.h.j.k.v.0 U U U U Y ;.q D.D.D.",
+"D.D.D.D., x.h.8.8.h.j.8.8.4.h.4.8.h.x.8 P H P P ~ ;.q D.D.D.",
+"D.D.D.D., v.h.4.4.8.8.4.1.z.h.8.4.h.c.8 H J H J Y ;.q D.D.D.",
+"D.D.D.D., c.2.z.j.4.*.1.1.8.2.2.*.2.l.8 J J H J U ] q D.D.D.",
+"D.D.D.D., l.h.2.4.4.1.%.1.&.2.4.8.7.k.8 f d f H U ] q D.D.D.",
+"D.D.D.D., z.8.#.1.4.1.*.1.1.1.*.N 4.l.8 f f C K ~ :.q D.D.D.",
+"D.D.D.D., 8.&.4.#.%.4.&.@.#.%.%.&.2.l.8 K K Y ~ ] ,.6 D.D.D.",
+"D.D.D.D., h.&.#.*.1.1.%.N N #.&.*.1.l.0 ' ] T x r 6 % D.D.D.",
+"D.D.D.D., 4.4.%.*.#.b &.N M b M 2.1.k.9 k 7 > $ o D.D.D.",
+"D.D.D.D., 7.&.N 5.&.N @.*.b N M N =.k., + D.D.D.",
+"D.D.D.D., 6.N N M M &.#.N 2.$.%.8.6.<.& D.D.D.D.D.",
+"D.D.D.D., 5.&.7.n $.m M 1.7.7.o.c 5 & @ D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 7.*.m %.=.&.7.} p 1 % # X D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 6.5.5.5.| a 1 & + . D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 6.-.a 1 & O . D.D.D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D.; : % O . D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D. D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D."
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/editcut.xpm b/languages/cpp/app_templates/qt4makeapp/editcut.xpm
new file mode 100644
index 00000000..9a118931
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/editcut.xpm
@@ -0,0 +1,252 @@
+/* XPM */
+static char *editcut[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 214 2",
+" c #000000",
+". c #0B0B0B",
+"X c #181300",
+"o c #1D190B",
+"O c #131313",
+"+ c #1B1B1B",
+"@ c #211E11",
+"# c #26231A",
+"$ c #2A2513",
+"% c #2E2912",
+"& c #2E2A19",
+"* c #372E0B",
+"= c #302A12",
+"- c #312C1B",
+"; c #3A320F",
+": c #3C3415",
+"> c #3C351B",
+", c #232323",
+"< c #2B2922",
+"1 c #2C2C2C",
+"2 c #302E26",
+"3 c #353120",
+"4 c #3F3B2D",
+"5 c #313131",
+"6 c #3A3A3A",
+"7 c #423814",
+"8 c #493E17",
+"9 c #413D2F",
+"0 c #423F32",
+"q c #4F4319",
+"w c #5C4A00",
+"e c #5F4F0D",
+"r c #514410",
+"t c #554813",
+"y c #4E472C",
+"u c #444136",
+"i c #4A483F",
+"p c #534B2B",
+"a c #504B37",
+"s c #514C3A",
+"d c #654F04",
+"f c #604F0B",
+"g c #665200",
+"h c #675509",
+"j c #6B5405",
+"k c #6C5807",
+"l c #6C590B",
+"z c #745B04",
+"x c #715D0A",
+"c c #7B5B02",
+"v c #625B3B",
+"b c #7E6815",
+"n c #6C643E",
+"m c #4D4B42",
+"M c #494949",
+"N c #504D43",
+"B c #54534C",
+"V c #515151",
+"C c #5D5B54",
+"Z c #656048",
+"A c #736A44",
+"S c #726C54",
+"D c #77725B",
+"F c #696968",
+"G c gray50",
+"H c #826203",
+"J c #806609",
+"K c #836907",
+"L c #8D6A03",
+"P c #9A6F00",
+"I c #9B7005",
+"U c #9E730E",
+"Y c #9C7511",
+"T c #85732C",
+"R c #88783B",
+"E c #AE7C00",
+"W c #A87B13",
+"Q c #847B53",
+"! c #827D64",
+"~ c #9C862E",
+"^ c #A98A1F",
+"/ c #B28D0A",
+"( c #B88D00",
+") c #B2821A",
+"_ c #B18E1B",
+"` c #B3941C",
+"' c #A88E2C",
+"] c #A28C36",
+"[ c #AE9224",
+"{ c #89815E",
+"} c #87826D",
+"| c #858174",
+" . c #888370",
+".. c #8E8A7D",
+"X. c #928C71",
+"o. c #A28E44",
+"O. c #AA9F74",
+"+. c #B9A456",
+"@. c #BDA85B",
+"#. c #B2A068",
+"$. c #C28700",
+"%. c #CC8E00",
+"&. c #C29A00",
+"*. c #C4962F",
+"=. c #CCA100",
+"-. c #D6A800",
+";. c #D1AC1B",
+":. c #DDB31A",
+">. c #D2A922",
+",. c #D4AE2B",
+"<. c #DBA12E",
+"1. c #DBA433",
+"2. c #DDB428",
+"3. c #D2B23B",
+"4. c #E6A200",
+"5. c #E8A509",
+"6. c #EAAF00",
+"7. c #EFAC1E",
+"8. c #F5A100",
+"9. c #FFAD02",
+"0. c #FCAF0D",
+"q. c #FCB005",
+"w. c #FFB60C",
+"e. c #FFBD00",
+"r. c #FFBD16",
+"t. c #E3B432",
+"y. c #E8BF3C",
+"u. c #F6BE2F",
+"i. c #C6A949",
+"p. c #D9A948",
+"a. c #D8AB52",
+"s. c #DBBA45",
+"d. c #C5B162",
+"f. c #ECB74D",
+"g. c #EFB841",
+"h. c #EFBE4A",
+"j. c #EABA55",
+"k. c #FDC006",
+"l. c #FFC10B",
+"z. c #FFC800",
+"x. c #FFC90D",
+"c. c #FAC113",
+"v. c #FBC11C",
+"b. c #FDC910",
+"n. c #EDC233",
+"m. c #F5C32D",
+"M. c #FFC728",
+"N. c #F4C537",
+"B. c #F6C63A",
+"V. c #F5CB36",
+"C. c #FFD73D",
+"Z. c #E9C659",
+"A. c #EAC85A",
+"S. c #FFDA4B",
+"D. c #FFDD5D",
+"F. c #E9CD6B",
+"G. c #FFD560",
+"H. c #FFE06C",
+"J. c gray56",
+"K. c #959595",
+"L. c gray62",
+"P. c #A6A18A",
+"I. c #A8A69E",
+"U. c #AEA895",
+"Y. c #B3AC8F",
+"T. c #B8AF8B",
+"R. c #B4AD96",
+"E. c #B8B199",
+"W. c #A4A4A4",
+"Q. c #AAAAAA",
+"!. c #B0ADA3",
+"~. c #BBB6A3",
+"^. c #B1B1B1",
+"/. c #B9B9B6",
+"(. c #BBBBBA",
+"). c #C5BC9D",
+"_. c #C2BCA2",
+"`. c #C1BEB5",
+"'. c #D2C38E",
+"]. c #DCC78C",
+"[. c #C7C0A7",
+"{. c #C7C2AE",
+"}. c #C7C3B2",
+"|. c #C5C2B8",
+" X c #CAC6B6",
+".X c #CBC9BE",
+"XX c #D9D3BB",
+"oX c #E6D08A",
+"OX c #E7DEBD",
+"+X c #ECDEB3",
+"@X c #FFF0B9",
+"#X c #C5C5C5",
+"$X c #CECCC7",
+"%X c #D0CEC5",
+"&X c #D0CFC8",
+"*X c #D2D1CB",
+"=X c #DBD6C5",
+"-X c #DBD7C9",
+";X c #D3D3D1",
+":X c #DBDBDB",
+">X c #E5E1D6",
+",X c #E5E3DA",
+"<X c #E8E5D9",
+"1X c #EDEADC",
+"2X c #FEF6DE",
+"3X c #E6E6E6",
+"4X c #E9E7E2",
+"5X c #E9E8E4",
+"6X c #EDECEA",
+"7X c #F2F1EB",
+"8X c #F1F1F1",
+"9X c #F8F7F4",
+"0X c #F9F8F8",
+"qX c None",
+/* pixels */
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqX5 5 5 1 , qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 V /.&XQ.F 1 , qXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 _.D.S.H.@X&X6 . qXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 S.=.w g &.C...+ qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 -.' + o t z.d., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX5 C V.@.+ 3 :.3., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX5 '.b.F.6 , 1 s.,., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX1 b ( n.OXE.E.F.^ + qXqXqXqXqXqXqXqX5 5 1 , ",
+"qXqXqXqXqXqXqX l x K A.oXoXZ.i., qXqXqXqXqXqX5 V &X0X6X, ",
+"qXqXqXqXqXqXqX 8 ( c.v.k.N.1 qXqXqXqX5 V $X0X0X9XXX, ",
+"qXqXqXqXqXqXqXqX O t 6.e.e.k.S O 5 5 V $X8X8X8X1XD : O ",
+"qXqXqXqXqXqXqXqXqXqX 3 J e.G.7X#.+ . 5 C |.3X3X5X4X_.4 % ",
+"qXqXqXqXqXqXqXqXqXqX q ].0X0X+X, B }.:X:X:X:X=XS & o ",
+"qXqXqXqXqXqXqXqXqXqXqX + M 8X8X7XU.Q.#X*X*X*XR.< % qX",
+"qXqXqXqXqXqXqXqXqXqXqXqX, 1 X6XW.G Q.L.^.{.Z @ . qXqX",
+"qXqXqXqXqXqXqXqXqXqX5 5 m P.W.:X6 . 3X/.X., @ qXqXqXqX",
+"qXqXqXqXqXqXqX5 5 5 n +.R.W.J.K.W.^.:X:X1Xm + qXqXqXqXqX",
+"qXqXqXqXqX5 5 i o.y.v.q./ P.I.} | R.&X*X;X8X ., qXqXqXqXqXqX",
+"qXqX5 5 5 R 3.M.5.E L 7.4._ 0 + O + i ).#X#X5X~., O qXqXqXqX",
+"qX5 u ] m.r.%.H r : , t.0.P 7 $ , { `.(.;X-X, + qXqXqX",
+"5 u 2.w.$.k t o , ~ h.P l , u T.^.#X<XN , qXqX",
+"5 >.9.U r . . , T B.*.x qX + , Q !.Q.<XC , qX",
+"p q.1.> . + 1 [ m.p.k . qXqXqXqX , u O.W.;X! + ",
+"4 8.j.` p 5 y ;.u.a.d % qXqXqXqXqXqX O , A P._., ",
+"1 x <.f.m.x.b.y.a.g ; qXqXqXqXqXqXqXqX + 0 v O ",
+" - h c W W W W z : qXqXqXqXqXqXqXqXqXqX . . ",
+" * e l l f X qXqXqXqXqXqXqXqXqXqXqXqXqX ",
+"qX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX qX",
+"qXqXqX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX"
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/editpaste.xpm b/languages/cpp/app_templates/qt4makeapp/editpaste.xpm
new file mode 100644
index 00000000..c29ad36b
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/editpaste.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *editpaste[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c black",
+". c #0D0900",
+"X c #191000",
+"o c #221700",
+"O c #2A1B00",
+"+ c #332200",
+"@ c #3E2900",
+"# c #3A2804",
+"$ c #4D3300",
+"% c #4B3E15",
+"& c #44391B",
+"* c #543800",
+"= c #5A3B00",
+"- c #4D4015",
+"; c #524E25",
+": c #5A4F2C",
+"> c #524E3D",
+", c #58562F",
+"< c #53503E",
+"1 c #5E623B",
+"2 c #634100",
+"3 c #684500",
+"4 c #6E4900",
+"5 c #614F11",
+"6 c #685416",
+"7 c #734C00",
+"8 c #784F00",
+"9 c #755B00",
+"0 c #7C5200",
+"q c #7C5A00",
+"w c #7B570F",
+"e c #69562F",
+"r c #786600",
+"t c #7F6A00",
+"y c #766300",
+"u c #60613F",
+"i c #7C6422",
+"p c #545143",
+"a c #54524B",
+"s c gray32",
+"d c #5D5D57",
+"f c #616641",
+"g c #67695D",
+"h c #6B734D",
+"j c #6C7553",
+"k c #616261",
+"l c #686A64",
+"z c #6B7162",
+"x c #727272",
+"c c #003DFF",
+"v c #0043FF",
+"b c #004BFF",
+"n c #0053FF",
+"m c #015AFF",
+"M c #0063FF",
+"N c #046DFF",
+"B c #0865FF",
+"V c #0378FF",
+"C c #1663FF",
+"Z c #1576FF",
+"A c #2678FF",
+"S c #6F7B84",
+"D c #77856D",
+"F c #7B8B75",
+"G c #0083FF",
+"H c #0197FF",
+"J c #0B92FF",
+"K c #1385FF",
+"L c #01A5FF",
+"P c #0DB5FF",
+"I c #3096FF",
+"U c #2DADFF",
+"Y c #2FBCFF",
+"T c #22C6FF",
+"R c #2AC5FF",
+"E c #30D0FF",
+"W c #38D5FF",
+"Q c #4493F1",
+"! c #5F83FF",
+"~ c #5F8AFF",
+"^ c #5290E4",
+"/ c #5F92FF",
+"( c #4CAAFE",
+") c #40B8FF",
+"_ c #779DCB",
+"` c #6693E2",
+"' c #6290FF",
+"] c #649DFF",
+"[ c #71A6E5",
+"{ c #79A4FF",
+"} c #7FB3FF",
+"| c #68B8F3",
+" . c #42DCFF",
+".. c #47E0FF",
+"X. c #58E9FF",
+"o. c #64C0EB",
+"O. c #6ADFEF",
+"+. c #825600",
+"@. c #845A00",
+"#. c #8B5C00",
+"$. c #905F00",
+"%. c #8C6103",
+"&. c #876807",
+"*. c #8A6111",
+"=. c #886E1B",
+"-. c #887600",
+";. c #8C7A00",
+":. c #936200",
+">. c #986800",
+",. c #926C22",
+"<. c #987A3F",
+"1. c #A07200",
+"2. c #A27511",
+"3. c #A97D15",
+"4. c #A77B14",
+"5. c #998712",
+"6. c #A68000",
+"7. c #A78F00",
+"8. c #AD8016",
+"9. c #AC9600",
+"0. c #BB8F00",
+"q. c #A99B2A",
+"w. c #B9A000",
+"e. c #B3A63C",
+"r. c #958D43",
+"t. c #988F44",
+"y. c #9A9346",
+"u. c #9F9948",
+"i. c #8B897C",
+"p. c #958F6F",
+"a. c #98937B",
+"s. c #A68443",
+"d. c #B08C41",
+"f. c #AF9462",
+"g. c #B39864",
+"h. c #B2A850",
+"j. c #BDB355",
+"k. c #C3972F",
+"l. c #C5A400",
+"z. c #CCAC00",
+"x. c #D7BB00",
+"c. c #CCA030",
+"v. c #CBB43E",
+"b. c #E4AD0C",
+"n. c #ECB600",
+"m. c #EDB900",
+"M. c #F2BB00",
+"N. c #C1B84C",
+"B. c #C1B757",
+"V. c #C5BB58",
+"C. c #C9BE5A",
+"Z. c #C2A978",
+"A. c #DFC000",
+"S. c #FDCB00",
+"D. c #F6C300",
+"F. c #FFD100",
+"G. c #FEDB00",
+"H. c #FFDF0E",
+"J. c #F5D500",
+"K. c #FBCD39",
+"L. c #FFE832",
+"P. c #FFE432",
+"I. c #CEC25C",
+"U. c #D7C648",
+"Y. c #DDC74B",
+"T. c #D0C55E",
+"R. c #D3C85F",
+"E. c #D5C960",
+"W. c #DDD264",
+"Q. c #E0CA4C",
+"!. c #E7D14E",
+"~. c #EFDA51",
+"^. c #F4D050",
+"/. c #F9D452",
+"(. c #FEDD53",
+"). c #E2D765",
+"_. c #E9DD69",
+"`. c #E6DD68",
+"'. c #FDDB6E",
+"]. c #FFEE4F",
+"[. c #FEE354",
+"{. c #FEEA55",
+"}. c #F7E153",
+"|. c #FFF056",
+" X c #ECE16A",
+".X c #F1E56D",
+"XX c #F7EA6F",
+"oX c #F7EB70",
+"OX c #F9EC70",
+"+X c #FEF372",
+"@X c #979486",
+"#X c gray60",
+"$X c #969596",
+"%X c #8AA193",
+"&X c #82A89B",
+"*X c #8CAEA3",
+"=X c #86A7A9",
+"-X c #8BA2B1",
+";X c #ACA580",
+":X c #A5A291",
+">X c #B3AF98",
+",X c #B8B7AF",
+"<X c #B3B2AB",
+"1X c #B1B1B1",
+"2X c #A6B8FF",
+"3X c #88DEE0",
+"4X c #8BF0FE",
+"5X c #A4CFC6",
+"6X c #BFD5FF",
+"7X c #BFDCFF",
+"8X c #C2AD82",
+"9X c #CBB489",
+"0X c #D2BF9B",
+"qX c #D1C19F",
+"wX c #C8C4AA",
+"eX c #CFCBB7",
+"rX c #D8C7A6",
+"tX c #D2C2A3",
+"yX c #D5CCB3",
+"uX c #DAD1A1",
+"iX c #DDD5BB",
+"pX c #D7D1B3",
+"aX c #ECE5BB",
+"sX c #F5EBB5",
+"dX c #F5ECBC",
+"fX c #F8EEB8",
+"gX c #FCF2BC",
+"hX c #CBCBCB",
+"jX c #D8D6C7",
+"kX c #DDDDDD",
+"lX c #E4DAC2",
+"zX c #ECE6C7",
+"xX c #EBE6D9",
+"cX c #E9E3D0",
+"vX c #F5EDC4",
+"bX c #F6EFC9",
+"nX c #F0EBD5",
+"mX c #F3EFDB",
+"MX c #FCF3C5",
+"NX c #FCF4CA",
+"BX c #F7F0CA",
+"VX c #F6F0D2",
+"CX c #F9F3D3",
+"ZX c #F9F4DC",
+"AX c #FFF8D4",
+"SX c #FFF9DB",
+"DX c #E7E7E4",
+"FX c #EBEBE9",
+"GX c #F1EDE1",
+"HX c #F9F6E5",
+"JX c #FDF9E4",
+"KX c #FEFBEB",
+"LX c #F6F2E6",
+"PX c #FEFCF3",
+"IX c #FEFDFD",
+"UX c #F4F4F3",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYXYX:.:.+ IXIXIXIXIXIXIXIXFX# +.7 YXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX>.k.c.6 FXkXkXkXDXkXkXkXx i b.>.+ YXYXYXYXYXYXYXYXYXYX",
+"YXYXYX:.'.K.=.hX1X1X1X1X1X1X1Xd &.0.%.* 7 #.#.:.$.#.2 YXYXYX",
+"YXYXYX:./.M.%.$Xk k d s s s e w >.2.d.s.Z.9XrXlXxX0X7 YXYXYX",
+"YXYXYX:.^.M.1.: % % - % 5 6 &.GXIXIXPXPXPXPXPXLXIXIXg.3 YXYX",
+"YXYX#X:.^.m.v.y.r.r.r.r.h.h.2.IXPXPXKXKXPXKXHXxXUXIXIXf.4 YX",
+"YXYX#X:.^.m.Y.I.B.j.j.j.V.I.4.PXKXJXKXJXKXKXmXjXFXIXIXUX+. YX",
+"YXYX#X:.^.m.Y.E.I.j.j.j.I.R.8.PXKXSXJXJXJXSXnXeXDXIXIXUX<. YX",
+"YXYXYX:./.M.!.W.R.I.T.R.E.W.8.UXJXJXSXSXSXSXnXeX:X@Xi.<X7 ",
+"YXYXYX:./.D.~._.`.W.W.W.W. X8.PXJXSXAXSXSXSXVXjX>X@X@X,X4 ",
+"YXYXYX:.(.S.}..X X X X X X X8.PXSXAXAXAXAXAXNXzXpXwXwXjX7 ",
+"YXYXYX:.(.S.[.OXOXOXoXoXt.; O s a p p p p a.AXMXvXaXzXGX+. ",
+"YXYXYX:.(.S.[.+X+X+XOX+X; 7X2X] / / ~ ! 2Xp MXNXNXNXSXKX+. YX",
+"YXYXYX:.(.F.|.+X+X+X+X+Xy., _ A m b v c ! p MXMXgXMXAXKX+. YX",
+"YXYXYX:.(.F.|.+X+X+X+X+X+Xj.& ^ B n b v ' < gXMXgXgXNXKX+. YX",
+"YXYXYX:.(.F.U.W.+X+X+X+X).y.g Q N m n b ~ < gXgXgXgXAXJXq YX",
+"YXYXYX:.[.l.j j y.I.j.r.1 =X( K N M m b ~ < gXgXgXgXNXKX+. YX",
+"YXYXYX:.[.t 5X4X&XD F =X| U J G V Z A C / < fXgXgXgXMXHX+. YX",
+"YXYXYX:.[.l.h 3XX...W T P L H K I [ S ` { < fXfXfXfXMXKX+. YX",
+"YXYXYX:.[.G.e.1 *XO...E R Y Y | -Xd Z.k 6X> fXfXfXfXBXJX+. YX",
+"YXYXYX:.[.G.{.`.u.1 F &X*X%Xz l a.uXfXp.> p.sXsXsXfXBXJX+. YX",
+"YXYXYX:.{.G.|.+X+X XN.q.5.7.q cXvXsXsXsXsXsXsXsXsXsXBXKX+. YX",
+"YXYXYX:.|.G.].|.L.H.G.G.G.A.1.JXvXsXsXsXsXsXsXsXfXdXCXPX+. YX",
+"YXYXYX:.{.G.G.G.G.G.x.w.;.t :.HXdXsXsXsXsXsXdXvXBXZXLXtX= YX",
+"YXYXYX:.{.G.J.x.9.;.r 9 q 0 #.KXvXsXaXsXvXBXCXHXiXg.*.= O YX",
+"YXYXYX:.L.9.-.y 9 q 0 = + #.HXbXdXbXVXZXcX8X,.3 $ . YX",
+"YXYXYX%.z.9 q 7 * o $.PXZXmXmX0Xs.0 $ X YX",
+"YXYXYX8 0 = o :.IXpXg.*.= O YXYXYXYX",
+"YXYXYX YXYX@.#.2 @ . YXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYX YXYXYXYXYXYXYXYXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/filenew.xpm b/languages/cpp/app_templates/qt4makeapp/filenew.xpm
new file mode 100644
index 00000000..85efceb2
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/filenew.xpm
@@ -0,0 +1,216 @@
+/* XPM */
+static char *filenew[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 178 2",
+" c black",
+". c #191000",
+"X c #221700",
+"o c #452E00",
+"O c #4A3100",
+"+ c #4E3400",
+"@ c #553800",
+"# c #604000",
+"$ c #6A4600",
+"% c #6D4800",
+"& c #704A00",
+"* c #724C00",
+"= c #744C00",
+"- c #764E00",
+"; c #785000",
+": c #805500",
+"> c #815500",
+", c #835700",
+"< c #865900",
+"1 c #875A00",
+"2 c #8A5B00",
+"3 c #8A5C00",
+"4 c #8B5C00",
+"5 c #8C5D00",
+"6 c #8D5D00",
+"7 c #8F5E00",
+"8 c #805911",
+"9 c #905F00",
+"0 c #906000",
+"q c #926000",
+"w c #946200",
+"e c #956300",
+"r c #966400",
+"t c #976400",
+"y c #956913",
+"u c #926C22",
+"i c #9B7732",
+"p c #B18D48",
+"a c #B28E49",
+"s c #B4904A",
+"d c #BAA373",
+"f c #A1A195",
+"g c #ABAB9F",
+"h c #ADADAB",
+"j c #AFAFAB",
+"k c #B3B3A6",
+"l c #BCBCB8",
+"z c #BFBFBC",
+"x c #CBB489",
+"c c #CBB58A",
+"v c #CDB78B",
+"b c #CAB891",
+"n c #C9BB9E",
+"m c #CEBEA2",
+"M c #C6C6BC",
+"N c #D9C8A8",
+"B c #E8E1BA",
+"V c #E8E1BB",
+"C c #FEFFA1",
+"Z c #FFFFA0",
+"A c #FEFFA3",
+"S c #FEFFA4",
+"D c #FEFFA6",
+"F c #FEFFA8",
+"G c #FEFFA9",
+"H c #FFFFA8",
+"J c #FEFFAA",
+"K c #FEFFAB",
+"L c #FFFFAB",
+"P c #FEFFAC",
+"I c #FFFFAC",
+"U c #FEFFAE",
+"Y c #FEFFAF",
+"T c #FEFFB0",
+"R c #FEFFB1",
+"E c #FFFFB0",
+"W c #FEFFB4",
+"Q c #FEFFB5",
+"! c #FFFFB4",
+"~ c #FEFFB8",
+"^ c #FEFFB9",
+"/ c #FFFFB8",
+"( c #FFFFB9",
+") c #FEFFBB",
+"_ c #FFFFBA",
+"` c #FEFFBD",
+"' c #FFFFBD",
+"] c #FEFFBE",
+"[ c #FFFFBE",
+"{ c #C8C8C1",
+"} c #CACAC4",
+"| c #CBCBC6",
+" . c #DBD2C1",
+".. c #DEDFCF",
+"X. c #D4D4D1",
+"o. c #E1D5C1",
+"O. c #E3D9C3",
+"+. c #E5DCCC",
+"@. c #E8E8D3",
+"#. c #ECECD7",
+"$. c #F0EBDA",
+"%. c #FEFFC2",
+"&. c #FEFFC3",
+"*. c #FFFFC2",
+"=. c #FEFFC7",
+"-. c #FFFFC7",
+";. c #FEFFCB",
+":. c #FEFFCC",
+">. c #FFFFCC",
+",. c #FEFFCE",
+"<. c #FEFFD0",
+"1. c #FEFFD1",
+"2. c #FFFFD0",
+"3. c #FFFFD1",
+"4. c #FFFFD3",
+"5. c #FEFFD5",
+"6. c #FFFFD5",
+"7. c #FEFFD6",
+"8. c #FEFFD7",
+"9. c #FFFFD6",
+"0. c #FFFFD8",
+"q. c #FEFFDA",
+"w. c #FFFFDA",
+"e. c #FFFFDB",
+"r. c #FFFFDC",
+"t. c #FEFFDE",
+"y. c #FEFFDF",
+"u. c #FFFFDE",
+"i. c #FFFFDF",
+"p. c #E9E9E7",
+"a. c #F3F3E9",
+"s. c #F3F3EB",
+"d. c #F5F5E8",
+"f. c #F8F8E3",
+"g. c #FEFFE0",
+"h. c LightYellow",
+"j. c #FFFFE1",
+"k. c #FEFFE3",
+"l. c #FFFFE3",
+"z. c #FDFEE7",
+"x. c #FEFFE4",
+"c. c #FEFFE5",
+"v. c #FFFFE4",
+"b. c #FBFBE9",
+"n. c #FEFFE8",
+"m. c #FFFFE8",
+"M. c #FFFFE9",
+"N. c #FFFFEA",
+"B. c #FEFFEC",
+"V. c #FEFFED",
+"C. c #FFFFEC",
+"Z. c #FFFFED",
+"A. c #FEFFEF",
+"S. c #F4F4F0",
+"D. c #F4F4F3",
+"F. c #F5F5F4",
+"G. c #F8F8F6",
+"H. c ivory",
+"J. c #FFFFF1",
+"K. c #FEFFF3",
+"L. c #FFFFF3",
+"P. c #FEFFF4",
+"I. c #FFFFF4",
+"U. c #FEFFF7",
+"Y. c #FFFFF6",
+"T. c #FFFFF7",
+"R. c #FBFBFB",
+"E. c #FFFFF8",
+"W. c #FFFFF9",
+"Q. c #FFFFFA",
+"!. c #FFFFFB",
+"~. c gray99",
+"^. c #FEFFFD",
+"/. c #FFFFFC",
+"(. c #FFFFFD",
+"). c #FFFFFE",
+"_. c gray100",
+"`. c None",
+/* pixels */
+"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.`.w 2 1 w 4 4 4 6 w 9 6 - `.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.r s p p c c c c N O.+.o.y # `.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.r ).).).).).).).).F.p.). .& o `.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w ).E.).E.).E.E.E.S.X.).R.n $ + `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w E.Y.Y.E.Y.E.E.E.a.| ).).D.m % `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w E.Y.Y.J.Y.J.Y.Y.a.| ).).).D.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.J.J.J.J.J.J.J.a.M l h h { ; `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.B.B.B.N.N.B.B.b...k f h } ; `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.N.N.N.N.N.N.N.l.f.#.@.#.a.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.l.l.l.l.l.l.l.l.l.l.l.l.J.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.r.l.l.r.l.r.l.r.l.r.l.r.J.1 `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w B.r.r.q.q.q.q.q.q.r.q.q.r.B.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w N.5.5.5.5.q.5.5.5.5.5.5.5.B., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w N.<.<.<.<.<.<.<.5.<.<.<.<.N., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.,.;.;.;.,.;.,.;.,.;.;.;.l., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.-.-.-.-.-.-.;.-.-.-.-.;.l.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.-.%.%.%.%.%.%.%.%.%.%.%.l., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w r.' ' ' ' ' ) ' ' ' ' ' ' r., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w r.) ) W ) ) ) ) ) ) W ) ) q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w q.W W W W W W W W W W W W q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.Y Y W Y Y Y Y Y Y Y Y Y 5., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.J J J Y J Y Y J Y J J Y q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.J J D J J D J D J W ) ,.$.- `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w <.Z D D Z D J Y ' ,.B b i - O `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w <.Z Z Z Y ) <.B d u & @ X `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w ,.J ) ,.B d y & o . `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.V d u & o . `.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.1 4 & o . `.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`."
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/fileopen.xpm b/languages/cpp/app_templates/qt4makeapp/fileopen.xpm
new file mode 100644
index 00000000..a6c33b62
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/fileopen.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *fileopen[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c black",
+". c #0B0900",
+"X c #130E00",
+"o c #161100",
+"O c #231A00",
+"+ c #352600",
+"@ c #3B311C",
+"# c #433100",
+"$ c #4F3B00",
+"% c #4A3E16",
+"& c #4A3D22",
+"* c #4D421A",
+"= c #54420D",
+"- c #4E4529",
+"; c #484338",
+": c #484233",
+"> c #5B4B24",
+", c #624500",
+"< c #674D00",
+"1 c #6D4D00",
+"2 c #6E4F17",
+"3 c #6D5200",
+"4 c #775500",
+"5 c #745B0F",
+"6 c #795200",
+"7 c #7A5A00",
+"8 c #715C18",
+"9 c #764B0A",
+"0 c #6C5423",
+"q c #6D592E",
+"w c #785E27",
+"e c #735626",
+"r c #665736",
+"t c #7A631D",
+"y c #7A672E",
+"u c #776535",
+"i c #5C5956",
+"p c #78704F",
+"a c #75726E",
+"s c #8D4F00",
+"d c #815700",
+"f c #835A00",
+"g c #8A5C00",
+"h c #866400",
+"j c #966100",
+"k c #956F00",
+"l c #9C6100",
+"z c #9D7500",
+"x c #856B2A",
+"c c #8C752A",
+"v c #8C723B",
+"b c #977939",
+"n c #A45D00",
+"m c #A26100",
+"M c #AA680D",
+"N c #AB6700",
+"B c #A07700",
+"V c #A57B00",
+"C c #AB7A00",
+"Z c #AA7300",
+"A c #AF721A",
+"S c #B87E00",
+"D c #B57B00",
+"F c #B0731A",
+"G c #B47C26",
+"H c #B77E28",
+"J c #897F59",
+"K c #977C40",
+"L c #927F58",
+"P c #807A6C",
+"I c #9C821D",
+"U c #9F8A35",
+"Y c #AC8000",
+"T c #B28500",
+"R c #B68800",
+"E c #BB8B00",
+"W c #A78337",
+"Q c #A28B31",
+"! c #AF9535",
+"~ c #B58E3A",
+"^ c #B88633",
+"/ c #B49936",
+"( c #BCA039",
+") c #998445",
+"_ c #978657",
+"` c #8B8264",
+"' c #8E8572",
+"] c #978864",
+"[ c #978C75",
+"{ c #9F9072",
+"} c #A38845",
+"| c #A48952",
+" . c #AA965C",
+".. c #A89156",
+"X. c #B5934D",
+"o. c #B39D45",
+"O. c #B49755",
+"+. c #AB984A",
+"@. c #AD9A65",
+"#. c #A79778",
+"$. c #A59874",
+"%. c #A29B7A",
+"&. c #A79775",
+"*. c #BDA959",
+"=. c #B3A46C",
+"-. c #B1A07F",
+";. c #B5A97A",
+":. c #BEB37B",
+">. c #C49200",
+",. c #C89500",
+"<. c #CC9800",
+"1. c #C69812",
+"2. c #D2A31C",
+"3. c #C2A63E",
+"4. c #D7AE37",
+"5. c #C29840",
+"6. c #C29B4E",
+"7. c #C2A641",
+"8. c #C6AA43",
+"9. c #C8AC45",
+"0. c #CBAF49",
+"q. c #CAA746",
+"w. c #C4A158",
+"e. c #CAA65D",
+"r. c #CEA857",
+"t. c #CFA95A",
+"y. c #C5AC50",
+"u. c #CDB14B",
+"i. c #CBB358",
+"p. c #CAB152",
+"a. c #D2AB59",
+"s. c #D1B54D",
+"d. c #D4B951",
+"f. c #D6BC5B",
+"g. c #DDB45E",
+"h. c #D9BD56",
+"j. c #D2B753",
+"k. c #DAAB48",
+"l. c #CEAE69",
+"z. c #CCAD67",
+"x. c #CCB662",
+"c. c #CAB26B",
+"v. c #C8B66B",
+"b. c #CEB775",
+"n. c #CEBE7F",
+"m. c #D3AD66",
+"M. c #D5BE64",
+"N. c #D4BF6D",
+"B. c #E4B34B",
+"V. c #E0B75F",
+"C. c #E1B85F",
+"Z. c #E4BA61",
+"A. c #E9BE63",
+"S. c #DDC159",
+"D. c #DAC269",
+"F. c #D4C176",
+"G. c #D8C67F",
+"H. c #E1C55D",
+"J. c #EFC05D",
+"K. c #F1C15E",
+"L. c #E0C264",
+"P. c #E5C961",
+"I. c #EDC164",
+"U. c #E9CD65",
+"Y. c #EFD36B",
+"T. c #F2C564",
+"R. c #F6C868",
+"E. c #F8C760",
+"W. c #FBCC6A",
+"Q. c #FDCB63",
+"!. c #F1D56D",
+"~. c #FFD06C",
+"^. c #F5D972",
+"/. c #FED175",
+"(. c #FADE77",
+"). c #E4C87A",
+"_. c #FEE27C",
+"`. c #8F9192",
+"'. c #9A9A96",
+"]. c #A79F83",
+"[. c #ADA583",
+"{. c #A7A399",
+"}. c #BBAC86",
+"|. c #BDB088",
+" X c #BBB298",
+".X c #A7A8A6",
+"XX c #ADAEB0",
+"oX c #B5B6B4",
+"OX c #BABCBC",
+"+X c #C6B38E",
+"@X c #D3BE80",
+"#X c #D0BC95",
+"$X c #C6BFA6",
+"%X c #C5C29D",
+"&X c #D2C283",
+"*X c #DAC789",
+"=X c #DBCA8B",
+"-X c #D5C489",
+";X c #DBCD94",
+":X c #D6C699",
+">X c #CFC8B1",
+",X c #C8C6B7",
+"<X c #D1C9A6",
+"1X c #DBD3BA",
+"2X c #E1C981",
+"3X c #E0CD91",
+"4X c #ECD686",
+"5X c #EBD69E",
+"6X c #FED682",
+"7X c #FED88B",
+"8X c #FEDC95",
+"9X c #E3CEA3",
+"0X c #EED9A9",
+"qX c #E7DCB9",
+"wX c #F4DDAF",
+"eX c #FFE68A",
+"rX c #FFE893",
+"tX c #FFEA9F",
+"yX c #FFE2A5",
+"uX c #FFE3AC",
+"iX c #FFECA7",
+"pX c #FFEDAE",
+"aX c #F1E0B6",
+"sX c #FDE5B4",
+"dX c #FFEEB4",
+"fX c #F8E5BB",
+"gX c #FFF0BC",
+"hX c #C5C7C8",
+"jX c #C7C8CA",
+"kX c #CCCECF",
+"lX c #CCCAC0",
+"zX c #CDCED0",
+"xX c #D1D1CF",
+"cX c #D1D3D4",
+"vX c #D6D8DA",
+"bX c #DADCDE",
+"nX c #DCDEE0",
+"mX c #DEE0E2",
+"MX c #E7DEC2",
+"NX c #EBE1C5",
+"BX c #F4E9C3",
+"VX c #F7EACE",
+"CX c #FEEAC3",
+"ZX c #FAEBCA",
+"AX c #FFF1C1",
+"SX c #FFF3CC",
+"DX c #FFF6DA",
+"FX c #E1E3E5",
+"GX c #E4E6E8",
+"HX c #E7E9EA",
+"JX c #E8E6E0",
+"KX c #E9EAEC",
+"LX c #ECEEF0",
+"PX c #EEF0F2",
+"IX c #F8F4E8",
+"UX c #F1F3F5",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX V E <.,.T YXYXYXYXYXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX< E 2.aXCXVXE 3 E <.E YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX R ,.5XCX8XQ.wX<.1.$.OX<. YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYX R >.L.ZXyXT.K.E.wX ..XKXKXR YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYX V E 4.ZXsXW.K.I.Z.O.{.KXUXUXMXk YXYX",
+"YXYXYXYXYXYX R E 7 YX< E 2.aXsX6XC.T.Z.w.[ xXUXUXUXUX2X3 YXYX",
+"YXYXYXYX R >.).5X,.T ,.5XCX8XK.T.A.a.] OXUXUXUXUXUXUX2.O YXYX",
+"YXYX Y E Z.ZXsX7XsX0XCXyXR.K.I.V._ .XUXUXUXUXUXLXKXJXV D N S 7 ",
+" z E 4.fXsX/.K.~./.6X~.I.I.C...'.KXUXPXPXPXLXKXGXbXl.N m.SXm.D ",
+" E 0XgX7XE.W.W.~.~.R.I.Z.w.' bXUXUXUXPXPXLXmXbX$X) ~ aXSXpXBXn ",
+" <.CXT.Q.~.W.W.R.I.A.t._ hXUXUXUXUXPXLXGXnX,X .t XAXSXeX4Xl.Z ",
+" <.sXB.W.W.W.T.A.g._ oXUXUXUXUXUXLXLXmXcX=.5 $.BXgXeX!.D.3Xm + ",
+" <.sXB.R.R.A.V.| {.KXUXUXUXUXLXKXGXvX|.c u qXdXgX^.U.f.3XH f ",
+" <.sXB.T.Z.m.[ nXUXUXUXUXPXKXHXbX,X) e <XdXiX_.S.u.P.F.t.h ",
+" <.sXk.Z.r.K jXUXUXUXPXLXKXmXcX@.5 %.DXiX_.Y.S.d.h.D.*Xl X ",
+" <.wXq.r.X.r UXUXPXPXKXmXvX|.y _ NXdXrX!.S.d.h.d.f.=XF 4 YX",
+" ,.0X5.X.) a PXPXKXGXnX>X) y >XAXAX_.S.h.h.u.s.d.F.6.g YX",
+" >.9X~ } u '.LXKXmXxX .5 [.IXAX_.!.S.h.h.d.8.s.D.n.j YXYX",
+" >.:XW v & kXmXvX;.t ] BXAXrX!.U.u.S.9.u.3.7.i.;XM 1 YXYXYX",
+" E #Xb u : nXcX_ u 1XSXgX^.U.H.S.d.8.s.d.u.b.-XG g YXYXYXYX",
+" R +Xc r a zX[.= -XdX_.U.d.P.h.d.u.3.8.N.=Xw.l 1 YXYXYXYX",
+" T }.x > `.oX> %.*.S.S.h.S.7.d.h.0.p.n.c.M d . YXYXYXYXYX",
+" C ].w @ XXu p *.( h.S.s.u.u.u.p.N.*X^ g + YXYXYXYXYXYX",
+" Z &.e ; ` * :.o.S.S.S.u.( 9.x.&XX.j , YXYXYXYXYXYX",
+" B { 0 i % [.o.u.S.d.h.9.M.&Xz.M 6 YXYXYXYXYXYXYXYX",
+" z { 0 - J *./ S.9.d.i.G.&XF g O YXYXYXYXYXYXYXYXYXYX",
+" z $.2 w =.! s.d.p.N.;X^ l , YXYXYXYXYXYXYXYXYXYXYX",
+" B &.9 ;.Q / j.x.@Xl.m 6 YXYXYXYXYXYXYXYXYXYXYXYXYX",
+" h W @.+.I y.&Xb.F 7 O YXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" $ s %XU F.=X^ j # YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" g O.<Xe.l 1 YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" o f n d . YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/filesave.xpm b/languages/cpp/app_templates/qt4makeapp/filesave.xpm
new file mode 100644
index 00000000..86ea7d63
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/filesave.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *filesave[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c #000000",
+". c #06060A",
+"X c #09090D",
+"o c #0B0B16",
+"O c #101022",
+"+ c #1E1E28",
+"@ c #181829",
+"# c #151F3A",
+"$ c #1A263F",
+"% c #1D2A3F",
+"& c #272730",
+"* c #2E2E3F",
+"= c #212140",
+"- c #212E41",
+"; c #2F2F41",
+": c #292A4A",
+"> c #23224B",
+", c #262353",
+"< c #292655",
+"1 c #2B2C54",
+"2 c #2C2C5B",
+"3 c #293746",
+"4 c #2D304F",
+"5 c #243243",
+"6 c #2E315D",
+"7 c #363647",
+"8 c #303E4A",
+"9 c #30325E",
+"0 c #3C3C53",
+"q c #2E2E60",
+"w c #2F3160",
+"e c #302E63",
+"r c #313164",
+"t c #363861",
+"y c #353868",
+"u c #384650",
+"i c #284F6B",
+"p c #2D547B",
+"a c #3B486A",
+"s c #36597D",
+"d c #3D5D7C",
+"f c #4C4C4C",
+"g c #40405A",
+"h c #414E56",
+"j c #4B585E",
+"k c #49545E",
+"l c #555555",
+"z c #4D4D6B",
+"x c #434675",
+"c c #4B5660",
+"v c #4F5962",
+"b c #41517E",
+"n c #4B507D",
+"m c #515C67",
+"M c #505D6E",
+"N c #5C5D7D",
+"B c #546066",
+"V c #54626D",
+"C c #5B646D",
+"Z c #55677A",
+"A c #556B78",
+"S c #5D6772",
+"D c #6B6B6B",
+"F c #646464",
+"G c #616C73",
+"H c #63707D",
+"J c #6B7679",
+"K c gray45",
+"L c #00418E",
+"P c #004494",
+"I c #004894",
+"U c #044F98",
+"Y c #03509B",
+"T c #0A5198",
+"R c #13579C",
+"E c #185DA1",
+"W c #285888",
+"Q c #2B6094",
+"! c #396D9A",
+"~ c #336A96",
+"^ c #3D719B",
+"/ c #226EB8",
+"( c #326EA8",
+") c #326BA3",
+"_ c #3673AE",
+"` c #3A76B4",
+"' c #0B6FD1",
+"] c #0F75D8",
+"[ c #1479DA",
+"{ c #1B7CDC",
+"} c #466481",
+"| c #42749C",
+" . c #4A799E",
+".. c #506A84",
+"X. c #5F678D",
+"o. c #576391",
+"O. c #5A6592",
+"+. c #5F6893",
+"@. c #5B738B",
+"#. c #507DA1",
+"$. c #626283",
+"%. c #636A94",
+"&. c #656F98",
+"*. c #657A8F",
+"=. c #6B7299",
+"-. c #717191",
+";. c #797998",
+":. c #687BA6",
+">. c #2281DC",
+",. c #3F81C0",
+"<. c #3988D7",
+"1. c #2785E1",
+"2. c #2E8AE3",
+"3. c #368FE5",
+"4. c #3690E6",
+"5. c #3D93E7",
+"6. c #3D94E9",
+"7. c #57839E",
+"8. c #4787BC",
+"9. c #5480A1",
+"0. c #5B84A3",
+"q. c #6E8496",
+"w. c #6E8B9A",
+"e. c #7D848E",
+"r. c #728597",
+"t. c #738598",
+"y. c #768899",
+"u. c #7B8B9B",
+"i. c #6489A5",
+"p. c #698EA7",
+"a. c #6D8FA9",
+"s. c #6E81AB",
+"d. c #7683A6",
+"f. c #768CB7",
+"g. c #7395AD",
+"h. c #7C96B0",
+"j. c #4086CA",
+"k. c #4986C3",
+"l. c #4284C3",
+"z. c #498ED2",
+"x. c #4D95DB",
+"c. c #548DC5",
+"v. c #5D92C8",
+"b. c #5593C9",
+"n. c #5097DE",
+"m. c #5198DE",
+"M. c #4296E7",
+"N. c #4895E2",
+"B. c #4B99E5",
+"V. c #4A9CEB",
+"C. c #4599EB",
+"Z. c #529DE6",
+"A. c #589EE2",
+"S. c #54A1EB",
+"D. c #5AA1E6",
+"F. c #5AA5EB",
+"G. c #5EA8EF",
+"H. c #53A3F1",
+"J. c #5EAAF2",
+"K. c #6699CB",
+"L. c #799BC8",
+"P. c #7EA6C9",
+"I. c #60A2E5",
+"U. c #65A7E8",
+"Y. c #6BABE9",
+"T. c #68ADF2",
+"R. c #67B0F5",
+"E. c #6DB3F6",
+"W. c #70ADEA",
+"Q. c #75B0E9",
+"!. c #7CB5EB",
+"~. c #73B9F8",
+"^. c #7BBDFB",
+"/. c #7CBAF6",
+"(. c gray55",
+"). c #828899",
+"_. c #84949E",
+"`. c #918E8A",
+"'. c #949494",
+"]. c #8F8FA9",
+"[. c #8997A5",
+"{. c #8A9AA9",
+"}. c #9A9BAF",
+"|. c #9399A9",
+" X c #9FAAB5",
+".X c #A29E9B",
+"XX c #A7A7A7",
+"oX c #ABABAB",
+"OX c #A3A3B4",
+"+X c #A8A8B7",
+"@X c #A3ABB3",
+"#X c #B4B5B5",
+"$X c #B0B0BC",
+"%X c #B7B9BC",
+"&X c #BBB7B3",
+"*X c #BBBBBB",
+"=X c #82B1DB",
+"-X c #81B7EC",
+";X c #88BBED",
+":X c #86BAED",
+">X c #AEBBC8",
+",X c #A6BDCD",
+"<X c #BBBCC3",
+"1X c #81C1F6",
+"2X c #83C2FA",
+"3X c #89C4FA",
+"4X c #8CC8FC",
+"5X c #95C2EF",
+"6X c #93CBFD",
+"7X c #9BCFFF",
+"8X c #97D0FC",
+"9X c #9CD3FE",
+"0X c #BEC0C1",
+"qX c #A3C7E7",
+"wX c #A2CAF1",
+"eX c #A1D4FF",
+"rX c #A3D8FF",
+"tX c #AADBFF",
+"yX c #B0D1F2",
+"uX c #BDD9F4",
+"iX c #AAE0FF",
+"pX c #B3E1FF",
+"aX c #B9E6FF",
+"sX c #BEE9FF",
+"dX c #C4C4C4",
+"fX c #C6C5CD",
+"gX c #C6C8CB",
+"hX c #CAC7C4",
+"jX c #CAC8C6",
+"kX c #CBCCCB",
+"lX c #D1D0CE",
+"zX c #D3D3D3",
+"xX c #D4D7D9",
+"cX c #D8D8D7",
+"vX c #DBDBDB",
+"bX c #C4ECFF",
+"nX c #C9E0F6",
+"mX c #C4F5FF",
+"MX c #CCF2FF",
+"NX c #D5E6F7",
+"BX c #DDEBF9",
+"VX c #DCFDFF",
+"CX c #D3F1F5",
+"ZX c #E1E0DE",
+"AX c #E4E3E3",
+"SX c #E4E7EA",
+"DX c #E7E8E9",
+"FX c #E8E6E4",
+"GX c #EDE9E5",
+"HX c #EBEBEB",
+"JX c #E7EEF5",
+"KX c #EAF2FA",
+"LX c #F1EEEA",
+"PX c #F3F3F3",
+"IX c #F4F8FC",
+"UX c #FDFDFC",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXy y e 6 6 2 < < , , 1 YXYX",
+"YXYXYX2 < , , q w 2 e r r r w e w r e 2 6 1 6 s :.f.L.y YXYX",
+"YXYXYXx d.s.:.a # $ $ % - 5 3 8 u h k B S J ).,XF.b.7.r YXYX",
+"YXYXYX&.mX~.8.V #X#X%XdXfXzXxXvXZXZXDXFXFXDXLXDX>.U i 9 YXYX",
+"YXYXYXo.2X] L C UXDXcXzXkXkXkXjXjXdXdX%X%X&X%X*XN.' ~ 6 YXYX",
+"YXYXYXo.1X] P k hXoXXXXXoXoX#X#X*X%X&X%X%XdXkXxXx.[ ~ 6 YXYX",
+"YXYXYXO.3X[ I m FXkXjXjXkXkXkXkXkXkXzXzXzXcXZXSXx.{ ! 6 YXYX",
+"YXYXYXo.3X{ I S UXvXxXzXkXkXkXkXkXjXdX*X%X#X&X%XZ.1.^ 9 YXYX",
+"YXYXYXO.4X>.U j jX#X#X#X%XdXdXkXzXkXzXzXcXvXDXJXA.1.| 6 YXYX",
+"YXYXYXO.6X>.T V PXZXZXZXAXSXDXDXFXHXDXHXHXHXHXSXI.2.| 9 YXYX",
+"YXYXYXO.6X2.T G UXLXDXDXAXZXZXAXZXvXcXzXkXkXkXgXY.3. .6 YXYX",
+"YXYXYXO.9X4.R m zXdXdXkXzXvXAXDXHXLXPXPXIXUXUXUXQ.6. .9 YXYX",
+"YXYXYXO.9X5.R H UXIXUXUXUXUXUXUXUXUXUXUXIXKXJXBX-XC.#.9 YXYX",
+"YXYXYXO.eXM./ h.UXUXIXKXBXNXnXuXyXwX5X:X!.Y.Y.Y.D.H.9.6 YXYX",
+"YXYXYX+.rXB.<.x.Q.;X-XQ.Y.U.U.D.Z.Z.B.B.C.V.V.B.B.T.0.9 YXYX",
+"YXYXYX+.tXB.N.B.B.B.B.C.V.V.H.H.H.D.N.z.8._ ( <.D.R.0.9 YXYX",
+"YXYXYX+.tXS.Z.F.D.m.z.l.` ) Q W p s } @.r.[. X>XG.E.0.9 YXYX",
+"YXYXYX+.pXU.m.) p d ..*.u.|.+X<XzXZXGXLXGXZXzXjX/.~.p.r YXYX",
+"YXYXYX%.aXT.k.*.GXlX&X.X`..XhXlXzXvXvXvXvXxXkXgX2X^.a.w YXYX",
+"YXYXYX%.aXE.k.r.LXoXl f l F *XlXzXvXvXvXvXcXzXgX4X:Xa.w YXYX",
+"YXYXYX%.bX~.c.y.LX'.f D K D 0XkXzXvXvXvXvXvXzXfX6X4Xg.9 YXYX",
+"YXYXYX%.bX^.c.y.LX'.l D K D 0XlXzXcXvXvXvXxXkXkX9X6Xw.r YXYX",
+"YXYXYX%.bX2Xv.u.LX'.l K K K 0XlXzXcXvXvXvXvXkXfX9XP.M = YXYX",
+"YXYXYX%.bX2XK.u.LX'.l K K D 0XlXxXcXvXZXvXxXzXkXqXZ : . YXYX",
+"YXYXYX%.MX6XK.u.LX'.f F D D 0XkXzXcXvXvXvXvXcXkX_.: o YXYX",
+"YXYXYX%.MX6XK.u.LXXX(.XX&XdXkXzXvXZXDXAXzX<X+X}.N O YXYX",
+"YXYXYX%.VXiX=X{.FXzXkXkXjXdX<X$XOX].;.$.z 0 7 & X YXYXYX",
+"YXYXYX=.CXq.A ).fX+X|.).-.N z 0 * + o YXYXYXYX",
+"YXYXYXn $.t 6 , 4 0 * + . YXYXYXYXYXYX",
+"YXYXYX> @ o YXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/cpp/app_templates/qt4makeapp/main.cpp b/languages/cpp/app_templates/qt4makeapp/main.cpp
new file mode 100644
index 00000000..3416347e
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/main.cpp
@@ -0,0 +1,14 @@
+%{CPP_TEMPLATE}
+
+#include <QApplication>
+#include "%{APPNAMELC}.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(application);
+ QApplication app(argc, argv);
+ %{APPNAME} * mw = new %{APPNAME}();
+ mw->show();
+ return app.exec();
+}
+
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp b/languages/cpp/app_templates/qt4makeapp/qt4makeapp
new file mode 100644
index 00000000..9c856e8e
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp
@@ -0,0 +1,11 @@
+# QMake application
+[General]
+Name=Qt4/QMake Application
+Name[fr]=Une Application Qt4 / QMake
+Icon=qt4makeapp.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generate a QMake/Qt4 based application (crossplatform compatible)- Needs Qt4
+Comment[fr]=G��e une application bas� sur Qt / QMake. Ce programme est multi platte-forme. Nécessite Qt4.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp
new file mode 100644
index 00000000..af16391f
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp
@@ -0,0 +1,285 @@
+%{CPP_TEMPLATE}
+
+#include <QtGui>
+#include "%{APPNAMELC}.h"
+
+#include <QTextEdit>
+#include <QTextStream>
+#include <QCloseEvent>
+#include <QFileDialog>
+
+%{APPNAME}::%{APPNAME}()
+{
+ textEdit = new QTextEdit;
+ setCentralWidget(textEdit);
+
+ createActions();
+ createMenus();
+ createToolBars();
+ createStatusBar();
+
+ readSettings();
+
+ connect(textEdit->document(), SIGNAL(contentsChanged()),
+ this, SLOT(documentWasModified()));
+
+ setCurrentFile("");
+}
+
+void %{APPNAME}::closeEvent(QCloseEvent *event)
+{
+ if (maybeSave()) {
+ writeSettings();
+ event->accept();
+ } else {
+ event->ignore();
+ }
+}
+
+void %{APPNAME}::newFile()
+{
+ if (maybeSave()) {
+ textEdit->clear();
+ setCurrentFile("");
+ }
+}
+
+void %{APPNAME}::open()
+{
+ if (maybeSave()) {
+ QString fileName = QFileDialog::getOpenFileName(this);
+ if (!fileName.isEmpty())
+ loadFile(fileName);
+ }
+}
+
+bool %{APPNAME}::save()
+{
+ if (curFile.isEmpty()) {
+ return saveAs();
+ } else {
+ return saveFile(curFile);
+ }
+}
+
+bool %{APPNAME}::saveAs()
+{
+ QString fileName = QFileDialog::getSaveFileName(this);
+ if (fileName.isEmpty())
+ return false;
+
+ return saveFile(fileName);
+}
+
+void %{APPNAME}::about()
+{
+ QMessageBox::about(this, tr("About Application"),
+ tr("The <b>Application</b> example demonstrates how to "
+ "write modern GUI applications using Qt, with a menu bar, "
+ "toolbars, and a status bar."));
+}
+
+void %{APPNAME}::documentWasModified()
+{
+ setWindowModified(true);
+}
+
+void %{APPNAME}::createActions()
+{
+ newAct = new QAction(QIcon(":/filenew.xpm"), tr("&New"), this);
+ newAct->setShortcut(tr("Ctrl+N"));
+ newAct->setStatusTip(tr("Create a new file"));
+ connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
+
+ openAct = new QAction(QIcon(":/fileopen.xpm"), tr("&Open..."), this);
+ openAct->setShortcut(tr("Ctrl+O"));
+ openAct->setStatusTip(tr("Open an existing file"));
+ connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
+
+ saveAct = new QAction(QIcon(":/filesave.xpm"), tr("&Save"), this);
+ saveAct->setShortcut(tr("Ctrl+S"));
+ saveAct->setStatusTip(tr("Save the document to disk"));
+ connect(saveAct, SIGNAL(triggered()), this, SLOT(save()));
+
+ saveAsAct = new QAction(tr("Save &As..."), this);
+ saveAsAct->setStatusTip(tr("Save the document under a new name"));
+ connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs()));
+
+ exitAct = new QAction(tr("E&xit"), this);
+ exitAct->setShortcut(tr("Ctrl+Q"));
+ exitAct->setStatusTip(tr("Exit the application"));
+ connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ cutAct = new QAction(QIcon(":/editcut.xpm"), tr("Cu&t"), this);
+ cutAct->setShortcut(tr("Ctrl+X"));
+ cutAct->setStatusTip(tr("Cut the current selection's contents to the "
+ "clipboard"));
+ connect(cutAct, SIGNAL(triggered()), textEdit, SLOT(cut()));
+
+ copyAct = new QAction(QIcon(":/editcopy.xpm"), tr("&Copy"), this);
+ copyAct->setShortcut(tr("Ctrl+C"));
+ copyAct->setStatusTip(tr("Copy the current selection's contents to the "
+ "clipboard"));
+ connect(copyAct, SIGNAL(triggered()), textEdit, SLOT(copy()));
+
+ pasteAct = new QAction(QIcon(":/editpaste.xpm"), tr("&Paste"), this);
+ pasteAct->setShortcut(tr("Ctrl+V"));
+ pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
+ "selection"));
+ connect(pasteAct, SIGNAL(triggered()), textEdit, SLOT(paste()));
+
+ aboutAct = new QAction(tr("&About"), this);
+ aboutAct->setStatusTip(tr("Show the application's About box"));
+ connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
+
+ aboutQtAct = new QAction(tr("About &Qt"), this);
+ aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
+ connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+
+ cutAct->setEnabled(false);
+ copyAct->setEnabled(false);
+ connect(textEdit, SIGNAL(copyAvailable(bool)),
+ cutAct, SLOT(setEnabled(bool)));
+ connect(textEdit, SIGNAL(copyAvailable(bool)),
+ copyAct, SLOT(setEnabled(bool)));
+}
+
+void %{APPNAME}::createMenus()
+{
+ fileMenu = menuBar()->addMenu(tr("&File"));
+ fileMenu->addAction(newAct);
+ fileMenu->addAction(openAct);
+ fileMenu->addAction(saveAct);
+ fileMenu->addAction(saveAsAct);
+ fileMenu->addSeparator();
+ fileMenu->addAction(exitAct);
+
+ editMenu = menuBar()->addMenu(tr("&Edit"));
+ editMenu->addAction(cutAct);
+ editMenu->addAction(copyAct);
+ editMenu->addAction(pasteAct);
+
+ menuBar()->addSeparator();
+
+ helpMenu = menuBar()->addMenu(tr("&Help"));
+ helpMenu->addAction(aboutAct);
+ helpMenu->addAction(aboutQtAct);
+}
+
+void %{APPNAME}::createToolBars()
+{
+ fileToolBar = addToolBar(tr("File"));
+ fileToolBar->addAction(newAct);
+ fileToolBar->addAction(openAct);
+ fileToolBar->addAction(saveAct);
+
+ editToolBar = addToolBar(tr("Edit"));
+ editToolBar->addAction(cutAct);
+ editToolBar->addAction(copyAct);
+ editToolBar->addAction(pasteAct);
+}
+
+void %{APPNAME}::createStatusBar()
+{
+ statusBar()->showMessage(tr("Ready"));
+}
+
+void %{APPNAME}::readSettings()
+{
+ QSettings settings("Trolltech", "Application Example");
+ QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
+ QSize size = settings.value("size", QSize(400, 400)).toSize();
+ resize(size);
+ move(pos);
+}
+
+void %{APPNAME}::writeSettings()
+{
+ QSettings settings("Trolltech", "Application Example");
+ settings.setValue("pos", pos());
+ settings.setValue("size", size());
+}
+
+bool %{APPNAME}::maybeSave()
+{
+ if (textEdit->document()->isModified()) {
+ int ret = QMessageBox::warning(this, tr("Application"),
+ tr("The document has been modified.\n"
+ "Do you want to save your changes?"),
+ QMessageBox::Yes | QMessageBox::Default,
+ QMessageBox::No,
+ QMessageBox::Cancel | QMessageBox::Escape);
+ if (ret == QMessageBox::Yes)
+ return save();
+ else if (ret == QMessageBox::Cancel)
+ return false;
+ }
+ return true;
+}
+
+void %{APPNAME}::loadFile(const QString &fileName)
+{
+ QFile file(fileName);
+ if (!file.open(QFile::ReadOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("Application"),
+ tr("Cannot read file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return;
+ }
+
+ QTextStream in(&file);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ textEdit->setPlainText(in.readAll());
+ QApplication::restoreOverrideCursor();
+
+ setCurrentFile(fileName);
+ statusBar()->showMessage(tr("File loaded"), 2000);
+}
+
+bool %{APPNAME}::saveFile(const QString &fileName)
+{
+ QFile file(fileName);
+ if (!file.open(QFile::WriteOnly | QFile::Text)) {
+ QMessageBox::warning(this, tr("Application"),
+ tr("Cannot write file %1:\n%2.")
+ .arg(fileName)
+ .arg(file.errorString()));
+ return false;
+ }
+
+ QTextStream out(&file);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ out << textEdit->toPlainText();
+ QApplication::restoreOverrideCursor();
+
+ setCurrentFile(fileName);
+ statusBar()->showMessage(tr("File saved"), 2000);
+ return true;
+}
+
+void %{APPNAME}::setCurrentFile(const QString &fileName)
+{
+ curFile = fileName;
+ textEdit->document()->setModified(false);
+ setWindowModified(false);
+
+ QString shownName;
+ if (curFile.isEmpty())
+ shownName = "untitled.txt";
+ else
+ shownName = strippedName(curFile);
+
+ setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Application")));
+}
+
+QString %{APPNAME}::strippedName(const QString &fullFileName)
+{
+ return QFileInfo(fullFileName).fileName();
+}
+
+%{APPNAME}::~%{APPNAME}()
+{
+
+}
+
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h
new file mode 100644
index 00000000..cd470d00
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h
@@ -0,0 +1,65 @@
+%{H_TEMPLATE}
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+
+#include <QMainWindow>
+#include <QCloseEvent>
+
+class QAction;
+class QMenu;
+class QTextEdit;
+
+class %{APPNAME}:public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}();
+ ~%{APPNAME}();
+
+protected:
+ void closeEvent(QCloseEvent *event);
+
+private slots:
+ void newFile();
+ void open();
+ bool save();
+ bool saveAs();
+ void about();
+ void documentWasModified();
+
+private:
+ void createActions();
+ void createMenus();
+ void createToolBars();
+ void createStatusBar();
+ void readSettings();
+ void writeSettings();
+ bool maybeSave();
+ void loadFile(const QString &fileName);
+ bool saveFile(const QString &fileName);
+ void setCurrentFile(const QString &fileName);
+ QString strippedName(const QString &fullFileName);
+
+ QTextEdit *textEdit;
+ QString curFile;
+
+ QMenu *fileMenu;
+ QMenu *editMenu;
+ QMenu *helpMenu;
+ QToolBar *fileToolBar;
+ QToolBar *editToolBar;
+ QAction *newAct;
+ QAction *openAct;
+ QAction *saveAct;
+ QAction *saveAsAct;
+ QAction *exitAct;
+ QAction *cutAct;
+ QAction *copyAct;
+ QAction *pasteAct;
+ QAction *aboutAct;
+ QAction *aboutQtAct;
+};
+
+#endif
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop
new file mode 100644
index 00000000..cd633ede
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>4</version>
+ <includestyle>4</includestyle>
+ <designerintegration>ExternalDesigner</designerintegration>
+ <qmake>%{QMAKE}</qmake>
+ <designer>%{DESIGNER}</designer>
+ </qt>
+ </kdevcppsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <breakpoints/>
+ <programargs></programargs>
+ <gdbpath>/usr/bin/gdb</gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ <breakpoints/>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <run>
+ <mainprogram>./bin/%{APPNAMELC}</mainprogram>
+ <programargs/>
+ </run>
+ </kdevtrollproject>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="ts" />
+ <type ext="qrc" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate
new file mode 100644
index 00000000..ff91d477
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.kdevtemplate
@@ -0,0 +1,207 @@
+# KDE Config File
+[General]
+Name=Qt4 Application
+Name[br]=Meziant Qt4
+Name[ca]=Aplicació Qt4
+Name[da]=Qt4-Program
+Name[de]=Qt4-Anwendung
+Name[el]=Εφαρμογή Qt4
+Name[es]=Aplicación Qt4
+Name[et]=Qt4 rakendus
+Name[fr]=Application Qt4
+Name[hu]=Qt4-alapú alkalmazás
+Name[it]=Applicazione Qt4
+Name[ja]=Qt4 アプリケーション
+Name[nds]=Qt4-Programm
+Name[nl]=Qt4-toepassing
+Name[pl]=Program Qt4
+Name[pt]=Aplicação do Qt4
+Name[pt_BR]=Aplicação do Qt4
+Name[ru]=Приложение Qt 4
+Name[sk]=Qt4 aplikácia
+Name[sr]=Qt4 програм
+Name[sr@Latn]=Qt4 program
+Name[sv]=Qt4-program
+Name[zh_TW]=Qt4 應用程式
+Icon=qt4makeapp.png
+Category=C++/QMake project
+Category[fr]=C++/QMake
+Comment=Generate a QMake/Qt4 based application (crossplatform compatible) - Needs Qt4
+Comment[ca]=Genera una aplicació basada en QMake/Qt4 (multi plataforma) -Necessita Qt4-
+Comment[da]=Generér et QMake/Qt4 baseret program (krydsplatform kompatibel) - behøver Qt4
+Comment[de]=Erstellt eine auf QMake/Qt4 basierende Anwendung (plattformunabhängig). - Benötigt Qt4.
+Comment[el]=Δημιουργία μια εφαρμογής βασισμένης στα QMake/Qt4 (συμβατή με πολλαπλές πλατφόρμες)
+Comment[es]=Genera una aplicación basada en QMake/Qt4 (con compatibilidad multiplataforma) - Necesita Qt4
+Comment[et]=Rakenduse loomine QMake'i/Qt4 põhjal (multiplatvormne)
+Comment[fr]=Génère une application basée sur QMake / Qt4 (compatible multi-plateforme) - Nécessite Qt4
+Comment[hu]=Létrehoz egy QMake/Qt4-alapú, keresztfordításra is alkalmas alkalmazást - Qt4-et igényel
+Comment[it]=Genera un'applicazione basata su QMake/Qt4 (compatibile multipiattaforma) - serve Qt4
+Comment[nds]=Stellt en op QMake un Qt4 opbuut Programm op (över Bedriefümgeven weg kompatibel) - Qt4 deit noot
+Comment[nl]=Genereer een Qmake/Qt4-gebaseerde toepassing (crossplatform compatible) - heeft Qt4 nodig
+Comment[pl]=Generuje program używający QMake i Qt4 (wieloplatformowy) - wymaga biblioteki Qt4
+Comment[pt]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4
+Comment[pt_BR]=Gera uma aplicação baseada no QMake/Qt4 (compatível com várias plataformas) - Necessita do Qt4
+Comment[ru]=Создание кроссплатформенного приложения Qt 4, использующего QMake
+Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt4 (multiplatformovo kompatibilnú) - vyžaduje Qt4
+Comment[sr]=Прави програм на основи QMake/Qt4 (прекоплатформски компатибилан) — захтева Qt4
+Comment[sr@Latn]=Pravi program na osnovi QMake/Qt4 (prekoplatformski kompatibilan) — zahteva Qt4
+Comment[sv]=Skapar ett QMake/Qt4-baserat program (fungerar på andra plattformar). Kräver Qt4.
+Comment[zh_TW]=產生一個 QMake/Qt4 為基礎的應用程式(跨平台相容)─需要 Qt4
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp,%{dest}/src/ReadMe
+Archive=qt4makeapp.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qt4makeapp.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/qt4makeapp.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE3]
+Type=install
+Source=%{src}/src.pro
+Dest=%{dest}/src/src.pro
+
+[FILE4]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/src/main.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/qt4makeapp.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE6]
+Type=install
+Source=%{src}/qt4makeapp.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE7]
+Type=install
+Source=%{src}/fileopen.xpm
+Dest=%{dest}/src/fileopen.xpm
+
+[FILE8]
+Type=install
+Source=%{src}/filesave.xpm
+Dest=%{dest}/src/filesave.xpm
+
+[FILE9]
+Type=install
+Source=%{src}/filenew.xpm
+Dest=%{dest}/src/filenew.xpm
+
+[FILE10]
+Type=install
+Source=%{src}/editcopy.xpm
+Dest=%{dest}/src/editcopy.xpm
+
+[FILE11]
+Type=install
+Source=%{src}/editpaste.xpm
+Dest=%{dest}/src/editpaste.xpm
+
+[FILE12]
+Type=install
+Source=%{src}/editcut.xpm
+Dest=%{dest}/src/editcut.xpm
+
+[FILE13]
+Type=install
+Source=%{src}/application.qrc
+Dest=%{dest}/src/application.qrc
+
+[FILE14]
+Type=install
+Source=%{src}/ReadMe
+Dest=%{dest}/src/ReadMe
+
+[MSG]
+Type=message
+Comment=A Qt4/Qmake based application was created in %{dest}
+Comment[ca]=Una aplicació basada en Qt4/Qmake ha estat creada en %{dest}
+Comment[da]=Et Qt4/Qmake baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf QMake/Qt4 basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή βασισμένη στα Qt4/Qmake δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en Qt4/Qmake ha sido creada en %{dest}
+Comment[et]=Rakendus Qt4/QMake'i põhjal loodi asukohta %{dest}
+Comment[fr]=Une application basée sur Qt4 / Qmake a été créée dans %{dest}
+Comment[hu]=Létrejött egy Qt4/Qmake-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su Qt4/Qmake in %{dest}
+Comment[ja]=Qt4/QMake ベースのアプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op Qt4 un Qmake opbuut Programm opstellt
+Comment[nl]=Een Qt4/Qmake gebaseerde toepassing is aangemaakt in %{dest}
+Comment[pl]=Program używający QMake i Qt4 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada no Qt4/Qmake em %{dest}
+Comment[ru]=Приложение Qt 4, использующее Qmake, создано в %{dest}
+Comment[sk]=Aplikácia založená na Qt4/Qmake bola vytvorená v %{dest}
+Comment[sr]=Програм на основу Qt4/Qmake направљен је у %{dest}
+Comment[sr@Latn]=Program na osnovu Qt4/Qmake napravljen je u %{dest}
+Comment[sv]=Ett QMake/Qt4-baserat program skapades i %{dest}
+Comment[zh_TW]=一個 QMake/Qt4 為基礎的應用程式已建立於 %{dest}
+
+Comment=
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake (Qt4).
+Comment[ca]=Ruta absoluta per a QMake (Qt4).
+Comment[da]=Absolut søgesti til QMake (Qt4).
+Comment[de]=Absoluter Pfad für QMake (Qt4).
+Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4).
+Comment[es]=Ruta completa para QMake (Qt4).
+Comment[et]=QMake (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour QMake (Qt4).
+Comment[hu]=A QMake (Qt4) teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake (Qt4).
+Comment[ja]=QMake (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för QMake (Qt4)
+Comment[nl]=Absoluut pad naar QMake (Qt4).
+Comment[pl]=Ścieżka bezwzględna do QMake (Qt4).
+Comment[pt]=Localização Absoluta do QMake (Qt4).
+Comment[pt_BR]=Localização Absoluta do QMake (Qt4).
+Comment[ru]=Полный путь к QMake (Qt 4).
+Comment[sk]=Absolútna cesta ku QMake (Qt4).
+Comment[sr]=Апсолутна путања до QMake-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4).
+Comment[sv]=Absolut sökväg till QMake (Qt4).
+Comment[zh_TW]=QMake(Qt4)的絕對路徑
+Default=
+[DESIGNER]
+Type=value
+ValueType=QString
+Value=DESIGNER
+Comment=Absolute Path for Designer (Qt4).
+Comment[ca]=Ruta absoluta per a Designer (Qt4).
+Comment[da]=Absolut søgesti til Designer (Qt4).
+Comment[de]=Absoluter Pfad für Designer (Qt4).
+Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4).
+Comment[es]=Ruta completa para Designer (Qt4).
+Comment[et]=Disaineri (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour Designer (Qt4).
+Comment[hu]=A Designer (Qt4) teljes elérési útja
+Comment[it]=Percorso assoluto del Designer (Qt4).
+Comment[ja]=Designer (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för Designer (Qt4)
+Comment[nl]=Absoluut pad naar Designer (Qt4).
+Comment[pl]=Ścieżka bezwzględna do Designera (Qt4).
+Comment[pt]=Localização Absoluta do Designer (Qt4).
+Comment[pt_BR]=Localização Absoluta do Designer (Qt4).
+Comment[ru]=Полный путь к Designer (Qt 4).
+Comment[sk]=Absolútna cesta ku Designer (Qt4).
+Comment[sr]=Апсолутна путања до Designer-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4).
+Comment[sv]=Absolut sökväg till Designer (Qt4).
+Comment[zh_TW]=設計家(Qt4)的絕對路徑
+Default=
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png
new file mode 100644
index 00000000..96a7e0bf
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro
new file mode 100644
index 00000000..7177d225
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.pro
@@ -0,0 +1,5 @@
+SUBDIRS += src
+TEMPLATE = subdirs
+CONFIG += warn_on \
+ qt \
+ thread \ No newline at end of file
diff --git a/languages/cpp/app_templates/qt4makeapp/src.pro b/languages/cpp/app_templates/qt4makeapp/src.pro
new file mode 100644
index 00000000..fa8baae6
--- /dev/null
+++ b/languages/cpp/app_templates/qt4makeapp/src.pro
@@ -0,0 +1,10 @@
+SOURCES += %{APPNAMELC}.cpp \
+ main.cpp
+HEADERS += %{APPNAMELC}.h
+TEMPLATE = app
+CONFIG += warn_on \
+ thread \
+ qt
+TARGET = %{APPNAMELC}
+DESTDIR = ../bin
+RESOURCES = application.qrc
diff --git a/languages/cpp/app_templates/qtopia4app/Example.png b/languages/cpp/app_templates/qtopia4app/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/qtopia4app/Makefile.am b/languages/cpp/app_templates/qtopia4app/Makefile.am
new file mode 100644
index 00000000..57785690
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = Example.png app.kdevelop example.desktop \
+ example.html main.cpp Makefile.am app.pro example.cpp \
+ example.h examplebase.ui
+
+templateName = qtopia4app
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ gzip -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/qtopia4app/app.kdevelop b/languages/cpp/app_templates/qtopia4app/app.kdevelop
new file mode 100644
index 00000000..465fd677
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/app.kdevelop
@@ -0,0 +1,163 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}</mainprogram>
+ <programargs>-qws</programargs>
+ <envvars>
+ <envvar value="/opt/Qtopia/SDK/4.2.4/x86" name="QPEDIR" />
+ <envvar value="$QPEDIR/qtopiacore/target" name="QTDIR" />
+ <envvar value="/opt/Qtopia/SDK/4.2.4/x86/lib:/opt/Qtopia/SDK/4.2.4/x86/qtopiacore/target/lib:$LD_LIBRARY_PATH" name="LD_LIBRARY_PATH" />
+ <envvar value="$PATH:/opt/Qtopia/SDK/scripts:/opt/Qtopia/SDK/4.2.4/x86/bin:/opt/Qtopia/SDK/4.2.4/x86/scripts" name="PATH" />
+
+ </envvars>
+ </run>
+ <envvars/>
+ <make>
+ <abortonerror>true</abortonerror>
+ <runmultiplejobs>false</runmultiplejobs>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin></makebin>
+ <prio>0</prio>
+ <envvars>
+ <envvar value="/opt/Qtopia/SDK/4.2.4/x86" name="QPEDIR" />
+ <envvar value="/opt/Qtopia/SDK/4.2.4/x86/qtopiacore/target" name="QTDIR" />
+ <envvar value="$PATH:/opt/Qtopia/SDK/scripts:/opt/Qtopia/SDK/4.2.4/x86/bin:/opt/Qtopia/SDK/4.2.4/x86/scripts" name="PATH" />
+ </envvars>
+ </make>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes/>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+ <kdevcppsupport>
+ <qt>
+ <used>true</used>
+ <version>4</version>
+ <includestyle>4</includestyle>
+ <root>/usr/lib/qt3</root>
+ <designerintegration>ExternalDesigner</designerintegration>
+ <qmake>/opt/Qtopia/SDK/4.2.4/x86/bin/qtopiamake</qmake>
+ <designer>/opt/Qtopia/SDK/4.2.4/x86/bin/designer</designer>
+ <designerpluginpaths/>
+ </qt>
+ </kdevcppsupport>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qtopia4app/app.pro b/languages/cpp/app_templates/qtopia4app/app.pro
new file mode 100644
index 00000000..05a0bb9c
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/app.pro
@@ -0,0 +1,31 @@
+qtopia_project(qtopia app) # see buildsystem.html for more project keywords
+TARGET=%{APPNAMELC}
+CONFIG+=qtopia_main
+CONFIG+=no_singleexec
+CONFIG+=no_quicklaunch
+CONFIG+=no_tr
+
+FORMS=%{APPNAMELC}base.ui
+HEADERS=%{APPNAMELC}.h
+SOURCES=main.cpp %{APPNAMELC}.cpp
+
+desktop.files=%{APPNAMELC}.desktop
+desktop.path=/apps/Applications
+desktop.hint=desktop
+
+pics.files=pics/*
+pics.path=/pics/%{APPNAMELC}
+pics.hint=pics
+
+help.source=help
+help.files=%{APPNAME}.html
+help.hint=help
+
+INSTALLS+=desktop pics help
+
+pkg.name=%{APPNAME}
+pkg.desc=%{APPNAME} Application
+pkg.version=1.0.0-1
+pkg.maintainer=%{AUTHOR} %{EMAIL}
+pkg.license=GPL
+pkg.domain=window
diff --git a/languages/cpp/app_templates/qtopia4app/example.cpp b/languages/cpp/app_templates/qtopia4app/example.cpp
new file mode 100644
index 00000000..a35d57cb
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/example.cpp
@@ -0,0 +1,40 @@
+
+#include "%{APPNAMELC}.h"
+#include <qpushbutton.h>
+
+%{APPNAME}Base::%{APPNAME}Base( QWidget *parent, Qt::WFlags f )
+ : QWidget( parent, f )
+{
+ setupUi( this );
+}
+
+%{APPNAME}Base::~%{APPNAME}Base()
+{
+}
+
+/*
+ * Constructs a %{APPNAME} which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+%{APPNAME}::%{APPNAME}( QWidget *parent, Qt::WFlags f )
+ : %{APPNAME}Base( parent, f )
+{
+ connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+%{APPNAME}::~%{APPNAME}()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * A simple slot... not very interesting.
+ */
+void %{APPNAME}::goodBye()
+{
+ close();
+}
+
diff --git a/languages/cpp/app_templates/qtopia4app/example.desktop b/languages/cpp/app_templates/qtopia4app/example.desktop
new file mode 100644
index 00000000..f6f04194
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/example.desktop
@@ -0,0 +1,37 @@
+[Desktop Entry]
+Comment=An %{APPNAME} Program
+Comment[ca]=Un programa per a %{APPNAME}
+Comment[da]=Et %{APPNAME} program
+Comment[de]=Ein %{APPNAME}-Program
+Comment[el]=Ένα πρόγραμμα %{APPNAME}
+Comment[es]=Un programa %{APPNAME}
+Comment[et]=%{APPNAME} programm
+Comment[eu]=%{APPNAME} programa bat
+Comment[fa]=برنامۀ %{APPNAME}
+Comment[fr]=Un programme %{APPNAME}
+Comment[ga]=Clár %{APPNAME}
+Comment[gl]=Un programa %{APPNAME}
+Comment[hu]=%{APPNAME} program
+Comment[it]=Un programma per %{APPNAME}
+Comment[ja]=%{APPNAME} プログラム
+Comment[nds]=En %{APPNAME}-Programm
+Comment[ne]= %{APPNAME} कार्यक्रम
+Comment[nl]=Een %{APPNAME} programma
+Comment[pl]=Program %{APPNAME}
+Comment[pt]=Um Programa %{APPNAME}
+Comment[pt_BR]=Um Programa %{APPNAME}
+Comment[ru]=Программа %{APPNAME}
+Comment[sk]=%{APPNAME} program
+Comment[sl]=Program %{APPNAME}
+Comment[sr]=%{APPNAME} програм
+Comment[sr@Latn]=%{APPNAME} program
+Comment[sv]=Ett %{APPNAME}-program
+Comment[ta]=ஒரு %{APPNAME} நிரல்
+Comment[tg]=Барномаи %{APPNAME}
+Comment[tr]=Bir %{APPNAME} Programı
+Comment[zh_CN]=一个 %{APPNAME} 程序
+Comment[zh_TW]=一個 %{APPNAME} 程式
+Exec=%{APPNAMELC}
+Icon=%{APPNAME}
+Type=Application
+Name=%{APPNAME}
diff --git a/languages/cpp/app_templates/qtopia4app/example.h b/languages/cpp/app_templates/qtopia4app/example.h
new file mode 100644
index 00000000..7d58c7d8
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/example.h
@@ -0,0 +1,24 @@
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+#include "ui_%{APPNAMELC}base.h"
+
+class %{APPNAME}Base : public QWidget, public Ui_%{APPNAME}Base
+{
+public:
+ %{APPNAME}Base( QWidget *parent = 0, Qt::WFlags f = 0 );
+ virtual ~%{APPNAME}Base();
+};
+
+class %{APPNAME} : public %{APPNAME}Base
+{
+ Q_OBJECT
+public:
+ %{APPNAME}( QWidget *parent = 0, Qt::WFlags f = 0 );
+ virtual ~%{APPNAME}();
+
+private slots:
+ void goodBye();
+};
+
+#endif // %{APPNAMEUC}_H
diff --git a/languages/cpp/app_templates/qtopia4app/example.html b/languages/cpp/app_templates/qtopia4app/example.html
new file mode 100644
index 00000000..279a6106
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/example.html
@@ -0,0 +1,15 @@
+<html>
+<h1>%{APPNAME}</h1>
+
+<p>This is the help for the %{APPNAME} program.
+
+<p>To user this application:
+
+<ol>
+ <li>Press the <img width=12 height=12 src=%{APPNAME}.png> icon in the Qtopia launcher.
+ <li>Read the label.
+ <li>Press the button.
+ <li>Read the source code provided.
+</ol>
+
+Now you know how to make a Qtopia application!
diff --git a/languages/cpp/app_templates/qtopia4app/examplebase.ui b/languages/cpp/app_templates/qtopia4app/examplebase.ui
new file mode 100644
index 00000000..17d6bc20
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/examplebase.ui
@@ -0,0 +1,44 @@
+<ui version="4.0" stdsetdef="1" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>%{APPNAME}Base</class>
+ <widget class="QWidget" name="%{APPNAME}Base" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>196</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>%{APPNAME}</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>11</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="TextLabel1" >
+ <property name="text" >
+ <string>This is just an %{APPNAME}. It doesn't do anything interesting at all.</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="quit" >
+ <property name="text" >
+ <string>Quit</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+</ui>
diff --git a/languages/cpp/app_templates/qtopia4app/main.cpp b/languages/cpp/app_templates/qtopia4app/main.cpp
new file mode 100644
index 00000000..43dbb4ac
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/main.cpp
@@ -0,0 +1,7 @@
+
+#include "%{APPNAMELC}.h"
+#include <qtopia/qtopiaapplication.h>
+
+QTOPIA_ADD_APPLICATION("%{APPNAMELC}", %{APPNAME})
+QTOPIA_MAIN
+
diff --git a/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate b/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate
new file mode 100644
index 00000000..298407f5
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/qtopia4app.kdevtemplate
@@ -0,0 +1,193 @@
+# KDE Config File
+[General]
+Name=Qtopia 4 Application
+Name[ca]=Aplicació per a Qtopia 4
+Name[da]=Qtopia4-program
+Name[de]=Qtopia 4-Anwendung
+Name[el]=Εφαρμογή Qtopia 4
+Name[es]=Aplicación para Qtopia 4
+Name[et]=Qtopia 4 rakendus
+Name[hu]=Qtopia 4-alapú alkalmazás
+Name[it]=Applicazione Qtopia 4
+Name[nds]=Qtopia 4-Programm
+Name[nl]=Qtopia4-programma
+Name[pl]=Program wykorzystujący Qtopię 4
+Name[pt]=Aplicação do Qtopia 4
+Name[pt_BR]=Aplicação do Qtopia 4
+Name[ru]=Приложение Qtopia 4
+Name[sk]=Qtopia 4 aplikácia
+Name[sr]=Qtopia 4 програм
+Name[sr@Latn]=Qtopia 4 program
+Name[sv]=Qtopia 4-program
+Name[zh_TW]=Qtopia 4 應用程式
+Icon=qmakeapp4.png
+Category=C++/Embedded
+Comment=Generate a Qmake/Qt based application for Qtopia 4.x
+Comment[ca]=Genera una aplicació basada en Qmake/Qt per a Qtopia 4.x
+Comment[da]=Genererer et QMake-/Qt-baseret program til Qtopia 4.x
+Comment[de]=Erstellt eine auf QMake/Qt basierende Anwendung für Qtopia 4.x
+Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης στο Qmake/Qt για το Qtopia 4.x
+Comment[es]=Genera una aplicación basada en Qmake/Qt para Qtopia 4.x
+Comment[et]=Qtopia 4.x rakenduse loomine QMake'i/Qt põhjal
+Comment[hu]=Létrehoz egy QMake/Qt-alapú alkalmazást a Qtopia 4.x rendszerhez
+Comment[it]=Genera un'applicazione basata su QMake/Qt per Qtopia 4.x
+Comment[nds]=Stellt en op QMake/Qt opbuut Programm för Qtopia 4.x op
+Comment[nl]=Genereer een Qmake/Qt-gebaseerd programma voor Qtopia 4.x
+Comment[pl]=Generuje program wykorzystujący QMake/Qt dla Qtopii 4.x
+Comment[pt]=Gera uma aplicação, baseada no QMake/Qt, para o Qtopia 4.x
+Comment[pt_BR]=Gera uma aplicação, baseada no QMake/Qt, para o Qtopia 4.x
+Comment[ru]=Создание приложения Qt, использующего QMake, для Qtopia 4.x
+Comment[sk]=Vygeneruje aplikáciu založenú na QMake/Qt pre Qtopia 4.x
+Comment[sr]=Прави програм за Qtopia-у 4.x на основу QMake-а/Qt-а
+Comment[sr@Latn]=Pravi program za Qtopia-u 4.x na osnovu QMake-a/Qt-a
+Comment[sv]=Skapa ett Qmake/Qt-baserat program för Qtopia 4.x
+Comment[zh_TW]=產生一個以 Qmake/Qt 為基礎的 Qtopia 4.x 應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=qtopia4app.tar.gz
+
+[MkDir0]
+Type=mkdir
+Dir=%{dest}/help
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/help/html
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/%{APPNAME}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/example.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/example.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[FILE6]
+Type=install
+EscapeXML=true
+Source=%{src}/examplebase.ui
+Dest=%{dest}/%{APPNAMELC}base.ui
+
+[FILE7]
+Type=install
+Source=%{src}/example.desktop
+Dest=%{dest}/%{APPNAMELC}.desktop
+
+[FILE8]
+Type=install
+EscapeXML=true
+Source=%{src}/example.html
+Dest=%{dest}/%{APPNAMELC}.html
+
+[FILE9]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/main.cpp
+
+[MSG]
+Type=message
+Comment=A Qtopia application was created in %{dest}
+Comment[ca]=Una aplicació basada en Qtopia ha estat creada en %{dest}
+Comment[da]=Et Qtopia program blev oprettet i %{dest}
+Comment[de]=Eine Qtopia-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Qtopia δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para Qtopia ha sido creada en %{dest}
+Comment[et]=Qtopia rakendus loodi asukohta %{dest}
+Comment[eu]=Qtopia aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد Qtopia در %{dest} ایجاد شد
+Comment[fr]=Une application Qtopia a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár Qtopia i %{dest}
+Comment[gl]=Creouse unha aplicación Qtopia en %{dest}
+Comment[hu]=Létrejött egy Qtopia-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Qtopia in %{dest}
+Comment[ja]=Qtopia アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Qtopia-Programm opstellt
+Comment[ne]=Qtopia अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Qtopia-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program wykorzystujący Qtopię został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Qtopia em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Qtopia em %{dest}
+Comment[ru]=Приложение Qtopia создано в %{dest}
+Comment[sk]=Qtopia aplikácia bola vytvorená v %{dest}
+Comment[sr]=Qtopia програм је направљен у %{dest}
+Comment[sr@Latn]=Qtopia program je napravljen u %{dest}
+Comment[sv]=Ett Qtopia-program skapades i %{dest}
+Comment[tr]=Bir Qtopia uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了 Qtopia 应用程序
+Comment[zh_TW]=一個 Qtopia 應用程式已建立於 %{dest}
+
+[QMAKE]
+Type=value
+ValueType=QString
+Value=QMAKE
+Comment=Absolute Path for QMake (Qt4).
+Comment[ca]=Ruta absoluta per a QMake (Qt4).
+Comment[da]=Absolut søgesti til QMake (Qt4).
+Comment[de]=Absoluter Pfad für QMake (Qt4).
+Comment[el]=Απόλυτη διαδρομή για το QMake (Qt4).
+Comment[es]=Ruta completa para QMake (Qt4).
+Comment[et]=QMake (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour QMake (Qt4).
+Comment[hu]=A QMake (Qt4) teljes elérési útja.
+Comment[it]=Percorso assoluto per QMake (Qt4).
+Comment[ja]=QMake (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för QMake (Qt4)
+Comment[nl]=Absoluut pad naar QMake (Qt4).
+Comment[pl]=Ścieżka bezwzględna do QMake (Qt4).
+Comment[pt]=Localização Absoluta do QMake (Qt4).
+Comment[pt_BR]=Localização Absoluta do QMake (Qt4).
+Comment[ru]=Полный путь к QMake (Qt 4).
+Comment[sk]=Absolútna cesta ku QMake (Qt4).
+Comment[sr]=Апсолутна путања до QMake-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do QMake-a (Qt4).
+Comment[sv]=Absolut sökväg till QMake (Qt4).
+Comment[zh_TW]=QMake(Qt4)的絕對路徑
+Default=/opt/Qtopia/SDK/4.2.4/x86/bin/qtopiamake
+[DESIGNER]
+Type=value
+ValueType=QString
+Value=DESIGNER
+Comment=Absolute Path for Designer (Qt4).
+Comment[ca]=Ruta absoluta per a Designer (Qt4).
+Comment[da]=Absolut søgesti til Designer (Qt4).
+Comment[de]=Absoluter Pfad für Designer (Qt4).
+Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4).
+Comment[es]=Ruta completa para Designer (Qt4).
+Comment[et]=Disaineri (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour Designer (Qt4).
+Comment[hu]=A Designer (Qt4) teljes elérési útja
+Comment[it]=Percorso assoluto del Designer (Qt4).
+Comment[ja]=Designer (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för Designer (Qt4)
+Comment[nl]=Absoluut pad naar Designer (Qt4).
+Comment[pl]=Ścieżka bezwzględna do Designera (Qt4).
+Comment[pt]=Localização Absoluta do Designer (Qt4).
+Comment[pt_BR]=Localização Absoluta do Designer (Qt4).
+Comment[ru]=Полный путь к Designer (Qt 4).
+Comment[sk]=Absolútna cesta ku Designer (Qt4).
+Comment[sr]=Апсолутна путања до Designer-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4).
+Comment[sv]=Absolut sökväg till Designer (Qt4).
+Comment[zh_TW]=設計家(Qt4)的絕對路徑
+Default=/opt/Qtopia/SDK/4.2.4/x86/bin/designer
+
+
diff --git a/languages/cpp/app_templates/qtopia4app/qtopia4app.png b/languages/cpp/app_templates/qtopia4app/qtopia4app.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/qtopia4app/qtopia4app.png
Binary files differ
diff --git a/languages/cpp/app_templates/qtopiaapp/.kdev_ignore b/languages/cpp/app_templates/qtopiaapp/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/.kdev_ignore
diff --git a/languages/cpp/app_templates/qtopiaapp/Example.png b/languages/cpp/app_templates/qtopiaapp/Example.png
new file mode 100644
index 00000000..f63d0bc7
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/Example.png
Binary files differ
diff --git a/languages/cpp/app_templates/qtopiaapp/Makefile.am b/languages/cpp/app_templates/qtopiaapp/Makefile.am
new file mode 100644
index 00000000..c250d5fa
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = Example.png app.kdevelop example.control example.desktop \
+ example.html main.cpp Makefile.am app.pro example.cpp \
+ example.h examplebase.ui qtopiaapp
+
+templateName = qtopiaapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/qtopiaapp/app.kdevelop b/languages/cpp/app_templates/qtopiaapp/app.kdevelop
new file mode 100644
index 00000000..9db37db3
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/app.kdevelop
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTMakeProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ </display>
+ </kdevdebugger>
+ <kdevtrollproject>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}</mainprogram>
+ <programargs>-qws</programargs>
+ </run>
+ <envvars/>
+ </kdevtrollproject>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes/>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <codecompletion>
+ <codehinting outputview="1" enablech="0" selectview="0" />
+ </codecompletion>
+ <classstore>
+ <enablepcs>false</enablepcs>
+ <enablepp>false</enablepp>
+ <preparsing/>
+ </classstore>
+ <filetemplates>
+ <choosefiles>false</choosefiles>
+ <interfaceURL></interfaceURL>
+ <implementationURL></implementationURL>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ <lowercasefilenames>true</lowercasefilenames>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevclassview>
+ <folderhierarchy>true</folderhierarchy>
+ <depthoffolders>2</depthoffolders>
+ </kdevclassview>
+ <kdevcvs>
+ <cvsoptions>-f</cvsoptions>
+ <commitoptions></commitoptions>
+ <updateoptions>-dP</updateoptions>
+ <addoptions></addoptions>
+ <removeoptions>-f</removeoptions>
+ <diffoptions>-u3 -p</diffoptions>
+ <logoptions></logoptions>
+ <rshoptions></rshoptions>
+ </kdevcvs>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/qtopiaapp/app.pro b/languages/cpp/app_templates/qtopiaapp/app.pro
new file mode 100644
index 00000000..c625020d
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/app.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+CONFIG = qt warn_on release
+HEADERS = %{APPNAMELC}.h
+SOURCES = main.cpp %{APPNAMELC}.cpp
+INTERFACES = %{APPNAMELC}base.ui
+TARGET = %{APPNAMELC}
+INCLUDEPATH += $(QPEDIR)/include
+DEPENDPATH += $(QPEDIR)/include
+LIBS += -lqpe
+
diff --git a/languages/cpp/app_templates/qtopiaapp/example.control b/languages/cpp/app_templates/qtopiaapp/example.control
new file mode 100644
index 00000000..d04f87ec
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/example.control
@@ -0,0 +1,11 @@
+Files: bin/%{APPNAMELC} apps/Applications/%{APPNAMELC}.desktop pics/%{APPNAME}.png help/html/%{APPNAMELC}.html
+Priority: optional
+Section: qpe/applications
+Maintainer: Your Name <you@your.domain.com>
+Architecture: $CPU_ARCH
+Arch: $DEVICE_ARCH
+Version: 1.0.0
+License: Public Domain
+Description: %{APPNAME} program
+ An %{APPNAMELC} program for the Qtopia environment.
+ Does nothing interesting.
diff --git a/languages/cpp/app_templates/qtopiaapp/example.cpp b/languages/cpp/app_templates/qtopiaapp/example.cpp
new file mode 100644
index 00000000..939f708e
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/example.cpp
@@ -0,0 +1,29 @@
+
+#include "%{APPNAMELC}.h"
+#include <qpushbutton.h>
+
+/*
+ * Constructs a %{APPNAME} which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+%{APPNAME}::%{APPNAME}( QWidget* parent, const char* name, WFlags fl )
+ : %{APPNAME}Base( parent, name, fl )
+{
+ connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+%{APPNAME}::~%{APPNAME}()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * A simple slot... not very interesting.
+ */
+void %{APPNAME}::goodBye()
+{
+ close();
+}
diff --git a/languages/cpp/app_templates/qtopiaapp/example.desktop b/languages/cpp/app_templates/qtopiaapp/example.desktop
new file mode 100644
index 00000000..f6f04194
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/example.desktop
@@ -0,0 +1,37 @@
+[Desktop Entry]
+Comment=An %{APPNAME} Program
+Comment[ca]=Un programa per a %{APPNAME}
+Comment[da]=Et %{APPNAME} program
+Comment[de]=Ein %{APPNAME}-Program
+Comment[el]=Ένα πρόγραμμα %{APPNAME}
+Comment[es]=Un programa %{APPNAME}
+Comment[et]=%{APPNAME} programm
+Comment[eu]=%{APPNAME} programa bat
+Comment[fa]=برنامۀ %{APPNAME}
+Comment[fr]=Un programme %{APPNAME}
+Comment[ga]=Clár %{APPNAME}
+Comment[gl]=Un programa %{APPNAME}
+Comment[hu]=%{APPNAME} program
+Comment[it]=Un programma per %{APPNAME}
+Comment[ja]=%{APPNAME} プログラム
+Comment[nds]=En %{APPNAME}-Programm
+Comment[ne]= %{APPNAME} कार्यक्रम
+Comment[nl]=Een %{APPNAME} programma
+Comment[pl]=Program %{APPNAME}
+Comment[pt]=Um Programa %{APPNAME}
+Comment[pt_BR]=Um Programa %{APPNAME}
+Comment[ru]=Программа %{APPNAME}
+Comment[sk]=%{APPNAME} program
+Comment[sl]=Program %{APPNAME}
+Comment[sr]=%{APPNAME} програм
+Comment[sr@Latn]=%{APPNAME} program
+Comment[sv]=Ett %{APPNAME}-program
+Comment[ta]=ஒரு %{APPNAME} நிரல்
+Comment[tg]=Барномаи %{APPNAME}
+Comment[tr]=Bir %{APPNAME} Programı
+Comment[zh_CN]=一个 %{APPNAME} 程序
+Comment[zh_TW]=一個 %{APPNAME} 程式
+Exec=%{APPNAMELC}
+Icon=%{APPNAME}
+Type=Application
+Name=%{APPNAME}
diff --git a/languages/cpp/app_templates/qtopiaapp/example.h b/languages/cpp/app_templates/qtopiaapp/example.h
new file mode 100644
index 00000000..883cb27d
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/example.h
@@ -0,0 +1,18 @@
+
+#ifndef %{APPNAMEUC}_H
+#define %{APPNAMEUC}_H
+#include "%{APPNAMELC}base.h"
+
+class %{APPNAME} : public %{APPNAME}Base
+{
+ Q_OBJECT
+
+public:
+ %{APPNAME}( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~%{APPNAME}();
+
+private slots:
+ void goodBye();
+};
+
+#endif // %{APPNAMEUC}_H
diff --git a/languages/cpp/app_templates/qtopiaapp/example.html b/languages/cpp/app_templates/qtopiaapp/example.html
new file mode 100644
index 00000000..279a6106
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/example.html
@@ -0,0 +1,15 @@
+<html>
+<h1>%{APPNAME}</h1>
+
+<p>This is the help for the %{APPNAME} program.
+
+<p>To user this application:
+
+<ol>
+ <li>Press the <img width=12 height=12 src=%{APPNAME}.png> icon in the Qtopia launcher.
+ <li>Read the label.
+ <li>Press the button.
+ <li>Read the source code provided.
+</ol>
+
+Now you know how to make a Qtopia application!
diff --git a/languages/cpp/app_templates/qtopiaapp/examplebase.ui b/languages/cpp/app_templates/qtopiaapp/examplebase.ui
new file mode 100644
index 00000000..b6b81b11
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/examplebase.ui
@@ -0,0 +1,49 @@
+<!DOCTYPE UI><UI>
+<class>%{APPNAME}Base</class>
+<widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>%{APPNAME}Base</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>196</width>
+ <height>245</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>%{APPNAME}</string>
+ </property>
+ <vbox>
+
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&lt;p&gt;This is just an &lt;i&gt;%{APPNAMELC}&lt;/i&gt;; it does not do anything interesting at all.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>quit</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Quit</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/app_templates/qtopiaapp/main.cpp b/languages/cpp/app_templates/qtopiaapp/main.cpp
new file mode 100644
index 00000000..0311a32e
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/main.cpp
@@ -0,0 +1,13 @@
+
+#include "%{APPNAMELC}.h"
+#include <qpe/qpeapplication.h>
+
+int main( int argc, char ** argv )
+{
+ QPEApplication a( argc, argv );
+
+ %{APPNAME} mw;
+ a.showMainWidget( &mw );
+
+ return a.exec();
+}
diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp b/languages/cpp/app_templates/qtopiaapp/qtopiaapp
new file mode 100644
index 00000000..e07d8627
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/qtopiaapp
@@ -0,0 +1,11 @@
+# TMake application
+[General]
+Name=Qtopia Application
+Name[fr]=Une Application Qtopia
+Icon=qmakeapp.png
+Category=C++/Embedded
+Category[fr]=C++/Environnement embarqu
+Comment=Generate a TMake/Qt based application for Qtopia 1.x
+Comment[fr]=Gnre une application base sur Qt / TMake pour l'environnement Qtopia 1.x.
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=APPNAMELC.cpp
diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate
new file mode 100644
index 00000000..45479b04
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.kdevtemplate
@@ -0,0 +1,153 @@
+# KDE Config File
+[General]
+Name=Qtopia Application
+Name[ca]=Aplicació per a Qtopia
+Name[da]=Qtopia-program
+Name[de]=Qtopia-Anwendung
+Name[el]=Εφαρμογή Qtopia
+Name[es]=Aplicación para Qtopia
+Name[et]=Qtopia rakendus
+Name[eu]=Qtopia aplikazioa
+Name[fa]=کاربرد Qtopia
+Name[fr]=Application Qtopia
+Name[ga]=Feidhmchlár Qtopia
+Name[gl]=Aplicación Qtopia
+Name[hu]=Qtopia-alkalmazás
+Name[it]=Applicazione Qtopia
+Name[ja]=Qtopia アプリケーション
+Name[nds]=Qtopia-Programm
+Name[ne]=Qtopia अनुप्रयोग
+Name[nl]=Qtopia-toepassing
+Name[pl]=Program wykorzystujący Qtopię
+Name[pt]=Aplicação do Qtopia
+Name[pt_BR]=Aplicação do Qtopia
+Name[ru]=Приложение Qtopia
+Name[sk]=Qtopia aplikácia
+Name[sl]=Program za Qtopio
+Name[sr]=Qtopia програм
+Name[sr@Latn]=Qtopia program
+Name[sv]=Qtopia-program
+Name[tr]=Qtopia Uygulaması
+Name[zh_CN]=Qtopia 应用程序
+Name[zh_TW]=Qtopia 應用程式
+Icon=qmakeapp.png
+Category=C++/Embedded
+Category[fr]=C++/Environnement embarqu
+Comment=Generate a TMake/Qt based application for Qtopia 1.x
+Comment[ca]=Genera una aplicació basada en TMake/Qt per a Qtopia 1.x
+Comment[da]=Generér et TMake/Qt baseret program for Qtopia 1.x
+Comment[de]=Erstellt eine auf TMake/Qt basierende Anwendung für Qtopia 1.x
+Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης στα TMake/Qt για το Qtopia 1.x
+Comment[es]=Genera una aplicación basada en TMake/Qt para Qtopia 1.x
+Comment[et]=Qtopia 1.x rakenduse loomine TMake'i/Qt põhjal
+Comment[eu]= Sortu TMake/Qt software-ean oinarritutako Qtopia 1.x aplikazio bat
+Comment[fa]=یک کاربرد بر مبنای TMake/Qt برای Qtopia 1.x تولید می‌کند
+Comment[fr]=Génère une application basée sur TMake / Qt pour Qtopia 1.x
+Comment[ga]=Cruthaigh feidhmchlár bunaithe ar TMake/Qt le haghaidh Qtopia 1.x
+Comment[gl]=Xera unha aplicación baseada en TMake/Qt para Qtopia 1.x
+Comment[hu]=Létrehoz egy TMake/Qt-alapú alkalmazást a Qtopia 1.x rendszerhez
+Comment[it]=Genera un'applicazione basata su TMake/Qt per Qtopia 1.x
+Comment[ja]=Qtopia 1.x 用の TMake/Qt ベースのアプリケーションを作成
+Comment[nds]=Stellt en op TMake/Qt opbuut Programm för Qtopia 1.x op
+Comment[ne]= Qtopia 1.x का लागि TMake/Qt आधारित अनुप्रयोग उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een Tmake/Qt-gebaseerde toepassing voor Qtopie 1.x
+Comment[pl]=Generuje program wykorzystujący TMake i Qt dla Qtopii 1.x
+Comment[pt]=Gera uma aplicação, baseada no TMake/Qt, para o Qtopia 1.x
+Comment[pt_BR]=Gera uma aplicação, baseada no TMake/Qt, para o Qtopia 1.x
+Comment[ru]=Создание приложения Qt со сборкой посредством TMake для Qtopia 1.x
+Comment[sk]=Vygeneruje aplikáciu založenú na TMake/Qt pre Qtopia 1.x
+Comment[sr]=Прави програм за Qtopia-у 1.x на основуTMake-а/Qt-а
+Comment[sr@Latn]=Pravi program za Qtopia-u 1.x na osnovuTMake-a/Qt-a
+Comment[sv]=Skapa ett TMake/Qt-baserat program för Qtopia 1.x
+Comment[tr]=Qtopia 1.x için TMake/Qt tabanlı bir uygulama yarat
+Comment[zh_CN]=生成适用于 Qtopia 1.x 基于 TMake/Qt 的应用程序
+Comment[zh_TW]=產生一個 Qtopia 1.x 的 TMake/Qt 應用程式
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp
+Archive=qtopiaapp.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/Example.png
+Dest=%{dest}/%{APPNAME}.png
+Process=false
+
+[FILE3]
+Type=install
+Source=%{src}/app.pro
+Dest=%{dest}/%{APPNAMELC}.pro
+
+[FILE4]
+Type=install
+Source=%{src}/example.cpp
+Dest=%{dest}/%{APPNAMELC}.cpp
+
+[FILE5]
+Type=install
+Source=%{src}/example.h
+Dest=%{dest}/%{APPNAMELC}.h
+
+[FILE6]
+Type=install
+EscapeXML=true
+Source=%{src}/examplebase.ui
+Dest=%{dest}/%{APPNAMELC}base.ui
+
+[FILE7]
+Type=install
+Source=%{src}/example.control
+Dest=%{dest}/%{APPNAMELC}.control
+
+[FILE8]
+Type=install
+Source=%{src}/example.desktop
+Dest=%{dest}/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+EscapeXML=true
+Source=%{src}/example.html
+Dest=%{dest}/%{APPNAMELC}.html
+
+[FILE10]
+Type=install
+Source=%{src}/main.cpp
+Dest=%{dest}/main.cpp
+
+[MSG]
+Type=message
+Comment=A Qtopia application was created in %{dest}
+Comment[ca]=Una aplicació basada en Qtopia ha estat creada en %{dest}
+Comment[da]=Et Qtopia program blev oprettet i %{dest}
+Comment[de]=Eine Qtopia-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Qtopia δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación para Qtopia ha sido creada en %{dest}
+Comment[et]=Qtopia rakendus loodi asukohta %{dest}
+Comment[eu]=Qtopia aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد Qtopia در %{dest} ایجاد شد
+Comment[fr]=Une application Qtopia a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár Qtopia i %{dest}
+Comment[gl]=Creouse unha aplicación Qtopia en %{dest}
+Comment[hu]=Létrejött egy Qtopia-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Qtopia in %{dest}
+Comment[ja]=Qtopia アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Qtopia-Programm opstellt
+Comment[ne]=Qtopia अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Qtopia-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program wykorzystujący Qtopię został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação do Qtopia em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação do Qtopia em %{dest}
+Comment[ru]=Приложение Qtopia создано в %{dest}
+Comment[sk]=Qtopia aplikácia bola vytvorená v %{dest}
+Comment[sr]=Qtopia програм је направљен у %{dest}
+Comment[sr@Latn]=Qtopia program je napravljen u %{dest}
+Comment[sv]=Ett Qtopia-program skapades i %{dest}
+Comment[tr]=Bir Qtopia uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了 Qtopia 应用程序
+Comment[zh_TW]=一個 Qtopia 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/cpp/app_templates/qtopiaapp/qtopiaapp.png
Binary files differ
diff --git a/languages/cpp/app_templates/win32gui/.kdev_ignore b/languages/cpp/app_templates/win32gui/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/.kdev_ignore
diff --git a/languages/cpp/app_templates/win32gui/Makefile.am b/languages/cpp/app_templates/win32gui/Makefile.am
new file mode 100644
index 00000000..66931bfd
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = app.cpp src-Makefile.am win32gui-Makefile.am win32gui-Makefile.cvs \
+ win32gui-configure.in win32gui.png app.kdevelop
+
+templateName = win32gui
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/win32gui/app.cpp b/languages/cpp/app_templates/win32gui/app.cpp
new file mode 100644
index 00000000..a875b28b
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/app.cpp
@@ -0,0 +1,12 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <windows.h>
+
+int STDCALL
+WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
+{
+ MessageBox (NULL, "Hello, Windows!", "Hello", MB_OK);
+ return 0;
+}
+
diff --git a/languages/cpp/app_templates/win32gui/app.kdevelop b/languages/cpp/app_templates/win32gui/app.kdevelop
new file mode 100644
index 00000000..f9dc8145
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/app.kdevelop
@@ -0,0 +1,192 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description></description>
+ <ignoreparts/>
+ <secondaryLanguages/>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}.exe</mainprogram>
+ <terminal>false</terminal>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs></programargs>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ <configargs></configargs>
+ <topsourcedir></topsourcedir>
+ <cppflags></cppflags>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags></cflags>
+ <f77flags></f77flags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ <topsourcedir></topsourcedir>
+ <cppflags></cppflags>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags></cflags>
+ <f77flags></f77flags>
+ </debug>
+ <default>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ <configargs></configargs>
+ <builddir></builddir>
+ <topsourcedir></topsourcedir>
+ <cppflags></cppflags>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevpgf77options</f77compiler>
+ <ccompilerbinary></ccompilerbinary>
+ <cxxcompilerbinary></cxxcompilerbinary>
+ <f77compilerbinary></f77compilerbinary>
+ <cflags></cflags>
+ <cxxflags></cxxflags>
+ <f77flags></f77flags>
+ </default>
+ </configurations>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <prio>0</prio>
+ </make>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>clanlib</toc>
+ <toc>opengl</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcppsupport>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <references>
+ <pcs>Qt</pcs>
+ <pcs>KDElibs</pcs>
+ <pcs>ksjembed</pcs>
+ </references>
+ </kdevcppsupport>
+ <kdevdebugger>
+ <general>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <dbgshell></dbgshell>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/win32gui/src-Makefile.am b/languages/cpp/app_templates/win32gui/src-Makefile.am
new file mode 100644
index 00000000..21f6d7c8
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = -mwindows $(all_libraries)
diff --git a/languages/cpp/app_templates/win32gui/win32gui-Makefile.am b/languages/cpp/app_templates/win32gui/win32gui-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/win32gui-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs b/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/win32gui-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/win32gui/win32gui-configure.in b/languages/cpp/app_templates/win32gui/win32gui-configure.in
new file mode 100644
index 00000000..612ce0d5
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/win32gui-configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_CPLUSPLUS
+AC_PROG_CXX
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate b/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate
new file mode 100644
index 00000000..0a600294
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/win32gui.kdevtemplate
@@ -0,0 +1,137 @@
+# KDE Config File
+[General]
+Name=Simple Win32 GUI App.
+Name[ca]=Simple aplicació per a Win32.
+Name[da]=Simpelt Win32 GUI-program.
+Name[de]=Einfache Win32-GUI-Anwendung
+Name[el]=Απλή εφαρμογή γραφικού περιβάλλοντος Win32.
+Name[es]=Aplicación sencilla para Win32
+Name[et]=Lihtne Win32 graafilise kasutajaliidese rakendus
+Name[eu]=Win32 GUI aplikazio sinplea.
+Name[fa]=کاربرد سادۀ ونک Win32
+Name[fr]=Interface graphique Win32 simple.
+Name[ga]=Feidhmchlár Simplí Win32 le Comhéadan Grafach
+Name[gl]=Aplicación sinxela Win32.
+Name[hu]=Egyszerű Win32-alapú, grafikus felületű alkalmazás
+Name[it]=Semplice applicazione GUI Win32.
+Name[ja]=簡単な Win32 GUI アプリケーション
+Name[nds]=Eenfach Win32-Böversietprogramm.
+Name[ne]=साधारण Win32 GUI अनुप्रयोग
+Name[nl]=Eenvoudige Win32 GUI-toepassing
+Name[pl]=Prosty program Win32
+Name[pt]=Aplicação gráfica simples em Win32.
+Name[pt_BR]=Aplicação gráfica simples em Win32.
+Name[ru]=Простое графическое приложение Windows
+Name[sk]=Jednoduchá Win32 GUI aplikácia
+Name[sr]=Једноставан Win32 програм са GUI-јем.
+Name[sr@Latn]=Jednostavan Win32 program sa GUI-jem.
+Name[sv]=Enkelt Win32-program med grafiskt gränssnitt
+Name[tr]=Basit Win32 Grafik Arayüz Uygulaması
+Name[zh_CN]=简单的 Win32 GUI 应用程序
+Name[zh_TW]=簡單的 Win32 使用者介面應用程式
+Icon=win32gui.png
+Category=C++
+Comment=Generates a shell project for crosscompiling Win32 projects.
+Comment[ca]=Genera un projecte d'intèrpret de comandaments per a la compilació multi plataforma de projectes per a Win32.
+Comment[da]=Genererer et skalprojekt for krydskompilering af Win32-projekter.
+Comment[de]=Erstellt ein Shell-Projekt für plattformunabhängige Win32-Projekte.
+Comment[el]=Δημιουργία ενός έργου κελύφους για μεταγλώττιση έργων Win32 σε διαφορετικές πλατφόρμες.
+Comment[es]=Genera un proyecto de intérprete de órdenes para compilación multiplataforma de proyectos Win32.
+Comment[et]=Shelliprojekti loomine Win32 projektide kompileerimiseks.
+Comment[eu]=Win32 proiektuak konpilazio gurutzaturako shell proiektu bat sortzen du.
+Comment[fa]=یک پروژۀ پوسته برای پروژه‌های Win32 ترجمۀ بین سکویی تولید می‌کند.
+Comment[fr]=Génère un projet shell pour la compilation croisée de projets Win32.
+Comment[gl]=Xera un proxecto shell para a compilación cruzada de proxectos Win32.
+Comment[hu]=Létrehoz egy konzolos projektet Win32-projektek keresztfordításához.
+Comment[it]=Genera un progetto di shell per progetti Win32 multi compilanti.
+Comment[nds]=Stellt en Konsoolprojekt för't Krüüzkompileren vun Win32-Projekten op.
+Comment[ne]=क्रसकम्पाइलिङ Win32 परियोजनाका लागि शेल परियोजना उत्पन्न गर्दछ
+Comment[nl]=Genereert een shellproject voor crosscompilerende Win32-projecten.
+Comment[pl]=Generuje powłokę do kompilacji projektów dla Win32.
+Comment[pt]=Gera um projecto para poder compilar projectos em Win32.
+Comment[pt_BR]=Gera um projecto para poder compilar projectos em Win32.
+Comment[ru]=Создание проекта для кросс-компиляции проектов Win32.
+Comment[sk]=Vygenruje shell projekt pre kompiláciu Win32 projektov.
+Comment[sr]=Прави пројекат за прекопревођење Win32 пројеката.
+Comment[sr@Latn]=Pravi projekat za prekoprevođenje Win32 projekata.
+Comment[sv]=Skapar ett skalprojekt för korskompilering av Win32-projekt.
+Comment[tr]=Win32 projelerini karşıderlemek için bir kabul projesi yarat.
+Comment[zh_CN]=生成跨平台编译的 Win32 工程的外壳工程。
+Comment[zh_TW]=產生一個 shell 專案,可在 Win32 跨平台編譯。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp
+Archive=win32gui.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/win32gui-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/win32gui-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/win32gui-configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=For this project to compile and run you need both Wine and MinGW installed.
+Comment[ca]=Per a compilar i executar aquest projecte us caldrà instal·lar Wine i MinGW.
+Comment[da]=For at dette projekt skal kompilere og køre har du brug for at have både Wine og MinGW installeret.
+Comment[de]=Um dieses Projekt kompilieren und ausführen zu können, muss sowohl Wine als auch MinGW installiert sein.
+Comment[el]=Για να μεταγλωττιστεί και να εκτελεστεί αυτό το έργο χρειάζεστε τόσο το Wine όσο και το MinGW εγκατεστημένα.
+Comment[es]=Para compilar y ejecutar este proyecto necesitará tener instalados Wine y MinGW.
+Comment[et]=Selle projekti kompileerimiseks ja käivitamiseks peab olema paigaldatud nii Wine kui MinGW.
+Comment[eu]=Proiektu hau konpilatzeko eta exekutatzeko Wine eta MinGw instalatuta izan behar dituzu.
+Comment[fa]=برای ترجمه و اجرای این پروژه، هم نیاز به نصب Wine و هم نیاز به MinGW دارید.
+Comment[fr]=Pour que ce projet compile et s'exécute, vous devez installer Wine et MinGW.
+Comment[gl]=Para poder compilar e executar este proxecto necesita ter instalados Wine e MinGW.
+Comment[hu]=A projekt lefordításához és futtatásához szükség van a Wine és a MinGW telepítésére.
+Comment[it]=Per compilare ed eseguire questo progetto dei avere sia Wine che MinGW installati.
+Comment[nds]=Wine un MinGW mööt installeert wesen, wenn Du dit Projekt kompileren un utföhren wullt.
+Comment[ne]=यो परियोजनाका लागि कम्पाइल गर्न र चलाउन तपाईँले वाइन र MinGW स्थापना गरेको हुनुपर्दछ ।
+Comment[nl]=Om dit project te kunnen compileren en uitvoeren hebt u Wine en MinGW nodig.
+Comment[pl]=Do kompilacji takiego projektu potrzebne są Wine oraz MinGW.
+Comment[pt]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados.
+Comment[pt_BR]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados.
+Comment[ru]=Для сборки и запуска этого проекта вам необходимо установить Wine и MinGW .
+Comment[sk]=Na kompiláciu tohoto projektu potrebujete mať nainštalované Wine a MinGW.
+Comment[sr]=Да би се овај пројекат превео и покренуо, и Wine и MinGW морају бити инсталирани.
+Comment[sr@Latn]=Da bi se ovaj projekat preveo i pokrenuo, i Wine i MinGW moraju biti instalirani.
+Comment[sv]=För att projektet ska kompileras och köras behöver du ha installerat både Wine och MinGW.
+Comment[tr]=Bu projenin derlenmesi için Wine ve MinGW'nin kurulu olması lazım.
+Comment[zh_CN]=要让此工程能够编译并运行,您需要同时安装 Wine 和 MinGW。
+Comment[zh_TW]=這個專案要編譯,您需要安裝 Wine 與 MinGW。
+
diff --git a/languages/cpp/app_templates/win32gui/win32gui.png b/languages/cpp/app_templates/win32gui/win32gui.png
new file mode 100644
index 00000000..901ee474
--- /dev/null
+++ b/languages/cpp/app_templates/win32gui/win32gui.png
Binary files differ
diff --git a/languages/cpp/app_templates/win32hello/.kdev_ignore b/languages/cpp/app_templates/win32hello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/.kdev_ignore
diff --git a/languages/cpp/app_templates/win32hello/Makefile.am b/languages/cpp/app_templates/win32hello/Makefile.am
new file mode 100644
index 00000000..d6c7dfad
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = app.cpp src-Makefile.am win32-Makefile.am win32-Makefile.cvs \
+ win32-configure.in win32hello.png app.kdevelop
+
+templateName = win32hello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/cpp/app_templates/win32hello/app.cpp b/languages/cpp/app_templates/win32hello/app.cpp
new file mode 100644
index 00000000..10b02750
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/app.cpp
@@ -0,0 +1,16 @@
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <cstdlib>
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ cout << "Hello, from Win32!" << endl;
+
+ return EXIT_SUCCESS;
+}
diff --git a/languages/cpp/app_templates/win32hello/app.kdevelop b/languages/cpp/app_templates/win32hello/app.kdevelop
new file mode 100644
index 00000000..33c1e97e
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/app.kdevelop
@@ -0,0 +1,164 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description></description>
+ <ignoreparts/>
+ <secondaryLanguages/>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>default</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}.exe</mainprogram>
+ <terminal>true</terminal>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs/>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ </debug>
+ <default>
+ <envvars>
+ <envvar value="i586-mingw32msvc-c" name="CC" />
+ <envvar value="i586-mingw32msvc-c++" name="CXX" />
+ <envvar value="i586-mingw32msvc-ld" name="LD" />
+ </envvars>
+ </default>
+ </configurations>
+ <make>
+ <envvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </envvars>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <prio>0</prio>
+ </make>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>clanlib</toc>
+ <toc>opengl</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.h" name="Header files" />
+ <group pattern="*.cpp" name="Source files" />
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcppsupport>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <references>
+ <pcs>Qt</pcs>
+ <pcs>KDElibs</pcs>
+ <pcs>ksjembed</pcs>
+ </references>
+ </kdevcppsupport>
+ <kdevdebugger>
+ <general>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <dbgshell></dbgshell>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/win32hello/src-Makefile.am b/languages/cpp/app_templates/win32hello/src-Makefile.am
new file mode 100644
index 00000000..21f6d7c8
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = -mwindows $(all_libraries)
diff --git a/languages/cpp/app_templates/win32hello/win32-Makefile.am b/languages/cpp/app_templates/win32hello/win32-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/win32-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/cpp/app_templates/win32hello/win32-Makefile.cvs b/languages/cpp/app_templates/win32hello/win32-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/win32-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/cpp/app_templates/win32hello/win32-configure.in b/languages/cpp/app_templates/win32hello/win32-configure.in
new file mode 100644
index 00000000..612ce0d5
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/win32-configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_LANG_CPLUSPLUS
+AC_PROG_CXX
+AM_PROG_LIBTOOL
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate b/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate
new file mode 100644
index 00000000..b6fb54d2
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/win32hello.kdevtemplate
@@ -0,0 +1,136 @@
+# KDE Config File
+[General]
+Name=Simple Win32 Hello World
+Name[ca]=Simple Hello World per a Win32
+Name[da]=Simpelt Win32 Goddag verden
+Name[de]=Einfaches Win32-"Hello World"-Programm
+Name[el]=Απλό Γεια σου Κόσμε Win32
+Name[es]=Sencillo programa «Hola mundo» para Win32
+Name[et]=Lihtne Win32 "Tere, maailm"
+Name[eu]=Win32 "Kaixo mundua" aplikazio sinple bat
+Name[fa]=Hello World سادۀ Win32
+Name[fr]=« Bonjour monde » Win32 simple
+Name[ga]=Ríomhchlár simplí "Hello World" le haghaidh Win32
+Name[gl]=Aplicación Win32 sinxela Ola mundo
+Name[hu]=Win32-alapú Hello world program
+Name[it]=Semplice "Hello World" Win32
+Name[nds]=Eenfach Win32-"Moin Welt"-Programm
+Name[ne]=साधारण Win32 हेल्लो वोल्ड
+Name[nl]=Eenvoudige Win32 Hello World
+Name[pl]=Prosty program Witaj świecie dla Win32
+Name[pt]=Olá Mundo Simples em Win32
+Name[pt_BR]=Olá Mundo Simples em Win32
+Name[ru]=Простое приложение Hello World для Windows
+Name[sk]=Jenoduchý Ahoj svet Win32 program
+Name[sr]=Једноставан Win32 „Здраво свете“
+Name[sr@Latn]=Jednostavan Win32 „Zdravo svete“
+Name[sv]=Enkelt Win32 Hello World
+Name[tr]=Basit Win32 Merhaba Dünya
+Name[zh_CN]=简单的 Win32 Hello World
+Name[zh_TW]=簡單的 Win32 Hello World
+Icon=win32hello.png
+Category=C++
+Comment=Generates a shell project for crosscompiling Win32 projects.
+Comment[ca]=Genera un projecte d'intèrpret de comandaments per a la compilació multi plataforma de projectes per a Win32.
+Comment[da]=Genererer et skalprojekt for krydskompilering af Win32-projekter.
+Comment[de]=Erstellt ein Shell-Projekt für plattformunabhängige Win32-Projekte.
+Comment[el]=Δημιουργία ενός έργου κελύφους για μεταγλώττιση έργων Win32 σε διαφορετικές πλατφόρμες.
+Comment[es]=Genera un proyecto de intérprete de órdenes para compilación multiplataforma de proyectos Win32.
+Comment[et]=Shelliprojekti loomine Win32 projektide kompileerimiseks.
+Comment[eu]=Win32 proiektuak konpilazio gurutzaturako shell proiektu bat sortzen du.
+Comment[fa]=یک پروژۀ پوسته برای پروژه‌های Win32 ترجمۀ بین سکویی تولید می‌کند.
+Comment[fr]=Génère un projet shell pour la compilation croisée de projets Win32.
+Comment[gl]=Xera un proxecto shell para a compilación cruzada de proxectos Win32.
+Comment[hu]=Létrehoz egy konzolos projektet Win32-projektek keresztfordításához.
+Comment[it]=Genera un progetto di shell per progetti Win32 multi compilanti.
+Comment[nds]=Stellt en Konsoolprojekt för't Krüüzkompileren vun Win32-Projekten op.
+Comment[ne]=क्रसकम्पाइलिङ Win32 परियोजनाका लागि शेल परियोजना उत्पन्न गर्दछ
+Comment[nl]=Genereert een shellproject voor crosscompilerende Win32-projecten.
+Comment[pl]=Generuje powłokę do kompilacji projektów dla Win32.
+Comment[pt]=Gera um projecto para poder compilar projectos em Win32.
+Comment[pt_BR]=Gera um projecto para poder compilar projectos em Win32.
+Comment[ru]=Создание проекта для кросс-компиляции проектов Win32.
+Comment[sk]=Vygenruje shell projekt pre kompiláciu Win32 projektov.
+Comment[sr]=Прави пројекат за прекопревођење Win32 пројеката.
+Comment[sr@Latn]=Pravi projekat za prekoprevođenje Win32 projekata.
+Comment[sv]=Skapar ett skalprojekt för korskompilering av Win32-projekt.
+Comment[tr]=Win32 projelerini karşıderlemek için bir kabul projesi yarat.
+Comment[zh_CN]=生成跨平台编译的 Win32 工程的外壳工程。
+Comment[zh_TW]=產生一個 shell 專案,可在 Win32 跨平台編譯。
+FileTemplates=h,CStyle,cpp,CStyle
+ShowFilesAfterGeneration=src/%{APPNAMELC}.cpp
+Archive=win32hello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/win32-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/win32-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/win32-configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=For this project to compile and run you need both Wine and MinGW installed.
+Comment[ca]=Per a compilar i executar aquest projecte us caldrà instal·lar Wine i MinGW.
+Comment[da]=For at dette projekt skal kompilere og køre har du brug for at have både Wine og MinGW installeret.
+Comment[de]=Um dieses Projekt kompilieren und ausführen zu können, muss sowohl Wine als auch MinGW installiert sein.
+Comment[el]=Για να μεταγλωττιστεί και να εκτελεστεί αυτό το έργο χρειάζεστε τόσο το Wine όσο και το MinGW εγκατεστημένα.
+Comment[es]=Para compilar y ejecutar este proyecto necesitará tener instalados Wine y MinGW.
+Comment[et]=Selle projekti kompileerimiseks ja käivitamiseks peab olema paigaldatud nii Wine kui MinGW.
+Comment[eu]=Proiektu hau konpilatzeko eta exekutatzeko Wine eta MinGw instalatuta izan behar dituzu.
+Comment[fa]=برای ترجمه و اجرای این پروژه، هم نیاز به نصب Wine و هم نیاز به MinGW دارید.
+Comment[fr]=Pour que ce projet compile et s'exécute, vous devez installer Wine et MinGW.
+Comment[gl]=Para poder compilar e executar este proxecto necesita ter instalados Wine e MinGW.
+Comment[hu]=A projekt lefordításához és futtatásához szükség van a Wine és a MinGW telepítésére.
+Comment[it]=Per compilare ed eseguire questo progetto dei avere sia Wine che MinGW installati.
+Comment[nds]=Wine un MinGW mööt installeert wesen, wenn Du dit Projekt kompileren un utföhren wullt.
+Comment[ne]=यो परियोजनाका लागि कम्पाइल गर्न र चलाउन तपाईँले वाइन र MinGW स्थापना गरेको हुनुपर्दछ ।
+Comment[nl]=Om dit project te kunnen compileren en uitvoeren hebt u Wine en MinGW nodig.
+Comment[pl]=Do kompilacji takiego projektu potrzebne są Wine oraz MinGW.
+Comment[pt]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados.
+Comment[pt_BR]=Para este projecto poder ser compilado e executado é necessário ter tanto o Wine como o MinGW instalados.
+Comment[ru]=Для сборки и запуска этого проекта вам необходимо установить Wine и MinGW .
+Comment[sk]=Na kompiláciu tohoto projektu potrebujete mať nainštalované Wine a MinGW.
+Comment[sr]=Да би се овај пројекат превео и покренуо, и Wine и MinGW морају бити инсталирани.
+Comment[sr@Latn]=Da bi se ovaj projekat preveo i pokrenuo, i Wine i MinGW moraju biti instalirani.
+Comment[sv]=För att projektet ska kompileras och köras behöver du ha installerat både Wine och MinGW.
+Comment[tr]=Bu projenin derlenmesi için Wine ve MinGW'nin kurulu olması lazım.
+Comment[zh_CN]=要让此工程能够编译并运行,您需要同时安装 Wine 和 MinGW。
+Comment[zh_TW]=這個專案要編譯,您需要安裝 Wine 與 MinGW。
+
diff --git a/languages/cpp/app_templates/win32hello/win32hello.png b/languages/cpp/app_templates/win32hello/win32hello.png
new file mode 100644
index 00000000..3f33a1b5
--- /dev/null
+++ b/languages/cpp/app_templates/win32hello/win32hello.png
Binary files differ
diff --git a/languages/cpp/app_templates/wxhello/.kdev_ignore b/languages/cpp/app_templates/wxhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/.kdev_ignore
diff --git a/languages/cpp/app_templates/wxhello/Makefile.am b/languages/cpp/app_templates/wxhello/Makefile.am
new file mode 100644
index 00000000..5f1a213a
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = src-Makefile.am app.cpp app.h app.kdevelop subdirs \
+ app.desktop wxhello.png
+
+templateName = wxhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/cpp/app_templates/wxhello/app.cpp b/languages/cpp/app_templates/wxhello/app.cpp
new file mode 100644
index 00000000..6bcb3d47
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/app.cpp
@@ -0,0 +1,52 @@
+#include <wx/wx.h>
+#include "%{APPNAMELC}.h"
+
+BEGIN_EVENT_TABLE( %{APPNAME}Frame, wxFrame )
+ EVT_MENU( Menu_File_Quit, %{APPNAME}Frame::OnQuit )
+ EVT_MENU( Menu_File_About, %{APPNAME}Frame::OnAbout )
+END_EVENT_TABLE()
+
+IMPLEMENT_APP(%{APPNAME}app)
+
+
+bool
+%{APPNAME}app::OnInit()
+{
+ %{APPNAME}Frame *frame = new %{APPNAME}Frame( wxT( "Hello World" ), wxPoint(50,50), wxSize(450,340) );
+
+ frame->Show(TRUE);
+ SetTopWindow(frame);
+ return TRUE;
+}
+
+%{APPNAME}Frame::%{APPNAME}Frame( const wxString& title, const wxPoint& pos, const wxSize& size )
+ : wxFrame((wxFrame *)NULL, -1, title, pos, size)
+{
+ wxMenu *menuFile = new wxMenu;
+
+ menuFile->Append( Menu_File_About, wxT( "&About..." ) );
+ menuFile->AppendSeparator();
+ menuFile->Append( Menu_File_Quit, wxT( "E&xit" ) );
+
+ wxMenuBar *menuBar = new wxMenuBar;
+ menuBar->Append( menuFile, wxT( "&File" ) );
+
+ SetMenuBar( menuBar );
+
+ CreateStatusBar();
+ SetStatusText( wxT( "Welcome to Kdevelop wxWidgets app!" ) );
+}
+
+void
+%{APPNAME}Frame::OnQuit( wxCommandEvent& WXUNUSED( event ) )
+{
+ Close(TRUE);
+}
+
+void
+%{APPNAME}Frame::OnAbout( wxCommandEvent& WXUNUSED( event ) )
+{
+ wxMessageBox( wxT( "This is a wxWidgets Hello world sample" ),
+ wxT( "About Hello World" ), wxOK | wxICON_INFORMATION, this );
+}
+
diff --git a/languages/cpp/app_templates/wxhello/app.desktop b/languages/cpp/app_templates/wxhello/app.desktop
new file mode 100644
index 00000000..e87774fa
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/app.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple wxWidgets Application
+Comment[ca]=Una simple aplicació per a wxWidgets
+Comment[da]=Et simpelt wxWidgets program
+Comment[de]=Eine einfache wxWidgets-Anwendung
+Comment[el]=Μια απλή εφαρμογή wxWidgets
+Comment[es]=Una aplicación wxWidgets sencilla
+Comment[et]=Lihtne wxWidgets rakendus
+Comment[eu]=wxWidgets aplikazio sinple bat
+Comment[fa]=یک کاربرد سادۀ wxWidgets
+Comment[fr]=Une application avec wxWidgets simple
+Comment[ga]=Feidhmchlár Simplí wxWidgets
+Comment[gl]=Unha aplicación sinxela wxWidgets
+Comment[hi]=एक सादा डब्ल्यूएक्स-विज़ेट्स अनुप्रयोग
+Comment[hu]=Egyszerű wxWidgets-alkalmazás
+Comment[is]=Einfalt wxWidgets forrit
+Comment[it]=Semplice applicazione wxWidgets
+Comment[ja]=シンプルな wxWidget アプリケーション
+Comment[nds]=En eenfach wxWidgets-Programm
+Comment[ne]=साधारण wxWidgets अनुप्रयोग
+Comment[nl]=Een eenvoudige wxWidgets-toepassing
+Comment[pl]=Prosty program wxWidgets
+Comment[pt]=Uma aplicação simples de wxWidgets
+Comment[pt_BR]=Um simples Aplicativo wxWidgets
+Comment[ru]=Создание простого приложения wxWidgets
+Comment[sk]=Jednoduchá wxWidgets aplikácia
+Comment[sl]=Preprost program za wxWidgets
+Comment[sr]=Једноставан wxWindows програм
+Comment[sr@Latn]=Jednostavan wxWindows program
+Comment[sv]=Ett enkelt wxWidgets-program
+Comment[ta]=சாதாரண wxசாளரங்கள் பயன்பாடு
+Comment[tg]=Гузориши оддии wxWidgets
+Comment[tr]=Basit bir Merhaba wmWidgets Uygulaması
+Comment[zh_CN]=一个简单的 wxWidgets 应用程序
+Comment[zh_TW]=簡單的 wxWidgets 應用程式
diff --git a/languages/cpp/app_templates/wxhello/app.h b/languages/cpp/app_templates/wxhello/app.h
new file mode 100644
index 00000000..cb4be988
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/app.h
@@ -0,0 +1,36 @@
+
+#ifndef _%{APPNAMEUC}_H_
+#define _%{APPNAMEUC}_H_
+
+/**
+ * @short Application Main Window
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+
+class
+%{APPNAME}app : public wxApp
+{
+ public:
+ virtual bool OnInit();
+};
+
+class
+%{APPNAME}Frame : public wxFrame
+{
+ public:
+ %{APPNAME}Frame( const wxString& title, const wxPoint& pos, const wxSize& size );
+ void OnQuit( wxCommandEvent& event );
+ void OnAbout( wxCommandEvent& event );
+
+ private:
+ DECLARE_EVENT_TABLE()
+};
+
+enum
+{
+ Menu_File_Quit = 100,
+ Menu_File_About
+};
+
+#endif // _%{APPNAMEUC}_H_
diff --git a/languages/cpp/app_templates/wxhello/app.kdevelop b/languages/cpp/app_templates/wxhello/app.kdevelop
new file mode 100644
index 00000000..77835163
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/app.kdevelop
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>C++</keyword>
+ <keyword>Code</keyword>
+ <keyword>wxWidgets</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>kdevgccoptions</ccompiler>
+ <cxxcompiler>kdevgppoptions</cxxcompiler>
+ <f77compiler>kdevg77options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.rc" name="Resource file" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="rc" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/cpp/app_templates/wxhello/src-Makefile.am b/languages/cpp/app_templates/wxhello/src-Makefile.am
new file mode 100644
index 00000000..f93393e6
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/src-Makefile.am
@@ -0,0 +1,14 @@
+# these are the headers for your project
+noinst_HEADERS = %{APPNAMELC}.h
+
+#########################################################################
+# APPLICATION SECTION
+#########################################################################
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# the application source, library search path, and link libraries
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+%{APPNAMELC}_LDFLAGS = $(WX_LIBS)
+
diff --git a/languages/cpp/app_templates/wxhello/subdirs b/languages/cpp/app_templates/wxhello/subdirs
new file mode 100644
index 00000000..85de9cf9
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/subdirs
@@ -0,0 +1 @@
+src
diff --git a/languages/cpp/app_templates/wxhello/wxhello b/languages/cpp/app_templates/wxhello/wxhello
new file mode 100644
index 00000000..2e0d224f
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/wxhello
@@ -0,0 +1,105 @@
+# wxWidgets Config File
+[General]
+Name=Simple Hello wxWidgets Application
+Name[fr]=Un simple programme de test Hello world
+Category=C++/wxWidgets
+Comment=Generates a simple wxWidgets Hello application.
+Comment[fr]=Gnre un simple programme de test du type Hello world en utilisant la bibliothque wxWidgets.
+FileTemplates=h,CStyle,cpp,CStyle
+Icon=wxhello.png
+ShowFilesAfterGeneration=src/APPNAMELC.cpp
+
+[LICENSE]
+Type=install
+Source=%{src}/template-common/%{LICENSEFILE}
+Dest=%{dest}/%{LICENSEFILE}
+
+[GNU]
+Type=install archive
+Source=%{src}/template-common/gnu.tar.gz
+Dest=%{dest}
+
+[SRC]
+Type= mkdir
+Dir=%{dest}/src
+
+[DOCSDIR]
+Type=mkdir
+Dir=%{dest}/doc
+
+[DOCSDIREN]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[DOCSMAKEFILE.AM1]
+Type=install
+Source=%{src}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+Option=INSTALL_DOCS
+
+[DOCSMAKEFILE.AM2]
+Type=install
+Source=%{src}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+Option=INSTALL_DOCS
+
+[DOCS]
+Type=install
+Source=%{src}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+Option=INSTALL_DOCS
+
+[PROJECT]
+Type=install
+Source=%{src}/template-wxhello/app.kdevelop
+Dest=%{dest}/${APPNAMELC}.kdevelop
+
+[WXMAKEFILE.AM]
+Type=install
+Source=%${src}/template-common/wx-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[WXMAKEFILE.CVS]
+Type=install
+Source=%${src}/template-common/wx-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[WXCONFIGURE.IN]
+Type=install
+Source=%${src}/template-common/wx-configure.in
+Dest=%{dest}/configure.in
+
+[APPICON.16]
+Type=install
+Source=%${src}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-${APPNAMELC}.png
+
+[APPICON.32]
+Type=install
+Source=%${src}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-${APPNAMELC}.png
+
+[SUBDIRS]
+Type=install
+Source=%${src}/template-wxhello/subdirs
+Dest=%{dest}/subdirs
+
+[SRC.MAKEFILE.AM]
+Type=install
+Source=%${src}/template-wxhello/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[APP.CPP]
+Type=install
+Source=%${src}/template-wxhello/app.cpp
+Dest=%{dest}/src/${APPNAMELC}.cpp
+
+[APP.H]
+Type=install
+Source=%${src}/template-wxhello/app.h
+Dest=%{dest}/src/${APPNAMELC}.h
+
+[APP.DESKTOP]
+Type=install
+Source=%${src}/template-wxhello/app.desktop
+Dest=%{dest}/src/${APPNAMELC}.desktop \ No newline at end of file
diff --git a/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate b/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate
new file mode 100644
index 00000000..48e605e1
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/wxhello.kdevtemplate
@@ -0,0 +1,192 @@
+# KDE Config File
+[General]
+Name=Simple Hello wxWidgets Application
+Name[ca]=Simple aplicació de Hello per a wxWidgets
+Name[da]=Simpelt Goddag wxWidgets program
+Name[de]=Einfache wxWidgets-Anwendung
+Name[el]=Απλή εφαρμογή Γεια σου wxWidgets
+Name[es]=Una sencilla aplicación «Hola mundo» con wxWidgets
+Name[et]=Lihtne wxWidgets'i tervitusrakendus
+Name[eu]=wxWidgets-en "Kaixo mundua" aplikazio sinple bat
+Name[fa]=کاربرد سادۀ Hello wxWidgets
+Name[fr]=Application « Bonjour monde » simple avec wxWidgets
+Name[gl]=Aplicación sinxela Ola en wxWidgets
+Name[hu]=wxWidgets-alapú Hello world program
+Name[it]=Semplice applicazione wxWidgets di "Hello"
+Name[ja]=簡単な wxWidget アプリケーション
+Name[nds]=Eenfach wxWidgets-Programm "Moin"
+Name[ne]=साधारण हेल्लो wxWidgets अनुप्रयोग
+Name[nl]=Eenvoudige Hello wxWidgets-toepassing
+Name[pl]=Prosty program Witaj używający wxWidgets
+Name[pt]=Aplicação Olá Mundo Simples do wxWidgets
+Name[pt_BR]=Aplicação Olá Mundo Simples do wxWidgets
+Name[ru]=Простое приложение wxWidgets
+Name[sk]=Jednoduchá wxWidgets Ahoj svet aplikácia
+Name[sr]=Једноставан „Здраво“ wxWidgets програм
+Name[sr@Latn]=Jednostavan „Zdravo“ wxWidgets program
+Name[sv]=Enkelt Hello-program för wxWidgets
+Name[tr]=Basit Merhaba wxWidgets Uygulaması
+Name[zh_CN]=一个简单的 wxWidgets 应用程序
+Name[zh_TW]=簡單的 Hello wxWidgets 應用程式
+Category=C++/wxWidgets
+Comment=Generates a simple wxWidgets Hello application.
+Comment[ca]=Genera una simple aplicació de Hello per a wxWidgets.
+Comment[da]=Genererer et simpelt wxWidgets Goddag-program.
+Comment[de]=Erstellt eine einfache wxWidgets-Anwendung
+Comment[el]=Δημιουργεί μια απλή εφαρμογή Γεια σου wxWidgets.
+Comment[es]=Genera una sencilla aplicación «Hola mundo» con wxWidgets
+Comment[et]=Lihtsa wxWidgets'i tervitusrakenduse loomine.
+Comment[eu]=wxWidgets-en "Kaixo mundua"aplikazio sinple bat sortzen du.
+Comment[fa]=یک کاربرد سادۀ wxWidgets Hello تولید می‌کند.
+Comment[fr]=Une application « Bonjour monde » simple avec wxWidgets.
+Comment[gl]=Xera unha aplicación sinxela Ola en wxWidgets.
+Comment[hu]=Létrehoz egy egyszerű wxWidgets-alkalmazást.
+Comment[it]=Genera una semplice applicazione wxWidgets di "Hello".
+Comment[ja]=簡単な wxWidget アプリケーションを作成します
+Comment[nds]=Stellt mit wxWidgets en eenfach "Moin"-Programm op.
+Comment[ne]=साधारण wxWidgets हेल्लो अनुप्रयोग उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudige wxWidget Hello-toepassing.
+Comment[pl]=Generuje prosty program Witaj wykorzystujący wxWidgets
+Comment[pt]=Gera uma aplicação simples de Olá Mundo do wxWidgets.
+Comment[pt_BR]=Gera uma aplicação simples de Olá Mundo do wxWidgets.
+Comment[ru]=Создание простого приложения wxWidgets.
+Comment[sk]=Vygeneruje jednoduchú wxWidgets Ahoj svet aplikáciu.
+Comment[sr]=Прави једноставан „Здраво“ wxWidgets програм.
+Comment[sr@Latn]=Pravi jednostavan „Zdravo“ wxWidgets program.
+Comment[sv]=Skapar ett enkelt Hello-program för wxWidgets.
+Comment[tr]=Basit bir wxWidgets Merhaba uygulaması yaratır.
+Comment[zh_CN]=生成一个简单的 wxWidgets Hello 应用程序。
+Comment[zh_TW]=產生一個簡單的 wxWidgets Hello 應用程式。
+FileTemplates=h,CStyle,cpp,CStyle
+Icon=wxhello.png
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.cpp
+Archive=wxhello.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[WXARCH]
+Type=install archive
+Source=%{kdevelop}/template-common/wxwidgets.tar.gz
+Dest=%{dest}
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[WX]
+Type=include
+File=%{kdevelop}/template-common/wx.kdevtemplate
+
+[FILE4]
+Type=install
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/wx-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/wx-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/wx-configure.in
+Dest=%{dest}/configure.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+#[FILE10]
+#Type=install
+#Source=%{src}/subdirs
+#Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE13]
+Type=install
+Source=%{src}/app.h
+Dest=%{dest}/src/%{APPNAMELC}.h
+
+[FILE14]
+Type=install
+Source=%{src}/app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[MSG]
+Type=message
+Comment=Simple hello wxWidgets application was created in %{dest}
+Comment[ca]=Simple aplicació de Hello per a wxWidgets ha estat creada en %{dest}
+Comment[da]=Simpelt Goddag wxWidgets program blev oprettet i %{dest}
+Comment[de]=Eine einfache wxWidgets-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια απλή εφαρμογή Γεια σου wxWidgets δημιουργήθηκε στο %{dest}
+Comment[es]=Una sencilla aplicación «Hola mundo» con wxWidgets ha sido creada en %{dest}
+Comment[et]=Lihtne wxWidgets'i tervitusrakendus loodi asukohta %{dest}
+Comment[eu]=wxWidgets "Kaixo mundua" aplikazio sinple bat sortu da hemen: %{dest}
+Comment[fa]=کاربرد سادۀ hello wxWidgets در %{dest} ایجاد شد
+Comment[fr]=Une application « Bonjour monde » simple en wxWidgets a été créée dans %{dest}
+Comment[gl]=Creouse unha aplicación sinxela Ola en wxWidgets en %{dest}
+Comment[hu]=Létrejött egy egyszerű wxWidgets-alkalmazás itt: %{dest}
+Comment[it]=È stata creata una semplice applicazione wxWidgets di "hello" in %{dest}
+Comment[ja]=簡単な wxWidget アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach wxWidgets-Programm opstellt
+Comment[ne]=साधारण हेल्लो wxWidgets अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Eenvoudige hello wxWidget-toepassing is aangemaakt in %{dest}
+Comment[pl]=Prosty program Witaj wykorzystujący wxWidgets został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação simples de wxWidgets em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação simples de wxWidgets em %{dest}
+Comment[ru]=Простое приложение wxWidgets создано в %{dest}
+Comment[sk]=Jedniduchá wxWidgets Ahoj svet aplikácia bola vytvorená v %{dest}
+Comment[sr]=Једноставан „Здраво“ wxWidgets програм направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo“ wxWidgets program napravljen je u %{dest}
+Comment[sv]=Ett enkelt Hello-program för wxWidgets.skapades i %{dest}
+Comment[tr]=Basit merhaba wxWidgets uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 wxWidgets Hello 应用程序
+Comment[zh_TW]=一個簡單的 hello wxWidgets 應用程式已建立於 %{dest}
diff --git a/languages/cpp/app_templates/wxhello/wxhello.png b/languages/cpp/app_templates/wxhello/wxhello.png
new file mode 100644
index 00000000..fbe48423
--- /dev/null
+++ b/languages/cpp/app_templates/wxhello/wxhello.png
Binary files differ
diff --git a/languages/cpp/ast_utils.cpp b/languages/cpp/ast_utils.cpp
new file mode 100644
index 00000000..d21f4782
--- /dev/null
+++ b/languages/cpp/ast_utils.cpp
@@ -0,0 +1,190 @@
+/***************************************************************************
+* Copyright (C) 2002 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "ast_utils.h"
+#include "ast.h"
+
+#include <qstringlist.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+#include <ktexteditor/editinterface.h>
+
+#include "cppsupport_utils.h"
+
+AST* findNodeAt( AST* node, int line, int column )
+{
+ // kdDebug(9007) << "findNodeAt(" << node << ")" << endl;
+
+ if ( !node )
+ return 0;
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+
+ node->getStartPosition( &startLine, &startColumn );
+ node->getEndPosition( &endLine, &endColumn );
+
+ if ( ( line > startLine || ( line == startLine && column >= startColumn ) ) &&
+ ( line < endLine || ( line == endLine && column < endColumn ) ) )
+ {
+
+ QPtrList<AST> children = node->children();
+ QPtrListIterator<AST> it( children );
+ while ( it.current() )
+ {
+ AST * a = it.current();
+ ++it;
+
+ AST* r = findNodeAt( a, line, column );
+ if ( r )
+ return r;
+ }
+
+ return node;
+ }
+
+ return 0;
+}
+
+void scopeOfNode( AST* ast, QStringList& scope )
+{
+ if ( !ast )
+ return ;
+
+ if ( ast->parent() )
+ scopeOfNode( ast->parent(), scope );
+
+ QString s;
+ switch ( ast->nodeType() )
+ {
+ case NodeType_ClassSpecifier:
+ if ( ( ( ClassSpecifierAST* ) ast ) ->name() )
+ {
+ s = ( ( ClassSpecifierAST* ) ast ) ->name() ->text();
+ s = s.isEmpty() ? QString::fromLatin1( "<unnamed>" ) : s;
+ scope.push_back( s );
+ }
+ break;
+
+ case NodeType_Namespace:
+ {
+ AST* namespaceName = ( ( NamespaceAST* ) ast ) ->namespaceName();
+ s = namespaceName ? namespaceName->text() : QString::fromLatin1( "<unnamed>" );
+ scope.push_back( s );
+ }
+ break;
+
+ case NodeType_FunctionDefinition:
+ {
+ FunctionDefinitionAST* funDef = static_cast<FunctionDefinitionAST*>( ast );
+ DeclaratorAST* d = funDef->initDeclarator() ->declarator();
+
+ // hotfix for bug #68726
+ if ( !d->declaratorId() )
+ break;
+
+ QPtrList<ClassOrNamespaceNameAST> l = d->declaratorId() ->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
+ while ( nameIt.current() )
+ {
+ AST * name = nameIt.current() ->name();
+ scope.push_back( name->text() );
+
+ ++nameIt;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+QString typeSpecToString( TypeSpecifierAST* typeSpec ) /// @todo remove
+{
+ if ( !typeSpec )
+ return QString::null;
+
+ return typeSpec->text().replace( QRegExp( " :: " ), "::" );
+}
+
+QString declaratorToString( DeclaratorAST* declarator, const QString& scope, bool skipPtrOp )
+{
+ if ( !declarator )
+ return QString::null;
+
+ QString text;
+
+ if ( !skipPtrOp )
+ {
+ QPtrList<AST> ptrOpList = declarator->ptrOpList();
+ for ( QPtrListIterator<AST> it( ptrOpList ); it.current(); ++it )
+ {
+ text += it.current() ->text();
+ }
+ text += " ";
+ }
+
+ text += scope;
+
+ if ( declarator->subDeclarator() )
+ text += QString::fromLatin1( "(" ) + declaratorToString( declarator->subDeclarator() ) + QString::fromLatin1( ")" );
+
+ if ( declarator->declaratorId() )
+ text += declarator->declaratorId() ->text();
+
+ QPtrList<AST> arrays = declarator->arrayDimensionList();
+ QPtrListIterator<AST> it( arrays );
+ while ( it.current() )
+ {
+ text += "[]";
+ ++it;
+ }
+
+ if ( declarator->parameterDeclarationClause() )
+ {
+ text += formattedOpeningParenthesis();
+
+ ParameterDeclarationListAST* l = declarator->parameterDeclarationClause() ->parameterDeclarationList();
+ if ( l != 0 )
+ {
+ QPtrList<ParameterDeclarationAST> params = l->parameterList();
+ QPtrListIterator<ParameterDeclarationAST> it( params );
+
+ while ( it.current() )
+ {
+ QString type = typeSpecToString( it.current() ->typeSpec() );
+ text += type;
+ if ( !type.isEmpty() )
+ text += " ";
+ text += declaratorToString( it.current() ->declarator() );
+
+ ++it;
+
+ if ( it.current() )
+ text += ", ";
+ }
+ }
+
+ text += formattedClosingParenthesis();
+
+ if ( declarator->constant() != 0 )
+ text += " const";
+ }
+
+ return text.replace( QRegExp( " :: " ), "::" ).simplifyWhiteSpace();
+}
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/ast_utils.h b/languages/cpp/ast_utils.h
new file mode 100644
index 00000000..ce9ec99f
--- /dev/null
+++ b/languages/cpp/ast_utils.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+* Copyright (C) 2002 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef __ast_utils_h
+#define __ast_utils_h
+
+#include <qstring.h>
+
+class AST;
+class DeclaratorAST;
+class TypeSpecifierAST;
+class QStringList;
+
+namespace KTextEditor
+{
+ class EditInterface;
+}
+
+AST* findNodeAt( AST* unit, int line, int column );
+void scopeOfNode( AST* ast, QStringList& );
+QString typeSpecToString( TypeSpecifierAST* typeSpec );
+QString declaratorToString( DeclaratorAST* declarator, const QString& scope = QString::null, bool skipPtrOp = false );
+
+#endif // __ast_utils_h
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/backgroundparser.cpp b/languages/cpp/backgroundparser.cpp
new file mode 100644
index 00000000..ed51d0c6
--- /dev/null
+++ b/languages/cpp/backgroundparser.cpp
@@ -0,0 +1,552 @@
+/***************************************************************************
+* Copyright (C) 2002 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "backgroundparser.h"
+#include "cppsupportpart.h"
+#include "cppsupport_events.h"
+#include "codeinformationrepository.h"
+#include "cppcodecompletion.h"
+#include "ast_utils.h"
+#include "kdevdeepcopy.h"
+#include "kdevdriver.h"
+
+#include <qmutex.h>
+
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+
+#include <kurl.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <list>
+#include <qdatastream.h>
+
+
+class BackgroundKDevDriver : public KDevDriver {
+public:
+ BackgroundKDevDriver( CppSupportPart* cppSupport, BackgroundParser* bp ) : KDevDriver( cppSupport, false ), m_backgroundParser(bp) {
+ }
+ virtual void fileParsed( ParsedFile& fileName );
+ virtual void addDependence( const QString& fileName, const Dependence& dep );
+private:
+ BackgroundParser* m_backgroundParser;
+};
+
+
+class KDevSourceProvider: public SourceProvider
+{
+public:
+ //Deadlock is a mutex that is locked when KDevSourceProvider::contents(..) is used, and that should be unlocked before QApplication is locked(that way a deadlock where the thread that holds the QApplication-mutex and tries to lock the given mutex, while the thread that calls contents(..) and holds the given mutex and tries to lock the QApplication-mutex, cannot happen)
+ KDevSourceProvider( CppSupportPart* cppSupport, QMutex& deadlock )
+ : m_cppSupport( cppSupport ),
+ m_readFromDisk( false ),
+ m_deadlock(deadlock)
+ {}
+
+ void setReadFromDisk( bool b )
+ {
+ m_readFromDisk = b;
+ }
+ bool readFromDisk() const
+ {
+ return m_readFromDisk;
+ }
+
+ virtual QString contents( const QString& fileName )
+ {
+ QString contents = QString::null;
+
+ if ( !m_readFromDisk )
+ {
+ m_deadlock.unlock();
+ // GET LOCK
+ kapp->lock ();
+
+ //kdDebug(9007) << "-------> kapp locked" << endl;
+
+ QPtrList<KParts::Part> parts( *m_cppSupport->partController() ->parts() );
+ QPtrListIterator<KParts::Part> it( parts );
+ while ( it.current() )
+ {
+ KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( it.current() );
+ ++it;
+
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if ( !doc || !editIface || doc->url().path() != fileName )
+ continue;
+
+ contents = QString( editIface->text().ascii() ); // deep copy
+
+ //kdDebug(9007) << "-------> kapp unlocked" << endl;
+
+ break;
+ }
+
+ // RELEASE LOCK
+ kapp->unlock();
+ m_deadlock.lock();
+ //kdDebug(9007) << "-------> kapp unlocked" << endl;
+ }
+
+ if( m_readFromDisk || contents == QString::null )
+ {
+ QFile f( fileName );
+ if ( f.open( IO_ReadOnly ) )
+ {
+ QTextStream stream( &f );
+ contents = stream.read();
+ f.close();
+ }
+ }
+
+ return contents;
+ }
+
+ virtual bool isModified( const QString& fileName )
+ {
+ bool ret = false;
+ m_deadlock.unlock();
+ kapp->lock ();
+
+ KParts::ReadOnlyPart *part = m_cppSupport->partController()->partForURL( KURL(fileName) );
+ KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( part );
+
+ if ( doc )
+ ret = doc->isModified();
+
+ kapp->unlock();
+ m_deadlock.lock();
+ return ret;
+ }
+
+private:
+ CppSupportPart* m_cppSupport;
+ bool m_readFromDisk;
+ QMutex& m_deadlock;
+private:
+ KDevSourceProvider( const KDevSourceProvider& source );
+ void operator = ( const KDevSourceProvider& source );
+};
+
+typedef std::string SafeString;
+
+class SynchronizedFileList
+{
+ typedef std::list< QPair<SafeString, bool> > ListType;
+public:
+ SynchronizedFileList()
+ {}
+
+ bool isEmpty() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.empty();
+ }
+
+ uint count() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.size();
+ }
+
+ QPair<SafeString, bool> front() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.front();
+ }
+
+ void clear()
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileList.clear();
+ }
+
+ void push_front( const QString& fileName, bool readFromDisk = false )
+ {
+ SafeString s( fileName.ascii() );
+ QMutexLocker locker( &m_mutex );
+ m_fileList.push_front( qMakePair( s, readFromDisk ) );
+ }
+
+ void push_back( const QString& fileName, bool readFromDisk = false )
+ {
+ SafeString s( fileName.ascii() );
+ QMutexLocker locker( &m_mutex );
+ m_fileList.push_back( qMakePair( s, readFromDisk ) );
+ }
+
+ void pop_front()
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileList.pop_front();
+ }
+
+ int count( const QString& fileName ) const {
+ int c = 0;
+
+ QMutexLocker locker( &m_mutex );
+ ListType::const_iterator it = m_fileList.begin();
+ while ( it != m_fileList.end() )
+ {
+ if ( ( *it ).first.compare( fileName.ascii() ) == 0 )
+ ++c;
+ ++it;
+ }
+ return c;
+ }
+
+ QPair<SafeString, bool> takeFront()
+ {
+ QMutexLocker locker( &m_mutex );
+ QPair<SafeString, bool> ret = m_fileList.front();
+ m_fileList.pop_front();
+ return ret;
+ }
+
+ bool contains( const QString& fileName ) const
+ {
+ QMutexLocker locker( &m_mutex );
+ ListType::const_iterator it = m_fileList.begin();
+ while ( it != m_fileList.end() )
+ {
+ if ( ( *it ).first.compare( fileName.ascii() ) == 0 )
+ return true;
+ ++it;
+ }
+ return false;
+ }
+
+ void remove( const QString& fileName )
+ {
+ QMutexLocker locker( &m_mutex );
+ ListType::iterator it = m_fileList.begin();
+ while ( it != m_fileList.end() )
+ {
+ if ( ( *it ).first.compare(fileName.ascii() ) == 0 )
+ m_fileList.erase( it++ );
+ else
+ ++it;
+ }
+ }
+
+private:
+ mutable QMutex m_mutex;
+ ListType m_fileList;
+};
+
+BackgroundParser::BackgroundParser( CppSupportPart* part, QWaitCondition* consumed )
+: m_consumed( consumed ), m_cppSupport( part ), m_close( false ), m_saveMemory( false )
+{
+ m_fileList = new SynchronizedFileList();
+ m_driver = new BackgroundKDevDriver( m_cppSupport, this );
+ m_driver->setSourceProvider( new KDevSourceProvider( m_cppSupport, m_mutex ) );
+
+ QString conf_file_name = m_cppSupport->specialHeaderName();
+ m_mutex.lock();
+ if ( QFile::exists( conf_file_name ) )
+ m_driver->parseFile( conf_file_name, true, true, true );
+ m_mutex.unlock();
+
+ //disabled for now m_driver->setResolveDependencesEnabled( true );
+}
+
+BackgroundParser::~BackgroundParser()
+{
+ removeAllFiles();
+
+ delete( m_driver );
+ m_driver = 0;
+
+ delete m_fileList;
+ m_fileList = 0;
+}
+
+void BackgroundParser::addFile( const QString& fileName, bool readFromDisk )
+{
+ QString fn = deepCopy( fileName );
+
+ //bool added = false;
+ /*if ( !m_fileList->contains( fn ) )
+ {
+ m_fileList->push_back( fn, readFromDisk );
+ added = true;
+ }*/
+ m_fileList->push_back( fn, readFromDisk );
+
+ //if ( added )
+ m_canParse.wakeAll();
+}
+
+void BackgroundParser::addFileFront( const QString& fileName, bool readFromDisk )
+{
+ QString fn = deepCopy( fileName );
+
+ bool added = false;
+ /*if ( m_fileList->contains( fn ) )
+ m_fileList->remove( fn );*/
+
+ m_fileList->push_front( fn, readFromDisk );
+ added = true;
+
+ if ( added )
+ m_canParse.wakeAll();
+}
+
+void BackgroundParser::removeAllFiles()
+{
+ kdDebug( 9007 ) << "BackgroundParser::removeAllFiles()" << endl;
+ QMutexLocker locker( &m_mutex );
+
+ QMap<QString, Unit*>::Iterator it = m_unitDict.begin();
+ while ( it != m_unitDict.end() )
+ {
+ Unit * unit = it.data();
+ ++it;
+ delete( unit );
+ unit = 0;
+ }
+ m_unitDict.clear();
+ m_driver->reset();
+ m_fileList->clear();
+
+ m_isEmpty.wakeAll();
+}
+
+void BackgroundParser::removeFile( const QString& fileName )
+{
+ QMutexLocker locker( &m_mutex );
+
+ Unit* unit = findUnit( fileName );
+ if ( unit )
+ {
+ m_driver->remove
+ ( fileName );
+ m_unitDict.remove( fileName );
+ delete( unit );
+ unit = 0;
+ }
+
+ if ( m_fileList->isEmpty() )
+ m_isEmpty.wakeAll();
+}
+
+void BackgroundKDevDriver::addDependence( const QString& fileName, const Dependence& dep ) {
+ //give waiting threads a chance to perform their actions
+ m_backgroundParser->m_mutex.unlock();
+ m_backgroundParser->m_mutex.lock();
+ KDevDriver::addDependence( fileName, dep );
+}
+
+void BackgroundKDevDriver::fileParsed( ParsedFile& fileName ) {
+ m_backgroundParser->fileParsed( fileName );
+}
+
+void BackgroundParser::parseFile( const QString& fileName, bool readFromDisk, bool lock )
+{
+ if( lock )
+ m_mutex.lock();
+ m_readFromDisk = readFromDisk;
+ static_cast<KDevSourceProvider*>( m_driver->sourceProvider() ) ->setReadFromDisk( readFromDisk );
+
+ m_driver->remove( fileName );
+ m_driver->parseFile( fileName , false, true );
+ if( !m_driver->isResolveDependencesEnabled() )
+ m_driver->removeAllMacrosInFile( fileName ); // romove all macros defined by this
+ // translation unit.
+ if ( lock )
+ m_mutex.unlock();
+}
+
+QValueList<Problem> cloneProblemList( const QValueList<Problem>& list ) {
+ QValueList<Problem> ret;
+ for( QValueList<Problem>::const_iterator it = list.begin(); it != list.end(); ++it ) {
+ ret << Problem( *it, true );
+ }
+ return ret;
+}
+
+void BackgroundParser::fileParsed( ParsedFile& file ) {
+
+ ParsedFilePointer translationUnitUnsafe = m_driver->takeTranslationUnit( file.fileName() );
+ //now file and translationUnitUnsafe are the same
+ ParsedFilePointer translationUnit;
+ //Since the lexer-cache keeps many QStrings like macro-names used in the background, everything must be copied here. The safest solution is just
+ //serializing and deserializing the whole thing(the serialization does not respect the AST, but that can be copied later because that's safe)
+ QMemArray<char> data;
+ {
+ QDataStream stream( data, IO_WriteOnly );
+ translationUnitUnsafe->write( stream );
+ }
+ {
+ QDataStream stream( data, IO_ReadOnly );
+ translationUnit = new ParsedFile( stream );
+ }
+
+ translationUnit->setTranslationUnit( translationUnitUnsafe->operator TranslationUnitAST *() ); //Copy the AST, doing that is thread-safe
+ translationUnitUnsafe->setTranslationUnit( 0 ); //Move the AST completely out of this thread's scope. Else it might crash on dual-core machines
+ file.setTranslationUnit(0); //just to be sure, set to zero on both
+
+ Unit* unit = new Unit;
+ unit->fileName = file.fileName();
+ unit->translationUnit = translationUnit;
+ unit->problems = cloneProblemList( m_driver->problems( file.fileName() ) );
+
+ static_cast<KDevSourceProvider*>( m_driver->sourceProvider() ) ->setReadFromDisk( false );
+
+ if ( m_unitDict.find( file.fileName() ) != m_unitDict.end() )
+ {
+ Unit * u = m_unitDict[ file.fileName() ];
+ m_unitDict.remove( file.fileName() );
+ delete( u );
+ u = 0;
+ }
+
+ m_unitDict.insert( file.fileName(), unit );
+
+ KApplication::postEvent( m_cppSupport, new FileParsedEvent( file.fileName(), unit->problems, m_readFromDisk ) );
+
+ m_currentFile = QString::null;
+
+ if ( m_fileList->isEmpty() )
+ m_isEmpty.wakeAll();
+}
+
+Unit* BackgroundParser::findUnit( const QString& fileName )
+{
+ QMap<QString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ return it != m_unitDict.end() ? *it : 0;
+}
+
+bool BackgroundParser::hasTranslationUnit( const QString& fileName ) {
+ QMap<QString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ return it != m_unitDict.end();
+}
+
+ParsedFilePointer BackgroundParser::translationUnit( const QString& fileName )
+{
+ Unit * u = findUnit( fileName );
+ if ( u == 0 )
+ {
+ return 0;
+ /*m_fileList->remove
+ ( fileName );
+ u = parseFile( fileName, false );*/
+ }
+
+ return u->translationUnit;
+}
+
+QValueList<Problem> BackgroundParser::problems( const QString& fileName, bool readFromDisk, bool forceParse )
+{
+ Q_UNUSED(readFromDisk);
+ Unit * u = findUnit( fileName );
+ if ( u == 0 || forceParse )
+ {
+ /*
+ m_fileList->remove
+ ( fileName );
+ u = parseFile( fileName, readFromDisk ); */
+ }
+
+ return u ? u->problems : QValueList<Problem>();
+}
+
+void BackgroundParser::close()
+{
+ {
+ QMutexLocker locker( &m_mutex );
+ m_close = true;
+ m_canParse.wakeAll();
+ }
+ kapp->unlock();
+
+ while ( running() )
+ sleep( 1 );
+ kapp->lock();
+}
+
+bool BackgroundParser::filesInQueue()
+{
+ QMutexLocker locker( &m_mutex );
+
+ return m_fileList->count() || !m_currentFile.isEmpty();
+}
+
+int BackgroundParser::countInQueue( const QString& file ) const {
+ return m_fileList->count( file );
+}
+
+void BackgroundParser::updateParserConfiguration()
+{
+ QMutexLocker locker( &m_mutex );
+
+ m_driver->setup();
+ QString conf_file_name = m_cppSupport->specialHeaderName();
+ m_driver->removeAllMacrosInFile( conf_file_name );
+ m_driver->parseFile( conf_file_name, true, true, true );
+}
+
+void BackgroundParser::run()
+{
+ // (void) m_cppSupport->codeCompletion()->repository()->getEntriesInScope( QStringList(), false );
+
+ while ( !m_close )
+ {
+
+ while ( m_fileList->isEmpty() )
+ {
+ if( m_saveMemory ) {
+ m_saveMemory = false;
+ m_driver->lexerCache()->saveMemory();
+ }
+
+ m_canParse.wait();
+
+ if ( m_close )
+ break;
+ }
+
+ if ( m_close )
+ break;
+
+ QPair<SafeString, bool> entry = m_fileList->takeFront();
+ QString fileName = entry.first.c_str();
+ bool readFromDisk = entry.second;
+ m_currentFile = deepCopy(fileName);
+
+ ( void ) parseFile( fileName, readFromDisk, true );
+
+
+ m_currentFile = QString::null;
+ }
+
+ kdDebug( 9007 ) << "!!!!!!!!!!!!!!!!!! BG PARSER DESTROYED !!!!!!!!!!!!" << endl;
+
+// adymo: commented to fix #88091
+// QThread::exit();
+}
+
+void BackgroundParser::saveMemory() {
+ m_saveMemory = true; //Delay the operation
+ m_canParse.wakeAll();
+}
+
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/backgroundparser.h b/languages/cpp/backgroundparser.h
new file mode 100644
index 00000000..2bbf1173
--- /dev/null
+++ b/languages/cpp/backgroundparser.h
@@ -0,0 +1,122 @@
+/***************************************************************************
+* Copyright (C) 2002 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef BACKGROUNDPARSER_H
+#define BACKGROUNDPARSER_H
+
+#include "ast.h"
+#include "driver.h"
+
+#include <qthread.h>
+#include <qwaitcondition.h>
+#include <qmutex.h>
+#include <qmap.h>
+#include <kdebug.h>
+
+class CppSupportPart;
+class TranslationUnitAST;
+class SynchronizedFileList;
+class BackgroundKDevDriver;
+class Unit
+{
+public:
+ Unit() : translationUnit( 0 )
+ {}
+ ~Unit()
+ {
+ translationUnit = 0;
+ }
+
+ QString fileName;
+ QValueList<Problem> problems;
+ ParsedFilePointer translationUnit;
+
+protected:
+ Unit( const Unit& source );
+ void operator = ( const Unit& source );
+};
+
+class BackgroundParser: public QThread
+{
+public:
+ BackgroundParser( CppSupportPart*, QWaitCondition* consumed );
+ virtual ~BackgroundParser();
+
+ QMutex& mutex()
+ {
+ return m_mutex;
+ }
+ void lock ()
+ {
+ m_mutex.lock();
+ }
+ void unlock()
+ {
+ m_mutex.unlock();
+ }
+
+ QWaitCondition& canParse()
+ {
+ return m_canParse;
+ }
+ QWaitCondition& isEmpty()
+ {
+ return m_isEmpty;
+ }
+
+ bool filesInQueue();
+
+ int countInQueue( const QString& file ) const;
+
+ void addFile( const QString& fileName, bool readFromDisk = false );
+ void addFileFront( const QString& fileName, bool readFromDisk = false );
+ void removeFile( const QString& fileName );
+ void removeAllFiles();
+
+ bool hasTranslationUnit( const QString& fileName );
+ ParsedFilePointer translationUnit( const QString& fileName );
+ QValueList<Problem> problems( const QString& fileName , bool readFromDisk = false, bool forceParse = false );
+ void updateParserConfiguration();
+
+ ///Should be run on a regular basis(every X minutes). It reduces some caches etc. BackgroundParser must be locked before.
+ void saveMemory();
+
+ void close();
+
+ virtual void run();
+
+protected:
+ friend class BackgroundKDevDriver;
+ void fileParsed( ParsedFile& fileName );
+ Unit* findUnit( const QString& fileName );
+ void parseFile( const QString& fileName, bool readFromDisk, bool lock = false )
+ ;
+
+private:
+ class KDevDriver* m_driver;
+ QString m_currentFile;
+ QWaitCondition m_canParse;
+ QWaitCondition m_isEmpty;
+ QWaitCondition* m_consumed;
+ QMutex m_mutex;
+ SynchronizedFileList* m_fileList;
+ CppSupportPart* m_cppSupport;
+ bool m_close;
+ QMap<QString, Unit*> m_unitDict;
+ bool m_saveMemory; //used to prevent blocking
+
+ //State of parseFile(..):
+ bool m_readFromDisk;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/bithelpers.h b/languages/cpp/bithelpers.h
new file mode 100644
index 00000000..3cb74420
--- /dev/null
+++ b/languages/cpp/bithelpers.h
@@ -0,0 +1,37 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __BITHELPERS_H__
+#define __BITHELPERS_H__
+
+namespace BitHelpers {
+template <class Type>
+inline Type addFlag( Type loc, Type add ) {
+ return (Type)( loc | add );
+}
+
+template <class Type>
+inline Type remFlag( Type loc, Type rem ) {
+ return (Type)( loc & (rem ^ 0xffffffff) );
+}
+
+template <class Type>
+inline Type bitInvert( Type val ) {
+ return (Type)(0xffffffff - (unsigned int)val);
+}
+}
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/ccconfigwidget.cpp b/languages/cpp/ccconfigwidget.cpp
new file mode 100644
index 00000000..09b13938
--- /dev/null
+++ b/languages/cpp/ccconfigwidget.cpp
@@ -0,0 +1,590 @@
+/***************************************************************************
+* Copyright (C) 2001 by Daniel Engelschalt *
+* daniel.engelschalt@gmx.net *
+* Copyright (C) 2004 Jonas Jacobi<j.jacobi@gmx.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. *
+* *
+***************************************************************************/
+// qt includes
+#include <qtabwidget.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include <qspinbox.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qmultilineedit.h>
+#include <qslider.h>
+#include <qheader.h>
+#include <qcolor.h>
+#include <qlabel.h>
+#include <qlayout.h>
+
+// kde includes
+#include <kdevproject.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kfileitem.h>
+#include <kurlrequester.h>
+#include <keditlistbox.h>
+#include <klistview.h>
+#include <knuminput.h>
+#include <kmainwindow.h>
+#include <klineedit.h>
+#include <kdeversion.h>
+// kdevelop includes
+#include <domutil.h>
+#include <kdevcoderepository.h>
+#include <kdevmainwindow.h>
+#include <kdevcoderepository.h>
+#include <catalog.h>
+// std includes
+#include <stdlib.h>
+
+#include "cppsupportfactory.h"
+#include "ccconfigwidget.h"
+#include "qtbuildconfig.h"
+#include "cppsupportpart.h"
+#include "cppcodecompletionconfig.h"
+#include "cppsplitheadersourceconfig.h"
+#include "createpcsdialog.h"
+#include "creategettersetterconfiguration.h"
+
+using namespace std;
+
+
+CCConfigWidget::CCConfigWidget( CppSupportPart* part, QWidget* parent, const char* name )
+ : CCConfigWidgetBase( parent, name )
+{
+ m_pPart = part;
+ connect( m_pPart->codeRepository(), SIGNAL( catalogRegistered( Catalog* ) ),
+ this, SLOT( catalogRegistered( Catalog* ) ) );
+ connect( m_pPart->codeRepository(), SIGNAL( catalogUnregistered( Catalog* ) ),
+ this, SLOT( catalogUnregistered( Catalog* ) ) );
+
+ connect( m_qtDir, SIGNAL(urlSelected(const QString &)),
+ this, SLOT(isValidQtDir(const QString &)));
+ connect( m_qtDir, SIGNAL(textChanged(const QString &)),
+ this, SLOT(isValidQtDir(const QString &)));
+
+ initGeneralTab( );
+ initQtTab();
+ initCodeCompletionTab( );
+ initGetterSetterTab( );
+ initSplitTab();
+ inputCodeCompletion->setRange( 0, 2000, 100, false );
+ inputArgumentsHint->setRange( 0, 2000, 100, false );
+}
+
+void CCConfigWidget::initGeneralTab( )
+{
+ QDomDocument dom = *m_pPart->projectDom();
+ interface_suffix->setText( DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", ".h" ) );
+ implementation_suffix->setText( DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", ".cpp" ) );
+
+ KConfig *config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "General" );
+ m_switchShouldMatch->setChecked( config->readBoolEntry( "SwitchShouldMatch", true ) );
+ m_showContextMenuExplosion->setChecked( config->readBoolEntry( "ShowContextMenuExplosion", false ) );
+ }
+}
+
+CCConfigWidget::~CCConfigWidget( )
+{}
+
+void CCConfigWidget::accept( )
+{
+ saveFileTemplatesTab();
+ saveQtTab();
+ saveCodeCompletionTab();
+ saveGetterSetterTab();
+ saveSplitTab();
+}
+
+void CCConfigWidget::saveFileTemplatesTab( )
+{
+ QDomDocument dom = *m_pPart->projectDom();
+ DomUtil::writeEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", interface_suffix->text() );
+ DomUtil::writeEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", implementation_suffix->text() );
+
+ KConfig *config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "General" );
+ config->writeEntry( "SwitchShouldMatch", m_switchShouldMatch->isChecked() );
+ config->writeEntry( "ShowContextMenuExplosion", m_showContextMenuExplosion->isChecked() );
+ }
+}
+
+void CCConfigWidget::initCodeCompletionTab( )
+{
+ advancedOptions->header() ->hide();
+
+ CppCodeCompletionConfig* c = m_pPart->codeCompletionConfig();
+
+ inputCodeCompletion->setValue( c->codeCompletionDelay() );
+ inputArgumentsHint->setValue( c->argumentsHintDelay() );
+ checkAutomaticCodeCompletion->setChecked( c->automaticCodeCompletion() );
+ checkAutomaticArgumentsHint->setChecked( c->automaticArgumentsHint() );
+
+ checkCompleteArgumentType->setChecked( c->processFunctionArguments() );
+ checkCompleteReturnType->setChecked( c->processPrimaryTypes() );
+ //checkShowOnlyAccessible->setChecked( c->showOnlyAccessibleItems() );
+
+ editNamespaceAlias->setText( c->namespaceAliases() );
+ checkBox18->setChecked( c->showEvaluationContextMenu() );
+ checkShowTypeEvaluationInStatusBar->setChecked( c->statusBarTypeEvaluation() );
+ checkShowCommentInArgumentHint->setChecked( c->showCommentWithArgumentHint() );
+ /*
+ switch( c->completionBoxItemOrder() ) {
+ case CppCodeCompletionConfig::ByAccessLevel:
+ radioGroupByAccess->setChecked( true );
+ break;
+ case CppCodeCompletionConfig::ByClass:
+ radioGroupByClass->setChecked( true );
+ break;
+ case CppCodeCompletionConfig::ByAlphabet:
+ radioGroupByAlphabet->setChecked( true );
+ break;
+ }*/
+
+ QValueList<Catalog*> catalogs = m_pPart->codeRepository() ->registeredCatalogs();
+ for ( QValueList<Catalog*>::Iterator it = catalogs.begin(); it != catalogs.end(); ++it )
+ {
+ Catalog* c = *it;
+ QFileInfo dbInfo( c->dbName() );
+ QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName(true) ), QCheckListItem::CheckBox );
+ item->setOn( c->enabled() );
+
+ m_catalogs[ item ] = c;
+ }
+
+ checkPreprocessIncludedHeaders->setChecked( c->preProcessAllHeaders() && !c->parseMissingHeaders() );
+ checkParseMissingHeaders->setChecked( c->parseMissingHeaders() );
+ checkListGlobalItems->setChecked( c->alwaysIncludeNamespaces() );
+ checkResolveIncludePaths->setChecked( c->resolveIncludePaths() );
+ editIncludePaths->setText( c->customIncludePaths() );
+}
+
+void CCConfigWidget::saveCodeCompletionTab( )
+{
+ CppCodeCompletionConfig * c = m_pPart->codeCompletionConfig();
+
+ c->setCodeCompletionDelay( inputCodeCompletion->value() );
+ c->setArgumentsHintDelay( inputArgumentsHint->value() );
+
+ c->setAutomaticCodeCompletion( checkAutomaticCodeCompletion->isChecked() );
+ c->setAutomaticArgumentsHint( checkAutomaticArgumentsHint->isChecked() );
+
+ c->setProcessFunctionArguments( checkCompleteArgumentType->isChecked() );
+ c->setProcessPrimaryTypes( checkCompleteReturnType->isChecked() );
+ //c->setShowOnlyAccessibleItems( checkShowOnlyAccessible->isChecked() );
+
+ c->setNamespaceAliases( editNamespaceAlias->text() );
+ c->setShowEvaluationContextMenu( checkBox18->isChecked() );
+ c->setStatusBarTypeEvaluation( checkShowTypeEvaluationInStatusBar->isChecked() );
+ c->setShowCommentWithArgumentHint( checkShowCommentInArgumentHint->isChecked() );
+
+ /*if( radioGroupByAccess->isChecked() )
+ c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByAccessLevel );
+
+ if( radioGroupByClass->isChecked() )
+ c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByClass );
+
+ if( radioGroupByAlphabet->isChecked() )
+ c->setCompletionBoxItemOrder( CppCodeCompletionConfig::ByAlphabet );*/
+
+ for ( QMap<QCheckListItem*, Catalog*>::Iterator it = m_catalogs.begin(); it != m_catalogs.end(); ++it )
+ {
+ it.data() ->setEnabled( it.key() ->isOn() );
+ }
+
+ c->setPreProcessAllHeaders( checkPreprocessIncludedHeaders->isChecked() || checkParseMissingHeaders->isChecked() );
+ c->setParseMissingHeaders( checkParseMissingHeaders->isChecked() );
+ c->setAlwaysIncludeNamespaces( checkListGlobalItems->isChecked() );
+ c->setResolveIncludePaths( checkResolveIncludePaths->isChecked() );
+ c->setCustomIncludePaths( editIncludePaths->text() );
+
+ c->store();
+}
+
+void CCConfigWidget::slotNewPCS( )
+{
+ CreatePCSDialog dlg( m_pPart, m_pPart->mainWindow() ->main() );
+ dlg.importerListView->setFocus();
+ dlg.exec();
+}
+
+void CCConfigWidget::slotRemovePCS()
+{
+ if ( !advancedOptions->selectedItem() )
+ return ;
+
+ QString db = advancedOptions->selectedItem() ->text( 0 );
+ QString question = i18n( "Are you sure you want to delete the \"%1\" database?" ).arg( db );
+
+ KStandardDirs *dirs = m_pPart->instance() ->dirs();
+ QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + KURL::encode_string_no_slash( db ) + ".db";
+
+ if ( KMessageBox::Continue == KMessageBox::warningContinueCancel( 0, question, i18n( "Delete Database" ), KStdGuiItem::del() ) )
+ {
+ m_pPart->removeCatalog( dbName );
+ }
+}
+
+void CCConfigWidget::catalogRegistered( Catalog * c )
+{
+ QFileInfo dbInfo( c->dbName() );
+ QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName(true) ), QCheckListItem::CheckBox );
+ item->setOn( c->enabled() );
+
+ m_catalogs[ item ] = c;
+}
+
+void CCConfigWidget::catalogUnregistered( Catalog * c )
+{
+ for ( QMap<QCheckListItem*, Catalog*>::Iterator it = m_catalogs.begin(); it != m_catalogs.end(); ++it )
+ {
+ if ( it.data() == c )
+ {
+ QCheckListItem * item = it.key();
+ delete( item );
+ m_catalogs.remove( it );
+ break;
+ }
+ }
+}
+
+void CCConfigWidget::initGetterSetterTab( )
+{
+ CreateGetterSetterConfiguration * config = m_pPart->createGetterSetterConfiguration();
+
+ if ( config == 0 )
+ return ;
+
+ m_edtGet->setText( config->prefixGet() );
+ m_edtSet->setText( config->prefixSet() );
+ m_edtRemovePrefix->setText( config->prefixVariable().join( "," ) );
+ m_edtParameterName->setText( config->parameterName() );
+
+ slotGetterSetterValuesChanged();
+}
+
+void CCConfigWidget::slotGetterSetterValuesChanged( )
+{
+ bool hasError = false;
+ if ( m_edtParameterName->text().isEmpty() )
+ {
+ m_lblParameterName->setPaletteForegroundColor( QColor( "red" ) );
+ m_edtExampleGet->setText( "error, missing parametername" );
+ m_edtExampleSet->setText( "error, missing parametername" );
+ hasError = true;
+ }
+
+ QString name = m_edtVariableName->text();
+ if ( name.isEmpty() )
+ {
+ m_lblVariableName->setPaletteForegroundColor( QColor( "red" ) );
+ m_edtExampleGet->setText( "error, missing variablename" );
+ m_edtExampleSet->setText( "error, missing variablename" );
+ hasError = true;
+ }
+
+ if ( hasError )
+ {
+ m_edtExampleGet->setPaletteForegroundColor( QColor( "red" ) );
+ m_edtExampleSet->setPaletteForegroundColor( QColor( "red" ) );
+
+ return ;
+ }
+ else
+ {
+ m_lblVariableName->setPaletteForegroundColor( QColor( "black" ) );
+ m_lblParameterName->setPaletteForegroundColor( QColor( "black" ) );
+ m_edtExampleGet->setPaletteForegroundColor( QColor( "black" ) );
+ m_edtExampleSet->setPaletteForegroundColor( QColor( "black" ) );
+ }
+
+ QStringList prefixes = QStringList::split( ",", m_edtRemovePrefix->text().replace( " ", "" ) );
+ unsigned int len = 0;
+ QStringList::ConstIterator theend = prefixes.end();
+ for ( QStringList::ConstIterator ci = prefixes.begin(); ci != theend; ++ci )
+ {
+ if ( name.startsWith( *ci ) && ( *ci ).length() > len )
+ len = ( *ci ).length();
+ }
+
+ if ( len > 0 )
+ name.remove( 0, len );
+
+ QString getName = name;
+ if ( !m_edtGet->text().isEmpty() )
+ {
+ getName[ 0 ] = getName[ 0 ].upper();
+ getName.prepend( m_edtGet->text() );
+ }
+
+ QString setName = name;
+ if ( !m_edtSet->text().isEmpty() )
+ {
+ setName[ 0 ] = setName[ 0 ].upper();
+ setName.prepend( m_edtSet->text() );
+ }
+
+ m_edtExampleGet->setText( "string " + getName + "() const;" );
+ m_edtExampleSet->setText( "void " + setName + "(const string& " + m_edtParameterName->text() + ");" );
+}
+
+void CCConfigWidget::saveGetterSetterTab( )
+{
+ if ( m_edtParameterName->text().isEmpty() || m_edtGet->text() == m_edtSet->text() )
+ return ;
+
+ CreateGetterSetterConfiguration* config = m_pPart->createGetterSetterConfiguration();
+ if ( config == 0 )
+ return ;
+
+ config->setPrefixGet( m_edtGet->text() );
+ config->setPrefixSet( m_edtSet->text() );
+ config->setPrefixVariable( QStringList::split( ",", m_edtRemovePrefix->text().replace( " ", "" ) ) );
+ config->setParameterName( m_edtParameterName->text() );
+ config->store();
+}
+
+void CCConfigWidget::initSplitTab( )
+{
+ CppSplitHeaderSourceConfig * config = m_pPart->splitHeaderSourceConfig();
+
+ if ( config == 0 )
+ return ;
+
+ m_splitEnable->setChecked( config->splitEnabled() );
+ m_splitSync->setChecked( config->autoSync() );
+
+ QString o = config->orientation();
+ m_splitVertical->setChecked( o == "Vertical" );
+ m_splitHorizontal->setChecked( o == "Horizontal" );
+}
+
+void CCConfigWidget::saveSplitTab( )
+{
+ CppSplitHeaderSourceConfig * config = m_pPart->splitHeaderSourceConfig();
+
+ if ( config == 0 )
+ return ;
+
+ config->setSplitEnable( m_splitEnable->isChecked() );
+ config->setAutoSync( m_splitSync->isChecked() );
+
+ if ( m_splitVertical->isChecked() )
+ config->setOrientation( "Vertical" );
+ else if ( m_splitHorizontal->isChecked() )
+ config->setOrientation( "Horizontal" );
+
+ config->store();
+}
+
+void CCConfigWidget::initQtTab()
+{
+ m_qtDir->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
+
+ QtBuildConfig* c = m_pPart->qtBuildConfig();
+ c->init();
+
+ m_qtUsed->setChecked( c->isUsed() );
+ if( c->version() == 4 )
+ {
+ m_versionQt4->setChecked( true );
+ m_kdevembedded->setEnabled( false );
+ m_kdevexternal->setEnabled( false );
+ m_qtStyleVersion4->setEnabled( true );
+ m_designerPath->setEnabled( true );
+ m_qmakePath->setEnabled( true );
+ m_qtDir->setEnabled( false );
+ m_txtQtDir->setEnabled( false );
+ m_txtDesigner->setEnabled( true );
+ pluginPaths->setEnabled( true );
+ }
+ else
+ {
+ m_versionQt3->setChecked( true );
+ m_kdevembedded->setEnabled( true );
+ m_kdevexternal->setEnabled( true );
+ m_qtStyleVersion4->setEnabled( false );
+ m_designerPath->setEnabled( true );
+ m_qmakePath->setEnabled( true );
+ m_qtDir->setEnabled( true );
+ m_txtQtDir->setEnabled( true );
+ m_txtDesigner->setEnabled( true );
+ pluginPaths->setEnabled( false );
+ }
+ if( c->includeStyle() == 4 )
+ {
+ m_qtStyleVersion4->setChecked( true );
+ }else
+ {
+ m_qtStyleVersion3->setChecked( true );
+ }
+ m_qtDir->setURL( c->root() );
+ isValidQtDir(m_qtDir->url());
+ m_qmakePath->setURL( c->qmakePath() );
+ isExecutable( m_qmakePath->url() );
+ m_designerPath->setURL( c->designerPath() );
+ isExecutable( m_designerPath->url() );
+ if ( c->designerIntegration() == "EmbeddedKDevDesigner" )
+ {
+ m_kdevembedded->setChecked( true );
+ }
+ else if ( c->designerIntegration() == "ExternalKDevDesigner" )
+ {
+ m_kdevexternal->setChecked( true );
+ }else
+ {
+ m_qtdesigner->setChecked( true );
+ }
+}
+
+bool CCConfigWidget::isExecutable( const QString& path )
+{
+ QFileInfo fi(path);
+
+ return ( fi.exists() && fi.isExecutable() );
+}
+
+void CCConfigWidget::isQMakeExecutable( const QString& path )
+{
+ if( !isExecutable( path ) )
+ {
+ m_qmakePath->lineEdit()->setPaletteForegroundColor(QColor("#ff0000"));
+ }else
+ {
+ m_qmakePath->lineEdit()->unsetPalette();
+ }
+}
+
+void CCConfigWidget::isDesignerExecutable( const QString& path )
+{
+ if( !isExecutable( path ) )
+ {
+ m_designerPath->lineEdit()->setPaletteForegroundColor(QColor("#ff0000"));
+ }else
+ {
+ m_designerPath->lineEdit()->unsetPalette();
+ }
+}
+
+void CCConfigWidget::saveQtTab()
+{
+ QtBuildConfig* c = m_pPart->qtBuildConfig();
+
+ c->setUsed( m_qtUsed->isChecked() );
+ if( m_versionQt4->isChecked() )
+ {
+ c->setVersion( 4 );
+ }
+ else
+ {
+ c->setVersion( 3 );
+ }
+ if( m_qtStyleVersion4->isChecked() )
+ {
+ c->setIncludeStyle( 4 );
+ }else
+ {
+ c->setIncludeStyle( 3 );
+ }
+ c->setRoot( m_qtDir->url() );
+ c->setQMakePath( m_qmakePath->url() );
+ c->setDesignerPath( m_designerPath->url() );
+ if( m_kdevembedded->isChecked() )
+ {
+ c->setDesignerIntegration( "EmbeddedKDevDesigner" );
+ }
+ else if ( m_kdevexternal->isChecked() )
+ {
+ c->setDesignerIntegration( "ExternalKDevDesigner" );
+ }else
+ {
+ c->setDesignerIntegration( "ExternalDesigner" );
+ }
+ c->store();
+}
+
+void CCConfigWidget::isValidQtDir( const QString &dir )
+{
+ QFileInfo inc( dir + QString( QChar( QDir::separator() ) )+
+ "include"+QString( QChar( QDir::separator() ) )+
+ "qt.h" );
+ if ( !m_versionQt4->isChecked() && !inc.exists() )
+ {
+ m_qtDir->lineEdit()->setPaletteForegroundColor(QColor("#ff0000"));
+ }else
+ {
+ m_qtDir->lineEdit()->unsetPalette();
+ }
+}
+
+void CCConfigWidget::toggleQtVersion( bool )
+{
+ if ( m_versionQt3->isChecked() )
+ {
+ m_qtStyleVersion4->setEnabled( false );
+ m_qtStyleVersion3->setChecked( true );
+ m_kdevembedded->setEnabled( true );
+ m_kdevexternal->setEnabled( true );
+ pluginPaths->setEnabled( false );
+ }
+ if ( m_versionQt4->isChecked() )
+ {
+ m_qtStyleVersion4->setEnabled( true );
+ m_qtdesigner->setChecked( true );
+ m_kdevembedded->setEnabled( false );
+ m_kdevexternal->setEnabled( false );
+ pluginPaths->setEnabled( true );
+ }
+ isValidQtDir( m_qtDir->url() );
+ isQMakeExecutable( m_qmakePath->url() );
+ isDesignerExecutable( m_designerPath->url() );
+}
+
+void CCConfigWidget::openPluginPaths()
+{
+ kdDebug(9024) << "Plugin paths opened" << endl;
+ QtBuildConfig* c = m_pPart->qtBuildConfig();
+ KDialog d( this );
+ QVBoxLayout* mainlayout = new QVBoxLayout( &d );
+ KPushButton* ok = new KPushButton( KStdGuiItem::ok(), &d );
+ connect( ok, SIGNAL(clicked()), &d, SLOT(accept()));
+ KPushButton* cancel = new KPushButton( KStdGuiItem::cancel(), &d );
+ connect( cancel, SIGNAL(clicked()), &d, SLOT(reject()));
+ QHBoxLayout* btns = new QHBoxLayout( &d );
+ btns->addItem( new QSpacerItem(10,10,QSizePolicy::Expanding) );
+ btns->addWidget(ok);
+ btns->addWidget(cancel);
+
+ d.setCaption( i18n( "Edit Qt4 Designer Plugin Paths" ) );
+ KURLRequester * req = new KURLRequester( &d );
+ req->setMode( KFile::Directory );
+ KEditListBox* p = new KEditListBox( i18n( "Plugin Paths" ), req->customEditor(), &d );
+ p->insertStringList( c->designerPluginPaths() );
+ mainlayout->addWidget( p );
+ mainlayout->addLayout( btns );
+ d.resize( 450, 250 );
+ if( d.exec() == QDialog::Accepted)
+ {
+ c->setDesignerPluginPaths( p->items() );
+ }
+}
+
+#include "ccconfigwidget.moc"
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/ccconfigwidget.h b/languages/cpp/ccconfigwidget.h
new file mode 100644
index 00000000..b8874ed2
--- /dev/null
+++ b/languages/cpp/ccconfigwidget.h
@@ -0,0 +1,74 @@
+/***************************************************************************
+* Copyright (C) 2001 by Daniel Engelschalt *
+* daniel.engelschalt@gmx.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 _CCCONFIGWIDGET_H_
+#define _CCCONFIGWIDGET_H_
+
+#include "ccconfigwidgetbase.h"
+#include <qmap.h>
+
+class CppSupportPart;
+class Catalog;
+class QCheckListItem;
+class KEditListBox;
+
+class CCConfigWidget : public CCConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CCConfigWidget( CppSupportPart* part, QWidget* parent = 0, const char* name = 0 );
+ virtual ~CCConfigWidget( );
+
+public slots:
+ void accept( );
+ void slotNewPCS();
+
+protected slots:
+ void slotGetterSetterValuesChanged();
+ virtual void slotRemovePCS();
+
+private slots:
+ void catalogRegistered( Catalog* c );
+ void catalogUnregistered( Catalog* c );
+ void isValidQtDir( const QString & );
+ void isDesignerExecutable( const QString& );
+ void isQMakeExecutable( const QString& );
+ void toggleQtVersion( bool );
+ void openPluginPaths( );
+
+private:
+ bool isExecutable( const QString & );
+
+ void initGeneralTab();
+ void saveFileTemplatesTab();
+
+ void initQtTab();
+ void saveQtTab();
+
+ void initCodeCompletionTab();
+ void saveCodeCompletionTab();
+
+ void initGetterSetterTab();
+ void saveGetterSetterTab();
+
+ void initSplitTab();
+ void saveSplitTab();
+
+private:
+ CppSupportPart* m_pPart;
+ QMap<QCheckListItem*, Catalog*> m_catalogs;
+ KEditListBox* m_designerPluginPaths;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/ccconfigwidgetbase.ui b/languages/cpp/ccconfigwidgetbase.ui
new file mode 100644
index 00000000..b7efc7d0
--- /dev/null
+++ b/languages/cpp/ccconfigwidgetbase.ui
@@ -0,0 +1,1798 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CCConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CCConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>839</width>
+ <height>622</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>C++ Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>cpp_options</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>codeCompletionPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Code Completion</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Code Completion Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkAutomaticCodeCompletion</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>A&amp;utomatic code completion:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Offer options to complete what you are typing.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer14</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>inputCodeCompletion</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>How long after a key press to offer suggestions</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>msec</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkListGlobalItems</cstring>
+ </property>
+ <property name="text">
+ <string>List &amp;global items when
+performing automatic completion</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>When this is checked, members of all
+higher namespaces will be included in
+the completion-list while performing
+automatic completion.
+
+This may bloat the completion-list
+and create a significant delay.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When this is checked, members of all
+higher namespaces will be included in
+the completion-list while performing
+automatic completion.
+
+This may bloat the completion-list
+and create a significant delay.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkCompleteReturnType</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do complete member-type-evaluation</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Completely evaluate member-types of
+template-classes (this includes types
+of member-variables and return-types
+of member-functions) in the
+completion-box.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Completely evaluate member-types of
+template-classes (this includes types
+of member-variables and return-types
+of member-functions) in the
+completion-box.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkCompleteArgumentType</cstring>
+ </property>
+ <property name="text">
+ <string>Do complete argument-type-e&amp;valuation</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Completely evaluate the function-argument-types
+of template-class member-functions in the
+completion-box.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Completely evaluate the function-argument-types
+of template-class member-functions in the
+completion-box.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox8_2</cstring>
+ </property>
+ <property name="title">
+ <string>Argument Hint Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkAutomaticArgumentsHint</cstring>
+ </property>
+ <property name="text">
+ <string>Auto&amp;matic arguments hint:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KIntNumInput">
+ <property name="name">
+ <cstring>inputArgumentsHint</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>msec</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkShowCommentInArgumentHint</cstring>
+ </property>
+ <property name="text">
+ <string>Show comment with
+argument hint</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup6</cstring>
+ </property>
+ <property name="title">
+ <string>Incremental Parsing</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radioButton13</cstring>
+ </property>
+ <property name="text">
+ <string>Do not process included headers</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>checkParseMissingHeaders</cstring>
+ </property>
+ <property name="text">
+ <string>Preprocess and parse included
+headers into a database(experimental)</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Parse preprocessed headers that are not part of this project
+into a special completion-database. To reparse the headers delete
+the database and reopen the project.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>checkPreprocessIncludedHeaders</cstring>
+ </property>
+ <property name="text">
+ <string>Preprocess included headers
+(collect macros and visibility-information)</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Try to locate all included files and preprocess them.
+This makes macros and imported namespaces work correctly, and allows KDevelop
+to know what code-items are visible from within which file.
+Note: Parsing may become very slow when this is enabled
+(It will become faster after some time).</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Code Completion Databases</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Code Completion Databases&lt;/b&gt; are used to store the parsed headers for external libraries, to allow code completion for non-project classes and methods.</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>advancedOptions</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>newPCSButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click to start the Code Completion database creation wizard.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removePCSButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox9_2</cstring>
+ </property>
+ <property name="title">
+ <string>Misc</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkResolveIncludePaths</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Advanced include-path resolution using make(e&amp;xperimental)</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Try to resolve the include-path by getting the command that would be used
+for compiling the file and parsing the gcc-options. The build-system needs to be working,
+test for problems by running "make -n -W myfile.cpp myfile.o" in the directory.
+This also works with cmake, and maybe some other build-systems that build on make.
+The project needs to be compiled or at least configured before this system may work.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkShowTypeEvaluationInStatusBar</cstring>
+ </property>
+ <property name="text">
+ <string>Show t&amp;ype evaluation in status bar</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>editIncludePaths</cstring>
+ </property>
+ <property name="text">
+ <string>src;</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>A semicolon-separated list of include-paths to be used while searching for headers.
+Paths not starting with '/' will be interpreted as relative to the project-folder.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>editNamespaceAlias</cstring>
+ </property>
+ <property name="text">
+ <string>std=_GLIBCXX_STD</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This line may contain a semicolon-separated list of namespace-aliases and namespace-imports.
+example: "std&lt;&lt;_GLIBCXX_STD;NewNamespaceName=OldNamespaceName; &lt;&lt; SomeGloballyImportedNamespace" (without paratheses).
+"&lt;&lt;" means that the right namespace is imported into the left, while "=" means that both namespaces are treated as
+if they were one("a=b" is equivalent to "a&lt;&lt;b;b&lt;&lt;a")</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel1_6</cstring>
+ </property>
+ <property name="text">
+ <string>Custom include paths:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Namespace alias list:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer15_2</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>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>navigationTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Navigation</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox12</cstring>
+ </property>
+ <property name="title">
+ <string>Header/Source split (Highly Experimental)</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_splitEnable</cstring>
+ </property>
+ <property name="text">
+ <string>Enable split of Header/So&amp;urce files</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check to have header and source appear in the same page.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to have header and source appear in the same page.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_splitSync</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Automatic S&amp;ynchronize</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check to have the source file scroll as you
+navigate the header and vice versa</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to have the source file scroll as you
+navigate the header and vice versa</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_splitOrientationBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Orientation</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select which Qt version your project is using.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_splitVertical</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Vertical</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using Qt version 3.x.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_splitHorizontal</cstring>
+ </property>
+ <property name="text">
+ <string>Hori&amp;zontal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using Qt version 4.x.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer12_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>400</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox21</cstring>
+ </property>
+ <property name="title">
+ <string>Context Menu</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_switchShouldMatch</cstring>
+ </property>
+ <property name="text">
+ <string>Switch Header/Implementation &amp;matches current function</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check to have the &lt;b&gt;Switch Header/Implementation&lt;/b&gt;
+feature attempt to match the function under the
+cursor with the matching declaration/definition.
+</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to have the &lt;b&gt;Switch Header/Implementation&lt;/b&gt;
+feature attempt to match the function under the
+cursor with the matching declaration/definition.
+</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_showContextMenuExplosion</cstring>
+ </property>
+ <property name="text">
+ <string>Show Go To &amp;Declaration/Definition submenus</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check to show two additional submenus
+in the editor context menu containing
+all the declarations and definitions
+for the current file and its matching
+header/implementation file.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check to show two additional submenus
+in the editor context menu containing
+all the declarations and definitions
+for the current file and its matching
+header/implementation file.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBox18</cstring>
+ </property>
+ <property name="text">
+ <string>Show type evaluation &amp;based navigation menus</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Menus appear on the right mouse click context menu,
+hows menu items to navigate. Needs the "Class View"
+plugin enabled to have use all options.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Menus appear on the right mouse click context menu,
+hows menu items to navigate. Needs the "Class View"
+plugin enabled to have use all options.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>classWizardPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Class Wi&amp;zard</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>options</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Filename options</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>These are the suffixes used by the Class Wizard when creating new classes.&lt;br&gt;Should be in the format: ".suffix"</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>interface_suffix</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>implementation_suffix</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Interface suffix:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>interface_suffix</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>I&amp;mplementation suffix:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>implementation_suffix</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer12_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>337</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>qtPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Qt Options</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_qtUsed</cstring>
+ </property>
+ <property name="text">
+ <string>Enable Qt opt&amp;ions</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_qtVersionDirectoryBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Qt Version, Directory and QMake Binary</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select which Qt version your project is using and where that Qt version is installed to.
+
+This option only applies to QMake projects.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_versionQt3</cstring>
+ </property>
+ <property name="text">
+ <string>Qt 3</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use Qt version 3 (When this is changed the project needs to be closed and re-opened.)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using Qt version 3.x.&lt;br&gt;When this is changed the project needs to be closed and re-opened.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_versionQt4</cstring>
+ </property>
+ <property name="text">
+ <string>Qt 4</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use Qt version 4 (When this is changed the project needs to be closed and re-opened.)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using Qt version 4.x.&lt;br&gt;When this is changed the project needs to be closed and re-opened.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_5</cstring>
+ </property>
+ <property name="text">
+ <string>(After changing the project needs to be re-opened)</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer13_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>470</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_txtQtDir</cstring>
+ </property>
+ <property name="text">
+ <string>Qt3 Directory:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This setting is only needed for Qt3 programs, for Qt4 just make sure the QMake Binary is set properly</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>m_qtDir</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The Qt directory, will be red if it is not a valid Qt directory. This setting is only needed for Qt3 programs.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose the directory that Qt was installed to. If this is shown in red the directory is not a valid Qt directory.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_txtQMake</cstring>
+ </property>
+ <property name="text">
+ <string>QMake Binary:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>m_qmakePath</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The full path to the QMake executable to be used</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_qtStyleBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Qt include syntax</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select which include style your project is using.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_qtStyleVersion3</cstring>
+ </property>
+ <property name="text">
+ <string>Qt &amp;3 style (#include &lt;qwidget.h&gt;)</string>
+ </property>
+ <property name="accel">
+ <string>Alt+3</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using include style as known from Qt version 3.x.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_qtStyleVersion4</cstring>
+ </property>
+ <property name="text">
+ <string>Qt &amp;4 style (#include &lt;QWidget&gt;)</string>
+ </property>
+ <property name="accel">
+ <string>Alt+4</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select this if your project is using include style as known from Qt version 4.x.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_designerBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>UI Designer Integration</string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_kdevembedded</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use KDevelop's embedded designer</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start KDevelop's own designer embedded within KDevelop</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to integrate the UI designer into KDevelop.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_kdevexternal</cstring>
+ </property>
+ <property name="text">
+ <string>Run &amp;KDevelop's designer as a separate application</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start KDevelop's own designer externally</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to run KDevelop's UI designer as a separate program.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_qtdesigner</cstring>
+ </property>
+ <property name="text">
+ <string>Run Qt &amp;Designer</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use Qt Designer externally</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this button if you wish to use Qt Designer rather than KDevelop's integrated designer.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_txtDesigner</cstring>
+ </property>
+ <property name="text">
+ <string>Designer Binary:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_designerPath</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>m_designerPath</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The full path to the Designer executable to be used</string>
+ </property>
+ </widget>
+ </hbox>
+ </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_4</cstring>
+ </property>
+ <property name="text">
+ <string>Extra Plugin Paths for Qt4 Designer:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_designerPrefix</cstring>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>pluginPaths</cstring>
+ </property>
+ <property name="text">
+ <string>Change Plugin Paths</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer14_2</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>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>accessorPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Accessors</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox8</cstring>
+ </property>
+ <property name="title">
+ <string>E&amp;xample for Member Variable of Type String</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout5_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_lblVariableName</cstring>
+ </property>
+ <property name="text">
+ <string>Variable name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>m_edtVariableName</cstring>
+ </property>
+ <property name="text">
+ <string>m_x</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>61</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_edtExampleGet</cstring>
+ </property>
+ <property name="text">
+ <string>int x() const;</string>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>m_edtExampleSet</cstring>
+ </property>
+ <property name="text">
+ <string>void setX(const string&amp; theValue);</string>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel7</cstring>
+ </property>
+ <property name="text">
+ <string>Get method:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel8</cstring>
+ </property>
+ <property name="text">
+ <string>Set method:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox9</cstring>
+ </property>
+ <property name="title">
+ <string>Settings</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_edtGet</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lblGet</cstring>
+ </property>
+ <property name="text">
+ <string>Prefix for &lt;b&gt;get&lt;/b&gt; methods:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="2">
+ <property name="name">
+ <cstring>m_edtSet</cstring>
+ </property>
+ <property name="text">
+ <string>set</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Will show as "Create Accessor Methods" in the
+right mouse button context menu only when
+you right click on a variable in a header file.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lblSet</cstring>
+ </property>
+ <property name="text">
+ <string>Prefix for &lt;b&gt;set&lt;/b&gt; methods:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>m_edtRemovePrefix</cstring>
+ </property>
+ <property name="text">
+ <string>m_</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lblRemovePrefix</cstring>
+ </property>
+ <property name="text">
+ <string>Member &lt;b&gt;variable&lt;/b&gt; prefix to remove:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="2">
+ <property name="name">
+ <cstring>m_edtParameterName</cstring>
+ </property>
+ <property name="text">
+ <string>theValue</string>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer5_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>87</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_lblParameterName</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Parametername&lt;/b&gt; in set method:</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>87</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="3">
+ <property name="name">
+ <cstring>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>92</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="3">
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>92</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer36</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>91</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>newPCSButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotNewPCS()</slot>
+ </connection>
+ <connection>
+ <sender>m_edtVariableName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotGetterSetterValuesChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_edtRemovePrefix</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotGetterSetterValuesChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_edtGet</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotGetterSetterValuesChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_edtSet</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotGetterSetterValuesChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_edtParameterName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotGetterSetterValuesChanged()</slot>
+ </connection>
+ <connection>
+ <sender>checkAutomaticCodeCompletion</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>inputCodeCompletion</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkAutomaticArgumentsHint</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>inputArgumentsHint</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>removePCSButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotRemovePCS()</slot>
+ </connection>
+ <connection>
+ <sender>m_splitEnable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>slotEnableSplit(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_splitEnable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_splitSync</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtUsed</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_qtStyleBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtUsed</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_qtVersionDirectoryBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtUsed</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_designerBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_splitEnable</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_splitOrientationBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt3</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>toggleQtVersion(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt4</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>toggleQtVersion(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtdesigner</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_txtDesigner</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtdesigner</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_designerPath</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_kdevexternal</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_txtDesigner</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_kdevembedded</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_txtDesigner</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_kdevexternal</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_designerPath</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_kdevembedded</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_designerPath</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt4</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_qtDir</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt4</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_txtQtDir</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt3</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_txtQtDir</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt3</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_qtDir</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtDir</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isValidQtDir(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_qmakePath</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isQMakeExecutable(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_qmakePath</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isQMakeExecutable(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_qtDir</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isValidQtDir(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_designerPath</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isDesignerExecutable(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_designerPath</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>isDesignerExecutable(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt4</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel1_4</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>pluginPaths</sender>
+ <signal>clicked()</signal>
+ <receiver>CCConfigWidgetBase</receiver>
+ <slot>openPluginPaths()</slot>
+ </connection>
+ <connection>
+ <sender>m_versionQt4</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>pluginPaths</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>cpp_options</tabstop>
+ <tabstop>checkAutomaticCodeCompletion</tabstop>
+ <tabstop>inputCodeCompletion</tabstop>
+ <tabstop>checkAutomaticArgumentsHint</tabstop>
+ <tabstop>inputArgumentsHint</tabstop>
+ <tabstop>newPCSButton</tabstop>
+ <tabstop>advancedOptions</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kurlrequester.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">implementationFile()</slot>
+ <slot access="protected">interfaceFile()</slot>
+ <slot access="protected">slotAddPPPath()</slot>
+ <slot access="protected">slotEnableCC()</slot>
+ <slot access="protected">slotEnableCH()</slot>
+ <slot access="protected">slotEnableChooseFiles( bool )</slot>
+ <slot access="protected">slotEnablePCS()</slot>
+ <slot access="protected">slotEnablePP()</slot>
+ <slot access="protected">slotRemovePPPath()</slot>
+ <slot access="protected">slotSelectTemplateGroup( const QString &amp; )</slot>
+ <slot access="protected">slotSetCHWindow()</slot>
+ <slot>slotNewPCS()</slot>
+ <slot access="protected">slotGetterSetterValuesChanged()</slot>
+ <slot access="protected">slotRemovePCS()</slot>
+ <slot access="protected">slotEnableSplit( bool )</slot>
+ <slot>toggleQtVersion(bool)</slot>
+ <slot>isDesignerExecutable(const QString&amp;)</slot>
+ <slot>isQMakeExecutable(const QString&amp;)</slot>
+ <slot>isValidQtDir(const QString&amp;)</slot>
+ <slot>openPluginPaths()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/classgeneratorconfig.cpp b/languages/cpp/classgeneratorconfig.cpp
new file mode 100644
index 00000000..c6049801
--- /dev/null
+++ b/languages/cpp/classgeneratorconfig.cpp
@@ -0,0 +1,236 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 <qcheckbox.h>
+#include <qcombobox.h>
+#include <qtextedit.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+
+#include <kstandarddirs.h>
+#include <kconfig.h>
+
+#include "cppsupportfactory.h"
+#include "classgeneratorconfig.h"
+
+ClassGeneratorConfig::ClassGeneratorConfig( QWidget* parent, const char* name, WFlags fl )
+ : ClassGeneratorConfigBase( parent, name, fl )
+{
+ readConfig();
+ currTemplate = &cppHeaderText;
+ template_edit->setText( *currTemplate );
+}
+
+ClassGeneratorConfig::ClassGeneratorConfig( QString v_cppHeaderText, QString v_cppSourceText,
+ QString v_objcHeaderText, QString v_objcSourceText,
+ QString v_gtkHeaderText, QString v_gtkSourceText,
+ NameCase v_fileCase, NameCase v_defCase, NameCase v_superCase,
+ bool v_showAuthor, bool v_genDoc, bool v_reformat,
+ QWidget* parent, const char* name, WFlags fl )
+ : ClassGeneratorConfigBase( parent, name, fl ),
+ cppHeaderText( v_cppHeaderText ), cppSourceText( v_cppSourceText ),
+ objcHeaderText( v_objcHeaderText ), objcSourceText( v_objcSourceText ),
+ gtkHeaderText( v_gtkHeaderText ), gtkSourceText( v_gtkSourceText )
+{
+ filecase_box->setCurrentItem( ( int ) v_fileCase );
+ defcase_box->setCurrentItem( ( int ) v_defCase );
+ supercase_box->setCurrentItem( ( int ) v_superCase );
+ author_box->setChecked( v_showAuthor );
+ doc_box->setChecked( v_genDoc );
+ reformat_box->setChecked( v_reformat );
+
+ currTemplate = &cppHeaderText;
+}
+
+ClassGeneratorConfig::~ClassGeneratorConfig()
+{}
+
+/*$SPECIALIZATION$*/
+void ClassGeneratorConfig::templateTypeChanged( int type )
+{
+ *currTemplate = template_edit->text();
+
+ currTemplate = identifyTemplate( type );
+ template_edit->setText( *currTemplate );
+}
+
+QString ClassGeneratorConfig::cppHeader()
+{
+ if ( currTemplate == &cppHeaderText )
+ * currTemplate = template_edit->text();
+ return cppHeaderText;
+}
+
+QString ClassGeneratorConfig::cppSource()
+{
+ if ( currTemplate == &cppSourceText )
+ * currTemplate = template_edit->text();
+ return cppSourceText;
+}
+
+QString ClassGeneratorConfig::objcHeader()
+{
+ if ( currTemplate == &objcHeaderText )
+ * currTemplate = template_edit->text();
+ return objcHeaderText;
+}
+
+QString ClassGeneratorConfig::objcSource()
+{
+ if ( currTemplate == &objcSourceText )
+ * currTemplate = template_edit->text();
+ return objcSourceText;
+}
+
+QString ClassGeneratorConfig::gtkHeader()
+{
+ if ( currTemplate == &gtkHeaderText )
+ * currTemplate = template_edit->text();
+ return gtkHeaderText;
+}
+
+QString ClassGeneratorConfig::gtkSource()
+{
+ if ( currTemplate == &gtkSourceText )
+ * currTemplate = template_edit->text();
+ return gtkSourceText;
+}
+
+ClassGeneratorConfig::NameCase ClassGeneratorConfig::fileCase()
+{
+ return ( NameCase ) filecase_box->currentItem();
+}
+
+ClassGeneratorConfig::NameCase ClassGeneratorConfig::defCase()
+{
+ return ( NameCase ) defcase_box->currentItem();
+}
+
+ClassGeneratorConfig::NameCase ClassGeneratorConfig::superCase()
+{
+ return ( NameCase ) supercase_box->currentItem();
+}
+
+bool ClassGeneratorConfig::showAuthor()
+{
+ return author_box->isChecked();
+}
+
+bool ClassGeneratorConfig::genDoc()
+{
+ return doc_box->isChecked();
+}
+
+QString *ClassGeneratorConfig::identifyTemplate( int value )
+{
+ switch ( value )
+ {
+ case 0:
+ return & cppHeaderText;
+ case 1:
+ return &cppSourceText;
+ case 2:
+ return &objcHeaderText;
+ case 3:
+ return &objcSourceText;
+ case 4:
+ return &gtkHeaderText;
+ case 5:
+ return &gtkSourceText;
+ }
+ return 0;
+}
+
+void ClassGeneratorConfig::readConfig()
+{
+ KConfig * config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "Class Generator" );
+
+ filecase_box->setCurrentItem( config->readNumEntry( "File Name Case", 0 ) );
+ defcase_box->setCurrentItem( config->readNumEntry( "Defines Case", 1 ) );
+ supercase_box->setCurrentItem( config->readNumEntry( "Superclasss Name Case", 0 ) );
+
+ author_box->setChecked( config->readBoolEntry( "Show Author Name", 1 ) );
+ doc_box->setChecked( config->readBoolEntry( "Generate Empty Documentation", 1 ) );
+
+ reformat_box->setChecked( config->readBoolEntry( "Reformat Source", 0 ) );
+
+ KStandardDirs *dirs = CppSupportFactory::instance() ->dirs();
+
+ cppHeaderText = templateText( dirs->findResource( "newclasstemplates", "cpp_header" ) );
+ cppSourceText = templateText( dirs->findResource( "newclasstemplates", "cpp_source" ) );
+ objcHeaderText = templateText( dirs->findResource( "newclasstemplates", "objc_header" ) );
+ objcSourceText = templateText( dirs->findResource( "newclasstemplates", "objc_source" ) );
+ gtkHeaderText = templateText( dirs->findResource( "newclasstemplates", "gtk_header" ) );
+ gtkSourceText = templateText( dirs->findResource( "newclasstemplates", "gtk_source" ) );
+ }
+}
+
+
+QString ClassGeneratorConfig::templateText( QString path )
+{
+ QFileInfo f( path );
+ if ( f.exists() )
+ {
+ QFile file( path );
+ if ( file.open( IO_ReadOnly ) )
+ {
+ QTextStream stream( &file );
+ return stream.read();
+ }
+ else
+ return "";
+ }
+ else
+ return "";
+}
+
+void ClassGeneratorConfig::storeConfig()
+{
+ KConfig * config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "Class Generator" );
+
+ config->writeEntry( "File Name Case", filecase_box->currentItem() );
+ config->writeEntry( "Defines Case", defcase_box->currentItem() );
+ config->writeEntry( "Superclasss Name Case", supercase_box->currentItem() );
+
+ config->writeEntry( "Show Author Name", author_box->isChecked() );
+ config->writeEntry( "Generate Empty Documentation", doc_box->isChecked() );
+
+ config->writeEntry( "Reformat Source", reformat_box->isChecked() );
+
+ KStandardDirs *dirs = CppSupportFactory::instance() ->dirs();
+
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "cpp_header", cppHeader() );
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "cpp_source", cppSource() );
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "objc_header", objcHeader() );
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "objc_source", objcSource() );
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "gtk_header", gtkHeader() );
+ saveTemplateText( dirs->saveLocation( "newclasstemplates" ) + "gtk_source", gtkSource() );
+ }
+}
+
+void ClassGeneratorConfig::saveTemplateText( QString path, QString content )
+{
+ QFile f( path );
+ if ( f.open( IO_WriteOnly ) )
+ {
+ QTextStream stream( &f );
+ stream << content;
+ f.close();
+ }
+}
+
+#include "classgeneratorconfig.moc"
diff --git a/languages/cpp/classgeneratorconfig.h b/languages/cpp/classgeneratorconfig.h
new file mode 100644
index 00000000..b9cb08a3
--- /dev/null
+++ b/languages/cpp/classgeneratorconfig.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 CLASSGENERATORCONFIG_H
+#define CLASSGENERATORCONFIG_H
+
+#include "classgeneratorconfigbase.h"
+
+class ClassGeneratorConfig : public ClassGeneratorConfigBase
+{
+ Q_OBJECT
+
+public:
+ enum NameCase { LowerCase, UpperCase, SameAsClassCase, SameAsFileCase };
+
+ ClassGeneratorConfig( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+
+ ClassGeneratorConfig( QString v_cppHeaderText, QString v_cppSourceText,
+ QString v_objcHeaderText, QString v_objcSourceText,
+ QString v_gtkHeaderText, QString v_gtkSourceText,
+ NameCase v_fileCase, NameCase v_defCase, NameCase v_superCase,
+ bool v_showAuthor, bool v_genDoc, bool v_reformat,
+ QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+
+ ~ClassGeneratorConfig();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void readConfig();
+
+ QString cppHeader();
+ QString cppSource();
+ QString objcHeader();
+ QString objcSource();
+ QString gtkHeader();
+ QString gtkSource();
+
+ NameCase fileCase();
+ NameCase defCase();
+ NameCase superCase();
+
+ bool showAuthor();
+ bool genDoc();
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ void storeConfig();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void templateTypeChanged( int type );
+
+private:
+ QString *identifyTemplate( int value );
+ QString templateText( QString path );
+ void saveTemplateText( QString path, QString content );
+
+ QString cppHeaderText;
+ QString cppSourceText;
+ QString objcHeaderText;
+ QString objcSourceText;
+ QString gtkHeaderText;
+ QString gtkSourceText;
+
+ QString *currTemplate;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
diff --git a/languages/cpp/classgeneratorconfigbase.ui b/languages/cpp/classgeneratorconfigbase.ui
new file mode 100644
index 00000000..566e9eb2
--- /dev/null
+++ b/languages/cpp/classgeneratorconfigbase.ui
@@ -0,0 +1,261 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ClassGeneratorConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ClassGeneratorConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>576</width>
+ <height>528</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox7_2</cstring>
+ </property>
+ <property name="title">
+ <string>Class &amp;Templates</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="0" column="0">
+ <item>
+ <property name="text">
+ <string>Cpp Header</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Cpp Source</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Objective-C Header</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Objective-C Source</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>GTK C Header</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>GTK C Source</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>templatename_box</cstring>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="1" column="0">
+ <property name="name">
+ <cstring>template_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Names</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>#ifndef - #&amp;define names:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>defcase_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;File names:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>filecase_box</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="0">
+ <item>
+ <property name="text">
+ <string>Lowercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Uppercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Same as Class Names</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>filecase_box</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Lowercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Uppercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Same as Class Names</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Same as File Names</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>defcase_box</cstring>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="2">
+ <item>
+ <property name="text">
+ <string>Lowercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Uppercase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Same as Class Names</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>supercase_box</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>textLabel3_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Superclass file names:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>supercase_box</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox9</cstring>
+ </property>
+ <property name="title">
+ <string>Class Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>author_box</cstring>
+ </property>
+ <property name="text">
+ <string>Include &amp;author name in class documentation</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>doc_box</cstring>
+ </property>
+ <property name="text">
+ <string>Generate &amp;empty documentation strings</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>reformat_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Reformat source before creating files</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>templatename_box</sender>
+ <signal>activated(int)</signal>
+ <receiver>ClassGeneratorConfigBase</receiver>
+ <slot>templateTypeChanged(int)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>templatename_box</tabstop>
+ <tabstop>template_edit</tabstop>
+ <tabstop>filecase_box</tabstop>
+ <tabstop>defcase_box</tabstop>
+ <tabstop>supercase_box</tabstop>
+ <tabstop>author_box</tabstop>
+ <tabstop>doc_box</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">templateTypeChanged(int type)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/codecompletionentry.h b/languages/cpp/codecompletionentry.h
new file mode 100644
index 00000000..60042004
--- /dev/null
+++ b/languages/cpp/codecompletionentry.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ cppcodecompletion.cpp - description
+ -------------------
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __CODECOMPLETIONENTRY_H__
+#define __CODECOMPLETIONENTRY_H__
+
+#include <ktexteditor/codecompletioninterface.h>
+
+//this is just a little helper-class to allow custom sorting, it must stay binary compatible with KTextEditor::CompletionEntry!!
+class CodeCompletionEntry : public KTextEditor::CompletionEntry
+{
+public:
+ CodeCompletionEntry() : KTextEditor::CompletionEntry() {
+ }
+ CodeCompletionEntry( const CodeCompletionEntry& rhs ) : KTextEditor::CompletionEntry( rhs ) {
+ }
+ CodeCompletionEntry( const KTextEditor::CompletionEntry& rhs ) : KTextEditor::CompletionEntry( rhs ) {
+ }
+
+ bool operator < ( const CodeCompletionEntry& rhs ) {
+ return userdata < rhs.userdata;
+ }
+ bool operator == ( const CodeCompletionEntry& rhs ) {
+ return userdata == rhs.userdata;
+ }
+ bool operator > ( const CodeCompletionEntry& rhs ) {
+ return userdata > rhs.userdata;
+ }
+
+ CodeCompletionEntry& operator = ( const KTextEditor::CompletionEntry& rhs ) {
+ (*(KTextEditor::CompletionEntry*)this) = rhs;
+ return *this;
+ }
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/codeinformationrepository.cpp b/languages/cpp/codeinformationrepository.cpp
new file mode 100644
index 00000000..5bb22a68
--- /dev/null
+++ b/languages/cpp/codeinformationrepository.cpp
@@ -0,0 +1,339 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "codeinformationrepository.h"
+#include "cpp_tags.h"
+
+#include <kdevcoderepository.h>
+#include <kdebug.h>
+
+/// @todo move in utils.cpp
+static QValueList<KTextEditor::CompletionEntry>
+my_unique( const QValueList<KTextEditor::CompletionEntry>& entryList )
+{
+
+ QValueList< KTextEditor::CompletionEntry > l;
+ QMap<QString, bool> map;
+ QValueList< KTextEditor::CompletionEntry >::ConstIterator it = entryList.begin();
+ while ( it != entryList.end() )
+ {
+ KTextEditor::CompletionEntry e = *it++;
+ QString key = e.type + " " +
+ e.text + " " +
+ e.prefix + " " +
+ e.postfix + " ";
+ if ( map.find( key ) == map.end() )
+ {
+ map[ key ] = TRUE;
+ l << e;
+ }
+ }
+ return l;
+}
+
+CodeInformationRepository::CodeInformationRepository( KDevCodeRepository* rep )
+ : m_rep( rep )
+{}
+
+CodeInformationRepository::~CodeInformationRepository()
+{}
+
+QValueList<Tag> CodeInformationRepository::query( const QValueList<Catalog :: QueryArgument> & args )
+{
+// kdDebug( 9007 ) << "CodeInformationRepository::query()" << endl;
+
+ QValueList<Tag> tags;
+
+ QValueList<Catalog*> catalogs = m_rep->registeredCatalogs();
+ QValueList<Catalog*>::Iterator it = catalogs.begin();
+ while ( it != catalogs.end() )
+ {
+ Catalog * catalog = *it;
+ ++it;
+
+ if ( !catalog->enabled() )
+ continue;
+
+ tags += catalog->query( args );
+ }
+
+ return tags;
+}
+
+QValueList<Tag> CodeInformationRepository::getTagsInFile( const QString & fileName )
+{
+ kdDebug( 9007 ) << "CodeInformationRepository::getTagsInFile()" << endl;
+
+ QValueList<Catalog::QueryArgument> args;
+ args << Catalog::QueryArgument( "fileName", fileName );
+
+ QValueList<Catalog*> catalogs = m_rep->registeredCatalogs();
+ QValueList<Catalog*>::Iterator it = catalogs.begin();
+ while ( it != catalogs.end() )
+ {
+ Catalog * catalog = *it;
+ ++it;
+
+ QValueList<Tag> tags = catalog->query( args );
+
+ if ( tags.size() )
+ return tags;
+ }
+
+ return QValueList<Tag>();
+}
+
+QValueList<Tag> CodeInformationRepository::getTagsInScope( const QStringList & scope, bool // isInstance
+ )
+{
+ kdDebug( 9007 ) << "CodeInformationRepository::getTagsInScope()" << endl;
+
+ QValueList<Tag> tags;
+ QValueList<Catalog::QueryArgument> args;
+
+#if 0
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Namespace )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Class )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+#endif
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_FunctionDeclaration )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Variable )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+
+ if ( true /*!isInstance*/ )
+ {
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Enumerator )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+ }
+
+ return tags;
+}
+
+QValueList<KTextEditor::CompletionEntry> CodeInformationRepository::getEntriesInScope( const QStringList & scope, bool isInstance, bool recompute )
+{
+ kdDebug( 9007 ) << "CodeInformationRepository::getEntriesInScope()" << endl;
+
+ if ( !recompute && !scope.size() && m_globalEntries.size() )
+ return m_globalEntries;
+ else if ( scope.size() == 0 )
+ {
+ m_globalEntries = my_unique( toEntryList( getTagsInScope( scope, isInstance ) ) );
+ return m_globalEntries;
+ }
+
+ return toEntryList( getTagsInScope( scope, isInstance ) );
+}
+
+
+QValueList<Tag> CodeInformationRepository::getBaseClassList( const QString& className )
+{
+// kdDebug( 9007 ) << "CodeInformationRepository::getBaseClassList()" << endl;
+
+ if ( className.isEmpty() )
+ return QValueList<Tag>();
+
+ QValueList<Catalog::QueryArgument> args;
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Base_class );
+ /* if( className.length() >= 2 )
+ args << Catalog::QueryArgument( "prefix", className.left(2) );*/
+ args << Catalog::QueryArgument( "name", className );
+ return query( args );
+}
+
+QValueList<Tag> CodeInformationRepository::getClassOrNamespaceList( const QStringList & scope )
+{
+ kdDebug( 9007 ) << "CodeInformationRepository::getClassOrNamespaceList()" << endl;
+
+ QValueList<Tag> tags;
+ QValueList<Catalog::QueryArgument> args;
+
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Namespace )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Class )
+ << Catalog::QueryArgument( "scope", scope );
+ tags += query( args );
+
+ return tags;
+}
+
+QValueList<Tag> CodeInformationRepository::getTagsInScope( const QString & name, const QStringList & scope )
+{
+ QValueList<Tag> tags;
+ QValueList<Catalog::QueryArgument> args;
+
+ args.clear();
+ args << Catalog::QueryArgument( "scope", scope );
+ /* if( name.length() >= 2 )
+ args << Catalog::QueryArgument( "prefix", name.left(2) ); */
+ args << Catalog::QueryArgument( "name", name );
+
+ tags += query( args );
+
+ return tags;
+}
+
+KTextEditor::CompletionEntry CodeInformationRepository::toEntry( Tag & tag, CppCodeCompletion::CompletionMode completionMode, TypeProcessor* proc )
+{
+ KTextEditor::CompletionEntry entry;
+
+ if ( tag.name().isEmpty() )
+ return entry;
+
+ switch ( tag.kind() )
+ {
+ case Tag::Kind_Typedef:
+ entry.prefix = "typedef";
+ entry.text = tag.name();
+ break;
+
+ case Tag::Kind_Class:
+ entry.prefix = "class";
+ entry.text = tag.name();
+ break;
+
+ case Tag::Kind_Struct:
+ entry.prefix = "struct";
+ entry.text = tag.name();
+ break;
+
+ case Tag::Kind_Namespace:
+ entry.prefix = "namespace";
+ entry.text = tag.name();
+ break;
+
+ case Tag::Kind_FunctionDeclaration:
+ //case Tag::Kind_Function:
+ {
+
+ CppFunction<Tag> tagInfo( tag );
+ QStringList arguments = tagInfo.arguments();
+ QStringList argumentNames = tagInfo.argumentNames();
+
+ if ( completionMode == CppCodeCompletion::VirtualDeclCompletion )
+ {
+ //Ideally the type info would be a entry.prefix, but we need them to be
+ //inserted upon completion so they have to be part of entry.text
+ entry.text = tagInfo.type();
+ entry.text += " ";
+ entry.text += tag.name();
+ }
+ else
+ entry.text = tag.name();
+
+ if ( !arguments.size() )
+ entry.text += "(";
+ else
+ entry.text += "( ";
+
+ QString signature;
+ for ( uint i = 0; i < arguments.size(); ++i )
+ {
+ if( !proc )
+ signature += arguments[ i ];
+ else
+ signature += proc->processType( arguments[ i ] );
+
+ if ( completionMode == CppCodeCompletion::NormalCompletion ||
+ completionMode == CppCodeCompletion::VirtualDeclCompletion )
+ {
+ QString argName = argumentNames[ i ];
+ if ( !argName.isEmpty() )
+ signature += QString::fromLatin1( " " ) + argName;
+
+ }
+
+ if ( i != ( arguments.size() - 1 ) )
+ {
+ signature += ", ";
+ }
+ }
+
+ if ( signature.isEmpty() )
+ entry.text += ")";
+ else
+ entry.postfix = signature + " )";
+
+ if ( tagInfo.isConst() )
+ entry.postfix += " const";
+
+ if ( completionMode == CppCodeCompletion::VirtualDeclCompletion )
+ {
+ entry.text += entry.postfix + ";";
+ entry.postfix = QString::null;
+ }
+ else if ( completionMode != CppCodeCompletion::NormalCompletion )
+ {
+ entry.text += entry.postfix;
+ entry.postfix = QString::null;
+ }
+
+ QString comment = tag.attribute( "description" ).toString();
+ if ( !comment.isNull() )
+ entry.comment = comment;
+ //else
+ //entry.comment = "no documentation available!";
+ }
+
+ break;
+
+ case Tag::Kind_Enumerator:
+ case Tag::Kind_Variable:
+ entry.text = tag.name();
+ break;
+
+ default:
+ ;
+ }
+
+ entry.comment = tag.comment();
+
+ return entry;
+}
+
+QValueList<KTextEditor :: CompletionEntry> CodeInformationRepository::toEntryList( const QValueList<Tag> & tags, CppCodeCompletion::CompletionMode completionMode )
+{
+ QValueList<KTextEditor :: CompletionEntry> entryList;
+ QMap<QString, bool> ns;
+
+ QValueList<Tag>::ConstIterator it = tags.begin();
+ while ( it != tags.end() )
+ {
+ Tag tag = *it;
+ ++it;
+
+ KTextEditor::CompletionEntry entry = toEntry( tag, completionMode );
+ if ( !entry.text.isEmpty() )
+ entryList << entry;
+ }
+
+ return entryList;
+}
+
+
diff --git a/languages/cpp/codeinformationrepository.h b/languages/cpp/codeinformationrepository.h
new file mode 100644
index 00000000..f7fa712a
--- /dev/null
+++ b/languages/cpp/codeinformationrepository.h
@@ -0,0 +1,58 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef CODEINFORMATIONREPOSITORY_H
+#define CODEINFORMATIONREPOSITORY_H
+
+#include "catalog.h"
+#include "cppcodecompletion.h"
+#include <qmap.h>
+
+#include <ktexteditor/codecompletioninterface.h>
+
+struct TypeProcessor {
+ virtual QString processType( const QString& type ) = 0;
+ virtual QString parentType() = 0;
+};
+
+class KDevCodeRepository;
+
+class CodeInformationRepository
+{
+public:
+ CodeInformationRepository( KDevCodeRepository* rep );
+ virtual ~CodeInformationRepository();
+
+ static QValueList<KTextEditor::CompletionEntry> toEntryList( const QValueList<Tag>& tags,
+ CppCodeCompletion::CompletionMode mode = CppCodeCompletion::NormalCompletion );
+ static KTextEditor::CompletionEntry toEntry( Tag& tag, CppCodeCompletion::CompletionMode mode = CppCodeCompletion::NormalCompletion, TypeProcessor* proc = 0 );
+ QValueList<KTextEditor::CompletionEntry> getEntriesInScope( const QStringList& scope, bool isInstance, bool recompute = false );
+
+ QValueList<Tag> query( const QValueList<Catalog::QueryArgument>& args );
+ QValueList<Tag> getTagsInScope( const QStringList& scope, bool isInstance );
+ QValueList<Tag> getTagsInScope( const QString& name, const QStringList& scope );
+
+ QValueList<Tag> getTagsInFile( const QString& fileName );
+ QValueList<Tag> getBaseClassList( const QString& className );
+ QValueList<Tag> getClassOrNamespaceList( const QStringList& scope );
+
+private:
+ QValueList<KTextEditor::CompletionEntry> m_globalEntries;
+ KDevCodeRepository* m_rep;
+
+private:
+ CodeInformationRepository( const CodeInformationRepository& source );
+ void operator = ( const CodeInformationRepository& source );
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/compiler/Makefile.am b/languages/cpp/compiler/Makefile.am
new file mode 100644
index 00000000..128e715f
--- /dev/null
+++ b/languages/cpp/compiler/Makefile.am
@@ -0,0 +1,6 @@
+# This is the collection of plugins. In contrast to the parts
+# directory, these are 'transient' in a sense and don't
+# share the complete KDevComponent interface.
+
+SUBDIRS = gccoptions
+
diff --git a/languages/cpp/compiler/gccoptions/Makefile.am b/languages/cpp/compiler/gccoptions/Makefile.am
new file mode 100644
index 00000000..3e801ae4
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/Makefile.am
@@ -0,0 +1,20 @@
+# Here resides the gcc option dialog plugin.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevgccoptions.la
+libkdevgccoptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+libkdevgccoptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(LIB_KHTML)
+
+libkdevgccoptions_la_SOURCES = gccoptionsplugin.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevgccoptions.desktop kdevgppoptions.desktop kdevg77options.desktop
+
+
+
+
diff --git a/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp b/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp
new file mode 100644
index 00000000..ac547fc7
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/gccoptionsplugin.cpp
@@ -0,0 +1,705 @@
+/***************************************************************************
+* Copyright (C) 2000-2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include <qapplication.h>
+#include <qlabel.h>
+#include <qvbuttongroup.h>
+#include <qradiobutton.h>
+#include <qvaluelist.h>
+#include <qtabwidget.h>
+#include <qlayout.h>
+#include <qvbox.h>
+#include <kdialog.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+
+#include "flagboxes.h"
+#include "gccoptionsplugin.h"
+
+K_EXPORT_COMPONENT_FACTORY( libkdevgccoptions, KGenericFactory<GccOptionsPlugin>( "kdevgccoptions" ) )
+
+class GeneralTab : public QWidget
+{
+public:
+ GeneralTab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 );
+ ~GeneralTab();
+
+ void readFlags( QStringList *str );
+ void writeFlags( QStringList *str );
+
+private:
+ FlagCheckBoxController *controller;
+};
+
+
+class OptimizationTab : public QWidget
+{
+public:
+ OptimizationTab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 );
+ ~OptimizationTab();
+
+ void readFlags( QStringList *str );
+ void writeFlags( QStringList *str );
+
+private:
+ QRadioButton *Odefault, *O0, *O1, *O2;
+ FlagListBox *optBox;
+};
+
+
+class G77Tab : public QWidget
+{
+public:
+ G77Tab( QWidget *parent = 0, const char *name = 0 );
+ ~G77Tab();
+
+ void readFlags( QStringList *str );
+ void writeFlags( QStringList *str );
+
+private:
+ FlagCheckBoxController *controller;
+};
+
+
+class Warnings1Tab : public QWidget
+{
+public:
+ Warnings1Tab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 );
+ ~Warnings1Tab();
+
+ void readFlags( QStringList *str );
+ void writeFlags( QStringList *str );
+
+private:
+ FlagCheckBoxController *controller;
+ FlagListBox *wallBox;
+};
+
+
+class Warnings2Tab : public QWidget
+{
+public:
+ Warnings2Tab( GccOptionsPlugin::Type type, QWidget *parent = 0, const char *name = 0 );
+ ~Warnings2Tab();
+
+ void readFlags( QStringList *str );
+ void writeFlags( QStringList *str );
+
+private:
+ FlagListBox *wrestBox;
+};
+
+
+GeneralTab::GeneralTab( GccOptionsPlugin::Type type, QWidget *parent, const char *name )
+ : QWidget( parent, name ), controller( new FlagCheckBoxController )
+{
+ QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ layout->setAutoAdd( true );
+ layout->addSpacing( 10 );
+
+ QVButtonGroup *output_group = new QVButtonGroup( i18n( "Output" ), this );
+ new FlagCheckBox( output_group, controller,
+ "-fsyntax-only", i18n( "Only check the code for syntax errors, do not produce object code" ) );
+ new FlagCheckBox( output_group, controller,
+ "-pg", i18n( "Generate extra code to write profile information for gprof" ) );
+ new FlagCheckBox( output_group, controller,
+ "-save-temps", i18n( "Do not delete intermediate output like assembler files" ) );
+
+ QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ layout->addSpacing( 10 );
+
+ QVButtonGroup *codegen_group = new QVButtonGroup( i18n( "Code Generation" ), this );
+ if ( type != GccOptionsPlugin::GPP )
+ {
+ new FlagCheckBox( codegen_group, controller,
+ "-fexceptions", i18n( "Enable exception handling" ),
+ "-fno-exception" );
+ }
+ else
+ {
+ new FlagCheckBox( codegen_group, controller,
+ "-fno-exceptions", i18n( "Disable exception handling" ),
+ "-fexception" );
+ }
+ // The following two are somehow mutually exclusive, but the default is
+ // platform-dependent, so if we would leave out one of them, we wouldn't
+ // know how to set the remaining one.
+ new FlagCheckBox( codegen_group, controller,
+ "-fpcc-struct-return", i18n( "Return certain struct and union values in memory rather than in registers" ) );
+ new FlagCheckBox( codegen_group, controller,
+ "-freg-struct-return", i18n( "Return certain struct and union values in registers when possible" ) );
+ new FlagCheckBox( codegen_group, controller,
+ "-short-enums", i18n( "For an enum, choose the smallest possible integer type" ) );
+ new FlagCheckBox( codegen_group, controller,
+ "-short-double", i18n( "Make 'double' the same as 'float'" ) );
+
+ QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ layout->addStretch();
+}
+
+
+GeneralTab::~GeneralTab()
+{
+ delete controller;
+}
+
+
+void GeneralTab::readFlags( QStringList *list )
+{
+ controller->readFlags( list );
+}
+
+
+void GeneralTab::writeFlags( QStringList *list )
+{
+ controller->writeFlags( list );
+}
+
+
+OptimizationTab::OptimizationTab( GccOptionsPlugin::Type type, QWidget *parent, const char *name )
+ : QWidget( parent, name )
+{
+ QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ layout->setAutoAdd( true );
+
+ QVButtonGroup *group = new QVButtonGroup( i18n( "Optimization Level" ), this );
+ Odefault = new QRadioButton( i18n( "Default" ), group );
+ Odefault->setChecked( true );
+ O0 = new QRadioButton( i18n( "No optimization" ), group );
+ O1 = new QRadioButton( i18n( "Level 1" ), group );
+ O2 = new QRadioButton( i18n( "Level 2" ), group );
+
+ optBox = new FlagListBox( this );
+
+ new FlagListItem( optBox,
+ "-ffloat-store", i18n( "<qt>Do not store floating point variables in registers</qt>" ),
+ "-fno-float-store" );
+ new FlagListItem( optBox,
+ "-fno-defer-pop", i18n( "<qt>Pop the arguments to each function call directly "
+ "after the function returns</qt>" ),
+ "-fdefer-pop" );
+ new FlagListItem( optBox,
+ "-fforce-mem", i18n( "<qt>Force memory operands to be copied into registers before "
+ "doing arithmetic on them</qt>" ),
+ "-fno-force-mem" );
+ new FlagListItem( optBox,
+ "-fforce-addr", i18n( "<qt>Force memory address constants to be copied into registers before "
+ "doing arithmetic on them</qt>" ),
+ "-fno-force-addr" );
+ new FlagListItem( optBox,
+ "-fomit-frame-pointer", i18n( "<qt>Do not keep the frame pointer in a register for functions that "
+ "do not need one</qt>" ),
+ "-fno-omit-frame-pointer" );
+ new FlagListItem( optBox,
+ "-fno-inline", i18n( "<qt>Ignore the <i>inline</i> keyword</qt>" ),
+ "-finline" );
+
+ if ( type == GccOptionsPlugin::GPP )
+ {
+ new FlagListItem( optBox,
+ "-fno-default-inline", i18n( "<qt>Do not make member functions inline merely because they "
+ "are defined inside the class scope</qt>" ),
+ "-fdefault-inline" );
+ }
+
+ QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ layout->addStretch();
+}
+
+
+OptimizationTab::~OptimizationTab()
+{}
+
+
+void OptimizationTab::readFlags( QStringList *list )
+{
+ optBox->readFlags( list );
+
+ QStringList::Iterator sli;
+ sli = list->find( "-O0" );
+ if ( sli != list->end() )
+ {
+ O0->setChecked( true );
+ list->remove
+ ( sli );
+ }
+ sli = list->find( "-O1" );
+ if ( sli != list->end() )
+ {
+ O1->setChecked( true );
+ list->remove
+ ( sli );
+ }
+ sli = list->find( "-O2" );
+ if ( sli != list->end() )
+ {
+ O2->setChecked( true );
+ list->remove
+ ( sli );
+ }
+}
+
+
+void OptimizationTab::writeFlags( QStringList *list )
+{
+ optBox->writeFlags( list );
+
+ if ( O0->isChecked() )
+ ( *list ) << "-O0";
+ else if ( O1->isChecked() )
+ ( *list ) << "-O1";
+ else if ( O2->isChecked() )
+ ( *list ) << "-O2";
+}
+
+
+G77Tab::G77Tab( QWidget *parent, const char *name )
+ : QWidget( parent, name ), controller( new FlagCheckBoxController )
+{
+ QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ layout->setAutoAdd( true );
+ layout->addSpacing( 10 );
+
+ QVButtonGroup *dialect_group = new QVButtonGroup( i18n( "Dialect" ), this );
+ new FlagCheckBox( dialect_group, controller,
+ "-ffree-form", i18n( "Interpret source code as Fortran 90 free form" ),
+ "-fno-exception" );
+ new FlagCheckBox( dialect_group, controller,
+ "-ff90", i18n( "Allow certain Fortran 90 constructs" ) );
+ new FlagCheckBox( dialect_group, controller,
+ "-fdollar-ok", i18n( "Allow '$' in symbol names" ) );
+ new FlagCheckBox( dialect_group, controller,
+ "-fbackslash", i18n( "Allow '\' in character constants to escape special characters" ),
+ "-fno-backslah" );
+ new FlagCheckBox( dialect_group, controller,
+ "-fonetrip", i18n( "DO loops are executed at least once" ) );
+
+ QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ layout->addSpacing( 10 );
+
+ QVButtonGroup *codegen_group = new QVButtonGroup( i18n( "Code Generation" ), this );
+ new FlagCheckBox( codegen_group, controller,
+ "-fno-automatic", i18n( "Treat local variables as if SAVE statement had been specified" ) );
+ new FlagCheckBox( codegen_group, controller,
+ "-finit-local-zero", i18n( "Init local variables to zero" ) );
+ new FlagCheckBox( codegen_group, controller,
+ "-fbounds-check", i18n( "Generate run-time checks for array subscripts" ) );
+
+ QApplication::sendPostedEvents( this, QEvent::ChildInserted );
+ layout->addStretch();
+}
+
+
+G77Tab::~G77Tab()
+{
+ delete controller;
+}
+
+
+void G77Tab::readFlags( QStringList *list )
+{
+ controller->readFlags( list );
+}
+
+
+void G77Tab::writeFlags( QStringList *list )
+{
+ controller->writeFlags( list );
+}
+
+
+Warnings1Tab::Warnings1Tab( GccOptionsPlugin::Type type, QWidget *parent, const char *name )
+ : QWidget( parent, name ), controller( new FlagCheckBoxController )
+{
+ QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ layout->setAutoAdd( true );
+
+ new FlagCheckBox( this, controller,
+ "-w", i18n( "Inhibit all warnings" ) );
+ new FlagCheckBox( this, controller,
+ "-Wno-import", i18n( "Inhibit warnings about the use of #import" ) );
+ new FlagCheckBox( this, controller,
+ "-Werror", i18n( "Make all warnings into errors" ) );
+ new FlagCheckBox( this, controller,
+ "-pedantic", i18n( "Issue all warnings demanded by strict ANSI C or ISO C++" ) );
+ new FlagCheckBox( this, controller,
+ "-pedantic-errors", i18n( "Like -pedantic, but errors are produced instead of warnings" ) );
+ new FlagCheckBox( this, controller,
+ "-Wall", i18n( "All warnings below, combined (-Wall):" ) );
+
+ wallBox = new FlagListBox( this );
+
+ new FlagListItem( wallBox,
+ "-Wchar-subscripts", i18n( "<qt>Warn if an array subscript has type <i>char</i></qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wcomment", i18n( "<qt>Warn when a comment-start sequence /* appears inside a comment</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wformat", i18n( "<qt>Check calls to <i>printf()</i>, <i>scanf()</i> etc\n"
+ "to make sure that the arguments supplied have types appropriate\n"
+ "to the format string specified, and that the conversions specified\n"
+ "in the format string make sense</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wformat=2", i18n( "<qt>Enable -Wformat plus format checks not \n"
+ "included in -Wformat. Currently equivalent to \n"
+ "`-Wformat -Wformat-nonliteral -Wformat-security \n"
+ "-Wformat-y2k'.</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wimplicit-int", i18n( "<qt>Warn when a declaration does not specify a type</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wimplicit-funtion-declaration",
+ i18n( "<qt>Issue a warning when a non-declared function is used</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Werror-implicit-function-declaration",
+ i18n( "<qt>Issue an error when a non-declared function is used</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wmain", i18n( "<qt>Warn if the type of <i>main()</i> is suspicious</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wmultichar", i18n( "<qt>Warn when multicharacter constants are encountered</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wmissing-braces", i18n( "<qt>Warn if an aggregate or union initializer is not fully bracketed</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wparentheses", i18n( "<qt>Warn when parentheses are omitted in certain contexts</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wsequence-point", i18n( "<qt>Warn about code that may have undefined semantics because of\n"
+ "violations of sequence point rules in the C standard</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wreturn-type", i18n( "<qt>Warn when a function without explicit return type is defined</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wswitch", i18n( "<qt>Warn whenever a <i>switch</i> statement has an index of enumeral type\n"
+ "and lacks a <i>case</i> for one or more of the named codes of that enumeration</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wtrigraphs", i18n( "<qt>Warn when trigraphs are encountered</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wunused", i18n( "<qt>Warn when a variable is declared but not used</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wuninitialized", i18n( "<qt>Warn when a variable is used without being initialized first</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wunknown-pragmas", i18n( "<qt>Warn when an unknown #pragma statement is encountered</qt>" ) );
+ new FlagListItem( wallBox,
+ "-Wdiv-by-zero", i18n( "<qt>Warn when a division by zero occurs.</qt>" ) );
+ if ( type == GccOptionsPlugin::GPP )
+ {
+ new FlagListItem( wallBox,
+ "-Wreorder", i18n( "<qt>Warn when the order of member initializers is different from\n"
+ "the order in the class declaration</qt>" ) );
+ }
+}
+
+
+Warnings1Tab::~Warnings1Tab()
+{
+ delete controller;
+}
+
+
+void Warnings1Tab::readFlags( QStringList *list )
+{
+ controller->readFlags( list );
+ wallBox->readFlags( list );
+}
+
+
+void Warnings1Tab::writeFlags( QStringList *list )
+{
+ controller->writeFlags( list );
+ wallBox->writeFlags( list );
+}
+
+
+Warnings2Tab::Warnings2Tab( GccOptionsPlugin::Type type, QWidget *parent, const char *name )
+ : QWidget( parent, name )
+{
+ QBoxLayout * layout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+ layout->setAutoAdd( true );
+
+ wrestBox = new FlagListBox( this );
+
+ new FlagListItem( wrestBox,
+ "-W", i18n( "<qt>Set options not included in -Wall which are very specific</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wfloat-equal", i18n( "<qt>Warn if floating point values are used in equality comparisons</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wundef", i18n( "<qt>Warn if an undefined identifier is evaluated in an <i>#if</i> directive</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wshadow", i18n( "<qt>Warn whenever a local variable shadows another local variable</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wpointer-arith", i18n( "<qt>Warn about anything that depends on the <i>sizeof</i> a\n"
+ "function type or of <i>void</i></qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wcast-qual", i18n( "<qt>Warn whenever a pointer is cast so as to remove a type\n"
+ "qualifier from the target type</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wcast-align", i18n( "<qt>Warn whenever a pointer is cast such that the required\n"
+ "alignment of the target is increased</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wwrite-strings", i18n( "<qt>Warn when the address of a string constant is cast\n"
+ "into a non-const <i>char *</i> pointer</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wconversion", i18n( "<qt>Warn if a prototype causes a type conversion that is different\n"
+ "from what would happen to the same argument in the absence\n"
+ "of a prototype</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wsign-compare", i18n( "<qt>Warn when a comparison between signed and unsigned values\n"
+ "could produce an incorrect result when the signed value\n"
+ "is converted to unsigned</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wmissing-noreturn", i18n( "<qt>Warn about functions which might be candidates for attribute 'noreturn'</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Waggregate-return", i18n( "<qt>Warn if any functions that return structures or unions are\n"
+ "defined or called</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wmissing-declarations", i18n( "<qt>Warn if a global function is defined without a previous declaration</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wno-deprecated-declarations",
+ i18n( "<qt>Do not warn about uses of functions, variables, and types marked as\n"
+ "deprecated by using the 'deprecated' attribute</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wpacked", i18n( "<qt>Warn if a structure is given the packed attribute, but the packed\n"
+ "attribute has no effect on the layout or size of the structure</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wpadded", i18n( "<qt>Warn if padding is included in a structure, either to align an\n"
+ "element of the structure or to align the whole structure</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wredundant-decls", i18n( "<qt>Warn if anything is declared more than once in the same scope</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wunreachable-code", i18n( "<qt>Warn if the compiler detects that code will never be executed</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Winline", i18n( "<qt>Warn if an <i>inline</i> function cannot be inlined</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wlong-long", i18n( "<qt>Warn if the <i>long long</i> type is used</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wdisabled-optimization", i18n( "<qt>Warn if a requested optimization pass is disabled</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wno-div-by-zero", i18n( "<qt>Do not warn if there is a division by zero</qt>" ) );
+
+ if ( type == GccOptionsPlugin::GCC )
+ {
+ new FlagListItem( wrestBox,
+ "-Wtraditional", i18n( "<qt>Warn about certain constructs that behave differently\n"
+ "in traditional and ANSI C</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wbad-function-cast", i18n( "<qt>Warn whenever a function call is cast to a non-matching type</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wstrict-prototypes", i18n( "<qt>Warn if a function is declared or defined without specifying\n"
+ "the argument types</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wmissing-prototypes", i18n( "<qt>Warn if a global function is defined without a previous prototype declaration</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wnested-externs", i18n( "<qt>Warn if an <i>extern</i> declaration is encountered within a function</qt>" ) );
+ }
+
+
+ if ( type == GccOptionsPlugin::GPP )
+ {
+ new FlagListItem( wrestBox,
+ "-Woverloaded-virtual", i18n( "<qt>Warn when a function declaration hides virtual\n"
+ "functions from a base class</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wsynth", i18n( "<qt>Warn when g++'s synthesis behavior does\n"
+ "not match that of cfront</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wctor-dtor-privacy", i18n( "<qt>Warn when a class seems unusable, because all the constructors or\n"
+ "destructors in a class are private and the class has no friends or\n"
+ "public static member functions</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wnon-virtual-dtor", i18n( "<qt>Warn when a class declares a non-virtual destructor that should\n"
+ "probably be virtual, because it looks like the class will be used\n"
+ "polymorphically</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wsign-promo", i18n( "<qt>Warn when overload resolution chooses a promotion from unsigned or\n"
+ "enumeral type to a signed type over a conversion to an unsigned\n"
+ "type of the same size. Previous versions of G++ would try to\n"
+ "preserve unsignedness, but the standard mandates the current behavior</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wabi", i18n( "<qt>Warn when G++ generates code that is probably not compatible with\n"
+ "the vendor-neutral C++ ABI</qt>" ) );
+ /* new FlagListItem(wrestBox,
+ "-Wreorder", i18n("<qt>Warn when the order of member initializers given in the code does\n"
+ "not match the order in which they must be executed.</qt>"));*/
+ new FlagListItem( wrestBox,
+ "-Weffc++", i18n( "<qt>Warn about violations of the following style guidelines from Scott\n"
+ "Meyers' 'Effective C++' book:\n"
+ "* Item 11: Define a copy constructor and an assignment\n"
+ " operator for classes with dynamically allocated memory;\n"
+ "* Item 12: Prefer initialization to assignment in constructors;\n"
+ "* Item 14: Make destructors virtual in base classes;\n"
+ "* Item 15: Have `operator=' return a reference to `*this';\n"
+ "* Item 23: Do not try to return a reference when you must\n"
+ " return an object\n"
+ "\n"
+ "and about violations of the following style guidelines from Scott\n"
+ "Meyers' 'More Effective C++' book:\n"
+ "* Item 6: Distinguish between prefix and postfix forms of\n"
+ " increment and decrement operators;\n"
+ "* Item 7: Never overload '&&', '||', or ','</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wno-deprecated", i18n( "<qt>Do not warn about usage of deprecated features</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wno-non-template-friend", i18n( "<qt>Disable warnings when non-templatized friend functions are declared\n"
+ "within a template</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wold-style-cast", i18n( "<qt>Warn if an old-style (C-style) cast to a non-void type is used\n"
+ "within a C++ program</qt>" ) );
+ new FlagListItem( wrestBox,
+ "-Wno-pmf-conversions", i18n( "<qt>Disable the diagnostic for converting a bound pointer to member\n"
+ "function to a plain pointer</qt>" ) );
+ }
+}
+
+
+Warnings2Tab::~Warnings2Tab()
+{}
+
+
+void Warnings2Tab::readFlags( QStringList *list )
+{
+ wrestBox->readFlags( list );
+}
+
+
+void Warnings2Tab::writeFlags( QStringList *list )
+{
+ wrestBox->writeFlags( list );
+}
+
+
+// Last but not least... :-)
+GccOptionsDialog::GccOptionsDialog( GccOptionsPlugin::Type type, QWidget *parent, const char *name )
+ : KDialogBase( Tabbed, GccOptionsPlugin::captionForType( type ), Ok | Cancel, Ok, parent, name, true )
+{
+ QVBox * vbox;
+
+ vbox = addVBoxPage( i18n( "General" ) );
+ general = new GeneralTab( type, vbox, "general tab" );
+
+ vbox = addVBoxPage( i18n( "Optimization" ) );
+ optimization = new OptimizationTab( type, vbox, "optimization tab" );
+
+ if ( type == GccOptionsPlugin::G77 )
+ {
+ vbox = addVBoxPage( i18n( "Fortran Specifics" ) );
+ g77 = new G77Tab( vbox, "g77 tab" );
+ }
+ else
+ g77 = 0;
+
+ vbox = addVBoxPage( i18n( "Warnings (safe)" ) );
+ warnings1 = new Warnings1Tab( type, vbox, "warnings1 tab" );
+
+ vbox = addVBoxPage( i18n( "Warnings (unsafe)" ) );
+ warnings2 = new Warnings2Tab( type, vbox, "warnings2 tab" );
+}
+
+
+GccOptionsDialog::~GccOptionsDialog()
+{}
+
+
+void GccOptionsDialog::setFlags( const QString &flags )
+{
+ QStringList flaglist = QStringList::split( " ", flags );
+
+ // Hand them to 'general' at last, so it can make a line edit
+ // with the unprocessed items
+ if ( g77 )
+ g77->readFlags( &flaglist );
+ optimization->readFlags( &flaglist );
+ warnings1->readFlags( &flaglist );
+ warnings2->readFlags( &flaglist );
+ general->readFlags( &flaglist );
+ unrecognizedFlags = flaglist;
+}
+
+
+QString GccOptionsDialog::flags() const
+{
+ QStringList flaglist;
+
+ if ( g77 )
+ g77->writeFlags( &flaglist );
+ optimization->writeFlags( &flaglist );
+ warnings1->writeFlags( &flaglist );
+ warnings2->writeFlags( &flaglist );
+ general->writeFlags( &flaglist );
+
+ QString flags;
+ QStringList::ConstIterator li;
+ for ( li = flaglist.begin(); li != flaglist.end(); ++li )
+ {
+ flags += ( *li );
+ flags += " ";
+ }
+
+ for ( li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li )
+ {
+ flags += ( *li );
+ flags += " ";
+ }
+
+ flags.truncate( flags.length() - 1 );
+ return flags;
+}
+
+
+GccOptionsPlugin::GccOptionsPlugin( QObject *parent, const char *name, const QStringList &args )
+ : KDevCompilerOptions( parent, name )
+{
+ gcctype = Unknown;
+
+ if ( args.count() == 0 )
+ return ;
+
+ QString typeStr = args[ 0 ];
+
+ if ( typeStr == "gcc" )
+ gcctype = GccOptionsPlugin::GCC;
+ else if ( typeStr == "g++" )
+ gcctype = GccOptionsPlugin::GPP;
+ else if ( typeStr == "g77" )
+ gcctype = GccOptionsPlugin::G77;
+}
+
+
+GccOptionsPlugin::~GccOptionsPlugin()
+{}
+
+
+QString GccOptionsPlugin::captionForType( Type type )
+{
+ switch ( type )
+ {
+ case GCC:
+ return i18n( "GNU C Compiler Options" );
+ case GPP:
+ return i18n( "GNU C++ Compiler Options" );
+ case G77:
+ return i18n( "GNU Fortran 77 Compiler Options" );
+ default:
+ return QString::null;
+ }
+}
+
+
+QString GccOptionsPlugin::exec( QWidget *parent, const QString &flags )
+{
+ if ( gcctype == Unknown )
+ return QString::null;
+ GccOptionsDialog *dlg = new GccOptionsDialog( gcctype, parent, "gcc options dialog" );
+ QString newFlags = flags;
+ dlg->setFlags( flags );
+ if ( dlg->exec() == QDialog::Accepted )
+ newFlags = dlg->flags();
+ delete dlg;
+ return newFlags;
+}
+
+#include "gccoptionsplugin.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/compiler/gccoptions/gccoptionsplugin.h b/languages/cpp/compiler/gccoptions/gccoptionsplugin.h
new file mode 100644
index 00000000..a3b8cd70
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/gccoptionsplugin.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GCCOPTIONSPLUGIN_H_
+#define _GCCOPTIONSPLUGIN_H_
+
+#include <kdialogbase.h>
+
+#include "kdevcompileroptions.h"
+
+
+class GeneralTab;
+class OptimizationTab;
+class G77Tab;
+class Warnings1Tab;
+class Warnings2Tab;
+
+
+class GccOptionsPlugin : public KDevCompilerOptions
+{
+ Q_OBJECT
+
+public:
+ enum Type { GCC, GPP, G77, Unknown };
+ GccOptionsPlugin( QObject *parent, const char *name, const QStringList &args );
+ ~GccOptionsPlugin();
+
+ static QString captionForType(Type type);
+
+ virtual QString exec(QWidget *parent, const QString &flags);
+
+private:
+ Type gcctype;
+};
+
+
+class GccOptionsDialog : public KDialogBase
+{
+public:
+ GccOptionsDialog( GccOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 );
+ ~GccOptionsDialog();
+
+ void setFlags(const QString &flags);
+ QString flags() const;
+
+private:
+ GeneralTab *general;
+ OptimizationTab *optimization;
+ G77Tab *g77;
+ Warnings1Tab *warnings1;
+ Warnings2Tab *warnings2;
+ QStringList unrecognizedFlags;
+};
+
+#endif
diff --git a/languages/cpp/compiler/gccoptions/kdevg77options.desktop b/languages/cpp/compiler/gccoptions/kdevg77options.desktop
new file mode 100644
index 00000000..4f7941b7
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/kdevg77options.desktop
@@ -0,0 +1,56 @@
+[Desktop Entry]
+Type=Service
+Exec=g77
+Comment=GNU Fortran 77 Compiler
+Comment[br]=Dastumer Fortran 77 GNU
+Comment[ca]=Compilador Fortran 77 de GNU
+Comment[da]=GNU Fortran 77 compiler
+Comment[el]=Μεταγλωττιστής GNU Fortran 77
+Comment[es]=Compilador GNU de Fortran 77
+Comment[et]=GNU Fortran 77 kompilaator
+Comment[eu]=GNU Fortran 77 konpiladorea
+Comment[fa]=مترجم فرترن ۷۷ گنو
+Comment[fr]=Compilateur pour Fortran 77 du GNU
+Comment[ga]=Tiomsaitheoir Fortran 77 GNU
+Comment[gl]=Compilador GNU Fortran 77
+Comment[hi]=जीएनयू फ़ोरट्रॉन 77 कम्पायलर
+Comment[hu]=GNU Fortran 77 fordítóprogram
+Comment[is]=GNU Fortran 77 þýðandi
+Comment[it]=Compilatore per GNU Fortran 77
+Comment[ja]=GNU Fortran 77 コンパイラ
+Comment[nds]=GNU Fortran 77-Kompilerer
+Comment[ne]=GNU Fortran 77 कम्पाइलर
+Comment[nl]=GNU Fortran 77-compiler
+Comment[pl]=Kompilator GNU Fortran 77
+Comment[pt]=Compilador GNU Fortran 77
+Comment[pt_BR]=Compilador GNU Fortran 77
+Comment[ru]=Компилятор GNU Fortran 77
+Comment[sk]=GNU Fortran 77 kompilátor
+Comment[sl]=Prevajalnik za GNU Fortran 77
+Comment[sr]=GNU-ов преводилац Fortran-а 77
+Comment[sr@Latn]=GNU-ov prevodilac Fortran-a 77
+Comment[sv]=GNU Fortran 77-compilator
+Comment[ta]=GNU Fortran 77 தொகுப்பி
+Comment[tg]=Талфифгари GNU Fortran 77
+Comment[tr]=GNU Fortran 77 Derleyicisi
+Comment[zh_CN]=GNU Fortran 77 编译器
+Comment[zh_TW]=GNU Fortran 77 編譯器
+Name=G77Options
+Name[de]=G77-Einstellungen (KDevelop)
+Name[el]=G77Επιλογές
+Name[hi]=जी77विकल्प
+Name[nds]=G77-Optschonen (KDevelop)
+Name[pl]=Opcje G77
+Name[sk]=G77 možnosti
+Name[sl]=Možnosti G77
+Name[sv]=Alternativ för g77
+Name[ta]=G77விருப்பங்கள்
+Name[tg]=G77Интихобҳо
+Name[tr]=G77Seçenekleri
+Name[zh_TW]=G77 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevgccoptions
+X-KDevelop-Version=5
+X-KDevelop-Language=Fortran
+X-KDevelop-Args=g77
+X-KDevelop-Default=true
diff --git a/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop b/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop
new file mode 100644
index 00000000..5d135cb1
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/kdevgccoptions.desktop
@@ -0,0 +1,54 @@
+[Desktop Entry]
+Type=Service
+Exec=gcc
+Comment=GNU C Compiler
+Comment[br]=Dastumer C GNU
+Comment[ca]=Compilador C de GNU
+Comment[da]=GNU C compiler
+Comment[el]=Μεταγλωττιστής GNU C
+Comment[es]=Compilador GNU de C
+Comment[et]=GNU C kompilaator
+Comment[eu]=GNU C konpiladorea
+Comment[fa]=مترجم سی گنو
+Comment[fr]=Compilateur C du GNU
+Comment[ga]=Tiomsaitheoir C GNU
+Comment[gl]=Compilador GNU C
+Comment[hi]=जीएनयू सी कम्पायलर
+Comment[hu]=GNU C fordítóprogram
+Comment[is]=GNU C þýðandi
+Comment[it]=Compilatore GNU C
+Comment[ja]=GNU C コンパイラ
+Comment[nds]=GNU C-Kompilerer
+Comment[ne]=GNU C कम्पाइलर
+Comment[pl]=Kompilator GNU C
+Comment[pt]=Compilador GNU C
+Comment[pt_BR]=Compilador GNU C
+Comment[ru]=Компилятор GNU C
+Comment[sk]=GNU C kompilátor
+Comment[sl]=Prevajalnik za GNU C
+Comment[sr]=GNU-ов C преводилац
+Comment[sr@Latn]=GNU-ov C prevodilac
+Comment[sv]=GNU C-kompilator
+Comment[ta]=GNU Cதொகுப்பி
+Comment[tg]=Талфифгари GNU C
+Comment[zh_CN]=GNU C 编译器
+Comment[zh_TW]=GNU C 編譯器
+Name=GccOptions
+Name[de]=GCC-Einstellungen (KDevelop)
+Name[el]=GccΕπιλογές
+Name[hi]=जीसीसी-विकल्प
+Name[nds]=GCC-Instellen
+Name[pl]=Opcje Gcc
+Name[sk]=Gcc možnosti
+Name[sl]=Možnosti Gcc
+Name[sv]=Alternativ för gcc
+Name[ta]=Gccவிருப்பங்கள்
+Name[tr]=GccSeçenekleri
+Name[zh_TW]=Gcc 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevgccoptions
+X-KDevelop-Version=5
+X-KDevelop-Language=C
+X-KDevelop-Args=gcc
+X-KDevelop-Default=true
+
diff --git a/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop b/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop
new file mode 100644
index 00000000..ad12fa4c
--- /dev/null
+++ b/languages/cpp/compiler/gccoptions/kdevgppoptions.desktop
@@ -0,0 +1,56 @@
+[Desktop Entry]
+Type=Service
+Exec=g++
+Comment=GNU C++ Compiler
+Comment[br]=Dastumer C++ GNU
+Comment[ca]=Compilador C++ de GNU
+Comment[da]=GNU C++ compiler
+Comment[el]=Μεταγλωττιστής GNU C++
+Comment[es]=Compilador GNU de C++
+Comment[et]=GNU C++ kompilaator
+Comment[eu]=GNU C++ konpiladorea
+Comment[fa]=مترجم C++ گنو
+Comment[fr]=Compilateur C++ de GNU
+Comment[ga]=Tiomsaitheoir C++ GNU
+Comment[gl]=Compilador GNU C++
+Comment[hi]=जीएनयू सी++ कम्पायलर
+Comment[hu]=GNU C++ fordítóprogram
+Comment[is]=GNU C++ þýðandi
+Comment[it]=Compilatore GNU C++
+Comment[ja]=GNU C++ コンパイラ
+Comment[nds]=GNU C++-Kompilerer
+Comment[ne]=GNU C++ कम्पाइलर
+Comment[nl]=GNU C++ compiler
+Comment[pl]=Kompilator GNU C++
+Comment[pt]=Compilador GNU C++
+Comment[pt_BR]=Compilador GNU C++
+Comment[ru]=Компилятор GNU C++
+Comment[sk]=GNU C++ kompilátor
+Comment[sl]=Prevajalnik za GNU C++
+Comment[sr]=GNU-ов C++ преводилац
+Comment[sr@Latn]=GNU-ov C++ prevodilac
+Comment[sv]=GNU C++ kompilator
+Comment[ta]=GNU C++தொகுப்பி
+Comment[tg]=Талфифгари GNU C++
+Comment[tr]=GNU C++ Derleyicisi
+Comment[zh_CN]=GNU C++ 编译器
+Comment[zh_TW]=GNU C++ 編譯器
+Name=GppOptions
+Name[de]=GPP-Einstellungen (KDevelop)
+Name[el]=GppΕπιλογές
+Name[hi]=जीपीपी-विकल्प
+Name[nds]=GPP-Instellen
+Name[pl]=Opcje Gpp
+Name[sk]=Gpp možnosti
+Name[sl]=Možnosti Gpp
+Name[sv]=Alternativ för g++
+Name[ta]=Gppவிருப்பங்கள்
+Name[tr]=GppSeçenekleri
+Name[zh_TW]=Gpp 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevgccoptions
+X-KDevelop-Version=5
+X-KDevelop-Language=C++
+X-KDevelop-Args=g++
+X-KDevelop-Default=true
+
diff --git a/languages/cpp/completiondebug.cpp b/languages/cpp/completiondebug.cpp
new file mode 100644
index 00000000..dc73329e
--- /dev/null
+++ b/languages/cpp/completiondebug.cpp
@@ -0,0 +1,56 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "completiondebug.h"
+
+namespace CompletionDebug {
+
+DBGStreamType dbgState;
+
+const int completionMaxDepth = 50;
+
+DBGStreamType::KStreamType& dbg() {
+ return dbgState.dbg();
+}
+
+bool dbgActive() {
+ return true;
+}
+
+#ifndef NDEBUG
+kdbgstream dbgMajor() {
+ kdbgstream ret = kdDebug( 9007 );
+ dbgState.outputPrefix( ret );
+ return ret;
+}
+#else
+kndbgstream dbgMajor() {
+ return kndDebug();
+};
+
+#endif
+
+#ifndef NDEBUG
+template<>
+ KDDebugState<kdbgstream>::KDDebugState() : m_stream ( kdDebug( 9007 ) ) {
+ }
+#endif
+
+template<>
+ KDDebugState<kndbgstream>::KDDebugState() {
+ }
+}
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/completiondebug.h b/languages/cpp/completiondebug.h
new file mode 100644
index 00000000..088b3b99
--- /dev/null
+++ b/languages/cpp/completiondebug.h
@@ -0,0 +1,221 @@
+/***************************************************************************
+copyright : (C) 2006 by David Nolden
+email : david.nolden.kdevelop@art-master.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 __COMPLETIONDEBUG_H__
+#define __COMPLETIONDEBUG_H__
+
+///With verbose shut on, the whole type-resolution-process is nicely traced for easy debugging(at cost of speed).
+//#define VERBOSE
+//#define VERBOSEMAJOR
+
+///When defined, a backtrace is printed the first time the maximum depth is reached for the first time.
+//#define DEPTHBACKTRACE
+
+#include <qstringlist.h>
+#include <kdebug.h>
+
+namespace CompletionDebug {
+template <class StreamType>
+class KDDebugState {
+ private:
+ StreamType m_stream;
+ kndbgstream m_nstream;
+ QStringList m_prefixStack;
+ int m_counter;
+ int m_depth;
+ bool m_enabled;
+ bool m_hadWarning;
+
+ public:
+ typedef StreamType KStreamType;
+ KDDebugState();
+
+ KDDebugState( StreamType stream ) : m_stream( stream ), m_counter( 0 ), m_depth( 0 ), m_enabled( true ), m_hadWarning( false ) {}
+
+ void push( const QString & txt ) {
+ m_prefixStack.push_back( txt );
+ pushDepth();
+ }
+
+ void pop() {
+ m_prefixStack.pop_back();
+ popDepth();
+ };
+
+ inline void pushDepth() {
+ m_depth++;
+ }
+
+ inline void popDepth() {
+ m_depth--;
+ }
+
+ bool hadWarning() {
+ return m_hadWarning;
+ }
+
+ void setHadWarning( bool had ) {
+ m_hadWarning = had;
+ }
+
+ StreamType& dbg() {
+#ifndef VERBOSE
+ if ( !m_enabled )
+ return m_nstream;
+#endif
+
+ m_stream << "(" << m_counter << ")";
+ for ( QStringList::iterator it = m_prefixStack.begin(); it != m_prefixStack.end() ; ++it )
+ m_stream << *it;
+
+ m_counter++;
+ return m_stream;
+ }
+
+ void setState( bool enabled ) {
+ m_enabled = enabled;
+ }
+
+ bool state() {
+ return m_enabled;
+ }
+
+#ifndef NDEBUG
+ void outputPrefix( kdbgstream& target ) {
+ target << "(" << m_counter << ")";
+ for ( QStringList::iterator it = m_prefixStack.begin(); it != m_prefixStack.end() ; ++it )
+ target << *it;
+
+ m_counter++;
+ }
+#endif
+
+ void clearCounter() {
+ m_counter = 0;
+ }
+
+ int depth() {
+ return m_depth;
+ }
+};
+#ifndef NDEBUG
+template <>
+KDDebugState<kdbgstream>::KDDebugState();
+#endif
+template <>
+KDDebugState<kndbgstream>::KDDebugState();
+#if defined(VERBOSE) && !defined(NDEBUG)
+typedef KDDebugState<kdbgstream> DBGStreamType;
+#else
+typedef KDDebugState<kndbgstream> DBGStreamType;
+#endif
+///Class to help indent the debug-output correctly
+extern DBGStreamType dbgState;
+extern const int completionMaxDepth;
+class LogDebug {
+ private:
+ DBGStreamType& m_state;
+ int m_max;
+ public:
+ LogDebug( const char* prefix = "#", int max = completionMaxDepth, DBGStreamType& st = dbgState ) : m_state( st ), m_max( max ) {
+ m_state.push( prefix );
+ };
+ ~LogDebug() {
+ m_state.pop();
+ }
+
+ DBGStreamType::KStreamType& dbg() {
+ return m_state.dbg();
+ }
+
+ int depth() {
+ return m_state.depth();
+ }
+
+ operator bool() {
+ bool r = depth() < m_max;
+
+ if ( !r && !m_state.hadWarning() ) {
+ m_state.setHadWarning( true );
+ dbg() << "recursion is too deep" << endl;
+#ifdef DEPTHBACKTRACE
+ kdDebug( 9007 ) << kdBacktrace() << endl;
+#endif
+ }
+ return r;
+ }
+};
+
+
+///does not care about the logging, but still counts the depth
+class DepthDebug {
+ DBGStreamType& m_state;
+ int m_max;
+ public:
+ DepthDebug( const char* prefix = "#", int max = completionMaxDepth, DBGStreamType& st = dbgState ) : m_state( st ), m_max( max ) {
+ Q_UNUSED( prefix );
+ m_state.pushDepth();
+ };
+
+ ~DepthDebug() {
+ m_state.popDepth();
+ }
+
+ kndbgstream dbg() {
+ return kndDebug();
+ }
+
+ int depth() {
+ return m_state.depth();
+ }
+
+ operator bool() {
+ bool r = depth() < m_max;
+
+ if ( !r && !m_state.hadWarning() ) {
+ m_state.setHadWarning( true );
+ dbg() << "recursion is too deep" << endl;
+#ifdef DEPTHBACKTRACE
+ kdDebug( 9007 ) << kdBacktrace() << endl;
+#endif
+ }
+ return r;
+ }
+};
+
+#ifndef VERBOSEMAJOR
+#define ifVerboseMajor(x) /**/
+#else
+#define ifVerboseMajor(x) x
+#endif
+
+bool dbgActive();
+
+#ifdef VERBOSE
+
+typedef LogDebug Debug;
+DBGStreamType::KStreamType& dbg();
+#define ifVerbose( x) {if( dbgActive() ) {x;}}
+#else
+
+DBGStreamType::KStreamType& dbg();
+typedef DepthDebug Debug;
+#define ifVerbose(x) /**/
+#endif
+#ifndef NDEBUG
+kdbgstream dbgMajor();
+#else
+kndbgstream dbgMajor();
+#endif
+}
+#endif
+// kate: indent-mode csands; tab-width 2;
diff --git a/languages/cpp/computerecoverypoints.h b/languages/cpp/computerecoverypoints.h
new file mode 100644
index 00000000..eccd44f6
--- /dev/null
+++ b/languages/cpp/computerecoverypoints.h
@@ -0,0 +1,190 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __COMPUTERECOVERYPOINTS_H__
+#define __COMPUTERECOVERYPOINTS_H__
+
+#include <qvaluestack.h>
+
+#include "simpletype.h"
+#include "simpletypenamespace.h"
+#include "tree_parser.h"
+
+static QString toSimpleName( NameAST* name )
+{
+ if ( !name )
+ return QString::null;
+
+ QString s;
+ QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
+ while ( nameIt.current() )
+ {
+ if ( nameIt.current() ->name() )
+ {
+ s += nameIt.current() ->name() ->text() + "::";
+ }
+ ++nameIt;
+ }
+
+ if ( name->unqualifiedName() && name->unqualifiedName() ->name() )
+ s += name->unqualifiedName() ->name() ->text();
+
+ return s;
+}
+
+
+struct RecoveryPoint
+{
+ int kind;
+ QStringList scope;
+ QValueList<QStringList> imports;
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+
+ RecoveryPoint()
+ : kind( 0 ), startLine( 0 ), startColumn( 0 ),
+ endLine( 0 ), endColumn( 0 )
+ {}
+
+ ///Registers the recovery-points imports into the given namespace
+ void registerImports( SimpleType ns, QString hardCodedAliases ) {
+ SimpleTypeNamespace* n = dynamic_cast<SimpleTypeNamespace*>( &(*ns) );
+ if( !n ) {
+ kdDebug( 9007 ) << "the global namespace was not resolved correctly " << endl;
+ } else {
+ ///put the imports into the global namespace
+ for( QValueList<QStringList>::iterator it = imports.begin(); it != imports.end(); ++it ) {
+ kdDebug( 9007 ) << "inserting import " << *it << " into the global scope" << endl;
+ n->addAliasMap( QString(""), (*it).join("::"), IncludeFiles() ); ///@TODO: remove this
+ }
+ n->addAliases( hardCodedAliases );
+ }
+ }
+
+private:
+ RecoveryPoint( const RecoveryPoint& source );
+ void operator = ( const RecoveryPoint& source );
+};
+
+
+// namespace?
+class ComputeRecoveryPoints: public TreeParser
+{
+public:
+ ComputeRecoveryPoints( QPtrList<RecoveryPoint>& points )
+ : recoveryPoints( points )
+ {}
+
+ virtual void parseTranslationUnit( const ParsedFile& ast )
+ {
+ QValueList<QStringList> dummy;
+
+ m_imports.push( dummy );
+ TreeParser::parseTranslationUnit( ast );
+ m_imports.pop();
+
+ kdDebug( 9007 ) << "found " << recoveryPoints.count() << " recovery points" << endl;
+ }
+
+ virtual void parseUsingDirective( UsingDirectiveAST* ast )
+ {
+ if ( !ast->name() )
+ return ;
+
+ //QStringList type = CppCodeCompletion::typeName( ast->name() ->text() ).scope();
+ m_imports.top().push_back( ast->name() ->text() );
+ }
+
+ virtual void parseNamespace( NamespaceAST* ast )
+ {
+ m_currentScope.push_back( ast->namespaceName() ->text() );
+ insertRecoveryPoint( ast );
+
+ m_imports.push( m_imports.top() ); // dup
+ // m_imports.top().push_back( m_currentScope );
+
+ TreeParser::parseNamespace( ast );
+
+ m_imports.pop();
+ m_currentScope.pop_back();
+ }
+
+ void parseTemplateDeclaration( TemplateDeclarationAST* ast )
+ {
+ if ( ast->declaration() )
+ parseDeclaration( ast->declaration() );
+
+ TreeParser::parseTemplateDeclaration( ast );
+ }
+
+
+ virtual void parseSimpleDeclaration( SimpleDeclarationAST* ast )
+ {
+ TypeSpecifierAST * typeSpec = ast->typeSpec();
+ //InitDeclaratorListAST* declarators = ast->initDeclaratorList();
+
+ if ( typeSpec )
+ parseTypeSpecifier( typeSpec );
+
+ //insertRecoveryPoint( ast );
+ TreeParser::parseSimpleDeclaration( ast );
+ }
+
+ virtual void parseFunctionDefinition( FunctionDefinitionAST* ast )
+ {
+ m_imports.push( m_imports.top() ); // dup
+ insertRecoveryPoint( ast );
+ m_imports.pop();
+ }
+
+ virtual void parseClassSpecifier( ClassSpecifierAST* ast )
+ {
+ insertRecoveryPoint( ast );
+ m_currentScope.push_back( toSimpleName( ast->name() ) );
+ TreeParser::parseClassSpecifier( ast );
+ m_currentScope.pop_back();
+ }
+
+ void insertRecoveryPoint( AST* ast )
+ {
+ if ( !ast )
+ return ;
+
+ RecoveryPoint* pt = new RecoveryPoint();
+ pt->kind = ast->nodeType();
+ pt->scope = m_currentScope;
+ ast->getStartPosition( &pt->startLine, &pt->startColumn );
+ ast->getEndPosition( &pt->endLine, &pt->endColumn );
+ pt->imports = m_imports.top();
+
+ recoveryPoints.append( pt );
+ }
+
+private:
+ QPtrList<RecoveryPoint>& recoveryPoints;
+ QValueStack< QValueList<QStringList> > m_imports;
+ QStringList m_currentScope;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/configproblemreporter.ui b/languages/cpp/configproblemreporter.ui
new file mode 100644
index 00000000..164d6693
--- /dev/null
+++ b/languages/cpp/configproblemreporter.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ConfigureProblemReporter</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigureProblemReporter</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>588</width>
+ <height>492</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3_2</cstring>
+ </property>
+ <property name="title">
+ <string>Problem Reporter</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If enabled, the C++ parser will report any syntax errors it detects.
+They will be displayed in the 'Problems' output view and as markers in the editor.</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>problemReporterCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use Problem Reporter</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Parsing</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If enabled, the C++ parser will run on the active file after the stated timeout, after there has been any changes to the text.
+
+If disabled, the parser will typically only run when the file is saved.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>bgParserCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>Enable &amp;background parsing</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>delayLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>msec</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>delaySlider</cstring>
+ </property>
+ <property name="minValue">
+ <number>250</number>
+ </property>
+ <property name="maxValue">
+ <number>2000</number>
+ </property>
+ <property name="lineStep">
+ <number>250</number>
+ </property>
+ <property name="pageStep">
+ <number>500</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>NoMarks</enum>
+ </property>
+ <property name="tickInterval">
+ <number>250</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Special &amp;Headers</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Often a macro that the C++ parser must understand in order to correctly parse a piece of code is defined somewhere in a non-standard header file that the parser does not look at. This textbox can be used to define those macros locally so that the C++ parser can understand them.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>specialHeader</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>delaySlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>setDelayLabel(int)</slot>
+ </connection>
+ <connection>
+ <sender>bgParserCheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>bgParserCheckbox_toggled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>bgParserCheckbox</tabstop>
+ <tabstop>delaySlider</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">configproblemreporter.ui.h</include>
+</includes>
+<forwards>
+ <forward>class CppSupportPart;</forward>
+</forwards>
+<variables>
+ <variable>CppSupportPart* m_part;</variable>
+</variables>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>setPart( CppSupportPart * part )</slot>
+ <slot>accept()</slot>
+ <slot>bgParserCheckbox_toggled( bool b )</slot>
+ <slot access="protected">setDelayLabel( int delay )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/configproblemreporter.ui.h b/languages/cpp/configproblemreporter.ui.h
new file mode 100644
index 00000000..d5952b95
--- /dev/null
+++ b/languages/cpp/configproblemreporter.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 slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include "cppsupportpart.h"
+
+#include <kdevproject.h>
+
+#include <kconfig.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+void ConfigureProblemReporter::init()
+{
+ m_part = 0;
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ problemReporterCheckbox->setChecked( config->readBoolEntry( "EnableProblemReporter", true ) );
+ bgParserCheckbox->setChecked( config->readBoolEntry( "EnableCppBgParser", true ) );
+ delaySlider->setEnabled( bgParserCheckbox->isChecked() );
+ delaySlider->setValue( config->readNumEntry( "BgParserDelay", 500 ) );
+ setDelayLabel( delaySlider->value() );
+}
+
+void ConfigureProblemReporter::destroy()
+{}
+
+void ConfigureProblemReporter::setPart( CppSupportPart* part )
+{
+ m_part = part;
+ if ( !m_part )
+ return ;
+
+ QString conf_file_name = m_part->specialHeaderName();
+ if ( QFile::exists( conf_file_name ) )
+ {
+ QFile f( conf_file_name );
+ if ( f.open( IO_ReadOnly ) )
+ {
+ QTextStream stream( &f );
+ specialHeader->setText( stream.read() );
+ f.close();
+ }
+ }
+}
+
+void ConfigureProblemReporter::accept()
+{
+ KConfig * config = kapp->config();
+ config->setGroup( "General Options" );
+ config->writeEntry( "EnableProblemReporter", problemReporterCheckbox->isChecked() );
+ config->writeEntry( "EnableCppBgParser", bgParserCheckbox->isChecked() );
+ if ( bgParserCheckbox->isChecked() )
+ config->writeEntry( "BgParserDelay", delaySlider->value() );
+ config->sync();
+
+ m_part->updateBackgroundParserConfig();
+
+
+ if ( m_part && specialHeader->isModified() )
+ {
+ QString conf_file_name = m_part->specialHeaderName( true );
+ QFile f( conf_file_name );
+ if ( f.open( IO_WriteOnly ) )
+ {
+ QTextStream stream( &f );
+ stream << specialHeader->text();
+ f.close();
+
+ m_part->updateParserConfiguration();
+ }
+ }
+}
+
+void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b )
+{
+ delaySlider->setEnabled( b );
+ if ( b == TRUE )
+ delayLabel->show();
+ else
+ delayLabel->hide();
+}
+
+
+void ConfigureProblemReporter::setDelayLabel( int delay )
+{
+ delayLabel->setText( i18n( "delay: %1 msec" ).arg( delay ) );
+}
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/configuration b/languages/cpp/configuration
new file mode 100644
index 00000000..bbdc5f4f
--- /dev/null
+++ b/languages/cpp/configuration
@@ -0,0 +1,2 @@
+// add your favorite macros here
+
diff --git a/languages/cpp/cpp_tags.h b/languages/cpp/cpp_tags.h
new file mode 100644
index 00000000..077fbd82
--- /dev/null
+++ b/languages/cpp/cpp_tags.h
@@ -0,0 +1,432 @@
+//
+//
+// C++ Interface: cpp_tags
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CPP_TAGS_H
+#define CPP_TAGS_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+template <class Tag>
+class CppBaseClass
+{
+public:
+ CppBaseClass( Tag& tag )
+ : m_tag( tag )
+ {
+ m_info.flags = tag.flags();
+ }
+
+ operator Tag& ()
+ {
+ return asTag();
+ }
+ Tag& asTag()
+ {
+ return m_tag;
+ }
+
+ operator const Tag& () const
+ {
+ return asTag();
+ }
+ const Tag& asTag() const
+ {
+ return m_tag;
+ }
+
+ static QString format( const Tag& tag )
+ {
+ return QString::null;
+ }
+
+ int access() const
+ {
+ return m_info.data.access;
+ }
+
+ void setAccess( int access )
+ {
+ m_info.data.access = access;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isVirtual() const
+ {
+ return m_info.data.isVirtual;
+ }
+
+ void setVirtual( bool b )
+ {
+ m_info.data.isVirtual = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ QString name() const
+ {
+ return m_tag.name();
+ }
+
+ void setName( const QString& name )
+ {
+ m_tag.setName( name );
+ }
+
+ QString baseClass() const
+ {
+ return m_tag.attribute( "b" ).toString();
+ }
+
+ void setBaseClass( const QString& baseClass )
+ {
+ m_tag.setAttribute( "b", baseClass );
+ }
+
+private:
+ Tag& m_tag;
+ union
+ {
+ unsigned long flags;
+ struct
+ {
+ unsigned long access:
+ 3;
+ unsigned long isVirtual:
+ 1;
+ }
+ data;
+ } m_info;
+};
+
+template <class Tag>
+class CppVariable
+{
+public:
+ CppVariable( Tag& tag )
+ : m_tag( tag )
+ {
+ m_info.flags = tag.flags();
+ }
+
+ operator Tag& ()
+ {
+ return asTag();
+ }
+ Tag& asTag()
+ {
+ return m_tag;
+ }
+
+ operator const Tag& () const
+ {
+ return asTag();
+ }
+ const Tag& asTag() const
+ {
+ return m_tag;
+ }
+
+ static QString format( const Tag& tag )
+ {
+ return QString::null;
+ }
+
+ int access() const
+ {
+ return m_info.data.access;
+ }
+
+ void setAccess( int access )
+ {
+ m_info.data.access = access;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isFriend() const
+ {
+ return m_info.data.isFriend;
+ }
+
+ void setFriend( bool b )
+ {
+ m_info.data.isFriend = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isStatic() const
+ {
+ return m_info.data.isStatic;
+ }
+
+ void setStatic( bool b )
+ {
+ m_info.data.isStatic = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ QString type() const
+ {
+ return m_tag.attribute( "t" ).toString();
+ }
+
+ void setType( const QString& type )
+ {
+ m_tag.setAttribute( "t", type );
+ }
+
+ QString name() const
+ {
+ return m_tag.name();
+ }
+
+ void setName( const QString& name )
+ {
+ m_tag.setName( name );
+ }
+
+private:
+ Tag& m_tag;
+ union
+ {
+ unsigned long flags;
+ struct
+ {
+ unsigned long access:
+ 3;
+ unsigned long isStatic:
+ 1;
+ unsigned long isFriend:
+ 1;
+ }
+ data;
+ } m_info;
+};
+
+template <class Tag>
+class CppFunction
+{
+public:
+ CppFunction( Tag& tag )
+ : m_tag( tag )
+ {
+ m_info.flags = tag.flags();
+ }
+
+ operator Tag& ()
+ {
+ return asTag();
+ }
+ Tag& asTag()
+ {
+ return m_tag;
+ }
+
+ operator const Tag& () const
+ {
+ return asTag();
+ }
+ const Tag& asTag() const
+ {
+ return m_tag;
+ }
+
+ static QString format( const Tag& tag )
+ {
+ return QString::null;
+ }
+
+ int access() const
+ {
+ return m_info.data.access;
+ }
+
+ void setAccess( int access )
+ {
+ m_info.data.access = access;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isSignal() const
+ {
+ return bool( m_info.data.isSignal );
+ }
+
+ void setSignal( bool isSignal )
+ {
+ m_info.data.isSignal = isSignal;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isSlot() const
+ {
+ return bool( m_info.data.isSlot );
+ }
+
+ void setSlot( bool isSlot )
+ {
+ m_info.data.isSlot = isSlot;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isInline() const
+ {
+ return m_info.data.isInline;
+ }
+
+ void setInline( bool b )
+ {
+ m_info.data.isInline = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isPure() const
+ {
+ return m_info.data.isPure;
+ }
+
+ void setPure( bool b )
+ {
+ m_info.data.isPure = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isFriend() const
+ {
+ return m_info.data.isFriend;
+ }
+
+ void setFriend( bool b )
+ {
+ m_info.data.isFriend = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isConst() const
+ {
+ return m_info.data.isConst;
+ }
+
+ void setConst( bool b )
+ {
+ m_info.data.isConst = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isVolatile() const
+ {
+ return m_info.data.isVolatile;
+ }
+
+ void setVolatile( bool b )
+ {
+ m_info.data.isVolatile = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isVirtual() const
+ {
+ return m_info.data.isVirtual;
+ }
+
+ void setVirtual( bool b )
+ {
+ m_info.data.isVirtual = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+ bool isStatic() const
+ {
+ return m_info.data.isStatic;
+ }
+
+ void setStatic( bool b )
+ {
+ m_info.data.isStatic = b;
+ m_tag.setFlags( m_info.flags );
+ }
+
+
+ QString type() const
+ {
+ return m_tag.attribute( "t" ).toString();
+ }
+
+ void setType( const QString& type )
+ {
+ m_tag.setAttribute( "t", type );
+ }
+
+ QString name() const
+ {
+ return m_tag.name();
+ }
+
+ void setName( const QString& name )
+ {
+ m_tag.setName( name );
+ }
+
+ QStringList arguments() const
+ {
+ return m_tag.attribute( "a" ).toStringList();
+ }
+
+ void setArguments( const QStringList args )
+ {
+ m_tag.setAttribute( "a", args );
+ }
+
+ QStringList argumentNames() const
+ {
+ return m_tag.attribute( "an" ).toStringList();
+ }
+
+ void setArgumentNames( const QStringList args )
+ {
+ m_tag.setAttribute( "an", args );
+ }
+
+private:
+ Tag& m_tag;
+ union
+ {
+ unsigned long flags;
+ struct
+ {
+ unsigned long access:
+ 3;
+ unsigned long isInline:
+ 1;
+ unsigned long isVirtual:
+ 1;
+ unsigned long isStatic:
+ 1;
+ unsigned long isPure:
+ 1;
+ unsigned long isFriend:
+ 1;
+ unsigned long isConst:
+ 1;
+ unsigned long isValile:
+ 1;
+ unsigned long isSlot:
+ 1;
+ unsigned long isSignal:
+ 1;
+ }
+ data;
+ } m_info;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cppcodecompletion.cpp b/languages/cpp/cppcodecompletion.cpp
new file mode 100644
index 00000000..27cc9009
--- /dev/null
+++ b/languages/cpp/cppcodecompletion.cpp
@@ -0,0 +1,4492 @@
+/***************************************************************************
+ cppcodecompletion.cpp - description
+ -------------------
+begin : Sat Jul 21 2001
+copyright : (C) 2001 by Victor R�er
+email : victor_roeder@gmx.de
+copyright : (C) 2002,2003 by Roberto Raggi
+email : roberto@kdevelop.org
+copyright : (C) 2005 by Adam Treat
+email : manyoso@yahoo.com
+copyright : (C) 2006,2007 by David Nolden
+email : david.nolden.kdevelop@art-master.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 "cppcodecompletion.h"
+
+
+#include "cppcodecompletionconfig.h"
+#include "backgroundparser.h"
+#include "ast.h"
+#include "ast_utils.h"
+#include "codeinformationrepository.h"
+#include "parser.h"
+#include "lexer.h"
+#include "tree_parser.h"
+#include "cpp_tags.h"
+#include "cppsupport_utils.h"
+#include "tag_creator.h"
+
+#include <typeinfo>
+
+#include <qpopupmenu.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kmessagebox.h>
+#include <kparts/part.h>
+#include <kstatusbar.h>
+#include <ktexteditor/document.h>
+#include <kaction.h>
+
+#include <qdatastream.h>
+#include <qfile.h>
+#include <qmap.h>
+#include <qregexp.h>
+#include <qstatusbar.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qpair.h>
+#include <qvaluestack.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+#include <kdevcoderepository.h>
+#include <codemodel_utils.h>
+#include <codemodel.h>
+#include <codebrowserfrontend.h>
+
+#include "codecompletionentry.h"
+#include "typedesc.h"
+#include "computerecoverypoints.h"
+#include "completiondebug.h"
+#include "bithelpers.h"
+#include "stringhelpers.h"
+#include "simpletype.h"
+#include "simpletypecachebinder.h"
+#include "safetycounter.h"
+#include "cppevaluation.h"
+#include "simplecontext.h"
+#include "simpletypefunction.h"
+
+//#define DISABLE_TRACING
+
+CppCodeCompletion* CppCodeCompletion::m_instance = 0;
+
+const bool disableVerboseForCompletionList = false;
+const bool disableVerboseForContextMenu = false;
+const bool contextMenuEntriesAtTop = false;
+bool showNamespaceAppearances = true;
+
+const char* constructorPrefix = "<constructor>";
+const char* destructorPrefix = "<destructor>";
+///This enables-disables the automatic processing of the expression under the mouse-cursor
+//#define DISABLETOOLTIPS
+
+/**
+-- TODO: Does not yet correctly search for overloaded functions and select the right one
+-- TODO: The documentation shown in the calltips looks very bad, a better solution must be found(maybe an additional tooltip)
+*/
+
+ void statusBarText( const QString& str, int time ) {
+ CppCodeCompletion* c = CppCodeCompletion::instance();
+ if( c )
+ c->addStatusText( str, time );
+ }
+
+TypePointer CppCodeCompletion::createGlobalNamespace() {
+ KSharedPtr<SimpleTypeCachedNamespace> n = new SimpleTypeCachedNamespace( QStringList(), QStringList() );
+ n->addAliases(m_pSupport->codeCompletionConfig()->namespaceAliases() );
+ return n.data();
+}
+
+template <class Item>
+class ItemLocker {
+ public:
+ ItemLocker( Item& it ) : item( it ) {
+ it.lock();
+ }
+ ~ItemLocker() {
+ item.unlock();
+ }
+ private:
+ Item& item;
+};
+
+ParsedFilePointer getParsedFile( CodeModelItem* i ) {
+ if( !i || !i->file() || !i->file()->parseResult() ) return 0;
+ return dynamic_cast<ParsedFile*>( i->file()->parseResult().data());
+}
+
+SafetyCounter safetyCounter;
+CppCodeCompletion* cppCompletionInstance = 0;
+
+//file global functions, must be before any "using namespace"
+QString cleanForMenu( QString txt ) {
+ return txt.replace( "&", "&&" ).replace( " ", " " );
+}
+
+QString buildSignature( TypePointer currType ) {
+ SimpleTypeFunctionInterface * f = currType->asFunction();
+ if ( !f )
+ return "";
+
+ QString ret;
+ LocateResult rtt = currType->locateDecType( f->getReturnType() );
+ if ( rtt->resolved() || rtt.resolutionCount() > 1 )
+ ret = rtt->fullNameChain();
+ else
+ ret = f->getReturnType().fullNameChain();
+
+
+ TypeDesc desc = currType->desc();
+ desc.decreaseFunctionDepth();
+
+ QString sig = ret + " " + desc.fullNameChain() + f->signature();
+ if ( f->isConst() )
+ sig += " const";
+ return sig;
+}
+
+uint PopupTracker::pendingPopups = 0;
+PopupTracker* PopupTracker::pt = 0;
+
+/** Multiple empty lines are reduced to one, too long lines wrapped over, and the beginnings of the lines are normalized
+*/
+QStringList maximumLength( const QStringList& in, int length ) {
+ QStringList ret;
+ uint firstNonSpace = 50000;
+ for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it )
+ for ( uint a = 0; a < ( *it ).length(); a++ )
+ if ( !( *it ) [ a ].isSpace() ) {
+ if ( firstNonSpace > a )
+ firstNonSpace = a;
+ break;
+ }
+ if ( firstNonSpace == 50000 )
+ return QStringList();
+
+ bool hadEmptyLine = false;
+ for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it ) {
+ if ( ( *it ).length() <= firstNonSpace ) {
+ if ( !hadEmptyLine )
+ ret << " ";
+ hadEmptyLine = true;
+ } else {
+ hadEmptyLine = false;
+ QString str = ( *it ).mid( firstNonSpace );
+ while ( !str.isEmpty() ) {
+ if ( (int)str.length() < length ) {
+ ret << str;
+ break;
+ } else {
+ ret << str.left( length ) + "\\";
+ str = str.mid( length );
+ }
+ }
+ }
+ }
+ return ret;
+}
+
+QStringList prepareTextForMenu( const QString& comment, int maxLines, int maxLength ) {
+ QStringList in = QStringList::split( "\n", comment );
+ QStringList out;
+ for ( QStringList::iterator it = in.begin(); it != in.end(); ++it ) {
+ out << cleanForMenu( *it );
+ if ( (int)out.count() >= maxLines ) {
+ out << "[...]";
+ break;
+ }
+ }
+
+ return maximumLength( out, maxLength );
+}
+
+QStringList formatComment( const QString& comment, int maxCols = 120 ) {
+ QStringList ret;
+ SafetyCounter s( 14 ); ///maximum of 14 lines
+
+ QStringList lines = QStringList::split( "\n", comment );
+ for ( QStringList::iterator it = lines.begin(); it != lines.end(); ++it ) {
+ QStringList words = QStringList::split( " ", *it );
+ while ( !words.isEmpty() && s ) {
+ QString line = "? ";
+ int len = 0;
+ while ( !words.isEmpty() && len < maxCols ) {
+ len += words.front().length();
+ line += words.front() + " ";
+ words.pop_front();
+ }
+ ret << line;
+ }
+ }
+ if ( !s )
+ ret << "? comment has too many lines";
+
+ return ret;
+}
+
+bool operator < ( const CodeCompletionEntry& e1, const CodeCompletionEntry& e2 ) {
+ return e1.text < e2.text;
+}
+
+template <class ItemType>
+static QValueList<ItemType> unique( const QValueList<ItemType>& entryList ) {
+
+ QValueList< ItemType > l;
+ QMap<QString, bool> map;
+ typename QValueList< ItemType >::ConstIterator it = entryList.begin();
+ while ( it != entryList.end() ) {
+ CodeCompletionEntry e = *it++;
+ QString key = ( e.type + " " +
+ e.prefix + " " +
+ e.text + " " +
+ e.postfix + " " ).simplifyWhiteSpace().stripWhiteSpace();
+ if ( map.find( key ) == map.end() ) {
+ map[ key ] = TRUE;
+ l << e;
+ }
+ }
+ return l;
+}
+
+static QStringList unique( const QStringList& entryList ) {
+
+ QStringList l;
+ QMap<QString, bool> map;
+ QStringList::ConstIterator it = entryList.begin();
+ while ( it != entryList.end() ) {
+ QString e = *it++;
+ if ( map.find( e ) == map.end() ) {
+ map[ e ] = TRUE;
+ l << e;
+ }
+ }
+ return l;
+}
+
+static QStringList unique( const QValueList<QStringList>& entryList ) {
+
+ QStringList l;
+ QMap<QString, bool> map;
+ QValueList<QStringList>::ConstIterator it = entryList.begin();
+ while ( it != entryList.end() ) {
+ QStringList li = ( *it++ );
+ QString e = li.join( "\n" );
+ if ( map.find( e ) == map.end() ) {
+ map[ e ] = TRUE;
+ l += li;
+ }
+ }
+
+ return l;
+}
+
+
+bool tokenAt( const QString& text, const QString& token, int textPos ) {
+ if ( text.isEmpty() )
+ return false;
+
+ int tokenPos = token.length() - 1;
+ if ( tokenPos <= 0 || textPos <= 0 )
+ return false;
+
+ while ( text[ textPos ] == token[ tokenPos ] ) {
+
+ --tokenPos;
+ --textPos;
+
+ if ( tokenPos == 0 || textPos == 0 ) {
+ if ( tokenPos == 0 ) {
+ if ( textPos >= 1 && text[ textPos ] == token[ tokenPos ] ) {
+ QChar c = text[ textPos - 1 ];
+ return c.isSpace() || c == '{' || c == '}' || c == ';';
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+ return false;
+}
+
+CppSupportPart* CppCodeCompletion::cppSupport() const {
+ return m_pSupport;
+}
+
+using namespace CompletionDebug;
+using namespace StringHelpers;
+using namespace BitHelpers;
+using namespace CppEvaluation;
+
+struct PopupFillerHelpStruct {
+ CppCodeCompletion* receiver;
+ FileList files;
+ CppCodeCompletion::PopupActions& m_popupActions;
+ PopupFillerHelpStruct( CppCodeCompletion* rec ) : m_popupActions( rec->m_popupActions ) {
+ receiver = rec;
+ files = receiver->cppSupport()->codeModel()->fileList();
+ }
+
+ bool shouldShowIncludeMenu() const {
+ return true;
+ }
+
+ QMap<QString, QPopupMenu*> m_namespacePopupCache;
+
+ void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) {
+ Q_UNUSED(prefix);
+
+ QString memType = d.memberTypeToString();
+
+ if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
+ memType = "enum";
+
+ QString txt = i18n( "Jump to %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
+ int id = parent->insertItem( txt, receiver, SLOT( popupAction( int ) ) );
+
+ receiver->m_popupActions.insert( id, d.decl );
+ }
+
+ void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) {
+ Debug dbg( "#insert# ", 10 );
+
+ QString txt1, txt2;
+
+ if ( d.resolved() && d.resolved() ->isNamespace() ) {
+ SimpleTypeCachedNamespace * ns = dynamic_cast<SimpleTypeCachedNamespace*>( d.resolved().data() );
+ if ( ns ) {
+ SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( receiver->getIncludeFiles() );
+ for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) {
+ SimpleTypeCodeModel* cm = dynamic_cast<SimpleTypeCodeModel*>( ( *it ).first.first.resolved().data() );
+ if ( cm && cm->item() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ QString scope = cm->scope().join("::");
+ QMap< QString, QPopupMenu* >::iterator it = m_namespacePopupCache.find( scope );
+ if( it != m_namespacePopupCache.end() ) {
+ parent->insertItem( "Imported Namespace " + scope, *it );
+ delete m;
+ } else {
+ parent->insertItem( "Imported Namespace " + scope, m );
+
+ insertItem( m, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix );
+ m_namespacePopupCache.insert( scope, m );
+ }
+ } else {
+ SimpleTypeNamespace* cn = dynamic_cast<SimpleTypeNamespace*>( ( *it ).first.first.resolved().data() );
+ if( cn ) {
+ TypePointer t = new SimpleTypeNamespace( cn ); //To avoid endless recursion, this needs to be done(the dynamic-cast above fails)
+ insertItem( parent, t->desc(), prefix );
+ }
+ }
+ }
+ return ;
+ }
+ }
+
+ if ( d.resolved() && receiver->cppSupport() ->codeCompletionConfig() ->showNamespaceAppearances() ) {
+ if ( SimpleTypeCachedCodeModel * item = dynamic_cast<SimpleTypeCachedCodeModel*>( d.resolved().data() ) ) { ///(1)
+ if ( item->item() && item->item() ->isNamespace() ) {
+ NamespaceModel* ns = dynamic_cast<NamespaceModel*>( item->item().data() );
+ QStringList wholeScope = ns->scope();
+ wholeScope << ns->name();
+ for( FileList::iterator it = files.begin(); it != files.end(); ++it ) {
+ // if( !safetyCounter ) break;
+ NamespaceModel* ns = (*it).data();
+
+ for( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
+ if( ns->hasNamespace( (*it2) ) ) {
+ ns = ns->namespaceByName( *it2 );
+ if( !ns ) break;
+ } else {
+ ns = 0;
+ break;
+ }
+ }
+
+ if( ns ) {
+ ItemDom i(ns);
+ int sLine, sCol, eLine, eCol;
+ i->getStartPosition( &sLine, &sCol );
+ i->getEndPosition( &eLine, &eCol );
+ insertItem( parent, (new SimpleTypeCodeModel( i ))->desc(), prefix + " " + (*it)->name() + QString(" (%1 Lines): ").arg( eLine - sLine ) ); ///SimpleTypeCodeModel is used instead of SimpleTypeCachedNodeModel, so the detection at (1) does not trigger, this avoids endless recursion.
+ }
+
+ }
+ return;
+ }
+ }
+ }
+
+ if ( d.resolved() ) {
+ if ( d.resolved() ->asFunction() ) {
+ txt1 = prefix + i18n( "Jump to declaration of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) );
+ txt2 = prefix + i18n( "Jump to definition of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) );
+ } else {
+ txt1 = prefix + i18n( "Jump to %1" ).arg( cleanForMenu( d.resolved() ->scope().join( "::" ) ) );
+ }
+ } else {
+ if( !BuiltinTypes::isBuiltin( d ) ) {
+ txt1 = prefix + d.name() + i18n( " is unresolved" );
+ } else {
+ txt1 = prefix + d.name() + i18n( " (builtin " ) + BuiltinTypes::comment( d ) + ")";
+ }
+ }
+
+ int id = parent->insertItem( txt1, receiver, SLOT( popupAction( int ) ) );
+ if ( d.resolved() )
+ receiver->m_popupActions.insert( id, d.resolved() ->getDeclarationInfo() );
+
+ if ( !txt2.isEmpty() ) {
+ int id2 = parent->insertItem( txt2, receiver, SLOT( popupDefinitionAction( int ) ) );
+ if ( d.resolved() )
+ receiver->m_popupDefinitionActions.insert( id2, d.resolved() ->getDeclarationInfo() );
+ }
+ }
+};
+
+ItemDom itemFromScope( const QStringList& scope, NamespaceDom startNamespace ) {
+ if ( scope.isEmpty() )
+ return ItemDom();
+
+ NamespaceDom glob = startNamespace;
+ if ( !glob )
+ return ItemDom();
+
+ ClassModel* curr = glob ;
+
+ QStringList::const_iterator mit = scope.begin();
+
+ while ( curr->isNamespace() && mit != scope.end() && ( ( NamespaceModel* ) curr ) ->hasNamespace( *mit ) ) {
+ curr = &( *( ( ( NamespaceModel* ) curr ) ->namespaceByName( *mit ) ) );
+ ++mit;
+ }
+
+ while ( ( curr->isNamespace() || curr->isClass() ) && mit != scope.end() && curr->hasClass( *mit ) ) {
+ ClassList cl = curr->classByName( *mit );
+ curr = &( **cl.begin() );
+ ++mit;
+ }
+
+ if ( mit != --scope.end() )
+ return ItemDom();
+
+ TypeAliasList l = curr->typeAliasByName( *mit );
+ if ( !l.isEmpty() )
+ return model_cast<ItemDom>( l.front() );
+
+ VariableDom v = curr->variableByName( *mit );
+ if ( v )
+ return model_cast<ItemDom>( v );
+
+ ClassList c = curr->classByName( *mit );
+ if ( !c.isEmpty() )
+ return model_cast<ItemDom>( c.front() );
+
+ EnumDom en = curr->enumByName( *mit );
+ if ( en )
+ return model_cast<ItemDom>( en );
+
+ FunctionList f = curr->functionByName( *mit );
+ if ( !f.isEmpty() )
+ return model_cast<ItemDom>( f.front() );
+
+ FunctionDefinitionList fd = curr->functionDefinitionByName( *mit );
+ if ( !fd.isEmpty() )
+ return model_cast<ItemDom>( fd.front() );
+
+ return ItemDom();
+}
+
+struct PopupClassViewFillerHelpStruct {
+ CppCodeCompletion* receiver;
+ CppCodeCompletion::PopupActions& m_popupActions;
+ PopupClassViewFillerHelpStruct( CppCodeCompletion* rec ) : m_popupActions( rec->m_popupActions ) {
+ receiver = rec;
+ }
+
+ bool shouldShowIncludeMenu() const {
+ return false;
+ }
+
+ void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) {
+ Q_UNUSED(prefix);
+ FileDom f = receiver->m_pSupport->codeModel() ->fileByName( d.decl.file );
+ if ( !f )
+ return ;
+
+ ItemDom dom = itemFromScope( QStringList::split( "::", d.name ), model_cast<NamespaceDom>( f ) );
+
+ QString memType = d.memberTypeToString();
+
+ if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
+ memType = "enum";
+
+ QString txt = i18n( "Show %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
+ int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) );
+
+ receiver->m_popupClassViewActions.insert( id, dom );
+ }
+
+ void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) {
+ Debug dbg( "#insert# ", 10 );
+
+ QString txt;
+ if ( !d.resolved() )
+ return ;
+
+ ItemDom dom;
+
+ if ( d.resolved() ) {
+ SimpleTypeCodeModel * cm = dynamic_cast<SimpleTypeCodeModel*>( d.resolved().data() );
+ if ( cm )
+ dom = cm->item();
+ }
+
+ if ( d.resolved() ) {
+ if ( !dom && d.resolved() ->isNamespace() ) {
+ SimpleTypeCachedNamespace * ns = dynamic_cast<SimpleTypeCachedNamespace*>( d.resolved().data() );
+ if ( ns ) {
+ SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( receiver->getIncludeFiles() );
+ for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) {
+ SimpleTypeCodeModel* cm = dynamic_cast<SimpleTypeCodeModel*>( ( *it ).first.first.resolved().data() );
+ if ( cm && cm->item() ) {
+ insertItem( parent, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix );
+ } else {
+ SimpleTypeNamespace* cn = dynamic_cast<SimpleTypeNamespace*>( ( *it ).first.first.resolved().data() );
+ if( cn ) {
+ TypePointer t = new SimpleTypeNamespace( cn ); //to avoid endless recursion (caching would be better)
+ insertItem( parent, t->desc(), prefix );
+ }
+ }
+ }
+ return ;
+ }
+ } else {
+ if ( dom ) {
+ QString n = d.resolved() ->scope().join( "::" );
+ //QString n = d.fullNameChain();
+ if ( d.resolved() ->asFunction() ) {
+ n = buildSignature( d.resolved() );
+ }
+ txt = prefix + i18n( "Show %1" ).arg( cleanForMenu( n ) );
+ } else {
+ txt = prefix + d.name() + " not in code-model";
+ }
+ }
+ } else {
+ if( !BuiltinTypes::isBuiltin( d ) ) {
+ txt = prefix + d.name() + i18n( " is unresolved" );
+ } else {
+ txt = prefix + d.name() + i18n( " (builtin " ) + BuiltinTypes::comment( d ) + ")";
+ }
+ }
+
+ int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) );
+
+ if ( dom )
+ receiver->m_popupClassViewActions.insert( id, dom );
+ }
+};
+
+template <class HelpStruct = PopupFillerHelpStruct>
+class PopupFiller {
+ HelpStruct struk;
+ QString depthAdd;
+ SafetyCounter s;
+ public:
+ PopupFiller( HelpStruct str , QString dAdd, int maxCount = 100 ) : struk( str ), depthAdd( dAdd ), s( maxCount ) {}
+
+
+ void fillIncludes( const DeclarationInfo& decl, QPopupMenu* parent, bool& needSeparator ) {
+ if( !struk.receiver->getIncludeFiles()[ HashedString( decl.file ) ] ) {
+ QString file = decl.file;
+ //The include-file seems to be missing
+ if( needSeparator ) {
+ needSeparator = false;
+ parent->insertSeparator();
+ }
+
+ QString includeFile = file;
+ QFileInfo info( file );
+
+ Driver* driver = struk.receiver->cppSupport()->driver();
+ if( driver ) {
+ QStringList elements = QStringList::split( "/", file );
+ includeFile = elements.back();
+ elements.pop_back();
+
+ Dependence d;
+ d.first = includeFile;
+ d.second = Dep_Local;
+ while( driver->findIncludeFile( d, struk.receiver->activeFileName() ) != file && !elements.empty() ) {
+ //kdDebug( 9007 ) << "could not find include-file \"" << d.first << "\"" << endl;
+ includeFile = elements.back() + "/" + includeFile;
+ d.first = includeFile;
+ elements.pop_back();
+ }
+ if( elements.empty() )
+ includeFile = "/" + includeFile;
+
+ //kdDebug( 9007 ) << "found include-file \"" << includeFile << "\"" << endl;
+ }
+ int id = parent->insertItem( i18n( "#include \"%1\" ( defines %2 )" ).arg ( includeFile ).arg( decl.name ), struk.receiver, SLOT( popupAction( int ) ) );
+ DeclarationInfo fakeDec;
+ fakeDec.name = decl.name;
+ fakeDec.file = includeFile;
+ fakeDec.startLine = -1; //Use startline -1 to indicate that instead of jumping to the file, the file should be included.
+ struk.m_popupActions.insert( id, fakeDec );
+ }
+ }
+
+ void fill( QPopupMenu * parent, LocateResult d, QString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) {
+ Debug dbg( "#fl# ", 10 )
+ ;
+
+
+ if ( !s || !dbg ) {
+ //dbgMajor() << "safety-counter triggered while filling \"" << d.fullNameChain() << "\"" << endl;
+ return ;
+ }
+
+ if ( !sourceVariable.name.isEmpty() && sourceVariable.name != "this" ) {
+ SimpleTypeImpl::MemberInfo f;
+ f.decl = sourceVariable;
+ f.name = sourceVariable.name;
+ f.type = d.desc();
+ f.memberType = SimpleTypeImpl::MemberInfo::Variable;
+
+ /*int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, SLOT( popupAction( int ) ) );
+
+ m_popupActions.insert( id, type.sourceVariable );*/
+ struk.insertItem( parent, f, prefix );
+
+ parent->insertSeparator();
+
+ if ( !sourceVariable.comment.isEmpty() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Comment on %1" ).arg( sourceVariable.name ), m );
+ QStringList ls = prepareTextForMenu( sourceVariable.comment, 15, 100 );
+ for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ }
+ parent->insertSeparator();
+ }
+ }
+
+ struk.insertItem( parent, d, prefix );
+
+ if( d->resolved() && !d->resolved()->specialization().isEmpty() ) {
+ SimpleType p = d->resolved()->parent();
+ LocateResult r = p->locateDecType( d->name() );
+ if( r ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Specialized from \"%1\"" ).arg( cleanForMenu( r->fullNameChain() ) ), m );
+ fill( m, r );
+ }
+ }
+
+ TypeDesc::TemplateParams p = d->templateParams();
+ for ( TypeDesc::TemplateParams::iterator it = p.begin(); it != p.end(); ++it ) {
+ //if( (*it)->resolved() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Template-param \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
+ fill( m, **it );
+ /*} else {
+ fill( parent, **it, prefix + depthAdd );
+ }*/
+ }
+
+ if ( d->resolved() ) {
+ if ( d->resolved() ->asFunction() ) {
+ LocateResult rt = d->resolved() ->locateDecType( d->resolved() ->asFunction() ->getReturnType() );
+ if ( rt ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Return-type \"%1\"" ).arg( cleanForMenu( rt->fullNameChain() ) ), m );
+ fill( m, rt );
+ }
+
+ QValueList<TypeDesc> args = d->resolved() ->asFunction() ->getArgumentTypes();
+ QStringList argNames = d->resolved() ->asFunction() ->getArgumentNames();
+ if ( !args.isEmpty() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Argument-types" ), m );
+ QStringList::iterator it2 = argNames.begin();
+ for ( QValueList<TypeDesc>::iterator it = args.begin(); it != args.end(); ++it ) {
+ LocateResult at = d->resolved() ->locateDecType( *it );
+ QString name = "";
+ if ( it2 != argNames.end() ) {
+ name = *it2;
+ ++it2;
+ }
+ QPopupMenu * mo = PopupTracker::createPopup( m );
+ m->insertItem( i18n( "Argument \"%1\"" ).arg( cleanForMenu( at->fullNameChain() + " " + name ) ), mo );
+ fill( mo, at );
+
+ }
+ }
+ }
+ }
+#ifndef DISABLE_TRACING
+ if ( d.trace() ) {
+ QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ if ( !trace.isEmpty() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Trace" ), m );
+
+ for ( QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ QPopupMenu * mo = PopupTracker::createPopup( m );
+ QString tail = ( *it ).second.fullNameChain();
+ if ( !tail.isEmpty() )
+ tail = "::" + tail;
+ m->insertItem( i18n( "%1 -> %2" ).arg( cleanForMenu( ( *it ).first.name + tail ) ).arg( cleanForMenu( ( *it ).first.type->fullNameChain() + tail ) ), mo );
+
+ struk.insertItem( mo, ( *it ).first, prefix );
+
+ if ( !( *it ).first.decl.comment.isEmpty() ) {
+ mo->insertSeparator();
+ QPopupMenu * m = PopupTracker::createPopup( mo );
+ mo->insertItem( i18n( "Comment" ), m );
+ QStringList ls = prepareTextForMenu( ( *it ).first.decl.comment, 15, 100 );
+ for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ }
+ }
+
+ /*bool needSeparator = true;
+ if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() )
+ fillIncludes( (*it).first.decl, mo, needSeparator );*/
+ }
+ }
+ }
+#endif
+
+ if ( d->resolved() ) {
+ QValueList<LocateResult> bases = d->resolved() ->getBases();
+ for ( QValueList<LocateResult>::iterator it = bases.begin(); it != bases.end(); ++it ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Base-class \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
+ fill( m, *it );
+ }
+
+ if ( d->resolved() ->parent() && d->resolved() ->parent() ->desc() ) {
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Nested in \"%1\"" ).arg( cleanForMenu( d->resolved() ->parent() ->fullTypeResolved() ) ), m );
+ fill( m, d->resolved() ->parent() ->desc() );
+ }
+
+ if ( !d->resolved() ->comment().isEmpty() ) {
+ parent->insertSeparator();
+ QPopupMenu * m = PopupTracker::createPopup( parent );
+ parent->insertItem( i18n( "Comment on %1" ).arg( cleanForMenu( d->name() ) ), m );
+ QStringList ls = prepareTextForMenu( d->resolved() ->comment(), 15, 100 );
+ for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ }
+ }
+ }
+
+ //Add entries for including missing include-files
+ if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() ) {
+ bool needSeparator = true;
+ //Show the include-files for the whole trace, because usually the first in the trace should be the one to include
+ if ( d.trace() ) {
+ QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ if ( !trace.isEmpty() ) {
+ for ( QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() )
+ fillIncludes( (*it).first.decl, parent, needSeparator );
+ }
+ }
+ }
+
+ //Show the include-file for the item itself
+ if( d->resolved() && !d->resolved()->isNamespace() && struk.receiver->cppSupport() ) {
+ fillIncludes( d->resolved()->getDeclarationInfo(), parent, needSeparator );
+ }
+ }
+ }
+};
+
+struct CompTypeProcessor : public TypeProcessor {
+ SimpleType m_scope;
+ bool m_processArguments;
+
+ CompTypeProcessor( SimpleType scope, bool processArguments ) : m_scope( scope ), m_processArguments( processArguments ) {}
+
+ virtual QString parentType() {
+ return m_scope->fullType();
+ }
+
+ virtual QString processType( const QString& type ) {
+ if ( !m_processArguments )
+ return type;
+ LocateResult t = m_scope->locateDecType( type );
+ if ( t )
+ return t->fullNameChain();
+ else
+ return type;
+ }
+};
+
+struct CppCodeCompletionData {
+ QPtrList<RecoveryPoint> recoveryPoints;
+ //QStringList classNameList;
+
+ CppCodeCompletionData() {
+ recoveryPoints.setAutoDelete( true );
+ }
+
+ RecoveryPoint* findRecoveryPoint( int line, int column ) {
+ if ( recoveryPoints.count() == 0 )
+ return 0;
+
+ QPair<int, int> pt = qMakePair( line, column );
+
+ QPtrListIterator<RecoveryPoint> it( recoveryPoints );
+ RecoveryPoint* recPt = 0;
+
+ while ( it.current() ) {
+ QPair<int, int> startPt = qMakePair( it.current() ->startLine, it.current() ->startColumn );
+ QPair<int, int> endPt = qMakePair( it.current() ->endLine, it.current() ->endColumn );
+
+ if ( pt < startPt ) {
+ break;
+ }
+
+ if ( startPt < pt && pt < endPt )
+ recPt = it.current();
+
+ ++it;
+ }
+
+ return recPt;
+ }
+
+};
+
+CppCodeCompletion::CppCodeCompletion( CppSupportPart* part )
+ : d( new CppCodeCompletionData ),
+ //Matches on includes
+ m_includeRx( "^\\s*#\\s*include\\s+[\"<]" ),
+ //Matches on C++ and C style comments as well as literal strings
+ m_cppCodeCommentsRx( "(//([^\n]*)(\n|$)|/\\*.*\\*/|\"([^\\\\]|\\\\.)*\")" ),
+ //Matches on alpha chars and '.'
+ m_codeCompleteChRx( "([A-Z])|([a-z])|(\\.)" ),
+ //Matches on "->" and "::"
+m_codeCompleteCh2Rx( "(->)|(\\:\\:)" ) {
+ m_instance = this;
+ cppCompletionInstance = this;
+ m_cppCodeCommentsRx.setMinimal( true );
+
+ m_pSupport = part;
+
+ connect( m_pSupport->codeCompletionConfig(), SIGNAL( stored() ), this, SLOT( emptyCache() ) );
+
+ m_activeCursor = 0;
+ m_activeEditor = 0;
+ m_activeCompletion = 0;
+ m_activeHintInterface = 0;
+ m_activeView = 0;
+ m_ccTimer = new QTimer( this );
+ m_showStatusTextTimer = new QTimer( this );
+
+ m_ccLine = 0;
+ m_ccColumn = 0;
+ connect( m_ccTimer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) );
+ connect( m_showStatusTextTimer, SIGNAL( timeout() ), this, SLOT( slotStatusTextTimeout() ) );
+
+ computeFileEntryList();
+
+ CppSupportPart* cppSupport = m_pSupport;
+ connect( cppSupport->project(), SIGNAL( addedFilesToProject( const QStringList& ) ),
+ this, SLOT( computeFileEntryList() ) );
+ connect( cppSupport->project(), SIGNAL( removedFilesFromProject( const QStringList& ) ),
+ this, SLOT( computeFileEntryList() ) );
+ connect( cppSupport, SIGNAL( synchronousParseReady( const QString&, ParsedFilePointer ) ), this, SLOT( synchronousParseReady( const QString&, ParsedFilePointer ) ) );
+
+ m_bArgHintShow = false;
+ m_bCompletionBoxShow = false;
+ m_blockForKeyword = false;
+ m_demandCompletion = false;
+ m_completionMode = NormalCompletion;
+
+ m_repository = new CodeInformationRepository( cppSupport->codeRepository() );
+
+ connect( cppSupport->codeRepository(), SIGNAL(catalogRegistered( Catalog* )), this, SLOT( emptyCache() ) );
+ connect( cppSupport->codeRepository(), SIGNAL(catalogUnregistered( Catalog* )), this, SLOT( emptyCache() ) );
+ connect( cppSupport->codeRepository(), SIGNAL(catalogChanged( Catalog* )), this, SLOT( emptyCache() ) );
+
+ setupCodeInformationRepository();
+
+ if ( part->partController() ->parts() ) {
+ QPtrListIterator<KParts::Part> it( *part->partController() ->parts() );
+ while ( KParts::Part * part = it.current() ) {
+ integratePart( part );
+ ++it;
+ }
+ }
+
+ if ( part->partController() ->activePart() )
+ slotActivePartChanged( part->partController() ->activePart() );
+
+ connect( part->partController( ), SIGNAL( partAdded( KParts::Part* ) ),
+ this, SLOT( slotPartAdded( KParts::Part* ) ) );
+ connect( part->partController( ), SIGNAL( activePartChanged( KParts::Part* ) ),
+ this, SLOT( slotActivePartChanged( KParts::Part* ) ) );
+
+ connect( part, SIGNAL( fileParsed( const QString& ) ),
+ this, SLOT( slotFileParsed( const QString& ) ) );
+ connect( part, SIGNAL( codeModelUpdated( const QString& ) ),
+ this, SLOT( slotCodeModelUpdated( const QString& ) ) );
+
+ KAction * action = new KAction( i18n("Jump to declaration under cursor"), 0, CTRL + Key_Comma,
+ this, SLOT(slotJumpToDeclCursorContext()), part->actionCollection(), "jump_to_declaration_cursor_context" );
+ action->plug( &m_DummyActionWidget );
+
+ action = new KAction( i18n("Jump to definition under cursor"), 0, CTRL + Key_Period,
+ this, SLOT(slotJumpToDefCursorContext()), part->actionCollection(), "jump_to_defintion_cursor_context" );
+ action->plug( &m_DummyActionWidget );
+}
+
+CppCodeCompletion::~CppCodeCompletion( ) {
+ delete m_repository;
+ delete d;
+}
+
+void CppCodeCompletion::addStatusText( QString text, int timeout ) {
+ m_statusTextList.append( QPair<int, QString>( timeout, text ) );
+ if ( !m_showStatusTextTimer->isActive() ) {
+ slotStatusTextTimeout();
+ }
+}
+
+void CppCodeCompletion::clearStatusText() {
+ m_statusTextList.clear();
+ m_showStatusTextTimer->stop();
+}
+
+void CppCodeCompletion::slotStatusTextTimeout() {
+ if ( m_statusTextList.isEmpty() || !m_pSupport )
+ return ;
+// m_pSupport->mainWindow() ->statusBar() ->message( m_statusTextList.front().second, m_statusTextList.front().first );
+ m_showStatusTextTimer->start( m_statusTextList.front().first , true );
+ m_statusTextList.pop_front();
+}
+
+void CppCodeCompletion::slotTimeout() {
+ if ( !m_activeCursor || !m_activeEditor || !m_activeCompletion )
+ return ;
+
+ uint nLine, nCol;
+ m_activeCursor->cursorPositionReal( &nLine, &nCol );
+
+ if ( nLine != m_ccLine || nCol != m_ccColumn )
+ return ;
+
+ QString textLine = m_activeEditor->textLine( nLine );
+ QChar ch = textLine[ nCol ];
+ if ( ch.isLetterOrNumber() || ch == '_' )
+ return ;
+
+ completeText();
+}
+
+void CppCodeCompletion::slotArgHintHidden() {
+ //kdDebug(9007) << "CppCodeCompletion::slotArgHintHidden()" << endl;
+ m_bArgHintShow = false;
+}
+
+void CppCodeCompletion::slotCompletionBoxHidden() {
+ //kdDebug( 9007 ) << "CppCodeCompletion::slotCompletionBoxHidden()" << endl;
+ m_bCompletionBoxShow = false;
+}
+
+
+void CppCodeCompletion::integratePart( KParts::Part * part ) {
+ if ( !part || !part->widget() )
+ return ;
+
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
+ if ( doc ) {
+ kdDebug( 9007 ) << k_funcinfo << "integrate document: " << doc << endl;
+
+ if ( m_pSupport ) { //The slot should connected even when automatic completion is disabled, so it can be enabled any time
+ kdDebug( 9007 ) << k_funcinfo << "enabling code completion" << endl;
+ connect( part, SIGNAL( textChanged() ), this, SLOT( slotTextChanged() ) );
+ connect( part->widget(), SIGNAL( completionDone() ), this,
+ SLOT( slotCompletionBoxHidden() ) );
+ connect( part->widget(), SIGNAL( completionAborted() ), this,
+ SLOT( slotCompletionBoxHidden() ) );
+ connect( part->widget(), SIGNAL( argHintHidden() ), this,
+ SLOT( slotArgHintHidden() ) );
+ }
+ }
+}
+
+void CppCodeCompletion::slotPartAdded( KParts::Part * part ) {
+ integratePart( part );
+}
+
+void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) {
+ emptyCache();
+ this->d->recoveryPoints.clear();
+ if ( m_activeHintInterface && m_activeView ) {
+ disconnect( m_activeView , SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) );
+
+ m_activeHintInterface = 0;
+ }
+ if ( !part )
+ return ;
+
+ kdDebug( 9007 ) << k_funcinfo << endl;
+
+ m_activeFileName = QString::null;
+
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
+ if ( !doc )
+ return ;
+
+ m_activeFileName = doc->url().path();
+
+ // if the interface stuff fails we should disable codecompletion automatically
+ m_activeEditor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ if ( !m_activeEditor ) {
+ kdDebug( 9007 ) << "Editor doesn't support the EditDocumentIface" << endl;
+ return ;
+ }
+
+ m_activeCursor = dynamic_cast<KTextEditor::ViewCursorInterface*>( part->widget() );
+ if ( !m_activeCursor ) {
+ kdDebug( 9007 ) << "The editor doesn't support the CursorDocumentIface!" << endl;
+ return ;
+ }
+
+ m_activeCompletion = dynamic_cast<KTextEditor::CodeCompletionInterface*>( part->widget() );
+ if ( !m_activeCompletion ) {
+ kdDebug( 9007 ) << "Editor doesn't support the CompletionIface" << endl;
+ return ;
+ }
+
+ m_activeView = part ? dynamic_cast<KTextEditor::View*>( part->widget() ) : 0;
+
+ if ( m_activeView )
+ m_activeHintInterface = dynamic_cast<KTextEditor::TextHintInterface*>( m_activeView );
+
+ char* q = 0;
+ kdDebug() << q << endl;
+
+ if ( m_activeHintInterface ) {
+#ifndef DISABLETOOLTIPS
+ m_activeHintInterface->enableTextHints( 500 );
+ connect( m_activeView, SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) );
+#endif
+
+ } else {
+ kdDebug( 9007 ) << "editor has no text-hint-interface" << endl;
+ }
+
+ kdDebug( 9007 ) << k_funcinfo << "-- end" << endl;
+}
+
+void CppCodeCompletion::slotTextChanged() {
+ m_ccTimer->stop();
+
+ if ( !m_activeCursor )
+ return ;
+
+ unsigned int nLine, nCol;
+ m_activeCursor->cursorPositionReal( &nLine, &nCol );
+
+ QString strCurLine = m_activeEditor->textLine( nLine );
+ QString ch = strCurLine.mid( nCol - 1, 1 );
+ QString ch2 = strCurLine.mid( nCol - 2, 2 );
+
+ // Tell the completion box to _go_away_ when the completion char
+ // becomes empty or whitespace and the box is already showing.
+ // !!WARNING!! This is very hackish, but KTE doesn't offer a way
+ // to tell the completion box to _go_away_
+ if ( ch.simplifyWhiteSpace().isEmpty() &&
+ !strCurLine.simplifyWhiteSpace().contains( "virtual" ) &&
+ m_bCompletionBoxShow ) {
+ QValueList<KTextEditor::CompletionEntry> entryList;
+ m_bCompletionBoxShow = true;
+ m_activeCompletion->showCompletionBox( entryList, 0 );
+ }
+
+ m_ccLine = 0;
+ m_ccColumn = 0;
+
+ bool argsHint = m_pSupport->codeCompletionConfig() ->automaticArgumentsHint();
+ bool codeComplete = m_pSupport->codeCompletionConfig() ->automaticCodeCompletion();
+ bool headComplete = codeComplete; //m_pSupport->codeCompletionConfig() ->automaticHeaderCompletion();
+
+ // m_codeCompleteChRx completes on alpha chars and '.'
+ // m_codeCompleteCh2Rx completes on "->" and "::"
+
+ if ( ( argsHint && ch == "(" ) ||
+ ( codeComplete && strCurLine.simplifyWhiteSpace().contains( "virtual" ) ) ||
+ ( codeComplete && ( m_codeCompleteChRx.search( ch ) != -1 ||
+ m_codeCompleteCh2Rx.search( ch2 ) != -1 ) ) ||
+ ( headComplete && ( ch == "\"" || ch == "<" ) && m_includeRx.search( strCurLine ) != -1 ) ) {
+ int time;
+ m_ccLine = nLine;
+ m_ccColumn = nCol;
+ if ( ch == "(" )
+ time = m_pSupport->codeCompletionConfig() ->argumentsHintDelay();
+ else
+ time = m_pSupport->codeCompletionConfig() ->codeCompletionDelay();
+ m_ccTimer->start( time, true );
+ }
+
+ fitContextItem( nLine, nCol );
+}
+
+void CppCodeCompletion::fitContextItem( int nLine, int nCol ) {
+ if( !SimpleType::globalNamespace() ) {
+ kdDebug( 9007 ) << "no global namespace was set, clearing cache" << endl;
+ emptyCache();
+ }
+ ///Find out whether the cache may be used on, or has to be cleared.
+ if ( m_cachedFromContext ) {
+ int sLine, sCol, eLine, eCol;
+ m_cachedFromContext->getStartPosition( &sLine, &sCol );
+ m_cachedFromContext->getEndPosition( &eLine, &eCol );
+
+ if ( ( nLine < sLine || ( nLine == sLine && nCol < sCol ) ) || ( nLine > eLine || ( nLine == eLine && nCol >= eCol ) ) ) {
+ ///The stored item was left. First check whether the item was expanded.
+ FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName );
+
+ if ( file ) {
+ CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file );
+ if ( m_cachedFromContext->isClass() ) {
+ ClassDom klass = fileModel.classAt( nLine, nCol );
+ if ( klass ) {
+ ClassDom oldClass = dynamic_cast<ClassModel*>( m_cachedFromContext.data() );
+ if ( oldClass && oldClass->name() == klass->name() && oldClass->scope() == klass->scope() ) {
+ m_cachedFromContext = klass.data();
+ } else {
+ emptyCache();
+ }
+ } else {
+ emptyCache();
+ }
+ } else if ( m_cachedFromContext->isFunction() ) {
+ FunctionDom function = fileModel.functionAt( nLine, nCol );
+ if ( function ) {
+ FunctionDom oldFunction = dynamic_cast<FunctionModel*>( m_cachedFromContext.data() );
+ if ( oldFunction && oldFunction->name() == function->name() && function->scope() == oldFunction->scope() && oldFunction->argumentList().count() == function->argumentList().count() ) {
+ ArgumentList l1 = oldFunction->argumentList();
+ ArgumentList l2 = function->argumentList();
+ ArgumentList::iterator it = l1.begin();
+ ArgumentList::iterator it2 = l2.begin();
+ bool match = true;
+ while ( it != l1.end() ) {
+ if ( ( *it ) ->type() != ( *it2 ) ->type() ) {
+ match = false;
+ break;
+ }
+ ++it;
+ ++it2;
+ }
+ if ( match ) {
+ m_cachedFromContext = function.data();
+ } else {
+ emptyCache();
+ }
+
+ } else {
+ emptyCache();
+ }
+ } else {
+ emptyCache();
+ }
+ } else {
+ emptyCache();
+ }
+ } else {
+ emptyCache();
+ }
+ }
+ }
+}
+
+enum { T_ACCESS, T_PAREN, T_BRACKET, T_IDE, T_UNKNOWN, T_TEMP };
+
+QString CppCodeCompletion::replaceCppComments( const QString& contents ) {
+ QString text = contents;
+
+ int pos = 0;
+ while ( ( pos = m_cppCodeCommentsRx.search( text, pos ) ) != -1 ) {
+ if ( m_cppCodeCommentsRx.cap( 1 ).startsWith( "//" ) ) {
+ QString before = m_cppCodeCommentsRx.cap( 1 );
+ QString after;
+ after.fill( ' ', before.length() - 5 );
+ after.prepend( "/*" );
+ after.append( "*/" );
+ text.replace( pos, before.length() - 1, after );
+ pos += after.length();
+ } else {
+ pos += m_cppCodeCommentsRx.matchedLength();
+ }
+ }
+ return text;
+}
+
+int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
+ kdDebug( 9007 ) << k_funcinfo << endl;
+
+ /* C++ style comments present issues with finding the expr so I'm
+ matching for them and replacing them with empty C style comments
+ of the same length for purposes of finding the expr. */
+
+ QString text = clearComments( contents );
+
+ int last = T_UNKNOWN;
+ int start = index;
+ --index;
+
+ while ( index > 0 ) {
+ while ( index > 0 && text[ index ].isSpace() ) {
+ --index;
+ }
+
+ QChar ch = text[ index ];
+ QString ch2 = text.mid( index - 1, 2 );
+ if ( ( last != T_IDE ) && ( ch.isLetterOrNumber() || ch == '_' ) ) {
+ while ( index > 0 && ( text[ index ].isLetterOrNumber() || text[ index ] == '_' ) ) {
+ --index;
+ }
+ last = T_IDE;
+ } else if ( last != T_IDE && ch == ')' ) {
+ int count = 0;
+ while ( index > 0 ) {
+ QChar ch = text[ index ];
+ if ( ch == '(' ) {
+ ++count;
+ } else if ( ch == ')' ) {
+ --count;
+ } else if ( count == 0 ) {
+ //index;
+ last = T_PAREN;
+ break;
+ }
+ --index;
+ }
+ } else if ( last != T_IDE && ch == '>' && ch2 != "->" ) {
+ int count = 0;
+ while ( index > 0 ) {
+ QChar ch = text[ index ];
+ if ( ch == '<' ) {
+ ++count;
+ } else if ( ch == '>' ) {
+ --count;
+ } else if ( count == 0 ) {
+ //--index;
+ last = T_TEMP;
+ break;
+ }
+ --index;
+ }
+ } else if ( ch == ']' ) {
+ int count = 0;
+ while ( index > 0 ) {
+ QChar ch = text[ index ];
+ if ( ch == '[' ) {
+ ++count;
+ } else if ( ch == ']' ) {
+ --count;
+ } else if ( count == 0 ) {
+ //--index;
+ last = T_BRACKET;
+ break;
+ }
+ --index;
+ }
+ } else if ( ch == '.' ) {
+ --index;
+ last = T_ACCESS;
+ } else if ( ch2 == "::" ) {
+ index -= 2;
+ last = T_ACCESS;
+ } else if ( ch2 == "->" ) {
+ index -= 2;
+ last = T_ACCESS;
+ } else {
+ if ( start > index ) {
+ ++index;
+ }
+ last = T_UNKNOWN;
+ break;
+ }
+ }
+
+ ///If we're at the first item, the above algorithm cannot be used safely,
+ ///so just determine whether the sign is valid for the beginning of an expression, if it isn't reject it.
+ if ( index == 0 && start > index && !( text[ index ].isLetterOrNumber() || text[ index ] == '_' || text[ index ] == ':' ) ) {
+ ++index;
+ }
+
+ return index;
+}
+
+QStringList CppCodeCompletion::splitExpression( const QString& text ) {
+#define ADD_CURRENT()\
+ if( current.length() ) { l << current; /*kdDebug(9007) << "add word " << current << endl;*/ current = ""; }
+
+ QStringList l;
+ uint index = 0;
+ QString current;
+ while ( index < text.length() ) {
+ QChar ch = text[ index ];
+ QString ch2 = text.mid( index, 2 );
+
+ if ( ch == '.' ) {
+ current += ch;
+ ADD_CURRENT();
+ ++index;
+ } else if ( ch == '(' ) {
+ int count = 0;
+ while ( index < text.length() ) {
+ QChar ch = text[ index ];
+ if ( ch == '(' ) {
+ ++count;
+ } else if ( ch == ')' ) {
+ --count;
+ } else if ( count == 0 ) {
+ break;
+ }
+ current += ch;
+ ++index;
+ }
+ } else if ( ch == '[' ) {
+ int count = 0;
+ while ( index < text.length() ) {
+ QChar ch = text[ index ];
+ if ( ch == '[' ) {
+ ++count;
+ } else if ( ch == ']' ) {
+ --count;
+ } else if ( count == 0 ) {
+ break;
+ }
+ current += ch;
+ ++index;
+ }
+ } else if ( ch2 == "->" ) {
+ current += ch2;
+ ADD_CURRENT();
+ index += 2;
+ } /*else if ( ch2 == "::" )
+ {
+ current += ch2;
+ ADD_CURRENT();
+ index += 2;
+ }*/
+ else {
+ current += text[ index ];
+ ++index;
+ }
+ }
+ ADD_CURRENT();
+ return l;
+}
+
+///Before calling this, a SimpleTypeConfiguration-object should be created, so that the ressources will be freed when that object is destroyed
+EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column , SimpleTypeConfiguration& conf, bool ifUnknownSetType ) {
+ kdDebug( 9007 ) << "CppCodeCompletion::evaluateExpressionAt( " << line << ", " << column << " )" << endl;
+
+ if ( !m_pSupport || !m_activeEditor )
+ return EvaluationResult();
+ if ( line < 0 || line >= ( int ) m_activeEditor->numLines() )
+ return EvaluationResult();
+ if ( column < 0 || column >= m_activeEditor->lineLength( line ) )
+ return EvaluationResult();
+
+ {
+ QString curLine = m_activeEditor->textLine( line );
+
+ ///move column to the last letter of the pointed word
+ while ( column + 1 < ( int ) curLine.length() && isValidIdentifierSign( curLine[ column ] ) && isValidIdentifierSign( curLine[ column + 1 ] ) )
+ column++;
+
+ //if( column > 0 ) column--;
+
+ if ( column >= ( int ) curLine.length() || curLine[ column ].isSpace() )
+ return EvaluationResult();
+
+ QString expr = curLine.left( column + 1 );
+ kdDebug( 9007 ) << "evaluating line \"" << expr.stripWhiteSpace() << "\"" << endl;
+
+ if ( curLine[ column ] == '-' || curLine[ column ] == ';' )
+ --column;
+
+ EvaluationResult type = evaluateExpressionType( line, column + 1, conf, ifUnknownSetType ? addFlag( DefaultEvaluationOptions, DefaultAsTypeExpression ) : DefaultEvaluationOptions );
+
+ kdDebug( 9007 ) << "type: " << type->fullNameChain() << endl;
+
+ return type;
+ }
+}
+
+void CppCodeCompletion::popupAction( int number ) {
+ PopupActions::iterator it = m_popupActions.find( number );
+ if ( it != m_popupActions.end() ) {
+ QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString();
+ if( (*it).startLine == -1 ) {
+ //startLine -1 indicates that the file should be added to the include-files
+ m_activeEditor->insertLine( 0, QString("#include \"%1\" /* defines %2 */").arg( fileName ).arg( (*it).name ) );
+ } else {
+ m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine );
+ }
+ } else {
+ kdDebug( 9007 ) << "error" << endl;
+ }
+}
+
+void CppCodeCompletion::popupDefinitionAction( int number ) {
+ PopupActions::iterator it = m_popupDefinitionActions.find( number );
+ if ( it != m_popupDefinitionActions.end() ) {
+ QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString();
+ if ( !m_pSupport->switchHeaderImpl( fileName, ( *it ).startLine, ( *it ).startCol ) )
+ m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine );
+ } else {
+ kdDebug( 9007 ) << "error" << endl;
+ }
+}
+
+void CppCodeCompletion::selectItem( ItemDom item ) {
+ Extensions::KDevCodeBrowserFrontend * f = m_pSupport->extension< Extensions::KDevCodeBrowserFrontend > ( "KDevelop/CodeBrowserFrontend" );
+
+ if ( f != 0 ) {
+ ItemDom itemDom( &( *item ) );
+ f->jumpedToItem( itemDom );
+ } else {
+ kdDebug() << "could not find the proper extension" << endl;
+ }
+}
+
+void CppCodeCompletion::popupClassViewAction( int number ) {
+ PopupClassViewActions::iterator it = m_popupClassViewActions.find( number );
+ if ( it != m_popupClassViewActions.end() ) {
+ if ( ( *it ) )
+ selectItem( *it );
+ } else {
+ kdDebug( 9007 ) << "error" << endl;
+ }
+}
+
+void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Context *context, int line, int column ) {
+ clearStatusText();
+ Q_UNUSED(context);
+ if ( !m_pSupport->codeCompletionConfig() ->showEvaluationContextMenu() )
+ return ;
+
+ kdDebug( 9007 ) << "CppCodeCompletion::contextEvaluationMenu()" << endl;
+
+ PopupTracker::print();
+
+ m_popupActions.clear();
+ m_popupDefinitionActions.clear();
+ m_popupClassViewActions.clear();
+
+ if ( !m_pSupport || !m_activeEditor )
+ return ;
+
+ struct SetDbgState {
+ DBGStreamType& st;
+ bool oldState;
+ SetDbgState( DBGStreamType& targ, bool state ) : st( targ ) {
+ oldState = targ.state();
+ targ.setState( state );
+ }
+ ~SetDbgState() {
+ st.setState( oldState );
+ }
+ };
+
+ int cpos = 0;
+
+ SetDbgState stt( dbgState, disableVerboseForContextMenu );
+
+ SimpleTypeConfiguration conf( m_activeFileName );
+
+ EvaluationResult type = evaluateExpressionAt( line, column, conf );
+
+ ///Test if it is a macro
+ if( type.isMacro ) {
+ QPopupMenu * m = PopupTracker::createPopup( popup );
+ int gid;
+ if ( contextMenuEntriesAtTop )
+ gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m, 5, cpos++ );
+ else
+ gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m );
+
+ int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( type.macro.name() ) ), this, SLOT( popupAction( int ) ) );
+ QPopupMenu * b = PopupTracker::createPopup( m );
+ m->insertItem( i18n( "Body" ), b );
+
+ DeclarationInfo i;
+ i.file = type.macro.fileName();
+ i.startCol = type.macro.column();
+ i.startLine = type.macro.line();
+ i.endCol = type.macro.column();
+ i.endLine = type.macro.line();
+ m_popupActions.insert( id, i );
+
+ QStringList ls = prepareTextForMenu( type.macro.body(), 20, 100 );
+ for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ b->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ }
+ }
+
+ ///Test if it is an include-directive
+ QString includeFileName, includeFilePath;
+ bool simpleAlgorithm = false;
+ bool isIncludeDirective = getIncludeInfo( line, includeFileName, includeFilePath, simpleAlgorithm );
+ if( isIncludeDirective ) {
+ ///Add menu entry
+ if( !includeFilePath.isEmpty() ) {
+ int gid;
+ QPopupMenu * m = PopupTracker::createPopup( popup );
+ if ( contextMenuEntriesAtTop )
+ gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m, 5, cpos++ );
+ else
+ gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m );
+
+ int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( includeFilePath ) ), this, SLOT( popupAction( int ) ) );
+
+ DeclarationInfo i;
+ i.file = includeFilePath;
+ i.startCol = 0;
+ i.startLine = 0;
+ i.endCol = 0;
+ i.endLine = 0;
+ m_popupActions.insert( id, i );
+
+ if( simpleAlgorithm && cppSupport()->codeCompletionConfig()->resolveIncludePaths() ) {
+ //Add a notification that the correct algorithm failed in finding the include-file correctly
+ m->insertItem( i18n( "This include-file could not be located regularly, and was selected from the project file list." ) );
+ }
+ } else {
+ ///Could not find include-file
+ if ( contextMenuEntriesAtTop )
+ popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ), 5, cpos++ );
+ else
+ popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ) );
+ }
+ }
+
+ ///Break if we cannot show additional information
+ if ( isIncludeDirective || (!type->resolved() && !type.sourceVariable && ( !type.resultType.trace() || type.resultType.trace() ->trace().isEmpty() ) && !BuiltinTypes::isBuiltin( type.resultType ) ) )
+ return ;
+
+ QString name = type->fullNameChain();
+ if ( type.sourceVariable )
+ name += " " + type.sourceVariable.name;
+ if ( type.resultType->resolved() && type.resultType->resolved() ->asFunction() )
+ name = buildSignature( type.resultType->resolved() );
+
+ ///Fill the jump-menu
+ {
+ PopupFillerHelpStruct h( this );
+ PopupFiller<PopupFillerHelpStruct> filler( h, "" );
+
+ QPopupMenu * m = PopupTracker::createPopup( popup );
+ int gid;
+ if ( contextMenuEntriesAtTop )
+ gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m, 5, cpos++ );
+ else
+ gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m );
+
+ popup->setWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to navigate to positions of items that are involved in this expression" ) );
+
+ /*if( type.sourceVariable && type.sourceVariable.name != "this" ) {
+ int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, SLOT( popupAction( int ) ) );
+
+ m_popupActions.insert( id, type.sourceVariable );
+ }*/
+
+ filler.fill( m, type, "", type.sourceVariable );
+ }
+ if ( type->resolved() ) {
+ ///Now fill the class-view-browsing-stuff
+ {
+ QPopupMenu * m = PopupTracker::createPopup( popup );
+ int gid;
+ if ( contextMenuEntriesAtTop )
+ gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m, 6, cpos++ );
+ else
+ gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m );
+
+ popup->setWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to show involved items in the class-view " ) );
+
+ PopupClassViewFillerHelpStruct h( this );
+ PopupFiller<PopupClassViewFillerHelpStruct> filler( h, "" );
+
+ filler.fill( m, type );
+ }
+ }
+
+ if ( contextMenuEntriesAtTop )
+ popup->insertSeparator( cpos );
+}
+
+void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) {
+ if ( ! m_pSupport->codeCompletionConfig() ->statusBarTypeEvaluation() )
+ return ;
+
+ kdDebug( 9007 ) << "CppCodeCompletion::slotTextHint()" << endl;
+
+ clearStatusText();
+
+ if ( m_lastHintTime.msecsTo( QTime::currentTime() ) < 300 ) {
+ kdDebug( 9007 ) << "slotNeedTextHint called too often" << endl;
+ return ;
+ }
+
+ m_lastHintTime = QTime::currentTime();
+
+ clearStatusText();
+ text = "";
+ if ( !m_pSupport || !m_activeEditor )
+ return ;
+
+ SimpleTypeConfiguration conf( m_activeFileName );
+
+ EvaluationResult type = evaluateExpressionAt( line, column, conf );
+
+ if ( type.expr.expr().stripWhiteSpace().isEmpty() )
+ return ; ///Expression could not be found
+
+ if ( type.sourceVariable ) {
+ text += type.sourceVariable.toText() + "\n";
+ }
+
+ if ( type->resolved() ) {
+ /*SimpleTypeFunctionInterface* f = type->resolved()->asFunction();
+ if( f ) {
+ text += "function: \"" + buildSignature( type->resolved() ) + "\"";
+ } else {
+ QValueList<TypeDesc> trace = type.resultType->trace();
+ if( !trace.isEmpty() ) {
+ for( QValueList<TypeDesc>::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ text += (*it).fullNameChain() + " --> ";
+ }
+ text += "\n";
+ }
+ text += "type: \"" + type.resultType->fullTypeResolved() + "\"";
+ }
+ if( type.resultType->parent()) text += "\nnested in: \"" + type.resultType->parent()->fullTypeResolvedWithScope() + "\"";
+ DeclarationInfo i = type.resultType->getDeclarationInfo();
+ if( i ) text += "\n" + i.locationToText();
+
+ if( !type.resultType->comment().isEmpty() ) text += "\n\n" + type.resultType->comment() + "";*/
+
+ } else {}
+
+ kdDebug( 9007 ) << "showing: \n" << text << endl;
+ const int timeout = 2000;
+
+ if ( type->resolved() ) {
+ addStatusText( i18n( "Type of \"%1\" is \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), timeout );
+ if ( type.sourceVariable && !type.sourceVariable.comment.isEmpty() ) {
+ addStatusText( i18n( "Comment on variable \"%1\": \"%2\"" ).arg( type.sourceVariable.name ).arg( type.sourceVariable.comment ) , 10000 );
+ }
+ if ( !type->resolved() ->comment().isEmpty() ) {
+ addStatusText( i18n( "Comment on \"%1\": \"%2\"" ).arg( type->name() ).arg( type->resolved() ->comment() ) , 10000 );
+ }
+ if ( type->resolved() ->comment().isEmpty() ) {
+ addStatusText( i18n( "\"%1\" has no comment" ).arg( type->name() ) , timeout );
+ }
+ } else {
+ if ( type ) {
+ if( !BuiltinTypes::isBuiltin( type.resultType ) ) {
+ addStatusText( i18n( "Type of \"%1\" is unresolved, name: \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), 2 * timeout );
+ } else {
+ addStatusText( i18n( "\"%1\" is of builtin type \"%2\", a %3" ).arg( type.expr.expr() ).arg( type->fullNameChain() ).arg(BuiltinTypes::comment( type.resultType )), 2 * timeout );
+ }
+
+
+ } else {
+ addStatusText( i18n( "Type of \"%1\" could not be evaluated: tried to evaluate expression as \"%2\"" ).arg( type.expr.expr() ).arg( type.expr.typeAsString() ), 2 * timeout );
+ }
+ }
+
+ text = ""; ///Don't really use tooltips since those are not implemented in katepart, and don't work right in the qt-designer based part
+}
+
+///not good..
+bool CppCodeCompletion::isTypeExpression( const QString& expr ) {
+ TypeDesc d( expr );
+ if ( !d.isValidType() )
+ return false;
+
+ QString ex = d.fullNameChain();
+ QStringList lex = QStringList::split( " ", ex );
+ QStringList lexpr = QStringList::split( " ", expr );
+ return lex.join( " " ) == lexpr.join( " " );
+}
+
+bool CppCodeCompletion::mayBeTypeTail( int line, int column, QString& append, bool inFunction ) {
+ QString tail = clearComments( m_activeEditor->text( line, column + 1, line + 10 > ( int ) m_activeEditor->numLines() ? ( int ) m_activeEditor->numLines() : line + 10, 0 ) );
+ tail.replace( "\n", " " );
+ SafetyCounter s ( 100 );
+ bool hadSpace = false;
+ while ( !tail.isEmpty() && s ) {
+ if ( tail[ 0 ] == ';' ) {
+ return false;
+ } else if ( ( !inFunction && tail[ 0 ] == ',' ) || tail[ 0 ] == '&' || tail[ 0 ] == '*' || tail[ 0 ] == '{' || tail[ 0 ] == ':' ) {
+ return true;
+ } else if ( isTypeOpenParen( tail[ 0 ] ) ) {
+ ///TODO: use findClose to make the whole expression include template-params
+ int to = findClose( tail, 0 );
+ if ( to != -1 ) {
+ append = tail.left( to + 1 );
+ tail = tail.mid( to + 1 );
+ } else {
+ return false;
+ }
+ } else if ( isTypeCloseParen( tail[ 0 ] ) ) {
+ return true;
+ } else if ( tail[ 0 ].isSpace() ) {
+ tail = tail.mid( 1 );
+ hadSpace = true;
+ } else if ( tail[ 0 ].isLetter() ) {
+ return hadSpace;
+ } else {
+ break;
+ }
+ }
+
+ return false;
+}
+
+bool CppCodeCompletion::canBeTypePrefix( const QString& prefix, bool inFunction ) {
+
+ for ( int p = prefix.length() - 1 ; p >= 0; --p ) {
+ if ( prefix[ p ].isSpace() ) {
+ continue;
+ }
+
+ if ( prefix[ p ] == ';' || prefix[ p ] == '<' || prefix[ p ] == ':' || ( !inFunction && ( prefix[ p ] == '(' || prefix[ p ] == ',' ) ) || prefix[ p ] == '}' || prefix[ p ] == '{' ) {
+ return true;
+ }
+
+ ///@todo: make this a simple regex
+ if ( prefix[ p ].isLetterOrNumber() && ( tokenAt( prefix, "class", p ) || tokenAt( prefix, "struct", p ) || tokenAt( prefix, "const", p ) || tokenAt( prefix, "typedef", p ) || tokenAt( prefix, "public", p ) || tokenAt( prefix, "protected", p ) || tokenAt( prefix, "private", p ) || tokenAt( prefix, "virtual", p ) || tokenAt( prefix, "static", p ) || tokenAt( prefix, "virtual", p ) ) )
+ return true;
+ else {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+///This function is just a litte hack und should be remade, it doesn't work for all cases
+ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int startLine, int startCol, bool inFunction ) {
+ ExpressionInfo ret;
+
+ QString contents = clearComments( getText( startLine, startCol, line, column ) );
+
+
+ int start_expr = expressionAt( contents, contents.length() );
+
+ if ( start_expr != int( contents.length() ) ) {
+ QString str = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace();
+ if ( str.startsWith( "new " ) ) {
+ str = str.mid( 4 ).stripWhiteSpace();
+ }
+ ret.setExpr( str );
+ if ( !ret.expr().isEmpty() )
+ ret.t = ExpressionInfo::NormalExpression;
+ }
+
+ if ( ret ) {
+ ///Check whether it may be a type-expression
+ bool mayBeType = true;
+ QString append;
+ if ( !mayBeTypeTail( line, column - 1, append, inFunction ) )
+ mayBeType = false;
+ if ( mayBeType ) {
+ if ( !canBeTypePrefix( contents.left( start_expr ), inFunction ) )
+ mayBeType = false;
+ }
+
+ //make this a regexp
+ QString e = ret.expr();
+ if ( e.contains( "." ) || e.contains( "->" ) || e.contains( "(" ) || e.contains( ")" ) || e.contains( "=" ) || e.contains( "-" ) )
+ mayBeType = false;
+
+ if ( mayBeType ) {
+ ret.setExpr( ret.expr() + append );
+ ret.t = ExpressionInfo::TypeExpression;
+ }
+ }
+
+ return ret;
+}
+
+void macrosToDriver( Driver& d, FileDom file ) {
+ return; //Deactivate this for now, because macros can cause inconsistency of line/column-numbers between processed text and the not-processed text of the buffer
+ ParseResultPointer p;
+ if( file )
+ p = file->parseResult();
+ ParsedFile* pf = dynamic_cast<ParsedFile*>( p.data() );
+ if( pf ) {
+ d.insertMacros( pf->usedMacros() ); ///Add macros
+ }
+}
+
+SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int line, int col, SimpleTypeConfiguration& conf ) {
+ Q_UNUSED(conf);
+ if ( !f )
+ return 0;
+ int modelStartLine, modelStartColumn;
+ int modelEndLine, modelEndColumn;
+
+ f->getStartPosition( &modelStartLine, &modelStartColumn );
+ f->getEndPosition( &modelEndLine, &modelEndColumn );
+
+ QString textLine = m_activeEditor->textLine( modelStartLine );
+ kdDebug( 9007 ) << "startLine = " << textLine << endl;
+
+ QString contents = getText( modelStartLine, modelStartColumn, line, col );
+
+ Driver d;
+ Lexer lexer( &d );
+ macrosToDriver( d, f->file() );
+
+ lexer.setSource( contents );
+ Parser parser( &d, &lexer );
+
+ DeclarationAST::Node recoveredDecl;
+ RecoveryPoint* recoveryPoint = this->d->findRecoveryPoint( line, col );///@todo recovery-points are not needed anymore
+
+ parser.parseDeclaration( recoveredDecl );
+ if ( recoveredDecl.get() ) {
+ bool isFunDef = recoveredDecl->nodeType() == NodeType_FunctionDefinition;
+ kdDebug( 9007 ) << "is function definition= " << isFunDef << endl;
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ recoveredDecl->getStartPosition( &startLine, &startColumn );
+ recoveredDecl->getEndPosition( &endLine, &endColumn );
+ /*if( startLine != modelStartLine || endLine != modelEndLine || startColumn != modelStartColumn || endColumn != modelEndColumn ) {
+ kdDebug( 9007 ) << "code-model and real file are out of sync \nfunction-bounds in code-model: " << endl;
+ kdDebug( 9007 ) << "(l " << modelStartLine << ", c " << modelStartColumn << ") - (l " << modelEndLine << ", c " << modelEndColumn << ") " << "parsed function-bounds: " << endl;
+ kdDebug( 9007 ) << "(l " << startLine << ", c " << startColumn << ") - (l " << endLine << ", c " << endColumn << ") " << endl;
+ }*/
+
+ if ( isFunDef ) {
+ FunctionDefinitionAST * def = static_cast<FunctionDefinitionAST*>( recoveredDecl.get() );
+
+ SimpleContext* ctx = computeContext( def, endLine, endColumn, modelStartLine, modelStartColumn );
+ if ( !ctx )
+ return 0;
+
+ QStringList scope = f->scope();
+
+
+ if ( !scope.isEmpty() ) {
+ SimpleType parentType;
+ /* if( !m_cachedFromContext ) {
+ TypePointer t = SimpleType(QStringList())->locateDecType( scope.join("") ).desc().resolved();;
+ if( t )
+ parentType = SimpleType( t.data() );
+ else
+ parentType = SimpleType( scope );
+ } else {*/
+ parentType = SimpleType( scope, getIncludeFiles() );
+ //}
+ parentType->descForEdit().setTotalPointerDepth( 1 );
+ ctx->setContainer( parentType );
+ }
+
+ SimpleType global = ctx->global();
+
+ if( dynamic_cast<SimpleTypeNamespace*>( &(*global) ) ) {
+ SimpleTypeNamespace* globalNs = static_cast <SimpleTypeNamespace*>( &(*global) );
+ QValueList<QPair<QString, QString> > localImports = ctx->imports();
+ for( QValueList<QPair<QString, QString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ globalNs->addAliasMap( (*it).first, (*it).second );
+ }
+
+ /* //Should not be necessary any more
+ if( !getParsedFile( f->file().data() ) || getParsedFile( f->file().data() )->includeFiles().size() <= 1 ) {
+ if ( !m_cachedFromContext ) {
+ conf.setGlobalNamespace( &( *global ) );
+ if ( recoveryPoint ) {
+ recoveryPoint->registerImports( global, m_pSupport->codeCompletionConfig() ->namespaceAliases() );
+ } else {
+ kdDebug( 9007 ) << "no recovery-point, cannot use imports" << endl;
+ }
+ }
+ }*/
+
+ ///Insert the "this"-type(container) and correctly resolve it using imported namespaces
+ if ( ctx->container() ) {
+ if ( !m_cachedFromContext ) {
+ TypeDesc td = ctx->container() ->desc();
+ td.setIncludeFiles( getIncludeFiles() );
+ td.makePrivate();
+
+ td.resetResolved( );
+ TypePointer tt = ctx->container() ->locateDecType( td, SimpleTypeImpl::LocateBase ) ->resolved();
+ if ( tt ) {
+ ctx->setContainer( SimpleType( tt ) );
+ } else {
+ kdDebug( 9007 ) << "could not resolve local this-type \"" << td.fullNameChain() << "\"" << endl;
+ }
+ }
+
+ SimpleType this_type = ctx->container();
+
+ this_type->descForEdit().setTotalPointerDepth( 1 );
+
+ SimpleVariable var;
+ var.type = this_type->desc();
+ var.name = "this";
+ var.comment = this_type->comment();
+ ctx->add
+ ( var );
+ ctx->setContainer( this_type );
+ }
+
+ return ctx;
+ } else {
+ kdDebug( 9007 ) << "computeFunctionContext: context is no function-definition" << endl;
+ }
+ } else {
+ kdDebug( 9007 ) << "computeFunctionContext: could not find a valid declaration to recover" << endl;
+ }
+ return 0;
+}
+
+bool CppCodeCompletion::functionContains( FunctionDom f , int line, int col ) {
+ if ( !f )
+ return false;
+ int sl, sc, el, ec;
+ f->getStartPosition( &sl, &sc );
+ f->getEndPosition( &el, &ec );
+ QString t = clearComments( getText( sl, sc, el, ec ) );
+ if ( t.isEmpty() )
+ return false;
+
+ //int i = t.find( '{' );
+ int i = t.find( '(' ); //This now includes the argument-list
+ if ( i == -1 )
+ return false;
+ int lineCols = 0;
+ for ( int a = 0; a < i; a++ ) {
+ if ( t[ a ] == '\n' ) {
+ sl++;
+ lineCols = 0;
+ } else {
+ lineCols++;
+ }
+ }
+
+ sc += lineCols;
+
+ return ( line > sl || ( line == sl && col >= sc ) ) && ( line < el || ( line == el && col < ec ) );
+}
+
+void CppCodeCompletion::getFunctionBody( FunctionDom f , int& line, int& col ) {
+ if ( !f )
+ return;
+ int sl, sc, el, ec;
+ f->getStartPosition( &sl, &sc );
+ f->getEndPosition( &el, &ec );
+ QString t = clearComments( getText( sl, sc, el, ec ) );
+ if ( t.isEmpty() )
+ return;
+
+ int i = t.find( '{' );
+ if ( i == -1 )
+ return;
+ i++;
+ if( (uint)i >= t.length() )
+ return;
+ int lineCols = 0;
+ for ( int a = 0; a < i; a++ ) {
+ if ( t[ a ] == '\n' ) {
+ sl++;
+ lineCols = 0;
+ } else {
+ lineCols++;
+ }
+ }
+
+ sc += lineCols;
+
+ line = sl;
+ col = sc;
+}
+
+void CppCodeCompletion::emptyCache() {
+ m_cachedFromContext = 0;
+ SimpleTypeConfiguration c; ///Will automatically destroy the type-store when the function is closed
+ kdDebug( 9007 ) << "completion-cache emptied" << endl;
+}
+
+void CppCodeCompletion::needRecoveryPoints() {
+
+ if ( this->d->recoveryPoints.isEmpty() ) {
+ kdDebug( 9007 ) << "missing recovery-points for file " << m_activeFileName << " they have to be computed now" << endl;
+ m_pSupport->backgroundParser() ->lock ()
+ ;
+
+ std::vector<CppCodeCompletion> vec;
+
+ TranslationUnitAST * ast = *m_pSupport->backgroundParser() ->translationUnit( m_activeFileName );
+ m_pSupport->backgroundParser() ->unlock();
+ if ( !ast ) {
+ kdDebug( 9007 ) << "background-parser is missing the translation-unit. The file needs to be reparsed." << endl;
+ m_pSupport->parseFileAndDependencies( m_activeFileName, true );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Background-parser is missing the necessary translation-unit. It will be computed, but this completion will fail." ).arg( m_activeFileName ), 2000 );
+ return;
+ } else {
+ computeRecoveryPointsLocked();
+ }
+ if ( this->d->recoveryPoints.isEmpty() ) {
+ kdDebug( 9007 ) << "Failed to compute recovery-points for " << m_activeFileName << endl;
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Failed to compute recovery-points for %1" ).arg( m_activeFileName ), 1000 );
+ } else {
+ kdDebug( 9007 ) << "successfully computed recovery-points for " << m_activeFileName << endl;
+ }
+ }
+}
+
+EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column, SimpleTypeConfiguration& conf, EvaluateExpressionOptions opt ) {
+ EvaluationResult ret;
+ safetyCounter.init();
+
+ FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName );
+
+ if ( !file ) {
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 );
+ kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n";
+ return SimpleType();
+ }
+
+ needRecoveryPoints();
+
+ CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file );
+ ItemDom contextItem;
+
+ int nLine = line, nCol = column;
+
+ // emptyCache();
+ fitContextItem( line, column );
+
+ QString strCurLine = m_activeEditor->textLine( nLine );
+
+ QString ch = strCurLine.mid( nCol - 1, 1 );
+ QString ch2 = strCurLine.mid( nCol - 2, 2 );
+
+ while ( ch[ 0 ].isSpace() && nCol >= 3 ) {
+ nCol -= 1;
+ ch = strCurLine.mid( nCol - 1, 1 );
+ ch2 = strCurLine.mid( nCol - 2, 2 );
+ }
+
+ if ( ch2 == "->" || ch == "." || ch == "(" ) {
+ int pos = ch2 == "->" ? nCol - 3 : nCol - 2;
+ QChar c = strCurLine[ pos ];
+ while ( pos > 0 && c.isSpace() )
+ c = strCurLine[ --pos ];
+
+ if ( !( c.isLetterOrNumber() || c == '_' || c == ')' || c == ']' || c == '>' ) ) {
+ conf.invalidate();
+ return SimpleType();
+ }
+ }
+ bool showArguments = false;
+
+ if ( ch == "(" ) {
+ --nCol;
+ while ( nCol > 0 && strCurLine[ nCol ].isSpace() )
+ --nCol;
+ showArguments = true;
+ }
+
+ QString word;
+
+ {
+ ExpressionInfo exp_ = findExpressionAt( line, column , line, 0 );
+
+ if( file->parseResult() ) {
+ ParsedFilePointer p = dynamic_cast<ParsedFile*>( file->parseResult().data());
+ if( p ) {
+ if( p->usedMacros().hasMacro( exp_.expr() ) ) {
+ //It is a macro, return it
+ ret.expr = exp_.expr();
+ ret.isMacro = true;
+ ret.macro = p->usedMacros().macro( exp_.expr() );
+ return ret;
+ }
+ }
+ }
+ }
+
+ if ( !m_cachedFromContext )
+ conf.setGlobalNamespace( createGlobalNamespace() );
+
+ ItemLocker<BackgroundParser> block( *m_pSupport->backgroundParser() );
+
+ FunctionDom currentFunction = fileModel.functionAt( line, column );
+
+ bool functionFailed = true;
+
+ if ( opt & SearchInFunctions ) {
+ //currentFunction = fileModel.functionAt( line, column );
+
+ if ( currentFunction && functionContains( currentFunction, line, column ) ) {
+ ///Evaluate the context of the function-body if we're in the argument-list
+ int realLine = line, realColumn = column;
+ getFunctionBody( currentFunction, realLine, realColumn );
+ if( realLine < line || ( realLine == line && realColumn < column ) ) {
+ realLine = line;
+ realColumn = column;
+ }
+
+ SimpleContext * ctx = computeFunctionContext( currentFunction, realLine, realColumn, conf );
+ contextItem = currentFunction.data();
+
+ if ( ctx ) {
+ opt = remFlag( opt, SearchInClasses );
+ int startLine, endLine;
+ currentFunction->getStartPosition( &startLine, &endLine );
+ ExpressionInfo exp = findExpressionAt( line, column , startLine, endLine, true );
+ if ( ( opt & DefaultAsTypeExpression ) && ( !exp.canBeNormalExpression() && !exp.canBeTypeExpression() ) && !exp.expr().isEmpty() )
+ exp.t = ExpressionInfo::TypeExpression;
+
+ if ( exp.canBeTypeExpression() ) {
+ {
+ if ( ! ( opt & IncludeTypeExpression ) ) {
+ kdDebug( 9007 ) << "recognized a type-expression, but another expression-type is desired" << endl;
+ } else {
+ TypeDesc d( exp.expr() );
+ d.setIncludeFiles( getIncludeFiles() );
+ ret.resultType = ctx->container() ->locateDecType( d );
+ ret.expr = exp;
+ }
+ }
+ }
+ if ( /*exp.canBeNormalExpression() &&*/ !ret.resultType->resolved() ) { ///It is not cleary possible to recognize the kind of an expression from the syntax as long as it's not written completely
+ {
+ if ( ! ( opt & IncludeStandardExpressions ) ) {
+ kdDebug( 9007 ) << "recognized a standard-expression, but another expression-type is desired" << endl;
+ } else {
+ ///Remove the not completely typed last word while normal completion
+ if ( !showArguments && ( opt & CompletionOption ) ) {
+ QString e = exp.expr();
+ int idx = e.length() - 1;
+ while ( e[ idx ].isLetterOrNumber() || e[ idx ] == '_' )
+ --idx;
+
+ if ( idx != int( e.length() ) - 1 ) {
+ ++idx;
+ word = e.mid( idx ).stripWhiteSpace();
+ exp.setExpr( e.left( idx ).stripWhiteSpace() );
+ }
+ }
+
+ functionFailed = false;
+ ret = evaluateExpression( exp, ctx );
+ }
+ }
+ }
+ } else {
+ kdDebug( 9007 ) << "could not compute context" << endl;
+ }
+ if ( ctx )
+ delete ctx;
+ } else {
+ kdDebug( 9007 ) << "could not find context-function in code-model" << endl;
+ }
+ }
+
+ if ( ( opt & SearchInClasses ) && !ret->resolved() && functionFailed ) {
+ ClassDom currentClass = fileModel.classAt( line, column );
+ int startLine = 0, startCol = 0;
+
+ RecoveryPoint* recoveryPoint = this->d->findRecoveryPoint( line, column );
+
+ QStringList scope;
+
+ if ( !currentClass ) {
+ kdDebug( 9007 ) << "no container-class found" << endl;
+ if ( !recoveryPoint ) {
+ kdDebug( 9007 ) << "no recovery-point found" << endl;
+ } else {
+ startLine = recoveryPoint->startLine;
+ startCol = recoveryPoint->startColumn;
+ scope = recoveryPoint->scope;
+ }
+ } else {
+ contextItem = currentClass.data();
+ scope = currentClass->scope();
+ scope << currentClass->name();
+ currentClass->getStartPosition( &startLine, &startCol );
+ }
+
+ SimpleType container;
+ if ( m_cachedFromContext ) {
+ TypeDesc d( scope.join( "::" ) );
+ d.setIncludeFiles( getIncludeFiles() );
+ SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
+ if ( i )
+ container = i;
+ else
+ container = SimpleType( scope, getIncludeFiles() );
+ } else {
+ container = SimpleType( scope, getIncludeFiles() );
+ }
+
+ ExpressionInfo exp = findExpressionAt( line, column , startLine, startCol );
+ exp.t = ExpressionInfo::TypeExpression; ///Outside of functions, we can only handle type-expressions
+ ret.expr = exp;
+
+ if ( exp && ( exp.t & ExpressionInfo::TypeExpression ) ) {
+ kdDebug( 9007 ) << "locating \"" << exp.expr() << "\" in " << container->fullTypeResolvedWithScope() << endl;
+ TypeDesc d( exp.expr() );
+ d.setIncludeFiles( getIncludeFiles() );
+ ret.resultType = container->locateDecType( d );
+ } else {
+ if ( exp ) {
+ kdDebug( 9007 ) << "wrong expression-type recognized" << endl;
+ } else {
+ kdDebug( 9007 ) << "expression could not be recognized" << endl;
+ }
+ }
+ }
+
+ CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig();
+ if( cfg->usePermanentCaching() && contextItem ) {
+ conf.invalidate();
+ m_cachedFromContext = contextItem;
+ }
+
+ return ret;
+}
+
+bool isAfterKeyword( const QString& str, int column ) {
+ QStringList keywords;
+ keywords << "new";
+ keywords << "throw";
+ keywords << "return";
+ keywords << "emit"; ///This could be done even better by only showing signals for completion..
+ for ( QStringList::iterator it = keywords.begin(); it != keywords.end(); ++it ) {
+ int len = ( *it ).length();
+ if ( column >= len && str.mid( column - len, len ) == *it )
+ return true;
+ }
+ return false;
+}
+
+void CppCodeCompletion::setMaxComments( int count ) {
+ m_maxComments = count;
+}
+
+///TODO: make this use findExpressionAt etc. (like the other expression-evaluation-stuff)
+void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
+ kdDebug( 9007 ) << "CppCodeCompletion::completeText()" << endl;
+ clearStatusText();
+
+ if ( !m_pSupport || !m_activeCursor || !m_activeEditor || !m_activeCompletion )
+ return ;
+
+ setMaxComments( 1000 );
+
+ needRecoveryPoints();
+
+ CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig();
+ m_demandCompletion = invokedOnDemand;
+
+ FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName );
+
+ if ( !file ) {
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 );
+ kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n";
+ return ;
+ }
+
+ CodeModelUtils::CodeModelHelper fileModel( m_pSupport->codeModel(), file );
+
+ ItemDom contextItem;
+
+ unsigned int line, column;
+ m_activeCursor->cursorPositionReal( &line, &column );
+
+ fitContextItem( line, column );
+
+ ///Check whether the cursor is within a comment
+ int surroundingStartLine = line - 10, surroundingEndLine = line + 10;
+ if ( surroundingStartLine < 0 )
+ surroundingStartLine = 0;
+ if ( surroundingEndLine > m_activeEditor->numLines() - 1 )
+ surroundingEndLine = m_activeEditor->numLines() - 1;
+ int surroundingEndCol = m_activeEditor->lineLength( surroundingEndLine );
+
+ QString pre = getText( surroundingStartLine, 0, line, column );
+ int pos = pre.length();
+ pre += getText( line, column, surroundingEndLine, surroundingEndCol );
+ QString cleared = clearComments( pre );
+ if ( cleared[ pos ] != pre[ pos ] ) {
+ kdDebug( 9007 ) << "stopping completion because we're in a coment" << endl;
+ return ;
+ }
+
+ int nLine = line, nCol = column;
+
+ QString strCurLine = clearComments( m_activeEditor->textLine( nLine ) );
+
+ QString ch = strCurLine.mid( nCol - 1, 1 );
+ QString ch2 = strCurLine.mid( nCol - 2, 2 );
+
+ while ( ch[ 0 ].isSpace() && nCol >= 3 ) {
+ nCol -= 1;
+ ch = strCurLine.mid( nCol - 1, 1 );
+ ch2 = strCurLine.mid( nCol - 2, 2 );
+ }
+
+ if ( m_includeRx.search( strCurLine ) != -1 ) {
+ if ( !m_fileEntryList.isEmpty() ) {
+ m_bCompletionBoxShow = true;
+ m_activeCompletion->showCompletionBox( m_fileEntryList, column - m_includeRx.matchedLength() );
+ }
+ return ;
+ }
+
+ bool showArguments = false;
+ bool isInstance = true;
+ m_completionMode = NormalCompletion;
+
+ if ( ch2 == "->" || ch == "." || ch == "(" ) {
+ int pos = ch2 == "->" ? nCol - 3 : nCol - 2;
+ QChar c = strCurLine[ pos ];
+ while ( pos > 0 && c.isSpace() )
+ c = strCurLine[ --pos ];
+
+ if ( !( c.isLetterOrNumber() || c == '_' || c == ')' || c == ']' || c == '>' ) )
+ return ;
+ }
+
+ if ( ch == "(" ) {
+ --nCol;
+ while ( nCol > 0 && strCurLine[ nCol - 1 ].isSpace() )
+ --nCol;
+
+ ///check whether it is a value-definition using constructor
+ int column = nCol;
+ bool s1 = false, s2 = false;
+ while ( column > 0 && isValidIdentifierSign( strCurLine[ column - 1 ] ) ) {
+ column--;
+ s1 = true;
+ }
+
+ ///skip white space
+ while ( column > 0 && strCurLine[ column - 1 ].isSpace() ) {
+ --column;
+ s2 = true;
+ }
+
+ if ( s1 && s2 && isValidIdentifierSign( strCurLine[ column - 1 ] ) ) {
+ if ( isAfterKeyword( strCurLine, column ) ) {
+ ///Maybe a constructor using "new", or "throw", "return", ...
+ } else {
+ ///it is a local constructor like "QString name("David");"
+ nCol = column;
+ }
+ }
+
+
+
+ showArguments = TRUE;
+ }
+
+ EvaluationResult type;
+ SimpleType this_type;
+ QString expr, word;
+
+ DeclarationAST::Node recoveredDecl;
+ TypeSpecifierAST::Node recoveredTypeSpec;
+
+ SimpleContext* ctx = 0;
+ SimpleTypeConfiguration conf( m_activeFileName );
+
+ if ( !m_cachedFromContext )
+ conf.setGlobalNamespace( createGlobalNamespace() );
+
+ ItemLocker<BackgroundParser> block( *m_pSupport->backgroundParser() );
+
+ FunctionDom currentFunction = fileModel.functionAt( line, column );
+
+ RecoveryPoint * recoveryPoint = d->findRecoveryPoint( line, column );
+ if ( recoveryPoint || currentFunction ) {
+ contextItem = currentFunction.data();
+ QStringList scope;
+
+ int startLine, startColumn;
+ if ( currentFunction ) { ///maybe change the priority of these
+ kdDebug( 9007 ) << "using code-model for completion" << endl;
+ currentFunction->getStartPosition( &startLine, &startColumn );
+ scope = currentFunction->scope();
+ } else {
+ kdDebug( 9007 ) << "recovery-point, node-kind = " << nodeTypeToString( recoveryPoint->kind ) << endl;
+ startLine = recoveryPoint->startLine;
+ startColumn = recoveryPoint->startColumn;
+ scope = recoveryPoint->scope;
+ }
+
+ QString textLine = m_activeEditor->textLine( startLine );
+ kdDebug( 9007 ) << "startLine = " << textLine << endl;
+
+ if ( currentFunction || recoveryPoint->kind == NodeType_FunctionDefinition ) {
+
+ QString textToReparse = clearComments( getText( startLine, startColumn, line, showArguments ? nCol : column ) );
+
+ kdDebug( 9007 ) << "-------------> reparse text" << endl << textToReparse << endl
+ << "--------------------------------------------" << endl;
+
+ Driver d;
+ Lexer lexer( &d );
+
+ macrosToDriver( d, file );
+
+ lexer.setSource( textToReparse );
+ Parser parser( &d, &lexer );
+
+ parser.parseDeclaration( recoveredDecl );
+ /* kdDebug(9007) << "recoveredDecl = " << recoveredDecl.get() << endl;*/
+ if ( recoveredDecl.get() ) {
+
+ bool isFunDef = recoveredDecl->nodeType() == NodeType_FunctionDefinition;
+ kdDebug( 9007 ) << "is function definition= " << isFunDef << endl;
+
+ int endLine, endColumn;
+ recoveredDecl->getEndPosition( &endLine, &endColumn );
+ kdDebug( 9007 ) << "endLine = " << endLine << ", endColumn " << endColumn << endl;
+
+ /// @todo check end position
+
+ if ( isFunDef ) {
+ FunctionDefinitionAST * def = static_cast<FunctionDefinitionAST*>( recoveredDecl.get() );
+
+ /// @todo remove code duplication
+
+ QString contents = textToReparse;
+ int start_expr = expressionAt( contents, contents.length() );
+
+ // kdDebug(9007) << "start_expr = " << start_expr << endl;
+ if ( start_expr != int( contents.length() ) )
+ expr = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace();
+
+ if ( expr.startsWith( "SIGNAL" ) || expr.startsWith( "SLOT" ) ) {
+ m_completionMode = expr.startsWith( "SIGNAL" ) ? SignalCompletion : SlotCompletion;
+
+ showArguments = false;
+ int end_expr = start_expr - 1;
+ while ( end_expr > 0 && contents[ end_expr ].isSpace() )
+ --end_expr;
+
+ if ( contents[ end_expr ] != ',' ) {
+ expr = QString::null;
+ } else {
+ start_expr = expressionAt( contents, end_expr );
+ expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
+ }
+ } else {
+ if ( !showArguments ) {
+ int idx = expr.length() - 1;
+ while ( expr[ idx ].isLetterOrNumber() || expr[ idx ] == '_' )
+ --idx;
+
+ if ( idx != int( expr.length() ) - 1 ) {
+ ++idx;
+ word = expr.mid( idx ).stripWhiteSpace();
+ expr = expr.left( idx ).stripWhiteSpace();
+ }
+ }
+ }
+
+ ctx = computeContext( def, endLine, endColumn, startLine, startColumn );
+ DeclaratorAST* d = def->initDeclarator() ->declarator();
+ NameAST* name = d->declaratorId();
+
+ QStringList nested;
+
+ QPtrList<ClassOrNamespaceNameAST> l;
+ if ( name ) {
+ l = name->classOrNamespaceNameList();
+ }
+ // QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
+ while ( nameIt.current() ) {
+ if ( nameIt.current() ->name() ) {
+ nested << nameIt.current() ->name() ->text();
+ }
+ ++nameIt;
+ }
+
+ if ( currentFunction ) {
+ scope = currentFunction->scope();
+ if ( !scope.isEmpty() ) {
+ //scope.pop_back();
+ } else {
+ kdDebug( 9007 ) << "scope is empty" << endl;
+ }
+ if( dynamic_cast<SimpleTypeNamespace*>( SimpleType::globalNamespace().data() ) ) {
+ SimpleTypeNamespace* globalNs = static_cast <SimpleTypeNamespace*>( SimpleType::globalNamespace().data() );
+ QValueList<QPair<QString, QString> > localImports = ctx->imports();
+ for( QValueList<QPair<QString, QString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ globalNs->addAliasMap( (*it).first, (*it).second );
+ }
+ } else {
+ scope += nested;
+ }
+
+ if ( !scope.isEmpty() ) {
+ SimpleType parentType;
+
+ /*if( !m_cachedFromContext ) {
+ TypePointer t = createGlobalNamespace();
+ conf.setGlobalNamespace( t );
+ SimpleTypeNamespace * n = dynamic_cast<SimpleTypeNamespace*>( t.data() );
+ if ( !n ) {
+ QString str = QString( "the global namespace was not resolved correctly , real type: " ) + typeid( n ).name() + QString( " name: " ) + n->scope().join( "::" ) + " scope-size: " + n->scope().count();
+ kdDebug( 9007 ) << str << endl;
+ m_pSupport->mainWindow() ->statusBar() ->message( str , 1000 );
+ } else {
+ }
+ this_type = SimpleType(t);
+ }*/
+
+ if ( m_cachedFromContext ) {
+ TypeDesc d( scope.join( "::" ) );
+ d.setIncludeFiles( getIncludeFiles() );
+ SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
+ if ( i ) {
+ parentType = i;
+ } else {
+ parentType = SimpleType( scope, getIncludeFiles() );
+ }
+ } else {
+ parentType = SimpleType( scope, getIncludeFiles() );
+ }
+ this_type = parentType;
+ this_type->descForEdit().setTotalPointerDepth( 1 );
+ ctx->setContainer( this_type );
+ }
+
+ ///Now locate the local type using the imported namespaces
+ if ( !scope.isEmpty() ) {
+ if ( !m_cachedFromContext ) {
+ TypeDesc td = ctx->container() ->desc();
+ td.makePrivate();
+ td.resetResolved( );
+ td.setIncludeFiles( getIncludeFiles() );
+ TypePointer tt = ctx->container() ->locateDecType( td, SimpleTypeImpl::LocateBase ) ->resolved();
+ if ( tt ) {
+ ctx->setContainer( SimpleType( tt ) );
+ } else {
+ kdDebug( 9007 ) << "could not resolve local this-type \"" << td.fullNameChain() << "\"" << endl;
+ }
+ }
+
+ SimpleType this_type = ctx->container();
+
+ this_type->descForEdit().setTotalPointerDepth( 1 );
+
+ SimpleVariable var;
+ var.type = this_type->desc();
+ var.name = "this";
+ var.comment = this_type->comment();
+ ctx->add
+ ( var );
+ ctx->setContainer( this_type );
+ }
+
+ ExpressionInfo exp( expr );
+ exp.t = ( ExpressionInfo::Type ) ( ExpressionInfo::NormalExpression | ExpressionInfo::TypeExpression );
+ type = evaluateExpression( exp, ctx );
+ }
+
+ } else {
+ kdDebug( 9007 ) << "no valid declaration to recover!!!" << endl;
+ }
+ } else if ( recoveryPoint->kind == NodeType_ClassSpecifier ) {
+ QString textToReparse = getText( recoveryPoint->startLine, recoveryPoint->startColumn,
+ recoveryPoint->endLine, recoveryPoint->endColumn, line );
+ // kdDebug(9007) << "-------------> please reparse only text" << endl << textToReparse << endl
+ // << "--------------------------------------------" << endl;
+
+ Driver d;
+ Lexer lexer( &d );
+ macrosToDriver( d, file );
+
+ lexer.setSource( textToReparse );
+ Parser parser( &d, &lexer );
+
+ parser.parseClassSpecifier( recoveredTypeSpec );
+ /* kdDebug(9007) << "recoveredDecl = " << recoveredTypeSpec.get() << endl;*/
+ if ( recoveredTypeSpec.get() ) {
+
+ //ClassSpecifierAST * clazz = static_cast<ClassSpecifierAST*>( recoveredTypeSpec.get() );
+
+ QString keyword = getText( line, 0, line, column ).simplifyWhiteSpace();
+
+ kdDebug( 9007 ) << "===========================> keyword is: " << keyword << endl;
+
+ if ( keyword == "virtual" ) { /*
+ BaseClauseAST *baseClause = clazz->baseClause();
+ if ( baseClause )
+ {
+ QPtrList<BaseSpecifierAST> baseList = baseClause->baseSpecifierList();
+ QPtrList<BaseSpecifierAST>::iterator it = baseList.begin();
+
+ for ( ; it != baseList.end(); ++it )
+ type.append( ( *it )->name()->text() );
+
+ ctx = new SimpleContext();
+
+ showArguments = false;
+ m_completionMode = VirtualDeclCompletion;
+
+ kdDebug(9007) << "------> found virtual keyword for class specifier '"
+ << clazz->text() << "'" << endl;
+ }*/
+ } else if ( QString( "virtual" ).find( keyword ) != -1 )
+ m_blockForKeyword = true;
+ else
+ m_blockForKeyword = false;
+ }
+ }
+ }
+
+ ///@todo is all this necessary?
+ if ( !recoveredDecl.get() && !recoveredTypeSpec.get() ) {
+ TranslationUnitAST * ast = *m_pSupport->backgroundParser() ->translationUnit( m_activeFileName );
+ if ( AST * node = findNodeAt( ast, line, column ) ) {
+ kdDebug( 9007 ) << "------------------- AST FOUND --------------------" << endl;
+ kdDebug( 9007 ) << "node-kind = " << nodeTypeToString( node->nodeType() ) << endl;
+
+ if ( FunctionDefinitionAST * def = functionDefinition( node ) ) {
+ kdDebug( 9007 ) << "------> found a function definition" << endl;
+
+ int startLine, startColumn;
+ def->getStartPosition( &startLine, &startColumn );
+
+ QString contents = getText( startLine, startColumn, line, showArguments ? nCol : column );
+
+
+ /// @todo remove code duplication
+ int start_expr = expressionAt( contents, contents.length() );
+
+ // kdDebug(9007) << "start_expr = " << start_expr << endl;
+ if ( start_expr != int( contents.length() ) )
+ expr = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace();
+
+ if ( expr.startsWith( "SIGNAL" ) || expr.startsWith( "SLOT" ) ) {
+ m_completionMode = expr.startsWith( "SIGNAL" ) ? SignalCompletion : SlotCompletion;
+
+ showArguments = false;
+ int end_expr = start_expr - 1;
+ while ( end_expr > 0 && contents[ end_expr ].isSpace() )
+ --end_expr;
+
+ if ( contents[ end_expr ] != ',' ) {
+ expr = QString::null;
+ } else {
+ start_expr = expressionAt( contents, end_expr );
+ expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
+ }
+ } else {
+ int idx = expr.length() - 1;
+ while ( expr[ idx ].isLetterOrNumber() || expr[ idx ] == '_' )
+ --idx;
+
+ if ( idx != int( expr.length() ) - 1 ) {
+ ++idx;
+ word = expr.mid( idx ).stripWhiteSpace();
+ expr = expr.left( idx ).stripWhiteSpace();
+ }
+ }
+
+ ctx = computeContext( def, line, column, startLine, startColumn );
+
+ QStringList scope;
+ scopeOfNode( def, scope );
+ this_type = SimpleType( scope, getIncludeFiles() );
+
+ if ( scope.size() ) { /*
+ SimpleVariable var;
+ var.type = scope;
+ var.name = "this";
+ ctx->add( var );*/
+ //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl;
+ }
+
+ ExpressionInfo exp( expr );
+ exp.t = ( ExpressionInfo::Type ) ( ExpressionInfo::NormalExpression | ExpressionInfo::TypeExpression );
+ type = evaluateExpression( exp, ctx );
+ }
+ }
+ }
+
+ if ( !ctx )
+ return ;
+
+ if ( ch2 == "::" ) {
+ QString str = clearComments( expr );
+ if ( !str.contains( '.' ) && !str.contains( "->" ) ) ///Necessary, because the expression may also be like user->BaseUser::
+ isInstance = false;
+ }
+
+ QString resolutionType = "(resolved)";
+ if( !type->resolved() ) {
+ if( BuiltinTypes::isBuiltin( type.resultType ) ) {
+ resolutionType = "(builtin " + BuiltinTypes::comment( type.resultType ) + ")";
+ } else {
+ resolutionType = "(unresolved)";
+ }
+ }
+
+ kdDebug( 9007 ) << "===========================> type is: " << type->fullNameChain() << resolutionType << endl;
+ kdDebug( 9007 ) << "===========================> word is: " << word << endl;
+
+ if ( !showArguments ) {
+ QValueList<CodeCompletionEntry> entryList;
+
+ if ( !type && this_type && ( expr.isEmpty() || expr.endsWith( ";" ) ) ) {
+
+ bool alwaysIncludeNamespaces = cfg->alwaysIncludeNamespaces();
+ {
+ SimpleType t = this_type;
+ ///First, all static data.
+ bool ready = false;
+ SafetyCounter cnt( 20 );
+ int depth = 0;
+ while ( !ready & cnt ) {
+ if ( t->scope().isEmpty() ) {
+ ready = true;
+ }
+ if( !t->isNamespace() || invokedOnDemand || alwaysIncludeNamespaces )
+ computeCompletionEntryList( t, entryList, t->scope(), false, depth );
+ t = t->parent();
+ depth++;
+ }
+ }
+ {
+ SimpleType t = this_type;
+ ///Now find non-static(if we have an instance) and global data
+ bool ready = false;
+ SafetyCounter cnt( 20 );
+ int depth = 0;
+ bool first = true;
+ while ( !ready & cnt ) {
+ if ( t->scope().isEmpty() ) {
+ ready = true;
+ }
+ if ( ( (t->isNamespace() && invokedOnDemand) || alwaysIncludeNamespaces ) || ( first && isInstance ) )
+ computeCompletionEntryList( t, entryList, t->scope(), t->isNamespace() ? true : isInstance, depth );
+ t = t->parent();
+ depth++;
+ first = false;
+ }
+ }
+ if( ctx ) computeCompletionEntryList( entryList, ctx, isInstance );
+ } else if ( type->resolved() && expr.isEmpty() ) {
+ if( ctx ) computeCompletionEntryList( entryList, ctx, isInstance );
+
+ // if ( m_pSupport->codeCompletionConfig() ->includeGlobalFunctions() )
+ // computeCompletionEntryList( type, entryList, QStringList(), false );
+
+ computeCompletionEntryList( type, entryList, QStringList(), false );
+
+ if ( this_type.scope().size() )
+ computeCompletionEntryList( this_type, entryList, this_type.scope(), isInstance );
+ computeCompletionEntryList( type, entryList, type->resolved() ->scope() , isInstance );
+ } else if ( type->resolved() ) {
+ if ( type->resolved() )
+ computeCompletionEntryList( type, entryList, type->resolved() ->scope() , isInstance );
+ }
+
+ QStringList trueMatches;
+
+ if ( invokedOnDemand ) {
+ // find matching words
+ QValueList<CodeCompletionEntry>::Iterator it;
+ for ( it = entryList.begin(); it != entryList.end(); ++it ) {
+ if ( ( *it ).text.startsWith( word ) ) {
+ trueMatches << ( *it ).text;
+
+ // if more than one entry matches, abort immediately
+ if ( trueMatches.size() > 1 )
+ break;
+ }
+ }
+ }
+
+ if ( invokedOnDemand && trueMatches.size() == 1 ) {
+ // erbsland: get the cursor position now, because m_ccLine and m_ccColumn
+ // are not set until the first typed char.
+ unsigned int nLine, nCol;
+ m_activeCursor->cursorPositionReal( &nLine, &nCol );
+ // there is only one entry -> complete immediately
+ m_activeEditor->insertText( nLine, nCol,
+ trueMatches[ 0 ].right( trueMatches[ 0 ].length() - word.length() ) );
+ } else if ( entryList.size() ) {
+ entryList = unique( entryList );
+ qHeapSort( entryList );
+
+ m_bCompletionBoxShow = true;
+ ///Warning: the conversion is only possible because CodeCompletionEntry is binary compatible with KTextEditor::CompletionEntry,
+ ///never change that!
+ m_activeCompletion->showCompletionBox( *( ( QValueList<KTextEditor::CompletionEntry>* ) ( &entryList ) ), word.length() );
+ }
+ } else {
+ QValueList<QStringList> signatureList;
+
+ signatureList = computeSignatureList( type );
+
+ QString methodName = type->name();
+
+ ///Search for variables with ()-operator in the context
+ if ( ctx ) {
+ SimpleVariable var = ctx->findVariable( methodName );
+ if ( !var.name.isEmpty() ) {
+ signatureList += computeSignatureList( ctx->container() ->locateDecType( var.type ) );
+ }
+ }
+
+ ///search for fitting methods/classes in the current context
+ SimpleType t = this_type;
+ bool ready = false;
+ SafetyCounter s( 20 );
+ do {
+ if ( !t )
+ ready = true;
+ TypeDesc d( methodName );
+ d.setIncludeFiles( getIncludeFiles() );
+ SimpleType method = t->typeOf( d );
+ if ( method )
+ signatureList += computeSignatureList( method );
+ if ( t )
+ t = t->parent();
+ } while ( !ready && s );
+
+ if ( !signatureList.isEmpty() ) {
+ //signatureList = unique( signatureList );
+ //qHeapSort( signatureList );
+ m_bArgHintShow = true;
+ m_activeCompletion->showArgHint( unique( signatureList ), "()", "," );
+ }
+ }
+
+ delete( ctx );
+ ctx = 0;
+
+ if ( cfg->usePermanentCaching() ) {
+ conf.invalidate();
+ m_cachedFromContext = contextItem;
+ }
+}
+
+
+QValueList<QStringList> CppCodeCompletion::computeSignatureList( EvaluationResult result ) {
+ SimpleType type = result;
+
+ if ( result.expr.t == ExpressionInfo::TypeExpression ) {
+ TypeDesc d( result->name() );
+ d.setIncludeFiles( getIncludeFiles() );
+ type = type->typeOf( d, SimpleTypeImpl::MemberInfo::Function ); ///Compute the signature of the constructor
+ }
+
+ QValueList<QStringList> retList;
+ SimpleTypeFunctionInterface* f = type->asFunction();
+ SimpleType currType = type;
+
+ if ( !f && !type->isNamespace() ) {
+ SimpleType t = type->typeOf( TypeDesc("operator ( )"), SimpleTypeImpl::MemberInfo::Function );
+
+ if ( t ) {
+ f = t->asFunction();
+ currType = t;
+ }
+ }
+
+ while ( f ) {
+ QStringList lst;
+ QString sig = buildSignature( currType.get() );
+ QString comment = currType->comment();
+ QStringList commentList;
+ if ( m_pSupport->codeCompletionConfig() ->showCommentWithArgumentHint() ) {
+
+ if ( !comment.isEmpty() ) {
+ if ( sig.length() + comment.length() < 130 ) {
+ sig += ": \"" + currType->comment() + "\"";
+ } else {
+ commentList = formatComment( comment );
+ }
+ }
+ }
+
+ lst << sig;
+ lst += commentList;
+
+ currType = f->nextFunction();
+
+ ///Maybe try to apply implicit template-params in this place
+
+ retList << lst;
+ f = currType->asFunction();
+ }
+ return retList;
+}
+
+void CppCodeCompletion::synchronousParseReady( const QString& file, ParsedFilePointer unit ) {
+ if ( file == m_activeFileName ) {
+ computeRecoveryPoints( unit );
+ }
+}
+
+void CppCodeCompletion::slotCodeModelUpdated( const QString& fileName ) {
+ if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
+ return ;
+
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file updated %1" ).arg( m_activeFileName ), 1000 );
+
+ computeRecoveryPointsLocked();
+}
+
+void CppCodeCompletion::slotFileParsed( const QString& fileName ) {
+ if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
+ return ;
+
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file parsed %1 (cache emptied)" ).arg( m_activeFileName ), 1000 );
+
+ emptyCache(); ///The cache has to be emptied, because the code-model changed. @todo Better: Only refresh the code-model(tell all code-model-types to refresh themselves on demand)
+
+ computeRecoveryPointsLocked();
+}
+
+void CppCodeCompletion::setupCodeInformationRepository( ) {}
+
+SimpleContext* CppCodeCompletion::computeContext( FunctionDefinitionAST * ast, int line, int col, int lineOffset, int colOffset ) {
+ kdDebug( 9007 ) << "CppCodeCompletion::computeContext() -- main" << endl;
+
+ SimpleContext* ctx = new SimpleContext();
+
+ if ( ast && ast->initDeclarator() && ast->initDeclarator() ->declarator() ) {
+ DeclaratorAST * d = ast->initDeclarator() ->declarator();
+ if ( ParameterDeclarationClauseAST * clause = d->parameterDeclarationClause() ) {
+ if ( ParameterDeclarationListAST * params = clause->parameterDeclarationList() ) {
+ QPtrList<ParameterDeclarationAST> l( params->parameterList() );
+ QPtrListIterator<ParameterDeclarationAST> it( l );
+ while ( it.current() ) {
+ ParameterDeclarationAST * param = it.current();
+ ++it;
+
+ SimpleVariable var;
+
+ QStringList ptrList;
+ QPtrList<AST> ptrOpList = param->declarator() ->ptrOpList();
+ QPtrList<AST>::iterator it = ptrOpList.begin();
+ for ( ; it != ptrOpList.end(); ++it ) {
+ ptrList.append( ( *it ) ->text() );
+ }
+
+ var.ptrList = ptrList;
+ var.type = param->typeSpec() ->text() + ptrList.join( "" );
+ var.name = declaratorToString( param->declarator(), QString::null, true );
+ var.comment = param->comment();
+ param->getStartPosition( &var.startLine, &var.startCol );
+ param->getEndPosition( &var.endLine, &var.endCol );
+
+ if ( var.type ) {
+ ctx->add
+ ( var );
+ //kdDebug(9007) << "add argument " << var.name << " with type " << var.type << endl;
+ }
+ }
+ }
+ }
+ }
+
+
+ if ( ast )
+ computeContext( ctx, ast->functionBody(), line, col );
+
+ if ( ctx ) {
+ ctx->offset( lineOffset, colOffset );
+ }
+
+ return ctx;
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, StatementAST* stmt, int line, int col ) {
+ if ( !stmt )
+ return ;
+
+ switch ( stmt->nodeType() ) {
+ case NodeType_IfStatement:
+ computeContext( ctx, static_cast<IfStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_WhileStatement:
+ computeContext( ctx, static_cast<WhileStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_DoStatement:
+ computeContext( ctx, static_cast<DoStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_ForStatement:
+ computeContext( ctx, static_cast<ForStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_SwitchStatement:
+ computeContext( ctx, static_cast<SwitchStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_TryBlockStatement:
+ computeContext( ctx, static_cast<TryBlockStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_DeclarationStatement:
+ computeContext( ctx, static_cast<DeclarationStatementAST*>( stmt ), line, col );
+ break;
+ case NodeType_StatementList:
+ computeContext( ctx, static_cast<StatementListAST*>( stmt ), line, col );
+ break;
+ case NodeType_ExpressionStatement:
+ break;
+ }
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, StatementListAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col, false, true ) )
+ return ;
+
+ QPtrList<StatementAST> l( ast->statementList() );
+ QPtrListIterator<StatementAST> it( l );
+ while ( it.current() ) {
+ StatementAST * stmt = it.current();
+ ++it;
+
+ computeContext( ctx, stmt, line, col );
+ }
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, IfStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+ computeContext( ctx, ast->elseStatement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, ForStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ computeContext( ctx, ast->initStatement(), line, col );
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, DoStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ //computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, WhileStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, SwitchStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col ) {
+ if ( !inContextScope( ast, line, col ) )
+ return ;
+
+ computeContext( ctx, ast->statement(), line, col );
+ computeContext( ctx, ast->catchStatementList(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col ) {
+ /*if ( !inContextScope( ast, line, col, false, true ) )
+ return;*/
+
+ QPtrList<CatchStatementAST> l( ast->statementList() );
+ QPtrListIterator<CatchStatementAST> it( l );
+ while ( it.current() ) {
+ CatchStatementAST * stmt = it.current();
+ ++it;
+
+ computeContext( ctx, stmt, line, col );
+ }
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col ) {
+ if ( !ast->statement() )
+ return ;
+ if ( !inContextScope( ast->statement(), line, col ) )
+ return ;
+
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col ) {
+ ///@todo respect NodeType_Typedef
+ if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_UsingDirective ) {
+ UsingDirectiveAST* usingDecl = static_cast<UsingDirectiveAST*>( ast->declaration() );
+ QString name;
+ if( usingDecl->name() ) {
+ name = usingDecl->name()->text();
+
+ if( !name.isNull() )
+ ctx->addImport( QPair<QString, QString>( "", name ) );
+ }
+ }
+
+ if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_NamespaceAlias ) {
+ NamespaceAliasAST* namespaceAlias = static_cast<NamespaceAliasAST*>( ast->declaration() );
+ QString name;
+
+ if( namespaceAlias ->namespaceName() && namespaceAlias->aliasName() ) {
+ ctx->addImport( QPair<QString, QString>( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) );
+ }
+ }
+
+ if ( !ast->declaration() || ast->declaration() ->nodeType() != NodeType_SimpleDeclaration )
+ return ;
+
+ if ( !inContextScope( ast, line, col, true, false ) )
+ return ;
+
+ SimpleDeclarationAST* simpleDecl = static_cast<SimpleDeclarationAST*>( ast->declaration() );
+ TypeSpecifierAST* typeSpec = simpleDecl->typeSpec();
+
+ InitDeclaratorListAST* initDeclListAST = simpleDecl->initDeclaratorList();
+ if ( !initDeclListAST )
+ return ;
+
+ QPtrList<InitDeclaratorAST> l = initDeclListAST->initDeclaratorList();
+ QPtrListIterator<InitDeclaratorAST> it( l );
+ while ( it.current() ) {
+ DeclaratorAST * d = it.current() ->declarator();
+ ++it;
+
+ if ( d->declaratorId() ) {
+ SimpleVariable var;
+
+ QStringList ptrList;
+ QPtrList<AST> ptrOpList = d->ptrOpList();
+ QPtrList<AST>::iterator it = ptrOpList.begin();
+ for ( ; it != ptrOpList.end(); ++it ) {
+ ptrList.append( ( *it ) ->text() );
+ }
+
+ for( int a = 0; a < d->arrayDimensionList().count(); a++ )
+ ptrList.append("*");
+
+ var.ptrList = ptrList;
+ var.type = typeSpec->text() + ptrList.join( "" );
+ var.name = toSimpleName( d->declaratorId() );
+ var.comment = d->comment();
+ d->getStartPosition( &var.startLine, &var.startCol );
+ d->getEndPosition( &var.endLine, &var.endCol );
+
+ ctx->add
+ ( var );
+ //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl;
+ }
+ }
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, ConditionAST* ast, int line, int col ) {
+ if ( !ast->typeSpec() || !ast->declarator() || !ast->declarator() ->declaratorId() )
+ return ;
+
+ if ( !inContextScope( ast, line, col, true, false ) )
+ return ;
+
+ SimpleVariable var;
+
+ QStringList ptrList;
+ QPtrList<AST> ptrOpList = ast->declarator() ->ptrOpList();
+ QPtrList<AST>::iterator it = ptrOpList.begin();
+ for ( ; it != ptrOpList.end(); ++it ) {
+ ptrList.append( ( *it ) ->text() );
+ }
+
+ var.ptrList = ptrList;
+ var.type = ast->typeSpec() ->text() + ptrList.join( "" );
+ var.name = toSimpleName( ast->declarator() ->declaratorId() );
+ var.comment = ast->comment();
+ ast->getStartPosition( &var.startLine, &var.startCol );
+ ast->getEndPosition( &var.endLine, &var.endCol );
+ ctx->add
+ ( var );
+ //kdDebug(9007) << "add variable " << var.name << " with type " << var.type << endl;
+}
+
+bool CppCodeCompletion::inContextScope( AST* ast, int line, int col, bool checkStart, bool checkEnd ) {
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ // kdDebug(9007) << k_funcinfo << endl;
+ // kdDebug(9007) << "current char line: " << line << " col: " << col << endl;
+ //
+ // kdDebug(9007) << nodeTypeToString( ast->nodeType() )
+ // << " start line: " << startLine
+ // << " col: " << startColumn << endl;
+ // kdDebug(9007) << nodeTypeToString( ast->nodeType() )
+ // << " end line: " << endLine
+ // << " col: " << endColumn << endl;
+
+ bool start = line > startLine || ( line == startLine && col >= startColumn );
+ bool end = line < endLine || ( line == endLine && col <= endColumn );
+
+ if ( checkStart && checkEnd )
+ return start && end;
+ else if ( checkStart )
+ return start;
+ else if ( checkEnd )
+ return end;
+
+ return false;
+}
+
+FunctionDefinitionAST * CppCodeCompletion::functionDefinition( AST* node ) {
+
+ while ( node ) {
+ if ( node->nodeType() == NodeType_FunctionDefinition )
+ return static_cast<FunctionDefinitionAST*>( node );
+ node = node->parent();
+ }
+ return 0;
+}
+
+QString CppCodeCompletion::getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine ) {
+ if ( startLine == endLine ) {
+ QString textLine = m_activeEditor->textLine( startLine );
+ return textLine.mid( startColumn, endColumn - startColumn );
+ }
+
+ QStringList contents;
+
+ for ( int line = startLine; line <= endLine; ++line ) {
+ if ( line == omitLine )
+ continue;
+
+ QString textLine = m_activeEditor->textLine( line );
+
+ if ( line == startLine )
+ textLine = textLine.mid( startColumn );
+ if ( line == endLine )
+ textLine = textLine.left( endColumn );
+
+ contents << textLine;
+ }
+ return contents.join( "\n" );
+}
+
+void CppCodeCompletion::computeRecoveryPointsLocked() {
+ m_pSupport->backgroundParser() ->lock ()
+ ;
+ ParsedFilePointer unit = m_pSupport->backgroundParser() ->translationUnit( m_activeFileName );
+ computeRecoveryPoints( unit );
+ m_pSupport->backgroundParser() ->unlock();
+}
+
+void CppCodeCompletion::computeRecoveryPoints( ParsedFilePointer unit ) {
+ if ( m_blockForKeyword )
+ return ;
+
+ kdDebug( 9007 ) << "CppCodeCompletion::computeRecoveryPoints" << endl;
+
+ d->recoveryPoints.clear();
+ if ( !unit )
+ return ;
+
+ ComputeRecoveryPoints walker( d->recoveryPoints );
+ walker.parseTranslationUnit( *unit );
+}
+
+QString codeModelAccessToString( CodeModelItem::Access access ) {
+ switch ( access ) {
+ case CodeModelItem::Public:
+ return "public";
+ case CodeModelItem::Protected:
+ return "protected";
+ case CodeModelItem::Private:
+ return "private";
+ default:
+ return "unknown";
+ }
+}
+
+#define MAXCOMMENTCOLUMNS 45
+
+
+QString CppCodeCompletion::commentFromItem( const SimpleType& parent, const ItemDom& item ) {
+ --m_maxComments;
+ static QString maxReached = " ";
+ if( m_maxComments < 0 ) {
+ return maxReached;
+ }
+ QString ret;
+ int line, col;
+ item->getStartPosition( &line, &col );
+
+
+ if ( !parent->scope().isEmpty() ) {
+ ret += "Container: " + parent->fullTypeResolvedWithScope();
+ }
+
+ if ( item->isEnum() ) {
+ ret += "\nKind: Enum";
+ ret += "\nValues:";
+ const EnumModel* en = dynamic_cast<const EnumModel*>( item.data() );
+ if ( en ) {
+ EnumeratorList values = en->enumeratorList();
+ for ( EnumeratorList::iterator it = values.begin(); it != values.end(); ++it ) {
+ ret += "\n " + ( *it ) ->name();
+ if ( !( *it ) ->value().isEmpty() ) {
+ ret + " = " + ( *it ) ->value();
+ }
+ }
+
+ ret += "\n\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) en->access() );
+ } else {}
+
+ }
+
+ if ( item->isFunction() || item->isFunctionDefinition() ) {
+ const FunctionModel * f = dynamic_cast<const FunctionModel*>( item.data() );
+ ret += "\nKind: Function";
+ if ( f ) {
+ QString state;
+ if ( f->isStatic() )
+ state += "static ";
+ if ( f->isVirtual() )
+ state += "virtual ";
+ if ( f->isAbstract() )
+ state += "abstract ";
+ //if( f->isTemplateable() ) state += "template ";
+ if ( f->isConstant() )
+ state += "const ";
+ if ( f->isSlot() )
+ state += "slot ";
+ if ( f->isSignal() )
+ state += "signal ";
+
+ if ( !state.isEmpty() )
+ ret += "\nModifiers: " + state;
+
+ ret += "\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) f->access() );
+ }
+ }
+
+ if ( item->isEnumerator() ) {
+ const EnumeratorModel * f = dynamic_cast<const EnumeratorModel*>( item.data() );
+ ret += "\nKind: Enumerator";
+ if ( f ) {
+ if ( !f->value().isEmpty() )
+ ret += "\nValue: " + f->value();
+
+ //ret += "\nAccess: " + codeModelAccessToString( f->() );
+ }
+ } else {
+ if ( item->isVariable() ) {
+ const VariableModel * f = dynamic_cast<const VariableModel*>( item.data() );
+ if ( f ) {
+ if ( !f->isEnumeratorVariable() ) {
+ ret += "\nKind: Variable";
+ if ( f->isStatic() )
+ ret += "\nModifiers: static";
+ } else {
+ ret += "\nKind: Enumerator";
+ ret += "\nEnum: " + f->type();
+ }
+
+ ret += "\nAccess: " + codeModelAccessToString( ( CodeModelItem::Access ) f->access() );
+ }
+ }
+ }
+
+ if ( item->isTypeAlias() ) {
+ const TypeAliasModel * t = dynamic_cast<const TypeAliasModel*>( item.data() );
+ ret += "\nKind: Typedef";
+ if ( t ) {
+ ret += "\nType: " + t->type();
+ LocateResult r = parent->locateDecType( t->type() );
+ if ( r.desc().resolved() )
+ ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope();
+ else
+ ret += "\nPartially resolved type: " + r.desc().fullNameChain();
+ }
+ }
+
+ if ( item->isClass() ) {
+ ret += "\nKind: Class";
+ }
+
+ ret += QString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( item->fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
+ if ( !item->comment().isEmpty() )
+ ret += "\n\n" + prepareTextForMenu( item->comment(), 3, MAXCOMMENTCOLUMNS ).join( "\n" );
+ return ret;
+}
+
+QString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag ) {
+ --m_maxComments;
+ static QString maxReached = " ";
+ if( m_maxComments < 0 ) {
+ return maxReached;
+ }
+
+ int line, col;
+ tag.getStartPosition( &line, &col );
+ QString ret; // = tag.comment();
+
+ if ( !parent->scope().isEmpty() ) {
+ ret += "Container: " + parent->fullTypeResolvedWithScope();
+ }
+ /*
+ if( tag.kind() == Tag::Kind_Enum ) {
+ ret += "\nKind: Enum";
+ ret += "\nValues:";
+ EnumModel* en = dynamic_cast<EnumModel*>( item.data() );
+ if( en ) {
+ EnumeratorList values =en->enumeratorList();
+ for( EnumeratorList::iterator it = values.begin(); it != values.end(); ++it )
+ {
+ ret += "\n " + (*it)->name();
+ if( !(*it)->value().isEmpty() ) {
+ ret + " = " + (*it)->value();
+ }
+ }
+
+ ret += "\n\nAccess: " + codeModelAccessToString( (CodeModelItem::Access)en->access() );
+ } else {
+ }
+ }*/
+
+ if ( tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_FunctionDeclaration ) {
+ CppFunction<Tag> function( tag );
+
+ ret += "\nKind: Function";
+
+ QString state;
+ if ( function.isStatic() )
+ state += "static ";
+ if ( function.isVirtual() )
+ state += "virtual ";
+ //if( function.isVolatile() ) state += "volatile ";
+ if ( function.isConst() )
+ state += "const ";
+ if ( function.isSlot() )
+ state += "slot ";
+ if ( function.isSignal() )
+ state += "signal ";
+ if ( !state.isEmpty() )
+ ret += "\nModifiers: " + state;
+
+ ret += "\nAccess: " + TagUtils::accessToString( function.access() );
+ }
+
+ /*if( item->isEnumerator() ) {
+ EnumeratorModel* f = dynamic_cast<EnumeratorModel*>( item.data() );
+ ret += "\nKind: Enumerator";
+ if( f ) {
+ if( !f->value().isEmpty() )
+ ret += "\nValue: " + f->value();
+
+ //ret += "\nAccess: " + codeModelAccessToString( f->() );
+ }
+ } else {
+ if( item->isVariable() ) {
+ VariableModel* f = dynamic_cast<VariableModel*>( item.data() );
+ ret += "\nKind: Variable";
+ if( f ) {
+ ret += "\nAccess: " + codeModelAccessToString( (CodeModelItem::Access)f->access() );
+ }
+ }
+ }*/
+
+ if ( tag.kind() == Tag::Kind_Enum ) {
+ CppVariable<Tag> var( tag );
+
+ ret += "\nKind: Enum";
+ }
+
+ if ( tag.kind() == Tag::Kind_Enumerator ) {
+ CppVariable<Tag> var( tag );
+
+ ret += "\nKind: Enumerator";
+ if ( tag.hasAttribute( "enum" ) && tag.attribute( "enum" ).asString() != "int" )
+ ret += "\nEnum: " + tag.attribute( "enum" ).asString();
+ }
+
+ if ( tag.kind() == Tag::Kind_Variable ) {
+ CppVariable<Tag> var( tag );
+
+ ret += "\nKind: Variable";
+ if ( var.isStatic() )
+ ret += "\nModifiers: static";
+ ret += "\nAccess: " + TagUtils::accessToString( var.access() );
+ }
+
+ if ( tag.kind() == Tag::Kind_Typedef ) {
+ ret += "\nKind: Typedef";
+ ret += "\nType: " + tagType( tag );
+ LocateResult r = parent->locateDecType( tagType( tag ) );
+ if ( r.desc().resolved() )
+ ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope();
+ else
+ ret += "\nPartially resolved type: " + r.desc().fullNameChain();
+ }
+
+ if ( tag.kind() == Tag::Kind_Class ) {
+ ret += "\nKind: Class";
+ }
+ if ( tag.kind() == Tag::Kind_Struct ) {
+ ret += "\nKind: Struct";
+ }
+
+ ret += QString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( tag.fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
+ if ( !tag.comment().isEmpty() ) {
+ ret += "\n\n" + prepareTextForMenu( tag.comment(), 20, MAXCOMMENTCOLUMNS ).join( "\n" );
+ }
+ return ret;
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList<CodeCompletionEntry>& entryList, const QStringList& type, SimpleTypeNamespace* ns, std::set<HashedString>& ignore, bool isInstance, int depth ) {
+ HashedString myName = HashedString( ns->scope().join("::") +"%"+typeid(*ns).name() );
+ if ( ignore.find( myName ) != ignore.end() )
+ return ;
+ ignore.insert( myName );
+ SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( getIncludeFiles() );
+ for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) {
+ SimpleTypeNamespace* nns = dynamic_cast<SimpleTypeNamespace*>( (*it).first.first.resolved().data() );
+ if ( !nns ) {
+ if( ( *it ).first.first.resolved() ) computeCompletionEntryList( SimpleType((*it).first.first.resolved()), entryList, ( *it ).first.first.resolved()->scope(), isInstance, depth );
+ } else {
+ if( ( *it ).first.first.resolved() ) computeCompletionEntryList( SimpleType(( *it ).first.first.resolved()), entryList, ( *it ).first.first.resolved()->scope(), nns, ignore, isInstance, depth );
+ }
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList< CodeCompletionEntry > & entryList, const QStringList & type, bool isInstance, int depth ) {
+ dbgState.setState( disableVerboseForCompletionList );
+
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+ SimpleTypeImpl* m = &( *typeR ) ;
+
+ if ( SimpleTypeNamespace * ns = dynamic_cast<SimpleTypeNamespace*>( m ) ) {
+ std::set<HashedString> ignore;
+ computeCompletionEntryList( typeR, entryList, type, ns, ignore, isInstance, depth );
+ } else if ( dynamic_cast<SimpleTypeCodeModel*>( m ) ) {
+ ItemDom item = ( dynamic_cast<SimpleTypeCodeModel*>( m ) ) ->item();
+ if ( item )
+ if ( ClassModel * mod = dynamic_cast<ClassModel*> ( &( *item ) ) )
+ computeCompletionEntryList( typeR, entryList, ClassDom( mod ) , isInstance, depth );
+ } else {
+ QValueList<Catalog::QueryArgument> args;
+ QValueList<Tag> tags;
+
+ QStringList ts = type;
+ if( !ts.isEmpty() ) {
+ QString s = ts.back() + typeR->specialization();
+ ts.pop_back();
+ ts.push_back( s );
+ }
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_FunctionDeclaration )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Variable )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ if ( !isInstance ) {
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Enumerator )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Enum )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Typedef )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Class )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Struct )
+ << Catalog::QueryArgument( "scope", ts );
+ tags = m_repository->query( args );
+ computeCompletionEntryList( typeR, entryList, tags, isInstance, depth );
+ }
+
+ args.clear();
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Base_class );
+ QString fullname = type.join( "::" )+typeR->specialization();
+ /* if( fullname.length() >=2 )
+ args << Catalog::QueryArgument( "prefix", fullname.left(2) );*/
+ args << Catalog::QueryArgument( "name", fullname );
+
+
+ QValueList<LocateResult> parents = typeR->getBases( );
+ for ( QValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ if ( !( *it ) ->resolved() )
+ continue;
+ SimpleType tp = SimpleType( ( *it ) ->resolved() );
+ if ( tp )
+ computeCompletionEntryList( tp, entryList, tp.scope(), isInstance, depth + 1 );
+ }
+ }
+ dbgState.setState( true );
+}
+
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, QValueList< Tag > & tags, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+ QString className = type->desc().name();
+
+ bool isNs = type->isNamespace();
+
+ CompTypeProcessor proc( type, m_pSupport->codeCompletionConfig() ->processFunctionArguments() && type->usingTemplates() );
+ bool resolve = m_pSupport->codeCompletionConfig() ->processPrimaryTypes() && type->usingTemplates();
+
+ QValueList<Tag>::Iterator it = tags.begin();
+ while ( it != tags.end() ) {
+ Tag & tag = *it;
+ ++it;
+
+ int subSorting = 0;
+
+ if ( tag.name().isEmpty() ) {
+ continue;
+ } else if ( m_completionMode != NormalCompletion ) {
+ if ( tag.kind() != Tag::Kind_FunctionDeclaration )
+ continue;
+ }
+
+ if ( tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_FunctionDeclaration ) {
+ CppFunction<Tag> info( tag );
+
+ if ( m_completionMode == SlotCompletion && !info.isSlot() )
+ continue;
+ else if ( m_completionMode == SignalCompletion && !info.isSignal() )
+ continue;
+ else if ( m_completionMode == VirtualDeclCompletion && !info.isVirtual() )
+ continue;
+
+ if ( info.isConst() )
+ subSorting = 1;
+ if ( info.isSlot() )
+ subSorting = 2;
+ if ( info.isSignal() )
+ subSorting = 3;
+ if ( info.isVirtual() )
+ subSorting = 4;
+ if ( info.isStatic() )
+ subSorting = 5;
+ }
+
+ CodeCompletionEntry e = CodeInformationRepository::toEntry( tag, m_completionMode, &proc );
+
+ TagFlags fl;
+ fl.flags = tag.flags();
+ int num = fl.data.access;
+
+ QString str = "public";
+ if ( num != 0 ) {
+ str = TagUtils::accessToString( num );
+ } else {
+ num = 0;
+ }
+ // 0 = protected, 1 = public, 2 = private
+
+ if ( str == "public" )
+ num = 0;
+ else if ( str == "protected" )
+ num = 1;
+ else if ( str == "private" )
+ num = 2;
+
+ int sortPosition = 0;
+
+ switch ( tag.kind() ) {
+ case Tag::Kind_Enum:
+ sortPosition = 3;
+ if ( isInstance )
+ continue;
+ break;
+ case Tag::Kind_Enumerator:
+ sortPosition = 4;
+ if ( isInstance )
+ continue;
+ break;
+ case Tag::Kind_Struct:
+ case Tag::Kind_Union:
+ case Tag::Kind_Class:
+ sortPosition = 5;
+ if ( isInstance )
+ continue;
+ break;
+ case Tag::Kind_VariableDeclaration:
+ case Tag::Kind_Variable:
+ sortPosition = 2;
+ if ( !isInstance && !CppVariable<Tag>( tag ).isStatic() && !isNs )
+ continue;
+ break;
+ case Tag::Kind_FunctionDeclaration:
+ case Tag::Kind_Function:
+ sortPosition = 1;
+ if ( !isInstance && !CppFunction<Tag>( tag ).isStatic() && !isNs )
+ continue;
+ break;
+ case Tag::Kind_Typedef:
+ sortPosition = 6;
+ if ( isInstance )
+ continue;
+ break;
+ }
+
+ e.userdata = QString( "%1%2%3%4%5" ).arg( num ).arg( depth ).arg( className ).arg( sortPosition ).arg( subSorting );
+
+ if ( m_completionMode != SignalCompletion ) {
+ if ( !type->isNamespace() ) {
+ if ( num == 1 )
+ e.postfix += "; (protected)"; // in " + proc.parentType() + ")";
+ if ( num == 2 )
+ e.postfix += "; (private)"; // in " + proc.parentType() + ")";
+ }
+ }
+
+
+ QString prefix = tagType( tag ).stripWhiteSpace();
+
+ if ( tag.kind() == Tag::Kind_Enumerator && tag.hasAttribute( "enum" ) ) {
+ prefix = tag.attribute( "enum" ).asString();
+ e.userdata += prefix; ///Sort enumerators together
+ } else if ( tag.kind() == Tag::Kind_Enum ) {
+ prefix = "enum";
+ } else {
+
+ if ( tag.kind() == Tag::Kind_FunctionDeclaration || tag.kind() == Tag::Kind_Function || tag.kind() == Tag::Kind_Variable || tag.kind() == Tag::Kind_Typedef ) {
+ if ( !prefix.isEmpty() && resolve ) {
+ LocateResult et = type->locateDecType( prefix );
+
+ if ( et )
+ prefix = et->fullNameChain();
+ }
+ }
+
+ if ( tag.kind() == Tag::Kind_FunctionDeclaration || tag.kind() == Tag::Kind_Function ) {
+ if ( prefix.isEmpty() ) {
+ if ( tag.name() == className )
+ prefix = constructorPrefix;
+ else if ( tag.name().startsWith( "~" ) )
+ prefix = destructorPrefix;
+ }
+ }
+
+ if ( tag.kind() == Tag::Kind_Class || tag.kind() == Tag::Kind_Function )
+ prefix = "";
+ }
+
+ e.comment = commentFromTag( type, tag );
+
+ if ( e.prefix.isEmpty() )
+ e.prefix = prefix;
+ else
+ e.prefix += " " + prefix;
+
+ e.prefix = e.prefix.stripWhiteSpace();
+ e.prefix = stringMult( depth, " " ) + e.prefix.stripWhiteSpace();
+
+ e.text = e.text.stripWhiteSpace();
+
+ if ( str != "private" )
+ entryList << e;
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, ClassDom klass, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+ computeCompletionEntryList( type, entryList, klass->functionList(), isInstance, depth );
+
+ ///Find all function-definitions that have no functions. Those may be inlined functions and need to be treated too.
+ FunctionDefinitionList definitions = klass->functionDefinitionList();
+ FunctionList l;
+
+ QStringList classScope = klass->scope();
+ classScope << klass->name();
+
+ for ( FunctionDefinitionList::iterator it = definitions.begin(); it != definitions.end(); ++it ) {
+ FunctionList fl = klass->functionByName( ( *it ) ->name() );
+
+ ArgumentList args = ( *it ) ->argumentList();
+
+ if ( !l.isEmpty() ) {
+ bool matched = false;
+ for ( FunctionList::iterator it = fl.begin(); it != fl.end(); ++it ) {
+ ArgumentList fArgs = ( *it ) ->argumentList();
+ if ( fArgs.count() != args.count() )
+ continue;
+ ArgumentList::iterator it = args.begin();
+ ArgumentList::iterator it2 = fArgs.begin();
+ bool hit = true;
+ while ( it != args.end() ) {
+ if ( ( *it ) ->type() != ( *it2 ) ->type() ) {
+ hit = false;
+ break;
+ }
+ ++it;
+ ++it2;
+ }
+ if ( hit ) {
+ matched = true;
+ break;
+ }
+
+ }
+
+ if ( matched )
+ continue;
+ }
+
+ ///The function-definition belongs to some sub-class
+ if( (*it)->scope() != classScope && !(*it)->scope().isEmpty() ) continue;
+ l << ( FunctionModel* ) ( *it ).data();
+ }
+
+ if ( !l.isEmpty() )
+ computeCompletionEntryList( type, entryList, l, isInstance, depth );
+
+ if ( m_completionMode == NormalCompletion )
+ computeCompletionEntryList( type, entryList, klass->variableList(), isInstance, depth );
+
+ if ( !isInstance ) {
+ computeCompletionEntryList( klass->name(), type, entryList, klass->classList(), isInstance, depth );
+ computeCompletionEntryList( klass->name(), type, entryList, klass->typeAliasList(), isInstance, depth );
+ }
+
+ QValueList<LocateResult> parents = type->getBases( );
+
+ for ( QValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ if ( !( *it ) ->resolved() )
+ continue;
+
+ SimpleTypeImpl* i = ( *it ) ->resolved();
+ computeCompletionEntryList( i, entryList, i->scope(), isInstance, depth + 1 );
+ /*
+ SimpleTypeCodeModel* m = dynamic_cast<SimpleTypeCodeModel*> ( i );
+ if ( m ) {
+ ItemDom item = m->item();
+ ClassModel* kl = dynamic_cast<ClassModel*> ( &( *item ) );
+ if ( kl ) {
+ computeCompletionEntryList( SimpleType( ( *it ) ->resolved() ), entryList, ClassDom ( kl ), isInstance, depth + 1 );
+ }
+ }*/
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, NamespaceDom scope, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+ CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig();
+
+ computeCompletionEntryList( type, entryList, ClassDom( scope.data() ), isInstance, depth );
+ if ( !isInstance )
+ computeCompletionEntryList( type, entryList, scope->namespaceList(), isInstance, depth );
+}
+
+void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const ClassList & lst, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+
+ ClassList::ConstIterator it = lst.begin();
+ while ( it != lst.end() ) {
+ ClassDom klass = *it;
+ ++it;
+
+ CodeCompletionEntry entry;
+ entry.prefix = "class";
+ entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
+ entry.text = klass->name();
+ entry.comment = commentFromItem( type, klass.data() );
+ if ( isInstance )
+ continue;
+
+ entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 6 );
+
+ entryList << entry;
+
+
+ // if ( cfg->includeTypes() )
+ /*{
+ computeCompletionEntryList( type, entryList, klass->classList(), isInstance, depth );
+ }*/
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+
+ TypeAliasList::ConstIterator it = lst.begin();
+ while ( it != lst.end() ) {
+ TypeAliasDom klass = *it;
+ ++it;
+
+ CodeCompletionEntry entry;
+
+ LocateResult et = type->locateDecType( klass->type() );
+ if ( et )
+ entry.prefix = "typedef " + et->fullNameChain();
+ else
+ entry.prefix = "typedef " + klass->type();
+
+ entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
+ entry.text = klass->name();
+ entry.comment = commentFromItem( type, klass.data() );
+ entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 5 );
+ entryList << entry;
+ }
+}
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const NamespaceList & lst, bool /*isInstance*/, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+ NamespaceList::ConstIterator it = lst.begin();
+ while ( it != lst.end() ) {
+ NamespaceDom scope = *it;
+ ++it;
+
+ CodeCompletionEntry entry;
+ entry.prefix = "namespace";
+ entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
+ entry.text = scope->name();
+ entry.comment = commentFromItem( type, scope.data() );
+ entryList << entry;
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const FunctionList & methods, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+ QString className = type->desc().name();
+ bool isNs = type->isNamespace();
+
+ bool resolve = type->usingTemplates() && m_pSupport->codeCompletionConfig() ->processPrimaryTypes();
+
+ CompTypeProcessor proc( type, m_pSupport->codeCompletionConfig() ->processFunctionArguments() && type->usingTemplates() );
+
+ FunctionList::ConstIterator it = methods.begin();
+ while ( it != methods.end() ) {
+ FunctionDom meth = *it;
+ ++it;
+
+ if ( isInstance && meth->isStatic() )
+ continue;
+ else if ( m_completionMode == SignalCompletion && !meth->isSignal() )
+ continue;
+ else if ( m_completionMode == SlotCompletion && !meth->isSlot() )
+ continue;
+ else if ( m_completionMode == VirtualDeclCompletion && !meth->isVirtual() )
+ continue;
+
+ if ( !isInstance && !meth->isStatic() && !isNs )
+ continue;
+
+ CodeCompletionEntry entry;
+
+ entry.comment = commentFromItem( type, model_cast<ItemDom>( meth ) );
+
+ if ( ! resolve ) {
+ entry.prefix = meth->resultType();
+ } else {
+ QString tt = meth->resultType();
+ LocateResult t = type->locateDecType( tt );
+ if ( t ) {
+ entry.prefix = t->fullNameChain();
+ } else
+ entry.prefix = meth->resultType();
+ }
+
+ if ( entry.prefix.isEmpty() && meth->name() == className )
+ entry.prefix = constructorPrefix;
+ if ( entry.prefix.isEmpty() && meth->name().startsWith( "~" ) )
+ entry.prefix = destructorPrefix;
+
+ entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
+ QString text;
+
+ ArgumentList args = meth->argumentList();
+ ArgumentList::Iterator argIt = args.begin();
+ /*
+ if ( m_completionMode == VirtualDeclCompletion )
+ {
+ //Ideally the type info would be a entry.prefix, but we need them to be
+ //inserted upon completion so they have to be part of entry.text
+ entry.text = meth->resultType();
+ entry.text += " ";
+ entry.text += meth->name();
+ }
+ else*/
+ entry.text = meth->name();
+
+ entry.text += formattedOpeningParenthesis( args.size() == 0 );
+
+ while ( argIt != args.end() ) {
+ ArgumentDom arg = *argIt;
+ ++argIt;
+
+ text += proc.processType( arg->type() );
+ if ( m_completionMode == NormalCompletion ||
+ m_completionMode == VirtualDeclCompletion )
+ text += QString( " " ) + arg->name();
+
+ if ( argIt != args.end() )
+ text += ", ";
+ }
+
+ if ( args.size() == 0 ) {
+ entry.text += formattedClosingParenthesis( true );
+ } else {
+ text += formattedClosingParenthesis( false );
+ }
+
+ int subSorting = 0;
+ if ( meth->isConstant() )
+ subSorting = 1;
+ if ( meth->isSlot() )
+ subSorting = 2;
+ if ( meth->isSignal() )
+ subSorting = 3;
+ if ( meth->isVirtual() )
+ subSorting = 4;
+ if ( meth->isStatic() )
+ subSorting = 5;
+
+ entry.userdata += QString( "%1%2%3%4%5" ).arg( meth->access() ).arg( depth ).arg( className ).arg( 1 ).arg( subSorting );
+
+ if ( m_completionMode == VirtualDeclCompletion )
+ entry.text += text + ";";
+ if ( m_completionMode != NormalCompletion )
+ entry.text += text;
+ else
+ entry.postfix = text;
+
+ if ( meth->isConstant() )
+ entry.postfix += " const";
+ if ( m_completionMode != SignalCompletion ) {
+ if ( !type->isNamespace() ) {
+ if ( meth->access() == CodeModelItem::Protected )
+ entry.postfix += "; (protected)"; // in " + type->fullType() + ")";
+ if ( meth->access() == CodeModelItem::Private )
+ entry.postfix += "; (private)"; // in " + type->fullType() + ")";
+ }
+ }
+
+ entry.text = entry.text.stripWhiteSpace();
+
+ entryList << entry;
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const VariableList & attributes, bool isInstance, int depth ) {
+ Debug d( "#cel#" );
+ QString className = type->desc().name();
+ bool isNs = type->isNamespace();
+
+ if ( !safetyCounter || !d )
+ return ;
+
+ if ( m_completionMode != NormalCompletion )
+ return ;
+ bool resolve = type->usingTemplates() && m_pSupport->codeCompletionConfig() ->processPrimaryTypes();
+
+ VariableList::ConstIterator it = attributes.begin();
+ while ( it != attributes.end() ) {
+ VariableDom attr = *it;
+ ++it;
+
+ if ( isInstance && attr->isStatic() )
+ continue;
+ if ( !isInstance && !attr->isStatic() && !isNs )
+ continue;
+
+ CodeCompletionEntry entry;
+ entry.text = attr->name();
+ entry.comment = commentFromItem( type, model_cast<ItemDom>( attr ) );
+ entry.userdata += QString( "%1%2%3%4" ).arg( attr->access() ).arg( depth ).arg( className ).arg( 2 );
+
+
+ if ( !attr->isEnumeratorVariable() ) {
+ if ( ! resolve ) {
+ entry.prefix = attr->type();
+ } else {
+ QString tt = attr->type();
+ LocateResult t = type->locateDecType( tt );
+ //SimpleType t = type->typeOf( attr->name() );
+ if ( t )
+ entry.prefix = t->fullNameChain();
+ else
+ entry.prefix = attr->type();
+ }
+ } else {
+ entry.prefix = attr->type();
+ entry.userdata += attr->type(); ///Sort enumerators by their enum
+ }
+ if ( attr->access() == CodeModelItem::Protected )
+ entry.postfix += "; (protected)"; // in " + type->fullType() + ")";
+ if ( attr->access() == CodeModelItem::Private )
+ entry.postfix += "; (private)"; // in " + type->fullType() + ")";
+
+ entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
+
+ entryList << entry;
+ }
+}
+
+void CppCodeCompletion::computeCompletionEntryList( QValueList< CodeCompletionEntry > & entryList, SimpleContext * ctx, bool /*isInstance*/, int depth ) {
+ Debug d( "#cel#" );
+ if ( !safetyCounter || !d )
+ return ;
+
+ while ( ctx ) {
+ QValueList<SimpleVariable> vars = ctx->vars();
+ QValueList<SimpleVariable>::ConstIterator it = vars.begin();
+ while ( it != vars.end() ) {
+ const SimpleVariable & var = *it;
+ ++it;
+
+ CodeCompletionEntry entry;
+ entry.prefix = var.type.fullNameChain();
+ entry.text = var.name;
+ entry.userdata = "000";
+ entry.comment = "Local variable";
+ entryList << entry;
+
+ }
+ ctx = ctx->prev();
+ }
+
+}
+
+EvaluationResult CppCodeCompletion::evaluateExpression( ExpressionInfo expr, SimpleContext* ctx ) {
+ safetyCounter.init();
+
+ //d->classNameList = typeNameList( m_pSupport->codeModel() );
+
+ CppEvaluation::ExpressionEvaluation obj( this, expr, AllOperators, getIncludeFiles(), ctx );
+
+ EvaluationResult res;
+ res = obj.evaluate();
+
+ QString resolutionType = "(resolved)";
+ if( !res->resolved() ) {
+ if( BuiltinTypes::isBuiltin( res.resultType ) ) {
+ resolutionType = "(builtin " + BuiltinTypes::comment( res.resultType ) + ")";
+ } else {
+ resolutionType = "(unresolved)";
+ }
+ }
+
+ addStatusText( i18n( "Type of \"%1\" is \"%2\", %3" ).arg( expr.expr() ).arg( res->fullNameChain() ).arg( resolutionType ), 5000 );
+
+ return res;
+}
+
+void CppCodeCompletion::computeFileEntryList( ) {
+ m_fileEntryList.clear();
+
+ QStringList fileList = m_pSupport->project() ->allFiles();
+ for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) {
+ if ( !m_pSupport->isHeader( *it ) )
+ continue;
+
+ CodeCompletionEntry entry;
+ entry.text = QFileInfo( *it ).fileName();
+
+ m_fileEntryList.push_back( entry );
+ }
+
+ m_fileEntryList = unique( m_fileEntryList );
+}
+
+HashedStringSet CppCodeCompletion::getIncludeFiles( const QString& fi ) {
+ QString file = fi;
+ if( file.isEmpty() )
+ file = m_activeFileName;
+
+ FileDom f = m_pSupport->codeModel() ->fileByName( file );
+ if( f ) {
+ ParseResultPointer p = f->parseResult();
+ if( p ) {
+ ParsedFilePointer pp = dynamic_cast<ParsedFile*>( p.data() );
+ if( pp ) {
+ return pp->includeFiles();
+ }
+ }
+ }
+ return HashedStringSet();
+}
+
+void CppCodeCompletion::slotJumpToDeclCursorContext()
+{
+ kdDebug(9007) << k_funcinfo << endl;
+ jumpCursorContext( Declaration );
+}
+
+void CppCodeCompletion::slotJumpToDefCursorContext()
+{
+ kdDebug(9007) << k_funcinfo << endl;
+ jumpCursorContext( Definition );
+}
+
+void CppCodeCompletion::jumpCursorContext( FunctionType f )
+{
+ if ( !m_activeCursor ) return;
+
+ SimpleTypeConfiguration conf( m_activeFileName );
+
+ unsigned int line;
+ unsigned int column;
+ m_activeCursor->cursorPositionReal( &line, &column );
+
+ EvaluationResult result = evaluateExpressionAt( line, column, conf );
+
+ // Determine the declaration info based on the type of item we are dealing with.
+ DeclarationInfo d;
+
+ QString includeFileName, includeFilePath;
+ bool unused;
+
+ if ( result.isMacro ) {
+ d.name = result.macro.name();
+ d.file = result.macro.fileName();
+ d.startLine = d.endLine = result.macro.line();
+ d.startCol = d.endCol = result.macro.column();
+ } else if ( getIncludeInfo( line, includeFileName, includeFilePath, unused ) ) {
+ d.name = includeFileName;
+ d.file = includeFilePath;
+ } else {
+ d = result.sourceVariable;
+ }
+ if ( !d ) {
+ LocateResult type = result.resultType;
+ if ( type && type->resolved() ) {
+ // Is it a namespace?
+ if ( type->resolved()->isNamespace() ) {
+ SimpleTypeCachedNamespace * ns = dynamic_cast<SimpleTypeCachedNamespace*>( type->resolved().data() );
+ if ( ns ) {
+ SimpleTypeNamespace::SlaveList slaves = ns->getSlaves( getIncludeFiles() );
+ if ( slaves.begin() != slaves.end() ) {
+ SimpleTypeCachedCodeModel * item = dynamic_cast<SimpleTypeCachedCodeModel*>( ( *slaves.begin() ).first.first.resolved().data() );
+ if ( item && item->item() && item->item()->isNamespace() ) {
+ NamespaceModel* ns = dynamic_cast<NamespaceModel*>( item->item().data() );
+ QStringList wholeScope = ns->scope();
+ wholeScope << ns->name();
+ FileList files = cppSupport()->codeModel()->fileList();
+ for ( FileList::iterator it = files.begin(); it != files.end(); ++it ) {
+ NamespaceModel* ns = (*it).data();
+ for ( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
+ if ( ns->hasNamespace( (*it2) ) ) {
+ ns = ns->namespaceByName( *it2 );
+ if ( !ns ) break;
+ } else {
+ ns = 0;
+ break;
+ }
+ }
+ if ( ns ) {
+ d.name = ns->name();
+ ns->getStartPosition( &d.startLine, &d.startCol );
+ ns->getEndPosition( &d.endLine, &d.endCol );
+ d.file = ns->fileName();
+ break;
+ }
+ }
+ }
+ }
+ }
+ } else {
+ // Not a namespace, we can get the declaration info straight from the type description.
+ d = type->resolved()->getDeclarationInfo();
+ }
+ }
+ // Unresolved, maybe its a named enumeration?
+ else if ( type && type.trace() ) {
+ QValueList< QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = type.trace()->trace();
+ if ( !trace.isEmpty() ) {
+ if ( trace.begin() != trace.end() ) {
+ d = ( *trace.begin() ).first.decl;
+ }
+ }
+ }
+ }
+ if ( d ) {
+ QString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator QString();
+ if ( f == Definition && cppSupport()->switchHeaderImpl( fileName, d.startLine, d.startCol ) )
+ return;
+ cppSupport()->partController()->editDocument( fileName, d.startLine );
+ }
+}
+
+QString CppCodeCompletion::createTypeInfoString( int line, int column )
+{
+ QString typeInfoString;
+
+ SimpleTypeConfiguration conf( m_activeFileName );
+ EvaluationResult type = evaluateExpressionAt( line, column, conf );
+
+ if ( type.expr.expr().stripWhiteSpace().isEmpty() )
+ return typeInfoString;
+
+ typeInfoString += type.expr.expr() + QString(" : " );
+
+ if ( type->resolved() )
+ {
+ QString scope = type->resolved()->scope().join("::");
+ int pos = scope.findRev("::");
+ if ( scope.isEmpty() || pos == -1 )
+ {
+ scope = "::";
+ }
+ else
+ {
+ scope.truncate( pos + 2 );
+ }
+
+ typeInfoString += scope + type->fullNameChain() + QString( i18n(" (resolved) ") );
+ }
+ else
+ {
+ if ( type )
+ {
+ if( !BuiltinTypes::isBuiltin( type.resultType ) )
+ {
+ typeInfoString += type->fullNameChain() + QString( i18n(" (unresolved) ") );
+ }
+ else
+ {
+ typeInfoString += type->fullNameChain() + ", " + BuiltinTypes::comment( type.resultType ) + QString( i18n(" (builtin type) ") );
+ }
+ }
+ else
+ {
+ typeInfoString += QString( i18n(" (unresolved) ") );
+ }
+ }
+
+ if( cppSupport() && type->resolved() && cppSupport()->codeCompletionConfig()->preProcessAllHeaders() ) {
+ DeclarationInfo decl = type->resolved()->getDeclarationInfo();
+ if( !getIncludeFiles()[ HashedString( decl.file ) ] ) {
+ typeInfoString += " [header not included] ";
+ }
+ }
+
+ return typeInfoString;
+}
+
+bool CppCodeCompletion::getIncludeInfo( int line, QString& includeFileName, QString& includeFilePath, bool& usedProjectFiles )
+{
+ bool isIncludeDirective = false;
+ QString lineText = getText( line, 0, line+1, 0 );
+ QRegExp includeRx( "(?:#include[\\s]*(?:\\\"|\\<))([^\\n]*)(\\\"|\\>)" );
+ if( includeRx.search( lineText ) != -1 ) {
+ //It is an include-directive. The regular expression captures the string, and the closing sign('"' or '>').
+ isIncludeDirective = true;
+ usedProjectFiles = false;
+ QStringList captured = includeRx.capturedTexts();
+ if( captured.size() == 3 ) {
+ Dependence d;
+ d.first = captured[1];
+ d.second = captured[2] == "\"" ? Dep_Local : Dep_Global;
+ includeFilePath = cppSupport()->driver()->findIncludeFile( d, activeFileName() );
+ if( includeFilePath.isEmpty() ) {
+ //A simple backup-algorithm that can only find files within the same project
+ includeFilePath = cppSupport()->findHeaderSimple( d.first );
+ usedProjectFiles = true;
+ }
+ includeFileName = d.first;
+ } else {
+ kdDebug( 9007 ) << "wrong count of captured items" << endl;
+ }
+ }
+ return isIncludeDirective;
+}
+
+
+#include "cppcodecompletion.moc"
+//kate: indent-mode csands; tab-width 2; space-indent off;
+
diff --git a/languages/cpp/cppcodecompletion.h b/languages/cpp/cppcodecompletion.h
new file mode 100644
index 00000000..0eb49908
--- /dev/null
+++ b/languages/cpp/cppcodecompletion.h
@@ -0,0 +1,324 @@
+/***************************************************************************
+ cppcodecompletion.h - description
+ -------------------
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __CPPCODECOMPLETION_H__
+#define __CPPCODECOMPLETION_H__
+
+#include "cppsupportpart.h"
+#include "declarationinfo.h"
+
+#include <ast.h>
+#include <codemodel.h>
+#include <set>
+
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+#include <ktexteditor/texthintinterface.h>
+#include <ktexteditor/cursorinterface.h>
+#include <ktexteditor/view.h>
+
+#include <qobject.h>
+#include <qmutex.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+#include <qguardedptr.h>
+#include <qregexp.h>
+
+#include "driver.h"
+///A little debugging class
+#include <qpopupmenu.h>
+class PopupTracker : public QObject {
+ Q_OBJECT
+public:
+ static PopupTracker* pt;
+
+ static uint pendingPopups;
+
+ static QPopupMenu* createPopup( QWidget* parent ) {
+ if( !pt ) pt = new PopupTracker();
+ QPopupMenu* m = new QPopupMenu( parent );
+ ++pendingPopups;
+ connect( m, SIGNAL(destroyed()), pt, SLOT(destroyedPopup()) );
+ return m;
+ }
+
+ static void print() {
+ if( pendingPopups )
+ kdDebug( 9007 ) << "PopupTracker: " << pendingPopups << " popups are still alive" << endl;
+ }
+
+public slots:
+ void destroyedPopup() {
+ --pendingPopups;
+ }
+};
+
+
+class CodeCompletionEntry;
+class CodeInformationRepository;
+class SimpleContext;
+class SimpleType;
+class SimpleTypeNamespace;
+class CppCodeCompletionData;
+class SimpleTypeConfiguration;
+class TypeDesc;
+struct PopupFillerHelpStruct;
+struct PopupClassViewFillerHelpStruct;
+class SimpleTypeImpl;
+class TranslationUnitAST;
+namespace CppEvaluation
+{
+ class EvaluationResult;
+}
+struct ExpressionInfo;
+
+typedef KSharedPtr<SimpleTypeImpl> TypePointer;
+
+class CppCodeCompletion : public QObject
+{
+ Q_OBJECT
+public:
+ friend class SimpleType;
+ enum CompletionMode
+ {
+ NormalCompletion,
+ SignalCompletion,
+ SlotCompletion,
+ VirtualDeclCompletion
+ };
+ enum MemberAccessOp
+ {
+ NoOp,
+ DotOp,
+ ArrowOp
+ };
+
+public:
+ CppCodeCompletion( CppSupportPart* part );
+ virtual ~CppCodeCompletion();
+
+ CodeInformationRepository* repository()
+ {
+ return m_repository;
+ }
+ CompletionMode completionMode() const
+ {
+ return m_completionMode;
+ }
+
+ QString createTypeInfoString( int line, int column );
+
+ QString replaceCppComments( const QString& contents );
+ int expressionAt( const QString& text, int index );
+ QStringList splitExpression( const QString& text );
+
+ CppEvaluation::EvaluationResult evaluateExpression( ExpressionInfo expr, SimpleContext* ctx );
+
+ CppEvaluation::EvaluationResult evaluateExpressionAt( int line, int column, SimpleTypeConfiguration& conf, bool ifUnknownSetType = false );
+
+ void contextEvaluationMenus ( QPopupMenu *popup, const Context *context, int line, int col );
+
+ CppSupportPart* cppSupport() const;
+
+ HashedStringSet getIncludeFiles( const QString& file = QString() );
+
+ static CppCodeCompletion* instance() {
+ return m_instance;
+ }
+
+ ///Adds a string that will be ticked through the status-bar
+ void addStatusText( QString text, int timeout );
+ void clearStatusText();
+
+ QString activeFileName() const {
+ return m_activeFileName;
+ }
+
+public slots:
+ /**
+ * @param invokedOnDemand if true and there is exactly one matching entry
+ * complete the match immediately without showing the completion box.
+ * This is only true, when the users invokes the completion himself
+ * (eg presses the completion shortcut CTRL+space)
+ */
+ void completeText( bool invokedOnDemand = false );
+private slots:
+ void emptyCache();
+ void slotPartAdded( KParts::Part *part );
+ void slotActivePartChanged( KParts::Part *part );
+ void slotArgHintHidden();
+ void slotCompletionBoxHidden();
+ void slotTextChanged();
+ void slotFileParsed( const QString& fileName );
+ void slotCodeModelUpdated( const QString& fileName );
+ void slotTimeout();
+ void slotStatusTextTimeout();
+ void computeFileEntryList();
+ bool isTypeExpression( const QString& expr );
+ void slotTextHint( int line, int col, QString &text );
+ void popupAction( int number );
+ void popupDefinitionAction( int number );
+ void popupClassViewAction( int number );
+ void synchronousParseReady( const QString& file, ParsedFilePointer unit );
+ void slotJumpToDefCursorContext();
+ void slotJumpToDeclCursorContext();
+
+private:
+ enum FunctionType { Declaration, Definition };
+
+ TypePointer createGlobalNamespace();
+ bool functionContains( FunctionDom f , int line, int col );
+ void getFunctionBody( FunctionDom f , int& line, int& col );
+ void selectItem( ItemDom item );
+ void addTypePopups( QPopupMenu* parent, TypeDesc d, QString depthAdd, QString prefix = "" );
+ void addTypeClassPopups( QPopupMenu* parent, TypeDesc d, QString depthAdd, QString prefix = "" );
+ QValueList<QStringList> computeSignatureList( CppEvaluation::EvaluationResult function );
+ void integratePart( KParts::Part* part );
+ void setupCodeInformationRepository();
+ FunctionDefinitionAST* functionDefinition( AST* node );
+ void computeRecoveryPoints( ParsedFilePointer unit );
+ void computeRecoveryPointsLocked();
+ void jumpCursorContext( FunctionType );
+ bool getIncludeInfo( int line, QString& includeFileName, QString& includeFilePath, bool& usedProjectFiles );
+
+ enum EvaluateExpressionOptions {
+ IncludeStandardExpressions = 1,
+ IncludeTypeExpression = 2,
+ CompletionOption = 4, ///Cut off the last word because it is incomplete
+ SearchInFunctions = 8,
+ SearchInClasses = 16,
+ DefaultAsTypeExpression = 32, ///This makes the evaluation interpret any unidentified expression as a type-expression
+ DefaultEvaluationOptions = 1 | 2 | 8 | 16,
+ DefaultCompletionOptions = 1 | 4 | 8 | 16
+ };
+
+ bool mayBeTypeTail( int line, int column, QString& append, bool inFunction = false );
+ bool canBeTypePrefix( const QString& prefix, bool inFunction = false );
+
+
+ ExpressionInfo findExpressionAt( int line, int col, int startLine, int startCol, bool inFunction = false );
+ SimpleContext* computeFunctionContext( FunctionDom f, int line, int col, SimpleTypeConfiguration& conf );
+
+ CppEvaluation::EvaluationResult evaluateExpressionType( int line, int column, SimpleTypeConfiguration& conf, EvaluateExpressionOptions opt = DefaultCompletionOptions );
+ SimpleType unTypeDef( SimpleType scope , QMap<QString, QString>& typedefs );
+
+ // QString buildSignature( TypePointer currType );
+ SimpleType typeOf( QValueList<Tag>& tags, MemberAccessOp accessOp );
+
+ /// @todo remove isInstance
+ void computeCompletionEntryList( QValueList<CodeCompletionEntry>& entryList, SimpleContext* ctx, bool isInstance, int depth = 0 );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>&
+ entryList, const QStringList& typeList, SimpleTypeNamespace* ns, std::set<HashedString>& ignore, bool isInstance, int depth = 0 );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>&
+ entryList, const QStringList& typeList, bool isInstance, int depth = 0 );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, QValueList<Tag>& tags, bool isInstance, int depth );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, ClassDom klass, bool isInstance, int depth );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, NamespaceDom scope, bool isInstance, int depth );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, const FunctionList& methods, bool isInstance, int depth );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, const VariableList& attributes, bool isInstance, int depth );
+ void computeCompletionEntryList( QString parent, SimpleType type, QValueList<CodeCompletionEntry>& entryList, const ClassList& lst, bool isInstance, int depth );
+ void computeCompletionEntryList( QString parent, SimpleType type, QValueList<CodeCompletionEntry>& entryList, const TypeAliasList& lst, bool isInstance, int depth );
+ void computeCompletionEntryList( SimpleType type, QValueList<CodeCompletionEntry>& entryList, const NamespaceList& lst, bool isInstance, int depth );
+
+ SimpleContext* computeContext( FunctionDefinitionAST* ast, int line, int col, int lineOffset, int colOffset );
+ void computeContext( SimpleContext*& ctx, StatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, StatementListAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, IfStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, ForStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, DoStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, WhileStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, SwitchStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, ConditionAST* ast, int line, int col );
+ bool inContextScope( AST* ast, int line, int col, bool checkStart = true, bool checkEnd = true );
+
+ QString getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine = -1 );
+
+
+private:
+
+ friend class SimpleTypeCatalog;
+ friend class SimpleTypeCodeModel;
+ friend class SimpleTypeImpl;
+ friend class ExpressionEvaluation;
+ friend class PopupFillerHelpStruct;
+ friend class PopupClassViewFillerHelpStruct;
+ QGuardedPtr<CppSupportPart> m_pSupport;
+ QTimer* m_ccTimer;
+ QTimer* m_showStatusTextTimer;
+ QValueList<QPair<int, QString> > m_statusTextList;
+
+ void fitContextItem( int nLine, int nColumn );
+ void needRecoveryPoints();
+
+ QString m_activeFileName;
+ KTextEditor::ViewCursorInterface* m_activeCursor;
+ KTextEditor::EditInterface* m_activeEditor;
+ KTextEditor::TextHintInterface* m_activeHintInterface;
+ KTextEditor::CodeCompletionInterface* m_activeCompletion;
+ KTextEditor::View* m_activeView;
+
+ bool m_bArgHintShow;
+ bool m_bCompletionBoxShow;
+ bool m_blockForKeyword;
+ bool m_demandCompletion;
+
+ unsigned int m_ccLine;
+ unsigned int m_ccColumn;
+ static CppCodeCompletion* m_instance;
+
+ CodeInformationRepository* m_repository;
+ CppCodeCompletionData* d;
+ CompletionMode m_completionMode;
+
+ QTime m_lastHintTime;
+
+ //If more then the given count of comments were requested, all following ones will be blank.(Performance-reasons)
+ void setMaxComments( int count );
+
+ QString commentFromItem( const SimpleType& parent, const ItemDom& item );
+ QString commentFromTag( const SimpleType& parent, Tag& tag );
+
+ ItemDom m_cachedFromContext; ///Can be a function or a class, representing the position from where the last completion was started. Necessary as long as all imports are put into the global namespace.
+
+ QRegExp m_includeRx;
+ QRegExp m_cppCodeCommentsRx;
+ QRegExp m_codeCompleteChRx;
+ QRegExp m_codeCompleteCh2Rx;
+ QValueList<KTextEditor::CompletionEntry> m_fileEntryList;
+
+ int m_maxComments;
+
+ typedef QMap<int, DeclarationInfo> PopupActions;
+ typedef QMap<int, ItemDom> PopupClassViewActions;
+ PopupActions m_popupActions;
+ PopupActions m_popupDefinitionActions;
+ PopupClassViewActions m_popupClassViewActions;
+
+ // we need something to plug actions that are not in any menu
+ // into in order for their shortcuts to work
+ QWidget m_DummyActionWidget;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/cppcodecompletionconfig.cpp b/languages/cpp/cppcodecompletionconfig.cpp
new file mode 100644
index 00000000..2c394858
--- /dev/null
+++ b/languages/cpp/cppcodecompletionconfig.cpp
@@ -0,0 +1,151 @@
+//
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: Roberto Raggi <robertol@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "cppcodecompletionconfig.h"
+#include "cppsupportpart.h"
+
+#include <domutil.h>
+
+#include <kdebug.h>
+#include <qdom.h>
+
+QString CppCodeCompletionConfig::defaultPath = QString::fromLatin1( "/kdevcppsupport/codecompletion" );
+
+CppCodeCompletionConfig::CppCodeCompletionConfig( CppSupportPart * part, QDomDocument* dom )
+ : QObject( part ), m_part( part ), m_dom( dom )
+{
+ init();
+}
+
+CppCodeCompletionConfig::~CppCodeCompletionConfig()
+{}
+
+void CppCodeCompletionConfig::init( )
+{
+/* m_includeGlobalFunctions = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeGlobalFunctions", true );
+ m_includeTypes = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeTypes", true );
+ m_includeEnums = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeEnums", true );
+ m_includeTypedefs = DomUtil::readBoolEntry( *m_dom, defaultPath + "/includeTypedefs", false );*/
+ m_automaticCodeCompletion = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticCodeCompletion", false );
+ m_automaticArgumentsHint = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticArgumentsHint", true );
+ m_automaticHeaderCompletion = DomUtil::readBoolEntry( *m_dom, defaultPath + "/automaticHeaderCompletion", true );
+ m_codeCompletionDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/codeCompletionDelay", 250 );
+ m_argumentsHintDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/argumentsHintDelay", 400 );
+ m_headerCompletionDelay = DomUtil::readIntEntry( *m_dom, defaultPath + "/headerCompletionDelay", 250 );
+
+ m_showOnlyAccessibleItems = DomUtil::readBoolEntry( *m_dom, defaultPath + "/showOnlyAccessibleItems", false );
+ m_completionBoxItemOrder = (CompletionBoxItemOrder)DomUtil::readIntEntry( *m_dom, defaultPath + "/completionBoxItemOrder", ByAccessLevel );
+ m_showEvaluationContextMenu = DomUtil::readBoolEntry( *m_dom, defaultPath + "/howEvaluationContextMenu", true );
+ m_showCommentWithArgumentHint = DomUtil::readBoolEntry( *m_dom, defaultPath + "/showCommentWithArgumentHint", true );
+ m_statusBarTypeEvaluation = DomUtil::readBoolEntry( *m_dom, defaultPath + "/statusBarTypeEvaluation", false );
+ m_namespaceAliases = DomUtil::readEntry( *m_dom, defaultPath + "/namespaceAliases", "std=_GLIBCXX_STD;__gnu_cxx=std" );
+ m_processPrimaryTypes = DomUtil::readBoolEntry( *m_dom, defaultPath + "/processPrimaryTypes", true );
+ m_processFunctionArguments = DomUtil::readBoolEntry( *m_dom, defaultPath + "/processFunctionArguments", false );
+
+ m_preProcessAllHeaders = DomUtil::readBoolEntry( *m_dom, defaultPath + "/preProcessAllHeaders", false );
+ m_parseMissingHeaders = DomUtil::readBoolEntry( *m_dom, defaultPath + "/parseMissingHeadersExperimental", false );
+ m_resolveIncludePaths = DomUtil::readBoolEntry( *m_dom, defaultPath + "/resolveIncludePathsUsingMakeExperimental", false );
+ m_alwaysParseInBackground = DomUtil::readBoolEntry( *m_dom, defaultPath + "/alwaysParseInBackground", true );
+ m_usePermanentCaching = DomUtil::readBoolEntry( *m_dom, defaultPath + "/usePermanentCaching", true );
+ m_alwaysIncludeNamespaces = DomUtil::readBoolEntry( *m_dom, defaultPath + "/alwaysIncludeNamespaces", false );
+ m_includePaths = DomUtil::readEntry( *m_dom, defaultPath + "/includePaths", ".;" );
+
+
+}
+
+void CppCodeCompletionConfig::store( )
+{
+/* DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeGlobalFunctions", m_includeGlobalFunctions );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeTypes", m_includeTypes );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeEnums", m_includeEnums );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/includeTypedefs", m_includeTypedefs );*/
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticCodeCompletion", m_automaticCodeCompletion );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticArgumentsHint", m_automaticArgumentsHint );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/automaticHeaderCompletion", m_automaticHeaderCompletion );
+ DomUtil::writeIntEntry( *m_dom, defaultPath + "/codeCompletionDelay", m_codeCompletionDelay );
+ DomUtil::writeIntEntry( *m_dom, defaultPath + "/argumentsHintDelay", m_argumentsHintDelay );
+ DomUtil::writeIntEntry( *m_dom, defaultPath + "/headerCompletionDelay", m_headerCompletionDelay );
+
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/showOnlyAccessibleItems", m_showOnlyAccessibleItems );
+ DomUtil::writeIntEntry( *m_dom, defaultPath + "/completionBoxItemOrder", m_completionBoxItemOrder );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/howEvaluationContextMenu", m_showEvaluationContextMenu );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/showCommentWithArgumentHint", m_showCommentWithArgumentHint );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/statusBarTypeEvaluation", m_statusBarTypeEvaluation );
+ DomUtil::writeEntry( *m_dom, defaultPath + "/namespaceAliases", m_namespaceAliases );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/processPrimaryTypes", m_processPrimaryTypes );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/processFunctionArguments", m_processFunctionArguments );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/preProcessAllHeaders", m_preProcessAllHeaders );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/parseMissingHeadersExperimental", m_parseMissingHeaders );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/resolveIncludePathsUsingMakeExperimental", m_resolveIncludePaths );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/alwaysParseInBackground", m_alwaysParseInBackground );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/usePermanentCaching", m_usePermanentCaching );
+ DomUtil::writeBoolEntry( *m_dom, defaultPath + "/alwaysIncludeNamespaces", m_alwaysIncludeNamespaces );
+ DomUtil::writeEntry( *m_dom, defaultPath + "/includePaths", m_includePaths );
+
+ emit stored();
+}
+
+// void CppCodeCompletionConfig::setIncludeTypes( bool b )
+// {
+// m_includeTypes = b;
+// }
+//
+// void CppCodeCompletionConfig::setIncludeEnums( bool b )
+// {
+// m_includeEnums = b;
+// }
+//
+// void CppCodeCompletionConfig::setIncludeTypedefs( bool b )
+// {
+// m_includeTypedefs = b;
+// }
+
+void CppCodeCompletionConfig::setAutomaticCodeCompletion( bool b )
+{
+ m_automaticCodeCompletion = b;
+}
+
+void CppCodeCompletionConfig::setAutomaticArgumentsHint( bool b )
+{
+ m_automaticArgumentsHint = b;
+}
+
+void CppCodeCompletionConfig::setCodeCompletionDelay( int delay )
+{
+ m_codeCompletionDelay = delay;
+}
+
+void CppCodeCompletionConfig::setArgumentsHintDelay( int delay )
+{
+ m_argumentsHintDelay = delay;
+}
+
+// void CppCodeCompletionConfig::setIncludeGlobalFunctions( bool b )
+// {
+// m_includeGlobalFunctions = b;
+// }
+
+void CppCodeCompletionConfig::setHeaderCompletionDelay( int delay )
+{
+ m_headerCompletionDelay = delay;
+}
+
+void CppCodeCompletionConfig::setAutomaticHeaderCompletion( bool b )
+{
+ m_automaticHeaderCompletion = b;
+}
+
+bool CppCodeCompletionConfig::showNamespaceAppearances() const {
+ return true;
+}
+
+#include "cppcodecompletionconfig.moc"
diff --git a/languages/cpp/cppcodecompletionconfig.h b/languages/cpp/cppcodecompletionconfig.h
new file mode 100644
index 00000000..13b23ccf
--- /dev/null
+++ b/languages/cpp/cppcodecompletionconfig.h
@@ -0,0 +1,310 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Roberto Raggi <robertol@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CPPCODECOMPLETIONCONFIG_H
+#define CPPCODECOMPLETIONCONFIG_H
+
+#include <qobject.h>
+
+class CppSupportPart;
+class QDomDocument;
+
+
+/**
+@author Roberto Raggi
+*/
+class CppCodeCompletionConfig : public QObject
+{
+ Q_OBJECT
+public:
+ CppCodeCompletionConfig( CppSupportPart* part, QDomDocument* dom );
+ virtual ~CppCodeCompletionConfig();
+
+// bool includeGlobalFunctions() const
+// {
+// return m_includeGlobalFunctions;
+// }
+//
+// void setIncludeGlobalFunctions( bool b );
+//
+// bool includeTypes() const
+// {
+// return m_includeTypes;
+// }
+//
+// void setIncludeTypes( bool b );
+//
+// bool includeEnums() const
+// {
+// return m_includeEnums;
+// }
+//
+// void setIncludeEnums( bool b );
+//
+// bool includeTypedefs() const
+// {
+// return m_includeTypedefs;
+// }
+//
+// void setIncludeTypedefs( bool b );
+
+ enum CompletionBoxItemOrder {
+ ByAccessLevel,
+ ByClass,
+ ByAlphabet
+ };
+
+ ///Whether the completion-cache should be kept alive as long as the context does not change
+ bool usePermanentCaching() const {
+ return m_usePermanentCaching;
+ }
+
+ void setUsePermanentCaching(bool b) {
+ m_usePermanentCaching = b;
+ }
+
+ ///Whether higher namespaces(like the global one) should be included while computing the
+ ///completion-list when using automatic code-completion. Should get an option in the interface(slows down the completion).
+ bool alwaysIncludeNamespaces() const {
+ return m_alwaysIncludeNamespaces;
+ }
+
+ void setAlwaysIncludeNamespaces(bool b) {
+ m_alwaysIncludeNamespaces = b;
+ }
+
+ ///Whether all included headers should be processed by the preprocessor(makes macros work across header-files)
+ void setPreProcessAllHeaders(bool b) {
+ m_preProcessAllHeaders = b;
+ }
+
+ ///Whether headers that were found and were not yet parsed in their active state should be parsed into the code-model
+ void setParseMissingHeaders(bool b) {
+ m_parseMissingHeaders = b;
+ }
+
+ ///Additional include-paths defined by the user
+ void setCustomIncludePaths(QString str) {
+ m_includePaths = str;
+ }
+
+ ///Whether we should try to automatically find out the used include-path from Makefiles etc.
+ void setResolveIncludePaths(bool b) {
+ m_resolveIncludePaths = b;
+ }
+
+ ///Whether higher namespaces(like the global one) should be included while computing the
+ ///completion-list when using automatic code-completion. Should get an option in the interface(slows down the completion).
+
+ ///Whether all included headers should be processed by the preprocessor(makes macros work across header-files)
+ bool preProcessAllHeaders() const {
+ return m_preProcessAllHeaders;
+ }
+
+ ///Whether headers that were found and were not yet parsed in their active state should be parsed into the code-model
+ bool parseMissingHeaders() const {
+ return m_parseMissingHeaders;
+ }
+
+ ///Additional include-paths defined by the user
+ QString customIncludePaths() const {
+ return m_includePaths;
+ }
+
+ ///Whether we should try to automatically find out the used include-path from Makefiles etc.
+ bool resolveIncludePaths() const {
+ return m_resolveIncludePaths;
+ }
+
+ bool alwaysParseInBackground() const {
+ return m_alwaysParseInBackground;
+ }
+
+ void setAlwaysParseInBackground(bool b) {
+ m_alwaysParseInBackground = b;
+ }
+
+ bool showNamespaceAppearances() const;
+
+ bool showOnlyAccessibleItems() const {
+ ///not yet used
+ return m_showOnlyAccessibleItems;
+ }
+
+ CompletionBoxItemOrder completionBoxItemOrder() const {
+ ///not yet used
+ return m_completionBoxItemOrder;
+ }
+
+ bool showEvaluationContextMenu() const {
+ ///used
+ return m_showEvaluationContextMenu;
+ }
+
+ bool showCommentWithArgumentHint() const {
+ ///used
+ return m_showCommentWithArgumentHint;
+ }
+
+ bool statusBarTypeEvaluation() const {
+ ///used
+ return m_statusBarTypeEvaluation;
+ }
+
+ QString namespaceAliases() const {
+ ///used
+ return m_namespaceAliases;
+ }
+
+ bool processPrimaryTypes() const { ///The "do complete return-type-evaluation" entry. However it should be renamed, because it also covers Variable-types and typedefs!
+ ///used
+ return m_processPrimaryTypes;
+ }
+
+ bool processFunctionArguments() const { ///The "do complete argument-type-evaluation" entry
+ ///used
+ return m_processFunctionArguments;
+ }
+
+
+ void setShowOnlyAccessibleItems( bool b ) {
+ ///not yet used
+ m_showOnlyAccessibleItems = b;
+ }
+
+ void setCompletionBoxItemOrder( CompletionBoxItemOrder b ) {
+ ///not yet used
+ m_completionBoxItemOrder = b;
+ }
+
+ void setShowEvaluationContextMenu( bool b ) {
+ ///used
+ m_showEvaluationContextMenu = b;
+ }
+
+ void setShowCommentWithArgumentHint( bool b ) {
+ ///used
+ m_showCommentWithArgumentHint = b;
+ }
+
+ void setStatusBarTypeEvaluation( bool b ) {
+ ///used
+ m_statusBarTypeEvaluation = b;
+ }
+
+ void setNamespaceAliases( QString n ) {
+ ///used
+ m_namespaceAliases = n;
+ }
+
+ void setProcessPrimaryTypes( bool b ) { ///The "do complete return-type-evaluation" entry. However it should be renamed, because it also covers Variable-types and typedefs!
+ ///used
+ m_processPrimaryTypes = b;
+ }
+
+ void setProcessFunctionArguments( bool b ) { ///The "do complete argument-type-evaluation" entry
+ ///used
+ m_processFunctionArguments = b;
+ }
+
+ bool automaticCodeCompletion() const {
+ return m_automaticCodeCompletion;
+ }
+
+
+ void setAutomaticCodeCompletion( bool b );
+
+ bool automaticArgumentsHint() const
+ {
+ ///used
+ return m_automaticArgumentsHint;
+ }
+
+ void setAutomaticArgumentsHint( bool b );
+
+ bool automaticHeaderCompletion() const
+ {
+ ///used
+ return m_automaticHeaderCompletion;
+ }
+
+ void setAutomaticHeaderCompletion( bool b );
+
+ int codeCompletionDelay() const
+ {
+ ///used
+ return m_codeCompletionDelay;
+ }
+
+ void setCodeCompletionDelay( int delay );
+
+ int argumentsHintDelay() const
+ {
+ ///used
+ return m_argumentsHintDelay;
+ }
+
+ void setArgumentsHintDelay( int delay );
+
+ int headerCompletionDelay() const
+ {
+ ///used
+ return m_headerCompletionDelay;
+ }
+
+ void setHeaderCompletionDelay( int delay );
+
+public slots:
+ void store();
+
+signals:
+ void stored();
+
+private:
+ void init();
+
+private:
+ CppSupportPart* m_part;
+ QDomDocument* m_dom;
+/* bool m_includeGlobalFunctions;
+ bool m_includeTypes;
+ bool m_includeEnums;
+ bool m_includeTypedefs;*/
+ bool m_automaticCodeCompletion;
+ bool m_automaticArgumentsHint;
+ bool m_automaticHeaderCompletion;
+ int m_codeCompletionDelay;
+ int m_argumentsHintDelay;
+ int m_headerCompletionDelay;
+
+ bool m_preProcessAllHeaders;
+ bool m_parseMissingHeaders;
+ bool m_resolveIncludePaths;
+ bool m_alwaysIncludeNamespaces;
+ bool m_alwaysParseInBackground;
+ bool m_usePermanentCaching;
+ QString m_includePaths;
+
+ bool m_showOnlyAccessibleItems;
+ CompletionBoxItemOrder m_completionBoxItemOrder;
+ bool m_showEvaluationContextMenu;
+ bool m_showCommentWithArgumentHint;
+ bool m_statusBarTypeEvaluation;
+ QString m_namespaceAliases;
+ bool m_processPrimaryTypes;
+ bool m_processFunctionArguments;
+
+ static QString defaultPath;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/cppevaluation.cpp b/languages/cpp/cppevaluation.cpp
new file mode 100644
index 00000000..ff1f4ab9
--- /dev/null
+++ b/languages/cpp/cppevaluation.cpp
@@ -0,0 +1,483 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "cppevaluation.h"
+#include "simplecontext.h"
+#include "safetycounter.h"
+
+extern SafetyCounter safetyCounter;
+
+namespace CppEvaluation {
+
+void statusLog( const QString& str ) {
+ ifVerboseMajor( dbgMajor() << str << endl );
+ statusBarText( str, 2000 );
+}
+OperatorSet AllOperators;
+
+///These lines register the operators to the list of all operators
+RegisterOperator< DotOperator > DotReg( AllOperators );
+RegisterOperator< NestedTypeOperator > NestedReg( AllOperators );
+RegisterOperator< ArrowOperator > ArrowReg( AllOperators );
+RegisterOperator< StarOperator > StarReg( AllOperators );
+RegisterOperator< AddressOperator > AddressReg( AllOperators );
+RegisterOperator< IndexOperator > IndexReg( AllOperators );
+RegisterOperator< ParenOperator > ParenReg( AllOperators );
+
+template<class To, class From>
+QValueList<To> convertList( const QValueList<From>& from ) {
+ QValueList<To> ret;
+ for( typename QValueList<From>::const_iterator it = from.begin(); it != from.end(); ++it ) {
+ ret << (To)*it;
+ }
+ return ret;
+}
+
+QString nameFromType( SimpleType t ) {
+ return t->fullTypeResolved();
+}
+
+QString Operator::printTypeList( QValueList<EvaluationResult>& lst )
+{
+ QString ret;
+ for( QValueList<EvaluationResult>::iterator it = lst.begin(); it != lst.end(); ++it ) {
+ ret += "\"" + (*it)->fullNameChain() + "\", ";
+ }
+ ret.truncate( ret.length() - 3 );
+ return ret;
+}
+
+void Operator::log( const QString& msg ) {
+ statusLog( "\"" + name() + "\": " + msg );
+ //ifVerboseMajor( dbgMajor() << "\"" << name() << "\": " << msg << endl );
+}
+
+OperatorSet::~OperatorSet() {
+ for( QValueList< Operator* >::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) {
+ delete *it;
+ }
+}
+
+OperatorIdentification OperatorSet::identifyOperator( const QString& str_ , Operator::BindingSide allowedBindings) {
+ QString str = str_.stripWhiteSpace();
+ for( OperatorList::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) {
+ if( ((*it)->binding() & allowedBindings) == (*it)->binding() ) {
+ if( OperatorIdentification ident = (*it)->identify( str ) ) {
+ return ident;
+ }
+ }
+ }
+
+ return OperatorIdentification();
+}
+
+OperatorIdentification UnaryOperator::identify( QString& str ) {
+ OperatorIdentification ret;
+ if( str.startsWith( m_identString ) ) {
+ ret.start = 0;
+ ret.end = m_identString.length();
+ ret.found = true;
+ ret.op = this;
+ }
+ return ret;
+}
+
+EvaluationResult UnaryOperator::apply( QValueList<EvaluationResult> params, QValueList<EvaluationResult> innerParams ) {
+ if( !checkParams( params ) ) {
+ log( QString("parameter-check failed: %1 params: ").arg( params.size() ) + printTypeList( params ) );
+ return EvaluationResult();
+ } else {
+ EvaluationResult t = unaryApply( params.front(), innerParams );
+ if( !t ) {
+ if( params.front() )
+ log( "could not apply \"" + name() + "\" to \"" + nameFromType( params.front() ) + "\"");
+ else
+ log( "operator \"" + name() + "\" applied on \"" + nameFromType( params.front() ) + "\": returning unresolved type \"" + nameFromType( t ) + "\"");
+ }
+ return t;
+ }
+}
+
+EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+ return param;
+}
+
+EvaluationResult DotOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+ if( param->totalPointerDepth() == 0 ) {
+ return param;
+ } else {
+ log( "failed to apply dot-operator to " + param->fullNameChain() + " because the pointer-depth is wrong" );
+ return EvaluationResult();
+ }
+}
+
+
+EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams ) {
+ if( param->totalPointerDepth() == 1 ) {
+ param->setTotalPointerDepth( param->totalPointerDepth() - 1 );
+ return param;
+ } else {
+ if( param->resolved() ) {
+ if( param->totalPointerDepth() == 0 ) {
+ return param->resolved()->applyOperator( SimpleTypeImpl::ArrowOp , convertList<LocateResult, EvaluationResult>(innerParams) );
+ } else {
+ log("failed to apply arrow-operator to " + param->fullNameChain() + " because the pointer-depth is wrong" );
+ return EvaluationResult();
+ }
+ } else {
+ log( "failed to apply arrow-operator to unresolved type" );
+ return EvaluationResult();
+ }
+ };
+}
+
+EvaluationResult StarOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+ if( param->totalPointerDepth() > 0 ) {
+ param->setTotalPointerDepth( param->totalPointerDepth() - 1 );
+ return param;
+ } else {
+ if( param->resolved() ) {
+ return param->resolved()->applyOperator( SimpleTypeImpl::StarOp );
+ } else {
+ log( "failed to apply star-operator to unresolved type" );
+ return EvaluationResult();
+ }
+ };
+}
+
+EvaluationResult AddressOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+ param->setTotalPointerDepth( param->totalPointerDepth() + 1 );
+ return param;
+}
+
+OperatorIdentification UnaryParenOperator::identify( QString& str ) {
+ OperatorIdentification ret;
+ if( str.startsWith( QString( identString()[0] ) ) ) {
+ ret.start = 0;
+ ret.end = findClose( str, 0 );
+ if( ret.end == -1 ) {
+ ret.found = false;
+ ret.end = 0;
+ } else {
+ if( str[ret.end] == identString()[1] ) {
+ ret.found = true;
+ ret.end += 1;
+ ret.op = this;
+
+ ///Try to extract the parameter-strings.
+ ParamIterator it( identString(), str.mid( ret.start, ret.end - ret.start ) );
+
+ while( it ) {
+ ret.innerParams << (*it).stripWhiteSpace();
+
+ ++it;
+ }
+
+ } else {
+ ret.end = 0;
+ }
+ }
+ }
+ return ret;
+}
+
+
+EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams ) {
+ if( param->totalPointerDepth() > 0 ) {
+ param->setTotalPointerDepth( param->totalPointerDepth() - 1 );
+ return param;
+ } else {
+ if( param->resolved() ) {
+ return param->resolved()->applyOperator( SimpleTypeImpl::IndexOp, convertList<LocateResult>( innerParams ) );
+ } else {
+ log( "failed to apply index-operator to unresolved type" );
+ return EvaluationResult();
+ }
+ };
+}
+
+EvaluationResult ParenOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams ) {
+ if( param ) {
+ if( param->resolved() ) {
+ return param->resolved()->applyOperator( SimpleTypeImpl::ParenOp, convertList<LocateResult>(innerParams) );
+ } else {
+ log( "failed to apply paren-operator to unresolved type" );
+ return EvaluationResult();
+ }
+
+ } else {
+ return innerParams[0];
+ }
+}
+
+ExpressionEvaluation::ExpressionEvaluation( CppCodeCompletion* data, ExpressionInfo expr, OperatorSet& operators, const HashedStringSet& includeFiles, SimpleContext* ctx ) : m_data( data ), m_ctx( ctx ), m_expr( expr ), m_global(false), m_operators( operators ), m_includeFiles( includeFiles ) {
+ safetyCounter.init();
+
+ ifVerboseMajor( dbgMajor( ) << "Initializing evaluation of expression " << expr << endl );
+
+ if ( expr.expr().startsWith( "::" ) )
+ {
+ expr.setExpr( expr.expr().mid( 2 ) );
+ m_global = true;
+ }
+
+ //m_expr = m_data->splitExpression( expr.expr() ).join("");
+}
+
+EvaluationResult ExpressionEvaluation::evaluate() {
+ EvaluationResult res;
+ res = evaluateExpressionInternal( m_expr.expr(), m_ctx->global(), m_ctx, m_ctx, /*m_expr.canBeTypeExpression() cannot be safely determined*/true );
+
+ ExpressionInfo ex = res.expr; ///backup and set the type which was chosen while the evaluation-process
+ res.expr = m_expr;
+ res.expr.t = ex.t;
+
+ return res;
+}
+
+EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression) {
+ LogDebug d( "#evl#" );
+ if( expr.isEmpty() || !safetyCounter ) {
+ scope.expr.t = ExpressionInfo::NormalExpression;
+ return scope;
+ }
+
+ /*if( !scope->resolved() ) {
+ ifVerboseMajor( dbgMajor() << "evaluateExpressionInternal(\"" << expr << "\") scope: \"" << scope->fullTypeStructure() << "\" is unresolved " << endl );
+ return EvaluationResult();
+ }*/
+
+ ifVerboseMajor( dbgMajor() << "evaluateExpressionInternal(\"" << expr << "\") scope: \"" << scope->fullNameChain() << "\" context: " << ctx << endl );
+
+ expr = expr.stripWhiteSpace();
+
+ ///Find the rightmost operator with the lowest priority, for the first split.
+ QValueList<OperatorIdentification> idents;
+ for( uint a = 0; a < expr.length(); ++a ) {
+ QString part = expr.mid( a );
+ OperatorIdentification ident = m_operators.identifyOperator( part );
+ if( ident ) {
+ ifVerboseMajor( dbgMajor() << "identified \"" << ident.op->name() << "\" in string " << part << endl );
+ ident.start += a;
+ ident.end += a;
+ idents << ident;
+ a += ident.end;
+ } else {
+ if( isLeftParen( part[0] ) ) {
+ int jump = findClose( part, 0 );
+ if( jump != -1 )
+ a += jump;
+ }
+ }
+ }
+
+ if( !idents.isEmpty() ) {
+ OperatorIdentification lowest;
+
+ for( QValueList<OperatorIdentification>::iterator it = idents.begin(); it != idents.end(); ++it ) {
+ if( lowest ) {
+ if( lowest.op->priority() >= (*it).op->priority() )
+ lowest = *it;
+ } else {
+ lowest = *it;
+ }
+ }
+
+ if( lowest ) {
+ QString leftSide = expr.left( lowest.start ).stripWhiteSpace();
+ QString rightSide = expr.right( expr.length() - lowest.end ).stripWhiteSpace();
+
+ EvaluationResult left, right;
+ if( !leftSide.isEmpty() ) {
+ left = evaluateExpressionInternal( leftSide, scope, ctx, innerCtx, lowest.op->canBeType( Operator::Left ) );
+ } else {
+ left = scope;
+ }
+
+ if( !left && (lowest.op->binding() & Operator::Left) ) {
+ ifVerboseMajor( dbgMajor() << "problem while evaluating expression \"" << expr << "\", the operator \"" << lowest.op->name() << "\" has a binding to the left side, but no left side could be evaluated: \"" << leftSide << "\"" << endl );
+ }
+
+ if( !rightSide.isEmpty() && (lowest.op->binding() & Operator::Right) )
+ right = evaluateExpressionInternal( rightSide, SimpleType(), ctx, innerCtx, lowest.op->canBeType( Operator::Right ) );
+
+ if( !right && (lowest.op->binding() & Operator::Right) ) {
+ ifVerboseMajor( dbgMajor() << "problem while evaluating expression \"" << expr << "\", the operator \"" << lowest.op->name() << "\" has a binding to the right side, but no right side could be evaluated: \"" << rightSide << "\"" << endl );
+ }
+
+ QValueList<EvaluationResult> innerParams;
+ QValueList<EvaluationResult> params;
+ if( lowest.op->binding() & Operator::Left ) params << left;
+ if( lowest.op->binding() & Operator::Right ) params << right;
+
+ for( QValueList<QString>::iterator it = lowest.innerParams.begin(); it != lowest.innerParams.end(); ++it ) {
+ ifVerboseMajor(dbgMajor() << "evaluating inner parameter \"" + *it + "\"" );
+ innerParams << evaluateExpressionInternal( (*it), SimpleType(), innerCtx, innerCtx, lowest.op->canBeType( Operator::Neutral ) );
+ }
+
+ EvaluationResult applied = lowest.op->apply( params, innerParams );
+ if( !applied ) {
+ statusLog( "\"" + expr + "\": failed to apply the operator \"" + lowest.op->name() + "\"" );
+ }
+
+ if( ! (lowest.op->binding() & Operator::Left) && !leftSide.isEmpty() ) {
+ ///When the operator has no binding to the left, the left side should be empty.
+ statusLog( "\"" + expr + "\": problem with the operator \"" + lowest.op->name() + ", it has no binding to the left side, but the left side is \""+ leftSide + "\"" );
+ }
+
+ if( ! (lowest.op->binding() & Operator::Right) && !rightSide.isEmpty() ) {
+ ///When the operator has no binding to the right, we should continue evaluating the right side, using the left type as scope.
+ ///Think about this.
+ return evaluateExpressionInternal( rightSide, applied, 0, innerCtx, lowest.op->canBeType( Operator::Right ) );
+ }
+
+ return applied;
+ } else {
+ ifVerboseMajor( dbgMajor() << " could not find an operator in " << expr << endl );
+ return evaluateAtomicExpression( expr, scope, ctx );
+ }
+ }
+
+ //dbgMajor() << " could not evaluate " << expr << endl;
+ ifVerboseMajor( dbgMajor() << "evaluating \"" << expr << "\" as atomic expression" << endl );
+
+ TypeDesc exp = m_ctx->container()->resolveTemplateParams( TypeDesc(expr) );
+
+ ifVerboseMajor( dbgMajor() << "after template-parameter resolution: \"" << exp.fullNameChain() << "\"" << endl );
+
+ EvaluationResult res = evaluateAtomicExpression( exp, scope, ctx, canBeTypeExpression );
+ return res;
+}
+
+/**This function needs a clean workover.
+ * An atomic expression is one that only consists of a type-, function- or variable-name(may include '::')
+ */
+EvaluationResult ExpressionEvaluation::evaluateAtomicExpression( TypeDesc expr, EvaluationResult scope, SimpleContext * ctx, bool canBeTypeExpression ) {
+ LogDebug d( "#evt#");
+ if( !safetyCounter || !d ) return SimpleType();
+ bool canBeItemExpression = true; ///To be implemented
+
+ if( scope ) {
+ expr.setIncludeFiles( scope.resultType->includeFiles() );
+ } else {
+ expr.setIncludeFiles( m_includeFiles );
+ }
+
+
+ ifVerboseMajor( dbgMajor() << "evaluateAtomicExpression(\"" << expr.name() << "\") scope: \"" << scope->fullNameChain() << "\" context: " << ctx << endl );
+
+ EvaluationResult bestRet;
+ int bestDepth = 0;
+
+ if( expr.name().isEmpty() )
+ return scope;
+
+ TypePointer searchIn = scope->resolved();
+ if( !searchIn ) {
+ statusLog( "scope-type is not resolved" );
+ return EvaluationResult();
+ }
+
+ if( ctx )
+ searchIn = ctx->container().get();
+
+ if( ctx && canBeItemExpression ) {
+ ///Search for variables and functions, first in the current context, and then through the container-classes upwards.
+ // find the variable in the current context
+ SimpleVariable var = ctx->findVariable( expr.name() );
+
+ if ( var.type ) {
+ TypeDesc d( var.type );
+ d.setIncludeFiles( m_includeFiles );
+ EvaluationResult ret = EvaluationResult( ctx->container()->locateDecType( d ), var.toDeclarationInfo( "current_file" ));
+ ret.expr.t = ExpressionInfo::NormalExpression;
+ return ret;
+ }
+
+ SimpleType current = ctx->container();
+
+ SimpleTypeImpl::TypeOfResult type;
+
+ SafetyCounter s( 20 );
+ bool ready = false;
+ int depth = 0;
+
+ while( !ready && s )
+ {
+ if( !current ) ready = true;
+
+ type = current->typeOf( expr );
+ if ( type) {
+ bestRet = EvaluationResult( type.type, type.decl );
+ bestDepth = depth;
+ bestRet.expr = expr.fullNameChain();
+ bestRet.expr.t = ExpressionInfo::NormalExpression;
+ }
+
+ depth++;
+ if( !ready ) current = current->parent();
+ }
+ }
+ /*
+ if( scope.expr.t & ExpressionInfo::TypeExpression )
+ canBeTypeExpression = true;*/
+
+ if( canBeItemExpression && (!bestRet || bestDepth > 0 ) ) {
+ //SimpleTypeImpl::
+ SimpleTypeImpl::TypeOfResult res = searchIn->typeOf( expr );
+
+ if( res ) {
+ bestRet = EvaluationResult( res.type, res.decl );
+ bestDepth = 0;
+ }
+ }
+ if( canBeTypeExpression ) {
+ ///Search for Types
+ LocateResult type = searchIn->locateDecType( expr );
+
+ if( !bestRet ||
+ /** Did we find a constructor within a class? */
+ (type->resolved() && ( bestRet->resolved() && type->resolved()->desc() == bestRet->resolved()->parent()->desc() && bestRet->resolved()->asFunction() ) ) ) {
+ /*if ( type && type->resolved() )
+ {*/
+ EvaluationResult ret = type;
+ ret.expr = expr.fullNameChain();
+ ret.expr.t = ExpressionInfo::TypeExpression;
+ bestRet = ret;
+ }
+ /*} else {
+ bestRet = EvaluationResult( type );
+ QStringList s = split+exprList;
+ s.pop_front();
+ if( !s.isEmpty() )
+ bestRet->append( new TypeDescShared( s.join("::") ) );
+ }*/
+ }
+
+ if( bestRet )
+ return bestRet;
+
+ ifVerboseMajor( dbgMajor() << "evaluateAtomicExpression: \"" << scope.resultType->fullNameChain() << "\"could not locate " << expr.fullNameChain() << endl );
+ return bestRet;
+}
+}
+
+// kate: indent-mode csands; tab-width 2;
diff --git a/languages/cpp/cppevaluation.h b/languages/cpp/cppevaluation.h
new file mode 100644
index 00000000..e4adeb28
--- /dev/null
+++ b/languages/cpp/cppevaluation.h
@@ -0,0 +1,367 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 CPPEVALUATION_H
+#define CPPEVALUATION_H
+
+#include <qvaluelist.h>
+
+#include "expressioninfo.h"
+#include "simpletype.h"
+#include "declarationinfo.h"
+#include <hashedstring.h>
+
+class SimpleContext;
+
+void statusBarText( const QString& str, int time = 1000 );
+
+namespace CppEvaluation {
+
+template <class To, class From>
+extern QValueList<To> convertList( const QValueList<From>& from );
+
+extern QString nameFromType( SimpleType t );
+
+class Operator;
+
+struct OperatorIdentification {
+ QValueList<QString> innerParams; /** Inner parameters of the operator( for the vec["hello"] the "hello" ) */
+ int start, end; /** Range the operator occupies */
+ bool found;
+ Operator* op; ///Can be 0 !
+
+ OperatorIdentification() : start( 0 ), end( 0 ), found( false ), op( 0 ) {}
+
+ operator bool() {
+ return found;
+ }
+};
+
+
+class EvaluationResult {
+ public:
+ EvaluationResult& operator = ( const EvaluationResult& rhs ) {
+ resultType = rhs.resultType;
+ sourceVariable = rhs.sourceVariable;
+ expr = rhs.expr;
+ isMacro = rhs.isMacro;
+ macro = rhs.macro;
+ return *this;
+ }
+
+ EvaluationResult( const EvaluationResult& rhs ) : resultType( rhs.resultType ), expr( rhs.expr ), sourceVariable( rhs.sourceVariable ), isMacro( rhs.isMacro ), macro( rhs.macro ) {}
+
+ LocateResult resultType; ///The resulting type
+
+ ExpressionInfo expr; ///Information about the expression that was processed
+
+ DeclarationInfo sourceVariable; ///If the type comes from a variable, this stores Information about it
+
+ bool isMacro;
+ Macro macro;
+
+ ///should be removed
+ EvaluationResult( SimpleType rhs ) : isMacro( false ) {
+ if ( rhs.get() != 0 )
+ resultType = rhs->desc();
+ }
+
+ EvaluationResult( LocateResult tp = TypeDesc(), DeclarationInfo var = DeclarationInfo() ) : resultType( tp ), sourceVariable( var ), isMacro( false ) {}
+
+ /*operator TypeDesc () const {
+ return (TypeDesc)resultType;
+ }*/
+
+ ///This must be removed
+ operator SimpleType() const {
+ if ( resultType->resolved() ) {
+ return SimpleType( resultType->resolved() );
+ } else {
+ return SimpleType( new SimpleTypeImpl( ( TypeDesc ) resultType ) );
+ }
+ }
+
+ TypeDesc* operator -> () {
+ return & resultType.desc();
+ }
+
+ operator LocateResult () const {
+ return resultType;
+ }
+
+ operator bool() const {
+ return ( bool ) resultType;
+ }
+};
+
+
+
+class Operator {
+ public:
+ enum BindingSide {
+ Neutral = 0,
+ Left = 1,
+ Right = 2
+ };
+ enum Type {
+ Unary = 1,
+ Binary = 2,
+ Ternary = 3
+ };
+
+ virtual ~Operator() {}
+
+ virtual int priority() = 0;
+
+ virtual Type type() = 0;
+ virtual int paramCount() = 0;
+
+ ///"binding" means that the operator needs the evaluated type of the expression on that side
+ ///The types of all bound sides will later be sent in the "params"-list of the apply-function
+ virtual BindingSide binding() = 0; ///The side to which the operator binds
+
+ ///When this returns true, the ident-structure must be filled correctly
+ virtual OperatorIdentification identify( QString& str ) = 0;
+
+ ///params
+ virtual EvaluationResult apply( QValueList<EvaluationResult> params, QValueList<EvaluationResult> innerParams ) = 0;
+
+ virtual QString name() = 0;
+
+ ///Should return whether the item it the given side can be a type(Neutral stands for the inner paremeters)
+ virtual bool canBeType( BindingSide side ) {
+ return true;
+ }
+
+ protected:
+ void log( const QString& msg );
+ QString printTypeList( QValueList<EvaluationResult>& lst );
+};
+
+
+class OperatorSet {
+ private:
+ typedef QValueList< Operator* > OperatorList;
+ OperatorList m_operators;
+ public:
+ OperatorSet() {}
+
+ ~OperatorSet();
+
+ void registerOperator( Operator* op ) {
+ m_operators << op;
+ }
+
+ OperatorIdentification identifyOperator( const QString& str_ , Operator::BindingSide allowedBindings = ( Operator::BindingSide ) ( Operator::Left | Operator::Right | Operator::Neutral ) );
+
+};
+extern OperatorSet AllOperators;
+
+
+template <class OperatorType>
+class RegisterOperator {
+ public:
+ RegisterOperator( OperatorSet& set
+ ) {
+ set.registerOperator( new OperatorType() );
+ }
+ ~RegisterOperator() {}
+}
+;
+
+
+class UnaryOperator : public Operator {
+ public:
+ UnaryOperator( int priority , QString identString, QString description, Operator::BindingSide binding ) : Operator(), m_priority( priority ), m_identString( identString ), m_name( description ), m_binding( binding ) {}
+
+ virtual int priority() {
+ return m_priority;
+ }
+
+ virtual Operator::Type type() {
+ return Operator::Unary;
+ }
+
+ virtual Operator::BindingSide binding() {
+ return m_binding;
+ }
+
+ virtual int paramCount() {
+ return 1;
+ }
+
+ virtual OperatorIdentification identify( QString& str );
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams ) = 0;
+
+ virtual bool checkParams( const QValueList<EvaluationResult>& params ) {
+ return !params.isEmpty() && params[ 0 ];
+ }
+
+ virtual EvaluationResult apply( QValueList<EvaluationResult> params, QValueList<EvaluationResult> innerParams );
+
+ virtual QString name() {
+ return m_name;
+ }
+
+ private:
+ int m_priority;
+ QString m_identString;
+ QString m_name;
+ Operator::BindingSide m_binding;
+ protected:
+
+ QString identString() const {
+ return m_identString;
+ }
+
+};
+
+
+class NestedTypeOperator : public UnaryOperator {
+ public:
+ NestedTypeOperator() : UnaryOperator( 18, "::", "nested-type-operator", Operator::Left ) {}
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ );
+};
+
+//RegisterOperator< NestedTypeOperator > NestedTypeReg( AllOperators ); ///This registers the operator to the list of all operators
+
+class DotOperator : public UnaryOperator {
+ public:
+ DotOperator() : UnaryOperator( 17, ".", "dot-operator", Operator::Left ) {}
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+class ArrowOperator : public UnaryOperator {
+ public:
+ ArrowOperator() : UnaryOperator( 17, "->", "arrow-operator", Operator::Left ) {}
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+
+class StarOperator : public UnaryOperator {
+ public:
+ StarOperator() : UnaryOperator( 15, "*", "star-operator", Operator::Right ) { ///Normally this should have a priority of 16, but that would need changes to the expression-parsin g-loop
+ }
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+
+class AddressOperator : public UnaryOperator {
+ public:
+ AddressOperator() : UnaryOperator( 16, "&", "address-operator", Operator::Right ) {}
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+
+class UnaryParenOperator : public UnaryOperator {
+ public:
+ ///Identstring should be both parens, for Example "[]" or "()"
+ UnaryParenOperator( int priority , QString identString, QString description, Operator::BindingSide binding ) : UnaryOperator( priority, identString, description, binding ) {}
+
+ virtual OperatorIdentification identify( QString& str );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+class IndexOperator : public UnaryParenOperator {
+ public:
+ IndexOperator() : UnaryParenOperator( 17, "[]", "index-operator", Operator::Left ) {}
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+
+class ParenOperator : public UnaryParenOperator {
+ public:
+ ParenOperator() : UnaryParenOperator( 16, "()", "paren-operator", Operator::Left ) {}
+
+ virtual bool checkParams( const QValueList<EvaluationResult>& params ) {
+ return !params.isEmpty();
+ }
+
+ virtual EvaluationResult unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& innerParams );
+
+ virtual bool canBeType( BindingSide side ) {
+ return false;
+ }
+};
+
+//This is used in CppCodeCompletion::evaluateExpression(..)
+class ExpressionEvaluation {
+ private:
+ CppCodeCompletion* m_data;
+ SimpleContext* m_ctx;
+ ExpressionInfo m_expr;
+ bool m_global;
+ OperatorSet& m_operators;
+ HashedStringSet m_includeFiles;
+
+ public:
+ ExpressionEvaluation( CppCodeCompletion* data, ExpressionInfo expr, OperatorSet& operators, const HashedStringSet& includeFiles, SimpleContext* ctx = 0 );
+
+ EvaluationResult evaluate();
+
+ private:
+ /**
+ recursion-method:
+ 1. Find the rightmost operator with the lowest priority, split the expression
+
+ vector[ (*it)->position ]().
+ */
+ virtual EvaluationResult evaluateExpressionInternal( QString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression = true );
+
+ ///Locates types or members
+ EvaluationResult evaluateAtomicExpression( TypeDesc expr, EvaluationResult scope, SimpleContext * ctx = 0, bool canBeTypeExpression = true );
+};
+
+
+}
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/cppimplementationwidget.cpp b/languages/cpp/cppimplementationwidget.cpp
new file mode 100644
index 00000000..c00c9b05
--- /dev/null
+++ b/languages/cpp/cppimplementationwidget.cpp
@@ -0,0 +1,100 @@
+/***************************************************************************
+* Copyright (C) 2004 by Alexander Dymo *
+* adymo@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU Library General Public License as *
+* published by the Free Software Foundation; either version 2 of the *
+* License, or (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU Library General Public *
+* License along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#include "cppimplementationwidget.h"
+
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <qdom.h>
+
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <klistview.h>
+#include <klineedit.h>
+
+#include <kdevlanguagesupport.h>
+#include <kdevproject.h>
+#include <domutil.h>
+#include <filetemplate.h>
+
+CppImplementationWidget::CppImplementationWidget( KDevLanguageSupport *part,
+ QWidget *parent, const char *name, bool modal )
+ : ImplementationWidget( part, parent, name, modal )
+{}
+
+QStringList CppImplementationWidget::createClassFiles()
+{
+ QString template_h = "#ifndef $DEFTEXT$_H\n#define $DEFTEXT$_H\n\n#include \"$BASEINCLUDE$\"\n\nclass $CLASSNAME$: public $BASECLASSNAME$ {\nQ_OBJECT\npublic:\n $CLASSNAME$(QWidget *parent = 0, const char *name = 0);\n};\n\n#endif\n";
+ QString template_cpp = "#include \"$CLASSINCLUDE$\"\n\n$CLASSNAME$::$CLASSNAME$(QWidget *parent, const char *name)\n :$BASECLASSNAME$(parent, name)\n{\n}\n";
+ if ( m_part->project() ->options() == KDevProject::UsesAutotoolsBuildSystem )
+ template_cpp += "\n#include \"$MOCINCLUDE$\"\n";
+
+ QFileInfo formInfo( m_formName );
+ template_h.replace( QRegExp( "\\$BASEINCLUDE\\$" ), formInfo.baseName() + ".h" );
+ template_h.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() );
+ template_h.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName );
+ template_h.replace( QRegExp( "\\$DEFTEXT\\$" ), fileNameEdit->text().upper() );
+
+ template_cpp.replace( QRegExp( "\\$CLASSINCLUDE\\$" ), fileNameEdit->text() + ".h" );
+ template_cpp.replace( QRegExp( "\\$CLASSNAME\\$" ), classNameEdit->text() );
+ template_cpp.replace( QRegExp( "\\$BASECLASSNAME\\$" ), m_baseClassName );
+ template_cpp.replace( QRegExp( "\\$MOCINCLUDE\\$" ), fileNameEdit->text() + ".moc" );
+
+ template_h = FileTemplate::read( m_part, "h" ) + template_h;
+ template_cpp = FileTemplate::read( m_part, "cpp" ) + template_cpp;
+
+ QString file_h = fileNameEdit->text() + ".h";
+ QString file_cpp = fileNameEdit->text() + ".cpp";
+ if ( !m_part->project() ->activeDirectory().isEmpty() )
+ {
+ file_h = m_part->project() ->activeDirectory() + "/" + file_h;
+ file_cpp = m_part->project() ->activeDirectory() + "/" + file_cpp;
+ }
+
+ QFile ifile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_cpp ) );
+ if ( !ifile.open( IO_WriteOnly ) )
+ {
+ KMessageBox::error( this, i18n( "Cannot write to implementation file" ) );
+ return QStringList();
+ }
+ QTextStream istream( &ifile );
+ istream << template_cpp;
+ ifile.close();
+
+ QFile hfile( QDir::cleanDirPath( m_part->project() ->projectDirectory() + "/" + file_h ) );
+ if ( !hfile.open( IO_WriteOnly ) )
+ {
+ KMessageBox::error( this, i18n( "Cannot write to header file" ) );
+ return QStringList();
+ }
+ QTextStream hstream( &hfile );
+ hstream << template_h;
+ hfile.close();
+
+ QStringList fileList;
+ fileList.append( file_h );
+ fileList.append( file_cpp );
+
+ return fileList;
+}
+
+#include "cppimplementationwidget.moc"
diff --git a/languages/cpp/cppimplementationwidget.h b/languages/cpp/cppimplementationwidget.h
new file mode 100644
index 00000000..d10045db
--- /dev/null
+++ b/languages/cpp/cppimplementationwidget.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+* Copyright (C) 2004 by Alexander Dymo *
+* adymo@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU Library General Public License as *
+* published by the Free Software Foundation; either version 2 of the *
+* License, or (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU Library General Public *
+* License along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#ifndef CPPIMPLEMENTATIONWIDGET_H
+#define CPPIMPLEMENTATIONWIDGET_H
+
+#include <implementationwidget.h>
+
+#include <codemodel.h>
+
+class KListViewItem;
+class CppSupportPart;
+
+class CppImplementationWidget : public ImplementationWidget
+{
+ Q_OBJECT
+public:
+ CppImplementationWidget( KDevLanguageSupport *part, QWidget* parent = 0, const char* name = 0, bool modal = false );
+
+protected:
+ virtual QStringList createClassFiles();
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
diff --git a/languages/cpp/cppnewclassdlg.cpp b/languages/cpp/cppnewclassdlg.cpp
new file mode 100644
index 00000000..b941b46e
--- /dev/null
+++ b/languages/cpp/cppnewclassdlg.cpp
@@ -0,0 +1,2242 @@
+/***************************************************************************
+* Copyright (C) 1998 by Sandy Meier *
+* smeier@rz.uni-potsdam.de *
+* Copyright (C) 1999 by Benoit.Cerrina *
+* Benoit.Cerrina@writeme.com *
+* Copyright (C) 2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2003 by Eray Ozkural *
+* <erayo@cs.bilkent.edu.tr> *
+* Copyright (C) 2003-2004 by Alexander Dymo *
+* adymo@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "cppnewclassdlg.h"
+
+#include <qcheckbox.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qradiobutton.h>
+#include <qregexp.h>
+#include <qtextedit.h>
+#include <qrect.h>
+#include <qstyle.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <qcombobox.h>
+#include <qlistview.h>
+#include <qpopupmenu.h>
+#include <qpushbutton.h>
+#include <qtabwidget.h>
+#include <klineedit.h>
+#include <kdeversion.h>
+
+#include "cppsupportpart.h"
+#include "kdevproject.h"
+#include "kdevsourceformatter.h"
+#include "kdevcoderepository.h"
+#include "kdevpartcontroller.h"
+#include "backgroundparser.h"
+#include "domutil.h"
+#include "filetemplate.h"
+#include "storeconverter.h"
+#include "qtbuildconfig.h"
+
+#include "classgeneratorconfig.h"
+
+QString QRegExp_escape( const QString& str )
+{
+#if QT_VERSION >= 0x030100
+ return QRegExp::escape( str );
+#else
+ // this block is copyrighted by Trolltech AS (GPL)
+ static const char meta[] = "$()*+.?[\\]^{|}";
+ QString quoted = str;
+ int i = 0;
+
+ while ( i < ( int ) quoted.length() )
+ {
+ if ( strchr( meta, quoted[ i ].latin1() ) != 0 )
+ quoted.insert( i++, "\\" );
+ i++;
+ }
+ return quoted;
+#endif
+}
+
+CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, QWidget *parent, const char *name )
+ : CppNewClassDialogBase( parent, name ), myModel( 0 )
+{
+ headerModified = false;
+ baseincludeModified = false;
+ implementationModified = false;
+ m_part = part;
+ // read file template configuration
+ // KDevProject *project = part->project();
+ QDomDocument &dom = *part->projectDom();
+ interface_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfaceURL" );
+ implementation_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationURL" );
+ interface_suffix = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", ".h" );
+ implementation_suffix = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationsuffix", ".cpp" );
+ lowercase_filenames = DomUtil::readBoolEntry( dom, "/cppsupportpart/filetemplates/lowercasefilenames", true );
+ m_parse = DomUtil::readEntry( *m_part->projectDom(), "/cppsupportpart/newclass/filenamesetting", "none" );
+ // name_handler_combo->setCurrentText(m_parse);
+ baseclasses_view->setSorting( -1 );
+ constructors_view->setSorting( -1 );
+
+ accessMenu = new QPopupMenu( this );
+ accessMenu->insertItem( i18n( "Use as Private" ),
+ this, SLOT( changeToPrivate() ), 0, 1 );
+ accessMenu->insertItem( i18n( "Use as Protected" ),
+ this, SLOT( changeToProtected() ), 0, 2 );
+ accessMenu->insertItem( i18n( "Use as Public" ),
+ this, SLOT( changeToPublic() ), 0, 3 );
+ accessMenu->insertSeparator();
+ accessMenu->insertItem( i18n( "Unset" ),
+ this, SLOT( changeToInherited() ), 0, 5 );
+
+ overMenu = new QPopupMenu( this );
+ overMenu->insertItem( i18n( "Extend Base Class Functionality" ),
+ this, SLOT( extendFunctionality() ), 0, 11 );
+ overMenu->insertItem( i18n( "Replace Base Class Method" ),
+ this, SLOT( replaceFunctionality() ), 0, 12 );
+
+ compBasename = basename_edit->completionObject();
+ setCompletionBasename( m_part->codeModel() );
+ compNamespace = namespace_edit->completionObject();
+ setCompletionNamespaceRecursive( m_part->codeModel() ->globalNamespace() );
+ classname_edit->setFocus();
+
+ // enable/disable qt options for non qt projects
+ childclass_box->setEnabled( m_part->qtBuildConfig()->isUsed() );
+ qobject_box->setEnabled( m_part->qtBuildConfig()->isUsed() );
+}
+
+
+CppNewClassDialog::~CppNewClassDialog()
+{
+ delete compBasename;
+ delete compNamespace;
+ delete myModel;
+}
+
+void CppNewClassDialog::setCompletionBasename( CodeModel *model )
+{
+ compBasename->clear();
+
+ // Import selected namespace without qualifier
+ NamespaceDom namespaceDom = model->globalNamespace();
+
+ QStringList::const_iterator it = currNamespace.begin();
+ for ( ; it != currNamespace.end() ; ++it )
+ {
+ if ( ! namespaceDom->hasNamespace( *it ) )
+ break;
+ namespaceDom = namespaceDom->namespaceByName( *it );
+ }
+
+ if ( it == currNamespace.end() )
+ // complete namespace has been found (not breaked)
+ compBasename->insertItems( sortedNameList( namespaceDom -> classList() ) );
+
+ addCompletionBasenameNamespacesRecursive( model->globalNamespace() );
+
+ QStringList compItems = compBasename->items();
+ it = compItems.begin();
+ for ( int i = 0;
+ it != compItems.end(); ++it, ++i )
+ kdDebug( 9007 ) << "compBasename->items()[" << i << "] = \"" << *it << "\"" << endl;
+}
+
+QStringList& gres( QStringList &list, const QRegExp & rx, const QString & after )
+{
+ QStringList::Iterator it = list.begin();
+ while ( it != list.end() )
+ {
+ ( *it ).replace( rx, after );
+ ++it;
+ }
+ return list;
+}
+
+void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const NamespaceDom & namespaceDom,
+ const QString & namespaceParent )
+{
+ // Add classes of this namespace
+ QStringList classList = sortedNameList( namespaceDom -> classList() );
+
+ if ( ! namespaceParent.isEmpty() )
+ {
+#if QT_VERSION >= 0x030200
+ classList.gres( QRegExp( "^" ), namespaceParent + "::" );
+#else
+
+ gres( classList, QRegExp( "^" ), namespaceParent + "::" );
+#endif
+
+ }
+
+ compBasename -> insertItems( classList );
+
+
+ // Recursion
+ NamespaceList namespaceList = namespaceDom->namespaceList();
+ NamespaceList::const_iterator it = namespaceList.begin();
+
+ for ( ; it != namespaceList.end() ; ++it )
+ {
+ QString fullNamespace;
+
+ if ( ! namespaceParent.isEmpty() )
+ fullNamespace = namespaceParent + "::";
+
+ fullNamespace += ( *it ) -> name();
+ addCompletionBasenameNamespacesRecursive( *it, fullNamespace );
+ }
+}
+
+
+void CppNewClassDialog::setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent )
+{
+ NamespaceList namespaceList = namespaceDom->namespaceList();
+ NamespaceList::const_iterator it = namespaceList.begin();
+ for ( ; it != namespaceList.end() ; ++it )
+ {
+ QString fullNamespace;
+
+ if ( ! namespaceParent.isEmpty() )
+ fullNamespace = namespaceParent + "::";
+
+ fullNamespace += ( *it ) -> name();
+ kdDebug( 9007 ) << "compNamespace -> addItem( \"" << fullNamespace << "\" )" << endl;
+ compNamespace -> addItem( fullNamespace );
+ setCompletionNamespaceRecursive( *it, fullNamespace );
+ }
+}
+
+void CppNewClassDialog::nameHandlerChanged( const QString &text )
+{
+ DomUtil::writeEntry( *m_part->projectDom(), "/cppsupportpart/newclass/filenamesetting", text );
+ m_parse = text;
+ classNameChanged( classname_edit->text() );
+}
+
+void CppNewClassDialog::classNameChanged( const QString &text )
+{
+ QString str = text;
+
+ if ( !headerModified )
+ {
+ QString header = str + interface_suffix;
+ switch ( gen_config->fileCase() )
+ {
+ case ClassGeneratorConfig::LowerCase:
+ header = header.lower();
+ break;
+ case ClassGeneratorConfig::UpperCase:
+ header = header.upper();
+ break;
+ default:
+ ;
+ }
+ header = header.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" );
+ header_edit->setText( header );
+ }
+ if ( !implementationModified )
+ {
+ QString implementation;
+ if ( str.contains( "template" ) )
+ implementation = str + "_impl" + interface_suffix;
+ else
+ implementation = str + implementation_suffix;
+ switch ( gen_config->fileCase() )
+ {
+ case ClassGeneratorConfig::LowerCase:
+ implementation = implementation.lower();
+ break;
+ case ClassGeneratorConfig::UpperCase:
+ implementation = implementation.upper();
+ break;
+ default:
+ ;
+ }
+ implementation = implementation.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" );
+ implementation_edit->setText( implementation );
+ }
+}
+
+void CppNewClassDialog::classNamespaceChanged( const QString &text )
+{
+ currNamespace = QStringList::split( QString( "::" ), text );
+ setCompletionBasename( m_part -> codeModel() );
+ reloadAdvancedInheritance( true );
+}
+
+void CppNewClassDialog::baseclassname_changed( const QString &text )
+{
+ if ( ( basename_edit->hasFocus() ) && ( !baseincludeModified ) )
+ {
+ QString header = text;
+
+ // handle Qt classes in a special way.
+ if( m_part->qtBuildConfig()->isUsed() && header.startsWith( "Q" ) )
+ {
+ if( m_part->qtBuildConfig()->version() == 3 )
+ {
+ header = header.lower() + ".h";
+ }
+ else if( m_part->qtBuildConfig()->version() == 4 )
+ {
+ // 1:1, e.g QObject is #include <QObject>
+ }
+ }
+ else
+ {
+ if ( header.contains( QRegExp( "::" ) ) )
+ header = header.mid( header.findRev( QRegExp( "::" ) ) + 2 );
+ header = header.replace( QRegExp( " *<.*>" ), "" );
+ header += interface_suffix;
+
+ switch ( gen_config->superCase() )
+ {
+ case ClassGeneratorConfig::LowerCase:
+ header = header.lower();
+ break;
+ case ClassGeneratorConfig::UpperCase:
+ header = header.upper();
+ break;
+ default:
+ ;
+ }
+ }
+
+ baseinclude_edit->setText( header );
+ }
+}
+
+void CppNewClassDialog::baseIncludeChanged( const QString &text )
+{
+ if ( baseinclude_edit->hasFocus() )
+ {
+ baseincludeModified = true;
+ if ( baseclasses_view->selectedItem() )
+ baseclasses_view->selectedItem() ->setText( 4, "true" );
+ }
+ if ( baseclasses_view->selectedItem() )
+ {
+ baseclasses_view->selectedItem() ->setText( 3, text );
+ }
+}
+
+void CppNewClassDialog::headerChanged()
+{
+ // Only if a change caused by the user himself
+ if ( header_edit->hasFocus() )
+ headerModified = true;
+}
+
+
+void CppNewClassDialog::implementationChanged()
+{
+ // Only if a change caused by the user himself
+ if ( implementation_edit->hasFocus() )
+ implementationModified = true;
+}
+
+void CppNewClassDialog::checkObjCInheritance( int val )
+{
+ childclass_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() );
+ gtk_box->setEnabled( !val );
+ qobject_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() );
+ namespace_edit->setEnabled( !val );
+ class_tabs->setTabEnabled( tab2, !val );
+ /* virtual_box->setEnabled(!val);
+ public_button->setEnabled(!val);
+ protected_button->setEnabled(!val);
+ private_button->setEnabled(!val);*/
+ if ( val && ( baseclasses_view->childCount() > 1 ) )
+ if ( KMessageBox::warningContinueCancel( this,
+ i18n( "Objective C does not support multiple inheritance.\nOnly the first base class in the list will be taken into account." ),
+ i18n( "Warning" ), KStdGuiItem::cont(), "Check Objective C inheritance rules" ) == KMessageBox::Cancel )
+ objc_box->setChecked( false );
+}
+
+void CppNewClassDialog::checkQWidgetInheritance( int val )
+{
+ if ( val )
+ {
+ qobject_box->setEnabled( val && m_part->qtBuildConfig()->isUsed() );
+ qobject_box->setChecked( val && m_part->qtBuildConfig()->isUsed() );
+ objc_box->setEnabled( !val );
+ gtk_box->setEnabled( !val );
+ }
+ else if ( qobject_box->isChecked() )
+ {
+ objc_box->setEnabled( false );
+ gtk_box->setEnabled( false );
+ }
+ else
+ {
+ objc_box->setEnabled( !val );
+ gtk_box->setEnabled( !val );
+ }
+
+
+ if ( val )
+ {
+ if ( baseclasses_view->childCount() == 0 )
+ {
+ addBaseClass();
+ basename_edit->setText( "QWidget" );
+ }
+ /* constructors_cpp_edit->append(classname_edit->text() + "::" + classname_edit->text() +
+ "(QWidget *parent, const char *name):\n QWidget(parent, name)\n{\n}\n");
+ constructors_h_edit->append(classname_edit->text() + "(QWidget *parent, const char *name);\n");*/
+ }
+
+ if ( val && ( baseclasses_view->childCount() > 1 ) )
+ if ( KMessageBox::warningContinueCancel( this,
+ i18n( "Multiple inheritance requires QObject derivative to be first and unique in base class list." ),
+ i18n( "Warning" ), KStdGuiItem::cont(), "Check QWidget inheritance rules" ) == KMessageBox::Cancel )
+ childclass_box->setChecked( false );
+}
+
+void CppNewClassDialog::qobject_box_stateChanged( int val )
+{
+ if ( childclass_box->isChecked() )
+ return ;
+
+ if ( baseclasses_view->childCount() == 0 )
+ {
+ addBaseClass();
+ basename_edit->setText( "QObject" );
+ }
+
+
+ objc_box->setEnabled( !val );
+ gtk_box->setEnabled( !val );
+}
+
+void CppNewClassDialog::gtk_box_stateChanged( int val )
+{
+ class_tabs->setTabEnabled( tab2, !val );
+ childclass_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() );
+ objc_box->setEnabled( !val );
+ qobject_box->setEnabled( !val && m_part->qtBuildConfig()->isUsed() );
+ namespace_edit->setEnabled( !val );
+
+ basename_edit->setEnabled( !val );
+ virtual_box->setEnabled( !val );
+ public_button->setEnabled( !val );
+ protected_button->setEnabled( !val );
+ private_button->setEnabled( !val );
+ addbaseclass_button->setEnabled( !val );
+ rembaseclass_button->setEnabled( !val );
+ upbaseclass_button->setEnabled( !val );
+ downbaseclass_button->setEnabled( !val );
+ baseclasses_view->setEnabled( !val );
+ baseinclude_edit->setEnabled( !val );
+}
+
+
+void CppNewClassDialog::accept()
+{
+ ClassGenerator generator( *this );
+ if ( generator.generate() )
+ QDialog::accept();
+
+}
+
+void CppNewClassDialog::setStateOfInheritanceEditors( bool state, bool hideList )
+{
+ basename_edit->setEnabled( state );
+ virtual_box->setEnabled( state );
+ public_button->setEnabled( state );
+ protected_button->setEnabled( state );
+ private_button->setEnabled( state );
+ scope_box->setEnabled( state );
+ baseinclude_edit->setEnabled( state );
+ if ( state )
+ baseclasses_view->setEnabled( state );
+ else
+ baseclasses_view->setEnabled( hideList ? state : true );
+ rembaseclass_button->setEnabled( state );
+ if ( !state )
+ {
+ upbaseclass_button->setEnabled( state );
+ downbaseclass_button->setEnabled( state );
+ }
+}
+
+void CppNewClassDialog::addBaseClass()
+{
+ baseincludeModified = false;
+ if ( baseclasses_view->selectedItem() )
+ baseclasses_view->selectedItem() ->setSelected( false );
+ QListViewItem* it = new QListViewItem( baseclasses_view, baseclasses_view->lastItem(),
+ QString::null, "public", QString( "%1" ).arg( scope_box->currentItem() ), QString::null, "false" );
+ setStateOfInheritanceEditors( true );
+ public_button->setChecked( true );
+ virtual_box->setChecked( false );
+ basename_edit->setText( QString::null );
+ basename_edit->setFocus();
+ baseclasses_view->setSelected( it, true );
+}
+
+void CppNewClassDialog::remBaseClass()
+{
+ bool basename_focused = false;
+ if ( basename_edit->hasFocus() )
+ {
+ basename_focused = true;
+ basename_edit->clearFocus();
+ }
+ if ( baseclasses_view->selectedItem() )
+ {
+ QListViewItem * it = baseclasses_view->selectedItem();
+ remClassFromAdv( it->text( 0 ) );
+ baseclasses_view->selectedItem() ->setSelected( false );
+ if ( it->itemBelow() )
+ baseclasses_view->setSelected( it->itemBelow(), true );
+ else if ( it->itemAbove() )
+ baseclasses_view->setSelected( it->itemAbove(), true );
+ delete it;
+ if ( baseclasses_view->childCount() == 0 )
+ setStateOfInheritanceEditors( false );
+ baseincludeModified = false;
+ }
+ if ( basename_focused )
+ basename_edit->setFocus();
+}
+
+void CppNewClassDialog::remBaseClassOnly()
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ QListViewItem * it = baseclasses_view->selectedItem();
+ baseclasses_view->selectedItem() ->setSelected( false );
+ if ( it->itemBelow() )
+ baseclasses_view->setSelected( it->itemBelow(), true );
+ else if ( it->itemAbove() )
+ baseclasses_view->setSelected( it->itemAbove(), true );
+ delete it;
+ if ( baseclasses_view->childCount() == 0 )
+ setStateOfInheritanceEditors( false );
+ baseincludeModified = true;
+ }
+}
+
+void CppNewClassDialog::remClassFromAdv( QString text )
+{
+ // Strip off namespace qualification
+ if ( text.contains( "::" ) )
+ text = text.mid( text.findRev( "::" ) + 2 );
+
+ removeTemplateParams( text );
+ QListViewItem *it = 0;
+ if ( ( it = access_view->findItem( text, 0 ) ) )
+ delete it;
+ if ( ( it = methods_view->findItem( text, 0 ) ) )
+ delete it;
+ if ( ( it = constructors_view->findItem( text, 0 ) ) )
+ {
+ /// @todo changing constructors text in constructors_cpp_edit
+ // and constructors_h_edit must be implemented
+
+ /* int *para = new int(1);
+ int *index = new int(1);
+ if (constructors_cpp_edit->find(text + "(", true, false, true, para, index))
+ {
+ qWarning("%s( found", text.latin1());
+ if (para) constructors_cpp_edit->removeParagraph(*para);
+ }*/
+ delete it;
+ }
+}
+
+void CppNewClassDialog::currBaseNameChanged( const QString &text )
+{
+ if ( baseclasses_view->selectedItem() && ( basename_edit->hasFocus() ) )
+ {
+ if ( class_tabs->isTabEnabled( tab2 ) )
+ {
+ //check for this class in the adv. inheritance lists
+ //and delete if it exists
+ remClassFromAdv( baseclasses_view->selectedItem() ->text( 0 ) );
+ //parse new base class
+ parseClass( text, baseclasses_view->selectedItem() ->text( 1 ) );
+ }
+ baseclasses_view->selectedItem() ->setText( 0, text );
+ updateConstructorsOrder();
+ }
+}
+
+void CppNewClassDialog::currBasePrivateSet()
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "private" );
+ baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "private" ) );
+ }
+}
+
+void CppNewClassDialog::currBaseProtectedSet()
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "protected" );
+ baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "protected" ) );
+ }
+}
+
+void CppNewClassDialog::currBasePublicSet()
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "public" );
+ baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "public" ) );
+ }
+}
+
+void CppNewClassDialog::scopeboxActivated( int value )
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ baseclasses_view->selectedItem() ->setText( 2, QString( "%1" ).arg( value ) );
+ }
+}
+
+void CppNewClassDialog::currBaseVirtualChanged( int val )
+{
+ if ( baseclasses_view->selectedItem() )
+ {
+ baseclasses_view->selectedItem() ->setText( 1, QString( val ? "virtual " : "" ) +
+ QString( private_button->isChecked() ? "private" : "" ) +
+ QString( protected_button->isChecked() ? "protected" : "" ) +
+ QString( public_button->isChecked() ? "public" : "" ) );
+ }
+}
+
+void CppNewClassDialog::currBaseSelected( QListViewItem *it )
+{
+ if ( it == 0 )
+ {
+ setStateOfInheritanceEditors( false, false );
+ return ;
+ }
+ setStateOfInheritanceEditors( true );
+ basename_edit->setText( it->text( 0 ) );
+ baseinclude_edit->setText( it->text( 3 ) );
+ scope_box->setCurrentItem( it->text( 2 ).toInt() );
+ if ( it->text( 1 ).contains( "private" ) )
+ private_button->setChecked( true );
+ else
+ private_button->setChecked( false );
+ if ( it->text( 1 ).contains( "protected" ) )
+ protected_button->setChecked( true );
+ else
+ protected_button->setChecked( false );
+ if ( it->text( 1 ).contains( "public" ) )
+ public_button->setChecked( true );
+ else
+ public_button->setChecked( false );
+ if ( it->text( 1 ).contains( "virtual" ) )
+ virtual_box->setChecked( true );
+ else
+ virtual_box->setChecked( false );
+ checkUpButtonState();
+ checkDownButtonState();
+
+ if ( it->text( 4 ) == "true" )
+ baseincludeModified = true;
+ else
+ baseincludeModified = false;
+}
+
+void CppNewClassDialog::upbaseclass_button_clicked()
+{
+ bool basename_focused = false;
+ if ( basename_edit->hasFocus() )
+ {
+ basename_focused = true;
+ basename_edit->clearFocus();
+ }
+ if ( baseclasses_view->selectedItem() )
+ {
+ QListViewItem * it = baseclasses_view->selectedItem();
+ if ( it->itemAbove() )
+ {
+ QListViewItem * newit;
+ if ( it->itemAbove() ->itemAbove() )
+ newit = new QListViewItem( baseclasses_view, it->itemAbove() ->itemAbove(),
+ it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 4 ) );
+ else
+ newit = new QListViewItem( baseclasses_view, it->text( 0 ), it->text( 1 ),
+ it->text( 2 ), it->text( 3 ), it->text( 4 ) );
+ remBaseClassOnly();
+ baseclasses_view->setSelected( newit, true );
+ checkUpButtonState();
+ updateConstructorsOrder();
+ }
+ }
+ if ( basename_focused )
+ basename_edit->setFocus();
+}
+
+void CppNewClassDialog::downbaseclass_button_clicked()
+{
+ bool basename_focused = false;
+ if ( basename_edit->hasFocus() )
+ {
+ basename_focused = true;
+ basename_edit->clearFocus();
+ }
+ if ( baseclasses_view->selectedItem() )
+ {
+ QListViewItem * it = baseclasses_view->selectedItem();
+ if ( it->itemBelow() )
+ {
+ QListViewItem * newit = new QListViewItem( baseclasses_view, it->itemBelow(),
+ it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 3 ) );
+ remBaseClassOnly();
+ baseclasses_view->setSelected( newit, true );
+ setStateOfInheritanceEditors( true );
+ checkDownButtonState();
+ updateConstructorsOrder();
+ }
+ }
+ if ( basename_focused )
+ basename_edit->setFocus();
+}
+
+void CppNewClassDialog::updateConstructorsOrder()
+{
+ QListViewItemIterator it( baseclasses_view );
+ QListViewItem *c_it;
+ QListViewItem *fc_it = 0;
+
+ while ( it.current() )
+ {
+ if ( ( c_it = constructors_view->findItem( it.current() ->text( 0 ), 0 ) ) )
+ {
+ c_it->moveItem( fc_it );
+ fc_it = c_it;
+ }
+ ++it;
+ }
+}
+
+
+void CppNewClassDialog::checkUpButtonState()
+{
+ if ( baseclasses_view->selectedItem() )
+ upbaseclass_button->setEnabled( baseclasses_view->selectedItem() ->itemAbove() );
+}
+
+void CppNewClassDialog::checkDownButtonState()
+{
+ if ( baseclasses_view->selectedItem() )
+ downbaseclass_button->setEnabled( baseclasses_view->selectedItem() ->itemBelow() );
+}
+
+void CppNewClassDialog::baseclasses_view_selectionChanged()
+{
+ /* if (baseclasses_view->selectedItem())
+ {
+ setStateOfInheritanceEditors(false, false);
+ }*/
+}
+
+void CppNewClassDialog::changeToPrivate()
+{
+ if ( access_view->selectedItem() )
+ access_view->selectedItem() ->setText( 2, "private" );
+}
+
+void CppNewClassDialog::changeToProtected()
+{
+ if ( access_view->selectedItem() )
+ access_view->selectedItem() ->setText( 2, "protected" );
+}
+
+void CppNewClassDialog::changeToPublic()
+{
+ if ( access_view->selectedItem() )
+ access_view->selectedItem() ->setText( 2, "public" );
+}
+
+void CppNewClassDialog::changeToInherited()
+{
+ if ( access_view->selectedItem() )
+ access_view->selectedItem() ->setText( 2, QString::null );
+}
+
+void CppNewClassDialog::newTabSelected( const QString& /*text*/ )
+{
+ /* if (text == i18n("&Advanced Inheritance"))
+ reloadAdvancedInheritance(true);*/
+}
+
+void CppNewClassDialog::newTabSelected( QWidget* /*w*/ )
+{
+ /* if ( QString(w->name()) == QString("tab2"))
+ {
+ reloadAdvancedInheritance(false);
+ }*/
+}
+
+
+void CppNewClassDialog::reloadAdvancedInheritance( bool clean )
+{
+ clearConstructorsList( clean );
+ clearMethodsList( clean );
+ clearUpgradeList( clean );
+
+ QListViewItemIterator it( baseclasses_view );
+ while ( it.current() )
+ {
+ if ( ! ( it.current() ->text( 0 ).isEmpty() ) )
+ {
+ parseClass( it.current() ->text( 0 ), it.current() ->text( 1 ) );
+ }
+ ++it;
+ }
+}
+
+void CppNewClassDialog::parseClass( QString clName, QString inheritance )
+{
+ // Determine namespace
+ QStringList clNamespace = currNamespace;
+ bool clFullQualified = false;
+
+ if ( clName.contains( "::" ) )
+ {
+ // Full qualified, override imported namespace
+ clFullQualified = true;
+ int splitpoint = clName.findRev( "::" );
+ clNamespace = QStringList::split( "::", clName.left( splitpoint ) );
+ clName = clName.mid( splitpoint + 2 );
+ }
+
+ kdDebug( 9007 ) << "clFullQualified = " << clFullQualified << endl;
+ kdDebug( 9007 ) << "clName = " << clName << endl;
+ QString debMsg = "clNamespace = ";
+ for ( QStringList::const_iterator it = clNamespace.begin();
+ it != clNamespace.end(); ++it )
+ debMsg += ( *it ) + "::";
+ kdDebug( 9007 ) << debMsg << endl;
+
+ QString templateAdd = templateActualParamsFormatted( clName );
+ removeTemplateParams( clName );
+
+ ClassList myClasses; // = m_part->codeModel()->globalNamespace()->classByName(clName);
+
+ NamespaceDom namespaceDom = m_part->codeModel() ->globalNamespace();
+
+ QStringList::const_iterator namespaceIt = clNamespace.begin();
+ for ( ; namespaceIt != clNamespace.end(); ++namespaceIt )
+ {
+ if ( ! namespaceDom -> hasNamespace( *namespaceIt ) )
+ break;
+ namespaceDom = namespaceDom->namespaceByName( *namespaceIt );
+ }
+ if ( namespaceIt == clNamespace.end() )
+ {
+ // Found specified namespace
+ myClasses = namespaceDom->classByName( clName );
+ // Fall back to global namespace if class was not fully qualified and is not found in selected namespace
+ if ( myClasses.empty() && ! clFullQualified )
+ myClasses = m_part -> codeModel() -> globalNamespace() -> classByName( clName );
+ }
+
+ if ( myClasses.empty() )
+ {
+ kdDebug() << "Trying persistent class store..." << endl;
+ parsePCSClass( clName, inheritance );
+ }
+
+ for ( ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt )
+ {
+ PCheckListItem<ClassDom> *it = new PCheckListItem<ClassDom>( *classIt, constructors_view, ( *classIt ) ->name() );
+ it->templateAddition = templateAdd;
+ PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() );
+ over->templateAddition = templateAdd;
+ QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) );
+ QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) );
+ PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() );
+ QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) );
+ QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) );
+ QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) );
+
+ FunctionList functionList = ( *classIt ) ->functionList();
+ for ( FunctionList::const_iterator methodIt = functionList.begin();
+ methodIt != functionList.end(); ++methodIt )
+ {
+ if ( ( *methodIt ) ->isSignal() )
+ {
+ // don't show signals as overridable methods
+ }
+ else if ( isConstructor( ( *classIt ) ->name(), *methodIt ) )
+ {
+ addToConstructorsList( it, *methodIt );
+ }
+ else if ( ( *methodIt ) ->isSlot() )
+ {
+ if ( ( *methodIt ) ->access() != CodeModelItem::Private )
+ {
+ addToMethodsList( over_slots, *methodIt );
+
+ QString inhModifier;
+ //protected inheritance gives protected attributes
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private attributes
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public attributes
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_slots, *methodIt, inhModifier );
+ }
+ }
+ else
+ {
+ // display only public and protected methods of the base class
+ if ( ( !isDestructor( ( *classIt ) ->name(), *methodIt ) ) && ( ( *methodIt ) ->access() != CodeModelItem::Private ) )
+ {
+ addToMethodsList( over_methods, *methodIt );
+
+ // see what modifier is given for the base class
+ QString inhModifier;
+ //protected inheritance gives protected methods
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private methods
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public methods
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_methods, *methodIt, inhModifier );
+ }
+ }
+ }
+
+ VariableList variableList = ( *classIt ) ->variableList();
+ for ( VariableList::const_iterator varIt = variableList.begin();
+ varIt != variableList.end(); ++varIt )
+ {
+ if ( ( *varIt ) ->access() != CodeModelItem::Private )
+ {
+ QString inhModifier;
+ //protected inheritance gives protected attributes
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private attributes
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public attributes
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_attrs, *varIt, inhModifier );
+ }
+ }
+ }
+}
+
+bool CppNewClassDialog::isConstructor( QString className, const FunctionDom &method )
+{
+ // regexp: myclass\\s*\\(\\s*(const)?\\s*myclass\\s*&[A-Za-z_0-9\\s]*\\) is for copy constructors
+ if ( ( className == method->name() ) )
+ {
+ qWarning( "1x" );
+ if ( ( method->argumentList().count() == 1 ) && ( m_part->formatModelItem( method->argumentList() [ 0 ].data() ).contains( QRegExp( " *(const)? *" + className + " *& *" ) ) ) )
+ // if ( method->asString().contains(QRegExp(className + "\\s*\\(\\s*(const)?\\s*" + className + "\\s*&[A-Za-z_0-9\\s]*\\)", true, false)) )
+ return false;
+ else
+ return true;
+ }
+ else
+ return false;
+}
+
+void CppNewClassDialog::addToConstructorsList( QCheckListItem *myClass, FunctionDom method )
+{
+ new PCheckListItem<FunctionDom>( method, myClass, m_part->formatModelItem( method.data() ), QCheckListItem::RadioButton );
+}
+
+void CppNewClassDialog::addToMethodsList( QListViewItem *parent, FunctionDom method )
+{
+ PCheckListItem<FunctionDom> *it = new PCheckListItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ), QCheckListItem::CheckBox );
+ method->isAbstract() ? it->setText( 1, i18n( "replace" ) ) : it->setText( 1, i18n( "extend" ) );
+}
+
+void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, FunctionDom method, QString modifier )
+{
+ PListViewItem<FunctionDom> *it = new PListViewItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ) );
+ it->setText( 1, modifier );
+}
+
+void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, VariableDom attr, QString modifier )
+{
+ PListViewItem<VariableDom> *it = new PListViewItem<VariableDom>( attr, parent, m_part->formatModelItem( attr.data() ) );
+ it->setText( 1, modifier );
+}
+
+
+void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance )
+{
+ // Determine namespace
+ QStringList clNamespace = currNamespace;
+ bool clFullQualified = false;
+
+ if ( clName.contains( "::" ) )
+ {
+ // Full qualified, override imported namespace
+ clFullQualified = true;
+ int splitpoint = clName.findRev( "::" );
+ clNamespace = QStringList::split( "::", clName.left( splitpoint ) );
+ clName = clName.mid( splitpoint + 2 );
+ }
+
+ kdDebug( 9007 ) << "clFullQualified = " << clFullQualified << endl;
+ kdDebug( 9007 ) << "clName = " << clName << endl;
+ kdDebug( 9007 ) << "clNamespace = " << clNamespace.join( "." ) << endl;
+
+ QString templateAdd = templateActualParamsFormatted( clName );
+ removeTemplateParams( clName );
+
+ myModel = new CodeModel();
+ StoreConverter converter( m_part, myModel );
+ converter.PCSClassToCodeModel( clName, clNamespace );
+
+ ClassList myClasses = myModel->globalNamespace() ->classByName( clName );
+ // kdDebug() << " tag class count: " << myClasses.count() << endl;
+
+ for ( ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt )
+ {
+ kdDebug() << " this is class " << ( *classIt ) ->name() << endl;
+ PCheckListItem<ClassDom> *it = new PCheckListItem<ClassDom>( *classIt, constructors_view, ( *classIt ) ->name() );
+ it->templateAddition = templateAdd;
+ PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() );
+ over->templateAddition = templateAdd;
+ QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) );
+ QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) );
+ PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() );
+ QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) );
+ QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) );
+ QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) );
+
+ FunctionList functionList = ( *classIt ) ->functionList();
+ for ( FunctionList::const_iterator methodIt = functionList.begin();
+ methodIt != functionList.end(); ++methodIt )
+ {
+ if ( ( *methodIt ) ->isSignal() )
+ {
+ //don't show signals as overridable methods
+ }
+ else if ( isConstructor( ( *classIt ) ->name(), *methodIt ) )
+ {
+ addToConstructorsList( it, *methodIt );
+ }
+ else if ( ( *methodIt ) ->isSlot() )
+ {
+ if ( ( *methodIt ) ->access() != CodeModelItem::Private )
+ {
+ addToMethodsList( over_slots, *methodIt );
+
+ QString inhModifier;
+ //protected inheritance gives protected attributes
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private attributes
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public attributes
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_slots, *methodIt, inhModifier );
+ }
+ }
+ else
+ {
+ //display only public and protected methods of the base class
+ if ( ( !isDestructor( ( *classIt ) ->name(), *methodIt ) ) && ( ( *methodIt ) ->access() != CodeModelItem::Private ) )
+ {
+ addToMethodsList( over_methods, *methodIt );
+
+ //see what modifier is given for the base class
+ QString inhModifier;
+ //protected inheritance gives protected methods
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private methods
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public methods
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_methods, *methodIt, inhModifier );
+ }
+ }
+ }
+
+ VariableList variableList = ( *classIt ) ->variableList();
+ for ( VariableList::const_iterator varIt = variableList.begin();
+ varIt != variableList.end(); ++varIt )
+ {
+ if ( ( *varIt ) ->access() != CodeModelItem::Private )
+ {
+ QString inhModifier;
+ //protected inheritance gives protected attributes
+ if ( inheritance.contains( "protected" ) )
+ inhModifier = "protected";
+ //private inheritance gives private attributes
+ else if ( inheritance.contains( "private" ) )
+ inhModifier = "private";
+ //public inheritance gives protected and public attributes
+ else if ( inheritance.contains( "public" ) )
+ inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
+ addToUpgradeList( access_attrs, *varIt, inhModifier );
+ }
+ }
+ }
+}
+
+void CppNewClassDialog::clear_selection_button_clicked()
+{
+ QListViewItemIterator it( constructors_view );
+ while ( it.current() )
+ {
+ PCheckListItem<FunctionDom> *curr;
+ if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
+ curr->setOn( false );
+ ++it;
+ }
+}
+
+void CppNewClassDialog::clearConstructorsList( bool clean )
+{
+ if ( clean )
+ constructors_view->clear();
+ /* else
+ {
+ QListViewItemIterator it( constructors_view );
+ while ( it.current() )
+ {
+ if ( ! currBaseClasses.contains(it.current().text(0)) )
+ delete it.current();
+ ++it;
+ }
+ }*/
+}
+
+void CppNewClassDialog::clearMethodsList( bool clean )
+{
+ if ( clean )
+ methods_view->clear();
+}
+
+void CppNewClassDialog::clearUpgradeList( bool clean )
+{
+ if ( clean )
+ access_view->clear();
+}
+
+void CppNewClassDialog::setAccessForItem( QListViewItem *curr, QString newAccess, bool isPublic )
+{
+ if ( newAccess == "public" )
+ curr->setText( 1, isPublic ? "public" : "protected" );
+ else
+ curr->setText( 1, newAccess );
+ if ( !curr->text( 2 ).isEmpty() )
+ {
+ if ( ( curr->text( 2 ) == "private" ) && ( ( newAccess == "public" ) || ( newAccess == "protected" ) ) )
+ curr->setText( 2, QString::null );
+ if ( ( curr->text( 2 ) == "protected" ) && ( ( newAccess == "public" ) && ( isPublic ) ) )
+ curr->setText( 2, QString::null );
+ }
+}
+
+void CppNewClassDialog::setAccessForBase( QString baseclass, QString newAccess )
+{
+ QListViewItem * base;
+
+ if ( ( base = access_view->findItem( baseclass, 0 ) ) )
+ {
+ QListViewItemIterator it( base );
+ while ( it.current() )
+ {
+ if ( !it.current() ->text( 1 ).isEmpty() )
+ {
+ PListViewItem<VariableDom> *curr;
+ PListViewItem<FunctionDom> *curr_m;
+ if ( ( curr = dynamic_cast<PListViewItem<VariableDom>* >( it.current() ) ) )
+ setAccessForItem( curr, newAccess, curr->item() ->access() == CodeModelItem::Public );
+ else if ( ( curr_m = dynamic_cast<PListViewItem<FunctionDom>* >( it.current() ) ) )
+ setAccessForItem( curr_m, newAccess, curr_m->item() ->access() == CodeModelItem::Public );
+ }
+ ++it;
+ }
+ }
+}
+
+
+void CppNewClassDialog::access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &p, int /*c*/ )
+{
+ if ( item && ( ( button == LeftButton ) || ( button == RightButton ) ) && ( item->depth() > 1 ) )
+ {
+ accessMenu->setItemEnabled( 1, true );
+ accessMenu->setItemEnabled( 2, true );
+ accessMenu->setItemEnabled( 3, true );
+ if ( item->text( 1 ) == "protected" )
+ {
+ accessMenu->setItemEnabled( 1, false );
+ }
+ if ( item->text( 1 ) == "public" )
+ {
+ accessMenu->setItemEnabled( 1, false );
+ accessMenu->setItemEnabled( 2, false );
+ }
+ accessMenu->exec( p );
+
+ /* accessMenu->setItemEnabled(1, item->text(1) == "private" ? false : true );
+ accessMenu->setItemEnabled(2, item->text(1) == "protected" ? false : true );
+ accessMenu->setItemEnabled(3, item->text(1) == "public" ? false : true );*/
+ }
+}
+
+
+void CppNewClassDialog::methods_view_mouseButtonPressed( int button , QListViewItem * item, const QPoint&p , int /*c*/ )
+{
+ if ( item && ( button == RightButton ) && ( item->depth() > 1 ) && ( ! item->text( 1 ).isEmpty() ) )
+ {
+ overMenu->exec( p );
+ }
+}
+
+void CppNewClassDialog::extendFunctionality()
+{
+ if ( methods_view->selectedItem() )
+ methods_view->selectedItem() ->setText( 1, i18n( "extend" ) );
+}
+
+void CppNewClassDialog::replaceFunctionality()
+{
+ if ( methods_view->selectedItem() )
+ methods_view->selectedItem() ->setText( 1, i18n( "replace" ) );
+}
+
+void CppNewClassDialog::selectall_button_clicked()
+{
+ QListViewItemIterator it( constructors_view );
+ while ( it.current() )
+ {
+ PCheckListItem<FunctionDom> *curr;
+ if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
+ curr->setOn( true );
+ ++it;
+ }
+}
+
+void CppNewClassDialog::to_constructors_list_clicked()
+{
+ QString templateAdd = templateStrFormatted().isEmpty() ? QString::null : templateStrFormatted() + "\n";
+ QString constructor_h = classNameFormatted();
+ QString constructor_cpp = templateAdd + classNameFormatted() + templateParamsFormatted() + "::" + classNameFormatted();
+ constructor_h += "(";
+ constructor_cpp += "(";
+ QString params_h;
+ QString params_cpp;
+ QString base;
+ int unnamed = 1;
+
+ QListViewItemIterator it( constructors_view );
+ while ( it.current() )
+ {
+ PCheckListItem<FunctionDom> *curr;
+ if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
+ {
+ if ( curr->isOn() && curr->parent() )
+ {
+ //fill the base classes list
+ base += base.isEmpty() ? ": " : ", ";
+ base += curr->parent() ->text( 0 );
+ PCheckListItem<ClassDom> *p;
+ if ( ( p = dynamic_cast<PCheckListItem<ClassDom>* >( curr->parent() ) ) )
+ {
+ base += p->templateAddition;
+ }
+ params_h += params_h.isEmpty() ? "" : ", ";
+
+ //fill arguments for both constructor and base class initializer
+ QString cparams;
+ QString bparams;
+ ArgumentList argumentList = curr->item() ->argumentList();
+ for ( ArgumentList::const_iterator argIt = argumentList.begin();
+ argIt != argumentList.end(); ++argIt )
+ {
+ bparams += bparams.isEmpty() ? "" : ", ";
+ cparams += cparams.isEmpty() ? "" : ", ";
+ cparams += ( *argIt ) ->type() + " ";
+ if ( ( *argIt ) ->name().isEmpty() )
+ {
+ cparams += QString( "arg%1" ).arg( unnamed );
+ bparams += QString( "arg%1" ).arg( unnamed++ );
+ }
+ else
+ {
+ bparams += ( *argIt ) ->name();
+ cparams += ( *argIt ) ->name();
+ }
+ if ( !( *argIt ) ->defaultValue().isEmpty() )
+ bparams += " = " + ( *argIt ) ->defaultValue();
+ }
+ params_h += cparams;
+ params_cpp = params_h;
+ base += "(" + bparams + ")";
+ }
+ }
+ ++it;
+ }
+
+ constructor_cpp += params_cpp + ")" + base + QString( "\n{\n}\n\n\n" );
+ constructor_h += params_h + ");\n\n";
+
+ constructors_h_edit->append( constructor_h );
+ constructors_cpp_edit->append( constructor_cpp );
+}
+
+
+
+/* ----------------------------------------------------------
+ ----------------------------------------------------------
+ ----------------------------------------------------------
+ ----------------------------------------------------------
+
+ class CppNewClassDialog::ClassGenerator
+
+ ----------------------------------------------------------
+ ----------------------------------------------------------
+ ----------------------------------------------------------
+ ---------------------------------------------------------- */
+
+
+bool CppNewClassDialog::ClassGenerator::validateInput()
+{
+ className = dlg.classname_edit->text().simplifyWhiteSpace();
+ QString temp = className;
+ className.replace( QRegExp( "template *<.*> *(class *)?" ), "" );
+ templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" );
+ templateStr.replace( QRegExp( " *class *$" ), "" );
+
+ templateParams = templateStr;
+ templateParams.replace( QRegExp( "^ *template *" ), "" );
+ templateParams.replace( QRegExp( " *class *" ), "" );
+ templateParams.simplifyWhiteSpace();
+
+ if ( className.isEmpty() )
+ {
+ KMessageBox::error( &dlg, i18n( "You must enter a classname." ) );
+ return false;
+ }
+
+ header = dlg.header_edit->text().simplifyWhiteSpace();
+ if ( header.isEmpty() )
+ {
+ KMessageBox::error( &dlg, i18n( "You must enter a name for the header file." ) );
+ return false;
+ }
+ implementation = dlg.implementation_edit->text().simplifyWhiteSpace();
+ if ( (!headeronly) && implementation.isEmpty() )
+ {
+ KMessageBox::error( &dlg, i18n( "You must enter a name for the implementation file." ) );
+ return false;
+ }
+
+ /// \FIXME
+ if ( ( header.find( '/' ) != -1 || implementation.find( '/' ) != -1 ) && !( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) )
+ {
+ KMessageBox::error( &dlg, i18n( "Generated files will always be added to the "
+ "active directory, so you must not give an "
+ "explicit subdirectory." ) );
+ return false;
+ }
+
+ return true;
+}
+
+
+bool CppNewClassDialog::ClassGenerator::generate()
+{
+ if ( !validateInput() )
+ return false;
+
+ project = dlg.m_part->project();
+ subDir = project->projectDirectory() + "/";
+ if ( !project->activeDirectory().isEmpty() ){
+ subDir += project->activeDirectory();
+ subDir = QDir::cleanDirPath(subDir);
+ subDir += "/";
+ }
+ headerPath = subDir + header;
+ implementationPath = subDir + implementation;
+
+ if ( QFileInfo( headerPath ).exists() || QFileInfo( implementationPath ).exists() )
+ {
+ KMessageBox::error( &dlg, i18n( "KDevelop is not able to add classes "
+ "to existing header or implementation files." ) );
+ return false;
+ }
+
+ if( ( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) )
+ {
+ QDir dir( QFileInfo( project->projectDirectory()+QString( QChar( QDir::separator() ) )+project->activeDirectory() + QString( QChar( QDir::separator() ) ) + header ).dirPath() );
+ kdDebug(9024) << "Dir for new file:" << dir.absPath() << endl;
+ if( dir.isRelative() )
+ dir.convertToAbs();
+
+ QValueStack<QString> dirsToCreate;
+ while( !dir.exists() )
+ {
+ dirsToCreate.push( dir.dirName() );
+ dir.cdUp();
+ }
+
+ while( !dirsToCreate.isEmpty() )
+ {
+ dir.mkdir( dirsToCreate.top() );
+ dir.cd( dirsToCreate.pop() );
+ }
+ }
+ common_text();
+
+ if(!headeronly) gen_implementation();
+
+ gen_interface();
+
+ QStringList fileList;
+ QString file;
+ if( project->activeDirectory().isEmpty() )
+ file = header;
+ else
+ file = project->activeDirectory() + "/" + header;
+ fileList.append ( file );
+ if (!headeronly)
+ {
+ if( project->activeDirectory().isEmpty() )
+ file = implementation;
+ else
+ file = project->activeDirectory() + "/" + implementation;
+ fileList.append ( file );
+ }
+ project->addFiles ( fileList );
+
+ return true;
+}
+
+void CppNewClassDialog::ClassGenerator::common_text()
+{
+
+ // common
+
+ namespaceStr = dlg.namespace_edit->text();
+ namespaces = QStringList::split( QString( "::" ), namespaceStr );
+
+ childClass = dlg.childclass_box->isChecked();
+ objc = dlg.objc_box->isChecked();
+ qobject = dlg.qobject_box->isChecked();
+ gtk = dlg.gtk_box->isChecked();
+ headeronly = dlg.headeronly_box->isChecked();
+
+ if ( ( dlg.baseclasses_view->childCount() == 0 ) && childClass )
+ new QListViewItem( dlg.baseclasses_view, "QWidget", "public" );
+ if ( objc && ( dlg.baseclasses_view->childCount() == 0 ) )
+ new QListViewItem( dlg.baseclasses_view, "NSObject", "public" );
+
+ if ( dlg.documentation_edit->text().isEmpty() && ( !dlg.gen_config->doc_box->isChecked() ) )
+ doc = "";
+ else
+ {
+ doc = QString( "/**\n" );
+ if ( !dlg.documentation_edit->text().isEmpty() )
+ {
+ doc.append( dlg.documentation_edit->text() );
+ if ( dlg.gen_config->author_box->isChecked() )
+ doc.append( "\n\n" );
+ }
+ QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" );
+ QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" );
+ if( !email.isEmpty() )
+ author += QString( " <%1>" ).arg( email );
+
+ if ( dlg.gen_config->author_box->isChecked() )
+ doc.append( "\t@author " + author + "\n" );
+ doc.append( "*/" );
+ }
+
+ if ( !namespaceStr.isEmpty() )
+ {
+ for ( QStringList::Iterator it = namespaces.begin(); it != namespaces.end(); ++it )
+ {
+ if ( !namespaceBeg.isEmpty() )
+ namespaceBeg += "\n\n";
+ if ( !namespaceEnd.isEmpty() )
+ namespaceEnd += "\n\n";
+ namespaceBeg += "namespace " + ( *it ) + " {";
+ namespaceEnd += "}";
+ }
+ }
+
+ //advanced constructor creation
+
+ advConstructorsHeader = QString::null;
+ advConstructorsSource = QString::null;
+ if ( !dlg.constructors_h_edit->text().isEmpty() )
+ {
+ advConstructorsHeader = " " + dlg.constructors_h_edit->text();
+ advConstructorsHeader.replace( QRegExp( "\n" ), "\n " );
+ }
+ if ( !dlg.constructors_cpp_edit->text().isEmpty() )
+ {
+ advConstructorsSource = dlg.constructors_cpp_edit->text();
+ }
+ advConstructorsHeader.replace( QRegExp( "[\\n ]*$" ), QString::null );
+ advConstructorsSource.replace( QRegExp( "[\\n ]*$" ), QString::null );
+
+ //advanced method overriding
+
+ advH_public = QString::null;
+ advH_public_slots = QString::null;
+ advH_protected = QString::null;
+ advH_protected_slots = QString::null;
+ advH_private = QString::null;
+ advH_private_slots = QString::null;
+ advCpp = QString::null;
+
+ QListViewItemIterator it( dlg.methods_view );
+ while ( it.current() )
+ {
+ PCheckListItem<FunctionDom> *curr;
+ if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
+ {
+ if ( curr->isOn() && ( curr->parent() ) && ( curr->parent() ->parent() ) )
+ {
+ QString * adv_h = 0;
+ if ( curr->item() ->access() == CodeModelItem::Private )
+ adv_h = curr->item() ->isSlot() ? &advH_private_slots : &advH_private;
+ if ( curr->item() ->access() == CodeModelItem::Protected )
+ adv_h = curr->item() ->isSlot() ? &advH_protected_slots : &advH_protected;
+ if ( curr->item() ->access() == CodeModelItem::Public )
+ adv_h = curr->item() ->isSlot() ? &advH_public_slots : &advH_public;
+
+ // if (advCpp.isEmpty()) advCpp += "\n\n";
+
+ QString bcName = curr->parent() ->parent() ->text( 0 );
+ PListViewItem<ClassDom> *bc;
+ if ( ( bc = dynamic_cast<PListViewItem<ClassDom>* >( curr->parent() ->parent() ) ) )
+ {
+ bcName += bc->templateAddition;
+ }
+ genMethodDeclaration( curr->item(), className, templateStr, adv_h, &advCpp,
+ ( curr->text( 1 ) == i18n( "extend" ) ) ? true : false, bcName );
+ }
+ }
+ ++it;
+ }
+
+ //advanced access control and upgrading
+ QListViewItemIterator ita( dlg.access_view );
+ while ( ita.current() )
+ {
+ PListViewItem<VariableDom> *curr;
+ PListViewItem<FunctionDom> *curr_m;
+ if ( ( curr = dynamic_cast<PListViewItem<VariableDom>* >( ita.current() ) ) )
+ {
+ if ( ( !curr->text( 2 ).isEmpty() ) && ( curr->parent() ) && ( curr->parent() ->parent() ) )
+ {
+ QString * adv_h = 0;
+ if ( curr->text( 2 ) == "private" )
+ adv_h = &advH_private;
+ if ( curr->text( 2 ) == "public" )
+ adv_h = &advH_public;
+ if ( curr->text( 2 ) == "protected" )
+ adv_h = &advH_protected;
+
+ /* if ((*adv_h).isEmpty())
+ *adv_h += "\n\n";*/
+ if ( adv_h )
+ *adv_h += QString( " using " ) + curr->parent() ->parent() ->text( 0 ) + "::" + curr->item() ->name() + ";\n";
+ }
+ }
+ else if ( ( curr_m = dynamic_cast<PListViewItem<FunctionDom>* >( ita.current() ) ) )
+ {
+ if ( ( !curr_m->text( 2 ).isEmpty() ) && ( curr_m->parent() ) && ( curr_m->parent() ->parent() ) )
+ {
+ QString * adv_h = 0;
+ if ( curr_m->text( 2 ) == "private" )
+ adv_h = &advH_private;
+ if ( curr_m->text( 2 ) == "public" )
+ adv_h = &advH_public;
+ if ( curr_m->text( 2 ) == "protected" )
+ adv_h = &advH_protected;
+
+ /* if ((*adv_h).isEmpty())
+ *adv_h += "\n\n";*/
+
+ QString methodName = curr_m->item() ->name();
+ if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) )
+ methodName = "operator" + methodName;
+ *adv_h += " using " + curr_m->parent() ->parent() ->text( 0 ) + "::" + methodName + ";\n";
+ }
+ }
+ ++ita;
+ }
+
+ QRegExp e( "[\\n ]*$" );
+ advH_public.replace( e, QString::null );
+ advH_public_slots.replace( e, QString::null );
+ advH_protected.replace( e, QString::null );
+ advH_protected_slots.replace( e, QString::null );
+ advH_private.replace( e, QString::null );
+ advH_private_slots.replace( e, QString::null );
+ advCpp.replace( e, QString::null );
+}
+
+void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method,
+ QString className, QString templateStr, QString *adv_h, QString *adv_cpp, bool extend, QString baseClassName )
+{
+ /* if ((*adv_h).isEmpty())
+ *adv_h += "\n\n";*/
+ QString methodName = method->name();
+ if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) )
+ methodName = "operator" + methodName;
+ *adv_h += " " + ( method->isVirtual() ? QString( "virtual " ) : QString( "" ) )
+ + ( method->isStatic() ? QString( "static " ) : QString( "" ) )
+ + method->resultType() + " " + methodName + "(";
+ if ( !templateStr.isEmpty() )
+ * adv_cpp += templateStr + "\n";
+ *adv_cpp += method->resultType() + " " + className + templateParams + "::" + methodName + "(";
+
+ QString bparams;
+ QString cparams;
+ int unnamed = 1;
+
+ ArgumentList argumentList = method->argumentList();
+ for ( ArgumentList::const_iterator argIt = argumentList.begin();
+ argIt != argumentList.end(); ++argIt )
+ {
+ bparams += bparams.isEmpty() ? "" : ", ";
+ cparams += cparams.isEmpty() ? "" : ", ";
+ cparams += ( *argIt ) ->type() + " ";
+ if ( ( *argIt ) ->name().isEmpty() )
+ {
+ cparams += QString( "arg%1" ).arg( unnamed );
+ bparams += QString( "arg%1" ).arg( unnamed++ );
+ }
+ else
+ {
+ bparams += ( *argIt ) ->name();
+ cparams += ( *argIt ) ->name();
+ }
+ if ( !( *argIt ) ->defaultValue().isEmpty() )
+ bparams += " " + ( *argIt ) ->defaultValue();
+ }
+ *adv_h += cparams + ")" + ( method->isConstant() ? " const" : "" ) + ";\n";
+ *adv_cpp += cparams + ")" + ( method->isConstant() ? " const" : "" ) + "\n{\n";
+ if ( extend )
+ * adv_cpp += ( ( method->resultType() == "void" ) ? " " : " return " ) +
+ baseClassName + "::" + methodName + "(" + bparams + ");\n";
+ *adv_cpp += "}\n\n";
+}
+
+
+void CppNewClassDialog::ClassGenerator::gen_implementation()
+{
+
+ // implementation
+
+ QString classImpl;
+ QFileInfo fi( implementationPath );
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName( true );
+
+ if ( dlg.filetemplate_box->isChecked() )
+ {
+ /* QDomDocument dom = *dlg.m_part->projectDom();
+ if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false))
+ classImpl = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/implementationURL",""), FileTemplate::Custom);
+ else*/
+ classImpl = FileTemplate::read( dlg.m_part, fi.extension( true ) );
+ }
+
+ classImpl.replace( QRegExp( "\\$MODULE\\$" ), module );
+ classImpl.replace( QRegExp( "\\$FILENAME\\$" ), basefilename );
+
+ if ( objc )
+ {
+ classImpl += dlg.gen_config->objcSource();
+ }
+ else if ( gtk )
+ {
+ classImpl += dlg.gen_config->gtkSource();
+ }
+ else
+ {
+ classImpl += dlg.gen_config->cppSource();
+ /* classImpl += QString(
+ "#include \"$HEADER$\"\n"
+ "\n"
+ "\n")
+ + namespaceBeg
+ + ( advConstructorsSource.isEmpty() ? QString("$CLASSNAME$::$CLASSNAME$($ARGS$)\n"
+ "$BASEINITIALIZER$"
+ "{\n"
+ "}\n") : advConstructorsSource )
+ + QString("\n"
+ "$CLASSNAME$::~$CLASSNAME$()\n"
+ "{\n"
+ "}\n")
+ + advCpp
+ + namespaceEnd;*/
+ }
+
+ QString relPath;
+ for ( int i = implementation.findRev( '/' ); i != -1; i = implementation.findRev( '/', --i ) )
+ relPath += "../";
+
+ QString constructors = ( advConstructorsSource.isEmpty() ? QString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n"
+ "$BASEINITIALIZER$"
+ "{\n"
+ "}" ) : advConstructorsSource )
+ + QString( "\n\n\n"
+ "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::~$CLASSNAME$()\n"
+ "{\n"
+ "}\n" );
+
+ qWarning( "NEW CLASS: constructors = %s", constructors.latin1() );
+
+ if ( childClass )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ {
+ argsH = "QWidget *parent = 0, const char *name = 0";
+ argsCpp = "QWidget *parent, const char *name";
+ }
+ else
+ {
+ argsH = "QWidget *parent = 0";
+ argsCpp = "QWidget *parent";
+ }
+ }
+ else if ( qobject )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ {
+ argsH = "QObject *parent = 0, const char *name = 0";
+ argsCpp = "QObject *parent, const char *name";
+ }
+ else
+ {
+ argsH = "QObject *parent = 0";
+ argsCpp = "QObject *parent";
+ }
+ }
+ else
+ {
+ argsH = "";
+ argsCpp = "";
+ }
+ QString baseInitializer;
+
+ if ( childClass && ( dlg.baseclasses_view->childCount() == 0 ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ baseInitializer = " : QWidget(parent, name)";
+ else
+ baseInitializer = " : QWidget(parent)";
+ }
+ else if ( qobject && ( dlg.baseclasses_view->childCount() == 0 ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ baseInitializer = " : QObject(parent, name)";
+ else
+ baseInitializer = " : QObject(parent)";
+ }
+ else if ( dlg.baseclasses_view->childCount() != 0 )
+ {
+ QListViewItemIterator it( dlg.baseclasses_view );
+ baseInitializer += " : ";
+ while ( it.current() )
+ {
+ if ( !it.current() ->text( 0 ).isEmpty() )
+ {
+ if ( baseInitializer != " : " )
+ {
+ baseInitializer += ", ";
+ }
+
+ if ( childClass && ( baseInitializer == " : " ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ baseInitializer += it.current()->text( 0 ) + "(parent, name)";
+ else
+ baseInitializer += it.current()->text( 0 ) + "(parent)";
+ }
+ else if ( qobject && ( baseInitializer == " : " ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ baseInitializer += it.current()->text( 0 ) + "(parent, name)";
+ else
+ baseInitializer += it.current()->text( 0 ) + "(parent)";
+ }
+ else
+ {
+ baseInitializer += it.current()->text( 0 ) + "()";
+ }
+ }
+ ++it;
+ }
+ baseInitializer += "\n";
+ }
+
+ constructors.replace( QRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer );
+ constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className );
+ // qWarning("NEW CLASS: constructors = %s", constructors.latin1());
+ if ( templateStr.isEmpty() )
+ {
+ constructors.replace( QRegExp( "\\$TEMPLATESTR\\$\\n" ), "" );
+ constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), "" );
+ }
+ else
+ {
+ constructors.replace( QRegExp( "\\$TEMPLATESTR\\$" ), templateStr );
+ constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams );
+ classImpl.replace( QRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" );
+ }
+ // qWarning("NEW CLASS: constructors = %s", constructors.latin1());
+ constructors.replace( QRegExp( "\\$ARGS\\$" ), argsCpp );
+ // qWarning("NEW CLASS: constructors = %s", constructors.latin1());
+
+
+ //remove unnesessary carriadge returns
+ QString hp = relPath + header;
+ beautifySource( classImpl, hp, className, namespaceBeg, constructors, advCpp, namespaceEnd, implementation );
+
+ classImpl.replace( QRegExp( "\\$HEADER\\$" ), relPath + header );
+ classImpl.replace( QRegExp( "\\$CLASSNAME\\$" ), className );
+ classImpl.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg );
+ classImpl.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$" ), constructors );
+ classImpl.replace( QRegExp( "\\$DEFINITIONS\\$" ), advCpp );
+ classImpl.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd );
+ classImpl.replace( QRegExp( "\\$FILENAME\\$" ), implementation );
+
+ if ( ( dlg.m_part->project() ) && ( childClass || qobject ) && ( dlg.m_part->project() ->options() & KDevProject::UsesAutotoolsBuildSystem ) )
+ {
+ QString moc = header;
+ moc.replace( QRegExp( "\\..*" ), ".moc" );
+ classImpl += "#include \"" + moc + "\"\n";
+ }
+
+ if ( dlg.gen_config->reformat_box->isChecked() )
+ {
+ KDevSourceFormatter * fmt = dlg.m_part->extension<KDevSourceFormatter>( "KDevelop/SourceFormatter" );
+ if ( fmt )
+ classImpl = fmt->formatSource( classImpl );
+ }
+
+ kdDebug( 9007 ) << "implementationPath = " << implementationPath << endl;
+
+ QFile ifile( implementationPath );
+ if ( !ifile.open( IO_WriteOnly ) )
+ {
+ KMessageBox::error( &dlg, i18n( "Cannot write to implementation file" ) );
+ return ;
+ }
+ QTextStream istream( &ifile );
+ istream << classImpl;
+ ifile.close();
+
+ KURL u;
+ u.setPath( implementationPath );
+ dlg.m_part->partController()->editDocument( u );
+}
+
+
+void CppNewClassDialog::ClassGenerator::gen_interface()
+{
+ // interface
+
+ QString classIntf;
+ QFileInfo fi( headerPath );
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName( true );
+
+ if ( dlg.filetemplate_box->isChecked() )
+ {
+ /* QDomDocument dom = *dlg.m_part->projectDom();
+ if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false))
+ classIntf = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/interfaceURL",""), FileTemplate::Custom);
+ else*/
+ classIntf = FileTemplate::read( dlg.m_part, fi.extension( true ) );
+ }
+
+ classIntf.replace( QRegExp( "\\$MODULE\\$" ), module );
+ classIntf.replace( QRegExp( "\\$FILENAME\\$" ), basefilename );
+
+ if ( objc )
+ {
+ classIntf += dlg.gen_config->objcHeader();
+ }
+ else if ( gtk )
+ {
+ classIntf += dlg.gen_config->gtkHeader();
+ }
+ else
+ {
+ classIntf += dlg.gen_config->cppHeader();
+ /* classIntf = QString("\n"
+ "#ifndef $HEADERGUARD$\n"
+ "#define $HEADERGUARD$\n"
+ "\n"
+ "$INCLUDEBASEHEADER$\n"
+ "\n")
+ + namespaceBeg
+ + QString("class $CLASSNAME$$INHERITANCE$\n"
+ "{\n"
+ "$QOBJECT$"
+ "public:\n")
+ + ( advConstructorsHeader.isEmpty() ? QString(" $CLASSNAME$($ARGS$);\n") : advConstructorsHeader )
+ + QString("\n ~$CLASSNAME$();\n")
+ + advH_public
+ + (advH_public_slots.isEmpty() ? QString::fromLatin1("") : ("\n\npublic slots:" + advH_public_slots))
+ + (advH_protected.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected:" + advH_protected))
+ + (advH_protected_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected slots:" + advH_protected_slots))
+ + (advH_private.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate:" + advH_private))
+ + (advH_private_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate slots:" + advH_private_slots))
+ + QString("};\n"
+ "\n")
+ + namespaceEnd
+ + "#endif\n";*/
+ }
+
+ QString headerGuard;
+ switch ( dlg.gen_config->defCase() )
+ {
+ case ClassGeneratorConfig::UpperCase:
+ headerGuard = namespaceStr.upper() + header.mid( header.findRev( "/" )+1 ).upper();
+ break;
+ case ClassGeneratorConfig::LowerCase:
+ headerGuard = namespaceStr.lower() + header.mid( header.findRev( "/" )+1 ).lower();
+ break;
+ case ClassGeneratorConfig::SameAsFileCase:
+ headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().findRev( "/" )+1 );
+ break;
+ case ClassGeneratorConfig::SameAsClassCase:
+ headerGuard = namespaceStr + header.mid( header.findRev( "/" )+1 );
+ break;
+ }
+
+ headerGuard.replace( QRegExp( "\\." ), "_" );
+ headerGuard.replace( QRegExp( "::" ), "_" );
+ QString includeBaseHeader;
+ if( dlg.m_part->qtBuildConfig()->isUsed() )
+ {
+ if( childClass && ( dlg.baseclasses_view->childCount() == 0 ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ includeBaseHeader = "#include <qwidget.h>";
+ else
+ includeBaseHeader = "#include <QWidget>";
+ }
+ else if( qobject && ( dlg.baseclasses_view->childCount() == 0 ) )
+ {
+ if( dlg.m_part->qtBuildConfig()->version() == 3 )
+ includeBaseHeader = "#include <qobject.h>";
+ else
+ includeBaseHeader = "#include <QObject>";
+ }
+ }
+
+ if ( objc )
+ {
+ if ( dlg.baseclasses_view->firstChild() )
+ if ( dlg.baseclasses_view->firstChild() ->text( 0 ) != "NSObject" )
+ if ( !dlg.baseclasses_view->firstChild() ->text( 3 ).isEmpty() )
+ includeBaseHeader = "#include "
+ + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) )
+ + dlg.baseclasses_view->firstChild() ->text( 3 )
+ + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) );
+ }
+ else
+ {
+ QListViewItemIterator it( dlg.baseclasses_view );
+ while ( it.current() )
+ {
+ if ( !it.current() ->text( 0 ).isEmpty() )
+ if ( !it.current() ->text( 3 ).isEmpty() )
+ // if ((!childClass) || (it.current()->text(0) != "QWidget"))
+ includeBaseHeader += ( includeBaseHeader.isEmpty() ? QString( "" ) : QString( "\n" ) ) + QString::fromLatin1( "#include " ) +
+ ( it.current() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) )
+ + it.current() ->text( 3 )
+ + ( it.current() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) );
+ ++it;
+ }
+ }
+
+ QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" );
+ QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" );
+ if( !email.isEmpty() )
+ author += QString( " <%1>" ).arg( email );
+
+ QString inheritance;
+ if ( dlg.baseclasses_view->childCount() > 0 )
+ {
+ inheritance += " : ";
+
+ QListViewItemIterator it( dlg.baseclasses_view );
+ while ( it.current() )
+ {
+ if ( !it.current() ->text( 0 ).isEmpty() )
+ {
+ if ( inheritance != " : " )
+ inheritance += ", ";
+ if ( it.current() ->text( 1 ).contains( "virtual" ) )
+ inheritance += "virtual ";
+ if ( it.current() ->text( 1 ).contains( "public" ) )
+ inheritance += "public ";
+ if ( it.current() ->text( 1 ).contains( "protected" ) )
+ inheritance += "protected ";
+ if ( it.current() ->text( 1 ).contains( "private" ) )
+ inheritance += "private ";
+ inheritance += it.current() ->text( 0 );
+ }
+ ++it;
+ }
+ }
+ else if ( qobject )
+ inheritance += ": public QObject";
+
+ QString constructors = QString( advConstructorsHeader.isEmpty() ?
+ QString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader )
+ + QString( "\n\n ~$CLASSNAME$();" );
+
+ constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className );
+ constructors.replace( QRegExp( "\\$ARGS\\$" ), argsH );
+
+ QString qobjectStr;
+ if ( childClass || qobject )
+ qobjectStr = "Q_OBJECT";
+
+
+ QString baseclass;
+ if ( dlg.baseclasses_view->childCount() > 0 )
+ baseclass = dlg.baseclasses_view->firstChild() ->text( 0 );
+ //remove unnesessary carriadge returns
+ beautifyHeader( classIntf, headerGuard, includeBaseHeader, author, doc, className, templateStr,
+ baseclass, inheritance, qobjectStr, argsH,
+ header, namespaceBeg, constructors, advH_public, advH_public_slots,
+ advH_protected, advH_protected_slots, advH_private, advH_private_slots, namespaceEnd );
+
+
+ classIntf.replace( QRegExp( "\\$HEADERGUARD\\$" ), headerGuard );
+ classIntf.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$" ), includeBaseHeader );
+ classIntf.replace( QRegExp( "\\$AUTHOR\\$" ), author );
+ classIntf.replace( QRegExp( "\\$DOC\\$" ), doc );
+ classIntf.replace( QRegExp( "\\$TEMPLATE\\$" ), templateStr );
+ classIntf.replace( QRegExp( "\\$CLASSNAME\\$" ), className );
+ if ( dlg.baseclasses_view->childCount() > 0 )
+ classIntf.replace( QRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) );
+ classIntf.replace( QRegExp( "\\$INHERITANCE\\$" ), inheritance );
+ classIntf.replace( QRegExp( "\\$QOBJECT\\$" ), qobjectStr );
+ classIntf.replace( QRegExp( "\\$ARGS\\$" ), argsH );
+ classIntf.replace( QRegExp( "\\$FILENAME\\$" ), header );
+ classIntf.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg );
+ classIntf.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$" ), constructors );
+ classIntf.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$" ), advH_public );
+ classIntf.replace( QRegExp( "\\$PUBLICSLOTS\\$" ), advH_public_slots );
+ classIntf.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$" ), QString( "protected:\n" ) + advH_protected );
+ classIntf.replace( QRegExp( "\\$PROTECTEDSLOTS\\$" ), QString( "protected slots:\n" ) + advH_protected_slots );
+ classIntf.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$" ), QString( "private:\n" ) + advH_private );
+ classIntf.replace( QRegExp( "\\$PRIVATESLOTS\\$" ), QString( "private slots:\n" ) + advH_private_slots );
+ classIntf.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd );
+
+ if ( !templateStr.isEmpty() && (!headeronly) )
+ classIntf.replace( QRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" );
+
+ if ( dlg.gen_config->reformat_box->isChecked() )
+ {
+ KDevSourceFormatter * fmt = dlg.m_part->extension<KDevSourceFormatter>( "KDevelop/SourceFormatter" );
+ if ( fmt )
+ classIntf = fmt->formatSource( classIntf );
+ }
+
+ QFile hfile( headerPath );
+ if ( !hfile.open( IO_WriteOnly ) )
+ {
+ KMessageBox::error( &dlg, i18n( "Cannot write to header file" ) );
+ return ;
+ }
+ QTextStream hstream( &hfile );
+ hstream << classIntf;
+ hfile.close();
+
+ KURL u;
+ u.setPath( headerPath );
+ dlg.m_part->partController()->editDocument( u );
+}
+
+void CppNewClassDialog::ClassGenerator::beautifyHeader( QString &templ, QString &headerGuard,
+ QString &includeBaseHeader, QString &author, QString &doc, QString &className, QString &templateStr,
+ QString &baseclass, QString &inheritance, QString &qobjectStr, QString &args,
+ QString &header, QString &namespaceBeg, QString &constructors, QString &advH_public, QString &advH_public_slots,
+ QString &advH_protected, QString &advH_protected_slots, QString &advH_private, QString &advH_private_slots,
+ QString &namespaceEnd )
+{
+ if ( headerGuard.isEmpty() )
+ templ.replace( QRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), QString::null );
+ if ( includeBaseHeader.isEmpty() )
+ templ.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), QString::null );
+ if ( author.isEmpty() )
+ templ.replace( QRegExp( "\\$AUTHOR\\$[\\n ]*" ), QString::null );
+ if ( doc.isEmpty() )
+ templ.replace( QRegExp( "\\$DOC\\$[\\n ]*" ), QString::null );
+ if ( className.isEmpty() )
+ templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null );
+ if ( templateStr.isEmpty() )
+ templ.replace( QRegExp( "\\$TEMPLATE\\$[\\n ]*" ), QString::null );
+ if ( baseclass.isEmpty() )
+ templ.replace( QRegExp( "\\$BASECLASS\\$[\\n ]*" ), QString::null );
+ if ( inheritance.isEmpty() )
+ templ.replace( QRegExp( "\\$INHERITANCE\\$[\\n ]*" ), QString::null );
+ if ( qobjectStr.isEmpty() )
+ templ.replace( QRegExp( "\\$QOBJECT\\$[\\n ]*" ), QString::null );
+ if ( args.isEmpty() )
+ templ.replace( QRegExp( "\\$ARGS\\$[\\n ]*" ), QString::null );
+ if ( header.isEmpty() )
+ templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null );
+ if ( namespaceBeg.isEmpty() )
+ templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null );
+ if ( constructors.isEmpty() )
+ templ.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), QString::null );
+ if ( advH_public.isEmpty() )
+ templ.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), QString::null );
+ if ( advH_public_slots.isEmpty() )
+ templ.replace( QRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), QString::null );
+ if ( advH_protected.isEmpty() )
+ templ.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), QString::null );
+ if ( advH_protected_slots.isEmpty() )
+ templ.replace( QRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), QString::null );
+ if ( advH_private.isEmpty() )
+ templ.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), QString::null );
+ if ( advH_private_slots.isEmpty() )
+ templ.replace( QRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), QString::null );
+ if ( namespaceEnd.isEmpty() )
+ templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null );
+}
+
+
+void CppNewClassDialog::ClassGenerator::beautifySource( QString &templ, QString &header, QString &className, QString &namespaceBeg,
+ QString &constructors, QString &advCpp, QString &namespaceEnd, QString &implementation )
+{
+ if ( header.isEmpty() )
+ templ.replace( QRegExp( "\\$HEADER\\$[\\n ]*" ), QString::null );
+ if ( className.isEmpty() )
+ templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null );
+ if ( namespaceBeg.isEmpty() )
+ templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null );
+ if ( constructors.isEmpty() )
+ templ.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), QString::null );
+ if ( advCpp.isEmpty() )
+ templ.replace( QRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), QString::null );
+ if ( namespaceEnd.isEmpty() )
+ templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null );
+ if ( implementation.isEmpty() )
+ templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null );
+}
+
+QString CppNewClassDialog::classNameFormatted( )
+{
+ return classNameFormatted( classname_edit->text() );
+}
+
+QString CppNewClassDialog::classNameFormatted( const QString &name )
+{
+ QString temp = name.simplifyWhiteSpace();
+ return temp.replace( QRegExp( "template *<.*> *(class *)?" ), "" );
+}
+
+
+QString CppNewClassDialog::templateStrFormatted( )
+{
+ return templateStrFormatted( classname_edit->text() );
+}
+
+QString CppNewClassDialog::templateStrFormatted( const QString &name )
+{
+ QString className = name.simplifyWhiteSpace();
+ QString temp = className;
+ className.replace( QRegExp( "template *<.*> *(class *)?" ), "" );
+ QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" );
+ templateStr.replace( QRegExp( " *class *$" ), "" );
+ return templateStr;
+}
+
+QString CppNewClassDialog::templateParamsFormatted( )
+{
+ return templateParamsFormatted( classname_edit->text() );
+}
+
+QString CppNewClassDialog::templateParamsFormatted( const QString &name )
+{
+ QString className = name.simplifyWhiteSpace();
+ QString temp = className;
+ className.replace( QRegExp( "template *<.*> *(class *)?" ), "" );
+ QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" );
+ templateStr.replace( QRegExp( " *class *$" ), "" );
+
+ QString templateParams = templateStr;
+ templateParams.replace( QRegExp( "^ *template *" ), "" );
+ templateParams.replace( QRegExp( " *class *" ), "" );
+ templateParams.simplifyWhiteSpace();
+
+ return templateParams;
+}
+
+QString CppNewClassDialog::templateActualParamsFormatted( const QString & name )
+{
+ QString className = name.simplifyWhiteSpace();
+ QString temp = className;
+ className.replace( QRegExp( "<.*> *" ), "" );
+ QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" );
+ return templateStr;
+}
+
+void CppNewClassDialog::removeTemplateParams( QString & name )
+{
+ name.replace( QRegExp( "<.*> *" ), "" );
+}
+
+bool CppNewClassDialog::isDestructor( QString className, const FunctionDom &method )
+{
+ if ( m_part->formatModelItem( method.data() ).contains( QRegExp( " *~ *" + className ) ) )
+ return true;
+ return false;
+}
+
+void CppNewClassDialog::headeronly_box_stateChanged(int val)
+{
+ implementation_edit->setEnabled(!val);
+}
+
+#include "cppnewclassdlg.moc"
+
+//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/languages/cpp/cppnewclassdlg.h b/languages/cpp/cppnewclassdlg.h
new file mode 100644
index 00000000..fb680921
--- /dev/null
+++ b/languages/cpp/cppnewclassdlg.h
@@ -0,0 +1,292 @@
+/***************************************************************************
+* Copyright (C) 1998 by Sandy Meier *
+* smeier@rz.uni-potsdam.de *
+* Copyright (C) 2002 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 _CPPNEWCLASSDLG_H_
+#define _CPPNEWCLASSDLG_H_
+
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qwidgetstack.h>
+
+#include "codemodel.h"
+#include "cppnewclassdlgbase.h"
+
+class CppSupportPart;
+class KDevProject;
+class QPopupMenu;
+class KCompletion;
+class CodeModel;
+
+
+template <class T>
+class PCheckListItem: public QCheckListItem
+{
+public:
+
+ PCheckListItem ( T item, QCheckListItem * parent, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QCheckListItem * parent, QListViewItem * after, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, after, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListViewItem * parent, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListViewItem * parent, QListViewItem * after, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, after, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListView * parent, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListView * parent, QListViewItem * after, const QString & text, Type tt = Controller ) :
+ QCheckListItem ( parent, after, text, tt ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListViewItem * parent, const QString & text, const QPixmap & p ) :
+ QCheckListItem ( parent, text, p ), m_item( item )
+ {}
+
+ PCheckListItem ( T item, QListView * parent, const QString & text, const QPixmap & p ) :
+ QCheckListItem ( parent, text, p ), m_item( item )
+ {}
+
+ T item()
+ {
+ return m_item;
+ }
+
+ QString templateAddition;
+
+private:
+ T m_item;
+};
+
+template <class T>
+class PListViewItem: public QListViewItem
+{
+public:
+
+ PListViewItem ( T item, QListViewItem * parent, QListViewItem * after, const QString & text ) :
+ QListViewItem ( parent, after, text ), m_item( item )
+ {}
+
+ PListViewItem ( T item, QListViewItem * parent, const QString & text ) :
+ QListViewItem ( parent, text ), m_item( item )
+ {}
+
+ PListViewItem ( T item, QListView * parent, const QString & text ) :
+ QListViewItem ( parent, text ), m_item( item )
+ {}
+
+ PListViewItem ( T item, QListView * parent, QListViewItem * after, const QString & text ) :
+ QListViewItem ( parent, after, text ), m_item( item )
+ {}
+
+ T item()
+ {
+ return m_item;
+ }
+
+ QString templateAddition;
+private:
+ T m_item;
+};
+
+
+class CppNewClassDialog : public CppNewClassDialogBase
+{
+ Q_OBJECT
+
+public:
+ CppNewClassDialog( CppSupportPart *part, QWidget *parent = 0, const char *name = 0 );
+ ~CppNewClassDialog();
+
+protected:
+ virtual void accept();
+ virtual void classNameChanged( const QString &text );
+ virtual void classNamespaceChanged( const QString &text );
+ virtual void headerChanged();
+ virtual void implementationChanged();
+ virtual void nameHandlerChanged( const QString &text );
+ virtual void baseclassname_changed( const QString &text );
+ virtual void baseIncludeChanged( const QString &text );
+
+ virtual void addBaseClass();
+ virtual void remBaseClass();
+ virtual void remBaseClassOnly();
+ virtual void currBaseNameChanged( const QString &text );
+ virtual void currBasePrivateSet();
+ virtual void currBaseProtectedSet();
+ virtual void currBasePublicSet();
+ virtual void currBaseVirtualChanged( int val );
+ virtual void currBaseSelected( QListViewItem *it );
+ virtual void scopeboxActivated( int value );
+
+ virtual void checkObjCInheritance( int val );
+ virtual void checkQWidgetInheritance( int val );
+
+ virtual void upbaseclass_button_clicked();
+ virtual void downbaseclass_button_clicked();
+ virtual void baseclasses_view_selectionChanged();
+
+ virtual void newTabSelected( const QString &text );
+ virtual void newTabSelected( QWidget *w );
+ virtual void access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &p, int c );
+ virtual void changeToPrivate();
+ virtual void changeToProtected();
+ virtual void changeToPublic();
+ virtual void changeToInherited();
+ virtual void methods_view_mouseButtonPressed( int button , QListViewItem * item, const QPoint&p , int c );
+ virtual void extendFunctionality();
+ virtual void replaceFunctionality();
+ virtual void to_constructors_list_clicked();
+ virtual void clear_selection_button_clicked();
+ virtual void selectall_button_clicked();
+ virtual void gtk_box_stateChanged( int val );
+ virtual void qobject_box_stateChanged( int val );
+ virtual void headeronly_box_stateChanged(int val);
+
+ void reloadAdvancedInheritance( bool clean = false );
+ void parseClass( QString clName, QString inheritance );
+ void parsePCSClass( QString clName, QString inheritance );
+ void addToConstructorsList( QCheckListItem *myClass, FunctionDom method );
+ void addToMethodsList( QListViewItem *parent, FunctionDom method );
+ void addToUpgradeList( QListViewItem *parent, FunctionDom method, QString modifier );
+ void addToUpgradeList( QListViewItem *parent, VariableDom attr, QString modifier );
+ void clearConstructorsList( bool clean = false );
+ void clearMethodsList( bool clean = false );
+ void clearUpgradeList( bool clean = false );
+ bool isConstructor( QString className, const FunctionDom &method );
+ bool isDestructor( QString className, const FunctionDom &method );
+
+private:
+
+ bool headerModified;
+ bool baseincludeModified;
+ bool implementationModified;
+ QString m_parse;
+ QPopupMenu *accessMenu;
+ QPopupMenu *overMenu;
+ CppSupportPart *m_part;
+ CodeModel *myModel;
+
+ // configuration variables
+ QString interface_url;
+ QString implementation_url;
+ QString interface_suffix;
+ QString implementation_suffix;
+ QStringList currNamespace;
+ bool lowercase_filenames;
+ QStringList currBaseClasses;
+ KCompletion * compBasename;
+ KCompletion * compNamespace;
+
+ void setCompletionBasename( CodeModel *model );
+ void addCompletionBasenameNamespacesRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent = "" );
+ void setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent = "" );
+ void setStateOfInheritanceEditors( bool state, bool hideList = true );
+ void setAccessForBase( QString baseclass, QString newAccess );
+ void setAccessForItem( QListViewItem *curr, QString newAccess, bool isPublic );
+ void remClassFromAdv( QString text );
+ void checkUpButtonState();
+ void checkDownButtonState();
+ void updateConstructorsOrder();
+
+ QString classNameFormatted();
+ QString templateStrFormatted();
+ QString templateParamsFormatted();
+ QString classNameFormatted( const QString & );
+ QString templateStrFormatted( const QString & );
+ QString templateParamsFormatted( const QString & );
+ QString templateActualParamsFormatted( const QString & );
+ void removeTemplateParams( QString & );
+
+ friend class ClassGenerator;
+
+ //! The class that translates UI input to a class
+ class ClassGenerator
+ {
+
+ public:
+ ClassGenerator( CppNewClassDialog& _dlg ) : dlg( _dlg )
+ {}
+ bool generate();
+
+ private:
+ bool validateInput();
+ void common_text();
+ void gen_implementation();
+ void gen_interface();
+ void genMethodDeclaration( FunctionDom method, QString className, QString templateStr,
+ QString *adv_h, QString *adv_cpp, bool extend, QString baseClassName );
+
+ void beautifyHeader( QString &templ, QString &headerGuard,
+ QString &includeBaseHeader, QString &author, QString &doc, QString &className, QString &templateStr,
+ QString &baseclass, QString &inheritance, QString &qobjectStr, QString &args,
+ QString &header, QString &namespaceBeg, QString &constructors, QString &advH_public,
+ QString &advH_public_slots,
+ QString &advH_protected, QString &advH_protected_slots, QString &advH_private, QString &advH_private_slots,
+ QString &namespaceEnd );
+ void beautifySource( QString &templ, QString &header, QString &className, QString &namespaceBeg,
+ QString &constructors, QString &advCpp, QString &namespaceEnd, QString &implementation );
+
+ QString className;
+ QString templateStr;
+ QString templateParams;
+ QString header;
+ QString implementation;
+
+ QString advConstructorsHeader;
+ QString advConstructorsSource;
+
+ KDevProject *project;
+ QString subDir, headerPath, implementationPath;
+ QString doc;
+ QString namespaceStr;
+ bool childClass;
+ bool objc;
+ bool qobject;
+ bool gtk;
+ bool headeronly;
+ QStringList namespaces;
+ QString namespaceBeg, namespaceEnd;
+ QString argsH;
+ QString argsCpp;
+
+ QString advH_public;
+ QString advH_public_slots;
+ QString advH_protected;
+ QString advH_protected_slots;
+ QString advH_private;
+ QString advH_private_slots;
+ QString advCpp;
+
+
+ CppNewClassDialog& dlg;
+ };
+
+
+ //! workaround to make gcc 2.95.x happy
+ friend class CppNewClassDialog::ClassGenerator;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cppnewclassdlgbase.ui b/languages/cpp/cppnewclassdlgbase.ui
new file mode 100644
index 00000000..4f443eaf
--- /dev/null
+++ b/languages/cpp/cppnewclassdlgbase.ui
@@ -0,0 +1,1290 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CppNewClassDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CppNewClassDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>510</width>
+ <height>611</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Class</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>class_tabs</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab1</cstring>
+ </property>
+ <attribute name="title">
+ <string>Class &amp;Information</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="0" column="0">
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>documentation_label_</cstring>
+ </property>
+ <property name="text">
+ <string>Docu&amp;mentation:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>documentation_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>documentation_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert a short description for your new class
+here for documentation purposes. This can be used
+to create API documentation in HTML format with
+doxygen or similar tools.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>filenames_group</cstring>
+ </property>
+ <property name="title">
+ <string>File Names</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>header_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Header:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>header_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>header_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert your header file name here.
+It is automatically inserted while
+you select the classname, but you can
+still edit it afterwards.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>implementation_label</cstring>
+ </property>
+ <property name="text">
+ <string>Im&amp;plementation:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>implementation_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>implementation_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert your implementation filename here.
+It is automatically inserted while
+you select the classname, but you can
+still edit it afterwards.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>headeronly_box</cstring>
+ </property>
+ <property name="text">
+ <string>Create only header</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>groupBox7</cstring>
+ </property>
+ <property name="title">
+ <string>Class</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>classname_label</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;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>classname_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>classname_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert your new classname here.
+You can also define template classes by specifying
+template &lt;params&gt; classname</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>namespace_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Name&amp;space:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>namespace_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>namespace_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert a name of the namespace here.
+You can define nested namespaces by specifying
+Namespace1::Namespace2::...::NamespaceN</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>inheritance_group</cstring>
+ </property>
+ <property name="title">
+ <string>Inheritance</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>addbaseclass_button</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="0">
+ <property name="name">
+ <cstring>rembaseclass_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</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="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="4" column="0">
+ <property name="name">
+ <cstring>upbaseclass_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="0">
+ <property name="name">
+ <cstring>downbaseclass_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</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="text">
+ <string>Move &amp;Down</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>basename_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Base class:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>basename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QListView" row="2" column="1" rowspan="4" colspan="2">
+ <column>
+ <property name="text">
+ <string>Baseclass Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Inheritance Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>baseclasses_view</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="resizePolicy">
+ <enum>AutoOneFit</enum>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>basename_edit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Insert the base class which your new class will be derived from. If you have checked 'Generate QWidget child class' the new class will be derived from QWidget. If no base class is named, the new class will not have a parent class. You can also use template classes here (like BaseClass&lt;int, int&gt;)</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="2">
+ <property name="name">
+ <cstring>baseinclude_edit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Global</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Local</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>scope_box</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>virtual_box</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Virtual</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>public_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Public</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>protected_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Protected</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>private_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Private</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="2" column="1">
+ <property name="name">
+ <cstring>optionsBox</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>filetemplate_box</cstring>
+ </property>
+ <property name="text">
+ <string>Use file t&amp;emplates</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>qobject_box</cstring>
+ </property>
+ <property name="text">
+ <string>Generate QOb&amp;ject child class</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>childclass_box</cstring>
+ </property>
+ <property name="text">
+ <string>Generate Q&amp;Widget child class</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>gtk_box</cstring>
+ </property>
+ <property name="text">
+ <string>Generate G&amp;TK+ class</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>objc_box</cstring>
+ </property>
+ <property name="text">
+ <string>Use Objective-C</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab2</cstring>
+ </property>
+ <attribute name="title">
+ <string>Ad&amp;vanced Information</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget4</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Constr&amp;uctors</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Base Class Constructors</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>constructors_view</cstring>
+ </property>
+ <property name="resizePolicy">
+ <enum>AutoOneFit</enum>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>to_constructors_list</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>125</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>C&amp;reate Constructor &gt;&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>clear_selection_button</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>125</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>C&amp;lear Selection</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>150</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget3</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_header</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Header</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QTextEdit" row="0" column="0">
+ <property name="name">
+ <cstring>constructors_h_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab_source</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Source</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="QTextEdit" row="0" column="0">
+ <property name="name">
+ <cstring>constructors_cpp_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Methods Ov&amp;erriding</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Methods</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Extend Functionality</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>methods_view</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="resizePolicy">
+ <enum>AutoOneFit</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Access Control</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Methods &amp; Attributes</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Implied Modifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>New Modifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>access_view</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="resizePolicy">
+ <enum>AutoOneFit</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Generation Options</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="ClassGeneratorConfig" row="0" column="0">
+ <property name="name">
+ <cstring>gen_config</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer7_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>ClassGeneratorConfig</class>
+ <header location="local">classgeneratorconfig.h</header>
+ <sizehint>
+ <width>0</width>
+ <height>0</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="2926">789c9d95594f32591086effd15c4ba3393fae895ee4ce6824540141011b7c95cf406a202caa6f065fefb549faaea0b24996fc623cb937aeb3d55754e871f67a587eb6ee9ecc7c96a1dada74929798e96a5b374339bedfefceb8f9f27a7b65da27fcb724bf6e96f27a783752929f516f32c070402289b3fc39d8203c3136157e276c1260eac0f0ade0907927f2d9c58261f929cad72be0cef8535ff5959e277c201ef0fa02cf1ae7022f9efca12ff301ca81e87c21a5f32db5acf95b0eebfcdd92e2be3a5b0fa7986435bfd6e981d99278c0ae6795c288b3e2b98e3036157d8f839961308af985df51b1b0e9dc0098ddf5a3811fd7dceaee52a370d475e28f9b7ca1c07539f67173c144e65be2fcae2d763f62d89df2acb7cc282393e57b6b9ff58d893fca632c7d1ccc78bbcd48b4c7cc2ec4bfdf0aa2cfbf50be6fa2c65d9af2aacfd2c94e53cccf9fa7645eb7794a59ebdb027fe5565895f09cb7e981a267f9febaf3117fab6702af599e7a5e2049e6dce1377c25affa6608e4786e34a58894dfc8b59f5f890731087e28f2de648fbdb16ccfd6c9465bf7365c732f12f61ed3f5016fd4a59f4e6790fddd00a5d137f638eb4bfa532df5ffc148ea4be5ac17c5ea9b2ecd72b98efff403893fa1accb12d5c5696fd4d7f6152c41f95c53f2a98f56b6597fbf3857da9b75e30fb5584b59fa78239de5596fd3e0be6fdccf311b99115f1fcdaccb12fe77927ac7e2365f1c382793e63e14cfccdf3132571e69b1f07e83327d23fbac2bee4d785d57f2a9c89de9c6fecaa1fce98135bf845b9e2189e2a07e6fee287b0cfcf3bce9525ff5d38927a1bcca9cc1b66ca528ff93d89d338e3f9e182b9c86f31a752ff609d2f847f5f83b5ea31c218137a4f8fac0cc738e10cd6d3b7189f718a2ff88a6f38c339ad05adfcf31d3f7089ab037d42ea356e708b9ff8853bdc6395de6b58c706ad736c1ee823f2de608b146dbcc08e8976f012afb04b3975ec1de853aa2457f749d5c16b1ce00d0ecdf75b1ce1dd11fd1b55d236cef7f8808ff88465b4d02676d03da29f51dd9e513fa28f150c3004246d07002288bfe9e7d45f0712f22635a490d15ef730361e3b389c67aedf2390ea3157e73dc333e9a6f042d13ebc7ed32f6882405d3ee1c678030ee10d6630a76f162c8ee8f37adeb14c0aaa0b3e68b725ac80a2b039a29f630db6e46bc127d5fd45de4b5226b0833d8ea07a445f871ae96dacc218ead08073c835136842eba8be016db830e77a419f21aca143f76c025b9ae7e5813ea35bd5a0731fd1c4877a7f614fde57d085deb7f31ad31dccf54fd087883ab7a88f6baabb45fdf760003707fa09ddd826f66048af1826f00a0bb3aa7009b73082bb03fd2faeffa7fff58cfffcbcfffdfbc93f7f7d62d7</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>classname_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>classNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>header_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>headerChanged()</slot>
+ </connection>
+ <connection>
+ <sender>implementation_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>implementationChanged()</slot>
+ </connection>
+ <connection>
+ <sender>childclass_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>checkQWidgetInheritance(int)</slot>
+ </connection>
+ <connection>
+ <sender>objc_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>checkObjCInheritance(int)</slot>
+ </connection>
+ <connection>
+ <sender>virtual_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBaseVirtualChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>public_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBasePublicSet()</slot>
+ </connection>
+ <connection>
+ <sender>protected_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBaseProtectedSet()</slot>
+ </connection>
+ <connection>
+ <sender>private_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBasePrivateSet()</slot>
+ </connection>
+ <connection>
+ <sender>addbaseclass_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>addBaseClass()</slot>
+ </connection>
+ <connection>
+ <sender>rembaseclass_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>remBaseClass()</slot>
+ </connection>
+ <connection>
+ <sender>baseclasses_view</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBaseSelected(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>upbaseclass_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>upbaseclass_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>downbaseclass_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>downbaseclass_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>baseclasses_view</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>baseclasses_view_selectionChanged()</slot>
+ </connection>
+ <connection>
+ <sender>gtk_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>gtk_box_stateChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>basename_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>currBaseNameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>qobject_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>qobject_box_stateChanged(int)</slot>
+ </connection>
+ <connection>
+ <sender>access_view</sender>
+ <signal>mouseButtonPressed(int,QListViewItem*,const QPoint&amp;,int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>access_view_mouseButtonPressed(int,QListViewItem*,const QPoint&amp;,int)</slot>
+ </connection>
+ <connection>
+ <sender>methods_view</sender>
+ <signal>mouseButtonPressed(int,QListViewItem*,const QPoint&amp;,int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>methods_view_mouseButtonPressed(int,QListViewItem*,const QPoint&amp;,int)</slot>
+ </connection>
+ <connection>
+ <sender>clear_selection_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>clear_selection_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>to_constructors_list</sender>
+ <signal>clicked()</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>to_constructors_list_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>class_tabs</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>newTabSelected(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>class_tabs</sender>
+ <signal>currentChanged(QWidget*)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>newTabSelected(QWidget*)</slot>
+ </connection>
+ <connection>
+ <sender>basename_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>baseclassname_changed(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>baseinclude_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>baseIncludeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>scope_box</sender>
+ <signal>activated(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>scopeboxActivated(int)</slot>
+ </connection>
+ <connection>
+ <sender>namespace_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>classNamespaceChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>headeronly_box</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>CppNewClassDlgBase</receiver>
+ <slot>headeronly_box_stateChanged(int)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>classname_edit</tabstop>
+ <tabstop>namespace_edit</tabstop>
+ <tabstop>addbaseclass_button</tabstop>
+ <tabstop>basename_edit</tabstop>
+ <tabstop>baseinclude_edit</tabstop>
+ <tabstop>scope_box</tabstop>
+ <tabstop>virtual_box</tabstop>
+ <tabstop>public_button</tabstop>
+ <tabstop>protected_button</tabstop>
+ <tabstop>private_button</tabstop>
+ <tabstop>baseclasses_view</tabstop>
+ <tabstop>rembaseclass_button</tabstop>
+ <tabstop>upbaseclass_button</tabstop>
+ <tabstop>downbaseclass_button</tabstop>
+ <tabstop>header_edit</tabstop>
+ <tabstop>implementation_edit</tabstop>
+ <tabstop>filetemplate_box</tabstop>
+ <tabstop>qobject_box</tabstop>
+ <tabstop>childclass_box</tabstop>
+ <tabstop>gtk_box</tabstop>
+ <tabstop>objc_box</tabstop>
+ <tabstop>documentation_edit</tabstop>
+ <tabstop>class_tabs</tabstop>
+ <tabstop>ok_button</tabstop>
+ <tabstop>cancel_button</tabstop>
+ <tabstop>tabWidget4</tabstop>
+ <tabstop>constructors_view</tabstop>
+ <tabstop>to_constructors_list</tabstop>
+ <tabstop>clear_selection_button</tabstop>
+ <tabstop>tabWidget3</tabstop>
+ <tabstop>constructors_h_edit</tabstop>
+ <tabstop>methods_view</tabstop>
+ <tabstop>access_view</tabstop>
+ <tabstop>gen_config</tabstop>
+ <tabstop>constructors_cpp_edit</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">updateClassStore()</slot>
+ <slot access="protected">access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &amp; p, int c )</slot>
+ <slot access="protected">classNameChanged( const QString &amp; text )</slot>
+ <slot access="protected">headerChanged()</slot>
+ <slot access="protected">implementationChanged()</slot>
+ <slot access="protected">nameHandlerChanged( const QString &amp; text )</slot>
+ <slot access="protected">addBaseClass()</slot>
+ <slot access="protected">remBaseClass()</slot>
+ <slot access="protected">currBaseNameChanged( const QString &amp; text )</slot>
+ <slot access="protected">currBasePrivateSet()</slot>
+ <slot access="protected">currBaseProtectedSet()</slot>
+ <slot access="protected">currBasePublicSet()</slot>
+ <slot access="protected">currBaseVirtualChanged( int val )</slot>
+ <slot access="protected">currBaseSelected( QListViewItem * it )</slot>
+ <slot access="protected">checkObjCInheritance( int val )</slot>
+ <slot access="protected">checkQWidgetInheritance( int val )</slot>
+ <slot access="protected">newTabSelected( const QString &amp; text )</slot>
+ <slot access="protected">changeToPrivate()</slot>
+ <slot access="protected">changeToProtected()</slot>
+ <slot access="protected">changeToPublic()</slot>
+ <slot access="protected">changeToInherited()</slot>
+ <slot access="protected">methods_view_mouseButtonPressed( int, QListViewItem *, const QPoint &amp;, int )</slot>
+ <slot access="protected">newTabSelected( QWidget * w )</slot>
+ <slot access="protected">extendFunctionality()</slot>
+ <slot access="protected">replaceFunctionality()</slot>
+ <slot access="protected">to_constructors_list_clicked()</slot>
+ <slot access="protected">from_constructors_list_clicked()</slot>
+ <slot access="protected">add_constructor_button_clicked()</slot>
+ <slot access="protected">rem_constructor_button_clicked()</slot>
+ <slot access="protected">clear_selection_button_clicked()</slot>
+ <slot access="protected">upbaseclass_button_clicked()</slot>
+ <slot access="protected">downbaseclass_button_clicked()</slot>
+ <slot access="protected">baseclasses_view_selectionChanged()</slot>
+ <slot access="protected">gtk_box_stateChanged( int )</slot>
+ <slot access="protected">qobject_box_stateChanged( int )</slot>
+ <slot access="protected">selectall_button_clicked()</slot>
+ <slot access="protected">baseclassname_changed( const QString &amp; )</slot>
+ <slot access="protected">baseIncludeChanged( const QString &amp; )</slot>
+ <slot access="protected">scopeboxActivated( int )</slot>
+ <slot access="protected">classNamespaceChanged( const QString &amp; )</slot>
+ <slot access="protected">headeronly_box_stateChanged(int val)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>classgeneratorconfig.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/cppsplitheadersourceconfig.cpp b/languages/cpp/cppsplitheadersourceconfig.cpp
new file mode 100644
index 00000000..68253368
--- /dev/null
+++ b/languages/cpp/cppsplitheadersourceconfig.cpp
@@ -0,0 +1,82 @@
+/*
+ * KDevelop config for split header/source
+ *
+ * Copyright (c) 2005 Adam Treat <treat@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "cppsplitheadersourceconfig.h"
+#include "cppsupportpart.h"
+
+#include <domutil.h>
+
+#include <kdebug.h>
+#include <qdom.h>
+
+QString CppSplitHeaderSourceConfig::defaultPath = QString::fromLatin1( "/kdevcppsupport/splitheadersource" );
+
+CppSplitHeaderSourceConfig::CppSplitHeaderSourceConfig( CppSupportPart * part, QDomDocument* dom )
+ : QObject( part ), m_part( part ), m_dom( dom )
+{
+ init();
+}
+
+CppSplitHeaderSourceConfig::~CppSplitHeaderSourceConfig()
+{}
+
+void CppSplitHeaderSourceConfig::init( )
+{
+ m_splitEnable =
+ DomUtil::readBoolEntry( *m_dom, defaultPath + "/enabled", false );
+ m_splitSync =
+ DomUtil::readBoolEntry( *m_dom, defaultPath + "/synchronize", true );
+ m_splitOrientation =
+ DomUtil::readEntry( *m_dom, defaultPath + "/orientation", "Vertical" );
+}
+
+void CppSplitHeaderSourceConfig::store( )
+{
+ DomUtil::writeBoolEntry( *m_dom,
+ defaultPath + "/enabled",
+ m_splitEnable );
+ DomUtil::writeBoolEntry( *m_dom,
+ defaultPath + "/synchronize",
+ m_splitSync );
+ DomUtil::writeEntry( *m_dom,
+ defaultPath + "/orientation",
+ m_splitOrientation );
+
+ emit stored();
+}
+
+void CppSplitHeaderSourceConfig::setSplitEnable( bool b )
+{
+ m_splitEnable = b;
+}
+
+void CppSplitHeaderSourceConfig::setAutoSync( bool b )
+{
+ m_splitSync = b;
+}
+
+void CppSplitHeaderSourceConfig::setOrientation( const QString &o )
+{
+ m_splitOrientation = o;
+}
+
+#include "cppsplitheadersourceconfig.moc"
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/cppsplitheadersourceconfig.h b/languages/cpp/cppsplitheadersourceconfig.h
new file mode 100644
index 00000000..d975bc2c
--- /dev/null
+++ b/languages/cpp/cppsplitheadersourceconfig.h
@@ -0,0 +1,74 @@
+/*
+ * KDevelop config for split header/source
+ *
+ * Copyright (c) 2005 Adam Treat <treat@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#ifndef CPPSPLITHEADERSOURCECONFIG_H
+#define CPPSPLITHEADERSOURCECONFIG_H
+
+#include <qobject.h>
+
+class CppSupportPart;
+class QDomDocument;
+
+class CppSplitHeaderSourceConfig : public QObject
+{
+ Q_OBJECT
+public:
+ CppSplitHeaderSourceConfig( CppSupportPart* part, QDomDocument* dom );
+ virtual ~CppSplitHeaderSourceConfig();
+
+ bool splitEnabled() const
+ {
+ return m_splitEnable;
+ }
+ void setSplitEnable( bool b );
+
+ bool autoSync() const
+ {
+ return m_splitSync;
+ }
+ void setAutoSync( bool b );
+
+ QString orientation() const
+ {
+ return m_splitOrientation;
+ }
+ void setOrientation( const QString &o );
+
+public slots:
+ void store();
+
+private:
+ void init();
+
+signals:
+ void stored();
+
+private:
+ CppSupportPart* m_part;
+ QDomDocument* m_dom;
+ bool m_splitEnable;
+ bool m_splitSync;
+ QString m_splitOrientation;
+
+ static QString defaultPath;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/cppsupport_events.h b/languages/cpp/cppsupport_events.h
new file mode 100644
index 00000000..0c266726
--- /dev/null
+++ b/languages/cpp/cppsupport_events.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef __cppsupport_events_h
+#define __cppsupport_events_h
+
+#include "kdevdeepcopy.h"
+
+#include <qevent.h>
+#include <qvaluelist.h>
+
+#if QT_VERSION < 0x030100
+#include <kdevmutex.h>
+#else
+#include <qmutex.h>
+#endif
+
+enum
+{
+ Event_FileParsed = QEvent::User + 1000
+};
+
+
+class FileParsedEvent: public QCustomEvent
+{
+public:
+ FileParsedEvent( const QString& fileName, const QValueList<Problem>& problems, bool fromDisk = false )
+ : QCustomEvent( Event_FileParsed ), m_fileName( deepCopy( fileName ) ), m_fromDisk( fromDisk )
+ {
+ // the members are deep copies
+ QValueListConstIterator<Problem> it = problems.begin();
+ while ( it != problems.end() )
+ {
+ Problem p = *it;
+ m_problems.append( Problem( deepCopy( p.text() ), p.line(), p.column(), p.level() ) );
+ m_problems.back().setFileName( deepCopy( p.fileName() ) );
+ ++it;
+ }
+ }
+
+ QString fileName() const
+ {
+ return m_fileName;
+ }
+ QValueList<Problem> problems() const
+ {
+ return m_problems;
+ }
+
+ bool fromDisk() {
+ return m_fromDisk;
+ }
+
+private:
+ QString m_fileName;
+ QValueList<Problem> m_problems;
+ bool m_fromDisk;
+
+private:
+ FileParsedEvent( const FileParsedEvent& source );
+ void operator = ( const FileParsedEvent& source );
+};
+
+
+#endif // __cppsupport_events_h
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cppsupport_utils.cpp b/languages/cpp/cppsupport_utils.cpp
new file mode 100644
index 00000000..e6f80abc
--- /dev/null
+++ b/languages/cpp/cppsupport_utils.cpp
@@ -0,0 +1,139 @@
+#include <qdir.h>
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include <codemodel.h>
+
+#include "cppsupport_utils.h"
+
+static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model );
+static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns );
+static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass );
+
+QStringList typeNameList( const CodeModel* model )
+{
+ QStringList lst;
+ QStringList path;
+ typeNameList( path, lst, model );
+ return lst;
+}
+
+static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model )
+{
+ const FileList fileList = model->fileList();
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ typeNameList( path, lst, model_cast<NamespaceDom>(*it) );
+}
+
+static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns )
+{
+ if( !ns->isFile() )
+ path.push_back( ns->name() );
+
+ const NamespaceList namespaceList = ns->namespaceList();
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ typeNameList( path, lst, *it );
+
+ const ClassList classList = ns->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typeNameList( path, lst, *it );
+
+ if( !ns->isFile() )
+ path.pop_back();
+}
+
+static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass )
+{
+ path.push_back( klass->name() );
+
+ lst << path.join( "::" );
+
+ const ClassList classList = klass->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typeNameList( path, lst, *it );
+
+ path.pop_back();
+}
+
+static void typedefMap( QMap<QString, QString> & map, const CodeModel * model );
+static void typedefMap( QMap<QString, QString> & map, NamespaceDom ns );
+static void typedefMap( QMap<QString, QString> & map, ClassDom klass );
+
+QMap<QString, QString> typedefMap( const CodeModel* model )
+{
+ QMap<QString, QString> map;
+ typedefMap( map, model );
+
+ /*We need to flatten the typedefs to avoid circular aliases.
+ Example:
+ map["Foo"] = "int";
+ map["Bar"] = "Foo";
+ map["Baz"] = "Bar";*/
+
+ QMap<QString, QString>::iterator it = map.begin();
+ for ( ; it != map.end(); ++it )
+ {
+ while ( map.contains( map[ it.key() ] ) &&
+ it.key() != map[ it.key() ] )
+ {
+ map[ it.key() ] = map[ map[ it.key() ] ];
+ }
+ }
+
+ return map;
+}
+
+static void typedefMap( QMap<QString, QString> & map, const CodeModel * model )
+{
+ const FileList fileList = model->fileList();
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ typedefMap( map, model_cast<NamespaceDom>(*it) );
+}
+
+static void typedefMap( QMap<QString, QString> & map, NamespaceDom ns )
+{
+ const TypeAliasList aliasList = ns->typeAliasList();
+ for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it )
+ map[ ( *it )->name() ] = ( *it )->type();
+
+ const NamespaceList namespaceList = ns->namespaceList();
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ typedefMap( map, *it );
+
+ const ClassList classList = ns->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typedefMap( map, *it );
+}
+
+static void typedefMap( QMap<QString, QString> & map, ClassDom klass )
+{
+ const TypeAliasList aliasList = klass->typeAliasList();
+ for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it )
+ map[ ( *it )->name() ] = ( *it )->type();
+
+ const ClassList classList = klass->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typedefMap( map, *it );
+}
+
+QString formattedOpeningParenthesis(bool suppressSpace)
+{
+ KConfig * config = kapp->config();
+ config->setGroup("AStyle");
+ bool use_spaces = config->readBoolEntry("PadParentheses", false);
+ if (not use_spaces or suppressSpace) return "(";
+ return "( ";
+}
+
+QString formattedClosingParenthesis(bool suppressSpace)
+{
+ KConfig * config = kapp->config();
+ config->setGroup("AStyle");
+ bool use_spaces = config->readBoolEntry("PadParentheses", false);
+ if (not use_spaces or suppressSpace) return ")";
+ return " )";
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/cppsupport_utils.h b/languages/cpp/cppsupport_utils.h
new file mode 100644
index 00000000..9182dd08
--- /dev/null
+++ b/languages/cpp/cppsupport_utils.h
@@ -0,0 +1,28 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef __cppsupport_utils_h
+#define __cppsupport_utils_h
+
+#include <qmap.h>
+#include <qstringlist.h>
+
+#include "codemodel.h"
+
+QStringList typeNameList( const CodeModel* model );
+QMap<QString, QString> typedefMap( const CodeModel* model );
+
+QString formattedOpeningParenthesis(bool suppressSpace = false);
+QString formattedClosingParenthesis(bool suppressSpace = false);
+
+#endif // __cppsupport_utils_h
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cppsupportfactory.cpp b/languages/cpp/cppsupportfactory.cpp
new file mode 100644
index 00000000..77a586c9
--- /dev/null
+++ b/languages/cpp/cppsupportfactory.cpp
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kinstance.h>
+#include <kstandarddirs.h>
+#include <kdevplugininfo.h>
+#include "cppsupportfactory.h"
+
+K_EXPORT_COMPONENT_FACTORY( libkdevcppsupport, CppSupportFactory )
+
+static const KDevPluginInfo data("kdevcppsupport");
+
+CppSupportFactory::CppSupportFactory()
+: KDevGenericFactory<CppSupportPart>( data )
+{
+}
+
+KInstance *CppSupportFactory::createInstance()
+{
+ KInstance *instance = KDevGenericFactory<CppSupportPart>::createInstance();
+ KStandardDirs *dirs = instance->dirs();
+ dirs->addResourceType( "newclasstemplates", KStandardDirs::kde_default("data") + "kdevcppsupport/newclass/" );
+ dirs->addResourceType( "pcs", KStandardDirs::kde_default( "data" ) + "kdevcppsupport/pcs/" );
+
+ return instance;
+}
+
+const KDevPluginInfo * CppSupportFactory::info()
+{
+ return &data;
+}
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
diff --git a/languages/cpp/cppsupportfactory.h b/languages/cpp/cppsupportfactory.h
new file mode 100644
index 00000000..78f53a7f
--- /dev/null
+++ b/languages/cpp/cppsupportfactory.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+* Copyright (C) 2000-2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef _CPPSUPPORTFACTORY_H_
+#define _CPPSUPPORTFACTORY_H_
+
+#include <kdevgenericfactory.h>
+#include "cppsupportpart.h"
+
+class KDevPluginInfo;
+
+class CppSupportFactory : public KDevGenericFactory<CppSupportPart>
+{
+public:
+ CppSupportFactory();
+
+ static const KDevPluginInfo *info();
+
+protected:
+ virtual KInstance *createInstance();
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cppsupportpart.cpp b/languages/cpp/cppsupportpart.cpp
new file mode 100644
index 00000000..f72b168c
--- /dev/null
+++ b/languages/cpp/cppsupportpart.cpp
@@ -0,0 +1,3186 @@
+/***************************************************************************
+* Copyright (C) 1999 by Jonas Nordin *
+* jonas.nordin@syncom.se *
+* Copyright (C) 2000-2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2002-2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* Copyright (C) 2003-2004 by Alexander Dymo *
+* adymo@mksat.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 "cppsupportpart.h"
+#include "cppsupport_events.h"
+#include "problemreporter.h"
+#include "backgroundparser.h"
+#include "store_walker.h"
+#include "ast.h"
+#include "ast_utils.h"
+#include "cppcodecompletion.h"
+#include "ccconfigwidget.h"
+#include "KDevCppSupportIface.h"
+#include "cppsupportfactory.h"
+#include "catalog.h"
+#include "cpp_tags.h"
+#include "kdevdriver.h"
+#include "cppcodecompletionconfig.h"
+#include "cppsplitheadersourceconfig.h"
+#include "tag_creator.h"
+#include "cppsupport_utils.h"
+#include "classgeneratorconfig.h"
+#include "urlutil.h"
+#include "creategettersetterconfiguration.h"
+#include "kdevsourceformatter.h"
+#include "kdevcreatefile.h"
+#include "qtbuildconfig.h"
+#include "kdeveditorutil.h"
+#include <ktexteditor/viewcursorinterface.h>
+#include <kpopupmenu.h>
+// wizards
+#include "cppnewclassdlg.h"
+#include "subclassingdlg.h"
+#include "addmethoddialog.h"
+#include "addattributedialog.h"
+#include "creategettersetterdialog.h"
+// designer integration
+#include "qtdesignercppintegration.h"
+#include "cppimplementationwidget.h"
+#include "configproblemreporter.h"
+#include "codeinformationrepository.h"
+
+#include <qeventloop.h>
+#include <qheader.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qfileinfo.h>
+#include <qguardedptr.h>
+#include <qpopupmenu.h>
+#include <qprogressdialog.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+#include <qstatusbar.h>
+#include <qprogressbar.h>
+#include <qregexp.h>
+#include <qlabel.h>
+#include <qvbox.h>
+#include <kmessagebox.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kgenericfactory.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kmainwindow.h>
+#include <kstatusbar.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/clipboardinterface.h>
+#include <ktexteditor/texthintinterface.h>
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <kdevmakefrontend.h>
+#include <kdevcoderepository.h>
+#include <codemodel_utils.h>
+#include <kdevplugininfo.h>
+
+#include <domutil.h>
+#include <config.h>
+
+const bool alwaysParseInBackground = true;
+
+enum { KDEV_DB_VERSION = 21 };
+enum { KDEV_PCS_VERSION = 18 };
+
+QStringList CppSupportPart::m_sourceMimeTypes = QStringList() << "text/x-csrc" << "text/x-c++src";
+QStringList CppSupportPart::m_headerMimeTypes = QStringList() << "text/x-chdr" << "text/x-c++hdr";
+
+QStringList CppSupportPart::m_sourceExtensions = QStringList::split( ",", "c,C,cc,cpp,c++,cxx,m,mm,M" );
+QStringList CppSupportPart::m_headerExtensions = QStringList::split( ",", "h,H,hh,h++,hxx,hpp,inl,tlh,diff,ui.h" );
+
+class CppDriver: public KDevDriver
+{
+public:
+ CppDriver( CppSupportPart* cppSupport ) : KDevDriver( cppSupport, true )
+ {}
+
+ void fileParsed( ParsedFile& fileName )
+ {
+ //kdDebug(9007) << "-----> file " << fileName << " parsed!" << endl;
+
+ ParsedFilePointer ast = takeTranslationUnit( fileName.fileName() );
+
+ if ( cppSupport() ->problemReporter() )
+ {
+ cppSupport() ->problemReporter() ->removeAllProblems( fileName.fileName() );
+
+ QValueList<Problem> pl = problems( fileName.fileName() );
+ QValueList<Problem>::ConstIterator it = pl.begin();
+ while ( it != pl.end() )
+ {
+ const Problem & p = *it++;
+ cppSupport() ->problemReporter() ->reportProblem( fileName.fileName(), p );
+ }
+ }
+
+ StoreWalker walker( fileName.fileName(), cppSupport() ->codeModel() );
+
+ if ( cppSupport() ->codeModel() ->hasFile( fileName.fileName() ) )
+ {
+ FileDom file = cppSupport() ->codeModel() ->fileByName( fileName.fileName() );
+ cppSupport() ->removeWithReferences( fileName.fileName() );
+ }
+
+ walker.parseTranslationUnit( *ast );
+ cppSupport() ->codeModel() ->addFile( walker.file() );
+ remove
+ ( fileName.fileName() );
+
+ if( cppSupport()->_jd ) {
+ cppSupport()->_jd->backgroundState ++;
+ cppSupport()->_jd->lastParse = QTime::currentTime();
+ }
+
+ QFileInfo fileInfo( fileName.fileName() );
+ QString path = URLUtil::canonicalPath( fileName.fileName() );
+
+ cppSupport()->m_timestamp[ path ] = fileInfo.lastModified();
+
+ cppSupport()->emitSynchronousParseReady( fileName.fileName(), ast );
+ }
+};
+
+// ProblemReporter doesn't really depend on background parsing, so it's a bit of a mixup to
+// handle them together, but it's the same config widget so...
+class BackgroundParserConfig
+{
+ bool m_useProblemReporter;
+ bool m_useBackgroundParser;
+ int m_backgroundParseDelay;
+public:
+ void readConfig()
+ {
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ m_useProblemReporter = config->readBoolEntry( "EnableProblemReporter", true );
+ m_useBackgroundParser = config->readBoolEntry( "EnableCppBgParser", true );
+ m_backgroundParseDelay = config->readNumEntry( "BgParserDelay", 500 );
+ }
+
+ bool useProblemReporter() { return m_useProblemReporter; }
+ bool useBackgroundParser() { return m_useBackgroundParser; }
+ int backgroudParseDelay() { return m_backgroundParseDelay; }
+};
+
+
+CppSupportPart::CppSupportPart( QObject *parent, const char *name, const QStringList &args )
+: KDevLanguageSupport( CppSupportFactory::info(), parent, name ? name : "KDevCppSupport" ), m_backgroundParser(0),
+ m_activeDocument( 0 ), m_activeView( 0 ), m_activeSelection( 0 ), m_activeEditor( 0 ), m_activeViewCursor( 0 ),
+ m_projectClosed( true ), m_projectClosing( false ), m_valid( false ), m_isTyping( false ), m_hadErrors( false ),
+ _jd(0)
+{
+ setInstance( CppSupportFactory::instance() );
+
+ m_pCompletionConfig = new CppCodeCompletionConfig( this, projectDom() );
+ m_pSplitHeaderSourceConfig = new CppSplitHeaderSourceConfig( this, projectDom() );
+ m_pCreateGetterSetterConfiguration = new CreateGetterSetterConfiguration( this ); connect( m_pSplitHeaderSourceConfig, SIGNAL( stored() ),
+ this, SLOT( splitHeaderSourceConfigStored() ) );
+ connect( m_pCompletionConfig, SIGNAL( stored() ),
+ this, SLOT( codeCompletionConfigStored() ) );
+ m_qtBuildConfig = new QtBuildConfig( this, projectDom() );
+ m_qtBuildConfig->store();
+
+ m_backgroundParserConfig = new BackgroundParserConfig;
+ m_backgroundParserConfig->readConfig();
+
+ m_driver = new CppDriver( this );
+ m_problemReporter = 0;
+
+ m_textChangedTimer = new QTimer( this );
+ connect( m_textChangedTimer, SIGNAL(timeout()), this, SLOT(slotParseCurrentFile()) );
+
+ m_cursorMovedTimer = new QTimer( this );
+ connect( m_cursorMovedTimer, SIGNAL(timeout()), this, SLOT(slotCursorPositionChanged()) );
+
+
+// m_deleteParserStoreTimer = new QTimer( this );
+ m_saveMemoryTimer = new QTimer( this );
+ m_buildSafeFileSetTimer = new QTimer( this );
+// m_functionHintTimer = new QTimer( this );
+ connect( m_buildSafeFileSetTimer, SIGNAL(timeout()), this, SLOT(buildSafeFileSet()) );
+ connect( m_saveMemoryTimer, SIGNAL(timeout()), this, SLOT(slotSaveMemory()) );
+// connect( m_deleteParserStoreTimer, SIGNAL(timeout()), this, SLOT(slotDeleteParserStore()) );
+ resetParserStoreTimer();
+ m_saveMemoryTimer->start( 240000, false ); //Free some memory every 4 minutes
+ // connect( m_functionHintTimer, SIGNAL(timeout()), this, SLOT(slotFunctionHint()) );
+
+ setXMLFile( "kdevcppsupport.rc" );
+
+ m_catalogList.setAutoDelete( true );
+
+ connect( core(), SIGNAL( projectOpened() ), this, SLOT( projectOpened() ) );
+ connect( core(), SIGNAL( projectClosed() ), this, SLOT( projectClosed() ) );
+ connect( core(), SIGNAL( languageChanged() ), this, SLOT( projectOpened() ) );
+ connect( partController(), SIGNAL( savedFile( const KURL& ) ),
+ this, SLOT( savedFile( const KURL& ) ) );
+ connect( core(), SIGNAL( contextMenu( QPopupMenu *, const Context * ) ),
+ this, SLOT( contextMenu( QPopupMenu *, const Context * ) ) );
+ connect( partController(), SIGNAL( activePartChanged( KParts::Part* ) ),
+ this, SLOT( activePartChanged( KParts::Part* ) ) );
+ connect( partController(), SIGNAL( partRemoved( KParts::Part* ) ),
+ this, SLOT( partRemoved( KParts::Part* ) ) );
+
+ connect( core(), SIGNAL( configWidget( KDialogBase* ) ),
+ this, SLOT( configWidget( KDialogBase* ) ) );
+
+ m_switchHeaderSourceAction = new KAction( i18n( "Switch Header/Implementation" ), SHIFT + Key_F12,
+ this, SLOT( slotSwitchHeader() ),
+ actionCollection(), "edit_switchheader" );
+ m_switchHeaderSourceAction->setToolTip( i18n( "Switch between header and implementation files" ) );
+ m_switchHeaderSourceAction->setWhatsThis( i18n( "<b>Switch Header/Implementation</b><p>"
+ "If you are currently looking at a header file, this "
+ "brings you to the corresponding implementation file. "
+ "If you are looking at an implementation file (.cpp etc.), "
+ "this brings you to the corresponding header file." ) );
+ m_switchHeaderSourceAction->setEnabled( false );
+
+ KAction *action;
+
+ action = new KAction( i18n( "Complete Text" ), CTRL + Key_Space,
+ this, SLOT( slotCompleteText() ),
+ actionCollection(), "edit_complete_text" );
+ action->setToolTip( i18n( "Complete current expression" ) );
+ action->setWhatsThis( i18n( "<b>Complete Text</p><p>Completes current expression using "
+ "memory class store for the current project and persistent class stores "
+ "for external libraries." ) );
+ action->setEnabled( false );
+
+ m_createGetterSetterAction = new KAction( i18n( "Create Accessor Methods" ), 0,
+ this, SLOT( slotCreateAccessMethods() ), actionCollection(),
+ "edit_create_getter_setter" );
+
+ action = new KAction( i18n( "Make Member" ), 0, Key_F2,
+ this, SLOT( slotMakeMember() ),
+ actionCollection(), "edit_make_member" );
+ action->setToolTip( i18n( "Make member" ) );
+ action->setWhatsThis( i18n( "<b>Make member</b><p>Creates a class member function in implementation file "
+ "based on the member declaration at the current line." ) );
+ action->plug( &m_DummyActionWidget );
+
+ action = new KAction( i18n( "Navigation Menu" ), 0, CTRL + ALT + Key_Space,
+ this, SLOT( slotNavigate() ),
+ actionCollection(), "edit_navigate" );
+ action->setToolTip( i18n( "Show the navigation-menu" ) );
+ action->setWhatsThis( i18n( "<b>Navigate</b><p>Shows a navigation-menu based on the type-evaluation of the item under the cursor." ) );
+ action->plug( &m_DummyActionWidget );
+
+
+ action = new KAction( i18n( "New Class..." ), "classnew", 0,
+ this, SLOT( slotNewClass() ),
+ actionCollection(), "project_newclass" );
+ action->setToolTip( i18n( "Generate a new class" ) );
+ action->setWhatsThis( i18n( "<b>New Class</b><p>Calls the <b>New Class</b> wizard." ) );
+
+ m_pCompletion = 0;
+
+ withcpp = false;
+ if ( args.count() == 1 && args[ 0 ] == "Cpp" )
+ withcpp = true;
+
+ // daniel
+ connect( core( ), SIGNAL( projectConfigWidget( KDialogBase* ) ), this,
+ SLOT( projectConfigWidget( KDialogBase* ) ) );
+
+ new KDevCppSupportIface( this );
+ //(void) dcopClient();
+
+ m_lockupTester = new UIBlockTester( 100 );
+}
+
+
+CppSupportPart::~CppSupportPart()
+{
+ delete m_lockupTester;
+
+ if ( !m_projectClosed )
+ projectClosed();
+
+ delete( m_driver );
+ m_driver = 0;
+
+ if ( m_backgroundParser )
+ {
+ m_backgroundParser->close();
+ // m_backgroundParser->wait();
+ delete m_backgroundParser;
+ m_backgroundParser = 0;
+ }
+
+ codeRepository() ->setMainCatalog( 0 );
+
+ QPtrListIterator<Catalog> it( m_catalogList );
+ while ( Catalog * catalog = it.current() )
+ {
+ ++it;
+ codeRepository() ->unregisterCatalog( catalog );
+ }
+
+
+ delete m_backgroundParserConfig;
+ m_backgroundParserConfig = 0;
+
+ delete m_pCompletion;
+ m_pCompletion = 0;
+
+/* mainWindow()->removeView( m_problemReporter );
+ delete m_problemReporter;
+ m_problemReporter = 0;
+*/
+ delete _jd;
+ _jd = 0;
+
+ kdDebug( 9007 ) << k_funcinfo << endl;
+}
+
+
+void CppSupportPart::customEvent( QCustomEvent* ev )
+{
+ kdDebug( 9007 ) << "CppSupportPart::customEvent(" << ev->type() << ")" << endl;
+
+ QTime t;
+ t.start();
+ bool fromDisk = false;
+
+ if ( ev->type() == int( Event_FileParsed ) )
+ {
+ resetParserStoreTimer();
+
+ FileParsedEvent * event = ( FileParsedEvent* ) ev;
+ fromDisk = event->fromDisk();
+ QString fileName = event->fileName();
+ bool hasErrors = false;
+ if ( m_problemReporter )
+ {
+ m_problemReporter->removeAllProblems( fileName );
+
+ QValueList<Problem> problems = event->problems();
+ QValueList<Problem>::ConstIterator it = problems.begin();
+ while ( it != problems.end() )
+ {
+ const Problem & p = *it++;
+ if ( p.level() == Problem::Level_Error )
+ hasErrors = true;
+
+ m_problemReporter->reportProblem( fileName, p );
+ }
+ }
+ ParsedFilePointer p = m_backgroundParser->translationUnit( fileName );
+ if( p && !p->includedFrom().isEmpty() ) {
+ kdDebug( 9007 ) << "customEvent() parsed included file \"" << fileName << "\" included from \"" << p->includedFrom() << "\"" << endl;
+ } else {
+ kdDebug( 9007 ) << "customEvent() parsed file \"" << fileName << "\"" << endl;
+ }
+
+ if( p && !p->includedFrom().isEmpty() ) {
+ if( !project()->isProjectFile( fileName ) ) {
+ //The file was parsed to resolve a dependency, and is not a project file
+ addToRepository( p );
+ } else {
+ //It is a project-file that was parsed for whatever reason to resolve a dependency(currently it isn't handled this way)
+ }
+ } else if( !project()->isProjectFile( fileName ) || !m_parseEmitWaiting.reject( fileName ) ) {
+ ParseEmitWaiting::Processed p = m_parseEmitWaiting.processFile( fileName, ( !m_hadErrors && hasErrors && !fromDisk && m_isTyping && fileName == m_activeFileName ) ? ParseEmitWaiting::HadErrors : ParseEmitWaiting::None );
+ parseEmit( p );
+
+ //Increase status-bar
+ if( p.hasFlag( ParseEmitWaiting::Silent ) && _jd ) {
+ _jd->backgroundState ++;
+ _jd->lastParse = QTime::currentTime();
+ }
+
+ } else {
+ ParseEmitWaiting::Processed p = m_fileParsedEmitWaiting.processFile( fileName );
+ if( !p.hasFlag( ParseEmitWaiting::Silent ) )
+ emitFileParsed( p );
+
+ //Increase status-bar
+ if( p.hasFlag( ParseEmitWaiting::Silent ) && _jd ) {
+ _jd->backgroundState ++;
+ _jd->lastParse = QTime::currentTime();
+ }
+ }
+ }
+}
+
+
+void CppSupportPart::projectConfigWidget( KDialogBase* dlg )
+{
+ QVBox * vbox = 0;
+
+ vbox = dlg->addVBoxPage( i18n( "C++ Support" ), i18n( "C++ Support" ),
+ BarIcon( info() ->icon(), KIcon::SizeMedium ) );
+ CCConfigWidget* w = new CCConfigWidget( this, vbox );
+ connect( dlg, SIGNAL( okClicked( ) ), w, SLOT( accept( ) ) );
+}
+
+void CppSupportPart::configWidget( KDialogBase *dlg )
+{
+ QVBox * vbox = dlg->addVBoxPage( i18n( "C++ Class Generator" ), i18n( "C++ Class Generator" ),
+ BarIcon( info() ->icon(), KIcon::SizeMedium ) );
+ ClassGeneratorConfig *w = new ClassGeneratorConfig( vbox, "classgenerator config widget" );
+ connect( dlg, SIGNAL( okClicked() ), w, SLOT( storeConfig() ) );
+
+ vbox = dlg->addVBoxPage(i18n("C++ Parsing"), i18n("C++ Parsing"),
+ BarIcon( "source_cpp", KIcon::SizeMedium) );
+ ConfigureProblemReporter* ww = new ConfigureProblemReporter( vbox );
+ ww->setPart( this );
+ connect(dlg, SIGNAL(okClicked()), ww, SLOT(accept()));
+}
+
+void CppSupportPart::activePartChanged( KParts::Part *part )
+{
+ kdDebug( 9032 ) << "CppSupportPart::activePartChanged()" << endl;
+
+ bool enabled = false;
+
+// m_functionHintTimer->stop();
+
+ if ( m_activeView )
+ {
+ disconnect( m_activeView, SIGNAL( cursorPositionChanged() ), this, 0 );
+ }
+ if ( m_activeDocument )
+ {
+ disconnect( m_activeDocument, SIGNAL(textChanged()), this, 0 );
+ }
+
+ m_isTyping = false;
+ m_hadErrors = true;
+ m_activeDocument = dynamic_cast<KTextEditor::Document*>( part );
+ m_activeView = part ? dynamic_cast<KTextEditor::View*>( part->widget() ) : 0;
+ m_activeEditor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ m_activeSelection = dynamic_cast<KTextEditor::SelectionInterface*>( part );
+ m_activeViewCursor = dynamic_cast<KTextEditor::ViewCursorInterface*>( m_activeView );
+
+ m_activeFileName = QString::null;
+
+ if ( m_activeDocument )
+ {
+ m_activeFileName = URLUtil::canonicalPath( m_activeDocument->url().path() );
+ QFileInfo fi( m_activeFileName );
+ QString ext = fi.extension();
+ if ( isSource( m_activeFileName ) || isHeader( m_activeFileName ) )
+ enabled = true;
+ }
+
+ actionCollection() ->action( "edit_switchheader" ) ->setEnabled( enabled );
+ actionCollection() ->action( "edit_complete_text" ) ->setEnabled( enabled );
+ actionCollection() ->action( "edit_make_member" ) ->setEnabled( enabled );
+
+ if ( !part || !part->widget() )
+ return ;
+
+ if ( m_activeDocument )
+ {
+ connect( m_activeDocument, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+ m_textChangedTimer->start( 250, true ); // kick the parse timer, we might want to parse the current file
+ }
+
+ if ( m_activeViewCursor )
+ {
+ connect( m_activeView, SIGNAL( cursorPositionChanged() ), this, SLOT(slotCursorMoved()) );
+// this, SLOT( slotCursorPositionChanged() ) );
+ }
+
+
+#if 0
+ KTextEditor::TextHintInterface* textHintIface = dynamic_cast<KTextEditor::TextHintInterface*>( m_activeView );
+ if ( !textHintIface )
+ return ;
+
+ connect( view, SIGNAL( needTextHint( int, int, QString& ) ),
+ this, SLOT( slotNeedTextHint( int, int, QString& ) ) );
+
+ textHintIface->enableTextHints( 1000 );
+#endif
+}
+
+
+void CppSupportPart::setTyping( bool typing ) {
+ m_isTyping = typing;
+ if( m_problemReporter) {
+ m_hadErrors &= m_problemReporter->hasErrors(m_activeFileName);///m_hadErrors generally stores whether there was an error-free state of the file.
+ }
+}
+
+
+void CppSupportPart::projectOpened( )
+{
+ kdDebug( 9007 ) << "projectOpened( )" << endl;
+
+ m_backgroundParser = new BackgroundParser( this, &m_eventConsumed );
+ m_backgroundParser->start( QThread::IdlePriority );
+
+ // setup the driver
+ QString conf_file_name = specialHeaderName();
+ if ( QFile::exists( conf_file_name ) )
+ m_driver->parseFile( conf_file_name, true, true, true );
+
+ m_projectDirectory = URLUtil::canonicalPath( project() ->projectDirectory() );
+ m_projectFileList = project() ->allFiles();
+
+ setupCatalog();
+
+ embedProblemReporter();
+
+ connect( core(), SIGNAL( configWidget( KDialogBase* ) ),
+ m_problemReporter, SLOT( configWidget( KDialogBase* ) ) );
+
+ connect( project( ), SIGNAL( addedFilesToProject( const QStringList & ) ),
+ this, SLOT( addedFilesToProject( const QStringList & ) ) );
+ connect( project( ), SIGNAL( removedFilesFromProject( const QStringList & ) ),
+ this, SLOT( removedFilesFromProject( const QStringList & ) ) );
+ connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ),
+ this, SLOT( changedFilesInProject( const QStringList & ) ) );
+ connect( project(), SIGNAL( projectCompiled() ),
+ this, SLOT( slotProjectCompiled() ) );
+
+ m_timestamp.clear();
+ m_parseEmitWaiting.clear();
+ m_fileParsedEmitWaiting.clear();
+
+ m_pCompletion = new CppCodeCompletion( this );
+ m_projectClosed = false;
+
+ m_buildSafeFileSetTimer->start( 500, true );
+ updateParserConfiguration(); //Necessary to respect custom include-paths and such
+
+ QTimer::singleShot( 500, this, SLOT( initialParse( ) ) );
+}
+
+void CppSupportPart::embedProblemReporter( bool force )
+{
+ if ( force || m_backgroundParserConfig->useProblemReporter() )
+ {
+ m_problemReporter = new ProblemReporter( this, 0, "problemReporterWidget" );
+ m_problemReporter->setIcon( SmallIcon( "info" ) );
+ m_problemReporter->setCaption( i18n( "Problem Reporter" ) );
+ mainWindow( ) ->embedOutputView( m_problemReporter, i18n( "Problems" ), i18n( "Problem reporter" ) );
+ }
+}
+
+void CppSupportPart::removeProblemReporter()
+{
+ mainWindow()->removeView( m_problemReporter );
+ delete m_problemReporter;
+ m_problemReporter = 0;
+}
+
+
+void CppSupportPart::projectClosed( )
+{
+ kdDebug( 9007 ) << "projectClosed( )" << endl;
+
+ m_projectClosing = true;
+
+ QStringList enabledPCSs;
+ QValueList<Catalog*> catalogs = codeRepository() ->registeredCatalogs();
+ for ( QValueList<Catalog*>::Iterator it = catalogs.begin(); it != catalogs.end(); ++it )
+ {
+ Catalog* c = *it;
+ if ( c->enabled() )
+ enabledPCSs.push_back( QFileInfo( c->dbName() ).baseName(true) );
+ }
+ DomUtil::writeListEntry( *project() ->projectDom(), "kdevcppsupport/references", "pcs", enabledPCSs );
+
+ for ( QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*>::const_iterator it = m_designers.begin();
+ it != m_designers.end(); ++it )
+ {
+ kdDebug( 9007 ) << "calling save settings fro designer integration" << endl;
+ it.data() ->saveSettings( *project() ->projectDom(), "kdevcppsupport/designerintegration" );
+ }
+
+ saveProjectSourceInfo();
+
+ m_pCompletionConfig->store();
+
+ delete _jd;
+ _jd = 0;
+
+ removeProblemReporter();
+
+ delete m_pCompletion;
+ m_parseEmitWaiting.clear();
+ m_fileParsedEmitWaiting.clear();
+ m_pCompletion = 0;
+ m_projectClosed = true;
+ m_projectClosing = false;
+}
+
+
+void CppSupportPart::slotNavigate() {
+ if( codeCompletion() && m_activeView && m_activeViewCursor ) {
+ unsigned int curLine = 0, curCol = 0;
+ m_activeViewCursor->cursorPositionReal( &curLine, &curCol );
+
+ if( m_navigationMenu ) delete (KPopupMenu*)m_navigationMenu;
+
+ m_navigationMenu = new KPopupMenu( m_activeView );
+
+ codeCompletion()->contextEvaluationMenus( m_navigationMenu, 0, curLine, curCol );
+
+ m_navigationMenu->move( m_activeView->mapToGlobal( m_activeViewCursor->cursorCoordinates() ) );
+ if ( m_navigationMenu->count() > 0 )
+ {
+ m_navigationMenu->show();
+ }
+ }
+}
+
+
+void CppSupportPart::contextMenu( QPopupMenu *popup, const Context *context )
+{
+ m_activeClass = 0;
+ m_activeFunction = 0;
+ m_activeVariable = 0;
+ m_curAttribute = 0;
+ m_curClass = 0;
+
+ if ( context->hasType( Context::EditorContext ) )
+ {
+ int id;
+
+ m_switchHeaderSourceAction->plug( popup );
+
+ // CodeModelItemContext
+ if ( context->type() == Context::EditorContext )
+ {
+ m_curClass = currentClass();
+ if ( m_curClass != 0 )
+ {
+ m_curAttribute = currentAttribute( m_curClass );
+ if ( m_curAttribute != 0 )
+ m_createGetterSetterAction->plug( popup );
+ }
+ }
+
+ QString text;
+ int atline, atcol;
+ MakeMemberHelper( text, atline, atcol );
+ if ( !text.isEmpty() )
+ {
+ id = popup->insertItem( i18n( "Make Member" ), this, SLOT( slotMakeMember() ) );
+ popup->setWhatsThis( id, i18n( "<b>Make member</b><p>Creates a class member function in implementation file "
+ "based on the member declaration at the current line." ) );
+ }
+
+ kdDebug( 9007 ) << "======> code model has the file: " << m_activeFileName << " = " << codeModel() ->hasFile( m_activeFileName ) << endl;
+
+ bool showContextMenuExplosion = false;
+ bool showContextTypeEvaluation = false;
+ KConfig *config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "General" );
+ showContextMenuExplosion = config->readBoolEntry( "ShowContextMenuExplosion", false );
+ config->setGroup( "General" );
+ showContextTypeEvaluation = config->readBoolEntry( "ShowContextTypeEvaluation", true );
+ }
+
+
+ if( codeModel() ->hasFile( m_activeFileName ) ) {
+
+ if( showContextTypeEvaluation && m_activeViewCursor != 0 ) {
+ if( codeCompletion() ) {
+ unsigned int curLine = 0, curCol = 0;
+ m_activeViewCursor->cursorPositionReal( &curLine, &curCol );
+
+ codeCompletion()->contextEvaluationMenus( popup, context, curLine, curCol );
+ }
+ }
+
+
+ if ( showContextMenuExplosion )
+ {
+ //kdDebug( 9007 ) << "CppSupportPart::contextMenu 1" << endl;
+ QString candidate;
+ if ( isSource( m_activeFileName ) )
+ candidate = sourceOrHeaderCandidate();
+ else
+ candidate = m_activeFileName;
+
+ unsigned int curLine = 0, curCol = 0;
+ if ( m_activeViewCursor != 0 )
+ m_activeViewCursor->cursorPositionReal( &curLine, &curCol );
+
+ //kdDebug( 9007 ) << "CppSupportPart::contextMenu 2: candidate: " << candidate << endl;
+
+ if ( !candidate.isEmpty() && codeModel() ->hasFile( candidate ) )
+ {
+ QPopupMenu * m2 = new QPopupMenu( popup );
+ id = popup->insertItem( i18n( "Go to Declaration" ), m2 );
+ popup->setWhatsThis( id, i18n( "<b>Go to declaration</b><p>Provides a menu to select available function declarations "
+ "in the current file and in the corresponding header (if the current file is an implementation) or source (if the current file is a header) file." ) );
+
+ FileDom file2 = codeModel() ->fileByName( candidate );
+ //kdDebug( 9007 ) << "CppSupportPart::contextMenu 3: " << file2->name() << endl;
+
+ FunctionList functionList2 = CodeModelUtils::allFunctions( file2 );
+ for ( FunctionList::ConstIterator it = functionList2.begin(); it != functionList2.end(); ++it )
+ {
+ QString text = ( *it ) ->scope().join( "::" );
+ //kdDebug( 9007 ) << "CppSupportPart::contextMenu 3 text: " << text << endl;
+ if ( !text.isEmpty() )
+ {
+ text += "::";
+ }
+ text += formatModelItem( *it, true );
+ text = text.replace( QString::fromLatin1( "&" ), QString::fromLatin1( "&&" ) );
+ int id = m2->insertItem( text, this, SLOT( gotoDeclarationLine( int ) ) );
+ int line, column;
+ ( *it ) ->getStartPosition( &line, &column );
+ m2->setItemParameter( id, line );
+ }
+
+ if ( m2->count() == 0 )
+ {
+ popup->removeItem( id );
+ }
+ //kdDebug( 9007 ) << "CppSupportPart::contextMenu 4" << endl;
+ }
+
+ QString candidate1;
+ if ( isHeader( m_activeFileName ) )
+ {
+ candidate1 = sourceOrHeaderCandidate();
+ }
+ else
+ {
+ candidate1 = m_activeFileName;
+ }
+ //kdDebug( 9007 ) << "CppSupportPart::go to definition in " << candidate1 << endl;
+ if ( codeModel() ->hasFile( candidate1 ) )
+ {
+ QPopupMenu * m = new QPopupMenu( popup );
+ id = popup->insertItem( i18n( "Go to Definition" ), m );
+ popup->setWhatsThis( id, i18n( "<b>Go to definition</b><p>Provides a menu to select available function definitions "
+ "in the current file and in the corresponding header (if the current file is an implementation) or source (if the current file is a header) file." ) );
+
+ const FileDom file = codeModel() ->fileByName( candidate1 );
+ const FunctionDefinitionList functionDefinitionList = CodeModelUtils::allFunctionDefinitionsDetailed( file ).functionList;
+ for ( FunctionDefinitionList::ConstIterator it = functionDefinitionList.begin(); it != functionDefinitionList.end(); ++it )
+ {
+ QString text = ( *it ) ->scope().join( "::" );
+ if ( !text.isEmpty() )
+ {
+ text += "::";
+ }
+ text += formatModelItem( *it, true );
+ text = text.replace( QString::fromLatin1( "&" ), QString::fromLatin1( "&&" ) );
+ int id = m->insertItem( text, this, SLOT( gotoLine( int ) ) );
+ int line, column;
+ ( *it ) ->getStartPosition( &line, &column );
+ m->setItemParameter( id, line );
+ }
+ if ( m->count() == 0 )
+ {
+ popup->removeItem( id );
+ }
+
+ }
+ }
+ }
+
+ const EditorContext *econtext = static_cast<const EditorContext*>( context );
+ QString str = econtext->currentLine();
+ if ( str.isEmpty() )
+ return ;
+ }
+ else if ( context->hasType( Context::CodeModelItemContext ) )
+ {
+ const CodeModelItemContext * mcontext = static_cast<const CodeModelItemContext*>( context );
+
+ if ( mcontext->item() ->isClass() )
+ {
+ m_activeClass = ( ClassModel* ) mcontext->item();
+ int id = popup->insertItem( i18n( "Extract Interface..." ), this, SLOT( slotExtractInterface() ) );
+ popup->setWhatsThis( id, i18n( "<b>Extract interface</b><p>Extracts interface from the selected class and creates a new class with this interface. "
+ "No implementation code is extracted and no implementation code is created." ) );
+ }
+ else if ( mcontext->item() ->isFunction() )
+ {
+ m_activeFunction = ( FunctionModel* ) mcontext->item();
+ }
+ }
+ else if ( context->hasType( Context::FileContext ) )
+ {
+ const FileContext * fc = static_cast<const FileContext*>( context );
+ //this is a .ui file and only selection contains only one such file
+ KURL url = fc->urls().first();
+ kdDebug( 9007 ) << "file context with " << url.path() << endl;
+ if ( url.fileName().endsWith( ".ui" ) )
+ {
+ m_contextFileName = url.path();
+ int id = popup->insertItem( i18n( "Create or Select Implementation..." ), this, SLOT( slotCreateSubclass() ) );
+ popup->setWhatsThis( id, i18n( "<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner." ) );
+ }
+ }
+}
+
+
+QStringList makeListUnique( const QStringList& rhs ) {
+ QMap<QString, bool> map;
+ QStringList ret;
+ for( QStringList::const_iterator it = rhs.begin(); it != rhs.end(); ++it ) {
+ if( map.find( *it ) == map.end() ) {
+ ret << *it;
+ map.insert( *it, true );
+ }
+ }
+ return ret;
+}
+
+// Makes sure that header files come first
+QStringList CppSupportPart::reorder( const QStringList &list )
+{
+ QStringList headers, others;
+
+ QStringList headerExtensions = QStringList::split( ",", "h,H,hh,hxx,hpp,tlh" );
+
+ QString projectPath = project()->projectDirectory();
+
+ QStringList::ConstIterator it;
+ for ( it = list.begin(); it != list.end(); ++it )
+ {
+ QString filePath = *it;
+ // brilliant stuff.. this method is apparently called both with
+ // relative and absolute paths..
+ if ( !filePath.startsWith("/") )
+ {
+ filePath = projectPath + "/" + filePath;
+ }
+ if( !isValidSource( filePath ) ) continue;
+ if ( headerExtensions.contains( QFileInfo( filePath ).extension() ) )
+ headers << ( filePath );
+ else
+ others << ( filePath );
+ }
+
+ return makeListUnique( headers + others );
+}
+
+void CppSupportPart::addedFilesToProject( const QStringList &fileList )
+{
+ m_projectFileList = project() ->allFiles();
+ QStringList files = reorder( fileList );
+
+ for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString path = *it;
+ if (!path.startsWith("/"))
+ path = URLUtil::canonicalPath( m_projectDirectory + "/" + ( *it ) );
+
+ maybeParse( path );
+ //emit addedSourceInfo( path );
+ }
+ m_buildSafeFileSetTimer->start( 500, true );
+}
+
+void CppSupportPart::removedFilesFromProject( const QStringList &fileList )
+{
+ m_projectFileList = project() ->allFiles();
+ for ( QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it );
+ kdDebug( 9007 ) << "=====================> remove file: " << path << endl;
+
+ removeWithReferences( path );
+ m_backgroundParser->removeFile( path );
+ }
+ m_buildSafeFileSetTimer->start( 500, true );
+}
+
+void CppSupportPart::changedFilesInProject( const QStringList & fileList )
+{
+ QStringList files = reorder( fileList );
+
+ for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it );
+
+ maybeParse( path );
+ //emit addedSourceInfo( path );
+ }
+}
+
+void CppSupportPart::savedFile( const KURL &file )
+{
+ if( file.path() == m_activeFileName ) {
+ m_isTyping = false;
+ m_hadErrors = false;
+ maybeParse( file.path() );
+ }
+
+ Q_UNUSED( file.path() );
+
+#if 0 // not needed anymore
+
+ kdDebug( 9007 ) << "savedFile(): " << fileName.mid ( m_projectDirectory.length() + 1 ) << endl;
+
+ if ( m_projectFileList.contains( fileName.mid ( m_projectDirectory.length() + 1 ) ) )
+ {
+ maybeParse( fileName );
+ emit addedSourceInfo( fileName );
+ }
+#endif
+}
+
+QString CppSupportPart::findSourceFile()
+{
+ // get the path of the currently active document
+ QFileInfo fi( m_activeFileName );
+ QString path = fi.filePath();
+ QString ext = fi.extension();
+ // extract the base path (full path without '.' and extension)
+ QString base = path.left( path.length() - ext.length() - 1 );
+ QStringList candidates;
+ if ( QStringList::split( ',', "h,H,hh,hxx,hpp,tlh" ).contains( ext ) )
+ {
+ candidates << ( base + ".c" );
+ candidates << ( base + ".cc" );
+ candidates << ( base + ".cpp" );
+ candidates << ( base + ".c++" );
+ candidates << ( base + ".cxx" );
+ candidates << ( base + ".C" );
+ candidates << ( base + ".m" );
+ candidates << ( base + ".mm" );
+ candidates << ( base + ".M" );
+ candidates << ( base + ".inl" );
+ candidates << ( base + "_impl.h" );
+ }
+
+ QStringList::ConstIterator it;
+ for ( it = candidates.begin(); it != candidates.end(); ++it )
+ {
+ kdDebug( 9007 ) << "Trying " << ( *it ) << endl;
+ if ( QFileInfo( *it ).exists() )
+ {
+ return * it;
+ }
+ }
+ return m_activeFileName;
+}
+
+QString CppSupportPart::sourceOrHeaderCandidate( const KURL &url )
+{
+ QString urlPath;
+ if ( url.isEmpty() )
+ {
+ KTextEditor::Document * doc =
+ dynamic_cast<KTextEditor::Document*>( partController() ->activePart() );
+ if ( !doc )
+ return QString::null;
+ urlPath = doc->url().path();
+ }
+ else
+ {
+ urlPath = url.path();
+ }
+ // get the path of the currently active document
+ QFileInfo fi( urlPath );
+ QString path = fi.filePath();
+ // extract the exension
+ QString ext = fi.extension();
+ if ( ext.isEmpty() )
+ return QString::null;
+ // extract the base path (full path without '.' and extension)
+ QString base = path.left( path.length() - ext.length() - 1 );
+ //kdDebug( 9007 ) << "base: " << base << ", ext: " << ext << endl;
+ // just the filename without the extension
+ QString fileNameWoExt = fi.fileName();
+ if ( !ext.isEmpty() )
+ fileNameWoExt.replace( "." + ext, "" );
+ QString possibleExts;
+ // depending on the current extension assemble a list of
+ // candidate files to look for
+ QStringList candidates;
+ // special case for template classes created by the new class dialog
+ if ( path.endsWith( "_impl.h" ) )
+ {
+ QString headerpath = path;
+ headerpath.replace( "_impl.h", ".h" );
+ candidates << headerpath;
+ fileNameWoExt.replace( "_impl", "" );
+ possibleExts = "h";
+ }
+ // if file is a header file search for implementation file
+ else if ( QStringList::split( ',', "h,H,hh,hxx,hpp,tlh" ).contains( ext ) )
+ {
+ candidates << ( base + ".c" );
+ candidates << ( base + ".cc" );
+ candidates << ( base + ".cpp" );
+ candidates << ( base + ".c++" );
+ candidates << ( base + ".cxx" );
+ candidates << ( base + ".C" );
+ candidates << ( base + ".m" );
+ candidates << ( base + ".mm" );
+ candidates << ( base + ".M" );
+ candidates << ( base + ".inl" );
+ candidates << ( base + "_impl.h" );
+ possibleExts = "c,cc,cpp,c++,cxx,C,m,mm,M,inl,_impl.h";
+ }
+ // if file is an implementation file, search for header file
+ else if ( QStringList::split( ',', "c,cc,cpp,c++,cxx,C,m,mm,M,inl" ).contains( ext ) )
+ {
+ candidates << ( base + ".h" );
+ candidates << ( base + ".H" );
+ candidates << ( base + ".hh" );
+ candidates << ( base + ".hxx" );
+ candidates << ( base + ".hpp" );
+ candidates << ( base + ".tlh" );
+ possibleExts = "h,H,hh,hxx,hpp,tlh";
+ }
+ // search for files from the assembled candidate lists, return the first
+ // candidate file that actually exists or QString::null if nothing is found.
+ QStringList::ConstIterator it;
+ for ( it = candidates.begin(); it != candidates.end(); ++it )
+ {
+ //kdDebug( 9007 ) << "Trying " << ( *it ) << endl;
+ if ( QFileInfo( *it ).exists() )
+ {
+ kdDebug( 9007 ) << "using: " << *it << endl;
+ return * it;
+ }
+ }
+ //kdDebug( 9007 ) << "Now searching in project files." << endl;
+ // Our last resort: search the project file list for matching files
+ QStringList::iterator fileIt;
+ QFileInfo candidateFileWoExt;
+ QString candidateFileWoExtString;
+ QStringList possibleExtsList = QStringList::split( ',', possibleExts );
+ for ( fileIt = m_projectFileList.begin(); fileIt != m_projectFileList.end(); ++fileIt )
+ {
+ candidateFileWoExt.setFile(*fileIt);
+ //kdDebug( 9007 ) << "candidate file: " << *fileIt << endl;
+ if( !candidateFileWoExt.extension().isEmpty() )
+ candidateFileWoExtString = candidateFileWoExt.fileName().replace( "." + candidateFileWoExt.extension(), "" );
+ if ( candidateFileWoExtString == fileNameWoExt )
+ {
+ if ( possibleExtsList.contains( candidateFileWoExt.extension() ) || candidateFileWoExt.extension().isEmpty() )
+ {
+ //kdDebug( 9007 ) << "checking if " << *fileIt << " exists" << endl;
+ if ( QFileInfo( *fileIt ).exists() )
+ kdDebug( 9007 ) << "using: " << *fileIt << endl;
+ return *fileIt;
+ }
+ }
+ }
+ return QString::null;
+}
+
+void CppSupportPart::slotSaveMemory() {
+ if( m_backgroundParser ) {
+ ///This is done so the caches are completely empty after kdevelop was idle for some time(else it would be waste of memory). The background-parsers internal lexer-cache-manager just cares about keeping the count of cached files under a specific count, but doesn't decrease that count when kdevelop is idle.
+ m_backgroundParser->lock();
+ m_backgroundParser->saveMemory();
+ m_backgroundParser->unlock();
+ }
+}
+
+void CppSupportPart::slotSwitchHeader( bool scrollOnly )
+{
+ bool attemptMatch = true;
+ KConfig *config = CppSupportFactory::instance() ->config();
+ if ( config )
+ {
+ config->setGroup( "General" );
+ attemptMatch = config->readBoolEntry( "SwitchShouldMatch", true );
+ }
+
+ // ok, both files exist. Do the codemodel have them?
+ if ( codeModel() ->hasFile( m_activeFileName ) && m_activeViewCursor && attemptMatch )
+ {
+ unsigned int currentline, column;
+ m_activeViewCursor->cursorPositionReal( &currentline, &column );
+
+ if ( switchHeaderImpl( m_activeFileName, currentline, column, scrollOnly ) )
+ return;
+ }
+
+ // last chance
+ KURL url;
+ url.setPath( sourceOrHeaderCandidate() );
+
+ if ( scrollOnly )
+ return;
+ else if ( !splitHeaderSourceConfig()->splitEnabled() )
+ partController() ->editDocument( url );
+ else
+ partController() ->splitCurrentDocument( url );
+}
+
+bool CppSupportPart::switchHeaderImpl( const QString& file, int line, int col, bool scrollOnly )
+{
+ bool handled = false;
+
+ FunctionDom d;
+ FileDom fd = codeModel() ->fileByName( file );
+ if ( fd ) {
+ CodeModelUtils::CodeModelHelper h( codeModel(), fd );
+ d = h.functionAt( line, col );
+ }
+ if ( d ) {
+ if( d->isFunctionDefinition() ) {
+ FunctionDom decl = findFunction( d );
+ if ( decl ) {
+ if ( (void*)&decl != (void*)d.data() && ( !scrollOnly || decl->fileName() != file ) ) {
+ jumpToCodeModelItem( model_cast<ItemDom>(decl), scrollOnly );
+ handled = true;
+ }
+ }
+ } else {
+ FunctionDom def = findFunctionDefinition( d );
+ if ( def ) {
+ if ( def != d && ( !scrollOnly || def->fileName() != file ) ) {
+ jumpToCodeModelItem( model_cast<ItemDom>(def), scrollOnly );
+ handled = true;
+ }
+ }
+ }
+ }
+
+ return handled;
+}
+
+FunctionDom CppSupportPart::findFunction( const FunctionDom& def )
+{
+ // We have a definition so we're looking for a declaration. The declaration will either be the child of a namespace node (non class members)
+ // or the child of a class node (class member). Search recursively until we find a declaration that matches.
+ FunctionDom bestMatch;
+ FunctionDom decl = findFunctionInNamespace( codeModel()->globalNamespace(), def, codeModel()->globalNamespace()->namespaceImports(),
+ sourceOrHeaderCandidate( def->fileName() ), 0, bestMatch );
+ return decl ? decl : bestMatch;
+}
+
+FunctionDom CppSupportPart::findFunctionInNamespace( const NamespaceDom& ns, const FunctionDom& def, const std::set<NamespaceImportModel>& nsImports,
+ const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch )
+{
+ FunctionDom d;
+ QStringList scope = def->scope();
+ if ( !(scopeIndex >= (signed) scope.size()) ) {
+ NamespaceDom ns_next = ns->namespaceByName( scope[ scopeIndex ] );
+ if ( ns_next ) {
+ d = findFunctionInNamespace( ns_next, def, ns_next->namespaceImports(), candidateFile, scopeIndex+1, bestMatch );
+ }
+ if ( !d ) {
+ for ( std::set<NamespaceImportModel>::const_iterator it_ns = nsImports.begin(); it_ns != nsImports.end(); ++it_ns ) {
+ if ( (*it_ns).fileName().str() == def->fileName() ) {
+ ns_next = ns->namespaceByName( (*it_ns).name() );
+ if ( ns_next ) {
+ if ( d = findFunctionInNamespace( ns_next, def, nsImports, candidateFile, scopeIndex, bestMatch ) ) break;
+ }
+ }
+ }
+ }
+ if ( !d ) {
+ ClassList classList = ns->classByName( scope[ scopeIndex ] );
+ for ( ClassList::ConstIterator it_cs = classList.begin(); it_cs != classList.end(); ) {
+ if ( d = findFunctionInClass( *(it_cs++), def, nsImports, candidateFile, scopeIndex+1, bestMatch ) ) break;
+ }
+ }
+ }
+ if ( !d ) {
+ FunctionList functionList = ns->functionByName( def->name() );
+ for ( FunctionList::ConstIterator it_decl = functionList.begin(); it_decl != functionList.end(); ++it_decl ) {
+ if ( CodeModelUtils::compareDeclarationToDefinition( *it_decl, (FunctionDefinitionModel*) def.data(), nsImports ) ) {
+ ParsedFile* p = dynamic_cast<ParsedFile*>( def->file()->parseResult().data() );
+ if ( p ) {
+ if ( p->includeFiles()[ (*it_decl)->fileName() ] ) {
+ d = *it_decl;
+ break;
+ } else if ( (*it_decl)->fileName() == candidateFile ) {
+ d = *it_decl;
+ break;
+ }
+ }
+ if ( !bestMatch ) {
+ bestMatch = *it_decl;
+ }
+ }
+ }
+ }
+ return d;
+}
+
+FunctionDom CppSupportPart::findFunctionInClass( const ClassDom& cs, const FunctionDom& def, const std::set<NamespaceImportModel>& nsImports,
+ const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch )
+{
+ FunctionDom d;
+ QStringList scope = def->scope();
+ if ( !(scopeIndex >= (signed) scope.size()) ) {
+ ClassList classList = cs->classByName( scope[ scopeIndex ] );
+ for ( ClassList::ConstIterator it_cs = classList.begin(); it_cs != classList.end(); ) {
+ if ( d = findFunctionInClass( *(it_cs++), def, nsImports, candidateFile, scopeIndex+1, bestMatch ) ) break;
+ }
+ }
+ if ( !d ) {
+ FunctionList functionList = cs->functionByName( def->name() );
+ for ( FunctionList::ConstIterator it_decl = functionList.begin(); it_decl != functionList.end(); ++it_decl ) {
+ if ( CodeModelUtils::compareDeclarationToDefinition( *it_decl, (FunctionDefinitionModel*) def.data(), nsImports ) ) {
+ ParsedFile* p = dynamic_cast<ParsedFile*>( def->file()->parseResult().data() );
+ if ( p ) {
+ if ( p->includeFiles()[ (*it_decl)->fileName() ] ) {
+ d = *it_decl;
+ break;
+ } else if ( (*it_decl)->fileName() == candidateFile ) {
+ d = *it_decl;
+ break;
+ }
+ }
+ if ( !bestMatch ) {
+ bestMatch = *it_decl;
+ }
+ }
+ }
+ }
+ return d;
+}
+
+FunctionDom CppSupportPart::findFunctionDefinition( const FunctionDom& decl )
+{
+ // We have a declaration so we're looking for a definition. The definition will be the child of some namespace node (never a class node).
+ // Since the definition can be the child of any namespace in its scope depending on syntax, we have to check every one.
+ FunctionDom def, bestMatch;
+ NamespaceDom ns = codeModel()->globalNamespace();
+ QString candidateFile = sourceOrHeaderCandidate( decl->fileName() );
+ FunctionDefinitionList functionList = ns->functionDefinitionByName( decl->name() );
+ for ( FunctionDefinitionList::ConstIterator it_def = functionList.begin(); it_def != functionList.end() && !def; ++it_def ) {
+ if ( CodeModelUtils::compareDeclarationToDefinition( decl, *it_def, ns->namespaceImports() ) ) {
+ ParsedFile* p = dynamic_cast<ParsedFile*>( (*it_def)->file()->parseResult().data() );
+ if ( p ) {
+ if ( p->includeFiles()[ decl->fileName() ] ) {
+ def = *it_def;
+ } else if ( (*it_def)->fileName() == candidateFile ) {
+ def = *it_def;
+ break;
+ }
+ }
+ if ( !bestMatch ) {
+ bestMatch = *it_def;
+ }
+ }
+ }
+ QStringList scope = decl->scope();
+ for ( QStringList::ConstIterator it_scope = scope.begin(); it_scope != scope.end() && !def; ++it_scope ) {
+ NamespaceDom ns_next = ns->namespaceByName( *it_scope );
+ if ( ns_next ) {
+ ns = ns_next;
+ FunctionDefinitionList functionList = ns->functionDefinitionByName( decl->name() );
+ for ( FunctionDefinitionList::ConstIterator it_def = functionList.begin(); it_def != functionList.end() && !def; ++it_def ) {
+ if ( CodeModelUtils::compareDeclarationToDefinition( decl, *it_def, ns->namespaceImports() ) ) {
+ ParsedFile* p = dynamic_cast<ParsedFile*>( (*it_def)->file()->parseResult().data() );
+ if ( p ) {
+ if ( p->includeFiles()[ decl->fileName() ] ) {
+ def = *it_def;
+ } else if ( (*it_def)->fileName() == candidateFile ) {
+ def = *it_def;
+ break;
+ }
+ }
+ if ( !bestMatch ) {
+ bestMatch = *it_def;
+ }
+ }
+ }
+ }
+ }
+ return def ? def : bestMatch;
+}
+
+void CppSupportPart::jumpToCodeModelItem( const ItemDom& item, bool scrollOnly )
+{
+ static KURL lastSyncedUrl;
+ static int lastSyncedLine = -1;
+
+ int line, col;
+ item->getStartPosition( &line, &col );
+
+ KURL url( item->fileName() );
+
+ if ( scrollOnly ) {
+ KParts::ReadOnlyPart* part = partController()->partForURL( url );
+ int currentLine = lastSyncedLine;
+ if ( part ) {
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if( iface )
+ iface->cursorPosition( (uint*) &currentLine, (uint*) &col );
+ }
+ partController() ->scrollToLineColumn( url, line, -1, lastSyncedLine != currentLine || lastSyncedUrl != url );
+ } else if ( !splitHeaderSourceConfig()->splitEnabled() )
+ partController() ->editDocument( url, line );
+ else
+ partController() ->splitCurrentDocument( url, line );
+ lastSyncedLine = line;
+ lastSyncedUrl = url;
+}
+
+KDevLanguageSupport::Features CppSupportPart::features()
+{
+ if ( withcpp )
+ return Features( Classes | Structs | Functions | Variables | Namespaces | Declarations
+ | Signals | Slots | AddMethod | AddAttribute | NewClass | CreateAccessMethods );
+ else
+ return Features ( Structs | Functions | Variables | Declarations );
+}
+
+QString CppSupportPart::formatClassName( const QString &name )
+{
+ QString n = name;
+ return n.replace( ".", "::" );
+}
+
+QString CppSupportPart::unformatClassName( const QString &name )
+{
+ QString n = name;
+ return n.replace( "::", "." );
+}
+
+bool CppSupportPart::shouldSplitDocument(const KURL &url)
+{
+ if ( !splitHeaderSourceConfig()->splitEnabled() )
+ return false;
+
+ KURL::List list = partController()->openURLs();
+ KURL::List::ConstIterator it = list.begin();
+ while ( it != list.end() )
+ {
+ QString candidate = sourceOrHeaderCandidate( ( *it ) );
+ if ( candidate.isEmpty() )
+ {
+ ++it;
+ continue;
+ }
+
+ KURL urlCandidate;
+ urlCandidate.setPath( candidate );
+ if ( url == urlCandidate )
+ {
+ // It is already open, so switch to it so
+ // our split view will open with it
+ partController() ->editDocument( ( *it ) );
+ return true;
+ }
+ ++it;
+ }
+ return false;
+}
+
+Qt::Orientation CppSupportPart::splitOrientation() const
+{
+ QString o = splitHeaderSourceConfig()->orientation();
+ if ( o == "Vertical" )
+ return Qt::Vertical;
+ else
+ return Qt::Horizontal;
+}
+
+void CppSupportPart::slotNewClass()
+{
+ CppNewClassDialog dlg( this );
+ dlg.exec();
+}
+
+void CppSupportPart::addMethod( ClassDom klass )
+{
+ if ( !klass )
+ {
+ KMessageBox::error( 0, i18n( "Please select a class." ), i18n( "Error" ) );
+ return ;
+ }
+
+ AddMethodDialog dlg( this, klass, mainWindow() ->main() );
+ dlg.exec();
+}
+
+void CppSupportPart::addAttribute( ClassDom klass )
+{
+ if ( !klass )
+ {
+ KMessageBox::error( 0, i18n( "Please select a class." ), i18n( "Error" ) );
+ return ;
+ }
+
+ AddAttributeDialog dlg( this, klass, mainWindow() ->main() );
+ dlg.exec();
+}
+
+void CppSupportPart::slotCompleteText()
+{
+ if ( !m_pCompletion )
+ return ;
+ m_pCompletion->completeText( true );
+}
+
+/**
+ * parsing stuff for project persistent classstore and code completion
+ */
+void CppSupportPart::initialParse( )
+{
+ // For debugging
+ if ( !project( ) )
+ {
+ // messagebox ?
+ kdDebug( 9007 ) << "No project" << endl;
+ return ;
+ }
+
+ parseProject( );
+ m_valid = true;
+ return ;
+}
+
+bool CppSupportPart::parseProject( bool force )
+{
+ if( _jd )
+ delete _jd->progressBar; ///Make sure the progress-bar is open
+
+ mainWindow() ->statusBar() ->message( i18n( "Updating..." ) );
+
+ kapp->setOverrideCursor( waitCursor );
+
+ _jd = new JobData;
+ if( QFileInfo( project() ->projectDirectory() + "/" + project()->projectName().lower()
+ + ".kdevelop.pcs" ).exists())
+ {
+ QDir d( project() ->projectDirectory());
+ d.rename(project() ->projectName().lower() + ".kdevelop.pcs",
+ project() ->projectName() +".kdevelop.pcs");
+ }
+ _jd->file.setName( project() ->projectDirectory() + "/" + project()->projectName()
+ + ".kdevelop.pcs" );
+
+ QString skip_file_name = project() ->projectDirectory() + "/" +
+ project() ->projectName() + ".kdevelop.ignore_pcs";
+ QString skip_lower_file_name = project() ->projectDirectory() + "/" +
+ project() ->projectName().lower() + ".kdevelop.ignore_pcs";
+
+ if ( !force && !QFile::exists( skip_file_name ) &&
+ !QFile::exists( skip_lower_file_name ) && _jd->file.open( IO_ReadOnly ) )
+ {
+ _jd->stream.setDevice( &( _jd->file ) );
+
+ createIgnorePCSFile();
+
+ QString sig;
+ int pcs_version = 0;
+ _jd->stream >> sig >> pcs_version;
+ if ( sig == "PCS" && pcs_version == KDEV_PCS_VERSION )
+ {
+
+ int numFiles = 0;
+ _jd->stream >> numFiles;
+ kdDebug( 9007 ) << "Read " << numFiles << " files from pcs" << endl;
+
+ for ( int i = 0; i < numFiles; ++i )
+ {
+ QString fn;
+ uint ts;
+ uint offset;
+
+ _jd->stream >> fn >> ts >> offset;
+ _jd->pcs[ fn ] = qMakePair( ts, offset );
+ }
+ }
+ }
+
+ _jd->files = reorder( modifiedFileList() );
+
+ QProgressBar* bar = new QProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow( ) ->statusBar( ) ->addWidget( bar );
+ bar->show( );
+
+ _jd->progressBar = bar;
+ _jd->dir.setPath( m_projectDirectory );
+ _jd->it = _jd->files.begin();
+ _jd->reparseList = QStringList();
+ _jd->backgroundCount = 0;
+ _jd->cycle = 0;
+
+ QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) );
+
+ m_saveMemoryTimer->stop(); //Do not regularly remove cached files that may still be needed while parsing(the cache anyway be full for the whole parsing-process)
+ return true;
+}
+
+void CppSupportPart::slotParseFiles()
+{
+ // NOTE: The checking for m_projectClosed is actually (currently) not needed.
+ // When the project is closed, the language support plugin is destroyed
+ // and as a consequence, the timer job signal never arrives at this method
+
+ if ( !_jd ) return; // how can this possibly happen?!
+
+ if ( _jd->cycle == 0 && !m_projectClosed && _jd->it != _jd->files.end() )
+ {
+ _jd->progressBar->setProgress( _jd->progressBar->progress() + 1 );
+
+ QFileInfo fileInfo( _jd->dir, *( _jd->it ) );
+
+ if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() )
+ {
+ QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() );
+
+ if ( isValidSource( absFilePath ) )
+ {
+ QDateTime t = fileInfo.lastModified();
+
+ if ( ! ( m_timestamp.contains( absFilePath ) && m_timestamp[ absFilePath ] == t ) )
+ {
+ if ( _jd->pcs.contains( absFilePath ) )
+ {
+ _jd->stream.device() ->at( _jd->pcs[ absFilePath ].second );
+ FileDom file = codeModel() ->create<FileModel>();
+ file->read( _jd->stream );
+ codeModel() ->addFile( file );
+
+ if( t.toTime_t() != _jd->pcs[ absFilePath ].first ) {
+ ///The FileDom had to be created first, so the dependencies are known
+ _jd->reparseList << file->name();
+/* kdDebug( 9007 ) << "File timestamp: " << ": " << t.toTime_t() << endl;
+ kdDebug( 9007 ) << "Stored timestamp: " << ": " << _jd->pcs[ absFilePath ].first << endl;*/
+ } else {
+ m_timestamp[ absFilePath ] = t;
+/* kdDebug( 9007 ) << "timestamp ok" << endl;*/
+ }
+ } else {
+ _jd->reparseList << absFilePath;
+ /* kdDebug( 9007 ) << absFilePath << " put into reparse-list" << endl;
+ */ }
+ } else {
+/* kdDebug( 9007 ) << absFilePath << " is already in code-model" << endl;*/
+ }
+ }
+ }
+
+ ++( _jd->it );
+ QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) );
+
+ if( _jd->it == _jd->files.end()) {
+ if( _jd->reparseList.isEmpty() ) {
+ _jd->backgroundCount = 0;
+ } else {
+ if( alwaysParseInBackground ) {
+ _jd->backgroundCount = parseFilesAndDependencies( _jd->reparseList, true, false, true );
+ } else {
+ _jd->reparseList = reorder( _jd->reparseList );
+ _jd->it = _jd->reparseList.begin();
+ _jd->backgroundCount = _jd->reparseList.count();
+ }
+ _jd->progressBar->setProgress( 0 ); ///restart progress-bar for reparsing
+ _jd->progressBar->setTotalSteps( _jd->backgroundCount );
+ }
+
+ _jd->lastBackgroundState = -1;
+ _jd->backgroundState = 0;
+ _jd->cycle = 1;
+ _jd->lastParse = QTime::currentTime();
+ kapp->restoreOverrideCursor( );
+ }
+ }
+ else // finished or interrupted
+ {
+ if( _jd->backgroundCount <= _jd->backgroundState || m_projectClosed ) {
+ mainWindow( ) ->statusBar( ) ->removeWidget( _jd->progressBar );
+
+ if ( !m_projectClosed )
+ {
+ kdDebug( 9007 ) << "updating sourceinfo" << endl;
+ kapp->restoreOverrideCursor( );
+ emit updatedSourceInfo();
+ mainWindow( ) ->statusBar( ) ->message( i18n( "Done" ), 2000 );
+ QFile::remove( project() ->projectDirectory()
+ + "/" + project() ->projectName()
+ + ".kdevelop.ignore_pcs" );
+ QFile::remove( project() ->projectDirectory()
+ + "/" + project() ->projectName().lower()
+ + ".kdevelop.ignore_pcs" );
+
+ }
+ else
+ {
+ kdDebug( 9007 ) << "ABORT" << endl;
+ }
+
+ delete _jd;
+ _jd = 0;
+ m_saveMemoryTimer->start( 240000, false );
+ } else {
+ _jd->progressBar->setProgress( _jd->backgroundState ); ///restart
+ _jd->progressBar->setTotalSteps( _jd->backgroundCount );
+ if( _jd->lastParse.msecsTo( QTime::currentTime()) > 60000 && !m_backgroundParser->filesInQueue()) {
+ _jd->backgroundCount = _jd->backgroundState; ///Stop waiting if there is no progress and no file in the background-parser
+ QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) );
+ } else {
+ int timeStep = 0;
+ if( alwaysParseInBackground ) {
+ QTimer::singleShot( 10, this, SLOT( slotParseFiles() ) );
+ } else {
+ if( _jd->it == _jd->reparseList.end() ) {
+ /*_jd->it = _jd->files.end();
+ _jd->backgroundCount = _jd->backgroundState; ///finish processing*/
+ timeStep = 1;
+ } else {
+ /*///Parse the files one by one
+ if( _jd->lastParse.msecsTo( QTime::currentTime()) > 100 || _jd->backgroundState != _jd->lastBackgroundState ) {*/
+ maybeParse( *_jd->it, false );
+ ++(_jd->it);
+ _jd->lastBackgroundState = _jd->backgroundState;
+ /*}else{
+ timeStep = 1;
+ }*/
+ }
+ QTimer::singleShot( timeStep, this, SLOT( slotParseFiles() ) );
+ }
+ }
+ }
+ }
+}
+
+void CppSupportPart::maybeParse( const QString& fn, bool background )
+{
+ if ( !isValidSource( fn ) )
+ return ;
+
+ QFileInfo fileInfo( fn );
+ QString path = URLUtil::canonicalPath( fn );
+ QDateTime t = fileInfo.lastModified();
+
+ if ( !fileInfo.exists() )
+ return;
+
+ QMap<QString, QDateTime>::Iterator it = m_timestamp.find( path );
+ if ( codeModel()->hasFile( fn ) && it != m_timestamp.end() && *it == t )
+ return;
+
+ QStringList l;
+ l << fn;
+ parseFilesAndDependencies( l, background );
+}
+
+bool CppSupportPart::isQueued( const QString& file ) const {
+ //int c = m_backgroundParser->countInQueue( file );
+ //if( c == 0 ) return false;
+ return m_parseEmitWaiting.waiting( file, ParseEmitWaiting::Silent, 2 ); //Since it may be possible that the background-parser is currently parsing the file(in an obselete state), it is allowed to have the file in the queue twice.
+}
+
+void CppSupportPart::slotNeedTextHint( int line, int column, QString& textHint )
+{
+ if ( 1 || !m_activeEditor )
+ return ;
+
+ m_backgroundParser->lock();
+ TranslationUnitAST* ast = *m_backgroundParser->translationUnit( m_activeFileName );
+ AST* node = 0;
+ if ( ast && ( node = findNodeAt( ast, line, column ) ) )
+ {
+
+ while ( node && node->nodeType() != NodeType_FunctionDefinition )
+ node = node->parent();
+
+ if ( node )
+ {
+ int startLine, startColumn;
+ int endLine, endColumn;
+ node->getStartPosition( &startLine, &startColumn );
+ node->getEndPosition( &endLine, &endColumn );
+
+ if ( !node->text().isNull() )
+ textHint = node->text();
+ else
+ textHint = m_activeEditor->textLine( startLine ).simplifyWhiteSpace();
+ }
+ }
+ m_backgroundParser->unlock();
+}
+
+void CppSupportPart::MakeMemberHelper( QString& text, int& atLine, int& atColumn )
+{
+ if ( !m_activeViewCursor || !m_valid )
+ return ;
+
+ atLine = -2;
+ atColumn = 0;
+
+ QString implFile = findSourceFile();
+
+ m_backgroundParser->lock();
+ TranslationUnitAST* translationUnit = *m_backgroundParser->translationUnit( m_activeFileName );
+ if ( translationUnit )
+ {
+ bool fail = false;
+ unsigned int line, column;
+ m_activeViewCursor->cursorPositionReal( &line, &column );
+
+ AST* currentNode = findNodeAt( translationUnit, line, column );
+ DeclaratorAST* declarator = 0;
+ while ( currentNode && currentNode->nodeType() != NodeType_SimpleDeclaration )
+ {
+ if ( currentNode->nodeType() == NodeType_Declarator )
+ declarator = ( DeclaratorAST* ) currentNode;
+ currentNode = currentNode->parent();
+ }
+ SimpleDeclarationAST* decl = currentNode ? ( SimpleDeclarationAST* ) currentNode : 0;
+
+ if ( decl && decl->storageSpecifier() && decl->storageSpecifier()->text().contains("friend") )
+ {
+ kdDebug(9007) << "this is a friend declaration, don't create any definition" << endl;
+ fail = true;
+ }
+
+ if ( !fail && decl && decl->initDeclaratorList() && !declarator )
+ {
+ InitDeclaratorAST * i = decl->initDeclaratorList() ->initDeclaratorList().at( 0 );
+ if ( i )
+ declarator = i->declarator();
+ }
+
+ if ( !fail && decl && declarator && declarator->parameterDeclarationClause() )
+ {
+
+ QStringList scope;
+ scopeOfNode( decl, scope );
+
+ QString scopeStr = scope.join( "::" );
+ if ( !scopeStr.isEmpty() )
+ scopeStr += "::";
+
+ QString declStr = declaratorToString( declarator, scopeStr ).simplifyWhiteSpace();
+ if ( declarator->exceptionSpecification() )
+ {
+ declStr += QString::fromLatin1( " throw( " );
+ QPtrList<AST> l = declarator->exceptionSpecification() ->nodeList();
+ QPtrListIterator<AST> type_it( l );
+ while ( type_it.current() )
+ {
+ declStr += type_it.current() ->text();
+ ++type_it;
+
+ if ( type_it.current() )
+ declStr += QString::fromLatin1( ", " );
+ }
+
+ declStr += QString::fromLatin1( " )" );
+ }
+
+ text += "\n\n";
+ QString type = typeSpecToString( decl->typeSpec() );
+ text += type;
+ if ( !type.isNull() )
+ text += + " ";
+
+ text += declStr + "\n{\n}";
+ }
+
+ if ( !fail )
+ {
+ translationUnit = *m_backgroundParser->translationUnit( implFile );
+ if ( translationUnit )
+ translationUnit->getEndPosition( &atLine, &atColumn );
+ }
+
+ kdDebug( 9007 ) << "at line in mm: " << atLine << endl;
+ }
+ m_backgroundParser->unlock();
+}
+
+void CppSupportPart::slotMakeMember()
+{
+ QString text;
+ int atColumn, atLine;
+ MakeMemberHelper( text, atLine, atColumn );
+
+ if ( !text.isEmpty() )
+ {
+ QString implFile = findSourceFile();
+
+ if ( !implFile.isEmpty() )
+ {
+ partController() ->editDocument( KURL( implFile ) );
+ kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 500 );
+ }
+ if ( atLine == -2 )
+ atLine = m_activeEditor->numLines() - 1;
+
+ m_backgroundParser->lock ()
+ ;
+
+ kdDebug( 9007 ) << "at line in mm: " << atLine << " atCol: " << atColumn << endl;
+ kdDebug( 9007 ) << "text: " << text << endl;
+ if ( m_activeEditor )
+ m_activeEditor->insertText( atLine, atColumn, text );
+ if ( m_activeViewCursor )
+ m_activeViewCursor->setCursorPositionReal( atLine + 3, 1 );
+
+ m_backgroundParser->unlock();
+ }
+}
+
+QStringList CppSupportPart::subclassWidget( const QString& formName )
+{
+ QStringList newFileNames;
+ SubclassingDlg *dlg = new SubclassingDlg( this, formName, newFileNames );
+ dlg->exec();
+ return newFileNames;
+}
+
+QStringList CppSupportPart::updateWidget( const QString& formName, const QString& fileName )
+{
+ QStringList dummy;
+ SubclassingDlg *dlg = new SubclassingDlg( this, formName, fileName, dummy );
+ dlg->exec();
+ return dummy;
+}
+
+void CppSupportPart::partRemoved( KParts::Part* part )
+{
+ kdDebug( 9032 ) << "CppSupportPart::partRemoved()" << endl;
+
+ if ( KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( part ) )
+ {
+
+ QString fileName = doc->url().path();
+ if ( !isValidSource( fileName ) )
+ return ;
+
+ QString canonicalFileName = URLUtil::canonicalPath( fileName );
+ m_backgroundParser->removeFile( canonicalFileName );
+ m_backgroundParser->addFile( canonicalFileName, true );
+ }
+}
+
+void CppSupportPart::slotProjectCompiled()
+{
+ kdDebug( 9007 ) << "CppSupportPart::slotProjectCompiled()" << endl;
+ parseProject();
+}
+
+QStringList CppSupportPart::modifiedFileList()
+{
+ QStringList lst;
+
+ QStringList fileList = m_projectFileList;
+ QStringList::Iterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ QString fileName = *it;
+ ++it;
+
+ QFileInfo fileInfo( m_projectDirectory, fileName );
+ QString path = URLUtil::canonicalPath( fileInfo.absFilePath() );
+
+ if ( !( isSource( path ) || isHeader( path ) ) )
+ continue;
+
+ QDateTime t = fileInfo.lastModified();
+
+ QMap<QString, QDateTime>::Iterator dictIt = m_timestamp.find( path );
+ if ( fileInfo.exists() && dictIt != m_timestamp.end() && *dictIt == t )
+ continue;
+
+ lst << fileName;
+ }
+
+ return lst;
+}
+
+KTextEditor::Document * CppSupportPart::findDocument( const KURL & url )
+{
+ if ( !partController() ->parts() )
+ return 0;
+
+ QPtrList<KParts::Part> parts( *partController() ->parts() );
+ QPtrListIterator<KParts::Part> it( parts );
+ while ( KParts::Part * part = it.current() )
+ {
+ KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( part );
+ if ( doc && doc->url() == url )
+ return doc;
+ ++it;
+ }
+
+ return 0;
+}
+
+void CppSupportPart::setupCatalog( )
+{
+ kdDebug( 9007 ) << "CppSupportPart::setupCatalog()" << endl;
+
+ KStandardDirs *dirs = CppSupportFactory::instance() ->dirs();
+ QStringList pcsList = dirs->findAllResources( "pcs", "*.db", false, true );
+ QStringList pcsIdxList = dirs->findAllResources( "pcs", "*.idx", false, true );
+
+ QStringList enabledPCSs;
+ if ( DomUtil::elementByPath( *project() ->projectDom(), "kdevcppsupport/references" ).isNull() )
+ {
+ for ( QStringList::Iterator it = pcsList.begin(); it != pcsList.end(); ++it )
+ {
+ kdDebug( 9007 ) << "CppSupportPart::setupCatalog()1 " << *it << endl;
+ enabledPCSs.push_back( QFileInfo( *it ).baseName(true) );
+ }
+ }
+ else
+ {
+ enabledPCSs = DomUtil::readListEntry( *project() ->projectDom(), "kdevcppsupport/references", "pcs" );
+ }
+
+ QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix";
+
+ if ( pcsList.size() && pcsVersion() < KDEV_DB_VERSION )
+ {
+ QStringList l = pcsList + pcsIdxList;
+ int rtn = KMessageBox::questionYesNoList( 0, i18n( "Persistent class store will be disabled: you have a wrong version of pcs installed.\nRemove old pcs files?" ), l, i18n( "C++ Support" ), KStdGuiItem::del(), KStdGuiItem::cancel() );
+ if ( rtn == KMessageBox::Yes )
+ {
+ QStringList::Iterator it = l.begin();
+ while ( it != l.end() )
+ {
+ QFile::remove
+ ( *it );
+ ++it;
+ }
+ // @todo regenerate the pcs list
+ pcsList.clear();
+ }
+ else
+ {
+ return ;
+ }
+ }
+
+ QStringList::Iterator it = pcsList.begin();
+ while ( it != pcsList.end() )
+ {
+ kdDebug( 9007 ) << "CppSupportPart::setupCatalog()2 " << *it << endl;
+ Catalog * catalog = new Catalog();
+ catalog->open( *it );
+ catalog->setEnabled( enabledPCSs.contains( QFileInfo( *it ).baseName(true) ) );
+ ++it;
+
+ for ( QStringList::Iterator idxIt = indexList.begin(); idxIt != indexList.end(); ++idxIt )
+ catalog->addIndex( ( *idxIt ).utf8() );
+
+ m_catalogList.append( catalog );
+ codeRepository() ->registerCatalog( catalog );
+ }
+
+ setPcsVersion( KDEV_DB_VERSION );
+}
+
+KMimeType::List CppSupportPart::mimeTypes( )
+{
+ QStringList mimeList;
+ mimeList += m_headerMimeTypes;
+ mimeList += m_sourceMimeTypes;
+
+ KMimeType::List list;
+ for ( QStringList::Iterator it = mimeList.begin(); it != mimeList.end(); ++it )
+ {
+ if ( KMimeType::Ptr mime = KMimeType::mimeType( *it ) )
+ list << mime;
+ }
+
+ return list;
+}
+
+int CppSupportPart::pcsVersion()
+{
+ KConfig * config = CppSupportFactory::instance() ->config();
+ KConfigGroupSaver cgs( config, "PCS" );
+ return config->readNumEntry( "Version", 0 );
+}
+
+void CppSupportPart::setPcsVersion( int version )
+{
+ KConfig * config = CppSupportFactory::instance() ->config();
+ KConfigGroupSaver cgs( config, "PCS" );
+ config->writeEntry( "Version", version );
+ config->sync();
+}
+
+QString CppSupportPart::formatTag( const Tag & inputTag )
+{
+ Tag tag = inputTag;
+
+ switch ( tag.kind() )
+ {
+ case Tag::Kind_Namespace:
+ return QString::fromLatin1( "namespace " ) + tag.name();
+
+ case Tag::Kind_Class:
+ return QString::fromLatin1( "class " ) + tag.name();
+
+ case Tag::Kind_Function:
+ case Tag::Kind_FunctionDeclaration:
+ {
+ CppFunction<Tag> tagInfo( tag );
+ return tagInfo.name() + "( " + tagInfo.arguments().join( ", " ) + " ) : " + tagInfo.type();
+ }
+ break;
+
+ case Tag::Kind_Variable:
+ case Tag::Kind_VariableDeclaration:
+ {
+ CppVariable<Tag> tagInfo( tag );
+ return tagInfo.name() + " : " + tagInfo.type();
+ }
+ break;
+ }
+ return tag.name();
+}
+
+void CppSupportPart::codeCompletionConfigStored( )
+{
+ if ( m_projectClosing ) return;
+ updateParserConfiguration();
+ /*
+ m_backgroundParser->updateParserConfiguration();
+
+ KDevDriver* d = dynamic_cast<KDevDriver*>( m_driver ); //The foreground-parse isn't used anymore, and could be removed
+ if( d ) {
+ d->setup();
+ d->makeMacrosPersistent();
+ }*/
+ partController() ->setActivePart( partController()->activePart() );
+}
+
+void CppSupportPart::splitHeaderSourceConfigStored( )
+{
+ QString o = splitHeaderSourceConfig()->orientation();
+ if ( o == "Vertical" )
+ emit splitOrientationChanged( Qt::Vertical );
+ else if ( o == "Horizontal" )
+ emit splitOrientationChanged( Qt::Horizontal );
+}
+
+void CppSupportPart::removeWithReferences( const QString & fileName )
+{
+kdDebug( 9007 ) << "remove with references: " << fileName << endl;
+ m_timestamp.remove( fileName );
+ if ( !codeModel() ->hasFile( fileName ) )
+ return ;
+
+ emit aboutToRemoveSourceInfo( fileName );
+
+ codeModel() ->removeFile( codeModel() ->fileByName( fileName ) );
+}
+
+bool CppSupportPart::isValidSource( const QString& fileName ) const
+{
+ QFileInfo fileInfo( fileName );
+ QString path = URLUtil::canonicalPath( fileInfo.absFilePath() );
+
+ return /*project() && project() ->isProjectFile( path )
+ &&*/ ( isSource( path ) || isHeader( path ) )
+ && !QFile::exists( fileInfo.dirPath( true ) + "/.kdev_ignore" );
+}
+
+QString CppSupportPart::formatModelItem( const CodeModelItem *item, bool shortDescription )
+{
+ if ( item->isFunction() || item->isFunctionDefinition() )
+ {
+ const FunctionModel * model = static_cast<const FunctionModel*>( item );
+ QString function;
+ QString args;
+ ArgumentList argumentList = model->argumentList();
+ for ( ArgumentList::const_iterator it = argumentList.begin(); it != argumentList.end(); ++it )
+ {
+ args.isEmpty() ? args += "" : args += ", " ;
+ args += formatModelItem( ( *it ).data() );
+ }
+ if ( !shortDescription )
+ function += ( model->isVirtual() ? QString( "virtual " ) : QString( "" ) ) + model->resultType() + " ";
+
+ function += model->name() + "(" + args + ")" + ( model->isConstant() ? QString( " const" ) : QString( "" ) ) +
+ ( model->isAbstract() ? QString( " = 0" ) : QString( "" ) );
+
+ return function;
+ }
+ else if ( item->isVariable() )
+ {
+ const VariableModel * model = static_cast<const VariableModel*>( item );
+ if ( shortDescription )
+ return model->name();
+ return model->type() + " " + model->name();
+ }
+ else if ( item->isArgument() )
+ {
+ const ArgumentModel * model = static_cast<const ArgumentModel*>( item );
+ QString arg;
+ if ( !shortDescription )
+ arg += model->type() + " ";
+ arg += model->name();
+ if ( !shortDescription )
+ arg += model->defaultValue().isEmpty() ? QString( "" ) : QString( " = " ) + model->defaultValue();
+ return arg.stripWhiteSpace();
+ }
+ else
+ return KDevLanguageSupport::formatModelItem( item, shortDescription );
+}
+
+void CppSupportPart::addClass()
+{
+ slotNewClass();
+}
+
+void CppSupportPart::saveProjectSourceInfo()
+{
+ const FileList fileList = codeModel() ->fileList();
+
+ if ( !project() || fileList.isEmpty() )
+ return ;
+
+ QFile f( project() ->projectDirectory() + "/"
+ + project() ->projectName() + ".kdevelop.pcs" );
+ if ( !f.open( IO_WriteOnly ) )
+ return ;
+
+ m_backgroundParser->lock();
+
+ createIgnorePCSFile();
+
+ QDataStream stream( &f );
+ QMap<QString, uint> offsets;
+
+ QString pcs( "PCS" );
+ stream << pcs << KDEV_PCS_VERSION;
+
+ stream << int( fileList.size() );
+ for ( FileList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ const FileDom dom = ( *it );
+ stream << dom->name() << m_timestamp[ dom->name() ].toTime_t();
+ if( m_timestamp.find( dom->name() ) == m_timestamp.end() ) {
+ kdDebug( 9007 ) << dom->name() << ": timestamp is missing " << endl;
+ }
+ offsets.insert( dom->name(), stream.device() ->at() );
+ stream << ( uint ) 0; // dummy offset
+ }
+
+ for ( FileList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ const FileDom dom = ( *it );
+ int offset = stream.device() ->at();
+
+ dom->write( stream );
+
+ int end = stream.device() ->at();
+
+ stream.device() ->at( offsets[ dom->name() ] );
+ stream << offset;
+ stream.device() ->at( end );
+ }
+
+ QFile::remove( project() ->projectDirectory() + "/"
+ + project() ->projectName() + ".kdevelop.ignore_pcs" );
+ QFile::remove( project() ->projectDirectory() + "/"
+ + project() ->projectName().lower() + ".kdevelop.ignore_pcs" );
+
+ m_backgroundParser->unlock();
+}
+
+QString CppSupportPart::extractInterface( const ClassDom& klass )
+{
+ QString txt;
+ QTextStream stream( &txt, IO_WriteOnly );
+
+ QString name = klass->name() + "Interface";
+ QString ind;
+ ind.fill( QChar( ' ' ), 4 );
+
+ stream
+ << "class " << name << "\n"
+ << "{" << "\n"
+ << "public:" << "\n"
+ << ind << name << "() {}" << "\n"
+ << ind << "virtual ~" << name << "() {}" << "\n"
+ << "\n";
+
+ const FunctionList functionList = klass->functionList();
+ for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it )
+ {
+ const FunctionDom& fun = *it;
+
+ if ( !fun->isVirtual() || fun->name().startsWith( "~" ) )
+ continue;
+
+ stream << ind << formatModelItem( fun );
+ if ( !fun->isAbstract() )
+ stream << " = 0";
+
+ stream << ";\n";
+ }
+
+ stream
+ << "\n"
+ << "private:" << "\n"
+ << ind << name << "( const " << name << "& source );" << "\n"
+ << ind << "void operator = ( const " << name << "& source );" << "\n"
+ << "};" << "\n\n";
+
+ return txt;
+}
+
+void CppSupportPart::slotExtractInterface( )
+{
+ if ( !m_activeClass )
+ return ;
+
+ QFileInfo fileInfo( m_activeClass->fileName() );
+ QString ifaceFileName = fileInfo.dirPath( true ) + "/" + m_activeClass->name().lower() + "_interface.h";
+ if ( QFile::exists( ifaceFileName ) )
+ {
+ KMessageBox::error( mainWindow() ->main(), i18n( "File %1 already exists" ).arg( ifaceFileName ),
+ i18n( "C++ Support" ) );
+ }
+ else
+ {
+ QString text = extractInterface( m_activeClass );
+
+ QFile f( ifaceFileName );
+ if ( f.open( IO_WriteOnly ) )
+ {
+ QTextStream stream( &f );
+ stream
+ << "#ifndef __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n"
+ << "#define __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n"
+ << "\n"
+ << extractInterface( m_activeClass )
+ << "\n"
+ << "#endif // __" << m_activeClass->name().upper() << "_INTERFACE_H" << "\n";
+ f.close();
+
+ project() ->addFile( ifaceFileName );
+ }
+ }
+
+ m_activeClass = 0;
+}
+
+void CppSupportPart::gotoLine( int line )
+{
+ if ( isHeader( m_activeFileName ) )
+ {
+ KURL url;
+ url.setPath( sourceOrHeaderCandidate() );
+ partController() ->editDocument( url, line );
+ }
+ else
+ m_activeViewCursor->setCursorPositionReal( line, 0 );
+}
+
+FileDom CppSupportPart::fileByName( const QString& name) {
+ return codeModel()->fileByName( name );
+}
+
+
+int CppSupportPart::parseFilesAndDependencies( QStringList files, bool background, bool parseFirst, bool silent ) {
+ QMap<QString, int> fileGroups;
+ int nextGroup = 0;
+
+ for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) {
+ FileDom d = fileByName( *it );
+
+ QStringList lst;
+ if( !d ) {
+ lst << *it;
+ }else{
+ lst = codeModel()->getGroupStrings( d->groupId() );
+/* kdDebug( 9007 ) << "adding group of: " << *it << ":\n" << " which is " << lst.join("\n") << "\n\n";*/
+ if( lst.count() > 10 ) {
+ lst = codeModel()->getGroupStrings( d->groupId() );
+ }
+ }
+ int cgroup = nextGroup;
+ nextGroup++;
+
+ if( fileGroups.find( *it ) != fileGroups.end() )
+ cgroup = fileGroups[*it];
+
+ for( QStringList::iterator lit = lst.begin(); lit != lst.end(); ++lit )
+ fileGroups[*lit] = cgroup;
+ }
+
+ QValueVector<QStringList> groups;
+ groups.resize( nextGroup );
+
+ ///put the groups together
+ for( QMap<QString, int>::iterator it = fileGroups.begin(); it != fileGroups.end(); ++it ) {
+ groups[*it] << it.key();
+ }
+
+ for( int a = 0; a < nextGroup; a++ ) {
+ QStringList group = reorder( groups[a] );
+
+
+/* kdDebug( 9007 ) << "reparsing the following group: " << ":\n" << group.join("\n") << "\n\n";*/
+ if( background ) {
+
+ m_backgroundParser->lock();
+
+ if( !group.isEmpty() ) {
+ if( !parseFirst )
+ m_parseEmitWaiting.addGroup( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None );
+ else
+ m_parseEmitWaiting.addGroupFront( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None );
+ if( !silent ) {
+ if( !parseFirst )
+ m_fileParsedEmitWaiting.addGroup( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None );
+ else
+ m_fileParsedEmitWaiting.addGroupFront( group, silent ? ParseEmitWaiting::Silent : ParseEmitWaiting::None );
+ }
+ }
+
+ if( parseFirst && !group.empty() ) {
+ for(QStringList::iterator it = --group.end(); it != group.end(); ) {
+ backgroundParser()->addFileFront(*it);
+ if( it == group.begin() ) {
+ it = group.end();
+ } else {
+ --it;
+ }
+ }
+ } else {
+ for(QStringList::iterator it = group.begin(); it != group.end(); ++it) {
+ backgroundParser()->addFile(*it);
+ }
+ }
+
+ m_backgroundParser->unlock();
+
+ } else {
+ for(QStringList::iterator it = group.begin(); it != group.end(); ++it) {
+ m_driver->parseFile( *it );
+ }
+ }
+ }
+
+ return fileGroups.count();
+}
+
+int CppSupportPart::parseFileAndDependencies( const QString & fileName, bool background, bool parseFirst, bool silent ) {
+ if(! isValidSource( fileName ) ) return 0;
+
+// kdDebug( 9007 ) << "reparsing dependencies of " << fileName << "\n";
+
+ return parseFilesAndDependencies( fileName, background, parseFirst, silent );
+}
+
+void CppSupportPart::parseEmit( ParseEmitWaiting::Processed files ) {
+ if( files.res.isEmpty() ) return;
+
+ bool modelHasFiles = true;
+
+ for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) {
+ if( !codeModel()->hasFile( *it ) ) modelHasFiles = false;
+ }
+
+ int oldFileCount = codeModel()->fileList().count();
+
+ if( (files.flag & ParseEmitWaiting::HadErrors) && modelHasFiles && !files.hasFlag( ParseEmitWaiting::Silent ) ) {
+ mainWindow() ->statusBar() ->message( "File parsed, but not updating code-model because of errors", 2000 );
+ kdDebug( 9007 ) << "not updating code-model because at least one file has errors" << endl;
+ // for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it )
+ // m_backgroundParser->removeFile( *it );
+ } else {
+ ///update timestamps
+ for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it ) {
+ if( !codeModel()->hasFile( *it ) ) modelHasFiles = false;
+ QString& fileName = *it;
+
+ QFileInfo fileInfo( fileName );
+ QString path = URLUtil::canonicalPath( fileName );
+
+ if ( !fileInfo.exists() ) {
+ removeWithReferences( path );
+ continue ;
+ }
+
+ m_timestamp[ path ] = fileInfo.lastModified();
+ }
+
+ if( files.hasFlag( ParseEmitWaiting::Silent ) && !alwaysParseInBackground )
+ return;
+
+ m_backgroundParser->lock();
+
+ QStringList l = files.res;
+
+ QMap<QString, bool> wholeResult;
+ QStringList missing;
+
+ QMap<QString, FileDom> newFiles;
+
+ while(!l.isEmpty() ) {
+ QString fileName = l.front();
+
+ if( !m_backgroundParser->hasTranslationUnit( fileName ) ) {
+ kdDebug( 9007 ) << "error: translation-unit is missing: " << fileName << endl;
+ missing << fileName;
+ } else {
+ if ( ParsedFilePointer ast = m_backgroundParser->translationUnit( fileName ) )
+ {
+ if ( true /*!hasErrors*/ )
+ {
+ FileDom oldFile = codeModel()->fileByName( fileName );
+
+ StoreWalker walker( fileName, codeModel() );
+ walker.setOverrides( newFiles );
+
+ walker.parseTranslationUnit( *ast );
+
+ if( oldFile ) {
+ newFiles[fileName] = walker.file();
+
+ ///update timestamps
+ QFileInfo fileInfo( fileName );
+ QString path = URLUtil::canonicalPath( fileName );
+
+ m_timestamp[ path ] = fileInfo.lastModified();
+ } else {
+ codeModel() ->addFile( walker.file() );
+ }
+
+ if( walker.file() ) {
+ QStringList grp = walker.file()->wholeGroupStrings();
+ for( QStringList::const_iterator it = grp.begin(); it != grp.end(); ++it )
+ wholeResult[*it] = true;
+ }
+ }
+ } else {
+ kdDebug( 9007 ) << "failed to parse " << fileName << endl;
+ }
+ }
+
+
+ l.pop_front();
+ }
+
+ bool canUpdate = true;
+ for( QMap<QString, FileDom>::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) {
+ FileDom oldFile = codeModel()->fileByName( it.key() );
+
+ if( !oldFile || !oldFile->canUpdate( *it ) ) {
+ canUpdate = false;
+ break;
+ }
+ }
+
+ if( canUpdate ) {
+ ///Update the code-model
+ for( QMap<QString, FileDom>::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) {
+ FileDom oldFile = codeModel()->fileByName( it.key() );
+ oldFile->update( *it );
+ codeModel()->mergeGroups( oldFile->groupId(), (*it)->groupId() ); ///Merge parsing-groups together
+ }
+ } else {
+ ///Remove the current files and replace them with the new ones
+ for( QMap<QString, FileDom>::const_iterator it = newFiles.begin(); it != newFiles.end(); ++it ) {
+ removeWithReferences( it.key() );
+ codeModel()->addFile( *it );
+ }
+ }
+ /*
+ ///make the list unique
+
+ l.clear();
+ for( QMap<QString, bool>::const_iterator it = wholeResult.begin(); it != wholeResult.end(); ++it )
+ l << it.key();*/
+
+ m_backgroundParser->unlock();
+
+ if( !missing.isEmpty() ) {
+ kdDebug( 9007 ) << "error: translation-units were missing: " << missing << endl;
+ //don't reparse missing units, because it may cause the whole project to be reparsed
+ // parseFilesAndDependencies( missing, true, false, files.hasFlag( ParseEmitWaiting::Silent ) );
+ }
+
+ if( files.hasFlag( ParseEmitWaiting::Silent ) ) {
+ if( alwaysParseInBackground )
+ for( QStringList::iterator it = files.res.begin(); it != files.res.end(); ++it )
+ m_backgroundParser->removeFile( *it );
+ } else {
+ if( !canUpdate ) { ///If the current model could be updated, do not emit addedSourceInfo(..) and remove the units from the parser, because nobody will be using them
+ QStringList l = files.res;
+ while(!l.isEmpty() ) {
+ emit aboutToRemoveSourceInfo( l.front() );
+ emit removedSourceInfo( l.front() );
+ emit addedSourceInfo( l.front() );
+ l.pop_front();
+ }
+
+ if( !files.hasFlag( ParseEmitWaiting::Silent ) )
+ emitFileParsed( files );
+ } else {
+ QStringList l = files.res;
+ while( !l.isEmpty() ) {
+ emit codeModelUpdated( l.front() );
+ emit aboutToRemoveSourceInfo( l.front() );
+ emit removedSourceInfo( l.front() );
+ emit addedSourceInfo( l.front() );
+ l.pop_front();
+ }
+ }
+ }
+ kdDebug( 9007 ) << "files in code-model after parseEmit: " << codeModel()->fileList().count() << " before: " << oldFileCount << endl;
+ }
+}
+
+/*void CppSupportPart::recomputeCodeModel( const QString& fileName )
+{*/
+
+//}
+
+void CppSupportPart::emitSynchronousParseReady( const QString& file, ParsedFilePointer unit ) {
+ emit synchronousParseReady( file, unit );
+}
+
+void CppSupportPart::emitFileParsed( QStringList l )
+{
+ while( !l.isEmpty() ) {
+ emit fileParsed( l.front() );
+ l.pop_front();
+ }
+}
+
+bool CppSupportPart::isHeader( const QString& fileName ) const
+{
+ /*KMimeType::Ptr ptr = KMimeType::findByPath( fileName );
+ if ( ptr && m_headerMimeTypes.contains( ptr->name() ) )
+ return true;*/
+
+ return ( m_headerExtensions.findIndex( QFileInfo( fileName ).extension() ) != -1 );
+}
+
+bool CppSupportPart::isSource( const QString& fileName ) const
+{
+ /*KMimeType::Ptr ptr = KMimeType::findByPath( fileName );
+ if ( ptr && m_sourceMimeTypes.contains( ptr->name() ) )
+ return true;*/
+
+ return ( m_sourceExtensions.findIndex( QFileInfo( fileName ).extension() ) != -1 );
+}
+
+void CppSupportPart::gotoDeclarationLine( int line )
+{
+ if ( isHeader( m_activeFileName ) )
+ m_activeViewCursor->setCursorPositionReal( line, 0 );
+ else
+ {
+ KURL url;
+ url.setPath( sourceOrHeaderCandidate() );
+ partController() ->editDocument( url, line );
+ }
+}
+
+void CppSupportPart::removeCatalog( const QString & dbName )
+{
+ if ( !QFile::exists( dbName ) )
+ return ;
+
+ QValueList<Catalog*> catalogs = codeRepository() ->registeredCatalogs();
+ Catalog* c = 0;
+ for ( QValueList<Catalog*>::Iterator it = catalogs.begin(); it != catalogs.end(); ++it )
+ {
+ if ( ( *it ) ->dbName() == dbName )
+ {
+ c = *it;
+ break;
+ }
+ }
+
+ if ( c )
+ {
+ codeRepository() ->unregisterCatalog( c );
+ m_catalogList.remove( c );
+ }
+
+ QFileInfo fileInfo( dbName );
+ QDir dir( fileInfo.dir( true ) );
+ QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix";
+ for(QStringList::Iterator iter = indexList.begin(); iter != indexList.end(); iter++)
+ {
+ QStringList fileList = dir.entryList( fileInfo.baseName(true) +"." +(*iter) + ".idx" );
+ for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString idxName = fileInfo.dirPath( true ) + "/" + *it;
+ kdDebug( 9007 ) << "=========> remove db index: " << idxName << endl;
+ dir.remove( *it );
+ }
+ }
+ dir.remove( fileInfo.fileName() );
+}
+
+void CppSupportPart::addCatalog( Catalog * catalog )
+{
+ m_catalogList.append( catalog );
+ codeRepository() ->registerCatalog( catalog );
+}
+
+FunctionDefinitionDom CppSupportPart::functionDefinitionAt( int line, int column )
+{
+ if ( !codeModel() ->hasFile( m_activeFileName ) )
+ return FunctionDefinitionDom();
+
+ CodeModelUtils::CodeModelHelper h( codeModel(), codeModel()->fileByName( m_activeFileName ) );
+
+ FunctionDom d = h.functionAt( line, column, CodeModelUtils::CodeModelHelper::Definition );
+ if( d ) {
+ FunctionDefinitionModel* m = dynamic_cast<FunctionDefinitionModel*>( d.data() );
+ if( m ) return FunctionDefinitionDom( m );
+ }
+ return FunctionDefinitionDom();
+}
+
+FunctionDefinitionDom CppSupportPart::currentFunctionDefinition( )
+{
+ if ( !this->m_activeViewCursor )
+ return FunctionDefinitionDom();
+
+ unsigned int line, column;
+ this->m_activeViewCursor->cursorPositionReal( &line, &column );
+ return functionDefinitionAt( line, column );
+}
+
+void CppSupportPart::slotCursorPositionChanged()
+{
+ if ( codeCompletion() )
+ {
+ unsigned int line = 0;
+ unsigned int column = 0;
+ if ( KDevEditorUtil::currentPositionReal( &line, &column, dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) ) )
+ {
+ QString typeInfoString = codeCompletion()->createTypeInfoString( line, column );
+ mainWindow()->statusBar()->message( typeInfoString );
+ }
+ }
+
+ // m_functionHintTimer->changeInterval( 1000 );
+ if ( splitHeaderSourceConfig()->splitEnabled()
+ && splitHeaderSourceConfig()->autoSync() )
+ slotSwitchHeader( true );
+}
+
+/*
+void CppSupportPart::slotFunctionHint( )
+{
+ kdDebug( 9007 ) << "=======> compute current function definition" << endl;
+// m_functionHintTimer->stop();
+ if ( FunctionDefinitionDom fun = currentFunctionDefinition() )
+ {
+ QStringList scope = fun->scope();
+ QString funName = scope.join( "::" );
+ if ( !funName.isEmpty() )
+ funName += "::";
+
+ funName += formatModelItem( fun, true );
+
+ mainWindow() ->statusBar() ->message( funName, 2000 );
+ }
+}
+*/
+
+void CppSupportPart::createIgnorePCSFile( )
+{
+ static QCString skip_me( "ignore me\n" );
+
+ QString skip_file_name = project() ->projectDirectory() + "/"
+ + project() ->projectName() + ".kdevelop.ignore_pcs";
+ QFile skip_pcs_file( skip_file_name );
+ if ( skip_pcs_file.open( IO_WriteOnly ) )
+ {
+ skip_pcs_file.writeBlock( skip_me );
+ skip_pcs_file.close();
+ }
+}
+
+QString CppSupportPart::specialHeaderName( bool local ) const
+{
+ if ( local )
+ return ::locateLocal( "data", "kdevcppsupport/configuration", CppSupportFactory::instance() );
+
+ return ::locate( "data", "kdevcppsupport/configuration", CppSupportFactory::instance() );
+}
+
+void CppSupportPart::updateParserConfiguration()
+{
+ m_backgroundParser->updateParserConfiguration();
+
+ QString conf_file_name = specialHeaderName();
+
+ m_driver->removeAllMacrosInFile( conf_file_name );
+ dynamic_cast<KDevDriver*>(m_driver)->setup();
+ m_driver->parseFile( conf_file_name, true, true, true );
+
+ m_buildSafeFileSetTimer->start( 500, true );
+ parseProject( true );
+}
+
+const Driver* CppSupportPart::driver() const {
+ return m_driver;
+}
+
+Driver* CppSupportPart::driver() {
+ return m_driver;
+}
+
+KDevDesignerIntegration * CppSupportPart::designer( KInterfaceDesigner::DesignerType type )
+{
+ KDevDesignerIntegration * des = 0;
+ switch ( type )
+ {
+ case KInterfaceDesigner::Glade:
+ case KInterfaceDesigner::QtDesigner:
+ des = m_designers[ type ];
+ if ( des == 0 )
+ {
+ CppImplementationWidget * impl = new CppImplementationWidget( this );
+ des = new QtDesignerCppIntegration( this, impl );
+ des->loadSettings( *project() ->projectDom(), "kdevcppsupport/designerintegration" );
+ m_designers[ type ] = des;
+ }
+ break;
+ }
+ return des;
+}
+
+
+void CppSupportPart::resetParserStoreTimer() {
+ // m_deleteParserStoreTimer->start(10000); ///try to empty the store regularly
+}
+
+void CppSupportPart::slotDeleteParserStore() {
+ /* if( !m_backgroundParser->filesInQueue() )
+ m_backgroundParser->removeAllFiles();
+ else
+ resetParserStoreTimer();*/
+}
+
+
+void CppSupportPart::slotCreateSubclass()
+{
+ QFileInfo fi( m_contextFileName );
+ if ( fi.extension( false ) != "ui" )
+ return ;
+ QtDesignerCppIntegration *des = dynamic_cast<QtDesignerCppIntegration*>( designer( KInterfaceDesigner::QtDesigner ) );
+ if ( des )
+ des->selectImplementation( m_contextFileName );
+}
+
+void CppSupportPart::addMethod( ClassDom aClass, const QString& name, const QString type,
+ const QString& parameters, CodeModelItem::Access accessType,
+ bool isConst, bool isInline, bool isVirtual, bool isPureVirtual,
+ const QString& implementation )
+{
+ partController() ->editDocument( KURL( aClass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( partController() ->activePart() );
+ if ( !editIface )
+ {
+ /// @fixme show messagebox
+ return ;
+ }
+ QString declarationString = type + " " + name + "(" + parameters + ")" + ( isConst ? " const" : "" );
+
+ KDevSourceFormatter* sourceFormatter = extension<KDevSourceFormatter>( "KDevelop/SourceFormatter" );
+
+ QString finalDeclaration = ( ( isVirtual || isPureVirtual ) ? "\nvirtual " : "\n" + declarationString +
+ ( isPureVirtual ? " = 0 " : "" ) +
+ ( isInline ? "\n{\n" + implementation + "\n}\n" : ";" ) );
+
+ if ( sourceFormatter != 0 )
+ finalDeclaration = sourceFormatter->formatSource( finalDeclaration );
+
+ QString indentString = "\t";
+
+ if ( sourceFormatter != 0 )
+ indentString = sourceFormatter->indentString();
+
+ editIface->insertText( findInsertionLineMethod( aClass, accessType ), 0,
+ finalDeclaration.replace( "\n", "\n\t" ) + "\n" );
+
+ backgroundParser() ->addFile( aClass->fileName() );
+ if ( isInline || isPureVirtual )
+ return ;
+
+ // construct fully qualified name for method definition
+ QString fullyQualifiedName = aClass->scope().join("::");
+ if (! fullyQualifiedName.isEmpty())
+ {
+ fullyQualifiedName += "::";
+ }
+ fullyQualifiedName += aClass->name() + "::" + name;
+
+ QString definitionString = "\n" + type + " " + fullyQualifiedName + "(" + parameters + ")" + ( isConst ? " const" : "" ) + "\n{\n" + implementation + "\n}\n";
+
+ if ( sourceFormatter != 0 )
+ definitionString = sourceFormatter->formatSource( definitionString );
+
+ QFileInfo info( aClass->fileName() );
+ QString implementationFile = info.dirPath( true ) + "/" + info.baseName() + ".cpp" ;
+ QFileInfo fileInfo( implementationFile );
+ KDevCreateFile* createFileSupport = extension<KDevCreateFile>( "KDevelop/CreateFile" );
+ if ( !QFile::exists( fileInfo.absFilePath() ) && createFileSupport != 0 )
+ createFileSupport->createNewFile( fileInfo.extension(), fileInfo.dirPath( true ), fileInfo.baseName() );
+
+ partController() ->editDocument( KURL( implementationFile ) );
+ editIface = dynamic_cast<KTextEditor::EditInterface*>( partController() ->activePart() );
+ if ( !editIface )
+ return ; //@fixme errorverdoedelung
+
+ editIface->insertLine( editIface->numLines(), QString::fromLatin1( "" ) );
+ editIface->insertText( editIface->numLines() - 1, 0, definitionString );
+ backgroundParser() ->addFile( implementationFile );
+}
+
+ClassDom CppSupportPart::currentClass( ) const
+{
+ FileDom file = codeModel() ->fileByName( m_activeFileName );
+ if ( file == 0 || m_activeViewCursor == 0 )
+ return 0;
+
+ unsigned int curLine, curCol;
+ m_activeViewCursor->cursorPositionReal( &curLine, &curCol );
+
+ CodeModelUtils::CodeModelHelper h( codeModel(), file );
+
+ return h.classAt( curLine, curCol );
+}
+
+VariableDom CppSupportPart::currentAttribute( ClassDom curClass ) const
+{
+ if ( m_activeViewCursor == 0 || curClass == 0 )
+ return 0;
+
+ unsigned int line, col;
+ m_activeViewCursor->cursorPositionReal( &line, &col );
+
+ VariableList vars = curClass->variableList();
+
+ for ( VariableList::iterator i = vars.begin(); i != vars.end(); ++i )
+ {
+ int startLine, startCol;
+ ( *i ) ->getStartPosition( &startLine, &startCol );
+ if ( startLine < (int)line || ( startLine == (int)line && startCol <= (int)col ) )
+ {
+ int endLine, endCol;
+ ( *i ) ->getEndPosition( &endLine, &endCol );
+ if ( endLine > (int)line || ( endLine == (int)line && endCol >= (int)col ) )
+ return * i;
+ }
+ }
+ return 0;
+}
+
+void CppSupportPart::slotCreateAccessMethods( )
+{
+ if ( m_curAttribute == 0 || m_curClass == 0 )
+ return ;
+
+ CreateGetterSetterDialog dlg ( this, m_curClass, m_curAttribute );
+ dlg.exec();
+}
+
+int CppSupportPart::findInsertionLineMethod( ClassDom aClass, CodeModelItem::Access access )
+{
+ int line, column;
+ aClass->getEndPosition( &line, &column );
+
+ int point = CodeModelUtils::findLastMethodLine( aClass, access );
+
+ if ( point == -1 )
+ {
+ KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( partController() ->activePart() );
+ if ( !editIface )
+ return -1;
+
+ editIface->insertLine( line - 1, CodeModelUtils::accessSpecifierToString( access ) + ":\n" );
+ return line;
+ }
+
+ return point + 1;
+}
+
+int CppSupportPart::findInsertionLineVariable( ClassDom aClass, CodeModelItem::Access access )
+{
+ int line, column;
+ aClass->getEndPosition( &line, &column );
+
+ int point = CodeModelUtils::findLastVariableLine( aClass, access );
+
+ if ( point == -1 )
+ {
+ KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( partController() ->activePart() );
+ if ( !editIface )
+ return -1;
+
+ editIface->insertLine( line - 1, CodeModelUtils::accessSpecifierToString( access ) + ":\n" );
+ return line;
+ }
+
+ return point;
+}
+
+void CppSupportPart::createAccessMethods( ClassDom theClass, VariableDom theVariable )
+{
+ m_curClass = theClass;
+ m_curAttribute = theVariable;
+
+ slotCreateAccessMethods();
+}
+
+void CppSupportPart::slotCursorMoved()
+{
+ m_cursorMovedTimer->start( 250, true );
+}
+
+void CppSupportPart::slotTextChanged()
+{
+ setTyping( true ); ///@todo check if this is really needed
+
+ if ( m_backgroundParserConfig->useBackgroundParser() )
+ {
+ m_textChangedTimer->start( m_backgroundParserConfig->backgroudParseDelay(), true );
+ }
+}
+
+void CppSupportPart::slotParseCurrentFile()
+{
+ if( isValid() && !isQueued( m_activeFileName ) )
+ {
+ parseFileAndDependencies( m_activeFileName, true, true );
+ }
+}
+
+void CppSupportPart::updateBackgroundParserConfig()
+{
+ BackgroundParserConfig config;
+ config.readConfig();
+
+ if ( m_backgroundParserConfig->useProblemReporter() && !config.useProblemReporter() )
+ {
+ removeProblemReporter();
+ }
+ else if ( !m_backgroundParserConfig->useProblemReporter() && config.useProblemReporter() )
+ {
+ embedProblemReporter( true );
+ }
+
+ *m_backgroundParserConfig = config;
+}
+
+const SynchronizedFileSet& CppSupportPart::safeFileSet() const {
+ return m_safeProjectFiles;
+}
+
+SynchronizedFileSet& CppSupportPart::safeFileSet() {
+ return m_safeProjectFiles;
+}
+
+void CppSupportPart::buildSafeFileSet() {
+ if( codeCompletion() == 0 ) //probably the project has already been closed
+ return;
+ SynchronizedFileSet::SetType files; //everything that goes into this set must be deep-copied
+
+ kdDebug( 9007 ) << "CppSupportPart:: rebuilding safe-file-set" << endl;
+ for( QStringList::const_iterator it = m_projectFileList.begin(); it != m_projectFileList.end(); ++it ) {
+ QFileInfo fi( *it );
+ QString file = *it;
+ if( fi.isRelative() ) {
+ fi.setFile( QDir(m_projectDirectory), *it );
+ file = fi.absFilePath();
+ }
+
+ //deep-copy
+ files.insert( QString::fromUtf8(file.utf8()) );
+ }
+
+ ///Now get all translation-units from the code-repository
+ QValueList<Catalog::QueryArgument> args;
+
+ args << Catalog::QueryArgument( "kind", Tag::Kind_TranslationUnit );
+
+ QValueList<Tag> tags( codeCompletion()->repository()->query( args ) );
+
+ for( QValueList<Tag>::const_iterator it = tags.begin(); it != tags.end(); ++it ) {
+ files.insert( (*it).fileName() + "||" + (*it).attribute("macroValueHash").toString() + "||" + (*it).attribute("macroIdHash").toString() );
+ }
+ m_safeProjectFiles.setFiles( files );
+}
+
+void CppSupportPart::addToRepository( ParsedFilePointer file ) {
+ QString catalogString( "automatic_" + KURL::encode_string_no_slash(m_projectDirectory) );
+
+ KStandardDirs *dirs = CppSupportFactory::instance() ->dirs();
+
+ QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + catalogString + ".db";
+
+ Catalog* catalog = 0;
+ ///First check if the catalog is already there
+ QValueList<Catalog*> catalogs = codeRepository()->registeredCatalogs();
+ for( QValueList<Catalog*>::const_iterator it = catalogs.begin(); it != catalogs.end(); ++it ) {
+ if( (*it)->dbName() == dbName ) {
+ catalog = *it;
+ break;
+ }
+ }
+
+ if( !catalog ) {
+ kdDebug( 9007 ) << "creating new catalog named " << catalogString << " for automatic filling" << endl;
+ //QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName" << "prefix";
+ catalog = new Catalog;
+ catalog->open( dbName );
+ catalog->addIndex( "kind" );
+ catalog->addIndex( "name" );
+ catalog->addIndex( "scope" );
+ catalog->addIndex( "prefix" );
+ catalog->addIndex( "fileName" );
+ /*
+ for ( QStringList::Iterator idxIt = indexList.begin(); idxIt != indexList.end(); ++idxIt )
+ catalog->addIndex( ( *idxIt ).utf8() );*/
+ addCatalog( catalog );
+ }
+ catalog->setEnabled( true );
+
+ ///Now check if the file was already parsed with the same parameters, if yes don't parse again(auto-update is currently not supported, when major changes have been done in the libraries, the repository should be deleted)
+ QValueList<Catalog::QueryArgument> args;
+
+ bool compatibleParsed = false;
+ Tag compatibleParsedTag;
+
+ args << Catalog::QueryArgument( "kind", Tag::Kind_TranslationUnit );
+ args << Catalog::QueryArgument( "fileName", file->fileName() );
+ QValueList<Tag> tags( catalog->query( args ) );
+ if( !tags.isEmpty() ) {
+ for( QValueList<Tag>::const_iterator it = tags.begin(); it != tags.end(); ++it ) {
+ if( (*it).hasAttribute( "cppparsedfile" ) ) {
+ QVariant v = (*it).attribute( "cppparsedfile" );
+ ///@todo reenable this
+ /*QByteArray b = v.toByteArray();
+ if( !b.isEmpty() ) {
+ //Would be much more efficient not to do this deserialization
+ ParsedFile f(b);
+ if( f.usedMacros().valueHash() == file->usedMacros().valueHash() && f.usedMacros().idHash() == file->usedMacros().idHash() && f.includeFiles().hash() == file->includeFiles().hash() ) {
+ ///Do not reparse the file, it seems to already be in the repository in a similar state
+ if( (*it).attribute( "includedFrom" ).toString() == file->includedFrom() ) return;
+
+ ///It is probable that the same state has already been parsed, but there seems to be no such tag yet(the tag will be added)
+ compatibleParsed = true;
+ compatibleParsedTag = *it;
+ break;
+ }
+ }*/
+ }
+ }
+ }
+
+ if( compatibleParsed ) {
+ ///Add a Tag that makes sure that the file will not be parsed again
+ compatibleParsedTag.setAttribute( "includedFrom", file->includedFrom() );
+ QByteArray data;
+ QDataStream s( data, IO_WriteOnly );
+ file->write( s );
+ compatibleParsedTag.setAttribute( "cppparsedfile", data );
+ catalog->addItem( compatibleParsedTag );
+ return;
+ }
+
+ kdDebug( 9007 ) << "parsing translation-unit " << file->fileName() << " into catalog " << catalogString << endl;
+ TagCreator w( file->fileName(), catalog );
+ w.parseTranslationUnit( *file );
+ codeRepository()->touchCatalog( catalog );
+
+ m_safeProjectFiles.insert( file->fileName() + "||" + QString("%1").arg(file->usedMacros().valueHash()) + "||" + QString("%1").arg(file->usedMacros().idHash()) );
+}
+
+QString CppSupportPart::findHeaderSimple( const QString &header )
+{
+ QStringList::ConstIterator it;
+ for ( it = m_projectFileList.begin(); it != m_projectFileList.end(); ++it )
+ {
+ QString s = *it;
+ if (s == header)
+ return s;
+ if ( ( s.right( header.length() ) == header ) && ( s[s.length() - header.length() - 1] == '/' ) )
+ return s;
+ }
+
+ return QString::null;
+}
+
+UIBlockTester::UIBlockTesterThread::UIBlockTesterThread( UIBlockTester& parent ) : QThread(), m_parent( parent ), m_stop(false) {
+}
+
+void UIBlockTester::UIBlockTesterThread::run() {
+ while(!m_stop) {
+ msleep( m_parent.m_msecs / 10 );
+ m_parent.m_timeMutex.lock();
+ QDateTime t = QDateTime::currentDateTime();
+ uint msecs = m_parent.m_lastTime.time().msecsTo( t.time() );
+ if( msecs > m_parent.m_msecs ) {
+ m_parent.lockup();
+ m_parent.m_lastTime = t;
+ }
+ m_parent.m_timeMutex.unlock();
+ }
+}
+
+void UIBlockTester::UIBlockTesterThread::stop() {
+ m_stop = true;
+}
+
+UIBlockTester::UIBlockTester( uint milliseconds ) : m_thread( *this ), m_msecs( milliseconds ) {
+ m_timer = new QTimer( this );
+ m_timer->start( milliseconds/10 );
+ connect( m_timer, SIGNAL(timeout()), this, SLOT(timer()) );
+ timer();
+ m_thread.start();
+}
+UIBlockTester::~UIBlockTester() {
+ m_thread.stop();
+ m_thread.wait();
+}
+
+void UIBlockTester::timer() {
+ m_timeMutex.lock();
+ m_lastTime = QDateTime::currentDateTime();
+ m_timeMutex.unlock();
+}
+
+void UIBlockTester::lockup() {
+ //std::cout << "UIBlockTester: lockup of the UI for " << m_msecs << endl; ///kdDebug(..) is not thread-safe..
+ int a = 1; ///Place breakpoint here
+}
+
+#include "cppsupportpart.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
diff --git a/languages/cpp/cppsupportpart.h b/languages/cpp/cppsupportpart.h
new file mode 100644
index 00000000..e01d5115
--- /dev/null
+++ b/languages/cpp/cppsupportpart.h
@@ -0,0 +1,661 @@
+/***************************************************************************
+* Copyright (C) 1999 by Jonas Nordin *
+* jonas.nordin@syncom.se *
+* Copyright (C) 2000-2001 by Bernd Gehrmann *
+* bernd@kdevelop.org *
+* Copyright (C) 2002-2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* Copyright (C) 2003-2004 by Alexander Dymo *
+* adymo@mksat.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 _CPPSUPPORTPART_H_
+#define _CPPSUPPORTPART_H_
+
+#include <kdevcore.h>
+#include <kdevlanguagesupport.h>
+
+#include <qthread.h>
+#include <qmutex.h>
+#include <qtimer.h>
+#include <kdialogbase.h>
+#include <qguardedptr.h>
+#include <qstring.h>
+#include <qwaitcondition.h>
+#include <qdatetime.h>
+#include <qdir.h>
+#include <qprogressbar.h>
+#include <kdebug.h>
+#include <ext/hash_map>
+#include "driver.h"
+
+
+///A class that helps detecting what exactly makes the UI block. To use it, just place a breakpoint on UIBlockTester::lockup() and inspect the execution-position of the main thread
+class UIBlockTester : public QObject {
+ Q_OBJECT
+ class UIBlockTesterThread : public QThread {
+ public:
+ UIBlockTesterThread( UIBlockTester& parent );
+ void run();
+ void stop();
+ private:
+ UIBlockTester& m_parent;
+ bool m_stop;
+ };
+ friend class UIBlockTesterThread;
+public:
+
+ ///@param milliseconds when the ui locks for .. milliseconds, lockup() is called
+ UIBlockTester( uint milliseconds );
+ ~UIBlockTester();
+
+private slots:
+ void timer();
+
+protected:
+ virtual void lockup();
+
+private:
+ UIBlockTesterThread m_thread;
+ QDateTime m_lastTime;
+ QMutex m_timeMutex;
+ QTimer * m_timer;
+ uint m_msecs;
+};
+
+class Context;
+class CppCodeCompletion;
+class CppCodeCompletionConfig;
+class CppSplitHeaderSourceConfig;
+class CreateGetterSetterConfiguration;
+class QtBuildConfig;
+class ProblemReporter;
+class BackgroundParser;
+class Catalog;
+class QLabel;
+class QProgressBar;
+class QStringList;
+class QListViewItem;
+class TranslationUnitAST;
+class QTimer;
+class KListView;
+class Driver;
+class KPopupMenu;
+class BackgroundParserConfig;
+class KAction;
+
+namespace KParts
+{
+ class Part;
+}
+namespace KTextEditor
+{
+ class Document;
+ class View;
+ class EditInterface;
+ class SelectionInterface;
+ class ViewCursorInterface;
+}
+
+
+class SynchronizedFileSet
+{
+public:
+ typedef __gnu_cxx::hash_set< HashedString > SetType;
+ SynchronizedFileSet()
+ {}
+
+ bool isEmpty() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileSet.empty();
+ }
+
+ uint count() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileSet.size();
+ }
+
+ void clear()
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileSet.clear();
+ }
+
+ void setFiles( const SetType& files ) {
+ QMutexLocker locker( &m_mutex );
+ m_fileSet = files;
+ }
+
+ void insert( const HashedString& str )
+ {
+ HashedString s( QString::fromUtf8(str.str().utf8()) );
+ QMutexLocker locker( &m_mutex );
+
+ m_fileSet.insert( s );
+ }
+
+ bool contains( const HashedString& str ) const {
+ QMutexLocker locker( &m_mutex );
+ return m_fileSet.find( str ) != m_fileSet.end();
+ }
+
+private:
+ mutable QMutex m_mutex;
+ SetType m_fileSet;
+};
+
+class CppSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ CppSupportPart( QObject *parent, const char *name, const QStringList &args );
+ virtual ~CppSupportPart();
+
+ bool isValid() const
+ {
+ return m_valid;
+ }
+
+ QString specialHeaderName( bool local = false ) const;
+ void updateParserConfiguration();
+ void updateBackgroundParserConfig();
+
+ // @fixme - isValid is used to avoid using the problem reporter
+ // when a project is first parsed. This because the problem reporter
+ // is currently a great slowdown for large projects (see bug #73671)
+ ProblemReporter* problemReporter() const
+ {
+ return isValid() ? static_cast<ProblemReporter *>( m_problemReporter ) : 0;
+ }
+
+ /** parses the file and all files that belong to it using the background-parser */
+ int parseFileAndDependencies( const QString& fileName, bool background = true, bool parseFirst = false, bool silent = false );
+ int parseFilesAndDependencies( QStringList files, bool background = true, bool parseFirst = false, bool silent = false );
+
+ BackgroundParser* backgroundParser() const
+ {
+ return m_backgroundParser;
+ }
+ CppCodeCompletion* codeCompletion() const
+ {
+ return m_pCompletion;
+ }
+ CppCodeCompletionConfig* codeCompletionConfig() const
+ {
+ return m_pCompletionConfig;
+ }
+ CppSplitHeaderSourceConfig* splitHeaderSourceConfig() const
+ {
+ return m_pSplitHeaderSourceConfig;
+ }
+ CreateGetterSetterConfiguration* createGetterSetterConfiguration() const
+ {
+ return m_pCreateGetterSetterConfiguration;
+ }
+
+ /**
+ Get a pointer to the QtBuildConfig object
+ @return A pointer to the QtBuildConfig object.
+ */
+ inline QtBuildConfig* qtBuildConfig() const { return m_qtBuildConfig; }
+
+ const QPtrList<Catalog>& catalogList() const
+ {
+ return m_catalogList;
+ }
+ void addCatalog( Catalog* catalog );
+ void removeCatalog( const QString& dbName );
+
+ bool isValidSource( const QString& fileName ) const;
+
+ virtual void customEvent( QCustomEvent* ev );
+
+ virtual QStringList subclassWidget( const QString& formName );
+ virtual QStringList updateWidget( const QString& formName, const QString& fileName );
+
+ FunctionDefinitionDom currentFunctionDefinition();
+ FunctionDefinitionDom functionDefinitionAt( int line, int column );
+
+
+ KTextEditor::Document* findDocument( const KURL& url );
+ static KConfig *config();
+
+ virtual QString formatTag( const Tag& tag );
+ virtual QString formatModelItem( const CodeModelItem *item, bool shortDescription = false );
+ virtual void addClass();
+
+ QString extractInterface( const ClassDom& klass );
+
+ bool isHeader( const QString& fileName ) const;
+ bool isSource( const QString& fileName ) const;
+
+ //uses the old simple algorithm to find the header
+ QString findHeaderSimple( const QString &header );
+
+ virtual KDevDesignerIntegration *designer( KInterfaceDesigner::DesignerType type );
+
+ void setTyping( bool typing );
+
+ /**
+ * Add a new method to a class.
+ * @param aClass The class to which the method should be added.
+ * @param name The name of the method.
+ * @param type The return type of the method.
+ * @param parameters A string containing the parameters
+ * (including names, default values, but no '(' , ')', e.g.: "int, const QString& aString").
+ * @param accessType The access specifier e.g. CodeModelItem::PUBLIC.
+ * @param isConst true if method is const.
+ * @param isInline true if method should be declared inline.
+ * @param isVirtual true if method is virtual(this is ignored if isPureVirtual is true)
+ * @param isPureVirtual true if method is pure virtual (this overrides any value of isVirtual)
+ * @param implementation a optional implementation, if this is not set the method body will be empty.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+ virtual void addMethod( ClassDom aClass, const QString& name, const QString type, const QString& parameters, CodeModelItem::Access accessType, bool isConst, bool isInline, bool isVirtual, bool isPureVirtual, const QString& implementation = "" );
+
+ void createAccessMethods( ClassDom theClass, VariableDom theVariable );
+
+ bool isQueued( const QString& file ) const;
+ bool switchHeaderImpl( const QString& file, int line, int col, bool scrollOnly = false );
+
+ const Driver* driver() const;
+
+ Driver* driver();
+
+ ///thread-safe, returns the thread-safe set of all files that do not need to be parsed when being included, either because they are part of the project and parsed anyway, or because they are already in the code-repository
+ const SynchronizedFileSet& safeFileSet() const;
+ SynchronizedFileSet& safeFileSet();
+signals:
+ void fileParsed( const QString& fileName );
+ ///Emitted whenever a file was parsed, but the code-model could be updated(the file in the code-model did not have to be replaced)
+ void codeModelUpdated( const QString& fileName );
+ ///Emitted whenever a translation-unit was parsed in the main thread
+ void synchronousParseReady( const QString& file, ParsedFilePointer unit );
+
+protected:
+ virtual KDevLanguageSupport::Features features();
+ virtual KMimeType::List mimeTypes();
+ virtual QString formatClassName( const QString &name );
+ virtual QString unformatClassName( const QString &name );
+ virtual bool shouldSplitDocument( const KURL &url );
+ virtual Qt::Orientation splitOrientation() const;
+ virtual void addMethod( ClassDom klass );
+ virtual void addAttribute( ClassDom klass );
+
+private slots:
+ void activePartChanged( KParts::Part *part );
+ void partRemoved( KParts::Part* part );
+ void projectOpened();
+ void projectClosed();
+ void savedFile( const KURL &fileName );
+ void configWidget( KDialogBase *dlg );
+ void projectConfigWidget( KDialogBase *dlg );
+ void contextMenu( QPopupMenu *popup, const Context *context );
+ void addedFilesToProject( const QStringList &fileList );
+ void removedFilesFromProject( const QStringList &fileList );
+ void changedFilesInProject( const QStringList & fileList );
+ void slotProjectCompiled();
+ void setupCatalog();
+ void codeCompletionConfigStored();
+ void splitHeaderSourceConfigStored();
+ // void recomputeCodeModel( const QString& fileName );
+ void slotNavigate();
+ void slotNewClass();
+ void slotSwitchHeader( bool scrollOnly = false );
+ void slotCompleteText();
+ void slotMakeMember();
+ void slotExtractInterface();
+ void slotCursorPositionChanged();
+// void slotFunctionHint();
+ void gotoLine( int line );
+ void gotoDeclarationLine( int line );
+ void emitFileParsed( QStringList l );
+ void slotParseFiles();
+ void slotCreateSubclass();
+ void slotCreateAccessMethods();
+ void slotDeleteParserStore();
+ void slotSaveMemory();
+ void slotTextChanged();
+ void slotCursorMoved();
+ void slotParseCurrentFile();
+ void embedProblemReporter( bool force = false );
+ void removeProblemReporter();
+
+
+ void slotNeedTextHint( int, int, QString& );
+
+ /**
+ * loads, parses and creates both classstores needed
+ */
+ void initialParse( );
+
+ /**
+ * only parses the current project
+ */
+ bool parseProject( bool force = false );
+
+private:
+
+ void resetParserStoreTimer();
+ /**
+ * Get a linenumber in which a new method with a specific access specifier can be inserted.
+ * If there isn't a "section" with access, such a "section" gets inserted and the resulting place is returned.
+ * @param aClass the class one wants to insert a method to.
+ * @param access the access specifier the new method should have.
+ * @return A linenumber where the new method can be inserted
+ * or -1 if partController()->activePart() is no KTextEditorInterface.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+ int findInsertionLineMethod( ClassDom aClass, CodeModelItem::Access access );
+ /**
+ * Same as above, just returns a insertion line for a variable instead of a method
+ */
+ int findInsertionLineVariable( ClassDom aClass, CodeModelItem::Access access );
+
+
+ /**
+ * Get a class declaration which is "around" the current cursor position.
+ * @return The class declaration which is "around" the current cursor position,
+ * in the case of nested classes this is the innermost fitting class. If there is no
+ * class declared at the current cursor position, 0 is returned.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+ ClassDom currentClass() const;
+ /**
+ * Get the class attribute of curClass, which is declared at the current cursor position.
+ * @param curClass the class to search for attributes.
+ * @return the attribute declared at the current cursor position or 0, if no attribute is declared there.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+ VariableDom currentAttribute( ClassDom curClass ) const;
+
+ /**
+ * checks if a file has to be parsed
+ */
+ FileDom fileByName( const QString& name);
+ void maybeParse( const QString& fileName, bool background = true );
+ void removeWithReferences( const QString& fileName );
+ void createIgnorePCSFile();
+
+ void MakeMemberHelper( QString& text, int& atline, int& atcol );
+
+ QString sourceOrHeaderCandidate( const KURL &url = KURL() );
+
+ FunctionDom findFunction( const FunctionDom& def );
+ FunctionDom findFunctionInNamespace( const NamespaceDom& ns, const FunctionDom& def, const std::set<NamespaceImportModel>& nsImports,
+ const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch );
+ FunctionDom findFunctionInClass( const ClassDom& cs, const FunctionDom& def, const std::set<NamespaceImportModel>& nsImports,
+ const QString& candidateFile, int scopeIndex, FunctionDom& bestMatch );
+ FunctionDom findFunctionDefinition( const FunctionDom& decl );
+
+ void jumpToCodeModelItem( const ItemDom& item, bool scrollOnly );
+
+ QStringList modifiedFileList();
+ QString findSourceFile();
+ int pcsVersion();
+ void setPcsVersion( int version );
+
+ void saveProjectSourceInfo();
+ QStringList reorder( const QStringList& list );
+
+ CppCodeCompletion* m_pCompletion;
+ CppCodeCompletionConfig* m_pCompletionConfig;
+ CppSplitHeaderSourceConfig* m_pSplitHeaderSourceConfig;
+
+ CreateGetterSetterConfiguration* m_pCreateGetterSetterConfiguration;
+ KAction * m_createGetterSetterAction;
+ KAction * m_switchHeaderSourceAction;
+
+ QtBuildConfig* m_qtBuildConfig;
+
+ bool withcpp;
+ QString m_contextFileName;
+
+ VariableDom m_curAttribute;
+ ClassDom m_curClass;
+ QGuardedPtr< ProblemReporter > m_problemReporter;
+ BackgroundParser* m_backgroundParser;
+ UIBlockTester* m_lockupTester;
+
+ KTextEditor::Document* m_activeDocument;
+ KTextEditor::View* m_activeView;
+ KTextEditor::SelectionInterface* m_activeSelection;
+ KTextEditor::EditInterface* m_activeEditor;
+ KTextEditor::ViewCursorInterface* m_activeViewCursor;
+ QString m_activeFileName;
+
+ QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*> m_designers;
+
+ QWaitCondition m_eventConsumed;
+ bool m_projectClosed;
+ bool m_projectClosing;
+
+ QMap<QString, QDateTime> m_timestamp;
+ bool m_valid;
+ bool m_isTyping;
+ bool m_hadErrors; ///Whether there were already errors when the user started typing
+
+ QPtrList<Catalog> m_catalogList;
+ Driver* m_driver;
+ QString m_projectDirectory;
+ QStringList m_projectFileList;
+
+ ClassDom m_activeClass;
+ FunctionDom m_activeFunction;
+ VariableDom m_activeVariable;
+
+ QGuardedPtr<KPopupMenu> m_navigationMenu;
+
+// QTimer* m_functionHintTimer;
+// QTimer* m_deleteParserStoreTimer;
+ QTimer* m_saveMemoryTimer;
+ QTimer * m_textChangedTimer;
+ QTimer * m_cursorMovedTimer;
+ QTimer* m_buildSafeFileSetTimer;
+
+ class ParseEmitWaiting {
+ public:
+ enum Flags {
+ None = 0,
+ HadErrors = 1,
+ HadQueueProblem = 2,
+ Silent = 4
+ };
+ private:
+ struct Item {
+ QStringList first;
+ QStringList second;
+ Flags flags;
+ Item() : flags(None) {
+ }
+ Item( QStringList f, QStringList s, Flags fl = None ) : first( f ), second( s ), flags( fl )
+ {
+ }
+ };
+ //typedef QPair<QStringList, QStringList> Item; ///The files we are waiting fore, and the files we already got
+ typedef QValueList< Item > List;
+ List m_waiting;
+
+
+ QStringList harvestUntil( List::iterator targIt ) {
+ List::iterator it = m_waiting.begin();
+ QStringList ret;
+ while( it != targIt && it != m_waiting.end() ) {
+ ret += (*it).first;
+ it = m_waiting.erase( it );
+ }
+ return ret;
+ }
+
+ public:
+ void addGroup( QStringList& files, Flags flag = None ) {
+ m_waiting << Item(files, QStringList(), flag);
+ }
+ void addGroupFront( QStringList& files, Flags flag = None ) {
+ m_waiting.push_front( Item(files, QStringList(), flag) );
+ }
+ void clear() {
+ m_waiting.clear();
+ }
+
+ ///files that were not requested must not be processed, since they maybe do not respect the group-relationships.
+ bool reject( QString file ) {
+ for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) {
+ if( (*it).first.find( file ) != (*it).first.end() ) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ bool waiting( QString file, Flags forbidFlags = None, int count = 1 ) const {
+ int hits = 0;
+ for( List::const_iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) {
+ if( (*it).first.find( file ) != (*it).first.end() ) {
+ if( ((Flags)((*it).flags & forbidFlags )) == None ) {
+ hits++;
+ if( hits >= count ) return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ struct Processed {
+ QStringList res;
+ Flags flag;
+ Processed() : flag(None) {
+ }
+ Processed(const QStringList& l , Flags f = None ) : res( l ), flag( f ) {
+ }
+ operator QStringList() {
+ return res;
+ }
+
+ bool hadQueueProblem() {
+ return flag & HadQueueProblem;
+ }
+
+ bool hasFlag( Flags f ) const {
+ return f & flag;
+ }
+ // surely a copy paste implementation?
+/*
+ bool hasFlag( Flags flag ) const {
+ return flag & HadQueueProblem;
+ }
+*/
+ };
+
+
+ private:
+ ///Just return all files that have been parsed
+ Processed errorRecover( QString currentFile ) {
+ QStringList ret;
+ kdDebug( 9007 ) << "ParseEmitWaiting: error in the waiting-chain" << endl;
+ for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) {
+ ret += (*it).second;
+ }
+ if( !currentFile.isEmpty() ) ret << currentFile;
+ m_waiting.clear();
+ return Processed( ret, HadQueueProblem );
+ }
+ public:
+
+ ///returns the parsed-messages that should be emitted
+ Processed processFile( QString file, Flags flag = None ) {
+ QStringList ret;
+ for( List::iterator it = m_waiting.begin(); it != m_waiting.end(); ++it) {
+ if( (*it).first.find( file ) != (*it).first.end() ) {
+ if( (*it).second.find( file ) == (*it).second.end() ) {
+ (*it).flags = (Flags) ((*it).flags | flag);
+ (*it).second << file;
+ if( (*it).second.count() == (*it).first.count() ) {
+ Flags f = (*it).flags;
+ if( it != m_waiting.begin() ) {
+ kdDebug( 9007 ) << "ParseEmitWaiting: the chain has multiple groups waiting, they are flushed" << endl;
+ f = (Flags)(f | HadQueueProblem);
+ }
+ return Processed( harvestUntil( ++it ), f );
+ } else {
+ ///The file was registered, now wait for the next
+ return QStringList();
+ }
+ } else {
+ ///The file has already been parsed
+ kdDebug( 9007 ) << "ParseEmitWaiting: file has been parsed twice" << endl;
+ return errorRecover( file );
+ }
+ }
+ }
+
+ kdDebug( 9007 ) << "ParseEmitWaiting: file \"" << file << "\" has no group waiting for it" << endl;
+ ret << file;
+ return Processed( ret, HadQueueProblem );
+ }
+ };
+
+ ParseEmitWaiting m_parseEmitWaiting;
+ ParseEmitWaiting m_fileParsedEmitWaiting;
+
+private slots:
+ void parseEmit( ParseEmitWaiting::Processed files );
+ void buildSafeFileSet();
+private:
+
+ SynchronizedFileSet m_safeProjectFiles;
+ BackgroundParserConfig * m_backgroundParserConfig;
+
+ static QStringList m_sourceMimeTypes;
+ static QStringList m_headerMimeTypes;
+
+ static QStringList m_sourceExtensions;
+ static QStringList m_headerExtensions;
+
+ friend class KDevCppSupportIface;
+ friend class CppDriver;
+
+ // we need something to plug actions that are not in any menu
+ // into in order for their shortcuts to work
+ QWidget m_DummyActionWidget;
+
+ void addToRepository( ParsedFilePointer );
+ void emitSynchronousParseReady( const QString& file, ParsedFilePointer unit );
+
+ struct JobData
+ {
+ QDir dir;
+ QGuardedPtr<QProgressBar> progressBar;
+ QStringList::Iterator it;
+ QStringList files;
+ int cycle;
+ int backgroundCount;
+ int lastBackgroundState;
+ int backgroundState;
+ QStringList reparseList;
+ QMap< QString, QPair<uint, uint> > pcs;
+ QDataStream stream;
+ QFile file;
+ QTime lastParse;
+
+ ~JobData()
+ {
+ delete progressBar;
+ }
+ };
+
+ JobData * _jd;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/cpptemplates b/languages/cpp/cpptemplates
new file mode 100644
index 00000000..e55181c0
--- /dev/null
+++ b/languages/cpp/cpptemplates
@@ -0,0 +1,22 @@
+<!DOCTYPE Templates>
+<Templates>
+ <Template code="if( | ){
+} else {
+}" name="ife" description="if else" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="private|" name="pr" description="private" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="while( | ){
+}" name="whileb" description="while statement" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="public|" name="pu" description="public" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="switch( | ){
+}" name="switchb" description="switch statement" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="protected|" name="pro" description="protected" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="for( |; ; ){
+}" name="forb" description="for statement" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="class | {
+public:
+};" name="classd" description="class declaration" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="struct | {
+};" name="structd" description="struct declaration" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+ <Template code="if( | ){
+}" name="ifb" description="if statement" suffixes="C++ (h,H,hh,hxx,hpp,inl,tlh,c,C,cc,cpp,c++,cxx,m,mm,M)"/>
+</Templates>
diff --git a/languages/cpp/creategettersetter.ui b/languages/cpp/creategettersetter.ui
new file mode 100644
index 00000000..0796d4fb
--- /dev/null
+++ b/languages/cpp/creategettersetter.ui
@@ -0,0 +1,232 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CreateGetterSetterDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CreateGetterSetterDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>428</width>
+ <height>105</height>
+ </rect>
+ </property>
+ <property name="modal">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="2" 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>61</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="0" column="5">
+ <property name="name">
+ <cstring>m_chkInlineGet</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;inline</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>create an inline get method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked the get method will be created inline; otherwise, it will not.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_chkGet</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;get method</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>create get method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked a getter method will be created.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>m_chkSet</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;set method</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>create set method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked a set method will be created</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>m_edtGet</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>name of the get method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The name of the created get method</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>m_edtSet</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>name of the set method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The name of the created set method</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="5">
+ <property name="name">
+ <cstring>m_chkInlineSet</cstring>
+ </property>
+ <property name="text">
+ <string>i&amp;nline</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>create an inline set method</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked the set method will be created inline; otherwise, it will not.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <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>21</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="2" column="4" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_btnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="2" column="3">
+ <property name="name">
+ <cstring>m_btnOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_chkGet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_edtGet</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_chkSet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_edtSet</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_btnOk</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateGetterSetterDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_btnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateGetterSetterDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_chkGet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_chkInlineGet</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_chkSet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>m_chkInlineSet</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>m_chkInlineGet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CreateGetterSetterDialogBase</receiver>
+ <slot>slotInlineChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_chkInlineSet</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>CreateGetterSetterDialogBase</receiver>
+ <slot>slotInlineChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_chkGet</tabstop>
+ <tabstop>m_edtGet</tabstop>
+ <tabstop>m_chkSet</tabstop>
+ <tabstop>m_edtSet</tabstop>
+ <tabstop>m_btnCancel</tabstop>
+ <tabstop>m_btnOk</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">slotInlineChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/creategettersetterconfiguration.cpp b/languages/cpp/creategettersetterconfiguration.cpp
new file mode 100644
index 00000000..5b64290f
--- /dev/null
+++ b/languages/cpp/creategettersetterconfiguration.cpp
@@ -0,0 +1,62 @@
+//
+// C++ Implementation: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "creategettersetterconfiguration.h"
+
+#include "cppsupportpart.h"
+
+#include <domutil.h>
+
+#include <qdom.h>
+#include <kmessagebox.h>
+QString CreateGetterSetterConfiguration::defaultPath = QString::fromLatin1( "/kdevcppsupport/creategettersetter" );
+
+CreateGetterSetterConfiguration::CreateGetterSetterConfiguration( CppSupportPart * part )
+: QObject(part), m_part(part), m_settings(0)
+{
+ init();
+}
+
+
+CreateGetterSetterConfiguration::~CreateGetterSetterConfiguration()
+{
+}
+
+void CreateGetterSetterConfiguration::init( )
+{
+ m_settings = m_part->projectDom();
+ if (m_settings == 0)
+ return;
+
+ m_prefixGet = DomUtil::readEntry( *m_settings, defaultPath + "/prefixGet", "" );
+ m_prefixSet = DomUtil::readEntry( *m_settings, defaultPath + "/prefixSet", "set" );
+ m_prefixVariable = QStringList::split(",", DomUtil::readEntry( *m_settings, defaultPath + "/prefixVariable", "m_,_" ));
+ m_parameterName = DomUtil::readEntry( *m_settings, defaultPath + "/parameterName", "theValue" );
+ m_isInlineGet = DomUtil::readBoolEntry(*m_settings, defaultPath + "/inlineGet", true );
+ m_isInlineSet = DomUtil::readBoolEntry(*m_settings, defaultPath + "/inlineSet", true );
+}
+
+void CreateGetterSetterConfiguration::store( )
+{
+ if (m_settings == 0)
+ return;
+
+ DomUtil::writeEntry( *m_settings, defaultPath + "/prefixGet", m_prefixGet );
+ DomUtil::writeEntry( *m_settings, defaultPath + "/prefixSet", m_prefixSet );
+ DomUtil::writeEntry( *m_settings, defaultPath + "/prefixVariable", m_prefixVariable.join(",") );
+ DomUtil::writeEntry( *m_settings, defaultPath + "/parameterName", m_parameterName );
+ DomUtil::writeBoolEntry(*m_settings, defaultPath + "/inlineGet", m_isInlineGet );
+ DomUtil::writeBoolEntry(*m_settings, defaultPath + "/inlineSet", m_isInlineSet );
+}
+
+#include "creategettersetterconfiguration.moc"
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/creategettersetterconfiguration.h b/languages/cpp/creategettersetterconfiguration.h
new file mode 100644
index 00000000..e11a45ee
--- /dev/null
+++ b/languages/cpp/creategettersetterconfiguration.h
@@ -0,0 +1,117 @@
+//
+// C++ Interface: creategettersetterconfiguration
+//
+// Description:
+//
+//
+// Author: Jonas Jacobi <j.jacobi@gmx.de>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CREATEGETTERSETTERCONFIGURATION_H
+#define CREATEGETTERSETTERCONFIGURATION_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+class CppSupportPart;
+class QDomDocument;
+
+/**
+ * Class containing the settings for the creation of get/set methods for class attributes.
+ * It contains several attributes:
+ * - prefixGet is the prefix which is put in front of the attributename for the getmethod.
+ * - prefixSet is the prefix which is put in front of the attributename for the setmethod.
+ * - prefixVariable is a StringList containing prefixes which should be removed from the attributename
+ * when creating the get/set method names
+ * - parameterName is the name of the parameter containing the value in the setmethod.
+ * - inlineGet true if getmethod should be created inline, false otherwise
+ * - inlineSet true if setmethod should be created inline, false otherwise
+ *
+ * The settings are stored per project under /kdevcppsupport/creategettersetter/.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+class CreateGetterSetterConfiguration : public QObject{
+Q_OBJECT
+public:
+ CreateGetterSetterConfiguration(CppSupportPart* part);
+ ~CreateGetterSetterConfiguration();
+
+public slots:
+ void init();
+ void store();
+
+public:
+ void setPrefixGet(const QString& theValue)
+ {
+ m_prefixGet = theValue;
+ }
+
+ QString prefixGet() const
+ {
+ return m_prefixGet;
+ }
+ void setPrefixSet(const QString& theValue)
+ {
+ m_prefixSet = theValue;
+ }
+
+ QString prefixSet() const
+ {
+ return m_prefixSet;
+ }
+ void setPrefixVariable(const QStringList& theValue)
+ {
+ m_prefixVariable = theValue;
+ }
+
+ QStringList prefixVariable() const
+ {
+ return m_prefixVariable;
+ }
+ void setParameterName(const QString& theValue)
+ {
+ m_parameterName = theValue;
+ }
+
+ QString parameterName() const
+ {
+ return m_parameterName;
+ }
+ void setInlineGet(bool theValue)
+ {
+ m_isInlineGet = theValue;
+ }
+
+ bool isInlineGet() const
+ {
+ return m_isInlineGet;
+ }
+ void setInlineSet(bool theValue)
+ {
+ m_isInlineSet = theValue;
+ }
+
+ bool isInlineSet() const
+ {
+ return m_isInlineSet;
+ }
+
+private:
+ CppSupportPart* m_part;
+ QDomDocument* m_settings;
+
+ QString m_prefixGet;
+ QString m_prefixSet;
+ QStringList m_prefixVariable;
+ QString m_parameterName;
+ bool m_isInlineGet;
+ bool m_isInlineSet;
+
+private:
+ static QString defaultPath;
+};
+
+#endif
diff --git a/languages/cpp/creategettersetterdialog.cpp b/languages/cpp/creategettersetterdialog.cpp
new file mode 100644
index 00000000..41a2f27e
--- /dev/null
+++ b/languages/cpp/creategettersetterdialog.cpp
@@ -0,0 +1,122 @@
+//
+// C++ Implementation: %{MODULE}
+//
+// Description:
+//
+//
+// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "creategettersetterdialog.h"
+
+#include "cppsupportpart.h"
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qregexp.h>
+
+#include "creategettersetterconfiguration.h"
+
+CreateGetterSetterDialog::CreateGetterSetterDialog( CppSupportPart* part, ClassDom aClass,
+ VariableDom aVar, QWidget *parent, const char *pName )
+: CreateGetterSetterDialogBase( parent, pName ), m_part( part ), m_class( aClass ), m_var( aVar )
+{
+ QString name = aVar->name();
+ setCaption( "Create methods for " + name );
+
+ if ( aVar->type().startsWith( "const" ) && !aVar->type().endsWith( "*" ) )
+ {
+ m_chkSet->setChecked( false );
+ m_chkSet->setEnabled( false );
+ }
+
+ CreateGetterSetterConfiguration* config = m_part->createGetterSetterConfiguration();
+ if ( config == 0 )
+ return ;
+
+ QStringList prefixes = config->prefixVariable();
+ unsigned int len = 0;
+
+ QStringList::ConstIterator theend = prefixes.end(); //find longest fitting prefix and remove it
+ for ( QStringList::ConstIterator ci = prefixes.begin(); ci != theend; ++ci )
+ {
+ if ( name.startsWith( *ci ) && ( *ci ).length() > len )
+ len = ( *ci ).length();
+ }
+
+ if ( len > 0 )
+ name.remove( 0, len );
+
+ m_edtGet->setText( name );
+
+ QString getName = name;
+ if ( ! config->prefixGet().isEmpty() )
+ getName[ 0 ] = getName[ 0 ].upper();
+
+ QString setName = name;
+ if ( ! config->prefixSet().isEmpty() )
+ setName[ 0 ] = setName[ 0 ].upper();
+
+ bool getIsChecked = config->isInlineGet();
+ bool setIsChecked = config->isInlineSet();
+ m_chkInlineGet->setChecked( getIsChecked );
+ m_chkInlineSet->setChecked( setIsChecked );
+
+ m_edtGet->setText( config->prefixGet() + getName );
+ m_edtSet->setText( config->prefixSet() + setName );
+}
+
+void CreateGetterSetterDialog::accept( )
+{
+ CreateGetterSetterConfiguration * config = m_part->createGetterSetterConfiguration();
+
+ if ( config == 0 )
+ return ;
+
+ if ( m_chkGet->isChecked() && !m_edtGet->text().isEmpty() )
+ m_part->addMethod( m_class, m_edtGet->text(), m_var->type(), "",
+ CodeModelItem::Public, true, m_chkInlineGet->isChecked(),
+ false, false, "\treturn " + m_var->name() + ";" );
+
+ if ( m_chkSet->isChecked() && !m_edtSet->text().isEmpty() )
+ {
+ QString parameterStr;
+
+ if ( m_var->type().endsWith( "*" ) )
+ {
+ parameterStr = m_var->type() + " " + config->parameterName();
+ }
+ else
+ {
+ QRegExp basicTypes( "((unsigned)?\\s*(char|byte|short|int|long))|double|float|bool" );
+ if ( basicTypes.exactMatch( m_var->type() ) )
+ parameterStr = m_var->type() + " " + config->parameterName();
+ else
+ parameterStr = "const " + m_var->type() + "& " + config->parameterName();
+ }
+ m_part->addMethod( m_class, m_edtSet->text(), "void", parameterStr, CodeModelItem::Public,
+ false, m_chkInlineSet->isChecked(), false, false,
+ "\t" + m_var->name() + " = " + config->parameterName() + ";" );
+ }
+ //@todo illegale eingaben nicht akzeptieren wie z.b. int& ...
+ QDialog::accept();
+}
+
+/**
+ * store current settings wether get/set methods should be created inline.
+ * this is done everytime one changes this behaviour in the dialog.
+ */
+void CreateGetterSetterDialog::slotInlineChanged( )
+{
+ CreateGetterSetterConfiguration * config = m_part->createGetterSetterConfiguration();
+ if ( config == 0 )
+ return ;
+
+ config->setInlineGet( m_chkInlineGet->isChecked() );
+ config->setInlineSet( m_chkInlineSet->isChecked() );
+ config->store();
+}
+
+#include "creategettersetterdialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/creategettersetterdialog.h b/languages/cpp/creategettersetterdialog.h
new file mode 100644
index 00000000..a535e303
--- /dev/null
+++ b/languages/cpp/creategettersetterdialog.h
@@ -0,0 +1,41 @@
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Jonas Jacobi <j.jacobi@gmx.de>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CREATEACCESSMETHODSDIALOG_H
+#define CREATEACCESSMETHODSDIALOG_H
+
+#include "creategettersetter.h"
+#include "codemodel.h"
+
+class CppSupportPart;
+
+/**
+ * Dialog which is shown, when a user wants to create get/set methods for a class attribute.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+class CreateGetterSetterDialog: public CreateGetterSetterDialogBase
+{
+ Q_OBJECT
+public:
+ CreateGetterSetterDialog(CppSupportPart* part, ClassDom aClass, VariableDom var, QWidget *parent = 0, const char *name = 0);
+
+protected slots:
+ void accept();
+ void slotInlineChanged();
+
+private:
+ CppSupportPart* m_part;
+
+ ClassDom m_class;
+ VariableDom m_var;
+};
+
+#endif
diff --git a/languages/cpp/createpcsdialog.cpp b/languages/cpp/createpcsdialog.cpp
new file mode 100644
index 00000000..1dc45034
--- /dev/null
+++ b/languages/cpp/createpcsdialog.cpp
@@ -0,0 +1,358 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "createpcsdialog.h"
+#include "createpcsdialog.moc"
+#include "driver.h"
+#include "tag_creator.h"
+#include "cppsupportpart.h"
+#include "setuphelper.h"
+
+#include <catalog.h>
+#include <kdevpcsimporter.h>
+#include <kdevcoderepository.h>
+
+#include <kparts/componentfactory.h>
+
+#include <ktrader.h>
+#include <kdebug.h>
+#include <klibloader.h>
+#include <klistbox.h>
+#include <kiconloader.h>
+#include <klistview.h>
+#include <kapplication.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kstringhandler.h>
+#include <klineedit.h>
+
+#include <qprogressbar.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qregexp.h>
+#include <qlayout.h>
+#include <qtimer.h>
+#include <qpushbutton.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+class CreatePCSDialog::RppDriver: public Driver
+{
+public:
+ RppDriver( Catalog* c )
+ : catalog( c )
+ {
+ setup();
+ }
+
+ virtual ~RppDriver()
+ {
+#if 0 /// \FIXME robe
+ TagCreator::destroyDocumentation();
+#endif
+
+ }
+
+#if 0 /// \FIXME robe
+ void addDocDirectory( const QString& dir )
+ {
+ m_docDirectoryList.append( dir );
+ TagCreator::setDocumentationDirectories( m_docDirectoryList );
+ }
+#endif
+
+ void fileParsed( ParsedFile& ast )
+ {
+ /// @todo increment progress
+
+#if 0 /// @todo show problems
+ QValueList<Problem> l = problems( fileName );
+ QValueList<Problem>::Iterator it = l.begin();
+ while ( it != l.end() )
+ {
+ const Problem & p = *it;
+ ++it;
+ }
+#endif
+
+ takeTranslationUnit( ast );
+
+ TagCreator w( ast.fileName(), catalog );
+ w.parseTranslationUnit( ast );
+
+ //if( !isResolveDependencesEnabled() )
+ // removeAllMacrosInFile( fileName );
+ }
+
+ // setup the preprocessor
+ // code provided by Reginald Stadlbauer <reggie@trolltech.com>
+ void setup()
+ {
+ bool ok;
+ QString gccLibPath = SetupHelper::getGccIncludePath(&ok);
+ if (!ok)
+ return;
+ gccLibPath = gccLibPath.replace( QRegExp( "[\r\n]" ), "" );
+ addIncludePath( gccLibPath );
+ //addIncludePath( "/usr/include/g++-3" );
+ //addIncludePath( "/usr/include/g++" );
+ QStringList lines = SetupHelper::getGccMacros(&ok);
+ if (!ok)
+ return;
+ for (QStringList::ConstIterator it = lines.constBegin(); it != lines.constEnd(); ++it) {
+ QStringList lst = QStringList::split( ' ', *it );
+ if ( lst.count() != 3 )
+ continue;
+ addMacro( Macro( lst[1], lst[2] ) );
+ }
+ addMacro( Macro( "__cplusplus", "1" ) );
+ addMacro( Macro( "Q_SIGNALS", "signals" ) );
+ addMacro( Macro( "Q_SLOTS", "slots" ) );
+ }
+
+private:
+ Catalog* catalog;
+#if 0 /// \FIXME
+
+ QStringList m_docDirectoryList;
+#endif
+};
+
+
+class PCSListViewItem: public KListViewItem
+{
+public:
+ PCSListViewItem( KService::Ptr ptr, KDevPCSImporter* importer, QListViewItem* parent )
+ : KListViewItem( parent ), m_importer( importer )
+ {
+ init( ptr );
+ }
+ PCSListViewItem( KService::Ptr ptr, KDevPCSImporter* importer, QListView* parent )
+ : KListViewItem( parent ), m_importer( importer )
+ {
+ init( ptr );
+ }
+
+ ~PCSListViewItem()
+ {
+ delete( m_importer );
+ m_importer = 0;
+ }
+
+ void init( KService::Ptr ptr )
+ {
+ setText( 0, ptr->comment() );
+ setPixmap( 0, SmallIcon( ptr->icon() ) );
+ }
+
+ KDevPCSImporter* importer()
+ {
+ return m_importer;
+ }
+
+private:
+ KDevPCSImporter* m_importer;
+};
+
+class CreatePCSDialog::PCSJobData
+{
+public:
+ QString dbName;
+ Catalog * catalog;
+ RppDriver * driver;
+ QStringList list;
+ QStringList::iterator it;
+ int progress;
+
+ PCSJobData( const QString & dbName, QStringList const & fileList )
+ : dbName( dbName), list( fileList ), it( list.begin() ), progress( 0 )
+ {
+ catalog = new Catalog;
+ catalog->open( dbName );
+ catalog->addIndex( "kind" );
+ catalog->addIndex( "name" );
+ catalog->addIndex( "scope" );
+ catalog->addIndex( "fileName" );
+
+ driver = new RppDriver( catalog );
+ }
+
+ ~PCSJobData()
+ {
+ delete driver;
+ delete catalog;
+ }
+};
+
+
+
+CreatePCSDialog::CreatePCSDialog( CppSupportPart* part, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : CreatePCSDialogBase( parent, name, modal, fl ), m_part( part ), m_jobData( 0 )
+{
+ helpButton()->hide();
+
+ m_settings = 0;
+ importerListView->header() ->hide();
+
+ KTrader::OfferList lst = KTrader::self() ->query( "KDevelop/PCSImporter" );
+ kdDebug( 9007 ) << "====================> found " << lst.size() << " importers" << endl;
+
+ for ( KTrader::OfferList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ KService::Ptr ptr = *it;
+
+ int error = 0;
+ KDevPCSImporter* importer = KParts::ComponentFactory::createInstanceFromService<KDevPCSImporter>( ptr, this, ptr->name().latin1(), QStringList(), &error );
+ if ( importer )
+ {
+ new PCSListViewItem( ptr, importer, importerListView );
+ }
+ }
+
+ setNextEnabled( importerPage, false );
+
+ QHBoxLayout* hbox = new QHBoxLayout( settingsPage );
+ hbox->setAutoAdd( true );
+
+ if ( importerListView->firstChild() )
+ {
+ importerListView->setSelected( importerListView->firstChild(), true );
+ setNextEnabled( importerPage, true );
+ }
+}
+
+CreatePCSDialog::~CreatePCSDialog()
+{}
+
+/*$SPECIALIZATION$*/
+void CreatePCSDialog::back()
+{
+ QWizard::back();
+}
+
+void CreatePCSDialog::next()
+{
+ QWizard::next();
+}
+
+void CreatePCSDialog::reject()
+{
+ if ( m_jobData ) {
+ m_part->removeCatalog( m_jobData->dbName );
+
+ delete m_jobData;
+ m_jobData = 0;
+ }
+
+ QWizard::reject();
+}
+
+void CreatePCSDialog::accept()
+{
+ delete m_jobData;
+ m_jobData = 0;
+
+ QWizard::accept();
+}
+
+void CreatePCSDialog::slotSelected( const QString & )
+{
+ if ( currentPage() == settingsPage )
+ {
+ if ( m_settings )
+ delete( m_settings );
+
+ KDevPCSImporter* importer = static_cast<PCSListViewItem*>( importerListView->selectedItem() ) ->importer();
+ m_settings = importer->createSettingsPage( settingsPage );
+ setNextEnabled( currentPage(), false );
+ setHelpEnabled( currentPage(), false );
+ connect( m_settings, SIGNAL( enabled( int ) ), this, SLOT( setNextPageEnabled( int ) ) );
+
+ if ( m_settings )
+ {
+ setHelpEnabled( m_settings, false );
+ m_settings->show();
+ }
+ }
+ else if ( currentPage() == descriptionPage )
+ {
+ KDevPCSImporter* importer = static_cast<PCSListViewItem*>( importerListView->selectedItem() )->importer();
+ filename_edit->setText( importer->dbName() );
+ }
+ else if ( currentPage() == finalPage )
+ {
+ setBackEnabled( currentPage(), false );
+ setNextEnabled( currentPage(), false );
+
+ KDevPCSImporter* importer = static_cast<PCSListViewItem*>( importerListView->selectedItem() )->importer();
+ QStringList fileList = importer->fileList();
+ progressBar->setTotalSteps( fileList.size() );
+ progressBar->setPercentageVisible( true );
+
+ KStandardDirs *dirs = m_part->instance() ->dirs();
+
+ QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + KURL::encode_string_no_slash(filename_edit->text()) + ".db";
+ kdDebug( 9007 ) << "================================> dbName = " << dbName << endl;
+
+ m_part->removeCatalog( dbName );
+
+ m_jobData = new PCSJobData( dbName, fileList );
+ QTimer::singleShot( 0, this, SLOT(parseNext()) );
+ }
+}
+
+void CreatePCSDialog::parseNext( )
+{
+ if ( ! m_jobData ) return;
+
+ if ( m_jobData->it == m_jobData->list.end() )
+ {
+ if ( m_jobData->progress > 0 )
+ {
+ m_part->addCatalog( m_jobData->catalog );
+ m_jobData->catalog = 0;
+ }
+ currentFile->setText("");
+ cancelButton()->setEnabled( false );
+
+ setFinishEnabled( currentPage(), true );
+
+ delete m_jobData;
+ m_jobData = 0;
+
+ return;
+ }
+
+ progressBar->setProgress( ++(m_jobData->progress) );
+ currentFile->setText( KStringHandler::lsqueeze( *(m_jobData->it), 80 ) );
+
+ m_jobData->driver->parseFile( *(m_jobData->it) );
+
+ ++(m_jobData->it);
+
+ QTimer::singleShot( 0, this, SLOT(parseNext()) );
+}
+
+
+void CreatePCSDialog::setNextPageEnabled( int enabled )
+{
+ setNextEnabled( currentPage(), enabled );
+}
+
+void CreatePCSDialog::slotSelectionChanged( QListViewItem * item )
+{
+ setNextPageEnabled( item != 0 );
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
diff --git a/languages/cpp/createpcsdialog.h b/languages/cpp/createpcsdialog.h
new file mode 100644
index 00000000..0d03d16f
--- /dev/null
+++ b/languages/cpp/createpcsdialog.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef CREATEPCSDIALOG_H
+#define CREATEPCSDIALOG_H
+
+#include "createpcsdialogbase.h"
+
+class CppSupportPart;
+
+class CreatePCSDialog : public CreatePCSDialogBase
+{
+ Q_OBJECT
+
+public:
+ CreatePCSDialog( CppSupportPart* part, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~CreatePCSDialog();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void slotSelected( const QString& );
+ virtual void slotSelectionChanged( QListViewItem* );
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void back();
+ virtual void next();
+ virtual void reject();
+ virtual void accept();
+ void setNextPageEnabled( int );
+
+ void parseNext();
+
+private:
+ CppSupportPart* m_part;
+ QWidget* m_settings;
+ class RppDriver;
+
+ class PCSJobData;
+ PCSJobData * m_jobData;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
+
diff --git a/languages/cpp/createpcsdialogbase.ui b/languages/cpp/createpcsdialogbase.ui
new file mode 100644
index 00000000..09b59a70
--- /dev/null
+++ b/languages/cpp/createpcsdialogbase.ui
@@ -0,0 +1,168 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CreatePCSDialogBase</class>
+<widget class="QWizard">
+ <property name="name">
+ <cstring>CreatePCSDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>477</width>
+ <height>411</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Persistant Class Store</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>importerPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select importer</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>importerListView</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>settingsPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Select directory</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>descriptionPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Describe database contents</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Filename:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>filename_edit</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <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>111</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>finalPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Creating...</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QProgressBar">
+ <property name="name">
+ <cstring>progressBar</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>currentFile</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>81</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>CreatePCSDialogBase</sender>
+ <signal>selected(const QString&amp;)</signal>
+ <receiver>CreatePCSDialogBase</receiver>
+ <slot>slotSelected(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>importerListView</sender>
+ <signal>clicked(QListViewItem*)</signal>
+ <receiver>CreatePCSDialogBase</receiver>
+ <slot>slotSelectionChanged(QListViewItem*)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>slotSelected(const QString&amp;)</slot>
+ <slot>slotSelectionChanged(QListViewItem*)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/debugger/DESIGN.txt b/languages/cpp/debugger/DESIGN.txt
new file mode 100644
index 00000000..627fd403
--- /dev/null
+++ b/languages/cpp/debugger/DESIGN.txt
@@ -0,0 +1,113 @@
+
+This document describes the design of KDevelop's debugger part. Not that it's
+work in progress, and sometimes describes desired design, not the actual
+one.
+
+== Components and lifecycle ==
+
+Debugger part consists of low-lever "controller" that handles talking
+with gdb and guess what state gdb is in, a number of view widgets, showing
+the state of the program, and a number of places where user can click to
+affect the program.
+
+What makes them all work together are "events" that controller sends
+to all interested parties. They are:
+
+ - Debugger exited. All view classes and actions become disabled and hidden
+ - Program exited. All view classes that can't be used without program
+ become disabled.
+ - Debugger is busy executing a command. All actions become disabled.
+ - Debugger is waiting for command. All actions becomes enabled.
+ - Program state changed. All views flush all cached data and
+ reload the content.
+ - Current thread/stack frame changed. All views switch to showing that
+ thread/frame.
+
+The distinction between "program state change" and "thread/frame" changed is
+that the latter does not imply that any *data* changed, and so it's not
+necessary to clear already cached data for other threads.
+
+== Command execution ==
+
+The controller has a queue of commands to send to gdb. A command typically
+has a callback (pair of QObject* and a member pointer) to be called when
+command is done.
+
+When the queue is non-empty, and debugger is not busy executing the previous
+command, the controller will send the command from the queue top to the gdb.
+The command being executed is remembed in the currentCmd_ member variable.
+Gdb will reply with a number of "out-of-band" responses, followed by one
+"done" or "error" response.
+
+The "done"/"error" response, when using MI interface, is a tree-line structure
+that's parsed with into GDBMI::ResultRecord structure, that is then passed
+to callback assocaited with the current command. Say, for "get me value of
+expression" command, MI response includes textual "value" field that can be
+used by any part of GUI to show the value. After callback is called,
+controller deletes the current command and then tries to execute next one from
+the queue, if there's one.
+
+The commands related to running program (continue/step/etc) are handled in
+a bit special way. Instead of calling any callbacks, controller performs
+predefined set of steps:
+
+ - Decide what's the reason for stop, and maybe do something special
+
+ - For stop on shared lib load, just continue
+
+ - For stop on breakpoint, run the breakpoint commands if any.
+
+ - Set a flag that program state might have changed, and must be reloaded
+
+ - Since hitting tracepoint adds extra commands, including possibly
+ "continue", we don't start reloading widgets immediately, instead
+ we wait for all commands currently in queue to get executed.
+
+ - Once there are no commands in queue, and "reload_program_state" flag is
+ set, we raise the 'program_state_changed' event. All widgets react to
+ that by queueing commands for realoding their state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Note that all commands are executed in the order they were queued, so if you
+add several commands at the same time, they are executed "automically". Each
+one sees the gdb state that the previous one has left it in.
+
+The MI protocol is stateful, that is there are things like current thread
+and current stack that affect the meaning of commands. Take care to never
+switch such "current" variables unless it's explicitly asked by the user.
+This means that if you have to switch thread/frame, always switch it back
+as the last command in a sequences.
+
+
+== Breakpoints handling ==
+
+Whenever a new breakpoint is added, or an existing breakpoint is modified,
+we immediately try to send the proper commands to gdb. Note that we
+don't try to check which properties of breakpoint were modified, we
+just send all breakpoint data.
+
+This is not always possible, because debugger might be busy, or just
+not started yet. In this case, we set 'pending' flag for breakpoint. Each time
+the debugger becomes free, we try to send the pending breakpoint again.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/languages/cpp/debugger/Makefile.am b/languages/cpp/debugger/Makefile.am
new file mode 100644
index 00000000..0ac84358
--- /dev/null
+++ b/languages/cpp/debugger/Makefile.am
@@ -0,0 +1,33 @@
+# Here resides the debugger part.
+
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+SUBDIRS = mi
+INCLUDES = -I$(top_srcdir)/languages/lib/debugger \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdebugger.la
+libkdevdebugger_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevdebugger_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML) \
+ $(top_builddir)/languages/lib/debugger/liblang_debugger.la \
+ $(top_builddir)/languages/cpp/debugger/mi/libgdbmi_parser.la
+
+libkdevdebugger_la_SOURCES = debuggerdcopinterface.skel debuggerpart.cpp \
+ dbgcontroller.cpp gdbcontroller.cpp gdbcommand.cpp \
+ gdbparser.cpp stty.cpp breakpoint.cpp variablewidget.cpp \
+ gdbbreakpointwidget.cpp framestackwidget.cpp disassemblewidget.cpp \
+ memviewdlg.cpp dbgpsdlg.cpp dbgtoolbar.cpp debuggerconfigwidget.cpp \
+ debuggerconfigwidgetbase.ui debuggertracingdialogbase.ui \
+ gdboutputwidget.cpp gdbtable.cpp debuggertracingdialog.cpp \
+ label_with_double_click.cpp
+
+METASOURCES = AUTO
+KDE_ICON = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdebugger.desktop
+
+rcdir = $(kde_datadir)/kdevdebugger
+rc_DATA = kdevdebugger.rc
+noinst_HEADERS = gdbtable.h
diff --git a/languages/cpp/debugger/TODO.txt b/languages/cpp/debugger/TODO.txt
new file mode 100644
index 00000000..38aca109
--- /dev/null
+++ b/languages/cpp/debugger/TODO.txt
@@ -0,0 +1,218 @@
+
+KDEV4 Debugger:
+
+ - Launch framework
+
+ - On fly launch types -- "dbus call to connect to a given app"
+
+ - Advanced data visualization
+
+ - Customizable by the user
+
+ - Assembler display that's good
+
+ - Hex display that's good
+
+ - Register display that is good.
+
+ - Debugger scripts? Remembering and replaying a set of
+ commands?
+
+ - Debugger as a visualizer tool?
+
+
+TODO:
+
+ - Check gdb version at startup.
+
+ - P1:
+
+ - Breakpoints duplicated on editing.
+
+ - Global radix
+
+ - Hiding of static members.
+
+ - No horizonal scrollbar in the variables widget.
+
+ - Debugging optimized binaries
+
+ - Debugged application somtimes not killed.
+
+ - Fix moving breakpoints on editing files
+
+ - Pressing tab in memory range dialog modified the edited file.
+
+ - Testing stepping into code for which gdb can't find the file or fullname.
+ Test stepping (or stepi) into undebuggable code.
+
+ - Test files without debug info
+
+ - Reconsider fixed font in variable widget
+
+ - Investigate 'stop on shlib load breaking next" on Dario's project.
+
+ - Incoming bug reports:
+
+ - Check core files usage.
+
+ - Fix remote target dialog, which is confusing and requires
+ to specify tree scripts!
+
+ - Big projects
+
+ - Add support for other special types (STL)
+
+ - Breakpoints
+
+ - Add shortcuts to context menu.
+
+ - Add icons
+
+ - Status display column is just ugly
+
+ - Handle "out of breakpoints" message.
+
+ - Check that changing breakpoint when program is running works sanely.
+ Need to either disable breakpoints widget when debugger is busy, or
+ stop debugger when we add new breakpoint.
+
+ - Implement gdb -> KDevelop breakpoint addition for all existing
+ breakpoint types.
+
+
+
+ - For function breakpoints, the 'file' property of breakpoint from
+ gdb is not a fullname (gdb 6.4), so we don't find the file.
+
+ - For function breakpoints with gdb CVS, clicking on marker corresponding
+ to function breakpoint does not clear it, but adds a new one.
+
+ - "Immediately leave function" breakpoint type.
+
+
+ - Watchpoints redux:
+
+ - Fix status display for watchpoints
+
+ - Test loading of read watchpoints from session file.
+
+ - Change "toogle watchpoint" into checkbox.
+
+ - "Read watchpoint triggered" message disappears too soon.
+
+
+ - Fix up the mess with relative vs. full names of files for breakpoints.
+
+
+ UI cleanup:
+
+ - The dialog box on watchpoint hit draws slowly initially.
+
+ - Cntrl-Enter for "add watch".
+
+ - Close all opened thread when opening other?
+
+ - The dialog box shown in MI errors is ugly. Often, it contains names
+ of internal gdb functions, or no interest to outsiders.
+
+ - Should strip formatting when copying from gdb output window.
+
+ Console command interaction:
+
+ - Handle "Program exited" messages from CLI "continue".
+
+
+ Code cleanup:
+
+ - Rename FileLine to Code.
+
+ - Kill raw char* manipulation.
+
+ - Fix hardcoded color in framestack widget
+
+ - Kill 'trimmableItem'.
+
+ Minor tweaks:
+
+ - Need some "scope" for error reporting. Say, we can try to set invalid
+ breakpoint condition from session file, on debugger startup. Need to
+ produce message like:
+ "Error detected when setting condition for breakpoint 1",
+ not a pretty opaque error we get now.
+
+ - Highlight type changes in variable widget
+
+ - Highlight composite types changes?
+
+ - Test that modifying breakpoint while application is running works.
+
+ - If remembered expresion includes dereferences pointer as a child,
+ that child is still updated as we step.
+
+ - Error in 'finish' command (e.g. on the outer frame) hides the
+ current line indicator.
+
+ - Should disable the 'finish' command on the outer frame.
+
+ Optimizations:
+
+ - If we're in some function and looked at frame 0 and frame 1, and
+ then run "finish", we need to reuse VarFrameRoot for previous frame
+ 1, which now became frame 0, no need to recreate it. Generally, need
+ to preserve open/closed state of all variables for all scopes.
+
+
+
+
+
+
+BUGS/ISSUES found:
+
+ - "set edit off" breaks MI
+ - no stop reason for stop on shared library load
+ - using "interpreter mi -whatever" when already in MI
+ mode causes gdb to output two "^done" messages and
+ it confuses us.
+ - No support for "character" format in -data-evaluate-expression
+ or -var-set-format
+ - Some of the -stack* command operate on current frame unless one is
+ specified, but -stack-list-arguments will print all frames.
+
+ - Output of -thread-list-ids uses the following syntax
+
+ {thread-id="1",thread-id="2"}
+
+ which is neither tuple nor list.
+
+ - Pending breakpoits broken in MI.
+
+
+ - Varobj broken:
+
+ - When entering new scope, we need to issue -stack-list-locals
+ to get names of new varaibles in that scope.
+
+ - When stopping inside undebuggable code (say, on watchpoint hit),
+ -file-list-exec-source-file reports the last valid source file.
+
+ - It's not possible to find if intefiour is running or not.
+
+
+
+
+
+Advantages of MI
+
+
+- The information is easier to extract.
+
+ - For watchpoint, getting the old and new value of
+ watched expression for display is trivial. For CLI,
+ this is tricky and not done in current code.
+
+
+
+
+
+
diff --git a/languages/cpp/debugger/breakpoint.cpp b/languages/cpp/debugger/breakpoint.cpp
new file mode 100644
index 00000000..7bcf674f
--- /dev/null
+++ b/languages/cpp/debugger/breakpoint.cpp
@@ -0,0 +1,719 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "breakpoint.h"
+#include "gdbcontroller.h"
+#include "gdbcommand.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <qfileinfo.h>
+#include <qfontmetrics.h>
+#include <qpainter.h>
+#include <qregexp.h>
+#include <qstring.h>
+
+#include <stdio.h>
+#include <typeinfo>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+
+static int BPKey_ = 0;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+Breakpoint::Breakpoint(bool temporary, bool enabled)
+ : s_pending_(true),
+ s_actionAdd_(true),
+ s_actionClear_(false),
+ s_actionModify_(false),
+ s_actionDie_(false),
+ s_dbgProcessing_(false),
+ s_enabled_(enabled),
+ s_temporary_(temporary),
+ s_hardwareBP_(false),
+ s_tracingEnabled_(false),
+ s_traceFormatStringEnabled_(false),
+
+ dbgId_(-1),
+ hits_(0),
+ key_(BPKey_++),
+ active_(-1),
+ ignoreCount_(0),
+ condition_("")
+{
+}
+
+/***************************************************************************/
+
+Breakpoint::~Breakpoint()
+{
+}
+
+void Breakpoint::sendToGdb(GDBController* controller)
+{
+ // Need to issue 'modifyBreakpoint' when setting breakpoint is done
+ controller_ = controller;
+
+ // FIXME: should either make sure this widget is disabled
+ // when needed, or implement simular logic.
+ if (controller->stateIsOn(s_dbgNotStarted))
+ {
+ // Can't modify breakpoint now, will try again later.
+ setPending(true);
+ return;
+ }
+
+ setPending(false);
+
+ bool restart = false;
+ // FIXME: this will only catch command for which gdb
+ // produces the "^running" marker.
+ // FIXME: this probably won't work if there are other
+ // run commands in the thread already.
+ if (controller->stateIsOn(s_appRunning)
+ && !controller->stateIsOn(s_explicitBreakInto))
+ {
+ kdDebug(9012) << "PAUSING APP\n";
+ controller->pauseApp();
+ restart = true;
+ }
+
+ if (isActionAdd())
+ {
+ // This prevents us from sending breakpoint command to
+ // gdb for empty breakpoints, when user haven't even
+ // typed function name, or address, or variable.
+ //
+ // Check for isDbgProcessing makes sure we don't issue
+ // several -break-insert commands before getting
+ // output from the first one.
+ if (isValid() && !isDbgProcessing())
+ {
+ setBreakpoint(controller);
+ }
+ }
+ else
+ {
+ if (isActionClear())
+ {
+ clearBreakpoint(controller);
+ }
+ else
+ {
+ if (isActionModify())
+ {
+ modifyBreakpoint(controller);
+ }
+ }
+ }
+
+ if (restart) {
+ kdDebug(9012) << "RESTARING APP\n";
+ GDBCommand *cmd = new GDBCommand("-exec-continue");
+ cmd->setRun(true);
+ controller->addCommand(cmd);
+ }
+}
+
+void Breakpoint::clearBreakpoint(GDBController* /*c*/)
+{
+ controller()->addCommandBeforeRun(
+ new GDBCommand(dbgRemoveCommand(),
+ this,
+ &Breakpoint::handleDeleted));
+}
+
+void Breakpoint::applicationExited(GDBController*)
+{
+}
+
+
+void Breakpoint::setBreakpoint(GDBController* controller)
+{
+ setDbgProcessing(true);
+
+ // Don't use handler mechanism yet, because the reply
+ // should contain internal id of breakpoint (not gdb id), so that we
+ // can match gdb id with the breakpoint instance we've set.
+
+ // Note that at startup we issue several breakpoint commands, so can't
+ // just store last breakpoint. Need to stack of last breakpoint commands,
+ // but that for later.
+ //
+ // When this command is finished, slotParseGDBBreakpointSet
+ // will be called by the controller.
+ controller->addCommandBeforeRun(
+ new GDBCommand(dbgSetCommand(controller),
+ this,
+ &Breakpoint::handleSet, true));
+}
+
+
+void Breakpoint::modifyBreakpoint(GDBController* controller)
+{
+ controller->
+ addCommandBeforeRun(
+ new ModifyBreakpointCommand(QString("-break-condition %1 ") +
+ conditional(), this));
+ controller->
+ addCommandBeforeRun(
+ new ModifyBreakpointCommand(QString("-break-after %1 ") +
+ QString::number(ignoreCount()), this));
+
+ controller->
+ addCommandBeforeRun(
+ new ModifyBreakpointCommand(isEnabled() ?
+ QString("-break-enable %1")
+ : QString("-break-disable %1"), this));
+}
+
+void Breakpoint::removedInGdb()
+{
+ setActionDie();
+ emit modified(this);
+}
+
+
+bool Breakpoint::match(const Breakpoint* breakpoint) const
+{
+ // simple case
+ if (this == breakpoint)
+ return true;
+
+ // Type case
+ if (typeid(*this) != typeid(*breakpoint))
+ return false;
+
+ return match_data(breakpoint);
+}
+
+/***************************************************************************/
+
+QString Breakpoint::dbgRemoveCommand() const
+{
+ if (dbgId_>0)
+ return QString("-break-delete %1").arg(dbgId_); // gdb command - not translatable
+
+ return QString();
+}
+
+
+/***************************************************************************/
+
+// called when debugger ends
+void Breakpoint::reset()
+{
+ dbgId_ = -1;
+ s_pending_ = true;
+ s_actionAdd_ = true; // waiting for the debugger to start
+ s_actionClear_ = false;
+ // All breakpoint properties will be automatically sent to
+ // gdb when breakpoint is first added, no matter what value
+ // this field has.
+ s_actionModify_ = false;
+ s_dbgProcessing_ = false;
+ s_hardwareBP_ = false;
+ hits_ = 0;
+ active_ = -1;
+}
+
+/***************************************************************************/
+
+void Breakpoint::setActive(int active, int id)
+{
+ active_ = active;
+ dbgId_ = id;
+
+ if (s_pending_ && !(s_actionAdd_ && s_actionModify_)) {
+ s_pending_ = false;
+ s_actionModify_ = false;
+ }
+
+ s_actionAdd_ = false;
+ s_actionClear_ = false;
+ s_actionDie_ = false;
+ s_dbgProcessing_ = false;
+}
+
+/***************************************************************************/
+
+QString Breakpoint::statusDisplay(int activeFlag) const
+{
+ QString status="";
+ if (!s_enabled_)
+ status = i18n("Disabled");
+ else
+ if (s_pending_)
+ {
+ if (s_actionAdd_)
+ status = i18n("Pending (add)");
+ if (s_actionClear_)
+ status = i18n("Pending (clear)");
+ if (s_actionModify_)
+ status = i18n("Pending (modify)");
+ }
+ else
+ if (isActive(activeFlag))
+ status = i18n("Active");
+
+ return status;
+}
+
+QString Breakpoint::traceRealFormatString() const
+{
+ QString result;
+
+ if (traceFormatStringEnabled())
+ {
+ result = traceFormatString();
+ }
+ else
+ {
+ result = "Tracepoint";
+ if (const FilePosBreakpoint* fb
+ = dynamic_cast<const FilePosBreakpoint*>(this))
+ {
+ result += " at " + fb->location() + ": ";
+ }
+ else
+ {
+ result += " " + QString::number(key()) + ": ";
+ }
+ for(QStringList::const_iterator i = tracedExpressions_.begin(),
+ e = tracedExpressions_.end(); i != e; ++i)
+ {
+ result += " " + *i + " = %d";
+ }
+ }
+
+ // Quote the thing
+ result = "\"" + result + "\\n\"";
+
+ for(QStringList::const_iterator i = tracedExpressions_.begin(),
+ e = tracedExpressions_.end(); i != e; ++i)
+ {
+ result += ", " + *i;
+ }
+
+ return result;
+}
+
+void Breakpoint::handleSet(const GDBMI::ResultRecord& r)
+{
+ // Try to find gdb id. It's a bit harder that it should be,
+ // because field names differ depending on breakpoint type.
+
+ int id = -1;
+
+ if (r.hasField("bkpt"))
+ id = r["bkpt"]["number"].literal().toInt();
+ else if (r.hasField("wpt"))
+ id = r["wpt"]["number"].literal().toInt();
+ else if (r.hasField("hw-rwpt"))
+ id = r["hw-rwpt"]["number"].literal().toInt();
+ // We don't have access watchpoints in UI yet, but
+ // for future.
+ else if (r.hasField("hw-awpt"))
+ id = r["hw-awpt"]["number"].literal().toInt();
+
+ if (id == -1)
+ {
+ // If can't set because file not found yet,
+ // will need to try later.
+ setPending(true);
+ }
+ else
+ {
+ setActive(0 /* unused m_activeFlag */, id);
+ }
+
+ // Need to do this so that if breakpoint is not set
+ // (because the file is not found)
+ // we unset isDbgProcessing flag, so that breakpoint can
+ // be set on next stop.
+ setDbgProcessing(false);
+
+ // Immediately call modifyBreakpoint to set all breakpoint
+ // properties, such as condition.
+ modifyBreakpoint(controller_);
+
+ emit modified(this);
+}
+
+void Breakpoint::handleDeleted(const GDBMI::ResultRecord& /*r*/)
+{
+ kdDebug(9012) << "inside handleDeleted\n";
+ setActionDie();
+ if (FilePosBreakpoint* fp = dynamic_cast<FilePosBreakpoint*>(this))
+ {
+ kdDebug(9012) << "handleDeleted, line is " << fp->lineNum() << "\n";
+ }
+ emit modified(this);
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+FilePosBreakpoint::FilePosBreakpoint()
+: subtype_(filepos),
+ line_(-1)
+{}
+
+FilePosBreakpoint::FilePosBreakpoint(const QString &fileName, int lineNum,
+ bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled)
+{
+ // Sets 'subtype'
+ setLocation(QString("%1:%2").arg(fileName).arg(lineNum));
+}
+
+FilePosBreakpoint::~FilePosBreakpoint()
+{
+}
+
+QString FilePosBreakpoint::dbgSetCommand(GDBController *c) const
+{
+ QString cmdStr = "-break-insert";
+
+ if (isTemporary())
+ cmdStr = cmdStr + " -t";
+
+ if (c->miPendingBreakpoints())
+ cmdStr = cmdStr + " -f";
+
+ return cmdStr + " " + location_;
+}
+
+bool FilePosBreakpoint::match_data(const Breakpoint *xb) const
+{
+ const FilePosBreakpoint* b = static_cast<const FilePosBreakpoint*>(xb);
+
+ if (b)
+ return location_ == b->location_;
+ else
+ return false;
+}
+
+QString FilePosBreakpoint::displayType() const
+{
+ return i18n("Code breakpoint", "Code");
+}
+
+bool FilePosBreakpoint::isValid() const
+{
+ return !location_.isEmpty();
+}
+
+bool FilePosBreakpoint::hasFileAndLine() const
+{
+ return line_ != -1;
+}
+
+QString FilePosBreakpoint::fileName() const
+{
+ return fileName_;
+}
+
+unsigned FilePosBreakpoint::lineNum() const
+{
+ return line_;
+}
+
+
+
+QString FilePosBreakpoint::location(bool compact) const
+{
+ if (subtype_ == filepos && hasFileAndLine() && compact)
+ {
+ return QFileInfo(fileName_).fileName()+":"+QString::number(line_);
+ }
+ else
+ {
+ return location_;
+ }
+}
+
+/***************************************************************************/
+
+void FilePosBreakpoint::setLocation(const QString& location)
+{
+ location_ = location;
+
+ QRegExp regExp1("(.*):(\\d+)$");
+ regExp1.setMinimal(true);
+ if ( regExp1.search(location, 0) >= 0 )
+ {
+ subtype_ = filepos;
+
+ QString t = regExp1.cap(1);
+ QString dirPath = QFileInfo(t).dirPath();
+ if ( dirPath == "." )
+ {
+ QString existingDirPath = QFileInfo(fileName_).dirPath();
+ if (existingDirPath != ".")
+ fileName_ = existingDirPath+"/"+regExp1.cap(1);
+ else
+ fileName_ = regExp1.cap(1);
+ }
+ else
+ fileName_ = regExp1.cap(1);
+
+ line_ = regExp1.cap(2).toInt();
+
+ location_ = QString("%1:%2").arg(fileName_).arg(regExp1.cap(2));
+ }
+ else
+ {
+ // Could be address as well, but it's treated absolutely
+ // the same everywhere.
+ subtype_ = function;
+ }
+}
+
+void FilePosBreakpoint::handleSet(const GDBMI::ResultRecord& r)
+{
+ // Below logic gets filename and line from gdb response, and
+ // allows us to show breakpoint marker even for function
+ // breakpoints. Unfortunately, 'fullname' field is available only in
+ // post-6.4 versions of gdb and if we try to use 'file', then
+ // KDevelop won't be able to find that file to show the marker.
+ if (r.hasField("bkpt"))
+ {
+ const GDBMI::Value& v = r["bkpt"];
+ if (v.hasField("fullname") && v.hasField("line"))
+ {
+ fileName_ = v["fullname"].literal();
+ line_ = v["line"].literal().toInt();
+ }
+ }
+
+ Breakpoint::handleSet(r);
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+Watchpoint::Watchpoint(const QString& varName, bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled),
+ varName_(varName)
+{
+}
+
+/***************************************************************************/
+
+Watchpoint::~Watchpoint()
+{
+}
+
+void Watchpoint::setBreakpoint(GDBController* controller)
+{
+ if (isEnabled())
+ {
+ setDbgProcessing(true);
+
+ controller->addCommandBeforeRun(
+ new GDBCommand(
+ QString("-data-evaluate-expression &%1").arg(varName_),
+ this,
+ &Watchpoint::handleAddressComputed));
+ }
+}
+
+void Watchpoint::handleAddressComputed(const GDBMI::ResultRecord& r)
+{
+ address_ = r["value"].literal().toULongLong(0, 16);
+ controller()->addCommandBeforeRun(
+ new GDBCommand(
+ QString("-break-watch *%1").arg(r["value"].literal()),
+ static_cast<Breakpoint*>(this),
+ &Watchpoint::handleSet));
+}
+
+void Watchpoint::applicationExited(GDBController* c)
+{
+ if (!c->stateIsOn(s_dbgNotStarted))
+ {
+ // Note: not using 'clearBreakpoint' as it will delete breakpoint
+ // completely.
+
+ controller()->addCommand(
+ new GDBCommand(dbgRemoveCommand()));
+ setDbgId(-1);
+ setEnabled(false);
+ setActionAdd(true);
+ address_ = static_cast<unsigned long long>(-1);
+ emit modified(this);
+ }
+}
+
+void Watchpoint::removedInGdb()
+{
+ // Do nothing. Watchpoints must be preserved
+ // even if they are gone in gdb.
+}
+
+/***************************************************************************/
+
+QString Watchpoint::dbgSetCommand(GDBController *) const
+{
+ return QString("-break-watch ")+varName_; // gdb command - not translatable
+}
+
+/***************************************************************************/
+
+bool Watchpoint::match_data(const Breakpoint* xb) const
+{
+ const Watchpoint* b = static_cast<const Watchpoint*>(xb);
+
+ return (varName_ == b->varName_);
+}
+
+ReadWatchpoint::ReadWatchpoint(const QString& varName, bool temporary, bool enabled)
+ : Watchpoint(varName, temporary, enabled)
+{
+}
+
+QString ReadWatchpoint::dbgSetCommand(GDBController *) const
+{
+ return QString("-break-watch -r ")+varName();
+}
+
+bool ReadWatchpoint::match_data(const Breakpoint* xb) const
+{
+ const ReadWatchpoint* b = static_cast<const ReadWatchpoint*>(xb);
+
+ return (varName() == b->varName());
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+//ExitBreakpoint::ExitBreakpoint(bool temporary, bool enabled) :
+// Breakpoint(temporary, enabled)
+//{
+//}
+//
+///***************************************************************************/
+//
+//ExitBreakpoint::~ExitBreakpoint()
+//{
+//}
+//
+///***************************************************************************/
+//
+//QString ExitBreakpoint::dbgSetCommand() const
+//{
+// return "";
+//}
+//
+///***************************************************************************/
+//
+//bool ExitBreakpoint::match(const Breakpoint* brkpt) const
+//{
+// // simple case
+// if (this == brkpt)
+// return true;
+//
+// // Type case
+// const ExitBreakpoint* check = dynamic_cast<const ExitBreakpoint*>(brkpt);
+// if (!check)
+// return false;
+//
+// // member case
+// return true;
+//}
+//
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+//
+// These are implemented in gdb but can cause a lot of breakpoints
+// to be set. This needs more thought before being implemented
+
+//RegExpBreakpoint::RegExpBreakpoint(bool temporary, bool enabled) :
+// Breakpoint(temporary, enabled)
+//{
+//}
+//
+///***************************************************************************/
+//
+//RegExpBreakpoint::~RegExpBreakpoint()
+//{
+//}
+//
+///***************************************************************************/
+//
+//QString RegExpBreakpoint::dbgSetCommand() const
+//{
+// return "";
+//}
+//
+///***************************************************************************/
+//
+////QString RegExpBreakpoint::dbgRemoveCommand() const
+////{
+//// return "";
+////}
+//
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+// Most catch options arn't implemented in gdb so ignore this for now.
+
+//CatchBreakpoint::CatchBreakpoint(bool temporary, bool enabled) :
+// Breakpoint(temporary, enabled)
+//{
+//}
+//
+///***************************************************************************/
+//
+//CatchBreakpoint::~CatchBreakpoint()
+//{
+//}
+//
+///***************************************************************************/
+//
+//QString CatchBreakpoint::dbgSetCommand() const
+//{
+// return "";
+//}
+//
+///***************************************************************************/
+//
+////QString CatchBreakpoint::dbgRemoveCommand() const
+////{
+//// return "";
+////}
+//
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#include "breakpoint.moc"
diff --git a/languages/cpp/debugger/breakpoint.h b/languages/cpp/debugger/breakpoint.h
new file mode 100644
index 00000000..f06fc3d3
--- /dev/null
+++ b/languages/cpp/debugger/breakpoint.h
@@ -0,0 +1,313 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _BREAKPOINT_H_
+#define _BREAKPOINT_H_
+
+#include <klocale.h>
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBMI
+{
+ class ResultRecord;
+}
+
+namespace GDBDebugger
+{
+
+ class GDBController;
+
+enum BP_TYPES
+{
+ BP_TYPE_Invalid,
+ BP_TYPE_FilePos,
+ BP_TYPE_Watchpoint,
+ BP_TYPE_ReadWatchpoint
+};
+
+class Breakpoint : public QObject
+{
+ Q_OBJECT
+public:
+ Breakpoint(bool temporary=false, bool enabled=true);
+ virtual ~Breakpoint();
+
+ void sendToGdb(GDBController* c);
+
+ // Called whenever this breakpoint is removed on gdb side.
+ virtual void removedInGdb();
+
+ virtual void applicationExited(GDBController*);
+
+
+
+ virtual QString dbgSetCommand(GDBController *) const = 0;
+ virtual QString dbgRemoveCommand() const;
+ /** Returns true if 'breakpoint' is identical to *this.
+ Checks for trival cases like pointer equality and
+ differing typeid() and then calls virtual
+ match_data.
+ */
+ bool match(const Breakpoint* breakpoint) const;
+ /** Returns true if essential data in 'breakpoint' is equivalent
+ to *this. The caller should guarantee that dynamic type
+ of *this and *breakpoint is the same.
+ */
+ virtual bool match_data(const Breakpoint* breakpoint) const = 0;
+
+ virtual bool hasFileAndLine() const { return false; }
+
+
+ virtual void reset();
+
+ void setActive(int active, int id);
+ bool isActive(int active) const { return (active_ == active) ||
+ (s_pending_ && !s_actionClear_); }
+
+ void setEnabled(bool enabled) { s_enabled_ = enabled; }
+ bool isEnabled() const { return s_enabled_; }
+
+ void setTemporary(bool temporary) { s_temporary_ = temporary; }
+ bool isTemporary() const { return s_temporary_; }
+
+ void setHardwareBP(bool hardwareBP) { s_hardwareBP_ = hardwareBP; }
+ bool isHardwareBP() const { return s_hardwareBP_; }
+
+ void setIgnoreCount(int ignoreCount) { ignoreCount_ = ignoreCount; }
+ int ignoreCount() const { return ignoreCount_; }
+
+ void setAddress(const QString &address) { address_ = address; }
+ QString address() const { return address_; }
+
+ void setConditional(const QString &condition) { condition_ = condition; }
+ QString conditional() const { return condition_; }
+
+ void setPending(bool pending) { s_pending_ = pending; }
+ bool isPending() const { return s_pending_; }
+
+ void setActionAdd(bool actionAdd) { s_actionDie_ = false;
+ s_actionAdd_ = actionAdd; }
+ bool isActionAdd() const { return s_actionAdd_; }
+
+ void setActionClear(bool actionClear) { s_actionClear_ = actionClear; }
+ bool isActionClear() const { return s_actionClear_; }
+
+ void setActionModify(bool actionModify) { s_actionDie_ = false;
+ s_actionModify_ = actionModify; }
+ bool isActionModify() const { return s_actionModify_; }
+
+ void setDbgProcessing(bool dbgProcessing) { s_dbgProcessing_ = dbgProcessing; }
+ bool isDbgProcessing() const { return s_dbgProcessing_; }
+ void setActionDie() { s_actionDie_ = true;
+ s_actionClear_ = false; }
+ bool isActionDie() const { return s_actionDie_; }
+
+ int key() const { return key_; }
+ void setDbgId(int dbgId) { dbgId_ = dbgId; }
+ int dbgId() const { return dbgId_; }
+ void setHits(int hits) { hits_ = hits; }
+ int hits() const { return hits_; }
+
+ virtual QString statusDisplay(int activeFlag) const;
+ virtual BP_TYPES type() const { return BP_TYPE_Invalid; }
+ virtual QString displayType() const { return i18n( "Invalid" ); }
+
+
+ bool tracingEnabled() const { return s_tracingEnabled_; }
+ void setTracingEnabled(bool enable) { s_tracingEnabled_ = enable; }
+
+ const QStringList& tracedExpressions() const { return tracedExpressions_; }
+ void setTracedExpressions(const QStringList& l) { tracedExpressions_ = l; }
+
+ bool traceFormatStringEnabled() const { return s_traceFormatStringEnabled_; }
+ void setTraceFormatStringEnabled(bool en) { s_traceFormatStringEnabled_ = en; }
+
+ const QString& traceFormatString() const { return traceFormatString_; }
+ void setTraceFormatString(const QString& s) { traceFormatString_ = s; }
+
+ QString traceRealFormatString() const;
+
+ virtual QString location(bool compact=true) const = 0;
+ virtual void setLocation(const QString& ) = 0;
+ virtual bool isValid() const = 0;
+
+signals:
+ /** Emitted whenever this breakpoint is modified from gdb side,
+ say when it's first created, or when gdb reports that any
+ property has changes.
+ */
+ void modified(Breakpoint*);
+
+private:
+ void handleDeleted(const GDBMI::ResultRecord&);
+ virtual void setBreakpoint(GDBController* controller);
+ void modifyBreakpoint(GDBController* controller);
+
+protected:
+ GDBController* controller() const { return controller_; }
+ virtual void handleSet(const GDBMI::ResultRecord&);
+ void clearBreakpoint(GDBController* c);
+
+private:
+ bool s_pending_ :1;
+ bool s_actionAdd_ :1;
+ bool s_actionClear_ :1;
+ bool s_actionModify_ :1;
+ bool s_actionDie_ :1;
+ bool s_dbgProcessing_ :1;
+ bool s_enabled_ :1;
+ bool s_temporary_ :1;
+ bool s_hardwareBP_ :1; // assigned by gdb
+ bool s_tracingEnabled_ :1;
+ bool s_traceFormatStringEnabled_ :1;
+
+ int dbgId_; // assigned by gdb
+ int hits_; // assigned by gdb
+
+ int key_; // internal unique key
+ int active_; // counter incremented on receipt of all BP's
+
+ int ignoreCount_;
+ QString address_;
+ QString condition_;
+ QStringList tracedExpressions_;
+ QString traceFormatString_;
+
+ GDBController* controller_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class FilePosBreakpoint : public Breakpoint
+{
+public:
+ FilePosBreakpoint();
+
+ FilePosBreakpoint(const QString &fileName, int lineNum,
+ bool temporary=false, bool enabled=true);
+ virtual ~FilePosBreakpoint();
+ virtual QString dbgSetCommand(GDBController *) const;
+ virtual bool match_data(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_FilePos; }
+ QString displayType() const;
+ QString location(bool compact=true) const;
+ void setLocation(const QString& location);
+ bool isValid() const;
+
+ bool hasFileAndLine() const;
+ QString fileName() const;
+ unsigned lineNum() const;
+
+protected:
+ void handleSet(const GDBMI::ResultRecord&);
+
+
+private:
+
+ enum subtype { filepos = 1, function, address };
+ subtype subtype_;
+
+ QString location_;
+ QString fileName_;
+ int line_;
+};
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+//class RegExpBreakpoint : public Breakpoint
+//{
+//public:
+// RegExpBreakpoint(bool temporary=false, bool enabled=true);
+// virtual ~RegExpBreakpoint();
+// virtual QString dbgSetCommand() const;
+//};
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+//class CatchBreakpoint : public Breakpoint
+//{
+//public:
+// CatchBreakpoint(bool temporary=false, bool enabled=true);
+// virtual ~CatchBreakpoint();
+// virtual QString dbgSetCommand() const;
+// virtual CatchBreakpoint& operator=(const CatchBreakpoint& rhs);
+//};
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+//class ExitBreakpoint : public Breakpoint
+//{
+//public:
+// ExitBreakpoint(bool temporary=false, bool enabled=true);
+// virtual ~ExitBreakpoint();
+// virtual QString dbgSetCommand() const;
+// bool match(const Breakpoint* brkpt) const;
+// virtual void configureDisplay();
+//};
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class Watchpoint : public Breakpoint
+{
+public:
+ Watchpoint(const QString &varName, bool temporary=false, bool enabled=true);
+ virtual ~Watchpoint();
+ virtual QString dbgSetCommand(GDBController *) const;
+
+ void applicationExited(GDBController*);
+ void removedInGdb();
+
+ bool match_data(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_Watchpoint; }
+ QString displayType() const { return i18n("Watchpoint"); }
+ void setVarName(const QString& varName) { varName_ = varName; }
+ QString varName() const { return varName_; }
+ unsigned long long address() const { return address_; }
+ QString location(bool) const { return varName_; }
+ void setLocation(const QString& location) { varName_ = location; }
+ bool isValid() const { return !varName_.isEmpty(); }
+
+private:
+ void setBreakpoint(GDBController* controller);
+ void handleAddressComputed(const GDBMI::ResultRecord&);
+
+ QString varName_;
+ unsigned long long address_;
+};
+
+class ReadWatchpoint : public Watchpoint
+{
+public:
+ ReadWatchpoint(const QString &varName, bool temporary=false, bool enabled=true);
+ virtual QString dbgSetCommand(GDBController *) const;
+ bool match_data(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_ReadWatchpoint; }
+ QString displayType() const { return i18n("Read Watchpoint"); }
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/dbgcontroller.cpp b/languages/cpp/debugger/dbgcontroller.cpp
new file mode 100644
index 00000000..6ca94543
--- /dev/null
+++ b/languages/cpp/debugger/dbgcontroller.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "dbgcontroller.h"
+#include <kprocess.h>
+
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+
+DbgController::DbgController()
+ : dbgProcess_(0)
+{
+}
+
+/***************************************************************************/
+
+DbgController::~DbgController()
+{
+ delete dbgProcess_;
+}
+
+/***************************************************************************/
+
+}
+
+#include "dbgcontroller.moc"
diff --git a/languages/cpp/debugger/dbgcontroller.h b/languages/cpp/debugger/dbgcontroller.h
new file mode 100644
index 00000000..8d13f2d0
--- /dev/null
+++ b/languages/cpp/debugger/dbgcontroller.h
@@ -0,0 +1,128 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DBGCONTROLLER_H_
+#define _DBGCONTROLLER_H_
+
+#include "mi/gdbmi.h"
+
+#include <qobject.h>
+#include <domutil.h>
+
+
+
+class KProcess;
+class QString;
+class QStrList;
+
+namespace GDBDebugger
+{
+
+class Breakpoint;
+class DbgCommand;
+class TrimmableItem;
+class VarItem;
+
+
+/***************************************************************************/
+/**
+ * @author jbb
+ */
+/***************************************************************************/
+// sigh - namespace's don't work on some of the older compilers
+enum DBGStateFlags
+{
+ s_dbgNotStarted = 1,
+ s_appNotStarted = 2,
+ s_waitForWrite = 8,
+ s_programExited = 16,
+ s_viewBT = 128,
+ s_viewBP = 256,
+ s_attached = 512,
+ s_core = 1024,
+ s_waitTimer = 2048,
+ // Set when 'slotStopDebugger' started executing, to avoid
+ // entering that function several times.
+ s_shuttingDown = 4096,
+ s_explicitBreakInto = (s_shuttingDown << 1),
+ s_dbgBusy = (s_explicitBreakInto << 1),
+ s_appRunning = (s_dbgBusy << 1),
+ s_lastDbgState = (s_appRunning << 1)
+
+};
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class DbgController : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ DbgController();
+ virtual ~DbgController();
+
+ virtual bool stateIsOn( int state ) = 0;
+
+public slots:
+ virtual void configure() = 0;
+
+ virtual void slotCoreFile(const QString &coreFile) = 0;
+ virtual void slotAttachTo(int pid) = 0;
+
+ virtual void slotStopDebugger() = 0;
+
+ virtual void slotRun() = 0;
+ // Kills the application but does not stop the debugger itself.
+ virtual void slotKill() = 0;
+ virtual void slotRunUntil(const QString &fileName, int lineNum) = 0;
+ virtual void slotJumpTo(const QString &fileName, int lineNum) = 0;
+ virtual void slotStepInto() = 0;
+ virtual void slotStepOver() = 0;
+ virtual void slotStepIntoIns() = 0;
+ virtual void slotStepOverIns() = 0;
+ virtual void slotStepOutOff() = 0;
+
+ virtual void slotBreakInto() = 0;
+
+ // jw - for optional additional commands and initialization
+ virtual void slotVarItemConstructed(VarItem */*item*/) {}
+
+protected slots:
+ virtual void slotDbgStdout(KProcess *proc, char *buf, int buflen) = 0;
+ virtual void slotDbgStderr(KProcess*, char*, int) {} ;
+ virtual void slotDbgWroteStdin(KProcess *proc) = 0;
+ virtual void slotDbgProcessExited(KProcess *proc) = 0;
+
+signals:
+ void gotoSourcePosition (const QString &fileName, int lineNum);
+ void rawGDBMemoryDump (char *buf);
+ void rawGDBRegisters (char *buf);
+ void rawGDBLibraries (char *buf);
+ void ttyStdout (const char *output);
+ void ttyStderr (const char *output);
+ void gdbInternalCommandStdout (const char *output);
+ void gdbUserCommandStdout (const char *output);
+ void gdbStderr (const char *output);
+ void showStepInSource (const QString &fileName, int lineNum, const QString &address);
+ void dbgStatus (const QString &status, int statusFlag);
+
+protected:
+ KProcess *dbgProcess_;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/dbgpsdlg.cpp b/languages/cpp/debugger/dbgpsdlg.cpp
new file mode 100644
index 00000000..524e4539
--- /dev/null
+++ b/languages/cpp/debugger/dbgpsdlg.cpp
@@ -0,0 +1,203 @@
+/***************************************************************************
+ begin : Mon Sep 20 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "dbgpsdlg.h"
+
+#include <kbuttonbox.h>
+#include <kdialog.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+#include <klistview.h>
+#include <klistviewsearchline.h>
+#include <kmessagebox.h>
+
+#include <qframe.h>
+#include <qlabel.h>
+#include <qlayout.h>
+
+#include <qtoolbutton.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qheader.h>
+#include <qtimer.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+
+namespace GDBDebugger
+{
+
+/***************************************************************************/
+
+// Display a list of processes for the user to select one
+// only display processes that they can do something with so if the user
+// is root then display all processes
+// For use with the internal debugger, but this dialog doesn't know anything
+// about why it's doing it.
+
+Dbg_PS_Dialog::Dbg_PS_Dialog(QWidget *parent, const char *name)
+ : KDialog(parent, name, true), // modal
+ psProc_(0),
+ pids_(new KListView(this)),
+ pidLines_(QString())
+{
+ setCaption(i18n("Attach to Process"));
+
+ pids_->addColumn("PID");
+ pids_->addColumn("TTY");
+ pids_->addColumn("STAT");
+ pids_->addColumn("TIME");
+ pids_->addColumn("COMMAND");
+
+
+ QBoxLayout *topLayout = new QVBoxLayout(this, 5);
+
+ searchLineWidget_ = new KListViewSearchLineWidget(pids_, this);
+ topLayout->addWidget(searchLineWidget_);
+
+ topLayout->addWidget(pids_);
+ pids_->setFont(KGlobalSettings::fixedFont());
+
+ KButtonBox *buttonbox = new KButtonBox(this, Qt::Horizontal);
+ buttonbox->addStretch();
+ QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+ buttonbox->layout();
+ topLayout->addWidget(buttonbox);
+
+ connect(ok, SIGNAL(clicked()), SLOT(accept()));
+ connect(cancel, SIGNAL(clicked()), SLOT(reject()));
+
+ // Default display to 40 chars wide, default height is okay
+ resize( ((KGlobalSettings::fixedFont()).pointSize())*40, height());
+ topLayout->activate();
+
+ QTimer::singleShot(0, this, SLOT(slotInit()));
+
+}
+
+/***************************************************************************/
+
+Dbg_PS_Dialog::~Dbg_PS_Dialog()
+{
+ delete psProc_;
+}
+
+/***************************************************************************/
+
+int Dbg_PS_Dialog::pidSelected()
+{
+ return pids_->currentItem()->text(0).toInt();
+}
+
+/***************************************************************************/
+void Dbg_PS_Dialog::slotInit()
+{
+ psProc_ = new KShellProcess("/bin/sh");
+#ifdef USE_SOLARIS
+ *psProc_ << "ps";
+ *psProc_ << "-opid";
+ *psProc_ << "-otty";
+ *psProc_ << "-os";
+ *psProc_ << "-otime";
+ *psProc_ << "-oargs";
+ pidCmd_ = "ps -opid -otty -os -otime -oargs";
+
+ if (getuid() == 0) {
+ *psProc_ << "-e";
+ pidCmd_ += " -e";
+ }
+#else
+ *psProc_ << "ps";
+ *psProc_ << "x";
+ pidCmd_ = "ps x";
+
+ if (getuid() == 0) {
+ *psProc_ << "a";
+ pidCmd_ += " a";
+ }
+#endif
+
+ connect( psProc_, SIGNAL(processExited(KProcess *)), SLOT(slotProcessExited()) );
+ connect( psProc_, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(slotReceivedOutput(KProcess *, char *, int)) );
+
+ psProc_->start(KProcess::NotifyOnExit, KProcess::Stdout);
+}
+
+/***************************************************************************/
+
+void Dbg_PS_Dialog::slotReceivedOutput(KProcess */*proc*/, char *buffer, int buflen)
+{
+ pidLines_ += QString::fromLocal8Bit(buffer, buflen);
+}
+
+/***************************************************************************/
+
+void Dbg_PS_Dialog::slotProcessExited()
+{
+ delete psProc_;
+ psProc_ = 0;
+
+ pidLines_ += '\n';
+
+ int start = pidLines_.find('\n', 0); // Skip the first line (header line)
+ int pos;
+
+ static QRegExp ps_output_line("^\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(.+)");
+ while ( (pos = pidLines_.find('\n', start)) != -1) {
+
+ QString item = pidLines_.mid(start, pos-start);
+ if (!item.isEmpty() && item.find(pidCmd_) == -1)
+ {
+ if(ps_output_line.search(item) == -1)
+ {
+ KMessageBox::information(
+ this,
+ // FIXME: probably should XML-escape 'item' before passing it
+ // to 'arg'.
+ i18n("<b>Could not parse output from the <tt>ps</tt> command.</b>"
+ "<p>The following line could not be parsed:"
+ "<b><tt>%1</tt>").arg(item),
+ i18n("Internal error"), "gdb_error" );
+ break;
+ }
+
+ new QListViewItem(pids_,
+ ps_output_line.cap(1),
+ ps_output_line.cap(2),
+ ps_output_line.cap(3),
+ ps_output_line.cap(4),
+ ps_output_line.cap(5));
+ }
+
+ start = pos+1;
+ }
+ // Need to set focus here too, as KListView will
+ // 'steal' it otherwise.
+ searchLineWidget_->searchLine()->setFocus();
+}
+
+void Dbg_PS_Dialog::focusIn(QFocusEvent*)
+{
+ searchLineWidget_->searchLine()->setFocus();
+}
+
+}
+
+/***************************************************************************/
+#include "dbgpsdlg.moc"
diff --git a/languages/cpp/debugger/dbgpsdlg.h b/languages/cpp/debugger/dbgpsdlg.h
new file mode 100644
index 00000000..d88eb72f
--- /dev/null
+++ b/languages/cpp/debugger/dbgpsdlg.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Mon Sep 20 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DBGPSDLG_H_
+#define _DBGPSDLG_H_
+
+#include <kdialog.h>
+
+class QListBox;
+class KProcess;
+class KListView;
+class KListViewSearchLineWidget;
+
+namespace GDBDebugger
+{
+
+/***************************************************************************/
+
+class Dbg_PS_Dialog : public KDialog
+{
+ Q_OBJECT
+
+public:
+ Dbg_PS_Dialog( QWidget *parent=0, const char *name=0 );
+ ~Dbg_PS_Dialog();
+
+ int pidSelected();
+
+private slots:
+ void slotInit();
+ void slotReceivedOutput(KProcess *proc, char *buffer, int buflen);
+ void slotProcessExited();
+
+protected:
+ void focusIn(QFocusEvent*);
+
+private:
+ KProcess* psProc_;
+ KListView* pids_;
+ KListViewSearchLineWidget* searchLineWidget_;
+ QString pidLines_;
+ QString pidCmd_;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/dbgtoolbar.cpp b/languages/cpp/debugger/dbgtoolbar.cpp
new file mode 100644
index 00000000..a3e58343
--- /dev/null
+++ b/languages/cpp/debugger/dbgtoolbar.cpp
@@ -0,0 +1,498 @@
+/***************************************************************************
+ begin : Thu Dec 23 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef QT_MAC
+#include "dbgtoolbar.h"
+#include "debuggerpart.h"
+#include "dbgcontroller.h"
+
+#include <kdockwindow.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kstandarddirs.h>
+#include <kwin.h>
+#include <kwinmodule.h>
+
+#include <qapplication.h>
+#include <qcursor.h>
+#include <qframe.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// Implements a floating toolbar for the debugger.
+
+// Unfortunately, I couldn't get the KToolBar to work nicely when it
+// was floating, so I was forced to write these classes. I'm not sure whether
+// I didn't try hard enough or ... and I've forgotten what the problems were
+// now.
+
+// The problem with using this is that it will not dock as a normal toolbar.
+// I'm not convince that this is a real problem though.
+
+// So, if you can get it to work as a KToolBar, and it works well when the
+// app is running, then all these classes can be removed.
+
+// This code is very specific to the internal debugger in kdevelop.
+
+namespace GDBDebugger
+{
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// This just allows the user to click on the toolbar and drag it somewhere else.
+// I would have preferred to use normal decoration on the toolbar and removed
+// the iconify, close, etc buttons from the window title but again I kept running
+// into problems. Instead, I used no decoration and this class. Also this looks
+// similar to the KToolBar floating style.
+class DbgMoveHandle : public QFrame
+{
+public:
+ DbgMoveHandle(DbgToolBar *parent=0, const char * name=0, WFlags f=0);
+ virtual ~DbgMoveHandle();
+
+ virtual void mousePressEvent(QMouseEvent *e);
+ virtual void mouseReleaseEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent(QMouseEvent *e);
+
+private:
+ DbgToolBar* toolBar_;
+ QPoint offset_;
+ bool moving_;
+};
+
+// **************************************************************************
+
+DbgMoveHandle::DbgMoveHandle(DbgToolBar *parent, const char * name, WFlags f)
+ : QFrame(parent, name, f),
+ toolBar_(parent),
+ offset_(QPoint(0,0)),
+ moving_(false)
+{
+ setFrameStyle(QFrame::Panel|QFrame::Raised);
+ setFixedHeight(12);
+}
+
+// **************************************************************************
+
+DbgMoveHandle::~DbgMoveHandle()
+{
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mousePressEvent(QMouseEvent *e)
+{
+ QFrame::mousePressEvent(e);
+ if (moving_)
+ return;
+
+ if (e->button() == RightButton) {
+ KPopupMenu *menu = new KPopupMenu(this);
+ menu->insertTitle(i18n("Debug Toolbar"));
+ menu->insertItem(i18n("Dock to Panel"),
+ parent(), SLOT(slotDock()));
+ menu->insertItem(i18n("Dock to Panel && Iconify KDevelop"),
+ parent(), SLOT(slotIconifyAndDock()));
+ menu->popup(e->globalPos());
+ } else {
+ moving_ = true;
+ offset_ = parentWidget()->pos() - e->globalPos();
+ setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ QApplication::setOverrideCursor(QCursor(sizeAllCursor));
+ setPalette(QPalette(colorGroup().background()));
+ repaint();
+ }
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mouseReleaseEvent(QMouseEvent *e)
+{
+ QFrame::mouseReleaseEvent(e);
+ moving_ = false;
+ offset_ = QPoint(0,0);
+ setFrameStyle(QFrame::Panel|QFrame::Raised);
+ QApplication::restoreOverrideCursor();
+ setPalette(QPalette(colorGroup().background()));
+ repaint();
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mouseMoveEvent(QMouseEvent *e)
+{
+ QFrame::mouseMoveEvent(e);
+ if (!moving_)
+ return;
+
+ toolBar_->move(e->globalPos() + offset_);
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// This class adds text _and_ a pixmap to a button. Why doesn't QPushButton
+// support that? It only allowed text _or_ pixmap.
+class DbgButton : public QPushButton
+{
+public:
+ DbgButton(const QPixmap &pixmap, const QString &text,
+ DbgToolBar *parent, const char *name=0);
+ virtual ~DbgButton() {};
+ void drawButtonLabel(QPainter *painter);
+ QSize sizeHint() const;
+
+private:
+ QPixmap pixmap_;
+};
+
+// **************************************************************************
+
+DbgButton::DbgButton(const QPixmap& pixmap, const QString& text,
+ DbgToolBar* parent, const char* name)
+ : QPushButton(parent, name),
+ pixmap_(pixmap)
+{
+ setText(text);
+}
+
+// **************************************************************************
+
+void DbgButton::drawButtonLabel(QPainter *painter)
+{
+ // We always have a pixmap (today...)
+ // Centre it if there's no text
+
+ bool hasText = !text().isEmpty();
+ int x = ((hasText ? height() : width()) - pixmap_.width()) / 2;
+ int y = (height() - pixmap_.height()) / 2;
+ painter->drawPixmap(x, y, pixmap_);
+
+ if (hasText) {
+ painter->setPen(colorGroup().text());
+ painter->drawText(height()+2, 0, width()-(height()+2), height(), AlignLeft|AlignVCenter, text());
+ }
+}
+
+// **************************************************************************
+
+QSize DbgButton::sizeHint() const
+{
+ if (text().isEmpty())
+ return pixmap_.size();
+ else
+ {
+ QSize ps = pixmap_.size();
+ QSize bs = QPushButton::sizeHint();
+ QSize result;
+ result.setWidth( ps.width() + bs.width()+10 );
+ result.setHeight( ps.height() > bs.height() ? ps.height() : bs.height() );
+ return result;
+ }
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+DbgDocker::DbgDocker(QWidget* parent, DbgToolBar* toolBar, const QPixmap& pixmap) :
+ KSystemTray(parent, "DbgDocker"),
+ toolBar_(toolBar)
+{
+ setPixmap(pixmap);
+ QToolTip::add( this, i18n("KDevelop debugger: Click to execute one line of code (\"step\")") );
+}
+
+// **************************************************************************
+
+void DbgDocker::mousePressEvent(QMouseEvent *e)
+{
+ if (!rect().contains( e->pos()))
+ return;
+
+ switch (e->button()) {
+ case LeftButton:
+ {
+ // Not really a click, but it'll hold for the time being !!!
+ emit clicked();
+ break;
+ }
+ case RightButton:
+ {
+ KPopupMenu* menu = new KPopupMenu(this);
+ menu->insertTitle(i18n("Debug Toolbar"));
+ menu->insertItem(i18n("Activate"), toolBar_, SLOT(slotUndock()));
+ menu->insertItem(i18n("Activate (KDevelop gets focus)"), toolBar_, SLOT(slotActivateAndUndock()));
+ menu->popup(e->globalPos());
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+DbgToolBar::DbgToolBar(DebuggerPart* part,
+ QWidget* parent, const char* name)
+ : QFrame(0, name),
+ part_(part),
+ activeWindow_(0),
+ winModule_(0),
+ bKDevFocus_(0),
+ bPrevFocus_(0),
+ appIsActive_(false),
+ docked_(false),
+ docker_(0),
+ dockWindow_(new KSystemTray(parent))
+{
+ winModule_ = new KWinModule(this);
+ docker_ = new DbgDocker(parent, this, BarIcon("dbgnext"));
+ connect(docker_, SIGNAL(clicked()), part_, SLOT(slotStepOver()));
+
+ // Must have noFocus set so that we can see what window was active.
+ // see slotDbgKdevFocus() for more comments
+ // I do not want the user to be able to "close" this widget. If we have any
+ // decoration then they can and that is bad.
+ // This widget is closed when the debugger finishes i.e. they press "Stop"
+
+ // Do we need NoFocus???
+ KWin::setState(winId(), NET::StaysOnTop | NET::SkipTaskbar);
+// KWin::setType(winId(), NET::Override); // So it has no decoration
+ KWin::setType(winId(), NET::Dock);
+
+ setFocusPolicy(NoFocus);
+ setFrameStyle( QFrame::Box | QFrame::Plain );
+ setLineWidth(4);
+ setMidLineWidth(0);
+
+ QBoxLayout* topLayout = new QVBoxLayout(this);
+
+ QBoxLayout* nextLayout = new QHBoxLayout();
+ QBoxLayout* stepLayout = new QHBoxLayout();
+ QBoxLayout* focusLayout = new QHBoxLayout();
+
+ DbgMoveHandle* moveHandle= new DbgMoveHandle(this);
+
+ QPushButton* bRun = new DbgButton(BarIcon("dbgrun"), i18n("Run"), this);
+ QPushButton* bInterrupt = new DbgButton(BarIcon("player_pause"), i18n("Interrupt"), this);
+ QPushButton* bNext = new DbgButton(BarIcon("dbgnext"), QString::null, this);
+ QPushButton* bNexti = new DbgButton(BarIcon("dbgnextinst"), QString::null, this);
+ QPushButton* bStep = new DbgButton(BarIcon("dbgstep"), QString::null, this);
+ QPushButton* bStepi = new DbgButton(BarIcon("dbgstepinst"), QString::null, this);
+ QPushButton* bFinish = new DbgButton(BarIcon("dbgstepout"), i18n("Step Out"), this);
+ QPushButton* bRunTo = new DbgButton(BarIcon("dbgrunto"), i18n("Run to Cursor"), this);
+ QPushButton* bView = new DbgButton(BarIcon("dbgmemview"), i18n("Viewers"), this);
+ bKDevFocus_ = new DbgButton(BarIcon("kdevelop"), QString::null, this);
+ bPrevFocus_ = new DbgButton(BarIcon("dbgmemview"), QString::null, this);
+
+ connect(bRun, SIGNAL(clicked()), part_, SLOT(slotRun()));
+ connect(bInterrupt, SIGNAL(clicked()), part_, SLOT(slotPause()));
+ connect(bNext, SIGNAL(clicked()), part_, SLOT(slotStepOver()));
+ connect(bNexti, SIGNAL(clicked()), part_, SLOT(slotStepOverInstruction()));
+ connect(bStep, SIGNAL(clicked()), part_, SLOT(slotStepInto()));
+ connect(bStepi, SIGNAL(clicked()), part_, SLOT(slotStepIntoInstruction()));
+ connect(bFinish, SIGNAL(clicked()), part_, SLOT(slotStepOut()));
+ connect(bRunTo, SIGNAL(clicked()), part_, SLOT(slotRunToCursor()));
+ connect(bView, SIGNAL(clicked()), part_, SLOT(slotMemoryView()));
+ connect(bKDevFocus_, SIGNAL(clicked()), this, SLOT(slotKdevFocus()));
+ connect(bPrevFocus_, SIGNAL(clicked()), this, SLOT(slotPrevFocus()));
+
+ QToolTip::add( bRun, i18n("Continue with application execution, may start the application") );
+ QToolTip::add( bInterrupt, i18n("Interrupt the application execution") );
+ QToolTip::add( bNext, i18n("Execute one line of code, but run through functions") );
+ QToolTip::add( bNexti, i18n("Execute one assembler instruction, but run through functions") );
+ QToolTip::add( bStep, i18n("Execute one line of code, stepping into functions if appropriate") );
+ QToolTip::add( bStepi, i18n("Execute one assembler instruction, stepping into functions if appropriate") );
+ QToolTip::add( bFinish, i18n("Execute to end of current stack frame") );
+ QToolTip::add( bRunTo, i18n("Continues execution until the cursor position is reached.") );
+ QToolTip::add( bView, i18n("Memory, dissemble, registers, library viewers") );
+ QToolTip::add( bKDevFocus_, i18n("Set focus on KDevelop") );
+ QToolTip::add( bPrevFocus_, i18n("Set focus on window that had focus when KDevelop got focus") );
+
+ QWhatsThis::add( bRun, i18n("Continue with application execution. May start the application.") );
+ QWhatsThis::add( bInterrupt, i18n("Interrupt the application execution.") );
+ QWhatsThis::add( bNext, i18n("Execute one line of code, but run through functions.") );
+ QWhatsThis::add( bNexti, i18n("Execute one assembler instruction, but run through functions.") );
+ QWhatsThis::add( bStep, i18n("Execute one line of code, stepping into functions if appropriate.") );
+ QWhatsThis::add( bStepi, i18n("Execute one assembler instruction, stepping into functions if appropriate.") );
+ QWhatsThis::add( bFinish, i18n("Execute to end of current stack frame.") );
+ QWhatsThis::add( bRunTo, i18n("Continues execution until the cursor position is reached.") );
+ QWhatsThis::add( bView, i18n("Memory, dissemble, registers, library viewers.") );
+ QWhatsThis::add( bKDevFocus_, i18n("Set focus on KDevelop.") );
+ QWhatsThis::add( bPrevFocus_, i18n("Set focus on window that had focus when KDevelop got focus.") );
+
+ topLayout->addWidget(moveHandle);
+ topLayout->addWidget(bRun);
+ topLayout->addLayout(nextLayout);
+ topLayout->addLayout(stepLayout);
+ topLayout->addWidget(bFinish);
+ topLayout->addWidget(bRunTo);
+ topLayout->addWidget(bView);
+ topLayout->addWidget(bInterrupt);
+ topLayout->addLayout(focusLayout);
+
+ focusLayout->addWidget(bKDevFocus_);
+ focusLayout->addWidget(bPrevFocus_);
+
+ stepLayout->addWidget(bStep);
+ stepLayout->addWidget(bStepi);
+
+ nextLayout->addWidget(bNext);
+ nextLayout->addWidget(bNexti);
+
+// int w = QMAX(bRun->sizeHint().width(), bFinish->sizeHint().width());
+// w = QMAX(w, bInterrupt->sizeHint().width());
+// w = QMAX(w, bView->sizeHint().width());
+
+ // they should have the same height, so don't be too fussy
+// int h = bFinish->sizeHint().height();
+//
+// bNext->setMinimumHeight(h);
+// bNexti->setMinimumHeight(h);
+// bStep->setMinimumHeight(h);
+// bStepi->setMinimumHeight(h);
+// bKDevFocus_->setMinimumHeight(h);
+// bPrevFocus_->setMinimumHeight(h);
+
+// setMinimumSize(w+10, h*7);
+// setMaximumSize(w+10, h*7);
+
+ setAppIndicator(appIsActive_);
+ topLayout->activate();
+}
+
+// **************************************************************************
+
+DbgToolBar::~DbgToolBar()
+{
+ slotUndock();
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotKdevFocus()
+{
+ // I really want to be able to set the focus on the _application_ being debugged
+ // but this is the best compromise I can come up with. All we do is save the
+ // window that had focus when they switch to the kdevelop window. To do this
+ // the toolbar _cannot_ accept focus.
+ // If anyone has a way of determining what window the app is _actually_ running on
+ // then please fix and send a patch.
+
+ if (winModule_->activeWindow() != topLevelWidget()->winId())
+ activeWindow_ = winModule_->activeWindow();
+
+ KWin::activateWindow(topLevelWidget()->winId());
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotPrevFocus()
+{
+ KWin::activateWindow(activeWindow_);
+}
+
+// **************************************************************************
+
+// If the app is active then the app button is highlighted, otherwise
+// kdev button is highlighted.
+void DbgToolBar::slotDbgStatus(const QString&, int state)
+{
+ bool appIndicator = state & s_dbgBusy;
+ if (appIndicator != appIsActive_) {
+ setAppIndicator(appIndicator);
+ appIsActive_ = appIndicator;
+ }
+}
+
+// **************************************************************************
+
+void DbgToolBar::setAppIndicator(bool appIndicator)
+{
+ if (appIndicator) {
+ bPrevFocus_->setPalette(QPalette(colorGroup().mid()));
+ bKDevFocus_->setPalette(QPalette(colorGroup().background()));
+ } else {
+ bPrevFocus_->setPalette(QPalette(colorGroup().background()));
+ bKDevFocus_->setPalette(QPalette(colorGroup().mid()));
+ }
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotDock()
+{
+ if (docked_)
+ return;
+
+ // Q_ASSERT(!docker_);
+ hide();
+
+ docker_->show();
+ docked_ = true;
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotIconifyAndDock()
+{
+ if (docked_)
+ return;
+
+ // KWin::iconifyWindow(ckDevelop_->winId(), true);
+ slotDock();
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotUndock()
+{
+ if (!docked_)
+ return;
+
+ show();
+ docker_->hide();
+ docked_ = false;
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotActivateAndUndock()
+{
+ if (!docked_)
+ return;
+
+ KWin::activateWindow(topLevelWidget()->winId());
+ slotUndock();
+}
+
+}
+
+// **************************************************************************
+#include "dbgtoolbar.moc"
+#endif
diff --git a/languages/cpp/debugger/dbgtoolbar.h b/languages/cpp/debugger/dbgtoolbar.h
new file mode 100644
index 00000000..4f284701
--- /dev/null
+++ b/languages/cpp/debugger/dbgtoolbar.h
@@ -0,0 +1,85 @@
+/***************************************************************************
+ begin : Thu Dec 23 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *q
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef QT_MAC
+#ifndef _DBGTOOLBAR_H_
+#define _DBGTOOLBAR_H_
+
+class KWinModule;
+
+#include <ksystemtray.h>
+#include <kwin.h> // needed for WId :(
+
+#include <qframe.h>
+
+namespace GDBDebugger
+{
+
+class DbgButton;
+class DbgToolBar;
+class DebuggerPart;
+
+class DbgDocker : public KSystemTray
+{
+ Q_OBJECT
+
+public:
+ DbgDocker(QWidget *parent, DbgToolBar *toolBar, const QPixmap &pixmap);
+ virtual ~DbgDocker() {};
+ virtual void mousePressEvent(QMouseEvent *e);
+
+signals:
+ void clicked();
+
+private:
+ DbgToolBar* toolBar_;
+};
+
+
+class DbgToolBar : public QFrame
+{
+ Q_OBJECT
+
+public:
+ DbgToolBar(DebuggerPart *part, QWidget* parent, const char* name=0);
+ virtual ~DbgToolBar();
+
+private slots:
+ void slotDbgStatus(const QString&, int);
+ void slotDock();
+ void slotUndock();
+ void slotIconifyAndDock();
+ void slotActivateAndUndock();
+
+ void slotKdevFocus();
+ void slotPrevFocus();
+
+private:
+ void setAppIndicator(bool appIndicator);
+
+ DebuggerPart* part_;
+ WId activeWindow_;
+ KWinModule* winModule_;
+ DbgButton* bKDevFocus_;
+ DbgButton* bPrevFocus_;
+ bool appIsActive_;
+ bool docked_;
+ DbgDocker* docker_;
+ KSystemTray* dockWindow_;
+};
+
+}
+
+#endif
+#endif
diff --git a/languages/cpp/debugger/debuggerconfigwidget.cpp b/languages/cpp/debugger/debuggerconfigwidget.cpp
new file mode 100644
index 00000000..93e52e64
--- /dev/null
+++ b/languages/cpp/debugger/debuggerconfigwidget.cpp
@@ -0,0 +1,138 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "debuggerconfigwidget.h"
+
+#include "debuggerpart.h"
+#include "kdevproject.h"
+
+#include "domutil.h"
+#include <kurlrequester.h>
+#include <klineedit.h>
+
+#include <qcheckbox.h>
+#include <qfileinfo.h>
+#include <qradiobutton.h>
+
+namespace GDBDebugger
+{
+
+DebuggerConfigWidget::DebuggerConfigWidget(DebuggerPart* part, QWidget *parent, const char *name)
+ : DebuggerConfigWidgetBase(parent, name), dom(*part->projectDom())
+{
+ gdbPath_edit->setMode(KFile::File|KFile::ExistingOnly|KFile::LocalOnly);
+
+ gdbPath_edit->setURL( DomUtil::readEntry(dom, "/kdevdebugger/general/gdbpath"));
+
+ QString shell = DomUtil::readEntry(dom, "/kdevdebugger/general/dbgshell","no_value");
+ if( shell == QString("no_value") )
+ {
+ QFileInfo info( part->project()->buildDirectory() + "/libtool" );
+ if( info.exists() ) {
+ shell = "libtool";
+ } else {
+ // Try one directory up.
+ info.setFile( part->project()->buildDirectory() + "/../libtool" );
+ if( info.exists() ) {
+ shell = "../libtool";
+ } else {
+ // Give up.
+ shell = QString::null;
+ }
+ }
+ }
+ debuggingShell_edit->setURL( shell );
+
+ // Use setFile instead?
+ configGdbScript_edit->setURL( DomUtil::readEntry(dom, "/kdevdebugger/general/configGdbScript"));
+ runShellScript_edit ->setURL( DomUtil::readEntry(dom, "/kdevdebugger/general/runShellScript"));
+ runGdbScript_edit ->setURL( DomUtil::readEntry(dom, "/kdevdebugger/general/runGdbScript"));
+
+ displayStaticMembers_box->setChecked( DomUtil::readBoolEntry(dom, "/kdevdebugger/display/staticmembers", false));
+ asmDemangle_box->setChecked( DomUtil::readBoolEntry(dom, "/kdevdebugger/display/demanglenames", true));
+ breakOnLoadingLibrary_box->setChecked( DomUtil::readBoolEntry(dom, "/kdevdebugger/general/breakonloadinglibs", true));
+ dbgTerminal_box->setChecked( DomUtil::readBoolEntry(dom, "/kdevdebugger/general/separatetty", false));
+ enableFloatingToolBar_box->setChecked( DomUtil::readBoolEntry(dom, "/kdevdebugger/general/floatingtoolbar", false));
+ int outputRadix = DomUtil::readIntEntry(dom, "/kdevdebugger/display/outputradix", 10);
+
+ switch (outputRadix)
+ {
+ case 8:
+ outputRadixOctal->setChecked(true);
+ break;
+ case 16:
+ outputRadixHexadecimal->setChecked(true);
+ break;
+ case 10:
+ default:
+ outputRadixDecimal->setChecked(true);
+ break;
+ }
+
+
+ if( DomUtil::readBoolEntry( dom, "/kdevdebugger/general/raiseGDBOnStart", false ) )
+ {
+ radioGDB->setChecked(true);
+ }else
+ {
+ radioFramestack->setChecked(true);
+ }
+
+ // ??? DomUtil::readEntry(dom, "/kdevdebugger/general/allowforcedbpset");
+
+ resize(sizeHint());
+}
+
+
+DebuggerConfigWidget::~DebuggerConfigWidget()
+{}
+
+
+void DebuggerConfigWidget::accept()
+{
+ DomUtil::writeEntry(dom, "/kdevdebugger/general/gdbpath", gdbPath_edit->url());
+ DomUtil::writeEntry(dom, "/kdevdebugger/general/dbgshell", debuggingShell_edit->url());
+
+ DomUtil::writeEntry(dom, "/kdevdebugger/general/configGdbScript", configGdbScript_edit->url());
+ DomUtil::writeEntry(dom, "/kdevdebugger/general/runShellScript", runShellScript_edit ->url());
+ DomUtil::writeEntry(dom, "/kdevdebugger/general/runGdbScript", runGdbScript_edit ->url());
+
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/display/staticmembers", displayStaticMembers_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/display/demanglenames", asmDemangle_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/general/breakonloadinglibs", breakOnLoadingLibrary_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/general/separatetty", dbgTerminal_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/general/floatingtoolbar", enableFloatingToolBar_box->isChecked());
+
+ int outputRadix;
+ if (outputRadixOctal->isChecked())
+ outputRadix = 8;
+ else if (outputRadixHexadecimal->isChecked())
+ outputRadix = 16;
+ else
+ outputRadix = 10;
+
+ DomUtil::writeIntEntry(dom, "/kdevdebugger/display/outputradix", outputRadix);
+
+ if( radioGDB->isChecked() )
+ {
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/general/raiseGDBOnStart", true);
+ }else
+ {
+ DomUtil::writeBoolEntry(dom, "/kdevdebugger/general/raiseGDBOnStart", false);
+ }
+
+}
+
+}
+
+#include "debuggerconfigwidget.moc"
diff --git a/languages/cpp/debugger/debuggerconfigwidget.h b/languages/cpp/debugger/debuggerconfigwidget.h
new file mode 100644
index 00000000..dbf63d4b
--- /dev/null
+++ b/languages/cpp/debugger/debuggerconfigwidget.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DEBUGGERCONFIGWIDGET_H_
+#define _DEBUGGERCONFIGWIDGET_H_
+
+#include "debuggerconfigwidgetbase.h"
+
+#include <qdom.h>
+
+namespace GDBDebugger
+{
+
+class DebuggerPart;
+
+class DebuggerConfigWidget : public DebuggerConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ DebuggerConfigWidget( DebuggerPart* part, QWidget *parent=0, const char *name=0 );
+ ~DebuggerConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ QDomDocument &dom;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/debuggerconfigwidgetbase.ui b/languages/cpp/debugger/debuggerconfigwidgetbase.ui
new file mode 100644
index 00000000..bf81b2d3
--- /dev/null
+++ b/languages/cpp/debugger/debuggerconfigwidgetbase.ui
@@ -0,0 +1,453 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DebuggerConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>debugger_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>558</width>
+ <height>627</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Debugger Configuration</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Debug arguments can be set on the Run Options page
+ or directly in the project manager</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>gdbPath_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Debugger executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>gdbPath_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>gdbPath_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Gdb executable</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>To run "gdb" binary from $PATH, leave this field empty. To run custom gdb, for example, for a different architecture, enter the executable name here. You can either run gdb from $PATH, but with a different name (say, "arm-gdb"), by typing the name here, or specify full path to the gdb executable.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>debuggingShell_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Debugging &amp;shell:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>debuggingShell_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Run gdb in a special shell (mainly for automake projects)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you want gdb to be executed by a special shell or tool insert it here. The main use-case is for Automake based projects where the application is actually only a script and libtool is needed to get it to run inside gdb.</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>debuggingShell_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Run gdb in a special shell (mainly for automake projects)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you want gdb to be executed by a special shell or tool insert it here. The main use-case is for Automake based projects where the application is actually only a script and &lt;b&gt;libtool&lt;/b&gt; is needed to get it to run inside gdb.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>asmDemangle_box</cstring>
+ </property>
+ <property name="text">
+ <string>Display &amp;demangled names</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When displaying the disassembled code you
+can select to see the methods' mangled names.
+However, non-mangled names are easier to read.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>breakOnLoadingLibrary_box</cstring>
+ </property>
+ <property name="text">
+ <string>Try settings &amp;breakpoints on library loading</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If GDB has not seen a library that will be loaded via
+"dlopen" then it will refuse to set a breakpoint in that code.
+We can get GDB to stop on a library load and hence
+try to set the pending breakpoints. See the documentation
+for more details relating to this behavior.
+
+If you are not "dlopen"ing libs then leave this unchecked.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>dbgTerminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>Enable separate terminal for application &amp;IO</string>
+ </property>
+ <property name="accel">
+ <string>Alt+I</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This allows you to enter terminal input when your
+application contains terminal input code (e.g. cin, fgets, etc.).
+If you use terminal input in your application then check this option.
+Otherwise leave it unchecked.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>enableFloatingToolBar_box</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;nable floating toolbar</string>
+ </property>
+ <property name="accel">
+ <string>Alt+N</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use the floating toolbar. This toolbar always stays
+on top of all windows so that if the app covers KDevelop
+you have control of the app through the small toolbar. It
+can also be docked into the panel.
+
+This toolbar is in addition to the toolbar in KDevelop.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>displayStaticMembers_box</cstring>
+ </property>
+ <property name="text">
+ <string>Display static &amp;members</string>
+ </property>
+ <property name="accel">
+ <string>Alt+M</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Displaying static members makes GDB slower in
+producing data within KDE and Qt.
+It may change the "signature" of the data
+which QString and friends rely on,
+but if you need to debug into these values then
+check this option.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>globalOutputRadix</cstring>
+ </property>
+ <property name="title">
+ <string>Global Output Radix</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>outputRadixOctal</cstring>
+ </property>
+ <property name="text">
+ <string>Oct&amp;al</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>outputRadixHexadecimal</cstring>
+ </property>
+ <property name="text">
+ <string>He&amp;xadecimal</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>outputRadixDecimal</cstring>
+ </property>
+ <property name="text">
+ <string>Decimal</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Start Debugger With</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioFramestack</cstring>
+ </property>
+ <property name="text">
+ <string>Framestack</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioGDB</cstring>
+ </property>
+ <property name="text">
+ <string>GDB Output</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Remote Debugging</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This script is intended for the actual commands needed to connect to a remotely running executable.
+ shell sleep 5 wait for remote program to start
+ target remote ... connect to the remote debugger
+ continue [optional] run debugging to the first breakpoint.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>runShellScript_label</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;un shell script:</string>
+ <comment>Shell script to be executed at run time</comment>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>runShellScript_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="1">
+ <property name="name">
+ <cstring>runGdbScript_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Script to connect with remote application</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This script is sourced by gdb after the two preceding scripts have been executed.
+This script is intended for the actual commands needed to connect to a remotely running executable.
+ shell sleep 5 wait for remote program to start
+ target remote ... connect to the remote debugger
+ continue [optional] run debugging to the first breakpoint.</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="1">
+ <property name="name">
+ <cstring>runShellScript_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Script to start remote application</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This shell script is run after the Config gdb script has been sourced by gdb.
+When debugging remotely this script is intended to actually start the remote process.
+[It is expected that the debug executable can be reached on the target, maybe by downloading it as a final build step]
+1) Find a way to execute a command remotely - rsh, ssh, telnet, ...
+2a) Execute "gdbserver ... application" on target.
+or if your executable contains the gdb stub
+2b) Execute "application" on target.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>runGdbScript_label</cstring>
+ </property>
+ <property name="text">
+ <string>Run &amp;gdb script:</string>
+ <comment>Gdb script to be executed at run time.</comment>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>runGdbScript_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>configGdbScript_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Config gdb script:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>configGdbScript_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>configGdbScript_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Gdb configure script</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This script is sourced by gdb when the debugging starts.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</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>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>debuggingShell_edit</tabstop>
+ <tabstop>gdbPath_edit</tabstop>
+ <tabstop>displayStaticMembers_box</tabstop>
+ <tabstop>asmDemangle_box</tabstop>
+ <tabstop>breakOnLoadingLibrary_box</tabstop>
+ <tabstop>enableFloatingToolBar_box</tabstop>
+ <tabstop>dbgTerminal_box</tabstop>
+ <tabstop>outputRadixOctal</tabstop>
+ <tabstop>outputRadixDecimal</tabstop>
+ <tabstop>outputRadixHexadecimal</tabstop>
+ <tabstop>configGdbScript_edit</tabstop>
+ <tabstop>runShellScript_edit</tabstop>
+ <tabstop>runGdbScript_edit</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/debugger/debuggerdcopinterface.h b/languages/cpp/debugger/debuggerdcopinterface.h
new file mode 100644
index 00000000..4a9bcf30
--- /dev/null
+++ b/languages/cpp/debugger/debuggerdcopinterface.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 2003 Hamish Rodda <rodda@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef DEBUGGERDCOPINTERFACE_H
+#define DEBUGGERDCOPINTERFACE_H
+
+#include <dcopobject.h>
+
+/**
+ * Enables dcop communication with the debugger part.
+ */
+class DebuggerDCOPInterface : public DCOPObject
+{
+ K_DCOP
+public:
+
+k_dcop:
+ virtual ASYNC slotDebugExternalProcess() = 0;
+ virtual ASYNC slotDebugCommandLine(const QString& command) = 0;
+};
+
+#endif
diff --git a/languages/cpp/debugger/debuggerpart.cpp b/languages/cpp/debugger/debuggerpart.cpp
new file mode 100644
index 00000000..c8c3c1a1
--- /dev/null
+++ b/languages/cpp/debugger/debuggerpart.cpp
@@ -0,0 +1,1272 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "debuggerpart.h"
+#include "label_with_double_click.h"
+
+#include <qdir.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <qpopupmenu.h>
+#include <qtooltip.h>
+
+#include <kaction.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kstatusbar.h>
+#include <kparts/part.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <qtimer.h>
+#include <kstringhandler.h>
+#include <kdockwidget.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "kdevdebugger.h"
+#include "domutil.h"
+#include "variablewidget.h"
+#include "gdbbreakpointwidget.h"
+#include "framestackwidget.h"
+#include "disassemblewidget.h"
+#include "processwidget.h"
+#include "gdbcontroller.h"
+#include "breakpoint.h"
+#include "dbgpsdlg.h"
+#include "dbgtoolbar.h"
+#include "memviewdlg.h"
+#include "gdbparser.h"
+#include "gdboutputwidget.h"
+#include "debuggerconfigwidget.h"
+#include "processlinemaker.h"
+
+#include <iostream>
+
+#include <kdevplugininfo.h>
+#include <debugger.h>
+
+
+
+
+
+namespace GDBDebugger
+{
+
+static const KDevPluginInfo data("kdevdebugger");
+
+typedef KDevGenericFactory<DebuggerPart> DebuggerFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevdebugger, DebuggerFactory( data ) )
+
+DebuggerPart::DebuggerPart( QObject *parent, const char *name, const QStringList & ) :
+ KDevPlugin( &data, parent, name ? name : "DebuggerPart" ),
+ controller(0), previousDebuggerState_(s_dbgNotStarted),
+ justRestarted_(false), needRebuild_(true),
+ running_(false)
+{
+ setObjId("DebuggerInterface");
+ setInstance(DebuggerFactory::instance());
+
+ setXMLFile("kdevdebugger.rc");
+
+ m_debugger = new Debugger( partController() );
+
+ statusBarIndicator = new LabelWithDoubleClick(
+ " ", mainWindow()->statusBar());
+ statusBarIndicator->setFixedWidth(15);
+ statusBarIndicator->setAlignment(Qt::AlignCenter);
+ mainWindow()->statusBar()->addWidget(statusBarIndicator, 0, true);
+ statusBarIndicator->show();
+
+ // Setup widgets and dbgcontroller
+
+ controller = new GDBController(*projectDom());
+
+
+ gdbBreakpointWidget = new GDBBreakpointWidget( controller,
+ 0, "gdbBreakpointWidget" );
+ gdbBreakpointWidget->setCaption(i18n("Breakpoint List"));
+ QWhatsThis::add
+ (gdbBreakpointWidget, i18n("<b>Breakpoint list</b><p>"
+ "Displays a list of breakpoints with "
+ "their current status. Clicking on a "
+ "breakpoint item allows you to change "
+ "the breakpoint and will take you "
+ "to the source in the editor window."));
+ gdbBreakpointWidget->setIcon( SmallIcon("stop") );
+ mainWindow()->embedOutputView(gdbBreakpointWidget, i18n("Breakpoints"), i18n("Debugger breakpoints"));
+
+ variableWidget = new VariableWidget( controller,
+ gdbBreakpointWidget,
+ 0, "variablewidget");
+ mainWindow()->embedSelectView(variableWidget, i18n("Variables"),
+ i18n("Debugger variable-view"));
+ mainWindow()->setViewAvailable(variableWidget, false);
+
+ framestackWidget = new FramestackWidget( controller, 0, "framestackWidget" );
+ framestackWidget->setEnabled(false);
+ framestackWidget->setCaption(i18n("Frame Stack"));
+ QWhatsThis::add
+ (framestackWidget, i18n("<b>Frame stack</b><p>"
+ "Often referred to as the \"call stack\", "
+ "this is a list showing what function is "
+ "currently active and who called each "
+ "function to get to this point in your "
+ "program. By clicking on an item you "
+ "can see the values in any of the "
+ "previous calling functions."));
+ framestackWidget->setIcon( SmallIcon("table") );
+ mainWindow()->embedOutputView(framestackWidget, i18n("Frame Stack"), i18n("Debugger function call stack"));
+ mainWindow()->setViewAvailable(framestackWidget, false);
+
+ disassembleWidget = new DisassembleWidget( controller, 0, "disassembleWidget" );
+ disassembleWidget->setEnabled(false);
+ disassembleWidget->setCaption(i18n("Machine Code Display"));
+ QWhatsThis::add
+ (disassembleWidget, i18n("<b>Machine code display</b><p>"
+ "A machine code view into your running "
+ "executable with the current instruction "
+ "highlighted. You can step instruction by "
+ "instruction using the debuggers toolbar "
+ "buttons of \"step over\" instruction and "
+ "\"step into\" instruction."));
+ disassembleWidget->setIcon( SmallIcon("gear") );
+ mainWindow()->embedOutputView(disassembleWidget, i18n("Disassemble"),
+ i18n("Debugger disassemble view"));
+ mainWindow()->setViewAvailable(disassembleWidget, false);
+
+ gdbOutputWidget = new GDBOutputWidget( 0, "gdbOutputWidget" );
+ gdbOutputWidget->setEnabled(false);
+ gdbOutputWidget->setIcon( SmallIcon("inline_image") );
+ gdbOutputWidget->setCaption(i18n("GDB Output"));
+ QWhatsThis::add
+ (gdbOutputWidget, i18n("<b>GDB output</b><p>"
+ "Shows all gdb commands being executed. "
+ "You can also issue any other gdb command while debugging."));
+ mainWindow()->embedOutputView(gdbOutputWidget, i18n("GDB"),
+ i18n("GDB output"));
+ mainWindow()->setViewAvailable(gdbOutputWidget, false);
+
+ // gdbBreakpointWidget -> this
+ connect( gdbBreakpointWidget, SIGNAL(refreshBPState(const Breakpoint&)),
+ this, SLOT(slotRefreshBPState(const Breakpoint&)));
+ connect( gdbBreakpointWidget, SIGNAL(publishBPState(const Breakpoint&)),
+ this, SLOT(slotRefreshBPState(const Breakpoint&)));
+ connect( gdbBreakpointWidget, SIGNAL(gotoSourcePosition(const QString&, int)),
+ this, SLOT(slotGotoSource(const QString&, int)) );
+
+
+ viewerWidget = new ViewerWidget( controller, 0, "viewerWidget");
+ mainWindow()->embedSelectView(viewerWidget,
+ i18n("Debug views"),
+ i18n("Special debugger views"));
+ mainWindow()->setViewAvailable(viewerWidget, false);
+ connect(viewerWidget, SIGNAL(setViewShown(bool)),
+ this, SLOT(slotShowView(bool)));
+
+ // Now setup the actions
+ KAction *action;
+
+// action = new KAction(i18n("&Start"), "1rightarrow", CTRL+SHIFT+Key_F9,
+ action = new KAction(i18n("&Start"), "dbgrun", Key_F9,
+ this, SLOT(slotRun()),
+ actionCollection(), "debug_run");
+ action->setToolTip( i18n("Start in debugger") );
+ action->setWhatsThis( i18n("<b>Start in debugger</b><p>"
+ "Starts the debugger with the project's main "
+ "executable. You may set some breakpoints "
+ "before this, or you can interrupt the program "
+ "while it is running, in order to get information "
+ "about variables, frame stack, and so on.") );
+
+ action = new KAction(i18n("&Restart"), "dbgrestart", 0,
+ this, SLOT(slotRestart()),
+ actionCollection(), "debug_restart");
+ action->setToolTip( i18n("Restart program") );
+ action->setWhatsThis( i18n("<b>Restarts application</b><p>"
+ "Restarts applications from the beginning."
+ ) );
+ action->setEnabled(false);
+
+
+ action = new KAction(i18n("Sto&p"), "stop", 0,
+ this, SLOT(slotStop()),
+ actionCollection(), "debug_stop");
+ action->setToolTip( i18n("Stop debugger") );
+ action->setWhatsThis(i18n("<b>Stop debugger</b><p>Kills the executable and exits the debugger."));
+
+ action = new KAction(i18n("Interrupt"), "player_pause", 0,
+ this, SLOT(slotPause()),
+ actionCollection(), "debug_pause");
+ action->setToolTip( i18n("Interrupt application") );
+ action->setWhatsThis(i18n("<b>Interrupt application</b><p>Interrupts the debugged process or current GDB command."));
+
+ action = new KAction(i18n("Run to &Cursor"), "dbgrunto", 0,
+ this, SLOT(slotRunToCursor()),
+ actionCollection(), "debug_runtocursor");
+ action->setToolTip( i18n("Run to cursor") );
+ action->setWhatsThis(i18n("<b>Run to cursor</b><p>Continues execution until the cursor position is reached."));
+
+
+ action = new KAction(i18n("Set E&xecution Position to Cursor"), "dbgjumpto", 0,
+ this, SLOT(slotJumpToCursor()),
+ actionCollection(), "debug_jumptocursor");
+ action->setToolTip( i18n("Jump to cursor") );
+ action->setWhatsThis(i18n("<b>Set Execution Position </b><p>Set the execution pointer to the current cursor position."));
+
+
+ action = new KAction(i18n("Step &Over"), "dbgnext", Key_F10,
+ this, SLOT(slotStepOver()),
+ actionCollection(), "debug_stepover");
+ action->setToolTip( i18n("Step over the next line") );
+ action->setWhatsThis( i18n("<b>Step over</b><p>"
+ "Executes one line of source in the current source file. "
+ "If the source line is a call to a function the whole "
+ "function is executed and the app will stop at the line "
+ "following the function call.") );
+
+
+ action = new KAction(i18n("Step over Ins&truction"), "dbgnextinst", 0,
+ this, SLOT(slotStepOverInstruction()),
+ actionCollection(), "debug_stepoverinst");
+ action->setToolTip( i18n("Step over instruction") );
+ action->setWhatsThis(i18n("<b>Step over instruction</b><p>Steps over the next assembly instruction."));
+
+
+ action = new KAction(i18n("Step &Into"), "dbgstep", Key_F11,
+ this, SLOT(slotStepInto()),
+ actionCollection(), "debug_stepinto");
+ action->setToolTip( i18n("Step into the next statement") );
+ action->setWhatsThis( i18n("<b>Step into</b><p>"
+ "Executes exactly one line of source. If the source line "
+ "is a call to a function then execution will stop after "
+ "the function has been entered.") );
+
+
+ action = new KAction(i18n("Step into I&nstruction"), "dbgstepinst", 0,
+ this, SLOT(slotStepIntoInstruction()),
+ actionCollection(), "debug_stepintoinst");
+ action->setToolTip( i18n("Step into instruction") );
+ action->setWhatsThis(i18n("<b>Step into instruction</b><p>Steps into the next assembly instruction."));
+
+
+ action = new KAction(i18n("Step O&ut"), "dbgstepout", Key_F12,
+ this, SLOT(slotStepOut()),
+ actionCollection(), "debug_stepout");
+ action->setToolTip( i18n("Steps out of the current function") );
+ action->setWhatsThis( i18n("<b>Step out</b><p>"
+ "Executes the application until the currently executing "
+ "function is completed. The debugger will then display "
+ "the line after the original call to that function. If "
+ "program execution is in the outermost frame (i.e. in "
+ "main()) then this operation has no effect.") );
+
+
+ action = new KAction(i18n("Viewers"), "dbgmemview", 0,
+ this, SLOT(slotMemoryView()),
+ actionCollection(), "debug_memview");
+ action->setToolTip( i18n("Debugger viewers") );
+ action->setWhatsThis(i18n("<b>Debugger viewers</b><p>Various information about application being executed. There are 4 views available:<br>"
+ "<b>Memory</b><br>"
+ "<b>Disassemble</b><br>"
+ "<b>Registers</b><br>"
+ "<b>Libraries</b>"));
+
+
+ action = new KAction(i18n("Examine Core File..."), "core", 0,
+ this, SLOT(slotExamineCore()),
+ actionCollection(), "debug_core");
+ action->setToolTip( i18n("Examine core file") );
+ action->setWhatsThis( i18n("<b>Examine core file</b><p>"
+ "This loads a core file, which is typically created "
+ "after the application has crashed, e.g. with a "
+ "segmentation fault. The core file contains an "
+ "image of the program memory at the time it crashed, "
+ "allowing you to do a post-mortem analysis.") );
+
+
+ action = new KAction(i18n("Attach to Process"), "connect_creating", 0,
+ this, SLOT(slotAttachProcess()),
+ actionCollection(), "debug_attach");
+ action->setToolTip( i18n("Attach to process") );
+ action->setWhatsThis(i18n("<b>Attach to process</b><p>Attaches the debugger to a running process."));
+
+ action = new KAction(i18n("Toggle Breakpoint"), 0, 0,
+ this, SLOT(toggleBreakpoint()),
+ actionCollection(), "debug_toggle_breakpoint");
+ action->setToolTip(i18n("Toggle breakpoint"));
+ action->setWhatsThis(i18n("<b>Toggle breakpoint</b><p>Toggles the breakpoint at the current line in editor."));
+
+ connect( mainWindow()->main()->guiFactory(), SIGNAL(clientAdded(KXMLGUIClient*)),
+ this, SLOT(guiClientAdded(KXMLGUIClient*)) );
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ connect( partController(), SIGNAL(loadedFile(const KURL &)),
+ gdbBreakpointWidget, SLOT(slotRefreshBP(const KURL &)) );
+ connect( debugger(), SIGNAL(toggledBreakpoint(const QString &, int)),
+ gdbBreakpointWidget, SLOT(slotToggleBreakpoint(const QString &, int)) );
+ connect( debugger(), SIGNAL(editedBreakpoint(const QString &, int)),
+ gdbBreakpointWidget, SLOT(slotEditBreakpoint(const QString &, int)) );
+ connect( debugger(), SIGNAL(toggledBreakpointEnabled(const QString &, int)),
+ gdbBreakpointWidget, SLOT(slotToggleBreakpointEnabled(const QString &, int)) );
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStop(KDevPlugin*)) );
+ connect( core(), SIGNAL(projectClosed()),
+ this, SLOT(projectClosed()) );
+
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+
+ procLineMaker = new ProcessLineMaker();
+
+ connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)),
+ appFrontend(), SLOT(insertStdoutLine(const QCString&)) );
+ connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)),
+ appFrontend(), SLOT(insertStderrLine(const QCString&)) );
+
+ connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)),
+ appFrontend(), SLOT(addPartialStdoutLine(const QCString&)));
+ connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)),
+ appFrontend(), SLOT(addPartialStderrLine(const QCString&)));
+
+ // The output from tracepoints goes to "application" window, because
+ // we don't have any better alternative, and using yet another window
+ // is undesirable. Besides, this makes tracepoint look even more similar
+ // to printf debugging.
+ connect( gdbBreakpointWidget, SIGNAL(tracingOutput(const char*)),
+ procLineMaker, SLOT(slotReceivedStdout(const char*)));
+
+
+ connect(partController(), SIGNAL(savedFile(const KURL &)),
+ this, SLOT(slotFileSaved()));
+
+ if (project())
+ connect(project(), SIGNAL(projectCompiled()),
+ this, SLOT(slotProjectCompiled()));
+
+ setupController();
+ QTimer::singleShot(0, this, SLOT(setupDcop()));
+}
+
+void DebuggerPart::setupDcop()
+{
+ QCStringList objects = kapp->dcopClient()->registeredApplications();
+ for (QCStringList::Iterator it = objects.begin(); it != objects.end(); ++it)
+ if ((*it).find("drkonqi-") == 0)
+ slotDCOPApplicationRegistered(*it);
+
+ connect(kapp->dcopClient(), SIGNAL(applicationRegistered(const QCString&)), SLOT(slotDCOPApplicationRegistered(const QCString&)));
+ kapp->dcopClient()->setNotifications(true);
+}
+
+void DebuggerPart::slotDCOPApplicationRegistered(const QCString& appId)
+{
+ if (appId.find("drkonqi-") == 0) {
+ QByteArray answer;
+ QCString replyType;
+
+ kapp->dcopClient()->call(appId, "krashinfo", "appName()", QByteArray(), replyType, answer, true, 5000);
+
+ QDataStream d(answer, IO_ReadOnly);
+ QCString appName;
+ d >> appName;
+
+ if (appName.length() && project() && project()->mainProgram().endsWith(appName)) {
+ kapp->dcopClient()->send(appId, "krashinfo", "registerDebuggingApplication(QString)", i18n("Debug in &KDevelop"));
+ connectDCOPSignal(appId, "krashinfo", "acceptDebuggingApplication()", "slotDebugExternalProcess()", true);
+ }
+ }
+}
+
+ASYNC DebuggerPart::slotDebugExternalProcess()
+{
+ QByteArray answer;
+ QCString replyType;
+
+ kapp->dcopClient()->call(kapp->dcopClient()->senderId(), "krashinfo", "pid()", QByteArray(), replyType, answer, true, 5000);
+
+ QDataStream d(answer, IO_ReadOnly);
+ int pid;
+ d >> pid;
+
+ if (attachProcess(pid) && m_drkonqi.isEmpty()) {
+ m_drkonqi = kapp->dcopClient()->senderId();
+ QTimer::singleShot(15000, this, SLOT(slotCloseDrKonqi()));
+ mainWindow()->raiseView(framestackWidget);
+ }
+
+ mainWindow()->main()->raise();
+}
+
+ASYNC DebuggerPart::slotDebugCommandLine(const QString& /*command*/)
+{
+ KMessageBox::information(0, "Asked to debug command line");
+}
+
+void DebuggerPart::slotCloseDrKonqi()
+{
+ kapp->dcopClient()->send(m_drkonqi, "MainApplication-Interface", "quit()", QByteArray());
+ m_drkonqi = "";
+}
+
+DebuggerPart::~DebuggerPart()
+{
+ kapp->dcopClient()->setNotifications(false);
+
+ if (variableWidget)
+ mainWindow()->removeView(variableWidget);
+ if (gdbBreakpointWidget)
+ mainWindow()->removeView(gdbBreakpointWidget);
+ if (framestackWidget)
+ mainWindow()->removeView(framestackWidget);
+ if (disassembleWidget)
+ mainWindow()->removeView(disassembleWidget);
+ if(gdbOutputWidget)
+ mainWindow()->removeView(gdbOutputWidget);
+
+ delete variableWidget;
+ delete gdbBreakpointWidget;
+ delete framestackWidget;
+ delete disassembleWidget;
+ delete gdbOutputWidget;
+ delete controller;
+ delete floatingToolBar;
+ delete statusBarIndicator;
+ delete procLineMaker;
+
+ GDBParser::destroy();
+}
+
+
+void DebuggerPart::guiClientAdded( KXMLGUIClient* client )
+{
+ // Can't change state until after XMLGUI has been loaded...
+ // Anyone know of a better way of doing this?
+ if( client == this )
+ stateChanged( QString("stopped") );
+}
+
+void DebuggerPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::EditorContext ))
+ return;
+
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ m_contextIdent = econtext->currentWord();
+
+ bool running = !(previousDebuggerState_ & s_dbgNotStarted);
+
+ // If debugger is running, we insert items at the top.
+ // The reason is user has explicitly run the debugger, so he's
+ // surely debugging, not editing code or something. So, first
+ // menu items should be about debugging, not some copy/paste/cut
+ // things.
+ if (!running)
+ popup->insertSeparator();
+
+ int index = running ? 0 : -1;
+ if (running)
+ {
+ // Too bad we can't add QAction to popup menu in Qt3.
+ KAction* act = actionCollection()->action("debug_runtocursor");
+ Q_ASSERT(act);
+ if (act)
+ {
+ int id = popup->insertItem( act->iconSet(), i18n("Run to &Cursor"),
+ this, SLOT(slotRunToCursor()),
+ 0, -1, index);
+
+ popup->setWhatsThis(id, act->whatsThis());
+ index += running;
+ }
+ }
+ if (econtext->url().isLocalFile())
+ {
+ int id = popup->insertItem( i18n("Toggle Breakpoint"),
+ this, SLOT(toggleBreakpoint()),
+ 0, -1, index);
+ index += running;
+ popup->setWhatsThis(id, i18n("<b>Toggle breakpoint</b><p>Toggles breakpoint at the current line."));
+ }
+ if (!m_contextIdent.isEmpty())
+ {
+ QString squeezed = KStringHandler::csqueeze(m_contextIdent, 30);
+ int id = popup->insertItem( i18n("Evaluate: %1").arg(squeezed),
+ this, SLOT(contextEvaluate()),
+ 0, -1, index);
+ index += running;
+ popup->setWhatsThis(id, i18n("<b>Evaluate expression</b><p>Shows the value of the expression under the cursor."));
+ int id2 = popup->insertItem( i18n("Watch: %1").arg(squeezed),
+ this, SLOT(contextWatch()),
+ 0, -1, index);
+ index += running;
+ popup->setWhatsThis(id2, i18n("<b>Watch expression</b><p>Adds an expression under the cursor to the Variables/Watch list."));
+ }
+ if (running)
+ popup->insertSeparator(index);
+}
+
+
+void DebuggerPart::toggleBreakpoint()
+{
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
+
+ if (!rwpart || !cursorIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ gdbBreakpointWidget->slotToggleBreakpoint(rwpart->url().path(), line);
+}
+
+
+void DebuggerPart::contextWatch()
+{
+ variableWidget->slotAddWatchVariable(m_contextIdent);
+}
+
+void DebuggerPart::contextEvaluate()
+{
+ variableWidget->slotEvaluateExpression(m_contextIdent);
+}
+
+void DebuggerPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Debugger"), i18n("Debugger"), BarIcon( info()->icon(), KIcon::SizeMedium) );
+ DebuggerConfigWidget *w = new DebuggerConfigWidget(this, vbox, "debugger config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ connect( dlg, SIGNAL(finished()), controller, SLOT(configure()) );
+}
+
+
+void DebuggerPart::setupController()
+{
+ VariableTree *variableTree = variableWidget->varTree();
+
+ // variableTree -> gdbBreakpointWidget
+ connect( variableTree, SIGNAL(toggleWatchpoint(const QString &)),
+ gdbBreakpointWidget, SLOT(slotToggleWatchpoint(const QString &)));
+
+ // gdbOutputWidget -> controller
+ connect( gdbOutputWidget, SIGNAL(userGDBCmd(const QString &)),
+ controller, SLOT(slotUserGDBCmd(const QString&)));
+ connect( gdbOutputWidget, SIGNAL(breakInto()),
+ controller, SLOT(slotBreakInto()));
+
+ connect( controller, SIGNAL(breakpointHit(int)),
+ gdbBreakpointWidget, SLOT(slotBreakpointHit(int)));
+
+ // controller -> disassembleWidget
+ connect( controller, SIGNAL(showStepInSource(const QString&, int, const QString&)),
+ disassembleWidget, SLOT(slotShowStepInSource(const QString&, int, const QString&)));
+
+ // controller -> this
+ connect( controller, SIGNAL(dbgStatus(const QString&, int)),
+ this, SLOT(slotStatus(const QString&, int)));
+ connect( controller, SIGNAL(showStepInSource(const QString&, int, const QString&)),
+ this, SLOT(slotShowStep(const QString&, int)));
+ connect( controller, SIGNAL(debuggerAbnormalExit()),
+ this, SLOT(slotDebuggerAbnormalExit()));
+
+ connect(controller, SIGNAL(event(GDBController::event_t)),
+ this, SLOT(slotEvent(GDBController::event_t)));
+
+ // controller -> procLineMaker
+ connect( controller, SIGNAL(ttyStdout(const char*)),
+ procLineMaker, SLOT(slotReceivedStdout(const char*)));
+ connect( controller, SIGNAL(ttyStderr(const char*)),
+ procLineMaker, SLOT(slotReceivedStderr(const char*)));
+
+ // controller -> gdbOutputWidget
+ connect( controller, SIGNAL(gdbInternalCommandStdout(const char*)),
+ gdbOutputWidget, SLOT(slotInternalCommandStdout(const char*)) );
+ connect( controller, SIGNAL(gdbUserCommandStdout(const char*)),
+ gdbOutputWidget, SLOT(slotUserCommandStdout(const char*)) );
+
+ connect( controller, SIGNAL(gdbStderr(const char*)),
+ gdbOutputWidget, SLOT(slotReceivedStderr(const char*)) );
+ connect( controller, SIGNAL(dbgStatus(const QString&, int)),
+ gdbOutputWidget, SLOT(slotDbgStatus(const QString&, int)));
+
+ // controller -> viewerWidget
+ connect( controller, SIGNAL(dbgStatus(const QString&, int)),
+ viewerWidget, SLOT(slotDebuggerState(const QString&, int)));
+
+
+ connect(statusBarIndicator, SIGNAL(doubleClicked()),
+ controller, SLOT(explainDebuggerStatus()));
+
+}
+
+
+bool DebuggerPart::startDebugger()
+{
+ QString build_dir; // Currently selected build directory
+ DomUtil::PairList run_envvars; // List with the environment variables
+ QString run_directory; // Directory from where the program should be run
+ QString program; // Absolute path to application
+ QString run_arguments; // Command line arguments to be passed to the application
+
+ if (project()) {
+ build_dir = project()->buildDirectory();
+ run_envvars = project()->runEnvironmentVars();
+ run_directory = project()->runDirectory();
+ program = project()->mainProgram();
+ run_arguments = project()->debugArguments();
+ }
+
+ QString shell = DomUtil::readEntry(*projectDom(), "/kdevdebugger/general/dbgshell");
+ if( !shell.isEmpty() )
+ {
+ shell = shell.simplifyWhiteSpace();
+ QString shell_without_args = QStringList::split(QChar(' '), shell ).first();
+
+ QFileInfo info( shell_without_args );
+ if( info.isRelative() )
+ {
+ shell_without_args = build_dir + "/" + shell_without_args;
+ info.setFile( shell_without_args );
+ }
+ if( !info.exists() )
+ {
+ KMessageBox::information(
+ mainWindow()->main(),
+ i18n("Could not locate the debugging shell '%1'.").arg( shell_without_args ),
+ i18n("Debugging Shell Not Found"), "gdb_error" );
+ return false;
+ }
+ }
+
+ if (controller->start(shell, run_envvars, run_directory,
+ program, run_arguments))
+ {
+ core()->running(this, true);
+
+ stateChanged( QString("active") );
+
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Continue") );
+
+ ac->action("debug_run")->setToolTip(
+ i18n("Continues the application execution") );
+ ac->action("debug_run")->setWhatsThis(
+ i18n("Continue application execution\n\n"
+ "Continues the execution of your application in the "
+ "debugger. This only takes effect when the application "
+ "has been halted by the debugger (i.e. a breakpoint has "
+ "been activated or the interrupt was pressed).") );
+
+ mainWindow()->setViewAvailable(framestackWidget, true);
+ mainWindow()->setViewAvailable(disassembleWidget, true);
+ mainWindow()->setViewAvailable(gdbOutputWidget, true);
+ mainWindow()->setViewAvailable(variableWidget, true);
+
+ framestackWidget->setEnabled(true);
+ disassembleWidget->setEnabled(true);
+
+ gdbOutputWidget->setEnabled(true);
+
+
+ if (DomUtil::readBoolEntry(*projectDom(), "/kdevdebugger/general/floatingtoolbar", false))
+ {
+#ifndef QT_MAC
+ floatingToolBar = new DbgToolBar(this, mainWindow()->main());
+ floatingToolBar->show();
+#endif
+ }
+
+ running_ = true;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+void DebuggerPart::slotStopDebugger()
+{
+ running_ = false;
+ controller->slotStopDebugger();
+ debugger()->clearExecutionPoint();
+
+ delete floatingToolBar;
+ floatingToolBar = 0;
+
+ gdbBreakpointWidget->reset();
+ disassembleWidget->clear();
+ gdbOutputWidget->clear();
+ disassembleWidget->slotActivate(false);
+
+// variableWidget->setEnabled(false);
+ framestackWidget->setEnabled(false);
+ disassembleWidget->setEnabled(false);
+ gdbOutputWidget->setEnabled(false);
+
+
+ mainWindow()->setViewAvailable(variableWidget, false);
+ mainWindow()->setViewAvailable(framestackWidget, false);
+ mainWindow()->setViewAvailable(disassembleWidget, false);
+ mainWindow()->setViewAvailable(gdbOutputWidget, false);
+
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Start") );
+// ac->action("debug_run")->setIcon( "1rightarrow" );
+ ac->action("debug_run")->setToolTip( i18n("Runs the program in the debugger") );
+ ac->action("debug_run")->setWhatsThis( i18n("Start in debugger\n\n"
+ "Starts the debugger with the project's main "
+ "executable. You may set some breakpoints "
+ "before this, or you can interrupt the program "
+ "while it is running, in order to get information "
+ "about variables, frame stack, and so on.") );
+
+ stateChanged( QString("stopped") );
+
+ core()->running(this, false);
+}
+
+void DebuggerPart::slotShowView(bool show)
+{
+ const QWidget* s = static_cast<const QWidget*>(sender());
+ QWidget* ncs = const_cast<QWidget*>(s);
+ mainWindow()->setViewAvailable(ncs, show);
+ if (show)
+ mainWindow()->raiseView(ncs);
+}
+
+void DebuggerPart::slotDebuggerAbnormalExit()
+{
+ mainWindow()->raiseView(gdbOutputWidget);
+
+ KMessageBox::information(
+ mainWindow()->main(),
+ i18n("<b>GDB exited abnormally</b>"
+ "<p>This is likely a bug in GDB. "
+ "Examine the gdb output window and then stop the debugger"),
+ i18n("GDB exited abnormally"), "gdb_error");
+
+ // Note: we don't stop the debugger here, becuse that will hide gdb
+ // window and prevent the user from finding the exact reason of the
+ // problem.
+}
+
+void DebuggerPart::slotFileSaved()
+{
+ needRebuild_ = true;
+}
+
+void DebuggerPart::slotProjectCompiled()
+{
+ needRebuild_ = false;
+}
+
+void DebuggerPart::projectClosed()
+{
+ slotStopDebugger();
+}
+
+void DebuggerPart::slotRun()
+{
+ if( controller->stateIsOn( s_dbgNotStarted ) ||
+ controller->stateIsOn( s_appNotStarted ) )
+ {
+ if (running_ && controller->stateIsOn(s_dbgNotStarted))
+ {
+ // User has already run the debugger, but it's not running.
+ // Most likely, the debugger has crashed, and the debuggerpart
+ // was left in 'running' state so that the user can examine
+ // gdb output or something. But now, need to fully shut down
+ // previous debug session.
+ slotStopDebugger();
+ }
+
+ // We're either starting gdb for the first time,
+ // or starting the application under gdb. In both
+ // cases, might need to rebuild the application.
+
+ // Note that this logic somewhat duplicates the
+ // isDirty method present in a number of project plugins.
+ // But there, it's a private method we can't conveniently
+ // access. Besides, the custom makefiles project manager won't
+ // care about a file unless it's explicitly added, so it can
+ // miss dependencies.
+
+ needRebuild_ |= haveModifiedFiles();
+
+ bool rebuild = false;
+ if (needRebuild_ && project())
+ {
+ // We don't add "Don't ask again" checkbox to the
+ // message because it's not clear if one cooked
+ // decision will be right for all cases when we're starting
+ // debugging with modified code, and because it's not clear
+ // how user can reset this "don't ask again" setting.
+ int r = KMessageBox::questionYesNoCancel(
+ 0,
+ "<b>" + i18n("Rebuild the project?") + "</b>" +
+ i18n("<p>The project is out of date. Rebuild it?"),
+ i18n("Rebuild the project?"));
+ if (r == KMessageBox::Cancel)
+ {
+ return;
+ }
+ if (r == KMessageBox::Yes)
+ {
+ rebuild = true;
+ }
+ else
+ {
+ // If the user said don't rebuild, try to avoid
+ // asking the same question again.
+ // Note that this only affects 'were any files changed'
+ // check, if a file is changed but not saved we'll
+ // still ask the user again. That's bad, but I don't know
+ // a better solution -- it's hard to check that
+ // the file has the same content as it had when the user
+ // last answered 'no, don't rebuild'.
+ needRebuild_ = false;
+ }
+
+ if (rebuild)
+ {
+ disconnect(SIGNAL(buildProject()));
+ // The KDevProject has no method to build the project,
+ // so try connecting to a slot has is present to all
+ // existing project managers.
+ // Note: this assumes that 'slotBuild' will save
+ // modified files.
+
+ if (connect(this, SIGNAL(buildProject()),
+ project(), SLOT(slotBuild())))
+ {
+ connect(project(), SIGNAL(projectCompiled()),
+ this, SLOT(slotRun_part2()));
+
+ emit buildProject();
+ rebuild = true;
+ }
+ }
+ }
+ if (!rebuild)
+ {
+ slotRun_part2();
+ }
+ return;
+ }
+ else
+ {
+ // When continuing the program, don't try to rebuild -- user
+ // has explicitly asked to "continue".
+ mainWindow()->statusBar()->message(i18n("Continuing program"), 1000);
+ }
+ controller->slotRun();
+}
+
+void DebuggerPart::slotRun_part2()
+{
+ needRebuild_ = false;
+
+ disconnect(project(), SIGNAL(projectCompiled()),
+ this, SLOT(slotRun_part2()));
+
+ if (controller->stateIsOn( s_dbgNotStarted ))
+ {
+ mainWindow()->statusBar()->message(i18n("Debugging program"), 1000);
+ if ( DomUtil::readBoolEntry( *projectDom(), "/kdevdebugger/general/raiseGDBOnStart", false ) )
+ {
+ mainWindow()->raiseView( gdbOutputWidget );
+ }else
+ {
+ mainWindow()->raiseView( framestackWidget );
+ }
+ appFrontend()->clearView();
+ startDebugger();
+ }
+ else if (controller->stateIsOn( s_appNotStarted ) )
+ {
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Continue") );
+ ac->action("debug_run")->setToolTip( i18n("Continues the application execution") );
+ ac->action("debug_run")->setWhatsThis( i18n("Continue application execution\n\n"
+ "Continues the execution of your application in the "
+ "debugger. This only takes effect when the application "
+ "has been halted by the debugger (i.e. a breakpoint has "
+ "been activated or the interrupt was pressed).") );
+
+ mainWindow()->statusBar()->message(i18n("Running program"), 1000);
+
+ appFrontend()->clearView();
+ }
+
+ controller->slotRun();
+}
+
+
+void DebuggerPart::slotRestart()
+{
+ // We implement restart as kill + slotRun, as opposed as plain "run"
+ // command because kill + slotRun allows any special logic in slotRun
+ // to apply for restart.
+ //
+ // That includes:
+ // - checking for out-of-date project
+ // - special setup for remote debugging.
+ //
+ // Had we used plain 'run' command, restart for remote debugging simply
+ // would not work.
+ controller->slotKill();
+ slotRun();
+}
+
+void DebuggerPart::slotExamineCore()
+{
+ mainWindow()->statusBar()->message(i18n("Choose a core file to examine..."), 1000);
+
+ QString dirName = project()? project()->projectDirectory() : QDir::homeDirPath();
+ QString coreFile = KFileDialog::getOpenFileName(dirName);
+ if (coreFile.isNull())
+ return;
+
+ mainWindow()->statusBar()->message(i18n("Examining core file %1").arg(coreFile), 1000);
+
+ startDebugger();
+ controller->slotCoreFile(coreFile);
+}
+
+
+void DebuggerPart::slotAttachProcess()
+{
+ mainWindow()->statusBar()->message(i18n("Choose a process to attach to..."), 1000);
+
+ Dbg_PS_Dialog dlg;
+ if (!dlg.exec() || !dlg.pidSelected())
+ return;
+
+ int pid = dlg.pidSelected();
+ attachProcess(pid);
+}
+
+bool DebuggerPart::attachProcess(int pid)
+{
+ mainWindow()->statusBar()->message(i18n("Attaching to process %1").arg(pid), 1000);
+
+ bool ret = startDebugger();
+ controller->slotAttachTo(pid);
+ return ret;
+}
+
+
+void DebuggerPart::slotStop(KDevPlugin* which)
+{
+ if( which != 0 && which != this )
+ return;
+
+// if( !controller->stateIsOn( s_dbgNotStarted ) && !controller->stateIsOn( s_shuttingDown ) )
+ slotStopDebugger();
+}
+
+
+void DebuggerPart::slotPause()
+{
+ controller->slotBreakInto();
+}
+
+
+void DebuggerPart::slotRunToCursor()
+{
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
+
+ if (!rwpart || !rwpart->url().isLocalFile() || !cursorIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPosition(&line, &col);
+
+ controller->slotRunUntil(rwpart->url().path(), ++line);
+}
+
+void DebuggerPart::slotJumpToCursor()
+{
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
+
+ if (!rwpart || !rwpart->url().isLocalFile() || !cursorIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ controller->slotJumpTo(rwpart->url().path(), ++line);
+}
+
+void DebuggerPart::slotStepOver()
+{
+ controller->slotStepOver();
+}
+
+
+void DebuggerPart::slotStepOverInstruction()
+{
+ controller->slotStepOverIns();
+}
+
+
+void DebuggerPart::slotStepIntoInstruction()
+{
+ controller->slotStepIntoIns();
+}
+
+
+void DebuggerPart::slotStepInto()
+{
+ controller->slotStepInto();
+}
+
+
+void DebuggerPart::slotStepOut()
+{
+ controller->slotStepOutOff();
+}
+
+
+void DebuggerPart::slotMemoryView()
+{
+ viewerWidget->slotAddMemoryView();
+}
+
+void DebuggerPart::slotRefreshBPState( const Breakpoint& BP)
+{
+ if (BP.hasFileAndLine())
+ {
+ const FilePosBreakpoint& bp = dynamic_cast<const FilePosBreakpoint&>(BP);
+ if (bp.isActionDie())
+ {
+ debugger()->setBreakpoint(bp.fileName(), bp.lineNum()-1, -1, true, false);
+ }
+ else if (bp.isActionClear())
+ {
+ // Do nothing. This is always a result of breakpoint deletion,
+ // either via click on gutter, or via breakpoints window.
+ // We should not add marker for a breakpoint that's being deleted,
+ // because if user removes marker, and we re-add it here until
+ // we see 'actionDie' this can confuse the code.
+ // And no need to clear the marker, since we'll soon see 'actionDie'
+ // and clear it for good.
+ }
+ else
+ debugger()->setBreakpoint(bp.fileName(), bp.lineNum()-1,
+ 1/*bp->id()*/, bp.isEnabled(), bp.isPending() );
+ }
+}
+
+void DebuggerPart::slotStatus(const QString &msg, int state)
+{
+ QString stateIndicator, stateIndicatorFull;
+
+ if (state & s_dbgNotStarted)
+ {
+ stateIndicator = " ";
+ stateIndicatorFull = "Debugger not started";
+ stateChanged( QString("stopped") );
+ }
+ else if (state & s_dbgBusy)
+ {
+ stateIndicator = "R";
+ stateIndicatorFull = "Debugger is busy";
+ stateChanged( QString("active") );
+ }
+ else if (state & s_programExited)
+ {
+ stateIndicator = "E";
+ stateIndicatorFull = "Application has exited";
+ stateChanged( QString("stopped") );
+ }
+ else
+ {
+ stateIndicator = "P";
+ stateIndicatorFull = "Application is paused";
+ stateChanged( QString("paused") );
+ // On the first stop, show the variables view.
+ // We do it on first stop, and not at debugger start, because
+ // a program might just successfully run till completion. If we show
+ // the var views on start and hide on stop, this will look like flicker.
+ // On the other hand, if application is paused, it's very
+ // likely that the user wants to see variables.
+ if (justRestarted_)
+ {
+ justRestarted_ = false;
+ mainWindow()->setViewAvailable(variableWidget, true);
+ mainWindow()->raiseView(variableWidget);
+ }
+ }
+
+ if (state & s_appNotStarted)
+ {
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("To start something","Start") );
+ ac->action("debug_run")->setToolTip( i18n("Restart the program in the debugger") );
+ ac->action("debug_run")->setWhatsThis( i18n("Restart in debugger\n\n"
+ "Restarts the program in the debugger") );
+ }
+
+
+ bool program_running = !(state & s_appNotStarted);
+ bool attached_or_core = (state & s_attached) || (state & s_core);
+
+ // If program is started, enable the 'restart' comand.
+ actionCollection()->action("debug_restart")->setEnabled(
+ program_running && !attached_or_core);
+
+
+ // As soon as debugger clears 's_appNotStarted' flag, we
+ // set 'justRestarted' variable.
+ // The other approach would be to set justRestarted in slotRun, slotCore
+ // and slotAttach.
+ // Note that setting this var in startDebugger is not OK, because the
+ // initial state of debugger is exactly the same as state after pause,
+ // so we'll always show varaibles view.
+ if ((previousDebuggerState_ & s_appNotStarted) &&
+ !(state & s_appNotStarted))
+ {
+ justRestarted_ = true;
+ }
+ if (state & s_appNotStarted)
+ {
+ justRestarted_ = false;
+ }
+
+ // And now? :-)
+ kdDebug(9012) << "Debugger state: " << stateIndicator << ": " << endl;
+ kdDebug(9012) << " " << msg << endl;
+
+ statusBarIndicator->setText(stateIndicator);
+ QToolTip::add(statusBarIndicator, stateIndicatorFull);
+ if (!msg.isEmpty())
+ mainWindow()->statusBar()->message(msg, 3000);
+
+
+ previousDebuggerState_ = state;
+}
+
+void DebuggerPart::slotEvent(GDBController::event_t e)
+{
+ if (e == GDBController::program_running ||
+ e == GDBController::program_exited ||
+ e == GDBController::debugger_exited)
+ {
+ debugger()->clearExecutionPoint();
+ }
+}
+
+
+void DebuggerPart::slotShowStep(const QString &fileName, int lineNum)
+{
+ if ( ! fileName.isEmpty() )
+ {
+ // Debugger counts lines from 1
+ debugger()->gotoExecutionPoint(KURL( fileName ), lineNum-1);
+ }
+ else
+ {
+ debugger()->clearExecutionPoint();
+ }
+}
+
+
+void DebuggerPart::slotGotoSource(const QString &fileName, int lineNum)
+{
+ if ( ! fileName.isEmpty() )
+ partController()->editDocument(KURL( fileName ), lineNum);
+}
+
+
+void DebuggerPart::slotActivePartChanged( KParts::Part* part )
+{
+ KAction* action = actionCollection()->action("debug_toggle_breakpoint");
+ if(!action)
+ return;
+
+ if(!part)
+ {
+ action->setEnabled(false);
+ return;
+ }
+ KTextEditor::ViewCursorInterface *iface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ action->setEnabled( iface != 0 );
+}
+
+void DebuggerPart::restorePartialProjectSession(const QDomElement* el)
+{
+ gdbBreakpointWidget->restorePartialProjectSession(el);
+ gdbOutputWidget->restorePartialProjectSession(el);
+}
+
+void DebuggerPart::savePartialProjectSession(QDomElement* el)
+{
+ gdbBreakpointWidget->savePartialProjectSession(el);
+ gdbOutputWidget->savePartialProjectSession(el);
+}
+
+bool DebuggerPart::haveModifiedFiles()
+{
+ bool have_modified = false;
+ KURL::List const& filelist = partController()->openURLs();
+ KURL::List::ConstIterator it = filelist.begin();
+ while ( it != filelist.end() )
+ {
+ if (partController()->documentState(*it) != Clean)
+ have_modified = true;
+
+ ++it;
+ }
+
+ return have_modified;
+}
+
+}
+
+KDevAppFrontend * GDBDebugger::DebuggerPart::appFrontend( )
+{
+ return extension<KDevAppFrontend>("KDevelop/AppFrontend");
+}
+
+KDevDebugger * GDBDebugger::DebuggerPart::debugger()
+{
+ return m_debugger;
+}
+
+#include "debuggerpart.moc"
diff --git a/languages/cpp/debugger/debuggerpart.h b/languages/cpp/debugger/debuggerpart.h
new file mode 100644
index 00000000..afb3b340
--- /dev/null
+++ b/languages/cpp/debugger/debuggerpart.h
@@ -0,0 +1,164 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DEBUGGERPART_H_
+#define _DEBUGGERPART_H_
+
+#include <qguardedptr.h>
+#include "kdevplugin.h"
+#include "kdevcore.h"
+
+#include "gdbcontroller.h"
+#include "debuggerdcopinterface.h"
+
+namespace KParts { class Part; }
+
+class QLabel;
+class QPopupMenu;
+class KDialogBase;
+class ProcessWidget;
+class ProcessLineMaker;
+class KDevAppFrontend;
+class KDevDebugger;
+
+namespace GDBDebugger
+{
+
+class GDBBreakpointWidget;
+class FramestackWidget;
+class DisassembleWidget;
+class Breakpoint;
+class GDBController;
+class DbgToolBar;
+class VariableWidget;
+class GDBOutputWidget;
+class ViewerWidget;
+
+class DebuggerPart : public KDevPlugin, virtual public DebuggerDCOPInterface
+{
+ Q_OBJECT
+
+public:
+ DebuggerPart( QObject *parent, const char *name, const QStringList & );
+ ~DebuggerPart();
+ virtual void restorePartialProjectSession(const QDomElement* el);
+ virtual void savePartialProjectSession(QDomElement* el);
+
+k_dcop:
+ virtual ASYNC slotDebugExternalProcess();
+ virtual ASYNC slotDebugCommandLine(const QString& command);
+
+private slots:
+ void setupDcop();
+ void guiClientAdded(KXMLGUIClient*);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void toggleBreakpoint();
+ void contextEvaluate();
+ void contextWatch();
+// void projectOpened();
+ void projectClosed();
+ void projectConfigWidget(KDialogBase *dlg);
+ void slotActivePartChanged(KParts::Part*);
+
+ void slotRun();
+ // Called to finish run operation in the case when we're
+ // starting the debugger. Called either directly from
+ // slotRun, if no rebuilding of project is needed, or
+ // indirectly from project()->projectCompiled() after project
+ // is rebuilt.
+ void slotRun_part2();
+ void slotRestart();
+ void slotExamineCore();
+ void slotAttachProcess();
+ void slotStopDebugger();
+ void slotStop(KDevPlugin* which = 0);
+ void slotPause();
+ void slotRunToCursor();
+ void slotJumpToCursor();
+ void slotStepOver();
+ void slotStepOverInstruction();
+ void slotStepIntoInstruction();
+ void slotStepInto();
+ void slotStepOut();
+ void slotMemoryView();
+
+ void slotRefreshBPState(const Breakpoint&);
+
+ void slotStatus(const QString &msg, int state);
+ void slotShowStep(const QString &fileName, int lineNum);
+ void slotGotoSource(const QString &fileName, int lineNum);
+
+ void slotDCOPApplicationRegistered(const QCString &appId);
+ void slotCloseDrKonqi();
+
+ // Hide or show the view that's the sender of this signal.
+ void slotShowView(bool enabled);
+
+ void slotDebuggerAbnormalExit();
+
+ // Called when some file in the project was saved.
+ // Sets 'needRebuild_' to true.
+ void slotFileSaved();
+
+ void slotProjectCompiled();
+
+ void slotEvent(GDBController::event_t);
+
+private:
+ KDevAppFrontend *appFrontend();
+ KDevDebugger *debugger();
+
+ bool attachProcess(int pid);
+ bool startDebugger();
+ void setupController();
+ bool haveModifiedFiles();
+
+ QGuardedPtr<VariableWidget> variableWidget;
+ QGuardedPtr<GDBBreakpointWidget> gdbBreakpointWidget;
+ QGuardedPtr<FramestackWidget> framestackWidget;
+ QGuardedPtr<DisassembleWidget> disassembleWidget;
+ QGuardedPtr<GDBOutputWidget> gdbOutputWidget;
+ QGuardedPtr<ViewerWidget> viewerWidget;
+ GDBController *controller;
+ QGuardedPtr<QLabel> statusBarIndicator;
+ QGuardedPtr<DbgToolBar> floatingToolBar;
+ ProcessLineMaker* procLineMaker;
+ ProcessLineMaker* gdbLineMaker;
+
+ QString m_contextIdent;
+ QCString m_drkonqi;
+
+ KDevDebugger *m_debugger;
+ int previousDebuggerState_;
+ // Set to true after each debugger restart
+ // Currently used to auto-show variables view
+ // on the first pause.
+ bool justRestarted_;
+
+ // Flag that specifies in project rebuild is necessary
+ // before running the debugger. Set to 'true' in constructor
+ // because we have no idea if project is 'dirty' or not
+ // when it's opened, and then set to 'true' each time a file is
+ // modified.
+ bool needRebuild_;
+
+ // Set by 'startDebugger' and cleared by 'slotStopDebugger'.
+ bool running_;
+
+signals:
+ void buildProject();
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/debuggertracingdialog.cpp b/languages/cpp/debugger/debuggertracingdialog.cpp
new file mode 100644
index 00000000..217f0b88
--- /dev/null
+++ b/languages/cpp/debugger/debuggertracingdialog.cpp
@@ -0,0 +1,104 @@
+
+#include "debuggertracingdialog.h"
+#include "breakpoint.h"
+
+#include <qbutton.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <keditlistbox.h>
+#include <kmessagebox.h>
+
+namespace GDBDebugger
+{
+
+ DebuggerTracingDialog
+ ::DebuggerTracingDialog(Breakpoint* bp,
+ QWidget* parent, const char* name)
+ : DebuggerTracingDialogBase(parent, name), bp_(bp)
+ {
+ expressions->setButtons(KEditListBox::Add | KEditListBox::Remove);
+
+ connect(enable, SIGNAL(stateChanged(int)),
+ this, SLOT(enableOrDisable(int)));
+
+ connect(enableCustomFormat, SIGNAL(stateChanged(int)),
+ this, SLOT(enableOrDisableCustomFormat(int)));
+
+ enable->setChecked(bp_->tracingEnabled());
+ expressions->setItems(bp_->tracedExpressions());
+ enableCustomFormat->setChecked(bp_->traceFormatStringEnabled());
+ customFormat->setText(bp_->traceFormatString());
+
+ enableOrDisable(enable->state());
+ }
+
+ void DebuggerTracingDialog::enableOrDisable(int state)
+ {
+ bool enable = (state == QButton::On);
+
+ expressionsLabel->setEnabled(enable);
+ expressions->setEnabled(enable);
+ enableCustomFormat->setEnabled(enable);
+ customFormat->setEnabled(enable && enableCustomFormat->isOn());
+ }
+
+ void DebuggerTracingDialog::enableOrDisableCustomFormat(int state)
+ {
+ customFormat->setEnabled(state == QButton::On);
+ }
+
+ void DebuggerTracingDialog::accept()
+ {
+ // Check that if we use format string,
+ // the number of expression is not larget than the number of
+ // format specifiers
+ bool ok = true;
+
+ if (enableCustomFormat->isOn())
+ {
+ QString s = customFormat->text();
+ unsigned percent_count = 0;
+ for (unsigned i = 0; i < s.length(); ++i)
+ if (s[i] == '%')
+ {
+ if (i+1 < s.length())
+ {
+ if (s[i+1] != '%')
+ {
+ ++percent_count;
+ }
+ else
+ {
+ // Double %
+ ++i;
+ }
+ }
+ }
+
+ if (percent_count < expressions->items().count())
+ {
+ ok = false;
+
+ KMessageBox::error(
+ this,
+ "<b>Not enough format specifiers</b>"
+ "<p>The number of format specifiers in the custom format "
+ "string is less then the number of expressions. Either remove "
+ "some expressions or edit the format string.",
+ "Not enough format specifiers");
+ }
+
+ }
+
+ if (ok)
+ {
+ bp_->setTracingEnabled(enable->isOn());
+ bp_->setTracedExpressions(expressions->items());
+ bp_->setTraceFormatStringEnabled(enableCustomFormat->isOn());
+ bp_->setTraceFormatString(customFormat->text());
+ DebuggerTracingDialogBase::accept();
+ }
+ }
+
+}
diff --git a/languages/cpp/debugger/debuggertracingdialog.h b/languages/cpp/debugger/debuggertracingdialog.h
new file mode 100644
index 00000000..1379f684
--- /dev/null
+++ b/languages/cpp/debugger/debuggertracingdialog.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Vladimir Prus *
+ * ghost@cs.msu.su *
+ * *
+ * 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 DEBUGGER_TRACING_DIALOG_VP_2005_08_22
+#define DEBUGGER_TRACING_DIALOG_VP_2005_08_22
+
+#include "debuggertracingdialogbase.h"
+
+
+namespace GDBDebugger
+{
+ class Breakpoint;
+
+ class DebuggerTracingDialog : public DebuggerTracingDialogBase
+ {
+ Q_OBJECT
+ public:
+ DebuggerTracingDialog(Breakpoint* bp,
+ QWidget* parent, const char* name = 0);
+
+ private slots:
+ void enableOrDisable(int);
+ void enableOrDisableCustomFormat(int);
+
+ private:
+ void accept();
+
+ private:
+ Breakpoint* bp_;
+ };
+}
+
+#endif
diff --git a/languages/cpp/debugger/debuggertracingdialogbase.ui b/languages/cpp/debugger/debuggertracingdialogbase.ui
new file mode 100644
index 00000000..333dc4de
--- /dev/null
+++ b/languages/cpp/debugger/debuggertracingdialogbase.ui
@@ -0,0 +1,141 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DebuggerTracingDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>DebuggerTracingDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>348</width>
+ <height>409</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tracing Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>enable</cstring>
+ </property>
+ <property name="text">
+ <string>Enable tracing</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enable tracing&lt;/b&gt;
+&lt;p&gt;Tracing is a mechanism to automatically print values of the choosed expressions and continue execution when breakpoint is hit. You can think of it as printf debugging that does not require modifying the source.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="2">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>enableCustomFormat</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Custom format string</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="5" column="0">
+ <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>
+ <widget class="KLineEdit" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>customFormat</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Custom format string&lt;/b&gt;
+&lt;p&gt;Specify a C-style format string that will be used when printing the choosen expression. For example:
+&lt;p align="center"&gt; &lt;tt&gt;Tracepoint 1: g = %d&lt;/tt&gt;&lt;/p&gt;
+If custom format string is not enabled, names and values of all expressions will be printed, using "%d" as format specifier for all expressions.</string>
+ </property>
+ </widget>
+ <widget class="KEditListBox" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>expressions</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>expressionsLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Expressions to print:</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>DebuggerTracingDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>DebuggerTracingDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>enableOrDisable()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/debugger/disassemblewidget.cpp b/languages/cpp/debugger/disassemblewidget.cpp
new file mode 100644
index 00000000..759393f5
--- /dev/null
+++ b/languages/cpp/debugger/disassemblewidget.cpp
@@ -0,0 +1,173 @@
+/***************************************************************************
+ begin : Tues Jan 3 2000
+ copyright : (C) 2000 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "disassemblewidget.h"
+#include "gdbcontroller.h"
+#include "gdbcommand.h"
+
+#include <kdebug.h>
+#include <kdeversion.h>
+#include <ktextedit.h>
+#include <kglobalsettings.h>
+
+#include <qdict.h>
+#include <qheader.h>
+#include <qtextedit.h>
+
+#include <stdlib.h>
+
+namespace GDBDebugger
+{
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+DisassembleWidget::DisassembleWidget(GDBController* controller, QWidget *parent, const char *name)
+ : QTextEdit(parent, name), controller_(controller),
+ active_(false),
+ lower_(0),
+ upper_(0),
+ address_(0)
+{
+ setFont(KGlobalSettings::fixedFont());
+ setReadOnly(true);
+}
+
+/***************************************************************************/
+
+DisassembleWidget::~DisassembleWidget()
+{}
+
+/***************************************************************************/
+
+bool DisassembleWidget::displayCurrent()
+{
+ Q_ASSERT(address_ >= lower_ || address_ <= upper_);
+
+ int line;
+ for (line=0; line < paragraphs(); line++)
+ {
+ unsigned long address = strtoul(text(line).latin1(), 0, 0);
+ if (address == address_)
+ {
+ // put cursor at start of line and highlight the line
+ setCursorPosition(line, 0);
+ setSelection(line,0,line+1,0,0);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/***************************************************************************/
+
+void DisassembleWidget::slotActivate(bool activate)
+{
+ kdDebug(9012) << "Disassemble widget active: " << activate << endl;
+
+ if (active_ != activate)
+ {
+ active_ = activate;
+ if (active_ && address_)
+ {
+ if (address_ < lower_ || address_ > upper_ || !displayCurrent())
+ getNextDisplay();
+ }
+ }
+}
+
+/***************************************************************************/
+
+void DisassembleWidget::slotShowStepInSource( const QString &, int,
+ const QString &currentAddress)
+{
+ kdDebug(9012) << "DisasssembleWidget::slotShowStepInSource()" << endl;
+
+ currentAddress_ = currentAddress;
+ address_ = strtoul(currentAddress.latin1(), 0, 0);
+ if (!active_)
+ return;
+
+ if (address_ < lower_ || address_ > upper_ || !displayCurrent())
+ getNextDisplay();
+}
+
+/***************************************************************************/
+
+void DisassembleWidget::getNextDisplay()
+{
+ kdDebug(9012) << "DisasssembleWidget::getNextDisplay()" << endl;
+
+ if (address_)
+ {
+ Q_ASSERT(!currentAddress_.isNull());
+
+ QString cmd = QString("-data-disassemble -s $pc -e \"$pc + 128\" -- 0");
+ controller_->addCommandToFront(
+ new GDBCommand( cmd, this, &DisassembleWidget::memoryRead ) );
+ }
+}
+
+/***************************************************************************/
+
+void DisassembleWidget::memoryRead(const GDBMI::ResultRecord& r)
+{
+ const GDBMI::Value& content = r["asm_insns"];
+ QString rawdata;
+
+ clear();
+
+ for(unsigned i = 0; i < content.size(); ++i)
+ {
+ const GDBMI::Value& line = content[i];
+
+ QString addr = line["address"].literal();
+ QString fct = line["func-name"].literal();
+ QString offs = line["offset"].literal();
+ QString inst = line["inst"].literal();
+
+ rawdata += QString(addr + " " + fct+"+"+offs + " " + inst + "\n");
+
+ if (i == 0) {
+ lower_ = strtoul(addr.latin1(), 0, 0);
+ } else if (i == content.size()-1) {
+ upper_ = strtoul(addr.latin1(), 0, 0);
+ }
+ }
+
+ append(rawdata);
+
+ displayCurrent();
+}
+
+
+void DisassembleWidget::showEvent(QShowEvent*)
+{
+ slotActivate(true);
+}
+
+
+void DisassembleWidget::hideEvent(QHideEvent*)
+{
+ slotActivate(false);
+}
+
+/***************************************************************************/
+
+}
+
+#include "disassemblewidget.moc"
diff --git a/languages/cpp/debugger/disassemblewidget.h b/languages/cpp/debugger/disassemblewidget.h
new file mode 100644
index 00000000..6b2fdd3a
--- /dev/null
+++ b/languages/cpp/debugger/disassemblewidget.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DISASSEMBLEWIDGET_H_
+#define _DISASSEMBLEWIDGET_H_
+
+#include "mi/gdbmi.h"
+
+#include <qtextedit.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+
+class Breakpoint;
+class GDBController;
+
+class DisassembleWidget : public QTextEdit
+{
+ Q_OBJECT
+
+public:
+ DisassembleWidget( GDBController* controller, QWidget *parent=0, const char *name=0 );
+ virtual ~DisassembleWidget();
+
+public slots:
+ void slotActivate(bool activate);
+ void slotShowStepInSource(const QString &fileName, int lineNum, const QString &address);
+
+private:
+ virtual void showEvent(QShowEvent*);
+ virtual void hideEvent(QHideEvent*);
+
+ bool displayCurrent();
+ void getNextDisplay();
+
+ /// callback for GDBCommand
+ void memoryRead(const GDBMI::ResultRecord& r);
+
+ GDBController* controller_;
+ bool active_;
+ unsigned long lower_;
+ unsigned long upper_;
+ unsigned long address_;
+ QString currentAddress_;
+};
+
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+#endif
diff --git a/languages/cpp/debugger/framestackwidget.cpp b/languages/cpp/debugger/framestackwidget.cpp
new file mode 100644
index 00000000..e731a1ee
--- /dev/null
+++ b/languages/cpp/debugger/framestackwidget.cpp
@@ -0,0 +1,645 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "framestackwidget.h"
+#include "gdbparser.h"
+#include "gdbcommand.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kglobalsettings.h>
+
+#include <qheader.h>
+#include <qlistbox.h>
+#include <qregexp.h>
+#include <qstrlist.h>
+#include <qpainter.h>
+
+
+#include <ctype.h>
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+
+FramestackWidget::FramestackWidget(GDBController* controller,
+ QWidget *parent,
+ const char *name, WFlags f)
+ : QListView(parent, name, f),
+ viewedThread_(0),
+ controller_(controller),
+ mayUpdate_( false )
+{
+ setRootIsDecorated(true);
+ setSorting(-1);
+ setSelectionMode(Single);
+ addColumn(QString::null); // Frame number
+ addColumn(QString::null); // function name/address
+ addColumn(QString::null); // source
+ header()->hide();
+
+
+ // FIXME: maybe, all debugger components should derive from
+ // a base class that does this connect.
+ connect(controller, SIGNAL(event(GDBController::event_t)),
+ this, SLOT(slotEvent(GDBController::event_t)));
+
+ connect( this, SIGNAL(clicked(QListViewItem*)),
+ this, SLOT(slotSelectionChanged(QListViewItem*)) );
+}
+
+
+/***************************************************************************/
+
+FramestackWidget::~FramestackWidget()
+{}
+
+/***************************************************************************/
+
+QListViewItem *FramestackWidget::lastChild() const
+{
+ QListViewItem* child = firstChild();
+ if (child)
+ while (QListViewItem* nextChild = child->nextSibling())
+ child = nextChild;
+
+ return child;
+}
+
+// **************************************************************************
+
+void FramestackWidget::clear()
+{
+ viewedThread_ = 0;
+
+ QListView::clear();
+}
+
+/***************************************************************************/
+
+void FramestackWidget::slotSelectionChanged(QListViewItem *thisItem)
+{
+ ThreadStackItem *thread = dynamic_cast<ThreadStackItem*> (thisItem);
+ if (thread)
+ {
+ controller_->selectFrame(0, thread->threadNo());
+ }
+ else
+ {
+ FrameStackItem *frame = dynamic_cast<FrameStackItem*> (thisItem);
+ if (frame)
+ {
+ if (frame->text(0) == "...")
+ {
+ // Switch to the target thread.
+ if (frame->threadNo() != -1)
+ controller_->addCommand(
+ new GDBCommand(QString("-thread-select %1")
+ .arg(frame->threadNo()).ascii()));
+
+ viewedThread_ = findThread(frame->threadNo());
+ getBacktrace(frame->frameNo(), frame->frameNo() + frameChunk_);
+ }
+ else
+ {
+ controller_->
+ selectFrame(frame->frameNo(), frame->threadNo());
+ }
+ }
+ }
+}
+
+/***************************************************************************/
+
+void FramestackWidget::slotEvent(GDBController::event_t e)
+{
+ switch(e)
+ {
+ case GDBController::program_state_changed:
+
+ kdDebug(9012) << "Clearning framestack\n";
+ clear();
+
+ if ( isVisible() )
+ {
+ controller_->addCommand(
+ new GDBCommand("-thread-list-ids",
+ this, &FramestackWidget::handleThreadList));
+ mayUpdate_ = false;
+ }
+ else mayUpdate_ = true;
+
+ break;
+
+
+ case GDBController::thread_or_frame_changed:
+
+ if (viewedThread_)
+ {
+ // For non-threaded programs frame switch is no-op
+ // as far as framestack is concerned.
+ // FIXME: but need to highlight the current frame.
+
+ if (ThreadStackItem* item
+ = findThread(controller_->currentThread()))
+ {
+ viewedThread_ = item;
+
+ if (!item->firstChild())
+ {
+ // No backtrace for this thread yet.
+ getBacktrace();
+ }
+ }
+ }
+
+ break;
+
+ case GDBController::program_exited:
+ case GDBController::debugger_exited:
+ {
+ clear();
+ break;
+ }
+ case GDBController::debugger_busy:
+ case GDBController::debugger_ready:
+ case GDBController::shared_library_loaded:
+ case GDBController::program_running:
+ case GDBController::connected_to_program:
+ break;
+ }
+}
+
+void FramestackWidget::showEvent(QShowEvent*)
+{
+ if (controller_->stateIsOn(s_appRunning|s_dbgBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if ( mayUpdate_ )
+ {
+ clear();
+
+ controller_->addCommand(
+ new GDBCommand( "-thread-list-ids", this, &FramestackWidget::handleThreadList ) );
+
+ mayUpdate_ = false;
+ }
+}
+
+void FramestackWidget::getBacktrace(int min_frame, int max_frame)
+{
+ minFrame_ = min_frame;
+ maxFrame_ = max_frame;
+
+ controller_->addCommand(
+ new GDBCommand(QString("-stack-info-depth %1").arg(max_frame+1),
+ this,
+ &FramestackWidget::handleStackDepth));
+}
+
+void FramestackWidget::handleStackDepth(const GDBMI::ResultRecord& r)
+{
+ int existing_frames = r["depth"].literal().toInt();
+
+ has_more_frames = (existing_frames > maxFrame_);
+
+ if (existing_frames < maxFrame_)
+ maxFrame_ = existing_frames;
+ //add the following command to the front, so noone switches threads in between
+ controller_->addCommandToFront(
+ new GDBCommand(QString("-stack-list-frames %1 %2")
+ .arg(minFrame_).arg(maxFrame_),
+ this, &FramestackWidget::parseGDBBacktraceList));
+}
+
+void FramestackWidget::getBacktraceForThread(int threadNo)
+{
+ unsigned currentThread = controller_->currentThread();
+ if (viewedThread_)
+ {
+ // Switch to the target thread.
+ controller_->addCommand(
+ new GDBCommand(QString("-thread-select %1")
+ .arg(threadNo).ascii()));
+
+ viewedThread_ = findThread(threadNo);
+ }
+
+ getBacktrace();
+
+ if (viewedThread_)
+ {
+ // Switch back to the original thread.
+ controller_->addCommand(
+ new GDBCommand(QString("-thread-select %1")
+ .arg(currentThread).ascii()));
+ }
+}
+
+void FramestackWidget::handleThreadList(const GDBMI::ResultRecord& r)
+{
+ // Gdb reply is:
+ // ^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},
+ // which syntactically is a tuple, but one has to access it
+ // by index anyway.
+ const GDBMI::TupleValue& ids =
+ dynamic_cast<const GDBMI::TupleValue&>(r["thread-ids"]);
+
+ if (ids.results.size() > 1)
+ {
+ // Need to iterate over all threads to figure out where each one stands.
+ // Note that this sequence of command will be executed in strict
+ // sequences, so no other view can add its command in between and
+ // get state for a wrong thread.
+
+ // Really threaded program.
+ for(unsigned i = 0, e = ids.results.size(); i != e; ++i)
+ {
+ QString id = ids.results[i]->value->literal();
+
+ controller_->addCommand(
+ new GDBCommand(QString("-thread-select %1").arg(id).ascii(),
+ this, &FramestackWidget::handleThread));
+ }
+
+ controller_->addCommand(
+ new GDBCommand(QString("-thread-select %1")
+ .arg(controller_->currentThread()).ascii()));
+ }
+
+ // Get backtrace for the current thread. We need to do this
+ // here, and not in event handler for program_state_changed,
+ // viewedThread_ is initialized by 'handleThread' before
+ // backtrace handler is called.
+ getBacktrace();
+}
+
+void FramestackWidget::handleThread(const GDBMI::ResultRecord& r)
+{
+ QString id = r["new-thread-id"].literal();
+ int id_num = id.toInt();
+
+ QString name_column;
+ QString func_column;
+ QString args_column;
+ QString source_column;
+
+ formatFrame(r["frame"], func_column, source_column);
+
+ ThreadStackItem* thread = new ThreadStackItem(this, id_num);
+ thread->setText(1, func_column);
+ thread->setText(2, source_column);
+
+ // The thread with a '*' is always the viewedthread
+
+ if (id_num == controller_->currentThread())
+ {
+ viewedThread_ = thread;
+ setSelected(viewedThread_, true);
+ }
+}
+
+
+void FramestackWidget::parseGDBBacktraceList(const GDBMI::ResultRecord& r)
+{
+ if (!r.hasField("stack"))
+ return;
+
+ const GDBMI::Value& frames = r["stack"];
+
+ if (frames.empty())
+ return;
+
+ Q_ASSERT(dynamic_cast<const GDBMI::ListValue*>(&frames));
+
+ // Remove "..." item, if there's one.
+ QListViewItem* last;
+ if (viewedThread_)
+ {
+ last = viewedThread_->firstChild();
+ if (last)
+ while(last->nextSibling())
+ last = last->nextSibling();
+ }
+ else
+ {
+ last = lastItem();
+ }
+ if (last && last->text(0) == "...")
+ delete last;
+
+ int lastLevel;
+ for(unsigned i = 0, e = frames.size(); i != e; ++i)
+ {
+ const GDBMI::Value& frame = frames[i];
+
+ // For now, just produce string simular to gdb
+ // console output. In future we might have a table,
+ // or something better.
+ QString frameDesc;
+
+ QString name_column;
+ QString func_column;
+ QString source_column;
+
+ QString level_s = frame["level"].literal();
+ int level = level_s.toInt();
+
+ name_column = "#" + level_s;
+
+ formatFrame(frame, func_column, source_column);
+
+ FrameStackItem* item;
+ if (viewedThread_)
+ item = new FrameStackItem(viewedThread_, level, name_column);
+ else
+ item = new FrameStackItem(this, level, name_column);
+ lastLevel = level;
+
+ item->setText(1, func_column);
+ item->setText(2, source_column);
+ }
+ if (has_more_frames)
+ {
+ QListViewItem* item;
+ if (viewedThread_)
+ item = new FrameStackItem(viewedThread_, lastLevel+1, "...");
+ else
+ item = new FrameStackItem(this, lastLevel+1, "...");
+ item->setText(1, "(click to get more frames)");
+ }
+
+ currentFrame_ = 0;
+ // Make sure the first frame in the stopped backtrace is selected
+ // and open
+ if (viewedThread_)
+ viewedThread_->setOpen(true);
+ else
+ {
+ if (FrameStackItem* frame = (FrameStackItem*) firstChild())
+ {
+ frame->setOpen(true);
+ setSelected(frame, true);
+ }
+ }
+}
+
+// **************************************************************************
+
+ThreadStackItem *FramestackWidget::findThread(int threadNo)
+{
+ QListViewItem *sibling = firstChild();
+ while (sibling)
+ {
+ ThreadStackItem *thread = dynamic_cast<ThreadStackItem*> (sibling);
+ if (thread && thread->threadNo() == threadNo)
+ {
+ return thread;
+ }
+ sibling = sibling->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+
+FrameStackItem *FramestackWidget::findFrame(int frameNo, int threadNo)
+{
+ QListViewItem* frameItem = 0;
+
+ if (threadNo != -1)
+ {
+ ThreadStackItem *thread = findThread(threadNo);
+ if (thread == 0)
+ return 0; // no matching thread?
+ frameItem = thread->firstChild();
+ }
+ else
+ frameItem = firstChild();
+
+ while (frameItem)
+ {
+ if (((FrameStackItem*)frameItem)->frameNo() == frameNo)
+ break;
+
+ frameItem = frameItem->nextSibling();
+ }
+ return (FrameStackItem*)frameItem;
+}
+
+void FramestackWidget::formatFrame(const GDBMI::Value& frame,
+ QString& func_column,
+ QString& source_column)
+{
+ func_column = source_column = "";
+
+ if (frame.hasField("func"))
+ {
+ func_column += " " + frame["func"].literal();
+ }
+ else
+ {
+ func_column += " " + frame["address"].literal();
+ }
+
+
+ if (frame.hasField("file"))
+ {
+ source_column = frame["file"].literal();
+
+ if (frame.hasField("line"))
+ {
+ source_column += ":" + frame["line"].literal();
+ }
+ }
+ else if (frame.hasField("from"))
+ {
+ source_column = frame["from"].literal();
+ }
+}
+
+
+void FramestackWidget::drawContentsOffset( QPainter * p, int ox, int oy,
+ int cx, int cy, int cw, int ch )
+{
+ QListView::drawContentsOffset(p, ox, oy, cx, cy, cw, ch);
+
+ int s1_x = header()->sectionPos(1);
+ int s1_w = header()->sectionSize(1);
+
+ QRect section1(s1_x, contentsHeight(), s1_w, viewport()->height());
+
+ p->fillRect(section1, KGlobalSettings::alternateBackgroundColor());
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+FrameStackItem::FrameStackItem(FramestackWidget *parent,
+ unsigned frameNo,
+ const QString &name)
+ : QListViewItem(parent, parent->lastChild()),
+ frameNo_(frameNo),
+ threadNo_(-1)
+{
+ setText(0, name);
+}
+
+// **************************************************************************
+
+FrameStackItem::FrameStackItem(ThreadStackItem *parent,
+ unsigned frameNo,
+ const QString &name)
+ : QListViewItem(parent, parent->lastChild()),
+ frameNo_(frameNo),
+ threadNo_(parent->threadNo())
+{
+ setText(0, name);
+}
+
+// **************************************************************************
+
+FrameStackItem::~FrameStackItem()
+{}
+
+// **************************************************************************
+
+QListViewItem *FrameStackItem::lastChild() const
+{
+ QListViewItem* child = firstChild();
+ if (child)
+ while (QListViewItem* nextChild = child->nextSibling())
+ child = nextChild;
+
+ return child;
+}
+
+// **************************************************************************
+
+void FrameStackItem::setOpen(bool open)
+{
+#if 0
+ if (open)
+ {
+ FramestackWidget* owner = (FramestackWidget*)listView();
+ if (this->threadNo() != owner->viewedThread() &&
+ this->frameNo() != owner->currentFrame_)
+ {
+ ((FramestackWidget*)listView())->slotSelectFrame(0, threadNo());
+ }
+ }
+#endif
+ QListViewItem::setOpen(open);
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+ThreadStackItem::ThreadStackItem(FramestackWidget *parent, unsigned threadNo)
+: QListViewItem(parent),
+ threadNo_(threadNo)
+{
+ setText(0, i18n("Thread %1").arg(threadNo_));
+ setExpandable(true);
+}
+
+// **************************************************************************
+
+ThreadStackItem::~ThreadStackItem()
+{}
+
+// **************************************************************************
+
+QListViewItem *ThreadStackItem::lastChild() const
+{
+ QListViewItem* child = firstChild();
+ if (child)
+ while (QListViewItem* nextChild = child->nextSibling())
+ child = nextChild;
+
+ return child;
+}
+
+// **************************************************************************
+
+void ThreadStackItem::setOpen(bool open)
+{
+ // If we're openining, and have no child yet, get backtrace from
+ // gdb.
+ if (open && !firstChild())
+ {
+ // Not that this will not switch to another thread (and won't show
+ // position in that other thread). This will only get the frames.
+
+ // Imagine you have 20 frames and you want to find one blocked on
+ // mutex. You don't want a new source file to be opened for each
+ // thread you open to find if that's the one you want to debug.
+ ((FramestackWidget*)listView())->getBacktraceForThread(threadNo());
+ }
+
+ if (open)
+ {
+ savedFunc_ = text(1);
+ setText(1, "");
+ savedSource_ = text(2);
+ setText(2, "");
+ }
+ else
+ {
+ setText(1, savedFunc_);
+ setText(2, savedSource_);
+ }
+
+ QListViewItem::setOpen(open);
+}
+
+void FrameStackItem::paintCell(QPainter * p, const QColorGroup & cg,
+ int column, int width, int align )
+{
+ QColorGroup cg2(cg);
+ if (column % 2)
+ {
+ cg2.setColor(QColorGroup::Base,
+ KGlobalSettings::alternateBackgroundColor());
+ }
+ QListViewItem::paintCell(p, cg2, column, width, align);
+}
+
+void ThreadStackItem::paintCell(QPainter * p, const QColorGroup & cg,
+ int column, int width, int align )
+{
+ QColorGroup cg2(cg);
+ if (column % 2)
+ {
+ cg2.setColor(QColorGroup::Base,
+ KGlobalSettings::alternateBackgroundColor());
+ }
+ QListViewItem::paintCell(p, cg2, column, width, align);
+}
+
+
+}
+
+/***************************************************************************/
+/***************************************************************************/
+
+#include "framestackwidget.moc"
diff --git a/languages/cpp/debugger/framestackwidget.h b/languages/cpp/debugger/framestackwidget.h
new file mode 100644
index 00000000..36cac1ba
--- /dev/null
+++ b/languages/cpp/debugger/framestackwidget.h
@@ -0,0 +1,183 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FRAMESTACKWIDGET_H_
+#define _FRAMESTACKWIDGET_H_
+
+#include <qlistview.h>
+#include <qstringlist.h>
+
+#include "gdbcontroller.h"
+#include "mi/miparser.h"
+
+#include <vector>
+
+namespace GDBDebugger
+{
+
+class FramestackWidget;
+
+
+class ThreadStackItem : public QListViewItem
+{
+public:
+ ThreadStackItem(FramestackWidget *parent,
+ unsigned threadNo);
+ virtual ~ThreadStackItem();
+
+ void setOpen(bool open);
+ QListViewItem *lastChild() const;
+
+ void paintCell(QPainter * p, const QColorGroup & cg,
+ int column, int width, int align );
+
+ int threadNo()
+ { return threadNo_; }
+
+private:
+ int threadNo_;
+ QString savedFunc_;
+ QString savedSource_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class FrameStackItem : public QListViewItem
+{
+public:
+ FrameStackItem(FramestackWidget *parent,
+ unsigned frameNo,
+ const QString &name);
+ FrameStackItem(ThreadStackItem *parent,
+ unsigned frameNo,
+ const QString &name);
+ virtual ~FrameStackItem();
+
+ void setOpen(bool open);
+ QListViewItem *lastChild() const;
+
+ void paintCell(QPainter * p, const QColorGroup & cg,
+ int column, int width, int align );
+
+ int frameNo()
+ { return frameNo_; }
+ int threadNo()
+ { return threadNo_; }
+private:
+ int frameNo_;
+ int threadNo_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+
+/**
+ * @author John Birch
+ */
+class FramestackWidget : public QListView
+{
+ Q_OBJECT
+
+public:
+ FramestackWidget( GDBController* controller,
+ QWidget *parent=0,
+ const char *name=0, WFlags f=0 );
+ virtual ~FramestackWidget();
+
+ QListViewItem *lastChild() const;
+
+ ThreadStackItem *findThread(int threadNo);
+ FrameStackItem *findFrame(int frameNo, int threadNo);
+
+ int viewedThread()
+ { return viewedThread_ ? viewedThread_->threadNo() : -1; }
+
+protected:
+
+ void drawContentsOffset( QPainter * p, int ox, int oy,
+ int cx, int cy, int cw, int ch );
+
+
+
+private:
+ /** Given gdb's 'frame' information, compute decent
+ textual representation for display.
+
+ The function is used both for frames and threads.
+ */
+ void formatFrame(const GDBMI::Value& frame,
+ QString& func_column,
+ QString& source_column);
+
+ /** Cause gdb to produce backtrace for the current thread.
+
+ GDB reply will be route to parseArg and parseGDBBacktraceList,
+ and will show up under viewedThread_ (if there are threads), or
+ on top-level.
+ */
+ void getBacktrace(int min_frame = 0, int max_frame = frameChunk_);
+
+ /** Obtains backtrace for the specified thread without chaning the current
+ thread in gdb.
+
+ Switches viewedThread_ to the specified thread, switches gdb thread,
+ call getBacktrace(), and switches the current thread back.
+ */
+ void getBacktraceForThread(int threadNo);
+ friend class ThreadStackItem;
+
+
+ void handleThreadList(const GDBMI::ResultRecord&);
+ void handleThread(const GDBMI::ResultRecord&);
+ void parseGDBBacktraceList(const GDBMI::ResultRecord&);
+ void handleStackDepth(const GDBMI::ResultRecord& r);
+
+public slots:
+ void slotEvent(GDBController::event_t e);
+ void slotSelectionChanged(QListViewItem *thisItem);
+
+#if QT_VERSION < 300
+private:
+ QListViewItem* findItemWhichBeginsWith(const QString& text) const;
+#endif
+ virtual void showEvent(QShowEvent*);
+
+private:
+
+ void clear();
+
+private:
+
+ ThreadStackItem *viewedThread_;
+ int currentFrame_;
+ GDBController* controller_;
+
+ // Data to pass from 'getBacktrace' to 'handleStackDepth'
+ int minFrame_;
+ int maxFrame_;
+ bool has_more_frames;
+
+ bool mayUpdate_;
+
+ friend class FrameStackItem;
+
+ static const int frameChunk_ = 5;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/gdbbreakpointwidget.cpp b/languages/cpp/debugger/gdbbreakpointwidget.cpp
new file mode 100644
index 00000000..f9a83d6c
--- /dev/null
+++ b/languages/cpp/debugger/gdbbreakpointwidget.cpp
@@ -0,0 +1,1262 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "gdbbreakpointwidget.h"
+#include "gdbtable.h"
+#include "debuggertracingdialog.h"
+#include "gdbcommand.h"
+#include "gdbcontroller.h"
+
+#include "breakpoint.h"
+#include "domutil.h"
+
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kurl.h>
+#include <kmessagebox.h>
+
+#include <qvbuttongroup.h>
+#include <qfileinfo.h>
+#include <qheader.h>
+#include <qtable.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+
+#include <stdlib.h>
+#include <ctype.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+
+enum Column {
+ Control = 0,
+ Enable = 1,
+ Type = 2,
+ Status = 3,
+ Location = 4,
+ Condition = 5,
+ IgnoreCount = 6,
+ Hits = 7,
+ Tracing = 8
+};
+
+
+#define numCols 9
+
+enum BW_ITEMS { BW_ITEM_Show, BW_ITEM_Edit, BW_ITEM_Disable, BW_ITEM_Delete,
+ BW_ITEM_DisableAll, BW_ITEM_EnableAll, BW_ITEM_DeleteAll};
+
+static int m_activeFlag = 0;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class BreakpointTableRow : public QTableItem
+{
+public:
+
+ BreakpointTableRow(QTable* table, EditType editType, Breakpoint* bp);
+ ~BreakpointTableRow();
+
+ bool match (Breakpoint* bp) const;
+ void reset ();
+ void setRow();
+
+ Breakpoint* breakpoint() { return m_breakpoint; }
+
+private:
+ void appendEmptyRow();
+
+private:
+ Breakpoint* m_breakpoint;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+BreakpointTableRow::BreakpointTableRow(QTable* parent, EditType editType,
+ Breakpoint* bp) :
+ QTableItem(parent, editType, ""),
+ m_breakpoint(bp)
+{
+ appendEmptyRow();
+ setRow();
+}
+
+/***************************************************************************/
+
+BreakpointTableRow::~BreakpointTableRow()
+{
+ m_breakpoint->deleteLater();
+}
+
+/***************************************************************************/
+
+bool BreakpointTableRow::match(Breakpoint* breakpoint) const
+{
+ return m_breakpoint->match(breakpoint);
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::reset()
+{
+ m_breakpoint->reset();
+ setRow();
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::appendEmptyRow()
+{
+ int row = table()->numRows();
+ table()->setNumRows(row+1);
+
+ table()->setItem(row, Control, this);
+
+ QCheckTableItem* cti = new QCheckTableItem( table(), "");
+ table()->setItem(row, Enable, cti);
+
+ ComplexEditCell* act = new ComplexEditCell(table());
+ table()->setItem(row, Tracing, act);
+ QObject::connect(act, SIGNAL(edit(QTableItem*)),
+ table()->parent(), SLOT(editTracing(QTableItem*)));
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::setRow()
+{
+ if ( m_breakpoint )
+ {
+ QTableItem *item = table()->item ( row(), Enable );
+ Q_ASSERT(item->rtti() == 2);
+ ((QCheckTableItem*)item)->setChecked(m_breakpoint->isEnabled());
+
+ QString status=m_breakpoint->statusDisplay(m_activeFlag);
+
+ table()->setText(row(), Status, status);
+ table()->setText(row(), Condition, m_breakpoint->conditional());
+ table()->setText(row(), IgnoreCount, QString::number(m_breakpoint->ignoreCount() ));
+ table()->setText(row(), Hits, QString::number(m_breakpoint->hits() ));
+
+ QString displayType = m_breakpoint->displayType();
+ table()->setText(row(), Location, m_breakpoint->location());
+
+
+ QTableItem* ce = table()->item( row(), Tracing );
+ ce->setText(breakpoint()->tracingEnabled() ? "Enabled" : "Disabled");
+ // In case there's editor open in this cell, update it too.
+ static_cast<ComplexEditCell*>(ce)->updateValue();
+
+
+ if (m_breakpoint->isTemporary())
+ displayType = i18n(" temporary");
+ if (m_breakpoint->isHardwareBP())
+ displayType += i18n(" hw");
+
+ table()->setText(row(), Type, displayType);
+ table()->adjustColumn(Type);
+ table()->adjustColumn(Status);
+ table()->adjustColumn(Location);
+ table()->adjustColumn(Hits);
+ table()->adjustColumn(IgnoreCount);
+ table()->adjustColumn(Condition);
+ }
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+GDBBreakpointWidget::GDBBreakpointWidget(GDBController* controller,
+ QWidget *parent, const char *name) :
+QHBox(parent, name),
+controller_(controller)
+{
+ m_table = new GDBTable(0, numCols, this, name);
+ m_table->setSelectionMode(QTable::SingleRow);
+ m_table->setShowGrid (false);
+ m_table->setLeftMargin(0);
+ m_table->setFocusStyle(QTable::FollowStyle);
+
+ m_table->hideColumn(Control);
+ m_table->setColumnReadOnly(Type, true);
+ m_table->setColumnReadOnly(Status, true);
+ m_table->setColumnReadOnly(Hits, true);
+ m_table->setColumnWidth( Enable, 20);
+
+ QHeader *header = m_table->horizontalHeader();
+
+ header->setLabel( Enable, "" );
+ header->setLabel( Type, i18n("Type") );
+ header->setLabel( Status, i18n("Status") );
+ header->setLabel( Location, i18n("Location") );
+ header->setLabel( Condition, i18n("Condition") );
+ header->setLabel( IgnoreCount, i18n("Ignore Count") );
+ header->setLabel( Hits, i18n("Hits") );
+ header->setLabel( Tracing, i18n("Tracing") );
+
+ QPopupMenu* newBreakpoint = new QPopupMenu(this);
+ newBreakpoint->insertItem(i18n("Code breakpoint", "Code"),
+ BP_TYPE_FilePos);
+ newBreakpoint->insertItem(i18n("Data breakpoint", "Data write"),
+ BP_TYPE_Watchpoint);
+ newBreakpoint->insertItem(i18n("Data read breakpoint", "Data read"),
+ BP_TYPE_ReadWatchpoint);
+
+
+ m_ctxMenu = new QPopupMenu( this );
+ m_ctxMenu->insertItem( i18n("New breakpoint", "New"),
+ newBreakpoint);
+ m_ctxMenu->insertItem( i18n( "Show text" ), BW_ITEM_Show );
+ int edit_id =
+ m_ctxMenu->insertItem( i18n( "Edit" ), BW_ITEM_Edit );
+ m_ctxMenu->setAccel(Qt::Key_Enter, edit_id);
+ m_ctxMenu->insertItem( i18n( "Disable" ), BW_ITEM_Disable );
+ int del_id =
+ m_ctxMenu->insertItem( SmallIcon("breakpoint_delete"),
+ i18n( "Delete" ), BW_ITEM_Delete );
+ m_ctxMenu->setAccel(Qt::Key_Delete, del_id);
+ m_ctxMenu->insertSeparator();
+ m_ctxMenu->insertItem( i18n( "Disable all"), BW_ITEM_DisableAll );
+ m_ctxMenu->insertItem( i18n( "Enable all"), BW_ITEM_EnableAll );
+ m_ctxMenu->insertItem( i18n( "Delete all"), BW_ITEM_DeleteAll );
+
+ m_table->show();
+
+ connect( newBreakpoint, SIGNAL(activated(int)),
+ this, SLOT(slotAddBlankBreakpoint(int)) );
+
+ connect( m_table, SIGNAL(contextMenuRequested(int, int, const QPoint &)),
+ this, SLOT(slotContextMenuShow(int, int, const QPoint & )) );
+ connect( m_ctxMenu, SIGNAL(activated(int)),
+ this, SLOT(slotContextMenuSelect(int)) );
+
+ connect( m_table, SIGNAL(doubleClicked(int, int, int, const QPoint &)),
+ this, SLOT(slotRowDoubleClicked(int, int, int, const QPoint &)));
+
+ connect( m_table, SIGNAL(valueChanged(int, int)),
+ this, SLOT(slotNewValue(int, int)));
+
+ connect( m_table, SIGNAL(returnPressed()),
+ this, SLOT(slotEditBreakpoint()));
+// connect( m_table, SIGNAL(f2Pressed()),
+// this, SLOT(slotEditBreakpoint()));
+ connect( m_table, SIGNAL(deletePressed()),
+ this, SLOT(slotRemoveBreakpoint()));
+// This slot doesn't exist anymore
+// connect( m_table, SIGNAL(insertPressed()),
+// this, SLOT(slotAddBlankBreakpoint()));
+
+ // FIXME: maybe, all debugger components should derive from
+ // a base class that does this connect.
+ connect(controller, SIGNAL(event(GDBController::event_t)),
+ this, SLOT(slotEvent(GDBController::event_t)));
+
+ connect(controller,
+ SIGNAL(watchpointHit(int, const QString&, const QString&)),
+ this,
+ SLOT(slotWatchpointHit(int, const QString&, const QString&)));
+}
+
+/***************************************************************************/
+
+GDBBreakpointWidget::~GDBBreakpointWidget()
+{
+ delete m_table;
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::reset()
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ btr->reset();
+ sendToGdb(*(btr->breakpoint()));
+ }
+ }
+}
+
+/***************************************************************************/
+
+// When a file is loaded then we need to tell the editor (display window)
+// which lines contain a breakpoint.
+void GDBBreakpointWidget::slotRefreshBP(const KURL &filename)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ FilePosBreakpoint* bp = dynamic_cast<FilePosBreakpoint*>(btr->breakpoint());
+ if (bp && bp->hasFileAndLine()
+ && (bp->fileName() == filename.path()))
+ emit refreshBPState(*bp);
+ }
+ }
+}
+
+void GDBBreakpointWidget::slotBreakpointHit(int id)
+{
+ BreakpointTableRow* br = findId(id);
+
+ // FIXME: should produce an message, this is most likely
+ // an error.
+ if (!br)
+ return;
+
+ Breakpoint* b = br->breakpoint();
+
+ if (b->tracingEnabled())
+ {
+ controller_->addCommand(
+ new CliCommand(("printf "
+ + b->traceRealFormatString()).latin1(),
+ this,
+ &GDBBreakpointWidget::handleTracingPrintf));
+
+ controller_->addCommand(new
+ GDBCommand("-exec-continue"));
+
+ }
+ else
+ {
+ controller_->demandAttention();
+ }
+}
+
+void GDBBreakpointWidget::slotWatchpointHit(int id,
+ const QString& oldValue,
+ const QString& newValue)
+{
+ BreakpointTableRow* br = findId(id);
+
+ // FIXME: should produce an message, this is most likely
+ // an error.
+ if (!br)
+ return;
+
+ Watchpoint* b = dynamic_cast<Watchpoint*>(br->breakpoint());
+
+
+ KMessageBox::information(
+ 0,
+ i18n("<b>Data write breakpoint</b><br>"
+ "Expression: %1<br>"
+ "Address: 0x%2<br>"
+ "Old value: %3<br>"
+ "New value: %4")
+ .arg(b->varName())
+ .arg(b->address(), 0, 16)
+ .arg(oldValue)
+ .arg(newValue));
+}
+
+/***************************************************************************/
+
+BreakpointTableRow* GDBBreakpointWidget::find(Breakpoint *breakpoint)
+{
+ // NOTE:- The match doesn't have to be equal. Each type of bp
+ // must decide on the match criteria.
+ Q_ASSERT (breakpoint);
+
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->match(breakpoint))
+ return btr;
+ }
+
+ return 0;
+}
+
+/***************************************************************************/
+
+// The Id is supplied by the debugger
+BreakpointTableRow* GDBBreakpointWidget::findId(int dbgId)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->breakpoint()->dbgId() == dbgId)
+ return btr;
+ }
+
+ return 0;
+}
+
+/***************************************************************************/
+
+// The key is a unique number supplied by us
+BreakpointTableRow* GDBBreakpointWidget::findKey(int BPKey)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->breakpoint()->key() == BPKey)
+ return btr;
+ }
+
+ return 0;
+}
+
+bool GDBBreakpointWidget::hasWatchpointForAddress(
+ unsigned long long address) const
+{
+ for(int i = 0; i < m_table->numRows(); ++i)
+ {
+ BreakpointTableRow* br = (BreakpointTableRow*)
+ m_table->item(i, Control);
+
+ Watchpoint* w = dynamic_cast<Watchpoint*>(br->breakpoint());
+ if (w && w->address() == address)
+ return true;
+ }
+ return false;
+}
+
+/***************************************************************************/
+
+BreakpointTableRow* GDBBreakpointWidget::addBreakpoint(Breakpoint *bp)
+{
+ BreakpointTableRow* btr =
+ new BreakpointTableRow( m_table, QTableItem::WhenCurrent, bp );
+
+ connect(bp, SIGNAL(modified(Breakpoint*)),
+ this, SLOT(slotBreakpointModified(Breakpoint*)));
+
+ sendToGdb(*bp);
+
+ return btr;
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::removeBreakpoint(BreakpointTableRow* btr)
+{
+ if (!btr)
+ return;
+
+ // Pending but the debugger hasn't started processing this bp so
+ // we can just remove it.
+ Breakpoint* bp = btr->breakpoint();
+ // No gdb breakpoint, and no breakpoint addition command in the
+ // queue. Just remove.
+ if (bp->dbgId() == -1 && !bp->isDbgProcessing())
+ {
+ bp->setActionDie();
+ sendToGdb(*bp);
+ m_table->removeRow(btr->row());
+ }
+ else
+ {
+ bp->setActionClear(true);
+ sendToGdb(*bp);
+ btr->setRow();
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotToggleBreakpoint(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ if (btr)
+ {
+ removeBreakpoint(btr);
+ }
+ else
+ addBreakpoint(fpBP);
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotToggleBreakpointEnabled(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ delete fpBP;
+ if (btr)
+ {
+ Breakpoint* bp=btr->breakpoint();
+ bp->setEnabled(!bp->isEnabled());
+ sendToGdb(*bp);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotToggleWatchpoint(const QString &varName)
+{
+ Watchpoint *watchpoint = new Watchpoint(varName, false, true);
+ BreakpointTableRow* btr = find(watchpoint);
+ if (btr)
+ {
+ removeBreakpoint(btr);
+ delete watchpoint;
+ }
+ else
+ addBreakpoint(watchpoint);
+}
+
+void GDBBreakpointWidget::handleBreakpointList(const GDBMI::ResultRecord& r)
+{
+ m_activeFlag++;
+
+ const GDBMI::Value& blist = r["BreakpointTable"]["body"];
+
+ for(unsigned i = 0, e = blist.size(); i != e; ++i)
+ {
+ const GDBMI::Value& b = blist[i];
+
+ int id = b["number"].literal().toInt();
+ BreakpointTableRow* btr = findId(id);
+ if (btr)
+ {
+ Breakpoint *bp = btr->breakpoint();
+ bp->setActive(m_activeFlag, id);
+ bp->setHits(b["times"].toInt());
+ if (b.hasField("ignore"))
+ bp->setIgnoreCount(b["ignore"].toInt());
+ else
+ bp->setIgnoreCount(0);
+ if (b.hasField("cond"))
+ bp->setConditional(b["cond"].literal());
+ else
+ bp->setConditional(QString::null);
+ btr->setRow();
+ emit publishBPState(*bp);
+ }
+ else
+ {
+ // It's a breakpoint added outside, most probably
+ // via gdb console. Add it now.
+ QString type = b["type"].literal();
+
+ if (type == "breakpoint" || type == "hw breakpoint")
+ {
+ if (b.hasField("fullname") && b.hasField("line"))
+ {
+ Breakpoint* bp = new FilePosBreakpoint(
+ b["fullname"].literal(),
+ b["line"].literal().toInt());
+
+ bp->setActive(m_activeFlag, id);
+ bp->setActionAdd(false);
+ bp->setPending(false);
+
+ new BreakpointTableRow(m_table,
+ QTableItem::WhenCurrent,
+ bp);
+
+ emit publishBPState(*bp);
+ }
+ }
+
+ }
+ }
+
+ // Remove any inactive breakpoints.
+ for ( int row = m_table->numRows()-1; row >= 0 ; row-- )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ Breakpoint* bp = btr->breakpoint();
+ if (!(bp->isActive(m_activeFlag)))
+ {
+ // FIXME: need to review is this happens for
+ // as-yet unset breakpoint.
+ bp->removedInGdb();
+ }
+ }
+ }
+}
+
+void GDBBreakpointWidget::handleTracingPrintf(const QValueVector<QString>& s)
+{
+ // The first line of output is the command itself, which we don't need.
+ for(unsigned i = 1; i < s.size(); ++i)
+ emit tracingOutput(s[i].local8Bit());
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotBreakpointSet(Breakpoint* bp)
+{
+ // FIXME: why 'key' is used here?
+ BreakpointTableRow* btr = findKey(bp->key());
+ if (!btr)
+ {
+ kdDebug(9012) << "Early return\n";
+ return;
+ }
+
+ btr->setRow();
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotAddBlankBreakpoint(int idx)
+{
+ BreakpointTableRow* btr = 0;
+ switch (idx)
+ {
+ case BP_TYPE_FilePos:
+ btr = addBreakpoint(new FilePosBreakpoint());
+ break;
+
+ case BP_TYPE_Watchpoint:
+ btr = addBreakpoint(new Watchpoint(""));
+ break;
+
+ case BP_TYPE_ReadWatchpoint:
+ btr = addBreakpoint(new ReadWatchpoint(""));
+ break;
+
+ default:
+ break;
+ }
+
+ if (btr)
+ {
+ m_table->selectRow(btr->row());
+ m_table->editCell(btr->row(), Location, false);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotRemoveBreakpoint()
+{
+ int row = m_table->currentRow();
+ if ( row != -1)
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ removeBreakpoint(btr);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotRemoveAllBreakpoints()
+{
+ for ( int row = m_table->numRows()-1; row>=0; row-- )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ removeBreakpoint(btr);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotRowDoubleClicked(int row, int col, int btn, const QPoint &)
+{
+ if ( btn == Qt::LeftButton )
+ {
+// kdDebug(9012) << "in slotRowSelected row=" << row << endl;
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ FilePosBreakpoint* bp = dynamic_cast<FilePosBreakpoint*>(btr->breakpoint());
+ if (bp && bp->hasFileAndLine())
+ emit gotoSourcePosition(bp->fileName(), bp->lineNum()-1);
+
+ // put the focus back on the clicked item if appropriate
+ if (col == Location || col == Condition || col == IgnoreCount)
+ m_table->editCell(row, col, false);
+ }
+ }
+}
+
+void GDBBreakpointWidget::slotContextMenuShow( int row, int /*col*/, const QPoint &mousePos )
+{
+ BreakpointTableRow *btr = (BreakpointTableRow *)m_table->item(row, Control );
+
+ if (btr == NULL)
+ {
+ btr = (BreakpointTableRow *)m_table->item(m_table->currentRow(),
+ Control );
+ }
+
+ if (btr != NULL)
+ {
+ m_ctxMenu->setItemEnabled(
+ BW_ITEM_Show,
+ btr->breakpoint()->hasFileAndLine());
+
+ if (btr->breakpoint( )->isEnabled( ))
+ {
+ m_ctxMenu->changeItem( BW_ITEM_Disable, i18n("Disable") );
+ }
+ else
+ {
+ m_ctxMenu->changeItem( BW_ITEM_Disable, i18n("Enable") );
+ }
+
+ m_ctxMenu->setItemEnabled(BW_ITEM_Disable, true);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Delete, true);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Edit, true);
+ }
+ else
+ {
+ m_ctxMenu->setItemEnabled(BW_ITEM_Show, false);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Disable, false);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Delete, false);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Edit, false);
+ }
+
+ bool has_bps = (m_table->numRows() != 0);
+ m_ctxMenu->setItemEnabled(BW_ITEM_DisableAll, has_bps);
+ m_ctxMenu->setItemEnabled(BW_ITEM_EnableAll, has_bps);
+ m_ctxMenu->setItemEnabled(BW_ITEM_Delete, has_bps);
+
+ m_ctxMenu->popup( mousePos );
+}
+
+void GDBBreakpointWidget::slotContextMenuSelect( int item )
+{
+ int row, col;
+ BreakpointTableRow *btr;
+ Breakpoint *bp;
+ FilePosBreakpoint *fbp;
+
+ row= m_table->currentRow( );
+ if (row == -1)
+ return;
+ btr = (BreakpointTableRow *)m_table->item( row, Control );
+ if (btr == NULL)
+ return;
+ bp = btr->breakpoint( );
+ if (bp == NULL)
+ return;
+ fbp = dynamic_cast<FilePosBreakpoint*>(bp);
+
+ switch( item )
+ {
+ case BW_ITEM_Show:
+ if (fbp)
+ emit gotoSourcePosition(fbp->fileName(), fbp->lineNum()-1);
+ break;
+ case BW_ITEM_Edit:
+ col = m_table->currentColumn( );
+ if (col == Location || col == Condition || col == IgnoreCount)
+ m_table->editCell(row, col, false);
+ break;
+ case BW_ITEM_Disable:
+
+ bp->setEnabled( !bp->isEnabled( ) );
+ btr->setRow( );
+ sendToGdb( *bp );
+ break;
+ case BW_ITEM_Delete:
+ slotRemoveBreakpoint( );
+ break;
+ case BW_ITEM_DeleteAll:
+ slotRemoveAllBreakpoints();
+ break;
+ case BW_ITEM_DisableAll:
+ case BW_ITEM_EnableAll:
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *)
+ m_table->item(row, Control);
+
+ if (btr)
+ {
+ btr->breakpoint()->setEnabled(item == BW_ITEM_EnableAll);
+ btr->setRow();
+ sendToGdb(*btr->breakpoint());
+ }
+ }
+ break;
+ default:
+ // oops, check it out! this case is not in sync with the
+ // m_ctxMenu. Check the enum in the header file.
+ return;
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotEditRow(int row, int col, const QPoint &)
+{
+// kdDebug(9012) << "in slotEditRow row=" << row << endl;
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ if (col == Location || col == Condition || col == IgnoreCount)
+ m_table->editCell(row, col, false);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotNewValue(int row, int col)
+{
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+
+ QString new_value = m_table->text(row, col);
+
+ if (btr)
+ {
+ Breakpoint* bp = btr->breakpoint();
+ switch (col)
+ {
+ case Enable:
+ {
+ QCheckTableItem *item =
+ (QCheckTableItem*)m_table->item ( row, Enable );
+ bp->setEnabled(item->isChecked());
+ }
+ break;
+
+ case Location:
+ {
+ if (bp->location() != new_value)
+ {
+ // GDB does not allow to change location of
+ // an existing breakpoint. So, need to remove old
+ // breakpoint and add another.
+
+ // Announce to editor that breakpoit at its
+ // current location is dying.
+ bp->setActionDie();
+ emit publishBPState(*bp);
+
+ // However, we don't want the line in breakpoint
+ // widget to disappear and appear again.
+
+ // Emit delete command. This won't resync breakpoint
+ // table (unlike clearBreakpoint), so we won't have
+ // nasty effect where line in the table first disappears
+ // and then appears again, and won't have internal issues
+ // as well.
+ if (!controller_->stateIsOn(s_dbgNotStarted))
+ controller_->addCommand(bp->dbgRemoveCommand().latin1());
+
+ // Now add new breakpoint in gdb. It will correspond to
+ // the same 'Breakpoint' and 'BreakpointRow' objects in
+ // KDevelop is the previous, deleted, breakpoint.
+
+ // Note: clears 'actionDie' implicitly.
+ bp->setActionAdd(true);
+ bp->setLocation(new_value);
+ }
+ break;
+ }
+
+ case Condition:
+ {
+ bp->setConditional(new_value);
+ break;
+ }
+
+ case IgnoreCount:
+ {
+ bp->setIgnoreCount(new_value.toInt());
+ break;
+ }
+ default:
+ break;
+ }
+
+ bp->setActionModify(true);
+
+
+ // This is not needed for most changes, since we've
+ // just read a value from table cell to breakpoint, and
+ // setRow will write back the same value to the cell.
+ // It's only really needed for tracing column changes,
+ // where tracing config dialog directly changes breakpoint,
+ // so we need to send those changes to the table.
+ btr->setRow();
+
+
+ sendToGdb(*bp);
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotEditBreakpoint(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ delete fpBP;
+
+ if (btr)
+ {
+ QTableSelection ts;
+ ts.init(btr->row(), 0);
+ ts.expandTo(btr->row(), numCols);
+ m_table->addSelection(ts);
+ m_table->editCell(btr->row(), Location, false);
+ }
+
+}
+
+void GDBBreakpointWidget::sendToGdb(Breakpoint& BP)
+{
+ // Announce the change in state. We need to do this before
+ // everything. For example, if debugger is not yet running, we'll
+ // immediate exit after setting pending flag, but we still want changes
+ // in "enabled" flag to be shown on the left border of the editor.
+ emit publishBPState(BP);
+
+ BP.sendToGdb(controller_);
+}
+
+void GDBBreakpointWidget::slotBreakpointModified(Breakpoint* b)
+{
+ emit publishBPState(*b);
+
+ if (BreakpointTableRow* btr = find(b))
+ {
+ if (b->isActionDie())
+ {
+ // Breakpoint was deleted, kill the table row.
+ m_table->removeRow(btr->row());
+ }
+ else
+ {
+ btr->setRow();
+ }
+ }
+}
+
+void GDBBreakpointWidget::slotEvent(GDBController::event_t e)
+{
+ switch(e)
+ {
+ case GDBController::program_state_changed:
+ {
+ controller_->addCommand(
+ new GDBCommand("-break-list",
+ this,
+ &GDBBreakpointWidget::handleBreakpointList));
+ break;
+ }
+
+ case GDBController::shared_library_loaded:
+ case GDBController::connected_to_program:
+ {
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *)
+ m_table->item(row, Control);
+
+ if (btr)
+ {
+ Breakpoint* bp = btr->breakpoint();
+ if ( (bp->dbgId() == -1 || bp->isPending())
+ && !bp->isDbgProcessing()
+ && bp->isValid())
+ {
+ sendToGdb(*bp);
+ }
+ }
+ }
+ break;
+ }
+ case GDBController::program_exited:
+ {
+ for(int row = 0; row < m_table->numRows(); ++row)
+ {
+ Breakpoint* b = static_cast<BreakpointTableRow*>(
+ m_table->item(row, Control))->breakpoint();
+
+ b->applicationExited(controller_);
+ }
+ }
+
+ default:
+ ;
+ }
+}
+
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::slotEditBreakpoint()
+{
+ m_table->editCell(m_table->currentRow(), Location, false);
+}
+
+
+void GDBBreakpointWidget::editTracing(QTableItem* item)
+{
+ BreakpointTableRow* btr = (BreakpointTableRow *)
+ m_table->item(item->row(), Control);
+
+ DebuggerTracingDialog* d = new DebuggerTracingDialog(
+ btr->breakpoint(), m_table, "");
+
+ int r = d->exec();
+
+ // Note: change cell text here and explicitly call slotNewValue here.
+ // We want this signal to be emitted when we close the tracing dialog
+ // and not when we select some other cell, as happens in Qt by default.
+ if (r == QDialog::Accepted)
+ {
+ // The dialog has modified "btr->breakpoint()" already.
+ // Calling 'slotNewValue' will flush the changes back
+ // to the table.
+ slotNewValue(item->row(), item->col());
+ }
+
+ delete d;
+}
+
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::savePartialProjectSession(QDomElement* el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull())
+ return;
+
+ QDomElement breakpointListEl = domDoc.createElement("breakpointList");
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr =
+ (BreakpointTableRow *) m_table->item(row, Control);
+ Breakpoint* bp = btr->breakpoint();
+
+ QDomElement breakpointEl =
+ domDoc.createElement("breakpoint"+QString::number(row));
+
+ breakpointEl.setAttribute("type", bp->type());
+ breakpointEl.setAttribute("location", bp->location(false));
+ breakpointEl.setAttribute("enabled", bp->isEnabled());
+ breakpointEl.setAttribute("condition", bp->conditional());
+ breakpointEl.setAttribute("tracingEnabled",
+ QString::number(bp->tracingEnabled()));
+ breakpointEl.setAttribute("traceFormatStringEnabled",
+ QString::number(bp->traceFormatStringEnabled()));
+ breakpointEl.setAttribute("tracingFormatString",
+ bp->traceFormatString());
+
+ QDomElement tracedExpressions =
+ domDoc.createElement("tracedExpressions");
+
+ QStringList::const_iterator i, e;
+ for(i = bp->tracedExpressions().begin(),
+ e = bp->tracedExpressions().end();
+ i != e; ++i)
+ {
+ QDomElement expr = domDoc.createElement("expression");
+ expr.setAttribute("value", *i);
+ tracedExpressions.appendChild(expr);
+ }
+
+ breakpointEl.appendChild(tracedExpressions);
+
+ breakpointListEl.appendChild(breakpointEl);
+ }
+
+ if (!breakpointListEl.isNull())
+ el->appendChild(breakpointListEl);
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el)
+{
+ /** Eventually, would be best to make each breakpoint type handle loading/
+ saving it's data. The only problem is that on load, we need to allocate
+ with new different objects, depending on type, and that requires some
+ kind of global registry. Gotta find out if a solution for that exists in
+ KDE (Boost.Serialization is too much dependency, and rolling my own is
+ boring).
+ */
+ QDomElement breakpointListEl = el->namedItem("breakpointList").toElement();
+ if (!breakpointListEl.isNull())
+ {
+ QDomElement breakpointEl;
+ for (breakpointEl = breakpointListEl.firstChild().toElement();
+ !breakpointEl.isNull();
+ breakpointEl = breakpointEl.nextSibling().toElement())
+ {
+ Breakpoint* bp=0;
+ BP_TYPES type = (BP_TYPES) breakpointEl.attribute( "type", "0").toInt();
+ switch (type)
+ {
+ case BP_TYPE_FilePos:
+ {
+ bp = new FilePosBreakpoint();
+ break;
+ }
+ case BP_TYPE_Watchpoint:
+ {
+ bp = new Watchpoint("");
+ break;
+ }
+ default:
+ break;
+ }
+
+ // Common settings for any type of breakpoint
+ if (bp)
+ {
+ bp->setLocation(breakpointEl.attribute( "location", ""));
+ if (type == BP_TYPE_Watchpoint)
+ {
+ bp->setEnabled(false);
+ }
+ else
+ {
+ bp->setEnabled(
+ breakpointEl.attribute( "enabled", "1").toInt());
+ }
+ bp->setConditional(breakpointEl.attribute( "condition", ""));
+
+ bp->setTracingEnabled(
+ breakpointEl.attribute("tracingEnabled", "0").toInt());
+ bp->setTraceFormatString(
+ breakpointEl.attribute("tracingFormatString", ""));
+ bp->setTraceFormatStringEnabled(
+ breakpointEl.attribute("traceFormatStringEnabled", "0")
+ .toInt());
+
+ QDomNode tracedExpr =
+ breakpointEl.namedItem("tracedExpressions");
+
+ if (!tracedExpr.isNull())
+ {
+ QStringList l;
+
+ for(QDomNode c = tracedExpr.firstChild(); !c.isNull();
+ c = c.nextSibling())
+ {
+ QDomElement el = c.toElement();
+ l.push_back(el.attribute("value", ""));
+ }
+ bp->setTracedExpressions(l);
+ }
+
+ // Now add the breakpoint. Don't try to check if
+ // breakpoint already exists.
+ // It's easy to check that breakpoint on the same
+ // line already exists, but it might have different condition,
+ // and checking conditions for equality is too complex thing.
+ // And anyway, it's will be suprising of realoading a project
+ // changes the set of breakpoints.
+ addBreakpoint(bp);
+ }
+ }
+ }
+}
+
+/***************************************************************************/
+
+void GDBBreakpointWidget::focusInEvent( QFocusEvent */* e*/ )
+{
+ // Without the following 'if', when we first open the breakpoints
+ // widget, the background is all black. This happens only with
+ // m_table->setFocusStyle(QTable::FollowStyle);
+ // in constructor, so I suspect Qt bug. But anyway, without
+ // current cell keyboard actions like Enter for edit won't work,
+ // so keyboard focus does not makes much sense.
+ if (m_table->currentRow() == -1 ||
+ m_table->currentColumn() == -1)
+ {
+ m_table->setCurrentCell(0, 0);
+ }
+ m_table->setFocus();
+}
+
+ComplexEditCell::
+ComplexEditCell(QTable* table)
+: QTableItem(table, QTableItem::WhenCurrent)
+{
+}
+
+
+QWidget* ComplexEditCell::createEditor() const
+{
+ QHBox* box = new QHBox( table()->viewport() );
+ box->setPaletteBackgroundColor(
+ table()->palette().active().highlight());
+
+ label_ = new QLabel(text(), box, "label");
+ label_->setBackgroundMode(Qt::PaletteHighlight);
+ // Sorry for hardcode, but '2' is already hardcoded in
+ // Qt source, in QTableItem::paint. Since I don't want the
+ // text to jump 2 pixels to the right when editor is activated,
+ // need to set the same indent for label.
+ label_->setIndent(2);
+ QPalette p = label_->palette();
+
+ p.setColor(QPalette::Active, QColorGroup::Foreground,
+ table()->palette().active().highlightedText());
+ p.setColor(QPalette::Inactive, QColorGroup::Foreground,
+ table()->palette().active().highlightedText());
+
+ label_->setPalette(p);
+
+ QPushButton* b = new QPushButton("...", box);
+ // This is exactly what is done in QDesigner source in the
+ // similar context. Haven't had any success making the good look
+ // with layout, I suppose that sizeHint for button is always larger
+ // than 20.
+ b->setFixedWidth( 20 );
+
+ connect(b, SIGNAL(clicked()), this, SLOT(slotEdit()));
+
+ return box;
+}
+
+void ComplexEditCell::updateValue()
+{
+ if (!label_.isNull())
+ {
+ label_->setText(table()->text(row(), col()));
+ }
+}
+
+void ComplexEditCell::slotEdit()
+{
+ emit edit(this);
+}
+
+}
+
+
+#include "gdbbreakpointwidget.moc"
diff --git a/languages/cpp/debugger/gdbbreakpointwidget.h b/languages/cpp/debugger/gdbbreakpointwidget.h
new file mode 100644
index 00000000..91dc40a5
--- /dev/null
+++ b/languages/cpp/debugger/gdbbreakpointwidget.h
@@ -0,0 +1,174 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GDBBreakpointWidget_H_
+#define _GDBBreakpointWidget_H_
+
+#include <qhbox.h>
+#include <qpopupmenu.h>
+#include <qtable.h>
+#include <qguardedptr.h>
+#include <qvaluevector.h>
+
+#include "mi/gdbmi.h"
+#include "gdbcontroller.h"
+
+class QDomElement;
+class QToolButton;
+class QLabel;
+class KURL;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace GDBDebugger
+{
+class Breakpoint;
+class BreakpointTableRow;
+class GDBTable;
+class GDBController;
+
+class GDBBreakpointWidget : public QHBox
+{
+ Q_OBJECT
+
+public:
+ GDBBreakpointWidget( GDBController* controller,
+ QWidget* parent=0, const char* name=0 );
+ virtual ~GDBBreakpointWidget();
+
+ void reset();
+
+ void savePartialProjectSession(QDomElement* el);
+ void restorePartialProjectSession(const QDomElement* el);
+
+ bool hasWatchpointForAddress(unsigned long long address) const;
+
+
+public slots:
+ // Connected to from the editor widget:
+ void slotToggleBreakpoint(const QString &filename, int lineNum);
+ void slotToggleBreakpointEnabled(const QString &fileName, int lineNum);
+
+ // Connected to from the variable widget:
+ void slotToggleWatchpoint(const QString &varName);
+
+ void slotBreakpointSet(Breakpoint*);
+
+ void slotRefreshBP(const KURL &filename);
+
+ void slotBreakpointHit(int id);
+
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+
+ friend class BreakpointActionCell; // for access to slotNewValue
+private slots:
+ void slotRemoveBreakpoint();
+ void slotRemoveAllBreakpoints();
+ void slotEditBreakpoint(const QString &fileName, int lineNum);
+ void slotEditBreakpoint();
+ void slotAddBlankBreakpoint(int idx);
+ void slotRowDoubleClicked(int row, int col, int button, const QPoint & mousePos);
+ void slotContextMenuShow( int row, int col, const QPoint &mousePos );
+ void slotContextMenuSelect( int item );
+ void slotEditRow(int row, int col, const QPoint & mousePos);
+ void slotNewValue(int row, int col);
+ void editTracing(QTableItem* item);
+ void slotBreakpointModified(Breakpoint*);
+
+ void slotEvent(GDBController::event_t);
+ void slotWatchpointHit(int id,
+ const QString& oldValue,
+ const QString& newValue);
+
+signals:
+ void publishBPState(const Breakpoint& brkpt);
+ void refreshBPState(const Breakpoint& brkpt);
+ void gotoSourcePosition(const QString &fileName, int lineNum);
+ // Emitted when output from yet another passed tracepoint is available.
+ void tracingOutput(const char*);
+
+private:
+ BreakpointTableRow* find(Breakpoint *bp);
+ BreakpointTableRow* findId(int id);
+ BreakpointTableRow* findKey(int BPKey);
+
+ void setActive();
+ BreakpointTableRow* addBreakpoint(Breakpoint *bp);
+ void removeBreakpoint(BreakpointTableRow* btr);
+
+ void sendToGdb(Breakpoint &);
+
+ void handleBreakpointList(const GDBMI::ResultRecord&);
+ void handleTracingPrintf(const QValueVector<QString>& s);
+
+private:
+ GDBController* controller_;
+
+ GDBTable* m_table;
+ QPopupMenu* m_ctxMenu;
+};
+
+class BreakpointTableRow;
+
+/** Custom table cell class for cells that require complex editing.
+ When current, the cell shows a "..." on the right. When clicked,
+ the 'edit' signal is emitted that can be be used to pop-up
+ a dialog box.
+
+ When editing is done, the receiver of 'edit' should change the
+ value in the table, and then call the 'updateValue' method.
+ */
+class ComplexEditCell : public QObject, public QTableItem
+{
+ Q_OBJECT
+public:
+
+ ComplexEditCell(QTable* table);
+
+ /** Called by Qt when the current cell should become editable.
+ In our case, when the item becomes current. Creates a widget
+ that will be shown in the cell and should be able to edit cell
+ content. In our case -- text plus "..." button that invokes
+ action dialog.
+ */
+ QWidget* createEditor() const;
+
+ void updateValue();
+
+private slots:
+
+ /** Called when the "..." button is clicked. */
+ void slotEdit();
+
+signals:
+ void edit(QTableItem*);
+
+private:
+ mutable QGuardedPtr<QLabel> label_;
+};
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/gdbcommand.cpp b/languages/cpp/debugger/gdbcommand.cpp
new file mode 100644
index 00000000..de5aeb9d
--- /dev/null
+++ b/languages/cpp/debugger/gdbcommand.cpp
@@ -0,0 +1,142 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "gdbcommand.h"
+#include "breakpoint.h"
+#include "variablewidget.h"
+
+namespace GDBDebugger
+{
+
+GDBCommand::GDBCommand(const QString &command)
+: command_(command), run(false), handler_this(0)
+{
+}
+
+QString GDBCommand::cmdToSend()
+{
+ return initialString() + "\n";
+}
+
+QString GDBCommand::initialString() const
+{
+ return command_;
+}
+
+bool GDBCommand::isUserCommand() const
+{
+ return false;
+}
+
+bool
+GDBCommand::invokeHandler(const GDBMI::ResultRecord& r)
+{
+ if (handler_this) {
+ (handler_this->*handler_method)(r);
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+void GDBCommand::newOutput(const QString& line)
+{
+ lines.push_back(line);
+}
+
+const QValueVector<QString>& GDBCommand::allStreamOutput() const
+{
+ return lines;
+}
+
+bool GDBCommand::handlesError() const
+{
+ return handlesError_;
+}
+
+GDBCommand::~GDBCommand()
+{
+}
+
+bool GDBCommand::isRun() const
+{
+ return run;
+}
+
+void GDBCommand::setRun(bool run)
+{
+ this->run = run;
+}
+
+
+UserCommand::UserCommand(const QString& s)
+: GDBCommand(s)
+{
+}
+
+bool UserCommand::isUserCommand() const
+{
+ return true;
+}
+
+
+ModifyBreakpointCommand::ModifyBreakpointCommand(
+ const QString& command, const Breakpoint* bp)
+: GDBCommand(command.local8Bit()),
+ bp_(bp)
+{}
+
+QString
+ModifyBreakpointCommand::cmdToSend()
+{
+ if (bp_->dbgId() > 0)
+ {
+ QString s(initialString());
+ s = s.arg(bp_->dbgId()) + "\n";
+ return s.local8Bit();
+ }
+ else
+ {
+ // The ID can be -1 either if breakpoint set command
+ // failed, or if breakpoint is somehow already deleted.
+ // In either case, should not do anything.
+ return "";
+ }
+}
+
+
+bool CliCommand::invokeHandler(const GDBMI::ResultRecord& r)
+{
+ // On error, do nothing.
+ if (r.reason != "done")
+ return true;
+
+ if (cli_handler_this) {
+ (cli_handler_this->*cli_handler_method)(allStreamOutput());
+ return true;
+ }
+ else {
+ return false;
+ }
+
+}
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
diff --git a/languages/cpp/debugger/gdbcommand.h b/languages/cpp/debugger/gdbcommand.h
new file mode 100644
index 00000000..8c928394
--- /dev/null
+++ b/languages/cpp/debugger/gdbcommand.h
@@ -0,0 +1,271 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GDBCOMMAND_H_
+#define _GDBCOMMAND_H_
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qvaluevector.h>
+
+#include "mi/gdbmi.h"
+#include <qguardedptr.h>
+
+namespace GDBDebugger
+{
+
+
+class Breakpoint;
+class VarItem;
+class ValueCallback;
+
+/**
+ * @author John Birch
+ */
+
+class GDBCommand
+{
+public:
+ GDBCommand(const QString& command);
+
+ template<class Handler>
+ GDBCommand(const QString& command,
+ Handler* handler_this,
+ void (Handler::* handler_method)(const GDBMI::ResultRecord&),
+ bool handlesError = false);
+
+ /* The command that should be sent to gdb.
+ This method is virtual so the command can compute this
+ dynamically, possibly using results of the previous
+ commands.
+ If the empty string is returned, nothing is sent. */
+ virtual QString cmdToSend();
+
+ /* Returns the initial string that was specified in
+ ctor invocation. The actual command will be
+ determined by cmdToSend above and the return
+ value of this method is only used in various
+ diagnostic messages emitted before actually
+ sending the command. */
+ QString initialString() const;
+
+ /* Returns true if this is command entered by the user
+ and so should be always shown in the gdb output window. */
+ virtual bool isUserCommand() const;
+
+ // If there's a handler for this command, invokes it and returns true.
+ // Otherwise, returns false.
+ virtual bool invokeHandler(const GDBMI::ResultRecord& r);
+
+ // Returns 'true' if 'invokeHandler' should be invoked even
+ // on MI errors.
+ bool handlesError() const;
+
+ virtual ~GDBCommand();
+
+ // Called by gdbcontroller for each new output string
+ // gdb emits for this command. In MI mode, this includes
+ // all "stream" messages, but does not include MI responses.
+ void newOutput(const QString&);
+
+ const QValueVector<QString>& allStreamOutput() const;
+
+ // True if this command run then target for
+ // unspecified period of time -- that is either 'run' or
+ // 'continue'.
+ bool isRun() const;
+
+ void setRun(bool run);
+
+private:
+ QString command_;
+ QGuardedPtr<QObject> handler_this;
+ typedef void (QObject::* handler_t)(const GDBMI::ResultRecord&);
+ handler_t handler_method;
+ QValueVector<QString> lines;
+ bool run;
+
+protected: // FIXME: should be private, after I kill the first ctor
+ // that is obsolete and no longer necessary.
+ bool handlesError_;
+
+};
+
+class UserCommand : public GDBCommand
+{
+public:
+ UserCommand(const QString& s);
+
+ bool isUserCommand() const;
+};
+
+/** This command is used to change some property of breakpoint.
+ It holds a pointer to a Breakpoint object and will substitute
+ breakpoint id into the command string.
+
+ So, the command can be issued before the breakpoint id is know. That
+ is, it's possible to queue add + modify pair. The add command will
+ set breakpoint id and modify command will use it.
+*/
+class ModifyBreakpointCommand : public GDBCommand
+{
+public:
+ /** The 'comamnd' should include a single format specifier "%1" that
+ will be replaced with the id of breakpoint.
+ */
+ ModifyBreakpointCommand(const QString& command, const Breakpoint* bp);
+
+public: // DbgCommand overrides
+ virtual QString cmdToSend();
+
+private:
+ const Breakpoint* bp_;
+};
+
+/** This is a class for raw CLI commands. Instead of invoking
+ user provided hook with MI response, it invokes the a hook
+ with lists of strings.
+*/
+class CliCommand : public GDBCommand
+{
+public:
+ template<class Handler>
+ CliCommand(const QString& command,
+ Handler* handler_this,
+ void (Handler::* handler_method)(const QValueVector<QString>&),
+ bool handlesError = false);
+
+
+
+public: // GDBCommand overrides
+ bool invokeHandler(const GDBMI::ResultRecord& r);
+
+private:
+ QGuardedPtr<QObject> cli_handler_this;
+ typedef void (QObject::* cli_handler_t)(const QValueVector<QString>&);
+ cli_handler_t cli_handler_method;
+};
+
+/** Command that does nothing and can be just used to invoke
+ a user provided handler when all preceeding commands are
+ executed.
+*/
+class SentinelCommand : public GDBCommand
+{
+public:
+ typedef void (QObject::*handler_method_t)();
+
+ template<class Handler>
+ SentinelCommand(Handler* handler_this,
+ void (Handler::* handler_method)())
+ : GDBCommand(""),
+ handler_this(handler_this),
+ handler_method(static_cast<handler_method_t>(handler_method))
+ {}
+
+ void invokeHandler()
+ {
+ (handler_this->*handler_method)();
+ }
+
+ QString cmdToSend()
+ {
+ return "";
+ }
+
+private:
+ QGuardedPtr<QObject> handler_this;
+ handler_method_t handler_method;
+
+};
+
+/* Command for which we don't want any reply. */
+class ResultlessCommand : public QObject, public GDBCommand
+{
+public:
+ ResultlessCommand(const QString& command, bool handlesError = false)
+ : GDBCommand(command, this, &ResultlessCommand::handle, handlesError)
+ {}
+
+private:
+ void handle(const GDBMI::ResultRecord&)
+ {}
+};
+
+class ExpressionValueCommand : public QObject, public GDBCommand
+{
+public:
+ typedef void (QObject::*handler_method_t)(const QString&);
+
+ template<class Handler>
+ ExpressionValueCommand(
+ const QString& expression,
+ Handler* handler_this,
+ void (Handler::* handler_method)(const QString&))
+ : GDBCommand(("-data-evaluate-expression " + expression).ascii(), this,
+ &ExpressionValueCommand::handleResponse),
+ handler_this(handler_this),
+ handler_method(static_cast<handler_method_t>(handler_method))
+ {}
+
+ void handleResponse(const GDBMI::ResultRecord& r)
+ {
+ (handler_this->*handler_method)(r["value"].literal());
+ }
+
+private:
+ QGuardedPtr<QObject> handler_this;
+ handler_method_t handler_method;
+};
+
+
+
+template<class Handler>
+GDBCommand::GDBCommand(
+ const QString& command,
+ Handler* handler_this,
+ void (Handler::* handler_method)(const GDBMI::ResultRecord&),
+ bool handlesError)
+: command_(command),
+ handler_this(handler_this),
+ handler_method(static_cast<handler_t>(handler_method)),
+ run(false),
+ handlesError_(handlesError)
+{
+}
+
+template<class Handler>
+CliCommand::CliCommand(
+ const QString& command,
+ Handler* handler_this,
+ void (Handler::* handler_method)(const QValueVector<QString>&),
+ bool handlesError)
+: GDBCommand(command.latin1()),
+ cli_handler_this(handler_this),
+ cli_handler_method(static_cast<cli_handler_t>(handler_method))
+{
+ handlesError_ = handlesError;
+}
+
+
+
+
+}
+
+
+
+
+
+#endif
diff --git a/languages/cpp/debugger/gdbcontroller.cpp b/languages/cpp/debugger/gdbcontroller.cpp
new file mode 100644
index 00000000..05954069
--- /dev/null
+++ b/languages/cpp/debugger/gdbcontroller.cpp
@@ -0,0 +1,1860 @@
+// *************************************************************************
+// gdbcontroller.cpp - description
+// -------------------
+// begin : Sun Aug 8 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * This program is free software; you can redistribute it and/or modify *
+// * it under the terms of the GNU General Public License as published by *
+// * the Free Software Foundation; either version 2 of the License, or *
+// * (at your option) any later version. *
+// * *
+// **************************************************************************
+
+#include "gdbcontroller.h"
+
+#include "breakpoint.h"
+#include "gdbcommand.h"
+#include "stty.h"
+#include "domutil.h"
+#include "settings.h"
+#include "mi/miparser.h"
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kwin.h>
+
+#include <qdatetime.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+#include <qstring.h>
+#include <qdir.h>
+#include <qvaluevector.h>
+#include <qeventloop.h>
+
+#include <iostream>
+#include <ctype.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <typeinfo>
+using namespace std;
+
+// **************************************************************************
+//
+// Does all the communication between gdb and the kdevelop's debugger code.
+// Significatant classes being used here are
+//
+// GDBParser - parses the "variable" data using the vartree and varitems
+// VarTree - where the variable data will end up
+// FrameStack - tracks the program frames and allows the user to switch between
+// and therefore view the calling funtions and their data
+// Breakpoint - Where and what to do with breakpoints.
+// STTY - the tty that the _application_ will run on.
+//
+// Significant variables
+// state_ - be very careful setting this. The controller is totally
+// dependent on this reflecting the correct state. For instance,
+// if the app is busy but we don't think so, then we lose control
+// of the app. The only way to get out of these situations is to
+// delete (stop) the controller.
+// currentFrame_
+// - Holds the frame number where and locals/variable information will
+// go to
+//
+// Certain commands need to be "wrapped", so that the output gdb produces is
+// of the form "\032data_id gdb output \032data_id"
+// Then a very simple parse can extract this gdb output and hand it off
+// to its' respective parser.
+// To do this we set the prompt to be \032data_id before the command and then
+// reset to \032i to indicate the "idle".
+//
+// Note that the following does not work because in certain situations
+// gdb can get an error in performing the command and therefore will not
+// output the final echo. Hence the data will be thrown away.
+// (certain "info locals" will generate this error.
+//
+// queueCmd(new GDBCommand(QString().sprintf("define printlocal\n"
+// "echo \32%c\ninfo locals\necho \32%c\n"
+// "end",
+// LOCALS, LOCALS)));
+// (although replacing echo with "set prompt" appropriately could work Hmmmm.)
+//
+// Shared libraries and breakpoints
+// ================================
+// Shared libraries and breakpoints have a problem that has a reasonable solution.
+// The problem is that gdb will not accept breakpoints in source that is in a
+// shared library that has _not_ _yet_ been opened but will be opened via a
+// dlopen.
+//
+// The solution is to get gdb to tell us when a shared library has been opened.
+// This means that when the user sets a breakpoint, we flag this breakpoint as
+// pending, try to set the breakpoint and if gdb says it succeeded then flag it
+// as active. If gdb is not successful then we leave the breakpoint as pending.
+//
+// This is known as "lazy breakpoints"
+//
+// If the user has selected a file that is really outside the program and tried to
+// set a breakpoint then this breakpoint will always be pending. I can't do
+// anything about that, because it _might_ be in a shared library. If not they
+// are either fools or just misguided...
+//
+// Now that the breakpoint is pending, we need gdb to tell us when a shared
+// library has been loaded. We use "set stop-on 1". This breaks on _any_
+// library event, and we just try to set the pending breakpoints. Once we're
+// done, we then "continue"
+//
+// Now here's the problem with all this. If the user "step"s over code that
+// contains a library dlopen then it'll just keep running, because we receive a
+// break and hence end up doing a continue. In this situation, I do _not_
+// do a continue but leave it stopped with the status line reflecting the
+// stopped state. The frame stack is in the dl routine that caused the stop.
+//
+// There isn't any way around this, but I could allievate the problem somewhat
+// by only doing a "set stop-on 1" when we have pending breakpoints.
+//
+// **************************************************************************
+
+namespace GDBDebugger
+{
+
+// This is here so we can check for startup /shutdown problems
+int debug_controllerExists = false;
+
+
+GDBController::GDBController(QDomDocument &projectDom)
+ : DbgController(),
+ currentFrame_(0),
+ viewedThread_(-1),
+ holdingZone_(),
+ currentCmd_(0),
+ tty_(0),
+ badCore_(QString()),
+ state_(s_dbgNotStarted|s_appNotStarted),
+ programHasExited_(false),
+ dom(projectDom),
+ config_breakOnLoadingLibrary_(true),
+ config_forceBPSet_(true),
+ config_displayStaticMembers_(false),
+ config_asmDemangle_(true),
+ config_dbgTerminal_(false),
+ config_gdbPath_(),
+ config_outputRadix_(10),
+ state_reload_needed(false),
+ stateReloadInProgress_(false)
+{
+ configure();
+ cmdList_.setAutoDelete(true);
+
+ Q_ASSERT(! debug_controllerExists);
+ debug_controllerExists = true;
+}
+
+// **************************************************************************
+
+// Deleting the controller involves shutting down gdb nicely.
+// When were attached to a process, we must first detach so that the process
+// can continue running as it was before being attached. gdb is quite slow to
+// detach from a process, so we must process events within here to get a "clean"
+// shutdown.
+GDBController::~GDBController()
+{
+ debug_controllerExists = false;
+}
+
+// **************************************************************************
+
+void GDBController::configure()
+{
+ // A a configure.gdb script will prevent these from uncontrolled growth...
+ config_configGdbScript_ = DomUtil::readEntry(dom, "/kdevdebugger/general/configGdbScript").latin1();
+ config_runShellScript_ = DomUtil::readEntry(dom, "/kdevdebugger/general/runShellScript").latin1();
+ config_runGdbScript_ = DomUtil::readEntry(dom, "/kdevdebugger/general/runGdbScript").latin1();
+
+// add macros for reading QStrings? or in configGdbScript?
+ config_forceBPSet_ = DomUtil::readBoolEntry(dom, "/kdevdebugger/general/allowforcedbpset", true);
+ config_dbgTerminal_ = DomUtil::readBoolEntry(dom, "/kdevdebugger/general/separatetty", false);
+ config_gdbPath_ = DomUtil::readEntry(dom, "/kdevdebugger/general/gdbpath");
+
+ bool old_displayStatic = config_displayStaticMembers_;
+ config_displayStaticMembers_ = DomUtil::readBoolEntry(dom, "/kdevdebugger/display/staticmembers",false);
+
+ bool old_asmDemangle = config_asmDemangle_;
+ config_asmDemangle_ = DomUtil::readBoolEntry(dom, "/kdevdebugger/display/demanglenames",true);
+
+ bool old_breakOnLoadingLibrary_ = config_breakOnLoadingLibrary_;
+ config_breakOnLoadingLibrary_ = DomUtil::readBoolEntry(dom, "/kdevdebugger/general/breakonloadinglibs",true);
+
+ // FIXME: should move this into debugger part or variable widget.
+ int old_outputRadix = config_outputRadix_;
+#if 0
+ config_outputRadix_ = DomUtil::readIntEntry(dom, "/kdevdebugger/display/outputradix", 10);
+ varTree_->setRadix(config_outputRadix_);
+#endif
+
+
+ if (( old_displayStatic != config_displayStaticMembers_ ||
+ old_asmDemangle != config_asmDemangle_ ||
+ old_breakOnLoadingLibrary_ != config_breakOnLoadingLibrary_ ||
+ old_outputRadix != config_outputRadix_) &&
+ dbgProcess_)
+ {
+ bool restart = false;
+ if (stateIsOn(s_dbgBusy))
+ {
+ pauseApp();
+ restart = true;
+ }
+
+ if (old_displayStatic != config_displayStaticMembers_)
+ {
+ if (config_displayStaticMembers_)
+ queueCmd(new GDBCommand("set print static-members on"));
+ else
+ queueCmd(new GDBCommand("set print static-members off"));
+ }
+ if (old_asmDemangle != config_asmDemangle_)
+ {
+ if (config_asmDemangle_)
+ queueCmd(new GDBCommand("set print asm-demangle on"));
+ else
+ queueCmd(new GDBCommand("set print asm-demangle off"));
+ }
+
+ // Disabled for MI port.
+ if (old_outputRadix != config_outputRadix_)
+ {
+ queueCmd(new GDBCommand(QCString().sprintf("set output-radix %d",
+ config_outputRadix_)));
+
+ // FIXME: should do this in variable widget anyway.
+ // After changing output radix, need to refresh variables view.
+ raiseEvent(program_state_changed);
+
+ }
+
+ if (!config_configGdbScript_.isEmpty())
+ queueCmd(new GDBCommand("source " + config_configGdbScript_));
+
+ if (restart)
+ queueCmd(new GDBCommand("-exec-continue"));
+ }
+}
+
+// **************************************************************************
+
+void GDBController::addCommand(GDBCommand* cmd)
+{
+ queueCmd(cmd);
+}
+
+void GDBController::addCommand(const QString& str)
+{
+ queueCmd(new GDBCommand(str));
+}
+
+void GDBController::addCommandToFront(GDBCommand* cmd)
+{
+ queueCmd(cmd, queue_at_front);
+}
+
+void GDBController::addCommandBeforeRun(GDBCommand* cmd)
+{
+ queueCmd(cmd, queue_before_run);
+}
+
+int GDBController::currentThread() const
+{
+ return viewedThread_;
+}
+
+int GDBController::currentFrame() const
+{
+ return currentFrame_;
+}
+
+// Fairly obvious that we'll add whatever command you give me to a queue
+// If you tell me to, I'll put it at the head of the queue so it'll run ASAP
+// Not quite so obvious though is that if we are going to run again. then any
+// information requests become redundent and must be removed.
+// We also try and run whatever command happens to be at the head of
+// the queue.
+void GDBController::queueCmd(GDBCommand *cmd, enum queue_where queue_where)
+{
+ if (stateIsOn(s_dbgNotStarted))
+ {
+ KMessageBox::information(
+ 0,
+ i18n("<b>Gdb command sent when debugger is not running</b><br>"
+ "The command was:<br> %1").arg(cmd->initialString()),
+ i18n("Internal error"), "gdb_error");
+ return;
+ }
+
+ if (stateReloadInProgress_)
+ stateReloadingCommands_.insert(cmd);
+
+ if (queue_where == queue_at_front)
+ cmdList_.insert(0, cmd);
+ else if (queue_where == queue_at_end)
+ cmdList_.append (cmd);
+ else if (queue_where == queue_before_run)
+ {
+ unsigned i;
+ for (i = 0; i < cmdList_.count(); ++i)
+ if (cmdList_.at(i)->isRun())
+ break;
+
+ cmdList_.insert(i, cmd);
+ }
+
+ kdDebug(9012) << "QUEUE: " << cmd->initialString()
+ << (stateReloadInProgress_ ? " (state reloading)\n" : "\n");
+
+ setStateOn(s_dbgBusy);
+ emit dbgStatus("", state_);
+ raiseEvent(debugger_busy);
+
+ executeCmd();
+}
+
+// **************************************************************************
+
+// If the appliction can accept a command and we've got one waiting
+// then send it.
+// Commands can be just request for data (or change gdbs state in someway)
+// or they can be "run" commands. If a command is sent to gdb our internal
+// state will get updated.
+void GDBController::executeCmd()
+{
+ if (stateIsOn(s_dbgNotStarted|s_waitForWrite|s_shuttingDown) || !dbgProcess_)
+ {
+ return;
+ }
+
+ if (!currentCmd_)
+ {
+ if (cmdList_.isEmpty())
+ return;
+
+ currentCmd_ = cmdList_.take(0);
+ }
+ else
+ {
+ return;
+ }
+
+ QString commandText = currentCmd_->cmdToSend();
+ bool bad_command = false;
+ QString message;
+
+ unsigned length = commandText.length();
+ // No i18n for message since it's mainly for debugging.
+ if (length == 0)
+ {
+ // The command might decide it's no longer necessary to send
+ // it.
+ if (SentinelCommand* sc = dynamic_cast<SentinelCommand*>(currentCmd_))
+ {
+ kdDebug(9012) << "SEND: sentinel command, not sending\n";
+ sc->invokeHandler();
+ }
+ else
+ {
+ kdDebug(9012) << "SEND: command " << currentCmd_->initialString()
+ << " changed its mind, not sending\n";
+ }
+
+ destroyCurrentCommand();
+ executeCmd();
+ commandDone();
+ return;
+ }
+ else
+ {
+ if (commandText[length-1] != '\n')
+ {
+ bad_command = true;
+ message = "Debugger command does not end with newline";
+ }
+ }
+ if (bad_command)
+ {
+ KMessageBox::information(0, i18n("<b>Invalid debugger command</b><br>")
+ + message,
+ i18n("Invalid debugger command"), "gdb_error");
+ return;
+ }
+
+ kdDebug(9012) << "SEND: " << commandText;
+
+ dbgProcess_->writeStdin(commandText.local8Bit(),
+ commandText.length());
+ setStateOn(s_waitForWrite);
+
+ QString prettyCmd = currentCmd_->cmdToSend();
+ prettyCmd.replace( QRegExp("set prompt \032.\n"), "" );
+ prettyCmd = "(gdb) " + prettyCmd;
+
+ if (currentCmd_->isUserCommand())
+ emit gdbUserCommandStdout( prettyCmd.latin1() );
+ else
+ emit gdbInternalCommandStdout( prettyCmd.latin1() );
+
+ emit dbgStatus ("", state_);
+}
+
+// **************************************************************************
+
+void GDBController::destroyCmds()
+{
+ if (currentCmd_)
+ {
+ destroyCurrentCommand();
+ }
+
+ while (!cmdList_.isEmpty())
+ delete cmdList_.take(0);
+}
+
+// Pausing an app removes any pending run commands so that the app doesn't
+// start again. If we want to be silent then we remove any pending info
+// commands as well.
+void GDBController::pauseApp()
+{
+ setStateOn(s_explicitBreakInto);
+
+ /* FIXME: need to decide if we really
+ need this, and the consistenly mark
+ info commands as such.
+ int i = cmdList_.count();
+ while (i)
+ {
+ i--;
+ DbgCommand *cmd = cmdList_.at(i);
+ if (cmd->isAnInfoCmd())
+ delete cmdList_.take(i);
+ }
+ */
+
+ if (dbgProcess_)
+ dbgProcess_->kill(SIGINT);
+}
+
+void GDBController::actOnProgramPauseMI(const GDBMI::ResultRecord& r)
+{
+ // Is this stop on shared library load? Gdb smartly does not
+ // print any 'reason' field in this case.
+ bool shared_library_load = false;
+ if (currentCmd_)
+ {
+ const QValueVector<QString>& lines = currentCmd_->allStreamOutput();
+ for(unsigned int i = 0; i < lines.count(); ++i)
+ {
+ if (lines[i].startsWith("Stopped due to shared library event"))
+ {
+ shared_library_load = true;
+ break;
+ }
+ }
+ }
+
+ if (shared_library_load)
+ {
+ raiseEvent(shared_library_loaded);
+ queueCmd(new GDBCommand("-exec-continue"));
+ return;
+ }
+
+ if (!r.hasField("reason"))
+ {
+ // FIXME: throw an exception, and add the gdb reply in the
+ // caller. Show message box in the caller, not here.
+ // FIXME: remove this 'bla-bla-bla'.
+ KMessageBox::detailedSorry(
+ 0,
+ i18n("<b>Invalid gdb reply</b>"
+ "<p>The 'stopped' packet does not include the 'reason' field'."),
+ i18n("The gdb reply is: bla-bla-bla"),
+ i18n("Invalid gdb reply"));
+ return;
+ }
+
+ QString reason = r["reason"].literal();
+ if (reason == "exited-normally" || reason == "exited")
+ {
+ programNoApp("Exited normally", false);
+ programHasExited_ = true;
+ state_reload_needed = false;
+ return;
+ }
+
+ if (reason == "exited-signalled")
+ {
+ programNoApp(i18n("Exited on signal %1")
+ .arg(r["signal-name"].literal()), false);
+ // FIXME: figure out why this variable is needed.
+ programHasExited_ = true;
+ state_reload_needed = false;
+ return;
+ }
+
+ if (reason == "watchpoint-scope")
+ {
+ QString number = r["wpnum"].literal();
+
+ // FIXME: shuld remove this watchpoint
+ // But first, we should consider if removing all
+ // watchpoinst on program exit is the right thing to
+ // do.
+
+ queueCmd(new GDBCommand("-exec-continue"));
+
+ state_reload_needed = false;
+ return;
+ }
+
+ if (reason == "signal-received")
+ {
+ QString name = r["signal-name"].literal();
+ QString user_name = r["signal-meaning"].literal();
+
+ // SIGINT is a "break into running program".
+ // We do this when the user set/mod/clears a breakpoint but the
+ // application is running.
+ // And the user does this to stop the program also.
+ bool suppress_reporting = false;
+ if (name == "SIGINT" && stateIsOn(s_explicitBreakInto))
+ {
+ suppress_reporting = true;
+ // TODO: check that we do something reasonable on
+ // implicit break into program (for setting breakpoints,
+ // or whatever).
+
+ setStateOff(s_explicitBreakInto);
+ emit dbgStatus("Application interrupted", state_);
+ // Will show the source line in the code
+ // handling non-special stop kinds, below.
+ }
+
+ if (!suppress_reporting)
+ {
+ // Whenever we have a signal raised then tell the user, but don't
+ // end the program as we want to allow the user to look at why the
+ // program has a signal that's caused the prog to stop.
+ // Continuing from SIG FPE/SEGV will cause a "Cannot ..." and
+ // that'll end the program.
+ KMessageBox::information(0,
+ i18n("Program received signal %1 (%2)")
+ .arg(name).arg(user_name),
+ i18n("Received signal"));
+ }
+ }
+
+ if (reason == "breakpoint-hit")
+ {
+ int id = r["bkptno"].literal().toInt();
+ emit breakpointHit(id);
+ }
+
+
+}
+
+
+void GDBController::reloadProgramState()
+{
+ const GDBMI::ResultRecord& r = *last_stop_result;
+
+ // In gdb 6.3, the *stopped reply does not include full
+ // name of the source file. Need to send extra command.
+ // Don't send it unless there was 'line' field in last *stopped response.
+ // The command has a bug that makes it always returns some file/line,
+ // even if we're not in one.
+ //
+ // FIXME: For gdb 6.4, should not send extra commands.
+ // That's for later, so that I verify that this three-command
+ // approach works fine.
+ if (r.hasField("frame") && r["frame"].hasField("line"))
+ queueCmd(new GDBCommand(
+ "-file-list-exec-source-file",
+ this,
+ &GDBController::handleMiFileListExecSourceFile));
+ else
+ {
+ maybeAnnounceWatchpointHit();
+ }
+
+ emit dbgStatus ("", state_);
+
+ // We're always at frame zero when the program stops
+ // and we must reset the active flag
+ if (r.hasField("thread-id"))
+ viewedThread_ = r["thread-id"].literal().toInt();
+ else
+ viewedThread_ = -1;
+ currentFrame_ = 0;
+
+ raiseEvent(program_state_changed);
+ state_reload_needed = false;
+}
+
+
+// **************************************************************************
+
+// There is no app anymore. This can be caused by program exiting
+// an invalid program specified or ...
+// gdb is still running though, but only the run command (may) make sense
+// all other commands are disabled.
+void GDBController::programNoApp(const QString &msg, bool msgBox)
+{
+ setState(s_appNotStarted|s_programExited|(state_&s_shuttingDown));
+
+ destroyCmds();
+
+ // We're always at frame zero when the program stops
+ // and we must reset the active flag
+ viewedThread_ = -1;
+ currentFrame_ = 0;
+
+ // The application has existed, but it's possible that
+ // some of application output is still in the pipe. We use
+ // different pipes to communicate with gdb and to get application
+ // output, so "exited" message from gdb might have arrived before
+ // last application output. Get this last bit.
+
+ // Note: this method can be called when we open an invalid
+ // core file. In that case, tty_ won't be set.
+ if (tty_)
+ tty_->readRemaining();
+
+ // Tty is no longer usable, delete it. Without this, QSocketNotifier
+ // will continiously bomd STTY with signals, so we need to either disable
+ // QSocketNotifier, or delete STTY. The latter is simpler, since we can't
+ // reuse it for future debug sessions anyway.
+
+ delete tty_;
+ tty_ = 0;
+
+ raiseEvent(program_exited);
+
+ if (msgBox)
+ KMessageBox::information(0, i18n("gdb message:\n")+msg,"Warning", "gdb_error");
+
+ emit dbgStatus (msg, state_);
+ /* Also show message in gdb window, so that users who
+ prefer to look at gdb window know what's up. */
+ emit gdbUserCommandStdout(msg.ascii());
+}
+
+void GDBController::parseCliLine(const QString& line)
+{
+ if (line.startsWith("The program no longer exists")
+ || line.startsWith("Program exited")
+ || line.startsWith("Program terminated"))
+ {
+ programNoApp(line, false);
+ return;
+ }
+
+#if 0
+ if (strncmp(buf, "No symbol", 9) == 0 || // watch point failed
+ strncmp(buf, "Single", 6) == 0 || // Single stepping
+ strncmp(buf, "No source file named", 20) == 0 || // breakpoint not set
+ strncmp(buf, "[Switching to Thread", 20) == 0 || //
+ strncmp(buf, "[Thread debugging using", 23) == 0 ||
+ strncmp(buf, "Current language:", 17) == 0 ||
+ strncmp(buf, "Error while mapping shared library sections:", 44) == 0 ||
+ strncmp(buf, "Error while reading shared library symbols:", 43) == 0 ||
+ *buf == ':' )
+ {
+ // We don't change state, because this falls out when a run command
+ // starts rather than when a run command stops.
+ // Or.... it falls out with other messages that _are_ handled.
+ return;
+ }
+#endif
+
+#if 0
+
+ /// @todo - Only do this at start up
+ if (
+ strstr(buf, "not in executable format:") ||
+ strstr(buf, "No such file or directory.") || // does this fall out?
+ strstr(buf, i18n("No such file or directory.").local8Bit())|| // from system via gdb
+ strstr(buf, "is not a core dump:") ||
+ strncmp(buf, "ptrace: No such process.", 24)==0 ||
+ strncmp(buf, "ptrace: Operation not permitted.", 32)==0 ||
+ strncmp(buf, "No executable file specified.", 29)==0)
+ {
+ programNoApp(QString(buf), true);
+ kdDebug(9012) << "Bad file <" << buf << ">" << endl;
+ return;
+ }
+#endif
+}
+
+void GDBController::handleMiFileListExecSourceFile(const GDBMI::ResultRecord& r)
+{
+ if (r.reason != "done")
+ {
+ return;
+
+ // FIXME: throw an exception here. Move reporting
+ // to the caller, who knows the gdb output.
+#if 0
+ KMessageBox::information(
+ 0,
+ i18n("Invalid gdb reply\n"
+ "Command was: %1\n"
+ "Response is: %2\n"
+ "Invalid response kind: \"%3\"")
+ .arg(currentCmd_->rawDbgCommand())
+ .arg(buf)
+ .arg(r.reason),
+ i18n("Invalid gdb reply"), "gdb_error");
+#endif
+ }
+
+ QString fullname = "";
+ if (r.hasField("fullname"))
+ fullname = r["fullname"].literal();
+
+ showStepInSource(fullname,
+ r["line"].literal().toInt(),
+ (*last_stop_result)["frame"]["addr"].literal());
+
+ /* Watchpoint hit is announced only after we've highlighted
+ the current line. */
+ maybeAnnounceWatchpointHit();
+
+ last_stop_result.reset();
+}
+
+void GDBController::maybeAnnounceWatchpointHit()
+{
+ /* For some cases, for example catchpoints,
+ gdb does not report any reason at all. */
+ if ((*last_stop_result).hasField("reason"))
+ {
+ QString last_stop_reason = (*last_stop_result)["reason"].literal();
+
+ if (last_stop_reason == "watchpoint-trigger")
+ {
+ emit watchpointHit((*last_stop_result)["wpt"]["number"]
+ .literal().toInt(),
+ (*last_stop_result)["value"]["old"].literal(),
+ (*last_stop_result)["value"]["new"].literal());
+ }
+ else if (last_stop_reason == "read-watchpoint-trigger")
+ {
+ emit dbgStatus ("Read watchpoint triggered", state_);
+ }
+ }
+}
+
+void GDBController::handleMiFrameSwitch(const GDBMI::ResultRecord& r)
+{
+ raiseEvent(thread_or_frame_changed);
+
+ const GDBMI::Value& frame = r["frame"];
+
+ QString file;
+ if (frame.hasField("fullname"))
+ file = frame["fullname"].literal();
+ else if (frame.hasField("file"))
+ file = frame["file"].literal();
+
+ int line = -1;
+ if (frame.hasField("line"))
+ line = frame["line"].literal().toInt();
+
+ showStepInSource(file,
+ line,
+ frame["addr"].literal());
+}
+
+// **************************************************************************
+// SLOTS
+// *****
+// For most of these slots data can only be sent to gdb when it
+// isn't busy and it is running.
+
+// **************************************************************************
+
+bool GDBController::start(const QString& shell, const DomUtil::PairList& run_envvars, const QString& run_directory, const QString &application, const QString& run_arguments)
+{
+ kdDebug(9012) << "Starting debugger controller\n";
+ badCore_ = QString();
+
+ Q_ASSERT (!dbgProcess_ && !tty_);
+
+ dbgProcess_ = new KProcess;
+
+ connect( dbgProcess_, SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, SLOT(slotDbgStdout(KProcess *, char *, int)) );
+
+ connect( dbgProcess_, SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, SLOT(slotDbgStderr(KProcess *, char *, int)) );
+
+ connect( dbgProcess_, SIGNAL(wroteStdin(KProcess *)),
+ this, SLOT(slotDbgWroteStdin(KProcess *)) );
+
+ connect( dbgProcess_, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotDbgProcessExited(KProcess*)) );
+
+ application_ = application;
+
+ QString gdb = "gdb";
+ // Prepend path to gdb, if needed. Using QDir,
+ // path can either end with slash, or not.
+ if (!config_gdbPath_.isEmpty())
+ {
+ gdb = config_gdbPath_;
+ }
+
+ if (!shell.isEmpty())
+ {
+ *dbgProcess_ << "/bin/sh" << "-c" << shell + " " + gdb +
+ + " " + application + " --interpreter=mi2 -quiet";
+ emit gdbUserCommandStdout(
+ QString( "/bin/sh -c " + shell + " " + gdb
+ + " " + application
+ + " --interpreter=mi2 -quiet\n" ).latin1());
+ }
+ else
+ {
+ *dbgProcess_ << gdb << application
+ << "-interpreter=mi2" << "-quiet";
+ emit gdbUserCommandStdout(
+ QString( gdb + " " + application +
+ " --interpreter=mi2 -quiet\n" ).latin1());
+ }
+
+ if (!dbgProcess_->start( KProcess::NotifyOnExit,
+ KProcess::Communication(KProcess::All)))
+ {
+ KMessageBox::information(
+ 0,
+ i18n("<b>Could not start debugger.</b>"
+ "<p>Could not run '%1'. "
+ "Make sure that the path name is specified correctly."
+ ).arg(dbgProcess_->args()[0]),
+ i18n("Could not start debugger"), "gdb_error");
+
+ return false;
+ }
+
+ setStateOff(s_dbgNotStarted);
+ emit dbgStatus ("", state_);
+
+ saw_gdb_prompt_ = false;
+
+ // Initialise gdb. At this stage gdb is sitting wondering what to do,
+ // and to whom. Organise a few things, then set up the tty for the application,
+ // and the application itself
+
+ // The following two are not necessary in MI, and the first one
+ // just breaks MI completely.
+ // queueCmd(new GDBCommand("set edit off", NOTRUNCMD, NOTINFOCMD, 0));
+ // queueCmd(new GDBCommand("set confirm off", NOTRUNCMD, NOTINFOCMD));
+
+ if (config_displayStaticMembers_)
+ queueCmd(new GDBCommand("set print static-members on"));
+ else
+ queueCmd(new GDBCommand("set print static-members off"));
+
+ // This makes gdb pump a variable out on one line.
+ queueCmd(new GDBCommand("set width 0"));
+ queueCmd(new GDBCommand("set height 0"));
+
+ queueCmd(new GDBCommand("handle SIG32 pass nostop noprint"));
+ queueCmd(new GDBCommand("handle SIG41 pass nostop noprint"));
+ queueCmd(new GDBCommand("handle SIG42 pass nostop noprint"));
+ queueCmd(new GDBCommand("handle SIG43 pass nostop noprint"));
+
+ // Print some nicer names in disassembly output. Although for an assembler
+ // person this may actually be wrong and the mangled name could be better.
+ if (config_asmDemangle_)
+ queueCmd(new GDBCommand("set print asm-demangle on"));
+ else
+ queueCmd(new GDBCommand("set print asm-demangle off"));
+
+ // make sure output radix is always set to users view.
+ queueCmd(new GDBCommand(QCString().sprintf("set output-radix %d", config_outputRadix_)));
+
+ // Change the "Working directory" to the correct one
+ QCString tmp( "cd " + QFile::encodeName( run_directory ));
+ queueCmd(new GDBCommand(tmp));
+
+ // Set the run arguments
+ if (!run_arguments.isEmpty())
+ queueCmd(
+ new GDBCommand(QCString("set args ") + run_arguments.local8Bit()));
+
+ // Get the run environment variables pairs into the environstr string
+ // in the form of: "ENV_VARIABLE=ENV_VALUE" and send to gdb using the
+ // "set enviroment" command
+ // Note that we quote the variable value due to the possibility of
+ // embedded spaces
+ QString environstr;
+ DomUtil::PairList::ConstIterator it;
+ for (it = run_envvars.begin(); it != run_envvars.end(); ++it)
+ {
+ environstr = "set environment ";
+ environstr += (*it).first;
+ environstr += "=";
+ environstr += (*it).second;
+ queueCmd(new GDBCommand(environstr.latin1()));
+ }
+
+ queueCmd(new GDBCommand(
+ "-list-features", this,
+ &GDBController::handleListFeatures, true /* handles error */));
+
+
+ queueCmd(new SentinelCommand(this, &GDBController::startDone));
+
+ // Now gdb has been started and the application has been loaded,
+ // BUT the app hasn't been started yet! A run command is about to be issued
+ // by whoever is controlling us. Or we might be asked to load a core, or
+ // attach to a running process.
+
+ return true;
+}
+
+void GDBController::startDone()
+{
+ // Needed so that breakpoint widget has a chance to insert breakpoints.
+ // FIXME: a bit hacky, as we're really not ready for new commands.
+ setStateOn(s_dbgBusy);
+ raiseEvent(debugger_ready);
+ raiseEvent(connected_to_program);
+}
+
+void GDBController::handleListFeatures(const GDBMI::ResultRecord& r)
+{
+ mi_pending_breakpoints_ = false;
+ if (r.reason == "done")
+ {
+ const GDBMI::Value& features = r["features"];
+ for (unsigned i = 0; i < features.size(); ++i)
+ if (features[i].literal() == "pending-breakpoints")
+ {
+ mi_pending_breakpoints_ = true;
+ }
+ }
+
+ if (!mi_pending_breakpoints_)
+ {
+ // This version of GDB does not support pending breakpoints in MI,
+ // so use a workaround.
+ // The below command makes GDB notify us about shared library
+ // events, and on each stop we'll try to set breakpoint again.
+ addCommandToFront(new GDBCommand("set stop-on-solib-events 1"));
+ }
+}
+// **************************************************************************
+
+void GDBController::slotStopDebugger()
+{
+ kdDebug(9012) << "GDBController::slotStopDebugger() called" << endl;
+ if (stateIsOn(s_shuttingDown) || !dbgProcess_)
+ return;
+
+ setStateOn(s_shuttingDown);
+ kdDebug(9012) << "GDBController::slotStopDebugger() executing" << endl;
+
+ QTime start;
+ QTime now;
+
+ // Get gdb's attention if it's busy. We need gdb to be at the
+ // command line so we can stop it.
+ if (stateIsOn(s_dbgBusy))
+ {
+ kdDebug(9012) << "gdb busy on shutdown - stopping gdb (SIGINT)" << endl;
+ dbgProcess_->kill(SIGINT);
+ start = QTime::currentTime();
+ while (-1)
+ {
+ kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput, 20 );
+ now = QTime::currentTime();
+ if (!stateIsOn(s_dbgBusy) || start.msecsTo( now ) > 2000)
+ break;
+ }
+ }
+
+ // If the app is attached then we release it here. This doesn't stop
+ // the app running.
+ if (stateIsOn(s_attached))
+ {
+ const char *detach="detach\n";
+ if (!dbgProcess_->writeStdin(detach, strlen(detach)))
+ kdDebug(9012) << "failed to write 'detach' to gdb" << endl;
+ emit gdbUserCommandStdout("(gdb) detach\n");
+ start = QTime::currentTime();
+ while (-1)
+ {
+ kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput, 20 );
+ now = QTime::currentTime();
+ if (!stateIsOn(s_attached) || start.msecsTo( now ) > 2000)
+ break;
+ }
+ }
+
+ // Now try to stop gdb running.
+ const char *quit="quit\n";
+ if (!dbgProcess_->writeStdin(quit, strlen(quit)))
+ kdDebug(9012) << "failed to write 'quit' to gdb" << endl;
+
+ emit gdbUserCommandStdout("(gdb) quit");
+ start = QTime::currentTime();
+ while (-1)
+ {
+ kapp->eventLoop()->processEvents( QEventLoop::ExcludeUserInput, 20 );
+ now = QTime::currentTime();
+ if (stateIsOn(s_programExited) || start.msecsTo( now ) > 2000)
+ break;
+ }
+
+ // We cannot wait forever.
+ if (!stateIsOn(s_programExited))
+ {
+ kdDebug(9012) << "gdb not shutdown - killing" << endl;
+ dbgProcess_->kill(SIGKILL);
+ }
+
+ destroyCmds();
+ delete dbgProcess_; dbgProcess_ = 0;
+ delete tty_; tty_ = 0;
+
+ // The gdb output buffer might contain start marker of some
+ // previously issued command that crashed gdb (so there's no end marker)
+ // If we don't clear this, then after restart, we'll be trying to search
+ // for the end marker of the command issued in previous gdb session,
+ // and never succeed.
+ gdbOutput_ = "";
+
+ setState(s_dbgNotStarted | s_appNotStarted);
+ emit dbgStatus (i18n("Debugger stopped"), state_);
+
+ raiseEvent(debugger_exited);
+}
+
+// **************************************************************************
+
+void GDBController::slotCoreFile(const QString &coreFile)
+{
+ setStateOff(s_programExited|s_appNotStarted);
+ setStateOn(s_core);
+
+ queueCmd(new GDBCommand(QCString("core ") + coreFile.latin1()));
+
+ raiseEvent(connected_to_program);
+ raiseEvent(program_state_changed);
+}
+
+// **************************************************************************
+
+void GDBController::slotAttachTo(int pid)
+{
+ setStateOff(s_appNotStarted|s_programExited);
+ setStateOn(s_attached);
+
+ // Currently, we always start debugger with a name of binary,
+ // we might be connecting to a different binary completely,
+ // so cancel all symbol tables gdb has.
+ // We can't omit application name from gdb invocation
+ // because for libtool binaries, we have no way to guess
+ // real binary name.
+ queueCmd(new GDBCommand(QString("file")));
+
+ // The MI interface does not implements -target-attach yet,
+ // and we don't recognize whatever gibberish 'attach' pours out, so...
+ queueCmd(new GDBCommand(
+ QCString().sprintf("attach %d", pid)));
+
+ raiseEvent(connected_to_program);
+
+ // ...emit a separate MI command to step one instruction more. We'll
+ // notice the '*stopped' response from it and proceed as usual.
+ queueCmd(new GDBCommand("-exec-step-instruction"));
+}
+
+// **************************************************************************
+
+void GDBController::slotRun()
+{
+ if (stateIsOn(s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (stateIsOn(s_appNotStarted)) {
+
+ delete tty_;
+ tty_ = new STTY(config_dbgTerminal_, Settings::terminalEmulatorName( *kapp->config() ));
+ if (!config_dbgTerminal_)
+ {
+ connect( tty_, SIGNAL(OutOutput(const char*)), SIGNAL(ttyStdout(const char*)) );
+ connect( tty_, SIGNAL(ErrOutput(const char*)), SIGNAL(ttyStderr(const char*)) );
+ }
+
+ QString tty(tty_->getSlave());
+ if (tty.isEmpty())
+ {
+ KMessageBox::information(0, i18n("GDB cannot use the tty* or pty* devices.\n"
+ "Check the settings on /dev/tty* and /dev/pty*\n"
+ "As root you may need to \"chmod ug+rw\" tty* and pty* devices "
+ "and/or add the user to the tty group using "
+ "\"usermod -G tty username\"."), "Warning", "gdb_error");
+
+ delete tty_;
+ tty_ = 0;
+ return;
+ }
+
+ queueCmd(new GDBCommand(QCString("tty ")+tty.latin1()));
+
+ if (!config_runShellScript_.isEmpty()) {
+ // Special for remote debug...
+ QCString tty(tty_->getSlave().latin1());
+ QCString options = QCString(">") + tty + QCString(" 2>&1 <") + tty;
+
+ KProcess *proc = new KProcess;
+
+ *proc << "sh" << "-c";
+ *proc << config_runShellScript_ +
+ " " + application_.latin1() + options;
+ proc->start(KProcess::DontCare);
+ }
+
+ if (!config_runGdbScript_.isEmpty()) {// gdb script at run is requested
+
+ // Race notice: wait for the remote gdbserver/executable
+ // - but that might be an issue for this script to handle...
+
+ // Future: the shell script should be able to pass info (like pid)
+ // to the gdb script...
+
+ queueCmd(new GDBCommand("source " + config_runGdbScript_));
+
+ // Note: script could contain "run" or "continue"
+ }
+ else {
+
+ QFileInfo app(application_);
+
+ if (!app.exists())
+ {
+ KMessageBox::error(
+ 0,
+ i18n("<b>Application does not exist</b>"
+ "<p>The application you are trying to debug,<br>"
+ " %1\n"
+ "<br>does not exist. Check that you have specified "
+ "the right application in the debugger configuration."
+ ).arg(app.fileName()),
+ i18n("Application does not exist"));
+
+ // FIXME: after this, KDevelop will still show that debugger
+ // is running, because DebuggerPart::slotStopDebugger won't be
+ // called, and core()->running(this, false) won't be called too.
+ slotStopDebugger();
+ return;
+ }
+ if (!app.isExecutable())
+ {
+ KMessageBox::error(
+ 0,
+ i18n("<b>Could not run application '%1'.</b>"
+ "<p>The application does not have the executable bit set. "
+ "Try rebuilding the project, or change permissions "
+ "manually."
+ ).arg(app.fileName()),
+ i18n("Could not run application"));
+ slotStopDebugger();
+ }
+ else
+ {
+ GDBCommand *cmd = new GDBCommand("-exec-run");
+ cmd->setRun(true);
+ queueCmd(cmd);
+ }
+ }
+ }
+ else {
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-continue"));
+ }
+ setStateOff(s_appNotStarted|s_programExited);
+}
+
+
+void GDBController::slotKill()
+{
+ if (stateIsOn(s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (stateIsOn(s_dbgBusy))
+ {
+ pauseApp();
+ }
+
+ queueCmd(new GDBCommand("kill"));
+
+ setStateOn(s_appNotStarted);
+}
+
+// **************************************************************************
+
+void GDBController::slotRunUntil(const QString &fileName, int lineNum)
+{
+ if (stateIsOn(s_dbgBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ if (fileName.isEmpty())
+ queueCmd(new GDBCommand(
+ QCString().sprintf("-exec-until %d", lineNum)));
+ else
+ queueCmd(new GDBCommand(
+ QCString().
+ sprintf("-exec-until %s:%d", fileName.latin1(), lineNum)));
+}
+
+// **************************************************************************
+
+void GDBController::slotJumpTo(const QString &fileName, int lineNum)
+{
+ if (stateIsOn(s_dbgBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (!fileName.isEmpty()) {
+ queueCmd(new GDBCommand(QCString().sprintf("tbreak %s:%d", fileName.latin1(), lineNum)));
+ queueCmd(new GDBCommand(QCString().sprintf("jump %s:%d", fileName.latin1(), lineNum)));
+ }
+}
+
+// **************************************************************************
+
+void GDBController::slotStepInto()
+{
+ if (stateIsOn(s_dbgBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-step"));
+}
+
+// **************************************************************************
+
+void GDBController::slotStepIntoIns()
+{
+ if (stateIsOn(s_dbgBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-step-instruction"));
+}
+
+// **************************************************************************
+
+void GDBController::slotStepOver()
+{
+ if (stateIsOn(s_dbgBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-next"));
+}
+
+// **************************************************************************
+
+void GDBController::slotStepOverIns()
+{
+ if (stateIsOn(s_dbgBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-next-instruction"));
+}
+
+// **************************************************************************
+
+void GDBController::slotStepOutOff()
+{
+ if (stateIsOn(s_dbgBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ removeStateReloadingCommands();
+
+ queueCmd(new GDBCommand("-exec-finish"));
+}
+
+// **************************************************************************
+
+// Only interrupt a running program.
+void GDBController::slotBreakInto()
+{
+ pauseApp();
+}
+
+// **************************************************************************
+
+void GDBController::selectFrame(int frameNo, int threadNo)
+{
+ // FIXME: this either should be removed completely, or
+ // trigger an error message.
+ if (stateIsOn(s_dbgBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (threadNo != -1)
+ {
+ if (viewedThread_ != threadNo)
+ queueCmd(new GDBCommand(
+ QString("-thread-select %1").arg(threadNo).ascii()));
+ }
+
+ queueCmd(new GDBCommand(
+ QString("-stack-select-frame %1").arg(frameNo).ascii()));
+
+ // Will emit the 'thread_or_frame_changed' event.
+ queueCmd(new GDBCommand("-stack-info-frame",
+ this, &GDBController::handleMiFrameSwitch));
+
+
+ // FIXME: the above commands might not be the first in queue, and
+ // previous commands might using values of 'viewedThread_' or
+ // 'currentFrame_'. Ideally, should change the values only after
+ // response from gdb.
+ viewedThread_ = threadNo;
+ currentFrame_ = frameNo;
+}
+
+// **************************************************************************
+
+void GDBController::defaultErrorHandler(const GDBMI::ResultRecord& result)
+{
+ QString msg = result["msg"].literal();
+
+ if (msg.contains("No such process"))
+ {
+ setState(s_appNotStarted|s_programExited);
+ emit dbgStatus (i18n("Process exited"), state_);
+ raiseEvent(program_exited);
+ return;
+ }
+
+ KMessageBox::information(
+ 0,
+ i18n("<b>Debugger error</b>"
+ "<p>Debugger reported the following error:"
+ "<p><tt>") + result["msg"].literal(),
+ i18n("Debugger error"), "gdb_error");
+
+ // Error most likely means that some change made in GUI
+ // was not communicated to the gdb, so GUI is now not
+ // in sync with gdb. Resync it.
+ //
+ // Another approach is to make each widget reload it content
+ // on errors from commands that it sent, but that's too complex.
+ // Errors are supposed to happen rarely, so full reload on error
+ // is not a big deal. Well, maybe except for memory view, but
+ // it's no auto-reloaded anyway.
+ //
+ // Also, don't reload state on errors appeared during state
+ // reloading!
+ if (stateReloadingCommands_.count(currentCmd_) == 0)
+ raiseEvent(program_state_changed);
+}
+
+void GDBController::processMICommandResponse(const GDBMI::ResultRecord& result)
+{
+ kdDebug(9012) << "MI stop reason " << result.reason << "\n";
+ if (result.reason == "stopped")
+ {
+ actOnProgramPauseMI(result);
+ }
+ else if (result.reason == "done")
+ {
+ // At least in one case, for 'detach', debuger write
+ // command directly, and 'currentCmd_' will be unset.
+ // Checking for currentCmd_ is safer in any case.
+ if (currentCmd_)
+ {
+ // Assume that if this command is part of state reloading,
+ // then any further commands issued in command handler
+ // are part of state reloading as well.
+ if (stateReloadingCommands_.count(currentCmd_))
+ {
+ stateReloadInProgress_ = true;
+ }
+ currentCmd_->invokeHandler(result);
+ stateReloadInProgress_ = false;
+ }
+ }
+ else if (result.reason == "error")
+ {
+ // Some commands want to handle errors themself.
+ if (currentCmd_ && currentCmd_->handlesError() &&
+ currentCmd_->invokeHandler(result))
+ {
+ // Done, nothing more needed
+ }
+ else
+ {
+ defaultErrorHandler(result);
+ }
+ }
+}
+
+// Data from gdb gets processed here.
+void GDBController::slotDbgStdout(KProcess *, char *buf, int buflen)
+{
+ static bool parsing = false;
+
+ QCString msg(buf, buflen+1);
+
+ // Copy the data out of the KProcess buffer before it gets overwritten
+ // Append to the back of the holding zone.
+ holdingZone_ += QCString(buf, buflen+1);
+
+ // Already parsing? then get out quick.
+ // VP, 2006-01-30. I'm not sure how this could happen, since
+ // parsing of gdb reply should not ever execute Qt message loop. Except,
+ // maybe, when we pop up a message box. But even in that case,
+ // it's likely we won't return to slotDbgStdout again.
+ if (parsing)
+ {
+ kdDebug(9012) << "Already parsing" << endl;
+ return;
+ }
+
+ bool ready_for_next_command = false;
+
+ int i;
+ bool got_any_command = false;
+ // For each gdb reply. In MI mode, each reply is one string.
+ while((i = holdingZone_.find('\n')) != -1)
+ {
+ got_any_command = true;
+
+ QCString reply(holdingZone_.left(i));
+ holdingZone_ = holdingZone_.mid(i+1);
+
+ kdDebug(9012) << "REPLY: " << reply << "\n";
+
+ FileSymbol file;
+ file.contents = reply;
+
+ std::auto_ptr<GDBMI::Record> r(mi_parser_.parse(&file));
+
+ if (r.get() == 0)
+ {
+ // FIXME: Issue an error!
+ kdDebug(9012) << "Invalid MI message: " << reply << "\n";
+ ready_for_next_command = true;
+ continue;
+ }
+
+ try {
+
+ switch(r->kind)
+ {
+ case GDBMI::Record::Result: {
+
+ GDBMI::ResultRecord& result = static_cast<GDBMI::ResultRecord&>(*r);
+
+ if (result.reason != "running")
+ {
+ kdDebug(9012) << "Command execution time "
+ << commandExecutionTime.elapsed() << " ms.\n";
+ }
+
+ /* The currentCmd_ may be NULL here, because when detaching
+ from debugger, we directly write "detach" to gdb and
+ busy-wait for a reply. Uisng the commands mechanism
+ won't work there, because command result are
+ communicated asynchronously.
+ This is will be fixed in KDevelop4. */
+ if (currentCmd_ && currentCmd_->isUserCommand())
+ emit gdbUserCommandStdout(reply);
+ else
+ emit gdbInternalCommandStdout(reply + "\n");
+
+ if (result.reason == "stopped")
+ {
+ // Transfers ownership.
+ // Needed so that in
+ // handleMiFileListExecSourceFile(GDBMI::ResultRecord& r);
+ // we can use the last stop reason.
+ last_stop_result.reset(static_cast<GDBMI::ResultRecord*>(r.get()));
+ r.release();
+ state_reload_needed = true;
+ }
+ else if (result.reason == "running")
+ {
+ setStateOn(s_appRunning);
+ raiseEvent(program_running);
+ }
+
+ // All MI commands have just one response, except for
+ // run-like command, which result in
+ //
+ // ^running
+ //
+ // followed by
+ //
+ // stopped.
+
+ ready_for_next_command = (result.reason != "running");
+ if (ready_for_next_command)
+ {
+ // Need to do this before procesing response,
+ // so that when processing response we don't
+ // think that application is running.
+ setStateOff(s_appRunning);
+ }
+
+ processMICommandResponse(result);
+
+
+ if (ready_for_next_command)
+ {
+ destroyCurrentCommand();
+ }
+
+
+ break;
+ }
+
+ case GDBMI::Record::Stream: {
+
+ GDBMI::StreamRecord& s = dynamic_cast<GDBMI::StreamRecord&>(*r);
+ /* The way current code works is that we start gdb,
+ and immediately send commands to it without waiting for
+ a prompt. As result, when we return back to the event
+ loop and read the first line from GDB, currentCmd_ is
+ already set. But really, we want to output everything
+ that gdb prints prior to prompt -- it might be
+ output from user's .gdbinit that user cares about. */
+ if (!saw_gdb_prompt_
+ || !currentCmd_ || currentCmd_->isUserCommand())
+ emit gdbUserCommandStdout(s.message.ascii());
+ else
+ emit gdbInternalCommandStdout(s.message.ascii());
+
+ if (currentCmd_)
+ currentCmd_->newOutput(s.message);
+
+ parseCliLine(s.message);
+
+ static QRegExp print_output("^\\$(\\d+) = ");
+ if (print_output.search(s.message) != -1)
+ {
+ kdDebug(9012) << "Found 'print' output: " << s.message << "\n";
+ print_command_result = s.message.ascii();
+ }
+
+ /* This is output from the program. Route it to
+ the Application window. */
+ if (s.reason == '@')
+ emit ttyStderr(s.message.ascii());
+
+ break;
+ }
+
+
+ case GDBMI::Record::Prompt:
+ saw_gdb_prompt_ = true;
+ break;
+ }
+ }
+ catch(const std::exception& e)
+ {
+ KMessageBox::detailedSorry(
+ 0,
+ i18n("<b>Internal debugger error</b>",
+ "<p>The debugger component encountered an internal error while "
+ "processing a reply from gdb. Please submit a bug report."),
+ i18n("The exception is: %1\n"
+ "The MI response is: %2").arg(e.what()).arg(reply),
+ i18n("Internal debugger error"));
+
+ destroyCurrentCommand();
+ ready_for_next_command = true;
+ }
+ }
+
+ // check the queue for any commands to send
+ if (ready_for_next_command)
+ {
+ executeCmd();
+ }
+
+ if (got_any_command)
+ kdDebug(9012) << "COMMANDS: " << cmdList_.count() << " in queue, "
+ << int(bool(currentCmd_)) << " executing\n";
+
+ commandDone();
+}
+
+void GDBController::commandDone()
+{
+ bool no_more_commands = (cmdList_.isEmpty() && !currentCmd_);
+
+ if (no_more_commands && state_reload_needed)
+ {
+ kdDebug(9012) << "Finishing program stop\n";
+ // Set to false right now, so that if 'actOnProgramPauseMI_part2'
+ // sends some commands, we won't call it again when handling replies
+ // from that commands.
+ state_reload_needed = false;
+ reloadProgramState();
+ }
+
+ if (no_more_commands)
+ {
+ kdDebug(9012) << "No more commands\n";
+ setStateOff(s_dbgBusy);
+ emit dbgStatus("", state_);
+ raiseEvent(debugger_ready);
+ }
+}
+
+void GDBController::destroyCurrentCommand()
+{
+ stateReloadingCommands_.erase(currentCmd_);
+ delete currentCmd_;
+ currentCmd_ = 0;
+}
+
+void GDBController::removeStateReloadingCommands()
+{
+ int i = cmdList_.count();
+ while (i)
+ {
+ i--;
+ GDBCommand* cmd = cmdList_.at(i);
+ if (stateReloadingCommands_.count(cmd))
+ {
+ kdDebug(9012) << "UNQUEUE: " << cmd->initialString() << "\n";
+ delete cmdList_.take(i);
+ }
+ }
+
+ if (stateReloadingCommands_.count(currentCmd_))
+ {
+ // This effectively prevents handler for this command
+ // to be ever invoked.
+ destroyCurrentCommand();
+ }
+}
+
+void GDBController::raiseEvent(event_t e)
+{
+ if (e == program_exited || e == debugger_exited)
+ {
+ stateReloadInProgress_ = false;
+ }
+
+ if (e == program_state_changed)
+ {
+ stateReloadInProgress_ = true;
+ kdDebug(9012) << "State reload in progress\n";
+ }
+
+ emit event(e);
+
+ if (e == program_state_changed)
+ {
+ stateReloadInProgress_ = false;
+ }
+}
+
+
+void GDBController::slotDbgStderr(KProcess *proc, char *buf, int buflen)
+{
+ // At the moment, just drop a message out and redirect
+ kdDebug(9012) << "STDERR: " << QString::fromLatin1(buf, buflen+1) << endl;
+ slotDbgStdout(proc, buf, buflen);
+}
+
+// **************************************************************************
+
+void GDBController::slotDbgWroteStdin(KProcess *)
+{
+ commandExecutionTime.start();
+
+ setStateOff(s_waitForWrite);
+
+ // FIXME: need to remove s_waitForWrite flag completely.
+ executeCmd();
+}
+
+// **************************************************************************
+
+void GDBController::slotDbgProcessExited(KProcess* process)
+{
+ Q_ASSERT(process == dbgProcess_);
+ bool abnormal = !process->normalExit();
+ delete dbgProcess_;
+ dbgProcess_ = 0;
+ delete tty_;
+ tty_ = 0;
+
+ if (abnormal)
+ emit debuggerAbnormalExit();
+
+ raiseEvent(debugger_exited);
+
+ destroyCmds();
+ setState(s_dbgNotStarted|s_appNotStarted|s_programExited);
+ emit dbgStatus (i18n("Process exited"), state_);
+
+ emit gdbUserCommandStdout("(gdb) Process exited\n");
+}
+
+// **************************************************************************
+
+void GDBController::slotUserGDBCmd(const QString& cmd)
+{
+ queueCmd(new UserCommand(cmd.latin1()));
+
+ // User command can theoreticall modify absolutely everything,
+ // so need to force a reload.
+
+ // We can do it right now, and don't wait for user command to finish
+ // since commands used to reload all view will be executed after
+ // user command anyway.
+ //if (!stateIsOn(s_appNotStarted) && !stateIsOn(s_programExited))
+ // raiseEvent(program_state_changed);
+}
+
+void GDBController::explainDebuggerStatus()
+{
+ QString information("%1 commands in queue\n"
+ "%2 commands being processed by gdb\n"
+ "Debugger state: %3\n");
+ information =
+ information.arg(cmdList_.count()).arg(currentCmd_ ? 1 : 0)
+ .arg(state_);
+
+ if (currentCmd_)
+ {
+ QString extra("Current command class: '%1'\n"
+ "Current command text: '%2'\n"
+ "Current command origianl text: '%3'\n");
+
+ extra = extra.arg(
+ typeid(*currentCmd_).name()).arg(currentCmd_->cmdToSend()).
+ arg(currentCmd_->initialString());
+ information += extra;
+ }
+
+ KMessageBox::information(0, information, "Debugger status");
+}
+
+bool GDBController::stateIsOn(int state)
+{
+ return state_ & state;
+}
+
+void GDBController::setStateOn(int stateOn)
+{
+ debugStateChange(state_, state_ | stateOn);
+ state_ |= stateOn;
+}
+
+void GDBController::setStateOff(int stateOff)
+{
+ debugStateChange(state_, state_ & ~stateOff);
+ state_ &= ~stateOff;
+}
+
+void GDBController::setState(int newState)
+{
+ debugStateChange(state_, newState);
+ state_ = newState;
+}
+
+void GDBController::debugStateChange(int oldState, int newState)
+{
+ int delta = oldState ^ newState;
+ if (delta)
+ {
+ QString out = "STATE: ";
+ for(unsigned i = 1; i < s_lastDbgState; i <<= 1)
+ {
+ if (delta & i)
+ {
+ if (i & newState)
+ out += "+";
+ else
+ out += "-";
+
+ bool found = false;
+#define STATE_CHECK(name)\
+ if (i == name) { out += #name; found = true; }
+ STATE_CHECK(s_dbgNotStarted);
+ STATE_CHECK(s_appNotStarted);
+ STATE_CHECK(s_waitForWrite);
+ STATE_CHECK(s_programExited);
+ STATE_CHECK(s_viewBT);
+ STATE_CHECK(s_viewBP);
+ STATE_CHECK(s_attached);
+ STATE_CHECK(s_core);
+ STATE_CHECK(s_waitTimer);
+ STATE_CHECK(s_shuttingDown);
+ STATE_CHECK(s_explicitBreakInto);
+ STATE_CHECK(s_dbgBusy);
+ STATE_CHECK(s_appRunning);
+#undef STATE_CHECK
+
+ if (!found)
+ out += QString::number(i);
+ out += " ";
+
+ }
+ }
+ kdDebug(9012) << out << "\n";
+ }
+}
+
+int GDBController::qtVersion( ) const
+{
+ return DomUtil::readIntEntry( dom, "/kdevcppsupport/qt/version", 3 );
+}
+
+void GDBController::demandAttention() const
+{
+ if ( QWidget * w = kapp->mainWidget() )
+ {
+ KWin::demandAttention( w->winId(), true );
+ }
+}
+
+bool GDBController::miPendingBreakpoints() const
+{
+ return mi_pending_breakpoints_;
+}
+
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+#include "gdbcontroller.moc"
diff --git a/languages/cpp/debugger/gdbcontroller.h b/languages/cpp/debugger/gdbcontroller.h
new file mode 100644
index 00000000..6a9e3385
--- /dev/null
+++ b/languages/cpp/debugger/gdbcontroller.h
@@ -0,0 +1,358 @@
+/***************************************************************************
+ gdbcontroller.h - description
+ -------------------
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GDBCONTROLLER_H_
+#define _GDBCONTROLLER_H_
+
+#include "dbgcontroller.h"
+#include "mi/gdbmi.h"
+#include "mi/miparser.h"
+
+#include <qcstring.h>
+#include <qdom.h>
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qmap.h>
+#include <qdatetime.h>
+
+#include <memory>
+#include <set>
+
+class KProcess;
+
+namespace GDBDebugger
+{
+
+class Breakpoint;
+class DbgCommand;
+class GDBCommand;
+class VarItem;
+class STTY;
+
+/**
+ * A front end implementation to the gdb command line debugger
+ * @author jbb
+ */
+
+class GDBController : public DbgController
+{
+ Q_OBJECT
+
+public:
+ GDBController(QDomDocument &projectDom);
+ ~GDBController();
+
+ enum event_t { program_state_changed = 1, program_exited, debugger_exited,
+ thread_or_frame_changed, debugger_busy, debugger_ready,
+ shared_library_loaded,
+ // Raised when debugger believe that program start running.
+ // Can be used to hide current line indicator.
+ // Don't count on this being raise in all cases where
+ // program is running.
+ program_running,
+ connected_to_program
+ };
+
+
+ /** Adds a command to the end of queue of commands to be executed
+ by gdb. The command will be actually sent to gdb only when
+ replies from all previous commands are received and full processed.
+
+ The literal command sent to gdb is obtained by calling
+ cmd->cmdToSend. The call is made immediately before sending the
+ command, so it's possible to use results of prior commands when
+ computing the exact command to send.
+ */
+ void addCommand(GDBCommand* cmd);
+
+ /** Same as above, but internally constructs new GDBCommand
+ instance from the string. */
+ void addCommand(const QString& cmd);
+
+ /** Adds command to the front of the commands queue. It will be executed
+ next.
+
+ This is usefull to implement 'atomic' command sequences. For example,
+ if one wants to switch to each thread in turn, asking gdb where that
+ thread stand, this should never be interrupted by other command, since
+ other commands might not expect that thread magically changes.
+
+ In this specific case, first -thread-list-ids commands is issued. The
+ handler for reply will add a number of command to front, and it will
+ guarantee that no other command will get in between.
+
+ Note that if you call:
+
+ addCommandToFront(cmd1);
+ addCommandToFront(cmd2);
+
+ The execution order will be 'cmd2', then 'cmd1'.
+
+ FIXME: is not used for now, maybe remove.
+ */
+ void addCommandToFront(GDBCommand* cmd);
+
+ /* If current command queue has any command
+ for which isRun is true, inserts 'cmd'
+ before the first such command. Otherwise,
+ works the same as addCommand. */
+ void addCommandBeforeRun(GDBCommand* cmd);
+
+ /** Selects the specified thread/frame. Immediately emits
+ thread_or_frame_changed event.
+ */
+ void selectFrame(int frameNo, int threadNo);
+
+
+ /** Returns the numerical identfier of the current thread,
+ or -1 if the program is not threaded (i.e. there's just
+ one thread.
+ */
+ int currentThread() const;
+
+ int currentFrame() const;
+
+ bool start(const QString& shell,
+ const DomUtil::PairList& run_envvars,
+ const QString& run_directory,
+ const QString &application,
+ const QString& run_arguments);
+
+ int qtVersion() const;
+
+ /**
+ * Call this when something very interesting happens that the user
+ * might be unaware of. It will make KDevelop's taskbar entry flash
+ * if the application doesn't already have focus.
+ * Typical use case: The debugger has stopped on a breakpoint.
+ */
+ void demandAttention() const;
+
+ void pauseApp();
+
+ bool miPendingBreakpoints() const;
+
+protected:
+ enum queue_where { queue_at_end, queue_at_front, queue_before_run };
+
+ void queueCmd(GDBCommand *cmd, enum queue_where queue_where = queue_at_end);
+
+private:
+ void parseLocals (char type, char *buf);
+ /** Parses the CLI output line, and catches interesting messages
+ like "Program exited". This is intended to allow using console
+ commands in the gdb window despite the fact that GDB does not
+ produce right MI notification for CLI commands. I.e. if you
+ run "continue" there will be no MI message if the application has
+ exited.
+ */
+ void parseCliLine (const QString&);
+
+ /** Handles a result response from a MI command -- that is
+ all MI responses except for Stream and Prompt responses.
+ Uses currentCmd to decide what to do with response and
+ calls appropriate method.
+ */
+ void processMICommandResponse(const GDBMI::ResultRecord& r);
+
+ void handleMiFileListExecSourceFile(const GDBMI::ResultRecord& r);
+
+ /** Handles reply from -stack-info-frame command issues
+ after switching the stack frame.
+ */
+ void handleMiFrameSwitch(const GDBMI::ResultRecord& r);
+
+ void executeCmd ();
+ void destroyCmds();
+ void removeInfoRequests();
+ void actOnProgramPauseMI(const GDBMI::ResultRecord& mi_record);
+ /** Called when there are no pending commands and 'state_reload_needed'
+ is true.
+ Issues commands to completely reload all program state shown
+ to the user.
+ */
+ void reloadProgramState();
+
+ void programNoApp(const QString &msg, bool msgBox);
+
+ void setStateOn(int stateOn);
+ void setStateOff(int stateOff);
+ void setState(int newState);
+
+ void debugStateChange(int oldState, int newState);
+ void commandDone();
+ void destroyCurrentCommand();
+
+ /** Removes all 'stateReloading' commands from the queue.
+ */
+ void removeStateReloadingCommands();
+
+ /** Raises the specified event. Should be used instead of
+ emitting 'event' directly, since this method can perform
+ additional book-keeping for events.
+ */
+ void raiseEvent(event_t e);
+
+ void maybeAnnounceWatchpointHit();
+
+ void handleListFeatures(const GDBMI::ResultRecord& result);
+ void startDone();
+
+ /** Default handler for errors.
+ Tries to guess is the error message is telling that target is
+ gone, if so, informs the user.
+ Otherwise, shows a dialog box and reloads view state. */
+ void defaultErrorHandler(const GDBMI::ResultRecord& result);
+
+public:
+ bool stateIsOn(int state);
+
+public slots:
+ void configure();
+
+
+ //void slotStart(const QString& shell, const QString &application);
+ void slotCoreFile(const QString &coreFile);
+ void slotAttachTo(int pid);
+
+ void slotStopDebugger();
+
+ void slotRun();
+ void slotKill();
+ void slotRunUntil(const QString &filename, int lineNum);
+ void slotJumpTo(const QString &filename, int lineNum);
+ void slotStepInto();
+ void slotStepOver();
+ void slotStepIntoIns();
+ void slotStepOverIns();
+ void slotStepOutOff();
+
+ void slotBreakInto();
+
+ void slotUserGDBCmd(const QString&);
+
+ // Pops up a dialog box with some hopefully
+ // detailed information about which state debugger
+ // is in, which commands were sent and so on.
+ void explainDebuggerStatus();
+
+
+protected slots:
+ void slotDbgStdout(KProcess *proc, char *buf, int buflen);
+ void slotDbgStderr(KProcess *proc, char *buf, int buflen);
+ void slotDbgWroteStdin(KProcess *proc);
+ void slotDbgProcessExited(KProcess *proc);
+
+signals:
+
+ /** This signal is emitted whenever the given event in a program
+ happens. See DESIGN.txt for expected handled of each event.
+
+ NOTE: this signal should never be emitted directly. Instead,
+ use raiseEvent.
+ */
+ void event(GDBController::event_t e);
+
+ void debuggerAbnormalExit();
+
+
+ /** Emitted immediately after breakpoint is hit, before any commands
+ are sent and before current line indicator is shown. */
+ void breakpointHit(int id);
+ /** Emitted for watchpoint hit, after line indicator is shown. */
+ void watchpointHit(int id,
+ const QString& oldValue, const QString& newValue);
+
+private:
+ int currentFrame_;
+ int viewedThread_;
+
+ // The output from gdb that was not parsed yet
+ QCString gdbOutput_;
+ // The output from gdb that arrived where we was
+ // parsing the previous output. To avoid messing
+ // things up, it's not directly added to
+ // gdbOutput_ but stored for future use.
+ // VP: It's not clear why the previous code was doing
+ // this, and holdingZone_ won't be processed until
+ // next output arrives, so probably should be just removed.
+ QCString holdingZone_;
+
+ QPtrList<GDBCommand> cmdList_;
+ GDBCommand* currentCmd_;
+
+ STTY* tty_;
+ QString badCore_;
+ QString application_;
+
+ // Gdb command that should be issued when we stop on breakpoint
+ // with the given gdb breakpoint id.
+ QMap<int, const Breakpoint*> tracedBreakpoints_;
+
+ // Some state variables
+ int state_;
+ bool programHasExited_;
+
+ // Configuration values
+ QDomDocument &dom;
+ bool config_breakOnLoadingLibrary_;
+ bool config_forceBPSet_;
+ bool config_displayStaticMembers_;
+ bool config_asmDemangle_;
+ bool config_dbgTerminal_;
+ QString config_gdbPath_;
+ QString config_dbgShell_;
+ QCString config_configGdbScript_;
+ QCString config_runShellScript_;
+ QCString config_runGdbScript_;
+ int config_outputRadix_;
+
+ MIParser mi_parser_;
+ // As of gdb 6.3, the *stopped packet does not contain
+ // full file name. So we need to send another command to
+ // fetch that, to highlight current line.
+ // After highting current line we need to do something more,
+ // like announcing write watchpoints, and so need to have
+ // access to the stop packet. So store it here.
+ std::auto_ptr<GDBMI::ResultRecord> last_stop_result;
+
+ // Gdb 6.4 (and 6.3) does not support "character" format with MI,
+ // so the only way it can work is via the "print" command. As gdb
+ // outputs things, we'll grep for lines that look like output from
+ // print, and store such lines in this variable, so later use.
+ QCString print_command_result;
+
+ bool state_reload_needed;
+
+ QTime commandExecutionTime;
+
+ bool stateReloadInProgress_;
+
+ /** Commands issues as result of the 'program_state_changed'
+ event. */
+ std::set<GDBCommand*> stateReloadingCommands_;
+
+ bool saw_gdb_prompt_;
+
+ /** Does the used GDB supports pending breakpoints in MI? */
+ bool mi_pending_breakpoints_;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/gdboutputwidget.cpp b/languages/cpp/debugger/gdboutputwidget.cpp
new file mode 100644
index 00000000..817f8692
--- /dev/null
+++ b/languages/cpp/debugger/gdboutputwidget.cpp
@@ -0,0 +1,376 @@
+// *************************************************************************
+// gdboutputwidget.cpp - description
+// -------------------
+// begin : 10th April 2003
+// copyright : (C) 2003 by John Birch
+// email : jbb@kdevelop.org
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * This program is free software; you can redistribute it and/or modify *
+// * it under the terms of the GNU General Public License as published by *
+// * the Free Software Foundation; either version 2 of the License, or *
+// * (at your option) any later version. *
+// * *
+// **************************************************************************
+
+#include "gdboutputwidget.h"
+#include "dbgcontroller.h"
+
+#include <kcombobox.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qtextedit.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qapplication.h>
+#include <qclipboard.h>
+#include <qdom.h>
+
+
+namespace GDBDebugger
+{
+
+/***************************************************************************/
+
+GDBOutputWidget::GDBOutputWidget( QWidget *parent, const char *name) :
+ QWidget(parent, name),
+ m_userGDBCmdEditor(0),
+ m_Interrupt(0),
+ m_gdbView(0),
+ showInternalCommands_(false),
+ maxLines_(5000)
+{
+
+ m_gdbView = new OutputText(this);
+ m_gdbView->setTextFormat(QTextEdit::LogText);
+
+ QBoxLayout *userGDBCmdEntry = new QHBoxLayout();
+ m_userGDBCmdEditor = new KHistoryCombo (this, "gdb-user-cmd-editor");
+
+ QLabel *label = new QLabel(i18n("&GDB cmd:"), this);
+ label->setBuddy(m_userGDBCmdEditor);
+ userGDBCmdEntry->addWidget(label);
+
+ userGDBCmdEntry->addWidget(m_userGDBCmdEditor);
+ userGDBCmdEntry->setStretchFactor(m_userGDBCmdEditor, 1);
+
+ m_Interrupt = new QToolButton( this, "add breakpoint" );
+ m_Interrupt->setSizePolicy ( QSizePolicy ( (QSizePolicy::SizeType)0,
+ ( QSizePolicy::SizeType)0,
+ 0,
+ 0,
+ m_Interrupt->sizePolicy().hasHeightForWidth())
+ );
+ m_Interrupt->setPixmap ( SmallIcon ( "player_pause" ) );
+ userGDBCmdEntry->addWidget(m_Interrupt);
+ QToolTip::add ( m_Interrupt, i18n ( "Pause execution of the app to enter gdb commands" ) );
+
+ QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
+ topLayout->addWidget(m_gdbView, 10);
+ topLayout->addLayout(userGDBCmdEntry);
+
+ slotDbgStatus( "", s_dbgNotStarted);
+
+ connect( m_userGDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotGDBCmd()) );
+ connect( m_Interrupt, SIGNAL(clicked()), SIGNAL(breakInto()));
+
+ connect( &updateTimer_, SIGNAL(timeout()),
+ this, SLOT(flushPending()));
+}
+
+/***************************************************************************/
+
+GDBOutputWidget::~GDBOutputWidget()
+{
+ delete m_gdbView;
+ delete m_userGDBCmdEditor;
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::clear()
+{
+ if (m_gdbView)
+ m_gdbView->clear();
+
+ userCommands_.clear();
+ allCommands_.clear();
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::slotInternalCommandStdout(const char* line)
+{
+ newStdoutLine(line, true);
+}
+
+void GDBOutputWidget::slotUserCommandStdout(const char* line)
+{
+ newStdoutLine(line, false);
+}
+
+namespace {
+ QString colorify(QString text, const QString& color)
+ {
+ // Make sure the newline is at the end of the newly-added
+ // string. This is so that we can always correctly remove
+ // newline inside 'flushPending'.
+ Q_ASSERT(text.endsWith("\n"));
+ if (text.endsWith("\n"))
+ {
+ text.remove(text.length()-1, 1);
+ }
+ text = "<font color=\"" + color + "\">" + text + "</font>\n";
+ return text;
+ }
+}
+
+
+void GDBOutputWidget::newStdoutLine(const QString& line,
+ bool internal)
+{
+ QString s = html_escape(line);
+ if (s.startsWith("(gdb)"))
+ {
+ s = colorify(s, "blue");
+ }
+
+ allCommands_.append(s);
+ allCommandsRaw_.append(line);
+ trimList(allCommands_, maxLines_);
+ trimList(allCommandsRaw_, maxLines_);
+
+ if (!internal)
+ {
+ userCommands_.append(s);
+ userCommandsRaw_.append(line);
+ trimList(userCommands_, maxLines_);
+ trimList(userCommandsRaw_, maxLines_);
+ }
+
+ if (!internal || showInternalCommands_)
+ showLine(s);
+}
+
+
+void GDBOutputWidget::showLine(const QString& line)
+{
+ pendingOutput_ += line;
+
+ // To improve performance, we update the view after some delay.
+ if (!updateTimer_.isActive())
+ {
+ updateTimer_.start(100, true /* single shot */);
+ }
+}
+
+void GDBOutputWidget::trimList(QStringList& l, unsigned max_size)
+{
+ unsigned int length = l.count();
+ if (length > max_size)
+ {
+ for(int to_delete = length - max_size; to_delete; --to_delete)
+ {
+ l.erase(l.begin());
+ }
+ }
+}
+
+void GDBOutputWidget::setShowInternalCommands(bool show)
+{
+ if (show != showInternalCommands_)
+ {
+ showInternalCommands_ = show;
+
+ // Set of strings to show changes, text edit still has old
+ // set. Refresh.
+ m_gdbView->clear();
+ QStringList& newList =
+ showInternalCommands_ ? allCommands_ : userCommands_;
+
+ QStringList::iterator i = newList.begin(), e = newList.end();
+ for(; i != e; ++i)
+ {
+ // Note that color formatting is already applied to '*i'.
+ showLine(*i);
+ }
+ }
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::slotReceivedStderr(const char* line)
+{
+ QString colored = colorify(html_escape(line), "red");
+ // Errors are shown inside user commands too.
+ allCommands_.append(colored);
+ trimList(allCommands_, maxLines_);
+ userCommands_.append(colored);
+ trimList(userCommands_, maxLines_);
+
+ allCommandsRaw_.append(line);
+ trimList(allCommandsRaw_, maxLines_);
+ userCommandsRaw_.append(line);
+ trimList(userCommandsRaw_, maxLines_);
+
+ showLine(colored);
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::slotGDBCmd()
+{
+ QString GDBCmd(m_userGDBCmdEditor->currentText());
+ if (!GDBCmd.isEmpty())
+ {
+ m_userGDBCmdEditor->addToHistory(GDBCmd);
+ m_userGDBCmdEditor->clearEdit();
+ emit userGDBCmd(GDBCmd);
+ }
+}
+
+void GDBOutputWidget::flushPending()
+{
+ m_gdbView->setUpdatesEnabled(false);
+
+ // QTextEdit adds newline after paragraph automatically.
+ // So, remove trailing newline to avoid double newlines.
+ if (pendingOutput_.endsWith("\n"))
+ pendingOutput_.remove(pendingOutput_.length()-1, 1);
+ Q_ASSERT(!pendingOutput_.endsWith("\n"));
+
+ m_gdbView->append(pendingOutput_);
+ pendingOutput_ = "";
+
+ m_gdbView->scrollToBottom();
+ m_gdbView->setUpdatesEnabled(true);
+ m_gdbView->update();
+ m_userGDBCmdEditor->setFocus();
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::slotDbgStatus(const QString &, int statusFlag)
+{
+ if (statusFlag & s_dbgNotStarted)
+ {
+ m_Interrupt->setEnabled(false);
+ m_userGDBCmdEditor->setEnabled(false);
+ return;
+ }
+ else
+ {
+ m_Interrupt->setEnabled(true);
+ }
+
+ if (statusFlag & s_dbgBusy)
+ {
+ m_userGDBCmdEditor->setEnabled(false);
+ }
+ else
+ {
+ m_userGDBCmdEditor->setEnabled(true);
+ }
+}
+
+/***************************************************************************/
+
+void GDBOutputWidget::focusInEvent(QFocusEvent */*e*/)
+{
+ m_gdbView->scrollToBottom();
+ m_userGDBCmdEditor->setFocus();
+}
+
+QString GDBOutputWidget::html_escape(const QString& s)
+{
+ QString r(s);
+ r.replace("<", "&lt;");
+ r.replace(">", "&gt;");
+ return r;
+}
+
+void GDBOutputWidget::savePartialProjectSession(QDomElement* el)
+{
+ QDomDocument doc = el->ownerDocument();
+
+ QDomElement showInternal = doc.createElement("showInternalCommands");
+ showInternal.setAttribute("value", QString::number(showInternalCommands_));
+
+ el->appendChild(showInternal);
+}
+
+void GDBOutputWidget::restorePartialProjectSession(const QDomElement* el)
+{
+ QDomElement showInternal =
+ el->namedItem("showInternalCommands").toElement();
+
+ if (!showInternal.isNull())
+ {
+ showInternalCommands_ = showInternal.attribute("value", "0").toInt();
+ }
+}
+
+
+//void OutputText::contextMenuEvent(QContextMenuEvent* e)
+QPopupMenu* OutputText::createPopupMenu(const QPoint&)
+{
+ KPopupMenu* popup = new KPopupMenu;
+
+ int id = popup->insertItem(i18n("Show Internal Commands"),
+ this,
+ SLOT(toggleShowInternalCommands()));
+
+ popup->setItemChecked(id, parent_->showInternalCommands_);
+ popup->setWhatsThis(
+ id,
+ i18n(
+ "Controls if commands issued internally by KDevelop "
+ "will be shown or not.<br>"
+ "This option will affect only future commands, it will not "
+ "add or remove already issued commands from the view."));
+
+ popup->insertItem(i18n("Copy All"),
+ this,
+ SLOT(copyAll()));
+
+
+ return popup;
+}
+
+void OutputText::copyAll()
+{
+ /* See comments for allCommandRaw_ for explanations of
+ this complex logic, as opposed to calling text(). */
+ QStringList& raw = parent_->showInternalCommands_ ?
+ parent_->allCommandsRaw_ : parent_->userCommandsRaw_;
+ QString text;
+ for (unsigned i = 0; i < raw.size(); ++i)
+ text += raw[i];
+
+ // Make sure the text is pastable both with Ctrl-C and with
+ // middle click.
+ QApplication::clipboard()->setText(text, QClipboard::Clipboard);
+ QApplication::clipboard()->setText(text, QClipboard::Selection);
+}
+
+void OutputText::toggleShowInternalCommands()
+{
+ parent_->setShowInternalCommands(!parent_->showInternalCommands_);
+}
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+}
+
+
+#include "gdboutputwidget.moc"
+
diff --git a/languages/cpp/debugger/gdboutputwidget.h b/languages/cpp/debugger/gdboutputwidget.h
new file mode 100644
index 00000000..ddf79823
--- /dev/null
+++ b/languages/cpp/debugger/gdboutputwidget.h
@@ -0,0 +1,137 @@
+// *************************************************************************
+// gdboutputwidget.cpp - description
+// -------------------
+// begin : 10th April 2003
+// copyright : (C) 2003 by John Birch
+// email : jbb@kdevelop.org
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * This program is free software; you can redistribute it and/or modify *
+// * it under the terms of the GNU General Public License as published by *
+// * the Free Software Foundation; either version 2 of the License, or *
+// * (at your option) any later version. *
+// * *
+// **************************************************************************
+
+#ifndef _GDBOUTPUTWIDGET_H_
+#define _GDBOUTPUTWIDGET_H_
+
+#include <qwidget.h>
+#include <qtextedit.h>
+#include <qtimer.h>
+#include <qstringlist.h>
+
+class KHistoryCombo;
+
+class QTextEdit;
+class QToolButton;
+class QDomElement;
+
+namespace GDBDebugger
+{
+
+class GDBOutputWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ GDBOutputWidget( QWidget *parent=0, const char *name=0 );
+ ~GDBOutputWidget();
+
+ void savePartialProjectSession(QDomElement* el);
+ void restorePartialProjectSession(const QDomElement* el);
+
+ void clear();
+
+public slots:
+ void slotInternalCommandStdout(const char* line);
+ void slotUserCommandStdout(const char* line);
+ void slotReceivedStderr(const char* line);
+ void slotDbgStatus (const QString &status, int statusFlag);
+
+ void slotGDBCmd();
+
+ void flushPending();
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+signals:
+ void userGDBCmd(const QString &cmd);
+ void breakInto();
+
+private:
+
+ QString html_escape(const QString& s);
+
+ void newStdoutLine(const QString& line, bool internal);
+
+ /** Arranges for 'line' to be shown to the user.
+ Adds 'line' to pendingOutput_ and makes sure
+ updateTimer_ is running. */
+ void showLine(const QString& line);
+
+ /** Makes 'l' no longer then 'max_size' by
+ removing excessive elements from the top.
+ */
+ void trimList(QStringList& l, unsigned max_size);
+
+ KHistoryCombo* m_userGDBCmdEditor;
+ QToolButton* m_Interrupt;
+ QTextEdit* m_gdbView;
+
+ void setShowInternalCommands(bool);
+ friend class OutputText;
+
+ /** The output from user commands only and from
+ all commands. We keep it here so that if we switch
+ "Show internal commands" on, we can show previous
+ internal commands.
+ */
+ QStringList userCommands_, allCommands_;
+ /** Same output, without any fancy formatting. Keeping it
+ here because I can't find any way to extract raw text,
+ without formatting, out of QTextEdit except for
+ selecting everything and calling 'copy()'. The latter
+ approach is just ugly. */
+ QStringList userCommandsRaw_, allCommandsRaw_;
+
+
+ /** For performance reasons, we don't immediately add new text
+ to QTExtEdit. Instead we add it to pendingOutput_ and
+ flush it on timer.
+ */
+ QString pendingOutput_;
+ QTimer updateTimer_;
+
+ bool showInternalCommands_;
+
+ int maxLines_;
+};
+
+/** Add popup menu specific to gdb output window to QTextEdit.
+*/
+class OutputText : public QTextEdit
+{
+ Q_OBJECT
+public:
+ OutputText(GDBOutputWidget* parent)
+ : QTextEdit(parent),
+ parent_(parent)
+ {}
+
+ QPopupMenu* createPopupMenu(const QPoint& pos);
+
+private slots:
+ void copyAll();
+ void toggleShowInternalCommands();
+
+private:
+ GDBOutputWidget* parent_;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/gdbparser.cpp b/languages/cpp/debugger/gdbparser.cpp
new file mode 100644
index 00000000..79057af5
--- /dev/null
+++ b/languages/cpp/debugger/gdbparser.cpp
@@ -0,0 +1,432 @@
+// **************************************************************************
+// begin : Tue Aug 17 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+// **************************************************************************
+
+// **************************************************************************
+// *
+// This program is free software; you can redistribute it and/or modify *
+// it under the terms of the GNU General Public License as published by *
+// the Free Software Foundation; either version 2 of the License, or *
+// (at your option) any later version. *
+// *
+// **************************************************************************
+
+#include "gdbparser.h"
+#include "variablewidget.h"
+#include <kdebug.h>
+
+#include <qregexp.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+
+namespace GDBDebugger
+{
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+GDBParser *GDBParser::GDBParser_ = 0;
+
+GDBParser *GDBParser::getGDBParser()
+{
+ if (!GDBParser_)
+ GDBParser_ = new GDBParser();
+
+ return GDBParser_;
+}
+
+// **************************************************************************
+
+void GDBParser::destroy()
+{
+ delete GDBParser_;
+ GDBParser_ = 0;
+}
+
+// **************************************************************************
+
+GDBParser::GDBParser()
+{
+}
+
+// **************************************************************************
+
+GDBParser::~GDBParser()
+{
+}
+
+
+// **************************************************************************
+
+QString GDBParser::getName(const char **buf)
+{
+ const char *start = skipNextTokenStart(*buf);
+ if (*start) {
+ *buf = skipTokenValue(start);
+ return QCString(start, *buf - start + 1);
+ } else
+ *buf = start;
+
+ return QString();
+}
+
+// **************************************************************************
+
+QString GDBParser::getValue(const char **buf)
+{
+ const char *start = skipNextTokenStart(*buf);
+ *buf = skipTokenValue(start);
+
+ QString value(QCString(start, *buf - start + 1).data());
+ return value;
+}
+
+QString GDBParser::undecorateValue(DataType type, const QString& s)
+{
+ QCString l8 = s.local8Bit();
+ const char* start = l8;
+ const char* end = start + s.length();
+
+ if (*start == '{')
+ {
+ // Gdb uses '{' in two cases:
+ // - composites (arrays and structures)
+ // - pointers to functions. In this case type is
+ // enclosed in "{}". Not sure why it's so, as
+ // when printing pointer, type is in parenthesis.
+ if (type == typePointer)
+ {
+ // Looks like type in braces at the beginning. Strip it.
+ start = skipDelim(start, '{', '}');
+ }
+ else
+ {
+ // Looks like composite, strip the braces and return.
+ return QCString(start+1, end - start -1);
+ }
+ }
+ else if (*start == '(')
+ {
+ // Strip the type of the pointer from the value.
+ //
+ // When printing values of pointers, gdb prints the pointer
+ // type as well. This is not necessary for kdevelop -- after
+ // all, there's separate column with value type. But that behaviour
+ // is not configurable. The only way to change it is to explicitly
+ // pass the 'x' format specifier to the 'print' command.
+ //
+ // We probably can achieve that by sending an 'print in hex' request
+ // as soon as we know the type of variable, but that would be complex
+ // and probably conflict with 'toggle hex/decimal' command.
+ // So, address this problem as close to debugger as possible.
+
+ // We can't find the first ')', because type can contain '(' and ')'
+ // characters if its function pointer. So count opening and closing
+ // parentheses.
+
+ start = skipDelim(start, '(', ')');
+ }
+
+ QString value(QCString(start, end - start + 1).data());
+
+ value = value.stripWhiteSpace();
+
+ if (value[0] == '@')
+ {
+ // It's a reference, we need to show just the value.
+ if (int i = value.find(":"))
+ {
+ value = value.mid(i+2);
+ }
+ else
+ {
+ // Just reference, no value at all, remove all
+ value = "";
+ }
+ }
+
+ if (value.find("Cannot access memory") == 0)
+ value = "(inaccessible)";
+
+ return value.stripWhiteSpace();
+}
+
+QString GDBParser::undecorateValue(const QString& s)
+{
+ DataType dataType = determineType(s.local8Bit());
+ QString r = undecorateValue(dataType, s.local8Bit());
+ return r;
+}
+
+// Given a value that starts with 0xNNNNNN determines if
+// it looks more like pointer, or a string value.
+DataType pointerOrValue(const char *buf)
+{
+ while (*buf) {
+ if (!isspace(*buf))
+ buf++;
+ else if (*(buf+1) == '\"')
+ return typeValue;
+ else
+ break;
+ }
+
+ return typePointer;
+}
+
+
+DataType GDBParser::determineType(const char *buf) const
+{
+ if (!buf || !*(buf= skipNextTokenStart(buf)))
+ return typeUnknown;
+
+ // A reference, probably from a parameter value.
+ if (*buf == '@')
+ return typeReference;
+
+ // Structures and arrays - (but which one is which?)
+ // {void (void)} 0x804a944 <__builtin_new+41> - this is a fn pointer
+ // (void (*)(void)) 0x804a944 <f(E *, char)> - so is this - ugly!!!
+ if (*buf == '{') {
+ if (strncmp(buf, "{{", 2) == 0)
+ return typeArray;
+
+ if (strncmp(buf, "{<No data fields>}", 18) == 0)
+ return typeValue;
+
+ buf++;
+ while (*buf) {
+ switch (*buf) {
+ case '=':
+ return typeStruct;
+ case '"':
+ buf = skipString(buf);
+ break;
+ case '\'':
+ buf = skipQuotes(buf, '\'');
+ break;
+ case ',':
+ if (*(buf-1) == '}')
+ Q_ASSERT(false);
+ return typeArray;
+ case '}':
+ if (*(buf+1) == ',' || *(buf+1) == '\n' || !*(buf+1))
+ return typeArray; // Hmm a single element array??
+ if (strncmp(buf+1, " 0x", 3) == 0)
+ return typePointer; // What about references?
+ return typeUnknown; // very odd?
+ case '(':
+ buf = skipDelim(buf, '(', ')');
+ break;
+ case '<':
+ buf = skipDelim(buf, '<', '>');
+ // gdb may produce this output:
+ // $1 = 0x804ddf3 ' ' <repeats 20 times>, "TESTSTRING"
+ // after having finished with the "repeats"-block we need
+ // to check if the string continues
+ if ( buf[0] == ',' && (buf[2] == '\"' || buf[2] == '\'') ) {
+ buf++; //set the buffer behind the comma to indicate that the string continues
+ }
+ break;
+ default:
+ buf++;
+ break;
+ }
+ }
+ return typeUnknown;
+ }
+
+ // some sort of address. We need to sort out if we have
+ // a 0x888888 "this is a char*" type which we'll term a value
+ // or whether we just have an address
+ if (strncmp(buf, "0x", 2) == 0) {
+ return pointerOrValue(buf);
+ }
+
+ // Pointers and references - references are a bit odd
+ // and cause GDB to fail to produce all the local data
+ // if they haven't been initialised. but that's not our problem!!
+ // (void (*)(void)) 0x804a944 <f(E *, char)> - this is a fn pointer
+ if (*buf == '(') {
+ buf = skipDelim(buf, '(', ')');
+ // This 'if' handles values like this:
+ // (int (&)[3]) @0xbffff684: {5, 6, 7}
+ // which is a reference to array.
+ if (buf[1] == '@')
+ return typeReference;
+ // This 'if' handles values like this:
+ // (int (*)[3]) 0xbffff810
+ if (strncmp(buf, " 0x", 3) == 0)
+ {
+ ++buf;
+ return pointerOrValue(buf);
+ }
+
+ switch (*(buf-2)) {
+ case '*':
+ return typePointer;
+ case '&':
+ return typeReference;
+ default:
+ switch (*(buf-8)) {
+ case '*':
+ return typePointer;
+ case '&':
+ return typeReference;
+ }
+ return typeUnknown;
+ }
+ }
+
+ buf = skipTokenValue(buf);
+ if ((strncmp(buf, " = ", 3) == 0) || (*buf == '='))
+ return typeName;
+
+ return typeValue;
+}
+
+// **************************************************************************
+
+const char *GDBParser::skipString(const char *buf) const
+{
+ if (buf && *buf == '\"') {
+ buf = skipQuotes(buf, *buf);
+ while (*buf) {
+ if ((strncmp(buf, ", \"", 3) == 0) ||
+ (strncmp(buf, ", '", 3) == 0))
+ buf = skipQuotes(buf+2, *(buf+2));
+ else if (strncmp(buf, " <", 2) == 0) // take care of <repeats
+ buf = skipDelim(buf+1, '<', '>');
+ else
+ break;
+ }
+
+ // If the string is long then it's chopped and has ... after it.
+ while (*buf && *buf == '.')
+ buf++;
+ }
+
+ return buf;
+}
+
+// ***************************************************************************
+
+const char *GDBParser::skipQuotes(const char *buf, char quotes) const
+{
+ if (buf && *buf == quotes) {
+ buf++;
+
+ while (*buf) {
+ if (*buf == '\\')
+ buf++; // skips \" or \' problems
+ else if (*buf == quotes)
+ return buf+1;
+
+ buf++;
+ }
+ }
+
+ return buf;
+}
+
+// **************************************************************************
+
+const char *GDBParser::skipDelim(const char *buf, char open, char close) const
+{
+ if (buf && *buf == open) {
+ buf++;
+
+ while (*buf) {
+ if (*buf == open)
+ buf = skipDelim(buf, open, close);
+ else if (*buf == close)
+ return buf+1;
+ else if (*buf == '\"')
+ buf = skipString(buf);
+ else if (*buf == '\'')
+ buf = skipQuotes(buf, *buf);
+ else if (*buf)
+ buf++;
+ }
+ }
+ return buf;
+}
+
+// **************************************************************************
+
+const char *GDBParser::skipTokenValue(const char *buf) const
+{
+ if (buf) {
+ while (true) {
+ buf = skipTokenEnd(buf);
+
+ const char *end = buf;
+ while (*end && isspace(*end) && *end != '\n')
+ end++;
+
+ if (*end == 0 || *end == ',' || *end == '\n' || *end == '=' || *end == '}')
+ break;
+
+ if (buf == end)
+ break;
+
+ buf = end;
+ }
+ }
+
+ return buf;
+}
+
+// **************************************************************************
+
+const char *GDBParser::skipTokenEnd(const char *buf) const
+{
+ if (buf) {
+ switch (*buf) {
+ case '"':
+ return skipString(buf);
+ case '\'':
+ return skipQuotes(buf, *buf);
+ case '{':
+ return skipDelim(buf, '{', '}');
+ case '<':
+ buf = skipDelim(buf, '<', '>');
+ // gdb may produce this output:
+ // $1 = 0x804ddf3 ' ' <repeats 20 times>, "TESTSTRING"
+ // after having finished with the "repeats"-block we need
+ // to check if the string continues
+ if ( buf[0] == ',' && (buf[2] == '\"' || buf[2] == '\'') ) {
+ buf++; //set the buffer behind the comma to indicate that the string continues
+ }
+ return buf;
+ case '(':
+ return skipDelim(buf, '(', ')');
+ }
+
+ while (*buf && !isspace(*buf) && *buf != ',' && *buf != '}' && *buf != '=')
+ buf++;
+ }
+
+ return buf;
+}
+
+// **************************************************************************
+
+const char *GDBParser::skipNextTokenStart(const char *buf) const
+{
+ if (buf)
+ while (*buf && (isspace(*buf) || *buf == ',' || *buf == '}' || *buf == '='))
+ buf++;
+
+ return buf;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+}
diff --git a/languages/cpp/debugger/gdbparser.h b/languages/cpp/debugger/gdbparser.h
new file mode 100644
index 00000000..8972e5df
--- /dev/null
+++ b/languages/cpp/debugger/gdbparser.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ begin : Tue Aug 17 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GDBPARSER_H_
+#define _GDBPARSER_H_
+
+#include "variablewidget.h"
+
+namespace GDBDebugger
+{
+
+class GDBParser
+{
+public:
+ DataType determineType(const char *buf) const;
+ QString undecorateValue(const QString& s);
+
+ const char *skipString(const char *buf) const;
+ const char *skipQuotes(const char *buf, char quote) const;
+ const char *skipDelim(const char *buf, char open, char close) const;
+
+ static GDBParser *getGDBParser();
+ static void destroy();
+
+private:
+ void parseArray(TrimmableItem *parent, const char *buf);
+
+ const char *skipTokenEnd(const char *buf) const;
+ const char *skipTokenValue(const char *buf) const;
+ const char *skipNextTokenStart(const char *buf) const;
+
+ QString getName(const char **buf);
+ /** Assuming 'buf' points to a value, return a pointer
+ to the position right after the value.
+ */
+ QString getValue(const char **buf);
+ QString undecorateValue(DataType type, const QString& s);
+
+protected:
+ GDBParser();
+ ~GDBParser();
+ static GDBParser *GDBParser_;
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/gdbtable.cpp b/languages/cpp/debugger/gdbtable.cpp
new file mode 100644
index 00000000..c4d75f3a
--- /dev/null
+++ b/languages/cpp/debugger/gdbtable.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 "gdbtable.h"
+
+namespace GDBDebugger {
+
+GDBTable::GDBTable(QWidget *parent, const char *name)
+ : QTable(parent, name)
+{
+}
+
+GDBTable::GDBTable(int nr, int nc, QWidget * parent, const char * name)
+ : QTable(nr, nc, parent, name)
+{
+}
+
+GDBTable::~GDBTable()
+{
+}
+
+void GDBTable::keyPressEvent( QKeyEvent * e )
+{
+ emit keyPressed(e->key());
+
+ if (e->key() == Key_Return)
+ emit returnPressed();
+ else if (e->key() == Key_F2)
+ emit f2Pressed();
+ else if ((e->text() == QString("a")) && (e->state() == AltButton))
+ {
+ emit insertPressed();
+ return;
+ }
+ else if ((e->text() == QString("A")) && (e->state() == AltButton))
+ {
+ emit insertPressed();
+ return;
+ }
+ else if (e->key() == Key_Delete)
+ emit deletePressed();
+
+ QTable::keyPressEvent(e);
+}
+
+}
+
+#include "gdbtable.moc"
+
diff --git a/languages/cpp/debugger/gdbtable.h b/languages/cpp/debugger/gdbtable.h
new file mode 100644
index 00000000..f8741e26
--- /dev/null
+++ b/languages/cpp/debugger/gdbtable.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 GDBDEBUGGERGDBTABLE_H
+#define GDBDEBUGGERGDBTABLE_H
+
+#include <qtable.h>
+
+namespace GDBDebugger {
+
+class GDBTable : public QTable
+{
+Q_OBJECT
+public:
+ GDBTable(QWidget *parent = 0, const char *name = 0);
+ GDBTable( int numRows, int numCols, QWidget * parent = 0, const char * name = 0 );
+ ~GDBTable();
+
+ virtual void keyPressEvent ( QKeyEvent * e );
+
+signals:
+ void keyPressed(int key);
+
+ void returnPressed();
+ void f2Pressed();
+ void insertPressed();
+ void deletePressed();
+};
+
+}
+
+#endif
+
diff --git a/languages/cpp/debugger/hi16-action-breakpoint_add.png b/languages/cpp/debugger/hi16-action-breakpoint_add.png
new file mode 100644
index 00000000..1b41040c
--- /dev/null
+++ b/languages/cpp/debugger/hi16-action-breakpoint_add.png
Binary files differ
diff --git a/languages/cpp/debugger/hi16-action-breakpoint_delete.png b/languages/cpp/debugger/hi16-action-breakpoint_delete.png
new file mode 100644
index 00000000..c35e039f
--- /dev/null
+++ b/languages/cpp/debugger/hi16-action-breakpoint_delete.png
Binary files differ
diff --git a/languages/cpp/debugger/hi16-action-breakpoint_delete_all.png b/languages/cpp/debugger/hi16-action-breakpoint_delete_all.png
new file mode 100644
index 00000000..c35e039f
--- /dev/null
+++ b/languages/cpp/debugger/hi16-action-breakpoint_delete_all.png
Binary files differ
diff --git a/languages/cpp/debugger/hi16-action-breakpoint_edit.png b/languages/cpp/debugger/hi16-action-breakpoint_edit.png
new file mode 100644
index 00000000..ec92ced2
--- /dev/null
+++ b/languages/cpp/debugger/hi16-action-breakpoint_edit.png
Binary files differ
diff --git a/languages/cpp/debugger/kdevdebugger.desktop b/languages/cpp/debugger/kdevdebugger.desktop
new file mode 100644
index 00000000..69b5646c
--- /dev/null
+++ b/languages/cpp/debugger/kdevdebugger.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin provides a frontend for GDB, a source-level debugger for C, C++ and more. http://sources.redhat.com/gdb/
+Comment[ca]=Aquest connector proveeix una interfície per a GDB, un depurador a nivell de codi per a C, C++ i d'altres. http://sources.redhat.com/gdb/
+Comment[da]=Dette plugin sørger for en brugerflade til GDB, en fejlretter til C, C++ og mere. http://sources.redhat.com/gdb/
+Comment[de]=Dieses Modul bietet eine Oberfläche für GDB, einen Quellcode-Debugger für C, C++ und andere Sprachen. http://sources.redhat.com/gdb/
+Comment[el]=Αυτό το πρόσθετο προσφέρει ένα πρόγραμμα για το GDB, έναν αποσφαλματωτή πηγαίου κώδικα για C, C++ και άλλες γλώσσες. http://sources.redhat.com/gdb/
+Comment[es]=Este complemento proporciona un entorno para GDB, un depurador a nivel de código para C, C++ y otros (http://sources.redhat.com/gdb/)
+Comment[et]=See plugin pakub GDB kasutajaliidest. GDB on C, C++ ja veel mitme keele lähtekoodi tasandil tegutsev siluja. http://sources.redhat.com/gdb/
+Comment[eu]=Plugin honek GDB-rako interfaze bat eskeintzen du. GDB, C eta C++-rako iturburu-mailako araztaile bat da. http://sources.redhat.com/gdb/
+Comment[fa]=این وصله پایانه‌ای برای GDB، اشکال‌زدای سطح منبع برای سی، C++ و بیشتر تولید می‌کند. http://sources.redhat.com/gdb/
+Comment[fr]=Ce module externe fournit une interface pour GDB, un débogueur au niveau source pour C, C++ et autres. http://sources.redhat.com/gdb/
+Comment[gl]=Esta extensión proporciona un frontal para GDB, un depurador a nivel de código para C, C++ e outras linguaxes. http://sources.redhat.com/gdb/
+Comment[hi]=यह प्लगइन जीडीबी के लिए फ्रन्टएण्ड प्रदान करता है, जो सी, सी++ तथा और भी के लिए स्रोत-स्तर पर डिबगर हैhttp://sources.redhat.com/gdb/
+Comment[hu]=Ez a bővítőmodul grafikus felületet biztosít a GDB nyomkövető használatához, C/C++-hoz és más nyelvekhez, forrásszinten. http://sources.redhat.com/gdb/
+Comment[is]=Þetta íforrit útvegar framhlið fyrir GDB, frumkóða-aflúsara fyrir C, C++ og fleira. http://sources.redhat.com/gdb/
+Comment[it]=Questo plugin fornisce un'interfaccia per GDB, un debugger a livello sorgente per C, C++ e altro. http://sources.redhat.com/gdb/
+Comment[ja]=このプラグインは、C, C++ などのソースレベルデバッガ GDB のフロントエンドを提供します。http://sources.redhat.com/gdb/
+Comment[nds]=Dit Moduul stellt en Böversiet för GDB praat, en Bornkode-Fehlersöker för C, C++ un annerswat. http://sources.redhat.com/gdb/
+Comment[ne]=यो प्लगइनले C, C++ र बढीका लागि स्रोत-तह डिबगर,GDB का लागि फ्रन्टइन्ड प्रदान गर्दछ । http://sources.redhat.com/gdb/
+Comment[nl]=Deze plugin biedt een grafische schil voor GDB, een broncode-debugger voor C, C++ en meer. http://sources.redhat.com/gdb/
+Comment[pl]=Ta wtyczka udostępnia interfejs do GDB, debugera poziomu źródłowego dla C, C++ i innych. http://sources.redhat.com/gdb/
+Comment[pt]=Este 'plugin' oferece uma interface para o GDB, um depurador ao nível do código para C, C++ entre outros. http://sources.redhat.com/gdb/
+Comment[pt_BR]=Este plug-in fornece um frontend para o GDB, um depurador a nível de código para C, C++ e mais. http://sources.redhat.com/gdb/
+Comment[ru]=Этот модуль предоставляет интерфейс к GDB, отладчику исходного кода для C, C++ и других языков. http://sources.redhat.com/gdb/
+Comment[sk]=Tento modul poskytuje rozhranie pre GDB, debuger pre C, C++ a ďalšie. http://sources.redhat.com/gdb/
+Comment[sl]=Ta vstavek omogoča vmesnik za GDB, razhroščevalnik na ravni izvorne kode za C, C++ in več. http://sourcs.redhat.com/gdb/
+Comment[sr]=Овај прикључак обезбеђује интерфејс за GDB, исправљач на нивоу изворног кода за C, C++ и више. http://sources.redhat.com/gdb/
+Comment[sr@Latn]=Ovaj priključak obezbeđuje interfejs za GDB, ispravljač na nivou izvornog koda za C, C++ i više. http://sources.redhat.com/gdb/
+Comment[sv]=Insticksprogrammet tillhandahåller ett gränssnitt till GDB, en källkodsavlusare för C, C++ med mera. http://sources.redhat.com/gdb/
+Comment[ta]=GDB க்கு இந்த சொருகு ஒரு முன்நிறுத்தல் , C, C++ மற்றும் பலவற்றிற்கு ஒரு மூல-நிலை டிபக்கர்
+Comment[tg]=Ин модул дар GDB интерфейсро ба ихтиёр мегузорад, созгузори код барои C, C++ ибтидоӣва барои дигар забонҳо. http://sources.redhat.com/gdb/
+Comment[tr]=Bu eklenti, C, C++ ve daha fazlası için bir kaynak-düzeyinde hata ayıklayıcı olan GDB için bir önucu sağlar. http://sources.redhat.com/gdb/
+Comment[zh_CN]=这个插件是一个 GDB 前端,一个 C、C++ 和其它语言的源代码调试器。http://sources.redhat.com/gdb/
+Comment[zh_TW]=這個外掛程式提供 GDB 的前端介面。GDB 是一個 C/C++ 還有其它語言的除錯器。http://sources.redhat.com/gdb/
+Name=KDevDebugger
+Name[da]=KDevelop Debugger
+Name[de]=Debugger (KDevelop)
+Name[hi]=के-डेव-डिबगर
+Name[nds]=KDevelop-Fehlersöker
+Name[ne]=केडीई विकास डिबगर
+Name[pl]=KDevDebuger
+Name[sk]=KDev debuger
+Name[sv]=KDevelop avlusare
+Name[ta]=கெடெவ் டிபக்கர்
+Name[zh_TW]=KDevelop 除錯器
+GenericName=Debugger Frontend
+GenericName[ca]=Interfície per al depurador
+GenericName[da]=Fejlsøgningsbrugerflade
+GenericName[de]=Debugger-Oberfläche
+GenericName[el]=Πρόγραμμα Αποσφαλματωτή
+GenericName[es]=Entorno del depurador
+GenericName[et]=Siluja kasutajaliides
+GenericName[eu]=Araztaile-interfazea
+GenericName[fa]=پایانۀ اشکال‌زدا
+GenericName[fr]=Interface du débogueur
+GenericName[ga]=Comhéadan Dífhabhtóra
+GenericName[gl]=Frontal de depuración
+GenericName[hi]=डिबगर फ्रन्टएण्ड
+GenericName[hu]=Grafikus felület nyomkövetéshez
+GenericName[it]=Interfaccia al debugger
+GenericName[ja]=デバッガフロントエンド
+GenericName[nds]=Fehlersöker-Böversiet
+GenericName[ne]=डिबगर फ्रन्टइन्ड
+GenericName[nl]=Grafische schil voor debugger
+GenericName[pl]=Interfejs do debugera
+GenericName[pt]=Interface de Depuração
+GenericName[pt_BR]=Frontend do Depurador
+GenericName[ru]=Интегрированный отладчик
+GenericName[sk]=Debuger rozhranie
+GenericName[sl]=Vmesnik razhroščevalnika
+GenericName[sr]=Интерфејс исправљача
+GenericName[sr@Latn]=Interfejs ispravljača
+GenericName[sv]=Gränssnitt för avlusare
+GenericName[ta]=டிபக்கர் பிரான்டட்
+GenericName[tg]=Интеграл ёфтани созгузор
+GenericName[tr]=Hata Ayıklayıcı Önucu
+GenericName[zh_CN]=调试器前端
+GenericName[zh_TW]=除錯器前端
+Icon=debugger
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevdebugger
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=CompiledDevelopment
diff --git a/languages/cpp/debugger/kdevdebugger.rc b/languages/cpp/debugger/kdevdebugger.rc
new file mode 100644
index 00000000..801cadb8
--- /dev/null
+++ b/languages/cpp/debugger/kdevdebugger.rc
@@ -0,0 +1,93 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevDebugger" version="11">
+<MenuBar>
+ <Menu name="debug">
+ <text>&amp;Debug</text>
+ <Action name="debug_run" group="debug"/>
+ <Action name="debug_stop" group="debug"/>
+ <Action name="debug_pause" group="debug"/>
+ <Action name="debug_runtocursor" group="debug"/>
+ <Action name="debug_jumptocursor" group="debug"/>
+ <Separator group="debug"/>
+ <Action name="debug_stepover" group="debug"/>
+ <Action name="debug_stepoverinst" group="debug"/>
+ <Action name="debug_stepinto" group="debug"/>
+ <Action name="debug_stepintoinst" group="debug"/>
+ <Action name="debug_stepout" group="debug"/>
+ <Action name="debug_restart" group="debug"/>
+ <Separator group="debug"/>
+ <Action name="debug_toggle_breakpoint" group="debug"/>
+ <Action name="debug_disable_breakpoint" group="debug"/>
+ <Separator group="debug"/>
+ <Action name="debug_memview" group="debug"/>
+ <Action name="debug_core" group="debug"/>
+ <Action name="debug_attach" group="debug"/>
+ <Separator group="debug"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="debugToolBar">
+ <text>Debugger Toolbar</text>
+ <Action name="debug_run"/>
+ <Action name="debug_restart"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepout"/>
+ <Separator/>
+ <Action name="debug_memview"/>
+ <WeakSeparator/>
+</ToolBar>
+<State name="stopped">
+ <enable>
+ <Action name="debug_run"/>
+ <Action name="debug_core"/>
+ <Action name="debug_attach"/>
+ </enable>
+ <disable>
+ <Action name="debug_stop"/>
+ <Action name="debug_pause"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepoverinst"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepintoinst"/>
+ <Action name="debug_stepout"/>
+ <Action name="debug_memview"/>
+ </disable>
+</State>
+<State name="paused">
+ <enable>
+ <Action name="debug_run"/>
+ <Action name="debug_stop"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepoverinst"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepintoinst"/>
+ <Action name="debug_stepout"/>
+ <Action name="debug_memview"/>
+ </enable>
+ <disable>
+ <Action name="debug_core"/>
+ <Action name="debug_attach"/>
+ </disable>
+</State>
+<State name="active">
+ <enable>
+ <Action name="debug_pause"/>
+ <Action name="debug_stop"/>
+ </enable>
+ <disable>
+ <Action name="debug_run"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepoverinst"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepintoinst"/>
+ <Action name="debug_stepout"/>
+ <Action name="debug_memview"/>
+ <Action name="debug_core"/>
+ <Action name="debug_attach"/>
+ </disable>
+</State>
+</kpartgui>
+
diff --git a/languages/cpp/debugger/label_with_double_click.cpp b/languages/cpp/debugger/label_with_double_click.cpp
new file mode 100644
index 00000000..a0a2014b
--- /dev/null
+++ b/languages/cpp/debugger/label_with_double_click.cpp
@@ -0,0 +1,14 @@
+
+#include "label_with_double_click.h"
+
+LabelWithDoubleClick::LabelWithDoubleClick(const QString& s, QWidget* parent)
+: QLabel(s, parent)
+{}
+
+void LabelWithDoubleClick::mouseDoubleClickEvent(QMouseEvent*)
+{
+ emit doubleClicked();
+}
+
+
+#include "label_with_double_click.moc"
diff --git a/languages/cpp/debugger/label_with_double_click.h b/languages/cpp/debugger/label_with_double_click.h
new file mode 100644
index 00000000..11dec898
--- /dev/null
+++ b/languages/cpp/debugger/label_with_double_click.h
@@ -0,0 +1,20 @@
+
+#ifndef LABEL_WITH_DOUBLE_CLICK_HPP_VP_2006_04_04
+#define LABEL_WITH_DOUBLE_CLICK_HPP_VP_2006_04_04
+
+#include <qlabel.h>
+
+class LabelWithDoubleClick : public QLabel
+{
+ Q_OBJECT
+public:
+ LabelWithDoubleClick(const QString& s, QWidget* parent);
+
+signals:
+ void doubleClicked();
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent*);
+};
+
+#endif
diff --git a/languages/cpp/debugger/memviewdlg.cpp b/languages/cpp/debugger/memviewdlg.cpp
new file mode 100644
index 00000000..5316aa91
--- /dev/null
+++ b/languages/cpp/debugger/memviewdlg.cpp
@@ -0,0 +1,486 @@
+/***************************************************************************
+ begin : Tue Oct 5 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "memviewdlg.h"
+#include "gdbcontroller.h"
+#include "gdbcommand.h"
+
+#include <kbuttonbox.h>
+#include <klineedit.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qvariant.h>
+#include <qpopupmenu.h>
+#include <qhbox.h>
+#include <qtoolbox.h>
+#include <qtextedit.h>
+
+#include <kmessagebox.h>
+
+#include <khexedit/byteseditinterface.h>
+
+#include <ctype.h>
+
+// **************************************************************************
+//
+// Dialog allows the user to enter
+// - A starting address
+// - An ending address
+//
+// this can be in the form
+// functiom/method name
+// variable address (ie &Var, str)
+// Memory address 0x8040abc
+//
+// When disassembling and you enter a method name without an
+// ending address then the whole method is disassembled.
+// No data means disassemble the method we're curently in.(from the
+// start of the method)
+//
+// click ok buton to send the request to gdb
+// the output is returned (some time later) in the raw data slot
+// and displayed as is, so it's rather crude, but it works!
+// **************************************************************************
+
+namespace GDBDebugger
+{
+ /** Container for controls that select memory range.
+
+ The memory range selection is embedded into memory view widget,
+ it's not a standalone dialog. However, we want to have easy way
+ to hide/show all controls, so we group them in this class.
+ */
+ class MemoryRangeSelector : public QWidget
+ {
+ public:
+ KLineEdit* startAddressLineEdit;
+ KLineEdit* amountLineEdit;
+ QPushButton* okButton;
+ QPushButton* cancelButton;
+
+ MemoryRangeSelector(QWidget* parent)
+ : QWidget(parent)
+ {
+ QVBoxLayout* l = new QVBoxLayout(this);
+
+ // Grid layout: labels + address field
+ QGridLayout* gl = new QGridLayout(l);
+
+ gl->setColSpacing(0, 2);
+ gl->setColSpacing(1, 4);
+ gl->setRowSpacing(1, 2);
+
+ QLabel* l1 = new QLabel(i18n("Start"), this);
+ gl->addWidget(l1, 0, 1);
+
+ startAddressLineEdit = new KLineEdit(this);
+ gl->addWidget(startAddressLineEdit, 0, 3);
+
+ QLabel* l2 = new QLabel(i18n("Amount"), this);
+ gl->addWidget(l2, 2, 1);
+
+ amountLineEdit = new KLineEdit(this);
+ gl->addWidget(amountLineEdit, 2, 3);
+
+ l->addSpacing(2);
+
+ QHBoxLayout* hb = new QHBoxLayout(l);
+ hb->addStretch();
+
+ okButton = new QPushButton(i18n("OK"), this);
+ hb->addWidget(okButton);
+
+ cancelButton = new QPushButton(i18n("Cancel"), this);
+ hb->addWidget(cancelButton);
+
+ l->addSpacing(2);
+
+ connect(startAddressLineEdit, SIGNAL(returnPressed()),
+ okButton, SLOT(animateClick()));
+
+ connect(amountLineEdit, SIGNAL(returnPressed()),
+ okButton, SLOT(animateClick()));
+ }
+ };
+
+
+
+ MemoryView::MemoryView(GDBController* controller,
+ QWidget* parent, const char* name)
+ : QWidget(parent, name),
+ controller_(controller),
+ // New memory view can be created only when debugger is active,
+ // so don't set s_appNotStarted here.
+ khexedit2_real_widget(0),
+ amount_(0), data_(0),
+ debuggerState_(0)
+ {
+ setCaption(i18n("Memory view"));
+ emit captionChanged(caption());
+
+ initWidget();
+
+ if (isOk())
+ slotEnableOrDisable();
+ }
+
+ void MemoryView::initWidget()
+ {
+ QVBoxLayout *l = new QVBoxLayout(this, 0, 0);
+
+ khexedit2_widget = KHE::createBytesEditWidget(this);
+
+ bool ok_ = false;
+
+ if (khexedit2_widget)
+ {
+ QWidget* real_widget = (QWidget*)
+ khexedit2_widget->child("BytesEdit");
+
+ if (real_widget)
+ {
+ ok_ = true;
+
+ connect(real_widget, SIGNAL(bufferChanged(int, int)),
+ this, SLOT(memoryEdited(int, int)));
+
+ khexedit2_real_widget = real_widget;
+
+ QVariant resize_style(2); // full size usage.
+ real_widget->setProperty("ResizeStyle", resize_style);
+
+ //QVariant group(8);
+ //real_widget->setProperty("StartOffset", start);
+ //real_widget->setProperty("NoOfBytesPerLine", group);
+
+ // HACK: use hardcoded constant taht should match
+ // khexedit2
+ // 3 -- binary
+ // 1 -- decimal
+ // 0 -- hex
+ //QVariant coding(3);
+ //real_widget->setProperty("Coding", coding);
+
+ //QVariant gap(32);
+ //real_widget->setProperty("BinaryGapWidth", gap);
+
+ }
+ else
+ {
+ delete khexedit2_widget;
+ }
+ }
+
+ if (ok_) {
+
+ rangeSelector_ = new MemoryRangeSelector(this);
+ l->addWidget(rangeSelector_);
+
+ connect(rangeSelector_->okButton, SIGNAL(clicked()),
+ this, SLOT(slotChangeMemoryRange()));
+
+
+ connect(rangeSelector_->cancelButton, SIGNAL(clicked()),
+ this, SLOT(slotHideRangeDialog()));
+
+ connect(rangeSelector_->startAddressLineEdit,
+ SIGNAL(textChanged(const QString&)),
+ this,
+ SLOT(slotEnableOrDisable()));
+
+ connect(rangeSelector_->amountLineEdit,
+ SIGNAL(textChanged(const QString&)),
+ this,
+ SLOT(slotEnableOrDisable()));
+
+ l->addWidget(khexedit2_widget);
+
+ } else {
+
+ QTextEdit* edit = new QTextEdit(this);
+ l->addWidget(edit);
+
+ edit->setText(
+ "<h1>Not available</h1>"
+ "<p>Could not open the khexedit2 library. "
+ "Make sure that the KHexEdit package (part of kdeutils) is installed. "
+ "Specifically, check for the following files:"
+ "<ul><li>libkhexeditcommon.so.0.0.0\n"
+ "<li>libkbyteseditwidget.so\n"
+ "<li>kbyteseditwidget.desktop\n"
+ "</ul>");
+ }
+
+ }
+
+ void MemoryView::debuggerStateChanged(int state)
+ {
+ if (isOk())
+ {
+ debuggerState_ = state;
+ slotEnableOrDisable();
+ }
+ }
+
+
+ void MemoryView::slotHideRangeDialog()
+ {
+ rangeSelector_->hide();
+ }
+
+ void MemoryView::slotChangeMemoryRange()
+ {
+ controller_->addCommand(
+ new ExpressionValueCommand(
+ rangeSelector_->amountLineEdit->text(),
+ this, &MemoryView::sizeComputed));
+ }
+
+ void MemoryView::sizeComputed(const QString& size)
+ {
+ controller_->addCommand(
+ new
+ GDBCommand(
+ QString("-data-read-memory %1 x 1 1 %2")
+ .arg(rangeSelector_->startAddressLineEdit->text())
+ .arg(size).ascii(),
+ this,
+ &MemoryView::memoryRead));
+ }
+
+ void MemoryView::memoryRead(const GDBMI::ResultRecord& r)
+ {
+ const GDBMI::Value& content = r["memory"][0]["data"];
+
+ amount_ = content.size();
+
+ startAsString_ = rangeSelector_->startAddressLineEdit->text();
+ amountAsString_ = rangeSelector_->amountLineEdit->text();
+ start_ = startAsString_.toUInt(0, 0);
+
+ setCaption(QString("%1 (%2 bytes)")
+ .arg(startAsString_).arg(amount_));
+ emit captionChanged(caption());
+
+ KHE::BytesEditInterface* bytesEditor
+ = KHE::bytesEditInterface(khexedit2_widget);
+
+ delete[] this->data_;
+ this->data_ = new char[amount_];
+ for(unsigned i = 0; i < content.size(); ++i)
+ {
+ this->data_[i] = content[i].literal().toInt(0, 16);
+ }
+
+
+ bytesEditor->setData( this->data_, amount_ );
+ bytesEditor->setReadOnly(false);
+ // Overwrite data, not insert new
+ bytesEditor->setOverwriteMode( true );
+ // Not sure this is needed, but prevent
+ // inserting new data.
+ bytesEditor->setOverwriteOnly( true );
+
+ QVariant start_v(start_);
+ khexedit2_real_widget->setProperty("FirstLineOffset", start_v);
+
+ //QVariant bsw(0);
+ //khexedit2_real_widget->setProperty("ByteSpacingWidth", bsw);
+
+ // HACK: use hardcoded constant taht should match
+ // khexedit2
+ // 3 -- binary
+ // 1 -- decimal
+ // 0 -- hex
+ //QVariant coding(1);
+ //khexedit2_real_widget->setProperty("Coding", coding);
+
+
+ slotHideRangeDialog();
+ }
+
+
+ void MemoryView::memoryEdited(int start, int end)
+ {
+ for(int i = start; i <= end; ++i)
+ {
+ controller_->addCommand(
+ new GDBCommand(
+ QString("set *(char*)(%1 + %2) = %3")
+ .arg(start_)
+ .arg(i)
+ .arg(QString::number(data_[i]))));
+ }
+ }
+
+ void MemoryView::contextMenuEvent ( QContextMenuEvent * e )
+ {
+ if (!isOk())
+ return;
+
+ QPopupMenu menu;
+
+ bool app_running = !(debuggerState_ & s_appNotStarted);
+
+ int idRange = menu.insertItem(i18n("Change memory range"));
+ // If address selector is show, 'set memory range' can't
+ // do anything more.
+ menu.setItemEnabled(idRange,
+ app_running && !rangeSelector_->isShown());
+ int idReload = menu.insertItem(i18n("Reload"));
+ // If amount is zero, it means there's not data yet, so
+ // reloading does not make sense.
+ menu.setItemEnabled(idReload, app_running && amount_ != 0);
+ int idClose = menu.insertItem(i18n("Close this view"));
+
+ int result = menu.exec(e->globalPos());
+
+ if (result == idRange)
+ {
+ rangeSelector_->startAddressLineEdit->setText(startAsString_);
+ rangeSelector_->amountLineEdit->setText(amountAsString_);
+
+ rangeSelector_->show();
+ rangeSelector_->startAddressLineEdit->setFocus();
+ }
+ if (result == idReload)
+ {
+ // We use numeric start_ and amount_ stored in this,
+ // not textual startAsString_ and amountAsString_,
+ // because program position might have changes and expressions
+ // are no longer valid.
+ controller_->addCommand(
+ new
+ GDBCommand(
+ QString("-data-read-memory %1 x 1 1 %2")
+ .arg(start_).arg(amount_).ascii(),
+ this,
+ &MemoryView::memoryRead));
+ }
+
+ if (result == idClose)
+ delete this;
+
+
+ }
+
+ bool MemoryView::isOk() const
+ {
+ return khexedit2_real_widget;
+ }
+
+ void MemoryView::slotEnableOrDisable()
+ {
+ bool app_started = !(debuggerState_ & s_appNotStarted);
+
+ bool enabled_ = app_started &&
+ !rangeSelector_->startAddressLineEdit->text().isEmpty() &&
+ !rangeSelector_->amountLineEdit->text().isEmpty();
+
+ rangeSelector_->okButton->setEnabled(enabled_);
+ }
+
+
+ ViewerWidget::ViewerWidget(GDBController* controller,
+ QWidget* parent,
+ const char* name)
+ : QWidget(parent, name),
+ controller_(controller)
+ {
+ setIcon(SmallIcon("math_brace"));
+
+ QVBoxLayout *l = new QVBoxLayout(this, 0, 0);
+
+ toolBox_ = new QToolBox(this);
+ l->addWidget(toolBox_);
+ }
+
+ void ViewerWidget::slotAddMemoryView()
+ {
+ // For unclear reasons, this call, that indirectly
+ // does
+ //
+ // mainWindow()->setViewAvailable(this)
+ // mainWindow()->raiseView(this)
+ //
+ // should be done before creating the child widget.
+ // Otherwise, the child widget won't be freely resizable --
+ // there will be not-so-small minimum size.
+ // Problem exists both with KMDI and S/IDEAL.
+
+ setViewShown(true);
+
+ MemoryView* widget = new MemoryView(controller_, this);
+ toolBox_->addItem(widget, widget->caption());
+ toolBox_->setCurrentItem(widget);
+ memoryViews_.push_back(widget);
+
+ connect(widget, SIGNAL(captionChanged(const QString&)),
+ this, SLOT(slotChildCaptionChanged(const QString&)));
+
+ connect(widget, SIGNAL(destroyed(QObject*)),
+ this, SLOT(slotChildDestroyed(QObject*)));
+ }
+
+ void ViewerWidget::slotDebuggerState(const QString&, int state)
+ {
+ for(unsigned i = 0; i < memoryViews_.size(); ++i)
+ {
+ memoryViews_[i]->debuggerStateChanged(state);
+ }
+ }
+
+ void ViewerWidget::slotChildCaptionChanged(const QString& caption)
+ {
+ const QWidget* s = static_cast<const QWidget*>(sender());
+ QWidget* ncs = const_cast<QWidget*>(s);
+ QString cap = caption;
+ // Prevent intepreting '&' as accelerator specifier.
+ cap.replace("&", "&&");
+ toolBox_->setItemLabel(toolBox_->indexOf(ncs), cap);
+ }
+
+ void ViewerWidget::slotChildDestroyed(QObject* child)
+ {
+ QValueVector<MemoryView*>::iterator i, e;
+ for(i = memoryViews_.begin(), e = memoryViews_.end(); i != e; ++i)
+ {
+ if (*i == child)
+ {
+ memoryViews_.erase(i);
+ break;
+ }
+ }
+
+ if (toolBox_->count() == 0)
+ setViewShown(false);
+ }
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+}
+
+#include "memviewdlg.moc"
diff --git a/languages/cpp/debugger/memviewdlg.h b/languages/cpp/debugger/memviewdlg.h
new file mode 100644
index 00000000..a29de924
--- /dev/null
+++ b/languages/cpp/debugger/memviewdlg.h
@@ -0,0 +1,118 @@
+/***************************************************************************
+ begin : Tue Oct 5 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _MEMVIEW_H_
+#define _MEMVIEW_H_
+
+#include "mi/gdbmi.h"
+
+#include <kdialog.h>
+
+#include <qvaluevector.h>
+
+class KLineEdit;
+class QMultiLineEdit;
+class QToolBox;
+
+namespace GDBDebugger
+{
+ class MemoryView;
+ class GDBController;
+
+ class ViewerWidget : public QWidget
+ {
+ Q_OBJECT
+ public:
+ ViewerWidget(GDBController* controller,
+ QWidget* parent, const char* name);
+
+ public slots:
+ /** Adds a new memory view to *this, initially showing
+ no data. */
+ void slotAddMemoryView();
+ /** Informs *this about change in debugger state. Should always
+ be connected to, so that *this can disable itself when
+ debugger is not running. */
+ void slotDebuggerState(const QString&, int state);
+
+ signals:
+ void setViewShown(bool shown);
+
+
+ private slots:
+ void slotChildCaptionChanged(const QString& caption);
+ void slotChildDestroyed(QObject* child);
+
+ private: // Data
+ GDBController* controller_;
+ QToolBox* toolBox_;
+ QValueVector<MemoryView*> memoryViews_;
+ };
+
+ class MemoryView : public QWidget
+ {
+ Q_OBJECT
+ public:
+ MemoryView(GDBController* controller,
+ QWidget* parent, const char* name = 0);
+
+ void debuggerStateChanged(int state);
+
+ signals:
+ void captionChanged(const QString& caption);
+
+ private: // Callbacks
+ void sizeComputed(const QString& value);
+
+ void memoryRead(const GDBMI::ResultRecord& r);
+
+ private slots:
+ void memoryEdited(int start, int end);
+
+ private:
+ // Returns true is we successfully created the hexeditor, and so
+ // can work.
+ bool isOk() const;
+
+
+
+ private slots:
+ /** Invoked when user has changed memory range.
+ Gets memory for the new range. */
+ void slotChangeMemoryRange();
+ void slotHideRangeDialog();
+ void slotEnableOrDisable();
+
+ private: // QWidget overrides
+ void contextMenuEvent(QContextMenuEvent* e);
+
+ private:
+ void initWidget();
+
+ private:
+ GDBController* controller_;
+ class MemoryRangeSelector* rangeSelector_;
+ QWidget* khexedit2_widget;
+ QWidget* khexedit2_real_widget;
+
+ uint start_, amount_;
+ QString startAsString_, amountAsString_;
+ char* data_;
+
+ int debuggerState_;
+ };
+}
+
+#endif
diff --git a/languages/cpp/debugger/mi/Makefile.am b/languages/cpp/debugger/mi/Makefile.am
new file mode 100644
index 00000000..d6cdf5f7
--- /dev/null
+++ b/languages/cpp/debugger/mi/Makefile.am
@@ -0,0 +1,12 @@
+
+# We need exceptions since they are used to report all MI access errors.
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+METASOURCES = AUTO
+INCLUDES = $(all_includes)
+
+lib_LTLIBRARIES = libgdbmi_parser.la
+libgdbmi_parser_la_LDFLAGS = $(all_libraries)
+libgdbmi_parser_la_LIBADD = $(LIB_QT)
+libgdbmi_parser_la_SOURCES = gdbmi.cpp miparser.cpp milexer.cpp
+
diff --git a/languages/cpp/debugger/mi/gdbmi.cpp b/languages/cpp/debugger/mi/gdbmi.cpp
new file mode 100644
index 00000000..534a0cad
--- /dev/null
+++ b/languages/cpp/debugger/mi/gdbmi.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2005-2006 by Vladimir Prus *
+ * ghost@cs.msu.su *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "gdbmi.h"
+
+using namespace GDBMI;
+
+
+type_error::type_error()
+: std::logic_error("MI type error")
+{}
+
+QString Value::literal() const
+{
+ throw type_error();
+}
+
+int Value::toInt(int /*base*/) const
+{
+ throw type_error();
+}
+
+bool Value::hasField(const QString&) const
+{
+ throw type_error();
+}
+
+const Value& Value::operator[](const QString&) const
+{
+ throw type_error();
+}
+
+bool Value::empty() const
+{
+ throw type_error();
+}
+
+unsigned Value::size() const
+{
+ throw type_error();
+}
+
+
+const Value& Value::operator[](unsigned) const
+{
+ throw type_error();
+}
+
+QString StringLiteralValue::literal() const
+{
+ return literal_;
+}
+
+int StringLiteralValue::toInt(int base) const
+{
+ bool ok;
+ int result = literal_.toInt(&ok, base);
+ if (!ok)
+ throw type_error();
+ return result;
+}
+
+TupleValue::~TupleValue()
+{
+ for (QValueListIterator<Result*> it=results.begin(); it!=results.end(); ++it)
+ delete *it;
+}
+
+bool TupleValue::hasField(const QString& variable) const
+{
+ return results_by_name.count(variable);
+}
+
+const Value& TupleValue::operator[](const QString& variable) const
+{
+ if (results_by_name.count(variable))
+ return *results_by_name[variable]->value;
+ else
+ throw type_error();
+}
+
+ListValue::~ListValue()
+{
+ for (QValueListIterator<Result*> it=results.begin(); it!=results.end(); ++it)
+ delete *it;
+}
+
+bool ListValue::empty() const
+{
+ return results.isEmpty();
+}
+
+unsigned ListValue::size() const
+{
+ return results.size();
+}
+
+const Value& ListValue::operator[](unsigned index) const
+{
+ if (index < results.size())
+ {
+ return *results[index]->value;
+ }
+ else
+ throw type_error();
+}
+
+
+
+
diff --git a/languages/cpp/debugger/mi/gdbmi.h b/languages/cpp/debugger/mi/gdbmi.h
new file mode 100644
index 00000000..7a193e91
--- /dev/null
+++ b/languages/cpp/debugger/mi/gdbmi.h
@@ -0,0 +1,221 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2005-2006 by Vladimir Prus *
+ * ghost@cs.msu.su *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef GDBMI_H
+#define GDBMI_H
+
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+
+#include <stdexcept>
+
+/**
+@author Roberto Raggi
+@author Vladimir Prus
+*/
+namespace GDBMI
+{
+ /** Exception that is thrown when we're trying to invoke an
+ operation that is not supported by specific MI value. For
+ example, trying to index a string literal.
+
+ Such errors are conceptually the same as assert, but in GUI
+ we can't use regular assert, and Q_ASSERT, which only prints
+ a message, is not suitable either. We need to break processing,
+ and the higher-level code can report "Internal parsing error",
+ or something.
+
+ Being glorified assert, this exception does not cary any
+ useful information.
+ */
+ class type_error : public std::logic_error
+ {
+ public:
+ type_error();
+ };
+
+ /** Base class for all MI values.
+ MI values are of three kinds:
+ - String literals
+ - Lists (indexed by integer)
+ - Tuple (set of named values, indexed by name)
+
+ The structure of response to a specific gdb command is fixed.
+ While any tuples in response may omit certain named fields, the
+ kind of each item never changes. That is, response to specific
+ command can't contains sometimes string and sometimes tuple in
+ specific position.
+
+ Because of that static structure, it's almost never needed to query
+ dynamic type of a MI value. Most often we know it's say, tuple, and
+ can subscripts it.
+
+ So, the Value class has methods for accessing all kinds of values.
+ Attempting to call a method that is not applicable to specific value
+ will result in exception. The client code will almost never need to
+ cast from 'Value' to its derived classes.
+
+ Note also that all methods in this class are const and return
+ const Value&. That's by design -- there's no need to modify gdb
+ responses in GUI.
+ */
+ struct Value
+ {
+ Value() {}
+ private: // Copy disabled to prevent slicing.
+ Value(const Value&);
+ Value& operator=(const Value&);
+
+ public:
+
+ virtual ~Value() {}
+
+ enum { StringLiteral, Tuple, List } kind;
+
+ /** If this value is a string literals, returns the string value.
+ Othewise, throws type_error.
+ */
+ virtual QString literal() const;
+
+ /** If the value is a string literal, converts it to int and
+ returns. If conversion fails, or the value cannot be
+ converted to int, throws type_error.
+ */
+ virtual int toInt(int base = 10) const;
+
+ /** If this value is a tuple, returns true if the tuple
+ has a field named 'variable'. Otherwise,
+ throws type_error.
+ */
+ virtual bool hasField(const QString& variable) const;
+
+ /** If this value is a tuple, and contains named field 'variable',
+ returns it. Otherwise, throws 'type_error'.
+ This method is virtual, and derived in base class, so that
+ we can save on casting, when we know for sure that instance
+ is TupleValue, or ListValue.
+ */
+ virtual const Value& operator[](const QString& variable) const;
+
+ /** If this value is a list, returns true if the list is empty.
+ If this value is not a list, throws 'type_error'.
+ */
+ virtual bool empty() const;
+
+ /** If this value is a list, returns it's size.
+ Otherwise, throws 'type_error'.
+ */
+ virtual unsigned size() const;
+
+ /** If this value is a list, returns the element at
+ 'index'. Otherwise, throws 'type_error'.
+ */
+ virtual const Value& operator[](unsigned index) const;
+ };
+
+ /** @internal
+ Internal class to represent name-value pair in tuples.
+ */
+ struct Result
+ {
+ Result() : value(0) {}
+ ~Result() { delete value; value = 0; }
+
+ QString variable;
+ Value *value;
+ };
+
+ struct StringLiteralValue : public Value
+ {
+ StringLiteralValue(const QString &lit)
+ : literal_(lit) { Value::kind = StringLiteral; }
+
+ public: // Value overrides
+
+ QString literal() const;
+ int toInt(int base) const;
+
+ private:
+ QString literal_;
+ };
+
+ struct TupleValue : public Value
+ {
+ TupleValue() { Value::kind = Tuple; }
+ ~TupleValue();
+
+ bool hasField(const QString&) const;
+ const Value& operator[](const QString& variable) const;
+
+
+ QValueList<Result*> results;
+ QMap<QString, GDBMI::Result*> results_by_name;
+ };
+
+ struct ListValue : public Value
+ {
+ ListValue() { Value::kind = List; }
+ ~ListValue();
+
+ bool empty() const;
+
+ unsigned size() const;
+
+ const Value& operator[](unsigned index) const;
+
+ QValueList<Result*> results;
+
+ };
+
+ struct Record
+ {
+ virtual ~Record() {}
+ virtual QString toString() const { Q_ASSERT( 0 ); return QString::null; }
+
+ enum { Prompt, Stream, Result } kind;
+ };
+
+ struct ResultRecord : public Record, public TupleValue
+ {
+ ResultRecord() { Record::kind = Result; }
+
+ QString reason;
+ };
+
+ struct PromptRecord : public Record
+ {
+ inline PromptRecord() { Record::kind = Prompt; }
+
+ virtual QString toString() const
+ { return "(prompt)\n"; }
+ };
+
+ struct StreamRecord : public Record
+ {
+ inline StreamRecord() : reason(0) { Record::kind = Stream; }
+
+ char reason;
+ QString message;
+ };
+}
+
+#endif
diff --git a/languages/cpp/debugger/mi/milexer.cpp b/languages/cpp/debugger/mi/milexer.cpp
new file mode 100644
index 00000000..ecf18373
--- /dev/null
+++ b/languages/cpp/debugger/mi/milexer.cpp
@@ -0,0 +1,290 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "milexer.h"
+#include "tokens.h"
+#include <cctype>
+#include <iostream>
+
+bool MILexer::s_initialized = false;
+scan_fun_ptr MILexer::s_scan_table[];
+
+
+MILexer::MILexer()
+{
+ if (!s_initialized)
+ setupScanTable();
+}
+
+MILexer::~MILexer()
+{
+}
+
+void MILexer::setupScanTable()
+{
+ s_initialized = true;
+
+ for (int i=0; i<128; ++i) {
+ switch (i) {
+ case '\n':
+ s_scan_table[i] = &MILexer::scanNewline;
+ break;
+
+ case '"':
+ s_scan_table[i] = &MILexer::scanStringLiteral;
+ break;
+
+ default:
+ if (isspace(i))
+ s_scan_table[i] = &MILexer::scanWhiteSpaces;
+ else if (isalpha(i) || i == '_')
+ s_scan_table[i] = &MILexer::scanIdentifier;
+ else if (isdigit(i))
+ s_scan_table[i] = &MILexer::scanNumberLiteral;
+ else
+ s_scan_table[i] = &MILexer::scanChar;
+ }
+ }
+
+ s_scan_table[128] = &MILexer::scanUnicodeChar;
+}
+
+/*
+
+ m_firstToken = m_tokens.data();
+ m_currentToken = 0;
+
+ m_firstToken = m_tokens.data();
+ m_currentToken = m_firstToken;
+ */
+
+TokenStream *MILexer::tokenize(const FileSymbol *fileSymbol)
+{
+ m_tokensCount = 0;
+ m_tokens.resize(64);
+
+ m_contents = fileSymbol->contents;
+ m_length = m_contents.length();
+ m_ptr = 0;
+
+ m_lines.resize(8);
+ m_line = 0;
+
+ m_lines[m_line++] = 0;
+
+ m_cursor = 0;
+
+ // tokenize
+ int pos, len;
+
+ for (;;) {
+ if (m_tokensCount == (int)m_tokens.size())
+ m_tokens.resize(m_tokensCount * 2);
+
+ Token &tk = m_tokens[m_tokensCount++];
+ tk.kind = nextToken(pos, len);
+ tk.position = pos;
+ tk.length = len;
+
+ if (tk.kind == 0)
+ break;
+ }
+
+ TokenStream *tokenStream = new TokenStream;
+ tokenStream->m_contents = m_contents;
+
+ tokenStream->m_lines = m_lines;
+ tokenStream->m_line = m_line;
+
+ tokenStream->m_tokens = m_tokens;
+ tokenStream->m_tokensCount = m_tokensCount;
+
+ tokenStream->m_firstToken = tokenStream->m_tokens.data();
+ tokenStream->m_currentToken = tokenStream->m_firstToken;;
+
+ tokenStream->m_cursor = m_cursor;
+
+ return tokenStream;
+}
+
+int MILexer::nextToken(int &pos, int &len)
+{
+ int start = 0;
+ int kind = 0;
+ unsigned char ch = 0;
+
+ while (m_ptr < m_length) {
+ start = m_ptr;
+
+ ch = (unsigned char)m_contents[m_ptr];
+ (this->*s_scan_table[ch < 128 ? ch : 128])(&kind);
+
+ switch (kind) {
+ case Token_whitespaces:
+ case '\n':
+ break;
+
+ default:
+ pos = start;
+ len = m_ptr - start;
+ return kind;
+ }
+
+ if (kind == 0)
+ break;
+ }
+
+ return 0;
+}
+
+void MILexer::scanChar(int *kind)
+{
+ *kind = m_contents[m_ptr++];
+}
+
+void MILexer::scanWhiteSpaces(int *kind)
+{
+ *kind = Token_whitespaces;
+
+ char ch;
+ while (m_ptr < m_length) {
+ ch = m_contents[m_ptr];
+ if (!(isspace(ch) && ch != '\n'))
+ break;
+
+ ++m_ptr;
+ }
+}
+
+void MILexer::scanNewline(int *kind)
+{
+ if (m_line == (int)m_lines.size())
+ m_lines.resize(m_lines.size() * 2);
+
+ if (m_lines.at(m_line) < m_ptr)
+ m_lines[m_line++] = m_ptr;
+
+ *kind = m_contents[m_ptr++];
+}
+
+void MILexer::scanUnicodeChar(int *kind)
+{
+ *kind = m_contents[m_ptr++];
+}
+
+void MILexer::scanStringLiteral(int *kind)
+{
+ ++m_ptr;
+ while (char c = m_contents[m_ptr]) {
+ switch (c) {
+ case '\n':
+ // ### error
+ *kind = Token_string_literal;
+ return;
+ case '\\':
+ {
+ char next = m_contents.at(m_ptr+1);
+ if (next == '"' || next == '\\')
+ m_ptr += 2;
+ else
+ ++m_ptr;
+ }
+ break;
+ case '"':
+ ++m_ptr;
+ *kind = Token_string_literal;
+ return;
+ default:
+ ++m_ptr;
+ break;
+ }
+ }
+
+ // ### error
+ *kind = Token_string_literal;
+}
+
+void MILexer::scanIdentifier(int *kind)
+{
+ char ch;
+ while (m_ptr < m_length) {
+ ch = m_contents[m_ptr];
+ if (!(isalnum(ch) || ch == '-' || ch == '_'))
+ break;
+
+ ++m_ptr;
+ }
+
+ *kind = Token_identifier;
+}
+
+void MILexer::scanNumberLiteral(int *kind)
+{
+ char ch;
+ while (m_ptr < m_length) {
+ ch = m_contents[m_ptr];
+ if (!(isalnum(ch) || ch == '.'))
+ break;
+
+ ++m_ptr;
+ }
+
+ // ### finish to implement me!!
+ *kind = Token_number_literal;
+}
+
+void TokenStream::positionAt(int position, int *line, int *column) const
+{
+ if (!(line && column && !m_lines.isEmpty()))
+ return;
+
+ int first = 0;
+ int len = m_line;
+ int half;
+ int middle;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+
+ middle += half;
+
+ if (m_lines[middle] < position) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ else
+ len = half;
+ }
+
+ *line = QMAX(first - 1, 0);
+ *column = position - m_lines.at(*line);
+
+ Q_ASSERT( *column >= 0 );
+}
+
+QCString TokenStream::tokenText(int index) const
+{
+ Token *t = index < 0 ? m_currentToken : m_firstToken + index;
+ const char* data = m_contents;
+ return QCString(data + t->position, t->length+1);
+}
+
diff --git a/languages/cpp/debugger/mi/milexer.h b/languages/cpp/debugger/mi/milexer.h
new file mode 100644
index 00000000..bc0deead
--- /dev/null
+++ b/languages/cpp/debugger/mi/milexer.h
@@ -0,0 +1,147 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef MILEXER_H
+#define MILEXER_H
+
+#include <qmemarray.h>
+#include <qmap.h>
+#include <qstring.h>
+
+class MILexer;
+class TokenStream;
+
+typedef void (MILexer::*scan_fun_ptr)(int *kind);
+
+struct Token
+{
+ int kind;
+ int position;
+ int length;
+};
+
+struct FileSymbol
+{
+ QCString contents;
+ TokenStream *tokenStream;
+
+ inline FileSymbol()
+ : tokenStream(0) {}
+
+ inline ~FileSymbol();
+};
+
+struct TokenStream
+{
+ inline int lookAhead(int n = 0) const
+ { return (m_currentToken + n)->kind; }
+
+ inline int currentToken() const
+ { return m_currentToken->kind; }
+
+ inline QCString currentTokenText() const
+ { return tokenText(-1); }
+
+ QCString tokenText(int index = 0) const;
+
+ inline int lineOffset(int line) const
+ { return m_lines.at(line); }
+
+ void positionAt(int position, int *line, int *column) const;
+
+ inline void getTokenStartPosition(int index, int *line, int *column) const
+ { positionAt((m_firstToken + index)->position, line, column); }
+
+ inline void getTokenEndPosition(int index, int *line, int *column) const
+ {
+ Token *tk = m_firstToken + index;
+ positionAt(tk->position + tk->length, line, column);
+ }
+
+ inline void rewind(int index)
+ { m_currentToken = m_firstToken + index; }
+
+ inline int cursor() const
+ { return m_currentToken - m_firstToken; }
+
+ inline void nextToken()
+ { m_currentToken++; m_cursor++; }
+
+//private:
+ QCString m_contents;
+
+ QMemArray<int> m_lines;
+ int m_line;
+
+ QMemArray<Token> m_tokens;
+ int m_tokensCount;
+
+ Token *m_firstToken;
+ Token *m_currentToken;
+
+ int m_cursor;
+};
+
+class MILexer
+{
+public:
+ MILexer();
+ ~MILexer();
+
+ TokenStream *tokenize(const FileSymbol *fileSymbol);
+
+private:
+ int nextToken(int &position, int &len);
+
+ void scanChar(int *kind);
+ void scanUnicodeChar(int *kind);
+ void scanNewline(int *kind);
+ void scanWhiteSpaces(int *kind);
+ void scanStringLiteral(int *kind);
+ void scanNumberLiteral(int *kind);
+ void scanIdentifier(int *kind);
+
+ void setupScanTable();
+
+private:
+ static bool s_initialized;
+ static scan_fun_ptr s_scan_table[128 + 1];
+
+ QCString m_contents;
+ int m_ptr;
+ // Cached 'm_contents.length()'
+ int m_length;
+
+ QMemArray<int> m_lines;
+ int m_line;
+
+ QMemArray<Token> m_tokens;
+ int m_tokensCount;
+
+ int m_cursor;
+};
+
+inline FileSymbol::~FileSymbol()
+{
+ delete tokenStream;
+ tokenStream = 0;
+}
+
+
+#endif
diff --git a/languages/cpp/debugger/mi/miparser.cpp b/languages/cpp/debugger/mi/miparser.cpp
new file mode 100644
index 00000000..876bfa47
--- /dev/null
+++ b/languages/cpp/debugger/mi/miparser.cpp
@@ -0,0 +1,345 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2005-2006 by Vladimir Prus *
+ * ghost@cs.msu.su *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "miparser.h"
+#include "tokens.h"
+#include <memory>
+
+using namespace GDBMI;
+
+#define MATCH(tok) \
+ do { \
+ if (lex->lookAhead(0) != (tok)) \
+ return false; \
+ } while (0)
+
+#define ADVANCE(tok) \
+ do { \
+ MATCH(tok); \
+ lex->nextToken(); \
+ } while (0)
+
+MIParser::MIParser()
+ : lex(0)
+{
+}
+
+MIParser::~MIParser()
+{
+}
+
+Record *MIParser::parse(FileSymbol *file)
+{
+ lex = 0;
+
+ Record *record = 0;
+
+ TokenStream *tokenStream = lexer.tokenize(file);
+ if (!tokenStream)
+ return false;
+
+ lex = file->tokenStream = tokenStream;
+
+ switch (lex->lookAhead()) {
+ case '~':
+ case '@':
+ case '&':
+ parseStreamRecord(record);
+ break;
+ case '(':
+ parsePrompt(record);
+ break;
+ case '^':
+ parseResultRecord(record);
+ break;
+ case '*':
+ // Same as result, only differs in start
+ // marker.
+ parseResultRecord(record);
+ break;
+ default:
+ break;
+ }
+
+ return record;
+}
+
+bool MIParser::parsePrompt(Record *&record)
+{
+ ADVANCE('(');
+ MATCH(Token_identifier);
+ if (lex->currentTokenText() != "gdb")
+ return false;
+ lex->nextToken();
+ ADVANCE(')');
+
+ record = new PromptRecord;
+ return true;
+}
+
+bool MIParser::parseStreamRecord(Record *&record)
+{
+ std::auto_ptr<StreamRecord> stream(new StreamRecord);
+
+ switch (lex->lookAhead()) {
+ case '~':
+ case '@':
+ case '&': {
+ stream->reason = lex->lookAhead();
+ lex->nextToken();
+ MATCH(Token_string_literal);
+ stream->message = parseStringLiteral();
+ record = stream.release();
+ }
+ return true;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+bool MIParser::parseResultRecord(Record *&record)
+{
+ if (lex->lookAhead() != '^' && lex->lookAhead() != '*')
+ return false;
+ lex->nextToken();
+
+ MATCH(Token_identifier);
+ QString reason = lex->currentTokenText();
+ lex->nextToken();
+
+ std::auto_ptr<ResultRecord> res(new ResultRecord);
+ res->reason = reason;
+
+ if (lex->lookAhead() != ',') {
+ record = res.release();
+ return true;
+ }
+
+ lex->nextToken();
+
+ if (!parseCSV(*res))
+ return false;
+
+ record = res.release();
+ return true;
+}
+
+bool MIParser::parseResult(Result *&result)
+{
+ MATCH(Token_identifier);
+ QString variable = lex->currentTokenText();
+ lex->nextToken();
+
+ std::auto_ptr<Result> res(new Result);
+ res->variable = variable;
+
+ if (lex->lookAhead() != '=')
+ return true;
+
+ lex->nextToken();
+
+ Value *value = 0;
+ if (!parseValue(value))
+ return false;
+
+ res->value = value;
+ result = res.release();
+
+ return true;
+}
+
+bool MIParser::parseValue(Value *&value)
+{
+ value = 0;
+
+ switch (lex->lookAhead()) {
+ case Token_string_literal: {
+ value = new StringLiteralValue(parseStringLiteral());
+ }
+ return true;
+
+ case '{':
+ return parseTuple(value);
+
+ case '[':
+ return parseList(value);
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+bool MIParser::parseTuple(Value *&value)
+{
+ TupleValue* val;
+
+ if (!parseCSV(&val, '{', '}'))
+ return false;
+
+ value = val;
+ return true;
+}
+
+bool MIParser::parseList(Value *&value)
+{
+ ADVANCE('[');
+
+ std::auto_ptr<ListValue> lst(new ListValue);
+
+ // Note: can't use parseCSV here because of nested
+ // "is this Value or Result" guessing. Too lazy to factor
+ // that out too using function pointers.
+ int tok = lex->lookAhead();
+ while (tok && tok != ']') {
+ Result *result = 0;
+ Value *val = 0;
+
+ if (tok == Token_identifier)
+ {
+ if (!parseResult(result))
+ return false;
+ }
+ else if (!parseValue(val))
+ return false;
+
+ Q_ASSERT(result || val);
+
+ if (!result) {
+ result = new Result;
+ result->value = val;
+ }
+ lst->results.append(result);
+
+ if (lex->lookAhead() == ',')
+ lex->nextToken();
+
+ tok = lex->lookAhead();
+ }
+ ADVANCE(']');
+
+ value = lst.release();
+
+ return true;
+}
+
+bool MIParser::parseCSV(TupleValue** value,
+ char start, char end)
+{
+ std::auto_ptr<TupleValue> tuple(new TupleValue);
+
+ if (!parseCSV(*tuple, start, end))
+ return false;
+
+ *value = tuple.get();
+ tuple.release();
+ return true;
+}
+
+bool MIParser::parseCSV(GDBMI::TupleValue& value,
+ char start, char end)
+{
+ if (start)
+ ADVANCE(start);
+
+ int tok = lex->lookAhead();
+ while (tok) {
+ if (end && tok == end)
+ break;
+
+ Result *result;
+ if (!parseResult(result))
+ return false;
+
+ value.results.append(result);
+ value.results_by_name.insert(result->variable, result);
+
+ if (lex->lookAhead() == ',')
+ lex->nextToken();
+
+ tok = lex->lookAhead();
+ }
+
+ if (end)
+ ADVANCE(end);
+
+ return true;
+}
+
+
+QString MIParser::parseStringLiteral()
+{
+ QCString message = lex->currentTokenText();
+
+ unsigned int length = message.length();
+ QString message2;
+ message2.setLength(length);
+ // The [1,length-1] range removes quotes without extra
+ // call to 'mid'
+ unsigned target_index = 0;
+ for(unsigned i = 1, e = length-1; i != e; ++i)
+ {
+ int translated = -1;
+ if (message[i] == '\\')
+ {
+ if (i+1 < length)
+ {
+ // TODO: implement all the other escapes, maybe
+ if (message[i+1] == 'n')
+ {
+ translated = '\n';
+ }
+ else if (message[i+1] == '\\')
+ {
+ translated = '\\';
+ }
+ else if (message[i+1] == '"')
+ {
+ translated = '"';
+ }
+ else if (message[i+1] == 't')
+ {
+ translated = '\t';
+ }
+
+ }
+ }
+
+ if (translated != -1)
+ {
+ message2[target_index++] = (char)translated;
+ ++i;
+ }
+ else
+ {
+ message2[target_index++] = message[i];
+ }
+ }
+ message2.setLength(target_index);
+
+ lex->nextToken();
+ return message2;
+}
+
diff --git a/languages/cpp/debugger/mi/miparser.h b/languages/cpp/debugger/mi/miparser.h
new file mode 100644
index 00000000..524dba7c
--- /dev/null
+++ b/languages/cpp/debugger/mi/miparser.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef MIPARSER_H
+#define MIPARSER_H
+
+#include "milexer.h"
+#include "gdbmi.h"
+
+#include <qstring.h>
+#include <qvaluelist.h>
+
+/**
+@author Roberto Raggi
+*/
+class MIParser
+{
+public:
+ MIParser();
+ ~MIParser();
+
+ GDBMI::Record *parse(FileSymbol *file);
+
+protected: // rules
+ bool parseResultRecord(GDBMI::Record *&record);
+ bool parsePrompt(GDBMI::Record *&record);
+ bool parseStreamRecord(GDBMI::Record *&record);
+
+ bool parseResult(GDBMI::Result *&result);
+ bool parseValue(GDBMI::Value *&value);
+ bool parseTuple(GDBMI::Value *&value);
+ bool parseList(GDBMI::Value *&value);
+
+ /** Creates new TupleValue object, writes its address
+ into *value, parses a comma-separated set of values,
+ and adds each new value into (*value)->results.
+ If 'start' and 'end' are not zero, they specify
+ start and end delimiter of the list.
+ Parsing stops when we see 'end' character, or, if
+ 'end' is zero, at the end of input.
+ */
+ bool parseCSV(GDBMI::TupleValue** value,
+ char start = 0, char end = 0);
+
+ /** @overload
+ Same as above, but writes into existing tuple.
+ */
+ bool parseCSV(GDBMI::TupleValue& value,
+ char start = 0, char end = 0);
+
+
+ /** Parses a string literal and returns it. Advances
+ the lexer past the literal. Processes C escape sequences
+ in the string.
+ @pre lex->lookAhead(0) == Token_string_literal
+ */
+ QString parseStringLiteral();
+
+
+
+private:
+ MILexer lexer;
+ TokenStream *lex;
+};
+
+#endif
diff --git a/languages/cpp/debugger/mi/tokens.h b/languages/cpp/debugger/mi/tokens.h
new file mode 100644
index 00000000..c9ab283d
--- /dev/null
+++ b/languages/cpp/debugger/mi/tokens.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef TOKENS_H
+#define TOKENS_H
+
+enum Type
+{
+ Token_eof = 0,
+ Token_identifier = 1000,
+ Token_number_literal,
+ Token_string_literal,
+ Token_whitespaces
+};
+
+#endif
+
diff --git a/languages/cpp/debugger/stty.cpp b/languages/cpp/debugger/stty.cpp
new file mode 100644
index 00000000..f0bc2627
--- /dev/null
+++ b/languages/cpp/debugger/stty.cpp
@@ -0,0 +1,386 @@
+/***************************************************************************
+ begin : Mon Sep 13 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ This code was originally written by Judin Maxim, from the
+ KDEStudio project.
+
+ It was then updated with later code from konsole (KDE).
+
+ It has also been enhanced with an idea from the code in kdbg
+ written by Johannes Sixt<Johannes.Sixt@telecom.at>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef __osf__
+#define _XOPEN_SOURCE_EXTENDED
+#define O_NDELAY O_NONBLOCK
+#endif
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#ifdef HAVE_SYS_STROPTS_H
+#include <sys/stropts.h>
+#define _NEW_TTY_CTRL
+#endif
+
+#include <assert.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <termios.h>
+#include <time.h>
+#include <unistd.h>
+#include <errno.h>
+
+#if defined (_HPUX_SOURCE)
+#define _TERMIOS_INCLUDED
+#include <bsdtty.h>
+#endif
+
+#include <qintdict.h>
+#include <qsocketnotifier.h>
+#include <qstring.h>
+#include <qfile.h>
+
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+
+#include "stty.h"
+
+#define PTY_FILENO 3
+#define BASE_CHOWN "konsole_grantpty"
+
+namespace GDBDebugger
+{
+
+static int chownpty(int fd, int grant)
+// param fd: the fd of a master pty.
+// param grant: 1 to grant, 0 to revoke
+// returns 1 on success 0 on fail
+{
+ void(*tmp)(int) = signal(SIGCHLD,SIG_DFL);
+ pid_t pid = fork();
+ if (pid < 0) {
+ signal(SIGCHLD,tmp);
+ return 0;
+ }
+ if (pid == 0) {
+ /* We pass the master pseudo terminal as file descriptor PTY_FILENO. */
+ if (fd != PTY_FILENO && dup2(fd, PTY_FILENO) < 0)
+ ::exit(1);
+
+ QString path = locate("exe", BASE_CHOWN);
+ execle(QFile::encodeName(path), BASE_CHOWN, grant?"--grant":"--revoke", (void *)0, NULL);
+ ::exit(1); // should not be reached
+ }
+ if (pid > 0) {
+ int w;
+ // retry:
+ int rc = waitpid (pid, &w, 0);
+ if (rc != pid)
+ ::exit(1);
+
+ // { // signal from other child, behave like catchChild.
+ // // guess this gives quite some control chaos...
+ // Shell* sh = shells.find(rc);
+ // if (sh) { shells.remove(rc); sh->doneShell(w); }
+ // goto retry;
+ // }
+ signal(SIGCHLD,tmp);
+ return (rc != -1 && WIFEXITED(w) && WEXITSTATUS(w) == 0);
+ }
+ signal(SIGCHLD,tmp);
+ return 0; //dummy.
+}
+
+// **************************************************************************
+
+STTY::STTY(bool ext, const QString &termAppName)
+ : QObject(),
+ out(0),
+ ttySlave(""),
+ pid_(0),
+ external_(ext)
+{
+ if (ext) {
+ findExternalTTY(termAppName);
+ } else {
+ fout = findTTY();
+ if (fout >= 0) {
+ ttySlave = QString(tty_slave);
+ out = new QSocketNotifier(fout, QSocketNotifier::Read, this);
+ connect( out, SIGNAL(activated(int)), this, SLOT(OutReceived(int)) );
+ }
+ }
+}
+
+// **************************************************************************
+
+STTY::~STTY()
+{
+ if (pid_)
+ ::kill(pid_, SIGTERM);
+
+ if (out) {
+ ::close(fout);
+ delete out;
+ }
+}
+
+// **************************************************************************
+
+int STTY::findTTY()
+{
+ int ptyfd = -1;
+ bool needGrantPty = TRUE;
+
+ // Find a master pty that we can open ////////////////////////////////
+
+#ifdef __sgi__
+ ptyfd = open("/dev/ptmx",O_RDWR);
+ if (ptyfd < 0) {
+ perror("Can't open a pseudo teletype");
+ return(-1);
+ }
+ strncpy(tty_slave, ptsname(ptyfd), 50);
+ grantpt(ptyfd);
+ unlockpt(ptyfd);
+ needGrantPty = FALSE;
+#endif
+
+ // first we try UNIX PTY's
+#ifdef TIOCGPTN
+ strcpy(pty_master,"/dev/ptmx");
+ strcpy(tty_slave,"/dev/pts/");
+ ptyfd = open(pty_master,O_RDWR);
+ if (ptyfd >= 0) { // got the master pty
+ int ptyno;
+ if (ioctl(ptyfd, TIOCGPTN, &ptyno) == 0) {
+ struct stat sbuf;
+ sprintf(tty_slave,"/dev/pts/%d",ptyno);
+ if (stat(tty_slave,&sbuf) == 0 && S_ISCHR(sbuf.st_mode))
+ needGrantPty = FALSE;
+ else {
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ } else {
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ }
+#endif
+
+#if defined(_SCO_DS) || defined(__USLC__) /* SCO OSr5 and UnixWare */
+ if (ptyfd < 0) {
+ for (int idx = 0; idx < 256; idx++)
+ { sprintf(pty_master, "/dev/ptyp%d", idx);
+ sprintf(tty_slave, "/dev/ttyp%d", idx);
+ if (access(tty_slave, F_OK) < 0) { idx = 256; break; }
+ if ((ptyfd = open (pty_master, O_RDWR)) >= 0)
+ { if (access (tty_slave, R_OK|W_OK) == 0) break;
+ close(ptyfd); ptyfd = -1;
+ }
+ }
+ }
+#endif
+ if (ptyfd < 0) { /// \FIXME Linux, Trouble on other systems?
+ for (const char* s3 = "pqrstuvwxyzabcde"; *s3 != 0; s3++) {
+ for (const char* s4 = "0123456789abcdef"; *s4 != 0; s4++) {
+ sprintf(pty_master,"/dev/pty%c%c",*s3,*s4);
+ sprintf(tty_slave,"/dev/tty%c%c",*s3,*s4);
+ if ((ptyfd = open(pty_master, O_RDWR)) >= 0) {
+ if (geteuid() == 0 || access(tty_slave, R_OK|W_OK) == 0)
+ break;
+
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ }
+
+ if (ptyfd >= 0)
+ break;
+ }
+ }
+
+ if (ptyfd >= 0) {
+ if (needGrantPty && !chownpty(ptyfd, TRUE)) {
+ fprintf(stderr,"kdevelop: chownpty failed for device %s::%s.\n",pty_master,tty_slave);
+ fprintf(stderr," : This means the session can be eavesdroped.\n");
+ fprintf(stderr," : Make sure konsole_grantpty is installed and setuid root.\n");
+ }
+
+ ::fcntl(ptyfd, F_SETFL, O_NDELAY);
+#ifdef TIOCSPTLCK
+ int flag = 0;
+ ioctl(ptyfd, TIOCSPTLCK, &flag); // unlock pty
+#endif
+ }
+
+ return ptyfd;
+}
+
+// **************************************************************************
+
+void STTY::OutReceived(int f)
+{
+ char buf[1024];
+ int n;
+
+ // read until socket is empty. We shouldn't be receiving a continuous
+ // stream of data, so the loop is unlikely to cause problems.
+ while ((n = ::read(f, buf, sizeof(buf)-1)) > 0) {
+ *(buf+n) = 0; // a standard string
+ emit OutOutput(buf);
+ }
+ // Note: for some reason, n can be 0 here.
+ // I can understand that non-blocking read returns 0,
+ // but I don't understand how OutRecieved can be even
+ // called when there's no input.
+ if (n == 0 /* eof */
+ || (n == -1 && errno != EAGAIN))
+ {
+ // Found eof or error. Disable socket notifier, otherwise Qt
+ // will repeatedly call this method, eating CPU
+ // cycles.
+ out->setEnabled(false);
+ }
+
+}
+
+void STTY::readRemaining()
+{
+ if (!external_)
+ OutReceived(fout);
+}
+
+// **************************************************************************
+
+#define FIFO_FILE "/tmp/debug_tty.XXXXXX"
+
+bool STTY::findExternalTTY(const QString &termApp)
+{
+ QString appName(termApp.isEmpty() ? QString("xterm") : termApp);
+
+ if ( KStandardDirs::findExe( termApp ).isEmpty() )
+ {
+ return false;
+ }
+
+ char fifo[] = FIFO_FILE;
+ int fifo_fd;
+ if ((fifo_fd = mkstemp(fifo)) == -1)
+ return false;
+
+ ::close(fifo_fd);
+ ::unlink(fifo);
+
+ // create a fifo that will pass in the tty name
+#ifdef HAVE_MKFIFO
+ if (::mkfifo(fifo, S_IRUSR|S_IWUSR) < 0)
+#else
+ if (::mknod(fifo, S_IFIFO | S_IRUSR|S_IWUSR, 0) < 0)
+#endif
+ return false;
+
+ int pid = ::fork();
+ if (pid < 0) { // No process
+ ::unlink(fifo);
+ return false;
+ }
+
+ if (pid == 0) { // child process
+ /*
+ * Spawn a console that in turn runs a shell script that passes us
+ * back the terminal name and then only sits and waits.
+ */
+
+ const char* prog = appName.latin1();
+ QString script = QString("tty>") + QString(fifo) +
+ QString(";" // fifo name
+ "trap \"\" INT QUIT TSTP;" // ignore various signals
+ "exec<&-;exec>&-;" // close stdin and stdout
+ "while :;do sleep 3600;done");
+ const char* scriptStr = script.latin1();
+ const char* end = 0;
+
+ if ( termApp == "konsole" )
+ {
+ ::execlp( prog, prog,
+ "-caption", i18n("kdevelop: Debug application console").local8Bit().data(),
+ "-e", "sh",
+ "-c", scriptStr,
+ end);
+ }
+ else
+ {
+ ::execlp( prog, prog,
+ "-e", "sh",
+ "-c", scriptStr,
+ end);
+ }
+
+ // Should not get here, as above should always work
+ ::exit(1);
+ }
+
+ // parent process
+ if (pid <= 0)
+ ::exit(1);
+
+ // Open the communication between us (the parent) and the
+ // child (the process running on a tty console)
+ fifo_fd = ::open(fifo, O_RDONLY);
+ if (fifo_fd < 0)
+ return false;
+
+ // Get the ttyname from the fifo buffer that the child process
+ // has sent.
+ char ttyname[50];
+ int n = ::read(fifo_fd, ttyname, sizeof(ttyname)-sizeof(char));
+
+ ::close(fifo_fd);
+ ::unlink(fifo);
+
+ // No name??
+ if (n <= 0)
+ return false;
+
+ // remove whitespace
+ ttyname[n] = 0;
+ if (char* newline = strchr(ttyname, '\n'))
+ *newline = 0; // clobber the new line
+
+ ttySlave = ttyname;
+ pid_ = pid;
+
+ return true;
+}
+
+}
+
+// **************************************************************************
+#include "stty.moc"
diff --git a/languages/cpp/debugger/stty.h b/languages/cpp/debugger/stty.h
new file mode 100644
index 00000000..639e8417
--- /dev/null
+++ b/languages/cpp/debugger/stty.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ begin : Mon Sep 13 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ This code was originally written by Judin Maxim, from the
+ KDEStudio project.
+
+ It was then updated with later code from konsole (KDE).
+
+ It has also been enhanced with an idea from the code in kdbg
+ written by Johannes Sixt<Johannes.Sixt@telecom.at>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _STTY_H_
+#define _STTY_H_
+
+class QSocketNotifier;
+
+#include <qobject.h>
+#include <qstring.h>
+
+namespace GDBDebugger
+{
+
+class STTY : public QObject
+{
+ Q_OBJECT
+
+public:
+ STTY(bool ext=false, const QString &termAppName=QString());
+ ~STTY();
+
+ QString getSlave() { return ttySlave; };
+ void readRemaining();
+
+private slots:
+ void OutReceived(int);
+
+signals:
+ void OutOutput(const char *);
+ void ErrOutput(const char*);
+
+private:
+ int findTTY();
+ bool findExternalTTY(const QString &termApp);
+
+private:
+ int fout;
+ int ferr;
+ QSocketNotifier *out;
+ QString ttySlave;
+ int pid_;
+ bool external_;
+
+ char pty_master[50]; // "/dev/ptyxx" | "/dev/ptmx"
+ char tty_slave[50]; // "/dev/ttyxx" | "/dev/pts/########..."
+};
+
+}
+
+#endif
diff --git a/languages/cpp/debugger/tests/README.txt b/languages/cpp/debugger/tests/README.txt
new file mode 100644
index 00000000..1764b029
--- /dev/null
+++ b/languages/cpp/debugger/tests/README.txt
@@ -0,0 +1,4 @@
+
+This directory contains some tests for debugger. They are not
+automated, and most test have no description of expected behaviour,
+but still it's better than nothing. \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/breakpoints/Makefile b/languages/cpp/debugger/tests/breakpoints/Makefile
new file mode 100644
index 00000000..77d481f8
--- /dev/null
+++ b/languages/cpp/debugger/tests/breakpoints/Makefile
@@ -0,0 +1,4 @@
+
+breakpoints: main.cpp foo.cpp
+ g++ -g -obreakpoints main.cpp foo.cpp
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/breakpoints/README.txt b/languages/cpp/debugger/tests/breakpoints/README.txt
new file mode 100644
index 00000000..5c441631
--- /dev/null
+++ b/languages/cpp/debugger/tests/breakpoints/README.txt
@@ -0,0 +1,2 @@
+
+Supposed to test various kinds of breakpoints. \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/breakpoints/breakpoints.kdevelop b/languages/cpp/debugger/tests/breakpoints/breakpoints.kdevelop
new file mode 100644
index 00000000..4b3b07c9
--- /dev/null
+++ b/languages/cpp/debugger/tests/breakpoints/breakpoints.kdevelop
@@ -0,0 +1,163 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@ghostwalk</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>breakpoints</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin/>
+ <defaulttarget/>
+ <makeoptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ </qt>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/breakpoints/foo.cpp b/languages/cpp/debugger/tests/breakpoints/foo.cpp
new file mode 100644
index 00000000..a3cf399d
--- /dev/null
+++ b/languages/cpp/debugger/tests/breakpoints/foo.cpp
@@ -0,0 +1,10 @@
+
+#include <stdio.h>
+
+void foo(int a)
+{
+ int i = 10;
+ int i2 = 12;
+ int i3 = i + i2;
+ printf("i3 = %d\n", i3);
+} \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/breakpoints/main.cpp b/languages/cpp/debugger/tests/breakpoints/main.cpp
new file mode 100644
index 00000000..81a5851f
--- /dev/null
+++ b/languages/cpp/debugger/tests/breakpoints/main.cpp
@@ -0,0 +1,38 @@
+
+void foo(int);
+
+void set_value(int* i)
+{
+ *i = 10;
+}
+
+void modify(int* i)
+{
+ *i = 15;
+}
+
+void read(int* i)
+{
+ static int i2;
+ i2 = *i;
+}
+
+int test_main(int* i)
+{
+ foo(5);
+ set_value(i);
+
+ modify(i);
+ read(i);
+
+ for(unsigned j = 0; j < 10; ++j)
+ foo(j);
+
+ return 0;
+}
+
+int main()
+{
+ int var;
+ return test_main(&var);
+}
diff --git a/languages/cpp/debugger/tests/dll/Makefile b/languages/cpp/debugger/tests/dll/Makefile
new file mode 100644
index 00000000..b49c732d
--- /dev/null
+++ b/languages/cpp/debugger/tests/dll/Makefile
@@ -0,0 +1,8 @@
+
+all: main libhelper.so
+
+main: main.cpp
+ g++ -g -o main main.cpp -ldl
+
+libhelper.so: helper.cpp
+ g++ -g -o libhelper.so -fPIC -shared helper.cpp \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/dll/README.txt b/languages/cpp/debugger/tests/dll/README.txt
new file mode 100644
index 00000000..52b39e46
--- /dev/null
+++ b/languages/cpp/debugger/tests/dll/README.txt
@@ -0,0 +1,3 @@
+
+Simple test that we can set breakpoint in dynamic library
+loaded with 'dlopen' before the library is actually loaded. \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/dll/dll.kdevelop b/languages/cpp/debugger/tests/dll/dll.kdevelop
new file mode 100644
index 00000000..dbeb12b3
--- /dev/null
+++ b/languages/cpp/debugger/tests/dll/dll.kdevelop
@@ -0,0 +1,158 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@ghostwalk</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>main</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin/>
+ <defaulttarget/>
+ <makeoptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcppsupport>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root/>
+ </qt>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <references/>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/dll/helper.cpp b/languages/cpp/debugger/tests/dll/helper.cpp
new file mode 100644
index 00000000..eb59e95b
--- /dev/null
+++ b/languages/cpp/debugger/tests/dll/helper.cpp
@@ -0,0 +1,6 @@
+
+extern "C" int helper(int i)
+{
+ int j = i;
+ return j+10;
+}
diff --git a/languages/cpp/debugger/tests/dll/main.cpp b/languages/cpp/debugger/tests/dll/main.cpp
new file mode 100644
index 00000000..ee91d5a2
--- /dev/null
+++ b/languages/cpp/debugger/tests/dll/main.cpp
@@ -0,0 +1,15 @@
+#include <dlfcn.h>
+
+typedef int (*ft)(int);
+
+int main()
+{
+ void* handle = dlopen("./libhelper.so", RTLD_LAZY);
+ void* sym = dlsym(handle, "helper");
+
+ ft f = (ft)sym;
+
+ f(10);
+ f(15);
+ return 0;
+}
diff --git a/languages/cpp/debugger/tests/infinite_loop/Makefile b/languages/cpp/debugger/tests/infinite_loop/Makefile
new file mode 100644
index 00000000..7d32cd85
--- /dev/null
+++ b/languages/cpp/debugger/tests/infinite_loop/Makefile
@@ -0,0 +1,4 @@
+
+infinite_loop: infinite_loop.cpp
+ g++ -g -oinfinite_loop infinite_loop.cpp
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/infinite_loop/README.txt b/languages/cpp/debugger/tests/infinite_loop/README.txt
new file mode 100644
index 00000000..1c008ee6
--- /dev/null
+++ b/languages/cpp/debugger/tests/infinite_loop/README.txt
@@ -0,0 +1,3 @@
+
+Tests that we can stop a program with the "Interrupt" command.
+
diff --git a/languages/cpp/debugger/tests/infinite_loop/infinite_loop.cpp b/languages/cpp/debugger/tests/infinite_loop/infinite_loop.cpp
new file mode 100644
index 00000000..ca90a055
--- /dev/null
+++ b/languages/cpp/debugger/tests/infinite_loop/infinite_loop.cpp
@@ -0,0 +1,17 @@
+
+int foo()
+{
+ int i = 0;
+ for(;;)
+ {
+ i = i+1;
+ }
+ return i;
+}
+
+int main()
+{
+ int r = 10;
+ r += foo();
+ return r;
+} \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/infinite_loop/infinite_loop.kdevelop b/languages/cpp/debugger/tests/infinite_loop/infinite_loop.kdevelop
new file mode 100644
index 00000000..24055c6f
--- /dev/null
+++ b/languages/cpp/debugger/tests/infinite_loop/infinite_loop.kdevelop
@@ -0,0 +1,109 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@zigzag</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>infinite_loop</mainprogram>
+ <directoryradio>executable</directoryradio>
+ </run>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
+ <completionBoxItemOrder>0</completionBoxItemOrder>
+ <howEvaluationContextMenu>true</howEvaluationContextMenu>
+ <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
+ <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
+ <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
+ <processPrimaryTypes>true</processPrimaryTypes>
+ <processFunctionArguments>false</processFunctionArguments>
+ </codecompletion>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/print_pointers/Makefile b/languages/cpp/debugger/tests/print_pointers/Makefile
new file mode 100644
index 00000000..0eafe22f
--- /dev/null
+++ b/languages/cpp/debugger/tests/print_pointers/Makefile
@@ -0,0 +1,3 @@
+
+print_pointers: print_pointers.cpp
+ g++ -g -o print_pointers -I/usr/share/qt3/include print_pointers.cpp -lqt-mt \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp b/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp
new file mode 100644
index 00000000..09053b51
--- /dev/null
+++ b/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp
@@ -0,0 +1,95 @@
+
+#include <qstring.h>
+#include <vector>
+
+struct B { int i; int j; static int k; };
+struct C { int a[3]; };
+struct D { int *ptr; };
+int B::k = 11;
+typedef int (*fp)(int);
+
+int g = 10;
+int g2 = 23;
+
+void func2()
+{
+ int foobar = 123;
+ printf("func2\n");
+}
+
+void func(QString& xs)
+{
+ int ac = 10;
+ std::string s;
+ func2();
+ g = 10;
+ xs = "foo";
+
+}
+
+class Test
+{
+ public:
+ QString n;
+ int b;
+};
+
+int test_main(int ac, char* av[])
+{
+ printf("Hello world\n");
+ int i = 10;
+ int* p1 = 0x00000000;
+ int** p1_p = &p1;
+ p1 = &g;
+
+ B* p2 = (B*)0x12345678;
+ g = 77;
+ int (*p3)(int) = (fp)0x000000AE;
+ B p4 = {1, 3};
+ p2 = &p4;
+ int p5[] = {5, 6, 7};
+ int* p6[] = {&g, &g2};
+ int p7[][2] = {{1,2}, {5,6}};
+ B p8[] = {{1,2}, {3,4}};
+ C p9 = {{7, 8, 9}};
+ g = 77;
+ const D p9_1 = {&g};
+ {
+ B p9_1;
+ int i = 15;
+ printf("p9_1\n");
+ }
+ B& p10 = p4;
+ int& p11 = *p1;
+ int (*p12)[3] = &p5;
+ int (&p13)[3] = p5;
+ char p14[6] = "abc";
+ wchar_t* p15 = L"test1";
+
+
+ QString s = "test test test test";
+ QString* sp = &s;
+ const QString& sr = s;
+ func(s);
+ i = 15;
+
+ std::vector<int> v;
+
+ Test* test = new Test;
+ Test& test2 = *test;
+ test->n = "foo";
+ printf("hi\n");
+ test = 0;
+ printf("hi2\n");
+ printf("hi %d\n", test->b);
+
+
+
+ p5[1] = 14;
+ return 0;
+}
+
+int main(int ac, char* av[])
+{
+ return test_main(ac, av);
+}
diff --git a/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop b/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop
new file mode 100644
index 00000000..03faba9a
--- /dev/null
+++ b/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop
@@ -0,0 +1,218 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@cs.msu.su</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts>
+ <part>kdevsecurity</part>
+ <part>kdevkonsoleview</part>
+ <part>kdevreplace</part>
+ <part>kdevctags2</part>
+ <part>kdevvalgrind</part>
+ </ignoreparts>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ <projectname>print_pointers</projectname>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>print_pointers</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin/>
+ <defaulttarget/>
+ <makeoptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ <filetypes>
+ <filetype>*.java</filetype>
+ <filetype>*.h</filetype>
+ <filetype>*.H</filetype>
+ <filetype>*.hh</filetype>
+ <filetype>*.hxx</filetype>
+ <filetype>*.hpp</filetype>
+ <filetype>*.c</filetype>
+ <filetype>*.C</filetype>
+ <filetype>*.cc</filetype>
+ <filetype>*.cpp</filetype>
+ <filetype>*.c++</filetype>
+ <filetype>*.cxx</filetype>
+ <filetype>Makefile</filetype>
+ <filetype>CMakeLists.txt</filetype>
+ </filetypes>
+ <blacklist/>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>true</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+ <kdevcppsupport>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
+ <completionBoxItemOrder>0</completionBoxItemOrder>
+ <howEvaluationContextMenu>true</howEvaluationContextMenu>
+ <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
+ <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
+ <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx&lt;&lt;std</namespaceAliases>
+ <processPrimaryTypes>true</processPrimaryTypes>
+ <processFunctionArguments>false</processFunctionArguments>
+ <preProcessAllHeaders>false</preProcessAllHeaders>
+ <parseMissingHeaders>false</parseMissingHeaders>
+ <resolveIncludePaths>true</resolveIncludePaths>
+ <alwaysParseInBackground>true</alwaysParseInBackground>
+ <usePermanentCaching>true</usePermanentCaching>
+ <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
+ <includePaths>.;</includePaths>
+ <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
+ <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
+ </codecompletion>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <references/>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ <includestyle>3</includestyle>
+ <designerintegration>EmbeddedKDevDesigner</designerintegration>
+ <qmake>/usr/bin/qmake-qt3</qmake>
+ <designer>/usr/bin/designer</designer>
+ <designerpluginpaths/>
+ </qt>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <kdevvisualadvance>
+ <emulator>VisualBoyAdvance</emulator>
+ <binary/>
+ <addOptions/>
+ <terminal>false</terminal>
+ <fullscreen>false</fullscreen>
+ <graphicFilter>-f0</graphicFilter>
+ <scaling>-1</scaling>
+ </kdevvisualadvance>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/segfault/Makefile b/languages/cpp/debugger/tests/segfault/Makefile
new file mode 100644
index 00000000..eebc5385
--- /dev/null
+++ b/languages/cpp/debugger/tests/segfault/Makefile
@@ -0,0 +1,4 @@
+
+segfault: segfault.cpp
+ g++ -g -osegfault segfault.cpp
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/segfault/README.txt b/languages/cpp/debugger/tests/segfault/README.txt
new file mode 100644
index 00000000..c36254de
--- /dev/null
+++ b/languages/cpp/debugger/tests/segfault/README.txt
@@ -0,0 +1,3 @@
+
+Tests that we correctly report segfault in a debugged program.
+
diff --git a/languages/cpp/debugger/tests/segfault/segfault.cpp b/languages/cpp/debugger/tests/segfault/segfault.cpp
new file mode 100644
index 00000000..3a77e500
--- /dev/null
+++ b/languages/cpp/debugger/tests/segfault/segfault.cpp
@@ -0,0 +1,7 @@
+
+
+int main()
+{
+ int* ptr = 0;
+ *ptr = 10;
+} \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/segfault/segfault.kdevelop b/languages/cpp/debugger/tests/segfault/segfault.kdevelop
new file mode 100644
index 00000000..0135e84b
--- /dev/null
+++ b/languages/cpp/debugger/tests/segfault/segfault.kdevelop
@@ -0,0 +1,163 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@zigzag</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description></description>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>segfault</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs></programargs>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir></builddir>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin></makebin>
+ <defaulttarget></defaulttarget>
+ <makeoptions></makeoptions>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ </qt>
+ <creategettersetter>
+ <prefixGet></prefixGet>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/threads/Makefile b/languages/cpp/debugger/tests/threads/Makefile
new file mode 100644
index 00000000..8db14799
--- /dev/null
+++ b/languages/cpp/debugger/tests/threads/Makefile
@@ -0,0 +1,4 @@
+
+threads: threads.cpp
+ g++ -g -othreads threads.cpp -pthread
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/threads/README.txt b/languages/cpp/debugger/tests/threads/README.txt
new file mode 100644
index 00000000..3d84fae1
--- /dev/null
+++ b/languages/cpp/debugger/tests/threads/README.txt
@@ -0,0 +1,4 @@
+
+Tests with a threaded application. Makes sure that the
+list of threads is shown that that switching threads works.
+
diff --git a/languages/cpp/debugger/tests/threads/threads.cpp b/languages/cpp/debugger/tests/threads/threads.cpp
new file mode 100644
index 00000000..f412ef7c
--- /dev/null
+++ b/languages/cpp/debugger/tests/threads/threads.cpp
@@ -0,0 +1,26 @@
+
+#include <pthread.h>
+
+void runner(int i)
+{
+ for(int i = 0; i < 1000000;)
+ ++i;
+}
+
+void* thread(void* p)
+{
+ runner((int)p);
+}
+
+int main()
+{
+ pthread_t p1, p2;
+
+ pthread_create(&p1, 0, &thread, (void*)1);
+ pthread_create(&p2, 0, &thread, (void*)2);
+
+ pthread_join(p1, 0);
+ pthread_join(p2, 0);
+
+ return 0;
+} \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/threads/threads.kdevelop b/languages/cpp/debugger/tests/threads/threads.kdevelop
new file mode 100644
index 00000000..3cd806b8
--- /dev/null
+++ b/languages/cpp/debugger/tests/threads/threads.kdevelop
@@ -0,0 +1,101 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@zigzag</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>threads</mainprogram>
+ <directoryradio>executable</directoryradio>
+ </run>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/tracing/Makefile b/languages/cpp/debugger/tests/tracing/Makefile
new file mode 100644
index 00000000..22333f01
--- /dev/null
+++ b/languages/cpp/debugger/tests/tracing/Makefile
@@ -0,0 +1,4 @@
+
+tracing: main.cpp
+ g++ -g -otracing main.cpp
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/tracing/main.cpp b/languages/cpp/debugger/tests/tracing/main.cpp
new file mode 100644
index 00000000..4a1a38d7
--- /dev/null
+++ b/languages/cpp/debugger/tests/tracing/main.cpp
@@ -0,0 +1,15 @@
+
+//
+int main()
+{
+ int i, j;
+ i = 157;
+ j = 312;
+
+ while( i != j )
+ {
+ if( i > j ) i = i-j;
+ else j = j-i;
+ }
+ return 0;
+}
diff --git a/languages/cpp/debugger/tests/tracing/tracing.kdevelop b/languages/cpp/debugger/tests/tracing/tracing.kdevelop
new file mode 100644
index 00000000..94d39c6f
--- /dev/null
+++ b/languages/cpp/debugger/tests/tracing/tracing.kdevelop
@@ -0,0 +1,163 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@ghostwalk</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description/>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>tracing</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs/>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin/>
+ <defaulttarget/>
+ <makeoptions/>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ <programargs/>
+ <gdbpath/>
+ <configGdbScript/>
+ <runShellScript/>
+ <runGdbScript/>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ </qt>
+ <creategettersetter>
+ <prefixGet/>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+</kdevelop>
diff --git a/languages/cpp/debugger/tests/two_module/Makefile b/languages/cpp/debugger/tests/two_module/Makefile
new file mode 100644
index 00000000..edd1a242
--- /dev/null
+++ b/languages/cpp/debugger/tests/two_module/Makefile
@@ -0,0 +1,4 @@
+
+two_module: main.cpp src/foo.cpp
+ g++ -g -I/usr/share/qt3/include -otwo_module main.cpp src/foo.cpp -lqt-mt
+ \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/two_module/README.txt b/languages/cpp/debugger/tests/two_module/README.txt
new file mode 100644
index 00000000..31bb0249
--- /dev/null
+++ b/languages/cpp/debugger/tests/two_module/README.txt
@@ -0,0 +1,2 @@
+
+Very basic tests containing two modules. \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/two_module/main.cpp b/languages/cpp/debugger/tests/two_module/main.cpp
new file mode 100644
index 00000000..30863389
--- /dev/null
+++ b/languages/cpp/debugger/tests/two_module/main.cpp
@@ -0,0 +1,8 @@
+
+void foo(int);
+
+int main(int ac, char* av[])
+{
+ foo(5);
+ return 0;
+}
diff --git a/languages/cpp/debugger/tests/two_module/src/foo.cpp b/languages/cpp/debugger/tests/two_module/src/foo.cpp
new file mode 100644
index 00000000..b66f9924
--- /dev/null
+++ b/languages/cpp/debugger/tests/two_module/src/foo.cpp
@@ -0,0 +1,12 @@
+
+#include <stdio.h>
+#include <qstring.h>
+
+void foo(int a)
+{
+ QString s = "foo";
+ int i = 10;
+ int i2 = 12;
+ int i3 = i + i2;
+ printf("i3 = %d\n", i3);
+} \ No newline at end of file
diff --git a/languages/cpp/debugger/tests/two_module/two_module.kdevelop b/languages/cpp/debugger/tests/two_module/two_module.kdevelop
new file mode 100644
index 00000000..a9ecc5ad
--- /dev/null
+++ b/languages/cpp/debugger/tests/two_module/two_module.kdevelop
@@ -0,0 +1,163 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>Vladimir Prus</author>
+ <email>ghost@ghostwalk</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts/>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ <description></description>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>two_module</mainprogram>
+ <directoryradio>executable</directoryradio>
+ <customdirectory>/</customdirectory>
+ <programargs></programargs>
+ <terminal>false</terminal>
+ <autocompile>true</autocompile>
+ <envvars/>
+ </run>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir></builddir>
+ </build>
+ <make>
+ <abortonerror>false</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <prio>0</prio>
+ <dontact>false</dontact>
+ <makebin></makebin>
+ <defaulttarget></defaulttarget>
+ <makeoptions></makeoptions>
+ <selectedenvironment>default</selectedenvironment>
+ <environments>
+ <default/>
+ </environments>
+ </make>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ <programargs></programargs>
+ <gdbpath></gdbpath>
+ <configGdbScript></configGdbScript>
+ <runShellScript></runShellScript>
+ <runGdbScript></runGdbScript>
+ <breakonloadinglibs>true</breakonloadinglibs>
+ <separatetty>false</separatetty>
+ <floatingtoolbar>false</floatingtoolbar>
+ </general>
+ <display>
+ <staticmembers>false</staticmembers>
+ <demanglenames>true</demanglenames>
+ <outputradix>10</outputradix>
+ </display>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevcppsupport>
+ <references/>
+ <codecompletion>
+ <includeGlobalFunctions>true</includeGlobalFunctions>
+ <includeTypes>true</includeTypes>
+ <includeEnums>true</includeEnums>
+ <includeTypedefs>false</includeTypedefs>
+ <automaticCodeCompletion>true</automaticCodeCompletion>
+ <automaticArgumentsHint>true</automaticArgumentsHint>
+ <automaticHeaderCompletion>true</automaticHeaderCompletion>
+ <codeCompletionDelay>250</codeCompletionDelay>
+ <argumentsHintDelay>400</argumentsHintDelay>
+ <headerCompletionDelay>250</headerCompletionDelay>
+ </codecompletion>
+ <qt>
+ <used>false</used>
+ <version>3</version>
+ <root>/usr/share/qt3</root>
+ </qt>
+ <creategettersetter>
+ <prefixGet></prefixGet>
+ <prefixSet>set</prefixSet>
+ <prefixVariable>m_,_</prefixVariable>
+ <parameterName>theValue</parameterName>
+ <inlineGet>true</inlineGet>
+ <inlineSet>true</inlineSet>
+ </creategettersetter>
+ <splitheadersource>
+ <enabled>false</enabled>
+ <synchronize>true</synchronize>
+ <orientation>Vertical</orientation>
+ </splitheadersource>
+ </kdevcppsupport>
+ <kdevfileview>
+ <groups>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidenonlocation>false</hidenonlocation>
+ </groups>
+ <tree>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ </tree>
+ </kdevfileview>
+ <cppsupportpart>
+ <filetemplates>
+ <interfacesuffix>.h</interfacesuffix>
+ <implementationsuffix>.cpp</implementationsuffix>
+ </filetemplates>
+ </cppsupportpart>
+</kdevelop>
diff --git a/languages/cpp/debugger/variablewidget.cpp b/languages/cpp/debugger/variablewidget.cpp
new file mode 100644
index 00000000..263afdf9
--- /dev/null
+++ b/languages/cpp/debugger/variablewidget.cpp
@@ -0,0 +1,2002 @@
+// **************************************************************************
+// begin : Sun Aug 8 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+// **************************************************************************
+
+// **************************************************************************
+// * *
+// * This program is free software; you can redistribute it and/or modify *
+// * it under the terms of the GNU General Public License as published by *
+// * the Free Software Foundation; either version 2 of the License, or *
+// * (at your option) any later version. *
+// * *
+// **************************************************************************
+
+#include "variablewidget.h"
+#include "gdbparser.h"
+#include "gdbcommand.h"
+#include "gdbbreakpointwidget.h"
+
+#include <kdebug.h>
+#include <kpopupmenu.h>
+#include <klineedit.h>
+#include <kdeversion.h>
+#include <kiconloader.h>
+
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qhbox.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qcursor.h>
+#include <qwhatsthis.h>
+#include <klocale.h>
+
+#include <qpoint.h>
+#include <qclipboard.h>
+#include <kapplication.h>
+#include <kmessagebox.h>
+
+#include <cctype>
+#include <set>
+#include <typeinfo>
+#include <cctype>
+
+/** The variables widget is passive, and is invoked by the rest of the
+ code via two main slots:
+ - slotDbgStatus
+ - slotCurrentFrame
+
+ The first is received the program status changes and the second is
+ recieved after current frame in the debugger can possibly changes.
+
+ The widget has a list item for each frame/thread combination, with
+ variables as children. However, at each moment only one item is shown.
+ When handling the slotCurrentFrame, we check if variables for the
+ current frame are available. If yes, we simply show the corresponding item.
+ Otherwise, we fetch the new data from debugger.
+
+ Fetching the data is done by emitting the produceVariablesInfo signal.
+ In response, we get slotParametersReady and slotLocalsReady signal,
+ in that order.
+
+ The data is parsed and changed variables are highlighted. After that,
+ we 'trim' variable items that were not reported by gdb -- that is, gone
+ out of scope.
+*/
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+namespace GDBDebugger
+{
+
+VariableWidget::VariableWidget(GDBController* controller,
+ GDBBreakpointWidget* breakpointWidget,
+ QWidget *parent, const char *name)
+: QWidget(parent, name)
+{
+ setIcon(SmallIcon("math_brace"));
+ setCaption(i18n("Variable Tree"));
+
+ varTree_ = new VariableTree(this, controller, breakpointWidget);
+
+ watchVarEditor_ = new KHistoryCombo( this,
+ "var-to-watch editor");
+
+ QHBoxLayout* buttons = new QHBoxLayout();
+
+ buttons->addStretch();
+
+ QPushButton *evalButton = new QPushButton(i18n("&Evaluate"), this );
+ buttons->addWidget(evalButton);
+
+ QPushButton *addButton = new QPushButton(i18n("&Watch"), this );
+ buttons->addWidget(addButton);
+
+ QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
+ topLayout->addWidget(varTree_, 10);
+ topLayout->addWidget(watchVarEditor_);
+ topLayout->addItem(buttons);
+
+
+ connect( addButton, SIGNAL(clicked()), SLOT(slotAddWatchVariable()) );
+ connect( evalButton, SIGNAL(clicked()), SLOT(slotEvaluateExpression()) );
+
+ connect( watchVarEditor_, SIGNAL(returnPressed()),
+ SLOT(slotEvaluateExpression()) );
+
+ connect(controller, SIGNAL(event(GDBController::event_t)),
+ varTree_, SLOT(slotEvent(GDBController::event_t)));
+
+
+ // Setup help items.
+
+ QWhatsThis::add(this, i18n(
+ "<b>Variable tree</b><p>"
+ "The variable tree allows you to see the values of local "
+ "variables and arbitrary expressions."
+ "<p>Local variables are displayed automatically and are updated "
+ "as you step through your program. "
+ "For each expression you enter, you can either evaluate it once, "
+ "or \"watch\" it (make it auto-updated). Expressions that are not "
+ "auto-updated can be updated manually from the context menu. "
+ "Expressions can be renamed to more descriptive names by clicking "
+ "on the name column."
+ "<p>To change the value of a variable or an expression, "
+ "click on the value."));
+
+ QWhatsThis::add(watchVarEditor_,
+ i18n("<b>Expression entry</b>"
+ "<p>Type in expression to evaluate."));
+
+ QWhatsThis::add(evalButton,
+ i18n("Evaluate the expression."));
+
+ QWhatsThis::add(addButton,
+ i18n("Evaluate the expression and "
+ "auto-update the value when stepping."));
+}
+
+void VariableWidget::slotAddWatchVariable()
+{
+// QString watchVar(watchVarEntry_->text());
+ QString watchVar(watchVarEditor_->currentText());
+ if (!watchVar.isEmpty())
+ {
+ slotAddWatchVariable(watchVar);
+ }
+}
+
+// **************************************************************************
+
+void VariableWidget::slotAddWatchVariable(const QString &ident)
+{
+ if (!ident.isEmpty())
+ {
+ watchVarEditor_->addToHistory(ident);
+ varTree_->slotAddWatchVariable(ident);
+ watchVarEditor_->clearEdit();
+ }
+}
+
+void VariableWidget::slotEvaluateExpression()
+{
+ QString exp(watchVarEditor_->currentText());
+ if (!exp.isEmpty())
+ {
+ slotEvaluateExpression(exp);
+ }
+}
+
+void VariableWidget::slotEvaluateExpression(const QString &ident)
+{
+ if (!ident.isEmpty())
+ {
+ watchVarEditor_->addToHistory(ident);
+ varTree_->slotEvaluateExpression(ident);
+ watchVarEditor_->clearEdit();
+ }
+}
+
+// **************************************************************************
+
+void VariableWidget::focusInEvent(QFocusEvent */*e*/)
+{
+ varTree_->setFocus();
+}
+
+
+
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+VariableTree::VariableTree(VariableWidget *parent,
+ GDBController* controller,
+ GDBBreakpointWidget* breakpointWidget,
+ const char *name)
+ : KListView(parent, name),
+ QToolTip( viewport() ),
+ controller_(controller),
+ breakpointWidget_(breakpointWidget),
+ activeFlag_(0),
+ recentExpressions_(0),
+ currentFrameItem(0),
+ activePopup_(0)
+{
+ setRootIsDecorated(true);
+ setAllColumnsShowFocus(true);
+ setSorting(-1);
+ QListView::setSelectionMode(QListView::Single);
+
+ // Note: it might be reasonable to set width of value
+ // column to 10 characters ('0x12345678'), and rely on
+ // tooltips for showing larger values. Currently, both
+ // columns will get roughly equal width.
+ addColumn(i18n("Variable"));
+ addColumn(i18n("Value"));
+// setResizeMode(AllColumns);
+
+ connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ SLOT(slotContextMenu(KListView*, QListViewItem*)) );
+ connect( this, SIGNAL(itemRenamed( QListViewItem*, int, const QString&)),
+ this, SLOT(slotItemRenamed( QListViewItem*, int, const QString&)));
+}
+
+// **************************************************************************
+
+VariableTree::~VariableTree()
+{
+}
+
+// **************************************************************************
+
+void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
+{
+ if (!item)
+ return;
+
+ setSelected(item, true); // Need to select this item.
+
+ if (item->parent())
+ {
+ KPopupMenu popup(this);
+ KPopupMenu format(this);
+
+ int idRemember = -2;
+ int idRemove = -2;
+ int idReevaluate = -2;
+ int idWatch = -2;
+
+ int idNatural = -2;
+ int idHex = -2;
+ int idDecimal = -2;
+ int idCharacter = -2;
+ int idBinary = -2;
+
+#define MAYBE_DISABLE(id) if (!var->isAlive()) popup.setItemEnabled(id, false)
+
+ VarItem* var;
+ if ((var = dynamic_cast<VarItem*>(item)))
+ {
+ popup.insertTitle(var->gdbExpression());
+
+
+ format.setCheckable(true);
+ idNatural = format.insertItem(i18n("Natural"),
+ (int)VarItem::natural);
+ format.setAccel(Qt::Key_N, idNatural);
+ idHex = format.insertItem(i18n("Hexadecimal"),
+ (int)VarItem::hexadecimal);
+ format.setAccel(Qt::Key_X, idHex);
+ idDecimal = format.insertItem(i18n("Decimal"),
+ (int)VarItem::decimal);
+ format.setAccel(Qt::Key_D, idDecimal);
+ idCharacter = format.insertItem(i18n("Character"),
+ (int)VarItem::character);
+ format.setAccel(Qt::Key_C, idCharacter);
+ idBinary = format.insertItem(i18n("Binary"),
+ (int)VarItem::binary);
+ format.setAccel(Qt::Key_T, idBinary);
+
+
+ format.setItemChecked((int)(var->format()), true);
+
+ int id = popup.insertItem(i18n("Format"), &format);
+ MAYBE_DISABLE(id);
+ }
+
+
+ QListViewItem* root = findRoot(item);
+
+ if (root != recentExpressions_)
+ {
+ idRemember = popup.insertItem(
+ SmallIcon("pencil"), i18n("Remember Value"));
+ MAYBE_DISABLE(idRemember);
+ }
+
+ if (dynamic_cast<WatchRoot*>(root)) {
+ idRemove = popup.insertItem(
+ SmallIcon("editdelete"), i18n("Remove Watch Variable") );
+ popup.setAccel(Qt::Key_Delete, idRemove);
+ } else if (root != recentExpressions_) {
+ idWatch = popup.insertItem(
+ i18n("Watch Variable"));
+ MAYBE_DISABLE(idWatch);
+ }
+ if (root == recentExpressions_) {
+ idReevaluate = popup.insertItem(
+ SmallIcon("reload"), i18n("Reevaluate Expression") );
+ MAYBE_DISABLE(idReevaluate);
+ idRemove = popup.insertItem(
+ SmallIcon("editdelete"), i18n("Remove Expression") );
+ popup.setAccel(Qt::Key_Delete, idRemove);
+ }
+
+ if (var)
+ {
+ popup.insertItem( i18n("Data write breakpoint"), idToggleWatch );
+ popup.setItemEnabled(idToggleWatch, false);
+ }
+
+ int idCopyToClipboard = popup.insertItem(
+ SmallIcon("editcopy"), i18n("Copy Value") );
+ popup.setAccel(Qt::CTRL + Qt::Key_C, idCopyToClipboard);
+
+ activePopup_ = &popup;
+ /* This code can be executed when debugger is stopped,
+ and we invoke popup menu on a var under "recent expressions"
+ just to delete it. */
+ if (var && var->isAlive() && !controller()->stateIsOn(s_dbgNotStarted))
+ controller_->addCommand(
+ new GDBCommand(
+ QString("-data-evaluate-expression &%1")
+ .arg(var->gdbExpression()),
+ this,
+ &VariableTree::handleAddressComputed,
+ true /*handles error*/));
+
+
+ int res = popup.exec(QCursor::pos());
+
+ activePopup_ = 0;
+
+
+ if (res == idNatural || res == idHex || res == idDecimal
+ || res == idCharacter || res == idBinary)
+ {
+ // Change format.
+ VarItem* var_item = static_cast<VarItem*>(item);
+ var_item->setFormat(static_cast<VarItem::format_t>(res));
+ }
+ else if (res == idRemember)
+ {
+ if (VarItem *item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ ((VariableWidget*)parent())->
+ slotEvaluateExpression(item->gdbExpression());
+ }
+ }
+ else if (res == idWatch)
+ {
+ if (VarItem *item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ ((VariableWidget*)parent())->
+ slotAddWatchVariable(item->gdbExpression());
+ }
+ }
+ else if (res == idRemove)
+ delete item;
+ else if (res == idCopyToClipboard)
+ {
+ copyToClipboard(item);
+ }
+ else if (res == idToggleWatch)
+ {
+ if (VarItem *item = dynamic_cast<VarItem*>(currentItem()))
+ emit toggleWatchpoint(item->gdbExpression());
+ }
+ else if (res == idReevaluate)
+ {
+ if (VarItem* item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ item->recreate();
+ }
+ }
+ }
+ else if (item == recentExpressions_)
+ {
+ KPopupMenu popup(this);
+ popup.insertTitle(i18n("Recent Expressions"));
+ int idRemove = popup.insertItem(
+ SmallIcon("editdelete"), i18n("Remove All"));
+ int idReevaluate = popup.insertItem(
+ SmallIcon("reload"), i18n("Reevaluate All"));
+ if (controller()->stateIsOn(s_dbgNotStarted))
+ popup.setItemEnabled(idReevaluate, false);
+ int res = popup.exec(QCursor::pos());
+
+ if (res == idRemove)
+ {
+ delete recentExpressions_;
+ recentExpressions_ = 0;
+ }
+ else if (res == idReevaluate)
+ {
+ for(QListViewItem* child = recentExpressions_->firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->recreate();
+ }
+ }
+ }
+}
+
+void VariableTree::slotEvent(GDBController::event_t event)
+{
+ switch(event)
+ {
+ case GDBController::program_exited:
+ case GDBController::debugger_exited:
+ {
+ // Remove all locals.
+ QListViewItem *child = firstChild();
+
+ while (child) {
+ QListViewItem *nextChild = child->nextSibling();
+
+ // don't remove the watch root, or 'recent expressions' root.
+ if (!(dynamic_cast<WatchRoot*> (child))
+ && child != recentExpressions_)
+ {
+ delete child;
+ }
+ child = nextChild;
+ }
+ currentFrameItem = 0;
+
+ if (recentExpressions_)
+ {
+ for(QListViewItem* child = recentExpressions_->firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->unhookFromGdb();
+ }
+ }
+
+ if (WatchRoot* w = findWatch())
+ {
+ for(QListViewItem* child = w->firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->unhookFromGdb();
+ }
+ }
+
+ break;
+ }
+
+ case GDBController::program_state_changed:
+
+ // Fall-through intended.
+
+ case GDBController::thread_or_frame_changed:
+ {
+ VarFrameRoot *frame = demand_frame_root(
+ controller_->currentFrame(), controller_->currentThread());
+
+ if (frame->isOpen())
+ {
+ updateCurrentFrame();
+ }
+ else
+ {
+ frame->setDirty();
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+void VariableTree::updateCurrentFrame()
+{
+ // In GDB 6.4, the -stack-list-locals command is broken.
+ // If there's any local reference variable which is not
+ // initialized yet, for example because it's in the middle
+ // of function, gdb will still print it and try to dereference
+ // it. If the address in not accessible, the MI command will
+ // exit with an error, and we won't be able to see *any*
+ // locals. A patch is submitted:
+ // http://sourceware.org/ml/gdb-patches/2006-04/msg00069.html
+ // but we need to work with 6.4, not with some future version. So,
+ // we just -stack-list-locals to get just names of the locals,
+ // but not their values.
+ // We'll fetch values separately:
+
+ controller_->addCommand(
+ new GDBCommand(QString("-stack-list-arguments 0 %1 %2")
+ .arg(controller_->currentFrame())
+ .arg(controller_->currentFrame())
+ .ascii(),
+ this,
+ &VariableTree::argumentsReady));
+
+
+ controller_->addCommand(
+ new GDBCommand("-stack-list-locals 0",
+ this,
+ &VariableTree::localsReady));
+
+}
+
+
+// **************************************************************************
+
+void VariableTree::slotAddWatchVariable(const QString &watchVar)
+{
+ VarItem *varItem = 0;
+ varItem = new VarItem(findWatch(), watchVar);
+}
+
+void VariableTree::slotEvaluateExpression(const QString &expression)
+{
+ if (recentExpressions_ == 0)
+ {
+ recentExpressions_ = new TrimmableItem(this);
+ recentExpressions_->setText(0, "Recent");
+ recentExpressions_->setOpen(true);
+ }
+
+ VarItem *varItem = new VarItem(recentExpressions_,
+ expression,
+ true /* freeze */);
+ varItem->setRenameEnabled(0, 1);
+}
+
+// **************************************************************************
+
+QListViewItem *VariableTree::findRoot(QListViewItem *item) const
+{
+ while (item->parent())
+ item = item->parent();
+
+ return item;
+}
+
+// **************************************************************************
+
+VarFrameRoot *VariableTree::findFrame(int frameNo, int threadNo) const
+{
+ QListViewItem *sibling = firstChild();
+
+ // frames only exist on th top level so we only need to
+ // check the siblings
+ while (sibling) {
+ VarFrameRoot *frame = dynamic_cast<VarFrameRoot*> (sibling);
+ if (frame && frame->matchDetails(frameNo, threadNo))
+ return frame;
+
+ sibling = sibling->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+
+WatchRoot *VariableTree::findWatch()
+{
+ QListViewItem *sibling = firstChild();
+
+ while (sibling) {
+ if (WatchRoot *watch = dynamic_cast<WatchRoot*> (sibling))
+ return watch;
+
+ sibling = sibling->nextSibling();
+ }
+
+ return new WatchRoot(this);
+}
+
+// **************************************************************************
+
+QListViewItem *VariableTree::lastChild() const
+{
+ QListViewItem *child = firstChild();
+ if (child)
+ while (QListViewItem *nextChild = child->nextSibling())
+ child = nextChild;
+
+ return child;
+}
+
+// **************************************************************************
+
+void VariableTree::maybeTip(const QPoint &p)
+{
+ VarItem * item = dynamic_cast<VarItem*>( itemAt( p ) );
+ if ( item )
+ {
+ QRect r = itemRect( item );
+ if ( r.isValid() )
+ tip( r, item->tipText() );
+ }
+}
+
+class ValueSpecialRepresentationCommand : public QObject, public CliCommand
+{
+public:
+ ValueSpecialRepresentationCommand(VarItem* item, const QString& command)
+ : CliCommand(command.ascii(),
+ this,
+ &ValueSpecialRepresentationCommand::handleReply,
+ true),
+ item_(item)
+ {}
+
+private:
+
+ VarItem* item_;
+
+ void handleReply(const QValueVector<QString>& lines)
+ {
+ QString s;
+ for(unsigned i = 1; i < lines.count(); ++i)
+ s += lines[i];
+ item_->updateSpecialRepresentation(s.local8Bit());
+ }
+};
+
+void VariableTree::slotVarobjNameChanged(
+ const QString& from, const QString& to)
+{
+ if (!from.isEmpty())
+ varobj2varitem.erase(from);
+
+ if (!to.isEmpty())
+ varobj2varitem[to] =
+ const_cast<VarItem*>(
+ static_cast<const VarItem*>(sender()));
+}
+
+
+
+VarFrameRoot* VariableTree::demand_frame_root(int frameNo, int threadNo)
+{
+ VarFrameRoot *frame = findFrame(frameNo, threadNo);
+ if (!frame)
+ {
+ frame = new VarFrameRoot(this, frameNo, threadNo);
+ frame->setFrameName(i18n("Locals"));
+ // Make sure "Locals" item is always the top item, before
+ // "watch" and "recent experessions" items.
+ this->takeItem(frame);
+ this->insertItem(frame);
+ frame->setOpen(true);
+ }
+ return frame;
+}
+
+void VariableTree::argumentsReady(const GDBMI::ResultRecord& r)
+{
+ const GDBMI::Value& args = r["stack-args"][0]["args"];
+
+ fetch_time.start();
+
+ locals_and_arguments.clear();
+ for(unsigned i = 0; i < args.size(); ++i)
+ {
+ locals_and_arguments.push_back(args[i].literal());
+ }
+}
+
+void VariableTree::localsReady(const GDBMI::ResultRecord& r)
+{
+ const GDBMI::Value& locals = r["locals"];
+
+ for(unsigned i = 0; i < locals.size(); ++i)
+ {
+ QString val = locals[i].literal();
+
+ // Check ada internal variables like <R45b>, <L23R> ...
+ bool is_ada_variable = (val[0] == '<' && val[val.length() - 1] == '>');
+
+ if (!is_ada_variable)
+ {
+ locals_and_arguments.push_back(val);
+ }
+ }
+
+ controller_->addCommand(new CliCommand("info frame",
+ this,
+ &VariableTree::frameIdReady));
+}
+
+void VariableTree::frameIdReady(const QValueVector<QString>& lines)
+{
+ //kdDebug(9012) << "localAddresses: " << lines[1] << "\n";
+
+ QString frame_info;
+ for(unsigned i = 1; i < lines.size(); ++i)
+ frame_info += lines[i];
+
+ kdDebug(9012) << "frame info: " << frame_info << "\n";
+ frame_info.replace('\n', "");
+
+ static QRegExp frame_base_rx("frame at 0x([0-9a-fA-F]*)");
+ static QRegExp frame_code_rx("saved [a-zA-Z0-9]* 0x([0-9a-fA-F]*)");
+
+ int i = frame_base_rx.search(frame_info);
+ int i2 = frame_code_rx.search(frame_info);
+
+ bool frameIdChanged = false;
+
+ VarFrameRoot *frame = demand_frame_root(
+ controller_->currentFrame(), controller_->currentThread());
+
+ if (frame != currentFrameItem)
+ {
+ if (currentFrameItem)
+ {
+ currentFrameItem->setVisible(false);
+ }
+ }
+ currentFrameItem = frame;
+ currentFrameItem->setVisible(true);
+
+
+ if (i != -1 && i2 != -1)
+ {
+ unsigned long long new_frame_base =
+ frame_base_rx.cap(1).toULongLong(0, 16);
+ unsigned long long new_code_address =
+ frame_code_rx.cap(1).toULongLong(0, 16);
+ kdDebug(9012) << "Frame base = " << QString::number(new_frame_base, 16)
+ << " code = " << QString::number(new_code_address, 16)
+ << "\n";
+ kdDebug(9012) << "Previous frame " <<
+ QString::number(frame->currentFrameBase, 16)
+ << " code = " << QString::number(
+ frame->currentFrameCodeAddress, 16)
+ << "\n";
+
+ frameIdChanged = (new_frame_base != frame->currentFrameBase ||
+ new_code_address != frame->currentFrameCodeAddress);
+
+ frame->currentFrameBase = new_frame_base;
+ frame->currentFrameCodeAddress = new_code_address;
+ }
+ else
+ {
+ KMessageBox::information(
+ 0,
+ "<b>Can't get frame id</b>"
+ "Could not found frame id from output of 'info frame'. "
+ "Further debugging can be unreliable. ",
+ i18n("Internal error"), "gdb_error");
+ }
+
+ if (frameIdChanged)
+ {
+ // Remove all variables.
+ // FIXME: probably, need to do this in all frames.
+ QListViewItem* child = frame->firstChild();
+ QListViewItem* next;
+ for(; child; child = next)
+ {
+ next = child->nextSibling();
+ delete child;
+ }
+ }
+
+ setUpdatesEnabled(false);
+
+ std::set<QListViewItem*> alive;
+
+ for(unsigned i = 0; i < locals_and_arguments.size(); ++i)
+ {
+ QString name = locals_and_arguments[i];
+
+ // See if we've got VarItem for this one already.
+ VarItem* var = 0;
+ for(QListViewItem *child = frame->firstChild();
+ child;
+ child = child->nextSibling())
+ {
+ if (child->text(VarNameCol) == name)
+ {
+ var = dynamic_cast<VarItem*>(child);
+ break;
+ }
+ }
+ if (!var)
+ {
+ var = new VarItem(frame, name);
+ }
+ alive.insert(var);
+
+ var->clearHighlight();
+ }
+
+ // Remove VarItems that don't correspond to any local
+ // variables any longer. Perform type/address updates
+ // for others.
+ for(QListViewItem* child = frame->firstChild(); child;)
+ {
+ QListViewItem* current = child;
+ child = current->nextSibling();
+ if (!alive.count(current))
+ delete current;
+ else
+ static_cast<VarItem*>(current)->recreateLocallyMaybe();
+ }
+
+ for(QListViewItem* child = findWatch()->firstChild();
+ child; child = child->nextSibling())
+ {
+ VarItem* var = static_cast<VarItem*>(child);
+ var->clearHighlight();
+ // For watched expressions, we don't have an easy way
+ // to check if their meaning is still the same, so
+ // unconditionally recreate them.
+ var->recreate();
+ }
+
+ // Note: can't use --all-values in this command, because gdb will
+ // die if there's any uninitialized variable. Ouch!
+ controller_->addCommand(new GDBCommand(
+ "-var-update *",
+ this,
+ &VariableTree::handleVarUpdate));
+
+ controller_->addCommand(new SentinelCommand(
+ this,
+ &VariableTree::variablesFetchDone));
+}
+
+void VariableTree::handleVarUpdate(const GDBMI::ResultRecord& r)
+{
+ const GDBMI::Value& changed = r["changelist"];
+
+ std::set<QString> names_to_update;
+
+ for(unsigned i = 0; i < changed.size(); ++i)
+ {
+ const GDBMI::Value& c = changed[i];
+
+ QString name = c["name"].literal();
+ if (c.hasField("in_scope") && c["in_scope"].literal() == "false")
+ continue;
+
+ names_to_update.insert(name);
+ }
+
+ QMap<QString, VarItem*>::iterator i, e;
+ for (i = varobj2varitem.begin(), e = varobj2varitem.end(); i != e; ++i)
+ {
+ if (names_to_update.count(i.key())
+ || i.data()->updateUnconditionally())
+ {
+ i.data()->updateValue();
+ }
+ }
+}
+
+void VarItem::handleCliPrint(const QValueVector<QString>& lines)
+{
+ static QRegExp r("(\\$[0-9]+)");
+ if (lines.size() >= 2)
+ {
+ int i = r.search(lines[1]);
+ if (i == 0)
+ {
+ controller_->addCommand(
+ new GDBCommand(QString("-var-create %1 * \"%2\"")
+ .arg(varobjName_)
+ .arg(r.cap(1)),
+ this,
+ &VarItem::varobjCreated,
+ // On initial create, errors get reported
+ // by generic code. After then, errors
+ // are swallowed by varobjCreated.
+ initialCreation_ ? false : true));
+ }
+ else
+ {
+ // FIXME: merge all output lines together.
+ // FIXME: add 'debuggerError' to debuggerpart.
+ KMessageBox::information(
+ 0,
+ i18n("<b>Debugger error</b><br>") + lines[1],
+ i18n("Debugger error"), "gdb_error");
+ }
+ }
+}
+
+
+void VariableTree::variablesFetchDone()
+{
+ // During parsing of fetched variable values, we might have issued
+ // extra command to handle 'special values', like QString.
+ // We don't want to enable updates just yet, because this will cause
+ // flicker, so add a sentinel command just to enable updates.
+ //
+ // We need this intermediate hook because commands for special
+ // representation are issues when responses to orginary fetch
+ // values commands are received, so we can add sentinel command after
+ // special representation fetch only when commands for ordinary
+ // fetch are all executed.
+ controller_->addCommand(new SentinelCommand(
+ this,
+ &VariableTree::fetchSpecialValuesDone));
+
+}
+
+void VariableTree::fetchSpecialValuesDone()
+{
+ // FIXME: can currentFrame_ or currentThread_ change between
+ // start of var fetch and call of 'variablesFetchDone'?
+ VarFrameRoot *frame = demand_frame_root(
+ controller_->currentFrame(), controller_->currentThread());
+
+// frame->trim();
+
+ frame->needLocals_ = false;
+
+ setUpdatesEnabled(true);
+ triggerUpdate();
+
+ kdDebug(9012) << "Time to fetch variables: " << fetch_time.elapsed() <<
+ "ms\n";
+}
+
+void
+VariableTree::slotItemRenamed(QListViewItem* item, int col, const QString& text)
+{
+ if (col == ValueCol)
+ {
+ VarItem* v = dynamic_cast<VarItem*>(item);
+ Q_ASSERT(v);
+ if (v)
+ {
+ v->setValue(text);
+ }
+ }
+}
+
+
+void VariableTree::keyPressEvent(QKeyEvent* e)
+{
+ if (VarItem* item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ QString text = e->text();
+
+ if (text == "n" || text == "x" || text == "d" || text == "c"
+ || text == "t")
+ {
+ item->setFormat(
+ item->formatFromGdbModifier(text[0].latin1()));
+ }
+
+ if (e->key() == Qt::Key_Delete)
+ {
+ QListViewItem* root = findRoot(item);
+
+ if (dynamic_cast<WatchRoot*>(root) || root == recentExpressions_)
+ {
+ delete item;
+ }
+ }
+
+ if (e->key() == Qt::Key_C && e->state() == Qt::ControlButton)
+ {
+ copyToClipboard(item);
+ }
+ }
+}
+
+
+void VariableTree::copyToClipboard(QListViewItem* item)
+{
+ QClipboard *qb = KApplication::clipboard();
+ QString text = item->text( 1 );
+
+ qb->setText( text, QClipboard::Clipboard );
+}
+
+void VariableTree::handleAddressComputed(const GDBMI::ResultRecord& r)
+{
+ if (r.reason == "error")
+ {
+ // Not lvalue, leave item disabled.
+ return;
+ }
+
+ if (activePopup_)
+ {
+ activePopup_->setItemEnabled(idToggleWatch, true);
+
+ unsigned long long address = r["value"].literal().toULongLong(0, 16);
+ if (breakpointWidget_->hasWatchpointForAddress(address))
+ {
+ activePopup_->setItemChecked(idToggleWatch, true);
+ }
+ }
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+TrimmableItem::TrimmableItem(VariableTree *parent)
+ : KListViewItem (parent, parent->lastChild())
+{
+}
+
+// **************************************************************************
+
+TrimmableItem::TrimmableItem(TrimmableItem *parent)
+ : KListViewItem (parent, parent->lastChild())
+{
+}
+
+// **************************************************************************
+
+TrimmableItem::~TrimmableItem()
+{
+}
+
+// **************************************************************************
+
+void TrimmableItem::paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int align)
+{
+ if ( !p )
+ return;
+ // make toplevel item (watch and frame items) names bold
+ if (column == 0 && !parent())
+ {
+ QFont f = p->font();
+ f.setBold(true);
+ p->setFont(f);
+ }
+ QListViewItem::paintCell( p, cg, column, width, align );
+}
+
+QListViewItem *TrimmableItem::lastChild() const
+{
+ QListViewItem *child = firstChild();
+ if (child)
+ while (QListViewItem *nextChild = child->nextSibling())
+ child = nextChild;
+
+ return child;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+int VarItem::varobjIndex = 0;
+
+VarItem::VarItem(TrimmableItem *parent,
+ const QString& expression,
+ bool frozen)
+ : TrimmableItem (parent),
+ expression_(expression),
+ highlight_(false),
+ oldSpecialRepresentationSet_(false),
+ format_(natural),
+ numChildren_(0),
+ childrenFetched_(false),
+ updateUnconditionally_(false),
+ frozen_(frozen),
+ initialCreation_(true),
+ baseClassMember_(false),
+ alive_(true)
+{
+ connect(this, SIGNAL(varobjNameChange(const QString&, const QString&)),
+ varTree(),
+ SLOT(slotVarobjNameChanged(const QString&, const QString&)));
+
+
+ // User might have entered format together with expression: like
+ // /x i1+i2
+ // If we do nothing, it will be impossible to watch the variable in
+ // different format, as we'll just add extra format specifier.
+ // So:
+ // - detect initial value of format_
+ // - remove the format specifier from the string.
+
+ static QRegExp explicit_format("^\\s*/(.)\\s*(.*)");
+ if (explicit_format.search(expression_) == 0)
+ {
+ format_ = formatFromGdbModifier(explicit_format.cap(1)[0].latin1());
+ expression_ = explicit_format.cap(2);
+ }
+
+ setText(VarNameCol, expression_);
+ // Allow to change variable name by editing.
+ setRenameEnabled(ValueCol, true);
+
+ // Need to store this locally, since varTree() is 0 in
+ // destructor.
+ controller_ = varTree()->controller();
+
+ createVarobj();
+}
+
+VarItem::VarItem(TrimmableItem *parent, const GDBMI::Value& varobj,
+ format_t format, bool baseClassMember)
+: TrimmableItem (parent),
+ highlight_(false),
+ oldSpecialRepresentationSet_(false),
+ format_(format),
+ numChildren_(0),
+ childrenFetched_(false),
+ updateUnconditionally_(false),
+ frozen_(false),
+ initialCreation_(false),
+ baseClassMember_(baseClassMember),
+ alive_(true)
+{
+ connect(this, SIGNAL(varobjNameChange(const QString&, const QString&)),
+ varTree(),
+ SLOT(slotVarobjNameChanged(const QString&, const QString&)));
+
+ expression_ = varobj["exp"].literal();
+ varobjName_ = varobj["name"].literal();
+
+ varobjNameChange("", varobjName_);
+
+ setText(VarNameCol, displayName());
+
+ // Allow to change variable name by editing.
+ setRenameEnabled(ValueCol, true);
+
+ controller_ = varTree()->controller();
+
+ // Set type and children.
+ originalValueType_ = varobj["type"].literal();
+ numChildren_ = varobj["numchild"].literal().toInt();
+ setExpandable(numChildren_ != 0);
+
+
+ // Get the initial value.
+ updateValue();
+}
+
+void VarItem::createVarobj()
+{
+ QString old = varobjName_;
+ varobjName_ = QString("KDEV%1").arg(varobjIndex++);
+ emit varobjNameChange(old, varobjName_);
+
+ if (frozen_)
+ {
+ // MI has no way to freeze a variable object. So, we
+ // issue print command that returns $NN convenience
+ // variable and we create variable object from that.
+ controller_->addCommand(
+ new CliCommand(
+ QString("print %1").arg(expression_),
+ this,
+ &VarItem::handleCliPrint));
+ }
+ else
+ {
+ controller_->addCommand(
+ new CliCommand(
+ QString("print /x &%1").arg(expression_),
+ this,
+ &VarItem::handleCurrentAddress,
+ true));
+
+ controller_->addCommand(
+ // Need to quote expression, otherwise gdb won't like
+ // spaces inside it.
+ new GDBCommand(QString("-var-create %1 * \"%2\"")
+ .arg(varobjName_)
+ .arg(expression_),
+ this,
+ &VarItem::varobjCreated,
+ initialCreation_ ? false : true));
+ }
+}
+
+void VarItem::varobjCreated(const GDBMI::ResultRecord& r)
+{
+ // If we've tried to recreate varobj (for example for watched expression)
+ // after step, and it's no longer valid, it's fine.
+ if (r.reason == "error")
+ {
+ varobjName_ = "";
+ return;
+ }
+ setAliveRecursively(true);
+
+ QString oldType = originalValueType_;
+ originalValueType_ = r["type"].literal();
+ if (!oldType.isEmpty() && oldType != originalValueType_)
+ {
+ // Type changed, the children might be no longer valid,
+ // so delete them.
+ for(QListViewItem* child = firstChild(); child; )
+ {
+ QListViewItem* cur = child;
+ child = child->nextSibling();
+ delete cur;
+ }
+ }
+
+ if (r.hasField("exp"))
+ expression_ = r["exp"].literal();
+ numChildren_ = r["numchild"].literal().toInt();
+ setExpandable(numChildren_ != 0);
+ currentAddress_ = lastObtainedAddress_;
+
+ setVarobjName(varobjName_);
+}
+
+void VarItem::setVarobjName(const QString& name)
+{
+ if (varobjName_ != name)
+ emit varobjNameChange(varobjName_, name);
+
+ varobjName_ = name;
+
+ if (format_ != natural)
+ {
+ controller_->addCommand(
+ new GDBCommand(QString("-var-set-format \"%1\" %2")
+ .arg(varobjName_).arg(varobjFormatName())));
+ }
+
+ // Get the initial value.
+ updateValue();
+
+ if (isOpen())
+ {
+ // This regets children list.
+ setOpen(true);
+ }
+}
+
+void VarItem::valueDone(const GDBMI::ResultRecord& r)
+{
+ if (r.reason == "done")
+ {
+ QString s = GDBParser::getGDBParser()->undecorateValue(
+ r["value"].literal());
+
+ if (format_ == character)
+ {
+ QString encoded = s;
+ bool ok;
+ int value = s.toInt(&ok);
+ if (ok)
+ {
+ char c = (char)value;
+ encoded += " '";
+ if (std::isprint(c))
+ encoded += c;
+ else {
+ // Try common escape characters.
+ static char backslashed[] = {'a', 'b', 'f', 'n',
+ 'r', 't', 'v', '0'};
+ static char represented[] = "\a\b\f\n\r\t\v";
+
+ const char* ix = strchr (represented, c);
+ if (ix) {
+ encoded += "\\";
+ encoded += backslashed[ix - represented];
+ }
+ else
+ encoded += "\\" + s;
+ }
+ encoded += "'";
+ s = encoded;
+ }
+ }
+
+ if (format_ == binary)
+ {
+ // For binary format, split the value at 4-bit boundaries
+ static QRegExp r("^[01]+$");
+ int i = r.search(s);
+ if (i == 0)
+ {
+ QString split;
+ for(unsigned i = 0; i < s.length(); ++i)
+ {
+ // For string 11111, we should split it as
+ // 1 1111, not as 1111 1.
+
+ // 0 is past the end character
+ int distance = i - s.length();
+
+ if (distance % 4 == 0 && !split.isEmpty())
+ split.append(' ');
+ split.append(s[i]);
+ }
+ s = split;
+ }
+ }
+
+ setText(ValueCol, s);
+ }
+ else
+ {
+ QString s = r["msg"].literal();
+ // Error response.
+ if (s.startsWith("Cannot access memory"))
+ {
+ s = "(inaccessible)";
+ setExpandable(false);
+ }
+ else
+ {
+ setExpandable(numChildren_ != 0);
+ }
+ setText(ValueCol, s);
+ }
+}
+
+void VarItem::createChildren(const GDBMI::ResultRecord& r,
+ bool children_of_fake)
+{
+ const GDBMI::Value& children = r["children"];
+
+ /* In order to figure out which variable objects correspond
+ to base class subobject, we first must detect if *this
+ is a structure type. We use present of 'public'/'private'/'protected'
+ fake child as an indicator. */
+ bool structureType = false;
+ if (!children_of_fake && children.size() > 0)
+ {
+ QString exp = children[0]["exp"].literal();
+ bool ok = false;
+ exp.toInt(&ok);
+ if (!ok || exp[0] != '*')
+ {
+ structureType = true;
+ }
+ }
+
+ for (unsigned i = 0; i < children.size(); ++i)
+ {
+ QString exp = children[i]["exp"].literal();
+ // For artificial accessibility nodes,
+ // fetch their children.
+ if (exp == "public" || exp == "protected" || exp == "private")
+ {
+ QString name = children[i]["name"].literal();
+ controller_->addCommand(new GDBCommand(
+ "-var-list-children \"" +
+ name + "\"",
+ this,
+ &VarItem::childrenOfFakesDone));
+ }
+ else
+ {
+ /* All children of structures that are not artifical
+ are base subobjects. */
+ bool baseObject = structureType;
+
+ VarItem* existing = 0;
+ for(QListViewItem* child = firstChild();
+ child; child = child->nextSibling())
+ {
+ VarItem* v = static_cast<VarItem*>(child);
+ kdDebug(9012) << "Child exp : " << v->expression_ <<
+ " new exp " << exp << "\n";
+
+ if (v->expression_ == exp)
+ {
+ existing = v;
+ }
+ }
+ if (existing)
+ {
+ existing->setVarobjName(children[i]["name"].literal());
+ }
+ else
+ {
+ kdDebug(9012) << "Creating new varobj "
+ << exp << " " << baseObject << "\n";
+ // Propagate format from parent.
+ VarItem* v = 0;
+ v = new VarItem(this, children[i], format_, baseObject);
+ }
+ }
+ }
+}
+
+
+void VarItem::childrenDone(const GDBMI::ResultRecord& r)
+{
+ createChildren(r, false);
+ childrenFetched_ = true;
+}
+
+void VarItem::childrenOfFakesDone(const GDBMI::ResultRecord& r)
+{
+ createChildren(r, true);
+}
+
+void VarItem::handleCurrentAddress(const QValueVector<QString>& lines)
+{
+ lastObtainedAddress_ = "";
+ if (lines.count() > 1)
+ {
+ static QRegExp r("\\$\\d+ = ([^\n]*)");
+ int i = r.search(lines[1]);
+ if (i == 0)
+ {
+ lastObtainedAddress_ = r.cap(1);
+ kdDebug(9012) << "new address " << lastObtainedAddress_ << "\n";
+ }
+ }
+}
+
+void VarItem::handleType(const QValueVector<QString>& lines)
+{
+ bool recreate = false;
+
+ if (lastObtainedAddress_ != currentAddress_)
+ {
+ kdDebug(9012) << "Address changed from " << currentAddress_
+ << " to " << lastObtainedAddress_ << "\n";
+ recreate = true;
+ }
+ else
+ {
+ // FIXME: add error diagnostic.
+ if (lines.count() > 1)
+ {
+ static QRegExp r("type = ([^\n]*)");
+ int i = r.search(lines[1]);
+ if (i == 0)
+ {
+ kdDebug(9012) << "found type: " << r.cap(1) << "\n";
+ kdDebug(9012) << "original Type: " << originalValueType_ << "\n";
+
+ if (r.cap(1) != originalValueType_)
+ {
+ recreate = true;
+ }
+ }
+ }
+ }
+ if (recreate)
+ {
+ this->recreate();
+ }
+}
+
+QString VarItem::displayName() const
+{
+ if (expression_[0] != '*')
+ return expression_;
+
+ if (const VarItem* parent =
+ dynamic_cast<const VarItem*>(TrimmableItem::parent()))
+ {
+ return "*" + parent->displayName();
+ }
+ else
+ {
+ return expression_;
+ }
+}
+
+void VarItem::setAliveRecursively(bool enable)
+{
+ setEnabled(enable);
+ alive_ = true;
+
+ for(QListViewItem* child = firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->setAliveRecursively(enable);
+ }
+}
+
+
+VarItem::~VarItem()
+{
+ unhookFromGdb();
+}
+
+QString VarItem::gdbExpression() const
+{
+ // The expression for this item can be either:
+ // - number, for array element
+ // - identifier, for member,
+ // - ***intentifier, for derefenreced pointer.
+ const VarItem* parent = dynamic_cast<const VarItem*>(TrimmableItem::parent());
+
+ bool ok = false;
+ expression_.toInt(&ok);
+ if (ok)
+ {
+ // Array, parent always exists.
+ return parent->gdbExpression() + "[" + expression_ + "]";
+ }
+ else if (expression_[0] == '*')
+ {
+ if (parent)
+ {
+ // For MI, expression_ can be "*0" (meaing
+ // references 0-th element of some array).
+ // So, we really need to get to the parent to computed the right
+ // gdb expression.
+ return "*" + parent->gdbExpression();
+ }
+ else
+ {
+ // Parent can be null for watched expressions. In that case,
+ // expression_ should be a valid C++ expression.
+ return expression_;
+ }
+ }
+ else
+ {
+ if (parent)
+ /* This is varitem corresponds to a base suboject,
+ the expression should cast parent to the base's
+ type. */
+ if (baseClassMember_)
+ return "((" + expression_ + ")" + parent->gdbExpression() + ")";
+ else
+ return parent->gdbExpression() + "." + expression_;
+ else
+ return expression_;
+ }
+}
+
+// **************************************************************************
+
+
+// FIXME: we have two method to set VarItem: this one
+// and updateValue below. That's bad, must have just one.
+void VarItem::setText(int column, const QString &data)
+{
+ QString strData=data;
+
+ if (column == ValueCol) {
+ QString oldValue(text(column));
+ if (!oldValue.isEmpty()) // Don't highlight new items
+ {
+ highlight_ = (oldValue != QString(data));
+ }
+ }
+
+ QListViewItem::setText(column, strData);
+}
+
+void VarItem::clearHighlight()
+{
+ highlight_ = false;
+
+ for(QListViewItem* child = firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->clearHighlight();
+ }
+}
+
+// **************************************************************************
+
+void VarItem::updateValue()
+{
+ if (handleSpecialTypes())
+ {
+ // 1. Gdb never includes structures in output from -var-update
+ // 2. Even if it did, the internal state of object can be
+ // arbitrary complex and gdb can't detect if pretty-printed
+ // value remains the same.
+ // So, we need to reload value on each step.
+ updateUnconditionally_ = true;
+ return;
+ }
+ updateUnconditionally_ = false;
+
+ controller_->addCommand(
+ new GDBCommand(
+ "-var-evaluate-expression \"" + varobjName_ + "\"",
+ this,
+ &VarItem::valueDone,
+ true /* handle error */));
+}
+
+void VarItem::setValue(const QString& new_value)
+{
+ controller_->addCommand(
+ new GDBCommand(QString("-var-assign \"%1\" %2").arg(varobjName_)
+ .arg(new_value)));
+
+ // And immediately reload it from gdb,
+ // so that it's display format is the one gdb uses,
+ // not the one user has typed. Otherwise, on the next
+ // step, the visible value might change and be highlighted
+ // as changed, which is bogus.
+ updateValue();
+}
+
+void VarItem::updateSpecialRepresentation(const QString& xs)
+{
+ QString s(xs);
+ if (s[0] == '$')
+ {
+ int i = s.find('=');
+ if (i != -1)
+ s = s.mid(i+2);
+ }
+
+ // A hack to nicely display QStrings. The content of QString is unicode
+ // for for ASCII only strings we get ascii character mixed with \000.
+ // Remove those \000 now.
+
+ // This is not very nice, becuse we're doing this unconditionally
+ // and this method can be called twice: first with data that gdb sends
+ // for a variable, and second after we request the string data. In theory
+ // the data sent by gdb might contain \000 that should not be translated.
+ //
+ // What's even worse, ideally we should convert the string data from
+ // gdb into a QString again, handling all other escapes and composing
+ // one QChar from two characters from gdb. But to do that, we *should*
+ // now if the data if generic gdb value, and result of request for string
+ // data. Fixing is is for later.
+ s.replace( QRegExp("\\\\000|\\\\0"), "" );
+
+ // FIXME: for now, assume that all special representations are
+ // just strings.
+
+ s = GDBParser::getGDBParser()->undecorateValue(s);
+
+ setText(ValueCol, s);
+ // On the first stop, when VarItem was just created,
+ // don't show it in red.
+ if (oldSpecialRepresentationSet_)
+ highlight_ = (oldSpecialRepresentation_ != s);
+ else
+ highlight_ = false;
+
+ oldSpecialRepresentationSet_ = true;
+ oldSpecialRepresentation_ = s;
+}
+
+void VarItem::recreateLocallyMaybe()
+{
+ controller_->addCommand(
+ new CliCommand(
+ QString("print /x &%1").arg(expression_),
+ this,
+ &VarItem::handleCurrentAddress,
+ true));
+
+ controller_->addCommand(
+ new CliCommand(
+ QString("whatis %1").arg(expression_),
+ this,
+ &VarItem::handleType));
+}
+
+void VarItem::recreate()
+{
+ unhookFromGdb();
+
+ initialCreation_ = false;
+ createVarobj();
+}
+
+
+// **************************************************************************
+
+void VarItem::setOpen(bool open)
+{
+ QListViewItem::setOpen(open);
+
+ if (open && !childrenFetched_)
+ {
+ controller_->addCommand(new GDBCommand(
+ "-var-list-children \"" + varobjName_ + "\"",
+ this,
+ &VarItem::childrenDone));
+ }
+}
+
+bool VarItem::handleSpecialTypes()
+{
+ kdDebug(9012) << "handleSpecialTypes: " << originalValueType_ << "\n";
+ if (originalValueType_.isEmpty())
+ return false;
+
+ static QRegExp qstring("^(const)?[ ]*QString[ ]*&?$");
+
+ if (qstring.exactMatch(originalValueType_)) {
+
+ VariableTree* varTree = static_cast<VariableTree*>(listView());
+ if( !varTree->controller() )
+ return false;
+ varTree->controller()->addCommand(
+ new ResultlessCommand(QString("print $kdev_d=%1.d")
+ .arg(gdbExpression()),
+ true /* ignore error */));
+
+ if (varTree->controller()->qtVersion() >= 4)
+ varTree->controller()->addCommand(
+ new ResultlessCommand(QString("print $kdev_s=$kdev_d.size"),
+ true));
+ else
+ varTree->controller()->addCommand(
+ new ResultlessCommand(QString("print $kdev_s=$kdev_d.len"),
+ true));
+
+ varTree->controller()->addCommand(
+ new ResultlessCommand(
+ QString("print $kdev_s= ($kdev_s > 0)? ($kdev_s > 100 ? 200 : 2*$kdev_s) : 0"),
+ true));
+
+ if (varTree->controller()->qtVersion() >= 4)
+ varTree->controller()->addCommand(
+ new ValueSpecialRepresentationCommand(
+ this, "print ($kdev_s>0) ? (*((char*)&$kdev_d.data[0])@$kdev_s) : \"\""));
+ else
+ varTree->controller()->addCommand(
+ new ValueSpecialRepresentationCommand(
+ this, "print ($kdev_s>0) ? (*((char*)&$kdev_d.unicode[0])@$kdev_s) : \"\""));
+
+ return true;
+ }
+
+ return false;
+}
+
+// **************************************************************************
+
+VarItem::format_t VarItem::format() const
+{
+ return format_;
+}
+
+void VarItem::setFormat(format_t f)
+{
+ if (f == format_)
+ return;
+
+ format_ = f;
+
+ if (numChildren_)
+ {
+ // If variable has children, change format for children.
+ // - for structures, that's clearly right
+ // - for arrays, that's clearly right
+ // - for pointers, this can be confusing, but nobody ever wants to
+ // see the pointer in decimal!
+ for(QListViewItem* child = firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->setFormat(f);
+ }
+ }
+ else
+ {
+ controller_->addCommand(
+ new GDBCommand(QString("-var-set-format \"%1\" %2")
+ .arg(varobjName_).arg(varobjFormatName())));
+
+ updateValue();
+ }
+}
+
+VarItem::format_t VarItem::formatFromGdbModifier(char c) const
+{
+ format_t nf;
+ switch(c)
+ {
+ case 'n': // Not quite gdb modifier, but used in our UI.
+ nf = natural; break;
+ case 'x':
+ nf = hexadecimal; break;
+ case 'd':
+ nf = decimal; break;
+ case 'c':
+ nf = character; break;
+ case 't':
+ nf = binary; break;
+ default:
+ nf = natural; break;
+ }
+ return nf;
+}
+
+QString VarItem::varobjFormatName() const
+{
+ switch(format_)
+ {
+ case natural:
+ return "natural";
+ break;
+
+ case hexadecimal:
+ return "hexadecimal";
+ break;
+
+ case decimal:
+ return "decimal";
+ break;
+
+ // Note: gdb does not support 'character' natively,
+ // so we'll generate appropriate representation
+ // ourselfs.
+ case character:
+ return "decimal";
+ break;
+
+ case binary:
+ return "binary";
+ break;
+ }
+ return "<undefined>";
+}
+
+
+// **************************************************************************
+
+// Overridden to highlight the changed items
+void VarItem::paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int align)
+{
+ if ( !p )
+ return;
+
+ // Draw values in fixed font. For example, when there are several
+ // pointer variables, it's nicer if they are aligned -- it allows
+ // to easy see the diferrence between the pointers.
+ if (column == ValueCol)
+ {
+ p->setFont(KGlobalSettings::fixedFont());
+ }
+
+ if (!alive_)
+ {
+ /* Draw this as disabled. */
+ QListViewItem::paintCell(p, varTree()->QWidget::palette().disabled(),
+ column, width, align);
+ }
+ else
+ {
+ if (column == ValueCol && highlight_)
+ {
+ QColorGroup hl_cg( cg.foreground(), cg.background(), cg.light(),
+ cg.dark(), cg.mid(), red, cg.base());
+ QListViewItem::paintCell( p, hl_cg, column, width, align );
+ } else
+ QListViewItem::paintCell( p, cg, column, width, align );
+ }
+}
+
+
+VariableTree* VarItem::varTree() const
+{
+ return static_cast<VariableTree*>(listView());
+}
+
+void VarItem::unhookFromGdb()
+{
+ // Unhook children first, so that child varitems are deleted
+ // before parent. Strictly speaking, we can avoid calling
+ // -var-delete on child varitems, but that's a bit cheesy,
+ for(QListViewItem* child = firstChild();
+ child; child = child->nextSibling())
+ {
+ static_cast<VarItem*>(child)->unhookFromGdb();
+ }
+
+ alive_ = false;
+ childrenFetched_ = false;
+
+ emit varobjNameChange(varobjName_, "");
+
+ if (!controller_->stateIsOn(s_dbgNotStarted) && !varobjName_.isEmpty())
+ {
+ controller_->addCommand(
+ new GDBCommand(
+ QString("-var-delete \"%1\"").arg(varobjName_)));
+ }
+
+ varobjName_ = "";
+}
+
+// **************************************************************************
+
+QString VarItem::tipText() const
+{
+ const unsigned int maxTooltipSize = 70;
+ QString tip = text( ValueCol );
+
+ if (tip.length() > maxTooltipSize)
+ tip = tip.mid(0, maxTooltipSize - 1 ) + " [...]";
+
+ if (!tip.isEmpty())
+ tip += "\n" + originalValueType_;
+
+ return tip;
+}
+
+bool VarItem::updateUnconditionally() const
+{
+ return updateUnconditionally_;
+}
+
+bool VarItem::isAlive() const
+{
+ return alive_;
+}
+
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+VarFrameRoot::VarFrameRoot(VariableTree *parent, int frameNo, int threadNo)
+ : TrimmableItem (parent),
+ needLocals_(false),
+ frameNo_(frameNo),
+ threadNo_(threadNo),
+ currentFrameBase((unsigned long long)-1),
+ currentFrameCodeAddress((unsigned long long)-1)
+{
+ setExpandable(true);
+}
+
+// **************************************************************************
+
+VarFrameRoot::~VarFrameRoot()
+{
+}
+
+void VarFrameRoot::setOpen(bool open)
+{
+ bool frameOpened = ( isOpen()==false && open==true );
+ QListViewItem::setOpen(open);
+
+ if (frameOpened && needLocals_)
+ {
+ needLocals_ = false;
+ VariableTree* parent = static_cast<VariableTree*>(listView());
+ parent->updateCurrentFrame();
+ }
+}
+
+// **************************************************************************
+
+bool VarFrameRoot::matchDetails(int frameNo, int threadNo)
+{
+ return frameNo == frameNo_ && threadNo == threadNo_;
+}
+
+void VarFrameRoot::setDirty()
+{
+ needLocals_ = true;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+WatchRoot::WatchRoot(VariableTree *parent)
+ : TrimmableItem(parent)
+{
+ setText(0, i18n("Watch"));
+ setOpen(true);
+}
+
+// **************************************************************************
+
+WatchRoot::~WatchRoot()
+{
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+}
+
+
+#include "variablewidget.moc"
+
diff --git a/languages/cpp/debugger/variablewidget.h b/languages/cpp/debugger/variablewidget.h
new file mode 100644
index 00000000..369f5748
--- /dev/null
+++ b/languages/cpp/debugger/variablewidget.h
@@ -0,0 +1,466 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _VARIABLEWIDGET_H_
+#define _VARIABLEWIDGET_H_
+
+#include "gdbcontroller.h"
+#include "mi/gdbmi.h"
+
+#include <klistview.h>
+#include <kcombobox.h>
+#include <qwidget.h>
+#include <qtooltip.h>
+#include <qvaluevector.h>
+#include <qdatetime.h>
+#include <qguardedptr.h>
+#include <qmap.h>
+
+#include <vector>
+
+class KLineEdit;
+class KPopupMenu;
+
+namespace GDBDebugger
+{
+
+class TrimmableItem;
+class VarFrameRoot;
+class WatchRoot;
+class VarItem;
+class VariableTree;
+class DbgController;
+class GDBBreakpointWidget;
+
+enum { VarNameCol = 0, ValueCol = 1, VarTypeCol = 2};
+enum DataType { typeUnknown, typeValue, typePointer, typeReference,
+ typeStruct, typeArray, typeQString, typeWhitespace,
+ typeName };
+
+class VariableWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ VariableWidget( GDBController* controller,
+ GDBBreakpointWidget* breakpointWidget,
+ QWidget *parent=0, const char *name=0 );
+
+ VariableTree *varTree() const
+ { return varTree_; }
+
+protected: // QWidget overrides
+ void focusInEvent(QFocusEvent *e);
+
+public slots:
+ void slotAddWatchVariable();
+ void slotAddWatchVariable(const QString &ident);
+ void slotEvaluateExpression();
+ void slotEvaluateExpression(const QString &ident);
+
+private:
+ VariableTree *varTree_;
+// KLineEdit *watchVarEntry_;
+ friend class VariableTree;
+
+ KHistoryCombo *watchVarEditor_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VariableTree : public KListView, public QToolTip
+{
+ Q_OBJECT
+public:
+ VariableTree(VariableWidget *parent,
+ GDBController* controller,
+ GDBBreakpointWidget* breakpointWidget,
+ const char *name=0 );
+ virtual ~VariableTree();
+
+ QListViewItem *lastChild() const;
+
+ QListViewItem *findRoot(QListViewItem *item) const;
+ VarFrameRoot *findFrame(int frameNo, int threadNo) const;
+ WatchRoot *findWatch();
+
+
+ // (from QToolTip) Display a tooltip when the cursor is over an item
+ virtual void maybeTip(const QPoint &);
+
+ GDBController* controller() const { return controller_; }
+
+signals:
+ void toggleWatchpoint(const QString &varName);
+
+public slots:
+ void slotAddWatchVariable(const QString& watchVar);
+ void slotEvaluateExpression(const QString& expression);
+
+ void slotEvent(GDBController::event_t);
+ void slotItemRenamed(QListViewItem* item, int col, const QString& text);
+
+private slots:
+ void slotContextMenu(KListView *, QListViewItem *item);
+ void slotVarobjNameChanged(const QString& from, const QString& to);
+
+private: // Callbacks for gdb commands;
+ void argumentsReady(const GDBMI::ResultRecord&);
+ void localsReady(const GDBMI::ResultRecord&);
+ void frameIdReady(const QValueVector<QString>&);
+ void handleVarUpdate(const GDBMI::ResultRecord&);
+ void handleEvaluateExpression(const QValueVector<QString>&);
+ void variablesFetchDone();
+ void fetchSpecialValuesDone();
+
+ /** This is called when address of expression for which
+ popup is created is known.
+
+ If there's no address (for rvalue), does nothing
+ (leaving "Data breakpoint" item disabled).
+ Otherwise, enabled that item, and check is we
+ have data breakpoint for that address already.
+ */
+ void handleAddressComputed(const GDBMI::ResultRecord& r);
+
+private: // helper functions
+ /** Get (if exists) and create (otherwise) frame root for
+ the specified frameNo/threadNo combination.
+ */
+ VarFrameRoot* demand_frame_root(int frameNo, int threadNo);
+
+ void updateCurrentFrame();
+
+ /** Copies the value (second column) of the specified item to
+ the clipboard.
+ */
+ void copyToClipboard(QListViewItem*);
+
+private: // QWidget overrides
+ void keyPressEvent(QKeyEvent* e);
+
+private:
+ GDBController* controller_;
+ GDBBreakpointWidget* breakpointWidget_;
+
+ int activeFlag_;
+ int iOutRadix;
+ bool justPaused_;
+
+ // Root of all recently printed expressions.
+ TrimmableItem* recentExpressions_;
+ VarFrameRoot* currentFrameItem;
+
+ QTime fetch_time;
+ // Names of locals and arguments as reported by
+ // gdb.
+ std::vector<QString> locals_and_arguments;
+
+ QMap<QString, VarItem*> varobj2varitem;
+
+ KPopupMenu* activePopup_;
+ static const int idToggleWatch = 10;
+
+ friend class VarFrameRoot;
+ friend class VarItem;
+ friend class WatchRoot;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+/** List view item that can 'trim' outdated children.
+
+ The instances of this class hold a number of children corresponding
+ to variables. When program state changes, such as after a step in source,
+ some variable values can change, and some variables can go out of scope.
+ We need
+ - highlight modified variables
+ - remove gone variables
+
+ We could just remove all children and repopulate the list from
+ the data from debugger, but then we'd loose information about previous
+ variable values.
+
+ So, we first update the values, highlighting the modified variables, and
+ keeping track which variables were recieved from gdb. After that, the
+ 'trim' method is called, removing all variables which were not recieved
+ from gdbr.
+ */
+class TrimmableItem : public KListViewItem
+{
+public:
+ TrimmableItem(VariableTree *parent);
+ TrimmableItem(TrimmableItem *parent);
+
+ virtual ~TrimmableItem();
+
+ QListViewItem *lastChild() const;
+
+protected:
+
+ void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int align );
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VarItem : public QObject,
+ public TrimmableItem
+{
+ Q_OBJECT
+public:
+ enum format_t { natural, hexadecimal, decimal, character, binary };
+
+ /** Creates top-level variable item from the specified expression.
+ Optionally, alternative display name can be provided.
+ */
+ VarItem( TrimmableItem *parent,
+ const QString& expression,
+ bool frozen = false);
+
+ VarItem( TrimmableItem *parent, const GDBMI::Value& varobj,
+ format_t format, bool baseClassMember);
+
+ virtual ~VarItem();
+
+ /// Returns the gdb expression for *this.
+ QString gdbExpression() const;
+
+ /** Returns true is this VarItem should be unconditionally
+ updated on each step, not matter what's the result of
+ -var-update command.
+ */
+ bool updateUnconditionally() const;
+
+ void updateValue();
+ void updateSpecialRepresentation(const QString& s);
+
+ /** Creates a fresh gdbs "variable object", if needed.
+ Preconditions:
+ - frame id did not change
+ - this is a root variable
+
+ If the current type of expression, or it's address, it different
+ from it was previously, creates new "variable object" and
+ fetches new value.
+
+ Otherwise, does nothing.
+ */
+ void recreateLocallyMaybe();
+
+ /** Tries to create new gdb variable object for this expression.
+ If successfull, updates all values. Otherwise, makes
+ itself disabled.
+ */
+ void recreate();
+
+ void setOpen(bool open);
+ void setText (int column, const QString& text);
+
+ /** Mark the variable as alive, or not alive.
+ Variables that are not alive a shown as "gray",
+ and nothing can be done about them except for
+ removing. */
+ void setAliveRecursively(bool enable);
+
+ /** Recursively clears the varobjName_ field, making
+ *this completely disconnected from gdb.
+ Automatically makes *this and children disables,
+ since there's no possible interaction with unhooked
+ object.
+ */
+ void unhookFromGdb();
+
+ // Returns the text to be displayed as tooltip (the value)
+ QString tipText() const;
+
+ format_t format() const;
+ void setFormat(format_t f);
+ format_t formatFromGdbModifier(char c) const;
+
+ /** Clears highliting for this variable and
+ all its children. */
+ void clearHighlight();
+
+ /** Sets new top-level textual value of this variable.
+ */
+ void setValue(const QString& new_value);
+
+ bool isAlive() const;
+
+signals:
+ /** Emitted whenever the name of varobj associated with *this changes:
+ - when we've created initial varobj
+ - when we've changed varobj name as part of 'recreate' method
+ - when *this is destroyed and no longer uses any varobj.
+
+ Either 'from' or 'to' can be empty string.
+ */
+ void varobjNameChange(const QString& from, const QString& to);
+
+private:
+
+ /** Creates new gdb "variable object". The controller_,
+ expression_ and format_ member variables should already
+ be set.
+ */
+ void createVarobj();
+
+ /** Precondition: 'name' is a name of existing
+ gdb variable object.
+ Effects:
+ - sets varobjName_ to 'name'
+ - sets format, if it's not default one
+ - gets initial value
+ - if item is open, gets children.
+ */
+ void setVarobjName(const QString& name);
+
+
+ /** Handle types that require special dispay, such as
+ QString. Return true if this is such a type.
+ The 'originalValueType_' is already initialized
+ by the time this method is called.
+ */
+ bool handleSpecialTypes();
+ void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int align );
+ void varobjCreated(const GDBMI::ResultRecord& r);
+ void valueDone(const GDBMI::ResultRecord& r);
+ void childrenDone(const GDBMI::ResultRecord& r);
+ void childrenOfFakesDone(const GDBMI::ResultRecord& r);
+ void handleCurrentAddress(const QValueVector<QString>& lines);
+ void handleType(const QValueVector<QString>& lines);
+
+ void createChildren(const GDBMI::ResultRecord& r, bool children_of_fake);
+
+ /** Called to handle the output of the cli print command.
+ */
+ void handleCliPrint(const QValueVector<QString>& lines);
+
+ // Assuming 'expression_' is already set, returns the
+ // displayName to use when showing this to the user.
+ // This function exists because if we have item with
+ // gdb expression '$1' and displayName 'P4', we want the child
+ // to show up as *P4, not as '*$1', so we can't uncondionally
+ // use expression gdb reports to us.
+ QString displayName() const;
+
+ VariableTree* varTree() const;
+
+ QString varobjFormatName() const;
+
+private:
+ // The gdb expression for this varItem relatively to
+ // parent VarItem.
+ QString expression_;
+
+ bool highlight_;
+ GDBController* controller_;
+
+ QString varobjName_;
+
+ // the non-cast type of the variable
+ QString originalValueType_;
+ bool oldSpecialRepresentationSet_;
+ QString oldSpecialRepresentation_;
+
+ format_t format_;
+
+ static int varobjIndex;
+
+ int numChildren_;
+ bool childrenFetched_;
+
+ QString currentAddress_;
+ QString lastObtainedAddress_;
+
+ bool updateUnconditionally_;
+ bool frozen_;
+
+ /* Set to true whan calling createVarobj for the
+ first time, and to false other time. */
+ bool initialCreation_;
+
+ /* Set if this VarItem corresponds to base class suboject. */
+ bool baseClassMember_;
+
+ bool alive_;
+};
+
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VarFrameRoot : public TrimmableItem
+{
+public:
+ VarFrameRoot(VariableTree *parent, int frameNo, int threadNo);
+ virtual ~VarFrameRoot();
+
+ void setOpen(bool open);
+
+ // Marks the frame as dirty, that is as having
+ // out of date values. As soon as we try to open
+ // this item, it will fetch new data.
+ void setDirty();
+
+ void setFrameName(const QString &frameName)
+ { setText(VarNameCol, frameName); setText(ValueCol, ""); }
+
+ bool needLocals() const { return needLocals_; }
+ bool matchDetails(int frameNo, int threadNo);
+
+private:
+ bool needLocals_;
+ int frameNo_;
+ int threadNo_;
+
+ // Frame base and code address of the current inner-most
+ // frame. Needed so that if we can know when 'frame N' no longer
+ // is the same as 'frame N' when this 'VarFrameRoot' was created.
+ unsigned long long currentFrameBase;
+ unsigned long long currentFrameCodeAddress;
+
+ friend class VariableTree;
+
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class WatchRoot : public TrimmableItem
+{
+public:
+ WatchRoot(VariableTree *parent);
+ virtual ~WatchRoot();
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#endif
diff --git a/languages/cpp/declarationinfo.h b/languages/cpp/declarationinfo.h
new file mode 100644
index 00000000..f1d28f26
--- /dev/null
+++ b/languages/cpp/declarationinfo.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 DECLARATIONINFO_H
+#define DECLARATIONINFO_H
+
+#include <qstring.h>
+
+struct DeclarationInfo {
+ class File {
+ QString m_file;
+ public:
+ File( const QString& file = "" ) : m_file( file ) {
+ }
+
+ operator QString() const {
+ return m_file;
+ }
+ };
+
+ DeclarationInfo() : startLine(0), startCol(0), endLine(0), endCol(0) {
+ }
+
+ operator bool() {
+ return !name.isEmpty();
+ }
+
+ QString locationToText() const {
+ return QString("line %1 col %2 - line %3 col %4\nfile: %5").arg(startLine).arg(startCol).arg(endLine).arg(endCol).arg(file);
+ }
+
+ QString toText() const {
+ if( name.isEmpty() ) return "";
+
+ QString ret;
+ ret = QString("name: " + name + "\n" ) + locationToText();
+ if( !comment.isEmpty() ) {
+ ret += "\n\"" + comment + "\"";
+ }
+ return ret;
+ }
+
+ int startLine, startCol;
+ int endLine, endCol;
+
+ File file;
+ QString name;
+ QString comment;
+};
+
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/doc/Makefile.am b/languages/cpp/doc/Makefile.am
new file mode 100644
index 00000000..55571124
--- /dev/null
+++ b/languages/cpp/doc/Makefile.am
@@ -0,0 +1,7 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = libc.toc libstdc++.toc kdetemplates.toc stl.toc qt-kdev3.toc kde2book.toc \
+ gnustep.toc gnome1.toc clanlib.toc c++_bugs_gcc.toc gtk_bugs.toc wxwidgets_bugs.toc \
+ cppannotations.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA = libc.index libstdc++.index stl.index kde2book.index
diff --git a/languages/cpp/doc/c++_bugs_gcc.toc b/languages/cpp/doc/c++_bugs_gcc.toc
new file mode 100644
index 00000000..758b6675
--- /dev/null
+++ b/languages/cpp/doc/c++_bugs_gcc.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>C++ bugs (GCC)</title>
+<base href="http://gcc.gnu.org/bugzilla/"/>
+<tocsect1 name="Query" url="query.cgi">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/cpp/doc/clanlib.toc b/languages/cpp/doc/clanlib.toc
new file mode 100644
index 00000000..04ed2041
--- /dev/null
+++ b/languages/cpp/doc/clanlib.toc
@@ -0,0 +1,384 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Clanlib</title>
+<base href="http://www.clanlib.org/docs/" />
+<tocsect1 name="Overview" url="overview/index.html">
+ <tocsect2 name="Getting started" url="overview/getting_started.html" />
+ <tocsect2 name="Display overview" url="overview/display-1.html" />
+ <tocsect2 name="Resources" url="overview/resources-1.html" />
+ <tocsect2 name="Sound overview" url="overview/sound_overview.html" />
+ <tocsect2 name="Signals &amp; Slots overview" url="overview/signals.html" />
+ <tocsect2 name="Sprites overview" url="overview/sprites_overview.html" />
+ <tocsect2 name="Font overview" url="overview/font_overview-1.html" />
+ <tocsect2 name="Loading graphics overview" url="overview/loading_graphics.html" />
+ <tocsect2 name="OpenGL overview" url="overview/opengl_overview.html" />
+ <tocsect2 name="GUI overview" url="overview/gui_overview.html" />
+ <tocsect2 name="GUI Theme/Style creation" url="overview/gui_theme.html" />
+ <tocsect2 name="GUI XML creation" url="overview/gui_resources.html" />
+ <tocsect2 name="Network overview" url="overview/network_overview.html" />
+ <tocsect2 name="Smart pointers" url="overview/pointers.html" />
+ <tocsect2 name="Post-Mortem Debugging" url="overview/crash_reporter.html" />
+ <tocsect2 name="Core resources" url="overview/core_resources.html" />
+ <tocsect2 name="Font resources" url="overview/font_resources.html" />
+ <tocsect2 name="Sprites resources" url="overview/sprites_resources.html" />
+ <tocsect2 name="Surface resources" url="overview/surface_resources.html" />
+ <tocsect2 name="Sample resources" url="overview/sample_resources.html" />
+ <tocsect2 name="Tips &amp; Tricks" url="overview/tipsandtricks.html" />
+</tocsect1>
+<tocsect1 name="API Reference" url="reference/index.html">
+ <tocsect2 name="App" url="">
+ <tocsect3 name="System" url="">
+ <tocsect4 name="CL_ClanApplication" url="reference/CL_ClanApplication.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Core">
+ <tocsect3 name="I/O Data">
+ <tocsect4 name="CL_Directory" url="reference/CL_Directory.html" />
+ <tocsect4 name="CL_DirectoryScanner" url="reference/CL_DirectoryScanner.html" />
+ <tocsect4 name="CL_Endian" url="reference/CL_Endian.html" />
+ <tocsect4 name="CL_InputSource" url="reference/CL_InputSource.html" />
+ <tocsect4 name="CL_InputSourceProvider" url="reference/CL_InputSourceProvider.html" />
+ <tocsect4 name="CL_InputSourceProvider_File" url="reference/CL_InputSourceProvider_File.html" />
+ <tocsect4 name="CL_InputSource_File" url="reference/CL_InputSource_File.html" />
+ <tocsect4 name="CL_InputSource_Memory" url="reference/CL_InputSource_Memory.html" />
+ <tocsect4 name="CL_InputSource_Zipped" url="reference/CL_InputSource_Zipped.html" />
+ <tocsect4 name="CL_OutputSource" url="reference/CL_OutputSource.html" />
+ <tocsect4 name="CL_OutputSourceProvider" url="reference/CL_OutputSourceProvider.html" />
+ <tocsect4 name="CL_OutputSource_File" url="reference/CL_OutputSource_File.html" />
+ <tocsect4 name="CL_OutputSource_Memory" url="reference/CL_OutputSource_Memory.html" />
+ <tocsect4 name="CL_OutputSource_Zipped" url="reference/CL_OutputSource_Zipped.html" />
+ <tocsect4 name="CL_Zip_Archive" url="reference/CL_Zip_Archive.html" />
+ <tocsect4 name="CL_Zip_FileEntry" url="reference/CL_Zip_FileEntry.html" />
+ </tocsect3>
+ <tocsect3 name="Library">
+ <tocsect4 name="CL_LibraryFactory" url="reference/CL_LibraryFactory.html" />
+ <tocsect4 name="CL_LibraryLoader" url="reference/CL_LibraryLoader.html" />
+ <tocsect4 name="CL_LibraryManager" url="reference/CL_LibraryManager.html" />
+ </tocsect3>
+ <tocsect3 name="Math">
+ <tocsect4 name="CL_DelauneyTriangulator" url="reference/CL_DelauneyTriangulator.html" />
+ <tocsect4 name="CL_DelauneyTriangulator_Triangle" url="reference/CL_DelauneyTriangulator_Triangle.html" />
+ <tocsect4 name="CL_DelauneyTriangulator_Vertex" url="reference/CL_DelauneyTriangulator_Vertex.html" />
+ <tocsect4 name="CL_LineMath" url="reference/CL_LineMath.html" />
+ <tocsect4 name="CL_Matrix4x4" url="reference/CL_Matrix4x4.html" />
+ <tocsect4 name="CL_NumberPool" url="reference/CL_NumberPool.html" />
+ <tocsect4 name="CL_OutlineTriangulator" url="reference/CL_OutlineTriangulator.html" />
+ <tocsect4 name="CL_Point" url="reference/CL_Point.html" />
+ <tocsect4 name="CL_Pointf" url="reference/CL_Pointf.html" />
+ <tocsect4 name="CL_Quad" url="reference/CL_Quad.html" />
+ <tocsect4 name="CL_Rect" url="reference/CL_Rect.html" />
+ <tocsect4 name="CL_Rectf" url="reference/CL_Rectf.html" />
+ <tocsect4 name="CL_Size" url="reference/CL_Size.html" />
+ <tocsect4 name="CL_Sizef" url="reference/CL_Sizef.html" />
+ <tocsect4 name="CL_TriangleMath" url="reference/CL_TriangleMath.html" />
+ <tocsect4 name="CL_Vector" url="reference/CL_Vector.html" />
+ <tocsect4 name="CL_Vector2" url="reference/CL_Vector2.html" />
+ </tocsect3>
+ <tocsect3 name="Resources">
+ <tocsect4 name="CL_Boolean" url="reference/CL_Boolean.html" />
+ <tocsect4 name="CL_Float" url="reference/CL_Float.html" />
+ <tocsect4 name="CL_InputSource_Raw" url="reference/CL_InputSource_Raw.html" />
+ <tocsect4 name="CL_Integer" url="reference/CL_Integer.html" />
+ <tocsect4 name="CL_Raw" url="reference/CL_Raw.html" />
+ <tocsect4 name="CL_Resource" url="reference/CL_Resource.html" />
+ <tocsect4 name="CL_ResourceData" url="reference/CL_ResourceData.html" />
+ <tocsect4 name="CL_ResourceData_Boolean" url="reference/CL_ResourceData_Boolean.html" />
+ <tocsect4 name="CL_ResourceData_Float" url="reference/CL_ResourceData_Float.html" />
+ <tocsect4 name="CL_ResourceData_Integer" url="reference/CL_ResourceData_Integer.html" />
+ <tocsect4 name="CL_ResourceData_Raw" url="reference/CL_ResourceData_Raw.html" />
+ <tocsect4 name="CL_ResourceData_String" url="reference/CL_ResourceData_String.html" />
+ <tocsect4 name="CL_ResourceManager" url="reference/CL_ResourceManager.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_Assert" url="reference/CL_Assert.html" />
+ <tocsect4 name="CL_CallStack" url="reference/CL_CallStack.html" />
+ <tocsect4 name="CL_Clonable" url="reference/CL_Clonable.html" />
+ <tocsect4 name="CL_CommandLine" url="reference/CL_CommandLine.html" />
+ <tocsect4 name="CL_ConsoleWindow" url="reference/CL_ConsoleWindow.html" />
+ <tocsect4 name="CL_CrashReporter" url="reference/CL_CrashReporter.html" />
+ <tocsect4 name="CL_Error" url="reference/CL_Error.html" />
+ <tocsect4 name="CL_EventListener" url="reference/CL_EventListener.html" />
+ <tocsect4 name="CL_EventTrigger" url="reference/CL_EventTrigger.html" />
+ <tocsect4 name="CL_KeepAlive" url="reference/CL_KeepAlive.html" />
+ <tocsect4 name="CL_Log" url="reference/CL_Log.html" />
+ <tocsect4 name="CL_Mutex" url="reference/CL_Mutex.html" />
+ <tocsect4 name="CL_MutexSection" url="reference/CL_MutexSection.html" />
+ <tocsect4 name="CL_Runnable" url="reference/CL_Runnable.html" />
+ <tocsect4 name="CL_SetupCore" url="reference/CL_SetupCore.html" />
+ <tocsect4 name="CL_String" url="reference/CL_String.html" />
+ <tocsect4 name="CL_System" url="reference/CL_System.html" />
+ <tocsect4 name="CL_Thread" url="reference/CL_Thread.html" />
+ <tocsect4 name="CL_Timer" url="reference/CL_Timer.html" />
+ </tocsect3>
+ <tocsect3 name="XML">
+ <tocsect4 name="CL_DomAttr" url="reference/CL_DomAttr.html" />
+ <tocsect4 name="CL_DomCDATASection" url="reference/CL_DomCDATASection.html" />
+ <tocsect4 name="CL_DomCharacterData" url="reference/CL_DomCharacterData.html" />
+ <tocsect4 name="CL_DomComment" url="reference/CL_DomComment.html" />
+ <tocsect4 name="CL_DomDocument" url="reference/CL_DomDocument.html" />
+ <tocsect4 name="CL_DomDocumentFragment" url="reference/CL_DomDocumentFragment.html" />
+ <tocsect4 name="CL_DomDocumentType" url="reference/CL_DomDocumentType.html" />
+ <tocsect4 name="CL_DomElement" url="reference/CL_DomElement.html" />
+ <tocsect4 name="CL_DomEntity" url="reference/CL_DomEntity.html" />
+ <tocsect4 name="CL_DomEntityReference" url="reference/CL_DomEntityReference.html" />
+ <tocsect4 name="CL_DomException" url="reference/CL_DomException.html" />
+ <tocsect4 name="CL_DomImplementation" url="reference/CL_DomImplementation.html" />
+ <tocsect4 name="CL_DomNamedNodeMap" url="reference/CL_DomNamedNodeMap.html" />
+ <tocsect4 name="CL_DomNode" url="reference/CL_DomNode.html" />
+ <tocsect4 name="CL_DomNodeList" url="reference/CL_DomNodeList.html" />
+ <tocsect4 name="CL_DomNotation" url="reference/CL_DomNotation.html" />
+ <tocsect4 name="CL_DomProcessingInstruction" url="reference/CL_DomProcessingInstruction.html" />
+ <tocsect4 name="CL_DomText" url="reference/CL_DomText.html" />
+ <tocsect4 name="CL_XMLToken" url="reference/CL_XMLToken.html" />
+ <tocsect4 name="CL_XMLTokenLoad" url="reference/CL_XMLTokenLoad.html" />
+ <tocsect4 name="CL_XMLTokenSave" url="reference/CL_XMLTokenSave.html" />
+ <tocsect4 name="CL_XMLTokenString" url="reference/CL_XMLTokenString.html" />
+ <tocsect4 name="CL_XMLTokenizer" url="reference/CL_XMLTokenizer.html" />
+ <tocsect4 name="CL_XMLWriter" url="reference/CL_XMLWriter.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Display">
+ <tocsect3 name="Collision">
+ <tocsect4 name="CL_CollisionOutline" url="reference/CL_CollisionOutline.html" />
+ <tocsect4 name="CL_Contour" url="reference/CL_Contour.html" />
+ <tocsect4 name="CL_OutlineCircle" url="reference/CL_OutlineCircle.html" />
+ <tocsect4 name="CL_OutlineProvider" url="reference/CL_OutlineProvider.html" />
+ <tocsect4 name="CL_OutlineProviderBitmap" url="reference/CL_OutlineProviderBitmap.html" />
+ <tocsect4 name="CL_OutlineProviderFile" url="reference/CL_OutlineProviderFile.html" />
+ </tocsect3>
+ <tocsect3 name="Display 2D">
+ <tocsect4 name="CL_Canvas" url="reference/CL_Canvas.html" />
+ <tocsect4 name="CL_Color" url="reference/CL_Color.html" />
+ <tocsect4 name="CL_Display" url="reference/CL_Display.html" />
+ <tocsect4 name="CL_DisplayMode" url="reference/CL_DisplayMode.html" />
+ <tocsect4 name="CL_DisplayWindow" url="reference/CL_DisplayWindow.html" />
+ <tocsect4 name="CL_DisplayWindowDescription" url="reference/CL_DisplayWindowDescription.html" />
+ <tocsect4 name="CL_FramerateCounter" url="reference/CL_FramerateCounter.html" />
+ <tocsect4 name="CL_Gradient" url="reference/CL_Gradient.html" />
+ <tocsect4 name="CL_GraphicContext" url="reference/CL_GraphicContext.html" />
+ <tocsect4 name="CL_Palette" url="reference/CL_Palette.html" />
+ <tocsect4 name="CL_PixelBuffer" url="reference/CL_PixelBuffer.html" />
+ <tocsect4 name="CL_PixelFormat" url="reference/CL_PixelFormat.html" />
+ <tocsect4 name="CL_RLESurface" url="reference/CL_RLESurface.html" />
+ <tocsect4 name="CL_Surface" url="reference/CL_Surface.html" />
+ <tocsect4 name="CL_Surface_DrawParams1" url="reference/CL_Surface_DrawParams1.html" />
+ <tocsect4 name="CL_Surface_DrawParams2" url="reference/CL_Surface_DrawParams2.html" />
+ </tocsect3>
+ <tocsect3 name="Fonts">
+ <tocsect4 name="CL_Font" url="reference/CL_Font.html" />
+ <tocsect4 name="CL_GlyphBuffer" url="reference/CL_GlyphBuffer.html" />
+ <tocsect4 name="CL_TextStyler" url="reference/CL_TextStyler.html" />
+ </tocsect3>
+ <tocsect3 name="Input">
+ <tocsect4 name="CL_InputBuffer" url="reference/CL_InputBuffer.html" />
+ <tocsect4 name="CL_InputButton" url="reference/CL_InputButton.html" />
+ <tocsect4 name="CL_InputContext" url="reference/CL_InputContext.html" />
+ <tocsect4 name="CL_InputDevice" url="reference/CL_InputDevice.html" />
+ <tocsect4 name="CL_InputEvent" url="reference/CL_InputEvent.html" />
+ <tocsect4 name="CL_Joystick" url="reference/CL_Joystick.html" />
+ <tocsect4 name="CL_KeyBinding" url="reference/CL_KeyBinding.html" />
+ <tocsect4 name="CL_Keyboard" url="reference/CL_Keyboard.html" />
+ <tocsect4 name="CL_Mouse" url="reference/CL_Mouse.html" />
+ </tocsect3>
+ <tocsect3 name="Sprites">
+ <tocsect4 name="CL_Sprite" url="reference/CL_Sprite.html" />
+ <tocsect4 name="CL_SpriteDescription" url="reference/CL_SpriteDescription.html" />
+ <tocsect4 name="CL_SpritePacker" url="reference/CL_SpritePacker.html" />
+ </tocsect3>
+ <tocsect3 name="Surface Providers">
+ <tocsect4 name="CL_DeviceContextBuffer" url="reference/CL_DeviceContextBuffer.html" />
+ <tocsect4 name="CL_JPEGProvider" url="reference/CL_JPEGProvider.html" />
+ <tocsect4 name="CL_PCXProvider" url="reference/CL_PCXProvider.html" />
+ <tocsect4 name="CL_PNGProvider" url="reference/CL_PNGProvider.html" />
+ <tocsect4 name="CL_ProviderFactory" url="reference/CL_ProviderFactory.html" />
+ <tocsect4 name="CL_ProviderType" url="reference/CL_ProviderType.html" />
+ <tocsect4 name="CL_TargaProvider" url="reference/CL_TargaProvider.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupDisplay" url="reference/CL_SetupDisplay.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="GL">
+ <tocsect3 name="Display 2D">
+ <tocsect4 name="CL_OpenGLSurface" url="reference/CL_OpenGLSurface.html" />
+ <tocsect4 name="CL_OpenGLWindow" url="reference/CL_OpenGLWindow.html" />
+ <tocsect4 name="CL_OpenGLWindowDescription" url="reference/CL_OpenGLWindowDescription.html" />
+ </tocsect3>
+ <tocsect3 name="Display 3D">
+ <tocsect4 name="CL_LightSource" url="reference/CL_LightSource.html" />
+ <tocsect4 name="CL_Material" url="reference/CL_Material.html" />
+ <tocsect4 name="CL_ProgramAttribute" url="reference/CL_ProgramAttribute.html" />
+ <tocsect4 name="CL_ProgramObject" url="reference/CL_ProgramObject.html" />
+ <tocsect4 name="CL_ProgramUniform" url="reference/CL_ProgramUniform.html" />
+ <tocsect4 name="CL_ShaderObject" url="reference/CL_ShaderObject.html" />
+ <tocsect4 name="CL_Texture" url="reference/CL_Texture.html" />
+ <tocsect4 name="CL_TextureUnit" url="reference/CL_TextureUnit.html" />
+ <tocsect4 name="CL_Viewpoint" url="reference/CL_Viewpoint.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_GLFunctions" url="reference/CL_GLFunctions.html" />
+ <tocsect4 name="CL_OpenGL" url="reference/CL_OpenGL.html" />
+ <tocsect4 name="CL_OpenGLState" url="reference/CL_OpenGLState.html" />
+ <tocsect4 name="CL_OpenGLStateData" url="reference/CL_OpenGLStateData.html" />
+ <tocsect4 name="CL_SetupGL" url="reference/CL_SetupGL.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="GUI">
+ <tocsect3 name="Controls">
+ <tocsect4 name="CL_Button" url="reference/CL_Button.html" />
+ <tocsect4 name="CL_CheckBox" url="reference/CL_CheckBox.html" />
+ <tocsect4 name="CL_FileDialog" url="reference/CL_FileDialog.html" />
+ <tocsect4 name="CL_Frame" url="reference/CL_Frame.html" />
+ <tocsect4 name="CL_Image" url="reference/CL_Image.html" />
+ <tocsect4 name="CL_InputBox" url="reference/CL_InputBox.html" />
+ <tocsect4 name="CL_InputDialog" url="reference/CL_InputDialog.html" />
+ <tocsect4 name="CL_Label" url="reference/CL_Label.html" />
+ <tocsect4 name="CL_ListBox" url="reference/CL_ListBox.html" />
+ <tocsect4 name="CL_Menu" url="reference/CL_Menu.html" />
+ <tocsect4 name="CL_MenuItem" url="reference/CL_MenuItem.html" />
+ <tocsect4 name="CL_MenuNode" url="reference/CL_MenuNode.html" />
+ <tocsect4 name="CL_MessageBox" url="reference/CL_MessageBox.html" />
+ <tocsect4 name="CL_ProgressBar" url="reference/CL_ProgressBar.html" />
+ <tocsect4 name="CL_RadioButton" url="reference/CL_RadioButton.html" />
+ <tocsect4 name="CL_RadioGroup" url="reference/CL_RadioGroup.html" />
+ <tocsect4 name="CL_ScrollBar" url="reference/CL_ScrollBar.html" />
+ <tocsect4 name="CL_TreeItem" url="reference/CL_TreeItem.html" />
+ <tocsect4 name="CL_TreeNode" url="reference/CL_TreeNode.html" />
+ <tocsect4 name="CL_TreeView" url="reference/CL_TreeView.html" />
+ <tocsect4 name="CL_Window" url="reference/CL_Window.html" />
+ </tocsect3>
+ <tocsect3 name="Framework">
+ <tocsect4 name="CL_Component" url="reference/CL_Component.html" />
+ <tocsect4 name="CL_ComponentManager" url="reference/CL_ComponentManager.html" />
+ <tocsect4 name="CL_ComponentMoveHandler" url="reference/CL_ComponentMoveHandler.html" />
+ <tocsect4 name="CL_ComponentResizeHandler" url="reference/CL_ComponentResizeHandler.html" />
+ <tocsect4 name="CL_ComponentStyle" url="reference/CL_ComponentStyle.html" />
+ <tocsect4 name="CL_ComponentType" url="reference/CL_ComponentType.html" />
+ <tocsect4 name="CL_Deck" url="reference/CL_Deck.html" />
+ <tocsect4 name="CL_GUIManager" url="reference/CL_GUIManager.html" />
+ <tocsect4 name="CL_Layout" url="reference/CL_Layout.html" />
+ <tocsect4 name="CL_ListItem" url="reference/CL_ListItem.html" />
+ <tocsect4 name="CL_StyleManager" url="reference/CL_StyleManager.html" />
+ </tocsect3>
+ <tocsect3 name="Style: Silver">
+ <tocsect4 name="CL_Button_Silver" url="reference/CL_Button_Silver.html" />
+ <tocsect4 name="CL_CheckBox_Silver" url="reference/CL_CheckBox_Silver.html" />
+ <tocsect4 name="CL_Frame_Silver" url="reference/CL_Frame_Silver.html" />
+ <tocsect4 name="CL_Image_Silver" url="reference/CL_Image_Silver.html" />
+ <tocsect4 name="CL_InputBox_Silver" url="reference/CL_InputBox_Silver.html" />
+ <tocsect4 name="CL_Label_Silver" url="reference/CL_Label_Silver.html" />
+ <tocsect4 name="CL_ListBox_Silver" url="reference/CL_ListBox_Silver.html" />
+ <tocsect4 name="CL_MenuItem_Silver" url="reference/CL_MenuItem_Silver.html" />
+ <tocsect4 name="CL_MenuNode_Silver" url="reference/CL_MenuNode_Silver.html" />
+ <tocsect4 name="CL_Menu_Silver" url="reference/CL_Menu_Silver.html" />
+ <tocsect4 name="CL_ProgressBar_Silver" url="reference/CL_ProgressBar_Silver.html" />
+ <tocsect4 name="CL_RadioButton_Silver" url="reference/CL_RadioButton_Silver.html" />
+ <tocsect4 name="CL_ScrollBar_Silver" url="reference/CL_ScrollBar_Silver.html" />
+ <tocsect4 name="CL_StyleManager_Silver" url="reference/CL_StyleManager_Silver.html" />
+ <tocsect4 name="CL_TreeItem_Silver" url="reference/CL_TreeItem_Silver.html" />
+ <tocsect4 name="CL_TreeView_Silver" url="reference/CL_TreeView_Silver.html" />
+ <tocsect4 name="CL_Window_Silver" url="reference/CL_Window_Silver.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupGUI" url="reference/CL_SetupGUI.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="MikMod">
+ <tocsect3 name="Sound Providers">
+ <tocsect4 name="CL_SoundProvider_MikMod" url="reference/CL_SoundProvider_MikMod.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupMikMod" url="reference/CL_SetupMikMod.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Network">
+ <tocsect3 name="Internet Relay Chat">
+ <tocsect4 name="CL_DCCDownload" url="reference/CL_DCCDownload.html" />
+ <tocsect4 name="CL_IRCConnection" url="reference/CL_IRCConnection.html" />
+ </tocsect3>
+ <tocsect3 name="NetObjects">
+ <tocsect4 name="CL_NetObject_Client" url="reference/CL_NetObject_Client.html" />
+ <tocsect4 name="CL_NetObject_Controller" url="reference/CL_NetObject_Controller.html" />
+ <tocsect4 name="CL_NetObject_Server" url="reference/CL_NetObject_Server.html" />
+ <tocsect4 name="CL_NetVariables" url="reference/CL_NetVariables.html" />
+ </tocsect3>
+ <tocsect3 name="NetSessions">
+ <tocsect4 name="CL_InputSource_NetPacket" url="reference/CL_InputSource_NetPacket.html" />
+ <tocsect4 name="CL_InputSource_NetStream" url="reference/CL_InputSource_NetStream.html" />
+ <tocsect4 name="CL_NetComputer" url="reference/CL_NetComputer.html" />
+ <tocsect4 name="CL_NetGroup" url="reference/CL_NetGroup.html" />
+ <tocsect4 name="CL_NetPacket" url="reference/CL_NetPacket.html" />
+ <tocsect4 name="CL_NetSession" url="reference/CL_NetSession.html" />
+ <tocsect4 name="CL_NetStream" url="reference/CL_NetStream.html" />
+ <tocsect4 name="CL_OutputSource_NetPacket" url="reference/CL_OutputSource_NetPacket.html" />
+ <tocsect4 name="CL_OutputSource_NetStream" url="reference/CL_OutputSource_NetStream.html" />
+ </tocsect3>
+ <tocsect3 name="Sockets">
+ <tocsect4 name="CL_IPAddress" url="reference/CL_IPAddress.html" />
+ <tocsect4 name="CL_InputSource_Socket" url="reference/CL_InputSource_Socket.html" />
+ <tocsect4 name="CL_OutputSource_Socket" url="reference/CL_OutputSource_Socket.html" />
+ <tocsect4 name="CL_Socket" url="reference/CL_Socket.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupNetwork" url="reference/CL_SetupNetwork.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="SDL">
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupSDL" url="reference/CL_SetupSDL.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Signal">
+ <tocsect3 name="System">
+ <tocsect4 name="CL_FunctionSlot_v0" url="reference/CL_FunctionSlot_v0.html" />
+ <tocsect4 name="CL_Signal" url="reference/CL_Signal.html" />
+ <tocsect4 name="CL_Signal_v0" url="reference/CL_Signal_v0.html" />
+ <tocsect4 name="CL_Signal_v0_Generic" url="reference/CL_Signal_v0_Generic.html" />
+ <tocsect4 name="CL_Slot" url="reference/CL_Slot.html" />
+ <tocsect4 name="CL_SlotBuffer_v0" url="reference/CL_SlotBuffer_v0.html" />
+ <tocsect4 name="CL_SlotContainer" url="reference/CL_SlotContainer.html" />
+ <tocsect4 name="CL_SlotParent_v0" url="reference/CL_SlotParent_v0.html" />
+ <tocsect4 name="CL_Slot_Generic" url="reference/CL_Slot_Generic.html" />
+ <tocsect4 name="CL_Slot_v0" url="reference/CL_Slot_v0.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Sound">
+ <tocsect3 name="Audio Mixing">
+ <tocsect4 name="CL_Sound" url="reference/CL_Sound.html" />
+ <tocsect4 name="CL_SoundBuffer" url="reference/CL_SoundBuffer.html" />
+ <tocsect4 name="CL_SoundBuffer_Session" url="reference/CL_SoundBuffer_Session.html" />
+ <tocsect4 name="CL_SoundFilter" url="reference/CL_SoundFilter.html" />
+ <tocsect4 name="CL_SoundOutput" url="reference/CL_SoundOutput.html" />
+ <tocsect4 name="CL_SoundOutput_Description" url="reference/CL_SoundOutput_Description.html" />
+ <tocsect4 name="CL_SoundProvider" url="reference/CL_SoundProvider.html" />
+ <tocsect4 name="CL_SoundProvider_Session" url="reference/CL_SoundProvider_Session.html" />
+ </tocsect3>
+ <tocsect3 name="CD Audio">
+ <tocsect4 name="CL_CDDrive" url="reference/CL_CDDrive.html" />
+ </tocsect3>
+ <tocsect3 name="Filters">
+ <tocsect4 name="CL_EchoFilter" url="reference/CL_EchoFilter.html" />
+ <tocsect4 name="CL_FadeFilter" url="reference/CL_FadeFilter.html" />
+ <tocsect4 name="CL_InverseEchoFilter" url="reference/CL_InverseEchoFilter.html" />
+ </tocsect3>
+ <tocsect3 name="Sound Providers">
+ <tocsect4 name="CL_SoundProviderFactory" url="reference/CL_SoundProviderFactory.html" />
+ <tocsect4 name="CL_SoundProviderType" url="reference/CL_SoundProviderType.html" />
+ <tocsect4 name="CL_SoundProvider_Raw" url="reference/CL_SoundProvider_Raw.html" />
+ <tocsect4 name="CL_SoundProvider_Recorder" url="reference/CL_SoundProvider_Recorder.html" />
+ <tocsect4 name="CL_SoundProvider_Wave" url="reference/CL_SoundProvider_Wave.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupSound" url="reference/CL_SetupSound.html" />
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Vorbis">
+ <tocsect3 name="Sound Providers">
+ <tocsect4 name="CL_SoundProvider_Vorbis" url="reference/CL_SoundProvider_Vorbis.html" />
+ </tocsect3>
+ <tocsect3 name="System">
+ <tocsect4 name="CL_SetupVorbis" url="reference/CL_SetupVorbis.html" />
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/cpp/doc/cppannotations.toc b/languages/cpp/doc/cppannotations.toc
new file mode 100644
index 00000000..081ad646
--- /dev/null
+++ b/languages/cpp/doc/cppannotations.toc
@@ -0,0 +1,456 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>C++ Annotations</title>
+<base href="http://www.icce.rug.nl/documents/cplusplus/"/>
+
+<tocsect1 name="Chapter 1: Overview of the chapters" url="cplusplus01.html#l1" />
+<tocsect1 name="Chapter 2: Introduction" url="cplusplus02.html#l2">
+ <tocsect2 name="2.1: What's new in the C++ Annotations" url="cplusplus02.html#l3"/>
+ <tocsect2 name="2.2: Free Lectures in C++" url="cplusplus02.html#l4"/>
+ <tocsect2 name="2.3: The history of C++" url="cplusplus02.html#l5">
+ <tocsect3 name="2.3.1: History of the C++ Annotations" url="cplusplus02.html#l6"/>
+ <tocsect3 name="2.3.2: Compiling a C program by a C++ compiler" url="cplusplus02.html#l7"/>
+ <tocsect3 name="2.3.3: Compiling a C++ program" url="cplusplus02.html#l8">
+ <tocsect4 name="2.3.3.1: C++ under MS-Windows" url="cplusplus02.html#l9"/>
+ <tocsect4 name="2.3.3.2: Compiling a C++ source text" url="cplusplus02.html#l10"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="2.4: Advantages and pretensions of C++" url="cplusplus02.html#l11"/>
+ <tocsect2 name="2.5: What is Object-Oriented Programming?" url="cplusplus02.html#l12"/>
+ <tocsect2 name="2.6: Differences between C and C++" url="cplusplus02.html#l13">
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 3: A first impression of C++" url="cplusplus03.html#l32">
+ <tocsect2 name="3.1: More extensions to C in C++" url="cplusplus03.html#l33">
+ <tocsect3 name="3.1.1: The scope resolution operator ::" url="cplusplus03.html#l34"/>
+ <tocsect3 name="3.1.2: `cout', `cin' and `cerr'" url="cplusplus03.html#l35"/>
+ <tocsect3 name="3.1.3: The keyword `const'" url="cplusplus03.html#l36"/>
+ <tocsect3 name="3.1.4: References" url="cplusplus03.html#l37"/>
+ </tocsect2>
+ <tocsect2 name="3.2: Functions as part of structs" url="cplusplus03.html#l38"/>
+ <tocsect2 name="3.3: Several new data types" url="cplusplus03.html#l39">
+ <tocsect3 name="3.3.1: The `bool' data type" url="cplusplus03.html#l40"/>
+ <tocsect3 name="3.3.2: The `wchar_t' data type" url="cplusplus03.html#l41"/>
+ </tocsect2>
+ <tocsect2 name="3.4: Data hiding: public, private and class" url="cplusplus03.html#l42"/>
+ <tocsect2 name="3.5: Structs in C vs. structs in C++" url="cplusplus03.html#l43"/>
+ <tocsect2 name="3.6: Namespaces" url="cplusplus03.html#l44">
+ <tocsect3 name="3.6.1: Defining namespaces" url="cplusplus03.html#l45">
+ <tocsect4 name="3.6.1.1: Declaring entities in namespaces" url="cplusplus03.html#l46"/>
+ <tocsect4 name="3.6.1.2: A closed namespace " url="cplusplus03.html#l47"/>
+ </tocsect3>
+ <tocsect3 name="3.6.2: Referring to entities" url="cplusplus03.html#l48">
+ <tocsect4 name="3.6.2.1: The `using' directive " url="cplusplus03.html#l49"/>
+ <tocsect4 name="3.6.2.2: `Koenig lookup' " url="cplusplus03.html#l50"/>
+ </tocsect3>
+ <tocsect3 name="3.6.3: The standard namespace" url="cplusplus03.html#l51"/>
+ <tocsect3 name="3.6.4: Nesting namespaces and namespace aliasing" url="cplusplus03.html#l52">
+ <tocsect4 name="3.6.4.1: Defining entities outside of their namespaces" url="cplusplus03.html#l53"/>
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 4: The `string' data type" url="cplusplus04.html#l54">
+ <tocsect2 name="4.1: Operations on strings" url="cplusplus04.html#l55"/>
+ <tocsect2 name="4.2: Overview of operations on strings" url="cplusplus04.html#l56">
+ <tocsect3 name="4.2.1: The string initializers" url="cplusplus04.html#l57"/>
+ <tocsect3 name="4.2.2: The string iterators" url="cplusplus04.html#l58"/>
+ <tocsect3 name="4.2.3: The string operators" url="cplusplus04.html#l59"/>
+ <tocsect3 name="4.2.4: The string member functions" url="cplusplus04.html#l60"/>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 5: The IO-stream Library" url="cplusplus05.html#l61">
+ <tocsect2 name="5.1: Iostream header files" url="cplusplus05.html#l62"/>
+ <tocsect2 name="5.2: The foundation: the class `ios_base'" url="cplusplus05.html#l63"/>
+ <tocsect2 name="5.3: Interfacing `streambuf' objects: the class `ios'" url="cplusplus05.html#l64">
+ <tocsect3 name="5.3.1: Condition states" url="cplusplus05.html#l65"/>
+ <tocsect3 name="5.3.2: Formatting output and input" url="cplusplus05.html#l66">
+ <tocsect4 name="5.3.2.1: Formatting flags" url="cplusplus05.html#l67"/>
+ <tocsect4 name="5.3.2.2: Format modifying member functions" url="cplusplus05.html#l68"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="5.4: Output" url="cplusplus05.html#l69">
+ <tocsect3 name="5.4.1: Basic output: the class `ostream'" url="cplusplus05.html#l70">
+ <tocsect4 name="5.4.1.1: Writing to `ostream' objects" url="cplusplus05.html#l71"/>
+ <tocsect4 name="5.4.1.2: `ostream' positioning" url="cplusplus05.html#l72"/>
+ <tocsect4 name="5.4.1.3: `ostream' flushing" url="cplusplus05.html#l73"/>
+ </tocsect3>
+ <tocsect3 name="5.4.2: Output to files: the class `ofstream'" url="cplusplus05.html#l74">
+ <tocsect4 name="5.4.2.1: Modes for opening stream objects" url="cplusplus05.html#l75"/>
+ </tocsect3>
+ <tocsect3 name="5.4.3: Output to memory: the class `ostringstream'" url="cplusplus05.html#l76"/>
+ </tocsect2>
+ <tocsect2 name="5.5: Input" url="cplusplus05.html#l77">
+ <tocsect3 name="5.5.1: Basic input: the class `istream'" url="cplusplus05.html#l78">
+ <tocsect4 name="5.5.1.1: Reading from `istream' objects" url="cplusplus05.html#l79"/>
+ <tocsect4 name="5.5.1.2: `istream' positioning" url="cplusplus05.html#l80"/>
+ </tocsect3>
+ <tocsect3 name="5.5.2: Input from streams: the class `ifstream'" url="cplusplus05.html#l81"/>
+ <tocsect3 name="5.5.3: Input from memory: the class `istringstream'" url="cplusplus05.html#l82"/>
+ </tocsect2>
+ <tocsect2 name="5.6: Manipulators" url="cplusplus05.html#l83"/>
+ <tocsect2 name="5.7: The `streambuf' class" url="cplusplus05.html#l84">
+ <tocsect3 name="5.7.1: Protected `streambuf' members" url="cplusplus05.html#l85"/>
+ <tocsect3 name="5.7.2: The class `filebuf'" url="cplusplus05.html#l86"/>
+ </tocsect2>
+ <tocsect2 name="5.8: Advanced topics" url="cplusplus05.html#l87">
+ <tocsect3 name="5.8.1: Copying streams" url="cplusplus05.html#l88"/>
+ <tocsect3 name="5.8.2: Coupling streams" url="cplusplus05.html#l89"/>
+ <tocsect3 name="5.8.3: Redirection using streams" url="cplusplus05.html#l90"/>
+ <tocsect3 name="5.8.4: Reading AND Writing to a stream" url="cplusplus05.html#l91"/>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 6: Classes" url="cplusplus06.html#l92">
+ <tocsect2 name="6.1: The constructor" url="cplusplus06.html#l93">
+ <tocsect3 name="6.1.1: A first application" url="cplusplus06.html#l94"/>
+ <tocsect3 name="6.1.2: Constructors: with and without arguments" url="cplusplus06.html#l95">
+ <tocsect4 name="6.1.2.1: The order of construction" url="cplusplus06.html#l96"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="6.2: Const member functions and const objects" url="cplusplus06.html#l97"/>
+ <tocsect2 name="6.3: The keyword `inline'" url="cplusplus06.html#l98">
+ <tocsect3 name="6.3.1: Inline functions within class declarations" url="cplusplus06.html#l99"/>
+ <tocsect3 name="6.3.2: Inline functions outside of class declarations" url="cplusplus06.html#l100"/>
+ <tocsect3 name="6.3.3: When to use inline functions" url="cplusplus06.html#l101"/>
+ </tocsect2>
+ <tocsect2 name="6.4: Objects in objects: composition" url="cplusplus06.html#l102">
+ <tocsect3 name="6.4.1: Composition and const objects: const member initializers" url="cplusplus06.html#l103"/>
+ <tocsect3 name="6.4.2: Composition and reference objects: reference member initializers" url="cplusplus06.html#l104"/>
+ </tocsect2>
+ <tocsect2 name="6.5: Header file organization with classes" url="cplusplus06.html#l105">
+ <tocsect3 name="6.5.1: Using namespaces in header files" url="cplusplus06.html#l106"/>
+ </tocsect2>
+ <tocsect2 name="6.6: The keyword `mutable'" url="cplusplus06.html#l107"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 7: Classes and memory allocation" url="cplusplus07.html#l108">
+ <tocsect2 name="7.1: The operators `new' and `delete'" url="cplusplus07.html#l109">
+ <tocsect3 name="7.1.1: Allocating arrays" url="cplusplus07.html#l110"/>
+ <tocsect3 name="7.1.2: Deleting arrays" url="cplusplus07.html#l111"/>
+ <tocsect3 name="7.1.3: Enlarging arrays" url="cplusplus07.html#l112"/>
+ </tocsect2>
+ <tocsect2 name="7.2: The destructor" url="cplusplus07.html#l113">
+ <tocsect3 name="7.2.1: New and delete and object pointers" url="cplusplus07.html#l114"/>
+ <tocsect3 name="7.2.2: The function set_new_handler()" url="cplusplus07.html#l115"/>
+ </tocsect2>
+ <tocsect2 name="7.3: The assignment operator" url="cplusplus07.html#l116">
+ <tocsect3 name="7.3.1: Overloading the assignment operator" url="cplusplus07.html#l117">
+ <tocsect4 name="7.3.1.1: The function 'operator=()'" url="cplusplus07.html#l118"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="7.4: The this pointer" url="cplusplus07.html#l119">
+ <tocsect3 name="7.4.1: Preventing self-destruction with this" url="cplusplus07.html#l120"/>
+ <tocsect3 name="7.4.2: Associativity of operators and this" url="cplusplus07.html#l121"/>
+ </tocsect2>
+ <tocsect2 name="7.5: The copy constructor: Initialization vs. Assignment" url="cplusplus07.html#l122">
+ <tocsect3 name="7.5.1: Similarities between the copy constructor and operator=()" url="cplusplus07.html#l123"/>
+ <tocsect3 name="7.5.2: Preventing the use of certain member functions" url="cplusplus07.html#l124"/>
+ </tocsect2>
+ <tocsect2 name="7.6: Conclusion" url="cplusplus07.html#l125"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 8: Exceptions" url="cplusplus08.html#l126">
+ <tocsect2 name="8.1: Using exceptions: syntax elements" url="cplusplus08.html#l127"/>
+ <tocsect2 name="8.2: An example using exceptions" url="cplusplus08.html#l128">
+ <tocsect3 name="8.2.1: No exceptions: `setjmp()' and `longjmp()'" url="cplusplus08.html#l129"/>
+ <tocsect3 name="8.2.2: Exceptions: the preferred alternative" url="cplusplus08.html#l130"/>
+ </tocsect2>
+ <tocsect2 name="8.3: Throwing exceptions" url="cplusplus08.html#l131">
+ <tocsect3 name="8.3.1: The empty `throw' statement" url="cplusplus08.html#l132"/>
+ </tocsect2>
+ <tocsect2 name="8.4: The try block" url="cplusplus08.html#l133"/>
+ <tocsect2 name="8.5: Catching exceptions" url="cplusplus08.html#l134">
+ <tocsect3 name="8.5.1: The default catcher" url="cplusplus08.html#l135"/>
+ </tocsect2>
+ <tocsect2 name="8.6: Declaring exception throwers" url="cplusplus08.html#l136"/>
+ <tocsect2 name="8.7: Iostreams and exceptions" url="cplusplus08.html#l137"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 9: More Operator Overloading" url="cplusplus09.html#l138">
+ <tocsect2 name="9.1: Overloading `operator[]()'" url="cplusplus09.html#l139"/>
+ <tocsect2 name="9.2: Overloading the insertion and extraction operators" url="cplusplus09.html#l140"/>
+ <tocsect2 name="9.3: Conversion operators" url="cplusplus09.html#l141"/>
+ <tocsect2 name="9.4: The `explicit' keyword" url="cplusplus09.html#l142"/>
+ <tocsect2 name="9.5: Overloading increment and decrement" url="cplusplus09.html#l143"/>
+ <tocsect2 name="9.6: Overloading `operator new(size_t)'" url="cplusplus09.html#l144"/>
+ <tocsect2 name="9.7: Overloading `operator delete(void *)'" url="cplusplus09.html#l145"/>
+ <tocsect2 name="9.8: Operators `new[]' and `delete[]'" url="cplusplus09.html#l146"/>
+ <tocsect2 name="9.9: Function Objects" url="cplusplus09.html#l147">
+ <tocsect3 name="9.9.1: Constructing manipulators" url="cplusplus09.html#l148">
+ <tocsect4 name="9.9.1.1: Manipulators requiring arguments" url="cplusplus09.html#l149"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="9.10: Overloadable Operators" url="cplusplus09.html#l150"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 10: Static data and functions" url="cplusplus10.html#l151">
+ <tocsect2 name="10.1: Static data" url="cplusplus10.html#l152">
+ <tocsect3 name="10.1.1: Private static data" url="cplusplus10.html#l153"/>
+ <tocsect3 name="10.1.2: Public static data" url="cplusplus10.html#l154"/>
+ </tocsect2>
+ <tocsect2 name="10.2: Static member functions" url="cplusplus10.html#l155"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 11: Friends" url="cplusplus11.html#l156">
+ <tocsect2 name="11.1: Friend-functions" url="cplusplus11.html#l157"/>
+ <tocsect2 name="11.2: Inline friends" url="cplusplus11.html#l158"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 12: Abstract Containers" url="cplusplus12.html#l159">
+ <tocsect2 name="12.1: The `pair' container" url="cplusplus12.html#l160"/>
+ <tocsect2 name="12.2: Sequential Containers" url="cplusplus12.html#l161">
+ <tocsect3 name="12.2.1: The `vector' container" url="cplusplus12.html#l162"/>
+ <tocsect3 name="12.2.2: The `list' container" url="cplusplus12.html#l163"/>
+ <tocsect3 name="12.2.3: The `queue' container" url="cplusplus12.html#l164"/>
+ <tocsect3 name="12.2.4: The `priority_queue' container" url="cplusplus12.html#l165"/>
+ <tocsect3 name="12.2.5: The `deque' container" url="cplusplus12.html#l166"/>
+ <tocsect3 name="12.2.6: The `map' container" url="cplusplus12.html#l167"/>
+ <tocsect3 name="12.2.7: The `multimap' container" url="cplusplus12.html#l168"/>
+ <tocsect3 name="12.2.8: The `set' container" url="cplusplus12.html#l169"/>
+ <tocsect3 name="12.2.9: The `multiset' container" url="cplusplus12.html#l170"/>
+ <tocsect3 name="12.2.10: The `stack' container" url="cplusplus12.html#l171"/>
+ <tocsect3 name="12.2.11: The `hash_map' and other hashing-based containers" url="cplusplus12.html#l172"/>
+ </tocsect2>
+ <tocsect2 name="12.3: The `complex' container" url="cplusplus12.html#l173"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 13: Inheritance" url="cplusplus13.html#l174">
+ <tocsect2 name="13.1: Related types" url="cplusplus13.html#l175"/>
+ <tocsect2 name="13.2: The constructor of a derived class" url="cplusplus13.html#l176"/>
+ <tocsect2 name="13.3: The destructor of a derived class" url="cplusplus13.html#l177"/>
+ <tocsect2 name="13.4: Redefining member functions" url="cplusplus13.html#l178"/>
+ <tocsect2 name="13.5: Multiple inheritance" url="cplusplus13.html#l179"/>
+ <tocsect2 name="13.6: Conversions between base classes and derived classes" url="cplusplus13.html#l180">
+ <tocsect3 name="13.6.1: Conversions in object assignments" url="cplusplus13.html#l181"/>
+ <tocsect3 name="13.6.2: Conversions in pointer assignments" url="cplusplus13.html#l182"/>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 14: Polymorphism" url="cplusplus14.html#l183">
+ <tocsect2 name="14.1: Virtual functions" url="cplusplus14.html#l184"/>
+ <tocsect2 name="14.2: Virtual destructors" url="cplusplus14.html#l185"/>
+ <tocsect2 name="14.3: Pure virtual functions" url="cplusplus14.html#l186"/>
+ <tocsect2 name="14.4: Virtual functions in multiple inheritance" url="cplusplus14.html#l187">
+ <tocsect3 name="14.4.1: Ambiguity in multiple inheritance" url="cplusplus14.html#l188"/>
+ <tocsect3 name="14.4.2: Virtual base classes" url="cplusplus14.html#l189"/>
+ <tocsect3 name="14.4.3: When virtual derivation is not appropriate" url="cplusplus14.html#l190"/>
+ </tocsect2>
+ <tocsect2 name="14.5: Run-Time Type identification" url="cplusplus14.html#l191">
+ <tocsect3 name="14.5.1: The dynamic_cast operator" url="cplusplus14.html#l192"/>
+ <tocsect3 name="14.5.2: The typeid operator" url="cplusplus14.html#l193"/>
+ </tocsect2>
+ <tocsect2 name="14.6: Deriving classes from `streambuf'" url="cplusplus14.html#l194"/>
+ <tocsect2 name="14.7: A polymorphic exception class" url="cplusplus14.html#l195"/>
+ <tocsect2 name="14.8: How polymorphism is implemented" url="cplusplus14.html#l196"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 15: Classes having pointers to members" url="cplusplus15.html#l197">
+ <tocsect2 name="15.1: Pointers to members: an example" url="cplusplus15.html#l198"/>
+ <tocsect2 name="15.2: Defining pointers to members" url="cplusplus15.html#l199"/>
+ <tocsect2 name="15.3: Using pointers to members" url="cplusplus15.html#l200"/>
+ <tocsect2 name="15.4: Pointers to static members" url="cplusplus15.html#l201"/>
+ <tocsect2 name="15.5: Sizes of pointers" url="cplusplus15.html#l202"/>
+</tocsect1>
+
+<tocsect1 name="Chapter 16: Nested Classes" url="cplusplus16.html#l203">
+ <tocsect2 name="16.1: Defining nested class members" url="cplusplus16.html#l204"/>
+ <tocsect2 name="16.2: Declaring nested classes" url="cplusplus16.html#l205"/>
+ <tocsect2 name="16.3: Accessing private members in nested classes" url="cplusplus16.html#l206"/>
+ <tocsect2 name="16.4: Nesting enumerations" url="cplusplus16.html#l207">
+ <tocsect3 name="16.4.1: Empty enumerations" url="cplusplus16.html#l208"/>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 17: The Standard Template Library, generic algorithms" url="cplusplus17.html#l209">
+ <tocsect2 name="17.1: Predefined function objects" url="cplusplus17.html#l210">
+ <tocsect3 name="17.1.1: Arithmetic Function Objects" url="cplusplus17.html#l211"/>
+ <tocsect3 name="17.1.2: Relational Function Objects" url="cplusplus17.html#l212"/>
+ <tocsect3 name="17.1.3: Logical Function Objects" url="cplusplus17.html#l213"/>
+ <tocsect3 name="17.1.4: Function Adaptors" url="cplusplus17.html#l214"/>
+ </tocsect2>
+ <tocsect2 name="17.2: Iterators" url="cplusplus17.html#l215">
+ <tocsect3 name="17.2.1: Insert iterators" url="cplusplus17.html#l216"/>
+ <tocsect3 name="17.2.2: istream iterators" url="cplusplus17.html#l217">
+ <tocsect4 name="17.2.2.1: istreambuf iterators" url="cplusplus17.html#l218"/>
+ </tocsect3>
+ <tocsect3 name="17.2.3: ostream iterators" url="cplusplus17.html#l219">
+ <tocsect4 name="17.2.3.1: ostreambuf iterators" url="cplusplus17.html#l220"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="17.3: The 'auto_ptr' class" url="cplusplus17.html#l221">
+ <tocsect3 name="17.3.1: Defining auto_ptr variables" url="cplusplus17.html#l222"/>
+ <tocsect3 name="17.3.2: Pointing to a newly allocated object" url="cplusplus17.html#l223"/>
+ <tocsect3 name="17.3.3: Pointing to another auto_ptr" url="cplusplus17.html#l224"/>
+ <tocsect3 name="17.3.4: Creating a plain auto_ptr" url="cplusplus17.html#l225"/>
+ <tocsect3 name="17.3.5: Auto_ptr: operators and members" url="cplusplus17.html#l226"/>
+ </tocsect2>
+ <tocsect2 name="17.4: The Generic Algorithms" url="cplusplus17.html#l227">
+ <tocsect3 name="17.4.1: accumulate()" url="cplusplus17.html#l228"/>
+ <tocsect3 name="17.4.2: adjacent_difference()" url="cplusplus17.html#l229"/>
+ <tocsect3 name="17.4.3: adjacent_find()" url="cplusplus17.html#l230"/>
+ <tocsect3 name="17.4.4: binary_search()" url="cplusplus17.html#l231"/>
+ <tocsect3 name="17.4.5: copy()" url="cplusplus17.html#l232"/>
+ <tocsect3 name="17.4.6: copy_backward()" url="cplusplus17.html#l233"/>
+ <tocsect3 name="17.4.7: count()" url="cplusplus17.html#l234"/>
+ <tocsect3 name="17.4.8: count_if()" url="cplusplus17.html#l235"/>
+ <tocsect3 name="17.4.9: equal()" url="cplusplus17.html#l236"/>
+ <tocsect3 name="17.4.10: equal_range()" url="cplusplus17.html#l237"/>
+ <tocsect3 name="17.4.11: fill()" url="cplusplus17.html#l238"/>
+ <tocsect3 name="17.4.12: fill_n()" url="cplusplus17.html#l239"/>
+ <tocsect3 name="17.4.13: find()" url="cplusplus17.html#l240"/>
+ <tocsect3 name="17.4.14: find_end()" url="cplusplus17.html#l241"/>
+ <tocsect3 name="17.4.15: find_first_of()" url="cplusplus17.html#l242"/>
+ <tocsect3 name="17.4.16: find_if()" url="cplusplus17.html#l243"/>
+ <tocsect3 name="17.4.17: for_each()" url="cplusplus17.html#l244"/>
+ <tocsect3 name="17.4.18: generate()" url="cplusplus17.html#l245"/>
+ <tocsect3 name="17.4.19: generate_n()" url="cplusplus17.html#l246"/>
+ <tocsect3 name="17.4.20: includes()" url="cplusplus17.html#l247"/>
+ <tocsect3 name="17.4.21: inner_product()" url="cplusplus17.html#l248"/>
+ <tocsect3 name="17.4.22: inplace_merge()" url="cplusplus17.html#l249"/>
+ <tocsect3 name="17.4.23: iter_swap()" url="cplusplus17.html#l250"/>
+ <tocsect3 name="17.4.24: lexicographical_compare()" url="cplusplus17.html#l251"/>
+ <tocsect3 name="17.4.25: lower_bound()" url="cplusplus17.html#l252"/>
+ <tocsect3 name="17.4.26: max()" url="cplusplus17.html#l253"/>
+ <tocsect3 name="17.4.27: max_element()" url="cplusplus17.html#l254"/>
+ <tocsect3 name="17.4.28: merge()" url="cplusplus17.html#l255"/>
+ <tocsect3 name="17.4.29: min()" url="cplusplus17.html#l256"/>
+ <tocsect3 name="17.4.30: min_element()" url="cplusplus17.html#l257"/>
+ <tocsect3 name="17.4.31: mismatch()" url="cplusplus17.html#l258"/>
+ <tocsect3 name="17.4.32: next_permutation()" url="cplusplus17.html#l259"/>
+ <tocsect3 name="17.4.33: nth_element()" url="cplusplus17.html#l260"/>
+ <tocsect3 name="17.4.34: partial_sort()" url="cplusplus17.html#l261"/>
+ <tocsect3 name="17.4.35: partial_sort_copy()" url="cplusplus17.html#l262"/>
+ <tocsect3 name="17.4.36: partial_sum()" url="cplusplus17.html#l263"/>
+ <tocsect3 name="17.4.37: partition()" url="cplusplus17.html#l264"/>
+ <tocsect3 name="17.4.38: prev_permutation()" url="cplusplus17.html#l265"/>
+ <tocsect3 name="17.4.39: random_shuffle()" url="cplusplus17.html#l266"/>
+ <tocsect3 name="17.4.40: remove()" url="cplusplus17.html#l267"/>
+ <tocsect3 name="17.4.41: remove_copy()" url="cplusplus17.html#l268"/>
+ <tocsect3 name="17.4.42: remove_if()" url="cplusplus17.html#l269"/>
+ <tocsect3 name="17.4.43: remove_copy_if()" url="cplusplus17.html#l270"/>
+ <tocsect3 name="17.4.44: replace()" url="cplusplus17.html#l271"/>
+ <tocsect3 name="17.4.45: replace_copy()" url="cplusplus17.html#l272"/>
+ <tocsect3 name="17.4.46: replace_if()" url="cplusplus17.html#l273"/>
+ <tocsect3 name="17.4.47: replace_copy_if()" url="cplusplus17.html#l274"/>
+ <tocsect3 name="17.4.48: reverse()" url="cplusplus17.html#l275"/>
+ <tocsect3 name="17.4.49: reverse_copy()" url="cplusplus17.html#l276"/>
+ <tocsect3 name="17.4.50: rotate()" url="cplusplus17.html#l277"/>
+ <tocsect3 name="17.4.51: rotate_copy()" url="cplusplus17.html#l278"/>
+ <tocsect3 name="17.4.52: search()" url="cplusplus17.html#l279"/>
+ <tocsect3 name="17.4.53: search_n()" url="cplusplus17.html#l280"/>
+ <tocsect3 name="17.4.54: set_difference()" url="cplusplus17.html#l281"/>
+ <tocsect3 name="17.4.55: set_intersection()" url="cplusplus17.html#l282"/>
+ <tocsect3 name="17.4.56: set_symmetric_difference()" url="cplusplus17.html#l283"/>
+ <tocsect3 name="17.4.57: set_union()" url="cplusplus17.html#l284"/>
+ <tocsect3 name="17.4.58: sort()" url="cplusplus17.html#l285"/>
+ <tocsect3 name="17.4.59: stable_partition()" url="cplusplus17.html#l286"/>
+ <tocsect3 name="17.4.60: stable_sort()" url="cplusplus17.html#l287"/>
+ <tocsect3 name="17.4.61: swap()" url="cplusplus17.html#l288"/>
+ <tocsect3 name="17.4.62: swap_ranges()" url="cplusplus17.html#l289"/>
+ <tocsect3 name="17.4.63: transform()" url="cplusplus17.html#l290"/>
+ <tocsect3 name="17.4.64: unique()" url="cplusplus17.html#l291"/>
+ <tocsect3 name="17.4.65: unique_copy()" url="cplusplus17.html#l292"/>
+ <tocsect3 name="17.4.66: upper_bound()" url="cplusplus17.html#l293"/>
+ <tocsect3 name="17.4.67: Heap algorithms" url="cplusplus17.html#l294">
+ <tocsect4 name="17.4.67.1: make_heap()" url="cplusplus17.html#l295"/>
+ <tocsect4 name="17.4.67.2: pop_heap()" url="cplusplus17.html#l296"/>
+ <tocsect4 name="17.4.67.3: push_heap()" url="cplusplus17.html#l297"/>
+ <tocsect4 name="17.4.67.4: sort_heap()" url="cplusplus17.html#l298"/>
+ <tocsect4 name="17.4.67.5: An example using the heap algorithms" url="cplusplus17.html#l299"/>
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 18: Templates" url="cplusplus18.html#l300">
+ <tocsect2 name="18.1: Template functions" url="cplusplus18.html#l301">
+ <tocsect3 name="18.1.1: Template function definitions" url="cplusplus18.html#l302"/>
+ <tocsect3 name="18.1.2: Instantiations of template functions" url="cplusplus18.html#l303">
+ <tocsect4 name="18.1.2.1: Declaring template functions" url="cplusplus18.html#l304"/>
+ </tocsect3>
+ <tocsect3 name="18.1.3: Argument deduction" url="cplusplus18.html#l305">
+ <tocsect4 name="18.1.3.1: Lvalue transformations" url="cplusplus18.html#l306"/>
+ <tocsect4 name="18.1.3.2: Qualification conversions" url="cplusplus18.html#l307"/>
+ <tocsect4 name="18.1.3.3: Conversion to a base class" url="cplusplus18.html#l308"/>
+ <tocsect4 name="18.1.3.4: Summary: the template argument deduction algorithm" url="cplusplus18.html#l309"/>
+ </tocsect3>
+ <tocsect3 name="18.1.4: Explicit arguments" url="cplusplus18.html#l310">
+ <tocsect4 name="18.1.4.1: Template explicit instantiation declarations" url="cplusplus18.html#l311"/>
+ </tocsect3>
+ <tocsect3 name="18.1.5: Template explicit specialization " url="cplusplus18.html#l312"/>
+ <tocsect3 name="18.1.6: Overloading template functions" url="cplusplus18.html#l313"/>
+ <tocsect3 name="18.1.7: Selecting an overloaded (template) function" url="cplusplus18.html#l314"/>
+ <tocsect3 name="18.1.8: Name resolution within template functions" url="cplusplus18.html#l315"/>
+ </tocsect2>
+ <tocsect2 name="18.2: Template classes" url="cplusplus18.html#l316">
+ <tocsect3 name="18.2.1: Template class definitions" url="cplusplus18.html#l317"/>
+ <tocsect3 name="18.2.2: Template class instantiations" url="cplusplus18.html#l318"/>
+ <tocsect3 name="18.2.3: Non-type parameters" url="cplusplus18.html#l319"/>
+ <tocsect3 name="18.2.4: Template class member functions" url="cplusplus18.html#l320"/>
+ <tocsect3 name="18.2.5: Template classes and friend declarations" url="cplusplus18.html#l321">
+ <tocsect4 name="18.2.5.1: Non-template friends" url="cplusplus18.html#l322"/>
+ <tocsect4 name="18.2.5.2: Bound friends" url="cplusplus18.html#l323"/>
+ <tocsect4 name="18.2.5.3: Unbound friends" url="cplusplus18.html#l324"/>
+ </tocsect3>
+ <tocsect3 name="18.2.6: Template classes and static data" url="cplusplus18.html#l325"/>
+ <tocsect3 name="18.2.7: Derived Template Classes" url="cplusplus18.html#l326"/>
+ <tocsect3 name="18.2.8: Nesting and template classes" url="cplusplus18.html#l327"/>
+ <tocsect3 name="18.2.9: Member templates" url="cplusplus18.html#l328"/>
+ <tocsect3 name="18.2.10: Template class specializations" url="cplusplus18.html#l329"/>
+ <tocsect3 name="18.2.11: Template class partial specializations" url="cplusplus18.html#l330"/>
+ <tocsect3 name="18.2.12: Name resolution within template classes" url="cplusplus18.html#l331"/>
+ </tocsect2>
+ <tocsect2 name="18.3: Constructing iterators" url="cplusplus18.html#l332">
+ <tocsect3 name="18.3.0.1: The implementation of a Random Access Iterator " url="cplusplus18.html#l333"/>
+ <tocsect3 name="18.3.0.2: The implementation of a reverse_iterator" url="cplusplus18.html#l334"/>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Chapter 19: Concrete examples of C++" url="cplusplus19.html#l335">
+ <tocsect2 name="19.1: Function objects performing bitwise operations" url="cplusplus19.html#l336"/>
+ <tocsect2 name="19.2: Implementing a reverse_iterator" url="cplusplus19.html#l337"/>
+ <tocsect2 name="19.3: A text to anything converter" url="cplusplus19.html#l338"/>
+ <tocsect2 name="19.4: `streambuf' classes using file descriptors" url="cplusplus19.html#l339">
+ <tocsect3 name="19.4.1: A class for output operations" url="cplusplus19.html#l340"/>
+ <tocsect3 name="19.4.2: Classes for input operations" url="cplusplus19.html#l341">
+ <tocsect4 name="19.4.2.1: Using a one-character buffer" url="cplusplus19.html#l342"/>
+ <tocsect4 name="19.4.2.2: Using an n-character buffer" url="cplusplus19.html#l343"/>
+ <tocsect4 name="19.4.2.3: Seeking positions in `streambuf' objects" url="cplusplus19.html#l344"/>
+ <tocsect4 name="19.4.2.4: Multiple `unget()' calls in `streambuf' objects" url="cplusplus19.html#l345"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="19.5: Using form() with ostream objects" url="cplusplus19.html#l346"/>
+ <tocsect2 name="19.6: Redirection revisited" url="cplusplus19.html#l347"/>
+ <tocsect2 name="19.7: The fork() system call" url="cplusplus19.html#l348">
+ <tocsect3 name="19.7.1: The `Daemon' program" url="cplusplus19.html#l349"/>
+ <tocsect3 name="19.7.2: The `Pipe' class" url="cplusplus19.html#l350"/>
+ <tocsect3 name="19.7.3: The `ParentSlurp' class" url="cplusplus19.html#l351"/>
+ <tocsect3 name="19.7.4: Communicating with multiple children" url="cplusplus19.html#l352">
+ <tocsect4 name="19.7.4.1: The `Select' class" url="cplusplus19.html#l353"/>
+ <tocsect4 name="19.7.4.2: The `Child' class" url="cplusplus19.html#l354"/>
+ <tocsect4 name="19.7.4.3: The `Monitor' class" url="cplusplus19.html#l355"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="19.8: Using Bison and Flex" url="cplusplus19.html#l356">
+ <tocsect3 name="19.8.1: Using Flex++ to create a scanner" url="cplusplus19.html#l357">
+ <tocsect4 name="19.8.1.1: The flex++ specification file" url="cplusplus19.html#l358"/>
+ <tocsect4 name="19.8.1.2: The derived class: Scanner" url="cplusplus19.html#l359"/>
+ <tocsect4 name="19.8.1.3: The main() function" url="cplusplus19.html#l360"/>
+ <tocsect4 name="19.8.1.4: Building the scanner-program" url="cplusplus19.html#l361"/>
+ </tocsect3>
+ <tocsect3 name="19.8.2: Using both bison++ and flex++" url="cplusplus19.html#l362">
+ <tocsect4 name="19.8.2.1: The bison++ specification file" url="cplusplus19.html#l363"/>
+ <tocsect4 name="19.8.2.2: The bison++ header section" url="cplusplus19.html#l364"/>
+ <tocsect4 name="19.8.2.3: The bison++ definition section" url="cplusplus19.html#l365"/>
+ <tocsect4 name="19.8.2.4: The bison++ grammar rules" url="cplusplus19.html#l366"/>
+ <tocsect4 name="19.8.2.5: The flex++ specification file" url="cplusplus19.html#l367"/>
+ <tocsect4 name="19.8.2.6: The generation of the code" url="cplusplus19.html#l368"/>
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+
+<tocsect1 name="Index" url="cppindex.html" />
+
+</kdeveloptoc>
diff --git a/languages/cpp/doc/gnome1.toc b/languages/cpp/doc/gnome1.toc
new file mode 100644
index 00000000..d996f1a0
--- /dev/null
+++ b/languages/cpp/doc/gnome1.toc
@@ -0,0 +1,424 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>GNOME 1.0 API Reference</title>
+<base href="http://developer.gnome.org/doc/API"/>
+<tocsect1 name="GLib" url="glib/index.html">
+ <tocsect2 name="GLib Fundamentals" url="glib/glib-fundamentals.html">
+ <tocsect3 name="Basic Types" url="glib/glib-basic-types.html"/>
+ <tocsect3 name="Limits of Basic Types" url="glib/glib-limits-of-basic-types.html"/>
+ <tocsect3 name="Standard Macros" url="glib/glib-standard-macros.html"/>
+ <tocsect3 name="Type Conversion Macros" url="glib/glib-type-conversion-macros.html"/>
+ <tocsect3 name="Byte Order Macros" url="glib/glib-type-conversion-macros.html"/>
+ <tocsect3 name="Miscellaneous Macros" url="glib/glib-miscellaneous-macros.html"/>
+ </tocsect2>
+ <tocsect2 name="GLib Core Application Support" url="glib/glib-core.html">
+ <tocsect3 name="The Main Event Loop" url="glib/glib-the-main-event-loop.html"/>
+ <tocsect3 name="Threads" url="glib/glib-threads.html"/>
+ <tocsect3 name="Dynamic Loading of Modules" url="glib/glib-dynamic-loading-of-modules.html"/>
+ <tocsect3 name="Memory Allocation" url="glib/glib-memory-allocation.html"/>
+ <tocsect3 name="IO Channels" url="glib/glib-io-channels.html"/>
+ <tocsect3 name="Message Output and Debugging Functions" url="glib/glib-warnings-and-assertions.html"/>
+ <tocsect3 name="Message Logging" url="glib/glib-message-logging.html"/>
+ </tocsect2>
+ <tocsect2 name="GLib Utilities" url="glib/glib-utilities.html">
+ <tocsect3 name="String Utility Functions" url="glib/glib-string-utility-functions.html"/>
+ <tocsect3 name="Date and Time Functions" url="glib/glib-date-and-time-functions.html"/>
+ <tocsect3 name="Hook Functions" url="glib/glib-hook-functions.html"/>
+ <tocsect3 name="Miscellaneous Utility Functions" url="glib/glib-miscellaneous-utility-functions.html"/>
+ <tocsect3 name="Lexical Scanner" url="glib/glib-lexical-scanner.html"/>
+ <tocsect3 name="Automatic String Completion" url="glib/glib-automatic-string-completion.html"/>
+ <tocsect3 name="Timers" url="glib/glib-timers.html"/>
+ <tocsect3 name="Windows Compatibility Functions" url="glib/glib-windows-compatability-functions.html"/>
+ </tocsect2>
+ <tocsect2 name="GLib Data Types" url="glib/glib-data-types.html">
+ <tocsect3 name="Memory Chunks" url="glib/glib-memory-chunks.html"/>
+ <tocsect3 name="Doubly-Linked Lists" url="glib/glib-doubly-linked-lists.html"/>
+ <tocsect3 name="Singly-Linked Lists" url="glib/glib-singly-linked-lists.html"/>
+ <tocsect3 name="Hash Tables" url="glib/glib-hash-tables.html"/>
+ <tocsect3 name="Strings" url="glib/glib-strings.html"/>
+ <tocsect3 name="String Chunks" url="glib/glib-string-chunks.html"/>
+ <tocsect3 name="Arrays" url="glib/glib-arrays.html"/>
+ <tocsect3 name="Pointer Arrays" url="glib/glib-pointer-arrays.html"/>
+ <tocsect3 name="Byte Arrays" url="glib/glib-byte-arrays.html"/>
+ <tocsect3 name="Balanced Binary Trees" url="glib/glib-balanced-binary-trees.html"/>
+ <tocsect3 name="N-ary Trees" url="glib/glib-n-ary-trees.html"/>
+ <tocsect3 name="Quarks" url="glib/glib-quarks.html"/>
+ <tocsect3 name="Keyed Data Lists" url="glib/glib-keyed-data-lists.html"/>
+ <tocsect3 name="Datasets" url="glib/glib-datasets.html"/>
+ <tocsect3 name="Relations and Tuples" url="glib/glib-relations-and-tuples.html"/>
+ <tocsect3 name="Caches" url="glib/glib-caches.html"/>
+ <tocsect3 name="Memory Allocators" url="glib/glib-memory-allocators.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="GDK" url="gdk/index.html">
+ <tocsect2 name="General" url="gdk/gdk-general.html"/>
+ <tocsect2 name="Points, Rectangles and Regions" url="gdk/gdk-points-rectangles-and-regions.html"/>
+ <tocsect2 name="Graphics Contexts" url="gdk/gdk-graphics-contexts.html"/>
+ <tocsect2 name="Drawing Primitives" url="gdk/gdk-drawing-primitives.html"/>
+ <tocsect2 name="Bitmaps and Pixmaps" url="gdk/gdk-bitmaps-and-pixmaps.html"/>
+ <tocsect2 name="Images" url="gdk/gdk-images.html"/>
+ <tocsect2 name="Colormaps and Colors" url="gdk/gdk-colormaps-and-colors.html"/>
+ <tocsect2 name="Color Contexts" url="gdk/gdk-color-contexts.html"/>
+ <tocsect2 name="Visuals" url="gdk/gdk-visuals.html"/>
+ <tocsect2 name="Fonts" url="gdk/gdk-fonts.html"/>
+ <tocsect2 name="Cursors" url="gdk/gdk-cursors.html"/>
+ <tocsect2 name="Windows" url="gdk/gdk-windows.html"/>
+ <tocsect2 name="Events" url="gdk/gdk-events.html"/>
+ <tocsect2 name="Event Structures" url="gdk/gdk-event-structures.html"/>
+ <tocsect2 name="Selections" url="gdk/gdk-selections.html"/>
+ <tocsect2 name="Drag and Drop" url="gdk/gdk-drag-and-drop.html"/>
+ <tocsect2 name="Properties and Atoms" url="gdk/gdk-properties-and-atoms.html"/>
+ <tocsect2 name="Threads" url="gdk/gdk-threads.html"/>
+ <tocsect2 name="Input" url="gdk/gdk-input.html"/>
+ <tocsect2 name="Input Devices" url="gdk/gdk-input-devices.html"/>
+ <tocsect2 name="Key Values" url="gdk/gdk-key-values.html"/>
+ <tocsect2 name="Input Methods" url="gdk/gdk-input-methods.html"/>
+ <tocsect2 name="Input Contexts" url="gdk/gdk-input-contexts.html"/>
+</tocsect1>
+<tocsect1 name="Gdk-Pixbuf" url="gdk-pixbuf/index.html">
+ <tocsect2 name="API Reference" url="gdk-pixbuf/r27.html">
+ <tocsect3 name="The GdkPixbuf Structure" url="gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html"/>
+ <tocsect3 name="Reference Counting and Memory Mangement" url="gdk-pixbuf/gdk-pixbuf-refcounting.html"/>
+ <tocsect3 name="File Loading" url="gdk-pixbuf/gdk-pixbuf-file-loading.html"/>
+ <tocsect3 name="Image Data in Memory" url="gdk-pixbuf/gdk-pixbuf-creating.html"/>
+ <tocsect3 name="Rendering" url="gdk-pixbuf/gdk-pixbuf-rendering.html"/>
+ <tocsect3 name="Scaling" url="gdk-pixbuf/gdk-pixbuf-scaling.html"/>
+ <tocsect3 name="Drawables to Pixbufs" url="gdk-pixbuf/gdk-pixbuf-from-drawables.html"/>
+ <tocsect3 name="Utilities" url="gdk-pixbuf/gdk-pixbuf-util.html"/>
+ <tocsect3 name="Animations" url="gdk-pixbuf/gdk-pixbuf-animation.html"/>
+ <tocsect3 name="GdkPixbufLoader" url="gdk-pixbuf/gdkpixbufloader.html"/>
+ <tocsect3 name="GnomeCanvasPixbuf" url="gdk-pixbuf/gnomecanvaspixbuf.html"/>
+ <tocsect3 name="Xlib initialization" url="gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-init.html"/>
+ <tocsect3 name="Xlib Rendering" url="gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-rendering.html"/>
+ <tocsect3 name="X Drawables to Pixbufs" url="gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-from-drawables.html"/>
+ <tocsect3 name="XlibRGB" url="gdk-pixbuf/gdk-pixbuf-gdk-pixbuf-xlib-rgb.html"/>
+ </tocsect2>
+ <tocsect2 name="Porting applications from Imlib to gdk-pixbuf" url="gdk-pixbuf/a3652.html">
+ <tocsect3 name="Introduction" url="gdk-pixbuf/a3652.html#AEN3662"/>
+ <tocsect3 name="Differences between Imlib and gdk-pixbuf" url="gdk-pixbuf/x3671.html">
+ <tocsect4 name="Initialization" url="gdk-pixbuf/x3671.html#AEN3681"/>
+ <tocsect4 name="Memory management" url="gdk-pixbuf/x3671.html#AEN3694"/>
+ <tocsect4 name="The Rendering Process" url="gdk-pixbuf/x3671.html#AEN3712"/>
+ </tocsect3>
+ <tocsect3 name="Converting Applications to gdk-pixbuf" url="gdk-pixbuf/x3723.html">
+ <tocsect4 name="Image loading and creation" url="gdk-pixbuf/x3723.html#AEN3729"/>
+ <tocsect4 name="Rendering Images" url="gdk-pixbuf/x3723.html#AEN3746"/>
+ <tocsect4 name="Scaling Images" url="gdk-pixbuf/x3723.html#AEN3759"/>
+ <tocsect4 name="Getting Image Data from a Drawable" url="gdk-pixbuf/x3723.html#AEN3776"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Compiling the gdk-pixbuf library" url="gdk-pixbuf/compiling.html">
+ <tocsect3 name="Building the Library" url="gdk-pixbuf/compiling.html#BUILDING"/>
+ <tocsect3 name="Extra Configuration Options" url="gdk-pixbuf/extra-configuration-options.html"/>
+ </tocsect2>
+ <tocsect2 name="License" url="gdk-pixbuf/license.html"/>
+</tocsect1>
+<tocsect1 name="GTK+" url="gtk/index.html">
+ <tocsect2 name="GTK+" url="gtk/gtk.html">
+ <tocsect3 name="General" url="gtk/gtk-general.html"/>
+ <tocsect3 name="Version Information" url="gtk/gtk-feature-test-macros.html"/>
+ <tocsect3 name="Graphics Contexts" url="gtk/gtk-graphics-contexts.html"/>
+ <tocsect3 name="Styles" url="gtk/gtk-styles.html"/>
+ <tocsect3 name="Themes" url="gtk/gtk-themes.html"/>
+ <tocsect3 name="Resource Files" url="gtk/gtk-resource-files.html"/>
+ <tocsect3 name="Keyboard Accelerators" url="gtk/gtk-keyboard-accelerators.html"/>
+ <tocsect3 name="Selections" url="gtk/gtk-selections.html"/>
+ <tocsect3 name="Drag and Drop" url="gtk/gtk-drag-and-drop.html"/>
+ <tocsect3 name="Signals" url="gtk/gtk-signals.html"/>
+ <tocsect3 name="Signal Marshallers" url="gtk/gtk-signal-marshallers.html"/>
+ <tocsect3 name="Implementation of Object Properties" url="gtk/gtk-object-properties.html"/>
+ <tocsect3 name="Types" url="gtk/gtk-types.html"/>
+ <tocsect3 name="Bindings" url="gtk/gtk-types.html"/>
+ <tocsect3 name="Standard Enumerations" url="gtk/gtk-standard-enumerations.html"/>
+ <tocsect3 name="Private Information" url="gtk/gtk-private-information.html"/>
+ </tocsect2>
+ <tocsect2 name="GTK+ Widgets and Objects" url="gtk/gtkobjects.html">
+ <tocsect3 name="GtkAccelLabel" url="gtk/gtkaccellabel.html"/>
+ <tocsect3 name="GtkAdjustment" url="gtk/gtkadjustment.html"/>
+ <tocsect3 name="GtkAlignment" url="gtk/gtkalignment.html"/>
+ <tocsect3 name="GtkArrow" url="gtk/gtkarrow.html"/>
+ <tocsect3 name="GtkAspectFrame" url="gtk/gtkaspectframe.html"/>
+ <tocsect3 name="GtkButtonBox" url="gtk/gtkbuttonbox.html"/>
+ <tocsect3 name="GtkBin" url="gtk/gtkbin.html"/>
+ <tocsect3 name="GtkBox" url="gtk/gtkbox.html"/>
+ <tocsect3 name="GtkButton" url="gtk/gtkbutton.html"/>
+ <tocsect3 name="GtkCalendar" url="gtk/gtkcalendar.html"/>
+ <tocsect3 name="GtkCheckButton" url="gtk/gtkcheckbutton.html"/>
+ <tocsect3 name="GtkCheckMenuItem" url="gtk/gtkcheckmenuitem.html"/>
+ <tocsect3 name="GtkCList" url="gtk/gtkclist.html"/>
+ <tocsect3 name="GtkColorSelection" url="gtk/gtkcolorselection.html"/>
+ <tocsect3 name="GtkColorSelectionDialog" url="gtk/gtkcolorselectiondialog.html"/>
+ <tocsect3 name="GtkCombo" url="gtk/gtkcombo.html"/>
+ <tocsect3 name="GtkContainer" url="gtk/gtkcontainer.html"/>
+ <tocsect3 name="GtkCTree" url="gtk/gtkctree.html"/>
+ <tocsect3 name="GtkCurve" url="gtk/gtkcurve.html"/>
+ <tocsect3 name="GtkData" url="gtk/gtkdata.html"/>
+ <tocsect3 name="GtkDialog" url="gtk/gtkdialog.html"/>
+ <tocsect3 name="GtkDrawingArea" url="gtk/gtkdrawingarea.html"/>
+ <tocsect3 name="GtkEditable" url="gtk/gtkeditable.html"/>
+ <tocsect3 name="GtkEntry" url="gtk/gtkentry.html"/>
+ <tocsect3 name="GtkEventBox" url="gtk/gtkeventbox.html"/>
+ <tocsect3 name="GtkFileSelection" url="gtk/gtkfileselection.html"/>
+ <tocsect3 name="GtkFixed" url="gtk/gtkfixed.html"/>
+ <tocsect3 name="GtkFontSelection" url="gtk/gtkfontselection.html"/>
+ <tocsect3 name="GtkFontSelectionDialog" url="gtk/gtkfontselectiondialog.html"/>
+ <tocsect3 name="GtkFrame" url="gtk/gtkframe.html"/>
+ <tocsect3 name="GtkGammaCurve" url="gtk/gtkgammacurve.html"/>
+ <tocsect3 name="GtkHandleBox" url="gtk/gtkhandlebox.html"/>
+ <tocsect3 name="GtkHButtonBox" url="gtk/gtkhbuttonbox.html"/>
+ <tocsect3 name="GtkHBox" url="gtk/gtkhbox.html"/>
+ <tocsect3 name="GtkHPaned" url="gtk/gtkhpaned.html"/>
+ <tocsect3 name="GtkHRuler" url="gtk/gtkhruler.html"/>
+ <tocsect3 name="GtkHScale" url="gtk/gtkhscale.html"/>
+ <tocsect3 name="GtkHScrollbar" url="gtk/gtkhscrollbar.html"/>
+ <tocsect3 name="GtkHSeparator" url="gtk/gtkhseparator.html"/>
+ <tocsect3 name="GtkImage" url="gtk/gtkimage.html"/>
+ <tocsect3 name="GtkInputDialog" url="gtk/gtkinputdialog.html"/>
+ <tocsect3 name="GtkInvisible" url="gtk/gtkinvisible.html"/>
+ <tocsect3 name="GtkItem" url="gtk/gtkitem.html"/>
+ <tocsect3 name="GtkItemFactory" url="gtk/gtkitemfactory.html"/>
+ <tocsect3 name="GtkLabel" url="gtk/gtklabel.html"/>
+ <tocsect3 name="GtkLayout" url="gtk/gtklayout.html"/>
+ <tocsect3 name="GtkList" url="gtk/gtklist.html"/>
+ <tocsect3 name="GtkListItem" url="gtk/gtklistitem.html"/>
+ <tocsect3 name="GtkMenu" url="gtk/gtkmenu.html"/>
+ <tocsect3 name="GtkMenuBar" url="gtk/gtkmenubar.html"/>
+ <tocsect3 name="GtkMenuItem" url="gtk/gtkmenuitem.html"/>
+ <tocsect3 name="GtkMenuShell" url="gtk/gtkmenushell.html"/>
+ <tocsect3 name="GtkMisc" url="gtk/gtkmisc.html"/>
+ <tocsect3 name="GtkNotebook" url="gtk/gtknotebook.html"/>
+ <tocsect3 name="GtkObject" url="gtk/gtkobject.html"/>
+ <tocsect3 name="GtkOptionMenu" url="gtk/gtkoptionmenu.html"/>
+ <tocsect3 name="GtkPacker" url="gtk/gtkpacker.html"/>
+ <tocsect3 name="GtkPaned" url="gtk/gtkpaned.html"/>
+ <tocsect3 name="GtkPixmap" url="gtk/gtkpixmap.html"/>
+ <tocsect3 name="GtkPlug" url="gtk/gtkplug.html"/>
+ <tocsect3 name="GtkPreview" url="gtk/gtkpreview.html"/>
+ <tocsect3 name="GtkProgress" url="gtk/gtkprogress.html"/>
+ <tocsect3 name="GtkProgressBar" url="gtk/gtkprogressbar.html"/>
+ <tocsect3 name="GtkRadioButton" url="gtk/gtkradiobutton.html"/>
+ <tocsect3 name="GtkRadioMenuItem" url="gtk/gtkradiomenuitem.html"/>
+ <tocsect3 name="GtkRange" url="gtk/gtkrange.html"/>
+ <tocsect3 name="GtkRuler" url="gtk/gtkruler.html"/>
+ <tocsect3 name="GtkScale" url="gtk/gtkscale.html"/>
+ <tocsect3 name="GtkScrollbar" url="gtk/gtkscrollbar.html"/>
+ <tocsect3 name="GtkScrollbar" url="gtk/gtkscrollbar.html"/>
+ <tocsect3 name="GtkSeparator" url="gtk/gtkseparator.html"/>
+ <tocsect3 name="GtkSocket" url="gtk/gtksocket.html"/>
+ <tocsect3 name="GtkSpinButton" url="gtk/gtkspinbutton.html"/>
+ <tocsect3 name="GtkStatusbar" url="gtk/gtkstatusbar.html"/>
+ <tocsect3 name="GtkTable" url="gtk/gtktable.html"/>
+ <tocsect3 name="GtkTearoffMenuItem" url="gtk/gtktearoffmenuitem.html"/>
+ <tocsect3 name="GtkText" url="gtk/gtktext.html"/>
+ <tocsect3 name="GtkTipsQuery" url="gtk/gtktipsquery.html"/>
+ <tocsect3 name="GtkToggleButton" url="gtk/gtktogglebutton.html"/>
+ <tocsect3 name="GtkToolbar" url="gtk/gtktoolbar.html"/>
+ <tocsect3 name="GtkTooltips" url="gtk/gtktooltips.html"/>
+ <tocsect3 name="GtkTree" url="gtk/gtktree.html"/>
+ <tocsect3 name="GtkTreeItem" url="gtk/gtktreeitem.html"/>
+ <tocsect3 name="GtkVButtonBox" url="gtk/gtkvbuttonbox.html"/>
+ <tocsect3 name="GtkVBox" url="gtk/gtkvbox.html"/>
+ <tocsect3 name="GtkViewport" url="gtk/gtkviewport.html"/>
+ <tocsect3 name="GtkVPaned" url="gtk/gtkvpaned.html"/>
+ <tocsect3 name="GtkVRuler" url="gtk/gtkvruler.html"/>
+ <tocsect3 name="GtkVScale" url="gtk/gtkvscale.html"/>
+ <tocsect3 name="GtkVScrollbar" url="gtk/gtkvscrollbar.html"/>
+ <tocsect3 name="GtkVSeparator" url="gtk/gtkvseparator.html"/>
+ <tocsect3 name="GtkWidget" url="gtk/gtkwidget.html"/>
+ <tocsect3 name="GtkWindow" url="gtk/gtkwindow.html"/>
+ </tocsect2>
+ <tocsect2 name="Index" url="gtk/gtk-index.html">
+ <tocsect3 name="Object Hierarchy" url="gtk/gtk-index.html#AEN49629"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Gnome Library" url="gnome/book1.html">
+ <tocsect2 name="gnome-config" url="gnome/gnome-gnome-config.html"/>
+ <tocsect2 name="gnome-defs" url="gnome/gnome-gnome-defs.html"/>
+ <tocsect2 name="gnome-dentry" url="gnome/gnome-gnome-dentry.html"/>
+ <tocsect2 name="gnome-exec" url="gnome/gnome-gnome-exec.html"/>
+ <tocsect2 name="gnome-fileconvert" url="gnome/gnome-gnome-fileconvert.html"/>
+ <tocsect2 name="gnome-help" url="gnome/gnome-gnome-help.html"/>
+ <tocsect2 name="gnome-history" url="gnome/gnome-gnome-history.html"/>
+ <tocsect2 name="gnome-i18n" url="gnome/gnome-gnome-i18n.html"/>
+ <tocsect2 name="gnome-metadata" url="gnome/gnome-gnome-metadata.html"/>
+ <tocsect2 name="gnome-mime-info" url="gnome/gnome-gnome-mime-info.html"/>
+ <tocsect2 name="gnome-mime" url="gnome/gnome-gnome-mime.html"/>
+ <tocsect2 name="gnome-paper" url="gnome/gnome-gnome-paper.html"/>
+ <tocsect2 name="gnome-popt" url="gnome/gnome-gnome-popt.html"/>
+ <tocsect2 name="gnome-regex" url="gnome/gnome-gnome-regex.html"/>
+ <tocsect2 name="gnome-remote" url="gnome/gnome-gnome-remote.html"/>
+ <tocsect2 name="gnome-score" url="gnome/gnome-gnome-score.html"/>
+ <tocsect2 name="gnome-sound" url="gnome/gnome-gnome-sound.html"/>
+ <tocsect2 name="gnome-triggers" url="gnome/gnome-gnome-triggers.html"/>
+ <tocsect2 name="gnome-url" url="gnome/gnome-gnome-url.html"/>
+ <tocsect2 name="gnome-util" url="gnome/gnome-gnome-util.html"/>
+ <tocsect2 name="libgnome" url="gnome/gnome-libgnome.html"/>
+</tocsect1>
+<tocsect1 name="Gnome User Interface Library" url="gnomeui/book1.html">
+ <tocsect2 name="Gnome User Interface Library" url="gnomeui/libgnomeui.html">
+ <tocsect3 name="gnome-app-helper" url="gnomeui/gnomeui-gnome-app-helper.html"/>
+ <tocsect3 name="gnome-app-util" url="gnomeui/gnomeui-gnome-app-util.html"/>
+ <tocsect3 name="gnome-canvas-util" url="gnomeui/gnomeui-gnome-canvas-util.html"/>
+ <tocsect3 name="gnome-dialog-util" url="gnomeui/gnomeui-gnome-dialog-util.html"/>
+ <tocsect3 name="gnome-dns" url="gnomeui/gnomeui-gnome-dns.html"/>
+ <tocsect3 name="gnome-geometry" url="gnomeui/gnomeui-gnome-geometry.html"/>
+ <tocsect3 name="gnome-ice" url="gnomeui/gnomeui-gnome-ice.html"/>
+ <tocsect3 name="gnome-icon-text" url="gnomeui/gnomeui-gnome-icon-text.html"/>
+ <tocsect3 name="gnome-init" url="gnomeui/gnomeui-gnome-init.html"/>
+ <tocsect3 name="gnome-mdi-session" url="gnomeui/gnomeui-gnome-mdi-session.html"/>
+ <tocsect3 name="gnome-popup-help" url="gnomeui/gnomeui-gnome-popup-help.html"/>
+ <tocsect3 name="gnome-popup-menu" url="gnomeui/gnomeui-gnome-popup-menu.html"/>
+ <tocsect3 name="gnome-preferences" url="gnomeui/gnomeui-gnome-preferences.html"/>
+ <tocsect3 name="gnome-properties" url="gnomeui/gnomeui-gnome-properties.html"/>
+ <tocsect3 name="gnome-property-entries" url="gnomeui/gnomeui-gnome-property-entries.html"/>
+ <tocsect3 name="gnome-startup" url="gnomeui/gnomeui-gnome-startup.html"/>
+ <tocsect3 name="gnome-types" url="gnomeui/gnomeui-gnome-types.html"/>
+ <tocsect3 name="gnome-uidefs" url="gnomeui/gnomeui-gnome-uidefs.html"/>
+ <tocsect3 name="gnome-window-icon" url="gnomeui/gnomeui-gnome-window-icon.html"/>
+ <tocsect3 name="gnome-winhints" url="gnomeui/gnomeui-gnome-winhints.html"/>
+ <tocsect3 name="gtkcauldron" url="gnomeui/gnomeui-gtkcauldron.html"/>
+ </tocsect2>
+ <tocsect2 name="GNOME Widgets and Objects" url="gnomeui/gnome-objects.html">
+ <tocsect3 name="GnomeAbout" url="gnomeui/gnomeabout.html"/>
+ <tocsect3 name="GnomeAnimator" url="gnomeui/gnomeanimator.html"/>
+ <tocsect3 name="GnomeApp" url="gnomeui/gnomeapp.html"/>
+ <tocsect3 name="GnomeAppBar" url="gnomeui/gnomeappbar.html"/>
+ <tocsect3 name="GnomeCalculator" url="gnomeui/gnomecalculator.html"/>
+ <tocsect3 name="GnomeCanvas" url="gnomeui/gnomecanvas.html"/>
+ <tocsect3 name="GnomeCanvasItem" url="gnomeui/gnomecanvasitem.html"/>
+ <tocsect3 name="GnomeCanvasGroup" url="gnomeui/gnomecanvasgroup.html"/>
+ <tocsect3 name="GnomeCanvasLine" url="gnomeui/gnomecanvasline.html"/>
+ <tocsect3 name="GnomeCanvasPolygon" url="gnomeui/gnomecanvaspolygon.html"/>
+ <tocsect3 name="GnomeCanvasRE" url="gnomeui/gnomecanvasre.html"/>
+ <tocsect3 name="GnomeCanvasRect" url="gnomeui/gnomecanvasrect.html"/>
+ <tocsect3 name="GnomeCanvasEllipse" url="gnomeui/gnomecanvasellipse.html"/>
+ <tocsect3 name="GnomeCanvasText" url="gnomeui/gnomecanvastext.html"/>
+ <tocsect3 name="GnomeCanvasImage" url="gnomeui/gnomecanvasimage.html"/>
+ <tocsect3 name="GnomeCanvasWidget" url="gnomeui/gnomecanvaswidget.html"/>
+ <tocsect3 name="GnomeClient" url="gnomeui/gnomeclient.html"/>
+ <tocsect3 name="GnomeColorPicker" url="gnomeui/gnomecolorpicker.html"/>
+ <tocsect3 name="GnomeDateEdit" url="gnomeui/gnomedateedit.html"/>
+ <tocsect3 name="GnomeDEntryEdit" url="gnomeui/gnomedentryedit.html"/>
+ <tocsect3 name="GnomeDialog" url="gnomeui/gnomedialog.html"/>
+ <tocsect3 name="GnomeDockBand" url="gnomeui/gnomedockband.html"/>
+ <tocsect3 name="GnomeDockItem" url="gnomeui/gnomedockitem.html"/>
+ <tocsect3 name="GnomeDock" url="gnomeui/gnomedock.html"/>
+ <tocsect3 name="GnomeDruid" url="gnomeui/gnomedruid.html"/>
+ <tocsect3 name="GnomeDruidPage" url="gnomeui/gnomedruidpage.html"/>
+ <tocsect3 name="GnomeDruidPageStart" url="gnomeui/gnomedruidpagestart.html"/>
+ <tocsect3 name="GnomeDruidPageStandard" url="gnomeui/gnomedruidpagestandard.html"/>
+ <tocsect3 name="GnomeDruidPageFinish" url="gnomeui/gnomedruidpagefinish.html"/>
+ <tocsect3 name="GnomeEntry" url="gnomeui/gnomeentry.html"/>
+ <tocsect3 name="GnomeFileEntry" url="gnomeui/gnomefileentry.html"/>
+ <tocsect3 name="GnomeFontPicker" url="gnomeui/gnomefontpicker.html"/>
+ <tocsect3 name="GnomeFontSelector" url="gnomeui/gnomefontselector.html"/>
+ <tocsect3 name="GnomeHRef" url="gnomeui/gnomehref.html"/>
+ <tocsect3 name="GnomeIconEntry" url="gnomeui/gnomeiconentry.html"/>
+ <tocsect3 name="GnomeIconTextItem" url="gnomeui/gnomeicontextitem.html"/>
+ <tocsect3 name="GnomeIconList" url="gnomeui/gnomeiconlist.html"/>
+ <tocsect3 name="GnomeIconSelection" url="gnomeui/gnomeiconselection.html"/>
+ <tocsect3 name="GnomeLess" url="gnomeui/gnomeless.html"/>
+ <tocsect3 name="GnomeMDIChild" url="gnomeui/gnomemdichild.html"/>
+ <tocsect3 name="GnomeMDIGenericChild" url="gnomeui/gnomemdigenericchild.html"/>
+ <tocsect3 name="GnomeMDI" url="gnomeui/gnomemdi.html"/>
+ <tocsect3 name="GnomeMessageBox" url="gnomeui/gnomemessagebox.html"/>
+ <tocsect3 name="GnomeNumberEntry" url="gnomeui/gnomenumberentry.html"/>
+ <tocsect3 name="GnomePaperSelector" url="gnomeui/gnomepaperselector.html"/>
+ <tocsect3 name="GnomePixmapEntry" url="gnomeui/gnomepixmapentry.html"/>
+ <tocsect3 name="GnomePixmap" url="gnomeui/gnomepixmap.html"/>
+ <tocsect3 name="GnomePropertyBox" url="gnomeui/gnomepropertybox.html"/>
+ <tocsect3 name="GnomeScores" url="gnomeui/gnomescores.html"/>
+ <tocsect3 name="GnomeStock" url="gnomeui/gnomestock.html"/>
+ <tocsect3 name="GtkClock" url="gnomeui/gtkclock.html"/>
+ <tocsect3 name="GtkTed" url="gnomeui/gtkted.html"/>
+ <tocsect3 name="GtkDial" url="gnomeui/gtkdial.html"/>
+ <tocsect3 name="GtkPixmapMenuItem" url="gnomeui/gtkpixmapmenuitem.html"/>
+ <tocsect3 name="GnomeSpell" url="gnomeui/gnomespell.html"/>
+ <tocsect3 name="GnomeDockLayout" url="gnomeui/gnomedocklayout.html"/>
+ <tocsect3 name="GnomeProcBar" url="gnomeui/gnomeprocbar.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Bonobo" url="bonobo/book1.html">
+ <tocsect2 name="Core Bonobo" url="bonobo/bonobo-core.html">
+ <tocsect3 name="Core Bonobo Objects" url="bonobo/bonobo-core.html#BONOBO-CORE-OBJECT">
+ <tocsect4 name="BonoboObject" url="bonobo/bonobo-bonobo-object.html"/>
+ <tocsect4 name="BonoboXObject" url="bonobo/bonobo-bonobo-xobject.html"/>
+ <tocsect4 name="bonobo-main" url="bonobo/bonobo-bonobo-main.html"/>
+ </tocsect3>
+ <tocsect3 name="Object Activation and Lifecycle" url="bonobo/bonobo-object-activation.html">
+ <tocsect4 name="bonobo-context" url="bonobo/bonobo-bonobo-context.html"/>
+ <tocsect4 name="bonobo-moniker-util" url="bonobo/bonobo-bonobo-moniker-util.html"/>
+ <tocsect4 name="BonoboObjectClient" url="bonobo/bonobo-bonobo-object-client.html"/>
+ <tocsect4 name="BonoboGenericFactory" url="bonobo/bonobo-bonobo-generic-factory.html"/>
+ <tocsect4 name="bonobo-exception" url="bonobo/bonobo-bonobo-exception.html"/>
+ </tocsect3>
+ <tocsect3 name="Properties" url="bonobo/bonobo-properties.html">
+ <tocsect4 name="BonoboPropertyBag" url="bonobo/bonobo-bonobo-property-bag.html"/>
+ <tocsect4 name="bonobo-property-bag-client" url="bonobo/bonobo-bonobo-property-bag-client.html"/>
+ <tocsect4 name="bonobo-arg" url="bonobo/bonobo-bonobo-arg.html"/>
+ <tocsect4 name="bonobo-property-bag-xml" url="bonobo/bonobo-bonobo-property-bag-xml.html"/>
+ <tocsect4 name="BonoboTransient" url="bonobo/bonobo-bonobo-transient.html"/>
+ </tocsect3>
+ <tocsect3 name="Notification and EventSources" url="bonobo/bonobo-notification.html">
+ <tocsect4 name="bonobo-event-source" url="bonobo/bonobo-bonobo-event-source.html"/>
+ <tocsect4 name="bonobo-listener" url="bonobo/bonobo-bonobo-listener.html"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Storage and Persistance" url="bonobo/bonobo-storage.html">
+ <tocsect3 name="bonobo-storage" url="bonobo/bonobo-bonobo-storage.html"/>
+ <tocsect3 name="BonoboStream" url="bonobo/bonobo-bonobo-stream.html"/>
+ <tocsect3 name="BonoboStreamMem" url="bonobo/bonobo-bonobo-stream-memory.html"/>
+ <tocsect3 name="BonoboPersist" url="bonobo/bonobo-bonobo-persist.html"/>
+ <tocsect3 name="BonoboPersistFile" url="bonobo/bonobo-bonobo-persist-file.html"/>
+ <tocsect3 name="BonoboPersistStream" url="bonobo/bonobo-bonobo-persist-stream.html"/>
+ <tocsect3 name="bonobo-stream-client" url="bonobo/bonobo-bonobo-stream-client.html"/>
+ <tocsect3 name="bonobo-storage-plugin" url="bonobo/bonobo-bonobo-storage-plugin.html"/>
+ </tocsect2>
+ <tocsect2 name="Controls" url="bonobo/bonobo-controls.html">
+ <tocsect3 name="BonoboControl" url="bonobo/bonobo-bonobo-control.html"/>
+ <tocsect3 name="BonoboControlFrame" url="bonobo/bonobo-bonobo-control-frame.html"/>
+ <tocsect3 name="BonoboPropertyControl" url="bonobo/bonobo-bonobo-property-control.html"/>
+ </tocsect2>
+ <tocsect2 name="Bonobo Compound Documents" url="bonobo/bonobo-documents.html">
+ <tocsect3 name="Model interfaces" url="bonobo/bonobo-documents.html#BONOBO-EMBEDDABLE">
+ <tocsect4 name="BonoboClientSite" url="bonobo/bonobo-bonobo-client-site.html"/>
+ <tocsect4 name="BonoboEmbeddable" url="bonobo/bonobo-bonobo-embeddable.html"/>
+ <tocsect4 name="BonoboItemContainer" url="bonobo/bonobo-bonobo-item-container.html"/>
+ </tocsect3>
+ <tocsect3 name="View interfaces" url="bonobo/bonobo-view.html">
+ <tocsect4 name="BonoboView" url="bonobo/bonobo-bonobo-view.html"/>
+ <tocsect4 name="BonoboViewFrame" url="bonobo/bonobo-bonobo-view-frame.html"/>
+ <tocsect4 name="BonoboCanvasItem" url="bonobo/bonobo-bonobo-canvas-item.html"/>
+ <tocsect4 name="BonoboCanvasComponent" url="bonobo/bonobo-bonobo-canvas-component.html"/>
+ </tocsect3>
+ <tocsect3 name="Printing" url="bonobo/bonobo-print.html">
+ <tocsect4 name="BonoboPrint" url="bonobo/bonobo-bonobo-print.html"/>
+ <tocsect4 name="BonoboPrintClient" url="bonobo/bonobo-bonobo-print-client.html"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="Bonobo UI" url="bonobo/bonobo-ui.html">
+ <tocsect3 name="BonoboWidget" url="bonobo/bonobo-bonobo-widget.html"/>
+ <tocsect3 name="BonoboWindow" url="bonobo/bonobo-bonobo-win.html"/>
+ <tocsect3 name="BonoboUIComponent" url="bonobo/bonobo-bonobo-ui-component.html"/>
+ <tocsect3 name="BonoboUIContainer" url="bonobo/bonobo-bonobo-ui-container.html"/>
+ <tocsect3 name="bonobo-ui-util" url="bonobo/bonobo-bonobo-ui-util.html"/>
+ <tocsect3 name="bonobo-ui-node" url="bonobo/bonobo-bonobo-ui-node.html"/>
+ <tocsect3 name="BonoboUIEngine" url="bonobo/bonobo-bonobo-ui-engine.html"/>
+ <tocsect3 name="BonoboUISync" url="bonobo/bonobo-bonobo-ui-sync.html"/>
+ </tocsect2>
+ <tocsect2 name="Writing Monikers" url="bonobo/bonobo-moniker-handlers.html">
+ <tocsect3 name="BonoboMoniker" url="bonobo/bonobo-bonobo-moniker.html"/>
+ <tocsect3 name="BonoboMonikerSimple" url="bonobo/bonobo-bonobo-moniker-simple.html"/>
+ <tocsect3 name="BonoboMonikerExtender" url="bonobo/bonobo-bonobo-moniker-extender.html"/>
+ <tocsect3 name="BonoboItemHandler" url="bonobo/bonobo-bonobo-item-handler.html"/>
+ </tocsect2>
+ <tocsect2 name="Supporting Classes" url="bonobo/bonobo-support-utilities.html">
+ <tocsect3 name="BonoboPlug" url="bonobo/bonobo-bonobo-plug.html"/>
+ <tocsect3 name="BonoboSocket" url="bonobo/bonobo-bonobo-socket.html"/>
+ <tocsect3 name="BonoboWrapper" url="bonobo/bonobo-bonobo-wrapper.html"/>
+ <tocsect3 name="BonoboSelector" url="bonobo/bonobo-bonobo-selector.html"/>
+ <tocsect3 name="bonobo-async" url="bonobo/bonobo-bonobo-async.html"/>
+ </tocsect2>
+</tocsect1>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/gnustep.toc b/languages/cpp/doc/gnustep.toc
new file mode 100644
index 00000000..ef477440
--- /dev/null
+++ b/languages/cpp/doc/gnustep.toc
@@ -0,0 +1,184 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>GNUstep</title>
+<base href="http://www.gnustep.org/resources/documentation"/>
+<tocsect1 name="Base" url="base/Base.html">
+ <tocsect2 name="NSArchiver" url="base/NSArchiver.html"/>
+ <tocsect2 name="NSArray" url="base/NSArray.html"/>
+ <tocsect2 name="NSAssertionHandler" url="base/NSAssertionHandler.html"/>
+ <tocsect2 name="NSAttributedString" url="base/NSAttributedString.html"/>
+ <tocsect2 name="NSAutoreleasePool" url="base/NSAutoreleasePool.html"/>
+ <tocsect2 name="NSBundle" url="base/NSBundle.html"/>
+ <tocsect2 name="NSCalendarDate" url="base/NSCalendarDate.html"/>
+ <tocsect2 name="NSCharacterSet" url="base/NSCharacterSet.html"/>
+ <tocsect2 name="NSCoder" url="base/NSCoder.html"/>
+ <tocsect2 name="NSConditionLock" url="base/NSConditionLock.html"/>
+ <tocsect2 name="NSConnection" url="base/NSConnection.html"/>
+ <tocsect2 name="NSCountedSet" url="base/NSCountedSet.html"/>
+ <tocsect2 name="NSDate" url="base/NSDate.html"/>
+ <tocsect2 name="NSDateFormatter" url="base/NSDateFormatter.html"/>
+ <tocsect2 name="NSDecimalNumber" url="base/NSDecimalNumber.html"/>
+ <tocsect2 name="NSDecimalNumberHandler" url="base/NSDecimalNumberHandler.html"/>
+ <tocsect2 name="NSDeserializer" url="base/NSDeserializer.html"/>
+ <tocsect2 name="NSDictionary" url="base/NSDictionary.html"/>
+ <tocsect2 name="NSDirectoryEnumerator" url="base/NSDirectoryEnumerator.html"/>
+ <tocsect2 name="NSDistantObject" url="base/NSDistantObject.html"/>
+ <tocsect2 name="NSDistantObjectRequest" url="base/NSDistantObjectRequest.html"/>
+ <tocsect2 name="NSDistributedLock" url="base/NSDistributedLock.html"/>
+ <tocsect2 name="NSDistributedNotificationCenter" url="base/NSDistributedNotificationCenter.html"/>
+ <tocsect2 name="NSEnumerator" url="base/NSEnumerator.html"/>
+ <tocsect2 name="NSException" url="base/NSException.html"/>
+ <tocsect2 name="NSFileHandle" url="base/NSFileHandle.html"/>
+ <tocsect2 name="NSFileManager" url="base/NSFileManager.html"/>
+ <tocsect2 name="NSFormatter" url="base/NSFormatter.html"/>
+ <tocsect2 name="NSHost" url="base/NSHost.html"/>
+ <tocsect2 name="NSInvocation" url="base/NSInvocation.html"/>
+ <tocsect2 name="NSLock" url="base/NSLock.html"/>
+ <tocsect2 name="NSMethodSignature" url="base/NSMethodSignature.html"/>
+ <tocsect2 name="NSMutableArray" url="base/NSMutableArray.html"/>
+ <tocsect2 name="NSMutableAttributedString" url="base/NSMutableAttributedString.html"/>
+ <tocsect2 name="NSMutableCharacterSet" url="base/NSMutableCharacterSet.html"/>
+ <tocsect2 name="NSMutableData" url="base/NSMutableData.html"/>
+ <tocsect2 name="NSMutableDictionary" url="base/NSMutableDictionary.html"/>
+ <tocsect2 name="NSMutableSet" url="base/NSMutableSet.html"/>
+ <tocsect2 name="NSMutableString" url="base/NSMutableString.html"/>
+ <tocsect2 name="NSNotification" url="base/NSNotification.html"/>
+ <tocsect2 name="NSNotificationCenter" url="base/NSNotificationCenter.html"/>
+ <tocsect2 name="NSNotificationQueue" url="base/NSNotificationQueue.html"/>
+ <tocsect2 name="NSNull" url="base/NSNull.html"/>
+ <tocsect2 name="NSNumber" url="base/NSNumber.html"/>
+ <tocsect2 name="NSNumberFormatter" url="base/NSNumberFormatter.html"/>
+ <tocsect2 name="NSObject" url="base/NSObject.html"/>
+ <tocsect2 name="NSPort" url="base/NSPort.html"/>
+ <tocsect2 name="NSPortCoder" url="base/NSPortCoder.html"/>
+ <tocsect2 name="NSPortMessage" url="base/NSPortMessage.html"/>
+ <tocsect2 name="NSPortNameServer" url="base/NSPortNameServer.html"/>
+ <tocsect2 name="NSProcessInfo" url="base/NSProcessInfo.html"/>
+ <tocsect2 name="NSProtocolChecker" url="base/NSProtocolChecker.html"/>
+ <tocsect2 name="NSProxy" url="base/NSProxy.html"/>
+ <tocsect2 name="NSRecursiveLock" url="base/NSRecursiveLock.html"/>
+ <tocsect2 name="NSRunLoop" url="base/NSRunLoop.html"/>
+ <tocsect2 name="NSScanner" url="base/NSScanner.html"/>
+ <tocsect2 name="NSSerializer" url="base/NSSerializer.html"/>
+ <tocsect2 name="NSSet" url="base/NSSet.html"/>
+ <tocsect2 name="NSString" url="base/NSString.html"/>
+ <tocsect2 name="NSTask" url="base/NSTask.html"/>
+ <tocsect2 name="NSThread" url="base/NSThread.html"/>
+ <tocsect2 name="NSTimeZone" url="base/NSTimeZone.html"/>
+ <tocsect2 name="NSTimer" url="base/NSTimer.html"/>
+ <tocsect2 name="NSURL" url="base/NSURL.html"/>
+ <tocsect2 name="NSURLHandle" url="base/NSURLHandle.html"/>
+ <tocsect2 name="NSUnarchiver" url="base/NSUnarchiver.html"/>
+ <tocsect2 name="NSUndoManager" url="base/NSUndoManager.html"/>
+ <tocsect2 name="NSUserDefaults" url="base/NSUserDefaults.html"/>
+ <tocsect2 name="NSValue" url="base/NSValue.html"/>
+ <tocsect2 name="NSFunctions" url="base/NSFunctions.html"/>
+ <tocsect2 name="GSMime" url="base/GSMime.html"/>
+ <tocsect2 name="GSXML" url="base/GSXML.html"/>
+</tocsect1>
+<tocsect1 name="Gui" url="gui/Gui.html">
+ <tocsect2 name="NSActionCell" url="gui/NSActionCell.html"/>
+ <tocsect2 name="NSAffineTransform" url="gui/NSAffineTransform.html"/>
+ <tocsect2 name="NSApplication" url="gui/NSApplication.html"/>
+ <tocsect2 name="NSAttributedStrngAdds" url="gui/NSAttributedStrngAdds.html"/>
+ <tocsect2 name="NSBezierPath" url="gui/NSBezierPath.html"/>
+ <tocsect2 name="NSBitmapImageRep" url="gui/NSBitmapImageRep.html"/>
+ <tocsect2 name="NSBox" url="gui/NSBox.html"/>
+ <tocsect2 name="NSBrowser" url="gui/NSBrowser.html"/>
+ <tocsect2 name="NSBrowserCell" url="gui/NSBrowserCell.html"/>
+ <tocsect2 name="NSBundleAdditions" url="gui/NSBundleAdditions.html"/>
+ <tocsect2 name="NSButton" url="gui/NSButton.html"/>
+ <tocsect2 name="NSButtonCell" url="gui/NSButtonCell.html"/>
+ <tocsect2 name="NSCachedImageRep" url="gui/NSCachedImageRep.html"/>
+ <tocsect2 name="NSCell" url="gui/NSCell.html"/>
+ <tocsect2 name="NSClipView" url="gui/NSClipView.html"/>
+ <tocsect2 name="NSCoderAdditions" url="gui/NSCoderAdditions.html"/>
+ <tocsect2 name="NSColor" url="gui/NSColor.html"/>
+ <tocsect2 name="NSColorList" url="gui/NSColorList.html"/>
+ <tocsect2 name="NSColorPanel" url="gui/NSColorPanel.html"/>
+ <tocsect2 name="NSColorPicker" url="gui/NSColorPicker.html"/>
+ <tocsect2 name="NSColorWell" url="gui/NSColorWell.html"/>
+ <tocsect2 name="NSComboBox" url="gui/NSComboBox.html"/>
+ <tocsect2 name="NSComboBoxCell" url="gui/NSComboBoxCell.html"/>
+ <tocsect2 name="NSControl" url="gui/NSControl.html"/>
+ <tocsect2 name="NSCursor" url="gui/NSCursor.html"/>
+ <tocsect2 name="NSCustomImageRep" url="gui/NSCustomImageRep.html"/>
+ <tocsect2 name="NSDPSContext" url="gui/NSDPSContext.html"/>
+ <tocsect2 name="NSDocument" url="gui/NSDocument.html"/>
+ <tocsect2 name="NSDocumentController" url="gui/NSDocumentController.html"/>
+ <tocsect2 name="NSEPSImageRep" url="gui/NSEPSImageRep.html"/>
+ <tocsect2 name="NSEvent" url="gui/NSEvent.html"/>
+ <tocsect2 name="NSFileWrapper" url="gui/NSFileWrapper.html"/>
+ <tocsect2 name="NSFont" url="gui/NSFont.html"/>
+ <tocsect2 name="NSFontManager" url="gui/NSFontManager.html"/>
+ <tocsect2 name="NSFontPanel" url="gui/NSFontPanel.html"/>
+ <tocsect2 name="NSForm" url="gui/NSForm.html"/>
+ <tocsect2 name="NSFormCell" url="gui/NSFormCell.html"/>
+ <tocsect2 name="NSGraphicsContext" url="gui/NSGraphicsContext.html"/>
+ <tocsect2 name="NSHelpManager" url="gui/NSHelpManager.html"/>
+ <tocsect2 name="NSImage" url="gui/NSImage.html"/>
+ <tocsect2 name="NSImageCell" url="gui/NSImageCell.html"/>
+ <tocsect2 name="NSImageRep" url="gui/NSImageRep.html"/>
+ <tocsect2 name="NSImageView" url="gui/NSImageView.html"/>
+ <tocsect2 name="NSInputManager" url="gui/NSInputManager.html"/>
+ <tocsect2 name="NSInputServer" url="gui/NSInputServer.html"/>
+ <tocsect2 name="NSLayoutManager" url="gui/NSLayoutManager.html"/>
+ <tocsect2 name="NSMatrix" url="gui/NSMatrix.html"/>
+ <tocsect2 name="NSMenu" url="gui/NSMenu.html"/>
+ <tocsect2 name="NSMenuItem" url="gui/NSMenuItem.html"/>
+ <tocsect2 name="NSMenuItemCell" url="gui/NSMenuItemCell.html"/>
+ <tocsect2 name="NSMenuView" url="gui/NSMenuView.html"/>
+ <tocsect2 name="NSMutableAttributedStringAdditions" url="gui/NSMutableAttributedStringAdditions.html"/>
+ <tocsect2 name="NSMutableParagraphStyle" url="gui/NSMutableParagraphStyle.html"/>
+ <tocsect2 name="NSOpenPanel" url="gui/NSOpenPanel.html"/>
+ <tocsect2 name="NSPICTImageRep" url="gui/NSPICTImageRep.html"/>
+ <tocsect2 name="NSPageLayout" url="gui/NSPageLayout.html"/>
+ <tocsect2 name="NSPanel" url="gui/NSPanel.html"/>
+ <tocsect2 name="NSParagraphStyle" url="gui/NSParagraphStyle.html"/>
+ <tocsect2 name="NSPasteboard" url="gui/NSPasteboard.html"/>
+ <tocsect2 name="NSPopUpButton" url="gui/NSPopUpButton.html"/>
+ <tocsect2 name="NSPopUpButtonCell" url="gui/NSPopUpButtonCell.html"/>
+ <tocsect2 name="NSPrintInfo" url="gui/NSPrintInfo.html"/>
+ <tocsect2 name="NSPrintOperation" url="gui/NSPrintOperation.html"/>
+ <tocsect2 name="NSPrintPanel" url="gui/NSPrintPanel.html"/>
+ <tocsect2 name="NSPrinter" url="gui/NSPrinter.html"/>
+ <tocsect2 name="NSProgressIndicator" url="gui/NSProgressIndicator.html"/>
+ <tocsect2 name="NSResponder" url="gui/NSResponder.html"/>
+ <tocsect2 name="NSRulerMarker" url="gui/NSRulerMarker.html"/>
+ <tocsect2 name="NSRulerView" url="gui/NSRulerView.html"/>
+ <tocsect2 name="NSSavePanel" url="gui/NSSavePanel.html"/>
+ <tocsect2 name="NSScreen" url="gui/NSScreen.html"/>
+ <tocsect2 name="NSScrollView" url="gui/NSScrollView.html"/>
+ <tocsect2 name="NSScroller" url="gui/NSScroller.html"/>
+ <tocsect2 name="NSSecureTextField" url="gui/NSSecureTextField.html"/>
+ <tocsect2 name="NSSecureTextFieldCell" url="gui/NSSecureTextFieldCell.html"/>
+ <tocsect2 name="NSSlider" url="gui/NSSlider.html"/>
+ <tocsect2 name="NSSliderCell" url="gui/NSSliderCell.html"/>
+ <tocsect2 name="NSSpellChecker" url="gui/NSSpellChecker.html"/>
+ <tocsect2 name="NSSpellServer" url="gui/NSSpellServer.html"/>
+ <tocsect2 name="NSSplitView" url="gui/NSSplitView.html"/>
+ <tocsect2 name="NSStringAdditions" url="gui/NSStringAdditions.html"/>
+ <tocsect2 name="NSTabView" url="gui/NSTabView.html"/>
+ <tocsect2 name="NSTabViewItem" url="gui/NSTabViewItem.html"/>
+ <tocsect2 name="NSTableColumn" url="gui/NSTableColumn.html"/>
+ <tocsect2 name="NSTableHeaderCell" url="gui/NSTableHeaderCell.html"/>
+ <tocsect2 name="NSTableHeaderView" url="gui/NSTableHeaderView.html"/>
+ <tocsect2 name="NSTableView" url="gui/NSTableView.html"/>
+ <tocsect2 name="NSText" url="gui/NSText.html"/>
+ <tocsect2 name="NSTextAttachment" url="gui/NSTextAttachment.html"/>
+ <tocsect2 name="NSTextAttachmentCell" url="gui/NSTextAttachmentCell.html"/>
+ <tocsect2 name="NSTextContainer" url="gui/NSTextContainer.html"/>
+ <tocsect2 name="NSTextField" url="gui/NSTextField.html"/>
+ <tocsect2 name="NSTextFieldCell" url="gui/NSTextFieldCell.html"/>
+ <tocsect2 name="NSTextStorage" url="gui/NSTextStorage.html"/>
+ <tocsect2 name="NSTextTab" url="gui/NSTextTab.html"/>
+ <tocsect2 name="NSTextView" url="gui/NSTextView.html"/>
+ <tocsect2 name="NSView" url="gui/NSView.html"/>
+ <tocsect2 name="NSWindow" url="gui/NSWindow.html"/>
+ <tocsect2 name="NSWindowController" url="gui/NSWindowController.html"/>
+ <tocsect2 name="NSWorkspace" url="gui/NSWorkspace.html"/>
+ <tocsect2 name="DPSOperators" url="gui/DPSOperators.html"/>
+</tocsect1>
+<tocsect1 name="Backend" url="back/Back.html"/>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/gtk_bugs.toc b/languages/cpp/doc/gtk_bugs.toc
new file mode 100644
index 00000000..fd1aa962
--- /dev/null
+++ b/languages/cpp/doc/gtk_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>GTK bugs</title>
+<base href="http://bugzilla.gnome.org/"/>
+<tocsect1 name="Query" url="query.cgi">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/cpp/doc/kde2book.toc b/languages/cpp/doc/kde2book.toc
new file mode 100644
index 00000000..e7d5f4d2
--- /dev/null
+++ b/languages/cpp/doc/kde2book.toc
@@ -0,0 +1,2875 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>KDE2 Development Book (kde.org)</title>
+<base href="http://developer.kde.org/documentation/books/kde-2.0-development"/>
+<tocsect1 name="Foreword" url="f822.html">
+ <tocsect2 name="Lead Author" url="frm15.html"/>
+ <tocsect2 name="Contributing Authors" url="frm16.html"/>
+ <tocsect2 name="Acknowledgments" url="frm17.html"/>
+ <tocsect2 name="Tell Us What You Think!" url="frm17.html"/>
+</tocsect1>
+<tocsect1 name="Introduction" url="f915.html">
+ <tocsect2 name="Prerequisites" url="frm19.html"/>
+ <tocsect2 name="About the Open Publication License" url="frm20.html"/>
+ <tocsect2 name="Organization of This Book" url="frm21.html"/>
+ <tocsect2 name="Conventions Used in This Book" url="frm22.html"/>
+ <tocsect2 name="Time to Develop!" url="frm22.html"/>
+</tocsect1>
+<tocsect1 name="Fundamentals of KDE Application Programming" url="p01.html">
+ <tocsect2 name="The K Desktop Environment Background" url="ch01.html">
+ <tocsect3 name="Motivation for a Free Desktop" url="ch01lev1sec2.html"/>
+ <tocsect3 name="Why Develop with KDE?" url="ch01lev1sec3.html"/>
+ <tocsect3 name="KDE Organization and Resources" url="ch01lev1sec4.html"/>
+ <tocsect3 name="System Requirements" url="ch01lev1sec5.html"/>
+ <tocsect3 name="Obtaining and Installing KDE" url="ch01lev1sec6.html"/>
+ <tocsect3 name="Licenses and Legalities" url="ch01lev1sec7.html"/>
+ <tocsect3 name="Let's Code, Already!" url="ch01lev1sec7.html"/>
+ </tocsect2>
+ <tocsect2 name="A Simple KDE Application" url="ch02.html">
+ <tocsect3 name="The Linux/UNIX Programmer's Desktop" url="ch02lev1sec2.html"/>
+ <tocsect3 name="Compiling a KDE Program" url="ch02lev1sec3.html"/>
+ <tocsect3 name="KDE Application Structure" url="ch02lev1sec4.html"/>
+ <tocsect3 name="GUI Elements" url="ch02lev1sec5.html"/>
+ <tocsect3 name="Programming Conventions" url="ch02lev1sec6.html"/>
+ <tocsect3 name="Summary" url="ch02lev1sec7.html"/>
+ <tocsect3 name="Exercises" url="ch02lev1sec7.html"/>
+ </tocsect2>
+ <tocsect2 name="The Qt Toolkit" url="ch03.html">
+ <tocsect3 name="What It Is For (Look and Feel)" url=""/>
+ <tocsect3 name="Inside the Qt Toolkit" url="ch03lev1sec2.html"/>
+ <tocsect3 name="Signals and Slots" url="ch03lev1sec3.html"/>
+ <tocsect3 name="Meta Object Compiler (moc)" url="ch03lev1sec4.html"/>
+ <tocsect3 name="The Utility Classes" url="ch03lev1sec5.html"/>
+ <tocsect3 name="Special Features (ImageIO, OpenGL, Mesa)" url="ch03lev1sec6.html"/>
+ <tocsect3 name="Summary" url="ch03lev1sec7.html"/>
+ <tocsect3 name="Exercises" url="ch03lev1sec8.html"/>
+ </tocsect2>
+ <tocsect2 name="Creating Custom KDE Widgets" url="ch04.html">
+ <tocsect3 name="Widget Basics" url="ch04lev1sec2.html"/>
+ <tocsect3 name="Painting Widgets" url="ch04lev1sec3.html"/>
+ <tocsect3 name="Using Child Widgets" url="ch04lev1sec4.html"/>
+ <tocsect3 name="Handling User Input" url="ch04lev1sec5.html"/>
+ <tocsect3 name="Summary" url="ch04lev1sec6.html"/>
+ <tocsect3 name="Exercises" url="ch04lev1sec6.html"/>
+ </tocsect2>
+ <tocsect2 name="KDE User Interface Compliance" url="ch05.html">
+ <tocsect3 name="The KDE Document-Centric Interface" url="ch05lev1sec2.html"/>
+ <tocsect3 name="Helping the User Use Your Application" url="ch05lev1sec3.html"/>
+ <tocsect3 name="Standard Dialog Boxes" url="ch05lev1sec4.html"/>
+ <tocsect3 name="Summary" url="ch05lev1sec5.html"/>
+ <tocsect3 name="Exercises" url="ch05lev1sec5.html"/>
+ </tocsect2>
+ <tocsect2 name="KDE Style Reference" url="ch06.html">
+ <tocsect3 name="Accessing the Standard Actions" url="ch06lev1sec2.html"/>
+ <tocsect3 name="Session Management" url="ch06lev1sec3.html"/>
+ <tocsect3 name="The Standard KDE Icons" url="ch06lev1sec4.html"/>
+ <tocsect3 name="Internationalization" url="ch06lev1sec5.html"/>
+ <tocsect3 name="Playing Sounds" url="ch06lev1sec6.html"/>
+ <tocsect3 name="User Notifications" url="ch06lev1sec7.html"/>
+ <tocsect3 name="Executing Other Programs" url="ch06lev1sec8.html"/>
+ <tocsect3 name="Network Transparency" url="ch06lev1sec9.html"/>
+ <tocsect3 name="User Friendliness" url="ch06lev1sec10.html"/>
+ <tocsect3 name="Summary" url="ch06lev1sec11.html"/>
+ <tocsect3 name="Exercises" url="ch06lev1sec11.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Advanced KDE Widgets and UI Design Techniques" url="p02.html">
+ <tocsect2 name="Further KDE Compliance" url="ch07.html">
+ <tocsect3 name="Drag and Drop" url="ch07lev1sec2.html"/>
+ <tocsect3 name="Application Configuration Information" url="ch07lev1sec3.html"/>
+ <tocsect3 name="Session Management" url="ch07lev1sec4.html"/>
+ <tocsect3 name="Application Resources" url="ch07lev1sec5.html"/>
+ <tocsect3 name="Network Transparency" url="ch07lev1sec6.html"/>
+ <tocsect3 name="Summary" url="ch07lev1sec7.html"/>
+ <tocsect3 name="Exercises" url="ch07lev1sec7.html"/>
+ </tocsect2>
+ <tocsect2 name="Using Dialog Boxes" url="ch08.html">
+ <tocsect3 name="Getting Started with the Dialog Widgets" url="ch08lev1sec2.html"/>
+ <tocsect3 name="Dialog Layout the Simple Way" url="ch08lev1sec3.html"/>
+ <tocsect3 name="Dialog Modality-Modal or Modeless Dialogs" url="ch08lev1sec4.html"/>
+ <tocsect3 name="KDE User-Interface Library (kdeui)" url="ch08lev1sec5.html"/>
+ <tocsect3 name="KDE User-Interface Library (kdeui)" url="ch08lev1sec6.html"/>
+ <tocsect3 name="A Larger Example: The Option Dialog in KEdit" url="ch08lev1sec7.html"/>
+ <tocsect3 name="User Interface Design Rules for Dialogs" url="ch08lev1sec8.html"/>
+ <tocsect3 name="Summary" url="ch08lev1sec9.html"/>
+ <tocsect3 name="Exercises" url="ch08lev1sec9.html"/>
+ </tocsect2>
+ <tocsect2 name="Constructing A Responsive User Interface" url="ch09.html">
+ <tocsect3 name="The Importance of Responsiveness" url="ch09lev1sec2.html"/>
+ <tocsect3 name="Speeding Up Window Updates" url="ch09lev1sec3.html"/>
+ <tocsect3 name="Performing Long Jobs" url="ch09lev1sec4.html"/>
+ <tocsect3 name="Summary" url="ch09lev1sec5.html"/>
+ <tocsect3 name="Exercises" url="ch09lev1sec5.html"/>
+ </tocsect2>
+ <tocsect2 name="Complex-Function KDE Widgets" url="ch10.html">
+ <tocsect3 name="Rendering HTML Files" url="ch10lev1sec2.html"/>
+ <tocsect3 name="Manipulating Images" url="ch10lev1sec3.html"/>
+ <tocsect3 name="Checking Spelling" url="ch10lev1sec4.html"/>
+ <tocsect3 name="Accessing the Address Book" url="ch10lev1sec5.html"/>
+ <tocsect3 name="Summary" url="ch10lev1sec6.html"/>
+ <tocsect3 name="Exercises" url="ch10lev1sec6.html"/>
+ </tocsect2>
+ <tocsect2 name="Alternative Application Types" url="ch11.html">
+ <tocsect3 name="Dialog-Based Applications" url="ch11lev1sec2.html"/>
+ <tocsect3 name="Single-Instance Applications" url="ch11lev1sec3.html"/>
+ <tocsect3 name="Panel Applets" url="ch11lev1sec4.html"/>
+ <tocsect3 name="Summary" url="ch11lev1sec5.html"/>
+ <tocsect3 name="Exercises" url="ch11lev1sec5.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Application Interaction and Integration" url="p03.html">
+ <tocsect2 name="Creating and Using Components (KParts)" url="ch12.html">
+ <tocsect3 name="The Difference Between Components and Widgets" url="ch12lev1sec2.html"/>
+ <tocsect3 name="The KDE Component Framework" url="ch12lev1sec3.html"/>
+ <tocsect3 name="Describing User Interface in XML" url="ch12lev1sec4.html"/>
+ <tocsect3 name="Read-Only and Read/Write Parts" url="ch12lev1sec5.html"/>
+ <tocsect3 name="Creating a Part" url="ch12lev1sec6.html"/>
+ <tocsect3 name="Making a Part Available Using Shared Libraries" url="ch12lev1sec7.html"/>
+ <tocsect3 name="Creating a KParts Application" url="ch12lev1sec8.html"/>
+ <tocsect3 name="Embedding More Than One Part in the Same Window" url="ch12lev1sec9.html"/>
+ <tocsect3 name="Creating a KParts Plug-in" url="ch12lev1sec10.html"/>
+ <tocsect3 name="Summary" url="ch12lev1sec10.html"/>
+ </tocsect2>
+ <tocsect2 name="DCOP-Desktop Communication Protocol" url="ch13.html">
+ <tocsect3 name="Motivation" url="ch13lev1sec2.html"/>
+ <tocsect3 name="History" url="ch13lev1sec3.html"/>
+ <tocsect3 name="Underlying Technologies" url="ch13lev1sec4.html"/>
+ <tocsect3 name="Architecture" url="ch13lev1sec5.html"/>
+ <tocsect3 name="Description of DCOP's Programming Interface" url="ch13lev1sec6.html"/>
+ <tocsect3 name="Developer Concerns and Tools in DCOP" url="ch13lev1sec7.html"/>
+ <tocsect3 name="DCOP Use in KDE 2.0-A Few Examples" url="ch13lev1sec8.html"/>
+ <tocsect3 name="Summary" url="ch13lev1sec8.html"/>
+ </tocsect2>
+ <tocsect2 name="Multimedia" url="ch14.html">
+ <tocsect3 name="Introducing aRts/MCOP" url="ch14lev1sec2.html"/>
+ <tocsect3 name="A First Glance at Writing Modules" url="ch14lev1sec3.html"/>
+ <tocsect3 name="MCOP" url="ch14lev1sec4.html"/>
+ <tocsect3 name="Standard Interfaces" url="ch14lev1sec5.html"/>
+ <tocsect3 name="Standard Interfaces" url="ch14lev1sec6.html"/>
+ <tocsect3 name="KDE Multimedia Besides MCOP" url="ch14lev1sec7.html"/>
+ <tocsect3 name="The Future of MCOP" url="ch14lev1sec8.html"/>
+ <tocsect3 name="Summary" url="ch14lev1sec9.html"/>
+ <tocsect3 name="Exercises" url="ch14lev1sec9.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Developer Tools and Support" url="p04.html">
+ <tocsect2 name="Creating Documentation" url="ch15.html">
+ <tocsect3 name="Documenting Source Code" url="ch15lev1sec2.html"/>
+ <tocsect3 name="Documenting Applications" url="ch15lev1sec3.html"/>
+ <tocsect3 name="Summary" url="ch15lev1sec3.html"/>
+ </tocsect2>
+ <tocsect2 name="Packaging and Distributing Code" url="ch16.html">
+ <tocsect3 name="The Structure of a Package" url="ch16lev1sec2.html"/>
+ <tocsect3 name="Administrative Files" url="ch16lev1sec3.html"/>
+ <tocsect3 name="Distributing Your Application" url="ch16lev1sec4.html"/>
+ <tocsect3 name="Summary" url="ch16lev1sec4.html"/>
+ </tocsect2>
+ <tocsect2 name="Managing Source Code with CVS" url="ch17.html">
+ <tocsect3 name="What Is CVS?" url="ch17lev1sec2.html"/>
+ <tocsect3 name="CVS Organization" url="ch17lev1sec3.html"/>
+ <tocsect3 name="Accessing Source Code in CVS" url="ch17lev1sec4.html"/>
+ <tocsect3 name="Installing and Using CVSup" url="ch17lev1sec5.html"/>
+ <tocsect3 name="Installing and Using cvs" url="ch17lev1sec6.html"/>
+ <tocsect3 name="Summary" url="ch17lev1sec6.html"/>
+ </tocsect2>
+ <tocsect2 name="The KDevelop IDE: The Integrated Development Environment for KDE" url="ch18.html">
+ <tocsect3 name="General Issues" url="ch18lev1sec2.html"/>
+ <tocsect3 name="Creating KDE 2.0 Applications" url="ch18lev1sec3.html"/>
+ <tocsect3 name="Getting Started with the KDE 2.0 API" url="ch18lev1sec4.html"/>
+ <tocsect3 name="The Classbrowser and Your Project" url="ch18lev1sec5.html"/>
+ <tocsect3 name="The File Viewers-The Windows to Your Project Files" url="ch18lev1sec6.html"/>
+ <tocsect3 name="The KDevelop Debugger" url="ch18lev1sec7.html"/>
+ <tocsect3 name="KDevelop 2.0-A Preview" url="ch18lev1sec8.html"/>
+ <tocsect3 name="Summary" url="ch18lev1sec8.html"/>
+ </tocsect2>
+ <tocsect2 name="Licensing Issues" url="ch19.html">
+ <tocsect3 name="Licensing Issues" url="ch19lev1sec2.html"/>
+ <tocsect3 name="License Usage by KDE" url="ch19lev1sec3.html"/>
+ <tocsect3 name="The License Usage by Qt" url="ch19lev1sec4.html"/>
+ <tocsect3 name="The KDE/Qt License History" url="ch19lev1sec5.html"/>
+ <tocsect3 name="Summary" url="ch19lev1sec5.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Appendixes" url="p05.html">
+ <tocsect2 name="KDE-Related Licenses" url="ap-a.html">
+ <tocsect3 name="GNU Library General Public License (LGPL)" url="appa1.html"/>
+ <tocsect3 name="GNU General Public License" url="appa1.html"/>
+ </tocsect2>
+ <tocsect2 name="KDE Class Reference" url="ap-c.html"/>
+ <tocsect2 name="Answers" url="ap-c.html">
+ <tocsect3 name="Chapter 1" url="appc1.html"/>
+ <tocsect3 name="Chapter 2" url="appc3.html"/>
+ <tocsect3 name="Chapter 3" url="appc5.html"/>
+ <tocsect3 name="Chapter 4" url="appc7.html"/>
+ <tocsect3 name="Chapter 5" url="appc9.html"/>
+ <tocsect3 name="Chapter 6" url="appc11.html"/>
+ <tocsect3 name="Chapter 7" url="appc13.html"/>
+ <tocsect3 name="Chapter 8" url="appc15.html"/>
+ <tocsect3 name="Chapter 9" url="appc17.html"/>
+ <tocsect3 name="Chapter 10" url="appc19.html"/>
+ <tocsect3 name="Chapter 11" url="appc21.html"/>
+ <tocsect3 name="Chapter 12" url="appc22.html"/>
+ <tocsect3 name="Chapter 13" url="appc23.html"/>
+ <tocsect3 name="Chapter 14" url="ch14.html"/>
+ </tocsect2>
+</tocsect1>
+
+
+<index>
+<entry name="aboutApp action" url="ch06.html"/>
+<entry name="aboutKDE action" url="ch06.html"/>
+<entry name="Abstract tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="accessing, application configuration files" url="ch07lev1sec2.html"/>
+<entry name="accessing, resources" url="ch07lev1sec4.html"/>
+<entry name="accesssing, documentation" url="ch18.html"/>
+<entry name="accounts, CVS (Concurrent Version System) accounts" url="ch17lev1sec3.html"/>
+<entry name="acessing, streams" url="ch14lev1sec3.html"/>
+<entry name="actionCollection() function" url="ch05.html"/>
+<entry name="actions, aboutApp" url="ch06.html"/>
+<entry name="actions, aboutKDE" url="ch06.html"/>
+<entry name="actions, actualSize" url="ch06.html"/>
+<entry name="actions, addBookmark" url="ch06.html"/>
+<entry name="actions, back" url="ch06.html"/>
+<entry name="actions, configureToolbars" url="ch06.html"/>
+<entry name="actions, copy" url="ch06.html"/>
+<entry name="actions, custom actions, KCustomActions widget" url="ch05.html"/>
+<entry name="actions, custom actions" url="ch05.html"/>
+<entry name="actions, Cut" url="ch06.html"/>
+<entry name="actions, editBookmarks" url="ch06.html"/>
+<entry name="actions, findNext" url="ch06.html"/>
+<entry name="actions, findPrev" url="ch06.html"/>
+<entry name="actions, find" url="ch06.html"/>
+<entry name="actions, firstPage" url="ch06.html"/>
+<entry name="actions, fitToHeight" url="ch06.html"/>
+<entry name="actions, fitToPage" url="ch06.html"/>
+<entry name="actions, fitToWidth" url="ch06.html"/>
+<entry name="actions, forward" url="ch06.html"/>
+<entry name="actions, gotoLine" url="ch06.html"/>
+<entry name="actions, gotoPage" url="ch06.html"/>
+<entry name="actions, goTo" url="ch06.html"/>
+<entry name="actions, helpContents" url="ch06.html"/>
+<entry name="actions, help" url="ch06.html"/>
+<entry name="actions, home" url="ch06.html"/>
+<entry name="actions, KAction class" url="ch05.html"/>
+<entry name="actions, keyBindings" url="ch06.html"/>
+<entry name="actions, lastPage" url="ch06.html"/>
+<entry name="actions, mail" url="ch06.html"/>
+<entry name="actions, next" url="ch06.html"/>
+<entry name="actions, openNew" url="ch06.html"/>
+<entry name="actions, openRecent" url="ch06.html"/>
+<entry name="actions, open" url="ch06.html"/>
+<entry name="actions, paste" url="ch06.html"/>
+<entry name="actions, preferences" url="ch06.html"/>
+<entry name="actions, printPreview" url="ch06.html"/>
+<entry name="actions, print" url="ch06.html"/>
+<entry name="actions, prior" url="ch06.html"/>
+<entry name="actions, quit" url="ch06.html"/>
+<entry name="actions, redisplay" url="ch06.html"/>
+<entry name="actions, redo" url="ch06.html"/>
+<entry name="actions, replace" url="ch06.html"/>
+<entry name="actions, reportBug" url="ch06.html"/>
+<entry name="actions, revert" url="ch06.html"/>
+<entry name="actions, saveAs" url="ch06.html"/>
+<entry name="actions, saveOptions" url="ch06.html"/>
+<entry name="actions, save" url="ch06.html"/>
+<entry name="actions, selectAll" url="ch06.html"/>
+<entry name="actions, showMenubar" url="ch06.html"/>
+<entry name="actions, showStatusbar" url="ch06.html"/>
+<entry name="actions, showToolbar" url="ch06.html"/>
+<entry name="actions, spelling" url="ch06.html"/>
+<entry name="actions, standard actions, KStdAction class" url="ch05.html"/>
+<entry name="actions, standard actions, KStdActionsDemo widget" url="ch05.html"/>
+<entry name="actions, standard actions" url="ch05.html"/>
+<entry name="actions, undo" url="ch06.html"/>
+<entry name="actions, up" url="ch06.html"/>
+<entry name="actions" url="ch05.html"/>
+<entry name="actions, whatsThis" url="ch06.html"/>
+<entry name="actions, zoomIn" url="ch06.html"/>
+<entry name="actions, zoomOut" url="ch06.html"/>
+<entry name="actions, zoom" url="ch06.html"/>
+<entry name="Action tag (XML)" url="ch05.html"/>
+<entry name="actualSize action" url="ch06.html"/>
+<entry name="addAuthor() function" url="ch05.html"/>
+<entry name="addBookmark action" url="ch06.html"/>
+<entry name="Add Folder command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="add() function" url="ch05lev1sec2.html"/>
+<entry name="addGlobalReference function" url="ch14lev1sec3.html"/>
+<entry name="Add Member Function command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="Add Member Variable command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="add option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="address book, contacts, selecting" url="ch10lev1sec4.html"/>
+<entry name="address book" url="ch10lev1sec4.html"/>
+<entry name="administrative files (packages), config.cache" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), config.h" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), config.log" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), config.status" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), configure.in" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), configure" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages), updating" url="ch16lev1sec2.html"/>
+<entry name="administrative files (packages)" url="ch16lev1sec2.html"/>
+<entry name="aKtion" url="ch14lev1sec6.html"/>
+<entry name="all target" url="ch16lev1sec2.html"/>
+<entry name="amin() method, KDialogApp" url="ch11.html"/>
+<entry name="&amp;, (ampersand)" url="ch02lev1sec4.html"/>
+<entry name="ampersand (&amp;)" url="ch02lev1sec4.html"/>
+<entry name="analog, real-time synthesis (aRts)" url="ch14.html"/>
+<entry name="announcing software" url="ch16lev1sec3.html"/>
+<entry name="API tools (DCOP), findObject() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), isApplicationRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), isRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), registeredApplications() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), remoteFunctions() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), remoteInterfaces() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), remoteObjects() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), senderId() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP), socket() method" url="ch13lev1sec6.html"/>
+<entry name="API tools (DCOP)" url="ch13lev1sec6.html"/>
+<entry name="appdata resource type" url="ch07lev1sec4.html"/>
+<entry name="applets, panel applet (KWeather), kweather.cpp class definition" url="ch11lev1sec3.html"/>
+<entry name="applets, panel applet (KWeather), kweather.h class definition" url="ch11lev1sec3.html"/>
+<entry name="applets, panel applet (KWeather), main() method" url="ch11lev1sec3.html"/>
+<entry name="applets, panel applet (KWeather)" url="ch11lev1sec3.html"/>
+<entry name="application configuration files, accessing" url="ch07lev1sec2.html"/>
+<entry name="application configuration files, example of" url="ch07lev1sec2.html"/>
+<entry name="application configuration files" url="ch07lev1sec2.html"/>
+<entry name="application icons, specifications" url="ch06lev1sec3.html"/>
+<entry name="application resources, accessing" url="ch07lev1sec4.html"/>
+<entry name="application resources, .desktop files" url="ch07lev1sec4.html"/>
+<entry name="application resources, standard resource locations" url="ch07lev1sec4.html"/>
+<entry name="application resources, types" url="ch07lev1sec4.html"/>
+<entry name="applications, configuration, options/configuration comparison" url="ch06.html"/>
+<entry name="applications, creating, KDevelop Application Wizard" url="ch18lev1sec2.html"/>
+<entry name="applications, creating, project editing" url="ch18lev1sec2.html"/>
+<entry name="applications, creating, templates" url="ch18lev1sec2.html"/>
+<entry name="applications, dialog-based (KDialogApp), kdialogapp.cpp class declaration" url="ch11.html"/>
+<entry name="applications, dialog-based (KDialogApp), kdialogapp.h class definition" url="ch11.html"/>
+<entry name="applications, dialog-based (KDialogApp), main() method" url="ch11.html"/>
+<entry name="applications, dialog-based (KDialogApp)" url="ch11.html"/>
+<entry name="applications, documenting with DocBook tools, DocBook installation" url="ch15lev1sec2.html"/>
+<entry name="applications, documenting with DocBook tools, DocBook Web site" url="ch15lev1sec2.html"/>
+<entry name="applications, documenting with DocBook tools, processing documentation" url="ch15lev1sec2.html"/>
+<entry name="applications, documenting with DocBook tools, sample documentation" url="ch15lev1sec2.html"/>
+<entry name="applications, documenting with DocBook tools, tags" url="ch15lev1sec2.html"/>
+<entry name="applications, documenting with DocBook tools" url="ch15lev1sec2.html"/>
+<entry name="applications, interfaces, user friendliness" url="ch06lev1sec9.html"/>
+<entry name="applications, network transparency, classes" url="ch06lev1sec8.html"/>
+<entry name="applications, network transparency" url="ch06lev1sec8.html"/>
+<entry name="applications, options, configuration/options comparison" url="ch06.html"/>
+<entry name="applications, running, KRun class" url="ch06lev1sec7.html"/>
+<entry name="applications, single-instance, kunique.cpp call definition" url="ch11lev1sec2.html"/>
+<entry name="applications, single-instance, kunique.h class definition" url="ch11lev1sec2.html"/>
+<entry name="applications, single-instance, main() method" url="ch11lev1sec2.html"/>
+<entry name="applications" url="ch02lev1sec3.html"/>
+<entry name="Application tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Application Wizard (KDevelop)" url="ch18lev1sec2.html"/>
+<entry name="apps resource type" url="ch07lev1sec4.html"/>
+<entry name="architecture, DCOP (Desktop Communication Protocol)" url="ch13lev1sec4.html"/>
+<entry name="archives, creating" url="ch16lev1sec3.html"/>
+<entry name="aRts (analog, real-time synthesis)" url="ch14.html"/>
+<entry name="artsbuilder" url="ch14lev1sec7.html"/>
+<entry name="async element (IDL)" url="ch14lev1sec3.html"/>
+<entry name="asynchronous streams" url="ch14lev1sec3.html"/>
+<entry name="at symbol (" url="ch15.html"/>
+<entry name="attach function" url="ch14lev1sec4.html"/>
+<entry name="attach() method" url="ch13lev1sec5.html"/>
+<entry name="attributes (IDL)" url="ch14lev1sec3.html"/>
+<entry name="attributes" url="ch05.html"/>
+<entry name="attributes, widget attributes" url="ch04.html"/>
+<entry name="AuthorGroup tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Author tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="author (" url="ch15.html"/>
+<entry name="Autoconf tool" url="ch18.html"/>
+<entry name="Automake tool" url="ch18.html"/>
+<entry name="back action" url="ch06.html"/>
+<entry name="balance() function" url="ch14lev1sec5.html"/>
+<entry name="beginTransaction() method" url="ch13lev1sec5.html"/>
+<entry name="binary packages, installing" url="ch01lev1sec5.html"/>
+<entry name="blockUserInput() method" url="ch13lev1sec5.html"/>
+<entry name="Book ID tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="BookInfo tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Bookmarks menu commands" url="ch06.html"/>
+<entry name="bounding boxes, drawing" url="ch04lev1sec2.html"/>
+<entry name="branches (CVS)" url="ch17lev1sec2.html"/>
+<entry name="Breakpoint page (KDevelop Output View" url="ch18.html"/>
+<entry name="Brown, Preston" url="ch13lev1sec2.html"/>
+<entry name="browsers, Classbrowser (KDevelop)" url="ch18lev1sec4.html"/>
+<entry name="browsers, simple browser application, ksimplebrowser.cpp class definition" url="ch10.html"/>
+<entry name="browsers, simple browser application, ksimplebrowser.h class declaration" url="ch10.html"/>
+<entry name="browsers, simple browser application, main() method" url="ch10.html"/>
+<entry name="calculateBlock function" url="ch14lev1sec2.html"/>
+<entry name="calculateBlock function" url="ch14lev1sec3.html"/>
+<entry name="callbacks" url="ch03lev1sec3.html"/>
+<entry name="call() method" url="ch13lev1sec5.html"/>
+<entry name="canDecode() function" url="ch07.html"/>
+<entry name="C/C++ Files window (KDevelop)" url="ch18.html"/>
+<entry name="CDE (Common Desktop Environment)" url="ch01.html"/>
+<entry name="cgi resource type" url="ch07lev1sec4.html"/>
+<entry name="CGotoDialog class, modeless dialog box" url="ch08lev1sec3.html"/>
+<entry name="CGotoDialog example, layout" url="ch08lev1sec2.html"/>
+<entry name="Chapter tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="checking out, applications (CVS)" url="ch17lev1sec5.html"/>
+<entry name="checking spelling" url="ch10lev1sec3.html"/>
+<entry name="checkList() method" url="ch10lev1sec3.html"/>
+<entry name="check() method" url="ch10lev1sec3.html"/>
+<entry name="checkWord() method" url="ch10lev1sec3.html"/>
+<entry name="Child Classes command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="child widgets, geometry management, QBoxLayout manager" url="ch04lev1sec3.html"/>
+<entry name="child widgets, geometry management, QGridLayout manager" url="ch04lev1sec3.html"/>
+<entry name="child widgets, geometry management" url="ch04lev1sec3.html"/>
+<entry name="child widgets, KChildren example, kchildren.cpp class definition" url="ch04lev1sec3.html"/>
+<entry name="child widgets, KChildren example, kchildren.h class declaration" url="ch04lev1sec3.html"/>
+<entry name="child widgets, KChildren example, main() method" url="ch04lev1sec3.html"/>
+<entry name="child widgets, KChildren example" url="ch04lev1sec3.html"/>
+<entry name="child widgets" url="ch04lev1sec3.html"/>
+<entry name="Classbrowser (KDevelop)" url="ch18lev1sec4.html"/>
+<entry name="class declarations, ***copy from declaring***" url="ch11lev1sec2.html"/>
+<entry name="class declarations" url="ch02lev1sec3.html"/>
+<entry name="class definitions, ***copy from defining***" url="ch11lev1sec2.html"/>
+<entry name="class definitions" url="ch02lev1sec4.html"/>
+<entry name="classes, CGotoDialog, modeless dialog box" url="ch08lev1sec3.html"/>
+<entry name="classes, documentation" url="ch02lev1sec5.html"/>
+<entry name="classes, documentation" url="ch15.html"/>
+<entry name="classes, KAction" url="ch05.html"/>
+<entry name="classes, KAction" url="ch06.html"/>
+<entry name="classes, KApplication" url="ch02lev1sec3.html"/>
+<entry name="classes, KAudioPlayer" url="ch14lev1sec6.html"/>
+<entry name="classes, KDE versus QT" url="ch03lev1sec2.html"/>
+<entry name="classes, KDialogBase" url="ch08lev1sec5.html"/>
+<entry name="classes, KEdit, Option dialog box" url="ch08lev1sec6.html"/>
+<entry name="classes, KNotifyClient" url="ch06lev1sec6.html"/>
+<entry name="classes, KNotify" url="ch13lev1sec7.html"/>
+<entry name="classes, KRun, opening files" url="ch06lev1sec7.html"/>
+<entry name="classes, KRun, running applications" url="ch06lev1sec7.html"/>
+<entry name="classes, KStdAction" url="ch05.html"/>
+<entry name="classes, KTMainWindow" url="ch02lev1sec3.html"/>
+<entry name="classes, KUniqueApplication, passing command-line parameters" url="ch13lev1sec7.html"/>
+<entry name="classes, KUniqueApplication, startup" url="ch13lev1sec7.html"/>
+<entry name="classes, KUniqueApplication" url="ch13lev1sec7.html"/>
+<entry name="classes, mainwindow" url="ch12lev1sec2.html"/>
+<entry name="classes, naming conventions" url="ch02lev1sec5.html"/>
+<entry name="classes, network transparency" url="ch06lev1sec8.html"/>
+<entry name="classes, part manager" url="ch12lev1sec2.html"/>
+<entry name="classes, part" url="ch12lev1sec2.html"/>
+<entry name="classes, plugin" url="ch12lev1sec2.html"/>
+<entry name="classes, QImage" url="ch10lev1sec2.html"/>
+<entry name="classes, QLayout, code example" url="ch08lev1sec2.html"/>
+<entry name="classes, QLayout, design issues" url="ch08lev1sec2.html"/>
+<entry name="classes, QLayout" url="ch08lev1sec2.html"/>
+<entry name="classes, QObject" url="ch03lev1sec2.html"/>
+<entry name="classes, QPainter, example usage (listing)" url="ch03lev1sec2.html"/>
+<entry name="classes, QPainter, functions" url="ch03lev1sec2.html"/>
+<entry name="classes, QPainter, methods" url="ch04lev1sec2.html"/>
+<entry name="classes, QPainter" url="ch03lev1sec2.html"/>
+<entry name="classes, QPainter" url="ch04lev1sec2.html"/>
+<entry name="classes, QPicture class, drawing commands, recording" url="ch04lev1sec2.html"/>
+<entry name="classes, QPixmap" url="ch10lev1sec2.html"/>
+<entry name="classes, QPushButton, functions" url="ch03lev1sec2.html"/>
+<entry name="classes, QPushButton, listing" url="ch03lev1sec2.html"/>
+<entry name="classes, QPushButton" url="ch03lev1sec2.html"/>
+<entry name="classes, QWidget, attributes" url="ch04.html"/>
+<entry name="classes, QWidget, documentation" url="ch04.html"/>
+<entry name="classes, QWidget, event handlers" url="ch04.html"/>
+<entry name="classes, QWidget, example (listing)" url="ch03lev1sec2.html"/>
+<entry name="classes, QWidget, functions" url="ch03lev1sec2.html"/>
+<entry name="classes, QWidget, sample class declaration" url="ch04.html"/>
+<entry name="classes, QWidget, signals" url="ch04.html"/>
+<entry name="classes, QWidget, slots" url="ch04.html"/>
+<entry name="classes, QWidget" url="ch03lev1sec2.html"/>
+<entry name="classes, QWidget" url="ch04.html"/>
+<entry name="classes, ReadOnlyPart" url="ch12lev1sec4.html"/>
+<entry name="classes, ReadWritePart" url="ch12lev1sec4.html"/>
+<entry name="classes, SelectDialog" url="ch08.html"/>
+<entry name="classes, slots in temporary classes" url="ch03lev1sec3.html"/>
+<entry name="classes, slots" url="ch03lev1sec3.html"/>
+<entry name="classes, template, QList" url="ch03lev1sec5.html"/>
+<entry name="classes, template" url="ch03lev1sec5.html"/>
+<entry name="classes, utility (Qt)" url="ch03lev1sec5.html"/>
+<entry name="Classparser (KDevelop)" url="ch18lev1sec4.html"/>
+<entry name="classses" url="ch09lev1sec2.html"/>
+<entry name="Classtool command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="Class Viewer (CV)" url="ch18.html"/>
+<entry name="clean target" url="ch16lev1sec2.html"/>
+<entry name="clients, dcop (DCOP shell client)" url="ch13lev1sec7.html"/>
+<entry name="clients, kdcop (DCOP shell client)" url="ch13lev1sec7.html"/>
+<entry name="closeEvent() event handler, widgets" url="ch04.html"/>
+<entry name="code, distribution, compressed archives" url="ch16lev1sec3.html"/>
+<entry name="code, distribution, informative text files" url="ch16lev1sec3.html"/>
+<entry name="code, distribution, software announcements" url="ch16lev1sec3.html"/>
+<entry name="code, distribution, uploads" url="ch16lev1sec3.html"/>
+<entry name="code, distribution" url="ch16lev1sec3.html"/>
+<entry name="code listings" url="ch04lev1sec3.html"/>
+<entry name="code, packages, administrative files" url="ch16lev1sec2.html"/>
+<entry name="code, packages, make targets" url="ch16lev1sec2.html"/>
+<entry name="code, packages, shared libraries" url="ch16lev1sec2.html"/>
+<entry name="code, packages, structure of" url="ch16.html"/>
+<entry name="code, packages, subdirectories" url="ch16lev1sec2.html"/>
+<entry name="code, packages, test results" url="ch16lev1sec2.html"/>
+<entry name="code, packages, top-level directories" url="ch16lev1sec2.html"/>
+<entry name="code, packages" url="ch16.html"/>
+<entry name="code" url="ch17lev1sec3.html"/>
+<entry name="color, icons, color depth" url="ch06lev1sec3.html"/>
+<entry name="commands, Bookmarks menu" url="ch06.html"/>
+<entry name="commands, Classbrowser pop-up menus, Add Folder" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Add Member Function" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Add Member Variable" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Child Classes" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Classtool" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Go to Declaration" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Graphical Classview" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, New Class" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, New File" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Options" url="ch18lev1sec4.html"/>
+<entry name="commands, Classbrowser pop-up menus, Parent Classes" url="ch18lev1sec4.html"/>
+<entry name="commands, cvs, add" url="ch17lev1sec5.html"/>
+<entry name="commands, cvs, commit" url="ch17lev1sec5.html"/>
+<entry name="commands, cvs, -l" url="ch17lev1sec5.html"/>
+<entry name="commands, cvs, remove" url="ch17lev1sec5.html"/>
+<entry name="commands, cvs, update" url="ch17lev1sec5.html"/>
+<entry name="commands, cvs" url="ch17lev1sec5.html"/>
+<entry name="commands, Edit menu" url="ch06.html"/>
+<entry name="commands, File menu" url="ch06.html"/>
+<entry name="commands, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="commands, Go menu" url="ch06.html"/>
+<entry name="commands, Help menu" url="ch06.html"/>
+<entry name="commands, Settings menu" url="ch06.html"/>
+<entry name="commands, Tools menu" url="ch06.html"/>
+<entry name="commands, View menu" url="ch06.html"/>
+<entry name="comments, KDOC-formatted comments" url="ch15.html"/>
+<entry name="commit option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="Common Desktop Environment (CDE)" url="ch01.html"/>
+<entry name="Common Object Request Broker Architecture (CORBA)" url="ch13lev1sec2.html"/>
+<entry name="compiler (IDL), invoking" url="ch14lev1sec3.html"/>
+<entry name="compilers, dcopidl" url="ch13lev1sec5.html"/>
+<entry name="compiling programs, example" url="ch02lev1sec2.html"/>
+<entry name="compiling programs, g++ compiler" url="ch02lev1sec2.html"/>
+<entry name="compiling programs, make utility" url="ch02lev1sec2.html"/>
+<entry name="compiling programs" url="ch02lev1sec2.html"/>
+<entry name="components" url="ch12.html"/>
+<entry name="compressed archives, creating" url="ch16lev1sec3.html"/>
+<entry name="computeSome() method" url="ch09lev1sec3.html"/>
+<entry name="Concurrent Versions System" url="ch17.html"/>
+<entry name="config.cache file" url="ch16lev1sec2.html"/>
+<entry name="config.h file" url="ch16lev1sec2.html"/>
+<entry name="config.log file" url="ch16lev1sec2.html"/>
+<entry name="config resource type" url="ch07lev1sec4.html"/>
+<entry name="config.status file" url="ch16lev1sec2.html"/>
+<entry name="configuration, applications, defined" url="ch06.html"/>
+<entry name="configuration files, accessing" url="ch07lev1sec2.html"/>
+<entry name="configuration files;accessing" url="ch07lev1sec2.html"/>
+<entry name="configuration files, example of" url="ch07lev1sec2.html"/>
+<entry name="configuration files" url="ch07lev1sec2.html"/>
+<entry name="configure file" url="ch16lev1sec2.html"/>
+<entry name="configure.in file" url="ch16lev1sec2.html"/>
+<entry name="configureToolbars action" url="ch06.html"/>
+<entry name="configuring, cvsup utility" url="ch17lev1sec4.html"/>
+<entry name="configuring, cvs utility" url="ch17lev1sec5.html"/>
+<entry name="configuring, directories, subdirectories" url="ch16lev1sec2.html"/>
+<entry name="configuring, directories, top-level directories" url="ch16lev1sec2.html"/>
+<entry name="configuring, spell-checking" url="ch10lev1sec3.html"/>
+<entry name="connectDCOPSignal() method" url="ch13lev1sec6.html"/>
+<entry name="connect() function" url="ch14lev1sec3.html"/>
+<entry name="connecting, objects" url="ch14lev1sec3.html"/>
+<entry name="contacts (address book), selecting" url="ch10lev1sec4.html"/>
+<entry name="content areas, Konqueror" url="ch05.html"/>
+<entry name="content areas, KOrganizer" url="ch05.html"/>
+<entry name="content areas, KWrite" url="ch05.html"/>
+<entry name="content areas" url="ch05.html"/>
+<entry name="copy action" url="ch06.html"/>
+<entry name="CORBA (Common Object Request Broker Architecture)" url="ch13lev1sec2.html"/>
+<entry name="counting, references" url="ch14lev1sec3.html"/>
+<entry name="createGUI() function" url="ch12lev1sec7.html"/>
+<entry name="C++, templates" url="ch03lev1sec5.html"/>
+<entry name="custom actions, KCustomActions widget, kcustomactions.cpp class definition" url="ch05.html"/>
+<entry name="custom actions, KCustomActions widget, kcustomactions.h class declaration" url="ch05.html"/>
+<entry name="custom actions, KCustomActions widget, kcustomactions.h class definition" url="ch05.html"/>
+<entry name="custom actions, KCustomActions widget, kcustomui.rc file" url="ch05.html"/>
+<entry name="custom actions, KCustomActions widget, main() function" url="ch05.html"/>
+<entry name="custom actions, KCustomActions widget, toolbars" url="ch05.html"/>
+<entry name="Cut action" url="ch06.html"/>
+<entry name="CV (Class Viewer)" url="ch18.html"/>
+<entry name="CVS, accounts" url="ch17lev1sec3.html"/>
+<entry name="CVS, applications, checking out" url="ch17lev1sec5.html"/>
+<entry name="CVS, branches" url="ch17lev1sec2.html"/>
+<entry name="CVS, changes, committing" url="ch17lev1sec5.html"/>
+<entry name="CVS, (Concurrent Versions System)" url="ch17.html"/>
+<entry name="CVS, cvsup utility, advantages" url="ch17lev1sec3.html"/>
+<entry name="CVS, cvsup utility, configuring" url="ch17lev1sec4.html"/>
+<entry name="CVS, cvs utility, command-line optoins" url="ch17lev1sec5.html"/>
+<entry name="CVS, cvs utility, commands" url="ch17lev1sec5.html"/>
+<entry name="CVS, cvs utility, configuring" url="ch17lev1sec5.html"/>
+<entry name="CVS, directories, adding" url="ch17lev1sec5.html"/>
+<entry name="CVS, directories, removing" url="ch17lev1sec5.html"/>
+<entry name="CVS, files, adding" url="ch17lev1sec5.html"/>
+<entry name="CVS, files, removing" url="ch17lev1sec5.html"/>
+<entry name="CVS, modules, checking out" url="ch17lev1sec5.html"/>
+<entry name="CVS, modules, listing" url="ch17lev1sec5.html"/>
+<entry name="CVS, modules, names" url="ch17lev1sec2.html"/>
+<entry name="CVS, modules, updating" url="ch17lev1sec5.html"/>
+<entry name="CVS, snapshots" url="ch17lev1sec3.html"/>
+<entry name="cvsup utility, advantages" url="ch17lev1sec3.html"/>
+<entry name="cvsup utility, configuring" url="ch17lev1sec4.html"/>
+<entry name="CVS" url="ch17.html"/>
+<entry name="cvs utility, commands, add" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, commands, commit" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, commands, -l" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, commands, remove" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, commands, update" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, commands" url="ch17lev1sec5.html"/>
+<entry name="cvs utility, configuring" url="ch17lev1sec5.html"/>
+<entry name="CVS, Web interface" url="ch17lev1sec3.html"/>
+<entry name="data resource type" url="ch07lev1sec4.html"/>
+<entry name="data streaming, reading devices" url="ch13lev1sec3.html"/>
+<entry name="data streaming" url="ch13lev1sec3.html"/>
+<entry name="data streaming, writing to devices" url="ch13lev1sec3.html"/>
+<entry name="data types (IDL)" url="ch14lev1sec3.html"/>
+<entry name="Date tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="DCOP, API tools, findObject() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, isApplicationRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, isRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, registeredApplications() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, remoteFunctions() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, remoteInterfaces() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, remoteObjects() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, senderId() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools, socket() method" url="ch13lev1sec6.html"/>
+<entry name="DCOP, API tools" url="ch13lev1sec6.html"/>
+<entry name="DCOP, architecture" url="ch13lev1sec4.html"/>
+<entry name="dcopc interface" url="ch13lev1sec7.html"/>
+<entry name="dcopClient() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, dcopc interface" url="ch13lev1sec7.html"/>
+<entry name="dcop (DCOP shell client)" url="ch13lev1sec7.html"/>
+<entry name="DCOP, dcop (shell client)" url="ch13lev1sec7.html"/>
+<entry name="DCOP, (Desktop Communication Protocol)" url="ch13.html"/>
+<entry name="DCOP, embedded K instances" url="ch13lev1sec6.html"/>
+<entry name="DCOP, embedded KPart instances" url="ch13lev1sec6.html"/>
+<entry name="DCOP, goals" url="ch13.html"/>
+<entry name="DCOP, history of" url="ch13lev1sec2.html"/>
+<entry name="dcopIDL" url="ch13lev1sec5.html"/>
+<entry name="DCOP, kdcop (shell client)" url="ch13lev1sec7.html"/>
+<entry name="DCOP, KNotify example" url="ch13lev1sec7.html"/>
+<entry name="DCOP, KUniqueApplication example, passing command-line parameters" url="ch13lev1sec7.html"/>
+<entry name="DCOP, KUniqueApplication example, startup" url="ch13lev1sec7.html"/>
+<entry name="DCOP, KUniqueApplication example" url="ch13lev1sec7.html"/>
+<entry name="DCOP, KXMLRPC interface" url="ch13lev1sec7.html"/>
+<entry name="DCOP, message redirection technology (referencing)" url="ch13lev1sec6.html"/>
+<entry name="DCOP, performance and overhead" url="ch13lev1sec6.html"/>
+<entry name="DCOP, programming interface, attach() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, call() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, dcopClient() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, dcopIDL" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, detach() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, makefile rules" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, process() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, registerAs() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, resume() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, send() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, suspend() method" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface, transactions" url="ch13lev1sec5.html"/>
+<entry name="DCOP, programming interface" url="ch13lev1sec5.html"/>
+<entry name="DCOPRef objects" url="ch13lev1sec6.html"/>
+<entry name="DCOP, signals and slots" url="ch13lev1sec6.html"/>
+<entry name="DCOP, underlying technologies, data streaming" url="ch13lev1sec3.html"/>
+<entry name="DCOP, underlying technologies, ICE (Inter-Client Exchange) mechanism" url="ch13lev1sec3.html"/>
+<entry name="DCOP, underlying technologies" url="ch13lev1sec3.html"/>
+<entry name="DCOP" url="ch13.html"/>
+<entry name="DCOP" url="ch13lev1sec5.html"/>
+<entry name="DCOP" url="ch13lev1sec7.html"/>
+<entry name="DDD debugger" url="ch02.html"/>
+<entry name="debuggers, gdb, options" url="ch18lev1sec6.html"/>
+<entry name="debuggers, gdb" url="ch18lev1sec6.html"/>
+<entry name="debuggers" url="ch02.html"/>
+<entry name="declaring, widget classes, kabdemo.h class declaration" url="ch10lev1sec4.html"/>
+<entry name="declaring, widget classes, KChildren example" url="ch04lev1sec3.html"/>
+<entry name="declaring widget classes, KConfigDemo widget" url="ch07lev1sec2.html"/>
+<entry name="declaring widget classes, KCustomActions widget" url="ch05.html"/>
+<entry name="declaring, widget classes, KDialogApp" url="ch11.html"/>
+<entry name="declaring, widget classes, KDisc example" url="ch04lev1sec4.html"/>
+<entry name="declaring widget classes, KDragDemo widget" url="ch07.html"/>
+<entry name="declaring widget classes, KDropDemo widget" url="ch07.html"/>
+<entry name="declaring widget classes, KHelpers" url="ch05lev1sec2.html"/>
+<entry name="declaring, widget classes, KImageView" url="ch10lev1sec2.html"/>
+<entry name="declaring, widget classes, KLongJob example" url="ch09lev1sec3.html"/>
+<entry name="declaring, widget classes, KPushButton example" url="ch04.html"/>
+<entry name="declaring, widget classes, KQuickDraw" url="ch09lev1sec2.html"/>
+<entry name="declaring widget classes, KRemoteDemo widget" url="ch07lev1sec5.html"/>
+<entry name="declaring widget classes, KResourceDemo widget" url="ch07lev1sec4.html"/>
+<entry name="declaring widget classes, KSaveAcross widget" url="ch07lev1sec3.html"/>
+<entry name="declaring, widget classes, KSimpleApp example" url="ch02lev1sec3.html"/>
+<entry name="declaring, widget classes, KSpellDemo" url="ch10lev1sec3.html"/>
+<entry name="declaring widget classes, KStatusBarDemo widget" url="ch05.html"/>
+<entry name="declaring widget classes, KStdActionsDemo widget" url="ch05.html"/>
+<entry name="declaring, widget classes, KTicTacToe example" url="ch04lev1sec3.html"/>
+<entry name="declaring, widget classes, KXOSquare example" url="ch04lev1sec2.html"/>
+<entry name="declaring, widget classes" url="ch11lev1sec2.html"/>
+<entry name="defiing, widget classes, KChildren example" url="ch04lev1sec3.html"/>
+<entry name="defining, streams" url="ch14lev1sec3.html"/>
+<entry name="defining, widget classes, KabDemo" url="ch10lev1sec4.html"/>
+<entry name="defining widget classes, KConfigDemo widget" url="ch07lev1sec2.html"/>
+<entry name="defining widget classes, KCustomActions widget" url="ch05.html"/>
+<entry name="defining, widget classes, KDialogApp" url="ch11.html"/>
+<entry name="defining, widget classes, KDisc example" url="ch04lev1sec4.html"/>
+<entry name="defining widget classes, KDragDemo widget" url="ch07.html"/>
+<entry name="defining widget classes, KDropDemo widget" url="ch07.html"/>
+<entry name="defining widget classes, KHelpers" url="ch05lev1sec2.html"/>
+<entry name="defining, widget classes, KImageView" url="ch10lev1sec2.html"/>
+<entry name="defining, widget classes, KQuickDraw" url="ch09lev1sec2.html"/>
+<entry name="defining widget classes, KRemoteDemo widget" url="ch07lev1sec5.html"/>
+<entry name="defining widget classes, KResourceDemo widget" url="ch07lev1sec4.html"/>
+<entry name="defining widget classes, KSaveAcross widget" url="ch07lev1sec3.html"/>
+<entry name="defining, widget classes, KSimpleApp example" url="ch02lev1sec4.html"/>
+<entry name="defining, widget classes, KSpellDemo" url="ch10lev1sec3.html"/>
+<entry name="defining widget classes, KStatusBarDemo widget" url="ch05.html"/>
+<entry name="defining widget classes, KStdActionsDemo widget" url="ch05.html"/>
+<entry name="defining, widget classes, KTicTacToe example" url="ch04lev1sec3.html"/>
+<entry name="defining, widget classes, kunique.h" url="ch11lev1sec2.html"/>
+<entry name="defining, widget classes, kweather.cpp" url="ch11lev1sec3.html"/>
+<entry name="defining, widget classes, kweather.h" url="ch11lev1sec3.html"/>
+<entry name="defining, widget classes, KXOSquare example" url="ch04lev1sec2.html"/>
+<entry name="defining, widget classes" url="ch11lev1sec2.html"/>
+<entry name="deleting, CVS (Concurrent Version System) directories" url="ch17lev1sec5.html"/>
+<entry name="deleting, CVS (Concurrent Version System) files" url="ch17lev1sec5.html"/>
+<entry name="deprecated (" url="ch15.html"/>
+<entry name="design guidelines, dialog boxes, layout issues" url="ch08lev1sec2.html"/>
+<entry name="design guidelines, dialog boxes" url="ch08lev1sec7.html"/>
+<entry name="designing, icons" url="ch06lev1sec3.html"/>
+<entry name="Desktop Communication Protocol. See DCOP" url="ch13.html"/>
+<entry name=".desktop files" url="ch07lev1sec4.html"/>
+<entry name="detach function" url="ch14lev1sec4.html"/>
+<entry name="detach() method" url="ch13lev1sec5.html"/>
+<entry name="development, documentation" url="ch18.html"/>
+<entry name="development history of, DCOP (Desktop Communication Protocol)" url="ch13lev1sec2.html"/>
+<entry name="development, languages" url="ch18.html"/>
+<entry name="development, project management" url="ch18.html"/>
+<entry name="diagnostic tools, gdb debugger, commands" url="ch18lev1sec6.html"/>
+<entry name="diagnostic tools, gdb debugger, enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="diagnostic tools, gdb debugger, options" url="ch18lev1sec6.html"/>
+<entry name="diagnostic tools, gdb debugger, running" url="ch18lev1sec6.html"/>
+<entry name="diagnostic tools, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="dialog-based application (KDialogApp), kdialogapp.cpp class declaration" url="ch11.html"/>
+<entry name="dialog-based application (KDialogApp), kdialogapp.h class definition" url="ch11.html"/>
+<entry name="dialog-based application (KDialogApp), main() method" url="ch11.html"/>
+<entry name="dialog-based application (KDialogApp)" url="ch11.html"/>
+<entry name="dialog boxes, design guidelines" url="ch08lev1sec7.html"/>
+<entry name="dialog boxes, dialog-based application (KDialogApp), kdialogapp.cpp class declaration" url="ch11.html"/>
+<entry name="dialog boxes, dialog-based application (KDialogApp), kdialogapp.h class definition" url="ch11.html"/>
+<entry name="dialog boxes, dialog-based application (KDialogApp), main() method" url="ch11.html"/>
+<entry name="dialog boxes, dialog-based application (KDialogApp)" url="ch11.html"/>
+<entry name="dialog boxes, kdeui (KDE user-interface library), manager widgets" url="ch08lev1sec4.html"/>
+<entry name="dialog boxes, kdeui (KDE user-interface library), read-to-use dialog boxes" url="ch08lev1sec4.html"/>
+<entry name="dialog boxes, kdeui (KDE user-interface library)" url="ch08lev1sec4.html"/>
+<entry name="dialog boxes, KDialogBase class" url="ch08lev1sec5.html"/>
+<entry name="dialog boxes, KEdit Option dialog example" url="ch08lev1sec6.html"/>
+<entry name="dialog boxes, KSpellConfig configuration dialog" url="ch10lev1sec3.html"/>
+<entry name="dialog boxes, layout, CGotoDialog example" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, design issues" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, hierarchies of layouts" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, manual placement" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, nested layouts" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, QLayout classes" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, layout, QVBox/QHBox widgets" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes, modal, advantages/disadvantages" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, modal, modal dialog allocated from the heap" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, modal, modal dialog located on the stack" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, modeless, advantages/disadvantages" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, modeless, CGotoDialog class example" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, modeless, removing from memory" url="ch08lev1sec3.html"/>
+<entry name="dialog boxes, simple example" url="ch08.html"/>
+<entry name="dialog boxes, standard dialog boxes, KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="dialog boxes, standard dialog boxes, KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="dialog boxes, standard dialog boxes, KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="dialog boxes, standard dialog boxes, sample application" url="ch05lev1sec3.html"/>
+<entry name="dialog boxes, standard dialog boxes" url="ch05lev1sec3.html"/>
+<entry name="dialog boxes" url="ch08.html"/>
+<entry name="dialog boxes" url="ch08lev1sec2.html"/>
+<entry name="dialog boxes" url="ch08lev1sec3.html"/>
+<entry name="Dialog Editor (KDevelop IDE), advantages" url="ch18.html"/>
+<entry name="Dialog Editor (KDevelop IDE)" url="ch18.html"/>
+<entry name="Dialog Editor (KDevelop IDE), weaknesses" url="ch18.html"/>
+<entry name="directories, CVS (Concurrent Version System), adding" url="ch17lev1sec5.html"/>
+<entry name="directories, CVS (Concurrent Version System), removing" url="ch17lev1sec5.html"/>
+<entry name="directories, subdirectories, configuring" url="ch16lev1sec2.html"/>
+<entry name="directories, top-level directories, configuring" url="ch16lev1sec2.html"/>
+<entry name="disableResize() method" url="ch08lev1sec2.html"/>
+<entry name="disabling, application functinos" url="ch09lev1sec3.html"/>
+<entry name="Disassemble page (KDevelop Output View" url="ch18.html"/>
+<entry name="disconnectDCOPSignal() method" url="ch13lev1sec6.html"/>
+<entry name="distclean target" url="ch16lev1sec2.html"/>
+<entry name="distribution, compressed archives" url="ch16lev1sec3.html"/>
+<entry name="distribution, informative text files" url="ch16lev1sec3.html"/>
+<entry name="distribution, packages" url="ch16lev1sec3.html"/>
+<entry name="distributions (KDE)" url="ch01lev1sec2.html"/>
+<entry name="distribution, software announcements" url="ch16lev1sec3.html"/>
+<entry name="distribution, uploads" url="ch16lev1sec3.html"/>
+<entry name="distribution" url="ch16lev1sec3.html"/>
+<entry name="DOC (Documentation Tree View)" url="ch18.html"/>
+<entry name="DOCTYPE tag (XML)" url="ch12lev1sec3.html"/>
+<entry name="documentation, accessing" url="ch18.html"/>
+<entry name="Documentation-Browser (KDevelop)" url="ch18lev1sec3.html"/>
+<entry name="Documentation-Browser window (KDevelop)" url="ch18.html"/>
+<entry name="documentation, DocBook tools, DocBook Web site" url="ch15lev1sec2.html"/>
+<entry name="documentation, DocBook tools, downloading" url="ch15lev1sec2.html"/>
+<entry name="documentation, DocBook tools, processing documentation" url="ch15lev1sec2.html"/>
+<entry name="documentation, DocBook tools, sample documentation" url="ch15lev1sec2.html"/>
+<entry name="documentation, DocBook tools, tags" url="ch15lev1sec2.html"/>
+<entry name="documentation, DocBook tools" url="ch15lev1sec2.html"/>
+<entry name="documentation, KDevelop IDE, API documentation" url="ch18lev1sec3.html"/>
+<entry name="documentation, KDevelop IDE, Documentation-Browser" url="ch18lev1sec3.html"/>
+<entry name="documentation, KDevelop IDE, online handbooks" url="ch18lev1sec3.html"/>
+<entry name="documentation, KDevelop IDE, searching" url="ch18lev1sec3.html"/>
+<entry name="documentation, KDevelop IDE" url="ch18lev1sec3.html"/>
+<entry name="documentation, KDOC, class documentation" url="ch15.html"/>
+<entry name="documentation, KDOC, comments" url="ch15.html"/>
+<entry name="documentation, KDOC, downloading" url="ch15.html"/>
+<entry name="documentation, KDOC, installing" url="ch15.html"/>
+<entry name="documentation, KDOC, library documentation" url="ch15.html"/>
+<entry name="documentation, KDOC, method documentation" url="ch15.html"/>
+<entry name="documentation, KDOC" url="ch15.html"/>
+<entry name="Documentation Tree View (DOC)" url="ch18.html"/>
+<entry name="documentation" url="ch02lev1sec5.html"/>
+<entry name="documentation" url="ch15.html"/>
+<entry name="documentation, widgets" url="ch04.html"/>
+<entry name="document-centric programs" url="ch02lev1sec3.html"/>
+<entry name="document-centric user interface, actions, custom actions" url="ch05.html"/>
+<entry name="document-centric user interface, actions, KAction class" url="ch05.html"/>
+<entry name="document-centric user interface, actions, standard actions" url="ch05.html"/>
+<entry name="document-centric user interface, actions" url="ch05.html"/>
+<entry name="document-centric user interface, content areas, Konqueror" url="ch05.html"/>
+<entry name="document-centric user interface, content areas, KOrganizer" url="ch05.html"/>
+<entry name="document-centric user interface, content areas, KWrite" url="ch05.html"/>
+<entry name="document-centric user interface, content areas" url="ch05.html"/>
+<entry name="document-centric user interface, menubars" url="ch05.html"/>
+<entry name="document-centric user interface, status bars, Konqueror status bar" url="ch05.html"/>
+<entry name="document-centric user interface, status bars, KWrite status bar" url="ch05.html"/>
+<entry name="document-centric user interface, status bars" url="ch05.html"/>
+<entry name="document-centric user interface, toolbars" url="ch05.html"/>
+<entry name="document-centric user interface" url="ch05.html"/>
+<entry name="document structure tags (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="double-buffering, advantages" url="ch09lev1sec2.html"/>
+<entry name="double-buffering, example of" url="ch09lev1sec2.html"/>
+<entry name="double-buffering, screen flicker" url="ch09lev1sec2.html"/>
+<entry name="double-buffering" url="ch09lev1sec2.html"/>
+<entry name="download() function" url="ch07lev1sec5.html"/>
+<entry name="downloading, DocBook tools" url="ch15lev1sec2.html"/>
+<entry name="downloading, KDOC" url="ch15.html"/>
+<entry name="drag and drop, responding to drop events" url="ch07.html"/>
+<entry name="drag and drop, starting a drag" url="ch07.html"/>
+<entry name="drag and drop" url="ch07.html"/>
+<entry name="drag and drop, XDND protocol" url="ch07.html"/>
+<entry name="DragCopy operations" url="ch07.html"/>
+<entry name="DragCopyOrMove operations" url="ch07.html"/>
+<entry name="DragDefault operations" url="ch07.html"/>
+<entry name="dragEnterEvent() event handler, widgets" url="ch04.html"/>
+<entry name="dragEnterEvent() function" url="ch07.html"/>
+<entry name="drag events, starting" url="ch07.html"/>
+<entry name="dragLeaveEvent() event handler, widgets" url="ch04.html"/>
+<entry name="dragMoveEvent() event handler, widgets" url="ch04.html"/>
+<entry name="DragMove operations" url="ch07.html"/>
+<entry name="drawEllipse() method" url="ch04lev1sec2.html"/>
+<entry name="drawing, bounding boxes" url="ch04lev1sec2.html"/>
+<entry name="drawing commands, recording, QPicture class" url="ch04lev1sec2.html"/>
+<entry name="drawing, ellipses" url="ch04lev1sec2.html"/>
+<entry name="drawing, lines" url="ch04lev1sec2.html"/>
+<entry name="drawLine() method" url="ch04lev1sec2.html"/>
+<entry name="drawRect() method" url="ch04lev1sec2.html"/>
+<entry name="dropEvent() event handler, widgets" url="ch04.html"/>
+<entry name="dropEvent() function" url="ch07.html"/>
+<entry name="drop events, responding to" url="ch07.html"/>
+<entry name="editBookmarks action" url="ch06.html"/>
+<entry name="editing, KEdit, session management code" url="ch06lev1sec2.html"/>
+<entry name="editing, projects" url="ch18lev1sec2.html"/>
+<entry name="editing, spell-checking (KSpell), configuring" url="ch10lev1sec3.html"/>
+<entry name="editing, spell-checking (KSpell), methods" url="ch10lev1sec3.html"/>
+<entry name="editing, spell-checking (KSpell), modal spell-checking" url="ch10lev1sec3.html"/>
+<entry name="editing, spell-checking (KSpell), sample application" url="ch10lev1sec3.html"/>
+<entry name="editing, spell-checking (KSpell)" url="ch10lev1sec3.html"/>
+<entry name="Edit menu commands" url="ch06.html"/>
+<entry name="editors, Dialog Editor (KDevelop), advantages" url="ch18.html"/>
+<entry name="editors, Dialog Editor (KDevelop)" url="ch18.html"/>
+<entry name="editors, Dialog Editor (KDevelop), weaknesses" url="ch18.html"/>
+<entry name="editors" url="ch02.html"/>
+<entry name="ellipses, drawing" url="ch04lev1sec2.html"/>
+<entry name="emacs editor" url="ch02.html"/>
+<entry name="email, mailing lists" url="ch01lev1sec3.html"/>
+<entry name="embedded KPart instances, DCOP (Desktop Communication Protocol)" url="ch13lev1sec6.html"/>
+<entry name="embedding, parts, mainwindow GUI" url="ch12lev1sec7.html"/>
+<entry name="embedding, parts, mainwindow header" url="ch12lev1sec7.html"/>
+<entry name="embedding, parts, mainwindow implementation" url="ch12lev1sec7.html"/>
+<entry name="embedding, parts, multiple parts" url="ch12lev1sec8.html"/>
+<entry name="embedding, parts" url="ch12lev1sec7.html"/>
+<entry name="emitDCOPSignal() method" url="ch13lev1sec6.html"/>
+<entry name="emitting signals" url="ch03lev1sec3.html"/>
+<entry name="Emphasis tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="enabling, application functions" url="ch09lev1sec3.html"/>
+<entry name="enabling, debugging, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="endTransaction() method" url="ch13lev1sec5.html"/>
+<entry name="enterEvent() event handler, widgets" url="ch04.html"/>
+<entry name="environment variables, KDEDIR" url="ch02lev1sec2.html"/>
+<entry name="environment variables, QTDIR" url="ch02lev1sec2.html"/>
+<entry name="error() function" url="ch05lev1sec3.html"/>
+<entry name="Ettrich, Matthias" url="ch01.html"/>
+<entry name="Ettrich, Matthias" url="ch13lev1sec2.html"/>
+<entry name="event() event handler, widgets" url="ch04.html"/>
+<entry name="event handling, drag events" url="ch07.html"/>
+<entry name="event handling, drop events" url="ch07.html"/>
+<entry name="event handling, Qt" url="ch03lev1sec2.html"/>
+<entry name="event handling, signals and slots" url="ch03lev1sec3.html"/>
+<entry name="event handling, widgets, closeEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, dragEnterEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, dragLeaveEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, dragMoveEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, dropEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, enterEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, event()" url="ch04.html"/>
+<entry name="event handling, widgets, focusInEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, focusOutEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, KDisc example" url="ch04lev1sec4.html"/>
+<entry name="event handling, widgets, keyPressEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, keyReleaseEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, keystrokes" url="ch04lev1sec4.html"/>
+<entry name="event handling, widgets, leaveEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, mouse clicks" url="ch04lev1sec4.html"/>
+<entry name="event handling, widgets, mouseDoubleClickEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, mouseMoveEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, mousePressEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, mouseReleaseEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, moveEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, paintEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, resizeEvent()" url="ch04.html"/>
+<entry name="event handling, widgets, showEvent()" url="ch04.html"/>
+<entry name="event handling, widgets" url="ch04.html"/>
+<entry name="event handling, widgets" url="ch04lev1sec4.html"/>
+<entry name="event handling, widgets, wheelEvent()" url="ch04.html"/>
+<entry name="Example_ADD module" url="ch14lev1sec2.html"/>
+<entry name="exception (" url="ch15.html"/>
+<entry name="exec() method, QDialog class" url="ch08lev1sec3.html"/>
+<entry name="exe resource type" url="ch07lev1sec4.html"/>
+<entry name="Exit command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="Extensible Markup Language" url="ch05.html"/>
+<entry name="factories, NotepadFactory, notepad_factory.cpp implementation" url="ch12lev1sec6.html"/>
+<entry name="factories, NotepadFactory, notepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="file dialog boxes, KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="file manager" url="ch01lev1sec2.html"/>
+<entry name="File menu commands" url="ch06.html"/>
+<entry name="filenames, network transparency" url="ch06lev1sec8.html"/>
+<entry name="files, administrative files, config.cache" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, config.h" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, config.log" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, config.status" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, configure.in" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, configure" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files, updating" url="ch16lev1sec2.html"/>
+<entry name="files, administrative files" url="ch16lev1sec2.html"/>
+<entry name="files, application configuration files, accessing" url="ch07lev1sec2.html"/>
+<entry name="files, application configuration files, example of" url="ch07lev1sec2.html"/>
+<entry name="files, application configuration files" url="ch07lev1sec2.html"/>
+<entry name="files, CVS (Concurrent Version System), adding" url="ch17lev1sec5.html"/>
+<entry name="files, CVS (Concurrent Version System), removing" url="ch17lev1sec5.html"/>
+<entry name="files, .desktop" url="ch07lev1sec4.html"/>
+<entry name="files, header, session management" url="ch06lev1sec2.html"/>
+<entry name="files, HTML files, rendering" url="ch10.html"/>
+<entry name="files, image formats" url="ch10lev1sec2.html"/>
+<entry name="files, Makefiles, example of" url="ch02lev1sec2.html"/>
+<entry name="files, makefiles, targets" url="ch16lev1sec2.html"/>
+<entry name="files, Makefiles" url="ch02lev1sec2.html"/>
+<entry name="files, .mcopclass files" url="ch14lev1sec2.html"/>
+<entry name="files, naming conventions" url="ch02lev1sec5.html"/>
+<entry name="files, opening, KRun class" url="ch06lev1sec7.html"/>
+<entry name="files, source, session management" url="ch06lev1sec2.html"/>
+<entry name="files, translation" url="ch06lev1sec4.html"/>
+<entry name="File Viewers (KDevelop), LFV (Logical File Viewer)" url="ch18.html"/>
+<entry name="File Viewers (KDevelop), LFV (Logical File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="File Viewers (KDevelop), RFV (Real File Viewer)" url="ch18.html"/>
+<entry name="File Viewers (KDevelop), RFV (Real File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="File Viewers (KDevelop)" url="ch18lev1sec5.html"/>
+<entry name="find action" url="ch06.html"/>
+<entry name="findNext action" url="ch06.html"/>
+<entry name="findObject() method" url="ch13lev1sec6.html"/>
+<entry name="findPrev action" url="ch06.html"/>
+<entry name="firstPage action" url="ch06.html"/>
+<entry name="fitToHeight action" url="ch06.html"/>
+<entry name="fitToPage action" url="ch06.html"/>
+<entry name="fitToWidth action" url="ch06.html"/>
+<entry name="flicker effect" url="ch09lev1sec2.html"/>
+<entry name="flushing graphics" url="ch03lev1sec2.html"/>
+<entry name="focusInEvent() event handler, widgets" url="ch04.html"/>
+<entry name="focusOutEvent() event handler, widgets" url="ch04.html"/>
+<entry name="font dialog boxes, KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="font dialog boxes, KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="formats, PNG, icons" url="ch06lev1sec3.html"/>
+<entry name="formatting tags (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="forward action" url="ch06.html"/>
+<entry name="Frame Stack page (KDevelop Output View" url="ch18.html"/>
+<entry name="FreeQt license" url="ch19lev1sec3.html"/>
+<entry name="Freshmeat Web site" url="ch16lev1sec3.html"/>
+<entry name="FTP, snapshots" url="ch17lev1sec3.html"/>
+<entry name="funcitons, main(), KHelpers widget" url="ch05lev1sec2.html"/>
+<entry name="functions, actionCollection" url="ch05.html"/>
+<entry name="functions, addAuthor()" url="ch05.html"/>
+<entry name="functions, addGlobalReference" url="ch14lev1sec3.html"/>
+<entry name="functions, add()" url="ch05lev1sec2.html"/>
+<entry name="functions, attach" url="ch14lev1sec4.html"/>
+<entry name="functions, balance()" url="ch14lev1sec5.html"/>
+<entry name="functions, calculateBlock" url="ch14lev1sec2.html"/>
+<entry name="functions, calculateBlock" url="ch14lev1sec3.html"/>
+<entry name="functions, canDecode()" url="ch07.html"/>
+<entry name="functions, connect()" url="ch14lev1sec3.html"/>
+<entry name="functions, cretaeGUI()" url="ch12lev1sec7.html"/>
+<entry name="functions, detach" url="ch14lev1sec4.html"/>
+<entry name="functions, download()" url="ch07lev1sec5.html"/>
+<entry name="functions, dragEnterEvent()" url="ch07.html"/>
+<entry name="functions, dropEvent()" url="ch07.html"/>
+<entry name="functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="functions, error()" url="ch05lev1sec3.html"/>
+<entry name="functions, getColor()" url="ch05lev1sec3.html"/>
+<entry name="functions, getExistingDirectory()" url="ch05lev1sec3.html"/>
+<entry name="functions, getFont()" url="ch05lev1sec3.html"/>
+<entry name="functions, getGlobalReference" url="ch14lev1sec3.html"/>
+<entry name="functions, getOpenFileName()" url="ch05lev1sec3.html"/>
+<entry name="functions, getSaveFileName()" url="ch05lev1sec3.html"/>
+<entry name="functions, helpMenu()" url="ch05lev1sec2.html"/>
+<entry name="functions, i18n(), KDE Translator's and Documenter's Web site" url="ch06lev1sec4.html"/>
+<entry name="functions, i18n(), syntax" url="ch06lev1sec4.html"/>
+<entry name="functions, i18n()" url="ch06lev1sec4.html"/>
+<entry name="functions, i18n()" url="ch07lev1sec4.html"/>
+<entry name="functions, information()" url="ch05lev1sec3.html"/>
+<entry name="functions, kingioRegister()" url="ch07lev1sec4.html"/>
+<entry name="functions, main(), KConfigDemo widget" url="ch07lev1sec2.html"/>
+<entry name="functions, main(), KCustomActions widget" url="ch05.html"/>
+<entry name="functions, main(), KDragDemo widget" url="ch07.html"/>
+<entry name="functions, main(), KDropDemo widget" url="ch07.html"/>
+<entry name="functions, main(), KRemoteDemo widget" url="ch07lev1sec5.html"/>
+<entry name="functions, main(), KSaveAcross widget" url="ch07lev1sec3.html"/>
+<entry name="functions, main(), KStatusBarDemo widget" url="ch05.html"/>
+<entry name="functions, main(), KStdActionsDemo widget" url="ch05.html"/>
+<entry name="functions, openFile()" url="ch12lev1sec5.html"/>
+<entry name="functions, openNew()" url="ch05.html"/>
+<entry name="functions, QGL widget" url="ch03lev1sec6.html"/>
+<entry name="functions, QList class" url="ch03lev1sec5.html"/>
+<entry name="functions, QPainter class" url="ch03lev1sec2.html"/>
+<entry name="functions, QPushButton class" url="ch03lev1sec2.html"/>
+<entry name="functions, queryClose()" url="ch07lev1sec3.html"/>
+<entry name="functions, QWidget class" url="ch03lev1sec2.html"/>
+<entry name="functions, readProperties()" url="ch07lev1sec3.html"/>
+<entry name="functions, removeGlobalReferences" url="ch14lev1sec3.html"/>
+<entry name="functions, run(), KRun class" url="ch06lev1sec7.html"/>
+<entry name="functions, saveFile()" url="ch12lev1sec5.html"/>
+<entry name="functions, saveProperties()" url="ch07lev1sec3.html"/>
+<entry name="functions, setAcceptDrops()" url="ch07.html"/>
+<entry name="functions, setExclusiveGroup()" url="ch05.html"/>
+<entry name="functions, setModified()" url="ch12lev1sec5.html"/>
+<entry name="functions, setReadWrite()" url="ch12lev1sec5.html"/>
+<entry name="functions, slotOpen()" url="ch07lev1sec5.html"/>
+<entry name="functions, slotSave()" url="ch07lev1sec5.html"/>
+<entry name="functions, slotSpecialHelp()" url="ch05lev1sec2.html"/>
+<entry name="functions, slots" url="ch03lev1sec3.html"/>
+<entry name="functions, sorry()" url="ch05lev1sec3.html"/>
+<entry name="functions, streamEnd()" url="ch14lev1sec3.html"/>
+<entry name="functions, streamInit()" url="ch14lev1sec3.html"/>
+<entry name="functions, streamStart()" url="ch14lev1sec3.html"/>
+<entry name="functions, upload()" url="ch07lev1sec5.html"/>
+<entry name="functions, warningContinueCancel()" url="ch05lev1sec3.html"/>
+<entry name="future technology, MCOP, composition/RAD" url="ch14lev1sec7.html"/>
+<entry name="future technology, MCOP, GUIs" url="ch14lev1sec7.html"/>
+<entry name="future technology, MCOP, media types" url="ch14lev1sec7.html"/>
+<entry name="future technology, MCOP, scripting" url="ch14lev1sec7.html"/>
+<entry name="future technology, MCOP" url="ch14lev1sec7.html"/>
+<entry name="g++ compiler" url="ch02lev1sec2.html"/>
+<entry name="gdb debugger, commands" url="ch18lev1sec6.html"/>
+<entry name="gdb debugger, enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="gdb debugger, options" url="ch18lev1sec6.html"/>
+<entry name="gdb debugger, running" url="ch18lev1sec6.html"/>
+<entry name="gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="gdb (GNU debugger)" url="ch02.html"/>
+<entry name="geometry management (widgets), dialog boxes, CGotoDialog example" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, design issues" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, hierarchies of layouts" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, manual placement" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, nested layouts" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, QLayout classes" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), dialog boxes, QVBox/QHBox widgets" url="ch08lev1sec2.html"/>
+<entry name="geometry management (widgets), QBoxLayout manager" url="ch04lev1sec3.html"/>
+<entry name="geometry management (widgets), QGridLayout manager" url="ch04lev1sec3.html"/>
+<entry name="geometry management (widgets)" url="ch04lev1sec3.html"/>
+<entry name="getColor() function" url="ch05lev1sec3.html"/>
+<entry name="getExistingDirectory() function" url="ch05lev1sec3.html"/>
+<entry name="getFont() function" url="ch05lev1sec3.html"/>
+<entry name="getGlobalReference function" url="ch14lev1sec3.html"/>
+<entry name="getOpenFileName() function" url="ch05lev1sec3.html"/>
+<entry name="getSaveFileName() function" url="ch05lev1sec3.html"/>
+<entry name="ghostviewtest.cpp file" url="ch12lev1sec7.html"/>
+<entry name="GhostViewTest, ghostviewtest.cpp" url="ch12lev1sec7.html"/>
+<entry name="GhostViewTest, ghostviewtest.h" url="ch12lev1sec7.html"/>
+<entry name="GhostViewTest, ghostviewtest_shell.rc" url="ch12lev1sec7.html"/>
+<entry name="ghostviewtest.h file" url="ch12lev1sec7.html"/>
+<entry name="ghostviewtest_shell.rc file" url="ch12lev1sec7.html"/>
+<entry name="GNU debugger (gdb)" url="ch02.html"/>
+<entry name="GNU Public License (GPL)" url="ch19lev1sec2.html"/>
+<entry name="GNU, xgettext utility" url="ch07lev1sec4.html"/>
+<entry name="Go menu commands" url="ch06.html"/>
+<entry name="goTo action" url="ch06.html"/>
+<entry name="Go to Declaration command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="gotoLine action" url="ch06.html"/>
+<entry name="gotoPage action" url="ch06.html"/>
+<entry name="GPL (GNU Public License)" url="ch19lev1sec2.html"/>
+<entry name="Granroth, Kurt" url="ch13lev1sec7.html"/>
+<entry name="Graphical Classview command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="graphical user interface" url="ch18.html"/>
+<entry name="graphics, flushing" url="ch03lev1sec2.html"/>
+<entry name="graphics, image view/converter application (KImageView), kimageview.cpp class declaration" url="ch10lev1sec2.html"/>
+<entry name="graphics, image view/converter application (KImageView), kimageview.h class definition" url="ch10lev1sec2.html"/>
+<entry name="graphics, image view/converter application (KImageView), main() method" url="ch10lev1sec2.html"/>
+<entry name="graphics, image view/converter application (KImageView)" url="ch10lev1sec2.html"/>
+<entry name="graphics, QImage class" url="ch10lev1sec2.html"/>
+<entry name="graphics, QPixmap class" url="ch10lev1sec2.html"/>
+<entry name="graphics, supported formats" url="ch10lev1sec2.html"/>
+<entry name="gt-2.1.0 package" url="ch01lev1sec5.html"/>
+<entry name="GUI (graphical user interface)" url="ch18.html"/>
+<entry name="GUIs, address book, contacts, selecting" url="ch10lev1sec4.html"/>
+<entry name="GUIs, address book" url="ch10lev1sec4.html"/>
+<entry name="GUIs, dialog boxes, design guidelines" url="ch08lev1sec7.html"/>
+<entry name="GUIs, dialog boxes, kdeui (KDE user-interface library)" url="ch08lev1sec4.html"/>
+<entry name="GUIs, dialog boxes, KDialogBase class" url="ch08lev1sec5.html"/>
+<entry name="GUIs, dialog boxes, KEdit Option dialog example" url="ch08lev1sec6.html"/>
+<entry name="GUIs, dialog boxes, layout" url="ch08lev1sec2.html"/>
+<entry name="GUIs, dialog boxes, modal" url="ch08lev1sec3.html"/>
+<entry name="GUIs, dialog boxes, modeless" url="ch08lev1sec3.html"/>
+<entry name="GUIs, dialog boxes, simple example" url="ch08.html"/>
+<entry name="GUIs, dialog boxes" url="ch08.html"/>
+<entry name="GUIs, document-centric interface, actions" url="ch05.html"/>
+<entry name="GUIs, document-centric interface, content areas" url="ch05.html"/>
+<entry name="GUIs, document-centric interface, menubars" url="ch05.html"/>
+<entry name="GUIs, document-centric interface, status bars" url="ch05.html"/>
+<entry name="GUIs, document-centric interface, toolbars" url="ch05.html"/>
+<entry name="GUIs, document-centric interface" url="ch05.html"/>
+<entry name="GUIs, drag and drop, responding to drop events" url="ch07.html"/>
+<entry name="GUIs, drag and drop, starting a drag" url="ch07.html"/>
+<entry name="GUIs, drag and drop" url="ch07.html"/>
+<entry name="GUIs, help, Tooltips" url="ch05lev1sec2.html"/>
+<entry name="GUIs, help" url="ch05lev1sec2.html"/>
+<entry name="GUIs, MCOP and" url="ch14lev1sec7.html"/>
+<entry name="GUIs, menubars, creating" url="ch02lev1sec4.html"/>
+<entry name="GUIs, responsiveness, importance of" url="ch09.html"/>
+<entry name="GUIs, responsiveness, long jobs, optimizing performance of" url="ch09lev1sec3.html"/>
+<entry name="GUIs, responsiveness" url="ch09.html"/>
+<entry name="GUIs, responsiveness, Window updates, double-buffering" url="ch09lev1sec2.html"/>
+<entry name="GUIs, standard dialog boxes, KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="GUIs, standard dialog boxes, KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="GUIs, standard dialog boxes, KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="GUIs, standard dialog boxes, sample application" url="ch05lev1sec3.html"/>
+<entry name="GUIs, standard dialog boxes" url="ch05lev1sec3.html"/>
+<entry name="GUIs, status limes" url="ch02lev1sec4.html"/>
+<entry name="GUIs, toolbars" url="ch02lev1sec4.html"/>
+<entry name="GUIs, UI compliance" url="ch05.html"/>
+<entry name="GUIs" url="ch07.html"/>
+<entry name="GUIs, widgets, attributes" url="ch04.html"/>
+<entry name="GUIs, widgets, child widgets" url="ch04lev1sec3.html"/>
+<entry name="GUIs, widgets, defined" url="ch04.html"/>
+<entry name="GUIs, widgets, dialog widgets" url="ch08.html"/>
+<entry name="GUIs, widgets, documentation" url="ch04.html"/>
+<entry name="GUIs, widgets, drawing commands, recording" url="ch04lev1sec2.html"/>
+<entry name="GUIs, widgets, event handlers" url="ch04.html"/>
+<entry name="GUIs, widgets, painting" url="ch04lev1sec2.html"/>
+<entry name="GUIs, widgets, sample class declaration" url="ch04.html"/>
+<entry name="GUIs, widgets, signals" url="ch04.html"/>
+<entry name="GUIs, widgets, slots" url="ch04.html"/>
+<entry name="GUIs, widgets" url="ch04.html"/>
+<entry name="GUIs, widgets, user input" url="ch04lev1sec4.html"/>
+<entry name="Hausmann, Simon" url="ch13lev1sec7.html"/>
+<entry name="header files, session management" url="ch06lev1sec2.html"/>
+<entry name="help action" url="ch06.html"/>
+<entry name="helpContents action" url="ch06.html"/>
+<entry name="Help menu commands" url="ch06.html"/>
+<entry name="helpMenu() function" url="ch05lev1sec2.html"/>
+<entry name="help, Tooltips" url="ch05lev1sec2.html"/>
+<entry name="help, ToolTips" url="ch05lev1sec2.html"/>
+<entry name="help" url="ch05lev1sec2.html"/>
+<entry name="Hemsley, Rik" url="ch13lev1sec7.html"/>
+<entry name="history of, DCOP (Desktop Communication Protocol)" url="ch13lev1sec2.html"/>
+<entry name="history of KDE/Qt licenses" url="ch19lev1sec4.html"/>
+<entry name="home action" url="ch06.html"/>
+<entry name="HTML files, rendering" url="ch10.html"/>
+<entry name="html resource type" url="ch07lev1sec4.html"/>
+<entry name="i18n() function, KDE Translator's and Documenter's Web site" url="ch06lev1sec4.html"/>
+<entry name="i18n() function, syntax" url="ch06lev1sec4.html"/>
+<entry name="i18n() function" url="ch06lev1sec4.html"/>
+<entry name="i18n() function" url="ch07lev1sec4.html"/>
+<entry name="ICE (Inter-Client Exchange) mechanism" url="ch13lev1sec3.html"/>
+<entry name="icon resource type" url="ch07lev1sec4.html"/>
+<entry name="icons, application, specifications" url="ch06lev1sec3.html"/>
+<entry name="icons, color depth" url="ch06lev1sec3.html"/>
+<entry name="icons, designing" url="ch06lev1sec3.html"/>
+<entry name="icons, names" url="ch06lev1sec3.html"/>
+<entry name="icons, PNG format" url="ch06lev1sec3.html"/>
+<entry name="icons, toolbar, specifications" url="ch06lev1sec3.html"/>
+<entry name="icons, type" url="ch06lev1sec3.html"/>
+<entry name="icons" url="ch06lev1sec3.html"/>
+<entry name="IDE (integrated development environment)" url="ch18.html"/>
+<entry name="IDL, attributes" url="ch14lev1sec3.html"/>
+<entry name="IDL, compiler, invoking" url="ch14lev1sec3.html"/>
+<entry name="IDL, data types" url="ch14lev1sec3.html"/>
+<entry name="IDL, #include statements" url="ch14lev1sec3.html"/>
+<entry name="IDL, (interface definition language)" url="ch14lev1sec3.html"/>
+<entry name="IDL, methods" url="ch14lev1sec3.html"/>
+<entry name="IDL, streams, defining" url="ch14lev1sec3.html"/>
+<entry name="IDL, structs" url="ch14lev1sec3.html"/>
+<entry name="IDL" url="ch14lev1sec3.html"/>
+<entry name="ImageIO" url="ch03lev1sec6.html"/>
+<entry name="images, image view/converter application (KImageView), kimageview.cpp class declaration" url="ch10lev1sec2.html"/>
+<entry name="images, image view/converter application (KImageView), kimageview.h class definition" url="ch10lev1sec2.html"/>
+<entry name="images, image view/converter application (KImageView), main() method" url="ch10lev1sec2.html"/>
+<entry name="images, image view/converter application (KImageView)" url="ch10lev1sec2.html"/>
+<entry name="images, QImage class" url="ch10lev1sec2.html"/>
+<entry name="images, QPixmap class" url="ch10lev1sec2.html"/>
+<entry name="images, suported formats" url="ch10lev1sec2.html"/>
+<entry name="image (" url="ch15.html"/>
+<entry name="#include statements" url="ch14lev1sec3.html"/>
+<entry name="information() function" url="ch05lev1sec3.html"/>
+<entry name="initializeGL() function (QGL widget)" url="ch03lev1sec6.html"/>
+<entry name="initializing, MCOP modules, attributes" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules, C++ constructor" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules, C++ destructor" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules, streamEnd() function" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules, streamInit() function" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules, streamStart() function" url="ch14lev1sec3.html"/>
+<entry name="initializing, MCOP modules" url="ch14lev1sec3.html"/>
+<entry name="initial object references" url="ch14lev1sec3.html"/>
+<entry name="in/out element (IDL)" url="ch14lev1sec3.html"/>
+<entry name="input (user), widgets, KDisc widget example" url="ch04lev1sec4.html"/>
+<entry name="input (user), widgets, keystrokes" url="ch04lev1sec4.html"/>
+<entry name="input (user), widgets, mouse clicks" url="ch04lev1sec4.html"/>
+<entry name="input (user), widgets" url="ch04lev1sec4.html"/>
+<entry name="installing, KDE, binary packages" url="ch01lev1sec5.html"/>
+<entry name="installing, KDE, source packages" url="ch01lev1sec5.html"/>
+<entry name="installing, KDE" url="ch01lev1sec5.html"/>
+<entry name="installing, KDOC" url="ch15.html"/>
+<entry name="install target" url="ch16lev1sec2.html"/>
+<entry name="integrated development environment (IDE)" url="ch18.html"/>
+<entry name="Inter-Client Exchange (ICE) mechanism" url="ch13lev1sec3.html"/>
+<entry name="interface definition language" url="ch14lev1sec3.html"/>
+<entry name="Interface Hall of Shame Web site" url="ch06lev1sec9.html"/>
+<entry name="Interface Hall of Shame Web site" url="ch08lev1sec7.html"/>
+<entry name="interfaces, applications, user friendliness" url="ch06lev1sec9.html"/>
+<entry name="interfaces, KMedia2" url="ch14lev1sec4.html"/>
+<entry name="interfaces, SimpleSoundServer" url="ch14lev1sec4.html"/>
+<entry name="interfaces, StereoEffectStack" url="ch14lev1sec4.html"/>
+<entry name="interface" url="ch18.html"/>
+<entry name="internal (" url="ch15.html"/>
+<entry name="internationalization" url="ch06lev1sec4.html"/>
+<entry name="internationalization" url="ch07lev1sec4.html"/>
+<entry name="invoking, IDL compiler" url="ch14lev1sec3.html"/>
+<entry name="invoking, paint events" url="ch04lev1sec2.html"/>
+<entry name="isApplicationRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="isRegistered() method" url="ch13lev1sec6.html"/>
+<entry name="ItemizedList tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Jansen, Geert" url="ch13lev1sec2.html"/>
+<entry name="jobs, long jobs, optimizing performance of, application functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="jobs, long jobs, optimizing performance of, processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="jobs, long jobs, optimizing performance of, QTimer class" url="ch09lev1sec3.html"/>
+<entry name="jobs, long jobs, optimizing performance of, speed issues" url="ch09lev1sec3.html"/>
+<entry name="jobs, long jobs, optimizing performance of" url="ch09lev1sec3.html"/>
+<entry name="KabDemo application (address book dialog), kabdemo.cpp class definition" url="ch10lev1sec4.html"/>
+<entry name="KabDemo application (address book dialog), kabdemo.h class declaration" url="ch10lev1sec4.html"/>
+<entry name="KabDemo application (address book dialog), main() method" url="ch10lev1sec4.html"/>
+<entry name="KabDemo application (address book dialog)" url="ch10lev1sec4.html"/>
+<entry name="kabdemo.cpp class definiiton (KabDemo)" url="ch10lev1sec4.html"/>
+<entry name="kabdemo.h class declaration (KabDemo)" url="ch10lev1sec4.html"/>
+<entry name="KAction class" url="ch05.html"/>
+<entry name="KAction class" url="ch06.html"/>
+<entry name="KApplication class" url="ch02lev1sec3.html"/>
+<entry name="KAudioPlayer class" url="ch14lev1sec6.html"/>
+<entry name="KButtonBox manager widget" url="ch08lev1sec4.html"/>
+<entry name="kchildren.cpp class definition (KChildren widget)" url="ch04lev1sec3.html"/>
+<entry name="kchildren.h class declaration (KChildren widget)" url="ch04lev1sec3.html"/>
+<entry name="KChildren sample widget (child widget), kchildren.cpp class definition" url="ch04lev1sec3.html"/>
+<entry name="KChildren sample widget (child widget), kchildren.h class declaration" url="ch04lev1sec3.html"/>
+<entry name="KChildren sample widget (child widget), main() method" url="ch04lev1sec3.html"/>
+<entry name="KChildren sample widget (child widget)" url="ch04lev1sec3.html"/>
+<entry name="kconfigdemo.cpp file (KConfigDemo widget)" url="ch07lev1sec2.html"/>
+<entry name="kconfigdemo.h file (KConfigDemo widget)" url="ch07lev1sec2.html"/>
+<entry name="KConfigDemo widget, kconfigdemo.cpp class definition" url="ch07lev1sec2.html"/>
+<entry name="KConfigDemo widget, kconfigdemo.h class declaration" url="ch07lev1sec2.html"/>
+<entry name="KConfigDemo widget, main() function" url="ch07lev1sec2.html"/>
+<entry name="kcustomactions.cpp file (KCustomActions widget)" url="ch05.html"/>
+<entry name="kcustomactions.h file (KCustomActions widget)" url="ch05.html"/>
+<entry name="KCustomActions widget, kcustomactions.cpp class definition" url="ch05.html"/>
+<entry name="KCustomActions widget, kcustomactions.h class declaration" url="ch05.html"/>
+<entry name="KCustomActions widget, kcustomactions.h class definition" url="ch05.html"/>
+<entry name="KCustomActions widget, kcustomui.rcp class file" url="ch05.html"/>
+<entry name="KCustomActions widget, main() function" url="ch05.html"/>
+<entry name="KCustomActions widget, toolbars" url="ch05.html"/>
+<entry name="kcustomui.rc file (KCustomActions widget)" url="ch05.html"/>
+<entry name="kdcop (DCOP shell client)" url="ch13lev1sec7.html"/>
+<entry name="kdeadmin module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdeadmin package" url="ch01lev1sec5.html"/>
+<entry name="KDE, advantages" url="ch01.html"/>
+<entry name="KDE, advantages" url="ch01lev1sec2.html"/>
+<entry name="kdebase module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdebase package" url="ch01lev1sec5.html"/>
+<entry name="kdebindings module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kde-common module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kde-devel mailing list" url="ch01lev1sec3.html"/>
+<entry name="KDE Developers' Web site" url="ch01lev1sec2.html"/>
+<entry name="KDEDIR environment variable" url="ch02lev1sec2.html"/>
+<entry name="$KDEDIR/share/appstext.txt (KResourceDemo widget)" url="ch07lev1sec4.html"/>
+<entry name="KDE, distributions" url="ch01lev1sec2.html"/>
+<entry name="kdegames module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdegames package" url="ch01lev1sec5.html"/>
+<entry name="kdegraphics module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdegraphics package" url="ch01lev1sec5.html"/>
+<entry name="kdei18n package" url="ch01lev1sec5.html"/>
+<entry name="kde-il8n module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KDE, installing, binary packages" url="ch01lev1sec5.html"/>
+<entry name="KDE, installing, source packages" url="ch01lev1sec5.html"/>
+<entry name="KDE, installing" url="ch01lev1sec5.html"/>
+<entry name="kdelibs module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdelibs package" url="ch01lev1sec5.html"/>
+<entry name="KDE, licenses" url="ch01lev1sec6.html"/>
+<entry name="KDE-MDI application template" url="ch18lev1sec2.html"/>
+<entry name="KDE Mini application template" url="ch18lev1sec2.html"/>
+<entry name="kdemultimedia module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdemultimedia package" url="ch01lev1sec5.html"/>
+<entry name="kdenetwork module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdenetwork package" url="ch01lev1sec5.html"/>
+<entry name="kdenonbeta module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KDE Normal application template" url="ch18lev1sec2.html"/>
+<entry name="KDE, obtaining" url="ch01lev1sec5.html"/>
+<entry name="KDE, online resources" url="ch01lev1sec3.html"/>
+<entry name="KDE, (overview of)" url="ch01.html"/>
+<entry name="KDE, Qt toolkit" url="ch03.html"/>
+<entry name="kdesdk module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdesupport module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdesupport package" url="ch01lev1sec5.html"/>
+<entry name="KDE, system requirements" url="ch01lev1sec4.html"/>
+<entry name="kdetoys module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KDE Translator's and Documenter's Web site" url="ch06lev1sec4.html"/>
+<entry name="kdeui (KDE user-interface library), dialog boxes" url="ch08lev1sec4.html"/>
+<entry name="kdeui (KDE user-interface library), manager widgets" url="ch08lev1sec4.html"/>
+<entry name="kdeui (KDE user-interface library" url="ch08lev1sec4.html"/>
+<entry name="KDE user-interface library" url="ch08lev1sec4.html"/>
+<entry name="kdeutils module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="kdeutils package" url="ch01lev1sec5.html"/>
+<entry name="KDevelop IDE, Classbrowser" url="ch18lev1sec4.html"/>
+<entry name="KDevelop IDE, Classparser" url="ch18lev1sec4.html"/>
+<entry name="KDevelop IDE, Dialog Editor, advantages" url="ch18.html"/>
+<entry name="KDevelop IDE, Dialog Editor" url="ch18.html"/>
+<entry name="KDevelop IDE, Dialog Editor, weaknesses" url="ch18.html"/>
+<entry name="KDevelop IDE, documentation, API documentation" url="ch18lev1sec3.html"/>
+<entry name="KDevelop IDE, documentation, Documentation-Browser" url="ch18lev1sec3.html"/>
+<entry name="KDevelop IDE, documentation, online handbooks" url="ch18lev1sec3.html"/>
+<entry name="KDevelop IDE, documentation, searching" url="ch18lev1sec3.html"/>
+<entry name="KDevelop IDE, documentation" url="ch18lev1sec3.html"/>
+<entry name="KDevelop IDE, File Viewers, LFV (Logical File Viewer)" url="ch18.html"/>
+<entry name="KDevelop IDE, File Viewers, LFV (Logical File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="KDevelop IDE, File Viewers, RFV (Real File Viewer)" url="ch18.html"/>
+<entry name="KDevelop IDE, File Viewers, RFV (Real File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="KDevelop IDE, File Viewers" url="ch18lev1sec5.html"/>
+<entry name="KDevelop IDE, gdb debugger, commands" url="ch18lev1sec6.html"/>
+<entry name="KDevelop IDE, gdb debugger, enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="KDevelop IDE, gdb debugger, options" url="ch18lev1sec6.html"/>
+<entry name="KDevelop IDE, gdb debugger, running" url="ch18lev1sec6.html"/>
+<entry name="KDevelop IDE, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="KDevelop IDE, KDE applications, creating, Application Wizard" url="ch18lev1sec2.html"/>
+<entry name="KDevelop IDE, KDE applications, creating, project editing" url="ch18lev1sec2.html"/>
+<entry name="KDevelop IDE, KDE applications, creating, templates" url="ch18lev1sec2.html"/>
+<entry name="KDevelop IDE, software development, documentation" url="ch18.html"/>
+<entry name="KDevelop IDE, software development, languages" url="ch18.html"/>
+<entry name="KDevelop IDE, software development, packages" url="ch18.html"/>
+<entry name="KDevelop IDE, software development, project management" url="ch18.html"/>
+<entry name="KDevelop IDE" url="ch18.html"/>
+<entry name="KDevelop IDE, versions, KDevelop 2.0" url="ch18.html"/>
+<entry name="KDevelop IDE, versions, KDevelop 2.0" url="ch18lev1sec7.html"/>
+<entry name="KDevelop IDE, versions" url="ch18.html"/>
+<entry name="KDevelop IDE, views, Output View" url="ch18.html"/>
+<entry name="KDevelop IDE, views, Tree View" url="ch18.html"/>
+<entry name="KDevelop IDE, working area" url="ch18.html"/>
+<entry name="kdevelop module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KDE Web site" url="ch01lev1sec3.html"/>
+<entry name="kdgb debugger" url="ch02.html"/>
+<entry name="kdialogapp.cpp file (KDialogApp)" url="ch11.html"/>
+<entry name="KDialogApp (dialog-based application), kdialogapp.cpp class definition" url="ch11.html"/>
+<entry name="KDialogApp (dialog-based application), kdialogapp.h class definition" url="ch11.html"/>
+<entry name="KDialogApp (dialog-based application), main() method" url="ch11.html"/>
+<entry name="KDialogApp, (dialog-based application)" url="ch11.html"/>
+<entry name="kdialogapp.h file (KDialogApp)" url="ch11.html"/>
+<entry name="KDialogApp, kdialogapp.cpp class declaration" url="ch11.html"/>
+<entry name="KDialogApp, kdialogapp.h class definition" url="ch11.html"/>
+<entry name="KDialogApp, main() method" url="ch11.html"/>
+<entry name="KDialogBase class" url="ch08lev1sec5.html"/>
+<entry name="KDialogBase manager widget" url="ch08lev1sec4.html"/>
+<entry name="KDialog manager widget" url="ch08lev1sec4.html"/>
+<entry name="KDisc widget (user input example), kdisc.cpp class definition" url="ch04lev1sec4.html"/>
+<entry name="KDisc widget (user input example), kdisc.h class declaration" url="ch04lev1sec4.html"/>
+<entry name="KDisc widget (user input example), main() method" url="ch04lev1sec4.html"/>
+<entry name="KDOC, class documentation" url="ch15.html"/>
+<entry name="KDOC, comments" url="ch15.html"/>
+<entry name="KDOC, downloading" url="ch15.html"/>
+<entry name="KDOC, installing" url="ch15.html"/>
+<entry name="KDOC, library documentation" url="ch15.html"/>
+<entry name="KDOC, method documentation" url="ch15.html"/>
+<entry name="kdocsample.h file" url="ch15.html"/>
+<entry name="kdragdemo.cpp file (KDragDemo widget)" url="ch07.html"/>
+<entry name="kdragdemo.h file (KDragDemo widget)" url="ch07.html"/>
+<entry name="KDragDemo widget, kdragdemo.cpp class declaration" url="ch07.html"/>
+<entry name="KDragDemo widget, kdragdemo.h class definition" url="ch07.html"/>
+<entry name="KDragDemo widget, main() function" url="ch07.html"/>
+<entry name="kdropdemo.cpp file (KDropDemo widget)" url="ch07.html"/>
+<entry name="kdropdemo.h file (KDropDemo widget)" url="ch07.html"/>
+<entry name="KDropDemo widget, kdropdemo.cpp class declaration" url="ch07.html"/>
+<entry name="KDropDemo widget, kdropdemo.h class definition" url="ch07.html"/>
+<entry name="KDropDemo widget, main() function" url="ch07.html"/>
+<entry name="KDropDemo widget" url="ch07.html"/>
+<entry name="KEdit, Option dialog box" url="ch08lev1sec6.html"/>
+<entry name="KEdit, session management code" url="ch06lev1sec2.html"/>
+<entry name="keyBindings action" url="ch06.html"/>
+<entry name="KeyCap tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="KeyCombo tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="keyPressEvent() event handler, widgets" url="ch04.html"/>
+<entry name="keyReleaseEvent() event handler, widgets" url="ch04.html"/>
+<entry name="keystrokes, handling, widgets" url="ch04lev1sec4.html"/>
+<entry name="KeyWordSet tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="keywords, moc" url="ch03lev1sec4.html"/>
+<entry name="Keyword tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="kfte editor" url="ch02.html"/>
+<entry name="kfte module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="khello program, compiling" url="ch02lev1sec2.html"/>
+<entry name="khelpers.cpp file (KHelpers widget)" url="ch05lev1sec2.html"/>
+<entry name="khelpers.h file (KHelpers widget)" url="ch05lev1sec2.html"/>
+<entry name="KHelpers widget, khelpers.cpp class definition" url="ch05lev1sec2.html"/>
+<entry name="KHelpers widget, khelpers.h class declaration" url="ch05lev1sec2.html"/>
+<entry name="KHelpers widget, main() function" url="ch05lev1sec2.html"/>
+<entry name="KHTMLWidget" url="ch10.html"/>
+<entry name="kimageview.cpp class declaration (KImageView widget)" url="ch10lev1sec2.html"/>
+<entry name="kimageview.h class definition (KImageView widget)" url="ch10lev1sec2.html"/>
+<entry name="KImageView widget (image viewer/converter), kimageview.cpp class declaration" url="ch10lev1sec2.html"/>
+<entry name="KImageView widget (image viewer/converter), kimageview.h class definition" url="ch10lev1sec2.html"/>
+<entry name="KImageView widget (image viewer/converter), main() method" url="ch10lev1sec2.html"/>
+<entry name="KImageView widget (image viewer/converter)" url="ch10lev1sec2.html"/>
+<entry name="kimgioRegister() function" url="ch07lev1sec4.html"/>
+<entry name="KIPC" url="ch13lev1sec2.html"/>
+<entry name="KJanusWidget manager widget" url="ch08lev1sec4.html"/>
+<entry name="klongjob.h class declaration (KLongJob widget), original version" url="ch09lev1sec3.html"/>
+<entry name="KLongJob widget (long job example), klongjob.h class declaration (original version)" url="ch09lev1sec3.html"/>
+<entry name="KLongJob widget (long job example), main() method" url="ch09lev1sec3.html"/>
+<entry name="klyx module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KMedia2 interface" url="ch14lev1sec4.html"/>
+<entry name="KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="kmusic module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KNotify API" url="ch14lev1sec6.html"/>
+<entry name="KNotify class" url="ch13lev1sec7.html"/>
+<entry name="KNotifyClient class" url="ch06lev1sec6.html"/>
+<entry name="koffice module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="Konqueror, content area" url="ch05.html"/>
+<entry name="Konqueror status bar" url="ch05.html"/>
+<entry name="Konqueror" url="ch01lev1sec2.html"/>
+<entry name="KOrganizer, content area" url="ch05.html"/>
+<entry name="korganizer module (CVS)" url="ch17lev1sec2.html"/>
+<entry name="KParts, compared to widgets" url="ch12.html"/>
+<entry name="KParts, embedded, DCOP (Desktop Communication Protocol)" url="ch13lev1sec6.html"/>
+<entry name="KParts, embedding, mainwindow GUI" url="ch12lev1sec7.html"/>
+<entry name="KParts, embedding, mainwindow header" url="ch12lev1sec7.html"/>
+<entry name="KParts, embedding, mainwindow implementation" url="ch12lev1sec7.html"/>
+<entry name="KParts, embedding, multiple parts" url="ch12lev1sec8.html"/>
+<entry name="KParts, embedding" url="ch12lev1sec7.html"/>
+<entry name="KParts, framework" url="ch12lev1sec2.html"/>
+<entry name="KParts, including in shared libraries, factory headers" url="ch12lev1sec6.html"/>
+<entry name="KParts, including in shared libraries, factory implementation" url="ch12lev1sec6.html"/>
+<entry name="KParts, including in shared libraries, makefiles" url="ch12lev1sec6.html"/>
+<entry name="KParts, including in shared libraries" url="ch12lev1sec6.html"/>
+<entry name="KParts, NotepadPart example, constructor" url="ch12lev1sec5.html"/>
+<entry name="KParts, NotepadPart example, Makefile.am" url="ch12lev1sec6.html"/>
+<entry name="KParts, NotepadPart example, notepad_factory.cpp implementatio" url="ch12lev1sec6.html"/>
+<entry name="KParts, NotepadPart example, notepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="KParts, NotepadPart example, notepad_part.h header" url="ch12lev1sec5.html"/>
+<entry name="KParts, NotepadPart example, openFile() function" url="ch12lev1sec5.html"/>
+<entry name="KParts, NotepadPart example, saveFile() function" url="ch12lev1sec5.html"/>
+<entry name="KParts, NotepadPart example, setReadWrite() function" url="ch12lev1sec5.html"/>
+<entry name="KParts, NotepadPart example" url="ch12lev1sec5.html"/>
+<entry name="KParts, PartManager" url="ch12lev1sec8.html"/>
+<entry name="KParts, plug-ins" url="ch12lev1sec9.html"/>
+<entry name="KParts, read-only parts" url="ch12lev1sec4.html"/>
+<entry name="KParts, read/write parts" url="ch12lev1sec4.html"/>
+<entry name="KParts" url="ch01lev1sec2.html"/>
+<entry name="KParts" url="ch12.html"/>
+<entry name="KParts, XML files" url="ch12lev1sec3.html"/>
+<entry name="kposquare.cpp class declaration (KXOSquare widget)" url="ch04lev1sec2.html"/>
+<entry name="kquickdraw.cpp class definition (KQuickDraw widget)" url="ch09lev1sec2.html"/>
+<entry name="kquickdraw.h class declaration (KQuickDraw widget)" url="ch09lev1sec2.html"/>
+<entry name="KQuickDraw widget, kquickdraw.cpp class definition" url="ch09lev1sec2.html"/>
+<entry name="KQuickDraw widget, kquickdraw.h class declaration" url="ch09lev1sec2.html"/>
+<entry name="KQuickDraw widget, main() method" url="ch09lev1sec2.html"/>
+<entry name="kremotedemo.cpp file (KRemoteDemo widget)" url="ch07lev1sec5.html"/>
+<entry name="kremotedemo.h file (KRemoteDemo widget)" url="ch07lev1sec5.html"/>
+<entry name="KRemoteDemo widget, kremotedemo.cpp class definition" url="ch07lev1sec5.html"/>
+<entry name="KRemoteDemo widget, kremotedemo.h class declaration" url="ch07lev1sec5.html"/>
+<entry name="KRemoteDemo widget, main() function" url="ch07lev1sec5.html"/>
+<entry name="kresourcedemo.cpp file (KResourceDemo widget)" url="ch07lev1sec4.html"/>
+<entry name="kresourcedemo.h file (KResourceDemo widget)" url="ch07lev1sec4.html"/>
+<entry name="KResourceDemo widget, $KDEDIR/share/appstext.txt contents" url="ch07lev1sec4.html"/>
+<entry name="KResourceDemo widget, kresourcedemo.cpp class definition" url="ch07lev1sec4.html"/>
+<entry name="KResourceDemo widget, kresourcedemo.h class declaration" url="ch07lev1sec4.html"/>
+<entry name="KResourceDemo widget, kresource.po translation template file" url="ch07lev1sec4.html"/>
+<entry name="kresource.po file (KResourceDemo widget)" url="ch07lev1sec4.html"/>
+<entry name="KRun class, opening files" url="ch06lev1sec7.html"/>
+<entry name="KRun class, running applications" url="ch06lev1sec7.html"/>
+<entry name="ksaveacross.cpp file (KSaveAcross widget)" url="ch07lev1sec3.html"/>
+<entry name="ksaveacross.h file (KSaveAcross widget)" url="ch07lev1sec3.html"/>
+<entry name="KSaveAcross widget, ksaveacross.cpp class definition" url="ch07lev1sec3.html"/>
+<entry name="KSaveAcross widget, ksaveacross.h class declaration" url="ch07lev1sec3.html"/>
+<entry name="KSaveAcross widget, main() function" url="ch07lev1sec3.html"/>
+<entry name="ksimpleapp-1.0.lsm listing" url="ch16lev1sec3.html"/>
+<entry name="ksimpleapp.cpp class definition (KSimpleApp program)" url="ch02lev1sec4.html"/>
+<entry name="ksimpleapp.docbook listing" url="ch15lev1sec2.html"/>
+<entry name="ksimpleapp.h class declaration (KSimpleApp program)" url="ch02lev1sec3.html"/>
+<entry name="KSimpleApp program, ksimpleapp.cpp class definition" url="ch02lev1sec4.html"/>
+<entry name="KSimpleApp program, ksimpleapp.h class declaration" url="ch02lev1sec3.html"/>
+<entry name="KSimpleApp program, main() method" url="ch02lev1sec3.html"/>
+<entry name="KSimpleApp program, menubar" url="ch02lev1sec4.html"/>
+<entry name="KSimpleApp program, status line" url="ch02lev1sec4.html"/>
+<entry name="KSimpleApp program, toolbar" url="ch02lev1sec4.html"/>
+<entry name="KSimpleBrowser application, ksimplebrowser.cpp class definition" url="ch10.html"/>
+<entry name="KSimpleBrowser application, ksimplebrowser.h class declaration" url="ch10.html"/>
+<entry name="KSimpleBrowser application, main() method" url="ch10.html"/>
+<entry name="ksimplebrowser.cpp class definition (simple browser application)" url="ch10.html"/>
+<entry name="ksimplebrowser.h class declaration (simple browser application)" url="ch10.html"/>
+<entry name="KSpellConfig configuration dialog box" url="ch10lev1sec3.html"/>
+<entry name="kspelldemo.cpp class declaration (KSpellDemo)" url="ch10lev1sec3.html"/>
+<entry name="kspelldemo.h class definition (KSpellDemo)" url="ch10lev1sec3.html"/>
+<entry name="KSpellDemo (spell-checking application), kspelldemo.cpp class declaration" url="ch10lev1sec3.html"/>
+<entry name="KSpellDemo (spell-checking application), kspelldemo.h class definition" url="ch10lev1sec3.html"/>
+<entry name="KSpellDemo (spell-checking application), main() method" url="ch10lev1sec3.html"/>
+<entry name="KSpell (spell-checking), configuring" url="ch10lev1sec3.html"/>
+<entry name="KSpell (spell-checking), methods" url="ch10lev1sec3.html"/>
+<entry name="KSpell (spell-checking), modal spell-checking" url="ch10lev1sec3.html"/>
+<entry name="KSpell (spell-checking), sample application" url="ch10lev1sec3.html"/>
+<entry name="KSpell (spell-checking)" url="ch10lev1sec3.html"/>
+<entry name="kstatusbardemo.cpp file, KStatusBarDemo widget" url="ch05.html"/>
+<entry name="kstatusbardemo.h file, KStatusBarDemo widget" url="ch05.html"/>
+<entry name="KStatusBarDemo widget, kstatusbardemo.cpp class definition" url="ch05.html"/>
+<entry name="KStatusBarDemo widget, kstatusbardemo.h class declaration" url="ch05.html"/>
+<entry name="KStatusBarDemo widget, main() function" url="ch05.html"/>
+<entry name="KStdAction class" url="ch05.html"/>
+<entry name="kstdactionsdemo.cpp file (KStdActionsDemo widget)" url="ch05.html"/>
+<entry name="kstdactionsdemo.h file (KStdActionsDemo widget)" url="ch05.html"/>
+<entry name="KStdActionsDemo widget, kstdactionsdemo.cpp class declaration" url="ch05.html"/>
+<entry name="KStdActionsDemo widget, kstdactionsdemo.h class definition" url="ch05.html"/>
+<entry name="KStdActionsDemo widget, ,main() function" url="ch05.html"/>
+<entry name="KStdActionsDemo widget" url="ch05.html"/>
+<entry name="ktictactoe.cpp class definition (KTicTacToe widget)" url="ch04lev1sec3.html"/>
+<entry name="ktictactoe.h class declaration (KTicTacToe widget)" url="ch04lev1sec3.html"/>
+<entry name="KTicTacToe widget (geometry management example), ktictactoe.cpp class definition" url="ch04lev1sec3.html"/>
+<entry name="KTicTacToe widget (geometry management example), ktictactoe.h class declaration" url="ch04lev1sec3.html"/>
+<entry name="KTicTacToe widget (geometry management example), playing the game" url="ch04lev1sec3.html"/>
+<entry name="KTMainWindow class" url="ch02lev1sec3.html"/>
+<entry name="Kulow, Stephen" url="ch16.html"/>
+<entry name="KUniqueApplication class, passing command-line parameters" url="ch13lev1sec7.html"/>
+<entry name="KUniqueApplication class, startup" url="ch13lev1sec7.html"/>
+<entry name="KUniqueApplication class" url="ch13lev1sec7.html"/>
+<entry name="KUniqueApplication, kunique.cpp call definition" url="ch11lev1sec2.html"/>
+<entry name="KUniqueApplication, kunique.h class definition" url="ch11lev1sec2.html"/>
+<entry name="KUniqueApplication, main() method" url="ch11lev1sec2.html"/>
+<entry name="kunique.cpp file" url="ch11lev1sec2.html"/>
+<entry name="kunique.h class definition" url="ch11lev1sec2.html"/>
+<entry name="KWeather applet, kweather.cpp class definition" url="ch11lev1sec3.html"/>
+<entry name="KWeather applet, kweather.h class definition" url="ch11lev1sec3.html"/>
+<entry name="KWeather applet, main() method" url="ch11lev1sec3.html"/>
+<entry name="KWeather applet" url="ch11lev1sec3.html"/>
+<entry name="kweather.cpp file" url="ch11lev1sec3.html"/>
+<entry name="kweather.h file" url="ch11lev1sec3.html"/>
+<entry name="KWrite, content area" url="ch05.html"/>
+<entry name="kwrite editor" url="ch02.html"/>
+<entry name="KWrite status bar" url="ch05.html"/>
+<entry name="KXMLRPC interface" url="ch13lev1sec7.html"/>
+<entry name="KXOSquare widget (painting example), code analysis" url="ch04lev1sec2.html"/>
+<entry name="KXOSquare widget (painting example), kxosquare.cpp class declaration" url="ch04lev1sec2.html"/>
+<entry name="KXOSquare widget (painting example), kxosquare.cpp class definition" url="ch04lev1sec2.html"/>
+<entry name="KXOSquare widget (painting example), main() method" url="ch04lev1sec2.html"/>
+<entry name="KXOSquare widget (painting example)" url="ch04lev1sec2.html"/>
+<entry name="languages, i18n() function, KDE Translator's and Documenter's Web site" url="ch06lev1sec4.html"/>
+<entry name="languages, i18n() function, syntax" url="ch06lev1sec4.html"/>
+<entry name="languages, i18n() function" url="ch06lev1sec4.html"/>
+<entry name="languages, translator files" url="ch06lev1sec4.html"/>
+<entry name="lastPage action" url="ch06.html"/>
+<entry name="layout, dialog boxes, CGotoDialog example" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, design guidelines" url="ch08lev1sec7.html"/>
+<entry name="layout, dialog boxes, design issues" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, hierarchies of layouts" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, manual placement" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, nested layouts" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, QLayout classes" url="ch08lev1sec2.html"/>
+<entry name="layout, dialog boxes, QVBox/QHBox widgets" url="ch08lev1sec2.html"/>
+<entry name="layout managers, creating internally, QVBox/QHBox widgets" url="ch08lev1sec2.html"/>
+<entry name="leaveEvent() event handler, widgets" url="ch04.html"/>
+<entry name="legal issues" url="ch01lev1sec6.html"/>
+<entry name="legal issues" url="ch19.html"/>
+<entry name="LFV (Logical File Viewer)" url="ch18.html"/>
+<entry name="LFV (Logical File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="LGPL (Library GNU Public License)" url="ch19lev1sec2.html"/>
+<entry name="libdoc (" url="ch15.html"/>
+<entry name="libkimgic library, supported image formats" url="ch10lev1sec2.html"/>
+<entry name="LibKMid" url="ch14lev1sec6.html"/>
+<entry name="libraries, documentation" url="ch15.html"/>
+<entry name="libraries, kdeui (KDE user-interface library), dialog boxes" url="ch08lev1sec4.html"/>
+<entry name="libraries, kdeui (KDE user-interface library), manager widgets" url="ch08lev1sec4.html"/>
+<entry name="libraries, kdeui (KDE user-interface library)" url="ch08lev1sec4.html"/>
+<entry name="libraries, libkimgic, supported image formats" url="ch10lev1sec2.html"/>
+<entry name="libraries, Mesa" url="ch03lev1sec6.html"/>
+<entry name="libraries, OpenGL" url="ch03lev1sec6.html"/>
+<entry name="libraries, parts, including, factory headers" url="ch12lev1sec6.html"/>
+<entry name="libraries, parts, including, factory implementation" url="ch12lev1sec6.html"/>
+<entry name="libraries, parts, including, makefiles" url="ch12lev1sec6.html"/>
+<entry name="libraries, parts, including" url="ch12lev1sec6.html"/>
+<entry name="libraries, Qt, supported image formats" url="ch10lev1sec2.html"/>
+<entry name="libraries, shared libraries, creating" url="ch16lev1sec2.html"/>
+<entry name="libraries" url="ch01lev1sec2.html"/>
+<entry name="Library GNU Public License (LGPL)" url="ch19lev1sec2.html"/>
+<entry name="lib resource type" url="ch07lev1sec4.html"/>
+<entry name="licenses, FreeQt" url="ch19lev1sec3.html"/>
+<entry name="licenses, GPL (GNU Public License)" url="ch19lev1sec2.html"/>
+<entry name="licenses, history of" url="ch19lev1sec4.html"/>
+<entry name="licenses, importance to projects" url="ch19.html"/>
+<entry name="licenses, LGPL (Library GNU Public License)" url="ch19lev1sec2.html"/>
+<entry name="licenses, online resources" url="ch19lev1sec5.html"/>
+<entry name="licenses, QPL (Q Public License)" url="ch19lev1sec3.html"/>
+<entry name="licenses" url="ch01lev1sec6.html"/>
+<entry name="licenses" url="ch19.html"/>
+<entry name="lines, drawing" url="ch04lev1sec2.html"/>
+<entry name="listing, CVS (Concurrent Version System) modules" url="ch17lev1sec5.html"/>
+<entry name="listings, application configuration file example" url="ch07lev1sec2.html"/>
+<entry name="listings, connecting slots to signals" url="ch03lev1sec3.html"/>
+<entry name="listings, DCOP, client using stub interface" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, DCOPClient call() method" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, DCOPClient send() method" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, DCOPClient send() method with QString data" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, dcopidl" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, DCOPRef usage" url="ch13lev1sec6.html"/>
+<entry name="listings, DCOP, DCOP within KPart" url="ch13lev1sec6.html"/>
+<entry name="listings, DCOP, DCOP within KPart" url="ch13lev1sec7.html"/>
+<entry name="listings, DCOP, handmade stub file" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, makefile rules" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, object that implements DCOP processing" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, processing with transactions" url="ch13lev1sec5.html"/>
+<entry name="listings, DCOP, typical application that uses DCOP" url="ch13lev1sec5.html"/>
+<entry name="listings, dcop" url="ch13lev1sec7.html"/>
+<entry name="listings, dialog boxes, CGotoDialog class example" url="ch08lev1sec2.html"/>
+<entry name="listings, dialog boxes, dialog from kdeui library" url="ch08lev1sec4.html"/>
+<entry name="listings, dialog boxes, KButtonBox in a dialog" url="ch08lev1sec4.html"/>
+<entry name="listings, dialog boxes, KEdit dialog code" url="ch08lev1sec6.html"/>
+<entry name="listings, dialog boxes, manual geometry strategy and QLayouts classes" url="ch08lev1sec2.html"/>
+<entry name="listings, dialog boxes, modal dialog allocated from the heap" url="ch08lev1sec3.html"/>
+<entry name="listings, dialog boxes, modal dialog located on the stack" url="ch08lev1sec3.html"/>
+<entry name="listings, dialog boxes, modeless dialog example" url="ch08lev1sec3.html"/>
+<entry name="listings, dialog boxes, modeless dialogs, removing from memory" url="ch08lev1sec3.html"/>
+<entry name="listings, dialog boxes, QVBox widget for geometry management" url="ch08lev1sec2.html"/>
+<entry name="listings, dialog boxes, SelectDialog class" url="ch08.html"/>
+<entry name="listings, Example_ADD interface" url="ch14lev1sec2.html"/>
+<entry name="listings, Example_ADD module" url="ch14lev1sec2.html"/>
+<entry name="listings, GhostViewTest, ghostviewtest.cpp" url="ch12lev1sec7.html"/>
+<entry name="listings, GhostViewTest, ghostviewtest.h" url="ch12lev1sec7.html"/>
+<entry name="listings, GhostViewTest, ghostviewtest_shell.rc" url="ch12lev1sec7.html"/>
+<entry name="listings, ImageIO sample program" url="ch03lev1sec6.html"/>
+<entry name="listings, KabDemo application (address book dialog), kabdemo.cpp class definition" url="ch10lev1sec4.html"/>
+<entry name="listings, KabDemo application (address book dialog), kabdemo.h class declaration" url="ch10lev1sec4.html"/>
+<entry name="listings, KabDemo application (address book dialog), main() method" url="ch10lev1sec4.html"/>
+<entry name="listings, KChildren widget, kchildren.cpp class definition" url="ch04lev1sec3.html"/>
+<entry name="listings, KChildren widget, kchildren.h class declaration" url="ch04lev1sec3.html"/>
+<entry name="listings, KChildren widget, main() method" url="ch04lev1sec3.html"/>
+<entry name="listings, KConfigDemo widget, kconfigdemo.cpp class definition" url="ch07lev1sec2.html"/>
+<entry name="listings, KConfigDemo widget, kconfigdemo.h class declaration" url="ch07lev1sec2.html"/>
+<entry name="listings, KConfigDemo widget, main() function" url="ch07lev1sec2.html"/>
+<entry name="listings, KCustomActions widget, kcustomactions.cpp class definition" url="ch05.html"/>
+<entry name="listings, KCustomActions widget, kcustomactions.h class declaration" url="ch05.html"/>
+<entry name="listings, KCustomActions widget, kcustomactions.h class definition" url="ch05.html"/>
+<entry name="listings, KCustomActions widget, kcustomui.rc file" url="ch05.html"/>
+<entry name="listings, KCustomActions widget, main() function" url="ch05.html"/>
+<entry name="listings, KDisc widget, ktictactoe.cpp class definition" url="ch04lev1sec4.html"/>
+<entry name="listings, KDisc widget, ktictactoe.h class declaration" url="ch04lev1sec4.html"/>
+<entry name="listings, KDisc widget, main() method" url="ch04lev1sec4.html"/>
+<entry name="listings, kdocsample.h" url="ch15.html"/>
+<entry name="listings, KDragDemo widget, kdragdemo.cpp class declaration" url="ch07.html"/>
+<entry name="listings, KDragDemo widget, kdragdemo.h class definition" url="ch07.html"/>
+<entry name="listings, KDragDemo widget, main() function" url="ch07.html"/>
+<entry name="listings, KDropDemo widget, kdropdemo.cpp" url="ch07.html"/>
+<entry name="listings, KDropDemo widget, kdropdemo.h" url="ch07.html"/>
+<entry name="listings, KDropDemo widget, main() function" url="ch07.html"/>
+<entry name="listings, khello program" url="ch02lev1sec2.html"/>
+<entry name="listings, KHelpers widget, khelpers.cpp class definition" url="ch05lev1sec2.html"/>
+<entry name="listings, KHelpers widget, khelpers.h class declaration" url="ch05lev1sec2.html"/>
+<entry name="listings, KHelpers widget, main() function" url="ch05lev1sec2.html"/>
+<entry name="listings, KImageView, kimageview.cpp class declaration" url="ch10lev1sec2.html"/>
+<entry name="listings, KImageView, kimageview.h class definition" url="ch10lev1sec2.html"/>
+<entry name="listings, KImageView, main() method" url="ch10lev1sec2.html"/>
+<entry name="listings, KLongJob widget (long job example), klongjob.h class declaration (original version)" url="ch09lev1sec3.html"/>
+<entry name="listings, KLongJob widget (long job example), main() method" url="ch09lev1sec3.html"/>
+<entry name="listings, KPushButton class declaration" url="ch04.html"/>
+<entry name="listings, KQuickDraw widget, kquickdraw.cpp class definition" url="ch09lev1sec2.html"/>
+<entry name="listings, KQuickDraw widget, kquickdraw.h class declaration" url="ch09lev1sec2.html"/>
+<entry name="listings, KQuickDraw widget, main() method" url="ch09lev1sec2.html"/>
+<entry name="listings, KRemoteDemo widget, kremotedemo.cpp class definition" url="ch07lev1sec5.html"/>
+<entry name="listings, KRemoteDemo widget, kremotedemo.h class declaration" url="ch07lev1sec5.html"/>
+<entry name="listings, KRemoteDemo widget, main() function" url="ch07lev1sec5.html"/>
+<entry name="listings, KResourceDemo widget, $KDEDIR/share/appstext.txt contents" url="ch07lev1sec4.html"/>
+<entry name="listings, KResourceDemo widget, kresourcedemo.cpp class definition" url="ch07lev1sec4.html"/>
+<entry name="listings, KResourceDemo widget, kresourcedemo.h class declaration" url="ch07lev1sec4.html"/>
+<entry name="listings, KResourceDemo widget, kresource.po translation template file" url="ch07lev1sec4.html"/>
+<entry name="listings, KRun class, opening files examples" url="ch06lev1sec7.html"/>
+<entry name="listings, KSaveAcross widget, ksaveacross.cpp class definition" url="ch07lev1sec3.html"/>
+<entry name="listings, KSaveAcross widget, ksaveacross.h class declaration" url="ch07lev1sec3.html"/>
+<entry name="listings, KSaveAcross widget, main() function" url="ch07lev1sec3.html"/>
+<entry name="listings, ksimpleapp-1.0.lsm" url="ch16lev1sec3.html"/>
+<entry name="listings, ksimpleapp.docbook" url="ch15lev1sec2.html"/>
+<entry name="listings, KSimpleApp program, ksimpleapp.cpp class definition" url="ch02lev1sec4.html"/>
+<entry name="listings, KSimpleApp program, ksimpleapp.h class declaration" url="ch02lev1sec3.html"/>
+<entry name="listings, KSimpleApp program, main() method" url="ch02lev1sec3.html"/>
+<entry name="listings, KSimpleBrowser, ksimplebrowser.cpp class definition" url="ch10.html"/>
+<entry name="listings, KSimpleBrowser, ksimplebrowser.h class declaration" url="ch10.html"/>
+<entry name="listings, KSimpleBrowser, main() method" url="ch10.html"/>
+<entry name="listings, KSpellDemo (spell-checking application), kspelldemo.cpp class declaration" url="ch10lev1sec3.html"/>
+<entry name="listings, KSpellDemo (spell-checking application), kspelldemo.h class definition" url="ch10lev1sec3.html"/>
+<entry name="listings, KSpellDemo (spell-checking application), main() method" url="ch10lev1sec3.html"/>
+<entry name="listings, KStandardDialogs main.cpp" url="ch05lev1sec3.html"/>
+<entry name="listings, KStatusBarDemo widget, kstatusbardemo.cpp class definition" url="ch05.html"/>
+<entry name="listings, KStatusBarDemo widget, kstatusbardemo.h class declaration" url="ch05.html"/>
+<entry name="listings, KStatusBarDemo widget, main() function" url="ch05.html"/>
+<entry name="listings, KStdActionsDemo widget, kstdactionsdemo.cpp class declaration" url="ch05.html"/>
+<entry name="listings, KStdActionsDemo widget, kstdactionsdemo.h class definition" url="ch05.html"/>
+<entry name="listings, KStdActionsDemo widget, main() function" url="ch05.html"/>
+<entry name="listings, KTicTacToe widget, ktictactoe.cpp class definition" url="ch04lev1sec3.html"/>
+<entry name="listings, KTicTacToe widget, ktictactoe.h class declaration" url="ch04lev1sec3.html"/>
+<entry name="listings, KUniqueApplication, kunique.cpp call definition" url="ch11lev1sec2.html"/>
+<entry name="listings, KUniqueApplication, kunique.h call definition" url="ch11lev1sec2.html"/>
+<entry name="listings, KUniqueApplication, main.cpp" url="ch11lev1sec2.html"/>
+<entry name="listings, KUniqueApplication, passing command-line parameters" url="ch13lev1sec7.html"/>
+<entry name="listings, KUniqueApplication, starting" url="ch13lev1sec7.html"/>
+<entry name="listings, KWeather applet, kweather.cpp class definition" url="ch11lev1sec3.html"/>
+<entry name="listings, KWeather applet, kweather.h class definition" url="ch11lev1sec3.html"/>
+<entry name="listings, KWeather applet, main() method" url="ch11lev1sec3.html"/>
+<entry name="listings, KXOSquare widget, kxosquare.cpp class declaration" url="ch04lev1sec2.html"/>
+<entry name="listings, KXOSquare widget, kxosquare.cpp class definition" url="ch04lev1sec2.html"/>
+<entry name="listings, KXOSquare widget, main() method" url="ch04lev1sec2.html"/>
+<entry name="listings, Makefile.am" url="ch16lev1sec2.html"/>
+<entry name="listings, Makefiles, example of" url="ch02lev1sec2.html"/>
+<entry name="listings, moc example" url="ch03lev1sec4.html"/>
+<entry name="listings, MyWindow class implementation" url="ch03lev1sec4.html"/>
+<entry name="listings, network transparency, complete example" url="ch06lev1sec8.html"/>
+<entry name="listings, network transparency, filenames" url="ch06lev1sec8.html"/>
+<entry name="listings, NotepadPart part, Makefile.am" url="ch12lev1sec6.html"/>
+<entry name="listings, NotepadPart part, notepad_factory.cpp factory implementation" url="ch12lev1sec6.html"/>
+<entry name="listings, NotepadPart part, notepad_factory.h factory header" url="ch12lev1sec6.html"/>
+<entry name="listings, NotepadPart part, notepad_part.cpp part 1 constructor" url="ch12lev1sec5.html"/>
+<entry name="listings, NotepadPart part, notepad_part.cpp part 2" url="ch12lev1sec5.html"/>
+<entry name="listings, NotepadPart part, notepad_part.cpp part 3" url="ch12lev1sec5.html"/>
+<entry name="listings, NotepadPart part, notepad_part.cpp part 4" url="ch12lev1sec5.html"/>
+<entry name="listings, NotepadPart part, notepad_part.h header" url="ch12lev1sec5.html"/>
+<entry name="listings, NotepadPart part, notepad_part.rc XML description" url="ch12lev1sec5.html"/>
+<entry name="listings, OpenGL program example" url="ch03lev1sec6.html"/>
+<entry name="listings, QList class example" url="ch03lev1sec5.html"/>
+<entry name="listings, QPainter class example usage" url="ch03lev1sec2.html"/>
+<entry name="listings, QPushButton class example usage" url="ch03lev1sec2.html"/>
+<entry name="listings, QWidget class example" url="ch03lev1sec2.html"/>
+<entry name="listings, reading from device with QDataStream" url="ch13lev1sec3.html"/>
+<entry name="listings, session management code, header file example" url="ch06lev1sec2.html"/>
+<entry name="listings, session management code, KEdit" url="ch06lev1sec2.html"/>
+<entry name="listings, session management code, main source code example" url="ch06lev1sec2.html"/>
+<entry name="listings, session management code, source file example" url="ch06lev1sec2.html"/>
+<entry name="listings, static run() functions" url="ch06lev1sec7.html"/>
+<entry name="listings, StereoBalanceControl, running on server" url="ch14lev1sec5.html"/>
+<entry name="listings, stereo beep, playing" url="ch14.html"/>
+<entry name="listings, template classes" url="ch03lev1sec5.html"/>
+<entry name="listings, writing through QDataStream" url="ch13lev1sec3.html"/>
+<entry name="ListItem tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="li (" url="ch15.html"/>
+<entry name="locale resource type" url="ch07lev1sec4.html"/>
+<entry name="Logical File Viewer (LFV)" url="ch18.html"/>
+<entry name="Logical File Viewer (LFV)" url="ch18lev1sec5.html"/>
+<entry name="long jobs, optimizing performance of, application functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="long jobs, optimizing performance of, processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="long jobs, optimizing performance of, QTimer class" url="ch09lev1sec3.html"/>
+<entry name="long jobs, optimizing performance of, speed issues" url="ch09lev1sec3.html"/>
+<entry name="long jobs, optimizing performance of" url="ch09lev1sec3.html"/>
+<entry name="l option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="mail action" url="ch06.html"/>
+<entry name="mailing lists" url="ch01lev1sec3.html"/>
+<entry name="main.cpp file (KstaqndardDialogs)" url="ch05lev1sec3.html"/>
+<entry name="main() function, KConfigDemo widget" url="ch07lev1sec2.html"/>
+<entry name="main() function, KCustomActions widget" url="ch05.html"/>
+<entry name="main() function, KDragDemo widget" url="ch07.html"/>
+<entry name="main() function, KDropDemo widget" url="ch07.html"/>
+<entry name="main() function, KHelpers widget" url="ch05lev1sec2.html"/>
+<entry name="main() function, KRemoteDemo widget" url="ch07lev1sec5.html"/>
+<entry name="main() function, KSaveAcross widget" url="ch07lev1sec3.html"/>
+<entry name="main() function, KStatusBarDemo widget" url="ch05.html"/>
+<entry name="main() method, KabDemo" url="ch10lev1sec4.html"/>
+<entry name="main() method, KChildren widget" url="ch04lev1sec3.html"/>
+<entry name="main() method, KDisc" url="ch04lev1sec4.html"/>
+<entry name="main() method, KImageView widget" url="ch10lev1sec2.html"/>
+<entry name="main() method, KLongJob widget" url="ch09lev1sec3.html"/>
+<entry name="main() method, KQuickDraw" url="ch09lev1sec2.html"/>
+<entry name="main() method, KSimpleApp" url="ch02lev1sec3.html"/>
+<entry name="main() method, KSimpleBrowser" url="ch10.html"/>
+<entry name="main() method, KSpellDemo" url="ch10lev1sec3.html"/>
+<entry name="main() method, KUniqueApplication" url="ch11lev1sec2.html"/>
+<entry name="main() method, KWeather applet" url="ch11lev1sec3.html"/>
+<entry name="main() method, KXOSquare widget" url="ch04lev1sec2.html"/>
+<entry name="maintainer-clean target" url="ch16lev1sec2.html"/>
+<entry name="mainwindow class" url="ch12lev1sec2.html"/>
+<entry name="Makefile.am file (NotepadPart)" url="ch12lev1sec6.html"/>
+<entry name="Makefile.am file" url="ch16lev1sec2.html"/>
+<entry name="makefiles, DCOP (Desktop Communication Protocol)" url="ch13lev1sec5.html"/>
+<entry name="Makefiles, example of" url="ch02lev1sec2.html"/>
+<entry name="makefiles, targets" url="ch16lev1sec2.html"/>
+<entry name="Makefiles" url="ch02lev1sec2.html"/>
+<entry name="make targets" url="ch16lev1sec2.html"/>
+<entry name="make utility" url="ch02lev1sec2.html"/>
+<entry name="manager widgets (kdeui)" url="ch08lev1sec4.html"/>
+<entry name="managing, sessions, header file example" url="ch06lev1sec2.html"/>
+<entry name="managing, sessions, KEdit" url="ch06lev1sec2.html"/>
+<entry name="managing, sessions, main source code example" url="ch06lev1sec2.html"/>
+<entry name="managing, sessions, source file example" url="ch06lev1sec2.html"/>
+<entry name="managing, sessions" url="ch06lev1sec2.html"/>
+<entry name="managing, sessions" url="ch07lev1sec3.html"/>
+<entry name="manual geometry strategy (dialog boxes)" url="ch08lev1sec2.html"/>
+<entry name="mcopclass files" url="ch14lev1sec2.html"/>
+<entry name="MCOP, future of, composition/RAD" url="ch14lev1sec7.html"/>
+<entry name="MCOP, future of, GUIs" url="ch14lev1sec7.html"/>
+<entry name="MCOP, future of, media types" url="ch14lev1sec7.html"/>
+<entry name="MCOP, future of, scripting" url="ch14lev1sec7.html"/>
+<entry name="MCOP, future of" url="ch14lev1sec7.html"/>
+<entry name="MCOP, IDL compiler, invoking" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, attributes" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, data types" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, #include statements" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, methods" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, stream definitions" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax, structs" url="ch14lev1sec3.html"/>
+<entry name="MCOP, IDL syntax" url="ch14lev1sec3.html"/>
+<entry name="mcopidl" url="ch14lev1sec2.html"/>
+<entry name="MCOP, initial object references" url="ch14lev1sec3.html"/>
+<entry name="MCOP, interfaces, KMedia2" url="ch14lev1sec4.html"/>
+<entry name="MCOP, interfaces, SimpleSoundServer" url="ch14lev1sec4.html"/>
+<entry name="MCOP, interfaces, StereoEffectStack" url="ch14lev1sec4.html"/>
+<entry name="MCOP, module initialization, attributes" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization, C++ constructor" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization, C++ destructor" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization, streamEnd() function" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization, streamInit() function" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization, streamStart() function" url="ch14lev1sec3.html"/>
+<entry name="MCOP, module initialization" url="ch14lev1sec3.html"/>
+<entry name="MCOP, modules, writing, Example_ADD module" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing, interface definitions" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing, interface implementation" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing, .mcopclass files" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing, mcopidl" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing, REGISTER_IMPLEMENTATION" url="ch14lev1sec2.html"/>
+<entry name="MCOP, modules, writing" url="ch14lev1sec2.html"/>
+<entry name="MCOP, object connections" url="ch14lev1sec3.html"/>
+<entry name="MCOP, reference counting" url="ch14lev1sec3.html"/>
+<entry name="MCOP, StereoBalanceControl sample program, balance() function" url="ch14lev1sec5.html"/>
+<entry name="MCOP, StereoBalanceControl sample program, IDL (interface definition language)" url="ch14lev1sec5.html"/>
+<entry name="MCOP, StereoBalanceControl sample program, makefile" url="ch14lev1sec5.html"/>
+<entry name="MCOP, StereoBalanceControl sample program, running on server" url="ch14lev1sec5.html"/>
+<entry name="MCOP, StereoBalanceControl sample program" url="ch14lev1sec5.html"/>
+<entry name="MCOP, stream access" url="ch14lev1sec3.html"/>
+<entry name="MCOP, synchronous versus asynchronous streams" url="ch14lev1sec3.html"/>
+<entry name="MCOP" url="ch14lev1sec3.html"/>
+<entry name="memory, modeless dialog boxes, removing from" url="ch08lev1sec3.html"/>
+<entry name="menubars, creating" url="ch02lev1sec4.html"/>
+<entry name="menubars" url="ch05.html"/>
+<entry name="MenuBar tag (XML)" url="ch05.html"/>
+<entry name="Menu tag (XML)" url="ch05.html"/>
+<entry name="Merge tag (XML)" url="ch12lev1sec3.html"/>
+<entry name="Mesa" url="ch03lev1sec6.html"/>
+<entry name="message redirection technology (referencing)" url="ch13lev1sec6.html"/>
+<entry name="Messages page (KDevelop Output View" url="ch18.html"/>
+<entry name="meta-information tags (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Meta Object Compiler, executing programs" url="ch03lev1sec4.html"/>
+<entry name="Meta Object Compiler, keywords" url="ch03lev1sec4.html"/>
+<entry name="Meta Object Compiler, main program file example" url="ch03lev1sec4.html"/>
+<entry name="Meta Object Compiler (moc)" url="ch03lev1sec2.html"/>
+<entry name="Meta Object Compiler" url="ch03lev1sec4.html"/>
+<entry name="methods, attach()" url="ch13lev1sec5.html"/>
+<entry name="methods, beginTransaction()" url="ch13lev1sec5.html"/>
+<entry name="methods, blockUserInput()" url="ch13lev1sec5.html"/>
+<entry name="methods, call()" url="ch13lev1sec5.html"/>
+<entry name="methods, checkList()" url="ch10lev1sec3.html"/>
+<entry name="methods, check()" url="ch10lev1sec3.html"/>
+<entry name="methods, checkWord()" url="ch10lev1sec3.html"/>
+<entry name="methods, computeSome()" url="ch09lev1sec3.html"/>
+<entry name="methods, connectDCOPSignal()" url="ch13lev1sec6.html"/>
+<entry name="methods, dcopClient()" url="ch13lev1sec5.html"/>
+<entry name="methods, detach()" url="ch13lev1sec5.html"/>
+<entry name="methods, disableResize()" url="ch08lev1sec2.html"/>
+<entry name="methods, disconnectDCOPSignal()" url="ch13lev1sec6.html"/>
+<entry name="methods, documentation" url="ch15.html"/>
+<entry name="methods, drawEllipse()" url="ch04lev1sec2.html"/>
+<entry name="methods, drawLine()" url="ch04lev1sec2.html"/>
+<entry name="methods, drawRect()" url="ch04lev1sec2.html"/>
+<entry name="methods, emitDCOPSignal()" url="ch13lev1sec6.html"/>
+<entry name="methods, endTransaction()" url="ch13lev1sec5.html"/>
+<entry name="methods, exec(), QDialog class" url="ch08lev1sec3.html"/>
+<entry name="methods, findObject()" url="ch13lev1sec6.html"/>
+<entry name="methods (IDL)" url="ch14lev1sec3.html"/>
+<entry name="methods, isApplicationRegistered()" url="ch13lev1sec6.html"/>
+<entry name="methods, isRegistered()" url="ch13lev1sec6.html"/>
+<entry name="methods, main(), KabDemo application" url="ch10lev1sec4.html"/>
+<entry name="methods, main(), KChildren widget" url="ch04lev1sec3.html"/>
+<entry name="methods, main(), KDialogApp" url="ch11.html"/>
+<entry name="methods, main(), KDisc" url="ch04lev1sec4.html"/>
+<entry name="methods, main(), KImageView widget" url="ch10lev1sec2.html"/>
+<entry name="methods, main(), KLongJob widget" url="ch09lev1sec3.html"/>
+<entry name="methods, main(), KQuickDraw" url="ch09lev1sec2.html"/>
+<entry name="methods, main(), KSimpleApp" url="ch02lev1sec3.html"/>
+<entry name="methods, main(), KSimpleBrowser" url="ch10.html"/>
+<entry name="methods, main(), KSpellDemo" url="ch10lev1sec3.html"/>
+<entry name="methods, main(), KUniqueApplication" url="ch11lev1sec2.html"/>
+<entry name="methods, main(), KWeather applet" url="ch11lev1sec3.html"/>
+<entry name="methods, main(), KXOSquare widget" url="ch04lev1sec2.html"/>
+<entry name="methods, modalCheck()" url="ch10lev1sec3.html"/>
+<entry name="methods, naming conventions" url="ch02lev1sec5.html"/>
+<entry name="methods, newInstance()" url="ch11lev1sec2.html"/>
+<entry name="methods, paintEvent()" url="ch04lev1sec2.html"/>
+<entry name="methods, paintEvent()" url="ch09lev1sec2.html"/>
+<entry name="methods, processEvents()" url="ch09lev1sec3.html"/>
+<entry name="methods, process()" url="ch13lev1sec5.html"/>
+<entry name="methods, registerAs()" url="ch13lev1sec5.html"/>
+<entry name="methods, registeredApplications()" url="ch13lev1sec6.html"/>
+<entry name="methods, remoteFunctions()" url="ch13lev1sec6.html"/>
+<entry name="methods, remoteInterfaces()" url="ch13lev1sec6.html"/>
+<entry name="methods, remoteObjects()" url="ch13lev1sec6.html"/>
+<entry name="methods, repaint(), QPainter class" url="ch04lev1sec2.html"/>
+<entry name="methods, resume()" url="ch13lev1sec5.html"/>
+<entry name="methods, senderId()" url="ch13lev1sec6.html"/>
+<entry name="methods, send()" url="ch13lev1sec5.html"/>
+<entry name="methods, setActiveWindow()" url="ch11lev1sec2.html"/>
+<entry name="methods, setButtonText()" url="ch08lev1sec5.html"/>
+<entry name="methods, setDefaultObject()" url="ch13lev1sec5.html"/>
+<entry name="methods, setMinimumSize()" url="ch11lev1sec3.html"/>
+<entry name="methods, setNotifications()" url="ch13lev1sec6.html"/>
+<entry name="methods, setPen()" url="ch04lev1sec2.html"/>
+<entry name="methods, setPlainCaption()" url="ch08lev1sec5.html"/>
+<entry name="methods, show()" url="ch02lev1sec3.html"/>
+<entry name="methodsslotSpellCheck()" url="ch10lev1sec3.html"/>
+<entry name="methods, socket()" url="ch13lev1sec6.html"/>
+<entry name="methods, startComputation()" url="ch09lev1sec3.html"/>
+<entry name="methods, statusBar()" url="ch02lev1sec4.html"/>
+<entry name="methods, stopComputation()" url="ch09lev1sec3.html"/>
+<entry name="methods, suspend()" url="ch13lev1sec5.html"/>
+<entry name="methods, toolBar()" url="ch02lev1sec4.html"/>
+<entry name="methods, update(), QPainter class" url="ch04lev1sec2.html"/>
+<entry name="methods, writeGlobalSettings()" url="ch10lev1sec3.html"/>
+<entry name="mian() function, KStdActionsDemo widget" url="ch05.html"/>
+<entry name="MIDI, LibKMid" url="ch14lev1sec6.html"/>
+<entry name="mime resource type" url="ch07lev1sec4.html"/>
+<entry name="Mini application template" url="ch18lev1sec2.html"/>
+<entry name="moc, executing programs" url="ch03lev1sec4.html"/>
+<entry name="moc, keywords" url="ch03lev1sec4.html"/>
+<entry name="moc, main program file example" url="ch03lev1sec4.html"/>
+<entry name="moc (Meta Object Compiler" url="ch03lev1sec2.html"/>
+<entry name="moc" url="ch03lev1sec4.html"/>
+<entry name="modalCheck() method" url="ch10lev1sec3.html"/>
+<entry name="modal dialog boxes, advantages/disadvantages" url="ch08lev1sec3.html"/>
+<entry name="modal dialog boxes, modal dialog allocated from the heap" url="ch08lev1sec3.html"/>
+<entry name="modal dialog boxes, modal dialog located on the stack" url="ch08lev1sec3.html"/>
+<entry name="modeless dialog boxes, advantages/disadvantages" url="ch08lev1sec3.html"/>
+<entry name="modeless dialog boxes, CGotoDialog class example" url="ch08lev1sec3.html"/>
+<entry name="modeless dialog boxes, removing from memory" url="ch08lev1sec3.html"/>
+<entry name="modules, CVS (Concurrent Version System), checking out" url="ch17lev1sec5.html"/>
+<entry name="modules, CVS (Concurrent Version System), listing" url="ch17lev1sec5.html"/>
+<entry name="modules, CVS (Concurrent Version System), names" url="ch17lev1sec2.html"/>
+<entry name="modules, CVS (Concurrent Version System), updating" url="ch17lev1sec5.html"/>
+<entry name="modules (MCOP), initializing, attributes" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing, C++ constructor" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing, C++ destructor" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing, streamEnd() function" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing, streamInit() function" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing, streamStart() function" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), initializing" url="ch14lev1sec3.html"/>
+<entry name="modules (MCOP), writing, Example_ADD module" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing, interface definitions" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing, interface implementation" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing, .mcopclass files" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing, mcopidl" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing, REGISTER_IMPLEMENTATION" url="ch14lev1sec2.html"/>
+<entry name="modules (MCOP), writing" url="ch14lev1sec2.html"/>
+<entry name="mouse clicks, handling, widgets" url="ch04lev1sec4.html"/>
+<entry name="mouseDoubleClickEvent() event handler, widgets" url="ch04.html"/>
+<entry name="mouse events" url="ch03lev1sec2.html"/>
+<entry name="mouseMoveEvent() event handler, widgets" url="ch04.html"/>
+<entry name="mousePressEvent() event handler, widgets" url="ch04.html"/>
+<entry name="mouseReleaseEvent() event handler, widgets" url="ch04.html"/>
+<entry name="moveEvent() event handler, widgets" url="ch04.html"/>
+<entry name="multi element (IDL)" url="ch14lev1sec3.html"/>
+<entry name="multimedia, aKtion" url="ch14lev1sec6.html"/>
+<entry name="multimedia, aRts (analog, real-time synthesis)" url="ch14.html"/>
+<entry name="multimedia, KAudioPlayer class" url="ch14lev1sec6.html"/>
+<entry name="multimedia, KNotify API" url="ch14lev1sec6.html"/>
+<entry name="multimedia, LibKMid" url="ch14lev1sec6.html"/>
+<entry name="multimedia, MCOP, future of" url="ch14lev1sec7.html"/>
+<entry name="multimedia, MCOP, IDL compiler" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, IDL syntax" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, initial object reference" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, interfaces" url="ch14lev1sec4.html"/>
+<entry name="multimedia, MCOP, module initialization" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, modules, writing" url="ch14lev1sec2.html"/>
+<entry name="multimedia, MCOP, object connections" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, reference counting" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, StereoBalanceControl sample program" url="ch14lev1sec5.html"/>
+<entry name="multimedia, MCOP, stream access" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP, synchronous versus asynchronous streams" url="ch14lev1sec3.html"/>
+<entry name="multimedia, MCOP" url="ch14lev1sec3.html"/>
+<entry name="multimedia, stero beeps, playing" url="ch14.html"/>
+<entry name="multimedia" url="ch06lev1sec5.html"/>
+<entry name="multimedia" url="ch14.html"/>
+<entry name="multiple parts, embedding" url="ch12lev1sec8.html"/>
+<entry name="music" url="ch14lev1sec6.html"/>
+<entry name="MyWindow class implementation" url="ch03lev1sec4.html"/>
+<entry name="names, files, network transparency" url="ch06lev1sec8.html"/>
+<entry name="names, icons" url="ch06lev1sec3.html"/>
+<entry name="naming conventions" url="ch02lev1sec5.html"/>
+<entry name="navigation, drag and drop, responding to drop events" url="ch07.html"/>
+<entry name="navigation, drag and drop, starting a drag" url="ch07.html"/>
+<entry name="navigation, drag and drop" url="ch07.html"/>
+<entry name="navigation, menubars, creating" url="ch02lev1sec4.html"/>
+<entry name="navigation, toolbars" url="ch02lev1sec4.html"/>
+<entry name="nested layouts (dialog boxes)" url="ch08lev1sec2.html"/>
+<entry name="network transparency, applications, classes" url="ch06lev1sec8.html"/>
+<entry name="network transparency, applications" url="ch06lev1sec8.html"/>
+<entry name="network transparency" url="ch01lev1sec2.html"/>
+<entry name="network transparency" url="ch07.html"/>
+<entry name="network transparency" url="ch07lev1sec5.html"/>
+<entry name="New Class command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="New File command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="newInstance() method" url="ch11lev1sec2.html"/>
+<entry name="next action" url="ch06.html"/>
+<entry name="Normal application template" url="ch18lev1sec2.html"/>
+<entry name="notepad_factory.cpp implementatio (NotepadFactory)" url="ch12lev1sec6.html"/>
+<entry name="notepad_factory.cpp implementation" url="ch12lev1sec6.html"/>
+<entry name="notepad_factory.h file (NotepadFactory)" url="ch12lev1sec6.html"/>
+<entry name="notepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="NotepadFactory, notepad_factory.cpp implementation" url="ch12lev1sec6.html"/>
+<entry name="NotepadFactory, notepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="notepad_part.cpp part 1 file" url="ch12lev1sec5.html"/>
+<entry name="notepad_part.cpp part 2 file" url="ch12lev1sec5.html"/>
+<entry name="notepad_part.cpp part 3 file" url="ch12lev1sec5.html"/>
+<entry name="notepad_part.cpp part 4 file" url="ch12lev1sec5.html"/>
+<entry name="notepad_part.h header file" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part, constructor" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part, Makefile.am" url="ch12lev1sec6.html"/>
+<entry name="NotepadPart partnotepad_factory.cpp implementatio" url="ch12lev1sec6.html"/>
+<entry name="NotepadPart partnotepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="NotepadPart part, notepad_part.h header" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part, openFile() function" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part, saveFile() function" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part, setReadWrite() function" url="ch12lev1sec5.html"/>
+<entry name="NotepadPart part" url="ch12lev1sec5.html"/>
+<entry name="notifications, user" url="ch06lev1sec6.html"/>
+<entry name="objects, connecting" url="ch14lev1sec3.html"/>
+<entry name="objects, DCOPRef" url="ch13lev1sec6.html"/>
+<entry name="objects, MCOP-aware, creating, Example_ADD module" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating, interface definitions" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating, interface implementation" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating, .mcopclass files" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating, mcopidl" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating, REGISTER_IMPLEMENTATION" url="ch14lev1sec2.html"/>
+<entry name="objects, MCOP-aware, creating" url="ch14lev1sec2.html"/>
+<entry name="objects, QDataStream" url="ch13lev1sec3.html"/>
+<entry name="objects, references, counting" url="ch14lev1sec3.html"/>
+<entry name="objects, references, initial object references" url="ch14lev1sec3.html"/>
+<entry name="obtaining, KDE" url="ch01lev1sec5.html"/>
+<entry name="online resources" url="ch01lev1sec3.html"/>
+<entry name="open action" url="ch06.html"/>
+<entry name="openFile() function" url="ch12lev1sec5.html"/>
+<entry name="OpenGL, creating programs" url="ch03lev1sec6.html"/>
+<entry name="OpenGL, sample program (listing)" url="ch03lev1sec6.html"/>
+<entry name="OpenGl" url="ch03lev1sec6.html"/>
+<entry name="opening, files, applications;KRun class" url="ch06lev1sec7.html"/>
+<entry name="openNew action" url="ch06.html"/>
+<entry name="openNew() function" url="ch05.html"/>
+<entry name="openRecent action" url="ch06.html"/>
+<entry name="optimizing performance, long jobs, application functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="optimizing performance, long jobs, processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="optimizing performance, long jobs, QTimer class" url="ch09lev1sec3.html"/>
+<entry name="optimizing performance, long jobs, speed issues" url="ch09lev1sec3.html"/>
+<entry name="optimizing performance, long jobs" url="ch09lev1sec3.html"/>
+<entry name="Option dialog box (KEdit)" url="ch08lev1sec6.html"/>
+<entry name="options, applications, defined" url="ch06.html"/>
+<entry name="Options command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="Output View (KDevelop IDE), Breakpoint page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE), Disassemble page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE), Frame Stack page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE), Messages page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE), Stderr page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE), Stdout page" url="ch18.html"/>
+<entry name="Output View (KDevelop IDE)" url="ch18.html"/>
+<entry name="packages, adminstrative files, config.cache" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, config.h" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, config.log" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, config.status" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, configure.in" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, configure" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files, updating" url="ch16lev1sec2.html"/>
+<entry name="packages, adminstrative files" url="ch16lev1sec2.html"/>
+<entry name="packages, creating" url="ch18.html"/>
+<entry name="packages, distribution, compressed archives" url="ch16lev1sec3.html"/>
+<entry name="packages, distribution, informative text files" url="ch16lev1sec3.html"/>
+<entry name="packages, distribution, software announcements" url="ch16lev1sec3.html"/>
+<entry name="packages, distribution, uploads" url="ch16lev1sec3.html"/>
+<entry name="packages, distribution" url="ch16lev1sec3.html"/>
+<entry name="packages, gt-2.1.0" url="ch01lev1sec5.html"/>
+<entry name="packages, installing, binary packages" url="ch01lev1sec5.html"/>
+<entry name="packages, installing, source packages" url="ch01lev1sec5.html"/>
+<entry name="packages, kdeadmin" url="ch01lev1sec5.html"/>
+<entry name="packages, kdebase" url="ch01lev1sec5.html"/>
+<entry name="packages, kdegames" url="ch01lev1sec5.html"/>
+<entry name="packages, kdegraphics" url="ch01lev1sec5.html"/>
+<entry name="packages, kdei18n" url="ch01lev1sec5.html"/>
+<entry name="packages, kdelibs" url="ch01lev1sec5.html"/>
+<entry name="packages, kdemultimedia" url="ch01lev1sec5.html"/>
+<entry name="packages, kdenetwork" url="ch01lev1sec5.html"/>
+<entry name="packages, kdesupport" url="ch01lev1sec5.html"/>
+<entry name="packages, kdeutils" url="ch01lev1sec5.html"/>
+<entry name="packages, make targets" url="ch16lev1sec2.html"/>
+<entry name="packages, shared libraries" url="ch16lev1sec2.html"/>
+<entry name="packages, structure of" url="ch16.html"/>
+<entry name="packages, subdirectories" url="ch16lev1sec2.html"/>
+<entry name="packages, test results" url="ch16lev1sec2.html"/>
+<entry name="packages, top-level directories" url="ch16lev1sec2.html"/>
+<entry name="packages" url="ch16.html"/>
+<entry name="paintEvent() event handler, widgets" url="ch04.html"/>
+<entry name="paintEvent() method" url="ch04lev1sec2.html"/>
+<entry name="paintEvent() method" url="ch09lev1sec2.html"/>
+<entry name="paintGL() function (QGL widget)" url="ch03lev1sec6.html"/>
+<entry name="painting, widgets, invoking paint events" url="ch04lev1sec2.html"/>
+<entry name="painting, widgets, KXOSquare example" url="ch04lev1sec2.html"/>
+<entry name="painting, widgets, paintEvent() method" url="ch04lev1sec2.html"/>
+<entry name="painting, widgets, repainting" url="ch04lev1sec2.html"/>
+<entry name="painting, widgets" url="ch04lev1sec2.html"/>
+<entry name="panel applet (KWeather), kweather.cpp class definition" url="ch11lev1sec3.html"/>
+<entry name="panel applet (KWeather), kweather.h class definition" url="ch11lev1sec3.html"/>
+<entry name="panel applet (KWeather), main() method" url="ch11lev1sec3.html"/>
+<entry name="panel applet (KWeather)" url="ch11lev1sec3.html"/>
+<entry name="parameters, signals and slots" url="ch03lev1sec3.html"/>
+<entry name="param (" url="ch15.html"/>
+<entry name="Para tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="Parent Classes command (Classbrowser pop-up menu)" url="ch18lev1sec4.html"/>
+<entry name="parsers, Classparser (KDevelop)" url="ch18lev1sec4.html"/>
+<entry name="part class" url="ch12lev1sec2.html"/>
+<entry name="part manager class" url="ch12lev1sec2.html"/>
+<entry name="PartManager" url="ch12lev1sec8.html"/>
+<entry name="parts, compared to widgets" url="ch12.html"/>
+<entry name="parts, embedding, mainwindow GUI" url="ch12lev1sec7.html"/>
+<entry name="parts, embedding, mainwindow header" url="ch12lev1sec7.html"/>
+<entry name="parts, embedding, mainwindow implementation" url="ch12lev1sec7.html"/>
+<entry name="parts, embedding, multiple parts" url="ch12lev1sec8.html"/>
+<entry name="parts, embedding" url="ch12lev1sec7.html"/>
+<entry name="parts, framework" url="ch12lev1sec2.html"/>
+<entry name="parts, including in shared libraries, factory headers" url="ch12lev1sec6.html"/>
+<entry name="parts, including in shared libraries, factory implementation" url="ch12lev1sec6.html"/>
+<entry name="parts, including in shared libraries, makefiles" url="ch12lev1sec6.html"/>
+<entry name="parts, including in shared libraries" url="ch12lev1sec6.html"/>
+<entry name="parts, NotepadPart example, constructor" url="ch12lev1sec5.html"/>
+<entry name="parts, NotepadPart example, Makefile.am" url="ch12lev1sec6.html"/>
+<entry name="parts, NotepadPart example, notepad_factory.cpp implementation" url="ch12lev1sec6.html"/>
+<entry name="parts, NotepadPart example, notepad_factory.h header" url="ch12lev1sec6.html"/>
+<entry name="parts, NotepadPart example, notepad_part.h header" url="ch12lev1sec5.html"/>
+<entry name="parts, NotepadPart example, openFile() function" url="ch12lev1sec5.html"/>
+<entry name="parts, NotepadPart example, saveFile() function" url="ch12lev1sec5.html"/>
+<entry name="parts, NotepadPart example, setReadWrite() function" url="ch12lev1sec5.html"/>
+<entry name="parts, NotepadPart example" url="ch12lev1sec5.html"/>
+<entry name="parts, PartManager" url="ch12lev1sec8.html"/>
+<entry name="parts, plug-ins" url="ch12lev1sec9.html"/>
+<entry name="parts, read-only parts" url="ch12lev1sec4.html"/>
+<entry name="parts, read/write parts" url="ch12lev1sec4.html"/>
+<entry name="parts" url="ch12.html"/>
+<entry name="parts, XML files" url="ch12lev1sec3.html"/>
+<entry name="paste action" url="ch06.html"/>
+<entry name="performance, DCOP (Desktop Communication Protocol)" url="ch13lev1sec6.html"/>
+<entry name="performance optimization, long jobs, application functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="performance optimization, long jobs, processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="performance optimization, long jobs, QTimer class" url="ch09lev1sec3.html"/>
+<entry name="performance optimization, long jobs, speed issues" url="ch09lev1sec3.html"/>
+<entry name="performance optimization, long jobs" url="ch09lev1sec3.html"/>
+<entry name="permissions" url="ch19lev1sec2.html"/>
+<entry name="pipes" url="ch13.html"/>
+<entry name="playing, sound" url="ch06lev1sec5.html"/>
+<entry name="playing, stero beeps" url="ch14.html"/>
+<entry name="plugin class" url="ch12lev1sec2.html"/>
+<entry name="plug-ins, KParts plug-ins" url="ch12lev1sec9.html"/>
+<entry name="PNG format, icons" url="ch06lev1sec3.html"/>
+<entry name="PNG format, (Portable Network Graphics)" url="ch06lev1sec3.html"/>
+<entry name="Portable Network Graphics format" url="ch06lev1sec3.html"/>
+<entry name="preferences action" url="ch06.html"/>
+<entry name="pre tags (KDOC)" url="ch15.html"/>
+<entry name="print action" url="ch06.html"/>
+<entry name="printPreview action" url="ch06.html"/>
+<entry name="prior action" url="ch06.html"/>
+<entry name="processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="processing, DocBook documentation" url="ch15lev1sec2.html"/>
+<entry name="process() method" url="ch13lev1sec5.html"/>
+<entry name="program listings" url="ch04lev1sec3.html"/>
+<entry name="programming conventions, class documentation" url="ch02lev1sec5.html"/>
+<entry name="programming conventions, naming conventions" url="ch02lev1sec5.html"/>
+<entry name="programming interface (DCOP), attach() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), call() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), dcopClient() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), dcopIDL" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), detach() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), makefile rules" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), process() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), registerAs() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), resume() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), send() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), suspend() method" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP), transactions" url="ch13lev1sec5.html"/>
+<entry name="programming interface (DCOP)" url="ch13lev1sec5.html"/>
+<entry name="programming, Qt toolkit" url="ch03.html"/>
+<entry name="programs, compiling, example" url="ch02lev1sec2.html"/>
+<entry name="programs, compiling, g++ compiler" url="ch02lev1sec2.html"/>
+<entry name="programs, compiling, make utility" url="ch02lev1sec2.html"/>
+<entry name="programs, compiling" url="ch02lev1sec2.html"/>
+<entry name="programs, debuggers" url="ch02.html"/>
+<entry name="programs, document-centric" url="ch02lev1sec3.html"/>
+<entry name="programs, GUI elements, creating/configuring" url="ch02lev1sec4.html"/>
+<entry name="programs, GUI elements, menubars" url="ch02lev1sec4.html"/>
+<entry name="programs, GUI elements, status lines" url="ch02lev1sec4.html"/>
+<entry name="programs, GUI elements, toolbars" url="ch02lev1sec4.html"/>
+<entry name="programs, programming conventions, class documentation" url="ch02lev1sec5.html"/>
+<entry name="programs, programming conventions, naming conventions" url="ch02lev1sec5.html"/>
+<entry name="programs, structure of, KApplication class" url="ch02lev1sec3.html"/>
+<entry name="programs, structure of, KTMainWindow class" url="ch02lev1sec3.html"/>
+<entry name="programs, structure of, main() method" url="ch02lev1sec3.html"/>
+<entry name="programs, structure of" url="ch02lev1sec3.html"/>
+<entry name="programs, text editors" url="ch02.html"/>
+<entry name="programs" url="ch02.html"/>
+<entry name="project management" url="ch18.html"/>
+<entry name="projects, editing" url="ch18lev1sec2.html"/>
+<entry name="protocols, DCOP, API tools" url="ch13lev1sec6.html"/>
+<entry name="protocols, DCOP, architecture" url="ch13lev1sec4.html"/>
+<entry name="protocols, DCOP, dcopc interface" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP, dcop (shell client)" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP;(Desktop Communication Protocol)" url="ch13.html"/>
+<entry name="protocols, DCOP, embedded KPart instances" url="ch13lev1sec6.html"/>
+<entry name="protocols, DCOP, goals" url="ch13.html"/>
+<entry name="protocols, DCOP, history of" url="ch13lev1sec2.html"/>
+<entry name="protocols, DCOP, kdcop (shell client)" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP, KNotify example" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP, KUniqueApplication example" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP, KXMLRPC interface" url="ch13lev1sec7.html"/>
+<entry name="protocols, DCOP, message redirection technology (referencing)" url="ch13lev1sec6.html"/>
+<entry name="protocols, DCOP, performance and overhead" url="ch13lev1sec6.html"/>
+<entry name="protocols, DCOP, programming interface" url="ch13lev1sec5.html"/>
+<entry name="protocols, DCOP, signals and slots" url="ch13lev1sec6.html"/>
+<entry name="protocols, DCOP, underlying technologies" url="ch13lev1sec3.html"/>
+<entry name="protocols, DCOP" url="ch13.html"/>
+<entry name="protocols, FTP, snapshots" url="ch17lev1sec3.html"/>
+<entry name="protocols, XDND" url="ch07.html"/>
+<entry name="QBoxLayout geometry manager" url="ch04lev1sec3.html"/>
+<entry name="QDataStream objects" url="ch13lev1sec3.html"/>
+<entry name="QGL widget" url="ch03lev1sec6.html"/>
+<entry name="QGridLayout geometry manager" url="ch04lev1sec3.html"/>
+<entry name="QHBox widget, layout managers, creating" url="ch08lev1sec2.html"/>
+<entry name="QImage class" url="ch10lev1sec2.html"/>
+<entry name="QLayout classes, code example" url="ch08lev1sec2.html"/>
+<entry name="QLayout classes, design issues" url="ch08lev1sec2.html"/>
+<entry name="QLayout classes" url="ch08lev1sec2.html"/>
+<entry name="Qlist class" url="ch03lev1sec5.html"/>
+<entry name="QObject class" url="ch03lev1sec2.html"/>
+<entry name="QPainter class, example usage (listing)" url="ch03lev1sec2.html"/>
+<entry name="QPainter class, member function" url="ch03lev1sec2.html"/>
+<entry name="QPainter class, methods, paintEvent()" url="ch04lev1sec2.html"/>
+<entry name="QPainter class, methods, repaint()" url="ch04lev1sec2.html"/>
+<entry name="QPainter class, methods, update()" url="ch04lev1sec2.html"/>
+<entry name="QPainter class" url="ch03lev1sec2.html"/>
+<entry name="QPainter class" url="ch04lev1sec2.html"/>
+<entry name="QPicture class, drawing commands, recording" url="ch04lev1sec2.html"/>
+<entry name="QPixmap class" url="ch10lev1sec2.html"/>
+<entry name="QPL (Q Public License)" url="ch19lev1sec3.html"/>
+<entry name="Q Public License (QPL)" url="ch19lev1sec3.html"/>
+<entry name="QPushButton class, listing" url="ch03lev1sec2.html"/>
+<entry name="QPushButton class, member functions" url="ch03lev1sec2.html"/>
+<entry name="QPushButton class" url="ch03lev1sec2.html"/>
+<entry name="QSplitter" url="ch05.html"/>
+<entry name="Qt, classes, QList" url="ch03lev1sec5.html"/>
+<entry name="QTDIR environment variable" url="ch02lev1sec2.html"/>
+<entry name="Qt, event handling" url="ch03lev1sec2.html"/>
+<entry name="Qt, ImageIO" url="ch03lev1sec6.html"/>
+<entry name="QTimer class" url="ch09lev1sec3.html"/>
+<entry name="Qt library, supported image formats" url="ch10lev1sec2.html"/>
+<entry name="Qt, license, FreeQt" url="ch19lev1sec3.html"/>
+<entry name="Qt, Mesa" url="ch03lev1sec6.html"/>
+<entry name="Qt, moc, executing programs" url="ch03lev1sec4.html"/>
+<entry name="Qt, moc, keywords" url="ch03lev1sec4.html"/>
+<entry name="Qt, moc, main program file example" url="ch03lev1sec4.html"/>
+<entry name="Qt, moc (Meta Object Compiler)" url="ch03lev1sec2.html"/>
+<entry name="Qt, moc" url="ch03lev1sec4.html"/>
+<entry name="Qt, OpenGL" url="ch03lev1sec6.html"/>
+<entry name="Qt, paremeters" url="ch03lev1sec3.html"/>
+<entry name="Qt, QObject class" url="ch03lev1sec2.html"/>
+<entry name="Qt, QPainter class, functions" url="ch03lev1sec2.html"/>
+<entry name="Qt, QPainter class" url="ch03lev1sec2.html"/>
+<entry name="Qt, QPushButton class, functions" url="ch03lev1sec2.html"/>
+<entry name="Qt, QPushButton class" url="ch03lev1sec2.html"/>
+<entry name="Qt, QWidget class, example (listing)" url="ch03lev1sec2.html"/>
+<entry name="Qt, QWidget class, member functions" url="ch03lev1sec2.html"/>
+<entry name="Qt, QWidget class" url="ch03lev1sec2.html"/>
+<entry name="Qt, signals, connecting to slots" url="ch03lev1sec3.html"/>
+<entry name="Qt, signals, emitting" url="ch03lev1sec3.html"/>
+<entry name="Qt, signals" url="ch03lev1sec3.html"/>
+<entry name="Qt, slots, connecting to signals" url="ch03lev1sec3.html"/>
+<entry name="Qt, slots, creating" url="ch03lev1sec3.html"/>
+<entry name="Qt, slots, parameters" url="ch03lev1sec3.html"/>
+<entry name="Qt, slots, temporary classes" url="ch03lev1sec3.html"/>
+<entry name="Qt, slots" url="ch03lev1sec3.html"/>
+<entry name="Qt, STL" url="ch03lev1sec5.html"/>
+<entry name="Qt tookit" url="ch03.html"/>
+<entry name="Qt toolkit, overview" url="ch03lev1sec2.html"/>
+<entry name="Qt, utility classes" url="ch03lev1sec5.html"/>
+<entry name="queryClose() function" url="ch07lev1sec3.html"/>
+<entry name="quit action" url="ch06.html"/>
+<entry name="QVBox widget, layout managers, creating" url="ch08lev1sec2.html"/>
+<entry name="QWidget class, attributes" url="ch04.html"/>
+<entry name="QWidget class, documentation" url="ch04.html"/>
+<entry name="QWidget class, event handlers, closeEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, dragEnterEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, dragLeaveEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, dragMoveEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, dropEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, enterEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, event()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, focusInEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, focusOutEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, keyPressEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, keyReleaseEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, leaveEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, mouseDoubleClickEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, mouseMoveEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, mousePressEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, mouseReleaseEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, moveEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, paintEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, resizeEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers, showEvent()" url="ch04.html"/>
+<entry name="QWidget class, event handlers" url="ch04.html"/>
+<entry name="QWidget class, event handlers, wheelEvent()" url="ch04.html"/>
+<entry name="QWidget class, sample class declaration" url="ch04.html"/>
+<entry name="QWidget class, signals" url="ch04.html"/>
+<entry name="QWidget class, slots" url="ch04.html"/>
+<entry name="QWidget class" url="ch03lev1sec2.html"/>
+<entry name="QWidget class" url="ch04.html"/>
+<entry name="raises (" url="ch15.html"/>
+<entry name="reading, devices, QDataStream" url="ch13lev1sec3.html"/>
+<entry name="ReadOnlyPart class" url="ch12lev1sec4.html"/>
+<entry name="read-only parts" url="ch12lev1sec4.html"/>
+<entry name="readProperties() function" url="ch07lev1sec3.html"/>
+<entry name="ReadWritePart class" url="ch12lev1sec4.html"/>
+<entry name="read/write parts" url="ch12lev1sec4.html"/>
+<entry name="Real File Viewer (RFV)" url="ch18.html"/>
+<entry name="Real File Viewer (RFV)" url="ch18lev1sec5.html"/>
+<entry name="recording, drawing commands, QPicture class" url="ch04lev1sec2.html"/>
+<entry name="redisplay action" url="ch06.html"/>
+<entry name="redo action" url="ch06.html"/>
+<entry name="references, counting" url="ch14lev1sec3.html"/>
+<entry name="references, initial object references" url="ch14lev1sec3.html"/>
+<entry name="referencing (message redirection technology)" url="ch13lev1sec6.html"/>
+<entry name="ref (" url="ch15.html"/>
+<entry name="registerAs() method" url="ch13lev1sec5.html"/>
+<entry name="registeredApplications() method" url="ch13lev1sec6.html"/>
+<entry name="REGISTER_IMPLEMENTATION" url="ch14lev1sec2.html"/>
+<entry name="registering, interface implementations, REGISTER_IMPLEMENTATION" url="ch14lev1sec2.html"/>
+<entry name="ReleaseInfo tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="remoteFunctions() method" url="ch13lev1sec6.html"/>
+<entry name="remoteInterfaces() method" url="ch13lev1sec6.html"/>
+<entry name="remoteObjects() method" url="ch13lev1sec6.html"/>
+<entry name="removeGlobalReferences function" url="ch14lev1sec3.html"/>
+<entry name="remove option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="removing, modeless dialog boxes" url="ch08lev1sec3.html"/>
+<entry name="rendering, HTML files" url="ch10.html"/>
+<entry name="repainting, widgets" url="ch04lev1sec2.html"/>
+<entry name="repaint() method, QPainter class" url="ch04lev1sec2.html"/>
+<entry name="replace action" url="ch06.html"/>
+<entry name="reportBug action" url="ch06.html"/>
+<entry name="resiceGL(int width, int height) function (QGL widget)" url="ch03lev1sec6.html"/>
+<entry name="resizeEvent() event handler, widgets" url="ch04.html"/>
+<entry name="Resource/Header Files window (KDevelop)" url="ch18.html"/>
+<entry name="resources, accessing" url="ch07lev1sec4.html"/>
+<entry name="resources, .desktop files" url="ch07lev1sec4.html"/>
+<entry name="resources, standard resource locations" url="ch07lev1sec4.html"/>
+<entry name="resources, types" url="ch07lev1sec4.html"/>
+<entry name="responding to drop events" url="ch07.html"/>
+<entry name="responsiveness, importance of" url="ch09.html"/>
+<entry name="responsiveness, long jobs, optimizing performance of, application functions, enabling/disabling" url="ch09lev1sec3.html"/>
+<entry name="responsiveness, long jobs, optimizing performance of, processEvents() method" url="ch09lev1sec3.html"/>
+<entry name="responsiveness, long jobs, optimizing performance of, QTimer class" url="ch09lev1sec3.html"/>
+<entry name="responsiveness, long jobs, optimizing performance of, speed issues" url="ch09lev1sec3.html"/>
+<entry name="responsiveness, long jobs, optimizing performance of" url="ch09lev1sec3.html"/>
+<entry name="responsiveness" url="ch09.html"/>
+<entry name="responsiveness, Window updates, double-buffering, advantages" url="ch09lev1sec2.html"/>
+<entry name="responsiveness, Window updates, double-buffering, example of" url="ch09lev1sec2.html"/>
+<entry name="responsiveness, Window updates, double-buffering, screen flicker" url="ch09lev1sec2.html"/>
+<entry name="responsiveness, Window updates, double-buffering" url="ch09lev1sec2.html"/>
+<entry name="resume() method" url="ch13lev1sec5.html"/>
+<entry name="returns (" url="ch15.html"/>
+<entry name="revert action" url="ch06.html"/>
+<entry name="RFV (Real File Viewer)" url="ch18.html"/>
+<entry name="RFV (Real File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="Run command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="run() functions, KRun class" url="ch06lev1sec7.html"/>
+<entry name="running, applications, KRun class" url="ch06lev1sec7.html"/>
+<entry name="running, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="Run to Cursor command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="save action" url="ch06.html"/>
+<entry name="saveAs action" url="ch06.html"/>
+<entry name="saveFile() function" url="ch12lev1sec5.html"/>
+<entry name="saveOptions action" url="ch06.html"/>
+<entry name="saveProperties() function" url="ch07lev1sec3.html"/>
+<entry name="screen flicker" url="ch09lev1sec2.html"/>
+<entry name="scripting, MCOP" url="ch14lev1sec7.html"/>
+<entry name="searching, KDevelop documentation" url="ch18lev1sec3.html"/>
+<entry name="Sectn tag (DocBook)***ITALICIZE n***" url="ch15lev1sec2.html"/>
+<entry name="sect (" url="ch15.html"/>
+<entry name="see (" url="ch15.html"/>
+<entry name="selectAll action" url="ch06.html"/>
+<entry name="SelectDialog class" url="ch08.html"/>
+<entry name="senderId() method" url="ch13lev1sec6.html"/>
+<entry name="send() method" url="ch13lev1sec5.html"/>
+<entry name="services resource type" url="ch07lev1sec4.html"/>
+<entry name="session management" url="ch07lev1sec3.html"/>
+<entry name="sessions, session management, header file example" url="ch06lev1sec2.html"/>
+<entry name="sessions, session management, KEdit" url="ch06lev1sec2.html"/>
+<entry name="sessions, session management, main source code example" url="ch06lev1sec2.html"/>
+<entry name="sessions, session management, source file example" url="ch06lev1sec2.html"/>
+<entry name="sessions, session management" url="ch06lev1sec2.html"/>
+<entry name="setAcceptDrops() function" url="ch07.html"/>
+<entry name="setActiveWindow() method" url="ch11lev1sec2.html"/>
+<entry name="setButtonText() method" url="ch08lev1sec5.html"/>
+<entry name="setDefaultObject() method" url="ch13lev1sec5.html"/>
+<entry name="setExclusiveGroup() function" url="ch05.html"/>
+<entry name="setMinimumSize() method" url="ch11lev1sec3.html"/>
+<entry name="setModified() function" url="ch12lev1sec5.html"/>
+<entry name="setNotifications() method" url="ch13lev1sec6.html"/>
+<entry name="setPen() method" url="ch04lev1sec2.html"/>
+<entry name="setPlainCaption() method" url="ch08lev1sec5.html"/>
+<entry name="setReadWrite() function" url="ch12lev1sec5.html"/>
+<entry name="Settings menu commands" url="ch06.html"/>
+<entry name="shared libraries, creating" url="ch16lev1sec2.html"/>
+<entry name="shared libraries, parts, including, factory headers" url="ch12lev1sec6.html"/>
+<entry name="shared libraries, parts, including, factory implementation" url="ch12lev1sec6.html"/>
+<entry name="shared libraries, parts, including, makefiles" url="ch12lev1sec6.html"/>
+<entry name="shared libraries, parts, including" url="ch12lev1sec6.html"/>
+<entry name="short (" url="ch15.html"/>
+<entry name="showEvent() event handler, widgets" url="ch04.html"/>
+<entry name="showMenubar action" url="ch06.html"/>
+<entry name="show() method" url="ch02lev1sec3.html"/>
+<entry name="showStatusbar action" url="ch06.html"/>
+<entry name="showToolbar action" url="ch06.html"/>
+<entry name="signals, connecting to slots" url="ch03lev1sec3.html"/>
+<entry name="signals (DCOP)" url="ch13lev1sec6.html"/>
+<entry name="signals, emitting" url="ch03lev1sec3.html"/>
+<entry name="signals, parameters" url="ch03lev1sec3.html"/>
+<entry name="signals, (Qt)" url="ch03lev1sec3.html"/>
+<entry name="signals" url="ch03lev1sec2.html"/>
+<entry name="signals (widgets)" url="ch04.html"/>
+<entry name="SimpleSoundServer interface" url="ch14lev1sec4.html"/>
+<entry name="since (" url="ch15.html"/>
+<entry name="single-instance application, kunique.cpp call definition" url="ch11lev1sec2.html"/>
+<entry name="single-instance application, kunique.h class definition" url="ch11lev1sec2.html"/>
+<entry name="single-instance application, main() method" url="ch11lev1sec2.html"/>
+<entry name="single-instance application" url="ch11lev1sec2.html"/>
+<entry name="slotButton()" url="ch03lev1sec4.html"/>
+<entry name="slotOpen() function" url="ch07lev1sec5.html"/>
+<entry name="slotSave() function" url="ch07lev1sec5.html"/>
+<entry name="slots, connecting to signals" url="ch03lev1sec3.html"/>
+<entry name="slots, creating" url="ch03lev1sec3.html"/>
+<entry name="slots (DCOP)" url="ch13lev1sec6.html"/>
+<entry name="slots, parameters" url="ch03lev1sec3.html"/>
+<entry name="slotSpecialHelp() function" url="ch05lev1sec2.html"/>
+<entry name="slotSpellCheck() method" url="ch10lev1sec3.html"/>
+<entry name="slots, (Qt)" url="ch03lev1sec3.html"/>
+<entry name="slots, slotButton()" url="ch03lev1sec4.html"/>
+<entry name="slots, temporary classes" url="ch03lev1sec3.html"/>
+<entry name="slots" url="ch03lev1sec2.html"/>
+<entry name="slots (widgets)" url="ch04.html"/>
+<entry name="snapshots" url="ch17lev1sec3.html"/>
+<entry name="socket() method" url="ch13lev1sec6.html"/>
+<entry name="software development, documentation" url="ch18.html"/>
+<entry name="software development, languages" url="ch18.html"/>
+<entry name="software development, packages, creating" url="ch18.html"/>
+<entry name="software development, project management" url="ch18.html"/>
+<entry name="sorry() function" url="ch05lev1sec3.html"/>
+<entry name="sound, KAudioPlayer class" url="ch14lev1sec6.html"/>
+<entry name="sound, LibKMid" url="ch14lev1sec6.html"/>
+<entry name="sound, multimedia" url="ch14lev1sec5.html"/>
+<entry name="sound, playing" url="ch06lev1sec5.html"/>
+<entry name="sound resource type" url="ch07lev1sec4.html"/>
+<entry name="sound, SimpleSoundServer interface" url="ch14lev1sec4.html"/>
+<entry name="sound, StereoBalanceControl sample program, balance() function" url="ch14lev1sec5.html"/>
+<entry name="sound, StereoBalanceControl sample program, IDL (interface definition language)" url="ch14lev1sec5.html"/>
+<entry name="sound, StereoBalanceControl sample program, makefile" url="ch14lev1sec5.html"/>
+<entry name="sound, StereoBalanceControl sample program, running on server" url="ch14lev1sec5.html"/>
+<entry name="sound, StereoBalanceControl sample program" url="ch14lev1sec5.html"/>
+<entry name="sound, stereo beeps, playing" url="ch14.html"/>
+<entry name="sound, StereoEffectStack interface" url="ch14lev1sec4.html"/>
+<entry name="sound" url="ch06lev1sec5.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), CVS accounts" url="ch17lev1sec3.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), cvsup utility" url="ch17lev1sec3.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), cvsup utility" url="ch17lev1sec4.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), cvs utility" url="ch17lev1sec5.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), snapshots" url="ch17lev1sec3.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System)" url="ch17lev1sec3.html"/>
+<entry name="source code, accessing in CVS (Concurrent Version System), Web interface" url="ch17lev1sec3.html"/>
+<entry name="source code documentation, KDOC, class documentation" url="ch15.html"/>
+<entry name="source code documentation, KDOC, comments" url="ch15.html"/>
+<entry name="source code documentation, KDOC, downloading" url="ch15.html"/>
+<entry name="source code documentation, KDOC, installing" url="ch15.html"/>
+<entry name="source code documentation, KDOC, library documentation" url="ch15.html"/>
+<entry name="source code documentation, KDOC, method documentation" url="ch15.html"/>
+<entry name="source code documentation" url="ch15.html"/>
+<entry name="source code listings" url="ch04lev1sec3.html"/>
+<entry name="source files, session management" url="ch06lev1sec2.html"/>
+<entry name="source packages, installing" url="ch01lev1sec5.html"/>
+<entry name="speeding up Window updates (double-buffering), advantages" url="ch09lev1sec2.html"/>
+<entry name="speeding up Window updates (double-buffering), example of" url="ch09lev1sec2.html"/>
+<entry name="speeding up Window updates (double-buffering), screen flicker" url="ch09lev1sec2.html"/>
+<entry name="speeding up Window updates (double-buffering)" url="ch09lev1sec2.html"/>
+<entry name="spell-checking (KSpell), configuring" url="ch10lev1sec3.html"/>
+<entry name="spell-checking (KSpell), methods" url="ch10lev1sec3.html"/>
+<entry name="spell-checking (KSpell), modal spell-checking" url="ch10lev1sec3.html"/>
+<entry name="spell-checking (KSpell), sample application" url="ch10lev1sec3.html"/>
+<entry name="spell-checking (KSpell)" url="ch10lev1sec3.html"/>
+<entry name="spelling action" url="ch06.html"/>
+<entry name="standard actions, KStdAction class" url="ch05.html"/>
+<entry name="standard actions, KStdActionsDemo widget, kstdactionsdemo.cpp class declaration" url="ch05.html"/>
+<entry name="standard actions, KStdActionsDemo widget, kstdactionsdemo.h class definition" url="ch05.html"/>
+<entry name="standard actions, KStdActionsDemo widget, main() function" url="ch05.html"/>
+<entry name="standard actions, KStdActionsDemo widget" url="ch05.html"/>
+<entry name="standard dialog boxes, KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="standard dialog boxes, KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="standard dialog boxes, KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="standard dialog boxes, sample application" url="ch05lev1sec3.html"/>
+<entry name="standard dialog boxes" url="ch05lev1sec3.html"/>
+<entry name="standard resource locations" url="ch07lev1sec4.html"/>
+<entry name="startComputation() method" url="ch09lev1sec3.html"/>
+<entry name="starting, drag events" url="ch07.html"/>
+<entry name="startobject parameter" url="ch03lev1sec3.html"/>
+<entry name="statements, #include" url="ch14lev1sec3.html"/>
+<entry name="states, toolbar icons" url="ch06lev1sec3.html"/>
+<entry name="static run() functions" url="ch06lev1sec7.html"/>
+<entry name="statusBar() method" url="ch02lev1sec4.html"/>
+<entry name="status bars, Konqueror status bar" url="ch05.html"/>
+<entry name="status bars, KWrite status bar" url="ch05.html"/>
+<entry name="status bars" url="ch05.html"/>
+<entry name="status lines" url="ch02lev1sec4.html"/>
+<entry name="Stderr page (KDevelop Output View" url="ch18.html"/>
+<entry name="Stdout page (KDevelop Output View" url="ch18.html"/>
+<entry name="Steo Over command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="Step In command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="Step In Instruction command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="Step Out command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="Step Over Instruction command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="StereoBalanceControl sample program, balance() function" url="ch14lev1sec5.html"/>
+<entry name="StereoBalanceControl sample program, IDL (interface definition language)" url="ch14lev1sec5.html"/>
+<entry name="StereoBalanceControl sample program, makefile" url="ch14lev1sec5.html"/>
+<entry name="StereoBalanceControl sample program, running on server" url="ch14lev1sec5.html"/>
+<entry name="StereoBalanceControl sample program" url="ch14lev1sec5.html"/>
+<entry name="stereo beeps, playing" url="ch14.html"/>
+<entry name="StereoEffectStack interface" url="ch14lev1sec4.html"/>
+<entry name="STL, (Standard Template Library)" url="ch03lev1sec5.html"/>
+<entry name="Stop command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="stopComputation() method" url="ch09lev1sec3.html"/>
+<entry name="streamEnd() function" url="ch14lev1sec3.html"/>
+<entry name="streaming data, reading devices" url="ch13lev1sec3.html"/>
+<entry name="streaming data" url="ch13lev1sec3.html"/>
+<entry name="streaming data, writing to devices" url="ch13lev1sec3.html"/>
+<entry name="streamInit() function" url="ch14lev1sec3.html"/>
+<entry name="streams, accessing" url="ch14lev1sec3.html"/>
+<entry name="streams, defining" url="ch14lev1sec3.html"/>
+<entry name="streams, synchronous versus asynchronous" url="ch14lev1sec3.html"/>
+<entry name="streamStart() function" url="ch14lev1sec3.html"/>
+<entry name="structs" url="ch14lev1sec3.html"/>
+<entry name="stub files (DCOP)" url="ch13lev1sec5.html"/>
+<entry name="subdirectories, configuring" url="ch16lev1sec2.html"/>
+<entry name="suspend() method" url="ch13lev1sec5.html"/>
+<entry name="synchronous streams" url="ch14lev1sec3.html"/>
+<entry name="syntax, i18n()" url="ch06lev1sec4.html"/>
+<entry name="system events, handling" url="ch04.html"/>
+<entry name="system requirements (KDE)" url="ch01lev1sec4.html"/>
+<entry name="tags (DocBook), document structure tags" url="ch15lev1sec2.html"/>
+<entry name="tags (DocBook), formatting tags" url="ch15lev1sec2.html"/>
+<entry name="tags (DocBook), meta-information tags" url="ch15lev1sec2.html"/>
+<entry name="tags (KDOC)" url="ch15.html"/>
+<entry name="tags (XML), DOCTYPE" url="ch12lev1sec3.html"/>
+<entry name="tags, XML (Extensible Markup Language)" url="ch05.html"/>
+<entry name="tags (XML), Merge" url="ch12lev1sec3.html"/>
+<entry name="targetobject parameter" url="ch03lev1sec3.html"/>
+<entry name="targets (makefiles)" url="ch16lev1sec2.html"/>
+<entry name="tasks" url="ch09lev1sec3.html"/>
+<entry name="template classes, listing" url="ch03lev1sec5.html"/>
+<entry name="templates, C++" url="ch03lev1sec5.html"/>
+<entry name="templates, KDevelop application templates, KDE-MDI" url="ch18lev1sec2.html"/>
+<entry name="templates, KDevelop application templates, KDE Mini" url="ch18lev1sec2.html"/>
+<entry name="templates, KDevelop application templates, KDE Normal" url="ch18lev1sec2.html"/>
+<entry name="templates, KDevelop application templates" url="ch18lev1sec2.html"/>
+<entry name="templates, QList class" url="ch03lev1sec5.html"/>
+<entry name="templates, STL" url="ch03lev1sec5.html"/>
+<entry name="testing, KXOSquare widget" url="ch04lev1sec2.html"/>
+<entry name="text editors" url="ch02.html"/>
+<entry name="text editor" url="ch05.html"/>
+<entry name="text tag (XML)" url="ch05.html"/>
+<entry name="throws (" url="ch15.html"/>
+<entry name="TicTacToe widget" url="ch04lev1sec3.html"/>
+<entry name="tooBar() method" url="ch02lev1sec4.html"/>
+<entry name="toolbar icons, specifications" url="ch06lev1sec3.html"/>
+<entry name="toolbar icons, states" url="ch06lev1sec3.html"/>
+<entry name="toolbar resource type" url="ch07lev1sec4.html"/>
+<entry name="toolbars, KCustomActions widget" url="ch05.html"/>
+<entry name="toolbars" url="ch02lev1sec4.html"/>
+<entry name="toolbars" url="ch05.html"/>
+<entry name="ToolBar tag (XML)" url="ch05.html"/>
+<entry name="toolkits, Qt" url="ch03.html"/>
+<entry name="tools, Autoconf" url="ch18.html"/>
+<entry name="tools, Automake" url="ch18.html"/>
+<entry name="tools, DocBook, DocBook Web site" url="ch15lev1sec2.html"/>
+<entry name="tools, DocBook, downloading" url="ch15lev1sec2.html"/>
+<entry name="tools, DocBook, processing documentation" url="ch15lev1sec2.html"/>
+<entry name="tools, DocBook, sample documentation" url="ch15lev1sec2.html"/>
+<entry name="tools, DocBook, tags" url="ch15lev1sec2.html"/>
+<entry name="tools, DocBook" url="ch15lev1sec2.html"/>
+<entry name="tools, gdb debugger, commands" url="ch18lev1sec6.html"/>
+<entry name="tools, gdb debugger, enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="tools, gdb debugger, options" url="ch18lev1sec6.html"/>
+<entry name="tools, gdb debugger, running" url="ch18lev1sec6.html"/>
+<entry name="tools, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="tools, KDOC, class documentation" url="ch15.html"/>
+<entry name="tools, KDOC, comments" url="ch15.html"/>
+<entry name="tools, KDOC, downloading" url="ch15.html"/>
+<entry name="tools, KDOC, installing" url="ch15.html"/>
+<entry name="tools, KDOC, library documentation" url="ch15.html"/>
+<entry name="tools, KDOC, method documentation" url="ch15.html"/>
+<entry name="tools, KDOC" url="ch15.html"/>
+<entry name="Tools menu commands" url="ch06.html"/>
+<entry name="Tools window (KDevelop)" url="ch18.html"/>
+<entry name="Tooltips" url="ch05lev1sec2.html"/>
+<entry name="top-level directories, configuring" url="ch16lev1sec2.html"/>
+<entry name="transactions (DCOP)" url="ch13lev1sec5.html"/>
+<entry name="translation files" url="ch06lev1sec4.html"/>
+<entry name="transparency (network)" url="ch07lev1sec5.html"/>
+<entry name="Tree View (KDevelop IDE), CV (Class Viewer)" url="ch18.html"/>
+<entry name="Tree View (KDevelop IDE), DOC (Documentation Tree View)" url="ch18.html"/>
+<entry name="Tree View (KDevelop IDE), LFV (Logical File Viewer)" url="ch18.html"/>
+<entry name="Tree View (KDevelop IDE), LFV (Logical File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="Tree View (KDevelop IDE), RFV (Real File Viewer)" url="ch18.html"/>
+<entry name="Tree View (KDevelop IDE), RFV (Real File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="Tree View (KDevelop IDE)" url="ch18.html"/>
+<entry name="Tree View (KDevelop IDE), VAR (Variable Viewer)" url="ch18.html"/>
+<entry name="Trolltech Web site" url="ch03.html"/>
+<entry name="troubleshooting, gdb debugger, commands" url="ch18lev1sec6.html"/>
+<entry name="troubleshooting, gdb debugger, enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="troubleshooting, gdb debugger, options" url="ch18lev1sec6.html"/>
+<entry name="troubleshooting, gdb debugger, running" url="ch18lev1sec6.html"/>
+<entry name="troubleshooting, gdb debugger" url="ch18lev1sec6.html"/>
+<entry name="tuning performance" url="ch09lev1sec3.html"/>
+<entry name="types (IDL)" url="ch14lev1sec3.html"/>
+<entry name="UI compliance, document-centric interface, actions" url="ch05.html"/>
+<entry name="UI compliance, document-centric interface, content areas" url="ch05.html"/>
+<entry name="UI compliance, document-centric interface, menubars" url="ch05.html"/>
+<entry name="UI compliance, document-centric interface, status bars" url="ch05.html"/>
+<entry name="UI compliance, document-centric interface, toolbars" url="ch05.html"/>
+<entry name="UI compliance, document-centric interface" url="ch05.html"/>
+<entry name="UI compliance, help, Tooltips" url="ch05lev1sec2.html"/>
+<entry name="UI compliance, help, ToolTips" url="ch05lev1sec2.html"/>
+<entry name="UI compliance, help" url="ch05lev1sec2.html"/>
+<entry name="UI compliance, standard dialog boxes, KFileDialog" url="ch05lev1sec3.html"/>
+<entry name="UI compliance, standard dialog boxes, KFontDialog" url="ch05lev1sec3.html"/>
+<entry name="UI compliance, standard dialog boxes, KMessageBox" url="ch05lev1sec3.html"/>
+<entry name="UI compliance, standard dialog boxes, sample application" url="ch05lev1sec3.html"/>
+<entry name="UI compliance, standard dialog boxes" url="ch05lev1sec3.html"/>
+<entry name="UI compliance" url="ch05.html"/>
+<entry name="ULink tag (DocBook)" url="ch15lev1sec2.html"/>
+<entry name="undo action" url="ch06.html"/>
+<entry name="uninstall target" url="ch16lev1sec2.html"/>
+<entry name="unique applications, KUniqueApplication example, passing command-line parameters" url="ch13lev1sec7.html"/>
+<entry name="unique applications, KUniqueApplication example, startup" url="ch13lev1sec7.html"/>
+<entry name="unique applications, KUniqueApplication example" url="ch13lev1sec7.html"/>
+<entry name="unique applications" url="ch13.html"/>
+<entry name="up action" url="ch06.html"/>
+<entry name="update() method, QPainter class" url="ch04lev1sec2.html"/>
+<entry name="update option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="updating, administrative files" url="ch16lev1sec2.html"/>
+<entry name="updating, modules (CVS)" url="ch17lev1sec5.html"/>
+<entry name="upload() function" url="ch07lev1sec5.html"/>
+<entry name="uploading, software" url="ch16lev1sec3.html"/>
+<entry name="user-friendly applications" url="ch06lev1sec9.html"/>
+<entry name="user input, widgets, KDisc widget example" url="ch04lev1sec4.html"/>
+<entry name="user input, widgets, keystrokes" url="ch04lev1sec4.html"/>
+<entry name="user input, widgets, mouse clicks" url="ch04lev1sec4.html"/>
+<entry name="user input, widgets" url="ch04lev1sec4.html"/>
+<entry name="user interface (KDevelop IDE), _____debugger), commands" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), Dialog Editor, advantages" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Dialog Editor" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Dialog Editor, weaknesses" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), gdb debugger), commands" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), gdb (debugger), enabling debugging information" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), gdb (debugger), options" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), gdb (debugger), running" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), gdb (debugger)" url="ch18lev1sec6.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Breakpoint page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Disassemble page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Frame Stack page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Messages page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Stderr page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View, Stdout page" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Output View" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, CV (Class Viewer)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, DOC (Documentation Tree View)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, LFV (Logical File Viewer)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, LFV (Logical File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, RFV (Real File Viewer)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, RFV (Real File Viewer)" url="ch18lev1sec5.html"/>
+<entry name="user interface (KDevelop IDE), Tree View" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), Tree View, VAR (Variable Viewer)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE)" url="ch18.html"/>
+<entry name="user interface (KDevelop IDE), working area" url="ch18.html"/>
+<entry name="user-interface library" url="ch08lev1sec4.html"/>
+<entry name="users, notifications" url="ch06lev1sec6.html"/>
+<entry name="utilities, cvs, commands" url="ch17lev1sec5.html"/>
+<entry name="utilities, cvs, configuring" url="ch17lev1sec5.html"/>
+<entry name="utilities, cvsup, advantages" url="ch17lev1sec3.html"/>
+<entry name="utilities, cvsup, configuring" url="ch17lev1sec4.html"/>
+<entry name="utilities, make" url="ch02lev1sec2.html"/>
+<entry name="utilities, xgettext" url="ch07lev1sec4.html"/>
+<entry name="utility classes, (Qt)" url="ch03lev1sec5.html"/>
+<entry name="variables, environment variables, KDEDIR" url="ch02lev1sec2.html"/>
+<entry name="variables, environment variables, QTDIR" url="ch02lev1sec2.html"/>
+<entry name="Variable Viewer (VAR)" url="ch18.html"/>
+<entry name="VAR (Variable Viewer)" url="ch18.html"/>
+<entry name="version control, CVS, accounts" url="ch17lev1sec3.html"/>
+<entry name="version control, CVS, branches" url="ch17lev1sec2.html"/>
+<entry name="version control, CVS, (Concurrent Versions System)" url="ch17.html"/>
+<entry name="version control, CVS, cvsup utility" url="ch17lev1sec3.html"/>
+<entry name="version control, CVS, cvsup utility" url="ch17lev1sec4.html"/>
+<entry name="version control, CVS, cvs utility" url="ch17lev1sec5.html"/>
+<entry name="version control, CVS, directories" url="ch17lev1sec5.html"/>
+<entry name="version control, CVS, files" url="ch17lev1sec5.html"/>
+<entry name="version control, CVS, modules" url="ch17lev1sec2.html"/>
+<entry name="version control, CVS, snapshots" url="ch17lev1sec3.html"/>
+<entry name="version control, CVS" url="ch17.html"/>
+<entry name="version control, CVS, Web interface" url="ch17lev1sec3.html"/>
+<entry name="versions, KDevelop IDE" url="ch18.html"/>
+<entry name="versions, KDevelop IDE, version 2.0" url="ch18.html"/>
+<entry name="versions, KDevelop IDE, version 2.0" url="ch18lev1sec7.html"/>
+<entry name="version (" url="ch15.html"/>
+<entry name="vi editor" url="ch02.html"/>
+<entry name="Viewers command (gdb debugger)" url="ch18lev1sec6.html"/>
+<entry name="View menu commands" url="ch06.html"/>
+<entry name="views, KDevelop IDE, Output View" url="ch18.html"/>
+<entry name="views, KDevelop IDE, Tree View" url="ch18.html"/>
+<entry name="wallpaper resource type" url="ch07lev1sec4.html"/>
+<entry name="warningContinueCancel() function" url="ch05lev1sec3.html"/>
+<entry name="Web, CVS (Concurrent Version System) interface" url="ch17lev1sec3.html"/>
+<entry name="Web sites, DKE Developers" url="ch01lev1sec2.html"/>
+<entry name="Web sites, DocBook" url="ch15lev1sec2.html"/>
+<entry name="Web sites, Freshmeat" url="ch16lev1sec3.html"/>
+<entry name="Web sites, ICE (Inter-Client Exchange) documentation" url="ch13lev1sec3.html"/>
+<entry name="Web sites, Interface Hall of Shame" url="ch06lev1sec9.html"/>
+<entry name="Web sites, Interface Hall of Shame" url="ch08lev1sec7.html"/>
+<entry name="Web sites, KDE Translator's and Documenter's Web site" url="ch06lev1sec4.html"/>
+<entry name="Web sites, KDE" url="ch01lev1sec3.html"/>
+<entry name="Web sites, licenses" url="ch19lev1sec5.html"/>
+<entry name="Web sites, Mesa" url="ch03lev1sec6.html"/>
+<entry name="Web sites, OpenGl" url="ch03lev1sec6.html"/>
+<entry name="Web sites, QDataStream documentation" url="ch13lev1sec3.html"/>
+<entry name="Web sites, Trolltech" url="ch03.html"/>
+<entry name="Web sites, XDND protocol" url="ch07.html"/>
+<entry name="Web sites, XML-RPC" url="ch13lev1sec7.html"/>
+<entry name="whatsThis action" url="ch06.html"/>
+<entry name="wheelEvent() event handler, widgets" url="ch04.html"/>
+<entry name="widets, KImageView (image viewer/converter), kimageview.cpp class declaration" url="ch10lev1sec2.html"/>
+<entry name="widets, KImageView (image viewer/converter), kimageview.h class definition" url="ch10lev1sec2.html"/>
+<entry name="widets, KImageView (image viewer/converter), main() method" url="ch10lev1sec2.html"/>
+<entry name="widets, KImageView (image viewer/converter)" url="ch10lev1sec2.html"/>
+<entry name="widgets, attributes" url="ch04.html"/>
+<entry name="widgets, child widgets, geometry management" url="ch04lev1sec3.html"/>
+<entry name="widgets, child widgets, KChildren example" url="ch04lev1sec3.html"/>
+<entry name="widgets, child widgets" url="ch04lev1sec3.html"/>
+<entry name="widgets, compared to parts" url="ch12.html"/>
+<entry name="widgets, defined" url="ch04.html"/>
+<entry name="widgets, dialog widgets" url="ch08.html"/>
+<entry name="widgets, documentation" url="ch04.html"/>
+<entry name="widgets, drawing commands, recording" url="ch04lev1sec2.html"/>
+<entry name="widgets, drawing graphics on" url="ch03lev1sec2.html"/>
+<entry name="widgets, event handlers, closeEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, dragEnterEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, dragLeaveEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, dragMoveEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, dropEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, enterEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, event()" url="ch04.html"/>
+<entry name="widgets, event handlers, focusInEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, focusOutEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, hideEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, keyPressEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, keyReleaseEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, leaveEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, mouseDoubleClickEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, mouseMoveEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, mousePressEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, mouseReleaseEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, moveEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, paintEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, resizeEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers, showEvent()" url="ch04.html"/>
+<entry name="widgets, event handlers" url="ch04.html"/>
+<entry name="widgets, event handlers, wheelEvent()" url="ch04.html"/>
+<entry name="widgets, KHTMLWidget" url="ch10.html"/>
+<entry name="widgets, KSpell (spell-checking), configuring" url="ch10lev1sec3.html"/>
+<entry name="widgets, KSpell (spell-checking), methods" url="ch10lev1sec3.html"/>
+<entry name="widgets, KSpell (spell-checking), modal spell-checking" url="ch10lev1sec3.html"/>
+<entry name="widgets, KSpell (spell-checking), sample application" url="ch10lev1sec3.html"/>
+<entry name="widgets, KSpell (spell-checking)" url="ch10lev1sec3.html"/>
+<entry name="widgets, manager widgets (kdeui)" url="ch08lev1sec4.html"/>
+<entry name="widgets, names of specific widgets" url="ch10lev1sec3.html"/>
+<entry name="widgets, painting, invoking paint events" url="ch04lev1sec2.html"/>
+<entry name="widgets, painting, KXOSquare example" url="ch04lev1sec2.html"/>
+<entry name="widgets, painting, paintEvent() method" url="ch04lev1sec2.html"/>
+<entry name="widgets, painting, repainting" url="ch04lev1sec2.html"/>
+<entry name="widgets, painting" url="ch04lev1sec2.html"/>
+<entry name="widgets, QGL" url="ch03lev1sec6.html"/>
+<entry name="widgets, sample class declaration" url="ch04.html"/>
+<entry name="widgets, signals" url="ch04.html"/>
+<entry name="widgets, slots" url="ch04.html"/>
+<entry name="widgets" url="ch01lev1sec2.html"/>
+<entry name="widgets" url="ch04.html"/>
+<entry name="widgets" url="ch04lev1sec3.html"/>
+<entry name="widgets" url="ch09lev1sec2.html"/>
+<entry name="widgets, user input, KDisc widget example" url="ch04lev1sec4.html"/>
+<entry name="widgets, user input, keystrokes" url="ch04lev1sec4.html"/>
+<entry name="widgets, user input, mouse clicks" url="ch04lev1sec4.html"/>
+<entry name="widgets, user input" url="ch04lev1sec4.html"/>
+<entry name="Window updates, double-buffering, advantages" url="ch09lev1sec2.html"/>
+<entry name="Window updates, double-buffering, example of" url="ch09lev1sec2.html"/>
+<entry name="Window updates, double-buffering, screen flicker" url="ch09lev1sec2.html"/>
+<entry name="Window updates, double-buffering" url="ch09lev1sec2.html"/>
+<entry name="wizards, Application Wizard (KDevelop)" url="ch18lev1sec2.html"/>
+<entry name="working area (KDevelop IDE)" url="ch18.html"/>
+<entry name="World Wide Web" url="ch17lev1sec3.html"/>
+<entry name="writeGlobalSettings() method" url="ch10lev1sec3.html"/>
+<entry name="writing, QDataStream serialization" url="ch13lev1sec3.html"/>
+<entry name="WWW" url="ch17lev1sec3.html"/>
+<entry name="X Atoms" url="ch13lev1sec2.html"/>
+<entry name="XDND protocol" url="ch07.html"/>
+<entry name="xgettext utility" url="ch07lev1sec4.html"/>
+<entry name="XML (Extensible Markup Language), tags" url="ch05.html"/>
+<entry name="XML (Extensible Markup Language)" url="ch05.html"/>
+<entry name="XML files, user interfaces" url="ch12lev1sec3.html"/>
+<entry name="XML-RPC" url="ch13lev1sec7.html"/>
+<entry name="XML tags, DOCTYPE" url="ch12lev1sec3.html"/>
+<entry name="XML tags, Merge" url="ch12lev1sec3.html"/>
+<entry name="X Windows programming, Qt toolkit" url="ch03.html"/>
+<entry name="z6 option (cvs command)" url="ch17lev1sec5.html"/>
+<entry name="zoom action" url="ch06.html"/>
+<entry name="zoomIn action" url="ch06.html"/>
+<entry name="ZoomOut action" url="ch06.html"/>
+</index>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/kdetemplates.toc b/languages/cpp/doc/kdetemplates.toc
new file mode 100644
index 00000000..c72f19ad
--- /dev/null
+++ b/languages/cpp/doc/kdetemplates.toc
@@ -0,0 +1,9 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>The KDevelop C++ KDE templates explained</title>
+<base href="http://women.kde.org/articles/tutorials/kdevelop_templates"/>
+<tocsect1 name="General KDE templates" url="index.php"/>
+<tocsect1 name="Other KDE templates" url="others.php/"/>
+<tocsect1 name="SCons templates" url="scons.php"/>
+<tocsect1 name="Qt templates" url="qt.php"/>
+</kdeveloptoc>
diff --git a/languages/cpp/doc/libc.toc b/languages/cpp/doc/libc.toc
new file mode 100644
index 00000000..a007614d
--- /dev/null
+++ b/languages/cpp/doc/libc.toc
@@ -0,0 +1,858 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>LIBC (umn.edu)</title>
+<base href="http://epoxy.mrs.umn.edu/doc/glibc-doc/html/"/>
+<tocsect1 name="1. Introduction" url="chapters_1.html#SEC1">
+ <tocsect2 name="1.1 Getting Started" url="chapters_1.html#SEC2"/>
+ <tocsect2 name="1.2 Standards and Portability" url="chapters_1.html#SEC3">
+ <tocsect3 name="1.2.1 ISO C" url="chapters_1.html#SEC4"/>
+ <tocsect3 name="1.2.2 POSIX (The Portable Operating System Interface)" url="chapters_1.html#SEC5"/>
+ <tocsect3 name="1.2.3 Berkeley Unix" url="chapters_1.html#SEC6"/>
+ <tocsect3 name="1.2.4 SVID (The System V Interface Description)" url="chapters_1.html#SEC7"/>
+ <tocsect3 name="1.2.5 XPG (The X/Open Portability Guide)" url="chapters_1.html#SEC8"/>
+ </tocsect2>
+ <tocsect2 name="1.3 Using the Library" url="chapters_1.html#SEC9">
+ <tocsect3 name="1.3.1 Header Files" url="chapters_1.html#SEC10"/>
+ <tocsect3 name="1.3.2 Macro Definitions of Functions" url="chapters_1.html#SEC11"/>
+ <tocsect3 name="1.3.3 Reserved Names" url="chapters_1.html#SEC12"/>
+ <tocsect3 name="1.3.4 Feature Test Macros" url="chapters_1.html#SEC13"/>
+ </tocsect2>
+ <tocsect2 name="1.4 Roadmap to the Manual" url="chapters_1.html#SEC14"/>
+</tocsect1>
+<tocsect1 name="2. Error Reporting" url="chapters_2.html#SEC15">
+ <tocsect2 name="2.1 Checking for Errors" url="chapters_2.html#SEC16"/>
+ <tocsect2 name="2.2 Error Codes" url="chapters_2.html#SEC17"/>
+ <tocsect2 name="2.3 Error Messages" url="chapters_2.html#SEC18"/>
+</tocsect1>
+<tocsect1 name="3. Virtual Memory Allocation And Paging" url="chapters_3.html#SEC19">
+ <tocsect2 name="3.1 Process Memory Concepts" url="chapters_3.html#SEC20"/>
+ <tocsect2 name="3.2 Allocating Storage For Program Data" url="chapters_3.html#SEC21">
+ <tocsect3 name="3.2.1 Memory Allocation in C Programs" url="chapters_3.html#SEC22">
+ <tocsect4 name="3.2.1.1 Dynamic Memory Allocation" url="chapters_3.html#SEC23"/>
+ </tocsect3>
+ <tocsect3 name="3.2.2 Unconstrained Allocation" url="chapters_3.html#SEC24">
+ <tocsect4 name="3.2.2.1 Basic Memory Allocation" url="chapters_3.html#SEC25"/>
+ <tocsect4 name="3.2.2.2 Examples of malloc" url="chapters_3.html#SEC26"/>
+ <tocsect4 name="3.2.2.3 Freeing Memory Allocated with malloc" url="chapters_3.html#SEC27"/>
+ <tocsect4 name="3.2.2.4 Changing the Size of a Block" url="chapters_3.html#SEC28"/>
+ <tocsect4 name="3.2.2.5 Allocating Cleared Space" url="chapters_3.html#SEC29"/>
+ <tocsect4 name="3.2.2.6 Efficiency Considerations for malloc" url="chapters_3.html#SEC30"/>
+ <tocsect4 name="3.2.2.7 Allocating Aligned Memory Blocks" url="chapters_3.html#SEC31"/>
+ <tocsect4 name="3.2.2.8 Malloc Tunable Parameters" url="chapters_3.html#SEC32"/>
+ <tocsect4 name="3.2.2.9 Heap Consistency Checking" url="chapters_3.html#SEC33"/>
+ <tocsect4 name="3.2.2.10 Memory Allocation Hooks" url="chapters_3.html#SEC34"/>
+ <tocsect4 name="3.2.2.11 Statistics for Memory Allocation with malloc" url="chapters_3.html#SEC35"/>
+ <tocsect4 name="3.2.2.12 Summary of malloc-Related Functions" url="chapters_3.html#SEC36"/>
+ </tocsect3>
+ <tocsect3 name="3.2.3 Allocation Debugging" url="chapters_3.html#SEC37">
+ <tocsect4 name="3.2.3.1 How to install the tracing functionality" url="chapters_3.html#SEC38"/>
+ <tocsect4 name="3.2.3.2 Example program excerpts" url="chapters_3.html#SEC39"/>
+ <tocsect4 name="3.2.3.3 Some more or less clever ideas" url="chapters_3.html#SEC40"/>
+ <tocsect4 name="3.2.3.4 Interpreting the traces" url="chapters_3.html#SEC41"/>
+ </tocsect3>
+ <tocsect3 name="3.2.4 Obstacks" url="chapters_3.html#SEC42">
+ <tocsect4 name="3.2.4.1 Creating Obstacks" url="chapters_3.html#SEC43"/>
+ <tocsect4 name="3.2.4.2 Preparing for Using Obstacks" url="chapters_3.html#SEC44"/>
+ <tocsect4 name="3.2.4.3 Allocation in an Obstack" url="chapters_3.html#SEC45"/>
+ <tocsect4 name="3.2.4.4 Freeing Objects in an Obstack" url="chapters_3.html#SEC46"/>
+ <tocsect4 name="3.2.4.5 Obstack Functions and Macros" url="chapters_3.html#SEC47"/>
+ <tocsect4 name="3.2.4.6 Growing Objects" url="chapters_3.html#SEC48"/>
+ <tocsect4 name="3.2.4.7 Extra Fast Growing Objects" url="chapters_3.html#SEC49"/>
+ <tocsect4 name="3.2.4.8 Status of an Obstack" url="chapters_3.html#SEC50"/>
+ <tocsect4 name="3.2.4.9 Alignment of Data in Obstacks" url="chapters_3.html#SEC51"/>
+ <tocsect4 name="3.2.4.10 Obstack Chunks" url="chapters_3.html#SEC52"/>
+ <tocsect4 name="3.2.4.11 Summary of Obstack Functions" url="chapters_3.html#SEC53"/>
+ </tocsect3>
+ <tocsect3 name="3.2.5 Automatic Storage with Variable Size" url="chapters_3.html#SEC54">
+ <tocsect4 name="3.2.5.1 alloca Example" url="chapters_3.html#SEC55"/>
+ <tocsect4 name="3.2.5.2 Advantages of alloca" url="chapters_3.html#SEC56"/>
+ <tocsect4 name="3.2.5.3 Disadvantages of alloca" url="chapters_3.html#SEC57"/>
+ <tocsect4 name="3.2.5.4 GNU C Variable-Size Arrays" url="chapters_3.html#SEC58"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="3.3 Resizing the Data Segment" url="chapters_3.html#SEC59"/>
+ <tocsect2 name="3.4 Locking Pages" url="chapters_3.html#SEC60">
+ <tocsect3 name="3.4.1 Why Lock Pages" url="chapters_3.html#SEC61"/>
+ <tocsect3 name="3.4.2 Locked Memory Details" url="chapters_3.html#SEC62"/>
+ <tocsect3 name="3.4.3 Functions To Lock And Unlock Pages" url="chapters_3.html#SEC63"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="4. Character Handling" url="chapters_4.html#SEC64">
+ <tocsect2 name="4.1 Classification of Characters" url="chapters_4.html#SEC65"/>
+ <tocsect2 name="4.2 Case Conversion" url="chapters_4.html#SEC66"/>
+ <tocsect2 name="4.3 Character class determination for wide characters" url="chapters_4.html#SEC67"/>
+ <tocsect2 name="4.4 Notes on using the wide character classes" url="chapters_4.html#SEC68"/>
+ <tocsect2 name="4.5 Mapping of wide characters." url="chapters_4.html#SEC69"/>
+</tocsect1>
+<tocsect1 name="5. String and Array Utilities" url="chapters_5.html#SEC70">
+ <tocsect2 name="5.1 Representation of Strings" url="chapters_5.html#SEC71"/>
+ <tocsect2 name="5.2 String and Array Conventions" url="chapters_5.html#SEC72"/>
+ <tocsect2 name="5.3 String Length" url="chapters_5.html#SEC73"/>
+ <tocsect2 name="5.4 Copying and Concatenation" url="chapters_5.html#SEC74"/>
+ <tocsect2 name="5.5 String/Array Comparison" url="chapters_5.html#SEC75"/>
+ <tocsect2 name="5.6 Collation Functions" url="chapters_5.html#SEC76"/>
+ <tocsect2 name="5.7 Search Functions" url="chapters_5.html#SEC77">
+ <tocsect3 name="5.7.1 Compatibility String Search Functions" url="chapters_5.html#SEC78"/>
+ </tocsect2>
+ <tocsect2 name="5.8 Finding Tokens in a String" url="chapters_5.html#SEC79"/>
+ <tocsect2 name="5.9 strfry" url="chapters_5.html#SEC80"/>
+ <tocsect2 name="5.10 Trivial Encryption" url="chapters_5.html#SEC81"/>
+ <tocsect2 name="5.11 Encode Binary Data" url="chapters_5.html#SEC82"/>
+ <tocsect2 name="5.12 Argz and Envz Vectors" url="chapters_5.html#SEC83">
+ <tocsect3 name="5.12.1 Argz Functions" url="chapters_5.html#SEC84"/>
+ <tocsect3 name="5.12.2 Envz Functions" url="chapters_5.html#SEC85"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="6. Character Set Handling" url="chapters_6.html#SEC86">
+ <tocsect2 name="6.1 Introduction to Extended Characters" url="chapters_6.html#SEC87"/>
+ <tocsect2 name="6.2 Overview about Character Handling Functions" url="chapters_6.html#SEC88"/>
+ <tocsect2 name="6.3 Restartable Multibyte Conversion Functions" url="chapters_6.html#SEC89">
+ <tocsect3 name="6.3.1 Selecting the conversion and its properties" url="chapters_6.html#SEC90"/>
+ <tocsect3 name="6.3.2 Representing the state of the conversion" url="chapters_6.html#SEC91"/>
+ <tocsect3 name="6.3.3 Converting Single Characters" url="chapters_6.html#SEC92"/>
+ <tocsect3 name="6.3.4 Converting Multibyte and Wide Character Strings" url="chapters_6.html#SEC93"/>
+ <tocsect3 name="6.3.5 A Complete Multibyte Conversion Example" url="chapters_6.html#SEC94"/>
+ </tocsect2>
+ <tocsect2 name="6.4 Non-reentrant Conversion Function" url="chapters_6.html#SEC95">
+ <tocsect3 name="6.4.1 Non-reentrant Conversion of Single Characters" url="chapters_6.html#SEC96"/>
+ <tocsect3 name="6.4.2 Non-reentrant Conversion of Strings" url="chapters_6.html#SEC97"/>
+ <tocsect3 name="6.4.3 States in Non-reentrant Functions" url="chapters_6.html#SEC98"/>
+ </tocsect2>
+ <tocsect2 name="6.5 Generic Charset Conversion" url="chapters_6.html#SEC99">
+ <tocsect3 name="6.5.1 Generic Character Set Conversion Interface" url="chapters_6.html#SEC100"/>
+ <tocsect3 name="6.5.2 A complete iconv example" url="chapters_6.html#SEC101"/>
+ <tocsect3 name="6.5.3 Some Details about other iconv Implementations" url="chapters_6.html#SEC102"/>
+ <tocsect3 name="6.5.4 The iconv Implementation in the GNU C library" url="chapters_6.html#SEC103">
+ <tocsect4 name="6.5.4.1 Format of `gconv-modules' files" url="chapters_6.html#SEC104"/>
+ <tocsect4 name="6.5.4.2 Finding the conversion path in iconv" url="chapters_6.html#SEC105"/>
+ <tocsect4 name="6.5.4.3 iconv module data structures" url="chapters_6.html#SEC106"/>
+ <tocsect4 name="6.5.4.4 iconv module interfaces" url="chapters_6.html#SEC107"/>
+ </tocsect3>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="7. Locales and Internationalization" url="chapters_7.html#SEC108">
+ <tocsect2 name="7.1 What Effects a Locale Has" url="chapters_7.html#SEC109"/>
+ <tocsect2 name="7.2 Choosing a Locale" url="chapters_7.html#SEC110"/>
+ <tocsect2 name="7.3 Categories of Activities that Locales Affect" url="chapters_7.html#SEC111"/>
+ <tocsect2 name="7.4 How Programs Set the Locale" url="chapters_7.html#SEC112"/>
+ <tocsect2 name="7.5 Standard Locales" url="chapters_7.html#SEC113"/>
+ <tocsect2 name="7.6 Accessing Locale Information" url="chapters_7.html#SEC114">
+ <tocsect3 name="7.6.1 localeconv: It is portable but small...small" url="chapters_7.html#SEC115">
+ <tocsect4 name="7.6.1.1 Generic Numeric Formatting Parameters" url="chapters_7.html#SEC116"/>
+ <tocsect4 name="7.6.1.2 Printing the Currency Symbol" url="chapters_7.html#SEC117"/>
+ <tocsect4 name="7.6.1.3 Printing the Sign of a Monetary Amount" url="chapters_7.html#SEC118"/>
+ </tocsect3>
+ <tocsect3 name="7.6.2 Pinpoint Access to Locale Data" url="chapters_7.html#SEC119"/>
+ </tocsect2>
+ <tocsect2 name="7.7 A dedicated function to format numbers" url="chapters_7.html#SEC120"/>
+ <tocsect2 name="7.8 Yes-or-No Questions" url="chapters_7.html#SEC121"/>
+</tocsect1>
+<tocsect1 name="8. Message Translation" url="chapters_8.html#SEC122">
+ <tocsect2 name="8.1 X/Open Message Catalog Handling" url="chapters_8.html#SEC123">
+ <tocsect3 name="8.1.1 The catgets function family" url="chapters_8.html#SEC124"/>
+ <tocsect3 name="8.1.2 Format of the message catalog files" url="chapters_8.html#SEC125"/>
+ <tocsect3 name="8.1.3 Generate Message Catalogs files" url="chapters_8.html#SEC126"/>
+ <tocsect3 name="8.1.4 How to use the catgets interface" url="chapters_8.html#SEC127">
+ <tocsect4 name="8.1.4.1 Not using symbolic names" url="chapters_8.html#SEC128"/>
+ <tocsect4 name="8.1.4.2 Using symbolic names" url="chapters_8.html#SEC129"/>
+ <tocsect4 name="8.1.4.3 How does to this allow to develop" url="chapters_8.html#SEC130"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="8.2 The Uniforum approach to Message Translation" url="chapters_8.html#SEC131">
+ <tocsect3 name="8.2.1 The gettext family of functions" url="chapters_8.html#SEC132">
+ <tocsect4 name="8.2.1.1 What has to be done to translate a message?" url="chapters_8.html#SEC133"/>
+ <tocsect4 name="8.2.1.2 How to determine which catalog to be used" url="chapters_8.html#SEC134"/>
+ <tocsect4 name="8.2.1.3 Additional functions for more complicated situations" url="chapters_8.html#SEC135"/>
+ <tocsect4 name="8.2.1.4 How to specify the output character set gettext uses" url="chapters_8.html#SEC137"/>
+ <tocsect4 name="8.2.1.5 How to use gettext in GUI programs" url="chapters_8.html#SEC138"/>
+ <tocsect4 name="8.2.1.6 User influence on gettext" url="chapters_8.html#SEC139"/>
+ </tocsect3>
+ <tocsect3 name="8.2.2 Programs to handle message catalogs for gettext" url="chapters_8.html#SEC140"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="9. Searching and Sorting" url="chapters_9.html#SEC141">
+ <tocsect2 name="9.1 Defining the Comparison Function" url="chapters_9.html#SEC142"/>
+ <tocsect2 name="9.2 Array Search Function" url="chapters_9.html#SEC143"/>
+ <tocsect2 name="9.3 Array Sort Function" url="chapters_9.html#SEC144"/>
+ <tocsect2 name="9.4 Searching and Sorting Example" url="chapters_9.html#SEC145"/>
+ <tocsect2 name="9.5 The hsearch function." url="chapters_9.html#SEC146"/>
+ <tocsect2 name="9.6 The tsearch function." url="chapters_9.html#SEC147"/>
+</tocsect1>
+<tocsect1 name="10. Pattern Matching" url="chapters_10.html#SEC148">
+ <tocsect2 name="10.1 Wildcard Matching" url="chapters_10.html#SEC149"/>
+ <tocsect2 name="10.2 Globbing" url="chapters_10.html#SEC150">
+ <tocsect3 name="10.2.1 Calling glob" url="chapters_10.html#SEC151"/>
+ <tocsect3 name="10.2.2 Flags for Globbing" url="chapters_10.html#SEC152"/>
+ <tocsect3 name="10.2.3 More Flags for Globbing" url="chapters_10.html#SEC153"/>
+ </tocsect2>
+ <tocsect2 name="10.3 Regular Expression Matching" url="chapters_10.html#SEC154">
+ <tocsect3 name="10.3.1 POSIX Regular Expression Compilation" url="chapters_10.html#SEC155"/>
+ <tocsect3 name="10.3.2 Flags for POSIX Regular Expressions" url="chapters_10.html#SEC156"/>
+ <tocsect3 name="10.3.3 Matching a Compiled POSIX Regular Expression" url="chapters_10.html#SEC157"/>
+ <tocsect3 name="10.3.4 Match Results with Subexpressions" url="chapters_10.html#SEC158"/>
+ <tocsect3 name="10.3.5 Complications in Subexpression Matching" url="chapters_10.html#SEC159"/>
+ <tocsect3 name="10.3.6 POSIX Regexp Matching Cleanup" url="chapters_10.html#SEC160"/>
+ </tocsect2>
+ <tocsect2 name="10.4 Shell-Style Word Expansion" url="chapters_10.html#SEC161">
+ <tocsect3 name="10.4.1 The Stages of Word Expansion" url="chapters_10.html#SEC162"/>
+ <tocsect3 name="10.4.2 Calling wordexp" url="chapters_10.html#SEC163"/>
+ <tocsect3 name="10.4.3 Flags for Word Expansion" url="chapters_10.html#SEC164"/>
+ <tocsect3 name="10.4.4 wordexp Example" url="chapters_10.html#SEC165"/>
+ <tocsect3 name="10.4.5 Details of Tilde Expansion" url="chapters_10.html#SEC166"/>
+ <tocsect3 name="10.4.6 Details of Variable Substitution" url="chapters_10.html#SEC167"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="11. Input/Output Overview" url="chapters_11.html#SEC168">
+ <tocsect2 name="11.1 Input/Output Concepts" url="chapters_11.html#SEC169">
+ <tocsect3 name="11.1.1 Streams and File Descriptors" url="chapters_11.html#SEC170"/>
+ <tocsect3 name="11.1.2 File Position" url="chapters_11.html#SEC171"/>
+ </tocsect2>
+ <tocsect2 name="11.2 File Names" url="chapters_11.html#SEC172">
+ <tocsect3 name="11.2.1 Directories" url="chapters_11.html#SEC173"/>
+ <tocsect3 name="11.2.2 File Name Resolution" url="chapters_11.html#SEC174"/>
+ <tocsect3 name="11.2.3 File Name Errors" url="chapters_11.html#SEC175"/>
+ <tocsect3 name="11.2.4 Portability of File Names" url="chapters_11.html#SEC176"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="12. Input/Output on Streams" url="chapters_12.html#SEC177">
+ <tocsect2 name="12.1 Streams" url="chapters_12.html#SEC178"/>
+ <tocsect2 name="12.2 Standard Streams" url="chapters_12.html#SEC179"/>
+ <tocsect2 name="12.3 Opening Streams" url="chapters_12.html#SEC180"/>
+ <tocsect2 name="12.4 Closing Streams" url="chapters_12.html#SEC181"/>
+ <tocsect2 name="12.5 Streams and Threads" url="chapters_12.html#SEC182"/>
+ <tocsect2 name="12.6 Streams in Internationalized Applications" url="chapters_12.html#SEC183"/>
+ <tocsect2 name="12.7 Simple Output by Characters or Lines" url="chapters_12.html#SEC184"/>
+ <tocsect2 name="12.8 Character Input" url="chapters_12.html#SEC185"/>
+ <tocsect2 name="12.9 Line-Oriented Input" url="chapters_12.html#SEC186"/>
+ <tocsect2 name="12.10 Unreading" url="chapters_12.html#SEC187">
+ <tocsect3 name="12.10.1 What Unreading Means" url="chapters_12.html#SEC188"/>
+ <tocsect3 name="12.10.2 Using ungetc To Do Unreading" url="chapters_12.html#SEC189"/>
+ </tocsect2>
+ <tocsect2 name="12.11 Block Input/Output" url="chapters_12.html#SEC190"/>
+ <tocsect2 name="12.12 Formatted Output" url="chapters_12.html#SEC191">
+ <tocsect3 name="12.12.1 Formatted Output Basics" url="chapters_12.html#SEC192"/>
+ <tocsect3 name="12.12.2 Output Conversion Syntax" url="chapters_12.html#SEC193"/>
+ <tocsect3 name="12.12.3 Table of Output Conversions" url="chapters_12.html#SEC194"/>
+ <tocsect3 name="12.12.4 Integer Conversions" url="chapters_12.html#SEC195"/>
+ <tocsect3 name="12.12.5 Floating-Point Conversions" url="chapters_12.html#SEC196"/>
+ <tocsect3 name="12.12.6 Other Output Conversions" url="chapters_12.html#SEC197"/>
+ <tocsect3 name="12.12.7 Formatted Output Functions" url="chapters_12.html#SEC198"/>
+ <tocsect3 name="12.12.8 Dynamically Allocating Formatted Output" url="chapters_12.html#SEC199"/>
+ <tocsect3 name="12.12.9 Variable Arguments Output Functions" url="chapters_12.html#SEC200"/>
+ <tocsect3 name="12.12.10 Parsing a Template String" url="chapters_12.html#SEC201"/>
+ <tocsect3 name="12.12.11 Example of Parsing a Template String" url="chapters_12.html#SEC202"/>
+ </tocsect2>
+ <tocsect2 name="12.13 Customizing printf" url="chapters_12.html#SEC203">
+ <tocsect3 name="12.13.1 Registering New Conversions" url="chapters_12.html#SEC204"/>
+ <tocsect3 name="12.13.2 Conversion Specifier Options" url="chapters_12.html#SEC205"/>
+ <tocsect3 name="12.13.3 Defining the Output Handler" url="chapters_12.html#SEC206"/>
+ <tocsect3 name="12.13.4 printf Extension Example" url="chapters_12.html#SEC207"/>
+ <tocsect3 name="12.13.5 Predefined printf Handlers" url="chapters_12.html#SEC208"/>
+ </tocsect2>
+ <tocsect2 name="12.14 Formatted Input" url="chapters_12.html#SEC209">
+ <tocsect3 name="12.14.1 Formatted Input Basics" url="chapters_12.html#SEC210"/>
+ <tocsect3 name="12.14.2 Input Conversion Syntax" url="chapters_12.html#SEC211"/>
+ <tocsect3 name="12.14.3 Table of Input Conversions" url="chapters_12.html#SEC212"/>
+ <tocsect3 name="12.14.4 Numeric Input Conversions" url="chapters_12.html#SEC213"/>
+ <tocsect3 name="12.14.5 String Input Conversions" url="chapters_12.html#SEC214"/>
+ <tocsect3 name="12.14.6 Dynamically Allocating String Conversions" url="chapters_12.html#SEC215"/>
+ <tocsect3 name="12.14.7 Other Input Conversions" url="chapters_12.html#SEC216"/>
+ <tocsect3 name="12.14.8 Formatted Input Functions" url="chapters_12.html#SEC217"/>
+ <tocsect3 name="12.14.9 Variable Arguments Input Functions" url="chapters_12.html#SEC218"/>
+ </tocsect2>
+ <tocsect2 name="12.15 End-Of-File and Errors" url="chapters_12.html#SEC219"/>
+ <tocsect2 name="12.16 Recovering from errors" url="chapters_12.html#SEC220"/>
+ <tocsect2 name="12.17 Text and Binary Streams" url="chapters_12.html#SEC221"/>
+ <tocsect2 name="12.18 File Positioning" url="chapters_12.html#SEC222"/>
+ <tocsect2 name="12.19 Portable File-Position Functions" url="chapters_12.html#SEC223"/>
+ <tocsect2 name="12.20 Stream Buffering" url="chapters_12.html#SEC224">
+ <tocsect3 name="12.20.1 Buffering Concepts" url="chapters_12.html#SEC225"/>
+ <tocsect3 name="12.20.2 Flushing Buffers" url="chapters_12.html#SEC226"/>
+ <tocsect3 name="12.20.3 Controlling Which Kind of Buffering" url="chapters_12.html#SEC227"/>
+ </tocsect2>
+ <tocsect2 name="12.21 Other Kinds of Streams" url="chapters_12.html#SEC228">
+ <tocsect3 name="12.21.1 String Streams" url="chapters_12.html#SEC229"/>
+ <tocsect3 name="12.21.2 Obstack Streams" url="chapters_12.html#SEC230"/>
+ <tocsect3 name="12.21.3 Programming Your Own Custom Streams" url="chapters_12.html#SEC231">
+ <tocsect4 name="12.21.3.1 Custom Streams and Cookies" url="chapters_12.html#SEC232"/>
+ <tocsect4 name="12.21.3.2 Custom Stream Hook Functions" url="chapters_12.html#SEC233"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="12.22 Formatted Messages" url="chapters_12.html#SEC234">
+ <tocsect3 name="12.22.1 Printing Formatted Messages" url="chapters_12.html#SEC235"/>
+ <tocsect3 name="12.22.2 Adding Severity Classes" url="chapters_12.html#SEC236"/>
+ <tocsect3 name="12.22.3 How to use fmtmsg and addseverity" url="chapters_12.html#SEC237"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="13. Low-Level Input/Output" url="chapters_13.html#SEC238">
+ <tocsect2 name="13.1 Opening and Closing Files" url="chapters_13.html#SEC239"/>
+ <tocsect2 name="13.2 Input and Output Primitives" url="chapters_13.html#SEC240"/>
+ <tocsect2 name="13.3 Setting the File Position of a Descriptor" url="chapters_13.html#SEC241"/>
+ <tocsect2 name="13.4 Descriptors and Streams" url="chapters_13.html#SEC242"/>
+ <tocsect2 name="13.5 Dangers of Mixing Streams and Descriptors" url="chapters_13.html#SEC243">
+ <tocsect3 name="13.5.1 Linked Channels" url="chapters_13.html#SEC244"/>
+ <tocsect3 name="13.5.2 Independent Channels" url="chapters_13.html#SEC245"/>
+ <tocsect3 name="13.5.3 Cleaning Streams" url="chapters_13.html#SEC246"/>
+ </tocsect2>
+ <tocsect2 name="13.6 Fast Scatter-Gather I/O" url="chapters_13.html#SEC247"/>
+ <tocsect2 name="13.7 Memory-mapped I/O" url="chapters_13.html#SEC248"/>
+ <tocsect2 name="13.8 Waiting for Input or Output" url="chapters_13.html#SEC249"/>
+ <tocsect2 name="13.9 Synchronizing I/O operations" url="chapters_13.html#SEC250"/>
+ <tocsect2 name="13.10 Perform I/O Operations in Parallel" url="chapters_13.html#SEC251">
+ <tocsect3 name="13.10.1 Asynchronous Read and Write Operations" url="chapters_13.html#SEC252"/>
+ <tocsect3 name="13.10.2 Getting the Status of AIO Operations" url="chapters_13.html#SEC253"/>
+ <tocsect3 name="13.10.3 Getting into a Consistent State" url="chapters_13.html#SEC254"/>
+ <tocsect3 name="13.10.4 Cancellation of AIO Operations" url="chapters_13.html#SEC255"/>
+ <tocsect3 name="13.10.5 How to optimize the AIO implementation" url="chapters_13.html#SEC256"/>
+ </tocsect2>
+ <tocsect2 name="13.11 Control Operations on Files" url="chapters_13.html#SEC257"/>
+ <tocsect2 name="13.12 Duplicating Descriptors" url="chapters_13.html#SEC258"/>
+ <tocsect2 name="13.13 File Descriptor Flags" url="chapters_13.html#SEC259"/>
+ <tocsect2 name="13.14 File Status Flags" url="chapters_13.html#SEC260">
+ <tocsect3 name="13.14.1 File Access Modes" url="chapters_13.html#SEC261"/>
+ <tocsect3 name="13.14.2 Open-time Flags" url="chapters_13.html#SEC262"/>
+ <tocsect3 name="13.14.3 I/O Operating Modes" url="chapters_13.html#SEC263"/>
+ <tocsect3 name="13.14.4 Getting and Setting File Status Flags" url="chapters_13.html#SEC264"/>
+ </tocsect2>
+ <tocsect2 name="13.15 File Locks" url="chapters_13.html#SEC265"/>
+ <tocsect2 name="13.16 Interrupt-Driven Input" url="chapters_13.html#SEC266"/>
+ <tocsect2 name="13.17 Generic I/O Control operations" url="chapters_13.html#SEC267"/>
+</tocsect1>
+<tocsect1 name="14. File System Interface" url="chapters_14.html#SEC268">
+ <tocsect2 name="14.1 Working Directory" url="chapters_14.html#SEC269"/>
+ <tocsect2 name="14.2 Accessing Directories" url="chapters_14.html#SEC270">
+ <tocsect3 name="14.2.1 Format of a Directory Entry" url="chapters_14.html#SEC271"/>
+ <tocsect3 name="14.2.2 Opening a Directory Stream" url="chapters_14.html#SEC272"/>
+ <tocsect3 name="14.2.3 Reading and Closing a Directory Stream" url="chapters_14.html#SEC273"/>
+ <tocsect3 name="14.2.4 Simple Program to List a Directory" url="chapters_14.html#SEC274"/>
+ <tocsect3 name="14.2.5 Random Access in a Directory Stream" url="chapters_14.html#SEC275"/>
+ <tocsect3 name="14.2.6 Scanning the Content of a Directory" url="chapters_14.html#SEC276"/>
+ <tocsect3 name="14.2.7 Simple Program to List a Directory, Mark II" url="chapters_14.html#SEC277"/>
+ </tocsect2>
+ <tocsect2 name="14.3 Working with Directory Trees" url="chapters_14.html#SEC278"/>
+ <tocsect2 name="14.4 Hard Links" url="chapters_14.html#SEC279"/>
+ <tocsect2 name="14.5 Symbolic Links" url="chapters_14.html#SEC280"/>
+ <tocsect2 name="14.6 Deleting Files" url="chapters_14.html#SEC281"/>
+ <tocsect2 name="14.7 Renaming Files" url="chapters_14.html#SEC282"/>
+ <tocsect2 name="14.8 Creating Directories" url="chapters_14.html#SEC283"/>
+ <tocsect2 name="14.9 File Attributes" url="chapters_14.html#SEC284">
+ <tocsect3 name="14.9.1 The meaning of the File Attributes" url="chapters_14.html#SEC285"/>
+ <tocsect3 name="14.9.2 Reading the Attributes of a File" url="chapters_14.html#SEC286"/>
+ <tocsect3 name="14.9.3 Testing the Type of a File" url="chapters_14.html#SEC287"/>
+ <tocsect3 name="14.9.4 File Owner" url="chapters_14.html#SEC288"/>
+ <tocsect3 name="14.9.5 The Mode Bits for Access Permission" url="chapters_14.html#SEC289"/>
+ <tocsect3 name="14.9.6 How Your Access to a File is Decided" url="chapters_14.html#SEC290"/>
+ <tocsect3 name="14.9.7 Assigning File Permissions" url="chapters_14.html#SEC291"/>
+ <tocsect3 name="14.9.8 Testing Permission to Access a File" url="chapters_14.html#SEC292"/>
+ <tocsect3 name="14.9.9 File Times" url="chapters_14.html#SEC293"/>
+ <tocsect3 name="14.9.10 File Size" url="chapters_14.html#SEC294"/>
+ </tocsect2>
+ <tocsect2 name="14.10 Making Special Files" url="chapters_14.html#SEC295"/>
+ <tocsect2 name="14.11 Temporary Files" url="chapters_14.html#SEC296"/>
+</tocsect1>
+<tocsect1 name="15. Pipes and FIFOs" url="chapters_15.html#SEC297">
+ <tocsect2 name="15.1 Creating a Pipe" url="chapters_15.html#SEC298"/>
+ <tocsect2 name="15.2 Pipe to a Subprocess" url="chapters_15.html#SEC299"/>
+ <tocsect2 name="15.3 FIFO Special Files" url="chapters_15.html#SEC300"/>
+ <tocsect2 name="15.4 Atomicity of Pipe I/O" url="chapters_15.html#SEC301"/>
+</tocsect1>
+<tocsect1 name="16. Sockets" url="chapters_16.html#SEC302">
+ <tocsect2 name="16.1 Socket Concepts" url="chapters_16.html#SEC303"/>
+ <tocsect2 name="16.2 Communication Styles" url="chapters_16.html#SEC304"/>
+ <tocsect2 name="16.3 Socket Addresses" url="chapters_16.html#SEC305">
+ <tocsect3 name="16.3.1 Address Formats" url="chapters_16.html#SEC306"/>
+ <tocsect3 name="16.3.2 Setting the Address of a Socket" url="chapters_16.html#SEC307"/>
+ <tocsect3 name="16.3.3 Reading the Address of a Socket" url="chapters_16.html#SEC308"/>
+ </tocsect2>
+ <tocsect2 name="16.4 Interface Naming" url="chapters_16.html#SEC309"/>
+ <tocsect2 name="16.5 The Local Namespace" url="chapters_16.html#SEC310">
+ <tocsect3 name="16.5.1 Local Namespace Concepts" url="chapters_16.html#SEC311"/>
+ <tocsect3 name="16.5.2 Details of Local Namespace" url="chapters_16.html#SEC312"/>
+ <tocsect3 name="16.5.3 Example of Local-Namespace Sockets" url="chapters_16.html#SEC313"/>
+ </tocsect2>
+ <tocsect2 name="16.6 The Internet Namespace" url="chapters_16.html#SEC314">
+ <tocsect3 name="16.6.1 Internet Socket Address Formats" url="chapters_16.html#SEC315"/>
+ <tocsect3 name="16.6.2 Host Addresses" url="chapters_16.html#SEC316">
+ <tocsect4 name="16.6.2.1 Internet Host Addresses" url="chapters_16.html#SEC317"/>
+ <tocsect4 name="16.6.2.2 Host Address Data Type" url="chapters_16.html#SEC320"/>
+ <tocsect4 name="16.6.2.3 Host Address Functions" url="chapters_16.html#SEC321"/>
+ <tocsect4 name="16.6.2.4 Host Names" url="chapters_16.html#SEC322"/>
+ </tocsect3>
+ <tocsect3 name="16.6.3 Internet Ports" url="chapters_16.html#SEC323"/>
+ <tocsect3 name="16.6.4 The Services Database" url="chapters_16.html#SEC324"/>
+ <tocsect3 name="16.6.5 Byte Order Conversion" url="chapters_16.html#SEC325"/>
+ <tocsect3 name="16.6.6 Protocols Database" url="chapters_16.html#SEC326"/>
+ <tocsect3 name="16.6.7 Internet Socket Example" url="chapters_16.html#SEC327"/>
+ </tocsect2>
+ <tocsect2 name="16.7 Other Namespaces" url="chapters_16.html#SEC328"/>
+ <tocsect2 name="16.8 Opening and Closing Sockets" url="chapters_16.html#SEC329">
+ <tocsect3 name="16.8.1 Creating a Socket" url="chapters_16.html#SEC330"/>
+ <tocsect3 name="16.8.2 Closing a Socket" url="chapters_16.html#SEC331"/>
+ <tocsect3 name="16.8.3 Socket Pairs" url="chapters_16.html#SEC332"/>
+ </tocsect2>
+ <tocsect2 name="16.9 Using Sockets with Connections" url="chapters_16.html#SEC333">
+ <tocsect3 name="16.9.1 Making a Connection" url="chapters_16.html#SEC334"/>
+ <tocsect3 name="16.9.2 Listening for Connections" url="chapters_16.html#SEC335"/>
+ <tocsect3 name="16.9.3 Accepting Connections" url="chapters_16.html#SEC336"/>
+ <tocsect3 name="16.9.4 Who is Connected to Me?" url="chapters_16.html#SEC337"/>
+ <tocsect3 name="16.9.5 Transferring Data" url="chapters_16.html#SEC338">
+ <tocsect4 name="16.9.5.1 Sending Data" url="chapters_16.html#SEC339"/>
+ <tocsect4 name="16.9.5.2 Receiving Data" url="chapters_16.html#SEC340"/>
+ <tocsect4 name="16.9.5.3 Socket Data Options" url="chapters_16.html#SEC341"/>
+ </tocsect3>
+ <tocsect3 name="16.9.6 Byte Stream Socket Example" url="chapters_16.html#SEC342"/>
+ <tocsect3 name="16.9.7 Byte Stream Connection Server Example" url="chapters_16.html#SEC343"/>
+ <tocsect3 name="16.9.8 Out-of-Band Data" url="chapters_16.html#SEC344"/>
+ </tocsect2>
+ <tocsect2 name="16.10 Datagram Socket Operations" url="chapters_16.html#SEC345">
+ <tocsect3 name="16.10.1 Sending Datagrams" url="chapters_16.html#SEC346"/>
+ <tocsect3 name="16.10.2 Receiving Datagrams" url="chapters_16.html#SEC347"/>
+ <tocsect3 name="16.10.3 Datagram Socket Example" url="chapters_16.html#SEC348"/>
+ <tocsect3 name="16.10.4 Example of Reading Datagrams" url="chapters_16.html#SEC349"/>
+ </tocsect2>
+ <tocsect2 name="16.11 The inetd Daemon" url="chapters_16.html#SEC350">
+ <tocsect3 name="16.11.1 inetd Servers" url="chapters_16.html#SEC351"/>
+ <tocsect3 name="16.11.2 Configuring inetd" url="chapters_16.html#SEC352"/>
+ </tocsect2>
+ <tocsect2 name="16.12 Socket Options" url="chapters_16.html#SEC353">
+ <tocsect3 name="16.12.1 Socket Option Functions" url="chapters_16.html#SEC354"/>
+ <tocsect3 name="16.12.2 Socket-Level Options" url="chapters_16.html#SEC355"/>
+ </tocsect2>
+ <tocsect2 name="16.13 Networks Database" url="chapters_16.html#SEC356"/>
+</tocsect1>
+<tocsect1 name="17. Low-Level Terminal Interface" url="chapters_17.html#SEC357">
+ <tocsect2 name="17.1 Identifying Terminals" url="chapters_17.html#SEC358"/>
+ <tocsect2 name="17.2 I/O Queues" url="chapters_17.html#SEC359"/>
+ <tocsect2 name="17.3 Two Styles of Input: Canonical or Not" url="chapters_17.html#SEC360"/>
+ <tocsect2 name="17.4 Terminal Modes" url="chapters_17.html#SEC361">
+ <tocsect3 name="17.4.1 Terminal Mode Data Types" url="chapters_17.html#SEC362"/>
+ <tocsect3 name="17.4.2 Terminal Mode Functions" url="chapters_17.html#SEC363"/>
+ <tocsect3 name="17.4.3 Setting Terminal Modes Properly" url="chapters_17.html#SEC364"/>
+ <tocsect3 name="17.4.4 Input Modes" url="chapters_17.html#SEC365"/>
+ <tocsect3 name="17.4.5 Output Modes" url="chapters_17.html#SEC366"/>
+ <tocsect3 name="17.4.6 Control Modes" url="chapters_17.html#SEC367"/>
+ <tocsect3 name="17.4.7 Local Modes" url="chapters_17.html#SEC368"/>
+ <tocsect3 name="17.4.8 Line Speed" url="chapters_17.html#SEC369"/>
+ <tocsect3 name="17.4.9 Special Characters" url="chapters_17.html#SEC370">
+ <tocsect4 name="17.4.9.1 Characters for Input Editing" url="chapters_17.html#SEC371"/>
+ <tocsect4 name="17.4.9.2 Characters that Cause Signals" url="chapters_17.html#SEC372"/>
+ <tocsect4 name="17.4.9.3 Special Characters for Flow Control" url="chapters_17.html#SEC373"/>
+ <tocsect4 name="17.4.9.4 Other Special Characters" url="chapters_17.html#SEC374"/>
+ </tocsect3>
+ <tocsect3 name="17.4.10 Noncanonical Input" url="chapters_17.html#SEC375"/>
+ </tocsect2>
+ <tocsect2 name="17.5 BSD Terminal Modes" url="chapters_17.html#SEC376"/>
+ <tocsect2 name="17.6 Line Control Functions" url="chapters_17.html#SEC377"/>
+ <tocsect2 name="17.7 Noncanonical Mode Example" url="chapters_17.html#SEC378"/>
+ <tocsect2 name="17.8 Pseudo-Terminals" url="chapters_17.html#SEC379">
+ <tocsect3 name="17.8.1 Allocating Pseudo-Terminals" url="chapters_17.html#SEC380"/>
+ <tocsect3 name="17.8.2 Opening a Pseudo-Terminal Pair" url="chapters_17.html#SEC381"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="18. Syslog" url="chapters_18.html#SEC382">
+ <tocsect2 name="18.1 Overview of Syslog" url="chapters_18.html#SEC383"/>
+ <tocsect2 name="18.2 Submitting Syslog Messages" url="chapters_18.html#SEC384">
+ <tocsect3 name="18.2.1 openlog" url="chapters_18.html#SEC385"/>
+ <tocsect3 name="18.2.2 syslog, vsyslog" url="chapters_18.html#SEC386"/>
+ <tocsect3 name="18.2.3 closelog" url="chapters_18.html#SEC387"/>
+ <tocsect3 name="18.2.4 setlogmask" url="chapters_18.html#SEC388"/>
+ <tocsect3 name="18.2.5 Syslog Example" url="chapters_18.html#SEC389"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="19. Mathematics" url="chapters_19.html#SEC390">
+ <tocsect2 name="19.1 Predefined Mathematical Constants" url="chapters_19.html#SEC391"/>
+ <tocsect2 name="19.2 Trigonometric Functions" url="chapters_19.html#SEC392"/>
+ <tocsect2 name="19.3 Inverse Trigonometric Functions" url="chapters_19.html#SEC393"/>
+ <tocsect2 name="19.4 Exponentiation and Logarithms" url="chapters_19.html#SEC394"/>
+ <tocsect2 name="19.5 Hyperbolic Functions" url="chapters_19.html#SEC395"/>
+ <tocsect2 name="19.6 Special Functions" url="chapters_19.html#SEC396"/>
+ <tocsect2 name="19.7 Known Maximum Errors in Math Functions" url="chapters_19.html#SEC397"/>
+ <tocsect2 name="19.8 Pseudo-Random Numbers" url="chapters_19.html#SEC398">
+ <tocsect3 name="19.8.1 ISO C Random Number Functions" url="chapters_19.html#SEC399"/>
+ <tocsect3 name="19.8.2 BSD Random Number Functions" url="chapters_19.html#SEC400"/>
+ <tocsect3 name="19.8.3 SVID Random Number Function" url="chapters_19.html#SEC401"/>
+ </tocsect2>
+ <tocsect2 name="19.9 Is Fast Code or Small Code preferred?" url="chapters_19.html#SEC402"/>
+</tocsect1>
+<tocsect1 name="20. Arithmetic Functions" url="chapters_20.html#SEC403">
+ <tocsect2 name="20.1 Integers" url="chapters_20.html#SEC404"/>
+ <tocsect2 name="20.2 Integer Division" url="chapters_20.html#SEC405"/>
+ <tocsect2 name="20.3 Floating Point Numbers" url="chapters_20.html#SEC406"/>
+ <tocsect2 name="20.4 Floating-Point Number Classification Functions" url="chapters_20.html#SEC407"/>
+ <tocsect2 name="20.5 Errors in Floating-Point Calculations" url="chapters_20.html#SEC408">
+ <tocsect3 name="20.5.1 FP Exceptions" url="chapters_20.html#SEC409"/>
+ <tocsect3 name="20.5.2 Infinity and NaN" url="chapters_20.html#SEC410"/>
+ <tocsect3 name="20.5.3 Examining the FPU status word" url="chapters_20.html#SEC411"/>
+ <tocsect3 name="20.5.4 Error Reporting by Mathematical Functions" url="chapters_20.html#SEC412"/>
+ </tocsect2>
+ <tocsect2 name="20.6 Rounding Modes" url="chapters_20.html#SEC413"/>
+ <tocsect2 name="20.7 Floating-Point Control Functions" url="chapters_20.html#SEC414"/>
+ <tocsect2 name="20.8 Arithmetic Functions" url="chapters_20.html#SEC415">
+ <tocsect3 name="20.8.1 Absolute Value" url="chapters_20.html#SEC416"/>
+ <tocsect3 name="20.8.2 Normalization Functions" url="chapters_20.html#SEC417"/>
+ <tocsect3 name="20.8.3 Rounding Functions" url="chapters_20.html#SEC418"/>
+ <tocsect3 name="20.8.4 Remainder Functions" url="chapters_20.html#SEC419"/>
+ <tocsect3 name="20.8.5 Setting and modifying single bits of FP values" url="chapters_20.html#SEC420"/>
+ <tocsect3 name="20.8.6 Floating-Point Comparison Functions" url="chapters_20.html#SEC421"/>
+ <tocsect3 name="20.8.7 Miscellaneous FP arithmetic functions" url="chapters_20.html#SEC422"/>
+ </tocsect2>
+ <tocsect2 name="20.9 Complex Numbers" url="chapters_20.html#SEC423"/>
+ <tocsect2 name="20.10 Projections, Conjugates, and Decomposing of Complex Numbers" url="chapters_20.html#SEC424"/>
+ <tocsect2 name="20.11 Parsing of Numbers" url="chapters_20.html#SEC425">
+ <tocsect3 name="20.11.1 Parsing of Integers" url="chapters_20.html#SEC426"/>
+ <tocsect3 name="20.11.2 Parsing of Floats" url="chapters_20.html#SEC427"/>
+ </tocsect2>
+ <tocsect2 name="20.12 Old-fashioned System V number-to-string functions" url="chapters_20.html#SEC428"/>
+</tocsect1>
+<tocsect1 name="21. Date and Time" url="chapters_21.html#SEC429">
+ <tocsect2 name="21.1 Time Basics" url="chapters_21.html#SEC430"/>
+ <tocsect2 name="21.2 Elapsed Time" url="chapters_21.html#SEC431"/>
+ <tocsect2 name="21.3 Processor And CPU Time" url="chapters_21.html#SEC432">
+ <tocsect3 name="21.3.1 CPU Time Inquiry" url="chapters_21.html#SEC433"/>
+ <tocsect3 name="21.3.2 Processor Time Inquiry" url="chapters_21.html#SEC434"/>
+ </tocsect2>
+ <tocsect2 name="21.4 Calendar Time" url="chapters_21.html#SEC435">
+ <tocsect3 name="21.4.1 Simple Calendar Time" url="chapters_21.html#SEC436"/>
+ <tocsect3 name="21.4.2 High-Resolution Calendar" url="chapters_21.html#SEC437"/>
+ <tocsect3 name="21.4.3 Broken-down Time" url="chapters_21.html#SEC438"/>
+ <tocsect3 name="21.4.4 High Accuracy Clock" url="chapters_21.html#SEC439"/>
+ <tocsect3 name="21.4.5 Formatting Calendar Time" url="chapters_21.html#SEC440"/>
+ <tocsect3 name="21.4.6 Convert textual time and date information back" url="chapters_21.html#SEC441">
+ <tocsect4 name="21.4.6.1 Interpret string according to given format" url="chapters_21.html#SEC442"/>
+ <tocsect4 name="21.4.6.2 A More User-friendly Way to Parse Times and Dates" url="chapters_21.html#SEC443"/>
+ </tocsect3>
+ <tocsect3 name="21.4.7 Specifying the Time Zone with TZ" url="chapters_21.html#SEC444"/>
+ <tocsect3 name="21.4.8 Functions and Variables for Time Zones" url="chapters_21.html#SEC445"/>
+ <tocsect3 name="21.4.9 Time Functions Example" url="chapters_21.html#SEC446"/>
+ </tocsect2>
+ <tocsect2 name="21.5 Setting an Alarm" url="chapters_21.html#SEC447"/>
+ <tocsect2 name="21.6 Sleeping" url="chapters_21.html#SEC448"/>
+</tocsect1>
+<tocsect1 name="22. Resource Usage And Limitation" url="chapters_22.html#SEC449">
+ <tocsect2 name="22.1 Resource Usage" url="chapters_22.html#SEC450"/>
+ <tocsect2 name="22.2 Limiting Resource Usage" url="chapters_22.html#SEC451"/>
+ <tocsect2 name="22.3 Process CPU Priority And Scheduling" url="chapters_22.html#SEC452">
+ <tocsect3 name="22.3.1 Absolute Priority" url="chapters_22.html#SEC453">
+ <tocsect4 name="22.3.1.1 Using Absolute Priority" url="chapters_22.html#SEC454"/>
+ </tocsect3>
+ <tocsect3 name="22.3.2 Realtime Scheduling" url="chapters_22.html#SEC455"/>
+ <tocsect3 name="22.3.3 Basic Scheduling Functions" url="chapters_22.html#SEC456"/>
+ <tocsect3 name="22.3.4 Traditional Scheduling" url="chapters_22.html#SEC457">
+ <tocsect4 name="22.3.4.1 Introduction To Traditional Scheduling" url="chapters_22.html#SEC458"/>
+ <tocsect4 name="22.3.4.2 Functions For Traditional Scheduling" url="chapters_22.html#SEC459"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="22.4 Querying memory available resources" url="chapters_22.html#SEC460">
+ <tocsect3 name="22.4.1 Overview about traditional Unix memory handling" url="chapters_22.html#SEC461"/>
+ <tocsect3 name="22.4.2 How to get information about the memory subsystem?" url="chapters_22.html#SEC462"/>
+ </tocsect2>
+ <tocsect2 name="22.5 Learn about the processors available" url="chapters_22.html#SEC463"/>
+</tocsect1>
+<tocsect1 name="23. Non-Local Exits" url="chapters_23.html#SEC464">
+ <tocsect2 name="23.1 Introduction to Non-Local Exits" url="chapters_23.html#SEC465"/>
+ <tocsect2 name="23.2 Details of Non-Local Exits" url="chapters_23.html#SEC466"/>
+ <tocsect2 name="23.3 Non-Local Exits and Signals" url="chapters_23.html#SEC467"/>
+ <tocsect2 name="23.4 Complete Context Control" url="chapters_23.html#SEC468"/>
+</tocsect1>
+<tocsect1 name="24. Signal Handling" url="chapters_24.html#SEC470">
+ <tocsect2 name="24.1 Basic Concepts of Signals" url="chapters_24.html#SEC471">
+ <tocsect3 name="24.1.1 Some Kinds of Signals" url="chapters_24.html#SEC472"/>
+ <tocsect3 name="24.1.2 Concepts of Signal Generation" url="chapters_24.html#SEC473"/>
+ <tocsect3 name="24.1.3 How Signals Are Delivered" url="chapters_24.html#SEC474"/>
+ </tocsect2>
+ <tocsect2 name="24.2 Standard Signals" url="chapters_24.html#SEC475">
+ <tocsect3 name="24.2.1 Program Error Signals" url="chapters_24.html#SEC476"/>
+ <tocsect3 name="24.2.2 Termination Signals" url="chapters_24.html#SEC477"/>
+ <tocsect3 name="24.2.3 Alarm Signals" url="chapters_24.html#SEC478"/>
+ <tocsect3 name="24.2.4 Asynchronous I/O Signals" url="chapters_24.html#SEC479"/>
+ <tocsect3 name="24.2.5 Job Control Signals" url="chapters_24.html#SEC480"/>
+ <tocsect3 name="24.2.6 Operation Error Signals" url="chapters_24.html#SEC481"/>
+ <tocsect3 name="24.2.7 Miscellaneous Signals" url="chapters_24.html#SEC482"/>
+ <tocsect3 name="24.2.8 Signal Messages" url="chapters_24.html#SEC483"/>
+ </tocsect2>
+ <tocsect2 name="24.3 Specifying Signal Actions" url="chapters_24.html#SEC484">
+ <tocsect3 name="24.3.1 Basic Signal Handling" url="chapters_24.html#SEC485"/>
+ <tocsect3 name="24.3.2 Advanced Signal Handling" url="chapters_24.html#SEC486"/>
+ <tocsect3 name="24.3.3 Interaction of signal and sigaction" url="chapters_24.html#SEC487"/>
+ <tocsect3 name="24.3.4 sigaction Function Example" url="chapters_24.html#SEC488"/>
+ <tocsect3 name="24.3.5 Flags for sigaction" url="chapters_24.html#SEC489"/>
+ <tocsect3 name="24.3.6 Initial Signal Actions" url="chapters_24.html#SEC490"/>
+ </tocsect2>
+ <tocsect2 name="24.4 Defining Signal Handlers" url="chapters_24.html#SEC491">
+ <tocsect3 name="24.4.1 Signal Handlers that Return" url="chapters_24.html#SEC492"/>
+ <tocsect3 name="24.4.2 Handlers That Terminate the Process" url="chapters_24.html#SEC493"/>
+ <tocsect3 name="24.4.3 Nonlocal Control Transfer in Handlers" url="chapters_24.html#SEC494"/>
+ <tocsect3 name="24.4.4 Signals Arriving While a Handler Runs" url="chapters_24.html#SEC495"/>
+ <tocsect3 name="24.4.5 Signals Close Together Merge into One" url="chapters_24.html#SEC496"/>
+ <tocsect3 name="24.4.6 Signal Handling and Nonreentrant Functions" url="chapters_24.html#SEC497"/>
+ <tocsect3 name="24.4.7 Atomic Data Access and Signal Handling" url="chapters_24.html#SEC498">
+ <tocsect4 name="24.4.7.1 Problems with Non-Atomic Access" url="chapters_24.html#SEC499"/>
+ <tocsect4 name="24.4.7.2 Atomic Types" url="chapters_24.html#SEC500"/>
+ <tocsect4 name="24.4.7.3 Atomic Usage Patterns" url="chapters_24.html#SEC501"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="24.5 Primitives Interrupted by Signals" url="chapters_24.html#SEC502"/>
+ <tocsect2 name="24.6 Generating Signals" url="chapters_24.html#SEC503">
+ <tocsect3 name="24.6.1 Signaling Yourself" url="chapters_24.html#SEC504"/>
+ <tocsect3 name="24.6.2 Signaling Another Process" url="chapters_24.html#SEC505"/>
+ <tocsect3 name="24.6.3 Permission for using kill" url="chapters_24.html#SEC506"/>
+ <tocsect3 name="24.6.4 Using kill for Communication" url="chapters_24.html#SEC507"/>
+ </tocsect2>
+ <tocsect2 name="24.7 Blocking Signals" url="chapters_24.html#SEC508">
+ <tocsect3 name="24.7.1 Why Blocking Signals is Useful" url="chapters_24.html#SEC509"/>
+ <tocsect3 name="24.7.2 Signal Sets" url="chapters_24.html#SEC510"/>
+ <tocsect3 name="24.7.3 Process Signal Mask" url="chapters_24.html#SEC511"/>
+ <tocsect3 name="24.7.4 Blocking to Test for Delivery of a Signal" url="chapters_24.html#SEC512"/>
+ <tocsect3 name="24.7.5 Blocking Signals for a Handler" url="chapters_24.html#SEC513"/>
+ <tocsect3 name="24.7.6 Checking for Pending Signals" url="chapters_24.html#SEC514"/>
+ <tocsect3 name="24.7.7 Remembering a Signal to Act On Later" url="chapters_24.html#SEC515"/>
+ </tocsect2>
+ <tocsect2 name="24.8 Waiting for a Signal" url="chapters_24.html#SEC516">
+ <tocsect3 name="24.8.1 Using pause" url="chapters_24.html#SEC517"/>
+ <tocsect3 name="24.8.2 Problems with pause" url="chapters_24.html#SEC518"/>
+ <tocsect3 name="24.8.3 Using sigsuspend" url="chapters_24.html#SEC519"/>
+ </tocsect2>
+ <tocsect2 name="24.9 Using a Separate Signal Stack" url="chapters_24.html#SEC520"/>
+ <tocsect2 name="24.10 BSD Signal Handling" url="chapters_24.html#SEC521">
+ <tocsect3 name="24.10.1 BSD Function to Establish a Handler" url="chapters_24.html#SEC522"/>
+ <tocsect3 name="24.10.2 BSD Functions for Blocking Signals" url="chapters_24.html#SEC523"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="25. The Basic Program/System Interface" url="chapters_25.html#SEC524">
+ <tocsect2 name="25.1 Program Arguments" url="chapters_25.html#SEC525">
+ <tocsect3 name="25.1.1 Program Argument Syntax Conventions" url="chapters_25.html#SEC526"/>
+ <tocsect3 name="25.1.2 Parsing Program Arguments" url="chapters_25.html#SEC527"/>
+ </tocsect2>
+ <tocsect2 name="25.2 Parsing program options using getopt" url="chapters_25.html#SEC528">
+ <tocsect3 name="25.2.1 Using the getopt function" url="chapters_25.html#SEC529"/>
+ <tocsect3 name="25.2.2 Example of Parsing Arguments with getopt" url="chapters_25.html#SEC530"/>
+ <tocsect3 name="25.2.3 Parsing Long Options with getopt_long" url="chapters_25.html#SEC531"/>
+ <tocsect3 name="25.2.4 Example of Parsing Long Options with getopt_long" url="chapters_25.html#SEC532"/>
+ </tocsect2>
+ <tocsect2 name="25.3 Parsing Program Options with Argp" url="chapters_25.html#SEC533">
+ <tocsect3 name="25.3.1 The argp_parse Function" url="chapters_25.html#SEC534"/>
+ <tocsect3 name="25.3.2 Argp Global Variables" url="chapters_25.html#SEC535"/>
+ <tocsect3 name="25.3.3 Specifying Argp Parsers" url="chapters_25.html#SEC536"/>
+ <tocsect3 name="25.3.4 Specifying Options in an Argp Parser" url="chapters_25.html#SEC537">
+ <tocsect4 name="25.3.4.1 Flags for Argp Options" url="chapters_25.html#SEC538"/>
+ </tocsect3>
+ <tocsect3 name="25.3.5 Argp Parser Functions" url="chapters_25.html#SEC539">
+ <tocsect4 name="25.3.5.1 Special Keys for Argp Parser Functions" url="chapters_25.html#SEC540"/>
+ <tocsect4 name="25.3.5.2 Functions For Use in Argp Parsers" url="chapters_25.html#SEC541"/>
+ <tocsect4 name="25.3.5.3 Argp Parsing State" url="chapters_25.html#SEC542"/>
+ </tocsect3>
+ <tocsect3 name="25.3.6 Combining Multiple Argp Parsers" url="chapters_25.html#SEC543"/>
+ <tocsect3 name="25.3.7 Flags for argp_parse" url="chapters_25.html#SEC544"/>
+ <tocsect3 name="25.3.8 Customizing Argp Help Output" url="chapters_25.html#SEC545">
+ <tocsect4 name="25.3.8.1 Special Keys for Argp Help Filter Functions" url="chapters_25.html#SEC546"/>
+ </tocsect3>
+ <tocsect3 name="25.3.9 The argp_help Function" url="chapters_25.html#SEC547"/>
+ <tocsect3 name="25.3.10 Flags for the argp_help Function" url="chapters_25.html#SEC548"/>
+ <tocsect3 name="25.3.11 Argp Examples" url="chapters_25.html#SEC549">
+ <tocsect4 name="25.3.11.1 A Minimal Program Using Argp" url="chapters_25.html#SEC550"/>
+ <tocsect4 name="25.3.11.2 A Program Using Argp with Only Default Options" url="chapters_25.html#SEC551"/>
+ <tocsect4 name="25.3.11.3 A Program Using Argp with User Options" url="chapters_25.html#SEC552"/>
+ <tocsect4 name="25.3.11.4 A Program Using Multiple Combined Argp Parsers" url="chapters_25.html#SEC553"/>
+ </tocsect3>
+ <tocsect3 name="25.3.12 Argp User Customization" url="chapters_25.html#SEC554">
+ <tocsect4 name="25.3.12.1 Parsing of Suboptions" url="chapters_25.html#SEC555"/>
+ </tocsect3>
+ <tocsect3 name="25.3.13 Parsing of Suboptions Example" url="chapters_25.html#SEC556"/>
+ </tocsect2>
+ <tocsect2 name="25.4 Environment Variables" url="chapters_25.html#SEC557">
+ <tocsect3 name="25.4.1 Environment Access" url="chapters_25.html#SEC558"/>
+ <tocsect3 name="25.4.2 Standard Environment Variables" url="chapters_25.html#SEC559"/>
+ </tocsect2>
+ <tocsect2 name="25.5 System Calls" url="chapters_25.html#SEC560"/>
+ <tocsect2 name="25.6 Program Termination" url="chapters_25.html#SEC561">
+ <tocsect3 name="25.6.1 Normal Termination" url="chapters_25.html#SEC562"/>
+ <tocsect3 name="25.6.2 Exit Status" url="chapters_25.html#SEC563"/>
+ <tocsect3 name="25.6.3 Cleanups on Exit" url="chapters_25.html#SEC564"/>
+ <tocsect3 name="25.6.4 Aborting a Program" url="chapters_25.html#SEC565"/>
+ <tocsect3 name="25.6.5 Termination Internals" url="chapters_25.html#SEC566"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="26. Processes" url="chapters_26.html#SEC567">
+ <tocsect2 name="26.1 Running a Command" url="chapters_26.html#SEC568"/>
+ <tocsect2 name="26.2 Process Creation Concepts" url="chapters_26.html#SEC569"/>
+ <tocsect2 name="26.3 Process Identification" url="chapters_26.html#SEC570"/>
+ <tocsect2 name="26.4 Creating a Process" url="chapters_26.html#SEC571"/>
+ <tocsect2 name="26.5 Executing a File" url="chapters_26.html#SEC572"/>
+ <tocsect2 name="26.6 Process Completion" url="chapters_26.html#SEC573"/>
+ <tocsect2 name="26.7 Process Completion Status" url="chapters_26.html#SEC574"/>
+ <tocsect2 name="26.8 BSD Process Wait Functions" url="chapters_26.html#SEC575"/>
+ <tocsect2 name="26.9 Process Creation Example" url="chapters_26.html#SEC576"/>
+</tocsect1>
+<tocsect1 name="27. Job Control" url="chapters_27.html#SEC577">
+ <tocsect2 name="27.1 Concepts of Job Control" url="chapters_27.html#SEC578"/>
+ <tocsect2 name="27.2 Job Control is Optional" url="chapters_27.html#SEC579"/>
+ <tocsect2 name="27.3 Controlling Terminal of a Process" url="chapters_27.html#SEC580"/>
+ <tocsect2 name="27.4 Access to the Controlling Terminal" url="chapters_27.html#SEC581"/>
+ <tocsect2 name="27.5 Orphaned Process Groups" url="chapters_27.html#SEC582"/>
+ <tocsect2 name="27.6 Implementing a Job Control Shell" url="chapters_27.html#SEC583">
+ <tocsect3 name="27.6.1 Data Structures for the Shell" url="chapters_27.html#SEC584"/>
+ <tocsect3 name="27.6.2 Initializing the Shell" url="chapters_27.html#SEC585"/>
+ <tocsect3 name="27.6.3 Launching Jobs" url="chapters_27.html#SEC586"/>
+ <tocsect3 name="27.6.4 Foreground and Background" url="chapters_27.html#SEC587"/>
+ <tocsect3 name="27.6.5 Stopped and Terminated Jobs" url="chapters_27.html#SEC588"/>
+ <tocsect3 name="27.6.6 Continuing Stopped Jobs" url="chapters_27.html#SEC589"/>
+ <tocsect3 name="27.6.7 The Missing Pieces" url="chapters_27.html#SEC590"/>
+ </tocsect2>
+ <tocsect2 name="27.7 Functions for Job Control" url="chapters_27.html#SEC591">
+ <tocsect3 name="27.7.1 Identifying the Controlling Terminal" url="chapters_27.html#SEC592"/>
+ <tocsect3 name="27.7.2 Process Group Functions" url="chapters_27.html#SEC593"/>
+ <tocsect3 name="27.7.3 Functions for Controlling Terminal Access" url="chapters_27.html#SEC594"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="28. System Databases and Name Service Switch" url="chapters_28.html#SEC595">
+ <tocsect2 name="28.1 NSS Basics" url="chapters_28.html#SEC596"/>
+ <tocsect2 name="28.2 The NSS Configuration File" url="chapters_28.html#SEC597">
+ <tocsect3 name="28.2.1 Services in the NSS configuration File" url="chapters_28.html#SEC598"/>
+ <tocsect3 name="28.2.2 Actions in the NSS configuration" url="chapters_28.html#SEC599"/>
+ <tocsect3 name="28.2.3 Notes on the NSS Configuration File" url="chapters_28.html#SEC600"/>
+ </tocsect2>
+ <tocsect2 name="28.3 NSS Module Internals" url="chapters_28.html#SEC601">
+ <tocsect3 name="28.3.1 The Naming Scheme of the NSS Modules" url="chapters_28.html#SEC602"/>
+ <tocsect3 name="28.3.2 The Interface of the Function in NSS Modules" url="chapters_28.html#SEC603"/>
+ </tocsect2>
+ <tocsect2 name="28.4 Extending NSS" url="chapters_28.html#SEC604">
+ <tocsect3 name="28.4.1 Adding another Service to NSS" url="chapters_28.html#SEC605"/>
+ <tocsect3 name="28.4.2 Internals of the NSS Module Functions" url="chapters_28.html#SEC606"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="29. Users and Groups" url="chapters_29.html#SEC607">
+ <tocsect2 name="29.1 User and Group IDs" url="chapters_29.html#SEC608"/>
+ <tocsect2 name="29.2 The Persona of a Process" url="chapters_29.html#SEC609"/>
+ <tocsect2 name="29.3 Why Change the Persona of a Process?" url="chapters_29.html#SEC610"/>
+ <tocsect2 name="29.4 How an Application Can Change Persona" url="chapters_29.html#SEC611"/>
+ <tocsect2 name="29.5 Reading the Persona of a Process" url="chapters_29.html#SEC612"/>
+ <tocsect2 name="29.6 Setting the User ID" url="chapters_29.html#SEC613"/>
+ <tocsect2 name="29.7 Setting the Group IDs" url="chapters_29.html#SEC614"/>
+ <tocsect2 name="29.8 Enabling and Disabling Setuid Access" url="chapters_29.html#SEC615"/>
+ <tocsect2 name="29.9 Setuid Program Example" url="chapters_29.html#SEC616"/>
+ <tocsect2 name="29.10 Tips for Writing Setuid Programs" url="chapters_29.html#SEC617"/>
+ <tocsect2 name="29.11 Identifying Who Logged In" url="chapters_29.html#SEC618"/>
+ <tocsect2 name="29.12 The User Accounting Database" url="chapters_29.html#SEC619">
+ <tocsect3 name="29.12.1 Manipulating the User Accounting Database" url="chapters_29.html#SEC620"/>
+ <tocsect3 name="29.12.2 XPG User Accounting Database Functions" url="chapters_29.html#SEC621"/>
+ <tocsect3 name="29.12.3 Logging In and Out" url="chapters_29.html#SEC622"/>
+ </tocsect2>
+ <tocsect2 name="29.13 User Database" url="chapters_29.html#SEC623">
+ <tocsect3 name="29.13.1 The Data Structure that Describes a User" url="chapters_29.html#SEC624"/>
+ <tocsect3 name="29.13.2 Looking Up One User" url="chapters_29.html#SEC625"/>
+ <tocsect3 name="29.13.3 Scanning the List of All Users" url="chapters_29.html#SEC626"/>
+ <tocsect3 name="29.13.4 Writing a User Entry" url="chapters_29.html#SEC627"/>
+ </tocsect2>
+ <tocsect2 name="29.14 Group Database" url="chapters_29.html#SEC628">
+ <tocsect3 name="29.14.1 The Data Structure for a Group" url="chapters_29.html#SEC629"/>
+ <tocsect3 name="29.14.2 Looking Up One Group" url="chapters_29.html#SEC630"/>
+ <tocsect3 name="29.14.3 Scanning the List of All Groups" url="chapters_29.html#SEC631"/>
+ </tocsect2>
+ <tocsect2 name="29.15 User and Group Database Example" url="chapters_29.html#SEC632"/>
+ <tocsect2 name="29.16 Netgroup Database" url="chapters_29.html#SEC633">
+ <tocsect3 name="29.16.1 Netgroup Data" url="chapters_29.html#SEC634"/>
+ <tocsect3 name="29.16.2 Looking up one Netgroup" url="chapters_29.html#SEC635"/>
+ <tocsect3 name="29.16.3 Testing for Netgroup Membership" url="chapters_29.html#SEC636"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="30. System Management" url="chapters_30.html#SEC637">
+ <tocsect2 name="30.1 Host Identification" url="chapters_30.html#SEC638"/>
+ <tocsect2 name="30.2 Platform Type Identification" url="chapters_30.html#SEC639"/>
+ <tocsect2 name="30.3 Controlling and Querying Mounts" url="chapters_30.html#SEC640">
+ <tocsect3 name="30.3.1 Mount Information" url="chapters_30.html#SEC641">
+ <tocsect4 name="30.3.1.1 The `fstab' file" url="chapters_30.html#SEC642"/>
+ <tocsect4 name="30.3.1.2 The `mtab' file" url="chapters_30.html#SEC643"/>
+ <tocsect4 name="30.3.1.3 Other (Non-libc) Sources of Mount Information" url="chapters_30.html#SEC644"/>
+ </tocsect3>
+ <tocsect3 name="30.3.2 Mount, Unmount, Remount" url="chapters_30.html#SEC645"/>
+ </tocsect2>
+ <tocsect2 name="30.4 System Parameters" url="chapters_30.html#SEC646"/>
+</tocsect1>
+<tocsect1 name="31. System Configuration Parameters" url="chapters_31.html#SEC647">
+ <tocsect2 name="31.1 General Capacity Limits" url="chapters_31.html#SEC648"/>
+ <tocsect2 name="31.2 Overall System Options" url="chapters_31.html#SEC649"/>
+ <tocsect2 name="31.3 Which Version of POSIX is Supported" url="chapters_31.html#SEC650"/>
+ <tocsect2 name="31.4 Using sysconf" url="chapters_31.html#SEC651">
+ <tocsect3 name="31.4.1 Definition of sysconf" url="chapters_31.html#SEC652"/>
+ <tocsect3 name="31.4.2 Constants for sysconf Parameters" url="chapters_31.html#SEC653"/>
+ <tocsect3 name="31.4.3 Examples of sysconf" url="chapters_31.html#SEC654"/>
+ </tocsect2>
+ <tocsect2 name="31.5 Minimum Values for General Capacity Limits" url="chapters_31.html#SEC655"/>
+ <tocsect2 name="31.6 Limits on File System Capacity" url="chapters_31.html#SEC656"/>
+ <tocsect2 name="31.7 Optional Features in File Support" url="chapters_31.html#SEC657"/>
+ <tocsect2 name="31.8 Minimum Values for File System Limits" url="chapters_31.html#SEC658"/>
+ <tocsect2 name="31.9 Using pathconf" url="chapters_31.html#SEC659"/>
+ <tocsect2 name="31.10 Utility Program Capacity Limits" url="chapters_31.html#SEC660"/>
+ <tocsect2 name="31.11 Minimum Values for Utility Limits" url="chapters_31.html#SEC661"/>
+ <tocsect2 name="31.12 String-Valued Parameters" url="chapters_31.html#SEC662"/>
+</tocsect1>
+<tocsect1 name="32. DES Encryption and Password Handling" url="chapters_32.html#SEC663">
+ <tocsect2 name="32.1 Legal Problems" url="chapters_32.html#SEC664"/>
+ <tocsect2 name="32.2 Reading Passwords" url="chapters_32.html#SEC665"/>
+ <tocsect2 name="32.3 Encrypting Passwords" url="chapters_32.html#SEC666"/>
+ <tocsect2 name="32.4 DES Encryption" url="chapters_32.html#SEC667"/>
+</tocsect1>
+<tocsect1 name="33. Debugging support" url="chapters_33.html#SEC668">
+ <tocsect2 name="33.1 Backtraces" url="chapters_33.html#SEC669"/>
+</tocsect1>
+<tocsect1 name="34. POSIX Threads" url="chapters_34.html#SEC670">
+ <tocsect2 name="34.1 Basic Thread Operations" url="chapters_34.html#SEC671"/>
+ <tocsect2 name="34.2 Thread Attributes" url="chapters_34.html#SEC672"/>
+ <tocsect2 name="34.3 Cancellation" url="chapters_34.html#SEC673"/>
+ <tocsect2 name="34.4 Cleanup Handlers" url="chapters_34.html#SEC674"/>
+ <tocsect2 name="34.5 Mutexes" url="chapters_34.html#SEC675"/>
+ <tocsect2 name="34.6 Condition Variables" url="chapters_34.html#SEC676"/>
+ <tocsect2 name="34.7 POSIX Semaphores" url="chapters_34.html#SEC677"/>
+ <tocsect2 name="34.8 Thread-Specific Data" url="chapters_34.html#SEC678"/>
+ <tocsect2 name="34.9 Threads and Signal Handling" url="chapters_34.html#SEC679"/>
+ <tocsect2 name="34.10 Threads and Fork" url="chapters_34.html#SEC680"/>
+ <tocsect2 name="34.11 Streams and Fork" url="chapters_34.html#SEC681"/>
+ <tocsect2 name="34.12 Miscellaneous Thread Functions" url="chapters_34.html#SEC682"/>
+</tocsect1>
+<tocsect1 name="A. C Language Facilities in the Library" url="chapters_35.html#SEC683">
+ <tocsect2 name="A.1 Explicitly Checking Internal Consistency" url="chapters_35.html#SEC684"/>
+ <tocsect2 name="A.2 Variadic Functions" url="chapters_35.html#SEC685">
+ <tocsect3 name="A.2.1 Why Variadic Functions are Used" url="chapters_35.html#SEC686"/>
+ <tocsect3 name="A.2.2 How Variadic Functions are Defined and Used" url="chapters_35.html#SEC687">
+ <tocsect4 name="A.2.2.1 Syntax for Variable Arguments" url="chapters_35.html#SEC688"/>
+ <tocsect4 name="A.2.2.2 Receiving the Argument Values" url="chapters_35.html#SEC689"/>
+ <tocsect4 name="A.2.2.3 How Many Arguments Were Supplied" url="chapters_35.html#SEC690"/>
+ <tocsect4 name="A.2.2.4 Calling Variadic Functions" url="chapters_35.html#SEC691"/>
+ <tocsect4 name="A.2.2.5 Argument Access Macros" url="chapters_35.html#SEC692"/>
+ </tocsect3>
+ <tocsect3 name="A.2.3 Example of a Variadic Function" url="chapters_35.html#SEC693">
+ <tocsect4 name="A.2.3.1 Old-Style Variadic Functions" url="chapters_35.html#SEC694"/>
+ </tocsect3>
+ </tocsect2>
+ <tocsect2 name="A.3 Null Pointer Constant" url="chapters_35.html#SEC695"/>
+ <tocsect2 name="A.4 Important Data Types" url="chapters_35.html#SEC696"/>
+ <tocsect2 name="A.5 Data Type Measurements" url="chapters_35.html#SEC697">
+ <tocsect3 name="A.5.1 Computing the Width of an Integer Data Type" url="chapters_35.html#SEC698"/>
+ <tocsect3 name="A.5.2 Range of an Integer Type" url="chapters_35.html#SEC699"/>
+ <tocsect3 name="A.5.3 Floating Type Macros" url="chapters_35.html#SEC700">
+ <tocsect4 name="A.5.3.1 Floating Point Representation Concepts" url="chapters_35.html#SEC701"/>
+ <tocsect4 name="A.5.3.2 Floating Point Parameters" url="chapters_35.html#SEC702"/>
+ <tocsect4 name="A.5.3.3 IEEE Floating Point" url="chapters_35.html#SEC703"/>
+ </tocsect3>
+ <tocsect3 name="A.5.4 Structure Field Offset Measurement" url="chapters_35.html#SEC704"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="B. Summary of Library Facilities" url="chapters_36.html#SEC705"/>
+<tocsect1 name="C. Installing the GNU C Library" url="chapters_37.html#SEC706">
+ <tocsect2 name="C.1 Configuring and compiling GNU Libc" url="chapters_37.html#SEC707"/>
+ <tocsect2 name="C.2 Installing the C Library" url="chapters_37.html#SEC708"/>
+ <tocsect2 name="C.3 Recommended Tools for Compilation" url="chapters_37.html#SEC709"/>
+ <tocsect2 name="C.4 Supported Configurations" url="chapters_37.html#SEC710"/>
+ <tocsect2 name="C.5 Specific advice for Linux systems" url="chapters_37.html#SEC711"/>
+ <tocsect2 name="C.6 Reporting Bugs" url="chapters_37.html#SEC712"/>
+</tocsect1>
+<tocsect1 name="D. Library Maintenance" url="chapters_38.html#SEC713">
+ <tocsect2 name="D.1 Adding New Functions" url="chapters_38.html#SEC714"/>
+ <tocsect2 name="D.2 Porting the GNU C Library" url="chapters_38.html#SEC715">
+ <tocsect3 name="D.2.1 Layout of the `sysdeps' Directory Hierarchy" url="chapters_38.html#SEC716"/>
+ <tocsect3 name="D.2.2 Porting the GNU C Library to Unix Systems" url="chapters_38.html#SEC717"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="E. Contributors to the GNU C Library" url="chapters_39.html#SEC718"/>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/libstdc++.toc b/languages/cpp/doc/libstdc++.toc
new file mode 100644
index 00000000..afdb10c1
--- /dev/null
+++ b/languages/cpp/doc/libstdc++.toc
@@ -0,0 +1,19 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>LIBSTDC++ (gcc.gnu.org)</title>
+<base href="http://gcc.gnu.org/onlinedocs/libstdc++"/>
+<tocsect1 name="Documentation" url="documentation.html"/>
+<tocsect1 name="Intro" url="17_intro/howto.html"/>
+<tocsect1 name="Library Support" url="18_support/howto.html"/>
+<tocsect1 name="Diagnostics" url="19_diagnostics/howto.html"/>
+<tocsect1 name="Utilities" url="20_util/howto.html"/>
+<tocsect1 name="Strings" url="21_strings/howto.html"/>
+<tocsect1 name="Localization" url="22_locale/howto.html"/>
+<tocsect1 name="Containers" url="23_containers/howto.html"/>
+<tocsect1 name="Iterators" url="24_iterators/howto.html"/>
+<tocsect1 name="Algorithms" url="25_algorithms/howto.html"/>
+<tocsect1 name="Numerics" url="26_numerics/howto.html"/>
+<tocsect1 name="I/O" url="27_io/howto.html"/>
+<tocsect1 name="Extensions" url="ext/howto.html"/>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/qt-kdev3.toc b/languages/cpp/doc/qt-kdev3.toc
new file mode 100644
index 00000000..e1ed885e
--- /dev/null
+++ b/languages/cpp/doc/qt-kdev3.toc
@@ -0,0 +1,39 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Qt Designer-3 and KDevelop-3</title>
+<base href="http://women.kde.org/articles/tutorials/kdevelop3"/>
+<tocsect1 name="Index" url="index.html">
+</tocsect1>
+<tocsect1 name="Introduction" url="introduction.html">
+</tocsect1>
+<tocsect1 name="Requirements" url="requirements.html">
+ <tocsect2 name="How to get Qt Designer" url="requirements.html"/>
+ <tocsect2 name="How to get KDevelop 3" url="get-kevelop.html"/>
+ <tocsect2 name="Lexicon" url="lexicon.html"/>
+</tocsect1>
+<tocsect1 name="Creating the application" url="creating.html">
+ <tocsect2 name="Starting the project" url="creating.htm"/>
+ <tocsect2 name="Designing the program" url="design-program.html"/>
+ <tocsect2 name="Adding widgets" url="adding-widgets.html"/>
+ <tocsect2 name="Getting spaced out" url="spaced-out.html"/>
+ <tocsect2 name="Signals and slots" url="signals-and-slots.html"/>
+ <tocsect2 name="Generating the source" url="source.html"/>
+ <tocsect2 name="Implementing the slot" url="slots.html"/>
+</tocsect1>
+<tocsect1 name="In short" url="in-short.html">
+</tocsect1>
+<tocsect1 name="Make the translations for a simple KDE project" url="translations.html">
+</tocsect1>
+<tocsect1 name="A few general tips" url="a_few_tips.html">
+ <tocsect2 name="General hints" url="a_few_tips.html#id2771559"/>
+ <tocsect2 name="Importing your project in KDE CVS" url="importing.html"/>
+ <tocsect2 name="How do I release my application as a tarball?" url="release-tarball.html"/>
+ <tocsect2 name="Useful links" url="links.html"/>
+</tocsect1>
+<tocsect1 name="Generating the source (alternate)" url="without_subclass.html">
+ <tocsect2 name="Without using the KDevelop subclassing capability" url="without_subclass.html"/>
+ <tocsect2 name="Implementing the slot" url="slots2.html"/>
+</tocsect1>
+<tocsect1 name="Credits and License" url="credits.html">
+</tocsect1>
+</kdeveloptoc> \ No newline at end of file
diff --git a/languages/cpp/doc/stl.toc b/languages/cpp/doc/stl.toc
new file mode 100644
index 00000000..d86b82b0
--- /dev/null
+++ b/languages/cpp/doc/stl.toc
@@ -0,0 +1,487 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>STL (sgi.com)</title>
+<base href="http://www.sgi.com/tech/stl"/>
+<tocsect1 name="Introduction" url="stl_introduction.html"/>
+<tocsect1 name="How to use the documentation" url="doc_introduction.html"/>
+<tocsect1 name="Containers" url="">
+ <tocsect2 name="Container concepts" url="">
+ <tocsect3 name="Container" url="Container.html"/>
+ <tocsect3 name="Forward Container" url="ForwardContainer.html"/>
+ <tocsect3 name="Reversible Container" url="ReversibleContainer.html"/>
+ <tocsect3 name="Random Access Container" url="RandomAccessContainer.html"/>
+ </tocsect2>
+ <tocsect2 name="Sequences concepts" url="">
+ <tocsect3 name="Sequence" url="Sequence.html"/>
+ <tocsect3 name="Front Insertion Sequence" url="FrontInsertionSequence.html"/>
+ <tocsect3 name="Back Insertion Sequence" url="BackInsertionSequence.html"/>
+ </tocsect2>
+ <tocsect2 name="Associative Containers concepts" url="">
+ <tocsect3 name="Associative Container" url="AssociativeContainer.html"/>
+ <tocsect3 name="Simple Associative Container" url="SimpleAssociativeContainer.html"/>
+ <tocsect3 name="Pair Associative Container" url="PairAssociativeContainer.html"/>
+ <tocsect3 name="Sorted Associative Container" url="SortedAssociativeContainer.html"/>
+ <tocsect3 name="Hashed Associative Container" url="HashedAssociativeContainer.html"/>
+ <tocsect3 name="HashFunction" url="HashFunction.html"/>
+ <tocsect3 name="Unique Associative Container" url="UniqueAssociativeContainer.html"/>
+ <tocsect3 name="Multiple Associative Container" url="MultipleAssociativeContainer.html"/>
+ <tocsect3 name="Unique Sorted Associative Container" url="UniqueSortedAssociativeContainer.html"/>
+ <tocsect3 name="Multiple Sorted Associative Container" url="MultipleSortedAssociativeContainer.html"/>
+ <tocsect3 name="Unique Hashed Associative Container" url="UniqueHashedAssociativeContainer.html"/>
+ <tocsect3 name="Multiple Hashed Associative Container" url="MultipleHashedAssociativeContainer.html"/>
+ </tocsect2>
+ <tocsect2 name="Container classes: Sequences" url="">
+ <tocsect3 name="vector" url="Vector.html"/>
+ <tocsect3 name="deque" url="Deque.html"/>
+ <tocsect3 name="list" url="List.html"/>
+ <tocsect3 name="slist" url="Slist.html"/>
+ <tocsect3 name="bit_vector" url="bit_vector.html"/>
+ </tocsect2>
+ <tocsect2 name="Container classes: Associative Containers" url="">
+ <tocsect3 name="set" url="set.html"/>
+ <tocsect3 name="map" url="Map.html"/>
+ <tocsect3 name="multiset" url="multiset.html"/>
+ <tocsect3 name="multimap" url="Multimap.html"/>
+ <tocsect3 name="hash_set" url="hash_set.html"/>
+ <tocsect3 name="hash_map" url="hash_map.html"/>
+ <tocsect3 name="hash_multiset" url="hash_multiset.html"/>
+ <tocsect3 name="hash_multimap" url="hash_multimap.html"/>
+ </tocsect2>
+ <tocsect2 name="String package" url="">
+ <tocsect3 name="Character traits" url="character_traits.html"/>
+ <tocsect3 name="char_traits" url="char_traits.html"/>
+ <tocsect3 name="basic_string" url="basic_string.html"/>
+ <tocsect3 name="rope" url="Rope.html"/>
+ </tocsect2>
+ <tocsect2 name="Container adaptors" url="">
+ <tocsect3 name="stack" url="stack.html"/>
+ <tocsect3 name="queue" url="queue.html"/>
+ <tocsect3 name="bitset" url="bitset.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Iterators" url="">
+ <tocsect2 name="Introduction" url="Iterators.html"/>
+ <tocsect2 name="Iterator Concepts" url="">
+ <tocsect3 name="Trivial Iterator" url="trivial.html"/>
+ <tocsect3 name="Input Iterator" url="InputIterator.html"/>
+ <tocsect3 name="Output Iterator" url="OutputIterator.html"/>
+ <tocsect3 name="Forward Iterator" url="ForwardIterator.html"/>
+ <tocsect3 name="Bidirectional Iterator" url="BidirectionalIterator.html"/>
+ <tocsect3 name="Random Access Iterator" url="RandomAccessIterator.html"/>
+ </tocsect2>
+ <tocsect2 name="Iterator Tags" url="">
+ <tocsect3 name="Introduction" url="iterator_tags.html"/>
+ <tocsect3 name="iterator_traits" url="iterator_traits.html"/>
+ <tocsect3 name="iterator_category" url="iterator_category.html"/>
+ <tocsect3 name="distance_type" url="distance_type.html"/>
+ <tocsect3 name="value_type" url="value_type.html"/>
+ </tocsect2>
+ <tocsect2 name="Iterator tag classes" url="">
+ <tocsect3 name="input_iterator_tag" url="input_iterator_tag.html"/>
+ <tocsect3 name="output_iterator_tag" url="output_iterator_tag.html"/>
+ <tocsect3 name="forward_iterator_tag" url="forward_iterator_tag.html"/>
+ <tocsect3 name="bidirectional_iterator_tag" url="bidirectional_iterator_tag.html"/>
+ <tocsect3 name="random_access_iterator_tag" url="random_access_iterator_tag.html"/>
+ </tocsect2>
+ <tocsect2 name="Iterator base classes" url="">
+ <tocsect3 name="input_iterator" url="input_iterator.html"/>
+ <tocsect3 name="output_iterator" url="output_iterator.html"/>
+ <tocsect3 name="forward_iterator" url="forward_iterator.html"/>
+ <tocsect3 name="bidirectional_iterator" url="bidirectional_iterator.html"/>
+ <tocsect3 name="random_access_iterator" url="random_access_iterator.html"/>
+ </tocsect2>
+ <tocsect2 name="Iterator functions" url="">
+ <tocsect3 name="distance" url="distance.html"/>
+ <tocsect3 name="advance" url="advance.html"/>
+ </tocsect2>
+ <tocsect2 name="Iterator classes" url="">
+ <tocsect3 name="istream_iterator" url="istream_iterator.html"/>
+ <tocsect3 name="ostream_iterator" url="ostream_iterator.html"/>
+ <tocsect3 name="front_insert_iterator" url="front_insert_iterator.html"/>
+ <tocsect3 name="back_insert_iterator" url="back_insert_iterator.html"/>
+ <tocsect3 name="insert_iterator" url="insert_iterator.html"/>
+ <tocsect3 name="reverse_iterator" url="ReverseIterator.html"/>
+ <tocsect3 name="reverse_bidirectional_iterator" url="ReverseBidirectionalIterator.html"/>
+ <tocsect3 name="raw_storage_iterator" url="raw_storage_iterator.html"/>
+ <tocsect3 name="sequence_buffer" url="sequence_buffer.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Algorithms" url="">
+ <tocsect2 name="Non-mutating algorithms" url="">
+ <tocsect3 name="for_each" url="for_each.html"/>
+ <tocsect3 name="find" url="find.html"/>
+ <tocsect3 name="find_if" url="find_if.html"/>
+ <tocsect3 name="adjacent_find" url="adjacent_find.html"/>
+ <tocsect3 name="find_first_of" url="find_first_of.html"/>
+ <tocsect3 name="count" url="count.html"/>
+ <tocsect3 name="count_if" url="count_if.html"/>
+ <tocsect3 name="mismatch" url="mismatch.html"/>
+ <tocsect3 name="equal" url="equal.html"/>
+ <tocsect3 name="search" url="search.html"/>
+ <tocsect3 name="search_n" url="search_n.html"/>
+ <tocsect3 name="find_end" url="find_end.html"/>
+ </tocsect2>
+ <tocsect2 name="Mutating algorithms" url="">
+ <tocsect3 name="copy" url="copy.html"/>
+ <tocsect3 name="copy_n" url="copy_n.html"/>
+ <tocsect3 name="copy_backward" url="copy_backward.html"/>
+ <tocsect3 name="swap" url="swap.html"/>
+ <tocsect3 name="iter_swap" url="iter_swap.html"/>
+ <tocsect3 name="swap_ranges" url="swap_ranges.html"/>
+ <tocsect3 name="transform" url="transform.html"/>
+ <tocsect3 name="replace" url="replace.html"/>
+ <tocsect3 name="replace_if" url="replace_if.html"/>
+ <tocsect3 name="replace_copy" url="replace_copy.html"/>
+ <tocsect3 name="replace_copy_if" url="replace_copy_if.html"/>
+ <tocsect3 name="fill" url="fill.html"/>
+ <tocsect3 name="fill_n" url="fill_n.html"/>
+ <tocsect3 name="generate" url="generate.html"/>
+ <tocsect3 name="generate_n" url="generate_n.html"/>
+ <tocsect3 name="remove" url="remove.html"/>
+ <tocsect3 name="remove_if" url="remove_if.html"/>
+ <tocsect3 name="remove_copy" url="remove_copy.html"/>
+ <tocsect3 name="remove_copy_if" url="remove_copy_if.html"/>
+ <tocsect3 name="unique" url="unique.html"/>
+ <tocsect3 name="unique_copy" url="unique_copy.html"/>
+ <tocsect3 name="reverse" url="reverse.html"/>
+ <tocsect3 name="reverse_copy" url="reverse_copy.html"/>
+ <tocsect3 name="rotate" url="rotate.html"/>
+ <tocsect3 name="rotate_copy" url="rotate_copy.html"/>
+ <tocsect3 name="random_shuffle" url="random_shuffle.html"/>
+ <tocsect3 name="random_sample" url="random_sample.html"/>
+ <tocsect3 name="random_sample_n" url="random_sample_n.html"/>
+ <tocsect3 name="partition" url="partition.html"/>
+ <tocsect3 name="stable_partition" url="stable_partition.html"/>
+ </tocsect2>
+ <tocsect2 name="Sorting" url="">
+ <tocsect3 name="sort" url="sort.html"/>
+ <tocsect3 name="stable_sort" url="stable_sort.html"/>
+ <tocsect3 name="partial_sort" url="partial_sort.html"/>
+ <tocsect3 name="partial_sort_copy" url="partial_sort_copy.html"/>
+ <tocsect3 name="is_sorted" url="is_sorted.html"/>
+ <tocsect3 name="nth_element" url="nth_element.html"/>
+ <tocsect3 name="lower_bound" url="lower_bound.html"/>
+ <tocsect3 name="upper_bound" url="upper_bound.html"/>
+ <tocsect3 name="equal_range" url="equal_range.html"/>
+ <tocsect3 name="binary_search" url="binary_search.html"/>
+ <tocsect3 name="merge" url="merge.html"/>
+ <tocsect3 name="inplace_merge" url="inplace_merge.html"/>
+ <tocsect3 name="includes" url="includes.html"/>
+ <tocsect3 name="set_union" url="set_union.html"/>
+ <tocsect3 name="set_intersection" url="set_intersection.html"/>
+ <tocsect3 name="set_difference" url="set_difference.html"/>
+ <tocsect3 name="set_symmetric_difference" url="set_symmetric_difference.html"/>
+ <tocsect3 name="push_heap" url="push_heap.html"/>
+ <tocsect3 name="pop_heap" url="pop_heap.html"/>
+ <tocsect3 name="make_heap" url="make_heap.html"/>
+ <tocsect3 name="sort_heap" url="sort_heap.html"/>
+ <tocsect3 name="is_heap" url="is_heap.html"/>
+ <tocsect3 name="min" url="min.html"/>
+ <tocsect3 name="max" url="max.html"/>
+ <tocsect3 name="min_element" url="min_element.html"/>
+ <tocsect3 name="max_element" url="max_element.html"/>
+ <tocsect3 name="lexicographical_compare" url="lexicographical_compare.html"/>
+ <tocsect3 name="lexicographical_compare_3way" url="lexicographical_compare_3way.html"/>
+ <tocsect3 name="next_permutation" url="next_permutation.html"/>
+ <tocsect3 name="prev_permutation" url="prev_permutation.html"/>
+ </tocsect2>
+ <tocsect2 name="Generalized numeric algorithms" url="">
+ <tocsect3 name="iota" url="iota.html"/>
+ <tocsect3 name="accumulate" url="accumulate.html"/>
+ <tocsect3 name="inner_product" url="inner_product.html"/>
+ <tocsect3 name="partial_sum" url="partial_sum.html"/>
+ <tocsect3 name="adjacent_difference" url="adjacent_difference.html"/>
+ <tocsect3 name="power" url="power.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Function Objects" url="">
+ <tocsect2 name="Introduction" url="functors.html"/>
+ <tocsect2 name="Function Object Concepts" url="">
+ <tocsect3 name="Generator" url="Generator.html"/>
+ <tocsect3 name="UnaryFunction" url="Unary Function.html"/>
+ <tocsect3 name="BinaryFunction" url="Binary Function.html"/>
+ <tocsect3 name="AdaptableGenerator" url="Adaptable Generator.html"/>
+ <tocsect3 name="AdaptableUnaryFunction" url="Adaptable Unary Function.html"/>
+ <tocsect3 name="AdaptableBinaryFunction" url="Adaptable Binary Function.html"/>
+ <tocsect3 name="Predicate" url="Predicate.html"/>
+ <tocsect3 name="BinaryPredicate" url="Binary Predicate.html"/>
+ <tocsect3 name="AdaptablePredicate" url="Adaptable Predicate.html"/>
+ <tocsect3 name="AdaptableBinaryPredicate" url="Adaptable Binary Predicate.html"/>
+ <tocsect3 name="StrictWeakOrdering" url="StrictWeakOrdering.html"/>
+ <tocsect3 name="MonoidOperation" url="Monoid Operation.html"/>
+ <tocsect3 name="RandomNumberGenerator" url="Random Number Generator.html"/>
+ </tocsect2>
+ <tocsect2 name="Predefined function objects" url="">
+ <tocsect3 name="plus" url="plus.html"/>
+ <tocsect3 name="minus" url="minus.html"/>
+ <tocsect3 name="times" url="multiplies.html"/> (formerly called "times")
+ <tocsect3 name="divides" url="divides.html"/>
+ <tocsect3 name="modulus" url="modulus.html"/>
+ <tocsect3 name="negate" url="negate.html"/>
+ <tocsect3 name="equal_to" url="equal_to.html"/>
+ <tocsect3 name="not_equal_to" url="not_equal_to.html"/>
+ <tocsect3 name="less" url="less.html"/>
+ <tocsect3 name="greater" url="greater.html"/>
+ <tocsect3 name="less_equal" url="less_equal.html"/>
+ <tocsect3 name="greater_equal" url="greater_equal.html"/>e
+ <tocsect3 name="logical_and" url="logical_and.html"/>
+ <tocsect3 name="logical_or" url="logical_or.html"/>
+ <tocsect3 name="logical_not" url="logical_not.html"/>
+ <tocsect3 name="identity" url="identity.html"/>
+ <tocsect3 name="project1st" url="project1st.html"/>
+ <tocsect3 name="project2nd" url="project2nd.html"/>
+ <tocsect3 name="select1st" url="select1st.html"/>
+ <tocsect3 name="select2nd" url="select2nd.html"/>
+ <tocsect3 name="subtractive_rng" url="subtractive_rng.html"/>
+ </tocsect2>
+ <tocsect2 name="Function object adaptors" url="">
+ <tocsect3 name="binder1st" url="binder1st.html"/>
+ <tocsect3 name="binder2nd" url="binder2nd.html"/>
+ <tocsect3 name="ptr_fun" url="ptr_fun.html"/>
+ <tocsect3 name="pointer_to_unary_function" url="pointer_to_unary_function.html"/>
+ <tocsect3 name="pointer_to_binary_function" url="pointer_to_binary_function.html"/>
+ <tocsect3 name="unary_negate" url="unary_negate.html"/>
+ <tocsect3 name="binary_negate" url="binary_negate.html"/>
+ <tocsect3 name="unary_compose" url="unary_compose.html"/>
+ <tocsect3 name="binary_compose" url="binary_compose.html"/>
+ <tocsect3 name="mem_fun_t" url="mem_fun.html"/>
+ <tocsect3 name="mem_fun_ref_t" url="mem_fun_ref.html"/>
+ <tocsect3 name="mem_fun1_t" url="mem_fun1.html"/>
+ <tocsect3 name="mem_fun1_ref_t" url="mem_fun1_ref.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Utilities" url="">
+ <tocsect2 name="Utilities Concepts" url="">
+ <tocsect3 name="Assignable" url="Assignable.html"/>
+ <tocsect3 name="Default Constructible" url="DefaultConstructible.html"/>
+ <tocsect3 name="Equality Comparable" url="EqualityComparable.html"/>
+ <tocsect3 name="LessThan Comparable" url="LessThanComparable.html"/>
+ </tocsect2>
+ <tocsect2 name="Functions: Relational Operators" url="operators.html"/>
+ <tocsect2 name="Classes: Pair" url="pair.html"/>
+</tocsect1>
+<tocsect1 name="Memory Allocation" url="">
+ <tocsect2 name="Classes" url="">
+ <tocsect3 name="Allocators" url="Allocators.html"/>
+ <tocsect3 name="raw_storage_iterator" url="raw_storage_iterator.html"/>
+ </tocsect2>
+ <tocsect2 name="Functions" url="">
+ <tocsect3 name="construct" url="construct.html"/>
+ <tocsect3 name="destroy" url="destroy.html"/>
+ <tocsect3 name="uninitialized_copy" url="uninitialized_copy"/>
+ <tocsect3 name="uninitialized_copy_n" url="uninitialized_copy_n"/>
+ <tocsect3 name="uninitialized_fill" url="uninitialized_fill"/>
+ <tocsect3 name="uninitialized_fill_n" url="uninitialized_fill_n"/>
+ <tocsect3 name="temporary_buffer" url="temporary_buffer.html"/>
+ <tocsect3 name="get_temporary_buffer" url="get_temporary_buffer.html"/>
+ <tocsect3 name="return_temporary_buffer" url="return_temporary_buffer.html"/>
+ </tocsect2>
+</tocsect1>
+<tocsect1 name="Design documents" url="">
+ <tocsect2 name="Thread safety" url="thread_safety.html"/>
+ <tocsect2 name="Complexity specifications" url="complexity.html"/>
+ <tocsect2 name="Representation of strings" url="string_discussion.html"/>
+</tocsect1>
+<index>
+<entry name="container, STL" url="Container.html"/>
+<entry name="container, forward" url="ForwardContainer.html"/>
+<entry name="random access container" url="RandomAccessContainer.html"/>
+<entry name="container, random access" url="RandomAccessContainer.html"/>
+<entry name="reversible container" url="ReversibleContainer.html"/>
+<entry name="container, reversible" url="ReversibleContainer.html"/>
+<entry name="forward container" url="ForwardContainer.html"/>
+<entry name="multiple sorted container" url="MultipleSortedContainer.html"/>
+<entry name="container, multiple sorted" url="MultipleSortedContainer.html"/>
+<entry name="associative container" url="AssociativeContainer.html"/>
+<entry name="container, associative" url="AssociativeContainer.html"/>
+<entry name="simple associative container" url="SimpleAssociativeContainer.html"/>
+<entry name="container, simple associative" url="SimpleAssociativeContainer.html"/>
+<entry name="unique associative container" url="UniqueAssociativeContainer.html"/>
+<entry name="container, unique associative" url="UniqueAssociativeContainer.html"/>
+<entry name="sorted associative container" url="SortedAssociativeContainer.html"/>
+<entry name="container, sorted associative" url="SortedAssociativeContainer.html"/>
+<entry name="hashed associative container" url="HashedAssociativeContainer.html"/>
+<entry name="container, hashed associative" url="HashedAssociativeContainer.html"/>
+<entry name="unique hashed associative container" url="UniqueHashedAssociativeContainer.html"/>
+<entry name="container, unique hashed associative" url="UniqueHashedAssociativeContainer.html"/>
+<entry name="pair associative container" url="PairAssociativeContainer.html"/>
+<entry name="container, pair associative" url="PairAssociativeContainer.html"/>
+<entry name="multiple associative container" url="MultipleAssociativeContainer.html"/>
+<entry name="container, multiple associative" url="MultipleAssociativeContainer.html"/>
+<entry name="iterators, STL" url="Iterators.html"/>
+<entry name="trivial iterator" url="TrivialIterator.html"/>
+<entry name="iterator, trivial" url="TrivialIterator.html"/>
+<entry name="random access iterator" url="RandomAccessIterator.html"/>
+<entry name="iterator, random access" url="RandomAccessIterator.html"/>
+<entry name="forward iterator" url="ForwardIterator.html"/>
+<entry name="iterator, forward" url="ForwardIterator.html"/>
+<entry name="bidirectional iterator" url="BidirectionalIterator.html"/>
+<entry name="iterator, bidirectional" url="BidirectionalIterator.html"/>
+<entry name="input iterator" url="InputIterator.html"/>
+<entry name="iterator, input" url="InputIterator.html"/>
+<entry name="output iterator" url="OutputIterator.html"/>
+<entry name="iterator, output" url="OutputIterator.html"/>
+<entry name="iterator tags" url="IteratorTags.html"/>
+<entry name="tags, iterator, STL" url="IteratorTags.html"/>
+<entry name="sequence, STL" url="Sequence.html"/>
+<entry name="back insertion sequence" url="BackInsertionSequence.html"/>
+<entry name="sequence, back insertion" url="BackInsertionSequence.html"/>
+<entry name="front insertion sequence" url="FrontInsertionSequence.html"/>
+<entry name="sequence, front insertion" url="FrontInsertionSequence.html"/>
+<entry name="assignable, STL" url="Assignable.html"/>
+<entry name="character traits, STL" url="CharacterTraits.html"/>
+<entry name="default constructible, STL" url="DefaultConstructible.html"/>
+<entry name="equality comparable, STL" url="EqualityComparable.html"/>
+<entry name="lessthan comparable, STL" url="LessThanComparable.html"/>
+<entry name="relational operators, STL" url="RelationalOperators.html"/>
+<entry name="operators, relational, STL" url="RelationalOperators.html"/>
+<entry name="vector, STL class" url="vector.html"/>
+<entry name="deque, STL class" url="Deque.html"/>
+<entry name="list, STL class" url="List.html"/>
+<entry name="slist, STL class" url="slist.html"/>
+<entry name="bit_vector, STL class" url="bit_vector.html"/>
+<entry name="set, STL class" url="set.html"/>
+<entry name="map, STL class" url="map.html"/>
+<entry name="multiset, STL class" url="multiset.html"/>
+<entry name="multimap, STL class" url="multimap.html"/>
+<entry name="hash_set, STL class" url="hash_set.html"/>
+<entry name="hash_map, STL class" url="hash.html"/>
+<entry name="hash_multiset, STL class" url="hash_multiset.html"/>
+<entry name="hash_multimap, STL class" url="hash_multimap.html"/>
+<entry name="char_traits, STL class" url="char_traits.html"/>
+<entry name="basic_string, STL class" url="basic_string.html"/>
+<entry name="rope, STL class" url="rope.html"/>
+<entry name="stack, STL class" url="stack.html"/>
+<entry name="queue, STL class" url="queue.html"/>
+<entry name="bitset, STL class" url="bitset.html"/>
+<entry name="iterator_traits, STL class" url="iterator_traits.html"/>
+<entry name="input_iterator, STL class" url="input_iterator.html"/>
+<entry name="outputput_iterator, STL class" url="output_iterator.html"/>
+<entry name="forward_iterator, STL class" url="forward_iterator.html"/>
+<entry name="bidirectional_iterator, STL class" url="bidirectional_iterator.html"/>
+<entry name="random_access_iterator, STL class" url="random_access_iterator.html"/>
+<entry name="istream_iterator, STL class" url="istream_iterator.html"/>
+<entry name="ostream_iterator, STL class" url="ostream_iterator.html"/>
+<entry name="front_insert_iterator, STL class" url="front_insert_iterator.html"/>
+<entry name="back_insert_iterator, STL class" url="back_insert_iterator.html"/>
+<entry name="insert_iterator, STL class" url="insert_iterator.html"/>
+<entry name="reverse_iterator, STL class" url="reverse_iterator.html"/>
+<entry name="reverse_bidirectional_iterator, STL class" url="reverse_bidirectional_iterator.html"/>
+<entry name="distance, STL function" url="distance.html"/>
+<entry name="advance, STL function" url="advance.html"/>
+<entry name="for_each, STL algorithm" url="for_each.html"/>
+<entry name="find, STL algorithm" url="find.html"/>
+<entry name="find_if, STL algorithm" url="find_if.html"/>
+<entry name="adjacent_find, STL algorithm" url="adjacent_find.html"/>
+<entry name="find_first_of, STL algorithm" url="find_first_of.html"/>
+<entry name="count, STL algorithm" url="count.html"/>
+<entry name="count_if, STL algorithm" url="count_if.html"/>
+<entry name="mismatch, STL algorithm" url="mismatch.html"/>
+<entry name="equal, STL algorithm" url="equal.html"/>
+<entry name="search, STL algorithm" url="search.html"/>
+<entry name="search_n, STL algorithm" url="search_n.html"/>
+<entry name="find_end, STL algorithm" url="find_end.html"/>
+<entry name="copy, STL algorithm" url="copy.html"/>
+<entry name="copy_n, STL algorithm" url="copy_n.html"/>
+<entry name="copy_backward, STL algorithm" url="copy_backward.html"/>
+<entry name="swap, STL algorithm" url="swap.html"/>
+<entry name="iter_swap, STL algorithm" url="iter_swap.html"/>
+<entry name="swap_ranges, STL algorithm" url="swap_ranges.html"/>
+<entry name="transform, STL algorithm" url="transform.html"/>
+<entry name="replace, STL algorithm" url="replace.html"/>
+<entry name="replace_if, STL algorithm" url="replace_if.html"/>
+<entry name="replace_copy, STL algorithm" url="replace_copy.html"/>
+<entry name="fill, STL algorithm" url="fill.html"/>
+<entry name="fill_n, STL algorithm" url="fill_n.html"/>
+<entry name="generate, STL algorithm" url="generate.html"/>
+<entry name="generate_n, STL algorithm" url="generate_n.html"/>
+<entry name="remove, STL algorithm" url="remove.html"/>
+<entry name="remove_if, STL algorithm" url="remove_if.html"/>
+<entry name="remove_copy, STL algorithm" url="remove_copy.html"/>
+<entry name="remove_copy_if, STL algorithm" url="remove_copy_if.html"/>
+<entry name="unique, STL algorithm" url="unique.html"/>
+<entry name="unique_copy, STL algorithm" url="unique_copy.html"/>
+<entry name="reverse, STL algorithm" url="reverse.html"/>
+<entry name="reverse_copy, STL algorithm" url="reverse_copy.html"/>
+<entry name="rotate, STL algorithm" url="rotate.html"/>
+<entry name="rotate_copy, STL algorithm" url="rotate_copy.html"/>
+<entry name="random_shuffle, STL algorithm" url="random_shuffle.html"/>
+<entry name="random_sample, STL algorithm" url="random_sample.html"/>
+<entry name="random_sample_n, STL algorithm" url="random_sample_n.html"/>
+<entry name="partition, STL algorithm" url="partition.html"/>
+<entry name="stable_partition, STL algorithm" url="stable_partition.html"/>
+<entry name="sort, STL algorithm" url="sort.html"/>
+<entry name="stable_sort, STL algorithm" url="stable_sort.html"/>
+<entry name="partial_sort, STL algorithm" url="partial_sort.html"/>
+<entry name="partial_sort_copy, STL algorithm" url="partial_sort_copy.html"/>
+<entry name="is_sorted, STL algorithm" url="is_sorted.html"/>
+<entry name="nth_element, STL algorithm" url="nth_element.html"/>
+<entry name="lower_bound, STL algorithm" url="lower_bound.html"/>
+<entry name="upper_bound, STL algorithm" url="upper_bound.html"/>
+<entry name="equal_range, STL algorithm" url="equal_range.html"/>
+<entry name="binary_search, STL algorithm" url="binary_search.html"/>
+<entry name="merge, STL algorithm" url="merge.html"/>
+<entry name="inplace_merge, STL algorithm" url="inplace_merge.html"/>
+<entry name="includes, STL algorithm" url="includes.html"/>
+<entry name="set_union, STL algorithm" url="set_union.html"/>
+<entry name="set_intersection, STL algorithm" url="set_intersection.html"/>
+<entry name="set_difference, STL algorithm" url="set_difference.html"/>
+<entry name="set_symmetric_difference, STL algorithm" url="set_symmetric_difference.html"/>
+<entry name="push_heap, STL algorithm" url="push_heap.html"/>
+<entry name="pop_heap, STL algorithm" url="pop_heap.html"/>
+<entry name="make_heap, STL algorithm" url="make_heap.html"/>
+<entry name="sort_heap, STL algorithm" url="sort_heap.html"/>
+<entry name="is_heap, STL algorithm" url="is_heap.html"/>
+<entry name="min, STL algorithm" url="min.html"/>
+<entry name="max, STL algorithm" url="max.html"/>
+<entry name="min_element, STL algorithm" url="min_element.html"/>
+<entry name="max_element, STL algorithm" url="max_element.html"/>
+<entry name="lexicographical_compare, STL algorithm" url="lexicographic_compare.html"/>
+<entry name="lexicographical_compare_3way, STL algorithm" url="lexicographic_compare_3way.html"/>
+<entry name="next_permutation, STL algorithm" url="next_permutation.html"/>
+<entry name="prev_permutation, STL algorithm" url="prev_permutation.html"/>
+<entry name="iota, STL algorithm" url="ioata.html"/>
+<entry name="accumulate, STL algorithm" url="accumulate.html"/>
+<entry name="inner_product, STL algorithm" url="inner_product.html"/>
+<entry name="partial_sum, STL algorithm" url="partial_sum.html"/>
+<entry name="adjacent_difference, STL algorithm" url="adjacent_difference.html"/>
+<entry name="power, STL algorithm" url="power.html"/>
+<entry name="plus, STL functor" url="plus.html"/>
+<entry name="minus, STL functor" url="minus.html"/>
+<entry name="times, STL functor" url="times.html"/>
+<entry name="divides, STL functor" url="divides.html"/>
+<entry name="modulus, STL functor" url="modulus.html"/>
+<entry name="negate, STL functor" url="negate.html"/>
+<entry name="equal_to, STL functor" url="equal_to.html"/>
+<entry name="not_equal_to, STL functor" url="not_equal_to.html"/>
+<entry name="less, STL functor" url="less.html"/>
+<entry name="greater, STL functor" url="greater.html"/>
+<entry name="less_equal, STL functor" url="less_equal.html"/>
+<entry name="greater_equal, STL functor" url="greater_equal.html"/>
+<entry name="logical_and, STL functor" url="logical_and.html"/>
+<entry name="logical_or, STL functor" url="logical_or.html"/>
+<entry name="logical_not, STL functor" url="logical_not.html"/>
+<entry name="identity, STL functor" url="identity.html"/>
+<entry name="project1st, STL functor" url="project1st.html"/>
+<entry name="project2nd, STL functor" url="project2nd.html"/>
+<entry name="select1st, STL functor" url="select1st.html"/>
+<entry name="select2nd, STL functor" url="select2nd.html"/>
+<entry name="subtractive_rng, STL functor" url="subtractive_rng.html"/>
+<entry name="binder1st, STL functor" url="binder1st.html"/>
+<entry name="binder2nd, STL functor" url="binder2nd.html"/>
+<entry name="ptr_fun, STL functor" url="ptr_fun.html"/>
+<entry name="pointer_to_unary_function, STL functor" url="pointer_to_unary.html"/>
+<entry name="pointer_to_binary_function, STL functor" url="pointer_to_binary.html"/>
+<entry name="unary_negate, STL functor" url="unary_negate.html"/>
+<entry name="binary_negate, STL functor" url="binary_negate.html"/>
+<entry name="unary_compose, STL functor" url="unary_compose.html"/>
+<entry name="binary_compose, STL functor" url="binary_compose.html"/>
+<entry name="mem_fun_t, STL functor" url="mem_fun_t.html"/>
+<entry name="mem_fun_ref_t, STL functor" url="mem_fun_ref_t.html"/>
+<entry name="mem_fun1_t, STL functor" url="mem_fun1_t.html"/>
+<entry name="mem_fun1_ref_t, STL functor" url="mem_fun1_ref_t.html"/>
+<entry name="pair, STL class" url="pair.html"/>
+<entry name="priority_queue, STL" url="priority_queue.html"/>
+</index>
+</kdeveloptoc>
+
diff --git a/languages/cpp/doc/wxwidgets_bugs.toc b/languages/cpp/doc/wxwidgets_bugs.toc
new file mode 100644
index 00000000..f7bb39c7
--- /dev/null
+++ b/languages/cpp/doc/wxwidgets_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>wxWidgets bugs</title>
+<base href="http://sourceforge.net/"/>
+<tocsect1 name="Query" url="tracker/?group_id=9863&amp;atid=109863">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/cpp/doxydoc.cpp b/languages/cpp/doxydoc.cpp
new file mode 100644
index 00000000..bcd36faa
--- /dev/null
+++ b/languages/cpp/doxydoc.cpp
@@ -0,0 +1,148 @@
+/***************************************************************************
+* Copyright (C) 2003 by Jonas B. Jacobi *
+* j.jacobi@gmx.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 "doxydoc.h"
+
+#include <list>
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qdom.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
+
+void DoxyDoc::formatType( QString& str )
+{
+ str.replace( QRegExp( " " ), "" );
+}
+
+DoxyDoc::DoxyDoc( const QStringList& dir )
+{
+ for ( uint i = 0; i < dir.count(); ++i )
+ m_dirs.push_back( QDir( *( dir.at( i ) ) ) );
+}
+
+//crappy implementation, change later
+QString DoxyDoc::functionDescription( const QString& tmpscope, const QString& name,
+ const QString& tmptype, const QString& tmparguments )
+{
+ QString scope = tmpscope;
+ bool foundfile = false;
+ //produce doxygen conform filenames
+ QString filename = "/class" + scope.replace( QRegExp( "_" ), "__" ).replace( QRegExp( "::" ), "_1_1" ) + ".xml";
+
+ //search for file in all directories
+ for ( std::list<QDir>::const_iterator ci = m_dirs.begin(); !foundfile && ci != m_dirs.end(); ++ci )
+ {
+ if ( QFile::exists( ci->path() + filename ) )
+ {
+ if ( m_file.name() != ci->path() + filename )
+ {
+ m_file.close();
+ m_file.setName( ci->path() + filename );
+ if ( !m_file.open( IO_ReadOnly ) )
+ {
+ m_file.setName( "" );
+ return "";
+ }
+ QDomDocument m_doc;
+ m_doc.setContent( m_file.readAll() );
+ m_file.close();
+ m_list = m_doc.elementsByTagName( "memberdef" );
+ foundfile = true;
+
+ }
+ else //file is already opened
+ foundfile = true;
+ }
+ }
+ if ( !foundfile )
+ return QString::null;
+
+ QString type = tmptype;
+ formatType( type );
+
+ for ( uint i = 0; i < m_list.count(); ++i )
+ {
+ QDomElement elem = m_list.item( i ).toElement();
+ if ( elem.elementsByTagName( "name" ).item( 0 ).toElement().text() == name &&
+ elem.elementsByTagName( "type" ).item( 0 ).toElement().text() == tmptype )
+ {
+ QDomNodeList paramnodes = elem.elementsByTagName( "param" );
+ QString nodearguments = "", arguments = tmparguments;
+ for ( unsigned int j = 0; j < paramnodes.count(); ++j )
+ nodearguments += paramnodes.item( j ).childNodes().item( 0 ).toElement().text() + ",";
+ if ( nodearguments != "" )
+ {
+ nodearguments = nodearguments.left( nodearguments.length() - 1 );
+ formatType( nodearguments );
+ }
+ formatType( arguments );
+ if ( arguments == nodearguments )
+ {
+ QString brief = "";
+ QDomNode briefnode = elem.elementsByTagName( "briefdescription" ).item( 0 );
+ if ( briefnode.hasChildNodes() )
+ brief = briefnode.firstChild().toElement().text();
+
+ QString detailstr = "", paramstr = "";
+ QDomNode detail = elem.elementsByTagName( "detaileddescription" ).item( 0 );
+ if ( detail.hasChildNodes() )
+ detail = detail.firstChild();
+
+ QDomNode descnode = detail.firstChild();
+ while ( !descnode.isNull() )
+ {
+ if ( descnode.nodeName() == "parameterlist" )
+ {
+ int tmpcount = descnode.childNodes().count();
+ for ( int k = 0; k < tmpcount; ++k )
+ {
+ //add parametername
+ paramstr += "<li><i>" + descnode.childNodes().item( k++ ).toElement().text() + "</i>\t";
+ //add parameterdescription
+ paramstr += descnode.childNodes().item( k ).toElement().text() + "</li>";
+ }
+ }
+ else
+ if ( descnode.nodeName() == "simplesect" )
+ {}
+ else
+ {
+ if ( descnode.isText() )
+ detailstr += descnode.toText().data();
+ else
+ detailstr += descnode.toElement().text();
+ }
+ descnode = descnode.nextSibling();
+ }
+
+
+ QString description = "";
+ if ( brief != "" )
+ description += brief + "<p>";
+ if ( detailstr != "" )
+ description += detailstr + "<p>";
+ if ( paramstr != "" )
+ description += "<b>Parameterlist:</b><p>" + paramstr;
+
+ if ( description == "" )
+ return QString::null;
+ else
+ return description;
+ }
+ }
+
+ }
+
+ return QString::null;
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/doxydoc.h b/languages/cpp/doxydoc.h
new file mode 100644
index 00000000..aca424b2
--- /dev/null
+++ b/languages/cpp/doxydoc.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+* Copyright (C) 2003 by Jonas B. Jacobi *
+* j.jacobi@gmx.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 DOXYDOC_H
+#define DOXYDOC_H
+
+#include <qstring.h>
+#include <qdom.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <list>
+
+/**
+This class is used for getting the description on functions, stored in xml files, which are created by Doxygen
+@author Jonas B. Jacobi
+@version 0.1
+*/
+class DoxyDoc
+{
+public:
+ /**
+ Constructs a new DoxyDoc object.
+ @param dir all directories, which should be searched for files containing the Doxygen-documentation.
+ */
+ DoxyDoc( const QStringList& dir );
+ ~DoxyDoc()
+ {}
+ ;
+ /**
+ Get the documentation referring to a special function, therefor most parts of the functions signature have to be provided
+ @param scope Scope of the function (e.g. name of class, it is member of, namespace etc ...)
+ @param name Name of the function(just the name, no '(' etc. )
+ @param type Return-type of the function
+ @param arguments String containing the arguments of the function, separated by commas and _without_ the argument names
+ */
+ QString functionDescription( const QString& scope, const QString& name, const QString& type, const QString& arguments );
+ /*not implemented yet, maybe later, if they are useful
+ QString classDescription();
+ QString enumDescription();
+ QString namespaceDescription();
+ QString memberVarDescription();
+ */
+private:
+ static void formatType( QString& type );
+ std::list<QDir> m_dirs;
+ //used for temporary storing/performance reasons
+ QFile m_file;
+ QDomNodeList m_list;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/expressioninfo.h b/languages/cpp/expressioninfo.h
new file mode 100644
index 00000000..836a2292
--- /dev/null
+++ b/languages/cpp/expressioninfo.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 EXPRESSIONINFO_H
+#define EXPRESSIONINFO_H
+
+#include "stringhelpers.h"
+
+using namespace StringHelpers;
+
+struct ExpressionInfo {
+ private:
+ QString m_expr;
+
+ public:
+
+ enum Type {
+ InvalidExpression = 0,
+ NormalExpression = 1,
+ TypeExpression = 2
+ };
+
+ Type t;
+ int start, end;
+
+ QString expr() {
+ return m_expr;
+ }
+
+ void setExpr( const QString& str ) {
+ m_expr = clearComments( str );
+ }
+
+ ExpressionInfo( QString str ) : t( NormalExpression ), start( 0 ), end( str.length() ) {
+ setExpr( str );
+
+ }
+
+ ExpressionInfo() : t( InvalidExpression ), start(0), end(0) {
+ }
+
+ operator bool() {
+ return t != InvalidExpression && !m_expr.isEmpty();
+ }
+
+ bool isTypeExpression() {
+ return t == TypeExpression && !m_expr.isEmpty();
+ }
+
+ bool canBeTypeExpression() {
+ return t & TypeExpression && !m_expr.isEmpty();
+ }
+
+ bool isNormalExpression() {
+ return t == NormalExpression && !m_expr.isEmpty();
+ }
+
+ bool canBeNormalExpression() {
+ return t & NormalExpression && !m_expr.isEmpty();
+ }
+
+ QString typeAsString() {
+ QString res ;
+ if( t & NormalExpression )
+ res += "NormalExpression, ";
+ if( t & TypeExpression )
+ res += "TypeExpression, ";
+ if( t == InvalidExpression )
+ res += "InvalidExpression, ";
+ if( !res.isEmpty() ) {
+ res = res.left( res.length() - 2 );
+ } else {
+ res = "Unknown";
+ }
+ return res;
+ }
+};
+
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/file_templates/Makefile.am b/languages/cpp/file_templates/Makefile.am
new file mode 100644
index 00000000..d688d547
--- /dev/null
+++ b/languages/cpp/file_templates/Makefile.am
@@ -0,0 +1,3 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = c cpp h l ll y yy
+
diff --git a/languages/cpp/file_templates/c b/languages/cpp/file_templates/c
new file mode 100644
index 00000000..29d5dfd0
--- /dev/null
+++ b/languages/cpp/file_templates/c
@@ -0,0 +1,11 @@
+/*
+* C Implementation: $MODULE$
+*
+* Description:
+*
+*
+* Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+*
+* Copyright: See COPYING file that comes with this distribution
+*
+*/
diff --git a/languages/cpp/file_templates/cpp b/languages/cpp/file_templates/cpp
new file mode 100644
index 00000000..23b3f500
--- /dev/null
+++ b/languages/cpp/file_templates/cpp
@@ -0,0 +1,11 @@
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/cpp/file_templates/h b/languages/cpp/file_templates/h
new file mode 100644
index 00000000..4e987ea1
--- /dev/null
+++ b/languages/cpp/file_templates/h
@@ -0,0 +1,11 @@
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/cpp/file_templates/l b/languages/cpp/file_templates/l
new file mode 100644
index 00000000..39a8d138
--- /dev/null
+++ b/languages/cpp/file_templates/l
@@ -0,0 +1,35 @@
+/*
+ *
+ * flex Implementation: $MODULE$
+ *
+ * Description:
+ *
+ *
+ * Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ *
+ */
+
+/*
+ *
+ * Use options
+ *
+ * %option prefix="foo"
+ * %option outfile="lex.yy.c"
+ *
+ * to create multiple flex scanner in one project.
+ *
+ */
+
+%{
+
+
+%}
+
+%option debug
+
+%%
+
+
+%%
diff --git a/languages/cpp/file_templates/ll b/languages/cpp/file_templates/ll
new file mode 100644
index 00000000..96daef19
--- /dev/null
+++ b/languages/cpp/file_templates/ll
@@ -0,0 +1,42 @@
+/*
+ *
+ * flex C++ implementation: $MODULE$
+ *
+ * Description:
+ *
+ *
+ * Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ *
+ */
+
+/*
+ *
+ * Use options
+ *
+ * %option prefix="foo"
+ * %option outfile="lex.yy.c"
+ *
+ * to create multiple flex scanner in one project.
+ *
+ *
+ * To create scanner class:
+ *
+ * %option c++
+ *
+ * (see '%option yyclass' also!)
+ *
+ */
+
+%{
+
+
+%}
+
+%option debug
+
+%%
+
+
+%%
diff --git a/languages/cpp/file_templates/y b/languages/cpp/file_templates/y
new file mode 100644
index 00000000..67180e42
--- /dev/null
+++ b/languages/cpp/file_templates/y
@@ -0,0 +1,40 @@
+/*
+ *
+ * bison/yacc Implementation: $MODULE$
+ *
+ * Description:
+ *
+ *
+ * Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ *
+ */
+
+/*
+ *
+ * Use options
+ *
+ * %name-prefix="foo"
+ * %yacc
+ *
+ * to create multiple parsers in one project.
+ *
+ */
+
+%{
+
+
+
+%}
+
+%debug
+
+%%
+
+
+
+
+
+%%
+
diff --git a/languages/cpp/file_templates/yy b/languages/cpp/file_templates/yy
new file mode 100644
index 00000000..dab32b85
--- /dev/null
+++ b/languages/cpp/file_templates/yy
@@ -0,0 +1,40 @@
+/*
+ *
+ * bison/yacc C++ Implementation: $MODULE$
+ *
+ * Description:
+ *
+ *
+ * Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ *
+ */
+
+/*
+ *
+ * Use options
+ *
+ * %name-prefix="foo"
+ * %yacc
+ *
+ * to create multiple parsers in one project.
+ *
+ */
+
+%{
+
+
+
+%}
+
+%debug
+
+%%
+
+
+
+
+
+%%
+
diff --git a/languages/cpp/includefiles.cpp b/languages/cpp/includefiles.cpp
new file mode 100644
index 00000000..fe945d25
--- /dev/null
+++ b/languages/cpp/includefiles.cpp
@@ -0,0 +1,2 @@
+#include"includefiles.h"
+
diff --git a/languages/cpp/includefiles.h b/languages/cpp/includefiles.h
new file mode 100644
index 00000000..5fe9a339
--- /dev/null
+++ b/languages/cpp/includefiles.h
@@ -0,0 +1,14 @@
+#ifndef INCLUDE_FILES_H
+#define INCLUDE_FILES_H
+
+#include<hashedstring.h>
+
+typedef HashedStringSet IncludeFiles;
+
+class PathFileSearch {
+public:
+private:
+
+};
+
+#endif
diff --git a/languages/cpp/includepathresolver.cpp b/languages/cpp/includepathresolver.cpp
new file mode 100644
index 00000000..117c7732
--- /dev/null
+++ b/languages/cpp/includepathresolver.cpp
@@ -0,0 +1,577 @@
+/***************************************************************************
+ copyright : (C) 2007 by David Nolden
+ email : david.nolden.kdevelop@art-master.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. *
+ * *
+ ***************************************************************************/
+
+/** Compatibility:
+ * make/automake: Should work perfectly
+ * cmake: Thanks to the path-recursion, this works with cmake(tested with version "2.4-patch 6" tested with kdelibs out-of-source and with kdevelop4 in-source)
+ *
+ *
+ * unsermake:
+ * unsermake is detected by reading the first line of the makefile. If it contains "generated by unsermake" the following things are respected:
+ * 1. Since unsermake does not have the -W command(which should tell it to recompile the given file no matter whether it has been changed or not), the file-modification-time of the file is changed temporarily and the --no-real-compare option is used to force recompilation.
+ * 2. The targets seem to be called *.lo instead of *.o when using unsermake, so *.lo names are used.
+ * example-(test)command: unsermake --no-real-compare -n myfile.lo
+ **/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <memory>
+#include "kurl.h" /* defines KURL */
+#include "qdir.h" /* defines QDir */
+#include "qregexp.h" /* defines QRegExp */
+#include "klocale.h" /* defines [function] i18n */
+#include "blockingkprocess.h" /* defines BlockingKProcess */
+#include "includepathresolver.h"
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdlib.h>
+
+#ifdef TEST
+#include "blockingkprocess.cpp"
+
+#include <iostream>
+using namespace std;
+#endif
+
+#ifndef TEST
+#define ifTest(x) {}
+#else
+#define ifTest(x) x
+#endif
+
+///After how many seconds should we retry?
+#define CACHE_FAIL_FOR_SECONDS 200
+
+using namespace CppTools;
+
+
+namespace CppTools {
+ ///Helper-class used to fake file-modification times
+ class FileModificationTimeWrapper {
+ public:
+ ///@param files list of files that should be fake-modified(modtime will be set to current time)
+ FileModificationTimeWrapper( const QStringList& files = QStringList() ) : m_newTime( time(0) ) {
+ for( QStringList::const_iterator it = files.begin(); it != files.end(); ++it ) {
+ ifTest( cout << "touching " << (*it).ascii() << endl );
+ struct stat s;
+ if( stat( (*it).local8Bit().data(), &s ) == 0 ) {
+ ///Success
+ m_stat[*it] = s;
+ ///change the modification-time to m_newTime
+ struct timeval times[2];
+ times[0].tv_sec = m_newTime;
+ times[0].tv_usec = 0;
+ times[1].tv_sec = m_newTime;
+ times[1].tv_usec = 0;
+
+ if( utimes( (*it).local8Bit().data(), times ) != 0 )
+ {
+ ifTest( cout << "failed to touch " << (*it).ascii() << endl );
+ }
+ }
+ }
+ }
+
+ //Not used yet, might be used to return LD_PRELOAD=.. FAKE_MODIFIED=.. etc. later
+ QString commandPrefix() const {
+ return QString();
+ }
+
+ ///Undo changed modification-times
+ void unModify() {
+ for( StatMap::const_iterator it = m_stat.begin(); it != m_stat.end(); ++it ) {
+
+ ifTest( cout << "untouching " << it.key().ascii() << endl );
+
+ struct stat s;
+ if( stat( it.key().local8Bit().data(), &s ) == 0 ) {
+ if( s.st_mtime == m_newTime ) {
+ ///Still the modtime that we've set, change it back
+ struct timeval times[2];
+ times[0].tv_usec = 0;
+ times[0].tv_sec = s.st_atime;
+ times[1].tv_usec = 0;
+ times[1].tv_sec = (*it).st_mtime;
+ if( utimes( it.key().local8Bit().data(), times ) != 0 ) {
+ ifTest( cout << "failed to untouch " << it.key().ascii() << endl );
+ }
+ } else {
+ ///The file was modified since we changed the modtime
+ ifTest( cout << " will not untouch " << it.key().ascii() << " because the modification-time has changed" << endl );
+ }
+ }
+ }
+ };
+
+ ~FileModificationTimeWrapper() {
+ unModify();
+ }
+
+ private:
+ typedef QMap<QString, struct stat> StatMap;
+ StatMap m_stat;
+ time_t m_newTime;
+ };
+
+ class SourcePathInformation {
+ public:
+ SourcePathInformation( const QString& path ) : m_path( path ), m_isUnsermake(false), m_shouldTouchFiles(false) {
+ m_isUnsermake = isUnsermakePrivate( path );
+
+ ifTest( if( m_isUnsermake ) cout << "unsermake detected" << endl );
+ }
+
+ bool isUnsermake() const {
+ return m_isUnsermake;
+ }
+
+ ///When this is set, the file-modification times are changed no matter whether it is unsermake or make
+ void setShouldTouchFiles(bool b) {
+ m_shouldTouchFiles = b;
+ }
+
+ QString getCommand( const QString& sourceFile, const QString& makeParameters ) const {
+ if( isUnsermake() )
+ return "unsermake -k --no-real-compare -n " + makeParameters;
+ else
+ return "make -k --no-print-directory -W \'" + sourceFile + "\' -n " + makeParameters;
+ }
+
+ bool hasMakefile() const {
+ QFileInfo makeFile( m_path, "Makefile" );
+ return makeFile.exists();
+ }
+
+ bool shouldTouchFiles() const {
+ return isUnsermake() || m_shouldTouchFiles;
+ }
+
+ QStringList possibleTargets( const QString& targetBaseName ) const {
+ QStringList ret;
+ if( isUnsermake() ) {
+ //unsermake breaks if the first given target does not exist, so in worst-case 2 calls are necessary
+ ret << targetBaseName + ".lo";
+ ret << targetBaseName + ".o";
+ } else {
+ //It would be nice if both targets could be processed in one call, the problem is the exit-status of make, so for now make has to be called twice.
+ ret << targetBaseName + ".o";
+ ret << targetBaseName + ".lo";
+ //ret << targetBaseName + ".lo " + targetBaseName + ".o";
+ }
+ return ret;
+ }
+
+ private:
+ bool isUnsermakePrivate( const QString& path ) {
+ bool ret = false;
+ QFileInfo makeFile( path, "Makefile" );
+ QFile f( makeFile.absFilePath() );
+ if( f.open( IO_ReadOnly ) ) {
+ QString firstLine;
+ f.readLine( firstLine, 1000 );
+ if( firstLine.find( "generated by unsermake" ) != -1 ) {
+ ret = true;
+ }
+ f.close();
+ }
+ return ret;
+ }
+
+ QString m_path;
+ bool m_isUnsermake;
+ bool m_shouldTouchFiles;
+ };
+
+};
+
+bool IncludePathResolver::executeCommandPopen ( const QString& command, const QString& workingDirectory, QString& result ) const
+{
+ ifTest( cout << "executing " << command.ascii() << endl );
+
+ char* oldWd = getcwd(0,0);
+ chdir( workingDirectory.local8Bit() );
+
+ FILE* fp;
+ const int BUFSIZE = 2048;
+ char buf [BUFSIZE];
+
+ result = QString();
+
+ int status = 1;
+ if ((fp = popen(command.local8Bit(), "r")) != NULL) {
+ while (fgets(buf, sizeof (buf), fp))
+ result += QString(buf);
+
+ status = pclose(fp);
+ }
+
+ if( oldWd ) {
+ chdir( oldWd );
+ free( oldWd );
+ }
+ return status == 0;
+}
+
+IncludePathResolver::IncludePathResolver( bool continueEventLoop ) : m_isResolving(false), m_outOfSource(false), m_continueEventLoop(continueEventLoop) {
+/* m_continueEventLoop = false;
+#warning DEBUGGING TEST, REMOVE THIS*/
+}
+
+///More efficient solution: Only do exactly one call for each directory. During that call, mark all source-files as changed, and make all targets for those files.
+PathResolutionResult IncludePathResolver::resolveIncludePath( const QString& file ) {
+ QFileInfo fi( file );
+ return resolveIncludePath( fi.fileName(), fi.dirPath(true) );
+}
+
+PathResolutionResult IncludePathResolver::resolveIncludePath( const QString& file, const QString& workingDirectory ) {
+
+ struct Enabler {
+ bool& b;
+ Enabler( bool& bb ) : b(bb) {
+ b = true;
+ }
+ ~Enabler() {
+ b = false;
+ }
+ };
+
+ if( m_isResolving )
+ return PathResolutionResult(false, i18n("tried include-path-resolution while another resolution-process was still running") );
+
+ Enabler e( m_isResolving );
+
+ ///STEP 1: CACHING
+ QDir dir( workingDirectory );
+ dir = QDir( dir.absPath() );
+ QFileInfo makeFile( dir, "Makefile" );
+ if( !makeFile.exists() )
+ return PathResolutionResult(false, i18n("Makefile is missing in folder \"%1\"").arg(dir.absPath()), i18n("problem while trying to resolve include-paths for %1").arg(file) );
+
+ QStringList cachedPath; //If the call doesn't succeed, use the cached not up-to-date version
+ QDateTime makeFileModification = makeFile.lastModified();
+ Cache::iterator it = m_cache.find( dir.path() );
+ if( it != m_cache.end() ) {
+ cachedPath = (*it).path;
+ if( makeFileModification == (*it).modificationTime ) {
+ if( !(*it).failed ) {
+ //We have a valid cached result
+ PathResolutionResult ret(true);
+ ret.path = (*it).path;
+ return ret;
+ } else {
+ //We have a cached failed result. We should use that for some time but then try again. Return the failed result if: ( there were too many tries within this folder OR this file was already tried ) AND The last tries have not expired yet
+ if( /*((*it).failedFiles.size() > 3 || (*it).failedFiles.find( file ) != (*it).failedFiles.end()) &&*/ (*it).failTime.secsTo( QDateTime::currentDateTime() ) < CACHE_FAIL_FOR_SECONDS ) {
+ PathResolutionResult ret(false); //Fake that the result is ok
+ ret.errorMessage = i18n("Cached: ") + (*it).errorMessage;
+ ret.longErrorMessage = (*it).longErrorMessage;
+ ret.path = (*it).path;
+ return ret;
+ } else {
+ //Try getting a correct result again
+ }
+ }
+ }
+ }
+
+ ///STEP 1: Prepare paths
+ QString targetName;
+ QFileInfo fi( file );
+
+ QString absoluteFile = file;
+ if( !file.startsWith("/") )
+ absoluteFile = dir.path() + "/" + file;
+ KURL u( absoluteFile );
+ u.cleanPath();
+ absoluteFile = u.path();
+
+ int dot;
+ if( (dot = file.findRev( '.' )) == -1 )
+ return PathResolutionResult( false, i18n( "Filename %1 seems to be malformed" ).arg(file) );
+
+ targetName = file.left( dot );
+
+ QString wd = dir.path();
+ if( !wd.startsWith("/") ) {
+ wd = QDir::currentDirPath() + "/" + wd;
+ KURL u( wd );
+ u.cleanPath();
+ wd = u.path();
+ }
+ if( m_outOfSource ) {
+ if( wd.startsWith( m_source ) ) {
+ //Move the current working-directory out of source, into the build-system
+ wd = m_build + "/" + wd.mid( m_source.length() );
+ KURL u( wd );
+ u.cleanPath();
+ wd = u.path();
+ }
+ }
+
+ SourcePathInformation source( wd );
+ QStringList possibleTargets = source.possibleTargets( targetName );
+
+ source.setShouldTouchFiles(true); //Think about whether this should be always enabled. I've enabled it for now so there's an even bigger chance that everything works.
+
+ ///STEP 3: Try resolving the paths, by using once the absolute and once the relative file-path. Which kind is required differs from setup to setup.
+
+ ///STEP 3.1: Try resolution using the absolute path
+ PathResolutionResult res;
+ //Try for each possible target
+ for( QStringList::const_iterator it = possibleTargets.begin(); it != possibleTargets.end(); ++it ) {
+ res = resolveIncludePathInternal( absoluteFile, wd, *it, source );
+ if( res ) break;
+ }
+ if( res ) {
+ CacheEntry ce;
+ ce.errorMessage = res.errorMessage;
+ ce.longErrorMessage = res.longErrorMessage;
+ ce.modificationTime = makeFileModification;
+ ce.path = res.path;
+ m_cache[dir.path()] = ce;
+
+ return res;
+ }
+
+
+ ///STEP 3.2: Try resolution using the relative path
+ QString relativeFile = KURL::relativePath(wd, absoluteFile);
+ for( QStringList::const_iterator it = possibleTargets.begin(); it != possibleTargets.end(); ++it ) {
+ res = resolveIncludePathInternal( relativeFile, wd, *it, source );
+ if( res ) break;
+ }
+
+ if( res.path.isEmpty() )
+ res.path = cachedPath; //We failed, maybe there is an old cached result, use that.
+
+ if( it == m_cache.end() )
+ it = m_cache.insert( dir.path(), CacheEntry() );
+
+ CacheEntry& ce(*it);
+ ce.modificationTime = makeFileModification;
+ ce.path = res.path;
+ if( !res ) {
+ ce.failed = true;
+ ce.errorMessage = res.errorMessage;
+ ce.longErrorMessage = res.longErrorMessage;
+ ce.failTime = QDateTime::currentDateTime();
+ ce.failedFiles[file] = true;
+ } else {
+ ce.failed = false;
+ ce.failedFiles.clear();
+ }
+
+ return res;
+}
+
+PathResolutionResult IncludePathResolver::getFullOutput( const QString& command, const QString& workingDirectory, QString& output ) const{
+ if( m_continueEventLoop ) {
+ BlockingKProcess proc;
+ proc.setWorkingDirectory( workingDirectory );
+ proc.setUseShell( true );
+ proc << command;
+ if ( !proc.start(KProcess::NotifyOnExit, KProcess::Stdout) ) {
+ return PathResolutionResult( false, i18n("Could not start the make-process") );
+ }
+
+ output = proc.stdOut();
+ if( proc.exitStatus() != 0 )
+ return PathResolutionResult( false, i18n("make-process finished with nonzero exit-status"), i18n("output: %1").arg( output ) );
+ } else {
+ bool ret = executeCommandPopen(command, workingDirectory, output);
+
+ if( !ret )
+ return PathResolutionResult( false, i18n("make-process failed"), i18n("output: %1").arg( output ) );
+ }
+ return PathResolutionResult(true);
+}
+
+PathResolutionResult IncludePathResolver::resolveIncludePathInternal( const QString& file, const QString& workingDirectory, const QString& makeParameters, const SourcePathInformation& source ) {
+
+ QString processStdout;
+
+ QStringList touchFiles;
+ if( source.shouldTouchFiles() )
+ touchFiles << file;
+
+ FileModificationTimeWrapper touch( touchFiles );
+
+ QString fullOutput;
+ PathResolutionResult res = getFullOutput( source.getCommand( file, makeParameters ), workingDirectory, fullOutput );
+ if( !res )
+ return res;
+
+ QRegExp newLineRx("\\\\\\n");
+ fullOutput.replace( newLineRx, "" );
+ ///@todo collect multiple outputs at the same time for performance-reasons
+ QString firstLine = fullOutput;
+ int lineEnd;
+ if( (lineEnd = fullOutput.find('\n')) != -1 )
+ firstLine.truncate( lineEnd ); //Only look at the first line of output
+
+ /**
+ * There's two possible cases this can currently handle.
+ * 1.: gcc is called, with the parameters we are searching for(so we parse the parameters)
+ * 2.: A recursive make is called, within another directory(so we follow the recursion and try again) "cd /foo/bar && make -f pi/pa/build.make pi/pa/po.o
+ * */
+
+
+ ///STEP 1: Test if it is a recursive make-call
+ QRegExp makeRx( "\\bmake\\s" );
+ int offset = 0;
+ while( (offset = makeRx.search( firstLine, offset )) != -1 )
+ {
+ QString prefix = firstLine.left( offset ).stripWhiteSpace();
+ if( prefix.endsWith( "&&") || prefix.endsWith( ";" ) || prefix.isEmpty() )
+ {
+ QString newWorkingDirectory = workingDirectory;
+ ///Extract the new working-directory
+ if( !prefix.isEmpty() ) {
+ if( prefix.endsWith( "&&" ) )
+ prefix.truncate( prefix.length() - 2 );
+ else if( prefix.endsWith( ";" ) )
+ prefix.truncate( prefix.length() - 1 );
+ ///Now test if what we have as prefix is a simple "cd /foo/bar" call.
+ if( prefix.startsWith( "cd ") && !prefix.contains( ";") && !prefix.contains("&&") ) {
+ newWorkingDirectory = prefix.right( prefix.length() - 3 ).stripWhiteSpace();
+ if( !newWorkingDirectory.startsWith("/") )
+ newWorkingDirectory = workingDirectory + "/" + newWorkingDirectory;
+ KURL u( newWorkingDirectory );
+ u.cleanPath();
+ newWorkingDirectory = u.path();
+ }
+ }
+ QFileInfo d( newWorkingDirectory );
+ if( d.exists() ) {
+ ///The recursive working-directory exists.
+ QString makeParams = firstLine.mid( offset+5 );
+ if( !makeParams.contains( ";" ) && !makeParams.contains( "&&" ) ) {
+ ///Looks like valid parameters
+ ///Make the file-name absolute, so it can be referenced from any directory
+ QString absoluteFile = file;
+ if( !absoluteFile.startsWith("/") )
+ absoluteFile = workingDirectory + "/" + file;
+ KURL u( absoluteFile );
+ u.cleanPath();
+ ///Try once with absolute, and if that fails with relative path of the file
+ SourcePathInformation newSource( newWorkingDirectory );
+ PathResolutionResult res = resolveIncludePathInternal( u.path(), newWorkingDirectory, makeParams, newSource );
+ if( res )
+ return res;
+ return resolveIncludePathInternal( KURL::relativePath(newWorkingDirectory,u.path()), newWorkingDirectory, makeParams , newSource );
+ }else{
+ return PathResolutionResult( false, i18n("Recursive make-call failed"), i18n("The parameter-string \"%1\" does not seem to be valid. Output was: %2").arg(makeParams).arg(fullOutput) );
+ }
+ } else {
+ return PathResolutionResult( false, i18n("Recursive make-call failed"), i18n("The directory \"%1\" does not exist. Output was: %2").arg(newWorkingDirectory).arg(fullOutput) );
+ }
+
+ } else {
+ return PathResolutionResult( false, i18n("Recursive make-call malformed"), i18n("Output was: %2").arg(fullOutput) );
+ }
+
+ ++offset;
+ if( offset >= firstLine.length() ) break;
+ }
+
+ ///STEP 2: Search the output for include-paths
+ QRegExp validRx( "\\b([cg]\\+\\+|gcc)" );
+ if( validRx.search( fullOutput ) == -1 )
+ return PathResolutionResult( false, i18n("Output seems not to be a valid gcc or g++ call"), i18n("Folder: \"%1\" Command: \"%2\" Output: \"%3\"").arg(workingDirectory).arg( source.getCommand(file, makeParameters) ).arg(fullOutput) );
+
+ PathResolutionResult ret( true );
+ ret.longErrorMessage = fullOutput;
+
+ QString includeParameterRx( "\\s(-I|--include-dir=|-I\\s)" );
+ QString quotedRx( "(\\').*(\\')|(\\\").*(\\\")" ); //Matches "hello", 'hello', 'hello"hallo"', etc.
+ QString escapedPathRx( "(([^)(\"'\\s]*)(\\\\\\s)?)*" ); //Matches /usr/I\ am \ a\ strange\ path/include
+
+ QRegExp includeRx( QString( "%1(%2|%3)(?=\\s)" ).arg( includeParameterRx ).arg( quotedRx ).arg( escapedPathRx ) );
+ includeRx.setMinimal( true );
+ includeRx.setCaseSensitive( true );
+ offset = 0;
+ while( (offset = includeRx.search( fullOutput, offset )) != -1 ) {
+ offset += 1; ///The previous white space
+ int pathOffset = 2;
+ if( fullOutput[offset+1] == '-' ) {
+ ///Must be --include-dir=, with a length of 14 characters
+ pathOffset = 14;
+ }
+ if( fullOutput.length() <= offset + pathOffset )
+ break;
+
+ if( fullOutput[offset+pathOffset].isSpace() )
+ pathOffset++;
+
+
+
+ int start = offset + pathOffset;
+ int end = offset + includeRx.matchedLength();
+
+ QString path = fullOutput.mid( start, end-start ).stripWhiteSpace();
+ if( path.startsWith( "\"") || path.startsWith( "\'") && path.length() > 2 ) {
+ //probable a quoted path
+ if( path.endsWith(path.left(1)) ) {
+ //Quotation is ok, remove it
+ path = path.mid( 1, path.length() - 2 );
+ }
+ }
+ if( !path.startsWith("/") )
+ path = workingDirectory + (workingDirectory.endsWith("/") ? "" : "/") + path;
+
+ KURL u( path );
+ u.cleanPath();
+
+ ret.path << u.path();
+
+ offset = end-1;
+ }
+
+
+ return ret;
+}
+
+void IncludePathResolver::setOutOfSourceBuildSystem( const QString& source, const QString& build ) {
+ m_outOfSource = true;
+ m_source = source;
+ m_build = build;
+}
+
+#ifdef TEST
+/** This can be used for testing and debugging the system. To compile it use
+ * gcc includepathresolver.cpp -I /usr/share/qt3/include -I /usr/include/kde -I ../../lib/util -DTEST -lkdecore -g -o includepathresolver
+ * */
+
+int main(int argc, char **argv) {
+ QApplication app(argc,argv);
+ IncludePathResolver resolver;
+ if( argc < 3 ) {
+ cout << "params: 1. file-name, 2. working-directory [3. source-directory 4. build-directory]" << endl;
+ return 1;
+ }
+ if( argc >= 5 ) {
+ cout << "mapping " << argv[3] << " -> " << argv[4] << endl;
+ resolver.setOutOfSourceBuildSystem( argv[3], argv[4] );
+ }
+ PathResolutionResult res = resolver.resolveIncludePath( argv[1], argv[2] );
+ cout << "success: " << res.success << "\n";
+ if( !res.success ) {
+ cout << "error-message: \n" << res.errorMessage << "\n";
+ cout << "long error-message: \n" << res.longErrorMessage << "\n";
+ }
+ cout << "path: \n" << res.path.join("\n");
+ return res.success;
+}
+
+#endif
diff --git a/languages/cpp/includepathresolver.h b/languages/cpp/includepathresolver.h
new file mode 100644
index 00000000..c182d52e
--- /dev/null
+++ b/languages/cpp/includepathresolver.h
@@ -0,0 +1,76 @@
+/***************************************************************************
+ copyright : (C) 2007 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 INCLUDEPATHRESOLVER_H
+#define INCLUDEPATHRESOLVER_H
+#include <qstring.h> /* defines QString */
+#include <qmap.h>
+
+namespace CppTools {
+ class FileModificationTimeWrapper;
+
+ struct PathResolutionResult {
+ PathResolutionResult( bool _success = false, const QString& _errorMessage = QString(), const QString& _longErrorMessage = QString() ) : success( _success ), errorMessage( _errorMessage ), longErrorMessage( _longErrorMessage ) {
+ }
+ bool success;
+ QString errorMessage;
+ QString longErrorMessage;
+
+ QStringList path;
+
+ operator bool() const {
+ return success;
+ };
+ };
+
+ class SourcePathInformation;
+
+ ///One resolution-try can issue up to 4 make-calls in worst case
+ class IncludePathResolver {
+ public:
+ ///Whether the Qt event-loop should be continued(using BlockingKProcess). This crashes if enabled in a non-foreground thread.
+ IncludePathResolver( bool continueEventLoop = false );
+ ///Same as below, but uses the directory of the file as working-directory. The argument must be absolute.
+ PathResolutionResult resolveIncludePath( const QString& file );
+ ///The include-path is only computed once for a whole directory, then it is cached using the modification-time of the Makefile.
+ PathResolutionResult resolveIncludePath( const QString& file, const QString& workingDirectory );
+ ///source and build must be absolute paths
+ void setOutOfSourceBuildSystem( const QString& source, const QString& build );
+ private:
+ bool m_isResolving;
+ bool m_continueEventLoop;
+ struct CacheEntry {
+ CacheEntry() : failed(false) {
+ }
+ QDateTime modificationTime;
+ QStringList path;
+ QString errorMessage, longErrorMessage;
+ bool failed;
+ QMap<QString,bool> failedFiles;
+ QDateTime failTime;
+ };
+ typedef QMap<QString, CacheEntry> Cache;
+ Cache m_cache;
+
+ ///Executes the command, either using popen or BlockingKProcess
+ PathResolutionResult getFullOutput( const QString& command, const QString& workingDirectory, QString& output ) const;
+ bool executeCommandPopen ( const QString& command, const QString& workingDirectory, QString& result ) const;
+ ///file should be the name of the target, without extension(because that may be different)
+ PathResolutionResult resolveIncludePathInternal( const QString& file, const QString& workingDirectory, const QString& makeParameters, const SourcePathInformation& source );
+ bool m_outOfSource;
+ QString m_source;
+ QString m_build;
+ };
+};
+
+#endif
diff --git a/languages/cpp/kdevcppsupport.desktop b/languages/cpp/kdevcppsupport.desktop
new file mode 100644
index 00000000..5283b529
--- /dev/null
+++ b/languages/cpp/kdevcppsupport.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=C++ Support
+Comment[ca]=Suport per a C++
+Comment[da]=C++ understøttelse
+Comment[de]=C++-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη C++
+Comment[es]=Soporte para C++
+Comment[et]=C++ toetus
+Comment[eu]=C++ euskarria
+Comment[fa]=پشتیبانی C++
+Comment[fr]=Prise en charge du langage C++
+Comment[ga]=Tacaíocht C++
+Comment[gl]=Soporte para C++
+Comment[hi]=सी++ समर्थन
+Comment[hu]=C++-támogatás
+Comment[is]=C++ stuðningur
+Comment[it]=Supporto per C++
+Comment[ja]=C++ サポート
+Comment[nds]=Ünnerstütten för C++
+Comment[ne]=C++ समर्थन
+Comment[nl]=Ondersteuning voor C++
+Comment[pl]=Obsługa C++
+Comment[pt]=Suporte a C++
+Comment[pt_BR]=Suporte ao C++
+Comment[ru]=Поддержка языка C++
+Comment[sk]=C++ podpora
+Comment[sl]=Podpora za C++
+Comment[sr]=Подршка за C++
+Comment[sr@Latn]=Podrška za C++
+Comment[sv]=C++ stöd
+Comment[ta]=C++ ஆதரவு
+Comment[tg]=Ёрӣ намудани забони C++
+Comment[tr]=C++ Desteği
+Comment[zh_CN]=C++ 支持
+Comment[zh_TW]=C++ 支援
+Name=KDevCppSupport
+Name[da]=KDevelop C++ understøttelse
+Name[hi]=के-डेव-सीपीपी-समर्थन
+Name[nds]=CPP-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaCpp
+Name[sk]=KDev C++ podpora
+Name[sv]=KDevelop C++ stöd
+Name[ta]=கெடெவ்சிபிபி ஆதரவு
+Name[zh_TW]=KDevelop C++ 支援
+GenericName=C++ Support
+GenericName[ca]=Suport per a C++
+GenericName[da]=C++ understøttelse
+GenericName[de]=Unterstützung für C++
+GenericName[el]=Υποστήριξη C++
+GenericName[es]=Soporte para C++
+GenericName[et]=C++ toetus
+GenericName[eu]=C++ euskarria
+GenericName[fa]=پشتیبانی C++
+GenericName[fr]=Prise en charge du langage C++
+GenericName[ga]=Tacaíocht C++
+GenericName[gl]=Soporte para C++
+GenericName[hi]=सी++ समर्थन
+GenericName[hu]=C++-támogatás
+GenericName[it]=Supporto C++
+GenericName[ja]=C++ サポート
+GenericName[nds]=Ünnerstütten för C++
+GenericName[ne]=C++ समर्थन
+GenericName[nl]=Ondersteuning voor C++
+GenericName[pa]=C++ ਸਹਿਯੋਗ
+GenericName[pl]=Obsługa C++
+GenericName[pt]=Suporte a C++
+GenericName[pt_BR]=Suporte ao C++
+GenericName[ru]=Поддержка языка C++
+GenericName[sk]=C++ podpora
+GenericName[sl]=Podpora za C++
+GenericName[sr]=Подршка за C++
+GenericName[sr@Latn]=Podrška za C++
+GenericName[sv]=C++ stöd
+GenericName[ta]=C++ ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони C++
+GenericName[tr]=C++ Desteği
+GenericName[zh_CN]=C++ 支持
+GenericName[zh_TW]=C++ 支援
+ServiceTypes=KDevelop/LanguageSupport
+Icon=source_cpp
+X-KDE-Library=libkdevcppsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=C++
+X-KDevelop-Args=Cpp
diff --git a/languages/cpp/kdevcppsupport.rc b/languages/cpp/kdevcppsupport.rc
new file mode 100644
index 00000000..37e3fa3a
--- /dev/null
+++ b/languages/cpp/kdevcppsupport.rc
@@ -0,0 +1,30 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevCppSupport" version="9">
+<MenuBar>
+ <Menu name="edit">
+ <Action name="edit_complete_text"/>
+ </Menu>
+
+ <Menu name="edit">
+ <Action name="edit_make_member"/>
+ </Menu>
+
+ <Menu name="view">
+ <Action name="edit_switchheader"/>
+ </Menu>
+
+ <Menu name="project">
+ <Action name="project_newclass" group="project_classes"/>
+ </Menu>
+</MenuBar>
+ <Menu name="hidden">
+ <Action name="edit_create_getter_setter"/>
+ <Action name="edit_navigate"/>
+ <Action name="jump_to_declaration_cursor_context"/>
+ <Action name="jump_to_defintion_cursor_context"/>
+ </Menu>
+<ToolBar name="browserToolBar" position="Top" iconText="IconOnly">
+ <Action name="project_newclass"/>
+</ToolBar>
+</kpartgui>
+
diff --git a/languages/cpp/kdevcsupport.desktop b/languages/cpp/kdevcsupport.desktop
new file mode 100644
index 00000000..2a307625
--- /dev/null
+++ b/languages/cpp/kdevcsupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=C Support
+Comment[ca]=Suport per a C
+Comment[da]=C understøttelse
+Comment[de]=C-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη C
+Comment[es]=Soporte para C
+Comment[et]=C toetus
+Comment[eu]=C euskarria
+Comment[fa]=پشتیبانی سی
+Comment[fr]=Prise en charge du langage C
+Comment[ga]=Tacaíocht C
+Comment[gl]=Soporte para C
+Comment[hi]=सी समर्थन
+Comment[hu]=C-támogatás
+Comment[is]=C stuðningur
+Comment[it]=Supporto per C
+Comment[ja]=C サポート
+Comment[nds]=Ünnerstütten för C
+Comment[ne]=C समर्थन
+Comment[nl]=Ondersteuning voor C
+Comment[pa]=C ਸਹਿਯੋਗ
+Comment[pl]=Obsługa C
+Comment[pt]=Suporte a C
+Comment[pt_BR]=Suporte ao C
+Comment[ru]=Поддержка языка C
+Comment[sk]=C podpora
+Comment[sl]=Podpora za C
+Comment[sr]=Подршка за C
+Comment[sr@Latn]=Podrška za C
+Comment[sv]=C-stöd
+Comment[ta]=C ஆதரவு
+Comment[tg]=Ёрӣ намудани забони C
+Comment[tr]=C Desteği
+Comment[zh_CN]=C 支持
+Comment[zh_TW]=C 支援
+Name=KDevCSupport
+Name[da]=KDevelop C understøttelse
+Name[nds]=C-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaC
+Name[sk]=KDev C podpora
+Name[sv]=KDevelop C-stöd
+Name[zh_TW]=KDevelop C 支援
+GenericName=C Support
+GenericName[ca]=Suport per a C
+GenericName[da]=C understøttelse
+GenericName[de]=Unterstützung für C
+GenericName[el]=Υποστήριξη C
+GenericName[es]=Soporte para C
+GenericName[et]=C toetus
+GenericName[eu]=C euskarria
+GenericName[fa]=پشتیبانی سی
+GenericName[fr]=Prise en charge du langage C
+GenericName[ga]=Tacaíocht C
+GenericName[gl]=Soporte para C
+GenericName[hi]=सी समर्थन
+GenericName[hu]=C-támogatás
+GenericName[it]=Supporto C
+GenericName[ja]=C サポート
+GenericName[nds]=Ünnerstütten för C
+GenericName[ne]=C समर्थन
+GenericName[nl]=Ondersteuning voor C
+GenericName[pa]=C ਸਹਿਯੋਗ
+GenericName[pl]=Obsługa C
+GenericName[pt]=Suporte a C
+GenericName[pt_BR]=Suporte ao C
+GenericName[ru]=Поддержка языка C
+GenericName[sk]=C podpora
+GenericName[sl]=Podpora za C
+GenericName[sr]=Подршка за C
+GenericName[sr@Latn]=Podrška za C
+GenericName[sv]=C-stöd
+GenericName[ta]=C ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони C
+GenericName[tr]=C Desteği
+GenericName[zh_CN]=C 支持
+GenericName[zh_TW]=C 支援
+ServiceTypes=KDevelop/LanguageSupport
+Icon=source_cpp
+X-KDE-Library=libkdevcppsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=C
+X-KDevelop-Args=C
diff --git a/languages/cpp/kdevdeepcopy.h b/languages/cpp/kdevdeepcopy.h
new file mode 100644
index 00000000..f006bbce
--- /dev/null
+++ b/languages/cpp/kdevdeepcopy.h
@@ -0,0 +1,14 @@
+#ifndef KDEVDEEPCOPY_H
+#define KDEVDEEPCOPY_H
+
+#include <qstring.h>
+
+inline QString deepCopy( const QString& s )
+{
+ QCString str = s.utf8();
+ return QString::fromUtf8( str, str.length() );
+}
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/kdevdriver.cpp b/languages/cpp/kdevdriver.cpp
new file mode 100644
index 00000000..53cf413e
--- /dev/null
+++ b/languages/cpp/kdevdriver.cpp
@@ -0,0 +1,206 @@
+#include "klocale.h" /* defines [function] i18n */
+#include <lexer.h>
+
+#include "kdevdriver.h"
+#include "cppcodecompletionconfig.h"
+#include "setuphelper.h"
+#include <unistd.h>
+#include "includepathresolver.h"
+
+
+KDevDriver::KDevDriver( CppSupportPart* cppSupport, bool foreground )
+: m_cppSupport( cppSupport ), m_includePathResolver(0), m_foreground(foreground), m_shouldParseIncludedFiles(true)
+{
+ //setupProject();
+ setup();
+
+}
+
+KDevDriver::~KDevDriver() {
+ delete m_includePathResolver;
+}
+
+CppSupportPart* KDevDriver::cppSupport() { return m_cppSupport; }
+
+void KDevDriver::setupProject()
+{
+ QMap<QString, bool> map;
+
+ QStringList fileList = m_cppSupport->project() ->allFiles();
+ QStringList::ConstIterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ QFileInfo info( *it );
+ ++it;
+
+ map.insert( info.dirPath( true ), true );
+ }
+ QMap<QString, bool>::Iterator mapit = map.begin();
+ while ( mapit != map.end() )
+ {
+ addIncludePath( mapit.key() );
+ ++mapit;
+ }
+}
+
+void KDevDriver::setupLexer( Lexer* lexer )
+{
+ Driver::setupLexer( lexer );
+ lexer->setReportMessages( true );
+ lexer->setReportWarnings( true );
+}
+
+//! setup the preprocessor
+//! code provided by Reginald Stadlbauer <reggie@trolltech.com>
+void KDevDriver::setup()
+{
+ if( lexerCache() ) lexerCache()->clear(); ///Clear the lexer-cache so missing headers get a chance to be parsed
+ clearMacros();
+ clearIncludePaths();
+
+ addMacro( Macro("KDEVELOP_PARSER", "3.4") );
+
+ bool ok;
+ QString verboseGccOutput = SetupHelper::getVerboseGccIncludePath( &ok );
+ QStringList verboseGccLines = QStringList::split( '\n', verboseGccOutput );
+ if( verboseGccLines.count() > 3 ) {
+ ///Parse the output of gcc. It includes gcc's final include-path when parsing an empty c++-file(including dirs like /usr/include/c++/4.xx/...)
+ //what about order?
+ for( QStringList::iterator it = verboseGccLines.begin(); it != verboseGccLines.end(); ++it ) {
+ if( (*it).startsWith(" ") && (*it).length() > 2 && (*it)[1] != ' ' ) {
+ //it is a potential include-file
+ QString path = (*it).stripWhiteSpace();
+ QFileInfo info( path );
+ if( info.exists() ) {
+ kdDebug( 9007 ) << "Adding include-path from gcc-output: \"" << path << "\" absolute: \"" << info.absFilePath() << "\"" << endl;
+ addIncludePath(info.absFilePath());
+ }
+ }
+ }
+ } else {
+ ///Do some of the old stuff
+ addIncludePath( "/include" );
+ addIncludePath( "/usr/include" );
+ addIncludePath( "/usr/local/include" );
+
+ bool ok;
+ QString includePath = SetupHelper::getGccIncludePath(&ok);
+ if (ok) {
+ QStringList ls = QStringList::split( "\n", includePath );
+ for( QStringList::const_iterator it = ls.begin(); it != ls.end(); ++it ) {
+ if( !(*it).isEmpty() )
+ addIncludePath( *it );
+ }
+ }
+
+ addIncludePath( includePath );
+ addIncludePath( "/usr/include/g++-3" );
+ addIncludePath( "/usr/include/g++" );
+ }
+
+ addMacro( Macro( "__cplusplus", "1" ) );
+
+ ///@todo maybe remove the following? Is there any normal user who has his environment set up correctly so this is of any use?
+ QString kdedir = getenv( "KDEDIR" );
+ if( !kdedir.isNull() )
+ addIncludePath( kdedir + "/include" );
+
+ QString qmakespec = getenv( "QMAKESPEC" );
+ if ( qmakespec.isNull() )
+ qmakespec = "linux-g++";
+
+ QString qtdir = getenv( "QTDIR" );
+ if( !qtdir.isNull() ) {
+ addIncludePath( qtdir + "/include" );
+
+ // #### implement other mkspecs and find a better way to find the
+ // #### proper mkspec (althoigh this will be no fun :-)
+
+ addIncludePath( qtdir + "/mkspecs/" + qmakespec );
+ }
+
+ QStringList lines = SetupHelper::getGccMacros(&ok);
+ if (!ok) {
+ for (QStringList::ConstIterator it = lines.constBegin(); it != lines.constEnd(); ++it) {
+ QStringList lst = QStringList::split( ' ', *it );
+ if ( lst.count() != 3 )
+ continue;
+ addMacro( Macro( lst[1], lst[2] ) );
+ }
+ }
+
+ addMacro( Macro( "__cplusplus", "1" ) );
+ addMacro( Macro( "Q_SIGNALS", "signals" ) );
+ addMacro( Macro( "Q_SLOTS", "slots" ) );
+ addMacro( Macro( "Q_SCRIPTABLE", "" ) );
+
+ CppCodeCompletionConfig* cfg = m_cppSupport->codeCompletionConfig();
+ QString str = cfg->customIncludePaths();
+ int pos = 0;
+ while( pos < str.length() ) {
+ int end = str.find( ';', pos );
+ if( end == -1 ) {
+ end = str.length();
+ }
+
+ QString s = str.mid( pos, end-pos ).stripWhiteSpace();
+ if( !s.isEmpty() ) {
+ if( !s.startsWith( "/" ) && m_cppSupport->project() ) {
+ s = m_cppSupport->project()->projectDirectory() + "/" + s;
+ }
+ addIncludePath( s );
+ }
+
+ pos = end+1;
+ }
+
+ setResolveDependencesEnabled( cfg->preProcessAllHeaders() | cfg->parseMissingHeaders() );
+
+ delete m_includePathResolver;
+ if( cfg->resolveIncludePaths() ) {
+ m_includePathResolver = new CppTools::IncludePathResolver( m_foreground );
+ if( m_cppSupport && m_cppSupport->project() )
+ m_includePathResolver->setOutOfSourceBuildSystem( m_cppSupport->project()->projectDirectory(), m_cppSupport->project()->buildDirectory() );
+ } else
+ m_includePathResolver = 0;
+
+ m_shouldParseIncludedFiles = cfg->parseMissingHeaders();
+}
+
+QStringList KDevDriver::getCustomIncludePath( const QString& file ) {
+ if( !file.startsWith("/") )
+ kdDebug( 9007 ) << "KDevDriver::getCustomIncludePath(..): given file \"" << file << "\" is not absolute" << endl;
+ if( !m_includePathResolver )
+ return includePaths();
+ CppTools::PathResolutionResult res = m_includePathResolver->resolveIncludePath( file );
+
+ if( !res.success ) {
+ Problem p( i18n( "%1. Message: %2" ).arg( res.errorMessage ).arg( res.longErrorMessage ), 0, 0, Problem::Level_Warning );
+ p.setFileName( file );
+ addProblem( file, p );
+ }
+
+ return res.path + includePaths();
+}
+
+bool KDevDriver::shouldParseIncludedFile( const ParsedFilePointer& file ) {
+ QString compoundString = file->fileName() + "||" + QString("%1").arg(file->usedMacros().valueHash()) + "||" + QString("%1").arg(file->usedMacros().idHash());
+
+ if( !m_shouldParseIncludedFiles )
+ return false;
+ m_cppSupport->safeFileSet().contains( compoundString );
+
+ if( m_cppSupport->safeFileSet().contains( file->fileName()) ){
+ return false;
+ } else if( m_cppSupport->safeFileSet().contains( compoundString ) ) {
+ //kdDebug( 9007 ) << "ALREADY IN FILE-SET: " << compoundString << endl;
+ return false;
+ } else {
+ m_cppSupport->safeFileSet().insert( compoundString ); //This is needed so the same instance of a file is not queued many times
+ //kdDebug( 9007 ) << "NOT IN FILE-SET, PARSING: " << compoundString << endl;
+ return true;
+ }
+
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/kdevdriver.h b/languages/cpp/kdevdriver.h
new file mode 100644
index 00000000..f46894b4
--- /dev/null
+++ b/languages/cpp/kdevdriver.h
@@ -0,0 +1,58 @@
+
+#ifndef __kdevdriver_h
+#define __kdevdriver_h
+
+#include "cppsupportpart.h"
+#include "driver.h"
+
+#include <kdevproject.h>
+#include <kdeversion.h>
+
+#include <cstdlib>
+#include <unistd.h>
+#include <qmap.h>
+
+class KProcess;
+namespace CppTools {
+ class IncludePathResolver;
+};
+
+class KDevDriver: public Driver
+{
+public:
+ ///When the driver is used in a background-thread, foreground MUST be false(else crash)
+ KDevDriver( CppSupportPart* cppSupport, bool foreground = false );
+ ~KDevDriver();
+ CppSupportPart* cppSupport();
+ void setupProject();
+ //! setup the preprocessor
+ //! code provided by Reginald Stadlbauer <reggie@trolltech.com>
+ void setup();
+
+ virtual void addMacro( const Macro& m )
+ {
+ if ( m.name() == "signals" || m.name() == "slots" )
+ return ;
+ Driver::addMacro( m );
+ }
+
+protected:
+ void setupLexer( Lexer* lexer );
+
+ ///Returns the complete include-path for that file. Not constant because it may add Problem-items to the driver. Must be absolute path.
+ virtual QStringList getCustomIncludePath( const QString& file );
+
+ virtual bool shouldParseIncludedFile( const ParsedFilePointer& /*file*/ );
+
+private:
+
+ CppSupportPart* m_cppSupport;
+ CppTools::IncludePathResolver* m_includePathResolver;
+ bool m_foreground;
+ bool m_shouldParseIncludedFiles;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
+
diff --git a/languages/cpp/main.cpp b/languages/cpp/main.cpp
new file mode 100644
index 00000000..079fba37
--- /dev/null
+++ b/languages/cpp/main.cpp
@@ -0,0 +1,283 @@
+
+#include <iostream>
+
+#include "driver.h"
+#include "ast.h"
+#include "lexer.h"
+#include "tag_creator.h"
+#include "setuphelper.h"
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+
+#include <catalog.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+class RppDriver: public Driver
+{
+public:
+ RppDriver( Catalog* c )
+ : catalog( c ), m_generateTags( true )
+ {
+ setup();
+ }
+
+ virtual ~RppDriver()
+ {
+ TagCreator::destroyDocumentation();
+ }
+
+ void setGenerateTags( bool b )
+ {
+ m_generateTags = b;
+ }
+
+ void addDocDirectory( const QString& dir )
+ {
+ m_docDirectoryList.append( dir );
+ TagCreator::setDocumentationDirectories( m_docDirectoryList );
+ }
+
+ void fileParsed( const ParsedFile& fileName )
+ {
+ std::cout << ( m_generateTags ? "generate tags for " : "checking " )
+ << QFile::encodeName( fileName.fileName() ).data() << std::endl;
+
+ QValueList<Problem> l = problems( fileName.fileName() );
+ QValueList<Problem>::Iterator it = l.begin();
+ while ( it != l.end() )
+ {
+ const Problem & p = *it;
+ ++it;
+ std::cout << QFile::encodeName( fileName.fileName() ).data() << ":" << p.line() << ":"
+ << p.column() << ": " << p.text().latin1() << std::endl;
+ }
+
+ takeTranslationUnit( fileName );
+
+ if ( m_generateTags )
+ {
+ TagCreator w( fileName.fileName(), catalog );
+ w.parseTranslationUnit( fileName );
+ }
+
+ if ( !isResolveDependencesEnabled() )
+ removeAllMacrosInFile( fileName.fileName() );
+ }
+
+ void setupLexer( Lexer* lex )
+ {
+ //lex->disableSkipWords();
+ Driver::setupLexer( lex );
+ }
+
+ // setup the preprocessor
+ // code provided by Reginald Stadlbauer <reggie@trolltech.com>
+ void setup()
+ {
+ QString kdedir = getenv( "KDEDIR" );
+ if ( !kdedir.isNull() )
+ addIncludePath( kdedir + "/include" );
+
+ QString qtdir = getenv( "QTDIR" );
+ if ( !qtdir.isNull() )
+ addIncludePath( qtdir + "/include" );
+
+ QString qmakespec = getenv( "QMAKESPEC" );
+ if ( qmakespec.isNull() )
+ qmakespec = "linux-g++";
+ // #### implement other mkspecs and find a better way to find the
+ // #### proper mkspec (althoigh this will be no fun :-)
+
+ addIncludePath( qtdir + "/mkspecs/" + qmakespec );
+
+ if ( qmakespec == "linux-g++" )
+ {
+ addIncludePath( "/include" );
+ addIncludePath( "/usr/include" );
+ addIncludePath( "/ust/local/include" );
+ bool ok;
+ QString gccLibPath = SetupHelper::getGccIncludePath(&ok);
+ if (!ok)
+ return;
+ gccLibPath = gccLibPath.replace( QRegExp( "[\r\n]" ), "" );
+ addIncludePath( gccLibPath );
+ addIncludePath( "/usr/include/g++-3" );
+ addIncludePath( "/usr/include/g++" );
+ QStringList lines = SetupHelper::getGccMacros(&ok);
+ if (!ok)
+ return;
+ for (QStringList::ConstIterator it = lines.constBegin(); it != lines.constEnd(); ++it) {
+ QStringList lst = QStringList::split( ' ', *it );
+ if ( lst.count() != 3 )
+ continue;
+ addMacro( Macro( lst[1], lst[2] ) );
+ }
+ addMacro( Macro( "__cplusplus", "1" ) );
+
+ QString incl = getenv( "INCLUDE" );
+ QStringList includePaths = QStringList::split( ':', incl );
+ QStringList::Iterator it = includePaths.begin();
+ while ( it != includePaths.end() )
+ {
+ addIncludePath( ( *it ).stripWhiteSpace() );
+ ++it;
+ }
+
+ }
+ else if ( qmakespec == "win32-borland" )
+ {
+ QString incl = getenv( "INCLUDE" );
+ QStringList includePaths = QStringList::split( ';', incl );
+ QStringList::Iterator it = includePaths.begin();
+ while ( it != includePaths.end() )
+ {
+ addIncludePath( ( *it ).stripWhiteSpace() );
+ ++it;
+ }
+ // ### I am sure there are more standard include paths on
+ // ### windows. I will fix that soon
+ // ### Also do the compiler specific defines on windows
+ }
+ }
+
+private:
+ Catalog* catalog;
+ bool m_generateTags;
+ QStringList m_docDirectoryList;
+};
+
+void parseDirectory( Driver& driver, QDir& dir, bool rec, bool parseAllFiles )
+{
+
+ QStringList fileList;
+ if ( parseAllFiles )
+ fileList = dir.entryList( QDir::Files );
+ else
+ fileList = dir.entryList( "*.h;*.H;*.hh;*.hxx;*.hpp;*.tlh" );
+
+ QStringList::Iterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ QString fn = dir.path() + "/" + ( *it );
+ ++it;
+
+ driver.parseFile( fn );
+ }
+
+ if ( rec )
+ {
+ QStringList fileList = dir.entryList( QDir::Dirs );
+ QStringList::Iterator it = fileList.begin();
+ while ( it != fileList.end() )
+ {
+ if ( ( *it ).startsWith( "." ) )
+ {
+ ++it;
+ continue;
+ }
+
+ QDir subdir( dir.path() + "/" + ( *it ) );
+ ++it;
+
+ parseDirectory( driver, subdir, rec, parseAllFiles );
+ }
+ }
+}
+
+int main( int argc, char* argv[] )
+{
+ KStandardDirs stddir;
+
+ if ( argc < 3 )
+ {
+ std::cerr << "usage: r++ dbname directories..." << std::endl << std::endl;
+ return -1;
+ }
+
+ bool rec = false;
+ bool parseAllFiles = false;
+
+ QString datadir = stddir.localkdedir() + "/" + KStandardDirs::kde_default( "data" );
+ if ( ! KStandardDirs::makeDir( datadir + "/kdevcppsupport/pcs/" ) )
+ {
+ kdWarning() << "*error* " << "could not create " << datadir + "/kdevcppsupport/pcs/" << endl << endl;
+ return -1;
+ }
+
+
+ if ( !QFile::exists( datadir + "/kdevcppsupport/pcs/" ) )
+ {
+ kdWarning() << "*error* " << datadir + "/kdevcppsupport/pcs/" << " doesn't exists!!" << endl << endl;
+ return -1;
+ }
+
+ QString dbFileName = datadir + "/kdevcppsupport/pcs/" + argv[ 1 ] + ".db";
+ // std::cout << "dbFileName = " << dbFileName << std::endl;
+ if ( QFile::exists( dbFileName ) )
+ {
+ kdWarning() << "*error* " << "database " << dbFileName << " already exists!" << endl << endl;
+ return -1;
+ }
+
+
+ Catalog catalog;
+ catalog.open( dbFileName );
+ catalog.addIndex( "kind" );
+ catalog.addIndex( "name" );
+ catalog.addIndex( "scope" );
+ catalog.addIndex( "fileName" );
+
+ RppDriver driver( &catalog );
+ driver.setResolveDependencesEnabled( true );
+
+ for ( int i = 2; i < argc; ++i )
+ {
+ QString s( argv[ i ] );
+ if ( s == "-r" || s == "--recursive" )
+ {
+ rec = true;
+ continue;
+ }
+ else if ( s == "-a" || s == "--all" )
+ {
+ parseAllFiles = true;
+ continue;
+ }
+ else if ( s == "-f" || s == "--fast" )
+ {
+ driver.setResolveDependencesEnabled( false );
+ continue;
+ }
+ else if ( s == "-c" || s == "--check-only" )
+ {
+ driver.setGenerateTags( false );
+ continue;
+ }
+ else if ( s.startsWith( "-d" ) )
+ {
+ driver.addDocDirectory( s.mid( 2 ) );
+ continue;
+ }
+
+ QDir dir( s );
+ if ( !dir.exists() )
+ {
+ kdWarning() << "*error* " << "the directory " << dir.path() << " doesn't exists!" << endl << endl;
+ continue;
+ }
+
+ parseDirectory( driver, dir, rec, parseAllFiles );
+ }
+
+ return 0;
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/newclass_templates/Makefile.am b/languages/cpp/newclass_templates/Makefile.am
new file mode 100644
index 00000000..5b013d27
--- /dev/null
+++ b/languages/cpp/newclass_templates/Makefile.am
@@ -0,0 +1,4 @@
+cppsupportdatadir = ${kde_datadir}/kdevcppsupport
+newclassdir = ${cppsupportdatadir}/newclass
+
+newclass_DATA = cpp_header cpp_source gtk_header gtk_source objc_header objc_source
diff --git a/languages/cpp/newclass_templates/cpp_header b/languages/cpp/newclass_templates/cpp_header
new file mode 100644
index 00000000..3952210c
--- /dev/null
+++ b/languages/cpp/newclass_templates/cpp_header
@@ -0,0 +1,31 @@
+#ifndef $HEADERGUARD$
+#define $HEADERGUARD$
+
+$INCLUDEBASEHEADER$
+
+$NAMESPACEBEG$
+
+$DOC$
+$TEMPLATE$
+class $CLASSNAME$$INHERITANCE$
+{
+$QOBJECT$
+public:
+$CONSTRUCTORDECLARATIONS$
+
+$PUBLICDECLARATIONS$
+
+$PUBLICSLOTS$
+
+$PROTECTEDDECLARATIONS$
+
+$PROTECTEDSLOTS$
+
+$PRIVATEDECLARATIONS$
+
+$PRIVATESLOTS$
+};
+
+$NAMESPACEEND$
+
+#endif
diff --git a/languages/cpp/newclass_templates/cpp_source b/languages/cpp/newclass_templates/cpp_source
new file mode 100644
index 00000000..eeeb1ea0
--- /dev/null
+++ b/languages/cpp/newclass_templates/cpp_source
@@ -0,0 +1,9 @@
+#include "$HEADER$"
+
+$NAMESPACEBEG$
+
+$CONSTRUCTORDEFINITIONS$
+
+$DEFINITIONS$
+
+$NAMESPACEEND$
diff --git a/languages/cpp/newclass_templates/gtk_header b/languages/cpp/newclass_templates/gtk_header
new file mode 100644
index 00000000..c44bff32
--- /dev/null
+++ b/languages/cpp/newclass_templates/gtk_header
@@ -0,0 +1,24 @@
+#ifndef $HEADERGUARD$
+#define $HEADERGUARD$
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
+$DOC$
+typedef struct td_test {
+/* TODO: put your data here */
+} $CLASSNAME$, *$CLASSNAME$Ptr;
+
+
+$CLASSNAME$* $CLASSNAME$_new(void);
+void $CLASSNAME$_delete($CLASSNAME$* self);
+gboolean $CLASSNAME$_init($CLASSNAME$* self);
+void $CLASSNAME$_end($CLASSNAME$* self);
+
+
+#endif
diff --git a/languages/cpp/newclass_templates/gtk_source b/languages/cpp/newclass_templates/gtk_source
new file mode 100644
index 00000000..aa5f05ea
--- /dev/null
+++ b/languages/cpp/newclass_templates/gtk_source
@@ -0,0 +1,35 @@
+#include "$HEADER$"
+
+$CLASSNAME$* $CLASSNAME$_new(void)
+{
+ $CLASSNAME$* self;
+ self = g_new($CLASSNAME$, 1);
+ if(NULL != self)
+ {
+ if(!$CLASSNAME$_init(self))
+ {
+ g_free(self);
+ self = NULL;
+ }
+ }
+ return self;
+}
+
+void $CLASSNAME$_delete($CLASSNAME$* self)
+{
+ g_return_if_fail(NULL != self);
+ $CLASSNAME$_end(self);
+ g_free(self);
+}
+
+gboolean $CLASSNAME$_init($CLASSNAME$* self)
+{
+ /* TODO: put init code here */
+
+ return TRUE;
+}
+
+void $CLASSNAME$_end($CLASSNAME$* self)
+{
+ /* TODO: put deinit code here */
+}
diff --git a/languages/cpp/newclass_templates/objc_header b/languages/cpp/newclass_templates/objc_header
new file mode 100644
index 00000000..9213782c
--- /dev/null
+++ b/languages/cpp/newclass_templates/objc_header
@@ -0,0 +1,11 @@
+#ifndef _$HEADERGUARD$_
+#define _$HEADERGUARD$_
+
+$INCLUDEBASEHEADER$
+#include <Foundation/NSObject.h>
+
+$DOC$
+@interface $CLASSNAME$ : $BASECLASS$
+@end
+
+#endif
diff --git a/languages/cpp/newclass_templates/objc_source b/languages/cpp/newclass_templates/objc_source
new file mode 100644
index 00000000..298e941d
--- /dev/null
+++ b/languages/cpp/newclass_templates/objc_source
@@ -0,0 +1,4 @@
+#include "$HEADER$"
+
+@implementation $CLASSNAME$
+@end
diff --git a/languages/cpp/pcsimporter/Makefile.am b/languages/cpp/pcsimporter/Makefile.am
new file mode 100644
index 00000000..5a2945ac
--- /dev/null
+++ b/languages/cpp/pcsimporter/Makefile.am
@@ -0,0 +1,3 @@
+INCLUDES =
+METASOURCES = AUTO
+SUBDIRS = qtimporter kdelibsimporter customimporter qt4importer
diff --git a/languages/cpp/pcsimporter/customimporter/Makefile.am b/languages/cpp/pcsimporter/customimporter/Makefile.am
new file mode 100644
index 00000000..5a630be9
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = -I$(top_srcdir)/languages/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkdevcustompcsimporter.la
+
+
+noinst_HEADERS = kdevcustomimporter.h
+libkdevcustompcsimporter_la_SOURCES = kdevcustomimporter.cpp settingsdialog.cpp settingsdialogbase.ui
+libkdevcustompcsimporter_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la
+libkdevcustompcsimporter_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+kde_services_DATA = kdevpcscustomimporter.desktop
diff --git a/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.cpp b/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.cpp
new file mode 100644
index 00000000..c3e5cb43
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.cpp
@@ -0,0 +1,118 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 "kdevcustomimporter.h"
+
+#include "settingsdialog.h"
+
+#include <qvaluestack.h>
+#include <qdir.h>
+
+#include <kdebug.h>
+#include <kgenericfactory.h>
+
+K_EXPORT_COMPONENT_FACTORY( libkdevcustompcsimporter, KGenericFactory<KDevCustomImporter>( "kdevcustompcsimporter" ) )
+
+KDevCustomImporter::KDevCustomImporter( QObject* parent, const char* name, const QStringList & // args
+ )
+ : KDevPCSImporter( parent, name )
+{}
+
+
+KDevCustomImporter::~KDevCustomImporter()
+{}
+
+
+QString KDevCustomImporter::dbName() const
+{
+ return m_settings->dbName();
+}
+
+QStringList KDevCustomImporter::fileList( const QString& path )
+{
+ QDir dir( path );
+ if ( !dir.exists() )
+ return QStringList();
+// QStringList lst = dir.entryList( "*.h;*.H;*.hh;*.hxx;*.hpp;*.tlh" );
+ QStringList lst = dir.entryList( m_settings->filePattern() );
+ QStringList fileList;
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ fileList.push_back( dir.absPath() + "/" + ( *it ) );
+ }
+ return fileList;
+}
+
+QStringList KDevCustomImporter::fileList()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ QStringList lst = m_settings->dirs();
+ QStringList files;
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ if ( !m_settings->recursive() )
+ files += fileList( *it );
+ else
+ processDir( *it, files );
+ }
+
+ return files;
+}
+
+QStringList KDevCustomImporter::includePaths()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ return m_settings->dirs();
+}
+
+QWidget* KDevCustomImporter::createSettingsPage( QWidget* parent, const char* name )
+{
+ m_settings = new SettingsDialog( parent, name );
+ return m_settings;
+}
+
+void KDevCustomImporter::processDir( const QString path, QStringList & files )
+{
+ QValueStack<QString> s;
+ s.push( path );
+ files += fileList( path );
+
+ QDir dir;
+ do
+ {
+ dir.setPath( s.pop() );
+ if (!dir.exists())
+ continue;
+ kdDebug( 9015 ) << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if ( !dirEntries ) continue;
+ QPtrListIterator<QFileInfo> it( *dirEntries );
+ for ( ; dirEntries && it.current(); ++it )
+ {
+ QString fileName = it.current() ->fileName();
+ if ( fileName == "." || fileName == ".." )
+ continue;
+ if ( it.current() ->isDir() )
+ {
+ QString tmpPath = it.current() ->absFilePath();
+ kdDebug( 9015 ) << "Pushing: " << tmpPath << endl;
+ s.push( tmpPath );
+ files += fileList( tmpPath );
+ }
+ }
+ }
+ while ( !s.isEmpty() );
+}
+
+#include "kdevcustomimporter.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.h b/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.h
new file mode 100644
index 00000000..5a522785
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/kdevcustomimporter.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.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 KDEVCUSTOMIMPORTER_H
+#define KDEVCUSTOMIMPORTER_H
+
+#include "kdevpcsimporter.h"
+
+#include <qguardedptr.h>
+
+class SettingsDialog;
+
+class KDevCustomImporter : public KDevPCSImporter
+{
+Q_OBJECT
+public:
+ KDevCustomImporter(QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList());
+
+ ~KDevCustomImporter();
+
+ virtual QString dbName() const;
+ virtual QStringList fileList();
+ virtual QStringList includePaths();
+ virtual QWidget* createSettingsPage(QWidget* parent, const char* name);
+
+protected:
+ QStringList fileList( const QString& path );
+ void processDir(const QString path, QStringList &files );
+
+private:
+ QGuardedPtr<SettingsDialog> m_settings;
+};
+
+#endif
diff --git a/languages/cpp/pcsimporter/customimporter/kdevpcscustomimporter.desktop b/languages/cpp/pcsimporter/customimporter/kdevpcscustomimporter.desktop
new file mode 100644
index 00000000..2e331977
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/kdevpcscustomimporter.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=KDevPCSCustomImporter
+Name[da]=KDevelop brugerdefineret PCS-importør
+Name[nds]=EgenPCS-Import för KDevelop
+Name[pl]=KDevWłasnyImportPCS
+Name[sk]=KDev PCS vlastný import
+Name[sv]=KDevelop egen import av PCS
+Name[zh_TW]=KDevelop PCS 自訂匯入器
+Comment=KDevelop Custom Directory PCS Importer
+Comment[ca]=Importador PCS de directori personalitzat per a KDevelop
+Comment[da]=KDevelop brugerdefineret mappe-PCS-importør
+Comment[de]=Import für persistenten Klassenspeicher aus benutzerdefinierten Ordnern
+Comment[el]=Εισαγωγέας PCS προσαρμοσμένου καταλόγου του KDevelop
+Comment[es]=Importador PCS de carpeta personalizada de KDevelop
+Comment[et]=KDevelopi kohandatud kataloogi PCS importija
+Comment[eu]=KDevelop-en direktorio pertsonalizatuko PCS inportatzailea
+Comment[fa]=واردکنندۀ PCS فهرست سفارشی KDevelop
+Comment[fr]=Importation PCS de dossiers personnalisés pour KDevelop
+Comment[gl]=Importador PCS de directorios personalizados para KDevelop
+Comment[hi]=के-डेवलप मनपसंद डिरेक्ट्री पीसीएस आयातक
+Comment[hu]=KDevelop egyéni könyvtár PCS-importáló
+Comment[it]=Cartella per l'importatore personalizzato PCS di KDevelop
+Comment[ja]=KDevelop カスタムディレクトリ PCS インポータ
+Comment[nds]=Import för duerhaftig Klassenspieker ut Bruker-Ornern
+Comment[ne]=केडीई विकास अनुकूल डाइरेक्टरी PCS आयातकर्ता
+Comment[nl]=KDevelop PCS Importer voor eigen mappen
+Comment[pl]=Własny program do importowania PCS dla KDevelopa
+Comment[pt]=Importador de PCS com Directoria Personalizada do KDevelop
+Comment[pt_BR]=Importador de Diretório PCS Personalizado para o KDevelop
+Comment[ru]=Загрузка символов из любого каталога в хранилище классов
+Comment[sk]=KDevelop vlastný PCS import priečinkov
+Comment[sr]=KDevelop-ов PCS увозник прилагођеног директоријума
+Comment[sr@Latn]=KDevelop-ov PCS uvoznik prilagođenog direktorijuma
+Comment[sv]=KDevelop PCS-import för egen katalog
+Comment[ta]=கெடெவலப் கஸ்டம் டைரக்ட்ரி இறக்குமதியாளர்
+Comment[tg]=Пурборкунии нишонаҳо аз анбори синфҳои каталог
+Comment[tr]=KDevelop Özel Dizin PCS Aktarıcısı
+Comment[zh_CN]=KDevelop 自定义目录的 PCS 导入器
+Comment[zh_TW]=KDevelop 自訂目錄 PCS 匯入器
+Icon=gear
+ServiceTypes=KDevelop/PCSImporter
+X-KDE-Library=libkdevcustompcsimporter
+X-KDevelop-PCSImporter=
diff --git a/languages/cpp/pcsimporter/customimporter/settingsdialog.cpp b/languages/cpp/pcsimporter/customimporter/settingsdialog.cpp
new file mode 100644
index 00000000..f6df0902
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/settingsdialog.cpp
@@ -0,0 +1,107 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* Copyright (C) 2006 by Jens Dagerbo *
+* jens.dagerbo@swipnet.se *
+* *
+* 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 <klistbox.h>
+#include <kcombobox.h>
+#include <kurlrequester.h>
+#include <kdeversion.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <klineedit.h>
+
+#include <keditlistbox.h>
+
+// should be included after possible KEditListBox redefinition
+#include "settingsdialog.h"
+
+#include <qfile.h>
+#include <qregexp.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+
+#include <cstdlib>
+
+SettingsDialog::SettingsDialog( QWidget* parent, const char* name, WFlags fl )
+ : SettingsDialogBase( parent, name, fl )
+{
+ KURLRequester * req = new KURLRequester( this );
+ req->setMode( KFile::Directory );
+ KEditListBox::CustomEditor pCustomEditor;
+ pCustomEditor = req->customEditor();
+ elb = new KEditListBox( i18n( "Directories to Parse" ), pCustomEditor, this );
+
+ grid->addMultiCellWidget( elb, 3, 3, 0, grid->numCols() );
+
+ // connect( dbName_edit, SIGNAL( textChanged( const QString& ) ), this, SLOT( validate() ) );
+ connect( elb->addButton(), SIGNAL( clicked() ), this, SLOT( validate() ) );
+ connect( elb->removeButton(), SIGNAL( clicked() ), this, SLOT( validate() ) );
+ connect( elb, SIGNAL( added( const QString& ) ), this, SLOT( validateDirectory( const QString& ) ) );
+}
+
+SettingsDialog::~SettingsDialog()
+{}
+
+QString SettingsDialog::dbName( ) const
+{
+ return QString();
+// return dbName_edit->text();
+}
+
+QStringList SettingsDialog::dirs( ) const
+{
+ return elb->items();
+}
+
+QString SettingsDialog::filePattern( ) const
+{
+ return pattern_edit->text();
+}
+
+bool SettingsDialog::recursive( ) const
+{
+ return recursive_box->isChecked();
+}
+
+void SettingsDialog::validate()
+{
+// emit enabled( !dbName_edit->text().isEmpty() && elb->listBox() ->count() > 0 );
+ emit enabled( elb->listBox()->count() > 0 );
+}
+
+void SettingsDialog::validateDirectory( const QString & dir )
+{
+ QDir d( dir, QString::null, QDir::DefaultSort, QDir::Dirs );
+ if ( !d.exists() )
+ {
+ elb->lineEdit() ->setText( dir );
+
+ if ( QListBoxItem * item = elb->listBox() ->findItem( dir, Qt::ExactMatch ) )
+ {
+ elb->listBox() ->removeItem( elb->listBox() ->index( item ) );
+ }
+
+ QString errormsg = QString( "<qt><b>%1</b> is not a directory</qt>" ).arg( dir );
+ KMessageBox::error( 0, errormsg, "Couldn't find directory" );
+ }
+ emit enabled( elb->listBox()->count() > 0 );
+}
+
+#include "settingsdialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
+
+
diff --git a/languages/cpp/pcsimporter/customimporter/settingsdialog.h b/languages/cpp/pcsimporter/customimporter/settingsdialog.h
new file mode 100644
index 00000000..309df8ab
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/settingsdialog.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include "settingsdialogbase.h"
+
+class KEditListBox;
+
+class SettingsDialog : public SettingsDialogBase
+{
+ Q_OBJECT
+
+public:
+ SettingsDialog(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~SettingsDialog();
+
+ bool isValidQtDir( const QString& path ) const;
+
+ QString qtDir() const;
+ QString configuration() const;
+
+ QString dbName() const;
+ QStringList dirs() const;
+ bool recursive() const;
+ QString filePattern() const;
+
+private slots:
+ void validate();
+ void validateDirectory( const QString & dir );
+
+private:
+ KEditListBox *elb;
+
+};
+
+#endif
+
+
diff --git a/languages/cpp/pcsimporter/customimporter/settingsdialogbase.ui b/languages/cpp/pcsimporter/customimporter/settingsdialogbase.ui
new file mode 100644
index 00000000..b9faadb1
--- /dev/null
+++ b/languages/cpp/pcsimporter/customimporter/settingsdialogbase.ui
@@ -0,0 +1,62 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SettingsDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SettingsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>510</width>
+ <height>501</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>grid</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>pattern_edit</cstring>
+ </property>
+ <property name="text">
+ <string>*.h;*.H;*.hh;*.hxx;*.hpp;*.tlh</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Filename pattern:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>recursive_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Recursive</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<signals>
+ <signal>enabled(int)</signal>
+</signals>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/Makefile.am b/languages/cpp/pcsimporter/kdelibsimporter/Makefile.am
new file mode 100644
index 00000000..96c3474f
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_srcdir)/languages/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkdevkdelibsimporter.la
+
+noinst_HEADERS = kdevkdelibsimporter.h settingsdialog.h
+libkdevkdelibsimporter_la_SOURCES = kdevkdelibsimporter.cpp settingsdialogbase.ui settingsdialog.cpp
+kde_services_DATA = kdevkdelibsimporter.desktop
+libkdevkdelibsimporter_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la
+libkdevkdelibsimporter_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.cpp b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.cpp
new file mode 100644
index 00000000..341256b7
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.cpp
@@ -0,0 +1,119 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "kdevkdelibsimporter.h"
+#include "kdevkdelibsimporter.moc"
+#include "settingsdialog.h"
+
+#include <kdebug.h>
+#include <kgenericfactory.h>
+
+#include <qvaluestack.h>
+#include <qlabel.h>
+#include <qdir.h>
+#include <qcombobox.h>
+
+K_EXPORT_COMPONENT_FACTORY( libkdevkdelibsimporter, KGenericFactory<KDevKDELibsImporter>( "kdevkdelibsimporter" ) )
+
+KDevKDELibsImporter::KDevKDELibsImporter( QObject * parent, const char * name, const QStringList& )
+ : KDevPCSImporter( parent, name )
+{}
+
+KDevKDELibsImporter::~KDevKDELibsImporter()
+{}
+
+QStringList KDevKDELibsImporter::fileList( const QString& path )
+{
+ QDir dir( path );
+ QStringList lst = dir.entryList( "*.h" );
+ QStringList fileList;
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ fileList.push_back( dir.absPath() + "/" + ( *it ) );
+ }
+ return fileList;
+}
+
+
+QStringList KDevKDELibsImporter::fileList()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ QStringList files;
+ int scope = m_settings->cbParsingScope->currentItem();
+ if ( scope == 0 )
+ {
+ files += fileList( m_settings->kdeDir() );
+ files += fileList( m_settings->kdeDir() + "/arts" );
+ files += fileList( m_settings->kdeDir() + "/artsc" );
+ files += fileList( m_settings->kdeDir() + "/dcopc" );
+ files += fileList( m_settings->kdeDir() + "/dom" );
+ files += fileList( m_settings->kdeDir() + "/kabc" );
+ files += fileList( m_settings->kdeDir() + "/kdeprint" );
+ files += fileList( m_settings->kdeDir() + "/kdesu" );
+ files += fileList( m_settings->kdeDir() + "/kio" );
+ files += fileList( m_settings->kdeDir() + "/kjs" );
+ files += fileList( m_settings->kdeDir() + "/kparts" );
+ files += fileList( m_settings->kdeDir() + "/ktexteditor" );
+ }
+ else if ( scope == 1 )
+ {
+ QValueStack<QString> s;
+ s.push( m_settings->kdeDir() );
+ files += fileList( m_settings->kdeDir() );
+
+ QDir dir;
+ do
+ {
+ dir.setPath( s.pop() );
+ kdDebug( 9015 ) << "Examining: " << dir.path() << endl;
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if ( !dirEntries ) continue;
+ QPtrListIterator<QFileInfo> it( *dirEntries );
+ for ( ; it.current(); ++it )
+ {
+ QString fileName = it.current() ->fileName();
+ if ( fileName == "." || fileName == ".." )
+ continue;
+ QString path = it.current() ->absFilePath();
+ if ( it.current() ->isDir() )
+ {
+ kdDebug( 9015 ) << "Pushing: " << path << endl;
+ s.push( path );
+ files += fileList( path );
+ }
+ }
+ }
+ while ( !s.isEmpty() );
+ }
+
+ return files;
+}
+
+QStringList KDevKDELibsImporter::includePaths()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ QStringList includePaths;
+ includePaths.push_back( m_settings->kdeDir() );
+ return includePaths;
+}
+
+QWidget * KDevKDELibsImporter::createSettingsPage( QWidget * parent, const char * name )
+{
+ m_settings = new SettingsDialog( parent, name );
+ return m_settings;
+}
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.desktop b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.desktop
new file mode 100644
index 00000000..51163d14
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Type=Service
+Name=KDevKDELibsImporter
+Name[da]=KDevelop KDELibs-importør
+Name[de]=KDELibs-PCS-Import (KDevelop)
+Name[hi]=के-डेव-केडीई-लिब्स-इम्पोर्टर
+Name[ja]=KDev KDE
+Name[nds]=KDELibs-PCS-Import (KDevelop)
+Name[pl]=KDevKDEImportBib
+Name[sk]=KDev KDE import knižníc
+Name[sv]=KDevelop KDE-biblioteksimport
+Name[ta]=கெடெவ் கெடெலிப்ஸ் இறக்குமதியாளர்
+Name[zh_TW]=KDevelop KDE 函式庫匯入器
+Comment=KDevelop KDELibs PCS Importer
+Comment[ca]=Importador PCS de KDELibs per a KDevelop
+Comment[da]=KDevelop KDELibs PCS importør
+Comment[de]=KDELibs-Import für persistenten Klassenspeicher
+Comment[el]=Εισαγωγέας PCS KDevelop KDELibs
+Comment[es]=Importador PCS de KDELibs de KDevelop
+Comment[et]=KDevelopi kdelibs PCS importija
+Comment[eu]=KDevelop-en KDELibs PCS inportatzailea
+Comment[fa]=واردکنندۀ KDevelop KDELibs PCS
+Comment[fr]=Importation PCS de KDELibs pour KDevelop
+Comment[gl]=Importador PCS de KDELibs para KDevelop
+Comment[hi]=के-डेवलप केडीई-लिब्स पीसीएस आयातक
+Comment[hu]=KDevelop KDELibs PCS-importáló
+Comment[it]=Importatore per KDELibs PCS di KDevelop
+Comment[ja]=KDevelop KDELibs PCS インポータ
+Comment[nds]=KDELibs-Import för duerhaftig Klassenspieker
+Comment[ne]=KDevelop KDELibs PCS आयातकर्ता
+Comment[nl]=KDevelop PCS Importer voor KDELibs
+Comment[pl]=KDevelop: importowanie PCS (KDELibs)
+Comment[pt]=Importador de PCS das KDELibs do KDevelop
+Comment[pt_BR]=Importador PCS do KDELibs para o KDevelop
+Comment[ru]=Загрузка символов из библиотеки KDELibs в хранилище классов
+Comment[sk]=KDevelop PCS import KDE knižníc
+Comment[sr]=KDevelop-ов KDELibs PCS увозник
+Comment[sr@Latn]=KDevelop-ov KDELibs PCS uvoznik
+Comment[sv]=KDevelop KDE-bibliotek PCS-import
+Comment[ta]=கெடெவலப் கெடெலிப்ஸ் பிசிஸ் இறக்குமதியாளர்
+Comment[tg]=Пурборкунии нишонаҳо аз китобхонаи KDELibs дар синфҳои анборӣ
+Comment[tr]=KDevelop KDELibs PCS Aktarıcısı
+Comment[zh_CN]=KDevelop KDELibs PCS 导入器
+Comment[zh_TW]=KDevelop KDE 函式庫匯入器
+Icon=gear
+ServiceTypes=KDevelop/PCSImporter
+X-KDE-Library=libkdevkdelibsimporter
+X-KDevelop-PCSImporter=
+X-KDevelop-Version=5
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.h b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.h
new file mode 100644
index 00000000..9514f287
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/kdevkdelibsimporter.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KDEVQTIMPORTER_H
+#define KDEVQTIMPORTER_H
+
+#include <kdevpcsimporter.h>
+#include <qguardedptr.h>
+
+class SettingsDialog;
+
+class KDevKDELibsImporter : public KDevPCSImporter
+{
+ Q_OBJECT
+public:
+ KDevKDELibsImporter( QObject* parent=0, const char* name=0, const QStringList& args=QStringList() );
+ virtual ~KDevKDELibsImporter();
+
+ virtual QString dbName() const { return QString::fromLatin1("KDElibs"); }
+ virtual QStringList fileList();
+ virtual QStringList includePaths();
+
+ virtual QWidget* createSettingsPage( QWidget* parent, const char* name=0 );
+
+private:
+ QStringList fileList( const QString& path );
+
+private:
+ QGuardedPtr<SettingsDialog> m_settings;
+};
+
+#endif
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.cpp b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.cpp
new file mode 100644
index 00000000..29ef96e9
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.cpp
@@ -0,0 +1,101 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* Copyright (C) 2006 by Jens Dagerbo *
+* jens.dagerbo@swipnet.se *
+* *
+* 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 <klistbox.h>
+#include <kcombobox.h>
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <cstdlib>
+
+#include "settingsdialog.h"
+
+QListBoxItem* QListBox_selectedItem( QListBox* cpQListBox )
+{
+ if ( cpQListBox->selectionMode() != QListBox::Single )
+ return 0;
+ if ( cpQListBox->isSelected( cpQListBox->currentItem() ) )
+ return cpQListBox->item( cpQListBox->currentItem() );
+ return 0;
+}
+
+SettingsDialog::SettingsDialog( QWidget* parent, const char* name, WFlags fl )
+: SettingsDialogBase( parent, name, fl )
+{
+ KApplication::kApplication()->dirs()->addResourceType("include","include");
+ QStringList kdedirs=KApplication::kApplication()->dirs()->findDirs("include","");
+ for( QStringList::Iterator it=kdedirs.begin(); it!=kdedirs.end(); ++it )
+ {
+ QString kdedir = *it;
+ if ( !kdedir.isEmpty() && isValidKDELibsDir( kdedir ) )
+ if ( !kdeListBox->findItem( kdedir, ExactMatch ) )
+ kdeListBox->insertItem( kdedir );
+ }
+
+ kdeUrl->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ connect( addUrlButton, SIGNAL(clicked()), this, SLOT(addUrlButton_clicked()) );
+}
+
+SettingsDialog::~SettingsDialog()
+{}
+
+void SettingsDialog::slotSelectionChanged( QListBoxItem* )
+{
+ emit enabled( kdeListBox->selectedItem() != 0 );
+}
+
+bool SettingsDialog::isValidKDELibsDir( const QString & path ) const
+{
+ return QFile::exists( path + "/kapplication.h" );
+}
+
+QString SettingsDialog::kdeDir( ) const
+{
+ return kdeListBox->currentText();
+}
+
+void SettingsDialog::addUrlButton_clicked()
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( isValidKDELibsDir( kdeUrl->url() ) )
+ {
+ kdeListBox->insertItem( kdeUrl->url() );
+ if ( QListBoxItem * item = kdeListBox->findItem( kdeUrl->url(), ExactMatch ) )
+ {
+ kdeListBox->setSelected( item, true );
+ }
+ kdeUrl->lineEdit()->clear();
+ }
+ else
+ {
+ KMessageBox::error( this, i18n("This does not appear to be a valid KDE include directory.\nPlease select a different directory."), i18n("Invalid Directory") );
+ }
+}
+
+
+#include "settingsdialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
+
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.h b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.h
new file mode 100644
index 00000000..ba15019b
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialog.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include "settingsdialogbase.h"
+
+class SettingsDialog : public SettingsDialogBase
+{
+ Q_OBJECT
+
+public:
+ SettingsDialog(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~SettingsDialog();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ bool isValidKDELibsDir( const QString& path ) const;
+
+ QString kdeDir() const;
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void slotSelectionChanged(QListBoxItem*);
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void addUrlButton_clicked();
+};
+
+#endif
+
+
diff --git a/languages/cpp/pcsimporter/kdelibsimporter/settingsdialogbase.ui b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialogbase.ui
new file mode 100644
index 00000000..00b8c3ac
--- /dev/null
+++ b/languages/cpp/pcsimporter/kdelibsimporter/settingsdialogbase.ui
@@ -0,0 +1,131 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SettingsDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SettingsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>403</width>
+ <height>266</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>KDE include directories:
+Only the selected entry will be used</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="3" column="1">
+ <item>
+ <property name="text">
+ <string>KDE Libs Headers</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>All KDE Headers</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cbParsingScope</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Decide if you want to restrict the Code Completion database to only the base kdelibs API or the entire KDE include structure</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Scope:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>kdeUrl</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If none of the directories KDevelop found is what you want,you can enter a directory of your choice here</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="3">
+ <property name="name">
+ <cstring>addUrlButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>kdeListBox</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="2" rowspan="1" colspan="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>220</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>kdeListBox</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<signals>
+ <signal>enabled(int)</signal>
+</signals>
+<slots>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/pcsimporter/qt4importer/Makefile.am b/languages/cpp/pcsimporter/qt4importer/Makefile.am
new file mode 100644
index 00000000..b0b4a622
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_srcdir)/languages/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkdevqt4importer.la
+
+noinst_HEADERS = kdevqt4importer.h settingsdialog.h
+libkdevqt4importer_la_SOURCES = kdevqt4importer.cpp settingsdialogbase.ui settingsdialog.cpp
+kde_services_DATA = kdevqt4importer.desktop
+libkdevqt4importer_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la
+libkdevqt4importer_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp
new file mode 100644
index 00000000..f4fedea0
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp
@@ -0,0 +1,107 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "kdevqt4importer.h"
+#include "kdevqt4importer.moc"
+#include "settingsdialog.h"
+
+#include <kgenericfactory.h>
+#include <ktempfile.h>
+#include <kprocess.h>
+#include <kdebug.h>
+
+#include <qtextstream.h>
+#include <qlabel.h>
+#include <qdir.h>
+
+K_EXPORT_COMPONENT_FACTORY( libkdevqt4importer, KGenericFactory<KDevQt4Importer>( "kdevqt4importer" ) )
+
+KDevQt4Importer::KDevQt4Importer( QObject * parent, const char * name, const QStringList& )
+ : KDevPCSImporter( parent, name )
+{
+ m_qtfile = 0;
+}
+
+KDevQt4Importer::~KDevQt4Importer()
+{
+ if (m_qtfile)
+ delete m_qtfile;
+
+ m_qtfile = 0;
+}
+
+QStringList KDevQt4Importer::fileList()
+{
+ if( !m_settings )
+ return QStringList();
+
+ if (m_qtfile)
+ delete m_qtfile;
+
+ KTempFile ifile;
+ QTextStream &is = *ifile.textStream();
+
+ is << "#include <QtCore/qobjectdefs.h>\n"
+ << "#undef Q_SLOTS\n#undef Q_SIGNALS\n#undef slots\n#undef signals"
+ << "#define Q_SLOTS slots\n"
+ << "#define Q_SIGNALS signals\n"
+ << "#include <QtCore/QtCore>\n"
+ << "#include <QtGui/QtGui>\n"
+ << "#include <QtNetwork/QtNetwork>\n"
+ << "#include <QtXml/QtXml>\n"
+ << "#include <Qt3Support/Qt3Support>\n"
+ << "#include <QtSql/QtSql>\n"
+ << "#include <QtTest/QtTest>\n"
+ << "#include <QtOpenGL/QtOpenGL>\n";
+
+
+
+ KProcess proc;
+ proc << "cpp" << "-nostdinc" << "-xc++";
+
+ m_qtfile = new KTempFile();
+
+ // include paths
+ QStringList paths = includePaths();
+ for (QStringList::Iterator it = paths.begin(); it != paths.end(); ++it)
+ proc << "-I" << *it;
+
+ ifile.close();
+
+ QString o;
+ o += "-o";
+ o += m_qtfile->name();
+
+ proc << ifile.name() << o;
+ proc.start(KProcess::Block);
+
+ return m_qtfile->name();
+}
+
+QStringList KDevQt4Importer::includePaths()
+{
+ if( !m_settings || !m_qtfile)
+ return QStringList();
+
+ QStringList includePaths;
+ includePaths.push_back( m_settings->qtDir() );
+ includePaths.push_back( m_settings->qtDir() + "/Qt" );
+
+ /// @todo add mkspec
+ return includePaths;
+}
+
+QWidget * KDevQt4Importer::createSettingsPage( QWidget * parent, const char * name )
+{
+ m_settings = new SettingsDialog( parent, name );
+ return m_settings;
+}
+
diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.desktop b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.desktop
new file mode 100644
index 00000000..d1003610
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.desktop
@@ -0,0 +1,34 @@
+[Desktop Entry]
+Type=Service
+Name=KDevQt4Importer
+Name[de]=Qt4-PCS-Import (KDevelop)
+Name[fr]=KDevQtImporter
+Name[nds]=Qt4-PCS-Import (KDevelop)
+Name[ru]=KDevQt 4Importer
+Name[sv]=KDevelop QT4-import
+Comment=KDevelop Qt4 PCS Importer
+Comment[ca]=Importador PCS de Qt4 per a KDevelop
+Comment[da]=KDevelop Qt4 PCS importør
+Comment[de]=Qt4-Import für persistenten Klassenspeicher
+Comment[el]=Εισαγωγέας PCS KDevelop Qt4
+Comment[es]=Importador PCS de Qt4 de KDevelop
+Comment[et]=KDevelopi Qt4 PCS importija
+Comment[fr]=Importation PCS de Qt4 pour KDevelop
+Comment[hu]=KDevelop Qt4 PCS-importáló
+Comment[it]=Importatore PCS di Qt4 di KDevelop
+Comment[ja]=KDevelop Qt4 PCS インポータ
+Comment[nds]=Qt4-Import för duerhaftig Klassenspieker
+Comment[pl]=KDevelop: importowanie PCS Qt4
+Comment[pt]=Importador de PCS para Qt4 do KDevelop
+Comment[pt_BR]=Importador de PCS para Qt4 do KDevelop
+Comment[ru]=Импорт Qt 4 PCS в KDevelop
+Comment[sk]=KDevelop Qt4 PCS import
+Comment[sr]=KDevelop-ов Qt4 PCS увозник
+Comment[sr@Latn]=KDevelop-ov Qt4 PCS uvoznik
+Comment[sv]=KDevelop QT4 PCS-import
+Comment[zh_TW]=KDevelop Qt4 PCS 匯入器
+Icon=gear
+ServiceTypes=KDevelop/PCSImporter
+X-KDE-Library=libkdevqt4importer
+X-KDevelop-PCSImporter=
+X-KDevelop-Version=5
diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h
new file mode 100644
index 00000000..821e6fef
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KDEVQTIMPORTER_H
+#define KDEVQTIMPORTER_H
+
+#include <kdevpcsimporter.h>
+#include <qguardedptr.h>
+
+class SettingsDialog;
+class KTempFile;
+
+class KDevQt4Importer : public KDevPCSImporter
+{
+ Q_OBJECT
+public:
+ KDevQt4Importer( QObject* parent=0, const char* name=0, const QStringList& args=QStringList() );
+ virtual ~KDevQt4Importer();
+
+ virtual QString dbName() const { return QString::fromLatin1("Qt4"); }
+ virtual QStringList fileList();
+ virtual QStringList includePaths();
+
+ virtual QWidget* createSettingsPage( QWidget* parent, const char* name=0 );
+
+private:
+ QGuardedPtr<SettingsDialog> m_settings;
+ KTempFile *m_qtfile;
+};
+
+#endif
diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp
new file mode 100644
index 00000000..cc59c6e9
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <klistbox.h>
+#include <kcombobox.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <cstdlib>
+
+#include "settingsdialog.h"
+
+QListBoxItem* QListBox_selectedItem(QListBox* cpQListBox)
+{
+ if ( cpQListBox->selectionMode() != QListBox::Single )
+ return 0;
+ if ( cpQListBox->isSelected( cpQListBox->currentItem() ) )
+ return cpQListBox->item(cpQListBox->currentItem());
+ return 0;
+}
+
+SettingsDialog::SettingsDialog(QWidget* parent, const char* name, WFlags fl)
+ : SettingsDialogBase(parent,name,fl)
+{
+ QStringList qtdirs;
+ qtdirs.push_back( ::getenv("QTDIR") + QString("/include") );
+ qtdirs.push_back( QString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt/include" );
+ qtdirs.push_back( QString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt-main/include" );
+ qtdirs.push_back( "/usr/qt/4/include" );
+
+ for( QStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it )
+ {
+ QString qtdir = *it;
+ if( !qtdir.isEmpty() && isValidQtDir(qtdir) )
+ if (!qtListBox->findItem(qtdir, ExactMatch))
+ qtListBox->insertItem( qtdir );
+ }
+
+ qtUrl->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ connect( addUrlButton, SIGNAL(clicked()), this, SLOT(addUrlButton_clicked()) );
+}
+
+SettingsDialog::~SettingsDialog()
+{
+}
+
+void SettingsDialog::slotSelectionChanged(QListBoxItem* item)
+{
+ if( !qtListBox->selectedItem() )
+ {
+ emit enabled( false );
+ return;
+ }
+
+
+ emit enabled( true );
+}
+
+bool SettingsDialog::isValidQtDir( const QString & path ) const
+{
+ return QFile::exists( path + "/QtCore/QtCore" );
+}
+
+QString SettingsDialog::qtDir( ) const
+{
+ return qtListBox->currentText();
+}
+
+QString SettingsDialog::configuration( ) const
+{
+ return "";
+}
+
+void SettingsDialog::addUrlButton_clicked( )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( isValidQtDir( qtUrl->url() ) )
+ {
+ qtListBox->insertItem( qtUrl->url() );
+ if ( QListBoxItem * item = qtListBox->findItem( qtUrl->url(), ExactMatch ) )
+ {
+ qtListBox->setSelected( item, true );
+ }
+ qtUrl->lineEdit()->clear();
+ }
+ else
+ {
+ KMessageBox::error( this, i18n("This does not appear to be a valid Qt4 include directory.\nPlease select a different directory."), i18n("Invalid Directory") );
+ }
+}
+
+
+#include "settingsdialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
+
diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.h b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h
new file mode 100644
index 00000000..1ec5663e
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include "settingsdialogbase.h"
+
+class SettingsDialog : public SettingsDialogBase
+{
+ Q_OBJECT
+
+public:
+ SettingsDialog(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~SettingsDialog();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ bool isValidQtDir( const QString& path ) const;
+
+ QString qtDir() const;
+ QString configuration() const;
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void slotSelectionChanged(QListBoxItem*);
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void addUrlButton_clicked();
+
+};
+
+#endif
+
+
diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui
new file mode 100644
index 00000000..f655e4f9
--- /dev/null
+++ b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui
@@ -0,0 +1,79 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SettingsDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SettingsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>346</width>
+ <height>275</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Qt4 include directories:
+Only the selected entry will be used</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>addUrlButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="0">
+ <property name="name">
+ <cstring>qtUrl</cstring>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>qtListBox</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>qtListBox</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<signals>
+ <signal>enabled(int)</signal>
+</signals>
+<slots>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/pcsimporter/qtimporter/Makefile.am b/languages/cpp/pcsimporter/qtimporter/Makefile.am
new file mode 100644
index 00000000..878f9b4a
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_srcdir)/languages/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libkdevqtimporter.la
+
+noinst_HEADERS = kdevqtimporter.h settingsdialog.h
+libkdevqtimporter_la_SOURCES = kdevqtimporter.cpp settingsdialogbase.ui settingsdialog.cpp
+kde_services_DATA = kdevqtimporter.desktop
+libkdevqtimporter_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/interfaces/liblang_interfaces.la
+libkdevqtimporter_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
diff --git a/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.cpp b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.cpp
new file mode 100644
index 00000000..add8574a
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "kdevqtimporter.h"
+#include "kdevqtimporter.moc"
+#include "settingsdialog.h"
+
+#include <kgenericfactory.h>
+
+#include <qlabel.h>
+#include <qdir.h>
+
+K_EXPORT_COMPONENT_FACTORY( libkdevqtimporter, KGenericFactory<KDevQtImporter>( "kdevqtimporter" ) )
+
+KDevQtImporter::KDevQtImporter( QObject * parent, const char * name, const QStringList& )
+ : KDevPCSImporter( parent, name )
+{}
+
+KDevQtImporter::~KDevQtImporter()
+{}
+
+QStringList KDevQtImporter::fileList()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ QDir dir( m_settings->qtDir() );
+ QStringList lst = dir.entryList( "*.h" );
+ QStringList fileList;
+ for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ if ( ( *it ).startsWith( "qconfig-" ) )
+ {
+ if ( ( *it ).endsWith( m_settings->configuration() + ".h" ) )
+ fileList.prepend( dir.absPath() + "/" + ( *it ) );
+ }
+ else
+ {
+ fileList.push_back( dir.absPath() + "/" + ( *it ) );
+ }
+ }
+ return fileList;
+}
+
+QStringList KDevQtImporter::includePaths()
+{
+ if ( !m_settings )
+ return QStringList();
+
+ QStringList includePaths;
+ includePaths.push_back( m_settings->qtDir() );
+ includePaths.push_back( m_settings->qtDir() + "/private" );
+ includePaths.push_back( m_settings->qtDir() + "/default" );
+
+ /// @todo add mkspec
+ return includePaths;
+}
+
+QWidget * KDevQtImporter::createSettingsPage( QWidget * parent, const char * name )
+{
+ m_settings = new SettingsDialog( parent, name );
+ return m_settings;
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.desktop b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.desktop
new file mode 100644
index 00000000..965e581f
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.desktop
@@ -0,0 +1,37 @@
+[Desktop Entry]
+Type=Service
+Name=KDevQtImporter
+Name[da]=KDevelop Qt-importør
+Name[de]=Qt-PCS-Import (KDevelop)
+Name[hi]=के-डेव-क्यूटी-आयातक
+Name[nds]=Qt-PCS-Import (KDevelop)
+Name[pl]=KDevImportQt
+Name[sv]=KDevelop QT-import
+Name[ta]=கெடெவ் க்யு இறக்குமதியாளர்
+Name[zh_TW]=KDev Qt 匯入器
+Comment=KDevelop Qt3 PCS Importer
+Comment[ca]=Importador PCS de Qt3 per a KDevelop
+Comment[da]=KDevelop Qt3 PCS importør
+Comment[de]=Qt3-Import für persistenten Klassenspeicher
+Comment[el]=Εισαγωγέας PCS KDevelop Qt3
+Comment[es]=Importador PCS de Qt3 de KDevelop
+Comment[et]=KDevelopi Qt3 PCS importija
+Comment[fr]=Importation PCS de Qt3 pour KDevelop
+Comment[hu]=KDevelop Qt3 PCS-importáló
+Comment[it]=Importatore PCS di Qt3 di KDevelop
+Comment[ja]=KDevelop Qt3 PCS インポータ
+Comment[nds]=Qt3-Import för duerhaftig Klassenspieker
+Comment[pl]=KDevelop: importowanie PCS Qt3
+Comment[pt]=Importador de PCS para Qt3 do KDevelop
+Comment[pt_BR]=Importador de PCS para Qt3 do KDevelop
+Comment[ru]=Импорт Qt 3 PCS в KDevelop
+Comment[sk]=KDevelop Qt3 PCS import
+Comment[sr]=KDevelop-ов Qt3 PCS увозник
+Comment[sr@Latn]=KDevelop-ov Qt3 PCS uvoznik
+Comment[sv]=KDevelop QT3 PCS-import
+Comment[zh_TW]=KDevelop Qt3 PCS 匯入器
+Icon=gear
+ServiceTypes=KDevelop/PCSImporter
+X-KDE-Library=libkdevqtimporter
+X-KDevelop-PCSImporter=
+X-KDevelop-Version=5
diff --git a/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.h b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.h
new file mode 100644
index 00000000..c53b0a8a
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/kdevqtimporter.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KDEVQTIMPORTER_H
+#define KDEVQTIMPORTER_H
+
+#include <kdevpcsimporter.h>
+#include <qguardedptr.h>
+
+class SettingsDialog;
+
+class KDevQtImporter : public KDevPCSImporter
+{
+ Q_OBJECT
+public:
+ KDevQtImporter( QObject* parent=0, const char* name=0, const QStringList& args=QStringList() );
+ virtual ~KDevQtImporter();
+
+ virtual QString dbName() const { return QString::fromLatin1("Qt"); }
+ virtual QStringList fileList();
+ virtual QStringList includePaths();
+
+ virtual QWidget* createSettingsPage( QWidget* parent, const char* name=0 );
+
+private:
+ QGuardedPtr<SettingsDialog> m_settings;
+};
+
+#endif
diff --git a/languages/cpp/pcsimporter/qtimporter/settingsdialog.cpp b/languages/cpp/pcsimporter/qtimporter/settingsdialog.cpp
new file mode 100644
index 00000000..b0db10cc
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/settingsdialog.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* Copyright (C) 2006 by Jens Dagerbo *
+* jens.dagerbo@swipnet.se *
+* *
+* 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 <klistbox.h>
+#include <kcombobox.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <cstdlib>
+
+#include "settingsdialog.h"
+
+QListBoxItem* QListBox_selectedItem( QListBox* cpQListBox )
+{
+ if ( cpQListBox->selectionMode() != QListBox::Single )
+ return 0;
+ if ( cpQListBox->isSelected( cpQListBox->currentItem() ) )
+ return cpQListBox->item( cpQListBox->currentItem() );
+ return 0;
+}
+
+SettingsDialog::SettingsDialog( QWidget* parent, const char* name, WFlags fl )
+ : SettingsDialogBase( parent, name, fl )
+{
+ QStringList qtdirs;
+ qtdirs.push_back( ::getenv( "QTDIR" ) + QString("/include") );
+ qtdirs.push_back( "/usr/lib/qt3/include" );
+ qtdirs.push_back( "/usr/lib/qt/include" );
+ qtdirs.push_back( "/usr/share/qt3/include" );
+ qtdirs.push_back( "/usr/qt/3/include" ); // gentoo style
+
+ for ( QStringList::Iterator it = qtdirs.begin(); it != qtdirs.end(); ++it )
+ {
+ QString qtdir = *it;
+ if ( !qtdir.isEmpty() && isValidQtDir( qtdir ) )
+ if ( !qtListBox->findItem( qtdir, ExactMatch ) )
+ qtListBox->insertItem( qtdir );
+ }
+
+ qtUrl->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ connect( addUrlButton, SIGNAL(clicked()), this, SLOT(addUrlButton_clicked()) );
+}
+
+SettingsDialog::~SettingsDialog()
+{}
+
+void SettingsDialog::slotSelectionChanged( QListBoxItem* )
+{
+ if ( !qtListBox->selectedItem() )
+ {
+ emit enabled( false );
+ return ;
+ }
+
+ QDir dir( qtDir() );
+ QStringList qconfigFileList = dir.entryList( "qconfig-*.h" );
+ qtConfiguration->clear();
+ QRegExp rx( "qconfig-(\\w+)\\.h" );
+ for ( QStringList::Iterator it = qconfigFileList.begin(); it != qconfigFileList.end(); ++it )
+ {
+ ( void ) rx.exactMatch( *it );
+ qtConfiguration->insertItem( rx.cap( 1 ) );
+ }
+
+ emit enabled( true );
+}
+
+bool SettingsDialog::isValidQtDir( const QString & path ) const
+{
+ return QFile::exists( path + "/qt.h" );
+}
+
+QString SettingsDialog::qtDir( ) const
+{
+ return qtListBox->currentText();
+}
+
+QString SettingsDialog::configuration( ) const
+{
+ return qtConfiguration->currentText();
+}
+void SettingsDialog::addUrlButton_clicked( )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( isValidQtDir( qtUrl->url() ) )
+ {
+ qtListBox->insertItem( qtUrl->url() );
+ if ( QListBoxItem * item = qtListBox->findItem( qtUrl->url(), ExactMatch ) )
+ {
+ qtListBox->setSelected( item, true );
+ }
+ qtUrl->lineEdit()->clear();
+ }
+ else
+ {
+ KMessageBox::error( this, i18n("This does not appear to be a valid Qt3 include directory.\nPlease select a different directory."), i18n("Invalid Directory") );
+ }
+
+}
+
+#include "settingsdialog.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
+
diff --git a/languages/cpp/pcsimporter/qtimporter/settingsdialog.h b/languages/cpp/pcsimporter/qtimporter/settingsdialog.h
new file mode 100644
index 00000000..1ec5663e
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/settingsdialog.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include "settingsdialogbase.h"
+
+class SettingsDialog : public SettingsDialogBase
+{
+ Q_OBJECT
+
+public:
+ SettingsDialog(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~SettingsDialog();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ bool isValidQtDir( const QString& path ) const;
+
+ QString qtDir() const;
+ QString configuration() const;
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void slotSelectionChanged(QListBoxItem*);
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ void addUrlButton_clicked();
+
+};
+
+#endif
+
+
diff --git a/languages/cpp/pcsimporter/qtimporter/settingsdialogbase.ui b/languages/cpp/pcsimporter/qtimporter/settingsdialogbase.ui
new file mode 100644
index 00000000..fa485d57
--- /dev/null
+++ b/languages/cpp/pcsimporter/qtimporter/settingsdialogbase.ui
@@ -0,0 +1,139 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SettingsDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SettingsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>397</width>
+ <height>283</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="3" column="1" rowspan="1" colspan="2">
+ <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>161</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <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="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Scope:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>qtConfiguration</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select the Qt configuration for which to create a Code Completion database. If you do not know what this option does, accept the default.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>addUrlButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>qtUrl</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Qt3 include directories:
+Only the selected entry will be used</string>
+ </property>
+ </widget>
+ <widget class="KListBox" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>qtListBox</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>qtListBox</sender>
+ <signal>selectionChanged(QListBoxItem*)</signal>
+ <receiver>SettingsDialogBase</receiver>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<signals>
+ <signal>enabled(int)</signal>
+</signals>
+<slots>
+ <slot>slotSelectionChanged(QListBoxItem*)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/cpp/problemreporter.cpp b/languages/cpp/problemreporter.cpp
new file mode 100644
index 00000000..48f9a84a
--- /dev/null
+++ b/languages/cpp/problemreporter.cpp
@@ -0,0 +1,441 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "problemreporter.h"
+#include "cppsupportpart.h"
+#include "configproblemreporter.h"
+#include "backgroundparser.h"
+
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+
+#include <kdeversion.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/markinterface.h>
+
+#include <ktexteditor/markinterfaceextension.h>
+#include <ktexteditor/view.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kdialogbase.h>
+
+#include <kconfig.h>
+
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qfileinfo.h>
+#include <qwhatsthis.h>
+#include <qtabbar.h>
+#include <qwidgetstack.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+
+class ProblemItem: public KListViewItem
+{
+public:
+ ProblemItem( QListView* parent, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, problem, file, line, column )
+ {}
+
+ ProblemItem( QListViewItem* parent, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, problem, file, line, column )
+ {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const
+ {
+ if ( column == 1 || column == 2 )
+ {
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if ( a == b )
+ return 0;
+ return ( a > b ? 1 : -1 );
+ }
+ return KListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+ProblemReporter::ProblemReporter( CppSupportPart* part, QWidget* parent, const char* name )
+: QWidget( parent, name ? name : "problemreporter" ),
+m_cppSupport( part ),
+// m_document( 0 ),
+m_markIface( 0 )
+{
+ QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. "
+ "It displays TODO entries, FIXME's and errors reported by a language parser. "
+ "To add a TODO or FIXME entry, just type<br>"
+ "<tt>//@todo my todo</tt><br>"
+ "<tt>//TODO: my todo</tt><br>"
+ "<tt>//FIXME fix this</tt>"));
+
+ m_initCurrentTimer = new QTimer( this );
+ connect( m_initCurrentTimer, SIGNAL(timeout()), this, SLOT(initCurrentList()) );
+ m_gridLayout = new QGridLayout(this,2,3);
+
+ m_errorList = new KListView(this);
+ m_warningList = new KListView(this);
+ m_fixmeList = new KListView(this);
+ m_todoList = new KListView(this);
+ m_filteredList = new KListView(this);
+ m_currentList = new KListView(this);
+
+ m_filteredList->addColumn( i18n("Level") );
+ m_currentList->addColumn( i18n("Level") );
+
+ //addColumn( i18n("Level") );
+ InitListView(m_warningList);
+ InitListView(m_errorList);
+ InitListView(m_fixmeList);
+ InitListView(m_todoList);
+ InitListView(m_filteredList);
+ InitListView(m_currentList);
+ m_currentList->removeColumn(1);
+
+ m_widgetStack = new QWidgetStack(this);
+ m_widgetStack->addWidget(m_currentList,0);
+ m_widgetStack->addWidget(m_errorList,1);
+ m_widgetStack->addWidget(m_warningList,2);
+ m_widgetStack->addWidget(m_fixmeList,3);
+ m_widgetStack->addWidget(m_todoList,4);
+ m_widgetStack->addWidget(m_filteredList,5);
+
+ m_tabBar = new QTabBar(this);
+ m_tabBar->insertTab(new QTab(i18n("Current")),0);
+ m_tabBar->insertTab(new QTab(i18n("Errors")),1);
+ m_tabBar->insertTab(new QTab(i18n("Warnings")),2);
+ m_tabBar->insertTab(new QTab(i18n("Fixme")),3);
+ m_tabBar->insertTab(new QTab(i18n("Todo")),4);
+ m_tabBar->insertTab(new QTab(i18n("Filtered")),5);
+ m_tabBar->setTabEnabled(0,false);
+ m_tabBar->setTabEnabled(5,false);
+
+ m_filterEdit = new KLineEdit(this);
+
+ QLabel* m_filterLabel = new QLabel(i18n("Lookup:"),this);
+
+ m_gridLayout->addWidget(m_tabBar,0,0);
+ m_gridLayout->addMultiCellWidget(m_widgetStack,1,1,0,2);
+ m_gridLayout->addWidget(m_filterLabel,0,1,Qt::AlignRight);
+ m_gridLayout->addWidget(m_filterEdit,0,2,Qt::AlignLeft);
+
+ connect( m_filterEdit, SIGNAL(returnPressed()),
+ this, SLOT(slotFilter()) );
+ connect( m_filterEdit, SIGNAL(textChanged( const QString & )),
+ this, SLOT(slotFilter()) );
+ connect( m_tabBar, SIGNAL(selected(int)),
+ this, SLOT(slotTabSelected(int)) );
+ connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partAdded(KParts::Part*)),
+ this, SLOT(slotPartAdded(KParts::Part*)) );
+
+ // any editors that were open when we loaded the project needs to have their markType07 icon set too..
+ QPtrListIterator<KParts::Part> it( *m_cppSupport->partController()->parts() );
+ while( it.current() )
+ {
+ if ( KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( it.current() ) )
+ {
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+ }
+ ++it;
+ }
+
+ slotActivePartChanged( part->partController()->activePart() );
+}
+
+void ProblemReporter::slotFilter()
+{
+ if(!m_tabBar->isTabEnabled(5))
+ m_tabBar->setTabEnabled(5,true);
+
+ m_tabBar->tab(5)->setText(i18n("Filtered: %1").arg( m_filterEdit->text() ));
+ m_tabBar->setCurrentTab(5);
+
+ m_filteredList->clear();
+
+ if ( m_filterEdit->text().isEmpty() )
+ {
+ m_tabBar->setTabEnabled( 5, false );
+ return;
+ }
+
+ filterList(m_errorList,i18n("Error"));
+ filterList(m_warningList,i18n("Warning"));
+ filterList(m_fixmeList,i18n("Fixme"));
+ filterList(m_todoList,i18n("Todo"));
+
+}
+
+void ProblemReporter::filterList(KListView* listview, const QString& level)
+{
+ QListViewItemIterator it( listview );
+ while ( it.current() )
+ {
+ if ( it.current()->text(3).contains(m_filterEdit->text(),false))
+ {
+ new KListViewItem(m_filteredList,level,
+ it.current()->text(0), it.current()->text(1),
+ it.current()->text(2), it.current()->text(3));
+ }
+ ++it;
+ }
+}
+
+void ProblemReporter::slotTabSelected( int tabindex )
+{
+ m_widgetStack->raiseWidget(tabindex);
+}
+
+void ProblemReporter::InitListView(KListView* listview)
+{
+ listview->addColumn( i18n("File") );
+ listview->addColumn( i18n("Line") );
+ listview->addColumn( i18n("Column") );
+ listview->addColumn( i18n("Problem") );
+ listview->setAllColumnsShowFocus( TRUE );
+
+ connect( listview, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+
+ connect( listview, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem* )) );
+
+}
+
+ProblemReporter::~ProblemReporter()
+{
+}
+
+void ProblemReporter::slotActivePartChanged( KParts::Part* part )
+{
+ m_currentList->clear();
+
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part );
+ m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part );
+
+ if ( !ro_part )
+ {
+ m_tabBar->setTabEnabled(0,false);
+ return;
+ }
+
+ m_fileName = ro_part->url().path();
+
+ initCurrentList();
+}
+
+void EfficientKListView::limitSize( int size )
+{
+ if( m_map.size() <= size + 50 ) return;
+
+ QMap<int, HashedString> backMap;
+ for( InsertionMap::const_iterator it = m_insertionNumbers.begin(); it != m_insertionNumbers.end(); ++it )
+ backMap[ (*it).second ] = (*it).first;
+
+ for( QMap<int, HashedString>::const_iterator it = backMap.begin(); it != backMap.end() && m_map.size() > size; ++it )
+ removeAllItems( (*it).str() );
+}
+
+void EfficientKListView::removeAllItems( const QString& str )
+{
+ HashedString h(str);
+ m_insertionNumbers.erase( h ) ;
+
+ std::pair<Map::iterator, Map::iterator> p = m_map.equal_range( h );
+
+ for( Map::iterator it = p.first; it != p.second; ++it ) {
+ delete( (*it).second );
+ }
+
+ m_map.erase( p.first, p.second );
+}
+
+void ProblemReporter::removeAllProblems( const QString& filename )
+{
+ QString relFileName = m_cppSupport->project()->relativeProjectFile(filename);
+
+ kdDebug(9007) << "ProblemReporter::removeAllProblems()" << relFileName << endl;
+
+ m_errorList.limitSize( 300 );
+ m_warningList.limitSize( 300 );
+ m_fixmeList.limitSize( 300 );
+ m_todoList.limitSize( 300 );
+
+ m_warningList.removeAllItems( relFileName );
+ m_errorList.removeAllItems( relFileName );
+ m_fixmeList.removeAllItems( relFileName );
+ m_todoList.removeAllItems( relFileName );
+
+ if( m_markIface )
+ {
+ QPtrList<KTextEditor::Mark> marks = m_markIface->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while( it.current() )
+ {
+ m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 );
+ ++it;
+ }
+ }
+ m_initCurrentTimer->start(500, true);
+}
+
+void ProblemReporter::initCurrentList()
+{
+ m_tabBar->setTabEnabled(0,true);
+
+ QString relFileName = m_cppSupport->project()->relativeProjectFile(m_fileName);
+
+ m_currentList->clear();
+
+ updateCurrentWith(m_errorList, i18n("Error"),relFileName);
+ updateCurrentWith(m_warningList, i18n("Warning"),relFileName);
+ updateCurrentWith(m_fixmeList,i18n("Fixme"),relFileName);
+ updateCurrentWith(m_todoList,i18n("Todo"),relFileName);
+
+// m_tabBar->setCurrentTab(0);
+}
+
+void ProblemReporter::updateCurrentWith(EfficientKListView& listview, const QString& level, const QString& filename)
+{
+ EfficientKListView::Range r = listview.getRange( filename );
+ for( ; r.first != r.second; ++r.first )
+ new ProblemItem(m_currentList,level,(*r.first).second->text(1),(*r.first).second->text(2),(*r.first).second->text(3));
+}
+
+void ProblemReporter::slotSelected( QListViewItem* item )
+{
+ bool is_filtered = false;
+ bool is_current = false;
+ if(item->listView() == m_filteredList)
+ is_filtered = true;
+ else if(item->listView() == m_currentList)
+ is_current = true;
+
+ //either use current file m_fileName or assemble a new one from current item (relative path) and projectDirectory
+ KURL url( is_current ? m_fileName : m_cppSupport->project()->projectDirectory() + "/" + item->text(0 + is_filtered) );
+ int line = item->text( 1 + is_filtered).toInt();
+ // int column = item->text( 3 ).toInt();
+ m_cppSupport->partController()->editDocument( url, line-1 );
+}
+
+bool ProblemReporter::hasErrors( const QString& fileName ) {
+ return m_errorList.hasItem( fileName );
+}
+
+void ProblemReporter::reportProblem( const QString& fileName, const Problem& p )
+{
+ int markType = levelToMarkType( p.level() );
+ if( markType != -1 && m_markIface && m_fileName == fileName )
+ m_markIface->addMark( p.line(), markType );
+
+ QString msg = p.text();
+ msg = msg.replace( QRegExp("\n"), "" );
+
+ QString relFileName = m_cppSupport->project()->relativeProjectFile(fileName);
+
+ EfficientKListView* list;
+
+ switch( p.level() )
+ {
+ case Problem::Level_Error:
+ list = &m_errorList;
+ break;
+ case Problem::Level_Warning:
+ list = &m_warningList;
+ break;
+ case Problem::Level_Todo:
+ list = &m_todoList;
+ break;
+ case Problem::Level_Fixme:
+ list = &m_fixmeList;
+ break;
+ default:
+ list = NULL;
+ }
+
+ if(list)
+ {
+ list->addItem( relFileName, new ProblemItem( *list,
+ relFileName,
+ QString::number( p.line() + 1 ),
+ QString::number( p.column() + 1 ),
+ msg ) );
+
+ }
+
+ m_initCurrentTimer->start( 500, true );
+}
+
+void ProblemReporter::slotPartAdded( KParts::Part* part )
+{
+ KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part );
+
+ if( !iface )
+ return;
+
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+}
+
+QString ProblemReporter::levelToString( int level ) const
+{
+ switch( level )
+ {
+ case Problem::Level_Error:
+ return QString( i18n("Error") );
+ case Problem::Level_Warning:
+ return QString( i18n("Warning") );
+ case Problem::Level_Todo:
+ return QString( i18n("Todo") );
+ case Problem::Level_Fixme:
+ return QString( i18n("Fixme") );
+ default:
+ return QString::null;
+ }
+}
+
+int ProblemReporter::levelToMarkType( int level ) const
+{
+ switch( level )
+ {
+ case Problem::Level_Error:
+ return KTextEditor::MarkInterface::markType07;
+ case Problem::Level_Warning:
+ return -1;
+ case Problem::Level_Todo:
+ return -1;
+ case Problem::Level_Fixme:
+ return -1;
+ default:
+ return -1;
+ }
+}
+
+#include "problemreporter.moc"
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/problemreporter.h b/languages/cpp/problemreporter.h
new file mode 100644
index 00000000..7e66b864
--- /dev/null
+++ b/languages/cpp/problemreporter.h
@@ -0,0 +1,156 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PROBLEMSREPORTER_H
+#define PROBLEMSREPORTER_H
+
+#include <klistview.h>
+#include <klineedit.h>
+#include <qguardedptr.h>
+#include <qdatetime.h>
+#include <map>
+#include <ext/hash_map>
+#include "hashedstring.h"
+
+class CppSupportPart;
+class QTimer;
+class QTabBar;
+class QWidgetStack;
+class QGridLayout;
+class KDialogBase;
+class Problem;
+class KURL;
+
+class EfficientKListView {
+public:
+ typedef __gnu_cxx::hash_multimap<HashedString, QListViewItem*> Map;
+ typedef std::pair< Map::const_iterator, Map::const_iterator > Range;
+ EfficientKListView( KListView* list = 0 ) : m_list( list ), m_insertionNumber( 0 ) {
+ }
+
+ EfficientKListView& operator = ( KListView* list ) {
+ m_list = list;
+ return *this;
+ }
+
+ operator KListView* () {
+ return m_list;
+ }
+
+ operator const KListView* () const {
+ return m_list;
+ }
+
+ KListView* operator -> () {
+ return m_list;
+ }
+
+ const KListView* operator -> () const {
+ return m_list;
+ }
+
+ void addItem( const QString& str, QListViewItem* item ) {
+ HashedString h( str );
+ m_insertionNumbers[h] = ++m_insertionNumber;
+ m_map.insert( std::make_pair( h, item ) );
+ }
+
+ Range getRange( const QString& str ) const {
+ return m_map.equal_range( HashedString(str) );
+ }
+
+ ///If the list has more then size items, the first items are removed until the size fits.
+ void limitSize( int size );
+
+ void removeAllItems( const QString& str );
+
+ bool hasItem( const QString& str ) const {
+ Map::const_iterator it = m_map.find( HashedString(str) );
+ return it != m_map.end();
+ }
+private:
+ int m_insertionNumber;
+ Map m_map;
+ typedef __gnu_cxx::hash_map<HashedString, int> InsertionMap;
+ InsertionMap m_insertionNumbers; //This is used to count which file was inserted first(higher insertion-number -> inserted later)
+ KListView* m_list;
+};
+
+namespace KParts
+{
+ class Part;
+}
+
+namespace KTextEditor
+{
+ class MarkInterface;
+ class Document;
+}
+
+class ProblemReporter: public QWidget
+{
+ Q_OBJECT
+public:
+ ProblemReporter( CppSupportPart* part, QWidget* parent = 0, const char* name = 0 );
+ virtual ~ProblemReporter();
+
+ void removeAllProblems( const QString& filename );
+ void reportProblem( const QString& fileName, const Problem& p );
+ bool hasErrors(const QString& file);
+
+public slots:
+
+private slots:
+ void slotPartAdded( KParts::Part* );
+ void slotActivePartChanged( KParts::Part* );
+ void slotSelected( QListViewItem* );
+ void slotTabSelected( int tabindex );
+ void slotFilter();
+ void initCurrentList();
+
+private:
+ QString levelToString( int level ) const;
+ int levelToMarkType( int level ) const;
+ void InitListView( KListView* listview );
+ void filterList( KListView* listview, const QString& level );
+ void updateCurrentWith( EfficientKListView& listview, const QString& level, const QString& filename );
+
+private:
+ QGridLayout* m_gridLayout;
+ QTabBar* m_tabBar;
+ QWidgetStack* m_widgetStack;
+ KListView* m_currentList;
+ QTimer* m_initCurrentTimer;
+ EfficientKListView m_errorList;
+ EfficientKListView m_fixmeList;
+ EfficientKListView m_todoList;
+ EfficientKListView m_warningList;
+ KListView* m_filteredList;
+ KLineEdit* m_filterEdit;
+
+ CppSupportPart* m_cppSupport;
+ KTextEditor::MarkInterface* m_markIface;
+ QString m_fileName;
+
+ ///@todo move these to cppsupportpart
+ int m_active;
+ int m_delay;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/qtbuildconfig.cpp b/languages/cpp/qtbuildconfig.cpp
new file mode 100644
index 00000000..809767bc
--- /dev/null
+++ b/languages/cpp/qtbuildconfig.cpp
@@ -0,0 +1,216 @@
+/*
+ Copyright (C) 2005 by Tobias Erbsland <te@profzone.ch>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "qtbuildconfig.h"
+#include "cppsupportpart.h"
+
+#include <domutil.h>
+
+#include <kdebug.h>
+#include <qdom.h>
+
+#include <stdlib.h>
+
+const QString QtBuildConfig::m_configRoot = QString( "/kdevcppsupport/qt" );
+
+QtBuildConfig::QtBuildConfig( CppSupportPart * part, QDomDocument* dom )
+ : QObject( part ), m_part( part ), m_dom( dom )
+{
+ init();
+}
+
+QtBuildConfig::~QtBuildConfig()
+{
+}
+
+void QtBuildConfig::init( )
+{
+ m_used = DomUtil::readBoolEntry( *m_dom, m_configRoot + "/used", false );
+ m_version = DomUtil::readIntEntry( *m_dom, m_configRoot + "/version", 3 );
+ if( m_version < 3 || m_version > 4 )
+ {
+ m_version = 3;
+ }
+ m_includeStyle = DomUtil::readIntEntry( *m_dom, m_configRoot + "/includestyle", 3 );
+ if( m_includeStyle < 3 || m_includeStyle > 4 )
+ {
+ m_includeStyle = m_version;
+ }
+ m_root = DomUtil::readEntry( *m_dom, m_configRoot + "/root", "" );
+ m_qmakePath = DomUtil::readEntry(*m_dom, m_configRoot + "/qmake", "");
+ m_designerPath = DomUtil::readEntry(*m_dom, m_configRoot + "/designer", "");
+ m_designerPluginPaths = DomUtil::readListEntry(*m_dom, m_configRoot + "/designerpluginpaths", "path" );
+
+ if( m_root.isEmpty() || !isValidQtDir( m_root ) )
+ {
+ findQtDir();
+ }
+ if( m_qmakePath.isEmpty() || !isExecutable( m_qmakePath ) )
+ {
+ m_qmakePath = findExecutable( "qmake-qt"+ QString::number( m_version ) );
+ if( m_qmakePath.isEmpty() || !isExecutable( m_qmakePath ) )
+ m_qmakePath = findExecutable( "qmake" );
+ }
+ if( m_designerPath.isEmpty() || !isExecutable( m_designerPath ) )
+ {
+ m_designerPath = findExecutable( "designer-qt"+QString::number( m_version ) );
+ if( m_designerPath.isEmpty() || !isExecutable( m_designerPath ) )
+ m_designerPath = findExecutable( "designer" );
+ }
+
+
+ m_designerIntegration = DomUtil::readEntry( *m_dom, m_configRoot + "/designerintegration" );
+ if( m_designerIntegration.isEmpty() )
+ {
+ if ( m_version == 3 )
+ m_designerIntegration = "EmbeddedKDevDesigner";
+ else
+ m_designerIntegration = "ExternalDesigner";
+ }
+}
+
+bool QtBuildConfig::isValidQtDir( const QString& path ) const
+{
+ QFileInfo inc( path + QString( QChar( QDir::separator() ) )+
+ "include"+QString( QChar( QDir::separator() ) )+
+ "qt.h" );
+ return ( m_version == 4 || ( m_version != 4 && inc.exists() ) );
+}
+
+void QtBuildConfig::buildBinDirs( QStringList & dirs ) const
+{
+ if( m_version == 3 )
+ {
+ if( !m_root.isEmpty() )
+ dirs << (m_root + QString( QChar( QDir::separator() ) ) + "bin");
+ dirs << (::getenv("QTDIR") + QString( QChar( QDir::separator() ) ) + "bin");
+ }
+ QStringList paths = QStringList::split(":",::getenv("PATH"));
+ dirs += paths;
+ QString binpath = QDir::rootDirPath() + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+
+ binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+ binpath = QDir::rootDirPath() + "usr" + QString( QChar( QDir::separator() ) ) + "local" + QString( QChar( QDir::separator() ) ) + "bin";
+ if( dirs.findIndex( binpath ) != -1 )
+ dirs << binpath;
+}
+
+
+QString QtBuildConfig::findExecutable( const QString& execname ) const
+{
+ QStringList dirs;
+ buildBinDirs( dirs );
+
+ for( QStringList::Iterator it=dirs.begin(); it!=dirs.end(); ++it )
+ {
+ QString designer = *it + QString( QChar( QDir::separator() ) ) + execname;
+ if( !designer.isEmpty() && isExecutable( designer ) )
+ {
+ return designer;
+ }
+ }
+ return "";
+}
+
+bool QtBuildConfig::isExecutable( const QString& path ) const
+{
+ QFileInfo fi(path);
+ return( fi.exists() && fi.isExecutable() );
+}
+
+void QtBuildConfig::findQtDir()
+{
+ QStringList qtdirs;
+ if( m_version == 3 )
+ qtdirs.push_back( ::getenv("QTDIR") );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( m_version ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt"+QString( QChar( QDir::separator() ) )+QString("%1").arg( m_version ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"share"+QString( QChar( QDir::separator() ) )+"qt"+QString("%1").arg( m_version ) );
+ qtdirs.push_back( QDir::rootDirPath()+"usr" );
+ qtdirs.push_back( QDir::rootDirPath()+"usr"+QString( QChar( QDir::separator() ) )+"lib"+QString( QChar( QDir::separator() ) )+"qt" );
+
+ for( QStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it )
+ {
+ QString qtdir = *it;
+ if( !qtdir.isEmpty() && isValidQtDir(qtdir) )
+ {
+ m_root = qtdir;
+ return;
+ }
+ }
+}
+
+void QtBuildConfig::store( )
+{
+ DomUtil::writeBoolEntry( *m_dom, m_configRoot + "/used", m_used );
+ DomUtil::writeIntEntry( *m_dom, m_configRoot + "/version", m_version );
+ DomUtil::writeIntEntry( *m_dom, m_configRoot + "/includestyle", m_includeStyle );
+ DomUtil::writeEntry( *m_dom, m_configRoot + "/root", m_root );
+ DomUtil::writeEntry( *m_dom, m_configRoot + "/designerintegration", m_designerIntegration );
+ DomUtil::writeEntry(*m_dom, m_configRoot + "/qmake", m_qmakePath );
+ DomUtil::writeEntry(*m_dom, m_configRoot + "/designer", m_designerPath );
+ DomUtil::writeListEntry(*m_dom, m_configRoot + "/designerpluginpaths", "path", m_designerPluginPaths );
+
+ emit stored();
+}
+
+void QtBuildConfig::setUsed( bool used )
+{
+ m_used = used;
+}
+
+void QtBuildConfig::setVersion( int version )
+{
+ m_version = version;
+}
+
+void QtBuildConfig::setIncludeStyle( int style )
+{
+ m_includeStyle = style;
+}
+
+void QtBuildConfig::setRoot( const QString& root )
+{
+ m_root = root;
+}
+
+void QtBuildConfig::setQMakePath( const QString& path )
+{
+ m_qmakePath = path;
+}
+
+void QtBuildConfig::setDesignerPluginPaths( const QStringList& pfx )
+{
+ m_designerPluginPaths = pfx;
+}
+
+void QtBuildConfig::setDesignerPath( const QString& path )
+{
+ m_designerPath = path;
+}
+
+void QtBuildConfig::setDesignerIntegration( const QString& designerIntegration )
+{
+ m_designerIntegration = designerIntegration;
+}
+#include "qtbuildconfig.moc"
+
+//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/languages/cpp/qtbuildconfig.h b/languages/cpp/qtbuildconfig.h
new file mode 100644
index 00000000..080cf2c1
--- /dev/null
+++ b/languages/cpp/qtbuildconfig.h
@@ -0,0 +1,90 @@
+/*
+ Copyright (C) 2005 by Tobias Erbsland <te@profzone.ch>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef QTBUILDCONFIG_H
+#define QTBUILDCONFIG_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+
+class CppSupportPart;
+class QDomDocument;
+
+/**
+ @brief The QtBuildConfig class stores all parameters related to the used Qt library
+
+ @author Tobias Erbsland <te@profzone.ch>
+*/
+class QtBuildConfig : public QObject
+{
+ Q_OBJECT
+
+public:
+ QtBuildConfig( CppSupportPart* part, QDomDocument* dom );
+ virtual ~QtBuildConfig();
+
+ inline bool isUsed() const { return m_used; }
+ inline int version() const { return m_version; }
+ inline int includeStyle() const { return m_includeStyle; }
+ inline const QString& root() const { return m_root; }
+ inline const QString& qmakePath() const { return m_qmakePath; }
+ inline const QString& designerPath() const { return m_designerPath; }
+ inline const QStringList& designerPluginPaths() const { return m_designerPluginPaths; }
+ inline const QString& designerIntegration() const { return m_designerIntegration; }
+
+ void setUsed( bool used );
+ void setVersion( int version );
+ void setIncludeStyle( int style );
+ void setRoot( const QString& root );
+ void setDesignerPath( const QString& path );
+ void setDesignerPluginPaths( const QStringList& pfx );
+ void setQMakePath( const QString& path );
+ void setDesignerIntegration( const QString& designerIntegration );
+ void init();
+
+public slots:
+ void store();
+
+signals:
+ void stored();
+
+private:
+
+ bool isValidQtDir( const QString& ) const;
+ void findQtDir();
+ QString findExecutable( const QString& ) const;
+ void buildBinDirs( QStringList& ) const;
+ bool isExecutable( const QString& ) const;
+
+ CppSupportPart* m_part; ///< The cpp support part
+ QDomDocument* m_dom; ///< The project configuration
+
+ bool m_used; ///< Flag if qt is used in this project.
+ int m_version; ///< The major version of the qt library (3 or 4)
+ int m_includeStyle; ///< The type of include style used (qt 3 or 4)
+ QString m_root; ///< The root directory of the used qt installation for Qt3
+ QString m_designerPath; ///< The path including the binary name of Qt Designer
+ QString m_qmakePath; ///< The path including the binary name of QMake
+ QStringList m_designerPluginPaths; ///< The Prefix for Designer
+ QString m_designerIntegration; ///< The type of designer used, kdevdesigner or qt designer
+
+ static const QString m_configRoot; ///< The root path of the configuration
+};
+
+#endif
+
+// kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/qtdesignercppintegration.cpp b/languages/cpp/qtdesignercppintegration.cpp
new file mode 100644
index 00000000..76581003
--- /dev/null
+++ b/languages/cpp/qtdesignercppintegration.cpp
@@ -0,0 +1,218 @@
+/***************************************************************************
+* Copyright (C) 2004 by Alexander Dymo *
+* adymo@mksat.net *
+* Portions Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#include "qtdesignercppintegration.h"
+
+#include <qpair.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+#include <domutil.h>
+#include <kdevpartcontroller.h>
+#include <kdevcreatefile.h>
+
+#include "backgroundparser.h"
+#include "cppsupportpart.h"
+#include "codemodel_utils.h"
+#include "implementationwidget.h"
+
+QtDesignerCppIntegration::QtDesignerCppIntegration( KDevLanguageSupport *part,
+ ImplementationWidget *impl )
+: QtDesignerIntegration( part, impl, true, 0 )
+{}
+
+void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function function, ClassDom klass )
+{
+ m_part->partController() ->editDocument( KURL( klass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController() ->activePart() );
+ if ( !editIface )
+ {
+ /// @todo show messagebox
+ // QDialog::accept();
+ return ;
+ }
+
+ int line, column;
+ klass->getEndPosition( &line, &column );
+
+ // compute the insertion point map
+ QMap<QString, QPair<int, int> > points;
+
+ const FunctionList functionList = klass->functionList();
+ for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it )
+ {
+ int funEndLine, funEndColumn;
+ ( *it ) ->getEndPosition( &funEndLine, &funEndColumn );
+ QString access = accessID( *it );
+ QPair<int, int> funEndPoint = qMakePair( funEndLine, funEndColumn );
+
+ if ( !points.contains( access ) || points[ access ] < funEndPoint )
+ {
+ points[ access ] = funEndPoint;
+ }
+ }
+
+ int insertedLine = 0;
+
+ QString access = function.access + ( function.type == KInterfaceDesigner::ftQtSlot ? " slots" : "" );
+
+ QString str = function.returnType + " " + function.function;
+ if ( function.specifier == "virtual" )
+ str = "virtual " + str;
+ else if ( function.specifier == "pure virtual" )
+ str = "virtual " + str + " = 0";
+ else if ( function.specifier == "static" )
+ str = "static " + str;
+ str += ";\n";
+ str = " " + str;
+
+ QPair<int, int> pt;
+ if ( points.contains( access ) )
+ {
+ pt = points[ access ];
+ }
+ else
+ {
+ str.prepend( access + ":\n" );
+ points[ access ] = qMakePair( line - 1, 0 );
+ pt = points[ access ]; // end of class declaration
+ }
+
+ editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str );
+ insertedLine += str.contains( QChar( '\n' ) );
+
+ CppSupportPart *cppPart = dynamic_cast<CppSupportPart *>( m_part );
+ cppPart->backgroundParser() ->addFile( klass->fileName() );
+
+ if ( function.specifier == "pure virtual" )
+ return ;
+
+
+ //implementation
+ QString stri = function.returnType + " " + klass->name() + "::" + function.function;
+ if ( function.specifier == "static" )
+ stri = "static " + stri;
+ stri += "\n{\n}\n";
+ stri = "\n" + stri;
+
+ QFileInfo fi( klass->fileName() );
+ QString implementationFile = fi.absFilePath();
+ implementationFile.replace( ".h", ".cpp" );
+
+ QFileInfo fileInfo( implementationFile );
+ if ( !QFile::exists( fileInfo.absFilePath() ) )
+ {
+ if ( KDevCreateFile * createFileSupp = m_part->extension<KDevCreateFile>( "KDevelop/CreateFile" ) )
+ createFileSupp->createNewFile( fileInfo.extension(), fileInfo.dirPath( true ), fileInfo.fileName() );
+ }
+
+ m_part->partController() ->editDocument( KURL( implementationFile ) );
+ editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController() ->activePart() );
+ if ( !editIface )
+ return ;
+
+ int atLine = 0, atColumn = 0;
+ TranslationUnitAST *translationUnit = 0;
+ ParsedFilePointer p = cppPart->backgroundParser() ->translationUnit( implementationFile );
+ if( p ) translationUnit = *p;
+ if ( translationUnit )
+ {
+ translationUnit->getEndPosition( &atLine, &atColumn );
+ kdDebug() << "atLine: " << atLine << endl;
+ stri = "\n" + stri;
+ }
+ else
+ {
+ atLine = editIface->numLines();
+ line = editIface->numLines();
+ while ( line > 0 )
+ {
+ if ( editIface->textLine( line ).isEmpty() )
+ {
+ --line;
+ continue;
+ }
+ else
+ {
+ if ( editIface->textLine( line ).contains( QRegExp( ".*#include .*\\.moc.*" ) ) )
+ atLine = line;
+ break;
+ }
+ }
+ kdDebug() << "atLine (2): " << atLine << endl;
+ atColumn = 0;
+ }
+
+ // editIface->insertLine( atLine + 1, QString::fromLatin1("") );
+ kdDebug() << "at line in intg: " << atLine << " atCol: " << atColumn << endl;
+ kdDebug() << "text: " << stri << endl;
+ editIface->insertText( atLine, atColumn, stri );
+ KTextEditor::View *activeView = dynamic_cast<KTextEditor::View*>( m_part->partController() ->activePart() ->widget() );
+ if ( activeView )
+ {
+ KTextEditor::ViewCursorInterface * cursor = dynamic_cast<KTextEditor::ViewCursorInterface*>( activeView );
+ if ( cursor )
+ cursor->setCursorPositionReal( atLine + 3, 1 );
+ }
+
+ cppPart->backgroundParser() ->addFile( implementationFile );
+}
+
+QString QtDesignerCppIntegration::accessID( FunctionDom fun ) const
+{
+ if ( fun->isSignal() )
+ return QString::fromLatin1( "signals" );
+
+ switch ( fun->access() )
+ {
+ case CodeModelItem::Public:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "public slots" );
+ return QString::fromLatin1( "public" );
+
+ case CodeModelItem::Protected:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "protected slots" );
+ return QString::fromLatin1( "protected" );
+
+ case CodeModelItem::Private:
+ if ( fun->isSlot() )
+ return QString::fromLatin1( "private slots" );
+ return QString::fromLatin1( "private" );
+ }
+
+ return QString::null;
+}
+
+void QtDesignerCppIntegration::processImplementationName( QString &name )
+{
+ name.replace( ".h", ".cpp" );
+}
+
+#include "qtdesignercppintegration.moc"
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/qtdesignercppintegration.h b/languages/cpp/qtdesignercppintegration.h
new file mode 100644
index 00000000..8709234d
--- /dev/null
+++ b/languages/cpp/qtdesignercppintegration.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+* Copyright (C) 2004 by Alexander Dymo *
+* adymo@mksat.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 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., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#ifndef QTDESIGNERCPPINTEGRATION_H
+#define QTDESIGNERCPPINTEGRATION_H
+
+#include <qtdesignerintegration.h>
+
+class QtDesignerCppIntegration : public QtDesignerIntegration
+{
+ Q_OBJECT
+public:
+ QtDesignerCppIntegration( KDevLanguageSupport *part, ImplementationWidget *impl );
+
+protected:
+ virtual void addFunctionToClass( KInterfaceDesigner::Function function, ClassDom klass );
+ QString accessID( FunctionDom fun ) const;
+
+ virtual void processImplementationName( QString &name );
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/safetycounter.h b/languages/cpp/safetycounter.h
new file mode 100644
index 00000000..d4333176
--- /dev/null
+++ b/languages/cpp/safetycounter.h
@@ -0,0 +1,59 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __SAFETYCOUNTER_H__
+#define __SAFETYCOUNTER_H__
+
+#include <kdebug.h>
+
+struct SafetyCounter {
+ int safetyCounter;
+ const int maxSafetyCounter;
+
+ SafetyCounter( int max = 40000 ) : safetyCounter(0), maxSafetyCounter(max) {
+ }
+
+ void init() {
+ safetyCounter = 0;
+ }
+
+ SafetyCounter& operator ++() {
+ safetyCounter++;
+ return *this;
+ }
+
+ ///Returns whether the counter is ok, but without increasing it
+ bool ok() const {
+ return safetyCounter < maxSafetyCounter;
+ }
+
+ operator bool() {
+ safetyCounter++;
+ bool ret = safetyCounter < maxSafetyCounter;
+ if( !ret ) {
+ if( safetyCounter == maxSafetyCounter ) {
+#ifdef DEPTHBACKTRACE
+ kdDebug( 9007) << "WARNING: Safety-counter reached count > " << maxSafetyCounter << ", operation stopped" << endl;
+#endif
+ kdDebug( 9007 ) << endl << kdBacktrace() << endl;
+ }
+ }
+
+ return ret;
+ }
+
+};
+
+#endif
diff --git a/languages/cpp/setuphelper.cpp b/languages/cpp/setuphelper.cpp
new file mode 100644
index 00000000..deab6135
--- /dev/null
+++ b/languages/cpp/setuphelper.cpp
@@ -0,0 +1,91 @@
+
+/***************************************************************************
+* Copyright (C) 2006 by Andras Mantia *
+* amantia@kde.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "setuphelper.h"
+#include "blockingkprocess.h"
+#include "driver.h"
+#include <kdebug.h>
+#include "ktempfile.h" /* defines [function] KTempDir */
+#include "kstandarddirs.h" /* defines [function] locateLocal */
+#include "qdir.h" /* defines QDir */
+#include <stdio.h>
+
+namespace SetupHelper {
+
+QString getGccIncludePath(bool *ok)
+{
+ *ok = true;
+ QString processStdout;
+ BlockingKProcess proc;
+ proc << "gcc" ;
+ proc << "-print-file-name=include" ;
+ if ( !proc.start(KProcess::NotifyOnExit, KProcess::Stdout) ) {
+ kdWarning(9007) << "Couldn't start gcc" << endl;
+ *ok = false;
+ return QString();
+ }
+ processStdout = proc.stdOut();
+
+ return processStdout;
+}
+
+QString getVerboseGccIncludePath(bool *ok)
+{
+ *ok = false;
+ ///Create temp file
+ KTempFile tempFile(locateLocal("tmp", "kdevelop_temp"), ".cpp");
+ tempFile.setAutoDelete(true);
+ if( tempFile.status() != 0 )
+ return QString();//Failed to create temp file
+
+ QString path = tempFile.name();
+ QFileInfo pathInfo( path );
+
+ char fileText[] = "//This source-file is empty";
+ fwrite(fileText, strlen(fileText), 1, tempFile.fstream() );
+ tempFile.close();
+
+ BlockingKProcess proc;
+ proc.setUseShell(true);
+ proc.setWorkingDirectory(pathInfo.dir(true).path());
+ proc << "gcc -v " + pathInfo.fileName() + " 2>&1";
+ if ( !proc.start(KProcess::NotifyOnExit, KProcess::Stdout) ) {
+ kdWarning(9007) << "Couldn't start gcc" << endl;
+ *ok = false;
+ return QString();
+ }
+ *ok = true;
+ return proc.stdOut();
+}
+
+QStringList getGccMacros(bool *ok)
+{
+ *ok = true;
+ QString processStdout;
+ BlockingKProcess proc;
+ proc << "gcc";
+ proc << "-E";
+ proc << "-dM";
+ proc << "-ansi" ;
+ proc << "-";
+ if ( !proc.start(KProcess::NotifyOnExit, KProcess::Stdout) ) {
+ kdWarning(9007) << "Couldn't start gcc" << endl;
+ *ok = false;
+ return QStringList();
+ }
+ proc.closeStdin();
+ processStdout = proc.stdOut();
+ QStringList lines = QStringList::split('\n', processStdout);
+ return lines;
+}
+
+}
diff --git a/languages/cpp/setuphelper.h b/languages/cpp/setuphelper.h
new file mode 100644
index 00000000..380994b4
--- /dev/null
+++ b/languages/cpp/setuphelper.h
@@ -0,0 +1,42 @@
+
+/***************************************************************************
+* Copyright (C) 2006 by Andras Mantia *
+* amantia@kde.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef SETUPHELPER_H
+#define SETUPHELPER_H
+
+#include <qstringlist.h>
+
+/**
+ A helper methods for setting up the various Driver derivates.
+
+ @author Andras Mantia <amantia@kde.org>
+ */
+namespace SetupHelper {
+ /** Get the include paths returned by gcc.
+ * @param ok false if there was a problem running gcc
+ */
+ QString getGccIncludePath(bool *ok);
+
+ /** Get the include-path return by gcc -v
+ * this path includes the path from the environment,
+ * the c++-include-path, etc., and of couse it also includes the above path.
+ * @param ok false if there was a problem running gcc
+ * */
+ QString getVerboseGccIncludePath(bool* ok);
+
+ /** Get the predefined macros returned by gcc
+ * @param ok false if there was a problem running gcc
+ */
+ QStringList getGccMacros(bool *ok);
+};
+
+#endif
diff --git a/languages/cpp/simplecontext.cpp b/languages/cpp/simplecontext.cpp
new file mode 100644
index 00000000..08af929d
--- /dev/null
+++ b/languages/cpp/simplecontext.cpp
@@ -0,0 +1,68 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "simplecontext.h"
+#include "safetycounter.h"
+
+SimpleType getGlobal( SimpleType t ) {
+ SimpleType global = t;
+ SafetyCounter s( 50 );
+ while( !global.scope().isEmpty() && s ) {
+ if( !s ) { kdDebug( 9007 ) << "error" << endl; break; }
+ global = global->parent();
+ }
+ if( !global.scope().isEmpty() ) {kdDebug( 9007 ) << "ERROR WITH GLOBAL SCOPE" << endl; return SimpleType(); }
+ return global;
+}
+
+void SimpleContext::offset( int lineOffset, int colOffset ) {
+ for( QValueList<SimpleVariable>::iterator it = m_vars.begin(); it != m_vars.end(); ++it ) {
+ if( (*it).endLine != (*it).startLine || (*it).endCol != (*it).startCol) {
+ if( (*it).startLine == 0 ) {
+ (*it).startCol += colOffset;
+ }
+ if( (*it).endLine == 0 ) {
+ (*it).endCol += colOffset;
+ }
+ (*it).startLine += lineOffset;
+ (*it).endLine += lineOffset;
+ }
+ }
+}
+
+SimpleVariable SimpleContext::findVariable( const QString& varname )
+{
+ SimpleContext * ctx = this;
+ while ( ctx )
+ {
+ const QValueList<SimpleVariable>& vars = ctx->vars();
+ for ( int i = vars.count() - 1; i >= 0; --i )
+ {
+ SimpleVariable v = vars[ i ];
+ if ( v.name == varname )
+ return v;
+ }
+ ctx = ctx->prev();
+ }
+ return SimpleVariable();
+}
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simplecontext.h b/languages/cpp/simplecontext.h
new file mode 100644
index 00000000..310d4f4d
--- /dev/null
+++ b/languages/cpp/simplecontext.h
@@ -0,0 +1,171 @@
+/***************************************************************************
+ begin : Sat Jul 21 2001
+ copyright : (C) 2001 by Victor R�er
+ email : victor_roeder@gmx.de
+ copyright : (C) 2002,2003 by Roberto Raggi
+ email : roberto@kdevelop.org
+ copyright : (C) 2005 by Adam Treat
+ email : manyoso@yahoo.com
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 SIMPLECONTEXT_H
+#define SIMPLECONTEXT_H
+
+#include <qvaluelist.h>
+#include <qstringlist.h>
+
+#include "declarationinfo.h"
+#include "typedesc.h"
+#include "simpletype.h"
+
+extern SimpleType getGlobal(SimpleType t);
+
+class SimpleVariable
+{
+public:
+ SimpleVariable()
+ {
+ startLine = endLine = startCol = endCol = 0;
+ }
+
+ SimpleVariable( const SimpleVariable& source )
+ : name( source.name ),
+ comment(source.comment),
+ startLine(source.startLine),
+ startCol(source.startCol),
+ endLine(source.endLine),
+ endCol(source.endCol),
+ type( source.type ),
+ ptrList( source.ptrList )
+ {}
+ ~SimpleVariable()
+ {}
+
+ SimpleVariable& operator = ( SimpleVariable& source )
+ {
+ name = source.name;
+ type = source.type;
+ ptrList = source.ptrList;
+ comment = source.comment;
+ startLine = source.startLine;
+ startCol = source.startCol;
+ endLine = source.endLine;
+ endCol = source.endCol;
+ return *this;
+ }
+
+ QString name;
+ QString comment;
+ int startLine, startCol;
+ int endLine, endCol;
+ TypeDesc type;
+ QStringList ptrList;
+
+ DeclarationInfo toDeclarationInfo( QString activeFileName ) {
+ DeclarationInfo decl;
+ decl.name = name;
+ decl.file = activeFileName;
+ decl.comment = comment;
+ decl.startLine = startLine;decl.startCol = startCol;
+ decl.endLine = endLine; decl.endCol = endCol;
+ return decl;
+ }
+};
+
+
+
+class SimpleContext
+{
+ public:
+ SimpleContext( SimpleType container = SimpleType(), SimpleContext* prev = 0 )
+ : m_prev( prev ), m_container( container )
+ {
+ (*m_container); ///Make the type physically create itself
+ }
+
+ virtual ~SimpleContext()
+ {
+ if ( m_prev )
+ {
+ delete( m_prev );
+ m_prev = 0;
+ }
+ }
+
+ SimpleContext* prev() const
+ {
+ return m_prev;
+ }
+
+ void attach( SimpleContext* ctx )
+ {
+ m_prev = ctx;
+ }
+
+ void detach()
+ {
+ m_prev = 0;
+ }
+
+ const QValueList<SimpleVariable>& vars() const
+ {
+ return m_vars;
+ }
+
+ void add( const SimpleVariable& v )
+ {
+ m_vars.append( v );
+ }
+
+ void add( const QValueList<SimpleVariable>& vars )
+ {
+ m_vars += vars;
+ }
+
+ //First the new name, aka "" for real imports, second the name to be imported
+ void addImport( const QPair<QString, QString>& import ) {
+ m_imports << import;
+ }
+
+ //Key the new name, aka "" for real imports, second the name to be imported
+ QValueList<QPair<QString, QString> > imports() {
+ return m_imports;
+ }
+
+ void offset( int lineOffset, int colOffset );
+
+ SimpleVariable findVariable( const QString& varname );
+
+ SimpleType global() {
+ return getGlobal( container() );
+ }
+
+ SimpleType& container() {
+ return m_container;
+ }
+
+ void setContainer( SimpleType cnt ) {
+ m_container = cnt;
+ (*m_container); ///make the type physically create itself
+ }
+
+ private:
+ QValueList<SimpleVariable> m_vars;
+ QValueList<QPair<QString, QString> > m_imports;
+ SimpleContext* m_prev;
+ SimpleType m_container;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simpletype.cpp b/languages/cpp/simpletype.cpp
new file mode 100644
index 00000000..e4334ae5
--- /dev/null
+++ b/languages/cpp/simpletype.cpp
@@ -0,0 +1,1051 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "simpletype.h"
+#include "safetycounter.h"
+#include "simpletypefunction.h"
+#include <klocale.h>
+
+QMap<QString, QString> BuiltinTypes::m_types;
+BuiltinTypes builtin; //Needed so BuiltinTypes::BuiltinTypes is called and the types are initialized
+
+BuiltinTypes::BuiltinTypes() {
+ m_types[ "void" ] = i18n( "typeless" );
+ m_types[ "bool" ] = i18n("boolean value, 1 byte, ( \"true\" or \"false\" )");
+ m_types["char" ] = i18n("signed/unsigned character, 1 byte");
+ m_types["signed char" ] = i18n("signed character, 1 byte, ranged -128 to 127");
+ m_types["unsigned char"] = i18n("unsigned character, 1 byte, ranged 0 to 255");
+ m_types["wchar_t"] = i18n("wide character, 2 bytes, ranged 0 to 65.535");
+ m_types["long"] = m_types["long int"] = m_types["int"] = m_types["signed int"] = i18n("signed integer, 4 bytes, ranged -2.147.483.648 to 2.147.483.647");
+ m_types["unsigned"] = m_types["unsigned int"] = i18n("unsigned integer, 4 bytes, ranged 0 to 4.294.967.295");
+ m_types["short"] = m_types["short int"] = i18n("short integer, 2 bytes, ranged -32.768 to 32.768");
+ m_types["unsigned short int"] = i18n("unsigned short integer, 2 bytes, ranged 0 to 65.535");
+ m_types["float"] = i18n("floating point value, 4 bytes, ranged ca. -3,4E+38 to 3,4E+38");
+ m_types["double"] = i18n("double floating point value, 8 bytes, ranged ca. -1,8E+308 to 1,8E+308");
+ m_types["long double"] = i18n("double long floating point value, 10 bytes, ranged ca. -3,4E+4932 to 3,4E+4932");
+ m_types["size_t"] = i18n("unsigned integer, byte-count dependent on operating-system" );
+
+}
+
+bool BuiltinTypes::isBuiltin( const TypeDesc& desc ) {
+ return m_types.find( desc.name() ) != m_types.end();
+}
+
+QString BuiltinTypes::comment( const TypeDesc& desc ) {
+ QMap<QString, QString>::iterator it = m_types.find( desc.name() );
+ if( it != m_types.end() ) {
+ return *it;
+ } else {
+ return QString::null;
+ }
+}
+
+extern SafetyCounter safetyCounter;
+
+TypePointer SimpleType::m_globalNamespace;
+SimpleType::TypeStore SimpleType::m_typeStore;
+SimpleType::TypeStore SimpleType::m_destroyedStore;
+QString globalCurrentFile = "";
+
+//SimpleType implementation
+
+void SimpleType::resolve( Repository rep ) const {
+ if ( !m_resolved ) {
+ if ( m_globalNamespace ) {
+ if ( ( rep == RepoUndefined || rep == RepoBoth ) ) {
+ m_resolved = true;
+ if ( scope().isEmpty() || str().isEmpty() ) {
+ m_type = m_globalNamespace;
+ return ;
+ } else {
+ TypeDesc d( scope().join( "::" ) );
+ d.setIncludeFiles( m_includeFiles );
+ LocateResult t = m_globalNamespace->locateDecType( d );
+ if ( t && t->resolved() ) {
+ m_type = t->resolved();
+ return ;
+ } else {
+ ifVerbose( dbg() << "\"" << scope().join( "::" ) << "\": The type could not be located in the global scope while resolving it" << endl );
+ }
+ }
+ }
+ } else {
+ ifVerbose( dbg() << "warning: no global namespace defined! " << endl );
+ }
+
+ TypePointer cm;
+
+ if ( rep == RepoUndefined || rep == RepoCodeModel ) {
+ if ( !m_type ) {
+ cm = TypePointer( new SimpleTypeCachedCodeModel( scope() ) );
+ } else {
+ cm = TypePointer( new SimpleTypeCachedCodeModel( &( *m_type ) ) );
+ }
+
+ if ( cm->hasNode() || rep == RepoCodeModel ) {
+ if ( cm->hasNode() ) {
+ ifVerbose( dbg() << "resolved \"" << str() << "\" from the code-model" << endl );
+ if ( cm->isNamespace() && rep != RepoCodeModel ) {
+ ifVerbose( dbg() << "\"" << str() << "\": is namespace, resolving proxy" << endl );
+ resolve( RepoBoth );
+ return ;
+ }
+ } else {
+ ifVerbose( dbg() << "forced \"" << str() << "\" to be resolved from code-model" << endl );
+ }
+ m_type = cm;
+ m_resolved = true;
+ return ;
+ }
+ }
+ if ( rep == RepoUndefined || rep == RepoCatalog ) {
+
+ if ( !m_type ) {
+ cm = TypePointer( new SimpleTypeCachedCatalog( scope() ) );
+ } else {
+ cm = TypePointer( new SimpleTypeCachedCatalog( &( *m_type ) ) );
+ }
+
+ if ( cm->hasNode() || rep == RepoCatalog ) {
+ if ( cm->hasNode() ) {
+ ifVerbose( dbg() << "resolved \"" << str() << "\" from the catalog" << endl );
+ if ( cm->isNamespace() && rep != RepoCatalog ) {
+ ifVerbose( dbg() << "\"" << str() << "\": is namespace, resolving proxy" << endl );
+ resolve( RepoBoth );
+ return ;
+ }
+ } else {
+ ifVerbose( dbg() << "forced \"" << str() << "\" to be resolved from catalog" << endl );
+ }
+ m_type = cm;
+ m_resolved = true;
+ return ;
+ }
+ }
+
+ if ( rep == RepoBoth ) {
+ cm = new SimpleTypeCachedNamespace( scope() );
+ m_type = cm;
+ m_resolved = true;
+ return ;
+ }
+
+ m_resolved = true;
+ ifVerbose( dbg() << "could not resolve \"" << m_type->desc().fullNameChain() << "\"" << endl );
+ }
+}
+
+void SimpleType::destroyStore() {
+ resetGlobalNamespace();
+ int cnt = m_typeStore.size();
+ kdDebug( 9007 ) << cnt << "types in type-store before destruction" << endl;
+
+ SafetyCounter s( 30000 );
+ while ( !m_typeStore.empty() && s ) {
+ TypeStore::iterator it = m_typeStore.begin();
+ TypePointer tp = *it;
+ m_destroyedStore.insert( tp );
+ m_typeStore.erase( it );
+ tp->breakReferences();
+ }
+
+ if ( !m_destroyedStore.empty() ) {
+ kdDebug( 9007 ) << "type-store is not empty, " << m_destroyedStore.size() << " types are left over" << endl;
+ for ( TypeStore::iterator it = m_destroyedStore.begin(); it != m_destroyedStore.end(); ++it ) {
+ kdDebug( 9007 ) << "type left: " << ( *it ) ->describe() << endl;
+ }
+ }
+
+ ///move them over so they will be cleared again next time, hoping that they will vanish
+ m_typeStore = m_destroyedStore;
+ m_destroyedStore.clear();
+}
+
+///This does not necessarily make the TypeDesc's private, so before editing them
+///their makePrivate must be called too
+void SimpleType::makePrivate() {
+ m_type = m_type->clone();
+}
+
+const QStringList& SimpleType::scope() const {
+ return m_type -> scope();
+}
+
+const QString SimpleType::str() const {
+ return m_type -> str();
+}
+
+void SimpleType::init( const QStringList& scope, const HashedStringSet& files, Repository rep ) {
+ m_includeFiles = files;
+
+ m_type = TypePointer( new SimpleTypeImpl( scope ) );
+ if ( rep != RepoUndefined )
+ resolve( rep );
+}
+
+SimpleType::SimpleType( ItemDom item ) : m_resolved( true ) {
+ m_type = TypePointer( new SimpleTypeCachedCodeModel( item ) );
+}
+/*
+SimpleType::SimpleType( Tag tag ) : m_resolved(true) {
+ m_type = TypePointer( new SimpleTypeCatalog( tag ) );
+}*/
+//
+//SimpleTypeImpl implementation
+
+QValueList<LocateResult> SimpleTypeImpl::getBases() {
+QValueList<LocateResult> ret;
+ QStringList bases = getBaseStrings();
+ for( QStringList::const_iterator it = bases.begin(); it != bases.end(); ++it ) {
+ TypeDesc d( *it );
+ d.setIncludeFiles( m_findIncludeFiles );
+ LocateResult res = locateDecType( d, LocateBase );
+ //if( res )
+ ret << res;
+ }
+ return ret;
+}
+
+void SimpleTypeImpl::setFindIncludeFiles( const IncludeFiles& files ) {
+ m_findIncludeFiles = files;
+}
+
+IncludeFiles SimpleTypeImpl::getFindIncludeFiles() {
+ return m_findIncludeFiles;
+}
+
+/**
+Searches for a member called "name", considering all types selected through "typ"*/
+SimpleTypeImpl::TypeOfResult SimpleTypeImpl::typeOf( const TypeDesc& name, MemberInfo::MemberType typ ) {
+ Debug d( "#to#" );
+ if ( !d ) {
+ ifVerbose( dbg() << "stopping typeOf-evaluation because the recursion-depth is too high" << endl );
+ return TypeOfResult( LocateResult( TypeDesc( "CompletionError::too_much_recursion" ) ) );
+ }
+ ifVerbose( dbg() << "\"" << str() << "\"------------>: searching for type of member \"" << name.fullNameChain() << "\"" << endl );
+
+ TypeDesc td = resolveTemplateParams( name );
+
+ MemberInfo mem = findMember( td, typ );
+
+ if ( mem ) {
+ mem.type = resolveTemplateParams( mem.type );
+
+ ifVerbose( dbg() << "\"" << str() << "\": found member " << name.fullNameChain() << ", type: " << mem.type->fullNameChain() << endl );
+ if ( mem.memberType == MemberInfo::Function ) {
+ ///For functions, find all functions with the same name, so that overloaded functions can be identified correctly
+ TypePointer ret = mem.build();
+ if ( ret && ret->asFunction() ) {
+ return TypeOfResult( LocateResult( ret->desc() ) );
+ } else {
+ ifVerbose( dbg() << "error, using old function-type-evaluation" << endl );
+
+ TypeDesc d( mem.type );
+ if( m_findIncludeFiles.size() != 0 )
+ d.setIncludeFiles( m_findIncludeFiles );
+ else
+ d.setIncludeFiles( name.includeFiles() );
+
+ return TypeOfResult( locateDecType( d ), mem.decl );
+ }
+ } else if ( mem.memberType == MemberInfo::Variable ) {
+ TypeDesc d( mem.type );
+ if( m_findIncludeFiles.size() != 0 )
+ d.setIncludeFiles( m_findIncludeFiles );
+ else
+ d.setIncludeFiles( name.includeFiles() );
+
+ return TypeOfResult( locateDecType( d ), mem.decl );
+ } else {
+ ifVerbose( dbg() << "while searching for the type of \"" << name.fullNameChain() << "\" in \"" << str() << "\": member has wrong type: \"" << mem.memberTypeToString() << "\"" << endl );
+ return TypeOfResult();
+ }
+ }
+
+ TypeOfResult ret = searchBases( td );
+ if ( !ret ) {
+ ifVerbose( dbg() << "\"" << str() << "\"------------>: failed to resolve the type of member \"" << name.fullNameChain() << "\"" << endl );
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\"------------>: successfully resolved the type of the member \"" << name.fullNameChain() << "\"" << endl );
+ }
+ return ret;
+}
+
+SimpleTypeFunctionInterface* SimpleTypeImpl::asFunction() {
+ return dynamic_cast<SimpleTypeFunctionInterface*> ( this );
+}
+
+QString SimpleTypeImpl::operatorToString( Operator op ) {
+ switch ( op ) {
+ case NoOp:
+ return "NoOp";
+ case IndexOp:
+ return "index-operator";
+ case ArrowOp:
+ return "arrow-operator";
+ case StarOp:
+ return "star-operator";
+ case AddrOp:
+ return "address-operator";
+ case ParenOp:
+ return "paren-operator";
+ default:
+ return QString( "%1" ).arg( ( long ) op );
+ };
+}
+
+LocateResult SimpleTypeImpl::getFunctionReturnType( QString functionName, QValueList<LocateResult> params ) {
+ LocateResult t = typeOf( functionName, MemberInfo::Function ).type;
+ if ( t->resolved() && t->resolved() ->asFunction() ) {
+ return t->resolved() ->applyOperator( ParenOp, params );
+ } else {
+ ifVerbose( dbg() << "error : could not find function \"" << functionName << "\" in \"" << str() << "\"" << endl );
+ return LocateResult();
+ }
+}
+
+LocateResult SimpleTypeImpl::applyOperator( Operator op , QValueList<LocateResult> params ) {
+ Debug d( "#applyn#" );
+ if ( !d || !safetyCounter )
+ return LocateResult();
+
+ ifVerbose( dbg() << "applying operator " << operatorToString( op ) << " to \"" << desc().fullNameChain() << "\"" << endl );
+ LocateResult ret;
+ if ( op == NoOp )
+ return LocateResult( desc() );
+
+ switch ( op ) {
+ case IndexOp:
+ return getFunctionReturnType( "operator [ ]", params );
+ break;
+ case StarOp:
+ return getFunctionReturnType( "operator *", params );
+ break;
+ case ArrowOp:
+ /** Dereference one more because the type must be a pointer */
+ ret = getFunctionReturnType( "operator ->", params );
+ if ( ret->totalPointerDepth() ) {
+ ret->setTotalPointerDepth( ret->totalPointerDepth() - 1 );
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\": " << " \"operator ->\" returns a type with the wrong pointer-depth" << endl );
+ }
+ return ret;
+ break;
+ case ParenOp:
+ /** Dereference one more because the type must be a pointer */
+ return getFunctionReturnType( "operator ( )", params );
+ default:
+ ifVerbose( dbg() << "wrong operator\n" );
+ }
+
+ return LocateResult();
+}
+
+TypeDesc SimpleTypeImpl::replaceTemplateParams( TypeDesc desc, TemplateParamInfo& paramInfo ) {
+ Debug d( "#repl#" );
+ if ( !d || !safetyCounter )
+ return desc;
+
+ TypeDesc ret = desc;
+ if ( !ret.hasTemplateParams() && !ret.next() ) {
+ TemplateParamInfo::TemplateParam t;
+ if ( paramInfo.getParam( t, desc.name() ) ) {
+
+ if ( t.value )
+ ret = t.value;
+ else if ( t.def )
+ ret = t.def;
+
+ if ( ret.name() != desc.name() )
+ ret.setTotalPointerDepth( ret.totalPointerDepth() + desc.totalPointerDepth() );
+ }
+ } else {
+ TypeDesc::TemplateParams& params = ret.templateParams();
+ for ( TypeDesc::TemplateParams::iterator it = params.begin(); it != params.end(); ++it ) {
+ *it = new TypeDescShared( replaceTemplateParams( **it, paramInfo ) );
+ }
+ }
+
+ if ( ret.next() ) {
+ ret.setNext( new TypeDescShared( replaceTemplateParams( *ret.next(), paramInfo ) ) );
+ }
+
+ return ret;
+}
+
+TypeDesc SimpleTypeImpl::resolveTemplateParams( LocateResult desc, LocateMode mode ) {
+ Debug d( "#resd#" );
+ if ( !d || !safetyCounter )
+ return desc;
+
+ LocateResult ret = desc;
+ if ( ret->hasTemplateParams() ) {
+ TypeDesc::TemplateParams & params = ret->templateParams();
+ for ( TypeDesc::TemplateParams::iterator it = params.begin(); it != params.end(); ++it ) {
+ if ( !( *it ) ->resolved() && !( *it ) ->hasFlag( ResolutionTried ) ) {
+ TypeDesc d( **it );
+ if( d.includeFiles().size() == 0 )
+ d.setIncludeFiles( this->getFindIncludeFiles() );
+ *it = locateDecType( d, mode );
+ ( *it ) ->setFlag( ResolutionTried );
+ }
+ }
+ }
+
+ if ( ret->next() ) {
+ ret->setNext( new TypeDescShared( resolveTemplateParams( *ret->next(), mode ) ) );
+ }
+
+ return ret;
+}
+
+class TemplateParamMatch {
+ public:
+ TemplateParamMatch() : m_matched( false ), m_maxDepth( 0 ), m_candidate( 0 ) {}
+
+ TemplateParamMatch( TypePointer candidate, const TypeDesc& params ) : m_matched( false ), m_maxDepth( 0 ), m_candidate( candidate ) {
+ m_candidateParams = candidate->getTemplateParamInfo();
+ TypeDesc specialization( candidate->specialization() );
+
+ TypeDesc cleanParams = params;
+ cleanParams.setName( "" );
+
+ m_matched = matchParameters( specialization, cleanParams );
+
+ if( m_matched ) {
+ //Make sure that all template-parameters were found
+ for( int a = 0; a < m_candidateParams.count(); a++ ) {
+ SimpleTypeImpl::TemplateParamInfo::TemplateParam t;
+ if( m_candidateParams.getParam( t, a ) ) {
+ if( !m_hadParameters.contains( t.name ) ) {
+ m_matched = false;
+ }
+ } else {
+ m_matched = false;
+ }
+ }
+ }
+ }
+
+ ///@todo: use all default-parameters if some are missing
+ ///@todo: also use decoration like "const" or "&" for specialization.
+ bool matchParameters( const TypeDesc& specialization, const LocateResult& params, int depth = 0 ) {
+ if( depth > m_maxDepth ) m_maxDepth = depth;
+
+ if( specialization.name().isEmpty() ) {
+ if( specialization.templateParams().count() != params->templateParams().count() )
+ return false;
+ } else {
+ SimpleTypeImpl::TemplateParamInfo::TemplateParam t;
+ if( m_candidateParams.getParam( t, specialization.name() ) ) {
+ TypeDesc oldValue = t.value;
+
+ //Check if the decoration of the specialization matches the decoration of the arguments, if not we have a mismatch.
+
+ if( specialization.totalPointerDepth() > params->totalPointerDepth() ) {
+ return false; //The decoration does not match the given argument
+ } else {
+ depth += specialization.totalPointerDepth();
+ if( depth > m_maxDepth ) m_maxDepth = depth;
+ }
+
+ //Fill the template-parameter, or compare if the one we already found out matches this one
+ LocateResult val;
+ if( specialization.hasTemplateParams() ) {
+ val = params->decoratedName();
+ } else {
+ val = params; //No more parameters have to be checked, so take the value and return later
+ }
+
+ val->setTotalPointerDepth( val->totalPointerDepth() - specialization.totalPointerDepth() );
+
+ t.value = val;
+
+ if( m_hadParameters.contains( t.name ) && oldValue != t.value ) {
+ return false; ///We have a mismatch, two different values for the same template-parameter.
+ } else {
+ m_candidateParams.addParam( t );
+ m_hadParameters[ t.name ] = val;
+ if( !specialization.hasTemplateParams() ) return true;
+ }
+ } else {
+ if( m_candidate->locateDecType( specialization.decoratedName() )->decoratedName() != params->decoratedName() ) {
+ //We have a mismatch
+ return false;
+ }
+ }
+ }
+
+
+ if( specialization.templateParams().count() != params->templateParams().count() ) {
+ return false; //mismatch in count of template-parameters
+ }
+
+ TypeDesc::TemplateParams::const_iterator specialIt = specialization.templateParams().begin();
+ TypeDesc::TemplateParams::const_iterator paramsIt = params->templateParams().begin();
+
+ while( specialIt != specialization.templateParams().end() && paramsIt != params->templateParams().end() ) {
+ if( !matchParameters( (*specialIt).desc(), (*paramsIt), depth+10 ) ) return false;
+
+ ++paramsIt;
+ ++specialIt;
+ }
+ return true;
+ }
+
+ operator bool() const {
+ return m_matched;
+ }
+
+ ///True if this match is better than the given one
+ bool operator > ( const TemplateParamMatch& rhs ) const {
+ if( !m_matched ) return false;
+ if(!rhs.m_matched ) return true;
+ return m_maxDepth > rhs.m_maxDepth;
+ }
+
+ TypePointer type() {
+ if( m_candidate ) {
+ TypePointer ret = m_candidate->clone();
+ ret->descForEdit().templateParams().clear();
+ for( int a = 0; a < m_candidateParams.count(); a++ ) {
+ SimpleTypeImpl::TemplateParamInfo::TemplateParam tp;
+ if( m_candidateParams.getParam( tp, a ) ) {
+ ret->descForEdit().templateParams().push_back( m_hadParameters[tp.name] );
+ } else {
+ ret->descForEdit().templateParams().push_back( LocateResult() ); //error
+ }
+ }
+ return ret;
+ } else {
+ return 0;
+ }
+ }
+
+ SimpleTypeImpl::TemplateParamInfo& templateParams() {
+ return m_candidateParams;
+ }
+
+ private:
+ TypePointer m_candidate;
+ SimpleTypeImpl::TemplateParamInfo m_candidateParams;
+ QMap<QString, LocateResult> m_hadParameters;
+ bool m_matched;
+ int m_maxDepth;
+};
+
+void SimpleTypeImpl::chooseSpecialization( MemberInfo& member ) {
+
+ if ( member.memberType != MemberInfo::NestedType )
+ return ;
+ if ( !member.type->hasTemplateParams() )
+ return ;
+
+ TypePointer type = member.build();
+
+ if ( !type )
+ return ;
+
+ //Get a list of all candidate-classes
+ TypePointer t = this;
+ if ( m_masterProxy )
+ t = m_masterProxy;
+
+ QValueList<TypePointer> classes = t->getMemberClasses( type->desc() );
+
+ //Find the specialization that fits the given template-parameters the best
+
+ if ( !type->specialization().isEmpty() ) {
+ kdDebug( 9007 ) << "a specialized template-class was suggested as primary class while searching for specialization, search problematic" << endl;
+ //return;
+ } else {
+ TemplateParamInfo params = type->getTemplateParamInfo();
+
+ int dif = params.count() - member.type->templateParams().count();
+
+ if ( dif > 0 ) {
+ //fill up missing template-parameters with their default-parameters, maybe should be done in findMember
+ for ( int a = member.type->templateParams().count(); a < params.count(); a++ ) {
+ LocateResult r;
+ TemplateParamInfo::TemplateParam tp;
+ if ( params.getParam( tp, a ) ) {
+ r = t->locateDecType( tp.value );
+ }
+ member.type->templateParams().push_back( r );
+ }
+ }
+ }
+
+ //now find the class that is most specialized and matches the template-parameters
+
+ TemplateParamMatch bestMatch;
+
+ for ( QValueList<TypePointer>::iterator it = classes.begin(); it != classes.end(); ++it ) {
+ if ( ( *it ) ->specialization().isEmpty() )
+ continue;
+ TemplateParamMatch match( ( *it ), member.type.desc() );
+
+ if ( match > bestMatch )
+ bestMatch = match;
+ }
+
+ if ( bestMatch ) {
+ TypePointer tp = bestMatch.type();
+ if ( tp ) {
+ member.setBuilt( tp );
+ }
+ }
+}
+
+
+LocateResult SimpleTypeImpl::locateType( TypeDesc name , LocateMode mode , int dir , MemberInfo::MemberType typeMask ) {
+ Debug d( "#lo#" );
+ if( BuiltinTypes::isBuiltin( name ) )
+ return name;
+
+ if ( !name || !safetyCounter || !d ) {
+ return desc();
+ }
+ if ( !d ) {
+ ifVerbose( dbg() << "stopping location because the recursion-depth is too high" << endl );
+ return TypeDesc( "CompletionError::too_much_recursion" );
+ }
+ ifVerbose( dbg() << "\(" << uint(this) << ")\"" << str() << "\": locating type \"" << name.fullNameChain() << "\"" << endl );
+ if ( name.resolved() && !name.next() ) {
+ ifVerbose( dbg() << "\"" << desc().fullName() << "\": type \"" << name.fullNameChain() << "\" is already resolved, returning stored instance" << endl );
+ return name;
+ }
+ /*
+ if( name.resolved() && name.length() == name.resolved()->desc().length() ) {
+ ifVerbose( dbg() << "\"" << desc().fullName() << "\": type \"" << name.fullNameChain() << "\" is already resolved, returning stored instance" << endl;
+ SimpleType ret = SimpleType( name.resolved() );
+
+ if( ! (name == ret->desc()) ) {
+ ret.makePrivate(); ///Maybe some small parameters like the pointer-depth were changed, so customize those
+ ret->parseParams( name );
+ }
+
+ return ret;
+ }*/
+ /*
+ //This optimization is now disabled, because it allows following a wrong path.
+ if( name.next() ) {
+ //This is an optimization for better use of the cache: Find the elements separately, so searches
+ //For elements that start with the same scope will be speeded up.
+ LocateResult r = locateType( name.firstType(), mode, dir, typeMask );
+ if( r && r->resolved() && r.locateMode().valid ) {
+ ifVerbose( dbg() << "splitting location" );
+ TypeDesc d( *name.next() );
+ d.setIncludeFiles( name.includeFiles() );
+ return r->resolved()->locateType( d, (LocateMode)r.locateMode().mode, r.locateMode().dir );
+ }
+ }*/
+
+ LocateResult ret = name; ///In case the type cannot be located, this helps to find at least the best match
+ //LocateResult ret;
+
+ TypeDesc first = resolveTemplateParams( name.firstType(), mode );
+
+ MemberInfo mem = findMember( first, typeMask );
+
+ switch ( mem.memberType ) {
+ case MemberInfo::Namespace:
+ if ( mode & ExcludeNamespaces )
+ break;
+ case MemberInfo::NestedType: {
+ if ( mem.memberType == MemberInfo::NestedType && mode & ExcludeNestedTypes )
+ break;
+
+ SimpleType sub;
+ if ( TypePointer t = mem.build() ) {
+ sub = SimpleType( t );
+#ifdef PHYSICAL_IMPORT
+ setSlaveParent( *sub );
+#endif
+ } else {
+ ///Should not happen..
+ kdDebug( 9007 ) << "\"" << str() << "\": Warning: the nested-type " << name.name() << " was found, but has no build-info" << endl;
+ return TypeDesc( "CompletionError::unknown" );
+ }
+
+ TypeDesc rest;
+ LocateMode newMode = addFlag( mode, ExcludeTemplates );
+ int newDir = 1;
+ if ( name.next() ) {
+ ifVerbose( dbg() << "\"" << str() << "\": found nested type \"" << name.name() << "\", passing control to it\n" );
+ ret = sub->locateType( resolveTemplateParams( *name.next(), Normal ), newMode, newDir ); ///since template-names cannot be referenced from outside, exclude them for the first cycle
+ ret.increaseResolutionCount();
+ if ( ret->resolved() )
+ return ret.resetDepth();
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\": successfully located searched type \"" << name.fullNameChain() << "\"\n" );
+ ret->setResolved( sub.get() );
+ ret->resolved()->setFindIncludeFiles( name.includeFiles() );
+ ret.locateMode().valid = true;
+ ret.locateMode().mode = (uint)newMode;
+ ret.locateMode().dir = newDir;
+ return ret.resetDepth();
+ }
+ break;
+ }
+ case MemberInfo::Typedef:
+ if ( mode & ExcludeTypedefs )
+ break;
+ case MemberInfo::Template: {
+ if ( mem.memberType == MemberInfo::Template && ( mode & ExcludeTemplates ) )
+ break;
+ ifVerbose( dbg() << "\"" << str() << "\": found " << mem.memberTypeToString() << " \"" << name.name() << "\" -> \"" << mem.type->fullNameChain() << "\", recursing \n" );
+ if ( name.hasTemplateParams() ) {
+ ifVerbose( dbg() << "\"" << str() << "\":warning: \"" << name.fullName() << "\" is a " << mem.memberTypeToString() << ", but it has template-params itself! Not matching" << endl );
+ } else {
+ if ( mem.type->name() != name.name() ) {
+
+ MemberInfo m = mem;
+ if ( name.next() ) {
+ mem.type->makePrivate();
+ mem.type->append( name.next() );
+ }
+ ret = locateDecType( mem.type, remFlag( mode, ExcludeTemplates ) );
+
+ if ( mem.memberType == MemberInfo::Template )
+ ret.addResolutionFlag( HadTemplate );
+ if ( mem.memberType == MemberInfo::Typedef )
+ ret.addResolutionFlag( HadTypedef );
+ ret.increaseResolutionCount();
+ // if( mode & TraceAliases && ret->resolved() )
+ {
+ m.name = "";
+
+ if ( !scope().isEmpty() ) {
+ m.name = fullTypeUnresolvedWithScope() + "::";
+ }
+ m.name += name.nameWithParams();
+ //m.name += name.fullNameChain();
+
+ if ( name.next() ) {
+ if ( m.type.trace() ) {
+ ret.trace() ->prepend( *m.type.trace(), 1 );
+ }
+ ret.trace() ->prepend( m, *name.next() );
+ } else {
+ if ( m.type.trace() )
+ ret.trace() ->prepend( *m.type.trace(), 1 );
+ ret.trace() ->prepend( m );
+ }
+ }
+
+ if ( ret->resolved() )
+ return ret.resetDepth();
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\"recursive typedef/template found: \"" << name.fullNameChain() << "\" -> \"" << mem.type->fullNameChain() << "\"" << endl );
+ }
+ }
+ break;
+ }
+ ///A Function is treated similar to a type
+ case MemberInfo::Function: {
+ if ( !name.next() ) {
+ TypePointer t = mem.build();
+ if ( t ) {
+ return t->desc();
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\"" << ": could not build function: \"" << name.fullNameChain() << "\"" );
+ }
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\"" << ": name-conflict: searched for \"" << name.fullNameChain() << "\" and found function \"" << mem.name << "\"" );
+ }
+ break;
+ };
+ ///Currently there is no representation of a Variable as a SimpleType, so only the type of the variable is used.
+ case MemberInfo::Variable: {
+ return locateDecType( mem.type, remFlag( mode, ExcludeTemplates ) ).resetDepth();
+ }
+ }
+
+ ///Ask bases but only on this level
+ if ( ! ( mode & ExcludeBases ) ) {
+
+ QValueList<LocateResult> bases = getBases();
+ if ( !bases.isEmpty() ) {
+ TypeDesc nameInBase = resolveTemplateParams( name, LocateBase ); ///Resolve all template-params that are at least visible in the scope of the base-declaration
+
+ for ( QValueList<LocateResult>::iterator it = bases.begin(); it != bases.end(); ++it ) {
+ if ( !( *it ) ->resolved() )
+ continue;
+ LocateResult t = ( *it ) ->resolved() ->locateType( nameInBase, addFlag( addFlag( mode, ExcludeTemplates ), ExcludeParents ), dir ); ///The searched Type cannot directly be a template-param in the base-class, so ExcludeTemplates. It's forgotten early enough.
+ if ( t->resolved() )
+ return t.increaseDepth();
+ else
+ if ( t > ret )
+ ret = t.increaseDepth();
+ }
+ }
+ }
+
+ ///Ask parentsc
+ if ( !scope().isEmpty() && dir != 1 && ! ( mode & ExcludeParents ) ) {
+ LocateResult rett = parent() ->locateType( resolveTemplateParams( name, mode & ExcludeBases ? ExcludeBases : mode ), mode & ForgetModeUpwards ? Normal : mode );
+ if ( rett->resolved() )
+ return rett.increaseDepth();
+ else
+ if ( rett > ret )
+ ret = rett.increaseDepth();
+ }
+
+ ///Ask the bases and allow them to search in their parents.
+ if ( ! ( mode & ExcludeBases ) ) {
+ TypeDesc baseName = resolveTemplateParams( name, LocateBase ); ///Resolve all template-params that are at least visible in the scope of the base-declaration
+ QValueList<LocateResult> bases = getBases();
+ if ( !bases.isEmpty() ) {
+ for ( QValueList<LocateResult>::iterator it = bases.begin(); it != bases.end(); ++it ) {
+ if ( !( *it ) ->resolved() )
+ continue;
+ LocateResult t = ( *it ) ->resolved() ->locateType( baseName, addFlag( mode, ExcludeTemplates ), dir ); ///The searched Type cannot directly be a template-param in the base-class, so ExcludeTemplates. It's forgotten early enough.
+ if ( t->resolved() )
+ return t.increaseDepth();
+ else
+ if ( t > ret )
+ ret = t.increaseDepth();
+ }
+ }
+ }
+
+ ///Give the type a desc, so the nearest point to the searched type is stored
+ ifVerbose( dbg() << "\"" << str() << "\": search for \"" << name.fullNameChain() << "\" FAILED" << endl );
+ return ret;
+}
+
+void SimpleTypeImpl::breakReferences() {
+ TypePointer p( this ); ///necessary so this type is not deleted in between
+ m_parent = 0;
+ m_desc.resetResolved();
+ // m_trace.clear();
+ m_masterProxy = 0;
+ invalidateCache();
+}
+
+TypePointer SimpleTypeImpl::bigContainer() {
+ if ( m_masterProxy )
+ return m_masterProxy;
+ else
+ return TypePointer( this );
+}
+
+SimpleType SimpleTypeImpl::parent() {
+ if ( m_parent ) {
+ //ifVerbose( dbg() << "\"" << str() << "\": returning parent" << endl;
+ return SimpleType( m_parent );
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\": locating parent" << endl );
+ invalidateSecondaryCache();
+ QStringList sc = scope();
+
+ if ( !sc.isEmpty() ) {
+ sc.pop_back();
+ SimpleType r = SimpleType( sc, m_desc.includeFiles() );
+ if ( &( *r.get() ) == this ) {
+ kdDebug( 9007 ) << "error: self set as parent: " << m_scope.join( "::" ) << "(" << m_scope.count() << ")" << ", " << sc.join( "::" ) << "(" << sc.count() << ")" /* << kdBacktrace()*/ << endl;
+ return SimpleType( new SimpleTypeImpl( "" ) );
+ }
+ m_parent = r.get();
+ return r;
+ } else {
+ ifVerbose( dbg() << "\"" << str() << "\"warning: returning parent of global scope!" << endl );
+ return SimpleType( new SimpleTypeImpl( "" ) );
+ }
+ }
+}
+
+const TypeDesc& SimpleTypeImpl::desc() {
+ if ( m_desc.name().isEmpty() )
+ m_desc.setName( cutTemplateParams( scope().back() ) );
+ m_desc.setResolved( this );
+ return m_desc;
+}
+
+TypeDesc& SimpleTypeImpl::descForEdit() {
+ desc();
+ invalidateCache();
+ return m_desc;
+}
+
+QString SimpleTypeImpl::describeWithParams() {
+ TemplateParamInfo pinfo = getTemplateParamInfo();
+ int num = 0;
+ TemplateParamInfo::TemplateParam param;
+ QString str = desc().name();
+ if ( desc().hasTemplateParams() ) {
+ str += "< ";
+
+ for ( TypeDesc::TemplateParams::const_iterator it = desc().templateParams().begin(); it != desc().templateParams().end(); ++it ) {
+ if ( pinfo.getParam( param, num ) && !param.name.isEmpty() )
+ str += param.name;
+ else
+ str += "[unknown name]";
+
+ str += " = " + ( *it ) ->fullNameChain() + ", ";
+ ++num;
+ }
+
+ str.truncate( str.length() - 2 );
+ str += " >";
+ }
+ return str;
+}
+
+QString SimpleTypeImpl::fullTypeResolved( int depth ) {
+ Debug d( "#tre#" );
+
+ TypeDesc t = desc();
+ if ( !scope().isEmpty() ) {
+ if ( depth > 10 )
+ return "KDevParseError::ToDeep";
+ if ( !safetyCounter )
+ return "KDevParseError::MaximumCountReached";
+
+ ifVerbose( dbg() << "fully resolving type " << t.fullName() << endl );
+ if ( scope().size() != 0 ) {
+ t = resolveTemplateParams( t, LocateBase );
+ }
+ }
+
+ return t.fullNameChain();
+}
+
+
+QString SimpleTypeImpl::fullTypeUnresolvedWithScope( ) {
+ if ( m_parent && !m_parent->scope().isEmpty() ) {
+ return m_parent->fullTypeUnresolvedWithScope() + "::" + m_desc.fullNameChain();
+ } else {
+ return m_desc.fullNameChain();
+ }
+}
+
+QString SimpleTypeImpl::fullTypeResolvedWithScope( int depth ) {
+ Q_UNUSED( depth );
+ if ( !m_scope.isEmpty() && parent() ) {
+ return parent() ->fullTypeResolvedWithScope() + "::" + fullTypeResolved();
+ } else {
+ return fullTypeResolved();
+ }
+}
+
+void SimpleTypeImpl::checkTemplateParams () {
+ invalidateCache();
+ if ( ! m_scope.isEmpty() ) {
+ QString str = m_scope.back();
+ m_desc = str;
+ if ( !m_desc.name().isEmpty() ) {
+ m_scope.pop_back();
+ m_scope << m_desc.name();
+ } else {
+ kdDebug() << "checkTemplateParams() produced bad scope-tail: \"" << m_desc.name() << "\", \"" << m_scope.join( "::" ) << "\"" << endl;
+ }
+ }
+}
+
+void SimpleTypeImpl::setScope( const QStringList& scope ) {
+ invalidateCache();
+ m_scope = scope;
+ if ( m_scope.count() == 1 && m_scope.front().isEmpty() ) {
+ //kdDebug() << "bad scope set " << kdBacktrace() << endl;
+ m_scope = QStringList();
+ }
+}
+
+SimpleTypeImpl::TypeOfResult SimpleTypeImpl::searchBases ( const TypeDesc& name /*option!!*/ ) {
+ QValueList<LocateResult> parents = getBases();
+ for ( QValueList<LocateResult>::iterator it = parents.begin(); it != parents.end(); ++it ) {
+ if ( !( *it ) ->resolved() )
+ continue;
+ TypeOfResult type = ( *it ) ->resolved() ->typeOf( name );
+ if ( type )
+ return type;
+ }
+ return TypeOfResult();
+}
+
+void SimpleTypeImpl::setSlaveParent( SimpleTypeImpl& slave ) {
+ if ( ! m_masterProxy ) {
+ slave.setParent( this );
+ } else {
+ slave.setParent( m_masterProxy );
+ }
+}
+
+void SimpleTypeImpl::parseParams( TypeDesc desc ) {
+ invalidateCache();
+ m_desc = desc;
+ m_desc.clearInstanceInfo();
+}
+
+void SimpleTypeImpl::takeTemplateParams( TypeDesc desc ) {
+ invalidateCache();
+ m_desc.templateParams() = desc.templateParams();
+}
+
+//SimpleTypeImpl::TemplateParamInfo implementation
+
+bool SimpleTypeImpl::TemplateParamInfo::getParam( TemplateParam& target, QString name ) const {
+ QMap<QString, TemplateParam>::const_iterator it = m_paramsByName.find( name );
+ if ( it != m_paramsByName.end() ) {
+ target = *it;
+ return true;
+ }
+ return false;
+}
+
+bool SimpleTypeImpl::TemplateParamInfo::getParam( TemplateParam& target, int number ) const {
+ QMap<int, TemplateParam>::const_iterator it = m_paramsByNumber.find( number );
+ if ( it != m_paramsByNumber.end() ) {
+ target = *it;
+ return true;
+ }
+ return false;
+}
+
+void SimpleTypeImpl::TemplateParamInfo::removeParam( int number ) {
+ QMap<int, TemplateParam>::iterator it = m_paramsByNumber.find( number );
+ if ( it != m_paramsByNumber.end() ) {
+ m_paramsByName.remove( ( *it ).name );
+ m_paramsByNumber.remove( it );
+ }
+}
+
+void SimpleTypeImpl::TemplateParamInfo::addParam( const TemplateParam& param ) {
+ m_paramsByNumber[ param.number ] = param;
+ m_paramsByName[ param.name ] = param;
+}
+
+int SimpleTypeImpl::TemplateParamInfo::count() const {
+ QMap<int, TemplateParam>::const_iterator it = m_paramsByNumber.end();
+ if ( it != m_paramsByNumber.begin() ) {
+ --it;
+ return ( *it ).number + 1;
+ } else {
+ return 0;
+ }
+}
+
+void SimpleTypeConfiguration::setGlobalNamespace( TypePointer globalNamespace ) {
+ if ( !globalNamespace->scope().isEmpty() ) {
+ kdDebug( 9007 ) << "error while setting global scope\n" << kdBacktrace() << endl;
+ SimpleType::setGlobalNamespace( new SimpleTypeImpl( "" ) );
+ } else {
+ SimpleType::setGlobalNamespace( globalNamespace );
+ }
+}
+
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/simpletype.h b/languages/cpp/simpletype.h
new file mode 100644
index 00000000..3e6f82d3
--- /dev/null
+++ b/languages/cpp/simpletype.h
@@ -0,0 +1,819 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __SIMPLETYPE_H__
+#define __SIMPLETYPE_H__
+
+#include <set>
+
+#include "bithelpers.h"
+#include "stringhelpers.h"
+#include "completiondebug.h"
+#include "typedesc.h"
+#include "declarationinfo.h"
+#include <qpair.h>
+
+#include "cpp_tags.h"
+#include "codemodel.h"
+
+#define NOBACKTRACE
+
+extern QString globalCurrentFile;
+
+using namespace CompletionDebug;
+using namespace BitHelpers;
+using namespace StringHelpers;
+
+class SimpleTypeImpl;
+class SimpleTypeNamespace;
+class SimpleTypeFunctionInterface;
+
+typedef KSharedPtr<SimpleTypeImpl> TypePointer;
+
+///if this is set, imported items will get their parent set to the node they were acquired through(which may increase the overall count of items, decrease the caching-performance, and may create other problems in locating stuff)
+//#define PHYSICAL_IMPORT
+
+enum Repository {
+ RepoCodeModel,
+ RepoCatalog,
+ RepoStringList,
+ RepoBoth,
+ RepoUndefined
+};
+
+class BuiltinTypes {
+ public:
+ ///This should be used for checking whether a type is builtin
+ static bool isBuiltin( const TypeDesc& desc );
+ ///If it is a builtin type this returns a short description of the type
+ static QString comment( const TypeDesc& desc );
+ BuiltinTypes();
+ private:
+ static QMap<QString, QString> m_types;
+};
+
+
+/**
+ A Type can be invalid( hasNode() returns false ) but still have a desc. In that case, the desc is the
+ nearest point reached in the resolution of the type.
+
+ Warning: The types are not copied when they are assigned to each other,
+ they manage internal references, so just changing a type may cause bugs.
+ Use makePrivate() before changing. */
+
+class SimpleType {
+ public:
+
+ friend class SimpleTypeImpl;
+
+ SimpleType( const SimpleType& rhs ) {
+ *this = rhs;
+ }
+
+ SimpleType( const QStringList& scope, const HashedStringSet& files, Repository rep = RepoUndefined ) : m_resolved( false ) {
+ init( scope, files, rep );
+ }
+
+ SimpleType( const QString& text,const HashedStringSet& files, Repository rep = RepoUndefined ) : m_resolved( false ) {
+ init( splitType( text ), files, rep );
+ };
+
+ SimpleType( Repository rep = RepoUndefined ) : m_resolved( false ) {
+ init( QStringList(), HashedStringSet(), rep );
+ };
+
+ SimpleType( SimpleTypeImpl* ip ) : m_type( TypePointer( ip ) ), m_resolved( true ) {}
+
+ SimpleType( ItemDom item );
+
+ bool operator < ( SimpleType& rhs );
+
+ /*SimpleType( Tag tag );*/
+
+ SimpleTypeImpl* operator -> () const {
+ resolve();
+ return &( *m_type );
+ }
+
+ TypePointer get
+ () const {
+ resolve();
+ return m_type;
+ }
+
+ SimpleTypeImpl& operator * () const {
+ resolve();
+ return *m_type;
+ }
+
+ SimpleType& operator = ( const SimpleType& rhs ) {
+ m_type = rhs.m_type;
+ m_resolved = rhs.m_resolved;
+ m_includeFiles = rhs.m_includeFiles;
+ return *this;
+ }
+
+ /** Just compares the scope */
+ bool operator == ( const SimpleType& rhs ) const {
+ return scope() == rhs.scope();
+ }
+
+ void makePrivate();
+
+ operator QString() const {
+ return str();
+ }
+
+ ///lazily returns the scope
+ const QStringList& scope() const;
+
+ const QString str() const;
+
+ ///valid() does not check whether the type was found in some model,
+ ///it just checks whether this theoretically represents a type.
+ inline operator bool () const {
+ return valid();
+ }
+
+ bool valid() const {
+ return !scope().isEmpty();
+ }
+
+ static TypePointer globalNamespace() {
+ return m_globalNamespace;
+ }
+
+ static void setGlobalNamespace( TypePointer tp ) {
+ m_globalNamespace = tp;
+ }
+
+ static void resetGlobalNamespace() {
+ m_globalNamespace = 0;
+ }
+
+ ///Since many cross-references are possible, this function breaks them all so that all SimpleTypeImpls can free themselves.
+ static void destroyStore();
+
+ private:
+
+ void init( const QStringList& scope, const HashedStringSet& files, Repository rep );
+
+ void resolve( Repository rep = RepoUndefined ) const ;
+
+ HashedStringSet m_includeFiles;
+
+ mutable TypePointer m_type;
+ mutable bool m_resolved;
+ static TypePointer m_globalNamespace; ///this is bad, but with the current parser we can't clearly determine the correct global-namespace for each class/file
+ typedef std::set
+ <SimpleTypeImpl*> TypeStore ;
+ static TypeStore m_typeStore; ///This is necessary because TypeDescs ind SimpleTypeImpls can have cross-references, and thereby make themselves unreleasable, so each SimpleTypeImpl is stored in this list and destroyed at once by SimpleTypeConfiguration( it breaks all references )
+ static TypeStore m_destroyedStore;
+
+ static void registerType( SimpleTypeImpl* tp ) {
+ if ( !tp )
+ return ;
+ m_typeStore.insert( tp );
+ }
+
+ static void unregisterType( SimpleTypeImpl* tp ) {
+ TypeStore::iterator it = m_typeStore.find( tp );
+ if ( it != m_typeStore.end() )
+ m_typeStore.erase( it );
+ else
+ m_destroyedStore.erase( tp );
+ }
+};
+
+
+class SimpleTypeConfiguration {
+ bool m_invalid;
+ public:
+ SimpleTypeConfiguration( QString currentFileName = "" ) : m_invalid( false ) {
+ globalCurrentFile = currentFileName;
+ dbgState.clearCounter();
+ }
+
+ void setGlobalNamespace( TypePointer globalNamespace );
+
+ virtual ~SimpleTypeConfiguration() {
+ if( !m_invalid ) {
+ SimpleType::resetGlobalNamespace();
+ SimpleType::destroyStore();
+ }
+ }
+ void invalidate() {
+ m_invalid = true;
+ }
+};
+
+
+class SimpleTypeImpl : public KShared {
+ /*enum ResolutionFlags {
+ NoFlag = 0,
+ HadTypedef = 1,
+ HadTemplate = 2,
+ HadAlias = 3
+ };*/
+
+ public:
+ typedef KSharedPtr<SimpleTypeImpl> TypePointer;
+
+ SimpleTypeImpl( const QStringList& scope ) : m_resolutionCount( 0 ), m_resolutionFlags( NoFlag ), m_scope( scope ) {
+ setScope( m_scope );
+ checkTemplateParams();
+ reg();
+ }
+
+ SimpleTypeImpl( const TypeDesc& desc ) : m_resolutionCount( 0 ), m_resolutionFlags( NoFlag ), m_desc( desc ) {
+ if ( !m_desc.name().isEmpty() )
+ m_scope.push_back( m_desc.name() );
+ else
+ m_scope.push_back( "BAD_NAME" );
+ reg();
+ }
+
+ SimpleTypeImpl( ) : m_resolutionCount( 0 ), m_resolutionFlags( NoFlag ) {
+ reg();
+ };
+
+ ///Returns the template-specialization-string for classes
+ virtual QString specialization() const {
+ return QString::null;
+ }
+
+ class TemplateParamInfo {
+ public:
+ struct TemplateParam {
+ QString name;
+ TypeDesc def;
+ TypeDesc value;
+ int number;
+ TemplateParam() : number( 0 ) {}
+ }
+ ;
+
+ TemplateParamInfo( ) {}
+
+ bool getParam( TemplateParam& target, QString name ) const;
+
+ bool getParam( TemplateParam& target, int number ) const;
+
+ void removeParam( int number );
+
+ void addParam( const TemplateParam& param );
+
+ int count() const;
+
+ private:
+ QMap<int, TemplateParam> m_paramsByNumber;
+ QMap<QString, TemplateParam> m_paramsByName;
+ };
+
+ int resolutionCount() {
+ return m_resolutionCount;
+ }
+
+ bool hasResolutionFlag( ResolutionFlags flag ) {
+ return m_resolutionFlags & flag;
+ }
+
+ enum Operator {
+ ArrowOp,
+ StarOp,
+ AddrOp,
+ IndexOp,
+ ParenOp,
+ NoOp
+ };
+
+ static CppCodeCompletion* data;
+ TypePointer m_masterProxy; ///If this is only a slave of a namespace-proxy, this holds the proxy.
+
+ virtual ~SimpleTypeImpl() {
+ unreg();
+ }
+
+ virtual Repository rep() {
+ return RepoStringList;
+ }
+
+ ///Returns the function-interface if this is a function, else zero
+ SimpleTypeFunctionInterface* asFunction();
+
+ virtual bool isNamespace() const {
+ return false;
+ };
+
+ virtual QString comment() const {
+ return "";
+ };
+
+
+ ///Sets the parent of the given slave to either this class, or the proxy of this class
+ virtual void setSlaveParent( SimpleTypeImpl& slave );
+
+ void setMasterProxy( TypePointer t ) {
+ m_masterProxy = t;
+ }
+
+ TypePointer masterProxy() const {
+ return m_masterProxy;
+ }
+
+ ///@todo remove this and use getTemplateParamInfo instead
+ virtual const LocateResult findTemplateParam( const QString& /*name*/ ) {
+ return LocateResult();
+ }
+
+ virtual TemplateParamInfo getTemplateParamInfo() {
+ return TemplateParamInfo();
+ }
+
+ virtual void parseParams( TypeDesc desc );
+
+ virtual void takeTemplateParams( TypeDesc desc );
+
+ ///Returns whether the type is really resolved( corresponds to an item in some model )
+ virtual bool hasNode() const {
+ return false;
+ };
+
+ virtual DeclarationInfo getDeclarationInfo() {
+ return DeclarationInfo();
+ }
+
+ virtual TypePointer clone() {
+ return new SimpleTypeImpl( this );
+ }
+
+ private:
+ int m_resolutionCount;
+ ResolutionFlags m_resolutionFlags;
+
+ SimpleTypeImpl( const SimpleTypeImpl& /*rhs*/ ) : KShared() {}
+
+ SimpleTypeImpl& operator = ( const SimpleTypeImpl& /*rhs*/ ) {
+ return * this;
+ }
+
+
+ void addResolutionFlag ( ResolutionFlags flag ) {
+ m_resolutionFlags = ( ResolutionFlags ) ( m_resolutionFlags | flag );
+ }
+
+ void removeResolutionFlag( ResolutionFlags flag ) {
+ m_resolutionFlags = remFlag( m_resolutionFlags, flag );
+ }
+
+ void increaseResolutionCount() {
+ ++m_resolutionCount;
+ }
+
+ void setResolutionCount( int val ) {
+ m_resolutionCount = val;
+ }
+#ifndef NOBACKTRACE
+ QString create_bt;
+#endif
+
+ inline QString createInfo() const {
+#ifndef NOBACKTRACE
+ return "\n" + create_bt + "\n";
+#endif
+
+ return "";
+ }
+
+ void reg() {
+#ifndef NOBACKTRACE
+ create_bt = kdBacktrace();
+#endif
+
+ SimpleType::registerType( this );
+ }
+
+ void unreg() {
+ SimpleType::unregisterType( this );
+ }
+
+ protected:
+ virtual void invalidateCache() {}
+ ;
+
+ ///Secondary cache also depends on the surrounding
+ virtual void invalidateSecondaryCache() {}
+
+ virtual void setSecondaryCacheActive( bool active ) {
+ Q_UNUSED( active );
+ }
+
+ ///Primary cache is the one associated only with this object. It must only be cleared
+ ///when the object pointed to changes
+ virtual void invalidatePrimaryCache( bool onlyNegative = false ) {}
+
+ static QString operatorToString( Operator op );
+
+ public:
+ /*
+ operator QString() const {
+ return str();
+ }
+
+ inline operator QStringList() const {
+ return m_scope;
+ }*/
+
+ int functionDepth() const {
+ return m_desc.pointerDepth();
+ }
+
+ void setFunctionDepth( int pc ) {
+ m_desc.setPointerDepth( pc );
+ }
+
+ void decreaseFunctionDepth() {
+ m_desc.setPointerDepth( m_desc.pointerDepth() - 1 );
+ }
+
+ int pointerDepth() const {
+ return m_desc.pointerDepth();
+ }
+
+ void setPointerDepth( int pc ) {
+ m_desc.setPointerDepth( pc );
+ }
+
+
+ ///returns the scope(including own name) as string
+ QString str() const {
+ if ( m_scope.isEmpty() )
+ return "";
+ return m_scope.join( "::" );
+ }
+
+ ///returns the scope(including own name) as string-list
+ inline const QStringList& scope() const {
+ return m_scope;
+ }
+
+ ///Returns the scope including template-specialization
+ QStringList specializedScope() const {
+ QStringList ts = m_scope;
+ if( !ts.isEmpty() ) {
+ QString s = ts.back() + specialization();
+ ts.pop_back();
+ ts.push_back( s );
+ }
+ return ts;
+ }
+
+ ///sets the parent-type(type this one is nested in)
+ void setParent( TypePointer parent ) {
+ if( parent == m_parent ) return;
+ invalidateSecondaryCache();
+ if ( &( *parent ) == this ) {
+ kdDebug( 9007 ) << "setSlaveParent error\n" << kdBacktrace() << endl;
+ return ;
+ }
+
+ m_parent = parent;
+ }
+
+ ///returns whether the type has template-parameters, or one of the parent-types has template-parameters.
+ bool usingTemplates() const {
+ return !m_desc.templateParams().isEmpty() || ( m_parent && m_parent->usingTemplates() );
+ }
+
+ ///This function should add aliases as well as namespace-imports into the given namespace
+ virtual void addAliasesTo( SimpleTypeNamespace* ns ) {
+ }
+
+ ///An abstract class for building types lazily
+ struct TypeBuildInfo : public KShared {
+ TypePointer buildCached() {
+ if ( m_cache )
+ return m_cache;
+ else {
+ m_cache = build();
+ return m_cache;
+ }
+ }
+
+ void setCache( const TypePointer& type ) {
+ m_cache = type;
+ }
+
+ virtual TypePointer build() = 0;
+
+ virtual ~TypeBuildInfo() {}
+
+ TypeBuildInfo() {}
+ private:
+
+ TypePointer m_cache;
+
+ TypeBuildInfo& operator =( const TypeBuildInfo& rhs ) {
+ Q_UNUSED( rhs );
+ return *this;
+ }
+ TypeBuildInfo( const TypeBuildInfo& rhs ) : KShared() {
+ Q_UNUSED( rhs );
+ }
+ };
+
+ ///A class that stores information about a member of some SimpleType
+ class MemberInfo {
+ KSharedPtr<TypeBuildInfo> m_build;
+ public:
+
+ enum MemberType {
+ NotFound = 0,
+ Function = 1,
+ Variable = 2,
+ Typedef = 4,
+ Template = 8,
+ NestedType = 16,
+ Namespace = 32,
+ AllTypes = 0xffffffff
+ } memberType;
+
+ MemberInfo() {
+ memberType = NotFound;
+ }
+
+ QString memberTypeToString() {
+ switch ( memberType ) {
+ case Namespace:
+ return "namespace";
+ case Function:
+ return "function";
+ case Variable:
+ return "variable";
+ case NotFound:
+ return "not found";
+ case Typedef:
+ return "typedef";
+ case Template:
+ return "template-parameter";
+ case NestedType:
+ return "nested-type";
+ default:
+ return "unknown";
+ };
+ }
+
+ typedef KSharedPtr<SimpleTypeImpl> TypePointer;
+
+ void setBuildInfo( KSharedPtr<TypeBuildInfo> build ) {
+ m_build = build;
+ }
+
+ void setBuilt( const TypePointer& item ) {
+ m_built = item;
+ }
+
+ TypePointer build() {
+ if( m_built ) return m_built;
+ if ( !m_build ) {
+ return TypePointer();
+ } else {
+ m_built = m_build->buildCached();
+ return m_built;
+ }
+ }
+
+ operator bool() const {
+ return memberType != NotFound;
+ }
+
+ QString name;
+ LocateResult type;
+
+ ///This member is only filles for variables, typedefs and template-params!
+ DeclarationInfo decl;
+ private:
+ TypePointer m_built;
+ };
+
+
+ enum LocateMode {
+ Normal = 1,
+ ExcludeTemplates = 2,
+ ExcludeTypedefs = 4,
+ ExcludeBases = 8,
+ ExcludeParents = 16,
+ ExcludeNestedTypes = 32,
+ ExcludeNamespaces = 64,
+ ForgetModeUpwards = 128, ///forgets everything, even NoFail, while passing control to the parent
+ LocateBase = 4 + 8 + 32 + 64 + 128, ///searching in the scope visible while the base-declaration of a class
+ NoFail = 256,
+ TraceAliases = 512, ///Stores a copy whenever an alias is applied
+ OnlyLocalTemplates = 4 + 8 + 16 + 32 + 64 + 256,
+ OnlyTemplates = 4 + 8 + 32 + 256
+ };
+
+ ///replaces template-parameters from the given structure with their value-types
+ TypeDesc replaceTemplateParams( TypeDesc desc, TemplateParamInfo& paramInfo );
+ TypeDesc resolveTemplateParams( LocateResult desc, LocateMode mode = Normal );
+
+ //typedef ::LocateResult LocateResult;
+
+
+ /**By default templates are included while the resolution, so when the type should be addressed from
+ outside of the class, ExcludeTemplates should be set as LocateMode, since templates can not be directly accessed from the outside.
+ The resulting type's template-params may not be completely resolved, but can all be resolved locally by that type*/
+ LocateResult locateDecType( TypeDesc desc , LocateMode mode = Normal, int dir = 0 , MemberInfo::MemberType typeMask = bitInvert( addFlag( MemberInfo::Variable, MemberInfo::Function ) ) ) {
+ TypeDesc td = desc;
+ td.clearInstanceInfo();
+ LocateResult r = locateType( td, mode, dir, typeMask );
+ r.desc() = resolveTemplateParams( r.desc() );
+ r->takeInstanceInfo( desc );
+ // r.desc().setPointerDepth( r.desc().pointerDepth() + td.pointerDepth() );
+ return r;
+ }
+
+ //protected:
+
+ virtual LocateResult locateType( TypeDesc name , LocateMode mode = Normal, int dir = 0 , MemberInfo::MemberType typeMask = bitInvert( addFlag( MemberInfo::Variable, MemberInfo::Function ) ) ) ;
+
+ public:
+
+ LocateResult getFunctionReturnType( QString functionName, QValueList<LocateResult> params = QValueList<LocateResult>() );
+
+ ///Tries to apply the operator and returns the new type. If it fails, it returns an invalid type.
+ virtual LocateResult applyOperator( Operator op , QValueList<LocateResult> params = QValueList<LocateResult>() );
+
+
+ /** In case of a class, returns all base-types */
+ virtual QValueList<LocateResult> getBases();
+
+ virtual QStringList getBaseStrings() {
+ return QStringList();
+ };
+
+ ///This pair contains the found type, and additionally the member-information that helped finding the type
+ struct TypeOfResult {
+ LocateResult type;
+ DeclarationInfo decl;
+
+ TypeOfResult( LocateResult t = LocateResult(), DeclarationInfo d = DeclarationInfo() ) : type( t ), decl( d ) {}
+
+ TypeDesc* operator -> () {
+ return & type.desc();
+ }
+
+ operator TypeDesc() {
+ return type;
+ }
+
+ ///should be removed
+ operator SimpleType() {
+ if ( type->resolved() ) {
+ return SimpleType( type->resolved() );
+ } else {
+ return SimpleType();
+ }
+ }
+
+ operator bool() {
+ return ( bool ) type;
+ }
+ };
+
+ public:
+
+ virtual TypeOfResult typeOf( const TypeDesc& name, MemberInfo::MemberType typ = addFlag( MemberInfo::Function, MemberInfo::Variable ) );
+
+
+ ///From outside this should only be called for members like functions/variables etc. Classes will not have their bases resolved when acquired using this function.
+ virtual MemberInfo findMember( TypeDesc name, MemberInfo::MemberType type = ( MemberInfo::MemberType ) 0xffffffff ) {
+ Q_UNUSED( name );
+ Q_UNUSED( type );
+ MemberInfo mem;
+ mem.memberType = MemberInfo::NotFound;
+ return mem;
+ };
+
+ ///Should return all specializations of a specific class-name
+ virtual QValueList<TypePointer> findSpecializations( const QString& name ) {
+ return QValueList<TypePointer>();
+ }
+
+ /**TypeDescs and SimpleTypeImpls usually have a cross-reference, which creates a circular dependency so that they are never freed using KShared. This function breaks the loop, and also breaks all other possible dependency-loops. After this function was called, the type still contains its private information, but can not not be used to resolve anything anymore. This function is called automatically while the destruction of SimpleTypeConfiguration */
+ virtual void breakReferences();
+
+ ///Returns either itself, or the (namespace-)proxy this type is a slave of.
+ TypePointer bigContainer();
+
+ ///Returns the parent, eg. the SimpleType this one is nested in.
+ SimpleType parent();
+
+ ///this must be a reference, so the desc can be manipulated in-place from outside
+ const TypeDesc& desc();
+
+ TypeDesc& descForEdit();
+
+ ///short version
+ QString fullType() const {
+ return m_desc.fullName();
+ }
+
+ ///Similar to fullTypeResolved, except that it also shows addition information about template-params
+ QString describeWithParams() ;
+
+ ///returns all information that is available constantly
+ QString describe() const {
+ QString description = m_desc.fullName() + " (" + m_scope.join( "::" ) + ")" + createInfo();
+ return description;
+ }
+
+ ///this completely evaluates everything
+ QString fullTypeResolved( int depth = 0 );
+
+ ///this completely evaluates everything
+ QString fullTypeResolvedWithScope( int depth = 0 );
+
+
+ QString fullTypeUnresolvedWithScope();
+
+ virtual QValueList<TypePointer> getMemberClasses( const TypeDesc& name ) {
+ return QValueList<TypePointer>();
+ }
+
+ ///Returns the include-file-set used for resolving this type
+ IncludeFiles getFindIncludeFiles();
+
+ private:
+ QStringList m_scope;
+ TypePointer m_parent;
+ IncludeFiles m_findIncludeFiles; //Set of include-files used for finding this object
+
+ protected:
+ SimpleTypeImpl( SimpleTypeImpl* rhs ) : m_masterProxy( rhs->m_masterProxy ), m_resolutionCount( rhs->m_resolutionCount ), m_resolutionFlags( rhs->m_resolutionFlags ), m_scope( rhs->m_scope ), m_parent( rhs->m_parent ), m_findIncludeFiles( rhs->m_findIncludeFiles ), m_desc( rhs->m_desc ) {
+ reg();
+ }
+
+ TypeDesc m_desc; ///descibes the local type(so next() must be null)
+
+ /** Tries to extract template-parameters from the scope, resets the params-list */
+ virtual void checkTemplateParams ();
+
+ void setScope( const QStringList& scope );
+
+ ///Searches the item IN the bases
+ TypeOfResult searchBases ( const TypeDesc& name );
+
+ ///Used to set the include-files that were used to find this type(needed for lazy evaluation of the base-classes)
+ void setFindIncludeFiles( const IncludeFiles& files );
+
+ ///Should be called within the parent-namespace/class
+ virtual void chooseSpecialization( MemberInfo& member );
+
+};
+
+
+class TypeTrace {
+ QValueList<QPair< SimpleTypeImpl::MemberInfo, TypeDesc> > m_trace;
+ public:
+
+ QValueList<QPair< SimpleTypeImpl::MemberInfo, TypeDesc> >& trace() {
+ return m_trace;
+ };
+
+ void prepend( const SimpleTypeImpl::MemberInfo& t, const TypeDesc& tail = TypeDesc() ) {
+ m_trace.push_front( QPair< SimpleTypeImpl::MemberInfo, TypeDesc>( t, tail ) );
+ }
+
+ void prepend( const TypeTrace& trace, int indent = 0 ) {
+/* if( indent != 0 ) {
+ QString ind;
+ for( int a = 0; a < indent; a++ ) ind += " ";
+ for( QValueList<QPair< SimpleTypeImpl::MemberInfo, TypeDesc> >::const_iterator it = trace.m_trace.end(); it != trace.m_trace.begin(); ) {
+ --it;
+ QPair<SimpleTypeImpl::MemberInfo, TypeDesc> item = *it;
+ item.second.prependDecoration( ind );
+ m_trace.push_front( item );
+ }
+ } else {*/
+ m_trace = trace.m_trace + m_trace;
+/* }*/
+ }
+};
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/simpletypecachebinder.h b/languages/cpp/simpletypecachebinder.h
new file mode 100644
index 00000000..0cc5e2b0
--- /dev/null
+++ b/languages/cpp/simpletypecachebinder.h
@@ -0,0 +1,348 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __SIMPLETYPECACHEBINDER_H__
+#define __SIMPLETYPECACHEBINDER_H__
+
+#include "simpletypenamespace.h"
+
+///In case the hashing-stuff brings some regressions, it can be removed again using this switch.
+#include <ext/hash_map>
+#include <map>
+
+//#define TEST_REMAP
+
+template <class Base>
+class SimpleTypeCacheBinder : public Base {
+ public:
+
+ SimpleTypeCacheBinder( SimpleTypeCacheBinder<Base>* b ) : Base( b ), m_locateCache( b->m_locateCache ), m_memberCache( b->m_memberCache ), m_basesCache( b->m_basesCache ), secondaryActive( b->secondaryActive ), m_classListCache( b->m_classListCache ), primaryActive( b->primaryActive ), m_haveBasesCache( b->m_haveBasesCache ) {}
+
+ SimpleTypeCacheBinder() : Base(), m_haveBasesCache( false ), secondaryActive( true ), primaryActive( true ) {}
+
+ template <class InitType>
+ SimpleTypeCacheBinder( InitType t ) : Base ( t ), m_haveBasesCache( false ) , secondaryActive( true ), primaryActive( true ) {}
+
+ template <class InitType1, class InitType2>
+ SimpleTypeCacheBinder( InitType1 t, InitType2 t2 ) : Base ( t, t2 ), m_haveBasesCache( false ), secondaryActive( true ), primaryActive( true ) {}
+
+ using Base::LocateMode;
+
+ struct LocateDesc {
+ TypeDesc mname;
+ //QString fullName;
+ SimpleTypeImpl::LocateMode mmode;
+ int mdir;
+ SimpleTypeImpl::MemberInfo::MemberType mtypeMask;
+ size_t m_hashKey;
+
+ LocateDesc() {}
+
+ LocateDesc( const TypeDesc& name, SimpleTypeImpl::LocateMode mode, int dir, SimpleTypeImpl::MemberInfo::MemberType typeMask ) : mname( name ), mmode( mode ) , mdir( dir ) , mtypeMask( typeMask ), m_hashKey( name.hashKey() + 11*int(mode) + 13*dir + 17*int(typeMask) ) {
+ //fullName = mname.fullNameChain();//fullTypeStructure();
+
+ }
+
+ ///@todo this should use hashing too
+ int compare( const LocateDesc& rhs ) const {
+ if ( m_hashKey != rhs.m_hashKey ) {
+ if ( m_hashKey < rhs.m_hashKey )
+ return -1;
+ else
+ return 1;
+ }
+ if ( mname.hashKey2() != rhs.mname.hashKey2() ) {
+ if ( mname.hashKey2() < rhs.mname.hashKey2() )
+ return -1;
+ else
+ return 1;
+ }
+ if ( mmode != rhs.mmode ) {
+ if ( mmode < rhs.mmode )
+ return -1;
+ else
+ return 1;
+ }
+ if ( mdir != rhs.mdir ) {
+ if ( mdir < rhs.mdir )
+ return -1;
+ else
+ return 1;
+ }
+ if ( mtypeMask != rhs.mtypeMask ) {
+ if ( mtypeMask < rhs.mtypeMask )
+ return -1;
+ else
+ return 1;
+ }
+
+ return 0;
+ }
+
+ bool operator < ( const LocateDesc& rhs ) const {
+ return compare( rhs ) == -1;
+ }
+
+ bool operator == ( const LocateDesc& rhs ) const {
+ //return compare( rhs ) == 0;
+ if( m_hashKey == rhs.m_hashKey && mname.hashKey2() == rhs.mname.hashKey2() )
+ return mname.name() == rhs.mname.name();
+ else
+ return false;
+ }
+
+ bool operator > ( const LocateDesc& rhs ) const {
+ return compare( rhs ) == 1;
+ }
+
+ inline size_t hashKey() const {
+ return m_hashKey;
+ }
+
+ struct hash {
+ inline size_t operator () ( const LocateDesc& m ) const {
+ return m.hashKey();
+ }
+
+ };
+ };
+
+ struct MemberFindDesc {
+ TypeDesc m_desc;
+ QString fullName;
+ SimpleTypeImpl::MemberInfo::MemberType findType;
+ size_t m_hashKey; //in time check why it is necessary to cache this key
+ size_t m_hashKey2;
+
+ MemberFindDesc() : m_hashKey( 0 ) {}
+
+ MemberFindDesc( TypeDesc d, SimpleTypeImpl::MemberInfo::MemberType ft ) : m_desc( d ), findType( ft ), m_hashKey( d.hashKey() + findType ), m_hashKey2( d.hashKey2() + findType ) {
+ //m_desc.makePrivate();
+ }
+
+ int compare( const MemberFindDesc& rhs ) const {
+ if ( fullName.isEmpty() ) const_cast<MemberFindDesc*>(this)->fullName = m_desc.fullNameChain();
+ if ( rhs.fullName.isEmpty() ) const_cast<MemberFindDesc*>(&rhs)->fullName = rhs.m_desc.fullNameChain();
+ const QString& a = fullName; //m_desc.fullNameChain();
+ const QString& b = rhs.fullName; //m_desc.fullNameChain();
+ if ( a != b ) {
+ if ( a < b )
+ return -1;
+ else
+ return 1;
+ }
+ if ( findType != rhs.findType ) {
+ if ( findType < rhs.findType )
+ return -1;
+ else
+ return 1;
+ }
+
+ return 0;
+ }
+
+ bool operator < ( const MemberFindDesc& rhs ) const {
+ return compare( rhs ) == -1;
+ }
+ //#endif
+ inline size_t hashKey() const {
+ return m_hashKey;
+ }
+
+ bool operator == ( const MemberFindDesc& rhs ) const {
+ bool ret = m_hashKey2 == rhs.m_hashKey2 && findType == rhs.findType;
+ if( ret )
+ return m_desc.name() == rhs.m_desc.name(); //Just for a little more security
+ return ret;
+ }
+ /*
+ bool operator > ( const MemberFindDesc& rhs ) const {
+ return compare( rhs ) == 1;
+ }*/
+ struct hash {
+ inline size_t operator () ( const MemberFindDesc& m ) const {
+ return m.hashKey();
+ }
+ };
+ };
+
+ typedef __gnu_cxx::hash_map<LocateDesc, LocateResult, typename LocateDesc::hash > LocateMap;
+ typedef __gnu_cxx::hash_map<MemberFindDesc, SimpleTypeImpl::MemberInfo, typename MemberFindDesc::hash > MemberMap;
+ typedef __gnu_cxx::hash_map<MemberFindDesc, QValueList<TypePointer>, typename MemberFindDesc::hash > ClassListMap;
+
+ virtual SimpleTypeImpl::MemberInfo findMember( TypeDesc name, SimpleTypeImpl::MemberInfo::MemberType type ) {
+ if ( !primaryActive )
+ return Base::findMember( name, type );
+ MemberFindDesc key( name, type );
+ typename MemberMap::iterator it = m_memberCache.find( key );
+
+ if ( it != m_memberCache.end() ) {
+ ifVerbose( dbg() << "\"" << Base::str() << "\" took member-info for \"" << name.fullNameChain() << "\" from the cache: " << (*it).second.name << endl );
+ return (*it).second;
+ } else {
+ SimpleTypeImpl::MemberInfo mem;
+
+ m_memberCache.insert( std::make_pair( key, mem ) ); //This is done to prevent expensive endless recursion
+
+ mem = Base::findMember( name, type );
+
+ std::pair< typename MemberMap::iterator, bool > r = m_memberCache.insert( std::make_pair( key, mem ) );
+ if ( !r.second ) {
+ (*r.first).second = mem;
+ }
+
+#ifdef TEST_REMAP
+ typename MemberMap::iterator it = m_memberCache.find( key );
+ if ( it == m_memberCache.end() ) dbgMajor() << "\"" << Base::str() << "\"remap failed with \"" << name.fullNameChain() << "\"" << endl;
+#endif
+
+ return mem;
+ }
+ }
+
+ virtual QValueList<TypePointer> getMemberClasses( const TypeDesc& name ) {
+ if ( !primaryActive )
+ return Base::getMemberClasses( name );
+ MemberFindDesc key( name, Base::MemberInfo::NestedType );
+ typename ClassListMap::iterator it = m_classListCache.find( key );
+
+ if ( it != m_classListCache.end() ) {
+ /*ifVerbose( dbg() << "\"" << Base::str() << "\" took member-info for \"" << name.fullNameChain() << "\" from the cache: " << (*it).second. << endl );*/
+ return (*it).second;
+ } else {
+ QValueList<TypePointer> mem;
+
+ m_classListCache.insert( std::make_pair( key, mem ) );
+
+ mem = Base::getMemberClasses( name );
+ std::pair<typename ClassListMap::iterator, bool> r = m_classListCache.insert( std::make_pair( key, mem ) );
+ if ( !r.second )
+ (*r.first).second = mem;
+
+#ifdef TEST_REMAP
+ typename ClassListMap::iterator it = m_classListCache.find( key );
+ if ( it == m_classListCache.end() ) dbgMajor() << "\"" << Base::str() << "\"remap failed with \"" << name.fullNameChain() << "\"" << endl;
+#endif
+
+ return mem;
+ }
+ }
+
+ virtual LocateResult locateType( TypeDesc name , SimpleTypeImpl::LocateMode mode, int dir, SimpleTypeImpl::MemberInfo::MemberType typeMask ) {
+
+ if ( !secondaryActive )
+ return Base::locateType( name, mode, dir, typeMask );
+ LocateDesc desc( name, mode, dir, typeMask );
+
+ typename LocateMap::iterator it = m_locateCache.find( desc );
+
+ if ( it != m_locateCache.end() ) {
+ Debug d( "#lo#" );
+ ifVerbose( dbg() << "\"" << Base::str() << "\" located \"" << name.fullNameChain() << "\" from the cache" << endl );
+ return (*it).second;
+ } else {
+ LocateResult t;
+ m_locateCache.insert( std::make_pair( desc, t ) ); //Done to prevent expensive recursion.
+ t = Base::locateType( name, mode, dir, typeMask );
+ std::pair< typename LocateMap::iterator, bool > r = m_locateCache.insert( std::make_pair( desc, t ) );
+ if ( !r.second )
+ (*r.first).second = t;
+
+#ifdef TEST_REMAP
+ typename LocateMap::iterator it = m_locateCache.find( desc );
+ if ( it == m_locateCache.end() ) dbgMajor() << "\"" << Base::str() << "\"remap failed with \"" << name.fullNameChain() << "\"" << endl;
+#endif
+ return t;
+ }
+ }
+
+ virtual QValueList<LocateResult> getBases() {
+ ///@todo this needs a lookup for different includeFiles..
+ if ( m_haveBasesCache ) {
+ ifVerbose( dbg() << "\"" << Base::str() << "\" took base-info from the cache" << endl );
+ return m_basesCache;
+ } else {
+ m_basesCache = Base::getBases();
+ m_haveBasesCache = true;
+ return m_basesCache;
+ }
+ }
+
+ private:
+ LocateMap m_locateCache;
+ MemberMap m_memberCache;
+ ClassListMap m_classListCache;
+ QValueList<LocateResult> m_basesCache;
+ bool m_haveBasesCache;
+ bool secondaryActive, primaryActive;
+
+ protected:
+
+ virtual typename Base::TypePointer clone() {
+ return new SimpleTypeCacheBinder<Base>( this );
+ }
+
+ virtual void invalidatePrimaryCache( bool onlyNegative ) {
+ //if( !m_memberCache.isEmpty() ) dbg() << "\"" << Base::str() << "\" primary caches cleared" << endl;
+ if ( !onlyNegative)
+ m_memberCache.clear();
+ else {
+ for ( typename MemberMap::iterator it = m_memberCache.begin(); it != m_memberCache.end(); ) {
+ if ( (*it).second.memberType == SimpleTypeImpl::MemberInfo::NotFound )
+ m_memberCache.erase( it++ );
+ else
+ ++it;
+ }
+ }
+ m_classListCache.clear();
+ }
+ virtual void invalidateSecondaryCache() {
+ //if( !m_locateCache.isEmpty() ) dbg() << "\"" << Base::str() << "\" secondary caches cleared" << endl;
+ m_locateCache.clear();
+ m_haveBasesCache = false;
+ m_basesCache.clear();
+ }
+
+ virtual void setSecondaryCacheActive( bool active ) {
+ secondaryActive = active;
+ }
+
+ virtual void setPrimaryCacheActive( bool active ) {
+ primaryActive = active;
+ }
+
+ virtual void invalidateCache() {
+ invalidatePrimaryCache( false );
+ invalidateSecondaryCache();
+ };
+ };
+
+
+//typedef SimpleTypeCacheBinder<SimpleTypeImpl> SimpleTypeImpl;
+
+ class SimpleTypeCodeModel;
+ class SimpleTypeCatalog;
+ class SimpleTypeNamespace;
+ class SimpleTypeCodeModelFunction;
+ class SimpleTypeCatalogFunction;
+
+ typedef SimpleTypeCacheBinder<SimpleTypeCodeModel> SimpleTypeCachedCodeModel;
+ typedef SimpleTypeCacheBinder<SimpleTypeCatalog> SimpleTypeCachedCatalog;
+ typedef SimpleTypeCacheBinder<SimpleTypeNamespace> SimpleTypeCachedNamespace;
+ typedef SimpleTypeCacheBinder<SimpleTypeCodeModelFunction> SimpleTypeCachedCodeModelFunction;
+ typedef SimpleTypeCacheBinder<SimpleTypeCatalogFunction> SimpleTypeCachedCatalogFunction;
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simpletypecatalog.cpp b/languages/cpp/simpletypecatalog.cpp
new file mode 100644
index 00000000..2b02cd9e
--- /dev/null
+++ b/languages/cpp/simpletypecatalog.cpp
@@ -0,0 +1,375 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "simpletypecatalog.h"
+#include "simpletypefunction.h"
+#include "safetycounter.h"
+
+extern SafetyCounter safetyCounter;
+extern CppCodeCompletion* cppCompletionInstance;
+
+//SimpleTypeCatalog implementation
+
+TypePointer SimpleTypeCatalog::clone() {
+ return new SimpleTypeCachedCatalog( this );
+}
+
+QString SimpleTypeCatalog::specialization() const {
+ return m_tag.getSpecializationDeclaration();
+}
+
+void SimpleTypeCatalog::addAliasesTo( SimpleTypeNamespace* ns ) {
+ if ( m_tag.kind() != Tag::Kind_Namespace ) return;
+ QValueList<Catalog::QueryArgument> args;
+
+///Insert all namespace-imports
+ args << Catalog::QueryArgument( "scope", specializedScope() );
+ args << Catalog::QueryArgument( "kind", Tag::Kind_UsingDirective );
+
+ QValueList<Tag> tags( cppCompletionInstance->m_repository->query( args ) );
+
+ for ( QValueList<Tag>::iterator it = tags.begin(); it != tags.end(); ++it ) {
+ TypeDesc d( (*it).name() );
+ d.setIncludeFiles( HashedString((*it).fileName()) ); ///@todo implement the include-file-logic
+ ns->addAliasMap( TypeDesc(), d, HashedString((*it).fileName()), true, false, bigContainer() );
+ }
+///Insert all namespace-aliases
+ args.clear();
+ args << Catalog::QueryArgument( "scope", specializedScope() );
+ args << Catalog::QueryArgument( "kind", Tag::Kind_NamespaceAlias );
+
+ tags = cppCompletionInstance->m_repository->query( args );
+
+ for ( QValueList<Tag>::iterator it = tags.begin(); it != tags.end(); ++it ) {
+ QVariant v = (*it).attribute( "alias" );
+ if ( v.type() == QVariant::String ) {
+ TypeDesc d( v.asString() );
+ d.setIncludeFiles( HashedString((*it).fileName()) );
+ ns->addAliasMap( (*it).name(), d, HashedString((*it).fileName()), true, false, bigContainer() );
+ } else
+ kdDebug( 9007 ) << "namespace-alias has no alias-text" << endl;
+ }
+}
+
+QValueList<TypePointer> SimpleTypeCatalog::getMemberClasses( const TypeDesc& name ) {
+ QValueList<TypePointer> ret;
+
+ QValueList<Catalog::QueryArgument> args;
+
+ args << Catalog::QueryArgument( "scope", specializedScope() );
+ args << Catalog::QueryArgument( "name", name.name() );
+
+ QValueList<Tag> tags( cppCompletionInstance->m_repository->query( args ) );
+
+ for ( QValueList<Tag>::iterator it = tags.begin(); it != tags.end(); ++it ) {
+ if ( (*it).kind() == Tag::Kind_Class ) {
+ ///It would be better to return all matched class-names from within findMember and use them from there so all this will be cached too.
+ CatalogBuildInfo b( *it, name, TypePointer( this ) );
+ TypePointer t = b.buildCached();
+ if ( t ) ret << t;
+ }
+ }
+
+ return ret;
+}
+
+SimpleTypeImpl::MemberInfo SimpleTypeCatalog::findMember( TypeDesc name, SimpleTypeImpl::MemberInfo::MemberType type ) {
+ MemberInfo ret;
+ ret.name = name.name();
+ ret.memberType = MemberInfo::NotFound;
+ if ( !name ) return ret;
+
+ if ( ( type & MemberInfo::Template) ) {
+ LocateResult s = findTemplateParam( name.name() );
+ if ( s ) {
+ ret.memberType = MemberInfo::Template;
+ ret.type = s;
+ ret.decl.name = name.name();
+ ret.decl.file = m_tag.fileName();
+ m_tag.getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ m_tag.getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ }
+ }
+
+ QValueList<Catalog::QueryArgument> args;
+
+ args << Catalog::QueryArgument( "scope", specializedScope() );
+ args << Catalog::QueryArgument( "name", name.name() );
+
+ QValueList<Tag> tags( cppCompletionInstance->m_repository->query( args ) );
+
+ if ( tags.isEmpty() ) return ret;
+
+///skip all using-directives
+ QValueList<Tag>::iterator it = tags.begin();
+ while ( ( (*it).kind() == Tag::Kind_UsingDirective || (*it).kind() == Tag::Kind_NamespaceAlias ) && it != tags.end() )
+ ++it;
+
+ if ( it == tags.end() ) return ret;
+
+ Tag tag = *it;
+
+ if ( tag.kind() == Tag::Kind_Variable && (type & MemberInfo::Variable) ) {
+ ret.memberType = MemberInfo::Variable;
+ ret.type = tagType( tag );
+ ret.decl.name = tag.name();
+ ret.decl.comment = tag.comment();
+ tag.getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ tag.getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ ret.decl.file = tag.fileName();
+ }
+ if ( tag.kind() == Tag::Kind_Enumerator && (type & MemberInfo::Variable) ) {
+ ret.memberType = MemberInfo::Variable;
+ if ( !tag.hasAttribute( "enum" ) ) {
+ ret.type = TypeDesc( "const int" );
+ } else {
+ ret.type = tag.attribute( "enum" ).asString();
+ if ( ret.type->name().isEmpty() )
+ ret.type = TypeDesc( "const int" );
+ }
+ ret.decl.name = tag.name();
+ ret.decl.comment = tag.comment();
+ tag.getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ tag.getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ ret.decl.file = tag.fileName();
+ } else if ( tag.kind() == Tag::Kind_Class && ( type & MemberInfo::NestedType ) ) {
+ //if( tag.hasSpecializationDeclaration() ) {
+ //Choose another tag(the main class, not a specialization).
+ bool hasSpecializationDeclaration = tag.hasSpecializationDeclaration();
+ bool isIncluded = name.includeFiles()[tag.fileName()];
+ if ( hasSpecializationDeclaration || !isIncluded ) {
+ for ( QValueList<Tag>::const_iterator it = tags.begin(); it != tags.end(); ++it ) {
+ if ( (*it).kind() == Tag::Kind_Class && !(*it).hasSpecializationDeclaration() ) {
+ if ( name.includeFiles()[(*it).fileName()] ) {
+ tag = *it;
+ isIncluded = true;
+ hasSpecializationDeclaration = false;
+ } else if ( hasSpecializationDeclaration ) {
+ tag = *it;
+ hasSpecializationDeclaration = false;
+ isIncluded = false;
+ }
+
+ if ( isIncluded && !hasSpecializationDeclaration ) break;
+ }
+ }
+ }
+ //only accept non-specialized classes
+ if ( !tag.hasSpecializationDeclaration() ) {
+ ret.setBuildInfo( new CatalogBuildInfo( tag, name, TypePointer( this ) ) );
+ ret.memberType = MemberInfo::NestedType;
+ ret.type = name;
+ }
+ } else if ( tag.kind() == Tag::Kind_Typedef && ( type & MemberInfo::Typedef ) ) {
+ ret.memberType = MemberInfo::Typedef;
+ ret.type = tagType( tag );
+ ret.decl.name = tag.name();
+ ret.decl.comment = tag.comment();
+ tag.getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ tag.getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ ret.decl.file = tag.fileName();
+ } else if ( tag.kind() == Tag::Kind_Enum && ( type & MemberInfo::Typedef ) ) {
+ ret.memberType = MemberInfo::Typedef;
+ ret.type = TypeDesc( "const int" );
+ ret.decl.name = tag.name();
+ ret.decl.comment = tag.comment();
+ tag.getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ tag.getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ ret.decl.file = tag.fileName();
+ } else if ( (tag.kind() == Tag::Kind_FunctionDeclaration || tag.kind() == Tag::Kind_Function) && ( type & MemberInfo::Function ) ) {
+ ret.memberType = MemberInfo::Function;
+ ret.type = tagType( tag );
+ ret.type->increaseFunctionDepth();
+ ret.setBuildInfo( new SimpleTypeCatalogFunction::CatalogFunctionBuildInfo( tags, name, TypePointer( this ) ) );
+ } else if ( tag.kind() == Tag::Kind_Namespace && ( type & MemberInfo::Namespace ) ) {
+ ret.setBuildInfo( new CatalogBuildInfo( tag , name, TypePointer( this ) ) );
+ ret.memberType = MemberInfo::Namespace;
+ ret.type = name;
+ }
+
+///Check if it is a template-name
+
+//if( !ret.type) ret.memberType = MemberInfo::NotFound; //constructor..
+
+ if( ret.memberType == MemberInfo::Function || ret.memberType == MemberInfo::Variable || ret.memberType == MemberInfo::Template || ret.memberType == MemberInfo::Typedef || ret.memberType == MemberInfo::NestedType ) {
+ //For redirected types it is necessary to add the include-files of the context they were searched in.
+ //That is not quite correct, but it makes sure that at least the same namespace-aliases will be activated while the search for the type.
+
+ ret.type->addIncludeFiles( name.includeFiles() );
+ }
+
+ chooseSpecialization( ret );
+ return ret;
+}
+
+Tag SimpleTypeCatalog::findSubTag( const QString& name ) {
+ if ( name.isEmpty() ) return Tag();
+
+ QValueList<Catalog::QueryArgument> args;
+ QTime t;
+
+ t.start();
+ args << Catalog::QueryArgument( "scope", specializedScope() );
+ args << Catalog::QueryArgument( "name", name );
+
+ QValueList<Tag> tags( cppCompletionInstance->m_repository->query( args ) );
+ if ( ! tags.isEmpty() ) {
+ //ifVerbose( dbg() << "findTag: \"" << str() << "\": tag \"" << name << "\" found " << endl );
+ return tags.front();
+ } else {
+ //ifVerbose( dbg() << "findTag: \"" << str() << "\": tag \"" << name << "\" not found " << endl );
+ return Tag();
+ }
+}
+
+QValueList<Tag> SimpleTypeCatalog::getBaseClassList( ) {
+ if ( scope().isEmpty() )
+ return QValueList<Tag>();
+ return cppCompletionInstance->m_repository->getBaseClassList( scope().join("::") + specialization() );
+}
+
+void SimpleTypeCatalog::initFromTag() {
+ QStringList l = m_tag.scope();
+ l << m_tag.name();
+ setScope( l );
+}
+
+void SimpleTypeCatalog::init() {
+ if ( !scope().isEmpty() ) {
+ QStringList l = scope();
+ QStringList cp = l;
+ cp.pop_back();
+ setScope( cp );
+ m_tag = findSubTag( l.back() );
+ setScope( l );
+ //initFromTag( ); ///must not be done, because it may initialize to wrong namespaces etc.
+ }
+}
+
+DeclarationInfo SimpleTypeCatalog::getDeclarationInfo() {
+ DeclarationInfo ret;
+
+ ret.name = fullTypeResolved();
+ if ( m_tag ) {
+ ret.file = m_tag.fileName();
+ m_tag.getStartPosition( &ret.startLine, &ret.startCol );
+ m_tag.getEndPosition( &ret.endLine, &ret.endCol );
+ ret.comment = m_tag.comment();
+ }
+
+ return ret;
+}
+
+QStringList SimpleTypeCatalog::getBaseStrings() {
+ Debug d( "#getbases#" );
+ if ( !d || !safetyCounter ) {
+ //ifVerbose( dbg() << "\"" << str() << "\": recursion to deep while getting bases" << endl );
+ return QStringList();
+ }
+
+ QStringList ret;
+ QMap<QString, bool> bases;
+// try with parentsc
+ QTime t;
+ t.restart();
+ QValueList<Tag> parents( getBaseClassList() );
+
+ QValueList<Tag>::Iterator it = parents.begin();
+ while ( it != parents.end() ) {
+ Tag & tag = *it;
+ ++it;
+
+ CppBaseClass<Tag> info( tag );
+
+ bases[ info.baseClass() ] = true;
+ }
+ return bases.keys();
+}
+
+SimpleTypeImpl::TemplateParamInfo SimpleTypeCatalog::getTemplateParamInfo() {
+ TemplateParamInfo ret;
+
+ if ( m_tag ) {
+ if ( m_tag.hasAttribute( "tpl" ) ) {
+ QStringList l = m_tag.attribute( "tpl" ).asStringList();
+
+ TypeDesc::TemplateParams templateParams = m_desc.templateParams();
+ uint pi = 0;
+ QStringList::const_iterator it = l.begin();
+ while ( it != l.end() ) {
+ TemplateParamInfo::TemplateParam curr;
+ curr.name = *it;
+ curr.number = pi;
+ ++pi;
+ ++it;
+ if ( it != l.end() ) {
+ curr.def = *it;
+ ++it;
+ }
+ if ( pi < templateParams.count() )
+ curr.value = *templateParams[pi];
+ ret.addParam( curr );
+ };
+ }
+ }
+
+ return ret;
+}
+
+const LocateResult SimpleTypeCatalog::findTemplateParam( const QString& name ) {
+ if ( m_tag ) {
+ if ( m_tag.hasAttribute( "tpl" ) ) {
+ QStringList l = m_tag.attribute( "tpl" ).asStringList();
+ ///we need the index, so count the items through
+ uint pi = 0;
+
+ QStringList::const_iterator it = l.begin();
+ while ( it != l.end() && *it != name ) {
+ ++pi;
+ ++it;
+ if ( it != l.end() ) ++it;
+ };
+
+ TypeDesc::TemplateParams templateParams = m_desc.templateParams();
+
+ if ( it != l.end() && pi < templateParams.count() ) {
+ return *templateParams[pi];
+ } else {
+ if ( it != l.end() && *it == name && !(*it).isEmpty()) {
+ ++it;
+ if ( it != l.end() && !(*it).isEmpty() ) {
+ ifVerbose( dbg() << "using default-template-type " << *it << " for " << name << endl );
+ return TypeDesc( *it ); ///return default-parameter
+ }
+ }
+ }
+ }
+ }
+ return LocateResult();
+}
+
+//SimpleTypeCatalog::CatalogBuildInfo implementation
+TypePointer SimpleTypeCatalog::CatalogBuildInfo::build() {
+ if ( !m_tag )
+ return TypePointer();
+ else {
+ TypePointer tp = new SimpleTypeCachedCatalog( m_tag );
+ tp->parseParams( m_desc );
+ if ( m_parent ) tp->setParent( m_parent->bigContainer() );
+ return tp;
+ }
+
+}
+
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/simpletypecatalog.h b/languages/cpp/simpletypecatalog.h
new file mode 100644
index 00000000..ecfdb833
--- /dev/null
+++ b/languages/cpp/simpletypecatalog.h
@@ -0,0 +1,119 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 SIMPLETYPECATALOG_H
+#define SIMPLETYPECATALOG_H
+
+#include "simpletype.h"
+
+class SimpleTypeCatalog : public SimpleTypeImpl {
+
+public:
+
+ SimpleTypeCatalog() {
+ };
+
+ virtual DeclarationInfo getDeclarationInfo();
+
+ SimpleTypeCatalog( SimpleTypeCatalog* rhs ) : SimpleTypeImpl( rhs ), m_tag( rhs->m_tag ) {
+ };
+
+ static CppCodeCompletion* data;
+
+ virtual bool isNamespace() const {
+ return m_tag.kind() == Tag::Kind_Namespace;
+ }
+
+ /** empty scope means global scope */
+ SimpleTypeCatalog( const QStringList& scope ) : SimpleTypeImpl( scope ) {
+ init();
+ }
+
+ SimpleTypeCatalog( SimpleTypeImpl* rhs ) : SimpleTypeImpl( rhs ) {
+ init();
+ };
+
+ SimpleTypeCatalog( Tag& tag ) {
+ m_tag = tag;
+ initFromTag();
+ }
+
+ virtual QString comment() const {
+ return m_tag.comment();
+ };
+
+ virtual TypePointer clone();
+
+ virtual Repository rep() const {
+ return RepoCatalog;
+ }
+
+ virtual bool hasNode() const {
+ return (bool)m_tag;
+ };
+
+ virtual QStringList getBaseStrings();
+
+ virtual TemplateParamInfo getTemplateParamInfo();
+
+ virtual const LocateResult findTemplateParam( const QString& name );
+
+ virtual QString specialization() const;
+
+ virtual void addAliasesTo( SimpleTypeNamespace* ns );
+
+private:
+ Tag m_tag;
+
+ int pointerDepthFromString( const QString& str ) {
+ QRegExp ptrRx( "(\\*|\\&)" );
+ QString ptr = str.mid( str.find( ptrRx ) );
+ QStringList ptrList = QStringList::split( "", ptr );
+ return ptrList.size();
+ }
+
+ Tag findSubTag( const QString& name );
+
+ QValueList<Tag> getBaseClassList();
+
+ void initFromTag();
+
+ void init();
+
+protected:
+ const Tag& tag() {
+ return m_tag;
+ }
+
+ struct CatalogBuildInfo : public TypeBuildInfo {
+ Tag m_tag;
+ TypeDesc m_desc;
+ TypePointer m_parent;
+
+ CatalogBuildInfo( Tag tag , const TypeDesc& desc, TypePointer parent ) : m_tag( tag ) , m_desc( desc ), m_parent( parent ) {
+ }
+
+ virtual TypePointer build();
+ };
+
+ virtual MemberInfo findMember( TypeDesc name, MemberInfo::MemberType type = MemberInfo::AllTypes);
+
+ virtual QValueList<TypePointer> getMemberClasses( const TypeDesc& name ) ;
+};
+
+
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/simpletypefunction.cpp b/languages/cpp/simpletypefunction.cpp
new file mode 100644
index 00000000..898228bb
--- /dev/null
+++ b/languages/cpp/simpletypefunction.cpp
@@ -0,0 +1,726 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "simpletypefunction.h"
+#include "safetycounter.h"
+#include "simpletypenamespace.h"
+
+extern SafetyCounter safetyCounter;
+extern CppCodeCompletion* cppCompletionInstance;
+
+HashedStringSet getIncludeFiles( const ItemDom& item ) {
+ if ( item ) {
+ FileDom f = item->file();
+ if ( f ) {
+ ParseResultPointer p = f->parseResult();
+ if ( p ) {
+ ParsedFilePointer pp = dynamic_cast<ParsedFile*>( p.data() );
+ if ( pp ) {
+ return pp->includeFiles();
+ }
+ }
+ }
+ }
+
+ return HashedStringSet();
+}
+
+
+
+//SimpleTypeFunctionInterface implementation
+
+QString SimpleTypeFunctionInterface::signature() {
+ QString sig = "( ";
+ SimpleTypeImpl* asType = dynamic_cast<SimpleTypeImpl*>( this );
+
+ QStringList argDefaults = getArgumentDefaults();
+ QStringList argNames = getArgumentNames();
+ QValueList<TypeDesc> argTypes = getArgumentTypes();
+ QValueList<LocateResult> argRealTypes;
+
+ if ( asType ) {
+ for ( QValueList<TypeDesc>::iterator it = argTypes.begin(); it != argTypes.end(); ++it ) {
+ argRealTypes << asType->locateDecType( *it );
+ }
+ }
+
+ QStringList::iterator def = argDefaults.begin();
+ QStringList::iterator name = argNames.begin();
+ QValueList<LocateResult>::iterator realType = argRealTypes.begin();
+
+ while ( realType != argRealTypes.end() ) {
+ if ( sig != "( " )
+ sig += ", ";
+
+ sig += ( *realType )->fullNameChain();
+ ++realType;
+
+ if ( name != argNames.end() ) {
+ if ( !( *name ).isEmpty() ) sig += " " + *name;
+ ++name;
+ }
+
+ if ( def != argDefaults.end() && !( *def ).isEmpty() ) {
+ sig += " = " + *def;
+ ++def;
+ }
+ }
+
+ sig += " )";
+ return sig;
+}
+
+bool SimpleTypeFunctionInterface::containsUndefinedTemplateParam( TypeDesc& desc, SimpleTypeImpl::TemplateParamInfo& paramInfo ) {
+ TypeDesc::TemplateParams& pm = desc.templateParams();
+ SimpleTypeImpl::TemplateParamInfo::TemplateParam t;
+
+ if ( pm.isEmpty() && paramInfo.getParam( t, desc.name() ) )
+ if ( !t.value ) return true;
+
+ if ( desc.next() )
+ if ( containsUndefinedTemplateParam( *desc.next(), paramInfo ) )
+ return true;
+
+ for ( TypeDesc::TemplateParams::iterator it = pm.begin(); it != pm.end(); ++it ) {
+ if ( containsUndefinedTemplateParam( **it, paramInfo ) ) return true;
+ }
+
+ return false;
+}
+
+void SimpleTypeFunctionInterface::resolveImplicitTypes( TypeDesc& argType, TypeDesc& gottenArgType, SimpleTypeImpl::TemplateParamInfo& paramInfo ) {
+ if ( argType.templateParams().isEmpty() ) { ///Template-types may not be templates.
+ SimpleTypeImpl::TemplateParamInfo::TemplateParam p;
+ if ( paramInfo.getParam( p, argType.name() ) && !p.value ) {
+ ifVerbose( dbg() << "choosing \"" << gottenArgType.fullNameChain() << "\" as implicit template-parameter for \"" << argType.name() << "\"" << endl );
+ p.value = gottenArgType;
+ p.value.makePrivate();
+ for ( int d = 0; d < argType.totalPointerDepth(); d++ )
+ p.value.setTotalPointerDepth( p.value.totalPointerDepth() - 1 );
+
+ paramInfo.addParam( p );
+ }
+ } else {
+ if ( argType.name() == gottenArgType.name() )
+ resolveImplicitTypes( argType.templateParams(), gottenArgType.templateParams(), paramInfo );
+ }
+}
+
+void SimpleTypeFunctionInterface::resolveImplicitTypes( TypeDesc::TemplateParams& argTypes, TypeDesc::TemplateParams& gottenArgTypes, SimpleTypeImpl::TemplateParamInfo& paramInfo ) {
+ TypeDesc::TemplateParams::iterator it = argTypes.begin();
+ TypeDesc::TemplateParams::iterator it2 = gottenArgTypes.begin();
+
+ while ( it != argTypes.end() && it2 != gottenArgTypes.end() ) {
+ resolveImplicitTypes( **it, **it2, paramInfo );
+ ++it;
+ ++it2;
+ }
+}
+
+void SimpleTypeFunctionInterface::resolveImplicitTypes( QValueList<TypeDesc>& argTypes, QValueList<TypeDesc>& gottenArgTypes, SimpleTypeImpl::TemplateParamInfo& paramInfo ) {
+ QValueList<TypeDesc>::iterator it = argTypes.begin();
+ QValueList<TypeDesc>::iterator it2 = gottenArgTypes.begin();
+
+ while ( it != argTypes.end() && it2 != gottenArgTypes.end() ) {
+ resolveImplicitTypes( *it, *it2, paramInfo );
+ ++it;
+ ++it2;
+ }
+}
+
+void SimpleTypeFunctionInterface::appendNextFunction( SimpleType func ) {
+ Debug d( "#fapp#" );
+ if ( !func || !d ) return;
+ if (( SimpleTypeImpl* ) func.get() == ( SimpleTypeImpl* ) this ) return;
+ if ( m_nextFunction && m_nextFunction->asFunction() ) {
+ m_nextFunction->asFunction()->appendNextFunction( func );
+ } else {
+ m_nextFunction = func;
+ }
+}
+
+//SimpleTypeCodeModel implementation
+
+void SimpleTypeCodeModel::addAliasesTo( SimpleTypeNamespace* ns ) {
+ const NamespaceModel* m = dynamic_cast<const NamespaceModel*>( m_item.data() );
+ if ( m ) {
+ const NamespaceModel::NamespaceAliasModelList& namespaceAliases = m->namespaceAliases();
+ const NamespaceModel::NamespaceImportModelList& namespaceImports = m->namespaceImports();
+ for ( NamespaceModel::NamespaceAliasModelList::const_iterator it = namespaceAliases.begin(); it != namespaceAliases.end(); ++it ) {
+ HashedStringSet searchFiles;
+ FileDom d = m->codeModel()->fileByName( it->fileName().str() );
+ ParsedFilePointer p = dynamic_cast<ParsedFile*>( d->parseResult().data() );
+ if ( p ) {
+ searchFiles = p->includeFiles();
+ } else {
+ searchFiles = HashedStringSet( HashedString( it->fileName() ) );
+ }
+ TypeDesc ds( it->aliasName() );
+ ds.setIncludeFiles( searchFiles );
+ ns->addAliasMap( it->name(), ds, HashedString( it->fileName() ), true, false, bigContainer() );
+ }
+ for ( NamespaceModel::NamespaceImportModelList::const_iterator it = namespaceImports.begin(); it != namespaceImports.end(); ++it ) {
+ HashedStringSet searchFiles;
+ FileDom d = m->codeModel()->fileByName( it->fileName().str() );
+ ParsedFilePointer p = dynamic_cast<ParsedFile*>( d->parseResult().data() );
+ if ( p ) {
+ searchFiles = p->includeFiles();
+ } else {
+ searchFiles = HashedStringSet( HashedString( it->fileName() ) );
+ }
+ TypeDesc ds( it->name() );
+ ds.setIncludeFiles( searchFiles );
+ ns->addAliasMap( TypeDesc(), ds, HashedString( it->fileName() ), true, false, bigContainer() );
+ }
+ }
+}
+
+SimpleTypeCodeModel::SimpleTypeCodeModel( ItemDom& item ) : m_item( item ) {
+ CodeModelItem* i = & ( *item );
+ FunctionModel* m = dynamic_cast<FunctionModel*>( i );
+ ClassModel* c = dynamic_cast<ClassModel*>( i );
+ if ( m ) {
+ QStringList l = m->scope();
+ l << m->name();
+ setScope( l );
+ return;
+ }
+ if ( c ) {
+ QStringList l = c->scope();
+ l << c->name();
+ setScope( l );
+ return;
+ }
+ ifVerbose( dbg() << "code-model-item has an unsupported type: " << i->name() << endl );
+}
+
+ItemDom SimpleTypeCodeModel::locateModelContainer( class CodeModel* m, TypeDesc t, ClassDom cnt ) {
+ if ( !cnt ) {
+ if ( m->globalNamespace() ) {
+ cnt = model_cast<ClassDom> ( m->globalNamespace() );
+ } else {
+ return ItemDom();
+ }
+ }
+ if ( t ) {
+ if ( cnt->hasClass( t.name() ) ) {
+ ClassList l = cnt->classByName( t.name() );
+ if ( !l.isEmpty() ) {
+ if ( t.next() )
+ return locateModelContainer( m, *t.next(), l.front() );
+ else
+ return model_cast<ItemDom> ( l.front() );
+ }
+ }
+ NamespaceModel* ns = dynamic_cast<NamespaceModel*>( & ( *cnt ) );
+ if ( ns ) {
+ NamespaceDom n = ns->namespaceByName( t.name() );
+ if ( t.next() )
+ return locateModelContainer( m, *t.next(), model_cast<ClassDom> ( n ) );
+ else
+ return model_cast<ItemDom> ( n );
+ }
+ }
+
+ return ItemDom();
+}
+
+///Until header-parsing is implemented, this tries to find the class that is most related to this item
+/*ClassDom SimpleTypeCodeModel::pickMostRelated( ClassList lst, QString fn ) {
+ if( lst.isEmpty() ) return ClassDom();
+
+ ClassDom best = lst.front();
+ uint bestMatch = 0;
+ //kdDebug() << "searching most related to " << fn << endl;
+
+ for( ClassList::iterator it = lst.begin(); it != lst.end(); ++it ) {
+ if( !(*it)->getSpecializationDeclaration().isEmpty() ) continue; ///Don't consider specialized classes
+ //kdDebug() << "comparing " << (*it)->fileName() << endl;
+ QString str = (*it)->fileName();
+ uint len = str.length();
+ if( fn.length() < len ) len = fn.length();
+
+ uint matchLen = 0;
+ for( uint a = 0; a < len; a++ ) {
+ if( str[a] == fn[a] )
+ matchLen++;
+ else
+ break;
+ }
+
+ if( matchLen > bestMatch ) {
+ //kdDebug() << "picking " << str << endl;
+ bestMatch = matchLen;
+ best = *it;
+ }
+ }
+
+ //kdDebug() << "picked " << best->fileName() << endl;
+ if( !best->getSpecializationDeclaration().isEmpty() ) best = 0; ///only accept non-specialized classes
+ return best;
+}*/
+
+/*QValueList<TypePointer> SimpleTypeCodeModel::findSpecializations( const QString& name ) {
+ ClassModel* klass = dynamic_cast<ClassModel*> ( & (*m_item) );
+ if( !klass ) {
+ ifVerbose( dbg() << "\"" << str() << "\": search for member " << name.name() << " unsuccessful because the own type is invalid" << endl );
+ return QValueList<TypePointer>();
+ }
+
+ ClassList l = klass->classByName( name.name() );
+
+ if( !l.isEmpty() ) {
+ ClassDom i = pickMostRelated( l, globalCurrentFile );
+ if( i ) {
+ ret.setBuildInfo( new CodeModelBuildInfo( model_cast<ItemDom>( i ), name, TypePointer( this ) ) );
+
+ ret.memberType = MemberInfo::NestedType;
+ ret.type = name;
+ }
+ }
+
+ return QValueList<TypePointer>();
+}*/
+
+
+QValueList<TypePointer> SimpleTypeCodeModel::getMemberClasses( const TypeDesc& name ) {
+ QValueList<TypePointer> ret;
+
+ if ( !m_item ) return ret;
+
+ ClassModel* klass = dynamic_cast<ClassModel*>( & ( *m_item ) );
+ if ( !klass ) {
+ ifVerbose( dbg() << "\"" << str() << "\": search for member " << name.name() << " unsuccessful because the own type is invalid" << endl );
+ return ret;
+ }
+
+ ClassList l = klass->classByName( name.name() );
+
+ if ( !l.isEmpty() ) {
+ for ( ClassList::iterator it = l.begin(); it != l.end(); ++it ) {
+ CodeModelBuildInfo b( model_cast<ItemDom> ( *it ), name, TypePointer( this ) );
+ TypePointer r = b.build();
+ if ( r )
+ ret << r;
+ }
+ }
+ return ret;
+}
+
+template<class Item>
+Item pickMostRelated( const HashedStringSet& includeFiles, const QValueList<Item>& list ) {
+ if ( list.isEmpty() ) return Item();
+
+ for ( typename QValueList<Item>::const_iterator it = list.begin(); it != list.end(); ++it ) {
+ if ( includeFiles[( *it )->fileName()] )
+ return *it;
+ }
+ return list.front();
+}
+
+template<>
+ClassDom pickMostRelated( const HashedStringSet& includeFiles, const QValueList<ClassDom>& list ) {
+ if ( list.isEmpty() ) return ClassDom(); ///@todo the current file must be preferred
+
+ for ( QValueList<ClassDom>::const_iterator it = list.begin(); it != list.end(); ++it ) {
+ if ( !( *it )->getSpecializationDeclaration().isEmpty() ) continue; ///Don't consider specialized classes
+ if ( includeFiles[( *it )->fileName()] )
+ return *it;
+ }
+
+
+ if ( !list.front()->getSpecializationDeclaration().isEmpty() ) return ClassDom(); ///Don't consider specialized classes
+ return list.front();
+}
+
+SimpleTypeImpl::MemberInfo SimpleTypeCodeModel::findMember( TypeDesc name , MemberInfo::MemberType type ) {
+ MemberInfo ret;
+ ret.name = name.name();
+ ret.memberType = MemberInfo::NotFound;
+ if ( !name || !m_item ) return ret;
+
+ ClassModel* klass = dynamic_cast<ClassModel*>( & ( *m_item ) );
+ if ( !klass ) {
+ ifVerbose( dbg() << "\"" << str() << "\": search for member " << name.name() << " unsuccessful because the own type is invalid" << endl );
+ return ret;
+ }
+ NamespaceModel* ns = dynamic_cast<NamespaceModel*>( klass );
+
+ if ( klass->hasVariable( name.name() ) && ( type & MemberInfo::Variable ) ) {
+ ret.memberType = MemberInfo::Variable;
+ VariableDom d = klass->variableByName( name.name() );
+ if ( d ) {
+ ret.type = d->type();
+ ret.type->setIncludeFiles( HashedString( d->fileName() ) );
+ ret.decl.name = d->name();
+ ret.decl.file = d->fileName();
+ ret.decl.comment = d->comment();
+ d->getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ d->getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ }
+ } else if ( klass->hasTypeAlias( name.name() ) && ( type & MemberInfo::Typedef ) ) {
+ ret.memberType = MemberInfo::Typedef;
+ TypeAliasList li = klass->typeAliasByName( name.name() );
+ TypeAliasDom a = pickMostRelated( name.includeFiles(), li );
+
+ if ( a ) {
+ ret.type = a->type();
+ ret.type->setIncludeFiles( getIncludeFiles( a.data() ) );
+ ret.decl.name = a->name();
+ ret.decl.file = a->fileName();
+ ret.decl.comment = a->comment();
+ a->getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ a->getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ }
+ } else if ( klass->hasEnum( name.name() ) && ( type & MemberInfo::Typedef ) ) {
+ ret.memberType = MemberInfo::Typedef;
+ EnumDom e = klass->enumByName( name.name() );
+ ret.type = TypeDesc( "const int" );
+ ret.type->setIncludeFiles( HashedString( e->fileName() ) );
+ ret.decl.name = e->name();
+ ret.decl.file = e->fileName();
+ ret.decl.comment = e->comment();
+ e->getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ e->getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ } else if ( klass->hasClass( name.name() ) && ( type & MemberInfo::NestedType ) ) {
+ ClassList l = klass->classByName( name.name() );
+
+ if ( !l.isEmpty() ) {
+ ClassDom i = pickMostRelated( name.includeFiles(), l );
+ if ( i ) {
+ ret.setBuildInfo( new CodeModelBuildInfo( model_cast<ItemDom> ( i ), name, TypePointer( this ) ) );
+
+ ret.memberType = MemberInfo::NestedType;
+ ret.type = name;
+ ret.type->setIncludeFiles( HashedString( i->fileName() ) );
+ }
+ }
+ } else if ( klass->hasFunction( name.name() ) && ( type & MemberInfo::Function ) ) {
+ ret.memberType = MemberInfo::Function;
+ FunctionList l = klass->functionByName( name.name() );
+ if ( !l.isEmpty() && l.front() ) {
+ ret.setBuildInfo( new SimpleTypeCodeModelFunction::CodeModelFunctionBuildInfo( l, name , TypePointer( this ) ) );
+ ret.type = l.front()->resultType();
+ ret.type->setIncludeFiles( HashedString( l.front()->fileName() ) );
+ ret.type->increaseFunctionDepth();
+ }
+ } else if ( ns && ns->hasNamespace( name.name() ) && ( type & MemberInfo::Namespace ) ) {
+ NamespaceDom n = ns->namespaceByName( name.name() );
+ ret.setBuildInfo( new CodeModelBuildInfo( model_cast<ItemDom> ( n ), name, TypePointer( this ) ) );
+ ret.memberType = MemberInfo::Namespace;
+ ret.type = name;
+ //ret.type->setIncludeFiles( d->fileName() );
+ } else if ( klass->hasFunctionDefinition( name.name() ) && ( type & MemberInfo::Function ) ) {
+ FunctionDefinitionList l = klass->functionDefinitionByName( name.name() );
+ for ( FunctionDefinitionList::iterator it = l.begin(); it != l.end(); ++it ) {
+ if ( !( *it )->scope().isEmpty() && ( *it )->scope() != scope() ) continue; ///Only use definitions with empty scope or that are within this class
+ ret.setBuildInfo( new SimpleTypeCodeModelFunction::CodeModelFunctionBuildInfo( l, name, TypePointer( this ) ) );
+ ret.type = l.front()->resultType();
+ ret.type->setIncludeFiles( HashedString(( *it )->fileName() ) );
+ ret.type->increaseFunctionDepth();
+ ret.memberType = MemberInfo::Function;
+ break;
+ }
+ }
+
+ if ( ret.memberType == MemberInfo::NotFound ) {
+ if ( type & MemberInfo::Template ) {
+ LocateResult s = findTemplateParam( name.name() );
+ if ( s ) {
+ ret.memberType = MemberInfo::Template;
+ ret.type = s;
+ if ( m_item )
+ ret.type->setIncludeFiles( getIncludeFiles( m_item.data() ) );
+ ret.decl.name = name.name();
+ if ( m_item ) {
+ ret.decl.file = m_item->fileName();
+ m_item->getStartPosition( &ret.decl.startLine, &ret.decl.startCol );
+ m_item->getEndPosition( &ret.decl.endLine, &ret.decl.endCol );
+ }
+ }
+ }
+ }
+
+ if ( ret.memberType == MemberInfo::Function || ret.memberType == MemberInfo::Variable || ret.memberType == MemberInfo::Template || ret.memberType == MemberInfo::Typedef || ret.memberType == MemberInfo::NestedType ) {
+ //For redirected types it is necessary to add the include-files of the context they were searched in.
+ //That is not quite correct, but it makes sure that at least the same namespace-aliases will be activated while the search for the type,
+ //Which is necessary because the alias is parented by exactly this class.
+
+ ret.type->addIncludeFiles( name.includeFiles() );
+ }
+
+ chooseSpecialization( ret );
+
+ return ret;
+}
+
+bool SimpleTypeCodeModel::findItem() {
+ QString key = str();
+ m_item = locateModelContainer( cppCompletionInstance->m_pSupport->codeModel(), str() );
+ return ( bool ) m_item;
+}
+
+void SimpleTypeCodeModel::init() {
+ if ( scope().isEmpty() ) {
+ m_item = cppCompletionInstance->m_pSupport->codeModel() ->globalNamespace();
+ } else {
+ findItem();
+ }
+}
+
+DeclarationInfo SimpleTypeCodeModel::getDeclarationInfo() {
+ DeclarationInfo ret;
+ ItemDom i = item();
+ ret.name = fullTypeResolved();
+ if ( i ) {
+ ret.file = i->fileName();
+ i->getStartPosition( &ret.startLine, &ret.startCol );
+ i->getEndPosition( &ret.endLine, &ret.endCol );
+ ret.comment = i->comment();
+ }
+ return ret;
+}
+
+QString SimpleTypeCodeModel::specialization() const {
+ const ClassModel* klass = dynamic_cast<const ClassModel*>( m_item.data() );
+ if ( !klass ) return QString::null;
+ return klass->getSpecializationDeclaration();
+}
+
+SimpleTypeImpl::TemplateParamInfo SimpleTypeCodeModel::getTemplateParamInfo() {
+ TemplateParamInfo ret;
+
+ if ( m_item ) {
+ TemplateModelItem* ti = dynamic_cast<TemplateModelItem*>( & ( *m_item ) );
+ TypeDesc::TemplateParams& templateParams = m_desc.templateParams();
+
+ TemplateModelItem::ParamMap m = ti->getTemplateParams();
+ for ( uint a = 0; a < m.size(); a++ ) {
+ TemplateParamInfo::TemplateParam t;
+ t.number = a;
+ t.name = m[a].first;
+ t.def = m[a].second;
+ if ( templateParams.count() > a )
+ t.value = *templateParams[a];
+ ret.addParam( t );
+ }
+ }
+
+ return ret;
+}
+
+const LocateResult SimpleTypeCodeModel::findTemplateParam( const QString& name ) {
+ if ( m_item ) {
+ TemplateModelItem* ti = dynamic_cast<TemplateModelItem*>( & ( *m_item ) );
+ TypeDesc::TemplateParams& templateParams = m_desc.templateParams();
+ int pi = ti->findTemplateParam( name );
+ if ( pi != -1 && ( int ) templateParams.count() > pi ) {
+ return *templateParams[pi];
+ } else {
+ if ( pi != -1 && !ti->getParam( pi ).second.isEmpty() ) {
+ QString def = ti->getParam( pi ).second;
+ ifVerbose( dbg() << "\"" << str() << "\": using default-template-parameter \"" << def << "\" for " << name << endl );
+ return TypeDesc( def );
+ } else if ( pi != -1 ) {
+ ifVerbose( dbg() << "\"" << str() << "\": template-type \"" << name << "\" has no pameter! " << endl );
+ }
+ }
+ }
+ return LocateResult();
+}
+
+QStringList SimpleTypeCodeModel::getBaseStrings() {
+ Debug d( "#getbases#" );
+ if ( !d || !safetyCounter ) {
+ //ifVerbose( dbg() << "\"" << str() << "\": recursion to deep while getting bases" << endl );
+ return QStringList();
+ }
+
+ QStringList ret;
+
+ ClassModel* klass;
+
+ if ( !m_item || ( klass = dynamic_cast<ClassModel*>( & ( *m_item ) ) ) == 0 ) return ret;
+
+ QStringList parents = klass->baseClassList();
+ for ( QStringList::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ ret << *it;
+ }
+
+ return ret;
+}
+
+TypePointer SimpleTypeCodeModel::CodeModelBuildInfo::build() {
+ TypePointer tp = new SimpleTypeCachedCodeModel( m_item );
+ tp->parseParams( m_desc );
+ if ( m_parent ) tp->setParent( m_parent->bigContainer() );
+ return tp;
+}
+
+//SimpleTypeCodeModelFunction implementation
+TypeDesc SimpleTypeCodeModelFunction::getReturnType() {
+ if ( item() ) {
+ IncludeFiles files;
+ if( parent() )
+ files = parent()->getFindIncludeFiles();
+ if ( FunctionModel* m = dynamic_cast<FunctionModel*>( & ( *item() ) ) ) {
+ TypeDesc d = m->resultType();
+ d.setIncludeFiles( files );
+ return d;
+ }
+ }
+
+ return TypeDesc();
+}
+
+bool SimpleTypeCodeModelFunction::isConst() {
+ if ( asFunctionModel() )
+ return asFunctionModel()->isConstant();
+
+ return false;
+}
+
+
+QValueList<TypeDesc> SimpleTypeCodeModelFunction::getArgumentTypes() {
+ QValueList<TypeDesc> ret;
+
+ if ( item() ) {
+ IncludeFiles files;
+ if( parent() )
+ files = parent()->getFindIncludeFiles();
+ if ( FunctionModel* m = dynamic_cast<FunctionModel*>( & ( *item() ) ) ) {
+ ArgumentList l = m->argumentList();
+ for ( ArgumentList::iterator it = l.begin(); it != l.end(); ++it ) {
+ ret << TypeDesc(( *it )->type() );
+ ret.back().setIncludeFiles( files );
+ }
+ }
+ }
+
+ return ret;
+}
+
+QStringList SimpleTypeCodeModelFunction::getArgumentNames() {
+ QStringList ret;
+
+ if ( item() ) {
+ if ( FunctionModel* m = dynamic_cast<FunctionModel*>( & ( *item() ) ) ) {
+ ArgumentList l = m->argumentList();
+ for ( ArgumentList::iterator it = l.begin(); it != l.end(); ++it )
+ ret << ( *it )->name();
+ }
+ }
+
+ return ret;
+}
+
+QStringList SimpleTypeCodeModelFunction::getArgumentDefaults() {
+ QStringList ret;
+
+ if ( item() ) {
+ if ( FunctionModel* m = dynamic_cast<FunctionModel*>( & ( *item() ) ) ) {
+ ArgumentList l = m->argumentList();
+ for ( ArgumentList::iterator it = l.begin(); it != l.end(); ++it )
+ ret << ( *it )->defaultValue();
+ }
+ }
+
+ return ret;
+}
+
+
+//SimpleTypeCodeModelFunction::CodeModelFunctionBuildInfo implementation
+
+SimpleTypeCodeModelFunction::CodeModelFunctionBuildInfo::CodeModelFunctionBuildInfo( FunctionDefinitionList items, TypeDesc& desc, TypePointer parent ) : m_desc( desc ), m_parent( parent ) {
+
+ for ( FunctionDefinitionList::iterator it = items.begin(); it != items.end(); ++it ) {
+ m_items << model_cast<FunctionDom> ( *it );
+ }
+}
+
+TypePointer SimpleTypeCodeModelFunction::CodeModelFunctionBuildInfo::build() {
+ QValueList<TypePointer> ret;
+ TypePointer last;
+ for ( FunctionList::iterator it = m_items.begin(); it != m_items.end(); ++it ) {
+ TypePointer tp = new SimpleTypeCodeModelFunction( model_cast<ItemDom> ( *it ) );
+ tp->takeTemplateParams( m_desc );
+ tp->descForEdit().increaseFunctionDepth();
+ tp->setParent( m_parent->bigContainer() );
+ if ( last && last->asFunction() ) last->asFunction()->appendNextFunction( SimpleType( tp ) );
+ last = tp;
+ ret << tp;
+ }
+
+ if ( ret.isEmpty() ) {
+ ifVerbose( dbg() << "error" << endl );
+ return TypePointer();
+ } else
+ return ret.front();
+}
+
+//SimpleTypeCatalogFunction implementation
+TypeDesc SimpleTypeCatalogFunction::getReturnType() {
+ if ( tag() ) {
+ return tagType( tag() );
+ }
+
+ return TypeDesc();
+}
+
+bool SimpleTypeCatalogFunction::isConst() {
+ Tag t = tag();
+ CppFunction<Tag> tagInfo( t );
+ return tagInfo.isConst();
+}
+
+QStringList SimpleTypeCatalogFunction::getArgumentNames() {
+ QStringList ret;
+ Tag t = tag();
+ CppFunction<Tag> tagInfo( t );
+ return tagInfo.argumentNames();
+}
+
+QValueList<TypeDesc> SimpleTypeCatalogFunction::getArgumentTypes() {
+ QValueList<TypeDesc> ret;
+ Tag t = tag();
+ CppFunction<Tag> tagInfo( t );
+ QStringList arguments = tagInfo.arguments();
+ for ( QStringList::iterator it = arguments.begin(); it != arguments.end(); ++it )
+ ret << TypeDesc( *it );
+ return ret;
+}
+
+//SimpleTypeCatalogFunction::CatalogFunctionBuildInfo implementation
+
+TypePointer SimpleTypeCatalogFunction::CatalogFunctionBuildInfo::build() {
+ QValueList<TypePointer> ret;
+ TypePointer last;
+ for ( QValueList<Tag>::iterator it = m_tags.begin(); it != m_tags.end(); ++it ) {
+ TypePointer tp = new SimpleTypeCatalogFunction( *it );
+ tp->takeTemplateParams( m_desc );
+ tp->descForEdit().increaseFunctionDepth();
+ if ( m_parent ) tp->setParent( m_parent->bigContainer() );
+ if ( last && last->asFunction() ) last->asFunction()->appendNextFunction( SimpleType( tp ) );
+ last = tp;
+ ret << tp;
+ }
+
+ if ( ret.isEmpty() ) {
+ ifVerbose( dbg() << "error" << endl );
+ return TypePointer();
+ }
+ return ret.front();
+}
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simpletypefunction.h b/languages/cpp/simpletypefunction.h
new file mode 100644
index 00000000..a0bd34fc
--- /dev/null
+++ b/languages/cpp/simpletypefunction.h
@@ -0,0 +1,341 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 SIMPLETYPEFUNCTION_H
+#define SIMPLETYPEFUNCTION_H
+
+#include "simpletype.h"
+#include "simpletypecachebinder.h"
+#include "simpletypecatalog.h"
+
+HashedStringSet getIncludeFiles( const ItemDom& item );
+
+
+///Interface that functions should implement
+class SimpleTypeFunctionInterface {
+ public:
+
+ SimpleTypeFunctionInterface() {
+ }
+
+ SimpleTypeFunctionInterface( SimpleTypeFunctionInterface* rhs ) {
+ m_nextFunction = rhs->m_nextFunction;
+ }
+
+ void clearNextFunctions() {
+ m_nextFunction = SimpleType();
+ }
+
+ void appendNextFunction( SimpleType func );
+
+ SimpleType nextFunction() {
+ return m_nextFunction;
+ }
+
+ ///Returns the totally unresolved return-type
+ virtual TypeDesc getReturnType() = 0;
+
+ virtual QValueList<TypeDesc> getArgumentTypes() = 0;
+
+ virtual QStringList getArgumentDefaults() = 0;
+
+ virtual QStringList getArgumentNames() = 0;
+
+ virtual bool isConst() = 0;
+
+ virtual QString signature();
+
+///TODO: This function should locate the correct overloaded method in the chain, fitting the parameters
+ ///should also moved into another class then
+ SimpleTypeImpl* match( const QValueList<LocateResult>& /*params*/ ) {
+ // QValueList<TypeDesc> args = getArgumentTypes();
+ return dynamic_cast<SimpleTypeImpl*>( this );
+ }
+
+ private:
+ ///Since functions can be overloaded, many functions with the same name can exist. Other functions that belong to this one
+ ///should be appended to this.
+ SimpleType m_nextFunction;
+
+
+ protected:
+
+ bool containsUndefinedTemplateParam( TypeDesc& desc, SimpleTypeImpl::TemplateParamInfo& paramInfo );
+
+ ///Tries to match the types, filling implicit template-params into paramInfo
+ void resolveImplicitTypes( TypeDesc& argType, TypeDesc& gottenArgType, SimpleTypeImpl::TemplateParamInfo& paramInfo );
+
+ ///Tries to match the types, filling implicit template-params into paramInfo
+ void resolveImplicitTypes( TypeDesc::TemplateParams& argTypes, TypeDesc::TemplateParams& gottenArgTypes, SimpleTypeImpl::TemplateParamInfo& paramInfo );
+
+ ///Tries to match the types, filling implicit template-params into paramInfo
+ void resolveImplicitTypes( QValueList<TypeDesc>& argTypes, QValueList<TypeDesc>& gottenArgTypes, SimpleTypeImpl::TemplateParamInfo& paramInfo );
+};
+
+template <class Base=SimpleTypeImpl>
+class SimpleTypeFunction : public Base, public SimpleTypeFunctionInterface {
+public:
+ SimpleTypeFunction() : Base() {
+ }
+
+ SimpleTypeFunction( SimpleTypeFunction<Base>* rhs ) : Base( rhs ), SimpleTypeFunctionInterface( rhs ) {
+ }
+
+ template <class Type>
+ SimpleTypeFunction( Type t ) : Base( t ) {
+ }
+
+ virtual ~SimpleTypeFunction() {
+ };
+
+ virtual SimpleTypeImpl::TypePointer clone() = 0;
+
+ virtual SimpleTypeImpl::MemberInfo findMember( TypeDesc name, SimpleTypeImpl::MemberInfo::MemberType type ){
+ SimpleTypeImpl::MemberInfo ret;
+ if( type & SimpleTypeImpl::MemberInfo::Template ) {
+ TypeDesc s = Base::findTemplateParam( name.name() );
+ if( s ) {
+ ret.memberType = SimpleTypeImpl::MemberInfo::Template;
+ ret.type = s;
+ }
+ }
+
+ return ret;
+ }
+
+ virtual LocateResult applyOperator( typename Base::Operator op , QValueList<LocateResult> params ) {
+ Debug d("#apply#");
+ if( !d )
+ return LocateResult();
+
+ if( op == SimpleTypeImpl::ParenOp ) {
+ ///First, try to find an overloaded function matching the parameter-types.
+ SimpleTypeImpl* f = match( params );
+ if( f && f->asFunction() ) {
+ ifVerbose( dbg() << "applying Operator " << this->operatorToString( op ) << " to \"" << f->desc().fullNameChain() << "\"" << endl );
+
+ TypeDesc rt = f->asFunction()->getReturnType();
+ SimpleTypeImpl::TemplateParamInfo paramInfo = f->getTemplateParamInfo();
+ if( containsUndefinedTemplateParam( rt, paramInfo ) ) {
+ /** This is the place where implicit template-function-instatiation takes place.
+ * Match the given param-types with the argument-types to resolve new template-params.
+ */
+ QValueList<TypeDesc> args = getArgumentTypes();
+ QValueList<TypeDesc> paramDescs;
+ for( QValueList<LocateResult>::iterator it = params.begin(); it != params.end(); ++it )
+ paramDescs << (TypeDesc)(*it);
+ resolveImplicitTypes( args, paramDescs, paramInfo );
+ ///paramInfo now contains the information for all implicit types
+ }
+
+ return this->parent()->locateDecType( f->replaceTemplateParams( rt, paramInfo ) );
+ } else {
+ ifVerbose( dbg() << "failed to find a fitting overloaded method" << endl );
+ }
+ }
+ return Base::applyOperator( op, params );
+ }
+
+};
+
+/**
+The SimpleTypeCodeModel and SimpleTypeCatalog can represent namespaces too,
+but they only represent a REAL(physical) namespace and only within either the catalog
+or the code-model. This is a proxy-class that handles namespace-aliases, imports, and splits requests to both, the catalog, and the code-model.
+There can be multiple namespaces aliased to the same one
+*/
+
+
+class SimpleTypeCodeModel : public SimpleTypeImpl {
+public:
+
+ SimpleTypeCodeModel( SimpleTypeCodeModel* rhs ) : SimpleTypeImpl( rhs ), m_item( rhs->m_item ) {
+ }
+
+ SimpleTypeCodeModel( SimpleTypeImpl* rhs ) : SimpleTypeImpl( rhs ) {
+ init();
+ }
+
+ SimpleTypeCodeModel( const QStringList& scope ) : SimpleTypeImpl( scope ) {
+ init();
+ }
+
+ virtual bool hasNode() const {
+ return (bool)m_item;
+ };
+
+ virtual QString comment() const {
+ if( m_item ) {
+ return m_item->comment();
+ } else {
+ return "";
+ }
+ };
+
+ virtual DeclarationInfo getDeclarationInfo();
+
+ SimpleTypeCodeModel( ItemDom& item );
+
+ virtual TypePointer clone() {
+ return new SimpleTypeCachedCodeModel( this );
+ }
+
+ virtual Repository rep() {
+ return RepoCodeModel;
+ }
+
+ virtual bool isNamespace() const {
+ if( m_item ) {
+ return m_item->isNamespace();
+ } else {
+ return false;
+ }
+ };
+
+ inline ItemDom& item() {
+ return m_item;
+ }
+
+ virtual TemplateParamInfo getTemplateParamInfo();
+
+ virtual const LocateResult findTemplateParam( const QString& name );
+
+ /** In case of a class, returns all base-types */
+ virtual QStringList getBaseStrings();
+
+ ItemDom locateModelContainer( class CodeModel* m, TypeDesc t, ClassDom cnt = ClassDom() );
+
+ virtual QString specialization() const;
+
+ virtual void addAliasesTo( SimpleTypeNamespace* ns );
+
+private:
+ ItemDom m_item;
+
+ bool findItem();
+
+ void init();
+
+ //ClassDom pickMostRelated( ClassList lst, QString fn );
+
+protected:
+ SimpleTypeCodeModel() : SimpleTypeImpl() {
+ };
+
+
+ struct CodeModelBuildInfo : public TypeBuildInfo {
+ ItemDom m_item;
+ TypeDesc m_desc;
+ TypePointer m_parent;
+
+ CodeModelBuildInfo( ItemDom item, const TypeDesc& desc, TypePointer parent ) : m_item( item ), m_desc( desc ), m_parent( parent ) {
+ }
+
+ virtual TypePointer build();
+ };
+
+ virtual MemberInfo findMember( TypeDesc name , MemberInfo::MemberType type = MemberInfo::AllTypes) ;
+
+ virtual QValueList<TypePointer> getMemberClasses( const TypeDesc& name ) ;
+};
+
+
+class SimpleTypeCodeModelFunction : public SimpleTypeFunction<SimpleTypeCodeModel> {
+public:
+ SimpleTypeCodeModelFunction() : SimpleTypeFunction<SimpleTypeCodeModel>() {
+ }
+
+ SimpleTypeCodeModelFunction( SimpleTypeCodeModelFunction* rhs ) : SimpleTypeFunction<SimpleTypeCodeModel> ( rhs ) {
+ }
+
+ virtual SimpleTypeImpl::TypePointer clone() {
+ return new SimpleTypeCodeModelFunction( this );
+ }
+
+ SimpleTypeCodeModelFunction( ItemDom item ) : SimpleTypeFunction<SimpleTypeCodeModel>( item ) {
+ }
+
+ virtual TypeDesc getReturnType();
+
+ virtual bool isConst();
+
+ virtual QValueList<TypeDesc> getArgumentTypes();
+
+ virtual QStringList getArgumentNames();
+
+ virtual QStringList getArgumentDefaults();
+
+ struct CodeModelFunctionBuildInfo : public TypeBuildInfo {
+ FunctionList m_items;
+ TypeDesc m_desc;
+ TypePointer m_parent;
+
+ CodeModelFunctionBuildInfo( FunctionList items, TypeDesc& desc, TypePointer parent ) : m_items( items ), m_desc( desc ), m_parent( parent ) {
+ }
+ CodeModelFunctionBuildInfo( FunctionDefinitionList items, TypeDesc& desc, TypePointer parent );
+
+ virtual TypePointer build();
+ };
+
+private:
+ FunctionModel* asFunctionModel() {
+ if( ! &(*item() ) ) return 0;
+ return dynamic_cast<FunctionModel*>( &(*item() ) );
+ }
+
+};
+
+
+class SimpleTypeCatalogFunction : public SimpleTypeFunction<SimpleTypeCatalog> {
+public:
+ SimpleTypeCatalogFunction() : SimpleTypeFunction<SimpleTypeCatalog>() {
+ }
+
+ SimpleTypeCatalogFunction( Tag tag ) : SimpleTypeFunction<SimpleTypeCatalog>( tag ) {
+ }
+
+ SimpleTypeCatalogFunction( SimpleTypeCatalogFunction* rhs ) : SimpleTypeFunction<SimpleTypeCatalog>( rhs ) {
+ }
+
+ virtual SimpleTypeImpl::TypePointer clone() {
+ return new SimpleTypeCatalogFunction( this );
+ }
+
+ struct CatalogFunctionBuildInfo : public TypeBuildInfo {
+ QValueList<Tag> m_tags;
+ TypeDesc m_desc;
+ TypePointer m_parent;
+
+ CatalogFunctionBuildInfo( QValueList<Tag> tags, TypeDesc& desc, TypePointer parent ) : m_tags( tags ), m_desc( desc ), m_parent( parent ) {
+ }
+
+ virtual TypePointer build();
+ };
+
+ virtual TypeDesc getReturnType();
+
+ virtual bool isConst ();
+
+ virtual QStringList getArgumentDefaults() {
+ return QStringList();
+ }
+
+ virtual QStringList getArgumentNames();
+
+ virtual QValueList<TypeDesc> getArgumentTypes();
+};
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simpletypenamespace.cpp b/languages/cpp/simpletypenamespace.cpp
new file mode 100644
index 00000000..2ae35401
--- /dev/null
+++ b/languages/cpp/simpletypenamespace.cpp
@@ -0,0 +1,438 @@
+/***************************************************************************
+copyright : (C) 2006 by David Nolden
+email : david.nolden.kdevelop@art-master.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 <qtl.h>
+#include <typeinfo>
+#include "simpletypenamespace.h"
+#include "simpletypecachebinder.h"
+
+#include "safetycounter.h"
+
+//#define PHYSICAL_IMPORT
+//Necessary, because else nested members cannot search the correct scope
+#define PHYSICALLY_IMPORT_NAMESPACES
+
+extern SafetyCounter safetyCounter;
+
+//SimpleTypeNamespace implementation
+
+TypePointer SimpleTypeNamespace::clone() {
+ return new SimpleTypeCachedNamespace( this );
+}
+
+SimpleTypeNamespace::SimpleTypeNamespace( const QStringList& fakeScope, const QStringList& realScope ) : SimpleTypeImpl( fakeScope ), m_currentSlaveId(0) {
+ ifVerbose( dbg() << "\"" << str() << "\": created namespace-proxy with real scope \"" << realScope.join( "::" ) << "\"" << endl );
+ SimpleType cm = SimpleType( realScope, HashedStringSet(), RepoCodeModel );
+ SimpleType ct = SimpleType( realScope, HashedStringSet(), RepoCatalog );
+ cm = SimpleType( cm->clone() );
+ ct = SimpleType( ct->clone() );
+ cm->setMasterProxy( this );
+ ct->setMasterProxy( this );
+ addImport( cm->desc() );
+ addImport( ct->desc() );
+}
+
+SimpleTypeNamespace::SimpleTypeNamespace( const QStringList& fakeScope ) : SimpleTypeImpl( fakeScope ), m_currentSlaveId(0) {
+ ifVerbose( dbg() << "\"" << str() << "\": created namespace-proxy" << endl );
+}
+
+SimpleTypeNamespace::SimpleTypeNamespace( SimpleTypeNamespace* ns ) : SimpleTypeImpl( ns ), m_currentSlaveId(0) {
+ ifVerbose( dbg() << "\"" << str() << "\": cloning namespace" << endl );
+ m_aliases = ns->m_aliases;
+ m_activeSlaves = ns->m_activeSlaves;
+ m_activeSlaveGroups = ns->m_activeSlaveGroups;
+}
+
+void SimpleTypeNamespace::breakReferences() {
+ m_aliases.clear();
+ m_activeSlaves.clear();
+ SimpleTypeImpl::breakReferences();
+}
+
+
+SimpleTypeImpl::MemberInfo SimpleTypeNamespace::findMember( TypeDesc name, MemberInfo::MemberType type ) {
+ std::set<HashedString> ignore;
+ SimpleTypeImpl::MemberInfo ret = findMember( name, type, ignore );
+///chooseSpecialization( ret ); should not be necessary
+ return ret;
+}
+
+QValueList<TypePointer> SimpleTypeNamespace::getMemberClasses( const TypeDesc& name ) {
+ std::set<HashedString> ignore;
+
+ return getMemberClasses( name, ignore );
+}
+
+QValueList<TypePointer> SimpleTypeNamespace::getMemberClasses( const TypeDesc& name, std::set<HashedString>& ignore ) {
+ HashedString myName = HashedString( scope().join( "::" ) +"%"+typeid( *this ).name() );
+ if ( ignore.find( myName ) != ignore.end() || !safetyCounter )
+ return QValueList<TypePointer>();
+
+ ignore.insert( myName );
+
+ QValueList<TypePointer> ret;
+
+ SlaveList l = getSlaves( name.includeFiles() );
+ for ( SlaveList::iterator it = l.begin(); it != l.end(); ++it ) {
+ if (( *it ).first.first.resolved() ) {
+ SimpleTypeNamespace* ns = dynamic_cast<SimpleTypeNamespace*>(( *it ).first.first.resolved().data() );
+ if ( !ns ) {
+ HashedString thatName = HashedString(( *it ).first.first.resolved()->scope().join( "::" ) +"%"+typeid( *( *it ).first.first.resolved() ).name() );
+ if ( ignore.find( thatName ) != ignore.end() ) continue;
+ ignore.insert( thatName );
+ ret += ( *it ).first.first.resolved()->getMemberClasses( name );
+ } else {
+ ret += ns->getMemberClasses( name, ignore );
+
+ }
+
+ }
+ }
+
+ return ret;
+}
+
+SimpleTypeImpl::MemberInfo SimpleTypeNamespace::findMember( TypeDesc name, MemberInfo::MemberType type, std::set
+ <HashedString>& ignore ) {
+ MemberInfo mem;
+ mem.name = "";
+ mem.memberType = MemberInfo::NotFound;
+ HashedString myName = HashedString( scope().join( "::" ) +"%"+typeid( *this ).name() );
+ if ( ignore.find( myName ) != ignore.end() || !safetyCounter )
+ return mem;
+ ignore.insert( myName );
+
+ SlaveList l = getSlaves( name.includeFiles() );
+
+ ImportList m_aliasImports;
+
+ AliasMap::iterator itt = m_aliases.find( name.name() );
+
+ if ( itt != m_aliases.end() && !( *itt ).empty() ) {
+ ifVerbose( dbg() << "\"" << str() << "\": namespace-sub-aliases \"" << name.name() << "\"" << "\" requested, locating targets" << endl );
+
+ for ( ImportList::iterator it = ( *itt ).begin(); it != ( *itt ).end(); ++it ) {
+ if ( !( /*name.includeFiles().size() < 1 ||*/ ( *it ).files <= name.includeFiles() ) ) continue; //filter the slave by the include-files
+
+ ifVerbose( dbg() << "\"" << str() << "\": namespace-sub-aliases \"" << name.name() << "\": taking target \"" << ( *it ).import.fullNameChain() << "\"" << endl );
+ /*TypeDesc d( (*it).import );
+ d.setIncludeFiles( name.includeFiles() );*/
+ m_aliasImports.insert( *it ); //@todo: what include-files should be used for searching the namespace?
+ /*LocateResult l = locateDecType( d, SimpleTypeImpl::Normal, 0, SimpleTypeImpl::MemberInfo::Namespace );
+ if ( !l || !l->resolved() || !dynamic_cast<SimpleTypeNamespace*>( l->resolved().data() ) ) {
+ ifVerbose( dbg() << "\"" << str() << "\": namespace-sub-aliases \"" << name.name() << "\" -> \"" << ( *it ).import.fullNameChain() << "\" could not be resolved" << endl );
+ } else {
+ m_aliasImports.insert( Import( d.includeFiles(), l, this ) );
+ }*/
+ }
+ }
+
+ for ( SlaveList::iterator it = l.begin(); it != l.end(); ++it ) {
+ if ( !( *it ).first.first.resolved() )
+ continue;
+ if ( ignore.find( HashedString(( *it ).first.first.resolved()->scope().join( "::" ) +"%"+ typeid( *( *it ).first.first.resolved() ).name() ) ) != ignore.end() ) continue;
+
+ ifVerbose( dbg() << "\"" << str() << "\": redirecting search for \"" << name.name() << "\" to \"" << ( *it ) .first.first.fullNameChain() << "\"" << endl );
+ if ( !( *it ).first.first.resolved() ) {
+ ifVerbose( dbg() << "\"" << str() << "\": while search for \"" << name.name() << "\": Imported namespace \"" << ( *it ) .first.first.fullNameChain() << "\" is not resolved(should have been resolved in updateAliases)" << endl );
+ continue;
+ }
+ ifVerbose( dbg() << "\"Class-type: " << typeid( *( *it ).first.first.resolved().data() ).name() << ")" << endl );
+ SimpleTypeNamespace* ns = dynamic_cast<SimpleTypeNamespace*>(( *it ).first.first.resolved().data() );
+
+ if ( ns )
+ mem = ns->findMember( name , type, ignore );
+ else
+ mem = ( *it ).first.first.resolved()->findMember( name, type );
+
+ if ( mem ) {
+ if ( mem.memberType != MemberInfo::Namespace ) {
+#ifdef PHYSICAL_IMPORT
+ TypePointer b = mem.build();
+ if ( b && !( b->parent()->masterProxy().data() == this ) ) {
+ b = b ->clone(); //expensive, cache is not shared
+ b->setParent( this );
+
+ mem.setBuilt( b );
+ }
+#else
+ if( mem.memberType == MemberInfo::NestedType )
+ chooseSpecialization( mem );
+ TypePointer b = mem.build();
+ if( b && b->parent() && b->parent()->masterProxy().data() == this )
+ b->setParent( this );
+#endif
+ return mem;
+ } else {
+ TypePointer b = mem.build();
+
+ if ( b )
+ m_aliasImports.insert( Import( IncludeFiles(), b->desc(), TypePointer() ) );
+ else
+ ifVerbose( dbg() << "\"" << str() << "\": found namespace \"" << name.name() << "\", but it is not resolved" << endl );
+ }
+ }
+ }
+
+ if ( !m_aliasImports.empty() ) {
+ return setupMemberInfo( name.fullNameList().join( "::" ), m_aliasImports );
+
+ }
+
+ return mem;
+}
+
+// LocateResult SimpleTypeNamespace::locateSlave( const SlaveList::const_iterator& target, const IncludeFiles& includeFiles ) {
+// for( SlaveList::const_iterator it = m_activeSlaves.begin(); it != target; ++it ) {
+//
+// }
+// }
+
+SimpleTypeImpl::MemberInfo SimpleTypeNamespace::setupMemberInfo( const QStringList& subName, const ImportList& imports ) {
+ MemberInfo mem;
+ mem.name = subName.join( "::" );
+ mem.memberType = MemberInfo::NotFound;
+ QStringList sc = scope();
+ sc += subName;
+ mem.type = sc.join( "::" );
+ mem.memberType = MemberInfo::Namespace;
+ mem.setBuildInfo( new NamespaceBuildInfo( sc, imports ) );
+ return mem;
+}
+
+///This must be optimized
+void SimpleTypeNamespace::addAliasMap( const TypeDesc& name, const TypeDesc& alias, const IncludeFiles& files, bool recurse, bool symmetric, const TypePointer& perspective ) {
+ Debug db;
+ if ( !db ) {
+ kdDebug( 9007 ) << str() << " addAliasMap: cannot add alias \"" << name.fullNameChain() << "\" -> \"" << alias.fullNameChain() << "\", recursion too deep" << endl;
+ return ;
+ }
+ if ( name.next() ) kdDebug( 9007 ) << "addAliasMap warning: type-alias-name has order higher than one: " << name.fullNameChain() << ", only " << name.name() << " will be used" << endl;
+ if ( name == alias )
+ return ;
+
+ if ( symmetric )
+ addAliasMap( alias, name, files, recurse, false );
+
+ invalidateSecondaryCache();
+ invalidatePrimaryCache( true ); //Only not-found items are cleared updated here for performance-reasons(found items will stay cached)
+
+ AliasMap::iterator it = m_aliases.find( name.name() );
+ if ( it == m_aliases.end() )
+ it = m_aliases.insert( name.name(), ImportList() );
+
+ Import a( files, alias, perspective );
+ std::pair< ImportList::const_iterator, ImportList::const_iterator > rng = ( *it ).equal_range( a );
+ while ( rng.first != rng.second ) {
+ if ( rng.first->files == files )
+ return ; //The same alias, with the same files, has already been added.
+ ++rng.first;
+ }
+
+ ( *it ).insert( a );
+ ifVerbose( dbg() << "\"" << str() << "\": adding namespace-alias \"" << name.name() << ( !symmetric ? "\" -> \"" : "\" = \"" ) << alias.name() << "\" files:\n[ " << files.print().c_str() << "]\n" << endl );
+ ifVerbose( if ( alias.resolved() ) dbg() << "Resolved type of the imported namespace: " << typeid( *alias.resolved() ).name() );
+
+ if ( name.name().isEmpty() ) {
+ addImport( alias, files, perspective );
+ }
+}
+
+std::set<size_t> SimpleTypeNamespace::updateAliases( const IncludeFiles& files/*, bool isRecursion */) {
+ std::set<size_t> possibleSlaves;
+ if ( m_activeSlaves.empty() || !safetyCounter.ok() ) return possibleSlaves;
+// if( !isRecursion ) {
+// ///Test the cache
+// SlavesCache::const_iterator it = m_slavesCache.find( files );
+// if( it != m_slavesCache.end() && it->second.first == m_slavesCache.size() ) return; ///The cache already contains a valid entry, and the work is done
+// }
+
+ m_activeSlaveGroups.findGroups( files, possibleSlaves );
+ if( possibleSlaves.empty() ) return possibleSlaves;
+
+ std::list<size_t> disabled;
+ for( std::set<size_t>::const_reverse_iterator it = possibleSlaves.rbegin(); it != possibleSlaves.rend(); ++it ) {
+ //Disable all slaves with higher ids
+ SlaveMap::iterator current = m_activeSlaves.find( *it );
+ if( current == m_activeSlaves.end() ) {
+ kdDebug( 9007 ) << "ERROR" << endl;
+ }
+
+ SlaveDesc& d( current->second );
+
+ if ( !d.first.first.resolved() ) {
+ for( SlaveMap::const_iterator itr = current; itr != m_activeSlaves.end(); ++it ) {
+ if( m_activeSlaveGroups.isDisabled( itr->first ) ) break; //stop searching when hitting the first disabled one(assuming that all behind are disabled too)
+ disabled.push_back( itr->first );
+ m_activeSlaveGroups.disableSet( itr->first );
+ }
+
+ TypeDesc descS = d.first.first;
+ TypePointer p = d.second; //perspective
+
+ HashedStringSet importIncludeFiles = d.first.second;
+
+ if ( !p ) p = this;
+
+ TypeDesc desc = p->locateDecType( descS, SimpleTypeImpl::Normal, 0, SimpleTypeImpl::MemberInfo::Namespace );
+ if ( !desc.resolved() ) {
+ ///If the namespace could not be found, help out by including the include-files of the current search
+ descS.setIncludeFiles( descS.includeFiles() + files );
+ desc = p->locateDecType( descS, SimpleTypeImpl::Normal, 0, SimpleTypeImpl::MemberInfo::Namespace );
+ }
+ if ( desc.resolved() ) {
+ ///If exactly the same namespace was already imported use the earlier imported instance, so they can share a single cache
+ ///@todo make more efficient.
+ for ( SlaveMap::const_iterator it = m_activeSlaves.begin(); it != m_activeSlaves.end(); ++it ) {
+ if (( *it ).second.first.first.resolved() && ( *it ).second.first.first.resolved()->scope() == desc.resolved()->scope() && typeid( *( *it ).second.first.first.resolved().data() ) == typeid( desc.resolved().data() ) ) {
+ desc.setResolved(( *it ).second.first.first.resolved() );
+ break;
+ }
+ }
+#ifdef PHYSICALLY_IMPORT_NAMESPACES
+ if ( desc.resolved()->masterProxy().data() != this ) {
+ desc.setResolved( desc.resolved()->clone() ); //expensive, cache is not shared
+ desc.resolved()->setMasterProxy( this ); //Possible solution: don't use this, simply set the parents of all found members correctly
+ }
+#endif
+ d.first.first = desc;
+ }
+ }
+ }
+
+ for( std::list<size_t>::const_iterator it = disabled.begin(); it != disabled.end(); ++it ) {
+ m_activeSlaveGroups.enableSet( *it );
+ }
+
+ return possibleSlaves;
+}
+
+
+void SimpleTypeNamespace::addAliases( QString map, const IncludeFiles& files ) {
+ while ( !map.isEmpty() ) {
+ int mid = map.find( "=" );
+ int mid2 = map.find( "<<" );
+ int found = mid;
+ int len = 1;
+ if ( mid2 != -1 && ( mid2 < found || found == -1 ) ) {
+ found = mid2;
+ len = 2;
+ }
+ if ( found == -1 )
+ break;
+
+ int end = map.find( ";", found + len );
+ if ( end == -1 ) {
+ //break;
+ end = map.length();
+ }
+ if ( end - ( found + len ) < 0 )
+ break;
+
+ addAliasMap( map.left( found ).stripWhiteSpace(), map.mid( found + len, end - found - len ).stripWhiteSpace(), files, true, found == mid );
+ map = map.mid( end + 1 );
+ }
+}
+
+void SimpleTypeNamespace::invalidatePrimaryCache( bool onlyNegative ) {
+ //m_slavesCache.clear();
+ SimpleTypeImpl::invalidatePrimaryCache( onlyNegative );
+}
+
+void SimpleTypeNamespace::addImport( const TypeDesc& import, const IncludeFiles& files, TypePointer perspective ) {
+ //ifVerbose( dbg() << "
+ if ( !perspective ) perspective = this;
+ invalidateCache();
+ TypeDesc d = import;
+ if ( d.resolved() ) {
+ #ifdef PHYSICALLY_IMPORT_NAMESPACES
+
+ if( d.resolved()->masterProxy().data() != this ) {
+ d.setResolved( d.resolved()->clone() ); //Expensive because of lost caching, think about how necessary this is
+ d.resolved()->setMasterProxy( this );
+ }
+ #endif
+ }
+
+ m_activeSlaves[ ++m_currentSlaveId ] = std::make_pair( std::make_pair( d, files ) , perspective );
+ m_activeSlaveGroups.addSet( m_currentSlaveId, files );
+
+ if( d.resolved() ) ///Must be called after the above, because it may insert new slaves, and the order in m_activeSlaves MUST be preserved
+ d.resolved()->addAliasesTo( this );
+}
+
+bool SimpleTypeNamespace::hasNode() const {
+ return true;
+}
+
+SimpleTypeNamespace::SlaveList SimpleTypeNamespace::getSlaves( const IncludeFiles& files ) {
+ /* ///Test the cache
+ SlavesCache::const_iterator it = m_slavesCache.find( files );
+ if( it != m_slavesCache.end() && it->second.first == m_activeSlaves.size() ) return it->second.second; ///The cache already contains a valid entry, and the work is done*/
+
+ std::set<size_t> allSlaves = updateAliases( files );
+ SlaveList ret;
+#ifdef IMPORT_DEBUG
+ for ( SlaveList::const_iterator it = m_activeSlaves.begin(); it != m_activeSlaves.end(); ++it ) {
+#ifdef IMPORT_DEBUG
+ ifVerbose( dbg() << "\"" << str() << "\": Checking whether \"" << (*it).second.first.first.fullNameChain() << "\" should be imported, current include-files: " << files.print().c_str() << "\nNeeded include-files: " << (*it).second.first.second.print().c_str() << "\n"; )
+#endif
+ if ( !(( *it ).second.first.second <= files ) ) {
+#ifdef IMPORT_DEBUG
+ ifVerbose( dbg() << "not imported." );
+#endif
+ continue;
+ }
+#ifdef IMPORT_DEBUG
+ ifVerbose( dbg() << "imported." << endl );
+#endif
+ ret.push_back( *it.second );
+ }
+#else
+ ifVerbose( dbg() << str() << " getSlaves() called for \n[ " << files.print().c_str() << endl );
+
+ for( std::set<size_t>::const_iterator it = allSlaves.begin(); it != allSlaves.end(); ++it ) {
+ SlaveMap::const_iterator itr = m_activeSlaves.find( *it );
+ if( itr != m_activeSlaves.end() ) {
+ ifVerbose( dbg() << str() << "getSlaves() returning " << (*itr).second.first.first.fullNameChain() << endl );
+ ret.push_back( (*itr).second );
+ } else {
+ kdDebug( 9007 ) << "ERROR in getSlaves()";
+ }
+ }
+#endif
+ /*if( it == m_slavesCache.end() || it->second.first < m_activeSlaves.size()
+ ) {
+ m_slavesCache.insert( std::make_pair( files, std::make_pair( m_activeSlaves.size(), ret ) ) );
+ }*/
+ return ret;
+}
+
+//SimpleTypeNamespace::NamespaceBuildInfo implementation
+
+TypePointer SimpleTypeNamespace::NamespaceBuildInfo::build() {
+ if ( m_built )
+ return m_built;
+ m_built = new SimpleTypeCachedNamespace( m_fakeScope );
+ for ( ImportList::iterator it = m_imports.begin(); it != m_imports.end(); ++it ) {
+ TypeDesc i = ( *it ).import;
+ if ( i.resolved() ) {
+ // i.setResolved( i.resolved()->clone() );
+ }
+
+ (( SimpleTypeCachedNamespace* ) m_built.data() ) ->addAliasMap( TypeDesc(), i, ( *it ).files, true, false, ( *it ).perspective );
+ }
+ return m_built;
+}
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/simpletypenamespace.h b/languages/cpp/simpletypenamespace.h
new file mode 100644
index 00000000..169c4548
--- /dev/null
+++ b/languages/cpp/simpletypenamespace.h
@@ -0,0 +1,165 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 SIMPLETYPENAMESPACE_H
+#define SIMPLETYPENAMESPACE_H
+
+#include<hashedstring.h>
+#include "simpletype.h"
+#include "includefiles.h"
+#include <set>
+#include <ext/hash_map>
+#include <list>
+
+class SimpleTypeNamespace : public SimpleTypeImpl {
+ public:
+
+ struct Import {
+ Import( const TypeDesc& _import, const TypePointer& persp ) : import( _import ), perspective( persp ) {}
+
+ Import( const IncludeFiles& _files, const TypeDesc& _import, const TypePointer& persp ) : files( _files ), import( _import ), perspective( persp ) {}
+
+ ///Does not respect the include-file-list, only the import-name is compared
+ bool operator < ( const Import& rhs ) const {
+ return import.name() < rhs.import.name();
+ }
+
+ ///Does not respect the include-file-list, only the import-name is compared
+ bool operator == ( const Import& rhs ) const {
+ return import.name() == rhs.import.name();
+ }
+
+ IncludeFiles files;
+ TypeDesc import;
+ TypePointer perspective; //From where the import should be searched
+ /*
+ bool operator < ( const Alias& rhs ) const {
+ if( alias < rhs.alias ) return true;
+ return false;
+ }
+
+ bool operator == ( const Alias& rhs ) const {
+ return alias == rhs.alias && files == rhs.files;
+ }*/
+
+ };
+
+ //First.first is the desc(including include-file-information for searching), first.second is the set of include-files that activate this import, second is the perspective in which to search
+ typedef std::pair<std::pair<TypeDesc, IncludeFiles>, TypePointer> SlaveDesc;
+ typedef std::list<SlaveDesc> SlaveList;
+ //Maps IDs to slaves
+ typedef std::map<size_t, SlaveDesc> SlaveMap;
+
+ typedef std::multiset<Import> ImportList;
+
+ SimpleTypeNamespace( const QStringList& fakeScope, const QStringList& realScope );
+
+ SimpleTypeNamespace( const QStringList& fakeScope );
+
+ SimpleTypeNamespace( SimpleTypeNamespace* ns );
+
+ bool isANamespace( SimpleTypeImpl* t ) {
+ return dynamic_cast<SimpleTypeNamespace*>( t ) != 0;
+ }
+
+ virtual TypePointer clone();
+
+ ///Returns a list of all slave-namespaces that have an effect with the given set of include-files. Some of the returned type-descs may be unresolved, in case they could not be resolved.
+ SlaveList getSlaves( const IncludeFiles& includeFiles );
+
+ /**empty name means an import.
+ * @param files Set of files that must be included for this alias-map to be active. If the set is empty, the alias will be used globally.
+ * @param alias The type to import. May contain the include-file-set to search with.
+ * @param perspective The point from which to search for the item on demand
+ */
+ void addAliasMap( const TypeDesc& name, const TypeDesc& alias , const IncludeFiles& files = IncludeFiles(), bool recurse = true, bool symmetric = false, const TypePointer& perspective = TypePointer() );
+
+ /**Takes a map of multiple aliases in form "A=B;C=D;....;" similar to the C++ "namespace A=B;" statement
+ * @param files Set of files that must be included for this alias-map to be active. If the set is empty, the alias will be used globally.
+ */
+ void addAliases( QString map, const IncludeFiles& files = IncludeFiles() );
+
+ private:
+ SlaveMap m_activeSlaves;
+ size_t m_currentSlaveId;
+ HashedStringSetGroup m_activeSlaveGroups;
+ typedef QMap<QString, ImportList> AliasMap;
+ AliasMap m_aliases;
+
+ //Inserts all aliases necessary fo handling a request using the given IncludeFiles
+ std::set<size_t> updateAliases( const IncludeFiles& files/*, bool isRecursion = false */);
+
+// LocateResult locateSlave( const SlaveList::const_iterator& it, const IncludeFiles& includeFiles );
+
+ void addImport( const TypeDesc& import, const IncludeFiles& files = IncludeFiles(), TypePointer perspective = TypePointer() );
+
+ friend class NamespaceBuildInfo;
+
+ struct NamespaceBuildInfo : public TypeBuildInfo {
+ QStringList m_fakeScope;
+ ImportList m_imports;
+ TypePointer m_built;
+
+
+ NamespaceBuildInfo( QStringList fakeScope, const ImportList& imports ) {
+ m_fakeScope = fakeScope;
+ m_imports = imports;
+ }
+
+ virtual TypePointer build();
+ };
+
+ explicit SimpleTypeNamespace( const SimpleTypeNamespace& rhs ) {}
+
+ protected:
+
+ //void updateAliases( const HashedStringSet& files );
+
+ SimpleTypeImpl::MemberInfo findMember( TypeDesc name, MemberInfo::MemberType type, std::set<HashedString>& ignore );
+
+ virtual void breakReferences();
+
+ virtual bool hasNode() const;
+
+ virtual bool isNamespace() const {
+ return true;
+ }
+
+ virtual void invalidatePrimaryCache( bool onlyNegative = false );
+
+ virtual MemberInfo findMember( TypeDesc name, MemberInfo::MemberType type = MemberInfo::AllTypes );
+
+ virtual QValueList<TypePointer> getMemberClasses( const TypeDesc& name ) ;
+
+ private:
+ struct HashedStringHasher {
+ size_t operator () ( const HashedStringSet& s ) const {
+ return s.hash();
+ }
+ };
+ //Maps from HashedStringSet to the count of slaves when the item was cached, and the SlaveList
+// typedef __gnu_cxx::hash_map<HashedStringSet, std::pair<size_t, SlaveList>, HashedStringHasher> SlavesCache;
+ //SlavesCache m_slavesCache;
+ QValueList<TypePointer> getMemberClasses( const TypeDesc& name, std::set<HashedString>& ignore ) ;
+
+ MemberInfo setupMemberInfo( const QStringList& subName, const ImportList& imports );
+
+ //TypePointer locateNamespace( const TypeDesc& alias );
+
+ //void recurseAliasMap() ;
+};
+
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/store_walker.cpp b/languages/cpp/store_walker.cpp
new file mode 100644
index 00000000..cd66dd23
--- /dev/null
+++ b/languages/cpp/store_walker.cpp
@@ -0,0 +1,1081 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "store_walker.h"
+#include "ast_utils.h"
+#include "urlutil.h"
+#include "driver.h"
+
+#include <kdebug.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+
+StoreWalker::StoreWalker( const QString& fileName, CodeModel* store )
+: m_store( store ), m_anon( 0 )
+{
+ m_fileName = URLUtil::canonicalPath( fileName );
+ m_hashedFileName = HashedString( m_fileName );
+
+ //kdDebug(9007) << "StoreWalker::StoreWalker(" << m_fileName << ")" << endl;
+}
+
+StoreWalker::~StoreWalker()
+{}
+
+
+void StoreWalker::parseTranslationUnit( const ParsedFile& ast )
+{
+ m_file = m_store->create<FileModel>();
+ m_file->setName( m_fileName ); /// @todo ?!?
+
+ m_currentScope.clear();
+ m_currentNamespace.clear();
+ m_currentClass.clear();
+
+ ParsedFilePointer p = new ParsedFile( ast );
+ p->setTranslationUnit( 0 ); //Necessary so the memory is not bloated after the first parse
+ m_file->setParseResult( p.data() ); ///@todo beautify
+
+ m_currentAccess = CodeModelItem::Public;
+ m_inSlots = false;
+ m_inSignals = false;
+ m_inStorageSpec = false;
+ m_inTypedef = false;
+ m_currentDeclarator = 0;
+ m_anon = 0;
+ m_imports.clear();
+
+ m_imports << QPair<QMap<QString, ClassDom>, QStringList>(QMap<QString, ClassDom>(), QStringList());
+ TreeParser::parseTranslationUnit( ast );
+ m_imports.pop_back();
+}
+
+void StoreWalker::parseDeclaration( DeclarationAST* ast )
+{
+ TreeParser::parseDeclaration( ast );
+}
+
+void StoreWalker::parseLinkageSpecification( LinkageSpecificationAST* ast )
+{
+ int inStorageSpec = m_inStorageSpec;
+ m_inStorageSpec = true;
+ TreeParser::parseLinkageSpecification( ast );
+ m_inStorageSpec = inStorageSpec;
+}
+
+void StoreWalker::parseNamespace( NamespaceAST* ast )
+{
+ if ( !m_currentClass.isEmpty() )
+ {
+ kdDebug( 9007 ) << "!!!!!!!!!!!!!!!!!!!!!!!!!! **error** !!!!!!!!!!!!!!!!!!!!" << endl;
+ return ;
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ QString nsName;
+ if ( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() )
+ {
+ QFileInfo fileInfo( m_fileName );
+ QString shortFileName = fileInfo.baseName();
+
+ nsName.sprintf( "(%s_%d)", shortFileName.local8Bit().data(), m_anon++ );
+ }
+ else
+ {
+ nsName = ast->namespaceName() ->text();
+ }
+
+ NamespaceDom ns = findOrInsertNamespace( ast, nsName );
+
+ m_currentScope.push_back( nsName );
+ m_currentNamespace.push( ns );
+
+ TreeParser::parseNamespace( ast );
+
+ m_currentNamespace.pop();
+ m_currentScope.pop_back();
+}
+
+void StoreWalker::parseNamespaceAlias( NamespaceAliasAST* ast )
+{
+ QString nsName;
+ QString aliasName;
+
+ if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() )
+ {
+ // anonymous namespace
+ }
+ else
+ nsName = ast->namespaceName()->text();
+
+ if( ast->aliasName() )
+ aliasName = ast->aliasName()->text();
+
+
+ if( !nsName.isNull() ) {
+ NamespaceAliasModel m;
+ m.setName( nsName );
+ m.setAliasName( aliasName );
+ m.setFileName( m_hashedFileName );
+ if( m_currentNamespace.empty() )
+ m_file->addNamespaceAlias( m );
+ else
+ m_currentNamespace.top() ->addNamespaceAlias( m );
+ }
+
+ TreeParser::parseNamespaceAlias( ast );
+}
+
+void StoreWalker::parseUsing( UsingAST* ast )
+{
+ TreeParser::parseUsing( ast );
+}
+
+void StoreWalker::parseUsingDirective( UsingDirectiveAST* ast )
+{
+ QString name;
+ if( ast->name() )
+ name = ast->name()->text();
+
+ if( !name.isNull() ) {
+ NamespaceImportModel m;
+ m.setName( name );
+ m.setFileName( m_hashedFileName );
+ if( m_currentNamespace.empty() )
+ m_file->addNamespaceImport( m );
+ else
+ m_currentNamespace.top() ->addNamespaceImport( m );
+ }
+
+ m_imports.back().second.push_back( name );
+}
+
+void StoreWalker::parseTypedef( TypedefAST* ast )
+{
+#if 0
+ DeclaratorAST * oldDeclarator = m_currentDeclarator;
+
+ if ( ast && ast->initDeclaratorList() && ast->initDeclaratorList() ->initDeclaratorList().count() > 0 )
+ {
+ QPtrList<InitDeclaratorAST> lst( ast->initDeclaratorList() ->initDeclaratorList() );
+ m_currentDeclarator = lst.at( 0 ) ->declarator();
+ }
+
+ m_inTypedef = true;
+
+ TreeParser::parseTypedef( ast );
+
+ m_inTypedef = false;
+ m_currentDeclarator = oldDeclarator;
+#else
+
+ TypeSpecifierAST* typeSpec = ast->typeSpec();
+ InitDeclaratorListAST* declarators = ast->initDeclaratorList();
+
+ if ( typeSpec && declarators )
+ {
+ QString typeId;
+
+ if ( typeSpec->name() )
+ typeId = typeSpec->name() ->text();
+
+ QPtrList<InitDeclaratorAST> l( declarators->initDeclaratorList() );
+ QPtrListIterator<InitDeclaratorAST> it( l );
+
+ InitDeclaratorAST* initDecl = 0;
+ while ( 0 != ( initDecl = it.current() ) )
+ {
+
+ QString type, id;
+ if ( initDecl->declarator() )
+ {
+ type = typeOfDeclaration( typeSpec, initDecl->declarator() );
+
+ DeclaratorAST* d = initDecl->declarator();
+ while ( d->subDeclarator() )
+ {
+ d = d->subDeclarator();
+ }
+
+ if ( d->declaratorId() )
+ id = d->declaratorId() ->text();
+ }
+
+ TypeAliasDom typeAlias = m_store->create<TypeAliasModel>();
+ typeAlias->setFileName( m_fileName );
+ typeAlias->setName( id );
+ typeAlias->setType( type );
+ typeAlias->setComment( ast->comment() );
+
+ int line, col;
+ initDecl->getStartPosition( &line, &col );
+ typeAlias->setStartPosition( line, col );
+
+ initDecl->getEndPosition( &line, &col );
+ typeAlias->setEndPosition( line, col );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addTypeAlias( typeAlias );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addTypeAlias( typeAlias );
+ else
+ m_file->addTypeAlias( typeAlias );
+
+#if 0
+
+ Tag tag;
+ tag.setKind( Tag::Kind_Typedef );
+ tag.setFileName( m_fileName );
+ tag.setName( id );
+ tag.setScope( m_currentScope );
+ tag.setAttribute( "t", type );
+ int line, col;
+ initDecl->getStartPosition( &line, &col );
+
+ tag.setStartPosition( line, col );
+
+ initDecl->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+#endif
+
+ ++it;
+ }
+
+ }
+#endif
+}
+
+void StoreWalker::parseTemplateDeclaration( TemplateDeclarationAST* ast )
+{
+ m_currentTemplateDeclarator.push( ast );
+ if ( ast->declaration() )
+ parseDeclaration( ast->declaration() );
+
+
+
+ TreeParser::parseTemplateDeclaration( ast );
+
+ m_currentTemplateDeclarator.pop();
+}
+
+void StoreWalker::parseSimpleDeclaration( SimpleDeclarationAST* ast )
+{
+ TypeSpecifierAST * typeSpec = ast->typeSpec();
+ InitDeclaratorListAST* declarators = ast->initDeclaratorList();
+ CommentPusher push( *this, ast->comment() );
+
+ if ( typeSpec )
+ parseTypeSpecifier( typeSpec );
+
+ if ( declarators )
+ {
+ QPtrList<InitDeclaratorAST> l = declarators->initDeclaratorList();
+
+ QPtrListIterator<InitDeclaratorAST> it( l );
+ while ( it.current() )
+ {
+ parseDeclaration( ast->functionSpecifier(), ast->storageSpecifier(),
+ typeSpec, it.current() );
+ ++it;
+ }
+ }
+}
+
+
+QStringList StoreWalker::findScope( const QStringList& scope ) {
+ ClassDom d = findClassFromScope( scope );
+
+ if( d ) {
+ QStringList ret = d->scope();
+ ret << d->name();
+ return ret;
+ }
+
+ return scope;
+}
+
+
+void StoreWalker::parseFunctionDefinition( FunctionDefinitionAST* ast )
+{
+ TypeSpecifierAST * typeSpec = ast->typeSpec();
+ GroupAST* funSpec = ast->functionSpecifier();
+ GroupAST* storageSpec = ast->storageSpecifier();
+
+ if ( !ast->initDeclarator() )
+ return ;
+
+ DeclaratorAST* d = ast->initDeclarator() ->declarator();
+
+ if ( !d->declaratorId() )
+ return ;
+
+ bool isFriend = false;
+ bool isVirtual = false;
+ bool isStatic = false;
+ bool isInline = false;
+
+ if ( funSpec )
+ {
+ QPtrList<AST> l = funSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "virtual" )
+ isVirtual = true;
+ else if ( text == "inline" )
+ isInline = true;
+ ++it;
+ }
+ }
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ QString id = d->declaratorId() ->unqualifiedName() ->text().stripWhiteSpace();
+
+ QStringList scope = scopeOfDeclarator( d, m_currentScope );
+ ClassDom c; ///c should be nonzero if it is a function-definition for a function within another class
+ if( !m_currentClass.top() ) {
+ ///It is not a local definition within a class, so search the scope so it can be corrected using imports
+ c = findClassFromScope( scope );
+ }
+
+ if( c ) {
+ scope = c->scope();
+ scope << c->name();
+ }
+
+ FunctionDefinitionDom method = m_store->create<FunctionDefinitionModel>();
+ method->setScope( scope );
+ method->setName( id );
+
+ parseFunctionArguments( d, model_cast<FunctionDom>( method ) );
+
+ QString text = typeOfDeclaration( typeSpec, d );
+ if ( !text.isEmpty() )
+ method->setResultType( text );
+
+ method->setFileName( m_fileName );
+ method->setStartPosition( startLine, startColumn );
+ method->setEndPosition( endLine, endColumn );
+ if( !ast->comment().isEmpty() )
+ method->setComment( ast->comment() );
+
+ checkTemplateDeclarator( & (*method) );
+
+ if ( m_inSignals )
+ method->setSignal( true );
+
+ if ( m_inSlots )
+ method->setSlot( true );
+
+ if( c && c->isClass() )
+ method->setConstant( d->constant() != 0 );
+ else if ( m_currentClass.top() || ( method->name() == "main" && scope.isEmpty() ) )
+ {
+ method->setConstant( d->constant() != 0 );
+ method->setAccess( m_currentAccess );
+ method->setStatic( isStatic );
+ method->setVirtual( isVirtual );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addFunction( model_cast<FunctionDom>( method ) );
+ else
+ m_file->addFunction( model_cast<FunctionDom>( method ) );
+ }
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addFunctionDefinition( method );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addFunctionDefinition( method );
+ else
+ m_file->addFunctionDefinition( method );
+}
+
+void StoreWalker::parseLinkageBody( LinkageBodyAST* ast )
+{
+ TreeParser::parseLinkageBody( ast );
+}
+
+void StoreWalker::parseTypeSpecifier( TypeSpecifierAST* ast )
+{
+ TreeParser::parseTypeSpecifier( ast );
+}
+
+void StoreWalker::takeTemplateParams( TemplateModelItem& target, TemplateDeclarationAST* ast) {
+ TemplateParameterListAST* pl = ast->templateParameterList();
+ if( pl ) {
+ QPtrList<TemplateParameterAST> list = pl->templateParameterList();
+
+ TemplateParameterAST* curr = list.first();
+ while( curr != 0 ) {
+ QString a, b;
+ if( curr->typeParameter() && curr->typeParameter()->name() ) {
+ a = curr->typeParameter()->name()->text();
+ if( curr->typeParameter()->typeId() )
+ b = curr->typeParameter()->typeId()->text();
+ }
+
+ target.addTemplateParam( a, b );
+ CodeModelItem* cmi = dynamic_cast<CodeModelItem*>(&target);
+ QString nm = "0";
+ if(cmi) nm = cmi->name();
+ kdDebug() << "item " << nm << " taking template-parameters " << a << ", default=" << b << "\n";
+ curr = list.next();
+ }
+ }
+}
+
+void StoreWalker::checkTemplateDeclarator( TemplateModelItem* item ) {
+ if( !m_currentTemplateDeclarator.empty() && m_currentTemplateDeclarator.top() != 0) {
+ TemplateDeclarationAST* a = m_currentTemplateDeclarator.top();
+
+ m_currentTemplateDeclarator.pop();
+ m_currentTemplateDeclarator.push(0);
+
+ takeTemplateParams( *item, a );
+ }
+}
+
+int StoreWalker::mergeGroups( int g1, int g2 ) {
+ int ng = m_store->mergeGroups( g1, g2 );
+ for( QMap<QString, FileDom>::iterator it = m_overrides.begin(); it != m_overrides.end(); ++it ) {
+ int g =(*it)->groupId();
+ if( g == g1 || g == g2 )
+ (*it)->setGroupId( ng );
+ }
+ return ng;
+}
+
+void StoreWalker::parseClassSpecifier( ClassSpecifierAST* ast )
+{
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ int oldAccess = m_currentAccess;
+ bool oldInSlots = m_inSlots;
+ bool oldInSignals = m_inSignals;
+
+ QString kind = ast->classKey() ->text();
+ if ( kind == "class" )
+ m_currentAccess = CodeModelItem::Private;
+ else
+ m_currentAccess = CodeModelItem::Public;
+ m_inSlots = false;
+ m_inSignals = false;
+
+ QString className;
+ if ( !ast->name() && m_currentDeclarator && m_currentDeclarator->declaratorId() )
+ {
+ className = m_currentDeclarator->declaratorId() ->text().stripWhiteSpace();
+ }
+ else if ( !ast->name() )
+ {
+ QFileInfo fileInfo( m_fileName );
+ QString shortFileName = fileInfo.baseName();
+ className.sprintf( "(%s_%d)", shortFileName.local8Bit().data(), m_anon++ );
+ }
+ else
+ {
+ className = ast->name() ->unqualifiedName() ->text().stripWhiteSpace();
+ }
+
+ ClassDom klass = m_store->create<ClassModel>();
+ klass->setStartPosition( startLine, startColumn );
+ klass->setEndPosition( endLine, endColumn );
+ klass->setFileName( m_fileName );
+
+ int i = className.find( '<' );
+ if( i != -1 ) {
+ klass->setSpecializationDeclaration( className.mid( i ) );
+ className = className.left( i );
+ }
+
+ klass->setName( className );
+ klass->setComment( ast->comment() );
+
+ checkTemplateDeclarator( &(*klass) );
+
+ bool embed = !scopeOfName( ast->name(), QStringList() ).isEmpty();
+
+ QStringList oldScope;
+
+
+ if( embed ) {
+ ClassDom embedderClass = findClassFromScope( m_currentScope + scopeOfName( ast->name(), QStringList() ));
+
+ if(embedderClass) {
+ if(embedderClass->fileName() != klass->fileName()) {
+ ///since we are creating a link between both files, put them into the same parsing-group
+ FileDom dm = embedderClass->file();
+ if( dm ) {
+ m_file->setGroupId( mergeGroups( dm->groupId(), m_file->groupId() ) );
+ }else{
+ kdDebug() << "file " << embedderClass->fileName() << " missing in store \n";
+ }
+ }
+
+ oldScope = m_currentScope;
+ m_currentScope = embedderClass->scope();
+ m_currentScope.push_back( embedderClass->name() );
+ m_currentClass.push( embedderClass );
+
+ //m_file->addClass( klass );//experiment
+ }else{
+ kdDebug( 9007 ) << "could not find embedding class " << QStringList(m_currentScope + scopeOfName( ast->name(), QStringList() )).join("::") << " for " << className << endl;
+ embed = false;
+ }
+ }
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addClass( klass );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addClass( klass );
+ else
+ m_file->addClass( klass );
+
+ klass->setScope( m_currentScope );
+
+
+ if ( ast->baseClause() )
+ parseBaseClause( ast->baseClause(), klass );
+
+ m_currentScope.push_back( className );
+ m_currentClass.push( klass );
+
+ //m_imports.push_back( QStringList() );
+
+ TreeParser::parseClassSpecifier( ast );
+
+
+ //m_imports.pop_back();
+ m_currentClass.pop();
+
+ m_currentScope.pop_back();
+
+ if( embed ) {
+ m_currentScope = oldScope;
+ m_currentClass.pop();
+ }
+
+ m_currentAccess = oldAccess;
+ m_inSlots = oldInSlots;
+ m_inSignals = oldInSignals;
+}
+
+void StoreWalker::parseEnumSpecifier( EnumSpecifierAST* ast )
+{
+ if( ast->name() ) {
+ TypeAliasDom typeAlias = m_store->create<TypeAliasModel>();
+ typeAlias->setFileName( m_fileName );
+ typeAlias->setName( ast->name()->text() );
+ typeAlias->setType( "const int" );
+ typeAlias->setComment( ast->comment() );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ typeAlias->setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ typeAlias->setEndPosition( line, col );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addTypeAlias( typeAlias );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addTypeAlias( typeAlias );
+ else
+ m_file->addTypeAlias( typeAlias );
+ }
+
+ QPtrList<EnumeratorAST> l = ast->enumeratorList();
+ QPtrListIterator<EnumeratorAST> it( l );
+ while ( it.current() )
+ {
+ VariableDom attr = m_store->create<VariableModel>();
+ attr->setName( it.current() ->id() ->text() );
+ attr->setFileName( m_fileName );
+ attr->setAccess( m_currentAccess );
+
+ if( !ast->name() ) {
+ attr->setType( "const int" );
+ } else {
+ attr->setType( ast->name()->text() );
+ }
+
+ attr->setEnumeratorVariable( true );
+
+ attr->setComment( (*it)->comment() );
+ attr->setStatic( true );
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ it.current() ->getStartPosition( &startLine, &startColumn );
+ attr->setStartPosition( startLine, startColumn );
+
+ it.current() ->getEndPosition( &endLine, &endColumn );
+ attr->setEndPosition( endLine, endColumn );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addVariable( attr );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addVariable( attr );
+ else
+ m_file->addVariable( attr );
+
+ ++it;
+ }
+}
+
+void StoreWalker::parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* ast )
+{
+ TreeParser::parseElaboratedTypeSpecifier( ast );
+}
+
+void StoreWalker::parseTypeDeclaratation( TypeSpecifierAST* typeSpec )
+{
+ parseTypeSpecifier( typeSpec );
+}
+
+void StoreWalker::parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec,
+ TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl )
+{
+ if ( m_inStorageSpec )
+ return ;
+
+ DeclaratorAST* d = decl->declarator();
+
+ if ( !d )
+ return ;
+
+ if ( !d->subDeclarator() && d->parameterDeclarationClause() )
+ return parseFunctionDeclaration( funSpec, storageSpec, typeSpec, decl );
+
+ DeclaratorAST* t = d;
+ while ( t && t->subDeclarator() )
+ t = t->subDeclarator();
+
+ QString id;
+ if ( t && t->declaratorId() && t->declaratorId() ->unqualifiedName() )
+ id = t->declaratorId() ->unqualifiedName() ->text();
+
+ if ( !scopeOfDeclarator( d, QStringList() ).isEmpty() )
+ {
+ kdDebug( 9007 ) << "skip declaration of " << QStringList(scopeOfDeclarator( d, QStringList() )).join("::") << "::" << id << endl;
+ return ;
+ }
+
+ VariableDom attr = m_store->create<VariableModel>();
+ attr->setName( id );
+ attr->setFileName( m_fileName );
+ attr->setComment( comment() );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addVariable( attr );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addVariable( attr );
+ else
+ m_file->addVariable( attr );
+
+ attr->setAccess( m_currentAccess );
+
+ QString text = typeOfDeclaration( typeSpec, d );
+ if ( !text.isEmpty() ) {
+ attr->setType( text );
+ }
+
+ bool isFriend = false;
+ //bool isVirtual = false;
+ bool isStatic = false;
+ //bool isInline = false;
+ //bool isInitialized = decl->initializer() != 0;
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ decl->getStartPosition( &startLine, &startColumn );
+ decl->getEndPosition( &endLine, &endColumn );
+
+ attr->setStartPosition( startLine, startColumn );
+ attr->setEndPosition( endLine, endColumn );
+ attr->setStatic( isStatic );
+}
+
+void StoreWalker::parseAccessDeclaration( AccessDeclarationAST * access )
+{
+ QPtrList<AST> l = access->accessList();
+
+ QString accessStr = l.at( 0 ) ->text();
+ if ( accessStr == "public" )
+ m_currentAccess = CodeModelItem::Public;
+ else if ( accessStr == "protected" )
+ m_currentAccess = CodeModelItem::Protected;
+ else if ( accessStr == "private" )
+ m_currentAccess = CodeModelItem::Private;
+ else if ( accessStr == "signals" )
+ m_currentAccess = CodeModelItem::Protected;
+ else
+ m_currentAccess = CodeModelItem::Public;
+
+ m_inSlots = l.count() > 1 ? l.at( 1 ) ->text() == "slots" : false;
+ m_inSignals = l.count() >= 1 ? l.at( 0 ) ->text() == "signals" : false;
+}
+
+NamespaceDom StoreWalker::findOrInsertNamespace( NamespaceAST* ast, const QString & name )
+{
+ if ( m_currentNamespace.top() && m_currentNamespace.top() ->hasNamespace( name ) )
+ return m_currentNamespace.top() ->namespaceByName( name );
+
+ if ( m_file->hasNamespace( name ) )
+ return m_file->namespaceByName( name );
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ NamespaceDom ns = m_store->create<NamespaceModel>();
+ ns->setFileName( m_fileName );
+ ns->setName( name );
+ ns->setStartPosition( startLine, startColumn );
+ ns->setEndPosition( endLine, endColumn );
+ ns->setComment( ast->comment() );
+
+ ns->setScope( m_currentScope );
+
+ if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addNamespace( ns );
+ else
+ m_file->addNamespace( ns );
+
+ return ns;
+}
+
+void StoreWalker::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageSpec,
+ TypeSpecifierAST * typeSpec, InitDeclaratorAST * decl )
+{
+ bool isFriend = false;
+ bool isVirtual = false;
+ bool isStatic = false;
+ bool isInline = false;
+ bool isPure = decl->initializer() != 0;
+
+ if ( funSpec )
+ {
+ QPtrList<AST> l = funSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "virtual" )
+ isVirtual = true;
+ else if ( text == "inline" )
+ isInline = true;
+ ++it;
+ }
+ }
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ decl->getStartPosition( &startLine, &startColumn );
+ decl->getEndPosition( &endLine, &endColumn );
+
+ DeclaratorAST* d = decl->declarator();
+ QString id = d->declaratorId() ->unqualifiedName() ->text();
+
+ FunctionDom method = m_store->create<FunctionModel>();
+ method->setName( id );
+
+ method->setComment( comment() );
+ method->setFileName( m_fileName );
+ method->setStartPosition( startLine, startColumn );
+ method->setEndPosition( endLine, endColumn );
+ method->setAccess( m_currentAccess );
+ method->setStatic( isStatic );
+ method->setVirtual( isVirtual );
+ method->setAbstract( isPure );
+ parseFunctionArguments( d, method );
+
+ checkTemplateDeclarator( & (*method) );
+
+
+ if ( m_inSignals )
+ method->setSignal( true );
+
+ if ( m_inSlots )
+ method->setSlot( true );
+
+ QString text = typeOfDeclaration( typeSpec, d );
+ if ( !text.isEmpty() )
+ method->setResultType( text );
+
+ method->setConstant( d->constant() != 0 );
+ method->setScope( scopeOfDeclarator( d, m_currentScope ) );
+
+ if ( m_currentClass.top() )
+ m_currentClass.top() ->addFunction( method );
+ else if ( m_currentNamespace.top() )
+ m_currentNamespace.top() ->addFunction( method );
+ else
+ m_file->addFunction( method );
+}
+
+void StoreWalker::parseFunctionArguments( DeclaratorAST* declarator, FunctionDom method )
+{
+ ParameterDeclarationClauseAST * clause = declarator->parameterDeclarationClause();
+
+ if ( clause && clause->parameterDeclarationList() )
+ {
+ ParameterDeclarationListAST * params = clause->parameterDeclarationList();
+ QPtrList<ParameterDeclarationAST> l( params->parameterList() );
+ QPtrListIterator<ParameterDeclarationAST> it( l );
+ while ( it.current() )
+ {
+ ParameterDeclarationAST * param = it.current();
+ ++it;
+
+ ArgumentDom arg = m_store->create<ArgumentModel>();
+
+ if ( param->declarator() )
+ {
+ QString text = declaratorToString( param->declarator(), QString::null, true );
+ if ( !text.isEmpty() )
+ arg->setName( text );
+ }
+
+ QString tp = typeOfDeclaration( param->typeSpec(), param->declarator() );
+ if ( !tp.isEmpty() )
+ arg->setType( tp );
+
+ method->addArgument( arg );
+ }
+ }
+}
+
+QString StoreWalker::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator )
+{
+ if ( !typeSpec || !declarator )
+ return QString::null;
+
+ QString text;
+
+ text += typeSpec->text();
+
+ QPtrList<AST> ptrOpList = declarator->ptrOpList();
+ for ( QPtrListIterator<AST> it( ptrOpList ); it.current(); ++it )
+ {
+ text += it.current() ->text();
+ }
+
+ for( int a = 0; a < declarator->arrayDimensionList().count(); a++ )
+ text += "*";
+
+
+ return text;
+}
+
+void StoreWalker::parseBaseClause( BaseClauseAST * baseClause, ClassDom klass )
+{
+ QPtrList<BaseSpecifierAST> l = baseClause->baseSpecifierList();
+ QPtrListIterator<BaseSpecifierAST> it( l );
+ while ( it.current() )
+ {
+ BaseSpecifierAST * baseSpecifier = it.current();
+
+ QString baseName;
+ if ( baseSpecifier->name() )
+ baseName = baseSpecifier->name() ->text();
+
+ klass->addBaseClass( baseName );
+
+ ++it;
+ }
+}
+
+QStringList StoreWalker::scopeOfName( NameAST* id, const QStringList& startScope )
+{
+ QStringList scope = startScope;
+ if ( id && id->classOrNamespaceNameList().count() )
+ {
+ if ( id->isGlobal() )
+ scope.clear();
+ QPtrList<ClassOrNamespaceNameAST> l = id->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> it( l );
+ while ( it.current() )
+ {
+ if ( it.current() ->name() )
+ {
+ scope << it.current() ->name() ->text();
+ }
+ ++it;
+ }
+ }
+
+ return scope;
+}
+
+
+///@todo respect the imports that result from the headers etc.
+ClassDom StoreWalker::findClassFromScope( const QStringList& scope )
+{
+ QString scopeText = scope.join("::");
+ if( !m_imports.isEmpty() ) {
+ QMapIterator<QString, ClassDom> it = m_imports.back().first.find( scopeText );
+ if( it != m_imports.back().first.end() ) {
+ return *it;
+ }
+ }
+
+ ClassDom c = classFromScope( scope );
+ if( c ) {
+ if( !m_imports.isEmpty() ) m_imports.back().first[ scopeText ] = c;
+ return c;
+ }
+
+ if(!m_imports.isEmpty() && !m_imports.back().second.isEmpty()) {
+ ///try the same using one of the imports(performance-wise this is not good, but simple)
+
+ QStringList::iterator it = m_imports.back().second.begin();
+ while(it != m_imports.back().second.end()) {
+ QStringList scp = QStringList::split("::", *it) + m_currentScope + scope;
+ c = classFromScope( scp );
+ if( c ) {
+ if( !m_imports.isEmpty() ) m_imports.back().first[ scopeText ] = c;
+ return c;
+ }
+ ++it;
+ }
+ }
+ return c;
+}
+
+ClassDom findScopeInFile( const QStringList& scope, NamespaceModel* glob ) {
+ if( !glob ) return ClassDom();
+
+ ClassModel* curr = glob ;
+
+ QStringList::const_iterator mit = scope.begin();
+
+ while(curr->isNamespace() && mit != scope.end() && ((NamespaceModel*)curr)->hasNamespace( *mit )) {
+ curr = &(*( ((NamespaceModel*)curr)->namespaceByName( *mit ) ));
+ ++mit;
+ }
+
+ while((curr->isNamespace() || curr->isClass()) && mit != scope.end() && curr->hasClass( *mit )) {
+ ClassList cl = curr->classByName( *mit );
+ curr = &(**cl.begin() );
+ ++mit;
+ }
+
+ if(mit == scope.end()) {
+ return curr;
+ } else {
+ return ClassDom(0);
+ }
+}
+
+ClassDom StoreWalker::classFromScope(const QStringList& scope) {
+ if(scope.isEmpty())return ClassDom(0);
+
+ //Since another instance of the current file may still be in the code-model this must be testede BEFORE the code-model
+ ClassDom c = findScopeInFile( scope, m_file.data() );
+ if( c ) return c;
+
+ NamespaceDom glob = m_store->globalNamespace();
+ if( !glob ) return ClassDom();
+ c = findScopeInFile( scope, glob );
+
+
+ QMap<QString, FileDom>::const_iterator it;
+
+ if( c ) {
+ ///Check the file that overrides the code-model file
+ it = m_overrides.find( c->fileName() );
+
+ //Find the class within the file that is overriding the one in code-model.
+ if( it != m_overrides.end() ) {
+ return findScopeInFile( scope, *it );
+ } else {
+ return c;
+ }
+ } else {
+ ///Search in all overrides, because they will be added later all at once
+ for( QMap<QString, FileDom>::const_iterator it = m_overrides.begin(); it != m_overrides.end(); ++it ) {
+ c = findScopeInFile( scope, *it );
+ if( c )
+ return c;
+ }
+ }
+
+ return ClassDom(0);
+}
+
+
+QStringList StoreWalker::scopeOfDeclarator( DeclaratorAST* d, const QStringList& startScope )
+{
+ return scopeOfName( d->declaratorId(), startScope );
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/store_walker.h b/languages/cpp/store_walker.h
new file mode 100644
index 00000000..488e692b
--- /dev/null
+++ b/languages/cpp/store_walker.h
@@ -0,0 +1,141 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef __store_walker_h
+#define __store_walker_h
+
+#include "tree_parser.h"
+#include <codemodel.h>
+#include <qstringlist.h>
+#include <qvaluestack.h>
+#include <hashedstring.h>
+
+class StoreWalker: public TreeParser
+{
+public:
+ StoreWalker( const QString& fileName, CodeModel* store );
+ virtual ~StoreWalker();
+
+ FileDom file()
+ {
+ return m_file;
+ }
+
+ // translation-unit
+ virtual void parseTranslationUnit( const ParsedFile& );
+
+ // declarations
+ virtual void parseDeclaration( DeclarationAST* );
+ virtual void parseLinkageSpecification( LinkageSpecificationAST* );
+ virtual void parseNamespace( NamespaceAST* );
+ virtual void parseNamespaceAlias( NamespaceAliasAST* );
+ virtual void parseUsing( UsingAST* );
+ virtual void parseUsingDirective( UsingDirectiveAST* );
+ virtual void parseTypedef( TypedefAST* );
+ virtual void parseTemplateDeclaration( TemplateDeclarationAST* );
+ virtual void parseSimpleDeclaration( SimpleDeclarationAST* );
+ virtual void parseFunctionDefinition( FunctionDefinitionAST* );
+ virtual void parseLinkageBody( LinkageBodyAST* );
+ virtual void parseAccessDeclaration( AccessDeclarationAST* );
+
+ void takeTemplateParams( TemplateModelItem& target, TemplateDeclarationAST*);
+
+ // type-specifier
+ virtual void parseTypeSpecifier( TypeSpecifierAST* );
+ virtual void parseClassSpecifier( ClassSpecifierAST* );
+ virtual void parseEnumSpecifier( EnumSpecifierAST* );
+ virtual void parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* );
+
+ virtual void parseTypeDeclaratation( TypeSpecifierAST* typeSpec );
+ virtual void parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl );
+ virtual void parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl );
+ virtual void parseFunctionArguments( DeclaratorAST* declarator, FunctionDom method );
+ virtual void parseBaseClause( BaseClauseAST* baseClause, ClassDom klass );
+
+private:
+ NamespaceDom findOrInsertNamespace( NamespaceAST* ast, const QString& name );
+ QString typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator );
+ QStringList scopeOfName( NameAST* id, const QStringList& scope );
+ QStringList scopeOfDeclarator( DeclaratorAST* d, const QStringList& scope );
+ ClassDom classFromScope(const QStringList& scope);
+ ClassDom findClassFromScope(const QStringList& scope);
+ void checkTemplateDeclarator( TemplateModelItem* item );
+private:
+
+ class CommentPusher {
+ StoreWalker& m_ref;
+ public:
+ CommentPusher( StoreWalker& ref, QString comment ) : m_ref( ref ) {
+ m_ref.pushComment( comment );
+ }
+ ~CommentPusher() {
+ m_ref.popComment();
+ }
+ };
+
+ QStringList m_comments;
+
+ QString comment() {
+ if( m_comments.isEmpty() ) {
+ return "";
+ } else {
+ return m_comments.front();
+ }
+ }
+
+ //Own implementation that also merges the groups of the overrides
+ int mergeGroups( int g1, int g2 );
+
+public:
+ void pushComment( QString comm ) {
+ m_comments.push_front( comm );
+ }
+
+ void popComment() {
+ m_comments.pop_front();
+ }
+
+ void setOverrides( const QMap<QString, FileDom>& overrides ) {
+ m_overrides = overrides;
+ }
+private:
+
+ QMap<QString, FileDom> m_overrides;
+
+ FileDom m_file;
+ QString m_fileName;
+ HashedString m_hashedFileName;
+ QStringList m_currentScope;
+ CodeModel* m_store;
+ QValueList<QPair<QMap<QString, ClassDom>, QStringList> > m_imports;
+ int m_currentAccess;
+ bool m_inSlots;
+ bool m_inSignals;
+ int m_anon;
+ bool m_inStorageSpec;
+ bool m_inTypedef;
+
+ DeclaratorAST* m_currentDeclarator;
+ QValueStack<TemplateDeclarationAST*> m_currentTemplateDeclarator;
+ QValueStack<NamespaceDom> m_currentNamespace;
+ QValueStack<ClassDom> m_currentClass;
+
+ QStringList findScope( const QStringList& scope );
+
+
+private:
+ StoreWalker( const StoreWalker& source );
+ void operator = ( const StoreWalker& source );
+};
+
+#endif // __store_walker_h
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/storeconverter.cpp b/languages/cpp/storeconverter.cpp
new file mode 100644
index 00000000..3569bdea
--- /dev/null
+++ b/languages/cpp/storeconverter.cpp
@@ -0,0 +1,149 @@
+/***************************************************************************
+* Copyright (C) 2003-2004 by Alexander Dymo *
+* adymo@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+#include "storeconverter.h"
+
+#include <qvaluelist.h>
+
+#include <kdebug.h>
+
+#include <kdevcoderepository.h>
+
+#include "cppcodecompletion.h"
+#include "codeinformationrepository.h"
+#include "cppsupportpart.h"
+
+StoreConverter::StoreConverter(CppSupportPart *part, CodeModel *model)
+:m_part(part), m_model(model)
+{
+}
+
+void StoreConverter::PCSClassToCodeModel(const QString &className, const QStringList &/*classScope*/)
+{
+ QValueList<Catalog*> catalogs = m_part->codeRepository()->registeredCatalogs();
+ for (QValueList<Catalog*>::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ Catalog *catalog = *it;
+ kdDebug() << "looking in catalog: " << catalog->dbName() << endl;
+
+ QValueList<Catalog::QueryArgument> args;
+ args << Catalog::QueryArgument( "kind", Tag::Kind_Class );
+ args << Catalog::QueryArgument( "name", className );
+ QValueList<Tag> tags = catalog->query(args);
+ for (QValueList<Tag>::iterator it = tags.begin(); it != tags.end(); ++it )
+ {
+ Tag& tag = *it;
+ kdDebug() << "TAG: " << tag.name() << " in file " << tag.fileName() << endl;
+ FileDom file;
+ bool addFile = false;
+ if (m_model->hasFile(tag.name()))
+ file = m_model->fileByName(tag.name());
+ else
+ {
+ file = m_model->create<FileModel>();
+ file->setName(tag.fileName());
+ addFile = true;
+ }
+ if (!file->hasClass(tag.name()))
+ parseClass(tag, file);
+ if (addFile) m_model->addFile(file);
+ }
+ }
+/* kdDebug() << "m_model class count: " << m_model->globalNamespace()->classList().count() << endl;
+ kdDebug() << "m_model file count: " << m_model->fileList().count() << endl;*/
+}
+
+void StoreConverter::parseClass(Tag &classTag, FileDom file)
+{
+ ClassDom klass = m_model->create<ClassModel>();
+ klass->setName(classTag.name());
+ klass->setFileName(classTag.fileName());
+
+ QStringList scope;
+ scope.append(classTag.name());
+ QValueList<Tag> symbolTags = m_part->codeCompletion()->repository()->
+ getTagsInScope(scope, false);
+
+// kdDebug() << "got tags: " << endl;
+ for (QValueList<Tag>::iterator sit = symbolTags.begin(); sit != symbolTags.end(); ++sit )
+ {
+ Tag &symbol = *sit;
+// kdDebug() << symbol.name() << endl;
+
+ switch (symbol.kind())
+ {
+ case Tag::Kind_FunctionDeclaration:
+ parseFunctionDeclaration(symbol, klass);
+ break;
+ case Tag::Kind_Variable:
+ parseVariable(symbol, klass);
+ }
+ }
+
+ QValueList<Tag> baseClassTags = m_part->codeCompletion()->repository()->getBaseClassList(classTag.name());
+ for (QValueList<Tag>::iterator bit = baseClassTags.begin();
+ bit != baseClassTags.end(); ++bit)
+ klass->addBaseClass((*bit).name());
+
+ file->addClass(klass);
+}
+
+void StoreConverter::parseFunctionDeclaration(Tag &fun, ClassDom klass)
+{
+ FunctionDom function = m_model->create<FunctionModel>();
+ function->setName(fun.name());
+ function->setFileName(fun.fileName());
+ function->setScope(fun.scope());
+
+ CppFunction<Tag> cppFun(fun);
+ function->setAccess(cppFun.access());
+ function->setSignal(cppFun.isSignal());
+ function->setSlot(cppFun.isSlot());
+ function->setVirtual(cppFun.isVirtual());
+ function->setStatic(cppFun.isStatic());
+ function->setInline(cppFun.isInline());
+ function->setConstant(cppFun.isConst());
+ function->setAbstract(cppFun.isPure());
+ function->setResultType(cppFun.type());
+
+ parseArguments(function, cppFun);
+
+ klass->addFunction(function);
+}
+
+void StoreConverter::parseVariable(Tag &var, ClassDom klass)
+{
+ VariableDom variable = m_model->create<VariableModel>();
+ variable->setName(var.name());
+ variable->setFileName(var.fileName());
+
+ CppVariable<Tag> cppVar(var);
+ variable->setAccess(cppVar.access());
+ variable->setStatic(cppVar.isStatic());
+ variable->setType(cppVar.type());
+
+ klass->addVariable(variable);
+}
+
+void StoreConverter::parseArguments(FunctionDom function, CppFunction<Tag> &cppFun)
+{
+ QStringList args = cppFun.arguments();
+ for (QStringList::const_iterator it = args.constBegin(); it != args.constEnd(); ++it)
+ {
+ ArgumentDom arg = m_model->create<ArgumentModel>();
+ arg->setType(*it);
+ arg->setName(cppFun.argumentNames()[args.findIndex(*it)]);
+
+ function->addArgument(arg);
+ }
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/storeconverter.h b/languages/cpp/storeconverter.h
new file mode 100644
index 00000000..34a5d3d3
--- /dev/null
+++ b/languages/cpp/storeconverter.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+* Copyright (C) 2003-2004 by Alexander Dymo *
+* adymo@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+#ifndef STORECONVERTER_H
+#define STORECONVERTER_H
+
+#include <qstringlist.h>
+
+#include <tag.h>
+#include <catalog.h>
+#include <codemodel.h>
+
+#include "cpp_tags.h"
+
+class CppSupportPart;
+
+class StoreConverter
+{
+public:
+ StoreConverter( CppSupportPart *part, CodeModel *model );
+
+ void PCSClassToCodeModel( const QString &className, const QStringList &classScope );
+
+protected:
+ /**Parses class from PCS and adds it into a file dom.*/
+ void parseClass( Tag &classTag, FileDom file );
+ /**Parses function declaration from PCS and adds it into a class dom.*/
+ void parseFunctionDeclaration( Tag &fun, ClassDom klass );
+ /**Parses variable from PCS and adds it into a class dom.*/
+ void parseVariable( Tag &var, ClassDom klass );
+ /**Parses function arguments from @p cppFun and adds them into a function dom.*/
+ void parseArguments( FunctionDom function, CppFunction<Tag> &cppFun );
+
+private:
+ CppSupportPart *m_part;
+ CodeModel *m_model;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/stringhelpers.cpp b/languages/cpp/stringhelpers.cpp
new file mode 100644
index 00000000..d380fd64
--- /dev/null
+++ b/languages/cpp/stringhelpers.cpp
@@ -0,0 +1,299 @@
+
+/***************************************************************************
+k copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "stringhelpers.h"
+#include "safetycounter.h"
+
+namespace StringHelpers
+{
+
+void clearStr( QString& str, int start, int end ) {
+ for( int a = start; a < end; a++) str[a] = ' ';
+}
+
+bool isValidIdentifierSign( const QChar& c ) {
+ if( c.isLetter() || c.isDigit() || c == '_' ) return true;
+ else return false;
+}
+
+
+QString clearComments( QString str ) {
+ if( str.isEmpty() ) return "";
+
+ SafetyCounter s( 1000 );
+ int lastPos = 0;
+ int pos;
+ int len = str.length();
+ while( (pos = str.find( "/*", lastPos )) != -1 ) {
+ if( !s ) return str;
+ int i = str.find( "*/", pos );
+ if( i != -1 && i <= len - 2 ) {
+ clearStr( str, pos, i+2 );
+ lastPos = i+2;
+ if( lastPos == len ) break;
+ } else {
+ break;
+ }
+ }
+
+ lastPos = 0;
+ while( (pos = str.find( "//", lastPos )) != -1 ) {
+ if( !s ) return str;
+ int i = str.find( "\n", pos );
+ if( i != -1 && i <= len - 1 ) {
+ clearStr( str, pos, i+1 );
+ lastPos = i+1;
+ } else {
+ clearStr( str, pos, len );
+ break;
+ }
+ }
+
+ return str;
+}
+
+QString cutTemplateParams( QString str ) {
+ int p;
+ if( (p = str.find('<') ) != -1) {
+ return str.left( p );
+ }
+
+ return str.stripWhiteSpace().replace('*',"");
+}
+
+QPair<QString, QString> splitTemplateParams( QString str ) {
+ QPair<QString, QString> ret;
+ int p;
+ if( (p = str.find('<') ) != -1) {
+ ret.first = str.left( p ).stripWhiteSpace();
+ ret.second = str.mid( p ).stripWhiteSpace();
+ } else {
+ ret.first = str.stripWhiteSpace();
+ }
+
+ return ret;
+}
+
+bool parenFits( QChar c1, QChar c2 ) {
+ if( c1 == '<' && c2 == '>' ) return true;
+ else if( c1 == '(' && c2 == ')' ) return true;
+ else if( c1 == '[' && c2 == ']' ) return true;
+ else if( c1 == '{' && c2 == '}' ) return true;
+ else
+ return false;
+}
+
+bool isParen( QChar c1 ) {
+ if( c1 == '<' || c1 == '>' ) return true;
+ else if( c1 == '(' || c1 == ')' ) return true;
+ else if( c1 == '[' || c1 == ']' ) return true;
+ else if( c1 == '{' || c1 == '}' ) return true;
+ else
+ return false;
+}
+
+bool isTypeParen( QChar c1 ) {
+ if( c1 == '<' || c1 == '>' ) return true;
+ else
+ return false;
+}
+
+bool isTypeOpenParen( QChar c1 ) {
+ if( c1 == '<' ) return true;
+ else
+ return false;
+}
+
+bool isTypeCloseParen( QChar c1 ) {
+ if( c1 == '>' ) return true;
+ else
+ return false;
+}
+
+bool isLeftParen( QChar c1 ) {
+ if( c1 == '<' ) return true;
+ else if( c1 == '(' ) return true;
+ else if( c1 == '[' ) return true;
+ else if( c1 == '{' ) return true;
+ else
+ return false;
+}
+
+int findClose( const QString& str , int pos ) {
+ int depth = 0;
+ QValueList<QChar> st;
+ QChar last = ' ';
+
+ for( int a = pos; a < (int)str.length(); a++) {
+ switch(str[a]) {
+ case '<':
+ case '(':
+ case '[':
+ case '{':
+ st.push_front( str[a] );
+ depth++;
+ break;
+ case '>':
+ if( last == '-' ) break;
+ case ')':
+ case ']':
+ case '}':
+ if( !st.isEmpty() && parenFits(st.front(), str[a]) ) {
+ depth--;
+ st.pop_front();
+ }
+ break;
+ case '"':
+ last = str[a];
+ a++;
+ while( a < (int)str.length() && (str[a] != '"' || last == '\\')) {
+ last = str[a];
+ a++;
+ }
+ continue;
+ break;
+ }
+
+ last = str[a];
+
+ if( depth == 0 ) {
+ return a;
+ }
+ }
+
+ return -1;
+}
+
+QString tagType( const Tag& tag )
+{
+ if ( tag.hasAttribute( "t" ) )
+ {
+ QString type = tag.attribute( "t" ).toString();
+ return type;
+ }
+ else if ( tag.kind() == Tag::Kind_Class || tag.kind() == Tag::Kind_Namespace )
+ {
+ QStringList l = tag.scope();
+ l << tag.name();
+ return l.join("::");
+ }
+ return QString();
+}
+
+int findCommaOrEnd( const QString& str , int pos, QChar validEnd) {
+
+ for( int a = pos; a < (int)str.length(); a++) {
+ switch(str[a]) {
+ case '"':
+ case '(':
+ case '[':
+ case '{':
+ case '<':
+ a = findClose( str, a );
+ if( a == -1 ) return str.length();
+ break;
+ case ')':
+ case ']':
+ case '}':
+ case '>':
+ if( validEnd != ' ' && validEnd != str[a] )
+ continue;
+ case ',':
+ return a;
+ }
+ }
+
+ return str.length();
+}
+
+int countExtract( QChar c, const QString& str ) {
+ int ret = 0;
+ for( int a = 0; a < (int)str.length(); a++) {
+ if( str[a] == c ) ++ret;
+ switch( str[a] ) {
+ case '"':
+ case '(':
+ case '[':
+ case '{':
+ case '<':
+ a = findClose( str, a );
+ if( a == -1 )
+ return ret;
+ }
+ }
+ return ret;
+}
+
+QString templateParamFromString( int num, QString str ) {
+ if( str.endsWith("::") ) str.truncate( str.length() - 2 );
+ int begin = str.find('<');
+ int end = str.findRev('>');
+
+ if(begin == -1 || end == -1) return "";
+
+ begin++;
+
+ for(int a = 0; a < num; a++) {
+ begin = findCommaOrEnd( str, begin );
+ if( begin == (int)str.length() ) return "";
+ begin++;
+ }
+ end = findCommaOrEnd( str, begin );
+
+ if( end == (int)str.length() ) return "";
+
+ return str.mid( begin, end - begin ).stripWhiteSpace();
+}
+
+QStringList splitType( QString str ) {
+ QStringList ret;
+ int currentStart = 0;
+ bool was = false;
+ for( int a = 0; a < (int)str.length(); ++a ) {
+ if( isLeftParen( str[a] ) ) {
+ a = findClose( str, a );
+ if( a == -1 ) {
+ CompletionDebug::dbg() << "misformatted type: " << str << endl;
+ return ret;
+ }
+ was = false;
+ } else {
+ if( str[a] == ':' ) {
+ if( was ) {
+ if( currentStart < a - 1 )
+ ret << str.mid( currentStart, (a - 1) - currentStart ).stripWhiteSpace();
+ currentStart = a + 1;
+ }
+ was = true;
+ } else {
+ was = false;
+ }
+ }
+ }
+ if( currentStart < (int)str.length() )
+ ret << str.mid( currentStart, str.length() - currentStart ).stripWhiteSpace();
+ return ret;
+}
+
+QString stringMult( int count, QString str ){
+ QString ret;
+ for( int a = 0; a < count; a++ ) ret += str;
+ return ret;
+}
+
+}
+
+
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/cpp/stringhelpers.h b/languages/cpp/stringhelpers.h
new file mode 100644
index 00000000..d15f57aa
--- /dev/null
+++ b/languages/cpp/stringhelpers.h
@@ -0,0 +1,118 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __STRINGHELPERS_H__
+#define __STRINGHELPERS_H__
+
+
+#include "completiondebug.h"
+#include "codeinformationrepository.h"
+
+
+namespace StringHelpers {
+
+void clearStr( QString& str, int start, int end );
+
+///Fills all comments with whitespaces
+QString clearComments( QString str );
+
+QString cutTemplateParams( QString str );
+
+QPair<QString, QString> splitTemplateParams( QString str );
+
+bool parenFits( QChar c1, QChar c2 );
+
+bool isParen( QChar c1 );
+
+bool isTypeParen( QChar c1 );
+
+bool isTypeOpenParen( QChar c1 );
+
+bool isTypeCloseParen( QChar c1 );
+
+bool isLeftParen( QChar c1 );
+
+/*only from left to right
+searches a fitting closing sign ( a ')' for a '(', ']' for '['
+ignores quoted text
+comments are currently not allowed */
+int findClose( const QString& str , int pos ); //todo: make this respect strings
+
+QString tagType( const Tag& tag );
+
+int findCommaOrEnd( const QString& str , int pos, QChar validEnd = ' ' );
+
+int countExtract( QChar c, const QString& str );
+
+QString templateParamFromString( int num, QString str );
+
+QStringList splitType( QString str ) ;
+
+class ParamIterator {
+ public:
+ ParamIterator( QString parens, QString source ) : m_source( source ), m_parens( parens ), m_cur( 0 ), m_curEnd ( 0 ) {
+ int begin = m_source.find( m_parens[ 0 ] );
+ int end = m_source.findRev( m_parens[ 1 ] );
+ m_prefix = m_source.left( begin );
+
+ if ( begin == -1 || end == -1 && end - begin > 1 )
+ m_cur = m_source.length();
+ else {
+ m_source = source.mid( begin + 1, end - begin );
+ m_curEnd = next();
+ }
+ }
+
+ ParamIterator& operator ++() {
+ m_cur = m_curEnd + 1;
+ if ( m_cur < ( int ) m_source.length() ) {
+ m_curEnd = next();
+ }
+ return *this;
+ }
+
+ QString operator *() {
+ return m_source.mid( m_cur, m_curEnd - m_cur ).stripWhiteSpace();
+ }
+
+ operator bool() const {
+ return m_cur < ( int ) m_source.length();
+ }
+
+ QString prefix() const {
+ return m_prefix;
+ }
+
+ private:
+ QString m_prefix;
+ QString m_source;
+ QString m_parens;
+ int m_cur;
+ int m_curEnd;
+
+ int next() {
+ return findCommaOrEnd( m_source, m_cur, m_parens[ 1 ] );
+ }
+
+};
+
+bool isValidIdentifierSign( const QChar& c );
+
+QString stringMult( int count, QString str );
+}
+
+
+#endif
+// kate: tab-width 2;
diff --git a/languages/cpp/subclassing_template/.kdev_ignore b/languages/cpp/subclassing_template/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/cpp/subclassing_template/.kdev_ignore
diff --git a/languages/cpp/subclassing_template/Makefile.am b/languages/cpp/subclassing_template/Makefile.am
new file mode 100644
index 00000000..4e722ca0
--- /dev/null
+++ b/languages/cpp/subclassing_template/Makefile.am
@@ -0,0 +1,5 @@
+cppsupportdatadir = ${kde_datadir}/kdevcppsupport
+subclassingdir = ${cppsupportdatadir}/subclassing
+
+subclassing_DATA = subclass_template.h subclass_template.cpp \
+ subclass_qt4_template.h subclass_qt4_template.cpp
diff --git a/languages/cpp/subclassing_template/subclass_qt4_template.cpp b/languages/cpp/subclassing_template/subclass_qt4_template.cpp
new file mode 100644
index 00000000..6c008d43
--- /dev/null
+++ b/languages/cpp/subclassing_template/subclass_qt4_template.cpp
@@ -0,0 +1,16 @@
+
+
+#include "$NEWFILENAMELC$.h"
+
+$NEWCLASS$::$NEWCLASS$(QWidget* parent, Qt::WFlags fl)
+: $QTBASECLASS$( parent, fl ), Ui::$BASECLASS$()
+{
+ setupUi(this);
+}
+
+$NEWCLASS$::~$NEWCLASS$()
+{
+}
+
+/*$SPECIALIZATION$*/
+
diff --git a/languages/cpp/subclassing_template/subclass_qt4_template.h b/languages/cpp/subclassing_template/subclass_qt4_template.h
new file mode 100644
index 00000000..a8a02303
--- /dev/null
+++ b/languages/cpp/subclassing_template/subclass_qt4_template.h
@@ -0,0 +1,28 @@
+
+#ifndef $NEWFILENAMEUC$_H
+#define $NEWFILENAMEUC$_H
+
+#include <$QTBASECLASS$>
+#include "ui_$BASEFILENAME$.h"
+
+class $NEWCLASS$ : public $QTBASECLASS$, private Ui::$BASECLASS$
+{
+ Q_OBJECT
+
+public:
+ $NEWCLASS$(QWidget* parent = 0, Qt::WFlags fl = 0 );
+ ~$NEWCLASS$();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+};
+
+#endif
diff --git a/languages/cpp/subclassing_template/subclass_template.cpp b/languages/cpp/subclassing_template/subclass_template.cpp
new file mode 100644
index 00000000..19269531
--- /dev/null
+++ b/languages/cpp/subclassing_template/subclass_template.cpp
@@ -0,0 +1,15 @@
+
+
+#include "$NEWFILENAMELC$.h"
+
+$NEWCLASS$::$NEWCLASS$(QWidget* parent, const char* name$CAN_BE_MODAL_CPP1$, WFlags fl)
+: $BASECLASS$(parent,name$CAN_BE_MODAL_CPP2$,fl)
+{
+}
+
+$NEWCLASS$::~$NEWCLASS$()
+{
+}
+
+/*$SPECIALIZATION$*/
+
diff --git a/languages/cpp/subclassing_template/subclass_template.h b/languages/cpp/subclassing_template/subclass_template.h
new file mode 100644
index 00000000..18846cc6
--- /dev/null
+++ b/languages/cpp/subclassing_template/subclass_template.h
@@ -0,0 +1,27 @@
+
+#ifndef $NEWFILENAMEUC$_H
+#define $NEWFILENAMEUC$_H
+
+#include "$BASEFILENAME$.h"
+
+class $NEWCLASS$ : public $BASECLASS$
+{
+ Q_OBJECT
+
+public:
+ $NEWCLASS$(QWidget* parent = 0, const char* name = 0$CAN_BE_MODAL_H$, WFlags fl = 0 );
+ ~$NEWCLASS$();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+};
+
+#endif
diff --git a/languages/cpp/subclassingdlg.cpp b/languages/cpp/subclassingdlg.cpp
new file mode 100644
index 00000000..fa5aece9
--- /dev/null
+++ b/languages/cpp/subclassingdlg.cpp
@@ -0,0 +1,536 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 "subclassingdlg.h"
+#include "cppsupportpart.h"
+#include "backgroundparser.h"
+#include "store_walker.h"
+#include "cppsupportfactory.h"
+#include "kdevsourceformatter.h"
+#include "kdevapi.h"
+#include "kdevproject.h"
+#include "filetemplate.h"
+#include "codemodel.h"
+
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <kfiledialog.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <domutil.h>
+#include <qdom.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <kconfig.h>
+
+
+#define WIDGET_CAPTION_NAME "widget/property|name=caption/string"
+#define WIDGET_CLASS_NAME "class"
+#define WIDGET_SLOTS "slots"
+#define WIDGET_FUNCTIONS "functions"
+
+// All widgets
+#define SLOT_ACCEPT SlotItem(m_slotView,"accept()","virtual","protected","void",false,true)
+#define SLOT_REJECT SlotItem(m_slotView,"reject()","virtual","protected","void",false,true)
+
+// Wizards
+#define SLOT_BACK SlotItem(m_slotView,"back()","virtual","protected","void",false,true)
+#define SLOT_NEXT SlotItem(m_slotView,"next()","virtual","protected","void",false,true)
+#define SLOT_HELP SlotItem(m_slotView,"help()","virtual","protected","void",false,true)
+
+
+SlotItem::SlotItem(QListView *parent,const QString &methodName,
+ const QString &specifier,
+ const QString &access, const QString &returnType,
+ bool isFunc,bool callBaseClass)
+: QCheckListItem(parent,methodName,QCheckListItem::CheckBox)
+{
+ setOn(true);
+ m_methodName = methodName;
+ m_access = access.isEmpty() ? (const QString) "public" : access;
+ m_specifier = specifier.isEmpty() ? (const QString) "virtual" : specifier;
+ m_returnType = returnType.isEmpty() ? (const QString) "void" : returnType;
+ m_isFunc = isFunc;
+ m_callBaseClass = callBaseClass;
+ setText(0,m_methodName);
+ setText(1,m_access);
+ setText(2,m_specifier);
+ setText(3,m_returnType);
+ setText(4,m_isFunc ? "Function" : "Slot");
+ if (m_access=="private" || m_specifier=="non virtual")
+ {
+ setOn(false);
+ setEnabled(false);
+ }
+ if (m_specifier=="pure virtual")
+ {
+ setOn(true);
+ setEnabled(false);
+ }
+ m_alreadyInSubclass = false;
+}
+
+void SlotItem::setAllreadyInSubclass()
+{
+ setOn(true);
+ setEnabled(false);
+ m_alreadyInSubclass = true;
+}
+
+
+SubclassingDlg::SubclassingDlg(CppSupportPart* cppSupport, const QString &formFile,
+ QStringList &newFileNames, QWidget* parent,
+ const char* name,bool modal, WFlags fl)
+: SubclassingDlgBase(parent,name,modal,fl),
+m_newFileNames(newFileNames), m_cppSupport( cppSupport )
+
+{
+ m_formFile = formFile;
+ readUiFile();
+ m_creatingNewSubclass = true;
+
+ KConfig *config = CppSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ reformatDefault_box->setChecked(config->readBoolEntry("Reformat Source", 0));
+ if (reformatDefault_box->isChecked())
+ reformat_box->setChecked(true);
+ }
+}
+
+
+SubclassingDlg::SubclassingDlg(CppSupportPart* cppSupport, const QString &formFile,
+ const QString &filename, QStringList &dummy,
+ QWidget* parent, const char* name, bool modal, WFlags fl)
+: SubclassingDlgBase(parent, name, modal, fl),
+m_newFileNames(dummy), m_cppSupport( cppSupport )
+
+{
+ m_formFile = formFile;
+ m_creatingNewSubclass = false;
+ m_filename = filename;
+
+ KConfig *config = CppSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ reformatDefault_box->setChecked(config->readBoolEntry("Reformat Source", 0));
+ if (reformatDefault_box->isChecked())
+ reformat_box->setChecked(true);
+ }
+
+ QStringList pathsplit(QStringList::split('/',filename));
+
+ QString baseClass = readBaseClassName();
+ if (!cppSupport->codeModel()->hasFile(filename+QString(".h")))
+ return;
+ ClassList myClasses = cppSupport->codeModel()->fileByName(filename+QString(".h"))->classList();
+ for (ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt)
+ {
+ kdDebug() << "base class " << baseClass << " class " << (*classIt)->name()
+ << " parents " << (*classIt)->baseClassList().join(",") << endl;
+ if ( (*classIt)->baseClassList().findIndex(baseClass) != -1 )
+ {
+ kdDebug() << "base class matched " << endl;
+ m_edClassName->setText((*classIt)->name());
+ m_edFileName->setText(pathsplit[pathsplit.count()-1]);
+
+ FunctionList functionList = (*classIt)->functionList();
+ for (FunctionList::const_iterator methodIt = functionList.begin();
+ methodIt != functionList.end(); ++methodIt)
+ {
+ m_parsedMethods << (*methodIt)->name() + "(";
+ }
+ }
+ }
+ readUiFile();
+ m_btnOk->setEnabled(true);
+}
+
+bool SubclassingDlg::alreadyInSubclass(const QString &method)
+{
+ for (uint i=0;i<m_parsedMethods.count();i++)
+ {
+ if (method.find(m_parsedMethods[i])==0)
+ return true;
+ }
+ return false;
+}
+
+void SubclassingDlg::readUiFile()
+{
+ QStringList splitPath = QStringList::split('/',m_formFile);
+ m_formName = QStringList::split('.',splitPath[splitPath.count()-1])[0]; // "somedlg.ui" = "somedlg"
+ splitPath.pop_back();
+ m_formPath = "/" + splitPath.join("/"); // join path to ui-file
+
+ m_btnOk->setEnabled(false);
+ QDomDocument doc;
+
+ DomUtil::openDOMFile(doc,m_formFile);
+ m_baseClassName = DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text();
+
+ m_baseCaption = DomUtil::elementByPathExt(doc,WIDGET_CAPTION_NAME).text();
+ setCaption(i18n("Create Subclass of ")+m_baseClassName);
+
+ // Special widget specific slots
+ SlotItem *newSlot;
+ m_qtBaseClassName = DomUtil::elementByPathExt(doc,"widget").attribute("class","QDialog");
+
+ if ( (m_qtBaseClassName=="QMainWindow") || (m_qtBaseClassName=="QWidget") )
+ m_canBeModal = false;
+ else
+ m_canBeModal = true;
+ if (m_qtBaseClassName != "QWidget")
+ {
+ newSlot = new SLOT_ACCEPT;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("accept()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+
+ newSlot = new SLOT_REJECT;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("reject()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+ }
+
+ if (m_qtBaseClassName == "QWizard")
+ {
+ newSlot = new SLOT_NEXT;
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass("next()"))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ newSlot = new SLOT_BACK;
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass("back()"))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ newSlot = new SLOT_HELP;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("help()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+ }
+
+ QDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS);
+ QDomNodeList slotnodes = slotsElem.childNodes();
+
+ for (unsigned int i=0; i<slotnodes.count();i++)
+ {
+ QDomElement slotelem = slotnodes.item(i).toElement();
+ newSlot = new SlotItem(m_slotView,slotelem.text(),
+ slotelem.attributeNode("specifier").value(),
+ slotelem.attributeNode("access").value(),
+ slotelem.attributeNode("returnType").value(),false);
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass(slotelem.text()))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ }
+
+ QDomElement funcsElem = DomUtil::elementByPathExt(doc,WIDGET_FUNCTIONS);
+ QDomNodeList funcnodes = funcsElem.childNodes();
+ SlotItem *newFunc;
+ for (unsigned int i=0; i<funcnodes.count();i++)
+ {
+ QDomElement funcelem = funcnodes.item(i).toElement();
+ newFunc = new SlotItem(m_slotView,funcelem.text(),
+ funcelem.attributeNode("specifier").value(),
+ funcelem.attributeNode("access").value(),
+ funcelem.attributeNode("returnType").value(),true);
+ m_slotView->insertItem(newFunc);
+ if (alreadyInSubclass(funcelem.text()))
+ newFunc->setAllreadyInSubclass();
+ m_slots << newFunc;
+ }
+}
+
+SubclassingDlg::~SubclassingDlg()
+{
+}
+
+
+void SubclassingDlg::updateDlg()
+{
+}
+
+void SubclassingDlg::replace(QString &string, const QString& search, const QString& replace)
+{
+ int nextPos = string.find(search);
+ unsigned int searchLength = search.length();
+ while (nextPos>-1)
+ {
+ string = string.replace(nextPos,searchLength,replace);
+ nextPos = string.find(search,nextPos+replace.length());
+ }
+}
+
+bool SubclassingDlg::loadBuffer(QString &buffer, const QString& filename)
+{
+ // open file and buffer it
+ QFile dataFile(filename);
+ if (!dataFile.open(IO_ReadOnly))
+ return false;
+ char *temp = new char[dataFile.size()+1];
+ dataFile.readBlock(temp,dataFile.size());
+ temp[dataFile.size()]='\0';
+ buffer = temp;
+ delete [] temp;
+ dataFile.close();
+ return true;
+}
+
+bool SubclassingDlg::replaceKeywords(QString &buffer,bool canBeModal)
+{
+ replace(buffer,"$NEWFILENAMEUC$",m_edFileName->text().upper());
+ replace(buffer,"$BASEFILENAMELC$",m_formName.lower());
+ replace(buffer,"$BASEFILENAME$",m_formName);
+ replace(buffer,"$NEWCLASS$",m_edClassName->text());
+ replace(buffer,"$QTBASECLASS$", m_qtBaseClassName );
+ replace(buffer,"$BASECLASS$",m_baseClassName);
+ replace(buffer,"$NEWFILENAMELC$",m_edFileName->text().lower());
+ if (canBeModal)
+ {
+ replace(buffer,"$CAN_BE_MODAL_H$",", bool modal = FALSE");
+ replace(buffer,"$CAN_BE_MODAL_CPP1$",", bool modal");
+ replace(buffer,"$CAN_BE_MODAL_CPP2$",", modal");
+ }
+ else
+ {
+ replace(buffer,"$CAN_BE_MODAL_H$","");
+ replace(buffer,"$CAN_BE_MODAL_CPP1$","");
+ replace(buffer,"$CAN_BE_MODAL_CPP2$","");
+ }
+
+ return true;
+}
+
+bool SubclassingDlg::saveBuffer(QString &buffer, const QString& filename)
+{
+ // save buffer
+
+ QFile dataFile(filename);
+ if (!dataFile.open(IO_WriteOnly | IO_Truncate))
+ return false;
+ dataFile.writeBlock((buffer+"\n").ascii(),(buffer+"\n").length());
+ dataFile.close();
+ return true;
+}
+
+
+void SubclassingDlg::accept()
+{
+ KConfig *config = CppSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ config->writeEntry("Reformat Source", reformatDefault_box->isChecked());
+ }
+
+ unsigned int i;
+
+ // h - file
+
+ QString public_slot =
+ "/*$PUBLIC_SLOTS$*/\n ";
+
+ QString protected_slot =
+ "/*$PROTECTED_SLOTS$*/\n ";
+
+ QString public_func =
+ "/*$PUBLIC_FUNCTIONS$*/\n ";
+
+ QString protected_func =
+ "/*$PROTECTED_FUNCTIONS$*/\n ";
+
+ QString buffer;
+ int qtVersion = DomUtil::readIntEntry( *m_cppSupport->project()->projectDom(), "/kdevcppsupport/qt/version", 3 );
+ if (m_creatingNewSubclass)
+ {
+ if ( qtVersion == 3 )
+ loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_template.h"));
+ else
+ loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_qt4_template.h"));
+
+ buffer = FileTemplate::read(m_cppSupport, "h") + buffer;
+ QFileInfo fi(m_filename + ".h");
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName(true);
+ buffer.replace(QRegExp("\\$MODULE\\$"),module);
+ buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename);
+ }
+ else
+ loadBuffer(buffer,m_filename+".h");
+
+ replaceKeywords(buffer,m_canBeModal);
+ for (i=0; i<m_slots.count(); i++)
+ {
+ SlotItem *slitem = m_slots[i];
+ if (!slitem->isOn() ||
+ slitem->m_alreadyInSubclass)
+ continue;
+ QString declBuild;
+ if (slitem->m_access=="public")
+ if (!slitem->m_isFunc)
+ declBuild = public_slot;
+ else
+ declBuild = public_func;
+ if (slitem->m_access=="protected")
+ if (!slitem->m_isFunc)
+ declBuild = protected_slot;
+ else
+ declBuild = protected_func;
+ if (!(slitem->m_specifier=="non virtual"))
+ declBuild += "virtual ";
+ declBuild += slitem->m_returnType + " ";
+ QString spacer;
+ if (slitem->m_access=="public")
+ {
+ if (!slitem->m_isFunc)
+ {
+ declBuild += spacer.fill(' ',43-declBuild.length()) + slitem->m_methodName + ";";
+ replace(buffer,"/*$PUBLIC_SLOTS$*/",declBuild);
+ }
+ else
+ {
+ declBuild += spacer.fill(' ',47-declBuild.length()) + slitem->m_methodName + ";";
+ replace(buffer,"/*$PUBLIC_FUNCTIONS$*/",declBuild);
+ }
+ }
+ if (slitem->m_access=="protected")
+ {
+ if (!slitem->m_isFunc)
+ {
+ declBuild += spacer.fill(' ',46-declBuild.length()) + slitem->m_methodName + ";";
+ replace(buffer,"/*$PROTECTED_SLOTS$*/",declBuild);
+ }
+ else
+ {
+ declBuild += spacer.fill(' ',50-declBuild.length()) + slitem->m_methodName + ";";
+ replace(buffer,"/*$PROTECTED_FUNCTIONS$*/",declBuild);
+ }
+ }
+ }
+
+ if (reformat_box->isChecked())
+ {
+ KDevSourceFormatter *fmt = m_cppSupport->extension<KDevSourceFormatter>("KDevelop/SourceFormatter");
+ if (fmt)
+ buffer = fmt->formatSource(buffer);
+ }
+
+ if (m_creatingNewSubclass)
+ saveBuffer(buffer,m_formPath + "/" + m_edFileName->text()+".h");
+ else
+ saveBuffer(buffer,m_filename+".h");
+
+ // cpp - file
+
+ QString implementation =
+ "/*$SPECIALIZATION$*/\n"
+ "$RETURNTYPE$ $NEWCLASS$::$METHOD$\n"
+ "{\n"
+ "}\n";
+
+ QString implementation_callbase =
+ "/*$SPECIALIZATION$*/\n"
+ "$RETURNTYPE$ $NEWCLASS$::$METHOD$\n"
+ "{\n"
+ " $QTBASECLASS$::$METHOD$;\n"
+ "}\n";
+
+
+ if (m_creatingNewSubclass)
+ {
+ if ( qtVersion == 3 )
+ loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_template.cpp"));
+ else
+ loadBuffer(buffer,::locate("data", "kdevcppsupport/subclassing/subclass_qt4_template.cpp"));
+
+ buffer = FileTemplate::read(m_cppSupport, "cpp") + buffer;
+ QFileInfo fi(m_filename + ".cpp");
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName(true);
+ buffer.replace(QRegExp("\\$MODULE\\$"),module);
+ buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename);
+ if ( (m_cppSupport->project()) && (m_cppSupport->project()->options() & KDevProject::UsesAutotoolsBuildSystem))
+ buffer += "\n#include \"$NEWFILENAMELC$.moc\"\n";
+ }
+ else
+ loadBuffer(buffer,m_filename+".cpp");
+
+ replaceKeywords(buffer,m_canBeModal);
+ for (i=0; i<m_slots.count(); i++)
+ {
+ SlotItem *slitem = m_slots[i];
+ if (!slitem->isOn() ||
+ slitem->m_alreadyInSubclass)
+ continue;
+ QString impl = slitem->m_callBaseClass ? implementation_callbase : implementation;
+ replace(impl,"$RETURNTYPE$",slitem->m_returnType);
+ replace(impl,"$NEWCLASS$",m_edClassName->text());
+ replace(impl,"$METHOD$", slitem->m_methodName);
+ replace(impl,"$QTBASECLASS$", m_qtBaseClassName);
+ replace(buffer,"/*$SPECIALIZATION$*/",impl);
+ }
+
+ if (reformat_box->isChecked())
+ {
+ KDevSourceFormatter *fmt = m_cppSupport->extension<KDevSourceFormatter>("KDevelop/SourceFormatter");
+ if (fmt)
+ buffer = fmt->formatSource(buffer);
+ }
+
+ if (m_creatingNewSubclass)
+ saveBuffer(buffer,m_formPath + "/" + m_edFileName->text()+".cpp");
+ else
+ saveBuffer(buffer,m_filename+".cpp");
+
+ if (m_creatingNewSubclass)
+ {
+ m_newFileNames.append(m_formPath + "/" + m_edFileName->text()+".cpp");
+ m_newFileNames.append(m_formPath + "/" + m_edFileName->text()+".h");
+ }
+ SubclassingDlgBase::accept();
+}
+
+void SubclassingDlg::onChangedClassName()
+{
+ m_edFileName->setText(m_edClassName->text().lower());
+ if (m_edFileName->text().isEmpty() ||
+ m_edClassName->text().isEmpty())
+ m_btnOk->setEnabled(false);
+ else
+ m_btnOk->setEnabled(true);
+}
+
+QString SubclassingDlg::readBaseClassName()
+{
+ QDomDocument doc;
+ DomUtil::openDOMFile(doc,m_formFile);
+ return DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text();
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/subclassingdlg.h b/languages/cpp/subclassingdlg.h
new file mode 100644
index 00000000..2f645f09
--- /dev/null
+++ b/languages/cpp/subclassingdlg.h
@@ -0,0 +1,85 @@
+/***************************************************************************
+* Copyright (C) 2002 by Jakob Simon-Gaarde *
+* jsgaarde@tdcspace.dk *
+* *
+* 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 SUBCLASSINGDLG_H
+#define SUBCLASSINGDLG_H
+
+#include <qlistview.h>
+
+#include "subclassingdlgbase.h"
+
+class QStringList;
+class QDomDocument;
+class CppSupportPart;
+
+class SlotItem : public QCheckListItem
+{
+public:
+ SlotItem( QListView *parent, const QString &text,
+ const QString &specifier, const QString &Access,
+ const QString &returnType, bool isFunc,
+ bool callBaseClass = false );
+ void setAllreadyInSubclass();
+ QString m_access;
+ QString m_methodName;
+ QString m_returnType;
+ QString m_specifier;
+ bool m_isFunc;
+ bool m_callBaseClass;
+ bool m_alreadyInSubclass;
+};
+
+
+class SubclassingDlg : public SubclassingDlgBase
+{
+public:
+ SubclassingDlg( CppSupportPart* cppSupport, const QString &formFile, QStringList &newFileNames,
+ QWidget* parent = 0, const char* name = 0,
+ bool modal = FALSE, WFlags fl = 0 );
+ SubclassingDlg( CppSupportPart* cppSupport, const QString &formFile, const QString &filename, QStringList &dummy,
+ QWidget* parent = 0, const char* name = 0,
+ bool modal = FALSE, WFlags fl = 0 );
+ ~SubclassingDlg();
+
+private:
+ void readUiFile();
+ QString readBaseClassName();
+ void updateDlg();
+ bool replaceKeywords( QString &buffer, bool canBeModal = true );
+ void replace( QString &string, const QString& search, const QString& replace );
+ bool saveBuffer( QString &buffer, const QString& filename );
+ bool loadBuffer( QString &buffer, const QString& filename );
+ bool alreadyInSubclass( const QString &method );
+ bool m_creatingNewSubclass;
+
+public slots:
+ virtual void accept();
+ virtual void onChangedClassName();
+
+protected:
+ QStringList &m_newFileNames;
+ QString m_filename;
+ QString m_formFile;
+ QString m_baseClassName;
+ QString m_qtBaseClassName;
+ QString m_baseCaption;
+ QString m_formName;
+ QString m_formPath;
+ QStringList m_parsedMethods;
+ bool m_canBeModal;
+ QValueList<SlotItem*> m_slots;
+ QValueList<SlotItem*> m_functions;
+ CppSupportPart* m_cppSupport;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/subclassingdlgbase.ui b/languages/cpp/subclassingdlgbase.ui
new file mode 100644
index 00000000..c732b244
--- /dev/null
+++ b/languages/cpp/subclassingdlgbase.ui
@@ -0,0 +1,244 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>SubclassingDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SubclassingDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>588</width>
+ <height>493</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create Subclass</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Subclass Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Specialize following slots:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_slotView</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_edClassName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>C&amp;lass name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_edClassName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>F&amp;ile name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_edFileName</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_edFileName</cstring>
+ </property>
+ </widget>
+ <widget class="QListView" row="3" column="0" rowspan="1" colspan="3">
+ <column>
+ <property name="text">
+ <string>Method</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Specifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Return Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_slotView</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>reformat_box</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;format source</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="2">
+ <property name="name">
+ <cstring>reformatDefault_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Reformat source by &amp;default</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_btnOk</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;reate</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>m_btnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <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>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_btnOk</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_btnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_edClassName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>onChangedClassName()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>onChangedClassName()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/cpp/tag_creator.cpp b/languages/cpp/tag_creator.cpp
new file mode 100644
index 00000000..8ad22d38
--- /dev/null
+++ b/languages/cpp/tag_creator.cpp
@@ -0,0 +1,884 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "tag_creator.h"
+#include "catalog.h"
+#include "ast_utils.h"
+#include "cpp_tags.h"
+#include "doxydoc.h"
+#include "driver.h"
+
+#include <kdebug.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+
+DoxyDoc* TagCreator::m_documentation = new DoxyDoc( QStringList() );
+
+TagCreator::TagCreator( const QString& fileName, Catalog* c )
+: m_catalog( c ), m_fileName( fileName ), m_anon( 0 )
+{
+}
+
+TagCreator::~TagCreator()
+{
+}
+
+void TagCreator::destroyDocumentation()
+{
+ delete m_documentation;
+}
+
+void TagCreator::setDocumentationDirectories( const QStringList& str )
+{
+ if ( m_documentation )
+ delete m_documentation;
+ m_documentation = new DoxyDoc( str );
+}
+
+void TagCreator::parseDeclaration( DeclarationAST* ast )
+{
+ if( ast->nodeType() == NodeType_AccessDeclaration ||
+ m_currentAccess.isEmpty() ||
+ m_currentAccess.contains("private") || ///In order to correctly evaluate templates, the private members are necessary too
+ m_currentAccess.contains("public") ||
+ m_currentAccess.contains("protected") ||
+ m_currentAccess.contains("signals") )
+ {
+ TreeParser::parseDeclaration( ast );
+ }
+}
+
+void TagCreator::parseTranslationUnit( const ParsedFile& ast )
+{
+ m_currentScope.clear();
+ m_currentAccess = QString::null;
+ m_inSlots = false;
+ m_inSignals = false;
+ m_anon = 0;
+ m_imports.clear();
+ m_inClass = false;
+
+ m_imports << QStringList();
+
+ Tag tag;
+ tag.setKind( Tag::Kind_TranslationUnit );
+ tag.setFileName( m_fileName );
+ tag.setName( m_fileName );
+
+ QByteArray data;
+ QDataStream stream(data, IO_WriteOnly );
+ ast.write( stream );
+ tag.setAttribute( "cppparsedfile", data );
+ tag.setAttribute( "includedFrom", ast.includedFrom() );
+ tag.setAttribute( "skippedLines", QString("%1").arg( ast.skippedLines()) );
+ tag.setAttribute( "macroValueHash", QString("%1").arg( ast.usedMacros().valueHash()) );
+ tag.setAttribute( "macroIdHash", QString("%1").arg( ast.usedMacros().idHash() ) );
+
+ tag.setScope( m_currentScope );
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ m_catalog->addItem( tag );
+
+ TreeParser::parseTranslationUnit( ast );
+ m_imports.pop_back();
+}
+
+void TagCreator::parseNamespaceAlias( NamespaceAliasAST* ast ) {
+ QString nsName;
+ QString aliasName;
+
+ if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() )
+ {
+ // anonymous namespace
+ }
+ else
+ nsName = ast->namespaceName()->text();
+
+ if( ast->aliasName() )
+ aliasName = ast->aliasName()->text();
+
+ Tag tag;
+ tag.setKind( Tag::Kind_Namespace );
+ tag.setFileName( m_fileName );
+ tag.setName( nsName ); ///nsName is the new name of the namespace
+ tag.setAttribute( "alias", aliasName ); ///aliasName is the name of the real namespace
+ tag.setScope( m_currentScope );
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ TreeParser::parseNamespaceAlias( ast );
+}
+
+void TagCreator::parseNamespace( NamespaceAST* ast )
+{
+ QString nsName;
+ if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() )
+ {
+ // anonymous namespace
+ }
+ else
+ nsName = ast->namespaceName()->text();
+
+ Tag tag;
+ tag.setKind( Tag::Kind_Namespace );
+ tag.setFileName( m_fileName );
+ tag.setName( nsName );
+ tag.setScope( m_currentScope );
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ m_currentScope.push_back( nsName );
+ TreeParser::parseNamespace( ast );
+ m_currentScope.pop_back();
+}
+
+void TagCreator::parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* ast )
+{
+ TreeParser::parseElaboratedTypeSpecifier( ast );
+}
+
+void TagCreator::parseUsingDirective( UsingDirectiveAST* ast )
+{
+ QString name;
+ if( ast->name() )
+ name = ast->name()->text();
+
+ if( !name.isNull() ){
+ Tag tag;
+ tag.setKind( Tag::Kind_UsingDirective );
+ tag.setFileName( m_fileName );
+ tag.setName( name );
+ tag.setScope( m_currentScope );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+ }
+
+ m_imports.back().push_back( name );
+}
+
+void TagCreator::parseTypedef( TypedefAST* ast )
+{
+ TypeSpecifierAST* typeSpec = ast->typeSpec();
+ InitDeclaratorListAST* declarators = ast->initDeclaratorList();
+
+ if( typeSpec && declarators ){
+ QString typeId;
+
+ if( typeSpec->name() )
+ typeId = typeSpec->name()->text();
+
+ QPtrList<InitDeclaratorAST> l( declarators->initDeclaratorList() );
+ QPtrListIterator<InitDeclaratorAST> it( l );
+
+ InitDeclaratorAST* initDecl = 0;
+ while( 0 != (initDecl = it.current()) )
+ {
+
+ QString type, id;
+ if( initDecl->declarator() )
+ {
+ type = typeOfDeclaration( typeSpec, initDecl->declarator() );
+
+ DeclaratorAST* d = initDecl->declarator();
+ while( d->subDeclarator() )
+ d = d->subDeclarator();
+
+ if( d->declaratorId() )
+ id = d->declaratorId()->text();
+ }
+
+ Tag tag;
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ tag.setKind( Tag::Kind_Typedef );
+ tag.setFileName( m_fileName );
+ tag.setName( id );
+ tag.setScope( m_currentScope );
+ tag.setAttribute( "t", type );
+
+ int line, col;
+ initDecl->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ initDecl->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ ++it;
+ }
+
+ }
+}
+
+void TagCreator::parseTemplateDeclaration( TemplateDeclarationAST* ast )
+{
+ m_currentTemplateDeclarator.push( ast );
+ if ( ast->declaration() )
+ parseDeclaration( ast->declaration() );
+
+
+
+ TreeParser::parseTemplateDeclaration( ast );
+
+ m_currentTemplateDeclarator.pop();
+}
+
+
+void TagCreator::parseSimpleDeclaration( SimpleDeclarationAST* ast )
+{
+ CommentPusher push( *this, ast->comment() );
+
+ TypeSpecifierAST* typeSpec = ast->typeSpec();
+ InitDeclaratorListAST* declarators = ast->initDeclaratorList();
+
+ if( typeSpec )
+ parseTypeSpecifier( typeSpec );
+
+ if( declarators )
+ {
+ QPtrList<InitDeclaratorAST> l = declarators->initDeclaratorList();
+
+ QPtrListIterator<InitDeclaratorAST> it( l );
+ while( it.current() )
+ {
+ parseMyDeclaration( ast->functionSpecifier(), ast->storageSpecifier(), typeSpec, it.current() );
+ ++it;
+ }
+ }
+}
+
+void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast )
+{
+ TypeSpecifierAST * typeSpec = ast->typeSpec();
+ GroupAST* funSpec = ast->functionSpecifier();
+ GroupAST* storageSpec = ast->storageSpecifier();
+
+ if ( !ast->initDeclarator() )
+ return ;
+
+ DeclaratorAST* d = ast->initDeclarator() ->declarator();
+
+ if ( !d->declaratorId() )
+ return ;
+
+ bool isFriend = false;
+ bool isVirtual = false;
+ bool isStatic = false;
+ bool isInline = false;
+
+ if ( funSpec )
+ {
+ QPtrList<AST> l = funSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "virtual" )
+ isVirtual = true;
+ else if ( text == "inline" )
+ isInline = true;
+ ++it;
+ }
+ }
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+
+ QString id = d->declaratorId() ->unqualifiedName() ->text().stripWhiteSpace();
+ QString scopeStr = scopeOfDeclarator( d );
+
+ Tag tag;
+ if( !comment() )
+ tag.setComment( ast->comment() );
+
+ CppFunction<Tag> tagBuilder( tag );
+ tag.setKind( Tag::Kind_Function );
+
+ tag.setFileName( m_fileName );
+ tag.setName( id );
+ tag.setScope( QStringList::split( ".", scopeStr ) );
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ tagBuilder.setType( typeOfDeclaration( typeSpec, d ) );
+
+ parseFunctionArguments( tag, d );
+ checkTemplateDeclarator( tag );
+
+ QString arguments = tag.attribute( "a" ).toStringList().join( "," );
+tag.setAttribute( "description", m_documentation->functionDescription( scopeStr.replace( QRegExp( "." ), ":" ), id, typeOfDeclaration( typeSpec, d ), arguments ) );
+
+ tagBuilder.setAccess( TagUtils::stringToAccess( m_currentAccess ) );
+
+ tagBuilder.setFriend( isFriend );
+ tagBuilder.setVirtual( isVirtual );
+ tagBuilder.setStatic( isStatic );
+ tagBuilder.setInline( isInline );
+ tagBuilder.setPure( false );
+ tagBuilder.setConst( d->constant() != 0 );
+ tagBuilder.setSignal( m_inSignals );
+ tagBuilder.setSlot( m_inSlots );
+
+ m_catalog->addItem( tag );
+
+ if ( !m_currentAccess.isEmpty() )
+ {
+ tag.setKind( Tag::Kind_FunctionDeclaration );
+ m_catalog->addItem( tag );
+ }
+}
+
+void TagCreator::parseLinkageBody( LinkageBodyAST* ast )
+{
+ QPtrList<DeclarationAST> l = ast->declarationList();
+ QPtrListIterator<DeclarationAST> it( l );
+ while ( it.current() )
+ {
+ parseDeclaration( it.current() );
+ ++it;
+ }
+}
+
+void TagCreator::checkTemplateDeclarator( Tag& tag ) {
+ if( !m_currentTemplateDeclarator.empty() && m_currentTemplateDeclarator.top() != 0) {
+ TemplateDeclarationAST* a = m_currentTemplateDeclarator.top();
+
+ m_currentTemplateDeclarator.pop();
+ m_currentTemplateDeclarator.push(0);
+
+ ///the template-declarator belongs to exactly this declaration
+ takeTemplateParams( tag, a );
+ }
+}
+
+
+void TagCreator::takeTemplateParams( Tag& target, TemplateDeclarationAST* ast) {
+ TemplateParameterListAST* pl = ast->templateParameterList();
+ if( pl ) {
+ QPtrList<TemplateParameterAST> list = pl->templateParameterList();
+
+ TemplateParameterAST* curr = list.first();
+ while( curr != 0 ) {
+ QString a, b;
+ if( curr->typeParameter() ) {
+ if( curr->typeParameter()->name() )
+ a = curr->typeParameter()->name()->text();
+ if( curr->typeParameter()->typeId() )
+ b = curr->typeParameter()->typeId()->text();
+ }
+
+ target.addTemplateParam( a, b );
+ curr = list.next();
+ }
+ }
+}
+
+
+void TagCreator::parseClassSpecifier( ClassSpecifierAST* ast )
+{
+ int startLine, startColumn;
+ int endLine, endColumn;
+ ast->getStartPosition( &startLine, &startColumn );
+ ast->getEndPosition( &endLine, &endColumn );
+
+ QString oldAccess = m_currentAccess;
+ bool oldInSlots = m_inSlots;
+ bool oldInSignals = m_inSignals;
+
+ QString kind = ast->classKey() ->text();
+ if ( kind == "class" )
+ m_currentAccess = "private";
+ else
+ m_currentAccess = "public";
+ m_inSlots = false;
+ m_inSignals = false;
+
+ QString className;
+ if ( !ast->name() )
+ {
+ //QFileInfo fileInfo( m_fileName );
+ //QString shortFileName = fileInfo.baseName();
+ //className.sprintf( "(%s_%d)", shortFileName.local8Bit(), m_anon++ );
+ }
+ else
+ {
+ className = ast->name() ->text();
+ }
+
+ Tag tag;
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ tag.setKind( Tag::Kind_Class );
+
+ tag.setFileName( m_fileName );
+
+ int i = className.find( '<' );
+ QString specialization;
+
+ if( i != -1 ) {
+ specialization = className.mid( i );
+ tag.setSpecializationDeclaration( specialization );
+ className = className.left( i );
+ }
+
+ tag.setName( className );
+ tag.setScope( m_currentScope );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ checkTemplateDeclarator( tag );
+
+ m_catalog->addItem( tag );
+
+ if ( ast->baseClause() )
+ parseBaseClause( tag.path()+specialization, ast->baseClause() );
+
+ m_currentScope.push_back( className + specialization );
+ int oldInClass = m_inClass;
+ m_inClass = true;
+ TreeParser::parseClassSpecifier( ast );
+ m_currentScope.pop_back();
+ m_inClass = oldInClass;
+
+ m_currentAccess = oldAccess;
+ m_inSlots = oldInSlots;
+ m_inSignals = oldInSignals;
+}
+
+void TagCreator::parseEnumSpecifier( EnumSpecifierAST* ast )
+{
+ Tag tag;
+ if( !ast->comment().isEmpty() )
+ tag.setComment( ast->comment() );
+
+ tag.setKind( Tag::Kind_Enum );
+
+ tag.setFileName( m_fileName );
+ if ( ast->name() )
+ tag.setName( ast->name() ->text() );
+ tag.setScope( m_currentScope );
+
+ int line, col;
+ ast->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ ast->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ QPtrList<EnumeratorAST> l = ast->enumeratorList();
+ QPtrListIterator<EnumeratorAST> it( l );
+ while ( it.current() )
+ {
+ QString name = it.current() ->id() ->text();
+
+ Tag tag;
+ tag.setKind( Tag::Kind_Enumerator );
+ tag.setComment( it.current()->comment() );
+
+ tag.setFileName( m_fileName );
+ tag.setName( name );
+ tag.setScope( m_currentScope );
+
+ if( ast->name() ) {
+ tag.setAttribute( "enum", ast->name()->text() );
+ } else {
+ tag.setAttribute( "enum", "const int" );
+ }
+
+ int line, col;
+ it.current() ->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ it.current() ->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ ++it;
+ }
+
+ TreeParser::parseEnumSpecifier( ast );
+}
+
+void TagCreator::parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl )
+{
+ DeclaratorAST * d = decl->declarator();
+
+ if ( !d )
+ return ;
+
+ if ( !d->subDeclarator() && d->parameterDeclarationClause() )
+ return parseFunctionDeclaration( funSpec, storageSpec, typeSpec, decl );
+
+ DeclaratorAST* t = d;
+ while ( t && t->subDeclarator() )
+ t = t->subDeclarator();
+
+ QString id;
+ if ( t && t->declaratorId() && t->declaratorId() ->unqualifiedName() )
+ id = t->declaratorId() ->unqualifiedName() ->text();
+
+ QString scopeStr = scopeOfDeclarator( d );
+
+ QString type = typeOfDeclaration( typeSpec, d );
+
+
+ bool isFriend = false;
+ //bool isVirtual = false;
+ bool isStatic = false;
+ //bool isInline = false;
+ //bool isInitialized = decl->initializer() != 0;
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+ Tag tag;
+ CppVariable<Tag> tagBuilder( tag );
+
+ tag.setKind( Tag::Kind_Variable );
+ tag.setFileName( m_fileName );
+ tag.setName( id );
+ tag.setScope( QStringList::split( ".", scopeStr ) );
+ if( !comment().isEmpty() )
+ tag.setComment( comment() );
+
+ int line, col;
+ decl->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ decl->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ tagBuilder.setType( type );
+ tagBuilder.setFriend( isFriend );
+ tagBuilder.setStatic( isStatic );
+ tagBuilder.setAccess( TagUtils::stringToAccess( m_currentAccess ) );
+
+ m_catalog->addItem( tag );
+}
+
+void TagCreator::parseAccessDeclaration( AccessDeclarationAST * access )
+{
+ QPtrList<AST> l = access->accessList();
+
+ m_currentAccess = l.at( 0 )->text();
+ if( m_currentAccess == "signals" )
+ m_currentAccess = "protected";
+
+ m_inSlots = l.count() > 1 ? l.at( 1 )->text() == "slots" : false;
+ m_inSignals = l.count() >= 1 ? l.at( 0 )->text() == "signals" : false;
+}
+
+void TagCreator::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageSpec,
+ TypeSpecifierAST * typeSpec, InitDeclaratorAST * decl )
+{
+ bool isFriend = false;
+ bool isVirtual = false;
+ bool isStatic = false;
+ bool isInline = false;
+ bool isPure = decl->initializer() != 0;
+
+ if ( funSpec )
+ {
+ QPtrList<AST> l = funSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "virtual" )
+ isVirtual = true;
+ else if ( text == "inline" )
+ isInline = true;
+ ++it;
+ }
+ }
+
+ if ( storageSpec )
+ {
+ QPtrList<AST> l = storageSpec->nodeList();
+ QPtrListIterator<AST> it( l );
+ while ( it.current() )
+ {
+ QString text = it.current() ->text();
+ if ( text == "friend" )
+ isFriend = true;
+ else if ( text == "static" )
+ isStatic = true;
+ ++it;
+ }
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+ decl->getStartPosition( &startLine, &startColumn );
+ decl->getEndPosition( &endLine, &endColumn );
+
+ DeclaratorAST* d = decl->declarator();
+ QString id = d->declaratorId() ->unqualifiedName() ->text();
+
+ QString type = typeOfDeclaration( typeSpec, d );
+
+ Tag tag;
+ CppFunction<Tag> tagBuilder( tag );
+
+ if( !comment().isEmpty() )
+ tag.setComment( comment() );
+ tag.setKind( Tag::Kind_FunctionDeclaration );
+ tag.setFileName( m_fileName );
+ tag.setName( id );
+ tag.setScope( m_currentScope );
+
+ int line, col;
+ decl->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ decl->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ tagBuilder.setType( type );
+ tagBuilder.setFriend( isFriend );
+ tagBuilder.setVirtual( isVirtual );
+ tagBuilder.setStatic( isStatic );
+ tagBuilder.setInline( isInline );
+ tagBuilder.setPure( isPure );
+ tagBuilder.setConst( d->constant() != 0 );
+ tagBuilder.setSignal( m_inSignals );
+ tagBuilder.setSlot( m_inSlots );
+
+ parseFunctionArguments( tag, d );
+ checkTemplateDeclarator( tag );
+
+ QString arguments = tag.attribute( "a" ).toStringList().join( "," );
+ QString scopeStr = m_currentScope.join( "::" );
+ tag.setAttribute( "description", m_documentation->functionDescription( scopeStr, id, type, arguments ) );
+
+ m_catalog->addItem( tag );
+}
+
+void TagCreator::parseFunctionArguments( Tag& tag, DeclaratorAST* declarator )
+{
+ ParameterDeclarationClauseAST* clause = declarator->parameterDeclarationClause();
+
+ QStringList types;
+ QStringList args;
+ if( clause && clause->parameterDeclarationList() ){
+ ParameterDeclarationListAST* params = clause->parameterDeclarationList();
+ QPtrList<ParameterDeclarationAST> l( params->parameterList() );
+ QPtrListIterator<ParameterDeclarationAST> it( l );
+
+ while( it.current() ){
+ ParameterDeclarationAST* param = it.current();
+ ++it;
+
+ QString name;
+ if( param->declarator() ){
+ name = declaratorToString(param->declarator(), QString::null, true );
+ }
+
+ QString type = typeOfDeclaration( param->typeSpec(), param->declarator() );
+
+ types << type;
+ args << name;
+ }
+
+ if( clause->ellipsis() ){
+ types << "...";
+ args << "";
+ }
+
+ }
+
+ CppFunction<Tag> tagBuilder( tag );
+
+ tagBuilder.setArguments( types );
+ tagBuilder.setArgumentNames( args );
+}
+
+QString TagCreator::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator )
+{
+ if( !typeSpec || !declarator )
+ return QString::null;
+
+ QString text;
+
+ text += typeSpec->text();
+ text = text.simplifyWhiteSpace();
+
+ QPtrList<AST> ptrOpList = declarator->ptrOpList();
+ for( QPtrListIterator<AST> it(ptrOpList); it.current(); ++it )
+ text += it.current()->text();
+
+ for( int a = 0; a < declarator->arrayDimensionList().count(); a++ )
+ text += "*";
+
+ return text;
+}
+
+void TagCreator::parseBaseClause( const QString& className, BaseClauseAST * baseClause )
+{
+ QPtrList<BaseSpecifierAST> l = baseClause->baseSpecifierList();
+ QPtrListIterator<BaseSpecifierAST> it( l );
+ while ( it.current() )
+ {
+ BaseSpecifierAST * baseSpecifier = it.current();
+
+ QString access;
+ if ( baseSpecifier->access() )
+ access = baseSpecifier->access() ->text();
+ bool isVirtual = baseSpecifier->isVirtual() != 0;
+
+ if( baseSpecifier->name() == 0 ) return; ///Workaround for some bug elsewhere
+
+ QString baseName;
+ if ( baseSpecifier->name() )
+ baseName = baseSpecifier->name() ->text();
+
+ Tag tag;
+ CppBaseClass<Tag> tagBuilder( tag );
+
+ tag.setKind( Tag::Kind_Base_class );
+ tag.setFileName( m_fileName );
+ tag.setName( className );
+ tag.setScope( m_currentScope );
+
+ tagBuilder.setBaseClass( baseName );
+ tagBuilder.setVirtual( isVirtual );
+ tagBuilder.setAccess( TagUtils::stringToAccess( access ) );
+
+ int line, col;
+ baseClause->getStartPosition( &line, &col );
+ tag.setStartPosition( line, col );
+
+ baseClause->getEndPosition( &line, &col );
+ tag.setEndPosition( line, col );
+
+ m_catalog->addItem( tag );
+
+ ++it;
+ }
+}
+
+QString TagCreator::scopeOfDeclarator( DeclaratorAST* d )
+{
+ QStringList scope = m_currentScope;
+ if ( d && d->declaratorId() && d->declaratorId() ->classOrNamespaceNameList().count() )
+ {
+ if ( d->declaratorId() ->isGlobal() )
+ scope.clear();
+ QPtrList<ClassOrNamespaceNameAST> l = d->declaratorId() ->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> it( l );
+ while ( it.current() )
+ {
+ if ( it.current() ->name() )
+ scope << it.current() ->name() ->text();
+
+ ++it;
+ }
+ }
+
+ return scope.join( "." );
+}
+
+int TagUtils::stringToAccess( const QString & access )
+{
+ QStringList l = QStringList()
+ << "public" << "protected" << "private"
+ << "public slots" << "protected slots" << "private slots"
+ << "signals";
+
+ int idx = l.findIndex( access );
+ return idx == -1 ? 0 : idx+1;
+}
+
+QString TagUtils::accessToString( int id )
+{
+ if( id == 0 ) return "unknown";
+
+ QStringList l = QStringList()
+ << "public" << "protected" << "private"
+ << "public slots" << "protected slots" << "private slots"
+ << "signals";
+
+ if( l.at(id-1) != l.end() )
+ return l[ id-1 ];
+
+ return QString::null;
+}
+
+//kate: indent-mode csands; tab-width 4; space-indent off;
diff --git a/languages/cpp/tag_creator.h b/languages/cpp/tag_creator.h
new file mode 100644
index 00000000..47d0b66f
--- /dev/null
+++ b/languages/cpp/tag_creator.h
@@ -0,0 +1,131 @@
+/***************************************************************************
+* Copyright (C) 2003 by Roberto Raggi *
+* roberto@kdevelop.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#ifndef __tag_creator_h
+#define __tag_creator_h
+
+#include "tree_parser.h"
+
+#include <qstringlist.h>
+#include <qvaluestack.h>
+
+class Catalog;
+class Tag;
+
+namespace TagUtils
+{
+ int stringToAccess( const QString& access );
+ QString accessToString( int id );
+}
+
+class TagCreator: public TreeParser
+{
+public:
+ TagCreator( const QString& fileName, Catalog* c );
+ virtual ~TagCreator();
+
+ // translation-unit
+ virtual void parseTranslationUnit( const ParsedFile& );
+
+ // declarations
+ virtual void parseDeclaration( DeclarationAST* );
+ virtual void parseNamespace( NamespaceAST* );
+ virtual void parseNamespaceAlias( NamespaceAliasAST* decl );
+ virtual void parseUsingDirective( UsingDirectiveAST* );
+ virtual void parseTypedef( TypedefAST* );
+ virtual void parseTemplateDeclaration( TemplateDeclarationAST* );
+ virtual void parseSimpleDeclaration( SimpleDeclarationAST* );
+ virtual void parseFunctionDefinition( FunctionDefinitionAST* );
+ virtual void parseLinkageBody( LinkageBodyAST* );
+ virtual void parseAccessDeclaration( AccessDeclarationAST* );
+
+ // type-specifier
+ virtual void parseClassSpecifier( ClassSpecifierAST* );
+ virtual void parseEnumSpecifier( EnumSpecifierAST* );
+ virtual void parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* );
+
+ virtual void parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl );
+ virtual void parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl );
+ virtual void parseFunctionArguments( Tag& tag, DeclaratorAST* declarator );
+ virtual void parseBaseClause( const QString& className, BaseClauseAST* baseClause );
+
+ /**
+ call this function after the last use of a TagCreator object, to do cleanup work
+ */
+ static void destroyDocumentation();
+
+ /**
+ This sets the directories, where the doxygen documentation should be searched in.
+ @param dirs QStringList containing strings, which define the pathes, where documentation is searched in
+ */
+ static void setDocumentationDirectories( const QStringList& dirs );
+
+
+private:
+ QString scopeOfDeclarator( DeclaratorAST* d );
+ QString typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator );
+
+private:
+
+ void takeTemplateParams( Tag& target, TemplateDeclarationAST* ast );
+ void checkTemplateDeclarator( Tag& tag );
+
+ class CommentPusher {
+ TagCreator& m_ref;
+ public:
+ CommentPusher( TagCreator& ref, QString comment ) : m_ref( ref ) {
+ m_ref.pushComment( comment );
+ }
+ ~CommentPusher() {
+ m_ref.popComment();
+ }
+ };
+
+ QStringList m_comments;
+
+ QString comment() {
+ if( m_comments.isEmpty() ) {
+ return "";
+ } else {
+ return m_comments.front();
+ }
+ }
+
+ void pushComment( QString comm ) {
+ m_comments.push_front( comm );
+ }
+
+ void popComment() {
+ m_comments.pop_front();
+ }
+
+ Catalog* m_catalog;
+ QString m_fileName;
+ QStringList m_currentScope;
+ QValueList<QStringList> m_imports;
+ QString m_currentAccess;
+ bool m_inClass;
+ bool m_inSlots;
+ bool m_inSignals;
+ int m_anon;
+
+ QValueStack<TemplateDeclarationAST*> m_currentTemplateDeclarator;
+
+ static class DoxyDoc* m_documentation;
+
+private:
+ TagCreator( const TagCreator& source );
+ void operator = ( const TagCreator& source );
+};
+
+#endif // __tag_creator_h
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/templates/Makefile.am b/languages/cpp/templates/Makefile.am
new file mode 100644
index 00000000..21f95fa8
--- /dev/null
+++ b/languages/cpp/templates/Makefile.am
@@ -0,0 +1,2 @@
+templatesdata_DATA = default.cpp default.h
+templatesdatadir = $(kde_datadir)/kdevcppsupport/templates
diff --git a/languages/cpp/templates/default.cpp b/languages/cpp/templates/default.cpp
new file mode 100644
index 00000000..9f3c6258
--- /dev/null
+++ b/languages/cpp/templates/default.cpp
@@ -0,0 +1,12 @@
+// -*-c++-*-
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/cpp/templates/default.h b/languages/cpp/templates/default.h
new file mode 100644
index 00000000..aa63e1e2
--- /dev/null
+++ b/languages/cpp/templates/default.h
@@ -0,0 +1,12 @@
+// -*-c++-*-
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/cpp/typedecoration.h b/languages/cpp/typedecoration.h
new file mode 100644
index 00000000..3d2e8382
--- /dev/null
+++ b/languages/cpp/typedecoration.h
@@ -0,0 +1,119 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __TYPEDECORATION_H__
+#define __TYPEDECORATION_H__
+
+
+class TypeDecoration {
+
+ public:
+ TypeDecoration() {
+ }
+
+ ///Removes the decoration from the given string
+ TypeDecoration( QString& str ) {
+ init( str );
+ }
+
+ ~TypeDecoration() {}
+
+ ///Removes the decoration from the assigned
+ TypeDecoration& operator = ( QString& str ) {
+ clear();
+ init( str );
+ return *this;
+ }
+
+ QString apply( const QString& str ) const {
+ QString ret = str;
+ if ( !ret.startsWith( m_decoration_front ) )
+ ret = m_decoration_front + ret;
+
+ if ( !ret.endsWith( m_decoration_back ) )
+ ret = ret + m_decoration_back;
+ return ret;
+ }
+
+ void operator += ( const TypeDecoration& rhs ) {
+ if ( !m_decoration_front.contains( rhs.m_decoration_front ) )
+ m_decoration_front += rhs.m_decoration_front;
+ if ( !m_decoration_back.contains( rhs.m_decoration_back ) )
+ m_decoration_back += rhs.m_decoration_back;
+ }
+
+ void clear() {
+ m_decoration_front = QString();
+ m_decoration_back = QString();
+ }
+
+ void prepend( const QString& str ) {
+ m_decoration_front = str + m_decoration_front;
+ }
+
+ /*bool smaller( const TypeDecoration& rhs ) const {
+ }
+
+ int depth() const {
+
+ }*/
+
+ private:
+ void init( QString& str ) {
+ str = str.stripWhiteSpace();
+
+ static const QString cnst = "const";
+ static const QString ref = "&";
+ if ( str.startsWith( cnst ) ) {
+ str.remove( 0, cnst.length() );
+ if( str.isEmpty() || ( !str[0].isLetterOrNumber() && str[0] != '_' ) ) {
+ m_decoration_front += cnst + " ";
+ str = str.stripWhiteSpace();
+ } else {
+ str = cnst + str; ///The const was not alone
+ }
+ }
+
+ if( str.endsWith( cnst ) ) {
+ str.remove( str.length() - cnst.length(), cnst.length() );
+ if( str.isEmpty() || ( !str[str.length()-1].isLetterOrNumber() && str[str.length()-1] != '_' ) ) {
+ m_decoration_back = (m_decoration_back + " " + cnst);
+ str = str.stripWhiteSpace();
+ } else {
+ str = str + cnst; ///The const was not alone
+ }
+ }
+
+ if ( str.endsWith( ref ) ) {
+ m_decoration_back = ref + m_decoration_back;
+ str = str.remove( str.length() - ref.length(), ref.length() ).stripWhiteSpace();
+
+ if( str.endsWith( cnst ) ) {
+ str.remove( str.length() - cnst.length(), cnst.length() );
+ if( str.isEmpty() || ( !str[str.length()-1].isLetterOrNumber() && str[str.length()-1] != '_' ) ) {
+ m_decoration_back = m_decoration_back + " " + cnst;
+ str = str.stripWhiteSpace();
+ } else {
+ str = str + cnst; ///The const was not alone
+ }
+ }
+ }
+ }
+
+ QString m_decoration_front, m_decoration_back;
+};
+
+#endif
+// kate: indent-mode csands; tab-width 4;
+
diff --git a/languages/cpp/typedesc.cpp b/languages/cpp/typedesc.cpp
new file mode 100644
index 00000000..2e4e28a0
--- /dev/null
+++ b/languages/cpp/typedesc.cpp
@@ -0,0 +1,788 @@
+/***************************************************************************
+ cppcodecompletion.cpp - description
+ -------------------
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "typedesc.h"
+#include "stringhelpers.h"
+#include "simpletype.h"
+
+#include "driver.h"
+#include "lexer.h"
+#include "parser.h"
+#include <qtextstream.h>
+
+#include <kglobal.h>
+
+const char* TypeDesc::functionMark = "[function] ";
+
+///Activated because of expressions like "const char* const"(the other algorithm chooses the const)
+//#define USELEXER
+
+using namespace StringHelpers;
+
+struct LocateResult::D {
+ TypeDesc m_desc;
+};
+
+LocateResult& LocateResult::operator = ( const TypeDesc& rhs ) {
+ *this = LocateResult( rhs );
+ return *this;
+}
+
+LocateResult::LocateResult() : d( new D() ), m_resolutionCount( 0 ), m_flags( NoFlag ), m_trace( 0 ), m_locateDepth( 0 ) {}
+
+LocateResult::LocateResult( const TypeDesc& desc ) : d( new D() ), m_resolutionCount( 0 ), m_flags( NoFlag ), m_trace( 0 ), m_locateDepth( 0 ) {
+ d->m_desc = desc;
+}
+
+LocateResult::LocateResult( const TypeDescPointer& desc ) : d( new D() ), m_resolutionCount( 0 ), m_flags( NoFlag ), m_trace( 0 ), m_locateDepth( 0 ) {
+ d->m_desc = *desc;
+}
+
+LocateResult::LocateResult( TypeDescShared* desc ) : d( new D() ), m_resolutionCount( 0 ), m_flags( NoFlag ), m_trace( 0 ), m_locateDepth( 0 ) {
+ d->m_desc = *desc;
+}
+
+LocateResult::LocateResult( const LocateResult& rhs ) : d( new D() ), m_resolutionCount( rhs.m_resolutionCount ), m_flags( rhs.m_flags ), m_trace( 0 ), m_locateDepth( rhs.m_locateDepth ) {
+ d->m_desc = rhs.d->m_desc;
+ if ( rhs.m_trace )
+ m_trace = new TypeTrace( *rhs.m_trace );
+}
+
+
+LocateResult::~LocateResult() {
+ if ( m_trace )
+ delete m_trace;
+ delete d;
+}
+
+LocateResult& LocateResult::operator = ( const LocateResult& rhs ) {
+ if ( &rhs == this )
+ return * this;
+ d->m_desc = rhs.d->m_desc;
+ m_locateDepth = rhs.m_locateDepth;
+ m_flags = rhs.m_flags;
+ m_resolutionCount = rhs.m_resolutionCount;
+
+ if ( m_trace )
+ delete m_trace;
+ if ( !rhs.m_trace ) {
+ m_trace = 0;
+ } else {
+ m_trace = new TypeTrace( *rhs.m_trace );
+ }
+ return *this;
+}
+
+
+LocateResult::operator const TypeDesc&() const {
+ return d->m_desc;
+}
+
+LocateResult::operator TypeDesc&() {
+ return d->m_desc;
+}
+
+TypeDesc& LocateResult::desc() {
+ return d->m_desc;
+}
+
+const TypeDesc& LocateResult::desc() const {
+ return d->m_desc;
+}
+
+const TypeDesc* LocateResult::operator ->() const {
+ return &d->m_desc;
+}
+
+TypeDesc* LocateResult::operator ->() {
+ return &d->m_desc;
+}
+
+LocateResult::operator bool() const {
+ return d->m_desc;
+}
+
+/*
+LocateResult::operator TypeDescPointer() {
+ if ( !m_desc )
+ m_desc = new TypeDescShared();
+ return m_desc;
+}*/
+
+
+void LocateResult::addResolutionFlag( ResolutionFlags flag ) {
+ m_flags = addFlag( flag, m_flags );
+}
+
+bool LocateResult::hasResolutionFlag( ResolutionFlags flag ) const {
+ return ( bool ) ( m_flags & flag );
+}
+
+TypeTrace* LocateResult::trace() {
+ if ( !m_trace )
+ m_trace = new TypeTrace();
+ return m_trace;
+}
+
+TypeDesc::TypeDesc() {}
+
+TypeDesc::TypeDesc( const QString& name ) {
+ init( name );
+}
+
+TypeDesc::TypeDesc( const TypeDesc& rhs ) {
+ *this = rhs;
+}
+
+bool TypeDesc::isValidType() const {
+ if ( !m_data )
+ return false;
+ if ( m_data->m_cleanName.find( "->" ) != -1 || m_data->m_cleanName.contains( '.' ) || m_data->m_cleanName.contains( ' ' ) || m_data->m_cleanName.isEmpty() )
+ return false;
+
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ if ( !( *it ) ->isValidType() )
+ return false;
+ }
+
+ if ( m_data->m_nextType )
+ if ( !m_data->m_nextType->isValidType() )
+ return false;
+ return true;
+}
+
+TypeDesc& TypeDesc::operator = ( const TypeDesc& rhs ) {
+ m_data = rhs.m_data;
+ return *this;
+}
+
+void TypeDesc::prependDecoration( const QString& str ) {
+ makePrivate();
+ m_data->m_dec.prepend( str );
+}
+
+int TypeDesc::depth() const {
+ if ( !m_data )
+ return 0;
+ int ret = 1;
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ ret = kMax( ( *it ) ->depth() + 1, ret );
+ }
+
+ if ( m_data->m_nextType ) {
+ ret = kMax( m_data->m_nextType->depth(), ret );
+ }
+
+ return ret;
+}
+
+int TypeDesc::length() const {
+ if ( !m_data )
+ return 0;
+ if ( !m_data->m_nextType && m_data->m_cleanName.isEmpty() )
+ return 0;
+ return m_data->m_nextType ? 1 + m_data->m_nextType->length() : 1;
+}
+
+HashedStringSet TypeDesc::includeFiles() const {
+ if( !m_data ) return HashedStringSet();
+ return m_data->m_includeFiles;
+}
+
+void TypeDesc::setIncludeFiles( const HashedStringSet& files ) {
+ makeDataPrivate();
+ m_data->m_includeFiles = files;
+ for ( TemplateParams::iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ (*it)->setIncludeFiles( files );
+ }
+ if( m_data->m_nextType ) {
+ if( m_data->m_nextType->_KShared_count() != 1 )
+ m_data->m_nextType = new TypeDescShared( *(m_data->m_nextType) );
+ m_data->m_nextType->setIncludeFiles( files );
+ }
+}
+
+void TypeDesc::addIncludeFiles( const HashedStringSet& files ) {
+ makeDataPrivate();
+ m_data->m_includeFiles += files;
+ for ( TemplateParams::iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ (*it)->addIncludeFiles( files );
+ }
+ if( m_data->m_nextType ) {
+ if( m_data->m_nextType->_KShared_count() != 1 )
+ m_data->m_nextType = new TypeDescShared( *(m_data->m_nextType) );
+ m_data->m_nextType->addIncludeFiles( files );
+ }
+}
+
+size_t TypeDescData::hashKey() {
+ size_t ret = 0;
+ if ( m_hashValid ) {
+ ret = m_hashKey;
+ } else {
+ ret += 89 * m_pointerDepth;
+ ret += 101 * m_functionDepth;
+
+ int len = m_cleanName.length();
+ for ( int a = 0; a < len; a++ )
+ ret += m_cleanName[ a ].unicode() * 3 * (11*(a+1));
+
+
+ int n = 1;
+ for ( TemplateParams::const_iterator it = m_templateParams.begin(); it != m_templateParams.end() ; ++it ) {
+ ret += 107 * n * ( *it ) ->hashKey();
+ n++;
+ }
+
+ m_hashKey = ret;
+ m_hashValid = true;
+ }
+
+ if ( m_nextType )
+ ret += 109 * m_nextType->hashKey();
+ return ret;
+}
+
+size_t TypeDescData::hashKey2() {
+ size_t ret = 0;
+ if( m_hash2Valid ) {
+ ret = m_hashKey2;
+ } else {
+ ret += 13 * m_pointerDepth;
+ ret += 17 * m_functionDepth;
+
+ int len = m_cleanName.length();
+ for ( int a = 0; a < len; a++ )
+ ret += m_cleanName[ a ].unicode() * 19 * (7*(a+1));
+
+
+ int n = 1;
+ for ( TemplateParams::const_iterator it = m_templateParams.begin(); it != m_templateParams.end() ; ++it ) {
+ ret += 23 * n * ( *it ) ->hashKey2();
+ n++;
+ }
+ m_hashKey2 = ret;
+ m_hash2Valid = true;
+ }
+
+ if ( m_nextType )
+ ret += 29 * m_nextType->hashKey2();
+ return ret;
+}
+
+///Something is wrong with this function.. so i use the string-comparison
+int TypeDesc::compare ( const TypeDesc& rhs ) const {
+ if ( m_data == rhs.m_data )
+ return 0;
+ if ( !m_data )
+ return -1;
+ if ( !rhs.m_data )
+ return 1;
+
+ /*static int dpth = 0;
+ dpth++;
+ if( dpth == 1 && (*this == rhs) )kdDebug( 9007 ) << "failed comparing " << fullNameChain() << " and " << rhs.fullNameChain() << " hashes: " << hashKey() << " " << rhs.hashKey() << endl;
+ dpth--;*/
+
+ if ( m_data->m_functionDepth != rhs.m_data->m_functionDepth ) {
+ if ( m_data->m_functionDepth < rhs.m_data->m_functionDepth )
+ return -1;
+ else
+ return 1;
+ }
+
+ if ( m_data->m_pointerDepth != rhs.m_data->m_pointerDepth ) {
+ if ( m_data->m_pointerDepth < rhs.m_data->m_pointerDepth )
+ return -1;
+ else
+ return 1;
+ }
+
+ if ( m_data->m_cleanName != rhs.m_data->m_cleanName ) {
+ if ( m_data->m_cleanName < rhs.m_data->m_cleanName )
+ return -1;
+ else
+ return 1;
+ }
+ if ( m_data->m_templateParams.size() != rhs.m_data->m_templateParams.size() ) {
+ if ( m_data->m_templateParams.size() < rhs.m_data->m_templateParams.size() )
+ return -1;
+ else
+ return 1;
+ }
+
+ TemplateParams::const_iterator it2 = rhs.m_data->m_templateParams.begin();
+ TemplateParams::const_iterator it = m_data->m_templateParams.begin();
+
+ for ( ; it != m_data->m_templateParams.end() && it2 != rhs.m_data->m_templateParams.end(); ) {
+ int cmp = ( *it ) ->compare( **it2 );
+ if ( cmp != 0 ) {
+ return cmp;
+ }
+ ++it2;
+ ++it;
+ }
+
+ if ( !( ( bool ) m_data->m_nextType ) != ( ( bool ) rhs.m_data->m_nextType ) ) {
+ if ( m_data->m_nextType )
+ return 1;
+ else
+ return -1;
+ }
+
+ if ( m_data->m_nextType && rhs.m_data->m_nextType )
+ return m_data->m_nextType->compare( *rhs.m_data->m_nextType );
+
+ return 0;
+}
+
+#ifdef USE_TEXT_STREAM
+QString TypeDesc::nameWithParams() const {
+ if ( !m_data )
+ return "";
+
+ QString ret;
+ {
+ QTextStream s( &ret, IO_WriteOnly );
+ s << m_data->m_cleanName;
+ if ( !m_data->m_templateParams.isEmpty() ) {
+ s << "<";
+ bool first = true;
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ if ( !first )
+ s << ", ";
+ s << ( *it ) ->fullNameChain();
+ first = false;
+ }
+ }
+ s << ">";
+ }
+ return ret;
+}
+
+#else
+
+QString TypeDesc::nameWithParams() const {
+ if( compare( *this ) != 0 ) {
+ compare( *this );
+ }
+ if ( !m_data )
+ return "";
+
+ QString ret = m_data->m_cleanName;
+ if ( !m_data->m_templateParams.isEmpty() ) {
+ ret += "<";
+ bool first = true;
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ if ( !first )
+ ret += ", ";
+ ret += ( *it ) ->fullNameChain();
+ first = false;
+ }
+ ret += ">";
+ }
+ return ret;
+}
+
+#endif
+
+QString TypeDesc::fullName( ) const {
+ if ( !m_data )
+ return "";
+
+ QString ret = nameWithParams();
+ for ( int a = 0; a < m_data->m_functionDepth; ++a )
+ ret = QString( functionMark ) + ret;
+ for ( int a = 0; a < m_data->m_pointerDepth; ++a )
+ ret += "*";
+ return m_data->m_dec.apply( ret );
+}
+
+size_t TypeDesc::hashKey() const {
+ if ( !m_data )
+ return 0;
+ size_t ret = const_cast<TypeDescData*>( m_data.data() ) ->hashKey();
+ //kdDebug( 9007 ) << "computed hash-key: " << fullName() << ": " << ret << endl;
+ return ret;
+}
+
+size_t TypeDesc::hashKey2() const {
+ if ( !m_data )
+ return 0;
+ size_t ret = const_cast<TypeDescData*>( m_data.data() ) ->hashKey2();
+ //kdDebug( 9007 ) << "computed hash-key: " << fullName() << ": " << ret << endl;
+ return ret;
+}
+
+QString TypeDesc::fullNameChain( ) const {
+ if ( !m_data )
+ return "";
+ QString ret = fullName();
+ if ( m_data->m_nextType ) {
+ ret += "::" + m_data->m_nextType->fullNameChain();
+ }
+ return m_data->m_dec.apply( ret );
+}
+
+QString TypeDesc::fullTypeStructure() const {
+ if ( !m_data )
+ return "";
+
+ QString ret = m_data->m_cleanName;
+ if ( !m_data->m_templateParams.isEmpty() ) {
+ ret += "<";
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ ret += ( *it ) ->fullTypeStructure();
+ ret += ", ";
+ }
+ ret.truncate( ret.length() - 2 );
+ ret += ">";
+ }
+ return ret;
+}
+
+
+QStringList TypeDesc::fullNameList( ) const {
+ if ( !m_data )
+ return "";
+ QStringList ret;
+ ret << fullName();
+ if ( m_data->m_nextType ) {
+ ret += m_data->m_nextType->fullNameList();
+ }
+ return ret;
+}
+
+
+/// The template-params may be changed in-place
+/// this list is local, but the params pointed by them not
+TypeDesc::TemplateParams& TypeDesc::templateParams() {
+ makeDataPrivate();
+ return m_data->m_templateParams;
+}
+
+const TypeDesc::TemplateParams& TypeDesc::templateParams() const {
+ const_cast<TypeDesc*>( this ) ->maybeInit();
+ return m_data->m_templateParams;
+}
+
+TypeDescPointer TypeDesc::next() {
+ if ( !m_data )
+ return 0;
+ return m_data->m_nextType;
+}
+
+KSharedPtr<const TypeDescShared> TypeDesc::next() const {
+ if ( !m_data )
+ return 0;
+ return m_data->m_nextType.data();
+}
+
+bool TypeDesc::hasTemplateParams() const {
+ if ( !m_data )
+ return false;
+ return !m_data->m_templateParams.isEmpty();
+}
+
+void TypeDesc::setNext( TypeDescPointer type ) {
+ makeDataPrivate();
+ m_data->m_nextType = type;
+}
+
+void TypeDesc::append( TypeDescPointer type ) {
+ if ( type ) {
+ makeDataPrivate();
+ if ( m_data->m_nextType )
+ m_data->m_nextType->append( type );
+ else
+ m_data->m_nextType = type;
+ }
+}
+
+TypePointer TypeDesc::resolved() const {
+ if ( !m_data )
+ return 0;
+ return m_data->m_resolved;
+}
+
+void TypeDesc::setResolved( TypePointer resolved ) {
+ makeDataPrivate();
+ m_data->m_resolved = resolved;
+}
+
+void TypeDesc::resetResolved() {
+ if ( !m_data )
+ return ;
+ makeDataPrivate();
+ m_data->m_resolved = 0;
+ if ( m_data->m_nextType )
+ m_data->m_nextType->resetResolved();
+}
+
+///Resets the resolved-pointers of this type, and all template-types
+void TypeDesc::resetResolvedComplete() {
+ if ( !m_data )
+ return ;
+ makeDataPrivate();
+ resetResolved();
+ for ( TemplateParams::iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it )
+ ( *it ) ->resetResolvedComplete();
+}
+
+///these might be changed in future to an own data-member
+void TypeDesc::increaseFunctionDepth() {
+ makeDataPrivate();
+ m_data->m_functionDepth++;
+}
+
+void TypeDesc::decreaseFunctionDepth() {
+ makeDataPrivate();
+ if ( m_data->m_functionDepth > 0 )
+ m_data->m_functionDepth--;
+}
+
+int TypeDesc::functionDepth() const {
+ if ( !m_data )
+ return 0;
+ return m_data->m_functionDepth;
+}
+
+void TypeDesc::takeInstanceInfo( const TypeDesc& rhs ) {
+ makeDataPrivate();
+ if( !rhs.m_data ) return;
+ m_data->m_pointerDepth += rhs.m_data->m_pointerDepth;
+ m_data->m_dec += rhs.m_data->m_dec;
+}
+
+void TypeDesc::clearInstanceInfo() {
+ if ( !m_data )
+ return ;
+ makeDataPrivate();
+ m_data->m_pointerDepth = 0;
+ m_data->m_dec.clear();
+}
+
+void TypeDesc::takeTemplateParams( const QString& string ) {
+ makeDataPrivate();
+ m_data->m_templateParams.clear();
+ for ( ParamIterator it( "<>", string ); it; ++it )
+ m_data->m_templateParams.append( new TypeDescShared( *it ) );
+}
+
+void TypeDesc::makeDataPrivate() {
+ if ( !m_data ) {
+ maybeInit();
+ return ;
+ }
+ if ( m_data.count() > 1 ) {
+ m_data = new TypeDescData( *m_data );
+ }
+ m_data->invalidateKey();
+}
+
+TypeDesc& TypeDesc::makePrivate() {
+ makeDataPrivate();
+ TemplateParams nList;
+ for ( TemplateParams::const_iterator it = m_data->m_templateParams.begin(); it != m_data->m_templateParams.end(); ++it ) {
+ TypeDescPointer tp( new TypeDescShared( ) );
+ *tp = **it;
+ tp->makePrivate();
+ nList.append( tp );
+ }
+ m_data->m_templateParams = nList;
+
+ if ( m_data->m_nextType ) {
+ TypeDescPointer tmp = m_data->m_nextType;
+ m_data->m_nextType = new TypeDescShared();
+ *m_data->m_nextType = *tmp;
+ m_data->m_nextType->makePrivate();
+ }
+ return *this;
+}
+
+int TypeDesc::totalPointerDepth() const {
+ if( next() )
+ return next()->totalPointerDepth();
+ else
+ return pointerDepth();
+}
+
+void TypeDesc::setTotalPointerDepth( int d ) {
+ makePrivate();
+ if( next() )
+ next()->setTotalPointerDepth( d );
+ else
+ setPointerDepth( d );
+}
+
+void TypeDesc::maybeInit() {
+ if ( m_data )
+ return ;
+ m_data = new TypeDescData();
+ m_data->m_pointerDepth = 0;
+ m_data->m_functionDepth = 0;
+ m_data->m_nextType = 0;
+ m_data->m_flags = Standard;
+}
+/*
+bool TypeDesc::decorationSmaller( const TypeDesc& rhs ) {
+ maybeInit();
+ rhs.maybeInit();
+ return m_data->m_dec.smaller( rhs.m_data.m_dec );
+
+}
+
+int TypeDesc::decorationDepth() {
+ if( !m_data ) return 0;
+ return m_data->m_dec.depth();
+}*/
+
+void TypeDesc::init( QString stri ) {
+ m_data = 0;
+ maybeInit();
+
+ if ( stri.isEmpty() )
+ return ;
+
+ m_data->m_dec = stri; ///Store the decoration
+
+ QStringList ls = splitType( stri );
+ QString str = ls.front().stripWhiteSpace();
+
+ ///Extract multiple types that may be written as a scope and put them to the next-types-list
+ if ( !ls.isEmpty() ) {
+ ls.pop_front();
+ if ( !ls.isEmpty() ) {
+ m_data->m_nextType = TypeDescPointer( new TypeDescShared( ls.join( "::" ) ) );
+ }
+ }
+
+ while ( str.startsWith( QString( functionMark ) ) ) {
+ m_data->m_functionDepth++;
+ str = str.mid( strlen( functionMark ) ).stripWhiteSpace();
+ }
+ bool isFunction = false, shorten = true;
+
+ //Little hack done for performance-reasons, to do less comparing
+ if( str.length() >= 4 ) {
+ QChar c = str[0];
+ switch( c.latin1() ) {
+ case 's':
+ if( str[1] == 'h' ) {
+ if( str.startsWith( "short" ) )
+ shorten = false;
+ } else if( str[1] == 'i' ) {
+ if( str.startsWith( "signed" ) )
+ shorten = false;
+ }
+ break;
+ case 'l':
+ if( str.startsWith( "long" ) )
+ shorten = false;
+ break;
+ case 'u':
+ if( str.startsWith( "unsigned" ) )
+ shorten = false;
+ break;
+ case 'o':
+ if( str.startsWith( "operator " ) ) {
+ isFunction = true;
+ shorten = false;
+ }
+ }
+ }
+
+ ///Since function-names are also processed by this function, this check has to be done
+ if( shorten ) {
+ ///Remove any prefixes like const or typename(very limited algorithm)
+ int len = str.find( "<" );
+ if ( len == -1 )
+ len = str.length();
+ int currentStart = 0;
+ bool wasEmpty = false;
+ for ( int a = 0; a < len; a++ ) {
+ if ( str[ a ] == ' ' ) {
+ wasEmpty = true;
+ } else if( wasEmpty && isValidIdentifierSign( str[a] ) ){
+ currentStart = a;
+ wasEmpty = false;
+ }
+ }
+ str = str.mid( currentStart );
+ }
+
+#ifdef USELEXER
+
+ Driver d;
+ Lexer lex( &d );
+ lex.setSource( str );
+ Parser parser( &d, &lex );
+
+ TypeSpecifierAST::Node typeSpec;
+ if ( parser.parseTypeSpecifier( typeSpec ) ) {
+ NameAST * name = typeSpec->name();
+
+ QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
+ QPtrListIterator<ClassOrNamespaceNameAST> it( l );
+
+ QString type;
+ while ( it.current() ) {
+ if ( it.current() ->name() ) {
+ type += it.current() ->name() ->text() + "::";
+ }
+ ++it;
+ }
+
+ if ( name->unqualifiedName() && name->unqualifiedName() ->name() ) {
+ type += name->unqualifiedName() ->name() ->text();
+ }
+
+ m_data->m_cleanName = type.stripWhiteSpace();
+ takeTemplateParams( str );
+ m_data->m_pointerDepth = countExtract( '*', str );
+ }
+#else
+ if( !isFunction ) {
+ takeData( str );
+ m_data->m_pointerDepth = countExtract( '*', str );
+ } else {
+ m_data->m_cleanName = str;
+ }
+
+#endif
+
+}
+
+void TypeDesc::takeData( const QString& string ) {
+ makeDataPrivate();
+ m_data->m_templateParams.clear();
+ ParamIterator it( "<>", string );
+ QString name = it.prefix();
+ name.remove( "*" );
+ name.remove( "&" );
+ m_data->m_cleanName = name.stripWhiteSpace();
+ for ( ; it; ++it )
+ m_data->m_templateParams.append( new TypeDescShared( *it ) );
+}
+
+TypeDesc operator + ( const TypeDesc& lhs, const TypeDesc& rhs ) {
+ TypeDesc ret = lhs;
+ ret.makePrivate();
+ ret.append( new TypeDescShared( rhs ) );
+ return ret;
+}
+
+
diff --git a/languages/cpp/typedesc.h b/languages/cpp/typedesc.h
new file mode 100644
index 00000000..924372df
--- /dev/null
+++ b/languages/cpp/typedesc.h
@@ -0,0 +1,403 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 __TYPEDESC_H__
+#define __TYPEDESC_H__
+
+#include <ktexteditor/codecompletioninterface.h>
+#include <ksharedptr.h>
+
+#include "includefiles.h"
+#include "typedecoration.h"
+
+class TypeDesc;
+class TypeDescShared;
+class SimpleTypeImpl;
+
+class TypeTrace;
+
+typedef KSharedPtr<TypeDescShared> TypeDescPointer;
+typedef KSharedPtr<SimpleTypeImpl> TypePointer;
+
+enum ResolutionFlags {
+ NoFlag = 0,
+ HadTypedef = 1,
+ HadTemplate = 2,
+ HadAlias = 3
+};
+
+class LocateResult {
+ public:
+ struct NewLocateMode { ///This is a helper that saves the influence on the behavior of locateType(..)
+ NewLocateMode() : mode(0), dir(0), valid(false) {
+ }
+ uint mode;
+ int dir;
+ bool valid;
+ };
+ private:
+ struct D;
+ D* d;
+ int m_resolutionCount;
+ ResolutionFlags m_flags;
+ TypeTrace* m_trace; ///pointer to the previous type in the trace-chain
+ int m_locateDepth; ///How far away from the beginning the type was found(counting steps upwards and steps into base-classes. Counter is stopped on the first typedef.)
+
+ NewLocateMode m_locateMode;
+ public:
+ LocateResult();
+ LocateResult( const TypeDesc& desc );
+
+ LocateResult( const TypeDescPointer& desc );
+ LocateResult( TypeDescShared* desc );
+ LocateResult( const LocateResult& rhs );
+ ~LocateResult();
+ /*
+ LocateResult& operator = ( const TypeDesc& rhs ) {
+ m_desc = new rhs;
+ return *this;
+ }*/
+
+ ///Returns the locate-flags that would have been used for locating a sub-item of this one(given the flags this was located with)
+ NewLocateMode& locateMode() {
+ return m_locateMode;
+ }
+
+ LocateResult& operator = ( const TypeDesc& rhs );
+
+ operator const TypeDesc&() const;
+
+ operator TypeDesc&() ;
+
+ TypeDesc& desc();
+
+ const TypeDesc& desc() const;
+
+ int depth() const {
+ return m_locateDepth;
+ }
+
+ ///This may be used to simply increase the depth while returning a LocateResult
+ LocateResult& increaseDepth() {
+ m_locateDepth++;
+ return *this;
+ }
+
+ ///This may be used to simply reset the depth while returning a LocateResult
+ LocateResult& resetDepth() {
+ m_locateDepth = 0;
+ return *this;
+ }
+
+ LocateResult& operator * () {
+ return * this;
+ }
+
+ const LocateResult& operator * () const {
+ return * this;
+ }
+
+ //operator TypeDescPointer();
+
+ operator bool() const;
+
+ LocateResult& operator = ( const LocateResult& rhs );
+
+ bool operator >( const LocateResult& rhs ) const {
+ return m_resolutionCount > rhs.m_resolutionCount;
+ }
+
+ const TypeDesc* operator ->() const;
+
+ TypeDesc* operator ->();
+
+ int resolutionCount() const {
+ return m_resolutionCount;
+ }
+
+ void increaseResolutionCount() {
+ m_resolutionCount++;
+ }
+
+ void addResolutionFlag( ResolutionFlags flag );
+
+ bool hasResolutionFlag( ResolutionFlags flag ) const;
+
+ TypeTrace* trace();
+};
+
+ ///These flags have no internal use, they are set and read from the outside
+enum TypeDescFlags {
+ Standard = 0,
+ ResolutionTried = 1 ///means that the resolution was tried, and should not be retried.
+};
+
+
+struct TypeDescData : public KShared {
+ typedef QValueList<LocateResult> TemplateParams;
+ QString m_cleanName;
+ int m_pointerDepth;
+ int m_functionDepth;
+ TemplateParams m_templateParams;
+ TypeDescPointer m_nextType;
+ TypePointer m_resolved;
+ TypeDecoration m_dec;
+ TypeDescFlags m_flags;
+ HashedStringSet m_includeFiles;
+
+ TypeDescData() : m_hashValid( false ), m_hash2Valid( false ) {
+ }
+ void invalidateKey() {
+ m_hashValid = false;
+ m_hash2Valid = false;
+ }
+
+ size_t hashKey();
+ size_t hashKey2();
+private:
+ bool m_hashValid;
+ uint m_hashKey;
+ bool m_hash2Valid;
+ uint m_hashKey2;
+};
+
+
+class TypeDesc {
+ public:
+ typedef QValueList<LocateResult> TemplateParams;
+
+ TypeDesc();
+
+ TypeDesc( const QString& str );
+
+ TypeDesc( const TypeDesc& rhs );
+
+ bool deeper( const TypeDesc& rhs ) const {
+ return depth() > rhs.depth();
+ }
+
+ bool longer( const TypeDesc& rhs ) const {
+ return length() > rhs.length();
+ }
+
+ TypeDesc& operator = ( const TypeDesc& rhs );
+
+ TypeDesc& operator = ( const QString& rhs ) {
+ init( rhs );
+ return *this;
+ }
+
+ TypeDesc firstType() const {
+ TypeDesc ret = *this;
+ ret.setNext( 0 );
+ return ret;
+ }
+
+ size_t hashKey() const;
+
+ /**Returns a hash-key that is computed in a different way than the first.
+ * If both keys match, it is pretty sure that typedescs are same.
+ * */
+ size_t hashKey2() const;
+
+///this function must be remade
+ bool isValidType() const ;
+
+ int depth() const;
+
+ int length() const ;
+
+ ///Does not respect include-files
+ int compare ( const TypeDesc& rhs ) const;
+
+ ///Does not respect include-files
+ bool operator < ( const TypeDesc& rhs ) const {
+ return compare( rhs ) == -1;
+ }
+
+ ///Does not respect include-files
+ bool operator > ( const TypeDesc& rhs ) const {
+ return compare( rhs ) == 1;
+ }
+
+ ///Does not respect include-files
+ bool operator == ( const TypeDesc& rhs ) const {
+ return compare( rhs ) == 0;
+ }
+
+ HashedStringSet includeFiles() const;
+
+ ///Sets the include-files for this desc, the next-desc, and all template-params
+ void setIncludeFiles( const HashedStringSet& files );
+
+ void addIncludeFiles( const HashedStringSet& files );
+
+ QString nameWithParams() const;
+
+ ///returns the type including template-parameters and pointer-depth
+ QString fullName( ) const;
+
+ /**returns the type include template-parameters, pointer-depth, and possible sub-types.
+ Example "A::B": A is the type, and B is the subtype */
+ QString fullNameChain( ) const ;
+
+ ///Returns the type-structure(full name-chain without any instance-info)
+ QString fullTypeStructure() const;
+
+ void prependDecoration( const QString& str );
+
+ ///Since the pointer-depth of a resolved type is always stored in the last element of its chain, this gives fast access to that depth
+ int totalPointerDepth() const;
+
+ void setTotalPointerDepth( int d );
+
+ int pointerDepth() const {
+ if( !m_data ) return 0;
+
+ return m_data->m_pointerDepth;
+ }
+
+ void setPointerDepth( int d ) {
+ makeDataPrivate();
+ m_data->m_pointerDepth = d;
+ }
+
+ /*void decreasePointerDepth() {
+ maybeInit();
+
+ if ( m_data->m_pointerDepth > 0 ) {
+ makeDataPrivate();
+ m_data->m_pointerDepth--;
+ }
+ }*/
+
+ ///returns a list include the full name of this type, and all subtypes
+ QStringList fullNameList( ) const;
+
+ QString decoratedName() const {
+ if( !m_data ) return "";
+ QString ret = m_data->m_dec.apply( name() );
+ for( int a = 0; a < pointerDepth(); a++ )
+ ret += "*";
+ return ret;
+ }
+
+ QString name() const {
+ if( !m_data ) return "";
+ return m_data->m_cleanName;
+ };
+
+ void setName( QString name ) {
+ makeDataPrivate();
+ m_data->m_cleanName = name;
+ }
+
+ /** The template-params may be changed in-place
+ this list is local, but the params pointed by them not(call makePrivate before changing) */
+ TemplateParams& templateParams();
+
+ const TemplateParams& templateParams() const;
+
+ ///clears the current template-parameters, and extracts those from the given string
+ void takeTemplateParams( const QString& string );
+
+ /**makes all references/pointers private, so everything about this structure may be changed without side-effects*/
+ TypeDesc& makePrivate();
+
+ operator bool () const {
+ if( !m_data ) return false;
+
+ return !m_data->m_cleanName.isEmpty();
+ }
+
+ TypeDescPointer next();
+
+ KSharedPtr<const TypeDescShared> next() const;
+
+ bool hasTemplateParams() const ;
+
+ void setNext( TypeDescPointer type );
+
+ void append( TypeDescPointer type );
+
+ TypePointer resolved() const ;
+
+ void setResolved( TypePointer resolved );
+
+ void resetResolved();
+
+ ///Resets the resolved-pointers of this type, and all template-types
+ void resetResolvedComplete();
+
+ void increaseFunctionDepth();
+
+ void decreaseFunctionDepth();
+
+ int functionDepth() const;
+
+ static const char* functionMark;
+
+ void setFlag( TypeDescFlags flag ) {
+ makeDataPrivate();
+ m_data->m_flags = ( TypeDescFlags ) ( m_data->m_flags | flag );
+ }
+
+ bool hasFlag( TypeDescFlags flag ) {
+ if( !m_data ) return false;
+
+ return ( bool ) ( m_data->m_flags & flag );
+ }
+
+ ///instance-information consists of things like the pointer-depth and the decoration
+ void takeInstanceInfo( const TypeDesc& rhs );
+
+ /*bool decorationSmaller( const TypeDesc& rhs );
+
+ int decorationDepth();*/
+
+ void clearInstanceInfo();
+
+
+ private:
+ void takeData( const QString& string );
+ void makeDataPrivate();
+ KSharedPtr<TypeDescData> m_data;
+
+ void maybeInit();
+ void init( QString stri );
+
+};
+
+class TypeDescShared : public TypeDesc, public KShared {
+ public:
+
+
+ TypeDescShared( const TypeDescShared& rhs ) : TypeDesc( rhs ), KShared() {}
+
+ TypeDescShared( const TypeDesc& rhs ) : TypeDesc( rhs ), KShared() {}
+
+ TypeDescShared& operator = ( const TypeDesc& rhs ) {
+ ( *( TypeDesc* ) this ) = rhs;
+ return *this;
+ }
+
+ TypeDescShared( const QString& name ) : TypeDesc( name ) {}
+ TypeDescShared() : TypeDesc() {}
+}
+;
+
+extern TypeDesc operator + ( const TypeDesc& lhs, const TypeDesc& rhs );
+
+#endif
+// kate: indent-mode csands; tab-width 4;
diff --git a/languages/csharp/Makefile.am b/languages/csharp/Makefile.am
new file mode 100644
index 00000000..51d0c110
--- /dev/null
+++ b/languages/csharp/Makefile.am
@@ -0,0 +1,25 @@
+# Here resides the CSharp support part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = app_templates file_templates doc
+
+
+kde_module_LTLIBRARIES = libkdevcsharpsupport.la kio_csharpdoc.la
+libkdevcsharpsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevcsharpsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevcsharpsupport_la_SOURCES = csharpsupportpart.cpp csharpconfigwidget.cpp csharpconfigwidgetbase.ui
+
+kio_csharpdoc_la_SOURCES = csharpdoc.cpp
+kio_csharpdoc_la_LIBADD = $(LIB_KIO)
+kio_csharpdoc_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevcsharpsupport.desktop csharpdoc.protocol
+
+rcdir = $(kde_datadir)/kdevcsharpsupport
+rc_DATA = kdevcsharpsupport.rc
diff --git a/languages/csharp/README.dox b/languages/csharp/README.dox
new file mode 100644
index 00000000..6d256b08
--- /dev/null
+++ b/languages/csharp/README.dox
@@ -0,0 +1,46 @@
+/** \class CSharpSupportPart
+This is csharp language support plugin.
+
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+\authors <a href="mailto:willems.luc AT pandora.be">Luc Willems</a>
+
+\maintainer <a href="mailto:willems.luc AT pandora.be">Luc Willems</a>
+
+\feature csharp programming language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/csharp/app_templates/Makefile.am b/languages/csharp/app_templates/Makefile.am
new file mode 100644
index 00000000..14608ada
--- /dev/null
+++ b/languages/csharp/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS =
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/CSharpIDE
+profiles_DATA = csharp.appwizard
diff --git a/languages/csharp/app_templates/csharp.appwizard b/languages/csharp/app_templates/csharp.appwizard
new file mode 100644
index 00000000..44c9faf9
--- /dev/null
+++ b/languages/csharp/app_templates/csharp.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=perlhello
diff --git a/languages/csharp/csharpconfigwidget.cpp b/languages/csharp/csharpconfigwidget.cpp
new file mode 100644
index 00000000..b18d3e69
--- /dev/null
+++ b/languages/csharp/csharpconfigwidget.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "csharpconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include "domutil.h"
+
+
+CSharpConfigWidget::CSharpConfigWidget(QDomDocument &projectDom,
+ QWidget *parent, const char *name)
+ : CSharpConfigWidgetBase(parent, name), dom(projectDom)
+{
+ interpreter_edit->setText(DomUtil::readEntry(dom, "/kdevcsharpsupport/run/interpreter"));
+ terminal_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevcsharpsupport/run/terminal"));
+}
+
+
+CSharpConfigWidget::~CSharpConfigWidget()
+{}
+
+
+void CSharpConfigWidget::accept()
+{
+ DomUtil::writeEntry(dom, "/kdevcsharpsupport/run/interpreter", interpreter_edit->text());
+ DomUtil::writeBoolEntry(dom, "/kdevcsharpsupport/run/terminal", terminal_box->isChecked());
+}
+
+#include "csharpconfigwidget.moc"
diff --git a/languages/csharp/csharpconfigwidget.h b/languages/csharp/csharpconfigwidget.h
new file mode 100644
index 00000000..bf1b063e
--- /dev/null
+++ b/languages/csharp/csharpconfigwidget.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CSHARPCONFIGWIDGET_H_
+#define _CSHARPCONFIGWIDGET_H_
+
+#include "csharpconfigwidgetbase.h"
+#include <qdom.h>
+
+
+class CSharpConfigWidget : public CSharpConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CSharpConfigWidget( QDomDocument &projectDom, QWidget *parent=0, const char *name=0 );
+ ~CSharpConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ QDomDocument &dom;
+};
+
+#endif
diff --git a/languages/csharp/csharpconfigwidgetbase.ui b/languages/csharp/csharpconfigwidgetbase.ui
new file mode 100644
index 00000000..dbf4d3ae
--- /dev/null
+++ b/languages/csharp/csharpconfigwidgetbase.ui
@@ -0,0 +1,101 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>CSharpConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>csharp_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>CSharp</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>interpreter_label</cstring>
+ </property>
+ <property name="text">
+ <string>CSharp &amp;interpreter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>terminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Execute programs in a terminal</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/csharp/csharpdoc.cpp b/languages/csharp/csharpdoc.cpp
new file mode 100644
index 00000000..8755be2b
--- /dev/null
+++ b/languages/csharp/csharpdoc.cpp
@@ -0,0 +1,133 @@
+#include "csharpdoc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <qtextstream.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kinstance.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kglobal.h>
+
+using namespace KIO;
+
+
+CSharpdocProtocol::CSharpdocProtocol(const QCString &pool, const QCString &app)
+ : SlaveBase("csharpdoc", pool, app)
+{}
+
+
+CSharpdocProtocol::~CSharpdocProtocol()
+{}
+
+
+void CSharpdocProtocol::get(const KURL& url)
+{
+ QStringList l = QStringList::split('/', url.path());
+
+ mimeType("text/html");
+
+ bool plain = false;
+ QString cmd = "csharpdoc ";
+ if (l[0] == "functions") {
+ plain = true;
+ cmd += "-t -f ";
+ cmd += KProcess::quote(l[1]);
+ } else if (l[0] == "faq") {
+ cmd += "-u -q ";
+ cmd += KProcess::quote(l[1]);
+ cmd += " | pod2html";
+ } else {
+ QCString errstr(i18n("The only existing directories are functions and faq.").local8Bit());
+ data(errstr);
+ finished();
+ return;
+ }
+
+ kdDebug() << "Command: " << cmd << endl;
+
+ if (plain)
+ data(QCString("<blockquote>"));
+
+ FILE *fd = popen(cmd.local8Bit().data(), "r");
+ char buffer[4090];
+ QByteArray array;
+
+ while (!feof(fd)) {
+ int n = fread(buffer, 1, 2048, fd);
+ if (n == -1) {
+ pclose(fd);
+ return;
+ }
+ array.setRawData(buffer, n);
+ data(array);
+ array.resetRawData(buffer, n);
+ }
+
+ pclose(fd);
+
+ if (plain)
+ data(QCString("</blockquote>"));
+
+ finished();
+}
+
+
+void CSharpdocProtocol::mimetype(const KURL &url)
+{
+ QStringList l = QStringList::split('/', url.path());
+ mimeType((l[0] == "faq")? "text/html" : "text/plain");
+ finished();
+}
+
+
+QCString CSharpdocProtocol::errorMessage()
+{
+ return QCString( "<html><body bgcolor=\"#FFFFFF\">" + i18n("Error in csharpdoc").local8Bit() + "</body></html>" );
+}
+
+
+void CSharpdocProtocol::stat(const KURL &/*url*/)
+{
+ UDSAtom uds_atom;
+ uds_atom.m_uds = KIO::UDS_FILE_TYPE;
+ uds_atom.m_long = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
+
+ UDSEntry uds_entry;
+ uds_entry.append(uds_atom);
+
+ statEntry(uds_entry);
+ finished();
+}
+
+
+void CSharpdocProtocol::listDir(const KURL &url)
+{
+ error( KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path() );
+}
+
+
+extern "C" {
+
+ int kdemain(int argc, char **argv)
+ {
+ KInstance instance( "kio_csharpdoc" );
+ KGlobal::locale()->setMainCatalogue("kdevelop");
+
+ if (argc != 4) {
+ fprintf(stderr, "Usage: kio_csharpdoc protocol domain-socket1 domain-socket2\n");
+ exit(-1);
+ }
+
+ CSharpdocProtocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ return 0;
+ }
+
+}
diff --git a/languages/csharp/csharpdoc.h b/languages/csharp/csharpdoc.h
new file mode 100644
index 00000000..85fa8cf5
--- /dev/null
+++ b/languages/csharp/csharpdoc.h
@@ -0,0 +1,25 @@
+#ifndef _CSHARPDOC_H_
+#define _CSHARPDOC_H_
+
+#include <qobject.h>
+#include <kio/slavebase.h>
+
+
+class CSharpdocProtocol : public KIO::SlaveBase
+{
+public:
+ CSharpdocProtocol(const QCString &pool, const QCString &app);
+ virtual ~CSharpdocProtocol();
+
+ virtual void get(const KURL& url);
+ virtual void stat(const KURL& url);
+ virtual void mimetype(const KURL& url);
+ virtual void listDir(const KURL& url);
+
+protected:
+ void decodeURL(const KURL &url);
+ void decodePath(QString path);
+ QCString errorMessage();
+};
+
+#endif
diff --git a/languages/csharp/csharpdoc.protocol b/languages/csharp/csharpdoc.protocol
new file mode 100644
index 00000000..9b813b02
--- /dev/null
+++ b/languages/csharp/csharpdoc.protocol
@@ -0,0 +1,9 @@
+[Protocol]
+exec=kio_csharpdoc
+protocol=csharpdoc
+input=none
+output=filesystem
+reading=true
+listing=Name
+determineMimetypeFromExtension=false
+Icon=help
diff --git a/languages/csharp/csharpsupportpart.cpp b/languages/csharp/csharpsupportpart.cpp
new file mode 100644
index 00000000..01a21ffb
--- /dev/null
+++ b/languages/csharp/csharpsupportpart.cpp
@@ -0,0 +1,331 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "csharpsupportpart.h"
+
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdevgenericfactory.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <qregexp.h>
+#include <codemodel.h>
+#include <qprogressbar.h>
+#include <kstatusbar.h>
+#include "kdevmainwindow.h"
+
+#include <kprocess.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugininfo.h"
+#include "kdevappfrontend.h"
+//#include "classstore.h"
+//#include "parsedclass.h"
+//#include "parsedmethod.h"
+//#include "parsedscript.h"
+#include "domutil.h"
+//#include "programmingbycontract.h"
+
+typedef KDevGenericFactory<CSharpSupportPart> CSharpSupportFactory;
+static const KDevPluginInfo data("kdevcsharpsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevcsharpsupport, CSharpSupportFactory( data ) )
+
+CSharpSupportPart::CSharpSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "CSharpSupportPart")
+{
+ setInstance(CSharpSupportFactory::instance());
+
+ setXMLFile("kdevcsharpsupport.rc");
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+
+ KAction *action;
+
+ action = new KAction( i18n("Execute Main Program"), "exec", 0,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_exec" );
+ action->setToolTip( i18n("Runs the CSharp program") );
+
+ action = new KAction( i18n("Execute String..."), "exec", 0,
+ this, SLOT(slotExecuteString()),
+ actionCollection(), "build_execstring" );
+ action->setToolTip( i18n("Executes a string as CSharp code") );
+
+ action = new KAction( i18n("Start CSharp Interpreter"), "exec", 0,
+ this, SLOT(slotStartInterpreter()),
+ actionCollection(), "build_runinterpreter" );
+ action->setToolTip( i18n("Starts the CSharp interpreter without a program") );
+
+ action = new KAction( i18n("Find CSharp Function Documentation..."), 0,
+ this, SLOT(slotCSharpdocFunction()),
+ actionCollection(), "help_csharpdocfunction" );
+ action->setToolTip( i18n("Show the documentation page of a CSharp function") );
+
+ action = new KAction( i18n("Find CSharp FAQ Entry..."), 0,
+ this, SLOT(slotCSharpdocFAQ()),
+ actionCollection(), "help_csharpdocfaq" );
+ action->setToolTip( i18n("Show the FAQ entry for a keyword") );
+
+ //csharp parser for codemodel
+ // m_parser = new csharpparser(core(),codeModel(),interpreter());
+}
+
+
+CSharpSupportPart::~CSharpSupportPart()
+{
+ if (project())
+ projectClosed();
+
+ // delete m_parser;
+ // m_parser=0;
+}
+
+
+void CSharpSupportPart::projectOpened()
+{
+ kdDebug(9007) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // procsharpy initialized
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+
+void CSharpSupportPart::projectClosed()
+{
+}
+
+void CSharpSupportPart::maybeParse(const QString fileName)
+{
+ QFileInfo fi(fileName);
+ QString path = fi.filePath();
+ QString extension = fi.extension();
+ if (extension == "cs") {
+ kdDebug(9016) << "maybe " << fileName << endl;
+ removeWithReference(fileName);
+ // m_parser->parse(fileName);
+ emit addedSourceInfo( fileName);
+ }
+}
+
+void CSharpSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9016) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ maybeParse(project()->projectDirectory() + "/" + ( *it ));
+ }
+}
+
+
+void CSharpSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9016) << "removedFilesFromProject()" << endl;
+ QStringList::ConstIterator it;
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ removeWithReference(fileName);
+ }
+ emit updatedSourceInfo();
+}
+
+
+void CSharpSupportPart::savedFile(const KURL &fileName)
+{
+ Q_UNUSED( fileName.path() );
+#if 0 // not needed anymore
+ kdDebug(9016) << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.mid ( project()->projectDirectory().length() + 1 ))) {
+ maybeParse(fileName);
+ emit updatedSourceInfo();
+ }
+#endif
+}
+
+
+KDevLanguageSupport::Features CSharpSupportPart::features()
+{
+ return KDevLanguageSupport::Features(Classes | Functions | Variables | Namespaces | /*Scripts | */NewClass | AddMethod | AddAttribute /*| NewScript*/);
+// return Functions;
+}
+
+QString CSharpSupportPart::interpreter()
+{
+ QString prog = DomUtil::readEntry(*projectDom(), "/kdevcsharpsupport/run/interpreter");
+ if (prog.isEmpty())
+ prog = "csharp";
+
+ return prog;
+}
+
+
+void CSharpSupportPart::startApplication(const QString &program)
+{
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevcsharpsupport/run/terminal");
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, inTerminal);
+}
+
+
+void CSharpSupportPart::slotExecute()
+{
+ QString program = project()->mainProgram();
+ QString cmd = interpreter() + " " + program;
+ startApplication(cmd);
+}
+
+
+void CSharpSupportPart::slotStartInterpreter()
+{
+ startApplication(interpreter());
+}
+
+
+void CSharpSupportPart::slotExecuteString()
+{
+ bool ok;
+ QString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), QString::null, &ok, 0);
+ if (ok) {
+ cmd.prepend("'");
+ cmd.append("'");
+ startApplication(cmd);
+ }
+}
+
+
+void CSharpSupportPart::slotCSharpdocFunction()
+{
+ bool ok;
+ QString key = KInputDialog::getText(i18n("Show CSharp Documentation"), i18n("Show CSharp documentation for function:"), "", &ok, 0);
+ if (ok && !key.isEmpty()) {
+ QString url = "csharpdoc:functions/";
+ url += key;
+ partController()->showDocument(KURL(url));
+ }
+}
+
+
+void CSharpSupportPart::slotCSharpdocFAQ()
+{
+ bool ok;
+ QString key = KInputDialog::getText(i18n("Show FAQ Entry"), i18n("Show FAQ entry for keyword:"), "", &ok, 0);
+ if (ok && !key.isEmpty()) {
+ QString url = "csharpdoc:faq/";
+ url += key;
+ partController()->showDocument(KURL(url));
+ }
+}
+KMimeType::List CSharpSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-csharp" );
+ if( mime )
+ list << mime;
+ return list;
+}
+
+void CSharpSupportPart::initialParse()
+{
+ kdDebug(9016) << "initialParse()" << endl;
+
+ if (project()) {
+ //copy from cpp support : give user some feedback
+ mainWindow()->statusBar()->message( i18n("Updating...") );
+ kapp->processEvents( );
+
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ // m_parser->initialParse();
+
+ //progress bar
+ QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow( )->statusBar( )->addWidget( bar );
+ bar->show( );
+ int n = 0;
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+// kdDebug(9016) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ maybeParse(project()->projectDirectory() + "/" + *it);
+ //update progress bar
+ bar->setProgress( n++ );
+ if( (n%5) == 0 )
+ kapp->processEvents();
+ }
+ parseUseFiles();
+ emit updatedSourceInfo();
+
+ //remove progressbar
+ mainWindow( )->statusBar( )->removeWidget( bar );
+ delete bar;
+ kapp->restoreOverrideCursor();
+ mainWindow()->statusBar()->message( i18n("Done") );
+
+ } else {
+ kdDebug(9016) << "No project" << endl;
+ }
+}
+
+void CSharpSupportPart::removeWithReference( const QString & fileName )
+{
+ kdDebug(9016) << "remove with references: " << fileName << endl;
+ //m_timestamp.remove( fileName );
+ if( !codeModel()->hasFile(fileName) )
+ return;
+
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+}
+
+void CSharpSupportPart::parseUseFiles()
+{
+ kdDebug(9016) << "parse addional libs" << endl;
+ return;
+ QString filename;
+ QStringList m_usefiles;
+ // QStringList m_usefiles = m_parser->UseFiles();
+
+ //parse addional use files
+ for (QStringList::Iterator it = m_usefiles.begin(); it != m_usefiles.end() ;++it)
+ {
+ // filename = m_parser->findLib(*it);
+ //if something found , parse it
+ if (!filename.isEmpty()) {
+ //kdDebug(9016) << "found " << filename << endl;
+ maybeParse(filename);
+ }
+ }
+}
+
+#include "csharpsupportpart.moc"
diff --git a/languages/csharp/csharpsupportpart.h b/languages/csharp/csharpsupportpart.h
new file mode 100644
index 00000000..166285a6
--- /dev/null
+++ b/languages/csharp/csharpsupportpart.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CSHARPSUPPORTPART_H_
+#define _CSHARPSUPPORTPART_H_
+
+#include "kdevlanguagesupport.h"
+#include <codemodel.h>
+// #include "csharpparser.h"
+
+class CSharpSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ CSharpSupportPart( QObject *parent, const char *name, const QStringList & );
+ ~CSharpSupportPart();
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotExecute();
+ void slotExecuteString();
+ void slotStartInterpreter();
+
+ // Internal
+ void initialParse();
+ void slotCSharpdocFunction();
+ void slotCSharpdocFAQ();
+
+private:
+ QString interpreter();
+ void startApplication(const QString &program);
+ void maybeParse(const QString fileName);
+ void parse(const QString &fileName);
+ void parseLines(QStringList* lines,const QString& fileName);
+ void removeWithReference( const QString & fileName );
+ void parseUseFiles();
+ //CSharp Parser
+// csharpparser* m_parser;
+
+};
+
+#endif
diff --git a/languages/csharp/doc/Makefile.am b/languages/csharp/doc/Makefile.am
new file mode 100644
index 00000000..e0dfb9eb
--- /dev/null
+++ b/languages/csharp/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA =
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/csharp/file_templates/Makefile.am b/languages/csharp/file_templates/Makefile.am
new file mode 100644
index 00000000..b4f0a30c
--- /dev/null
+++ b/languages/csharp/file_templates/Makefile.am
@@ -0,0 +1,4 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA =
+
+
diff --git a/languages/csharp/kdevcsharpsupport.desktop b/languages/csharp/kdevcsharpsupport.desktop
new file mode 100644
index 00000000..dbd9492b
--- /dev/null
+++ b/languages/csharp/kdevcsharpsupport.desktop
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=CSharp Support
+Comment[ca]=Suport per a CSharp
+Comment[da]=Csharp understøttelse
+Comment[de]=CSharp-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη CSharp
+Comment[es]=Soporte para CSharp
+Comment[et]=CSharp'i toetus
+Comment[fr]=Prise en charge du langage CSharp
+Comment[hu]=CSharp-támogatás
+Comment[it]=Supporto per CSharp
+Comment[ja]=CSharp サポート
+Comment[nds]=Ünnerstütten för CSharp
+Comment[nl]=Ondersteuning voor CSharp
+Comment[pl]=Obsługa CSharp
+Comment[pt]=Suporte a C#
+Comment[pt_BR]=Suporte a C#
+Comment[ru]=Поддержка CSharp
+Comment[sk]=CSharp podpora
+Comment[sr]=Подршка за CSharp
+Comment[sr@Latn]=Podrška za CSharp
+Comment[sv]=C#-stöd
+Comment[zh_TW]=C# 支援
+Name=KDevCSharpSupport
+Name[de]=Unterstützung für CSharp (KDevelop)
+Name[nds]=CSharp-Ünnerstütten för KDevelop
+Name[sv]=KDevelop C#-stöd
+Name[zh_TW]=KDevelop C# 支援
+GenericName=CSharp Support
+GenericName[ca]=Suport per a CSharp
+GenericName[da]=CSharp understøttelse
+GenericName[de]=Unterstützung für CSharp
+GenericName[el]=Υποστήριξη CSharp
+GenericName[es]=Soporte para CSharp
+GenericName[et]=CSharp'i toetus
+GenericName[fr]=Prise en charge du langage CSharp
+GenericName[hu]=CSharp-támogatás
+GenericName[it]=Supporto CSharp
+GenericName[ja]=CSharp サポート
+GenericName[nds]=Ünnerstütten för CSharp
+GenericName[nl]=Ondersteuning voor CSharp
+GenericName[pl]=Obsługa CSharp
+GenericName[pt]=Suporte a C#
+GenericName[pt_BR]=Suporte a C#
+GenericName[ru]=Поддержка CSharp
+GenericName[sk]=CSharp podpora
+GenericName[sr]=Подршка за CSharp
+GenericName[sr@Latn]=Podrška za CSharp
+GenericName[sv]=C#-stöd
+GenericName[zh_TW]=C# 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevcsharpsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=CSharp
+
diff --git a/languages/csharp/kdevcsharpsupport.rc b/languages/csharp/kdevcsharpsupport.rc
new file mode 100644
index 00000000..b5f735e2
--- /dev/null
+++ b/languages/csharp/kdevcsharpsupport.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevCSharpSupport" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_exec" />
+ <Action name="build_runinterpreter" />
+ <Action name="build_execstring" />
+ </Menu>
+ <Menu name="help">
+ <Action name="help_csharpdocfunction"/>
+ <Action name="help_csharpdocfaq"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/fortran/Makefile.am b/languages/fortran/Makefile.am
new file mode 100644
index 00000000..ac6f5be2
--- /dev/null
+++ b/languages/fortran/Makefile.am
@@ -0,0 +1,20 @@
+# Here resides the Fortran support part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = file_templates app_templates compiler doc
+
+kde_module_LTLIBRARIES = libkdevfortransupport.la
+libkdevfortransupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfortransupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfortransupport_la_SOURCES = fortransupportpart.cpp fixedformparser.cpp ftnchekconfigwidget.cpp ftnchekconfigwidgetbase.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfortransupport.desktop
+
+rcdir = $(kde_datadir)/kdevfortransupport
+rc_DATA = kdevfortransupport.rc
diff --git a/languages/fortran/README.dox b/languages/fortran/README.dox
new file mode 100644
index 00000000..65a4e645
--- /dev/null
+++ b/languages/fortran/README.dox
@@ -0,0 +1,48 @@
+/** \class FortranSupportPart
+This is Fortran language support plugin.
+
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Fortran language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/fortran/app_templates/Makefile.am b/languages/fortran/app_templates/Makefile.am
new file mode 100644
index 00000000..056dc759
--- /dev/null
+++ b/languages/fortran/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = fortranhello
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/FortranIDE
+profiles_DATA = fortran.appwizard
diff --git a/languages/fortran/app_templates/fortran.appwizard b/languages/fortran/app_templates/fortran.appwizard
new file mode 100644
index 00000000..7cd8232e
--- /dev/null
+++ b/languages/fortran/app_templates/fortran.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=fortranhello
diff --git a/languages/fortran/app_templates/fortranhello/.kdev_ignore b/languages/fortran/app_templates/fortranhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/.kdev_ignore
diff --git a/languages/fortran/app_templates/fortranhello/Makefile.am b/languages/fortran/app_templates/fortranhello/Makefile.am
new file mode 100644
index 00000000..ba97453d
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = main.f src-Makefile.am fortran-Makefile.am fortran-Makefile.cvs \
+ configure.in fortranhello.png app.kdevelop
+templateName = fortranhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/fortran/app_templates/fortranhello/app.kdevelop b/languages/fortran/app_templates/fortranhello/app.kdevelop
new file mode 100644
index 00000000..b4abc5ae
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/app.kdevelop
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Fortran77</primarylanguage>
+ <keywords>
+ <keyword>Fortran</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevCTags</part>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/%{APPNAMELC}</activetarget>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ <terminal>true</terminal>
+ </run>
+ <makeenvvars>
+ <envvar value="1" name="WANT_AUTOCONF_2_5" />
+ <envvar value="1" name="WANT_AUTOMAKE_1_6" />
+ </makeenvvars>
+ </kdevautoproject>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="F"/>
+ <type ext="fpp"/>
+ <type ext="f"/>
+ <type ext="for"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfortransupport>
+ <ftnchek>
+ <division>false</division>
+ <extern>false</extern>
+ <declare>false</declare>
+ <pure>false</pure>
+ <argumentsall>false</argumentsall>
+ <commonall>false</commonall>
+ <truncationall>false</truncationall>
+ <usageall>false</usageall>
+ <f77all>false</f77all>
+ <portabilityall>false</portabilityall>
+ <argumentsonly></argumentsonly>
+ <commononly></commononly>
+ <truncationonly></truncationonly>
+ <usageonly></usageonly>
+ <f77only></f77only>
+ <portabilityonly></portabilityonly>
+ </ftnchek>
+ </kdevfortransupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.f;*.for;*.FOR" name="Preprocessed Fortran" />
+ <group pattern="*.F;*.fpp;*.FPP" name="Fortran77 source files" />
+ </groups>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/fortran/app_templates/fortranhello/configure.in b/languages/fortran/app_templates/fortranhello/configure.in
new file mode 100644
index 00000000..e1b885a7
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/configure.in
@@ -0,0 +1,10 @@
+AC_INIT(configure.in)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AM_CONFIG_HEADER(config.h)
+
+AC_LANG_FORTRAN77
+AC_PROG_F77
+AC_F77_LIBRARY_LDFLAGS
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/languages/fortran/app_templates/fortranhello/fortran-Makefile.am b/languages/fortran/app_templates/fortranhello/fortran-Makefile.am
new file mode 100644
index 00000000..02520f20
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/fortran-Makefile.am
@@ -0,0 +1,5 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src
diff --git a/languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs b/languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs
new file mode 100644
index 00000000..d1607023
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/fortran-Makefile.cvs
@@ -0,0 +1,8 @@
+default: all
+
+all:
+ aclocal
+ autoheader
+ automake
+ autoconf
+
diff --git a/languages/fortran/app_templates/fortranhello/fortranhello b/languages/fortran/app_templates/fortranhello/fortranhello
new file mode 100644
index 00000000..1028a814
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/fortranhello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[fr]=Un simple programme de test Hello world
+Icon=fortranhello.png
+Category=Fortran
+Comment=Generates a simple Hello world program in Fortran
+Comment[fr]=Gnre un simple programme de test du type Hello world dans le language FORTRAN.
+FileTemplates=f,None
+ShowFilesAfterGeneration=src/APPNAMELC.f
diff --git a/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate b/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate
new file mode 100644
index 00000000..b6580853
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/fortranhello.kdevtemplate
@@ -0,0 +1,140 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[ca]=Simple programa Hello world
+Name[da]=Simpelt Goddag verden program
+Name[de]=Ein einfaches "Hello World"-Programm
+Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo» sencillo
+Name[et]=Lihtne "Tere, maailm" programm
+Name[eu]="Kaixo mundua" programa sinplea
+Name[fa]=برنامۀ سادۀ Hello world
+Name[fr]=Programme « Bonjour monde » simple
+Name[ga]=Ríomhchlár simplí "Hello World"
+Name[gl]=Programa sinxelo Ola mundo
+Name[hu]=Egyszerű Hello world program
+Name[it]=Semplice programma di "Hello world"
+Name[ja]=簡単な Hello world プログラム
+Name[ms]=Program Hello World mudah
+Name[nds]=En eenfach "Moin Welt"-Programm
+Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Eenvoudig 'Hello World' programma
+Name[pl]=Prosty program witaj świecie
+Name[pt]=Programa simples Olá Mundo
+Name[pt_BR]=Programa simples Olá Mundo
+Name[ru]=Простая программа Hello world
+Name[sk]=Jednoduchý "Ahoj svet" program
+Name[sl]=Preprost program Hello world
+Name[sr]=Једноставан „Здраво свете“ програм
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program
+Name[sv]=Enkelt Hello world-program
+Name[tr]=Basit Merhaba dünya programı
+Name[zh_CN]=简单的 Hello world 程序
+Name[zh_TW]=簡單的 Hello world 程式
+Icon=fortranhello.png
+Category=Fortran
+Comment=Generates a simple Hello world program in Fortran
+Comment[ca]=Genera un simple programa de Hello world en Fortran
+Comment[da]=Genererer et simpelt Goddag verden program i Fortran
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in Fortran
+Comment[el]=Δημιουργία ενός απλού προγράμματος Γεια σου σε Fortran
+Comment[es]=Genera un sencillo programa «Hola mundo» en Fortran
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Fortranis
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Fortran lengoaian
+Comment[fa]=یک برنامۀ سادۀ Hello world در فرترن تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Fortran
+Comment[gl]=Xera un programa sinxelo Ola mundo en Fortran
+Comment[hu]=Létrehoz egy egyszerű Hello world programot Fortran nyelven
+Comment[it]=Genera un semplice programma di "Hello world" in Fortran
+Comment[ja]=簡単な Hello world プログラムを Fortran で作成します
+Comment[nds]=Stellt en eenfach "Moin Welt"-Programm in Fortran op
+Comment[ne]=फोर्ट्रानमा साधारण हेल्लो वोल्ड कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig Hello World-programma in Fortran
+Comment[pl]=Generuje prosty program Witaj świecie w Fortranie
+Comment[pt]=Gera um programa simples Olá Mundo em Fortran
+Comment[pt_BR]=Gera um programa simples Olá Mundo em Fortran
+Comment[ru]=Создание простой программы Hello world на Fortran
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program vo Fortran
+Comment[sr]=Прави једноставан „Здраво свете“ у Fortran-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Fortran-u
+Comment[sv]=Skapar ett enkelt Hello world-program i Fortran
+Comment[tr]=Fortran'da basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成一个简单的 Fortran 语言 Hello world 程序
+Comment[zh_TW]=產生一個簡單的 Fortran Hello world 程式
+FileTemplates=f,None
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.f
+Archive=fortranhello.tar.gz
+
+[INCADMIN]
+Type=include
+File=%{kdevelop}/template-common/incadmin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/fortran-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE3]
+Type=install
+Source=%{src}/fortran-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE4]
+Type=install
+Source=%{src}/configure.in
+Dest=%{dest}/configure.in
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{src}/main.f
+Dest=%{dest}/src/%{APPNAMELC}.f
+
+[MSG]
+Type=message
+Comment=a simple "Hello world" program in fortran was created in %{dest}
+Comment[ca]=Un simple programa de "Hello world" en fortran ha estat creat en %{dest}
+Comment[da]=et simpelt "Goddag verden" program i fortran blev oprettet i %{dest}
+Comment[de]=Ein einfaches "Hello World"-Programm in Fortran wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα "Γεια σου κόσμε" σε fortran δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa «Hola mundo» en Fortran ha sido creado en %{dest}
+Comment[et]=Lihtne "Tere, maailm" programm Fortranis loodi asukohta %{dest}
+Comment[eu]="Kaixo mundua" programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در فرترن در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » simple en Fortran a été créé dans %{dest}
+Comment[gl]=Creouse un programa sinxelo "Ola mundo" en fortran en %{dest}
+Comment[hu]=Létrejött egy egyszerű, Fortran nyelvű Hello world program itt: %{dest}
+Comment[it]=È stato creato un semplice programma di "Hello world" in Fortran in %{dest}
+Comment[ja]=Fortran で記述された簡単な Hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Fortran opstellt
+Comment[ne]=फोर्ट्रानमा साधारण "हेल्लो वोल्ड" कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=een eenvoudig "Hello World"-programma in Fortran is aangemaakt in %{dest}
+Comment[pl]=Prosty program "Witaj świecie" w Fortranie został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples "Olá mundo" em Fortran em %{dest}
+Comment[pt_BR]=Foi criado um programa simples "Olá mundo" em Fortran em %{dest}
+Comment[ru]=Простая программа "Hello world" на Fortran создана в %{dest}
+Comment[sk]=Jednoduchý "Ahoj svet" program vo Fortran bol vytvorený v %{dest}
+Comment[sr]=Једноставан „Здраво свете“ у Fortran-у направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo svete“ u Fortran-u napravljen je u %{dest}
+Comment[sv]=Ett enkelt "Hello world"-program i Fortran skapades i %{dest}
+Comment[tr]=Fortran'da basit bir "Merhaba Dünya" programı %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 Fortran 语言“Hello world”程序
+Comment[zh_TW]=一個 fortran 的簡單的 "Hello world" 程式已建立於 %{dest}
diff --git a/languages/fortran/app_templates/fortranhello/fortranhello.png b/languages/fortran/app_templates/fortranhello/fortranhello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/fortranhello.png
Binary files differ
diff --git a/languages/fortran/app_templates/fortranhello/main.f b/languages/fortran/app_templates/fortranhello/main.f
new file mode 100644
index 00000000..3f5d29ca
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/main.f
@@ -0,0 +1,7 @@
+c
+c This is the Hello World example
+c
+ program hello
+ print *,'Hello World!'
+ stop
+ end
diff --git a/languages/fortran/app_templates/fortranhello/src-Makefile.am b/languages/fortran/app_templates/fortranhello/src-Makefile.am
new file mode 100644
index 00000000..f3f03092
--- /dev/null
+++ b/languages/fortran/app_templates/fortranhello/src-Makefile.am
@@ -0,0 +1,8 @@
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.f
+
+# set the include path found by configure
+INCLUDES= $(all_includes)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries)
diff --git a/languages/fortran/compiler/Makefile.am b/languages/fortran/compiler/Makefile.am
new file mode 100644
index 00000000..3489a85c
--- /dev/null
+++ b/languages/fortran/compiler/Makefile.am
@@ -0,0 +1,6 @@
+# This is the collection of plugins. In contrast to the parts
+# directory, these are 'transient' in a sense and don't
+# share the complete KDevComponent interface.
+
+SUBDIRS = pgioptions
+
diff --git a/languages/fortran/compiler/pgioptions/Makefile.am b/languages/fortran/compiler/pgioptions/Makefile.am
new file mode 100644
index 00000000..3c3dd54e
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/Makefile.am
@@ -0,0 +1,18 @@
+# Here resides the pgi option dialog plugin.
+# This defines the options for the Portland Group compiler
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevpgioptions.la
+libkdevpgioptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+libkdevpgioptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la
+
+libkdevpgioptions_la_SOURCES = pgioptionsfactory.cpp pgioptionsplugin.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevpghpfoptions.desktop kdevpgf77options.desktop
+
diff --git a/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop b/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop
new file mode 100644
index 00000000..8af14494
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/kdevpgf77options.desktop
@@ -0,0 +1,53 @@
+[Desktop Entry]
+Type=Service
+Exec=pgf77
+Comment=Portland Group Fortran77 Compiler
+Comment[br]=Dastumer Fortran 77 ar strollad Portland
+Comment[ca]=Compilador Fortran 77 de Portland Group
+Comment[da]=Portland Group Fortran77 oversætter
+Comment[el]=Μεταγλωττιστής Fortran77 ομάδας Portland
+Comment[es]=Compilador de Fortran 77 de Portland Group
+Comment[et]=Portland Group Fortran77 kompilaator
+Comment[eu]=Portland Group Fortran77 konpiladorea
+Comment[fa]=مترجم فرترن ۷۷ گروه Portland
+Comment[fr]=Compilateur Fortran77 du Portland Group
+Comment[gl]=Compilador de Fortran77 de Portland Group
+Comment[hi]=पोर्टलैंड समूह फ़ोरट्रॉन77 कम्पायलर
+Comment[hu]=Portland Group Fortran 77 fordítóprogram
+Comment[is]=Portland Group Fortran77 þýðandi
+Comment[it]=Compilatore per Portland Group Fortran77
+Comment[ja]=Portland グループ Fortran77 コンパイラ
+Comment[nds]=Portland Group-Fortran77-Kompilerer
+Comment[ne]=पोर्टल्यान्ड समूह फोर्ट्रान ७७ कम्पाइलर
+Comment[nl]=Portland Group Fortran77-compiler
+Comment[pl]=Kompilator Portland Group Fortran77
+Comment[pt]=Compilador de Fortran77 do Portland Group
+Comment[pt_BR]=Compilador Portland Group Fortran77
+Comment[ru]=Компилятор Portland Group Fortran77
+Comment[sk]=Portland Group Fortran77 kompilátor
+Comment[sl]=Prevajalnik za Portland Group Fortran77
+Comment[sr]=Преводилац Fortran-а 77 од Portland Group-а
+Comment[sr@Latn]=Prevodilac Fortran-a 77 od Portland Group-a
+Comment[sv]=Portland gruppens Fortran 77-kompilator
+Comment[ta]=பொர்ட்லான்ட் குழு பொர்ட்ரான் 77 தொகுப்பி
+Comment[tg]=Талфифгари Portland Group Fortran77
+Comment[tr]=Portland Grubu Fortran 77 Derleyicisi
+Comment[zh_CN]=Portland Group Fortran77 编译器
+Comment[zh_TW]=Portland Group Fortran 77 編譯器
+Name=Pgf77Options
+Name[da]=Portland Group Fortran77 indstillinger
+Name[de]=Pgf77-Einstellungen (KDevelop)
+Name[hi]=पीजीएफ़77विकल्प
+Name[nds]=Pgf77-Instellen (KDevelop)
+Name[pl]=Opcje Pgf77
+Name[sk]=Pgf77 možnosti
+Name[sl]=Možnosti Pgf77
+Name[sv]=Alternativ för pgf77
+Name[ta]=Pgf77 விருப்பங்கள்
+Name[tg]=Pgf77Интихобҳо
+Name[zh_TW]=Pgf77 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevpgioptions
+X-KDevelop-Version=5
+X-KDevelop-Language=Fortran
+X-KDevelop-Args=pgf77
diff --git a/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop b/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop
new file mode 100644
index 00000000..56923deb
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/kdevpghpfoptions.desktop
@@ -0,0 +1,50 @@
+[Desktop Entry]
+Type=Service
+Exec=pghpf
+Comment=Portland Group High Performance Fortran compiler
+Comment[ca]=Compilador Fortran d'altes prestacions de Portland Group
+Comment[da]=Portland Group Fortran oversætter
+Comment[de]=Portland Group High Performance Fortran Compiler
+Comment[el]=Μεταγλωττιστής υψηλής ταχύτητας Fortran της ομάδας Portland
+Comment[es]=Compilador de Fortran de alto rendimiento de Portland Group
+Comment[et]=Portland Groupi suure jõudlusega Fortrani kompilaator
+Comment[eu]=Portland Group-en errendimendu handiko Fortran konpiladorea
+Comment[fa]=مترجم فرترن با کارایی بالای گروه Portland
+Comment[fr]=Compilateur Fortran hautes performances du Portland Group
+Comment[gl]=Compilador de High Performance Fortran de Portland Group
+Comment[hi]=पोर्टलैंड समूह उच्च परफ़ार्मेंस फ़ोरट्रॉन कम्पायलर
+Comment[hu]=Portland Group nagyteljesítményű Fortran fordítóprogram
+Comment[it]=Compilatore ad alte prestazioni per Fortran del Portland Group
+Comment[ja]=Portland グループ ハイパフォーマンス Fortran コンパイラ
+Comment[nds]=Portland Group-Hoochleistenkompilerer för Fortran
+Comment[ne]=पोर्टल्यान्ड समूह उच्च कार्यसम्पादन फोर्ट्रान कम्पाइलर
+Comment[nl]=Portland Group High Performance Fortran-compiler
+Comment[pl]=Kompilator Portland Group High Performance Fortran
+Comment[pt]=Compilador Portland Group High Performance Fortran
+Comment[pt_BR]=Compilador Portland Group Alta Performance
+Comment[ru]=Компилятор Portland Group High Performance Fortran
+Comment[sk]=Portland Group vysoko výkonný Fortran kompilátor
+Comment[sr]=Преводилац Fortran-а високих перформанси, из Portland Group-а
+Comment[sr@Latn]=Prevodilac Fortran-a visokih performansi, iz Portland Group-a
+Comment[sv]=Portland gruppens högprestanda Fortran 77-kompilator
+Comment[ta]=பொர்ட்லான்ட் குழு உயர் செயல்பாடு பொர்ட்ரான் தொகுப்பி
+Comment[tg]=Талфифгари Portland Group High Performance Fortran
+Comment[tr]=Portland Grubu Yüksek Başarımlı Fortran Derleyicisi
+Comment[zh_CN]=Portland Group 高性能 Fortran 编译器
+Comment[zh_TW]=Portland Group 高效能 Fortran 編譯器
+Name=PghpfOptions
+Name[da]=Portland Group oversætter-indstillinger
+Name[de]=Pghpf-Einstellungen (KDevelop)
+Name[hi]=पीजीएचपीएफ़-विकल्प
+Name[nds]=Pghpf-Optschonen
+Name[pl]=Opcje Pghpf
+Name[sk]=Pghpf možnosti
+Name[sv]=Alternativ för pghpf
+Name[ta]=Pghpf விருப்பங்கள்
+Name[tg]=PghpfИнтихобҳо
+Name[zh_TW]=Pghpf 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevpgioptions
+X-KDevelop-Version=5
+X-KDevelop-Language=Fortran
+X-KDevelop-Args=pghpf
diff --git a/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp b/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp
new file mode 100644
index 00000000..5fad6630
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/pgioptionsfactory.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kdebug.h>
+#include <kinstance.h>
+#include "pgioptionsplugin.h"
+#include "pgioptionsfactory.h"
+
+
+extern "C" {
+
+ void *init_libkdevpgioptions()
+ {
+ return new PgiOptionsFactory;
+ }
+
+}
+
+
+PgiOptionsFactory::PgiOptionsFactory(QObject *parent, const char *name)
+ : KLibFactory(parent, name)
+{
+ instance();
+}
+
+
+PgiOptionsFactory::~PgiOptionsFactory()
+{
+ delete s_instance;
+ s_instance = 0;
+}
+
+
+QObject *PgiOptionsFactory::createObject(QObject *parent, const char *name,
+ const char * /*classname*/, const QStringList &args)
+{
+ if (args.count() > 0 && qstrcmp(args[0].latin1(), "pghpf") == 0) {
+ kdDebug(9021) << "Building PgiOptions for PGHPF" << endl;
+ return new PgiOptionsPlugin(PgiOptionsPlugin::PGHPF, parent, name);
+ } else if (args.count() > 0 && qstrcmp(args[0].latin1(), "pgf77") == 0) {
+ kdDebug(9021) << "Building PgiOptions for PGF77" << endl;
+ return new PgiOptionsPlugin(PgiOptionsPlugin::PGF77, parent, name);
+ } else {
+ kdDebug(9021) << "Wrong args for kdevpgioptions library" << endl;
+ if (args.count() > 0)
+ kdDebug(9021) << args[0] << endl;
+ return 0;
+ }
+}
+
+
+KInstance *PgiOptionsFactory::s_instance = 0;
+KInstance *PgiOptionsFactory::instance()
+{
+ if (!s_instance)
+ s_instance = new KInstance("kdevpgioptions");
+
+ return s_instance;
+}
+
+#include "pgioptionsfactory.moc"
diff --git a/languages/fortran/compiler/pgioptions/pgioptionsfactory.h b/languages/fortran/compiler/pgioptions/pgioptionsfactory.h
new file mode 100644
index 00000000..9e3113a7
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/pgioptionsfactory.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PGIOPTIONSFACTORY_H_
+#define _PGIOPTIONSFACTORY_H_
+
+#include <klibloader.h>
+
+
+class PgiOptionsFactory : public KLibFactory
+{
+ Q_OBJECT
+
+public:
+ PgiOptionsFactory( QObject *parent=0, const char *name=0 );
+ ~PgiOptionsFactory();
+
+ virtual QObject* createObject( QObject *parent, const char *name,
+ const char *classname, const QStringList &args);
+ static KInstance *instance();
+
+private:
+ static KInstance *s_instance;
+};
+
+#endif
diff --git a/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp b/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp
new file mode 100644
index 00000000..8bed362e
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/pgioptionsplugin.cpp
@@ -0,0 +1,324 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qapplication.h>
+#include <qheader.h>
+#include <qlayout.h>
+#include <qlistview.h>
+#include <qradiobutton.h>
+#include <qvbox.h>
+#include <qvbuttongroup.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include "pgioptionsplugin.h"
+
+
+const char * const optimization_flags[] = {
+ "-Mautopar",
+ "-Mextract",
+ "-Minline",
+ "-Mipa",
+ 0
+};
+
+
+const char * const hpf_flags[] = {
+ "-Mbackslash",
+ "-Mcmf",
+ "-Mdclchk",
+ "-Mextend",
+ "-Mf90",
+ "-Mnofree",
+ "-Mstandard",
+ "-Mupcase",
+ "-Mbyteswapio",
+ "-Mdepchk",
+ "-Mdlines",
+ "-Mg",
+ "-Mftn",
+ "-Minfo",
+ "-Minform",
+ "-Mkeepft",
+ "-Mkeepstaticn",
+ "-Mmpi",
+ "-Mmpl",
+ "-Mlist",
+ "-Mnohpfc",
+ "-Mnoindependent",
+ "-Mnoprelink",
+ "-Moverlap",
+ "-Mpreprocess",
+ "-Mprof",
+ "-Mpvm",
+ "-Mr8",
+ "-Mrecursive",
+ "-Mreplicate",
+ "-Mrpm",
+ "-Mrpm1",
+ "-M[no]sequence",
+ "-Msmp",
+ "-Mstats",
+ 0
+};
+
+
+
+class GeneralTab : public QWidget
+{
+public:
+ GeneralTab( QWidget *parent=0, const char *name=0 );
+ ~GeneralTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+};
+
+
+class OptimizationTab : public QWidget
+{
+public:
+ OptimizationTab( PgiOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 );
+ ~OptimizationTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ QRadioButton *Odefault, *O0, *O1, *O2;
+ QListView *optBox;
+};
+
+
+class HpfTab : public QWidget
+{
+public:
+ HpfTab( QWidget *parent=0, const char *name=0 );
+ ~HpfTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ QListView *hpfBox;
+};
+
+
+OptimizationTab::OptimizationTab(PgiOptionsPlugin::Type type, QWidget *parent, const char *name)
+ : QWidget(parent, name)
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *group = new QVButtonGroup(i18n("Optimization Level"), this);
+ Odefault = new QRadioButton(i18n("Default"), group);
+ Odefault->setChecked(true);
+ O0 = new QRadioButton(i18n("No optimization"), group);
+ O1 = new QRadioButton(i18n("Level 1"), group);
+ O2 = new QRadioButton(i18n("Level 2"), group);
+
+ if (type == PgiOptionsPlugin::PGHPF) {
+ optBox = new QListView(this);
+ optBox->addColumn(QString::null);
+ optBox->header()->hide();
+ for (const char * const *p = optimization_flags; *p; ++p) {
+ new QCheckListItem(optBox, *p, QCheckListItem::CheckBox);
+ kdDebug() << (*p) << endl;
+ }
+ } else
+ optBox = 0;
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addStretch();
+}
+
+
+OptimizationTab::~OptimizationTab()
+{}
+
+
+void OptimizationTab::readFlags(QStringList *list)
+{
+ if (optBox) {
+ QListViewItem *item = optBox->firstChild();
+ for (; item; item = item->nextSibling()) {
+ QStringList::Iterator sli = list->find(item->text(0));
+ if (sli != list->end()) {
+ static_cast<QCheckListItem*>(item)->setOn(true);
+ list->remove(sli);
+ }
+ }
+ }
+
+ QStringList::Iterator sli;
+ sli = list->find("-O0");
+ if (sli != list->end()) {
+ O0->setChecked(true);
+ list->remove(sli);
+ }
+ sli = list->find("-O1");
+ if (sli != list->end()) {
+ O1->setChecked(true);
+ list->remove(sli);
+ }
+ sli = list->find("-O2");
+ if (sli != list->end()) {
+ O2->setChecked(true);
+ list->remove(sli);
+ }
+}
+
+
+void OptimizationTab::writeFlags(QStringList *list)
+{
+ if (optBox) {
+ QListViewItem *item = optBox->firstChild();
+ for (; item; item = item->nextSibling())
+ if (static_cast<QCheckListItem*>(item)->isOn())
+ (*list) << item->text(0);
+ }
+
+ if (O0->isChecked())
+ (*list) << "-O0";
+ else if (O1->isChecked())
+ (*list) << "-O1";
+ else if (O2->isChecked())
+ (*list) << "-O2";
+}
+
+
+HpfTab::HpfTab(QWidget *parent, const char *name)
+ : QWidget(parent, name)
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ hpfBox = new QListView(this);
+ hpfBox->addColumn(QString::null);
+ hpfBox->header()->hide();
+ for (const char * const *p = hpf_flags; *p; ++p)
+ new QCheckListItem(hpfBox, *p, QCheckListItem::CheckBox);
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addStretch();
+}
+
+
+HpfTab::~HpfTab()
+{}
+
+
+void HpfTab::readFlags(QStringList *list)
+{
+ QListViewItem *item = hpfBox->firstChild();
+ for (; item; item = item->nextSibling()) {
+ QStringList::Iterator sli = list->find(item->text(0));
+ if (sli != list->end()) {
+ static_cast<QCheckListItem*>(item)->setOn(true);
+ list->remove(sli);
+ }
+ }
+}
+
+
+void HpfTab::writeFlags(QStringList *list)
+{
+ QListViewItem *item = hpfBox->firstChild();
+ for (; item; item = item->nextSibling()) {
+ if (static_cast<QCheckListItem*>(item)->isOn())
+ (*list) << item->text(0);
+ }
+}
+
+
+PgiOptionsDialog::PgiOptionsDialog(PgiOptionsPlugin::Type type, QWidget *parent, const char *name)
+ : KDialogBase(Tabbed, (type == PgiOptionsPlugin::PGHPF)? i18n("PGHPF Compiler Options") : i18n("PGF77 Compiler Options"),
+ Ok|Cancel, Ok, parent, name, true)
+{
+ QVBox *vbox;
+
+ // vbox = addVBoxPage(i18n("General"));
+ // general = new GeneralTab(vbox, "general tab");
+
+ vbox = addVBoxPage(i18n("Optimization"));
+ optimization = new OptimizationTab(type, vbox, "optimization tab");
+
+ if (type == PgiOptionsPlugin::PGHPF) {
+ vbox = addVBoxPage(i18n("HPF"));
+ hpf = new HpfTab(vbox, "optimization tab");
+ } else
+ hpf = 0;
+
+}
+
+
+PgiOptionsDialog::~PgiOptionsDialog()
+{
+}
+
+
+void PgiOptionsDialog::setFlags(const QString &flags)
+{
+ QStringList flaglist = QStringList::split(" ", flags);
+
+ // Hand them to 'general' at last, so it can make a line edit
+ // with the unprocessed items
+ if (hpf)
+ hpf->readFlags(&flaglist);
+ optimization->readFlags(&flaglist);
+ // general->readFlags(&flaglist);
+}
+
+
+QString PgiOptionsDialog::flags() const
+{
+ QStringList flaglist;
+
+ if (hpf)
+ hpf->writeFlags(&flaglist);
+ optimization->writeFlags(&flaglist);
+ // general->writeFlags(&flaglist);
+
+ QString flags;
+ QStringList::ConstIterator li;
+ for (li = flaglist.begin(); li != flaglist.end(); ++li) {
+ flags += (*li);
+ flags += " ";
+ }
+
+ flags.truncate(flags.length()-1);
+ return flags;
+}
+
+
+PgiOptionsPlugin::PgiOptionsPlugin(Type type, QObject *parent, const char *name)
+ : KDevCompilerOptions(parent, name)
+{
+ pgitype = type;
+}
+
+
+PgiOptionsPlugin::~PgiOptionsPlugin()
+{}
+
+
+QString PgiOptionsPlugin::exec(QWidget *parent, const QString &flags)
+{
+ PgiOptionsDialog *dlg = new PgiOptionsDialog(pgitype, parent, "pgi options dialog");
+ QString newFlags = flags;
+ dlg->setFlags(flags);
+ if (dlg->exec() == QDialog::Accepted)
+ newFlags = dlg->flags();
+ delete dlg;
+ return newFlags;
+}
+
+#include "pgioptionsplugin.moc"
diff --git a/languages/fortran/compiler/pgioptions/pgioptionsplugin.h b/languages/fortran/compiler/pgioptions/pgioptionsplugin.h
new file mode 100644
index 00000000..dfbf4547
--- /dev/null
+++ b/languages/fortran/compiler/pgioptions/pgioptionsplugin.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PGIOPTIONSPLUGIN_H_
+#define _PGIOPTIONSPLUGIN_H_
+
+#include <kdialogbase.h>
+
+#include "kdevcompileroptions.h"
+
+class GeneralTab;
+class OptimizationTab;
+class HpfTab;
+
+
+class PgiOptionsPlugin : public KDevCompilerOptions
+{
+ Q_OBJECT
+
+public:
+ enum Type { PGHPF, PGF77 };
+
+ PgiOptionsPlugin( Type type, QObject *parent=0, const char *name=0 );
+ ~PgiOptionsPlugin();
+
+ virtual QString exec(QWidget *parent, const QString &flags);
+
+private:
+ Type pgitype;
+};
+
+
+class PgiOptionsDialog : public KDialogBase
+{
+public:
+ PgiOptionsDialog(PgiOptionsPlugin::Type type, QWidget *parent=0, const char *name=0 );
+ ~PgiOptionsDialog();
+
+ void setFlags(const QString &flags);
+ QString flags() const;
+
+private:
+ OptimizationTab *optimization;
+ HpfTab *hpf;
+};
+
+#endif
diff --git a/languages/fortran/doc/Makefile.am b/languages/fortran/doc/Makefile.am
new file mode 100644
index 00000000..5e7eab51
--- /dev/null
+++ b/languages/fortran/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = fortran_bugs_gcc.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/fortran/doc/fortran_bugs_gcc.toc b/languages/fortran/doc/fortran_bugs_gcc.toc
new file mode 100644
index 00000000..444a2a05
--- /dev/null
+++ b/languages/fortran/doc/fortran_bugs_gcc.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Fortran bugs (GCC)</title>
+<base href="http://gcc.gnu.org/bugzilla/"/>
+<tocsect1 name="Query" url="query.cgi">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/fortran/file_templates/Makefile.am b/languages/fortran/file_templates/Makefile.am
new file mode 100644
index 00000000..2a8e4365
--- /dev/null
+++ b/languages/fortran/file_templates/Makefile.am
@@ -0,0 +1,2 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = f f77 f90 f95 for fpp ftn
diff --git a/languages/fortran/file_templates/f b/languages/fortran/file_templates/f
new file mode 100644
index 00000000..909182fc
--- /dev/null
+++ b/languages/fortran/file_templates/f
@@ -0,0 +1,11 @@
+c
+c Preprocessed Fortran Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/f77 b/languages/fortran/file_templates/f77
new file mode 100644
index 00000000..a3628bc1
--- /dev/null
+++ b/languages/fortran/file_templates/f77
@@ -0,0 +1,11 @@
+c
+c Fortran 77 Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/f90 b/languages/fortran/file_templates/f90
new file mode 100644
index 00000000..b3800d65
--- /dev/null
+++ b/languages/fortran/file_templates/f90
@@ -0,0 +1,11 @@
+c
+c Fortran 90 Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/f95 b/languages/fortran/file_templates/f95
new file mode 100644
index 00000000..a4f452cf
--- /dev/null
+++ b/languages/fortran/file_templates/f95
@@ -0,0 +1,11 @@
+c
+c Fortran 95 Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/for b/languages/fortran/file_templates/for
new file mode 100644
index 00000000..909182fc
--- /dev/null
+++ b/languages/fortran/file_templates/for
@@ -0,0 +1,11 @@
+c
+c Preprocessed Fortran Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/fpp b/languages/fortran/file_templates/fpp
new file mode 100644
index 00000000..d8a7ad6c
--- /dev/null
+++ b/languages/fortran/file_templates/fpp
@@ -0,0 +1,11 @@
+c
+c Fortran Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/file_templates/ftn b/languages/fortran/file_templates/ftn
new file mode 100644
index 00000000..a3628bc1
--- /dev/null
+++ b/languages/fortran/file_templates/ftn
@@ -0,0 +1,11 @@
+c
+c Fortran 77 Implementation: $MODULE$
+c
+c Description:
+c
+c
+c Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+c
+c Copyright: See COPYING file that comes with this distribution
+c
+
diff --git a/languages/fortran/fixedformparser.cpp b/languages/fortran/fixedformparser.cpp
new file mode 100644
index 00000000..7084fbba
--- /dev/null
+++ b/languages/fortran/fixedformparser.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "fixedformparser.h"
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <kdebug.h>
+#include <codemodel.h>
+
+
+FixedFormParser::FixedFormParser(CodeModel* model)
+{
+ m_model = model;
+
+ functionre.setPattern("(integer|real|logical|complex|character|"
+ "double(precision)?)function([^(]+).*");
+ subroutinere.setPattern("subroutine([^(]+).*");
+
+ functionre.setCaseSensitive( false );
+ subroutinere.setCaseSensitive( false );
+}
+
+
+void FixedFormParser::process(const QCString &line, const QString &fileName, int lineNum)
+{
+ QCString simplified;
+ int l = line.length();
+ for (int i=0; i < l; ++i)
+ if (line[i] != ' ')
+ simplified += line[i];
+
+ if ( simplified.isEmpty() ) return;
+
+ QString name;
+ if (functionre.search(simplified) != -1)
+ name = functionre.cap(3);
+ else if (subroutinere.search(simplified) != -1)
+ name = subroutinere.cap(1);
+ else
+ return;
+
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName(fileName);
+ method->setStartPosition(lineNum, 0);
+
+ if( !m_file->hasFunction(method->name()) )
+ m_file->addFunction(method);
+}
+
+
+void FixedFormParser::parse(const QString &fileName)
+{
+ QFile f(QFile::encodeName(fileName));
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream stream(&f);
+
+ m_file = m_model->create<FileModel>();
+ m_file->setName( fileName );
+
+ QCString line;
+ int lineNum=0, startLineNum=0;
+ while (!stream.atEnd()) {
+ ++lineNum;
+ QCString str = stream.readLine().local8Bit();
+ if (!str.isEmpty() && QCString("*Cc#!").find(str[0]) != -1)
+ continue;
+ // Continuation line
+ if (str.length() > 6 && str.left(5) == " " && str[5] != ' ') {
+ line += str.right(str.length()-6);
+ continue;
+ }
+ // An initial or invalid line. We don't care
+ // about validity
+ process(line, fileName, startLineNum);
+ line = str.right(str.length()-6);
+ startLineNum = lineNum-1;
+ }
+ process(line, fileName, startLineNum);
+
+ f.close();
+
+ m_model->addFile( m_file );
+}
diff --git a/languages/fortran/fixedformparser.h b/languages/fortran/fixedformparser.h
new file mode 100644
index 00000000..a7016510
--- /dev/null
+++ b/languages/fortran/fixedformparser.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FIXEDFORMPARSER_H_
+#define _FIXEDFORMPARSER_H_
+
+#include <qstring.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <codemodel.h>
+
+
+class FixedFormParser
+{
+public:
+ FixedFormParser(CodeModel* model);
+
+ void parse(const QString &fileName);
+
+private:
+ void process(const QCString &line, const QString &fileName, int lineNum);
+ CodeModel* m_model;
+ FileDom m_file;
+ QRegExp functionre, subroutinere;
+};
+
+#endif
diff --git a/languages/fortran/fortransupportpart.cpp b/languages/fortran/fortransupportpart.cpp
new file mode 100644
index 00000000..e0c0bde9
--- /dev/null
+++ b/languages/fortran/fortransupportpart.cpp
@@ -0,0 +1,287 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * The tooltips for ftnchek contained in this source file are taken *
+ * from the ftnchek man page. ftnchek is written by Robert Moniot and *
+ * others. *
+ * *
+ ***************************************************************************/
+
+#include "fortransupportpart.h"
+#include "ftnchekconfigwidget.h"
+#include "fixedformparser.h"
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kregexp.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kiconloader.h>
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevmakefrontend.h>
+#include <kdevpartcontroller.h>
+#include <domutil.h>
+#include <codemodel.h>
+#include <kdevplugininfo.h>
+
+
+typedef KDevGenericFactory<FortranSupportPart> FortranSupportFactory;
+static const KDevPluginInfo data("kdevfortransupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevfortransupport, FortranSupportFactory( data ) )
+
+FortranSupportPart::FortranSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "FortranSupportPart")
+{
+ setInstance(FortranSupportFactory::instance());
+
+ setXMLFile("kdevfortransupport.rc");
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+
+ KAction *action;
+
+ action = new KAction( i18n("&Ftnchek"), 0,
+ this, SLOT(slotFtnchek()),
+ actionCollection(), "project_ftnchek" );
+ action->setToolTip(i18n("Run ftnchek"));
+ action->setWhatsThis(i18n("<b>Run ftnchek</b><p>Runs <b>ftnchek</b> to check fortran programs for semantic errors. Configure ftnchek options in project settings dialog, <b>Ftnchek</b> tab."));
+
+ parser = 0;
+}
+
+
+FortranSupportPart::~FortranSupportPart()
+{}
+
+
+void FortranSupportPart::slotFtnchek()
+{
+ // Do something smarter here...
+ if (makeFrontend()->isRunning()) {
+ KMessageBox::sorry(0, i18n("There is currently a job running."));
+ return;
+ }
+
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ QDomDocument &dom = *projectDom();
+
+ QString cmdline = "cd ";
+ cmdline += KProcess::quote(project()->projectDirectory());
+ cmdline += "&& ftnchek -nonovice ";
+
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/division"))
+ cmdline += "-division ";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/extern"))
+ cmdline += "-extern ";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/declare"))
+ cmdline += "-declare ";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/pure"))
+ cmdline += "-pure ";
+
+ cmdline += "-arguments=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly") + " ";
+
+ cmdline += "-common=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/commononly") + " ";
+
+ cmdline += "-truncation=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/truncationonly") + " ";
+
+ cmdline += "-usage=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/usageonly") + " ";
+
+ cmdline += "-f77=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/f77only") + " ";
+
+ cmdline += "-portability=";
+ if (DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall"))
+ cmdline += "all ";
+ else
+ cmdline += DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly") + " ";
+
+ QStringList list = project()->allFiles();
+ QStringList::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ QFileInfo fi(*it);
+ QString extension = fi.extension();
+ if (extension == "f77" || extension == "f" || extension == "for"
+ || extension == "ftn") {
+ cmdline += *it + " ";
+ }
+ }
+
+ makeFrontend()->queueCommand(QString::null, cmdline);
+}
+
+
+void FortranSupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Ftnchek"), i18n("Ftnchek"), BarIcon("kdevelop", KIcon::SizeMedium));
+ FtnchekConfigWidget *w = new FtnchekConfigWidget(*projectDom(), vbox, "ftnchek config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+
+void FortranSupportPart::projectOpened()
+{
+ kdDebug(9019) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ parser = new FixedFormParser(codeModel());
+
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+
+void FortranSupportPart::projectClosed()
+{
+ delete parser;
+ parser = 0;
+}
+
+
+void FortranSupportPart::maybeParse(const QString fileName)
+{
+ QFileInfo fi(fileName);
+ QString extension = fi.extension();
+ if (extension == "f77" || extension == "f" || extension == "for" || extension == "ftn") {
+
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+
+ parser->parse(fileName);
+ }
+}
+
+
+void FortranSupportPart::initialParse()
+{
+ kdDebug(9019) << "initialParse()" << endl;
+
+ if (project()) {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+ QFileInfo fileInfo( project()->projectDirectory(), *it );
+ kdDebug(9019) << "maybe parse " << fileInfo.absFilePath() << endl;
+ maybeParse( fileInfo.absFilePath() );
+ }
+
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug(9019) << "No project" << endl;
+ }
+}
+
+
+void FortranSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9019) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QFileInfo fileInfo( project()->projectDirectory(), *it );
+ QString path = fileInfo.absFilePath();
+ maybeParse( path );
+ emit addedSourceInfo( path );
+ }
+
+ //emit updatedSourceInfo();
+}
+
+
+void FortranSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9019) << "removedFilesFromProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QFileInfo fileInfo( project()->projectDirectory(), *it );
+ QString path = fileInfo.absFilePath();
+
+ if( codeModel()->hasFile(path) ){
+ emit aboutToRemoveSourceInfo( path );
+ codeModel()->removeFile( codeModel()->fileByName(path) );
+ }
+ }
+
+ //emit updatedSourceInfo();
+}
+
+
+void FortranSupportPart::savedFile(const KURL &fileName)
+{
+ kdDebug(9019) << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) {
+ maybeParse(fileName.path());
+ emit addedSourceInfo( fileName.path() );
+ }
+}
+
+
+KDevLanguageSupport::Features FortranSupportPart::features()
+{
+ return Features(Functions);
+}
+
+KDevMakeFrontend * FortranSupportPart::makeFrontend( )
+{
+ return extension<KDevMakeFrontend>("KDevelop/MakeFrontend");
+}
+
+#include "fortransupportpart.moc"
diff --git a/languages/fortran/fortransupportpart.h b/languages/fortran/fortransupportpart.h
new file mode 100644
index 00000000..52dcba5a
--- /dev/null
+++ b/languages/fortran/fortransupportpart.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FORTRANSUPPORTPART_H_
+#define _FORTRANSUPPORTPART_H_
+
+class FixedFormParser;
+class KDialogBase;
+class QStringList;
+class KDevMakeFrontend;
+
+#include "kdevlanguagesupport.h"
+
+
+class FortranSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ FortranSupportPart( QObject *parent, const char *name, const QStringList & );
+ ~FortranSupportPart();
+
+protected:
+ virtual KDevLanguageSupport::Features features();
+
+private slots:
+ void slotFtnchek();
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+
+ // Internal
+ void initialParse();
+
+private:
+ void maybeParse(const QString fileName);
+ KDevMakeFrontend *makeFrontend();
+
+ FixedFormParser *parser;
+};
+
+#endif
diff --git a/languages/fortran/ftnchekconfigwidget.cpp b/languages/fortran/ftnchekconfigwidget.cpp
new file mode 100644
index 00000000..fd4f7a87
--- /dev/null
+++ b/languages/fortran/ftnchekconfigwidget.cpp
@@ -0,0 +1,290 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "ftnchekconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qradiobutton.h>
+#include <qtooltip.h>
+#include <klocale.h>
+
+#include "domutil.h"
+
+
+class FtnchekItem : public QCheckListItem
+{
+public:
+ FtnchekItem(QListView *parent, const QString &flagstr,
+ const QString &description)
+ : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox),
+ flag(flagstr), desc(description)
+ {
+ setText(1, desc);
+ }
+
+ static void readFlagsToListView(QListView *listview, QStringList *list);
+ static void writeFlagsFromListView(QListView *listview, QStringList *list);
+
+private:
+ QString flag;
+ QString desc;
+ friend class FtnchekToolTip;
+};
+
+
+void FtnchekItem::readFlagsToListView(QListView *listview, QStringList *list)
+{
+ QListViewItem *item = listview->firstChild();
+ for (; item; item = item->nextSibling()) {
+ FtnchekItem *flitem = static_cast<FtnchekItem*>(item);
+ QStringList::Iterator sli = list->find(flitem->flag);
+ if (sli != list->end()) {
+ flitem->setOn(true);
+ list->remove(sli);
+ }
+ }
+}
+
+
+void FtnchekItem::writeFlagsFromListView(QListView *listview, QStringList *list)
+{
+ (*list).clear();
+
+ QListViewItem *item = listview->firstChild();
+ for (; item; item = item->nextSibling()) {
+ FtnchekItem *flitem = static_cast<FtnchekItem*>(item);
+ if (flitem->isOn())
+ (*list) << flitem->flag;
+ }
+}
+
+
+class FtnchekToolTip : public QToolTip
+{
+public:
+ FtnchekToolTip(QWidget *parent)
+ : QToolTip(parent)
+ {}
+protected:
+ void maybeTip(const QPoint &pos)
+ {
+ QListView *listview = static_cast<QListView*>(parentWidget());
+ QListViewItem *item = listview->itemAt(pos);
+ FtnchekItem *flitem = static_cast<FtnchekItem*>(item);
+
+ if (item)
+ tip(listview->itemRect(item), flitem->desc);
+ }
+};
+
+
+const char *arguments_flags[] = {
+ "arrayness", I18N_NOOP("Warn about inconsistent use of arguments that use arrays"),
+ "type", I18N_NOOP("Warn about dummy arguments of a data type different from "
+ "the actual arguments"),
+ "function-type", I18N_NOOP("Warn if the invocation assumes a different data type for the return type, "
+ "different from the actual return type"),
+ "number", I18N_NOOP("Warn about invoking a subprogram with an incorrect number of arguments"),
+ 0, 0
+};
+
+
+const char *common_flags[] = {
+ "dimension", I18N_NOOP("Corresponding arrays in each declaration of a block must agree in size "
+ "and number of dimensions"),
+ "exact", I18N_NOOP("The comparison of two blocks is done variable-by-variable"),
+ "length", I18N_NOOP("Warn if different declarations of the same block are not equal in total length"),
+ "type", I18N_NOOP("In each declaration of a block, corresponding memory locations "
+ "must agree in data type"),
+ 0, 0
+};
+
+
+const char *truncation_flags[] = {
+ "int-div-exponent", I18N_NOOP("Use of the result of integer division as an exponent"),
+ "int-div-real", I18N_NOOP("Conversion of an expression involving an integer division to real"),
+ "int-div-zero", I18N_NOOP("Division in an integer constant expression that yields a result of zero"),
+ 0, 0
+};
+
+
+const char *usage_flags[] = {
+ "arg-alias", I18N_NOOP("A scalar dummy argument is actually the same as another "
+ "and is (or may be) modified"),
+ "arg-array-alias", I18N_NOOP("A dummy argument which is an array or array element "
+ "is the same array as another and is modified"),
+ "arg-common-alias", I18N_NOOP("A scalar dummy argument is the same as a common variable in "
+ "the subprogram, and either is modified"),
+ 0, 0
+};
+
+
+const char *f77_flags[] = {
+ "accept-type", I18N_NOOP("ACCEPT and TYPE I/O statements"),
+ "array-bounds", I18N_NOOP("Expressions defining array bounds that contain array "
+ "elements or function references"),
+ "assignment-stmt", I18N_NOOP("Assignment statements involving arrays"),
+ 0, 0
+};
+
+
+const char *portability_flags[] = {
+ "backslash", I18N_NOOP("Backslash characters in strings"),
+ "common-alignment", I18N_NOOP("COMMON block variables not in descending order of storage sizes"),
+ "hollerith", I18N_NOOP("Hollerith constants"),
+ 0, 0
+};
+
+
+FtnchekConfigWidget::FtnchekConfigWidget(QDomDocument &projectDom, QWidget *parent, const char *name)
+ : FtnchekConfigWidgetBase(parent, name), dom(projectDom)
+{
+ arguments_group = new QButtonGroup;
+ arguments_group->insert(argumentsall_button);
+ arguments_group->insert(argumentsonly_button);
+ common_group = new QButtonGroup;
+ common_group->insert(commonall_button);
+ common_group->insert(commononly_button);
+ truncation_group = new QButtonGroup;
+ truncation_group->insert(truncationall_button);
+ truncation_group->insert(truncationonly_button);
+ usage_group = new QButtonGroup;
+ usage_group->insert(usageall_button);
+ usage_group->insert(usageonly_button);
+ f77_group = new QButtonGroup;
+ f77_group->insert(f77all_button);
+ f77_group->insert(f77only_button);
+ portability_group = new QButtonGroup;
+ portability_group->insert(portabilityall_button);
+ portability_group->insert(portabilityonly_button);
+
+ arguments_listview->header()->hide();
+ new FtnchekToolTip(arguments_listview);
+
+ common_listview->header()->hide();
+ new FtnchekToolTip(common_listview);
+
+ truncation_listview->header()->hide();
+ new FtnchekToolTip(truncation_listview);
+
+ usage_listview->header()->hide();
+ new FtnchekToolTip(usage_listview);
+
+ f77_listview->header()->hide();
+ new FtnchekToolTip(f77_listview);
+
+ portability_listview->header()->hide();
+ new FtnchekToolTip(portability_listview);
+
+ for (const char **p = arguments_flags; *p; p += 2)
+ new FtnchekItem(arguments_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ for (const char **p = common_flags; *p; p += 2)
+ new FtnchekItem(common_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ for (const char **p = truncation_flags; *p; p += 2)
+ new FtnchekItem(truncation_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ for (const char **p = usage_flags; *p; p += 2)
+ new FtnchekItem(usage_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ for (const char **p = f77_flags; *p; p += 2)
+ new FtnchekItem(f77_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ for (const char **p = portability_flags; *p; p += 2)
+ new FtnchekItem(portability_listview, QString::fromUtf8(*p), i18n(*(p+1)));
+
+ readConfig();
+}
+
+
+FtnchekConfigWidget::~FtnchekConfigWidget()
+{
+ delete arguments_group;
+ delete common_group;
+ delete truncation_group;
+ delete usage_group;
+ delete f77_group;
+ delete portability_group;
+}
+
+
+void FtnchekConfigWidget::accept()
+{
+ storeConfig();
+}
+
+
+void FtnchekConfigWidget::readConfig()
+{
+ division_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/division"));
+ extern_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/extern"));
+ declare_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/declare"));
+ pure_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/pure"));
+
+ argumentsall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall"));
+ commonall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall"));
+ truncationall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall"));
+ usageall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall"));
+ f77all_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all"));
+ portabilityall_button->setChecked(DomUtil::readBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall"));
+
+ QStringList list;
+
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly"));
+ FtnchekItem::readFlagsToListView(arguments_listview, &list);
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/commononly"));
+ FtnchekItem::readFlagsToListView(common_listview, &list);
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/truncationonly"));
+ FtnchekItem::readFlagsToListView(truncation_listview, &list);
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/usageonly"));
+ FtnchekItem::readFlagsToListView(usage_listview, &list);
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/f77only"));
+ FtnchekItem::readFlagsToListView(f77_listview, &list);
+ list = QStringList::split(',', DomUtil::readEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly"));
+ FtnchekItem::readFlagsToListView(portability_listview, &list);
+}
+
+
+void FtnchekConfigWidget::storeConfig()
+{
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/division", division_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/extern", extern_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/declare", declare_box->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/pure", pure_box->isChecked());
+
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/argumentsall", argumentsall_button->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/commonall", commonall_button->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/truncationall", truncationall_button->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/usageall", usageall_button->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/f77all", f77all_button->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevfortransupport/ftnchek/portabilityall", portabilityall_button->isChecked());
+
+ QStringList list;
+
+ FtnchekItem::writeFlagsFromListView(arguments_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/argumentsonly", list.join(","));
+ FtnchekItem::writeFlagsFromListView(common_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/commononly", list.join(","));
+ FtnchekItem::writeFlagsFromListView(truncation_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/truncationonly", list.join(","));
+ FtnchekItem::writeFlagsFromListView(usage_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/usageonly", list.join(","));
+ FtnchekItem::writeFlagsFromListView(f77_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/f77only", list.join(","));
+ FtnchekItem::writeFlagsFromListView(portability_listview, &list);
+ DomUtil::writeEntry(dom, "/kdevfortransupport/ftnchek/portabilityonly", list.join(","));
+}
+
+#include "ftnchekconfigwidget.moc"
diff --git a/languages/fortran/ftnchekconfigwidget.h b/languages/fortran/ftnchekconfigwidget.h
new file mode 100644
index 00000000..053b2598
--- /dev/null
+++ b/languages/fortran/ftnchekconfigwidget.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FTNCHEKCONFIGWIDGET_H_
+#define _FTNCHEKCONFIGWIDGET_H_
+
+#include <qdom.h>
+#include "ftnchekconfigwidgetbase.h"
+
+class QButtonGroup;
+
+class FtnchekConfigWidget : public FtnchekConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ FtnchekConfigWidget(QDomDocument &projectDom, QWidget *parent, const char *name);
+ ~FtnchekConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ void readConfig();
+ void storeConfig();
+
+ QButtonGroup *arguments_group, *common_group;
+ QButtonGroup *truncation_group, *usage_group;
+ QButtonGroup *f77_group, *portability_group;
+ QDomDocument dom;
+};
+
+#endif
diff --git a/languages/fortran/ftnchekconfigwidgetbase.ui b/languages/fortran/ftnchekconfigwidgetbase.ui
new file mode 100644
index 00000000..b6bb2184
--- /dev/null
+++ b/languages/fortran/ftnchekconfigwidgetbase.ui
@@ -0,0 +1,584 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>FtnchekConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ftcheck_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>798</width>
+ <height>507</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Ftnchek Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>TabWidget4</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;1</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="2">
+ <property name="name">
+ <cstring>extern_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;External subprograms without definition</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="2">
+ <property name="name">
+ <cstring>division_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Divisions</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>declare_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Identifiers without explicit type</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>pure_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Assume functions have no side effects</string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>Spacer2_3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Ar&amp;guments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>argumentsall_button</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="4" column="0">
+ <property name="name">
+ <cstring>argumentsall_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="5" column="0">
+ <property name="name">
+ <cstring>argumentsonly_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="6" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="2" column="2">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton" row="4" column="2">
+ <property name="name">
+ <cstring>commonall_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="5" column="2">
+ <property name="name">
+ <cstring>commononly_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QListView" row="6" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>arguments_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <widget class="QListView" row="6" column="2">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>common_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="2">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Common &amp;blocks:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>commonall_button</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;2</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>truncationonly_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Truncation and roundoff errors:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>truncationall_button</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>truncationall_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use of variables:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>usageall_button</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="2">
+ <property name="name">
+ <cstring>usageall_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="3" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>truncation_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="2">
+ <property name="name">
+ <cstring>usageonly_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QListView" row="3" column="2">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>usage_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;3</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>f77all_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>f77only_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QListView" row="3" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>f77_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <widget class="QListView" row="3" column="2">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>portability_listview</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>Fortran 77 language &amp;extensions:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>f77all_button</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>TextLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Other &amp;portability warnings:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>portabilityall_button</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="2">
+ <property name="name">
+ <cstring>portabilityall_button</cstring>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="2">
+ <property name="name">
+ <cstring>portabilityonly_button</cstring>
+ </property>
+ <property name="text">
+ <string>Only the following:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>declare_box</tabstop>
+ <tabstop>pure_box</tabstop>
+ <tabstop>extern_box</tabstop>
+ <tabstop>division_box</tabstop>
+ <tabstop>argumentsall_button</tabstop>
+ <tabstop>argumentsonly_button</tabstop>
+ <tabstop>arguments_listview</tabstop>
+ <tabstop>commonall_button</tabstop>
+ <tabstop>commononly_button</tabstop>
+ <tabstop>common_listview</tabstop>
+ <tabstop>TabWidget4</tabstop>
+ <tabstop>truncationall_button</tabstop>
+ <tabstop>truncationonly_button</tabstop>
+ <tabstop>truncation_listview</tabstop>
+ <tabstop>usageall_button</tabstop>
+ <tabstop>usageonly_button</tabstop>
+ <tabstop>usage_listview</tabstop>
+ <tabstop>f77all_button</tabstop>
+ <tabstop>f77only_button</tabstop>
+ <tabstop>f77_listview</tabstop>
+ <tabstop>portabilityall_button</tabstop>
+ <tabstop>portabilityonly_button</tabstop>
+ <tabstop>portability_listview</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/fortran/kdevfortransupport.desktop b/languages/fortran/kdevfortransupport.desktop
new file mode 100644
index 00000000..ad4f8185
--- /dev/null
+++ b/languages/fortran/kdevfortransupport.desktop
@@ -0,0 +1,80 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Fortran 77 Support
+Comment[ca]=Suport per a Fortran 77
+Comment[da]=Fortran 77 understøttelse
+Comment[de]=Unterstützung für Fortran 77 für KDevelop
+Comment[el]=Υποστήριξη Fortran 77
+Comment[es]=Soporte para Fortran 77
+Comment[et]=Fortran 77 toetus
+Comment[eu]=Fortran 77 euskarria
+Comment[fa]=پشتیبانی فرترن ۷۷
+Comment[fr]=Prise en charge du langage Fortran77
+Comment[ga]=Tacaíocht Fortran 77
+Comment[gl]=Soporte para Fortran 77
+Comment[hi]=फ़ोरट्रॉन 77 समर्थन
+Comment[hu]=Fortran 77-támogatás
+Comment[is]=Fortran 77 stuðningur
+Comment[it]=Supporto per Fortran 77
+Comment[ja]=Fortran 77 サポート
+Comment[nds]=Ünnerstütten för Fortran 77
+Comment[ne]=फोर्ट्रान ७७ समर्थन
+Comment[nl]=Ondersteuning voor Fortran 77
+Comment[pl]=Obsługa Fortrana 77
+Comment[pt]=Suporte a Fortran 77
+Comment[pt_BR]=Suporte ao Fortran 77
+Comment[ru]=Поддержка языка Fortran 77
+Comment[sk]=Fortran 77 podpora
+Comment[sl]=Podpora za Fortran 77
+Comment[sr]=Подршка за Fortran 77
+Comment[sr@Latn]=Podrška za Fortran 77
+Comment[sv]=Fortran 77-stöd
+Comment[ta]=பொர்ட்ரான் 77 ஆதரவு
+Comment[tg]=Ёрӣ намудани забони 77 Support
+Comment[tr]=Fortran 77 Desteği
+Comment[zh_CN]=Fortran 77 支持
+Comment[zh_TW]=Fortran 77 支援
+Name=KDevFortranSupport
+Name[da]=KDevelop Fortran77 understøttelse
+Name[nds]=Fortran-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaFortrana
+Name[sk]=KDev Fortran podpora
+Name[sv]=KDevelop Fortran-stöd
+Name[zh_TW]=KDevelop Fortran 支援
+GenericName=Fortran 77 Support
+GenericName[ca]=Suport per a Fortran 77
+GenericName[da]=Fortran 77 understøttelse
+GenericName[de]=Unterstützung für Fortran 77
+GenericName[el]=Υποστήριξη Fortran 77
+GenericName[es]=Soporte para Fortran 77
+GenericName[et]=Fortran 77 toetus
+GenericName[eu]=Fortran 77 euskarria
+GenericName[fa]=پشتیبانی فرترن ۷۷
+GenericName[fr]=Prise en charge du langage Fortran 77
+GenericName[ga]=Tacaíocht Fortran 77
+GenericName[gl]=Soporte para Fortran 77
+GenericName[hi]=फ़ोरट्रॉन 77 समर्थन
+GenericName[hu]=Fortran 77-támogatás
+GenericName[it]=Supporto Fortran 77
+GenericName[ja]=Fortran 77 サポート
+GenericName[nds]=Ünnerstütten för Fortran-77
+GenericName[ne]=फोर्ट्रान ७७ समर्थन
+GenericName[nl]=Ondersteuning voor Fortran 77
+GenericName[pl]=Obsługa Fortrana 77
+GenericName[pt]=Suporte a Fortran 77
+GenericName[pt_BR]=Suporte ao Fortran 77
+GenericName[ru]=Поддержка языка Fortran 77
+GenericName[sk]=Fortran 77 podpora
+GenericName[sl]=Podpora za Fortran 77
+GenericName[sr]=Подршка за Fortran 77
+GenericName[sr@Latn]=Podrška za Fortran 77
+GenericName[sv]=Fortran 77-stöd
+GenericName[tg]=Ёрӣ намудани забони 77 Support
+GenericName[tr]=Fortran 77 Desteği
+GenericName[zh_CN]=Fortran 77 支持
+GenericName[zh_TW]=Fortran 77 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevfortransupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Fortran77
diff --git a/languages/fortran/kdevfortransupport.rc b/languages/fortran/kdevfortransupport.rc
new file mode 100644
index 00000000..40e3f80a
--- /dev/null
+++ b/languages/fortran/kdevfortransupport.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevFortranSupport" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="project_ftnchek" />
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/languages/java/JavaAST.hpp b/languages/java/JavaAST.hpp
new file mode 100644
index 00000000..7108fca1
--- /dev/null
+++ b/languages/java/JavaAST.hpp
@@ -0,0 +1,77 @@
+#ifndef JAVAAST_HPP
+#define JAVAAST_HPP
+
+#include <antlr/CommonAST.hpp>
+#include <antlr/ASTFactory.hpp>
+
+class JavaAST;
+typedef ANTLR_USE_NAMESPACE(antlr)ASTRefCount<JavaAST> RefJavaAST;
+
+class JavaAST : public ANTLR_USE_NAMESPACE(antlr)CommonAST
+{
+public:
+ JavaAST()
+ : m_line(0), m_column(0) {}
+
+ virtual ~JavaAST() {}
+
+ int getLine() const { return m_line; }
+ void setLine( int line ) { m_line = line; }
+
+ int getColumn() const { return m_column; }
+ void setColumn( int column ) { m_column = column; }
+
+ void initialize( ANTLR_USE_NAMESPACE(antlr)RefToken t )
+ {
+ CommonAST::initialize(t);
+ m_line = t->getLine() - 1;
+ m_column = t->getColumn() - 1;
+ }
+
+ void initialize( ANTLR_USE_NAMESPACE(antlr)RefAST t )
+ {
+ CommonAST::initialize( t );
+
+ m_line = 0;
+ m_column = 0;
+
+ RefJavaAST a( dynamic_cast<JavaAST*>(t.get()) );
+ m_line = a->getLine();
+ m_column = a->getColumn();
+ }
+
+ void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
+ {
+ CommonAST::initialize( t, txt );
+ m_line = 0;
+ m_column = 0;
+ }
+
+ static ANTLR_USE_NAMESPACE(antlr)RefAST factory()
+ {
+ RefJavaAST n(new JavaAST);
+ return n.get();
+ }
+
+
+private:
+ int m_line;
+ int m_column;
+
+private:
+ JavaAST( const JavaAST& source );
+ void operator = ( const JavaAST& source );
+};
+
+namespace antlr
+{
+
+class JavaASTFactory: public ASTFactory
+{
+public:
+ JavaASTFactory(): ASTFactory( "JavaAST", JavaAST::factory ) {}
+};
+
+} // namespace antlr
+
+#endif
diff --git a/languages/java/JavaLexer.cpp b/languages/java/JavaLexer.cpp
new file mode 100644
index 00000000..623e816f
--- /dev/null
+++ b/languages/java/JavaLexer.cpp
@@ -0,0 +1,2183 @@
+/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaLexer.cpp"$ */
+#include "JavaLexer.hpp"
+#include <antlr/CharBuffer.hpp>
+#include <antlr/TokenStreamException.hpp>
+#include <antlr/TokenStreamIOException.hpp>
+#include <antlr/TokenStreamRecognitionException.hpp>
+#include <antlr/CharStreamException.hpp>
+#include <antlr/CharStreamIOException.hpp>
+#include <antlr/NoViableAltForCharException.hpp>
+
+#line 1041 "java.g"
+
+#include <string>
+
+#line 16 "JavaLexer.cpp"
+JavaLexer::JavaLexer(ANTLR_USE_NAMESPACE(std)istream& in)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),true)
+{
+ initLiterals();
+}
+
+JavaLexer::JavaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,true)
+{
+ initLiterals();
+}
+
+JavaLexer::JavaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,true)
+{
+ initLiterals();
+}
+
+void JavaLexer::initLiterals()
+{
+ literals["byte"] = 51;
+ literals["public"] = 62;
+ literals["case"] = 94;
+ literals["short"] = 53;
+ literals["break"] = 89;
+ literals["while"] = 87;
+ literals["new"] = 137;
+ literals["instanceof"] = 122;
+ literals["implements"] = 76;
+ literals["synchronized"] = 68;
+ literals["float"] = 55;
+ literals["package"] = 44;
+ literals["return"] = 91;
+ literals["throw"] = 93;
+ literals["null"] = 136;
+ literals["threadsafe"] = 67;
+ literals["protected"] = 63;
+ literals["class"] = 70;
+ literals["throws"] = 82;
+ literals["do"] = 88;
+ literals["strictfp"] = 41;
+ literals["super"] = 80;
+ literals["transient"] = 65;
+ literals["native"] = 66;
+ literals["interface"] = 72;
+ literals["final"] = 39;
+ literals["if"] = 84;
+ literals["double"] = 57;
+ literals["volatile"] = 69;
+ literals["catch"] = 98;
+ literals["try"] = 96;
+ literals["int"] = 54;
+ literals["for"] = 86;
+ literals["extends"] = 71;
+ literals["boolean"] = 50;
+ literals["char"] = 52;
+ literals["private"] = 61;
+ literals["default"] = 95;
+ literals["false"] = 135;
+ literals["this"] = 79;
+ literals["static"] = 64;
+ literals["abstract"] = 40;
+ literals["continue"] = 90;
+ literals["finally"] = 97;
+ literals["else"] = 85;
+ literals["import"] = 46;
+ literals["void"] = 49;
+ literals["switch"] = 92;
+ literals["true"] = 134;
+ literals["long"] = 56;
+}
+
+ANTLR_USE_NAMESPACE(antlr)RefToken JavaLexer::nextToken()
+{
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ for (;;) {
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ int _ttype = ANTLR_USE_NAMESPACE(antlr)Token::INVALID_TYPE;
+ resetText();
+ try { // for lexical and char stream error handling
+ switch ( LA(1)) {
+ case 0x3f /* '?' */ :
+ {
+ mQUESTION(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x28 /* '(' */ :
+ {
+ mLPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x29 /* ')' */ :
+ {
+ mRPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x5b /* '[' */ :
+ {
+ mLBRACK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x5d /* ']' */ :
+ {
+ mRBRACK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x7b /* '{' */ :
+ {
+ mLCURLY(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x7d /* '}' */ :
+ {
+ mRCURLY(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x3a /* ':' */ :
+ {
+ mCOLON(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x2c /* ',' */ :
+ {
+ mCOMMA(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x7e /* '~' */ :
+ {
+ mBNOT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x3b /* ';' */ :
+ {
+ mSEMI(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ case 0xa /* '\n' */ :
+ case 0xc /* '\14' */ :
+ case 0xd /* '\r' */ :
+ case 0x20 /* ' ' */ :
+ {
+ mWS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x27 /* '\'' */ :
+ {
+ mCHAR_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x22 /* '\"' */ :
+ {
+ mSTRING_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x24 /* '$' */ :
+ case 0x41 /* 'A' */ :
+ case 0x42 /* 'B' */ :
+ case 0x43 /* 'C' */ :
+ case 0x44 /* 'D' */ :
+ case 0x45 /* 'E' */ :
+ case 0x46 /* 'F' */ :
+ case 0x47 /* 'G' */ :
+ case 0x48 /* 'H' */ :
+ case 0x49 /* 'I' */ :
+ case 0x4a /* 'J' */ :
+ case 0x4b /* 'K' */ :
+ case 0x4c /* 'L' */ :
+ case 0x4d /* 'M' */ :
+ case 0x4e /* 'N' */ :
+ case 0x4f /* 'O' */ :
+ case 0x50 /* 'P' */ :
+ case 0x51 /* 'Q' */ :
+ case 0x52 /* 'R' */ :
+ case 0x53 /* 'S' */ :
+ case 0x54 /* 'T' */ :
+ case 0x55 /* 'U' */ :
+ case 0x56 /* 'V' */ :
+ case 0x57 /* 'W' */ :
+ case 0x58 /* 'X' */ :
+ case 0x59 /* 'Y' */ :
+ case 0x5a /* 'Z' */ :
+ case 0x5f /* '_' */ :
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ mIDENT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x2e /* '.' */ :
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ mNUM_INT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ default:
+ if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ ) && (LA(3) == 0x3e /* '>' */ ) && (LA(4) == 0x3d /* '=' */ )) {
+ mBSR_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ ) && (LA(3) == 0x3d /* '=' */ )) {
+ mSR_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ ) && (LA(3) == 0x3e /* '>' */ ) && (true)) {
+ mBSR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3c /* '<' */ ) && (LA(3) == 0x3d /* '=' */ )) {
+ mSL_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mEQUAL(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x21 /* '!' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mNOT_EQUAL(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mDIV_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2b /* '+' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mPLUS_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2b /* '+' */ ) && (LA(2) == 0x2b /* '+' */ )) {
+ mINC(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mMINUS_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x2d /* '-' */ )) {
+ mDEC(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mSTAR_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x25 /* '%' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mMOD_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3e /* '>' */ ) && (true)) {
+ mSR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mGE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3c /* '<' */ ) && (true)) {
+ mSL(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mLE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x5e /* '^' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mBXOR_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x7c /* '|' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mBOR_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x7c /* '|' */ ) && (LA(2) == 0x7c /* '|' */ )) {
+ mLOR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x26 /* '&' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mBAND_ASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x26 /* '&' */ ) && (LA(2) == 0x26 /* '&' */ )) {
+ mLAND(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
+ mSL_COMMENT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2a /* '*' */ )) {
+ mML_COMMENT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
+ mASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x21 /* '!' */ ) && (true)) {
+ mLNOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (true)) {
+ mDIV(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2b /* '+' */ ) && (true)) {
+ mPLUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (true)) {
+ mMINUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (true)) {
+ mSTAR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x25 /* '%' */ ) && (true)) {
+ mMOD(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
+ mGT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
+ mLT_(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x5e /* '^' */ ) && (true)) {
+ mBXOR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x7c /* '|' */ ) && (true)) {
+ mBOR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x26 /* '&' */ ) && (true)) {
+ mBAND(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR)
+ {
+ uponEOF();
+ _returnToken = makeToken(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE);
+ }
+ else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ if ( !_returnToken )
+ goto tryAgain; // found SKIP token
+
+ _ttype = _returnToken->getType();
+ _returnToken->setType(_ttype);
+ return _returnToken;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamIOException& csie) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamIOException(csie.io);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamException& cse) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamException(cse.getMessage());
+ }
+tryAgain:;
+ }
+}
+
+void JavaLexer::mQUESTION(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = QUESTION;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('?' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('(' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mRPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(')' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLBRACK(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LBRACK;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('[' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mRBRACK(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RBRACK;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(']' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLCURLY(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LCURLY;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('{' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mRCURLY(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RCURLY;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('}' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mCOLON(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COLON;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(':' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mCOMMA(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMA;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(',' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('=' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mEQUAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EQUAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("==");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLNOT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LNOT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('!' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBNOT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BNOT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('~' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mNOT_EQUAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NOT_EQUAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("!=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mDIV(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DIV;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('/' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mDIV_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DIV_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("/=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mPLUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PLUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('+' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mPLUS_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PLUS_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("+=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mINC(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = INC;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("++");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mMINUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MINUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('-' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mMINUS_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MINUS_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("-=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mDEC(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DEC;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("--");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSTAR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STAR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('*' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSTAR_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STAR_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("*=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mMOD(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MOD;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('%' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mMOD_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MOD_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("%=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">>");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSR_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SR_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">>=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBSR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BSR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">>>");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBSR_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BSR_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">>>=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mGE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mGT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<<");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSL_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SL_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<<=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLT_(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LT_;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('<' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBXOR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BXOR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('^' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBXOR_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BXOR_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("^=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBOR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BOR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('|' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBOR_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BOR_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("|=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLOR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LOR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("||");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBAND(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BAND;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('&' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mBAND_ASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = BAND_ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("&=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mLAND(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LAND;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("&&");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSEMI(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SEMI;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(';' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mWS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = WS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ { // ( ... )+
+ int _cnt245=0;
+ for (;;) {
+ switch ( LA(1)) {
+ case 0x20 /* ' ' */ :
+ {
+ match(' ' /* charlit */ );
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ {
+ match('\t' /* charlit */ );
+ break;
+ }
+ case 0xc /* '\14' */ :
+ {
+ match('\14' /* charlit */ );
+ break;
+ }
+ case 0xa /* '\n' */ :
+ case 0xd /* '\r' */ :
+ {
+ {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ ) && (true) && (true)) {
+ match("\r\n");
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && (true) && (true) && (true)) {
+ match('\r' /* charlit */ );
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+#line 1137 "java.g"
+ newline();
+#line 1109 "JavaLexer.cpp"
+ break;
+ }
+ default:
+ {
+ if ( _cnt245>=1 ) { goto _loop245; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ _cnt245++;
+ }
+ _loop245:;
+ } // ( ... )+
+#line 1139 "java.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 1123 "JavaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSL_COMMENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SL_COMMENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("//");
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_0.member(LA(1)))) {
+ {
+ match(_tokenSet_0);
+ }
+ }
+ else {
+ goto _loop249;
+ }
+
+ }
+ _loop249:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case 0xa /* '\n' */ :
+ {
+ match('\n' /* charlit */ );
+ break;
+ }
+ case 0xd /* '\r' */ :
+ {
+ match('\r' /* charlit */ );
+ {
+ if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1146 "java.g"
+
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+ newline();
+
+#line 1183 "JavaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mML_COMMENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = ML_COMMENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("/*");
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ ) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff)) && ((LA(4) >= 0x3 /* '\3' */ && LA(4) <= 0xff))) {
+ match('\r' /* charlit */ );
+ match('\n' /* charlit */ );
+#line 1167 "java.g"
+ newline();
+#line 1205 "JavaLexer.cpp"
+ }
+ else if (((LA(1) == 0x2a /* '*' */ ) && ((LA(2) >= 0x3 /* '\3' */ && LA(2) <= 0xff)) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff)))&&( LA(2)!='/' )) {
+ match('*' /* charlit */ );
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && ((LA(2) >= 0x3 /* '\3' */ && LA(2) <= 0xff)) && ((LA(3) >= 0x3 /* '\3' */ && LA(3) <= 0xff)) && (true)) {
+ match('\r' /* charlit */ );
+#line 1168 "java.g"
+ newline();
+#line 1214 "JavaLexer.cpp"
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+#line 1169 "java.g"
+ newline();
+#line 1220 "JavaLexer.cpp"
+ }
+ else if ((_tokenSet_1.member(LA(1)))) {
+ {
+ match(_tokenSet_1);
+ }
+ }
+ else {
+ goto _loop255;
+ }
+
+ }
+ _loop255:;
+ } // ( ... )*
+ match("*/");
+#line 1173 "java.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 1237 "JavaLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mCHAR_LITERAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = CHAR_LITERAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('\'' /* charlit */ );
+ {
+ if ((LA(1) == 0x5c /* '\\' */ )) {
+ mESC(false);
+ }
+ else if ((_tokenSet_2.member(LA(1)))) {
+ matchNot('\'' /* charlit */ );
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ match('\'' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mESC(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = ESC;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('\\' /* charlit */ );
+ {
+ switch ( LA(1)) {
+ case 0x6e /* 'n' */ :
+ {
+ match('n' /* charlit */ );
+ break;
+ }
+ case 0x72 /* 'r' */ :
+ {
+ match('r' /* charlit */ );
+ break;
+ }
+ case 0x74 /* 't' */ :
+ {
+ match('t' /* charlit */ );
+ break;
+ }
+ case 0x62 /* 'b' */ :
+ {
+ match('b' /* charlit */ );
+ break;
+ }
+ case 0x66 /* 'f' */ :
+ {
+ match('f' /* charlit */ );
+ break;
+ }
+ case 0x22 /* '\"' */ :
+ {
+ match('\"' /* charlit */ );
+ break;
+ }
+ case 0x27 /* '\'' */ :
+ {
+ match('\'' /* charlit */ );
+ break;
+ }
+ case 0x5c /* '\\' */ :
+ {
+ match('\\' /* charlit */ );
+ break;
+ }
+ case 0x75 /* 'u' */ :
+ {
+ { // ( ... )+
+ int _cnt265=0;
+ for (;;) {
+ if ((LA(1) == 0x75 /* 'u' */ )) {
+ match('u' /* charlit */ );
+ }
+ else {
+ if ( _cnt265>=1 ) { goto _loop265; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt265++;
+ }
+ _loop265:;
+ } // ( ... )+
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ {
+ matchRange('0','3');
+ {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x37 /* '7' */ )) && ((LA(2) >= 0x3 /* '\3' */ && LA(2) <= 0xff)) && (true) && (true)) {
+ matchRange('0','7');
+ {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x37 /* '7' */ )) && ((LA(2) >= 0x3 /* '\3' */ && LA(2) <= 0xff)) && (true) && (true)) {
+ matchRange('0','7');
+ }
+ else if (((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)) && (true) && (true) && (true)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ }
+ else if (((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)) && (true) && (true) && (true)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ break;
+ }
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ {
+ matchRange('4','7');
+ {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x37 /* '7' */ )) && ((LA(2) >= 0x3 /* '\3' */ && LA(2) <= 0xff)) && (true) && (true)) {
+ matchRange('0','7');
+ }
+ else if (((LA(1) >= 0x3 /* '\3' */ && LA(1) <= 0xff)) && (true) && (true) && (true)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mSTRING_LITERAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STRING_LITERAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('\"' /* charlit */ );
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0x5c /* '\\' */ )) {
+ mESC(false);
+ }
+ else if ((_tokenSet_3.member(LA(1)))) {
+ {
+ match(_tokenSet_3);
+ }
+ }
+ else {
+ goto _loop261;
+ }
+
+ }
+ _loop261:;
+ } // ( ... )*
+ match('\"' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mHEX_DIGIT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = HEX_DIGIT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ matchRange('0','9');
+ break;
+ }
+ case 0x41 /* 'A' */ :
+ case 0x42 /* 'B' */ :
+ case 0x43 /* 'C' */ :
+ case 0x44 /* 'D' */ :
+ case 0x45 /* 'E' */ :
+ case 0x46 /* 'F' */ :
+ {
+ matchRange('A','F');
+ break;
+ }
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ {
+ matchRange('a','f');
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mVOCAB(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = VOCAB;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ matchRange('\3',static_cast<unsigned char>('\377'));
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mIDENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = IDENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 0x41 /* 'A' */ :
+ case 0x42 /* 'B' */ :
+ case 0x43 /* 'C' */ :
+ case 0x44 /* 'D' */ :
+ case 0x45 /* 'E' */ :
+ case 0x46 /* 'F' */ :
+ case 0x47 /* 'G' */ :
+ case 0x48 /* 'H' */ :
+ case 0x49 /* 'I' */ :
+ case 0x4a /* 'J' */ :
+ case 0x4b /* 'K' */ :
+ case 0x4c /* 'L' */ :
+ case 0x4d /* 'M' */ :
+ case 0x4e /* 'N' */ :
+ case 0x4f /* 'O' */ :
+ case 0x50 /* 'P' */ :
+ case 0x51 /* 'Q' */ :
+ case 0x52 /* 'R' */ :
+ case 0x53 /* 'S' */ :
+ case 0x54 /* 'T' */ :
+ case 0x55 /* 'U' */ :
+ case 0x56 /* 'V' */ :
+ case 0x57 /* 'W' */ :
+ case 0x58 /* 'X' */ :
+ case 0x59 /* 'Y' */ :
+ case 0x5a /* 'Z' */ :
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case 0x5f /* '_' */ :
+ {
+ match('_' /* charlit */ );
+ break;
+ }
+ case 0x24 /* '$' */ :
+ {
+ match('$' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 0x41 /* 'A' */ :
+ case 0x42 /* 'B' */ :
+ case 0x43 /* 'C' */ :
+ case 0x44 /* 'D' */ :
+ case 0x45 /* 'E' */ :
+ case 0x46 /* 'F' */ :
+ case 0x47 /* 'G' */ :
+ case 0x48 /* 'H' */ :
+ case 0x49 /* 'I' */ :
+ case 0x4a /* 'J' */ :
+ case 0x4b /* 'K' */ :
+ case 0x4c /* 'L' */ :
+ case 0x4d /* 'M' */ :
+ case 0x4e /* 'N' */ :
+ case 0x4f /* 'O' */ :
+ case 0x50 /* 'P' */ :
+ case 0x51 /* 'Q' */ :
+ case 0x52 /* 'R' */ :
+ case 0x53 /* 'S' */ :
+ case 0x54 /* 'T' */ :
+ case 0x55 /* 'U' */ :
+ case 0x56 /* 'V' */ :
+ case 0x57 /* 'W' */ :
+ case 0x58 /* 'X' */ :
+ case 0x59 /* 'Y' */ :
+ case 0x5a /* 'Z' */ :
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case 0x5f /* '_' */ :
+ {
+ match('_' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ matchRange('0','9');
+ break;
+ }
+ case 0x24 /* '$' */ :
+ {
+ match('$' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ goto _loop275;
+ }
+ }
+ }
+ _loop275:;
+ } // ( ... )*
+ _ttype = testLiteralsTable(_ttype);
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mNUM_INT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NUM_INT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+ ANTLR_USE_NAMESPACE(antlr)RefToken f1;
+ ANTLR_USE_NAMESPACE(antlr)RefToken f2;
+ ANTLR_USE_NAMESPACE(antlr)RefToken f3;
+ ANTLR_USE_NAMESPACE(antlr)RefToken f4;
+#line 1251 "java.g"
+
+ bool isDecimal = false;
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+
+#line 1707 "JavaLexer.cpp"
+
+ switch ( LA(1)) {
+ case 0x2e /* '.' */ :
+ {
+ match('.' /* charlit */ );
+#line 1256 "java.g"
+ _ttype = DOT;
+#line 1715 "JavaLexer.cpp"
+ {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ { // ( ... )+
+ int _cnt279=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ if ( _cnt279>=1 ) { goto _loop279; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt279++;
+ }
+ _loop279:;
+ } // ( ... )+
+ {
+ if ((LA(1) == 0x45 /* 'E' */ || LA(1) == 0x65 /* 'e' */ )) {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ {
+ if ((LA(1) == 0x44 /* 'D' */ || LA(1) == 0x46 /* 'F' */ || LA(1) == 0x64 /* 'd' */ || LA(1) == 0x66 /* 'f' */ )) {
+ mFLOAT_SUFFIX(true);
+ f1=_returnToken;
+#line 1257 "java.g"
+ t=f1;
+#line 1746 "JavaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+#line 1258 "java.g"
+
+ if ( t &&
+ (t->getText().find('f') != ANTLR_USE_NAMESPACE(std)string::npos ||
+ t->getText().find('F') != ANTLR_USE_NAMESPACE(std)string::npos ) ) {
+ _ttype = NUM_FLOAT;
+ }
+ else {
+ _ttype = NUM_DOUBLE; // assume double
+ }
+
+#line 1763 "JavaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ {
+ switch ( LA(1)) {
+ case 0x30 /* '0' */ :
+ {
+ match('0' /* charlit */ );
+#line 1270 "java.g"
+ isDecimal = true;
+#line 1789 "JavaLexer.cpp"
+ {
+ switch ( LA(1)) {
+ case 0x58 /* 'X' */ :
+ case 0x78 /* 'x' */ :
+ {
+ {
+ switch ( LA(1)) {
+ case 0x78 /* 'x' */ :
+ {
+ match('x' /* charlit */ );
+ break;
+ }
+ case 0x58 /* 'X' */ :
+ {
+ match('X' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt286=0;
+ for (;;) {
+ if ((_tokenSet_4.member(LA(1))) && (true) && (true) && (true)) {
+ mHEX_DIGIT(false);
+ }
+ else {
+ if ( _cnt286>=1 ) { goto _loop286; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt286++;
+ }
+ _loop286:;
+ } // ( ... )+
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ {
+ { // ( ... )+
+ int _cnt288=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x37 /* '7' */ ))) {
+ matchRange('0','7');
+ }
+ else {
+ if ( _cnt288>=1 ) { goto _loop288; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt288++;
+ }
+ _loop288:;
+ } // ( ... )+
+ break;
+ }
+ default:
+ {
+ }
+ }
+ }
+ break;
+ }
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ {
+ matchRange('1','9');
+ }
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ goto _loop291;
+ }
+
+ }
+ _loop291:;
+ } // ( ... )*
+#line 1285 "java.g"
+ isDecimal=true;
+#line 1888 "JavaLexer.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ if ((LA(1) == 0x4c /* 'L' */ || LA(1) == 0x6c /* 'l' */ )) {
+ {
+ switch ( LA(1)) {
+ case 0x6c /* 'l' */ :
+ {
+ match('l' /* charlit */ );
+ break;
+ }
+ case 0x4c /* 'L' */ :
+ {
+ match('L' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1287 "java.g"
+ _ttype = NUM_LONG;
+#line 1919 "JavaLexer.cpp"
+ }
+ else if (((LA(1) == 0x2e /* '.' */ || LA(1) == 0x44 /* 'D' */ || LA(1) == 0x45 /* 'E' */ || LA(1) == 0x46 /* 'F' */ || LA(1) == 0x64 /* 'd' */ || LA(1) == 0x65 /* 'e' */ || LA(1) == 0x66 /* 'f' */ ))&&(isDecimal)) {
+ {
+ switch ( LA(1)) {
+ case 0x2e /* '.' */ :
+ {
+ match('.' /* charlit */ );
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ goto _loop296;
+ }
+
+ }
+ _loop296:;
+ } // ( ... )*
+ {
+ if ((LA(1) == 0x45 /* 'E' */ || LA(1) == 0x65 /* 'e' */ )) {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ {
+ if ((LA(1) == 0x44 /* 'D' */ || LA(1) == 0x46 /* 'F' */ || LA(1) == 0x64 /* 'd' */ || LA(1) == 0x66 /* 'f' */ )) {
+ mFLOAT_SUFFIX(true);
+ f2=_returnToken;
+#line 1291 "java.g"
+ t=f2;
+#line 1953 "JavaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ case 0x45 /* 'E' */ :
+ case 0x65 /* 'e' */ :
+ {
+ mEXPONENT(false);
+ {
+ if ((LA(1) == 0x44 /* 'D' */ || LA(1) == 0x46 /* 'F' */ || LA(1) == 0x64 /* 'd' */ || LA(1) == 0x66 /* 'f' */ )) {
+ mFLOAT_SUFFIX(true);
+ f3=_returnToken;
+#line 1292 "java.g"
+ t=f3;
+#line 1971 "JavaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ case 0x44 /* 'D' */ :
+ case 0x46 /* 'F' */ :
+ case 0x64 /* 'd' */ :
+ case 0x66 /* 'f' */ :
+ {
+ mFLOAT_SUFFIX(true);
+ f4=_returnToken;
+#line 1293 "java.g"
+ t=f4;
+#line 1988 "JavaLexer.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1295 "java.g"
+
+ if ( t &&
+ (t->getText().find('f') != ANTLR_USE_NAMESPACE(std)string::npos ||
+ t->getText().find('F') != ANTLR_USE_NAMESPACE(std)string::npos ) ) {
+ _ttype = NUM_FLOAT;
+ }
+ else {
+ _ttype = NUM_DOUBLE; // assume double
+ }
+
+#line 2008 "JavaLexer.cpp"
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mEXPONENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EXPONENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x65 /* 'e' */ :
+ {
+ match('e' /* charlit */ );
+ break;
+ }
+ case 0x45 /* 'E' */ :
+ {
+ match('E' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case 0x2b /* '+' */ :
+ {
+ match('+' /* charlit */ );
+ break;
+ }
+ case 0x2d /* '-' */ :
+ {
+ match('-' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt304=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ if ( _cnt304>=1 ) { goto _loop304; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt304++;
+ }
+ _loop304:;
+ } // ( ... )+
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void JavaLexer::mFLOAT_SUFFIX(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = FLOAT_SUFFIX;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ switch ( LA(1)) {
+ case 0x66 /* 'f' */ :
+ {
+ match('f' /* charlit */ );
+ break;
+ }
+ case 0x46 /* 'F' */ :
+ {
+ match('F' /* charlit */ );
+ break;
+ }
+ case 0x64 /* 'd' */ :
+ {
+ match('d' /* charlit */ );
+ break;
+ }
+ case 0x44 /* 'D' */ :
+ {
+ match('D' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+
+const unsigned long JavaLexer::_tokenSet_0_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
+// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! \" # $ %
+// & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G
+// H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h
+// i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83
+// 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91
+// 0x92 0x93 0x94 0x95 0x96 0x97
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaLexer::_tokenSet_0(_tokenSet_0_data_,16);
+const unsigned long JavaLexer::_tokenSet_1_data_[] = { 4294958072UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12 0x13 0x14
+// 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! \" # $ %
+// & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H
+// I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d e f g h i
+// j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 0x84
+// 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92
+// 0x93 0x94 0x95 0x96 0x97
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaLexer::_tokenSet_1(_tokenSet_1_data_,16);
+const unsigned long JavaLexer::_tokenSet_2_data_[] = { 4294967288UL, 4294967167UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
+// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! \" #
+// $ % & ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
+// G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i
+// j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 0x84
+// 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92
+// 0x93 0x94 0x95 0x96 0x97
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaLexer::_tokenSet_2(_tokenSet_2_data_,16);
+const unsigned long JavaLexer::_tokenSet_3_data_[] = { 4294967288UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13
+// 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f ! # $
+// % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F
+// G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i
+// j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82 0x83 0x84
+// 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92
+// 0x93 0x94 0x95 0x96 0x97
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaLexer::_tokenSet_3(_tokenSet_3_data_,16);
+const unsigned long JavaLexer::_tokenSet_4_data_[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaLexer::_tokenSet_4(_tokenSet_4_data_,10);
+
diff --git a/languages/java/JavaLexer.hpp b/languages/java/JavaLexer.hpp
new file mode 100644
index 00000000..a46022cd
--- /dev/null
+++ b/languages/java/JavaLexer.hpp
@@ -0,0 +1,132 @@
+#ifndef INC_JavaLexer_hpp_
+#define INC_JavaLexer_hpp_
+
+#line 2 "java.g"
+
+ #include "driver.h"
+ #include "JavaAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefJavaAST(ast)->setLine( t->getLine() );\
+ RefJavaAST(ast)->setColumn( t->getColumn() ); \
+ }
+
+#line 19 "JavaLexer.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaLexer.hpp"$ */
+#include <antlr/CommonToken.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/BitSet.hpp>
+#include "JavaTokenTypes.hpp"
+#include <antlr/CharScanner.hpp>
+class CUSTOM_API JavaLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public JavaTokenTypes
+{
+#line 1058 "java.g"
+
+private:
+ Driver* m_driver;
+
+public:
+ void setDriver( Driver* d ) { m_driver = d; }
+ void setFileName( const QString& fileName ) { m_driver->currentFileName() = fileName; }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) );
+ }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(errorMessage.c_str()), getLine(), getColumn()) );
+ }
+
+ virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(warnMessage.c_str()), getLine(), getColumn()) );
+ }
+#line 30 "JavaLexer.hpp"
+private:
+ void initLiterals();
+public:
+ bool getCaseSensitiveLiterals() const
+ {
+ return true;
+ }
+public:
+ JavaLexer(ANTLR_USE_NAMESPACE(std)istream& in);
+ JavaLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib);
+ JavaLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state);
+ ANTLR_USE_NAMESPACE(antlr)RefToken nextToken();
+ public: void mQUESTION(bool _createToken);
+ public: void mLPAREN(bool _createToken);
+ public: void mRPAREN(bool _createToken);
+ public: void mLBRACK(bool _createToken);
+ public: void mRBRACK(bool _createToken);
+ public: void mLCURLY(bool _createToken);
+ public: void mRCURLY(bool _createToken);
+ public: void mCOLON(bool _createToken);
+ public: void mCOMMA(bool _createToken);
+ public: void mASSIGN(bool _createToken);
+ public: void mEQUAL(bool _createToken);
+ public: void mLNOT(bool _createToken);
+ public: void mBNOT(bool _createToken);
+ public: void mNOT_EQUAL(bool _createToken);
+ public: void mDIV(bool _createToken);
+ public: void mDIV_ASSIGN(bool _createToken);
+ public: void mPLUS(bool _createToken);
+ public: void mPLUS_ASSIGN(bool _createToken);
+ public: void mINC(bool _createToken);
+ public: void mMINUS(bool _createToken);
+ public: void mMINUS_ASSIGN(bool _createToken);
+ public: void mDEC(bool _createToken);
+ public: void mSTAR(bool _createToken);
+ public: void mSTAR_ASSIGN(bool _createToken);
+ public: void mMOD(bool _createToken);
+ public: void mMOD_ASSIGN(bool _createToken);
+ public: void mSR(bool _createToken);
+ public: void mSR_ASSIGN(bool _createToken);
+ public: void mBSR(bool _createToken);
+ public: void mBSR_ASSIGN(bool _createToken);
+ public: void mGE(bool _createToken);
+ public: void mGT(bool _createToken);
+ public: void mSL(bool _createToken);
+ public: void mSL_ASSIGN(bool _createToken);
+ public: void mLE(bool _createToken);
+ public: void mLT_(bool _createToken);
+ public: void mBXOR(bool _createToken);
+ public: void mBXOR_ASSIGN(bool _createToken);
+ public: void mBOR(bool _createToken);
+ public: void mBOR_ASSIGN(bool _createToken);
+ public: void mLOR(bool _createToken);
+ public: void mBAND(bool _createToken);
+ public: void mBAND_ASSIGN(bool _createToken);
+ public: void mLAND(bool _createToken);
+ public: void mSEMI(bool _createToken);
+ public: void mWS(bool _createToken);
+ public: void mSL_COMMENT(bool _createToken);
+ public: void mML_COMMENT(bool _createToken);
+ public: void mCHAR_LITERAL(bool _createToken);
+ protected: void mESC(bool _createToken);
+ public: void mSTRING_LITERAL(bool _createToken);
+ protected: void mHEX_DIGIT(bool _createToken);
+ protected: void mVOCAB(bool _createToken);
+ public: void mIDENT(bool _createToken);
+ public: void mNUM_INT(bool _createToken);
+ protected: void mEXPONENT(bool _createToken);
+ protected: void mFLOAT_SUFFIX(bool _createToken);
+private:
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+};
+
+#endif /*INC_JavaLexer_hpp_*/
diff --git a/languages/java/JavaRecognizer.cpp b/languages/java/JavaRecognizer.cpp
new file mode 100644
index 00000000..1021c6a0
--- /dev/null
+++ b/languages/java/JavaRecognizer.cpp
@@ -0,0 +1,6540 @@
+/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaRecognizer.cpp"$ */
+#include "JavaRecognizer.hpp"
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/ASTFactory.hpp>
+#line 1 "java.g"
+#line 8 "JavaRecognizer.cpp"
+JavaRecognizer::JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,k)
+{
+}
+
+JavaRecognizer::JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,2)
+{
+}
+
+JavaRecognizer::JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,k)
+{
+}
+
+JavaRecognizer::JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,2)
+{
+}
+
+JavaRecognizer::JavaRecognizer(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(state,2)
+{
+}
+
+void JavaRecognizer::compilationUnit() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST compilationUnit_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_package:
+ {
+ packageDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE:
+ case FINAL:
+ case ABSTRACT:
+ case STRICTFP:
+ case SEMI:
+ case LITERAL_import:
+ case LITERAL_private:
+ case LITERAL_public:
+ case LITERAL_protected:
+ case LITERAL_static:
+ case LITERAL_transient:
+ case LITERAL_native:
+ case LITERAL_threadsafe:
+ case LITERAL_synchronized:
+ case LITERAL_volatile:
+ case LITERAL_class:
+ case LITERAL_interface:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LITERAL_import)) {
+ importDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop4;
+ }
+
+ }
+ _loop4:;
+ } // ( ... )*
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_0.member(LA(1)))) {
+ typeDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop6;
+ }
+
+ }
+ _loop6:;
+ } // ( ... )*
+ match(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE);
+ compilationUnit_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_1);
+ } else {
+ throw;
+ }
+ }
+ returnAST = compilationUnit_AST;
+}
+
+void JavaRecognizer::packageDefinition() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST packageDefinition_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken p = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST p_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ p = LT(1);
+ if ( inputState->guessing == 0 ) {
+ p_AST = astFactory->create(p);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(p_AST));
+ }
+ match(LITERAL_package);
+ if ( inputState->guessing==0 ) {
+#line 196 "java.g"
+ p_AST->setType(PACKAGE_DEF);
+#line 137 "JavaRecognizer.cpp"
+ }
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ packageDefinition_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ } else {
+ throw;
+ }
+ }
+ returnAST = packageDefinition_AST;
+}
+
+void JavaRecognizer::importDefinition() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST importDefinition_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken i = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST i_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ i = LT(1);
+ if ( inputState->guessing == 0 ) {
+ i_AST = astFactory->create(i);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(i_AST));
+ }
+ match(LITERAL_import);
+ if ( inputState->guessing==0 ) {
+#line 202 "java.g"
+ i_AST->setType(IMPORT);
+#line 174 "JavaRecognizer.cpp"
+ }
+ identifierStar();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ importDefinition_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ } else {
+ throw;
+ }
+ }
+ returnAST = importDefinition_AST;
+}
+
+void JavaRecognizer::typeDefinition() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST typeDefinition_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST m_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case FINAL:
+ case ABSTRACT:
+ case STRICTFP:
+ case LITERAL_private:
+ case LITERAL_public:
+ case LITERAL_protected:
+ case LITERAL_static:
+ case LITERAL_transient:
+ case LITERAL_native:
+ case LITERAL_threadsafe:
+ case LITERAL_synchronized:
+ case LITERAL_volatile:
+ case LITERAL_class:
+ case LITERAL_interface:
+ {
+ modifiers();
+ if (inputState->guessing==0) {
+ m_AST = returnAST;
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_class:
+ {
+ classDefinition(m_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LITERAL_interface:
+ {
+ interfaceDefinition(m_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ typeDefinition_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ typeDefinition_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_3);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typeDefinition_AST;
+}
+
+void JavaRecognizer::identifier() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST identifier_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp5_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp5_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp5_AST));
+ }
+ match(IDENT);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == DOT)) {
+ RefJavaAST tmp6_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp6_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp6_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp7_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp7_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp7_AST));
+ }
+ match(IDENT);
+ }
+ else {
+ goto _loop23;
+ }
+
+ }
+ _loop23:;
+ } // ( ... )*
+ identifier_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_4);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifier_AST;
+}
+
+void JavaRecognizer::identifierStar() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST identifierStar_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp8_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp8_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp8_AST));
+ }
+ match(IDENT);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == DOT) && (LA(2) == IDENT)) {
+ RefJavaAST tmp9_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp9_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp10_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp10_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp10_AST));
+ }
+ match(IDENT);
+ }
+ else {
+ goto _loop26;
+ }
+
+ }
+ _loop26:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ RefJavaAST tmp11_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp11_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp11_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp12_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp12_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp12_AST));
+ }
+ match(STAR);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ identifierStar_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifierStar_AST;
+}
+
+void JavaRecognizer::modifiers() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST modifiers_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_6.member(LA(1)))) {
+ modifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop30;
+ }
+
+ }
+ _loop30:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ modifiers_AST = RefJavaAST(currentAST.root);
+#line 290 "java.g"
+ modifiers_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(modifiers_AST))));
+#line 420 "JavaRecognizer.cpp"
+ currentAST.root = modifiers_AST;
+ if ( modifiers_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ modifiers_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = modifiers_AST->getFirstChild();
+ else
+ currentAST.child = modifiers_AST;
+ currentAST.advanceChildToEnd();
+ }
+ modifiers_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ } else {
+ throw;
+ }
+ }
+ returnAST = modifiers_AST;
+}
+
+void JavaRecognizer::classDefinition(
+ RefJavaAST modifiers
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST classDefinition_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST sc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST ic_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST cb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LITERAL_class);
+ RefJavaAST tmp14_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp14_AST = astFactory->create(LT(1));
+ }
+ match(IDENT);
+ superClassClause();
+ if (inputState->guessing==0) {
+ sc_AST = returnAST;
+ }
+ implementsClause();
+ if (inputState->guessing==0) {
+ ic_AST = returnAST;
+ }
+ classBlock();
+ if (inputState->guessing==0) {
+ cb_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ classDefinition_AST = RefJavaAST(currentAST.root);
+#line 319 "java.g"
+ classDefinition_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(6))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CLASS_DEF,"CLASS_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(modifiers))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(tmp14_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(sc_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(ic_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(cb_AST))));
+#line 475 "JavaRecognizer.cpp"
+ currentAST.root = classDefinition_AST;
+ if ( classDefinition_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ classDefinition_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = classDefinition_AST->getFirstChild();
+ else
+ currentAST.child = classDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_8);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classDefinition_AST;
+}
+
+void JavaRecognizer::interfaceDefinition(
+ RefJavaAST modifiers
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST interfaceDefinition_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST ie_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST cb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LITERAL_interface);
+ RefJavaAST tmp16_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp16_AST = astFactory->create(LT(1));
+ }
+ match(IDENT);
+ interfaceExtends();
+ if (inputState->guessing==0) {
+ ie_AST = returnAST;
+ }
+ classBlock();
+ if (inputState->guessing==0) {
+ cb_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ interfaceDefinition_AST = RefJavaAST(currentAST.root);
+#line 335 "java.g"
+ interfaceDefinition_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(5))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(INTERFACE_DEF,"INTERFACE_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(modifiers))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(tmp16_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(ie_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(cb_AST))));
+#line 524 "JavaRecognizer.cpp"
+ currentAST.root = interfaceDefinition_AST;
+ if ( interfaceDefinition_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ interfaceDefinition_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = interfaceDefinition_AST->getFirstChild();
+ else
+ currentAST.child = interfaceDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_9);
+ } else {
+ throw;
+ }
+ }
+ returnAST = interfaceDefinition_AST;
+}
+
+/** A declaration is the creation of a reference or primitive-type variable
+ * Create a separate Type/Var tree for each var in the var list.
+ */
+void JavaRecognizer::declaration() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST declaration_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST m_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST t_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST v_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ modifiers();
+ if (inputState->guessing==0) {
+ m_AST = returnAST;
+ }
+ typeSpec(false);
+ if (inputState->guessing==0) {
+ t_AST = returnAST;
+ }
+ variableDefinitions(m_AST,t_AST);
+ if (inputState->guessing==0) {
+ v_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ declaration_AST = RefJavaAST(currentAST.root);
+#line 220 "java.g"
+ declaration_AST = v_AST;
+#line 573 "JavaRecognizer.cpp"
+ currentAST.root = declaration_AST;
+ if ( declaration_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ declaration_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = declaration_AST->getFirstChild();
+ else
+ currentAST.child = declaration_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = declaration_AST;
+}
+
+void JavaRecognizer::typeSpec(
+ bool addImagNode
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST typeSpec_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ classTypeSpec(addImagNode);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typeSpec_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ {
+ builtInTypeSpec(addImagNode);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typeSpec_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typeSpec_AST;
+}
+
+void JavaRecognizer::variableDefinitions(
+ RefJavaAST mods, RefJavaAST t
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST variableDefinitions_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ variableDeclarator((RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)mods),
+ (RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)t));
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ variableDeclarator((RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)mods),
+ (RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)t));
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop59;
+ }
+
+ }
+ _loop59:;
+ } // ( ... )*
+ variableDefinitions_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variableDefinitions_AST;
+}
+
+void JavaRecognizer::classTypeSpec(
+ bool addImagNode
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST classTypeSpec_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LBRACK)) {
+ lb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lb_AST = astFactory->create(lb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lb_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 233 "java.g"
+ lb_AST->setType(ARRAY_DECLARATOR);
+#line 715 "JavaRecognizer.cpp"
+ }
+ match(RBRACK);
+ }
+ else {
+ goto _loop15;
+ }
+
+ }
+ _loop15:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ classTypeSpec_AST = RefJavaAST(currentAST.root);
+#line 234 "java.g"
+
+ if ( addImagNode ) {
+ classTypeSpec_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TYPE,"TYPE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(classTypeSpec_AST))));
+ }
+
+#line 734 "JavaRecognizer.cpp"
+ currentAST.root = classTypeSpec_AST;
+ if ( classTypeSpec_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ classTypeSpec_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = classTypeSpec_AST->getFirstChild();
+ else
+ currentAST.child = classTypeSpec_AST;
+ currentAST.advanceChildToEnd();
+ }
+ classTypeSpec_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classTypeSpec_AST;
+}
+
+void JavaRecognizer::builtInTypeSpec(
+ bool addImagNode
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST builtInTypeSpec_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ builtInType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LBRACK)) {
+ lb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lb_AST = astFactory->create(lb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lb_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 244 "java.g"
+ lb_AST->setType(ARRAY_DECLARATOR);
+#line 782 "JavaRecognizer.cpp"
+ }
+ match(RBRACK);
+ }
+ else {
+ goto _loop18;
+ }
+
+ }
+ _loop18:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ builtInTypeSpec_AST = RefJavaAST(currentAST.root);
+#line 245 "java.g"
+
+ if ( addImagNode ) {
+ builtInTypeSpec_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TYPE,"TYPE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(builtInTypeSpec_AST))));
+ }
+
+#line 801 "JavaRecognizer.cpp"
+ currentAST.root = builtInTypeSpec_AST;
+ if ( builtInTypeSpec_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ builtInTypeSpec_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = builtInTypeSpec_AST->getFirstChild();
+ else
+ currentAST.child = builtInTypeSpec_AST;
+ currentAST.advanceChildToEnd();
+ }
+ builtInTypeSpec_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ } else {
+ throw;
+ }
+ }
+ returnAST = builtInTypeSpec_AST;
+}
+
+void JavaRecognizer::builtInType() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST builtInType_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LITERAL_void:
+ {
+ RefJavaAST tmp20_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp20_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST));
+ }
+ match(LITERAL_void);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_boolean:
+ {
+ RefJavaAST tmp21_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp21_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp21_AST));
+ }
+ match(LITERAL_boolean);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_byte:
+ {
+ RefJavaAST tmp22_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp22_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST));
+ }
+ match(LITERAL_byte);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_char:
+ {
+ RefJavaAST tmp23_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp23_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST));
+ }
+ match(LITERAL_char);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_short:
+ {
+ RefJavaAST tmp24_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp24_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST));
+ }
+ match(LITERAL_short);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_int:
+ {
+ RefJavaAST tmp25_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp25_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp25_AST));
+ }
+ match(LITERAL_int);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_float:
+ {
+ RefJavaAST tmp26_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp26_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST));
+ }
+ match(LITERAL_float);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_long:
+ {
+ RefJavaAST tmp27_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp27_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp27_AST));
+ }
+ match(LITERAL_long);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_double:
+ {
+ RefJavaAST tmp28_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp28_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST));
+ }
+ match(LITERAL_double);
+ builtInType_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_11);
+ } else {
+ throw;
+ }
+ }
+ returnAST = builtInType_AST;
+}
+
+void JavaRecognizer::type() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST type_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ {
+ builtInType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ } else {
+ throw;
+ }
+ }
+ returnAST = type_AST;
+}
+
+void JavaRecognizer::modifier() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST modifier_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LITERAL_private:
+ {
+ RefJavaAST tmp29_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp29_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp29_AST));
+ }
+ match(LITERAL_private);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_public:
+ {
+ RefJavaAST tmp30_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp30_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp30_AST));
+ }
+ match(LITERAL_public);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_protected:
+ {
+ RefJavaAST tmp31_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp31_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp31_AST));
+ }
+ match(LITERAL_protected);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_static:
+ {
+ RefJavaAST tmp32_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp32_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp32_AST));
+ }
+ match(LITERAL_static);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_transient:
+ {
+ RefJavaAST tmp33_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp33_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp33_AST));
+ }
+ match(LITERAL_transient);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case FINAL:
+ {
+ RefJavaAST tmp34_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp34_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp34_AST));
+ }
+ match(FINAL);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case ABSTRACT:
+ {
+ RefJavaAST tmp35_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp35_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp35_AST));
+ }
+ match(ABSTRACT);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_native:
+ {
+ RefJavaAST tmp36_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp36_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp36_AST));
+ }
+ match(LITERAL_native);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_threadsafe:
+ {
+ RefJavaAST tmp37_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp37_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp37_AST));
+ }
+ match(LITERAL_threadsafe);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_synchronized:
+ {
+ RefJavaAST tmp38_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp38_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp38_AST));
+ }
+ match(LITERAL_synchronized);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_volatile:
+ {
+ RefJavaAST tmp39_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp39_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp39_AST));
+ }
+ match(LITERAL_volatile);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case STRICTFP:
+ {
+ RefJavaAST tmp40_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp40_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp40_AST));
+ }
+ match(STRICTFP);
+ modifier_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_13);
+ } else {
+ throw;
+ }
+ }
+ returnAST = modifier_AST;
+}
+
+void JavaRecognizer::superClassClause() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST superClassClause_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST id_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ {
+ match(LITERAL_extends);
+ identifier();
+ if (inputState->guessing==0) {
+ id_AST = returnAST;
+ }
+ break;
+ }
+ case LCURLY:
+ case LITERAL_implements:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ superClassClause_AST = RefJavaAST(currentAST.root);
+#line 325 "java.g"
+ superClassClause_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_AST))));
+#line 1185 "JavaRecognizer.cpp"
+ currentAST.root = superClassClause_AST;
+ if ( superClassClause_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ superClassClause_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = superClassClause_AST->getFirstChild();
+ else
+ currentAST.child = superClassClause_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_14);
+ } else {
+ throw;
+ }
+ }
+ returnAST = superClassClause_AST;
+}
+
+void JavaRecognizer::implementsClause() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST implementsClause_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken i = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST i_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_implements:
+ {
+ i = LT(1);
+ if ( inputState->guessing == 0 ) {
+ i_AST = astFactory->create(i);
+ }
+ match(LITERAL_implements);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop46;
+ }
+
+ }
+ _loop46:;
+ } // ( ... )*
+ break;
+ }
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ implementsClause_AST = RefJavaAST(currentAST.root);
+#line 363 "java.g"
+ implementsClause_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(implementsClause_AST))));
+#line 1259 "JavaRecognizer.cpp"
+ currentAST.root = implementsClause_AST;
+ if ( implementsClause_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ implementsClause_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = implementsClause_AST->getFirstChild();
+ else
+ currentAST.child = implementsClause_AST;
+ currentAST.advanceChildToEnd();
+ }
+ implementsClause_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_15);
+ } else {
+ throw;
+ }
+ }
+ returnAST = implementsClause_AST;
+}
+
+void JavaRecognizer::classBlock() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST classBlock_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LCURLY);
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case FINAL:
+ case ABSTRACT:
+ case STRICTFP:
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LITERAL_private:
+ case LITERAL_public:
+ case LITERAL_protected:
+ case LITERAL_static:
+ case LITERAL_transient:
+ case LITERAL_native:
+ case LITERAL_threadsafe:
+ case LITERAL_synchronized:
+ case LITERAL_volatile:
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LCURLY:
+ {
+ field();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ goto _loop38;
+ }
+ }
+ }
+ _loop38:;
+ } // ( ... )*
+ match(RCURLY);
+ if ( inputState->guessing==0 ) {
+ classBlock_AST = RefJavaAST(currentAST.root);
+#line 345 "java.g"
+ classBlock_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(OBJBLOCK,"OBJBLOCK")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(classBlock_AST))));
+#line 1341 "JavaRecognizer.cpp"
+ currentAST.root = classBlock_AST;
+ if ( classBlock_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ classBlock_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = classBlock_AST->getFirstChild();
+ else
+ currentAST.child = classBlock_AST;
+ currentAST.advanceChildToEnd();
+ }
+ classBlock_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classBlock_AST;
+}
+
+void JavaRecognizer::interfaceExtends() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST interfaceExtends_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken e = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST e_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_extends:
+ {
+ e = LT(1);
+ if ( inputState->guessing == 0 ) {
+ e_AST = astFactory->create(e);
+ }
+ match(LITERAL_extends);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop42;
+ }
+
+ }
+ _loop42:;
+ } // ( ... )*
+ break;
+ }
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ interfaceExtends_AST = RefJavaAST(currentAST.root);
+#line 354 "java.g"
+ interfaceExtends_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(interfaceExtends_AST))));
+#line 1416 "JavaRecognizer.cpp"
+ currentAST.root = interfaceExtends_AST;
+ if ( interfaceExtends_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ interfaceExtends_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = interfaceExtends_AST->getFirstChild();
+ else
+ currentAST.child = interfaceExtends_AST;
+ currentAST.advanceChildToEnd();
+ }
+ interfaceExtends_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_15);
+ } else {
+ throw;
+ }
+ }
+ returnAST = interfaceExtends_AST;
+}
+
+void JavaRecognizer::field() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST field_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST mods_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST h_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST s_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST cd_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST id_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST t_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST param_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST rt_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST tc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST s2_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST v_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST s3_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST s4_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if ((_tokenSet_13.member(LA(1))) && (_tokenSet_17.member(LA(2)))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ mods_AST = returnAST;
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_class:
+ {
+ classDefinition(mods_AST);
+ if (inputState->guessing==0) {
+ cd_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 378 "java.g"
+ field_AST = cd_AST;
+#line 1474 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ case LITERAL_interface:
+ {
+ interfaceDefinition(mods_AST);
+ if (inputState->guessing==0) {
+ id_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 381 "java.g"
+ field_AST = id_AST;
+#line 1495 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ default:
+ if ((LA(1) == IDENT) && (LA(2) == LPAREN)) {
+ ctorHead();
+ if (inputState->guessing==0) {
+ h_AST = returnAST;
+ }
+ constructorBody();
+ if (inputState->guessing==0) {
+ s_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 375 "java.g"
+ field_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(4))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CTOR_DEF,"CTOR_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mods_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(h_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST))));
+#line 1520 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else if (((LA(1) >= LITERAL_void && LA(1) <= IDENT)) && (_tokenSet_18.member(LA(2)))) {
+ typeSpec(false);
+ if (inputState->guessing==0) {
+ t_AST = returnAST;
+ }
+ {
+ if ((LA(1) == IDENT) && (LA(2) == LPAREN)) {
+ RefJavaAST tmp47_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp47_AST = astFactory->create(LT(1));
+ }
+ match(IDENT);
+ match(LPAREN);
+ parameterDeclarationList();
+ if (inputState->guessing==0) {
+ param_AST = returnAST;
+ }
+ match(RPAREN);
+ declaratorBrackets(t_AST);
+ if (inputState->guessing==0) {
+ rt_AST = returnAST;
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_throws:
+ {
+ throwsClause();
+ if (inputState->guessing==0) {
+ tc_AST = returnAST;
+ }
+ break;
+ }
+ case SEMI:
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case LCURLY:
+ {
+ compoundStatement();
+ if (inputState->guessing==0) {
+ s2_AST = returnAST;
+ }
+ break;
+ }
+ case SEMI:
+ {
+ RefJavaAST tmp50_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp50_AST = astFactory->create(LT(1));
+ }
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 396 "java.g"
+ field_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(7))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(METHOD_DEF,"METHOD_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mods_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TYPE,"TYPE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(rt_AST))))))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(tmp47_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(param_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(tc_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s2_AST))));
+#line 1602 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else if ((LA(1) == IDENT) && (_tokenSet_19.member(LA(2)))) {
+ variableDefinitions(mods_AST,t_AST);
+ if (inputState->guessing==0) {
+ v_AST = returnAST;
+ }
+ RefJavaAST tmp51_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp51_AST = astFactory->create(LT(1));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 405 "java.g"
+ field_AST = v_AST;
+#line 1626 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else if ((LA(1) == LITERAL_static) && (LA(2) == LCURLY)) {
+ match(LITERAL_static);
+ compoundStatement();
+ if (inputState->guessing==0) {
+ s3_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 411 "java.g"
+ field_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(STATIC_INIT,"STATIC_INIT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s3_AST))));
+#line 1658 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else if ((LA(1) == LCURLY)) {
+ compoundStatement();
+ if (inputState->guessing==0) {
+ s4_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ field_AST = RefJavaAST(currentAST.root);
+#line 415 "java.g"
+ field_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(INSTANCE_INIT,"INSTANCE_INIT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s4_AST))));
+#line 1677 "JavaRecognizer.cpp"
+ currentAST.root = field_AST;
+ if ( field_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ field_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = field_AST->getFirstChild();
+ else
+ currentAST.child = field_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ } else {
+ throw;
+ }
+ }
+ returnAST = field_AST;
+}
+
+void JavaRecognizer::ctorHead() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST ctorHead_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp53_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp53_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp53_AST));
+ }
+ match(IDENT);
+ match(LPAREN);
+ parameterDeclarationList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ {
+ switch ( LA(1)) {
+ case LITERAL_throws:
+ {
+ throwsClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ ctorHead_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_15);
+ } else {
+ throw;
+ }
+ }
+ returnAST = ctorHead_AST;
+}
+
+void JavaRecognizer::constructorBody() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST constructorBody_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lc = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ lc = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lc_AST = astFactory->create(lc);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lc_AST));
+ }
+ match(LCURLY);
+ if ( inputState->guessing==0 ) {
+#line 419 "java.g"
+ lc_AST->setType(SLIST);
+#line 1771 "JavaRecognizer.cpp"
+ }
+ {
+ if ((LA(1) == LITERAL_this || LA(1) == LITERAL_super) && (LA(2) == LPAREN)) {
+ explicitConstructorInvocation();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_23.member(LA(1)))) {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop55;
+ }
+
+ }
+ _loop55:;
+ } // ( ... )*
+ match(RCURLY);
+ constructorBody_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constructorBody_AST;
+}
+
+void JavaRecognizer::parameterDeclarationList() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST parameterDeclarationList_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case FINAL:
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ {
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop80;
+ }
+
+ }
+ _loop80:;
+ } // ( ... )*
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ parameterDeclarationList_AST = RefJavaAST(currentAST.root);
+#line 508 "java.g"
+ parameterDeclarationList_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETERS,"PARAMETERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(parameterDeclarationList_AST))));
+#line 1872 "JavaRecognizer.cpp"
+ currentAST.root = parameterDeclarationList_AST;
+ if ( parameterDeclarationList_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ parameterDeclarationList_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = parameterDeclarationList_AST->getFirstChild();
+ else
+ currentAST.child = parameterDeclarationList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameterDeclarationList_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ } else {
+ throw;
+ }
+ }
+ returnAST = parameterDeclarationList_AST;
+}
+
+void JavaRecognizer::declaratorBrackets(
+ RefJavaAST typ
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST declaratorBrackets_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if ( inputState->guessing==0 ) {
+ declaratorBrackets_AST = RefJavaAST(currentAST.root);
+#line 452 "java.g"
+ declaratorBrackets_AST=typ;
+#line 1908 "JavaRecognizer.cpp"
+ currentAST.root = declaratorBrackets_AST;
+ if ( declaratorBrackets_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ declaratorBrackets_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = declaratorBrackets_AST->getFirstChild();
+ else
+ currentAST.child = declaratorBrackets_AST;
+ currentAST.advanceChildToEnd();
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LBRACK)) {
+ lb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lb_AST = astFactory->create(lb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lb_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 453 "java.g"
+ lb_AST->setType(ARRAY_DECLARATOR);
+#line 1929 "JavaRecognizer.cpp"
+ }
+ match(RBRACK);
+ }
+ else {
+ goto _loop63;
+ }
+
+ }
+ _loop63:;
+ } // ( ... )*
+ declaratorBrackets_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_25);
+ } else {
+ throw;
+ }
+ }
+ returnAST = declaratorBrackets_AST;
+}
+
+void JavaRecognizer::throwsClause() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST throwsClause_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp59_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp59_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp59_AST));
+ }
+ match(LITERAL_throws);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop76;
+ }
+
+ }
+ _loop76:;
+ } // ( ... )*
+ throwsClause_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_26);
+ } else {
+ throw;
+ }
+ }
+ returnAST = throwsClause_AST;
+}
+
+void JavaRecognizer::compoundStatement() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST compoundStatement_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lc = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ lc = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lc_AST = astFactory->create(lc);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lc_AST));
+ }
+ match(LCURLY);
+ if ( inputState->guessing==0 ) {
+#line 535 "java.g"
+ lc_AST->setType(SLIST);
+#line 2015 "JavaRecognizer.cpp"
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_23.member(LA(1)))) {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop86;
+ }
+
+ }
+ _loop86:;
+ } // ( ... )*
+ match(RCURLY);
+ compoundStatement_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_27);
+ } else {
+ throw;
+ }
+ }
+ returnAST = compoundStatement_AST;
+}
+
+/** Catch obvious constructor calls, but not the expr.super(...) calls */
+void JavaRecognizer::explicitConstructorInvocation() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST explicitConstructorInvocation_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp1 = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp1_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp2 = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp2_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LITERAL_this:
+ {
+ match(LITERAL_this);
+ lp1 = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp1_AST = astFactory->create(lp1);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp1_AST));
+ }
+ match(LPAREN);
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 428 "java.g"
+ lp1_AST->setType(CTOR_CALL);
+#line 2076 "JavaRecognizer.cpp"
+ }
+ explicitConstructorInvocation_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_super:
+ {
+ match(LITERAL_super);
+ lp2 = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp2_AST = astFactory->create(lp2);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp2_AST));
+ }
+ match(LPAREN);
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 430 "java.g"
+ lp2_AST->setType(SUPER_CTOR_CALL);
+#line 2099 "JavaRecognizer.cpp"
+ }
+ explicitConstructorInvocation_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ } else {
+ throw;
+ }
+ }
+ returnAST = explicitConstructorInvocation_AST;
+}
+
+void JavaRecognizer::statement() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST statement_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST m_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST c_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken s = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST s_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LCURLY:
+ {
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_if:
+ {
+ RefJavaAST tmp68_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp68_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp68_AST));
+ }
+ match(LITERAL_if);
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ if ((LA(1) == LITERAL_else) && (_tokenSet_23.member(LA(2)))) {
+ match(LITERAL_else);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_28.member(LA(1))) && (_tokenSet_29.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_for:
+ {
+ RefJavaAST tmp72_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp72_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp72_AST));
+ }
+ match(LITERAL_for);
+ match(LPAREN);
+ forInit();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ forCond();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ forIter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_while:
+ {
+ RefJavaAST tmp77_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp77_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp77_AST));
+ }
+ match(LITERAL_while);
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_do:
+ {
+ RefJavaAST tmp80_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp80_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp80_AST));
+ }
+ match(LITERAL_do);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LITERAL_while);
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_break:
+ {
+ RefJavaAST tmp85_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp85_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp85_AST));
+ }
+ match(LITERAL_break);
+ {
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ RefJavaAST tmp86_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp86_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp86_AST));
+ }
+ match(IDENT);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_continue:
+ {
+ RefJavaAST tmp88_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp88_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp88_AST));
+ }
+ match(LITERAL_continue);
+ {
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ RefJavaAST tmp89_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp89_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp89_AST));
+ }
+ match(IDENT);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_return:
+ {
+ RefJavaAST tmp91_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp91_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp91_AST));
+ }
+ match(LITERAL_return);
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_switch:
+ {
+ RefJavaAST tmp93_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp93_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp93_AST));
+ }
+ match(LITERAL_switch);
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ match(LCURLY);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LITERAL_case || LA(1) == LITERAL_default)) {
+ casesGroup();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop95;
+ }
+
+ }
+ _loop95:;
+ } // ( ... )*
+ match(RCURLY);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_try:
+ {
+ tryBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_throw:
+ {
+ RefJavaAST tmp98_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp98_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp98_AST));
+ }
+ match(LITERAL_throw);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case SEMI:
+ {
+ s = LT(1);
+ if ( inputState->guessing == 0 ) {
+ s_AST = astFactory->create(s);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST));
+ }
+ match(SEMI);
+ if ( inputState->guessing==0 ) {
+#line 617 "java.g"
+ s_AST->setType(EMPTY_STAT);
+#line 2451 "JavaRecognizer.cpp"
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ bool synPredMatched89 = false;
+ if (((_tokenSet_30.member(LA(1))) && (_tokenSet_31.member(LA(2))))) {
+ int _m89 = mark();
+ synPredMatched89 = true;
+ inputState->guessing++;
+ try {
+ {
+ declaration();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched89 = false;
+ }
+ rewind(_m89);
+ inputState->guessing--;
+ }
+ if ( synPredMatched89 ) {
+ declaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ }
+ else if ((_tokenSet_32.member(LA(1))) && (_tokenSet_33.member(LA(2)))) {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ statement_AST = RefJavaAST(currentAST.root);
+ }
+ else if ((_tokenSet_34.member(LA(1))) && (_tokenSet_35.member(LA(2)))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ m_AST = returnAST;
+ }
+ classDefinition(m_AST);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ RefJavaAST tmp102_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp102_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp102_AST));
+ }
+ match(IDENT);
+ c = LT(1);
+ if ( inputState->guessing == 0 ) {
+ c_AST = astFactory->create(c);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST));
+ }
+ match(COLON);
+ if ( inputState->guessing==0 ) {
+#line 560 "java.g"
+ c_AST->setType(LABELED_STAT);
+#line 2516 "JavaRecognizer.cpp"
+ }
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ }
+ else if ((LA(1) == LITERAL_synchronized) && (LA(2) == LPAREN)) {
+ RefJavaAST tmp103_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp103_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp103_AST));
+ }
+ match(LITERAL_synchronized);
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statement_AST = RefJavaAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_28);
+ } else {
+ throw;
+ }
+ }
+ returnAST = statement_AST;
+}
+
+void JavaRecognizer::argList() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST argList_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expressionList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ if ( inputState->guessing==0 ) {
+ argList_AST = RefJavaAST(currentAST.root);
+#line 1008 "java.g"
+ argList_AST = astFactory->create(ELIST,"ELIST");
+#line 2609 "JavaRecognizer.cpp"
+ currentAST.root = argList_AST;
+ if ( argList_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ argList_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = argList_AST->getFirstChild();
+ else
+ currentAST.child = argList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ argList_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ } else {
+ throw;
+ }
+ }
+ returnAST = argList_AST;
+}
+
+/** Declaration of a variable. This can be a class/instance variable,
+ * or a local variable in a method
+ * It can also include possible initialization.
+ */
+void JavaRecognizer::variableDeclarator(
+ RefJavaAST mods, RefJavaAST t
+) {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST variableDeclarator_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken id = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST id_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST d_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST v_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ id = LT(1);
+ if ( inputState->guessing == 0 ) {
+ id_AST = astFactory->create(id);
+ }
+ match(IDENT);
+ declaratorBrackets(t);
+ if (inputState->guessing==0) {
+ d_AST = returnAST;
+ }
+ varInitializer();
+ if (inputState->guessing==0) {
+ v_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ variableDeclarator_AST = RefJavaAST(currentAST.root);
+#line 448 "java.g"
+ variableDeclarator_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(5))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(VARIABLE_DEF,"VARIABLE_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(mods))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TYPE,"TYPE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(d_AST))))))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(v_AST))));
+#line 2672 "JavaRecognizer.cpp"
+ currentAST.root = variableDeclarator_AST;
+ if ( variableDeclarator_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ variableDeclarator_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = variableDeclarator_AST->getFirstChild();
+ else
+ currentAST.child = variableDeclarator_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_36);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variableDeclarator_AST;
+}
+
+void JavaRecognizer::varInitializer() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST varInitializer_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ RefJavaAST tmp106_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp106_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp106_AST));
+ }
+ match(ASSIGN);
+ initializer();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case COMMA:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ varInitializer_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_36);
+ } else {
+ throw;
+ }
+ }
+ returnAST = varInitializer_AST;
+}
+
+void JavaRecognizer::initializer() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST initializer_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ initializer_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LCURLY:
+ {
+ arrayInitializer();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ initializer_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_37);
+ } else {
+ throw;
+ }
+ }
+ returnAST = initializer_AST;
+}
+
+void JavaRecognizer::arrayInitializer() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST arrayInitializer_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lc = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ lc = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lc_AST = astFactory->create(lc);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lc_AST));
+ }
+ match(LCURLY);
+ if ( inputState->guessing==0 ) {
+#line 462 "java.g"
+ lc_AST->setType(ARRAY_INIT);
+#line 2826 "JavaRecognizer.cpp"
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LCURLY:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ initializer();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA) && (_tokenSet_38.member(LA(2)))) {
+ match(COMMA);
+ initializer();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop69;
+ }
+
+ }
+ _loop69:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case COMMA:
+ {
+ match(COMMA);
+ break;
+ }
+ case RCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case RCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RCURLY);
+ arrayInitializer_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arrayInitializer_AST;
+}
+
+void JavaRecognizer::expression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST expression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ assignmentExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ expression_AST = RefJavaAST(currentAST.root);
+#line 715 "java.g"
+ expression_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(EXPR,"EXPR")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(expression_AST))));
+#line 2938 "JavaRecognizer.cpp"
+ currentAST.root = expression_AST;
+ if ( expression_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ expression_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = expression_AST->getFirstChild();
+ else
+ currentAST.child = expression_AST;
+ currentAST.advanceChildToEnd();
+ }
+ expression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_40);
+ } else {
+ throw;
+ }
+ }
+ returnAST = expression_AST;
+}
+
+void JavaRecognizer::parameterDeclaration() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST parameterDeclaration_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST pm_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST t_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken id = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST id_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefJavaAST pd_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ parameterModifier();
+ if (inputState->guessing==0) {
+ pm_AST = returnAST;
+ }
+ typeSpec(false);
+ if (inputState->guessing==0) {
+ t_AST = returnAST;
+ }
+ id = LT(1);
+ if ( inputState->guessing == 0 ) {
+ id_AST = astFactory->create(id);
+ }
+ match(IDENT);
+ declaratorBrackets(t_AST);
+ if (inputState->guessing==0) {
+ pd_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ parameterDeclaration_AST = RefJavaAST(currentAST.root);
+#line 516 "java.g"
+ parameterDeclaration_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(4))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(PARAMETER_DEF,"PARAMETER_DEF")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(pm_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(TYPE,"TYPE")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(pd_AST))))))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_AST))));
+#line 2992 "JavaRecognizer.cpp"
+ currentAST.root = parameterDeclaration_AST;
+ if ( parameterDeclaration_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ parameterDeclaration_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = parameterDeclaration_AST->getFirstChild();
+ else
+ currentAST.child = parameterDeclaration_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_41);
+ } else {
+ throw;
+ }
+ }
+ returnAST = parameterDeclaration_AST;
+}
+
+void JavaRecognizer::parameterModifier() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST parameterModifier_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken f = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST f_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case FINAL:
+ {
+ f = LT(1);
+ if ( inputState->guessing == 0 ) {
+ f_AST = astFactory->create(f);
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST));
+ }
+ match(FINAL);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ parameterModifier_AST = RefJavaAST(currentAST.root);
+#line 522 "java.g"
+ parameterModifier_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(MODIFIERS,"MODIFIERS")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(f_AST))));
+#line 3056 "JavaRecognizer.cpp"
+ currentAST.root = parameterModifier_AST;
+ if ( parameterModifier_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ parameterModifier_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = parameterModifier_AST->getFirstChild();
+ else
+ currentAST.child = parameterModifier_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameterModifier_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_42);
+ } else {
+ throw;
+ }
+ }
+ returnAST = parameterModifier_AST;
+}
+
+void JavaRecognizer::forInit() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST forInit_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ bool synPredMatched107 = false;
+ if (((_tokenSet_30.member(LA(1))) && (_tokenSet_31.member(LA(2))))) {
+ int _m107 = mark();
+ synPredMatched107 = true;
+ inputState->guessing++;
+ try {
+ {
+ declaration();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched107 = false;
+ }
+ rewind(_m107);
+ inputState->guessing--;
+ }
+ if ( synPredMatched107 ) {
+ declaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_32.member(LA(1))) && (_tokenSet_43.member(LA(2)))) {
+ expressionList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == SEMI)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if ( inputState->guessing==0 ) {
+ forInit_AST = RefJavaAST(currentAST.root);
+#line 651 "java.g"
+ forInit_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FOR_INIT,"FOR_INIT")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(forInit_AST))));
+#line 3124 "JavaRecognizer.cpp"
+ currentAST.root = forInit_AST;
+ if ( forInit_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ forInit_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = forInit_AST->getFirstChild();
+ else
+ currentAST.child = forInit_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forInit_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = forInit_AST;
+}
+
+void JavaRecognizer::forCond() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST forCond_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ forCond_AST = RefJavaAST(currentAST.root);
+#line 656 "java.g"
+ forCond_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FOR_CONDITION,"FOR_CONDITION")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(forCond_AST))));
+#line 3204 "JavaRecognizer.cpp"
+ currentAST.root = forCond_AST;
+ if ( forCond_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ forCond_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = forCond_AST->getFirstChild();
+ else
+ currentAST.child = forCond_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forCond_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = forCond_AST;
+}
+
+void JavaRecognizer::forIter() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST forIter_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expressionList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if ( inputState->guessing==0 ) {
+ forIter_AST = RefJavaAST(currentAST.root);
+#line 661 "java.g"
+ forIter_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(FOR_ITERATOR,"FOR_ITERATOR")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(forIter_AST))));
+#line 3284 "JavaRecognizer.cpp"
+ currentAST.root = forIter_AST;
+ if ( forIter_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ forIter_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = forIter_AST->getFirstChild();
+ else
+ currentAST.child = forIter_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forIter_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_24);
+ } else {
+ throw;
+ }
+ }
+ returnAST = forIter_AST;
+}
+
+void JavaRecognizer::casesGroup() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST casesGroup_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt98=0;
+ for (;;) {
+ if ((LA(1) == LITERAL_case || LA(1) == LITERAL_default) && (_tokenSet_44.member(LA(2)))) {
+ aCase();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt98>=1 ) { goto _loop98; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt98++;
+ }
+ _loop98:;
+ } // ( ... )+
+ caseSList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ if ( inputState->guessing==0 ) {
+ casesGroup_AST = RefJavaAST(currentAST.root);
+#line 632 "java.g"
+ casesGroup_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CASE_GROUP,"CASE_GROUP")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(casesGroup_AST))));
+#line 3337 "JavaRecognizer.cpp"
+ currentAST.root = casesGroup_AST;
+ if ( casesGroup_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ casesGroup_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = casesGroup_AST->getFirstChild();
+ else
+ currentAST.child = casesGroup_AST;
+ currentAST.advanceChildToEnd();
+ }
+ casesGroup_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_45);
+ } else {
+ throw;
+ }
+ }
+ returnAST = casesGroup_AST;
+}
+
+void JavaRecognizer::tryBlock() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST tryBlock_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp110_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp110_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp110_AST));
+ }
+ match(LITERAL_try);
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LITERAL_catch)) {
+ handler();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop114;
+ }
+
+ }
+ _loop114:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case LITERAL_finally:
+ {
+ finallyClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case FINAL:
+ case ABSTRACT:
+ case STRICTFP:
+ case SEMI:
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LITERAL_private:
+ case LITERAL_public:
+ case LITERAL_protected:
+ case LITERAL_static:
+ case LITERAL_transient:
+ case LITERAL_native:
+ case LITERAL_threadsafe:
+ case LITERAL_synchronized:
+ case LITERAL_volatile:
+ case LITERAL_class:
+ case LCURLY:
+ case RCURLY:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case LITERAL_if:
+ case LITERAL_else:
+ case LITERAL_for:
+ case LITERAL_while:
+ case LITERAL_do:
+ case LITERAL_break:
+ case LITERAL_continue:
+ case LITERAL_return:
+ case LITERAL_switch:
+ case LITERAL_throw:
+ case LITERAL_case:
+ case LITERAL_default:
+ case LITERAL_try:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ tryBlock_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_28);
+ } else {
+ throw;
+ }
+ }
+ returnAST = tryBlock_AST;
+}
+
+void JavaRecognizer::aCase() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST aCase_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_case:
+ {
+ RefJavaAST tmp111_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp111_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp111_AST));
+ }
+ match(LITERAL_case);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LITERAL_default:
+ {
+ RefJavaAST tmp112_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp112_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp112_AST));
+ }
+ match(LITERAL_default);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(COLON);
+ aCase_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_46);
+ } else {
+ throw;
+ }
+ }
+ returnAST = aCase_AST;
+}
+
+void JavaRecognizer::caseSList() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST caseSList_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_23.member(LA(1)))) {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop103;
+ }
+
+ }
+ _loop103:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ caseSList_AST = RefJavaAST(currentAST.root);
+#line 641 "java.g"
+ caseSList_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(SLIST,"SLIST")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(caseSList_AST))));
+#line 3557 "JavaRecognizer.cpp"
+ currentAST.root = caseSList_AST;
+ if ( caseSList_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ caseSList_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = caseSList_AST->getFirstChild();
+ else
+ currentAST.child = caseSList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ caseSList_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_45);
+ } else {
+ throw;
+ }
+ }
+ returnAST = caseSList_AST;
+}
+
+void JavaRecognizer::expressionList() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST expressionList_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop121;
+ }
+
+ }
+ _loop121:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ expressionList_AST = RefJavaAST(currentAST.root);
+#line 721 "java.g"
+ expressionList_AST = RefJavaAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(ELIST,"ELIST")))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(expressionList_AST))));
+#line 3609 "JavaRecognizer.cpp"
+ currentAST.root = expressionList_AST;
+ if ( expressionList_AST!=RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ expressionList_AST->getFirstChild() != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = expressionList_AST->getFirstChild();
+ else
+ currentAST.child = expressionList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ expressionList_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_47);
+ } else {
+ throw;
+ }
+ }
+ returnAST = expressionList_AST;
+}
+
+void JavaRecognizer::handler() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST handler_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp115_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp115_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp115_AST));
+ }
+ match(LITERAL_catch);
+ match(LPAREN);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ handler_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_48);
+ } else {
+ throw;
+ }
+ }
+ returnAST = handler_AST;
+}
+
+void JavaRecognizer::finallyClause() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST finallyClause_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp118_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp118_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp118_AST));
+ }
+ match(LITERAL_finally);
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ finallyClause_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_28);
+ } else {
+ throw;
+ }
+ }
+ returnAST = finallyClause_AST;
+}
+
+void JavaRecognizer::assignmentExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST assignmentExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ conditionalExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ {
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ RefJavaAST tmp119_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp119_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp119_AST));
+ }
+ match(ASSIGN);
+ break;
+ }
+ case PLUS_ASSIGN:
+ {
+ RefJavaAST tmp120_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp120_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp120_AST));
+ }
+ match(PLUS_ASSIGN);
+ break;
+ }
+ case MINUS_ASSIGN:
+ {
+ RefJavaAST tmp121_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp121_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp121_AST));
+ }
+ match(MINUS_ASSIGN);
+ break;
+ }
+ case STAR_ASSIGN:
+ {
+ RefJavaAST tmp122_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp122_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp122_AST));
+ }
+ match(STAR_ASSIGN);
+ break;
+ }
+ case DIV_ASSIGN:
+ {
+ RefJavaAST tmp123_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp123_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp123_AST));
+ }
+ match(DIV_ASSIGN);
+ break;
+ }
+ case MOD_ASSIGN:
+ {
+ RefJavaAST tmp124_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp124_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp124_AST));
+ }
+ match(MOD_ASSIGN);
+ break;
+ }
+ case SR_ASSIGN:
+ {
+ RefJavaAST tmp125_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp125_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp125_AST));
+ }
+ match(SR_ASSIGN);
+ break;
+ }
+ case BSR_ASSIGN:
+ {
+ RefJavaAST tmp126_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp126_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp126_AST));
+ }
+ match(BSR_ASSIGN);
+ break;
+ }
+ case SL_ASSIGN:
+ {
+ RefJavaAST tmp127_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp127_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp127_AST));
+ }
+ match(SL_ASSIGN);
+ break;
+ }
+ case BAND_ASSIGN:
+ {
+ RefJavaAST tmp128_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp128_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp128_AST));
+ }
+ match(BAND_ASSIGN);
+ break;
+ }
+ case BXOR_ASSIGN:
+ {
+ RefJavaAST tmp129_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp129_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp129_AST));
+ }
+ match(BXOR_ASSIGN);
+ break;
+ }
+ case BOR_ASSIGN:
+ {
+ RefJavaAST tmp130_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp130_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp130_AST));
+ }
+ match(BOR_ASSIGN);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ assignmentExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RBRACK:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case COLON:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ assignmentExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_40);
+ } else {
+ throw;
+ }
+ }
+ returnAST = assignmentExpression_AST;
+}
+
+void JavaRecognizer::conditionalExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST conditionalExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ logicalOrExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case QUESTION:
+ {
+ RefJavaAST tmp131_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp131_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp131_AST));
+ }
+ match(QUESTION);
+ assignmentExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ conditionalExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RBRACK:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ conditionalExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_49);
+ } else {
+ throw;
+ }
+ }
+ returnAST = conditionalExpression_AST;
+}
+
+void JavaRecognizer::logicalOrExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST logicalOrExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ logicalAndExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LOR)) {
+ RefJavaAST tmp133_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp133_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp133_AST));
+ }
+ match(LOR);
+ logicalAndExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop129;
+ }
+
+ }
+ _loop129:;
+ } // ( ... )*
+ logicalOrExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_50);
+ } else {
+ throw;
+ }
+ }
+ returnAST = logicalOrExpression_AST;
+}
+
+void JavaRecognizer::logicalAndExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST logicalAndExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ inclusiveOrExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LAND)) {
+ RefJavaAST tmp134_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp134_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp134_AST));
+ }
+ match(LAND);
+ inclusiveOrExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop132;
+ }
+
+ }
+ _loop132:;
+ } // ( ... )*
+ logicalAndExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_51);
+ } else {
+ throw;
+ }
+ }
+ returnAST = logicalAndExpression_AST;
+}
+
+void JavaRecognizer::inclusiveOrExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST inclusiveOrExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ exclusiveOrExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == BOR)) {
+ RefJavaAST tmp135_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp135_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp135_AST));
+ }
+ match(BOR);
+ exclusiveOrExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop135;
+ }
+
+ }
+ _loop135:;
+ } // ( ... )*
+ inclusiveOrExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_52);
+ } else {
+ throw;
+ }
+ }
+ returnAST = inclusiveOrExpression_AST;
+}
+
+void JavaRecognizer::exclusiveOrExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST exclusiveOrExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ andExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == BXOR)) {
+ RefJavaAST tmp136_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp136_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp136_AST));
+ }
+ match(BXOR);
+ andExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop138;
+ }
+
+ }
+ _loop138:;
+ } // ( ... )*
+ exclusiveOrExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exclusiveOrExpression_AST;
+}
+
+void JavaRecognizer::andExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST andExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ equalityExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == BAND)) {
+ RefJavaAST tmp137_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp137_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp137_AST));
+ }
+ match(BAND);
+ equalityExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop141;
+ }
+
+ }
+ _loop141:;
+ } // ( ... )*
+ andExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_54);
+ } else {
+ throw;
+ }
+ }
+ returnAST = andExpression_AST;
+}
+
+void JavaRecognizer::equalityExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST equalityExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ relationalExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == NOT_EQUAL || LA(1) == EQUAL)) {
+ {
+ switch ( LA(1)) {
+ case NOT_EQUAL:
+ {
+ RefJavaAST tmp138_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp138_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp138_AST));
+ }
+ match(NOT_EQUAL);
+ break;
+ }
+ case EQUAL:
+ {
+ RefJavaAST tmp139_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp139_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp139_AST));
+ }
+ match(EQUAL);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relationalExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop145;
+ }
+
+ }
+ _loop145:;
+ } // ( ... )*
+ equalityExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_55);
+ } else {
+ throw;
+ }
+ }
+ returnAST = equalityExpression_AST;
+}
+
+void JavaRecognizer::relationalExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST relationalExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ shiftExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case SEMI:
+ case RBRACK:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ {
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= LT_ && LA(1) <= GE))) {
+ {
+ switch ( LA(1)) {
+ case LT_:
+ {
+ RefJavaAST tmp140_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp140_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp140_AST));
+ }
+ match(LT_);
+ break;
+ }
+ case GT:
+ {
+ RefJavaAST tmp141_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp141_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp141_AST));
+ }
+ match(GT);
+ break;
+ }
+ case LE:
+ {
+ RefJavaAST tmp142_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp142_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp142_AST));
+ }
+ match(LE);
+ break;
+ }
+ case GE:
+ {
+ RefJavaAST tmp143_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp143_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp143_AST));
+ }
+ match(GE);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ shiftExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop150;
+ }
+
+ }
+ _loop150:;
+ } // ( ... )*
+ break;
+ }
+ case LITERAL_instanceof:
+ {
+ RefJavaAST tmp144_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp144_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp144_AST));
+ }
+ match(LITERAL_instanceof);
+ typeSpec(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relationalExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_56);
+ } else {
+ throw;
+ }
+ }
+ returnAST = relationalExpression_AST;
+}
+
+void JavaRecognizer::shiftExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST shiftExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ additiveExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= SL && LA(1) <= BSR))) {
+ {
+ switch ( LA(1)) {
+ case SL:
+ {
+ RefJavaAST tmp145_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp145_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp145_AST));
+ }
+ match(SL);
+ break;
+ }
+ case SR:
+ {
+ RefJavaAST tmp146_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp146_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp146_AST));
+ }
+ match(SR);
+ break;
+ }
+ case BSR:
+ {
+ RefJavaAST tmp147_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp147_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp147_AST));
+ }
+ match(BSR);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ additiveExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop154;
+ }
+
+ }
+ _loop154:;
+ } // ( ... )*
+ shiftExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_57);
+ } else {
+ throw;
+ }
+ }
+ returnAST = shiftExpression_AST;
+}
+
+void JavaRecognizer::additiveExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST additiveExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ multiplicativeExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == PLUS || LA(1) == MINUS)) {
+ {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ RefJavaAST tmp148_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp148_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp148_AST));
+ }
+ match(PLUS);
+ break;
+ }
+ case MINUS:
+ {
+ RefJavaAST tmp149_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp149_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp149_AST));
+ }
+ match(MINUS);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ multiplicativeExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop158;
+ }
+
+ }
+ _loop158:;
+ } // ( ... )*
+ additiveExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_58);
+ } else {
+ throw;
+ }
+ }
+ returnAST = additiveExpression_AST;
+}
+
+void JavaRecognizer::multiplicativeExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST multiplicativeExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_59.member(LA(1)))) {
+ {
+ switch ( LA(1)) {
+ case STAR:
+ {
+ RefJavaAST tmp150_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp150_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp150_AST));
+ }
+ match(STAR);
+ break;
+ }
+ case DIV:
+ {
+ RefJavaAST tmp151_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp151_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp151_AST));
+ }
+ match(DIV);
+ break;
+ }
+ case MOD:
+ {
+ RefJavaAST tmp152_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp152_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp152_AST));
+ }
+ match(MOD);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop162;
+ }
+
+ }
+ _loop162:;
+ } // ( ... )*
+ multiplicativeExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_60);
+ } else {
+ throw;
+ }
+ }
+ returnAST = multiplicativeExpression_AST;
+}
+
+void JavaRecognizer::unaryExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST unaryExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case INC:
+ {
+ RefJavaAST tmp153_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp153_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp153_AST));
+ }
+ match(INC);
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case DEC:
+ {
+ RefJavaAST tmp154_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp154_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp154_AST));
+ }
+ match(DEC);
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case MINUS:
+ {
+ RefJavaAST tmp155_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp155_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp155_AST));
+ }
+ match(MINUS);
+ if ( inputState->guessing==0 ) {
+#line 812 "java.g"
+ tmp155_AST->setType(UNARY_MINUS);
+#line 4646 "JavaRecognizer.cpp"
+ }
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case PLUS:
+ {
+ RefJavaAST tmp156_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp156_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp156_AST));
+ }
+ match(PLUS);
+ if ( inputState->guessing==0 ) {
+#line 813 "java.g"
+ tmp156_AST->setType(UNARY_PLUS);
+#line 4666 "JavaRecognizer.cpp"
+ }
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ unaryExpressionNotPlusMinus();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unaryExpression_AST;
+}
+
+void JavaRecognizer::unaryExpressionNotPlusMinus() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST unaryExpressionNotPlusMinus_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lpb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lpb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case BNOT:
+ {
+ RefJavaAST tmp157_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp157_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp157_AST));
+ }
+ match(BNOT);
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpressionNotPlusMinus_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LNOT:
+ {
+ RefJavaAST tmp158_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp158_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp158_AST));
+ }
+ match(LNOT);
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unaryExpressionNotPlusMinus_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ {
+ if ((LA(1) == LPAREN) && ((LA(2) >= LITERAL_void && LA(2) <= LITERAL_double))) {
+ lpb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lpb_AST = astFactory->create(lpb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lpb_AST));
+ }
+ match(LPAREN);
+ if ( inputState->guessing==0 ) {
+#line 829 "java.g"
+ lpb_AST->setType(TYPECAST);
+#line 4801 "JavaRecognizer.cpp"
+ }
+ builtInTypeSpec(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ unaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ bool synPredMatched167 = false;
+ if (((LA(1) == LPAREN) && (LA(2) == IDENT))) {
+ int _m167 = mark();
+ synPredMatched167 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ classTypeSpec(true);
+ match(RPAREN);
+ unaryExpressionNotPlusMinus();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched167 = false;
+ }
+ rewind(_m167);
+ inputState->guessing--;
+ }
+ if ( synPredMatched167 ) {
+ lp = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp_AST = astFactory->create(lp);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp_AST));
+ }
+ match(LPAREN);
+ if ( inputState->guessing==0 ) {
+#line 836 "java.g"
+ lp_AST->setType(TYPECAST);
+#line 4843 "JavaRecognizer.cpp"
+ }
+ classTypeSpec(true);
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ unaryExpressionNotPlusMinus();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_62.member(LA(1))) && (_tokenSet_63.member(LA(2)))) {
+ postfixExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ unaryExpressionNotPlusMinus_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unaryExpressionNotPlusMinus_AST;
+}
+
+void JavaRecognizer::postfixExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST postfixExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp3 = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp3_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lps = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lps_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken in = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST in_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken de = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST de_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ primaryExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == DOT) && (LA(2) == IDENT)) {
+ RefJavaAST tmp161_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp161_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp161_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp162_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp162_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp162_AST));
+ }
+ match(IDENT);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ lp = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp_AST = astFactory->create(lp);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp_AST));
+ }
+ match(LPAREN);
+ if ( inputState->guessing==0 ) {
+#line 867 "java.g"
+ lp_AST->setType(METHOD_CALL);
+#line 4936 "JavaRecognizer.cpp"
+ }
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ case LBRACK:
+ case RBRACK:
+ case DOT:
+ case STAR:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ case INC:
+ case DEC:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else if ((LA(1) == DOT) && (LA(2) == LITERAL_this)) {
+ RefJavaAST tmp164_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp164_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp164_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp165_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp165_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp165_AST));
+ }
+ match(LITERAL_this);
+ }
+ else if ((LA(1) == DOT) && (LA(2) == LITERAL_super)) {
+ RefJavaAST tmp166_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp166_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp166_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp167_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp167_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp167_AST));
+ }
+ match(LITERAL_super);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ lp3 = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp3_AST = astFactory->create(lp3);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp3_AST));
+ }
+ match(LPAREN);
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ if ( inputState->guessing==0 ) {
+#line 876 "java.g"
+ lp3_AST->setType(SUPER_CTOR_CALL);
+#line 5043 "JavaRecognizer.cpp"
+ }
+ break;
+ }
+ case DOT:
+ {
+ RefJavaAST tmp169_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp169_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp169_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp170_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp170_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp170_AST));
+ }
+ match(IDENT);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ lps = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lps_AST = astFactory->create(lps);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lps_AST));
+ }
+ match(LPAREN);
+ if ( inputState->guessing==0 ) {
+#line 878 "java.g"
+ lps_AST->setType(METHOD_CALL);
+#line 5074 "JavaRecognizer.cpp"
+ }
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ case LBRACK:
+ case RBRACK:
+ case DOT:
+ case STAR:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ case INC:
+ case DEC:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else if ((LA(1) == DOT) && (LA(2) == LITERAL_new)) {
+ RefJavaAST tmp172_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp172_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp172_AST));
+ }
+ match(DOT);
+ newExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == LBRACK)) {
+ lb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lb_AST = astFactory->create(lb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lb_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 884 "java.g"
+ lb_AST->setType(INDEX_OP);
+#line 5166 "JavaRecognizer.cpp"
+ }
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RBRACK);
+ }
+ else {
+ goto _loop173;
+ }
+
+ }
+ _loop173:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case INC:
+ {
+ in = LT(1);
+ if ( inputState->guessing == 0 ) {
+ in_AST = astFactory->create(in);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(in_AST));
+ }
+ match(INC);
+ if ( inputState->guessing==0 ) {
+#line 889 "java.g"
+ in_AST->setType(POST_INC);
+#line 5194 "JavaRecognizer.cpp"
+ }
+ break;
+ }
+ case DEC:
+ {
+ de = LT(1);
+ if ( inputState->guessing == 0 ) {
+ de_AST = astFactory->create(de);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(de_AST));
+ }
+ match(DEC);
+ if ( inputState->guessing==0 ) {
+#line 890 "java.g"
+ de_AST->setType(POST_DEC);
+#line 5209 "JavaRecognizer.cpp"
+ }
+ break;
+ }
+ case SEMI:
+ case RBRACK:
+ case STAR:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ postfixExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = postfixExpression_AST;
+}
+
+void JavaRecognizer::primaryExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST primaryExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lbt = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lbt_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ identPrimary();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ if ((LA(1) == DOT) && (LA(2) == LITERAL_class)) {
+ RefJavaAST tmp174_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp174_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp174_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp175_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp175_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp175_AST));
+ }
+ match(LITERAL_class);
+ }
+ else if ((_tokenSet_39.member(LA(1))) && (_tokenSet_64.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_true:
+ {
+ RefJavaAST tmp176_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp176_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp176_AST));
+ }
+ match(LITERAL_true);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_false:
+ {
+ RefJavaAST tmp177_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp177_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp177_AST));
+ }
+ match(LITERAL_false);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_null:
+ {
+ RefJavaAST tmp178_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp178_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp178_AST));
+ }
+ match(LITERAL_null);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_new:
+ {
+ newExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_this:
+ {
+ RefJavaAST tmp179_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp179_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp179_AST));
+ }
+ match(LITERAL_this);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_super:
+ {
+ RefJavaAST tmp180_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp180_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp180_AST));
+ }
+ match(LITERAL_super);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LPAREN:
+ {
+ match(LPAREN);
+ assignmentExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ {
+ builtInType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == LBRACK)) {
+ lbt = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lbt_AST = astFactory->create(lbt);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lbt_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 907 "java.g"
+ lbt_AST->setType(ARRAY_DECLARATOR);
+#line 5429 "JavaRecognizer.cpp"
+ }
+ match(RBRACK);
+ }
+ else {
+ goto _loop178;
+ }
+
+ }
+ _loop178:;
+ } // ( ... )*
+ RefJavaAST tmp184_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp184_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp184_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp185_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp185_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp185_AST));
+ }
+ match(LITERAL_class);
+ primaryExpression_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = primaryExpression_AST;
+}
+
+/** object instantiation.
+ * Trees are built as illustrated by the following input/tree pairs:
+ *
+ * new T()
+ *
+ * new
+ * |
+ * T -- ELIST
+ * |
+ * arg1 -- arg2 -- .. -- argn
+ *
+ * new int[]
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ *
+ * new int[] {1,2}
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR -- ARRAY_INIT
+ * |
+ * EXPR -- EXPR
+ * | |
+ * 1 2
+ *
+ * new int[3]
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ * |
+ * EXPR
+ * |
+ * 3
+ *
+ * new int[1][2]
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ * |
+ * ARRAY_DECLARATOR -- EXPR
+ * | |
+ * EXPR 1
+ * |
+ * 2
+ *
+ */
+void JavaRecognizer::newExpression() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST newExpression_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp186_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp186_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp186_AST));
+ }
+ match(LITERAL_new);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ {
+ switch ( LA(1)) {
+ case LCURLY:
+ {
+ classBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case LBRACK:
+ case RBRACK:
+ case DOT:
+ case STAR:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ case INC:
+ case DEC:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case LBRACK:
+ {
+ newArrayDeclarator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LCURLY:
+ {
+ arrayInitializer();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case LBRACK:
+ case RBRACK:
+ case DOT:
+ case STAR:
+ case RCURLY:
+ case COMMA:
+ case RPAREN:
+ case ASSIGN:
+ case COLON:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ case INC:
+ case DEC:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ newExpression_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = newExpression_AST;
+}
+
+/** Match a, a.b.c refs, a.b.c(...) refs, a.b.c[], a.b.c[].class,
+ * and a.b.c.class refs. Also this(...) and super(...). Match
+ * this or super.
+ */
+void JavaRecognizer::identPrimary() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST identPrimary_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lp = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lp_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lbc = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lbc_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST tmp189_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp189_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp189_AST));
+ }
+ match(IDENT);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == DOT) && (LA(2) == IDENT)) {
+ RefJavaAST tmp190_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp190_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp190_AST));
+ }
+ match(DOT);
+ RefJavaAST tmp191_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp191_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp191_AST));
+ }
+ match(IDENT);
+ }
+ else {
+ goto _loop181;
+ }
+
+ }
+ _loop181:;
+ } // ( ... )*
+ {
+ if ((LA(1) == LPAREN)) {
+ {
+ lp = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lp_AST = astFactory->create(lp);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lp_AST));
+ }
+ match(LPAREN);
+ if ( inputState->guessing==0 ) {
+#line 933 "java.g"
+ lp_AST->setType(METHOD_CALL);
+#line 5755 "JavaRecognizer.cpp"
+ }
+ argList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ }
+ }
+ else if ((LA(1) == LBRACK) && (LA(2) == RBRACK)) {
+ { // ( ... )+
+ int _cnt185=0;
+ for (;;) {
+ if ((LA(1) == LBRACK) && (LA(2) == RBRACK)) {
+ lbc = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lbc_AST = astFactory->create(lbc);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lbc_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 935 "java.g"
+ lbc_AST->setType(ARRAY_DECLARATOR);
+#line 5778 "JavaRecognizer.cpp"
+ }
+ match(RBRACK);
+ }
+ else {
+ if ( _cnt185>=1 ) { goto _loop185; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt185++;
+ }
+ _loop185:;
+ } // ( ... )+
+ }
+ else if ((_tokenSet_39.member(LA(1))) && (_tokenSet_64.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ identPrimary_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identPrimary_AST;
+}
+
+void JavaRecognizer::constant() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST constant_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case NUM_INT:
+ {
+ RefJavaAST tmp194_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp194_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp194_AST));
+ }
+ match(NUM_INT);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case CHAR_LITERAL:
+ {
+ RefJavaAST tmp195_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp195_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp195_AST));
+ }
+ match(CHAR_LITERAL);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ RefJavaAST tmp196_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp196_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp196_AST));
+ }
+ match(STRING_LITERAL);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case NUM_FLOAT:
+ {
+ RefJavaAST tmp197_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp197_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp197_AST));
+ }
+ match(NUM_FLOAT);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case NUM_LONG:
+ {
+ RefJavaAST tmp198_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp198_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp198_AST));
+ }
+ match(NUM_LONG);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ case NUM_DOUBLE:
+ {
+ RefJavaAST tmp199_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp199_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp199_AST));
+ }
+ match(NUM_DOUBLE);
+ constant_AST = RefJavaAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constant_AST;
+}
+
+void JavaRecognizer::newArrayDeclarator() {
+ returnAST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefJavaAST newArrayDeclarator_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken lb = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefJavaAST lb_AST = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt195=0;
+ for (;;) {
+ if ((LA(1) == LBRACK) && (_tokenSet_65.member(LA(2)))) {
+ lb = LT(1);
+ if ( inputState->guessing == 0 ) {
+ lb_AST = astFactory->create(lb);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(lb_AST));
+ }
+ match(LBRACK);
+ if ( inputState->guessing==0 ) {
+#line 1023 "java.g"
+ lb_AST->setType(ARRAY_DECLARATOR);
+#line 5922 "JavaRecognizer.cpp"
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case LPAREN:
+ case LITERAL_this:
+ case LITERAL_super:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ case NUM_LONG:
+ case NUM_DOUBLE:
+ {
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RBRACK);
+ }
+ else {
+ if ( _cnt195>=1 ) { goto _loop195; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt195++;
+ }
+ _loop195:;
+ } // ( ... )+
+ newArrayDeclarator_AST = RefJavaAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_66);
+ } else {
+ throw;
+ }
+ }
+ returnAST = newArrayDeclarator_AST;
+}
+
+void JavaRecognizer::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
+{
+ factory.setMaxNodeType(151);
+}
+const char* JavaRecognizer::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "BLOCK",
+ "MODIFIERS",
+ "OBJBLOCK",
+ "SLIST",
+ "CTOR_DEF",
+ "METHOD_DEF",
+ "VARIABLE_DEF",
+ "INSTANCE_INIT",
+ "STATIC_INIT",
+ "TYPE",
+ "CLASS_DEF",
+ "INTERFACE_DEF",
+ "PACKAGE_DEF",
+ "ARRAY_DECLARATOR",
+ "EXTENDS_CLAUSE",
+ "IMPLEMENTS_CLAUSE",
+ "PARAMETERS",
+ "PARAMETER_DEF",
+ "LABELED_STAT",
+ "TYPECAST",
+ "INDEX_OP",
+ "POST_INC",
+ "POST_DEC",
+ "METHOD_CALL",
+ "EXPR",
+ "ARRAY_INIT",
+ "IMPORT",
+ "UNARY_MINUS",
+ "UNARY_PLUS",
+ "CASE_GROUP",
+ "ELIST",
+ "FOR_INIT",
+ "FOR_CONDITION",
+ "FOR_ITERATOR",
+ "EMPTY_STAT",
+ "\"final\"",
+ "\"abstract\"",
+ "\"strictfp\"",
+ "SUPER_CTOR_CALL",
+ "CTOR_CALL",
+ "\"package\"",
+ "SEMI",
+ "\"import\"",
+ "LBRACK",
+ "RBRACK",
+ "\"void\"",
+ "\"boolean\"",
+ "\"byte\"",
+ "\"char\"",
+ "\"short\"",
+ "\"int\"",
+ "\"float\"",
+ "\"long\"",
+ "\"double\"",
+ "IDENT",
+ "DOT",
+ "STAR",
+ "\"private\"",
+ "\"public\"",
+ "\"protected\"",
+ "\"static\"",
+ "\"transient\"",
+ "\"native\"",
+ "\"threadsafe\"",
+ "\"synchronized\"",
+ "\"volatile\"",
+ "\"class\"",
+ "\"extends\"",
+ "\"interface\"",
+ "LCURLY",
+ "RCURLY",
+ "COMMA",
+ "\"implements\"",
+ "LPAREN",
+ "RPAREN",
+ "\"this\"",
+ "\"super\"",
+ "ASSIGN",
+ "\"throws\"",
+ "COLON",
+ "\"if\"",
+ "\"else\"",
+ "\"for\"",
+ "\"while\"",
+ "\"do\"",
+ "\"break\"",
+ "\"continue\"",
+ "\"return\"",
+ "\"switch\"",
+ "\"throw\"",
+ "\"case\"",
+ "\"default\"",
+ "\"try\"",
+ "\"finally\"",
+ "\"catch\"",
+ "PLUS_ASSIGN",
+ "MINUS_ASSIGN",
+ "STAR_ASSIGN",
+ "DIV_ASSIGN",
+ "MOD_ASSIGN",
+ "SR_ASSIGN",
+ "BSR_ASSIGN",
+ "SL_ASSIGN",
+ "BAND_ASSIGN",
+ "BXOR_ASSIGN",
+ "BOR_ASSIGN",
+ "QUESTION",
+ "LOR",
+ "LAND",
+ "BOR",
+ "BXOR",
+ "BAND",
+ "NOT_EQUAL",
+ "EQUAL",
+ "LT_",
+ "GT",
+ "LE",
+ "GE",
+ "\"instanceof\"",
+ "SL",
+ "SR",
+ "BSR",
+ "PLUS",
+ "MINUS",
+ "DIV",
+ "MOD",
+ "INC",
+ "DEC",
+ "BNOT",
+ "LNOT",
+ "\"true\"",
+ "\"false\"",
+ "\"null\"",
+ "\"new\"",
+ "NUM_INT",
+ "CHAR_LITERAL",
+ "STRING_LITERAL",
+ "NUM_FLOAT",
+ "NUM_LONG",
+ "NUM_DOUBLE",
+ "WS",
+ "SL_COMMENT",
+ "ML_COMMENT",
+ "ESC",
+ "HEX_DIGIT",
+ "VOCAB",
+ "EXPONENT",
+ "FLOAT_SUFFIX",
+ 0
+};
+
+const unsigned long JavaRecognizer::_tokenSet_0_data_[] = { 0UL, 3758105472UL, 383UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// "interface"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_0(_tokenSet_0_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_1_data_[] = { 2UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_1(_tokenSet_1_data_,6);
+const unsigned long JavaRecognizer::_tokenSet_2_data_[] = { 2UL, 3758121856UL, 383UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "final" "abstract" "strictfp" SEMI "import" "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+// "class" "interface"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_2(_tokenSet_2_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_3_data_[] = { 2UL, 3758105472UL, 383UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "final" "abstract" "strictfp" SEMI "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+// "class" "interface"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_3(_tokenSet_3_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_4_data_[] = { 0UL, 67215360UL, 687616UL, 4194296UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK RBRACK IDENT LCURLY RCURLY COMMA "implements" LPAREN RPAREN
+// ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN
+// SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION
+// LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_4(_tokenSet_4_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_5_data_[] = { 0UL, 8192UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_5(_tokenSet_5_data_,6);
+const unsigned long JavaRecognizer::_tokenSet_6_data_[] = { 0UL, 3758097280UL, 63UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_6(_tokenSet_6_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_7_data_[] = { 0UL, 134086656UL, 320UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT "class" "interface"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_7(_tokenSet_7_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_8_data_[] = { 2UL, 3892192128UL, 4294027135UL, 3221225473UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+// "class" "interface" LCURLY RCURLY LPAREN "this" "super" "if" "else"
+// "for" "while" "do" "break" "continue" "return" "switch" "throw" "case"
+// "default" "try" PLUS MINUS INC DEC BNOT LNOT "true" "false" "null" "new"
+// NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_8(_tokenSet_8_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_9_data_[] = { 2UL, 3892192128UL, 1919UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+// "class" "interface" LCURLY RCURLY
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_9(_tokenSet_9_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_10_data_[] = { 0UL, 67182592UL, 674816UL, 4194296UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK IDENT RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_10(_tokenSet_10_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_11_data_[] = { 0UL, 201433088UL, 683008UL, 4194296UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK RBRACK IDENT DOT RCURLY COMMA LPAREN RPAREN ASSIGN COLON
+// PLUS_ASSIGN MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN
+// BSR_ASSIGN SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION LOR
+// LAND BOR BXOR BAND NOT_EQUAL EQUAL
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_11(_tokenSet_11_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_12_data_[] = { 0UL, 32768UL, 8192UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LBRACK LPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_12(_tokenSet_12_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_13_data_[] = { 0UL, 3892183936UL, 383UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// "interface"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_13(_tokenSet_13_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_14_data_[] = { 0UL, 0UL, 4608UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LCURLY "implements"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_14(_tokenSet_14_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_15_data_[] = { 0UL, 0UL, 512UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LCURLY
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_15(_tokenSet_15_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_16_data_[] = { 2UL, 4294943616UL, 4294700927UL, 4294967289UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF "final" "abstract" "strictfp" SEMI LBRACK RBRACK "void" "boolean"
+// "byte" "char" "short" "int" "float" "long" "double" IDENT DOT STAR "private"
+// "public" "protected" "static" "transient" "native" "threadsafe" "synchronized"
+// "volatile" "class" "interface" LCURLY RCURLY COMMA LPAREN RPAREN "this"
+// "super" ASSIGN COLON "if" "else" "for" "while" "do" "break" "continue"
+// "return" "switch" "throw" "case" "default" "try" PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS DIV MOD INC DEC BNOT
+// LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_16(_tokenSet_16_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_17_data_[] = { 0UL, 4026434432UL, 8575UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" LBRACK "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT DOT "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+// "class" "interface" LPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_17(_tokenSet_17_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_18_data_[] = { 0UL, 201359360UL, 0UL, 0UL, 0UL, 0UL };
+// LBRACK IDENT DOT
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_18(_tokenSet_18_data_,6);
+const unsigned long JavaRecognizer::_tokenSet_19_data_[] = { 0UL, 40960UL, 133120UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK COMMA ASSIGN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_19(_tokenSet_19_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_20_data_[] = { 0UL, 3892192128UL, 1919UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// "interface" LCURLY RCURLY
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_20(_tokenSet_20_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_21_data_[] = { 0UL, 3892192128UL, 1070704255UL, 3221225473UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// LCURLY RCURLY LPAREN "this" "super" "if" "for" "while" "do" "break"
+// "continue" "return" "switch" "throw" "try" PLUS MINUS INC DEC BNOT LNOT
+// "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT
+// NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_21(_tokenSet_21_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_22_data_[] = { 0UL, 4294878080UL, 1071359871UL, 4294967289UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI LBRACK "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT DOT STAR "private" "public"
+// "protected" "static" "transient" "native" "threadsafe" "synchronized"
+// "volatile" "class" "interface" LCURLY RCURLY LPAREN "this" "super" ASSIGN
+// COLON "if" "for" "while" "do" "break" "continue" "return" "switch" "throw"
+// "try" PLUS_ASSIGN MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN
+// BSR_ASSIGN SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION LOR
+// LAND BOR BXOR BAND NOT_EQUAL EQUAL LT_ GT LE GE "instanceof" SL SR BSR
+// PLUS MINUS DIV MOD INC DEC BNOT LNOT "true" "false" "null" "new" NUM_INT
+// CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_22(_tokenSet_22_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_23_data_[] = { 0UL, 3892192128UL, 1070703231UL, 3221225473UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// LCURLY LPAREN "this" "super" "if" "for" "while" "do" "break" "continue"
+// "return" "switch" "throw" "try" PLUS MINUS INC DEC BNOT LNOT "true"
+// "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG
+// NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_23(_tokenSet_23_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_24_data_[] = { 0UL, 0UL, 16384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// RPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_24(_tokenSet_24_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_25_data_[] = { 0UL, 8192UL, 412160UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LCURLY COMMA RPAREN ASSIGN "throws"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_25(_tokenSet_25_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_26_data_[] = { 0UL, 8192UL, 512UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LCURLY
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_26(_tokenSet_26_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_27_data_[] = { 0UL, 3892192128UL, 4294027135UL, 3221225479UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// "interface" LCURLY RCURLY LPAREN "this" "super" "if" "else" "for" "while"
+// "do" "break" "continue" "return" "switch" "throw" "case" "default" "try"
+// "finally" "catch" PLUS MINUS INC DEC BNOT LNOT "true" "false" "null"
+// "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_27(_tokenSet_27_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_28_data_[] = { 0UL, 3892192128UL, 4294026879UL, 3221225473UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// LCURLY RCURLY LPAREN "this" "super" "if" "else" "for" "while" "do" "break"
+// "continue" "return" "switch" "throw" "case" "default" "try" PLUS MINUS
+// INC DEC BNOT LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_28(_tokenSet_28_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_29_data_[] = { 0UL, 4294878080UL, 4294682495UL, 4294967295UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI LBRACK "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT DOT STAR "private" "public"
+// "protected" "static" "transient" "native" "threadsafe" "synchronized"
+// "volatile" "class" "interface" LCURLY RCURLY LPAREN "this" "super" ASSIGN
+// COLON "if" "else" "for" "while" "do" "break" "continue" "return" "switch"
+// "throw" "case" "default" "try" "finally" "catch" PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS DIV MOD INC DEC BNOT
+// LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_29(_tokenSet_29_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_30_data_[] = { 0UL, 3892183936UL, 63UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_30(_tokenSet_30_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_31_data_[] = { 0UL, 4026434432UL, 63UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" LBRACK "void" "boolean" "byte" "char"
+// "short" "int" "float" "long" "double" IDENT DOT "private" "public" "protected"
+// "static" "transient" "native" "threadsafe" "synchronized" "volatile"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_31(_tokenSet_31_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_32_data_[] = { 0UL, 134086656UL, 106496UL, 3221225472UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT LPAREN "this" "super" PLUS MINUS INC DEC BNOT LNOT "true" "false"
+// "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG
+// NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_32(_tokenSet_32_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_33_data_[] = { 0UL, 536780800UL, 237568UL, 4294967288UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK "void" "boolean" "byte" "char" "short" "int" "float" "long"
+// "double" IDENT DOT STAR LPAREN "this" "super" ASSIGN PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS DIV MOD INC DEC BNOT
+// LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_33(_tokenSet_33_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_34_data_[] = { 0UL, 3758097280UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_34(_tokenSet_34_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_35_data_[] = { 0UL, 3825206144UL, 127UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_35(_tokenSet_35_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_36_data_[] = { 0UL, 8192UL, 2048UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI COMMA
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_36(_tokenSet_36_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_37_data_[] = { 0UL, 8192UL, 3072UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RCURLY COMMA
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_37(_tokenSet_37_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_38_data_[] = { 0UL, 134086656UL, 107008UL, 3221225472UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT LCURLY LPAREN "this" "super" PLUS MINUS INC DEC BNOT LNOT "true"
+// "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG
+// NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_38(_tokenSet_38_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_39_data_[] = { 0UL, 402759680UL, 674816UL, 4294967288UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK RBRACK DOT STAR RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN
+// MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN
+// SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR
+// BAND NOT_EQUAL EQUAL LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS
+// DIV MOD INC DEC
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_39(_tokenSet_39_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_40_data_[] = { 0UL, 73728UL, 543744UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN COLON
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_40(_tokenSet_40_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_41_data_[] = { 0UL, 0UL, 18432UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// COMMA RPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_41(_tokenSet_41_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_42_data_[] = { 0UL, 134086656UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_42(_tokenSet_42_data_,6);
+const unsigned long JavaRecognizer::_tokenSet_43_data_[] = { 0UL, 536780800UL, 239616UL, 4294967288UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK "void" "boolean" "byte" "char" "short" "int" "float" "long"
+// "double" IDENT DOT STAR COMMA LPAREN "this" "super" ASSIGN PLUS_ASSIGN
+// MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN
+// SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR
+// BAND NOT_EQUAL EQUAL LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS
+// DIV MOD INC DEC BNOT LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL
+// STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_43(_tokenSet_43_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_44_data_[] = { 0UL, 134086656UL, 630784UL, 3221225472UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT LPAREN "this" "super" COLON PLUS MINUS INC DEC BNOT LNOT "true"
+// "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG
+// NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_44(_tokenSet_44_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_45_data_[] = { 0UL, 0UL, 3221226496UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// RCURLY "case" "default"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_45(_tokenSet_45_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_46_data_[] = { 0UL, 3892192128UL, 4291929727UL, 3221225473UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// LCURLY RCURLY LPAREN "this" "super" "if" "for" "while" "do" "break"
+// "continue" "return" "switch" "throw" "case" "default" "try" PLUS MINUS
+// INC DEC BNOT LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_46(_tokenSet_46_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_47_data_[] = { 0UL, 8192UL, 16384UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_47(_tokenSet_47_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_48_data_[] = { 0UL, 3892192128UL, 4294026879UL, 3221225479UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI "void" "boolean" "byte" "char" "short"
+// "int" "float" "long" "double" IDENT "private" "public" "protected" "static"
+// "transient" "native" "threadsafe" "synchronized" "volatile" "class"
+// LCURLY RCURLY LPAREN "this" "super" "if" "else" "for" "while" "do" "break"
+// "continue" "return" "switch" "throw" "case" "default" "try" "finally"
+// "catch" PLUS MINUS INC DEC BNOT LNOT "true" "false" "null" "new" NUM_INT
+// CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_48(_tokenSet_48_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_49_data_[] = { 0UL, 73728UL, 674816UL, 16376UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_49(_tokenSet_49_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_50_data_[] = { 0UL, 73728UL, 674816UL, 32760UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_50(_tokenSet_50_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_51_data_[] = { 0UL, 73728UL, 674816UL, 65528UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_51(_tokenSet_51_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_52_data_[] = { 0UL, 73728UL, 674816UL, 131064UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_52(_tokenSet_52_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_53_data_[] = { 0UL, 73728UL, 674816UL, 262136UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_53(_tokenSet_53_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_54_data_[] = { 0UL, 73728UL, 674816UL, 524280UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_54(_tokenSet_54_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_55_data_[] = { 0UL, 73728UL, 674816UL, 1048568UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_55(_tokenSet_55_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_56_data_[] = { 0UL, 73728UL, 674816UL, 4194296UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_56(_tokenSet_56_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_57_data_[] = { 0UL, 73728UL, 674816UL, 134217720UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_57(_tokenSet_57_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_58_data_[] = { 0UL, 73728UL, 674816UL, 1073741816UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_58(_tokenSet_58_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_59_data_[] = { 0UL, 268435456UL, 0UL, 0UL, 3UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// STAR DIV MOD
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_59(_tokenSet_59_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_60_data_[] = { 0UL, 73728UL, 674816UL, 4294967288UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_60(_tokenSet_60_data_,8);
+const unsigned long JavaRecognizer::_tokenSet_61_data_[] = { 0UL, 268509184UL, 674816UL, 4294967288UL, 3UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RBRACK STAR RCURLY COMMA RPAREN ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS DIV MOD
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_61(_tokenSet_61_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_62_data_[] = { 0UL, 134086656UL, 106496UL, 0UL, 65472UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT LPAREN "this" "super" "true" "false" "null" "new" NUM_INT CHAR_LITERAL
+// STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_62(_tokenSet_62_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_63_data_[] = { 0UL, 536846336UL, 781312UL, 4294967288UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK RBRACK "void" "boolean" "byte" "char" "short" "int" "float"
+// "long" "double" IDENT DOT STAR RCURLY COMMA LPAREN RPAREN "this" "super"
+// ASSIGN COLON PLUS_ASSIGN MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN
+// SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION
+// LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL LT_ GT LE GE "instanceof" SL
+// SR BSR PLUS MINUS DIV MOD INC DEC BNOT LNOT "true" "false" "null" "new"
+// NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_63(_tokenSet_63_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_64_data_[] = { 0UL, 4294943616UL, 4294700927UL, 4294967289UL, 65535UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "strictfp" SEMI LBRACK RBRACK "void" "boolean" "byte"
+// "char" "short" "int" "float" "long" "double" IDENT DOT STAR "private"
+// "public" "protected" "static" "transient" "native" "threadsafe" "synchronized"
+// "volatile" "class" "interface" LCURLY RCURLY COMMA LPAREN RPAREN "this"
+// "super" ASSIGN COLON "if" "else" "for" "while" "do" "break" "continue"
+// "return" "switch" "throw" "case" "default" "try" PLUS_ASSIGN MINUS_ASSIGN
+// STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN BSR_ASSIGN SL_ASSIGN BAND_ASSIGN
+// BXOR_ASSIGN BOR_ASSIGN QUESTION LOR LAND BOR BXOR BAND NOT_EQUAL EQUAL
+// LT_ GT LE GE "instanceof" SL SR BSR PLUS MINUS DIV MOD INC DEC BNOT
+// LNOT "true" "false" "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL
+// NUM_FLOAT NUM_LONG NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_64(_tokenSet_64_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_65_data_[] = { 0UL, 134152192UL, 106496UL, 3221225472UL, 65532UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// RBRACK "void" "boolean" "byte" "char" "short" "int" "float" "long" "double"
+// IDENT LPAREN "this" "super" PLUS MINUS INC DEC BNOT LNOT "true" "false"
+// "null" "new" NUM_INT CHAR_LITERAL STRING_LITERAL NUM_FLOAT NUM_LONG
+// NUM_DOUBLE
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_65(_tokenSet_65_data_,12);
+const unsigned long JavaRecognizer::_tokenSet_66_data_[] = { 0UL, 402759680UL, 675328UL, 4294967288UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LBRACK RBRACK DOT STAR LCURLY RCURLY COMMA RPAREN ASSIGN COLON
+// PLUS_ASSIGN MINUS_ASSIGN STAR_ASSIGN DIV_ASSIGN MOD_ASSIGN SR_ASSIGN
+// BSR_ASSIGN SL_ASSIGN BAND_ASSIGN BXOR_ASSIGN BOR_ASSIGN QUESTION LOR
+// LAND BOR BXOR BAND NOT_EQUAL EQUAL LT_ GT LE GE "instanceof" SL SR BSR
+// PLUS MINUS DIV MOD INC DEC
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaRecognizer::_tokenSet_66(_tokenSet_66_data_,12);
+
+
diff --git a/languages/java/JavaRecognizer.hpp b/languages/java/JavaRecognizer.hpp
new file mode 100644
index 00000000..e9e426b7
--- /dev/null
+++ b/languages/java/JavaRecognizer.hpp
@@ -0,0 +1,423 @@
+#ifndef INC_JavaRecognizer_hpp_
+#define INC_JavaRecognizer_hpp_
+
+#line 2 "java.g"
+
+ #include "driver.h"
+ #include "JavaAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefJavaAST(ast)->setLine( t->getLine() );\
+ RefJavaAST(ast)->setColumn( t->getColumn() ); \
+ }
+
+#line 19 "JavaRecognizer.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaRecognizer.hpp"$ */
+#include <antlr/TokenStream.hpp>
+#include <antlr/TokenBuffer.hpp>
+#include "JavaTokenTypes.hpp"
+#include <antlr/LLkParser.hpp>
+
+/** Java 1.3 Recognizer
+ *
+ * Run 'java Main [-showtree] directory-full-of-java-files'
+ *
+ * [The -showtree option pops up a Swing frame that shows
+ * the AST constructed from the parser.]
+ *
+ * Run 'java Main <directory full of java files>'
+ *
+ * Contributing authors:
+ * John Mitchell johnm@non.net
+ * Terence Parr parrt@magelang.com
+ * John Lilley jlilley@empathy.com
+ * Scott Stanchfield thetick@magelang.com
+ * Markus Mohnen mohnen@informatik.rwth-aachen.de
+ * Peter Williams pete.williams@sun.com
+ * Allan Jacobs Allan.Jacobs@eng.sun.com
+ * Steve Messick messick@redhills.com
+ * John Pybus john@pybus.org
+ *
+ * Version 1.00 December 9, 1997 -- initial release
+ * Version 1.01 December 10, 1997
+ * fixed bug in octal def (0..7 not 0..8)
+ * Version 1.10 August 1998 (parrt)
+ * added tree construction
+ * fixed definition of WS,comments for mac,pc,unix newlines
+ * added unary plus
+ * Version 1.11 (Nov 20, 1998)
+ * Added "shutup" option to turn off last ambig warning.
+ * Fixed inner class def to allow named class defs as statements
+ * synchronized requires compound not simple statement
+ * add [] after builtInType DOT class in primaryExpression
+ * "const" is reserved but not valid..removed from modifiers
+ * Version 1.12 (Feb 2, 1999)
+ * Changed LITERAL_xxx to xxx in tree grammar.
+ * Updated java.g to use tokens {...} now for 2.6.0 (new feature).
+ *
+ * Version 1.13 (Apr 23, 1999)
+ * Didn't have (stat)? for else clause in tree parser.
+ * Didn't gen ASTs for interface extends. Updated tree parser too.
+ * Updated to 2.6.0.
+ * Version 1.14 (Jun 20, 1999)
+ * Allowed final/abstract on local classes.
+ * Removed local interfaces from methods
+ * Put instanceof precedence where it belongs...in relationalExpr
+ * It also had expr not type as arg; fixed it.
+ * Missing ! on SEMI in classBlock
+ * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus).
+ * fixed: didn't like Object[].class in parser or tree parser
+ * Version 1.15 (Jun 26, 1999)
+ * Screwed up rule with instanceof in it. :( Fixed.
+ * Tree parser didn't like (expr).something; fixed.
+ * Allowed multiple inheritance in tree grammar. oops.
+ * Version 1.16 (August 22, 1999)
+ * Extending an interface built a wacky tree: had extra EXTENDS.
+ * Tree grammar didn't allow multiple superinterfaces.
+ * Tree grammar didn't allow empty var initializer: {}
+ * Version 1.17 (October 12, 1999)
+ * ESC lexer rule allowed 399 max not 377 max.
+ * java.tree.g didn't handle the expression of synchronized
+ * statements.
+ * Version 1.18 (August 12, 2001)
+ * Terence updated to Java 2 Version 1.3 by
+ * observing/combining work of Allan Jacobs and Steve
+ * Messick. Handles 1.3 src. Summary:
+ * o primary didn't include boolean.class kind of thing
+ * o constructor calls parsed explicitly now:
+ * see explicitConstructorInvocation
+ * o add strictfp modifier
+ * o missing objBlock after new expression in tree grammar
+ * o merged local class definition alternatives, moved after declaration
+ * o fixed problem with ClassName.super.field
+ * o reordered some alternatives to make things more efficient
+ * o long and double constants were not differentiated from int/float
+ * o whitespace rule was inefficient: matched only one char
+ * o add an examples directory with some nasty 1.3 cases
+ * o made Main.java use buffered IO and a Reader for Unicode support
+ * o supports UNICODE?
+ * Using Unicode charVocabulay makes code file big, but only
+ * in the bitsets at the end. I need to make ANTLR generate
+ * unicode bitsets more efficiently.
+ * Version 1.19 (April 25, 2002)
+ * Terence added in nice fixes by John Pybus concerning floating
+ * constants and problems with super() calls. John did a nice
+ * reorg of the primary/postfix expression stuff to read better
+ * and makes f.g.super() parse properly (it was METHOD_CALL not
+ * a SUPER_CTOR_CALL). Also:
+ *
+ * o "finally" clause was a root...made it a child of "try"
+ * o Added stuff for asserts too for Java 1.4, but *commented out*
+ * as it is not backward compatible.
+ *
+ * Version 1.20 (October 27, 2002)
+ *
+ * Terence ended up reorging John Pybus' stuff to
+ * remove some nondeterminisms and some syntactic predicates.
+ * Note that the grammar is stricter now; e.g., this(...) must
+ * be the first statement.
+ *
+ * Trinary ?: operator wasn't working as array name:
+ * (isBig ? bigDigits : digits)[i];
+ *
+ * Checked parser/tree parser on source for
+ * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4,
+ * and the 110k-line jGuru server source.
+ *
+ * Version tracking now done with following ID:
+ *
+ * $Id$
+ *
+ * This grammar is in the PUBLIC DOMAIN
+ */
+class CUSTOM_API JavaRecognizer : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public JavaTokenTypes
+{
+#line 154 "java.g"
+
+private:
+ Driver* m_driver;
+
+public:
+ void setDriver( Driver* d ) { m_driver = d; }
+ void setFileName( const QString& fileName ) { m_driver->currentFileName() = fileName; }
+
+ void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) );
+ }
+
+ void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(errorMessage.c_str()), LT(1)->getLine(), LT(1)->getColumn()) );
+ }
+
+ void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(message.c_str()), LT(1)->getLine(), LT(1)->getColumn()) );
+ }
+#line 142 "JavaRecognizer.hpp"
+public:
+ void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+protected:
+ JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k);
+public:
+ JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf);
+protected:
+ JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k);
+public:
+ JavaRecognizer(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer);
+ JavaRecognizer(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state);
+ int getNumTokens() const
+ {
+ return JavaRecognizer::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return JavaRecognizer::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return JavaRecognizer::tokenNames;
+ }
+ public: void compilationUnit();
+ public: void packageDefinition();
+ public: void importDefinition();
+ public: void typeDefinition();
+ public: void identifier();
+ public: void identifierStar();
+ public: void modifiers();
+ public: void classDefinition(
+ RefJavaAST modifiers
+ );
+ public: void interfaceDefinition(
+ RefJavaAST modifiers
+ );
+ public: void declaration();
+ public: void typeSpec(
+ bool addImagNode
+ );
+ public: void variableDefinitions(
+ RefJavaAST mods, RefJavaAST t
+ );
+ public: void classTypeSpec(
+ bool addImagNode
+ );
+ public: void builtInTypeSpec(
+ bool addImagNode
+ );
+ public: void builtInType();
+ public: void type();
+ public: void modifier();
+ public: void superClassClause();
+ public: void implementsClause();
+ public: void classBlock();
+ public: void interfaceExtends();
+ public: void field();
+ public: void ctorHead();
+ public: void constructorBody();
+ public: void parameterDeclarationList();
+ public: void declaratorBrackets(
+ RefJavaAST typ
+ );
+ public: void throwsClause();
+ public: void compoundStatement();
+ public: void explicitConstructorInvocation();
+ public: void statement();
+ public: void argList();
+ public: void variableDeclarator(
+ RefJavaAST mods, RefJavaAST t
+ );
+ public: void varInitializer();
+ public: void initializer();
+ public: void arrayInitializer();
+ public: void expression();
+ public: void parameterDeclaration();
+ public: void parameterModifier();
+ public: void forInit();
+ public: void forCond();
+ public: void forIter();
+ public: void casesGroup();
+ public: void tryBlock();
+ public: void aCase();
+ public: void caseSList();
+ public: void expressionList();
+ public: void handler();
+ public: void finallyClause();
+ public: void assignmentExpression();
+ public: void conditionalExpression();
+ public: void logicalOrExpression();
+ public: void logicalAndExpression();
+ public: void inclusiveOrExpression();
+ public: void exclusiveOrExpression();
+ public: void andExpression();
+ public: void equalityExpression();
+ public: void relationalExpression();
+ public: void shiftExpression();
+ public: void additiveExpression();
+ public: void multiplicativeExpression();
+ public: void unaryExpression();
+ public: void unaryExpressionNotPlusMinus();
+ public: void postfixExpression();
+ public: void primaryExpression();
+ public: void newExpression();
+ public: void identPrimary();
+ public: void constant();
+ public: void newArrayDeclarator();
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefJavaAST returnAST;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 152;
+#else
+ enum {
+ NUM_TOKENS = 152
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+ static const unsigned long _tokenSet_5_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
+ static const unsigned long _tokenSet_6_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
+ static const unsigned long _tokenSet_7_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7;
+ static const unsigned long _tokenSet_8_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8;
+ static const unsigned long _tokenSet_9_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9;
+ static const unsigned long _tokenSet_10_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10;
+ static const unsigned long _tokenSet_11_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11;
+ static const unsigned long _tokenSet_12_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12;
+ static const unsigned long _tokenSet_13_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13;
+ static const unsigned long _tokenSet_14_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14;
+ static const unsigned long _tokenSet_15_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15;
+ static const unsigned long _tokenSet_16_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16;
+ static const unsigned long _tokenSet_17_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17;
+ static const unsigned long _tokenSet_18_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18;
+ static const unsigned long _tokenSet_19_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19;
+ static const unsigned long _tokenSet_20_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20;
+ static const unsigned long _tokenSet_21_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21;
+ static const unsigned long _tokenSet_22_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22;
+ static const unsigned long _tokenSet_23_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23;
+ static const unsigned long _tokenSet_24_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24;
+ static const unsigned long _tokenSet_25_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25;
+ static const unsigned long _tokenSet_26_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26;
+ static const unsigned long _tokenSet_27_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27;
+ static const unsigned long _tokenSet_28_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28;
+ static const unsigned long _tokenSet_29_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29;
+ static const unsigned long _tokenSet_30_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30;
+ static const unsigned long _tokenSet_31_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_31;
+ static const unsigned long _tokenSet_32_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_32;
+ static const unsigned long _tokenSet_33_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_33;
+ static const unsigned long _tokenSet_34_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_34;
+ static const unsigned long _tokenSet_35_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_35;
+ static const unsigned long _tokenSet_36_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_36;
+ static const unsigned long _tokenSet_37_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_37;
+ static const unsigned long _tokenSet_38_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_38;
+ static const unsigned long _tokenSet_39_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_39;
+ static const unsigned long _tokenSet_40_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_40;
+ static const unsigned long _tokenSet_41_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_41;
+ static const unsigned long _tokenSet_42_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_42;
+ static const unsigned long _tokenSet_43_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_43;
+ static const unsigned long _tokenSet_44_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_44;
+ static const unsigned long _tokenSet_45_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_45;
+ static const unsigned long _tokenSet_46_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_46;
+ static const unsigned long _tokenSet_47_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_47;
+ static const unsigned long _tokenSet_48_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_48;
+ static const unsigned long _tokenSet_49_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_49;
+ static const unsigned long _tokenSet_50_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_50;
+ static const unsigned long _tokenSet_51_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_51;
+ static const unsigned long _tokenSet_52_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_52;
+ static const unsigned long _tokenSet_53_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_53;
+ static const unsigned long _tokenSet_54_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_54;
+ static const unsigned long _tokenSet_55_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_55;
+ static const unsigned long _tokenSet_56_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_56;
+ static const unsigned long _tokenSet_57_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_57;
+ static const unsigned long _tokenSet_58_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_58;
+ static const unsigned long _tokenSet_59_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_59;
+ static const unsigned long _tokenSet_60_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_60;
+ static const unsigned long _tokenSet_61_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_61;
+ static const unsigned long _tokenSet_62_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_62;
+ static const unsigned long _tokenSet_63_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_63;
+ static const unsigned long _tokenSet_64_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_64;
+ static const unsigned long _tokenSet_65_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_65;
+ static const unsigned long _tokenSet_66_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_66;
+};
+
+#endif /*INC_JavaRecognizer_hpp_*/
diff --git a/languages/java/JavaStoreWalker.cpp b/languages/java/JavaStoreWalker.cpp
new file mode 100644
index 00000000..b442aafd
--- /dev/null
+++ b/languages/java/JavaStoreWalker.cpp
@@ -0,0 +1,3441 @@
+/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.cpp"$ */
+#include "JavaStoreWalker.hpp"
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/BitSet.hpp>
+#line 1 "java.store.g"
+#line 11 "JavaStoreWalker.cpp"
+JavaStoreWalker::JavaStoreWalker()
+ : ANTLR_USE_NAMESPACE(antlr)TreeParser() {
+}
+
+void JavaStoreWalker::compilationUnit(RefJavaAST _t) {
+ RefJavaAST compilationUnit_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 75 "java.store.g"
+ QString package; QString imp; QStringList imports;
+#line 20 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+#line 76 "java.store.g"
+ init();
+#line 25 "JavaStoreWalker.cpp"
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKAGE_DEF:
+ {
+ package=packageDefinition(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ case CLASS_DEF:
+ case INTERFACE_DEF:
+ case IMPORT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IMPORT)) {
+ imp=importDefinition(_t);
+ _t = _retTree;
+#line 78 "java.store.g"
+ imports << imp;
+#line 58 "JavaStoreWalker.cpp"
+ }
+ else {
+ goto _loop4;
+ }
+
+ }
+ _loop4:;
+ } // ( ... )*
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == CLASS_DEF || _t->getType() == INTERFACE_DEF)) {
+ typeDefinition(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop6;
+ }
+
+ }
+ _loop6:;
+ } // ( ... )*
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+ QString JavaStoreWalker::packageDefinition(RefJavaAST _t) {
+#line 82 "java.store.g"
+ QString id ;
+#line 94 "JavaStoreWalker.cpp"
+ RefJavaAST packageDefinition_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t8 = _t;
+ RefJavaAST tmp1_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKAGE_DEF);
+ _t = _t->getFirstChild();
+ id=identifier(_t);
+ _t = _retTree;
+ _t = __t8;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return id ;
+}
+
+ QString JavaStoreWalker::importDefinition(RefJavaAST _t) {
+#line 86 "java.store.g"
+ QString id ;
+#line 119 "JavaStoreWalker.cpp"
+ RefJavaAST importDefinition_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t10 = _t;
+ RefJavaAST tmp2_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IMPORT);
+ _t = _t->getFirstChild();
+ id=identifierStar(_t);
+ _t = _retTree;
+ _t = __t10;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return id ;
+}
+
+void JavaStoreWalker::typeDefinition(RefJavaAST _t) {
+ RefJavaAST typeDefinition_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 90 "java.store.g"
+ QStringList bases; QString className; ClassDom klass; QStringList m;
+#line 145 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CLASS_DEF:
+ {
+ RefJavaAST __t12 = _t;
+ RefJavaAST tmp3_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CLASS_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ RefJavaAST tmp4_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 92 "java.store.g"
+
+ klass = m_model->create<ClassModel>();
+ QString name = QString::fromUtf8( tmp4_AST_in->getText().c_str(), tmp4_AST_in->getText().length() );
+ QStringList path = QStringList::split( ".", name );
+ className = path.back();
+
+ klass->setName( path.back() );
+ klass->setScope( m_currentScope );
+ klass->setStartPosition( tmp4_AST_in->getLine(), tmp4_AST_in->getColumn() );
+ /// @todo klass->setEndPositon()
+
+ klass->setFileName( m_file->name() );
+ if( m_currentClass.top() )
+ m_currentClass.top()->addClass( klass );
+ else
+ m_file->addClass( klass );
+
+#line 180 "JavaStoreWalker.cpp"
+ bases=extendsClause(_t);
+ _t = _retTree;
+#line 110 "java.store.g"
+
+ for( QStringList::Iterator it = bases.begin(); it != bases.end(); ++it )
+ klass->addBaseClass( *it );
+
+#line 188 "JavaStoreWalker.cpp"
+ implementsClause(_t);
+ _t = _retTree;
+#line 115 "java.store.g"
+
+ m_currentClass.push( klass );
+ m_currentScope.push_back( className );
+
+#line 196 "JavaStoreWalker.cpp"
+ objBlock(_t,klass);
+ _t = _retTree;
+#line 120 "java.store.g"
+
+ m_currentClass.pop();
+ m_currentScope.pop_back();
+
+#line 204 "JavaStoreWalker.cpp"
+ _t = __t12;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INTERFACE_DEF:
+ {
+ RefJavaAST __t13 = _t;
+ RefJavaAST tmp5_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INTERFACE_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ RefJavaAST tmp6_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 126 "java.store.g"
+
+ klass = m_model->create<ClassModel>();
+ QString name = QString::fromUtf8( tmp6_AST_in->getText().c_str(), tmp6_AST_in->getText().length() );
+ QStringList path = QStringList::split( ".", name );
+ className = path.back();
+
+ klass->setName( path.back() );
+ klass->setScope( m_currentScope );
+ klass->setStartPosition( tmp6_AST_in->getLine(), tmp6_AST_in->getColumn() );
+ /// @todo klass->setEndPositon()
+
+ klass->setFileName( m_file->name() );
+
+ if( m_currentClass.top() )
+ m_currentClass.top()->addClass( klass );
+ else
+ m_file->addClass( klass );
+
+#line 239 "JavaStoreWalker.cpp"
+ bases=extendsClause(_t);
+ _t = _retTree;
+#line 145 "java.store.g"
+
+ m_currentClass.push( klass );
+ m_currentScope.push_back( className );
+
+#line 247 "JavaStoreWalker.cpp"
+ interfaceBlock(_t,klass);
+ _t = _retTree;
+#line 150 "java.store.g"
+
+ m_currentClass.pop();
+ m_currentScope.pop_back();
+
+#line 255 "JavaStoreWalker.cpp"
+ _t = __t13;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+ QString JavaStoreWalker::identifier(RefJavaAST _t) {
+#line 363 "java.store.g"
+ QString id ;
+#line 277 "JavaStoreWalker.cpp"
+ RefJavaAST identifier_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp7_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 364 "java.store.g"
+
+ id = tmp7_AST_in->getText().c_str();
+
+#line 293 "JavaStoreWalker.cpp"
+ break;
+ }
+ case DOT:
+ {
+ RefJavaAST __t74 = _t;
+ RefJavaAST tmp8_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ id=identifier(_t);
+ _t = _retTree;
+ RefJavaAST tmp9_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ _t = __t74;
+ _t = _t->getNextSibling();
+#line 367 "java.store.g"
+
+ id += QString(".") + tmp9_AST_in->getText().c_str();
+
+#line 313 "JavaStoreWalker.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return id ;
+}
+
+ QString JavaStoreWalker::identifierStar(RefJavaAST _t) {
+#line 372 "java.store.g"
+ QString id ;
+#line 334 "JavaStoreWalker.cpp"
+ RefJavaAST identifierStar_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp10_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 373 "java.store.g"
+
+ id = tmp10_AST_in->getText().c_str();
+
+#line 350 "JavaStoreWalker.cpp"
+ break;
+ }
+ case DOT:
+ {
+ RefJavaAST __t76 = _t;
+ RefJavaAST tmp11_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ id=identifier(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case STAR:
+ {
+ RefJavaAST tmp12_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR);
+ _t = _t->getNextSibling();
+#line 376 "java.store.g"
+ id += QString(".") + tmp12_AST_in->getText().c_str();
+#line 372 "JavaStoreWalker.cpp"
+ break;
+ }
+ case IDENT:
+ {
+ RefJavaAST tmp13_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 377 "java.store.g"
+ id += QString(".") + tmp13_AST_in->getText().c_str();
+#line 382 "JavaStoreWalker.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t76;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return id ;
+}
+
+ QStringList JavaStoreWalker::modifiers(RefJavaAST _t) {
+#line 183 "java.store.g"
+ QStringList l ;
+#line 413 "JavaStoreWalker.cpp"
+ RefJavaAST modifiers_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefJavaAST m = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefJavaAST __t21 = _t;
+ RefJavaAST tmp14_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MODIFIERS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_0.member(_t->getType()))) {
+ m = (_t == ASTNULL) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ modifier(_t);
+ _t = _retTree;
+#line 184 "java.store.g"
+ l << m->getText().c_str();
+#line 432 "JavaStoreWalker.cpp"
+ }
+ else {
+ goto _loop23;
+ }
+
+ }
+ _loop23:;
+ } // ( ... )*
+ _t = __t21;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return l ;
+}
+
+ QStringList JavaStoreWalker::extendsClause(RefJavaAST _t) {
+#line 202 "java.store.g"
+ QStringList l ;
+#line 456 "JavaStoreWalker.cpp"
+ RefJavaAST extendsClause_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 202 "java.store.g"
+ QString id;
+#line 460 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t26 = _t;
+ RefJavaAST tmp15_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXTENDS_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENT || _t->getType() == DOT)) {
+ id=identifier(_t);
+ _t = _retTree;
+#line 203 "java.store.g"
+ l << id;
+#line 476 "JavaStoreWalker.cpp"
+ }
+ else {
+ goto _loop28;
+ }
+
+ }
+ _loop28:;
+ } // ( ... )*
+ _t = __t26;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return l ;
+}
+
+ QStringList JavaStoreWalker::implementsClause(RefJavaAST _t) {
+#line 206 "java.store.g"
+ QStringList l ;
+#line 500 "JavaStoreWalker.cpp"
+ RefJavaAST implementsClause_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 206 "java.store.g"
+ QString id;
+#line 504 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t30 = _t;
+ RefJavaAST tmp16_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IMPLEMENTS_CLAUSE);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENT || _t->getType() == DOT)) {
+ id=identifier(_t);
+ _t = _retTree;
+#line 207 "java.store.g"
+ l << id;
+#line 520 "JavaStoreWalker.cpp"
+ }
+ else {
+ goto _loop32;
+ }
+
+ }
+ _loop32:;
+ } // ( ... )*
+ _t = __t30;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return l ;
+}
+
+void JavaStoreWalker::objBlock(RefJavaAST _t,
+ ClassDom klass
+) {
+ RefJavaAST objBlock_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 221 "java.store.g"
+ FunctionDom meth; VariableDom attr;
+#line 547 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t38 = _t;
+ RefJavaAST tmp17_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJBLOCK);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CTOR_DEF:
+ {
+ meth=ctorDef(_t);
+ _t = _retTree;
+#line 223 "java.store.g"
+
+ klass->addFunction( meth );
+
+#line 567 "JavaStoreWalker.cpp"
+ break;
+ }
+ case METHOD_DEF:
+ {
+ meth=methodDef(_t);
+ _t = _retTree;
+#line 226 "java.store.g"
+
+ klass->addFunction( meth );
+
+#line 578 "JavaStoreWalker.cpp"
+ break;
+ }
+ case VARIABLE_DEF:
+ {
+ attr=variableDef(_t);
+ _t = _retTree;
+#line 229 "java.store.g"
+
+ klass->addVariable( attr );
+
+#line 589 "JavaStoreWalker.cpp"
+ break;
+ }
+ case CLASS_DEF:
+ case INTERFACE_DEF:
+ {
+ typeDefinition(_t);
+ _t = _retTree;
+ break;
+ }
+ case STATIC_INIT:
+ {
+ RefJavaAST __t40 = _t;
+ RefJavaAST tmp18_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STATIC_INIT);
+ _t = _t->getFirstChild();
+ slist(_t);
+ _t = _retTree;
+ _t = __t40;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INSTANCE_INIT:
+ {
+ RefJavaAST __t41 = _t;
+ RefJavaAST tmp19_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INSTANCE_INIT);
+ _t = _t->getFirstChild();
+ slist(_t);
+ _t = _retTree;
+ _t = __t41;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ goto _loop42;
+ }
+ }
+ }
+ _loop42:;
+ } // ( ... )*
+ _t = __t38;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::interfaceBlock(RefJavaAST _t,
+ ClassDom klass
+) {
+ RefJavaAST interfaceBlock_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 210 "java.store.g"
+ FunctionDom meth; VariableDom attr;
+#line 648 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t34 = _t;
+ RefJavaAST tmp20_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OBJBLOCK);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case METHOD_DEF:
+ {
+ meth=methodDecl(_t);
+ _t = _retTree;
+#line 212 "java.store.g"
+
+
+#line 667 "JavaStoreWalker.cpp"
+ break;
+ }
+ case VARIABLE_DEF:
+ {
+ attr=variableDef(_t);
+ _t = _retTree;
+#line 215 "java.store.g"
+
+
+#line 677 "JavaStoreWalker.cpp"
+ break;
+ }
+ default:
+ {
+ goto _loop36;
+ }
+ }
+ }
+ _loop36:;
+ } // ( ... )*
+ _t = __t34;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+ QString JavaStoreWalker::typeSpec(RefJavaAST _t) {
+#line 157 "java.store.g"
+ QString tp ;
+#line 702 "JavaStoreWalker.cpp"
+ RefJavaAST typeSpec_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t15 = _t;
+ RefJavaAST tmp21_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TYPE);
+ _t = _t->getFirstChild();
+ tp=typeSpecArray(_t);
+ _t = _retTree;
+ _t = __t15;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return tp ;
+}
+
+ QString JavaStoreWalker::typeSpecArray(RefJavaAST _t) {
+#line 161 "java.store.g"
+ QString tp ;
+#line 727 "JavaStoreWalker.cpp"
+ RefJavaAST typeSpecArray_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARRAY_DECLARATOR:
+ {
+ RefJavaAST __t17 = _t;
+ RefJavaAST tmp22_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_DECLARATOR);
+ _t = _t->getFirstChild();
+ tp=typeSpecArray(_t);
+ _t = _retTree;
+ _t = __t17;
+ _t = _t->getNextSibling();
+#line 162 "java.store.g"
+ tp += "[]";
+#line 746 "JavaStoreWalker.cpp"
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ case IDENT:
+ case DOT:
+ {
+ tp=type(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return tp ;
+}
+
+ QString JavaStoreWalker::type(RefJavaAST _t) {
+#line 166 "java.store.g"
+ QString tp ;
+#line 783 "JavaStoreWalker.cpp"
+ RefJavaAST type_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ RefJavaAST b = RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ case DOT:
+ {
+ tp=identifier(_t);
+ _t = _retTree;
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ {
+ b = (_t == ASTNULL) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+ builtInType(_t);
+ _t = _retTree;
+#line 168 "java.store.g"
+ tp = b->getText().c_str();
+#line 813 "JavaStoreWalker.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return tp ;
+}
+
+void JavaStoreWalker::builtInType(RefJavaAST _t) {
+ RefJavaAST builtInType_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_void:
+ {
+ RefJavaAST tmp23_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_void);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_boolean:
+ {
+ RefJavaAST tmp24_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_boolean);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_byte:
+ {
+ RefJavaAST tmp25_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_byte);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_char:
+ {
+ RefJavaAST tmp26_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_char);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_short:
+ {
+ RefJavaAST tmp27_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_short);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_int:
+ {
+ RefJavaAST tmp28_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_int);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_float:
+ {
+ RefJavaAST tmp29_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_float);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_long:
+ {
+ RefJavaAST tmp30_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_long);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_double:
+ {
+ RefJavaAST tmp31_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_double);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::modifier(RefJavaAST _t) {
+ RefJavaAST modifier_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_private:
+ {
+ RefJavaAST tmp32_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_private);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_public:
+ {
+ RefJavaAST tmp33_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_public);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_protected:
+ {
+ RefJavaAST tmp34_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_protected);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_static:
+ {
+ RefJavaAST tmp35_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_static);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_transient:
+ {
+ RefJavaAST tmp36_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_transient);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FINAL:
+ {
+ RefJavaAST tmp37_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FINAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ABSTRACT:
+ {
+ RefJavaAST tmp38_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ABSTRACT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_native:
+ {
+ RefJavaAST tmp39_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_native);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_threadsafe:
+ {
+ RefJavaAST tmp40_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_threadsafe);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_synchronized:
+ {
+ RefJavaAST tmp41_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_synchronized);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_const:
+ {
+ RefJavaAST tmp42_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_const);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_volatile:
+ {
+ RefJavaAST tmp43_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_volatile);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+ FunctionDom JavaStoreWalker::methodDecl(RefJavaAST _t) {
+#line 257 "java.store.g"
+ FunctionDom meth ;
+#line 1023 "JavaStoreWalker.cpp"
+ RefJavaAST methodDecl_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 257 "java.store.g"
+
+ QStringList m;
+ QString tp;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+
+#line 1032 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t46 = _t;
+ RefJavaAST tmp44_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),METHOD_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ tp=typeSpec(_t);
+ _t = _retTree;
+ methodHead(_t,meth);
+ _t = _retTree;
+ _t = __t46;
+ _t = _t->getNextSibling();
+#line 264 "java.store.g"
+
+ meth->setResultType( tp );
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+
+#line 1057 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return meth ;
+}
+
+ VariableDom JavaStoreWalker::variableDef(RefJavaAST _t) {
+#line 293 "java.store.g"
+ VariableDom attr ;
+#line 1071 "JavaStoreWalker.cpp"
+ RefJavaAST variableDef_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 293 "java.store.g"
+
+ QStringList m;
+ QString tp;
+ attr = m_model->create<VariableModel>();
+ attr->setFileName( m_file->name() );
+
+#line 1080 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t51 = _t;
+ RefJavaAST tmp45_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIABLE_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ tp=typeSpec(_t);
+ _t = _retTree;
+ variableDeclarator(_t,attr);
+ _t = _retTree;
+ varInitializer(_t);
+ _t = _retTree;
+ _t = __t51;
+ _t = _t->getNextSibling();
+#line 300 "java.store.g"
+
+ attr->setType( tp );
+ if( m.contains("public") )
+ attr->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ attr->setAccess( CodeModelItem::Protected );
+ else
+ attr->setAccess( CodeModelItem::Private );
+
+ attr->setStatic( m.contains("static") );
+
+#line 1109 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return attr ;
+}
+
+ FunctionDom JavaStoreWalker::ctorDef(RefJavaAST _t) {
+#line 239 "java.store.g"
+ FunctionDom meth ;
+#line 1123 "JavaStoreWalker.cpp"
+ RefJavaAST ctorDef_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 239 "java.store.g"
+
+ QStringList m;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+
+#line 1131 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t44 = _t;
+ RefJavaAST tmp46_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CTOR_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ methodHead(_t,meth);
+ _t = _retTree;
+ slist(_t);
+ _t = _retTree;
+ _t = __t44;
+ _t = _t->getNextSibling();
+#line 247 "java.store.g"
+
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+
+#line 1155 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return meth ;
+}
+
+ FunctionDom JavaStoreWalker::methodDef(RefJavaAST _t) {
+#line 275 "java.store.g"
+ FunctionDom meth ;
+#line 1169 "JavaStoreWalker.cpp"
+ RefJavaAST methodDef_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 275 "java.store.g"
+
+ QStringList m;
+ QString tp;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+
+#line 1178 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t48 = _t;
+ RefJavaAST tmp47_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),METHOD_DEF);
+ _t = _t->getFirstChild();
+ m=modifiers(_t);
+ _t = _retTree;
+ tp=typeSpec(_t);
+ _t = _retTree;
+ methodHead(_t,meth);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SLIST:
+ {
+ slist(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t48;
+ _t = _t->getNextSibling();
+#line 282 "java.store.g"
+
+ meth->setResultType( tp );
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+
+#line 1223 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return meth ;
+}
+
+void JavaStoreWalker::slist(RefJavaAST _t) {
+ RefJavaAST slist_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t79 = _t;
+ RefJavaAST tmp48_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SLIST);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_1.member(_t->getType()))) {
+ stat(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop81;
+ }
+
+ }
+ _loop81:;
+ } // ( ... )*
+ _t = __t79;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::methodHead(RefJavaAST _t,
+ FunctionDom meth
+) {
+ RefJavaAST methodHead_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 350 "java.store.g"
+ ArgumentDom arg;
+#line 1274 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST tmp49_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ RefJavaAST __t65 = _t;
+ RefJavaAST tmp50_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARAMETERS);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == PARAMETER_DEF)) {
+ arg=parameterDef(_t);
+ _t = _retTree;
+#line 351 "java.store.g"
+ meth->addArgument(arg);
+#line 1293 "JavaStoreWalker.cpp"
+ }
+ else {
+ goto _loop67;
+ }
+
+ }
+ _loop67:;
+ } // ( ... )*
+ _t = __t65;
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_throws:
+ {
+ throwsClause(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ case SLIST:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+#line 352 "java.store.g"
+
+ meth->setName( tmp49_AST_in->getText().c_str() );
+ meth->setScope( m_currentScope );
+ meth->setStartPosition( tmp49_AST_in->getLine(), tmp49_AST_in->getColumn() );
+
+#line 1331 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::variableDeclarator(RefJavaAST _t,
+ VariableDom attr
+) {
+ RefJavaAST variableDeclarator_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp51_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+#line 329 "java.store.g"
+
+ attr->setName( tmp51_AST_in->getText().c_str() );
+ attr->setStartPosition( tmp51_AST_in->getLine(), tmp51_AST_in->getColumn() );
+
+#line 1360 "JavaStoreWalker.cpp"
+ break;
+ }
+ case LBRACK:
+ {
+ RefJavaAST tmp52_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LBRACK);
+ _t = _t->getNextSibling();
+ variableDeclarator(_t,attr);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::varInitializer(RefJavaAST _t) {
+ RefJavaAST varInitializer_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASSIGN:
+ {
+ RefJavaAST __t58 = _t;
+ RefJavaAST tmp53_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGN);
+ _t = _t->getFirstChild();
+ initializer(_t);
+ _t = _retTree;
+ _t = __t58;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+ ArgumentDom JavaStoreWalker::parameterDef(RefJavaAST _t) {
+#line 313 "java.store.g"
+ ArgumentDom arg ;
+#line 1426 "JavaStoreWalker.cpp"
+ RefJavaAST parameterDef_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+#line 313 "java.store.g"
+
+ QString tp;
+ arg = m_model->create<ArgumentModel>();
+
+#line 1433 "JavaStoreWalker.cpp"
+
+ try { // for error handling
+ RefJavaAST __t53 = _t;
+ RefJavaAST tmp54_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PARAMETER_DEF);
+ _t = _t->getFirstChild();
+ modifiers(_t);
+ _t = _retTree;
+ tp=typeSpec(_t);
+ _t = _retTree;
+ RefJavaAST tmp55_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ _t = __t53;
+ _t = _t->getNextSibling();
+#line 318 "java.store.g"
+
+ arg->setType( tp );
+ arg->setName( tmp55_AST_in->getText().c_str() );
+
+#line 1454 "JavaStoreWalker.cpp"
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+ return arg ;
+}
+
+void JavaStoreWalker::objectinitializer(RefJavaAST _t) {
+ RefJavaAST objectinitializer_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t55 = _t;
+ RefJavaAST tmp56_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INSTANCE_INIT);
+ _t = _t->getFirstChild();
+ slist(_t);
+ _t = _retTree;
+ _t = __t55;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::initializer(RefJavaAST _t) {
+ RefJavaAST initializer_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case EXPR:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case ARRAY_INIT:
+ {
+ arrayInitializer(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::expression(RefJavaAST _t) {
+ RefJavaAST expression_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t124 = _t;
+ RefJavaAST tmp57_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EXPR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t124;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::arrayInitializer(RefJavaAST _t) {
+ RefJavaAST arrayInitializer_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t61 = _t;
+ RefJavaAST tmp58_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_INIT);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == EXPR || _t->getType() == ARRAY_INIT)) {
+ initializer(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop63;
+ }
+
+ }
+ _loop63:;
+ } // ( ... )*
+ _t = __t61;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::throwsClause(RefJavaAST _t) {
+ RefJavaAST throwsClause_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t70 = _t;
+ RefJavaAST tmp59_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_throws);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENT || _t->getType() == DOT)) {
+ identifier(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop72;
+ }
+
+ }
+ _loop72:;
+ } // ( ... )*
+ _t = __t70;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::stat(RefJavaAST _t) {
+ RefJavaAST stat_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CLASS_DEF:
+ case INTERFACE_DEF:
+ {
+ typeDefinition(_t);
+ _t = _retTree;
+ break;
+ }
+ case VARIABLE_DEF:
+ {
+ variableDef(_t);
+ _t = _retTree;
+ break;
+ }
+ case EXPR:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case LABELED_STAT:
+ {
+ RefJavaAST __t83 = _t;
+ RefJavaAST tmp60_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LABELED_STAT);
+ _t = _t->getFirstChild();
+ RefJavaAST tmp61_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ stat(_t);
+ _t = _retTree;
+ _t = __t83;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_if:
+ {
+ RefJavaAST __t84 = _t;
+ RefJavaAST tmp62_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_if);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ stat(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SLIST:
+ case VARIABLE_DEF:
+ case CLASS_DEF:
+ case INTERFACE_DEF:
+ case LABELED_STAT:
+ case EXPR:
+ case EMPTY_STAT:
+ case LITERAL_synchronized:
+ case LITERAL_if:
+ case LITERAL_for:
+ case LITERAL_while:
+ case LITERAL_do:
+ case LITERAL_break:
+ case LITERAL_continue:
+ case LITERAL_return:
+ case LITERAL_switch:
+ case LITERAL_throw:
+ case LITERAL_try:
+ {
+ stat(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t84;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_for:
+ {
+ RefJavaAST __t86 = _t;
+ RefJavaAST tmp63_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_for);
+ _t = _t->getFirstChild();
+ RefJavaAST __t87 = _t;
+ RefJavaAST tmp64_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR_INIT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VARIABLE_DEF:
+ {
+ variableDef(_t);
+ _t = _retTree;
+ break;
+ }
+ case ELIST:
+ {
+ elist(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t87;
+ _t = _t->getNextSibling();
+ RefJavaAST __t89 = _t;
+ RefJavaAST tmp65_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR_CONDITION);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case EXPR:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t89;
+ _t = _t->getNextSibling();
+ RefJavaAST __t91 = _t;
+ RefJavaAST tmp66_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR_ITERATOR);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ELIST:
+ {
+ elist(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t91;
+ _t = _t->getNextSibling();
+ stat(_t);
+ _t = _retTree;
+ _t = __t86;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_while:
+ {
+ RefJavaAST __t93 = _t;
+ RefJavaAST tmp67_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_while);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ stat(_t);
+ _t = _retTree;
+ _t = __t93;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_do:
+ {
+ RefJavaAST __t94 = _t;
+ RefJavaAST tmp68_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_do);
+ _t = _t->getFirstChild();
+ stat(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t94;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_break:
+ {
+ RefJavaAST __t95 = _t;
+ RefJavaAST tmp69_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_break);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp70_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t95;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_continue:
+ {
+ RefJavaAST __t97 = _t;
+ RefJavaAST tmp71_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_continue);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp72_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t97;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_return:
+ {
+ RefJavaAST __t99 = _t;
+ RefJavaAST tmp73_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_return);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case EXPR:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t99;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_switch:
+ {
+ RefJavaAST __t101 = _t;
+ RefJavaAST tmp74_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_switch);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == CASE_GROUP)) {
+ caseGroup(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop103;
+ }
+
+ }
+ _loop103:;
+ } // ( ... )*
+ _t = __t101;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_throw:
+ {
+ RefJavaAST __t104 = _t;
+ RefJavaAST tmp75_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_throw);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ _t = __t104;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_synchronized:
+ {
+ RefJavaAST __t105 = _t;
+ RefJavaAST tmp76_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_synchronized);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ stat(_t);
+ _t = _retTree;
+ _t = __t105;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_try:
+ {
+ tryBlock(_t);
+ _t = _retTree;
+ break;
+ }
+ case SLIST:
+ {
+ slist(_t);
+ _t = _retTree;
+ break;
+ }
+ case EMPTY_STAT:
+ {
+ RefJavaAST tmp77_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EMPTY_STAT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::elist(RefJavaAST _t) {
+ RefJavaAST elist_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t120 = _t;
+ RefJavaAST tmp78_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ELIST);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == EXPR)) {
+ expression(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop122;
+ }
+
+ }
+ _loop122:;
+ } // ( ... )*
+ _t = __t120;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::caseGroup(RefJavaAST _t) {
+ RefJavaAST caseGroup_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t107 = _t;
+ RefJavaAST tmp79_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE_GROUP);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt110=0;
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_case:
+ {
+ RefJavaAST __t109 = _t;
+ RefJavaAST tmp80_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_case);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ _t = __t109;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_default:
+ {
+ RefJavaAST tmp81_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_default);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ if ( _cnt110>=1 ) { goto _loop110; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+ }
+ _cnt110++;
+ }
+ _loop110:;
+ } // ( ... )+
+ slist(_t);
+ _t = _retTree;
+ _t = __t107;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::tryBlock(RefJavaAST _t) {
+ RefJavaAST tryBlock_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t112 = _t;
+ RefJavaAST tmp82_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_try);
+ _t = _t->getFirstChild();
+ slist(_t);
+ _t = _retTree;
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == LITERAL_catch)) {
+ handler(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop114;
+ }
+
+ }
+ _loop114:;
+ } // ( ... )*
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_finally:
+ {
+ RefJavaAST __t116 = _t;
+ RefJavaAST tmp83_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_finally);
+ _t = _t->getFirstChild();
+ slist(_t);
+ _t = _retTree;
+ _t = __t116;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t112;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::handler(RefJavaAST _t) {
+ RefJavaAST handler_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t118 = _t;
+ RefJavaAST tmp84_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_catch);
+ _t = _t->getFirstChild();
+ parameterDef(_t);
+ _t = _retTree;
+ slist(_t);
+ _t = _retTree;
+ _t = __t118;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::expr(RefJavaAST _t) {
+ RefJavaAST expr_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case QUESTION:
+ {
+ RefJavaAST __t126 = _t;
+ RefJavaAST tmp85_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),QUESTION);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t126;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ASSIGN:
+ {
+ RefJavaAST __t127 = _t;
+ RefJavaAST tmp86_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t127;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PLUS_ASSIGN:
+ {
+ RefJavaAST __t128 = _t;
+ RefJavaAST tmp87_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t128;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS_ASSIGN:
+ {
+ RefJavaAST __t129 = _t;
+ RefJavaAST tmp88_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t129;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STAR_ASSIGN:
+ {
+ RefJavaAST __t130 = _t;
+ RefJavaAST tmp89_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t130;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIV_ASSIGN:
+ {
+ RefJavaAST __t131 = _t;
+ RefJavaAST tmp90_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t131;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MOD_ASSIGN:
+ {
+ RefJavaAST __t132 = _t;
+ RefJavaAST tmp91_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t132;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SR_ASSIGN:
+ {
+ RefJavaAST __t133 = _t;
+ RefJavaAST tmp92_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SR_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t133;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BSR_ASSIGN:
+ {
+ RefJavaAST __t134 = _t;
+ RefJavaAST tmp93_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BSR_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t134;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SL_ASSIGN:
+ {
+ RefJavaAST __t135 = _t;
+ RefJavaAST tmp94_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SL_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t135;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BAND_ASSIGN:
+ {
+ RefJavaAST __t136 = _t;
+ RefJavaAST tmp95_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BAND_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t136;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BXOR_ASSIGN:
+ {
+ RefJavaAST __t137 = _t;
+ RefJavaAST tmp96_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BXOR_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t137;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BOR_ASSIGN:
+ {
+ RefJavaAST __t138 = _t;
+ RefJavaAST tmp97_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOR_ASSIGN);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t138;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LOR:
+ {
+ RefJavaAST __t139 = _t;
+ RefJavaAST tmp98_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LOR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t139;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LAND:
+ {
+ RefJavaAST __t140 = _t;
+ RefJavaAST tmp99_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LAND);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t140;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BOR:
+ {
+ RefJavaAST __t141 = _t;
+ RefJavaAST tmp100_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t141;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BXOR:
+ {
+ RefJavaAST __t142 = _t;
+ RefJavaAST tmp101_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BXOR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t142;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BAND:
+ {
+ RefJavaAST __t143 = _t;
+ RefJavaAST tmp102_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BAND);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t143;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ RefJavaAST __t144 = _t;
+ RefJavaAST tmp103_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT_EQUAL);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t144;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case EQUAL:
+ {
+ RefJavaAST __t145 = _t;
+ RefJavaAST tmp104_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQUAL);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t145;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LT_:
+ {
+ RefJavaAST __t146 = _t;
+ RefJavaAST tmp105_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LT_);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t146;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GT:
+ {
+ RefJavaAST __t147 = _t;
+ RefJavaAST tmp106_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GT);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t147;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LE:
+ {
+ RefJavaAST __t148 = _t;
+ RefJavaAST tmp107_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LE);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t148;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GE:
+ {
+ RefJavaAST __t149 = _t;
+ RefJavaAST tmp108_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GE);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t149;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SL:
+ {
+ RefJavaAST __t150 = _t;
+ RefJavaAST tmp109_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SL);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t150;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SR:
+ {
+ RefJavaAST __t151 = _t;
+ RefJavaAST tmp110_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t151;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BSR:
+ {
+ RefJavaAST __t152 = _t;
+ RefJavaAST tmp111_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BSR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t152;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PLUS:
+ {
+ RefJavaAST __t153 = _t;
+ RefJavaAST tmp112_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t153;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS:
+ {
+ RefJavaAST __t154 = _t;
+ RefJavaAST tmp113_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t154;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIV:
+ {
+ RefJavaAST __t155 = _t;
+ RefJavaAST tmp114_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t155;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MOD:
+ {
+ RefJavaAST __t156 = _t;
+ RefJavaAST tmp115_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t156;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STAR:
+ {
+ RefJavaAST __t157 = _t;
+ RefJavaAST tmp116_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t157;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INC:
+ {
+ RefJavaAST __t158 = _t;
+ RefJavaAST tmp117_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INC);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t158;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DEC:
+ {
+ RefJavaAST __t159 = _t;
+ RefJavaAST tmp118_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DEC);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t159;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case POST_INC:
+ {
+ RefJavaAST __t160 = _t;
+ RefJavaAST tmp119_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),POST_INC);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t160;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case POST_DEC:
+ {
+ RefJavaAST __t161 = _t;
+ RefJavaAST tmp120_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),POST_DEC);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t161;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BNOT:
+ {
+ RefJavaAST __t162 = _t;
+ RefJavaAST tmp121_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BNOT);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t162;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LNOT:
+ {
+ RefJavaAST __t163 = _t;
+ RefJavaAST tmp122_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LNOT);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t163;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_instanceof:
+ {
+ RefJavaAST __t164 = _t;
+ RefJavaAST tmp123_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_instanceof);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t164;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case UNARY_MINUS:
+ {
+ RefJavaAST __t165 = _t;
+ RefJavaAST tmp124_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_MINUS);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t165;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case UNARY_PLUS:
+ {
+ RefJavaAST __t166 = _t;
+ RefJavaAST tmp125_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNARY_PLUS);
+ _t = _t->getFirstChild();
+ expr(_t);
+ _t = _retTree;
+ _t = __t166;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TYPE:
+ case TYPECAST:
+ case INDEX_OP:
+ case METHOD_CALL:
+ case IDENT:
+ case DOT:
+ case LITERAL_this:
+ case LITERAL_super:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ {
+ primaryExpression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::primaryExpression(RefJavaAST _t) {
+ RefJavaAST primaryExpression_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp126_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefJavaAST __t168 = _t;
+ RefJavaAST tmp127_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case TYPE:
+ case TYPECAST:
+ case INDEX_OP:
+ case POST_INC:
+ case POST_DEC:
+ case METHOD_CALL:
+ case UNARY_MINUS:
+ case UNARY_PLUS:
+ case IDENT:
+ case DOT:
+ case STAR:
+ case LITERAL_this:
+ case LITERAL_super:
+ case ASSIGN:
+ case PLUS_ASSIGN:
+ case MINUS_ASSIGN:
+ case STAR_ASSIGN:
+ case DIV_ASSIGN:
+ case MOD_ASSIGN:
+ case SR_ASSIGN:
+ case BSR_ASSIGN:
+ case SL_ASSIGN:
+ case BAND_ASSIGN:
+ case BXOR_ASSIGN:
+ case BOR_ASSIGN:
+ case QUESTION:
+ case LOR:
+ case LAND:
+ case BOR:
+ case BXOR:
+ case BAND:
+ case NOT_EQUAL:
+ case EQUAL:
+ case LT_:
+ case GT:
+ case LE:
+ case GE:
+ case LITERAL_instanceof:
+ case SL:
+ case SR:
+ case BSR:
+ case PLUS:
+ case MINUS:
+ case DIV:
+ case MOD:
+ case INC:
+ case DEC:
+ case BNOT:
+ case LNOT:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_null:
+ case LITERAL_new:
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ {
+ expr(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefJavaAST tmp128_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEX_OP:
+ {
+ arrayIndex(_t);
+ _t = _retTree;
+ break;
+ }
+ case LITERAL_this:
+ {
+ RefJavaAST tmp129_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_this);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_class:
+ {
+ RefJavaAST tmp130_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_class);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_new:
+ {
+ RefJavaAST __t171 = _t;
+ RefJavaAST tmp131_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_new);
+ _t = _t->getFirstChild();
+ RefJavaAST tmp132_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ elist(_t);
+ _t = _retTree;
+ _t = __t171;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ break;
+ }
+ case ARRAY_DECLARATOR:
+ {
+ RefJavaAST __t172 = _t;
+ RefJavaAST tmp133_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_DECLARATOR);
+ _t = _t->getFirstChild();
+ type(_t);
+ _t = _retTree;
+ _t = __t172;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_void:
+ case LITERAL_boolean:
+ case LITERAL_byte:
+ case LITERAL_char:
+ case LITERAL_short:
+ case LITERAL_int:
+ case LITERAL_float:
+ case LITERAL_long:
+ case LITERAL_double:
+ {
+ builtInType(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LITERAL_class:
+ {
+ RefJavaAST tmp134_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_class);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t168;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INDEX_OP:
+ {
+ arrayIndex(_t);
+ _t = _retTree;
+ break;
+ }
+ case METHOD_CALL:
+ {
+ RefJavaAST __t174 = _t;
+ RefJavaAST tmp135_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),METHOD_CALL);
+ _t = _t->getFirstChild();
+ primaryExpression(_t);
+ _t = _retTree;
+ elist(_t);
+ _t = _retTree;
+ _t = __t174;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TYPECAST:
+ {
+ RefJavaAST __t175 = _t;
+ RefJavaAST tmp136_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TYPECAST);
+ _t = _t->getFirstChild();
+ typeSpec(_t);
+ _t = _retTree;
+ expr(_t);
+ _t = _retTree;
+ _t = __t175;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_new:
+ {
+ newExpression(_t);
+ _t = _retTree;
+ break;
+ }
+ case NUM_INT:
+ case CHAR_LITERAL:
+ case STRING_LITERAL:
+ case NUM_FLOAT:
+ {
+ constant(_t);
+ _t = _retTree;
+ break;
+ }
+ case LITERAL_super:
+ {
+ RefJavaAST tmp137_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_super);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_true:
+ {
+ RefJavaAST tmp138_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_true);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_false:
+ {
+ RefJavaAST tmp139_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_false);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_this:
+ {
+ RefJavaAST tmp140_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_this);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LITERAL_null:
+ {
+ RefJavaAST tmp141_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_null);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case TYPE:
+ {
+ typeSpec(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::arrayIndex(RefJavaAST _t) {
+ RefJavaAST arrayIndex_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t177 = _t;
+ RefJavaAST tmp142_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INDEX_OP);
+ _t = _t->getFirstChild();
+ primaryExpression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t177;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::newExpression(RefJavaAST _t) {
+ RefJavaAST newExpression_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t180 = _t;
+ RefJavaAST tmp143_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LITERAL_new);
+ _t = _t->getFirstChild();
+ type(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARRAY_DECLARATOR:
+ {
+ newArrayDeclarator(_t);
+ _t = _retTree;
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARRAY_INIT:
+ {
+ arrayInitializer(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ break;
+ }
+ case ELIST:
+ {
+ elist(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t180;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::constant(RefJavaAST _t) {
+ RefJavaAST constant_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefJavaAST tmp144_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHAR_LITERAL:
+ {
+ RefJavaAST tmp145_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHAR_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ RefJavaAST tmp146_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STRING_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_FLOAT:
+ {
+ RefJavaAST tmp147_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_FLOAT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::newArrayDeclarator(RefJavaAST _t) {
+ RefJavaAST newArrayDeclarator_AST_in = (_t == RefJavaAST(ASTNULL)) ? RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefJavaAST __t184 = _t;
+ RefJavaAST tmp148_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY_DECLARATOR);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARRAY_DECLARATOR:
+ {
+ newArrayDeclarator(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ case EXPR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ {
+ if (_t == RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case EXPR:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t184;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefJavaAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void JavaStoreWalker::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& )
+{
+}
+const char* JavaStoreWalker::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "BLOCK",
+ "MODIFIERS",
+ "OBJBLOCK",
+ "SLIST",
+ "CTOR_DEF",
+ "METHOD_DEF",
+ "VARIABLE_DEF",
+ "INSTANCE_INIT",
+ "STATIC_INIT",
+ "TYPE",
+ "CLASS_DEF",
+ "INTERFACE_DEF",
+ "PACKAGE_DEF",
+ "ARRAY_DECLARATOR",
+ "EXTENDS_CLAUSE",
+ "IMPLEMENTS_CLAUSE",
+ "PARAMETERS",
+ "PARAMETER_DEF",
+ "LABELED_STAT",
+ "TYPECAST",
+ "INDEX_OP",
+ "POST_INC",
+ "POST_DEC",
+ "METHOD_CALL",
+ "EXPR",
+ "ARRAY_INIT",
+ "IMPORT",
+ "UNARY_MINUS",
+ "UNARY_PLUS",
+ "CASE_GROUP",
+ "ELIST",
+ "FOR_INIT",
+ "FOR_CONDITION",
+ "FOR_ITERATOR",
+ "EMPTY_STAT",
+ "\"final\"",
+ "\"abstract\"",
+ "\"strictfp\"",
+ "SUPER_CTOR_CALL",
+ "CTOR_CALL",
+ "\"package\"",
+ "SEMI",
+ "\"import\"",
+ "LBRACK",
+ "RBRACK",
+ "\"void\"",
+ "\"boolean\"",
+ "\"byte\"",
+ "\"char\"",
+ "\"short\"",
+ "\"int\"",
+ "\"float\"",
+ "\"long\"",
+ "\"double\"",
+ "IDENT",
+ "DOT",
+ "STAR",
+ "\"private\"",
+ "\"public\"",
+ "\"protected\"",
+ "\"static\"",
+ "\"transient\"",
+ "\"native\"",
+ "\"threadsafe\"",
+ "\"synchronized\"",
+ "\"volatile\"",
+ "\"class\"",
+ "\"extends\"",
+ "\"interface\"",
+ "LCURLY",
+ "RCURLY",
+ "COMMA",
+ "\"implements\"",
+ "LPAREN",
+ "RPAREN",
+ "\"this\"",
+ "\"super\"",
+ "ASSIGN",
+ "\"throws\"",
+ "COLON",
+ "\"if\"",
+ "\"else\"",
+ "\"for\"",
+ "\"while\"",
+ "\"do\"",
+ "\"break\"",
+ "\"continue\"",
+ "\"return\"",
+ "\"switch\"",
+ "\"throw\"",
+ "\"case\"",
+ "\"default\"",
+ "\"try\"",
+ "\"finally\"",
+ "\"catch\"",
+ "PLUS_ASSIGN",
+ "MINUS_ASSIGN",
+ "STAR_ASSIGN",
+ "DIV_ASSIGN",
+ "MOD_ASSIGN",
+ "SR_ASSIGN",
+ "BSR_ASSIGN",
+ "SL_ASSIGN",
+ "BAND_ASSIGN",
+ "BXOR_ASSIGN",
+ "BOR_ASSIGN",
+ "QUESTION",
+ "LOR",
+ "LAND",
+ "BOR",
+ "BXOR",
+ "BAND",
+ "NOT_EQUAL",
+ "EQUAL",
+ "LT_",
+ "GT",
+ "LE",
+ "GE",
+ "\"instanceof\"",
+ "SL",
+ "SR",
+ "BSR",
+ "PLUS",
+ "MINUS",
+ "DIV",
+ "MOD",
+ "INC",
+ "DEC",
+ "BNOT",
+ "LNOT",
+ "\"true\"",
+ "\"false\"",
+ "\"null\"",
+ "\"new\"",
+ "NUM_INT",
+ "CHAR_LITERAL",
+ "STRING_LITERAL",
+ "NUM_FLOAT",
+ "NUM_LONG",
+ "NUM_DOUBLE",
+ "WS",
+ "SL_COMMENT",
+ "ML_COMMENT",
+ "ESC",
+ "HEX_DIGIT",
+ "VOCAB",
+ "EXPONENT",
+ "FLOAT_SUFFIX",
+ "\"const\"",
+ 0
+};
+
+const unsigned long JavaStoreWalker::_tokenSet_0_data_[] = { 0UL, 3758096768UL, 63UL, 0UL, 16777216UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "final" "abstract" "private" "public" "protected" "static" "transient"
+// "native" "threadsafe" "synchronized" "volatile" "const"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaStoreWalker::_tokenSet_0(_tokenSet_0_data_,12);
+const unsigned long JavaStoreWalker::_tokenSet_1_data_[] = { 272680064UL, 64UL, 1070596112UL, 1UL, 0UL, 0UL, 0UL, 0UL };
+// SLIST VARIABLE_DEF CLASS_DEF INTERFACE_DEF LABELED_STAT EXPR EMPTY_STAT
+// "synchronized" "if" "for" "while" "do" "break" "continue" "return" "switch"
+// "throw" "try"
+const ANTLR_USE_NAMESPACE(antlr)BitSet JavaStoreWalker::_tokenSet_1(_tokenSet_1_data_,8);
+
+
diff --git a/languages/java/JavaStoreWalker.hpp b/languages/java/JavaStoreWalker.hpp
new file mode 100644
index 00000000..ed43efcc
--- /dev/null
+++ b/languages/java/JavaStoreWalker.hpp
@@ -0,0 +1,164 @@
+#ifndef INC_JavaStoreWalker_hpp_
+#define INC_JavaStoreWalker_hpp_
+
+#line 3 "java.store.g"
+
+ #include <codemodel.h>
+ #include "JavaAST.hpp"
+
+ #include <qstring.h>
+ #include <qstringlist.h>
+ #include <qvaluestack.h>
+ #include <qfileinfo.h>
+
+#line 15 "JavaStoreWalker.hpp"
+#include <antlr/config.hpp>
+#include "JavaStoreWalkerTokenTypes.hpp"
+/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.hpp"$ */
+#include <antlr/TreeParser.hpp>
+
+#line 13 "java.store.g"
+
+ #include <codemodel.h>
+
+ #include <kdebug.h>
+
+#line 27 "JavaStoreWalker.hpp"
+/** Java 1.2 AST Recognizer Grammar
+ *
+ * Author:
+ * Terence Parr parrt@magelang.com
+ *
+ * Version tracking now done with following ID:
+ *
+ * $Id$
+ *
+ * This grammar is in the PUBLIC DOMAIN
+ *
+ * BUGS
+ */
+class CUSTOM_API JavaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public JavaStoreWalkerTokenTypes
+{
+#line 43 "java.store.g"
+
+private:
+ QStringList m_currentScope;
+ CodeModel* m_model;
+ FileDom m_file;
+ QValueStack<ClassDom> m_currentClass;
+ int m_currentAccess;
+ int m_anon;
+ ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory;
+
+public:
+ void setCodeModel( CodeModel* model )
+ {
+ m_model = model;
+ }
+
+ void setFile( FileDom file )
+ {
+ m_file = file;
+ }
+
+ void init()
+ {
+ m_currentScope.clear();
+ m_currentAccess = CodeModelItem::Public;
+ m_anon = 0;
+
+ initializeASTFactory (ast_factory);
+ setASTFactory (&ast_factory);
+ }
+#line 44 "JavaStoreWalker.hpp"
+public:
+ JavaStoreWalker();
+ static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+ int getNumTokens() const
+ {
+ return JavaStoreWalker::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return JavaStoreWalker::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return JavaStoreWalker::tokenNames;
+ }
+ public: void compilationUnit(RefJavaAST _t);
+ public: QString packageDefinition(RefJavaAST _t);
+ public: QString importDefinition(RefJavaAST _t);
+ public: void typeDefinition(RefJavaAST _t);
+ public: QString identifier(RefJavaAST _t);
+ public: QString identifierStar(RefJavaAST _t);
+ public: QStringList modifiers(RefJavaAST _t);
+ public: QStringList extendsClause(RefJavaAST _t);
+ public: QStringList implementsClause(RefJavaAST _t);
+ public: void objBlock(RefJavaAST _t,
+ ClassDom klass
+ );
+ public: void interfaceBlock(RefJavaAST _t,
+ ClassDom klass
+ );
+ public: QString typeSpec(RefJavaAST _t);
+ public: QString typeSpecArray(RefJavaAST _t);
+ public: QString type(RefJavaAST _t);
+ public: void builtInType(RefJavaAST _t);
+ public: void modifier(RefJavaAST _t);
+ public: FunctionDom methodDecl(RefJavaAST _t);
+ public: VariableDom variableDef(RefJavaAST _t);
+ public: FunctionDom ctorDef(RefJavaAST _t);
+ public: FunctionDom methodDef(RefJavaAST _t);
+ public: void slist(RefJavaAST _t);
+ public: void methodHead(RefJavaAST _t,
+ FunctionDom meth
+ );
+ public: void variableDeclarator(RefJavaAST _t,
+ VariableDom attr
+ );
+ public: void varInitializer(RefJavaAST _t);
+ public: ArgumentDom parameterDef(RefJavaAST _t);
+ public: void objectinitializer(RefJavaAST _t);
+ public: void initializer(RefJavaAST _t);
+ public: void expression(RefJavaAST _t);
+ public: void arrayInitializer(RefJavaAST _t);
+ public: void throwsClause(RefJavaAST _t);
+ public: void stat(RefJavaAST _t);
+ public: void elist(RefJavaAST _t);
+ public: void caseGroup(RefJavaAST _t);
+ public: void tryBlock(RefJavaAST _t);
+ public: void handler(RefJavaAST _t);
+ public: void expr(RefJavaAST _t);
+ public: void primaryExpression(RefJavaAST _t);
+ public: void arrayIndex(RefJavaAST _t);
+ public: void newExpression(RefJavaAST _t);
+ public: void constant(RefJavaAST _t);
+ public: void newArrayDeclarator(RefJavaAST _t);
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefJavaAST returnAST;
+ RefJavaAST _retTree;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 153;
+#else
+ enum {
+ NUM_TOKENS = 153
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+};
+
+#endif /*INC_JavaStoreWalker_hpp_*/
diff --git a/languages/java/JavaStoreWalkerTokenTypes.hpp b/languages/java/JavaStoreWalkerTokenTypes.hpp
new file mode 100644
index 00000000..44322944
--- /dev/null
+++ b/languages/java/JavaStoreWalkerTokenTypes.hpp
@@ -0,0 +1,169 @@
+#ifndef INC_JavaStoreWalkerTokenTypes_hpp_
+#define INC_JavaStoreWalkerTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalkerTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API JavaStoreWalkerTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ BLOCK = 4,
+ MODIFIERS = 5,
+ OBJBLOCK = 6,
+ SLIST = 7,
+ CTOR_DEF = 8,
+ METHOD_DEF = 9,
+ VARIABLE_DEF = 10,
+ INSTANCE_INIT = 11,
+ STATIC_INIT = 12,
+ TYPE = 13,
+ CLASS_DEF = 14,
+ INTERFACE_DEF = 15,
+ PACKAGE_DEF = 16,
+ ARRAY_DECLARATOR = 17,
+ EXTENDS_CLAUSE = 18,
+ IMPLEMENTS_CLAUSE = 19,
+ PARAMETERS = 20,
+ PARAMETER_DEF = 21,
+ LABELED_STAT = 22,
+ TYPECAST = 23,
+ INDEX_OP = 24,
+ POST_INC = 25,
+ POST_DEC = 26,
+ METHOD_CALL = 27,
+ EXPR = 28,
+ ARRAY_INIT = 29,
+ IMPORT = 30,
+ UNARY_MINUS = 31,
+ UNARY_PLUS = 32,
+ CASE_GROUP = 33,
+ ELIST = 34,
+ FOR_INIT = 35,
+ FOR_CONDITION = 36,
+ FOR_ITERATOR = 37,
+ EMPTY_STAT = 38,
+ FINAL = 39,
+ ABSTRACT = 40,
+ STRICTFP = 41,
+ SUPER_CTOR_CALL = 42,
+ CTOR_CALL = 43,
+ LITERAL_package = 44,
+ SEMI = 45,
+ LITERAL_import = 46,
+ LBRACK = 47,
+ RBRACK = 48,
+ LITERAL_void = 49,
+ LITERAL_boolean = 50,
+ LITERAL_byte = 51,
+ LITERAL_char = 52,
+ LITERAL_short = 53,
+ LITERAL_int = 54,
+ LITERAL_float = 55,
+ LITERAL_long = 56,
+ LITERAL_double = 57,
+ IDENT = 58,
+ DOT = 59,
+ STAR = 60,
+ LITERAL_private = 61,
+ LITERAL_public = 62,
+ LITERAL_protected = 63,
+ LITERAL_static = 64,
+ LITERAL_transient = 65,
+ LITERAL_native = 66,
+ LITERAL_threadsafe = 67,
+ LITERAL_synchronized = 68,
+ LITERAL_volatile = 69,
+ LITERAL_class = 70,
+ LITERAL_extends = 71,
+ LITERAL_interface = 72,
+ LCURLY = 73,
+ RCURLY = 74,
+ COMMA = 75,
+ LITERAL_implements = 76,
+ LPAREN = 77,
+ RPAREN = 78,
+ LITERAL_this = 79,
+ LITERAL_super = 80,
+ ASSIGN = 81,
+ LITERAL_throws = 82,
+ COLON = 83,
+ LITERAL_if = 84,
+ LITERAL_else = 85,
+ LITERAL_for = 86,
+ LITERAL_while = 87,
+ LITERAL_do = 88,
+ LITERAL_break = 89,
+ LITERAL_continue = 90,
+ LITERAL_return = 91,
+ LITERAL_switch = 92,
+ LITERAL_throw = 93,
+ LITERAL_case = 94,
+ LITERAL_default = 95,
+ LITERAL_try = 96,
+ LITERAL_finally = 97,
+ LITERAL_catch = 98,
+ PLUS_ASSIGN = 99,
+ MINUS_ASSIGN = 100,
+ STAR_ASSIGN = 101,
+ DIV_ASSIGN = 102,
+ MOD_ASSIGN = 103,
+ SR_ASSIGN = 104,
+ BSR_ASSIGN = 105,
+ SL_ASSIGN = 106,
+ BAND_ASSIGN = 107,
+ BXOR_ASSIGN = 108,
+ BOR_ASSIGN = 109,
+ QUESTION = 110,
+ LOR = 111,
+ LAND = 112,
+ BOR = 113,
+ BXOR = 114,
+ BAND = 115,
+ NOT_EQUAL = 116,
+ EQUAL = 117,
+ LT_ = 118,
+ GT = 119,
+ LE = 120,
+ GE = 121,
+ LITERAL_instanceof = 122,
+ SL = 123,
+ SR = 124,
+ BSR = 125,
+ PLUS = 126,
+ MINUS = 127,
+ DIV = 128,
+ MOD = 129,
+ INC = 130,
+ DEC = 131,
+ BNOT = 132,
+ LNOT = 133,
+ LITERAL_true = 134,
+ LITERAL_false = 135,
+ LITERAL_null = 136,
+ LITERAL_new = 137,
+ NUM_INT = 138,
+ CHAR_LITERAL = 139,
+ STRING_LITERAL = 140,
+ NUM_FLOAT = 141,
+ NUM_LONG = 142,
+ NUM_DOUBLE = 143,
+ WS = 144,
+ SL_COMMENT = 145,
+ ML_COMMENT = 146,
+ ESC = 147,
+ HEX_DIGIT = 148,
+ VOCAB = 149,
+ EXPONENT = 150,
+ FLOAT_SUFFIX = 151,
+ LITERAL_const = 152,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_JavaStoreWalkerTokenTypes_hpp_*/
diff --git a/languages/java/JavaStoreWalkerTokenTypes.txt b/languages/java/JavaStoreWalkerTokenTypes.txt
new file mode 100644
index 00000000..c81c4b44
--- /dev/null
+++ b/languages/java/JavaStoreWalkerTokenTypes.txt
@@ -0,0 +1,151 @@
+// $ANTLR 2.7.7 (20061129): java.store.g -> JavaStoreWalkerTokenTypes.txt$
+JavaStoreWalker // output token vocab name
+BLOCK=4
+MODIFIERS=5
+OBJBLOCK=6
+SLIST=7
+CTOR_DEF=8
+METHOD_DEF=9
+VARIABLE_DEF=10
+INSTANCE_INIT=11
+STATIC_INIT=12
+TYPE=13
+CLASS_DEF=14
+INTERFACE_DEF=15
+PACKAGE_DEF=16
+ARRAY_DECLARATOR=17
+EXTENDS_CLAUSE=18
+IMPLEMENTS_CLAUSE=19
+PARAMETERS=20
+PARAMETER_DEF=21
+LABELED_STAT=22
+TYPECAST=23
+INDEX_OP=24
+POST_INC=25
+POST_DEC=26
+METHOD_CALL=27
+EXPR=28
+ARRAY_INIT=29
+IMPORT=30
+UNARY_MINUS=31
+UNARY_PLUS=32
+CASE_GROUP=33
+ELIST=34
+FOR_INIT=35
+FOR_CONDITION=36
+FOR_ITERATOR=37
+EMPTY_STAT=38
+FINAL="final"=39
+ABSTRACT="abstract"=40
+STRICTFP="strictfp"=41
+SUPER_CTOR_CALL=42
+CTOR_CALL=43
+LITERAL_package="package"=44
+SEMI=45
+LITERAL_import="import"=46
+LBRACK=47
+RBRACK=48
+LITERAL_void="void"=49
+LITERAL_boolean="boolean"=50
+LITERAL_byte="byte"=51
+LITERAL_char="char"=52
+LITERAL_short="short"=53
+LITERAL_int="int"=54
+LITERAL_float="float"=55
+LITERAL_long="long"=56
+LITERAL_double="double"=57
+IDENT=58
+DOT=59
+STAR=60
+LITERAL_private="private"=61
+LITERAL_public="public"=62
+LITERAL_protected="protected"=63
+LITERAL_static="static"=64
+LITERAL_transient="transient"=65
+LITERAL_native="native"=66
+LITERAL_threadsafe="threadsafe"=67
+LITERAL_synchronized="synchronized"=68
+LITERAL_volatile="volatile"=69
+LITERAL_class="class"=70
+LITERAL_extends="extends"=71
+LITERAL_interface="interface"=72
+LCURLY=73
+RCURLY=74
+COMMA=75
+LITERAL_implements="implements"=76
+LPAREN=77
+RPAREN=78
+LITERAL_this="this"=79
+LITERAL_super="super"=80
+ASSIGN=81
+LITERAL_throws="throws"=82
+COLON=83
+LITERAL_if="if"=84
+LITERAL_else="else"=85
+LITERAL_for="for"=86
+LITERAL_while="while"=87
+LITERAL_do="do"=88
+LITERAL_break="break"=89
+LITERAL_continue="continue"=90
+LITERAL_return="return"=91
+LITERAL_switch="switch"=92
+LITERAL_throw="throw"=93
+LITERAL_case="case"=94
+LITERAL_default="default"=95
+LITERAL_try="try"=96
+LITERAL_finally="finally"=97
+LITERAL_catch="catch"=98
+PLUS_ASSIGN=99
+MINUS_ASSIGN=100
+STAR_ASSIGN=101
+DIV_ASSIGN=102
+MOD_ASSIGN=103
+SR_ASSIGN=104
+BSR_ASSIGN=105
+SL_ASSIGN=106
+BAND_ASSIGN=107
+BXOR_ASSIGN=108
+BOR_ASSIGN=109
+QUESTION=110
+LOR=111
+LAND=112
+BOR=113
+BXOR=114
+BAND=115
+NOT_EQUAL=116
+EQUAL=117
+LT_=118
+GT=119
+LE=120
+GE=121
+LITERAL_instanceof="instanceof"=122
+SL=123
+SR=124
+BSR=125
+PLUS=126
+MINUS=127
+DIV=128
+MOD=129
+INC=130
+DEC=131
+BNOT=132
+LNOT=133
+LITERAL_true="true"=134
+LITERAL_false="false"=135
+LITERAL_null="null"=136
+LITERAL_new="new"=137
+NUM_INT=138
+CHAR_LITERAL=139
+STRING_LITERAL=140
+NUM_FLOAT=141
+NUM_LONG=142
+NUM_DOUBLE=143
+WS=144
+SL_COMMENT=145
+ML_COMMENT=146
+ESC=147
+HEX_DIGIT=148
+VOCAB=149
+EXPONENT=150
+FLOAT_SUFFIX=151
+LITERAL_const="const"=152
diff --git a/languages/java/JavaTokenTypes.hpp b/languages/java/JavaTokenTypes.hpp
new file mode 100644
index 00000000..e36fa54c
--- /dev/null
+++ b/languages/java/JavaTokenTypes.hpp
@@ -0,0 +1,168 @@
+#ifndef INC_JavaTokenTypes_hpp_
+#define INC_JavaTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20061129): "java.g" -> "JavaTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API JavaTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ BLOCK = 4,
+ MODIFIERS = 5,
+ OBJBLOCK = 6,
+ SLIST = 7,
+ CTOR_DEF = 8,
+ METHOD_DEF = 9,
+ VARIABLE_DEF = 10,
+ INSTANCE_INIT = 11,
+ STATIC_INIT = 12,
+ TYPE = 13,
+ CLASS_DEF = 14,
+ INTERFACE_DEF = 15,
+ PACKAGE_DEF = 16,
+ ARRAY_DECLARATOR = 17,
+ EXTENDS_CLAUSE = 18,
+ IMPLEMENTS_CLAUSE = 19,
+ PARAMETERS = 20,
+ PARAMETER_DEF = 21,
+ LABELED_STAT = 22,
+ TYPECAST = 23,
+ INDEX_OP = 24,
+ POST_INC = 25,
+ POST_DEC = 26,
+ METHOD_CALL = 27,
+ EXPR = 28,
+ ARRAY_INIT = 29,
+ IMPORT = 30,
+ UNARY_MINUS = 31,
+ UNARY_PLUS = 32,
+ CASE_GROUP = 33,
+ ELIST = 34,
+ FOR_INIT = 35,
+ FOR_CONDITION = 36,
+ FOR_ITERATOR = 37,
+ EMPTY_STAT = 38,
+ FINAL = 39,
+ ABSTRACT = 40,
+ STRICTFP = 41,
+ SUPER_CTOR_CALL = 42,
+ CTOR_CALL = 43,
+ LITERAL_package = 44,
+ SEMI = 45,
+ LITERAL_import = 46,
+ LBRACK = 47,
+ RBRACK = 48,
+ LITERAL_void = 49,
+ LITERAL_boolean = 50,
+ LITERAL_byte = 51,
+ LITERAL_char = 52,
+ LITERAL_short = 53,
+ LITERAL_int = 54,
+ LITERAL_float = 55,
+ LITERAL_long = 56,
+ LITERAL_double = 57,
+ IDENT = 58,
+ DOT = 59,
+ STAR = 60,
+ LITERAL_private = 61,
+ LITERAL_public = 62,
+ LITERAL_protected = 63,
+ LITERAL_static = 64,
+ LITERAL_transient = 65,
+ LITERAL_native = 66,
+ LITERAL_threadsafe = 67,
+ LITERAL_synchronized = 68,
+ LITERAL_volatile = 69,
+ LITERAL_class = 70,
+ LITERAL_extends = 71,
+ LITERAL_interface = 72,
+ LCURLY = 73,
+ RCURLY = 74,
+ COMMA = 75,
+ LITERAL_implements = 76,
+ LPAREN = 77,
+ RPAREN = 78,
+ LITERAL_this = 79,
+ LITERAL_super = 80,
+ ASSIGN = 81,
+ LITERAL_throws = 82,
+ COLON = 83,
+ LITERAL_if = 84,
+ LITERAL_else = 85,
+ LITERAL_for = 86,
+ LITERAL_while = 87,
+ LITERAL_do = 88,
+ LITERAL_break = 89,
+ LITERAL_continue = 90,
+ LITERAL_return = 91,
+ LITERAL_switch = 92,
+ LITERAL_throw = 93,
+ LITERAL_case = 94,
+ LITERAL_default = 95,
+ LITERAL_try = 96,
+ LITERAL_finally = 97,
+ LITERAL_catch = 98,
+ PLUS_ASSIGN = 99,
+ MINUS_ASSIGN = 100,
+ STAR_ASSIGN = 101,
+ DIV_ASSIGN = 102,
+ MOD_ASSIGN = 103,
+ SR_ASSIGN = 104,
+ BSR_ASSIGN = 105,
+ SL_ASSIGN = 106,
+ BAND_ASSIGN = 107,
+ BXOR_ASSIGN = 108,
+ BOR_ASSIGN = 109,
+ QUESTION = 110,
+ LOR = 111,
+ LAND = 112,
+ BOR = 113,
+ BXOR = 114,
+ BAND = 115,
+ NOT_EQUAL = 116,
+ EQUAL = 117,
+ LT_ = 118,
+ GT = 119,
+ LE = 120,
+ GE = 121,
+ LITERAL_instanceof = 122,
+ SL = 123,
+ SR = 124,
+ BSR = 125,
+ PLUS = 126,
+ MINUS = 127,
+ DIV = 128,
+ MOD = 129,
+ INC = 130,
+ DEC = 131,
+ BNOT = 132,
+ LNOT = 133,
+ LITERAL_true = 134,
+ LITERAL_false = 135,
+ LITERAL_null = 136,
+ LITERAL_new = 137,
+ NUM_INT = 138,
+ CHAR_LITERAL = 139,
+ STRING_LITERAL = 140,
+ NUM_FLOAT = 141,
+ NUM_LONG = 142,
+ NUM_DOUBLE = 143,
+ WS = 144,
+ SL_COMMENT = 145,
+ ML_COMMENT = 146,
+ ESC = 147,
+ HEX_DIGIT = 148,
+ VOCAB = 149,
+ EXPONENT = 150,
+ FLOAT_SUFFIX = 151,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_JavaTokenTypes_hpp_*/
diff --git a/languages/java/JavaTokenTypes.txt b/languages/java/JavaTokenTypes.txt
new file mode 100644
index 00000000..48ff0ca3
--- /dev/null
+++ b/languages/java/JavaTokenTypes.txt
@@ -0,0 +1,150 @@
+// $ANTLR 2.7.7 (20061129): java.g -> JavaTokenTypes.txt$
+Java // output token vocab name
+BLOCK=4
+MODIFIERS=5
+OBJBLOCK=6
+SLIST=7
+CTOR_DEF=8
+METHOD_DEF=9
+VARIABLE_DEF=10
+INSTANCE_INIT=11
+STATIC_INIT=12
+TYPE=13
+CLASS_DEF=14
+INTERFACE_DEF=15
+PACKAGE_DEF=16
+ARRAY_DECLARATOR=17
+EXTENDS_CLAUSE=18
+IMPLEMENTS_CLAUSE=19
+PARAMETERS=20
+PARAMETER_DEF=21
+LABELED_STAT=22
+TYPECAST=23
+INDEX_OP=24
+POST_INC=25
+POST_DEC=26
+METHOD_CALL=27
+EXPR=28
+ARRAY_INIT=29
+IMPORT=30
+UNARY_MINUS=31
+UNARY_PLUS=32
+CASE_GROUP=33
+ELIST=34
+FOR_INIT=35
+FOR_CONDITION=36
+FOR_ITERATOR=37
+EMPTY_STAT=38
+FINAL="final"=39
+ABSTRACT="abstract"=40
+STRICTFP="strictfp"=41
+SUPER_CTOR_CALL=42
+CTOR_CALL=43
+LITERAL_package="package"=44
+SEMI=45
+LITERAL_import="import"=46
+LBRACK=47
+RBRACK=48
+LITERAL_void="void"=49
+LITERAL_boolean="boolean"=50
+LITERAL_byte="byte"=51
+LITERAL_char="char"=52
+LITERAL_short="short"=53
+LITERAL_int="int"=54
+LITERAL_float="float"=55
+LITERAL_long="long"=56
+LITERAL_double="double"=57
+IDENT=58
+DOT=59
+STAR=60
+LITERAL_private="private"=61
+LITERAL_public="public"=62
+LITERAL_protected="protected"=63
+LITERAL_static="static"=64
+LITERAL_transient="transient"=65
+LITERAL_native="native"=66
+LITERAL_threadsafe="threadsafe"=67
+LITERAL_synchronized="synchronized"=68
+LITERAL_volatile="volatile"=69
+LITERAL_class="class"=70
+LITERAL_extends="extends"=71
+LITERAL_interface="interface"=72
+LCURLY=73
+RCURLY=74
+COMMA=75
+LITERAL_implements="implements"=76
+LPAREN=77
+RPAREN=78
+LITERAL_this="this"=79
+LITERAL_super="super"=80
+ASSIGN=81
+LITERAL_throws="throws"=82
+COLON=83
+LITERAL_if="if"=84
+LITERAL_else="else"=85
+LITERAL_for="for"=86
+LITERAL_while="while"=87
+LITERAL_do="do"=88
+LITERAL_break="break"=89
+LITERAL_continue="continue"=90
+LITERAL_return="return"=91
+LITERAL_switch="switch"=92
+LITERAL_throw="throw"=93
+LITERAL_case="case"=94
+LITERAL_default="default"=95
+LITERAL_try="try"=96
+LITERAL_finally="finally"=97
+LITERAL_catch="catch"=98
+PLUS_ASSIGN=99
+MINUS_ASSIGN=100
+STAR_ASSIGN=101
+DIV_ASSIGN=102
+MOD_ASSIGN=103
+SR_ASSIGN=104
+BSR_ASSIGN=105
+SL_ASSIGN=106
+BAND_ASSIGN=107
+BXOR_ASSIGN=108
+BOR_ASSIGN=109
+QUESTION=110
+LOR=111
+LAND=112
+BOR=113
+BXOR=114
+BAND=115
+NOT_EQUAL=116
+EQUAL=117
+LT_=118
+GT=119
+LE=120
+GE=121
+LITERAL_instanceof="instanceof"=122
+SL=123
+SR=124
+BSR=125
+PLUS=126
+MINUS=127
+DIV=128
+MOD=129
+INC=130
+DEC=131
+BNOT=132
+LNOT=133
+LITERAL_true="true"=134
+LITERAL_false="false"=135
+LITERAL_null="null"=136
+LITERAL_new="new"=137
+NUM_INT=138
+CHAR_LITERAL=139
+STRING_LITERAL=140
+NUM_FLOAT=141
+NUM_LONG=142
+NUM_DOUBLE=143
+WS=144
+SL_COMMENT=145
+ML_COMMENT=146
+ESC=147
+HEX_DIGIT=148
+VOCAB=149
+EXPONENT=150
+FLOAT_SUFFIX=151
diff --git a/languages/java/KDevJavaSupportIface.cpp b/languages/java/KDevJavaSupportIface.cpp
new file mode 100644
index 00000000..306ad76e
--- /dev/null
+++ b/languages/java/KDevJavaSupportIface.cpp
@@ -0,0 +1,24 @@
+
+#include "KDevJavaSupportIface.h"
+#include "javasupportpart.h"
+
+KDevJavaSupportIface::KDevJavaSupportIface( JavaSupportPart* javaSupport )
+ : QObject( javaSupport ), DCOPObject( "KDevJavaSupport" ), m_javaSupport( javaSupport )
+{
+}
+
+KDevJavaSupportIface::~KDevJavaSupportIface()
+{
+}
+
+void KDevJavaSupportIface::addClass()
+{
+ m_javaSupport->slotNewClass();
+}
+
+void KDevJavaSupportIface::parseProject()
+{
+ m_javaSupport->parseProject();
+}
+
+#include "KDevJavaSupportIface.moc"
diff --git a/languages/java/KDevJavaSupportIface.h b/languages/java/KDevJavaSupportIface.h
new file mode 100644
index 00000000..e0dce53f
--- /dev/null
+++ b/languages/java/KDevJavaSupportIface.h
@@ -0,0 +1,26 @@
+
+#ifndef KDEVJAVASUPPORTIFACE_H
+#define KDEVJAVASUPPORTIFACE_H
+
+#include <qobject.h>
+#include <dcopobject.h>
+
+class JavaSupportPart;
+
+class KDevJavaSupportIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+public:
+ KDevJavaSupportIface( JavaSupportPart* javaSupport );
+ ~KDevJavaSupportIface();
+
+k_dcop:
+ void addClass();
+ void parseProject();
+
+private:
+ JavaSupportPart* m_javaSupport;
+};
+
+#endif
diff --git a/languages/java/Makefile.am b/languages/java/Makefile.am
new file mode 100644
index 00000000..386f220f
--- /dev/null
+++ b/languages/java/Makefile.am
@@ -0,0 +1,37 @@
+# Here resides the Java support part.
+
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+# SUBDIRS = templates subclassing_template newclass_templates file_templates
+SUBDIRS = file_templates app_templates doc
+
+INCLUDES = -I$(top_srcdir)/lib/antlr -I$(top_srcdir)/lib/catalog \
+ -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevjavasupport.la
+libkdevjavasupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevjavasupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/antlr/src/libantlr.la $(top_builddir)/lib/catalog/libkdevcatalog.la
+
+libkdevjavasupport_la_SOURCES = JavaLexer.cpp KDevJavaSupportIface.cpp javasupportfactory.cpp \
+JavaRecognizer.cpp backgroundparser.cpp configproblemreporter.ui javasupportpart.cpp \
+JavaStoreWalker.cpp javasupport_utils.cpp problemreporter.cpp driver.cpp kdevdriver.cpp KDevJavaSupportIface.skel
+
+
+EXTRA_DIST = java.g java.tree.g java.store.g
+
+
+#JavaLexer.hpp JavaLexer.cpp JavaRecognizer.hpp JavaRecognizer.cpp: # java.g
+# antlr java.g
+
+#JavaStoreWalker.hpp JavaStoreWalker.cpp: # java.store.g
+# antlr java.store.g
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevjavasupport.desktop
+
+rcdir = $(kde_datadir)/kdevjavasupport
+rc_DATA = kdevjavasupport.rc
diff --git a/languages/java/README.dox b/languages/java/README.dox
new file mode 100644
index 00000000..49af1e43
--- /dev/null
+++ b/languages/java/README.dox
@@ -0,0 +1,48 @@
+/** \class JavaSupportPart
+This is Java language support plugin.
+
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:jonas.nordin AT syncom.se">Jonas Nordin</a> Copyright (C) 1999
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a> Copyright (C) 2000-2001
+\authors <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a> Copyright (C) 2002-2003
+
+\maintainer <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a> Copyright (C) 2002-2003
+
+\feature Java language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=javasupport&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">javasupport component at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/java/app_templates/Makefile.am b/languages/java/app_templates/Makefile.am
new file mode 100644
index 00000000..b47abfca
--- /dev/null
+++ b/languages/java/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = javahello kappjava superwaba
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/JavaIDE
+profiles_DATA = java.appwizard
diff --git a/languages/java/app_templates/java.appwizard b/languages/java/app_templates/java.appwizard
new file mode 100644
index 00000000..087d6c0c
--- /dev/null
+++ b/languages/java/app_templates/java.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=javahello,kappjava,superwaba
diff --git a/languages/java/app_templates/javahello/.kdev_ignore b/languages/java/app_templates/javahello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/java/app_templates/javahello/.kdev_ignore
diff --git a/languages/java/app_templates/javahello/Main.java b/languages/java/app_templates/javahello/Main.java
new file mode 100644
index 00000000..dc757fe5
--- /dev/null
+++ b/languages/java/app_templates/javahello/Main.java
@@ -0,0 +1,7 @@
+
+class Main{
+
+ public static void main( String[] args ){
+ System.out.println( "Hello, world!" );
+ }
+}
diff --git a/languages/java/app_templates/javahello/Makefile.am b/languages/java/app_templates/javahello/Makefile.am
new file mode 100644
index 00000000..8551a6ac
--- /dev/null
+++ b/languages/java/app_templates/javahello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = Main.java build.xml javahello.filelist javahello.kdevelop
+templateName= javahello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/java/app_templates/javahello/build.xml b/languages/java/app_templates/javahello/build.xml
new file mode 100644
index 00000000..27b6046d
--- /dev/null
+++ b/languages/java/app_templates/javahello/build.xml
@@ -0,0 +1,37 @@
+<project name="%{APPNAME}" default="dist" basedir=".">
+ <description>
+ hello application
+ </description>
+ <!-- set global properties for this build -->
+ <property name="src" location="." />
+ <property name="build" location="build" />
+ <property name="dist" location="dist" />
+
+ <target name="init">
+ <!-- Create the time stamp -->
+ <tstamp/>
+ <!-- Create the build directory structure used by compile -->
+ <mkdir dir="${build}"/>
+ </target>
+
+ <target name="compile" depends="init"
+ description="compile the source " >
+ <!-- Compile the java code from ${src} into ${build} -->
+ <javac srcdir="${src}" destdir="${build}"/>
+ </target>
+
+ <target name="dist" depends="compile"
+ description="generate the distribution" >
+ <!-- Create the distribution directory -->
+ <mkdir dir="${dist}/lib"/>
+
+ <jar jarfile="${dist}/lib/%{APPNAMELC}.jar" basedir="${build}"/>
+ </target>
+
+ <target name="clean"
+ description="clean up" >
+ <!-- Delete the ${build} and ${dist} directory trees -->
+ <delete dir="${build}"/>
+ <delete dir="${dist}"/>
+ </target>
+</project>
diff --git a/languages/java/app_templates/javahello/javahello b/languages/java/app_templates/javahello/javahello
new file mode 100644
index 00000000..a2225ce5
--- /dev/null
+++ b/languages/java/app_templates/javahello/javahello
@@ -0,0 +1,11 @@
+# Java application
+[General]
+Name=Application
+Name[fr]=Une application JAVA / Ant
+Icon=qmakeapp.png
+Category=Java/Ant project
+Category[fr]=Java/Ant
+Comment=Generate a Java application
+Comment[fr]=Gnre une application dans le language JAVA en utilisant Ant
+FileTemplates=java,JavaStyle
+ShowFilesAfterGeneration=Main.java
diff --git a/languages/java/app_templates/javahello/javahello.filelist b/languages/java/app_templates/javahello/javahello.filelist
new file mode 100644
index 00000000..97da44be
--- /dev/null
+++ b/languages/java/app_templates/javahello/javahello.filelist
@@ -0,0 +1,2 @@
+# KDevelop Custom Project File List
+Main.java
diff --git a/languages/java/app_templates/javahello/javahello.kdevelop b/languages/java/app_templates/javahello/javahello.kdevelop
new file mode 100644
index 00000000..c3eb6898
--- /dev/null
+++ b/languages/java/app_templates/javahello/javahello.kdevelop
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAntProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevcustomproject>
+ <build>
+ <buildtool>ant</buildtool>
+ </build>
+ </kdevcustomproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/java/app_templates/javahello/javahello.kdevtemplate b/languages/java/app_templates/javahello/javahello.kdevtemplate
new file mode 100644
index 00000000..a7427704
--- /dev/null
+++ b/languages/java/app_templates/javahello/javahello.kdevtemplate
@@ -0,0 +1,124 @@
+# KDE Config File
+[General]
+Name=Application
+Name[br]=Arload
+Name[ca]=Aplicació
+Name[cy]=Cymhwysiad
+Name[da]=Program
+Name[de]=Anwendung
+Name[el]=Εφαρμογή
+Name[es]=Aplicación
+Name[et]=Rakendus
+Name[eu]=Aplikazioa
+Name[fa]=کاربرد
+Name[ga]=Feidhmchlár
+Name[gl]=Aplicación
+Name[hu]=Alkalmazások
+Name[it]=Applicazione
+Name[ja]=アプリケーション
+Name[lt]=Programa
+Name[ms]=Aplikasi
+Name[nds]=Programm
+Name[ne]=अनुप्रयोग
+Name[nl]=Toepassing
+Name[pl]=Program
+Name[pt]=Aplicação
+Name[pt_BR]=Aplicativo
+Name[ru]=Приложение
+Name[rw]=Porogaramu
+Name[sk]=Aplikácia
+Name[sl]=Program
+Name[sr]=Програм
+Name[sr@Latn]=Program
+Name[sv]=Program
+Name[tr]=Uygulama
+Name[zh_CN]=应用程序
+Name[zh_TW]=應用程式
+Icon=qmakeapp.png
+Category=Java/Ant project
+Category[fr]=Java/Ant
+Comment=Generate a Java application
+Comment[ca]=Genera una aplicació Java
+Comment[da]=Generér et Java-program
+Comment[de]=Erstellt eine Java-Anwendung
+Comment[el]=Δημιουργία μιας εφαρμογής Java
+Comment[es]=Genera una aplicación en Java
+Comment[et]=Java rakenduse loomine
+Comment[eu]=Sortu Java aplikazio bat
+Comment[fa]=یک کاربرد جاوا تولید می‌کند
+Comment[fr]=Génère une application Java
+Comment[ga]=Cruthaigh feidhmchlár Java
+Comment[gl]=Xera unha aplicación Java
+Comment[hu]=Létrehoz egy Java-alkalmazást
+Comment[it]=Genera un'applicazione Java
+Comment[ja]= Java アプリケーションを作成
+Comment[nds]=Stellt en Java-Programm op
+Comment[ne]=जाभा अनुप्रयोग उत्पन्न गर्नुहोस्
+Comment[nl]=Genereer een Java-toepassing
+Comment[pl]=Generuj program w Javie
+Comment[pt]=Gera uma aplicação em Java
+Comment[pt_BR]=Gera uma aplicação em Java
+Comment[ru]=Создание приложения Java
+Comment[sk]=Vygeneruje Java aplikáciu
+Comment[sr]=Прави Java програм
+Comment[sr@Latn]=Pravi Java program
+Comment[sv]=Skapa ett Java-program
+Comment[tr]=Bir Java uygulaması yarat
+Comment[zh_CN]=生成一个 Java 应用程序
+Comment[zh_TW]=產生 Java 應用程式
+FileTemplates=java,JavaStyle
+ShowFilesAfterGeneration=%{dest}/Main.java
+Archive=javahello.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/javahello.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/javahello.filelist
+Dest=%{dest}/%{APPNAMELC}.filelist
+
+[FILE3]
+Type=install
+Source=%{src}/Main.java
+Dest=%{dest}/Main.java
+
+[FILE4]
+Type=install
+Source=%{src}/build.xml
+Dest=%{dest}/build.xml
+
+[msg]
+Type=message
+Comment=A JAVA application was created in %{dest}
+Comment[ca]=Una aplicació JAVA ha estat creada en %{dest}
+Comment[da]=Et JAVA-program blev oprettet i %{dest}
+Comment[de]=Eine Java-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή JAVA δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación en Java ha sido creada en %{dest}
+Comment[et]=Java rakendus loodi asukohta %{dest}
+Comment[eu]=JAVA aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد جاوا در %{dest} ایجاد شد
+Comment[fr]=Une application Java a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár JAVA i %{dest}
+Comment[gl]=Creouse una aplicación JAVA en %{dest}
+Comment[hu]=Létrejött egy Java-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Java in %{dest}
+Comment[ja]=JAVA アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en JAVA-Programm opstellt
+Comment[ne]= जाभा अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Java-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program w Javie został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação em Java em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação em Java em %{dest}
+Comment[ru]=Приложение Java создано в %{dest}
+Comment[sk]=Java aplikácia bola vytvorená v %{dest}
+Comment[sr]=Java програм је направљен у %{dest}
+Comment[sr@Latn]=Java program je napravljen u %{dest}
+Comment[sv]=Ett Java-program skapades i %{dest}
+Comment[tr]=Bir JAVA uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个 Java 应用程序
+Comment[zh_TW]=一個 Java 應用程式已建立於 %{dest}
diff --git a/languages/java/app_templates/javahello/javahello.png b/languages/java/app_templates/javahello/javahello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/java/app_templates/javahello/javahello.png
Binary files differ
diff --git a/languages/java/app_templates/kappjava/.kdev_ignore b/languages/java/app_templates/kappjava/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/java/app_templates/kappjava/.kdev_ignore
diff --git a/languages/java/app_templates/kappjava/Makefile.am b/languages/java/app_templates/kappjava/Makefile.am
new file mode 100644
index 00000000..4cda2ef7
--- /dev/null
+++ b/languages/java/app_templates/kappjava/Makefile.am
@@ -0,0 +1,17 @@
+dataFiles = app.java pref.java appview.java app_client.java appui.rc \
+ src-Makefile.am kappjava.png app.kdevelop subdirs
+templateName = kappjava
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/java/app_templates/kappjava/app.desktop b/languages/java/app_templates/kappjava/app.desktop
new file mode 100644
index 00000000..941c0846
--- /dev/null
+++ b/languages/java/app_templates/kappjava/app.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC} %i -caption "%c"
+Icon=%{APPNAMELC}
+Type=Application
+X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html
+Comment=A Java KDE KPart Application
+Comment[ca]=Una aplicació KPart en Java per al KDE
+Comment[da]=Et Java KDE KPart-program
+Comment[de]=Eine KDE-Komponten-Anwendung in Java
+Comment[el]=Μια εφαρμογή Java KDE KPart
+Comment[es]=Una aplicación KPart en Java para KDE
+Comment[et]=Java KDE KPart rakendus
+Comment[eu]=Java KDE KPart aplikazio bat
+Comment[fa]=یک کاربرد KDE KPart جاوا
+Comment[fr]=Une application KPart en JAVA pour KDE
+Comment[ga]=Feidhmchlár KPart KDE i Java
+Comment[gl]=Unha aplicación KPart de KDE en Java
+Comment[hi]=एक जावा केडीई के-पार्ट अनुप्रयोग
+Comment[hu]=Java-ban írt, KPart-alapú KDE-alkalmazás
+Comment[is]=Java KDE KPart forrit
+Comment[it]=Un'applicazione Java KDE KPart
+Comment[ja]= Java KDE KPart アプリケーション
+Comment[nds]=En KDE-Programm in Java
+Comment[ne]=जाभा केडीई KPart अनुप्रयोग
+Comment[nl]=Een Java KDE KPart-toepassing
+Comment[pl]=Element osadzalny KPart Javy
+Comment[pt]=Uma Aplicação KDE KPart em Java
+Comment[pt_BR]=Um Aplicativo KPart do KDE para Java
+Comment[ru]=Приложение KPart для KDE на Java
+Comment[sk]=Java KDE KPart aplikácia
+Comment[sl]=Program za Javo KDE KPart
+Comment[sr]=Java KDE KPart програм
+Comment[sr@Latn]=Java KDE KPart program
+Comment[sv]=Ett Java KDE Kpart-program
+Comment[ta]=ஜாவா கெடி கெபாகம் பயன்பாடு
+Comment[tg]=Гузориш KPart барои KDE дар Java
+Comment[tr]=Bir Java KDE KPart Uygulaması
+Comment[zh_CN]=一个 Java KDE KPart 应用程序
+Comment[zh_TW]=Java KDE KPart 應用程式
+Terminal=false
diff --git a/languages/java/app_templates/kappjava/app.java b/languages/java/app_templates/kappjava/app.java
new file mode 100644
index 00000000..2cb3e94a
--- /dev/null
+++ b/languages/java/app_templates/kappjava/app.java
@@ -0,0 +1,281 @@
+/*
+ * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
+ */
+
+import java.util.*;
+import org.kde.qt.*;
+import org.kde.koala.*;
+
+/**
+ * This class serves as the main window for %{APPNAME}. It handles the
+ * menus, toolbars, and status bars.
+ *
+ * @short Main window class
+ * @author $AUTHOR <$EMAIL>
+ * @version $APP_VERSION
+ */
+public class %{APPNAME} extends KMainWindow
+{
+ private %{APPNAME}View m_view;
+ private QPrinter m_printer;
+
+%{APPNAME}()
+{
+ super( null, "%{APPNAME}" );
+ m_view = new %{APPNAME}View(this);
+ m_printer = new QPrinter();
+ // accept dnd
+ setAcceptDrops(true);
+
+ // tell the KMainWindow that this is indeed the main widget
+ setCentralWidget(m_view);
+
+ // then, setup our actions
+ setupActions();
+
+ // and a status bar
+ statusBar().show();
+
+ // Apply the create the main window and ask the mainwindow to
+ // automatically save settings if changed: window size, toolbar
+ // position, icon size, etc. Also to add actions for the statusbar
+ // toolbar, and keybindings if necessary.
+ setupGUI();
+
+ // allow the view to change the statusbar and caption
+ connect(m_view, SIGNAL("signalChangeStatusbar(String)"),
+ this, SLOT("changeStatusbar(String)"));
+ connect(m_view, SIGNAL("signalChangeCaption(String)"),
+ this, SLOT("changeCaption(String)"));
+
+}
+
+public void load(KURL url)
+{
+ StringBuffer target = new StringBuffer();
+ // the below code is what you should normally do. in this
+ // example case, we want the url to our own. you probably
+ // want to use this code instead for your app
+
+ // download the contents
+ if (NetAccess.download(url, target, null))
+ {
+ // set our caption
+ setCaption(url.fileName());
+
+ // load in the file (target is always local)
+// loadFile(target);
+
+ // and remove the temp file
+ NetAccess.removeTempFile(target.toString());
+ }
+
+ setCaption(url.url());
+ m_view.openURL(url);
+}
+
+public void setupActions()
+{
+ KApplication kapp = KApplication.kApplication();
+ KStdAction.openNew(this, SLOT("fileNew()"), actionCollection());
+ KStdAction.open(this, SLOT("fileOpen()"), actionCollection());
+ KStdAction.save(this, SLOT("fileSave()"), actionCollection());
+ KStdAction.saveAs(this, SLOT("fileSaveAs()"), actionCollection());
+ KStdAction.print(this, SLOT("filePrint()"), actionCollection());
+ KStdAction.quit(kapp, SLOT("quit()"), actionCollection());
+
+ KStdAction.preferences(this, SLOT("optionsPreferences()"), actionCollection());
+
+ // this doesn't do anything useful. it's just here to illustrate
+ // how to insert a custom menu and menu item
+ KAction custom = new KAction(tr("Cus&tom Menuitem"), new KShortcut(),
+ this, SLOT("optionsPreferences()"),
+ actionCollection(), "custom_action");
+}
+
+protected void saveProperties(KConfig config)
+{
+ // the 'config' object points to the session managed
+ // config file. anything you write here will be available
+ // later when this app is restored
+
+ if (m_view.currentURL() != null)
+ config.writeEntry("lastURL", m_view.currentURL());
+}
+
+protected void readProperties(KConfig config)
+{
+ // the 'config' object points to the session managed
+ // config file. this function is automatically called whenever
+ // the app is being restored. read in here whatever you wrote
+ // in 'saveProperties'
+
+ String url = config.readPathEntry("lastURL");
+
+ if (url != null)
+ m_view.openURL(new KURL(url));
+}
+
+protected void dragEnterEvent(QDragEnterEvent event)
+{
+ // accept uri drops only
+ event.accept(QUriDrag.canDecode(event));
+}
+
+protected void dropEvent(QDropEvent event)
+{
+ // this is a very simplistic implementation of a drop event. we
+ // will only accept a dropped URL. the Qt dnd code can do *much*
+ // much more, so please read the docs there
+ ArrayList uri = new ArrayList();
+
+ // see if we can decode a URI.. if not, just ignore it
+ if (QUriDrag.decode(event, (String[]) uri.toArray()))
+ {
+ // okay, we have a URI.. process it
+ String url, target;
+ url = (String) uri.get(0);
+
+ // load in the file
+ load(new KURL(url));
+ }
+}
+
+private void fileNew()
+{
+ // this slot is called whenever the File.New menu is selected,
+ // the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ // button is clicked
+
+ // create a new window
+ (new %{APPNAME}()).show();
+}
+
+private void fileOpen()
+{
+ // this slot is called whenever the File.Open menu is selected,
+ // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ // button is clicked
+ KURL url = KURLRequesterDlg.getURL(null, this, tr("Open Location") );
+ if (!url.isEmpty())
+ m_view.openURL(url);
+}
+
+private void fileSave()
+{
+ // this slot is called whenever the File.Save menu is selected,
+ // the Save shortcut is pressed (usually CTRL+S) or the Save toolbar
+ // button is clicked
+
+ // save the current file
+}
+
+private void fileSaveAs()
+{
+ // this slot is called whenever the File.Save As menu is selected,
+ KURL file_url = KFileDialog.getSaveURL();
+ if (!file_url.isEmpty() && file_url.isValid())
+ {
+ // save your info, here
+ }
+}
+
+private void filePrint()
+{
+ // this slot is called whenever the File.Print menu is selected,
+ // the Print shortcut is pressed (usually CTRL+P) or the Print toolbar
+ // button is clicked
+ if (m_printer == null) m_printer = new QPrinter();
+ if (QPrintDialog.getPrinterSetup(m_printer))
+ {
+ // setup the printer. with Qt, you always "print" to a
+ // QPainter.. whether the output medium is a pixmap, a screen,
+ // or paper
+ QPainter p = new QPainter();
+ p.begin(m_printer);
+
+ // we let our view do the actual printing
+ QPaintDeviceMetrics metrics = new QPaintDeviceMetrics(m_printer);
+ m_view.print(p, metrics.height(), metrics.width());
+
+ // and send the result to the printer
+ p.end();
+ }
+}
+
+private void optionsPreferences()
+{
+ // popup some sort of preference dialog, here
+ %{APPNAME}Preferences dlg = new %{APPNAME}Preferences();
+ if (dlg.exec() != 0)
+ {
+ // redo your settings
+ }
+}
+
+private void changeStatusbar(String text)
+{
+ // display the text on the statusbar
+ statusBar().message(text);
+}
+
+private void changeCaption(String text)
+{
+ // display the text on the caption
+ setCaption(text);
+}
+
+static String description =
+ "A KDE Application";
+
+static String version = "%{VERSION}";
+
+static String[][] options =
+{
+ { "+[URL]", "Document to open.", null }
+};
+
+static void main(String[] cmdLineArgs)
+{
+ KAboutData about = new KAboutData("%{APPNAMELC}", "%{APPNAME}", version, description,
+ KAboutData.License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", null, null, "%{EMAIL}");
+ about.addAuthor( "%{AUTHOR}", null, "%{EMAIL}" );
+ KCmdLineArgs.init(cmdLineArgs, about);
+ KCmdLineArgs.addCmdLineOptions(options);
+ KApplication app = new KApplication();
+
+ // see if we are starting with session management
+ if (app.isRestored())
+ RESTORE("%{APPNAME}");
+ else
+ {
+ // no session.. just start up normally
+ KCmdLineArgs args = KCmdLineArgs.parsedArgs();
+ if (args.count() == 0)
+ {
+ %{APPNAME} widget = new %{APPNAME}();
+ widget.show();
+ }
+ else
+ {
+ int i = 0;
+ for (; i < args.count(); i++)
+ {
+ %{APPNAME} widget = new %{APPNAME}();
+ widget.show();
+ widget.load(args.url(i));
+ }
+ }
+ args.clear();
+ }
+
+ app.exec();
+ return;
+}
+
+ static {
+ qtjava.initialize();
+ kdejava.initialize();
+ }
+}
+
diff --git a/languages/java/app_templates/kappjava/app.kdevelop b/languages/java/app_templates/kappjava/app.kdevelop
new file mode 100644
index 00000000..078f5c1a
--- /dev/null
+++ b/languages/java/app_templates/kappjava/app.kdevelop
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <keywords>
+ <keyword>Java</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activetarget>src/java</activetarget>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.java" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdebugger>
+ <general>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="java"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/java/app_templates/kappjava/app_client.java b/languages/java/app_templates/kappjava/app_client.java
new file mode 100644
index 00000000..9ed90c8a
--- /dev/null
+++ b/languages/java/app_templates/kappjava/app_client.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
+ */
+
+#include <kapp.h>
+#include <dcopclient.h>
+#include <qdatastream.h>
+#include <qstring.h>
+
+int main(int argc, char **argv)
+{
+ KApplication app(argc, argv, "%{APPNAMELC}_client", false);
+
+ // get our DCOP client and attach so that we may use it
+ DCOPClient *client = app.dcopClient();
+ client->attach();
+
+ // do a 'send' for now
+ QByteArray data;
+ QDataStream ds(data, IO_WriteOnly);
+ if (argc > 1)
+ ds << QString(argv[1]);
+ else
+ ds << QString("http://www.kde.org");
+ client->send("%{APPNAMELC}", "%{APPNAME}Iface", "openURL(QString)", data);
+
+ return app.exec();
+}
diff --git a/languages/java/app_templates/kappjava/appui.rc b/languages/java/app_templates/kappjava/appui.rc
new file mode 100644
index 00000000..ceb4f14e
--- /dev/null
+++ b/languages/java/app_templates/kappjava/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="custom"><text>C&amp;ustom</text>
+ <Action name="custom_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/java/app_templates/kappjava/appview.java b/languages/java/app_templates/kappjava/appview.java
new file mode 100644
index 00000000..1ead5458
--- /dev/null
+++ b/languages/java/app_templates/kappjava/appview.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
+ */
+
+import java.util.*;
+import org.kde.qt.*;
+import org.kde.koala.*;
+
+/**
+ * This is the main view class for %{APPNAME}. Most of the non-menu,
+ * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ * here.
+ *
+ * This %{APPNAMELC} uses an HTML component as an example.
+ *
+ * @short Main view
+ * @author %{AUTHOR} <%{EMAIL}>
+ * @version %{VERSION}
+ */
+public class %{APPNAME}View extends QWidget
+{
+
+ QHBoxLayout top_layout;
+
+public %{APPNAME}View(QWidget parent)
+{
+ super(parent, null);
+ // setup our layout manager to automatically add our widgets
+ top_layout = new QHBoxLayout(this);
+ top_layout.setAutoAdd(true);
+
+ // we want to look for all components that satisfy our needs. the
+ // trader will actually search through *all* registered KDE
+ // applications and components -- not just KParts. So we have to
+ // specify two things: a service type and a constraint
+ //
+ // the service type is like a mime type. we say that we want all
+ // applications and components that can handle HTML -- 'text/html'
+ //
+ // however, by itself, this will return such things as Netscape..
+ // not what we wanted. so we constrain it by saying that the
+ // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes
+ // field. with this, only components of the type we want will be
+ // returned.
+ ArrayList offers = KTrader.self().query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes");
+
+ KLibFactory factory = null;
+ // in theory, we only care about the first one.. but let's try all
+ // offers just in case the first can't be loaded for some reason
+ Iterator it = offers.iterator();
+ while(it.hasNext())
+ {
+ KService ptr = (KService) it.next();
+
+ // we now know that our offer can handle HTML and is a part.
+ // since it is a part, it must also have a library... let's try to
+ // load that now
+ factory = KLibLoader.self().factory( ptr.library() );
+ if (factory != null)
+ {
+ m_html = (ReadOnlyPart) factory.create(this, ptr.name(), "KParts::ReadOnlyPart");
+ break;
+ }
+ }
+
+ // if our factory is invalid, then we never found our component
+ // and we might as well just exit now
+ if (factory == null)
+ {
+ KMessageBox.error(this, "Could not find a suitable HTML component");
+ return;
+ }
+
+ connect(m_html, SIGNAL("setWindowCaption(String)"),
+ this, SLOT("slotSetTitle(String)"));
+ connect(m_html, SIGNAL("setStatusBarText(String)"),
+ this, SLOT("slotOnURL(String)"));
+
+}
+
+
+public void print(QPainter p, int height, int width)
+{
+ // do the actual printing, here
+ // p.drawText(etc..)
+}
+
+public String currentURL()
+{
+ return m_html.url().url();
+}
+
+public void openURL(String url)
+{
+ openURL(new KURL(url));
+}
+
+public void openURL(KURL url)
+{
+ m_html.openURL(url);
+}
+
+private void slotOnURL(String url)
+{
+ emit("signalChangeStatusbar", url);
+}
+
+private void slotSetTitle(String title)
+{
+ emit("signalChangeCaption", title);
+}
+
+private ReadOnlyPart m_html;
+
+}
diff --git a/languages/java/app_templates/kappjava/kappjava b/languages/java/app_templates/kappjava/kappjava
new file mode 100644
index 00000000..e199ac25
--- /dev/null
+++ b/languages/java/app_templates/kappjava/kappjava
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Application framework
+Name[fr]=Squelette d'application
+Icon=kappjava.png
+Category=Java/KDE
+Comment=Generates a simple Java KDE application with one toplevel window, menus and toolbars.
+Comment[fr]=Gnre une simple application KDE dans le language JAVA avec une fentre principale, des menus, et des barres d'outils.
+FileTemplates=java,CStyle
+ShowFilesAfterGeneration=src/APPNAMEView.java
diff --git a/languages/java/app_templates/kappjava/kappjava.kdevtemplate b/languages/java/app_templates/kappjava/kappjava.kdevtemplate
new file mode 100644
index 00000000..3fd80ca8
--- /dev/null
+++ b/languages/java/app_templates/kappjava/kappjava.kdevtemplate
@@ -0,0 +1,163 @@
+# KDE Config File
+[General]
+Name=Application framework
+Name[ca]=Infraestructura d'aplicacions
+Name[da]=Programskelet
+Name[de]=Anwendungsgrundgerüst
+Name[el]=Πλαίσιο εφαρμογής
+Name[es]=Infraestructura de aplicación
+Name[et]=Rakenduse raamistik
+Name[eu]=Aplikazioen lan-markoa
+Name[fa]=چارچوب کاربرد
+Name[fr]=Infrastructure d'application
+Name[ga]=Creatlach feidhmchláir
+Name[gl]=Entorno de traballo para aplicación
+Name[hu]=Alkalmazás-keretrendszer
+Name[it]=Infrastruttura applicativa
+Name[ja]=アプリケーションフレームワーク
+Name[nds]=Programmrahmenwark
+Name[ne]=अनुप्रयोग फ्रेमवर्क
+Name[nl]=Applicationframework
+Name[pl]=Szablon programu
+Name[pt]=Plataforma de aplicações
+Name[pt_BR]=Plataforma de aplicações
+Name[ru]=Приложение KDE
+Name[sk]=Aplikačný framework
+Name[sl]=Ogrodje programa
+Name[sr]=Радни оквир програма
+Name[sr@Latn]=Radni okvir programa
+Name[sv]=Programramverk
+Name[tr]=Uygulama Çatısı
+Name[zh_CN]=应用程序框架
+Name[zh_TW]=應用程式框架
+Icon=kappjava.png
+Category=Java/KDE
+Comment=Generates a simple Java KDE application with one toplevel window, menus and toolbars.
+Comment[ca]=Genera una simple aplicació per al KDE en Java amb una finestra principal, menús i barres d'eines.
+Comment[da]=Genererer et simpelt Java KDE program med et vindue på topniveau, menuer og værktøjslinjer.
+Comment[de]=Erstellt eine einfache Java-KDE-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή Java του KDE με ένα ανώτερο παράθυρο, μενού, και γραμμές εργαλείων.
+Comment[es]=Genera una sencilla aplicación para KDE en Java, con una ventana principal, menús y barras de herramientas.
+Comment[et]=Lihtsa Java KDE rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega.
+Comment[eu]=Goi-mailako lehio bat, menuak eta tresna-barrak dituen Java KDE aplikazio bat sortzen du.
+Comment[fa]=یک کاربرد سادۀ KDE جاوا با یک پنجرۀ سطح بالا، گزینگان و میله‌های ابزار تولید می‌کند.
+Comment[fr]=Génère une application KDE simple en Java comprenant une fenêtre de premier niveau, des menus et des barres d'outils.
+Comment[gl]=Xera unha aplicación sinxela KDE en Java cunha xanela principal, menús e barras de ferramentas.
+Comment[hu]=Létrehoz egy egyszerű Java-alapú KDE-alkalmazást egy főablakkal, menükkel és eszköztárakkal.
+Comment[it]=Genera una semplice applicazione KDE Java con una finestra toplevel, menu e barre degli strumenti.
+Comment[nds]=Stellt en eenfach KDE-Programm in Java mit een böverst Finster, Menüs un Warktüüchbalkens op.
+Comment[ne]=एउटा उच्चतह सञ्झ्याल, मेनु र उपकरणपट्टीसँग साधारण जाभा केडीई अनुप्रयोग उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een eenvoudige Java KDE-toepassing met een toplevel window, menu's en toolbars.
+Comment[pl]=Generuje prosty program KDE w Javie posiadający okno, menu i paski narzędzi.
+Comment[pt]=Gera uma aplicação para KDE simples em Java, com uma janela de topo, menus e barras de ferramentas.
+Comment[pt_BR]=Gera uma aplicação para KDE simples em Java, com uma janela de topo, menus e barras de ferramentas.
+Comment[ru]=Создание простого приложения Java KDE с окном, меню и панелями инструментов.
+Comment[sk]=Vygeneruje jednoduchú Java KDE aplikáciu s jedným oknom, menu a panelom nástrojov.
+Comment[sr]=Прави једноставан Java KDE програм са једним прозором највишег нивоа, менијима и тракама са алатом.
+Comment[sr@Latn]=Pravi jednostavan Java KDE program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom.
+Comment[sv]=Skapar ett enkelt Java KDE-program med ett toppnivåfönster, menyer och verktygsrader.
+Comment[tr]=Bir üst seviye penceresi, menüleri ve araç çubukları olan basit bir Java KDE uygulaması yaratır.
+Comment[zh_CN]=生成一个简单的带有顶级窗口、菜单和工具栏的 Java KDE 应用程序。
+Comment[zh_TW]=產生一個簡單的 Java KDE 應用程式,內含頂層視窗、選單與工具列。
+FileTemplates=java,CStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAME}View.java
+Archive=kappjava.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[DOCBOOK]
+Type=include
+File=%{kdevelop}/template-common/dockbook.kdevtemplate
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.java
+Dest=%{dest}/src/%{APPNAME}.java
+
+[FILE16]
+Type=install
+Source=%{src}/appview.java
+Dest=%{dest}/src/%{APPNAME}View.java
+
+[FILE17]
+Type=install
+Source=%{src}/pref.java
+Dest=%{dest}/src/%{APPNAME}Preferences.java
+
+[FILE18]
+Type=install
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
diff --git a/languages/java/app_templates/kappjava/kappjava.png b/languages/java/app_templates/kappjava/kappjava.png
new file mode 100644
index 00000000..913ebb87
--- /dev/null
+++ b/languages/java/app_templates/kappjava/kappjava.png
Binary files differ
diff --git a/languages/java/app_templates/kappjava/pref.java b/languages/java/app_templates/kappjava/pref.java
new file mode 100644
index 00000000..a50fdb31
--- /dev/null
+++ b/languages/java/app_templates/kappjava/pref.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}>
+ */
+
+import java.util.*;
+import org.kde.qt.*;
+import org.kde.koala.*;
+
+public class %{APPNAME}Preferences extends KDialogBase
+{
+private %{APPNAME}PrefPageOne m_pageOne;
+private %{APPNAME}PrefPageTwo m_pageTwo;
+
+public %{APPNAME}Preferences()
+{
+ super(TreeList, "%{APPNAME} Preferences",
+ Help|Default|Ok|Apply|Cancel, Ok);
+
+ // this is the base class for your preferences dialog. it is now
+ // a Treelist dialog.. but there are a number of other
+ // possibilities (including Tab, Swallow, and just Plain)
+ QFrame frame;
+ frame = addPage(tr("First Page"), tr("Page One Options"));
+ m_pageOne = new %{APPNAME}PrefPageOne(frame);
+
+ frame = addPage(tr("Second Page"), tr("Page Two Options"));
+ m_pageTwo = new %{APPNAME}PrefPageTwo(frame);
+}
+
+public class %{APPNAME}PrefPageOne extends QFrame {
+public %{APPNAME}PrefPageOne(QWidget parent)
+{
+ super(parent);
+ QHBoxLayout layout = new QHBoxLayout(this);
+ layout.setAutoAdd(true);
+
+ new QLabel("Add something here", this);
+}
+}
+
+public class %{APPNAME}PrefPageTwo extends QFrame {
+public %{APPNAME}PrefPageTwo(QWidget parent)
+{
+ super(parent);
+ QHBoxLayout layout = new QHBoxLayout(this);
+ layout.setAutoAdd(true);
+
+ new QLabel("Add something here", this);
+}
+}
+
+}
diff --git a/languages/java/app_templates/kappjava/src-Makefile.am b/languages/java/app_templates/kappjava/src-Makefile.am
new file mode 100644
index 00000000..6468994c
--- /dev/null
+++ b/languages/java/app_templates/kappjava/src-Makefile.am
@@ -0,0 +1,18 @@
+## Makefile.am for %{APPNAMELC}
+
+JAVAROOT = .
+
+# which sources should be compiled for %{APPNAMELC}
+java_JAVA = %{APPNAME}.java %{APPNAME}View.java \
+ %{APPNAME}Preferences.java
+
+
+KDE_ICON = %{APPNAMELC}
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
diff --git a/languages/java/app_templates/kappjava/subdirs b/languages/java/app_templates/kappjava/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/java/app_templates/kappjava/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/java/app_templates/superwaba/.kdev_ignore b/languages/java/app_templates/superwaba/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/java/app_templates/superwaba/.kdev_ignore
diff --git a/languages/java/app_templates/superwaba/Makefile.am b/languages/java/app_templates/superwaba/Makefile.am
new file mode 100644
index 00000000..8c27b8d5
--- /dev/null
+++ b/languages/java/app_templates/superwaba/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = superwaba.png sw.java src-Makefile sw.kdevelop sw.filelist
+templateName = superwaba
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/java/app_templates/superwaba/src-Makefile b/languages/java/app_templates/superwaba/src-Makefile
new file mode 100644
index 00000000..84b55ece
--- /dev/null
+++ b/languages/java/app_templates/superwaba/src-Makefile
@@ -0,0 +1,226 @@
+# Makefile template
+#
+# for using WABA and SUPERWABA on Linux systems
+#
+# Doug Lawson (dlawson@cablespeed.com)
+# Modified for use with KDevelop by Ian Reinhart Geiser <geiseri@kde.org>
+
+# Copyright (c) Doug Lawson 2003
+# developed for classes I teach.
+#
+# may be distributed under GPL
+# (http://www.gnu.org/licenses/gpl.html)
+# or any other license that allows it to be freely used.
+#
+# please let me know about any improvements you make
+
+VERSION = %{VERSION}
+# What are we building? We put the names here at the
+# top to make it easy to change
+
+MAINCLASSNAME = %{APPNAME}
+
+# ExtraClassList will be blank if the app consists of
+# only one class
+EXTRACLASSLIST =
+
+# Is there an icon for this program? If there
+# is, create an icon argument for exegen
+#
+# Exegen will automatically look for icons
+# so this may not be needed. Run
+# java Exegen /?
+# for help on Exegen
+#
+# If you use this line, make sure to un-comment it!
+#
+# ICONFLAG = /I Icon
+
+# Like ICONFLAG, height and width may be specified, or
+# you may accept the default. On PalmOS, the app will run
+# full-screen by default, which is usually what you want.
+#
+# If you want the same look on PalmOS as on
+# Windows CE, you should specify height and width
+#
+# run
+# java Exegen /?
+# for more information, or see the docs.
+#
+# HEIGHT = /h 160
+# WIDTH = /w 160
+
+# CAB Options
+# The /Z parameter is used to create eight cab files so your application can
+# easily be installed in all compatible Windows CE platforms. You may pass,
+# optionally, a .swz file with some global and local libraries used by your
+# app. For example, if you need to install the TinyLarge.pdb font and also a
+# custom database, E.g. mydata.pdb, you must copy all files to the current
+# directory, then create a myapp.swz file with the following contents:
+#
+# [G]TinyLarge.pdb
+# [L]mydata.pdb
+#
+# The [G] denotes a global library (fonts are always global libraries), and the
+# [L] denotes a local library.
+# The user will then have two options to start the installation process:
+# 1. Run the created xxx_install.bat file, or
+# 2. If the cab files are available in the internet, the user may launch the
+# browser from inside the device, connect to the site and choose the appropriate
+# cab file. The browser will then download and install the file.
+# The /Z parameter works on in the Windows platform.
+SWZFILE =
+CABFLAGS = /Z $(SWZFILE)
+
+# ------------------------------------------------------
+# Most of the stuff below this line will not change
+# very often. If you change Java SDKs or re-install
+# waba or superwaba, you may need to change it.
+
+# first, the locations of the various java components.
+# On a *NIX system, they will usually be in something
+# like the directories listed here.
+
+
+# The flags and arguments here have been developed for use with
+# the SUN jdk v1.3. Read your java documentation carefully,
+# don't just blindly assume that what I have here will work
+# with your setup.
+
+JAVADIR = %{JAVADIR}
+JAVABINDIR = $(JAVADIR)/bin
+JAVAC = $(JAVABINDIR)/javac
+JAR = $(JAVABINDIR)/jar
+
+# Java Compiler flags and arguments. For these makefiles,
+# it is easiest if we include the CLASSPATH in the command
+# line.
+JCFLAGS = -classpath $(CLASSPATH)
+
+JAVA = $(JAVABINDIR)/java
+JAVAFLAGS = -classpath $(CLASSPATH)
+
+APPLETVIEWER = $(JAVABINDIR)/appletviewer
+AVFLAGS = -J-classpath -J$(CLASSPATH)
+
+
+# next, where are all the WABA bits and pieces?
+WABADIR = %{WABADIR}
+WABABINDIR = $(WABADIR)/superwaba/bin
+WABAEXTRADIR = $(WABADIR)/superwaba
+
+################################################################################
+# You should not have to change anything below this line.
+################################################################################
+# the classpath will have to tell java where to find the waba stuff.
+#
+# the CLASSPATH here is set to let java find
+# - the classes it needs to produce the executable class files
+# - the waba.applet class, Warp.class, and Exegen.class
+#
+# This strategy works so far, but it may (conceivably) produce a
+# conflict at some point. Be warned. You may want to use a CLASSPATH
+# that leaves out waba.applet, Warp and/or Exegen.
+#
+CLASSPATH = $(WABADIR):$(WABAEXTRADIR):$(WABAEXTRADIR)/classes:$(WABABINDIR):.
+
+# exegen and warp
+#
+# exegen is the EXEcutable GENerator. It takes the
+# main waba/java class (which usually extends MainWindow)
+# and makes it into a program that will automagically run
+# itself under waba or superwaba on a PalmOS gadget.
+#
+# Since the palm program has a .prc extension, it is called
+# PRCFILE here.
+#
+# Exegen also creates a .exe file for Window CE
+#
+# warp is the Waba Application Resource Packager.
+# It bundles the classes and other resources into
+# a single PALM database file (which is also used
+# by the Win CE executable). This file has a .pdb
+# extension. In this makefile it is called PDBFILE
+#
+# The standard waba SDK has only the MS-Windows *.exe files.
+# for exegen and warp
+#
+# Although there are exegen and warp native binaries for Linux,
+# they don't seem to work very well. The solution has been to
+# write those programs in Java.
+#
+# for waba, use the java apps
+# from http://www.wn.com.au/rnielsen/wextras/
+# (Rob Nielsen). Getting all the paths to fall into the right
+# place takes a little tuning, though (which is why this makefile
+# is here, I suppose)
+#
+# For superwaba, the same programs are included in the
+# distribution
+
+
+EXEGEN = $(JAVA) $(JAVAFLAGS) Exegen
+EXEGENFLAGS = $(HEIGHT) $(WIDTH) $(ICONFLAG) /L /V $(VERSION) $(CABFLAGS)
+
+WARP = $(JAVA) $(JAVAFLAGS) Warp
+WARPFLAGS = c
+
+MAINCLASS = $(MAINCLASSNAME).class
+EXTRACLASSES = $(EXTRACLASSLIST)
+
+WEBPAGE = $(MAINCLASSNAME).html
+
+PRCBASENAME = $(MAINCLASSNAME)
+PDBBASENAME = $(MAINCLASSNAME)
+
+PDBFILE = $(PDBBASENAME).pdb
+PRCFILE = $(PRCBASENAME).prc
+
+
+all: $(PDBFILE) $(PRCFILE)
+
+$(PRCFILE): $(PDBFILE)
+ $(EXEGEN) $(EXEGENFLAGS) $(PRCBASENAME) $(MAINCLASSNAME) $(PDBBASENAME)
+
+# you may want to change this one so that Warp only handles
+# the classes you tell it to (instead of using the wildcard '*.class')
+# Use the second pair of lines below, which are commented out.
+#
+# Note that there is a potential problem if your program generates
+# inner classes (which have names like
+# 'ClockPanel$SettingsWindow.class'.
+# If that is the case, the wildcard *.class filespec is guaranteed to
+# include them in the make dependency.
+
+$(PDBFILE): $(MAINCLASS) $(EXTRACLASSES)
+ $(WARP) $(WARPFLAGS) $(PDBBASENAME) *.class
+
+# $(PDBFILE): $(MAINCLASS) $(EXTRACLASSES)
+# $(WARP) $(WARPFLAGS) $(PDBBASENAME) $(MAINCLASS) $(EXTRACLASSES)
+
+# Below, we just tell make how to create foo.class if it can find
+# foo.java
+
+%.class: %.java
+ $(JAVAC) $(JCFLAGS) $<
+
+# note that the 'test' target DOES NOT INCLUDE A DEPENDENCY
+# for the java classes. This way, you can keep doing tests of the old
+# class while you rewrite the source (foo.java).
+
+test:
+ echo "running this test does not rebuild any of the targets" ;\
+ $(JAVA) $(JAVAFLAGS) waba.applet.Applet $(MAINCLASSNAME)
+
+# Since I haven't (yet) got the code written to generate the
+# web page, target 'applettest' is commented out. If you want
+# to create the web page by hand and test it, be my guest.
+
+# applettest: $(WEBPAGE)
+# $(APPLETVIEWER) $(AVFLAGS) $(webpage)
+
+clean:
+ rm -f *.class *.pdb *.prc *.lnk
+
+jar: $(MAINCLASS) $(EXTRACLASSES)
+ $(JAR) -cvfm $(MAINCLASSNAME).jar $(MAINCLASSNAME).mft $(MAINCLASS) $(EXTRACLASSES)
diff --git a/languages/java/app_templates/superwaba/superwaba b/languages/java/app_templates/superwaba/superwaba
new file mode 100644
index 00000000..eea98775
--- /dev/null
+++ b/languages/java/app_templates/superwaba/superwaba
@@ -0,0 +1,54 @@
+# KDE Config File
+[General]
+Name=SuperWaba
+Name[fr]=Une application SuperWaba
+Icon=superwaba.png
+Category=Java
+Comment=A simple template for building SuperWaba Java based apps on WinCE and PalmOS. More information can be found at http://www.superwaba.org
+Comment[fr]=Gnre un simple modle d'application JAVA en utilisant SuperWaba pour les environnements WinCE et PalmOS. Plus d'informations peuvent tre trouv l'URL suivante : http://www.superwaba.org.
+FileTemplates=java
+ShowFilesAfterGeneration=APPNAME.java
+Archive=superwaba.tar.gz
+
+[JAVA]
+Type=value
+Value=JAVA
+Comment=Path to your java root
+Default=/usr/lib/java
+ValueType=QString
+
+[WABA]
+Type=value
+Value=WABA
+Comment=Path to your SuperWaba root
+Default=/usr/lib
+ValueType=QString
+
+[GNU]
+Type=install archive
+Source=%{kdevelop}/template-common/gnu.tar.gz
+Dest=%{dest}
+
+[PROJECT]
+Type=install
+Source=%{src}/sw.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILELIST]
+Type=install
+Source=%{src}/sw.filelist
+Dest=%{dest}/%{APPNAMELC}.filelist
+
+[MAKEFILE]
+Type=install
+Source=%{src}/src-Makefile
+Dest=%{dest}/Makefile
+
+[SOURCE]
+Type=install
+Source=%{src}/sw.java
+Dest=%{dest}/%{APPNAME}.java
+
+[MESSAGE]
+Type=Message
+Comment=Your application is setup to build. Edit the make targets to customize the file.
diff --git a/languages/java/app_templates/superwaba/superwaba.kdevtemplate b/languages/java/app_templates/superwaba/superwaba.kdevtemplate
new file mode 100644
index 00000000..a963caac
--- /dev/null
+++ b/languages/java/app_templates/superwaba/superwaba.kdevtemplate
@@ -0,0 +1,166 @@
+# KDE Config File
+[General]
+Name=SuperWaba
+Name[ne]=सुपरवाभा
+Icon=superwaba.png
+Category=Java
+Comment=A simple template for building SuperWaba Java based apps on WinCE and PalmOS. More information can be found at http://www.superwaba.org
+Comment[ca]=Una simple plantilla per a construir aplicacions basades en SuperWaba Java per a WinCE i PalmOS. Podeu trobar més informació a http://www.superwaba.org
+Comment[da]=En simpel skabelon til at bygge SuperWaba Java baserede programmer på WinCE og PalmOS. Mere information kan findes på http://www.superwaba.org
+Comment[de]=Eine einfache Vorlage zum Erstellen von auf Java basierenden SuperWaba-Anwendungen unter WinCE und PalmOS. Weitere Informationen erhalten Sie auf http://www.superwaba.org.
+Comment[el]=Ένα απλό πρότυπο για την κατασκευή εφαρμογών SuperWaba Java για τα WinCE και PalmOS. Περισσότερες πληροφορίες μπορούν να βρεθούν στο http://www.superwaba.org
+Comment[es]=Una plantilla sencilla para crear aplicaciones basadas en SuperWaba Java para WinCE y PalmOS. Puede encontrar más información en http://www.superwaba.org
+Comment[et]=Lihtne mall rakenduste loomiseks SuperWaba Java põhjal WinCE ja PalmOS'i tarbeks. Rohkem infot annab http://www.superwaba.org
+Comment[eu]=WinCE eta PalmOS sistema eragileetan SuperWaba Javan oinarritutako aplikazioak sortzeko txantiloi sinple bat. Informazio gehiagorako: http://www.superwaba.org
+Comment[fa]=یک قالب ساده برای ساختن کاربردهای بر مبنای SuperWaba جاوا روی WinCE و PalmOS. اطلاعات بیشتر می‌تواند در http://www.superwaba.org یافت شود
+Comment[fr]=Un modèle simple pour construire des applications basées sur Java SuperWaba pour WinCE et PalmOS. Vous trouverez plus d'informations sur http://www.superwaba.org
+Comment[gl]=Un modelo sinxelo para crear aplicacións SuperWaba baseadas en Java para WinCE e PalmOS. Pode atopar máis información en http://www.superwaba.org
+Comment[hu]=Egyszerű sablon SuperWaba Java-alkalmazások készítéséhez, WinCE és PalmOS platformra. Részletes információ itt található: http://www.superwaba.org
+Comment[it]=Un semplice modello per compilare applicazioni Java SuperWaba basato su WinCE e PalmOS. Ulteriori informazioni possono essere trovate visitando http://www.superwaba.org/
+Comment[nds]=En eenfach Vörlaag för't Opstellen vun op WinCE un PalmOS opbuut SuperWaba-Programmen. Mehr Informatschonen laat sik op http://www.superwaba.org finnen
+Comment[ne]=WinCE र PalmOS मा सुपरवाभा जाभा आधारित अनुप्रयोग निर्माणका लागि साधारण टेम्प्लेट । बढी जानकारी http://www.superwaba.org मा फेला पार्न सकिन्छ ।
+Comment[nl]=Een eenvouidg sjabloon voor het bouwen van SuperWaba Java-gebaseerde toepassingen op WinCE en PalmOS. Meer informatie vindt u op http://www.superwaba.org.
+Comment[pl]=Prosty szablon do budowania programów w Javie wykorzystujących SuperWaba w środowiskach WinCE oraz PalmOS. Więcej informacji można znaleźć na stronie http://www.superwaba.org
+Comment[pt]=Um modelo simples para criara aplicações Java, baseadas no SuperWaba, para o WinCE e o PalmOS. Poderá encontrar mais informações em http://www.superwaba.org
+Comment[pt_BR]=Um modelo simples para criara aplicações Java, baseadas no SuperWaba, para o WinCE e o PalmOS. Poderá encontrar mais informações em http://www.superwaba.org
+Comment[ru]=Создание приложения SuperWaba Java для устройств WinCE и PalmOS. Дополнительную информацию можно найти на http://www.superwaba.org
+Comment[sk]=Jednoduchá šablóna pre vytváranie SuperWaba Java Aplikácií na WinCE a PalmOS. Viac informácií môžte nájsť na http://www.superwaba.org
+Comment[sr]=Једноставан шаблон за градњу SuperWaba програма на основу Java-е, за WinCE и PalmOS. Више информација на http://www.superwaba.org
+Comment[sr@Latn]=Jednostavan šablon za gradnju SuperWaba programa na osnovu Java-e, za WinCE i PalmOS. Više informacija na http://www.superwaba.org
+Comment[sv]=En enkel mall för att bygga SuperWaba Java-baserade program på WinCE och PalmOS. Mer information hittas på http://www.superwaba.org.
+Comment[tr]=WinCE ve PalmOS üstünde SuperWaba tabanlı Java uygulamarı yapmak için basit bir şablon. Daha fazla bilgi http://www.superwaba.org/ adresinde bulunabilir.
+Comment[zh_CN]=在 WinCE 和 PalmOS 上构建基于 SuperWaba Java 应用程序的简单模板。更多信息可以在 http://www.superwaba.org 找到
+Comment[zh_TW]=一個簡單的建立在 WinCE 與 PalmOS 上執行的 SuperWaba Java 應用程式。您可以在 http://www.superwaba.org 取得更多資訊。
+FileTemplates=java
+ShowFilesAfterGeneration=%{dest}/%{APPNAME}.java
+Archive=superwaba.tar.gz
+
+[JAVA]
+Type=value
+Value=JAVA
+Comment=Path to your java root
+Comment[ca]=Ruta cap a la vostra arrel Java
+Comment[da]=Sti til din java-rod
+Comment[de]=Pfad zum Stammordner von Java
+Comment[el]=Διαδρομή στο κατάλογό σας της java
+Comment[es]=Ruta a su carpeta raíz Java
+Comment[et]=Java juurkataloogi asukoht
+Comment[eu]=Zure java erroaren bide-izena
+Comment[fa]=مسیر ریشۀ جاوای شما
+Comment[fr]=Chemin vers votre racine Java
+Comment[gl]=Ruta a súa instalación de java
+Comment[hu]=A Java-alapkönyvtár elérési útja
+Comment[it]=Percorso alla radice java
+Comment[ja]=Java ルートへのパス
+Comment[nds]=Padd na Dien Java-Wörtelorner
+Comment[ne]=तपाईँको जाभा रूटको मार्ग
+Comment[nl]=Pad naar uw Java-hoofdmap
+Comment[pl]=Ścieżka do głównego katalogu Javy
+Comment[pt]=A localização de base do seu Java
+Comment[pt_BR]=A localização de base do seu Java
+Comment[ru]=Путь к корневому каталогу Java
+Comment[sk]=Cesta ku java koreňu
+Comment[sr]=Путања до вашег корена Java-е
+Comment[sr@Latn]=Putanja do vašeg korena Java-e
+Comment[sv]=Sökväg till Java-rotkatalog
+Comment[zh_CN]=您的 Java 根路径
+Comment[zh_TW]=您的 java 根路徑
+Default=/usr/lib/java
+ValueType=QString
+
+[WABA]
+Type=value
+Value=WABA
+Comment=Path to your SuperWaba root
+Comment[ca]=Ruta cap a la vostra arrel SuperWaba
+Comment[da]=Sti til din SuperWaba-rod
+Comment[de]=Pfad zum Stammordner von SuperWaba
+Comment[el]=Διαδρομή στο κατάλογό σας της SuperWaba
+Comment[es]=Ruta a su carpeta raíz de SuperWaba
+Comment[et]=SuperWaba juurkataloogi asukoht
+Comment[eu]=Zure SuperWaba erroaren bide-izena
+Comment[fa]=مسیر ریشۀ SuperWaba شما
+Comment[fr]=Chemin vers votre racine SuperWaba
+Comment[gl]=Ruta a súa instalación de SuperWaba
+Comment[hu]=A SuperWaba-alapkönyvtár elérési útja
+Comment[it]=Percorso alla radice SuperWaba
+Comment[ja]=SuperWaba ルートへのパス
+Comment[nds]=Padd na Dien SuperWaba-Wörtelorner
+Comment[ne]=तपाईँको सुपरवाभा रूटको मार्ग
+Comment[nl]=Pad naar uw SuperWaba-hoofdmap
+Comment[pl]=Ścieżka do głównego katalogu SuperWaba
+Comment[pt]=A localização de base do seu SuperWaba
+Comment[pt_BR]=A localização de base do seu SuperWaba
+Comment[ru]=Путь к корневому каталогу SuperWaba
+Comment[sk]=Cesta ku SuperWaba koreňu
+Comment[sr]=Путања до вашег корена SuperWaba-е
+Comment[sr@Latn]=Putanja do vašeg korena SuperWaba-e
+Comment[sv]=Sökväg till SuperWaba-rotkatalog
+Comment[tr]=SuperWaba kök dizininizin yolu
+Comment[zh_CN]=您的 SuperWaba 根路径
+Comment[zh_TW]=您的 SuperWaba 根路徑
+Default=/usr/lib
+ValueType=QString
+
+[GNU]
+Type=install archive
+Source=%{kdevelop}/template-common/gnu.tar.gz
+Dest=%{dest}
+
+[PROJECT]
+Type=install
+EscapeXML=true
+Source=%{src}/sw.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILELIST]
+Type=install
+Source=%{src}/sw.filelist
+Dest=%{dest}/%{APPNAMELC}.filelist
+
+[MAKEFILE]
+Type=install
+Source=%{src}/src-Makefile
+Dest=%{dest}/Makefile
+
+[SOURCE]
+Type=install
+Source=%{src}/sw.java
+Dest=%{dest}/%{APPNAME}.java
+
+[MESSAGE]
+Type=Message
+Comment=Your application is setup to build. Edit the make targets to customize the file.
+Comment[ca]=La vostra aplicació està llesta per a ser construïda. Editeu els objectius de make per a personalitzar el fitxer.
+Comment[da]=Dit program er parat til at blive bygget. Redigér make targets for at indstille filen.
+Comment[de]=Ihre Anwendung ist bereit für das Erstellen. Bearbeiten Sie die Make-Targets, um die Datei an Ihre Bedürfnisse anzupassen.
+Comment[el]=Η εφαρμογή σας έχει ρυθμιστεί για κατασκευή. Επεξεργαστείτε τους προορισμούς κατασκευής για την προσαρμογή του αρχείου.
+Comment[en_GB]=Your application is setup to build. Edit the make targets to customise the file.
+Comment[es]=Su aplicación está lista para ser construída. Edite los objetivos make para personalizar el archivo.
+Comment[et]=Rakendus on ehitamiseks valmis. Faili kohandamiseks redigeeri ehitamise sihtmärke.
+Comment[eu]=Zure aplikazioa eraikitzeko konfiguratu da. Editatu make-en helburuak fitxategia pertsonalizatzeko.
+Comment[fa]=کاربرد شما برای ساختن برپا می‌شود. برای سفارشی کردن پرونده، هدفهای make را ویرایش کنید.
+Comment[fr]=Votre application est prête à être construite. Modifiez les cibles de « make » pour personnaliser le fichier.
+Comment[gl]=A súa aplicación esta configurada para compilar. Edite os obxectivos make para persoalizalo ficheiro.
+Comment[hu]=Az alkalmazás készen áll a lefordításra. A make-célpontok szerkeszthetők, ha szükséges.
+Comment[it]=L'applicazione è configurata per compilare. Modifica i target di make per personalizzare il file.
+Comment[nds]=Dien Programm kann opstellt warrn. Bewerk de "Make"-Telen för't Topassen vun de Datei.
+Comment[ne]=तपाईँको अनुप्रयोग निर्माण गर्नका लागि सेटअप भएको छ । फाइललाई अनुकूल गर्नका लागि मेक तार्गेटलाई सम्पादन गर्नुहोस् ।
+Comment[nl]=Uw toepassing kan worden gebouwd. Bewerk de make targets om het bestand naar eigen inzicht aan te passen.
+Comment[pl]=Program skonfigurowany. Dostosowanie pliku do własnych potrzeb jest możliwe przez modyfikację celów make.
+Comment[pt]=A sua aplicação está preparada para ser compilada. Edite os alvos do 'make' para personalizar o ficheiro.
+Comment[pt_BR]=A sua aplicação está preparada para ser compilada. Edite os alvos do 'make' para personalizar o ficheiro.
+Comment[ru]=Ваше приложение готово для сборки.
+Comment[sk]=Aplikácia je pripravená na build. Môžte si prispôsobiť make ciele.
+Comment[sr]=Ваш програм је спреман за градњу. Уредите циљеве справљача да бисте прилагодили фајл.
+Comment[sr@Latn]=Vaš program je spreman za gradnju. Uredite ciljeve spravljača da biste prilagodili fajl.
+Comment[sv]=Programmet är inställt att byggas. Redigera byggmålen för att anpassa filen.
+Comment[tr]=Uygulamanız derlenmeye hazır. Dosyayı özelleştirmek için make hedeflerini düzenleyin.
+Comment[zh_CN]=您的应用程序已设置为构建。编辑 make 目标可自定义文件。
+Comment[zh_TW]=您的應用程式已設定好可建立了。請編輯 make 目標來調整檔案。
+Archive=superwaba.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
diff --git a/languages/java/app_templates/superwaba/superwaba.png b/languages/java/app_templates/superwaba/superwaba.png
new file mode 100644
index 00000000..3492333d
--- /dev/null
+++ b/languages/java/app_templates/superwaba/superwaba.png
Binary files differ
diff --git a/languages/java/app_templates/superwaba/sw.filelist b/languages/java/app_templates/superwaba/sw.filelist
new file mode 100644
index 00000000..f219d672
--- /dev/null
+++ b/languages/java/app_templates/superwaba/sw.filelist
@@ -0,0 +1 @@
+%{APPNAME}.java
diff --git a/languages/java/app_templates/superwaba/sw.java b/languages/java/app_templates/superwaba/sw.java
new file mode 100644
index 00000000..e1c9927c
--- /dev/null
+++ b/languages/java/app_templates/superwaba/sw.java
@@ -0,0 +1,97 @@
+
+/** An example that shows the new user interface gadgets for grayscale */
+
+import waba.fx.*;
+import waba.sys.*;
+import waba.ui.*;
+
+public class %{APPNAME} extends MainWindow
+{
+ MenuBar mbar;
+ Button pushB;
+
+public %{APPNAME}()
+{
+ super( "%{APPNAME}", TAB_ONLY_BORDER );
+
+ setDoubleBuffer( true );
+ // use native style?
+ if ( waba.sys.Settings.platform.equals( "PalmOS" ) )
+ {
+ waba.sys.Settings.setPalmOSStyle( true );
+ }
+ // if we are a color device then we can use a nice color
+ // otherwise WHITE is the most readable
+ if ( !waba.sys.Settings.isColor )
+ {
+ Color.defaultBackColor = Color.WHITE;
+ waba.ui.MainWindow.getMainWindow().setBackColor( Color.WHITE );
+ }
+ else
+ {
+ Color.defaultBackColor = new Color( 213, 210, 205 );
+ waba.ui.MainWindow.getMainWindow().setBackColor( new Color( 213, 210, 205 ) );
+ }
+}
+
+public void onStart()
+{
+
+ initGUI();
+ Settings.appSecretKey = "installed";
+}
+
+// Called by the system to pass events to the application.
+public void onEvent( Event event )
+{
+ if ( event.type == ControlEvent.WINDOW_CLOSED )
+ {
+ if ( event.target == mbar )
+ {
+ switch ( mbar.getSelectedMenuItem() )
+ {
+ case 1:
+ quitApp();
+ break;
+ case 101:
+ showAbout();
+ break;
+ default :
+ break;
+ }
+ }
+ }
+ else if ( event.type == ControlEvent.PRESSED )
+ {
+ if ( event.target == pushB )
+ {
+ showAbout();
+ }
+ }
+}
+
+private void showAbout( )
+{
+ MessageBox mb = new MessageBox( "%{APPNAME}", "This is a small test app." );
+ mb.setDoubleBuffer( true );
+ popupBlockingModal( mb );
+}
+
+private void quitApp()
+{
+ exit( 0 );
+}
+
+
+private void initGUI()
+{
+ String col0[] = { "File","Exit..."};
+ String col1[] = { "Help","About" };
+
+ pushB = new Button( "Push me" );
+ add(pushB, CENTER, CENTER);
+ setMenuBar( mbar = new MenuBar( new String[][]{ col0, col1 }) );
+
+}
+
+}
diff --git a/languages/java/app_templates/superwaba/sw.kdevelop b/languages/java/app_templates/superwaba/sw.kdevelop
new file mode 100644
index 00000000..bddee282
--- /dev/null
+++ b/languages/java/app_templates/superwaba/sw.kdevelop
@@ -0,0 +1,94 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ <keywords>
+ <keyword>Java</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevcustomproject>
+ <run>
+ <mainprogram>make test</mainprogram>
+ <programargs/>
+ <terminal>true</terminal>
+ <envvars/>
+ </run>
+ <envvars/>
+ <build>
+ <buildtool>make</buildtool>
+ <builddir/>
+ </build>
+ <make>
+ <abortonerror>true</abortonerror>
+ <numberofjobs>1</numberofjobs>
+ <dontact>false</dontact>
+ <makebin/>
+ <envvars/>
+ </make>
+ <makeenvvars/>
+ </kdevcustomproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="Makefile" name="Build" />
+ <group pattern="*.java" name="Source" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="java"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/java/backgroundparser.cpp b/languages/java/backgroundparser.cpp
new file mode 100644
index 00000000..4081949c
--- /dev/null
+++ b/languages/java/backgroundparser.cpp
@@ -0,0 +1,363 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "backgroundparser.h"
+#include "javasupportpart.h"
+#include "javasupport_events.h"
+#include "driver.h"
+#include "kdevdeepcopy.h"
+#include "kdevdriver.h"
+
+#if QT_VERSION < 0x030100
+#include <kdevmutex.h>
+#else
+#include <qmutex.h>
+#endif
+
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+
+#include <kurl.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+
+class KDevSourceProvider: public SourceProvider
+{
+public:
+ KDevSourceProvider( JavaSupportPart* javaSupport )
+ : m_javaSupport( javaSupport ),
+ m_readFromDisk( false ) {}
+
+ void setReadFromDisk( bool b ) { m_readFromDisk = b; }
+ bool readFromDisk() const { return m_readFromDisk; }
+
+ virtual QString contents( const QString& fileName )
+ {
+ if( !m_readFromDisk ){
+ //kdDebug(9013) << "-------> kapp is locked = " << kapp->locked() << endl;
+ bool needToLock = kapp->locked() == false;
+
+ if( needToLock )
+ kapp->lock();
+
+ //kdDebug(9013) << "-------> kapp locked" << endl;
+
+ QPtrList<KParts::Part> parts( *m_javaSupport->partController()->parts() );
+ QPtrListIterator<KParts::Part> it( parts );
+ while( it.current() ){
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( it.current() );
+ ++it;
+
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if( !doc || !editIface || doc->url().path() != fileName )
+ continue;
+
+ QString contents = QString( editIface->text().ascii() ); // deep copy
+
+ if( needToLock )
+ kapp->unlock();
+
+ //kdDebug(9013) << "-------> kapp unlocked" << endl;
+
+ return contents;
+ }
+
+ if( needToLock )
+ kapp->unlock();
+ //kdDebug(9013) << "-------> kapp unlocked" << endl;
+ }
+
+ QFile f( fileName );
+ QTextStream stream( &f );
+ if( f.open(IO_ReadOnly) ){
+ QString contents = stream.read();
+ f.close();
+ return contents;
+ }
+
+ return QString::null;
+ }
+
+ virtual bool isModified( const QString& fileName )
+ {
+ Q_UNUSED( fileName );
+ return true;
+ }
+
+private:
+ JavaSupportPart* m_javaSupport;
+ bool m_readFromDisk;
+private:
+ KDevSourceProvider( const KDevSourceProvider& source );
+ void operator = ( const KDevSourceProvider& source );
+};
+
+class SynchronizedFileList
+{
+public:
+ SynchronizedFileList() {}
+
+ bool isEmpty() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.isEmpty();
+ }
+
+ uint count() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.count();
+ }
+
+ QPair<QString, bool> front() const
+ {
+ QMutexLocker locker( &m_mutex );
+ return m_fileList.front();
+ }
+
+ void clear()
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileList.clear();
+ }
+
+ void push_back( const QString& fileName, bool readFromDisk=false )
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileList.append( qMakePair(fileName, readFromDisk) ); /// \FIXME ROBE deepcopy?!
+ }
+
+ void pop_front()
+ {
+ QMutexLocker locker( &m_mutex );
+ m_fileList.pop_front();
+ }
+
+ bool contains( const QString& fileName ) const
+ {
+ QMutexLocker locker( &m_mutex );
+ QValueList< QPair<QString, bool> >::ConstIterator it = m_fileList.begin();
+ while( it != m_fileList.end() ){
+ if( (*it).first == fileName )
+ return true;
+ ++it;
+ }
+ return false;
+ }
+
+ void remove( const QString& fileName )
+ {
+ QMutexLocker locker( &m_mutex );
+ QValueList< QPair<QString, bool> >::Iterator it = m_fileList.begin();
+ while( it != m_fileList.end() ){
+ if( (*it).first == fileName )
+ m_fileList.remove( it );
+ ++it;
+ }
+ }
+
+private:
+ mutable QMutex m_mutex;
+ QValueList< QPair<QString, bool> > m_fileList;
+};
+
+BackgroundParser::BackgroundParser( JavaSupportPart* part, QWaitCondition* consumed )
+ : m_consumed( consumed ), m_javaSupport( part ), m_close( false )
+{
+ m_fileList = new SynchronizedFileList();
+ m_driver = new KDevDriver( m_javaSupport );
+ m_driver->setSourceProvider( new KDevSourceProvider(m_javaSupport) );
+ //disabled for now m_driver->setResolveDependencesEnabled( true );
+}
+
+BackgroundParser::~BackgroundParser()
+{
+ removeAllFiles();
+
+ delete( m_driver );
+ m_driver = 0;
+
+ delete m_fileList;
+ m_fileList = 0;
+}
+
+void BackgroundParser::addFile( const QString& fileName, bool readFromDisk )
+{
+ QString fn = deepCopy( fileName );
+
+ bool added = false;
+ if( !m_fileList->contains(fn) ){
+ m_fileList->push_back( fn, readFromDisk );
+ added = true;
+ }
+
+ if( added )
+ m_canParse.wakeAll();
+}
+
+void BackgroundParser::removeAllFiles()
+{
+ kdDebug(9013) << "BackgroundParser::removeAllFiles()" << endl;
+ QMutexLocker locker( &m_mutex );
+
+ QMap<QString, Unit*>::Iterator it = m_unitDict.begin();
+ while( it != m_unitDict.end() ){
+ Unit* unit = it.data();
+ ++it;
+ delete( unit );
+ unit = 0;
+ }
+ m_unitDict.clear();
+ m_driver->reset();
+ m_fileList->clear();
+
+ m_isEmpty.wakeAll();
+}
+
+void BackgroundParser::removeFile( const QString& fileName )
+{
+ QMutexLocker locker( &m_mutex );
+
+ if( Unit* unit = findUnit(fileName) ){
+ m_driver->remove( fileName );
+ m_unitDict.remove( fileName );
+ delete( unit );
+ unit = 0;
+ }
+
+ if( m_fileList->isEmpty() )
+ m_isEmpty.wakeAll();
+}
+
+Unit* BackgroundParser::parseFile( const QString& fileName, bool readFromDisk )
+{
+ static_cast<KDevSourceProvider*>( m_driver->sourceProvider() )->setReadFromDisk( readFromDisk );
+
+ m_driver->remove( fileName );
+ m_driver->parseFile( fileName );
+ RefJavaAST translationUnit = m_driver->takeTranslationUnit( fileName );
+
+ Unit* unit = new Unit;
+ unit->fileName = fileName;
+ unit->translationUnit = translationUnit;
+ unit->problems = m_driver->problems( fileName );
+
+ static_cast<KDevSourceProvider*>( m_driver->sourceProvider() )->setReadFromDisk( false );
+
+ if( m_unitDict.find(fileName) != m_unitDict.end() ){
+ Unit* u = m_unitDict[ fileName ];
+ m_unitDict.remove( fileName );
+ delete( u );
+ u = 0;
+ }
+
+ m_unitDict.insert( fileName, unit );
+
+ if( m_fileList->contains(fileName) ){
+ kdDebug(9013) << "========================> FILE: " << fileName << " IN QUEUE <=============" << endl;
+ } else {
+ KApplication::postEvent( m_javaSupport, new FileParsedEvent(fileName, unit->problems) );
+ }
+
+ m_currentFile = QString::null;
+
+ if( m_fileList->isEmpty() )
+ m_isEmpty.wakeAll();
+
+ return unit;
+}
+
+Unit* BackgroundParser::findUnit( const QString& fileName )
+{
+ QMap<QString, Unit*>::Iterator it = m_unitDict.find( fileName );
+ return it != m_unitDict.end() ? *it : 0;
+}
+
+RefJavaAST BackgroundParser::translationUnit( const QString& fileName )
+{
+ Unit* u = 0;
+ if( (u = findUnit(fileName)) == 0 ){
+ m_fileList->remove( fileName );
+ u = parseFile( fileName, false );
+ }
+
+ return u->translationUnit;
+}
+
+QValueList<Problem> BackgroundParser::problems( const QString& fileName )
+{
+ Unit* u = 0;
+ if( (u = findUnit(fileName)) == 0 ){
+ m_fileList->remove( fileName );
+ u = parseFile( fileName, false );
+ }
+
+ return u ? u->problems : QValueList<Problem>();
+}
+
+void BackgroundParser::close()
+{
+ QMutexLocker locker( &m_mutex );
+ m_close = true;
+ m_canParse.wakeAll();
+}
+
+bool BackgroundParser::filesInQueue()
+{
+ QMutexLocker locker( &m_mutex );
+
+ return m_fileList->count() || !m_currentFile.isEmpty();
+}
+
+void BackgroundParser::run()
+{
+ // (void) m_javaSupport->codeCompletion()->repository()->getEntriesInScope( QStringList(), false );
+
+ while( !m_close ){
+
+ m_mutex.lock();
+ while( m_fileList->isEmpty() ){
+ m_canParse.wait( &m_mutex );
+
+ if( m_close ){
+ break;
+ }
+ }
+
+ if( m_close ){
+ m_mutex.unlock();
+ break;
+ }
+
+ QPair<QString, bool> entry = m_fileList->front();
+ QString fileName = entry.first;
+ bool readFromDisk = entry.second;
+ m_currentFile = fileName;
+ m_fileList->pop_front();
+
+ (void) parseFile( fileName, readFromDisk );
+ m_mutex.unlock();
+ }
+
+ kdDebug(9013) << "!!!!!!!!!!!!!!!!!! BG PARSER DESTROYED !!!!!!!!!!!!" << endl;
+
+ //commented to fix #83352
+ //QThread::exit();
+}
diff --git a/languages/java/backgroundparser.h b/languages/java/backgroundparser.h
new file mode 100644
index 00000000..2029ebf5
--- /dev/null
+++ b/languages/java/backgroundparser.h
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef BACKGROUNDPARSER_H
+#define BACKGROUNDPARSER_H
+
+#include "driver.h"
+#include "JavaAST.hpp"
+
+#include <qthread.h>
+#include <qwaitcondition.h>
+#include <qmutex.h>
+#include <qmap.h>
+#include <kdebug.h>
+
+class JavaSupportPart;
+class TranslationUnitAST;
+class SynchronizedFileList;
+
+class Unit
+{
+public:
+ Unit() {}
+ ~Unit() {}
+
+ QString fileName;
+ QValueList<Problem> problems;
+ RefJavaAST translationUnit;
+
+protected:
+ Unit( const Unit& source );
+ void operator = ( const Unit& source );
+};
+
+class BackgroundParser: public QThread
+{
+public:
+ BackgroundParser( JavaSupportPart*, QWaitCondition* consumed );
+ virtual ~BackgroundParser();
+
+ QMutex& mutex() { return m_mutex; }
+ void lock() { m_mutex.lock(); }
+ void unlock() { m_mutex.unlock(); }
+
+ QWaitCondition& canParse() { return m_canParse; }
+ QWaitCondition& isEmpty() { return m_isEmpty; }
+
+ bool filesInQueue();
+
+ void addFile( const QString& fileName, bool readFromDisk=false );
+ void removeFile( const QString& fileName );
+ void removeAllFiles();
+
+ RefJavaAST translationUnit( const QString& fileName );
+ QValueList<Problem> problems( const QString& fileName );
+
+ void close();
+
+ virtual void run();
+
+protected:
+ Unit* findUnit( const QString& fileName );
+ Unit* parseFile( const QString& fileName, bool readFromDisk );
+
+private:
+ class KDevDriver* m_driver;
+ QString m_currentFile;
+ QWaitCondition m_canParse;
+ QWaitCondition m_isEmpty;
+ QWaitCondition* m_consumed;
+ QMutex m_mutex;
+ SynchronizedFileList* m_fileList;
+ JavaSupportPart* m_javaSupport;
+ bool m_close;
+ QMap<QString, Unit*> m_unitDict;
+};
+
+#endif
diff --git a/languages/java/configproblemreporter.ui b/languages/java/configproblemreporter.ui
new file mode 100644
index 00000000..580f60c4
--- /dev/null
+++ b/languages/java/configproblemreporter.ui
@@ -0,0 +1,257 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConfigureProblemReporter</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigureProblemReporter</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>588</width>
+ <height>490</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>&amp;Parsing</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>bgParserCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable background parsing</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>delayLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>msec</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>delaySlider</cstring>
+ </property>
+ <property name="maxValue">
+ <number>2000</number>
+ </property>
+ <property name="lineStep">
+ <number>250</number>
+ </property>
+ <property name="pageStep">
+ <number>500</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>Right</enum>
+ </property>
+ <property name="tickInterval">
+ <number>250</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Special Headers</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView" row="0" column="0" rowspan="5" colspan="1">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>specialHeaderListView</cstring>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ <spacer row="4" 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>61</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>pushButton6</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>pushButton5</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>pushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>pushButton4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>delaySlider</sender>
+ <signal>valueChanged(int)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>setDelayLabel(int)</slot>
+ </connection>
+ <connection>
+ <sender>bgParserCheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>bgParserCheckbox_toggled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>pushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>addSpecialHeader()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton4</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>removeSpecialHeader()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton5</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>moveUpSpecialHeader()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton6</sender>
+ <signal>clicked()</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>moveDownSpecialHeader()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>bgParserCheckbox</tabstop>
+ <tabstop>delaySlider</tabstop>
+ <tabstop>specialHeaderListView</tabstop>
+ <tabstop>pushButton3</tabstop>
+ <tabstop>pushButton4</tabstop>
+ <tabstop>pushButton5</tabstop>
+ <tabstop>pushButton6</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">configproblemreporter.ui.h</include>
+</includes>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>accept()</slot>
+ <slot>bgParserCheckbox_toggled( bool b )</slot>
+ <slot access="protected">setDelayLabel( int delay )</slot>
+ <slot>addSpecialHeader()</slot>
+ <slot>removeSpecialHeader()</slot>
+ <slot>moveUpSpecialHeader()</slot>
+ <slot>moveDownSpecialHeader()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/java/configproblemreporter.ui.h b/languages/java/configproblemreporter.ui.h
new file mode 100644
index 00000000..f68a0c80
--- /dev/null
+++ b/languages/java/configproblemreporter.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 slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+#include <kconfig.h>
+#include <kapplication.h>
+#include <klocale.h>
+
+void ConfigureProblemReporter::init()
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ bgParserCheckbox->setChecked( config->readBoolEntry("EnableJavaBgParser", true) );
+ delaySlider->setEnabled( bgParserCheckbox->isChecked() );
+ delaySlider->setValue( config->readNumEntry("BgParserDelay", 500) );
+ setDelayLabel( delaySlider->value() );
+}
+
+void ConfigureProblemReporter::destroy()
+{
+}
+
+void ConfigureProblemReporter::accept()
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ config->writeEntry( "EnableJavaBgParser", bgParserCheckbox->isChecked() );
+ if( bgParserCheckbox->isChecked() )
+ config->writeEntry( "BgParserDelay", delaySlider->value() );
+ config->sync();
+}
+
+
+void ConfigureProblemReporter::bgParserCheckbox_toggled( bool b )
+{
+ delaySlider->setEnabled( b );
+ if ( b == TRUE )
+ delayLabel->show();
+ else
+ delayLabel->hide();
+}
+
+
+void ConfigureProblemReporter::setDelayLabel( int delay )
+{
+ delayLabel->setText( i18n( "delay: %1 msec" ).arg( delay ) );
+}
+
+
+void ConfigureProblemReporter::addSpecialHeader()
+{
+
+}
+
+
+void ConfigureProblemReporter::removeSpecialHeader()
+{
+
+}
+
+
+void ConfigureProblemReporter::moveUpSpecialHeader()
+{
+
+}
+
+
+void ConfigureProblemReporter::moveDownSpecialHeader()
+{
+
+}
diff --git a/languages/java/doc/Makefile.am b/languages/java/doc/Makefile.am
new file mode 100644
index 00000000..adb0f24f
--- /dev/null
+++ b/languages/java/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = sw.toc java_bugs_gcc.toc java_bugs_sun.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/java/doc/java_bugs_gcc.toc b/languages/java/doc/java_bugs_gcc.toc
new file mode 100644
index 00000000..8162d1e1
--- /dev/null
+++ b/languages/java/doc/java_bugs_gcc.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Java bugs (GCC)</title>
+<base href="http://gcc.gnu.org/bugzilla/"/>
+<tocsect1 name="Query" url="query.cgi">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/java/doc/java_bugs_sun.toc b/languages/java/doc/java_bugs_sun.toc
new file mode 100644
index 00000000..779f2a32
--- /dev/null
+++ b/languages/java/doc/java_bugs_sun.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Java bugs (Sun)</title>
+<base href="http://developer.java.sun.com/developer/bugParade/"/>
+<tocsect1 name="Query" url="index.jshtml">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/java/doc/sw.toc b/languages/java/doc/sw.toc
new file mode 100644
index 00000000..da6356d2
--- /dev/null
+++ b/languages/java/doc/sw.toc
@@ -0,0 +1,146 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>SuperWaba 3.4.1 API</title>
+<base href="http://www.superwaba.com.br/doc/"/>
+<tocsect1 name="java.lang" url="java/lang/package-summary.html">
+ <tocsect2 name="Class" url="java/lang/Class.html"/>
+ <tocsect2 name="Math" url="java/lang/Math.html"/>
+ <tocsect2 name="Object" url="java/lang/Object.html"/>
+ <tocsect2 name="String" url="java/lang/String.html"/>
+ <tocsect2 name="StringBuffer" url="java/lang/StringBuffer.html"/>
+ <tocsect2 name="Throwable" url="java/lang/Throwable.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.palm.io.builtin" url="superwaba/ext/palm/io/builtin/package-summary.html">
+ <tocsect2 name="Address" url="superwaba/ext/palm/io/builtin/Address.html"/>
+ <tocsect2 name="Datebook" url="superwaba/ext/palm/io/builtin/Datebook.html"/>
+ <tocsect2 name="Mail" url="superwaba/ext/palm/io/builtin/Mail.html"/>
+ <tocsect2 name="Memo" url="superwaba/ext/palm/io/builtin/Memo.html"/>
+ <tocsect2 name="ToDo" url="superwaba/ext/palm/io/builtin/ToDo.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.palm.io.scanner" url="superwaba/ext/palm/io/scanner/package-summary.html">
+ <tocsect2 name="ScanEvent" url="superwaba/ext/palm/io/scanner/ScanEvent.html"/>
+ <tocsect2 name="Scan" url="superwaba/ext/palm/io/scanner/Scan.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.game" url="superwaba/ext/xplat/game/package-summary.html">
+ <tocsect2 name="AnimatedButton" url="superwaba/ext/xplat/game/AnimatedButton.html"/>
+ <tocsect2 name="AnimatedSprite" url="superwaba/ext/xplat/game/AnimatedSprite.html"/>
+ <tocsect2 name="Animation" url="superwaba/ext/xplat/game/Animation.html"/>
+ <tocsect2 name="AnimationEvent" url="superwaba/ext/xplat/game/AnimationEvent.html"/>
+ <tocsect2 name="GameEngine" url="superwaba/ext/xplat/game/GameEngine.html"/>
+ <tocsect2 name="HighScoreEntry" url="superwaba/ext/xplat/game/HightScoreEntry.html"/>
+ <tocsect2 name="HighScores" url="superwaba/ext/xplat/game/HighScores.html"/>
+ <tocsect2 name="Options" url="superwaba/ext/xplat/game/Options.html"/>
+ <tocsect2 name="Sprite" url="superwaba/ext/xplat/game/Sprite.html"/>
+ <tocsect2 name="TextRenderer" url="superwaba/ext/xplat/game/TextRenderer.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.io" url="superwaba/ext/xplat/io/package-summary.html">
+ <tocsect2 name="Storable" url="superwaba/ext/xplat/io/Storable.html"/>
+ <tocsect2 name="DataStream" url="superwaba/ext/xplat/io/DataStream.html"/>
+ <tocsect2 name="SerialPDB" url="superwaba/ext/xplat/io/SerialPDB.html"/>
+ <tocsect2 name="ObjectCatalog" url="superwaba/ext/xplat/io/ObjectCatalog.html"/>
+ <tocsect2 name="SerialPDBServer" url="superwaba/ext/xplat/io/SerialPDBServer.html"/>
+ <tocsect2 name="SerialSocketServer" url="superwaba/ext/xplat/io/SerialSocketServer.html"/>
+ <tocsect2 name="SerialSocket" url="superwaba/ext/xplat/io/SerialSocket.html"/>
+ <tocsect2 name="BufferStream" url="superwaba/ext/xplat/io/BufferStream.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.io.gps" url="superwaba/ext/xplat.io.gps/package-summary.html">
+ <tocsect2 name="GPS" url="superwaba/ext/xplat/io/gps/GPS.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.io.gps.garmin" url="superwaba/ext/xplat/io/gps/garmin/package-summary.html">
+ <tocsect2 name="Waypoint" url="superwaba/ext/xplat/io/gps/garmin/Waypoint.html"/>
+ <tocsect2 name="Route" url="superwaba/ext/xplat/io/gps/garmin/Route.html"/>
+ <tocsect2 name="Packet" url="superwaba/ext/xplat/io/gps/garmin/Packet.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.sql" url="superwaba/ext/.xplat/sql/package-summary.html">
+ <tocsect2 name="BatchUpdateException" url="superwaba/ext/xplat/sql/BatchUpdateException.html"/>
+ <tocsect2 name="Connection" url="superwaba/ext/xplat/sql/Connection.html"/>
+ <tocsect2 name="ResultSet" url="superwaba/ext/xplat/sql/ResultSet.html"/>
+ <tocsect2 name="SQLWarning" url="superwaba/ext/xplat/sql/SQLWarning.html"/>
+ <tocsect2 name="Driver" url="superwaba/ext/xplat/sql/Driver.html"/>
+ <tocsect2 name="Timestamp" url="superwaba/ext/xplat/sql/Timestamp.html"/>
+ <tocsect2 name="Blob" url="superwaba/ext/xplat/sql/Blob.html"/>
+ <tocsect2 name="DriverPropertyInfo" url="superwaba/ext/xplat/sql/DriverPropertyInfo.html"/>
+ <tocsect2 name="Ref" url="superwaba/ext/xplat/sql/Ref.html"/>
+ <tocsect2 name="Statement" url="superwaba/ext/xplat/sql/Statement.html"/>
+ <tocsect2 name="Types" url="superwaba/ext/xplat/sql/Types.html"/>
+ <tocsect2 name="PreparedStatement" url="superwaba/ext/xplat/sql/PreparedStatement.htm"/>l
+ <tocsect2 name="SQLException" url="superwaba/ext/xplat/sql/SQLException.html"/>
+ <tocsect2 name="c" url="superwaba/ext/xplat/sql/c.html"/>
+ <tocsect2 name="DataTruncation" url="superwaba/ext/xplat/sql/DatabaseMetaData.html"/>
+ <tocsect2 name="Time" url="superwaba/ext/xplat/sql/Time.html"/>
+ <tocsect2 name="ResultSetMetaData" url="superwaba/ext/xplat/sql/ResultSetMetaData.html"/>
+ <tocsect2 name="ParameterMetaData" url="superwaba/ext/xplat/sql/ParameterMetaData.html"/>
+ <tocsect2 name="DriverManager" url="superwaba/ext/xplat/sql/DriverManager.html"/>
+ <tocsect2 name="Date" url="superwaba/ext/xplat/sql/Date.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.sql.db2e" url="superwaba/ext/.xplat/sql/db2e/package-summary.html">
+ <tocsect2 name="Driver" url="superwaba/ext/xplat/sql/db2e/wdbc/Driver.html"/>
+ <tocsect2 name="BoundDate" url="superwaba/ext/xplat/sql/db2e/BoundDate.html"/>
+ <tocsect2 name="BoundTimestamp" url="superwaba/ext/xplat/sql/db2e/BoundTimestamp.html"/>
+ <tocsect2 name="c" url="superwaba/ext/xplat/sql/db2e/c.html"/>
+ <tocsect2 name="BoundInt" url="superwaba/ext/xplat/sql/db2e/BoundInt.html"/>
+ <tocsect2 name="DB2Exception" url="superwaba/ext/xplat/sql/db2e/DB2Exception.html"/>
+ <tocsect2 name="BoundBlob" url="superwaba/ext/xplat/sql/db2e/BoundBlob.html"/>
+ <tocsect2 name="Db2e" url="superwaba/ext/xplat/sql/db2e/Db2e.html"/>
+ <tocsect2 name="BoundString" url="superwaba/ext/xplat/sql/db2e/BoundString.html"/>
+ <tocsect2 name="BoundTime" url="superwaba/ext/xplat/sql/db2e/BoundTime.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.sql.db2e.wdbc" url="superwaba/ext/xplat/sql/db2e/wdbc/package-summary.html">
+ <tocsect2 name="Db2eConnection" url="superwaba/ext/xplat/sql/db2e/wdbc/Db2eConnection.html"/>
+ <tocsect2 name="Db2eMetaData" url="superwaba/ext/xplat/sql/db2e/wdbc/Db2eMetaData.html"/>
+ <tocsect2 name="Db2eStatement" url="superwaba/ext/xplat/sql/db2e/wdbc/Db2eStatement.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.ui" url="superwaba/ext/xplat/ui/package-summary.html">
+ <tocsect2 name="MultiEditMenu" url="superwaba/ext/xplat/ui/MultiEditMenu.html"/>
+ <tocsect2 name="ChoicesDialog" url="superwaba/ext/xplat/ui/ChoicesDialog.html"/>
+ <tocsect2 name="Grid" url="superwaba/ext/xplat/ui/Grid.html"/>
+ <tocsect2 name="ProgressBar" url="superwaba/ext/xplat/ui/ProgressBar.html"/>
+ <tocsect2 name="JustifiedContainer" url="superwaba/ext/xplat/ui/JustifiedContainer.html"/>
+ <tocsect2 name="BigNumber" url="superwaba/ext/xplat/ui/BigNumber.html"/>
+ <tocsect2 name="MultiEdit" url="superwaba/ext/xplat/ui/MultiEdit.html"/>
+ <tocsect2 name="SpinList" url="superwaba/ext/xplat/ui/SpinList.html"/>
+ <tocsect2 name="GridModel" url="superwaba/ext/xplat/ui/GridModel.html"/>
+ <tocsect2 name="GridContainer" url="superwaba/ext/xplat/ui/GridContainer.html"/>
+ <tocsect2 name="ColorList" url="superwaba/ext/xplat/ui/ColorList.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.util" url="superwaba/ext/xplat/util/package-summary.html">
+ <tocsect2 name="Compression" url="superwaba/ext/xplat/util/Compression.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.util.crypto" url="superwaba/ext/xplat/util/crypto/package-summary.html">
+ <tocsect2 name="MD5" url="superwaba/ext/xplat/util/crypto/MD5.html"/>
+ <tocsect2 name="BlowfishECB" url="superwaba/ext/xplat/util/crypto/BlowfishECB.html"/>
+ <tocsect2 name="SHA1" url="superwaba/ext/xplat/util/crypto/SHA1.html"/>
+ <tocsect2 name="BinConverter" url="superwaba/ext/xplat/util/crypto/BinConverter.html"/>
+ <tocsect2 name="TEA" url="superwaba/ext/xplat/util/crypto/TEA.html"/>
+ <tocsect2 name="BlowfishCBC" url="superwaba/ext/xplat/util/crypto/BlowfishCBC.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.util.datergf" url="superwaba/ext/xplat/util/datergf/package-summary.html">
+ <tocsect2 name="DateTime" url="superwaba/ext/xplat/util/datergf/DateTime.html"/>
+ <tocsect2 name="DTC" url="superwaba/ext/xplat/util/datergf/DTC.html"/>
+ <tocsect2 name="Calendar" url="superwaba/ext/xplat/util/datergf/Calendar.html"/>
+ <tocsect2 name="Time" url="superwaba/ext/xplat/util/datergf/Time.html"/>
+ <tocsect2 name="Date" url="superwaba/ext/xplat/util/datergf/Date.html"/>
+ <tocsect2 name="DateFormat" url="superwaba/ext/xplat/util/datergf/DateFormat.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.util.xml" url="superwaba/ext/xplat/util/xml/package-summary.html">
+ <tocsect2 name="XmlListener" url="superwaba/ext/xplat/util/xml/XmlListener.html"/>
+ <tocsect2 name="LiteParser" url="superwaba/ext/xplat/util/xml/LiteParser.html"/>
+ <tocsect2 name="HttpLiteParser" url="superwaba/ext/xplat/util/xml/HttpLiteParser.html"/>
+ <tocsect2 name="StreamBuffer" url="superwaba/ext/xplat/util/xml/StreamBuffer.html"/>
+ <tocsect2 name="HttpListener" url="superwaba/ext/xplat/util/xml/HttpListener.html"/>
+ <tocsect2 name="XmlLiteParser" url="superwaba/ext/xplat/util/xml/XmlLiteParser.html"/>
+ <tocsect2 name="HttpXmlListener" url="superwaba/ext/xplat/util/xml/HttpXmlListener.html"/>
+ <tocsect2 name="HttpXmlLiteParser" url="superwaba/ext/xplat/util/xml/HttpXmlLiteParser.html"/>
+ <tocsect2 name="ParserException" url="superwaba/ext/xplat/util/xml/ParserException.html"/>
+</tocsect1>
+<tocsect1 name="superwaba.ext.xplat.util.props" url="superwaba/ext/xplat/util/props/package-summary.html">
+ <tocsect2 name="Properties.Value" url="superwaba/ext/xplat/util/props/Properties.Value.html"/>
+ <tocsect2 name="Properties" url="superwaba/ext/xplat/util/props/Properties.html"/>
+ <tocsect2 name="Properties.Double" url="superwaba/ext/xplat/util/props/Properties.Double.html"/>
+ <tocsect2 name="Properties.Long" url="superwaba/ext/xplat/util/props/Properties.Long.html"/>
+ <tocsect2 name="Properties.Str" url="superwaba/ext/xplat/util/props/Properties.Str.html"/>
+ <tocsect2 name="Properties.Int" url="superwaba/ext/xplat/util/props/Properties.Int.html"/>
+ <tocsect2 name="Properties.Boolean" url="superwaba/ext/xplat/util/props/Properties.Boolean.html"/>
+</tocsect1>
+</kdeveloptoc>
+
diff --git a/languages/java/driver.cpp b/languages/java/driver.cpp
new file mode 100644
index 00000000..f5bb6bfc
--- /dev/null
+++ b/languages/java/driver.cpp
@@ -0,0 +1,227 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "JavaAST.hpp"
+#include "JavaLexer.hpp"
+#include "JavaRecognizer.hpp"
+
+#include <kdebug.h>
+#include <stdlib.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+
+#include <string>
+#include <sstream>
+
+class DefaultSourceProvider: public SourceProvider
+{
+public:
+ DefaultSourceProvider() {}
+
+ virtual QString contents( const QString& fileName )
+ {
+ QString source;
+
+ QFile f( fileName );
+ if( f.open(IO_ReadOnly) ){
+ QTextStream s( &f );
+ source = s.read();
+ f.close();
+ }
+ return source;
+ }
+
+ virtual bool isModified( const QString& fileName )
+ {
+ Q_UNUSED( fileName );
+ return true;
+ }
+
+private:
+ DefaultSourceProvider( const DefaultSourceProvider& source );
+ void operator = ( const DefaultSourceProvider& source );
+};
+
+
+Driver::Driver()
+ : lexer( 0 )
+{
+ m_sourceProvider = new DefaultSourceProvider();
+}
+
+Driver::~Driver()
+{
+ reset();
+ delete( m_sourceProvider );
+}
+
+SourceProvider* Driver::sourceProvider()
+{
+ return m_sourceProvider;
+}
+
+void Driver::setSourceProvider( SourceProvider* sourceProvider )
+{
+ if( m_sourceProvider )
+ delete( m_sourceProvider );
+ m_sourceProvider = sourceProvider;
+}
+
+void Driver::reset( )
+{
+ m_problems.clear();
+ m_includePaths.clear();
+
+ while( m_parsedUnits.size() ){
+ RefJavaAST unit = *m_parsedUnits.begin();
+ m_parsedUnits.remove( m_parsedUnits.begin() );
+ delete( unit );
+ }
+}
+
+void Driver::remove( const QString & fileName )
+{
+ m_problems.remove( fileName );
+
+ QMap<QString, RefJavaAST>::Iterator it = m_parsedUnits.find( fileName );
+ if( it != m_parsedUnits.end() ){
+ RefJavaAST unit = *it;
+ m_parsedUnits.remove( it );
+ delete( unit );
+ }
+}
+
+RefJavaAST Driver::takeTranslationUnit( const QString& fileName )
+{
+ QMap<QString, RefJavaAST>::Iterator it = m_parsedUnits.find( fileName );
+ RefJavaAST unit( *it );
+ //m_parsedUnits.remove( it );
+ m_parsedUnits[ fileName] = 0;
+ return unit;
+}
+
+RefJavaAST Driver::translationUnit( const QString& fileName ) const
+{
+ QMap<QString, RefJavaAST>::ConstIterator it = m_parsedUnits.find( fileName );
+ return it != m_parsedUnits.end() ? *it : RefJavaAST();
+}
+
+void Driver::addProblem( const QString & fileName, const Problem & problem )
+{
+ findOrInsertProblemList( fileName ).append( problem );
+}
+
+QValueList < Problem >& Driver::findOrInsertProblemList( const QString & fileName )
+{
+ QMap<QString, QValueList<Problem> >::Iterator it = m_problems.find( fileName );
+ if( it != m_problems.end() )
+ return it.data();
+
+ QValueList<Problem> l;
+ m_problems.insert( fileName, l );
+ return m_problems[ fileName ];
+}
+
+QValueList < Problem > Driver::problems( const QString & fileName ) const
+{
+ QMap<QString, QValueList<Problem> >::ConstIterator it = m_problems.find( fileName );
+ if( it != m_problems.end() )
+ return it.data();
+ return QValueList<Problem>();
+}
+
+void Driver::parseFile( const QString& fileName, bool onlyPreProcess, bool force )
+{
+ QFileInfo fileInfo( fileName );
+ QString absFilePath = fileInfo.absFilePath();
+
+ QMap<QString, RefJavaAST>::Iterator it = m_parsedUnits.find( absFilePath );
+
+ if( force && it != m_parsedUnits.end() ){
+ takeTranslationUnit( absFilePath );
+ } else if( it != m_parsedUnits.end() && *it != 0 ){
+ // file already processed
+ return;
+ }
+
+ m_problems.remove( fileName );
+
+ m_currentFileName = fileName;
+
+ std::string source( sourceProvider()->contents(fileName).utf8() );
+ std::istringstream in( source.c_str() );
+
+ JavaLexer lex( in );
+ lex.setDriver( this );
+ lexer = &lex;
+ setupLexer( &lex );
+
+
+ /// @todo lex.setSource( sourceProvider()->contents(fileName) );
+
+ RefJavaAST translationUnit;
+ if( !onlyPreProcess ){
+ JavaRecognizer parser( lex );
+ parser.setDriver( this );
+ setupParser( &parser );
+
+
+ try{
+ // make an ast factory
+ ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory;
+ // initialize and put it in the parser...
+ parser.initializeASTFactory (ast_factory);
+ parser.setASTFactory (&ast_factory);
+
+ parser.compilationUnit();
+
+ RefJavaAST translationUnit = RefJavaAST( parser.getAST() );
+ m_parsedUnits.insert( fileName, translationUnit );
+
+ } catch( ANTLR_USE_NAMESPACE(antlr)ANTLRException& ex ){}
+
+ }
+
+ m_currentFileName = QString::null;
+ lexer = 0;
+
+ fileParsed( fileName );
+}
+
+void Driver::setupLexer( JavaLexer * // lexer
+ )
+{
+}
+
+void Driver::setupParser( JavaRecognizer * parser )
+{
+ Q_UNUSED( parser );
+}
+
+void Driver::addIncludePath( const QString &path )
+{
+ if( !path.stripWhiteSpace().isEmpty() )
+ m_includePaths << path;
+}
+
+void Driver::fileParsed( const QString & fileName )
+{
+ Q_UNUSED( fileName );
+}
diff --git a/languages/java/driver.h b/languages/java/driver.h
new file mode 100644
index 00000000..c830875e
--- /dev/null
+++ b/languages/java/driver.h
@@ -0,0 +1,139 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef DRIVER_H
+#define DRIVER_H
+
+#include "JavaAST.hpp"
+
+#include <qpair.h>
+#include <qvaluestack.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+class JavaLexer;
+class JavaRecognizer;
+
+class Problem
+{
+public:
+ enum
+ {
+ Level_Error = 0,
+ Level_Warning,
+ Level_Todo,
+ Level_Fixme
+ };
+
+public:
+ Problem() {}
+ Problem( const Problem& source )
+ : m_text( source.m_text ), m_line( source.m_line ),
+ m_column( source.m_column ), m_level( source.m_level ) {}
+ Problem( const QString& text, int line, int column, int level=Level_Error )
+ : m_text( text ), m_line( line ), m_column( column ), m_level(level) {}
+
+ Problem& operator = ( const Problem& source )
+ {
+ m_text = source.m_text;
+ m_line = source.m_line;
+ m_column = source.m_column;
+ m_level = source.m_level;
+ return( *this );
+ }
+
+ bool operator == ( const Problem& p ) const
+ {
+ return m_text == p.m_text && m_line == p.m_line && m_column == p.m_column && m_level == p.m_level;
+ }
+
+ QString text() const { return m_text; }
+ int line() const { return m_line; }
+ int column() const { return m_column; }
+ int level() const { return m_level; }
+
+private:
+ QString m_text;
+ int m_line;
+ int m_column;
+ int m_level;
+};
+
+class SourceProvider
+{
+public:
+ SourceProvider() {}
+ virtual ~SourceProvider() {}
+
+ virtual QString contents( const QString& fileName ) = 0;
+ virtual bool isModified( const QString& fileName ) = 0;
+
+private:
+ SourceProvider( const SourceProvider& source );
+ void operator = ( const SourceProvider& source );
+};
+
+class Driver
+{
+public:
+ Driver();
+ virtual ~Driver();
+
+ SourceProvider* sourceProvider();
+ void setSourceProvider( SourceProvider* sourceProvider );
+
+ virtual void reset();
+
+ virtual void parseFile( const QString& fileName, bool onlyPreProcesss=false, bool force=false );
+ virtual void fileParsed( const QString& fileName );
+ virtual void remove( const QString& fileName );
+
+ virtual void addProblem( const QString& fileName, const Problem& problem );
+
+ QString currentFileName() const { return m_currentFileName; }
+ RefJavaAST takeTranslationUnit( const QString& fileName );
+ RefJavaAST translationUnit( const QString& fileName ) const;
+ QValueList<Problem> problems( const QString& fileName ) const;
+
+ QStringList includePaths() const { return m_includePaths; }
+ virtual void addIncludePath( const QString &path );
+
+ const QMap<QString, RefJavaAST> &parsedUnits() const { return m_parsedUnits; }
+
+protected:
+ virtual void setupLexer( JavaLexer* lexer );
+ virtual void setupParser( JavaRecognizer* parser );
+
+private:
+ QValueList<Problem>& findOrInsertProblemList( const QString& fileName );
+
+private:
+ QString m_currentFileName;
+ QMap< QString, QValueList<Problem> > m_problems;
+ QMap< QString, RefJavaAST > m_parsedUnits;
+ QStringList m_includePaths;
+ JavaLexer *lexer;
+ SourceProvider* m_sourceProvider;
+
+private:
+ Driver( const Driver& source );
+ void operator = ( const Driver& source );
+};
+
+#endif
diff --git a/languages/java/file_templates/Makefile.am b/languages/java/file_templates/Makefile.am
new file mode 100644
index 00000000..dc3b82a9
--- /dev/null
+++ b/languages/java/file_templates/Makefile.am
@@ -0,0 +1,4 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = java
+
+
diff --git a/languages/java/file_templates/java b/languages/java/file_templates/java
new file mode 100644
index 00000000..f490b79c
--- /dev/null
+++ b/languages/java/file_templates/java
@@ -0,0 +1,6 @@
+/*
+ * Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ *
+*/
diff --git a/languages/java/java.g b/languages/java/java.g
new file mode 100644
index 00000000..1f825ec5
--- /dev/null
+++ b/languages/java/java.g
@@ -0,0 +1,1318 @@
+
+header "pre_include_hpp" {
+ #include "driver.h"
+ #include "JavaAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefJavaAST(ast)->setLine( t->getLine() );\
+ RefJavaAST(ast)->setColumn( t->getColumn() ); \
+ }
+}
+
+options {
+ language="Cpp";
+}
+
+/** Java 1.3 Recognizer
+ *
+ * Run 'java Main [-showtree] directory-full-of-java-files'
+ *
+ * [The -showtree option pops up a Swing frame that shows
+ * the AST constructed from the parser.]
+ *
+ * Run 'java Main <directory full of java files>'
+ *
+ * Contributing authors:
+ * John Mitchell johnm@non.net
+ * Terence Parr parrt@magelang.com
+ * John Lilley jlilley@empathy.com
+ * Scott Stanchfield thetick@magelang.com
+ * Markus Mohnen mohnen@informatik.rwth-aachen.de
+ * Peter Williams pete.williams@sun.com
+ * Allan Jacobs Allan.Jacobs@eng.sun.com
+ * Steve Messick messick@redhills.com
+ * John Pybus john@pybus.org
+ *
+ * Version 1.00 December 9, 1997 -- initial release
+ * Version 1.01 December 10, 1997
+ * fixed bug in octal def (0..7 not 0..8)
+ * Version 1.10 August 1998 (parrt)
+ * added tree construction
+ * fixed definition of WS,comments for mac,pc,unix newlines
+ * added unary plus
+ * Version 1.11 (Nov 20, 1998)
+ * Added "shutup" option to turn off last ambig warning.
+ * Fixed inner class def to allow named class defs as statements
+ * synchronized requires compound not simple statement
+ * add [] after builtInType DOT class in primaryExpression
+ * "const" is reserved but not valid..removed from modifiers
+ * Version 1.12 (Feb 2, 1999)
+ * Changed LITERAL_xxx to xxx in tree grammar.
+ * Updated java.g to use tokens {...} now for 2.6.0 (new feature).
+ *
+ * Version 1.13 (Apr 23, 1999)
+ * Didn't have (stat)? for else clause in tree parser.
+ * Didn't gen ASTs for interface extends. Updated tree parser too.
+ * Updated to 2.6.0.
+ * Version 1.14 (Jun 20, 1999)
+ * Allowed final/abstract on local classes.
+ * Removed local interfaces from methods
+ * Put instanceof precedence where it belongs...in relationalExpr
+ * It also had expr not type as arg; fixed it.
+ * Missing ! on SEMI in classBlock
+ * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus).
+ * fixed: didn't like Object[].class in parser or tree parser
+ * Version 1.15 (Jun 26, 1999)
+ * Screwed up rule with instanceof in it. :( Fixed.
+ * Tree parser didn't like (expr).something; fixed.
+ * Allowed multiple inheritance in tree grammar. oops.
+ * Version 1.16 (August 22, 1999)
+ * Extending an interface built a wacky tree: had extra EXTENDS.
+ * Tree grammar didn't allow multiple superinterfaces.
+ * Tree grammar didn't allow empty var initializer: {}
+ * Version 1.17 (October 12, 1999)
+ * ESC lexer rule allowed 399 max not 377 max.
+ * java.tree.g didn't handle the expression of synchronized
+ * statements.
+ * Version 1.18 (August 12, 2001)
+ * Terence updated to Java 2 Version 1.3 by
+ * observing/combining work of Allan Jacobs and Steve
+ * Messick. Handles 1.3 src. Summary:
+ * o primary didn't include boolean.class kind of thing
+ * o constructor calls parsed explicitly now:
+ * see explicitConstructorInvocation
+ * o add strictfp modifier
+ * o missing objBlock after new expression in tree grammar
+ * o merged local class definition alternatives, moved after declaration
+ * o fixed problem with ClassName.super.field
+ * o reordered some alternatives to make things more efficient
+ * o long and double constants were not differentiated from int/float
+ * o whitespace rule was inefficient: matched only one char
+ * o add an examples directory with some nasty 1.3 cases
+ * o made Main.java use buffered IO and a Reader for Unicode support
+ * o supports UNICODE?
+ * Using Unicode charVocabulay makes code file big, but only
+ * in the bitsets at the end. I need to make ANTLR generate
+ * unicode bitsets more efficiently.
+ * Version 1.19 (April 25, 2002)
+ * Terence added in nice fixes by John Pybus concerning floating
+ * constants and problems with super() calls. John did a nice
+ * reorg of the primary/postfix expression stuff to read better
+ * and makes f.g.super() parse properly (it was METHOD_CALL not
+ * a SUPER_CTOR_CALL). Also:
+ *
+ * o "finally" clause was a root...made it a child of "try"
+ * o Added stuff for asserts too for Java 1.4, but *commented out*
+ * as it is not backward compatible.
+ *
+ * Version 1.20 (October 27, 2002)
+ *
+ * Terence ended up reorging John Pybus' stuff to
+ * remove some nondeterminisms and some syntactic predicates.
+ * Note that the grammar is stricter now; e.g., this(...) must
+ * be the first statement.
+ *
+ * Trinary ?: operator wasn't working as array name:
+ * (isBig ? bigDigits : digits)[i];
+ *
+ * Checked parser/tree parser on source for
+ * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4,
+ * and the 110k-line jGuru server source.
+ *
+ * Version tracking now done with following ID:
+ *
+ * $Id$
+ *
+ * This grammar is in the PUBLIC DOMAIN
+ */
+class JavaRecognizer extends Parser;
+options {
+ k = 2; // two token lookahead
+ exportVocab=Java; // Call its vocabulary "Java"
+ codeGenMakeSwitchThreshold = 2; // Some optimizations
+ codeGenBitsetTestThreshold = 3;
+ defaultErrorHandler = true;
+ buildAST = true;
+ ASTLabelType = "RefJavaAST";
+}
+
+tokens {
+ BLOCK; MODIFIERS; OBJBLOCK; SLIST; CTOR_DEF; METHOD_DEF; VARIABLE_DEF;
+ INSTANCE_INIT; STATIC_INIT; TYPE; CLASS_DEF; INTERFACE_DEF;
+ PACKAGE_DEF; ARRAY_DECLARATOR; EXTENDS_CLAUSE; IMPLEMENTS_CLAUSE;
+ PARAMETERS; PARAMETER_DEF; LABELED_STAT; TYPECAST; INDEX_OP;
+ POST_INC; POST_DEC; METHOD_CALL; EXPR; ARRAY_INIT;
+ IMPORT; UNARY_MINUS; UNARY_PLUS; CASE_GROUP; ELIST; FOR_INIT; FOR_CONDITION;
+ FOR_ITERATOR; EMPTY_STAT; FINAL="final"; ABSTRACT="abstract";
+ STRICTFP="strictfp"; SUPER_CTOR_CALL; CTOR_CALL;
+}
+
+{
+private:
+ Driver* m_driver;
+
+public:
+ void setDriver( Driver* d ) { m_driver = d; }
+ void setFileName( const QString& fileName ) { m_driver->currentFileName() = fileName; }
+
+ void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) );
+ }
+
+ void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(errorMessage.c_str()), LT(1)->getLine(), LT(1)->getColumn()) );
+ }
+
+ void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(message.c_str()), LT(1)->getLine(), LT(1)->getColumn()) );
+ }
+}
+
+// Compilation Unit: In Java, this is a single file. This is the start
+// rule for this parser
+compilationUnit
+ : // A compilation unit starts with an optional package definition
+ ( packageDefinition
+ | /* nothing */
+ )
+
+ // Next we have a series of zero or more import statements
+ ( importDefinition )*
+
+ // Wrapping things up with any number of class or interface
+ // definitions
+ ( typeDefinition )*
+
+ EOF!
+ ;
+
+// Package statement: "package" followed by an identifier.
+packageDefinition
+ options {defaultErrorHandler = true;} // let ANTLR handle errors
+ : p:"package"^ {#p->setType(PACKAGE_DEF);} identifier SEMI!
+ ;
+
+// Import statement: import followed by a package or class name
+importDefinition
+ options {defaultErrorHandler = true;}
+ : i:"import"^ {#i->setType(IMPORT);} identifierStar SEMI!
+ ;
+
+// A type definition in a file is either a class or interface definition.
+typeDefinition
+ options {defaultErrorHandler = true;}
+ : m:modifiers!
+ ( classDefinition[#m]
+ | interfaceDefinition[#m]
+ )
+ | SEMI!
+ ;
+
+/** A declaration is the creation of a reference or primitive-type variable
+ * Create a separate Type/Var tree for each var in the var list.
+ */
+declaration!
+ : m:modifiers t:typeSpec[false] v:variableDefinitions[#m,#t]
+ {#declaration = #v;}
+ ;
+
+// A type specification is a type name with possible brackets afterwards
+// (which would make it an array type).
+typeSpec[bool addImagNode]
+ : classTypeSpec[addImagNode]
+ | builtInTypeSpec[addImagNode]
+ ;
+
+// A class type specification is a class type with possible brackets afterwards
+// (which would make it an array type).
+classTypeSpec[bool addImagNode]
+ : identifier (lb:LBRACK^ {#lb->setType(ARRAY_DECLARATOR);} RBRACK!)*
+ {
+ if ( addImagNode ) {
+ #classTypeSpec = #(#[TYPE,"TYPE"], #classTypeSpec);
+ }
+ }
+ ;
+
+// A builtin type specification is a builtin type with possible brackets
+// afterwards (which would make it an array type).
+builtInTypeSpec[bool addImagNode]
+ : builtInType (lb:LBRACK^ {#lb->setType(ARRAY_DECLARATOR);} RBRACK!)*
+ {
+ if ( addImagNode ) {
+ #builtInTypeSpec = #(#[TYPE,"TYPE"], #builtInTypeSpec);
+ }
+ }
+ ;
+
+// A type name. which is either a (possibly qualified) class name or
+// a primitive (builtin) type
+type
+ : identifier
+ | builtInType
+ ;
+
+// The primitive types.
+builtInType
+ : "void"
+ | "boolean"
+ | "byte"
+ | "char"
+ | "short"
+ | "int"
+ | "float"
+ | "long"
+ | "double"
+ ;
+
+// A (possibly-qualified) java identifier. We start with the first IDENT
+// and expand its name by adding dots and following IDENTS
+identifier
+ : IDENT ( DOT^ IDENT )*
+ ;
+
+identifierStar
+ : IDENT
+ ( DOT^ IDENT )*
+ ( DOT^ STAR )?
+ ;
+
+// A list of zero or more modifiers. We could have used (modifier)* in
+// place of a call to modifiers, but I thought it was a good idea to keep
+// this rule separate so they can easily be collected in a Vector if
+// someone so desires
+modifiers
+ : ( modifier )*
+ {#modifiers = #([MODIFIERS, "MODIFIERS"], #modifiers);}
+ ;
+
+// modifiers for Java classes, interfaces, class/instance vars and methods
+modifier
+ : "private"
+ | "public"
+ | "protected"
+ | "static"
+ | "transient"
+ | "final"
+ | "abstract"
+ | "native"
+ | "threadsafe"
+ | "synchronized"
+// | "const" // reserved word, but not valid
+ | "volatile"
+ | "strictfp"
+ ;
+
+// Definition of a Java class
+classDefinition![RefJavaAST modifiers]
+ : "class" IDENT
+ // it _might_ have a superclass...
+ sc:superClassClause
+ // it might implement some interfaces...
+ ic:implementsClause
+ // now parse the body of the class
+ cb:classBlock
+ {#classDefinition = #(#[CLASS_DEF,"CLASS_DEF"],
+ modifiers,IDENT,sc,ic,cb);}
+ ;
+
+superClassClause!
+ : ( "extends" id:identifier )?
+ {#superClassClause = #(#[EXTENDS_CLAUSE,"EXTENDS_CLAUSE"],id);}
+ ;
+
+// Definition of a Java Interface
+interfaceDefinition![RefJavaAST modifiers]
+ : "interface" IDENT
+ // it might extend some other interfaces
+ ie:interfaceExtends
+ // now parse the body of the interface (looks like a class...)
+ cb:classBlock
+ {#interfaceDefinition = #(#[INTERFACE_DEF,"INTERFACE_DEF"],
+ modifiers,IDENT,ie,cb);}
+ ;
+
+// This is the body of a class. You can have fields and extra semicolons,
+// That's about it (until you see what a field is...)
+classBlock
+ : LCURLY!
+ ( field | SEMI! )*
+ RCURLY!
+ {#classBlock = #([OBJBLOCK, "OBJBLOCK"], #classBlock);}
+ ;
+
+// An interface can extend several other interfaces...
+interfaceExtends
+ : (
+ e:"extends"!
+ identifier ( COMMA! identifier )*
+ )?
+ {#interfaceExtends = #(#[EXTENDS_CLAUSE,"EXTENDS_CLAUSE"],
+ #interfaceExtends);}
+ ;
+
+// A class can implement several interfaces...
+implementsClause
+ : (
+ i:"implements"! identifier ( COMMA! identifier )*
+ )?
+ {#implementsClause = #(#[IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE"],
+ #implementsClause);}
+ ;
+
+// Now the various things that can be defined inside a class or interface...
+// Note that not all of these are really valid in an interface (constructors,
+// for example), and if this grammar were used for a compiler there would
+// need to be some semantic checks to make sure we're doing the right thing...
+field!
+ : // method, constructor, or variable declaration
+ mods:modifiers
+ ( h:ctorHead s:constructorBody // constructor
+ {#field = #(#[CTOR_DEF,"CTOR_DEF"], mods, h, s);}
+
+ | cd:classDefinition[#mods] // inner class
+ {#field = #cd;}
+
+ | id:interfaceDefinition[#mods] // inner interface
+ {#field = #id;}
+
+ | t:typeSpec[false] // method or variable declaration(s)
+ ( IDENT // the name of the method
+
+ // parse the formal parameter declarations.
+ LPAREN! param:parameterDeclarationList RPAREN!
+
+ rt:declaratorBrackets[#t]
+
+ // get the list of exceptions that this method is
+ // declared to throw
+ (tc:throwsClause)?
+
+ ( s2:compoundStatement | SEMI )
+ {#field = #(#[METHOD_DEF,"METHOD_DEF"],
+ mods,
+ #(#[TYPE,"TYPE"],rt),
+ IDENT,
+ param,
+ tc,
+ s2);}
+ | v:variableDefinitions[#mods,#t] SEMI
+// {#field = #(#[VARIABLE_DEF,"VARIABLE_DEF"], v);}
+ {#field = #v;}
+ )
+ )
+
+ // "static { ... }" class initializer
+ | "static" s3:compoundStatement
+ {#field = #(#[STATIC_INIT,"STATIC_INIT"], s3);}
+
+ // "{ ... }" instance initializer
+ | s4:compoundStatement
+ {#field = #(#[INSTANCE_INIT,"INSTANCE_INIT"], s4);}
+ ;
+
+constructorBody
+ : lc:LCURLY^ {#lc->setType(SLIST);}
+ ( options { greedy=true; } : explicitConstructorInvocation)?
+ (statement)*
+ RCURLY!
+ ;
+
+/** Catch obvious constructor calls, but not the expr.super(...) calls */
+explicitConstructorInvocation
+ : "this"! lp1:LPAREN^ argList RPAREN! SEMI!
+ {#lp1->setType(CTOR_CALL);}
+ | "super"! lp2:LPAREN^ argList RPAREN! SEMI!
+ {#lp2->setType(SUPER_CTOR_CALL);}
+ ;
+
+variableDefinitions[RefJavaAST mods, RefJavaAST t]
+ : variableDeclarator[(RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)mods),
+ (RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)t)]
+ ( COMMA!
+ variableDeclarator[(RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)mods),
+ (RefJavaAST)getASTFactory()->dupTree((antlr::RefAST)t)]
+ )*
+ ;
+
+/** Declaration of a variable. This can be a class/instance variable,
+ * or a local variable in a method
+ * It can also include possible initialization.
+ */
+variableDeclarator![RefJavaAST mods, RefJavaAST t]
+ : id:IDENT d:declaratorBrackets[t] v:varInitializer
+ {#variableDeclarator = #(#[VARIABLE_DEF,"VARIABLE_DEF"], mods, #(#[TYPE,"TYPE"],d), id, v);}
+ ;
+
+declaratorBrackets[RefJavaAST typ]
+ : {#declaratorBrackets=typ;}
+ (lb:LBRACK^ {#lb->setType(ARRAY_DECLARATOR);} RBRACK!)*
+ ;
+
+varInitializer
+ : ( ASSIGN^ initializer )?
+ ;
+
+// This is an initializer used to set up an array.
+arrayInitializer
+ : lc:LCURLY^ {#lc->setType(ARRAY_INIT);}
+ ( initializer
+ (
+ // CONFLICT: does a COMMA after an initializer start a new
+ // initializer or start the option ',' at end?
+ // ANTLR generates proper code by matching
+ // the comma as soon as possible.
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ :
+ COMMA! initializer
+ )*
+ (COMMA!)?
+ )?
+ RCURLY!
+ ;
+
+// The two "things" that can initialize an array element are an expression
+// and another (nested) array initializer.
+initializer
+ : expression
+ | arrayInitializer
+ ;
+
+// This is the header of a method. It includes the name and parameters
+// for the method.
+// This also watches for a list of exception classes in a "throws" clause.
+ctorHead
+ : IDENT // the name of the method
+
+ // parse the formal parameter declarations.
+ LPAREN! parameterDeclarationList RPAREN!
+
+ // get the list of exceptions that this method is declared to throw
+ (throwsClause)?
+ ;
+
+// This is a list of exception classes that the method is declared to throw
+throwsClause
+ : "throws"^ identifier ( COMMA! identifier )*
+ ;
+
+// A list of formal parameters
+parameterDeclarationList
+ : ( parameterDeclaration ( COMMA! parameterDeclaration )* )?
+ {#parameterDeclarationList = #(#[PARAMETERS,"PARAMETERS"],
+ #parameterDeclarationList);}
+ ;
+
+// A formal parameter.
+parameterDeclaration!
+ : pm:parameterModifier t:typeSpec[false] id:IDENT
+ pd:declaratorBrackets[#t]
+ {#parameterDeclaration = #(#[PARAMETER_DEF,"PARAMETER_DEF"],
+ pm, #([TYPE,"TYPE"],pd), id);}
+ ;
+
+parameterModifier
+ : (f:"final")?
+ {#parameterModifier = #(#[MODIFIERS,"MODIFIERS"], f);}
+ ;
+
+// Compound statement. This is used in many contexts:
+// Inside a class definition prefixed with "static":
+// it is a class initializer
+// Inside a class definition without "static":
+// it is an instance initializer
+// As the body of a method
+// As a completely indepdent braced block of code inside a method
+// it starts a new scope for variable definitions
+
+compoundStatement
+ : lc:LCURLY^ {#lc->setType(SLIST);}
+ // include the (possibly-empty) list of statements
+ (statement)*
+ RCURLY!
+ ;
+
+statement
+ // A list of statements in curly braces -- start a new scope!
+ : compoundStatement
+
+ // declarations are ambiguous with "ID DOT" relative to expression
+ // statements. Must backtrack to be sure. Could use a semantic
+ // predicate to test symbol table to see what the type was coming
+ // up, but that's pretty hard without a symbol table ;)
+ | (declaration)=> declaration SEMI!
+
+ // An expression statement. This could be a method call,
+ // assignment statement, or any other expression evaluated for
+ // side-effects.
+ | expression SEMI!
+
+ // class definition
+ | m:modifiers! classDefinition[#m]
+
+ // Attach a label to the front of a statement
+ | IDENT c:COLON^ {#c->setType(LABELED_STAT);} statement
+
+ // If-else statement
+ | "if"^ LPAREN! expression RPAREN! statement
+ (
+ // CONFLICT: the old "dangling-else" problem...
+ // ANTLR generates proper code matching
+ // as soon as possible. Hush warning.
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ :
+ "else"! statement
+ )?
+
+ // For statement
+ | "for"^
+ LPAREN!
+ forInit SEMI! // initializer
+ forCond SEMI! // condition test
+ forIter // updater
+ RPAREN!
+ statement // statement to loop over
+
+ // While statement
+ | "while"^ LPAREN! expression RPAREN! statement
+
+ // do-while statement
+ | "do"^ statement "while"! LPAREN! expression RPAREN! SEMI!
+
+ // get out of a loop (or switch)
+ | "break"^ (IDENT)? SEMI!
+
+ // do next iteration of a loop
+ | "continue"^ (IDENT)? SEMI!
+
+ // Return an expression
+ | "return"^ (expression)? SEMI!
+
+ // switch/case statement
+ | "switch"^ LPAREN! expression RPAREN! LCURLY!
+ ( casesGroup )*
+ RCURLY!
+
+ // exception try-catch block
+ | tryBlock
+
+ // throw an exception
+ | "throw"^ expression SEMI!
+
+ // synchronize a statement
+ | "synchronized"^ LPAREN! expression RPAREN! compoundStatement
+
+ // asserts (uncomment if you want 1.4 compatibility)
+ // | "assert"^ expression ( COLON! expression )? SEMI!
+
+ // empty statement
+ | s:SEMI {#s->setType(EMPTY_STAT);}
+ ;
+
+casesGroup
+ : ( // CONFLICT: to which case group do the statements bind?
+ // ANTLR generates proper code: it groups the
+ // many "case"/"default" labels together then
+ // follows them with the statements
+ options {
+ greedy = true;
+ }
+ :
+ aCase
+ )+
+ caseSList
+ {#casesGroup = #([CASE_GROUP, "CASE_GROUP"], #casesGroup);}
+ ;
+
+aCase
+ : ("case"^ expression | "default") COLON!
+ ;
+
+caseSList
+ : (statement)*
+ {#caseSList = #(#[SLIST,"SLIST"],#caseSList);}
+ ;
+
+// The initializer for a for loop
+forInit
+ // if it looks like a declaration, it is
+ : ( (declaration)=> declaration
+ // otherwise it could be an expression list...
+ | expressionList
+ )?
+ {#forInit = #(#[FOR_INIT,"FOR_INIT"],#forInit);}
+ ;
+
+forCond
+ : (expression)?
+ {#forCond = #(#[FOR_CONDITION,"FOR_CONDITION"],#forCond);}
+ ;
+
+forIter
+ : (expressionList)?
+ {#forIter = #(#[FOR_ITERATOR,"FOR_ITERATOR"],#forIter);}
+ ;
+
+// an exception handler try/catch block
+tryBlock
+ : "try"^ compoundStatement
+ (handler)*
+ ( finallyClause )?
+ ;
+
+finallyClause
+ : "finally"^ compoundStatement
+ ;
+
+// an exception handler
+handler
+ : "catch"^ LPAREN! parameterDeclaration RPAREN! compoundStatement
+ ;
+
+// expressions
+// Note that most of these expressions follow the pattern
+// thisLevelExpression :
+// nextHigherPrecedenceExpression
+// (OPERATOR nextHigherPrecedenceExpression)*
+// which is a standard recursive definition for a parsing an expression.
+// The operators in java have the following precedences:
+// lowest (13) = *= /= %= += -= <<= >>= >>>= &= ^= |=
+// (12) ?:
+// (11) ||
+// (10) &&
+// ( 9) |
+// ( 8) ^
+// ( 7) &
+// ( 6) == !=
+// ( 5) < <= > >=
+// ( 4) << >>
+// ( 3) +(binary) -(binary)
+// ( 2) * / %
+// ( 1) ++ -- +(unary) -(unary) ~ ! (type)
+// [] () (method call) . (dot -- identifier qualification)
+// new () (explicit parenthesis)
+//
+// the last two are not usually on a precedence chart; I put them in
+// to point out that new has a higher precedence than '.', so you
+// can validy use
+// new Frame().show()
+//
+// Note that the above precedence levels map to the rules below...
+// Once you have a precedence chart, writing the appropriate rules as below
+// is usually very straightfoward
+
+// the mother of all expressions
+expression
+ : assignmentExpression
+ {#expression = #(#[EXPR,"EXPR"],#expression);}
+ ;
+
+// This is a list of expressions.
+expressionList
+ : expression (COMMA! expression)*
+ {#expressionList = #(#[ELIST,"ELIST"], expressionList);}
+ ;
+
+// assignment expression (level 13)
+assignmentExpression
+ : conditionalExpression
+ ( ( ASSIGN^
+ | PLUS_ASSIGN^
+ | MINUS_ASSIGN^
+ | STAR_ASSIGN^
+ | DIV_ASSIGN^
+ | MOD_ASSIGN^
+ | SR_ASSIGN^
+ | BSR_ASSIGN^
+ | SL_ASSIGN^
+ | BAND_ASSIGN^
+ | BXOR_ASSIGN^
+ | BOR_ASSIGN^
+ )
+ assignmentExpression
+ )?
+ ;
+
+// conditional test (level 12)
+conditionalExpression
+ : logicalOrExpression
+ ( QUESTION^ assignmentExpression COLON! conditionalExpression )?
+ ;
+
+// logical or (||) (level 11)
+logicalOrExpression
+ : logicalAndExpression (LOR^ logicalAndExpression)*
+ ;
+
+// logical and (&&) (level 10)
+logicalAndExpression
+ : inclusiveOrExpression (LAND^ inclusiveOrExpression)*
+ ;
+
+// bitwise or non-short-circuiting or (|) (level 9)
+inclusiveOrExpression
+ : exclusiveOrExpression (BOR^ exclusiveOrExpression)*
+ ;
+
+// exclusive or (^) (level 8)
+exclusiveOrExpression
+ : andExpression (BXOR^ andExpression)*
+ ;
+
+// bitwise or non-short-circuiting and (&) (level 7)
+andExpression
+ : equalityExpression (BAND^ equalityExpression)*
+ ;
+
+// equality/inequality (==/!=) (level 6)
+equalityExpression
+ : relationalExpression ((NOT_EQUAL^ | EQUAL^) relationalExpression)*
+ ;
+
+// boolean relational expressions (level 5)
+relationalExpression
+ : shiftExpression
+ ( ( ( LT_^
+ | GT^
+ | LE^
+ | GE^
+ )
+ shiftExpression
+ )*
+ | "instanceof"^ typeSpec[true]
+ )
+ ;
+
+// bit shift expressions (level 4)
+shiftExpression
+ : additiveExpression ((SL^ | SR^ | BSR^) additiveExpression)*
+ ;
+
+// binary addition/subtraction (level 3)
+additiveExpression
+ : multiplicativeExpression ((PLUS^ | MINUS^) multiplicativeExpression)*
+ ;
+
+// multiplication/division/modulo (level 2)
+multiplicativeExpression
+ : unaryExpression ((STAR^ | DIV^ | MOD^ ) unaryExpression)*
+ ;
+
+unaryExpression
+ : INC^ unaryExpression
+ | DEC^ unaryExpression
+ | MINUS^ {#MINUS->setType(UNARY_MINUS);} unaryExpression
+ | PLUS^ {#PLUS->setType(UNARY_PLUS);} unaryExpression
+ | unaryExpressionNotPlusMinus
+ ;
+
+unaryExpressionNotPlusMinus
+ : BNOT^ unaryExpression
+ | LNOT^ unaryExpression
+
+ | ( // subrule allows option to shut off warnings
+ options {
+ // "(int" ambig with postfixExpr due to lack of sequence
+ // info in linear approximate LL(k). It's ok. Shut up.
+ generateAmbigWarnings=false;
+ }
+ : // If typecast is built in type, must be numeric operand
+ // Also, no reason to backtrack if type keyword like int, float...
+ lpb:LPAREN^ {#lpb->setType(TYPECAST);} builtInTypeSpec[true] RPAREN!
+ unaryExpression
+
+ // Have to backtrack to see if operator follows. If no operator
+ // follows, it's a typecast. No semantic checking needed to parse.
+ // if it _looks_ like a cast, it _is_ a cast; else it's a "(expr)"
+ | (LPAREN classTypeSpec[true] RPAREN unaryExpressionNotPlusMinus)=>
+ lp:LPAREN^ {#lp->setType(TYPECAST);} classTypeSpec[true] RPAREN!
+ unaryExpressionNotPlusMinus
+
+ | postfixExpression
+ )
+ ;
+
+// qualified names, array expressions, method invocation, post inc/dec
+postfixExpression
+ :
+ /*
+ "this"! lp1:LPAREN^ argList RPAREN!
+ {#lp1->setType(CTOR_CALL);}
+
+ | "super"! lp2:LPAREN^ argList RPAREN!
+ {#lp2->setType(SUPER_CTOR_CALL);}
+ |
+ */
+ primaryExpression
+
+ (
+ /*
+ options {
+ // the use of postfixExpression in SUPER_CTOR_CALL adds DOT
+ // to the lookahead set, and gives loads of false non-det
+ // warnings.
+ // shut them off.
+ generateAmbigWarnings=false;
+ }
+ : */
+ DOT^ IDENT
+ ( lp:LPAREN^ {#lp->setType(METHOD_CALL);}
+ argList
+ RPAREN!
+ )?
+ | DOT^ "this"
+
+ | DOT^ "super"
+ ( // (new Outer()).super() (create enclosing instance)
+ lp3:LPAREN^ argList RPAREN!
+ {#lp3->setType(SUPER_CTOR_CALL);}
+ | DOT^ IDENT
+ ( lps:LPAREN^ {#lps->setType(METHOD_CALL);}
+ argList
+ RPAREN!
+ )?
+ )
+ | DOT^ newExpression
+ | lb:LBRACK^ {#lb->setType(INDEX_OP);} expression RBRACK!
+ )*
+
+ ( // possibly add on a post-increment or post-decrement.
+ // allows INC/DEC on too much, but semantics can check
+ in:INC^ {#in->setType(POST_INC);}
+ | de:DEC^ {#de->setType(POST_DEC);}
+ )?
+ ;
+
+// the basic element of an expression
+primaryExpression
+ : identPrimary ( options {greedy=true;} : DOT^ "class" )?
+ | constant
+ | "true"
+ | "false"
+ | "null"
+ | newExpression
+ | "this"
+ | "super"
+ | LPAREN! assignmentExpression RPAREN!
+ // look for int.class and int[].class
+ | builtInType
+ ( lbt:LBRACK^ {#lbt->setType(ARRAY_DECLARATOR);} RBRACK! )*
+ DOT^ "class"
+ ;
+
+/** Match a, a.b.c refs, a.b.c(...) refs, a.b.c[], a.b.c[].class,
+ * and a.b.c.class refs. Also this(...) and super(...). Match
+ * this or super.
+ */
+identPrimary
+ : IDENT
+ (
+ options {
+ // .ident could match here or in postfixExpression.
+ // We do want to match here. Turn off warning.
+ greedy=true;
+ }
+ : DOT^ IDENT
+ )*
+ (
+ options {
+ // ARRAY_DECLARATOR here conflicts with INDEX_OP in
+ // postfixExpression on LBRACK RBRACK.
+ // We want to match [] here, so greedy. This overcomes
+ // limitation of linear approximate lookahead.
+ greedy=true;
+ }
+ : ( lp:LPAREN^ {#lp->setType(METHOD_CALL);} argList RPAREN! )
+ | ( options {greedy=true;} :
+ lbc:LBRACK^ {#lbc->setType(ARRAY_DECLARATOR);} RBRACK!
+ )+
+ )?
+ ;
+
+/** object instantiation.
+ * Trees are built as illustrated by the following input/tree pairs:
+ *
+ * new T()
+ *
+ * new
+ * |
+ * T -- ELIST
+ * |
+ * arg1 -- arg2 -- .. -- argn
+ *
+ * new int[]
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ *
+ * new int[] {1,2}
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR -- ARRAY_INIT
+ * |
+ * EXPR -- EXPR
+ * | |
+ * 1 2
+ *
+ * new int[3]
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ * |
+ * EXPR
+ * |
+ * 3
+ *
+ * new int[1][2]
+ *
+ * new
+ * |
+ * int -- ARRAY_DECLARATOR
+ * |
+ * ARRAY_DECLARATOR -- EXPR
+ * | |
+ * EXPR 1
+ * |
+ * 2
+ *
+ */
+newExpression
+ : "new"^ type
+ ( LPAREN! argList RPAREN! (classBlock)?
+
+ //java 1.1
+ // Note: This will allow bad constructs like
+ // new int[4][][3] {exp,exp}.
+ // There needs to be a semantic check here...
+ // to make sure:
+ // a) [ expr ] and [ ] are not mixed
+ // b) [ expr ] and an init are not used together
+
+ | newArrayDeclarator (arrayInitializer)?
+ )
+ ;
+
+argList
+ : ( expressionList
+ | /*nothing*/
+ {#argList = #[ELIST,"ELIST"];}
+ )
+ ;
+
+newArrayDeclarator
+ : (
+ // CONFLICT:
+ // newExpression is a primaryExpression which can be
+ // followed by an array index reference. This is ok,
+ // as the generated code will stay in this loop as
+ // long as it sees an LBRACK (proper behavior)
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ :
+ lb:LBRACK^ {#lb->setType(ARRAY_DECLARATOR);}
+ (expression)?
+ RBRACK!
+ )+
+ ;
+
+constant
+ : NUM_INT
+ | CHAR_LITERAL
+ | STRING_LITERAL
+ | NUM_FLOAT
+ | NUM_LONG
+ | NUM_DOUBLE
+ ;
+
+//----------------------------------------------------------------------------
+// The Java scanner
+//----------------------------------------------------------------------------
+{
+#include <string>
+}
+class JavaLexer extends Lexer;
+
+options {
+ exportVocab=Java; // call the vocabulary "Java"
+ testLiterals=false; // don't automatically test for literals
+ defaultErrorHandler=false;
+ k=4; // four characters of lookahead
+// charVocabulary='\u0003'..'\uFFFF';
+ charVocabulary='\u0003'..'\u00FF';
+ // without inlining some bitset tests, couldn't do unicode;
+ // I need to make ANTLR generate smaller bitsets; see
+ // bottom of JavaLexer.java
+ codeGenBitsetTestThreshold=20;
+}
+{
+private:
+ Driver* m_driver;
+
+public:
+ void setDriver( Driver* d ) { m_driver = d; }
+ void setFileName( const QString& fileName ) { m_driver->currentFileName() = fileName; }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(ex.getMessage().c_str()), ex.getLine(), ex.getColumn()) );
+ }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(errorMessage.c_str()), getLine(), getColumn()) );
+ }
+
+ virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){
+ m_driver->addProblem( m_driver->currentFileName(), Problem( QString::fromLocal8Bit(warnMessage.c_str()), getLine(), getColumn()) );
+ }
+}
+
+// OPERATORS
+QUESTION : '?' ;
+LPAREN : '(' ;
+RPAREN : ')' ;
+LBRACK : '[' ;
+RBRACK : ']' ;
+LCURLY : '{' ;
+RCURLY : '}' ;
+COLON : ':' ;
+COMMA : ',' ;
+//DOT : '.' ;
+ASSIGN : '=' ;
+EQUAL : "==" ;
+LNOT : '!' ;
+BNOT : '~' ;
+NOT_EQUAL : "!=" ;
+DIV : '/' ;
+DIV_ASSIGN : "/=" ;
+PLUS : '+' ;
+PLUS_ASSIGN : "+=" ;
+INC : "++" ;
+MINUS : '-' ;
+MINUS_ASSIGN : "-=" ;
+DEC : "--" ;
+STAR : '*' ;
+STAR_ASSIGN : "*=" ;
+MOD : '%' ;
+MOD_ASSIGN : "%=" ;
+SR : ">>" ;
+SR_ASSIGN : ">>=" ;
+BSR : ">>>" ;
+BSR_ASSIGN : ">>>=" ;
+GE : ">=" ;
+GT : ">" ;
+SL : "<<" ;
+SL_ASSIGN : "<<=" ;
+LE : "<=" ;
+LT_ : '<' ;
+BXOR : '^' ;
+BXOR_ASSIGN : "^=" ;
+BOR : '|' ;
+BOR_ASSIGN : "|=" ;
+LOR : "||" ;
+BAND : '&' ;
+BAND_ASSIGN : "&=" ;
+LAND : "&&" ;
+SEMI : ';' ;
+
+// Whitespace -- ignored
+WS : ( ' '
+ | '\t'
+ | '\f'
+ // handle newlines
+ | ( options {generateAmbigWarnings=false;}
+ : "\r\n" // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ { newline(); }
+ )+
+ { $setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP); }
+ ;
+
+// Single-line comments
+SL_COMMENT
+ : "//"
+ (~('\n'|'\r'))* ('\n'|'\r'('\n')?)
+ {
+ $setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP);
+ newline();
+ }
+ ;
+
+// multiple-line comments
+ML_COMMENT
+ : "/*"
+ ( /* '\r' '\n' can be matched in one alternative or by matching
+ '\r' in one iteration and '\n' in another. I am trying to
+ handle any flavor of newline that comes in, but the language
+ that allows both "\r\n" and "\r" and "\n" to all be valid
+ newline is ambiguous. Consequently, the resulting grammar
+ must be ambiguous. I'm shutting this warning off.
+ */
+ options {
+ generateAmbigWarnings=false;
+ }
+ :
+ { LA(2)!='/' }? '*'
+ | '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | ~('*'|'\n'|'\r')
+ )*
+ "*/"
+ {$setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP);}
+ ;
+
+// character literals
+CHAR_LITERAL
+ : '\'' ( ESC | ~'\'' ) '\''
+ ;
+
+// string literals
+STRING_LITERAL
+ : '"' (ESC|~('"'|'\\'))* '"'
+ ;
+
+// escape sequence -- note that this is protected; it can only be called
+// from another lexer rule -- it will not ever directly return a token to
+// the parser
+// There are various ambiguities hushed in this rule. The optional
+// '0'...'9' digit matches should be matched here rather than letting
+// them go back to STRING_LITERAL to be matched. ANTLR does the
+// right thing by matching immediately; hence, it's ok to shut off
+// the FOLLOW ambig warnings.
+protected
+ESC
+ : '\\'
+ ( 'n'
+ | 'r'
+ | 't'
+ | 'b'
+ | 'f'
+ | '"'
+ | '\''
+ | '\\'
+ | ('u')+ HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT
+ | '0'..'3'
+ (
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ : '0'..'7'
+ (
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ : '0'..'7'
+ )?
+ )?
+ | '4'..'7'
+ (
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ : '0'..'7'
+ )?
+ )
+ ;
+
+// hexadecimal digit (again, note it's protected!)
+protected
+HEX_DIGIT
+ : ('0'..'9'|'A'..'F'|'a'..'f')
+ ;
+
+// a dummy rule to force vocabulary to be all characters (except special
+// ones that ANTLR uses internally (0 to 2)
+protected
+VOCAB
+ : '\3'..'\377'
+ ;
+
+// an identifier. Note that testLiterals is set to true! This means
+// that after we match the rule, we look in the literals table to see
+// if it's a literal or really an identifer
+IDENT
+ options {testLiterals=true;}
+ : ('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*
+ ;
+
+// a numeric literal
+NUM_INT
+ {
+ bool isDecimal = false;
+ ANTLR_USE_NAMESPACE(antlr)RefToken t = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ }
+ : '.' {_ttype = DOT;}
+ ( ('0'..'9')+ (EXPONENT)? (f1:FLOAT_SUFFIX {t=f1;})?
+ {
+ if ( t &&
+ (t->getText().find('f') != ANTLR_USE_NAMESPACE(std)string::npos ||
+ t->getText().find('F') != ANTLR_USE_NAMESPACE(std)string::npos ) ) {
+ _ttype = NUM_FLOAT;
+ }
+ else {
+ _ttype = NUM_DOUBLE; // assume double
+ }
+ }
+ )?
+
+ | ( '0' {isDecimal = true;} // special case for just '0'
+ ( ('x'|'X')
+ ( // hex
+ // the 'e'|'E' and float suffix stuff look
+ // like hex digits, hence the (...)+ doesn't
+ // know when to stop: ambig. ANTLR resolves
+ // it correctly by matching immediately. It
+ // is therefor ok to hush warning.
+ options {
+ warnWhenFollowAmbig=false;
+ }
+ : HEX_DIGIT
+ )+
+ | ('0'..'7')+ // octal
+ )?
+ | ('1'..'9') ('0'..'9')* {isDecimal=true;} // non-zero decimal
+ )
+ ( ('l'|'L') { _ttype = NUM_LONG; }
+
+ // only check to see if it's a float if looks like decimal so far
+ | {isDecimal}?
+ ( '.' ('0'..'9')* (EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;})?
+ | EXPONENT (f3:FLOAT_SUFFIX {t=f3;})?
+ | f4:FLOAT_SUFFIX {t=f4;}
+ )
+ {
+ if ( t &&
+ (t->getText().find('f') != ANTLR_USE_NAMESPACE(std)string::npos ||
+ t->getText().find('F') != ANTLR_USE_NAMESPACE(std)string::npos ) ) {
+ _ttype = NUM_FLOAT;
+ }
+ else {
+ _ttype = NUM_DOUBLE; // assume double
+ }
+ }
+ )?
+ ;
+
+// a couple protected methods to assist in matching floating point numbers
+protected
+EXPONENT
+ : ('e'|'E') ('+'|'-')? ('0'..'9')+
+ ;
+
+protected
+FLOAT_SUFFIX
+ : 'f'|'F'|'d'|'D'
+ ;
+
diff --git a/languages/java/java.store.g b/languages/java/java.store.g
new file mode 100644
index 00000000..b69b7323
--- /dev/null
+++ b/languages/java/java.store.g
@@ -0,0 +1,521 @@
+// KDevelop support by Roberto Raggi (roberto@kdevelop.org)
+
+header "pre_include_hpp" {
+ #include <codemodel.h>
+ #include "JavaAST.hpp"
+
+ #include <qstring.h>
+ #include <qstringlist.h>
+ #include <qvaluestack.h>
+ #include <qfileinfo.h>
+}
+
+header "post_include_hpp" {
+ #include <codemodel.h>
+
+ #include <kdebug.h>
+}
+
+options {
+ language="Cpp";
+}
+
+/** Java 1.2 AST Recognizer Grammar
+ *
+ * Author:
+ * Terence Parr parrt@magelang.com
+ *
+ * Version tracking now done with following ID:
+ *
+ * $Id$
+ *
+ * This grammar is in the PUBLIC DOMAIN
+ *
+ * BUGS
+ */
+class JavaStoreWalker extends TreeParser;
+
+options {
+ importVocab=Java;
+ defaultErrorHandler = true;
+ ASTLabelType = "RefJavaAST";
+}
+{
+private:
+ QStringList m_currentScope;
+ CodeModel* m_model;
+ FileDom m_file;
+ QValueStack<ClassDom> m_currentClass;
+ int m_currentAccess;
+ int m_anon;
+ ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory;
+
+public:
+ void setCodeModel( CodeModel* model )
+ {
+ m_model = model;
+ }
+
+ void setFile( FileDom file )
+ {
+ m_file = file;
+ }
+
+ void init()
+ {
+ m_currentScope.clear();
+ m_currentAccess = CodeModelItem::Public;
+ m_anon = 0;
+
+ initializeASTFactory (ast_factory);
+ setASTFactory (&ast_factory);
+ }
+}
+
+compilationUnit { QString package; QString imp; QStringList imports; }
+ : { init(); }
+ (package=packageDefinition)?
+ (imp=importDefinition { imports << imp; } )*
+ (typeDefinition)*
+ ;
+
+packageDefinition returns [ QString id ]
+ : #( PACKAGE_DEF id=identifier )
+ ;
+
+importDefinition returns [ QString id ]
+ : #( IMPORT id=identifierStar )
+ ;
+
+typeDefinition { QStringList bases; QString className; ClassDom klass; QStringList m;}
+ : #(CLASS_DEF m=modifiers IDENT
+ {
+ klass = m_model->create<ClassModel>();
+ QString name = QString::fromUtf8( #IDENT->getText().c_str(), #IDENT->getText().length() );
+ QStringList path = QStringList::split( ".", name );
+ className = path.back();
+
+ klass->setName( path.back() );
+ klass->setScope( m_currentScope );
+ klass->setStartPosition( #IDENT->getLine(), #IDENT->getColumn() );
+ /// @todo klass->setEndPositon()
+
+ klass->setFileName( m_file->name() );
+ if( m_currentClass.top() )
+ m_currentClass.top()->addClass( klass );
+ else
+ m_file->addClass( klass );
+ }
+ bases=extendsClause
+ {
+ for( QStringList::Iterator it = bases.begin(); it != bases.end(); ++it )
+ klass->addBaseClass( *it );
+ }
+ implementsClause
+ {
+ m_currentClass.push( klass );
+ m_currentScope.push_back( className );
+ }
+ objBlock[klass]
+ {
+ m_currentClass.pop();
+ m_currentScope.pop_back();
+ }
+ )
+ | #(INTERFACE_DEF m=modifiers IDENT
+ {
+ klass = m_model->create<ClassModel>();
+ QString name = QString::fromUtf8( #IDENT->getText().c_str(), #IDENT->getText().length() );
+ QStringList path = QStringList::split( ".", name );
+ className = path.back();
+
+ klass->setName( path.back() );
+ klass->setScope( m_currentScope );
+ klass->setStartPosition( #IDENT->getLine(), #IDENT->getColumn() );
+ /// @todo klass->setEndPositon()
+
+ klass->setFileName( m_file->name() );
+
+ if( m_currentClass.top() )
+ m_currentClass.top()->addClass( klass );
+ else
+ m_file->addClass( klass );
+ }
+ bases=extendsClause
+ {
+ m_currentClass.push( klass );
+ m_currentScope.push_back( className );
+ }
+ interfaceBlock[klass]
+ {
+ m_currentClass.pop();
+ m_currentScope.pop_back();
+ }
+ )
+ ;
+
+typeSpec returns [ QString tp ]
+ : #(TYPE tp=typeSpecArray)
+ ;
+
+typeSpecArray returns [ QString tp ]
+ : #( ARRAY_DECLARATOR tp=typeSpecArray ) { tp += "[]"; }
+ | tp=type
+ ;
+
+type returns [ QString tp ]
+ : tp=identifier
+ | b:builtInType { tp = #b->getText().c_str(); }
+ ;
+
+builtInType
+ : "void"
+ | "boolean"
+ | "byte"
+ | "char"
+ | "short"
+ | "int"
+ | "float"
+ | "long"
+ | "double"
+ ;
+
+modifiers returns [ QStringList l ]
+ : #( MODIFIERS (m:modifier { l << #m->getText().c_str(); } )* )
+ ;
+
+modifier
+ : "private"
+ | "public"
+ | "protected"
+ | "static"
+ | "transient"
+ | "final"
+ | "abstract"
+ | "native"
+ | "threadsafe"
+ | "synchronized"
+ | "const"
+ | "volatile"
+ ;
+
+extendsClause returns [ QStringList l ] { QString id; }
+ : #(EXTENDS_CLAUSE (id=identifier { l << id; } )* )
+ ;
+
+implementsClause returns [ QStringList l ] { QString id; }
+ : #(IMPLEMENTS_CLAUSE (id=identifier { l << id; } )* )
+ ;
+
+interfaceBlock [ ClassDom klass ] { FunctionDom meth; VariableDom attr; }
+ : #( OBJBLOCK
+ ( meth=methodDecl {
+ }
+
+ | attr=variableDef {
+ }
+ )*
+ )
+ ;
+
+objBlock [ ClassDom klass ] { FunctionDom meth; VariableDom attr; }
+ : #( OBJBLOCK
+ ( meth=ctorDef {
+ klass->addFunction( meth );
+ }
+ | meth=methodDef {
+ klass->addFunction( meth );
+ }
+ | attr=variableDef {
+ klass->addVariable( attr );
+ }
+ | typeDefinition
+ | #(STATIC_INIT slist)
+ | #(INSTANCE_INIT slist)
+ )*
+ )
+ ;
+
+ctorDef returns [ FunctionDom meth ] {
+ QStringList m;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+ }
+ : #(CTOR_DEF
+ m=modifiers methodHead[meth] slist
+ )
+ {
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+ }
+ ;
+
+methodDecl returns [ FunctionDom meth ] {
+ QStringList m;
+ QString tp;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+ }
+ : #(METHOD_DEF m=modifiers tp=typeSpec methodHead[meth])
+ {
+ meth->setResultType( tp );
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+ }
+ ;
+
+methodDef returns [ FunctionDom meth ] {
+ QStringList m;
+ QString tp;
+ meth = m_model->create<FunctionModel>();
+ meth->setFileName( m_file->name() );
+ }
+ : #(METHOD_DEF m=modifiers tp=typeSpec methodHead[meth] (slist)?)
+ {
+ meth->setResultType( tp );
+ if( m.contains("public") )
+ meth->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ meth->setAccess( CodeModelItem::Protected );
+ else
+ meth->setAccess( CodeModelItem::Private );
+ }
+ ;
+
+variableDef returns [ VariableDom attr ] {
+ QStringList m;
+ QString tp;
+ attr = m_model->create<VariableModel>();
+ attr->setFileName( m_file->name() );
+ }
+ : #(VARIABLE_DEF m=modifiers tp=typeSpec variableDeclarator[attr] varInitializer)
+ {
+ attr->setType( tp );
+ if( m.contains("public") )
+ attr->setAccess( CodeModelItem::Public );
+ else if( m.contains("protected") )
+ attr->setAccess( CodeModelItem::Protected );
+ else
+ attr->setAccess( CodeModelItem::Private );
+
+ attr->setStatic( m.contains("static") );
+ }
+ ;
+
+parameterDef returns [ ArgumentDom arg ] {
+ QString tp;
+ arg = m_model->create<ArgumentModel>();
+ }
+ : #(PARAMETER_DEF modifiers tp=typeSpec IDENT )
+ {
+ arg->setType( tp );
+ arg->setName( #IDENT->getText().c_str() );
+ }
+ ;
+
+objectinitializer
+ : #(INSTANCE_INIT slist)
+ ;
+
+variableDeclarator [ VariableDom attr ]
+ : IDENT {
+ attr->setName( #IDENT->getText().c_str() );
+ attr->setStartPosition( #IDENT->getLine(), #IDENT->getColumn() );
+ }
+ | LBRACK variableDeclarator[attr]
+ ;
+
+varInitializer
+ : #(ASSIGN initializer)
+ |
+ ;
+
+initializer
+ : expression
+ | arrayInitializer
+ ;
+
+arrayInitializer
+ : #(ARRAY_INIT (initializer)*)
+ ;
+
+methodHead [ FunctionDom meth ] { ArgumentDom arg; }
+ : IDENT #( PARAMETERS (arg=parameterDef { meth->addArgument(arg); } )* ) (throwsClause)?
+ {
+ meth->setName( #IDENT->getText().c_str() );
+ meth->setScope( m_currentScope );
+ meth->setStartPosition( #IDENT->getLine(), #IDENT->getColumn() );
+ }
+ ;
+
+throwsClause
+ : #( "throws" (identifier)* )
+ ;
+
+identifier returns [ QString id ]
+ : IDENT {
+ id = #IDENT->getText().c_str();
+ }
+ | #( DOT id=identifier IDENT ) {
+ id += QString(".") + #IDENT->getText().c_str();
+ }
+ ;
+
+identifierStar returns [ QString id ]
+ : IDENT {
+ id = #IDENT->getText().c_str();
+ }
+ | #( DOT id=identifier (STAR { id += QString(".") + #STAR->getText().c_str(); } |
+ IDENT { id += QString(".") + #IDENT->getText().c_str(); }) )
+ ;
+
+slist
+ : #( SLIST (stat)* )
+ ;
+
+stat: typeDefinition
+ | variableDef
+ | expression
+ | #(LABELED_STAT IDENT stat)
+ | #("if" expression stat (stat)? )
+ | #( "for"
+ #(FOR_INIT (variableDef | elist)?)
+ #(FOR_CONDITION (expression)?)
+ #(FOR_ITERATOR (elist)?)
+ stat
+ )
+ | #("while" expression stat)
+ | #("do" stat expression)
+ | #("break" (IDENT)? )
+ | #("continue" (IDENT)? )
+ | #("return" (expression)? )
+ | #("switch" expression (caseGroup)*)
+ | #("throw" expression)
+ | #("synchronized" expression stat)
+ | tryBlock
+ | slist // nested SLIST
+ | EMPTY_STAT
+ ;
+
+caseGroup
+ : #(CASE_GROUP (#("case" expression) | "default")+ slist)
+ ;
+
+tryBlock
+ : #( "try" slist (handler)* (#("finally" slist))? )
+ ;
+
+handler
+ : #( "catch" parameterDef slist )
+ ;
+
+elist
+ : #( ELIST (expression)* )
+ ;
+
+expression
+ : #(EXPR expr)
+ ;
+
+expr: #(QUESTION expr expr expr) // trinary operator
+ | #(ASSIGN expr expr) // binary operators...
+ | #(PLUS_ASSIGN expr expr)
+ | #(MINUS_ASSIGN expr expr)
+ | #(STAR_ASSIGN expr expr)
+ | #(DIV_ASSIGN expr expr)
+ | #(MOD_ASSIGN expr expr)
+ | #(SR_ASSIGN expr expr)
+ | #(BSR_ASSIGN expr expr)
+ | #(SL_ASSIGN expr expr)
+ | #(BAND_ASSIGN expr expr)
+ | #(BXOR_ASSIGN expr expr)
+ | #(BOR_ASSIGN expr expr)
+ | #(LOR expr expr)
+ | #(LAND expr expr)
+ | #(BOR expr expr)
+ | #(BXOR expr expr)
+ | #(BAND expr expr)
+ | #(NOT_EQUAL expr expr)
+ | #(EQUAL expr expr)
+ | #(LT_ expr expr)
+ | #(GT expr expr)
+ | #(LE expr expr)
+ | #(GE expr expr)
+ | #(SL expr expr)
+ | #(SR expr expr)
+ | #(BSR expr expr)
+ | #(PLUS expr expr)
+ | #(MINUS expr expr)
+ | #(DIV expr expr)
+ | #(MOD expr expr)
+ | #(STAR expr expr)
+ | #(INC expr)
+ | #(DEC expr)
+ | #(POST_INC expr)
+ | #(POST_DEC expr)
+ | #(BNOT expr)
+ | #(LNOT expr)
+ | #("instanceof" expr expr)
+ | #(UNARY_MINUS expr)
+ | #(UNARY_PLUS expr)
+ | primaryExpression
+ ;
+
+primaryExpression
+ : IDENT
+ | #( DOT
+ ( expr
+ ( IDENT
+ | arrayIndex
+ | "this"
+ | "class"
+ | #( "new" IDENT elist )
+ )
+ | #(ARRAY_DECLARATOR type)
+ | builtInType ("class")?
+ )
+ )
+ | arrayIndex
+ | #(METHOD_CALL primaryExpression elist)
+ | #(TYPECAST typeSpec expr)
+ | newExpression
+ | constant
+ | "super"
+ | "true"
+ | "false"
+ | "this"
+ | "null"
+ | typeSpec // type name used with instanceof
+ ;
+
+arrayIndex
+ : #(INDEX_OP primaryExpression expression)
+ ;
+
+constant
+ : NUM_INT
+ | CHAR_LITERAL
+ | STRING_LITERAL
+ | NUM_FLOAT
+ ;
+
+newExpression
+ : #( "new" type
+ ( newArrayDeclarator (arrayInitializer)?
+ | elist
+ )
+ )
+
+ ;
+
+newArrayDeclarator
+ : #( ARRAY_DECLARATOR (newArrayDeclarator)? (expression)? )
+ ;
diff --git a/languages/java/java.tree.g b/languages/java/java.tree.g
new file mode 100644
index 00000000..9fa94a95
--- /dev/null
+++ b/languages/java/java.tree.g
@@ -0,0 +1,331 @@
+options {
+ language="Cpp";
+}
+
+/** Java 1.3 AST Recognizer Grammar
+ *
+ * Author: (see java.g preamble)
+ *
+ * Version tracking now done with following ID:
+ *
+ * $Id$
+ *
+ * This grammar is in the PUBLIC DOMAIN
+ */
+
+class JavaTreeParser extends TreeParser;
+
+options {
+ importVocab = Java;
+}
+
+compilationUnit
+ : (packageDefinition)?
+ (importDefinition)*
+ (typeDefinition)*
+ ;
+
+packageDefinition
+ : #( PACKAGE_DEF identifier )
+ ;
+
+importDefinition
+ : #( IMPORT identifierStar )
+ ;
+
+typeDefinition
+ : #(CLASS_DEF modifiers IDENT extendsClause implementsClause objBlock )
+ | #(INTERFACE_DEF modifiers IDENT extendsClause interfaceBlock )
+ ;
+
+typeSpec
+ : #(TYPE typeSpecArray)
+ ;
+
+typeSpecArray
+ : #( ARRAY_DECLARATOR typeSpecArray )
+ | type
+ ;
+
+type: identifier
+ | builtInType
+ ;
+
+builtInType
+ : "void"
+ | "boolean"
+ | "byte"
+ | "char"
+ | "short"
+ | "int"
+ | "float"
+ | "long"
+ | "double"
+ ;
+
+modifiers
+ : #( MODIFIERS (modifier)* )
+ ;
+
+modifier
+ : "private"
+ | "public"
+ | "protected"
+ | "static"
+ | "transient"
+ | "final"
+ | "abstract"
+ | "native"
+ | "threadsafe"
+ | "synchronized"
+ | "const"
+ | "volatile"
+ | "strictfp"
+ ;
+
+extendsClause
+ : #(EXTENDS_CLAUSE (identifier)* )
+ ;
+
+implementsClause
+ : #(IMPLEMENTS_CLAUSE (identifier)* )
+ ;
+
+interfaceBlock
+ : #( OBJBLOCK
+ ( methodDecl
+ | variableDef
+ )*
+ )
+ ;
+
+objBlock
+ : #( OBJBLOCK
+ ( ctorDef
+ | methodDef
+ | variableDef
+ | typeDefinition
+ | #(STATIC_INIT slist)
+ | #(INSTANCE_INIT slist)
+ )*
+ )
+ ;
+
+ctorDef
+ : #(CTOR_DEF modifiers methodHead (slist)?)
+ ;
+
+methodDecl
+ : #(METHOD_DEF modifiers typeSpec methodHead)
+ ;
+
+methodDef
+ : #(METHOD_DEF modifiers typeSpec methodHead (slist)?)
+ ;
+
+variableDef
+ : #(VARIABLE_DEF modifiers typeSpec variableDeclarator varInitializer)
+ ;
+
+parameterDef
+ : #(PARAMETER_DEF modifiers typeSpec IDENT )
+ ;
+
+objectinitializer
+ : #(INSTANCE_INIT slist)
+ ;
+
+variableDeclarator
+ : IDENT
+ | LBRACK variableDeclarator
+ ;
+
+varInitializer
+ : #(ASSIGN initializer)
+ |
+ ;
+
+initializer
+ : expression
+ | arrayInitializer
+ ;
+
+arrayInitializer
+ : #(ARRAY_INIT (initializer)*)
+ ;
+
+methodHead
+ : IDENT #( PARAMETERS (parameterDef)* ) (throwsClause)?
+ ;
+
+throwsClause
+ : #( "throws" (identifier)* )
+ ;
+
+identifier
+ : IDENT
+ | #( DOT identifier IDENT )
+ ;
+
+identifierStar
+ : IDENT
+ | #( DOT identifier (STAR|IDENT) )
+ ;
+
+slist
+ : #( SLIST (stat)* )
+ ;
+
+stat: typeDefinition
+ | variableDef
+ | expression
+ | #(LABELED_STAT IDENT stat)
+ | #("if" expression stat (stat)? )
+ | #( "for"
+ #(FOR_INIT (variableDef | elist)?)
+ #(FOR_CONDITION (expression)?)
+ #(FOR_ITERATOR (elist)?)
+ stat
+ )
+ | #("while" expression stat)
+ | #("do" stat expression)
+ | #("break" (IDENT)? )
+ | #("continue" (IDENT)? )
+ | #("return" (expression)? )
+ | #("switch" expression (caseGroup)*)
+ | #("throw" expression)
+ | #("synchronized" expression stat)
+ | tryBlock
+ | slist // nested SLIST
+ // uncomment to make assert JDK 1.4 stuff work
+ // | #("assert" expression (expression)?)
+ | EMPTY_STAT
+ ;
+
+caseGroup
+ : #(CASE_GROUP (#("case" expression) | "default")+ slist)
+ ;
+
+tryBlock
+ : #( "try" slist (handler)* (#("finally" slist))? )
+ ;
+
+handler
+ : #( "catch" parameterDef slist )
+ ;
+
+elist
+ : #( ELIST (expression)* )
+ ;
+
+expression
+ : #(EXPR expr)
+ ;
+
+expr: #(QUESTION expr expr expr) // trinary operator
+ | #(ASSIGN expr expr) // binary operators...
+ | #(PLUS_ASSIGN expr expr)
+ | #(MINUS_ASSIGN expr expr)
+ | #(STAR_ASSIGN expr expr)
+ | #(DIV_ASSIGN expr expr)
+ | #(MOD_ASSIGN expr expr)
+ | #(SR_ASSIGN expr expr)
+ | #(BSR_ASSIGN expr expr)
+ | #(SL_ASSIGN expr expr)
+ | #(BAND_ASSIGN expr expr)
+ | #(BXOR_ASSIGN expr expr)
+ | #(BOR_ASSIGN expr expr)
+ | #(LOR expr expr)
+ | #(LAND expr expr)
+ | #(BOR expr expr)
+ | #(BXOR expr expr)
+ | #(BAND expr expr)
+ | #(NOT_EQUAL expr expr)
+ | #(EQUAL expr expr)
+ | #(LT_ expr expr)
+ | #(GT expr expr)
+ | #(LE expr expr)
+ | #(GE expr expr)
+ | #(SL expr expr)
+ | #(SR expr expr)
+ | #(BSR expr expr)
+ | #(PLUS expr expr)
+ | #(MINUS expr expr)
+ | #(DIV expr expr)
+ | #(MOD expr expr)
+ | #(STAR expr expr)
+ | #(INC expr)
+ | #(DEC expr)
+ | #(POST_INC expr)
+ | #(POST_DEC expr)
+ | #(BNOT expr)
+ | #(LNOT expr)
+ | #("instanceof" expr expr)
+ | #(UNARY_MINUS expr)
+ | #(UNARY_PLUS expr)
+ | primaryExpression
+ ;
+
+primaryExpression
+ : IDENT
+ | #( DOT
+ ( expr
+ ( IDENT
+ | arrayIndex
+ | "this"
+ | "class"
+ | #( "new" IDENT elist )
+ | "super"
+ )
+ | #(ARRAY_DECLARATOR typeSpecArray)
+ | builtInType ("class")?
+ )
+ )
+ | arrayIndex
+ | #(METHOD_CALL primaryExpression elist)
+ | ctorCall
+ | #(TYPECAST typeSpec expr)
+ | newExpression
+ | constant
+ | "super"
+ | "true"
+ | "false"
+ | "this"
+ | "null"
+ | typeSpec // type name used with instanceof
+ ;
+
+ctorCall
+ : #( CTOR_CALL elist )
+ | #( SUPER_CTOR_CALL
+ ( elist
+ | primaryExpression elist
+ )
+ )
+ ;
+
+arrayIndex
+ : #(INDEX_OP expr expression)
+ ;
+
+constant
+ : NUM_INT
+ | CHAR_LITERAL
+ | STRING_LITERAL
+ | NUM_FLOAT
+ | NUM_DOUBLE
+ | NUM_LONG
+ ;
+
+newExpression
+ : #( "new" type
+ ( newArrayDeclarator (arrayInitializer)?
+ | elist (objBlock)?
+ )
+ )
+
+ ;
+
+newArrayDeclarator
+ : #( ARRAY_DECLARATOR (newArrayDeclarator)? (expression)? )
+ ;
diff --git a/languages/java/javasupport_events.h b/languages/java/javasupport_events.h
new file mode 100644
index 00000000..c267b8e5
--- /dev/null
+++ b/languages/java/javasupport_events.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __javasupport_events_h
+#define __javasupport_events_h
+
+#include "driver.h"
+#include "kdevdeepcopy.h"
+
+#include <qevent.h>
+#include <qvaluelist.h>
+
+#if QT_VERSION < 0x030100
+#include <kdevmutex.h>
+#else
+#include <qmutex.h>
+#endif
+
+enum
+{
+ Event_FileParsed = QEvent::User + 1000
+};
+
+class FileParsedEvent: public QCustomEvent
+{
+public:
+ FileParsedEvent( const QString& fileName, const QValueList<Problem>& problems )
+ : QCustomEvent(Event_FileParsed), m_fileName( deepCopy(fileName) )
+ {
+ // the members are deep copies
+ QValueListConstIterator<Problem> it = problems.begin();
+ while (it != problems.end()) {
+ Problem p = *it;
+ m_problems.append(Problem(deepCopy(p.text()), p.line(), p.column(), p.level()));
+ ++it;
+ }
+ }
+
+ QString fileName() const { return m_fileName; }
+ QValueList<Problem> problems() const { return m_problems; }
+
+private:
+ QString m_fileName;
+ QValueList<Problem> m_problems;
+
+private:
+ FileParsedEvent( const FileParsedEvent& source );
+ void operator = ( const FileParsedEvent& source );
+};
+
+
+#endif // __javasupport_events_h
diff --git a/languages/java/javasupport_utils.cpp b/languages/java/javasupport_utils.cpp
new file mode 100644
index 00000000..1fa28b81
--- /dev/null
+++ b/languages/java/javasupport_utils.cpp
@@ -0,0 +1,52 @@
+
+#include "javasupport_utils.h"
+#include <codemodel.h>
+
+static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model );
+static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns );
+static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass );
+
+QStringList typeNameList( const CodeModel* model )
+{
+ QStringList lst;
+ QStringList path;
+ typeNameList( path, lst, model );
+ return lst;
+}
+
+static void typeNameList( QStringList& path, QStringList & lst, const CodeModel * model )
+{
+ const FileList fileList = model->fileList();
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ typeNameList( path, lst, model_cast<NamespaceDom>(*it) );
+}
+
+static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns )
+{
+ if( !ns->isFile() )
+ path.push_back( ns->name() );
+
+ const NamespaceList namespaceList = ns->namespaceList();
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ typeNameList( path, lst, *it );
+
+ const ClassList classList = ns->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typeNameList( path, lst, *it );
+
+ if( !ns->isFile() )
+ path.pop_back();
+}
+
+static void typeNameList( QStringList & path, QStringList & lst, ClassDom klass )
+{
+ path.push_back( klass->name() );
+
+ lst << path.join( "::" );
+
+ const ClassList classList = klass->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ typeNameList( path, lst, *it );
+ path.pop_back();
+}
+
diff --git a/languages/java/javasupport_utils.h b/languages/java/javasupport_utils.h
new file mode 100644
index 00000000..12d2fec0
--- /dev/null
+++ b/languages/java/javasupport_utils.h
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __javasupport_utils_h
+#define __javasupport_utils_h
+
+#include <qstringlist.h>
+
+class CodeModel;
+
+QStringList typeNameList( const CodeModel* model );
+
+#endif // __javasupport_utils_h
diff --git a/languages/java/javasupportfactory.cpp b/languages/java/javasupportfactory.cpp
new file mode 100644
index 00000000..a453c84a
--- /dev/null
+++ b/languages/java/javasupportfactory.cpp
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kinstance.h>
+#include <kstandarddirs.h>
+#include <kdevplugininfo.h>
+#include "javasupportfactory.h"
+
+static const KDevPluginInfo data("kdevjavasupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevjavasupport, JavaSupportFactory )
+
+JavaSupportFactory::JavaSupportFactory()
+ : KDevGenericFactory<JavaSupportPart>( data )
+{
+}
+
+KInstance *JavaSupportFactory::createInstance()
+{
+ KInstance *instance = KDevGenericFactory<JavaSupportPart>::createInstance();
+ KStandardDirs *dirs = instance->dirs();
+ dirs->addResourceType( "newclasstemplates", KStandardDirs::kde_default("data") + "kdevjavasupport/newclass/" );
+ dirs->addResourceType( "pcs", KStandardDirs::kde_default( "data" ) + "kdevjavasupport/pcs/" );
+
+ return instance;
+}
+
+const KDevPluginInfo *JavaSupportFactory::info()
+{
+ return &data;
+}
+
diff --git a/languages/java/javasupportfactory.h b/languages/java/javasupportfactory.h
new file mode 100644
index 00000000..fc82d929
--- /dev/null
+++ b/languages/java/javasupportfactory.h
@@ -0,0 +1,31 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _JAVASUPPORTFACTORY_H_
+#define _JAVASUPPORTFACTORY_H_
+
+#include <kdevgenericfactory.h>
+#include "javasupportpart.h"
+
+class KDevPluginInfo;
+
+class JavaSupportFactory : public KDevGenericFactory<JavaSupportPart>
+{
+public:
+ JavaSupportFactory();
+
+ static const KDevPluginInfo *info();
+
+protected:
+ virtual KInstance *createInstance();
+};
+
+#endif
diff --git a/languages/java/javasupportpart.cpp b/languages/java/javasupportpart.cpp
new file mode 100644
index 00000000..c8122a47
--- /dev/null
+++ b/languages/java/javasupportpart.cpp
@@ -0,0 +1,908 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2002-2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "javasupportpart.h"
+#include "javasupport_events.h"
+#include "problemreporter.h"
+#include "backgroundparser.h"
+#include "KDevJavaSupportIface.h"
+#include "javasupportfactory.h"
+#include "catalog.h"
+#include "kdevdriver.h"
+#include "javasupport_utils.h"
+
+#include "JavaStoreWalker.hpp"
+#include "JavaAST.hpp"
+
+#include <qheader.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qfileinfo.h>
+#include <qguardedptr.h>
+#include <qpopupmenu.h>
+#include <qprogressdialog.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+#include <qstatusbar.h>
+#include <qprogressbar.h>
+#include <qregexp.h>
+#include <qlabel.h>
+#include <qvbox.h>
+#include <kmessagebox.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kgenericfactory.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kstatusbar.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/clipboardinterface.h>
+
+#include <ktexteditor/texthintinterface.h>
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <kdevmakefrontend.h>
+#include <kdevcoderepository.h>
+
+#include <domutil.h>
+#include <urlutil.h>
+#include <config.h>
+
+enum { KDEV_DB_VERSION = 7 };
+enum { KDEV_PCS_VERSION = 8 };
+
+class JavaDriver: public KDevDriver
+{
+public:
+ JavaDriver( JavaSupportPart* javaSupport )
+ : KDevDriver( javaSupport )
+ {
+ }
+
+ void fileParsed( const QString& fileName )
+ {
+ //kdDebug(9013) << "-----> file " << fileName << " parsed!" << endl;
+ RefJavaAST ast = takeTranslationUnit( fileName );
+
+ if( javaSupport()->problemReporter() ){
+ javaSupport()->problemReporter()->removeAllProblems( fileName );
+
+ QValueList<Problem> pl = problems( fileName );
+ QValueList<Problem>::ConstIterator it = pl.begin();
+ while( it != pl.end() ){
+ const Problem& p = *it++;
+ javaSupport()->problemReporter()->reportProblem( fileName, p );
+ }
+ }
+
+ if( javaSupport()->codeModel()->hasFile(fileName) ){
+ FileDom file = javaSupport()->codeModel()->fileByName( fileName );
+ javaSupport()->removeWithReferences( fileName );
+ }
+
+ FileDom file = javaSupport()->codeModel()->create<FileModel>();
+ file->setName( fileName );
+ JavaStoreWalker walker;
+ walker.setFile( file );
+ walker.setCodeModel( javaSupport()->codeModel() );
+ walker.compilationUnit( ast );
+ javaSupport()->codeModel()->addFile( file );
+
+ remove( fileName );
+ }
+};
+
+JavaSupportPart::JavaSupportPart(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevLanguageSupport(JavaSupportFactory::info(), parent, name ? name : "KDevJavaSupport"),
+ m_activeDocument( 0 ), m_activeView( 0 ), m_activeSelection( 0 ), m_activeEditor( 0 ),
+ m_activeViewCursor( 0 ), m_projectClosed( true ), m_valid( false )
+{
+ setInstance(JavaSupportFactory::instance());
+
+ m_driver = new JavaDriver( this );
+
+ setXMLFile( "kdevjavasupport.rc" );
+
+ m_catalogList.setAutoDelete( true );
+ setupCatalog();
+
+ m_backgroundParser = new BackgroundParser( this, &m_eventConsumed );
+ m_backgroundParser->start();
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(activePartChanged(KParts::Part*)));
+ connect( partController(), SIGNAL(partRemoved(KParts::Part*)),
+ this, SLOT(partRemoved(KParts::Part*)));
+
+ m_problemReporter = new ProblemReporter( this, 0, "problemReporterWidget" );
+ m_problemReporter->setIcon( SmallIcon("info") );
+ mainWindow( )->embedOutputView( m_problemReporter, i18n("Problems"), i18n("Problem reporter"));
+
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ m_problemReporter, SLOT(configWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ this, SLOT(configWidget(KDialogBase*)) );
+
+ KAction *action;
+
+ action = new KAction(i18n("New Class..."), "classnew", 0,
+ this, SLOT(slotNewClass()),
+ actionCollection(), "project_newclass");
+ action->setToolTip( i18n("Generate a new class") );
+ action->setWhatsThis( i18n("<b>New Class</b>Generates a new class.<p>") );
+
+ // daniel
+ connect( core( ), SIGNAL( projectConfigWidget( KDialogBase* ) ), this,
+ SLOT( projectConfigWidget( KDialogBase* ) ) );
+
+ new KDevJavaSupportIface( this );
+ //(void) dcopClient();
+}
+
+
+JavaSupportPart::~JavaSupportPart()
+{
+ delete( m_driver );
+ m_driver = 0;
+
+ if( m_backgroundParser ){
+ m_backgroundParser->close();
+ m_backgroundParser->wait();
+ delete m_backgroundParser;
+ m_backgroundParser = 0;
+ }
+
+ codeRepository()->setMainCatalog( 0 );
+
+ QPtrListIterator<Catalog> it( m_catalogList );
+ while( Catalog* catalog = it.current() ){
+ ++it;
+ codeRepository()->unregisterCatalog( catalog );
+ }
+
+ mainWindow( )->removeView( m_problemReporter );
+
+ delete m_problemReporter;
+ m_problemReporter = 0;
+}
+
+void JavaSupportPart::customEvent( QCustomEvent* ev )
+{
+ //kdDebug(9013) << "JavaSupportPart::customEvent()" << endl;
+
+ if( ev->type() == int(Event_FileParsed) ){
+ FileParsedEvent* event = (FileParsedEvent*) ev;
+ QString fileName = event->fileName();
+
+ if( m_problemReporter ){
+ m_problemReporter->removeAllProblems( fileName );
+
+ bool hasErrors = false;
+ QValueList<Problem> problems = event->problems();
+ QValueList<Problem>::ConstIterator it = problems.begin();
+ while( it != problems.end() ){
+ const Problem& p = *it++;
+ if( p.level() == Problem::Level_Error )
+ hasErrors = true;
+
+ m_problemReporter->reportProblem( fileName, p );
+ }
+
+ m_backgroundParser->lock();
+ if( RefJavaAST ast = m_backgroundParser->translationUnit(fileName) ){
+
+ if( !hasErrors ){
+ if( codeModel()->hasFile(fileName) ){
+ FileDom file = codeModel()->fileByName( fileName );
+ removeWithReferences( fileName );
+ }
+
+ FileDom file = codeModel()->create<FileModel>();
+ file->setName( fileName );
+ JavaStoreWalker walker;
+ walker.setFile( file );
+ walker.setCodeModel( codeModel() );
+
+ walker.compilationUnit( ast );
+ codeModel()->addFile( file );
+
+ emit addedSourceInfo( fileName );
+ }
+ }
+ m_backgroundParser->unlock();
+ }
+ emit fileParsed( fileName );
+ }
+}
+
+void JavaSupportPart::projectConfigWidget( KDialogBase* /*dlg*/ )
+{
+}
+
+void JavaSupportPart::configWidget(KDialogBase */*dlg*/)
+{
+}
+
+void JavaSupportPart::activePartChanged(KParts::Part *part)
+{
+ kdDebug(9032) << "JavaSupportPart::activePartChanged()" << endl;
+
+ bool enabled = false;
+
+ m_activeDocument = dynamic_cast<KTextEditor::Document*>( part );
+ m_activeView = part ? dynamic_cast<KTextEditor::View*>( part->widget() ) : 0;
+ m_activeEditor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ m_activeSelection = dynamic_cast<KTextEditor::SelectionInterface*>( part );
+ m_activeViewCursor = part ? dynamic_cast<KTextEditor::ViewCursorInterface*>( m_activeView ) : 0;
+
+ m_activeFileName = QString::null;
+
+ if (m_activeDocument) {
+ m_activeFileName = URLUtil::canonicalPath( m_activeDocument->url().path() );
+ QFileInfo fi( m_activeFileName );
+ QString ext = fi.extension();
+ if (fileExtensions().contains(ext))
+ enabled = true;
+ }
+
+ if( !part )
+ return;
+
+ if( !m_activeView )
+ return;
+
+#if 0
+ KTextEditor::TextHintInterface* textHintIface = dynamic_cast<KTextEditor::TextHintInterface*>( m_activeView );
+ if( !textHintIface )
+ return;
+
+ connect( view, SIGNAL(needTextHint(int,int,QString&)),
+ this, SLOT(slotNeedTextHint(int,int,QString&)) );
+
+ textHintIface->enableTextHints( 1000 );
+#endif
+}
+
+
+void JavaSupportPart::projectOpened( )
+{
+ kdDebug( 9013 ) << "projectOpened( )" << endl;
+
+ m_projectDirectory = URLUtil::canonicalPath( project()->projectDirectory() );
+
+ connect( project( ), SIGNAL( addedFilesToProject( const QStringList & ) ),
+ this, SLOT( addedFilesToProject( const QStringList & ) ) );
+ connect( project( ), SIGNAL( removedFilesFromProject( const QStringList &) ),
+ this, SLOT( removedFilesFromProject( const QStringList & ) ) );
+ connect( project( ), SIGNAL( changedFilesInProject( const QStringList & ) ),
+ this, SLOT( changedFilesInProject( const QStringList & ) ) );
+ connect( project(), SIGNAL(projectCompiled()),
+ this, SLOT(slotProjectCompiled()) );
+
+ m_timestamp.clear();
+
+ m_projectClosed = false;
+
+ QTimer::singleShot( 500, this, SLOT( initialParse( ) ) );
+}
+
+
+void JavaSupportPart::projectClosed( )
+{
+ kdDebug( 9013 ) << "projectClosed( )" << endl;
+
+ saveProjectSourceInfo();
+
+ if( m_backgroundParser )
+ m_backgroundParser->removeAllFiles();
+
+ m_projectClosed = true;
+}
+
+void JavaSupportPart::contextMenu(QPopupMenu */*popup*/, const Context *context)
+{
+ m_activeClass = 0;
+ m_activeFunction = 0;
+ m_activeVariable = 0;
+
+ if( context->hasType(Context::EditorContext) ){
+ // nothing!
+ } else if( context->hasType(Context::CodeModelItemContext) ){
+ const CodeModelItemContext* mcontext = static_cast<const CodeModelItemContext*>( context );
+
+ if( mcontext->item()->isClass() ){
+ m_activeClass = (ClassModel*) mcontext->item();
+ } else if( mcontext->item()->isFunction() ){
+ m_activeFunction = (FunctionModel*) mcontext->item();
+ }
+ }
+}
+
+void JavaSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ QStringList files = fileList;
+
+ for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + (*it) );
+
+ maybeParse( path );
+ emit addedSourceInfo( path );
+ }
+}
+
+void JavaSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ for ( QStringList::ConstIterator it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it );
+
+ removeWithReferences( path );
+ m_backgroundParser->removeFile( path );
+ }
+}
+
+void JavaSupportPart::changedFilesInProject( const QStringList & fileList )
+{
+ QStringList files = fileList;
+
+ for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it )
+ {
+ QString path = URLUtil::canonicalPath( m_projectDirectory + "/" + *it );
+
+ maybeParse( path );
+ emit addedSourceInfo( path );
+ }
+}
+
+void JavaSupportPart::savedFile(const KURL &fileName)
+{
+ Q_UNUSED( fileName.path() );
+
+#if 0 // not needed anymore
+ kdDebug(9013) << "savedFile(): " << fileName.mid ( m_projectDirectory.length() + 1 ) << endl;
+
+ QStringList projectFileList = project()->allFiles();
+ if (projectFileList.contains(fileName.mid ( m_projectDirectory.length() + 1 ))) {
+ maybeParse( fileName );
+ emit addedSourceInfo( fileName );
+ }
+#endif
+}
+
+QString JavaSupportPart::findSourceFile()
+{
+ QFileInfo fi( m_activeFileName );
+ QString path = fi.filePath();
+ QString ext = fi.extension();
+ QString base = path.left( path.length() - ext.length() );
+ QStringList candidates;
+
+ if (ext == "h" || ext == "H" || ext == "hh" || ext == "hxx" || ext == "hpp" || ext == "tlh") {
+ candidates << (base + "c");
+ candidates << (base + "cc");
+ candidates << (base + "java");
+ candidates << (base + "java");
+ candidates << (base + "cxx");
+ candidates << (base + "C");
+ candidates << (base + "m");
+ candidates << (base + "mm");
+ candidates << (base + "M");
+ candidates << (base + "inl");
+ }
+
+ QStringList::ConstIterator it;
+ for (it = candidates.begin(); it != candidates.end(); ++it) {
+ kdDebug(9013) << "Trying " << (*it) << endl;
+ if (QFileInfo(*it).exists()) {
+ return *it;
+ }
+ }
+
+ return m_activeFileName;
+}
+
+KDevLanguageSupport::Features JavaSupportPart::features()
+{
+ return Features( Classes | Functions | Variables );
+}
+
+QString JavaSupportPart::formatClassName(const QString &name)
+{
+ return name;
+}
+
+QString JavaSupportPart::unformatClassName(const QString &name)
+{
+ return name;
+}
+
+QStringList JavaSupportPart::fileExtensions() const
+{
+ return QStringList::split(",", "java");
+}
+
+void JavaSupportPart::slotNewClass()
+{
+}
+
+void JavaSupportPart::addMethod( ClassDom /*klass*/ )
+{
+}
+
+void JavaSupportPart::addAttribute( ClassDom /*klass*/ )
+{
+}
+
+void JavaSupportPart::initialParse( )
+{
+ // For debugging
+ if( !project( ) ){
+ // messagebox ?
+ kdDebug( 9013 ) << "No project" << endl;
+ return;
+ }
+
+ parseProject( );
+ emit updatedSourceInfo();
+ m_valid = true;
+ return;
+}
+
+#if QT_VERSION < 0x030100
+// Taken from qt-3.2/tools/qdatetime.java/QDateTime::toTime_t() and modified for normal function
+uint toTime_t(QDateTime t)
+{
+ tm brokenDown;
+ brokenDown.tm_sec = t.time().second();
+ brokenDown.tm_min = t.time().minute();
+ brokenDown.tm_hour = t.time().hour();
+ brokenDown.tm_mday = t.date().day();
+ brokenDown.tm_mon = t.date().month() - 1;
+ brokenDown.tm_year = t.date().year() - 1900;
+ brokenDown.tm_isdst = -1;
+ int secsSince1Jan1970UTC = (int) mktime( &brokenDown );
+ if ( secsSince1Jan1970UTC < -1 )
+ secsSince1Jan1970UTC = -1;
+ return (uint) secsSince1Jan1970UTC;
+}
+#endif
+
+bool
+JavaSupportPart::parseProject( )
+{
+ //QLabel* label = new QLabel( "", mainWindow( )->statusBar( ) );
+ //label->setMinimumWidth( 600 );
+ //mainWindow( )->statusBar( )->addWidget( label );
+ //label->show( );
+
+ mainWindow()->statusBar()->message( i18n("Updating...") );
+
+ kapp->processEvents( );
+ kapp->setOverrideCursor( waitCursor );
+
+ QStringList files = modifiedFileList();
+
+ QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow( )->statusBar( )->addWidget( bar );
+ bar->show( );
+
+ QDir d( m_projectDirectory );
+
+ QDataStream stream;
+ QMap< QString, QPair<uint, uint> > pcs;
+
+ if( QFileInfo( project()->projectDirectory() + "/" +
+ project()->projectName().lower() + ".kdevelop.pcs" ).exists() )
+ {
+ d.rename(project()->projectName().lower() + ".kdevelop.pcs",
+ project()->projectName() + ".kdevelop.pcs");
+ }
+ QFile f(project()->projectDirectory() + "/" + project()->projectName() + ".kdevelop.pcs");
+ if( f.open(IO_ReadOnly) ){
+ stream.setDevice( &f );
+
+ QString sig;
+ int pcs_version = 0;
+ stream >> sig >> pcs_version;
+ if( sig == "PCS" && pcs_version == KDEV_PCS_VERSION ){
+
+ int numFiles = 0;
+ stream >> numFiles;
+
+ for( int i=0; i<numFiles; ++i ){
+ QString fn;
+ uint ts;
+ uint offset;
+
+ stream >> fn >> ts >> offset;
+ pcs[ fn ] = qMakePair( ts, offset );
+ }
+ }
+ }
+
+ int n = 0;
+ for( QStringList::Iterator it = files.begin( ); it != files.end( ); ++it ) {
+ bar->setProgress( n++ );
+ QFileInfo fileInfo( d, *it );
+
+ if( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() ){
+ QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() );
+ kdDebug(9013) << "parse file: " << absFilePath << endl;
+
+ if( (n%5) == 0 ){
+ kapp->processEvents();
+
+ if( m_projectClosed ){
+ delete( bar );
+ return false;
+ }
+ }
+
+ if( isValidSource(absFilePath) ){
+ QDateTime t = fileInfo.lastModified();
+ if( m_timestamp.contains(absFilePath) && m_timestamp[absFilePath] == t )
+ continue;
+
+#if QT_VERSION >= 0x030100
+ if( pcs.contains(absFilePath) && t.toTime_t() == pcs[absFilePath].first ){
+#else
+ if( pcs.contains(absFilePath) && toTime_t(t) == pcs[absFilePath].first ){
+#endif
+ stream.device()->at( pcs[absFilePath].second );
+ FileDom file = codeModel()->create<FileModel>();
+ file->read( stream );
+ codeModel()->addFile( file );
+ } else {
+ m_driver->parseFile( absFilePath );
+ }
+
+ m_timestamp[ absFilePath ] = t;
+ }
+ }
+
+ if( m_projectClosed ){
+ kdDebug(9013) << "ABORT" << endl;
+ kapp->restoreOverrideCursor( );
+ return false;
+ }
+ }
+
+ kdDebug( 9013 ) << "updating sourceinfo" << endl;
+ emit updatedSourceInfo();
+
+ mainWindow( )->statusBar( )->removeWidget( bar );
+ delete bar;
+ //mainWindow( )->statusBar( )->removeWidget( label );
+ //delete label;
+
+ kapp->restoreOverrideCursor( );
+ mainWindow( )->statusBar( )->message( i18n( "Done" ), 2000 );
+
+ return true;
+}
+
+void JavaSupportPart::maybeParse( const QString& fileName )
+{
+ if( !isValidSource(fileName) )
+ return;
+
+ QFileInfo fileInfo( fileName );
+ QString path = URLUtil::canonicalPath( fileName );
+ QDateTime t = fileInfo.lastModified();
+
+ if( !fileInfo.exists() ){
+ removeWithReferences( path );
+ return;
+ }
+
+ QMap<QString, QDateTime>::Iterator it = m_timestamp.find( path );
+ if( it != m_timestamp.end() && *it == t ){
+ return;
+ }
+
+ m_timestamp[ path ] = t;
+ m_driver->parseFile( path );
+}
+
+void JavaSupportPart::slotNeedTextHint( int /*line*/, int /*column*/, QString& /*textHint*/ )
+{
+}
+
+QStringList JavaSupportPart::subclassWidget(const QString& /*formName*/)
+{
+ QStringList newFileNames;
+ return newFileNames;
+}
+
+QStringList JavaSupportPart::updateWidget(const QString& /*formName*/, const QString& /*fileName*/)
+{
+ QStringList dummy;
+ return dummy;
+}
+
+void JavaSupportPart::partRemoved( KParts::Part* part )
+{
+ kdDebug(9032) << "JavaSupportPart::partRemoved()" << endl;
+
+ if( KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part ) ){
+
+ QString fileName = doc->url().path();
+ if( fileName.isEmpty() )
+ return;
+
+ QString canonicalFileName = URLUtil::canonicalPath( fileName );
+ m_backgroundParser->removeFile( canonicalFileName );
+ m_backgroundParser->addFile( canonicalFileName, true );
+ }
+}
+
+void JavaSupportPart::slotProjectCompiled()
+{
+ kdDebug(9013) << "JavaSupportPart::slotProjectCompiled()" << endl;
+ parseProject();
+}
+
+QStringList JavaSupportPart::modifiedFileList()
+{
+ QStringList lst;
+
+ QStringList fileList = project()->allFiles();
+ QStringList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QString fileName = *it;
+ ++it;
+
+ QFileInfo fileInfo( m_projectDirectory, fileName );
+
+ if( !fileExtensions().contains(fileInfo.extension()) )
+ continue;
+
+ QDateTime t = fileInfo.lastModified();
+ QString path = URLUtil::canonicalPath( fileInfo.absFilePath() );
+ QMap<QString, QDateTime>::Iterator dictIt = m_timestamp.find( path );
+ if( fileInfo.exists() && dictIt != m_timestamp.end() && *dictIt == t )
+ continue;
+
+ lst << fileName;
+ }
+
+ return lst;
+}
+
+KTextEditor::Document * JavaSupportPart::findDocument( const KURL & url )
+{
+ if( !partController()->parts() )
+ return 0;
+
+ QPtrList<KParts::Part> parts( *partController()->parts() );
+ QPtrListIterator<KParts::Part> it( parts );
+ while( KParts::Part* part = it.current() ){
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
+ if( doc && doc->url() == url )
+ return doc;
+ ++it;
+ }
+
+ return 0;
+}
+
+void JavaSupportPart::setupCatalog( )
+{
+ kdDebug(9013) << "JavaSupportPart::setupCatalog()" << endl;
+
+ QStringList indexList = QStringList() << "kind" << "name" << "scope" << "fileName";
+
+ KStandardDirs *dirs = JavaSupportFactory::instance()->dirs();
+ QStringList pcsList = dirs->findAllResources( "pcs", "*.db", false, true );
+ QStringList pcsIdxList = dirs->findAllResources( "pcs", "*.idx", false, true );
+
+ if( pcsList.size() && pcsVersion() < KDEV_DB_VERSION ){
+ QStringList l = pcsList + pcsIdxList;
+ int rtn = KMessageBox::questionYesNoList( 0, i18n("Persistent class store will be disabled: you have a wrong version of pcs installed.\nRemove old pcs files?"), l, i18n("Java Support"), KStdGuiItem::remove(), i18n("Keep Them") );
+ if( rtn == KMessageBox::Yes ){
+ QStringList::Iterator it = l.begin();
+ while( it != l.end() ){
+ QFile::remove( *it );
+ ++it;
+ }
+ // @todo regenerate the pcs list
+ pcsList.clear();
+ } else {
+ return;
+ }
+ }
+
+ QStringList::Iterator it = pcsList.begin();
+ while( it != pcsList.end() ){
+ Catalog* catalog = new Catalog();
+ catalog->open( *it );
+ ++it;
+
+ for( QStringList::Iterator idxIt=indexList.begin(); idxIt!=indexList.end(); ++idxIt )
+ catalog->addIndex( (*idxIt).utf8() );
+
+ m_catalogList.append( catalog );
+ codeRepository()->registerCatalog( catalog );
+ }
+
+ setPcsVersion( KDEV_DB_VERSION );
+}
+
+KMimeType::List JavaSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime;
+
+ mime = KMimeType::mimeType( "text/x-java" );
+ if( mime )
+ list << mime;
+
+ return list;
+}
+
+int JavaSupportPart::pcsVersion()
+{
+ KConfig* config = JavaSupportFactory::instance()->config();
+ KConfigGroupSaver cgs( config, "PCS" );
+ return config->readNumEntry( "Version", 0 );
+}
+
+void JavaSupportPart::setPcsVersion( int version )
+{
+ KConfig* config = JavaSupportFactory::instance()->config();
+ KConfigGroupSaver cgs( config, "PCS" );
+ config->writeEntry( "Version", version );
+ config->sync();
+}
+
+QString JavaSupportPart::formatTag( const Tag & /*inputTag*/ )
+{
+ return QString::null;
+}
+
+void JavaSupportPart::removeWithReferences( const QString & fileName )
+{
+ kdDebug(9013) << "remove with references: " << fileName << endl;
+ m_timestamp.remove( fileName );
+ if( !codeModel()->hasFile(fileName) )
+ return;
+
+ emit aboutToRemoveSourceInfo( fileName );
+
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+}
+
+bool JavaSupportPart::isValidSource( const QString& fileName ) const
+{
+ QFileInfo fileInfo( fileName );
+ return fileExtensions().contains( fileInfo.extension() ) && !QFile::exists(fileInfo.dirPath(true) + "/.kdev_ignore");
+}
+
+QString JavaSupportPart::formatModelItem( const CodeModelItem *item, bool shortDescription )
+{
+ if (item->isFunction())
+ {
+ const FunctionModel *model = static_cast<const FunctionModel*>(item);
+ QString function;
+ QString args;
+ ArgumentList argumentList = model->argumentList();
+ for (ArgumentList::const_iterator it = argumentList.begin(); it != argumentList.end(); ++it)
+ {
+ args.isEmpty() ? args += "" : args += ", " ;
+ args += formatModelItem((*it).data());
+ }
+ if( !shortDescription )
+ function += model->resultType() + " ";
+
+ function += model->name() + "(" + args + ")" +
+ (model->isAbstract() ? QString(" = 0") : QString("") );
+
+ return function;
+ }
+ else if (item->isVariable())
+ {
+ const VariableModel *model = static_cast<const VariableModel*>(item);
+ if( shortDescription )
+ return model->name();
+ return model->type() + " " + model->name();
+ }
+ else if (item->isArgument())
+ {
+ const ArgumentModel *model = static_cast<const ArgumentModel*>(item);
+ QString arg;
+ if( !shortDescription )
+ arg += model->type() + " ";
+ arg += model->name();
+ if( !shortDescription )
+ arg += model->defaultValue().isEmpty() ? QString("") : QString(" = ") + model->defaultValue();
+ return arg.stripWhiteSpace();
+ }
+ else
+ return KDevLanguageSupport::formatModelItem( item, shortDescription );
+}
+
+void JavaSupportPart::addClass( )
+{
+ slotNewClass();
+}
+
+void JavaSupportPart::saveProjectSourceInfo( )
+{
+ const FileList fileList = codeModel()->fileList();
+
+ if( !project() || fileList.isEmpty() )
+ return;
+
+ QFile f( project()->projectDirectory() + "/" +
+ project()->projectName() + ".kdevelop.pcs" );
+ if( !f.open( IO_WriteOnly ) )
+ return;
+
+ QDataStream stream( &f );
+ QMap<QString, uint> offsets;
+
+ QString pcs( "PCS" );
+ stream << pcs << KDEV_PCS_VERSION;
+
+ stream << int( fileList.size() );
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
+ const FileDom dom = (*it);
+#if QT_VERSION >= 0x030100
+ stream << dom->name() << m_timestamp[ dom->name() ].toTime_t();
+#else
+ stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]);
+#endif
+ offsets.insert( dom->name(), stream.device()->at() );
+ stream << (uint)0; // dummy offset
+ }
+
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
+ const FileDom dom = (*it);
+ int offset = stream.device()->at();
+
+ dom->write( stream );
+
+ int end = stream.device()->at();
+
+ stream.device()->at( offsets[dom->name()] );
+ stream << offset;
+ stream.device()->at( end );
+ }
+}
+
+#include "javasupportpart.moc"
diff --git a/languages/java/javasupportpart.h b/languages/java/javasupportpart.h
new file mode 100644
index 00000000..e6280560
--- /dev/null
+++ b/languages/java/javasupportpart.h
@@ -0,0 +1,165 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2002-2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _JAVASUPPORTPART_H_
+#define _JAVASUPPORTPART_H_
+
+#include <kdevcore.h>
+#include <kdevlanguagesupport.h>
+
+#include <kdialogbase.h>
+#include <qguardedptr.h>
+#include <qstring.h>
+#include <qwaitcondition.h>
+#include <qdatetime.h>
+
+class Context;
+class ProblemReporter;
+class BackgroundParser;
+class Catalog;
+class QLabel;
+class QProgressBar;
+class QStringList;
+class QListViewItem;
+class KListView;
+class Driver;
+
+namespace KParts { class Part; }
+namespace KTextEditor
+{
+ class Document;
+ class View;
+ class EditInterface;
+ class SelectionInterface;
+ class ViewCursorInterface;
+}
+
+class JavaSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ JavaSupportPart( QObject *parent, const char *name, const QStringList &args );
+ virtual ~JavaSupportPart();
+
+ bool isValid() const { return m_valid; }
+
+ ProblemReporter* problemReporter() { return m_problemReporter; }
+ BackgroundParser* backgroundParser() { return m_backgroundParser; }
+
+ const QPtrList<Catalog>& catalogList() { return m_catalogList; }
+
+ bool isValidSource( const QString& fileName ) const;
+ QStringList fileExtensions( ) const;
+
+ virtual void customEvent( QCustomEvent* ev );
+
+ virtual QStringList subclassWidget(const QString& formName);
+ virtual QStringList updateWidget(const QString& formName, const QString& fileName);
+
+ KTextEditor::Document* findDocument( const KURL& url );
+
+ static KConfig *config();
+
+ virtual QString formatTag( const Tag& tag );
+ virtual QString formatModelItem( const CodeModelItem *item, bool shortDescription=false );
+ virtual void addClass();
+
+signals:
+ void fileParsed( const QString& fileName );
+
+protected:
+ virtual KDevLanguageSupport::Features features();
+ virtual KMimeType::List mimeTypes();
+ virtual QString formatClassName(const QString &name);
+ virtual QString unformatClassName(const QString &name);
+ virtual void addMethod( ClassDom klass );
+ virtual void addAttribute( ClassDom klass );
+
+private slots:
+ void activePartChanged(KParts::Part *part);
+ void partRemoved( KParts::Part* part );
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void configWidget(KDialogBase *dlg);
+ void projectConfigWidget(KDialogBase *dlg);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void changedFilesInProject( const QStringList & fileList );
+ void slotProjectCompiled();
+ void setupCatalog();
+
+ void slotNewClass();
+
+ void slotNeedTextHint( int, int, QString& );
+
+ /**
+ * loads, parses and creates both classstores needed
+ */
+ void initialParse( );
+
+ /**
+ * only parses the current project
+ */
+ bool parseProject( );
+
+private:
+
+ /**
+ * checks if a file has to be parsed
+ */
+ void maybeParse( const QString& fileName );
+ void removeWithReferences( const QString& fileName );
+
+ QStringList modifiedFileList();
+ QString findSourceFile();
+ int pcsVersion();
+ void setPcsVersion( int version );
+
+ void saveProjectSourceInfo();
+
+ QString m_contextFileName;
+
+ QGuardedPtr< ProblemReporter > m_problemReporter;
+ BackgroundParser* m_backgroundParser;
+
+ KTextEditor::Document* m_activeDocument;
+ KTextEditor::View* m_activeView;
+ KTextEditor::SelectionInterface* m_activeSelection;
+ KTextEditor::EditInterface* m_activeEditor;
+ KTextEditor::ViewCursorInterface* m_activeViewCursor;
+ QString m_activeFileName;
+
+ QWaitCondition m_eventConsumed;
+ bool m_projectClosed;
+
+ QMap<QString, QDateTime> m_timestamp;
+ bool m_valid;
+
+ QPtrList<Catalog> m_catalogList;
+ Driver* m_driver;
+ QString m_projectDirectory;
+
+ ClassDom m_activeClass;
+ FunctionDom m_activeFunction;
+ VariableDom m_activeVariable;
+
+ friend class KDevJavaSupportIface;
+ friend class JavaDriver;
+};
+
+#endif
diff --git a/languages/java/javatemplates b/languages/java/javatemplates
new file mode 100644
index 00000000..09373351
--- /dev/null
+++ b/languages/java/javatemplates
@@ -0,0 +1,3 @@
+<!DOCTYPE Templates>
+<Templates>
+</Templates>
diff --git a/languages/java/kdevdeepcopy.h b/languages/java/kdevdeepcopy.h
new file mode 100644
index 00000000..8e7d8fbe
--- /dev/null
+++ b/languages/java/kdevdeepcopy.h
@@ -0,0 +1,12 @@
+#ifndef KDEVDEEPCOPY_H
+#define KDEVDEEPCOPY_H
+
+#include <qstring.h>
+
+inline QString deepCopy( const QString& s )
+{
+ QCString str = s.utf8();
+ return QString::fromUtf8( str, str.length() );
+}
+
+#endif
diff --git a/languages/java/kdevdriver.cpp b/languages/java/kdevdriver.cpp
new file mode 100644
index 00000000..444217ff
--- /dev/null
+++ b/languages/java/kdevdriver.cpp
@@ -0,0 +1,44 @@
+
+#include "kdevdriver.h"
+#include "JavaLexer.hpp"
+#include <unistd.h>
+#include <qfileinfo.h>
+
+KDevDriver::KDevDriver( JavaSupportPart* javaSupport )
+ : m_javaSupport( javaSupport )
+{
+}
+
+JavaSupportPart* KDevDriver::javaSupport()
+{
+ return m_javaSupport;
+}
+
+void KDevDriver::setupProject()
+{
+ QMap<QString, bool> map;
+
+ {
+ QStringList fileList = m_javaSupport->project()->allFiles();
+ QStringList::ConstIterator it = fileList.begin();
+ while( it != fileList.end() ){
+ QFileInfo info( *it );
+ ++it;
+
+ map.insert( info.dirPath(true), true );
+ }
+ }
+
+ {
+ QMap<QString, bool>::Iterator it = map.begin();
+ while( it != map.end() ){
+ addIncludePath( it.key() );
+ ++it;
+ }
+ }
+}
+
+void KDevDriver::setupLexer( JavaLexer* lexer )
+{
+ Driver::setupLexer( lexer );
+}
diff --git a/languages/java/kdevdriver.h b/languages/java/kdevdriver.h
new file mode 100644
index 00000000..041129fa
--- /dev/null
+++ b/languages/java/kdevdriver.h
@@ -0,0 +1,30 @@
+
+#ifndef __kdevdriver_h
+#define __kdevdriver_h
+
+#include "javasupportpart.h"
+
+#include <kdevproject.h>
+#include <kdeversion.h>
+
+#include "driver.h"
+
+#include <cstdlib>
+#include <unistd.h>
+
+class KDevDriver: public Driver
+{
+public:
+ KDevDriver( JavaSupportPart* javaSupport );
+ JavaSupportPart* javaSupport();
+ void setupProject();
+
+protected:
+ void setupLexer( JavaLexer* lexer );
+
+private:
+ JavaSupportPart* m_javaSupport;
+};
+
+#endif
+
diff --git a/languages/java/kdevjavasupport.desktop b/languages/java/kdevjavasupport.desktop
new file mode 100644
index 00000000..053ecfce
--- /dev/null
+++ b/languages/java/kdevjavasupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Java Support
+Comment[ca]=Suport per a Java
+Comment[da]=Java understøttelse
+Comment[de]=Java-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη Java
+Comment[es]=Soporte para Java
+Comment[et]=Java toetus
+Comment[eu]=Java euskarria
+Comment[fa]=پشتیبانی جاوا
+Comment[fr]=Prise en charge de Java
+Comment[ga]=Tacaíocht Java
+Comment[gl]=Soporte para Java
+Comment[hi]=जावा समर्थन
+Comment[hu]=Java-támogatás
+Comment[is]=Java stuðningur
+Comment[it]=Supporto per Java
+Comment[ja]=Java サポート
+Comment[nds]=Java-Ünnerstütten för KDevelop
+Comment[ne]=जाभा समर्थन
+Comment[nl]=Ondersteuning voor Java
+Comment[pl]=Obsługa Javy
+Comment[pt]=Suporte a Java
+Comment[pt_BR]=Suporte ao Java
+Comment[ru]=Поддержка языка Java
+Comment[sk]=Java podpora
+Comment[sl]=Podpora javi
+Comment[sr]=Подршка за Java-у
+Comment[sr@Latn]=Podrška za Java-u
+Comment[sv]=Java-stöd
+Comment[ta]=ஜாவா ஆதரவு
+Comment[tg]=Ёрӣ намудани забони Java
+Comment[tr]=Java Desteği
+Comment[zh_CN]=Java 支持
+Comment[zh_TW]=Java 支援
+Name=KDevJavaSupport
+Name[da]=KDevelop Java-understøttelse
+Name[de]=Unterstützung für Java (KDevelop)
+Name[hi]=के-डेव-जावा-समर्थन
+Name[nds]=Java-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaJavy
+Name[sk]=KDev Java podpora
+Name[sv]=KDevelop Java-stöd
+Name[ta]=கெடெவ் ஜாவா ஆதரவு
+Name[zh_TW]=KDevelop Java 支援
+GenericName=Java Support
+GenericName[ca]=Suport per a Java
+GenericName[da]=Java-understøttelse
+GenericName[de]=Unterstützung für Java
+GenericName[el]=Υποστήριξη Java
+GenericName[es]=Soporte para Java
+GenericName[et]=Java toetus
+GenericName[eu]=Java euskarria
+GenericName[fa]=پشتیبانی جاوا
+GenericName[fr]=Prise en charge de JAVA
+GenericName[ga]=Tacaíocht Java
+GenericName[gl]=Soporte para Java
+GenericName[hi]=जावा समर्थन
+GenericName[hu]=Java-támogatás
+GenericName[it]=Supporto Java
+GenericName[ja]=Java サポート
+GenericName[nds]=Ünnerstütten för Java
+GenericName[ne]=जाभा समर्थन
+GenericName[nl]=Ondersteuning voor Java
+GenericName[pl]=Obsługa Javy
+GenericName[pt]=Suporte a Java
+GenericName[pt_BR]=Suporte ao Java
+GenericName[ru]=Поддержка языка Java
+GenericName[sk]=Java podpora
+GenericName[sl]=Podpora javi
+GenericName[sr]=Подршка за Java-у
+GenericName[sr@Latn]=Podrška za Java-u
+GenericName[sv]=Java-stöd
+GenericName[ta]=ஜாவா ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони Java
+GenericName[tr]=Java Desteği
+GenericName[zh_CN]=Java 支持
+GenericName[zh_TW]=Java 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevjavasupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Java
+X-KDevelop-Args=Java
diff --git a/languages/java/kdevjavasupport.rc b/languages/java/kdevjavasupport.rc
new file mode 100644
index 00000000..e9b80d0d
--- /dev/null
+++ b/languages/java/kdevjavasupport.rc
@@ -0,0 +1,4 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevJavaSupport" version="4">
+</kpartgui>
+
diff --git a/languages/java/newclass_templates/Makefile.am b/languages/java/newclass_templates/Makefile.am
new file mode 100644
index 00000000..d24c99ef
--- /dev/null
+++ b/languages/java/newclass_templates/Makefile.am
@@ -0,0 +1,4 @@
+javasupportdatadir = ${kde_datadir}/kdevjavasupport
+newclassdir = ${javasupportdatadir}/newclass
+
+newclass_DATA = java_source
diff --git a/languages/java/newclass_templates/java_source b/languages/java/newclass_templates/java_source
new file mode 100644
index 00000000..eeeb1ea0
--- /dev/null
+++ b/languages/java/newclass_templates/java_source
@@ -0,0 +1,9 @@
+#include "$HEADER$"
+
+$NAMESPACEBEG$
+
+$CONSTRUCTORDEFINITIONS$
+
+$DEFINITIONS$
+
+$NAMESPACEEND$
diff --git a/languages/java/problemreporter.cpp b/languages/java/problemreporter.cpp
new file mode 100644
index 00000000..12955662
--- /dev/null
+++ b/languages/java/problemreporter.cpp
@@ -0,0 +1,299 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "problemreporter.h"
+#include "javasupportpart.h"
+#include "configproblemreporter.h"
+#include "backgroundparser.h"
+
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+
+#include <kdeversion.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/markinterface.h>
+
+#include <ktexteditor/markinterfaceextension.h>
+#include <ktexteditor/view.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kdialogbase.h>
+
+#include <kconfig.h>
+
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qfileinfo.h>
+#include <qwhatsthis.h>
+#include <qgroupbox.h>
+
+
+class ProblemItem: public KListViewItem
+{
+public:
+ ProblemItem( QListView* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, level, problem, file, line, column ) {}
+
+ ProblemItem( QListViewItem* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, level, problem, file, line, column ) {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const {
+ if( column == 2 || column == 3 ){
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if( a == b )
+ return 0;
+ return( a > b ? 1 : -1 );
+ }
+ return KListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+ProblemReporter::ProblemReporter( JavaSupportPart* part, QWidget* parent, const char* name )
+ : KListView( parent, name ? name : "problemreporter" ),
+ m_javaSupport( part ),
+ m_document( 0 ),
+ m_markIface( 0 )
+{
+ QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. "
+ "It displays TODO entries, FIXME's and errors reported by a language parser. "
+ "To add a TODO or FIXME entry, just type<br>"
+ "<tt>//@todo my todo</tt><br>"
+ "<tt>//TODO: my todo</tt><br>"
+ "<tt>//FIXME fix this</tt>"));
+
+ addColumn( i18n("Level") );
+ addColumn( i18n("File") );
+ addColumn( i18n("Line") );
+ addColumn( i18n("Column") );
+ addColumn( i18n("Problem") );
+ setAllColumnsShowFocus( TRUE );
+
+ m_timer = new QTimer( this );
+
+ connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partAdded(KParts::Part*)),
+ this, SLOT(slotPartAdded(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)),
+ this, SLOT(slotPartRemoved(KParts::Part*)) );
+
+ connect( m_timer, SIGNAL(timeout()), this, SLOT(reparse()) );
+
+ connect( this, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+
+ configure();
+}
+
+ProblemReporter::~ProblemReporter()
+{
+}
+
+void ProblemReporter::slotActivePartChanged( KParts::Part* part )
+{
+ if( !part )
+ return;
+
+ m_timer->stop();
+
+ if( m_document )
+ disconnect( m_document, 0, this, 0 );
+
+ m_document = dynamic_cast<KTextEditor::Document*>( part );
+ m_markIface = 0;
+
+ if( !m_document )
+ return;
+
+ m_fileName = m_document->url().path();
+
+ if( !m_javaSupport->isValidSource(m_fileName) )
+ return;
+
+ connect( m_document, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+ m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part );
+
+ if( !m_javaSupport->backgroundParser() )
+ return;
+
+ m_javaSupport->backgroundParser()->lock();
+ bool needReparse = false;
+ if( !m_javaSupport->backgroundParser()->translationUnit(m_fileName) )
+ needReparse = true;
+ m_javaSupport->backgroundParser()->unlock();
+
+ if( needReparse )
+ reparse();
+}
+
+void ProblemReporter::slotTextChanged()
+{
+ if( m_active )
+ m_timer->changeInterval( m_delay );
+}
+
+void ProblemReporter::removeAllProblems( const QString& filename )
+{
+ QListViewItem* current = firstChild();
+ while( current ){
+ QListViewItem* i = current;
+ current = current->nextSibling();
+
+ if( i->text(1) == filename )
+ delete( i );
+ }
+
+ if( m_document && m_markIface ){
+ QPtrList<KTextEditor::Mark> marks = m_markIface->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while( it.current() ){
+ m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 );
+ ++it;
+ }
+ }
+}
+
+void ProblemReporter::reparse()
+{
+ if( !m_javaSupport->isValid() )
+ return;
+
+ // @todo use the project database to decide which files to parse instead of this!
+ // ugly hack: do not parse non .java ending files
+ if ( !m_fileName.endsWith(".java") )
+ return;
+
+ m_timer->stop();
+
+ kdDebug(9013) << "ProblemReporter::reparse()" << endl;
+ m_javaSupport->backgroundParser()->addFile( m_fileName );
+ kdDebug(9013) << "---> file added " << m_fileName << endl;
+}
+
+void ProblemReporter::slotSelected( QListViewItem* item )
+{
+ KURL url( item->text(1) );
+ int line = item->text( 2 ).toInt();
+ // int column = item->text( 3 ).toInt();
+ m_javaSupport->partController()->editDocument( url, line-1 );
+// m_javaSupport->mainWindow()->lowerView( this );
+}
+
+void ProblemReporter::reportProblem( const QString& fileName, const Problem& p )
+{
+ int markType = levelToMarkType( p.level() );
+ if( markType != -1 && m_document && m_markIface && m_fileName == fileName ){
+ m_markIface->addMark( p.line(), markType );
+ }
+
+ QString msg = p.text();
+ msg = msg.replace( QRegExp("\n"), "" );
+
+ new ProblemItem( this,
+ levelToString( p.level() ),
+ fileName,
+ QString::number( p.line() + 1 ),
+ QString::number( p.column() + 1 ),
+ msg );
+}
+
+void ProblemReporter::configure()
+{
+ kdDebug(9013) << "ProblemReporter::configure()" << endl;
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ m_active = config->readBoolEntry( "EnableJavaBgParser", TRUE );
+ m_delay = config->readNumEntry( "BgParserDelay", 500 );
+}
+
+void ProblemReporter::configWidget( KDialogBase* dlg )
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Java Parsing"));
+ ConfigureProblemReporter* w = new ConfigureProblemReporter( vbox );
+ //FIXME adymo: unused functionality
+ w->groupBox3->hide();
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ connect(dlg, SIGNAL(okClicked()), this, SLOT(configure()));
+}
+
+void ProblemReporter::slotPartAdded( KParts::Part* part )
+{
+ KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part );
+
+ if( !iface )
+ return;
+
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+}
+
+void ProblemReporter::slotPartRemoved( KParts::Part* part )
+{
+ kdDebug(9013) << "ProblemReporter::slotPartRemoved()" << endl;
+ if( part == m_document ){
+ m_document = 0;
+ m_timer->stop();
+ }
+}
+
+QString ProblemReporter::levelToString( int level ) const
+{
+ switch( level )
+ {
+ case Problem::Level_Error:
+ return QString::fromLatin1( "Error" );
+ case Problem::Level_Warning:
+ return QString::fromLatin1( "Warning" );
+ case Problem::Level_Todo:
+ return QString::fromLatin1( "Todo" );
+ case Problem::Level_Fixme:
+ return QString::fromLatin1( "Fixme" );
+ default:
+ return QString::null;
+ }
+}
+
+int ProblemReporter::levelToMarkType( int level ) const
+{
+ switch( level )
+ {
+ case Problem::Level_Error:
+ return KTextEditor::MarkInterface::markType07;
+ case Problem::Level_Warning:
+ return -1;
+ case Problem::Level_Todo:
+ return -1;
+ case Problem::Level_Fixme:
+ return -1;
+ default:
+ return -1;
+ }
+}
+
+#include "problemreporter.moc"
diff --git a/languages/java/problemreporter.h b/languages/java/problemreporter.h
new file mode 100644
index 00000000..93835583
--- /dev/null
+++ b/languages/java/problemreporter.h
@@ -0,0 +1,74 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PROBLEMSREPORTER_H
+#define PROBLEMSREPORTER_H
+
+#include <klistview.h>
+#include <qguardedptr.h>
+
+class JavaSupportPart;
+class QTimer;
+class KDialogBase;
+class Problem;
+
+namespace KParts{
+ class Part;
+}
+
+namespace KTextEditor{
+ class MarkInterface;
+ class Document;
+}
+
+class ProblemReporter: public KListView{
+ Q_OBJECT
+public:
+ ProblemReporter( JavaSupportPart* part, QWidget* parent=0, const char* name=0 );
+ virtual ~ProblemReporter();
+
+ void removeAllProblems( const QString& filename );
+ void reportProblem( const QString& fileName, const Problem& p );
+
+public slots:
+ void reparse();
+ void configure();
+ void configWidget( KDialogBase* );
+
+private slots:
+ void slotPartAdded( KParts::Part* );
+ void slotPartRemoved( KParts::Part* );
+ void slotActivePartChanged( KParts::Part* );
+ void slotTextChanged();
+ void slotSelected( QListViewItem* );
+
+private:
+ QString levelToString( int level ) const;
+ int levelToMarkType( int level ) const;
+
+private:
+ JavaSupportPart* m_javaSupport;
+ QGuardedPtr<KTextEditor::Document> m_document;
+ KTextEditor::MarkInterface* m_markIface;
+ QTimer* m_timer;
+ QString m_fileName;
+ int m_active;
+ int m_delay;
+};
+
+#endif
diff --git a/languages/kjssupport/Makefile.am b/languages/kjssupport/Makefile.am
new file mode 100644
index 00000000..d61fc67c
--- /dev/null
+++ b/languages/kjssupport/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = -I$(kde_includes)/kdevelop $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevkjssupport.la
+libkdevkjssupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevkjssupport_la_LIBADD = -lkjsembed -lkdevelop
+libkdevkjssupport_la_SOURCES = kjssupport_part.cpp kjsproblems.cpp jscodecompletion.cpp subclassingdlg.cpp subclassingdlgbase.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevkjssupport.desktop
+
+mimesrcdir = $(kde_mimedir)/text
+mimesrc_DATA = x-javascript-source.desktop
+
+EXTRA_DIST = $(mimesrc_DATA)
+
+rcdir = $(kde_datadir)/kdevkjssupport
+rc_DATA = kdevkjssupport.rc
+
+SUBDIRS = template subclassing_template
+noinst_HEADERS = kjsproblems.h
diff --git a/languages/kjssupport/jscodecompletion.cpp b/languages/kjssupport/jscodecompletion.cpp
new file mode 100644
index 00000000..8fd59f57
--- /dev/null
+++ b/languages/kjssupport/jscodecompletion.cpp
@@ -0,0 +1,174 @@
+//
+// C++ Implementation: jscodecompletion
+//
+// Description:
+//
+//
+// Author: ian reinhart geiser <geiseri@kde.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "jscodecompletion.h"
+#include <qwhatsthis.h>
+
+#include <qfileinfo.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <kapplication.h>
+#include <qregexp.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdialogbase.h>
+
+
+#include <kdevelop/kdevcore.h>
+#include <kdevelop/kdevmainwindow.h>
+#include <kdevelop/kdevlanguagesupport.h>
+#include <kdevelop/kdevpartcontroller.h>
+#include <kdevelop/kdevproject.h>
+#include <kdevelop/kdevappfrontend.h>
+#include <kdevelop/domutil.h>
+#include <kdevelop/codemodel.h>
+
+JSCodeCompletion::JSCodeCompletion(QObject *parent, const char *name)
+ : QObject(parent, name)
+{
+ m_argWidgetShow = false;
+ m_completionBoxShow=false;
+}
+
+
+JSCodeCompletion::~JSCodeCompletion()
+{}
+
+void JSCodeCompletion::setActiveEditorPart( KParts::Part * part )
+{
+ if (!part || !part->widget())
+ return;
+
+ kdDebug() << "JSCodeCompletion::setActiveEditorPart" << endl;
+
+ // We need to think about this
+ // if(!(m_config->getCodeCompletion() || m_config->getCodeHinting())){
+ // return; // no help
+ // }
+
+ m_editInterface = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!m_editInterface)
+ {
+ kdDebug() << "editor doesn't support the EditDocumentIface" << endl;
+ return;
+ }
+
+ m_cursorInterface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (!m_cursorInterface)
+ {
+ kdDebug() << "editor does not support the ViewCursorInterface" << endl;
+ return;
+ }
+
+ m_codeInterface = dynamic_cast<KTextEditor::CodeCompletionInterface*>(part->widget());
+ if (!m_codeInterface)
+ { // no CodeCompletionDocument available
+ kdDebug() << "editor doesn't support the CodeCompletionDocumentIface" << endl;
+ return;
+ }
+
+ disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice
+ connect(part->widget(), SIGNAL(cursorPositionChanged()),
+ this, SLOT(cursorPositionChanged()));
+ connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHidden()));
+ connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxAbort()));
+ connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHidden()));
+}
+
+QValueList< KTextEditor::CompletionEntry > JSCodeCompletion::getVars( const QString & startText )
+{
+ kdDebug() << "getVars for " << startText << endl;
+ QValueList<KTextEditor::CompletionEntry> varList;
+ /*
+ QValueList<QString>::ConstIterator it;
+ for (it = m_vars.begin(); it != m_vars.end(); ++it)
+ {
+ QString var = "$" + (*it);
+ kdDebug() << "Compair " << var << endl;
+ if( var.startsWith( startText ))
+ {
+ KTextEditor::CompletionEntry e;
+ e.text = var;
+ //e.postfix ="";
+ //e.prefix ="";
+ kdDebug() << "getVar: " << var << endl;
+ varList.append(e);
+ }
+ }
+ */
+ return varList;
+}
+
+void JSCodeCompletion::cursorPositionChanged( )
+{
+ uint line, col;
+ m_cursorInterface->cursorPositionReal(&line, &col);
+ kdDebug() << "JSCodeCompletion::cursorPositionChanged:" << line << ":" << col << endl;
+
+ QString lineStr = m_editInterface->textLine(line);
+ if(lineStr.isNull() || lineStr.isEmpty())
+ {
+ kdDebug() << "No Text..." << endl;
+ return; // nothing to do
+ }
+ // if(m_config->getCodeCompletion())
+ // {
+ QString restLine = lineStr.mid(col);
+ QString prevText = lineStr.mid(0,col);
+
+ if(restLine.left(1) != " " && restLine.left(1) != "\t" && !restLine.isNull())
+ {
+ kdDebug() << "no codecompletion because no empty character after cursor:" << restLine << ":" << endl;
+ return;
+ }
+
+ QRegExp prevReg("([\\d\\w]*)[.]$");
+
+ if (prevReg.search( prevText ) != -1 )
+ {
+ // We are in completion mode
+ QString startMatch = prevReg.cap(0);
+ kdDebug() << "Matching: " << startMatch << endl;
+ m_completionBoxShow=true;
+ m_codeInterface->showCompletionBox(getVars(startMatch),2);
+ }
+ else
+ {
+ kdDebug() << "no vars in: " << prevText << endl;
+ return;
+ }
+
+ // }
+
+
+}
+
+void JSCodeCompletion::completionBoxHidden( )
+{
+ kdDebug() << "Complete..." << endl;
+ m_completionBoxShow=false;
+}
+
+void JSCodeCompletion::completionBoxAbort( )
+{
+ kdDebug() << "aborted..." << endl;
+ m_completionBoxShow=false;
+
+}
+
+
+#include "jscodecompletion.moc"
diff --git a/languages/kjssupport/jscodecompletion.h b/languages/kjssupport/jscodecompletion.h
new file mode 100644
index 00000000..0cceb1e0
--- /dev/null
+++ b/languages/kjssupport/jscodecompletion.h
@@ -0,0 +1,53 @@
+//
+// C++ Interface: jscodecompletion
+//
+// Description:
+//
+//
+// Author: ian reinhart geiser <geiseri@kde.org>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef JSCODECOMPLETION_H
+#define JSCODECOMPLETION_H
+
+#include <qobject.h>
+#include <kdevelop/codemodel.h>
+#include <kdevelop/kdevplugin.h>
+#include <kdevelop/kdevlanguagesupport.h>
+
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+
+/**
+The code completion engine for Javascript.
+
+@author ian reinhart geiser
+*/
+class JSCodeCompletion : public QObject
+{
+ Q_OBJECT
+ public:
+ JSCodeCompletion(QObject *parent = 0, const char *name = 0);
+
+ ~JSCodeCompletion();
+ void setActiveEditorPart(KParts::Part* editorPart);
+ QValueList<KTextEditor::CompletionEntry> getVars(const QString& textHint);
+
+ public slots:
+ void cursorPositionChanged();
+ void completionBoxHidden();
+ void completionBoxAbort();
+
+ private:
+ bool m_argWidgetShow;
+ bool m_completionBoxShow;
+ KTextEditor::EditInterface *m_editInterface;
+ KTextEditor::CodeCompletionInterface *m_codeInterface;
+ KTextEditor::ViewCursorInterface *m_cursorInterface;
+
+};
+
+#endif
diff --git a/languages/kjssupport/kdevkjssupport.desktop b/languages/kjssupport/kdevkjssupport.desktop
new file mode 100644
index 00000000..d60863b8
--- /dev/null
+++ b/languages/kjssupport/kdevkjssupport.desktop
@@ -0,0 +1,54 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=kjsSupport
+Comment[da]=kjs-understøttelse
+Comment[et]=kjs toetus
+Comment[fa]=پشتیبانی kjs
+Comment[nds]=KDE-Ünnerstütten för JavaScript
+Comment[pl]=Obsługakjs
+Comment[sk]=kjs podpora
+Comment[sv]=Javaskript-stöd
+Comment[zh_TW]=kjs 支援
+Name=KDevkjsSupport
+Name[da]=KDevelop Bash-understøttelse
+Name[nds]=KJS-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługakjs
+Name[sk]=KDev kjs podpora
+Name[sv]=KDevelop Javaskript-stöd
+Name[zh_TW]=KDevelop kjs 支援
+GenericName=KDE JavaScript Support
+GenericName[ca]=Suport per a JavaScript per al KDE
+GenericName[da]=KDE JavaScript-understøttelse
+GenericName[de]=Unterstützung für KDE-JavaScript
+GenericName[el]=Υποστήριξη KDE JavaScript
+GenericName[es]=Soporte para JavaScript de KDE
+GenericName[et]=KDE JavaScripti toetus
+GenericName[eu]=KDE JavaScript euskarria
+GenericName[fa]=پشتیبانی جاوااسکریپت KDE
+GenericName[fr]=Prise en charge du JavaScript pour KDE
+GenericName[ga]=Tacaíocht JavaScript KDE
+GenericName[gl]=Soporte para JavaScript de KDE
+GenericName[hu]=KDE Javascript-támogatás
+GenericName[it]=Supporto JavaScript di KDE
+GenericName[ja]=KDE JavaScript サポート
+GenericName[nds]=KDE-Ünnerstütten för JavaScript
+GenericName[ne]=केडीई जाभास्क्रिप्ट समर्थन
+GenericName[nl]=KDE ondersteuning voor JavaScript
+GenericName[pl]=Obsługa JavaScriptu KDE
+GenericName[pt]=Suporte KDE a JavaScript
+GenericName[pt_BR]=Suporte ao JavaScript do KDE
+GenericName[ru]=Поддержка языка JavaScript
+GenericName[sk]=KDE JavaScript podpora
+GenericName[sl]=Podpora javascriptu v KDE
+GenericName[sr]=KDE-ова подршка за Javascript
+GenericName[sr@Latn]=KDE-ova podrška za Javascript
+GenericName[sv]=KDE Javaskript-stöd
+GenericName[tr]=KDE JavaScript Desteği
+GenericName[zh_CN]=KDE JavaScript 支持
+GenericName[zh_TW]=KDE JavaScript 支援
+Icon=kdevelop
+ServiceTypes=KDevelop/LanguageSupport
+X-KDevelop-Language=Javascript
+X-KDE-Library=libkdevkjssupport
+X-KDevelop-Version=3
diff --git a/languages/kjssupport/kdevkjssupport.rc b/languages/kjssupport/kdevkjssupport.rc
new file mode 100644
index 00000000..e48fc863
--- /dev/null
+++ b/languages/kjssupport/kdevkjssupport.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevkjsSupport" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/kjssupport/kjsproblems.cpp b/languages/kjssupport/kjsproblems.cpp
new file mode 100644
index 00000000..39084169
--- /dev/null
+++ b/languages/kjssupport/kjsproblems.cpp
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2003 ian reinhart geiser <geiseri@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "kjsproblems.h"
+#include "kjssupport_part.h"
+#include <kiconloader.h>
+
+class KJSProblemItem: public KListViewItem
+{
+ public:
+ KJSProblemItem( QListView* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, level, problem, file, line, column )
+ {}
+
+ KJSProblemItem( QListViewItem* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, level, problem, file, line, column )
+ {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const
+ {
+ if( column == 2 || column == 3 )
+ {
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if( a == b )
+ return 0;
+ return( a > b ? 1 : -1 );
+ }
+ return KListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+KJSProblems::KJSProblems(kjsSupportPart *part, QWidget *parent, const char *name) : KListView(parent,name), m_part(part)
+{
+ addColumn ("File");
+ addColumn ("Line #");
+ addColumn ("Problem:");
+ setIcon( SmallIcon("info") );
+}
+
+
+KJSProblems::~KJSProblems()
+{
+
+}
+
+void KJSProblems::clearItems()
+{
+ clear();
+ setIcon( SmallIcon("info") );
+}
+
+void KJSProblems::addLine(const QString &file, int lineNo, const QString &message)
+{
+ new QListViewItem( this, file, QString::number( lineNo ), message);
+ setIcon( SmallIcon("error") );
+}
+
+
+#include "kjsproblems.moc"
diff --git a/languages/kjssupport/kjsproblems.h b/languages/kjssupport/kjsproblems.h
new file mode 100644
index 00000000..d7d47c63
--- /dev/null
+++ b/languages/kjssupport/kjsproblems.h
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2003 ian reinhart geiser <geiseri@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef KJSPROBLEMS_H
+#define KJSPROBLEMS_H
+
+#include <klistview.h>
+class kjsSupportPart;
+
+/**
+@author ian reinhart geiser
+*/
+class KJSProblems : public KListView
+{
+Q_OBJECT
+public:
+
+ KJSProblems(kjsSupportPart *part, QWidget *parent = 0L, const char *name = 0L);
+ ~KJSProblems();
+
+ void clearItems();
+ void addLine(const QString &file, int lineNo, const QString &message);
+
+private:
+ kjsSupportPart *m_part;
+};
+
+#endif
diff --git a/languages/kjssupport/kjssupport_part.cpp b/languages/kjssupport/kjssupport_part.cpp
new file mode 100644
index 00000000..c4907991
--- /dev/null
+++ b/languages/kjssupport/kjssupport_part.cpp
@@ -0,0 +1,448 @@
+/*
+ Copyright (C) 2003 ian reinhart geiser <geiseri@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qwhatsthis.h>
+#include <qtimer.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <qpopupmenu.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+#include <kdevcore.h>
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+#include <domutil.h>
+#include <codemodel.h>
+#include <kparts/part.h>
+
+
+#include <kdevproject.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kapplication.h>
+
+#include <kjsembed/kjsembedpart.h>
+#include <kjsembed/jsconsolewidget.h>
+
+#include <kdevplugininfo.h>
+
+#include "kjssupport_part.h"
+#include "kjsproblems.h"
+#include "jscodecompletion.h"
+#include "subclassingdlg.h"
+
+typedef KDevGenericFactory<kjsSupportPart> kjsSupportFactory;
+static const KDevPluginInfo data("kdevkjssupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevkjssupport, kjsSupportFactory( data ) );
+
+
+class typeProperty
+{
+ public:
+ QString type;
+ QString name;
+ int depth;
+};
+
+kjsSupportPart::kjsSupportPart(QObject *parent, const char *name, const QStringList& )
+: KDevLanguageSupport(&data, parent, name ? name : "kjsSupportPart" )
+{
+ setInstance(kjsSupportFactory::instance());
+ setXMLFile("kdevkjssupport.rc");
+
+
+ m_build = new KAction( i18n("&Run"), "exec",Key_F9,this, SLOT(slotRun()),actionCollection(), "build_execute" );
+ m_build->setStatusText( i18n("Test the active script.") );
+
+ kdDebug() << "Creating kjssupport Part" << endl;
+
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const QString&)), this, SLOT(savedFile(const QString&)) );
+ connect(partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part *)));
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+
+
+ // Building kjs interpreter.
+ m_js = new KJSEmbed::KJSEmbedPart();
+ mainWindow()->embedOutputView( m_js->view() , i18n("KJS Console"),i18n("KJS Embed Console") );
+
+ // get the problem reporter
+ m_problemReporter = new KJSProblems( this, 0, "problems" );
+ mainWindow( )->embedOutputView( m_problemReporter, i18n("Problems"), i18n("Problem reporter"));
+ m_cc = new JSCodeCompletion();
+ }
+
+
+kjsSupportPart::~kjsSupportPart()
+{
+ delete m_problemReporter;
+ delete m_cc;
+ delete m_build;
+ delete m_js;
+}
+
+KDevLanguageSupport::Features kjsSupportPart::features()
+{
+ return Features(Classes | Variables | Functions);
+}
+
+KMimeType::List kjsSupportPart::mimeTypes()
+{
+ KMimeType::List list;
+
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-javascript" );
+ if( mime )
+ list << mime;
+
+ return list;
+}
+void kjsSupportPart::slotRun()
+{
+ // Execute the application here.
+
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( partController()->activePart() );
+ if ( ro_part )
+ {
+ m_js->runFile( ro_part->url().path() );
+ }
+
+}
+
+void kjsSupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ Q_UNUSED( dlg );
+ // Create your config dialog here.
+}
+void kjsSupportPart::projectOpened()
+{
+ kdDebug(9014) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(parse()));
+}
+void kjsSupportPart::projectClosed()
+{
+
+}
+void kjsSupportPart::savedFile(const QString &fileName)
+{
+
+
+ if (project()->allFiles().contains(fileName.mid ( project()->projectDirectory().length() + 1 )))
+ {
+ kdDebug(9014) << "parse file " << fileName << endl;
+ parse( fileName );
+ emit addedSourceInfo( fileName );
+ }
+}
+void kjsSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9014) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + ( *it ) << endl;
+ parse( project()->projectDirectory() + "/" + (*it) );
+ }
+
+ emit updatedSourceInfo();
+}
+void kjsSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ if( codeModel()->hasFile(fileName) )
+ {
+ kdDebug(9014) << "removed " << fileName << endl;
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+ }
+
+}
+void kjsSupportPart::parse()
+{
+ kdDebug(9014) << "initialParse()" << endl;
+
+ if (project())
+ {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ m_problemReporter->clear();
+
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it)
+ {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+
+ parse( project()->projectDirectory() + "/" + (*it) );
+
+ }
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug(9014) << "No project" << endl;
+ }
+}
+void kjsSupportPart::slotActivePartChanged(KParts::Part *part)
+{
+ kdDebug() << "Changeing active part..." << endl;
+ m_cc->setActiveEditorPart(part);
+}
+
+/*!
+ \fn kjsSupportPart::parse(const QString &fileName)
+ */
+void kjsSupportPart::parse(const QString &fileName)
+{
+ QFileInfo fi(fileName);
+ if (fi.extension() == "js")
+ {
+ if( codeModel()->hasFile(fileName) )
+ {
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+
+ FileDom m_file = codeModel()->create<FileModel>();
+ m_file->setName( fileName );
+ m_file->setFileName( fileName );
+
+ QFile f(QFile::encodeName(fileName));
+ if (!f.open(IO_ReadOnly))
+ return;
+ QString rawline;
+ QString line;
+ uint lineNo = 0;
+ QTextStream stream(&f);
+ int depth = 0;
+ bool inFunction = false;
+ QString lastFunction = "";
+ int lastLineNo = 0;
+ ClassDom currentClass;
+
+ QRegExp varRx("var[\\s]([_a-zA-Z\\d]+)");
+ QRegExp classVarRx("this\\.([_a-zA-Z\\d]+)");
+ QRegExp classMethRx("this\\.([_a-zA-Z\\d]+)[\\s]*=[\\s]*function(\\([^){}\\n\\r]*\\))");
+ QRegExp methRx("function[\\s]+([_a-zA-Z\\d]+[\\s]*\\([^){}\\n\\r]*\\))");
+ QRegExp allocRx("([_\\d\\w]+)[\\s]*=[\\s]*new[\\s]*([_\\d\\w]+)");
+ QRegExp assnRx("var[\\s]+([_\\d\\w]+)[\\s]+[=][\\s]+([_\\d\\w]+)[;]");
+
+ while (!stream.atEnd())
+ {
+ rawline = stream.readLine();
+ line = rawline.stripWhiteSpace().local8Bit();
+ kdDebug() << "Trying line: " << line << endl;
+
+ if (methRx.search(line) != -1 && depth == 0)
+ {
+ if (lastFunction != "" )
+ addMethod(lastFunction, m_file, lastLineNo);
+ lastFunction = methRx.cap(1);
+ lastLineNo = lineNo;
+ }
+ else if(varRx.search(line) != -1 && depth == 0)
+ {
+ addAttribute(varRx.cap(1), m_file, lineNo);
+ }
+ else if(classMethRx.search(line) != -1 && depth > 0)
+ {
+ if ( lastFunction != "" )
+ {
+ currentClass = addClass(lastFunction, m_file, lastLineNo );
+ lastFunction = "";
+ }
+ addMethod(classMethRx.cap(1)+classMethRx.cap(2), currentClass, lineNo);
+ }
+ else if(classVarRx.search(line) != -1 && depth > 0)
+ {
+ if ( lastFunction != "" )
+ {
+ currentClass = addClass(lastFunction, m_file, lastLineNo );
+ lastFunction = "";
+ }
+ addAttribute(classVarRx.cap(1), currentClass, lineNo);
+ }
+
+ if( allocRx.search(line) != -1 )
+ {
+ QString varName = allocRx.cap(1);
+ QString varType = allocRx.cap(2);
+
+ typeProperty *type = new typeProperty();
+ type->depth = depth;
+ type->name = varName;
+ type->type = varType;
+
+ m_typeMap.insert(varName, type);
+ kdDebug() << "Adding " << varName << " of type " << varType << " at scope " << depth << endl;
+
+ }
+
+
+ kdDebug() << "Syntax check..." << endl;
+ KJS::UString jsLine( line.latin1() );
+ int lineNumber = 0;
+ KJS::UString errorMessage;
+
+ if ( !m_js->interpreter()->checkSyntax( jsLine, &lineNumber, &errorMessage ) )
+ {
+ kdDebug() << errorMessage.qstring() << " on line " << lineNo << endl;
+ m_problemReporter->addLine(m_file->fileName(), lineNo, errorMessage.qstring());
+ }
+
+ if( line.contains("{") )
+ ++depth;
+
+ if( line.contains("}") )
+ --depth;
+
+ ++lineNo;
+ }
+
+ if (lastFunction != "" )
+ addMethod(lastFunction, m_file, lastLineNo);
+
+ f.close();
+
+ kdDebug() << "Trying to add list..." << endl;
+
+ codeModel()->addFile( m_file );
+
+
+ }
+}
+
+ClassDom kjsSupportPart::addClass(const QString &name, FileDom file, uint lineNo)
+{
+ ClassDom clazz = codeModel()->create<ClassModel>();
+ clazz->setName(name);
+ clazz->setFileName(file->fileName());
+ clazz->setStartPosition(lineNo, 0);
+
+ if( !file->hasClass(clazz->name()) ){
+ kdDebug() << "Add global class " << clazz->name() << endl;
+ file->addClass( clazz );
+ }
+ return clazz;
+}
+
+void kjsSupportPart::addMethod(const QString &name, ClassDom clazz, uint lineNo)
+{
+ FunctionDom method = codeModel()->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName(clazz->fileName());
+ method->setStartPosition(lineNo, 0);
+
+ if( !clazz->hasFunction(method->name()) ){
+ kdDebug() << "Add class method " << method->name() << endl;
+ clazz->addFunction( method );
+ }
+}
+
+void kjsSupportPart::addAttribute(const QString &name, ClassDom clazz, uint lineNo)
+{
+ VariableDom var = codeModel()->create<VariableModel>();
+ var->setName(name);
+ var->setFileName(clazz->fileName());
+ var->setStartPosition( lineNo, 0 );
+ var->setType(i18n("Variable"));
+
+ if( !clazz->hasVariable(var->name()) ){
+ kdDebug() << "Add class attribute " << var->name() << endl;
+ clazz->addVariable(var);
+ }
+}
+
+void kjsSupportPart::addMethod(const QString &name, FileDom file, uint lineNo)
+{
+ FunctionDom method = codeModel()->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName(file->fileName());
+ method->setStartPosition(lineNo, 0);
+
+ if( !file->hasFunction(method->name()) ){
+ kdDebug() << "Add global method " << method->name() << endl;
+ file->addFunction( method );
+ }
+}
+
+void kjsSupportPart::addAttribute(const QString &name, FileDom file, uint lineNo)
+{
+ VariableDom var = codeModel()->create<VariableModel>();
+ var->setName(name);
+ var->setFileName(file->fileName());
+ var->setStartPosition( lineNo, 0 );
+ var->setType(i18n("Variable"));
+
+ if( !file->hasVariable(var->name()) ){
+ kdDebug() << "Add global attribute " << var->name() << endl;
+ file->addVariable(var);
+ }
+}
+
+void kjsSupportPart::contextMenu(QPopupMenu * popupMenu, const Context *context)
+{
+ kdDebug() << "1" << endl;
+ if (!context->hasType( Context::FileContext ))
+ return;
+
+ kdDebug() << "2" << endl;
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+ m_selectedUI = fcontext->fileName();
+ if (m_selectedUI.right(3).lower() == ".ui")
+ int id = popupMenu->insertItem(i18n("Implement Slots"),
+ this, SLOT(implementSlots()));
+ else
+ m_selectedUI = QString::null;
+}
+
+void kjsSupportPart::implementSlots()
+{
+ if (m_selectedUI.isEmpty())
+ return;
+
+ QStringList newFiles;
+ SubclassingDlg *sub = new SubclassingDlg(this, m_selectedUI, newFiles);
+ if (sub->exec())
+ project()->addFiles(newFiles);
+
+ delete sub;
+}
+
+#include "kjssupport_part.moc"
diff --git a/languages/kjssupport/kjssupport_part.h b/languages/kjssupport/kjssupport_part.h
new file mode 100644
index 00000000..67e35f07
--- /dev/null
+++ b/languages/kjssupport/kjssupport_part.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (C) 2003 ian reinhart geiser <geiseri@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __KDEVPART_KJSSUPPORT_H__
+#define __KDEVPART_KJSSUPPORT_H__
+
+
+#include <kdevelop/kdevplugin.h>
+#include <kdevelop/codemodel.h>
+#include <kdevelop/kdevlanguagesupport.h>
+#include <kdialogbase.h>
+#include <qstringlist.h>
+#include <qdict.h>
+
+namespace KJSEmbed
+{
+class KJSEmbedPart;
+class KJSConsoleWidget;
+};
+
+class QPopupMenu;
+class KAction;
+class KJSProblems;
+class JSCodeCompletion;
+class Context;
+
+class typeProperty;
+
+
+class kjsSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+ public:
+ kjsSupportPart(QObject *parent, const char *name, const QStringList &);
+ ~kjsSupportPart();
+ protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+ private slots:
+ void slotRun();
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const QString &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void parse();
+ void slotActivePartChanged(KParts::Part *part);
+ void contextMenu(QPopupMenu *popupMenu, const Context *context);
+ void implementSlots();
+ private:
+ void parse(const QString &fileName);
+ void addAttribute(const QString &name, ClassDom clazz, uint lineNo);
+ void addMethod(const QString &name, ClassDom clazz, uint lineNo);
+ void addAttribute(const QString &name, FileDom file, uint lineNo);
+ void addMethod(const QString &name, FileDom file, uint lineNo);
+ ClassDom addClass(const QString &name, FileDom file, uint lineNo);
+ KAction *m_build;
+ KJSEmbed::KJSEmbedPart *m_js;
+ KJSProblems *m_problemReporter;
+ QDict<typeProperty> m_typeMap;
+ JSCodeCompletion *m_cc;
+
+ QString m_selectedUI;
+};
+
+
+#endif
diff --git a/languages/kjssupport/subclassing_template/Makefile.am b/languages/kjssupport/subclassing_template/Makefile.am
new file mode 100644
index 00000000..8c99d172
--- /dev/null
+++ b/languages/kjssupport/subclassing_template/Makefile.am
@@ -0,0 +1,3 @@
+kjssupportdatadir = ${kde_datadir}/kdevkjssupport
+subclassingdir = ${kjssupportdatadir}/subclassing
+subclassing_DATA = subclass_template.js
diff --git a/languages/kjssupport/subclassing_template/subclass_template.js b/languages/kjssupport/subclassing_template/subclass_template.js
new file mode 100644
index 00000000..568c5699
--- /dev/null
+++ b/languages/kjssupport/subclassing_template/subclass_template.js
@@ -0,0 +1,2 @@
+//Slot implementations and slot-signal connections for $BASEFILENAME$ form
+/*$SPECIALIZATION$*/
diff --git a/languages/kjssupport/subclassingdlg.cpp b/languages/kjssupport/subclassingdlg.cpp
new file mode 100644
index 00000000..be1ad83e
--- /dev/null
+++ b/languages/kjssupport/subclassingdlg.cpp
@@ -0,0 +1,461 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 "subclassingdlg.h"
+#include "kjssupport_part.h"
+/*#include "backgroundparser.h"
+#include "store_walker.h"
+#include "cppsupportfactory.h"*/
+#include <kdevelop/kdevsourceformatter.h>
+#include <kdevelop/kdevproject.h>
+#include <kdevelop/filetemplate.h>
+#include <kdevelop/codemodel.h>
+
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <kfiledialog.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <domutil.h>
+#include <qdom.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <kconfig.h>
+
+
+#define WIDGET_CAPTION_NAME "widget/property|name=caption/string"
+#define WIDGET_CLASS_NAME "class"
+#define WIDGET_SLOTS "slots"
+#define WIDGET_FUNCTIONS "functions"
+
+// All widgets
+#define SLOT_ACCEPT SlotItem(m_slotView,"accept()","virtual","protected","void",false,true)
+#define SLOT_REJECT SlotItem(m_slotView,"reject()","virtual","protected","void",false,true)
+
+// Wizards
+#define SLOT_BACK SlotItem(m_slotView,"back()","virtual","protected","void",false,true)
+#define SLOT_NEXT SlotItem(m_slotView,"next()","virtual","protected","void",false,true)
+#define SLOT_HELP SlotItem(m_slotView,"help()","virtual","protected","void",false,true)
+
+
+SlotItem::SlotItem(QListView *parent,const QString &methodName,
+ const QString &specifier,
+ const QString &access, const QString &returnType,
+ bool isFunc,bool callBaseClass)
+: QCheckListItem(parent,methodName,QCheckListItem::CheckBox)
+{
+ setOn(true);
+ m_methodName = methodName;
+ m_access = access.isEmpty() ? (const QString) "public" : access;
+ m_specifier = specifier.isEmpty() ? (const QString) "virtual" : specifier;
+ m_returnType = returnType.isEmpty() ? (const QString) "void" : returnType;
+ m_isFunc = isFunc;
+ m_callBaseClass = callBaseClass;
+ setText(0,m_methodName);
+ setText(1,m_access);
+ setText(2,m_specifier);
+ setText(3,m_returnType);
+ setText(4,m_isFunc ? "Function" : "Slot");
+ if (m_access=="private" ||
+ m_specifier=="non virtual")
+ {
+ setOn(false);
+ setEnabled(false);
+ }
+ if (m_specifier=="pure virtual")
+ {
+ setOn(true);
+ setEnabled(false);
+ }
+ m_alreadyInSubclass = false;
+}
+
+void SlotItem::setAllreadyInSubclass()
+{
+ setOn(true);
+ setEnabled(false);
+ m_alreadyInSubclass = true;
+}
+
+
+SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,QStringList &newFileNames,
+ QWidget* parent, const char* name,bool modal, WFlags fl)
+: SubclassingDlgBase(parent,name,modal,fl),
+m_newFileNames(newFileNames), m_kjsSupport( kjsSupport )
+//=================================================
+{
+ m_formFile = formFile;
+ readUiFile();
+ m_creatingNewSubclass = true;
+
+/* KConfig *config = kjsSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ reformatDefault_box->setChecked(config->readBoolEntry("Reformat Source", 0));
+ if (reformatDefault_box->isChecked())
+ reformat_box->setChecked(true);
+ }*/
+// m_btnOk->setEnabled(true);
+}
+
+
+/*SubclassingDlg::SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,const QString &filename,QStringList &dummy,
+ QWidget* parent, const char* name,bool modal, WFlags fl)
+: SubclassingDlgBase(parent,name,modal,fl),
+m_newFileNames(dummy), m_kjsSupport( kjsSupport )
+//=================================================
+{
+ m_formFile = formFile;
+ m_creatingNewSubclass = false;
+ m_filename = filename;
+
+ KConfig *config = kjsSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ reformatDefault_box->setChecked(config->readBoolEntry("Reformat Source", 0));
+ if (reformatDefault_box->isChecked())
+ reformat_box->setChecked(true);
+ }
+
+ QStringList pathsplit(QStringList::split('/',filename));
+
+ QString baseClass = readBaseClassName();
+ if (!kjsSupport->codeModel()->hasFile(filename+QString(".h")))
+ return;
+ ClassList myClasses = kjsSupport->codeModel()->fileByName(filename+QString(".h"))->classList();
+ for (ClassList::const_iterator classIt = myClasses.begin(); classIt != myClasses.end(); ++classIt)
+ {
+ kdDebug() << "base class " << baseClass << " class " << (*classIt)->name()
+ << " parents " << (*classIt)->baseClassList().join(",") << endl;
+ if ( (*classIt)->baseClassList().findIndex(baseClass) != -1 )
+ {
+ kdDebug() << "base class matched " << endl;
+ m_edClassName->setText((*classIt)->name());
+ m_edFileName->setText(pathsplit[pathsplit.count()-1]);
+
+ FunctionList functionList = (*classIt)->functionList();
+ for (FunctionList::const_iterator methodIt = functionList.begin();
+ methodIt != functionList.end(); ++methodIt)
+ {
+ m_parsedMethods << (*methodIt)->name() + "(";
+ }
+ }
+ }
+ readUiFile();
+ m_btnOk->setEnabled(true);
+}
+*/
+bool SubclassingDlg::alreadyInSubclass(const QString &method)
+{
+ for (uint i=0;i<m_parsedMethods.count();i++)
+ if (method.find(m_parsedMethods[i])==0)
+ return true;
+ return false;
+}
+
+void SubclassingDlg::readUiFile()
+{
+ QStringList splitPath = QStringList::split('/',m_formFile);
+ m_formName = QStringList::split('.',splitPath[splitPath.count()-1])[0]; // "somedlg.ui" = "somedlg"
+ splitPath.pop_back();
+ m_formPath = "/" + splitPath.join("/"); // join path to ui-file
+
+ m_btnOk->setEnabled(false);
+ QDomDocument doc;
+
+ DomUtil::openDOMFile(doc,m_formFile);
+ m_baseClassName = DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text();
+
+ m_baseCaption = DomUtil::elementByPathExt(doc,WIDGET_CAPTION_NAME).text();
+ setCaption(i18n("Create Subclass of ")+m_baseClassName);
+
+ // Special widget specific slots
+ SlotItem *newSlot;
+ m_qtBaseClassName = DomUtil::elementByPathExt(doc,"widget").attribute("class","QDialog");
+
+ if ( (m_qtBaseClassName=="QMainWindow") || (m_qtBaseClassName=="QWidget") )
+ m_canBeModal = false;
+ else
+ m_canBeModal = true;
+ if (m_qtBaseClassName != "QWidget")
+ {
+ newSlot = new SLOT_ACCEPT;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("accept()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+
+ newSlot = new SLOT_REJECT;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("reject()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+ }
+
+ if (m_qtBaseClassName == "QWizard")
+ {
+ newSlot = new SLOT_NEXT;
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass("next()"))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ newSlot = new SLOT_BACK;
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass("back()"))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ newSlot = new SLOT_HELP;
+ newSlot->setOn(false);
+ if (alreadyInSubclass("help()"))
+ newSlot->setAllreadyInSubclass();
+ m_slotView->insertItem(newSlot);
+ m_slots << newSlot;
+ }
+
+ QDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS);
+ QDomNodeList slotnodes = slotsElem.childNodes();
+
+ for (unsigned int i=0; i<slotnodes.count();i++)
+ {
+ QDomElement slotelem = slotnodes.item(i).toElement();
+ newSlot = new SlotItem(m_slotView,slotelem.text(),
+ slotelem.attributeNode("specifier").value(),
+ slotelem.attributeNode("access").value(),
+ slotelem.attributeNode("returnType").value(),false);
+ m_slotView->insertItem(newSlot);
+ if (alreadyInSubclass(slotelem.text()))
+ newSlot->setAllreadyInSubclass();
+ m_slots << newSlot;
+ }
+
+ QDomElement funcsElem = DomUtil::elementByPathExt(doc,WIDGET_FUNCTIONS);
+ QDomNodeList funcnodes = funcsElem.childNodes();
+ SlotItem *newFunc;
+ for (unsigned int i=0; i<funcnodes.count();i++)
+ {
+ QDomElement funcelem = funcnodes.item(i).toElement();
+ newFunc = new SlotItem(m_slotView,funcelem.text(),
+ funcelem.attributeNode("specifier").value(),
+ funcelem.attributeNode("access").value(),
+ funcelem.attributeNode("returnType").value(),true);
+ m_slotView->insertItem(newFunc);
+ if (alreadyInSubclass(funcelem.text()))
+ newFunc->setAllreadyInSubclass();
+ m_slots << newFunc;
+ }
+
+ QDomElement connElem = DomUtil::elementByPathExt(doc,"connections");
+ QDomNodeList connnodes = connElem.childNodes();
+ for (unsigned int i=0; i<connnodes.count();i++)
+ {
+ QDomElement connelem = connnodes.item(i).toElement();
+ connections += "$NEWCLASS$.connect(";
+ if (connelem.namedItem("sender").toElement().text() == m_baseClassName)
+ connections += "this";
+ else
+ connections += "$NEWCLASS$.child('" + connelem.namedItem("sender").toElement().text() + "')";
+ connections += ", '" + connelem.namedItem("signal").toElement().text() + "', ";
+ if (connelem.namedItem("receiver").toElement().text() == m_baseClassName)
+ connections += "this";
+ else
+ connections += "$NEWCLASS$.child('" + connelem.namedItem("receiver").toElement().text() + "')";
+ connections += ", '" + connelem.namedItem("slot").toElement().text().remove("()") + "');\n";
+ }
+}
+
+SubclassingDlg::~SubclassingDlg()
+//===============================
+{
+}
+
+
+void SubclassingDlg::updateDlg()
+//==============================
+{
+}
+
+void SubclassingDlg::replace(QString &string, const QString& search, const QString& replace)
+//==========================================================================================
+{
+ int nextPos = string.find(search);
+ unsigned int searchLength = search.length();
+ while (nextPos>-1)
+ {
+ string = string.replace(nextPos,searchLength,replace);
+ nextPos = string.find(search,nextPos+replace.length());
+ }
+}
+
+bool SubclassingDlg::loadBuffer(QString &buffer, const QString& filename)
+//======================================================================
+{
+ // open file and buffer it
+ QFile dataFile(filename);
+ if (!dataFile.open(IO_ReadOnly))
+ return false;
+ char *temp = new char[dataFile.size()+1];
+ dataFile.readBlock(temp,dataFile.size());
+ temp[dataFile.size()]='\0';
+ buffer = temp;
+ delete [] temp;
+ dataFile.close();
+ return true;
+}
+
+bool SubclassingDlg::replaceKeywords(QString &buffer,bool canBeModal)
+//===================================================================
+{
+ replace(buffer,"$NEWFILENAMEUC$",m_edFileName->text().upper());
+ replace(buffer,"$BASEFILENAMELC$",m_formName.lower());
+ replace(buffer,"$BASEFILENAME$",m_formName);
+ replace(buffer,"$NEWCLASS$",m_edClassName->text());
+ replace(buffer,"$BASECLASS$",m_baseClassName);
+ replace(buffer,"$NEWFILENAMELC$",m_edFileName->text().lower());
+ if (canBeModal)
+ {
+ replace(buffer,"$CAN_BE_MODAL_H$",", bool modal = FALSE");
+ replace(buffer,"$CAN_BE_MODAL_CPP1$",", bool modal");
+ replace(buffer,"$CAN_BE_MODAL_CPP2$",", modal");
+ }
+ else
+ {
+ replace(buffer,"$CAN_BE_MODAL_H$","");
+ replace(buffer,"$CAN_BE_MODAL_CPP1$","");
+ replace(buffer,"$CAN_BE_MODAL_CPP2$","");
+ }
+
+ return true;
+}
+
+bool SubclassingDlg::saveBuffer(QString &buffer, const QString& filename)
+//=======================================================================
+{
+ // save buffer
+
+ QFile dataFile(filename);
+ if (!dataFile.open(IO_WriteOnly | IO_Truncate))
+ return false;
+ dataFile.writeBlock((buffer+"\n").ascii(),(buffer+"\n").length());
+ dataFile.close();
+ return true;
+}
+
+
+void SubclassingDlg::accept()
+//===========================
+{
+/* KConfig *config = kjsSupportFactory::instance()->config();
+ if (config)
+ {
+ config->setGroup("Subclassing");
+ config->writeEntry("Reformat Source", reformatDefault_box->isChecked());
+ }*/
+
+ unsigned int i;
+
+ // h - file
+
+ QString public_slot =
+ "/*$PUBLIC_SLOTS$*/\n ";
+
+ QString protected_slot =
+ "/*$PROTECTED_SLOTS$*/\n ";
+
+ QString public_func =
+ "/*$PUBLIC_FUNCTIONS$*/\n ";
+
+ QString protected_func =
+ "/*$PROTECTED_FUNCTIONS$*/\n ";
+
+ QString buffer;
+ if (m_creatingNewSubclass)
+ {
+ loadBuffer(buffer,::locate("data", "kdevkjssupport/subclassing/subclass_template.js"));
+ kdDebug() << "buffer: " << buffer << endl;
+ buffer = "var $NEWCLASS$ = Factory.loadui(\"$BASEFILENAME$.ui\", this);\n\n" + buffer;
+ buffer = FileTemplate::read(m_kjsSupport, "js") + buffer + connections;
+ kdDebug() << "buffer: " << buffer << endl;
+ QFileInfo fi(m_filename + ".js");
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName(true);
+ buffer.replace(QRegExp("\\$MODULE\\$"),module);
+ buffer.replace(QRegExp("\\$FILENAME\\$"),basefilename);
+ }
+ else
+ loadBuffer(buffer,m_filename+".js");
+
+ // js - file
+
+ QString implementation =
+ "/*$SPECIALIZATION$*/\n"
+ "function $METHOD$\n"
+ "{\n"
+ "}\n";
+
+ replaceKeywords(buffer,m_canBeModal);
+ for (i=0; i<m_slots.count(); i++)
+ {
+ SlotItem *slitem = m_slots[i];
+ if (!slitem->isOn() ||
+ slitem->m_alreadyInSubclass)
+ continue;
+ QString impl = implementation;
+ replace(impl,"$RETURNTYPE$",slitem->m_returnType);
+ replace(impl,"$NEWCLASS$",m_edClassName->text());
+ replace(impl,"$METHOD$", slitem->m_methodName);
+ replace(impl,"$QTBASECLASS$", m_qtBaseClassName);
+ replace(buffer,"/*$SPECIALIZATION$*/",impl);
+ }
+ kdDebug() << buffer << endl;
+
+ if (reformat_box->isChecked())
+ buffer = m_kjsSupport->sourceFormatter()->formatSource(buffer);
+
+ if (m_creatingNewSubclass)
+ saveBuffer(buffer,m_formPath + "/" + m_edFileName->text()+".js");
+ else
+ saveBuffer(buffer,m_filename+".js");
+
+ if (m_creatingNewSubclass)
+ {
+ m_newFileNames.append(m_formPath + "/" + m_edFileName->text()+".js");
+ }
+ SubclassingDlgBase::accept();
+}
+
+void SubclassingDlg::onChangedClassName()
+//=======================================
+{
+ m_edFileName->setText(m_edClassName->text().lower());
+ if (m_edFileName->text().isEmpty() ||
+ m_edClassName->text().isEmpty())
+ m_btnOk->setEnabled(false);
+ else
+ m_btnOk->setEnabled(true);
+}
+
+QString SubclassingDlg::readBaseClassName( )
+{
+ QDomDocument doc;
+ DomUtil::openDOMFile(doc,m_formFile);
+ return DomUtil::elementByPathExt(doc,WIDGET_CLASS_NAME).text();
+}
diff --git a/languages/kjssupport/subclassingdlg.h b/languages/kjssupport/subclassingdlg.h
new file mode 100644
index 00000000..c727b648
--- /dev/null
+++ b/languages/kjssupport/subclassingdlg.h
@@ -0,0 +1,85 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * *
+ * 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 SUBCLASSINGDLG_H
+#define SUBCLASSINGDLG_H
+
+#include <qlistview.h>
+
+#include "subclassingdlgbase.h"
+
+class QStringList;
+class QDomDocument;
+class kjsSupportPart;
+
+class SlotItem : public QCheckListItem
+{
+ public:
+ SlotItem(QListView *parent,const QString &text,
+ const QString &specifier, const QString &Access,
+ const QString &returnType,bool isFunc,
+ bool callBaseClass=false);
+ void setAllreadyInSubclass();
+ QString m_access;
+ QString m_methodName;
+ QString m_returnType;
+ QString m_specifier;
+ bool m_isFunc;
+ bool m_callBaseClass;
+ bool m_alreadyInSubclass;
+};
+
+
+class SubclassingDlg : public SubclassingDlgBase
+{
+public:
+ SubclassingDlg(kjsSupportPart* kjsSupport, const QString &formFile,QStringList &newFileNames,
+ QWidget* parent = 0, const char* name = 0,
+ bool modal = FALSE, WFlags fl = 0 );
+/* SubclassingDlg(CppSupportPart* kjsSupport, const QString &formFile,const QString &filename,QStringList &dummy,
+ QWidget* parent = 0, const char* name = 0,
+ bool modal = FALSE, WFlags fl = 0 );*/
+ ~SubclassingDlg();
+
+private:
+ void readUiFile();
+ QString readBaseClassName();
+ void updateDlg();
+ bool replaceKeywords(QString &buffer, bool canBeModal=true);
+ void replace(QString &string, const QString& search, const QString& replace);
+ bool saveBuffer(QString &buffer, const QString& filename);
+ bool loadBuffer(QString &buffer, const QString& filename);
+ bool alreadyInSubclass(const QString &method);
+ bool m_creatingNewSubclass;
+
+public slots:
+ virtual void accept();
+ virtual void onChangedClassName();
+
+protected:
+ QStringList &m_newFileNames;
+ QString m_filename;
+ QString m_formFile;
+ QString m_baseClassName;
+ QString m_qtBaseClassName;
+ QString m_baseCaption;
+ QString m_formName;
+ QString m_formPath;
+ QStringList m_parsedMethods;
+ bool m_canBeModal;
+ QValueList<SlotItem*> m_slots;
+ QValueList<SlotItem*> m_functions;
+ kjsSupportPart* m_kjsSupport;
+ QString connections;
+};
+
+#endif
+
diff --git a/languages/kjssupport/subclassingdlgbase.ui b/languages/kjssupport/subclassingdlgbase.ui
new file mode 100644
index 00000000..fea5ef6d
--- /dev/null
+++ b/languages/kjssupport/subclassingdlgbase.ui
@@ -0,0 +1,253 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SubclassingDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SubclassingDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>588</width>
+ <height>493</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Implement Slots</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>reformat_box</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;format source</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="2">
+ <property name="name">
+ <cstring>reformatDefault_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Reformat source by &amp;default</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="3" column="0" rowspan="1" colspan="3">
+ <column>
+ <property name="text">
+ <string>Method</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Access</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Specifier</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Return Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_slotView</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Specialize following slots:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_slotView</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_edFileName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>F&amp;ile name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_edFileName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>C&amp;lass name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_edClassName</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_edClassName</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_btnOk</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;reate</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>m_btnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <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>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_btnOk</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_btnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_edClassName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>SubclassingDlgBase</receiver>
+ <slot>onChangedClassName()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_edClassName</tabstop>
+ <tabstop>m_edFileName</tabstop>
+ <tabstop>m_slotView</tabstop>
+ <tabstop>reformat_box</tabstop>
+ <tabstop>reformatDefault_box</tabstop>
+ <tabstop>m_btnOk</tabstop>
+ <tabstop>m_btnCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>onChangedClassName()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/kjssupport/template/Makefile.am b/languages/kjssupport/template/Makefile.am
new file mode 100644
index 00000000..3244188a
--- /dev/null
+++ b/languages/kjssupport/template/Makefile.am
@@ -0,0 +1,20 @@
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+commondatadir = ${appwizarddatadir}/template-common
+jshellodir = ${appwizarddatadir}/template-jshello
+templatedir = ${appwizarddatadir}/templates
+
+jshello_DATA = app.js app.kdevelop
+template_DATA = jshello
+
+DISTCLEANFILES = script.local
+EXTRA_DIST = script
+
+perl = perl
+
+script.local: ${srcdir}/script
+ cp ${srcdir}/script script.local ; \
+ perl -npi -e 's%^#\!.*$$%#!'${perl}' -I'${commondatadir}'%g;' script.local
+
+install-data-local: script.local
+ $(mkinstalldirs) $(DESTDIR)$(jshellodir)
+ $(INSTALL_DATA) script.local $(DESTDIR)$(jshellodir)/script
diff --git a/languages/kjssupport/template/app.js b/languages/kjssupport/template/app.js
new file mode 100644
index 00000000..aa564dd6
--- /dev/null
+++ b/languages/kjssupport/template/app.js
@@ -0,0 +1,18 @@
+#!/usr/bin/env kjscmd
+
+// Create main view
+var mw = new KMainWindow();
+var lv = new KListView( mw );
+mw.setCentralWidget(lv);
+
+lv.addColumn('One');
+lv.addColumn('Two');
+lv.addColumn('Three');
+
+lv.insertItem( 'Something', "Nothing", "Thing" );
+lv.insertItem( 'Something', "Nothing", "Thing" );
+lv.insertItem( 'Something', "Nothing", "Thing" );
+lv.insertItem( 'Something', "Nothing", "Thing" );
+
+mw.show();
+
diff --git a/languages/kjssupport/template/app.kdevelop b/languages/kjssupport/template/app.kdevelop
new file mode 100644
index 00000000..2bb39a0a
--- /dev/null
+++ b/languages/kjssupport/template/app.kdevelop
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>$AUTHOR$</author>
+ <email>$EMAIL$</email>
+ <version>$VERSION$</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Javascript</primarylanguage>
+ <keywords>
+ <keyword>Javascript</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevFileView</part>
+ <part>KDevdistpart</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir>src</activedir>
+ <includepatterns>*.js</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.js" name="Scripts" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>kde</toc>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>perl</toc>
+ <toc>php</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="js"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/kjssupport/template/jshello b/languages/kjssupport/template/jshello
new file mode 100644
index 00000000..8013b033
--- /dev/null
+++ b/languages/kjssupport/template/jshello
@@ -0,0 +1,6 @@
+# KDE Config File
+[General]
+Name=Simple KJSEmbed Script
+Category=Script
+Comment=This generates a simplistic 'Hello world' program in KJSEmbed
+FileTemplates=js,Javascript
diff --git a/languages/kjssupport/template/script b/languages/kjssupport/template/script
new file mode 100644
index 00000000..d3a808c5
--- /dev/null
+++ b/languages/kjssupport/template/script
@@ -0,0 +1,13 @@
+#!perl -I/usr/kde/3.1/share/apps/kdevappwizard/template-common
+
+use gideon;
+
+initGideon();
+
+print "Installing project file\n";
+installHTML( "${src}/template-jshello/app.kdevelop", "${dest}/${APPNAMELC}.kdevelop" );
+
+print "Installing application sources\n";
+install( "${src}/template-jshello/app.js", "${dest}/${APPNAMELC}.js" );
+
+print "Finished\n";
diff --git a/languages/kjssupport/x-javascript-source.desktop b/languages/kjssupport/x-javascript-source.desktop
new file mode 100644
index 00000000..5beeb52a
--- /dev/null
+++ b/languages/kjssupport/x-javascript-source.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+MimeType=dummy
+Hidden=true
+
diff --git a/languages/lib/Makefile.am b/languages/lib/Makefile.am
new file mode 100644
index 00000000..2bb7ebfa
--- /dev/null
+++ b/languages/lib/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES =
+METASOURCES = AUTO
+SUBDIRS = interfaces debugger designer_integration
+
+DOXYGEN_EMPTY = YES
+include ../../Doxyfile.am
diff --git a/languages/lib/debugger/Mainpage.dox b/languages/lib/debugger/Mainpage.dox
new file mode 100644
index 00000000..2e141fd3
--- /dev/null
+++ b/languages/lib/debugger/Mainpage.dox
@@ -0,0 +1,36 @@
+/**
+@mainpage The KDevelop %Debugger Support Library
+
+This library contains classes to implement debugger support for a programming language.
+
+<b>Link with</b>: -llang_debugger
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/languages/debugger
+
+\section usingdebugger Where to use this library
+
+Each debugger support plugin must interact with an editor to set breakpoints,
+jump to execution points, etc. This kind of interaction is implemented in
+@ref Debugger class. Your debugger support plugin just need to create
+an instance of @ref Debugger class and connect its signals, for example:
+@code
+m_debugger = new Debugger( partController() );
+
+connect( m_debugger, SIGNAL(toggledBreakpoint(const QString &, int)),
+ debuggerBreakpointWidget, SLOT(slotToggleBreakpoint(const QString &, int)) );
+connect( m_debugger, SIGNAL(editedBreakpoint(const QString &, int)),
+ debuggerBreakpointWidget, SLOT(slotEditBreakpoint(const QString &, int)) );
+connect( m_debugger, SIGNAL(toggledBreakpointEnabled(const QString &, int)),
+ debuggerBreakpointWidget, SLOT(slotToggleBreakpointEnabled(const QString &, int)) );
+@endcode
+Then m_debugger instance can be used for example, to jump to the execution point:
+@code
+m_debugger->gotoExecutionPoint(fileUrl, lineNumber);
+@endcode
+or to set a breakpoint:
+@code
+m_debugger->setBreakpoint(fileName, lineNumber, id, enabled, pending);
+@endcode
+
+*/
+
diff --git a/languages/lib/debugger/Makefile.am b/languages/lib/debugger/Makefile.am
new file mode 100644
index 00000000..cdeee852
--- /dev/null
+++ b/languages/lib/debugger/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+lib_LTLIBRARIES = liblang_debugger.la
+liblang_debugger_la_LDFLAGS = $(all_libraries)
+liblang_debugger_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KPARTS) -lktexteditor
+liblang_debugger_la_SOURCES = kdevdebugger.cpp debugger.cpp
+langincludedirdir = $(includedir)/kdevelop/languages/debugger
+langincludedir_HEADERS = debugger.h kdevdebugger.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces kdevutil
+DOXYGEN_PROJECTNAME = KDevelop Debugger Support Library
+DOXYGEN_DOCDIRPREFIX = kdevlang
+include ../../../Doxyfile.am
diff --git a/languages/lib/debugger/debugger.cpp b/languages/lib/debugger/debugger.cpp
new file mode 100644
index 00000000..92765efe
--- /dev/null
+++ b/languages/lib/debugger/debugger.cpp
@@ -0,0 +1,209 @@
+
+#include "debugger.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <ktexteditor/document.h>
+
+// #include "editorproxy.h"
+#include <kdevpartcontroller.h>
+
+
+using namespace KTextEditor;
+
+Debugger *Debugger::s_instance = 0;
+
+Debugger::Debugger(KDevPartController *partController)
+ :m_partController(partController)
+{
+ connect( m_partController, SIGNAL(partAdded(KParts::Part*)),
+ this, SLOT(partAdded(KParts::Part*)) );
+}
+
+
+Debugger::~Debugger()
+{}
+
+
+// Debugger *Debugger::getInstance()
+// {
+// if (!s_instance)
+// s_instance = new Debugger;
+//
+// return s_instance;
+// }
+
+
+void Debugger::setBreakpoint(const QString &fileName, int lineNum, int id, bool enabled, bool pending)
+{
+ KParts::Part *part = m_partController->partForURL(KURL(fileName));
+ if( !part )
+ return;
+
+ MarkInterface *iface = dynamic_cast<MarkInterface*>(part);
+ if (!iface)
+ return;
+
+ // Temporarily disconnect so we don't get confused by receiving extra
+ // marksChanged signals
+ disconnect( part, SIGNAL(marksChanged()), this, SLOT(marksChanged()) );
+ iface->removeMark( lineNum, Breakpoint | ActiveBreakpoint | ReachedBreakpoint | DisabledBreakpoint );
+
+ BPItem bpItem(fileName, lineNum);
+ QValueList<BPItem>::Iterator it = BPList.find(bpItem);
+ if (it != BPList.end())
+ {
+// kdDebug(9012) << "Removing BP=" << fileName << ":" << lineNum << endl;
+ BPList.remove(it);
+ }
+
+ // An id of -1 means this breakpoint should be hidden from the user.
+ // I believe this functionality is not used presently.
+ if( id != -1 )
+ {
+ uint markType = Breakpoint;
+ if( !pending )
+ markType |= ActiveBreakpoint;
+ if( !enabled )
+ markType |= DisabledBreakpoint;
+ iface->addMark( lineNum, markType );
+// kdDebug(9012) << "Appending BP=" << fileName << ":" << lineNum << endl;
+ BPList.append(BPItem(fileName, lineNum));
+ }
+
+ connect( part, SIGNAL(marksChanged()), this, SLOT(marksChanged()) );
+}
+
+
+void Debugger::clearExecutionPoint()
+{
+ QPtrListIterator<KParts::Part> it(*m_partController->parts());
+ for ( ; it.current(); ++it)
+ {
+ MarkInterface *iface = dynamic_cast<MarkInterface*>(it.current());
+ if (!iface)
+ continue;
+
+ QPtrList<Mark> list = iface->marks();
+ QPtrListIterator<Mark> markIt(list);
+ for( ; markIt.current(); ++markIt )
+ {
+ Mark* mark = markIt.current();
+ if( mark->type & ExecutionPoint )
+ iface->removeMark( mark->line, ExecutionPoint );
+ }
+ }
+}
+
+
+void Debugger::gotoExecutionPoint(const KURL &url, int lineNum)
+{
+ clearExecutionPoint();
+
+ m_partController->editDocument(url, lineNum);
+
+ KParts::Part *part = m_partController->partForURL(url);
+ if( !part )
+ return;
+ MarkInterface *iface = dynamic_cast<MarkInterface*>(part);
+ if( !iface )
+ return;
+
+ iface->addMark( lineNum, ExecutionPoint );
+}
+
+void Debugger::marksChanged()
+{
+ if(sender()->inherits("KTextEditor::Document") )
+ {
+ KTextEditor::Document* doc = (KTextEditor::Document*) sender();
+ MarkInterface* iface = KTextEditor::markInterface( doc );
+
+ if (iface)
+ {
+ if( !m_partController->partForURL( doc->url() ) )
+ return; // Probably means the document is being closed.
+
+ KTextEditor::Mark *m;
+ QValueList<BPItem> oldBPList = BPList;
+ QPtrList<KTextEditor::Mark> newMarks = iface->marks();
+
+ // Compare the oldBPlist to the new list from the editor.
+ //
+ // If we don't have some of the old breakpoints in the new list
+ // then they have been moved by the user adding or removing source
+ // code. Remove these old breakpoints
+ //
+ // If we _can_ find these old breakpoints in the newlist then
+ // nothing has happened to them. We can just ignore these and to
+ // do that we must remove them from the new list.
+
+ bool bpchanged = false;
+
+ for (uint i = 0; i < oldBPList.count(); i++)
+ {
+ if (oldBPList[i].fileName() != doc->url().path())
+ continue;
+
+ bool found=false;
+ for (uint newIdx=0; newIdx < newMarks.count(); newIdx++)
+ {
+ m = newMarks.at(newIdx);
+ if ((m->type & Breakpoint) &&
+ m->line == oldBPList[i].lineNum() &&
+ doc->url().path() == oldBPList[i].fileName())
+ {
+ newMarks.remove(newIdx);
+ found=true;
+ break;
+ }
+ }
+
+ if (!found)
+ {
+ emit toggledBreakpoint( doc->url().path(), oldBPList[i].lineNum() );
+ bpchanged = true;
+ }
+ }
+
+ // Any breakpoints left in the new list are the _new_ position of
+ // the moved breakpoints. So add these as new breakpoints via
+ // toggling them.
+ for (uint i = 0; i < newMarks.count(); i++)
+ {
+ m = newMarks.at(i);
+ if (m->type & Breakpoint)
+ {
+ emit toggledBreakpoint( doc->url().path(), m->line );
+ bpchanged = true;
+ }
+ }
+
+ if ( bpchanged && m_partController->activePart() == doc )
+ {
+ //bring focus back to the editor
+ m_partController->activatePart( doc );
+ }
+ }
+ }
+}
+
+
+void Debugger::partAdded( KParts::Part* part )
+{
+ MarkInterfaceExtension *iface = dynamic_cast<MarkInterfaceExtension*>(part);
+ if( !iface )
+ return;
+
+ iface->setDescription((MarkInterface::MarkTypes)Breakpoint, i18n("Breakpoint"));
+ iface->setPixmap((MarkInterface::MarkTypes)Breakpoint, *inactiveBreakpointPixmap());
+ iface->setPixmap((MarkInterface::MarkTypes)ActiveBreakpoint, *activeBreakpointPixmap());
+ iface->setPixmap((MarkInterface::MarkTypes)ReachedBreakpoint, *reachedBreakpointPixmap());
+ iface->setPixmap((MarkInterface::MarkTypes)DisabledBreakpoint, *disabledBreakpointPixmap());
+ iface->setPixmap((MarkInterface::MarkTypes)ExecutionPoint, *executionPointPixmap());
+ iface->setMarksUserChangable( Bookmark | Breakpoint );
+
+ connect( part, SIGNAL(marksChanged()), this, SLOT(marksChanged()) );
+}
+
+#include "debugger.moc"
diff --git a/languages/lib/debugger/debugger.h b/languages/lib/debugger/debugger.h
new file mode 100644
index 00000000..ed545f28
--- /dev/null
+++ b/languages/lib/debugger/debugger.h
@@ -0,0 +1,132 @@
+#ifndef __DEBUGGER_H__
+#define __DEBUGGER_H__
+
+#include <qvaluelist.h>
+
+#include "kdevdebugger.h"
+
+#include <kparts/part.h>
+#include <ktexteditor/markinterface.h>
+
+#include <kdeversion.h>
+#include <ktexteditor/markinterfaceextension.h>
+
+class KDevPartController;
+
+/**
+* Describes a single breakpoint in the system
+*
+* This is used so that we can track the breakpoints and move them appropriately
+* as the user adds or removes lines of code before breakpoints.
+*/
+
+class BPItem
+{
+public:
+ /**
+ * default ctor - required from QValueList
+ */
+ BPItem() : m_fileName(""), m_lineNum(0)
+ {}
+
+ BPItem( const QString& fileName, const uint lineNum)
+ : m_fileName(fileName),
+ m_lineNum(lineNum)
+ {}
+
+ uint lineNum() const { return m_lineNum; }
+ QString fileName() const { return m_fileName; }
+
+ bool operator==( const BPItem& rhs ) const
+ {
+ return (m_fileName == rhs.m_fileName
+ && m_lineNum == rhs.m_lineNum);
+ }
+
+private:
+ QString m_fileName;
+ uint m_lineNum;
+};
+
+
+/**
+* Handles signals from the editor that relate to breakpoints and the execution
+* point of the debugger.
+* We may change, add or remove breakpoints in this class.
+*/
+class Debugger : public KDevDebugger
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ */
+// static Debugger *getInstance();
+
+ /**
+ * Controls the breakpoint icon being displayed in the editor through the
+ * markinterface
+ *
+ * @param fileName The breakpoint is added or removed from this file
+ * @param lineNum ... at this line number
+ * @param id This is an internal id. which has a special number
+ * that prevents us changing the mark icon. (why?)
+ * @param enabled The breakpoint could be enabled, disabled
+ * @param pending pending or active. Each state has a different icon.
+ */
+ void setBreakpoint(const QString &fileName, int lineNum,
+ int id, bool enabled, bool pending);
+
+ /**
+ * Displays an icon in the file at the line that the debugger has stoped
+ * at.
+ * @param url The file the debugger has stopped at.
+ * @param lineNum The line number to display. Note: We may not know it.
+ */
+ void gotoExecutionPoint(const KURL &url, int lineNum=-1);
+
+ /**
+ * Remove the executution point being displayed.
+ */
+ void clearExecutionPoint();
+
+// protected:
+
+ Debugger(KDevPartController *partController);
+ ~Debugger();
+
+private slots:
+
+ /**
+ * Whenever a new part is added this slot gets triggered and we then
+ * look for a MarkInterfaceExtension part. When it is a
+ * MarkInterfaceExtension part we set the various pixmaps of the
+ * breakpoint icons.
+ */
+ void partAdded( KParts::Part* part );
+
+ /**
+ * Called by the TextEditor interface when the marks have changed position
+ * because the user has added or removed source.
+ * In here we figure out if we need to reset the breakpoints due to
+ * these source changes.
+ */
+ void marksChanged();
+
+private:
+ enum MarkType {
+ Bookmark = KTextEditor::MarkInterface::markType01,
+ Breakpoint = KTextEditor::MarkInterface::markType02,
+ ActiveBreakpoint = KTextEditor::MarkInterface::markType03,
+ ReachedBreakpoint = KTextEditor::MarkInterface::markType04,
+ DisabledBreakpoint = KTextEditor::MarkInterface::markType05,
+ ExecutionPoint = KTextEditor::MarkInterface::markType06
+ };
+
+ static Debugger *s_instance;
+ KDevPartController *m_partController;
+ QValueList<BPItem> BPList;
+};
+
+#endif
diff --git a/languages/lib/debugger/kdevdebugger.cpp b/languages/lib/debugger/kdevdebugger.cpp
new file mode 100644
index 00000000..01b4d4f7
--- /dev/null
+++ b/languages/lib/debugger/kdevdebugger.cpp
@@ -0,0 +1,182 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevdebugger.h"
+
+KDevDebugger::KDevDebugger(QObject *parent, const char *name)
+ : QObject(parent, name)
+{
+}
+
+
+KDevDebugger::~KDevDebugger()
+{
+}
+
+const QPixmap* KDevDebugger::inactiveBreakpointPixmap()
+{
+ const char*breakpoint_gr_xpm[]={
+ "11 16 6 1",
+ "c c #c6c6c6",
+ "d c #2c2c2c",
+ "# c #000000",
+ ". c None",
+ "a c #ffffff",
+ "b c #555555",
+ "...........",
+ "...........",
+ "...#####...",
+ "..#aaaaa#..",
+ ".#abbbbbb#.",
+ "#abbbbbbbb#",
+ "#abcacacbd#",
+ "#abbbbbbbb#",
+ "#abcacacbd#",
+ "#abbbbbbbb#",
+ ".#bbbbbbb#.",
+ "..#bdbdb#..",
+ "...#####...",
+ "...........",
+ "...........",
+ "..........."};
+ static QPixmap pixmap( breakpoint_gr_xpm );
+ return &pixmap;
+}
+
+const QPixmap* KDevDebugger::activeBreakpointPixmap()
+{
+ const char* breakpoint_xpm[]={
+ "11 16 6 1",
+ "c c #c6c6c6",
+ ". c None",
+ "# c #000000",
+ "d c #840000",
+ "a c #ffffff",
+ "b c #ff0000",
+ "...........",
+ "...........",
+ "...#####...",
+ "..#aaaaa#..",
+ ".#abbbbbb#.",
+ "#abbbbbbbb#",
+ "#abcacacbd#",
+ "#abbbbbbbb#",
+ "#abcacacbd#",
+ "#abbbbbbbb#",
+ ".#bbbbbbb#.",
+ "..#bdbdb#..",
+ "...#####...",
+ "...........",
+ "...........",
+ "..........."};
+ static QPixmap pixmap( breakpoint_xpm );
+ return &pixmap;
+}
+
+const QPixmap* KDevDebugger::reachedBreakpointPixmap()
+{
+ const char*breakpoint_bl_xpm[]={
+ "11 16 7 1",
+ "a c #c0c0ff",
+ "# c #000000",
+ "c c #0000c0",
+ "e c #0000ff",
+ "b c #dcdcdc",
+ "d c #ffffff",
+ ". c None",
+ "...........",
+ "...........",
+ "...#####...",
+ "..#ababa#..",
+ ".#bcccccc#.",
+ "#acccccccc#",
+ "#bcadadace#",
+ "#acccccccc#",
+ "#bcadadace#",
+ "#acccccccc#",
+ ".#ccccccc#.",
+ "..#cecec#..",
+ "...#####...",
+ "...........",
+ "...........",
+ "..........."};
+ static QPixmap pixmap( breakpoint_bl_xpm );
+ return &pixmap;
+}
+
+const QPixmap* KDevDebugger::disabledBreakpointPixmap()
+{
+ const char*breakpoint_wh_xpm[]={
+ "11 16 7 1",
+ "a c #c0c0ff",
+ "# c #000000",
+ "c c #0000c0",
+ "e c #0000ff",
+ "b c #dcdcdc",
+ "d c #ffffff",
+ ". c None",
+ "...........",
+ "...........",
+ "...#####...",
+ "..#ddddd#..",
+ ".#ddddddd#.",
+ "#ddddddddd#",
+ "#ddddddddd#",
+ "#ddddddddd#",
+ "#ddddddddd#",
+ "#ddddddddd#",
+ ".#ddddddd#.",
+ "..#ddddd#..",
+ "...#####...",
+ "...........",
+ "...........",
+ "..........."};
+ static QPixmap pixmap( breakpoint_wh_xpm );
+ return &pixmap;
+}
+
+const QPixmap* KDevDebugger::executionPointPixmap()
+{
+ const char*exec_xpm[]={
+ "11 16 4 1",
+ "a c #00ff00",
+ "b c #000000",
+ ". c None",
+ "# c #00c000",
+ "...........",
+ "...........",
+ "...........",
+ "#a.........",
+ "#aaa.......",
+ "#aaaaa.....",
+ "#aaaaaaa...",
+ "#aaaaaaaaa.",
+ "#aaaaaaa#b.",
+ "#aaaaa#b...",
+ "#aaa#b.....",
+ "#a#b.......",
+ "#b.........",
+ "...........",
+ "...........",
+ "..........."};
+ static QPixmap pixmap( exec_xpm );
+ return &pixmap;
+}
+
+#include "kdevdebugger.moc"
diff --git a/languages/lib/debugger/kdevdebugger.h b/languages/lib/debugger/kdevdebugger.h
new file mode 100644
index 00000000..24bd2c7b
--- /dev/null
+++ b/languages/lib/debugger/kdevdebugger.h
@@ -0,0 +1,88 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef _KDEVDEBUGGER_H_
+#define _KDEVDEBUGGER_H_
+
+
+#include <qobject.h>
+#include <qpixmap.h>
+
+
+#include <kurl.h>
+
+/**
+* Base class to handle signals from the editor that relate to breakpoints
+* and the execution point of the debugger.
+*/
+class KDevDebugger : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ KDevDebugger(QObject *parent=0, const char *name=0);
+ ~KDevDebugger();
+
+ /**
+ * Sets a breakpoint in the editor document belong to fileName.
+ * If id==-1, the breakpoint is deleted.
+ */
+ virtual void setBreakpoint(const QString &fileName, int lineNum,
+ int id, bool enabled, bool pending) = 0;
+
+ /**
+ * Goes to a given location in a source file and marks the line.
+ * This is used by the debugger to mark the location where the
+ * the debugger has stopped.
+ */
+ virtual void gotoExecutionPoint(const KURL &url, int lineNum=0) = 0;
+
+ /**
+ * Clear the execution point. Usefull if debugging has ended.
+ */
+ virtual void clearExecutionPoint() = 0;
+
+ static const QPixmap* inactiveBreakpointPixmap();
+ static const QPixmap* activeBreakpointPixmap();
+ static const QPixmap* reachedBreakpointPixmap();
+ static const QPixmap* disabledBreakpointPixmap();
+ static const QPixmap* executionPointPixmap();
+
+signals:
+
+ /**
+ * The user has toggled a breakpoint.
+ */
+ void toggledBreakpoint(const QString &fileName, int lineNum);
+
+ /*
+ * The user wants to edit the properties of a breakpoint.
+ */
+ void editedBreakpoint(const QString &fileName, int lineNum);
+
+ /**
+ * The user wants to enable/disable a breakpoint.
+ */
+ void toggledBreakpointEnabled(const QString &fileName, int lineNum);
+
+};
+
+
+#endif
diff --git a/languages/lib/designer_integration/Mainpage.dox b/languages/lib/designer_integration/Mainpage.dox
new file mode 100644
index 00000000..1f2db949
--- /dev/null
+++ b/languages/lib/designer_integration/Mainpage.dox
@@ -0,0 +1,48 @@
+/**
+@mainpage The KDevelop Designer Integration Support Library
+
+This library contains base classes to implement GUI designer integration in language support plugins.
+
+<b>Link with</b>: -ldesignerintegration
+
+<b>Include path</b>: -I\$(kde_includes)/languages/designer_integration
+
+\section usingintegration Using designer integration support library
+Each language support which wants to use integrated designer, must reimplement
+@code
+virtual KDevDesignerIntegration *KDevLanguageSupport::designer(KInterfaceDesigner::DesignerType type)
+@endcode
+method and return designer integration object (@ref KDevLanguageSupport base class returns 0).
+
+Qt designer integration can be easily implemented by reusing @ref QtDesignerIntegration
+base class.
+
+For example, designer method of a language support could look like:
+@code
+KDevDesignerIntegration * MyLanguageSupportPart::designer(KInterfaceDesigner::DesignerType type)
+{
+ KDevDesignerIntegration *des = 0;
+ switch (type)
+ {
+ case KInterfaceDesigner::QtDesigner:
+ des = m_designers[type];
+ if (des == 0)
+ {
+ MyLanguageImplementationWidget *impl = new MyLanguageImplementationWidget(this);
+ des = new MyLanguageQtDesignerIntegration(this, impl);
+ m_designers[type] = des;
+ }
+ break;
+ }
+ return des;
+}
+return des;
+@endcode
+In the code above m_designers is a designer cache declared as:
+@code
+QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*> m_designers;
+@endcode
+MyLanguageImplementationWidget and MyLanguageQtDesignerIntegration classes are subclasses
+of @ref QtDesignerIntegration and @ref ImplementationWidget base classes.
+*/
+
diff --git a/languages/lib/designer_integration/Makefile.am b/languages/lib/designer_integration/Makefile.am
new file mode 100644
index 00000000..cab66420
--- /dev/null
+++ b/languages/lib/designer_integration/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+libdesignerintegration_la_LDFLAGS = $(all_libraries)
+lib_LTLIBRARIES = libdesignerintegration.la
+libdesignerintegration_la_LIBADD = $(top_builddir)/lib/interfaces/libkdevinterfaces.la $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
+libdesignerintegration_la_SOURCES = implementationwidgetbase.ui \
+ implementationwidget.cpp qtdesignerintegration.cpp
+
+langincludedirdir = $(includedir)/kdevelop/languages/designer_integration
+langincludedir_HEADERS = qtdesignerintegration.h implementationwidget.h implementationwidgetbase.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces kdevutil
+DOXYGEN_PROJECTNAME = KDevelop Designer Integration Support Library
+include ../../../Doxyfile.am
diff --git a/languages/lib/designer_integration/implementationwidget.cpp b/languages/lib/designer_integration/implementationwidget.cpp
new file mode 100644
index 00000000..7c561e7c
--- /dev/null
+++ b/languages/lib/designer_integration/implementationwidget.cpp
@@ -0,0 +1,158 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "implementationwidget.h"
+
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qregexp.h>
+#include <qdom.h>
+#include <qradiobutton.h>
+
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <klistview.h>
+
+#include <kdevproject.h>
+#include <domutil.h>
+#include <filetemplate.h>
+#include <kdevlanguagesupport.h>
+
+namespace ImplUtils{
+class ClassItem: public KListViewItem{
+public:
+ ClassItem(KListViewItem *parent, ClassDom dom)
+ :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); }
+ ClassItem(KListView *parent, ClassDom dom)
+ :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); }
+ ClassDom dom() const { return m_dom; }
+private:
+ ClassDom m_dom;
+};
+
+class NamespaceItem: public KListViewItem{
+public:
+ NamespaceItem(KListViewItem *parent, NamespaceDom dom)
+ :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); }
+ NamespaceItem(KListView *parent, NamespaceDom dom)
+ :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); }
+ NamespaceDom dom() const { return m_dom; }
+private:
+ NamespaceDom m_dom;
+};
+}
+
+ImplementationWidget::ImplementationWidget(KDevLanguageSupport *part, QWidget* parent, const char* name, bool modal)
+ :CreateImplemenationWidgetBase(parent, name, modal), m_part(part)
+{
+}
+
+void ImplementationWidget::init(const QString &formName)
+{
+ m_formName = formName;
+
+ classView->clear();
+ fileNameEdit->clear();
+ classNameEdit->clear();
+
+ QDomDocument doc;
+ DomUtil::openDOMFile(doc, m_formName);
+ m_baseClassName = DomUtil::elementByPathExt(doc, "class").text();
+ setCaption(i18n("Create or Select Implementation Class for: %1").arg(m_baseClassName));
+
+ KListViewItem *item = new KListViewItem(classView, i18n("Namespaces &amp;&amp; Classes"));
+ item->setOpen(true);
+ processNamespaces(m_part->codeModel()->globalNamespace(), item);
+}
+
+void ImplementationWidget::processNamespaces(NamespaceDom dom, KListViewItem *parent)
+{
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::const_iterator it = nslist.begin(); it != nslist.end(); ++it)
+ processNamespaces(*it, new ImplUtils::NamespaceItem(parent, *it));
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ processClasses(*it, new ImplUtils::ClassItem(parent, *it));
+}
+
+void ImplementationWidget::processClasses(ClassDom dom, KListViewItem *parent)
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ processClasses(*it, new ImplUtils::ClassItem(parent, *it));
+}
+
+ImplementationWidget::~ImplementationWidget()
+{
+}
+
+/*$SPECIALIZATION$*/
+void ImplementationWidget::classNameChanged(const QString &text)
+{
+ fileNameEdit->setText(text.lower());
+}
+
+void ImplementationWidget::accept()
+{
+ if (createButton->isOn())
+ {
+ if (classNameEdit->text().isEmpty())
+ return;
+ if (!createClass())
+ return;
+ ClassList cllist = m_part->codeModel()->globalNamespace()->classByName(classNameEdit->text());
+ if (cllist.count() > 0)
+ m_selectedClass = cllist.first();
+ else
+ KMessageBox::error(0, i18n("Class was created but not found in class store."));
+ }
+ else if (useButton->isOn())
+ {
+ if (!classView->currentItem())
+ return;
+ ImplUtils::ClassItem *item = dynamic_cast<ImplUtils::ClassItem*>(classView->currentItem());
+ if (!item)
+ return;
+ m_selectedClass = item->dom();
+ }
+ QDialog::accept();
+}
+
+ClassDom ImplementationWidget::selectedClass()
+{
+ return m_selectedClass;
+}
+
+bool ImplementationWidget::createClass()
+{
+ m_part->project()->addFiles(createClassFiles());
+ return true;
+}
+
+int ImplementationWidget::exec(const QString &formName)
+{
+ init(formName);
+ return QDialog::exec();
+}
+
+#include "implementationwidget.moc"
+
diff --git a/languages/lib/designer_integration/implementationwidget.h b/languages/lib/designer_integration/implementationwidget.h
new file mode 100644
index 00000000..3200c877
--- /dev/null
+++ b/languages/lib/designer_integration/implementationwidget.h
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef IMPLEMENTATIONWIDGET_H
+#define IMPLEMENTATIONWIDGET_H
+
+#include "implementationwidgetbase.h"
+
+#include <codemodel.h>
+
+class KListViewItem;
+class KDevLanguageSupport;
+
+/**
+Base class for implementation creation widgets.
+Contains language-independent implementation widget that can be used
+to create or select an implementation of a form in designer.
+
+Implementations could be subclasses or simple files with callbacks, etc.
+
+Subclasses of this class should reimplement only pure virtual functions in the common case.
+*/
+class ImplementationWidget : public CreateImplemenationWidgetBase
+{
+Q_OBJECT
+public:
+ ImplementationWidget(KDevLanguageSupport *part, QWidget* parent = 0, const char* name = 0, bool modal = false);
+ virtual ~ImplementationWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ /**@returns The %DOM of selected (or created) class.*/
+ ClassDom selectedClass();
+
+ /**Executes implementation widget for a form @p formName.*/
+ int exec(const QString &formName);
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ /**Sets up the dialog. No need to reimplement unless you want to restrict
+ the number of classes being displayed as possible implementation classes.*/
+ void init(const QString &formName);
+
+ void processNamespaces(NamespaceDom dom, KListViewItem *parent);
+ void processClasses(ClassDom dom, KListViewItem *parent);
+
+ /**Creates a class and adds it to a project. No need to reimplement.*/
+ bool createClass();
+
+ /**Reimplement to create actual files with the form implementation.
+ @return The list of absolute paths to a files created.*/
+ virtual QStringList createClassFiles() = 0;
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void classNameChanged(const QString &text);
+ virtual void accept();
+
+protected:
+ KDevLanguageSupport *m_part;
+ ClassDom m_selectedClass;
+ QString m_formName;
+ QString m_baseClassName;
+};
+
+#endif
+
diff --git a/languages/lib/designer_integration/implementationwidgetbase.ui b/languages/lib/designer_integration/implementationwidgetbase.ui
new file mode 100644
index 00000000..1a39d39e
--- /dev/null
+++ b/languages/lib/designer_integration/implementationwidgetbase.ui
@@ -0,0 +1,267 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CreateImplemenationWidgetBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CreateImplemenationWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>518</width>
+ <height>353</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create or Select Implementation Class</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>createButton</cstring>
+ </property>
+ <property name="text">
+ <string>Create &amp;new class</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KListView" row="4" column="0">
+ <column>
+ <property name="text">
+ <string>Class Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>File</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>classView</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>classNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;lass name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>classNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>classNameEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>useButton</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;existing class</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout2_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>fileNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;File name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>fileNameEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateImplemenationWidgetBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CreateImplemenationWidgetBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>createButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>classNameLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>classNameEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>useButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>classView</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>fileNameLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createButton</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>fileNameEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>classNameEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CreateImplemenationWidgetBase</receiver>
+ <slot>classNameChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>createButton</tabstop>
+ <tabstop>classNameEdit</tabstop>
+ <tabstop>fileNameEdit</tabstop>
+ <tabstop>classView</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">classNameChanged(const QString &amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/lib/designer_integration/qtdesignerintegration.cpp b/languages/lib/designer_integration/qtdesignerintegration.cpp
new file mode 100644
index 00000000..32dc16ca
--- /dev/null
+++ b/languages/lib/designer_integration/qtdesignerintegration.cpp
@@ -0,0 +1,195 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qtdesignerintegration.h"
+
+#include <qpair.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+
+#include <rurl.h>
+#include <domutil.h>
+#include <kdevpartcontroller.h>
+#include <kdevcreatefile.h>
+#include <kdevlanguagesupport.h>
+#include <kdevproject.h>
+
+#include "codemodel_utils.h"
+#include "implementationwidget.h"
+
+QtDesignerIntegration::QtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl, bool classHasDefinitions, const char* name)
+ :KDevDesignerIntegration(part, name), m_part(part), m_impl(impl),
+ m_classHasDefinitions(classHasDefinitions)
+{
+}
+
+QtDesignerIntegration::~QtDesignerIntegration()
+{
+ delete m_impl;
+}
+
+void QtDesignerIntegration::addFunction(const QString& formName, KInterfaceDesigner::Function function)
+{
+ kdDebug() << "QtDesignerIntegration::addFunction: form: " << formName << ", function: " << function.function << endl;
+
+ if (!m_implementations.contains(formName))
+ if (!selectImplementation(formName))
+ return;
+
+ ClassDom klass = m_implementations[formName];
+ if (!klass)
+ {
+ KMessageBox::error(0, i18n("Cannot find implementation class for form: %1").arg(formName));
+ return;
+ }
+
+ addFunctionToClass(function, klass);
+}
+
+void QtDesignerIntegration::editFunction(const QString& formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function)
+{
+ kdDebug() << "QtDesignerIntegration::editFunction: form: " << formName
+ << ", old function: " << oldFunction.function
+ << ", function: " << function.function << endl;
+}
+
+void QtDesignerIntegration::removeFunction(const QString& formName, KInterfaceDesigner::Function function)
+{
+ kdDebug() << "QtDesignerIntegration::removeFunction: form: " << formName << ", function: " << function.function << endl;
+}
+
+bool QtDesignerIntegration::selectImplementation(const QString &formName)
+{
+ QFileInfo fi(formName);
+ if (!fi.exists())
+ return false;
+
+ if (m_impl->exec(formName))
+ {
+ m_implementations[formName] = m_impl->selectedClass();
+ return true;
+ }
+ return false;
+}
+
+void QtDesignerIntegration::loadSettings(QDomDocument dom, QString path)
+{
+ QDomElement el = DomUtil::elementByPath(dom, path + "/qtdesigner");
+ if (el.isNull())
+ return;
+ QDomNodeList impls = el.elementsByTagName("implementation");
+ for (uint i = 0; i < impls.count(); ++i)
+ {
+ QDomElement el = impls.item(i).toElement();
+ if (el.isNull())
+ continue;
+ QString implementationPath = Relative::File(m_part->project()->projectDirectory(),
+ el.attribute("implementationpath"), true).urlPath();
+ FileDom file = m_part->codeModel()->fileByName(implementationPath);
+ if (!file)
+ continue;
+ ClassList cllist = file->classByName(el.attribute("class"));
+ QString uiPath = Relative::File(m_part->project()->projectDirectory(),
+ el.attribute("path"), true).urlPath();
+ if (cllist.count() > 0)
+ m_implementations[uiPath] = cllist.first();
+ }
+}
+
+void QtDesignerIntegration::saveSettings(QDomDocument dom, QString path)
+{
+ kdDebug() << "QtDesignerIntegration::saveSettings" << endl;
+ QDomElement el = DomUtil::createElementByPath(dom, path + "/qtdesigner");
+ for (QMap<QString, ClassDom>::const_iterator it = m_implementations.begin();
+ it != m_implementations.end(); ++it)
+ {
+ QDomElement il = dom.createElement("implementation");
+ el.appendChild(il);
+ il.setAttribute("path",
+ Relative::File(m_part->project()->projectDirectory(), it.key()).rurl());
+ il.setAttribute("implementationpath",
+ Relative::File(m_part->project()->projectDirectory(), it.data()->fileName()).rurl());
+ il.setAttribute("class", it.data()->name());
+ }
+}
+
+void QtDesignerIntegration::openFunction(const QString &formName, const QString &functionName)
+{
+ kdDebug() << "QtDesignerIntegration::openFunction, formName = " << formName
+ << ", functionName = " << functionName << endl;
+ QString fn = functionName;
+ if (fn.find("(") > 0)
+ fn.remove(fn.find("("), fn.length());
+
+ if (!m_implementations[formName])
+ return;
+
+ int line = -1, col = -1;
+
+ QString impl = m_implementations[formName]->fileName();
+ processImplementationName(impl);
+
+ if (m_part->codeModel()->hasFile(impl))
+ {
+ if (m_classHasDefinitions)
+ {
+ FunctionDefinitionList list =
+ m_part->codeModel()->fileByName(impl)->functionDefinitionList();
+ for (FunctionDefinitionList::const_iterator it = list.begin(); it != list.end(); ++it)
+ {
+ if ((*it)->name() == fn)
+ (*it)->getStartPosition(&line, &col);
+ }
+ }
+ else
+ {
+ FunctionList list =
+ m_part->codeModel()->fileByName(impl)->functionList();
+ for (FunctionList::const_iterator it = list.begin(); it != list.end(); ++it)
+ {
+ if ((*it)->name() == fn)
+ (*it)->getStartPosition(&line, &col);
+ }
+ }
+ }
+
+ m_part->partController()->editDocument(KURL(impl), line, col);
+}
+
+void QtDesignerIntegration::processImplementationName(QString &// name
+ )
+{
+}
+
+void QtDesignerIntegration::openSource(const QString &formName)
+{
+ if (!m_implementations.contains(formName))
+ if (!selectImplementation(formName))
+ return;
+ QString impl = m_implementations[formName]->fileName();
+ processImplementationName(impl);
+ m_part->partController()->editDocument(KURL(impl), -1, -1);
+}
+
+#include "qtdesignerintegration.moc"
diff --git a/languages/lib/designer_integration/qtdesignerintegration.h b/languages/lib/designer_integration/qtdesignerintegration.h
new file mode 100644
index 00000000..fd8b512f
--- /dev/null
+++ b/languages/lib/designer_integration/qtdesignerintegration.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QTDESIGNERINTEGRATION_H
+#define QTDESIGNERINTEGRATION_H
+
+#include <qmap.h>
+
+#include <codemodel.h>
+#include "kdevdesignerintegration.h"
+
+class KDevLanguageSupport;
+class ImplementationWidget;
+
+/**
+Qt Designer integration base class.
+Contains language-independent implementation part of a @ref KDevDesignerIntegration interface.
+Ready to use in KDevelop language support plugins.
+
+Subclasses of this class should reimplement only pure virtual functions in the common case.
+*/
+class QtDesignerIntegration : public KDevDesignerIntegration
+{
+Q_OBJECT
+public:
+ QtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl,
+ bool classHasDefinitions, const char* name = 0);
+ virtual ~QtDesignerIntegration();
+
+public slots:
+ virtual void addFunction(const QString& formName, KInterfaceDesigner::Function function);
+ virtual void editFunction(const QString& formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function);
+ virtual void removeFunction(const QString& formName, KInterfaceDesigner::Function function);
+
+ virtual void openFunction(const QString &formName, const QString &functionName);
+
+ virtual void openSource(const QString &formName);
+
+ virtual void saveSettings(QDomDocument dom, QString path);
+ virtual void loadSettings(QDomDocument dom, QString path);
+
+ bool selectImplementation(const QString &formName);
+
+protected:
+ /**Reimplement this to add a function to a class. This means you need to modify
+ the source file and add actual code of a function.*/
+ virtual void addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass) = 0;
+ /**Modifies name to be a name of a implementation file for languages that have
+ separate files for interface and implementation parts of a class. For example,
+ C++ language support plugin will do:
+ @code
+ name.replace(".h", ".cpp");
+ @endcode*/
+ virtual void processImplementationName(QString &name);
+
+ //Form file - derived class name
+ QMap<QString, ClassDom> m_implementations;
+
+ KDevLanguageSupport *m_part;
+ ImplementationWidget *m_impl;
+ bool m_classHasDefinitions;
+};
+
+#endif
diff --git a/languages/lib/interfaces/Mainpage.dox b/languages/lib/interfaces/Mainpage.dox
new file mode 100644
index 00000000..f31c4bfc
--- /dev/null
+++ b/languages/lib/interfaces/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Language Support Interfaces Library
+
+This library contains interfaces for KDevelop language support facilities.
+
+<b>Link with</b>: -llang_interfaces
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/languages/interfaces
+*/
+
diff --git a/languages/lib/interfaces/Makefile.am b/languages/lib/interfaces/Makefile.am
new file mode 100644
index 00000000..2ccbac75
--- /dev/null
+++ b/languages/lib/interfaces/Makefile.am
@@ -0,0 +1,16 @@
+
+METASOURCES = AUTO
+langincludedirdir = $(includedir)/kdevelop/languages/interfaces
+lib_LTLIBRARIES = liblang_interfaces.la
+liblang_interfaces_la_LDFLAGS = $(all_libraries)
+liblang_interfaces_la_SOURCES = kdevpcsimporter.cpp
+liblang_interfaces_la_LIBADD = $(LIB_QT)
+langincludedir_HEADERS = kdevpcsimporter.h
+INCLUDES = $(all_includes)
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = kdeveloppcsimporter.desktop
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces kdevutil
+DOXYGEN_PROJECTNAME = KDevelop Language Support Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdevlang
+include ../../../Doxyfile.am
diff --git a/languages/lib/interfaces/kdeveloppcsimporter.desktop b/languages/lib/interfaces/kdeveloppcsimporter.desktop
new file mode 100644
index 00000000..bbf0f490
--- /dev/null
+++ b/languages/lib/interfaces/kdeveloppcsimporter.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/PCSImporter
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop PCS Importer
+Name[ca]=Importador PCS per a KDevelop
+Name[da]=KDevelop PCS importør
+Name[de]=PCS-Importierer (KDevelop)
+Name[el]=Εισαγωγέας PCS KDevelop
+Name[es]=Importación PCS de KDevelop
+Name[et]=KDevelopi PCS importija
+Name[eu]=KDevelop PCS inportatzailea
+Name[fa]=واردکنندۀ KDevelop PCS
+Name[fr]=Importation PCS pour KDevelop
+Name[ga]=Iompórtálaí PCS KDevelop
+Name[gl]=Importador PCS de KDevelop
+Name[hi]=के-डेवलप पीसीएस आयातक
+Name[hu]=KDevelop PCS-importáló
+Name[ja]=KDevelop PCS インポータ
+Name[nds]=PCS-Import (KDevelop)
+Name[ne]=केडीई विकास PCS आयातकर्ता
+Name[nl]=KDevelop PCS importeren
+Name[pl]=KDevelop: import PCS
+Name[pt]=Importador de PCS do KDevelop
+Name[pt_BR]=Importador PCS para o KDevelop
+Name[ru]=Загрузчик в хранилище классов
+Name[sk]=KDevelop PCS import
+Name[sl]=Uvažanje PCS za KDevelop
+Name[sr]=KDevelop-ов PCS увозник
+Name[sr@Latn]=KDevelop-ov PCS uvoznik
+Name[sv]=KDevelop PCS-import
+Name[ta]=KDevelop pcs ஏற்றுமதியாளர்
+Name[tg]=Пурборкунанда дар анбори синфӣ
+Name[tr]=KDevelop PCS Aktarıcısı
+Name[zh_CN]=KDevelop PCS导入器
+Name[zh_TW]=KDevelop PCS 匯入器
+
+[PropertyDef::X-KDevelop-PCSImporter]
+Type=QString
diff --git a/languages/lib/interfaces/kdevpcsimporter.cpp b/languages/lib/interfaces/kdevpcsimporter.cpp
new file mode 100644
index 00000000..de8a8632
--- /dev/null
+++ b/languages/lib/interfaces/kdevpcsimporter.cpp
@@ -0,0 +1,36 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "kdevpcsimporter.h"
+#include "kdevpcsimporter.moc"
+
+KDevPCSImporter::KDevPCSImporter( QObject * parent, const char * name )
+ : QObject( parent, name )
+{
+}
+
+KDevPCSImporter::~ KDevPCSImporter( )
+{
+}
+
+QWidget * KDevPCSImporter::createSettingsPage( QWidget * /*parent*/, const char * /*name*/ )
+{
+ return 0;
+}
+
diff --git a/languages/lib/interfaces/kdevpcsimporter.h b/languages/lib/interfaces/kdevpcsimporter.h
new file mode 100644
index 00000000..8493b9e3
--- /dev/null
+++ b/languages/lib/interfaces/kdevpcsimporter.h
@@ -0,0 +1,49 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef KDEVPCSIMPORTER_H
+#define KDEVPCSIMPORTER_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+
+class QWidget;
+
+/**
+KDevelop persistent class store importer plugin.
+
+These plugins are used by language support plugins to fill symbol stores
+with symbol information from certain files. The purpose of the importer
+is to provide file selection wizard.
+*/
+class KDevPCSImporter: public QObject
+{
+ Q_OBJECT
+public:
+ KDevPCSImporter( QObject* parent=0, const char* name=0 );
+ virtual ~KDevPCSImporter();
+
+ virtual QString dbName() const = 0;
+ virtual QStringList includePaths() = 0;
+ virtual QStringList fileList() = 0;
+
+ virtual QWidget* createSettingsPage( QWidget* parent, const char* name=0 );
+};
+
+#endif // KDEVPCSIMPORTER_H
diff --git a/languages/pascal/Makefile.am b/languages/pascal/Makefile.am
new file mode 100644
index 00000000..5abaa01b
--- /dev/null
+++ b/languages/pascal/Makefile.am
@@ -0,0 +1,33 @@
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+INCLUDES = -I$(top_srcdir)/lib/antlr -I$(top_srcdir)/lib/catalog \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = file_templates app_templates compiler doc
+
+kde_module_LTLIBRARIES = libkdevpascalsupport.la
+libkdevpascalsupport_la_LDFLAGS = $(LEXLIB) $(all_libraries) $(KDE_PLUGIN)
+libkdevpascalsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/antlr/src/libantlr.la $(top_builddir)/lib/catalog/libkdevcatalog.la
+
+libkdevpascalsupport_la_SOURCES = pascalsupport_part.cpp PascalLexer.cpp PascalParser.cpp PascalStoreWalker.cpp backgroundparser.cpp configproblemreporter.ui problemreporter.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevpascalsupport.desktop
+
+rcdir = $(kde_datadir)/kdevpascalsupport
+rc_DATA = kdevpascalsupport.rc
+
+genparser:
+ antlr pascal.g && antlr pascal.tree.g
+
+## The following rules assume that you have Java and ANTLR installed,
+#PascalLexer.hpp PascalLexer.cpp PascalParser.hpp PascalParser.cpp: pascal.g
+# antlr pascal.g
+
+#PascalStoreWalker.hpp PascalStoreWalker.cpp: pascal.tree.g
+# antlr pascal.tree.g
+
+templatedir = ${kde_datadir}/kdevabbrev/templates
+template_DATA = pascaltemplates
diff --git a/languages/pascal/PascalAST.hpp b/languages/pascal/PascalAST.hpp
new file mode 100644
index 00000000..3df4ea50
--- /dev/null
+++ b/languages/pascal/PascalAST.hpp
@@ -0,0 +1,51 @@
+#ifndef PASCALAST_HPP
+#define PASCALAST_HPP
+
+#include <antlr/CommonAST.hpp>
+
+class PascalAST;
+typedef antlr::ASTRefCount<PascalAST> RefPascalAST;
+
+class PascalAST : public antlr::CommonAST {
+public:
+ PascalAST()
+ : m_line(0), m_column(0) {}
+
+ ~PascalAST() {}
+
+ int getLine() const { return m_line; }
+ void setLine( int line ) { m_line = line; }
+
+ int getColumn() const { return m_column; }
+ void setColumn( int column ) { m_column = column; }
+
+ void initialize( antlr::RefToken t ) {
+ antlr::CommonAST::initialize(t);
+ m_line = t->getLine() - 1;
+ m_column = t->getColumn() - 1;
+ }
+
+ void initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt) {
+ setType(t);
+ setText(txt);
+ m_line = 0;
+ m_column = 0;
+ }
+
+ void addChild( RefPascalAST c ) {
+ antlr::RefAST n( c.get() );
+ antlr::BaseAST::addChild( n );
+ }
+
+ static antlr::RefAST factory( void ) {
+ RefPascalAST n(new PascalAST);
+ return n.get();
+ }
+
+private:
+ int m_line;
+ int m_column;
+};
+
+
+#endif
diff --git a/languages/pascal/PascalLexer.cpp b/languages/pascal/PascalLexer.cpp
new file mode 100644
index 00000000..28f532f8
--- /dev/null
+++ b/languages/pascal/PascalLexer.cpp
@@ -0,0 +1,1309 @@
+/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalLexer.cpp"$ */
+#include "PascalLexer.hpp"
+#include <antlr/CharBuffer.hpp>
+#include <antlr/TokenStreamException.hpp>
+#include <antlr/TokenStreamIOException.hpp>
+#include <antlr/TokenStreamRecognitionException.hpp>
+#include <antlr/CharStreamException.hpp>
+#include <antlr/CharStreamIOException.hpp>
+#include <antlr/NoViableAltForCharException.hpp>
+
+#line 1 "pascal.g"
+#line 13 "PascalLexer.cpp"
+PascalLexer::PascalLexer(ANTLR_USE_NAMESPACE(std)istream& in)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(new ANTLR_USE_NAMESPACE(antlr)CharBuffer(in),false)
+{
+ initLiterals();
+}
+
+PascalLexer::PascalLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(ib,false)
+{
+ initLiterals();
+}
+
+PascalLexer::PascalLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state)
+ : ANTLR_USE_NAMESPACE(antlr)CharScanner(state,false)
+{
+ initLiterals();
+}
+
+void PascalLexer::initLiterals()
+{
+ literals["until"] = 146;
+ literals["xor"] = 123;
+ literals["abstract"] = 99;
+ literals["shortint"] = 69;
+ literals["with"] = 150;
+ literals["packed"] = 91;
+ literals["inherited"] = 172;
+ literals["break"] = 168;
+ literals["smallint"] = 70;
+ literals["safecall"] = 64;
+ literals["constructor"] = 102;
+ literals["continue"] = 169;
+ literals["uses"] = 30;
+ literals["for"] = 147;
+ literals["else"] = 142;
+ literals["is"] = 119;
+ literals["of"] = 51;
+ literals["and"] = 128;
+ literals["integer"] = 68;
+ literals["byte"] = 73;
+ literals["nil"] = 161;
+ literals["begin"] = 34;
+ literals["interface"] = 32;
+ literals["as"] = 165;
+ literals["div"] = 126;
+ literals["write"] = 110;
+ literals["qword"] = 76;
+ literals["procedure"] = 47;
+ literals["shl"] = 129;
+ literals["var"] = 45;
+ literals["private"] = 100;
+ literals["function"] = 49;
+ literals["unit"] = 31;
+ literals["downto"] = 149;
+ literals["name"] = 29;
+ literals["resourcestring"] = 42;
+ literals["register"] = 57;
+ literals["popstack"] = 61;
+ literals["label"] = 40;
+ literals["try"] = 155;
+ literals["raise"] = 154;
+ literals["not"] = 131;
+ literals["record"] = 92;
+ literals["forward"] = 48;
+ literals["in"] = 118;
+ literals["except"] = 156;
+ literals["file"] = 95;
+ literals["operator"] = 153;
+ literals["pascal"] = 58;
+ literals["finalization"] = 39;
+ literals["cdecl"] = 59;
+ literals["extended"] = 86;
+ literals["external"] = 52;
+ literals["destructor"] = 103;
+ literals["real"] = 83;
+ literals["virtual"] = 98;
+ literals["chr"] = 160;
+ literals["near"] = 65;
+ literals["object"] = 97;
+ literals["public"] = 53;
+ literals["repeat"] = 145;
+ literals["library"] = 23;
+ literals["false"] = 133;
+ literals["longint"] = 71;
+ literals["saveregisters"] = 62;
+ literals["to"] = 148;
+ literals["asm"] = 166;
+ literals["case"] = 93;
+ literals["export"] = 56;
+ literals["true"] = 132;
+ literals["do"] = 144;
+ literals["stdcall"] = 60;
+ literals["program"] = 35;
+ literals["absolute"] = 164;
+ literals["override"] = 105;
+ literals["then"] = 141;
+ literals["set"] = 94;
+ literals["protected"] = 101;
+ literals["or"] = 122;
+ literals["word"] = 74;
+ literals["finally"] = 157;
+ literals["char"] = 80;
+ literals["if"] = 140;
+ literals["far"] = 66;
+ literals["const"] = 41;
+ literals["index"] = 28;
+ literals["assembler"] = 167;
+ literals["cardinal"] = 75;
+ literals["string"] = 88;
+ literals["dispose"] = 170;
+ literals["read"] = 109;
+ literals["default"] = 111;
+ literals["new"] = 173;
+ literals["array"] = 50;
+ literals["self"] = 174;
+ literals["end"] = 25;
+ literals["single"] = 84;
+ literals["property"] = 108;
+ literals["mod"] = 127;
+ literals["goto"] = 139;
+ literals["on"] = 158;
+ literals["comp"] = 87;
+ literals["initialization"] = 38;
+ literals["class"] = 104;
+ literals["int64"] = 72;
+ literals["published"] = 107;
+ literals["nodefault"] = 112;
+ literals["inline"] = 63;
+ literals["while"] = 143;
+ literals["boolean"] = 77;
+ literals["type"] = 44;
+ literals["double"] = 85;
+ literals["implementation"] = 33;
+ literals["exports"] = 26;
+ literals["alias"] = 54;
+ literals["exit"] = 171;
+ literals["shr"] = 130;
+}
+
+ANTLR_USE_NAMESPACE(antlr)RefToken PascalLexer::nextToken()
+{
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ for (;;) {
+ ANTLR_USE_NAMESPACE(antlr)RefToken theRetToken;
+ int _ttype = ANTLR_USE_NAMESPACE(antlr)Token::INVALID_TYPE;
+ resetText();
+ try { // for lexical and char stream error handling
+ switch ( LA(1)) {
+ case 0x2c /* ',' */ :
+ {
+ mCOMMA(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x3b /* ';' */ :
+ {
+ mSEMI(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x3d /* '=' */ :
+ {
+ mEQUAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x29 /* ')' */ :
+ {
+ mRPAREN(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x5b /* '[' */ :
+ {
+ mLBRACK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x5d /* ']' */ :
+ {
+ mRBRACK(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x5e /* '^' */ :
+ {
+ mPOINTER(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x40 /* '@' */ :
+ {
+ mAT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x7d /* '}' */ :
+ {
+ mRCURLY(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ case 0xa /* '\n' */ :
+ case 0xc /* '\14' */ :
+ case 0xd /* '\r' */ :
+ case 0x20 /* ' ' */ :
+ {
+ mWS(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ mIDENT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x27 /* '\'' */ :
+ {
+ mSTRING_LITERAL(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ mNUM_INT(true);
+ theRetToken=_returnToken;
+ break;
+ }
+ default:
+ if ((LA(1) == 0x3a /* ':' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mASSIGN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3e /* '>' */ )) {
+ mNOT_EQUAL(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mLE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mGE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x28 /* '(' */ ) && (LA(2) == 0x2e /* '.' */ )) {
+ mLBRACK2(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2e /* '.' */ ) && (LA(2) == 0x29 /* ')' */ )) {
+ mRBRACK2(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2b /* '+' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mPLUSEQ(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mMINUSEQ(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mSTAREQ(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x3d /* '=' */ )) {
+ mSLASHQE(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x28 /* '(' */ ) && (LA(2) == 0x2a /* '*' */ )) {
+ mCOMMENT_1(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x7b /* '{' */ ) && ((LA(2) >= 0x0 /* '\0' */ && LA(2) <= 0xff))) {
+ mCOMMENT_2(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
+ mCOMMENT_3(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2b /* '+' */ ) && (true)) {
+ mPLUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2d /* '-' */ ) && (true)) {
+ mMINUS(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2a /* '*' */ ) && (true)) {
+ mSTAR(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2f /* '/' */ ) && (true)) {
+ mSLASH(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3a /* ':' */ ) && (true)) {
+ mCOLON(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
+ mLTH(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
+ mGT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x28 /* '(' */ ) && (true)) {
+ mLPAREN(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x2e /* '.' */ ) && (true)) {
+ mDOT(true);
+ theRetToken=_returnToken;
+ }
+ else if ((LA(1) == 0x7b /* '{' */ ) && (true)) {
+ mLCURLY(true);
+ theRetToken=_returnToken;
+ }
+ else {
+ if (LA(1)==EOF_CHAR)
+ {
+ uponEOF();
+ _returnToken = makeToken(ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE);
+ }
+ else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+ }
+ if ( !_returnToken )
+ goto tryAgain; // found SKIP token
+
+ _ttype = _returnToken->getType();
+ _returnToken->setType(_ttype);
+ return _returnToken;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& e) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamRecognitionException(e);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamIOException& csie) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamIOException(csie.io);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)CharStreamException& cse) {
+ throw ANTLR_USE_NAMESPACE(antlr)TokenStreamException(cse.getMessage());
+ }
+tryAgain:;
+ }
+}
+
+void PascalLexer::mPLUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PLUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('+' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mMINUS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MINUS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('-' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSTAR(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STAR;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('*' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSLASH(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SLASH;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('/' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mASSIGN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = ASSIGN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(":=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mCOMMA(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMA;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(',' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSEMI(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SEMI;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(';' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mCOLON(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COLON;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(':' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mEQUAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EQUAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('=' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mNOT_EQUAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NOT_EQUAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<>");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLTH(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LTH;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('<' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("<=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mGE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(">=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mGT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = GT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('>' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('(' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mRPAREN(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RPAREN;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(')' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLBRACK(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LBRACK;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('[' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLBRACK2(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LBRACK2;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("(.");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mRBRACK(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RBRACK;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(']' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mRBRACK2(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RBRACK2;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match(".)");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mPOINTER(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = POINTER;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('^' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mAT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = AT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('@' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mDOT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = DOT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('.' /* charlit */ );
+ {
+ if ((LA(1) == 0x2e /* '.' */ )) {
+ match('.' /* charlit */ );
+#line 1124 "pascal.g"
+ _ttype = DOTDOT;
+#line 719 "PascalLexer.cpp"
+ }
+ else {
+ }
+
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mLCURLY(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = LCURLY;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("{");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mRCURLY(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = RCURLY;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("}");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mPLUSEQ(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = PLUSEQ;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("+=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mMINUSEQ(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = MINUSEQ;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("-=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSTAREQ(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STAREQ;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("*=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSLASHQE(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = SLASHQE;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("/=");
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mWS(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = WS;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ switch ( LA(1)) {
+ case 0x20 /* ' ' */ :
+ {
+ match(' ' /* charlit */ );
+ break;
+ }
+ case 0x9 /* '\t' */ :
+ {
+ match('\t' /* charlit */ );
+ break;
+ }
+ case 0xc /* '\14' */ :
+ {
+ match('\14' /* charlit */ );
+ break;
+ }
+ case 0xa /* '\n' */ :
+ case 0xd /* '\r' */ :
+ {
+ {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ )) {
+ match("\r\n");
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && (true)) {
+ match('\r' /* charlit */ );
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+
+ }
+#line 1142 "pascal.g"
+ newline();
+#line 859 "PascalLexer.cpp"
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+#line 1144 "pascal.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 870 "PascalLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mCOMMENT_1(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMENT_1;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("(*");
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ ) && ((LA(3) >= 0x0 /* '\0' */ && LA(3) <= 0xff)) && ((LA(4) >= 0x0 /* '\0' */ && LA(4) <= 0xff))) {
+ match('\r' /* charlit */ );
+ match('\n' /* charlit */ );
+#line 1152 "pascal.g"
+ newline();
+#line 892 "PascalLexer.cpp"
+ }
+ else if (((LA(1) == 0x2a /* '*' */ ) && ((LA(2) >= 0x0 /* '\0' */ && LA(2) <= 0xff)) && ((LA(3) >= 0x0 /* '\0' */ && LA(3) <= 0xff)))&&( LA(2) != ')' )) {
+ match('*' /* charlit */ );
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && ((LA(2) >= 0x0 /* '\0' */ && LA(2) <= 0xff)) && ((LA(3) >= 0x0 /* '\0' */ && LA(3) <= 0xff)) && (true)) {
+ match('\r' /* charlit */ );
+#line 1153 "pascal.g"
+ newline();
+#line 901 "PascalLexer.cpp"
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+#line 1154 "pascal.g"
+ newline();
+#line 907 "PascalLexer.cpp"
+ }
+ else if ((_tokenSet_0.member(LA(1)))) {
+ {
+ match(_tokenSet_0);
+ }
+ }
+ else {
+ goto _loop427;
+ }
+
+ }
+ _loop427:;
+ } // ( ... )*
+ match("*)");
+#line 1158 "pascal.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 924 "PascalLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mCOMMENT_2(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMENT_2;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('{' /* charlit */ );
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0xd /* '\r' */ ) && (LA(2) == 0xa /* '\n' */ ) && ((LA(3) >= 0x0 /* '\0' */ && LA(3) <= 0xff)) && (true)) {
+ match('\r' /* charlit */ );
+ match('\n' /* charlit */ );
+#line 1164 "pascal.g"
+ newline();
+#line 946 "PascalLexer.cpp"
+ }
+ else if ((LA(1) == 0xd /* '\r' */ ) && ((LA(2) >= 0x0 /* '\0' */ && LA(2) <= 0xff)) && (true) && (true)) {
+ match('\r' /* charlit */ );
+#line 1165 "pascal.g"
+ newline();
+#line 952 "PascalLexer.cpp"
+ }
+ else if ((LA(1) == 0xa /* '\n' */ )) {
+ match('\n' /* charlit */ );
+#line 1166 "pascal.g"
+ newline();
+#line 958 "PascalLexer.cpp"
+ }
+ else if ((_tokenSet_1.member(LA(1)))) {
+ {
+ match(_tokenSet_1);
+ }
+ }
+ else {
+ goto _loop431;
+ }
+
+ }
+ _loop431:;
+ } // ( ... )*
+ match('}' /* charlit */ );
+#line 1170 "pascal.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 975 "PascalLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mCOMMENT_3(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = COMMENT_3;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match("//");
+ { // ( ... )*
+ for (;;) {
+ if ((_tokenSet_2.member(LA(1)))) {
+ matchNot('\n' /* charlit */ );
+ }
+ else {
+ goto _loop434;
+ }
+
+ }
+ _loop434:;
+ } // ( ... )*
+ match('\n' /* charlit */ );
+#line 1175 "pascal.g"
+ _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP;
+#line 1005 "PascalLexer.cpp"
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mIDENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = IDENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ matchRange('a','z');
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case 0x61 /* 'a' */ :
+ case 0x62 /* 'b' */ :
+ case 0x63 /* 'c' */ :
+ case 0x64 /* 'd' */ :
+ case 0x65 /* 'e' */ :
+ case 0x66 /* 'f' */ :
+ case 0x67 /* 'g' */ :
+ case 0x68 /* 'h' */ :
+ case 0x69 /* 'i' */ :
+ case 0x6a /* 'j' */ :
+ case 0x6b /* 'k' */ :
+ case 0x6c /* 'l' */ :
+ case 0x6d /* 'm' */ :
+ case 0x6e /* 'n' */ :
+ case 0x6f /* 'o' */ :
+ case 0x70 /* 'p' */ :
+ case 0x71 /* 'q' */ :
+ case 0x72 /* 'r' */ :
+ case 0x73 /* 's' */ :
+ case 0x74 /* 't' */ :
+ case 0x75 /* 'u' */ :
+ case 0x76 /* 'v' */ :
+ case 0x77 /* 'w' */ :
+ case 0x78 /* 'x' */ :
+ case 0x79 /* 'y' */ :
+ case 0x7a /* 'z' */ :
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ matchRange('0','9');
+ break;
+ }
+ case 0x5f /* '_' */ :
+ {
+ match('_' /* charlit */ );
+ break;
+ }
+ default:
+ {
+ goto _loop438;
+ }
+ }
+ }
+ _loop438:;
+ } // ( ... )*
+ _ttype = testLiteralsTable(_ttype);
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mSTRING_LITERAL(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = STRING_LITERAL;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ match('\'' /* charlit */ );
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == 0x27 /* '\'' */ ) && (LA(2) == 0x27 /* '\'' */ )) {
+ match("\'\'");
+ }
+ else if ((_tokenSet_3.member(LA(1)))) {
+ {
+ match(_tokenSet_3);
+ }
+ }
+ else {
+ goto _loop442;
+ }
+
+ }
+ _loop442:;
+ } // ( ... )*
+ match('\'' /* charlit */ );
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+/** a numeric literal. Form is (from Wirth)
+ * digits
+ * digits . digits
+ * digits . digits exponent
+ * digits exponent
+ */
+void PascalLexer::mNUM_INT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = NUM_INT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ { // ( ... )+
+ int _cnt445=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ if ( _cnt445>=1 ) { goto _loop445; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt445++;
+ }
+ _loop445:;
+ } // ( ... )+
+ {
+ if ((LA(1) == 0x65 /* 'e' */ )) {
+ mEXPONENT(false);
+#line 1204 "pascal.g"
+ _ttype = NUM_REAL;
+#line 1153 "PascalLexer.cpp"
+ }
+ else {
+ {
+ if (((LA(1) == 0x2e /* '.' */ ))&&((LA(2)!='.')&&(LA(2)!=')'))) {
+ match('.' /* charlit */ );
+#line 1201 "pascal.g"
+ _ttype = NUM_REAL;
+#line 1161 "PascalLexer.cpp"
+ { // ( ... )+
+ int _cnt449=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ if ( _cnt449>=1 ) { goto _loop449; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt449++;
+ }
+ _loop449:;
+ } // ( ... )+
+ {
+ if ((LA(1) == 0x65 /* 'e' */ )) {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ }
+ else {
+ }
+
+ }
+ }
+
+ }
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+void PascalLexer::mEXPONENT(bool _createToken) {
+ int _ttype; ANTLR_USE_NAMESPACE(antlr)RefToken _token; ANTLR_USE_NAMESPACE(std)string::size_type _begin = text.length();
+ _ttype = EXPONENT;
+ ANTLR_USE_NAMESPACE(std)string::size_type _saveIndex;
+
+ {
+ match('e' /* charlit */ );
+ }
+ {
+ switch ( LA(1)) {
+ case 0x2b /* '+' */ :
+ {
+ match('+' /* charlit */ );
+ break;
+ }
+ case 0x2d /* '-' */ :
+ {
+ match('-' /* charlit */ );
+ break;
+ }
+ case 0x30 /* '0' */ :
+ case 0x31 /* '1' */ :
+ case 0x32 /* '2' */ :
+ case 0x33 /* '3' */ :
+ case 0x34 /* '4' */ :
+ case 0x35 /* '5' */ :
+ case 0x36 /* '6' */ :
+ case 0x37 /* '7' */ :
+ case 0x38 /* '8' */ :
+ case 0x39 /* '9' */ :
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt455=0;
+ for (;;) {
+ if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
+ matchRange('0','9');
+ }
+ else {
+ if ( _cnt455>=1 ) { goto _loop455; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
+ }
+
+ _cnt455++;
+ }
+ _loop455:;
+ } // ( ... )+
+ if ( _createToken && _token==ANTLR_USE_NAMESPACE(antlr)nullToken && _ttype!=ANTLR_USE_NAMESPACE(antlr)Token::SKIP ) {
+ _token = makeToken(_ttype);
+ _token->setText(text.substr(_begin, text.length()-_begin));
+ }
+ _returnToken = _token;
+ _saveIndex=0;
+}
+
+
+const unsigned long PascalLexer::_tokenSet_0_data_[] = { 4294958079UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12
+// 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f !
+// \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C
+// D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c d
+// e f g h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80 0x81 0x82
+// 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90
+// 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e
+// 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac
+// 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba
+// 0xbb 0xbc 0xbd
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalLexer::_tokenSet_0(_tokenSet_0_data_,16);
+const unsigned long PascalLexer::_tokenSet_1_data_[] = { 4294958079UL, 4294967295UL, 4294967295UL, 3758096383UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xe 0xf 0x10 0x11 0x12
+// 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f !
+// \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B
+// C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a b c
+// d e f g h i j k l m n o p q r s t u v w x y z { | ~ 0x7f 0x80 0x81 0x82
+// 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90
+// 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e
+// 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa 0xab 0xac
+// 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8 0xb9 0xba
+// 0xbb 0xbc 0xbd
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalLexer::_tokenSet_1(_tokenSet_1_data_,16);
+const unsigned long PascalLexer::_tokenSet_2_data_[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11
+// 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
+// ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
+// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ ` a
+// b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80
+// 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e
+// 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c
+// 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa
+// 0xab 0xac 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8
+// 0xb9 0xba 0xbb 0xbc 0xbd
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalLexer::_tokenSet_2(_tokenSet_2_data_,16);
+const unsigned long PascalLexer::_tokenSet_3_data_[] = { 4294967295UL, 4294967167UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
+// 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
+// 0x1f ! \" # $ % & ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+// @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ 0x5c ] ^ _ `
+// a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ 0x7f 0x80
+// 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e
+// 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c
+// 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2 0xa3 0xa4 0xa5 0xa6 0xa7 0xa8 0xa9 0xaa
+// 0xab 0xac 0xad 0xae 0xaf 0xb0 0xb1 0xb2 0xb3 0xb4 0xb5 0xb6 0xb7 0xb8
+// 0xb9 0xba 0xbb 0xbc 0xbd
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalLexer::_tokenSet_3(_tokenSet_3_data_,16);
+
diff --git a/languages/pascal/PascalLexer.hpp b/languages/pascal/PascalLexer.hpp
new file mode 100644
index 00000000..f63ac84d
--- /dev/null
+++ b/languages/pascal/PascalLexer.hpp
@@ -0,0 +1,121 @@
+#ifndef INC_PascalLexer_hpp_
+#define INC_PascalLexer_hpp_
+
+#line 29 "pascal.g"
+
+ #include "problemreporter.h"
+ #include "PascalAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefPascalAST(ast)->setLine( t->getLine() );\
+ RefPascalAST(ast)->setColumn( t->getColumn() ); \
+ }
+
+#line 19 "PascalLexer.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalLexer.hpp"$ */
+#include <antlr/CommonToken.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/BitSet.hpp>
+#include "PascalTokenTypes.hpp"
+#include <antlr/CharScanner.hpp>
+class CUSTOM_API PascalLexer : public ANTLR_USE_NAMESPACE(antlr)CharScanner, public PascalTokenTypes
+{
+#line 1067 "pascal.g"
+
+private:
+ ProblemReporter* m_problemReporter;
+ unsigned int m_numberOfErrors;
+
+public:
+ void resetErrors() { m_numberOfErrors = 0; }
+ unsigned int numberOfErrors() const { return m_numberOfErrors; }
+ void setProblemReporter( ProblemReporter* r ) { m_problemReporter = r; }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_problemReporter->reportError( ex.getMessage().c_str(),
+ ex.getFilename().c_str(),
+ ex.getLine(),
+ ex.getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_problemReporter->reportError( errorMessage.c_str(),
+ getFilename().c_str(),
+ getLine(), getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){
+ m_problemReporter->reportWarning( warnMessage.c_str(),
+ getFilename().c_str(),
+ getLine(), getColumn() );
+ }
+#line 30 "PascalLexer.hpp"
+private:
+ void initLiterals();
+public:
+ bool getCaseSensitiveLiterals() const
+ {
+ return false;
+ }
+public:
+ PascalLexer(ANTLR_USE_NAMESPACE(std)istream& in);
+ PascalLexer(ANTLR_USE_NAMESPACE(antlr)InputBuffer& ib);
+ PascalLexer(const ANTLR_USE_NAMESPACE(antlr)LexerSharedInputState& state);
+ ANTLR_USE_NAMESPACE(antlr)RefToken nextToken();
+ public: void mPLUS(bool _createToken);
+ public: void mMINUS(bool _createToken);
+ public: void mSTAR(bool _createToken);
+ public: void mSLASH(bool _createToken);
+ public: void mASSIGN(bool _createToken);
+ public: void mCOMMA(bool _createToken);
+ public: void mSEMI(bool _createToken);
+ public: void mCOLON(bool _createToken);
+ public: void mEQUAL(bool _createToken);
+ public: void mNOT_EQUAL(bool _createToken);
+ public: void mLTH(bool _createToken);
+ public: void mLE(bool _createToken);
+ public: void mGE(bool _createToken);
+ public: void mGT(bool _createToken);
+ public: void mLPAREN(bool _createToken);
+ public: void mRPAREN(bool _createToken);
+ public: void mLBRACK(bool _createToken);
+ public: void mLBRACK2(bool _createToken);
+ public: void mRBRACK(bool _createToken);
+ public: void mRBRACK2(bool _createToken);
+ public: void mPOINTER(bool _createToken);
+ public: void mAT(bool _createToken);
+ public: void mDOT(bool _createToken);
+ public: void mLCURLY(bool _createToken);
+ public: void mRCURLY(bool _createToken);
+ public: void mPLUSEQ(bool _createToken);
+ public: void mMINUSEQ(bool _createToken);
+ public: void mSTAREQ(bool _createToken);
+ public: void mSLASHQE(bool _createToken);
+ public: void mWS(bool _createToken);
+ public: void mCOMMENT_1(bool _createToken);
+ public: void mCOMMENT_2(bool _createToken);
+ public: void mCOMMENT_3(bool _createToken);
+ public: void mIDENT(bool _createToken);
+ public: void mSTRING_LITERAL(bool _createToken);
+ public: void mNUM_INT(bool _createToken);
+ protected: void mEXPONENT(bool _createToken);
+private:
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+};
+
+#endif /*INC_PascalLexer_hpp_*/
diff --git a/languages/pascal/PascalParser.cpp b/languages/pascal/PascalParser.cpp
new file mode 100644
index 00000000..172f4a49
--- /dev/null
+++ b/languages/pascal/PascalParser.cpp
@@ -0,0 +1,9744 @@
+/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalParser.cpp"$ */
+#include "PascalParser.hpp"
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/ASTFactory.hpp>
+#line 1 "pascal.g"
+#line 8 "PascalParser.cpp"
+PascalParser::PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,k)
+{
+}
+
+PascalParser::PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(tokenBuf,2)
+{
+}
+
+PascalParser::PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,k)
+{
+}
+
+PascalParser::PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(lexer,2)
+{
+}
+
+PascalParser::PascalParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state)
+: ANTLR_USE_NAMESPACE(antlr)LLkParser(state,2)
+{
+}
+
+void PascalParser::compilationUnit() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST compilationUnit_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PROGRAM:
+ {
+ program();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ compilationUnit_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LIBRARY:
+ {
+ library();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ compilationUnit_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case UNIT:
+ {
+ unit();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ compilationUnit_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = compilationUnit_AST;
+}
+
+void PascalParser::program() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST program_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ programHeading();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case USES:
+ {
+ usesClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case BEGIN:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ block();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DOT);
+ program_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = program_AST;
+}
+
+void PascalParser::library() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST library_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp2_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp2_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp2_AST));
+ }
+ match(LIBRARY);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ {
+ switch ( LA(1)) {
+ case USES:
+ {
+ usesClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case EXPORTS:
+ case BEGIN:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ libraryBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exportsClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ match(DOT);
+ library_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = library_AST;
+}
+
+void PascalParser::unit() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST unit_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp6_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp6_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp6_AST));
+ }
+ match(UNIT);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ interfacePart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ implementationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case INITIALIZATION:
+ {
+ {
+ initializationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case FINALIZATION:
+ {
+ finalizationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ break;
+ }
+ case BEGIN:
+ {
+ realizationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(END);
+ unit_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unit_AST;
+}
+
+void PascalParser::programHeading() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST programHeading_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp9_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp9_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp9_AST));
+ }
+ match(PROGRAM);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ match(LPAREN);
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ programHeading_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_1);
+ } else {
+ throw;
+ }
+ }
+ returnAST = programHeading_AST;
+}
+
+void PascalParser::usesClause() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST usesClause_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp13_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp13_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp13_AST));
+ }
+ match(USES);
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ usesClause_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ } else {
+ throw;
+ }
+ }
+ returnAST = usesClause_AST;
+}
+
+void PascalParser::block() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST block_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ declarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statementPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ block_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_3);
+ } else {
+ throw;
+ }
+ }
+ returnAST = block_AST;
+}
+
+void PascalParser::identifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST identifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp15_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp15_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp15_AST));
+ }
+ match(IDENT);
+ identifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_4);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifier_AST;
+}
+
+void PascalParser::libraryBlock() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST libraryBlock_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ declarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ {
+ statementPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case EXPORTS:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ libraryBlock_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_5);
+ } else {
+ throw;
+ }
+ }
+ returnAST = libraryBlock_AST;
+}
+
+void PascalParser::exportsClause() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exportsClause_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp16_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp16_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp16_AST));
+ }
+ match(EXPORTS);
+ exportsList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exportsClause_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exportsClause_AST;
+}
+
+void PascalParser::declarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST declarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case LABEL:
+ {
+ labelDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CONST:
+ {
+ constantDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RESOURCESTRING:
+ {
+ resourcestringDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case TYPE:
+ {
+ typeDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case VAR:
+ {
+ variableDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ procedureAndFunctionDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop41;
+ }
+ }
+ }
+ _loop41:;
+ } // ( ... )*
+ declarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_7);
+ } else {
+ throw;
+ }
+ }
+ returnAST = declarationPart_AST;
+}
+
+void PascalParser::statementPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST statementPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ statementPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_3);
+ } else {
+ throw;
+ }
+ }
+ returnAST = statementPart_AST;
+}
+
+void PascalParser::exportsList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exportsList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ exportsEntry();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ exportsEntry();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop11;
+ }
+
+ }
+ _loop11:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case SEMI:
+ {
+ match(SEMI);
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exportsList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exportsList_AST;
+}
+
+void PascalParser::exportsEntry() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exportsEntry_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_index:
+ {
+ RefPascalAST tmp19_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp19_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp19_AST));
+ }
+ match(LITERAL_index);
+ integerConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case COMMA:
+ case LITERAL_name:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_name:
+ {
+ RefPascalAST tmp20_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp20_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp20_AST));
+ }
+ match(LITERAL_name);
+ stringConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case COMMA:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exportsEntry_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_8);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exportsEntry_AST;
+}
+
+void PascalParser::integerConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST integerConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST s_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST n_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case NUM_INT:
+ {
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ integerConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PLUS:
+ case MINUS:
+ {
+ sign();
+ if (inputState->guessing==0) {
+ s_AST = returnAST;
+ }
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ n_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ integerConstant_AST = RefPascalAST(currentAST.root);
+#line 880 "pascal.g"
+ integerConstant_AST=RefPascalAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST))));
+#line 780 "PascalParser.cpp"
+ currentAST.root = integerConstant_AST;
+ if ( integerConstant_AST!=RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ integerConstant_AST->getFirstChild() != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = integerConstant_AST->getFirstChild();
+ else
+ currentAST.child = integerConstant_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_9);
+ } else {
+ throw;
+ }
+ }
+ returnAST = integerConstant_AST;
+}
+
+void PascalParser::stringConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST stringConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case STRING_LITERAL:
+ {
+ string();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stringConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CHR:
+ {
+ constantChr();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stringConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_10);
+ } else {
+ throw;
+ }
+ }
+ returnAST = stringConstant_AST;
+}
+
+void PascalParser::identifierList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST identifierList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop378;
+ }
+
+ }
+ _loop378:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ identifierList_AST = RefPascalAST(currentAST.root);
+#line 867 "pascal.g"
+ identifierList_AST = RefPascalAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(IDLIST)))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(identifierList_AST))));
+#line 880 "PascalParser.cpp"
+ currentAST.root = identifierList_AST;
+ if ( identifierList_AST!=RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ identifierList_AST->getFirstChild() != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = identifierList_AST->getFirstChild();
+ else
+ currentAST.child = identifierList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ identifierList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_11);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifierList_AST;
+}
+
+void PascalParser::interfacePart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST interfacePart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp22_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp22_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp22_AST));
+ }
+ match(INTERFACE);
+ {
+ switch ( LA(1)) {
+ case USES:
+ {
+ usesClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IMPLEMENTATION:
+ case CONST:
+ case TYPE:
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case CONST:
+ {
+ constantDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case TYPE:
+ {
+ typeDeclarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ procedureHeadersPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ goto _loop24;
+ }
+ }
+ }
+ _loop24:;
+ } // ( ... )*
+ interfacePart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_12);
+ } else {
+ throw;
+ }
+ }
+ returnAST = interfacePart_AST;
+}
+
+void PascalParser::implementationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST implementationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp23_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp23_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp23_AST));
+ }
+ match(IMPLEMENTATION);
+ {
+ switch ( LA(1)) {
+ case USES:
+ {
+ usesClause();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case BEGIN:
+ case INITIALIZATION:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ declarationPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ implementationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_13);
+ } else {
+ throw;
+ }
+ }
+ returnAST = implementationPart_AST;
+}
+
+void PascalParser::initializationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST initializationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp24_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp24_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp24_AST));
+ }
+ match(INITIALIZATION);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop34;
+ }
+
+ }
+ _loop34:;
+ } // ( ... )*
+ initializationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_14);
+ } else {
+ throw;
+ }
+ }
+ returnAST = initializationPart_AST;
+}
+
+void PascalParser::finalizationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST finalizationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp26_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp26_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp26_AST));
+ }
+ match(FINALIZATION);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop37;
+ }
+
+ }
+ _loop37:;
+ } // ( ... )*
+ finalizationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = finalizationPart_AST;
+}
+
+void PascalParser::realizationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST realizationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp28_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp28_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp28_AST));
+ }
+ match(BEGIN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop29;
+ }
+
+ }
+ _loop29:;
+ } // ( ... )*
+ realizationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = realizationPart_AST;
+}
+
+void PascalParser::constantDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constantDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp30_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp30_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp30_AST));
+ }
+ match(CONST);
+ { // ( ... )+
+ int _cnt47=0;
+ for (;;) {
+ if ((LA(1) == IDENT) && (LA(2) == EQUAL)) {
+ constantDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ typedConstantDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt47>=1 ) { goto _loop47; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt47++;
+ }
+ _loop47:;
+ } // ( ... )+
+ constantDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constantDeclarationPart_AST;
+}
+
+void PascalParser::typeDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST typeDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp31_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp31_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp31_AST));
+ }
+ match(TYPE);
+ { // ( ... )+
+ int _cnt54=0;
+ for (;;) {
+ if ((LA(1) == IDENT)) {
+ typeDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt54>=1 ) { goto _loop54; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt54++;
+ }
+ _loop54:;
+ } // ( ... )+
+ typeDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_2);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typeDeclarationPart_AST;
+}
+
+void PascalParser::procedureHeadersPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureHeadersPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ procedureHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureHeadersPart_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ functionHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureHeadersPart_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_15);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureHeadersPart_AST;
+}
+
+void PascalParser::statement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST statement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case NUM_INT:
+ {
+ label();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ break;
+ }
+ case BEGIN:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case GOTO:
+ case RAISE:
+ case IDENT:
+ {
+ simpleStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case BEGIN:
+ case CASE:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case TRY:
+ {
+ structuredStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ statement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = statement_AST;
+}
+
+void PascalParser::labelDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST labelDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp33_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp33_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp33_AST));
+ }
+ match(LABEL);
+ label();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ label();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop44;
+ }
+
+ }
+ _loop44:;
+ } // ( ... )*
+ match(SEMI);
+ labelDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = labelDeclarationPart_AST;
+}
+
+void PascalParser::resourcestringDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST resourcestringDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp36_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp36_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp36_AST));
+ }
+ match(RESOURCESTRING);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == IDENT)) {
+ stringConstantDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop50;
+ }
+
+ }
+ _loop50:;
+ } // ( ... )*
+ resourcestringDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = resourcestringDeclarationPart_AST;
+}
+
+void PascalParser::variableDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variableDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp37_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp37_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp37_AST));
+ }
+ match(VAR);
+ variableDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI) && (LA(2) == IDENT)) {
+ match(SEMI);
+ variableDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop57;
+ }
+
+ }
+ _loop57:;
+ } // ( ... )*
+ match(SEMI);
+ variableDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variableDeclarationPart_AST;
+}
+
+void PascalParser::procedureAndFunctionDeclarationPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureAndFunctionDeclarationPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ procedureAndFunctionDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureAndFunctionDeclarationPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureAndFunctionDeclarationPart_AST;
+}
+
+void PascalParser::label() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST label_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ label_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_18);
+ } else {
+ throw;
+ }
+ }
+ returnAST = label_AST;
+}
+
+void PascalParser::constantDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constantDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(EQUAL);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ constantDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_19);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constantDeclaration_AST;
+}
+
+void PascalParser::typedConstantDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST typedConstantDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(EQUAL);
+ typedConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ typedConstantDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_19);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typedConstantDeclaration_AST;
+}
+
+void PascalParser::stringConstantDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST stringConstantDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(EQUAL);
+ string();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ stringConstantDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_20);
+ } else {
+ throw;
+ }
+ }
+ returnAST = stringConstantDeclaration_AST;
+}
+
+void PascalParser::string() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST string_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp46_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp46_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp46_AST));
+ }
+ match(STRING_LITERAL);
+ string_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_21);
+ } else {
+ throw;
+ }
+ }
+ returnAST = string_AST;
+}
+
+void PascalParser::typeDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST typeDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(EQUAL);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ typeDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_19);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typeDeclaration_AST;
+}
+
+void PascalParser::variableDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variableDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)RefToken c = ANTLR_USE_NAMESPACE(antlr)nullToken;
+ RefPascalAST c_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ c = LT(1);
+ if ( inputState->guessing == 0 ) {
+ c_AST = astFactory->create(c);
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(c_AST));
+ }
+ match(COLON);
+ if ( inputState->guessing==0 ) {
+#line 246 "pascal.g"
+ c_AST->setType(VARDECL);
+#line 1741 "PascalParser.cpp"
+ }
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ variableDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variableDeclaration_AST;
+}
+
+void PascalParser::type() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST type_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case INTEGER:
+ case SHORTINT:
+ case SMALLINT:
+ case LONGINT:
+ case INT64:
+ case BYTE:
+ case WORD:
+ case CARDINAL:
+ case QWORD:
+ case BOOLEAN:
+ case BYTEBOOL:
+ case LONGBOOL:
+ case CHAR:
+ case REAL:
+ case SINGLE:
+ case DOUBLE:
+ case EXTENDED:
+ case COMP:
+ {
+ simpleType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NUM_INT:
+ case PLUS:
+ case MINUS:
+ case STRING_LITERAL:
+ case CHR:
+ case NUM_REAL:
+ case IDENT:
+ {
+ subrangeTypeOrTypeIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LPAREN:
+ {
+ enumeratedType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case STRING:
+ {
+ stringType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case ARRAY:
+ case PACKED:
+ case RECORD:
+ case SET:
+ case FILE:
+ case OBJECT:
+ case CLASS:
+ {
+ structuredType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case POINTER:
+ {
+ pointerType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ proceduralType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ type_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = type_AST;
+}
+
+void PascalParser::procedureAndFunctionDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureAndFunctionDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PROCEDURE:
+ {
+ procedureDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureAndFunctionDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FUNCTION:
+ {
+ functionDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureAndFunctionDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CONSTRUCTOR:
+ {
+ constructorDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureAndFunctionDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case DESTRUCTOR:
+ {
+ destructorDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ procedureAndFunctionDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureAndFunctionDeclaration_AST;
+}
+
+void PascalParser::procedureDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ procedureHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subroutineBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ procedureDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureDeclaration_AST;
+}
+
+void PascalParser::functionDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST functionDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ functionHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subroutineBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ functionDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = functionDeclaration_AST;
+}
+
+void PascalParser::constructorDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constructorDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ constructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ subroutineBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constructorDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constructorDeclaration_AST;
+}
+
+void PascalParser::destructorDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST destructorDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ destructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ subroutineBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ destructorDeclaration_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_17);
+ } else {
+ throw;
+ }
+ }
+ returnAST = destructorDeclaration_AST;
+}
+
+void PascalParser::compoundStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST compoundStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if ((LA(1) == BEGIN) && (LA(2) == END)) {
+ match(BEGIN);
+ match(END);
+ compoundStatement_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == BEGIN) && (LA(2) == SEMI)) {
+ match(BEGIN);
+ { // ( ... )+
+ int _cnt312=0;
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ }
+ else {
+ if ( _cnt312>=1 ) { goto _loop312; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt312++;
+ }
+ _loop312:;
+ } // ( ... )+
+ match(END);
+ compoundStatement_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == BEGIN) && (_tokenSet_24.member(LA(2)))) {
+ match(BEGIN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ goto _loop315;
+ }
+
+ }
+ _loop315:;
+ } // ( ... )*
+ match(END);
+ compoundStatement_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_25);
+ } else {
+ throw;
+ }
+ }
+ returnAST = compoundStatement_AST;
+}
+
+void PascalParser::procedureHeader() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureHeader_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp61_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp61_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp61_AST));
+ }
+ match(PROCEDURE);
+ {
+ if ((LA(1) == IDENT) && (LA(2) == SEMI || LA(2) == LPAREN)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ qualifiedMethodIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop68;
+ }
+
+ }
+ _loop68:;
+ } // ( ... )*
+ procedureHeader_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_26);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureHeader_AST;
+}
+
+void PascalParser::subroutineBlock() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST subroutineBlock_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case BEGIN:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ block();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subroutineBlock_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case EXTERNAL:
+ {
+ externalDirective();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subroutineBlock_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FORWARD:
+ {
+ match(FORWARD);
+ subroutineBlock_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_27);
+ } else {
+ throw;
+ }
+ }
+ returnAST = subroutineBlock_AST;
+}
+
+void PascalParser::functionHeader() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST functionHeader_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched74 = false;
+ if (((LA(1) == FUNCTION) && (LA(2) == IDENT))) {
+ int _m74 = mark();
+ synPredMatched74 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(FUNCTION);
+ identifier();
+ match(COLON);
+ type();
+ match(SEMI);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched74 = false;
+ }
+ rewind(_m74);
+ inputState->guessing--;
+ }
+ if ( synPredMatched74 ) {
+ RefPascalAST tmp65_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp65_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp65_AST));
+ }
+ match(FUNCTION);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop76;
+ }
+
+ }
+ _loop76:;
+ } // ( ... )*
+ functionHeader_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched78 = false;
+ if (((LA(1) == FUNCTION) && (LA(2) == IDENT))) {
+ int _m78 = mark();
+ synPredMatched78 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(FUNCTION);
+ identifier();
+ match(COLON);
+ match(COLON);
+ identifier();
+ match(COLON);
+ type();
+ match(SEMI);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched78 = false;
+ }
+ rewind(_m78);
+ inputState->guessing--;
+ }
+ if ( synPredMatched78 ) {
+ RefPascalAST tmp69_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp69_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp69_AST));
+ }
+ match(FUNCTION);
+ qualifiedMethodIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop80;
+ }
+
+ }
+ _loop80:;
+ } // ( ... )*
+ functionHeader_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched82 = false;
+ if (((LA(1) == FUNCTION) && (LA(2) == IDENT))) {
+ int _m82 = mark();
+ synPredMatched82 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(FUNCTION);
+ identifier();
+ match(COLON);
+ match(COLON);
+ identifier();
+ match(LPAREN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched82 = false;
+ }
+ rewind(_m82);
+ inputState->guessing--;
+ }
+ if ( synPredMatched82 ) {
+ RefPascalAST tmp73_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp73_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp73_AST));
+ }
+ match(FUNCTION);
+ qualifiedMethodIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop84;
+ }
+
+ }
+ _loop84:;
+ } // ( ... )*
+ functionHeader_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == FUNCTION) && (LA(2) == IDENT)) {
+ RefPascalAST tmp77_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp77_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp77_AST));
+ }
+ match(FUNCTION);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop86;
+ }
+
+ }
+ _loop86:;
+ } // ( ... )*
+ functionHeader_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }}
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_26);
+ } else {
+ throw;
+ }
+ }
+ returnAST = functionHeader_AST;
+}
+
+void PascalParser::qualifiedMethodIdentifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST qualifiedMethodIdentifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ match(COLON);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ qualifiedMethodIdentifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_28);
+ } else {
+ throw;
+ }
+ }
+ returnAST = qualifiedMethodIdentifier_AST;
+}
+
+void PascalParser::formalParameterList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST formalParameterList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LPAREN);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop96;
+ }
+
+ }
+ _loop96:;
+ } // ( ... )*
+ match(RPAREN);
+ formalParameterList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_29);
+ } else {
+ throw;
+ }
+ }
+ returnAST = formalParameterList_AST;
+}
+
+void PascalParser::modifiers() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST modifiers_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PUBLIC:
+ {
+ match(PUBLIC);
+ modifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case ALIAS:
+ {
+ {
+ match(ALIAS);
+ stringConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ modifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case INTERRUPT:
+ {
+ match(INTERRUPT);
+ modifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ {
+ callModifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ modifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case EXPORT:
+ {
+ match(EXPORT);
+ modifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = modifiers_AST;
+}
+
+void PascalParser::externalDirective() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST externalDirective_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp90_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp90_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp90_AST));
+ }
+ match(EXTERNAL);
+ {
+ switch ( LA(1)) {
+ case STRING_LITERAL:
+ case CHR:
+ {
+ stringConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_name:
+ {
+ {
+ RefPascalAST tmp91_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp91_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp91_AST));
+ }
+ match(LITERAL_name);
+ stringConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ break;
+ }
+ case LITERAL_index:
+ {
+ {
+ RefPascalAST tmp92_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp92_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp92_AST));
+ }
+ match(LITERAL_index);
+ integerConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ break;
+ }
+ case ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE:
+ case SEMI:
+ case END:
+ case EXPORTS:
+ case BEGIN:
+ case INITIALIZATION:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case ANTLR_USE_NAMESPACE(antlr)Token::EOF_TYPE:
+ case SEMI:
+ case END:
+ case EXPORTS:
+ case BEGIN:
+ case INITIALIZATION:
+ case LABEL:
+ case CONST:
+ case RESOURCESTRING:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ externalDirective_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_27);
+ } else {
+ throw;
+ }
+ }
+ returnAST = externalDirective_AST;
+}
+
+void PascalParser::functionHeaderEnding() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST functionHeaderEnding_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case COLON:
+ {
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop91;
+ }
+
+ }
+ _loop91:;
+ } // ( ... )*
+ functionHeaderEnding_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LPAREN:
+ {
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PUBLIC && LA(1) <= FAR))) {
+ modifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ }
+ else {
+ goto _loop93;
+ }
+
+ }
+ _loop93:;
+ } // ( ... )*
+ functionHeaderEnding_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = functionHeaderEnding_AST;
+}
+
+void PascalParser::parameterDeclaration() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST parameterDeclaration_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ valueParameter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ parameterDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case VAR:
+ {
+ variableParameter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ parameterDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CONST:
+ {
+ constantParameter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ parameterDeclaration_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_30);
+ } else {
+ throw;
+ }
+ }
+ returnAST = parameterDeclaration_AST;
+}
+
+void PascalParser::valueParameter() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST valueParameter_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched100 = false;
+ if (((LA(1) == IDENT) && (LA(2) == COMMA || LA(2) == COLON))) {
+ int _m100 = mark();
+ synPredMatched100 = true;
+ inputState->guessing++;
+ try {
+ {
+ identifierList();
+ match(COLON);
+ match(ARRAY);
+ match(OF);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched100 = false;
+ }
+ rewind(_m100);
+ inputState->guessing--;
+ }
+ if ( synPredMatched100 ) {
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ match(ARRAY);
+ match(OF);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ valueParameter_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COMMA || LA(2) == COLON)) {
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ valueParameter_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_30);
+ } else {
+ throw;
+ }
+ }
+ returnAST = valueParameter_AST;
+}
+
+void PascalParser::variableParameter() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variableParameter_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp103_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp103_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp103_AST));
+ }
+ match(VAR);
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case COLON:
+ {
+ untypedParameterPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ variableParameter_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_30);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variableParameter_AST;
+}
+
+void PascalParser::constantParameter() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constantParameter_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp104_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp104_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp104_AST));
+ }
+ match(CONST);
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case COLON:
+ {
+ untypedParameterPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ constantParameter_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_30);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constantParameter_AST;
+}
+
+void PascalParser::untypedParameterPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST untypedParameterPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched105 = false;
+ if (((LA(1) == COLON) && (LA(2) == ARRAY))) {
+ int _m105 = mark();
+ synPredMatched105 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(COLON);
+ match(ARRAY);
+ match(OF);
+ type();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched105 = false;
+ }
+ rewind(_m105);
+ inputState->guessing--;
+ }
+ if ( synPredMatched105 ) {
+ match(COLON);
+ match(ARRAY);
+ match(OF);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ untypedParameterPart_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == COLON) && (_tokenSet_31.member(LA(2)))) {
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ untypedParameterPart_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_30);
+ } else {
+ throw;
+ }
+ }
+ returnAST = untypedParameterPart_AST;
+}
+
+void PascalParser::callModifiers() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST callModifiers_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case REGISTER:
+ {
+ match(REGISTER);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PASCAL:
+ {
+ match(PASCAL);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CDECL:
+ {
+ match(CDECL);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case STDCALL:
+ {
+ match(STDCALL);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case POPSTACK:
+ {
+ match(POPSTACK);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SAVEREGISTERS:
+ {
+ match(SAVEREGISTERS);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case INLINE:
+ {
+ match(INLINE);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SAFECALL:
+ {
+ match(SAFECALL);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NEAR:
+ {
+ match(NEAR);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FAR:
+ {
+ match(FAR);
+ callModifiers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = callModifiers_AST;
+}
+
+void PascalParser::expression() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST expression_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ simpleExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case EQUAL:
+ case LE:
+ case GE:
+ case LTH:
+ case GT:
+ case NOT_EQUAL:
+ case IN:
+ case IS:
+ {
+ expressionSign();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleExpression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DOT:
+ case SEMI:
+ case END:
+ case COMMA:
+ case RPAREN:
+ case FINALIZATION:
+ case OF:
+ case DOTDOT:
+ case RBRACK:
+ case THEN:
+ case ELSE:
+ case DO:
+ case UNTIL:
+ case TO:
+ case DOWNTO:
+ case RBRACK2:
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ expression_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_32);
+ } else {
+ throw;
+ }
+ }
+ returnAST = expression_AST;
+}
+
+void PascalParser::typedConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST typedConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched120 = false;
+ if (((_tokenSet_33.member(LA(1))) && (_tokenSet_34.member(LA(2))))) {
+ int _m120 = mark();
+ synPredMatched120 = true;
+ inputState->guessing++;
+ try {
+ {
+ constant();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched120 = false;
+ }
+ rewind(_m120);
+ inputState->guessing--;
+ }
+ if ( synPredMatched120 ) {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typedConstant_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched122 = false;
+ if (((LA(1) == LPAREN) && (LA(2) == IDENT))) {
+ int _m122 = mark();
+ synPredMatched122 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ identifier();
+ match(COLON);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched122 = false;
+ }
+ rewind(_m122);
+ inputState->guessing--;
+ }
+ if ( synPredMatched122 ) {
+ recordConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typedConstant_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched124 = false;
+ if (((LA(1) == LPAREN) && (_tokenSet_35.member(LA(2))))) {
+ int _m124 = mark();
+ synPredMatched124 = true;
+ inputState->guessing++;
+ try {
+ {
+ arrayConstant();
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched124 = false;
+ }
+ rewind(_m124);
+ inputState->guessing--;
+ }
+ if ( synPredMatched124 ) {
+ arrayConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typedConstant_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((_tokenSet_36.member(LA(1))) && (_tokenSet_37.member(LA(2)))) {
+ proceduralConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typedConstant_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }}
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typedConstant_AST;
+}
+
+void PascalParser::constant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST s_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST n_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST s2_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ RefPascalAST id_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case NUM_INT:
+ case NUM_REAL:
+ {
+ unsignedNumber();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case IDENT:
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ string();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CHR:
+ {
+ constantChr();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ if ((LA(1) == PLUS || LA(1) == MINUS) && (LA(2) == NUM_INT || LA(2) == NUM_REAL)) {
+ sign();
+ if (inputState->guessing==0) {
+ s_AST = returnAST;
+ }
+ unsignedNumber();
+ if (inputState->guessing==0) {
+ n_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ constant_AST = RefPascalAST(currentAST.root);
+#line 901 "pascal.g"
+ constant_AST=RefPascalAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(n_AST))));
+#line 3461 "PascalParser.cpp"
+ currentAST.root = constant_AST;
+ if ( constant_AST!=RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ constant_AST->getFirstChild() != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = constant_AST->getFirstChild();
+ else
+ currentAST.child = constant_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else if ((LA(1) == PLUS || LA(1) == MINUS) && (LA(2) == IDENT)) {
+ sign();
+ if (inputState->guessing==0) {
+ s2_AST = returnAST;
+ }
+ identifier();
+ if (inputState->guessing==0) {
+ id_AST = returnAST;
+ }
+ if ( inputState->guessing==0 ) {
+ constant_AST = RefPascalAST(currentAST.root);
+#line 903 "pascal.g"
+ constant_AST=RefPascalAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(s2_AST))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(id_AST))));
+#line 3484 "PascalParser.cpp"
+ currentAST.root = constant_AST;
+ if ( constant_AST!=RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ constant_AST->getFirstChild() != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = constant_AST->getFirstChild();
+ else
+ currentAST.child = constant_AST;
+ currentAST.advanceChildToEnd();
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_38);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constant_AST;
+}
+
+void PascalParser::recordConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST recordConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LPAREN);
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ }
+ else {
+ goto _loop134;
+ }
+
+ }
+ _loop134:;
+ } // ( ... )*
+ match(RPAREN);
+ recordConstant_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = recordConstant_AST;
+}
+
+void PascalParser::arrayConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST arrayConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LPAREN);
+ {
+ switch ( LA(1)) {
+ case NUM_INT:
+ case PLUS:
+ case MINUS:
+ case STRING_LITERAL:
+ case CHR:
+ case NUM_REAL:
+ case IDENT:
+ {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ arrayConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ {
+ switch ( LA(1)) {
+ case NUM_INT:
+ case PLUS:
+ case MINUS:
+ case STRING_LITERAL:
+ case CHR:
+ case NUM_REAL:
+ case IDENT:
+ {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case LPAREN:
+ {
+ arrayConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ goto _loop129;
+ }
+
+ }
+ _loop129:;
+ } // ( ... )*
+ match(RPAREN);
+ arrayConstant_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_39);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arrayConstant_AST;
+}
+
+void PascalParser::proceduralConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST proceduralConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ proceduralConstant_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = proceduralConstant_AST;
+}
+
+void PascalParser::addressConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST addressConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp127_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp127_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp127_AST));
+ }
+ match(NUM_INT);
+ addressConstant_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = addressConstant_AST;
+}
+
+void PascalParser::simpleType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST simpleType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case INTEGER:
+ case SHORTINT:
+ case SMALLINT:
+ case LONGINT:
+ case INT64:
+ case BYTE:
+ case WORD:
+ case CARDINAL:
+ case QWORD:
+ case BOOLEAN:
+ case BYTEBOOL:
+ case LONGBOOL:
+ case CHAR:
+ {
+ ordinalType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case REAL:
+ case SINGLE:
+ case DOUBLE:
+ case EXTENDED:
+ case COMP:
+ {
+ realType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = simpleType_AST;
+}
+
+void PascalParser::subrangeTypeOrTypeIdentifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST subrangeTypeOrTypeIdentifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case DOTDOT:
+ {
+ match(DOTDOT);
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ case EQUAL:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ subrangeTypeOrTypeIdentifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = subrangeTypeOrTypeIdentifier_AST;
+}
+
+void PascalParser::enumeratedType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST enumeratedType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched147 = false;
+ if (((LA(1) == LPAREN) && (LA(2) == IDENT))) {
+ int _m147 = mark();
+ synPredMatched147 = true;
+ inputState->guessing++;
+ try {
+ {
+ match(LPAREN);
+ identifier();
+ match(ASSIGN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched147 = false;
+ }
+ rewind(_m147);
+ inputState->guessing--;
+ }
+ if ( synPredMatched147 ) {
+ match(LPAREN);
+ assignedEnumList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ enumeratedType_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == LPAREN) && (LA(2) == IDENT)) {
+ match(LPAREN);
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ enumeratedType_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_40);
+ } else {
+ throw;
+ }
+ }
+ returnAST = enumeratedType_AST;
+}
+
+void PascalParser::stringType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST stringType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp133_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp133_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp133_AST));
+ }
+ match(STRING);
+ {
+ switch ( LA(1)) {
+ case LBRACK:
+ {
+ match(LBRACK);
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RBRACK);
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ case EQUAL:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ stringType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = stringType_AST;
+}
+
+void PascalParser::structuredType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST structuredType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case PACKED:
+ {
+ match(PACKED);
+ break;
+ }
+ case ARRAY:
+ case RECORD:
+ case SET:
+ case FILE:
+ case OBJECT:
+ case CLASS:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case ARRAY:
+ {
+ arrayType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RECORD:
+ {
+ recordType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case OBJECT:
+ {
+ objectType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CLASS:
+ {
+ classType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SET:
+ {
+ setType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case FILE:
+ {
+ fileType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ structuredType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = structuredType_AST;
+}
+
+void PascalParser::pointerType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST pointerType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp137_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp137_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp137_AST));
+ }
+ match(POINTER);
+ typeIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ pointerType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = pointerType_AST;
+}
+
+void PascalParser::proceduralType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST proceduralType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched185 = false;
+ if (((LA(1) == PROCEDURE || LA(1) == FUNCTION) && (LA(2) == IDENT))) {
+ int _m185 = mark();
+ synPredMatched185 = true;
+ inputState->guessing++;
+ try {
+ {
+ proceduralTypePart1();
+ match(SEMI);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched185 = false;
+ }
+ rewind(_m185);
+ inputState->guessing--;
+ }
+ if ( synPredMatched185 ) {
+ proceduralTypePart1();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ callModifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ proceduralType_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == PROCEDURE || LA(1) == FUNCTION) && (LA(2) == IDENT)) {
+ proceduralTypePart1();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ proceduralType_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = proceduralType_AST;
+}
+
+void PascalParser::ordinalType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST ordinalType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case INTEGER:
+ {
+ match(INTEGER);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SHORTINT:
+ {
+ match(SHORTINT);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SMALLINT:
+ {
+ match(SMALLINT);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LONGINT:
+ {
+ match(LONGINT);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case INT64:
+ {
+ match(INT64);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case BYTE:
+ {
+ match(BYTE);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case WORD:
+ {
+ match(WORD);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CARDINAL:
+ {
+ match(CARDINAL);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case QWORD:
+ {
+ match(QWORD);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case BOOLEAN:
+ {
+ match(BOOLEAN);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case BYTEBOOL:
+ {
+ match(BYTEBOOL);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LONGBOOL:
+ {
+ match(LONGBOOL);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CHAR:
+ {
+ match(CHAR);
+ ordinalType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_40);
+ } else {
+ throw;
+ }
+ }
+ returnAST = ordinalType_AST;
+}
+
+void PascalParser::realType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST realType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case REAL:
+ {
+ match(REAL);
+ realType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SINGLE:
+ {
+ match(SINGLE);
+ realType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case DOUBLE:
+ {
+ match(DOUBLE);
+ realType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case EXTENDED:
+ {
+ match(EXTENDED);
+ realType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case COMP:
+ {
+ match(COMP);
+ realType_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = realType_AST;
+}
+
+void PascalParser::typeIdentifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST typeIdentifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ typeIdentifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_41);
+ } else {
+ throw;
+ }
+ }
+ returnAST = typeIdentifier_AST;
+}
+
+void PascalParser::subrangeType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST subrangeType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DOTDOT);
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ subrangeType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = subrangeType_AST;
+}
+
+void PascalParser::assignedEnumList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST assignedEnumList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(ASSIGN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(ASSIGN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ }
+ else {
+ goto _loop152;
+ }
+
+ }
+ _loop152:;
+ } // ( ... )*
+ assignedEnumList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_42);
+ } else {
+ throw;
+ }
+ }
+ returnAST = assignedEnumList_AST;
+}
+
+void PascalParser::unsignedInteger() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST unsignedInteger_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp161_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp161_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp161_AST));
+ }
+ match(NUM_INT);
+ unsignedInteger_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_43);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unsignedInteger_AST;
+}
+
+void PascalParser::arrayType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST arrayType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp162_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp162_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp162_AST));
+ }
+ match(ARRAY);
+ match(LBRACK);
+ arrayIndexType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ arrayIndexType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop161;
+ }
+
+ }
+ _loop161:;
+ } // ( ... )*
+ match(RBRACK);
+ match(OF);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ arrayType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arrayType_AST;
+}
+
+void PascalParser::recordType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST recordType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp167_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp167_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp167_AST));
+ }
+ match(RECORD);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == CASE || LA(1) == IDENT)) {
+ fieldList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop168;
+ }
+
+ }
+ _loop168:;
+ } // ( ... )*
+ match(END);
+ recordType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = recordType_AST;
+}
+
+void PascalParser::objectType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST objectType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp169_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp169_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp169_AST));
+ }
+ match(OBJECT);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ heritage();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case PUBLIC:
+ case PRIVATE:
+ case PROTECTED:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case IDENT:
+ {
+ componentList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PUBLIC:
+ case PRIVATE:
+ case PROTECTED:
+ {
+ objectVisibilitySpecifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(END);
+ objectType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = objectType_AST;
+}
+
+void PascalParser::classType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST classType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp171_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp171_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp171_AST));
+ }
+ match(CLASS);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ heritage();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case PUBLIC:
+ case PRIVATE:
+ case PROTECTED:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PUBLISHED:
+ case PROPERTY:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ case IDENT:
+ {
+ classComponentList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PUBLIC:
+ case PRIVATE:
+ case PROTECTED:
+ case PUBLISHED:
+ {
+ classVisibilitySpecifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(END);
+ classType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classType_AST;
+}
+
+void PascalParser::setType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST setType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp173_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp173_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp173_AST));
+ }
+ match(SET);
+ match(OF);
+ ordinalType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ setType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = setType_AST;
+}
+
+void PascalParser::fileType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST fileType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp175_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp175_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp175_AST));
+ }
+ match(FILE);
+ match(OF);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ fileType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = fileType_AST;
+}
+
+void PascalParser::arrayIndexType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST arrayIndexType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if (((LA(1) >= INTEGER && LA(1) <= CHAR))) {
+ ordinalType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ arrayIndexType_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched164 = false;
+ if (((_tokenSet_36.member(LA(1))) && (_tokenSet_44.member(LA(2))))) {
+ int _m164 = mark();
+ synPredMatched164 = true;
+ inputState->guessing++;
+ try {
+ {
+ expression();
+ match(DOTDOT);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched164 = false;
+ }
+ rewind(_m164);
+ inputState->guessing--;
+ }
+ if ( synPredMatched164 ) {
+ arraySubrangeType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ arrayIndexType_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == LPAREN) && (LA(2) == IDENT)) {
+ enumeratedType();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ arrayIndexType_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_45);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arrayIndexType_AST;
+}
+
+void PascalParser::arraySubrangeType() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST arraySubrangeType_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DOTDOT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ arraySubrangeType_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_45);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arraySubrangeType_AST;
+}
+
+void PascalParser::fieldList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST fieldList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ fixedField();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ fieldList_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CASE:
+ {
+ variantPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ fieldList_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_46);
+ } else {
+ throw;
+ }
+ }
+ returnAST = fieldList_AST;
+}
+
+void PascalParser::fixedField() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST fixedField_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ fixedField_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_46);
+ } else {
+ throw;
+ }
+ }
+ returnAST = fixedField_AST;
+}
+
+void PascalParser::variantPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variantPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp180_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp180_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp180_AST));
+ }
+ match(CASE);
+ {
+ if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == OF)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(OF);
+ variant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ variant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop174;
+ }
+
+ }
+ _loop174:;
+ } // ( ... )*
+ variantPart_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_46);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variantPart_AST;
+}
+
+void PascalParser::variant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt177=0;
+ for (;;) {
+ if ((_tokenSet_33.member(LA(1)))) {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COMMA);
+ }
+ else {
+ if ( _cnt177>=1 ) { goto _loop177; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt177++;
+ }
+ _loop177:;
+ } // ( ... )+
+ match(COLON);
+ match(LPAREN);
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == CASE || LA(1) == IDENT)) {
+ fieldList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop179;
+ }
+
+ }
+ _loop179:;
+ } // ( ... )*
+ match(RPAREN);
+ variant_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_47);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variant_AST;
+}
+
+void PascalParser::proceduralTypePart1() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST proceduralTypePart1_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case FUNCTION:
+ {
+ functionHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ {
+ procedureHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case OF:
+ {
+ match(OF);
+ match(OBJECT);
+ break;
+ }
+ case SEMI:
+ case RPAREN:
+ case EQUAL:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ proceduralTypePart1_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_23);
+ } else {
+ throw;
+ }
+ }
+ returnAST = proceduralTypePart1_AST;
+}
+
+void PascalParser::heritage() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST heritage_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LPAREN);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ heritage_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_48);
+ } else {
+ throw;
+ }
+ }
+ returnAST = heritage_AST;
+}
+
+void PascalParser::componentList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST componentList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ { // ( ... )+
+ int _cnt196=0;
+ for (;;) {
+ if ((LA(1) == IDENT)) {
+ fieldDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt196>=1 ) { goto _loop196; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt196++;
+ }
+ _loop196:;
+ } // ( ... )+
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ { // ( ... )+
+ int _cnt199=0;
+ for (;;) {
+ if ((_tokenSet_49.member(LA(1)))) {
+ methodDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt199>=1 ) { goto _loop199; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt199++;
+ }
+ _loop199:;
+ } // ( ... )+
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ componentList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = componentList_AST;
+}
+
+void PascalParser::objectVisibilitySpecifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST objectVisibilitySpecifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ objectVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PROTECTED:
+ {
+ match(PROTECTED);
+ objectVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PUBLIC:
+ {
+ match(PUBLIC);
+ objectVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = objectVisibilitySpecifier_AST;
+}
+
+void PascalParser::fieldDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST fieldDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifierList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ fieldDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_50);
+ } else {
+ throw;
+ }
+ }
+ returnAST = fieldDefinition_AST;
+}
+
+void PascalParser::methodDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST methodDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case FUNCTION:
+ {
+ functionHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ {
+ procedureHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case CONSTRUCTOR:
+ {
+ constructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DESTRUCTOR:
+ {
+ destructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ methodDirectives();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ methodDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_51);
+ } else {
+ throw;
+ }
+ }
+ returnAST = methodDefinition_AST;
+}
+
+void PascalParser::constructorHeader() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constructorHeader_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp198_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp198_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp198_AST));
+ }
+ match(CONSTRUCTOR);
+ {
+ if ((LA(1) == IDENT) && (LA(2) == LPAREN)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ qualifiedMethodIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ constructorHeader_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constructorHeader_AST;
+}
+
+void PascalParser::destructorHeader() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST destructorHeader_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp199_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp199_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp199_AST));
+ }
+ match(DESTRUCTOR);
+ {
+ if ((LA(1) == IDENT) && (LA(2) == LPAREN)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ qualifiedMethodIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ destructorHeader_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = destructorHeader_AST;
+}
+
+void PascalParser::methodDirectives() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST methodDirectives_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case VIRTUAL:
+ {
+ match(VIRTUAL);
+ match(SEMI);
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ match(ABSTRACT);
+ match(SEMI);
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ {
+ callModifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ methodDirectives_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_51);
+ } else {
+ throw;
+ }
+ }
+ returnAST = methodDirectives_AST;
+}
+
+void PascalParser::classComponentList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST classComponentList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ { // ( ... )+
+ int _cnt220=0;
+ for (;;) {
+ if ((LA(1) == IDENT)) {
+ fieldDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ if ( _cnt220>=1 ) { goto _loop220; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt220++;
+ }
+ _loop220:;
+ } // ( ... )+
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ { // ( ... )+
+ int _cnt224=0;
+ for (;;) {
+ if ((_tokenSet_52.member(LA(1)))) {
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ {
+ classMethodDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROPERTY:
+ {
+ propertyDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ if ( _cnt224>=1 ) { goto _loop224; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());}
+ }
+
+ _cnt224++;
+ }
+ _loop224:;
+ } // ( ... )+
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ classComponentList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classComponentList_AST;
+}
+
+void PascalParser::classVisibilitySpecifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST classVisibilitySpecifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PRIVATE:
+ {
+ match(PRIVATE);
+ classVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PROTECTED:
+ {
+ match(PROTECTED);
+ classVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PUBLIC:
+ {
+ match(PUBLIC);
+ classVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PUBLISHED:
+ {
+ match(PUBLISHED);
+ classVisibilitySpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classVisibilitySpecifier_AST;
+}
+
+void PascalParser::classMethodDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST classMethodDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case PROCEDURE:
+ case FUNCTION:
+ case CLASS:
+ {
+ {
+ {
+ switch ( LA(1)) {
+ case CLASS:
+ {
+ match(CLASS);
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case FUNCTION:
+ {
+ functionHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PROCEDURE:
+ {
+ procedureHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ break;
+ }
+ case CONSTRUCTOR:
+ {
+ constructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case DESTRUCTOR:
+ {
+ destructorHeader();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(SEMI);
+ classMethodDirectives();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ classMethodDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classMethodDefinition_AST;
+}
+
+void PascalParser::propertyDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST propertyDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp211_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp211_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp211_AST));
+ }
+ match(PROPERTY);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case COLON:
+ case LBRACK:
+ {
+ propertyInterface();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ case LITERAL_read:
+ case LITERAL_write:
+ case DEFAULT:
+ case LITERAL_nodefault:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ propertySpecifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ propertyDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = propertyDefinition_AST;
+}
+
+void PascalParser::classMethodDirectives() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST classMethodDirectives_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case VIRTUAL:
+ case OVERRIDE:
+ case MESSAGE:
+ {
+ directiveVariants();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case REGISTER:
+ case PASCAL:
+ case CDECL:
+ case STDCALL:
+ case POPSTACK:
+ case SAVEREGISTERS:
+ case INLINE:
+ case SAFECALL:
+ case NEAR:
+ case FAR:
+ {
+ callModifiers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ classMethodDirectives_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = classMethodDirectives_AST;
+}
+
+void PascalParser::directiveVariants() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST directiveVariants_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case VIRTUAL:
+ {
+ {
+ match(VIRTUAL);
+ {
+ switch ( LA(1)) {
+ case ABSTRACT:
+ {
+ match(ABSTRACT);
+ match(SEMI);
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ directiveVariants_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case OVERRIDE:
+ {
+ match(OVERRIDE);
+ directiveVariants_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case MESSAGE:
+ {
+ {
+ match(MESSAGE);
+ {
+ switch ( LA(1)) {
+ case NUM_INT:
+ case PLUS:
+ case MINUS:
+ {
+ integerConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case STRING_LITERAL:
+ case CHR:
+ {
+ stringConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ directiveVariants_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_22);
+ } else {
+ throw;
+ }
+ }
+ returnAST = directiveVariants_AST;
+}
+
+void PascalParser::propertyInterface() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST propertyInterface_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LBRACK:
+ {
+ propertyParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case COLON:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(COLON);
+ typeIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_index:
+ {
+ RefPascalAST tmp220_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp220_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp220_AST));
+ }
+ match(LITERAL_index);
+ integerConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ case LITERAL_read:
+ case LITERAL_write:
+ case DEFAULT:
+ case LITERAL_nodefault:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ propertyInterface_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_54);
+ } else {
+ throw;
+ }
+ }
+ returnAST = propertyInterface_AST;
+}
+
+void PascalParser::propertySpecifiers() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST propertySpecifiers_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case LITERAL_read:
+ {
+ readSpecifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ case LITERAL_write:
+ case DEFAULT:
+ case LITERAL_nodefault:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case LITERAL_write:
+ {
+ writeSpecifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ case DEFAULT:
+ case LITERAL_nodefault:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ switch ( LA(1)) {
+ case DEFAULT:
+ case LITERAL_nodefault:
+ {
+ defaultSpecifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ propertySpecifiers_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = propertySpecifiers_AST;
+}
+
+void PascalParser::propertyParameterList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST propertyParameterList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LBRACK);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ parameterDeclaration();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop246;
+ }
+
+ }
+ _loop246:;
+ } // ( ... )*
+ match(RBRACK);
+ propertyParameterList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_55);
+ } else {
+ throw;
+ }
+ }
+ returnAST = propertyParameterList_AST;
+}
+
+void PascalParser::readSpecifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST readSpecifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp224_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp224_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp224_AST));
+ }
+ match(LITERAL_read);
+ fieldOrMethod();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ readSpecifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_56);
+ } else {
+ throw;
+ }
+ }
+ returnAST = readSpecifier_AST;
+}
+
+void PascalParser::writeSpecifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST writeSpecifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp225_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp225_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp225_AST));
+ }
+ match(LITERAL_write);
+ fieldOrMethod();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ writeSpecifier_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_57);
+ } else {
+ throw;
+ }
+ }
+ returnAST = writeSpecifier_AST;
+}
+
+void PascalParser::defaultSpecifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST defaultSpecifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case DEFAULT:
+ {
+ {
+ RefPascalAST tmp226_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp226_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp226_AST));
+ }
+ match(DEFAULT);
+ {
+ switch ( LA(1)) {
+ case NUM_INT:
+ case PLUS:
+ case MINUS:
+ case STRING_LITERAL:
+ case CHR:
+ case NUM_REAL:
+ case IDENT:
+ {
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ case PROCEDURE:
+ case FUNCTION:
+ case CONSTRUCTOR:
+ case DESTRUCTOR:
+ case CLASS:
+ case PROPERTY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ defaultSpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LITERAL_nodefault:
+ {
+ RefPascalAST tmp227_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp227_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp227_AST));
+ }
+ match(LITERAL_nodefault);
+ defaultSpecifier_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_53);
+ } else {
+ throw;
+ }
+ }
+ returnAST = defaultSpecifier_AST;
+}
+
+void PascalParser::fieldOrMethod() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST fieldOrMethod_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ fieldOrMethod_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_56);
+ } else {
+ throw;
+ }
+ }
+ returnAST = fieldOrMethod_AST;
+}
+
+void PascalParser::simpleExpression() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST simpleExpression_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= PLUS && LA(1) <= XOR))) {
+ {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ match(PLUS);
+ break;
+ }
+ case MINUS:
+ {
+ match(MINUS);
+ break;
+ }
+ case OR:
+ {
+ match(OR);
+ break;
+ }
+ case XOR:
+ {
+ match(XOR);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ term();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop263;
+ }
+
+ }
+ _loop263:;
+ } // ( ... )*
+ simpleExpression_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_58);
+ } else {
+ throw;
+ }
+ }
+ returnAST = simpleExpression_AST;
+}
+
+void PascalParser::expressionSign() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST expressionSign_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LE:
+ {
+ match(LE);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case GE:
+ {
+ match(GE);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LTH:
+ {
+ match(LTH);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case GT:
+ {
+ match(GT);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ match(NOT_EQUAL);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case IN:
+ {
+ match(IN);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case IS:
+ {
+ match(IS);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case EQUAL:
+ {
+ match(EQUAL);
+ expressionSign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_36);
+ } else {
+ throw;
+ }
+ }
+ returnAST = expressionSign_AST;
+}
+
+void PascalParser::term() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST term_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if (((LA(1) >= STAR && LA(1) <= SHR))) {
+ {
+ switch ( LA(1)) {
+ case STAR:
+ {
+ match(STAR);
+ break;
+ }
+ case SLASH:
+ {
+ match(SLASH);
+ break;
+ }
+ case DIV:
+ {
+ match(DIV);
+ break;
+ }
+ case MOD:
+ {
+ match(MOD);
+ break;
+ }
+ case AND:
+ {
+ match(AND);
+ break;
+ }
+ case SHL:
+ {
+ match(SHL);
+ break;
+ }
+ case SHR:
+ {
+ match(SHR);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop267;
+ }
+
+ }
+ _loop267:;
+ } // ( ... )*
+ term_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_59);
+ } else {
+ throw;
+ }
+ }
+ returnAST = term_AST;
+}
+
+void PascalParser::factor() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST factor_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ {
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NUM_INT:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ {
+ unsignedConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NOT:
+ {
+ {
+ match(NOT);
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PLUS:
+ case MINUS:
+ {
+ {
+ {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ match(PLUS);
+ break;
+ }
+ case MINUS:
+ {
+ match(MINUS);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ factor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case LBRACK:
+ {
+ setConstructor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case AT:
+ {
+ addressFactor();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case TRUE:
+ {
+ RefPascalAST tmp252_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp252_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp252_AST));
+ }
+ match(TRUE);
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FALSE:
+ {
+ RefPascalAST tmp253_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp253_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp253_AST));
+ }
+ match(FALSE);
+ factor_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ if ((LA(1) == IDENT) && (_tokenSet_60.member(LA(2)))) {
+ identifierOrValueTypecastOrFunctionCall();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ factor_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == LBRACK)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LBRACK);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop274;
+ }
+
+ }
+ _loop274:;
+ } // ( ... )*
+ match(RBRACK);
+ factor_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = factor_AST;
+}
+
+void PascalParser::identifierOrValueTypecastOrFunctionCall() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST identifierOrValueTypecastOrFunctionCall_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ bool synPredMatched277 = false;
+ if (((LA(1) == IDENT) && (LA(2) == LPAREN))) {
+ int _m277 = mark();
+ synPredMatched277 = true;
+ inputState->guessing++;
+ try {
+ {
+ identifier();
+ match(LPAREN);
+ expression();
+ match(COMMA);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched277 = false;
+ }
+ rewind(_m277);
+ inputState->guessing--;
+ }
+ if ( synPredMatched277 ) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LPAREN);
+ expressions();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ identifierOrValueTypecastOrFunctionCall_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ bool synPredMatched279 = false;
+ if (((LA(1) == IDENT) && (LA(2) == LPAREN))) {
+ int _m279 = mark();
+ synPredMatched279 = true;
+ inputState->guessing++;
+ try {
+ {
+ identifier();
+ match(LPAREN);
+ expression();
+ match(RPAREN);
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& pe) {
+ synPredMatched279 = false;
+ }
+ rewind(_m279);
+ inputState->guessing--;
+ }
+ if ( synPredMatched279 ) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ identifierOrValueTypecastOrFunctionCall_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (_tokenSet_61.member(LA(2)))) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ identifierOrValueTypecastOrFunctionCall_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifierOrValueTypecastOrFunctionCall_AST;
+}
+
+void PascalParser::unsignedConstant() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST unsignedConstant_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case NUM_INT:
+ case NUM_REAL:
+ {
+ unsignedNumber();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unsignedConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CHR:
+ {
+ constantChr();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unsignedConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ string();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unsignedConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NIL:
+ {
+ match(NIL);
+ unsignedConstant_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unsignedConstant_AST;
+}
+
+void PascalParser::setConstructor() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST setConstructor_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LBRACK);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ case NUM_INT:
+ case LBRACK:
+ case PLUS:
+ case MINUS:
+ case NOT:
+ case TRUE:
+ case FALSE:
+ case AT:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ case IDENT:
+ {
+ setGroup();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ setGroup();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop290;
+ }
+
+ }
+ _loop290:;
+ } // ( ... )*
+ break;
+ }
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RBRACK);
+ setConstructor_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = setConstructor_AST;
+}
+
+void PascalParser::addressFactor() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST addressFactor_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(AT);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ addressFactor_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_61);
+ } else {
+ throw;
+ }
+ }
+ returnAST = addressFactor_AST;
+}
+
+void PascalParser::expressions() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST expressions_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop286;
+ }
+
+ }
+ _loop286:;
+ } // ( ... )*
+ expressions_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_42);
+ } else {
+ throw;
+ }
+ }
+ returnAST = expressions_AST;
+}
+
+void PascalParser::functionCall() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST functionCall_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ actualParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case FINALIZATION:
+ case AT:
+ case ELSE:
+ case UNTIL:
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ functionCall_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_62);
+ } else {
+ throw;
+ }
+ }
+ returnAST = functionCall_AST;
+}
+
+void PascalParser::actualParameterList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST actualParameterList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(LPAREN);
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ case NUM_INT:
+ case LBRACK:
+ case PLUS:
+ case MINUS:
+ case NOT:
+ case TRUE:
+ case FALSE:
+ case AT:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ case IDENT:
+ {
+ expressions();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RPAREN);
+ actualParameterList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_62);
+ } else {
+ throw;
+ }
+ }
+ returnAST = actualParameterList_AST;
+}
+
+void PascalParser::setGroup() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST setGroup_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case DOT:
+ {
+ match(DOT);
+ match(DOT);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case COMMA:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ setGroup_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_45);
+ } else {
+ throw;
+ }
+ }
+ returnAST = setGroup_AST;
+}
+
+void PascalParser::valueTypecast() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST valueTypecast_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ typeIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LPAREN);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ valueTypecast_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = valueTypecast_AST;
+}
+
+void PascalParser::simpleStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST simpleStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case GOTO:
+ {
+ gotoStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case RAISE:
+ {
+ raiseStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ if ((LA(1) == IDENT) && (_tokenSet_63.member(LA(2)))) {
+ assignmentStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleStatement_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (_tokenSet_64.member(LA(2)))) {
+ procedureStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ simpleStatement_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = simpleStatement_AST;
+}
+
+void PascalParser::structuredStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST structuredStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case BEGIN:
+ {
+ compoundStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ structuredStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ {
+ repetitiveStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ structuredStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CASE:
+ case IF:
+ {
+ conditionalStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ structuredStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case TRY:
+ {
+ exceptionStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ structuredStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case WITH:
+ {
+ withStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ structuredStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = structuredStatement_AST;
+}
+
+void PascalParser::assignmentStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST assignmentStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifierOrArrayIdentifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ assignmentOperator();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ assignmentStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = assignmentStatement_AST;
+}
+
+void PascalParser::procedureStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST procedureStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case LPAREN:
+ {
+ actualParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case FINALIZATION:
+ case ELSE:
+ case UNTIL:
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ procedureStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = procedureStatement_AST;
+}
+
+void PascalParser::gotoStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST gotoStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(GOTO);
+ label();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ gotoStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = gotoStatement_AST;
+}
+
+void PascalParser::raiseStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST raiseStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp274_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp274_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp274_AST));
+ }
+ match(RAISE);
+ {
+ switch ( LA(1)) {
+ case IDENT:
+ {
+ functionCall();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case AT:
+ {
+ match(AT);
+ addressConstant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case FINALIZATION:
+ case ELSE:
+ case UNTIL:
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ case END:
+ case FINALIZATION:
+ case ELSE:
+ case UNTIL:
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ raiseStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = raiseStatement_AST;
+}
+
+void PascalParser::identifierOrArrayIdentifier() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST identifierOrArrayIdentifier_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ if ((LA(1) == IDENT) && (_tokenSet_65.member(LA(2)))) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ identifierOrArrayIdentifier_AST = RefPascalAST(currentAST.root);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == LBRACK)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(LBRACK);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop302;
+ }
+
+ }
+ _loop302:;
+ } // ( ... )*
+ match(RBRACK);
+ identifierOrArrayIdentifier_AST = RefPascalAST(currentAST.root);
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_65);
+ } else {
+ throw;
+ }
+ }
+ returnAST = identifierOrArrayIdentifier_AST;
+}
+
+void PascalParser::assignmentOperator() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST assignmentOperator_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ match(ASSIGN);
+ assignmentOperator_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case PLUSEQ:
+ {
+ RefPascalAST tmp280_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp280_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp280_AST));
+ }
+ match(PLUSEQ);
+ assignmentOperator_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case MINUSEQ:
+ {
+ RefPascalAST tmp281_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp281_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp281_AST));
+ }
+ match(MINUSEQ);
+ assignmentOperator_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case STAREQ:
+ {
+ RefPascalAST tmp282_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp282_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp282_AST));
+ }
+ match(STAREQ);
+ assignmentOperator_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case SLASHQE:
+ {
+ RefPascalAST tmp283_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp283_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp283_AST));
+ }
+ match(SLASHQE);
+ assignmentOperator_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_36);
+ } else {
+ throw;
+ }
+ }
+ returnAST = assignmentOperator_AST;
+}
+
+void PascalParser::repetitiveStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST repetitiveStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case FOR:
+ {
+ forStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ repetitiveStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case REPEAT:
+ {
+ repeatStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ repetitiveStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case WHILE:
+ {
+ whileStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ repetitiveStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = repetitiveStatement_AST;
+}
+
+void PascalParser::conditionalStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST conditionalStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case IF:
+ {
+ ifStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ conditionalStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case CASE:
+ {
+ caseStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ conditionalStatement_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = conditionalStatement_AST;
+}
+
+void PascalParser::exceptionStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exceptionStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ tryStatement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exceptionStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exceptionStatement_AST;
+}
+
+void PascalParser::withStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST withStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp284_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp284_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp284_AST));
+ }
+ match(WITH);
+ recordVariableList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DO);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ withStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = withStatement_AST;
+}
+
+void PascalParser::ifStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST ifStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp286_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp286_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp286_AST));
+ }
+ match(IF);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(THEN);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ if ((LA(1) == ELSE) && (_tokenSet_24.member(LA(2)))) {
+ match(ELSE);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else if ((_tokenSet_16.member(LA(1))) && (_tokenSet_66.member(LA(2)))) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ ifStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = ifStatement_AST;
+}
+
+void PascalParser::caseStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST caseStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp289_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp289_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp289_AST));
+ }
+ match(CASE);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(OF);
+ caseListElement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI) && (_tokenSet_33.member(LA(2)))) {
+ match(SEMI);
+ caseListElement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop320;
+ }
+
+ }
+ _loop320:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case SEMI:
+ {
+ match(SEMI);
+ match(ELSE);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop323;
+ }
+
+ }
+ _loop323:;
+ } // ( ... )*
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(END);
+ caseStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = caseStatement_AST;
+}
+
+void PascalParser::forStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST forStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp296_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp296_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp296_AST));
+ }
+ match(FOR);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(ASSIGN);
+ forList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DO);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ forStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = forStatement_AST;
+}
+
+void PascalParser::repeatStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST repeatStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp299_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp299_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp299_AST));
+ }
+ match(REPEAT);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case SEMI:
+ case UNTIL:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else {
+ goto _loop332;
+ }
+
+ }
+ _loop332:;
+ } // ( ... )*
+ match(UNTIL);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ repeatStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = repeatStatement_AST;
+}
+
+void PascalParser::whileStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST whileStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp302_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp302_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp302_AST));
+ }
+ match(WHILE);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DO);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ whileStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = whileStatement_AST;
+}
+
+void PascalParser::caseListElement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST caseListElement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ constList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ RefPascalAST tmp304_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp304_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp304_AST));
+ }
+ match(COLON);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ caseListElement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_67);
+ } else {
+ throw;
+ }
+ }
+ returnAST = caseListElement_AST;
+}
+
+void PascalParser::constList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ constant();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop327;
+ }
+
+ }
+ _loop327:;
+ } // ( ... )*
+ if ( inputState->guessing==0 ) {
+ constList_AST = RefPascalAST(currentAST.root);
+#line 746 "pascal.g"
+ constList_AST = RefPascalAST(astFactory->make((new ANTLR_USE_NAMESPACE(antlr)ASTArray(2))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(astFactory->create(CONSTLIST)))->add(ANTLR_USE_NAMESPACE(antlr)RefAST(constList_AST))));
+#line 8219 "PascalParser.cpp"
+ currentAST.root = constList_AST;
+ if ( constList_AST!=RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) &&
+ constList_AST->getFirstChild() != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ currentAST.child = constList_AST->getFirstChild();
+ else
+ currentAST.child = constList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ constList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_55);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constList_AST;
+}
+
+void PascalParser::forList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST forList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ initialValue();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ {
+ switch ( LA(1)) {
+ case TO:
+ {
+ RefPascalAST tmp306_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp306_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp306_AST));
+ }
+ match(TO);
+ break;
+ }
+ case DOWNTO:
+ {
+ RefPascalAST tmp307_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp307_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp307_AST));
+ }
+ match(DOWNTO);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ finalValue();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ forList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_68);
+ } else {
+ throw;
+ }
+ }
+ returnAST = forList_AST;
+}
+
+void PascalParser::initialValue() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST initialValue_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ initialValue_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_69);
+ } else {
+ throw;
+ }
+ }
+ returnAST = initialValue_AST;
+}
+
+void PascalParser::finalValue() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST finalValue_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ finalValue_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_68);
+ } else {
+ throw;
+ }
+ }
+ returnAST = finalValue_AST;
+}
+
+void PascalParser::recordVariableList() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST recordVariableList_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ variable();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ variable();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop341;
+ }
+
+ }
+ _loop341:;
+ } // ( ... )*
+ recordVariableList_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_68);
+ } else {
+ throw;
+ }
+ }
+ returnAST = recordVariableList_AST;
+}
+
+/** A variable is an id with a suffix and can look like:
+ * id
+ * id[expr,...]
+ * id.id
+ * id.id[expr,...]
+ * id^
+ * id^.id
+ * id^.id[expr,...]
+ * ...
+ *
+ * LL has a really hard time with this construct as it's naturally
+ * left-recursive. We have to turn into a simple loop rather than
+ * recursive loop, hence, the suffixes. I keep in the same rule
+ * for easy tree construction.
+ */
+void PascalParser::variable() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST variable_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case AT:
+ {
+ RefPascalAST tmp309_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp309_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp309_AST));
+ }
+ match(AT);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case IDENT:
+ {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;) {
+ switch ( LA(1)) {
+ case LBRACK:
+ {
+ RefPascalAST tmp310_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp310_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp310_AST));
+ }
+ match(LBRACK);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop346;
+ }
+
+ }
+ _loop346:;
+ } // ( ... )*
+ match(RBRACK);
+ break;
+ }
+ case LBRACK2:
+ {
+ RefPascalAST tmp313_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp313_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp313_AST));
+ }
+ match(LBRACK2);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == COMMA)) {
+ match(COMMA);
+ expression();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop348;
+ }
+
+ }
+ _loop348:;
+ } // ( ... )*
+ match(RBRACK2);
+ break;
+ }
+ case DOT:
+ {
+ RefPascalAST tmp316_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp316_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp316_AST));
+ }
+ match(DOT);
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case POINTER:
+ {
+ RefPascalAST tmp317_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp317_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp317_AST));
+ }
+ match(POINTER);
+ break;
+ }
+ default:
+ {
+ goto _loop349;
+ }
+ }
+ }
+ _loop349:;
+ } // ( ... )*
+ variable_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_70);
+ } else {
+ throw;
+ }
+ }
+ returnAST = variable_AST;
+}
+
+void PascalParser::operatorDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST operatorDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp318_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp318_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp318_AST));
+ }
+ match(OPERATOR);
+ {
+ switch ( LA(1)) {
+ case ASSIGN:
+ {
+ assignmentOperatorDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case PLUS:
+ case MINUS:
+ case STAR:
+ case SLASH:
+ {
+ arithmeticOperatorDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case EQUAL:
+ case LE:
+ case GE:
+ case LTH:
+ case GT:
+ {
+ comparisonOperatorDefinition();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ type();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(SEMI);
+ subroutineBlock();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ operatorDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_0);
+ } else {
+ throw;
+ }
+ }
+ returnAST = operatorDefinition_AST;
+}
+
+void PascalParser::assignmentOperatorDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST assignmentOperatorDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(ASSIGN);
+ match(LPAREN);
+ valueParameter();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ assignmentOperatorDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_71);
+ } else {
+ throw;
+ }
+ }
+ returnAST = assignmentOperatorDefinition_AST;
+}
+
+void PascalParser::arithmeticOperatorDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST arithmeticOperatorDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ match(PLUS);
+ break;
+ }
+ case MINUS:
+ {
+ match(MINUS);
+ break;
+ }
+ case SLASH:
+ {
+ match(SLASH);
+ break;
+ }
+ default:
+ if ((LA(1) == STAR) && (LA(2) == LPAREN)) {
+ match(STAR);
+ }
+ else if ((LA(1) == STAR) && (LA(2) == STAR)) {
+ {
+ match(STAR);
+ match(STAR);
+ }
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(LPAREN);
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ arithmeticOperatorDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_71);
+ } else {
+ throw;
+ }
+ }
+ returnAST = arithmeticOperatorDefinition_AST;
+}
+
+void PascalParser::comparisonOperatorDefinition() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST comparisonOperatorDefinition_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ {
+ switch ( LA(1)) {
+ case EQUAL:
+ {
+ match(EQUAL);
+ break;
+ }
+ case LE:
+ {
+ match(LE);
+ break;
+ }
+ case GE:
+ {
+ match(GE);
+ break;
+ }
+ case GT:
+ {
+ match(GT);
+ break;
+ }
+ case LTH:
+ {
+ match(LTH);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(LPAREN);
+ formalParameterList();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ comparisonOperatorDefinition_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_71);
+ } else {
+ throw;
+ }
+ }
+ returnAST = comparisonOperatorDefinition_AST;
+}
+
+void PascalParser::tryStatement() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST tryStatement_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp339_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp339_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp339_AST));
+ }
+ match(TRY);
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case EXCEPT:
+ case FINALLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exceptOrFinallyPart();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(END);
+ tryStatement_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_16);
+ } else {
+ throw;
+ }
+ }
+ returnAST = tryStatement_AST;
+}
+
+void PascalParser::statements() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST statements_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop369;
+ }
+
+ }
+ _loop369:;
+ } // ( ... )*
+ statements_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_72);
+ } else {
+ throw;
+ }
+ }
+ returnAST = statements_AST;
+}
+
+void PascalParser::exceptOrFinallyPart() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exceptOrFinallyPart_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case EXCEPT:
+ {
+ match(EXCEPT);
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case ON:
+ case IDENT:
+ {
+ exceptionHandlers();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exceptOrFinallyPart_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case FINALLY:
+ {
+ match(FINALLY);
+ {
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exceptOrFinallyPart_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exceptOrFinallyPart_AST;
+}
+
+void PascalParser::exceptionHandlers() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exceptionHandlers_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case BEGIN:
+ case NUM_INT:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ case RAISE:
+ case TRY:
+ case IDENT:
+ {
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exceptionHandlers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case ON:
+ {
+ exceptionHandler();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ { // ( ... )*
+ for (;;) {
+ if ((LA(1) == SEMI)) {
+ match(SEMI);
+ exceptionHandler();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ }
+ else {
+ goto _loop372;
+ }
+
+ }
+ _loop372:;
+ } // ( ... )*
+ {
+ switch ( LA(1)) {
+ case ELSE:
+ {
+ match(ELSE);
+ statements();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ break;
+ }
+ case END:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ exceptionHandlers_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_6);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exceptionHandlers_AST;
+}
+
+void PascalParser::exceptionHandler() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST exceptionHandler_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ match(ON);
+ {
+ if ((LA(1) == IDENT) && (LA(2) == COLON)) {
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(COLON);
+ }
+ else if ((LA(1) == IDENT) && (LA(2) == DO)) {
+ }
+ else {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ identifier();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(DO);
+ statement();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ exceptionHandler_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_73);
+ } else {
+ throw;
+ }
+ }
+ returnAST = exceptionHandler_AST;
+}
+
+void PascalParser::sign() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST sign_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case PLUS:
+ {
+ RefPascalAST tmp349_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp349_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp349_AST));
+ }
+ match(PLUS);
+ sign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case MINUS:
+ {
+ RefPascalAST tmp350_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp350_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp350_AST));
+ }
+ match(MINUS);
+ sign_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_74);
+ } else {
+ throw;
+ }
+ }
+ returnAST = sign_AST;
+}
+
+void PascalParser::constantChr() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST constantChr_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp351_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp351_AST = astFactory->create(LT(1));
+ astFactory->makeASTRoot(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp351_AST));
+ }
+ match(CHR);
+ match(LPAREN);
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ match(RPAREN);
+ constantChr_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_75);
+ } else {
+ throw;
+ }
+ }
+ returnAST = constantChr_AST;
+}
+
+void PascalParser::unsignedNumber() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST unsignedNumber_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ switch ( LA(1)) {
+ case NUM_INT:
+ {
+ unsignedInteger();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unsignedNumber_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ case NUM_REAL:
+ {
+ unsignedReal();
+ if (inputState->guessing==0) {
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST));
+ }
+ unsignedNumber_AST = RefPascalAST(currentAST.root);
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_76);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unsignedNumber_AST;
+}
+
+void PascalParser::unsignedReal() {
+ returnAST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ ANTLR_USE_NAMESPACE(antlr)ASTPair currentAST;
+ RefPascalAST unsignedReal_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+
+ try { // for error handling
+ RefPascalAST tmp354_AST = RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST);
+ if ( inputState->guessing == 0 ) {
+ tmp354_AST = astFactory->create(LT(1));
+ astFactory->addASTChild(currentAST, ANTLR_USE_NAMESPACE(antlr)RefAST(tmp354_AST));
+ }
+ match(NUM_REAL);
+ unsignedReal_AST = RefPascalAST(currentAST.root);
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ if( inputState->guessing == 0 ) {
+ reportError(ex);
+ recover(ex,_tokenSet_76);
+ } else {
+ throw;
+ }
+ }
+ returnAST = unsignedReal_AST;
+}
+
+void PascalParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory )
+{
+ factory.setMaxNodeType(189);
+}
+const char* PascalParser::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "BLOCK",
+ "IDLIST",
+ "ELIST",
+ "FUNC_CALL",
+ "PROC_CALL",
+ "SCALARTYPE",
+ "TYPELIST",
+ "VARIANT_TAG",
+ "VARIANT_TAG_NO_ID",
+ "VARIANT_CASE",
+ "CONSTLIST",
+ "FIELDLIST",
+ "ARGDECLS",
+ "VARDECL",
+ "ARGDECL",
+ "ARGLIST",
+ "TYPEDECL",
+ "FIELD",
+ "DOT",
+ "\"library\"",
+ "SEMI",
+ "\"end\"",
+ "\"exports\"",
+ "COMMA",
+ "\"index\"",
+ "\"name\"",
+ "\"uses\"",
+ "\"unit\"",
+ "\"interface\"",
+ "\"implementation\"",
+ "\"begin\"",
+ "\"program\"",
+ "LPAREN",
+ "RPAREN",
+ "\"initialization\"",
+ "\"finalization\"",
+ "\"label\"",
+ "\"const\"",
+ "\"resourcestring\"",
+ "EQUAL",
+ "\"type\"",
+ "\"var\"",
+ "COLON",
+ "\"procedure\"",
+ "\"forward\"",
+ "\"function\"",
+ "\"array\"",
+ "\"of\"",
+ "\"external\"",
+ "\"public\"",
+ "\"alias\"",
+ "INTERRUPT",
+ "\"export\"",
+ "\"register\"",
+ "\"pascal\"",
+ "\"cdecl\"",
+ "\"stdcall\"",
+ "\"popstack\"",
+ "\"saveregisters\"",
+ "\"inline\"",
+ "\"safecall\"",
+ "\"near\"",
+ "\"far\"",
+ "NUM_INT",
+ "\"integer\"",
+ "\"shortint\"",
+ "\"smallint\"",
+ "\"longint\"",
+ "\"int64\"",
+ "\"byte\"",
+ "\"word\"",
+ "\"cardinal\"",
+ "\"qword\"",
+ "\"boolean\"",
+ "BYTEBOOL",
+ "LONGBOOL",
+ "\"char\"",
+ "DOTDOT",
+ "ASSIGN",
+ "\"real\"",
+ "\"single\"",
+ "\"double\"",
+ "\"extended\"",
+ "\"comp\"",
+ "\"string\"",
+ "LBRACK",
+ "RBRACK",
+ "\"packed\"",
+ "\"record\"",
+ "\"case\"",
+ "\"set\"",
+ "\"file\"",
+ "POINTER",
+ "\"object\"",
+ "\"virtual\"",
+ "\"abstract\"",
+ "\"private\"",
+ "\"protected\"",
+ "\"constructor\"",
+ "\"destructor\"",
+ "\"class\"",
+ "\"override\"",
+ "MESSAGE",
+ "\"published\"",
+ "\"property\"",
+ "\"read\"",
+ "\"write\"",
+ "\"default\"",
+ "\"nodefault\"",
+ "LE",
+ "GE",
+ "LTH",
+ "GT",
+ "NOT_EQUAL",
+ "\"in\"",
+ "\"is\"",
+ "PLUS",
+ "MINUS",
+ "\"or\"",
+ "\"xor\"",
+ "STAR",
+ "SLASH",
+ "\"div\"",
+ "\"mod\"",
+ "\"and\"",
+ "\"shl\"",
+ "\"shr\"",
+ "\"not\"",
+ "\"true\"",
+ "\"false\"",
+ "AT",
+ "PLUSEQ",
+ "MINUSEQ",
+ "STAREQ",
+ "SLASHQE",
+ "\"goto\"",
+ "\"if\"",
+ "\"then\"",
+ "\"else\"",
+ "\"while\"",
+ "\"do\"",
+ "\"repeat\"",
+ "\"until\"",
+ "\"for\"",
+ "\"to\"",
+ "\"downto\"",
+ "\"with\"",
+ "LBRACK2",
+ "RBRACK2",
+ "\"operator\"",
+ "\"raise\"",
+ "\"try\"",
+ "\"except\"",
+ "\"finally\"",
+ "\"on\"",
+ "STRING_LITERAL",
+ "\"chr\"",
+ "\"nil\"",
+ "NUM_REAL",
+ "IDENT",
+ "\"absolute\"",
+ "\"as\"",
+ "\"asm\"",
+ "\"assembler\"",
+ "\"break\"",
+ "\"continue\"",
+ "\"dispose\"",
+ "\"exit\"",
+ "\"inherited\"",
+ "\"new\"",
+ "\"self\"",
+ "METHOD",
+ "ADDSUBOR",
+ "ASSIGNEQUAL",
+ "SIGN",
+ "FUNC",
+ "NODE_NOT_EMIT",
+ "MYASTVAR",
+ "LF",
+ "LCURLY",
+ "RCURLY",
+ "WS",
+ "COMMENT_1",
+ "COMMENT_2",
+ "COMMENT_3",
+ "EXPONENT",
+ 0
+};
+
+const unsigned long PascalParser::_tokenSet_0_data_[] = { 2UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_0(_tokenSet_0_data_,6);
+const unsigned long PascalParser::_tokenSet_1_data_[] = { 1073741824UL, 177924UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// "uses" "begin" "label" "const" "resourcestring" "type" "var" "procedure"
+// "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_1(_tokenSet_1_data_,8);
+const unsigned long PascalParser::_tokenSet_2_data_[] = { 100663296UL, 177990UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "exports" "implementation" "begin" "initialization" "label" "const"
+// "resourcestring" "type" "var" "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_2(_tokenSet_2_data_,8);
+const unsigned long PascalParser::_tokenSet_3_data_[] = { 121634818UL, 177988UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" "begin" "initialization" "label" "const"
+// "resourcestring" "type" "var" "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_3(_tokenSet_3_data_,8);
+const unsigned long PascalParser::_tokenSet_4_data_[] = { 994050050UL, 706736UL, 101056512UL, 4294963649UL, 833972167UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" COMMA "index" "name" LPAREN RPAREN "finalization"
+// EQUAL COLON "procedure" "function" "of" DOTDOT ASSIGN LBRACK RBRACK
+// POINTER "constructor" "destructor" "class" "property" "read" "write"
+// "default" "nodefault" LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or"
+// "xor" STAR SLASH "div" "mod" "and" "shl" "shr" AT PLUSEQ MINUSEQ STAREQ
+// SLASHQE "then" "else" "do" "until" "to" "downto" LBRACK2 RBRACK2 "except"
+// "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_4(_tokenSet_4_data_,12);
+const unsigned long PascalParser::_tokenSet_5_data_[] = { 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "exports"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_5(_tokenSet_5_data_,6);
+const unsigned long PascalParser::_tokenSet_6_data_[] = { 33554432UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_6(_tokenSet_6_data_,6);
+const unsigned long PascalParser::_tokenSet_7_data_[] = { 100663296UL, 68UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "exports" "begin" "initialization"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_7(_tokenSet_7_data_,6);
+const unsigned long PascalParser::_tokenSet_8_data_[] = { 184549376UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" COMMA
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_8(_tokenSet_8_data_,6);
+const unsigned long PascalParser::_tokenSet_9_data_[] = { 788529154UL, 177988UL, 0UL, 127424UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "end" "exports" COMMA "name" "begin" "initialization" "label"
+// "const" "resourcestring" "type" "var" "procedure" "function" "constructor"
+// "destructor" "class" "property" "read" "write" "default" "nodefault"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_9(_tokenSet_9_data_,8);
+const unsigned long PascalParser::_tokenSet_10_data_[] = { 1056964610UL, 177988UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "end" "exports" COMMA "index" "name" "begin" "initialization"
+// "label" "const" "resourcestring" "type" "var" "procedure" "function"
+// "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_10(_tokenSet_10_data_,8);
+const unsigned long PascalParser::_tokenSet_11_data_[] = { 16777216UL, 16416UL, 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RPAREN COLON RBRACK
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_11(_tokenSet_11_data_,8);
+const unsigned long PascalParser::_tokenSet_12_data_[] = { 0UL, 2UL, 0UL, 0UL, 0UL, 0UL };
+// "implementation"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_12(_tokenSet_12_data_,6);
+const unsigned long PascalParser::_tokenSet_13_data_[] = { 33554432UL, 68UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "begin" "initialization"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_13(_tokenSet_13_data_,6);
+const unsigned long PascalParser::_tokenSet_14_data_[] = { 33554432UL, 128UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "finalization"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_14(_tokenSet_14_data_,6);
+const unsigned long PascalParser::_tokenSet_15_data_[] = { 0UL, 168450UL, 0UL, 0UL, 0UL, 0UL };
+// "implementation" "const" "type" "procedure" "function"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_15(_tokenSet_15_data_,6);
+const unsigned long PascalParser::_tokenSet_16_data_[] = { 50331648UL, 128UL, 0UL, 0UL, 805584896UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" "finalization" "else" "until" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_16(_tokenSet_16_data_,12);
+const unsigned long PascalParser::_tokenSet_17_data_[] = { 100663296UL, 177988UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "exports" "begin" "initialization" "label" "const" "resourcestring"
+// "type" "var" "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_17(_tokenSet_17_data_,8);
+const unsigned long PascalParser::_tokenSet_18_data_[] = { 184549376UL, 16512UL, 0UL, 0UL, 805584896UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" COMMA "finalization" COLON "else" "until" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_18(_tokenSet_18_data_,12);
+const unsigned long PascalParser::_tokenSet_19_data_[] = { 100663296UL, 177990UL, 0UL, 192UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "exports" "implementation" "begin" "initialization" "label" "const"
+// "resourcestring" "type" "var" "procedure" "function" "constructor" "destructor"
+// IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_19(_tokenSet_19_data_,12);
+const unsigned long PascalParser::_tokenSet_20_data_[] = { 100663296UL, 177988UL, 0UL, 192UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "exports" "begin" "initialization" "label" "const" "resourcestring"
+// "type" "var" "procedure" "function" "constructor" "destructor" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_20(_tokenSet_20_data_,12);
+const unsigned long PascalParser::_tokenSet_21_data_[] = { 1061158914UL, 720868UL, 67239936UL, 4294840768UL, 825581575UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" COMMA "index" "name" "begin" RPAREN "initialization"
+// "finalization" "label" "const" "resourcestring" EQUAL "type" "var" COLON
+// "procedure" "function" "of" DOTDOT RBRACK "constructor" "destructor"
+// "class" "property" LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or"
+// "xor" STAR SLASH "div" "mod" "and" "shl" "shr" "then" "else" "do" "until"
+// "to" "downto" RBRACK2 "except" "finally" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_21(_tokenSet_21_data_,12);
+const unsigned long PascalParser::_tokenSet_22_data_[] = { 16777216UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_22(_tokenSet_22_data_,6);
+const unsigned long PascalParser::_tokenSet_23_data_[] = { 16777216UL, 2080UL, 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RPAREN EQUAL RBRACK
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_23(_tokenSet_23_data_,8);
+const unsigned long PascalParser::_tokenSet_24_data_[] = { 0UL, 4UL, 536870920UL, 0UL, 206215168UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "begin" NUM_INT "case" "goto" "if" "while" "repeat" "for" "with" "raise"
+// "try" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_24(_tokenSet_24_data_,12);
+const unsigned long PascalParser::_tokenSet_25_data_[] = { 121634818UL, 178116UL, 0UL, 192UL, 805584896UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" "begin" "initialization" "finalization"
+// "label" "const" "resourcestring" "type" "var" "procedure" "function"
+// "constructor" "destructor" "else" "until" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_25(_tokenSet_25_data_,12);
+const unsigned long PascalParser::_tokenSet_26_data_[] = { 16777216UL, 1818406UL, 67108864UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "implementation" "begin" RPAREN "label" "const" "resourcestring"
+// EQUAL "type" "var" "procedure" "forward" "function" "of" "external"
+// RBRACK "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_26(_tokenSet_26_data_,8);
+const unsigned long PascalParser::_tokenSet_27_data_[] = { 117440514UL, 177988UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "end" "exports" "begin" "initialization" "label" "const" "resourcestring"
+// "type" "var" "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_27(_tokenSet_27_data_,8);
+const unsigned long PascalParser::_tokenSet_28_data_[] = { 16777216UL, 16400UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN COLON
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_28(_tokenSet_28_data_,6);
+const unsigned long PascalParser::_tokenSet_29_data_[] = { 16777216UL, 16416UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RPAREN COLON
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_29(_tokenSet_29_data_,6);
+const unsigned long PascalParser::_tokenSet_30_data_[] = { 16777216UL, 32UL, 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI RPAREN RBRACK
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_30(_tokenSet_30_data_,8);
+const unsigned long PascalParser::_tokenSet_31_data_[] = { 0UL, 426000UL, 3657039864UL, 50331907UL, 2147483648UL, 13UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN "procedure" "function" "array" NUM_INT "integer" "shortint" "smallint"
+// "longint" "int64" "byte" "word" "cardinal" "qword" "boolean" BYTEBOOL
+// LONGBOOL "char" "real" "single" "double" "extended" "comp" "string"
+// "packed" "record" "set" "file" POINTER "object" "class" PLUS MINUS STRING_LITERAL
+// "chr" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_31(_tokenSet_31_data_,12);
+const unsigned long PascalParser::_tokenSet_32_data_[] = { 188743680UL, 524448UL, 67239936UL, 0UL, 825581568UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT SEMI "end" COMMA RPAREN "finalization" "of" DOTDOT RBRACK "then"
+// "else" "do" "until" "to" "downto" RBRACK2 "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_32(_tokenSet_32_data_,12);
+const unsigned long PascalParser::_tokenSet_33_data_[] = { 0UL, 0UL, 8UL, 50331648UL, 2147483648UL, 13UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// NUM_INT PLUS MINUS STRING_LITERAL "chr" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_33(_tokenSet_33_data_,12);
+const unsigned long PascalParser::_tokenSet_34_data_[] = { 16777216UL, 16UL, 8UL, 0UL, 0UL, 12UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN NUM_INT NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_34(_tokenSet_34_data_,12);
+const unsigned long PascalParser::_tokenSet_35_data_[] = { 0UL, 16UL, 8UL, 50331648UL, 2147483648UL, 13UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN NUM_INT PLUS MINUS STRING_LITERAL "chr" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_35(_tokenSet_35_data_,12);
+const unsigned long PascalParser::_tokenSet_36_data_[] = { 0UL, 16UL, 33554440UL, 50331648UL, 2147483768UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN NUM_INT LBRACK PLUS MINUS "not" "true" "false" AT STRING_LITERAL
+// "chr" "nil" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_36(_tokenSet_36_data_,12);
+const unsigned long PascalParser::_tokenSet_37_data_[] = { 16777216UL, 2064UL, 100663304UL, 4294836224UL, 2147483775UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI LPAREN EQUAL NUM_INT LBRACK RBRACK LE GE LTH GT NOT_EQUAL "in"
+// "is" PLUS MINUS "or" "xor" STAR SLASH "div" "mod" "and" "shl" "shr"
+// "not" "true" "false" AT STRING_LITERAL "chr" "nil" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_37(_tokenSet_37_data_,12);
+const unsigned long PascalParser::_tokenSet_38_data_[] = { 184549378UL, 182304UL, 67239936UL, 4544UL, 0UL, 0UL, 0UL, 0UL };
+// EOF SEMI "end" COMMA RPAREN EQUAL COLON "procedure" "function" DOTDOT
+// RBRACK "constructor" "destructor" "class" "property"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_38(_tokenSet_38_data_,8);
+const unsigned long PascalParser::_tokenSet_39_data_[] = { 150994944UL, 32UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI COMMA RPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_39(_tokenSet_39_data_,6);
+const unsigned long PascalParser::_tokenSet_40_data_[] = { 150994944UL, 2080UL, 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI COMMA RPAREN EQUAL RBRACK
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_40(_tokenSet_40_data_,8);
+const unsigned long PascalParser::_tokenSet_41_data_[] = { 318767104UL, 165936UL, 67108864UL, 127424UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" "index" LPAREN RPAREN EQUAL "procedure" "function" RBRACK
+// "constructor" "destructor" "class" "property" "read" "write" "default"
+// "nodefault"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_41(_tokenSet_41_data_,8);
+const unsigned long PascalParser::_tokenSet_42_data_[] = { 0UL, 32UL, 0UL, 0UL, 0UL, 0UL };
+// RPAREN
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_42(_tokenSet_42_data_,6);
+const unsigned long PascalParser::_tokenSet_43_data_[] = { 792723458UL, 720868UL, 67239936UL, 4294963648UL, 825581575UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" COMMA "name" "begin" RPAREN "initialization"
+// "finalization" "label" "const" "resourcestring" EQUAL "type" "var" COLON
+// "procedure" "function" "of" DOTDOT RBRACK "constructor" "destructor"
+// "class" "property" "read" "write" "default" "nodefault" LE GE LTH GT
+// NOT_EQUAL "in" "is" PLUS MINUS "or" "xor" STAR SLASH "div" "mod" "and"
+// "shl" "shr" "then" "else" "do" "until" "to" "downto" RBRACK2 "except"
+// "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_43(_tokenSet_43_data_,12);
+const unsigned long PascalParser::_tokenSet_44_data_[] = { 0UL, 2064UL, 100794376UL, 4294836224UL, 2147483775UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// LPAREN EQUAL NUM_INT DOTDOT LBRACK RBRACK LE GE LTH GT NOT_EQUAL "in"
+// "is" PLUS MINUS "or" "xor" STAR SLASH "div" "mod" "and" "shl" "shr"
+// "not" "true" "false" AT STRING_LITERAL "chr" "nil" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_44(_tokenSet_44_data_,12);
+const unsigned long PascalParser::_tokenSet_45_data_[] = { 134217728UL, 0UL, 67108864UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// COMMA RBRACK
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_45(_tokenSet_45_data_,8);
+const unsigned long PascalParser::_tokenSet_46_data_[] = { 33554432UL, 32UL, 536870912UL, 0UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" RPAREN "case" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_46(_tokenSet_46_data_,12);
+const unsigned long PascalParser::_tokenSet_47_data_[] = { 50331648UL, 32UL, 536870912UL, 0UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" RPAREN "case" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_47(_tokenSet_47_data_,12);
+const unsigned long PascalParser::_tokenSet_48_data_[] = { 33554432UL, 2260992UL, 0UL, 6640UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "public" "private" "protected" "constructor"
+// "destructor" "class" "published" "property" IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_48(_tokenSet_48_data_,12);
+const unsigned long PascalParser::_tokenSet_49_data_[] = { 0UL, 163840UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_49(_tokenSet_49_data_,8);
+const unsigned long PascalParser::_tokenSet_50_data_[] = { 33554432UL, 163840UL, 0UL, 4544UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor" "class" "property"
+// IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_50(_tokenSet_50_data_,12);
+const unsigned long PascalParser::_tokenSet_51_data_[] = { 33554432UL, 163840UL, 0UL, 192UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_51(_tokenSet_51_data_,8);
+const unsigned long PascalParser::_tokenSet_52_data_[] = { 0UL, 163840UL, 0UL, 4544UL, 0UL, 0UL, 0UL, 0UL };
+// "procedure" "function" "constructor" "destructor" "class" "property"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_52(_tokenSet_52_data_,8);
+const unsigned long PascalParser::_tokenSet_53_data_[] = { 33554432UL, 163840UL, 0UL, 4544UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor" "class" "property"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_53(_tokenSet_53_data_,8);
+const unsigned long PascalParser::_tokenSet_54_data_[] = { 33554432UL, 163840UL, 0UL, 127424UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor" "class" "property"
+// "read" "write" "default" "nodefault"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_54(_tokenSet_54_data_,8);
+const unsigned long PascalParser::_tokenSet_55_data_[] = { 0UL, 16384UL, 0UL, 0UL, 0UL, 0UL };
+// COLON
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_55(_tokenSet_55_data_,6);
+const unsigned long PascalParser::_tokenSet_56_data_[] = { 33554432UL, 163840UL, 0UL, 119232UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor" "class" "property"
+// "write" "default" "nodefault"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_56(_tokenSet_56_data_,8);
+const unsigned long PascalParser::_tokenSet_57_data_[] = { 33554432UL, 163840UL, 0UL, 102848UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "procedure" "function" "constructor" "destructor" "class" "property"
+// "default" "nodefault"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_57(_tokenSet_57_data_,8);
+const unsigned long PascalParser::_tokenSet_58_data_[] = { 188743680UL, 526496UL, 67239936UL, 16646144UL, 825581568UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT SEMI "end" COMMA RPAREN "finalization" EQUAL "of" DOTDOT RBRACK
+// LE GE LTH GT NOT_EQUAL "in" "is" "then" "else" "do" "until" "to" "downto"
+// RBRACK2 "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_58(_tokenSet_58_data_,12);
+const unsigned long PascalParser::_tokenSet_59_data_[] = { 188743680UL, 526496UL, 67239936UL, 268304384UL, 825581568UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT SEMI "end" COMMA RPAREN "finalization" EQUAL "of" DOTDOT RBRACK
+// LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or" "xor" "then" "else"
+// "do" "until" "to" "downto" RBRACK2 "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_59(_tokenSet_59_data_,12);
+const unsigned long PascalParser::_tokenSet_60_data_[] = { 188743680UL, 526512UL, 67239936UL, 4294836224UL, 825581575UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT SEMI "end" COMMA LPAREN RPAREN "finalization" EQUAL "of" DOTDOT
+// RBRACK LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or" "xor" STAR SLASH
+// "div" "mod" "and" "shl" "shr" "then" "else" "do" "until" "to" "downto"
+// RBRACK2 "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_60(_tokenSet_60_data_,12);
+const unsigned long PascalParser::_tokenSet_61_data_[] = { 188743680UL, 526496UL, 67239936UL, 4294836224UL, 825581575UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT SEMI "end" COMMA RPAREN "finalization" EQUAL "of" DOTDOT RBRACK
+// LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or" "xor" STAR SLASH "div"
+// "mod" "and" "shl" "shr" "then" "else" "do" "until" "to" "downto" RBRACK2
+// "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_61(_tokenSet_61_data_,12);
+const unsigned long PascalParser::_tokenSet_62_data_[] = { 50331648UL, 128UL, 0UL, 0UL, 805584960UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" "finalization" AT "else" "until" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_62(_tokenSet_62_data_,12);
+const unsigned long PascalParser::_tokenSet_63_data_[] = { 0UL, 0UL, 33816576UL, 0UL, 1920UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// ASSIGN LBRACK PLUSEQ MINUSEQ STAREQ SLASHQE
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_63(_tokenSet_63_data_,12);
+const unsigned long PascalParser::_tokenSet_64_data_[] = { 50331648UL, 144UL, 0UL, 0UL, 805584896UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" LPAREN "finalization" "else" "until" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_64(_tokenSet_64_data_,12);
+const unsigned long PascalParser::_tokenSet_65_data_[] = { 0UL, 0UL, 262144UL, 0UL, 1920UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// ASSIGN PLUSEQ MINUSEQ STAREQ SLASHQE
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_65(_tokenSet_65_data_,12);
+const unsigned long PascalParser::_tokenSet_66_data_[] = { 121634818UL, 178132UL, 570425352UL, 50331840UL, 4233025656UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" "begin" LPAREN "initialization" "finalization"
+// "label" "const" "resourcestring" "type" "var" "procedure" "function"
+// NUM_INT LBRACK "case" "constructor" "destructor" PLUS MINUS "not" "true"
+// "false" AT "goto" "if" "else" "while" "repeat" "until" "for" "with"
+// "raise" "try" "except" "finally" "on" STRING_LITERAL "chr" "nil" NUM_REAL
+// IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_66(_tokenSet_66_data_,12);
+const unsigned long PascalParser::_tokenSet_67_data_[] = { 50331648UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_67(_tokenSet_67_data_,6);
+const unsigned long PascalParser::_tokenSet_68_data_[] = { 0UL, 0UL, 0UL, 0UL, 65536UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "do"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_68(_tokenSet_68_data_,12);
+const unsigned long PascalParser::_tokenSet_69_data_[] = { 0UL, 0UL, 0UL, 0UL, 3145728UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "to" "downto"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_69(_tokenSet_69_data_,12);
+const unsigned long PascalParser::_tokenSet_70_data_[] = { 134217728UL, 0UL, 0UL, 0UL, 65536UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// COMMA "do"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_70(_tokenSet_70_data_,12);
+const unsigned long PascalParser::_tokenSet_71_data_[] = { 0UL, 0UL, 0UL, 0UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_71(_tokenSet_71_data_,12);
+const unsigned long PascalParser::_tokenSet_72_data_[] = { 33554432UL, 0UL, 0UL, 0UL, 805306368UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// "end" "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_72(_tokenSet_72_data_,12);
+const unsigned long PascalParser::_tokenSet_73_data_[] = { 50331648UL, 0UL, 0UL, 0UL, 16384UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SEMI "end" "else"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_73(_tokenSet_73_data_,12);
+const unsigned long PascalParser::_tokenSet_74_data_[] = { 0UL, 0UL, 8UL, 0UL, 0UL, 12UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// NUM_INT NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_74(_tokenSet_74_data_,12);
+const unsigned long PascalParser::_tokenSet_75_data_[] = { 1061158914UL, 720868UL, 67239936UL, 4294840768UL, 825581575UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" "exports" COMMA "index" "name" "begin" RPAREN "initialization"
+// "finalization" "label" "const" "resourcestring" EQUAL "type" "var" COLON
+// "procedure" "function" "of" DOTDOT RBRACK "constructor" "destructor"
+// "class" "property" LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or"
+// "xor" STAR SLASH "div" "mod" "and" "shl" "shr" "then" "else" "do" "until"
+// "to" "downto" RBRACK2 "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_75(_tokenSet_75_data_,12);
+const unsigned long PascalParser::_tokenSet_76_data_[] = { 188743682UL, 706720UL, 67239936UL, 4294840768UL, 825581575UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// EOF DOT SEMI "end" COMMA RPAREN "finalization" EQUAL COLON "procedure"
+// "function" "of" DOTDOT RBRACK "constructor" "destructor" "class" "property"
+// LE GE LTH GT NOT_EQUAL "in" "is" PLUS MINUS "or" "xor" STAR SLASH "div"
+// "mod" "and" "shl" "shr" "then" "else" "do" "until" "to" "downto" RBRACK2
+// "except" "finally"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalParser::_tokenSet_76(_tokenSet_76_data_,12);
+
+
diff --git a/languages/pascal/PascalParser.hpp b/languages/pascal/PascalParser.hpp
new file mode 100644
index 00000000..d37d76c5
--- /dev/null
+++ b/languages/pascal/PascalParser.hpp
@@ -0,0 +1,422 @@
+#ifndef INC_PascalParser_hpp_
+#define INC_PascalParser_hpp_
+
+#line 29 "pascal.g"
+
+ #include "problemreporter.h"
+ #include "PascalAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefPascalAST(ast)->setLine( t->getLine() );\
+ RefPascalAST(ast)->setColumn( t->getColumn() ); \
+ }
+
+#line 19 "PascalParser.hpp"
+#include <antlr/config.hpp>
+/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalParser.hpp"$ */
+#include <antlr/TokenStream.hpp>
+#include <antlr/TokenBuffer.hpp>
+#include "PascalTokenTypes.hpp"
+#include <antlr/LLkParser.hpp>
+
+class CUSTOM_API PascalParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public PascalTokenTypes
+{
+#line 90 "pascal.g"
+
+private:
+ unsigned int m_numberOfErrors;
+ ProblemReporter* m_problemReporter;
+
+public:
+ void resetErrors() { m_numberOfErrors = 0; }
+ unsigned int numberOfErrors() const { return m_numberOfErrors; }
+ void setProblemReporter( ProblemReporter* r ) { m_problemReporter = r; }
+
+ void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_problemReporter->reportError( ex.getMessage().c_str(),
+ ex.getFilename().c_str(),
+ ex.getLine(),
+ ex.getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_problemReporter->reportError( errorMessage.c_str(),
+ getFilename().c_str(),
+ LT(1)->getLine(),
+ LT(1)->getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){
+ m_problemReporter->reportMessage( message.c_str(),
+ getFilename().c_str(),
+ LT(1)->getLine(),
+ LT(1)->getColumn() );
+ }
+#line 30 "PascalParser.hpp"
+public:
+ void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+protected:
+ PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k);
+public:
+ PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf);
+protected:
+ PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k);
+public:
+ PascalParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer);
+ PascalParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state);
+ int getNumTokens() const
+ {
+ return PascalParser::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return PascalParser::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return PascalParser::tokenNames;
+ }
+ public: void compilationUnit();
+ public: void program();
+ public: void library();
+ public: void unit();
+ public: void programHeading();
+ public: void usesClause();
+ public: void block();
+ public: void identifier();
+ public: void libraryBlock();
+ public: void exportsClause();
+ public: void declarationPart();
+ public: void statementPart();
+ public: void exportsList();
+ public: void exportsEntry();
+ public: void integerConstant();
+ public: void stringConstant();
+ public: void identifierList();
+ public: void interfacePart();
+ public: void implementationPart();
+ public: void initializationPart();
+ public: void finalizationPart();
+ public: void realizationPart();
+ public: void constantDeclarationPart();
+ public: void typeDeclarationPart();
+ public: void procedureHeadersPart();
+ public: void statement();
+ public: void labelDeclarationPart();
+ public: void resourcestringDeclarationPart();
+ public: void variableDeclarationPart();
+ public: void procedureAndFunctionDeclarationPart();
+ public: void label();
+ public: void constantDeclaration();
+ public: void typedConstantDeclaration();
+ public: void stringConstantDeclaration();
+ public: void string();
+ public: void typeDeclaration();
+ public: void variableDeclaration();
+ public: void type();
+ public: void procedureAndFunctionDeclaration();
+ public: void procedureDeclaration();
+ public: void functionDeclaration();
+ public: void constructorDeclaration();
+ public: void destructorDeclaration();
+ public: void compoundStatement();
+ public: void procedureHeader();
+ public: void subroutineBlock();
+ public: void functionHeader();
+ public: void qualifiedMethodIdentifier();
+ public: void formalParameterList();
+ public: void modifiers();
+ public: void externalDirective();
+ public: void functionHeaderEnding();
+ public: void parameterDeclaration();
+ public: void valueParameter();
+ public: void variableParameter();
+ public: void constantParameter();
+ public: void untypedParameterPart();
+ public: void callModifiers();
+ public: void expression();
+ public: void typedConstant();
+ public: void constant();
+ public: void recordConstant();
+ public: void arrayConstant();
+ public: void proceduralConstant();
+ public: void addressConstant();
+ public: void simpleType();
+ public: void subrangeTypeOrTypeIdentifier();
+ public: void enumeratedType();
+ public: void stringType();
+ public: void structuredType();
+ public: void pointerType();
+ public: void proceduralType();
+ public: void ordinalType();
+ public: void realType();
+ public: void typeIdentifier();
+ public: void subrangeType();
+ public: void assignedEnumList();
+ public: void unsignedInteger();
+ public: void arrayType();
+ public: void recordType();
+ public: void objectType();
+ public: void classType();
+ public: void setType();
+ public: void fileType();
+ public: void arrayIndexType();
+ public: void arraySubrangeType();
+ public: void fieldList();
+ public: void fixedField();
+ public: void variantPart();
+ public: void variant();
+ public: void proceduralTypePart1();
+ public: void heritage();
+ public: void componentList();
+ public: void objectVisibilitySpecifier();
+ public: void fieldDefinition();
+ public: void methodDefinition();
+ public: void constructorHeader();
+ public: void destructorHeader();
+ public: void methodDirectives();
+ public: void classComponentList();
+ public: void classVisibilitySpecifier();
+ public: void classMethodDefinition();
+ public: void propertyDefinition();
+ public: void classMethodDirectives();
+ public: void directiveVariants();
+ public: void propertyInterface();
+ public: void propertySpecifiers();
+ public: void propertyParameterList();
+ public: void readSpecifier();
+ public: void writeSpecifier();
+ public: void defaultSpecifier();
+ public: void fieldOrMethod();
+ public: void simpleExpression();
+ public: void expressionSign();
+ public: void term();
+ public: void factor();
+ public: void identifierOrValueTypecastOrFunctionCall();
+ public: void unsignedConstant();
+ public: void setConstructor();
+ public: void addressFactor();
+ public: void expressions();
+ public: void functionCall();
+ public: void actualParameterList();
+ public: void setGroup();
+ public: void valueTypecast();
+ public: void simpleStatement();
+ public: void structuredStatement();
+ public: void assignmentStatement();
+ public: void procedureStatement();
+ public: void gotoStatement();
+ public: void raiseStatement();
+ public: void identifierOrArrayIdentifier();
+ public: void assignmentOperator();
+ public: void repetitiveStatement();
+ public: void conditionalStatement();
+ public: void exceptionStatement();
+ public: void withStatement();
+ public: void ifStatement();
+ public: void caseStatement();
+ public: void forStatement();
+ public: void repeatStatement();
+ public: void whileStatement();
+ public: void caseListElement();
+ public: void constList();
+ public: void forList();
+ public: void initialValue();
+ public: void finalValue();
+ public: void recordVariableList();
+ public: void variable();
+ public: void operatorDefinition();
+ public: void assignmentOperatorDefinition();
+ public: void arithmeticOperatorDefinition();
+ public: void comparisonOperatorDefinition();
+ public: void tryStatement();
+ public: void statements();
+ public: void exceptOrFinallyPart();
+ public: void exceptionHandlers();
+ public: void exceptionHandler();
+ public: void sign();
+ public: void constantChr();
+ public: void unsignedNumber();
+ public: void unsignedReal();
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefPascalAST returnAST;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 190;
+#else
+ enum {
+ NUM_TOKENS = 190
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+ static const unsigned long _tokenSet_5_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
+ static const unsigned long _tokenSet_6_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
+ static const unsigned long _tokenSet_7_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7;
+ static const unsigned long _tokenSet_8_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8;
+ static const unsigned long _tokenSet_9_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9;
+ static const unsigned long _tokenSet_10_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10;
+ static const unsigned long _tokenSet_11_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11;
+ static const unsigned long _tokenSet_12_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12;
+ static const unsigned long _tokenSet_13_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13;
+ static const unsigned long _tokenSet_14_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14;
+ static const unsigned long _tokenSet_15_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_15;
+ static const unsigned long _tokenSet_16_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_16;
+ static const unsigned long _tokenSet_17_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_17;
+ static const unsigned long _tokenSet_18_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_18;
+ static const unsigned long _tokenSet_19_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_19;
+ static const unsigned long _tokenSet_20_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_20;
+ static const unsigned long _tokenSet_21_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_21;
+ static const unsigned long _tokenSet_22_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_22;
+ static const unsigned long _tokenSet_23_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_23;
+ static const unsigned long _tokenSet_24_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_24;
+ static const unsigned long _tokenSet_25_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_25;
+ static const unsigned long _tokenSet_26_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_26;
+ static const unsigned long _tokenSet_27_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_27;
+ static const unsigned long _tokenSet_28_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_28;
+ static const unsigned long _tokenSet_29_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_29;
+ static const unsigned long _tokenSet_30_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_30;
+ static const unsigned long _tokenSet_31_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_31;
+ static const unsigned long _tokenSet_32_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_32;
+ static const unsigned long _tokenSet_33_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_33;
+ static const unsigned long _tokenSet_34_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_34;
+ static const unsigned long _tokenSet_35_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_35;
+ static const unsigned long _tokenSet_36_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_36;
+ static const unsigned long _tokenSet_37_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_37;
+ static const unsigned long _tokenSet_38_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_38;
+ static const unsigned long _tokenSet_39_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_39;
+ static const unsigned long _tokenSet_40_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_40;
+ static const unsigned long _tokenSet_41_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_41;
+ static const unsigned long _tokenSet_42_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_42;
+ static const unsigned long _tokenSet_43_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_43;
+ static const unsigned long _tokenSet_44_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_44;
+ static const unsigned long _tokenSet_45_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_45;
+ static const unsigned long _tokenSet_46_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_46;
+ static const unsigned long _tokenSet_47_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_47;
+ static const unsigned long _tokenSet_48_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_48;
+ static const unsigned long _tokenSet_49_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_49;
+ static const unsigned long _tokenSet_50_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_50;
+ static const unsigned long _tokenSet_51_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_51;
+ static const unsigned long _tokenSet_52_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_52;
+ static const unsigned long _tokenSet_53_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_53;
+ static const unsigned long _tokenSet_54_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_54;
+ static const unsigned long _tokenSet_55_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_55;
+ static const unsigned long _tokenSet_56_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_56;
+ static const unsigned long _tokenSet_57_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_57;
+ static const unsigned long _tokenSet_58_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_58;
+ static const unsigned long _tokenSet_59_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_59;
+ static const unsigned long _tokenSet_60_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_60;
+ static const unsigned long _tokenSet_61_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_61;
+ static const unsigned long _tokenSet_62_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_62;
+ static const unsigned long _tokenSet_63_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_63;
+ static const unsigned long _tokenSet_64_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_64;
+ static const unsigned long _tokenSet_65_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_65;
+ static const unsigned long _tokenSet_66_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_66;
+ static const unsigned long _tokenSet_67_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_67;
+ static const unsigned long _tokenSet_68_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_68;
+ static const unsigned long _tokenSet_69_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_69;
+ static const unsigned long _tokenSet_70_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_70;
+ static const unsigned long _tokenSet_71_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_71;
+ static const unsigned long _tokenSet_72_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_72;
+ static const unsigned long _tokenSet_73_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_73;
+ static const unsigned long _tokenSet_74_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_74;
+ static const unsigned long _tokenSet_75_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_75;
+ static const unsigned long _tokenSet_76_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_76;
+};
+
+#endif /*INC_PascalParser_hpp_*/
diff --git a/languages/pascal/PascalStoreWalker.cpp b/languages/pascal/PascalStoreWalker.cpp
new file mode 100644
index 00000000..96c69fe4
--- /dev/null
+++ b/languages/pascal/PascalStoreWalker.cpp
@@ -0,0 +1,3409 @@
+/* $ANTLR 2.7.7 (20061129): "pascal.tree.g" -> "PascalStoreWalker.cpp"$ */
+#include "PascalStoreWalker.hpp"
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/NoViableAltException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/BitSet.hpp>
+#line 1 "pascal.tree.g"
+#line 11 "PascalStoreWalker.cpp"
+PascalStoreWalker::PascalStoreWalker()
+ : ANTLR_USE_NAMESPACE(antlr)TreeParser() {
+}
+
+void PascalStoreWalker::program(RefPascalAST _t) {
+ RefPascalAST program_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ programHeading(_t);
+ _t = _retTree;
+ block(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::programHeading(RefPascalAST _t) {
+ RefPascalAST programHeading_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROGRAM:
+ {
+ RefPascalAST __t3 = _t;
+ RefPascalAST tmp1_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROGRAM);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp2_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ identifierList(_t);
+ _t = _retTree;
+ _t = __t3;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case UNIT:
+ {
+ RefPascalAST __t4 = _t;
+ RefPascalAST tmp3_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),UNIT);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp4_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ _t = __t4;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::block(RefPascalAST _t) {
+ RefPascalAST block_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LABEL:
+ {
+ labelDeclarationPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case CONST:
+ {
+ constantDefinitionPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case TYPE:
+ {
+ typeDefinitionPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case VAR:
+ {
+ variableDeclarationPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ procedureAndFunctionDeclarationPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case USES:
+ {
+ usesUnitsPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case IMPLEMENTATION:
+ {
+ RefPascalAST tmp5_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IMPLEMENTATION);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ goto _loop8;
+ }
+ }
+ }
+ _loop8:;
+ } // ( ... )*
+ compoundStatement(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::identifierList(RefPascalAST _t) {
+ RefPascalAST identifierList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t104 = _t;
+ RefPascalAST tmp6_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDLIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt106=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == IDENT)) {
+ RefPascalAST tmp7_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ }
+ else {
+ if ( _cnt106>=1 ) { goto _loop106; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt106++;
+ }
+ _loop106:;
+ } // ( ... )+
+ _t = __t104;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::identifier(RefPascalAST _t) {
+ RefPascalAST identifier_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST tmp8_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::labelDeclarationPart(RefPascalAST _t) {
+ RefPascalAST labelDeclarationPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t12 = _t;
+ RefPascalAST tmp9_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LABEL);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt14=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == NUM_INT)) {
+ label(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt14>=1 ) { goto _loop14; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt14++;
+ }
+ _loop14:;
+ } // ( ... )+
+ _t = __t12;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::constantDefinitionPart(RefPascalAST _t) {
+ RefPascalAST constantDefinitionPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t17 = _t;
+ RefPascalAST tmp10_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt19=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == EQUAL)) {
+ constantDefinition(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt19>=1 ) { goto _loop19; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt19++;
+ }
+ _loop19:;
+ } // ( ... )+
+ _t = __t17;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::typeDefinitionPart(RefPascalAST _t) {
+ RefPascalAST typeDefinitionPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t31 = _t;
+ RefPascalAST tmp11_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TYPE);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt33=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == TYPEDECL)) {
+ typeDefinition(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt33>=1 ) { goto _loop33; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt33++;
+ }
+ _loop33:;
+ } // ( ... )+
+ _t = __t31;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+/** Yields a list of VARDECL-rooted subtrees with VAR at the overall root */
+void PascalStoreWalker::variableDeclarationPart(RefPascalAST _t) {
+ RefPascalAST variableDeclarationPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t83 = _t;
+ RefPascalAST tmp12_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VAR);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt85=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == VARDECL)) {
+ variableDeclaration(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt85>=1 ) { goto _loop85; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt85++;
+ }
+ _loop85:;
+ } // ( ... )+
+ _t = __t83;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::procedureAndFunctionDeclarationPart(RefPascalAST _t) {
+ RefPascalAST procedureAndFunctionDeclarationPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ procedureOrFunctionDeclaration(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::usesUnitsPart(RefPascalAST _t) {
+ RefPascalAST usesUnitsPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t10 = _t;
+ RefPascalAST tmp13_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),USES);
+ _t = _t->getFirstChild();
+ identifierList(_t);
+ _t = _retTree;
+ _t = __t10;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::compoundStatement(RefPascalAST _t) {
+ RefPascalAST compoundStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ statements(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::label(RefPascalAST _t) {
+ RefPascalAST label_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST tmp14_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::constantDefinition(RefPascalAST _t) {
+ RefPascalAST constantDefinition_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t21 = _t;
+ RefPascalAST tmp15_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQUAL);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp16_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ constant(_t);
+ _t = _retTree;
+ _t = __t21;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::constant(RefPascalAST _t) {
+ RefPascalAST constant_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefPascalAST tmp17_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp18_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PLUS:
+ {
+ RefPascalAST __t23 = _t;
+ RefPascalAST tmp19_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefPascalAST tmp20_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp21_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENT:
+ {
+ RefPascalAST tmp22_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t23;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS:
+ {
+ RefPascalAST __t25 = _t;
+ RefPascalAST tmp23_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefPascalAST tmp24_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp25_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENT:
+ {
+ RefPascalAST tmp26_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t25;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENT:
+ {
+ RefPascalAST tmp27_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ RefPascalAST tmp28_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STRING_LITERAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHR:
+ {
+ RefPascalAST __t27 = _t;
+ RefPascalAST tmp29_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHR);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefPascalAST tmp30_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp31_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t27;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::string(RefPascalAST _t) {
+ RefPascalAST string_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST tmp32_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STRING_LITERAL);
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::typeDefinition(RefPascalAST _t) {
+ RefPascalAST typeDefinition_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t35 = _t;
+ RefPascalAST tmp33_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TYPEDECL);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp34_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SCALARTYPE:
+ case ARRAY:
+ case INTEGER:
+ case BOOLEAN:
+ case CHAR:
+ case DOTDOT:
+ case REAL:
+ case STRING:
+ case PACKED:
+ case RECORD:
+ case SET:
+ case FILE:
+ case POINTER:
+ case IDENT:
+ {
+ type(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION:
+ {
+ RefPascalAST __t37 = _t;
+ RefPascalAST tmp35_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGDECLS:
+ {
+ formalParameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case INTEGER:
+ case BOOLEAN:
+ case CHAR:
+ case REAL:
+ case STRING:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ resultType(_t);
+ _t = _retTree;
+ _t = __t37;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE:
+ {
+ RefPascalAST __t39 = _t;
+ RefPascalAST tmp36_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGDECLS:
+ {
+ formalParameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t39;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t35;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::type(RefPascalAST _t) {
+ RefPascalAST type_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SCALARTYPE:
+ {
+ RefPascalAST __t42 = _t;
+ RefPascalAST tmp37_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SCALARTYPE);
+ _t = _t->getFirstChild();
+ identifierList(_t);
+ _t = _retTree;
+ _t = __t42;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOTDOT:
+ {
+ RefPascalAST __t43 = _t;
+ RefPascalAST tmp38_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOTDOT);
+ _t = _t->getFirstChild();
+ constant(_t);
+ _t = _retTree;
+ constant(_t);
+ _t = _retTree;
+ _t = __t43;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INTEGER:
+ case BOOLEAN:
+ case CHAR:
+ case REAL:
+ case STRING:
+ case IDENT:
+ {
+ typeIdentifier(_t);
+ _t = _retTree;
+ break;
+ }
+ case ARRAY:
+ case PACKED:
+ case RECORD:
+ case SET:
+ case FILE:
+ {
+ structuredType(_t);
+ _t = _retTree;
+ break;
+ }
+ case POINTER:
+ {
+ RefPascalAST __t44 = _t;
+ RefPascalAST tmp39_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),POINTER);
+ _t = _t->getFirstChild();
+ typeIdentifier(_t);
+ _t = _retTree;
+ _t = __t44;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::formalParameterList(RefPascalAST _t) {
+ RefPascalAST formalParameterList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t94 = _t;
+ RefPascalAST tmp40_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARGDECLS);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt96=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_0.member(_t->getType()))) {
+ formalParameterSection(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt96>=1 ) { goto _loop96; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt96++;
+ }
+ _loop96:;
+ } // ( ... )+
+ _t = __t94;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::resultType(RefPascalAST _t) {
+ RefPascalAST resultType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ typeIdentifier(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::typeIdentifier(RefPascalAST _t) {
+ RefPascalAST typeIdentifier_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefPascalAST tmp41_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHAR:
+ {
+ RefPascalAST tmp42_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHAR);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BOOLEAN:
+ {
+ RefPascalAST tmp43_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BOOLEAN);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case INTEGER:
+ {
+ RefPascalAST tmp44_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),INTEGER);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case REAL:
+ {
+ RefPascalAST tmp45_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STRING:
+ {
+ RefPascalAST __t46 = _t;
+ RefPascalAST tmp46_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STRING);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IDENT:
+ {
+ RefPascalAST tmp47_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_INT:
+ {
+ RefPascalAST tmp48_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp49_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t46;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::structuredType(RefPascalAST _t) {
+ RefPascalAST structuredType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PACKED:
+ {
+ RefPascalAST __t49 = _t;
+ RefPascalAST tmp50_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PACKED);
+ _t = _t->getFirstChild();
+ unpackedStructuredType(_t);
+ _t = _retTree;
+ _t = __t49;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case ARRAY:
+ case RECORD:
+ case SET:
+ case FILE:
+ {
+ unpackedStructuredType(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::unpackedStructuredType(RefPascalAST _t) {
+ RefPascalAST unpackedStructuredType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARRAY:
+ {
+ arrayType(_t);
+ _t = _retTree;
+ break;
+ }
+ case RECORD:
+ {
+ recordType(_t);
+ _t = _retTree;
+ break;
+ }
+ case SET:
+ {
+ setType(_t);
+ _t = _retTree;
+ break;
+ }
+ case FILE:
+ {
+ fileType(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+/** Note here that the syntactic diff between brackets disappears.
+ * If the brackets mean different things semantically, we need
+ * two different alternatives here.
+ */
+void PascalStoreWalker::arrayType(RefPascalAST _t) {
+ RefPascalAST arrayType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t52 = _t;
+ RefPascalAST tmp51_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARRAY);
+ _t = _t->getFirstChild();
+ typeList(_t);
+ _t = _retTree;
+ type(_t);
+ _t = _retTree;
+ _t = __t52;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::recordType(RefPascalAST _t) {
+ RefPascalAST recordType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t58 = _t;
+ RefPascalAST tmp52_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),RECORD);
+ _t = _t->getFirstChild();
+ fieldList(_t);
+ _t = _retTree;
+ _t = __t58;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::setType(RefPascalAST _t) {
+ RefPascalAST setType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t78 = _t;
+ RefPascalAST tmp53_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SET);
+ _t = _t->getFirstChild();
+ type(_t);
+ _t = _retTree;
+ _t = __t78;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::fileType(RefPascalAST _t) {
+ RefPascalAST fileType_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t80 = _t;
+ RefPascalAST tmp54_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FILE);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case SCALARTYPE:
+ case ARRAY:
+ case INTEGER:
+ case BOOLEAN:
+ case CHAR:
+ case DOTDOT:
+ case REAL:
+ case STRING:
+ case PACKED:
+ case RECORD:
+ case SET:
+ case FILE:
+ case POINTER:
+ case IDENT:
+ {
+ type(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t80;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::typeList(RefPascalAST _t) {
+ RefPascalAST typeList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t54 = _t;
+ RefPascalAST tmp55_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TYPELIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt56=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_1.member(_t->getType()))) {
+ type(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt56>=1 ) { goto _loop56; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt56++;
+ }
+ _loop56:;
+ } // ( ... )+
+ _t = __t54;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::fieldList(RefPascalAST _t) {
+ RefPascalAST fieldList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t60 = _t;
+ RefPascalAST tmp56_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FIELDLIST);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FIELD:
+ {
+ fixedPart(_t);
+ _t = _retTree;
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case CASE:
+ {
+ variantPart(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ break;
+ }
+ case CASE:
+ {
+ variantPart(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t60;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::fixedPart(RefPascalAST _t) {
+ RefPascalAST fixedPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt65=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == FIELD)) {
+ recordSection(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt65>=1 ) { goto _loop65; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt65++;
+ }
+ _loop65:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::variantPart(RefPascalAST _t) {
+ RefPascalAST variantPart_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t69 = _t;
+ RefPascalAST tmp57_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE);
+ _t = _t->getFirstChild();
+ tag(_t);
+ _t = _retTree;
+ { // ( ... )+
+ int _cnt71=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == VARIANT_CASE)) {
+ variant(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt71>=1 ) { goto _loop71; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt71++;
+ }
+ _loop71:;
+ } // ( ... )+
+ _t = __t69;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::recordSection(RefPascalAST _t) {
+ RefPascalAST recordSection_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t67 = _t;
+ RefPascalAST tmp58_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FIELD);
+ _t = _t->getFirstChild();
+ identifierList(_t);
+ _t = _retTree;
+ type(_t);
+ _t = _retTree;
+ _t = __t67;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::tag(RefPascalAST _t) {
+ RefPascalAST tag_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case VARIANT_TAG:
+ {
+ RefPascalAST __t73 = _t;
+ RefPascalAST tmp59_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_TAG);
+ _t = _t->getFirstChild();
+ identifier(_t);
+ _t = _retTree;
+ typeIdentifier(_t);
+ _t = _retTree;
+ _t = __t73;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case VARIANT_TAG_NO_ID:
+ {
+ RefPascalAST __t74 = _t;
+ RefPascalAST tmp60_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_TAG_NO_ID);
+ _t = _t->getFirstChild();
+ typeIdentifier(_t);
+ _t = _retTree;
+ _t = __t74;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::variant(RefPascalAST _t) {
+ RefPascalAST variant_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t76 = _t;
+ RefPascalAST tmp61_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARIANT_CASE);
+ _t = _t->getFirstChild();
+ constList(_t);
+ _t = _retTree;
+ fieldList(_t);
+ _t = _retTree;
+ _t = __t76;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::constList(RefPascalAST _t) {
+ RefPascalAST constList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t108 = _t;
+ RefPascalAST tmp62_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CONSTLIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt110=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_2.member(_t->getType()))) {
+ constant(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt110>=1 ) { goto _loop110; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt110++;
+ }
+ _loop110:;
+ } // ( ... )+
+ _t = __t108;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::variableDeclaration(RefPascalAST _t) {
+ RefPascalAST variableDeclaration_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t87 = _t;
+ RefPascalAST tmp63_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VARDECL);
+ _t = _t->getFirstChild();
+ identifierList(_t);
+ _t = _retTree;
+ type(_t);
+ _t = _retTree;
+ _t = __t87;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::procedureOrFunctionDeclaration(RefPascalAST _t) {
+ RefPascalAST procedureOrFunctionDeclaration_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROCEDURE:
+ {
+ procedureDeclaration(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNCTION:
+ {
+ functionDeclaration(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::procedureDeclaration(RefPascalAST _t) {
+ RefPascalAST procedureDeclaration_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t91 = _t;
+ RefPascalAST tmp64_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp65_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGDECLS:
+ {
+ formalParameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case BLOCK:
+ case USES:
+ case IMPLEMENTATION:
+ case LABEL:
+ case CONST:
+ case TYPE:
+ case VAR:
+ case PROCEDURE:
+ case FUNCTION:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ block(_t);
+ _t = _retTree;
+ _t = __t91;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::functionDeclaration(RefPascalAST _t) {
+ RefPascalAST functionDeclaration_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t112 = _t;
+ RefPascalAST tmp66_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp67_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGDECLS:
+ {
+ formalParameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case INTEGER:
+ case BOOLEAN:
+ case CHAR:
+ case REAL:
+ case STRING:
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ resultType(_t);
+ _t = _retTree;
+ block(_t);
+ _t = _retTree;
+ _t = __t112;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::formalParameterSection(RefPascalAST _t) {
+ RefPascalAST formalParameterSection_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGDECL:
+ {
+ parameterGroup(_t);
+ _t = _retTree;
+ break;
+ }
+ case VAR:
+ {
+ RefPascalAST __t98 = _t;
+ RefPascalAST tmp68_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),VAR);
+ _t = _t->getFirstChild();
+ parameterGroup(_t);
+ _t = _retTree;
+ _t = __t98;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNCTION:
+ {
+ RefPascalAST __t99 = _t;
+ RefPascalAST tmp69_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNCTION);
+ _t = _t->getFirstChild();
+ parameterGroup(_t);
+ _t = _retTree;
+ _t = __t99;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PROCEDURE:
+ {
+ RefPascalAST __t100 = _t;
+ RefPascalAST tmp70_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROCEDURE);
+ _t = _t->getFirstChild();
+ parameterGroup(_t);
+ _t = _retTree;
+ _t = __t100;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::parameterGroup(RefPascalAST _t) {
+ RefPascalAST parameterGroup_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t102 = _t;
+ RefPascalAST tmp71_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARGDECL);
+ _t = _t->getFirstChild();
+ identifierList(_t);
+ _t = _retTree;
+ typeIdentifier(_t);
+ _t = _retTree;
+ _t = __t102;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::statement(RefPascalAST _t) {
+ RefPascalAST statement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case COLON:
+ {
+ RefPascalAST __t116 = _t;
+ RefPascalAST tmp72_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COLON);
+ _t = _t->getFirstChild();
+ label(_t);
+ _t = _retTree;
+ unlabelledStatement(_t);
+ _t = _retTree;
+ _t = __t116;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case BLOCK:
+ case PROC_CALL:
+ case ASSIGN:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ {
+ unlabelledStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::unlabelledStatement(RefPascalAST _t) {
+ RefPascalAST unlabelledStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case PROC_CALL:
+ case ASSIGN:
+ case GOTO:
+ {
+ simpleStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case BLOCK:
+ case CASE:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ {
+ structuredStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::simpleStatement(RefPascalAST _t) {
+ RefPascalAST simpleStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ASSIGN:
+ {
+ assignmentStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case PROC_CALL:
+ {
+ procedureStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case GOTO:
+ {
+ gotoStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::structuredStatement(RefPascalAST _t) {
+ RefPascalAST structuredStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BLOCK:
+ {
+ compoundStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case CASE:
+ case IF:
+ {
+ conditionalStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ {
+ repetetiveStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case WITH:
+ {
+ withStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::assignmentStatement(RefPascalAST _t) {
+ RefPascalAST assignmentStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t120 = _t;
+ RefPascalAST tmp73_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ASSIGN);
+ _t = _t->getFirstChild();
+ variable(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t120;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::procedureStatement(RefPascalAST _t) {
+ RefPascalAST procedureStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t166 = _t;
+ RefPascalAST tmp74_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PROC_CALL);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp75_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGLIST:
+ {
+ parameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t166;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::gotoStatement(RefPascalAST _t) {
+ RefPascalAST gotoStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t170 = _t;
+ RefPascalAST tmp76_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GOTO);
+ _t = _t->getFirstChild();
+ label(_t);
+ _t = _retTree;
+ _t = __t170;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+/** A variable is an id with a suffix and can look like:
+ * id
+ * id[expr,...]
+ * id.id
+ * id.id[expr,...]
+ * id^
+ * id^.id
+ * id^.id[expr,...]
+ * ...
+ *
+ * LL has a really hard time with this construct as it's naturally
+ * left-recursive. We have to turn into a simple loop rather than
+ * recursive loop, hence, the suffixes. I keep in the same rule
+ * for easy tree construction.
+ */
+void PascalStoreWalker::variable(RefPascalAST _t) {
+ RefPascalAST variable_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case LBRACK:
+ {
+ RefPascalAST __t122 = _t;
+ RefPascalAST tmp77_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LBRACK);
+ _t = _t->getFirstChild();
+ variable(_t);
+ _t = _retTree;
+ { // ( ... )+
+ int _cnt124=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_3.member(_t->getType()))) {
+ expression(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt124>=1 ) { goto _loop124; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt124++;
+ }
+ _loop124:;
+ } // ( ... )+
+ _t = __t122;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LBRACK2:
+ {
+ RefPascalAST __t125 = _t;
+ RefPascalAST tmp78_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LBRACK2);
+ _t = _t->getFirstChild();
+ variable(_t);
+ _t = _retTree;
+ { // ( ... )+
+ int _cnt127=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_3.member(_t->getType()))) {
+ expression(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt127>=1 ) { goto _loop127; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt127++;
+ }
+ _loop127:;
+ } // ( ... )+
+ _t = __t125;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ {
+ RefPascalAST __t128 = _t;
+ RefPascalAST tmp79_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOT);
+ _t = _t->getFirstChild();
+ variable(_t);
+ _t = _retTree;
+ RefPascalAST tmp80_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ _t = __t128;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case POINTER:
+ {
+ RefPascalAST __t129 = _t;
+ RefPascalAST tmp81_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),POINTER);
+ _t = _t->getFirstChild();
+ variable(_t);
+ _t = _retTree;
+ _t = __t129;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AT:
+ {
+ RefPascalAST __t130 = _t;
+ RefPascalAST tmp82_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AT);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp83_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ _t = __t130;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IDENT:
+ {
+ RefPascalAST tmp84_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::expression(RefPascalAST _t) {
+ RefPascalAST expression_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case EQUAL:
+ {
+ RefPascalAST __t132 = _t;
+ RefPascalAST tmp85_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),EQUAL);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t132;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ RefPascalAST __t133 = _t;
+ RefPascalAST tmp86_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT_EQUAL);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t133;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LTH:
+ {
+ RefPascalAST __t134 = _t;
+ RefPascalAST tmp87_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LTH);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t134;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case LE:
+ {
+ RefPascalAST __t135 = _t;
+ RefPascalAST tmp88_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),LE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t135;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GE:
+ {
+ RefPascalAST __t136 = _t;
+ RefPascalAST tmp89_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t136;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case GT:
+ {
+ RefPascalAST __t137 = _t;
+ RefPascalAST tmp90_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),GT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t137;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case IN:
+ {
+ RefPascalAST __t138 = _t;
+ RefPascalAST tmp91_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IN);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t138;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case PLUS:
+ {
+ RefPascalAST __t139 = _t;
+ RefPascalAST tmp92_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),PLUS);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FUNC_CALL:
+ case DOT:
+ case EQUAL:
+ case NUM_INT:
+ case LBRACK:
+ case SET:
+ case POINTER:
+ case LE:
+ case GE:
+ case LTH:
+ case GT:
+ case NOT_EQUAL:
+ case IN:
+ case PLUS:
+ case MINUS:
+ case OR:
+ case STAR:
+ case SLASH:
+ case DIV:
+ case MOD:
+ case AND:
+ case NOT:
+ case AT:
+ case LBRACK2:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ case IDENT:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t139;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MINUS:
+ {
+ RefPascalAST __t141 = _t;
+ RefPascalAST tmp93_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MINUS);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case FUNC_CALL:
+ case DOT:
+ case EQUAL:
+ case NUM_INT:
+ case LBRACK:
+ case SET:
+ case POINTER:
+ case LE:
+ case GE:
+ case LTH:
+ case GT:
+ case NOT_EQUAL:
+ case IN:
+ case PLUS:
+ case MINUS:
+ case OR:
+ case STAR:
+ case SLASH:
+ case DIV:
+ case MOD:
+ case AND:
+ case NOT:
+ case AT:
+ case LBRACK2:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ case IDENT:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t141;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case OR:
+ {
+ RefPascalAST __t143 = _t;
+ RefPascalAST tmp94_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),OR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t143;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STAR:
+ {
+ RefPascalAST __t144 = _t;
+ RefPascalAST tmp95_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),STAR);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t144;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case SLASH:
+ {
+ RefPascalAST __t145 = _t;
+ RefPascalAST tmp96_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SLASH);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t145;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DIV:
+ {
+ RefPascalAST __t146 = _t;
+ RefPascalAST tmp97_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DIV);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t146;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case MOD:
+ {
+ RefPascalAST __t147 = _t;
+ RefPascalAST tmp98_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),MOD);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t147;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case AND:
+ {
+ RefPascalAST __t148 = _t;
+ RefPascalAST tmp99_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),AND);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t148;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NOT:
+ {
+ RefPascalAST __t149 = _t;
+ RefPascalAST tmp100_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NOT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ _t = __t149;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOT:
+ case LBRACK:
+ case POINTER:
+ case AT:
+ case LBRACK2:
+ case IDENT:
+ {
+ variable(_t);
+ _t = _retTree;
+ break;
+ }
+ case FUNC_CALL:
+ {
+ functionDesignator(_t);
+ _t = _retTree;
+ break;
+ }
+ case SET:
+ {
+ set(_t);
+ _t = _retTree;
+ break;
+ }
+ case NUM_INT:
+ {
+ RefPascalAST tmp101_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp102_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case CHR:
+ {
+ RefPascalAST __t150 = _t;
+ RefPascalAST tmp103_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CHR);
+ _t = _t->getFirstChild();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case NUM_INT:
+ {
+ RefPascalAST tmp104_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_INT);
+ _t = _t->getNextSibling();
+ break;
+ }
+ case NUM_REAL:
+ {
+ RefPascalAST tmp105_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NUM_REAL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t150;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ string(_t);
+ _t = _retTree;
+ break;
+ }
+ case NIL:
+ {
+ RefPascalAST tmp106_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),NIL);
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::functionDesignator(RefPascalAST _t) {
+ RefPascalAST functionDesignator_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t153 = _t;
+ RefPascalAST tmp107_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FUNC_CALL);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp108_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case ARGLIST:
+ {
+ parameterList(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t153;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::set(RefPascalAST _t) {
+ RefPascalAST set_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t160 = _t;
+ RefPascalAST tmp109_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),SET);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_4.member(_t->getType()))) {
+ element(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop162;
+ }
+
+ }
+ _loop162:;
+ } // ( ... )*
+ _t = __t160;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::parameterList(RefPascalAST _t) {
+ RefPascalAST parameterList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t156 = _t;
+ RefPascalAST tmp110_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),ARGLIST);
+ _t = _t->getFirstChild();
+ { // ( ... )+
+ int _cnt158=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_3.member(_t->getType()))) {
+ actualParameter(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt158>=1 ) { goto _loop158; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt158++;
+ }
+ _loop158:;
+ } // ( ... )+
+ _t = __t156;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::actualParameter(RefPascalAST _t) {
+ RefPascalAST actualParameter_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ expression(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::element(RefPascalAST _t) {
+ RefPascalAST element_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case DOTDOT:
+ {
+ RefPascalAST __t164 = _t;
+ RefPascalAST tmp111_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOTDOT);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t164;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case FUNC_CALL:
+ case DOT:
+ case EQUAL:
+ case NUM_INT:
+ case LBRACK:
+ case SET:
+ case POINTER:
+ case LE:
+ case GE:
+ case LTH:
+ case GT:
+ case NOT_EQUAL:
+ case IN:
+ case PLUS:
+ case MINUS:
+ case OR:
+ case STAR:
+ case SLASH:
+ case DIV:
+ case MOD:
+ case AND:
+ case NOT:
+ case AT:
+ case LBRACK2:
+ case STRING_LITERAL:
+ case CHR:
+ case NIL:
+ case NUM_REAL:
+ case IDENT:
+ {
+ expression(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::conditionalStatement(RefPascalAST _t) {
+ RefPascalAST conditionalStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case IF:
+ {
+ ifStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case CASE:
+ {
+ caseStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::repetetiveStatement(RefPascalAST _t) {
+ RefPascalAST repetetiveStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case WHILE:
+ {
+ whileStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case REPEAT:
+ {
+ repeatStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ case FOR:
+ {
+ forStatement(_t);
+ _t = _retTree;
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::withStatement(RefPascalAST _t) {
+ RefPascalAST withStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t201 = _t;
+ RefPascalAST tmp112_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WITH);
+ _t = _t->getFirstChild();
+ recordVariableList(_t);
+ _t = _retTree;
+ statement(_t);
+ _t = _retTree;
+ _t = __t201;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::statements(RefPascalAST _t) {
+ RefPascalAST statements_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t174 = _t;
+ RefPascalAST tmp113_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),BLOCK);
+ _t = _t->getFirstChild();
+ { // ( ... )*
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_5.member(_t->getType()))) {
+ statement(_t);
+ _t = _retTree;
+ }
+ else {
+ goto _loop176;
+ }
+
+ }
+ _loop176:;
+ } // ( ... )*
+ _t = __t174;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::ifStatement(RefPascalAST _t) {
+ RefPascalAST ifStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t179 = _t;
+ RefPascalAST tmp114_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IF);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ statement(_t);
+ _t = _retTree;
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BLOCK:
+ case PROC_CALL:
+ case COLON:
+ case ASSIGN:
+ case CASE:
+ case GOTO:
+ case IF:
+ case WHILE:
+ case REPEAT:
+ case FOR:
+ case WITH:
+ {
+ statement(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t179;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::caseStatement(RefPascalAST _t) {
+ RefPascalAST caseStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t182 = _t;
+ RefPascalAST tmp115_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),CASE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ { // ( ... )+
+ int _cnt184=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_t->getType() == COLON)) {
+ caseListElement(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt184>=1 ) { goto _loop184; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt184++;
+ }
+ _loop184:;
+ } // ( ... )+
+ {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case BLOCK:
+ {
+ statements(_t);
+ _t = _retTree;
+ break;
+ }
+ case 3:
+ {
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ _t = __t182;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::caseListElement(RefPascalAST _t) {
+ RefPascalAST caseListElement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t187 = _t;
+ RefPascalAST tmp116_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),COLON);
+ _t = _t->getFirstChild();
+ constList(_t);
+ _t = _retTree;
+ statement(_t);
+ _t = _retTree;
+ _t = __t187;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::whileStatement(RefPascalAST _t) {
+ RefPascalAST whileStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t190 = _t;
+ RefPascalAST tmp117_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),WHILE);
+ _t = _t->getFirstChild();
+ expression(_t);
+ _t = _retTree;
+ statement(_t);
+ _t = _retTree;
+ _t = __t190;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::repeatStatement(RefPascalAST _t) {
+ RefPascalAST repeatStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t192 = _t;
+ RefPascalAST tmp118_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),REPEAT);
+ _t = _t->getFirstChild();
+ statements(_t);
+ _t = _retTree;
+ expression(_t);
+ _t = _retTree;
+ _t = __t192;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::forStatement(RefPascalAST _t) {
+ RefPascalAST forStatement_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ RefPascalAST __t194 = _t;
+ RefPascalAST tmp119_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),FOR);
+ _t = _t->getFirstChild();
+ RefPascalAST tmp120_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),IDENT);
+ _t = _t->getNextSibling();
+ forList(_t);
+ _t = _retTree;
+ statement(_t);
+ _t = _retTree;
+ _t = __t194;
+ _t = _t->getNextSibling();
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::forList(RefPascalAST _t) {
+ RefPascalAST forList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ switch ( _t->getType()) {
+ case TO:
+ {
+ RefPascalAST __t196 = _t;
+ RefPascalAST tmp121_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),TO);
+ _t = _t->getFirstChild();
+ initialValue(_t);
+ _t = _retTree;
+ finalValue(_t);
+ _t = _retTree;
+ _t = __t196;
+ _t = _t->getNextSibling();
+ break;
+ }
+ case DOWNTO:
+ {
+ RefPascalAST __t197 = _t;
+ RefPascalAST tmp122_AST_in = _t;
+ match(ANTLR_USE_NAMESPACE(antlr)RefAST(_t),DOWNTO);
+ _t = _t->getFirstChild();
+ initialValue(_t);
+ _t = _retTree;
+ finalValue(_t);
+ _t = _retTree;
+ _t = __t197;
+ _t = _t->getNextSibling();
+ break;
+ }
+ default:
+ {
+ throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));
+ }
+ }
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::initialValue(RefPascalAST _t) {
+ RefPascalAST initialValue_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ expression(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::finalValue(RefPascalAST _t) {
+ RefPascalAST finalValue_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ expression(_t);
+ _t = _retTree;
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::recordVariableList(RefPascalAST _t) {
+ RefPascalAST recordVariableList_AST_in = (_t == RefPascalAST(ASTNULL)) ? RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) : _t;
+
+ try { // for error handling
+ { // ( ... )+
+ int _cnt204=0;
+ for (;;) {
+ if (_t == RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = ASTNULL;
+ if ((_tokenSet_6.member(_t->getType()))) {
+ variable(_t);
+ _t = _retTree;
+ }
+ else {
+ if ( _cnt204>=1 ) { goto _loop204; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(ANTLR_USE_NAMESPACE(antlr)RefAST(_t));}
+ }
+
+ _cnt204++;
+ }
+ _loop204:;
+ } // ( ... )+
+ }
+ catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
+ reportError(ex);
+ if ( _t != RefPascalAST(ANTLR_USE_NAMESPACE(antlr)nullAST) )
+ _t = _t->getNextSibling();
+ }
+ _retTree = _t;
+}
+
+void PascalStoreWalker::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& )
+{
+}
+const char* PascalStoreWalker::tokenNames[] = {
+ "<0>",
+ "EOF",
+ "<2>",
+ "NULL_TREE_LOOKAHEAD",
+ "BLOCK",
+ "IDLIST",
+ "ELIST",
+ "FUNC_CALL",
+ "PROC_CALL",
+ "SCALARTYPE",
+ "TYPELIST",
+ "VARIANT_TAG",
+ "VARIANT_TAG_NO_ID",
+ "VARIANT_CASE",
+ "CONSTLIST",
+ "FIELDLIST",
+ "ARGDECLS",
+ "VARDECL",
+ "ARGDECL",
+ "ARGLIST",
+ "TYPEDECL",
+ "FIELD",
+ "DOT",
+ "\"library\"",
+ "SEMI",
+ "\"end\"",
+ "\"exports\"",
+ "COMMA",
+ "\"index\"",
+ "\"name\"",
+ "\"uses\"",
+ "\"unit\"",
+ "\"interface\"",
+ "\"implementation\"",
+ "\"begin\"",
+ "\"program\"",
+ "LPAREN",
+ "RPAREN",
+ "\"initialization\"",
+ "\"finalization\"",
+ "\"label\"",
+ "\"const\"",
+ "\"resourcestring\"",
+ "EQUAL",
+ "\"type\"",
+ "\"var\"",
+ "COLON",
+ "\"procedure\"",
+ "\"forward\"",
+ "\"function\"",
+ "\"array\"",
+ "\"of\"",
+ "\"external\"",
+ "\"public\"",
+ "\"alias\"",
+ "INTERRUPT",
+ "\"export\"",
+ "\"register\"",
+ "\"pascal\"",
+ "\"cdecl\"",
+ "\"stdcall\"",
+ "\"popstack\"",
+ "\"saveregisters\"",
+ "\"inline\"",
+ "\"safecall\"",
+ "\"near\"",
+ "\"far\"",
+ "NUM_INT",
+ "\"integer\"",
+ "\"shortint\"",
+ "\"smallint\"",
+ "\"longint\"",
+ "\"int64\"",
+ "\"byte\"",
+ "\"word\"",
+ "\"cardinal\"",
+ "\"qword\"",
+ "\"boolean\"",
+ "BYTEBOOL",
+ "LONGBOOL",
+ "\"char\"",
+ "DOTDOT",
+ "ASSIGN",
+ "\"real\"",
+ "\"single\"",
+ "\"double\"",
+ "\"extended\"",
+ "\"comp\"",
+ "\"string\"",
+ "LBRACK",
+ "RBRACK",
+ "\"packed\"",
+ "\"record\"",
+ "\"case\"",
+ "\"set\"",
+ "\"file\"",
+ "POINTER",
+ "\"object\"",
+ "\"virtual\"",
+ "\"abstract\"",
+ "\"private\"",
+ "\"protected\"",
+ "\"constructor\"",
+ "\"destructor\"",
+ "\"class\"",
+ "\"override\"",
+ "MESSAGE",
+ "\"published\"",
+ "\"property\"",
+ "\"read\"",
+ "\"write\"",
+ "\"default\"",
+ "\"nodefault\"",
+ "LE",
+ "GE",
+ "LTH",
+ "GT",
+ "NOT_EQUAL",
+ "\"in\"",
+ "\"is\"",
+ "PLUS",
+ "MINUS",
+ "\"or\"",
+ "\"xor\"",
+ "STAR",
+ "SLASH",
+ "\"div\"",
+ "\"mod\"",
+ "\"and\"",
+ "\"shl\"",
+ "\"shr\"",
+ "\"not\"",
+ "\"true\"",
+ "\"false\"",
+ "AT",
+ "PLUSEQ",
+ "MINUSEQ",
+ "STAREQ",
+ "SLASHQE",
+ "\"goto\"",
+ "\"if\"",
+ "\"then\"",
+ "\"else\"",
+ "\"while\"",
+ "\"do\"",
+ "\"repeat\"",
+ "\"until\"",
+ "\"for\"",
+ "\"to\"",
+ "\"downto\"",
+ "\"with\"",
+ "LBRACK2",
+ "RBRACK2",
+ "\"operator\"",
+ "\"raise\"",
+ "\"try\"",
+ "\"except\"",
+ "\"finally\"",
+ "\"on\"",
+ "STRING_LITERAL",
+ "\"chr\"",
+ "\"nil\"",
+ "NUM_REAL",
+ "IDENT",
+ "\"absolute\"",
+ "\"as\"",
+ "\"asm\"",
+ "\"assembler\"",
+ "\"break\"",
+ "\"continue\"",
+ "\"dispose\"",
+ "\"exit\"",
+ "\"inherited\"",
+ "\"new\"",
+ "\"self\"",
+ "METHOD",
+ "ADDSUBOR",
+ "ASSIGNEQUAL",
+ "SIGN",
+ "FUNC",
+ "NODE_NOT_EMIT",
+ "MYASTVAR",
+ "LF",
+ "LCURLY",
+ "RCURLY",
+ "WS",
+ "COMMENT_1",
+ "COMMENT_2",
+ "COMMENT_3",
+ "EXPONENT",
+ 0
+};
+
+const unsigned long PascalStoreWalker::_tokenSet_0_data_[] = { 262144UL, 172032UL, 0UL, 0UL, 0UL, 0UL };
+// ARGDECL "var" "procedure" "function"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_0(_tokenSet_0_data_,6);
+const unsigned long PascalStoreWalker::_tokenSet_1_data_[] = { 512UL, 262144UL, 3641384976UL, 1UL, 0UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// SCALARTYPE "array" "integer" "boolean" "char" DOTDOT "real" "string"
+// "packed" "record" "set" "file" POINTER IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_1(_tokenSet_1_data_,12);
+const unsigned long PascalStoreWalker::_tokenSet_2_data_[] = { 0UL, 0UL, 8UL, 50331648UL, 2147483648UL, 13UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// NUM_INT PLUS MINUS STRING_LITERAL "chr" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_2(_tokenSet_2_data_,12);
+const unsigned long PascalStoreWalker::_tokenSet_3_data_[] = { 4194432UL, 2048UL, 1107296264UL, 4152229889UL, 2155872329UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// FUNC_CALL DOT EQUAL NUM_INT LBRACK "set" POINTER LE GE LTH GT NOT_EQUAL
+// "in" PLUS MINUS "or" STAR SLASH "div" "mod" "and" "not" AT LBRACK2 STRING_LITERAL
+// "chr" "nil" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_3(_tokenSet_3_data_,12);
+const unsigned long PascalStoreWalker::_tokenSet_4_data_[] = { 4194432UL, 2048UL, 1107427336UL, 4152229889UL, 2155872329UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// FUNC_CALL DOT EQUAL NUM_INT DOTDOT LBRACK "set" POINTER LE GE LTH GT
+// NOT_EQUAL "in" PLUS MINUS "or" STAR SLASH "div" "mod" "and" "not" AT
+// LBRACK2 STRING_LITERAL "chr" "nil" NUM_REAL IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_4(_tokenSet_4_data_,12);
+const unsigned long PascalStoreWalker::_tokenSet_5_data_[] = { 272UL, 16384UL, 537133056UL, 0UL, 4888576UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// BLOCK PROC_CALL COLON ASSIGN "case" "goto" "if" "while" "repeat" "for"
+// "with"
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_5(_tokenSet_5_data_,12);
+const unsigned long PascalStoreWalker::_tokenSet_6_data_[] = { 4194304UL, 0UL, 33554432UL, 1UL, 8388672UL, 8UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
+// DOT LBRACK POINTER AT LBRACK2 IDENT
+const ANTLR_USE_NAMESPACE(antlr)BitSet PascalStoreWalker::_tokenSet_6(_tokenSet_6_data_,12);
+
+
diff --git a/languages/pascal/PascalStoreWalker.hpp b/languages/pascal/PascalStoreWalker.hpp
new file mode 100644
index 00000000..bc354743
--- /dev/null
+++ b/languages/pascal/PascalStoreWalker.hpp
@@ -0,0 +1,172 @@
+#ifndef INC_PascalStoreWalker_hpp_
+#define INC_PascalStoreWalker_hpp_
+
+#line 20 "pascal.tree.g"
+
+ #include <codemodel.h>
+ #include "PascalAST.hpp"
+
+ #include <qstring.h>
+ #include <qstringlist.h>
+ #include <qfileinfo.h>
+
+#line 14 "PascalStoreWalker.hpp"
+#include <antlr/config.hpp>
+#include "PascalStoreWalkerTokenTypes.hpp"
+/* $ANTLR 2.7.7 (20061129): "pascal.tree.g" -> "PascalStoreWalker.hpp"$ */
+#include <antlr/TreeParser.hpp>
+
+#line 29 "pascal.tree.g"
+
+ #include <codemodel.h>
+ #include <kdebug.h>
+
+#line 25 "PascalStoreWalker.hpp"
+class CUSTOM_API PascalStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public PascalStoreWalkerTokenTypes
+{
+#line 47 "pascal.tree.g"
+
+private:
+ QString m_fileName;
+ QStringList m_currentScope;
+ int m_currentAccess;
+ int m_anon;
+ CodeModel* m_model;
+
+public:
+ void setCodeModel( CodeModel* model ) { m_model = model; }
+ CodeModel* codeModel() { return m_model; }
+ const CodeModel* codeModel() const { return m_model; }
+
+ QString fileName() const { return m_fileName; }
+ void setFileName( const QString& fileName ) { m_fileName = fileName; }
+
+ void init(){
+ m_currentScope.clear();
+ m_currentAccess = CodeModelItem::Public;
+ m_anon = 0;
+ }
+
+ void wipeout() { m_model->wipeout(); }
+#line 29 "PascalStoreWalker.hpp"
+public:
+ PascalStoreWalker();
+ static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
+ int getNumTokens() const
+ {
+ return PascalStoreWalker::NUM_TOKENS;
+ }
+ const char* getTokenName( int type ) const
+ {
+ if( type > getNumTokens() ) return 0;
+ return PascalStoreWalker::tokenNames[type];
+ }
+ const char* const* getTokenNames() const
+ {
+ return PascalStoreWalker::tokenNames;
+ }
+ public: void program(RefPascalAST _t);
+ public: void programHeading(RefPascalAST _t);
+ public: void block(RefPascalAST _t);
+ public: void identifierList(RefPascalAST _t);
+ public: void identifier(RefPascalAST _t);
+ public: void labelDeclarationPart(RefPascalAST _t);
+ public: void constantDefinitionPart(RefPascalAST _t);
+ public: void typeDefinitionPart(RefPascalAST _t);
+ public: void variableDeclarationPart(RefPascalAST _t);
+ public: void procedureAndFunctionDeclarationPart(RefPascalAST _t);
+ public: void usesUnitsPart(RefPascalAST _t);
+ public: void compoundStatement(RefPascalAST _t);
+ public: void label(RefPascalAST _t);
+ public: void constantDefinition(RefPascalAST _t);
+ public: void constant(RefPascalAST _t);
+ public: void string(RefPascalAST _t);
+ public: void typeDefinition(RefPascalAST _t);
+ public: void type(RefPascalAST _t);
+ public: void formalParameterList(RefPascalAST _t);
+ public: void resultType(RefPascalAST _t);
+ public: void typeIdentifier(RefPascalAST _t);
+ public: void structuredType(RefPascalAST _t);
+ public: void unpackedStructuredType(RefPascalAST _t);
+ public: void arrayType(RefPascalAST _t);
+ public: void recordType(RefPascalAST _t);
+ public: void setType(RefPascalAST _t);
+ public: void fileType(RefPascalAST _t);
+ public: void typeList(RefPascalAST _t);
+ public: void fieldList(RefPascalAST _t);
+ public: void fixedPart(RefPascalAST _t);
+ public: void variantPart(RefPascalAST _t);
+ public: void recordSection(RefPascalAST _t);
+ public: void tag(RefPascalAST _t);
+ public: void variant(RefPascalAST _t);
+ public: void constList(RefPascalAST _t);
+ public: void variableDeclaration(RefPascalAST _t);
+ public: void procedureOrFunctionDeclaration(RefPascalAST _t);
+ public: void procedureDeclaration(RefPascalAST _t);
+ public: void functionDeclaration(RefPascalAST _t);
+ public: void formalParameterSection(RefPascalAST _t);
+ public: void parameterGroup(RefPascalAST _t);
+ public: void statement(RefPascalAST _t);
+ public: void unlabelledStatement(RefPascalAST _t);
+ public: void simpleStatement(RefPascalAST _t);
+ public: void structuredStatement(RefPascalAST _t);
+ public: void assignmentStatement(RefPascalAST _t);
+ public: void procedureStatement(RefPascalAST _t);
+ public: void gotoStatement(RefPascalAST _t);
+ public: void variable(RefPascalAST _t);
+ public: void expression(RefPascalAST _t);
+ public: void functionDesignator(RefPascalAST _t);
+ public: void set(RefPascalAST _t);
+ public: void parameterList(RefPascalAST _t);
+ public: void actualParameter(RefPascalAST _t);
+ public: void element(RefPascalAST _t);
+ public: void conditionalStatement(RefPascalAST _t);
+ public: void repetetiveStatement(RefPascalAST _t);
+ public: void withStatement(RefPascalAST _t);
+ public: void statements(RefPascalAST _t);
+ public: void ifStatement(RefPascalAST _t);
+ public: void caseStatement(RefPascalAST _t);
+ public: void caseListElement(RefPascalAST _t);
+ public: void whileStatement(RefPascalAST _t);
+ public: void repeatStatement(RefPascalAST _t);
+ public: void forStatement(RefPascalAST _t);
+ public: void forList(RefPascalAST _t);
+ public: void initialValue(RefPascalAST _t);
+ public: void finalValue(RefPascalAST _t);
+ public: void recordVariableList(RefPascalAST _t);
+public:
+ ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
+ {
+ return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
+ }
+
+protected:
+ RefPascalAST returnAST;
+ RefPascalAST _retTree;
+private:
+ static const char* tokenNames[];
+#ifndef NO_STATIC_CONSTS
+ static const int NUM_TOKENS = 190;
+#else
+ enum {
+ NUM_TOKENS = 190
+ };
+#endif
+
+ static const unsigned long _tokenSet_0_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
+ static const unsigned long _tokenSet_1_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
+ static const unsigned long _tokenSet_2_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
+ static const unsigned long _tokenSet_3_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
+ static const unsigned long _tokenSet_4_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
+ static const unsigned long _tokenSet_5_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
+ static const unsigned long _tokenSet_6_data_[];
+ static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
+};
+
+#endif /*INC_PascalStoreWalker_hpp_*/
diff --git a/languages/pascal/PascalStoreWalkerTokenTypes.hpp b/languages/pascal/PascalStoreWalkerTokenTypes.hpp
new file mode 100644
index 00000000..0f4142f5
--- /dev/null
+++ b/languages/pascal/PascalStoreWalkerTokenTypes.hpp
@@ -0,0 +1,206 @@
+#ifndef INC_PascalStoreWalkerTokenTypes_hpp_
+#define INC_PascalStoreWalkerTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20061129): "pascal.tree.g" -> "PascalStoreWalkerTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API PascalStoreWalkerTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ BLOCK = 4,
+ IDLIST = 5,
+ ELIST = 6,
+ FUNC_CALL = 7,
+ PROC_CALL = 8,
+ SCALARTYPE = 9,
+ TYPELIST = 10,
+ VARIANT_TAG = 11,
+ VARIANT_TAG_NO_ID = 12,
+ VARIANT_CASE = 13,
+ CONSTLIST = 14,
+ FIELDLIST = 15,
+ ARGDECLS = 16,
+ VARDECL = 17,
+ ARGDECL = 18,
+ ARGLIST = 19,
+ TYPEDECL = 20,
+ FIELD = 21,
+ DOT = 22,
+ LIBRARY = 23,
+ SEMI = 24,
+ END = 25,
+ EXPORTS = 26,
+ COMMA = 27,
+ LITERAL_index = 28,
+ LITERAL_name = 29,
+ USES = 30,
+ UNIT = 31,
+ INTERFACE = 32,
+ IMPLEMENTATION = 33,
+ BEGIN = 34,
+ PROGRAM = 35,
+ LPAREN = 36,
+ RPAREN = 37,
+ INITIALIZATION = 38,
+ FINALIZATION = 39,
+ LABEL = 40,
+ CONST = 41,
+ RESOURCESTRING = 42,
+ EQUAL = 43,
+ TYPE = 44,
+ VAR = 45,
+ COLON = 46,
+ PROCEDURE = 47,
+ FORWARD = 48,
+ FUNCTION = 49,
+ ARRAY = 50,
+ OF = 51,
+ EXTERNAL = 52,
+ PUBLIC = 53,
+ ALIAS = 54,
+ INTERRUPT = 55,
+ EXPORT = 56,
+ REGISTER = 57,
+ PASCAL = 58,
+ CDECL = 59,
+ STDCALL = 60,
+ POPSTACK = 61,
+ SAVEREGISTERS = 62,
+ INLINE = 63,
+ SAFECALL = 64,
+ NEAR = 65,
+ FAR = 66,
+ NUM_INT = 67,
+ INTEGER = 68,
+ SHORTINT = 69,
+ SMALLINT = 70,
+ LONGINT = 71,
+ INT64 = 72,
+ BYTE = 73,
+ WORD = 74,
+ CARDINAL = 75,
+ QWORD = 76,
+ BOOLEAN = 77,
+ BYTEBOOL = 78,
+ LONGBOOL = 79,
+ CHAR = 80,
+ DOTDOT = 81,
+ ASSIGN = 82,
+ REAL = 83,
+ SINGLE = 84,
+ DOUBLE = 85,
+ EXTENDED = 86,
+ COMP = 87,
+ STRING = 88,
+ LBRACK = 89,
+ RBRACK = 90,
+ PACKED = 91,
+ RECORD = 92,
+ CASE = 93,
+ SET = 94,
+ FILE = 95,
+ POINTER = 96,
+ OBJECT = 97,
+ VIRTUAL = 98,
+ ABSTRACT = 99,
+ PRIVATE = 100,
+ PROTECTED = 101,
+ CONSTRUCTOR = 102,
+ DESTRUCTOR = 103,
+ CLASS = 104,
+ OVERRIDE = 105,
+ MESSAGE = 106,
+ PUBLISHED = 107,
+ PROPERTY = 108,
+ LITERAL_read = 109,
+ LITERAL_write = 110,
+ DEFAULT = 111,
+ LITERAL_nodefault = 112,
+ LE = 113,
+ GE = 114,
+ LTH = 115,
+ GT = 116,
+ NOT_EQUAL = 117,
+ IN = 118,
+ IS = 119,
+ PLUS = 120,
+ MINUS = 121,
+ OR = 122,
+ XOR = 123,
+ STAR = 124,
+ SLASH = 125,
+ DIV = 126,
+ MOD = 127,
+ AND = 128,
+ SHL = 129,
+ SHR = 130,
+ NOT = 131,
+ TRUE = 132,
+ FALSE = 133,
+ AT = 134,
+ PLUSEQ = 135,
+ MINUSEQ = 136,
+ STAREQ = 137,
+ SLASHQE = 138,
+ GOTO = 139,
+ IF = 140,
+ THEN = 141,
+ ELSE = 142,
+ WHILE = 143,
+ DO = 144,
+ REPEAT = 145,
+ UNTIL = 146,
+ FOR = 147,
+ TO = 148,
+ DOWNTO = 149,
+ WITH = 150,
+ LBRACK2 = 151,
+ RBRACK2 = 152,
+ OPERATOR = 153,
+ RAISE = 154,
+ TRY = 155,
+ EXCEPT = 156,
+ FINALLY = 157,
+ ON = 158,
+ STRING_LITERAL = 159,
+ CHR = 160,
+ NIL = 161,
+ NUM_REAL = 162,
+ IDENT = 163,
+ ABSOLUTE = 164,
+ AS = 165,
+ ASM = 166,
+ ASSEMBLER = 167,
+ BREAK = 168,
+ CONTINUE = 169,
+ DISPOSE = 170,
+ EXIT = 171,
+ INHERITED = 172,
+ NEW = 173,
+ SELF = 174,
+ METHOD = 175,
+ ADDSUBOR = 176,
+ ASSIGNEQUAL = 177,
+ SIGN = 178,
+ FUNC = 179,
+ NODE_NOT_EMIT = 180,
+ MYASTVAR = 181,
+ LF = 182,
+ LCURLY = 183,
+ RCURLY = 184,
+ WS = 185,
+ COMMENT_1 = 186,
+ COMMENT_2 = 187,
+ COMMENT_3 = 188,
+ EXPONENT = 189,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_PascalStoreWalkerTokenTypes_hpp_*/
diff --git a/languages/pascal/PascalStoreWalkerTokenTypes.txt b/languages/pascal/PascalStoreWalkerTokenTypes.txt
new file mode 100644
index 00000000..8d347fc1
--- /dev/null
+++ b/languages/pascal/PascalStoreWalkerTokenTypes.txt
@@ -0,0 +1,188 @@
+// $ANTLR 2.7.7 (20061129): pascal.tree.g -> PascalStoreWalkerTokenTypes.txt$
+PascalStoreWalker // output token vocab name
+BLOCK=4
+IDLIST=5
+ELIST=6
+FUNC_CALL=7
+PROC_CALL=8
+SCALARTYPE=9
+TYPELIST=10
+VARIANT_TAG=11
+VARIANT_TAG_NO_ID=12
+VARIANT_CASE=13
+CONSTLIST=14
+FIELDLIST=15
+ARGDECLS=16
+VARDECL=17
+ARGDECL=18
+ARGLIST=19
+TYPEDECL=20
+FIELD=21
+DOT=22
+LIBRARY="library"=23
+SEMI=24
+END="end"=25
+EXPORTS="exports"=26
+COMMA=27
+LITERAL_index="index"=28
+LITERAL_name="name"=29
+USES="uses"=30
+UNIT="unit"=31
+INTERFACE="interface"=32
+IMPLEMENTATION="implementation"=33
+BEGIN="begin"=34
+PROGRAM="program"=35
+LPAREN=36
+RPAREN=37
+INITIALIZATION="initialization"=38
+FINALIZATION="finalization"=39
+LABEL="label"=40
+CONST="const"=41
+RESOURCESTRING="resourcestring"=42
+EQUAL=43
+TYPE="type"=44
+VAR="var"=45
+COLON=46
+PROCEDURE="procedure"=47
+FORWARD="forward"=48
+FUNCTION="function"=49
+ARRAY="array"=50
+OF="of"=51
+EXTERNAL="external"=52
+PUBLIC="public"=53
+ALIAS="alias"=54
+INTERRUPT=55
+EXPORT="export"=56
+REGISTER="register"=57
+PASCAL="pascal"=58
+CDECL="cdecl"=59
+STDCALL="stdcall"=60
+POPSTACK="popstack"=61
+SAVEREGISTERS="saveregisters"=62
+INLINE="inline"=63
+SAFECALL="safecall"=64
+NEAR="near"=65
+FAR="far"=66
+NUM_INT=67
+INTEGER="integer"=68
+SHORTINT="shortint"=69
+SMALLINT="smallint"=70
+LONGINT="longint"=71
+INT64="int64"=72
+BYTE="byte"=73
+WORD="word"=74
+CARDINAL="cardinal"=75
+QWORD="qword"=76
+BOOLEAN="boolean"=77
+BYTEBOOL=78
+LONGBOOL=79
+CHAR="char"=80
+DOTDOT=81
+ASSIGN=82
+REAL="real"=83
+SINGLE="single"=84
+DOUBLE="double"=85
+EXTENDED="extended"=86
+COMP="comp"=87
+STRING="string"=88
+LBRACK=89
+RBRACK=90
+PACKED="packed"=91
+RECORD="record"=92
+CASE="case"=93
+SET="set"=94
+FILE="file"=95
+POINTER=96
+OBJECT="object"=97
+VIRTUAL="virtual"=98
+ABSTRACT="abstract"=99
+PRIVATE="private"=100
+PROTECTED="protected"=101
+CONSTRUCTOR="constructor"=102
+DESTRUCTOR="destructor"=103
+CLASS="class"=104
+OVERRIDE="override"=105
+MESSAGE=106
+PUBLISHED="published"=107
+PROPERTY="property"=108
+LITERAL_read="read"=109
+LITERAL_write="write"=110
+DEFAULT="default"=111
+LITERAL_nodefault="nodefault"=112
+LE=113
+GE=114
+LTH=115
+GT=116
+NOT_EQUAL=117
+IN="in"=118
+IS="is"=119
+PLUS=120
+MINUS=121
+OR="or"=122
+XOR="xor"=123
+STAR=124
+SLASH=125
+DIV="div"=126
+MOD="mod"=127
+AND="and"=128
+SHL="shl"=129
+SHR="shr"=130
+NOT="not"=131
+TRUE="true"=132
+FALSE="false"=133
+AT=134
+PLUSEQ=135
+MINUSEQ=136
+STAREQ=137
+SLASHQE=138
+GOTO="goto"=139
+IF="if"=140
+THEN="then"=141
+ELSE="else"=142
+WHILE="while"=143
+DO="do"=144
+REPEAT="repeat"=145
+UNTIL="until"=146
+FOR="for"=147
+TO="to"=148
+DOWNTO="downto"=149
+WITH="with"=150
+LBRACK2=151
+RBRACK2=152
+OPERATOR="operator"=153
+RAISE="raise"=154
+TRY="try"=155
+EXCEPT="except"=156
+FINALLY="finally"=157
+ON="on"=158
+STRING_LITERAL=159
+CHR="chr"=160
+NIL="nil"=161
+NUM_REAL=162
+IDENT=163
+ABSOLUTE="absolute"=164
+AS="as"=165
+ASM="asm"=166
+ASSEMBLER="assembler"=167
+BREAK="break"=168
+CONTINUE="continue"=169
+DISPOSE="dispose"=170
+EXIT="exit"=171
+INHERITED="inherited"=172
+NEW="new"=173
+SELF="self"=174
+METHOD=175
+ADDSUBOR=176
+ASSIGNEQUAL=177
+SIGN=178
+FUNC=179
+NODE_NOT_EMIT=180
+MYASTVAR=181
+LF=182
+LCURLY=183
+RCURLY=184
+WS=185
+COMMENT_1=186
+COMMENT_2=187
+COMMENT_3=188
+EXPONENT=189
diff --git a/languages/pascal/PascalTokenTypes.hpp b/languages/pascal/PascalTokenTypes.hpp
new file mode 100644
index 00000000..3e613221
--- /dev/null
+++ b/languages/pascal/PascalTokenTypes.hpp
@@ -0,0 +1,206 @@
+#ifndef INC_PascalTokenTypes_hpp_
+#define INC_PascalTokenTypes_hpp_
+
+/* $ANTLR 2.7.7 (20061129): "pascal.g" -> "PascalTokenTypes.hpp"$ */
+
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+
+#ifdef __cplusplus
+struct CUSTOM_API PascalTokenTypes {
+#endif
+ enum {
+ EOF_ = 1,
+ BLOCK = 4,
+ IDLIST = 5,
+ ELIST = 6,
+ FUNC_CALL = 7,
+ PROC_CALL = 8,
+ SCALARTYPE = 9,
+ TYPELIST = 10,
+ VARIANT_TAG = 11,
+ VARIANT_TAG_NO_ID = 12,
+ VARIANT_CASE = 13,
+ CONSTLIST = 14,
+ FIELDLIST = 15,
+ ARGDECLS = 16,
+ VARDECL = 17,
+ ARGDECL = 18,
+ ARGLIST = 19,
+ TYPEDECL = 20,
+ FIELD = 21,
+ DOT = 22,
+ LIBRARY = 23,
+ SEMI = 24,
+ END = 25,
+ EXPORTS = 26,
+ COMMA = 27,
+ LITERAL_index = 28,
+ LITERAL_name = 29,
+ USES = 30,
+ UNIT = 31,
+ INTERFACE = 32,
+ IMPLEMENTATION = 33,
+ BEGIN = 34,
+ PROGRAM = 35,
+ LPAREN = 36,
+ RPAREN = 37,
+ INITIALIZATION = 38,
+ FINALIZATION = 39,
+ LABEL = 40,
+ CONST = 41,
+ RESOURCESTRING = 42,
+ EQUAL = 43,
+ TYPE = 44,
+ VAR = 45,
+ COLON = 46,
+ PROCEDURE = 47,
+ FORWARD = 48,
+ FUNCTION = 49,
+ ARRAY = 50,
+ OF = 51,
+ EXTERNAL = 52,
+ PUBLIC = 53,
+ ALIAS = 54,
+ INTERRUPT = 55,
+ EXPORT = 56,
+ REGISTER = 57,
+ PASCAL = 58,
+ CDECL = 59,
+ STDCALL = 60,
+ POPSTACK = 61,
+ SAVEREGISTERS = 62,
+ INLINE = 63,
+ SAFECALL = 64,
+ NEAR = 65,
+ FAR = 66,
+ NUM_INT = 67,
+ INTEGER = 68,
+ SHORTINT = 69,
+ SMALLINT = 70,
+ LONGINT = 71,
+ INT64 = 72,
+ BYTE = 73,
+ WORD = 74,
+ CARDINAL = 75,
+ QWORD = 76,
+ BOOLEAN = 77,
+ BYTEBOOL = 78,
+ LONGBOOL = 79,
+ CHAR = 80,
+ DOTDOT = 81,
+ ASSIGN = 82,
+ REAL = 83,
+ SINGLE = 84,
+ DOUBLE = 85,
+ EXTENDED = 86,
+ COMP = 87,
+ STRING = 88,
+ LBRACK = 89,
+ RBRACK = 90,
+ PACKED = 91,
+ RECORD = 92,
+ CASE = 93,
+ SET = 94,
+ FILE = 95,
+ POINTER = 96,
+ OBJECT = 97,
+ VIRTUAL = 98,
+ ABSTRACT = 99,
+ PRIVATE = 100,
+ PROTECTED = 101,
+ CONSTRUCTOR = 102,
+ DESTRUCTOR = 103,
+ CLASS = 104,
+ OVERRIDE = 105,
+ MESSAGE = 106,
+ PUBLISHED = 107,
+ PROPERTY = 108,
+ LITERAL_read = 109,
+ LITERAL_write = 110,
+ DEFAULT = 111,
+ LITERAL_nodefault = 112,
+ LE = 113,
+ GE = 114,
+ LTH = 115,
+ GT = 116,
+ NOT_EQUAL = 117,
+ IN = 118,
+ IS = 119,
+ PLUS = 120,
+ MINUS = 121,
+ OR = 122,
+ XOR = 123,
+ STAR = 124,
+ SLASH = 125,
+ DIV = 126,
+ MOD = 127,
+ AND = 128,
+ SHL = 129,
+ SHR = 130,
+ NOT = 131,
+ TRUE = 132,
+ FALSE = 133,
+ AT = 134,
+ PLUSEQ = 135,
+ MINUSEQ = 136,
+ STAREQ = 137,
+ SLASHQE = 138,
+ GOTO = 139,
+ IF = 140,
+ THEN = 141,
+ ELSE = 142,
+ WHILE = 143,
+ DO = 144,
+ REPEAT = 145,
+ UNTIL = 146,
+ FOR = 147,
+ TO = 148,
+ DOWNTO = 149,
+ WITH = 150,
+ LBRACK2 = 151,
+ RBRACK2 = 152,
+ OPERATOR = 153,
+ RAISE = 154,
+ TRY = 155,
+ EXCEPT = 156,
+ FINALLY = 157,
+ ON = 158,
+ STRING_LITERAL = 159,
+ CHR = 160,
+ NIL = 161,
+ NUM_REAL = 162,
+ IDENT = 163,
+ ABSOLUTE = 164,
+ AS = 165,
+ ASM = 166,
+ ASSEMBLER = 167,
+ BREAK = 168,
+ CONTINUE = 169,
+ DISPOSE = 170,
+ EXIT = 171,
+ INHERITED = 172,
+ NEW = 173,
+ SELF = 174,
+ METHOD = 175,
+ ADDSUBOR = 176,
+ ASSIGNEQUAL = 177,
+ SIGN = 178,
+ FUNC = 179,
+ NODE_NOT_EMIT = 180,
+ MYASTVAR = 181,
+ LF = 182,
+ LCURLY = 183,
+ RCURLY = 184,
+ WS = 185,
+ COMMENT_1 = 186,
+ COMMENT_2 = 187,
+ COMMENT_3 = 188,
+ EXPONENT = 189,
+ NULL_TREE_LOOKAHEAD = 3
+ };
+#ifdef __cplusplus
+};
+#endif
+#endif /*INC_PascalTokenTypes_hpp_*/
diff --git a/languages/pascal/PascalTokenTypes.txt b/languages/pascal/PascalTokenTypes.txt
new file mode 100644
index 00000000..063a729a
--- /dev/null
+++ b/languages/pascal/PascalTokenTypes.txt
@@ -0,0 +1,188 @@
+// $ANTLR 2.7.7 (20061129): pascal.g -> PascalTokenTypes.txt$
+Pascal // output token vocab name
+BLOCK=4
+IDLIST=5
+ELIST=6
+FUNC_CALL=7
+PROC_CALL=8
+SCALARTYPE=9
+TYPELIST=10
+VARIANT_TAG=11
+VARIANT_TAG_NO_ID=12
+VARIANT_CASE=13
+CONSTLIST=14
+FIELDLIST=15
+ARGDECLS=16
+VARDECL=17
+ARGDECL=18
+ARGLIST=19
+TYPEDECL=20
+FIELD=21
+DOT=22
+LIBRARY="library"=23
+SEMI=24
+END="end"=25
+EXPORTS="exports"=26
+COMMA=27
+LITERAL_index="index"=28
+LITERAL_name="name"=29
+USES="uses"=30
+UNIT="unit"=31
+INTERFACE="interface"=32
+IMPLEMENTATION="implementation"=33
+BEGIN="begin"=34
+PROGRAM="program"=35
+LPAREN=36
+RPAREN=37
+INITIALIZATION="initialization"=38
+FINALIZATION="finalization"=39
+LABEL="label"=40
+CONST="const"=41
+RESOURCESTRING="resourcestring"=42
+EQUAL=43
+TYPE="type"=44
+VAR="var"=45
+COLON=46
+PROCEDURE="procedure"=47
+FORWARD="forward"=48
+FUNCTION="function"=49
+ARRAY="array"=50
+OF="of"=51
+EXTERNAL="external"=52
+PUBLIC="public"=53
+ALIAS="alias"=54
+INTERRUPT=55
+EXPORT="export"=56
+REGISTER="register"=57
+PASCAL="pascal"=58
+CDECL="cdecl"=59
+STDCALL="stdcall"=60
+POPSTACK="popstack"=61
+SAVEREGISTERS="saveregisters"=62
+INLINE="inline"=63
+SAFECALL="safecall"=64
+NEAR="near"=65
+FAR="far"=66
+NUM_INT=67
+INTEGER="integer"=68
+SHORTINT="shortint"=69
+SMALLINT="smallint"=70
+LONGINT="longint"=71
+INT64="int64"=72
+BYTE="byte"=73
+WORD="word"=74
+CARDINAL="cardinal"=75
+QWORD="qword"=76
+BOOLEAN="boolean"=77
+BYTEBOOL=78
+LONGBOOL=79
+CHAR="char"=80
+DOTDOT=81
+ASSIGN=82
+REAL="real"=83
+SINGLE="single"=84
+DOUBLE="double"=85
+EXTENDED="extended"=86
+COMP="comp"=87
+STRING="string"=88
+LBRACK=89
+RBRACK=90
+PACKED="packed"=91
+RECORD="record"=92
+CASE="case"=93
+SET="set"=94
+FILE="file"=95
+POINTER=96
+OBJECT="object"=97
+VIRTUAL="virtual"=98
+ABSTRACT="abstract"=99
+PRIVATE="private"=100
+PROTECTED="protected"=101
+CONSTRUCTOR="constructor"=102
+DESTRUCTOR="destructor"=103
+CLASS="class"=104
+OVERRIDE="override"=105
+MESSAGE=106
+PUBLISHED="published"=107
+PROPERTY="property"=108
+LITERAL_read="read"=109
+LITERAL_write="write"=110
+DEFAULT="default"=111
+LITERAL_nodefault="nodefault"=112
+LE=113
+GE=114
+LTH=115
+GT=116
+NOT_EQUAL=117
+IN="in"=118
+IS="is"=119
+PLUS=120
+MINUS=121
+OR="or"=122
+XOR="xor"=123
+STAR=124
+SLASH=125
+DIV="div"=126
+MOD="mod"=127
+AND="and"=128
+SHL="shl"=129
+SHR="shr"=130
+NOT="not"=131
+TRUE="true"=132
+FALSE="false"=133
+AT=134
+PLUSEQ=135
+MINUSEQ=136
+STAREQ=137
+SLASHQE=138
+GOTO="goto"=139
+IF="if"=140
+THEN="then"=141
+ELSE="else"=142
+WHILE="while"=143
+DO="do"=144
+REPEAT="repeat"=145
+UNTIL="until"=146
+FOR="for"=147
+TO="to"=148
+DOWNTO="downto"=149
+WITH="with"=150
+LBRACK2=151
+RBRACK2=152
+OPERATOR="operator"=153
+RAISE="raise"=154
+TRY="try"=155
+EXCEPT="except"=156
+FINALLY="finally"=157
+ON="on"=158
+STRING_LITERAL=159
+CHR="chr"=160
+NIL="nil"=161
+NUM_REAL=162
+IDENT=163
+ABSOLUTE="absolute"=164
+AS="as"=165
+ASM="asm"=166
+ASSEMBLER="assembler"=167
+BREAK="break"=168
+CONTINUE="continue"=169
+DISPOSE="dispose"=170
+EXIT="exit"=171
+INHERITED="inherited"=172
+NEW="new"=173
+SELF="self"=174
+METHOD=175
+ADDSUBOR=176
+ASSIGNEQUAL=177
+SIGN=178
+FUNC=179
+NODE_NOT_EMIT=180
+MYASTVAR=181
+LF=182
+LCURLY=183
+RCURLY=184
+WS=185
+COMMENT_1=186
+COMMENT_2=187
+COMMENT_3=188
+EXPONENT=189
diff --git a/languages/pascal/README.dox b/languages/pascal/README.dox
new file mode 100644
index 00000000..52ef50b1
--- /dev/null
+++ b/languages/pascal/README.dox
@@ -0,0 +1,26 @@
+/** \class PascalSupportPart
+This is Pascal language support plugin.
+
+Pascal support provides good fpc and dcc compiler support by compiler plugins.
+Nearly all command line switches for those compilers can be configured in Project Options.
+Language parser exists but it isn't perfect yet.
+
+In order to generate the parser by hand, antlr v2.7.2 is required.
+There are parser compilation errors with some gcc versions. To avoid
+them, replace file antlr/CppCodeGenerator.java in the antlr source code tree
+with the one from <a href="ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerator.java.gz">ftp://fara.cs.uni-potsdam.de/incoming/CppCodeGenerar.java.gz</a>.
+
+\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\maintainer <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\feature Pascal language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Language parser can sometimes treat correct lines as errors. Please send sample code to maintainer if you have this problem.
+
+\faq <b>Why KDevelop does not provide GNU pascal compiler plugin?</b> If you need GNU pascal compiler plugin, please write about it to maintainer and prepare to help testing it.
+\faq <b>Compiler plugin lacks option X.</b> Write about it to maintaner or send a patch. Adding compiler options is easy task. Just look at languages/pascal/compiler directory.
+
+
+*/
diff --git a/languages/pascal/app_templates/Makefile.am b/languages/pascal/app_templates/Makefile.am
new file mode 100644
index 00000000..9fd47804
--- /dev/null
+++ b/languages/pascal/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = pascalhello fpcgtk fpchello fpcsharedlib
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/PascalIDE
+profiles_DATA = pascal.appwizard
diff --git a/languages/pascal/app_templates/fpcgtk/.kdev_ignore b/languages/pascal/app_templates/fpcgtk/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/.kdev_ignore
diff --git a/languages/pascal/app_templates/fpcgtk/Makefile.am b/languages/pascal/app_templates/fpcgtk/Makefile.am
new file mode 100644
index 00000000..252cbf27
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.pp app.kdevelop
+templateName = fpcgtk
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/pascal/app_templates/fpcgtk/app.kdevelop b/languages/pascal/app_templates/fpcgtk/app.kdevelop
new file mode 100644
index 00000000..995d340b
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/app.kdevelop
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevPascalProject</projectmanagement>
+ <primarylanguage>Pascal</primarylanguage>
+ <keywords>
+ <keyword>Pascal</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevpascalproject>
+ <general>
+ <useconfiguration>default</useconfiguration>
+ </general>
+ <configurations>
+ <default>
+ <mainsource>src/%{APPNAMELC}.pp</mainsource>
+ <compiler>kdevfpcoptions</compiler>
+ <compileroptions>-vr</compileroptions>
+ <compilerexec>fpc</compilerexec>
+ </default>
+ </configurations>
+ <run>
+ <terminal>false</terminal>
+ </run>
+ </kdevpascalproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="pp"/>
+ <type ext="pas"/>
+ <type ext="dpr"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/pascal/app_templates/fpcgtk/fpcgtk b/languages/pascal/app_templates/fpcgtk/fpcgtk
new file mode 100644
index 00000000..374f1bc9
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/fpcgtk
@@ -0,0 +1,9 @@
+# KDE Config File
+[General]
+Name=GTK+ application
+Name[fr]=Une application GTK+
+Category=Pascal/Free Pascal
+Comment=Generates a GTK+ based GUI application in Pascal
+Comment[fr]=Gnre une application base sur la bibliothque GTK+ dans le language PASCAL.
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=src/APPNAMELC.pp
diff --git a/languages/pascal/app_templates/fpcgtk/fpcgtk.kdevtemplate b/languages/pascal/app_templates/fpcgtk/fpcgtk.kdevtemplate
new file mode 100644
index 00000000..56696aa1
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/fpcgtk.kdevtemplate
@@ -0,0 +1,114 @@
+# KDE Config File
+[General]
+Name=GTK+ application
+Name[ca]=Aplicació GTK+
+Name[da]=GTK+ program
+Name[de]=GTK+-Anwendung
+Name[el]=Εφαρμογή GTK+
+Name[es]=Aplicación GTK+
+Name[et]=GTK+ rakendus
+Name[eu]=GTK+ aplikazioa
+Name[fa]=کاربرد GTK+
+Name[fr]=Application GTK+
+Name[ga]=Feidhmchlár GTK+
+Name[gl]=Aplicación GTK+
+Name[hu]=GTK+-alapú alkalmazás
+Name[it]=Applicazione GTK+
+Name[ja]=GTK+ アプリケーション
+Name[nds]=GTK+-Programm
+Name[ne]=GTK+ अनुप्रयोग
+Name[nl]=GTK+-toepassing
+Name[pl]=Program GTK+
+Name[pt]=Aplicação do GTK+
+Name[pt_BR]=Aplicativo GTK+
+Name[ru]=Приложение GTK+
+Name[sk]=GTK+ aplikácia
+Name[sr]=GTK+ програм
+Name[sr@Latn]=GTK+ program
+Name[sv]=GTK+ program
+Name[tr]=GTK+ Uygulaması
+Name[zh_CN]=GTK+ 应用程序
+Name[zh_TW]=GTK+ 應用程式
+Category=Pascal/Free Pascal
+Comment=Generates a GTK+ based GUI application in Pascal
+Comment[ca]=Genera una aplicació IGU en Pascal basada en GTK+
+Comment[da]=Genererer et GTK+ baseret GUI program i Pascal
+Comment[de]=Erstellt eine auf GTK+ basierende GUI-Anwendung in Pascal
+Comment[el]=Δημιουργεί μια γραφική εφαρμογή βασισμένη στο GTK+ σε Pascal
+Comment[es]=Genera una aplicación gráfica en Pascal basada en GTK+
+Comment[et]=Graafilise rakenduse loomine GTK+ põhjal Pascalis
+Comment[eu]=GTK+-en oinarritutako GUI aplikazio bat sortzen du Pascal-en
+Comment[fa]=یک کاربرد ونک بر مبنای GTK+ در پاسکال تولید می‌کند
+Comment[fr]=Génère une application avec interface graphique basée sur GTK+ en Pascal
+Comment[ga]=Cruthaigh feidhmchlár grafach i Pascal, bunaithe ar GTK+
+Comment[gl]=Xera unha aplicación GUI baseada en GTK+ en Pascal
+Comment[hu]=Létrehoz egy GTK+-alapú grafikus felületű alkalmazást Pascalban
+Comment[it]=Genera un'applicazione GUI basata su GTK+ in Pascal
+Comment[ja]=GTK+ ベースの GUI アプリケーションを Pascal で作成します
+Comment[nds]=Stellt en op GTK+ opbuut Böversietprogramm in Pascal op
+Comment[ne]= GTK+ आधारित जी यू आई अनुप्रयोगलाई पास्कलमा उत्पन्न गर्दछ
+Comment[nl]=Genereert een GKT+-gebaseerde GUI-toepassing in Pascal
+Comment[pl]=Generuje program z graficznym interfejsem użytkownika używający GTK+ w Pascalu
+Comment[pt]=Gera uma aplicação gráfica, baseada em GTK+, em Pascal
+Comment[pt_BR]=Gera uma aplicação gráfica, baseada em GTK+, em Pascal
+Comment[ru]=Создание приложения GTK+ на Pascal
+Comment[sk]=Vygeneruje GTK+ GUI aplikáciu v Pascal
+Comment[sr]=Прави GUI програм на основу GTK+ у Pascal-у
+Comment[sr@Latn]=Pravi GUI program na osnovu GTK+ u Pascal-u
+Comment[sv]=Skapar ett GTK+ baserat program med grafiskt användargränssnitt i Pascal
+Comment[zh_CN]=生成一个 Pascal 语言的 GTK+ GUI 应用程序
+Comment[zh_TW]=產生一個 Pascal 語言,以GTK+ 為基礎的使用者介面應用程式
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.pp
+Archive=fpcgtk.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE2]
+Type=install
+Source=%{src}/main.pp
+Dest=%{dest}/src/%{APPNAMELC}.pp
+
+[MSG]
+Type=message
+Comment=A GTK+ application written in pascal was created in %{dest}
+Comment[ca]=Una aplicació GTK+ escrita en Pascal ha estat creada en %{dest}
+Comment[da]=Et GTK+ program skrevet i pascal blev oprettet i %{dest}
+Comment[de]=Eine in Pascal geschriebene GTK+-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή GTK+ γραμμένη σε pascal δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación GTK+ escrita en Pascal ha sido creada en %{dest}
+Comment[et]=GTK+ rakendus Pascalis loodi asukohta %{dest}
+Comment[eu]=Pascal-en idatzitako GTK+ aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد GTK+ نوشته‌شده در پاسکال در %{dest} ایجاد شد
+Comment[fr]=Une application GTK+ écrite en Pascal a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár GTK+, scríofa i pascal, i %{dest}
+Comment[gl]=Creouse unha aplicación GTK+ escrita en pascal en %{dest}
+Comment[hu]=Létrejött egy egyszerű, Pascal nyelvű, GTK+-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione GTK+ scritta in Pascal in %{dest}
+Comment[ja]=Pascal で書かれた GTK+ アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Pascal-Programm för GTK+ opstellt
+Comment[ne]=पास्कलमा लेखिएको GTK+ अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een GTK+-toepassing geschreven in Pascal is aangemaakt in %{dest}
+Comment[pl]=Program GTK+ napisany w Pascalu został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação GTK+, escrita em Pascal, em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação GTK+, escrita em Pascal, em %{dest}
+Comment[ru]=Приложение GTK+ на Pascal создано в %{dest}
+Comment[sk]=GTK+ aplikácia v Pascal bola vytvorená v %{dest}
+Comment[sr]=GTK+ програм у Pascal-у направљен је у %{dest}
+Comment[sr@Latn]=GTK+ program u Pascal-u napravljen je u %{dest}
+Comment[sv]=Ett GTK+ program skrivet i Pascal skapades i %{dest}
+Comment[tr]=Pascal'da yazılmış bir GTK+ uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了 Pascal 语言的 GTK+ 应用程序
+Comment[zh_TW]=一個 Pascal 的 GTK+ 應用程式已建立於 %{dest}
diff --git a/languages/pascal/app_templates/fpcgtk/fpcgtk.png b/languages/pascal/app_templates/fpcgtk/fpcgtk.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/fpcgtk.png
Binary files differ
diff --git a/languages/pascal/app_templates/fpcgtk/main.pp b/languages/pascal/app_templates/fpcgtk/main.pp
new file mode 100644
index 00000000..4ac4a3b4
--- /dev/null
+++ b/languages/pascal/app_templates/fpcgtk/main.pp
@@ -0,0 +1,84 @@
+program %{APPNAMELC};
+
+{$mode objfpc}
+
+uses
+ glib,gdk,gtk;
+
+procedure hello(widget : pGtkWidget ; data: pgpointer ); cdecl;
+begin
+ writeln('Hello World');
+end;
+
+function delete_event (widget : pGtkWidget ; event: pGdkEvent; data: pgpointer ): integer; cdecl;
+begin
+ writeln('Delete Event Occurred');
+ delete_event := ord(true);
+end;
+
+procedure destroy(widget : pGtkWidget ; data: pgpointer ); cdecl;
+begin
+ gtk_main_quit();
+end;
+
+var
+ window, button : pGtkWidget;//GtkWidget is the storage type for widgets
+
+
+begin
+ // This is called in all GTK applications. Arguments are parsed
+ // from the command line and are returned to the application.
+ gtk_init (@argc, @argv);
+
+ // create a new window
+ window := gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ // When the window is given the "delete_event" signal (this is given
+ // by the window manager, usually by the 'close' option, or on the
+ // titlebar), we ask it to call the delete_event () function
+ // as defined above. The data passed to the callback
+ // function is NULL and is ignored in the callback function.
+ gtk_signal_connect (pGTKOBJECT (window), 'delete_event',
+ GTK_SIGNAL_FUNC (@delete_event), NIL);
+
+
+ // Here we connect the "destroy" event to a signal handler.
+ // This event occurs when we call gtk_widget_destroy() on the window,
+ // or if we return 'FALSE' in the "delete_event" callback.
+ gtk_signal_connect (pGTKOBJECT (window), 'destroy',
+ GTK_SIGNAL_FUNC (@destroy), NULL);
+
+ // Sets the border width of the window.
+ gtk_container_set_border_width (GTK_CONTAINER (window), 10);
+
+ // Creates a new button with the label "Hello World".
+ button := gtk_button_new_with_label ('Hello_World');
+
+ // When the button receives the "clicked" signal, it will call the
+ // function hello() passing it NULL as its argument. The hello()
+ // function is defined above. */
+ gtk_signal_connect (pGTKOBJECT (button), 'clicked',
+ GTK_SIGNAL_FUNC (@hello), NULL);
+
+ // This will cause the window to be destroyed by calling
+ // gtk_widget_destroy(window) when "clicked". Again, the destroy
+ // signal could come from here, or the window manager
+ gtk_signal_connect_object (pGTKOBJECT (button), 'clicked',
+ GTK_SIGNAL_FUNC (@gtk_widget_destroy),
+ pGTKOBJECT(window));
+
+ // This packs the button into the window (a gtk container).
+ gtk_container_add (GTK_CONTAINER (window), button);
+
+ // The final step is to display this newly created widget.
+ gtk_widget_show (button);
+
+ // and the window
+ gtk_widget_show (window);
+
+ // All GTK applications must have a gtk_main(). Control ends here
+ // and waits for an event to occur (like a key press or
+ // mouse event).
+ gtk_main ();
+
+end.
diff --git a/languages/pascal/app_templates/fpchello/.kdev_ignore b/languages/pascal/app_templates/fpchello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/.kdev_ignore
diff --git a/languages/pascal/app_templates/fpchello/Makefile.am b/languages/pascal/app_templates/fpchello/Makefile.am
new file mode 100644
index 00000000..e09141dc
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.pp app.kdevelop
+templateName = fpchello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/pascal/app_templates/fpchello/app.kdevelop b/languages/pascal/app_templates/fpchello/app.kdevelop
new file mode 100644
index 00000000..f0a07582
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/app.kdevelop
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevPascalProject</projectmanagement>
+ <primarylanguage>Pascal</primarylanguage>
+ <keywords>
+ <keyword>Pascal</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevpascalproject>
+ <general>
+ <useconfiguration>default</useconfiguration>
+ </general>
+ <configurations>
+ <default>
+ <mainsource>src/%{APPNAMELC}.pp</mainsource>
+ <compiler>kdevfpcoptions</compiler>
+ <compileroptions>-vr</compileroptions>
+ <compilerexec>fpc</compilerexec>
+ </default>
+ </configurations>
+ <run>
+ <terminal>true</terminal>
+ </run>
+ </kdevpascalproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="pp"/>
+ <type ext="pas"/>
+ <type ext="dpr"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/pascal/app_templates/fpchello/fpchello b/languages/pascal/app_templates/fpchello/fpchello
new file mode 100644
index 00000000..b5a0acbf
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/fpchello
@@ -0,0 +1,9 @@
+# KDE Config File
+[General]
+Name=Simple program
+Name[fr]=Un simple programme de test
+Category=Pascal/Free Pascal
+Comment=Generates a simple program in Pascal
+Comment[fr]=Gnre un simple programme de test dans le language PASCAL.
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=src/APPNAMELC.pp
diff --git a/languages/pascal/app_templates/fpchello/fpchello.kdevtemplate b/languages/pascal/app_templates/fpchello/fpchello.kdevtemplate
new file mode 100644
index 00000000..44fa8bc1
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/fpchello.kdevtemplate
@@ -0,0 +1,115 @@
+# KDE Config File
+[General]
+Name=Simple program
+Name[ca]=Simple programa
+Name[da]=Simpelt program
+Name[de]=Einfaches Programm
+Name[el]=Απλό πρόγραμμα
+Name[es]=Programa sencillo
+Name[et]=Lihtne programm
+Name[eu]=Programa sinplea
+Name[fa]=برنامۀ ساده
+Name[fr]=Programme simple
+Name[ga]=Ríomhchlár simplí
+Name[gl]=Programa sinxelo
+Name[hu]=Egyszerű program
+Name[it]=Semplice programma
+Name[ja]=簡単なプログラム
+Name[nds]=Eenfach Programm
+Name[ne]=साधारण कार्यक्रम
+Name[nl]=Eenvoudig programma
+Name[pl]=Prosty program
+Name[pt]=Programa simples
+Name[pt_BR]=Programa simples
+Name[ru]=Простое приложение
+Name[sk]=Jednoduchý prohram
+Name[sr]=Једноставан програм
+Name[sr@Latn]=Jednostavan program
+Name[sv]=Enkelt program
+Name[tr]=Basit program
+Name[zh_CN]=简单程序
+Name[zh_TW]=簡單程式
+Category=Pascal/Free Pascal
+Comment=Generates a simple program in Pascal
+Comment[ca]=Genera un simple programa en Pascal
+Comment[da]=Genererer et simpelt program i Pascal
+Comment[de]=Erstellt ein einfaches Programm in Pascal
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα σε Pascal
+Comment[es]=Genera un sencillo programa en Pascal
+Comment[et]=Lihtsa programmi loomine Pascalis
+Comment[eu]=Pascal-en idatzitako programa sinple bat
+Comment[fa]=یک برنامۀ ساده در پاسکال تولید می‌کند
+Comment[fr]=Génère un programme simple en Pascal
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí i Pascal
+Comment[gl]=Xera un programa sinxelo en Pascal
+Comment[hu]=Létrehoz egy egyszerű programot Pascalban
+Comment[it]=Genera un semplice programma in Pascal
+Comment[ja]=簡単なプログラムを Pascal で作成します
+Comment[nds]=Stellt en eenfach Pascal-Programm op
+Comment[ne]=पास्कलमा साधारण कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig programma in Pascal
+Comment[pl]=Generuje prosty program w Pascalu
+Comment[pt]=Gera um programa simples em Pascal
+Comment[pt_BR]=Gera um programa simples em Pascal
+Comment[ru]=Создание простого приложения на Pascal
+Comment[sk]=Vygeneruje jednoduchý program v Pascal
+Comment[sr]=Прави једноставан програм у Pascal-у
+Comment[sr@Latn]=Pravi jednostavan program u Pascal-u
+Comment[sv]=Skapar ett enkelt program i Pascal
+Comment[tr]=Pascal'da basit bir program yaratır
+Comment[zh_CN]=生成一个简单的 Pascal 语言程序
+Comment[zh_TW]=產生一個 Pascal 的簡單程式
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.pp
+Archive=fpchello.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE2]
+Type=install
+Source=%{src}/main.pp
+Dest=%{dest}/src/%{APPNAMELC}.pp
+
+[MSG]
+Type=message
+Comment=A simple pascal program was created in %{dest}
+Comment[ca]=Un simple programa en Pascal ha estat creat en %{dest}
+Comment[da]=Et simpelt pascal program blev oprettet i %{dest}
+Comment[de]=Ein einfaches Programm in Pascal wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα pascal δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa en Pascal ha sido creado en %{dest}
+Comment[et]=Lihtne Pascali programm loodi asukohta %{dest}
+Comment[eu]=Pascal-en oinarritutako programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ پاسکال در %{dest} ایجاد شد
+Comment[fr]=Un programme Pascal simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh ríomhchlár simplí pascal i %{dest}
+Comment[gl]=Creouse un programa sinxelo en pascal en %{dest}
+Comment[hu]=Létrejött egy egyszerű Pascal-program itt: %{dest}
+Comment[it]=È stato creato un semplice programma Pascal in %{dest}
+Comment[ja]=簡単な Pascal プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Pascal-Programm opstellt
+Comment[ne]=साधारण पास्कल कार्यक्रम %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Pascal-programma is aangemaakt in %{dest}
+Comment[pl]=Prosty program w Pascalu został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples em Pascal em %{dest}
+Comment[pt_BR]=Foi criado um programa simples em Pascal em %{dest}
+Comment[ru]=Простое приложение на Pascal создано в %{dest}
+Comment[sk]=Jednoduchý program v Pascal bol vytvorený v %{dest}
+Comment[sr]=Једноставан pascal програм направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan pascal program napravljen je u %{dest}
+Comment[sv]=Ett enkelt Pascal-program skapades i %{dest}
+Comment[tr]=Pascal'da basit bir program %{dest} içinde yaratıldı
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 Pascal 程序
+Comment[zh_TW]=一個簡單的 Pascal 程式已建立於 %{dest}
diff --git a/languages/pascal/app_templates/fpchello/fpchello.png b/languages/pascal/app_templates/fpchello/fpchello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/fpchello.png
Binary files differ
diff --git a/languages/pascal/app_templates/fpchello/main.pp b/languages/pascal/app_templates/fpchello/main.pp
new file mode 100644
index 00000000..932c3c0b
--- /dev/null
+++ b/languages/pascal/app_templates/fpchello/main.pp
@@ -0,0 +1,5 @@
+program main;
+
+begin
+ WriteLn('Hello World');
+end.
diff --git a/languages/pascal/app_templates/fpcsharedlib/.kdev_ignore b/languages/pascal/app_templates/fpcsharedlib/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/.kdev_ignore
diff --git a/languages/pascal/app_templates/fpcsharedlib/Makefile.am b/languages/pascal/app_templates/fpcsharedlib/Makefile.am
new file mode 100644
index 00000000..6a7f1a85
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.pp app.kdevelop
+templateName = fpcsharedlib
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/pascal/app_templates/fpcsharedlib/app.kdevelop b/languages/pascal/app_templates/fpcsharedlib/app.kdevelop
new file mode 100644
index 00000000..bdf974e9
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/app.kdevelop
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevPascalProject</projectmanagement>
+ <primarylanguage>Pascal</primarylanguage>
+ <keywords>
+ <keyword>Pascal</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevpascalproject>
+ <general>
+ <useconfiguration>default</useconfiguration>
+ </general>
+ <configurations>
+ <default>
+ <mainsource>src/%{APPNAMELC}.pp</mainsource>
+ <compiler>kdevfpcoptions</compiler>
+ <compileroptions>-vr</compileroptions>
+ <compilerexec>fpc</compilerexec>
+ </default>
+ </configurations>
+ <run>
+ <terminal>true</terminal>
+ </run>
+ </kdevpascalproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="pp"/>
+ <type ext="pas"/>
+ <type ext="dpr"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib
new file mode 100644
index 00000000..51a294f9
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib
@@ -0,0 +1,9 @@
+# KDE Config File
+[General]
+Name=Shared library
+Name[fr]=Une bibliothque partage
+Category=Pascal/Free Pascal
+Comment=Generates a shared library in Pascal
+Comment[fr]=Gnre une bibliothque partage dans le language PASCAL.
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=src/APPNAMELC.pp
diff --git a/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.kdevtemplate b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.kdevtemplate
new file mode 100644
index 00000000..3e4eb4fe
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.kdevtemplate
@@ -0,0 +1,115 @@
+# KDE Config File
+[General]
+Name=Shared library
+Name[ca]=Biblioteca compartida
+Name[da]=Delt bibliotek
+Name[de]=Shared Library
+Name[el]=Κοινόχρηστη βιβλιοθήκη
+Name[es]=Biblioteca compartida
+Name[et]=Jagatud teek
+Name[eu]=Liburutegi partekatua
+Name[fa]=کتابخانۀ مشترک
+Name[fr]=Bibliothèque partagée
+Name[ga]=Comhleabharlann
+Name[gl]=Biblioteca compartida
+Name[hu]=Osztott programkönyvtár
+Name[it]=Libreria condivisa
+Name[ja]=共有ライブラリ
+Name[nds]=Deelt Bibliotheek
+Name[ne]=साझेदार लाइब्रेरी
+Name[nl]=Gedeelde bibliotheek
+Name[pl]=Biblioteka dzielona
+Name[pt]=Biblioteca dinâmica
+Name[pt_BR]=Biblioteca compartilhada
+Name[ru]=Разделяемая библиотека
+Name[sk]=Zdieľaná knižnica
+Name[sr]=Дељена библиотека
+Name[sr@Latn]=Deljena biblioteka
+Name[sv]=Delat bibliotek
+Name[tr]=Paylaşılan Kütüphane
+Name[zh_CN]=共享库
+Name[zh_TW]=共享函式庫
+Category=Pascal/Free Pascal
+Comment=Generates a shared library in Pascal
+Comment[ca]=Genera una biblioteca compartida en Pascal
+Comment[da]=Genererer et delt bibliotek i Pascal
+Comment[de]=Erstellt eine Shared Library in Pascal
+Comment[el]=Δημιουργία μιας κοινόχρηστης βιβλιοθήκης σε Pascal
+Comment[es]=Genera una biblioteca compartida en Pascal
+Comment[et]=Jagatud teegi loomine Pascalis
+Comment[eu]=Pascal-en idatzitako liburutegi partekatu bat sortzen du
+Comment[fa]=یک کتابخانۀ مشترک در پاسکال تولید می‌کند
+Comment[fr]=Génère une bibliothèque partagée en Pascal
+Comment[ga]=Cruthaíonn sé seo comhleabharlann i Pascal
+Comment[gl]=Xera unha biblioteca compartida en Pascal
+Comment[hu]=Létrehoz egy osztott programkönyvtárt Pascalban
+Comment[it]=Genera una libreria condivisa in Pascal
+Comment[ja]=共有ライブラリを Pascal で作成します
+Comment[nds]=Stellt en deelt Bibliotheek in Pascal op
+Comment[ne]=साझेदार लाइब्रेरीलाई पास्कलमा उत्पन्न गर्दछ
+Comment[nl]=Genereert een gedeelde bibliotheek in Pascal
+Comment[pl]=Generuje bibliotekę dzieloną w Pascalu
+Comment[pt]=Gera uma biblioteca dinâmica em Pascal
+Comment[pt_BR]=Gera uma biblioteca dinâmica em Pascal
+Comment[ru]=Создание разделяемой библиотеки на Pascal
+Comment[sk]=Vygeneruje zdieľanú knižnicu v Pascal
+Comment[sr]=Прави дељену библиотеку у Pascal-у
+Comment[sr@Latn]=Pravi deljenu biblioteku u Pascal-u
+Comment[sv]=Skapar ett delat bibliotek i Pascal
+Comment[tr]=Pascal'da bir paylaşılan kütüphane yaratır
+Comment[zh_CN]=生成 Pascal 语言的共享库
+Comment[zh_TW]=產生一個 Pascal 的共享函式庫
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.pp
+Archive=fpcsharedlib.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE2]
+Type=install
+Source=%{src}/main.pp
+Dest=%{dest}/src/%{APPNAMELC}.pp
+
+[MSG]
+Type=message
+Comment=A shared library project written in pascal was created in %{dest}
+Comment[ca]=Una biblioteca compartida escrita en Pascal ha estat creada en %{dest}
+Comment[da]=Et delt biblioteksprojekt skrevet i pascal blev oprettet i %{dest}
+Comment[de]=Ein Projekt für eine in Pascal geschriebene Shared Library wurde in %{dest} erstellt.
+Comment[el]=Ένα έργο κοινόχρηστης βιβλιοθήκης γραμμένο σε pascal δημιουργήθηκε στο %{dest}
+Comment[es]=Un proyecto de biblioteca compartida escrito en Pascal ha sido creado en %{dest}
+Comment[et]=Jagatud teegi projekt Pascalis loodi asukohta %{dest}
+Comment[eu]=Pascal-en idatzitako liburutegi partekatu bat sortu da hemen: %{dest}
+Comment[fa]=یک پروژۀ کتابخانۀ مشترک نوشته‌شده در پاسکال در %{dest} ایجاد شد
+Comment[fr]=Un projet de bibliothèque partagée écrit en Pascal a été créé dans %{dest}
+Comment[ga]=Cruthaíodh tionscadal comhleabharlainne, scríofa i pascal, i %{dest}
+Comment[gl]=Creouse un proxecto de biblioteca compartida en pascan en %{dest}
+Comment[hu]=Létrejött egy Pascal nyelvű projekt osztott programkönyvtár készítéséhez itt: %{dest}
+Comment[it]=È stato creato un progetto di libreria condivisa scritto in Pascal in %{dest}
+Comment[ja]=Pascal で書かれた共有ライブラリプロジェクトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Projekt för en in Pascal schreven deelt Bibliotheek opstellt
+Comment[ne]=पास्कलमा लेखिएको साझेदार लाइब्रेरी परियोजना %{dest} मा सिर्जना गरियो
+Comment[nl]=Een gedeelde bibliotheek geschreven in Pascal is aangemaakt in %{dest}
+Comment[pl]=Projekt biblioteki dzielonej napisanej w Pascalu został utworzony w %{dest}
+Comment[pt]=Foi criado o projecto de uma biblioteca dinâmica em Pascal em %{dest}
+Comment[pt_BR]=Foi criado o projecto de uma biblioteca dinâmica em Pascal em %{dest}
+Comment[ru]=Разделяемая библиотека на Pascal создана в %{dest}
+Comment[sk]=Zdieľaná knižnica v Pascal bola vytvorená v %{dest}
+Comment[sr]=Пројекат дељене библиотеке у Pascal-у направљен је у %{dest}
+Comment[sr@Latn]=Projekat deljene biblioteke u Pascal-u napravljen je u %{dest}
+Comment[sv]=Ett projekt med delat bibliotek skrivet i Pascal skapades i %{dest}
+Comment[tr]=Pascal'da bir paylaşılan kütüphane projesi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个 Pascal 语言的共享库工程
+Comment[zh_TW]=一個 Pascal 的共享函式庫專案已建立於 %{dest}
diff --git a/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.png b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/fpcsharedlib.png
Binary files differ
diff --git a/languages/pascal/app_templates/fpcsharedlib/main.pp b/languages/pascal/app_templates/fpcsharedlib/main.pp
new file mode 100644
index 00000000..c02e1472
--- /dev/null
+++ b/languages/pascal/app_templates/fpcsharedlib/main.pp
@@ -0,0 +1,11 @@
+library %{APPNAMELC};
+
+function %{APPNAMELC}_test: integer; cdecl; export;
+begin
+ %{APPNAMELC}_test := 0;
+end;
+
+exports
+ %{APPNAMELC}_test;
+
+end.
diff --git a/languages/pascal/app_templates/pascal.appwizard b/languages/pascal/app_templates/pascal.appwizard
new file mode 100644
index 00000000..766cc0ba
--- /dev/null
+++ b/languages/pascal/app_templates/pascal.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=pascalhello,fpcgtk,fpchello,fpcsharedlib
diff --git a/languages/pascal/app_templates/pascalhello/.kdev_ignore b/languages/pascal/app_templates/pascalhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/.kdev_ignore
diff --git a/languages/pascal/app_templates/pascalhello/Makefile.am b/languages/pascal/app_templates/pascalhello/Makefile.am
new file mode 100644
index 00000000..02924e72
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = main.pp app.kdevelop
+templateName = pascalhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/pascal/app_templates/pascalhello/app.kdevelop b/languages/pascal/app_templates/pascalhello/app.kdevelop
new file mode 100644
index 00000000..fcb75f33
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/app.kdevelop
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevPascalProject</projectmanagement>
+ <primarylanguage>Pascal</primarylanguage>
+ <keywords>
+ <keyword>Pascal</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevpascalproject>
+ <general>
+ <useconfiguration>default</useconfiguration>
+ </general>
+ <configurations>
+ <default>
+ <mainsource>src/%{APPNAMELC}.pp</mainsource>
+ </default>
+ </configurations>
+ <run>
+ <terminal>true</terminal>
+ </run>
+ </kdevpascalproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="pp"/>
+ <type ext="pas"/>
+ <type ext="dpr"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/pascal/app_templates/pascalhello/main.pp b/languages/pascal/app_templates/pascalhello/main.pp
new file mode 100644
index 00000000..932c3c0b
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/main.pp
@@ -0,0 +1,5 @@
+program main;
+
+begin
+ WriteLn('Hello World');
+end.
diff --git a/languages/pascal/app_templates/pascalhello/pascalhello b/languages/pascal/app_templates/pascalhello/pascalhello
new file mode 100644
index 00000000..7482fb78
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/pascalhello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[fr]=Un simple programme de test Hello world
+Icon=pascalhello.png
+Category=Pascal
+Comment=Generates a simple Hello world program in Pascal
+Comment[fr]=Gnre un simple programme de test du type Hello world dans le language PASCAL.
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=src/APPNAMELC.pp
diff --git a/languages/pascal/app_templates/pascalhello/pascalhello.kdevtemplate b/languages/pascal/app_templates/pascalhello/pascalhello.kdevtemplate
new file mode 100644
index 00000000..13c9df69
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/pascalhello.kdevtemplate
@@ -0,0 +1,116 @@
+# KDE Config File
+[General]
+Name=Simple Hello world program
+Name[ca]=Simple programa Hello world
+Name[da]=Simpelt Goddag verden program
+Name[de]=Ein einfaches "Hello World"-Programm
+Name[el]=Απλό πρόγραμμα Γεια σου Κόσμε
+Name[es]=Programa «Hola mundo» sencillo
+Name[et]=Lihtne "Tere, maailm" programm
+Name[eu]="Kaixo mundua" programa sinplea
+Name[fa]=برنامۀ سادۀ Hello world
+Name[fr]=Programme « Bonjour monde » simple
+Name[ga]=Ríomhchlár simplí "Hello World"
+Name[gl]=Programa sinxelo Ola mundo
+Name[hu]=Egyszerű Hello world program
+Name[it]=Semplice programma di "Hello world"
+Name[ja]=簡単な Hello world プログラム
+Name[ms]=Program Hello World mudah
+Name[nds]=En eenfach "Moin Welt"-Programm
+Name[ne]=साधारण हेल्लो वोल्ड कार्यक्रम
+Name[nl]=Eenvoudig 'Hello World' programma
+Name[pl]=Prosty program witaj świecie
+Name[pt]=Programa simples Olá Mundo
+Name[pt_BR]=Programa simples Olá Mundo
+Name[ru]=Простая программа Hello world
+Name[sk]=Jednoduchý "Ahoj svet" program
+Name[sl]=Preprost program Hello world
+Name[sr]=Једноставан „Здраво свете“ програм
+Name[sr@Latn]=Jednostavan „Zdravo svete“ program
+Name[sv]=Enkelt Hello world-program
+Name[tr]=Basit Merhaba dünya programı
+Name[zh_CN]=简单的 Hello world 程序
+Name[zh_TW]=簡單的 Hello world 程式
+Icon=pascalhello.png
+Category=Pascal
+Comment=Generates a simple Hello world program in Pascal
+Comment[ca]=Genera un simple programa de Hello world en Pascal
+Comment[da]=Genererer et simpelt Goddag verden program i Pascal
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in Pascal
+Comment[el]=Δημιουργεί ένα απλό πρόγραμμα Γεια σου Κόσμε σε Pascal
+Comment[es]=Genera un programa «Hola mundo» sencillo en Pascal
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Pascalis
+Comment[eu]=Pascal-en idatzitako "Kaixo mundua" programa sinple bat sortzen du
+Comment[fa]=یک برنامۀ سادۀ Hello world در پاسکال تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Pascal
+Comment[gl]=Xera un programa sinxelo Ola mundo en Pascal
+Comment[hu]=Létrehoz egy egyszerű Hello world programot Pascalban
+Comment[it]=Genera un semplice programma di "Hello world" in Pascal
+Comment[ja]=簡単な Hello world プログラムを Pascal で作成します
+Comment[nds]=Stellt in Pascal en eenfach "Moin Welt"-Programm op
+Comment[ne]=साधारण हेल्लो वोल्ड कार्यक्रमलाई पास्कलमा उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvudig Hello World-programma in Pascal
+Comment[pl]=Generuje prosty program "Witaj świecie" w Pascalu
+Comment[pt]=Gera um programa simples Olá Mundo em Pascal
+Comment[pt_BR]=Gera um programa simples Olá Mundo em Pascal
+Comment[ru]=Создание простого приложения Hello world на Pascal
+Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v Pascal
+Comment[sr]=Прави једноставан „Здраво свете“ у Pascal-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Pascal-u
+Comment[sv]=Skapar ett enkelt Hello world-program i Pascal
+Comment[tr]=Pascal'da basit bir Merhaba Dünya programı yaratır.
+Comment[zh_CN]=生成一个简单的 Pascal 语言 Hello world 程序
+Comment[zh_TW]=產生一個簡單的 Pascal Hello world 程式
+FileTemplates=pp-program,PStyle,pp-unit,PStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.pp
+Archive=pascalhello.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir1]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE2]
+Type=install
+Source=%{src}/main.pp
+Dest=%{dest}/src/%{APPNAMELC}.pp
+
+[MSG]
+Type=message
+Comment=A simple 'hello world' program in Pascal was created in %{dest}
+Comment[ca]=Un simple programa de 'hello world' en Pascal ha estat creat en %{dest}
+Comment[da]=Et simpelt 'goddag verden' program i Pascal blev oprettet i %{dest}
+Comment[de]=Ein einfaches "Hello world"-Programm in Pascal wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό πρόγραμμα 'Γεια σου κόσμε' σε Pascal δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa «Hola mundo» en Pascal ha sido creado en %{dest}
+Comment[et]=Lihtne "Tere, maailm" programm Pascalis loodi asukohta %{dest}
+Comment[eu]=Pascal-en idatzitako "Kaixo mundua" programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک برنامۀ سادۀ «hello world» در پاسکال در %{dest} ایجاد شد
+Comment[fr]=Un programme « Bonjour monde » simple en Pascal a été créé dans %{dest}
+Comment[gl]=Creouse un programa sinxelo en Pascal 'ola mundo' en %{dest}
+Comment[hu]=Létrejött egy egyszerű Hello world Pascal-program itt: %{dest}
+Comment[it]=È stato creato un semplice programma Pascal di "hello world" in %{dest}
+Comment[ja]=Pascal で書かれた簡単な hello world プログラムを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach "Moin Welt"-Programm in Pascal opstellt
+Comment[ne]=पास्कलमा साधारण 'हेल्लो वोल्ड' कार्यक्रम %{dest} सिर्जना गरियो
+Comment[nl]=Een eenvoudig Hello World-programma geschreven in Pascal is aangemaakt in %{dest}
+Comment[pl]=Prosty program "Witaj świecie" w Pascalu został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples 'olá mundo' em Pascal em %{dest}
+Comment[pt_BR]=Foi criado um programa simples 'olá mundo' em Pascal em %{dest}
+Comment[ru]=Простое приложение 'hello world' на Pascal создано в %{dest}
+Comment[sk]=Jednoduchý Ahoj svet program v Pascal bol vytvorený v %{dest}
+Comment[sr]=Једноставан „Здраво свете“ програм у Pascal-у направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan „Zdravo svete“ program u Pascal-u napravljen je u %{dest}
+Comment[sv]=Ett enkelt 'Hello world'-program i Pascal skapades i %{dest}
+Comment[tr]=Pascal'da basit bir "Merhaba Dünya" uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的“Hello world”程序
+Comment[zh_TW]=一個簡單的 Pascal Hello world 程式已建立於 %{dest}
diff --git a/languages/pascal/app_templates/pascalhello/pascalhello.png b/languages/pascal/app_templates/pascalhello/pascalhello.png
new file mode 100644
index 00000000..888d4f13
--- /dev/null
+++ b/languages/pascal/app_templates/pascalhello/pascalhello.png
Binary files differ
diff --git a/languages/pascal/backgroundparser.cpp b/languages/pascal/backgroundparser.cpp
new file mode 100644
index 00000000..a61c9774
--- /dev/null
+++ b/languages/pascal/backgroundparser.cpp
@@ -0,0 +1,95 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <sstream>
+
+#include "backgroundparser.h"
+#include "problemreporter.h"
+#include "PascalLexer.hpp"
+#include "PascalParser.hpp"
+#include "PascalAST.hpp"
+#include <kdebug.h>
+#include <qfile.h>
+#include <antlr/ASTFactory.hpp>
+
+BackgroundParser::BackgroundParser( ProblemReporter* reporter,
+ const QString& source,
+ const QString& filename )
+ : m_reporter( reporter ),
+ m_source( source.unicode(), source.length() ),
+ m_fileName( filename )
+{
+}
+
+BackgroundParser::~BackgroundParser()
+{
+}
+
+void BackgroundParser::run()
+{
+ kdDebug() << "11" << endl;
+
+ QCString _fn = QFile::encodeName(m_fileName);
+ std::string fn( _fn.data() );
+
+ QCString text = m_source.utf8();
+ std::istringstream stream( text.data() );
+
+ kdDebug() << "12" << endl;
+
+ PascalLexer lexer( stream );
+ lexer.setFilename( fn );
+ lexer.setProblemReporter( m_reporter );
+
+ kdDebug() << "13" << endl;
+
+ PascalParser parser( lexer );
+ parser.setFilename( fn );
+ parser.setProblemReporter( m_reporter );
+
+ antlr::ASTFactory my_factory( "PascalAST", PascalAST::factory );
+ parser.initializeASTFactory(my_factory);
+ parser.setASTFactory( &my_factory );
+
+ kdDebug() << "14" << endl;
+
+ try{
+
+ kdDebug() << "15" << endl;
+
+ lexer.resetErrors();
+ parser.resetErrors();
+
+ kdDebug() << "16" << endl;
+
+ parser.compilationUnit();
+
+ kdDebug() << "17" << endl;
+
+ int errors = lexer.numberOfErrors() + parser.numberOfErrors();
+
+ kdDebug() << "18" << endl;
+ } catch( antlr::ANTLRException& ex ){
+
+ kdDebug() << "19" << endl;
+
+ kdDebug() << "*exception*: " << ex.toString().c_str() << endl;
+ m_reporter->reportError( ex.getMessage().c_str(),
+ m_fileName,
+ lexer.getLine(),
+ lexer.getColumn() );
+ }
+
+ kdDebug(9013) << "FINISHED!!" << endl;
+}
+
+
+
diff --git a/languages/pascal/backgroundparser.h b/languages/pascal/backgroundparser.h
new file mode 100644
index 00000000..7118c7f2
--- /dev/null
+++ b/languages/pascal/backgroundparser.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef BACKGROUNDPARSER_H
+#define BACKGROUNDPARSER_H
+
+#include <qthread.h>
+#include <qstring.h>
+
+class ProblemReporter;
+
+class BackgroundParser: public QThread{
+public:
+ BackgroundParser( ProblemReporter* reporter,
+ const QString& source,
+ const QString& filename );
+ virtual ~BackgroundParser();
+
+ virtual void run();
+
+private:
+ ProblemReporter* m_reporter;
+ QString m_source;
+ QString m_fileName;
+};
+
+#endif
diff --git a/languages/pascal/compiler/Makefile.am b/languages/pascal/compiler/Makefile.am
new file mode 100644
index 00000000..c9f7528b
--- /dev/null
+++ b/languages/pascal/compiler/Makefile.am
@@ -0,0 +1,6 @@
+# This is the collection of plugins. In contrast to the parts
+# directory, these are 'transient' in a sense and don't
+# share the complete KDevComponent interface.
+
+SUBDIRS = dccoptions fpcoptions
+
diff --git a/languages/pascal/compiler/dccoptions/Makefile.am b/languages/pascal/compiler/dccoptions/Makefile.am
new file mode 100644
index 00000000..61dd304c
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/Makefile.am
@@ -0,0 +1,16 @@
+# Here resides the gcc option dialog plugin.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdccoptions.la
+libkdevdccoptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+libkdevdccoptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(LIB_KHTML)
+
+libkdevdccoptions_la_SOURCES = dccoptionsplugin.cpp optiontabs.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdccoptions.desktop
diff --git a/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp b/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp
new file mode 100644
index 00000000..a65ca9d6
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/dccoptionsplugin.cpp
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <qvbox.h>
+#include <qdialog.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kgenericfactory.h>
+
+#include "dccoptionsplugin.h"
+
+#include "optiontabs.h"
+
+K_EXPORT_COMPONENT_FACTORY( libkdevdccoptions, KGenericFactory<DccOptionsPlugin>( "kdevdccoptions" ) )
+
+DccOptionsPlugin::DccOptionsPlugin(QObject *parent, const char *name, const QStringList/* &args*/)
+ : KDevCompilerOptions(parent, name)
+{
+}
+
+DccOptionsPlugin::~DccOptionsPlugin()
+{
+}
+
+QString DccOptionsPlugin::exec(QWidget *parent, const QString &flags)
+{
+ DccOptionsDialog *dlg = new DccOptionsDialog(parent, "dcc options dialog");
+ QString newFlags = flags;
+ dlg->setFlags(flags);
+ if(dlg->exec() == QDialog::Accepted)
+ newFlags = dlg->flags();
+ delete dlg;
+ return newFlags;
+}
+
+
+DccOptionsDialog::DccOptionsDialog( QWidget * parent, const char * name )
+ : KDialogBase(Tabbed, i18n("Delphi Compiler Options"), Ok|Cancel, Ok, parent, name, true)
+{
+ QVBox *vbox;
+
+ vbox = addVBoxPage(i18n("General"));
+ general = new GeneralTab(vbox, "general tab");
+
+ vbox = addVBoxPage(i18n("Locations I"));
+ locations = new LocationsTab(vbox, "locations tab");
+
+ vbox = addVBoxPage(i18n("Locations II"));
+ locations2 = new Locations2Tab(vbox, "locations2 tab");
+
+ vbox = addVBoxPage(i18n("Code Generation"));
+ codegen = new CodegenTab(vbox, "codegen tab");
+
+ vbox = addVBoxPage(i18n("Debug && Optimization"));
+ debug_optim = new DebugOptimTab(vbox, "debug and optim tab");
+
+ vbox = addVBoxPage(i18n("Linker"));
+ linker = new LinkerTab(vbox, "linker tab");
+}
+
+DccOptionsDialog::~DccOptionsDialog( )
+{
+}
+
+void DccOptionsDialog::setFlags( const QString & flags )
+{
+ QStringList flaglist = QStringList::split(" ", flags);
+
+ general->readFlags(&flaglist);
+ codegen->readFlags(&flaglist);
+ debug_optim->readFlags(&flaglist);
+ locations->readFlags(&flaglist);
+ locations2->readFlags(&flaglist);
+ linker->readFlags(&flaglist);
+
+ unrecognizedFlags = flaglist;
+}
+
+QString DccOptionsDialog::flags( ) const
+{
+ QStringList flaglist;
+
+ general->writeFlags(&flaglist);
+ locations->writeFlags(&flaglist);
+ locations2->writeFlags(&flaglist);
+ codegen->writeFlags(&flaglist);
+ debug_optim->writeFlags(&flaglist);
+ linker->writeFlags(&flaglist);
+
+ QString flags;
+ QStringList::ConstIterator li;
+ for (li = flaglist.begin(); li != flaglist.end(); ++li) {
+ flags += (*li);
+ flags += " ";
+ }
+
+ for (li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li) {
+ flags += (*li);
+ flags += " ";
+ }
+
+ flags.truncate(flags.length()-1);
+ return flags;
+}
+
+#include "dccoptionsplugin.moc"
diff --git a/languages/pascal/compiler/dccoptions/dccoptionsplugin.h b/languages/pascal/compiler/dccoptions/dccoptionsplugin.h
new file mode 100644
index 00000000..35f34532
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/dccoptionsplugin.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 DCCOPTIONSPLUGIN_H
+#define DCCOPTIONSPLUGIN_H
+
+#include <kdialogbase.h>
+
+#include "kdevcompileroptions.h"
+
+class DccOptionsPlugin : public KDevCompilerOptions
+{
+ Q_OBJECT
+
+public:
+ DccOptionsPlugin( QObject *parent, const char *name, const QStringList/* &args */);
+ ~DccOptionsPlugin();
+
+ virtual QString exec(QWidget *parent, const QString &flags);
+};
+
+class GeneralTab;
+class LinkerTab;
+class LocationsTab;
+class Locations2Tab;
+class CodegenTab;
+class DebugOptimTab;
+
+class DccOptionsDialog : public KDialogBase
+{
+public:
+ DccOptionsDialog( QWidget *parent=0, const char *name=0 );
+ ~DccOptionsDialog();
+
+ void setFlags(const QString &flags);
+ QString flags() const;
+
+private:
+ GeneralTab *general;
+ LinkerTab *linker;
+ LocationsTab *locations;
+ Locations2Tab *locations2;
+ CodegenTab *codegen;
+ DebugOptimTab *debug_optim;
+ QStringList unrecognizedFlags;
+};
+
+
+#endif
diff --git a/languages/pascal/compiler/dccoptions/kdevdccoptions.desktop b/languages/pascal/compiler/dccoptions/kdevdccoptions.desktop
new file mode 100644
index 00000000..8a577bb7
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/kdevdccoptions.desktop
@@ -0,0 +1,54 @@
+[Desktop Entry]
+Type=Service
+Exec=dcc
+Comment=Borland Delphi Compiler
+Comment[br]=Dastumer Delphi Borland
+Comment[ca]=Compilador Delphi de Borland
+Comment[da]=Borland Delphi oversætter
+Comment[el]=Μεταγλωττιστής Borland Delphi
+Comment[es]=Compilador de Delphi de Borland
+Comment[et]=Borland Delphi kompilaator
+Comment[eu]=Borland Delphi konpiladorea
+Comment[fa]=مترجم برلند دلفی
+Comment[fr]=Compilateur Delphi de Borland
+Comment[ga]=Tiomsaitheoir Borland Delphi
+Comment[gl]=Compilador Borland Delphi
+Comment[hi]=बोरलैंड डेल्फ़ी कम्पायलर
+Comment[hu]=Borland Delphi fordítóprogram
+Comment[is]=Borland Delphi þýðandi
+Comment[it]=Compilatore per Borland Delphi
+Comment[ja]=Borland Delphi コンパイラ
+Comment[nds]=Borland Delphi-Kompilerer
+Comment[ne]=बोरल्यान्ड डेल्पी कम्पाइलर
+Comment[nl]=Borland Delphi-compiler
+Comment[pl]=Kompilator Borland Delphi
+Comment[pt]=Compilador de Borland Delphi
+Comment[pt_BR]=Compilador Delphi da Borland Delphi
+Comment[ru]=Компилятор Borland Delphi
+Comment[sk]=Borland Delphi kompilátor
+Comment[sl]=Prevajalnik za Borland Delphi
+Comment[sr]=Borland-ов преводилац Delphi-ја
+Comment[sr@Latn]=Borland-ov prevodilac Delphi-ja
+Comment[sv]=Borland Delphi kompilator
+Comment[ta]=பொர்லான்ட் டெல்பி தொகுப்பி
+Comment[tg]=Талфифгари Borland Delphi
+Comment[tr]=Borland Delphi Derleyicisi
+Comment[zh_CN]=Borland Delphi 编译器
+Comment[zh_TW]=Borland Delphi 編譯器
+Name=DccOptions
+Name[da]=Delphi oversætter indstillinger
+Name[de]=Delphi-Einstellungen (KDevelop)
+Name[hi]=डीसीसी-विकल्प
+Name[nds]=Delphi-Optschonen (KDevelop)
+Name[pl]=Opcje Dcc
+Name[sk]=Dcc možnosti
+Name[sl]=Možnosti Dcc
+Name[sv]=Alternativ för dcc
+Name[ta]=Dccவிருப்பங்கள்
+Name[tg]=DccИнтихобҳо
+Name[zh_TW]=Dcc 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevdccoptions
+X-KDevelop-Version=5
+X-KDevelop-Language=Pascal
+X-KDevelop-Args=dcc
diff --git a/languages/pascal/compiler/dccoptions/optiontabs.cpp b/languages/pascal/compiler/dccoptions/optiontabs.cpp
new file mode 100644
index 00000000..97622606
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/optiontabs.cpp
@@ -0,0 +1,399 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 <kdialog.h>
+#include <klocale.h>
+
+#include <qspinbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvbuttongroup.h>
+#include <qapplication.h>
+#include <qpushbutton.h>
+
+#include "flagboxes.h"
+
+#include "optiontabs.h"
+
+LinkerTab::LinkerTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), radioController(new FlagRadioButtonController()),
+ pathController(new FlagPathEditController()),
+ editController(new FlagEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *map_group = new QVButtonGroup(i18n("Map File"), this);
+ QRadioButton *m_defaultMap = new QRadioButton(i18n("Off"), map_group);
+ m_defaultMap->setChecked(true);
+ new FlagRadioButton(map_group, radioController,
+ "-GS", i18n("Segments"));
+ new FlagRadioButton(map_group, radioController,
+ "-GP", i18n("Publics"));
+ new FlagRadioButton(map_group, radioController,
+ "-GD", i18n("Detailed"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ new FlagPathEdit(this, "", pathController,
+ "--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
+ "-$M", i18n("Reserved address space:"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ layout->addStretch();
+}
+
+LinkerTab::~LinkerTab( )
+{
+ delete radioController;
+ delete pathController;
+ delete editController;
+}
+
+void LinkerTab::readFlags( QStringList * str )
+{
+ pathController->readFlags(str);
+ radioController->readFlags(str);
+ editController->readFlags(str);
+}
+
+void LinkerTab::writeFlags( QStringList * str )
+{
+ pathController->writeFlags(str);
+ radioController->writeFlags(str);
+ editController->writeFlags(str);
+}
+
+
+
+LocationsTab::LocationsTab( QWidget * parent, const char * name )
+ :QWidget(parent, name), pathController(new FlagPathEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ new FlagPathEdit(this, ":", pathController,
+ "-I", i18n("Include search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-R", i18n("Resource search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-U", i18n("Unit search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-O", i18n("Object search path (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addStretch();
+}
+
+LocationsTab::~LocationsTab( )
+{
+ delete pathController;
+}
+
+void LocationsTab::readFlags( QStringList * str )
+{
+ pathController->readFlags(str);
+}
+
+void LocationsTab::writeFlags( QStringList * str )
+{
+ pathController->writeFlags(str);
+}
+
+
+
+Locations2Tab::Locations2Tab( QWidget * parent, const char * name )
+ :QWidget(parent, name), pathController(new FlagPathEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ new FlagPathEdit(this, "", pathController,
+ "-E", i18n("Executable output directory:"));
+ new FlagPathEdit(this, "", pathController,
+ "-N", i18n("Unit output directory:"));
+ new FlagPathEdit(this, "", pathController,
+ "-LE", i18n("Package directory:"));
+ new FlagPathEdit(this, "", pathController,
+ "-LN", i18n("Package source code directory:"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addStretch();
+}
+
+Locations2Tab::~Locations2Tab( )
+{
+ delete pathController;
+}
+
+void Locations2Tab::readFlags( QStringList * str )
+{
+ pathController->readFlags(str);
+}
+
+void Locations2Tab::writeFlags( QStringList * str )
+{
+ pathController->writeFlags(str);
+}
+
+
+
+GeneralTab::GeneralTab( QWidget * parent, const char * name )
+ :QWidget(parent, name), controller(new FlagCheckBoxController()),
+ editController(new FlagEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *build_group = new QVButtonGroup(i18n("Build"), this);
+ new FlagCheckBox(build_group, controller,
+ "-B", i18n("Build all units"));
+ new FlagCheckBox(build_group, controller,
+ "-M", i18n("Make modified units"));
+ new FlagCheckBox(build_group, controller,
+ "-Q", i18n("Quiet compile"));
+ new FlagCheckBox(build_group, controller,
+ "-Z", i18n("Disable implicit package compilation"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addSpacing(10);
+
+ new FlagListEdit(this, ":", editController, "-D", i18n("Conditional defines (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ new FlagListEdit(this, ":", editController, "-A", i18n("Unit aliases in form unit=alias (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addSpacing(10);
+
+ QVButtonGroup *message_group = new QVButtonGroup(i18n("Messages"), this);
+ new FlagCheckBox(message_group, controller,
+ "-H", i18n("Output hint messages"));
+ new FlagCheckBox(message_group, controller,
+ "-W", i18n("Output warning messages"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addSpacing(10);
+ QVButtonGroup *package_group = new QVButtonGroup(i18n("Packages"), this);
+ new FlagListEdit(package_group, ":", editController, "-LU", i18n("Build with packages (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+GeneralTab::~GeneralTab( )
+{
+ delete controller;
+ delete editController;
+}
+
+void GeneralTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ editController->readFlags(str);
+}
+
+void GeneralTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ editController->writeFlags(str);
+}
+
+
+
+CodegenTab::CodegenTab( QWidget * parent, const char * name )
+ :QWidget(parent, name), controller(new FlagCheckBoxController()),
+ listController(new FlagEditController()),
+ radioController(new FlagRadioButtonController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+// layout->setAutoAdd(true);
+
+ QGridLayout *layout2 = new QGridLayout(layout, 2, 2, KDialog::spacingHint());
+
+ QVButtonGroup *align_group = new QVButtonGroup(i18n("Code Alignment && Stack Frames"), this);
+ QRadioButton *align_def = new QRadioButton(i18n("Default (-$A8)"), align_group);
+ align_def->setChecked(true);
+ new FlagRadioButton(align_group, radioController,
+ "'-$A1'", i18n("Never align"));
+ new FlagRadioButton(align_group, radioController,
+ "'-$A2'", i18n("On word boundaries"));
+ new FlagRadioButton(align_group, radioController,
+ "'-$A4'", i18n("On double word boundaries"));
+ new FlagRadioButton(align_group, radioController,
+ "'-$A8'", i18n("On quad word boundaries"));
+ new FlagCheckBox(align_group, controller,
+ "'-$W+'", i18n("Generate stack frames"), "'-$W-'");
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout2->addWidget(align_group, 0, 0);
+
+ QVButtonGroup *enum_group = new QVButtonGroup(i18n("Enumeration Size"), this);
+ QRadioButton *enum_def = new QRadioButton(i18n("Default (-$Z1)"), enum_group);
+ enum_def->setChecked(true);
+ new FlagRadioButton(enum_group, radioController,
+ "'-$Z1'", i18n("Unsigned byte (256 values)"));
+ new FlagRadioButton(enum_group, radioController,
+ "'-$Z2'", i18n("Unsigned word (64K values)"));
+ new FlagRadioButton(enum_group, radioController,
+ "'-$Z4'", i18n("Unsigned double word (4096M values)"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout2->addWidget(enum_group, 0, 1);
+
+ QVButtonGroup *compile_group = new QVButtonGroup(i18n("Compile Time Checks"), this);
+ new FlagCheckBox(compile_group, controller,
+ "'-$C+'", i18n("Assertions"), "'-$C-'", "'-$C+'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$B+'", i18n("Complete boolean evaluation"), "'-$B-'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$X+'", i18n("Extended syntax"), "'-$X-'", "'-$X+'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$H+'", i18n("Long strings"), "'-$H-'", "'-$H+'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$P+'", i18n("Open string parameters"), "'-$P-'", "'-$P+'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$T+'", i18n("Type-checked pointers"), "'-$T-'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$V+'", i18n("Var-string checking"), "'-$V-'", "'-$V+'");
+ new FlagCheckBox(compile_group, controller,
+ "'-$J+'", i18n("Writable typed constants"), "'-$J-'");
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout2->addWidget(compile_group, 1, 0);
+
+ QVButtonGroup *run_group = new QVButtonGroup(i18n("Run Time Checks"), this);
+ new FlagCheckBox(run_group, controller,
+ "'-$M+'", i18n("Runtime type information"), "'-$M-'");
+ new FlagCheckBox(run_group, controller,
+ "'-$G+'", i18n("Imported data references"), "'-$G-'", "'-$G+'");
+ new FlagCheckBox(run_group, controller,
+ "'-$I+'", i18n("Input/Output checking"), "'-$I-'", "'-$I+'");
+ new FlagCheckBox(run_group, controller,
+ "'-$Q+'", i18n("Overflow checking"), "'-$Q-'");
+ new FlagCheckBox(run_group, controller,
+ "'-$R+'", i18n("Range checking"), "'-$R-'");
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout2->addWidget(run_group, 1, 1);
+
+ layout->addStretch();
+}
+
+CodegenTab::~CodegenTab( )
+{
+ delete controller;
+ delete listController;
+ delete radioController;
+}
+
+void CodegenTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ listController->readFlags(str);
+ radioController->readFlags(str);
+}
+
+void CodegenTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ listController->writeFlags(str);
+ radioController->writeFlags(str);
+}
+
+
+
+DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ radioController(new FlagRadioButtonController)
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+// layout->setAutoAdd(true);
+
+ QVButtonGroup *optim_group = new QVButtonGroup(i18n("Optimization"), this);
+ new FlagCheckBox(optim_group, controller,
+ "'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
+ layout->addWidget(optim_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
+
+ QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
+ new FlagCheckBox(debug_group, controller,
+ "'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
+ new FlagCheckBox(debug_group, controller,
+ "'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
+ gdb = new FlagCheckBox(debug_group, controller,
+ "-V", i18n("Debug information for GDB"));
+ namespacedb = new FlagCheckBox(debug_group, controller,
+ "-VN", i18n("Namespace debug info"));
+ symboldb = new FlagCheckBox(debug_group, controller,
+ "-VR", i18n("Write symbol info in an .rsm file"));
+ layout2->addWidget(debug_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QVButtonGroup *debug_add = new QVButtonGroup(i18n("Symbol Reference Information"), this);
+ QRadioButton *m_default = new QRadioButton(i18n("Default (-$YD)"), debug_add);
+ m_default->setChecked(true);
+ new FlagRadioButton(debug_add, radioController,
+ "'-$Y-'", i18n("No information"));
+ new FlagRadioButton(debug_add, radioController,
+ "'-$YD'", i18n("Definition information"));
+ new FlagRadioButton(debug_add, radioController,
+ "'-$Y+'", i18n("Full reference information"));
+ layout2->addWidget(debug_add);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QHBoxLayout *layout3 = new QHBoxLayout(layout, KDialog::spacingHint());
+ QPushButton *release = new QPushButton(i18n("Release"), this);
+ QPushButton *debug = new QPushButton(i18n("Debug"), this);
+ layout3->addWidget(release);
+ layout3->addWidget(debug);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
+ connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));
+
+ layout->addStretch();
+}
+
+ DebugOptimTab::~ DebugOptimTab( )
+{
+ delete controller;
+ delete radioController;
+}
+
+void DebugOptimTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ radioController->readFlags(str);
+}
+
+void DebugOptimTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ radioController->writeFlags(str);
+}
+
+void DebugOptimTab::setReleaseOptions()
+{
+ QStringList sl = QStringList::split(",", "'-$O+','-$Y-','-$D-','-$L-'");
+ readFlags(&sl);
+ gdb->setChecked(false);
+ namespacedb->setChecked(false);
+ symboldb->setChecked(false);
+}
+
+void DebugOptimTab::setDebugOptions()
+{
+ QStringList sl = QStringList::split(",", "'-$O-','-$Y+','-$D+','-$L+',-V,-VN");
+ readFlags(&sl);
+}
+
+#include "optiontabs.moc"
diff --git a/languages/pascal/compiler/dccoptions/optiontabs.h b/languages/pascal/compiler/dccoptions/optiontabs.h
new file mode 100644
index 00000000..048684a5
--- /dev/null
+++ b/languages/pascal/compiler/dccoptions/optiontabs.h
@@ -0,0 +1,116 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 OPTIONTABS_H
+#define OPTIONTABS_H
+
+#include <qwidget.h>
+
+class FlagRadioButtonController;
+class FlagPathEditController;
+class FlagCheckBoxController;
+class FlagEditController;
+class QRadioButton;
+class FlagRadioButton;
+class FlagCheckBox;
+
+class LinkerTab : public QWidget
+{
+public:
+ LinkerTab( QWidget *parent=0, const char *name=0 );
+ ~LinkerTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagRadioButtonController *radioController;
+ FlagPathEditController *pathController;
+ FlagEditController *editController;
+};
+
+class LocationsTab : public QWidget
+{
+public:
+ LocationsTab( QWidget *parent=0, const char *name=0 );
+ ~LocationsTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagPathEditController *pathController;
+};
+
+class Locations2Tab : public QWidget
+{
+public:
+ Locations2Tab( QWidget *parent=0, const char *name=0 );
+ ~Locations2Tab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagPathEditController *pathController;
+};
+
+class GeneralTab: public QWidget
+{
+public:
+ GeneralTab( QWidget *parent=0, const char *name=0 );
+ ~GeneralTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagEditController *editController;
+};
+
+class CodegenTab : public QWidget
+{
+public:
+ CodegenTab( QWidget *parent=0, const char *name=0 );
+ ~CodegenTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagEditController *listController;
+ FlagRadioButtonController *radioController;
+};
+
+class DebugOptimTab : public QWidget
+{
+ Q_OBJECT
+public:
+ DebugOptimTab( QWidget *parent=0, const char *name=0 );
+ ~DebugOptimTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagRadioButtonController *radioController;
+
+ FlagCheckBox *gdb;
+ FlagCheckBox *namespacedb;
+ FlagCheckBox *symboldb;
+
+private slots:
+ void setReleaseOptions();
+ void setDebugOptions();
+};
+
+#endif
diff --git a/languages/pascal/compiler/fpcoptions/Makefile.am b/languages/pascal/compiler/fpcoptions/Makefile.am
new file mode 100644
index 00000000..2868bd01
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/Makefile.am
@@ -0,0 +1,20 @@
+# Here resides the gcc option dialog plugin.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extras \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfpcoptions.la
+libkdevfpcoptions_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+libkdevfpcoptions_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(LIB_KHTML)
+
+libkdevfpcoptions_la_SOURCES = fpcoptionsplugin.cpp optiontabs.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfpcoptions.desktop
+
+
+
+
diff --git a/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.cpp b/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.cpp
new file mode 100644
index 00000000..6fd73e5f
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.cpp
@@ -0,0 +1,126 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <qvbox.h>
+
+#include <klocale.h>
+#include <kgenericfactory.h>
+
+#include "optiontabs.h"
+#include "fpcoptionsplugin.h"
+
+K_EXPORT_COMPONENT_FACTORY( libkdevfpcoptions, KGenericFactory<FpcOptionsPlugin>( "kdevfpcoptions" ) )
+
+FpcOptionsPlugin::FpcOptionsPlugin(QObject *parent, const char *name, const QStringList& /*args*/)
+ : KDevCompilerOptions(parent, name)
+{
+}
+
+FpcOptionsPlugin::~FpcOptionsPlugin()
+{
+}
+
+QString FpcOptionsPlugin::exec(QWidget *parent, const QString &flags)
+{
+ FpcOptionsDialog *dlg = new FpcOptionsDialog(parent, "fpc options dialog");
+ QString newFlags = flags;
+ dlg->setFlags(flags);
+ if (dlg->exec() == QDialog::Accepted)
+ newFlags = dlg->flags();
+ delete dlg;
+ return newFlags;
+}
+
+
+
+FpcOptionsDialog::FpcOptionsDialog( QWidget *parent, const char *name )
+ : KDialogBase(Tabbed, i18n("Free Pascal Compiler Options"), Ok|Cancel, Ok, parent, name, true)
+{
+ QVBox *vbox;
+
+ vbox = addVBoxPage(i18n("Language"));
+ language = new LanguageTab(vbox, "language tab");
+
+ vbox = addVBoxPage(i18n("Locations I"));
+ directories = new FilesAndDirectoriesTab(vbox, "directories tab");
+
+ vbox = addVBoxPage(i18n("Locations II"));
+ directories2 = new FilesAndDirectoriesTab2(vbox, "directories2 tab");
+
+ vbox = addVBoxPage(i18n("Debug && Optimization"));
+ debug_optim = new DebugOptimTab(vbox, "debug_optim tab");
+
+ vbox = addVBoxPage(i18n("Code Generation"));
+ codegen = new CodegenTab(vbox, "codegen tab");
+
+ vbox = addVBoxPage(i18n("Assembler"));
+ assembler = new AssemblerTab(vbox, "assembler tab");
+
+ vbox = addVBoxPage(i18n("Linker"));
+ linker = new LinkerTab(vbox, "linker tab");
+
+ vbox = addVBoxPage(i18n("Feedback"));
+ feedback = new FeedbackTab(vbox, "feedback tab");
+
+ vbox = addVBoxPage(i18n("Miscellaneous"));
+ misc = new MiscTab(vbox, "miscellaneous tab");
+}
+
+FpcOptionsDialog::~FpcOptionsDialog()
+{
+}
+
+void FpcOptionsDialog::setFlags(const QString &flags)
+{
+ QStringList flaglist = QStringList::split(" ", flags);
+
+ feedback->readFlags(&flaglist);
+ language->readFlags(&flaglist);
+ assembler->readFlags(&flaglist);
+ linker->readFlags(&flaglist);
+ codegen->readFlags(&flaglist);
+ debug_optim->readFlags(&flaglist);
+ directories->readFlags(&flaglist);
+ directories2->readFlags(&flaglist);
+ misc->readFlags(&flaglist);
+ unrecognizedFlags = flaglist;
+}
+
+QString FpcOptionsDialog::flags() const
+{
+ QStringList flaglist;
+
+ language->writeFlags(&flaglist);
+ directories->writeFlags(&flaglist);
+ directories2->writeFlags(&flaglist);
+ debug_optim->writeFlags(&flaglist);
+ codegen->writeFlags(&flaglist);
+ assembler->writeFlags(&flaglist);
+ linker->writeFlags(&flaglist);
+ feedback->writeFlags(&flaglist);
+ misc->writeFlags(&flaglist);
+
+ QString flags;
+ QStringList::ConstIterator li;
+ for (li = flaglist.begin(); li != flaglist.end(); ++li) {
+ flags += (*li);
+ flags += " ";
+ }
+
+ for (li = unrecognizedFlags.begin(); li != unrecognizedFlags.end(); ++li) {
+ flags += (*li);
+ flags += " ";
+ }
+
+ flags.truncate(flags.length()-1);
+ return flags;
+}
+
+#include "fpcoptionsplugin.moc"
diff --git a/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.h b/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.h
new file mode 100644
index 00000000..f6b15fff
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/fpcoptionsplugin.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 DCCOPTIONSPLUGIN_H
+#define DCCOPTIONSPLUGIN_H
+
+#include <kdialogbase.h>
+
+#include "kdevcompileroptions.h"
+
+class FpcOptionsPlugin : public KDevCompilerOptions
+{
+ Q_OBJECT
+
+public:
+ FpcOptionsPlugin( QObject *parent, const char *name, const QStringList &args );
+ ~FpcOptionsPlugin();
+
+ virtual QString exec(QWidget *parent, const QString &flags);
+};
+
+
+class FeedbackTab;
+class FilesAndDirectoriesTab;
+class LanguageTab;
+class CodegenTab;
+
+class FpcOptionsDialog : public KDialogBase
+{
+public:
+ FpcOptionsDialog( QWidget *parent=0, const char *name=0 );
+ ~FpcOptionsDialog();
+
+ void setFlags(const QString &flags);
+ QString flags() const;
+
+private:
+/* GeneralTab *general;
+ OptimizationTab *optimization;
+ G77Tab *g77;
+ Warnings1Tab *warnings1;
+ Warnings2Tab *warnings2;*/
+
+ FeedbackTab *feedback;
+ FilesAndDirectoriesTab *directories;
+ FilesAndDirectoriesTab2 *directories2;
+ DebugOptimTab *debug_optim;
+ LanguageTab *language;
+ CodegenTab *codegen;
+ AssemblerTab *assembler;
+ LinkerTab *linker;
+ MiscTab *misc;
+ QStringList unrecognizedFlags;
+};
+
+#endif
diff --git a/languages/pascal/compiler/fpcoptions/kdevfpcoptions.desktop b/languages/pascal/compiler/fpcoptions/kdevfpcoptions.desktop
new file mode 100644
index 00000000..246cf08b
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/kdevfpcoptions.desktop
@@ -0,0 +1,55 @@
+[Desktop Entry]
+Type=Service
+Exec=fpc
+Comment=Free Pascal Compiler
+Comment[br]=Dastumer Pascal dieub
+Comment[ca]=Compilador Free Pascal
+Comment[da]=Free Pascal oversætter
+Comment[el]=Μεταγλωττιστής Free Pascal
+Comment[es]=Compilador Free Pascal
+Comment[et]=Free Pascal kompilaator
+Comment[eu]=Free Pascal konpiladorea
+Comment[fa]=مترجم آزاد پاسکال
+Comment[fr]=Compilateur Free Pascal
+Comment[ga]=Tiomsaitheoir Saor Pascal
+Comment[gl]=Compilador Free Pascal
+Comment[hi]=फ्री पॉस्कल कम्पायलर
+Comment[hu]=Szabad forráskódú Pascal fordítóprogram
+Comment[is]=Frjáls Pascal þýðandi
+Comment[it]=Compilatore per Free Pascal
+Comment[ja]=Free Pascal コンパイラ
+Comment[nds]=Free Pascal-Kompilerer
+Comment[ne]=स्वतन्त्र पास्कल कम्पाइलर
+Comment[nl]=Free Pascal-compiler
+Comment[pt]=Compilador Free Pascal
+Comment[pt_BR]=Compilador Free Pascal
+Comment[ru]=Компилятор Free Pascal
+Comment[sk]=Voľný Pascal kompilátor
+Comment[sl]=Prevajalnik za Free Pascal
+Comment[sr]=Слободни преводилац Pascal-а
+Comment[sr@Latn]=Slobodni prevodilac Pascal-a
+Comment[sv]=Fri Pascal-kompilator
+Comment[ta]=இலவச பாஸ்கல் தொகுப்பி
+Comment[tg]=Талфифгари Free Pascal
+Comment[tr]=Serbest Pascal Derleyicisi
+Comment[zh_CN]=Free Pascal 编译器
+Comment[zh_TW]=Free Pascal 編譯器
+Name=FpcOptions
+Name[da]=Free Pascal oversætter indstillinger
+Name[de]=Fpc-Einstellungen (KDevelop)
+Name[hi]=एफपीसी-विकल्प
+Name[nds]=Fpc-Optschonen (KDevelop)
+Name[pl]=Opcje Fpc
+Name[sk]=Fpc možnosti
+Name[sl]=Možnosti Fpc
+Name[sv]=Alternativ för fpc
+Name[ta]=Fpcவிருப்பங்கள்
+Name[tg]=FpcИнтихобҳо
+Name[zh_TW]=Fpc 選項
+ServiceTypes=KDevelop/CompilerOptions
+X-KDE-Library=libkdevfpcoptions
+X-KDevelop-Version=5
+X-KDevelop-Language=Pascal
+X-KDevelop-Args=fpc
+X-KDevelop-Default=true
+
diff --git a/languages/pascal/compiler/fpcoptions/optiontabs.cpp b/languages/pascal/compiler/fpcoptions/optiontabs.cpp
new file mode 100644
index 00000000..2579cb3c
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/optiontabs.cpp
@@ -0,0 +1,657 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <kdialog.h>
+#include <klocale.h>
+
+#include <qspinbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qvbuttongroup.h>
+#include <qapplication.h>
+#include <qframe.h>
+#include <qpushbutton.h>
+
+#include "flagboxes.h"
+
+#include "optiontabs.h"
+
+FeedbackTab::FeedbackTab(QWidget *parent, const char *name)
+ : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *output_group = new QVButtonGroup(i18n("Output"), this);
+ new FlagCheckBox(output_group, controller,
+ "-vr", i18n("Format errors like GCC does"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *verbose_group = new QVButtonGroup(i18n("Verbose"), this);
+ new FlagCheckBox(verbose_group, controller,
+ "-va", i18n("Write all possible info"));
+ new FlagCheckBox(verbose_group, controller,
+ "-v0", i18n("Write no messages"));
+ new FlagCheckBox(verbose_group, controller,
+ "-ve", i18n("Show only errors"));
+ new FlagCheckBox(verbose_group, controller,
+ "-vi", i18n("Show some general information"));
+ new FlagCheckBox(verbose_group, controller,
+ "-vw", i18n("Issue warnings"));
+ new FlagCheckBox(verbose_group, controller,
+ "-vn", i18n("Issue notes"));
+ new FlagCheckBox(verbose_group, controller,
+ "-vh", i18n("Issue hints"));
+ new FlagCheckBox(verbose_group, controller,
+ "-vd", i18n("Write other debugging info"));
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *other_group = new QVButtonGroup(i18n("Other Information"), this);
+ new FlagCheckBox(other_group, controller,
+ "-vl", i18n("Show line numbers when processing files"));
+ new FlagCheckBox(other_group, controller,
+ "-vu", i18n("Print information on loaded units"));
+ new FlagCheckBox(other_group, controller,
+ "-vt", i18n("Print the names of loaded files"));
+ new FlagCheckBox(other_group, controller,
+ "-vm", i18n("Write which macros are defined"));
+ new FlagCheckBox(other_group, controller,
+ "-vc", i18n("Warn when processing a conditional"));
+ new FlagCheckBox(other_group, controller,
+ "-vp", i18n("Print the names of procedures and functions"));
+ new FlagCheckBox(other_group, controller,
+ "-vb", i18n("Show all procedure declarations if an overloaded function error occurs"));
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+FeedbackTab::~FeedbackTab()
+{
+ delete controller;
+}
+
+void FeedbackTab::readFlags(QStringList *list)
+{
+ controller->readFlags(list);
+}
+
+void FeedbackTab::writeFlags(QStringList *list)
+{
+ controller->writeFlags(list);
+}
+
+
+
+FilesAndDirectoriesTab::FilesAndDirectoriesTab( QWidget * parent, const char * name )
+ :QWidget(parent, name), controller(new FlagCheckBoxController()),
+ pathController(new FlagPathEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ new FlagPathEdit(this, ":", pathController,
+ "-Fu", i18n("Unit search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-Fi", i18n("Include file search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-Fo", i18n("Object file search path (delimited by \":\"):"));
+ new FlagPathEdit(this, ":", pathController,
+ "-Fl", i18n("Library search path (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addStretch();
+}
+
+FilesAndDirectoriesTab::~FilesAndDirectoriesTab( )
+{
+ delete controller;
+ delete pathController;
+}
+
+void FilesAndDirectoriesTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ pathController->readFlags(str);
+}
+
+void FilesAndDirectoriesTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ pathController->writeFlags(str);
+}
+
+FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( QWidget * parent, const char * name )
+ :QWidget(parent, name), controller(new FlagCheckBoxController()),
+ pathController(new FlagPathEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ new FlagPathEdit(this, "", pathController,
+ "-FE", i18n("Write executables and units in:"));
+ new FlagPathEdit(this, "", pathController,
+ "-FU", i18n("Write units in:"));
+ new FlagPathEdit(this, "", pathController,
+ "-o", i18n("Executable name:"), KFile::File);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(20);
+
+ new FlagPathEdit(this, "", pathController,
+ "-e", i18n("Location of as and ld programs:"));
+ new FlagPathEdit(this, "", pathController,
+ "-FL", i18n("Dynamic linker executable:"), KFile::File);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(20);
+
+ new FlagPathEdit(this, "", pathController,
+ "-Fr", i18n("Compiler messages file:"), KFile::File);
+ new FlagPathEdit(this, "", pathController,
+ "-Fe", i18n("Write compiler messages to file:"), KFile::File);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+FilesAndDirectoriesTab2::~FilesAndDirectoriesTab2( )
+{
+ delete controller;
+ delete pathController;
+}
+
+void FilesAndDirectoriesTab2::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ pathController->readFlags(str);
+}
+
+void FilesAndDirectoriesTab2::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ pathController->writeFlags(str);
+}
+
+
+LanguageTab::LanguageTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *compat_group = new QVButtonGroup(i18n("Pascal Compatibility"), this);
+ new FlagCheckBox(compat_group, controller,
+ "-S2", i18n("Switch on Delphi 2 extensions"));
+ new FlagCheckBox(compat_group, controller,
+ "-Sd", i18n("Strict Delphi compatibility mode"));
+ new FlagCheckBox(compat_group, controller,
+ "-So", i18n("Borland TP 7.0 compatibility mode"));
+ new FlagCheckBox(compat_group, controller,
+ "-Sp", i18n("GNU Pascal compatibility mode"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *ccompat_group = new QVButtonGroup(i18n("C/C++ Compatibility"), this);
+ new FlagCheckBox(ccompat_group, controller,
+ "-Sc", i18n("Support C style operators *=, +=, /=, -="));
+ new FlagCheckBox(ccompat_group, controller,
+ "-Si", i18n("Support C++ style INLINE"));
+ new FlagCheckBox(ccompat_group, controller,
+ "-Sm", i18n("Support C style macros"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *lang_group = new QVButtonGroup(i18n("Language"), this);
+ new FlagCheckBox(lang_group, controller,
+ "-Sg", i18n("Support the label and goto commands"));
+ new FlagCheckBox(lang_group, controller,
+ "-Sh", i18n("Use ansistrings by default for strings"));
+ new FlagCheckBox(lang_group, controller,
+ "-Ss", i18n("Require the name of constructors to be init\n and the name of destructors to be done"));
+ new FlagCheckBox(lang_group, controller,
+ "-St", i18n("Allow the static keyword in objects"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+ LanguageTab::~ LanguageTab( )
+{
+ delete controller;
+}
+
+void LanguageTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+}
+
+void LanguageTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+}
+
+AssemblerTab::AssemblerTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ asmController(new FlagRadioButtonController)
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+// layout->setAutoAdd(true);
+
+ QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
+
+ QVButtonGroup *info_group = new QVButtonGroup(i18n("Assembler Info"), this);
+ new FlagCheckBox(info_group, controller,
+ "-a", i18n("Do not delete assembler files"));
+ new FlagCheckBox(info_group, controller,
+ "-al", i18n("List source"));
+ new FlagCheckBox(info_group, controller,
+ "-ar", i18n("List register allocation and release info"));
+ new FlagCheckBox(info_group, controller,
+ "-at", i18n("List temporary allocations and deallocations"));
+ layout2->addWidget(info_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ //layout->addSpacing(10);
+
+ QVButtonGroup *asmkind_group = new QVButtonGroup(i18n("Assembler Reader"), this);
+ QRadioButton *m_defaultkind = new QRadioButton(i18n("Use default reader"), asmkind_group);
+ m_defaultkind->setChecked(true);
+ new FlagRadioButton(asmkind_group, asmController,
+ "-Ratt", i18n("AT&T style assembler"));
+ new FlagRadioButton(asmkind_group, asmController,
+ "-Rintel", i18n("Intel style assembler"));
+ new FlagRadioButton(asmkind_group, asmController,
+ "-Rdirect", i18n("Direct assembler"));
+ layout2->addWidget(asmkind_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+
+ QVButtonGroup *asm_group = new QVButtonGroup(i18n("Assembler Output"), this);
+ new FlagCheckBox(asm_group, controller,
+ "-P", i18n("Use pipes instead of files when assembling"));
+ QRadioButton *m_default = new QRadioButton(i18n("Use default output"), asm_group);
+ m_default->setChecked(true);
+ new FlagRadioButton(asm_group, asmController,
+ "-Aas", i18n("Use GNU as"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Aasout", i18n("Use GNU asaout"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Anasmcoff", i18n("Use NASM coff"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Anasmelf", i18n("Use NASM elf"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Anasmobj", i18n("Use NASM obj"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Amasm", i18n("Use MASM"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Atasm", i18n("Use TASM"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Acoff", i18n("Use coff"));
+ new FlagRadioButton(asm_group, asmController,
+ "-Apecoff", i18n("Use pecoff"));
+ layout->addWidget(asm_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+ AssemblerTab::~ AssemblerTab( )
+{
+ delete controller;
+ delete asmController;
+}
+
+void AssemblerTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ asmController->readFlags(str);
+}
+
+void AssemblerTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ asmController->writeFlags(str);
+}
+
+
+
+DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ optimController(new FlagRadioButtonController)
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+// layout->setAutoAdd(true);
+
+ QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
+
+ QBoxLayout *layout3 = new QVBoxLayout(layout2, KDialog::spacingHint());
+
+ QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
+ new FlagCheckBox(debug_group, controller,
+ "-g", i18n("Generate information for GDB"), "-!g");
+ new FlagCheckBox(debug_group, controller,
+ "-gd", i18n("Generate information for DBX"), "-!gd");
+ new FlagCheckBox(debug_group, controller,
+ "-gl", i18n("Use lineinfo unit"), "-!gl");
+ new FlagCheckBox(debug_group, controller,
+ "-gh", i18n("Use heaptrc unit"), "-!gh");
+ new FlagCheckBox(debug_group, controller,
+ "-gc", i18n("Generate checks for pointers"), "-!gc");
+ layout3->addWidget(debug_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout3->addSpacing(10);
+
+ QVButtonGroup *profile_group = new QVButtonGroup(i18n("Profiling"), this);
+ new FlagCheckBox(profile_group, controller,
+ "-pg", i18n("Generate profiler code for gprof"), "-!pg");
+ layout3->addWidget(profile_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout3->addSpacing(10);
+
+ QBoxLayout *layout4 = new QVBoxLayout(layout2, KDialog::spacingHint());
+
+ QVButtonGroup *optim_group1 = new QVButtonGroup(i18n("General Optimization"), this);
+ m_default = new QRadioButton(i18n("Default"), optim_group1);
+ m_default->setChecked(true);
+ new FlagRadioButton(optim_group1, optimController,
+ "-Og", i18n("Generate smaller code"));
+ optim1 = new FlagRadioButton(optim_group1, optimController,
+ "-OG", i18n("Generate faster code"));
+ layout4->addWidget(optim_group1);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout4->addSpacing(10);
+
+ QVButtonGroup *optim_group2 = new QVButtonGroup(i18n("Optimization Levels"), this);
+ m_default2 = new QRadioButton(i18n("Default"), optim_group2);
+ m_default2->setChecked(true);
+ new FlagRadioButton(optim_group2, optimController,
+ "-O1", i18n("Level 1"));
+ new FlagRadioButton(optim_group2, optimController,
+ "-O2", i18n("Level 2"));
+ optim2 = new FlagRadioButton(optim_group2, optimController,
+ "-O3", i18n("Level 3"));
+ layout4->addWidget(optim_group2);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout4->addSpacing(10);
+
+ QHBoxLayout *layout5 = new QHBoxLayout(layout, KDialog::spacingHint());
+
+ QVButtonGroup *optim_group3 = new QVButtonGroup(i18n("Architecture"), this);
+ m_default3 = new QRadioButton(i18n("Default"), optim_group3);
+ m_default3->setChecked(true);
+ new FlagRadioButton(optim_group3, optimController,
+ "-Op1", i18n("386/486"));
+ new FlagRadioButton(optim_group3, optimController,
+ "-Op2", i18n("Pentium/PentiumMMX"));
+ new FlagRadioButton(optim_group3, optimController,
+ "-Op2", i18n("PentiumPro/PII/Cyrix 6x86/K6"));
+ layout5->addWidget(optim_group3);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QVButtonGroup *optim_group4 = new QVButtonGroup(i18n("Another Optimization"), this);
+ new FlagCheckBox(optim_group4, controller,
+ "-Or", i18n("Use register variables"), "-!Or");
+ new FlagCheckBox(optim_group4, controller,
+ "-Ou", i18n("Uncertain optimizations"), "-!Ou");
+ layout5->addWidget(optim_group4);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QHBoxLayout *layout6 = new QHBoxLayout(layout, KDialog::spacingHint());
+ QPushButton *release = new QPushButton(i18n("Release"), this);
+ QPushButton *debug = new QPushButton(i18n("Debug"), this);
+ layout6->addWidget(release);
+ layout6->addWidget(debug);
+ connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
+ connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));
+
+ layout->addStretch();
+}
+
+ DebugOptimTab::~ DebugOptimTab( )
+{
+ delete controller;
+ delete optimController;
+}
+
+void DebugOptimTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ optimController->readFlags(str);
+}
+
+void DebugOptimTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ optimController->writeFlags(str);
+}
+
+void DebugOptimTab::setReleaseOptions()
+{
+ m_default->setChecked(true);
+ m_default2->setChecked(true);
+// m_default3->setChecked(true);
+ QStringList sl = QStringList::split(",", "-!g,-!gd,-!gl,-!gh,-!gc,-!pg,-!Ou,-!Or");
+ readFlags(&sl);
+ optim1->setChecked(true);
+ optim2->setChecked(true);
+}
+
+void DebugOptimTab::setDebugOptions()
+{
+ QStringList sl = QStringList::split(",", "-g,-gl,-gh,-gc");
+ readFlags(&sl);
+ m_default->setChecked(true);
+ m_default2->setChecked(true);
+// m_default3->setChecked(true);
+}
+
+CodegenTab::CodegenTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ listController(new FlagEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ QVButtonGroup *compile_group = new QVButtonGroup(i18n("Compile Time Checks"), this);
+ new FlagCheckBox(compile_group, controller,
+ "-Sa", i18n("Include assert statements in compiled code"));
+ new FlagCheckBox(compile_group, controller,
+ "-Un", i18n("Do not check the unit name for being the same as the file name"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *run_group = new QVButtonGroup(i18n("Run Time Checks"), this);
+ new FlagCheckBox(run_group, controller,
+ "-Cr", i18n("Range checking"));
+ new FlagCheckBox(run_group, controller,
+ "-Ct", i18n("Stack checking"));
+ new FlagCheckBox(run_group, controller,
+ "-Ci", i18n("Input/Output checking"));
+ new FlagCheckBox(run_group, controller,
+ "-Co", i18n("Integer overflow checking"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ new FlagListEdit(this, ":", listController, "-d", i18n("Conditional defines (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ new FlagListEdit(this, ":", listController, "-u", i18n("Undefine conditional defines (delimited by \":\"):"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ new FlagSpinEdit(this, 1024, 67107840, 1, 131072, listController,
+ "-Cs", i18n("Stack size:"));
+ new FlagSpinEdit(this, 1024, 67107840, 1, 2097152, listController,
+ "-Ch", i18n("Heap size:"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+CodegenTab::~ CodegenTab( )
+{
+ delete controller;
+ delete listController;
+}
+
+void CodegenTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ listController->readFlags(str);
+}
+
+void CodegenTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ listController->writeFlags(str);
+}
+
+LinkerTab::LinkerTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ listController(new FlagEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+
+ QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());
+
+ QVButtonGroup *link_group = new QVButtonGroup(i18n("Linking Stage"), this);
+ new FlagCheckBox(link_group, controller,
+ "-CD", i18n("Create dynamic library"));
+ new FlagCheckBox(link_group, controller,
+ "-CX", i18n("Create smartlinked units"));
+ new FlagCheckBox(link_group, controller,
+ "-Ur", i18n("Generate release units"));
+ new FlagCheckBox(link_group, controller,
+ "-Cn", i18n("Omit the linking stage"));
+ new FlagCheckBox(link_group, controller,
+ "-s", i18n("Create assembling and linking script"));
+ layout2->addWidget(link_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QVButtonGroup *exec_group = new QVButtonGroup(i18n("Executable Generation"), this);
+ new FlagCheckBox(exec_group, controller,
+ "-Xs", i18n("Strip the symbols from the executable"));
+ new FlagCheckBox(exec_group, controller,
+ "-XS", i18n("Link with static units"));
+ new FlagCheckBox(exec_group, controller,
+ "-XX", i18n("Link with smartlinked units"));
+ new FlagCheckBox(exec_group, controller,
+ "-XD", i18n("Link with dynamic libraries"));
+ new FlagCheckBox(exec_group, controller,
+ "-Xc", i18n("Link with the C library"));
+ layout2->addWidget(exec_group);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ FlagListEdit *led = new FlagListEdit(this, ":", listController, "-k", i18n("Options passed to the linker (delimited by \":\"):"));
+ layout->addWidget(led);
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ layout->addStretch();
+}
+
+LinkerTab::~LinkerTab( )
+{
+ delete controller;
+ delete listController;
+}
+
+void LinkerTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ listController->readFlags(str);
+}
+
+void LinkerTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ listController->writeFlags(str);
+}
+
+MiscTab::MiscTab( QWidget * parent, const char * name )
+ : QWidget(parent, name), controller(new FlagCheckBoxController()),
+ radioController(new FlagRadioButtonController()),
+ pathController(new FlagPathEditController()),
+ editController(new FlagEditController())
+{
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ layout->setAutoAdd(true);
+
+ new FlagCheckBox(this, controller,
+ "-B", i18n("Recompile all used units"));
+ new FlagCheckBox(this, controller,
+ "-n", i18n("Do not read default configuration file"));
+ new FlagPathEdit(this, "", pathController,
+ "@", i18n("Compiler configuration file:"), KFile::File);
+ new FlagSpinEdit(this, 1, 1000, 1, 50, editController,
+ "-Se", i18n("Stop after the error:"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *browser_group = new QVButtonGroup(i18n("Browser Info"), this);
+ QRadioButton *m_defaultBrowser = new QRadioButton(i18n("No browser info"), browser_group);
+ m_defaultBrowser->setChecked(true);
+ new FlagRadioButton(browser_group, radioController,
+ "-b", i18n("Global browser info"));
+ new FlagRadioButton(browser_group, radioController,
+ "-bl", i18n("Global and local browser info"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ QVButtonGroup *target_group = new QVButtonGroup(i18n("Target OS"), this);
+ QRadioButton *m_defaultTarget = new QRadioButton(i18n("Default"), target_group);
+ m_defaultTarget->setChecked(true);
+ new FlagRadioButton(target_group, radioController,
+ "-TGO32V1", i18n("DOS and version 1 of the DJ DELORIE extender"));
+ new FlagRadioButton(target_group, radioController,
+ "-TGO32V2", i18n("DOS and version 2 of the DJ DELORIE extender"));
+ new FlagRadioButton(target_group, radioController,
+ "-TLINUX", i18n("Linux"));
+ new FlagRadioButton(target_group, radioController,
+ "-TOS2", i18n("OS/2 (2.x) using the EMX extender"));
+ new FlagRadioButton(target_group, radioController,
+ "-TWIN32", i18n("WINDOWS 32 bit"));
+ new FlagRadioButton(target_group, radioController,
+ "-TSUNOS", i18n("SunOS/Solaris"));
+ new FlagRadioButton(target_group, radioController,
+ "-TBEOS", i18n("BeOS"));
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+ layout->addSpacing(10);
+
+ layout->addStretch();
+}
+
+MiscTab::~ MiscTab( )
+{
+ delete controller;
+ delete pathController;
+ delete radioController;
+ delete editController;
+}
+
+void MiscTab::readFlags( QStringList * str )
+{
+ controller->readFlags(str);
+ radioController->readFlags(str);
+ pathController->readFlags(str);
+ editController->readFlags(str);
+}
+
+void MiscTab::writeFlags( QStringList * str )
+{
+ controller->writeFlags(str);
+ radioController->writeFlags(str);
+ pathController->writeFlags(str);
+ editController->writeFlags(str);
+}
+
+#include "optiontabs.moc"
diff --git a/languages/pascal/compiler/fpcoptions/optiontabs.h b/languages/pascal/compiler/fpcoptions/optiontabs.h
new file mode 100644
index 00000000..56109ae2
--- /dev/null
+++ b/languages/pascal/compiler/fpcoptions/optiontabs.h
@@ -0,0 +1,161 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 OPTIONTABS_H
+#define OPTIONTABS_H
+
+#include <qwidget.h>
+
+class QSpinBox;
+class QRadioButton;
+class FlagRadioButton;
+class FlagCheckBoxController;
+class FlagRadioButtonController;
+class FlagPathEditController;
+class FlagEditController;
+
+class FeedbackTab : public QWidget
+{
+public:
+ FeedbackTab( QWidget *parent=0, const char *name=0 );
+ ~FeedbackTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+};
+
+class FilesAndDirectoriesTab: public QWidget
+{
+public:
+ FilesAndDirectoriesTab( QWidget *parent = 0, const char *name = 0);
+ ~FilesAndDirectoriesTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagPathEditController *pathController;
+};
+
+class FilesAndDirectoriesTab2: public QWidget
+{
+public:
+ FilesAndDirectoriesTab2( QWidget *parent = 0, const char *name = 0);
+ ~FilesAndDirectoriesTab2();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagPathEditController *pathController;
+};
+
+class LanguageTab : public QWidget
+{
+public:
+ LanguageTab( QWidget *parent=0, const char *name=0 );
+ ~LanguageTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+};
+
+class AssemblerTab : public QWidget
+{
+public:
+ AssemblerTab( QWidget *parent=0, const char *name=0 );
+ ~AssemblerTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagRadioButtonController *asmController;
+};
+
+class DebugOptimTab : public QWidget
+{
+ Q_OBJECT
+public:
+ DebugOptimTab( QWidget *parent=0, const char *name=0 );
+ ~DebugOptimTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagRadioButtonController *optimController;
+
+ QRadioButton *m_default;
+ QRadioButton *m_default2;
+ QRadioButton *m_default3;
+ FlagRadioButton *optim1;
+ FlagRadioButton *optim2;
+
+private slots:
+ void setReleaseOptions();
+ void setDebugOptions();
+};
+
+class CodegenTab : public QWidget
+{
+public:
+ CodegenTab( QWidget *parent=0, const char *name=0 );
+ ~CodegenTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagEditController *listController;
+};
+
+class LinkerTab : public QWidget
+{
+public:
+ LinkerTab( QWidget *parent=0, const char *name=0 );
+ ~LinkerTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagEditController *listController;
+};
+
+class MiscTab : public QWidget
+{
+public:
+ MiscTab( QWidget *parent=0, const char *name=0 );
+ ~MiscTab();
+
+ void readFlags(QStringList *str);
+ void writeFlags(QStringList *str);
+
+private:
+ FlagCheckBoxController *controller;
+ FlagRadioButtonController *radioController;
+ FlagPathEditController *pathController;
+ FlagEditController *editController;
+};
+
+#endif
diff --git a/languages/pascal/configproblemreporter.ui b/languages/pascal/configproblemreporter.ui
new file mode 100644
index 00000000..a215f7a8
--- /dev/null
+++ b/languages/pascal/configproblemreporter.ui
@@ -0,0 +1,88 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ConfigureProblemReporter</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigureProblemReporter</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>390</width>
+ <height>306</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>bgParserCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable background parsing</string>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>delaySlider</cstring>
+ </property>
+ <property name="maxValue">
+ <number>2000</number>
+ </property>
+ <property name="lineStep">
+ <number>250</number>
+ </property>
+ <property name="pageStep">
+ <number>500</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>NoMarks</enum>
+ </property>
+ <property name="tickInterval">
+ <number>250</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>101</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>bgParserCheckbox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>ConfigureProblemReporter</receiver>
+ <slot>bgParserCheckbox_toggled(bool)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>init()</slot>
+ <slot>destroy()</slot>
+ <slot>accept()</slot>
+ <slot>bgParserCheckbox_toggled( bool b )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/pascal/doc/Makefile.am b/languages/pascal/doc/Makefile.am
new file mode 100644
index 00000000..a7829d08
--- /dev/null
+++ b/languages/pascal/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = pascal_bugs_fp.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/pascal/doc/pascal_bugs_fp.toc b/languages/pascal/doc/pascal_bugs_fp.toc
new file mode 100644
index 00000000..60be2ec5
--- /dev/null
+++ b/languages/pascal/doc/pascal_bugs_fp.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Pascal bugs (fp)</title>
+<base href="http://www.freepascal.org/"/>
+<tocsect1 name="Query" url="bugs.html">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/pascal/file_templates/Makefile.am b/languages/pascal/file_templates/Makefile.am
new file mode 100644
index 00000000..94891c97
--- /dev/null
+++ b/languages/pascal/file_templates/Makefile.am
@@ -0,0 +1,2 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = dpr pas-program pas-unit pp-program pp-unit
diff --git a/languages/pascal/file_templates/dpr b/languages/pascal/file_templates/dpr
new file mode 100644
index 00000000..3f271522
--- /dev/null
+++ b/languages/pascal/file_templates/dpr
@@ -0,0 +1,12 @@
+{
+ Pascal program: $MODULE$
+
+ Description:
+ Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ Copyright: See COPYING file that comes with this distribution
+}
+program $MODULE$;
+
+begin
+
+end.
diff --git a/languages/pascal/file_templates/pas-program b/languages/pascal/file_templates/pas-program
new file mode 100644
index 00000000..3f271522
--- /dev/null
+++ b/languages/pascal/file_templates/pas-program
@@ -0,0 +1,12 @@
+{
+ Pascal program: $MODULE$
+
+ Description:
+ Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ Copyright: See COPYING file that comes with this distribution
+}
+program $MODULE$;
+
+begin
+
+end.
diff --git a/languages/pascal/file_templates/pas-unit b/languages/pascal/file_templates/pas-unit
new file mode 100644
index 00000000..98b52e50
--- /dev/null
+++ b/languages/pascal/file_templates/pas-unit
@@ -0,0 +1,19 @@
+{
+ Pascal unit: $MODULE$
+
+ Description:
+ Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ Copyright: See COPYING file that comes with this distribution
+}
+
+unit $MODULE$;
+
+interface
+
+implementation
+
+initialization
+
+finalization
+
+end.
diff --git a/languages/pascal/file_templates/pp-program b/languages/pascal/file_templates/pp-program
new file mode 100644
index 00000000..3f271522
--- /dev/null
+++ b/languages/pascal/file_templates/pp-program
@@ -0,0 +1,12 @@
+{
+ Pascal program: $MODULE$
+
+ Description:
+ Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ Copyright: See COPYING file that comes with this distribution
+}
+program $MODULE$;
+
+begin
+
+end.
diff --git a/languages/pascal/file_templates/pp-unit b/languages/pascal/file_templates/pp-unit
new file mode 100644
index 00000000..98b52e50
--- /dev/null
+++ b/languages/pascal/file_templates/pp-unit
@@ -0,0 +1,19 @@
+{
+ Pascal unit: $MODULE$
+
+ Description:
+ Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+ Copyright: See COPYING file that comes with this distribution
+}
+
+unit $MODULE$;
+
+interface
+
+implementation
+
+initialization
+
+finalization
+
+end.
diff --git a/languages/pascal/kdevpascalsupport.desktop b/languages/pascal/kdevpascalsupport.desktop
new file mode 100644
index 00000000..e560b8da
--- /dev/null
+++ b/languages/pascal/kdevpascalsupport.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Pascal Language Support
+Comment[ca]=Suport per al llenguatge Pascal
+Comment[da]=Pascal sprogunderstøttelse
+Comment[de]=Pascal-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη γλώσσας Pascal
+Comment[es]=Soporte para el lenguaje Pascal
+Comment[et]=Pascali keele toetus
+Comment[eu]=Pascal lenguaiaren euskarria
+Comment[fa]=پشتیبانی زبان پاسکال
+Comment[fr]=Prise en charge du langage Pascal
+Comment[ga]=Tacaíocht Pascal
+Comment[gl]=Soporte para linguaxe Pascal
+Comment[hi]=पास्कल भाषा समर्थन
+Comment[hu]=Támogatás a Pascal nyelv használatához
+Comment[is]=Stuðningur við Pascal forritunarmálið
+Comment[it]=Supporto per il linguaggio Pascal
+Comment[ja]=Pascal 言語サポート
+Comment[nds]=Ünnerstütten för de Spraak Pascal
+Comment[ne]=पास्कल भाषा समर्थन
+Comment[nl]=Ondersteuning voor Pascal
+Comment[pl]=Obsługa języka Pascal
+Comment[pt]=Suporte da Linguagem Pascal
+Comment[pt_BR]=Suporte à Linguagem Pascal
+Comment[ru]=Поддержка языка Pascal
+Comment[sk]=Podpora jazyka Pascal
+Comment[sl]=Podpora jeziku pascal
+Comment[sr]=Језичка подршка за Pascal
+Comment[sr@Latn]=Jezička podrška za Pascal
+Comment[sv]=Stöd för språket Pascal
+Comment[ta]=பாஸ்கல் மொழி ஆதரவு
+Comment[tg]=Ёрӣ намудани забони Pascal Language
+Comment[tr]=Pascal Dil Desteği
+Comment[zh_CN]=Pascal 语言支持
+Comment[zh_TW]=Pascal 語言支援
+Name=KDevPascalSupport
+Name[da]=KDevelop Pascal-understøttelse
+Name[de]=Sprachunterstützung für Pascal (KDevelop)
+Name[hi]=के-डेव-पॉस्कल-समर्थन
+Name[nds]=Pascal-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaPascala
+Name[sk]=KDev Pascal podpora
+Name[sv]=KDevelop Pascal-stöd
+Name[ta]=கெடெவ் பாஸ்கல் ஆதரவு
+Name[zh_TW]=KDevelop Pascal 支援
+GenericName=Pascal Language Support
+GenericName[ca]=Suport per al llenguatge Pascal
+GenericName[da]=Pascal sprogunderstøttelse
+GenericName[de]=Sprachunterstützung für Pascal
+GenericName[el]=Υποστήριξη γλώσσας Pascal
+GenericName[es]=Soporte para el lenguaje Pascal
+GenericName[et]=Pascali keele toetus
+GenericName[eu]=Pascal lenguaiaren euskarria
+GenericName[fa]=پشتیبانی زبان پاسکال
+GenericName[fr]=Prise en charge du langage PASCAL
+GenericName[ga]=Tacaíocht Pascal
+GenericName[gl]=Soporte para linguaxe Pascal
+GenericName[hi]=पास्कल भाषा समर्थन
+GenericName[hu]=Pascal-támogatás
+GenericName[it]=Supporto per il linguaggio Pascal
+GenericName[ja]=Pascal 言語サポート
+GenericName[nds]=Ünnerstütten för de Spraak Pascal
+GenericName[ne]=पास्कल भाषा समर्थन
+GenericName[nl]=Ondersteuning voor Pascal
+GenericName[pl]=Obsługa języka Pascal
+GenericName[pt]=Suporte à Linguagem Pascal
+GenericName[pt_BR]=Suporte à Linguagem Pascal
+GenericName[ru]=Поддержка языка Pascal
+GenericName[sk]=Podpora jazyka Pascal
+GenericName[sl]=Podpora jezicu pascal
+GenericName[sr]=Језичка подршка за Pascal
+GenericName[sr@Latn]=Jezička podrška za Pascal
+GenericName[sv]=Stöd för språket Pascal
+GenericName[ta]=பாஸ்கல் மொழி ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони Pascal
+GenericName[tr]=Pascal Dil Desteği
+GenericName[zh_CN]=Pascal 语言支持
+GenericName[zh_TW]=Pascal 語言支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevpascalsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Pascal
diff --git a/languages/pascal/kdevpascalsupport.rc b/languages/pascal/kdevpascalsupport.rc
new file mode 100644
index 00000000..4335b2a6
--- /dev/null
+++ b/languages/pascal/kdevpascalsupport.rc
@@ -0,0 +1,3 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="KDevPascalSupport" version="2">
+</kpartplugin>
diff --git a/languages/pascal/pascal.g b/languages/pascal/pascal.g
new file mode 100644
index 00000000..fde5dcb8
--- /dev/null
+++ b/languages/pascal/pascal.g
@@ -0,0 +1,1212 @@
+//
+//
+// Pascal Grammar
+//
+// Adapted from,
+// Pascal User Manual And Report (Second Edition-1978)
+// Kathleen Jensen - Niklaus Wirth
+//
+// By
+//
+// Hakki Dogusan dogusanh@tr-net.net.tr
+//
+// Then significantly enhanced by Piet Schoutteten
+// with some guidance by Terence Parr. Piet added tree
+// construction, and some tree walkers.
+//
+//
+// Turbo Pascal, Free Pascal and Delphi pascal extensions
+// by Alexander Dymo <cloudtemple@mksat.net>
+//
+//
+// Adapted from,
+// Free Pascal: Reference Guide 1.9 April 2002
+//
+//
+// KDevelop 3.0 support by Alexander Dymo <cloudtemple@mksat.net>
+//
+
+header "pre_include_hpp" {
+ #include "problemreporter.h"
+ #include "PascalAST.hpp"
+
+ #include <qlistview.h>
+ #include <kdebug.h>
+
+ #define SET_POSITION(ast,t)\
+ { \
+ RefPascalAST(ast)->setLine( t->getLine() );\
+ RefPascalAST(ast)->setColumn( t->getColumn() ); \
+ }
+}
+
+options {
+ language="Cpp";
+}
+
+class PascalParser extends Parser;
+options {
+ k = 2; // two token lookahead
+ exportVocab=Pascal; // Call its vocabulary "Pascal"
+ codeGenMakeSwitchThreshold = 2; // Some optimizations
+ codeGenBitsetTestThreshold = 3;
+ defaultErrorHandler = true; // Generate parser error handlers
+ buildAST = true;
+ ASTLabelType = "RefPascalAST";
+}
+
+/* Define imaginary tokens used to organize tree
+ *
+ * One of the principles here is that any time you have a list of
+ * stuff, you usually want to treat it like one thing (a list) a some
+ * point in the grammar. You want trees to have a fixed number of children
+ * as much as possible. For example, the definition of a procedure should
+ * be something like #(PROCEDURE ID #(ARGDECLS ARG1 ARG2...)) not
+ * #(PROCEDURE ID ARG1 ARG2 ... ) since this is harder to parse and
+ * harder to manipulate. Same is true for statement lists (BLOCK) etc...
+ */
+tokens {
+ BLOCK; // list of statements
+ IDLIST; // list of identifiers; e.g., #(PROGRAM #(IDLIST ID ID...))
+ ELIST; // expression list for proc args etc...
+ FUNC_CALL;
+ PROC_CALL;
+ SCALARTYPE; // IDLIST that is really a scalar type like (Mon,Tue,Wed)
+ TYPELIST; // list of types such as for array declarations
+ VARIANT_TAG;// for CASEs in a RECORD
+ VARIANT_TAG_NO_ID;// for CASEs in a RECORD (no id, just a type)
+ VARIANT_CASE;// a case of the variant
+ CONSTLIST; // List of constants
+ FIELDLIST; // list of fields in a record
+ ARGDECLS; // overall group of declarations of args for proc/func.
+ VARDECL; // declaration of a variable
+ ARGDECL; // declaration of a parameter
+ ARGLIST; // list of actual arguments (expressions)
+ TYPEDECL; // declaration of a type
+ FIELD; // the root a RECORD field
+}
+
+// Define some methods and variables to use in the generated parser.
+{
+private:
+ unsigned int m_numberOfErrors;
+ ProblemReporter* m_problemReporter;
+
+public:
+ void resetErrors() { m_numberOfErrors = 0; }
+ unsigned int numberOfErrors() const { return m_numberOfErrors; }
+ void setProblemReporter( ProblemReporter* r ) { m_problemReporter = r; }
+
+ void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_problemReporter->reportError( ex.getMessage().c_str(),
+ ex.getFilename().c_str(),
+ ex.getLine(),
+ ex.getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_problemReporter->reportError( errorMessage.c_str(),
+ getFilename().c_str(),
+ LT(1)->getLine(),
+ LT(1)->getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ void reportMessage( const ANTLR_USE_NAMESPACE(std)string& message ){
+ m_problemReporter->reportMessage( message.c_str(),
+ getFilename().c_str(),
+ LT(1)->getLine(),
+ LT(1)->getColumn() );
+ }
+}
+
+compilationUnit
+ : program
+ | library
+ | unit
+ ;
+
+program
+ : programHeading
+ (usesClause)?
+ block
+ DOT!
+ ;
+
+library
+ : LIBRARY^ identifier SEMI!
+ (usesClause)?
+ libraryBlock
+ exportsClause
+ END! DOT!
+ ;
+
+libraryBlock
+ : declarationPart (statementPart)?
+ ;
+
+exportsClause
+ : EXPORTS^
+ exportsList
+ ;
+
+exportsList
+ : exportsEntry ( COMMA! exportsEntry )* (SEMI!)?
+ ;
+
+exportsEntry
+ : identifier ("index" integerConstant)? ("name" stringConstant)?
+ ;
+
+usesClause
+ : USES^ identifierList SEMI!
+ ;
+
+unit
+ : UNIT^ identifier SEMI!
+ interfacePart
+ implementationPart
+ ( (initializationPart (finalizationPart)?) | realizationPart )?
+ END!
+ ;
+
+interfacePart
+ : INTERFACE^
+ (usesClause)?
+ ( constantDeclarationPart
+ | typeDeclarationPart
+ | procedureHeadersPart
+ )*
+ ;
+
+implementationPart
+ : IMPLEMENTATION^
+ (usesClause)?
+ declarationPart
+ ;
+
+realizationPart
+ : BEGIN^ statement ( SEMI! statement )*
+ ;
+
+programHeading
+ : PROGRAM^ identifier (LPAREN! identifierList RPAREN!)? SEMI!
+ ;
+
+initializationPart
+ : INITIALIZATION^
+ statement ( SEMI! statement )*
+ ;
+
+finalizationPart
+ : FINALIZATION^
+ statement ( SEMI! statement )*
+ ;
+
+block
+ : declarationPart statementPart
+ ;
+
+declarationPart
+ : (labelDeclarationPart
+ | constantDeclarationPart
+ | resourcestringDeclarationPart
+ | typeDeclarationPart
+ | variableDeclarationPart
+ | procedureAndFunctionDeclarationPart
+ )*
+ ;
+
+labelDeclarationPart
+ : LABEL^ label ( COMMA! label )* SEMI!
+ ;
+
+constantDeclarationPart
+ : CONST^ ( constantDeclaration | typedConstantDeclaration )+
+ ;
+
+resourcestringDeclarationPart
+ : RESOURCESTRING^ ( stringConstantDeclaration )*
+ ;
+
+stringConstantDeclaration
+ : identifier EQUAL! string
+ ;
+
+typeDeclarationPart
+ : TYPE^ ( typeDeclaration )+
+ ;
+
+variableDeclarationPart
+ : VAR^ variableDeclaration ( SEMI! variableDeclaration )* SEMI!
+ ;
+
+variableDeclaration
+ : identifierList c:COLON^ {#c->setType(VARDECL);} type
+ ;
+
+procedureAndFunctionDeclarationPart
+ : procedureAndFunctionDeclaration
+ ;
+
+procedureAndFunctionDeclaration
+ : procedureDeclaration
+ | functionDeclaration
+ | constructorDeclaration
+ | destructorDeclaration
+ ;
+
+statementPart
+ : compoundStatement
+ ;
+
+procedureDeclaration
+ : procedureHeader subroutineBlock SEMI!
+ ;
+
+procedureHeadersPart
+ : procedureHeader | functionHeader // ) SEMI! ( callModifiers SEMI! )
+ ;
+
+procedureHeader
+ : PROCEDURE^ ( identifier | qualifiedMethodIdentifier )
+ (formalParameterList)? SEMI! (modifiers SEMI!)*
+ ;
+
+qualifiedMethodIdentifier
+ : identifier COLON! COLON! identifier
+ ;
+
+subroutineBlock
+ : block
+ | externalDirective
+// | asmBlock
+ | FORWARD!
+ ;
+
+functionDeclaration
+ : functionHeader subroutineBlock SEMI!
+ ;
+
+functionHeader
+ : (FUNCTION^ identifier COLON! type SEMI!)=> FUNCTION^ identifier COLON! type SEMI! (modifiers SEMI!)*
+ | (FUNCTION^ identifier COLON! COLON! identifier COLON! type SEMI!)=> FUNCTION^ qualifiedMethodIdentifier COLON! type SEMI! (modifiers SEMI!)*
+ | (FUNCTION^ identifier COLON! COLON! identifier LPAREN!)=> FUNCTION^ qualifiedMethodIdentifier formalParameterList COLON! type SEMI! (modifiers SEMI!)*
+ | FUNCTION^ identifier formalParameterList COLON! type SEMI! (modifiers SEMI!)*
+ ;
+
+functionHeaderEnding
+ : (COLON! type SEMI!)=> COLON! type SEMI! (modifiers SEMI!)*
+ | formalParameterList COLON! type SEMI! (modifiers SEMI!)*
+ ;
+
+formalParameterList
+ : LPAREN! parameterDeclaration ( SEMI! parameterDeclaration )* RPAREN!
+ ;
+
+parameterDeclaration
+ : valueParameter
+ | variableParameter
+ | constantParameter
+ ;
+
+valueParameter
+ : (identifierList COLON! ARRAY! OF!)=> identifierList COLON! ARRAY! OF! type
+ | identifierList COLON! type
+ ;
+
+variableParameter
+ : VAR identifierList ( untypedParameterPart )?
+ ;
+
+untypedParameterPart
+ : (COLON! ARRAY! OF! type)=> COLON! ARRAY! OF! type
+ | COLON! type
+ ;
+
+constantParameter
+ : CONST identifierList ( untypedParameterPart )?
+ ;
+
+externalDirective
+ : EXTERNAL^ ( stringConstant ( ("name" stringConstant) | ("index" integerConstant) )? )?
+ ;
+
+/*asmBlock
+ : ASSEMBLER^ SEMI! declarationPart asmStatement
+ ;
+*/
+modifiers
+ : PUBLIC! | (ALIAS! stringConstant) | INTERRUPT! | callModifiers | EXPORT!
+ ;
+
+callModifiers
+ : REGISTER! | PASCAL! | CDECL! | STDCALL! | POPSTACK! | SAVEREGISTERS! | INLINE! | SAFECALL! | NEAR! | FAR!
+ ;
+
+constantDeclaration
+// : ( identifier EQUAL! expression SEMI! ) ( identifier EQUAL! expression SEMI! )*
+ : identifier EQUAL! expression SEMI!
+ ;
+
+typedConstantDeclaration
+// : ( identifier COLON! type EQUAL! typedConstant SEMI! )+
+ : identifier COLON! type EQUAL! typedConstant SEMI!
+ ;
+
+//FIXME: is there a better way to handle this instead of simply forcing the rules
+typedConstant
+ : (constant)=> constant
+// | addressConstant
+ | (LPAREN! identifier COLON!)=> recordConstant
+ | (arrayConstant)=> arrayConstant
+ | proceduralConstant
+ ;
+
+arrayConstant
+ : LPAREN! ( constant | arrayConstant ) ( COMMA! ( constant | arrayConstant ) )* RPAREN!
+ ;
+
+recordConstant
+ : LPAREN! ( identifier COLON! constant ) ( SEMI! ( identifier COLON! constant ) )* RPAREN!
+ ;
+
+addressConstant
+ : NUM_INT
+ ;
+
+proceduralConstant
+ : expression
+ ;
+
+typeDeclaration
+ : identifier EQUAL! type SEMI!
+ ;
+
+type
+// : simpleType | subrangeType | enumeratedType | stringType | structuredType | pointerType | proceduralType | typeIdentifier
+ : simpleType | subrangeTypeOrTypeIdentifier | enumeratedType | stringType | structuredType | pointerType | proceduralType
+ ;
+
+simpleType
+ : ordinalType | realType
+ ;
+
+ordinalType
+ : INTEGER! | SHORTINT! | SMALLINT! | LONGINT! | INT64! | BYTE! | WORD! | CARDINAL! | QWORD!
+ | BOOLEAN! | BYTEBOOL! | LONGBOOL! | CHAR!
+ ;
+
+subrangeTypeOrTypeIdentifier
+ : constant (DOTDOT! constant)?
+ ;
+
+typeIdentifier
+ : identifier
+ ;
+
+subrangeType
+ : constant DOTDOT! constant
+ ;
+
+enumeratedType
+ : (LPAREN! identifier ASSIGN!)=> LPAREN! assignedEnumList RPAREN!
+ | LPAREN! identifierList RPAREN!
+ ;
+
+assignedEnumList
+ : (identifier ASSIGN! expression) ( COMMA! (identifier ASSIGN! expression) )*
+ ;
+
+realType
+ : REAL! | SINGLE! | DOUBLE! | EXTENDED! | COMP!
+ ;
+
+stringType
+ : STRING^ ( LBRACK! unsignedInteger RBRACK! )?
+ ;
+
+structuredType
+ : (PACKED!)? ( arrayType | recordType | objectType | classType | setType | fileType )
+ ;
+
+arrayType
+ : ARRAY^ LBRACK! arrayIndexType ( COMMA! arrayIndexType )* RBRACK! OF! type
+ ;
+
+arrayIndexType
+ : ordinalType
+ | (expression DOTDOT!)=> arraySubrangeType
+ | enumeratedType
+ ;
+
+arraySubrangeType
+ : expression DOTDOT! expression
+ ;
+
+recordType
+ : RECORD^ (fieldList)* END!
+ ;
+
+fieldList
+ : fixedField | variantPart
+ ;
+
+fixedField
+ : identifierList COLON! type SEMI!
+ ;
+
+variantPart
+ : CASE^ (identifier COLON!)? identifier OF! variant ( SEMI! variant )*
+ ;
+
+variant
+ : (constant COMMA!)+ COLON! LPAREN! (fieldList)* RPAREN!
+ ;
+
+setType
+ : SET^ OF! ordinalType
+ ;
+
+fileType
+ : FILE^ OF! type
+ ;
+
+pointerType
+ : POINTER^ typeIdentifier
+ ;
+
+proceduralType
+ : (proceduralTypePart1 SEMI!)=> proceduralTypePart1 SEMI! callModifiers
+ | proceduralTypePart1
+ ;
+
+proceduralTypePart1
+ : ( functionHeader | procedureHeader ) (OF! OBJECT!)?
+ ;
+
+objectType
+ : OBJECT^ (heritage)? (componentList | objectVisibilitySpecifier ) END!
+ ;
+
+heritage
+ : LPAREN! identifier RPAREN!
+ ;
+
+componentList
+ : ( (fieldDefinition)+ )? ( (methodDefinition)+ )?
+ ;
+
+fieldDefinition
+ : identifierList COLON! type SEMI!
+ ;
+
+methodDefinition
+ : ( functionHeader | procedureHeader | constructorHeader | destructorHeader ) SEMI! methodDirectives
+ ;
+
+methodDirectives
+ : ( VIRTUAL! SEMI! (ABSTRACT! SEMI!)? )? (callModifiers SEMI!)?
+ ;
+
+objectVisibilitySpecifier
+ : PRIVATE! | PROTECTED! | PUBLIC!
+ ;
+
+constructorDeclaration
+ : constructorHeader SEMI! subroutineBlock
+ ;
+
+destructorDeclaration
+ : destructorHeader SEMI! subroutineBlock
+ ;
+
+constructorHeader
+ : CONSTRUCTOR^ ( identifier | qualifiedMethodIdentifier ) formalParameterList
+ ;
+
+destructorHeader
+ : DESTRUCTOR^ ( identifier | qualifiedMethodIdentifier ) formalParameterList
+ ;
+
+classType
+ : CLASS^ (heritage)? (classComponentList | classVisibilitySpecifier ) END!
+ ;
+
+classComponentList
+ : ( (fieldDefinition)+ )? ( ( (classMethodDefinition | propertyDefinition) )+ )?
+ ;
+
+classMethodDefinition
+ : ( ( (CLASS!)? (functionHeader | procedureHeader) ) | constructorHeader | destructorHeader ) SEMI! classMethodDirectives
+ ;
+
+classMethodDirectives
+ : ( directiveVariants SEMI! )? (callModifiers SEMI!)?
+ ;
+
+directiveVariants
+ : ( VIRTUAL! (ABSTRACT! SEMI!)? )
+ | OVERRIDE!
+ | (MESSAGE! (integerConstant | stringConstant))
+ ;
+
+classVisibilitySpecifier
+ : PRIVATE! | PROTECTED! | PUBLIC! | PUBLISHED!
+ ;
+
+propertyDefinition
+ : PROPERTY^ identifier (propertyInterface)? propertySpecifiers
+ ;
+
+propertyInterface
+ : (propertyParameterList)? COLON! typeIdentifier ("index" integerConstant)?
+ ;
+
+propertyParameterList
+ : LBRACK! parameterDeclaration (SEMI! parameterDeclaration)* RBRACK!
+ ;
+
+propertySpecifiers
+ : (readSpecifier)? (writeSpecifier)? (defaultSpecifier)?
+ ;
+
+readSpecifier
+ : "read" fieldOrMethod
+ ;
+
+writeSpecifier
+ : "write" fieldOrMethod
+ ;
+
+defaultSpecifier
+ : ( DEFAULT (constant)? )
+ | "nodefault"
+ ;
+
+fieldOrMethod
+ : identifier
+ ;
+
+expression
+ : simpleExpression ( expressionSign simpleExpression )?
+ ;
+
+expressionSign
+// : STAR! | LE! | GE! | LTH! | GT! | NOT_EQUAL! | IN! | IS!
+ : LE! | GE! | LTH! | GT! | NOT_EQUAL! | IN! | IS! | EQUAL!
+ ;
+
+simpleExpression
+ : term ( ( PLUS! | MINUS! | OR! | XOR! ) term )*
+ ;
+
+term
+ : factor ( (STAR! | SLASH! | DIV! | MOD! | AND! | SHL! | SHR!) factor )*
+ ;
+
+//TODO: distinguish between identifiers, typecasts and function calls -> semantic predicate
+factor
+ : ( LPAREN! expression RPAREN! )
+// | (qualifiedMethodIdentifier2 LBRACK!)=> qualifiedMethodIdentifier2 LBRACK! arrayIndexType ( COMMA! arrayIndexType )* RBRACK!
+ | identifierOrValueTypecastOrFunctionCall
+// | identifier
+// | functionCall
+ | unsignedConstant
+ | ( NOT! factor )
+ | ( (PLUS! | MINUS!) factor )
+ | setConstructor
+// | valueTypecast
+ | addressFactor
+ | TRUE
+ | FALSE
+ | identifier LBRACK! expression ( COMMA! expression )* RBRACK!
+ ;
+
+//FIXME: is this correct?
+identifierOrValueTypecastOrFunctionCall
+ : (identifier LPAREN! expression COMMA!)=> identifier LPAREN! expressions RPAREN!
+ | (identifier LPAREN! expression RPAREN!)=> identifier LPAREN! expression RPAREN!
+// | (qualifiedMethodIdentifier2 LPAREN! expression COMMA!)=> qualifiedMethodIdentifier2 LPAREN! expressions RPAREN!
+// | (identifier DOT)=> qualifiedMethodIdentifier2
+ | identifier
+ ;
+
+/*qualifiedMethodIdentifier2
+ : identifier DOT identifier
+ ;
+*/
+//( functionIdentifier | methodDesignator | qualifiedMethodDesignator | variableReference )
+functionCall
+ : identifier (actualParameterList)?
+ ;
+
+actualParameterList
+ : LPAREN! ( expressions )? RPAREN!
+ ;
+
+expressions
+ : expression ( COMMA! expression )*
+ ;
+
+setConstructor
+ : LBRACK! ( setGroup ( COMMA! setGroup )* )? RBRACK!
+ ;
+
+setGroup
+ : expression ( DOT! DOT! expression )?
+ ;
+
+valueTypecast
+ : typeIdentifier LPAREN! expression RPAREN!
+ ;
+
+//( variableReference | procedureIdentifier | functionIdentifier | qualifiedMethodIdentifier )
+addressFactor
+ : AT! identifier
+ ;
+
+statement
+// : (label COLON!)? (simpleStatement | structuredStatement | asmStatement)
+ : (label COLON!)? (simpleStatement | structuredStatement)
+ ;
+
+simpleStatement
+ : assignmentStatement | procedureStatement | gotoStatement | raiseStatement
+ ;
+
+assignmentStatement
+ : identifierOrArrayIdentifier assignmentOperator expression
+ ;
+
+identifierOrArrayIdentifier
+ : identifier
+// | (qualifiedMethodIdentifier LBRACK!)=> qualifiedMethodIdentifier LBRACK! arrayIndexType ( COMMA! arrayIndexType )* RBRACK!
+// | qualifiedMethodIdentifier
+ | identifier LBRACK! expression ( COMMA! expression )* RBRACK!
+ ;
+
+assignmentOperator
+ : ASSIGN! | PLUSEQ | MINUSEQ | STAREQ | SLASHQE
+ ;
+
+procedureStatement
+ : identifier (actualParameterList)?
+ ;
+
+gotoStatement
+ : GOTO! label
+ ;
+
+structuredStatement
+ : compoundStatement | repetitiveStatement | conditionalStatement | exceptionStatement | withStatement
+ ;
+
+conditionalStatement
+ : ifStatement | caseStatement
+ ;
+
+repetitiveStatement
+ : forStatement | repeatStatement | whileStatement
+ ;
+
+compoundStatement
+ : BEGIN! END!
+ | BEGIN! (SEMI!)+ END!
+ | BEGIN! statement (SEMI! (statement)?)* END!
+ ;
+
+ifStatement
+ : IF^ expression THEN! statement
+ (
+ // CONFLICT: the old "dangling-else" problem...
+ // ANTLR generates proper code matching
+ // as soon as possible. Hush warning.
+ options {
+ generateAmbigWarnings=false;
+ }
+ : ELSE! statement
+ )?
+ ;
+
+caseStatement
+ : CASE^ expression OF!
+ caseListElement ( SEMI! caseListElement )*
+ ( SEMI! ELSE! statement ( SEMI! statement )* )?
+ END!
+ ;
+
+caseListElement
+ : constList COLON^ statement
+ ;
+
+constList
+ : constant ( COMMA! constant )*
+ {#constList = #([CONSTLIST],#constList);}
+ ;
+
+whileStatement
+ : WHILE^ expression DO! statement
+ ;
+
+repeatStatement
+ : REPEAT^ statement ( SEMI! (statement)? )* UNTIL! expression
+ ;
+
+forStatement
+ : FOR^ identifier ASSIGN! forList DO! statement
+ ;
+
+forList
+ : initialValue (TO^ | DOWNTO^) finalValue
+ ;
+
+initialValue
+ : expression
+ ;
+
+finalValue
+ : expression
+ ;
+
+withStatement
+ : WITH^ recordVariableList DO! statement
+ ;
+
+recordVariableList
+ : variable ( COMMA! variable )*
+ ;
+
+/** A variable is an id with a suffix and can look like:
+ * id
+ * id[expr,...]
+ * id.id
+ * id.id[expr,...]
+ * id^
+ * id^.id
+ * id^.id[expr,...]
+ * ...
+ *
+ * LL has a really hard time with this construct as it's naturally
+ * left-recursive. We have to turn into a simple loop rather than
+ * recursive loop, hence, the suffixes. I keep in the same rule
+ * for easy tree construction.
+ */
+variable
+ : ( AT^ identifier // AT is root of identifier; then other op becomes root
+ | identifier
+ )
+ ( LBRACK^ expression ( COMMA! expression)* RBRACK!
+ | LBRACK2^ expression ( COMMA! expression)* RBRACK2!
+ | DOT^ identifier
+ | POINTER^
+ )*
+ ;
+
+/*asmStatement
+ : ASM^ assemblerCode END! (registerList)?
+ ;
+
+registerList
+ : LBRACK! stringConstant ( COMMA! stringConstant )*
+ ;
+
+assemblerCode
+ : (.)*
+ ;
+*/
+operatorDefinition
+ : OPERATOR^ ( assignmentOperatorDefinition | arithmeticOperatorDefinition | comparisonOperatorDefinition )
+ identifier COLON! type SEMI! subroutineBlock
+ ;
+
+assignmentOperatorDefinition
+ : ASSIGN! LPAREN! valueParameter RPAREN!
+ ;
+
+arithmeticOperatorDefinition
+ : ( PLUS! | MINUS! | STAR! | SLASH! | (STAR! STAR!) ) LPAREN! formalParameterList RPAREN!
+ ;
+
+comparisonOperatorDefinition
+ : ( EQUAL! | LE! | GE! | GT! | LTH! ) LPAREN! formalParameterList RPAREN!
+ ;
+
+raiseStatement
+ : RAISE^ ( functionCall (AT! addressConstant)? )?
+ ;
+
+exceptionStatement
+ : tryStatement
+ ;
+
+tryStatement
+ : TRY^ (statements)? exceptOrFinallyPart END!
+ ;
+
+exceptOrFinallyPart
+ : EXCEPT! (exceptionHandlers)?
+ | FINALLY! (statements)?
+ ;
+
+statements
+ : statement ( SEMI! statement )*
+ ;
+
+exceptionHandlers
+ : statements | exceptionHandler ( SEMI! exceptionHandler )* ( ELSE! statements )?
+ ;
+
+exceptionHandler
+ : ON! (identifier COLON!)? identifier DO! statement
+ ;
+
+identifierList
+ : identifier ( COMMA! identifier )*
+ {#identifierList = #(#[IDLIST],#identifierList);}
+ ;
+
+label
+ : unsignedInteger
+ ;
+
+unsignedInteger
+ : NUM_INT
+ ;
+
+integerConstant
+ : unsignedInteger
+ |! s:sign n:unsignedInteger { #integerConstant=#(s,n); }
+ ;
+
+stringConstant
+ : string | constantChr
+ ;
+
+sign
+ : PLUS | MINUS
+ ;
+
+string
+ : STRING_LITERAL
+ ;
+
+constantChr
+ : CHR^ LPAREN! unsignedInteger RPAREN!
+ ;
+
+constant
+ : unsignedNumber
+ |! s:sign n:unsignedNumber { #constant=#(s,n); }
+ | identifier
+ |! s2:sign id:identifier { #constant=#(s2,id); }
+ | string
+ | constantChr
+ ;
+
+unsignedConstant
+ : unsignedNumber | constantChr | string | NIL!
+ ;
+
+unsignedNumber
+ : unsignedInteger
+ | unsignedReal
+ ;
+
+unsignedReal
+ : NUM_REAL
+ ;
+
+identifier
+ : IDENT
+ ;
+
+
+//----------------------------------------------------------------------------
+// The Pascal scanner
+//----------------------------------------------------------------------------
+class PascalLexer extends Lexer;
+
+options {
+ charVocabulary = '\0'..'\377';
+ exportVocab = Pascal; // call the vocabulary "Pascal"
+ testLiterals = false; // don't automatically test for literals
+ k = 4; // four characters of lookahead
+ caseSensitive = false;
+ caseSensitiveLiterals = false;
+ defaultErrorHandler=false;
+}
+
+tokens {
+ ABSOLUTE = "absolute" ;
+ ABSTRACT = "abstract" ;
+ ALIAS = "alias" ;
+ AND = "and" ;
+ ARRAY = "array" ;
+ AS = "as" ;
+ ASM = "asm" ;
+ ASSEMBLER = "assembler" ;
+ BEGIN = "begin" ;
+ BREAK = "break" ;
+ BOOLEAN = "boolean" ;
+ BYTE = "byte" ;
+ CARDINAL = "cardinal" ;
+ CASE = "case" ;
+ CDECL = "cdecl" ;
+ CHAR = "char" ;
+ CHR = "chr" ;
+ CLASS = "class" ;
+ COMP = "comp" ;
+ CONST = "const" ;
+ CONSTRUCTOR = "constructor" ;
+ CONTINUE = "continue" ;
+ DEFAULT = "default" ;
+ DESTRUCTOR = "destructor" ;
+ DISPOSE = "dispose" ;
+ DIV = "div" ;
+ DO = "do" ;
+ DOUBLE = "double" ;
+ DOWNTO = "downto" ;
+ ELSE = "else" ;
+ END = "end" ;
+ EXCEPT = "except" ;
+ EXPORT = "export" ;
+ EXPORTS = "exports" ;
+ EXTENDED = "extended" ;
+ EXTERNAL = "external" ;
+ EXIT = "exit" ;
+ FALSE = "false" ;
+ FILE = "file" ;
+ FINALLY = "finally" ;
+ FAR = "far" ;
+ FOR = "for" ;
+ FORWARD = "forward" ;
+ FUNCTION = "function" ;
+ GOTO = "goto" ;
+ IF = "if" ;
+ IN = "in" ;
+// INDEX = "index" ;
+ IS = "is" ;
+ INHERITED = "inherited" ;
+ INLINE = "inline" ;
+ INT64 = "int64" ;
+ INTEGER = "integer" ;
+ LABEL = "label" ;
+ LIBRARY = "library" ;
+ LONGINT = "longint" ;
+ MOD = "mod" ;
+// NAME = "name" ;
+ NEAR = "near" ;
+ NEW = "new" ;
+ NIL = "nil" ;
+ NOT = "not" ;
+ OBJECT = "object" ;
+ OF = "of" ;
+ ON = "on" ;
+ OPERATOR = "operator" ;
+ OR = "or" ;
+ OVERRIDE = "override" ;
+ PACKED = "packed" ;
+ PASCAL = "pascal" ;
+ POPSTACK = "popstack" ;
+ PRIVATE = "private" ;
+ PROCEDURE = "procedure" ;
+ PROTECTED = "protected" ;
+ PROGRAM = "program" ;
+ PROPERTY = "property" ;
+ PUBLIC = "public" ;
+ PUBLISHED = "published" ;
+ QWORD = "qword" ;
+ RAISE = "raise" ;
+ REAL = "real" ;
+ RECORD = "record" ;
+ REGISTER = "register" ;
+ REPEAT = "repeat" ;
+ SAFECALL = "safecall" ;
+ SAVEREGISTERS = "saveregisters" ;
+ SELF = "self" ;
+ SET = "set" ;
+ SHORTINT = "shortint" ;
+ SHR = "shr" ;
+ SHL = "shl" ;
+ SINGLE = "single" ;
+ SMALLINT = "smallint" ;
+ STDCALL = "stdcall" ;
+ THEN = "then" ;
+ TO = "to" ;
+ TRUE = "true" ;
+ TRY = "try" ;
+ TYPE = "type" ;
+ UNTIL = "until" ;
+ VAR = "var" ;
+ VIRTUAL = "virtual" ;
+ WHILE = "while" ;
+ WITH = "with" ;
+ WORD = "word" ;
+ XOR = "xor" ;
+ METHOD ;
+ ADDSUBOR ;
+ ASSIGNEQUAL ;
+ SIGN ;
+ FUNC ;
+ NODE_NOT_EMIT ;
+ MYASTVAR ;
+ LF ;
+ UNIT = "unit" ;
+ INTERFACE = "interface" ;
+ USES = "uses" ;
+ STRING = "string" ;
+ IMPLEMENTATION = "implementation" ;
+ FINALIZATION = "finalization" ;
+ INITIALIZATION = "initialization" ;
+ RESOURCESTRING = "resourcestring" ;
+//pspsps ???
+}
+
+{
+private:
+ ProblemReporter* m_problemReporter;
+ unsigned int m_numberOfErrors;
+
+public:
+ void resetErrors() { m_numberOfErrors = 0; }
+ unsigned int numberOfErrors() const { return m_numberOfErrors; }
+ void setProblemReporter( ProblemReporter* r ) { m_problemReporter = r; }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex ){
+ m_problemReporter->reportError( ex.getMessage().c_str(),
+ ex.getFilename().c_str(),
+ ex.getLine(),
+ ex.getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ virtual void reportError( const ANTLR_USE_NAMESPACE(std)string& errorMessage ){
+ m_problemReporter->reportError( errorMessage.c_str(),
+ getFilename().c_str(),
+ getLine(), getColumn() );
+ ++m_numberOfErrors;
+ }
+
+ virtual void reportWarning( const ANTLR_USE_NAMESPACE(std)string& warnMessage ){
+ m_problemReporter->reportWarning( warnMessage.c_str(),
+ getFilename().c_str(),
+ getLine(), getColumn() );
+ }
+}
+
+//----------------------------------------------------------------------------
+// OPERATORS
+//----------------------------------------------------------------------------
+PLUS : '+' ;
+MINUS : '-' ;
+STAR : '*' ;
+SLASH : '/' ;
+ASSIGN : ":=" ;
+COMMA : ',' ;
+SEMI : ';' ;
+COLON : ':' ;
+EQUAL : '=' ;
+NOT_EQUAL : "<>" ;
+LTH : '<' ;
+LE : "<=" ;
+GE : ">=" ;
+GT : '>' ;
+LPAREN : '(' ;
+RPAREN : ')' ;
+LBRACK : '[' ; // line_tab[line]
+LBRACK2 : "(." ; // line_tab(.line.)
+RBRACK : ']' ;
+RBRACK2 : ".)" ;
+POINTER : '^' ;
+AT : '@' ;
+DOT : '.' ('.' {$setType(DOTDOT);})? ;
+LCURLY : "{" ;
+RCURLY : "}" ;
+PLUSEQ : "+=" ;
+MINUSEQ : "-=" ;
+STAREQ : "*=" ;
+SLASHQE : "/=" ;
+
+
+// Whitespace -- ignored
+WS : ( ' '
+ | '\t'
+ | '\f'
+ // handle newlines
+ | ( "\r\n" // Evil DOS
+ | '\r' // Macintosh
+ | '\n' // Unix (the right way)
+ )
+ { newline(); }
+ )
+ { _ttype = ANTLR_USE_NAMESPACE(antlr)Token::SKIP; }
+ ;
+
+
+COMMENT_1
+ : "(*"
+ ( options { generateAmbigWarnings=false; }
+ : { LA(2) != ')' }? '*'
+ | '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | ~('*' | '\n' | '\r')
+ )*
+ "*)"
+ {$setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP);}
+ ;
+
+COMMENT_2
+ : '{'
+ ( options {generateAmbigWarnings=false;}
+ : '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | ~('}' | '\n' | '\r')
+ )*
+ '}'
+ {$setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP);}
+ ;
+
+COMMENT_3
+ : "//" (~'\n')* '\n'
+ {$setType(ANTLR_USE_NAMESPACE(antlr)Token::SKIP);}
+ ;
+
+// an identifier. Note that testLiterals is set to true! This means
+// that after we match the rule, we look in the literals table to see
+// if it's a literal or really an identifer
+IDENT
+ options {testLiterals=true;}
+ : ('a'..'z') ('a'..'z'|'0'..'9'|'_')* //pspsps
+ ;
+
+// string literals
+STRING_LITERAL
+ : '\'' ("\'\'" | ~('\''))* '\'' //pspsps * in stead of + because of e.g. ''
+ ;
+
+/** a numeric literal. Form is (from Wirth)
+ * digits
+ * digits . digits
+ * digits . digits exponent
+ * digits exponent
+ */
+NUM_INT
+ : ('0'..'9')+ // everything starts with a digit sequence
+ ( ( {(LA(2)!='.')&&(LA(2)!=')')}? // force k=2; avoid ".."
+//PSPSPS example ARRAY (.1..99.) OF char; // after .. thinks it's a NUM_REAL
+ '.' {$setType(NUM_REAL);} // dot means we are float
+ ('0'..'9')+ (EXPONENT)?
+ )?
+ | EXPONENT {$setType(NUM_REAL);} // 'E' means we are float
+ )
+ ;
+
+// a couple protected methods to assist in matching floating point numbers
+protected
+EXPONENT
+ : ('e') ('+'|'-')? ('0'..'9')+
+ ;
diff --git a/languages/pascal/pascal.tree.g b/languages/pascal/pascal.tree.g
new file mode 100644
index 00000000..c597afb8
--- /dev/null
+++ b/languages/pascal/pascal.tree.g
@@ -0,0 +1,468 @@
+//
+// Pascal Tree Super Grammar (symtab.g derives from this)
+//
+// Adapted from,
+// Pascal User Manual And Report (Second Edition-1978)
+// Kathleen Jensen - Niklaus Wirth
+//
+// By
+//
+// Hakki Dogusan dogusanh@tr-net.net.tr
+//
+// Then significantly enhanced by Piet Schoutteten
+// with some guidance by Terence Parr. Piet added tree
+// construction, and some tree walkers.
+//
+//
+// Adopted to KDevelop by Alexander Dymo <cloudtemple@mksat.net>
+//
+
+header "pre_include_hpp" {
+ #include <codemodel.h>
+ #include "PascalAST.hpp"
+
+ #include <qstring.h>
+ #include <qstringlist.h>
+ #include <qfileinfo.h>
+}
+
+header "post_include_hpp" {
+ #include <codemodel.h>
+ #include <kdebug.h>
+}
+
+options {
+ language="Cpp";
+}
+
+
+class PascalStoreWalker extends TreeParser;
+
+options {
+ importVocab = Pascal;
+ defaultErrorHandler = true;
+ ASTLabelType = "RefPascalAST";
+}
+
+{
+private:
+ QString m_fileName;
+ QStringList m_currentScope;
+ int m_currentAccess;
+ int m_anon;
+ CodeModel* m_model;
+
+public:
+ void setCodeModel( CodeModel* model ) { m_model = model; }
+ CodeModel* codeModel() { return m_model; }
+ const CodeModel* codeModel() const { return m_model; }
+
+ QString fileName() const { return m_fileName; }
+ void setFileName( const QString& fileName ) { m_fileName = fileName; }
+
+ void init(){
+ m_currentScope.clear();
+ m_currentAccess = CodeModelItem::Public;
+ m_anon = 0;
+ }
+
+ void wipeout() { m_model->wipeout(); }
+}
+
+program
+ : programHeading
+ block
+ ;
+
+programHeading
+ : #(PROGRAM IDENT identifierList)
+ | #(UNIT IDENT)
+ ;
+
+identifier
+ : IDENT
+ ;
+
+block
+ : ( labelDeclarationPart
+ | constantDefinitionPart
+ | typeDefinitionPart
+ | variableDeclarationPart
+ | procedureAndFunctionDeclarationPart
+ | usesUnitsPart
+ | IMPLEMENTATION
+ )*
+ compoundStatement
+ ;
+
+usesUnitsPart
+ : #(USES identifierList)
+ ;
+
+labelDeclarationPart
+ : #(LABEL ( label )+)
+ ;
+
+label
+ : NUM_INT
+ ;
+
+constantDefinitionPart
+ : #(CONST ( constantDefinition )+ )
+ ;
+
+constantDefinition
+ : #(EQUAL IDENT constant)
+ ;
+
+constant
+ : NUM_INT
+ | NUM_REAL
+ | #( PLUS
+ ( NUM_INT
+ | NUM_REAL
+ | IDENT
+ )
+ )
+ | #( MINUS
+ ( NUM_INT
+ | NUM_REAL
+ | IDENT
+ )
+ )
+ | IDENT
+ | STRING_LITERAL
+ | #(CHR (NUM_INT|NUM_REAL))
+ ;
+
+string
+ : STRING_LITERAL
+ ;
+
+typeDefinitionPart
+ : #(TYPE ( typeDefinition )+)
+ ;
+
+typeDefinition
+ : #(TYPEDECL IDENT
+ ( type
+ | #(FUNCTION (formalParameterList)? resultType)
+ | #(PROCEDURE (formalParameterList)?)
+ )
+ )
+ ;
+
+type
+ : #(SCALARTYPE identifierList)
+ | #(DOTDOT constant constant)
+ | typeIdentifier
+ | structuredType
+ | #(POINTER typeIdentifier)
+ ;
+
+typeIdentifier
+ : IDENT
+ | CHAR
+ | BOOLEAN
+ | INTEGER
+ | REAL
+ | #( STRING
+ ( IDENT
+ | NUM_INT
+ | NUM_REAL
+ |
+ )
+ )
+ ;
+
+structuredType
+ : #(PACKED unpackedStructuredType)
+ | unpackedStructuredType
+ ;
+
+unpackedStructuredType
+ : arrayType
+ | recordType
+ | setType
+ | fileType
+ ;
+
+/** Note here that the syntactic diff between brackets disappears.
+ * If the brackets mean different things semantically, we need
+ * two different alternatives here.
+ */
+arrayType
+ : #(ARRAY typeList type)
+ ;
+
+typeList
+ : #( TYPELIST ( type )+ )
+ ;
+
+recordType
+ : #(RECORD fieldList)
+ ;
+
+fieldList
+ : #( FIELDLIST
+ ( fixedPart ( variantPart )?
+ | variantPart
+ )
+ )
+ ;
+
+fixedPart
+ : ( recordSection )+
+ ;
+
+recordSection
+ : #(FIELD identifierList type)
+ ;
+
+variantPart
+ : #( CASE tag ( variant )+ )
+ ;
+
+tag
+ : #(VARIANT_TAG identifier typeIdentifier)
+ | #(VARIANT_TAG_NO_ID typeIdentifier)
+ ;
+
+variant
+ : #(VARIANT_CASE constList fieldList)
+ ;
+
+setType
+ : #(SET type)
+ ;
+
+fileType
+ : #(FILE (type)?)
+ ;
+
+/** Yields a list of VARDECL-rooted subtrees with VAR at the overall root */
+variableDeclarationPart
+ : #( VAR ( variableDeclaration )+ )
+ ;
+
+variableDeclaration
+ : #(VARDECL identifierList type)
+ ;
+
+procedureAndFunctionDeclarationPart
+ : procedureOrFunctionDeclaration
+ ;
+
+procedureOrFunctionDeclaration
+ : procedureDeclaration
+ | functionDeclaration
+ ;
+
+procedureDeclaration
+ : #(PROCEDURE IDENT (formalParameterList)? block )
+ ;
+
+formalParameterList
+ : #(ARGDECLS ( formalParameterSection )+)
+ ;
+
+formalParameterSection
+ : parameterGroup
+ | #(VAR parameterGroup)
+ | #(FUNCTION parameterGroup)
+ | #(PROCEDURE parameterGroup)
+ ;
+
+parameterGroup
+ : #(ARGDECL identifierList typeIdentifier)
+ ;
+
+identifierList
+ : #(IDLIST (IDENT)+)
+ ;
+
+constList
+ : #(CONSTLIST ( constant )+)
+ ;
+
+functionDeclaration
+ : #(FUNCTION IDENT (formalParameterList)? resultType block)
+ ;
+
+resultType
+ : typeIdentifier
+ ;
+
+statement
+ : #(COLON label unlabelledStatement)
+ | unlabelledStatement
+ ;
+
+unlabelledStatement
+ : simpleStatement
+ | structuredStatement
+ ;
+
+simpleStatement
+ : assignmentStatement
+ | procedureStatement
+ | gotoStatement
+ ;
+
+assignmentStatement
+ : #(ASSIGN variable expression)
+ ;
+
+/** A variable is an id with a suffix and can look like:
+ * id
+ * id[expr,...]
+ * id.id
+ * id.id[expr,...]
+ * id^
+ * id^.id
+ * id^.id[expr,...]
+ * ...
+ *
+ * LL has a really hard time with this construct as it's naturally
+ * left-recursive. We have to turn into a simple loop rather than
+ * recursive loop, hence, the suffixes. I keep in the same rule
+ * for easy tree construction.
+ */
+variable
+ : #(LBRACK variable (expression)+)
+ | #(LBRACK2 variable (expression)+)
+ | #(DOT variable IDENT)
+ | #(POINTER variable)
+ | #(AT IDENT)
+ | IDENT
+ ;
+
+expression
+ : #(EQUAL expression expression)
+ | #(NOT_EQUAL expression expression)
+ | #(LTH expression expression)
+ | #(LE expression expression)
+ | #(GE expression expression)
+ | #(GT expression expression)
+ | #(IN expression expression)
+ | #(PLUS expression (expression)?)
+ | #(MINUS expression (expression)?)
+ | #(OR expression expression)
+ | #(STAR expression expression)
+ | #(SLASH expression expression)
+ | #(DIV expression expression)
+ | #(MOD expression expression)
+ | #(AND expression expression)
+ | #(NOT expression)
+ | variable
+ | functionDesignator
+ | set
+ | NUM_INT
+ | NUM_REAL
+ | #(CHR (NUM_INT|NUM_REAL))
+ | string
+ | NIL
+ ;
+
+functionDesignator
+ : #(FUNC_CALL IDENT (parameterList)?)
+ ;
+
+parameterList
+ : #( ARGLIST (actualParameter)+ )
+ ;
+
+set
+ : #(SET (element)*)
+ ;
+
+element
+ : #(DOTDOT expression expression)
+ | expression
+ ;
+
+procedureStatement
+ : #(PROC_CALL IDENT ( parameterList )?)
+ ;
+
+actualParameter
+ : expression
+ ;
+
+gotoStatement
+ : #(GOTO label)
+ ;
+
+structuredStatement
+ : compoundStatement
+ | conditionalStatement
+ | repetetiveStatement
+ | withStatement
+ ;
+
+compoundStatement
+ : statements
+ ;
+
+statements
+ : #(BLOCK (statement)*)
+ ;
+
+conditionalStatement
+ : ifStatement
+ | caseStatement
+ ;
+
+ifStatement
+ : #(IF expression statement (statement)?)
+ ;
+
+caseStatement //pspsps ???
+ : #(CASE expression
+ ( caseListElement )+
+ ( statements )?
+ )
+ ;
+
+caseListElement
+ : #(COLON constList statement)
+ ;
+
+repetetiveStatement
+ : whileStatement
+ | repeatStatement
+ | forStatement
+ ;
+
+whileStatement
+ : #(WHILE expression statement)
+ ;
+
+repeatStatement
+ : #(REPEAT statements expression)
+ ;
+
+forStatement
+ : #(FOR IDENT forList statement)
+ ;
+
+forList
+ : #(TO initialValue finalValue)
+ | #(DOWNTO initialValue finalValue)
+ ;
+
+initialValue
+ : expression
+ ;
+
+finalValue
+ : expression
+ ;
+
+withStatement
+ : #(WITH recordVariableList statement)
+ ;
+
+recordVariableList
+ : ( variable )+
+ ;
diff --git a/languages/pascal/pascalsupport_part.cpp b/languages/pascal/pascalsupport_part.cpp
new file mode 100644
index 00000000..0c5f96f2
--- /dev/null
+++ b/languages/pascal/pascalsupport_part.cpp
@@ -0,0 +1,323 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 <fstream>
+
+#include <qdir.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kstatusbar.h>
+
+#include <antlr/ASTFactory.hpp>
+
+#include "catalog.h"
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <kdevplugininfo.h>
+
+#include "pascalsupport_part.h"
+#include "problemreporter.h"
+#include "PascalLexer.hpp"
+#include "PascalParser.hpp"
+#include "PascalStoreWalker.hpp"
+
+struct PascalSupportPartData{
+ ProblemReporter* problemReporter;
+
+ PascalSupportPartData()
+ : problemReporter( 0 )
+ {}
+};
+
+typedef KDevGenericFactory<PascalSupportPart> PascalSupportFactory;
+static const KDevPluginInfo data("kdevpascalsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevpascalsupport, PascalSupportFactory( data ) )
+
+PascalSupportPart::PascalSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "KDevPascalSupport" ),
+ d( new PascalSupportPartData() )
+{
+ setInstance(PascalSupportFactory::instance());
+ setXMLFile("kdevpascalsupport.rc");
+
+ d->problemReporter = new ProblemReporter( this );
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ d->problemReporter, SLOT(configWidget(KDialogBase*)) );
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), SIGNAL(configWidget(KDialogBase*)),
+ this, SLOT(configWidget(KDialogBase*)) );
+ connect( core( ), SIGNAL( projectConfigWidget( KDialogBase* ) ), this,
+ SLOT( projectConfigWidget( KDialogBase* ) ) );
+
+ mainWindow()->embedOutputView( d->problemReporter, i18n("Problems"), i18n("problem reporter") );
+ QWhatsThis::add(d->problemReporter, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. "
+ "It displays errors reported by a language parser."));
+}
+
+PascalSupportPart::~PascalSupportPart()
+{
+ mainWindow()->removeView( d->problemReporter );
+ delete( d->problemReporter );
+
+ delete( d );
+}
+
+PascalSupportPart::Features PascalSupportPart::features()
+{
+ return Features(Classes | Structs | Functions | Variables | Declarations);
+}
+
+void PascalSupportPart::projectOpened()
+{
+ connect(project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)));
+ connect(project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)));
+ connect(project(), SIGNAL(projectCompiled()),
+ this, SLOT(slotProjectCompiled()) );
+
+ m_projectFileList = project()->allFiles();
+ m_projectClosed = false;
+
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+void PascalSupportPart::projectClosed()
+{
+ m_projectClosed = true;
+}
+
+void PascalSupportPart::configWidget(KDialogBase *dlg)
+{
+ Q_UNUSED( dlg );
+ return;
+}
+
+void PascalSupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ Q_UNUSED( dlg );
+ return;
+}
+
+void PascalSupportPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ Q_UNUSED( popup );
+ Q_UNUSED( context );
+ return;
+}
+
+void PascalSupportPart::savedFile(const KURL &fileName)
+{
+ maybeParse(fileName.path());
+ emit updatedSourceInfo();
+}
+
+void PascalSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ for (QStringList::ConstIterator it = fileList.begin(); it != fileList.end() ;++it)
+ {
+ QString fn = project()->projectDirectory() + "/" + *it;
+ maybeParse( fn );
+ kapp->processEvents( 500 );
+ emit addedSourceInfo(fn);
+ }
+}
+
+void PascalSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ for (QStringList::ConstIterator it = fileList.begin(); it != fileList.end() ;++it)
+ {
+ QString fn = project()->projectDirectory() + "/" + *it;
+
+ emit aboutToRemoveSourceInfo(fn);
+ codeModel()->removeFile( codeModel()->fileByName(fn) );
+ }
+}
+
+void PascalSupportPart::slotProjectCompiled()
+{
+ return;
+}
+
+void PascalSupportPart::initialParse( )
+{
+ kdDebug(9013) << "------------------------------------------> initialParse()" << endl;
+
+ if (project())
+ {
+ kapp->setOverrideCursor(waitCursor);
+
+ /// @todo Progress indicator!
+
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it){
+ QString fn = project()->projectDirectory() + "/" + *it;
+ maybeParse( fn );
+ kapp->processEvents( 500 );
+ }
+
+ emit updatedSourceInfo();
+
+ kapp->restoreOverrideCursor();
+ mainWindow()->statusBar()->message( i18n("Found 1 problem", "Found %n problems", d->problemReporter->childCount()) );
+ }
+}
+
+void PascalSupportPart::maybeParse( const QString & fileName )
+{
+ kdDebug(9013) << "Maybe parse: " << fileName << endl;
+
+ KMimeType::Ptr mime = KMimeType::findByURL( KURL( fileName ) );
+ if( !mime || mime->name() != "text/x-pascal" )
+ return;
+
+ mainWindow()->statusBar()->message( i18n("Parsing file: %1").arg(fileName) );
+ parse( fileName );
+}
+
+void PascalSupportPart::parse( const QString & fileName )
+{
+ kdDebug(9013) << "PascalSupportPart::parse() -- " << fileName << endl;
+
+ std::ifstream stream( QFile::encodeName( fileName ).data() );
+ QCString _fn = fileName.utf8();
+ std::string fn( _fn.data() );
+
+ PascalLexer lexer( stream );
+ lexer.setFilename( fn );
+ lexer.setProblemReporter( d->problemReporter );
+
+ PascalParser parser( lexer );
+ parser.setFilename( fn );
+ parser.setProblemReporter( d->problemReporter );
+
+ try{
+ antlr::ASTFactory my_factory( "PascalAST", PascalAST::factory );
+ parser.initializeASTFactory(my_factory);
+ parser.setASTFactory( &my_factory );
+
+ lexer.resetErrors();
+ parser.resetErrors();
+
+ parser.compilationUnit();
+ int errors = lexer.numberOfErrors() + parser.numberOfErrors();
+ RefPascalAST ast = RefPascalAST( parser.getAST() );
+
+ if( errors == 0 && ast != antlr::nullAST ){
+ kdDebug(9013) << "-------------------> start StoreWalker" << endl;
+/* PascalStoreWalker walker;
+ walker.setFileName( fileName );
+ walker.setCodeModel( codeModel() );
+ walker.compilationUnit( ast );*/
+ }
+
+ } catch( antlr::ANTLRException& ex ){
+ kdDebug() << "*exception*: " << ex.toString().c_str() << endl;
+ d->problemReporter->reportError( ex.getMessage().c_str(),
+ fileName,
+ lexer.getLine(),
+ lexer.getColumn() );
+ }
+}
+
+KMimeType::List PascalSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "text/x-pascal" );
+ if( mime )
+ list << mime;
+ return list;
+}
+
+QString PascalSupportPart::formatTag( const Tag & inputTag )
+{
+ Tag tag = inputTag;
+
+ switch( tag.kind() )
+ {
+ case Tag::Kind_Namespace:
+ return QString::fromLatin1("unit ") + tag.name();
+
+ case Tag::Kind_Class:
+ return QString::fromLatin1("class ") + tag.name();
+
+ case Tag::Kind_Function:
+ case Tag::Kind_FunctionDeclaration:
+ {
+ return tag.name() + "()";
+ }
+ break;
+
+ case Tag::Kind_Variable:
+ case Tag::Kind_VariableDeclaration:
+ {
+ return QString::fromLatin1("var ") + tag.name();
+ }
+ break;
+ }
+ return tag.name();
+}
+
+QString PascalSupportPart::formatModelItem( const CodeModelItem * item, bool shortDescription )
+{
+ if (item->isFunction() || item->isFunctionDefinition() )
+ {
+ const FunctionModel *model = static_cast<const FunctionModel*>(item);
+ QString function;
+ QString args;
+ ArgumentList argumentList = model->argumentList();
+ for (ArgumentList::const_iterator it = argumentList.begin(); it != argumentList.end(); ++it)
+ {
+ args.isEmpty() ? args += "" : args += ", " ;
+ args += formatModelItem((*it).data());
+ }
+
+ function += model->name() + "(" + args + ")";
+
+ if( !shortDescription )
+ function += (model->isVirtual() ? QString("virtual; ") : QString("") ) + model->resultType() + " ";
+
+ return function;
+ }
+ else if (item->isVariable())
+ {
+ const VariableModel *model = static_cast<const VariableModel*>(item);
+ if( shortDescription )
+ return model->name();
+ return model->name() + ": " + model->type();
+ }
+ else if (item->isArgument())
+ {
+ const ArgumentModel *model = static_cast<const ArgumentModel*>(item);
+ QString arg;
+ arg += model->name();
+ arg += ": " + model->type();
+ if( !shortDescription )
+ arg += model->defaultValue().isEmpty() ? QString("") : QString(" = ") + model->defaultValue();
+ return arg.stripWhiteSpace();
+ }
+ else
+ return KDevLanguageSupport::formatModelItem( item, shortDescription );
+}
+
+#include "pascalsupport_part.moc"
diff --git a/languages/pascal/pascalsupport_part.h b/languages/pascal/pascalsupport_part.h
new file mode 100644
index 00000000..4319d1f9
--- /dev/null
+++ b/languages/pascal/pascalsupport_part.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2003 Alexander Dymo *
+ * cloudtemple@mksat.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 __KDEVPART_PASCALSUPPORT_H__
+#define __KDEVPART_PASCALSUPPORT_H__
+
+#include <qguardedptr.h>
+#include "kdevlanguagesupport.h"
+
+class PascalSupportWidget;
+class KDialogBase;
+class QPopupMenu;
+class Context;
+class PascalSupportPartData;
+
+class PascalSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+public:
+ PascalSupportPart(QObject *parent, const char *name, const QStringList &);
+ ~PascalSupportPart();
+
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+ virtual QString formatTag( const Tag& tag );
+ virtual QString formatModelItem( const CodeModelItem *item, bool shortDescription=false );
+
+private slots:
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void configWidget(KDialogBase *dlg);
+ void projectConfigWidget(KDialogBase *dlg);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotProjectCompiled();
+
+ void initialParse();
+
+private:
+ void maybeParse(const QString &fileName);
+ void parse(const QString &fileName);
+
+ QGuardedPtr<PascalSupportWidget> m_widget;
+
+ bool m_projectClosed;
+ QStringList m_projectFileList;
+
+ PascalSupportPartData* d;
+
+};
+
+#endif
diff --git a/languages/pascal/pascaltemplates b/languages/pascal/pascaltemplates
new file mode 100644
index 00000000..771f7cca
--- /dev/null
+++ b/languages/pascal/pascaltemplates
@@ -0,0 +1,30 @@
+<!DOCTYPE Templates>
+<Templates>
+ <Template code="if ( | ) then
+begin
+end
+else
+begin
+end;" name="ife" description="if else" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="while ( | ) do
+begin
+end;" name="whileb" description="while statement" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="private|" name="pr" description="private" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="public|" name="pu" description="public" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="case ( | ) of
+end;" name="caseb" description="case statement" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="protected|" name="pro" description="protected" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="for | := to do
+begin
+end;" name="forb" description="for statement" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="|= class()
+public
+private
+protected
+end;" name="classd" description="class declaration" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="|= record
+end;" name="recordd" description="record declaration" suffixes="Pascal (p,pp,pas,dpr)"/>
+ <Template code="if ( | ) then
+begin
+end;" name="ifb" description="if statement" suffixes="Pascal (p,pp,pas,dpr)"/>
+</Templates>
diff --git a/languages/pascal/problemreporter.cpp b/languages/pascal/problemreporter.cpp
new file mode 100644
index 00000000..7a0a6d0d
--- /dev/null
+++ b/languages/pascal/problemreporter.cpp
@@ -0,0 +1,289 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "problemreporter.h"
+#include "pascalsupport_part.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "configproblemreporter.h"
+#include "backgroundparser.h"
+
+#include <kdeversion.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/markinterface.h>
+
+#include <ktexteditor/markinterfaceextension.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+
+#include <kconfig.h>
+
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <kdialogbase.h>
+
+
+class ProblemItem: public QListViewItem{
+public:
+ ProblemItem( QListView* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : QListViewItem( parent, level, problem, file, line, column ) {}
+
+ ProblemItem( QListViewItem* parent, const QString& level, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : QListViewItem( parent, level, problem, file, line, column ) {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const {
+ if( column == 3 || column == 4 ){
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if( a == b )
+ return 0;
+ return( a > b ? -1 : 1 );
+ }
+ return QListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+ProblemReporter::ProblemReporter( PascalSupportPart* part, QWidget* parent, const char* name )
+ : QListView( parent, name ),
+ m_pascalSupport( part ),
+ m_editor( 0 ),
+ m_document( 0 ),
+ m_markIface( 0 ),
+ m_bgParser( 0 )
+{
+ addColumn( i18n("Level") );
+ addColumn( i18n("Problem") );
+ addColumn( i18n("File") );
+ addColumn( i18n("Line") );
+ //addColumn( i18n("Column") );
+ setAllColumnsShowFocus( TRUE );
+
+ m_timer = new QTimer( this );
+
+ connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partAdded(KParts::Part*)),
+ this, SLOT(slotPartAdded(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)),
+ this, SLOT(slotPartRemoved(KParts::Part*)) );
+
+ connect( m_timer, SIGNAL(timeout()), this, SLOT(reparse()) );
+
+ connect( this, SIGNAL(doubleClicked(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+
+ configure();
+}
+
+ProblemReporter::~ProblemReporter()
+{
+ if( m_bgParser ) {
+ m_bgParser->wait();
+ }
+
+ delete( m_bgParser );
+ m_bgParser = 0;
+}
+
+void ProblemReporter::slotActivePartChanged( KParts::Part* part )
+{
+ if( !part )
+ return;
+
+ if( m_editor )
+ reparse();
+
+ m_document = dynamic_cast<KTextEditor::Document*>( part );
+ if( m_document ){
+ m_filename = m_document->url().path();
+ }
+
+ m_editor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ if( m_editor )
+ connect( m_document, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+
+ m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part );
+
+ m_timer->changeInterval( m_delay );
+}
+
+void ProblemReporter::slotTextChanged()
+{
+ if( m_active )
+ m_timer->changeInterval( m_delay );
+}
+
+void ProblemReporter::reparse()
+{
+ kdDebug(9007) << "ProblemReporter::reparse()" << endl;
+
+ kdDebug() << "1" << endl;
+
+ if( !m_editor )
+ return;
+
+ kdDebug() << "2" << endl;
+
+ m_timer->stop();
+
+ kdDebug() << "3" << endl;
+
+ if( m_bgParser ) {
+ if( m_bgParser->running() ) {
+ m_timer->changeInterval( m_delay );
+ return;
+ }
+
+ delete( m_bgParser );
+ m_bgParser = 0;
+ }
+
+ kdDebug() << "4" << endl;
+
+ QListViewItem* current = firstChild();
+ while( current ){
+ QListViewItem* i = current;
+ current = current->nextSibling();
+
+ if( i->text(2) == m_filename )
+ delete( i );
+ }
+
+ kdDebug() << "5" << endl;
+
+ if( m_markIface ){
+ QPtrList<KTextEditor::Mark> marks = m_markIface->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while( it.current() ){
+ m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 );
+ ++it;
+ }
+ }
+
+ kdDebug() << "6" << endl;
+
+ m_bgParser = new BackgroundParser( this, m_editor->text(), m_filename );
+
+ kdDebug() << "7" << endl;
+
+ m_bgParser->start();
+
+ kdDebug() << "8" << endl;
+}
+
+void ProblemReporter::slotSelected( QListViewItem* item )
+{
+ KURL url( item->text(2) );
+ int line = item->text( 3 ).toInt();
+ // int column = item->text( 4 ).toInt();
+ m_pascalSupport->partController()->editDocument( url, line-1 );
+}
+
+void ProblemReporter::reportError( QString message,
+ QString filename,
+ int line, int column )
+{
+ if( m_markIface ){
+ m_markIface->addMark( line-1, KTextEditor::MarkInterface::markType07 );
+ }
+
+ new ProblemItem( this,
+ "error",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::reportWarning( QString message,
+ QString filename,
+ int line, int column )
+{
+ new ProblemItem( this,
+ "warning",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::reportMessage( QString message,
+ QString filename,
+ int line, int column )
+{
+ new QListViewItem( this,
+ "message",
+ message.replace( QRegExp("\n"), "" ),
+ filename,
+ QString::number( line ),
+ QString::number( column ) );
+}
+
+void ProblemReporter::configure()
+{
+ kdDebug(9007) << "ProblemReporter::configure()" << endl;
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ m_active = config->readBoolEntry( "EnablePascalBgParser", TRUE );
+ m_delay = config->readNumEntry( "BgParserDelay", 500 );
+}
+
+void ProblemReporter::configWidget( KDialogBase* dlg )
+{
+ /// \FIXME adymo: use problem reporter configuration
+ Q_UNUSED(dlg);
+/* QVBox *vbox = dlg->addVBoxPage(i18n("Pascal Parsing"));
+ ConfigureProblemReporter* w = new ConfigureProblemReporter( vbox );
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ connect(dlg, SIGNAL(okClicked()), this, SLOT(configure()));*/
+}
+
+void ProblemReporter::slotPartAdded( KParts::Part* part )
+{
+ KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part );
+
+ if( !iface )
+ return;
+
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+}
+
+void ProblemReporter::slotPartRemoved( KParts::Part* part )
+{
+ kdDebug(9007) << "ProblemReporter::slotPartRemoved()" << endl;
+ if( part == m_document ){
+ m_document = 0;
+ m_editor = 0;
+ m_timer->stop();
+ }
+}
+
+#include "problemreporter.moc"
diff --git a/languages/pascal/problemreporter.h b/languages/pascal/problemreporter.h
new file mode 100644
index 00000000..3fa3ee28
--- /dev/null
+++ b/languages/pascal/problemreporter.h
@@ -0,0 +1,78 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PROBLEMSREPORTER_H
+#define PROBLEMSREPORTER_H
+
+#include <qlistview.h>
+
+class PascalSupportPart;
+class QTimer;
+class KDialogBase;
+class BackgroundParser;
+
+namespace KParts{
+ class Part;
+}
+
+namespace KTextEditor{
+ class EditInterface;
+ class MarkInterface;
+ class Document;
+}
+
+class ProblemReporter: public QListView{
+ Q_OBJECT
+public:
+ ProblemReporter( PascalSupportPart* part, QWidget* parent=0, const char* name=0 );
+ virtual ~ProblemReporter();
+
+ virtual void reportError( QString message, QString filename,
+ int line, int column );
+
+ virtual void reportWarning( QString message, QString filename,
+ int line, int column );
+
+ virtual void reportMessage( QString message, QString filename,
+ int line, int column );
+
+public slots:
+ void reparse();
+ void configure();
+ void configWidget( KDialogBase* );
+
+private slots:
+ void slotPartAdded( KParts::Part* );
+ void slotPartRemoved( KParts::Part* );
+ void slotActivePartChanged( KParts::Part* );
+ void slotTextChanged();
+ void slotSelected( QListViewItem* );
+
+private:
+ PascalSupportPart* m_pascalSupport;
+ KTextEditor::EditInterface* m_editor;
+ KTextEditor::Document* m_document;
+ KTextEditor::MarkInterface* m_markIface;
+ QTimer* m_timer;
+ QString m_filename;
+ int m_active;
+ int m_delay;
+ BackgroundParser* m_bgParser;
+};
+
+#endif
diff --git a/languages/perl/Makefile.am b/languages/perl/Makefile.am
new file mode 100644
index 00000000..2354c124
--- /dev/null
+++ b/languages/perl/Makefile.am
@@ -0,0 +1,25 @@
+# Here resides the Perl support part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = app_templates file_templates doc
+
+
+kde_module_LTLIBRARIES = libkdevperlsupport.la kio_perldoc.la
+libkdevperlsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevperlsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevperlsupport_la_SOURCES = perlparser.cpp perlsupportpart.cpp perlconfigwidget.cpp perlconfigwidgetbase.ui
+
+kio_perldoc_la_SOURCES = perldoc.cpp
+kio_perldoc_la_LIBADD = $(LIB_KIO)
+kio_perldoc_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevperlsupport.desktop perldoc.protocol
+
+rcdir = $(kde_datadir)/kdevperlsupport
+rc_DATA = kdevperlsupport.rc
diff --git a/languages/perl/README.dox b/languages/perl/README.dox
new file mode 100644
index 00000000..f8608a41
--- /dev/null
+++ b/languages/perl/README.dox
@@ -0,0 +1,46 @@
+/** \class PerlSupportPart
+This is perl language support plugin.
+
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+\authors <a href="mailto:willems.luc AT pandora.be">Luc Willems</a>
+
+\maintainer <a href="mailto:willems.luc AT pandora.be">Luc Willems</a>
+
+\feature perl programming language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/perl/app_templates/Makefile.am b/languages/perl/app_templates/Makefile.am
new file mode 100644
index 00000000..c284be59
--- /dev/null
+++ b/languages/perl/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = perlhello
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PerlIDE
+profiles_DATA = perl.appwizard
diff --git a/languages/perl/app_templates/perl.appwizard b/languages/perl/app_templates/perl.appwizard
new file mode 100644
index 00000000..44c9faf9
--- /dev/null
+++ b/languages/perl/app_templates/perl.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=perlhello
diff --git a/languages/perl/app_templates/perlhello/.kdev_ignore b/languages/perl/app_templates/perlhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/.kdev_ignore
diff --git a/languages/perl/app_templates/perlhello/Makefile.am b/languages/perl/app_templates/perlhello/Makefile.am
new file mode 100644
index 00000000..1c1d7b33
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.pl app.kdevelop
+templateName = perlhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/perl/app_templates/perlhello/app.kdevelop b/languages/perl/app_templates/perlhello/app.kdevelop
new file mode 100644
index 00000000..c781322d
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/app.kdevelop
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Perl</primarylanguage>
+ <projectdirectory>.</projectdirectory>
+ <absoluteprojectpath>false</absoluteprojectpath>
+ </general>
+ <kdevscriptproject>
+ <run>
+ <mainprogram>./%{APPNAMELC}.pl</mainprogram>
+ </run>
+ <general>
+ <includepatterns>*.pl,*.pm</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="" />
+ <type ext="pl" />
+ <type ext="pm" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/perl/app_templates/perlhello/app.pl b/languages/perl/app_templates/perlhello/app.pl
new file mode 100755
index 00000000..bd6bbf6a
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/app.pl
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+#
+use strict;
+use warnings;
+
+
+#program version
+my $VERSION="%{VERSION}";
+
+#For CVS , use following line
+#my $VERSION=sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+
+sub do_something {
+ my $text=shift;
+ print "$text\n";
+}
+
+&do_something("Hello World");
+print "That's all folks for version $VERSION \n";
+
+__END__
+
+=head1 NAME
+
+%{APPNAME} - short description of your program
+
+=head1 SYNOPSIS
+
+ how to use your program
+
+=head1 DESCRIPTION
+
+ long description of your program
+
+=head1 SEE ALSO
+
+ need to know things before somebody uses your program
+
+=head1 AUTHOR
+
+ %{AUTHOR}
+
+=cut
diff --git a/languages/perl/app_templates/perlhello/perlhello b/languages/perl/app_templates/perlhello/perlhello
new file mode 100644
index 00000000..1f015e1b
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/perlhello
@@ -0,0 +1,10 @@
+# KDE Config File
+[General]
+Name=Simple Perl script
+Name[fr]=Un simple script de test Hello world
+Icon=camel.png
+Category=Perl
+Comment=This generates a simplistic 'Hello world' program in Perl (http://www.perl.org)
+Comment[fr]=Gnre un simple script de test du type Hello world dans le language PERL (http://www.perl.org).
+FileTemplates=perl,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.pl
diff --git a/languages/perl/app_templates/perlhello/perlhello.kdevtemplate b/languages/perl/app_templates/perlhello/perlhello.kdevtemplate
new file mode 100644
index 00000000..ead7b5b8
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/perlhello.kdevtemplate
@@ -0,0 +1,108 @@
+# KDE Config File
+[General]
+Name=Simple Perl script
+Name[ca]=Simple script en Perl
+Name[da]=Simpelt Perl script
+Name[de]=Einfaches Perl-Skript
+Name[el]=Απλό σενάριο Perl
+Name[es]=Guión sencillo en Perl
+Name[et]=Lihtne Perli skript
+Name[eu]=Perl script sinplea
+Name[fa]=دست‌نوشتۀ سادۀ پرل
+Name[fr]=Script Perl simple
+Name[ga]=Script shimplí Perl
+Name[gl]=Script sinxelo en Perl
+Name[hu]=Egyszerű Perl-szkript
+Name[it]=Semplice script Perl
+Name[ja]=簡単な Perl スクリプト
+Name[nds]=Eenfach Perl-Skript
+Name[ne]=साधारण पर्ल स्क्रिप्ट
+Name[nl]=Eenvoudig Perl-script
+Name[pl]=Prosty skrypt w Perlu
+Name[pt]=Programa simples em Perl
+Name[pt_BR]=Programa simples em Perl
+Name[ru]=Простой скрипт Perl
+Name[sk]=Jednoduchý Perl skript
+Name[sr]=Једноставна Perl скрипта
+Name[sr@Latn]=Jednostavna Perl skripta
+Name[sv]=Enkelt Perl-skript
+Name[tr]=Basit Perl betiği
+Name[zh_CN]=简单 Perl 脚本
+Name[zh_TW]=簡單的 Perl 文稿
+Icon=camel.png
+Category=Perl
+Comment=This generates a simplistic 'Hello world' program in Perl (http://www.perl.org)
+Comment[ca]=Genera un simple programa de 'Hello world' en Perl (http://www.perl.org)
+Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i Perl (http://www.perl.org)
+Comment[de]=Hiermit wird ein einfaches "Hello World"-Programm in Perl erstellt (http://www.perl.org).
+Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα 'Γεια σου κόσμε' σε Perl (http://www.perl.org)
+Comment[es]=Genera un programa «Hola mundo» sencillo en Perl (http://www.perl.org)
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Perlis (http://www.perl.org)
+Comment[eu]=Honek "Kaixo mundua" Perl-en (http://www.perl.org) idatzitako programa sinple bat sortzen du.
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در پرل (http://www.perl.org) تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Perl (http://www.perl.org)
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello world" i Perl (http://www.perl.org/)
+Comment[gl]=Isto xera un programa sinxelo en Perl 'Ola mundo'(http://www.perl.org)
+Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot Perlben (http://www.perl.org)
+Comment[it]=Genera un semplice programma di "Hello world" in Perl (http://www.perl.org)
+Comment[ja]=Perl で書かれた簡単な Hello world プログラムを作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm in Perl op.(http://www.perl.org).
+Comment[ne]=यसले पर्लमा साधारण 'हेल्लो वोल्ड' कार्यक्रम उत्पन्न गर्दछ (http://www.perl.org)
+Comment[nl]=Dit genereert een eenvoudig Hello World-programma in Perl (http://www.perl.org)
+Comment[pl]=Generuje prosty skrypt "Witaj świecie" w Perlu (http://www.perl.org)
+Comment[pt]=Isto gera um programa simples 'Olá mundo' em Perl (http://www.perl.org)
+Comment[pt_BR]=Isto gera um programa simples 'Olá mundo' em Perl (http://www.perl.org)
+Comment[ru]=Создание простой программы 'Hello world' на Perl (http://www.perl.org)
+Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v Perl (http://www.perl.org)
+Comment[sr]=Прави једноставан „Здраво свете“ програм у Perl-у (http://www.perl.org)
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u Perl-u (http://www.perl.org)
+Comment[sv]=Detta skapar ett förenklat 'Hello world'-program i Perl (http://www.perl.org)
+Comment[tr]=Bu, Perl'de basit bir "Merhaba Dünya" programı yaratır (http://www.perl.org)
+Comment[zh_CN]=这将生成一个简单的 Perl 语言“Hello world”程序
+Comment[zh_TW]=產生一個簡單的 Perl (http://www.perl.org) 的 Hello world 程式
+FileTemplates=perl,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.pl
+Archive=perlhello.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.pl
+Dest=%{dest}/%{APPNAMELC}.pl
+
+[MSG]
+Type=message
+Comment=A simple Perl script was created in %{dest}
+Comment[ca]=Un simple script en Perl ha estat creat en %{dest}
+Comment[da]=Et simpelt Perl script blev oprettet i %{dest}
+Comment[de]=Ein einfaches Perl-Skript wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό σενάριο Perl δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo guión en Perl ha sido creado en %{dest}
+Comment[et]=Lihtne Perli skript loodi asukohta %{dest}
+Comment[eu]=Perl script sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک دست‌نوشتۀ سادۀ پرل در %{dest} ایجاد شد
+Comment[fr]=Un script Perl simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh script shimplí Perl i %{dest}
+Comment[gl]=Creouse un script sinxelo en Perl en %{dest}
+Comment[hu]=Létrejött egy egyszerű Perl-szkript itt: %{dest}
+Comment[it]=È stato creato un semplice script Perl in %{dest}
+Comment[ja]=簡単な Perl スクリプトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Perl-Skript opstellt.
+Comment[ne]=साधारण पर्ल स्क्रिप्ट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Perl-script is aangemaakt in %{dest}
+Comment[pl]=Prosty skrypt w Perlu został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples em Perl em %{dest}
+Comment[pt_BR]=Foi criado um programa simples em Perl em %{dest}
+Comment[ru]=Простой скрипт Perl создан в %{dest}
+Comment[sk]=Jednoduchý Perl skript bol vytvorený v %{dest}
+Comment[sr]=Једноставна Perl скрипта направљена је у %{dest}
+Comment[sr@Latn]=Jednostavna Perl skripta napravljena je u %{dest}
+Comment[sv]=Ett enkelt Perl-skript skapades i %{dest}
+Comment[tr]=Basit Perl betiği %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 Perl 脚本
+Comment[zh_TW]=一個簡單的 Perl 文稿已建立於 %{dest}
diff --git a/languages/perl/app_templates/perlhello/perlhello.png b/languages/perl/app_templates/perlhello/perlhello.png
new file mode 100644
index 00000000..78e0532a
--- /dev/null
+++ b/languages/perl/app_templates/perlhello/perlhello.png
Binary files differ
diff --git a/languages/perl/doc/Makefile.am b/languages/perl/doc/Makefile.am
new file mode 100644
index 00000000..dae5d699
--- /dev/null
+++ b/languages/perl/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = perl.toc perl_bugs.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/perl/doc/perl.toc b/languages/perl/doc/perl.toc
new file mode 100644
index 00000000..84cb8145
--- /dev/null
+++ b/languages/perl/doc/perl.toc
@@ -0,0 +1,54 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Perl</title>
+<tocsect1 name="Data structures" url="man:perldata"/>
+<tocsect1 name="Syntax" url="man:perlsyn"/>
+<tocsect1 name="Operators and Precedence" url="man:perlop"/>
+<tocsect1 name="Regular Expressions" url="man:perlre"/>
+<tocsect1 name="Execution and Options" url="man:perlrun"/>
+<tocsect1 name="Builtin Functions" url="man:perlfunc"/>
+<tocsect1 name="open() Tutorial" url="man:perlopentut"/>
+<tocsect1 name="Predefined Variables" url="man:perlvar"/>
+<tocsect1 name="Subroutines" url="man:perlsub"/>
+<tocsect1 name="Modules: how they work" url="man:perlmod"/>
+<tocsect1 name="Modules: how to write and use" url="man:perlmodlib"/>
+<tocsect1 name="Modules: how to install from CPAN" url="man:perlmodinstall"/>
+<tocsect1 name="Formats" url="man:perlform"/>
+<tocsect1 name="Unicode Support" url="man:perlunicode"/>
+<tocsect1 name="Locale Support" url="man:perllocale"/>
+<tocsect1 name="References Introduction" url="man:perlreftut"/>
+<tocsect1 name="References, the rest of the story" url="man:perlref"/>
+<tocsect1 name="Data Structures: introduction" url="man:perldsc"/>
+<tocsect1 name="Data Structures: arrrays of arrays" url="man:perllol"/>
+<tocsect1 name="OO tutorial 1" url="man:perlboot"/>
+<tocsect1 name="OO tutorial 2" url="man:perltoot"/>
+<tocsect1 name="OO tutorial 3" url="man:perltootc"/>
+<tocsect1 name="Objects" url="man:perlobj"/>
+<tocsect1 name="Objects hidden behind simple variables" url="man:perltie"/>
+<tocsect1 name="OO tricks and examples" url="man:perlbot"/>
+<tocsect1 name="Interprocess Communication" url="man:perlipc"/>
+<tocsect1 name="fork() Information" url="man:perlfork"/>
+<tocsect1 name="Threads Tutorial" url="man:perlthrtut"/>
+<tocsect1 name="Warnings and their Control" url="man:perllexwarn"/>
+<tocsect1 name="Source Filters" url="man:perlfilter"/>
+<tocsect1 name="DBM Filters" url="man:perldbmfilter"/>
+<tocsect1 name="Compiler Suite Introduction" url="man:perlcompile"/>
+<tocsect1 name="Debugging" url="man:perldebug"/>
+<tocsect1 name="Diagnostic Messages" url="man:perldiag"/>
+<tocsect1 name="Number semantics" url="man:perlnumber"/>
+<tocsect1 name="Security" url="man:perlsec"/>
+<tocsect1 name="Traps for the Unwary" url="man:perltrap"/>
+<tocsect1 name="Portability Guide" url="man:perlport"/>
+<tocsect1 name="Style Guide" url="man:perlstyle"/>
+<tocsect1 name="POD" url="man:perlpod"/>
+<tocsect1 name="Embed Perl in C" url="man:perlembed"/>
+<tocsect1 name="Internal IO abstraction interface" url="man:perlapio"/>
+<tocsect1 name="Debugging guts and tips" url="man:perldebguts"/>
+<tocsect1 name="XS API" url="man:perlxs"/>
+<tocsect1 name="XS Tutorial" url="man:perlxstut"/>
+<tocsect1 name="Internal Functions" url="man:perlguts"/>
+<tocsect1 name="Calling conventions from C" url="man:perlcall"/>
+<tocsect1 name="API listing" url="man:perlapi"/>
+<tocsect1 name="Internal functions" url="man:perlintern"/>
+</kdeveloptoc>
+
diff --git a/languages/perl/doc/perl_bugs.toc b/languages/perl/doc/perl_bugs.toc
new file mode 100644
index 00000000..126b35f3
--- /dev/null
+++ b/languages/perl/doc/perl_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Perl bugs</title>
+<base href="http://www.nntp.perl.org/"/>
+<tocsect1 name="Query" url="group">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/perl/file_templates/Makefile.am b/languages/perl/file_templates/Makefile.am
new file mode 100644
index 00000000..f1f8457d
--- /dev/null
+++ b/languages/perl/file_templates/Makefile.am
@@ -0,0 +1,4 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = pl pm
+
+
diff --git a/languages/perl/file_templates/pl b/languages/perl/file_templates/pl
new file mode 100644
index 00000000..bacfcdda
--- /dev/null
+++ b/languages/perl/file_templates/pl
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+#
+use strict;
+use warnings;
+
+
+#program version
+my $VERSION="$VERSION$";
+
+#For CVS , use following line
+#my $VERSION=sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
+
+sub do_something {
+ my $text=shift;
+ print "$text\n";
+}
+
+&do_something("Hello World");
+print "That's all folks for version $VERSION \n";
+
+__END__
+
+=head1 NAME
+
+Script name - short discription of your program
+
+=head1 SYNOPSIS
+
+ how to us your program
+
+=head1 DESCRIPTION
+
+ long description of your program
+
+=head1 SEE ALSO
+
+ need to know things before somebody uses your program
+
+=head1 AUTHOR
+
+ $AUTHOR$
+
+=cut
diff --git a/languages/perl/file_templates/pm b/languages/perl/file_templates/pm
new file mode 100644
index 00000000..c0e33a1d
--- /dev/null
+++ b/languages/perl/file_templates/pm
@@ -0,0 +1,68 @@
+package $MODULE$;
+
+use strict;
+
+require Exporter;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+
+# set the version for version checking
+$VERSION = $VERSION$;
+
+@ISA = qw(Exporter);
+@EXPORT = qw(&hello);
+%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
+
+# your exported package globals go here,
+# as well as any optionally exported functions
+@EXPORT_OK = qw($Var1 %Hashit &func3);
+
+use vars qw($Var1 %Hashit);
+# non-exported package globals go here
+use vars qw(@more $stuff);
+
+# initialize package globals, first exported ones
+$Var1 = '';
+%Hashit = ();
+
+# then the others (which are still accessible as $Some::Module::stuff)
+$stuff = '';
+@more = ();
+
+
+# file-private lexicals go here
+my $priv_var = '';
+my %secret_hash = ();
+
+
+sub hello {
+ print "hello world\n";
+}
+
+
+END { } # module clean-up code here (global destructor)
+
+1;
+
+__END__
+
+=head1 NAME
+
+ModuleName - short discription of your program
+
+=head1 SYNOPSIS
+
+ how to us your module
+
+=head1 DESCRIPTION
+
+ long description of your module
+
+=head1 SEE ALSO
+
+ need to know things before somebody uses your program
+
+=head1 AUTHOR
+
+ $AUTHOR$
+
+=cut
diff --git a/languages/perl/kdevperlsupport.desktop b/languages/perl/kdevperlsupport.desktop
new file mode 100644
index 00000000..66cfc907
--- /dev/null
+++ b/languages/perl/kdevperlsupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Perl Support
+Comment[ca]=Suport per a Perl
+Comment[da]=Perl-understøttelse
+Comment[de]=Perl-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη Perl
+Comment[es]=Soporte para Perl
+Comment[et]=Perli toetus
+Comment[eu]=Perl euskarria
+Comment[fa]=پشتیبانی پرل
+Comment[fr]=Prise en charge du langage Perl
+Comment[ga]=Tacaíocht Perl
+Comment[gl]=Soporte para Perl
+Comment[hi]=पर्ल समर्थन
+Comment[hu]=Perl-támogatás
+Comment[is]=Perl stuðningur
+Comment[it]=Supporto Perl
+Comment[ja]=Perl サポート
+Comment[nds]=Ünnerstütten för Perl
+Comment[ne]=पर्ल समर्थन
+Comment[nl]=Ondersteuning voor Perl
+Comment[pl]=Obsługa Perla
+Comment[pt]=Suporte a Perl
+Comment[pt_BR]=Suporte ao Perl
+Comment[ru]=Поддержка языка Perl
+Comment[sk]=Perl podpora
+Comment[sl]=Podpora za perl
+Comment[sr]=Подршка за Perl
+Comment[sr@Latn]=Podrška za Perl
+Comment[sv]=Perl-stöd
+Comment[ta]=பெர்ல் ஆதரவு
+Comment[tg]=Ёрӣ намудани забони Perl
+Comment[tr]=Perl Desteği
+Comment[zh_CN]=Perl 支持
+Comment[zh_TW]=Perl 支援
+Name=KDevPerlSupport
+Name[da]=KDevelop Perl-understøttelse
+Name[de]=Unterstützung für Perl (KDevelop)
+Name[hi]=के-डेव-पर्ल-समर्थन
+Name[nds]=Perl-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaPerla
+Name[sk]=KDev Perl podpora
+Name[sv]=KDevelop Perl-stöd
+Name[ta]=கெடெவ் பெர்ல் ஆதரவு
+Name[zh_TW]=KDevelop Perl 支援
+GenericName=Perl Support
+GenericName[ca]=Suport per a Perl
+GenericName[da]=Perl-understøttelse
+GenericName[de]=Unterstützung für Perl
+GenericName[el]=Υποστήριξη Perl
+GenericName[es]=Soporte para Perl
+GenericName[et]=Perli toetus
+GenericName[eu]=Perl euskarria
+GenericName[fa]=پشتیبانی پرل
+GenericName[fr]=Prise en charge du langage PERL
+GenericName[ga]=Tacaíocht Perl
+GenericName[gl]=Soporte para Perl
+GenericName[hi]=पर्ल समर्थन
+GenericName[hu]=Perl-támogatás
+GenericName[it]=Supporto per Perl
+GenericName[ja]=Perl サポート
+GenericName[nds]=Ünnerstütten för Perl
+GenericName[ne]=पर्ल समर्थन
+GenericName[nl]=Ondersteuning voor Perl
+GenericName[pl]=Obsługa Perla
+GenericName[pt]=Suporte a Perl
+GenericName[pt_BR]=Suporte ao Perl
+GenericName[ru]=Поддержка языка Perl
+GenericName[sk]=Perl podpora
+GenericName[sl]=Podpora za perl
+GenericName[sr]=Подршка за Perl
+GenericName[sr@Latn]=Podrška za Perl
+GenericName[sv]=Perl-stöd
+GenericName[ta]=பெர்ல் ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони Perl
+GenericName[tr]=Perl Desteği
+GenericName[zh_CN]=Perl 支持
+GenericName[zh_TW]=Perl 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevperlsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Perl
+
diff --git a/languages/perl/kdevperlsupport.rc b/languages/perl/kdevperlsupport.rc
new file mode 100644
index 00000000..9f5f4ee9
--- /dev/null
+++ b/languages/perl/kdevperlsupport.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevPerlSupport" version="1">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_exec" />
+ <Action name="build_runinterpreter" />
+ <Action name="build_execstring" />
+ </Menu>
+ <Menu name="help">
+ <Action name="help_perldocfunction"/>
+ <Action name="help_perldocfaq"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/perl/perlconfigwidget.cpp b/languages/perl/perlconfigwidget.cpp
new file mode 100644
index 00000000..475ed8af
--- /dev/null
+++ b/languages/perl/perlconfigwidget.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "perlconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <qlineedit.h>
+#include "domutil.h"
+
+
+PerlConfigWidget::PerlConfigWidget(QDomDocument &projectDom,
+ QWidget *parent, const char *name)
+ : PerlConfigWidgetBase(parent, name), dom(projectDom)
+{
+ interpreter_edit->setText(DomUtil::readEntry(dom, "/kdevperlsupport/run/interpreter"));
+ terminal_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevperlsupport/run/terminal"));
+}
+
+
+PerlConfigWidget::~PerlConfigWidget()
+{}
+
+
+void PerlConfigWidget::accept()
+{
+ DomUtil::writeEntry(dom, "/kdevperlsupport/run/interpreter", interpreter_edit->text());
+ DomUtil::writeBoolEntry(dom, "/kdevperlsupport/run/terminal", terminal_box->isChecked());
+}
+
+#include "perlconfigwidget.moc"
diff --git a/languages/perl/perlconfigwidget.h b/languages/perl/perlconfigwidget.h
new file mode 100644
index 00000000..07364a40
--- /dev/null
+++ b/languages/perl/perlconfigwidget.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PERLCONFIGWIDGET_H_
+#define _PERLCONFIGWIDGET_H_
+
+#include "perlconfigwidgetbase.h"
+#include <qdom.h>
+
+
+class PerlConfigWidget : public PerlConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ PerlConfigWidget( QDomDocument &projectDom, QWidget *parent=0, const char *name=0 );
+ ~PerlConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ QDomDocument &dom;
+};
+
+#endif
diff --git a/languages/perl/perlconfigwidgetbase.ui b/languages/perl/perlconfigwidgetbase.ui
new file mode 100644
index 00000000..8becd0f4
--- /dev/null
+++ b/languages/perl/perlconfigwidgetbase.ui
@@ -0,0 +1,101 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PerlConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>perl_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Perl</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>interpreter_label</cstring>
+ </property>
+ <property name="text">
+ <string>Perl &amp;interpreter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>terminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Execute programs in a terminal</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/perl/perldoc.cpp b/languages/perl/perldoc.cpp
new file mode 100644
index 00000000..cbb4d18f
--- /dev/null
+++ b/languages/perl/perldoc.cpp
@@ -0,0 +1,133 @@
+#include "perldoc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <qtextstream.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kinstance.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kglobal.h>
+
+using namespace KIO;
+
+
+PerldocProtocol::PerldocProtocol(const QCString &pool, const QCString &app)
+ : SlaveBase("perldoc", pool, app)
+{}
+
+
+PerldocProtocol::~PerldocProtocol()
+{}
+
+
+void PerldocProtocol::get(const KURL& url)
+{
+ QStringList l = QStringList::split('/', url.path());
+
+ mimeType("text/html");
+
+ bool plain = false;
+ QString cmd = "perldoc ";
+ if (l[0] == "functions") {
+ plain = true;
+ cmd += "-t -f ";
+ cmd += KProcess::quote(l[1]);
+ } else if (l[0] == "faq") {
+ cmd += "-u -q ";
+ cmd += KProcess::quote(l[1]);
+ cmd += " | pod2html";
+ } else {
+ QCString errstr(i18n("The only existing directories are functions and faq.").local8Bit());
+ data(errstr);
+ finished();
+ return;
+ }
+
+ kdDebug() << "Command: " << cmd << endl;
+
+ if (plain)
+ data(QCString("<blockquote>"));
+
+ FILE *fd = popen(cmd.local8Bit().data(), "r");
+ char buffer[4090];
+ QByteArray array;
+
+ while (!feof(fd)) {
+ int n = fread(buffer, 1, 2048, fd);
+ if (n == -1) {
+ pclose(fd);
+ return;
+ }
+ array.setRawData(buffer, n);
+ data(array);
+ array.resetRawData(buffer, n);
+ }
+
+ pclose(fd);
+
+ if (plain)
+ data(QCString("</blockquote>"));
+
+ finished();
+}
+
+
+void PerldocProtocol::mimetype(const KURL &url)
+{
+ QStringList l = QStringList::split('/', url.path());
+ mimeType((l[0] == "faq")? "text/html" : "text/plain");
+ finished();
+}
+
+
+QCString PerldocProtocol::errorMessage()
+{
+ return QCString( "<html><body bgcolor=\"#FFFFFF\">" + i18n("Error in perldoc").local8Bit() + "</body></html>" );
+}
+
+
+void PerldocProtocol::stat(const KURL &/*url*/)
+{
+ UDSAtom uds_atom;
+ uds_atom.m_uds = KIO::UDS_FILE_TYPE;
+ uds_atom.m_long = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
+
+ UDSEntry uds_entry;
+ uds_entry.append(uds_atom);
+
+ statEntry(uds_entry);
+ finished();
+}
+
+
+void PerldocProtocol::listDir(const KURL &url)
+{
+ error( KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path() );
+}
+
+
+extern "C" {
+
+ int kdemain(int argc, char **argv)
+ {
+ KInstance instance( "kio_perldoc" );
+ KGlobal::locale()->setMainCatalogue("kdevelop");
+
+ if (argc != 4) {
+ fprintf(stderr, "Usage: kio_perldoc protocol domain-socket1 domain-socket2\n");
+ exit(-1);
+ }
+
+ PerldocProtocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ return 0;
+ }
+
+}
diff --git a/languages/perl/perldoc.h b/languages/perl/perldoc.h
new file mode 100644
index 00000000..00cced89
--- /dev/null
+++ b/languages/perl/perldoc.h
@@ -0,0 +1,25 @@
+#ifndef _PERLDOC_H_
+#define _PERLDOC_H_
+
+#include <qobject.h>
+#include <kio/slavebase.h>
+
+
+class PerldocProtocol : public KIO::SlaveBase
+{
+public:
+ PerldocProtocol(const QCString &pool, const QCString &app);
+ virtual ~PerldocProtocol();
+
+ virtual void get(const KURL& url);
+ virtual void stat(const KURL& url);
+ virtual void mimetype(const KURL& url);
+ virtual void listDir(const KURL& url);
+
+protected:
+ void decodeURL(const KURL &url);
+ void decodePath(QString path);
+ QCString errorMessage();
+};
+
+#endif
diff --git a/languages/perl/perldoc.protocol b/languages/perl/perldoc.protocol
new file mode 100644
index 00000000..031ca931
--- /dev/null
+++ b/languages/perl/perldoc.protocol
@@ -0,0 +1,9 @@
+[Protocol]
+exec=kio_perldoc
+protocol=perldoc
+input=none
+output=filesystem
+reading=true
+listing=Name
+determineMimetypeFromExtension=false
+Icon=help
diff --git a/languages/perl/perlparser.cpp b/languages/perl/perlparser.cpp
new file mode 100644
index 00000000..a6a5a834
--- /dev/null
+++ b/languages/perl/perlparser.cpp
@@ -0,0 +1,494 @@
+/***************************************************************************
+ perlparser.cpp - description
+ -------------------
+ begin : Sun Nov 2 2003
+ copyright : (C) 2003 by luc
+ email : willems.luc(at)pandora.be
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "perlparser.h"
+
+#include <kdebug.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+
+perlparser::perlparser(KDevCore* core,CodeModel* model, QString interpreter) {
+ m_core = core;
+ m_model = model;
+ m_interpreter=interpreter;
+ //get INC paths for current installed perl
+ getPerlINC();
+
+}
+
+perlparser::~perlparser(){
+}
+
+const QStringList perlparser::UseFiles()
+{
+ return m_usefiles;
+}
+
+void perlparser::initialParse() {
+ m_usefiles.clear();
+}
+
+void perlparser::parse(const QString &fileName){
+ QFile f(fileName);
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream stream(&f);
+ QStringList list;
+ QString rawline;
+ while (!stream.eof()) {
+ rawline = stream.readLine();
+ list.append(rawline.stripWhiteSpace().local8Bit());
+ }
+ f.close();
+ kdDebug(9016) << "parsing " << fileName << endl;
+
+ m_file = m_model->create<FileModel>();
+ m_file->setName(fileName );
+ this->parseLines(&list,fileName);
+ m_model->addFile( m_file );
+}
+
+void perlparser::parseLines(QStringList* lines,const QString &fileName)
+{
+ QRegExp packagere("^[ \t]*package[ \t]+([+A-Za-z0-9_:]*).*\\;");
+ QRegExp basere("^[ \t]*use[ \t]+base[ \t]*\\(\'*\"*([A-Za-z0-9_:]*)");
+ QRegExp libre("^[ \t]*use[ \t]+lib[ \t]*\\(\'*\"*([A-Za-z0-9_:]*)");
+ QRegExp usere("^[ \t]*use[ \t]+([+A-Za-z0-9_:]*).*\\;");
+ QRegExp isare("^[ \t]*@ISA[ \t=qw\\(\'\"]*([A-Za-z0-9_: ]*)");
+ QRegExp globalre("^[ \t]*our[ \t]+\\(*([ \t,$%@*+A-Za-z0-9_]*)\\)*.*");
+ QRegExp myre("^[ \t]*my[ \t]+\\(*([ \t,$%@*+A-Za-z0-9_]*)\\)*.*");
+ QRegExp subre("^[ \t]*sub[ \t]+([A-Za-z0-9_]+)([A-Za-z0-9_]|([ \t]*[{])?)$");
+ QRegExp blessre("bless[ \t]*[\\( ]*([,$%@*+A-Za-z0-9_]*).*;");
+ QRegExp namere("^[ \t]*([$%@*])([A-Za-z0-9_]*).*$");
+ QRegExp privatere("^_([A-Za-z0-9_]*)");
+ QRegExp startpod("^=[a-z0-9]+ [a-z0-9]*");
+ QRegExp cutpod("^=cut");
+
+ QString line;
+
+ //clear all "last" know things
+ m_lastsub="";
+ m_lastattr="";
+ m_inpackage = false;
+ m_inscript = false;
+ m_inclass=false;
+
+ m_lastscript=0;
+ m_lastpackage=0;
+ m_lastclass=0;
+
+ int lineNo = -1;
+
+ bool inpod = false;
+ bool endpod = false;
+
+ //check if we are parsing a script or module
+ QFileInfo fi(fileName);
+ bool inscript =(fi.extension() == "pl");
+ kdDebug(9016) << "inscript : " << inscript << "," << fi.extension() << endl;
+
+ if (inscript) {
+ addScript(fileName,lineNo,fi.fileName());
+ }
+
+ for ( QStringList::Iterator it = lines->begin(); it != lines->end(); ++it ) {
+ ++lineNo;
+ line = (*it).local8Bit();
+ //empty line ?
+ if (line.isEmpty()) { continue;}
+ //some POD checking , quick and dirty but it seams to work
+ if(inpod && endpod) { inpod=false; endpod=false;}
+ //are we in pod documentation ?
+ if (startpod.search(line)>=0) {inpod=true; continue;}
+ //are we in pod documentation ?
+ if (inpod) { endpod=( cutpod.search(line)>=0 ); continue; }
+
+
+ //sub matching
+ if (subre.search(line)>=0){
+ QString subname=subre.cap(1);
+ kdDebug(9016) << "subre match [" << subname << "]" << endl;
+ bool prive = privatere.search(subname) >= 0;
+ kdDebug(9016) << "prive match [" << prive << "]" << endl;
+ if (m_inscript) { addScriptSub(fileName,lineNo,subname,prive);}
+ else {
+ if (m_inclass) { addClassMethod(fileName,lineNo,subname,prive);}
+ else { addPackageSub(fileName,lineNo,subname,prive);}
+ }
+ continue;
+ } //sub
+
+ //our matching
+ if (globalre.search(line)>=0) {
+ //splitup multible ours
+ QString varlist=globalre.cap(1);
+ kdDebug(9016) << "globalre match [" << varlist <<"]" << endl;
+ QStringList vars=QStringList::split(",",varlist);
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) {
+ if (namere.search(*it)>=0) {
+ QString var = namere.cap(2);
+ kdDebug(9016) << "namere match [" << var << "]" << endl;
+ if (m_lastpackage) { addAttributetoPackage(fileName,lineNo,var); }
+ else { addAttributetoScript(fileName,lineNo,var); }
+ }
+ }
+ continue;
+ } //globalre
+
+
+ //bless matching
+ if ((blessre.search(line)>=0) && (!m_inscript)) {
+ kdDebug(9016) << "blessre match []" << endl;
+ addClass(fileName,lineNo);
+ addConstructor(fileName,lineNo,m_lastsub);
+ continue;
+ } //bless
+
+ //base matching
+ if ((basere.search(line)>=0) && (!m_inscript)) {
+ QString parent = basere.cap(1);
+ //create child & parent classes
+ kdDebug(9016) << "basere match [" << parent << "]" << endl;
+ addClass(fileName,lineNo);
+ addParentClass(parent);
+ continue;
+ } else {
+ if (libre.search(line)>=0) {
+ QString path = libre.cap(1);
+ //add lib to INC path list
+ kdDebug(9016) << "libre match [" << path << "]" << endl;
+ m_INClist.append(path);
+ continue;
+ } else {
+ if (usere.search(line)>=0) {
+ //add lib to use list for later parsing
+ QString lib = usere.cap(1);
+ kdDebug(9016) << "usere match [" << lib << "]" << endl;
+ addUseLib(lib);
+ continue;
+ } \
+ }
+ } //base
+
+ if ((isare.search(line)>=0) && (!m_inscript)) {
+ QString parent = isare.cap(1);
+ //create child & parent classes
+ kdDebug(9016) << "isare match [" << parent << "]" << endl;
+ addClass(fileName,lineNo);
+ addParentClass(parent);
+ continue;
+ } //isa
+
+ if ((packagere.search(line)>=0) && (!m_inscript)) {
+ QString package=packagere.cap(1);
+ kdDebug(9016) << "packagere match [" << package << "]" << endl;
+ addPackage(fileName,lineNo,package);
+ continue;
+ }//package
+
+ } // for lines loop
+}
+
+void perlparser::addPackage(const QString& fileName ,int lineNr , const QString& name)
+{
+ kdDebug(9016) << "AddPackage [" << name << "]" << endl;
+ NamespaceDom package = m_model->create<NamespaceModel>();
+
+ package->setName(name);
+ package->setFileName(fileName );
+ package->setStartPosition(lineNr, 0 );
+ package->setScope(name);
+
+ if (!m_file->hasNamespace(name)) {
+ m_file->addNamespace(package);
+ m_lastpackage=package;
+ } else {
+ kdDebug(9016) << "addPackage [" << name << " exist]" << endl;
+ }
+
+ //clear all "last" know things
+ m_lastpackagename=name;
+ m_lastsub="";
+ m_lastattr="";
+ m_inpackage=true;
+ m_inscript = false;
+ m_inclass=false;
+
+ m_lastclass=0;
+ m_lastscript=0;
+
+}
+
+void perlparser::addScript(const QString& fileName ,int lineNr ,const QString& name)
+{
+ kdDebug(9016) << "addScript [" << name << "]" << endl;
+
+ //map name of script under /scripts
+ //m_file->setName("/Scripts/"+name);
+
+ kdDebug(9016) << "addScript [" << name << "]" << endl;
+ NamespaceDom script = m_model->create<NamespaceModel>();
+
+ script->setName(name);
+ script->setFileName(fileName );
+ script->setStartPosition(lineNr, 0 );
+ script->setScope(name);
+
+ if (!m_file->hasNamespace(name)) {
+ m_file->addNamespace(script);
+ m_lastscript=script;
+ } else {
+ kdDebug(9016) << "addScript [" << name << " exist]" << endl;
+ }
+
+ //clear all "last" know things
+ m_lastsub="";
+ m_lastattr="";
+ m_inpackage = false;
+ m_inscript = true;
+ m_inclass=false;
+
+ m_lastscriptname=name;
+ m_lastpackage=0;
+ m_lastclass=0;
+
+}
+
+void perlparser::addAttributetoPackage(const QString& fileName ,int lineNr ,const QString& name)
+{
+ kdDebug(9016) << "addAttributetoPackage [" << name << "]" << endl;
+ VariableDom var = m_model->create<VariableModel>();
+ var->setName(name);
+ var->setFileName( fileName );
+ var->setStartPosition( lineNr, 0 );
+ if (m_lastpackage) {
+ if (!m_lastpackage->hasVariable(var->name()))
+ m_lastpackage->addVariable(var);
+ } else {
+ kdDebug(9016) << "addAttributetoPackge[ no m_file]" << endl;
+ }
+
+ m_lastattr=name;
+}
+
+void perlparser::addAttributetoScript(const QString& fileName ,int lineNr ,const QString& name)
+{
+ kdDebug(9016) << "addAttributetoScript [" << name << "]" << endl;
+ VariableDom var = m_model->create<VariableModel>();
+ var->setName(name);
+ var->setFileName( fileName );
+ var->setStartPosition( lineNr, 0 );
+ if (m_lastscript) {
+ if (!m_lastscript->hasVariable(var->name()))
+ m_lastscript->addVariable(var);
+ } else {
+ kdDebug(9016) << "addAttributeScript[ no m_file]" << endl;
+ }
+}
+
+void perlparser::addClass(const QString& fileName ,int lineNr)
+{
+ kdDebug(9016) << "addClass [ " << m_lastpackagename << " ]" << endl;
+ if (m_lastpackage->hasClass(m_lastpackagename)) {
+ kdDebug(9016) << "Class already defined" << endl;
+ } else {
+ kdDebug(9016) << "new Class" << endl;
+ ClassDom lastClass = m_model->create<ClassModel>();
+ lastClass->setName(m_lastpackagename);
+ lastClass->setFileName(fileName);
+ lastClass->setStartPosition(lineNr, 0);
+ m_lastpackage->addClass(lastClass);
+ m_lastclass=lastClass;
+ m_inclass=true;
+ }
+}
+
+void perlparser::addConstructor(const QString& fileName ,int lineNr ,const QString& name)
+{
+ kdDebug(9016) << "set Constructor["<< name << "]" << endl;
+
+ FunctionDom method;
+
+ if (m_lastpackage->hasFunction(name)) {
+ //remove last sub frompackage scope
+ method = m_lastpackage->functionByName(name)[0];
+ method->getStartPosition(&lineNr,0);
+ m_lastpackage->removeFunction(method);
+ }
+ method = m_lastclass->functionByName(name)[0];
+ if (!method) {
+ kdDebug(9016) << "add new Constructor["<< name << ", " << lineNr << "]" << endl;
+ method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName( fileName );
+ method->setStartPosition( lineNr, 0 );
+ m_lastclass->addFunction(method);
+ }
+ method->setStatic(true);
+ //update class position
+ m_lastclass->setStartPosition(lineNr,0);
+}
+
+void perlparser::addGlobalSub(const QString& fileName ,int lineNr ,const QString& name ,bool privatesub)
+{
+ kdDebug(9016) << "addGlobalSub[ " << name << "]" << endl;
+
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName( fileName );
+ method->setStartPosition( lineNr, 0 );
+ method->setStatic(true);
+ if (privatesub)
+ method->setAccess(CodeModelItem::Private);
+ if (m_lastpackage) {
+ if (!m_lastpackage->hasFunction(method->name()))
+ m_lastpackage->addFunction(method);
+ } else {
+ kdDebug(9016) << "addGlobalsub[ no m_lastpackage]" << endl;
+ }
+
+ //also add seperate to namespace
+ addPackageSub(fileName,lineNr,name,privatesub);
+ m_lastsub=name;
+}
+
+void perlparser::addScriptSub(const QString& fileName ,int lineNr ,const QString& name ,bool privatesub)
+
+{
+ kdDebug(9016) << "addScriptSub[ " << name << "]" << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName( fileName );
+ method->setStartPosition( lineNr, 0 );
+ if (privatesub)
+ method->setAccess(CodeModelItem::Private);
+ if(m_lastscript) {
+ m_lastscript->addFunction(method);
+ } else {
+ }
+
+ m_lastsub=name;
+}
+
+void perlparser::addClassMethod(const QString& fileName ,int lineNr ,const QString& name ,bool privatesub)
+{
+ kdDebug(9016) << "addClassMethod[ " << name << "]" << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName( fileName );
+ method->setStartPosition( lineNr, 0 );
+ method->setVirtual(true);
+ if (privatesub)
+ method->setAccess(CodeModelItem::Private);
+ if (m_lastclass) {
+ if (!m_lastclass->hasFunction(method->name()))
+ m_lastclass->addFunction(method);
+ } else {
+ kdDebug(9016) << "addClassmethod[ no m_lastclass]" << endl;
+ }
+
+// addPackageSub(fileName,lineNr,name,privatesub);
+ m_lastsub=name;
+}
+
+void perlparser::addPackageSub(const QString& fileName ,int lineNr ,const QString& name ,bool privatesub)
+{
+ kdDebug(9016) << "addPackageSub[ " << name << "]" << endl;
+ FunctionDom method = m_model->create<FunctionModel>();
+ method->setName(name);
+ method->setFileName( fileName );
+ method->setStartPosition( lineNr, 0 );
+ if (privatesub)
+ method->setAccess(CodeModelItem::Private);
+ if (m_lastpackage) {
+ if (!m_lastpackage->hasFunction(method->name()))
+ m_lastpackage->addFunction(method);
+ } else {
+ kdDebug(9016) << "addPackageSub[ no m_file]" << endl;
+ }
+ m_lastsub=name;
+}
+
+void perlparser::addParentClass(const QString& parent)
+{
+ kdDebug(9016) << "addParentClass[ " << parent << "]" << endl;
+ if (m_lastclass) {
+ m_lastclass->addBaseClass(parent);
+ } else {
+ kdDebug(9016) << "addParentClass[ no m_lastclass]" << endl;
+ }
+}
+
+void perlparser::addUseLib(const QString& lib)
+{
+ if (!m_model->hasFile(lib)) {
+ if (m_usefiles.findIndex(lib) == -1) {
+ //only add if not already parsed or in the list
+ kdDebug(9016) << "add lib for later parsing [" << lib << "]" << endl;
+ m_usefiles.append(lib);
+ }
+ }
+}
+
+void perlparser::getPerlINC() {
+
+
+ m_INClist.clear();
+
+ QString cmd = "/usr/bin/perl -e\" print join('|',@INC);\"";
+ QString result;
+
+ FILE *fd = popen(cmd.local8Bit().data(), "r");
+ char buffer[4090];
+ QByteArray array;
+
+ while (!feof(fd)) {
+ int n = fread(buffer, 1, 2048, fd);
+ if (n == -1) {
+ pclose(fd);
+ return;
+ }
+ array.setRawData(buffer, n);
+ result=QString::QString(array);
+ array.resetRawData(buffer, n);
+ }
+ pclose(fd);
+ //get INC list so we can use it to parse "use" modules
+ m_INClist = QStringList::split(QString("|"),result);
+ kdDebug(9016) << "INC " << m_INClist.size() << " "<< result << endl;
+}
+
+QString perlparser::findLib( const QString& lib)
+{
+ QString result;
+
+ QString file=lib;
+ file.replace( QRegExp("::"), QString("/"));
+
+ //find the correct path by using the INC list
+ QStringList::Iterator inc = m_INClist.begin();
+ while((inc != m_INClist.end()) && (result.isEmpty()) ) {
+ QFileInfo fi((*inc) + "/" + file + ".pm");
+ if ( fi.exists() ) {
+ result = (*inc) + "/" + file + ".pm";
+ }
+ ++inc;
+ }
+ return result;
+}
+
diff --git a/languages/perl/perlparser.h b/languages/perl/perlparser.h
new file mode 100644
index 00000000..01ded7d8
--- /dev/null
+++ b/languages/perl/perlparser.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ perlparser.h - description
+ -------------------
+ begin : Sun Nov 2 2003
+ copyright : (C) 2003 by luc
+ email : luc@lieve
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 PERLPARSER_H
+#define PERLPARSER_H
+
+#include "kdevlanguagesupport.h"
+#include <codemodel.h>
+
+
+/**perl source to classview parser
+ *@author luc
+ */
+
+class perlparser {
+ public:
+ perlparser(KDevCore* core,CodeModel* model, QString interpreter);
+ perlparser();
+ ~perlparser();
+
+ void initialParse();
+ void parse(const QString &fileName);
+ void parseLines(QStringList* lines,const QString& fileName);
+ const QStringList UseFiles();
+ QString findLib( const QString& lib);
+
+ private:
+ //global functions to add to ClassStore
+ void addPackage(const QString& fileName ,int lineNr , const QString& name);
+ void addAttributetoScript(const QString& fileName ,int lineNr ,const QString& name);
+ void addAttributetoPackage(const QString& fileName ,int lineNr ,const QString& name);
+ void addClass(const QString& fileName ,int lineNr );
+ void addConstructor(const QString& fileName ,int lineNr ,const QString& methodname);
+ void addGlobalSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
+ void addScriptSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
+ void addClassMethod(const QString& fileName ,int lineNr , const QString& name , bool privatesub);
+ void addPackageSub(const QString& fileName ,int lineNr , const QString& name, bool privatesub);
+ void addParentClass(const QString& parent);
+ void addScript(const QString& fileName ,int lineNr , const QString& name);
+ void addUseLib(const QString& lib);
+ void getPerlINC();
+
+ bool m_inpackage;
+ bool m_inscript;
+ bool m_inclass;
+
+ QString m_lastsub;
+ QString m_lastparentclass;
+ QString m_lastattr;
+ QString m_lastpackagename;
+ QString m_lastscriptname;
+
+ NamespaceDom m_lastscript;
+ NamespaceDom m_lastpackage;
+ ClassDom m_lastclass;
+
+ //CodeModel
+ CodeModel* m_model;
+ KDevCore* m_core;
+ FileDom m_file;
+
+ //this willhav a list of INC paths
+ QStringList m_INClist;
+ //this will get a list off all files "use" in the perl files
+ //and need additional parsing to include the classes in the classview
+ QStringList m_usefiles;
+
+ QString m_interpreter;
+
+
+};
+
+#endif
diff --git a/languages/perl/perlsupportpart.cpp b/languages/perl/perlsupportpart.cpp
new file mode 100644
index 00000000..4305644e
--- /dev/null
+++ b/languages/perl/perlsupportpart.cpp
@@ -0,0 +1,330 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "perlsupportpart.h"
+
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdevgenericfactory.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <qregexp.h>
+#include <codemodel.h>
+#include <qprogressbar.h>
+#include <kstatusbar.h>
+#include "kdevmainwindow.h"
+
+#include <kprocess.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugininfo.h"
+#include "kdevappfrontend.h"
+//#include "classstore.h"
+//#include "parsedclass.h"
+//#include "parsedmethod.h"
+//#include "parsedscript.h"
+#include "domutil.h"
+//#include "programmingbycontract.h"
+
+typedef KDevGenericFactory<PerlSupportPart> PerlSupportFactory;
+static const KDevPluginInfo data("kdevperlsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevperlsupport, PerlSupportFactory( data ) )
+
+PerlSupportPart::PerlSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "PerlSupportPart")
+{
+ setInstance(PerlSupportFactory::instance());
+
+ setXMLFile("kdevperlsupport.rc");
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+
+ KAction *action;
+
+ action = new KAction( i18n("Execute Main Program"), "exec", 0,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_exec" );
+ action->setToolTip( i18n("Runs the Perl program") );
+
+ action = new KAction( i18n("Execute String..."), "exec", 0,
+ this, SLOT(slotExecuteString()),
+ actionCollection(), "build_execstring" );
+ action->setToolTip( i18n("Executes a string as Perl code") );
+
+ action = new KAction( i18n("Start Perl Interpreter"), "exec", 0,
+ this, SLOT(slotStartInterpreter()),
+ actionCollection(), "build_runinterpreter" );
+ action->setToolTip( i18n("Starts the Perl interpreter without a program") );
+
+ action = new KAction( i18n("Find Perl Function Documentation..."), 0,
+ this, SLOT(slotPerldocFunction()),
+ actionCollection(), "help_perldocfunction" );
+ action->setToolTip( i18n("Show the documentation page of a Perl function") );
+
+ action = new KAction( i18n("Find Perl FAQ Entry..."), 0,
+ this, SLOT(slotPerldocFAQ()),
+ actionCollection(), "help_perldocfaq" );
+ action->setToolTip( i18n("Show the FAQ entry for a keyword") );
+
+ //perl parser for codemodel
+ m_parser = new perlparser(core(),codeModel(),interpreter());
+}
+
+
+PerlSupportPart::~PerlSupportPart()
+{
+ if (project())
+ projectClosed();
+
+ delete m_parser;
+ m_parser=0;
+}
+
+
+void PerlSupportPart::projectOpened()
+{
+ kdDebug(9007) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+
+void PerlSupportPart::projectClosed()
+{
+}
+
+void PerlSupportPart::maybeParse(const QString fileName)
+{
+ QFileInfo fi(fileName);
+ QString path = fi.filePath();
+ QString extension = fi.extension();
+ if (extension == "pl" || extension == "pm") {
+ kdDebug(9016) << "maybe " << fileName << endl;
+ removeWithReference(fileName);
+ m_parser->parse(fileName);
+ emit addedSourceInfo( fileName);
+ }
+}
+
+void PerlSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9016) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ maybeParse(project()->projectDirectory() + "/" + ( *it ));
+ }
+}
+
+
+void PerlSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9016) << "removedFilesFromProject()" << endl;
+ QStringList::ConstIterator it;
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ removeWithReference(fileName);
+ }
+ emit updatedSourceInfo();
+}
+
+
+void PerlSupportPart::savedFile(const KURL &fileName)
+{
+ Q_UNUSED( fileName.path() );
+#if 0 // not needed anymore
+ kdDebug(9016) << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.mid ( project()->projectDirectory().length() + 1 ))) {
+ maybeParse(fileName);
+ emit updatedSourceInfo();
+ }
+#endif
+}
+
+
+KDevLanguageSupport::Features PerlSupportPart::features()
+{
+ return KDevLanguageSupport::Features(Classes | Functions | Variables | Namespaces | /*Scripts | */NewClass | AddMethod | AddAttribute /*| NewScript*/);
+// return Functions;
+}
+
+QString PerlSupportPart::interpreter()
+{
+ QString prog = DomUtil::readEntry(*projectDom(), "/kdevperlsupport/run/interpreter");
+ if (prog.isEmpty())
+ prog = "perl";
+
+ return prog;
+}
+
+
+void PerlSupportPart::startApplication(const QString &program)
+{
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevperlsupport/run/terminal");
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, inTerminal);
+}
+
+
+void PerlSupportPart::slotExecute()
+{
+ QString program = project()->mainProgram();
+ QString cmd = interpreter() + " " + program;
+ startApplication(cmd);
+}
+
+
+void PerlSupportPart::slotStartInterpreter()
+{
+ startApplication(interpreter());
+}
+
+
+void PerlSupportPart::slotExecuteString()
+{
+ bool ok;
+ QString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), QString::null, &ok, 0);
+ if (ok) {
+ cmd.prepend("'");
+ cmd.append("'");
+ startApplication(cmd);
+ }
+}
+
+
+void PerlSupportPart::slotPerldocFunction()
+{
+ bool ok;
+ QString key = KInputDialog::getText(i18n("Show Perl Documentation"), i18n("Show Perl documentation for function:"), "", &ok, 0);
+ if (ok && !key.isEmpty()) {
+ QString url = "perldoc:functions/";
+ url += key;
+ partController()->showDocument(KURL(url));
+ }
+}
+
+
+void PerlSupportPart::slotPerldocFAQ()
+{
+ bool ok;
+ QString key = KInputDialog::getText(i18n("Show FAQ Entry"), i18n("Show FAQ entry for keyword:"), "", &ok, 0);
+ if (ok && !key.isEmpty()) {
+ QString url = "perldoc:faq/";
+ url += key;
+ partController()->showDocument(KURL(url));
+ }
+}
+KMimeType::List PerlSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-perl" );
+ if( mime )
+ list << mime;
+ return list;
+}
+
+void PerlSupportPart::initialParse()
+{
+ kdDebug(9016) << "initialParse()" << endl;
+
+ if (project()) {
+ //copy from cpp support : give user some feedback
+ mainWindow()->statusBar()->message( i18n("Updating...") );
+ kapp->processEvents( );
+
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ m_parser->initialParse();
+
+ //progress bar
+ QProgressBar* bar = new QProgressBar( files.count( ), mainWindow( )->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow( )->statusBar( )->addWidget( bar );
+ bar->show( );
+ int n = 0;
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+// kdDebug(9016) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ maybeParse(project()->projectDirectory() + "/" + *it);
+ //update progress bar
+ bar->setProgress( n++ );
+ if( (n%5) == 0 )
+ kapp->processEvents();
+ }
+ parseUseFiles();
+ emit updatedSourceInfo();
+
+ //remove progressbar
+ mainWindow( )->statusBar( )->removeWidget( bar );
+ delete bar;
+ kapp->restoreOverrideCursor();
+ mainWindow()->statusBar()->message( i18n("Done") );
+
+ } else {
+ kdDebug(9016) << "No project" << endl;
+ }
+}
+
+void PerlSupportPart::removeWithReference( const QString & fileName )
+{
+ kdDebug(9016) << "remove with references: " << fileName << endl;
+ //m_timestamp.remove( fileName );
+ if( !codeModel()->hasFile(fileName) )
+ return;
+
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+}
+
+void PerlSupportPart::parseUseFiles()
+{
+ kdDebug(9016) << "parse addional libs" << endl;
+ return;
+ QString filename;
+ QStringList m_usefiles = m_parser->UseFiles();
+
+ //parse addional use files
+ for (QStringList::Iterator it = m_usefiles.begin(); it != m_usefiles.end() ;++it)
+ {
+ filename = m_parser->findLib(*it);
+ //if something found , parse it
+ if (!filename.isEmpty()) {
+ //kdDebug(9016) << "found " << filename << endl;
+ maybeParse(filename);
+ }
+ }
+}
+
+#include "perlsupportpart.moc"
diff --git a/languages/perl/perlsupportpart.h b/languages/perl/perlsupportpart.h
new file mode 100644
index 00000000..91765a47
--- /dev/null
+++ b/languages/perl/perlsupportpart.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PERLSUPPORTPART_H_
+#define _PERLSUPPORTPART_H_
+
+#include "kdevlanguagesupport.h"
+#include <codemodel.h>
+#include "perlparser.h"
+
+class PerlSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ PerlSupportPart( QObject *parent, const char *name, const QStringList & );
+ ~PerlSupportPart();
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotExecute();
+ void slotExecuteString();
+ void slotStartInterpreter();
+
+ // Internal
+ void initialParse();
+ void slotPerldocFunction();
+ void slotPerldocFAQ();
+
+private:
+ QString interpreter();
+ void startApplication(const QString &program);
+ void maybeParse(const QString fileName);
+ void parse(const QString &fileName);
+ void parseLines(QStringList* lines,const QString& fileName);
+ void removeWithReference( const QString & fileName );
+ void parseUseFiles();
+ //Perl Parser
+ perlparser* m_parser;
+
+};
+
+#endif
diff --git a/languages/php/Makefile.am b/languages/php/Makefile.am
new file mode 100644
index 00000000..ac053aaf
--- /dev/null
+++ b/languages/php/Makefile.am
@@ -0,0 +1,24 @@
+# Here resides the PHP support part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+SUBDIRS = data app_templates file_templates doc
+
+
+kde_module_LTLIBRARIES = libkdevphpsupport.la
+libkdevphpsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevphpsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML)
+
+libkdevphpsupport_la_SOURCES = phpsupportpart.cpp phpconfigwidgetbase.ui phpconfigwidget.cpp phpinfodlg.ui phphtmlview.cpp phperrorview.cpp phpconfigdata.cpp phpcodecompletion.cpp phpparser.cpp phpnewclassdlgbase.ui phpnewclassdlg.cpp phpfile.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevphpsupport.desktop
+
+rcdir = $(kde_datadir)/kdevphpsupport
+rc_DATA = kdevphpsupport.rc
+
+templatedir = ${kde_datadir}/kdevabbrev/templates
+template_DATA = phptemplates
diff --git a/languages/php/README.dox b/languages/php/README.dox
new file mode 100644
index 00000000..14e69997
--- /dev/null
+++ b/languages/php/README.dox
@@ -0,0 +1,32 @@
+/** \class PHPSupportPart
+This is PHP language support plugin.
+
+Support for the <a href="http://www.php.net">PHP Language</a>, you can
+develop php script for web or php script for shell.
+
+It's support checking of your script with problems report and also parse
+all include files from your script.
+
+\authors <a href="mailto:smeier AT kdevelop.org">Sandy Meier</a>
+\authors <a href="mailto:n.escuder AT intra-links.com">Escuder Nicolas</a>
+
+\maintainer <a href="mailto:smeier AT kdevelop.org">Sandy Meier</a>
+\maintainer <a href="mailto:n.escuder AT intra-links.com">Escuder Nicolas</a>
+
+\feature PHP language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=php+support&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">php support component at Bugzilla database</a>
+
+\requirement PHP Cli Version or WebServer with php
+
+\todo extended classtools (new class,new function...) based on filetemplates
+\todo debugger and profiler support dbg (http://dd.cron.ru/dbg)
+\todo html form support (dialogs for generating html code, tables...)
+\todo support for phpdoc
+\todo documentation viewer for php (maybe plugins for the current docviewer) (tf)
+\todo integrated filemanager with ftp client (maybe a konqueror part)
+\todo code template factory (contains useful php code snippet like array_display,trace,validator)
+\todo new functions list from php 5 documentation
+
+*/
diff --git a/languages/php/app_templates/Makefile.am b/languages/php/app_templates/Makefile.am
new file mode 100644
index 00000000..12fdee76
--- /dev/null
+++ b/languages/php/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = phphello
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PHPIDE
+profiles_DATA = php.appwizard
diff --git a/languages/php/app_templates/php.appwizard b/languages/php/app_templates/php.appwizard
new file mode 100644
index 00000000..5cddaac5
--- /dev/null
+++ b/languages/php/app_templates/php.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=phphello
diff --git a/languages/php/app_templates/phphello/.kdev_ignore b/languages/php/app_templates/phphello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/php/app_templates/phphello/.kdev_ignore
diff --git a/languages/php/app_templates/phphello/Makefile.am b/languages/php/app_templates/phphello/Makefile.am
new file mode 100644
index 00000000..12d29f1b
--- /dev/null
+++ b/languages/php/app_templates/phphello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.php app.kdevelop
+templateName = phphello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/php/app_templates/phphello/app.kdevelop b/languages/php/app_templates/phphello/app.kdevelop
new file mode 100644
index 00000000..c8844e1e
--- /dev/null
+++ b/languages/php/app_templates/phphello/app.kdevelop
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>PHP</primarylanguage>
+ <keywords>
+ <keyword>PHP</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir></activedir>
+ <includepatterns>*.php,*.phps,*.php3,*.inc</includepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+<kdevphpsupport>
+ <codeHelp>
+ <codeCompletion>true</codeCompletion>
+ <codeHinting>true</codeHinting>
+ <realtimeParsing>true</realtimeParsing>
+ </codeHelp>
+</kdevphpsupport>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="php"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.php;*.phps;*.php3" name="PHP files" />
+ <group pattern="*.inc" name="Include files" />
+ </groups>
+ </kdevfileview>
+</kdevelop>
diff --git a/languages/php/app_templates/phphello/app.php b/languages/php/app_templates/phphello/app.php
new file mode 100644
index 00000000..c6a62b4f
--- /dev/null
+++ b/languages/php/app_templates/phphello/app.php
@@ -0,0 +1,28 @@
+<?php
+
+%{PHP_TEMPLATE}
+
+printHeader();
+echo "<h1>Hello World!</h1>\n";
+printFooter();
+
+function printHeader(){
+ echo <<<EOF
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta name="description" content="" />
+ <meta name="author" content="%{AUTHOR}" />
+ <meta name="keywords" content="" />
+ <title>%{APPNAME}</title>
+</head>
+<body>
+
+EOF;
+}
+
+function printFooter(){
+ echo "</body>\n</html>";
+}
+
+?>
diff --git a/languages/php/app_templates/phphello/phphello b/languages/php/app_templates/phphello/phphello
new file mode 100644
index 00000000..f9f1a69f
--- /dev/null
+++ b/languages/php/app_templates/phphello/phphello
@@ -0,0 +1,25 @@
+# KDE Config File
+[General]
+Name=Simple PHP script
+Name[fr]=Un simple script de test Hello world
+Category=PHP
+Comment=This generates a simplistic 'Hello world' program in PHP (http://www.php.net)
+Comment[fr]=Gnre un simple script de test du type Hello world dans le language PHP (http://www.php.net).
+DefaultDestinatonDir=HOMEDIR/public_html
+FileTemplates=php,CPPStyle
+ShowFilesAfterGeneration=%{APPNAMELC}.php
+Archive=phphello.tar.gz
+
+[PROJECT]
+Type=install
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[APP.PHP]
+Type=install
+Source=%{src}/app.php
+Dest=%{dest}/%{APPNAMELC}.php
+
+[MGS]
+Type=message
+Comment=A simple PHP project was created in %{dest}.
diff --git a/languages/php/app_templates/phphello/phphello.kdevtemplate b/languages/php/app_templates/phphello/phphello.kdevtemplate
new file mode 100644
index 00000000..8d52f490
--- /dev/null
+++ b/languages/php/app_templates/phphello/phphello.kdevtemplate
@@ -0,0 +1,108 @@
+# KDE Config File
+[General]
+Name=Simple PHP script
+Name[ca]=Simple script en PHP
+Name[da]=Simpelt PHP script
+Name[de]=Einfaches PHP-Skript
+Name[el]=Απλό σενάριο PHP
+Name[es]=Guión sencillo en PHP
+Name[et]=Lihtne PHP skript
+Name[eu]=PHP script sinplea
+Name[fa]=دست‌نوشتۀ سادۀ پی‌اچ‌پی
+Name[fr]=Script PHP simple
+Name[ga]=Script Simplí PHP
+Name[gl]=Script sinxelo en PHP
+Name[hu]=Egyszerű PHP-szkript
+Name[it]=Semplice script PHP
+Name[ja]=簡単な PHP スクリプト
+Name[nds]=Eenfach PHP-Skript
+Name[ne]=साधारण पी एच पी स्क्रिप्ट
+Name[nl]=Eenvoudig PHP-script
+Name[pl]=Prosty skrypt w PHP
+Name[pt]=Programa simples em PHP
+Name[pt_BR]=Programa simples em PHP
+Name[ru]=Простой скрипт PHP
+Name[sk]=Jednoduchý PHP skript
+Name[sr]=Једноставна PHP скрипта
+Name[sr@Latn]=Jednostavna PHP skripta
+Name[sv]=Enkelt PHP-skript
+Name[tr]=Basit PHP betiği
+Name[zh_CN]=简单 PHP 脚本
+Name[zh_TW]=簡單的 PHP 文稿
+Category=PHP
+Comment=This generates a simplistic 'Hello world' program in PHP (http://www.php.net)
+Comment[ca]=Genera un simple programa de 'Hello world' en PHP (http://www.php.net)
+Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i PHP (http://www.php.net)
+Comment[de]=Hiermit wird ein einfaches "Hello World"-Programm in PHP erstellt (http://www.php.net).
+Comment[el]=Αυτό δημιουργεί ένα πρόγραμμα 'Γεια σου κόσμε' σε PHP (http://www.php.net)
+Comment[es]=Genera un programa «Hola mundo» sencillo en PHP (http://www.php.net)
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine PHP-s (http://www.php.net)
+Comment[eu]=Honek PHP-n (http://www.php.net) idatzitako "Kaixo mundua" programa sinple bat sortzen du
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در پی‌اچ‌پی ( http://www.php.net)تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en PHP (http://www.php.net)
+Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello world" i PHP (http://www.php.net/)
+Comment[gl]=Isto xera un programa sinxelo en PHP 'Ola mundo'(http://www.php.net)
+Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot PHP-ban (http://www.php.net)
+Comment[it]=Genera un semplice programma di "Hello world" in PHP (http://www.php.net)
+Comment[ja]=PHP で書かれた簡単な Hello world プログラムを作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm in PHP op. (http://www.php.net)
+Comment[ne]=यसले पी एच पी मा साधारण 'हेल्लो वोल्ड' कार्यक्रम उत्पन्न गर्दछ(http://www.php.net)
+Comment[nl]=Dit genereert een eenvoudig 'Hello World'-programma in PHP (http://www.php.net)
+Comment[pl]=Generuje prosty program "Witaj świecie" w PHP (http://www.php.net)
+Comment[pt]=Isto gera uma programa simples 'Olá Mundo' em PHP (http://www.php.net)
+Comment[pt_BR]=Isto gera uma programa simples 'Olá Mundo' em PHP (http://www.php.net)
+Comment[ru]=Создание простой программы 'Hello world' на PHP (http://www.php.net)
+Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v PHP (http://www.php.net)
+Comment[sr]=Ово прави једноставан „Здраво свете“ програм у PHP-у (http://www.php.net)
+Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ program u PHP-u (http://www.php.net)
+Comment[sv]=Detta skapar ett förenklat 'Hello world'-program i PHP (http://www.php.net)
+Comment[tr]=Bu PHP'de basit bir "Merhaba Dünya "programı yaratır (http://www.php.net)
+Comment[zh_CN]=这将生成一个简单的 PHP 语言“Hello world”程序
+Comment[zh_TW]=產生一個 PHP(http://www.php.net)的 Hello world 程式
+DefaultDestinatonDir=HOMEDIR/public_html
+FileTemplates=php,CPPStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.php
+Archive=phphello.tar.gz
+
+[PROJECT]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[APP.PHP]
+Type=install
+Source=%{src}/app.php
+Dest=%{dest}/%{APPNAMELC}.php
+
+[MGS]
+Type=message
+Comment=A simple PHP project was created in %{dest}.
+Comment[ca]=Un simple projecte en PHP ha estat creat en %{dest}.
+Comment[da]=Et simpelt PHP projekt blev oprettet i %{dest}.
+Comment[de]=Ein einfaches PHP-Projekt wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό έργο PHP δημιουργήθηκε στο %{dest}.
+Comment[es]=Un sencillo proyecto en PHP ha sido creado en %{dest}.
+Comment[et]=Lihtne PHP projekt loodi asukohta %{dest}.
+Comment[eu]=PHP-n idatzitako programa sinple bat sortu da hemen: %{dest}.
+Comment[fa]=یک پروژۀ سادۀ پی‌اچ‌پی در %{dest} ایجاد شد.
+Comment[fr]=Un projet PHP simple a été créé dans %{dest}.
+Comment[ga]=Cruthaíodh tionscadal simplí PHP i %{dest}
+Comment[gl]=Creouse un proxecto sinxelo en PHP en %{dest}
+Comment[hu]=Létrejött egy egyszerű PHP-alapú projekt itt: %{dest}.
+Comment[it]=È stato creato un semplice progetto PHP in %{dest}.
+Comment[ja]=簡単な PHP プロジェクトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach PHP-Projekt opstellt.
+Comment[ne]=साधारण PHP परियोजना %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig PHP-project is aangemaakt in %{dest}.
+Comment[pl]=Prosty projekt w PHP został utworzony w %{dest}.
+Comment[pt]=Foi criado um projecto simples em PHP em %{dest}.
+Comment[pt_BR]=Foi criado um projecto simples em PHP em %{dest}.
+Comment[ru]=Простой скрипт PHP создан в %{dest}.
+Comment[sk]=Jednoduchý PHP projekt bol vytvorený v %{dest}.
+Comment[sr]=Једноставан PHP пројекат направљен је у %{dest}.
+Comment[sr@Latn]=Jednostavan PHP projekat napravljen je u %{dest}.
+Comment[sv]=Ett enkelt PHP-projekt skapades i %{dest}.
+Comment[tr]=Basit bir PHP projesi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 PHP 工程。
+Comment[zh_TW]=一個簡單的 PHP 專案已建立於 %{dest}
diff --git a/languages/php/app_templates/phphello/phphello.png b/languages/php/app_templates/phphello/phphello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/php/app_templates/phphello/phphello.png
Binary files differ
diff --git a/languages/php/data/Makefile.am b/languages/php/data/Makefile.am
new file mode 100644
index 00000000..e54b0415
--- /dev/null
+++ b/languages/php/data/Makefile.am
@@ -0,0 +1,6 @@
+phpsupportdatadir = ${kde_datadir}/kdevphpsupport
+
+install-data-local:
+ mkdir -p $(DESTDIR)$(phpsupportdatadir)
+ $(INSTALL_DATA) $(srcdir)/phpfunctions $(DESTDIR)$(phpsupportdatadir)/phpfunctions
+
diff --git a/languages/php/data/phpfunctions b/languages/php/data/phpfunctions
new file mode 100644
index 00000000..d0897bd5
--- /dev/null
+++ b/languages/php/data/phpfunctions
@@ -0,0 +1,1657 @@
+CODING_STANDARDS:int abs(int number)
+CODING_STANDARDS:object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
+README:bool my_drawtext(resource image, string text, resource font, int x, int y[, int color])
+zend_builtin_functions:int strlen(string str)
+zend_builtin_functions:int strcmp(string str1, string str2)
+zend_builtin_functions:int strncmp(string str1, string str2, int len)
+zend_builtin_functions:int strcasecmp(string str1, string str2)
+zend_builtin_functions:int strncasecmp(string str1, string str2, int len)
+zend_builtin_functions:string get_class(object object)
+zend_builtin_functions:string get_parent_class(object object)
+zend_builtin_functions:bool is_subclass_of(object object, string class_name)
+zend_builtin_functions:array get_class_vars(string class_name)
+zend_builtin_functions:array get_object_vars(object obj)
+zend_builtin_functions:array get_class_methods(string class_name)
+zend_builtin_functions:bool method_exists(object object, string method)
+zend_builtin_functions:bool class_exists(string classname)
+zend_builtin_functions:bool function_exists(string function_name)
+zend_builtin_functions:array get_included_files(void)
+zend_builtin_functions:void trigger_error(string messsage [, int error_type])
+zend_builtin_functions:string set_error_handler(string error_handler)
+zend_builtin_functions:void restore_error_handler(void)
+zend_builtin_functions:array get_declared_classes(void)
+zend_builtin_functions:string create_function(string args, string code)
+aspell:int aspell_new(string master [, string personal])
+aspell:array aspell_suggest(aspell int, string word)
+aspell:int aspell_check(aspell int, string word)
+aspell:int aspell_check_raw(aspell int, string word)
+bcmath:string bcadd(string left_operand, string right_operand [, int scale])
+bcmath:string bcsub(string left_operand, string right_operand [, int scale])
+bcmath:string bcmul(string left_operand, string right_operand [, int scale])
+bcmath:string bcdiv(string left_operand, string right_operand [, int scale])
+bcmath:string bcmod(string left_operand, string right_operand)
+bcmath:string bcpow(string x, string y [, int scale])
+bcmath:string bcsqrt(string operand [, int scale])
+bcmath:string bccomp(string left_operand, string right_operand [, int scale])
+bcmath:string bcscale(int scale)
+cal_unix:int unixtojd([int timestamp])
+cal_unix:int jdtounix(int jday)
+calendar:string jdtogregorian(int juliandaycount)
+calendar:int gregoriantojd(int month, int day, int year)
+calendar:string jdtojulian(int juliandaycount)
+calendar:int juliantojd(int month, int day, int year)
+calendar:string jdtojewish(int juliandaycount)
+calendar:int jewishtojd(int month, int day, int year)
+calendar:string jdtofrench(int juliandaycount)
+calendar:int frenchtojd(int month, int day, int year)
+calendar:mixed jddayofweek(int juliandaycount [, int mode])
+calendar:string jdmonthname(int juliandaycount, int mode)
+easter:int easter_date([int year])
+easter:int easter_days([int year])
+ccvs:string ccvs_init(string name)
+ccvs:string ccvs_done(string sess)
+ccvs:string ccvs_new(string session, string invoice)
+ccvs:string ccvs_add(string session, string invoice, string argtype, string argval)
+ccvs:string ccvs_delete(string session, string invoice)
+ccvs:string ccvs_auth(string session, string invoice)
+ccvs:string ccvs_return(string session, string invoice)
+ccvs:string ccvs_reverse(string session, string invoice)
+ccvs:string ccvs_sale(string session, string invoice)
+ccvs:string ccvs_void(string session, string invoice)
+ccvs:string ccvs_status(string session, string invoice)
+ccvs:int ccvs_count(string session, string type)
+ccvs:string ccvs_lookup(string session, string invoice, int inum)
+ccvs:string ccvs_report(string session, string type)
+ccvs:string ccvs_command(string session, string type, string argval)
+ccvs:string ccvs_textvalue(string session)
+COM:int com_load(string module_name)
+COM:mixed com_invoke(int module, string handler_name [, mixed arg [, ...]])
+COM:mixed com_propget(int module, string property_name)
+COM:bool com_propput(int module, string property_name, mixed value)
+cpdf:void cpdf_global_set_document_limits(int maxPages, int maxFonts, int maxImages, int maxAnnots, int maxObjects)
+cpdf:bool cpdf_set_creator(int pdfdoc, string creator)
+cpdf:bool cpdf_set_title(int pdfptr, string title)
+cpdf:bool cpdf_set_subject(int pdfptr, string subject)
+cpdf:bool cpdf_set_keywords(int pdfptr, string keywords)
+cpdf:void cpdf_set_viewer_preferences(int pdfdoc, int pagemode)
+cpdf:int cpdf_open(int compression [, string filename [, array doc_limits]])
+cpdf:void cpdf_close(int pdfdoc)
+cpdf:void cpdf_page_init(int pdfdoc, int pagenr, int orientation, int height, int width [, double unit])
+cpdf:void cpdf_finalize_page(int pdfdoc, int pagenr)
+cpdf:void cpdf_set_current_page(int pdfdoc, int pagenr)
+cpdf:void cpdf_begin_text(int pdfdoc)
+cpdf:void cpdf_end_text(int pdfdoc)
+cpdf:void cpdf_show(int pdfdoc, string text)
+cpdf:void cpdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor [, int mode])
+cpdf:void cpdf_continue_text(int pdfdoc, string text)
+cpdf:void cpdf_text(int pdfdoc, string text [, double x-koor, double y-koor [, int mode [, double orientation [, int alignmode]]]])
+cpdf:void cpdf_set_font(int pdfdoc, string font, double size, string encoding)
+cpdf:void cpdf_set_leading(int pdfdoc, double distance)
+cpdf:void cpdf_set_text_rendering(int pdfdoc, int rendermode)
+cpdf:void cpdf_set_horiz_scaling(int pdfdoc, double scale)
+cpdf:void cpdf_set_text_rise(int pdfdoc, double value)
+cpdf:void cpdf_set_text_matrix(int pdfdoc, arry matrix)
+cpdf:void cpdf_set_text_pos(int pdfdoc, double x, double y [, int mode])
+cpdf:void cpdf_rotate_text(int pdfdoc, double angle)
+cpdf:void cpdf_set_char_spacing(int pdfdoc, double space)
+cpdf:void cpdf_set_word_spacing(int pdfdoc, double space)
+cpdf:double cpdf_stringwidth(int pdfdoc, string text)
+cpdf:void cpdf_save(int pdfdoc)
+cpdf:void cpdf_restore(int pdfdoc)
+cpdf:void cpdf_translate(int pdfdoc, double x, double y)
+cpdf:void cpdf_scale(int pdfdoc, double x-scale, double y-scale)
+cpdf:void cpdf_rotate(int pdfdoc, double angle)
+cpdf:void cpdf_setflat(int pdfdoc, double value)
+cpdf:void cpdf_setlinejoin(int pdfdoc, int value)
+cpdf:void cpdf_setlinecap(int pdfdoc, int value)
+cpdf:void cpdf_setmiterlimit(int pdfdoc, double value)
+cpdf:void cpdf_setlinewidth(int pdfdoc, double width)
+cpdf:void cpdf_setdash(int pdfdoc, long white, long black)
+cpdf:void cpdf_moveto(int pdfdoc, double x, double y [, int mode])
+cpdf:void cpdf_rmoveto(int pdfdoc, double x, double y [, int mode])
+cpdf:void cpdf_curveto(int pdfdoc, double x1, double y1, double x2, double y2, double x3, double y3 [, int mode])
+cpdf:void cpdf_lineto(int pdfdoc, double x, double y [, int mode])
+cpdf:void cpdf_rlineto(int pdfdoc, double x, double y [, int mode])
+cpdf:void cpdf_circle(int pdfdoc, double x, double y, double radius [, int mode])
+cpdf:void cpdf_arc(int pdfdoc, double x, double y, double radius, double start, double end [, int mode])
+cpdf:void cpdf_rect(int pdfdoc, double x, double y, double width, double height [, int mode])
+cpdf:void cpdf_newpath(int pdfdoc)
+cpdf:void cpdf_closepath(int pdfdoc)
+cpdf:void cpdf_closepath_stroke(int pdfdoc)
+cpdf:void cpdf_stroke(int pdfdoc)
+cpdf:void cpdf_fill(int pdfdoc)
+cpdf:void cpdf_fill_stroke(int pdfdoc)
+cpdf:void cpdf_closepath_fill_stroke(int pdfdoc)
+cpdf:void cpdf_clip(int pdfdoc)
+cpdf:void cpdf_setgray_fill(int pdfdoc, double value)
+cpdf:void cpdf_setgray_stroke(int pdfdoc, double value)
+cpdf:void cpdf_setgray(int pdfdoc, double value)
+cpdf:void cpdf_setrgbcolor_fill(int pdfdoc, double red, double green, double blue)
+cpdf:void cpdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double blue)
+cpdf:void cpdf_setrgbcolor(int pdfdoc, double red, double green, double blue)
+cpdf:void cpdf_set_page_animation(int pdfdoc, int transition, double duration, double direction, int orientation, int inout)
+cpdf:array cpdf_finalize(int pdfdoc)
+cpdf:array cpdf_output_buffer(int pdfdoc)
+cpdf:array cpdf_save_to_file(int pdfdoc, string filename)
+cpdf:void cpdf_import_jpeg(int pdfdoc, string filename, double x, double y, double angle, double width, double height, double x-scale, double y-scale, int gsave [, int mode])
+cpdf:void cpdf_place_inline_image(int pdfdoc, int gdimage, double x, double y, double angle, fload width, float height, int gsave [, int mode])
+cpdf:void cpdf_add_annotation(int pdfdoc, double xll, double yll, double xur, double xur, string title, string text [, int mode])
+cpdf:void cpdf_set_action_url(int pdfdoc, double xll, double yll, double xur, double xur, string url [, int mode])
+cpdf:int cpdf_add_outline(int pdfdoc, int lastoutline, int sublevel, int open, int pagenr, string title)
+curl:string curl_version(void)
+curl:int curl_init([string url])
+curl:bool curl_setopt(int ch, string option, mixed value)
+curl:bool curl_exec(int ch)
+curl:string curl_error(int ch)
+curl:int curl_errno(int ch)
+curl:void curl_close(int ch)
+dav:void dav_set_mkcol_handlers(string test, string create)
+db:string dblist(void)
+db:int dbmopen(string filename, string mode)
+db:bool dbmclose(int dbm_identifier)
+db:int dbminsert(int dbm_identifier, string key, string value)
+db:int dbmreplace(int dbm_identifier, string key, string value)
+db:string dbmfetch(int dbm_identifier, string key)
+db:int dbmexists(int dbm_identifier, string key)
+db:int dbmdelete(int dbm_identifier, string key)
+db:string dbmfirstkey(int dbm_identifier)
+db:string dbmnextkey(int dbm_identifier, string key)
+dba:int dba_popen(string path, string mode, string handlername [, string ...])
+dba:int dba_open(string path, string mode, string handlername [, string ...])
+dba:void dba_close(int handle)
+dba:bool dba_exists(string key, int handle)
+dba:string dba_fetch(string key, int handle)
+dba:string dba_firstkey(int handle)
+dba:string dba_nextkey(int handle)
+dba:bool dba_delete(string key, int handle)
+dba:bool dba_insert(string key, string value, int handle)
+dba:bool dba_replace(string key, string value, int handle)
+dba:bool dba_optimize(int handle)
+dba:bool dba_sync(int handle)
+dbase:int dbase_open(string name, int mode)
+dbase:bool dbase_close(int identifier)
+dbase:int dbase_numrecords(int identifier)
+dbase:int dbase_numfields(int identifier)
+dbase:bool dbase_pack(int identifier)
+dbase:bool dbase_add_record(int identifier, array data)
+dbase:bool dbase_replace_record(int identifier, array data, int recnum)
+dbase:bool dbase_delete_record(int identifier, int record)
+dbase:array dbase_get_record(int identifier, int record)
+dbase:array dbase_get_record_with_names(int identifier, int record)
+dbase:bool dbase_create(string filename, array fields)
+domxml:string domxml_test(int id)
+domxml:string domxml_attrname([int dir_handle])
+domxml:class domxml_node(string name)
+domxml:string domxml_lastchild([int node])
+domxml:string domxml_parent([int node])
+domxml:string domxml_children([int node])
+domxml:string domxml_getattr([int node,] string attrname)
+domxml:bool domxml_setattr([int node,] string attrname, string value)
+domxml:array domxml_attributes([int node])
+domxml:string domxml_rootnew([int doc])
+domxml:string domxml_root([int doc_handle])
+domxml:string domxml_dtd([int doc_handle])
+domxml:string domxml_dumpmem([int doc_handle])
+domxml:class xmldoc(string xmldoc)
+domxml:class xmldocfile(string filename)
+domxml:string domxml_new_child([int node_handle,] string name, string content)
+domxml:string domxml_add_root([int doc_handle,] string name)
+domxml:class domxml_new_xmldoc(string version)
+domxml:string node_namespace([int node])
+domxml:string node_attributes([int node])
+domxml:string node_children([int node])
+domxml:class xmltree(string xmldoc)
+dotnet:int dotnet_load(string module_name)
+exif:string read_exif_data(string filename)
+fdf:int fdf_open(string filename)
+fdf:void fdf_close(int fdfdoc)
+fdf:void fdf_create(void)
+fdf:void fdf_get_value(int fdfdoc, string fieldname)
+fdf:void fdf_set_value(int fdfdoc, string fieldname, string value, int isName)
+fdf:void fdf_next_field_name(int fdfdoc [, string fieldname])
+fdf:void fdf_set_ap(int fdfdoc, string fieldname, int face, string filename, int pagenr)
+fdf:void fdf_set_status(int fdfdoc, string status)
+fdf:void fdf_get_status(int fdfdoc)
+fdf:void fdf_set_file(int fdfdoc, string filename)
+fdf:void fdf_get_file(int fdfdoc)
+fdf:void fdf_save(int fdfdoc, string filename)
+fdf:void fdf_add_template(int fdfdoc, int newpage, string filename, string template, int rename)
+fdf:void fdf_set_flags(int fdfdoc, string fieldname, int whichFlags, int newFlags)
+fdf:void fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name)
+fdf:void fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichTrigger, string url, int flags)
+fdf:void fdf_set_javascript_action(int fdfdoc, string fieldname, int whichTrigger, string script)
+filepro:bool filepro(string directory)
+filepro:int filepro_rowcount(void)
+filepro:string filepro_fieldname(int fieldnumber)
+filepro:string filepro_fieldtype(int field_number)
+filepro:int filepro_fieldwidth(int field_number)
+filepro:int filepro_fieldcount(void)
+filepro:string filepro_retrieve(int row_number, int field_number)
+ftp:int ftp_connect(string host [, int port])
+ftp:int ftp_login(int stream, string username, string password)
+ftp:string ftp_pwd(int stream)
+ftp:int ftp_cdup(int stream)
+ftp:int ftp_chdir(int stream, string directory)
+ftp:int ftp_exec(int stream, string command)
+ftp:string ftp_mkdir(int stream, string directory)
+ftp:int ftp_rmdir(int stream, string directory)
+ftp:array ftp_nlist(int stream, string directory)
+ftp:array ftp_rawlist(int stream, string directory)
+ftp:string ftp_systype(int stream)
+ftp:int ftp_fget(int stream, int fp, string remote_file, int mode)
+ftp:int ftp_pasv(int stream, int pasv)
+ftp:int ftp_get(int stream, string local_file, string remote_file, int mode)
+ftp:int ftp_fput(int stream, string local_file, string remote_file, int mode)
+ftp:int ftp_put(int stream, string remote_file, string local_file, int mode)
+ftp:int ftp_size(int stream, string path)
+ftp:int ftp_mdtm(int stream, string path)
+ftp:int ftp_rename(int stream, string src, string dest)
+ftp:int ftp_delete(int stream, string path)
+ftp:int ftp_site(int stream, string cmd)
+ftp:int ftp_quit(int stream)
+gd:int imageloadfont(string filename)
+gd:int imagecreate(int x_size, int y_size)
+gd:int imagetypes(void)
+gd:int imagecreatefromgif(string filename)
+gd:int imagecreatefromjpeg(string filename)
+gd:int imagecreatefrompng(string filename)
+gd:int imagecreatefromxbm(string filename)
+gd:int imagecreatefromwbmp(string filename)
+gd:int imagegif(int im [, string filename])
+gd:int imagepng(int im [, string filename])
+gd:int imagejpeg(int im [, string filename [, int quality]])
+gd:int imagewbmp(int im [, string filename])
+gd:int imagedestroy(int im)
+gd:int imagecolorallocate(int im, int red, int green, int blue)
+gd:int imagepalettecopy(int dst, int src)
+gd:int imagecolorat(int im, int x, int y)
+gd:int imagecolorclosest(int im, int red, int green, int blue)
+gd:int imagecolorclosesthwb(int im, int red, int green, int blue)
+gd:int imagecolordeallocate(int im, int index)
+gd:int imagecolorresolve(int im, int red, int green, int blue)
+gd:int imagecolorexact(int im, int red, int green, int blue)
+gd:int imagecolorset(int im, int col, int red, int green, int blue)
+gd:array imagecolorsforindex(int im, int col)
+gd:int imagegammacorrect(int im, double inputgamma, double outputgamma)
+gd:int imagesetpixel(int im, int x, int y, int col)
+gd:int imageline(int im, int x1, int y1, int x2, int y2, int col)
+gd:int imagedashedline(int im, int x1, int y1, int x2, int y2, int col)
+gd:int imagerectangle(int im, int x1, int y1, int x2, int y2, int col)
+gd:int imagefilledrectangle(int im, int x1, int y1, int x2, int y2, int col)
+gd:int imagearc(int im, int cx, int cy, int w, int h, int s, int e, int col)
+gd:int imagefilltoborder(int im, int x, int y, int border, int col)
+gd:int imagefill(int im, int x, int y, int col)
+gd:int imagecolorstotal(int im)
+gd:int imagecolortransparent(int im [, int col])
+gd:int imageinterlace(int im [, int interlace])
+gd:int imagepolygon(int im, array point, int num_points, int col)
+gd:int imagefilledpolygon(int im, array point, int num_points, int col)
+gd:int imagefontwidth(int font)
+gd:int imagefontheight(int font)
+gd:int imagechar(int im, int font, int x, int y, string c, int col)
+gd:int imagecharup(int im, int font, int x, int y, string c, int col)
+gd:int imagestring(int im, int font, int x, int y, string str, int col)
+gd:int imagestringup(int im, int font, int x, int y, string str, int col)
+gd:int imagecopy(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h)
+gd:int imagecopymerge(int src_im, int dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct)
+gd:int imagecopyresized(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h)
+gd:int imagesx(int im)
+gd:int imagesy(int im)
+gd:array imagettfbbox(int size, int angle, string font_file, string text)
+gd:array imagettftext(int im, int size, int angle, int x, int y, int col, string font_file, string text)
+gd:int imagepsloadfont(string pathname)
+gd:bool imagepsfreefont(int font_index)
+gd:bool imagepsencodefont(int font_index, string filename)
+gd:bool imagepsextendfont(int font_index, double extend)
+gd:bool imagepsslantfont(int font_index, double slant)
+gd:array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, double angle, int antialias])
+gd:array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle])
+gdt1:int imagepsloadfont(string pathname)
+gdt1:bool imagepsfreefont(int font_index)
+gdt1:bool imagepsencodefont(int font_index, string filename)
+gdt1:bool imagepsextendfont(int font_index, double extend)
+gdt1:bool imagepsslantfont(int font_index, double slant)
+gdt1:array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, double angle, int antialias])
+gdt1:array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle])
+gettext:string textdomain(string domain)
+gettext:string gettext(string msgid)
+gettext:string dgettext(string domain_name, string msgid)
+gettext:string dcgettext(string domain_name, string msgid, long category)
+gettext:string bindtextdomain(string domain_name, string dir)
+hw:int hw_connect(string host, int port [string username [, string password]])
+hw:int hw_pconnect(string host, int port [, string username [, string password]])
+hw:void hw_close(int link)
+hw:void hw_info(int link)
+hw:int hw_error(int link)
+hw:string hw_errormsg(int link)
+hw:int hw_root(void)
+hw:string hw_stat(int link)
+hw:array hw_who(int link)
+hw:string hw_dummy(int link, int id, int msgid)
+hw:string hw_getobject(int link, int objid [, string linkroot])
+hw:int hw_insertobject(int link, string objrec, string parms)
+hw:string hw_getandlock(int link, int objid)
+hw:void hw_unlock(int link, int objid)
+hw:void hw_deleteobject(int link, int objid)
+hw:void hw_changeobject(int link, int objid, array attributes)
+hw:void hw_modifyobject(int link, int objid, array remattributes, array addattributes [, int mode])
+hw:void hw_mv(int link, array objrec, int from, int dest)
+hw:void hw_cp(int link, array objrec, int dest)
+hw:hwdoc hw_gettext(int link, int objid [, int rootid])
+hw:void hw_edittext(int link, hwdoc doc)
+hw:hwdoc hw_getcgi(int link, int objid)
+hw:int hw_getremote(int link, int objid)
+hw:[array|int] hw_getremotechildren(int link, string objrec)
+hw:void hw_setlinkroot(int link, int rootid)
+hw:hwdoc hw_pipedocument(int link, int objid)
+hw:hwdoc hw_pipecgi(int link, int objid)
+hw:void hw_insertdocument(int link, int parentid, hwdoc doc)
+hw:hwdoc hw_new_document(string objrec, string data, int size)
+hw:void hw_free_document(hwdoc doc)
+hw:void hw_outputdocument(hwdoc doc)
+hw:void hw_output_document(hwdoc doc)
+hw:string hw_documentbodytag(hwdoc doc [, string prefix])
+hw:string hw_document_bodytag(hwdoc doc [, string prefix])
+hw:string hw_document_content(hwdoc doc)
+hw:int hw_document_setcontent(hwdoc doc, string content)
+hw:int hw_documentsize(hwdoc doc)
+hw:int hw_document_size(hwdoc doc)
+hw:string hw_documentattributes(hwdoc doc)
+hw:string hw_document_attributes(hwdoc doc)
+hw:array hw_getparentsobj(int link, int objid)
+hw:array hw_getparents(int link, int objid)
+hw:array hw_children(int link, int objid)
+hw:array hw_childrenobj(int link, int objid)
+hw:array hw_getchildcoll(int link, int objid)
+hw:array hw_getchildcollobj(int link, int objid)
+hw:int hw_docbyanchor(int link, int anchorid)
+hw:array hw_docbyanchorobj(int link, int anchorid)
+hw:array hw_getobjectbyquery(int link, string query, int maxhits)
+hw:array hw_getobjectbyqueryobj(int link, string query, int maxhits)
+hw:array hw_getobjectbyquerycoll(int link, int collid, string query, int maxhits)
+hw:array hw_getobjectbyquerycollobj(int link, int collid, string query, int maxhits)
+hw:array hw_getchilddoccoll(int link, int objid)
+hw:array hw_getchilddoccollobj(int link, int objid)
+hw:array hw_getanchors(int link, int objid)
+hw:array hw_getanchorsobj(int link, int objid)
+hw:string hw_getusername(int link)
+hw:void hw_identify(int link, string username, string password)
+hw:array hw_objrec2array(string objrec, [array format])
+hw:string hw_array2objrec(array objarr)
+hw:array hw_incollections(int link, array objids, array collids, int para)
+hw:void hw_inscoll(int link, int parentid, array objarr)
+hw:void hw_insdoc(int link, int parentid, string objrec [, string text])
+hw:int hw_getsrcbydestobj(int link, int destid)
+hw:int hw_mapid(int link, int serverid, int destid)
+hw:string hw_getrellink(int link, int rootid, int sourceid, int destid)
+hw:void hw_connection_info(int link)
+icap:int icap_close(int stream_id [, int options])
+icap:int icap_open(string calendar, string user, string password [, int options])
+icap:int icap_reopen(int stream_id, string calendar [, int options])
+icap:int icap_expunge(int stream_id)
+icap:int icap_fetch_event(int stream_id, int eventid [, int options])
+icap:array icap_list_events(int stream_id, int begindate [, int enddate])
+icap:string icap_create_calendar(int stream_id, string calendar)
+icap:string icap_rename_calendar(int stream_id, string src_calendar, string dest_calendar)
+icap:int icap_list_alarms(int stream_id, array date, array time)
+icap:string icap_delete_calendar(int stream_id, string calendar)
+icap:string icap_delete_event(int stream_id, int uid)
+icap:string icap_delete_calendar(int stream_id, int uid)
+icap:string icap_store_event(int stream_id, object event)
+icap:string icap_snooze(int stream_id, int uid)
+imap:int imap_open(string mailbox, string user, string password [, int options])
+imap:int imap_popen(string mailbox, string user, string password [, int options])
+imap:int imap_reopen(int stream_id, string mailbox [, int options])
+imap:int imap_append(int stream_id, string folder, string message [, string flags])
+imap:int imap_num_msg(int stream_id)
+imap:int imap_ping(int stream_id)
+imap:int imap_num_recent(int stream_id)
+imap:int imap_expunge(int stream_id)
+imap:int imap_close(int stream_id [, int options])
+imap:array imap_headers(int stream_id)
+imap:string imap_body(int stream_id, int msg_no [, int options])
+imap:string imap_fetchtext_full(int stream_id, int msg_no [, int options])
+imap:int imap_mail_copy(int stream_id, int msg_no, string mailbox [, int options])
+imap:int imap_mail_move(int stream_id, int msg_no, string mailbox [, int options])
+imap:int imap_createmailbox(int stream_id, string mailbox)
+imap:int imap_renamemailbox(int stream_id, string old_name, string new_name)
+imap:int imap_deletemailbox(int stream_id, string mailbox)
+imap:array imap_list(int stream_id, string ref, string pattern)
+imap:array imap_getmailboxes(int stream_id, string ref, string pattern)
+imap:array imap_scan(int stream_id, string ref, string pattern, string content)
+imap:object imap_check(int stream_id)
+imap:int imap_delete(int stream_id, int msg_no [, int flags])
+imap:int imap_undelete(int stream_id, int msg_no)
+imap:object imap_headerinfo(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
+imap:object imap_rfc822_parse_headers(string headers [, string default_host])
+imap:array imap_lsub(int stream_id, string ref, string pattern)
+imap:array imap_getsubscribed(int stream_id, string ref, string pattern)
+imap:int imap_subscribe(int stream_id, string mailbox)
+imap:int imap_unsubscribe(int stream_id, string mailbox)
+imap:object imap_fetchstructure(int stream_id, int msg_no [, int options])
+imap:string imap_fetchbody(int stream_id, int msg_no, int section [, int options])
+imap:string imap_base64(string text)
+imap:string imap_qprint(string text)
+imap:string imap_8bit(string text)
+imap:string imap_binary(string text)
+imap:object imap_mailboxmsginfo(int stream_id)
+imap:string imap_rfc822_write_address(string mailbox, string host, string personal)
+imap:array imap_rfc822_parse_adrlist(string address_string, string default_host)
+imap:string imap_utf8(string string)
+imap:string imap_utf7_decode(string buf)
+imap:string imap_utf7_encode(string buf)
+imap:int imap_setflag_full(int stream_id, string sequence, string flag [, int options])
+imap:int imap_clearflag_full(int stream_id, string sequence, string flag [, int options])
+imap:array imap_sort(int stream_id, int criteria, int reverse [, int options])
+imap:string imap_fetchheader(int stream_id, int msg_no [, int options])
+imap:int imap_uid(int stream_id, int msg_no)
+imap:int imap_msgno(int stream_id, int unique_msg_id)
+imap:object imap_status(int stream_id, string mailbox, int options)
+imap:object imap_bodystruct(int stream_id, int msg_no, int section)
+imap:array imap_fetch_overview(int stream_id, int msg_no)
+imap:string imap_mail_compose(array envelope, array body)
+imap:int imap_mail(string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]])
+imap:array imap_search(int stream_id, string criteria [, long flags])
+imap:array imap_alerts(void)
+imap:array imap_errors(void)
+imap:string imap_last_error(void)
+imap:array imap_mime_header_decode(string str)
+ifx:int ifx_connect([string database [, string userid [, string password]]])
+ifx:int ifx_pconnect([string database [, string userid [, string password]]])
+ifx:int ifx_close(int connid)
+ifx:int ifx_query(string query, int connid [, int cursortype] [, array idarray])
+ifx:int ifx_prepare(string query, int connid [, int cursortype] [, array idarray])
+ifx:int ifx_do(int resultid)
+ifx:string ifx_error([int connection_id])
+ifx:string ifx_errormsg([int errorcode])
+ifx:int ifx_affected_rows(int resultid)
+ifx:array ifx_fetch_row(int resultid [, mixed position])
+ifx:int ifx_htmltbl_result(int resultid [, string htmltableoptions])
+ifx:array ifx_fieldtypes(int resultid)
+ifx:array ifx_fieldproperties(int resultid)
+ifx:int ifx_num_rows(int resultid)
+ifx:int ifx_getsqlca(int resultid)
+ifx:int ifx_num_fields(int resultid)
+ifx:int ifx_free_result(int resultid)
+ifx:int ifx_create_blob(int type, int mode, string param)
+ifx:int ifx_copy_blob(int bid)
+ifx:int ifx_free_blob(int bid)
+ifx:string ifx_get_blob(int bid)
+ifx:int ifx_update_blob(int bid, string content)
+ifx:void ifx_blobinfile_mode(int mode)
+ifx:void ifx_textasvarchar(int mode)
+ifx:void ifx_byteasvarchar(int mode)
+ifx:void ifx_nullformat(int mode)
+ifx:int ifx_create_char(string param)
+ifx:string ifx_get_char(int bid)
+ifx:int ifx_free_char(int bid)
+ifx:int ifx_update_char(int bid, string content)
+ifx:int ifxus_create_slob(int mode)
+ifx:int ifxus_free_slob(int bid)
+ifx:int ifxus_close_slob(int bid)
+ifx:int ifxus_open_slob(long bid, int mode)
+ifx:int ifxus_tell_slob(long bid)
+ifx:int ifxus_seek_slob(long bid, int mode, long offset)
+ifx:int ifxus_read_slob(long bid, long nbytes)
+ifx:int ifxus_write_slob(long bid, string content)
+ii:resource ingres_connect([string database [, string username [, string password]]])
+ii:resource ingres_pconnect([string database [, string username [, string password]]])
+ii:bool ingres_close([resource link])
+ii:bool ingres_query(string query [, resource link])
+ii:int ingres_num_rows([resource link])
+ii:int ingres_num_fields([resource link])
+ii:string ingres_field_name(int index [, resource link])
+ii:string ingres_field_type(int index [, resource link])
+ii:string ingres_field_nullable(int index [, resource link])
+ii:string ingres_field_length(int index [, resource link])
+ii:string ingres_field_precision(int index [, resource link])
+ii:string ingres_field_scale(int index [, resource link])
+ii:array ingres_fetch_array([int result_type [, resource link]])
+ii:array ingres_fetch_row([resource link])
+ii:array ingres_fetch_object([int result_type [, resource link]])
+ii:bool ingres_rollback([resource link])
+ii:bool ingres_commit([resource link])
+ii:bool ingres_autocommit([resource link])
+interbase:string ibase_errmsg(void)
+interbase:int ibase_connect(string database [, string username] [, string password] [, string charset] [, int buffers] [, int dialect] [, string role])
+interbase:int ibase_pconnect(string database [, string username] [, string password] [, string charset] [, int buffers] [, int dialect] [, string role])
+interbase:int ibase_close([int link_identifier])
+interbase:int ibase_trans([int trans_args [, int link_identifier]])
+interbase:int ibase_commit([int link_identifier,] int trans_number)
+interbase:int ibase_rollback([int link_identifier,] int trans_number)
+interbase:int ibase_query([int link_identifier,] string query [, int bind_args])
+interbase:array ibase_fetch_row(int result [, int blob_flag])
+interbase:object ibase_fetch_object(int result [, int blob_flag])
+interbase:int ibase_free_result(int result)
+interbase:int ibase_prepare([int link_identifier,] string query)
+interbase:int ibase_execute(int query [, int bind_args [, int ...])
+interbase:int ibase_free_query(int query)
+interbase:int ibase_timefmt(string format)
+interbase:int ibase_num_fields(int result)
+interbase:array ibase_field_info(int result, int field_number)
+interbase:int ibase_blob_create([int link_identifier])
+interbase:int ibase_blob_open(string blob_id)
+interbase:int ibase_blob_add(int blob_id, string data)
+interbase:string ibase_blob_get(int blob_id, int len)
+interbase:int ibase_blob_close(int blob_id)
+interbase:int ibase_blob_cancel(int blob_id)
+interbase:object ibase_blob_info(string blob_id_str)
+interbase:int ibase_blob_echo(string blob_id_str)
+interbase:string ibase_blob_import([link_identifier,] int file_id)
+ldap:int ldap_connect([string host [, int port]])
+ldap:int ldap_bind(int link [, string dn, string password])
+ldap:int ldap_unbind(int link)
+ldap:int ldap_read(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] )
+ldap:int ldap_list(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] )
+ldap:int ldap_search(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] )
+ldap:int ldap_free_result(int result)
+ldap:int ldap_count_entries(int link, int result)
+ldap:int ldap_first_entry(int link, int result)
+ldap:int ldap_next_entry(int link, int entry)
+ldap:array ldap_get_entries(int link, int result)
+ldap:string ldap_first_attribute(int link, int result, int ber)
+ldap:string ldap_next_attribute(int link, int result, int ber)
+ldap:array ldap_get_attributes(int link, int result)
+ldap:array ldap_get_values(int link, int result, string attribute)
+ldap:array ldap_get_values_len(int link, int result, string attribute)
+ldap:string ldap_get_dn(int link, int result)
+ldap:array ldap_explode_dn(string dn, int with_attrib)
+ldap:string ldap_dn2ufn(string dn)
+ldap:int ldap_add(int link, string dn, array entry)
+ldap:int ldap_modify(int link, string dn, array entry)
+ldap:int ldap_mod_replace(int link, string dn, array entry)
+ldap:int ldap_mod_add(int link, string dn, array entry)
+ldap:int ldap_mod_del(int link, string dn, array entry)
+ldap:int ldap_delete(int link, string dn)
+ldap:int ldap_errno(int link)
+ldap:string ldap_err2str(int errno)
+ldap:string ldap_error(int link)
+ldap:int ldap_compare(int link, string dn, string attr, string value)
+ldap:string ldap_t61_to_8859(string value)
+ldap:string ldap_8859_to_t61(string value)
+mcal:int mcal_close(int stream_id [, int options])
+mcal:int mcal_open(string calendar, string user, string password [, int options])
+mcal:string mcal_popen(string calendar, string user, string password [, int options])
+mcal:int mcal_reopen(int stream_id, string calendar [, int options])
+mcal:int mcal_expunge(int stream_id)
+mcal:int mcal_fetch_event(int stream_id, int eventid [, int options])
+mcal:object mcal_fetch_current_stream_event(int stream_id)
+mcal:array mcal_list_events(int stream_id, object begindate [, object enddate])
+mcal:string mcal_create_calendar(int stream_id, string calendar)
+mcal:string mcal_rename_calendar(int stream_id, string src_calendar, string dest_calendar)
+mcal:bool mcal_list_alarms(int stream_id, int year, int month, int day, int hour, int min, int sec)
+mcal:string mcal_delete_calendar(int stream_id, string calendar)
+mcal:string mcal_delete_event(int stream_id, int event_id)
+mcal:string mcal_append_event(int stream_id)
+mcal:string mcal_store_event(int stream_id)
+mcal:string mcal_snooze(int stream_id, int uid)
+mcal:string mcal_event_set_category(int stream_id, string category)
+mcal:string mcal_event_set_title(int stream_id, string title)
+mcal:string mcal_event_set_description(int stream_id, string description)
+mcal:string mcal_event_set_start(int stream_id, int year,int month, int day [[[, int hour], int min], int sec])
+mcal:string mcal_event_set_end(int stream_id, int year,int month, int day [[[, int hour], int min], int sec])
+mcal:int mcal_event_set_alarm(int stream_id, int alarm)
+mcal:int mcal_event_init(int stream_id)
+mcal:int mcal_event_set_class(int stream_id, int class)
+mcal:string mcal_event_add_attribute(int stream_id, string attribute, string value)
+mcal:bool mcal_is_leap_year(int year)
+mcal:int mcal_days_in_month(int month, bool leap_year)
+mcal:bool mcal_date_valid(int year, int month, int day)
+mcal:bool mcal_time_valid(int hour, int min, int sec)
+mcal:int mcal_day_of_week(int year, int month, int day)
+mcal:int mcal_day_of_year(int year, int month, int day)
+mcal:int mcal_week_of_year(int day, int month, int year)
+mcal:int mcal_date_compare(int ayear, int amonth, int aday, int byear, int bmonth, int bday)
+mcal:object mcal_next_recurrence(int stream_id, int weekstart, array next)
+mcal:string mcal_event_set_recur_none(int stream_id)
+mcal:string mcal_event_set_recur_daily(int stream_id, int year, int month, int day, int interval)
+mcal:string mcal_event_set_recur_weekly(int stream_id, int year, int month, int day, int interval, int weekdays)
+mcal:string mcal_event_set_recur_monthly_mday(int stream_id, int year, int month, int day, int interval)
+mcal:string mcal_event_set_recur_monthly_wday(int stream_id, int year, int month, int day, int interval)
+mcal:string mcal_event_set_recur_yearly(int stream_id, int year, int month, int day, int interval)
+mcrypt:resource mcrypt_module_open(string cipher, string cipher_directory, string mode, string mode_directory)
+mcrypt:int mcrypt_generic_init(resource td, string key, string iv)
+mcrypt:string mcrypt_generic(resource td, string data)
+mcrypt:string mdecrypt_generic(resource td, string data)
+mcrypt:int mcrypt_enc_get_supported_key_sizes(resource td)
+mcrypt:int mcrypt_enc_self_test(resource td)
+mcrypt:bool mcrypt_generic_end(resource td)
+mcrypt:bool mcrypt_enc_is_block_algorithm_mode(resource td)
+mcrypt:bool mcrypt_enc_is_block_algorithm(resource td)
+mcrypt:bool mcrypt_enc_is_block_mode(resource td)
+mcrypt:int mcrypt_enc_get_block_size(resource td)
+mcrypt:int mcrypt_enc_get_key_size(resource td)
+mcrypt:int mcrypt_enc_get_iv_size(resource td)
+mcrypt:string mcrypt_enc_get_algorithms_name(resource td)
+mcrypt:string mcrypt_enc_get_modes_name(resource td)
+mcrypt:bool mcrypt_module_self_test(string algorithm [, string lib_dir])
+mcrypt:bool mcrypt_module_is_block_algorithm_mode(string mode [, string lib_dir])
+mcrypt:bool mcrypt_module_is_block_algorithm(string algorithm [, string lib_dir])
+mcrypt:bool mcrypt_module_is_block_mode(string mode [, string lib_dir])
+mcrypt:int mcrypt_module_get_algo_block_size(string algorithm [, string lib_dir])
+mcrypt:int mcrypt_module_get_algo_key_size(string algorithm [, string lib_dir])
+mcrypt:int mcrypt_module_get_supported_key_sizes(string algorithm [, string lib_dir])
+mcrypt:array mcrypt_list_algorithms([string lib_dir])
+mcrypt:array mcrypt_list_modes([string lib_dir])
+mcrypt:int mcrypt_get_key_size(string cipher, string module)
+mcrypt:int mcrypt_get_block_size(string cipher, string module)
+mcrypt:int mcrypt_get_iv_size(string cipher, string module)
+mcrypt:string mcrypt_get_cipher_name(string cipher)
+mcrypt:string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)
+mcrypt:string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)
+mcrypt:string mcrypt_ecb(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_cfb(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_ofb(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_create_iv(int size, int source)
+mcrypt:string mcrypt_get_cipher_name(int cipher)
+mcrypt:int mcrypt_get_key_size(int cipher)
+mcrypt:int mcrypt_get_block_size(int cipher)
+mcrypt:string mcrypt_ofb(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_cfb(int cipher, string key, string data, int mode, string iv)
+mcrypt:string mcrypt_cbc(int cipher, string key, string data, int mode [, string iv])
+mcrypt:string mcrypt_ecb(int cipher, string key, string data, int mode)
+mhash:int mhash_count()
+mhash:int mhash_get_block_size(int hash)
+mhash:string mhash_get_hash_name(int hash)
+mhash:string mhash(int hash, string data)
+msql:int msql_connect([string hostname[
+msql:int msql_pconnect([string hostname[
+msql:int msql_close([int link_identifier])
+msql:int msql_select_db(string database_name [, int link_identifier])
+msql:int msql_create_db(string database_name [, int link_identifier])
+msql:int msql_drop_db(string database_name [, int link_identifier])
+msql:int msql_query(string query [, int link_identifier])
+msql:int msql_db_query(string database_name, string query [, int link_identifier])
+msql:int msql_list_dbs([int link_identifier])
+msql:int msql_list_tables(string database_name [, int link_identifier])
+msql:int msql_list_fields(string database_name, string table_name [, int link_identifier])
+msql:string msql_error([int link_identifier])
+msql:int msql_result(int query, int row [, mixed field])
+msql:int msql_num_rows(int query)
+msql:int msql_num_fields(int query)
+msql:array msql_fetch_row(int query)
+msql:object msql_fetch_object(int query [, int result_type])
+msql:array msql_fetch_array(int query [, int result_type])
+msql:int msql_data_seek(int query, int row_number)
+msql:object msql_fetch_field(int query [, int field_offset])
+msql:int msql_field_seek(int query, int field_offset)
+msql:string msql_field_name(int query, int field_index)
+msql:string msql_field_table(int query, int field_offset)
+msql:int msql_field_len(int query, int field_offet)
+msql:string msql_field_type(int query, int field_offset)
+msql:string msql_field_flags(int query, int field_offset)
+msql:int msql_free_result(int query)
+msql:int msql_affected_rows(int query)
+mssql:int mssql_connect([string servername [, string username [, string password]]])
+mssql:int mssql_pconnect([string servername [, string username [, string password]]])
+mssql:int mssql_close([int connectionid])
+mssql:bool mssql_select_db(string database_name [, int conn_id])
+mssql:int mssql_query(string query [, int conn_id])
+mssql:int mssql_free_result(string result_index)
+mssql:string mssql_get_last_message(void)
+mssql:int mssql_num_rows(int mssql_result_index)
+mssql:int mssql_num_fields(int mssql_result_index)
+mssql:array mssql_fetch_row(int result_id)
+mssql:object mssql_fetch_object(int result_id)
+mssql:array mssql_fetch_array(int result_id)
+mssql:int mssql_data_seek(int result_id, int offset)
+mssql:object mssql_fetch_field(int result_id [, int offset])
+mssql:int mssql_field_length(int result_id [, int offset])
+mssql:string mssql_field_name(int result_id [, int offset])
+mssql:string mssql_field_type(int result_id [, int offset])
+mssql:bool mssql_field_seek(int result_id, int offset)
+mssql:string mssql_result(int result_id, int row, mixed field)
+mssql:void mssql_min_error_severity(int severity)
+mssql:void mssql_min_message_severity(int severity)
+mysql:int mysql_connect([string hostname])
+mysql:int mysql_pconnect([string hostname])
+mysql:int mysql_close([int link_identifier])
+mysql:int mysql_select_db(string database_name [, int link_identifier])
+mysql:int mysql_create_db(string database_name [, int link_identifier])
+mysql:int mysql_drop_db(string database_name [, int link_identifier])
+mysql:int mysql_query(string query [, int link_identifier])
+mysql:int mysql_db_query(string database_name, string query [, int link_identifier])
+mysql:int mysql_list_dbs([int link_identifier])
+mysql:int mysql_list_tables(string database_name [, int link_identifier])
+mysql:int mysql_list_fields(string database_name, string table_name [, int link_identifier])
+mysql:string mysql_error([int link_identifier])
+mysql:int mysql_errno([int link_identifier])
+mysql:int mysql_affected_rows([int link_identifier])
+mysql:char mysql_escape_string([char string])
+mysql:int mysql_insert_id([int link_identifier])
+mysql:int mysql_result(int result, int row [, mixed field])
+mysql:int mysql_num_rows(int result)
+mysql:int mysql_num_fields(int result)
+mysql:array mysql_fetch_row(int result)
+mysql:object mysql_fetch_object(int result [, int result_type])
+mysql:array mysql_fetch_array(int result [, int result_type])
+mysql:array mysql_fetch_assoc(int result)
+mysql:int mysql_data_seek(int result, int row_number)
+mysql:array mysql_fetch_lengths(int result)
+mysql:object mysql_fetch_field(int result [, int field_offset])
+mysql:int mysql_field_seek(int result, int field_offset)
+mysql:string mysql_field_name(int result, int field_index)
+mysql:string mysql_field_table(int result, int field_offset)
+mysql:int mysql_field_len(int result, int field_offet)
+mysql:string mysql_field_type(int result, int field_offset)
+mysql:string mysql_field_flags(int result, int field_offset)
+mysql:int mysql_free_result(int result)
+oci8:int ocidefinebyname(int stmt, string name, mixed &var [, int type])
+oci8:int ocibindbyname(int stmt, string name, mixed &var, int maxlength [, int type])
+oci8:string ocifreedesc(object lob)
+oci8:string ocisavelob(object lob)
+oci8:string ocisavelobfile(object lob)
+oci8:string ociloadlob(object lob)
+oci8:void ociwritelobtofile(object lob [, string filename] [, int start] [, int length])
+oci8:string ocinewdescriptor(int connection [, int type])
+oci8:string ocirollback(int conn)
+oci8:string ocicommit(int conn)
+oci8:string ocicolumnname(int stmt, int col)
+oci8:int ocicolumnsize(int stmt, int col)
+oci8:int ocicolumnscale(int stmt, int col)
+oci8:int ocicolumnprecision(int stmt, int col)
+oci8:mixed ocicolumntype(int stmt, int col)
+oci8:mixed ocicolumntyperaw(int stmt, int col)
+oci8:int ocicolumnisnull(int stmt, int col)
+oci8:void ociinternaldebug(int onoff)
+oci8:int ociexecute(int stmt [, int mode])
+oci8:int ocicancel(int stmt)
+oci8:int ocifetch(int stmt)
+oci8:int ocifetchinto(int stmt, array &output [, int mode])
+oci8:int ocifetchstatement(int stmt, array &output)
+oci8:int ocifreestatement(int stmt)
+oci8:int ocilogoff(int conn)
+oci8:int ocinlogon(string user, string pass [, string db])
+oci8:int ocilogon(string user, string pass [, string db])
+oci8:int ociplogon(string user, string pass [, string db])
+oci8:array ocierror([int stmt|conn|global])
+oci8:int ocinumcols(int stmt)
+oci8:int ociparse(int conn, string query)
+oci8:int ocisetprefetch(int conn, string query)
+oci8:int ocinewcursor(int conn)
+oci8:string ociresult(int stmt, mixed column)
+oci8:string ociserverversion(int conn)
+oci8:int ocistatementtype(int stmt)
+oci8:int ocirowcount(int stmt)
+odbc:void odbc_close_all(void)
+odbc:int odbc_binmode(int result_id, int mode)
+odbc:int odbc_longreadlen(int result_id, int length)
+odbc:int odbc_prepare(int connection_id, string query)
+odbc:int odbc_execute(int result_id [, array parameters_array])
+odbc:string odbc_cursor(int result_id)
+odbc:int odbc_exec(int connection_id, string query [, int flags])
+odbc:object odbc_fetch_object(int result [, int rownumber])
+odbc:array odbc_fetch_array(int result [, int rownumber])
+odbc:int odbc_fetch_into(int result_id [, int rownumber], array result_array)
+odbc:int odbc_fetch_row(int result_id [, int row_number])
+odbc:string odbc_result(int result_id, mixed field)
+odbc:int odbc_result_all(int result_id [, string format])
+odbc:int odbc_free_result(int result_id)
+odbc:int odbc_connect(string DSN, string user, string password [, int cursor_option])
+odbc:int odbc_pconnect(string DSN, string user, string password [, int cursor_option])
+odbc:void odbc_close(int connection_id)
+odbc:int odbc_num_rows(int result_id)
+odbc:int odbc_num_fields(int result_id)
+odbc:string odbc_field_name(int result_id, int field_number)
+odbc:string odbc_field_type(int result_id, int field_number)
+odbc:int odbc_field_len(int result_id, int field_number)
+odbc:int odbc_field_scale(int result_id, int field_number)
+odbc:int odbc_field_num(int result_id, string field_name)
+odbc:int odbc_autocommit(int connection_id [, int OnOff])
+odbc:int odbc_commit(int connection_id)
+odbc:int odbc_rollback(int connection_id)
+odbc:int odbc_setoption(int conn_id|result_id, int which, int option, int value)
+odbc:int odbc_tables(int connection_id [, string qualifier, string owner, string name, string table_types])
+odbc:int odbc_columns(int connection_id, string qualifier, string owner, string table_name, string column_name)
+odbc:int odbc_columnprivileges(int connection_id, string catalog, string schema, string table, string column)
+odbc:int odbc_foreignkeys(int connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table)
+odbc:int odbc_gettypeinfo(int connection_id [, int data_type])
+odbc:int odbc_primarykeys(int connection_id, string qualifier, string owner, string table)
+odbc:int odbc_procedurecolumns(int connection_id [, string qualifier, string owner, string proc, string column])
+odbc:int odbc_procedures(int connection_id [, string qualifier, string owner, string name])
+odbc:int odbc_specialcolumns(int connection_id, int type, string qualifier, string owner, string table, int scope, int nullable)
+odbc:int odbc_statistics(int connection_id, string qualifier, string owner, string name, int unique, int accuracy)
+odbc:int odbc_tableprivileges(int connection_id, string qualifier, string owner, string name)
+oracle:int ora_logon(string user, string password)
+oracle:int ora_plogon(string user, string password)
+oracle:int ora_logoff(int connection)
+oracle:int ora_open(int connection)
+oracle:int ora_close(int cursor)
+oracle:int ora_commitoff(int connection)
+oracle:int ora_commiton(int connection)
+oracle:int ora_commit(int connection)
+oracle:int ora_rollback(int connection)
+oracle:int ora_parse(int cursor, string sql_statement [, int defer])
+oracle:int ora_bind(int cursor, string php_variable_name, string sql_parameter_name, int length [, int type])
+oracle:int ora_exec(int cursor)
+oracle:int ora_numcols(int cursor)
+oracle:int ora_numrows(int cursor)
+oracle:int ora_do(int connection, int cursor)
+oracle:int ora_fetch(int cursor)
+oracle:int ora_fetch_into(int cursor, array result [, int flags])
+oracle:string ora_columnname(int cursor, int column)
+oracle:string ora_columntype(int cursor, int column)
+oracle:int ora_columnsize(int cursor, int column)
+oracle:mixed ora_getcolumn(int cursor, int column)
+oracle:string ora_error(int cursor_or_connection)
+oracle:int ora_errorcode(int cursor_or_connection)
+ovrimos:int ovrimos_connect(string host, string db, string user, string password)
+ovrimos:void ovrimos_close(int connection)
+ovrimos:void ovrimos_close_all()
+ovrimos:int ovrimos_longreadlen(int result_id, int length)
+ovrimos:int ovrimos_prepare(int connection_id, string query)
+ovrimos:int ovrimos_execute(int result_id [, array parameters_array])
+ovrimos:string ovrimos_cursor(int result_id)
+ovrimos:int ovrimos_exec(int connection_id, string query)
+ovrimos:int ovrimos_fetch_into(int result_id, array result_array [, string how, [int rownumber]])
+ovrimos:int ovrimos_fetch_row(int result_id [, int how, [int row_number]])
+ovrimos:string ovrimos_result(int result_id, mixed field)
+ovrimos:int ovrimos_result_all(int result_id [, string format])
+ovrimos:int ovrimos_free_result(int result_id)
+ovrimos:int ovrimos_num_rows(int result_id)
+ovrimos:int ovrimos_num_fields(int result_id)
+ovrimos:string ovrimos_field_name(int result_id, int field_number)
+ovrimos:string ovrimos_field_type(int result_id, int field_number)
+ovrimos:int ovrimos_field_len(int result_id, int field_number)
+ovrimos:int ovrimos_field_num(int result_id, string field_name)
+ovrimos:int ovrimos_autocommit(int connection_id, int OnOff)
+ovrimos:int ovrimos_commit(int connection_id)
+ovrimos:int ovrimos_rollback(int connection_id)
+ovrimos:int ovrimos_setoption(int conn_id|result_id, int which, int option, int value)
+pcre:int preg_match(string pattern, string subject [, array subpatterns])
+pcre:int preg_match_all(string pattern, string subject, array subpatterns [, int order])
+pcre:string preg_replace(string|array regex, string|array replace, string|array subject [, int limit])
+pcre:array preg_split(string pattern, string subject [, int limit [, int flags]])
+pcre:string preg_quote(string str, string delim_char)
+pcre:array preg_grep(string regex, array input)
+pdf:bool pdf_set_info(int pdfdoc, string fieldname, string value)
+pdf:bool pdf_set_info_creator(int pdfdoc, string creator)
+pdf:bool pdf_set_info_title(int pdfdoc, string title)
+pdf:bool pdf_set_info_subject(int pdfdoc, string subject)
+pdf:bool pdf_set_info_author(int pdfdoc, string author)
+pdf:bool pdf_set_info_keywords(int pdfdoc, string keywords)
+pdf:int pdf_open([int filedesc])
+pdf:void pdf_close(int pdfdoc)
+pdf:void pdf_begin_page(int pdfdoc, double width, double height)
+pdf:void pdf_end_page(int pdfdoc)
+pdf:void pdf_show(int pdfdoc, string text)
+pdf:void pdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor)
+pdf:int pdf_show_boxed(int pdfdoc, string text, double x-koor, double y-koor, double width, double height, string mode, [string feature])
+pdf:void pdf_set_font(int pdfdoc, string font, double size, string encoding [, int embed])
+pdf:int pdf_get_font(int pdfdoc)
+pdf:string pdf_get_fontname(int pdfdoc)
+pdf:double pdf_get_fontsize(int pdfdoc)
+pdf:void pdf_set_leading(int pdfdoc, double distance)
+pdf:void pdf_set_text_rendering(int pdfdoc, int mode)
+pdf:void pdf_set_horiz_scaling(int pdfdoc, double scale)
+pdf:void pdf_set_text_rise(int pdfdoc, double value)
+pdf:void pdf_set_text_matrix(int pdfdoc, arry matrix)
+pdf:void pdf_set_text_pos(int pdfdoc, double x, double y)
+pdf:void pdf_set_char_spacing(int pdfdoc, double space)
+pdf:void pdf_set_word_spacing(int pdfdoc, double space)
+pdf:void pdf_continue_text(int pdfdoc, string text)
+pdf:double pdf_stringwidth(int pdfdoc, string text)
+pdf:void pdf_save(int pdfdoc)
+pdf:void pdf_restore(int pdfdoc)
+pdf:void pdf_translate(int pdfdoc, double x, double y)
+pdf:void pdf_scale(int pdfdoc, double x-scale, double y-scale)
+pdf:void pdf_rotate(int pdfdoc, double angle)
+pdf:void pdf_skew(int pdfdoc, double xangle, double yangle)
+pdf:void pdf_setflat(int pdfdoc, double value)
+pdf:void pdf_setlinejoin(int pdfdoc, int value)
+pdf:void pdf_setlinecap(int pdfdoc, int value)
+pdf:void pdf_setmiterlimit(int pdfdoc, double value)
+pdf:void pdf_setlinewidth(int pdfdoc, double width)
+pdf:void pdf_setdash(int pdfdoc, double white, double black)
+pdf:void pdf_moveto(int pdfdoc, double x, double y)
+pdf:void pdf_curveto(int pdfdoc, double x1, double y1, double x2, double y2, double x3, double y3)
+pdf:void pdf_lineto(int pdfdoc, double x, double y)
+pdf:void pdf_circle(int pdfdoc, double x, double y, double radius)
+pdf:void pdf_arc(int pdfdoc, double x, double y, double radius, double start, double end)
+pdf:void pdf_rect(int pdfdoc, double x, double y, double width, double height)
+pdf:void pdf_closepath(int pdfdoc)
+pdf:void pdf_closepath_stroke(int pdfdoc)
+pdf:void pdf_stroke(int pdfdoc)
+pdf:void pdf_fill(int pdfdoc)
+pdf:void pdf_fill_stroke(int pdfdoc)
+pdf:void pdf_closepath_fill_stroke(int pdfdoc)
+pdf:void pdf_endpath(int pdfdoc)
+pdf:void pdf_clip(int pdfdoc)
+pdf:void pdf_set_parameter(int pdfdoc, string key, string value)
+pdf:string pdf_get_parameter(int pdfdoc, string key, mixed modifier)
+pdf:void pdf_set_value(int pdfdoc, string key, double value)
+pdf:double pdf_get_value(int pdfdoc, string key, double modifier)
+pdf:void pdf_setgray_fill(int pdfdoc, double value)
+pdf:void pdf_setgray_stroke(int pdfdoc, double value)
+pdf:void pdf_setgray(int pdfdoc, double value)
+pdf:void pdf_setrgbcolor_fill(int pdfdoc, double red, double green, double blue)
+pdf:void pdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double blue)
+pdf:void pdf_setrgbcolor(int pdfdoc, double red, double green, double blue)
+pdf:int pdf_add_outline(int pdfdoc, string text [, int parent, int open]);
+pdf:void pdf_set_transition(int pdfdoc, int transition)
+pdf:void pdf_set_duration(int pdfdoc, double duration)
+pdf:int pdf_open_gif(int pdf, string giffile)
+pdf:int pdf_open_jpeg(int pdf, string jpegfile)
+pdf:int pdf_open_png(int pdf, string pngfile)
+pdf:int pdf_open_tiff(int pdf, string tifffile)
+pdf:int pdf_open_image_file(int pdf, string type, string file)
+pdf:int pdf_open_memory_image(int pdf, int image)
+pdf:void pdf_close_image(int pdfimage)
+pdf:void pdf_place_image(int pdf, int pdfimage, double x, double y, double scale)
+pdf:void pdf_get_image_width(int pdf, int pdfimage)
+pdf:void pdf_get_image_height(int pdf, int pdfimage)
+pdf:void pdf_add_weblink(int pdfdoc, double llx, double lly, double urx, double ury, string url)
+pdf:void pdf_add_pdflink(int pdfdoc, double llx, double lly, double urx, double ury, string filename, int page, string dest)
+pdf:void pdf_set_border_style(int pdfdoc, string style, double width)
+pdf:void pdf_set_border_color(int pdfdoc, double red, double green, double blue)
+pdf:void pdf_set_border_dash(int pdfdoc, double black, double white)
+pdf:void pdf_add_annotation(int pdfdoc, double xll, double yll, double xur, double xur, string title, string text)
+pfpro:string pfpro_version()
+pfpro:void pfpro_init()
+pfpro:void pfpro_cleanup()
+pfpro:string pfpro_process_raw(string parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]])
+pfpro:array pfpro_process(array parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]])
+pgsql:int pg_connect([string connection_string] | [string host, string port [, string options [, string tty,]] string database)
+pgsql:int pg_pconnect([string connection_string] | [string host, string port [, string options [, string tty,]] string database)
+pgsql:bool pg_close([int connection])
+pgsql:string pg_dbname([int connection])
+pgsql:string pg_errormessage([int connection])
+pgsql:string pg_options([int connection])
+pgsql:int pg_port([int connection])
+pgsql:string pg_tty([int connection])
+pgsql:string pg_host([int connection])
+pgsql:int pg_exec([int connection,] string query)
+pgsql:int pg_end_copy([int connection])
+pgsql:int pg_put_line([int connection,] string query)
+pgsql:int pg_numrows(int result)
+pgsql:int pg_numfields(int result)
+pgsql:int pg_cmdtuples(int result)
+pgsql:string pg_fieldname(int result, int field_number)
+pgsql:int pg_fieldsize(int result, int field_number)
+pgsql:string pg_fieldtype(int result, int field_number)
+pgsql:int pg_fieldnum(int result, string field_name)
+pgsql:mixed pg_result(int result, int row_number, mixed field_name)
+pgsql:array pg_fetch_row(int result, int row)
+pgsql:array pg_fetch_array(int result, int row [, int result_type])
+pgsql:object pg_fetch_object(int result, int row [, int result_type])
+pgsql:int pg_fieldprtlen(int result, int row, mixed field_name_or_number)
+pgsql:int pg_fieldisnull(int result, int row, mixed field_name_or_number)
+pgsql:int pg_freeresult(int result)
+pgsql:int pg_getlastoid(int result)
+pgsql:bool pg_trace(string filename [, string mode [, resource connection]])
+pgsql:bool pg_untrace([int connection])
+pgsql:int pg_locreate(int connection)
+pgsql:void pg_lounlink([int connection,] int large_obj_id)
+pgsql:int pg_loopen([int connection,] int objoid, string mode)
+pgsql:void pg_loclose(int fd)
+pgsql:string pg_loread(int fd, int len)
+pgsql:int pg_lowrite(int fd, string buf)
+pgsql:void pg_loreadall(int fd)
+pgsql:int pg_loimport(string filename [, resource connection])
+pgsql:bool pg_loexport(int objoid, string filename [, resource connection])
+pgsql:int pg_set_client_encoding([int connection,] string encoding)
+pgsql:string pg_client_encoding([int connection])
+posix:int posix_kill(int pid, int sig)
+posix:long posix_getpid(void)
+posix:long posix_getppid(void)
+posix:long posix_getuid(void)
+posix:long posix_getgid(void)
+posix:long posix_geteuid(void)
+posix:long posix_getegid(void)
+posix:long posix_setuid(long uid)
+posix:long posix_setgid(long uid)
+posix:long posix_seteuid(long uid)
+posix:long posix_setegid(long uid)
+posix:long posix_getgroups(void)
+posix:string posix_getlogin(void)
+posix:long posix_getpgrp(void)
+posix:long posix_setsid(void)
+posix:long posix_setpgid(long pid, long pgid)
+posix:long posix_getpgid(void)
+posix:long posix_getsid(void)
+posix:array posix_uname(void)
+posix:array posix_times(void)
+posix:string posix_ctermid(void)
+posix:string posix_ttyname(int fd)
+posix:bool posix_isatty(int fd)
+posix:string posix_getcwd(void)
+posix:string posix_mkfifo(void)
+posix:array posix_getgrnam(string groupname)
+posix:array posix_getgrgid(long gid)
+posix:array posix_getpwnam(string groupname)
+posix:array posix_getpwuid(long uid)
+posix:long posix_getrlimit(void)
+pspell:int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
+pspell:int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]])
+pspell:int pspell_new_config(int config)
+pspell:int pspell_check(int pspell, string word)
+pspell:array pspell_suggest(int pspell, string word)
+pspell:int pspell_store_replacement(int pspell, string misspell, string correct)
+pspell:int pspell_add_to_personal(int pspell, string word)
+pspell:int pspell_add_to_session(int pspell, string word)
+pspell:int pspell_clear_session(int pspell)
+pspell:int pspell_save_wordlist(int pspell)
+pspell:int pspell_config_create(string language [, string spelling [, string jargon [, string encoding]]])
+pspell:int pspell_config_runtogether(int conf, bool runtogether)
+pspell:int pspell_config_mode(int conf, long mode)
+pspell:int pspell_config_ignore(int conf, int ignore)
+pspell:int pspell_config_personal(int conf, string personal)
+pspell:int pspell_config_repl(int conf, string repl)
+pspell:int pspell_config_save_repl(int conf, bool save)
+readline:string readline([string prompt])
+readline:mixed readline_info([string varname] [, string newvalue])
+readline:void readline_add_history([string prompt])
+readline:void readline_clear_history(void)
+readline:array readline_list_history(void)
+readline:int readline_read_history([string filename] [, int from] [,int to])
+readline:int readline_write_history([string filename])
+readline:void readline_completion_function(string funcname)
+recode:string recode_string(string request, string str)
+recode:bool recode_file(string request, resource input, resource output)
+sablot:resource xslt_create(void)
+sablot:bool xslt_run(resource xh, string xslt_file, string data_file[, string result[, array xslt_params[, array xslt_args]]])
+sablot:bool xslt_openlog(resource xh, string logfile[, int loglevel])
+sablot:bool xslt_closelog(resource xh)
+sablot:string xslt_fetch_result(resource xh[, string result_name])
+sablot:void xslt_free(resource xh)
+sablot:void xslt_set_sax_handler(resource xh, array handlers)
+sablot:mixed xslt_error([int xh])
+sablot:int xslt_errno([int xh])
+session:void session_set_cookie_params(int lifetime [, string path [, string domain]])
+session:array session_get_cookie_params(void)
+session:string session_name([string newname])
+session:string session_module_name([string newname])
+session:void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc)
+session:string session_save_path([string newname])
+session:string session_id([string newid])
+session:string session_cache_limiter([string new_cache_limiter])
+session:bool session_register(mixed var_names [, mixed ...])
+session:bool session_unregister(string varname)
+session:bool session_is_registered(string varname)
+session:string session_encode(void)
+session:bool session_decode(string data)
+session:bool session_start(void)
+session:bool session_destroy(void)
+session:void session_unset(void)
+shmop:int shm_open (int key, int flags, int mode, int size)
+shmop:string shm_read (int shmid, int start, int count)
+shmop:void shm_close (int shmid)
+shmop:int shm_size (int shmid)
+shmop:int shm_write (int shmid, string data, int offset)
+shmop:bool shm_delete (int shmid)
+create_stubs:{{{ proto " types[i] " " funcs[i] "("
+skeleton:string confirm_extname_compiled(string arg)
+snmp:string snmpget(string host, string community, string object_id [, int timeout [, int retries]])
+snmp:array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]])
+snmp:array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]])
+snmp:bool snmp_get_quick_print(void)
+snmp:void snmp_set_quick_print(int quick_print)
+snmp:int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])
+sockets:resource fd_alloc(void)
+sockets:void fd_dealloc(void)
+sockets:bool fd_set(int fd, resource set)
+sockets:bool fd_clear(int fd, resource set)
+sockets:bool fd_isset(int fd, resource set)
+sockets:void fd_zero(resource set)
+sockets:int select(int max_fd, resource readfds, resource writefds, resource exceptfds, int tv_sec, int tv_usec)
+sockets:int open_listen_sock(int port)
+sockets:int accept_connect(int fd)
+sockets:bool set_nonblock(int fd)
+sockets:bool listen(int fd, int backlog)
+sockets:bool close(int fd)
+sockets:int write(int fd, string buf, int length)
+sockets:int read(int fd, string &buf, int length)
+sockets:int getsockname(int fd, string &addr, int &port)
+sockets:int gethostbyname(string name, string &addr)
+sockets:int getpeername(int fd, string &addr, int &port)
+sockets:int gethostbyaddr(string addr, string &name)
+sockets:int socket(int domain, int type, int protocol)
+sockets:int connect(int sockfd, string addr [, int port])
+sockets:string strerror(int errno)
+sockets:int bind(int sockfd, string addr [, int port])
+sockets:resource build_iovec(int num_vectors [, int ...])
+sockets:string fetch_iovec(resource iovec_id, int iovec_position)
+sockets:bool set_iovec(resource iovec_id, int iovec_position, string new_val)
+sockets:bool add_iovec(resource iovec_id, int iov_len)
+sockets:bool delete_iovec(resource iovec_id, int iov_pos)
+sockets:bool free_iovec(resource iovec_id)
+sockets:int readv(int fd, resource iovec_id)
+sockets:int writev(int fd, resource iovec_id)
+sockets:int recv(int fd, string buf, int len, int flags)
+sockets:int send(int fd, string buf, int len, int flags)
+sockets:int recvfrom(int fd, string &buf, int len, int flags, string &name [, int &port])
+sockets:int sendto(int fd, string buf, int len, int flags, string addr [, int port])
+sockets:int recvmsg(int fd, resource iovec, array &control, int &controllen, int &flags, string &addr [, int &port])
+sockets:int sendmsg(int fd, resource iovec, int flags, string addr [, int port])
+sockets:int getsockopt(int fd, int level, int optname, array|int &optval)
+sockets:int setsockopt(int fd, int level, int optname, int|array optval)
+sockets:int socketpair(int domain, int type, int protocol, array &fds)
+sockets:int shutdown(int fd, int how)
+array:int krsort(array array_arg [, int sort_flags])
+array:int ksort(array array_arg [, int sort_flags])
+array:int count(mixed var)
+array:void natsort(array array_arg)
+array:void natcasesort(array array_arg)
+array:void asort(array array_arg [, int sort_flags])
+array:void arsort(array array_arg [, int sort_flags])
+array:void sort(array array_arg [, int sort_flags])
+array:void rsort(array array_arg [, int sort_flags])
+array:void usort(array array_arg, string cmp_function)
+array:void uasort(array array_arg, string cmp_function)
+array:void uksort(array array_arg, string cmp_function)
+array:mixed end(array array_arg)
+array:mixed prev(array array_arg)
+array:mixed next(array array_arg)
+array:mixed reset(array array_arg)
+array:mixed current(array array_arg)
+array:mixed key(array array_arg)
+array:mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])
+array:mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])
+array:int array_walk(array input, string funcname [, mixed userdata])
+array:bool in_array(mixed needle, array haystack [, bool strict])
+array:void extract(array var_array, int extract_type [, string prefix])
+array:array compact(mixed var_names [, mixed ...])
+array:array range(int low, int high)
+array:int shuffle(array array_arg)
+array:int array_push(array stack, mixed var [, mixed ...])
+array:mixed array_pop(array stack)
+array:mixed array_shift(array stack)
+array:int array_unshift(array stack, mixed var [, mixed ...])
+array:array array_splice(array input, int offset [, int length [, array replacement]])
+array:array array_slice(array input, int offset [, int length])
+array:array array_merge(array arr1, array arr2 [, array ...])
+array:array array_merge_recursive(array arr1, array arr2 [, array ...])
+array:array array_keys(array input [, mixed search_value])
+array:array array_values(array input)
+array:array array_count_values(array input)
+array:array array_reverse(array input [, bool preserve keys])
+array:array array_pad(array input, int pad_size, mixed pad_value)
+array:array array_flip(array input)
+array:array array_unique(array input)
+array:array array_intersect(array arr1, array arr2 [, array ...])
+array:array array_diff(array arr1, array arr2 [, array ...])
+array:bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...])
+array:mixed array_rand(array input [, int num_req])
+assert:int assert(string|bool assertion)
+assert:mixed assert_options(int what [, mixed value])
+base64:string base64_encode(string str)
+base64:string base64_decode(string str)
+basic_functions:int ip2long(string ip_address)
+basic_functions:string long2ip(int proper_address)
+basic_functions:string getenv(string varname)
+basic_functions:void putenv(string setting)
+basic_functions:int intval(mixed var [, int base])
+basic_functions:double doubleval(mixed var)
+basic_functions:string strval(mixed var)
+basic_functions:void flush(void)
+basic_functions:void sleep(int seconds)
+basic_functions:void usleep(int micro_seconds)
+basic_functions:string gettype(mixed var)
+basic_functions:int settype(string var, string type)
+basic_functions:string get_current_user(void)
+basic_functions:string get_cfg_var(string option_name)
+basic_functions:int set_magic_quotes_runtime(int new_setting)
+basic_functions:int get_magic_quotes_runtime(void)
+basic_functions:int get_magic_quotes_gpc(void)
+basic_functions:bool is_resource(mixed var)
+basic_functions:bool is_bool(mixed var)
+basic_functions:bool is_long(mixed var)
+basic_functions:bool is_double(mixed var)
+basic_functions:bool is_string(mixed var)
+basic_functions:bool is_array(mixed var)
+basic_functions:bool is_object(mixed var)
+basic_functions:bool is_numeric(mixed value)
+basic_functions:int error_log(string message, int message_type [, string destination] [, string extra_headers])
+basic_functions:mixed call_user_func(string function_name [, mixed parmeter] [, mixed ...])
+basic_functions:mixed call_user_method(string method_name, object object [, mixed parameter] [, mixed ...])
+basic_functions:void register_shutdown_function(string function_name)
+basic_functions:void highlight_file(string file_name)
+basic_functions:void highlight_string(string string)
+basic_functions:string ini_get(string varname)
+basic_functions:string ini_set(string varname, string newvalue)
+basic_functions:string ini_restore(string varname)
+basic_functions:string print_r(mixed var)
+basic_functions:int connection_aborted(void)
+basic_functions:int connection_timeout(void)
+basic_functions:int connection_status(void)
+basic_functions:int ignore_user_abort(boolean value)
+basic_functions:int getservbyname(string service, string protocol)
+basic_functions:string getservbyport(int port, string protocol)
+basic_functions:int getprotobyname(string name)
+basic_functions:string getprotobynumber(int proto)
+basic_functions:array get_loaded_extensions(void)
+basic_functions:bool extension_loaded(string extension_name)
+basic_functions:array get_extension_funcs(string extension_name)
+basic_functions:void register_tick_function(string function_name [, mixed arg [, ... ]])
+basic_functions:void unregister_tick_function(string function_name)
+basic_functions:boolean is_uploaded_file(string path)
+basic_functions:boolean move_uploaded_file(string path, string new_path)
+browscap:object get_browser(string browser_name)
+crc32:string crc32(string str)
+crypt:string crypt(string str [, string salt])
+cyr_convert:string convert_cyr_string(string str, string from, string to)
+datetime:int time(void)
+datetime:int mktime(int hour, int min, int sec, int mon, int day, int year)
+datetime:int gmmktime(int hour, int min, int sec, int mon, int day, int year)
+datetime:string date(string format [, int timestamp])
+datetime:string gmdate(string format [, int timestamp])
+datetime:array localtime([int timestamp [, bool associative_array]])
+datetime:array getdate([int timestamp])
+datetime:bool checkdate(int month, int day, int year)
+datetime:string strftime(string format [, int timestamp])
+datetime:string gmstrftime(string format [, int timestamp])
+datetime:int strtotime(string time, int now)
+dir:int opendir(string path)
+dir:class dir(string directory)
+dir:void closedir([int dir_handle])
+dir:int chdir(string directory)
+dir:string getcwd(void)
+dir:void rewinddir([int dir_handle])
+dir:string readdir([int dir_handle])
+dl:int dl(string extension_filename)
+dns:string gethostbyaddr(string ip_address)
+dns:string gethostbyname(string hostname)
+dns:array gethostbynamel(string hostname)
+dns:int checkdnsrr(string host [, string type])
+dns:int getmxrr(string hostname, array mxhosts [, array weight])
+exec:int exec(string command [, array output [, int return_value]])
+exec:int system(string command [, int return_value])
+exec:void passthru(string command [, int return_value])
+exec:string escapeshellcmd(string command)
+exec:string escapeshellarg(string arg)
+exec:string shell_exec(string cmd)
+file:bool flock(int fp, int operation [, int wouldblock])
+file:array get_meta_tags(string filename [, int use_include_path])
+file:array file(string filename [, int use_include_path])
+file:string tempnam(string dir, string prefix)
+file:int tmpfile(void)
+file:int fopen(string filename, string mode [, int use_include_path])
+file:int fclose(int fp)
+file:int popen(string command, string mode)
+file:int pclose(int fp)
+file:int feof(int fp)
+file:int set_socket_blocking(int socket_descriptor, int mode)
+file:bool socket_set_timeout(int socket_descriptor, int seconds, int microseconds)
+file:array socket_get_status(resource socket_descriptor)
+file:string fgets(int fp, int length)
+file:string fgetc(int fp)
+file:string fgetss(int fp, int length [, string allowable_tags])
+file:mixed fscanf(string str, string format [, string ...])
+file:int fwrite(int fp, string str [, int length])
+file:int fflush(int fp)
+file:int set_file_buffer(int fp, int buffer)
+file:int rewind(int fp)
+file:int ftell(int fp)
+file:int fseek(int fp, int offset [, int whence])
+file:int mkdir(string pathname, int mode)
+file:int rmdir(string dirname)
+file:int readfile(string filename [, int use_include_path])
+file:int umask([int mask])
+file:int fpassthru(int fp)
+file:int rename(string old_name, string new_name)
+file:int unlink(string filename)
+file:int ftruncate (int fp, int size)
+file:int fstat(int fp)
+file:int copy(string source_file, string destination_file)
+file:int fread(int fp, int length)
+file:array fgetcsv(int fp, int length)
+file:string realpath(string path)
+filestat:double diskfreespace(string path)
+filestat:bool chgrp(string filename, mixed group)
+filestat:bool chown (string filename, mixed user)
+filestat:bool chmod(string filename, int mode)
+filestat:bool touch(string filename [, int time])
+filestat:void clearstatcache(void)
+filestat:int fileperms(string filename)
+filestat:int fileinode(string filename)
+filestat:int filesize(string filename)
+filestat:int fileowner(string filename)
+filestat:nt filegroup(string filename)
+filestat:int fileatime(string filename)
+filestat:int filemtime(string filename)
+filestat:int filectime(string filename)
+filestat:string filetype(string filename)
+filestat:int is_writable(string filename)
+filestat:int is_readable(string filename)
+filestat:int is_executable(string filename)
+filestat:int is_file(string filename)
+filestat:int is_dir(string filename)
+filestat:int is_link(string filename)
+filestat:bool file_exists(string filename)
+filestat:array lstat(string filename)
+filestat:array stat(string filename)
+formatted_print:string sprintf(string format [, mixed arg1 [, mixed ...]])
+formatted_print:int printf(string format [, mixed arg1 [, mixed ...]])
+fsock:int fsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]])
+fsock:int pfsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]])
+head:void header(string header)
+head:void setcookie(string name [, string value [, int expires [, string path [, string domain [, string secure]]]]])
+head:int headers_sent(void)
+html:string htmlspecialchars(string string [, int quote_style])
+html:string htmlentities(string string [, int quote_style])
+html:array get_html_translation_table([int table [, int quote_style]])
+image:array getimagesize(string imagefile [, array info])
+info:void phpinfo([int what])
+info:string phpversion(void)
+info:void phpcredits([int flag])
+info:string php_logo_guid(void)
+info:string php_egg_logo_guid(void)
+info:string zend_logo_guid(void)
+info:string php_sapi_name(void)
+info:string php_uname(void)
+iptc:array iptcembed(string iptcdata, string jpeg_file_name [, int spool])
+iptc:array iptcparse(string iptcdata)
+lcg:double lcg_value()
+levenshtein:int levenshtein(string str1, string str2)
+link:string readlink(string filename)
+link:int linkinfo(string filename)
+link:int symlink(string target, string link)
+link:int link(string target, string link)
+mail:int ezmlm_hash(string addr)
+mail:int mail(string to, string subject, string message [, string additional_headers])
+math:int abs(int number)
+math:double ceil(double number)
+math:double floor(double number)
+math:double round(double number [, int precision])
+math:double sin(double number)
+math:double cos(double number)
+math:double tan(double number)
+math:double asin(double number)
+math:double acos(double number)
+math:double atan(double number)
+math:double atan2(double y, double x)
+math:double pi(void)
+math:double pow(double base, double exponent)
+math:double exp(double number)
+math:double log(double number)
+math:double log10(double number)
+math:double sqrt(double number)
+math:double deg2rad(double number)
+math:double rad2deg(double number)
+math:int bindec(string binary_number)
+math:int hexdec(string hexadecimal_number)
+math:int octdec(string octal_number)
+math:string decbin(int decimal_number)
+math:string decoct(int decimal_number)
+math:string dechex(int decimal_number)
+math:string base_convert(string number, int frombase, int tobase)
+math:string number_format(double number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])
+md5:string md5(string str)
+metaphone:string metaphone(string text, int phones)
+microtime:string microtime(void)
+microtime:array gettimeofday(void)
+microtime:array getrusage([int who])
+output:void ob_start(void)
+output:void ob_end_flush(void)
+output:void ob_end_clean(void)
+output:string ob_get_contents(void)
+output:string ob_get_length(void)
+output:void ob_implicit_flush([int flag])
+pack:string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
+pack:array unpack(string format, string input)
+pageinfo:int getmyuid(void)
+pageinfo:int getmypid(void)
+pageinfo:int getmyinode(void)
+pageinfo:int getlastmod(void)
+rand:void srand(int seed)
+rand:void mt_srand(int seed)
+rand:int rand([int min, int max])
+rand:int mt_rand([int min, int max])
+rand:int getrandmax(void)
+rand:int mt_getrandmax(void)
+quot_print:string quoted_printable_decode(string str)
+reg:int ereg(string pattern, string string [, array registers])
+reg:int eregi(string pattern, string string [, array registers])
+reg:string ereg_replace(string pattern, string replacement, string string)
+reg:string eregi_replace(string pattern, string replacement, string string])
+reg:array split(string pattern, string string [, int limit])
+reg:array spliti(string pattern, string string [, int limit])
+reg:string sql_regcase(string string)
+soundex:string soundex(string str)
+string:string bin2hex(string data)
+string:int strspn(string str, string mask)
+string:int strcspn(string str, string mask)
+string:string rtrim(string str)
+string:string chop(string str)
+string:string trim(string str)
+string:string ltrim(string str)
+string:string wordwrap(string str [, int width [, string break [, int cut]]])
+string:array explode(string separator, string str [, int limit])
+string:string join(array src, string glue)
+string:string implode(string glue, array src)
+string:string strtok([string str,] string token)
+string:string strtoupper(string str)
+string:string strtolower(string str)
+string:string basename(string path)
+string:string dirname(string path)
+string:array pathinfo(string path)
+string:string stristr(string haystack, string needle)
+string:string strstr(string haystack, string needle)
+string:string strchr(string haystack, string needle)
+string:int strpos(string haystack, string needle [, int offset])
+string:int strrpos(string haystack, string needle)
+string:string strrchr(string haystack, string needle)
+string:string chunk_split(string str [, int chunklen [, string ending]])
+string:string substr(string str, int start [, int length])
+string:string substr_replace(string str, string repl, int start [, int length])
+string:string quotemeta(string str)
+string:int ord(string character)
+string:string chr(int ascii)
+string:string ucfirst(string str)
+string:string ucwords(string str)
+string:string strtr(string str, string from, string to)
+string:string strrev(string str)
+string:int similar_text(string str1, string str2 [, double percent])
+string:string addcslashes(string str, string charlist)
+string:string addslashes(string str)
+string:string stripcslashes(string str)
+string:string stripslashes(string str)
+string:string str_replace(string needle, string str, string haystack)
+string:string hebrev(string str [, int max_chars_per_line])
+string:string hebrevc(string str [, int max_chars_per_line])
+string:string nl2br(string str)
+string:string strip_tags(string str [, string allowable_tags])
+string:string setlocale(string category, string locale)
+string:void parse_str(string encoded_string, [array result])
+string:string str_repeat(string input, int mult)
+string:mixed count_chars(string input [, int mode])
+string:int strnatcmp(string s1, string s2)
+string:int strnatcasecmp(string s1, string s2)
+string:int substr_count(string haystack, string needle)
+string:string str_pad(string input, int pad_length [, string pad_string [, int pad_type]])
+string:mixed sscanf(string str, string format [, string ...])
+syslog:void define_syslog_variables(void)
+syslog:int openlog(string ident, int option, int facility)
+syslog:int closelog(void)
+syslog:int syslog(int priority, string message)
+uniqid:string uniqid(string prefix, [bool more_entropy])
+url:array parse_url(string url)
+url:string urlencode(string str)
+url:string urldecode(string str)
+url:string rawurlencode(string str)
+url:string rawurldecode(string str)
+var:void var_dump(mixed var)
+var:string serialize(mixed variable)
+var:mixed unserialize(string variable_representation)
+swf:void swf_openfile(string name, double xsize, double ysize, double framerate, double r, double g, double b)
+swf:void swf_closefile(void)
+swf:void swf_labelframe(string name)
+swf:void swf_showframe(void)
+swf:void swf_setframe(int frame_number)
+swf:int swf_getframe(void)
+swf:void swf_mulcolor(double r, double g, double b, double a)
+swf:void swf_addcolor(double r, double g, double b, double a)
+swf:void swf_placeobject(int objid, int depth)
+swf:void swf_modifyobject(int depth, int how)
+swf:void swf_removeobject(int depth)
+swf:int swf_nextid(void)
+swf:void swf_startdoaction(void)
+swf:void swf_enddoaction(void)
+swf:void swf_actiongotoframe(int frame_number)
+swf:void swf_actiongeturl(string url, string target)
+swf:void swf_actionnextframe(void)
+swf:void swf_actionprevframe(void)
+swf:void swf_actionplay(void)
+swf:void swf_actionstop(void)
+swf:void swf_actiontogglequality(void)
+swf:void swf_actionwaitforframe(int frame, int skipcount)
+swf:void swf_actionsettarget(string target)
+swf:void swf_actiongotolabel(string label)
+swf:void swf_defineline(int objid, double x1, double y1, double x2, double y2, double width)
+swf:void swf_definerect(int objid, double x1, double y1, double x2, double y2, double width)
+swf:void swf_definepoly(int obj_id, array coords, int npoints, double width)
+swf:void swf_startshape(int objid)
+swf:void swf_shapelinesolid(double r, double g, double b, double a, double width)
+swf:void swf_shapefilloff(void)
+swf:void swf_shapefillsolid(double r, double g, double b, double a)
+swf:void swf_shapefillbitmapclip(int bitmapid)
+swf:void swf_shapefillbitmaptile(int bitmapid)
+swf:void swf_shapemoveto(double x, double y)
+swf:void swf_shapelineto(double x, double y)
+swf:void swf_shapecurveto(double x1, double y1, double x2, double y2)
+swf:void swf_shapecurveto3(double x1, double y1, double x2, double y2, double x3, double y3)
+swf:void swf_shapearc(double x, double y, double r, double ang1, double ang2)
+swf:void swf_endshape(void)
+swf:void swf_definefont(int fontid, string name)
+swf:void swf_setfont(int fontid)
+swf:void swf_fontsize(double height)
+swf:void swf_fontslant(double slant)
+swf:void swf_fonttracking(track)
+swf:array swf_getfontinfo(void)
+swf:void swf_definetext(int objid, string str, int docCenter)
+swf:void swf_textwidth(string str)
+swf:void swf_definebitmap(int objid, string imgname)
+swf:array swf_getbitmapinfo(int bitmapid)
+swf:void swf_startsymbol(int objid)
+swf:void swf_endsymbol(void)
+swf:void swf_startbutton(int objid, int type)
+swf:void swf_addbuttonrecord(int state, int objid, int depth)
+swf:void swf_oncondition(int transitions)
+swf:void swf_endbutton(void)
+swf:void swf_viewport(double xmin, double xmax, double ymin, double ymax)
+swf:void swf_ortho2(double xmin, double xmax, double ymin, double ymax)
+swf:void swf_ortho(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
+swf:void swf_polarview(double dist, double azimuth, double incidence, double twist)
+swf:void swf_perspective(double fovy, double aspect, double near, double far)
+swf:void swf_lookat(double vx, double vy, double vz, double px, double py, double pz, double twist)
+swf:void swf_pushmatrix(void)
+swf:void swf_popmatrix(void)
+swf:void swf_scale(double x, double y, double z)
+swf:void swf_translate(double x, double y, double z)
+swf:void swf_rotate(double angle, string axis)
+swf:void swf_posround(int doit)
+sybase_db:int sybase_connect([string host [, string user [, string password [, string charset]]]])
+sybase_db:int sybase_pconnect([string host [, string user [, string password [, string charset]]]])
+sybase_db:bool sybase_close([int link_id])
+sybase_db:bool sybase_select_db(string database [, int link_id])
+sybase_db:int sybase_query(string query [, int link_id])
+sybase_db:bool sybase_free_result(int result)
+sybase_db:string sybase_get_last_message(void)
+sybase_db:int sybase_num_rows(int result)
+sybase_db:int sybase_num_fields(int result)
+sybase_db:array sybase_fetch_row(int result)
+sybase_db:object sybase_fetch_object(int result)
+sybase_db:array sybase_fetch_array(int result)
+sybase_db:bool sybase_data_seek(int result, int offset)
+sybase_db:object sybase_fetch_field(int result [, int offset])
+sybase_db:bool sybase_field_seek(int result, int offset)
+sybase_db:string sybase_result(int result, int row, mixed field)
+sybase_db:void sybase_min_error_severity(int severity)
+sybase_db:void sybase_min_message_severity(int severity)
+sybase_ct:int sybase_connect([string host [, string user [, string password [, string charset]]]])
+sybase_ct:int sybase_pconnect([string host [, string user [, string password [, string charset]]]])
+sybase_ct:bool sybase_close([int link_id])
+sybase_ct:bool sybase_select_db(string database [, int link_id])
+sybase_ct:int sybase_query(string query [, int link_id])
+sybase_ct:bool sybase_free_result(int result)
+sybase_ct:int sybase_num_rows(int result)
+sybase_ct:int sybase_num_fields(int result)
+sybase_ct:array sybase_fetch_row(int result)
+sybase_ct:object sybase_fetch_object(int result)
+sybase_ct:array sybase_fetch_array(int result)
+sybase_ct:bool sybase_data_seek(int result, int offset)
+sybase_ct:object sybase_fetch_field(int result [, int offset])
+sybase_ct:bool sybase_field_seek(int result, int offset)
+sybase_ct:string sybase_result(int result, int row, mixed field)
+sybase_ct:int sybase_affected_rows([int link_id])
+sybase_ct:void sybase_min_client_severity(int severity)
+sybase_ct:void sybase_min_server_severity(int severity)
+sysvsem:int sem_get(int key [, int max_acquire [, int perm]])
+sysvsem:int sem_acquire(int id)
+sysvsem:int sem_release(int id)
+sysvshm:int shm_attach(int key [, int memsize [, int perm]])
+sysvshm:int shm_detach(int shm_identifier)
+sysvshm:int shm_remove(int shm_identifier)
+sysvshm:int shm_put_var(int shm_identifier, int variable_key, mixed variable)
+sysvshm:mixed shm_get_var(int id, int variable_key)
+sysvshm:int shm_remove_var(int id, int variable_key)
+wddx:string wddx_serialize_value(mixed var [, string comment])
+wddx:string wddx_serialize_vars(mixed var_name [, mixed ...])
+wddx:int wddx_packet_start([string comment])
+wddx:string wddx_packet_end(int packet_id)
+wddx:int wddx_add_vars(int packet_id [, mixed var_names [, mixed ...]])
+wddx:mixed wddx_deserialize(string packet)
+xml:int xml_parser_create(void)
+xml:int xml_set_object(int pind, object &obj)
+xml:int xml_set_element_handler(int pind, string shdl, string ehdl)
+xml:int xml_set_character_data_handler(int pind, string hdl)
+xml:int xml_set_processing_instruction_handler(int pind, string hdl)
+xml:int xml_set_default_handler(int pind, string hdl)
+xml:int xml_set_unparsed_entity_decl_handler(int pind, string hdl)
+xml:int xml_set_notation_decl_handler(int pind, string hdl)
+xml:int xml_set_external_entity_ref_handler(int pind, string hdl)
+xml:int xml_parse(int pind, string data [, int isFinal])
+xml:int xml_parse_into_struct(int pind, string data, array &struct, array &index)
+xml:int xml_get_error_code(int pind)
+xml:string xml_error_string(int code)
+xml:int xml_get_current_line_number(int pind)
+xml:int xml_get_current_column_number(int pind)
+xml:int xml_get_current_byte_index(int pind)
+xml:int xml_parser_free(int pind)
+xml:int xml_parser_set_option(int pind, int option, mixed value)
+xml:int xml_parser_get_option(int pind, int option)
+xml:string utf8_encode(string data)
+xml:string utf8_decode(string data)
+yaz:int yaz_connect(string zurl [, string user [, string group, string pass]])
+yaz:int yaz_close(int id)
+yaz:int yaz_search(int id, string type, string query)
+yaz:int yaz_wait()
+yaz:int yaz_errno(int id)
+yaz:string yaz_error(int id)
+yaz:string yaz_addinfo(int id)
+yaz:int yaz_hits(int id)
+yaz:string yaz_record(int id, int pos, string type)
+yaz:int yaz_syntax(int id, string syntax)
+yaz:int yaz_element(int id, string elementsetname)
+yaz:int yaz_range(int id, int start, int number)
+yp:string yp_get_default_domain(void)
+yp:int yp_order(string domain, string map)
+yp:string yp_master(string domain, string map)
+yp:string yp_match(string domain, string map, string key)
+yp:array yp_first(string domain, string map)
+yp:array yp_next(string domain, string map, string key)
+zlib:array gzfile(string filename [, int use_include_path])
+zlib:int gzopen(string filename, string mode [, int use_include_path])
+zlib:int gzclose(int zp)
+zlib:int gzeof(int zp)
+zlib:string gzgets(int zp, int length)
+zlib:string gzgetc(int zp)
+zlib:string gzgetss(int zp, int length [, string allowable_tags])
+zlib:int gzwrite(int zp, string str [, int length])
+zlib:int gzputs(int zp, string str [, int length])
+zlib:int gzrewind(int zp)
+zlib:int gztell(int zp)
+zlib:int gzseek(int zp, int offset)
+zlib:int readgzfile(string filename [, int use_include_path])
+zlib:int gzpassthru(int zp)
+zlib:string gzread(int zp, int length)
+zlib:string gzcompress(string data [, int level])
+zlib:string gzuncompress(string data, int length)
+configuration-parser:void parse_ini_file(string filename)
+main:void set_time_limit(int seconds)
+configuration-parser:void parse_ini_file(string filename)
+apache:string apache_note(string note_name [, string note_value])
+apache:int virtual(string filename)
+apache:array getallheaders(void)
+apache:class apache_lookup_uri(string URI)
diff --git a/languages/php/doc/Makefile.am b/languages/php/doc/Makefile.am
new file mode 100644
index 00000000..163d435b
--- /dev/null
+++ b/languages/php/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = php.toc php_bugs.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA = php.index
+
diff --git a/languages/php/doc/php.toc b/languages/php/doc/php.toc
new file mode 100644
index 00000000..f09df62e
--- /dev/null
+++ b/languages/php/doc/php.toc
@@ -0,0 +1,7069 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>PHP Manual</title>
+<base href="http://www.php.net/manual/en/"/>
+<tocsect1 name="PHP Manual" url="manual.php">
+ <tocsect2 name="Preface" url="preface.php"/>
+</tocsect1>
+<tocsect1 name="Getting Started" url="getting-started.php">
+ <tocsect2 name="Introduction" url="introduction.php"/>
+ <tocsect2 name="A simple tutorial" url="tutorial.php"/>
+</tocsect1>
+<tocsect1 name="Installation and Configuration" url="install.php">
+ <tocsect2 name="General Installation Considerations" url="install.general.php"/>
+ <tocsect2 name="Installation on Unix systems" url="install.unix.php"/>
+ <tocsect2 name="Installation on Mac OS X" url="install.macosx.php"/>
+ <tocsect2 name="Installation on Windows systems" url="install.windows.php"/>
+ <tocsect2 name="Installation of PECL extensions" url="install.pecl.php"/>
+ <tocsect2 name="Problems?" url="install.problems.php"/>
+ <tocsect2 name="Runtime Configuration" url="configuration.php"/>
+</tocsect1>
+<tocsect1 name="Language Reference" url="langref.php">
+ <tocsect2 name="Basic syntax" url="language.basic-syntax.php"/>
+ <tocsect2 name="Types" url="language.types.php"/>
+ <tocsect2 name="Variables" url="language.variables.php"/>
+ <tocsect2 name="Constants" url="language.constants.php"/>
+ <tocsect2 name="Expressions" url="language.expressions.php"/>
+ <tocsect2 name="Operators" url="language.operators.php"/>
+ <tocsect2 name="Control Structures" url="language.control-structures.php"/>
+ <tocsect2 name="Functions" url="language.functions.php"/>
+ <tocsect2 name="Classes and Objects (PHP 4)" url="language.oop.php"/>
+ <tocsect2 name="Classes and Objects (PHP 5)" url="language.oop5.php"/>
+ <tocsect2 name="Namespaces" url="language.namespaces.php"/>
+ <tocsect2 name="Exceptions" url="language.exceptions.php"/>
+ <tocsect2 name="References Explained" url="language.references.php"/>
+ <tocsect2 name="Predefined variables" url="reserved.variables.php"/>
+ <tocsect2 name="Predefined Exceptions" url="reserved.exceptions.php"/>
+ <tocsect2 name="Context options and parameters" url="context.php"/>
+</tocsect1>
+<tocsect1 name="Security" url="security.php">
+ <tocsect2 name="Introduction" url="security.intro.php"/>
+ <tocsect2 name="General considerations" url="security.general.php"/>
+ <tocsect2 name="Installed as CGI binary" url="security.cgi-bin.php"/>
+ <tocsect2 name="Installed as an Apache module" url="security.apache.php"/>
+ <tocsect2 name="Filesystem Security" url="security.filesystem.php"/>
+ <tocsect2 name="Database Security" url="security.database.php"/>
+ <tocsect2 name="Error Reporting" url="security.errors.php"/>
+ <tocsect2 name="Using Register Globals" url="security.globals.php"/>
+ <tocsect2 name="User Submitted Data" url="security.variables.php"/>
+ <tocsect2 name="Magic Quotes" url="security.magicquotes.php"/>
+ <tocsect2 name="Hiding PHP" url="security.hiding.php"/>
+ <tocsect2 name="Keeping Current" url="security.current.php"/>
+</tocsect1>
+<tocsect1 name="Features" url="features.php">
+ <tocsect2 name="HTTP authentication with PHP" url="features.http-auth.php"/>
+ <tocsect2 name="Cookies" url="features.cookies.php"/>
+ <tocsect2 name="Sessions" url="features.sessions.php"/>
+ <tocsect2 name="Dealing with XForms" url="features.xforms.php"/>
+ <tocsect2 name="Handling file uploads" url="features.file-upload.php"/>
+ <tocsect2 name="Using remote files" url="features.remote-files.php"/>
+ <tocsect2 name="Connection handling" url="features.connection-handling.php"/>
+ <tocsect2 name="Persistent Database Connections" url="features.persistent-connections.php"/>
+ <tocsect2 name="Safe Mode" url="features.safe-mode.php"/>
+ <tocsect2 name="Using PHP from the command line" url="features.commandline.php"/>
+</tocsect1>
+<tocsect1 name="APC" url="book.apc.php">
+ <tocsect2 name="Introduction" url="intro.apc.php"/>
+ <tocsect2 name="Installing/Configuring" url="apc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="apc.constants.php"/>
+ <tocsect2 name="APC Functions" url="ref.apc.php"/>
+</tocsect1>
+<tocsect1 name="APD" url="book.apd.php">
+ <tocsect2 name="Introduction" url="intro.apd.php"/>
+ <tocsect2 name="Installing/Configuring" url="apd.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="apd.constants.php"/>
+ <tocsect2 name="Examples" url="apd.examples.php"/>
+ <tocsect2 name="APD Functions" url="ref.apd.php"/>
+</tocsect1>
+<tocsect1 name="bcompiler" url="book.bcompiler.php">
+ <tocsect2 name="Introduction" url="intro.bcompiler.php"/>
+ <tocsect2 name="Installing/Configuring" url="bcompiler.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="bcompiler.constants.php"/>
+ <tocsect2 name="bcompiler Functions" url="ref.bcompiler.php"/>
+</tocsect1>
+<tocsect1 name="Error Handling" url="book.errorfunc.php">
+ <tocsect2 name="Introduction" url="intro.errorfunc.php"/>
+ <tocsect2 name="Installing/Configuring" url="errorfunc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="errorfunc.constants.php"/>
+ <tocsect2 name="Examples" url="errorfunc.examples.php"/>
+ <tocsect2 name="Error Handling Functions" url="ref.errorfunc.php"/>
+</tocsect1>
+<tocsect1 name="Object overloading" url="book.overload.php">
+ <tocsect2 name="Introduction" url="intro.overload.php"/>
+ <tocsect2 name="Installing/Configuring" url="overload.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="overload.constants.php"/>
+ <tocsect2 name="Examples" url="overload.examples.php"/>
+ <tocsect2 name="Object overloading Functions" url="ref.overload.php"/>
+</tocsect1>
+<tocsect1 name="Output Control" url="book.outcontrol.php">
+ <tocsect2 name="Introduction" url="intro.outcontrol.php"/>
+ <tocsect2 name="Installing/Configuring" url="outcontrol.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="outcontrol.constants.php"/>
+ <tocsect2 name="Examples" url="outcontrol.examples.php"/>
+ <tocsect2 name="Output Control Functions" url="ref.outcontrol.php"/>
+</tocsect1>
+<tocsect1 name="PHP Options/Info" url="book.info.php">
+ <tocsect2 name="Introduction" url="intro.info.php"/>
+ <tocsect2 name="Installing/Configuring" url="info.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="info.constants.php"/>
+ <tocsect2 name="PHP Options/Info Functions" url="ref.info.php"/>
+</tocsect1>
+<tocsect1 name="runkit" url="book.runkit.php">
+ <tocsect2 name="Introduction" url="intro.runkit.php"/>
+ <tocsect2 name="Predefined Constants" url="runkit.constants.php"/>
+ <tocsect2 name="Installing/Configuring" url="runkit.setup.php"/>
+ <tocsect2 name="runkit Functions" url="ref.runkit.php"/>
+</tocsect1>
+<tocsect1 name="ID3" url="book.id3.php">
+ <tocsect2 name="Introduction" url="intro.id3.php"/>
+ <tocsect2 name="Installing/Configuring" url="id3.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="id3.constants.php"/>
+ <tocsect2 name="ID3 Functions" url="ref.id3.php"/>
+</tocsect1>
+<tocsect1 name="oggvorbis" url="book.oggvorbis.php">
+ <tocsect2 name="Introduction" url="intro.oggvorbis.php"/>
+ <tocsect2 name="Installing/Configuring" url="oggvorbis.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="oggvorbis.constants.php"/>
+ <tocsect2 name="Context options" url="oggvorbis.contexts.php"/>
+ <tocsect2 name="Examples" url="oggvorbis.examples.php"/>
+</tocsect1>
+<tocsect1 name="OpenAL" url="book.openal.php">
+ <tocsect2 name="Introduction" url="intro.openal.php"/>
+ <tocsect2 name="Installing/Configuring" url="openal.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="openal.constants.php"/>
+ <tocsect2 name="OpenAL Functions" url="ref.openal.php"/>
+</tocsect1>
+<tocsect1 name="KADM5" url="book.kadm5.php">
+ <tocsect2 name="Introduction" url="intro.kadm5.php"/>
+ <tocsect2 name="Installing/Configuring" url="kadm5.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="kadm5.constants.php"/>
+ <tocsect2 name="Examples" url="kadm5.examples.php"/>
+ <tocsect2 name="KADM5 Functions" url="ref.kadm5.php"/>
+</tocsect1>
+<tocsect1 name="Radius" url="book.radius.php">
+ <tocsect2 name="Introduction" url="intro.radius.php"/>
+ <tocsect2 name="Installing/Configuring" url="radius.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="radius.constants.php"/>
+ <tocsect2 name="Examples" url="radius.examples.php"/>
+ <tocsect2 name="Radius Functions" url="ref.radius.php"/>
+</tocsect1>
+<tocsect1 name="Calendar" url="book.calendar.php">
+ <tocsect2 name="Introduction" url="intro.calendar.php"/>
+ <tocsect2 name="Installing/Configuring" url="calendar.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="calendar.constants.php"/>
+ <tocsect2 name="Calendar Functions" url="ref.calendar.php"/>
+</tocsect1>
+<tocsect1 name="Date/Time" url="book.datetime.php">
+ <tocsect2 name="Introduction" url="intro.datetime.php"/>
+ <tocsect2 name="Installing/Configuring" url="datetime.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="datetime.constants.php"/>
+ <tocsect2 name="List of Supported Timezones" url="timezones.php"/>
+ <tocsect2 name="Date/Time Functions" url="ref.datetime.php"/>
+</tocsect1>
+<tocsect1 name="Newt" url="book.newt.php">
+ <tocsect2 name="Introduction" url="intro.newt.php"/>
+ <tocsect2 name="Installing/Configuring" url="newt.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="newt.constants.php"/>
+ <tocsect2 name="Examples" url="newt.examples.php"/>
+ <tocsect2 name="Newt Functions" url="ref.newt.php"/>
+</tocsect1>
+<tocsect1 name="Ncurses" url="book.ncurses.php">
+ <tocsect2 name="Introduction" url="intro.ncurses.php"/>
+ <tocsect2 name="Installing/Configuring" url="ncurses.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ncurses.constants.php"/>
+ <tocsect2 name="Ncurses Functions" url="ref.ncurses.php"/>
+</tocsect1>
+<tocsect1 name="Readline" url="book.readline.php">
+ <tocsect2 name="Introduction" url="intro.readline.php"/>
+ <tocsect2 name="Installing/Configuring" url="readline.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="readline.constants.php"/>
+ <tocsect2 name="Readline Functions" url="ref.readline.php"/>
+</tocsect1>
+<tocsect1 name="Bzip2" url="book.bzip2.php">
+ <tocsect2 name="Introduction" url="intro.bzip2.php"/>
+ <tocsect2 name="Installing/Configuring" url="bzip2.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="bzip2.constants.php"/>
+ <tocsect2 name="Examples" url="bzip2.examples.php"/>
+ <tocsect2 name="Bzip2 Functions" url="ref.bzip2.php"/>
+</tocsect1>
+<tocsect1 name="LZF" url="book.lzf.php">
+ <tocsect2 name="Introduction" url="intro.lzf.php"/>
+ <tocsect2 name="Installing/Configuring" url="lzf.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="lzf.constants.php"/>
+ <tocsect2 name="LZF Functions" url="ref.lzf.php"/>
+</tocsect1>
+<tocsect1 name="Phar" url="book.phar.php">
+ <tocsect2 name="Introduction" url="intro.phar.php"/>
+ <tocsect2 name="Installing/Configuring" url="phar.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="phar.constants.php"/>
+ <tocsect2 name="Using Phar Archives" url="phar.using.php"/>
+ <tocsect2 name="Creating Phar Archives" url="phar.creating.php"/>
+ <tocsect2 name="What makes a phar a phar and not a tar or a zip?" url="phar.fileformat.php"/>
+ <tocsect2 name="Phar" url="class.Phar.php"/>
+ <tocsect2 name="PharData" url="class.PharData.php"/>
+ <tocsect2 name="PharFileInfo" url="class.PharFileInfo.php"/>
+ <tocsect2 name="PharException" url="class.PharException.php"/>
+</tocsect1>
+<tocsect1 name="Rar" url="book.rar.php">
+ <tocsect2 name="Introduction" url="intro.rar.php"/>
+ <tocsect2 name="Installing/Configuring" url="rar.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="rar.constants.php"/>
+ <tocsect2 name="Examples" url="rar.examples.php"/>
+ <tocsect2 name="Rar Functions" url="ref.rar.php"/>
+</tocsect1>
+<tocsect1 name="Zip" url="book.zip.php">
+ <tocsect2 name="Introduction" url="intro.zip.php"/>
+ <tocsect2 name="Installing/Configuring" url="zip.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="zip.constants.php"/>
+ <tocsect2 name="Examples" url="zip.examples.php"/>
+ <tocsect2 name="Zip Functions" url="ref.zip.php"/>
+</tocsect1>
+<tocsect1 name="Zlib" url="book.zlib.php">
+ <tocsect2 name="Introduction" url="intro.zlib.php"/>
+ <tocsect2 name="Installing/Configuring" url="zlib.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="zlib.constants.php"/>
+ <tocsect2 name="Examples" url="zlib.examples.php"/>
+ <tocsect2 name="Zlib Functions" url="ref.zlib.php"/>
+</tocsect1>
+<tocsect1 name="MCVE" url="book.mcve.php">
+ <tocsect2 name="Introduction" url="intro.mcve.php"/>
+ <tocsect2 name="Installing/Configuring" url="mcve.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mcve.constants.php"/>
+ <tocsect2 name="MCVE Functions" url="ref.mcve.php"/>
+</tocsect1>
+<tocsect1 name="SPPLUS" url="book.spplus.php">
+ <tocsect2 name="Introduction" url="intro.spplus.php"/>
+ <tocsect2 name="Installing/Configuring" url="spplus.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="spplus.constants.php"/>
+ <tocsect2 name="SPPLUS Functions" url="ref.spplus.php"/>
+</tocsect1>
+<tocsect1 name="Cracklib" url="book.crack.php">
+ <tocsect2 name="Introduction" url="intro.crack.php"/>
+ <tocsect2 name="Installing/Configuring" url="crack.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="crack.constants.php"/>
+ <tocsect2 name="Examples" url="crack.examples.php"/>
+ <tocsect2 name="Crack Functions" url="ref.crack.php"/>
+</tocsect1>
+<tocsect1 name="Hash" url="book.hash.php">
+ <tocsect2 name="Introduction" url="intro.hash.php"/>
+ <tocsect2 name="Installing/Configuring" url="hash.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="hash.constants.php"/>
+ <tocsect2 name="Hash Functions" url="ref.hash.php"/>
+</tocsect1>
+<tocsect1 name="Mcrypt" url="book.mcrypt.php">
+ <tocsect2 name="Introduction" url="intro.mcrypt.php"/>
+ <tocsect2 name="Installing/Configuring" url="mcrypt.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mcrypt.constants.php"/>
+ <tocsect2 name="Mcrypt ciphers" url="mcrypt.ciphers.php"/>
+ <tocsect2 name="Examples" url="mcrypt.examples.php"/>
+ <tocsect2 name="Mcrypt Functions" url="ref.mcrypt.php"/>
+</tocsect1>
+<tocsect1 name="Mhash" url="book.mhash.php">
+ <tocsect2 name="Introduction" url="intro.mhash.php"/>
+ <tocsect2 name="Installing/Configuring" url="mhash.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mhash.constants.php"/>
+ <tocsect2 name="Examples" url="mhash.examples.php"/>
+ <tocsect2 name="Mhash Functions" url="ref.mhash.php"/>
+</tocsect1>
+<tocsect1 name="OpenSSL" url="book.openssl.php">
+ <tocsect2 name="Introduction" url="intro.openssl.php"/>
+ <tocsect2 name="Installing/Configuring" url="openssl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="openssl.constants.php"/>
+ <tocsect2 name="Key/Certificate parameters" url="openssl.certparams.php"/>
+ <tocsect2 name="Certificate Verification" url="openssl.cert.verification.php"/>
+ <tocsect2 name="OpenSSL Functions" url="ref.openssl.php"/>
+</tocsect1>
+<tocsect1 name="DBA" url="book.dba.php">
+ <tocsect2 name="Introduction" url="intro.dba.php"/>
+ <tocsect2 name="Installing/Configuring" url="dba.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dba.constants.php"/>
+ <tocsect2 name="Examples" url="dba.examples.php"/>
+ <tocsect2 name="DBA Functions" url="ref.dba.php"/>
+</tocsect1>
+<tocsect1 name="dbx" url="book.dbx.php">
+ <tocsect2 name="Introduction" url="intro.dbx.php"/>
+ <tocsect2 name="Installing/Configuring" url="dbx.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="constants.dbx.php"/>
+ <tocsect2 name="dbx Functions" url="ref.dbx.php"/>
+</tocsect1>
+<tocsect1 name="ODBC" url="book.uodbc.php">
+ <tocsect2 name="Introduction" url="intro.uodbc.php"/>
+ <tocsect2 name="Installing/Configuring" url="uodbc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="uodbc.constants.php"/>
+ <tocsect2 name="ODBC Functions" url="ref.uodbc.php"/>
+</tocsect1>
+<tocsect1 name="PDO" url="book.pdo.php">
+ <tocsect2 name="Introduction" url="intro.pdo.php"/>
+ <tocsect2 name="Installing/Configuring" url="pdo.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pdo.constants.php"/>
+ <tocsect2 name="Connections and Connection management" url="pdo.connections.php"/>
+ <tocsect2 name="Transactions and auto-commit" url="pdo.transactions.php"/>
+ <tocsect2 name="Prepared statements and stored procedures" url="pdo.prepared-statements.php"/>
+ <tocsect2 name="Errors and error handling" url="pdo.error-handling.php"/>
+ <tocsect2 name="Large Objects (LOBs)" url="pdo.lobs.php"/>
+ <tocsect2 name="PDO" url="class.pdo.php"/>
+ <tocsect2 name="PDOStatement" url="class.pdostatement.php"/>
+ <tocsect2 name="PDO Drivers" url="pdo.drivers.php"/>
+</tocsect1>
+<tocsect1 name="SDO" url="book.sdo.php">
+ <tocsect2 name="Introduction" url="intro.sdo.php"/>
+ <tocsect2 name="Installing/Configuring" url="sdo.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sdo.constants.php"/>
+ <tocsect2 name="Limitations" url="sdo.limitations.php"/>
+ <tocsect2 name="Examples" url="sdo.examples.php"/>
+ <tocsect2 name="SDO Functions" url="ref.sdo.php"/>
+</tocsect1>
+<tocsect1 name="SDO-DAS-Relational" url="book.sdodasrel.php">
+ <tocsect2 name="Introduction" url="intro.sdodasrel.php"/>
+ <tocsect2 name="Installing/Configuring" url="sdodasrel.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sdodasrel.constants.php"/>
+ <tocsect2 name="Examples" url="sdo.das.rel.examples.php"/>
+ <tocsect2 name="Limitations" url="sdo.das.rel.limitations.php"/>
+ <tocsect2 name="SDO-DAS-Relational Functions" url="ref.sdo.das.rel.php"/>
+</tocsect1>
+<tocsect1 name="dBase" url="book.dbase.php">
+ <tocsect2 name="Introduction" url="intro.dbase.php"/>
+ <tocsect2 name="Installing/Configuring" url="dbase.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dbase.constants.php"/>
+ <tocsect2 name="dBase Functions" url="ref.dbase.php"/>
+</tocsect1>
+<tocsect1 name="DB++" url="book.dbplus.php">
+ <tocsect2 name="Introduction" url="intro.dbplus.php"/>
+ <tocsect2 name="Installing/Configuring" url="dbplus.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dbplus.constants.php"/>
+ <tocsect2 name="DB++ Functions" url="ref.dbplus.php"/>
+</tocsect1>
+<tocsect1 name="FrontBase" url="book.fbsql.php">
+ <tocsect2 name="Introduction" url="intro.fbsql.php"/>
+ <tocsect2 name="Installing/Configuring" url="fbsql.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="fbsql.constants.php"/>
+ <tocsect2 name="FrontBase Functions" url="ref.fbsql.php"/>
+</tocsect1>
+<tocsect1 name="filePro" url="book.filepro.php">
+ <tocsect2 name="Introduction" url="intro.filepro.php"/>
+ <tocsect2 name="Installing/Configuring" url="filepro.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="filepro.constants.php"/>
+ <tocsect2 name="filePro Functions" url="ref.filepro.php"/>
+</tocsect1>
+<tocsect1 name="Firebird/InterBase" url="book.ibase.php">
+ <tocsect2 name="Introduction" url="intro.ibase.php"/>
+ <tocsect2 name="Installing/Configuring" url="ibase.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ibase.constants.php"/>
+ <tocsect2 name="Firebird/InterBase Functions" url="ref.ibase.php"/>
+</tocsect1>
+<tocsect1 name="Informix" url="book.ifx.php">
+ <tocsect2 name="Introduction" url="intro.ifx.php"/>
+ <tocsect2 name="Installing/Configuring" url="ifx.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ifx.constants.php"/>
+ <tocsect2 name="Informix Functions" url="ref.ifx.php"/>
+</tocsect1>
+<tocsect1 name="IBM DB2" url="book.ibm-db2.php">
+ <tocsect2 name="Introduction" url="intro.ibm-db2.php"/>
+ <tocsect2 name="Installing/Configuring" url="ibm-db2.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ibm-db2.constants.php"/>
+ <tocsect2 name="IBM DB2 Functions" url="ref.ibm-db2.php"/>
+</tocsect1>
+<tocsect1 name="Ingres II" url="book.ingres.php">
+ <tocsect2 name="Introduction" url="intro.ingres.php"/>
+ <tocsect2 name="Installing/Configuring" url="ingres.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ingres.constants.php"/>
+ <tocsect2 name="Examples" url="ingres.examples.php"/>
+ <tocsect2 name="Ingres II Functions" url="ref.ingres.php"/>
+</tocsect1>
+<tocsect1 name="MaxDB" url="book.maxdb.php">
+ <tocsect2 name="Introduction" url="intro.maxdb.php"/>
+ <tocsect2 name="Installing/Configuring" url="maxdb.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="maxdb.constants.php"/>
+ <tocsect2 name="Examples" url="maxdb.examples.php"/>
+ <tocsect2 name="MaxDB Functions" url="ref.maxdb.php"/>
+</tocsect1>
+<tocsect1 name="mSQL" url="book.msql.php">
+ <tocsect2 name="Introduction" url="intro.msql.php"/>
+ <tocsect2 name="Installing/Configuring" url="msql.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="msql.constants.php"/>
+ <tocsect2 name="Examples" url="msql.examples.php"/>
+ <tocsect2 name="mSQL Functions" url="ref.msql.php"/>
+</tocsect1>
+<tocsect1 name="Mssql" url="book.mssql.php">
+ <tocsect2 name="Introduction" url="intro.mssql.php"/>
+ <tocsect2 name="Installing/Configuring" url="mssql.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mssql.constants.php"/>
+ <tocsect2 name="Mssql Functions" url="ref.mssql.php"/>
+</tocsect1>
+<tocsect1 name="MySQL" url="book.mysql.php">
+ <tocsect2 name="Introduction" url="intro.mysql.php"/>
+ <tocsect2 name="Installing/Configuring" url="mysql.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mysql.constants.php"/>
+ <tocsect2 name="Examples" url="mysql.examples.php"/>
+ <tocsect2 name="MySQL Functions" url="ref.mysql.php"/>
+</tocsect1>
+<tocsect1 name="Mysqli" url="book.mysqli.php">
+ <tocsect2 name="Introduction" url="intro.mysqli.php"/>
+ <tocsect2 name="Installing/Configuring" url="mysqli.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mysqli.constants.php"/>
+ <tocsect2 name="MySQLi" url="class.mysqli.php"/>
+ <tocsect2 name="MySQLi_STMT" url="class.mysqli-stmt.php"/>
+ <tocsect2 name="MySQLi_Result" url="class.mysqli-result.php"/>
+ <tocsect2 name="MySQLi_Driver" url="class.mysqli-driver.php"/>
+ <tocsect2 name="Aliases and deprecated Mysqli Functions" url="ref.mysqli.php"/>
+</tocsect1>
+<tocsect1 name="OCI8" url="book.oci8.php">
+ <tocsect2 name="Introduction" url="intro.oci8.php"/>
+ <tocsect2 name="Installing/Configuring" url="oci8.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="oci8.constants.php"/>
+ <tocsect2 name="Examples" url="oci8.examples.php"/>
+ <tocsect2 name="Connecting Handling" url="oci8.connection.php"/>
+ <tocsect2 name="Supported Datatypes" url="oci8.datatypes.php"/>
+ <tocsect2 name="OCI8 Functions" url="ref.oci8.php"/>
+</tocsect1>
+<tocsect1 name="Ovrimos SQL" url="book.ovrimos.php">
+ <tocsect2 name="Introduction" url="intro.ovrimos.php"/>
+ <tocsect2 name="Installing/Configuring" url="ovrimos.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ovrimos.constants.php"/>
+ <tocsect2 name="Examples" url="ovrimos.examples.php"/>
+ <tocsect2 name="Ovrimos SQL Functions" url="ref.ovrimos.php"/>
+</tocsect1>
+<tocsect1 name="Paradox" url="book.paradox.php">
+ <tocsect2 name="Introduction" url="intro.paradox.php"/>
+ <tocsect2 name="Installing/Configuring" url="paradox.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="paradox.constants.php"/>
+ <tocsect2 name="Paradox Functions" url="ref.paradox.php"/>
+</tocsect1>
+<tocsect1 name="PostgreSQL" url="book.pgsql.php">
+ <tocsect2 name="Introduction" url="intro.pgsql.php"/>
+ <tocsect2 name="Installing/Configuring" url="pgsql.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pgsql.constants.php"/>
+ <tocsect2 name="Examples" url="pgsql.examples.php"/>
+ <tocsect2 name="PostgreSQL Functions" url="ref.pgsql.php"/>
+</tocsect1>
+<tocsect1 name="SQLite" url="book.sqlite.php">
+ <tocsect2 name="Introduction" url="intro.sqlite.php"/>
+ <tocsect2 name="Installing/Configuring" url="sqlite.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sqlite.constants.php"/>
+ <tocsect2 name="SQLite Functions" url="ref.sqlite.php"/>
+</tocsect1>
+<tocsect1 name="Sybase" url="book.sybase.php">
+ <tocsect2 name="Introduction" url="intro.sybase.php"/>
+ <tocsect2 name="Installing/Configuring" url="sybase.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sybase.constants.php"/>
+ <tocsect2 name="Sybase Functions" url="ref.sybase.php"/>
+</tocsect1>
+<tocsect1 name="Direct IO" url="book.dio.php">
+ <tocsect2 name="Introduction" url="intro.dio.php"/>
+ <tocsect2 name="Installing/Configuring" url="dio.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dio.constants.php"/>
+ <tocsect2 name="Direct IO Functions" url="ref.dio.php"/>
+</tocsect1>
+<tocsect1 name="Directories" url="book.dir.php">
+ <tocsect2 name="Installing/Configuring" url="dir.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dir.constants.php"/>
+ <tocsect2 name="Directory Functions" url="ref.dir.php"/>
+</tocsect1>
+<tocsect1 name="Fileinfo" url="book.fileinfo.php">
+ <tocsect2 name="Introduction" url="intro.fileinfo.php"/>
+ <tocsect2 name="Installing/Configuring" url="fileinfo.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="fileinfo.constants.php"/>
+ <tocsect2 name="Fileinfo Functions" url="ref.fileinfo.php"/>
+</tocsect1>
+<tocsect1 name="Filesystem" url="book.filesystem.php">
+ <tocsect2 name="Introduction" url="intro.filesystem.php"/>
+ <tocsect2 name="Installing/Configuring" url="filesystem.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="filesystem.constants.php"/>
+ <tocsect2 name="Filesystem Functions" url="ref.filesystem.php"/>
+</tocsect1>
+<tocsect1 name="Mimetype" url="book.mime-magic.php">
+ <tocsect2 name="Introduction" url="intro.mime-magic.php"/>
+ <tocsect2 name="Installing/Configuring" url="mime-magic.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mime-magic.constants.php"/>
+ <tocsect2 name="Mimetype Functions" url="ref.mime-magic.php"/>
+</tocsect1>
+<tocsect1 name="xattr" url="book.xattr.php">
+ <tocsect2 name="Introduction" url="intro.xattr.php"/>
+ <tocsect2 name="Installing/Configuring" url="xattr.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xattr.constants.php"/>
+ <tocsect2 name="xattr Functions" url="ref.xattr.php"/>
+</tocsect1>
+<tocsect1 name="xdiff" url="book.xdiff.php">
+ <tocsect2 name="Introduction" url="intro.xdiff.php"/>
+ <tocsect2 name="Installing/Configuring" url="xdiff.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xdiff.constants.php"/>
+ <tocsect2 name="xdiff Functions" url="ref.xdiff.php"/>
+</tocsect1>
+<tocsect1 name="Enchant" url="book.enchant.php">
+ <tocsect2 name="Introduction" url="intro.enchant.php"/>
+ <tocsect2 name="Installing/Configuring" url="enchant.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="enchant.constants.php"/>
+ <tocsect2 name="Examples" url="enchant.examples.php"/>
+ <tocsect2 name="Enchant Functions" url="ref.enchant.php"/>
+</tocsect1>
+<tocsect1 name="FriBiDi" url="book.fribidi.php">
+ <tocsect2 name="Introduction" url="intro.fribidi.php"/>
+ <tocsect2 name="Installing/Configuring" url="fribidi.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="fribidi.constants.php"/>
+ <tocsect2 name="FriBiDi Functions" url="ref.fribidi.php"/>
+</tocsect1>
+<tocsect1 name="Gettext" url="book.gettext.php">
+ <tocsect2 name="Introduction" url="intro.gettext.php"/>
+ <tocsect2 name="Installing/Configuring" url="gettext.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="gettext.constants.php"/>
+ <tocsect2 name="Gettext Functions" url="ref.gettext.php"/>
+</tocsect1>
+<tocsect1 name="i18n" url="book.i18n.php">
+ <tocsect2 name="Introduction" url="intro.i18n.php"/>
+ <tocsect2 name="Installing/Configuring" url="i18n.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="i18n.constants.php"/>
+ <tocsect2 name="i18n Functions" url="ref.i18n.php"/>
+</tocsect1>
+<tocsect1 name="iconv" url="book.iconv.php">
+ <tocsect2 name="Introduction" url="intro.iconv.php"/>
+ <tocsect2 name="Installing/Configuring" url="iconv.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="iconv.constants.php"/>
+ <tocsect2 name="iconv Functions" url="ref.iconv.php"/>
+</tocsect1>
+<tocsect1 name="intl" url="book.intl.php">
+ <tocsect2 name="Introduction" url="intro.intl.php"/>
+ <tocsect2 name="Installing/Configuring" url="intl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="intl.constants.php"/>
+ <tocsect2 name="Examples" url="intl.examples.php"/>
+ <tocsect2 name="intl Functions" url="ref.intl.php"/>
+ <tocsect2 name="Collator" url="class.collator.php"/>
+ <tocsect2 name="NumberFormatter" url="class.numberformatter.php"/>
+ <tocsect2 name="Locale" url="class.locale.php"/>
+ <tocsect2 name="Normalizer" url="class.normalizer.php"/>
+ <tocsect2 name="MessageFormatter" url="class.messageformatter.php"/>
+ <tocsect2 name="IntlDateFormatter" url="class.intldateformatter.php"/>
+</tocsect1>
+<tocsect1 name="Multibyte String" url="book.mbstring.php">
+ <tocsect2 name="Introduction" url="intro.mbstring.php"/>
+ <tocsect2 name="Installing/Configuring" url="mbstring.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mbstring.constants.php"/>
+ <tocsect2 name="Summaries of supported encodings" url="mbstring.encodings.php"/>
+ <tocsect2 name="Basics of Japanese multi-byte encodings" url="mbstring.ja-basic.php"/>
+ <tocsect2 name="HTTP Input and Output" url="mbstring.http.php"/>
+ <tocsect2 name="Supported Character Encodings" url="mbstring.supported-encodings.php"/>
+ <tocsect2 name="Function Overloading Feature" url="mbstring.overload.php"/>
+ <tocsect2 name="PHP Character Encoding Requirements" url="mbstring.php4.req.php"/>
+ <tocsect2 name="Multibyte String Functions" url="ref.mbstring.php"/>
+</tocsect1>
+<tocsect1 name="Pspell" url="book.pspell.php">
+ <tocsect2 name="Introduction" url="intro.pspell.php"/>
+ <tocsect2 name="Installing/Configuring" url="pspell.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pspell.constants.php"/>
+ <tocsect2 name="Pspell Functions" url="ref.pspell.php"/>
+</tocsect1>
+<tocsect1 name="Recode" url="book.recode.php">
+ <tocsect2 name="Introduction" url="intro.recode.php"/>
+ <tocsect2 name="Installing/Configuring" url="recode.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="recode.constants.php"/>
+ <tocsect2 name="Recode Functions" url="ref.recode.php"/>
+</tocsect1>
+<tocsect1 name="Unicode" url="book.unicode.php">
+ <tocsect2 name="Introduction" url="intro.unicode.php"/>
+ <tocsect2 name="Installing/Configuring" url="unicode.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="unicode.constants.php"/>
+ <tocsect2 name="Unicode Functions" url="ref.unicode.php"/>
+</tocsect1>
+<tocsect1 name="Exif" url="book.exif.php">
+ <tocsect2 name="Introduction" url="intro.exif.php"/>
+ <tocsect2 name="Installing/Configuring" url="exif.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="exif.constants.php"/>
+ <tocsect2 name="Exif Functions" url="ref.exif.php"/>
+</tocsect1>
+<tocsect1 name="GD" url="book.image.php">
+ <tocsect2 name="Introduction" url="intro.image.php"/>
+ <tocsect2 name="Installing/Configuring" url="image.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="image.constants.php"/>
+ <tocsect2 name="Examples" url="image.examples.php"/>
+ <tocsect2 name="GD Functions" url="ref.image.php"/>
+</tocsect1>
+<tocsect1 name="ImageMagick" url="book.imagick.php">
+ <tocsect2 name="Introduction" url="intro.imagick.php"/>
+ <tocsect2 name="Installing/Configuring" url="imagick.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="imagick.constants.php"/>
+ <tocsect2 name="Examples" url="imagick.examples.php"/>
+ <tocsect2 name="The Imagick class" url="class.imagick.php"/>
+ <tocsect2 name="The ImagickDraw class" url="class.imagickdraw.php"/>
+ <tocsect2 name="The ImagickPixel class" url="class.imagickpixel.php"/>
+ <tocsect2 name="The ImagickPixelIterator class" url="class.imagickpixeliterator.php"/>
+</tocsect1>
+<tocsect1 name="Cyrus" url="book.cyrus.php">
+ <tocsect2 name="Introduction" url="intro.cyrus.php"/>
+ <tocsect2 name="Installing/Configuring" url="cyrus.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="cyrus.constants.php"/>
+ <tocsect2 name="Cyrus Functions" url="ref.cyrus.php"/>
+</tocsect1>
+<tocsect1 name="IMAP" url="book.imap.php">
+ <tocsect2 name="Introduction" url="intro.imap.php"/>
+ <tocsect2 name="Installing/Configuring" url="imap.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="imap.constants.php"/>
+ <tocsect2 name="IMAP Functions" url="ref.imap.php"/>
+</tocsect1>
+<tocsect1 name="Mail" url="book.mail.php">
+ <tocsect2 name="Introduction" url="intro.mail.php"/>
+ <tocsect2 name="Installing/Configuring" url="mail.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mail.constants.php"/>
+ <tocsect2 name="Mail Functions" url="ref.mail.php"/>
+</tocsect1>
+<tocsect1 name="Mailparse" url="book.mailparse.php">
+ <tocsect2 name="Introduction" url="intro.mailparse.php"/>
+ <tocsect2 name="Installing/Configuring" url="mailparse.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mailparse.constants.php"/>
+ <tocsect2 name="Mailparse Functions" url="ref.mailparse.php"/>
+</tocsect1>
+<tocsect1 name="vpopmail" url="book.vpopmail.php">
+ <tocsect2 name="Introduction" url="intro.vpopmail.php"/>
+ <tocsect2 name="Installing/Configuring" url="vpopmail.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="vpopmail.constants.php"/>
+ <tocsect2 name="vpopmail Functions" url="ref.vpopmail.php"/>
+</tocsect1>
+<tocsect1 name="BC Math" url="book.bc.php">
+ <tocsect2 name="Introduction" url="intro.bc.php"/>
+ <tocsect2 name="Installing/Configuring" url="bc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="bc.constants.php"/>
+ <tocsect2 name="BC Math Functions" url="ref.bc.php"/>
+</tocsect1>
+<tocsect1 name="GMP" url="book.gmp.php">
+ <tocsect2 name="Introduction" url="intro.gmp.php"/>
+ <tocsect2 name="Installing/Configuring" url="gmp.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="gmp.constants.php"/>
+ <tocsect2 name="Examples" url="gmp.examples.php"/>
+ <tocsect2 name="GMP Functions" url="ref.gmp.php"/>
+</tocsect1>
+<tocsect1 name="Math" url="book.math.php">
+ <tocsect2 name="Introduction" url="intro.math.php"/>
+ <tocsect2 name="Installing/Configuring" url="math.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="math.constants.php"/>
+ <tocsect2 name="Math Functions" url="ref.math.php"/>
+</tocsect1>
+<tocsect1 name="Statistics" url="book.stats.php">
+ <tocsect2 name="Introduction" url="intro.stats.php"/>
+ <tocsect2 name="Installing/Configuring" url="stats.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="stats.constants.php"/>
+ <tocsect2 name="Statistic Functions" url="ref.stats.php"/>
+</tocsect1>
+<tocsect1 name="FDF" url="book.fdf.php">
+ <tocsect2 name="Introduction" url="intro.fdf.php"/>
+ <tocsect2 name="Installing/Configuring" url="fdf.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="fdf.constants.php"/>
+ <tocsect2 name="Examples" url="fdf.examples.php"/>
+ <tocsect2 name="FDF Functions" url="ref.fdf.php"/>
+</tocsect1>
+<tocsect1 name="GnuPG" url="book.gnupg.php">
+ <tocsect2 name="Introduction" url="intro.gnupg.php"/>
+ <tocsect2 name="Installing/Configuring" url="gnupg.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="gnupg.constants.php"/>
+ <tocsect2 name="Examples" url="gnupg.examples.php"/>
+ <tocsect2 name="GnuPG Functions" url="ref.gnupg.php"/>
+</tocsect1>
+<tocsect1 name="haru" url="book.haru.php">
+ <tocsect2 name="Introduction" url="intro.haru.php"/>
+ <tocsect2 name="Installing/Configuring" url="haru.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="haru.constants.php"/>
+ <tocsect2 name="Examples" url="haru.examples.php"/>
+ <tocsect2 name="Builtin Fonts And Encodings" url="haru.builtin.php"/>
+ <tocsect2 name="HaruException" url="class.haruexception.php"/>
+ <tocsect2 name="HaruDoc" url="class.harudoc.php"/>
+ <tocsect2 name="HaruPage" url="class.harupage.php"/>
+ <tocsect2 name="HaruFont" url="class.harufont.php"/>
+ <tocsect2 name="HaruImage" url="class.haruimage.php"/>
+ <tocsect2 name="HaruEncoder" url="class.haruencoder.php"/>
+ <tocsect2 name="HaruOutline" url="class.haruoutline.php"/>
+ <tocsect2 name="HaruAnnotation" url="class.haruannotation.php"/>
+ <tocsect2 name="HaruDestination" url="class.harudestination.php"/>
+</tocsect1>
+<tocsect1 name="Ming" url="book.ming.php">
+ <tocsect2 name="Introduction" url="intro.ming.php"/>
+ <tocsect2 name="Installing/Configuring" url="ming.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ming.constants.php"/>
+ <tocsect2 name="Examples" url="ming.examples.php"/>
+ <tocsect2 name="Ming Functions" url="ref.ming.php"/>
+ <tocsect2 name="SWFAction" url="class.swfaction.php"/>
+ <tocsect2 name="SWFBitmap" url="class.swfbitmap.php"/>
+ <tocsect2 name="SWFButton" url="class.swfbutton.php"/>
+ <tocsect2 name="SWFDisplayItem" url="class.swfdisplayitem.php"/>
+ <tocsect2 name="SWFFill" url="class.swffill.php"/>
+ <tocsect2 name="SWFFont" url="class.swffont.php"/>
+ <tocsect2 name="SWFFontChar" url="class.swffontchar.php"/>
+ <tocsect2 name="SWFGradient" url="class.swfgradient.php"/>
+ <tocsect2 name="SWFMorph" url="class.swfmorph.php"/>
+ <tocsect2 name="SWFMovie" url="class.swfmovie.php"/>
+ <tocsect2 name="SWFPrebuiltClip" url="class.swfprebuiltclip.php"/>
+ <tocsect2 name="SWFShape" url="class.swfshape.php"/>
+ <tocsect2 name="SWFSound" url="class.swfsound.php"/>
+ <tocsect2 name="SWFSoundInstance" url="class.swfsoundinstance.php"/>
+ <tocsect2 name="SWFSprite" url="class.swfsprite.php"/>
+ <tocsect2 name="SWFText" url="class.swftext.php"/>
+ <tocsect2 name="SWFTextField" url="class.swftextfield.php"/>
+ <tocsect2 name="SWFVideoStream" url="class.swfvideostream.php"/>
+</tocsect1>
+<tocsect1 name="PDF" url="book.pdf.php">
+ <tocsect2 name="Introduction" url="intro.pdf.php"/>
+ <tocsect2 name="Installing/Configuring" url="pdf.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pdf.constants.php"/>
+ <tocsect2 name="Examples" url="pdf.examples.php"/>
+ <tocsect2 name="PDF Functions" url="ref.pdf.php"/>
+</tocsect1>
+<tocsect1 name="PS" url="book.ps.php">
+ <tocsect2 name="Introduction" url="intro.ps.php"/>
+ <tocsect2 name="Installing/Configuring" url="ps.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ps.constants.php"/>
+ <tocsect2 name="PS Functions" url="ref.ps.php"/>
+</tocsect1>
+<tocsect1 name="RPM Reader" url="book.rpmreader.php">
+ <tocsect2 name="Introduction" url="intro.rpmreader.php"/>
+ <tocsect2 name="Installing/Configuring" url="rpmreader.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="rpmreader.constants.php"/>
+ <tocsect2 name="Examples" url="rpmreader.examples.php"/>
+ <tocsect2 name="RPM Reader Functions" url="ref.rpmreader.php"/>
+</tocsect1>
+<tocsect1 name="SWF" url="book.swf.php">
+ <tocsect2 name="Introduction" url="intro.swf.php"/>
+ <tocsect2 name="Installing/Configuring" url="swf.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="swf.constants.php"/>
+ <tocsect2 name="Examples" url="swf.examples.php"/>
+ <tocsect2 name="SWF Functions" url="ref.swf.php"/>
+</tocsect1>
+<tocsect1 name="Swish" url="book.swish.php">
+ <tocsect2 name="Introduction" url="intro.swish.php"/>
+ <tocsect2 name="Installing/Configuring" url="swish.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="swish.constants.php"/>
+ <tocsect2 name="Examples" url="swish.examples.php"/>
+ <tocsect2 name="Swish Functions" url="ref.swish.php"/>
+</tocsect1>
+<tocsect1 name="Program execution" url="book.exec.php">
+ <tocsect2 name="Introduction" url="intro.exec.php"/>
+ <tocsect2 name="Installing/Configuring" url="exec.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="exec.constants.php"/>
+ <tocsect2 name="Program execution Functions" url="ref.exec.php"/>
+</tocsect1>
+<tocsect1 name="Expect" url="book.expect.php">
+ <tocsect2 name="Introduction" url="intro.expect.php"/>
+ <tocsect2 name="Installing/Configuring" url="expect.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="expect.constants.php"/>
+ <tocsect2 name="Examples" url="expect.examples.php"/>
+ <tocsect2 name="Expect Functions" url="ref.expect.php"/>
+</tocsect1>
+<tocsect1 name="PCNTL" url="book.pcntl.php">
+ <tocsect2 name="Introduction" url="intro.pcntl.php"/>
+ <tocsect2 name="Installing/Configuring" url="pcntl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pcntl.constants.php"/>
+ <tocsect2 name="Examples" url="pcntl.examples.php"/>
+ <tocsect2 name="PCNTL Functions" url="ref.pcntl.php"/>
+</tocsect1>
+<tocsect1 name="POSIX" url="book.posix.php">
+ <tocsect2 name="Introduction" url="intro.posix.php"/>
+ <tocsect2 name="Installing/Configuring" url="posix.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="posix.constants.php"/>
+ <tocsect2 name="POSIX Functions" url="ref.posix.php"/>
+</tocsect1>
+<tocsect1 name="Semaphore" url="book.sem.php">
+ <tocsect2 name="Introduction" url="intro.sem.php"/>
+ <tocsect2 name="Installing/Configuring" url="sem.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sem.constants.php"/>
+ <tocsect2 name="Semaphore Functions" url="ref.sem.php"/>
+</tocsect1>
+<tocsect1 name="Shared Memory" url="book.shmop.php">
+ <tocsect2 name="Introduction" url="intro.shmop.php"/>
+ <tocsect2 name="Installing/Configuring" url="shmop.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="shmop.constants.php"/>
+ <tocsect2 name="Examples" url="shmop.examples.php"/>
+ <tocsect2 name="Shared Memory Functions" url="ref.shmop.php"/>
+</tocsect1>
+<tocsect1 name="GeoIP" url="book.geoip.php">
+ <tocsect2 name="Introduction" url="intro.geoip.php"/>
+ <tocsect2 name="Installing/Configuring" url="geoip.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="geoip.constants.php"/>
+ <tocsect2 name="GeoIP Functions" url="ref.geoip.php"/>
+</tocsect1>
+<tocsect1 name="JSON" url="book.json.php">
+ <tocsect2 name="Introduction" url="intro.json.php"/>
+ <tocsect2 name="Installing/Configuring" url="json.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="json.constants.php"/>
+ <tocsect2 name="JSON Functions" url="ref.json.php"/>
+</tocsect1>
+<tocsect1 name="Misc." url="book.misc.php">
+ <tocsect2 name="Introduction" url="intro.misc.php"/>
+ <tocsect2 name="Installing/Configuring" url="misc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="misc.constants.php"/>
+ <tocsect2 name="Misc. Functions" url="ref.misc.php"/>
+</tocsect1>
+<tocsect1 name="Parsekit" url="book.parsekit.php">
+ <tocsect2 name="Introduction" url="intro.parsekit.php"/>
+ <tocsect2 name="Installing/Configuring" url="parsekit.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="parsekit.constants.php"/>
+ <tocsect2 name="Parsekit Functions" url="ref.parsekit.php"/>
+</tocsect1>
+<tocsect1 name="SPL" url="book.spl.php">
+ <tocsect2 name="Introduction" url="intro.spl.php"/>
+ <tocsect2 name="Installing/Configuring" url="spl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="spl.constants.php"/>
+ <tocsect2 name="Datastructures" url="spl.datastructures.php"/>
+ <tocsect2 name="SPL Functions" url="ref.spl.php"/>
+ <tocsect2 name="ArrayIterator" url="class.arrayiterator.php"/>
+ <tocsect2 name="ArrayObject" url="class.arrayobject.php"/>
+ <tocsect2 name="CachingIterator" url="class.cachingiterator.php"/>
+ <tocsect2 name="RecursiveCachingIterator" url="class.recursivecachingiterator.php"/>
+ <tocsect2 name="DirectoryIterator" url="class.directoryiterator.php"/>
+ <tocsect2 name="FilterIterator" url="class.filteriterator.php"/>
+ <tocsect2 name="LimitIterator" url="class.limititerator.php"/>
+ <tocsect2 name="ParentIterator" url="class.parentiterator.php"/>
+ <tocsect2 name="RecursiveDirectoryIterator" url="class.recursivedirectoryiterator.php"/>
+ <tocsect2 name="RecursiveIteratorIterator" url="class.recursiveiteratoriterator.php"/>
+ <tocsect2 name="SimpleXMLIterator" url="class.simplexmliterator.php"/>
+ <tocsect2 name="SplDoublyLinkedList" url="class.spldoublylinkedlist.php"/>
+ <tocsect2 name="SplStack" url="class.splstack.php"/>
+ <tocsect2 name="SplQueue" url="class.splqueue.php"/>
+ <tocsect2 name="SplHeap" url="class.splheap.php"/>
+ <tocsect2 name="SplMaxHeap" url="class.splmaxheap.php"/>
+ <tocsect2 name="SplMinHeap" url="class.splminheap.php"/>
+ <tocsect2 name="SplPriorityQueue" url="class.splpriorityqueue.php"/>
+</tocsect1>
+<tocsect1 name="Streams" url="book.stream.php">
+ <tocsect2 name="Introduction" url="intro.stream.php"/>
+ <tocsect2 name="Installing/Configuring" url="stream.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="stream.constants.php"/>
+ <tocsect2 name="Stream Filters" url="stream.filters.php"/>
+ <tocsect2 name="Stream Contexts" url="stream.contexts.php"/>
+ <tocsect2 name="Stream Errors" url="stream.errors.php"/>
+ <tocsect2 name="Examples" url="stream.examples.php"/>
+ <tocsect2 name="Stream Functions" url="ref.stream.php"/>
+</tocsect1>
+<tocsect1 name="Tidy" url="book.tidy.php">
+ <tocsect2 name="Introduction" url="intro.tidy.php"/>
+ <tocsect2 name="Installing/Configuring" url="tidy.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="tidy.constants.php"/>
+ <tocsect2 name="Examples" url="tidy.examples.php"/>
+ <tocsect2 name="Tidy Functions" url="ref.tidy.php"/>
+</tocsect1>
+<tocsect1 name="Tokenizer" url="book.tokenizer.php">
+ <tocsect2 name="Introduction" url="intro.tokenizer.php"/>
+ <tocsect2 name="Installing/Configuring" url="tokenizer.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="tokenizer.constants.php"/>
+ <tocsect2 name="Examples" url="tokenizer.examples.php"/>
+ <tocsect2 name="Tokenizer Functions" url="ref.tokenizer.php"/>
+</tocsect1>
+<tocsect1 name="URLs" url="book.url.php">
+ <tocsect2 name="Introduction" url="intro.url.php"/>
+ <tocsect2 name="Installing/Configuring" url="url.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="url.constants.php"/>
+ <tocsect2 name="URL Functions" url="ref.url.php"/>
+</tocsect1>
+<tocsect1 name="cURL" url="book.curl.php">
+ <tocsect2 name="Introduction" url="intro.curl.php"/>
+ <tocsect2 name="Installing/Configuring" url="curl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="curl.constants.php"/>
+ <tocsect2 name="Examples" url="curl.examples.php"/>
+ <tocsect2 name="cURL Functions" url="ref.curl.php"/>
+</tocsect1>
+<tocsect1 name="FAM" url="book.fam.php">
+ <tocsect2 name="Introduction" url="intro.fam.php"/>
+ <tocsect2 name="Installing/Configuring" url="fam.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="fam.constants.php"/>
+ <tocsect2 name="FAM Functions" url="ref.fam.php"/>
+</tocsect1>
+<tocsect1 name="FTP" url="book.ftp.php">
+ <tocsect2 name="Introduction" url="intro.ftp.php"/>
+ <tocsect2 name="Installing/Configuring" url="ftp.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ftp.constants.php"/>
+ <tocsect2 name="Examples" url="ftp.examples.php"/>
+ <tocsect2 name="FTP Functions" url="ref.ftp.php"/>
+</tocsect1>
+<tocsect1 name="Hyperwave" url="book.hw.php">
+ <tocsect2 name="Introduction" url="intro.hw.php"/>
+ <tocsect2 name="Installing/Configuring" url="hw.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="hw.constants.php"/>
+ <tocsect2 name="Integration with Apache" url="hw.apache.php"/>
+ <tocsect2 name="Hyperwave Functions" url="ref.hw.php"/>
+</tocsect1>
+<tocsect1 name="Hyperwave API" url="book.hwapi.php">
+ <tocsect2 name="Introduction" url="intro.hwapi.php"/>
+ <tocsect2 name="Installing/Configuring" url="hwapi.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="hwapi.constants.php"/>
+ <tocsect2 name="Hyperwave API Functions" url="ref.hwapi.php"/>
+</tocsect1>
+<tocsect1 name="HTTP" url="book.http.php">
+ <tocsect2 name="Introduction" url="intro.http.php"/>
+ <tocsect2 name="Installing/Configuring" url="http.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="http.constants.php"/>
+ <tocsect2 name="Request Options" url="http.request.options.php"/>
+ <tocsect2 name="The HttpDeflateStream class" url="class.httpdeflatestream.php"/>
+ <tocsect2 name="The HttpInflateStream class" url="class.httpinflatestream.php"/>
+ <tocsect2 name="The HttpMessage class" url="class.httpmessage.php"/>
+ <tocsect2 name="The HttpQueryString class" url="class.httpquerystring.php"/>
+ <tocsect2 name="The HttpRequest" url="class.httprequest.php"/>
+ <tocsect2 name="The HttpRequestPool class" url="class.httprequestpool.php"/>
+ <tocsect2 name="The HttpResponse" url="class.httpresponse.php"/>
+ <tocsect2 name="HTTP Functions" url="ref.http.php"/>
+</tocsect1>
+<tocsect1 name="Java" url="book.java.php">
+ <tocsect2 name="Introduction" url="intro.java.php"/>
+ <tocsect2 name="Installing/Configuring" url="java.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="java.constants.php"/>
+ <tocsect2 name="Java Servlet SAPI" url="java.servlet.php"/>
+ <tocsect2 name="Examples" url="java.examples.php"/>
+ <tocsect2 name="Java Functions" url="ref.java.php"/>
+</tocsect1>
+<tocsect1 name="LDAP" url="book.ldap.php">
+ <tocsect2 name="Introduction" url="intro.ldap.php"/>
+ <tocsect2 name="Installing/Configuring" url="ldap.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ldap.constants.php"/>
+ <tocsect2 name="Using the PHP LDAP calls" url="ldap.using.php"/>
+ <tocsect2 name="Examples" url="ldap.examples.php"/>
+ <tocsect2 name="LDAP Functions" url="ref.ldap.php"/>
+</tocsect1>
+<tocsect1 name="Lotus Notes" url="book.notes.php">
+ <tocsect2 name="Introduction" url="intro.notes.php"/>
+ <tocsect2 name="Installing/Configuring" url="notes.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="notes.constants.php"/>
+ <tocsect2 name="Lotus Notes Functions" url="ref.notes.php"/>
+</tocsect1>
+<tocsect1 name="Memcache" url="book.memcache.php">
+ <tocsect2 name="Introduction" url="intro.memcache.php"/>
+ <tocsect2 name="Installing/Configuring" url="memcache.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="memcache.constants.php"/>
+ <tocsect2 name="Examples" url="memcache.examples.php"/>
+ <tocsect2 name="Memcache Functions" url="ref.memcache.php"/>
+</tocsect1>
+<tocsect1 name="mnoGoSearch" url="book.mnogosearch.php">
+ <tocsect2 name="Introduction" url="intro.mnogosearch.php"/>
+ <tocsect2 name="Installing/Configuring" url="mnogosearch.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mnogosearch.constants.php"/>
+ <tocsect2 name="mnoGoSearch Functions" url="ref.mnogosearch.php"/>
+</tocsect1>
+<tocsect1 name="mqseries" url="book.mqseries.php">
+ <tocsect2 name="Introduction" url="intro.mqseries.php"/>
+ <tocsect2 name="Installing/Configuring" url="mqseries.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="mqseries.constants.php"/>
+ <tocsect2 name="mqseries Functions" url="ref.mqseries.php"/>
+</tocsect1>
+<tocsect1 name="Gopher" url="book.net-gopher.php">
+ <tocsect2 name="Introduction" url="intro.net-gopher.php"/>
+ <tocsect2 name="Installing/Configuring" url="net-gopher.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="net-gopher.constants.php"/>
+ <tocsect2 name="Examples" url="net-gopher.examples.php"/>
+ <tocsect2 name="Gopher Functions" url="ref.net-gopher.php"/>
+</tocsect1>
+<tocsect1 name="Network" url="book.network.php">
+ <tocsect2 name="Introduction" url="intro.network.php"/>
+ <tocsect2 name="Installing/Configuring" url="network.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="network.constants.php"/>
+ <tocsect2 name="Network Functions" url="ref.network.php"/>
+</tocsect1>
+<tocsect1 name="SAM" url="book.sam.php">
+ <tocsect2 name="Introduction" url="intro.sam.php"/>
+ <tocsect2 name="Installing/Configuring" url="sam.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sam.constants.php"/>
+ <tocsect2 name="Examples" url="sam.examples.php"/>
+ <tocsect2 name="SAM Functions" url="ref.sam.php"/>
+</tocsect1>
+<tocsect1 name="SNMP" url="book.snmp.php">
+ <tocsect2 name="Introduction" url="intro.snmp.php"/>
+ <tocsect2 name="Installing/Configuring" url="snmp.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="snmp.constants.php"/>
+ <tocsect2 name="SNMP Functions" url="ref.snmp.php"/>
+</tocsect1>
+<tocsect1 name="Sockets" url="book.sockets.php">
+ <tocsect2 name="Introduction" url="intro.sockets.php"/>
+ <tocsect2 name="Installing/Configuring" url="sockets.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sockets.constants.php"/>
+ <tocsect2 name="Examples" url="sockets.examples.php"/>
+ <tocsect2 name="Socket Errors" url="sockets.errors.php"/>
+ <tocsect2 name="Socket Functions" url="ref.sockets.php"/>
+</tocsect1>
+<tocsect1 name="SSH2" url="book.ssh2.php">
+ <tocsect2 name="Introduction" url="intro.ssh2.php"/>
+ <tocsect2 name="Installing/Configuring" url="ssh2.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ssh2.constants.php"/>
+ <tocsect2 name="SSH2 Functions" url="ref.ssh2.php"/>
+</tocsect1>
+<tocsect1 name="SVN" url="book.svn.php">
+ <tocsect2 name="Introduction" url="intro.svn.php"/>
+ <tocsect2 name="Installing/Configuring" url="svn.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="svn.constants.php"/>
+ <tocsect2 name="SVN Functions" url="ref.svn.php"/>
+</tocsect1>
+<tocsect1 name="TCP" url="book.tcpwrap.php">
+ <tocsect2 name="Introduction" url="intro.tcpwrap.php"/>
+ <tocsect2 name="Installing/Configuring" url="tcpwrap.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="tcpwrap.constants.php"/>
+ <tocsect2 name="TCP Functions" url="ref.tcpwrap.php"/>
+</tocsect1>
+<tocsect1 name="YAZ" url="book.yaz.php">
+ <tocsect2 name="Introduction" url="intro.yaz.php"/>
+ <tocsect2 name="Installing/Configuring" url="yaz.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="yaz.constants.php"/>
+ <tocsect2 name="Examples" url="yaz.examples.php"/>
+ <tocsect2 name="YAZ Functions" url="ref.yaz.php"/>
+</tocsect1>
+<tocsect1 name="YP/NIS" url="book.nis.php">
+ <tocsect2 name="Introduction" url="intro.nis.php"/>
+ <tocsect2 name="Installing/Configuring" url="nis.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="nis.constants.php"/>
+ <tocsect2 name="YP/NIS Functions" url="ref.nis.php"/>
+</tocsect1>
+<tocsect1 name="Apache" url="book.apache.php">
+ <tocsect2 name="Introduction" url="intro.apache.php"/>
+ <tocsect2 name="Installing/Configuring" url="apache.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="apache.constants.php"/>
+ <tocsect2 name="Apache Functions" url="ref.apache.php"/>
+</tocsect1>
+<tocsect1 name="IIS" url="book.iisfunc.php">
+ <tocsect2 name="Introduction" url="intro.iisfunc.php"/>
+ <tocsect2 name="Installing/Configuring" url="iisfunc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="iisfunc.constants.php"/>
+ <tocsect2 name="IIS Functions" url="ref.iisfunc.php"/>
+</tocsect1>
+<tocsect1 name="NSAPI" url="book.nsapi.php">
+ <tocsect2 name="Introduction" url="intro.nsapi.php"/>
+ <tocsect2 name="Installing/Configuring" url="nsapi.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="nsapi.constants.php"/>
+ <tocsect2 name="NSAPI Functions" url="ref.nsapi.php"/>
+</tocsect1>
+<tocsect1 name="Msession" url="book.msession.php">
+ <tocsect2 name="Introduction" url="intro.msession.php"/>
+ <tocsect2 name="Installing/Configuring" url="msession.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="msession.constants.php"/>
+ <tocsect2 name="Msession Functions" url="ref.msession.php"/>
+</tocsect1>
+<tocsect1 name="Sessions" url="book.session.php">
+ <tocsect2 name="Introduction" url="intro.session.php"/>
+ <tocsect2 name="Installing/Configuring" url="session.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="session.constants.php"/>
+ <tocsect2 name="Examples" url="session.examples.php"/>
+ <tocsect2 name="Sessions and security" url="session.security.php"/>
+ <tocsect2 name="Session Functions" url="ref.session.php"/>
+</tocsect1>
+<tocsect1 name="Session PgSQL" url="book.session-pgsql.php">
+ <tocsect2 name="Introduction" url="intro.session-pgsql.php"/>
+ <tocsect2 name="Installing/Configuring" url="session-pgsql.setup.php"/>
+ <tocsect2 name="Table definitions" url="session-pgsql.tables.php"/>
+ <tocsect2 name="Predefined Constants" url="session-pgsql.constants.php"/>
+ <tocsect2 name="Session PgSQL Functions" url="ref.session-pgsql.php"/>
+</tocsect1>
+<tocsect1 name="BBCode" url="book.bbcode.php">
+ <tocsect2 name="Introduction" url="intro.bbcode.php"/>
+ <tocsect2 name="Installing/Configuring" url="bbcode.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="bbcode.constants.php"/>
+ <tocsect2 name="BBCode Functions" url="ref.bbcode.php"/>
+</tocsect1>
+<tocsect1 name="PCRE" url="book.pcre.php">
+ <tocsect2 name="Introduction" url="intro.pcre.php"/>
+ <tocsect2 name="Installing/Configuring" url="pcre.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="pcre.constants.php"/>
+ <tocsect2 name="Examples" url="pcre.examples.php"/>
+ <tocsect2 name="PCRE Patterns" url="pcre.pattern.php"/>
+ <tocsect2 name="PCRE Functions" url="ref.pcre.php"/>
+</tocsect1>
+<tocsect1 name="POSIX Regex" url="book.regex.php">
+ <tocsect2 name="Introduction" url="intro.regex.php"/>
+ <tocsect2 name="Installing/Configuring" url="regex.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="regex.constants.php"/>
+ <tocsect2 name="Examples" url="regex.examples.php"/>
+ <tocsect2 name="POSIX Regex Functions" url="ref.regex.php"/>
+</tocsect1>
+<tocsect1 name="Strings" url="book.strings.php">
+ <tocsect2 name="Introduction" url="intro.strings.php"/>
+ <tocsect2 name="Installing/Configuring" url="strings.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="string.constants.php"/>
+ <tocsect2 name="String Functions" url="ref.strings.php"/>
+</tocsect1>
+<tocsect1 name="Arrays" url="book.array.php">
+ <tocsect2 name="Introduction" url="intro.array.php"/>
+ <tocsect2 name="Installing/Configuring" url="array.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="array.constants.php"/>
+ <tocsect2 name="Array Functions" url="ref.array.php"/>
+</tocsect1>
+<tocsect1 name="Classes/Objects" url="book.classobj.php">
+ <tocsect2 name="Introduction" url="intro.classobj.php"/>
+ <tocsect2 name="Installing/Configuring" url="classobj.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="classobj.constants.php"/>
+ <tocsect2 name="Examples" url="classobj.examples.php"/>
+ <tocsect2 name="Classes/Object Functions" url="ref.classobj.php"/>
+</tocsect1>
+<tocsect1 name="Classkit" url="book.classkit.php">
+ <tocsect2 name="Introduction" url="intro.classkit.php"/>
+ <tocsect2 name="Installing/Configuring" url="classkit.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="classkit.constants.php"/>
+ <tocsect2 name="Classkit Functions" url="ref.classkit.php"/>
+</tocsect1>
+<tocsect1 name="Ctype" url="book.ctype.php">
+ <tocsect2 name="Introduction" url="intro.ctype.php"/>
+ <tocsect2 name="Installing/Configuring" url="ctype.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="ctype.constants.php"/>
+ <tocsect2 name="Ctype Functions" url="ref.ctype.php"/>
+</tocsect1>
+<tocsect1 name="Filter" url="book.filter.php">
+ <tocsect2 name="Introduction" url="intro.filter.php"/>
+ <tocsect2 name="Installing/Configuring" url="filter.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="filter.constants.php"/>
+ <tocsect2 name="Filter Functions" url="ref.filter.php"/>
+</tocsect1>
+<tocsect1 name="Function Handling" url="book.funchand.php">
+ <tocsect2 name="Introduction" url="intro.funchand.php"/>
+ <tocsect2 name="Installing/Configuring" url="funchand.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="funchand.constants.php"/>
+ <tocsect2 name="Function handling Functions" url="ref.funchand.php"/>
+</tocsect1>
+<tocsect1 name="Object Aggregation" url="book.objaggregation.php">
+ <tocsect2 name="Introduction" url="intro.objaggregation.php"/>
+ <tocsect2 name="Examples" url="objaggregation.examples.php"/>
+ <tocsect2 name="Object Aggregation Functions" url="ref.objaggregation.php"/>
+</tocsect1>
+<tocsect1 name="Variable handling" url="book.var.php">
+ <tocsect2 name="Introduction" url="intro.var.php"/>
+ <tocsect2 name="Installing/Configuring" url="var.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="var.constants.php"/>
+ <tocsect2 name="Variable handling Functions" url="ref.var.php"/>
+</tocsect1>
+<tocsect1 name="SOAP" url="book.soap.php">
+ <tocsect2 name="Introduction" url="intro.soap.php"/>
+ <tocsect2 name="Installing/Configuring" url="soap.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="soap.constants.php"/>
+ <tocsect2 name="SOAP Functions" url="ref.soap.php"/>
+</tocsect1>
+<tocsect1 name="XML-RPC" url="book.xmlrpc.php">
+ <tocsect2 name="Introduction" url="intro.xmlrpc.php"/>
+ <tocsect2 name="Installing/Configuring" url="xmlrpc.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xmlrpc.constants.php"/>
+ <tocsect2 name="XML-RPC Functions" url="ref.xmlrpc.php"/>
+</tocsect1>
+<tocsect1 name=".NET" url="book.dotnet.php">
+ <tocsect2 name="Introduction" url="dotnet.intro.php"/>
+ <tocsect2 name="Installing/Configuring" url="dotnet.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dotnet.constants.php"/>
+ <tocsect2 name=".NET Functions" url="ref.dotnet.php"/>
+</tocsect1>
+<tocsect1 name="COM" url="book.com.php">
+ <tocsect2 name="Introduction" url="intro.com.php"/>
+ <tocsect2 name="Installing/Configuring" url="com.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="com.constants.php"/>
+ <tocsect2 name="Errors and error handling" url="com.error-handling.php"/>
+ <tocsect2 name="Examples" url="com.examples.php"/>
+ <tocsect2 name="COM Functions" url="ref.com.php"/>
+</tocsect1>
+<tocsect1 name="Printer" url="book.printer.php">
+ <tocsect2 name="Introduction" url="intro.printer.php"/>
+ <tocsect2 name="Installing/Configuring" url="printer.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="printer.constants.php"/>
+ <tocsect2 name="Printer Functions" url="ref.printer.php"/>
+</tocsect1>
+<tocsect1 name="W32api" url="book.w32api.php">
+ <tocsect2 name="Introduction" url="intro.w32api.php"/>
+ <tocsect2 name="Installing/Configuring" url="w32api.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="w32api.constants.php"/>
+ <tocsect2 name="Examples" url="w32api.examples.php"/>
+ <tocsect2 name="W32api Functions" url="ref.w32api.php"/>
+</tocsect1>
+<tocsect1 name="win32ps" url="book.win32ps.php">
+ <tocsect2 name="Introduction" url="intro.win32ps.php"/>
+ <tocsect2 name="Installing/Configuring" url="win32ps.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="win32ps.constants.php"/>
+ <tocsect2 name="Examples" url="win32ps.examples.php"/>
+ <tocsect2 name="win32ps Functions" url="ref.win32ps.php"/>
+</tocsect1>
+<tocsect1 name="win32service" url="book.win32service.php">
+ <tocsect2 name="Introduction" url="intro.win32service.php"/>
+ <tocsect2 name="Installing/Configuring" url="win32service.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="win32service.constants.php"/>
+ <tocsect2 name="Examples" url="win32service.examples.php"/>
+ <tocsect2 name="win32service Functions" url="ref.win32service.php"/>
+</tocsect1>
+<tocsect1 name="DOM" url="book.dom.php">
+ <tocsect2 name="Introduction" url="intro.dom.php"/>
+ <tocsect2 name="Installing/Configuring" url="dom.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="dom.constants.php"/>
+ <tocsect2 name="DOMAttr" url="class.domattr.php"/>
+ <tocsect2 name="DOMCharacterData" url="class.domcharacterdata.php"/>
+ <tocsect2 name="DOMComment" url="class.domcomment.php"/>
+ <tocsect2 name="DOMDocument" url="class.domdocument.php"/>
+ <tocsect2 name="DOMDocumentFragment" url="class.domdocumentfragment.php"/>
+ <tocsect2 name="DOMDocumentType" url="class.domdocumenttype.php"/>
+ <tocsect2 name="DOMElement" url="class.domelement.php"/>
+ <tocsect2 name="DOMEntity" url="class.domentity.php"/>
+ <tocsect2 name="DOMEntityReference" url="class.domentityreference.php"/>
+ <tocsect2 name="DOMException" url="class.domexception.php"/>
+ <tocsect2 name="DOMImplementation" url="class.domimplementation.php"/>
+ <tocsect2 name="DOMNamedNodeMap" url="class.domnamednodemap.php"/>
+ <tocsect2 name="DOMNode" url="class.domnode.php"/>
+ <tocsect2 name="DOMNodeList" url="class.domnodelist.php"/>
+ <tocsect2 name="DOMNotation" url="class.domnotation.php"/>
+ <tocsect2 name="DOMProcessingInstruction" url="class.domprocessinginstruction.php"/>
+ <tocsect2 name="DOMText" url="class.domtext.php"/>
+ <tocsect2 name="DOMXPath" url="class.domxpath.php"/>
+ <tocsect2 name="DOM Functions" url="ref.dom.php"/>
+</tocsect1>
+<tocsect1 name="DOM XML" url="book.domxml.php">
+ <tocsect2 name="Introduction" url="intro.domxml.php"/>
+ <tocsect2 name="Installing/Configuring" url="domxml.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="domxml.constants.php"/>
+ <tocsect2 name="DOM XML Functions" url="ref.domxml.php"/>
+</tocsect1>
+<tocsect1 name="libxml" url="book.libxml.php">
+ <tocsect2 name="Introduction" url="intro.libxml.php"/>
+ <tocsect2 name="Installing/Configuring" url="libxml.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="libxml.constants.php"/>
+ <tocsect2 name="libxml Functions" url="ref.libxml.php"/>
+</tocsect1>
+<tocsect1 name="qtdom" url="book.qtdom.php">
+ <tocsect2 name="Introduction" url="intro.qtdom.php"/>
+ <tocsect2 name="Installing/Configuring" url="qtdom.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="qtdom.constants.php"/>
+ <tocsect2 name="qtdom Functions" url="ref.qtdom.php"/>
+</tocsect1>
+<tocsect1 name="SCA" url="book.sca.php">
+ <tocsect2 name="Introduction" url="intro.sca.php"/>
+ <tocsect2 name="Installing/Configuring" url="sca.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sca.constants.php"/>
+ <tocsect2 name="Examples" url="sca.examples.php"/>
+ <tocsect2 name="SCA Functions" url="ref.sca.php"/>
+</tocsect1>
+<tocsect1 name="SDO DAS XML" url="book.sdo-das-xml.php">
+ <tocsect2 name="Introduction" url="intro.sdo-das-xml.php"/>
+ <tocsect2 name="Installing/Configuring" url="sdo-das-xml.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="sdo-das-xml.constants.php"/>
+ <tocsect2 name="Examples" url="sdo-das-xml.examples.php"/>
+ <tocsect2 name="SDO DAS XML Functions" url="ref.sdo-das-xml.php"/>
+</tocsect1>
+<tocsect1 name="SimpleXML" url="book.simplexml.php">
+ <tocsect2 name="Introduction" url="intro.simplexml.php"/>
+ <tocsect2 name="Installing/Configuring" url="simplexml.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="simplexml.constants.php"/>
+ <tocsect2 name="Examples" url="simplexml.examples.php"/>
+ <tocsect2 name="SimpleXML Functions" url="ref.simplexml.php"/>
+</tocsect1>
+<tocsect1 name="WDDX" url="book.wddx.php">
+ <tocsect2 name="Introduction" url="intro.wddx.php"/>
+ <tocsect2 name="Installing/Configuring" url="wddx.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="wddx.constants.php"/>
+ <tocsect2 name="Examples" url="wddx.examples.php"/>
+ <tocsect2 name="WDDX Functions" url="ref.wddx.php"/>
+</tocsect1>
+<tocsect1 name="XML Parser" url="book.xml.php">
+ <tocsect2 name="Introduction" url="intro.xml.php"/>
+ <tocsect2 name="Installing/Configuring" url="xml.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xml.constants.php"/>
+ <tocsect2 name="Event Handlers" url="xml.eventhandlers.php"/>
+ <tocsect2 name="Case Folding" url="xml.case-folding.php"/>
+ <tocsect2 name="Error Codes" url="xml.error-codes.php"/>
+ <tocsect2 name="Character Encoding" url="xml.encoding.php"/>
+ <tocsect2 name="Examples" url="xml.examples.php"/>
+ <tocsect2 name="XML Parser Functions" url="ref.xml.php"/>
+</tocsect1>
+<tocsect1 name="XMLReader" url="book.xmlreader.php">
+ <tocsect2 name="Introduction" url="intro.xmlreader.php"/>
+ <tocsect2 name="Installing/Configuring" url="xmlreader.setup.php"/>
+ <tocsect2 name="XMLReader" url="class.xmlreader.php"/>
+</tocsect1>
+<tocsect1 name="XMLWriter" url="book.xmlwriter.php">
+ <tocsect2 name="Introduction" url="intro.xmlwriter.php"/>
+ <tocsect2 name="Installing/Configuring" url="xmlwriter.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xmlwriter.constants.php"/>
+ <tocsect2 name="XMLWriter Functions" url="ref.xmlwriter.php"/>
+</tocsect1>
+<tocsect1 name="XSL" url="book.xsl.php">
+ <tocsect2 name="Introduction" url="intro.xsl.php"/>
+ <tocsect2 name="Installing/Configuring" url="xsl.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xsl.constants.php"/>
+ <tocsect2 name="Examples" url="xsl.examples.php"/>
+ <tocsect2 name="XSLTProcessor" url="class.xsltprocessor.php"/>
+</tocsect1>
+<tocsect1 name="XSLT" url="book.xslt.php">
+ <tocsect2 name="Introduction" url="intro.xslt.php"/>
+ <tocsect2 name="Installing/Configuring" url="xslt.setup.php"/>
+ <tocsect2 name="Predefined Constants" url="xslt.constants.php"/>
+ <tocsect2 name="XSLT Functions" url="ref.xslt.php"/>
+</tocsect1>
+<tocsect1 name="PHP at the Core: A Hacker&#039;s Guide to the Zend Engine" url="internals2.php">
+ <tocsect2 name="Preface" url="internals2.preface.php"/>
+ <tocsect2 name="The &quot;counter&quot; Extension - A Continuing Example" url="internals2.counter.php"/>
+ <tocsect2 name="The PHP 5 build system" url="internals2.buildsys.php"/>
+ <tocsect2 name="Extension structure" url="internals2.structure.php"/>
+ <tocsect2 name="Memory management" url="internals2.memory.php"/>
+ <tocsect2 name="Working with variables" url="internals2.variables.php"/>
+ <tocsect2 name="Writing functions" url="internals2.funcs.php"/>
+ <tocsect2 name="Working with classes and objects" url="internals2.objects.php"/>
+ <tocsect2 name="Working with resources" url="internals2.resources.php"/>
+ <tocsect2 name="Working with INI settings" url="internals2.ini.php"/>
+ <tocsect2 name="Working with streams" url="internals2.streams.php"/>
+ <tocsect2 name="PDO Driver How-To" url="internals2.pdo.php"/>
+ <tocsect2 name="Extension FAQs" url="internals2.faq.php"/>
+ <tocsect2 name="Zend Engine 2 API reference" url="internals2.apiref.php"/>
+ <tocsect2 name="Zend Engine 1" url="internals2.ze1.php"/>
+ <tocsect2 name="The future: PHP 6 and Zend Engine 3" url="internals2.ze3.php"/>
+</tocsect1>
+<tocsect1 name="FAQ" url="faq.php">
+ <tocsect2 name="General Information" url="faq.general.php"/>
+ <tocsect2 name="Mailing lists" url="faq.mailinglist.php"/>
+ <tocsect2 name="Obtaining PHP" url="faq.obtaining.php"/>
+ <tocsect2 name="Database issues" url="faq.databases.php"/>
+ <tocsect2 name="Installation" url="faq.installation.php"/>
+ <tocsect2 name="Build Problems" url="faq.build.php"/>
+ <tocsect2 name="Using PHP" url="faq.using.php"/>
+ <tocsect2 name="PHP and HTML" url="faq.html.php"/>
+ <tocsect2 name="PHP and COM" url="faq.com.php"/>
+ <tocsect2 name="PHP and other languages" url="faq.languages.php"/>
+ <tocsect2 name="Migrating from PHP 4 to PHP 5" url="faq.migration5.php"/>
+ <tocsect2 name="Miscellaneous Questions" url="faq.misc.php"/>
+</tocsect1>
+<tocsect1 name="Appendices" url="appendices.php">
+ <tocsect2 name="History of PHP and related projects" url="history.php"/>
+ <tocsect2 name="Migrating from PHP 5.1.x to PHP 5.2.x" url="migration52.php"/>
+ <tocsect2 name="Migrating from PHP 5.0.x to PHP 5.1.x" url="migration51.php"/>
+ <tocsect2 name="Migrating from PHP 4 to PHP 5" url="migration5.php"/>
+ <tocsect2 name="Debugging in PHP" url="debugger.php"/>
+ <tocsect2 name="Configure options" url="configure.php"/>
+ <tocsect2 name="php.ini directives" url="ini.php"/>
+ <tocsect2 name="Extension Categorization" url="extensions.php"/>
+ <tocsect2 name="List of Function Aliases" url="aliases.php"/>
+ <tocsect2 name="List of Reserved Words" url="reserved.php"/>
+ <tocsect2 name="List of Resource Types" url="resource.php"/>
+ <tocsect2 name="List of Supported Protocols/Wrappers" url="wrappers.php"/>
+ <tocsect2 name="List of Available Filters" url="filters.php"/>
+ <tocsect2 name="List of Supported Socket Transports" url="transports.php"/>
+ <tocsect2 name="PHP type comparison tables" url="types.comparisons.php"/>
+ <tocsect2 name="List of Parser Tokens" url="tokens.php"/>
+ <tocsect2 name="Userland Naming Guide" url="userlandnaming.php"/>
+ <tocsect2 name="About the manual" url="about.php"/>
+ <tocsect2 name="Open Publication License" url="opl.license.php"/>
+ <tocsect2 name="Function Index" url="indexes.php"/>
+</tocsect1>
+<index>
+<entry name="Superglobals" url="language.variables.superglobals.php"/>
+<entry name="$GLOBALS" url="reserved.variables.globals.php"/>
+<entry name="$HTTP_SERVER_VARS [deprecated]" url="reserved.variables.server.php"/>
+<entry name="$HTTP_GET_VARS [deprecated]" url="reserved.variables.get.php"/>
+<entry name="$HTTP_POST_VARS [deprecated]" url="reserved.variables.post.php"/>
+<entry name="$HTTP_POST_FILES [deprecated]" url="reserved.variables.files.php"/>
+<entry name="$_REQUEST" url="reserved.variables.request.php"/>
+<entry name="$HTTP_SESSION_VARS [deprecated]" url="reserved.variables.session.php"/>
+<entry name="$HTTP_ENV_VARS [deprecated]" url="reserved.variables.environment.php"/>
+<entry name="$HTTP_COOKIE_VARS [deprecated]" url="reserved.variables.cookies.php"/>
+<entry name="$php_errormsg" url="reserved.variables.phperrormsg.php"/>
+<entry name="$HTTP_RAW_POST_DATA" url="reserved.variables.httprawpostdata.php"/>
+<entry name="$http_response_header" url="reserved.variables.httpresponseheader.php"/>
+<entry name="$argc" url="reserved.variables.argc.php"/>
+<entry name="$argv" url="reserved.variables.argv.php"/>
+<entry name="Exception::__construct" url="exception.construct.php"/>
+<entry name="Exception::getMessage" url="exception.getmessage.php"/>
+<entry name="Exception::getCode" url="exception.getcode.php"/>
+<entry name="Exception::getFile" url="exception.getfile.php"/>
+<entry name="Exception::getLine" url="exception.getline.php"/>
+<entry name="Exception::getTrace" url="exception.gettrace.php"/>
+<entry name="Exception::getTraceAsString" url="exception.gettraceasstring.php"/>
+<entry name="Exception::__toString" url="exception.tostring.php"/>
+<entry name="Exception::__clone" url="exception.clone.php"/>
+<entry name="ErrorException::__construct" url="errorexception.construct.php"/>
+<entry name="ErrorException::getSeverity" url="errorexception.getseverity.php"/>
+<entry name="Socket context options" url="context.socket.php"/>
+<entry name="HTTP context options" url="context.http.php"/>
+<entry name="FTP context options" url="context.ftp.php"/>
+<entry name="SSL context options" url="context.ssl.php"/>
+<entry name="CURL context options" url="context.curl.php"/>
+<entry name="Context parameters" url="context.params.php"/>
+<entry name="apc_add" url="function.apc-add.php"/>
+<entry name="apc_cache_info" url="function.apc-cache-info.php"/>
+<entry name="apc_clear_cache" url="function.apc-clear-cache.php"/>
+<entry name="apc_compile_file" url="function.apc-compile-file.php"/>
+<entry name="apc_define_constants" url="function.apc-define-constants.php"/>
+<entry name="apc_delete" url="function.apc-delete.php"/>
+<entry name="apc_fetch" url="function.apc-fetch.php"/>
+<entry name="apc_load_constants" url="function.apc-load-constants.php"/>
+<entry name="apc_sma_info" url="function.apc-sma-info.php"/>
+<entry name="apc_store" url="function.apc-store.php"/>
+<entry name="apd_breakpoint" url="function.apd-breakpoint.php"/>
+<entry name="apd_callstack" url="function.apd-callstack.php"/>
+<entry name="apd_clunk" url="function.apd-clunk.php"/>
+<entry name="apd_continue" url="function.apd-continue.php"/>
+<entry name="apd_croak" url="function.apd-croak.php"/>
+<entry name="apd_dump_function_table" url="function.apd-dump-function-table.php"/>
+<entry name="apd_dump_persistent_resources" url="function.apd-dump-persistent-resources.php"/>
+<entry name="apd_dump_regular_resources" url="function.apd-dump-regular-resources.php"/>
+<entry name="apd_echo" url="function.apd-echo.php"/>
+<entry name="apd_get_active_symbols" url="function.apd-get-active-symbols.php"/>
+<entry name="apd_set_pprof_trace" url="function.apd-set-pprof-trace.php"/>
+<entry name="apd_set_session_trace" url="function.apd-set-session-trace.php"/>
+<entry name="apd_set_session" url="function.apd-set-session.php"/>
+<entry name="apd_set_socket_session_trace" url="function.apd-set-socket-session-trace.php"/>
+<entry name="override_function" url="function.override-function.php"/>
+<entry name="rename_function" url="function.rename-function.php"/>
+<entry name="bcompiler_load_exe" url="function.bcompiler-load-exe.php"/>
+<entry name="bcompiler_load" url="function.bcompiler-load.php"/>
+<entry name="bcompiler_parse_class" url="function.bcompiler-parse-class.php"/>
+<entry name="bcompiler_read" url="function.bcompiler-read.php"/>
+<entry name="bcompiler_write_class" url="function.bcompiler-write-class.php"/>
+<entry name="bcompiler_write_constant" url="function.bcompiler-write-constant.php"/>
+<entry name="bcompiler_write_exe_footer" url="function.bcompiler-write-exe-footer.php"/>
+<entry name="bcompiler_write_file" url="function.bcompiler-write-file.php"/>
+<entry name="bcompiler_write_footer" url="function.bcompiler-write-footer.php"/>
+<entry name="bcompiler_write_function" url="function.bcompiler-write-function.php"/>
+<entry name="bcompiler_write_functions_from_file" url="function.bcompiler-write-functions-from-file.php"/>
+<entry name="bcompiler_write_header" url="function.bcompiler-write-header.php"/>
+<entry name="bcompiler_write_included_filename" url="function.bcompiler-write-included-filename.php"/>
+<entry name="debug_backtrace" url="function.debug-backtrace.php"/>
+<entry name="debug_print_backtrace" url="function.debug-print-backtrace.php"/>
+<entry name="error_get_last" url="function.error-get-last.php"/>
+<entry name="error_log" url="function.error-log.php"/>
+<entry name="error_reporting" url="function.error-reporting.php"/>
+<entry name="restore_error_handler" url="function.restore-error-handler.php"/>
+<entry name="restore_exception_handler" url="function.restore-exception-handler.php"/>
+<entry name="set_error_handler" url="function.set-error-handler.php"/>
+<entry name="set_exception_handler" url="function.set-exception-handler.php"/>
+<entry name="trigger_error" url="function.trigger-error.php"/>
+<entry name="user_error" url="function.user-error.php"/>
+<entry name="overload" url="function.overload.php"/>
+<entry name="flush" url="function.flush.php"/>
+<entry name="ob_clean" url="function.ob-clean.php"/>
+<entry name="ob_end_clean" url="function.ob-end-clean.php"/>
+<entry name="ob_end_flush" url="function.ob-end-flush.php"/>
+<entry name="ob_flush" url="function.ob-flush.php"/>
+<entry name="ob_get_clean" url="function.ob-get-clean.php"/>
+<entry name="ob_get_contents" url="function.ob-get-contents.php"/>
+<entry name="ob_get_flush" url="function.ob-get-flush.php"/>
+<entry name="ob_get_length" url="function.ob-get-length.php"/>
+<entry name="ob_get_level" url="function.ob-get-level.php"/>
+<entry name="ob_get_status" url="function.ob-get-status.php"/>
+<entry name="ob_gzhandler" url="function.ob-gzhandler.php"/>
+<entry name="ob_implicit_flush" url="function.ob-implicit-flush.php"/>
+<entry name="ob_list_handlers" url="function.ob-list-handlers.php"/>
+<entry name="ob_start" url="function.ob-start.php"/>
+<entry name="output_add_rewrite_var" url="function.output-add-rewrite-var.php"/>
+<entry name="output_reset_rewrite_vars" url="function.output-reset-rewrite-vars.php"/>
+<entry name="assert_options" url="function.assert-options.php"/>
+<entry name="assert" url="function.assert.php"/>
+<entry name="dl" url="function.dl.php"/>
+<entry name="extension_loaded" url="function.extension-loaded.php"/>
+<entry name="get_cfg_var" url="function.get-cfg-var.php"/>
+<entry name="get_current_user" url="function.get-current-user.php"/>
+<entry name="get_defined_constants" url="function.get-defined-constants.php"/>
+<entry name="get_extension_funcs" url="function.get-extension-funcs.php"/>
+<entry name="get_include_path" url="function.get-include-path.php"/>
+<entry name="get_included_files" url="function.get-included-files.php"/>
+<entry name="get_loaded_extensions" url="function.get-loaded-extensions.php"/>
+<entry name="get_magic_quotes_gpc" url="function.get-magic-quotes-gpc.php"/>
+<entry name="get_magic_quotes_runtime" url="function.get-magic-quotes-runtime.php"/>
+<entry name="get_required_files" url="function.get-required-files.php"/>
+<entry name="getenv" url="function.getenv.php"/>
+<entry name="getlastmod" url="function.getlastmod.php"/>
+<entry name="getmygid" url="function.getmygid.php"/>
+<entry name="getmyinode" url="function.getmyinode.php"/>
+<entry name="getmypid" url="function.getmypid.php"/>
+<entry name="getmyuid" url="function.getmyuid.php"/>
+<entry name="getopt" url="function.getopt.php"/>
+<entry name="getrusage" url="function.getrusage.php"/>
+<entry name="ini_alter" url="function.ini-alter.php"/>
+<entry name="ini_get_all" url="function.ini-get-all.php"/>
+<entry name="ini_get" url="function.ini-get.php"/>
+<entry name="ini_restore" url="function.ini-restore.php"/>
+<entry name="ini_set" url="function.ini-set.php"/>
+<entry name="main" url="function.main.php"/>
+<entry name="memory_get_peak_usage" url="function.memory-get-peak-usage.php"/>
+<entry name="memory_get_usage" url="function.memory-get-usage.php"/>
+<entry name="php_ini_loaded_file" url="function.php-ini-loaded-file.php"/>
+<entry name="php_ini_scanned_files" url="function.php-ini-scanned-files.php"/>
+<entry name="php_logo_guid" url="function.php-logo-guid.php"/>
+<entry name="php_sapi_name" url="function.php-sapi-name.php"/>
+<entry name="php_uname" url="function.php-uname.php"/>
+<entry name="phpcredits" url="function.phpcredits.php"/>
+<entry name="phpinfo" url="function.phpinfo.php"/>
+<entry name="phpversion" url="function.phpversion.php"/>
+<entry name="putenv" url="function.putenv.php"/>
+<entry name="restore_include_path" url="function.restore-include-path.php"/>
+<entry name="set_include_path" url="function.set-include-path.php"/>
+<entry name="set_magic_quotes_runtime" url="function.set-magic-quotes-runtime.php"/>
+<entry name="set_time_limit" url="function.set-time-limit.php"/>
+<entry name="sys_get_temp_dir" url="function.sys-get-temp-dir.php"/>
+<entry name="version_compare" url="function.version-compare.php"/>
+<entry name="zend_logo_guid" url="function.zend-logo-guid.php"/>
+<entry name="zend_thread_id" url="function.zend-thread-id.php"/>
+<entry name="zend_version" url="function.zend-version.php"/>
+<entry name="Runkit_Sandbox" url="runkit.sandbox.php"/>
+<entry name="Runkit_Sandbox_Parent" url="runkit.sandbox-parent.php"/>
+<entry name="runkit_class_adopt" url="function.runkit-class-adopt.php"/>
+<entry name="runkit_class_emancipate" url="function.runkit-class-emancipate.php"/>
+<entry name="runkit_constant_add" url="function.runkit-constant-add.php"/>
+<entry name="runkit_constant_redefine" url="function.runkit-constant-redefine.php"/>
+<entry name="runkit_constant_remove" url="function.runkit-constant-remove.php"/>
+<entry name="runkit_function_add" url="function.runkit-function-add.php"/>
+<entry name="runkit_function_copy" url="function.runkit-function-copy.php"/>
+<entry name="runkit_function_redefine" url="function.runkit-function-redefine.php"/>
+<entry name="runkit_function_remove" url="function.runkit-function-remove.php"/>
+<entry name="runkit_function_rename" url="function.runkit-function-rename.php"/>
+<entry name="runkit_import" url="function.runkit-import.php"/>
+<entry name="runkit_lint_file" url="function.runkit-lint-file.php"/>
+<entry name="runkit_lint" url="function.runkit-lint.php"/>
+<entry name="runkit_method_add" url="function.runkit-method-add.php"/>
+<entry name="runkit_method_copy" url="function.runkit-method-copy.php"/>
+<entry name="runkit_method_redefine" url="function.runkit-method-redefine.php"/>
+<entry name="runkit_method_remove" url="function.runkit-method-remove.php"/>
+<entry name="runkit_method_rename" url="function.runkit-method-rename.php"/>
+<entry name="runkit_return_value_used" url="function.runkit-return-value-used.php"/>
+<entry name="runkit_sandbox_output_handler" url="function.runkit-sandbox-output-handler.php"/>
+<entry name="runkit_superglobals" url="function.runkit-superglobals.php"/>
+<entry name="id3_get_frame_long_name" url="function.id3-get-frame-long-name.php"/>
+<entry name="id3_get_frame_short_name" url="function.id3-get-frame-short-name.php"/>
+<entry name="id3_get_genre_id" url="function.id3-get-genre-id.php"/>
+<entry name="id3_get_genre_list" url="function.id3-get-genre-list.php"/>
+<entry name="id3_get_genre_name" url="function.id3-get-genre-name.php"/>
+<entry name="id3_get_tag" url="function.id3-get-tag.php"/>
+<entry name="id3_get_version" url="function.id3-get-version.php"/>
+<entry name="id3_remove_tag" url="function.id3-remove-tag.php"/>
+<entry name="id3_set_tag" url="function.id3-set-tag.php"/>
+<entry name="openal_buffer_create" url="function.openal-buffer-create.php"/>
+<entry name="openal_buffer_data" url="function.openal-buffer-data.php"/>
+<entry name="openal_buffer_destroy" url="function.openal-buffer-destroy.php"/>
+<entry name="openal_buffer_get" url="function.openal-buffer-get.php"/>
+<entry name="openal_buffer_loadwav" url="function.openal-buffer-loadwav.php"/>
+<entry name="openal_context_create" url="function.openal-context-create.php"/>
+<entry name="openal_context_current" url="function.openal-context-current.php"/>
+<entry name="openal_context_destroy" url="function.openal-context-destroy.php"/>
+<entry name="openal_context_process" url="function.openal-context-process.php"/>
+<entry name="openal_context_suspend" url="function.openal-context-suspend.php"/>
+<entry name="openal_device_close" url="function.openal-device-close.php"/>
+<entry name="openal_device_open" url="function.openal-device-open.php"/>
+<entry name="openal_listener_get" url="function.openal-listener-get.php"/>
+<entry name="openal_listener_set" url="function.openal-listener-set.php"/>
+<entry name="openal_source_create" url="function.openal-source-create.php"/>
+<entry name="openal_source_destroy" url="function.openal-source-destroy.php"/>
+<entry name="openal_source_get" url="function.openal-source-get.php"/>
+<entry name="openal_source_pause" url="function.openal-source-pause.php"/>
+<entry name="openal_source_play" url="function.openal-source-play.php"/>
+<entry name="openal_source_rewind" url="function.openal-source-rewind.php"/>
+<entry name="openal_source_set" url="function.openal-source-set.php"/>
+<entry name="openal_source_stop" url="function.openal-source-stop.php"/>
+<entry name="openal_stream" url="function.openal-stream.php"/>
+<entry name="kadm5_chpass_principal" url="function.kadm5-chpass-principal.php"/>
+<entry name="kadm5_create_principal" url="function.kadm5-create-principal.php"/>
+<entry name="kadm5_delete_principal" url="function.kadm5-delete-principal.php"/>
+<entry name="kadm5_destroy" url="function.kadm5-destroy.php"/>
+<entry name="kadm5_flush" url="function.kadm5-flush.php"/>
+<entry name="kadm5_get_policies" url="function.kadm5-get-policies.php"/>
+<entry name="kadm5_get_principal" url="function.kadm5-get-principal.php"/>
+<entry name="kadm5_get_principals" url="function.kadm5-get-principals.php"/>
+<entry name="kadm5_init_with_password" url="function.kadm5-init-with-password.php"/>
+<entry name="kadm5_modify_principal" url="function.kadm5-modify-principal.php"/>
+<entry name="radius_acct_open" url="function.radius-acct-open.php"/>
+<entry name="radius_add_server" url="function.radius-add-server.php"/>
+<entry name="radius_auth_open" url="function.radius-auth-open.php"/>
+<entry name="radius_close" url="function.radius-close.php"/>
+<entry name="radius_config" url="function.radius-config.php"/>
+<entry name="radius_create_request" url="function.radius-create-request.php"/>
+<entry name="radius_cvt_addr" url="function.radius-cvt-addr.php"/>
+<entry name="radius_cvt_int" url="function.radius-cvt-int.php"/>
+<entry name="radius_cvt_string" url="function.radius-cvt-string.php"/>
+<entry name="radius_demangle_mppe_key" url="function.radius-demangle-mppe-key.php"/>
+<entry name="radius_demangle" url="function.radius-demangle.php"/>
+<entry name="radius_get_attr" url="function.radius-get-attr.php"/>
+<entry name="radius_get_vendor_attr" url="function.radius-get-vendor-attr.php"/>
+<entry name="radius_put_addr" url="function.radius-put-addr.php"/>
+<entry name="radius_put_attr" url="function.radius-put-attr.php"/>
+<entry name="radius_put_int" url="function.radius-put-int.php"/>
+<entry name="radius_put_string" url="function.radius-put-string.php"/>
+<entry name="radius_put_vendor_addr" url="function.radius-put-vendor-addr.php"/>
+<entry name="radius_put_vendor_attr" url="function.radius-put-vendor-attr.php"/>
+<entry name="radius_put_vendor_int" url="function.radius-put-vendor-int.php"/>
+<entry name="radius_put_vendor_string" url="function.radius-put-vendor-string.php"/>
+<entry name="radius_request_authenticator" url="function.radius-request-authenticator.php"/>
+<entry name="radius_send_request" url="function.radius-send-request.php"/>
+<entry name="radius_server_secret" url="function.radius-server-secret.php"/>
+<entry name="radius_strerror" url="function.radius-strerror.php"/>
+<entry name="cal_days_in_month" url="function.cal-days-in-month.php"/>
+<entry name="cal_from_jd" url="function.cal-from-jd.php"/>
+<entry name="cal_info" url="function.cal-info.php"/>
+<entry name="cal_to_jd" url="function.cal-to-jd.php"/>
+<entry name="easter_date" url="function.easter-date.php"/>
+<entry name="easter_days" url="function.easter-days.php"/>
+<entry name="FrenchToJD" url="function.frenchtojd.php"/>
+<entry name="GregorianToJD" url="function.gregoriantojd.php"/>
+<entry name="JDDayOfWeek" url="function.jddayofweek.php"/>
+<entry name="JDMonthName" url="function.jdmonthname.php"/>
+<entry name="JDToFrench" url="function.jdtofrench.php"/>
+<entry name="JDToGregorian" url="function.jdtogregorian.php"/>
+<entry name="jdtojewish" url="function.jdtojewish.php"/>
+<entry name="JDToJulian" url="function.jdtojulian.php"/>
+<entry name="jdtounix" url="function.jdtounix.php"/>
+<entry name="JewishToJD" url="function.jewishtojd.php"/>
+<entry name="JulianToJD" url="function.juliantojd.php"/>
+<entry name="unixtojd" url="function.unixtojd.php"/>
+<entry name="checkdate" url="function.checkdate.php"/>
+<entry name="date_create" url="function.date-create.php"/>
+<entry name="date_date_set" url="function.date-date-set.php"/>
+<entry name="date_default_timezone_get" url="function.date-default-timezone-get.php"/>
+<entry name="date_default_timezone_set" url="function.date-default-timezone-set.php"/>
+<entry name="date_format" url="function.date-format.php"/>
+<entry name="date_isodate_set" url="function.date-isodate-set.php"/>
+<entry name="date_modify" url="function.date-modify.php"/>
+<entry name="date_offset_get" url="function.date-offset-get.php"/>
+<entry name="date_parse" url="function.date-parse.php"/>
+<entry name="date_sun_info" url="function.date-sun-info.php"/>
+<entry name="date_sunrise" url="function.date-sunrise.php"/>
+<entry name="date_sunset" url="function.date-sunset.php"/>
+<entry name="date_time_set" url="function.date-time-set.php"/>
+<entry name="date_timezone_get" url="function.date-timezone-get.php"/>
+<entry name="date_timezone_set" url="function.date-timezone-set.php"/>
+<entry name="date" url="function.date.php"/>
+<entry name="getdate" url="function.getdate.php"/>
+<entry name="gettimeofday" url="function.gettimeofday.php"/>
+<entry name="gmdate" url="function.gmdate.php"/>
+<entry name="gmmktime" url="function.gmmktime.php"/>
+<entry name="gmstrftime" url="function.gmstrftime.php"/>
+<entry name="idate" url="function.idate.php"/>
+<entry name="localtime" url="function.localtime.php"/>
+<entry name="microtime" url="function.microtime.php"/>
+<entry name="mktime" url="function.mktime.php"/>
+<entry name="strftime" url="function.strftime.php"/>
+<entry name="strptime" url="function.strptime.php"/>
+<entry name="strtotime" url="function.strtotime.php"/>
+<entry name="time" url="function.time.php"/>
+<entry name="timezone_abbreviations_list" url="function.timezone-abbreviations-list.php"/>
+<entry name="timezone_identifiers_list" url="function.timezone-identifiers-list.php"/>
+<entry name="timezone_name_from_abbr" url="function.timezone-name-from-abbr.php"/>
+<entry name="timezone_name_get" url="function.timezone-name-get.php"/>
+<entry name="timezone_offset_get" url="function.timezone-offset-get.php"/>
+<entry name="timezone_open" url="function.timezone-open.php"/>
+<entry name="timezone_transitions_get" url="function.timezone-transitions-get.php"/>
+<entry name="newt_bell" url="function.newt-bell.php"/>
+<entry name="newt_button_bar" url="function.newt-button-bar.php"/>
+<entry name="newt_button" url="function.newt-button.php"/>
+<entry name="newt_centered_window" url="function.newt-centered-window.php"/>
+<entry name="newt_checkbox_get_value" url="function.newt-checkbox-get-value.php"/>
+<entry name="newt_checkbox_set_flags" url="function.newt-checkbox-set-flags.php"/>
+<entry name="newt_checkbox_set_value" url="function.newt-checkbox-set-value.php"/>
+<entry name="newt_checkbox_tree_add_item" url="function.newt-checkbox-tree-add-item.php"/>
+<entry name="newt_checkbox_tree_find_item" url="function.newt-checkbox-tree-find-item.php"/>
+<entry name="newt_checkbox_tree_get_current" url="function.newt-checkbox-tree-get-current.php"/>
+<entry name="newt_checkbox_tree_get_entry_value" url="function.newt-checkbox-tree-get-entry-value.php"/>
+<entry name="newt_checkbox_tree_get_multi_selection" url="function.newt-checkbox-tree-get-multi-selection.php"/>
+<entry name="newt_checkbox_tree_get_selection" url="function.newt-checkbox-tree-get-selection.php"/>
+<entry name="newt_checkbox_tree_multi" url="function.newt-checkbox-tree-multi.php"/>
+<entry name="newt_checkbox_tree_set_current" url="function.newt-checkbox-tree-set-current.php"/>
+<entry name="newt_checkbox_tree_set_entry_value" url="function.newt-checkbox-tree-set-entry-value.php"/>
+<entry name="newt_checkbox_tree_set_entry" url="function.newt-checkbox-tree-set-entry.php"/>
+<entry name="newt_checkbox_tree_set_width" url="function.newt-checkbox-tree-set-width.php"/>
+<entry name="newt_checkbox_tree" url="function.newt-checkbox-tree.php"/>
+<entry name="newt_checkbox" url="function.newt-checkbox.php"/>
+<entry name="newt_clear_key_buffer" url="function.newt-clear-key-buffer.php"/>
+<entry name="newt_cls" url="function.newt-cls.php"/>
+<entry name="newt_compact_button" url="function.newt-compact-button.php"/>
+<entry name="newt_component_add_callback" url="function.newt-component-add-callback.php"/>
+<entry name="newt_component_takes_focus" url="function.newt-component-takes-focus.php"/>
+<entry name="newt_create_grid" url="function.newt-create-grid.php"/>
+<entry name="newt_cursor_off" url="function.newt-cursor-off.php"/>
+<entry name="newt_cursor_on" url="function.newt-cursor-on.php"/>
+<entry name="newt_delay" url="function.newt-delay.php"/>
+<entry name="newt_draw_form" url="function.newt-draw-form.php"/>
+<entry name="newt_draw_root_text" url="function.newt-draw-root-text.php"/>
+<entry name="newt_entry_get_value" url="function.newt-entry-get-value.php"/>
+<entry name="newt_entry_set_filter" url="function.newt-entry-set-filter.php"/>
+<entry name="newt_entry_set_flags" url="function.newt-entry-set-flags.php"/>
+<entry name="newt_entry_set" url="function.newt-entry-set.php"/>
+<entry name="newt_entry" url="function.newt-entry.php"/>
+<entry name="newt_finished" url="function.newt-finished.php"/>
+<entry name="newt_form_add_component" url="function.newt-form-add-component.php"/>
+<entry name="newt_form_add_components" url="function.newt-form-add-components.php"/>
+<entry name="newt_form_add_hot_key" url="function.newt-form-add-hot-key.php"/>
+<entry name="newt_form_destroy" url="function.newt-form-destroy.php"/>
+<entry name="newt_form_get_current" url="function.newt-form-get-current.php"/>
+<entry name="newt_form_run" url="function.newt-form-run.php"/>
+<entry name="newt_form_set_background" url="function.newt-form-set-background.php"/>
+<entry name="newt_form_set_height" url="function.newt-form-set-height.php"/>
+<entry name="newt_form_set_size" url="function.newt-form-set-size.php"/>
+<entry name="newt_form_set_timer" url="function.newt-form-set-timer.php"/>
+<entry name="newt_form_set_width" url="function.newt-form-set-width.php"/>
+<entry name="newt_form_watch_fd" url="function.newt-form-watch-fd.php"/>
+<entry name="newt_form" url="function.newt-form.php"/>
+<entry name="newt_get_screen_size" url="function.newt-get-screen-size.php"/>
+<entry name="newt_grid_add_components_to_form" url="function.newt-grid-add-components-to-form.php"/>
+<entry name="newt_grid_basic_window" url="function.newt-grid-basic-window.php"/>
+<entry name="newt_grid_free" url="function.newt-grid-free.php"/>
+<entry name="newt_grid_get_size" url="function.newt-grid-get-size.php"/>
+<entry name="newt_grid_h_close_stacked" url="function.newt-grid-h-close-stacked.php"/>
+<entry name="newt_grid_h_stacked" url="function.newt-grid-h-stacked.php"/>
+<entry name="newt_grid_place" url="function.newt-grid-place.php"/>
+<entry name="newt_grid_set_field" url="function.newt-grid-set-field.php"/>
+<entry name="newt_grid_simple_window" url="function.newt-grid-simple-window.php"/>
+<entry name="newt_grid_v_close_stacked" url="function.newt-grid-v-close-stacked.php"/>
+<entry name="newt_grid_v_stacked" url="function.newt-grid-v-stacked.php"/>
+<entry name="newt_grid_wrapped_window_at" url="function.newt-grid-wrapped-window-at.php"/>
+<entry name="newt_grid_wrapped_window" url="function.newt-grid-wrapped-window.php"/>
+<entry name="newt_init" url="function.newt-init.php"/>
+<entry name="newt_label_set_text" url="function.newt-label-set-text.php"/>
+<entry name="newt_label" url="function.newt-label.php"/>
+<entry name="newt_listbox_append_entry" url="function.newt-listbox-append-entry.php"/>
+<entry name="newt_listbox_clear_selection" url="function.newt-listbox-clear-selection.php"/>
+<entry name="newt_listbox_clear" url="function.newt-listbox-clear.php"/>
+<entry name="newt_listbox_delete_entry" url="function.newt-listbox-delete-entry.php"/>
+<entry name="newt_listbox_get_current" url="function.newt-listbox-get-current.php"/>
+<entry name="newt_listbox_get_selection" url="function.newt-listbox-get-selection.php"/>
+<entry name="newt_listbox_insert_entry" url="function.newt-listbox-insert-entry.php"/>
+<entry name="newt_listbox_item_count" url="function.newt-listbox-item-count.php"/>
+<entry name="newt_listbox_select_item" url="function.newt-listbox-select-item.php"/>
+<entry name="newt_listbox_set_current_by_key" url="function.newt-listbox-set-current-by-key.php"/>
+<entry name="newt_listbox_set_current" url="function.newt-listbox-set-current.php"/>
+<entry name="newt_listbox_set_data" url="function.newt-listbox-set-data.php"/>
+<entry name="newt_listbox_set_entry" url="function.newt-listbox-set-entry.php"/>
+<entry name="newt_listbox_set_width" url="function.newt-listbox-set-width.php"/>
+<entry name="newt_listbox" url="function.newt-listbox.php"/>
+<entry name="newt_listitem_get_data" url="function.newt-listitem-get-data.php"/>
+<entry name="newt_listitem_set" url="function.newt-listitem-set.php"/>
+<entry name="newt_listitem" url="function.newt-listitem.php"/>
+<entry name="newt_open_window" url="function.newt-open-window.php"/>
+<entry name="newt_pop_help_line" url="function.newt-pop-help-line.php"/>
+<entry name="newt_pop_window" url="function.newt-pop-window.php"/>
+<entry name="newt_push_help_line" url="function.newt-push-help-line.php"/>
+<entry name="newt_radio_get_current" url="function.newt-radio-get-current.php"/>
+<entry name="newt_radiobutton" url="function.newt-radiobutton.php"/>
+<entry name="newt_redraw_help_line" url="function.newt-redraw-help-line.php"/>
+<entry name="newt_reflow_text" url="function.newt-reflow-text.php"/>
+<entry name="newt_refresh" url="function.newt-refresh.php"/>
+<entry name="newt_resize_screen" url="function.newt-resize-screen.php"/>
+<entry name="newt_resume" url="function.newt-resume.php"/>
+<entry name="newt_run_form" url="function.newt-run-form.php"/>
+<entry name="newt_scale_set" url="function.newt-scale-set.php"/>
+<entry name="newt_scale" url="function.newt-scale.php"/>
+<entry name="newt_scrollbar_set" url="function.newt-scrollbar-set.php"/>
+<entry name="newt_set_help_callback" url="function.newt-set-help-callback.php"/>
+<entry name="newt_set_suspend_callback" url="function.newt-set-suspend-callback.php"/>
+<entry name="newt_suspend" url="function.newt-suspend.php"/>
+<entry name="newt_textbox_get_num_lines" url="function.newt-textbox-get-num-lines.php"/>
+<entry name="newt_textbox_reflowed" url="function.newt-textbox-reflowed.php"/>
+<entry name="newt_textbox_set_height" url="function.newt-textbox-set-height.php"/>
+<entry name="newt_textbox_set_text" url="function.newt-textbox-set-text.php"/>
+<entry name="newt_textbox" url="function.newt-textbox.php"/>
+<entry name="newt_vertical_scrollbar" url="function.newt-vertical-scrollbar.php"/>
+<entry name="newt_wait_for_key" url="function.newt-wait-for-key.php"/>
+<entry name="newt_win_choice" url="function.newt-win-choice.php"/>
+<entry name="newt_win_entries" url="function.newt-win-entries.php"/>
+<entry name="newt_win_menu" url="function.newt-win-menu.php"/>
+<entry name="newt_win_message" url="function.newt-win-message.php"/>
+<entry name="newt_win_messagev" url="function.newt-win-messagev.php"/>
+<entry name="newt_win_ternary" url="function.newt-win-ternary.php"/>
+<entry name="ncurses_addch" url="function.ncurses-addch.php"/>
+<entry name="ncurses_addchnstr" url="function.ncurses-addchnstr.php"/>
+<entry name="ncurses_addchstr" url="function.ncurses-addchstr.php"/>
+<entry name="ncurses_addnstr" url="function.ncurses-addnstr.php"/>
+<entry name="ncurses_addstr" url="function.ncurses-addstr.php"/>
+<entry name="ncurses_assume_default_colors" url="function.ncurses-assume-default-colors.php"/>
+<entry name="ncurses_attroff" url="function.ncurses-attroff.php"/>
+<entry name="ncurses_attron" url="function.ncurses-attron.php"/>
+<entry name="ncurses_attrset" url="function.ncurses-attrset.php"/>
+<entry name="ncurses_baudrate" url="function.ncurses-baudrate.php"/>
+<entry name="ncurses_beep" url="function.ncurses-beep.php"/>
+<entry name="ncurses_bkgd" url="function.ncurses-bkgd.php"/>
+<entry name="ncurses_bkgdset" url="function.ncurses-bkgdset.php"/>
+<entry name="ncurses_border" url="function.ncurses-border.php"/>
+<entry name="ncurses_bottom_panel" url="function.ncurses-bottom-panel.php"/>
+<entry name="ncurses_can_change_color" url="function.ncurses-can-change-color.php"/>
+<entry name="ncurses_cbreak" url="function.ncurses-cbreak.php"/>
+<entry name="ncurses_clear" url="function.ncurses-clear.php"/>
+<entry name="ncurses_clrtobot" url="function.ncurses-clrtobot.php"/>
+<entry name="ncurses_clrtoeol" url="function.ncurses-clrtoeol.php"/>
+<entry name="ncurses_color_content" url="function.ncurses-color-content.php"/>
+<entry name="ncurses_color_set" url="function.ncurses-color-set.php"/>
+<entry name="ncurses_curs_set" url="function.ncurses-curs-set.php"/>
+<entry name="ncurses_def_prog_mode" url="function.ncurses-def-prog-mode.php"/>
+<entry name="ncurses_def_shell_mode" url="function.ncurses-def-shell-mode.php"/>
+<entry name="ncurses_define_key" url="function.ncurses-define-key.php"/>
+<entry name="ncurses_del_panel" url="function.ncurses-del-panel.php"/>
+<entry name="ncurses_delay_output" url="function.ncurses-delay-output.php"/>
+<entry name="ncurses_delch" url="function.ncurses-delch.php"/>
+<entry name="ncurses_deleteln" url="function.ncurses-deleteln.php"/>
+<entry name="ncurses_delwin" url="function.ncurses-delwin.php"/>
+<entry name="ncurses_doupdate" url="function.ncurses-doupdate.php"/>
+<entry name="ncurses_echo" url="function.ncurses-echo.php"/>
+<entry name="ncurses_echochar" url="function.ncurses-echochar.php"/>
+<entry name="ncurses_end" url="function.ncurses-end.php"/>
+<entry name="ncurses_erase" url="function.ncurses-erase.php"/>
+<entry name="ncurses_erasechar" url="function.ncurses-erasechar.php"/>
+<entry name="ncurses_filter" url="function.ncurses-filter.php"/>
+<entry name="ncurses_flash" url="function.ncurses-flash.php"/>
+<entry name="ncurses_flushinp" url="function.ncurses-flushinp.php"/>
+<entry name="ncurses_getch" url="function.ncurses-getch.php"/>
+<entry name="ncurses_getmaxyx" url="function.ncurses-getmaxyx.php"/>
+<entry name="ncurses_getmouse" url="function.ncurses-getmouse.php"/>
+<entry name="ncurses_getyx" url="function.ncurses-getyx.php"/>
+<entry name="ncurses_halfdelay" url="function.ncurses-halfdelay.php"/>
+<entry name="ncurses_has_colors" url="function.ncurses-has-colors.php"/>
+<entry name="ncurses_has_ic" url="function.ncurses-has-ic.php"/>
+<entry name="ncurses_has_il" url="function.ncurses-has-il.php"/>
+<entry name="ncurses_has_key" url="function.ncurses-has-key.php"/>
+<entry name="ncurses_hide_panel" url="function.ncurses-hide-panel.php"/>
+<entry name="ncurses_hline" url="function.ncurses-hline.php"/>
+<entry name="ncurses_inch" url="function.ncurses-inch.php"/>
+<entry name="ncurses_init_color" url="function.ncurses-init-color.php"/>
+<entry name="ncurses_init_pair" url="function.ncurses-init-pair.php"/>
+<entry name="ncurses_init" url="function.ncurses-init.php"/>
+<entry name="ncurses_insch" url="function.ncurses-insch.php"/>
+<entry name="ncurses_insdelln" url="function.ncurses-insdelln.php"/>
+<entry name="ncurses_insertln" url="function.ncurses-insertln.php"/>
+<entry name="ncurses_insstr" url="function.ncurses-insstr.php"/>
+<entry name="ncurses_instr" url="function.ncurses-instr.php"/>
+<entry name="ncurses_isendwin" url="function.ncurses-isendwin.php"/>
+<entry name="ncurses_keyok" url="function.ncurses-keyok.php"/>
+<entry name="ncurses_keypad" url="function.ncurses-keypad.php"/>
+<entry name="ncurses_killchar" url="function.ncurses-killchar.php"/>
+<entry name="ncurses_longname" url="function.ncurses-longname.php"/>
+<entry name="ncurses_meta" url="function.ncurses-meta.php"/>
+<entry name="ncurses_mouse_trafo" url="function.ncurses-mouse-trafo.php"/>
+<entry name="ncurses_mouseinterval" url="function.ncurses-mouseinterval.php"/>
+<entry name="ncurses_mousemask" url="function.ncurses-mousemask.php"/>
+<entry name="ncurses_move_panel" url="function.ncurses-move-panel.php"/>
+<entry name="ncurses_move" url="function.ncurses-move.php"/>
+<entry name="ncurses_mvaddch" url="function.ncurses-mvaddch.php"/>
+<entry name="ncurses_mvaddchnstr" url="function.ncurses-mvaddchnstr.php"/>
+<entry name="ncurses_mvaddchstr" url="function.ncurses-mvaddchstr.php"/>
+<entry name="ncurses_mvaddnstr" url="function.ncurses-mvaddnstr.php"/>
+<entry name="ncurses_mvaddstr" url="function.ncurses-mvaddstr.php"/>
+<entry name="ncurses_mvcur" url="function.ncurses-mvcur.php"/>
+<entry name="ncurses_mvdelch" url="function.ncurses-mvdelch.php"/>
+<entry name="ncurses_mvgetch" url="function.ncurses-mvgetch.php"/>
+<entry name="ncurses_mvhline" url="function.ncurses-mvhline.php"/>
+<entry name="ncurses_mvinch" url="function.ncurses-mvinch.php"/>
+<entry name="ncurses_mvvline" url="function.ncurses-mvvline.php"/>
+<entry name="ncurses_mvwaddstr" url="function.ncurses-mvwaddstr.php"/>
+<entry name="ncurses_napms" url="function.ncurses-napms.php"/>
+<entry name="ncurses_new_panel" url="function.ncurses-new-panel.php"/>
+<entry name="ncurses_newpad" url="function.ncurses-newpad.php"/>
+<entry name="ncurses_newwin" url="function.ncurses-newwin.php"/>
+<entry name="ncurses_nl" url="function.ncurses-nl.php"/>
+<entry name="ncurses_nocbreak" url="function.ncurses-nocbreak.php"/>
+<entry name="ncurses_noecho" url="function.ncurses-noecho.php"/>
+<entry name="ncurses_nonl" url="function.ncurses-nonl.php"/>
+<entry name="ncurses_noqiflush" url="function.ncurses-noqiflush.php"/>
+<entry name="ncurses_noraw" url="function.ncurses-noraw.php"/>
+<entry name="ncurses_pair_content" url="function.ncurses-pair-content.php"/>
+<entry name="ncurses_panel_above" url="function.ncurses-panel-above.php"/>
+<entry name="ncurses_panel_below" url="function.ncurses-panel-below.php"/>
+<entry name="ncurses_panel_window" url="function.ncurses-panel-window.php"/>
+<entry name="ncurses_pnoutrefresh" url="function.ncurses-pnoutrefresh.php"/>
+<entry name="ncurses_prefresh" url="function.ncurses-prefresh.php"/>
+<entry name="ncurses_putp" url="function.ncurses-putp.php"/>
+<entry name="ncurses_qiflush" url="function.ncurses-qiflush.php"/>
+<entry name="ncurses_raw" url="function.ncurses-raw.php"/>
+<entry name="ncurses_refresh" url="function.ncurses-refresh.php"/>
+<entry name="ncurses_replace_panel" url="function.ncurses-replace-panel.php"/>
+<entry name="ncurses_reset_prog_mode" url="function.ncurses-reset-prog-mode.php"/>
+<entry name="ncurses_reset_shell_mode" url="function.ncurses-reset-shell-mode.php"/>
+<entry name="ncurses_resetty" url="function.ncurses-resetty.php"/>
+<entry name="ncurses_savetty" url="function.ncurses-savetty.php"/>
+<entry name="ncurses_scr_dump" url="function.ncurses-scr-dump.php"/>
+<entry name="ncurses_scr_init" url="function.ncurses-scr-init.php"/>
+<entry name="ncurses_scr_restore" url="function.ncurses-scr-restore.php"/>
+<entry name="ncurses_scr_set" url="function.ncurses-scr-set.php"/>
+<entry name="ncurses_scrl" url="function.ncurses-scrl.php"/>
+<entry name="ncurses_show_panel" url="function.ncurses-show-panel.php"/>
+<entry name="ncurses_slk_attr" url="function.ncurses-slk-attr.php"/>
+<entry name="ncurses_slk_attroff" url="function.ncurses-slk-attroff.php"/>
+<entry name="ncurses_slk_attron" url="function.ncurses-slk-attron.php"/>
+<entry name="ncurses_slk_attrset" url="function.ncurses-slk-attrset.php"/>
+<entry name="ncurses_slk_clear" url="function.ncurses-slk-clear.php"/>
+<entry name="ncurses_slk_color" url="function.ncurses-slk-color.php"/>
+<entry name="ncurses_slk_init" url="function.ncurses-slk-init.php"/>
+<entry name="ncurses_slk_noutrefresh" url="function.ncurses-slk-noutrefresh.php"/>
+<entry name="ncurses_slk_refresh" url="function.ncurses-slk-refresh.php"/>
+<entry name="ncurses_slk_restore" url="function.ncurses-slk-restore.php"/>
+<entry name="ncurses_slk_set" url="function.ncurses-slk-set.php"/>
+<entry name="ncurses_slk_touch" url="function.ncurses-slk-touch.php"/>
+<entry name="ncurses_standend" url="function.ncurses-standend.php"/>
+<entry name="ncurses_standout" url="function.ncurses-standout.php"/>
+<entry name="ncurses_start_color" url="function.ncurses-start-color.php"/>
+<entry name="ncurses_termattrs" url="function.ncurses-termattrs.php"/>
+<entry name="ncurses_termname" url="function.ncurses-termname.php"/>
+<entry name="ncurses_timeout" url="function.ncurses-timeout.php"/>
+<entry name="ncurses_top_panel" url="function.ncurses-top-panel.php"/>
+<entry name="ncurses_typeahead" url="function.ncurses-typeahead.php"/>
+<entry name="ncurses_ungetch" url="function.ncurses-ungetch.php"/>
+<entry name="ncurses_ungetmouse" url="function.ncurses-ungetmouse.php"/>
+<entry name="ncurses_update_panels" url="function.ncurses-update-panels.php"/>
+<entry name="ncurses_use_default_colors" url="function.ncurses-use-default-colors.php"/>
+<entry name="ncurses_use_env" url="function.ncurses-use-env.php"/>
+<entry name="ncurses_use_extended_names" url="function.ncurses-use-extended-names.php"/>
+<entry name="ncurses_vidattr" url="function.ncurses-vidattr.php"/>
+<entry name="ncurses_vline" url="function.ncurses-vline.php"/>
+<entry name="ncurses_waddch" url="function.ncurses-waddch.php"/>
+<entry name="ncurses_waddstr" url="function.ncurses-waddstr.php"/>
+<entry name="ncurses_wattroff" url="function.ncurses-wattroff.php"/>
+<entry name="ncurses_wattron" url="function.ncurses-wattron.php"/>
+<entry name="ncurses_wattrset" url="function.ncurses-wattrset.php"/>
+<entry name="ncurses_wborder" url="function.ncurses-wborder.php"/>
+<entry name="ncurses_wclear" url="function.ncurses-wclear.php"/>
+<entry name="ncurses_wcolor_set" url="function.ncurses-wcolor-set.php"/>
+<entry name="ncurses_werase" url="function.ncurses-werase.php"/>
+<entry name="ncurses_wgetch" url="function.ncurses-wgetch.php"/>
+<entry name="ncurses_whline" url="function.ncurses-whline.php"/>
+<entry name="ncurses_wmouse_trafo" url="function.ncurses-wmouse-trafo.php"/>
+<entry name="ncurses_wmove" url="function.ncurses-wmove.php"/>
+<entry name="ncurses_wnoutrefresh" url="function.ncurses-wnoutrefresh.php"/>
+<entry name="ncurses_wrefresh" url="function.ncurses-wrefresh.php"/>
+<entry name="ncurses_wstandend" url="function.ncurses-wstandend.php"/>
+<entry name="ncurses_wstandout" url="function.ncurses-wstandout.php"/>
+<entry name="ncurses_wvline" url="function.ncurses-wvline.php"/>
+<entry name="readline_add_history" url="function.readline-add-history.php"/>
+<entry name="readline_callback_handler_install" url="function.readline-callback-handler-install.php"/>
+<entry name="readline_callback_handler_remove" url="function.readline-callback-handler-remove.php"/>
+<entry name="readline_callback_read_char" url="function.readline-callback-read-char.php"/>
+<entry name="readline_clear_history" url="function.readline-clear-history.php"/>
+<entry name="readline_completion_function" url="function.readline-completion-function.php"/>
+<entry name="readline_info" url="function.readline-info.php"/>
+<entry name="readline_list_history" url="function.readline-list-history.php"/>
+<entry name="readline_on_new_line" url="function.readline-on-new-line.php"/>
+<entry name="readline_read_history" url="function.readline-read-history.php"/>
+<entry name="readline_redisplay" url="function.readline-redisplay.php"/>
+<entry name="readline_write_history" url="function.readline-write-history.php"/>
+<entry name="readline" url="function.readline.php"/>
+<entry name="bzclose" url="function.bzclose.php"/>
+<entry name="bzcompress" url="function.bzcompress.php"/>
+<entry name="bzdecompress" url="function.bzdecompress.php"/>
+<entry name="bzerrno" url="function.bzerrno.php"/>
+<entry name="bzerror" url="function.bzerror.php"/>
+<entry name="bzerrstr" url="function.bzerrstr.php"/>
+<entry name="bzflush" url="function.bzflush.php"/>
+<entry name="bzopen" url="function.bzopen.php"/>
+<entry name="bzread" url="function.bzread.php"/>
+<entry name="bzwrite" url="function.bzwrite.php"/>
+<entry name="lzf_compress" url="function.lzf-compress.php"/>
+<entry name="lzf_decompress" url="function.lzf-decompress.php"/>
+<entry name="lzf_optimized_for" url="function.lzf-optimized-for.php"/>
+<entry name="Phar::addEmptyDir" url="phar.addemptydir.php"/>
+<entry name="Phar::addFile" url="phar.addfile.php"/>
+<entry name="Phar::addFromString" url="phar.addfromstring.php"/>
+<entry name="Phar::apiVersion" url="phar.apiversion.php"/>
+<entry name="Phar::buildFromDirectory" url="phar.buildfromdirectory.php"/>
+<entry name="Phar::buildFromIterator" url="phar.buildfromiterator.php"/>
+<entry name="Phar::canCompress" url="phar.cancompress.php"/>
+<entry name="Phar::canWrite" url="phar.canwrite.php"/>
+<entry name="Phar::compress" url="phar.compress.php"/>
+<entry name="Phar::compressAllFilesBZIP2" url="phar.compressallfilesbzip2.php"/>
+<entry name="Phar::compressAllFilesGZ" url="phar.compressallfilesgz.php"/>
+<entry name="Phar::compressFiles" url="phar.compressfiles.php"/>
+<entry name="Phar::__construct" url="phar.construct.php"/>
+<entry name="Phar::convertToData" url="phar.converttodata.php"/>
+<entry name="Phar::convertToExecutable" url="phar.converttoexecutable.php"/>
+<entry name="Phar::copy" url="phar.copy.php"/>
+<entry name="Phar::count" url="phar.count.php"/>
+<entry name="Phar::createDefaultStub" url="phar.createdefaultstub.php"/>
+<entry name="Phar::decompress" url="phar.decompress.php"/>
+<entry name="Phar::decompressFiles" url="phar.decompressfiles.php"/>
+<entry name="Phar::delMetadata" url="phar.delmetadata.php"/>
+<entry name="Phar::delete" url="phar.delete.php"/>
+<entry name="Phar::extractTo" url="phar.extractto.php"/>
+<entry name="Phar::getMetaData" url="phar.getmetadata.php"/>
+<entry name="Phar::getModified" url="phar.getmodified.php"/>
+<entry name="Phar::getSignature" url="phar.getsignature.php"/>
+<entry name="Phar::getStub" url="phar.getstub.php"/>
+<entry name="Phar::getSupportedCompression" url="phar.getsupportedcompression.php"/>
+<entry name="Phar::getSupportedSignatures" url="phar.getsupportedsignatures.php"/>
+<entry name="Phar::getVersion" url="phar.getversion.php"/>
+<entry name="Phar::hasMetaData" url="phar.hasmetadata.php"/>
+<entry name="Phar::interceptFileFuncs" url="phar.interceptfilefuncs.php"/>
+<entry name="Phar::isBuffering" url="phar.isbuffering.php"/>
+<entry name="Phar::isCompressed" url="phar.iscompressed.php"/>
+<entry name="Phar::isFileFormat" url="phar.isfileformat.php"/>
+<entry name="Phar::isValidPharFilename" url="phar.isvalidpharfilename.php"/>
+<entry name="Phar::isWritable" url="phar.iswritable.php"/>
+<entry name="Phar::loadPhar" url="phar.loadphar.php"/>
+<entry name="Phar::mapPhar" url="phar.mapphar.php"/>
+<entry name="Phar::mount" url="phar.mount.php"/>
+<entry name="Phar::mungServer" url="phar.mungserver.php"/>
+<entry name="Phar::offsetExists" url="phar.offsetexists.php"/>
+<entry name="Phar::offsetGet" url="phar.offsetget.php"/>
+<entry name="Phar::offsetSet" url="phar.offsetset.php"/>
+<entry name="Phar::offsetUnset" url="phar.offsetunset.php"/>
+<entry name="Phar::running" url="phar.running.php"/>
+<entry name="Phar::setAlias" url="phar.setalias.php"/>
+<entry name="Phar::setDefaultStub" url="phar.setdefaultstub.php"/>
+<entry name="Phar::setMetadata" url="phardata.setmetadata.php"/>
+<entry name="Phar::setSignatureAlgorithm" url="phardata.setsignaturealgorithm.php"/>
+<entry name="Phar::setStub" url="phar.setstub.php"/>
+<entry name="Phar::startBuffering" url="phar.startbuffering.php"/>
+<entry name="Phar::stopBuffering" url="phar.stopbuffering.php"/>
+<entry name="Phar::uncompressAllFiles" url="phar.uncompressallfiles.php"/>
+<entry name="Phar::unlinkArchive" url="phar.unlinkarchive.php"/>
+<entry name="Phar::webPhar" url="phar.webphar.php"/>
+<entry name="PharData::addEmptyDir" url="phardata.addemptydir.php"/>
+<entry name="PharData::addFile" url="phardata.addfile.php"/>
+<entry name="PharData::addFromString" url="phardata.addfromstring.php"/>
+<entry name="PharData::buildFromDirectory" url="phardata.buildfromdirectory.php"/>
+<entry name="PharData::buildFromIterator" url="phardata.buildfromiterator.php"/>
+<entry name="PharData::compress" url="phardata.compress.php"/>
+<entry name="PharData::compressFiles" url="phardata.compressfiles.php"/>
+<entry name="PharData::__construct" url="phardata.construct.php"/>
+<entry name="PharData::convertToData" url="phardata.converttodata.php"/>
+<entry name="PharData::convertToExecutable" url="phardata.converttoexecutable.php"/>
+<entry name="PharData::copy" url="phardata.copy.php"/>
+<entry name="PharData::decompress" url="phardata.decompress.php"/>
+<entry name="PharData::decompressFiles" url="phardata.decompressfiles.php"/>
+<entry name="PharData::delMetadata" url="phardata.delmetadata.php"/>
+<entry name="PharData::delete" url="phardata.delete.php"/>
+<entry name="PharData::extractTo" url="phardata.extractto.php"/>
+<entry name="PharData::isWritable" url="phardata.iswritable.php"/>
+<entry name="PharData::offsetSet" url="phardata.offsetset.php"/>
+<entry name="PharData::offsetUnset" url="phardata.offsetunset.php"/>
+<entry name="PharData::setAlias" url="phardata.setalias.php"/>
+<entry name="PharData::setDefaultStub" url="phardata.setdefaultstub.php"/>
+<entry name="PharData::setStub" url="phardata.setstub.php"/>
+<entry name="PharFileInfo::chmod" url="pharfileinfo.chmod.php"/>
+<entry name="PharFileInfo::compress" url="pharfileinfo.compress.php"/>
+<entry name="PharFileInfo::__construct" url="pharfileinfo.construct.php"/>
+<entry name="PharFileInfo::decompress" url="pharfileinfo.decompress.php"/>
+<entry name="PharFileInfo::delMetadata" url="pharfileinfo.delmetadata.php"/>
+<entry name="PharFileInfo::getCRC32" url="pharfileinfo.getcrc32.php"/>
+<entry name="PharFileInfo::getCompressedSize" url="pharfileinfo.getcompressedsize.php"/>
+<entry name="PharFileInfo::getMetaData" url="pharfileinfo.getmetadata.php"/>
+<entry name="PharFileInfo::getPharFlags" url="pharfileinfo.getpharflags.php"/>
+<entry name="PharFileInfo::hasMetadata" url="pharfileinfo.hasmetadata.php"/>
+<entry name="PharFileInfo::isCRCChecked" url="pharfileinfo.iscrcchecked.php"/>
+<entry name="PharFileInfo::isCompressed" url="pharfileinfo.iscompressed.php"/>
+<entry name="PharFileInfo::isCompressedBZIP2" url="pharfileinfo.iscompressedbzip2.php"/>
+<entry name="PharFileInfo::isCompressedGZ" url="pharfileinfo.iscompressedgz.php"/>
+<entry name="PharFileInfo::setCompressedBZIP2" url="pharfileinfo.setcompressedbzip2.php"/>
+<entry name="PharFileInfo::setCompressedGZ" url="pharfileinfo.setcompressedgz.php"/>
+<entry name="PharFileInfo::setMetaData" url="pharfileinfo.setmetadata.php"/>
+<entry name="PharFileInfo::setUncompressed" url="pharfileinfo.setuncompressed.php"/>
+<entry name="PharException" url="PharException.intro.unused.php"/>
+<entry name="rar_close" url="function.rar-close.php"/>
+<entry name="rar_entry_get" url="function.rar-entry-get.php"/>
+<entry name="Rar::extract" url="function.rar-extract.php"/>
+<entry name="Rar::getAttr" url="function.rar-getattr.php"/>
+<entry name="Rar::getCrc" url="function.rar-getcrc.php"/>
+<entry name="Rar::getFileTime" url="function.rar-getfiletime.php"/>
+<entry name="Rar::getHostOs" url="function.rar-gethostos.php"/>
+<entry name="Rar::getMethod" url="function.rar-getmethod.php"/>
+<entry name="Rar::getName" url="function.rar-getname.php"/>
+<entry name="Rar::getPackedSize" url="function.rar-getpackedsize.php"/>
+<entry name="Rar::getUnpackedSize" url="function.rar-getunpackedsize.php"/>
+<entry name="Rar::getVersion" url="function.rar-getversion.php"/>
+<entry name="rar_list" url="function.rar-list.php"/>
+<entry name="rar_open" url="function.rar-open.php"/>
+<entry name="zip_close" url="function.zip-close.php"/>
+<entry name="zip_entry_close" url="function.zip-entry-close.php"/>
+<entry name="zip_entry_compressedsize" url="function.zip-entry-compressedsize.php"/>
+<entry name="zip_entry_compressionmethod" url="function.zip-entry-compressionmethod.php"/>
+<entry name="zip_entry_filesize" url="function.zip-entry-filesize.php"/>
+<entry name="zip_entry_name" url="function.zip-entry-name.php"/>
+<entry name="zip_entry_open" url="function.zip-entry-open.php"/>
+<entry name="zip_entry_read" url="function.zip-entry-read.php"/>
+<entry name="zip_open" url="function.zip-open.php"/>
+<entry name="zip_read" url="function.zip-read.php"/>
+<entry name="ZipArchive::addEmptyDir" url="function.ziparchive-addemptydir.php"/>
+<entry name="ZipArchive::addFile" url="function.ziparchive-addfile.php"/>
+<entry name="ZipArchive::addFromString" url="function.ziparchive-addfromstring.php"/>
+<entry name="ZipArchive::close" url="function.ziparchive-close.php"/>
+<entry name="ZipArchive::deleteIndex" url="function.ziparchive-deleteindex.php"/>
+<entry name="ZipArchive::deleteName" url="function.ziparchive-deletename.php"/>
+<entry name="ZipArchive::extractTo" url="function.ziparchive-extractto.php"/>
+<entry name="ZipArchive::getArchiveComment" url="function.ziparchive-getarchivecomment.php"/>
+<entry name="ZipArchive::getCommentIndex" url="function.ziparchive-getcommentindex.php"/>
+<entry name="ZipArchive::getCommentName" url="function.ziparchive-getcommentname.php"/>
+<entry name="ZipArchive::getFromIndex" url="function.ziparchive-getfromindex.php"/>
+<entry name="ZipArchive::getFromName" url="function.ziparchive-getfromname.php"/>
+<entry name="ZipArchive::getNameIndex" url="function.ziparchive-getnameindex.php"/>
+<entry name="ZipArchive::getStream" url="function.ziparchive-getstream.php"/>
+<entry name="ZipArchive::locateName" url="function.ziparchive-locatename.php"/>
+<entry name="ZipArchive::open" url="function.ziparchive-open.php"/>
+<entry name="ZipArchive::renameIndex" url="function.ziparchive-renameindex.php"/>
+<entry name="ZipArchive::renameName" url="function.ziparchive-renamename.php"/>
+<entry name="ZipArchive::setArchiveComment" url="function.ziparchive-setarchivecomment.php"/>
+<entry name="ZipArchive::setCommentIndex" url="function.ziparchive-setcommentindex.php"/>
+<entry name="ZipArchive::setCommentName" url="function.ziparchive-setCommentName.php"/>
+<entry name="ZipArchive::statIndex" url="function.ziparchive-statindex.php"/>
+<entry name="ZipArchive::statName" url="function.ziparchive-statname.php"/>
+<entry name="ZipArchive::unchangeAll" url="function.ziparchive-unchangeall.php"/>
+<entry name="ZipArchive::unchangeArchive" url="function.ziparchive-unchangearchive.php"/>
+<entry name="ZipArchive::unchangeIndex" url="function.ziparchive-unchangeindex.php"/>
+<entry name="ZipArchive::unchangeName" url="function.ziparchive-unchangename.php"/>
+<entry name="gzclose" url="function.gzclose.php"/>
+<entry name="gzcompress" url="function.gzcompress.php"/>
+<entry name="gzdecode" url="function.gzdecode.php"/>
+<entry name="gzdeflate" url="function.gzdeflate.php"/>
+<entry name="gzencode" url="function.gzencode.php"/>
+<entry name="gzeof" url="function.gzeof.php"/>
+<entry name="gzfile" url="function.gzfile.php"/>
+<entry name="gzgetc" url="function.gzgetc.php"/>
+<entry name="gzgets" url="function.gzgets.php"/>
+<entry name="gzgetss" url="function.gzgetss.php"/>
+<entry name="gzinflate" url="function.gzinflate.php"/>
+<entry name="gzopen" url="function.gzopen.php"/>
+<entry name="gzpassthru" url="function.gzpassthru.php"/>
+<entry name="gzputs" url="function.gzputs.php"/>
+<entry name="gzread" url="function.gzread.php"/>
+<entry name="gzrewind" url="function.gzrewind.php"/>
+<entry name="gzseek" url="function.gzseek.php"/>
+<entry name="gztell" url="function.gztell.php"/>
+<entry name="gzuncompress" url="function.gzuncompress.php"/>
+<entry name="gzwrite" url="function.gzwrite.php"/>
+<entry name="readgzfile" url="function.readgzfile.php"/>
+<entry name="zlib_get_coding_type" url="function.zlib-get-coding-type.php"/>
+<entry name="m_checkstatus" url="function.m-checkstatus.php"/>
+<entry name="m_completeauthorizations" url="function.m-completeauthorizations.php"/>
+<entry name="m_connect" url="function.m-connect.php"/>
+<entry name="m_connectionerror" url="function.m-connectionerror.php"/>
+<entry name="m_deletetrans" url="function.m-deletetrans.php"/>
+<entry name="m_destroyconn" url="function.m-destroyconn.php"/>
+<entry name="m_destroyengine" url="function.m-destroyengine.php"/>
+<entry name="m_getcell" url="function.m-getcell.php"/>
+<entry name="m_getcellbynum" url="function.m-getcellbynum.php"/>
+<entry name="m_getcommadelimited" url="function.m-getcommadelimited.php"/>
+<entry name="m_getheader" url="function.m-getheader.php"/>
+<entry name="m_initconn" url="function.m-initconn.php"/>
+<entry name="m_initengine" url="function.m-initengine.php"/>
+<entry name="m_iscommadelimited" url="function.m-iscommadelimited.php"/>
+<entry name="m_maxconntimeout" url="function.m-maxconntimeout.php"/>
+<entry name="m_monitor" url="function.m-monitor.php"/>
+<entry name="m_numcolumns" url="function.m-numcolumns.php"/>
+<entry name="m_numrows" url="function.m-numrows.php"/>
+<entry name="m_parsecommadelimited" url="function.m-parsecommadelimited.php"/>
+<entry name="m_responsekeys" url="function.m-responsekeys.php"/>
+<entry name="m_responseparam" url="function.m-responseparam.php"/>
+<entry name="m_returnstatus" url="function.m-returnstatus.php"/>
+<entry name="m_setblocking" url="function.m-setblocking.php"/>
+<entry name="m_setdropfile" url="function.m-setdropfile.php"/>
+<entry name="m_setip" url="function.m-setip.php"/>
+<entry name="m_setssl_cafile" url="function.m-setssl-cafile.php"/>
+<entry name="m_setssl_files" url="function.m-setssl-files.php"/>
+<entry name="m_setssl" url="function.m-setssl.php"/>
+<entry name="m_settimeout" url="function.m-settimeout.php"/>
+<entry name="m_sslcert_gen_hash" url="function.m-sslcert-gen-hash.php"/>
+<entry name="m_transactionssent" url="function.m-transactionssent.php"/>
+<entry name="m_transinqueue" url="function.m-transinqueue.php"/>
+<entry name="m_transkeyval" url="function.m-transkeyval.php"/>
+<entry name="m_transnew" url="function.m-transnew.php"/>
+<entry name="m_transsend" url="function.m-transsend.php"/>
+<entry name="m_uwait" url="function.m-uwait.php"/>
+<entry name="m_validateidentifier" url="function.m-validateidentifier.php"/>
+<entry name="m_verifyconnection" url="function.m-verifyconnection.php"/>
+<entry name="m_verifysslcert" url="function.m-verifysslcert.php"/>
+<entry name="calcul_hmac" url="function.calcul-hmac.php"/>
+<entry name="calculhmac" url="function.calculhmac.php"/>
+<entry name="nthmac" url="function.nthmac.php"/>
+<entry name="signeurlpaiement" url="function.signeurlpaiement.php"/>
+<entry name="crack_check" url="function.crack-check.php"/>
+<entry name="crack_closedict" url="function.crack-closedict.php"/>
+<entry name="crack_getlastmessage" url="function.crack-getlastmessage.php"/>
+<entry name="crack_opendict" url="function.crack-opendict.php"/>
+<entry name="hash_algos" url="function.hash-algos.php"/>
+<entry name="hash_copy" url="function.hash-copy.php"/>
+<entry name="hash_file" url="function.hash-file.php"/>
+<entry name="hash_final" url="function.hash-final.php"/>
+<entry name="hash_hmac_file" url="function.hash-hmac-file.php"/>
+<entry name="hash_hmac" url="function.hash-hmac.php"/>
+<entry name="hash_init" url="function.hash-init.php"/>
+<entry name="hash_update_file" url="function.hash-update-file.php"/>
+<entry name="hash_update_stream" url="function.hash-update-stream.php"/>
+<entry name="hash_update" url="function.hash-update.php"/>
+<entry name="hash" url="function.hash.php"/>
+<entry name="mcrypt_cbc" url="function.mcrypt-cbc.php"/>
+<entry name="mcrypt_cfb" url="function.mcrypt-cfb.php"/>
+<entry name="mcrypt_create_iv" url="function.mcrypt-create-iv.php"/>
+<entry name="mcrypt_decrypt" url="function.mcrypt-decrypt.php"/>
+<entry name="mcrypt_ecb" url="function.mcrypt-ecb.php"/>
+<entry name="mcrypt_enc_get_algorithms_name" url="function.mcrypt-enc-get-algorithms-name.php"/>
+<entry name="mcrypt_enc_get_block_size" url="function.mcrypt-enc-get-block-size.php"/>
+<entry name="mcrypt_enc_get_iv_size" url="function.mcrypt-enc-get-iv-size.php"/>
+<entry name="mcrypt_enc_get_key_size" url="function.mcrypt-enc-get-key-size.php"/>
+<entry name="mcrypt_enc_get_modes_name" url="function.mcrypt-enc-get-modes-name.php"/>
+<entry name="mcrypt_enc_get_supported_key_sizes" url="function.mcrypt-enc-get-supported-key-sizes.php"/>
+<entry name="mcrypt_enc_is_block_algorithm_mode" url="function.mcrypt-enc-is-block-algorithm-mode.php"/>
+<entry name="mcrypt_enc_is_block_algorithm" url="function.mcrypt-enc-is-block-algorithm.php"/>
+<entry name="mcrypt_enc_is_block_mode" url="function.mcrypt-enc-is-block-mode.php"/>
+<entry name="mcrypt_enc_self_test" url="function.mcrypt-enc-self-test.php"/>
+<entry name="mcrypt_encrypt" url="function.mcrypt-encrypt.php"/>
+<entry name="mcrypt_generic_deinit" url="function.mcrypt-generic-deinit.php"/>
+<entry name="mcrypt_generic_end" url="function.mcrypt-generic-end.php"/>
+<entry name="mcrypt_generic_init" url="function.mcrypt-generic-init.php"/>
+<entry name="mcrypt_generic" url="function.mcrypt-generic.php"/>
+<entry name="mcrypt_get_block_size" url="function.mcrypt-get-block-size.php"/>
+<entry name="mcrypt_get_cipher_name" url="function.mcrypt-get-cipher-name.php"/>
+<entry name="mcrypt_get_iv_size" url="function.mcrypt-get-iv-size.php"/>
+<entry name="mcrypt_get_key_size" url="function.mcrypt-get-key-size.php"/>
+<entry name="mcrypt_list_algorithms" url="function.mcrypt-list-algorithms.php"/>
+<entry name="mcrypt_list_modes" url="function.mcrypt-list-modes.php"/>
+<entry name="mcrypt_module_close" url="function.mcrypt-module-close.php"/>
+<entry name="mcrypt_module_get_algo_block_size" url="function.mcrypt-module-get-algo-block-size.php"/>
+<entry name="mcrypt_module_get_algo_key_size" url="function.mcrypt-module-get-algo-key-size.php"/>
+<entry name="mcrypt_module_get_supported_key_sizes" url="function.mcrypt-module-get-supported-key-sizes.php"/>
+<entry name="mcrypt_module_is_block_algorithm_mode" url="function.mcrypt-module-is-block-algorithm-mode.php"/>
+<entry name="mcrypt_module_is_block_algorithm" url="function.mcrypt-module-is-block-algorithm.php"/>
+<entry name="mcrypt_module_is_block_mode" url="function.mcrypt-module-is-block-mode.php"/>
+<entry name="mcrypt_module_open" url="function.mcrypt-module-open.php"/>
+<entry name="mcrypt_module_self_test" url="function.mcrypt-module-self-test.php"/>
+<entry name="mcrypt_ofb" url="function.mcrypt-ofb.php"/>
+<entry name="mdecrypt_generic" url="function.mdecrypt-generic.php"/>
+<entry name="mhash_count" url="function.mhash-count.php"/>
+<entry name="mhash_get_block_size" url="function.mhash-get-block-size.php"/>
+<entry name="mhash_get_hash_name" url="function.mhash-get-hash-name.php"/>
+<entry name="mhash_keygen_s2k" url="function.mhash-keygen-s2k.php"/>
+<entry name="mhash" url="function.mhash.php"/>
+<entry name="openssl_csr_export_to_file" url="function.openssl-csr-export-to-file.php"/>
+<entry name="openssl_csr_export" url="function.openssl-csr-export.php"/>
+<entry name="openssl_csr_get_public_key" url="function.openssl-csr-get-public-key.php"/>
+<entry name="openssl_csr_get_subject" url="function.openssl-csr-get-subject.php"/>
+<entry name="openssl_csr_new" url="function.openssl-csr-new.php"/>
+<entry name="openssl_csr_sign" url="function.openssl-csr-sign.php"/>
+<entry name="openssl_error_string" url="function.openssl-error-string.php"/>
+<entry name="openssl_free_key" url="function.openssl-free-key.php"/>
+<entry name="openssl_get_privatekey" url="function.openssl-get-privatekey.php"/>
+<entry name="openssl_get_publickey" url="function.openssl-get-publickey.php"/>
+<entry name="openssl_open" url="function.openssl-open.php"/>
+<entry name="openssl_pkcs12_export_to_file" url="function.openssl-pkcs12-export-to-file.php"/>
+<entry name="openssl_pkcs12_export" url="function.openssl-pkcs12-export.php"/>
+<entry name="openssl_pkcs12_read" url="function.openssl-pkcs12-read.php"/>
+<entry name="openssl_pkcs7_decrypt" url="function.openssl-pkcs7-decrypt.php"/>
+<entry name="openssl_pkcs7_encrypt" url="function.openssl-pkcs7-encrypt.php"/>
+<entry name="openssl_pkcs7_sign" url="function.openssl-pkcs7-sign.php"/>
+<entry name="openssl_pkcs7_verify" url="function.openssl-pkcs7-verify.php"/>
+<entry name="openssl_pkey_export_to_file" url="function.openssl-pkey-export-to-file.php"/>
+<entry name="openssl_pkey_export" url="function.openssl-pkey-export.php"/>
+<entry name="openssl_pkey_free" url="function.openssl-pkey-free.php"/>
+<entry name="openssl_pkey_get_details" url="function.openssl-pkey-get-details.php"/>
+<entry name="openssl_pkey_get_private" url="function.openssl-pkey-get-private.php"/>
+<entry name="openssl_pkey_get_public" url="function.openssl-pkey-get-public.php"/>
+<entry name="openssl_pkey_new" url="function.openssl-pkey-new.php"/>
+<entry name="openssl_private_decrypt" url="function.openssl-private-decrypt.php"/>
+<entry name="openssl_private_encrypt" url="function.openssl-private-encrypt.php"/>
+<entry name="openssl_public_decrypt" url="function.openssl-public-decrypt.php"/>
+<entry name="openssl_public_encrypt" url="function.openssl-public-encrypt.php"/>
+<entry name="openssl_seal" url="function.openssl-seal.php"/>
+<entry name="openssl_sign" url="function.openssl-sign.php"/>
+<entry name="openssl_verify" url="function.openssl-verify.php"/>
+<entry name="openssl_x509_check_private_key" url="function.openssl-x509-check-private-key.php"/>
+<entry name="openssl_x509_checkpurpose" url="function.openssl-x509-checkpurpose.php"/>
+<entry name="openssl_x509_export_to_file" url="function.openssl-x509-export-to-file.php"/>
+<entry name="openssl_x509_export" url="function.openssl-x509-export.php"/>
+<entry name="openssl_x509_free" url="function.openssl-x509-free.php"/>
+<entry name="openssl_x509_parse" url="function.openssl-x509-parse.php"/>
+<entry name="openssl_x509_read" url="function.openssl-x509-read.php"/>
+<entry name="dba_close" url="function.dba-close.php"/>
+<entry name="dba_delete" url="function.dba-delete.php"/>
+<entry name="dba_exists" url="function.dba-exists.php"/>
+<entry name="dba_fetch" url="function.dba-fetch.php"/>
+<entry name="dba_firstkey" url="function.dba-firstkey.php"/>
+<entry name="dba_handlers" url="function.dba-handlers.php"/>
+<entry name="dba_insert" url="function.dba-insert.php"/>
+<entry name="dba_key_split" url="function.dba-key-split.php"/>
+<entry name="dba_list" url="function.dba-list.php"/>
+<entry name="dba_nextkey" url="function.dba-nextkey.php"/>
+<entry name="dba_open" url="function.dba-open.php"/>
+<entry name="dba_optimize" url="function.dba-optimize.php"/>
+<entry name="dba_popen" url="function.dba-popen.php"/>
+<entry name="dba_replace" url="function.dba-replace.php"/>
+<entry name="dba_sync" url="function.dba-sync.php"/>
+<entry name="dbx_close" url="function.dbx-close.php"/>
+<entry name="dbx_compare" url="function.dbx-compare.php"/>
+<entry name="dbx_connect" url="function.dbx-connect.php"/>
+<entry name="dbx_error" url="function.dbx-error.php"/>
+<entry name="dbx_escape_string" url="function.dbx-escape-string.php"/>
+<entry name="dbx_fetch_row" url="function.dbx-fetch-row.php"/>
+<entry name="dbx_query" url="function.dbx-query.php"/>
+<entry name="dbx_sort" url="function.dbx-sort.php"/>
+<entry name="odbc_autocommit" url="function.odbc-autocommit.php"/>
+<entry name="odbc_binmode" url="function.odbc-binmode.php"/>
+<entry name="odbc_close_all" url="function.odbc-close-all.php"/>
+<entry name="odbc_close" url="function.odbc-close.php"/>
+<entry name="odbc_columnprivileges" url="function.odbc-columnprivileges.php"/>
+<entry name="odbc_columns" url="function.odbc-columns.php"/>
+<entry name="odbc_commit" url="function.odbc-commit.php"/>
+<entry name="odbc_connect" url="function.odbc-connect.php"/>
+<entry name="odbc_cursor" url="function.odbc-cursor.php"/>
+<entry name="odbc_data_source" url="function.odbc-data-source.php"/>
+<entry name="odbc_do" url="function.odbc-do.php"/>
+<entry name="odbc_error" url="function.odbc-error.php"/>
+<entry name="odbc_errormsg" url="function.odbc-errormsg.php"/>
+<entry name="odbc_exec" url="function.odbc-exec.php"/>
+<entry name="odbc_execute" url="function.odbc-execute.php"/>
+<entry name="odbc_fetch_array" url="function.odbc-fetch-array.php"/>
+<entry name="odbc_fetch_into" url="function.odbc-fetch-into.php"/>
+<entry name="odbc_fetch_object" url="function.odbc-fetch-object.php"/>
+<entry name="odbc_fetch_row" url="function.odbc-fetch-row.php"/>
+<entry name="odbc_field_len" url="function.odbc-field-len.php"/>
+<entry name="odbc_field_name" url="function.odbc-field-name.php"/>
+<entry name="odbc_field_num" url="function.odbc-field-num.php"/>
+<entry name="odbc_field_precision" url="function.odbc-field-precision.php"/>
+<entry name="odbc_field_scale" url="function.odbc-field-scale.php"/>
+<entry name="odbc_field_type" url="function.odbc-field-type.php"/>
+<entry name="odbc_foreignkeys" url="function.odbc-foreignkeys.php"/>
+<entry name="odbc_free_result" url="function.odbc-free-result.php"/>
+<entry name="odbc_gettypeinfo" url="function.odbc-gettypeinfo.php"/>
+<entry name="odbc_longreadlen" url="function.odbc-longreadlen.php"/>
+<entry name="odbc_next_result" url="function.odbc-next-result.php"/>
+<entry name="odbc_num_fields" url="function.odbc-num-fields.php"/>
+<entry name="odbc_num_rows" url="function.odbc-num-rows.php"/>
+<entry name="odbc_pconnect" url="function.odbc-pconnect.php"/>
+<entry name="odbc_prepare" url="function.odbc-prepare.php"/>
+<entry name="odbc_primarykeys" url="function.odbc-primarykeys.php"/>
+<entry name="odbc_procedurecolumns" url="function.odbc-procedurecolumns.php"/>
+<entry name="odbc_procedures" url="function.odbc-procedures.php"/>
+<entry name="odbc_result_all" url="function.odbc-result-all.php"/>
+<entry name="odbc_result" url="function.odbc-result.php"/>
+<entry name="odbc_rollback" url="function.odbc-rollback.php"/>
+<entry name="odbc_setoption" url="function.odbc-setoption.php"/>
+<entry name="odbc_specialcolumns" url="function.odbc-specialcolumns.php"/>
+<entry name="odbc_statistics" url="function.odbc-statistics.php"/>
+<entry name="odbc_tableprivileges" url="function.odbc-tableprivileges.php"/>
+<entry name="odbc_tables" url="function.odbc-tables.php"/>
+<entry name="PDO::beginTransaction" url="pdo.begintransaction.php"/>
+<entry name="PDO::commit" url="pdo.commit.php"/>
+<entry name="PDO::__construct" url="pdo.construct.php"/>
+<entry name="PDO::errorCode" url="pdo.errorcode.php"/>
+<entry name="PDO::errorInfo" url="pdo.errorinfo.php"/>
+<entry name="PDO::exec" url="pdo.exec.php"/>
+<entry name="PDO::getAttribute" url="pdo.getattribute.php"/>
+<entry name="PDO::getAvailableDrivers" url="pdo.getavailabledrivers.php"/>
+<entry name="PDO::lastInsertId" url="pdo.lastinsertid.php"/>
+<entry name="PDO::prepare" url="pdo.prepare.php"/>
+<entry name="PDO::query" url="pdo.query.php"/>
+<entry name="PDO::quote" url="pdo.quote.php"/>
+<entry name="PDO::rollBack" url="pdo.rollback.php"/>
+<entry name="PDO::setAttribute" url="pdo.setattribute.php"/>
+<entry name="PDOStatement->bindColumn" url="pdostatement.bindcolumn.php"/>
+<entry name="PDOStatement->bindParam" url="pdostatement.bindparam.php"/>
+<entry name="PDOStatement->bindValue" url="pdostatement.bindvalue.php"/>
+<entry name="PDOStatement->closeCursor" url="pdostatement.closecursor.php"/>
+<entry name="PDOStatement->columnCount" url="pdostatement.columncount.php"/>
+<entry name="PDOStatement->errorCode" url="pdostatement.errorcode.php"/>
+<entry name="PDOStatement->errorInfo" url="pdostatement.errorinfo.php"/>
+<entry name="PDOStatement->execute" url="pdostatement.execute.php"/>
+<entry name="PDOStatement->fetch" url="pdostatement.fetch.php"/>
+<entry name="PDOStatement->fetchAll" url="pdostatement.fetchall.php"/>
+<entry name="PDOStatement->fetchColumn" url="pdostatement.fetchcolumn.php"/>
+<entry name="PDOStatement->fetchObject" url="pdostatement.fetchobject.php"/>
+<entry name="PDOStatement->getAttribute" url="pdostatement.getattribute.php"/>
+<entry name="PDOStatement->getColumnMeta" url="pdostatement.getcolumnmeta.php"/>
+<entry name="PDOStatement->nextRowset" url="pdostatement.nextrowset.php"/>
+<entry name="PDOStatement->rowCount" url="pdostatement.rowcount.php"/>
+<entry name="PDOStatement->setAttribute" url="pdostatement.setattribute.php"/>
+<entry name="PDOStatement->setFetchMode" url="pdostatement.setfetchmode.php"/>
+<entry name="PDO_DBLIB DSN" url="ref.pdo-dblib.connection.php"/>
+<entry name="PDO_FIREBIRD DSN" url="ref.pdo-firebird.connection.php"/>
+<entry name="PDO_IBM DSN" url="ref.pdo-ibm.connection.php"/>
+<entry name="PDO_INFORMIX DSN" url="ref.pdo-informix.connection.php"/>
+<entry name="PDO_MYSQL DSN" url="ref.pdo-mysql.connection.php"/>
+<entry name="PDO_OCI DSN" url="ref.pdo-oci.connection.php"/>
+<entry name="PDO_ODBC DSN" url="ref.pdo-odbc.connection.php"/>
+<entry name="PDO_PGSQL DSN" url="ref.pdo-pgsql.connection.php"/>
+<entry name="PDO::pgsqlLOBCreate" url="function.pdo-pgsqllobcreate.php"/>
+<entry name="PDO::pgsqlLOBOpen" url="function.pdo-pgsqllobopen.php"/>
+<entry name="PDO::pgsqlLOBUnlink" url="function.pdo-pgsqllobunlink.php"/>
+<entry name="PDO_SQLITE DSN" url="ref.pdo-sqlite.connection.php"/>
+<entry name="PDO->sqliteCreateAggregate()" url="function.pdo-sqlitecreateaggregate.php"/>
+<entry name="PDO->sqliteCreateFunction()" url="function.pdo-sqlitecreatefunction.php"/>
+<entry name="SDO_DAS_ChangeSummary::beginLogging" url="function.sdo-das-changesummary-beginlogging.php"/>
+<entry name="SDO_DAS_ChangeSummary::endLogging" url="function.sdo-das-changesummary-endlogging.php"/>
+<entry name="SDO_DAS_ChangeSummary::getChangeType" url="function.sdo-das-changesummary-getchangetype.php"/>
+<entry name="SDO_DAS_ChangeSummary::getChangedDataObjects" url="function.sdo-das-changesummary-getchangeddataobjects.php"/>
+<entry name="SDO_DAS_ChangeSummary::getOldContainer" url="function.sdo-das-changesummary-getoldcontainer.php"/>
+<entry name="SDO_DAS_ChangeSummary::getOldValues" url="function.sdo-das-changesummary-getoldvalues.php"/>
+<entry name="SDO_DAS_ChangeSummary::isLogging" url="function.sdo-das-changesummary-islogging.php"/>
+<entry name="SDO_DAS_DataFactory::addPropertyToType" url="function.sdo-das-datafactory-addpropertytotype.php"/>
+<entry name="SDO_DAS_DataFactory::addType" url="function.sdo-das-datafactory-addtype.php"/>
+<entry name="SDO_DAS_DataFactory::getDataFactory" url="function.sdo-das-datafactory-getdatafactory.php"/>
+<entry name="SDO_DAS_DataObject::getChangeSummary" url="function.sdo-das-dataobject-getchangesummary.php"/>
+<entry name="SDO_DAS_Setting::getListIndex" url="function.sdo-das-setting-getlistindex.php"/>
+<entry name="SDO_DAS_Setting::getPropertyIndex" url="function.sdo-das-setting-getpropertyindex.php"/>
+<entry name="SDO_DAS_Setting::getPropertyName" url="function.sdo-das-setting-getpropertyname.php"/>
+<entry name="SDO_DAS_Setting::getValue" url="function.sdo-das-setting-getvalue.php"/>
+<entry name="SDO_DAS_Setting::isSet" url="function.sdo-das-setting-isset.php"/>
+<entry name="SDO_DataFactory::create" url="function.sdo-datafactory-create.php"/>
+<entry name="SDO_DataObject::clear" url="function.sdo-dataobject-clear.php"/>
+<entry name="SDO_DataObject::createDataObject" url="function.sdo-dataobject-createdataobject.php"/>
+<entry name="SDO_DataObject::getContainer" url="function.sdo-dataobject-getcontainer.php"/>
+<entry name="SDO_DataObject::getSequence" url="function.sdo-dataobject-getsequence.php"/>
+<entry name="SDO_DataObject::getTypeName" url="function.sdo-dataobject-gettypename.php"/>
+<entry name="SDO_DataObject::getTypeNamespaceURI" url="function.sdo-dataobject-gettypenamespaceuri.php"/>
+<entry name="SDO_Exception::getCause" url="function.sdo-exception-getcause.php"/>
+<entry name="SDO_List::insert" url="function.sdo-list-insert.php"/>
+<entry name="SDO_Model_Property::getContainingType" url="function.sdo-model-property-getcontainingtype.php"/>
+<entry name="SDO_Model_Property::getDefault" url="function.sdo-model-property-getdefault.php"/>
+<entry name="SDO_Model_Property::getName" url="function.sdo-model-property-getname.php"/>
+<entry name="SDO_Model_Property::getType" url="function.sdo-model-property-gettype.php"/>
+<entry name="SDO_Model_Property::isContainment" url="function.sdo-model-property-iscontainment.php"/>
+<entry name="SDO_Model_Property::isMany" url="function.sdo-model-property-ismany.php"/>
+<entry name="SDO_Model_ReflectionDataObject::__construct" url="function.sdo-model-reflectiondataobject-construct.php"/>
+<entry name="SDO_Model_ReflectionDataObject::export" url="function.sdo-model-reflectiondataobject-export.php"/>
+<entry name="SDO_Model_ReflectionDataObject::getContainmentProperty" url="function.sdo-model-reflectiondataobject-getcontainmentproperty.php"/>
+<entry name="SDO_Model_ReflectionDataObject::getInstanceProperties" url="function.sdo-model-reflectiondataobject-getinstanceproperties.php"/>
+<entry name="SDO_Model_ReflectionDataObject::getType" url="function.sdo-model-reflectiondataobject-gettype.php"/>
+<entry name="SDO_Model_Type::getBaseType" url="function.sdo-model-type-getbasetype.php"/>
+<entry name="SDO_Model_Type::getName" url="function.sdo-model-type-getname.php"/>
+<entry name="SDO_Model_Type::getNamespaceURI" url="function.sdo-model-type-getnamespaceuri.php"/>
+<entry name="SDO_Model_Type::getProperties" url="function.sdo-model-type-getproperties.php"/>
+<entry name="SDO_Model_Type::getProperty" url="function.sdo-model-type-getproperty.php"/>
+<entry name="SDO_Model_Type::isAbstractType" url="function.sdo-model-type-isabstracttype.php"/>
+<entry name="SDO_Model_Type::isDataType" url="function.sdo-model-type-isdatatype.php"/>
+<entry name="SDO_Model_Type::isInstance" url="function.sdo-model-type-isinstance.php"/>
+<entry name="SDO_Model_Type::isOpenType" url="function.sdo-model-type-isopentype.php"/>
+<entry name="SDO_Model_Type::isSequencedType" url="function.sdo-model-type-issequencedtype.php"/>
+<entry name="SDO_Sequence::getProperty" url="function.sdo-sequence-getproperty.php"/>
+<entry name="SDO_Sequence::insert" url="function.sdo-sequence-insert.php"/>
+<entry name="SDO_Sequence::move" url="function.sdo-sequence-move.php"/>
+<entry name="SDO_DAS_Relational::applyChanges" url="function.sdo-das-relational-applychanges.php"/>
+<entry name="SDO_DAS_Relational::__construct" url="function.sdo-das-relational-construct.php"/>
+<entry name="SDO_DAS_Relational::createRootDataObject" url="function.sdo-das-relational-createrootdataobject.php"/>
+<entry name="SDO_DAS_Relational::executePreparedQuery" url="function.sdo-das-relational-executepreparedquery.php"/>
+<entry name="SDO_DAS_Relational::executeQuery" url="function.sdo-das-relational-executequery.php"/>
+<entry name="dbase_add_record" url="function.dbase-add-record.php"/>
+<entry name="dbase_close" url="function.dbase-close.php"/>
+<entry name="dbase_create" url="function.dbase-create.php"/>
+<entry name="dbase_delete_record" url="function.dbase-delete-record.php"/>
+<entry name="dbase_get_header_info" url="function.dbase-get-header-info.php"/>
+<entry name="dbase_get_record_with_names" url="function.dbase-get-record-with-names.php"/>
+<entry name="dbase_get_record" url="function.dbase-get-record.php"/>
+<entry name="dbase_numfields" url="function.dbase-numfields.php"/>
+<entry name="dbase_numrecords" url="function.dbase-numrecords.php"/>
+<entry name="dbase_open" url="function.dbase-open.php"/>
+<entry name="dbase_pack" url="function.dbase-pack.php"/>
+<entry name="dbase_replace_record" url="function.dbase-replace-record.php"/>
+<entry name="dbplus_add" url="function.dbplus-add.php"/>
+<entry name="dbplus_aql" url="function.dbplus-aql.php"/>
+<entry name="dbplus_chdir" url="function.dbplus-chdir.php"/>
+<entry name="dbplus_close" url="function.dbplus-close.php"/>
+<entry name="dbplus_curr" url="function.dbplus-curr.php"/>
+<entry name="dbplus_errcode" url="function.dbplus-errcode.php"/>
+<entry name="dbplus_errno" url="function.dbplus-errno.php"/>
+<entry name="dbplus_find" url="function.dbplus-find.php"/>
+<entry name="dbplus_first" url="function.dbplus-first.php"/>
+<entry name="dbplus_flush" url="function.dbplus-flush.php"/>
+<entry name="dbplus_freealllocks" url="function.dbplus-freealllocks.php"/>
+<entry name="dbplus_freelock" url="function.dbplus-freelock.php"/>
+<entry name="dbplus_freerlocks" url="function.dbplus-freerlocks.php"/>
+<entry name="dbplus_getlock" url="function.dbplus-getlock.php"/>
+<entry name="dbplus_getunique" url="function.dbplus-getunique.php"/>
+<entry name="dbplus_info" url="function.dbplus-info.php"/>
+<entry name="dbplus_last" url="function.dbplus-last.php"/>
+<entry name="dbplus_lockrel" url="function.dbplus-lockrel.php"/>
+<entry name="dbplus_next" url="function.dbplus-next.php"/>
+<entry name="dbplus_open" url="function.dbplus-open.php"/>
+<entry name="dbplus_prev" url="function.dbplus-prev.php"/>
+<entry name="dbplus_rchperm" url="function.dbplus-rchperm.php"/>
+<entry name="dbplus_rcreate" url="function.dbplus-rcreate.php"/>
+<entry name="dbplus_rcrtexact" url="function.dbplus-rcrtexact.php"/>
+<entry name="dbplus_rcrtlike" url="function.dbplus-rcrtlike.php"/>
+<entry name="dbplus_resolve" url="function.dbplus-resolve.php"/>
+<entry name="dbplus_restorepos" url="function.dbplus-restorepos.php"/>
+<entry name="dbplus_rkeys" url="function.dbplus-rkeys.php"/>
+<entry name="dbplus_ropen" url="function.dbplus-ropen.php"/>
+<entry name="dbplus_rquery" url="function.dbplus-rquery.php"/>
+<entry name="dbplus_rrename" url="function.dbplus-rrename.php"/>
+<entry name="dbplus_rsecindex" url="function.dbplus-rsecindex.php"/>
+<entry name="dbplus_runlink" url="function.dbplus-runlink.php"/>
+<entry name="dbplus_rzap" url="function.dbplus-rzap.php"/>
+<entry name="dbplus_savepos" url="function.dbplus-savepos.php"/>
+<entry name="dbplus_setindex" url="function.dbplus-setindex.php"/>
+<entry name="dbplus_setindexbynumber" url="function.dbplus-setindexbynumber.php"/>
+<entry name="dbplus_sql" url="function.dbplus-sql.php"/>
+<entry name="dbplus_tcl" url="function.dbplus-tcl.php"/>
+<entry name="dbplus_tremove" url="function.dbplus-tremove.php"/>
+<entry name="dbplus_undo" url="function.dbplus-undo.php"/>
+<entry name="dbplus_undoprepare" url="function.dbplus-undoprepare.php"/>
+<entry name="dbplus_unlockrel" url="function.dbplus-unlockrel.php"/>
+<entry name="dbplus_unselect" url="function.dbplus-unselect.php"/>
+<entry name="dbplus_update" url="function.dbplus-update.php"/>
+<entry name="dbplus_xlockrel" url="function.dbplus-xlockrel.php"/>
+<entry name="dbplus_xunlockrel" url="function.dbplus-xunlockrel.php"/>
+<entry name="fbsql_affected_rows" url="function.fbsql-affected-rows.php"/>
+<entry name="fbsql_autocommit" url="function.fbsql-autocommit.php"/>
+<entry name="fbsql_blob_size" url="function.fbsql-blob-size.php"/>
+<entry name="fbsql_change_user" url="function.fbsql-change-user.php"/>
+<entry name="fbsql_clob_size" url="function.fbsql-clob-size.php"/>
+<entry name="fbsql_close" url="function.fbsql-close.php"/>
+<entry name="fbsql_commit" url="function.fbsql-commit.php"/>
+<entry name="fbsql_connect" url="function.fbsql-connect.php"/>
+<entry name="fbsql_create_blob" url="function.fbsql-create-blob.php"/>
+<entry name="fbsql_create_clob" url="function.fbsql-create-clob.php"/>
+<entry name="fbsql_create_db" url="function.fbsql-create-db.php"/>
+<entry name="fbsql_data_seek" url="function.fbsql-data-seek.php"/>
+<entry name="fbsql_database_password" url="function.fbsql-database-password.php"/>
+<entry name="fbsql_database" url="function.fbsql-database.php"/>
+<entry name="fbsql_db_query" url="function.fbsql-db-query.php"/>
+<entry name="fbsql_db_status" url="function.fbsql-db-status.php"/>
+<entry name="fbsql_drop_db" url="function.fbsql-drop-db.php"/>
+<entry name="fbsql_errno" url="function.fbsql-errno.php"/>
+<entry name="fbsql_error" url="function.fbsql-error.php"/>
+<entry name="fbsql_fetch_array" url="function.fbsql-fetch-array.php"/>
+<entry name="fbsql_fetch_assoc" url="function.fbsql-fetch-assoc.php"/>
+<entry name="fbsql_fetch_field" url="function.fbsql-fetch-field.php"/>
+<entry name="fbsql_fetch_lengths" url="function.fbsql-fetch-lengths.php"/>
+<entry name="fbsql_fetch_object" url="function.fbsql-fetch-object.php"/>
+<entry name="fbsql_fetch_row" url="function.fbsql-fetch-row.php"/>
+<entry name="fbsql_field_flags" url="function.fbsql-field-flags.php"/>
+<entry name="fbsql_field_len" url="function.fbsql-field-len.php"/>
+<entry name="fbsql_field_name" url="function.fbsql-field-name.php"/>
+<entry name="fbsql_field_seek" url="function.fbsql-field-seek.php"/>
+<entry name="fbsql_field_table" url="function.fbsql-field-table.php"/>
+<entry name="fbsql_field_type" url="function.fbsql-field-type.php"/>
+<entry name="fbsql_free_result" url="function.fbsql-free-result.php"/>
+<entry name="fbsql_get_autostart_info" url="function.fbsql-get-autostart-info.php"/>
+<entry name="fbsql_hostname" url="function.fbsql-hostname.php"/>
+<entry name="fbsql_insert_id" url="function.fbsql-insert-id.php"/>
+<entry name="fbsql_list_dbs" url="function.fbsql-list-dbs.php"/>
+<entry name="fbsql_list_fields" url="function.fbsql-list-fields.php"/>
+<entry name="fbsql_list_tables" url="function.fbsql-list-tables.php"/>
+<entry name="fbsql_next_result" url="function.fbsql-next-result.php"/>
+<entry name="fbsql_num_fields" url="function.fbsql-num-fields.php"/>
+<entry name="fbsql_num_rows" url="function.fbsql-num-rows.php"/>
+<entry name="fbsql_password" url="function.fbsql-password.php"/>
+<entry name="fbsql_pconnect" url="function.fbsql-pconnect.php"/>
+<entry name="fbsql_query" url="function.fbsql-query.php"/>
+<entry name="fbsql_read_blob" url="function.fbsql-read-blob.php"/>
+<entry name="fbsql_read_clob" url="function.fbsql-read-clob.php"/>
+<entry name="fbsql_result" url="function.fbsql-result.php"/>
+<entry name="fbsql_rollback" url="function.fbsql-rollback.php"/>
+<entry name="fbsql_rows_fetched" url="function.fbsql-rows-fetched.php"/>
+<entry name="fbsql_select_db" url="function.fbsql-select-db.php"/>
+<entry name="fbsql_set_characterset" url="function.fbsql-set-characterset.php"/>
+<entry name="fbsql_set_lob_mode" url="function.fbsql-set-lob-mode.php"/>
+<entry name="fbsql_set_password" url="function.fbsql-set-password.php"/>
+<entry name="fbsql_set_transaction" url="function.fbsql-set-transaction.php"/>
+<entry name="fbsql_start_db" url="function.fbsql-start-db.php"/>
+<entry name="fbsql_stop_db" url="function.fbsql-stop-db.php"/>
+<entry name="fbsql_table_name" url="function.fbsql-table-name.php"/>
+<entry name="fbsql_tablename" url="function.fbsql-tablename.php"/>
+<entry name="fbsql_username" url="function.fbsql-username.php"/>
+<entry name="fbsql_warnings" url="function.fbsql-warnings.php"/>
+<entry name="filepro_fieldcount" url="function.filepro-fieldcount.php"/>
+<entry name="filepro_fieldname" url="function.filepro-fieldname.php"/>
+<entry name="filepro_fieldtype" url="function.filepro-fieldtype.php"/>
+<entry name="filepro_fieldwidth" url="function.filepro-fieldwidth.php"/>
+<entry name="filepro_retrieve" url="function.filepro-retrieve.php"/>
+<entry name="filepro_rowcount" url="function.filepro-rowcount.php"/>
+<entry name="filepro" url="function.filepro.php"/>
+<entry name="ibase_add_user" url="function.ibase-add-user.php"/>
+<entry name="ibase_affected_rows" url="function.ibase-affected-rows.php"/>
+<entry name="ibase_backup" url="function.ibase-backup.php"/>
+<entry name="ibase_blob_add" url="function.ibase-blob-add.php"/>
+<entry name="ibase_blob_cancel" url="function.ibase-blob-cancel.php"/>
+<entry name="ibase_blob_close" url="function.ibase-blob-close.php"/>
+<entry name="ibase_blob_create" url="function.ibase-blob-create.php"/>
+<entry name="ibase_blob_echo" url="function.ibase-blob-echo.php"/>
+<entry name="ibase_blob_get" url="function.ibase-blob-get.php"/>
+<entry name="ibase_blob_import" url="function.ibase-blob-import.php"/>
+<entry name="ibase_blob_info" url="function.ibase-blob-info.php"/>
+<entry name="ibase_blob_open" url="function.ibase-blob-open.php"/>
+<entry name="ibase_close" url="function.ibase-close.php"/>
+<entry name="ibase_commit_ret" url="function.ibase-commit-ret.php"/>
+<entry name="ibase_commit" url="function.ibase-commit.php"/>
+<entry name="ibase_connect" url="function.ibase-connect.php"/>
+<entry name="ibase_db_info" url="function.ibase-db-info.php"/>
+<entry name="ibase_delete_user" url="function.ibase-delete-user.php"/>
+<entry name="ibase_drop_db" url="function.ibase-drop-db.php"/>
+<entry name="ibase_errcode" url="function.ibase-errcode.php"/>
+<entry name="ibase_errmsg" url="function.ibase-errmsg.php"/>
+<entry name="ibase_execute" url="function.ibase-execute.php"/>
+<entry name="ibase_fetch_assoc" url="function.ibase-fetch-assoc.php"/>
+<entry name="ibase_fetch_object" url="function.ibase-fetch-object.php"/>
+<entry name="ibase_fetch_row" url="function.ibase-fetch-row.php"/>
+<entry name="ibase_field_info" url="function.ibase-field-info.php"/>
+<entry name="ibase_free_event_handler" url="function.ibase-free-event-handler.php"/>
+<entry name="ibase_free_query" url="function.ibase-free-query.php"/>
+<entry name="ibase_free_result" url="function.ibase-free-result.php"/>
+<entry name="ibase_gen_id" url="function.ibase-gen-id.php"/>
+<entry name="ibase_maintain_db" url="function.ibase-maintain-db.php"/>
+<entry name="ibase_modify_user" url="function.ibase-modify-user.php"/>
+<entry name="ibase_name_result" url="function.ibase-name-result.php"/>
+<entry name="ibase_num_fields" url="function.ibase-num-fields.php"/>
+<entry name="ibase_num_params" url="function.ibase-num-params.php"/>
+<entry name="ibase_param_info" url="function.ibase-param-info.php"/>
+<entry name="ibase_pconnect" url="function.ibase-pconnect.php"/>
+<entry name="ibase_prepare" url="function.ibase-prepare.php"/>
+<entry name="ibase_query" url="function.ibase-query.php"/>
+<entry name="ibase_restore" url="function.ibase-restore.php"/>
+<entry name="ibase_rollback_ret" url="function.ibase-rollback-ret.php"/>
+<entry name="ibase_rollback" url="function.ibase-rollback.php"/>
+<entry name="ibase_server_info" url="function.ibase-server-info.php"/>
+<entry name="ibase_service_attach" url="function.ibase-service-attach.php"/>
+<entry name="ibase_service_detach" url="function.ibase-service-detach.php"/>
+<entry name="ibase_set_event_handler" url="function.ibase-set-event-handler.php"/>
+<entry name="ibase_timefmt" url="function.ibase-timefmt.php"/>
+<entry name="ibase_trans" url="function.ibase-trans.php"/>
+<entry name="ibase_wait_event" url="function.ibase-wait-event.php"/>
+<entry name="ifx_affected_rows" url="function.ifx-affected-rows.php"/>
+<entry name="ifx_blobinfile_mode" url="function.ifx-blobinfile-mode.php"/>
+<entry name="ifx_byteasvarchar" url="function.ifx-byteasvarchar.php"/>
+<entry name="ifx_close" url="function.ifx-close.php"/>
+<entry name="ifx_connect" url="function.ifx-connect.php"/>
+<entry name="ifx_copy_blob" url="function.ifx-copy-blob.php"/>
+<entry name="ifx_create_blob" url="function.ifx-create-blob.php"/>
+<entry name="ifx_create_char" url="function.ifx-create-char.php"/>
+<entry name="ifx_do" url="function.ifx-do.php"/>
+<entry name="ifx_error" url="function.ifx-error.php"/>
+<entry name="ifx_errormsg" url="function.ifx-errormsg.php"/>
+<entry name="ifx_fetch_row" url="function.ifx-fetch-row.php"/>
+<entry name="ifx_fieldproperties" url="function.ifx-fieldproperties.php"/>
+<entry name="ifx_fieldtypes" url="function.ifx-fieldtypes.php"/>
+<entry name="ifx_free_blob" url="function.ifx-free-blob.php"/>
+<entry name="ifx_free_char" url="function.ifx-free-char.php"/>
+<entry name="ifx_free_result" url="function.ifx-free-result.php"/>
+<entry name="ifx_get_blob" url="function.ifx-get-blob.php"/>
+<entry name="ifx_get_char" url="function.ifx-get-char.php"/>
+<entry name="ifx_getsqlca" url="function.ifx-getsqlca.php"/>
+<entry name="ifx_htmltbl_result" url="function.ifx-htmltbl-result.php"/>
+<entry name="ifx_nullformat" url="function.ifx-nullformat.php"/>
+<entry name="ifx_num_fields" url="function.ifx-num-fields.php"/>
+<entry name="ifx_num_rows" url="function.ifx-num-rows.php"/>
+<entry name="ifx_pconnect" url="function.ifx-pconnect.php"/>
+<entry name="ifx_prepare" url="function.ifx-prepare.php"/>
+<entry name="ifx_query" url="function.ifx-query.php"/>
+<entry name="ifx_textasvarchar" url="function.ifx-textasvarchar.php"/>
+<entry name="ifx_update_blob" url="function.ifx-update-blob.php"/>
+<entry name="ifx_update_char" url="function.ifx-update-char.php"/>
+<entry name="ifxus_close_slob" url="function.ifxus-close-slob.php"/>
+<entry name="ifxus_create_slob" url="function.ifxus-create-slob.php"/>
+<entry name="ifxus_free_slob" url="function.ifxus-free-slob.php"/>
+<entry name="ifxus_open_slob" url="function.ifxus-open-slob.php"/>
+<entry name="ifxus_read_slob" url="function.ifxus-read-slob.php"/>
+<entry name="ifxus_seek_slob" url="function.ifxus-seek-slob.php"/>
+<entry name="ifxus_tell_slob" url="function.ifxus-tell-slob.php"/>
+<entry name="ifxus_write_slob" url="function.ifxus-write-slob.php"/>
+<entry name="db2_autocommit" url="function.db2-autocommit.php"/>
+<entry name="db2_bind_param" url="function.db2-bind-param.php"/>
+<entry name="db2_client_info" url="function.db2-client-info.php"/>
+<entry name="db2_close" url="function.db2-close.php"/>
+<entry name="db2_column_privileges" url="function.db2-column-privileges.php"/>
+<entry name="db2_columns" url="function.db2-columns.php"/>
+<entry name="db2_commit" url="function.db2-commit.php"/>
+<entry name="db2_conn_error" url="function.db2-conn-error.php"/>
+<entry name="db2_conn_errormsg" url="function.db2-conn-errormsg.php"/>
+<entry name="db2_connect" url="function.db2-connect.php"/>
+<entry name="db2_cursor_type" url="function.db2-cursor-type.php"/>
+<entry name="db2_escape_string" url="function.db2-escape-string.php"/>
+<entry name="db2_exec" url="function.db2-exec.php"/>
+<entry name="db2_execute" url="function.db2-execute.php"/>
+<entry name="db2_fetch_array" url="function.db2-fetch-array.php"/>
+<entry name="db2_fetch_assoc" url="function.db2-fetch-assoc.php"/>
+<entry name="db2_fetch_both" url="function.db2-fetch-both.php"/>
+<entry name="db2_fetch_object" url="function.db2-fetch-object.php"/>
+<entry name="db2_fetch_row" url="function.db2-fetch-row.php"/>
+<entry name="db2_field_display_size" url="function.db2-field-display-size.php"/>
+<entry name="db2_field_name" url="function.db2-field-name.php"/>
+<entry name="db2_field_num" url="function.db2-field-num.php"/>
+<entry name="db2_field_precision" url="function.db2-field-precision.php"/>
+<entry name="db2_field_scale" url="function.db2-field-scale.php"/>
+<entry name="db2_field_type" url="function.db2-field-type.php"/>
+<entry name="db2_field_width" url="function.db2-field-width.php"/>
+<entry name="db2_foreign_keys" url="function.db2-foreign-keys.php"/>
+<entry name="db2_free_result" url="function.db2-free-result.php"/>
+<entry name="db2_free_stmt" url="function.db2-free-stmt.php"/>
+<entry name="db2_get_option" url="function.db2-get-option.php"/>
+<entry name="db2_lob_read" url="function.db2-lob-read.php"/>
+<entry name="db2_next_result" url="function.db2-next-result.php"/>
+<entry name="db2_num_fields" url="function.db2-num-fields.php"/>
+<entry name="db2_num_rows" url="function.db2-num-rows.php"/>
+<entry name="db2_pconnect" url="function.db2-pconnect.php"/>
+<entry name="db2_prepare" url="function.db2-prepare.php"/>
+<entry name="db2_primary_keys" url="function.db2-primary-keys.php"/>
+<entry name="db2_procedure_columns" url="function.db2-procedure-columns.php"/>
+<entry name="db2_procedures" url="function.db2-procedures.php"/>
+<entry name="db2_result" url="function.db2-result.php"/>
+<entry name="db2_rollback" url="function.db2-rollback.php"/>
+<entry name="db2_server_info" url="function.db2-server-info.php"/>
+<entry name="db2_set_option" url="function.db2-set-option.php"/>
+<entry name="db2_special_columns" url="function.db2-special-columns.php"/>
+<entry name="db2_statistics" url="function.db2-statistics.php"/>
+<entry name="db2_stmt_error" url="function.db2-stmt-error.php"/>
+<entry name="db2_stmt_errormsg" url="function.db2-stmt-errormsg.php"/>
+<entry name="db2_table_privileges" url="function.db2-table-privileges.php"/>
+<entry name="db2_tables" url="function.db2-tables.php"/>
+<entry name="ingres_autocommit" url="function.ingres-autocommit.php"/>
+<entry name="ingres_close" url="function.ingres-close.php"/>
+<entry name="ingres_commit" url="function.ingres-commit.php"/>
+<entry name="ingres_connect" url="function.ingres-connect.php"/>
+<entry name="ingres_cursor" url="function.ingres-cursor.php"/>
+<entry name="ingres_errno" url="function.ingres-errno.php"/>
+<entry name="ingres_error" url="function.ingres-error.php"/>
+<entry name="ingres_errsqlstate" url="function.ingres-errsqlstate.php"/>
+<entry name="ingres_fetch_array" url="function.ingres-fetch-array.php"/>
+<entry name="ingres_fetch_object" url="function.ingres-fetch-object.php"/>
+<entry name="ingres_fetch_row" url="function.ingres-fetch-row.php"/>
+<entry name="ingres_field_length" url="function.ingres-field-length.php"/>
+<entry name="ingres_field_name" url="function.ingres-field-name.php"/>
+<entry name="ingres_field_nullable" url="function.ingres-field-nullable.php"/>
+<entry name="ingres_field_precision" url="function.ingres-field-precision.php"/>
+<entry name="ingres_field_scale" url="function.ingres-field-scale.php"/>
+<entry name="ingres_field_type" url="function.ingres-field-type.php"/>
+<entry name="ingres_num_fields" url="function.ingres-num-fields.php"/>
+<entry name="ingres_num_rows" url="function.ingres-num-rows.php"/>
+<entry name="ingres_pconnect" url="function.ingres-pconnect.php"/>
+<entry name="ingres_query" url="function.ingres-query.php"/>
+<entry name="ingres_rollback" url="function.ingres-rollback.php"/>
+<entry name="maxdb->affected_rows" url="function.maxdb-affected-rows.php"/>
+<entry name=" maxdb->auto_commit" url="function.maxdb-autocommit.php"/>
+<entry name="maxdb_bind_param" url="function.maxdb-bind-param.php"/>
+<entry name="maxdb_bind_result" url="function.maxdb-bind-result.php"/>
+<entry name="maxdb->change_user" url="function.maxdb-change-user.php"/>
+<entry name="maxdb->character_set_name" url="function.maxdb-character-set-name.php"/>
+<entry name="maxdb_client_encoding" url="function.maxdb-client-encoding.php"/>
+<entry name="maxdb->close_long_data" url="function.maxdb-close-long-data.php"/>
+<entry name="maxdb->close" url="function.maxdb-close.php"/>
+<entry name="maxdb->commit" url="function.maxdb-commit.php"/>
+<entry name="maxdb_connect_errno" url="function.maxdb-connect-errno.php"/>
+<entry name="maxdb_connect_error" url="function.maxdb-connect-error.php"/>
+<entry name="maxdb()" url="function.maxdb-connect.php"/>
+<entry name="result->data_seek" url="function.maxdb-data-seek.php"/>
+<entry name="maxdb_debug" url="function.maxdb-debug.php"/>
+<entry name="maxdb->disable_reads_from_master" url="function.maxdb-disable-reads-from-master.php"/>
+<entry name="maxdb_disable_rpl_parse" url="function.maxdb-disable-rpl-parse.php"/>
+<entry name="maxdb_dump_debug_info" url="function.maxdb-dump-debug-info.php"/>
+<entry name="maxdb_embedded_connect" url="function.maxdb-embedded-connect.php"/>
+<entry name="maxdb_enable_reads_from_master" url="function.maxdb-enable-reads-from-master.php"/>
+<entry name="maxdb_enable_rpl_parse" url="function.maxdb-enable-rpl-parse.php"/>
+<entry name="maxdb->errno" url="function.maxdb-errno.php"/>
+<entry name="maxdb_error" url="function.maxdb-error.php"/>
+<entry name="maxdb_escape_string" url="function.maxdb-escape-string.php"/>
+<entry name="maxdb_execute" url="function.maxdb-execute.php"/>
+<entry name="result->fetch_array" url="function.maxdb-fetch-array.php"/>
+<entry name="maxdb->fetch_assoc" url="function.maxdb-fetch-assoc.php"/>
+<entry name="result->fetch_field_direct" url="function.maxdb-fetch-field-direct.php"/>
+<entry name="result->fetch_field" url="function.maxdb-fetch-field.php"/>
+<entry name="result->fetch_fields" url="function.maxdb-fetch-fields.php"/>
+<entry name="result->lengths" url="function.maxdb-fetch-lengths.php"/>
+<entry name="result->fetch_object" url="function.maxdb-fetch-object.php"/>
+<entry name="result->fetch_row" url="function.maxdb-fetch-row.php"/>
+<entry name="maxdb_fetch" url="function.maxdb-fetch.php"/>
+<entry name="maxdb->field_count" url="function.maxdb-field-count.php"/>
+<entry name="result->field_seek" url="function.maxdb-field-seek.php"/>
+<entry name="result->current_field" url="function.maxdb-field-tell.php"/>
+<entry name="result->free" url="function.maxdb-free-result.php"/>
+<entry name="maxdb_get_client_info" url="function.maxdb-get-client-info.php"/>
+<entry name="maxdb_get_client_version" url="function.maxdb-get-client-version.php"/>
+<entry name="maxdb->get_host_info" url="function.maxdb-get-host-info.php"/>
+<entry name="maxdb_get_metadata" url="function.maxdb-get-metadata.php"/>
+<entry name="maxdb->protocol_version" url="function.maxdb-get-proto-info.php"/>
+<entry name="maxdb->server_info" url="function.maxdb-get-server-info.php"/>
+<entry name="maxdb_get_server_version" url="function.maxdb-get-server-version.php"/>
+<entry name="maxdb->info" url="function.maxdb-info.php"/>
+<entry name="maxdb_init" url="function.maxdb-init.php"/>
+<entry name="maxdb->insert_id" url="function.maxdb-insert-id.php"/>
+<entry name="maxdb->kill" url="function.maxdb-kill.php"/>
+<entry name="maxdb_master_query" url="function.maxdb-master-query.php"/>
+<entry name="maxdb->more_results" url="function.maxdb-more-results.php"/>
+<entry name="maxdb->multi_query" url="function.maxdb-multi-query.php"/>
+<entry name="maxdb->next_result" url="function.maxdb-next-result.php"/>
+<entry name="result->field_count" url="function.maxdb-num-fields.php"/>
+<entry name="maxdb_num_rows" url="function.maxdb-num-rows.php"/>
+<entry name="maxdb->options" url="function.maxdb-options.php"/>
+<entry name="maxdb_param_count" url="function.maxdb-param-count.php"/>
+<entry name="maxdb->ping" url="function.maxdb-ping.php"/>
+<entry name="maxdb->prepare" url="function.maxdb-prepare.php"/>
+<entry name="maxdb->query" url="function.maxdb-query.php"/>
+<entry name="maxdb->real_connect" url="function.maxdb-real-connect.php"/>
+<entry name="maxdb->real_escape_string" url="function.maxdb-real-escape-string.php"/>
+<entry name="maxdb->real_query" url="function.maxdb-real-query.php"/>
+<entry name="maxdb_report" url="function.maxdb-report.php"/>
+<entry name="maxdb->rollback" url="function.maxdb-rollback.php"/>
+<entry name="maxdb_rpl_parse_enabled" url="function.maxdb-rpl-parse-enabled.php"/>
+<entry name="maxdb_rpl_probe" url="function.maxdb-rpl-probe.php"/>
+<entry name="maxdb->rpl_query_type" url="function.maxdb-rpl-query-type.php"/>
+<entry name="maxdb->select_db" url="function.maxdb-select-db.php"/>
+<entry name="maxdb_send_long_data" url="function.maxdb-send-long-data.php"/>
+<entry name="maxdb->send_query" url="function.maxdb-send-query.php"/>
+<entry name="maxdb_server_end" url="function.maxdb-server-end.php"/>
+<entry name="maxdb_server_init" url="function.maxdb-server-init.php"/>
+<entry name="maxdb_set_opt" url="function.maxdb-set-opt.php"/>
+<entry name="maxdb->sqlstate" url="function.maxdb-sqlstate.php"/>
+<entry name="maxdb->ssl_set" url="function.maxdb-ssl-set.php"/>
+<entry name="maxdb->stat" url="function.maxdb-stat.php"/>
+<entry name="maxdb_stmt->affected_rows" url="function.maxdb-stmt-affected-rows.php"/>
+<entry name="stmt->bind_param" url="function.maxdb-stmt-bind-param.php"/>
+<entry name="stmt->bind_result" url="function.maxdb-stmt-bind-result.php"/>
+<entry name="stmt->close_long_data" url="function.maxdb-stmt-close-long-data.php"/>
+<entry name="maxdb_stmt->close" url="function.maxdb-stmt-close.php"/>
+<entry name="stmt->data_seek" url="function.maxdb-stmt-data-seek.php"/>
+<entry name="maxdb_stmt->errno" url="function.maxdb-stmt-errno.php"/>
+<entry name="maxdb_stmt->error" url="function.maxdb-stmt-error.php"/>
+<entry name="stmt->execute" url="function.maxdb-stmt-execute.php"/>
+<entry name="stmt->fetch" url="function.maxdb-stmt-fetch.php"/>
+<entry name="stmt->free_result" url="function.maxdb-stmt-free-result.php"/>
+<entry name="maxdb->stmt_init" url="function.maxdb-stmt-init.php"/>
+<entry name="stmt->num_rows" url="function.maxdb-stmt-num-rows.php"/>
+<entry name="stmt->param_count" url="function.maxdb-stmt-param-count.php"/>
+<entry name="stmt->prepare" url="function.maxdb-stmt-prepare.php"/>
+<entry name="stmt->reset" url="function.maxdb-stmt-reset.php"/>
+<entry name="maxdb_stmt_result_metadata" url="function.maxdb-stmt-result-metadata.php"/>
+<entry name="stmt->send_long_data" url="function.maxdb-stmt-send-long-data.php"/>
+<entry name="maxdb_stmt_sqlstate" url="function.maxdb-stmt-sqlstate.php"/>
+<entry name="maxdb->store_result" url="function.maxdb-store-result.php"/>
+<entry name="maxdb->thread_id" url="function.maxdb-thread-id.php"/>
+<entry name="maxdb_thread_safe" url="function.maxdb-thread-safe.php"/>
+<entry name="maxdb->use_result" url="function.maxdb-use-result.php"/>
+<entry name="maxdb->warning_count" url="function.maxdb-warning-count.php"/>
+<entry name="msql_affected_rows" url="function.msql-affected-rows.php"/>
+<entry name="msql_close" url="function.msql-close.php"/>
+<entry name="msql_connect" url="function.msql-connect.php"/>
+<entry name="msql_create_db" url="function.msql-create-db.php"/>
+<entry name="msql_createdb" url="function.msql-createdb.php"/>
+<entry name="msql_data_seek" url="function.msql-data-seek.php"/>
+<entry name="msql_db_query" url="function.msql-db-query.php"/>
+<entry name="msql_dbname" url="function.msql-dbname.php"/>
+<entry name="msql_drop_db" url="function.msql-drop-db.php"/>
+<entry name="msql_error" url="function.msql-error.php"/>
+<entry name="msql_fetch_array" url="function.msql-fetch-array.php"/>
+<entry name="msql_fetch_field" url="function.msql-fetch-field.php"/>
+<entry name="msql_fetch_object" url="function.msql-fetch-object.php"/>
+<entry name="msql_fetch_row" url="function.msql-fetch-row.php"/>
+<entry name="msql_field_flags" url="function.msql-field-flags.php"/>
+<entry name="msql_field_len" url="function.msql-field-len.php"/>
+<entry name="msql_field_name" url="function.msql-field-name.php"/>
+<entry name="msql_field_seek" url="function.msql-field-seek.php"/>
+<entry name="msql_field_table" url="function.msql-field-table.php"/>
+<entry name="msql_field_type" url="function.msql-field-type.php"/>
+<entry name="msql_fieldflags" url="function.msql-fieldflags.php"/>
+<entry name="msql_fieldlen" url="function.msql-fieldlen.php"/>
+<entry name="msql_fieldname" url="function.msql-fieldname.php"/>
+<entry name="msql_fieldtable" url="function.msql-fieldtable.php"/>
+<entry name="msql_fieldtype" url="function.msql-fieldtype.php"/>
+<entry name="msql_free_result" url="function.msql-free-result.php"/>
+<entry name="msql_list_dbs" url="function.msql-list-dbs.php"/>
+<entry name="msql_list_fields" url="function.msql-list-fields.php"/>
+<entry name="msql_list_tables" url="function.msql-list-tables.php"/>
+<entry name="msql_num_fields" url="function.msql-num-fields.php"/>
+<entry name="msql_num_rows" url="function.msql-num-rows.php"/>
+<entry name="msql_numfields" url="function.msql-numfields.php"/>
+<entry name="msql_numrows" url="function.msql-numrows.php"/>
+<entry name="msql_pconnect" url="function.msql-pconnect.php"/>
+<entry name="msql_query" url="function.msql-query.php"/>
+<entry name="msql_regcase" url="function.msql-regcase.php"/>
+<entry name="msql_result" url="function.msql-result.php"/>
+<entry name="msql_select_db" url="function.msql-select-db.php"/>
+<entry name="msql_tablename" url="function.msql-tablename.php"/>
+<entry name="msql" url="function.msql.php"/>
+<entry name="mssql_bind" url="function.mssql-bind.php"/>
+<entry name="mssql_close" url="function.mssql-close.php"/>
+<entry name="mssql_connect" url="function.mssql-connect.php"/>
+<entry name="mssql_data_seek" url="function.mssql-data-seek.php"/>
+<entry name="mssql_execute" url="function.mssql-execute.php"/>
+<entry name="mssql_fetch_array" url="function.mssql-fetch-array.php"/>
+<entry name="mssql_fetch_assoc" url="function.mssql-fetch-assoc.php"/>
+<entry name="mssql_fetch_batch" url="function.mssql-fetch-batch.php"/>
+<entry name="mssql_fetch_field" url="function.mssql-fetch-field.php"/>
+<entry name="mssql_fetch_object" url="function.mssql-fetch-object.php"/>
+<entry name="mssql_fetch_row" url="function.mssql-fetch-row.php"/>
+<entry name="mssql_field_length" url="function.mssql-field-length.php"/>
+<entry name="mssql_field_name" url="function.mssql-field-name.php"/>
+<entry name="mssql_field_seek" url="function.mssql-field-seek.php"/>
+<entry name="mssql_field_type" url="function.mssql-field-type.php"/>
+<entry name="mssql_free_result" url="function.mssql-free-result.php"/>
+<entry name="mssql_free_statement" url="function.mssql-free-statement.php"/>
+<entry name="mssql_get_last_message" url="function.mssql-get-last-message.php"/>
+<entry name="mssql_guid_string" url="function.mssql-guid-string.php"/>
+<entry name="mssql_init" url="function.mssql-init.php"/>
+<entry name="mssql_min_error_severity" url="function.mssql-min-error-severity.php"/>
+<entry name="mssql_min_message_severity" url="function.mssql-min-message-severity.php"/>
+<entry name="mssql_next_result" url="function.mssql-next-result.php"/>
+<entry name="mssql_num_fields" url="function.mssql-num-fields.php"/>
+<entry name="mssql_num_rows" url="function.mssql-num-rows.php"/>
+<entry name="mssql_pconnect" url="function.mssql-pconnect.php"/>
+<entry name="mssql_query" url="function.mssql-query.php"/>
+<entry name="mssql_result" url="function.mssql-result.php"/>
+<entry name="mssql_rows_affected" url="function.mssql-rows-affected.php"/>
+<entry name="mssql_select_db" url="function.mssql-select-db.php"/>
+<entry name="mysql_affected_rows" url="function.mysql-affected-rows.php"/>
+<entry name="mysql_change_user" url="function.mysql-change-user.php"/>
+<entry name="mysql_client_encoding" url="function.mysql-client-encoding.php"/>
+<entry name="mysql_close" url="function.mysql-close.php"/>
+<entry name="mysql_connect" url="function.mysql-connect.php"/>
+<entry name="mysql_create_db" url="function.mysql-create-db.php"/>
+<entry name="mysql_data_seek" url="function.mysql-data-seek.php"/>
+<entry name="mysql_db_name" url="function.mysql-db-name.php"/>
+<entry name="mysql_db_query" url="function.mysql-db-query.php"/>
+<entry name="mysql_drop_db" url="function.mysql-drop-db.php"/>
+<entry name="mysql_errno" url="function.mysql-errno.php"/>
+<entry name="mysql_error" url="function.mysql-error.php"/>
+<entry name="mysql_escape_string" url="function.mysql-escape-string.php"/>
+<entry name="mysql_fetch_array" url="function.mysql-fetch-array.php"/>
+<entry name="mysql_fetch_assoc" url="function.mysql-fetch-assoc.php"/>
+<entry name="mysql_fetch_field" url="function.mysql-fetch-field.php"/>
+<entry name="mysql_fetch_lengths" url="function.mysql-fetch-lengths.php"/>
+<entry name="mysql_fetch_object" url="function.mysql-fetch-object.php"/>
+<entry name="mysql_fetch_row" url="function.mysql-fetch-row.php"/>
+<entry name="mysql_field_flags" url="function.mysql-field-flags.php"/>
+<entry name="mysql_field_len" url="function.mysql-field-len.php"/>
+<entry name="mysql_field_name" url="function.mysql-field-name.php"/>
+<entry name="mysql_field_seek" url="function.mysql-field-seek.php"/>
+<entry name="mysql_field_table" url="function.mysql-field-table.php"/>
+<entry name="mysql_field_type" url="function.mysql-field-type.php"/>
+<entry name="mysql_free_result" url="function.mysql-free-result.php"/>
+<entry name="mysql_get_client_info" url="function.mysql-get-client-info.php"/>
+<entry name="mysql_get_host_info" url="function.mysql-get-host-info.php"/>
+<entry name="mysql_get_proto_info" url="function.mysql-get-proto-info.php"/>
+<entry name="mysql_get_server_info" url="function.mysql-get-server-info.php"/>
+<entry name="mysql_info" url="function.mysql-info.php"/>
+<entry name="mysql_insert_id" url="function.mysql-insert-id.php"/>
+<entry name="mysql_list_dbs" url="function.mysql-list-dbs.php"/>
+<entry name="mysql_list_fields" url="function.mysql-list-fields.php"/>
+<entry name="mysql_list_processes" url="function.mysql-list-processes.php"/>
+<entry name="mysql_list_tables" url="function.mysql-list-tables.php"/>
+<entry name="mysql_num_fields" url="function.mysql-num-fields.php"/>
+<entry name="mysql_num_rows" url="function.mysql-num-rows.php"/>
+<entry name="mysql_pconnect" url="function.mysql-pconnect.php"/>
+<entry name="mysql_ping" url="function.mysql-ping.php"/>
+<entry name="mysql_query" url="function.mysql-query.php"/>
+<entry name="mysql_real_escape_string" url="function.mysql-real-escape-string.php"/>
+<entry name="mysql_result" url="function.mysql-result.php"/>
+<entry name="mysql_select_db" url="function.mysql-select-db.php"/>
+<entry name="mysql_set_charset" url="function.mysql-set-charset.php"/>
+<entry name="mysql_stat" url="function.mysql-stat.php"/>
+<entry name="mysql_tablename" url="function.mysql-tablename.php"/>
+<entry name="mysql_thread_id" url="function.mysql-thread-id.php"/>
+<entry name="mysql_unbuffered_query" url="function.mysql-unbuffered-query.php"/>
+<entry name="mysqli_affected_rows" url="mysqli.affected-rows.php"/>
+<entry name="mysqli_autocommit" url="mysqli.autocommit.php"/>
+<entry name="mysqli_change_user" url="mysqli.change-user.php"/>
+<entry name="mysqli_character_set_name" url="mysqli.character-set-name.php"/>
+<entry name="mysqli_close" url="mysqli.close.php"/>
+<entry name="mysqli_commit" url="mysqli.commit.php"/>
+<entry name="mysqli_connect_errno" url="mysqli.connect-errno.php"/>
+<entry name="mysqli_connect_error" url="mysqli.connect-error.php"/>
+<entry name="mysqli_connect" url="mysqli.connect.php"/>
+<entry name="mysqli_debug" url="mysqli.debug.php"/>
+<entry name="mysqli_dump_debug_info" url="mysqli.dump-debug-info.php"/>
+<entry name="mysqli_errno" url="mysqli.errno.php"/>
+<entry name="mysqli_error" url="mysqli.error.php"/>
+<entry name="mysqli_field_count" url="mysqli.field-count.php"/>
+<entry name="mysqli_get_charset" url="mysqli.get-charset.php"/>
+<entry name="mysqli_get_client_info" url="mysqli.get-client-info.php"/>
+<entry name="mysqli_get_client_version" url="mysqli.get-client-version.php"/>
+<entry name="mysqli_get_host_info" url="mysqli.get-host-info.php"/>
+<entry name="mysqli_get_proto_info" url="mysqli.get-proto-info.php"/>
+<entry name="mysqli_get_server_info" url="mysqli.get-server-info.php"/>
+<entry name="mysqli_get_server_version" url="mysqli.get-server-version.php"/>
+<entry name="mysqli_get_warnings" url="mysqli.get-warnings.php"/>
+<entry name="mysqli_info" url="mysqli.info.php"/>
+<entry name="mysqli_init" url="mysqli.init.php"/>
+<entry name="mysqli_insert_id" url="mysqli.insert-id.php"/>
+<entry name="mysqli_kill" url="mysqli.kill.php"/>
+<entry name="mysqli_more_results" url="mysqli.more-results.php"/>
+<entry name="mysqli_multi_query" url="mysqli.multi-query.php"/>
+<entry name="mysqli_next_result" url="mysqli.next-result.php"/>
+<entry name="mysqli_options" url="mysqli.options.php"/>
+<entry name="mysqli_ping" url="mysqli.ping.php"/>
+<entry name="mysqli_prepare" url="mysqli.prepare.php"/>
+<entry name="mysqli_query" url="mysqli.query.php"/>
+<entry name="mysqli_real_connect" url="mysqli.real-connect.php"/>
+<entry name="mysqli_real_escape_string" url="mysqli.real-escape-string.php"/>
+<entry name="mysqli_real_query" url="mysqli.real-query.php"/>
+<entry name="mysqli_rollback" url="mysqli.rollback.php"/>
+<entry name="mysqli_select_db" url="mysqli.select-db.php"/>
+<entry name="mysqli_set_charset" url="mysqli.set-charset.php"/>
+<entry name="mysqli_set_local_infile_default" url="mysqli.set-local-infile-default.php"/>
+<entry name="mysqli_set_local_infile_handler" url="mysqli.set-local-infile-handler.php"/>
+<entry name="mysqli_sqlstate" url="mysqli.sqlstate.php"/>
+<entry name="mysqli_ssl_set" url="mysqli.ssl-set.php"/>
+<entry name="mysqli_stat" url="mysqli.stat.php"/>
+<entry name="mysqli_stmt_init" url="mysqli.stmt-init.php"/>
+<entry name="mysqli_store_result" url="mysqli.store-result.php"/>
+<entry name="mysqli_thread_id" url="mysqli.thread-id.php"/>
+<entry name="mysqli_thread_safe" url="mysqli.thread-safe.php"/>
+<entry name="mysqli_use_result" url="mysqli.use-result.php"/>
+<entry name="mysqli_warning_count" url="mysqli.warning-count.php"/>
+<entry name="mysqli_stmt_affected_rows" url="mysqli-stmt.affected-rows.php"/>
+<entry name="mysqli_stmt_attr_get" url="mysqli-stmt.attr-get.php"/>
+<entry name="mysqli_stmt_attr_set" url="mysqli-stmt.attr-set.php"/>
+<entry name="mysqli_stmt_bind_param" url="mysqli-stmt.bind-param.php"/>
+<entry name="mysqli_stmt_bind_result" url="mysqli-stmt.bind-result.php"/>
+<entry name="mysqli_stmt_close" url="mysqli-stmt.close.php"/>
+<entry name="mysqli_stmt_data_seek" url="mysqli-stmt.data-seek.php"/>
+<entry name="mysqli_stmt_errno" url="mysqli-stmt.errno.php"/>
+<entry name="mysqli_stmt_error" url="mysqli-stmt.error.php"/>
+<entry name="mysqli_stmt_execute" url="mysqli-stmt.execute.php"/>
+<entry name="mysqli_stmt_fetch" url="mysqli-stmt.fetch.php"/>
+<entry name="mysqli_stmt_field_count" url="mysqli-stmt.field-count.php"/>
+<entry name="mysqli_stmt_free_result" url="mysqli-stmt.free-result.php"/>
+<entry name="mysqli_stmt_get_warnings" url="mysqli-stmt.get-warnings.php"/>
+<entry name="mysqli_stmt_insert_id" url="mysqli-stmt.insert-id.php"/>
+<entry name="mysqli_stmt_num_rows" url="mysqli-stmt.num-rows.php"/>
+<entry name="mysqli_stmt_param_count" url="mysqli-stmt.param-count.php"/>
+<entry name="mysqli_stmt_prepare" url="mysqli-stmt.prepare.php"/>
+<entry name="mysqli_stmt_reset" url="mysqli-stmt.reset.php"/>
+<entry name="mysqli_stmt_result_metadata" url="mysqli-stmt.result-metadata.php"/>
+<entry name="mysqli_stmt_send_long_data" url="mysqli-stmt.send-long-data.php"/>
+<entry name="mysqli_stmt_sqlstate" url="mysqli-stmt.sqlstate.php"/>
+<entry name="mysqli_stmt_store_result" url="mysqli-stmt.store-result.php"/>
+<entry name="mysqli_field_tell" url="mysqli-result.current-field.php"/>
+<entry name="mysqli_data_seek" url="mysqli-result.data-seek.php"/>
+<entry name="mysqli_fetch_array" url="mysqli-result.fetch-array.php"/>
+<entry name="mysqli_fetch_assoc" url="mysqli-result.fetch-assoc.php"/>
+<entry name="mysqli_fetch_field_direct" url="mysqli-result.fetch-field-direct.php"/>
+<entry name="mysqli_fetch_field" url="mysqli-result.fetch-field.php"/>
+<entry name="mysqli_fetch_fields" url="mysqli-result.fetch-fields.php"/>
+<entry name="mysqli_fetch_object" url="mysqli-result.fetch-object.php"/>
+<entry name="mysqli_fetch_row" url="mysqli-result.fetch-row.php"/>
+<entry name="mysqli_num_fields" url="mysqli-result.field-count.php"/>
+<entry name="mysqli_field_seek" url="mysqli-result.field-seek.php"/>
+<entry name="mysqli_free_result" url="mysqli-result.free.php"/>
+<entry name="mysqli_fetch_lengths" url="mysqli-result.lengths.php"/>
+<entry name="mysqli_num_rows" url="mysqli-result.num-rows.php"/>
+<entry name="mysqli_embedded_server_end" url="mysqli-driver.embedded-server-end.php"/>
+<entry name="mysqli_embedded_server_start" url="mysqli-driver.embedded-server-start.php"/>
+<entry name="mysqli_bind_param" url="function.mysqli-bind-param.php"/>
+<entry name="mysqli_bind_result" url="function.mysqli-bind-result.php"/>
+<entry name="mysqli_client_encoding" url="function.mysqli-client-encoding.php"/>
+<entry name="mysqli->disable_reads_from_master()" url="function.mysqli-disable-reads-from-master.php"/>
+<entry name="mysqli_disable_rpl_parse" url="function.mysqli-disable-rpl-parse.php"/>
+<entry name="mysqli_enable_reads_from_master" url="function.mysqli-enable-reads-from-master.php"/>
+<entry name="mysqli_enable_rpl_parse" url="function.mysqli-enable-rpl-parse.php"/>
+<entry name="mysqli_escape_string" url="function.mysqli-escape-string.php"/>
+<entry name="mysqli_execute" url="function.mysqli-execute.php"/>
+<entry name="mysqli_fetch" url="function.mysqli-fetch.php"/>
+<entry name="mysqli_get_metadata" url="function.mysqli-get-metadata.php"/>
+<entry name="mysqli_master_query" url="function.mysqli-master-query.php"/>
+<entry name="mysqli_param_count" url="function.mysqli-param-count.php"/>
+<entry name="mysqli_report" url="function.mysqli-report.php"/>
+<entry name="mysqli_rpl_parse_enabled" url="function.mysqli-rpl-parse-enabled.php"/>
+<entry name="mysqli_rpl_probe" url="function.mysqli-rpl-probe.php"/>
+<entry name="mysqli->rpl_query_type()" url="function.mysqli-rpl-query-type.php"/>
+<entry name="mysqli_send_long_data" url="function.mysqli-send-long-data.php"/>
+<entry name="mysqli->send_query()" url="function.mysqli-send-query.php"/>
+<entry name="mysqli_set_opt" url="function.mysqli-set-opt.php"/>
+<entry name="mysqli_slave_query" url="function.mysqli-slave-query.php"/>
+<entry name="oci_bind_array_by_name" url="function.oci-bind-array-by-name.php"/>
+<entry name="oci_bind_by_name" url="function.oci-bind-by-name.php"/>
+<entry name="oci_cancel" url="function.oci-cancel.php"/>
+<entry name="oci_close" url="function.oci-close.php"/>
+<entry name="OCI-Collection->append" url="function.oci-collection-append.php"/>
+<entry name="OCI-Collection->assign" url="function.oci-collection-assign.php"/>
+<entry name="OCI-Collection->assignElem" url="function.oci-collection-element-assign.php"/>
+<entry name="OCI-Collection->free" url="function.oci-collection-free.php"/>
+<entry name="OCI-Collection->getElem" url="function.oci-collection-element-get.php"/>
+<entry name="OCI-Collection->max" url="function.oci-collection-max.php"/>
+<entry name="OCI-Collection->size" url="function.oci-collection-size.php"/>
+<entry name="OCI-Collection->trim" url="function.oci-collection-trim.php"/>
+<entry name="oci_commit" url="function.oci-commit.php"/>
+<entry name="oci_connect" url="function.oci-connect.php"/>
+<entry name="oci_define_by_name" url="function.oci-define-by-name.php"/>
+<entry name="oci_error" url="function.oci-error.php"/>
+<entry name="oci_execute" url="function.oci-execute.php"/>
+<entry name="oci_fetch_all" url="function.oci-fetch-all.php"/>
+<entry name="oci_fetch_array" url="function.oci-fetch-array.php"/>
+<entry name="oci_fetch_assoc" url="function.oci-fetch-assoc.php"/>
+<entry name="oci_fetch_object" url="function.oci-fetch-object.php"/>
+<entry name="oci_fetch_row" url="function.oci-fetch-row.php"/>
+<entry name="oci_fetch" url="function.oci-fetch.php"/>
+<entry name="oci_field_is_null" url="function.oci-field-is-null.php"/>
+<entry name="oci_field_name" url="function.oci-field-name.php"/>
+<entry name="oci_field_precision" url="function.oci-field-precision.php"/>
+<entry name="oci_field_scale" url="function.oci-field-scale.php"/>
+<entry name="oci_field_size" url="function.oci-field-size.php"/>
+<entry name="oci_field_type_raw" url="function.oci-field-type-raw.php"/>
+<entry name="oci_field_type" url="function.oci-field-type.php"/>
+<entry name="oci_free_statement" url="function.oci-free-statement.php"/>
+<entry name="oci_internal_debug" url="function.oci-internal-debug.php"/>
+<entry name="OCI-Lob->append" url="function.oci-lob-append.php"/>
+<entry name="OCI-Lob->close" url="function.oci-lob-close.php"/>
+<entry name="oci_lob_copy" url="function.oci-lob-copy.php"/>
+<entry name="OCI-Lob->eof" url="function.oci-lob-eof.php"/>
+<entry name="OCI-Lob->erase" url="function.oci-lob-erase.php"/>
+<entry name="OCI-Lob->export" url="function.oci-lob-export.php"/>
+<entry name="OCI-Lob->flush" url="function.oci-lob-flush.php"/>
+<entry name="OCI-Lob->free" url="function.oci-lob-free.php"/>
+<entry name="OCI-Lob->getBuffering" url="function.oci-lob-getbuffering.php"/>
+<entry name="OCI-Lob->import" url="function.oci-lob-import.php"/>
+<entry name="oci_lob_is_equal" url="function.oci-lob-is-equal.php"/>
+<entry name="OCI-Lob->load" url="function.oci-lob-load.php"/>
+<entry name="OCI-Lob->read" url="function.oci-lob-read.php"/>
+<entry name="OCI-Lob->rewind" url="function.oci-lob-rewind.php"/>
+<entry name="OCI-Lob->save" url="function.oci-lob-save.php"/>
+<entry name="OCI-Lob->saveFile" url="function.oci-lob-savefile.php"/>
+<entry name="OCI-Lob->seek" url="function.oci-lob-seek.php"/>
+<entry name="OCI-Lob->setBuffering" url="function.oci-lob-setbuffering.php"/>
+<entry name="OCI-Lob->size" url="function.oci-lob-size.php"/>
+<entry name="OCI-Lob->tell" url="function.oci-lob-tell.php"/>
+<entry name="OCI-Lob->truncate" url="function.oci-lob-truncate.php"/>
+<entry name="OCI-Lob->write" url="function.oci-lob-write.php"/>
+<entry name="OCI-Lob->writeTemporary" url="function.oci-lob-writetemporary.php"/>
+<entry name="OCI-Lob->writeToFile" url="function.oci-lob-writetofile.php"/>
+<entry name="oci_new_collection" url="function.oci-new-collection.php"/>
+<entry name="oci_new_connect" url="function.oci-new-connect.php"/>
+<entry name="oci_new_cursor" url="function.oci-new-cursor.php"/>
+<entry name="oci_new_descriptor" url="function.oci-new-descriptor.php"/>
+<entry name="oci_num_fields" url="function.oci-num-fields.php"/>
+<entry name="oci_num_rows" url="function.oci-num-rows.php"/>
+<entry name="oci_parse" url="function.oci-parse.php"/>
+<entry name="oci_password_change" url="function.oci-password-change.php"/>
+<entry name="oci_pconnect" url="function.oci-pconnect.php"/>
+<entry name="oci_result" url="function.oci-result.php"/>
+<entry name="oci_rollback" url="function.oci-rollback.php"/>
+<entry name="oci_server_version" url="function.oci-server-version.php"/>
+<entry name="oci_set_prefetch" url="function.oci-set-prefetch.php"/>
+<entry name="oci_statement_type" url="function.oci-statement-type.php"/>
+<entry name="ocibindbyname" url="function.ocibindbyname.php"/>
+<entry name="ocicancel" url="function.ocicancel.php"/>
+<entry name="ocicloselob" url="function.ocicloselob.php"/>
+<entry name="ocicollappend" url="function.ocicollappend.php"/>
+<entry name="ocicollassign" url="function.ocicollassign.php"/>
+<entry name="ocicollassignelem" url="function.ocicollassignelem.php"/>
+<entry name="ocicollgetelem" url="function.ocicollgetelem.php"/>
+<entry name="ocicollmax" url="function.ocicollmax.php"/>
+<entry name="ocicollsize" url="function.ocicollsize.php"/>
+<entry name="ocicolltrim" url="function.ocicolltrim.php"/>
+<entry name="ocicolumnisnull" url="function.ocicolumnisnull.php"/>
+<entry name="ocicolumnname" url="function.ocicolumnname.php"/>
+<entry name="ocicolumnprecision" url="function.ocicolumnprecision.php"/>
+<entry name="ocicolumnscale" url="function.ocicolumnscale.php"/>
+<entry name="ocicolumnsize" url="function.ocicolumnsize.php"/>
+<entry name="ocicolumntype" url="function.ocicolumntype.php"/>
+<entry name="ocicolumntyperaw" url="function.ocicolumntyperaw.php"/>
+<entry name="ocicommit" url="function.ocicommit.php"/>
+<entry name="ocidefinebyname" url="function.ocidefinebyname.php"/>
+<entry name="ocierror" url="function.ocierror.php"/>
+<entry name="ociexecute" url="function.ociexecute.php"/>
+<entry name="ocifetch" url="function.ocifetch.php"/>
+<entry name="ocifetchinto" url="function.ocifetchinto.php"/>
+<entry name="ocifetchstatement" url="function.ocifetchstatement.php"/>
+<entry name="ocifreecollection" url="function.ocifreecollection.php"/>
+<entry name="ocifreecursor" url="function.ocifreecursor.php"/>
+<entry name="ocifreedesc" url="function.ocifreedesc.php"/>
+<entry name="ocifreestatement" url="function.ocifreestatement.php"/>
+<entry name="ociinternaldebug" url="function.ociinternaldebug.php"/>
+<entry name="ociloadlob" url="function.ociloadlob.php"/>
+<entry name="ocilogoff" url="function.ocilogoff.php"/>
+<entry name="ocilogon" url="function.ocilogon.php"/>
+<entry name="ocinewcollection" url="function.ocinewcollection.php"/>
+<entry name="ocinewcursor" url="function.ocinewcursor.php"/>
+<entry name="ocinewdescriptor" url="function.ocinewdescriptor.php"/>
+<entry name="ocinlogon" url="function.ocinlogon.php"/>
+<entry name="ocinumcols" url="function.ocinumcols.php"/>
+<entry name="ociparse" url="function.ociparse.php"/>
+<entry name="ociplogon" url="function.ociplogon.php"/>
+<entry name="ociresult" url="function.ociresult.php"/>
+<entry name="ocirollback" url="function.ocirollback.php"/>
+<entry name="ocirowcount" url="function.ocirowcount.php"/>
+<entry name="ocisavelob" url="function.ocisavelob.php"/>
+<entry name="ocisavelobfile" url="function.ocisavelobfile.php"/>
+<entry name="ociserverversion" url="function.ociserverversion.php"/>
+<entry name="ocisetprefetch" url="function.ocisetprefetch.php"/>
+<entry name="ocistatementtype" url="function.ocistatementtype.php"/>
+<entry name="ociwritelobtofile" url="function.ociwritelobtofile.php"/>
+<entry name="ociwritetemporarylob" url="function.ociwritetemporarylob.php"/>
+<entry name="ovrimos_close" url="function.ovrimos-close.php"/>
+<entry name="ovrimos_commit" url="function.ovrimos-commit.php"/>
+<entry name="ovrimos_connect" url="function.ovrimos-connect.php"/>
+<entry name="ovrimos_cursor" url="function.ovrimos-cursor.php"/>
+<entry name="ovrimos_exec" url="function.ovrimos-exec.php"/>
+<entry name="ovrimos_execute" url="function.ovrimos-execute.php"/>
+<entry name="ovrimos_fetch_into" url="function.ovrimos-fetch-into.php"/>
+<entry name="ovrimos_fetch_row" url="function.ovrimos-fetch-row.php"/>
+<entry name="ovrimos_field_len" url="function.ovrimos-field-len.php"/>
+<entry name="ovrimos_field_name" url="function.ovrimos-field-name.php"/>
+<entry name="ovrimos_field_num" url="function.ovrimos-field-num.php"/>
+<entry name="ovrimos_field_type" url="function.ovrimos-field-type.php"/>
+<entry name="ovrimos_free_result" url="function.ovrimos-free-result.php"/>
+<entry name="ovrimos_longreadlen" url="function.ovrimos-longreadlen.php"/>
+<entry name="ovrimos_num_fields" url="function.ovrimos-num-fields.php"/>
+<entry name="ovrimos_num_rows" url="function.ovrimos-num-rows.php"/>
+<entry name="ovrimos_prepare" url="function.ovrimos-prepare.php"/>
+<entry name="ovrimos_result_all" url="function.ovrimos-result-all.php"/>
+<entry name="ovrimos_result" url="function.ovrimos-result.php"/>
+<entry name="ovrimos_rollback" url="function.ovrimos-rollback.php"/>
+<entry name="px_close" url="function.px-close.php"/>
+<entry name="px_create_fp" url="function.px-create-fp.php"/>
+<entry name="px_date2string" url="function.px-date2string.php"/>
+<entry name="px_delete_record" url="function.px-delete-record.php"/>
+<entry name="px_delete" url="function.px-delete.php"/>
+<entry name="px_get_field" url="function.px-get-field.php"/>
+<entry name="px_get_info" url="function.px-get-info.php"/>
+<entry name="px_get_parameter" url="function.px-get-parameter.php"/>
+<entry name="px_get_record" url="function.px-get-record.php"/>
+<entry name="px_get_schema" url="function.px-get-schema.php"/>
+<entry name="px_get_value" url="function.px-get-value.php"/>
+<entry name="px_insert_record" url="function.px-insert-record.php"/>
+<entry name="px_new" url="function.px-new.php"/>
+<entry name="px_numfields" url="function.px-numfields.php"/>
+<entry name="px_numrecords" url="function.px-numrecords.php"/>
+<entry name="px_open_fp" url="function.px-open-fp.php"/>
+<entry name="px_put_record" url="function.px-put-record.php"/>
+<entry name="px_retrieve_record" url="function.px-retrieve-record.php"/>
+<entry name="px_set_blob_file" url="function.px-set-blob-file.php"/>
+<entry name="px_set_parameter" url="function.px-set-parameter.php"/>
+<entry name="px_set_tablename" url="function.px-set-tablename.php"/>
+<entry name="px_set_targetencoding" url="function.px-set-targetencoding.php"/>
+<entry name="px_set_value" url="function.px-set-value.php"/>
+<entry name="px_timestamp2string" url="function.px-timestamp2string.php"/>
+<entry name="px_update_record" url="function.px-update-record.php"/>
+<entry name="pg_affected_rows" url="function.pg-affected-rows.php"/>
+<entry name="pg_cancel_query" url="function.pg-cancel-query.php"/>
+<entry name="pg_client_encoding" url="function.pg-client-encoding.php"/>
+<entry name="pg_close" url="function.pg-close.php"/>
+<entry name="pg_connect" url="function.pg-connect.php"/>
+<entry name="pg_connection_busy" url="function.pg-connection-busy.php"/>
+<entry name="pg_connection_reset" url="function.pg-connection-reset.php"/>
+<entry name="pg_connection_status" url="function.pg-connection-status.php"/>
+<entry name="pg_convert" url="function.pg-convert.php"/>
+<entry name="pg_copy_from" url="function.pg-copy-from.php"/>
+<entry name="pg_copy_to" url="function.pg-copy-to.php"/>
+<entry name="pg_dbname" url="function.pg-dbname.php"/>
+<entry name="pg_delete" url="function.pg-delete.php"/>
+<entry name="pg_end_copy" url="function.pg-end-copy.php"/>
+<entry name="pg_escape_bytea" url="function.pg-escape-bytea.php"/>
+<entry name="pg_escape_string" url="function.pg-escape-string.php"/>
+<entry name="pg_execute" url="function.pg-execute.php"/>
+<entry name="pg_fetch_all_columns" url="function.pg-fetch-all-columns.php"/>
+<entry name="pg_fetch_all" url="function.pg-fetch-all.php"/>
+<entry name="pg_fetch_array" url="function.pg-fetch-array.php"/>
+<entry name="pg_fetch_assoc" url="function.pg-fetch-assoc.php"/>
+<entry name="pg_fetch_object" url="function.pg-fetch-object.php"/>
+<entry name="pg_fetch_result" url="function.pg-fetch-result.php"/>
+<entry name="pg_fetch_row" url="function.pg-fetch-row.php"/>
+<entry name="pg_field_is_null" url="function.pg-field-is-null.php"/>
+<entry name="pg_field_name" url="function.pg-field-name.php"/>
+<entry name="pg_field_num" url="function.pg-field-num.php"/>
+<entry name="pg_field_prtlen" url="function.pg-field-prtlen.php"/>
+<entry name="pg_field_size" url="function.pg-field-size.php"/>
+<entry name="pg_field_table" url="function.pg-field-table.php"/>
+<entry name="pg_field_type_oid" url="function.pg-field-type-oid.php"/>
+<entry name="pg_field_type" url="function.pg-field-type.php"/>
+<entry name="pg_free_result" url="function.pg-free-result.php"/>
+<entry name="pg_get_notify" url="function.pg-get-notify.php"/>
+<entry name="pg_get_pid" url="function.pg-get-pid.php"/>
+<entry name="pg_get_result" url="function.pg-get-result.php"/>
+<entry name="pg_host" url="function.pg-host.php"/>
+<entry name="pg_insert" url="function.pg-insert.php"/>
+<entry name="pg_last_error" url="function.pg-last-error.php"/>
+<entry name="pg_last_notice" url="function.pg-last-notice.php"/>
+<entry name="pg_last_oid" url="function.pg-last-oid.php"/>
+<entry name="pg_lo_close" url="function.pg-lo-close.php"/>
+<entry name="pg_lo_create" url="function.pg-lo-create.php"/>
+<entry name="pg_lo_export" url="function.pg-lo-export.php"/>
+<entry name="pg_lo_import" url="function.pg-lo-import.php"/>
+<entry name="pg_lo_open" url="function.pg-lo-open.php"/>
+<entry name="pg_lo_read_all" url="function.pg-lo-read-all.php"/>
+<entry name="pg_lo_read" url="function.pg-lo-read.php"/>
+<entry name="pg_lo_seek" url="function.pg-lo-seek.php"/>
+<entry name="pg_lo_tell" url="function.pg-lo-tell.php"/>
+<entry name="pg_lo_unlink" url="function.pg-lo-unlink.php"/>
+<entry name="pg_lo_write" url="function.pg-lo-write.php"/>
+<entry name="pg_meta_data" url="function.pg-meta-data.php"/>
+<entry name="pg_num_fields" url="function.pg-num-fields.php"/>
+<entry name="pg_num_rows" url="function.pg-num-rows.php"/>
+<entry name="pg_options" url="function.pg-options.php"/>
+<entry name="pg_parameter_status" url="function.pg-parameter-status.php"/>
+<entry name="pg_pconnect" url="function.pg-pconnect.php"/>
+<entry name="pg_ping" url="function.pg-ping.php"/>
+<entry name="pg_port" url="function.pg-port.php"/>
+<entry name="pg_prepare" url="function.pg-prepare.php"/>
+<entry name="pg_put_line" url="function.pg-put-line.php"/>
+<entry name="pg_query_params" url="function.pg-query-params.php"/>
+<entry name="pg_query" url="function.pg-query.php"/>
+<entry name="pg_result_error_field" url="function.pg-result-error-field.php"/>
+<entry name="pg_result_error" url="function.pg-result-error.php"/>
+<entry name="pg_result_seek" url="function.pg-result-seek.php"/>
+<entry name="pg_result_status" url="function.pg-result-status.php"/>
+<entry name="pg_select" url="function.pg-select.php"/>
+<entry name="pg_send_execute" url="function.pg-send-execute.php"/>
+<entry name="pg_send_prepare" url="function.pg-send-prepare.php"/>
+<entry name="pg_send_query_params" url="function.pg-send-query-params.php"/>
+<entry name="pg_send_query" url="function.pg-send-query.php"/>
+<entry name="pg_set_client_encoding" url="function.pg-set-client-encoding.php"/>
+<entry name="pg_set_error_verbosity" url="function.pg-set-error-verbosity.php"/>
+<entry name="pg_trace" url="function.pg-trace.php"/>
+<entry name="pg_transaction_status" url="function.pg-transaction-status.php"/>
+<entry name="pg_tty" url="function.pg-tty.php"/>
+<entry name="pg_unescape_bytea" url="function.pg-unescape-bytea.php"/>
+<entry name="pg_untrace" url="function.pg-untrace.php"/>
+<entry name="pg_update" url="function.pg-update.php"/>
+<entry name="pg_version" url="function.pg-version.php"/>
+<entry name="SQLiteDatabase->arrayQuery" url="function.sqlite-array-query.php"/>
+<entry name="SQLiteDatabase->busyTimeout" url="function.sqlite-busy-timeout.php"/>
+<entry name="SQLiteDatabase->changes" url="function.sqlite-changes.php"/>
+<entry name="sqlite_close" url="function.sqlite-close.php"/>
+<entry name="SQLiteUnbuffered->column" url="function.sqlite-column.php"/>
+<entry name="SQLiteDatabase->createAggregate" url="function.sqlite-create-aggregate.php"/>
+<entry name="SQLiteDatabase->createFunction" url="function.sqlite-create-function.php"/>
+<entry name="SQLiteUnbuffered->current" url="function.sqlite-current.php"/>
+<entry name="sqlite_error_string" url="function.sqlite-error-string.php"/>
+<entry name="sqlite_escape_string" url="function.sqlite-escape-string.php"/>
+<entry name="SQLiteDatabase->exec" url="function.sqlite-exec.php"/>
+<entry name="sqlite_factory" url="function.sqlite-factory.php"/>
+<entry name="SQLiteUnbuffered->fetchAll" url="function.sqlite-fetch-all.php"/>
+<entry name="SQLiteUnbuffered->fetch" url="function.sqlite-fetch-array.php"/>
+<entry name="SQLiteDatabase->fetchColumnTypes" url="function.sqlite-fetch-column-types.php"/>
+<entry name="SQLiteUnbuffered->fetchObject" url="function.sqlite-fetch-object.php"/>
+<entry name="SQLiteUnbuffered->fetchSingle" url="function.sqlite-fetch-single.php"/>
+<entry name="sqlite_fetch_string" url="function.sqlite-fetch-string.php"/>
+<entry name="SQLiteUnbuffered->fieldName" url="function.sqlite-field-name.php"/>
+<entry name="sqlite_has_more" url="function.sqlite-has-more.php"/>
+<entry name="SQLiteResult->hasPrev" url="function.sqlite-has-prev.php"/>
+<entry name="SQLiteResult->key" url="function.sqlite-key.php"/>
+<entry name="SQLiteDatabase->lastError" url="function.sqlite-last-error.php"/>
+<entry name="SQLiteDatabase->lastInsertRowid" url="function.sqlite-last-insert-rowid.php"/>
+<entry name="sqlite_libencoding" url="function.sqlite-libencoding.php"/>
+<entry name="sqlite_libversion" url="function.sqlite-libversion.php"/>
+<entry name="SQLiteUnbuffered->next" url="function.sqlite-next.php"/>
+<entry name="SQLiteUnbuffered->numFields" url="function.sqlite-num-fields.php"/>
+<entry name="SQLiteResult->numRows" url="function.sqlite-num-rows.php"/>
+<entry name="sqlite_open" url="function.sqlite-open.php"/>
+<entry name="sqlite_popen" url="function.sqlite-popen.php"/>
+<entry name="SQLiteResult->prev" url="function.sqlite-prev.php"/>
+<entry name="SQLiteDatabase->query" url="function.sqlite-query.php"/>
+<entry name="SQLiteResult->rewind" url="function.sqlite-rewind.php"/>
+<entry name="SQLiteResult->seek" url="function.sqlite-seek.php"/>
+<entry name="SQLiteDatabase->singleQuery" url="function.sqlite-single-query.php"/>
+<entry name="sqlite_udf_decode_binary" url="function.sqlite-udf-decode-binary.php"/>
+<entry name="sqlite_udf_encode_binary" url="function.sqlite-udf-encode-binary.php"/>
+<entry name="SQLiteDatabase->unbufferedQuery" url="function.sqlite-unbuffered-query.php"/>
+<entry name="SQLiteUnbuffered->valid" url="function.sqlite-valid.php"/>
+<entry name="sybase_affected_rows" url="function.sybase-affected-rows.php"/>
+<entry name="sybase_close" url="function.sybase-close.php"/>
+<entry name="sybase_connect" url="function.sybase-connect.php"/>
+<entry name="sybase_data_seek" url="function.sybase-data-seek.php"/>
+<entry name="sybase_deadlock_retry_count" url="function.sybase-deadlock-retry-count.php"/>
+<entry name="sybase_fetch_array" url="function.sybase-fetch-array.php"/>
+<entry name="sybase_fetch_assoc" url="function.sybase-fetch-assoc.php"/>
+<entry name="sybase_fetch_field" url="function.sybase-fetch-field.php"/>
+<entry name="sybase_fetch_object" url="function.sybase-fetch-object.php"/>
+<entry name="sybase_fetch_row" url="function.sybase-fetch-row.php"/>
+<entry name="sybase_field_seek" url="function.sybase-field-seek.php"/>
+<entry name="sybase_free_result" url="function.sybase-free-result.php"/>
+<entry name="sybase_get_last_message" url="function.sybase-get-last-message.php"/>
+<entry name="sybase_min_client_severity" url="function.sybase-min-client-severity.php"/>
+<entry name="sybase_min_error_severity" url="function.sybase-min-error-severity.php"/>
+<entry name="sybase_min_message_severity" url="function.sybase-min-message-severity.php"/>
+<entry name="sybase_min_server_severity" url="function.sybase-min-server-severity.php"/>
+<entry name="sybase_num_fields" url="function.sybase-num-fields.php"/>
+<entry name="sybase_num_rows" url="function.sybase-num-rows.php"/>
+<entry name="sybase_pconnect" url="function.sybase-pconnect.php"/>
+<entry name="sybase_query" url="function.sybase-query.php"/>
+<entry name="sybase_result" url="function.sybase-result.php"/>
+<entry name="sybase_select_db" url="function.sybase-select-db.php"/>
+<entry name="sybase_set_message_handler" url="function.sybase-set-message-handler.php"/>
+<entry name="sybase_unbuffered_query" url="function.sybase-unbuffered-query.php"/>
+<entry name="dio_close" url="function.dio-close.php"/>
+<entry name="dio_fcntl" url="function.dio-fcntl.php"/>
+<entry name="dio_open" url="function.dio-open.php"/>
+<entry name="dio_read" url="function.dio-read.php"/>
+<entry name="dio_seek" url="function.dio-seek.php"/>
+<entry name="dio_stat" url="function.dio-stat.php"/>
+<entry name="dio_tcsetattr" url="function.dio-tcsetattr.php"/>
+<entry name="dio_truncate" url="function.dio-truncate.php"/>
+<entry name="dio_write" url="function.dio-write.php"/>
+<entry name="chdir" url="function.chdir.php"/>
+<entry name="chroot" url="function.chroot.php"/>
+<entry name="dir" url="class.dir.php"/>
+<entry name="closedir" url="function.closedir.php"/>
+<entry name="getcwd" url="function.getcwd.php"/>
+<entry name="opendir" url="function.opendir.php"/>
+<entry name="readdir" url="function.readdir.php"/>
+<entry name="rewinddir" url="function.rewinddir.php"/>
+<entry name="scandir" url="function.scandir.php"/>
+<entry name="finfo_buffer" url="function.finfo-buffer.php"/>
+<entry name="finfo_close" url="function.finfo-close.php"/>
+<entry name="finfo_file" url="function.finfo-file.php"/>
+<entry name="finfo->__construct()" url="function.finfo-open.php"/>
+<entry name="finfo_set_flags" url="function.finfo-set-flags.php"/>
+<entry name="basename" url="function.basename.php"/>
+<entry name="chgrp" url="function.chgrp.php"/>
+<entry name="chmod" url="function.chmod.php"/>
+<entry name="chown" url="function.chown.php"/>
+<entry name="clearstatcache" url="function.clearstatcache.php"/>
+<entry name="copy" url="function.copy.php"/>
+<entry name="delete" url="function.delete.php"/>
+<entry name="dirname" url="function.dirname.php"/>
+<entry name="disk_free_space" url="function.disk-free-space.php"/>
+<entry name="disk_total_space" url="function.disk-total-space.php"/>
+<entry name="diskfreespace" url="function.diskfreespace.php"/>
+<entry name="fclose" url="function.fclose.php"/>
+<entry name="feof" url="function.feof.php"/>
+<entry name="fflush" url="function.fflush.php"/>
+<entry name="fgetc" url="function.fgetc.php"/>
+<entry name="fgetcsv" url="function.fgetcsv.php"/>
+<entry name="fgets" url="function.fgets.php"/>
+<entry name="fgetss" url="function.fgetss.php"/>
+<entry name="file_exists" url="function.file-exists.php"/>
+<entry name="file_get_contents" url="function.file-get-contents.php"/>
+<entry name="file_put_contents" url="function.file-put-contents.php"/>
+<entry name="file" url="function.file.php"/>
+<entry name="fileatime" url="function.fileatime.php"/>
+<entry name="filectime" url="function.filectime.php"/>
+<entry name="filegroup" url="function.filegroup.php"/>
+<entry name="fileinode" url="function.fileinode.php"/>
+<entry name="filemtime" url="function.filemtime.php"/>
+<entry name="fileowner" url="function.fileowner.php"/>
+<entry name="fileperms" url="function.fileperms.php"/>
+<entry name="filesize" url="function.filesize.php"/>
+<entry name="filetype" url="function.filetype.php"/>
+<entry name="flock" url="function.flock.php"/>
+<entry name="fnmatch" url="function.fnmatch.php"/>
+<entry name="fopen" url="function.fopen.php"/>
+<entry name="fpassthru" url="function.fpassthru.php"/>
+<entry name="fputcsv" url="function.fputcsv.php"/>
+<entry name="fputs" url="function.fputs.php"/>
+<entry name="fread" url="function.fread.php"/>
+<entry name="fscanf" url="function.fscanf.php"/>
+<entry name="fseek" url="function.fseek.php"/>
+<entry name="fstat" url="function.fstat.php"/>
+<entry name="ftell" url="function.ftell.php"/>
+<entry name="ftruncate" url="function.ftruncate.php"/>
+<entry name="fwrite" url="function.fwrite.php"/>
+<entry name="glob" url="function.glob.php"/>
+<entry name="is_dir" url="function.is-dir.php"/>
+<entry name="is_executable" url="function.is-executable.php"/>
+<entry name="is_file" url="function.is-file.php"/>
+<entry name="is_link" url="function.is-link.php"/>
+<entry name="is_readable" url="function.is-readable.php"/>
+<entry name="is_uploaded_file" url="function.is-uploaded-file.php"/>
+<entry name="is_writable" url="function.is-writable.php"/>
+<entry name="is_writeable" url="function.is-writeable.php"/>
+<entry name="lchgrp" url="function.lchgrp.php"/>
+<entry name="lchown" url="function.lchown.php"/>
+<entry name="link" url="function.link.php"/>
+<entry name="linkinfo" url="function.linkinfo.php"/>
+<entry name="lstat" url="function.lstat.php"/>
+<entry name="mkdir" url="function.mkdir.php"/>
+<entry name="move_uploaded_file" url="function.move-uploaded-file.php"/>
+<entry name="parse_ini_file" url="function.parse-ini-file.php"/>
+<entry name="pathinfo" url="function.pathinfo.php"/>
+<entry name="pclose" url="function.pclose.php"/>
+<entry name="popen" url="function.popen.php"/>
+<entry name="readfile" url="function.readfile.php"/>
+<entry name="readlink" url="function.readlink.php"/>
+<entry name="realpath" url="function.realpath.php"/>
+<entry name="rename" url="function.rename.php"/>
+<entry name="rewind" url="function.rewind.php"/>
+<entry name="rmdir" url="function.rmdir.php"/>
+<entry name="set_file_buffer" url="function.set-file-buffer.php"/>
+<entry name="stat" url="function.stat.php"/>
+<entry name="symlink" url="function.symlink.php"/>
+<entry name="tempnam" url="function.tempnam.php"/>
+<entry name="tmpfile" url="function.tmpfile.php"/>
+<entry name="touch" url="function.touch.php"/>
+<entry name="umask" url="function.umask.php"/>
+<entry name="unlink" url="function.unlink.php"/>
+<entry name="mime_content_type" url="function.mime-content-type.php"/>
+<entry name="xattr_get" url="function.xattr-get.php"/>
+<entry name="xattr_list" url="function.xattr-list.php"/>
+<entry name="xattr_remove" url="function.xattr-remove.php"/>
+<entry name="xattr_set" url="function.xattr-set.php"/>
+<entry name="xattr_supported" url="function.xattr-supported.php"/>
+<entry name="xdiff_file_diff_binary" url="function.xdiff-file-diff-binary.php"/>
+<entry name="xdiff_file_diff" url="function.xdiff-file-diff.php"/>
+<entry name="xdiff_file_merge3" url="function.xdiff-file-merge3.php"/>
+<entry name="xdiff_file_patch_binary" url="function.xdiff-file-patch-binary.php"/>
+<entry name="xdiff_file_patch" url="function.xdiff-file-patch.php"/>
+<entry name="xdiff_string_diff_binary" url="function.xdiff-string-diff-binary.php"/>
+<entry name="xdiff_string_diff" url="function.xdiff-string-diff.php"/>
+<entry name="xdiff_string_merge3" url="function.xdiff-string-merge3.php"/>
+<entry name="xdiff_string_patch_binary" url="function.xdiff-string-patch-binary.php"/>
+<entry name="xdiff_string_patch" url="function.xdiff-string-patch.php"/>
+<entry name="enchant_broker_describe" url="function.enchant-broker-describe.php"/>
+<entry name="enchant_broker_dict_exists" url="function.enchant-broker-dict-exists.php"/>
+<entry name="enchant_broker_free_dict" url="function.enchant-broker-free-dict.php"/>
+<entry name="enchant_broker_free" url="function.enchant-broker-free.php"/>
+<entry name="enchant_broker_get_error" url="function.enchant-broker-get-error.php"/>
+<entry name="enchant_broker_init" url="function.enchant-broker-init.php"/>
+<entry name="enchant_broker_list_dicts" url="function.enchant-broker-list-dicts.php"/>
+<entry name="enchant_broker_request_dict" url="function.enchant-broker-request-dict.php"/>
+<entry name="enchant_broker_request_pwl_dict" url="function.enchant-broker-request-pwl-dict.php"/>
+<entry name="enchant_broker_set_ordering" url="function.enchant-broker-set-ordering.php"/>
+<entry name="enchant_dict_add_to_personal" url="function.enchant-dict-add-to-personal.php"/>
+<entry name="enchant_dict_add_to_session" url="function.enchant-dict-add-to-session.php"/>
+<entry name="enchant_dict_check" url="function.enchant-dict-check.php"/>
+<entry name="enchant_dict_describe" url="function.enchant-dict-describe.php"/>
+<entry name="enchant_dict_get_error" url="function.enchant-dict-get-error.php"/>
+<entry name="enchant_dict_is_in_session" url="function.enchant-dict-is-in-session.php"/>
+<entry name="enchant_dict_quick_check" url="function.enchant-dict-quick-check.php"/>
+<entry name="enchant_dict_store_replacement" url="function.enchant-dict-store-replacement.php"/>
+<entry name="enchant_dict_suggest" url="function.enchant-dict-suggest.php"/>
+<entry name="fribidi_log2vis" url="function.fribidi-log2vis.php"/>
+<entry name="bind_textdomain_codeset" url="function.bind-textdomain-codeset.php"/>
+<entry name="bindtextdomain" url="function.bindtextdomain.php"/>
+<entry name="dcgettext" url="function.dcgettext.php"/>
+<entry name="dcngettext" url="function.dcngettext.php"/>
+<entry name="dgettext" url="function.dgettext.php"/>
+<entry name="dngettext" url="function.dngettext.php"/>
+<entry name="gettext" url="function.gettext.php"/>
+<entry name="ngettext" url="function.ngettext.php"/>
+<entry name="textdomain" url="function.textdomain.php"/>
+<entry name="locale_get_default" url="locale.getdefault.php"/>
+<entry name="locale_set_default" url="locale.setdefault.php"/>
+<entry name="iconv_get_encoding" url="function.iconv-get-encoding.php"/>
+<entry name="iconv_mime_decode_headers" url="function.iconv-mime-decode-headers.php"/>
+<entry name="iconv_mime_decode" url="function.iconv-mime-decode.php"/>
+<entry name="iconv_mime_encode" url="function.iconv-mime-encode.php"/>
+<entry name="iconv_set_encoding" url="function.iconv-set-encoding.php"/>
+<entry name="iconv_strlen" url="function.iconv-strlen.php"/>
+<entry name="iconv_strpos" url="function.iconv-strpos.php"/>
+<entry name="iconv_strrpos" url="function.iconv-strrpos.php"/>
+<entry name="iconv_substr" url="function.iconv-substr.php"/>
+<entry name="iconv" url="function.iconv.php"/>
+<entry name="ob_iconv_handler" url="function.ob-iconv-handler.php"/>
+<entry name="grapheme_extract" url="function.grapheme-extract.php"/>
+<entry name="grapheme_stripos" url="function.grapheme-stripos.php"/>
+<entry name="grapheme_stristr" url="function.grapheme-stristr.php"/>
+<entry name="grapheme_strlen" url="function.grapheme-strlen.php"/>
+<entry name="grapheme_strpos" url="function.grapheme-strpos.php"/>
+<entry name="grapheme_strripos" url="function.grapheme-strripos.php"/>
+<entry name="grapheme_strrpos" url="function.grapheme-strrpos.php"/>
+<entry name="grapheme_strstr" url="function.grapheme-strstr.php"/>
+<entry name="grapheme_substr" url="function.grapheme-substr.php"/>
+<entry name="intl_error_name" url="function.intl-error-name.php"/>
+<entry name="intl_get_error_code" url="function.intl-get-error-code.php"/>
+<entry name="intl_get_error_message" url="function.intl-get-error-message.php"/>
+<entry name="intl_is_failure" url="function.intl-is-failure.php"/>
+<entry name="collator_asort" url="collator.asort.php"/>
+<entry name="collator_compare" url="collator.compare.php"/>
+<entry name="Collator::__construct" url="collator.construct.php"/>
+<entry name="collator_create" url="collator.create.php"/>
+<entry name="collator_get_attribute" url="collator.getattribute.php"/>
+<entry name="collator_get_error_code" url="collator.geterrorcode.php"/>
+<entry name="collator_get_error_message" url="collator.geterrormessage.php"/>
+<entry name="collator_get_locale" url="collator.getlocale.php"/>
+<entry name="collator_get_strength" url="collator.getstrength.php"/>
+<entry name="collator_set_attribute" url="collator.setattribute.php"/>
+<entry name="collator_set_strength" url="collator.setstrength.php"/>
+<entry name="collator_sort_with_sort_keys" url="collator.sortwithsortkeys.php"/>
+<entry name="collator_sort" url="collator.sort.php"/>
+<entry name="NumberFormatter::__construct" url="numberformatter.create.php"/>
+<entry name="numfmt_format_currency" url="numberformatter.formatcurrency.php"/>
+<entry name="numfmt_format" url="numberformatter.format.php"/>
+<entry name="numfmt_get_attribute" url="numberformatter.getattribute.php"/>
+<entry name="numfmt_get_error_code" url="numberformatter.geterrorcode.php"/>
+<entry name="numfmt_get_error_message" url="numberformatter.geterrormessage.php"/>
+<entry name="numfmt_get_locale" url="numberformatter.getlocale.php"/>
+<entry name="numfmt_get_pattern" url="numberformatter.getpattern.php"/>
+<entry name="numfmt_get_symbol" url="numberformatter.getsymbol.php"/>
+<entry name="numfmt_get_text_attribute" url="numberformatter.gettextattribute.php"/>
+<entry name="numfmt_parse_currency" url="numberformatter.parsecurrency.php"/>
+<entry name="numfmt_parse" url="numberformatter.parse.php"/>
+<entry name="numfmt_set_attribute" url="numberformatter.setattribute.php"/>
+<entry name="numfmt_set_pattern" url="numberformatter.setpattern.php"/>
+<entry name="numfmt_set_symbol" url="numberformatter.setsymbol.php"/>
+<entry name="numfmt_set_text_attribute" url="numberformatter.settextattribute.php"/>
+<entry name="locale_compose_locale" url="locale.composelocale.php"/>
+<entry name="locale_filter_matches" url="locale.filtermatches.php"/>
+<entry name="locale_get_all_variants" url="locale.getallvariants.php"/>
+<entry name="locale_get_display_language" url="locale.getdisplaylanguage.php"/>
+<entry name="locale_get_display_name" url="locale.getdisplayname.php"/>
+<entry name="locale_get_display_region" url="locale.getdisplayregion.php"/>
+<entry name="locale_get_display_script" url="locale.getdisplayscript.php"/>
+<entry name="locale_get_display_variant" url="locale.getdisplayvariant.php"/>
+<entry name="locale_get_keywords" url="locale.getkeywords.php"/>
+<entry name="locale_get_primary_language" url="locale.getprimarylanguage.php"/>
+<entry name="locale_get_region" url="locale.getregion.php"/>
+<entry name="locale_get_script" url="locale.getscript.php"/>
+<entry name="locale_lookup" url="locale.lookup.php"/>
+<entry name="locale_parse_locale" url="locale.parselocale.php"/>
+<entry name="normalizer_is_normalized" url="normalizer.isnormalized.php"/>
+<entry name="normalizer_normalize" url="normalizer.normalize.php"/>
+<entry name="msgfmt_create" url="messageformatter.create.php"/>
+<entry name="msgfmt_format_message" url="messageformatter.formatmessage.php"/>
+<entry name="msgfmt_format" url="messageformatter.format.php"/>
+<entry name="msgfmt_get_error_code" url="messageformatter.geterrorcode.php"/>
+<entry name="msgfmt_get_error_message" url="messageformatter.geterrormessage.php"/>
+<entry name="msgfmt_get_locale" url="messageformatter.getlocale.php"/>
+<entry name="msgfmt_get_pattern" url="messageformatter.getpattern.php"/>
+<entry name="msgfmt_parse_message" url="messageformatter.parsemessage.php"/>
+<entry name="msgfmt_parse" url="messageformatter.parse.php"/>
+<entry name="msgfmt_set_pattern" url="messageformatter.setpattern.php"/>
+<entry name="IntlDateFormatter::__construct" url="intldateformatter.create.php"/>
+<entry name="datefmt_format" url="intldateformatter.format.php"/>
+<entry name="datefmt_get_calendar" url="intldateformatter.getcalendar.php"/>
+<entry name="datefmt_get_datetype" url="intldateformatter.getdatetype.php"/>
+<entry name="datefmt_get_error_code" url="intldateformatter.geterrorcode.php"/>
+<entry name="datefmt_get_error_message" url="intldateformatter.geterrormessage.php"/>
+<entry name="datefmt_get_locale" url="intldateformatter.getlocale.php"/>
+<entry name="datefmt_get_pattern" url="intldateformatter.getpattern.php"/>
+<entry name="datefmt_get_timetype" url="intldateformatter.gettimetype.php"/>
+<entry name="datefmt_get_timezone_id" url="intldateformatter.gettimezoneid.php"/>
+<entry name="datefmt_is_lenient" url="intldateformatter.islenient.php"/>
+<entry name="datefmt_localtime" url="intldateformatter.localtime.php"/>
+<entry name="datefmt_parse" url="intldateformatter.parse.php"/>
+<entry name="datefmt_set_calendar" url="intldateformatter.setcalendar.php"/>
+<entry name="datefmt_set_lenient" url="intldateformatter.setlenient.php"/>
+<entry name="datefmt_set_pattern" url="intldateformatter.setpattern.php"/>
+<entry name="datefmt_set_timezone_id" url="intldateformatter.settimezoneid.php"/>
+<entry name="mb_check_encoding" url="function.mb-check-encoding.php"/>
+<entry name="mb_convert_case" url="function.mb-convert-case.php"/>
+<entry name="mb_convert_encoding" url="function.mb-convert-encoding.php"/>
+<entry name="mb_convert_kana" url="function.mb-convert-kana.php"/>
+<entry name="mb_convert_variables" url="function.mb-convert-variables.php"/>
+<entry name="mb_decode_mimeheader" url="function.mb-decode-mimeheader.php"/>
+<entry name="mb_decode_numericentity" url="function.mb-decode-numericentity.php"/>
+<entry name="mb_detect_encoding" url="function.mb-detect-encoding.php"/>
+<entry name="mb_detect_order" url="function.mb-detect-order.php"/>
+<entry name="mb_encode_mimeheader" url="function.mb-encode-mimeheader.php"/>
+<entry name="mb_encode_numericentity" url="function.mb-encode-numericentity.php"/>
+<entry name="mb_ereg_match" url="function.mb-ereg-match.php"/>
+<entry name="mb_ereg_replace" url="function.mb-ereg-replace.php"/>
+<entry name="mb_ereg_search_getpos" url="function.mb-ereg-search-getpos.php"/>
+<entry name="mb_ereg_search_getregs" url="function.mb-ereg-search-getregs.php"/>
+<entry name="mb_ereg_search_init" url="function.mb-ereg-search-init.php"/>
+<entry name="mb_ereg_search_pos" url="function.mb-ereg-search-pos.php"/>
+<entry name="mb_ereg_search_regs" url="function.mb-ereg-search-regs.php"/>
+<entry name="mb_ereg_search_setpos" url="function.mb-ereg-search-setpos.php"/>
+<entry name="mb_ereg_search" url="function.mb-ereg-search.php"/>
+<entry name="mb_ereg" url="function.mb-ereg.php"/>
+<entry name="mb_eregi_replace" url="function.mb-eregi-replace.php"/>
+<entry name="mb_eregi" url="function.mb-eregi.php"/>
+<entry name="mb_get_info" url="function.mb-get-info.php"/>
+<entry name="mb_http_input" url="function.mb-http-input.php"/>
+<entry name="mb_http_output" url="function.mb-http-output.php"/>
+<entry name="mb_internal_encoding" url="function.mb-internal-encoding.php"/>
+<entry name="mb_language" url="function.mb-language.php"/>
+<entry name="mb_list_encodings" url="function.mb-list-encodings.php"/>
+<entry name="mb_output_handler" url="function.mb-output-handler.php"/>
+<entry name="mb_parse_str" url="function.mb-parse-str.php"/>
+<entry name="mb_preferred_mime_name" url="function.mb-preferred-mime-name.php"/>
+<entry name="mb_regex_encoding" url="function.mb-regex-encoding.php"/>
+<entry name="mb_regex_set_options" url="function.mb-regex-set-options.php"/>
+<entry name="mb_send_mail" url="function.mb-send-mail.php"/>
+<entry name="mb_split" url="function.mb-split.php"/>
+<entry name="mb_strcut" url="function.mb-strcut.php"/>
+<entry name="mb_strimwidth" url="function.mb-strimwidth.php"/>
+<entry name="mb_stripos" url="function.mb-stripos.php"/>
+<entry name="mb_stristr" url="function.mb-stristr.php"/>
+<entry name="mb_strlen" url="function.mb-strlen.php"/>
+<entry name="mb_strpos" url="function.mb-strpos.php"/>
+<entry name="mb_strrchr" url="function.mb-strrchr.php"/>
+<entry name="mb_strrichr" url="function.mb-strrichr.php"/>
+<entry name="mb_strripos" url="function.mb-strripos.php"/>
+<entry name="mb_strrpos" url="function.mb-strrpos.php"/>
+<entry name="mb_strstr" url="function.mb-strstr.php"/>
+<entry name="mb_strtolower" url="function.mb-strtolower.php"/>
+<entry name="mb_strtoupper" url="function.mb-strtoupper.php"/>
+<entry name="mb_strwidth" url="function.mb-strwidth.php"/>
+<entry name="mb_substitute_character" url="function.mb-substitute-character.php"/>
+<entry name="mb_substr_count" url="function.mb-substr-count.php"/>
+<entry name="mb_substr" url="function.mb-substr.php"/>
+<entry name="pspell_add_to_personal" url="function.pspell-add-to-personal.php"/>
+<entry name="pspell_add_to_session" url="function.pspell-add-to-session.php"/>
+<entry name="pspell_check" url="function.pspell-check.php"/>
+<entry name="pspell_clear_session" url="function.pspell-clear-session.php"/>
+<entry name="pspell_config_create" url="function.pspell-config-create.php"/>
+<entry name="pspell_config_data_dir" url="function.pspell-config-data-dir.php"/>
+<entry name="pspell_config_dict_dir" url="function.pspell-config-dict-dir.php"/>
+<entry name="pspell_config_ignore" url="function.pspell-config-ignore.php"/>
+<entry name="pspell_config_mode" url="function.pspell-config-mode.php"/>
+<entry name="pspell_config_personal" url="function.pspell-config-personal.php"/>
+<entry name="pspell_config_repl" url="function.pspell-config-repl.php"/>
+<entry name="pspell_config_runtogether" url="function.pspell-config-runtogether.php"/>
+<entry name="pspell_config_save_repl" url="function.pspell-config-save-repl.php"/>
+<entry name="pspell_new_config" url="function.pspell-new-config.php"/>
+<entry name="pspell_new_personal" url="function.pspell-new-personal.php"/>
+<entry name="pspell_new" url="function.pspell-new.php"/>
+<entry name="pspell_save_wordlist" url="function.pspell-save-wordlist.php"/>
+<entry name="pspell_store_replacement" url="function.pspell-store-replacement.php"/>
+<entry name="pspell_suggest" url="function.pspell-suggest.php"/>
+<entry name="recode_file" url="function.recode-file.php"/>
+<entry name="recode_string" url="function.recode-string.php"/>
+<entry name="recode" url="function.recode.php"/>
+<entry name="unicode_decode" url="function.unicode-decode.php"/>
+<entry name="unicode_encode" url="function.unicode-encode.php"/>
+<entry name="unicode_get_error_mode" url="function.unicode-get-error-mode.php"/>
+<entry name="unicode_get_subst_char" url="function.unicode-get-subst-char.php"/>
+<entry name="unicode_set_error_mode" url="function.unicode-set-error-mode.php"/>
+<entry name="unicode_set_subst_char" url="function.unicode-set-subst-char.php"/>
+<entry name="exif_imagetype" url="function.exif-imagetype.php"/>
+<entry name="exif_read_data" url="function.exif-read-data.php"/>
+<entry name="exif_tagname" url="function.exif-tagname.php"/>
+<entry name="exif_thumbnail" url="function.exif-thumbnail.php"/>
+<entry name="read_exif_data" url="function.read-exif-data.php"/>
+<entry name="gd_info" url="function.gd-info.php"/>
+<entry name="getimagesize" url="function.getimagesize.php"/>
+<entry name="image_type_to_extension" url="function.image-type-to-extension.php"/>
+<entry name="image_type_to_mime_type" url="function.image-type-to-mime-type.php"/>
+<entry name="image2wbmp" url="function.image2wbmp.php"/>
+<entry name="imagealphablending" url="function.imagealphablending.php"/>
+<entry name="imageantialias" url="function.imageantialias.php"/>
+<entry name="imagearc" url="function.imagearc.php"/>
+<entry name="imagechar" url="function.imagechar.php"/>
+<entry name="imagecharup" url="function.imagecharup.php"/>
+<entry name="imagecolorallocate" url="function.imagecolorallocate.php"/>
+<entry name="imagecolorallocatealpha" url="function.imagecolorallocatealpha.php"/>
+<entry name="imagecolorat" url="function.imagecolorat.php"/>
+<entry name="imagecolorclosest" url="function.imagecolorclosest.php"/>
+<entry name="imagecolorclosestalpha" url="function.imagecolorclosestalpha.php"/>
+<entry name="imagecolorclosesthwb" url="function.imagecolorclosesthwb.php"/>
+<entry name="imagecolordeallocate" url="function.imagecolordeallocate.php"/>
+<entry name="imagecolorexact" url="function.imagecolorexact.php"/>
+<entry name="imagecolorexactalpha" url="function.imagecolorexactalpha.php"/>
+<entry name="imagecolormatch" url="function.imagecolormatch.php"/>
+<entry name="imagecolorresolve" url="function.imagecolorresolve.php"/>
+<entry name="imagecolorresolvealpha" url="function.imagecolorresolvealpha.php"/>
+<entry name="imagecolorset" url="function.imagecolorset.php"/>
+<entry name="imagecolorsforindex" url="function.imagecolorsforindex.php"/>
+<entry name="imagecolorstotal" url="function.imagecolorstotal.php"/>
+<entry name="imagecolortransparent" url="function.imagecolortransparent.php"/>
+<entry name="imageconvolution" url="function.imageconvolution.php"/>
+<entry name="imagecopy" url="function.imagecopy.php"/>
+<entry name="imagecopymerge" url="function.imagecopymerge.php"/>
+<entry name="imagecopymergegray" url="function.imagecopymergegray.php"/>
+<entry name="imagecopyresampled" url="function.imagecopyresampled.php"/>
+<entry name="imagecopyresized" url="function.imagecopyresized.php"/>
+<entry name="imagecreate" url="function.imagecreate.php"/>
+<entry name="imagecreatefromgd2" url="function.imagecreatefromgd2.php"/>
+<entry name="imagecreatefromgd2part" url="function.imagecreatefromgd2part.php"/>
+<entry name="imagecreatefromgd" url="function.imagecreatefromgd.php"/>
+<entry name="imagecreatefromgif" url="function.imagecreatefromgif.php"/>
+<entry name="imagecreatefromjpeg" url="function.imagecreatefromjpeg.php"/>
+<entry name="imagecreatefrompng" url="function.imagecreatefrompng.php"/>
+<entry name="imagecreatefromstring" url="function.imagecreatefromstring.php"/>
+<entry name="imagecreatefromwbmp" url="function.imagecreatefromwbmp.php"/>
+<entry name="imagecreatefromxbm" url="function.imagecreatefromxbm.php"/>
+<entry name="imagecreatefromxpm" url="function.imagecreatefromxpm.php"/>
+<entry name="imagecreatetruecolor" url="function.imagecreatetruecolor.php"/>
+<entry name="imagedashedline" url="function.imagedashedline.php"/>
+<entry name="imagedestroy" url="function.imagedestroy.php"/>
+<entry name="imageellipse" url="function.imageellipse.php"/>
+<entry name="imagefill" url="function.imagefill.php"/>
+<entry name="imagefilledarc" url="function.imagefilledarc.php"/>
+<entry name="imagefilledellipse" url="function.imagefilledellipse.php"/>
+<entry name="imagefilledpolygon" url="function.imagefilledpolygon.php"/>
+<entry name="imagefilledrectangle" url="function.imagefilledrectangle.php"/>
+<entry name="imagefilltoborder" url="function.imagefilltoborder.php"/>
+<entry name="imagefilter" url="function.imagefilter.php"/>
+<entry name="imagefontheight" url="function.imagefontheight.php"/>
+<entry name="imagefontwidth" url="function.imagefontwidth.php"/>
+<entry name="imageftbbox" url="function.imageftbbox.php"/>
+<entry name="imagefttext" url="function.imagefttext.php"/>
+<entry name="imagegammacorrect" url="function.imagegammacorrect.php"/>
+<entry name="imagegd2" url="function.imagegd2.php"/>
+<entry name="imagegd" url="function.imagegd.php"/>
+<entry name="imagegif" url="function.imagegif.php"/>
+<entry name="imagegrabscreen" url="function.imagegrabscreen.php"/>
+<entry name="imagegrabwindow" url="function.imagegrabwindow.php"/>
+<entry name="imageinterlace" url="function.imageinterlace.php"/>
+<entry name="imageistruecolor" url="function.imageistruecolor.php"/>
+<entry name="imagejpeg" url="function.imagejpeg.php"/>
+<entry name="imagelayereffect" url="function.imagelayereffect.php"/>
+<entry name="imageline" url="function.imageline.php"/>
+<entry name="imageloadfont" url="function.imageloadfont.php"/>
+<entry name="imagepalettecopy" url="function.imagepalettecopy.php"/>
+<entry name="imagepng" url="function.imagepng.php"/>
+<entry name="imagepolygon" url="function.imagepolygon.php"/>
+<entry name="imagepsbbox" url="function.imagepsbbox.php"/>
+<entry name="imagepsencodefont" url="function.imagepsencodefont.php"/>
+<entry name="imagepsextendfont" url="function.imagepsextendfont.php"/>
+<entry name="imagepsfreefont" url="function.imagepsfreefont.php"/>
+<entry name="imagepsloadfont" url="function.imagepsloadfont.php"/>
+<entry name="imagepsslantfont" url="function.imagepsslantfont.php"/>
+<entry name="imagepstext" url="function.imagepstext.php"/>
+<entry name="imagerectangle" url="function.imagerectangle.php"/>
+<entry name="imagerotate" url="function.imagerotate.php"/>
+<entry name="imagesavealpha" url="function.imagesavealpha.php"/>
+<entry name="imagesetbrush" url="function.imagesetbrush.php"/>
+<entry name="imagesetpixel" url="function.imagesetpixel.php"/>
+<entry name="imagesetstyle" url="function.imagesetstyle.php"/>
+<entry name="imagesetthickness" url="function.imagesetthickness.php"/>
+<entry name="imagesettile" url="function.imagesettile.php"/>
+<entry name="imagestring" url="function.imagestring.php"/>
+<entry name="imagestringup" url="function.imagestringup.php"/>
+<entry name="imagesx" url="function.imagesx.php"/>
+<entry name="imagesy" url="function.imagesy.php"/>
+<entry name="imagetruecolortopalette" url="function.imagetruecolortopalette.php"/>
+<entry name="imagettfbbox" url="function.imagettfbbox.php"/>
+<entry name="imagettftext" url="function.imagettftext.php"/>
+<entry name="imagetypes" url="function.imagetypes.php"/>
+<entry name="imagewbmp" url="function.imagewbmp.php"/>
+<entry name="imagexbm" url="function.imagexbm.php"/>
+<entry name="iptcembed" url="function.iptcembed.php"/>
+<entry name="iptcparse" url="function.iptcparse.php"/>
+<entry name="jpeg2wbmp" url="function.jpeg2wbmp.php"/>
+<entry name="png2wbmp" url="function.png2wbmp.php"/>
+<entry name="Imagick::adaptiveBlurImage" url="function.imagick-adaptiveblurimage.php"/>
+<entry name="Imagick::adaptiveResizeImage" url="function.imagick-adaptiveresizeimage.php"/>
+<entry name="Imagick::adaptiveSharpenImage" url="function.imagick-adaptivesharpenimage.php"/>
+<entry name="Imagick::adaptiveThresholdImage" url="function.imagick-adaptivethresholdimage.php"/>
+<entry name="Imagick::addImage" url="function.imagick-addimage.php"/>
+<entry name="Imagick::addNoiseImage" url="function.imagick-addnoiseimage.php"/>
+<entry name="Imagick::affineTransformImage" url="function.imagick-affinetransformimage.php"/>
+<entry name="Imagick::annotateImage" url="function.imagick-annotateimage.php"/>
+<entry name="Imagick::appendImages" url="function.imagick-appendimages.php"/>
+<entry name="Imagick::averageImages" url="function.imagick-averageimages.php"/>
+<entry name="Imagick::blackThresholdImage" url="function.imagick-blackthresholdimage.php"/>
+<entry name="Imagick::blurImage" url="function.imagick-blurimage.php"/>
+<entry name="Imagick::borderImage" url="function.imagick-borderimage.php"/>
+<entry name="Imagick::charcoalImage" url="function.imagick-charcoalimage.php"/>
+<entry name="Imagick::chopImage" url="function.imagick-chopimage.php"/>
+<entry name="Imagick::clear" url="function.imagick-clear.php"/>
+<entry name="Imagick::clipImage" url="function.imagick-clipimage.php"/>
+<entry name="Imagick::clipPathImage" url="function.imagick-clippathimage.php"/>
+<entry name="Imagick::clone" url="function.imagick-clone.php"/>
+<entry name="Imagick::clutImage" url="function.imagick-clutimage.php"/>
+<entry name="Imagick::coalesceImages" url="function.imagick-coalesceimages.php"/>
+<entry name="Imagick::colorFloodfillImage" url="function.imagick-paintfloodfillimage.php"/>
+<entry name="Imagick::colorizeImage" url="function.imagick-colorizeimage.php"/>
+<entry name="Imagick::combineImages" url="function.imagick-combineimages.php"/>
+<entry name="Imagick::commentImage" url="function.imagick-commentimage.php"/>
+<entry name="Imagick::compareImageChannels" url="function.imagick-compareimagechannels.php"/>
+<entry name="Imagick::compareImageLayers" url="function.imagick-compareimagelayers.php"/>
+<entry name="Imagick::compareImages" url="function.imagick-compareimages.php"/>
+<entry name="Imagick::compositeImage" url="function.imagick-compositeimage.php"/>
+<entry name="Imagick::__construct" url="function.imagick-construct.php"/>
+<entry name="Imagick::contrastImage" url="function.imagick-contrastimage.php"/>
+<entry name="Imagick::contrastStretchImage" url="function.imagick-contraststretchimage.php"/>
+<entry name="Imagick::convolveImage" url="function.imagick-convolveimage.php"/>
+<entry name="Imagick::cropImage" url="function.imagick-cropimage.php"/>
+<entry name="Imagick::cropThumbnailImage" url="function.imagick-cropthumbnailimage.php"/>
+<entry name="Imagick::current" url="function.imagick-current.php"/>
+<entry name="Imagick::cycleColormapImage" url="function.imagick-cyclecolormapimage.php"/>
+<entry name="Imagick::deconstructImages" url="function.imagick-deconstructimages.php"/>
+<entry name="Imagick::despeckleImage" url="function.imagick-despeckleimage.php"/>
+<entry name="Imagick::destroy" url="function.imagick-destroy.php"/>
+<entry name="Imagick::displayImage" url="function.imagick-displayimage.php"/>
+<entry name="Imagick::displayImages" url="function.imagick-displayimages.php"/>
+<entry name="Imagick::distortImage" url="function.imagick-distortimage.php"/>
+<entry name="Imagick::drawImage" url="function.imagick-drawimage.php"/>
+<entry name="Imagick::edgeImage" url="function.imagick-edgeimage.php"/>
+<entry name="Imagick::embossImage" url="function.imagick-embossimage.php"/>
+<entry name="Imagick::enhanceImage" url="function.imagick-enhanceimage.php"/>
+<entry name="Imagick::equalizeImage" url="function.imagick-equalizeimage.php"/>
+<entry name="Imagick::evaluateImage" url="function.imagick-evaluateimage.php"/>
+<entry name="Imagick::flattenImages" url="function.imagick-flattenimages.php"/>
+<entry name="Imagick::flipImage" url="function.imagick-flipimage.php"/>
+<entry name="Imagick::flopImage" url="function.imagick-flopimage.php"/>
+<entry name="Imagick::frameImage" url="function.imagick-frameimage.php"/>
+<entry name="Imagick::fxImage" url="function.imagick-fximage.php"/>
+<entry name="Imagick::gammaImage" url="function.imagick-gammaimage.php"/>
+<entry name="Imagick::gaussianBlurImage" url="function.imagick-gaussianblurimage.php"/>
+<entry name="Imagick::getCompression" url="function.imagick-getcompression.php"/>
+<entry name="Imagick::getCompressionQuality" url="function.imagick-getcompressionquality.php"/>
+<entry name="Imagick::getCopyright" url="function.imagick-getcopyright.php"/>
+<entry name="Imagick::getFilename" url="function.imagick-getfilename.php"/>
+<entry name="Imagick::getFormat" url="function.imagick-getformat.php"/>
+<entry name="Imagick::getHomeURL" url="function.imagick-gethomeurl.php"/>
+<entry name="Imagick::getImage" url="function.imagick-getimage.php"/>
+<entry name="Imagick::getImageBackgroundColor" url="function.imagick-getimagebackgroundcolor.php"/>
+<entry name="Imagick::getImageBlob" url="function.imagick-getimageblob.php"/>
+<entry name="Imagick::getImageBluePrimary" url="function.imagick-getimageblueprimary.php"/>
+<entry name="Imagick::getImageBorderColor" url="function.imagick-getimagebordercolor.php"/>
+<entry name="Imagick::getImageChannelDepth" url="function.imagick-getimagechanneldepth.php"/>
+<entry name="Imagick::getImageChannelDistortion" url="function.imagick-getimagechanneldistortion.php"/>
+<entry name="Imagick::getImageChannelExtrema" url="function.imagick-getimagechannelextrema.php"/>
+<entry name="Imagick::getImageChannelMean" url="function.imagick-getimagechannelmean.php"/>
+<entry name="Imagick::getImageChannelStatistics" url="function.imagick-getimagechannelstatistics.php"/>
+<entry name="Imagick::getImageColormapColor" url="function.imagick-getimagecolormapcolor.php"/>
+<entry name="Imagick::getImageColors" url="function.imagick-getimagecolors.php"/>
+<entry name="Imagick::getImageColorspace" url="function.imagick-getimagecolorspace.php"/>
+<entry name="Imagick::getImageCompose" url="function.imagick-getimagecompose.php"/>
+<entry name="Imagick::getImageDelay" url="function.imagick-getimagedelay.php"/>
+<entry name="Imagick::getImageDepth" url="function.imagick-getimagedepth.php"/>
+<entry name="Imagick::getImageDispose" url="function.imagick-getimagedispose.php"/>
+<entry name="Imagick::getImageDistortion" url="function.imagick-getimagedistortion.php"/>
+<entry name="Imagick::getImageExtrema" url="function.imagick-getimageextrema.php"/>
+<entry name="Imagick::getImageFilename" url="function.imagick-getimagefilename.php"/>
+<entry name="Imagick::getImageFormat" url="function.imagick-getimageformat.php"/>
+<entry name="Imagick::getImageGamma" url="function.imagick-getimagegamma.php"/>
+<entry name="Imagick::getImageGeometry" url="function.imagick-getimagegeometry.php"/>
+<entry name="Imagick::getImageGreenPrimary" url="function.imagick-getimagegreenprimary.php"/>
+<entry name="Imagick::getImageHeight" url="function.imagick-getimageheight.php"/>
+<entry name="Imagick::getImageHistogram" url="function.imagick-getimagehistogram.php"/>
+<entry name="Imagick::getImageIndex" url="function.imagick-getimageindex.php"/>
+<entry name="Imagick::getImageInterlaceScheme" url="function.imagick-getimageinterlacescheme.php"/>
+<entry name="Imagick::getImageInterpolateMethod" url="function.imagick-getimageinterpolatemethod.php"/>
+<entry name="Imagick::getImageIterations" url="function.imagick-getimageiterations.php"/>
+<entry name="Imagick::getImageLength" url="function.imagick-getimagelength.php"/>
+<entry name="Imagick::getImageMagickLicense" url="function.imagick-getimagemagicklicense.php"/>
+<entry name="Imagick::getImageMatte" url="function.imagick-getimagematte.php"/>
+<entry name="Imagick::getImageMatteColor" url="function.imagick-getimagemattecolor.php"/>
+<entry name="Imagick::getImageOrientation" url="function.imagick-getimageorientation.php"/>
+<entry name="Imagick::getImagePage" url="function.imagick-getimagepage.php"/>
+<entry name="Imagick::getImagePixelColor" url="function.imagick-getimagepixelcolor.php"/>
+<entry name="Imagick::getImageProfile" url="function.imagick-getimageprofile.php"/>
+<entry name="Imagick::getImageProfiles" url="function.imagick-getimageprofiles.php"/>
+<entry name="Imagick::getImageProperties" url="function.imagick-getimageproperties.php"/>
+<entry name="Imagick::getImageProperty" url="function.imagick-getimageproperty.php"/>
+<entry name="Imagick::getImageRedPrimary" url="function.imagick-getimageredprimary.php"/>
+<entry name="Imagick::getImageRegion" url="function.imagick-getimageregion.php"/>
+<entry name="Imagick::getImageRenderingIntent" url="function.imagick-getimagerenderingintent.php"/>
+<entry name="Imagick::getImageResolution" url="function.imagick-getimageresolution.php"/>
+<entry name="Imagick::getImageScene" url="function.imagick-getimagescene.php"/>
+<entry name="Imagick::getImageSignature" url="function.imagick-getimagesignature.php"/>
+<entry name="Imagick::getImageSize" url="function.imagick-getimagesize.php"/>
+<entry name="Imagick::getImageTicksPerSecond" url="function.imagick-getimagetickspersecond.php"/>
+<entry name="Imagick::getImageTotalInkDensity" url="function.imagick-getimagetotalinkdensity.php"/>
+<entry name="Imagick::getImageType" url="function.imagick-getimagetype.php"/>
+<entry name="Imagick::getImageUnits" url="function.imagick-getimageunits.php"/>
+<entry name="Imagick::getImageVirtualPixelMethod" url="function.imagick-getimagevirtualpixelmethod.php"/>
+<entry name="Imagick::getImageWhitePoint" url="function.imagick-getimagewhitepoint.php"/>
+<entry name="Imagick::getImageWidth" url="function.imagick-getimagewidth.php"/>
+<entry name="Imagick::getInterlaceScheme" url="function.imagick-getinterlacescheme.php"/>
+<entry name="Imagick::getIteratorIndex" url="function.imagick-getiteratorindex.php"/>
+<entry name="Imagick::getNumberImages" url="function.imagick-getnumberimages.php"/>
+<entry name="Imagick::getOption" url="function.imagick-getoption.php"/>
+<entry name="Imagick::getPackageName" url="function.imagick-getpackagename.php"/>
+<entry name="Imagick::getPage" url="function.imagick-getpage.php"/>
+<entry name="Imagick::getPixelIterator" url="function.imagick-getpixeliterator.php"/>
+<entry name="Imagick::getPixelRegionIterator" url="function.imagick-getpixelregioniterator.php"/>
+<entry name="Imagick::getQuantumDepth" url="function.imagick-getquantumdepth.php"/>
+<entry name="Imagick::getQuantumRange" url="function.imagick-getquantumrange.php"/>
+<entry name="Imagick::getReleaseDate" url="function.imagick-getreleasedate.php"/>
+<entry name="Imagick::getResource" url="function.imagick-getresource.php"/>
+<entry name="Imagick::getResourceLimit" url="function.imagick-getresourcelimit.php"/>
+<entry name="Imagick::getSamplingFactors" url="function.imagick-getsamplingfactors.php"/>
+<entry name="Imagick::getSize" url="function.imagick-getsize.php"/>
+<entry name="Imagick::getSizeOffset" url="function.imagick-getsizeoffset.php"/>
+<entry name="Imagick::getVersion" url="function.imagick-getversion.php"/>
+<entry name="Imagick::hasNextImage" url="function.imagick-hasnextimage.php"/>
+<entry name="Imagick::hasPreviousImage" url="function.imagick-haspreviousimage.php"/>
+<entry name="Imagick::identifyImage" url="function.imagick-identifyimage.php"/>
+<entry name="Imagick::implodeImage" url="function.imagick-implodeimage.php"/>
+<entry name="Imagick::labelImage" url="function.imagick-labelimage.php"/>
+<entry name="Imagick::levelImage" url="function.imagick-levelimage.php"/>
+<entry name="Imagick::linearStretchImage" url="function.imagick-linearstretchimage.php"/>
+<entry name="Imagick::magnifyImage" url="function.imagick-magnifyimage.php"/>
+<entry name="Imagick::mapImage" url="function.imagick-mapimage.php"/>
+<entry name="Imagick::matteFloodfillImage" url="function.imagick-mattefloodfillimage.php"/>
+<entry name="Imagick::medianFilterImage" url="function.imagick-medianfilterimage.php"/>
+<entry name="Imagick::minifyImage" url="function.imagick-minifyimage.php"/>
+<entry name="Imagick::modulateImage" url="function.imagick-modulateimage.php"/>
+<entry name="Imagick::montageImage" url="function.imagick-montageimage.php"/>
+<entry name="Imagick::morphImages" url="function.imagick-morphimages.php"/>
+<entry name="Imagick::mosaicImages" url="function.imagick-mosaicimages.php"/>
+<entry name="Imagick::motionBlurImage" url="function.imagick-motionblurimage.php"/>
+<entry name="Imagick::negateImage" url="function.imagick-negateimage.php"/>
+<entry name="Imagick::newImage" url="function.imagick-newimage.php"/>
+<entry name="Imagick::newPseudoImage" url="function.imagick-newpseudoimage.php"/>
+<entry name="Imagick::nextImage" url="function.imagick-nextimage.php"/>
+<entry name="Imagick::normalizeImage" url="function.imagick-normalizeimage.php"/>
+<entry name="Imagick::oilPaintImage" url="function.imagick-oilpaintimage.php"/>
+<entry name="Imagick::optimizeImageLayers" url="function.imagick-optimizeimagelayers.php"/>
+<entry name="Imagick::paintOpaqueImage" url="function.imagick-paintopaqueimage.php"/>
+<entry name="Imagick::paintTransparentImage" url="function.imagick-painttransparentimage.php"/>
+<entry name="Imagick::pingImage" url="function.imagick-pingimage.php"/>
+<entry name="Imagick::pingImageBlob" url="function.imagick-pingimageblob.php"/>
+<entry name="Imagick::pingImageFile" url="function.imagick-pingimagefile.php"/>
+<entry name="Imagick::polaroidImage" url="function.imagick-polaroidimage.php"/>
+<entry name="Imagick::posterizeImage" url="function.imagick-posterizeimage.php"/>
+<entry name="Imagick::previewImages" url="function.imagick-previewimages.php"/>
+<entry name="Imagick::previousImage" url="function.imagick-previousimage.php"/>
+<entry name="Imagick::profileImage" url="function.imagick-profileimage.php"/>
+<entry name="Imagick::quantizeImage" url="function.imagick-quantizeimage.php"/>
+<entry name="Imagick::quantizeImages" url="function.imagick-quantizeimages.php"/>
+<entry name="Imagick::queryFontMetrics" url="function.imagick-queryfontmetrics.php"/>
+<entry name="Imagick::queryFonts" url="function.imagick-queryfonts.php"/>
+<entry name="Imagick::queryFormats" url="function.imagick-queryformats.php"/>
+<entry name="Imagick::radialBlurImage" url="function.imagick-radialblurimage.php"/>
+<entry name="Imagick::raiseImage" url="function.imagick-raiseimage.php"/>
+<entry name="Imagick::randomThresholdImage" url="function.imagick-randomthresholdimage.php"/>
+<entry name="Imagick::readImage" url="function.imagick-readimage.php"/>
+<entry name="Imagick::readImageBlob" url="function.imagick-readimageblob.php"/>
+<entry name="Imagick::readImageFile" url="function.imagick-readimagefile.php"/>
+<entry name="Imagick::reduceNoiseImage" url="function.imagick-reducenoiseimage.php"/>
+<entry name="Imagick::removeImage" url="function.imagick-removeimage.php"/>
+<entry name="Imagick::removeImageProfile" url="function.imagick-removeimageprofile.php"/>
+<entry name="Imagick::render" url="function.imagick-render.php"/>
+<entry name="Imagick::resampleImage" url="function.imagick-resampleimage.php"/>
+<entry name="Imagick::resizeImage" url="function.imagick-resizeimage.php"/>
+<entry name="Imagick::rollImage" url="function.imagick-rollimage.php"/>
+<entry name="Imagick::rotateImage" url="function.imagick-rotateimage.php"/>
+<entry name="Imagick::roundCorners" url="function.imagick-roundcorners.php"/>
+<entry name="Imagick::sampleImage" url="function.imagick-sampleimage.php"/>
+<entry name="Imagick::scaleImage" url="function.imagick-scaleimage.php"/>
+<entry name="Imagick::separateImageChannel" url="function.imagick-separateimagechannel.php"/>
+<entry name="Imagick::sepiaToneImage" url="function.imagick-sepiatoneimage.php"/>
+<entry name="Imagick::setBackgroundColor" url="function.imagick-setbackgroundcolor.php"/>
+<entry name="Imagick::setCompression" url="function.imagick-setcompression.php"/>
+<entry name="Imagick::setCompressionQuality" url="function.imagick-setcompressionquality.php"/>
+<entry name="Imagick::setFilename" url="function.imagick-setfilename.php"/>
+<entry name="Imagick::setFirstIterator" url="function.imagick-setfirstiterator.php"/>
+<entry name="Imagick::setFormat" url="function.imagick-setformat.php"/>
+<entry name="Imagick::setImage" url="function.imagick-setimage.php"/>
+<entry name="Imagick::setImageBackgroundColor" url="function.imagick-setimagebackgroundcolor.php"/>
+<entry name="Imagick::setImageBias" url="function.imagick-setimagebias.php"/>
+<entry name="Imagick::setImageBluePrimary" url="function.imagick-setimageblueprimary.php"/>
+<entry name="Imagick::setImageBorderColor" url="function.imagick-setimagebordercolor.php"/>
+<entry name="Imagick::setImageChannelDepth" url="function.imagick-setimagechanneldepth.php"/>
+<entry name="Imagick::setImageColormapColor" url="function.imagick-setimagecolormapcolor.php"/>
+<entry name="Imagick::setImageColorspace" url="function.imagick-setimagecolorspace.php"/>
+<entry name="Imagick::setImageCompose" url="function.imagick-setimagecompose.php"/>
+<entry name="Imagick::setImageCompression" url="function.imagick-setimagecompression.php"/>
+<entry name="Imagick::setImageDelay" url="function.imagick-setimagedelay.php"/>
+<entry name="Imagick::setImageDepth" url="function.imagick-setimagedepth.php"/>
+<entry name="Imagick::setImageDispose" url="function.imagick-setimagedispose.php"/>
+<entry name="Imagick::setImageExtent" url="function.imagick-setimageextent.php"/>
+<entry name="Imagick::setImageFilename" url="function.imagick-setimagefilename.php"/>
+<entry name="Imagick::setImageFormat" url="function.imagick-setimageformat.php"/>
+<entry name="Imagick::setImageGamma" url="function.imagick-setimagegamma.php"/>
+<entry name="Imagick::setImageGreenPrimary" url="function.imagick-setimagegreenprimary.php"/>
+<entry name="Imagick::setImageIndex" url="function.imagick-setimageindex.php"/>
+<entry name="Imagick::setImageInterlaceScheme" url="function.imagick-setimageinterlacescheme.php"/>
+<entry name="Imagick::setImageInterpolateMethod" url="function.imagick-setimageinterpolatemethod.php"/>
+<entry name="Imagick::setImageIterations" url="function.imagick-setimageiterations.php"/>
+<entry name="Imagick::setImageMatte" url="function.imagick-setimagematte.php"/>
+<entry name="Imagick::setImageMatteColor" url="function.imagick-setimagemattecolor.php"/>
+<entry name="Imagick::setImageOpacity" url="function.imagick-setimageopacity.php"/>
+<entry name="Imagick::setImageOrientation" url="function.imagick-setimageorientation.php"/>
+<entry name="Imagick::setImagePage" url="function.imagick-setimagepage.php"/>
+<entry name="Imagick::setImageProfile" url="function.imagick-setimageprofile.php"/>
+<entry name="Imagick::setImageProperty" url="function.imagick-setimageproperty.php"/>
+<entry name="Imagick::setImageRedPrimary" url="function.imagick-setimageredprimary.php"/>
+<entry name="Imagick::setImageRenderingIntent" url="function.imagick-setimagerenderingintent.php"/>
+<entry name="Imagick::setImageResolution" url="function.imagick-setimageresolution.php"/>
+<entry name="Imagick::setImageScene" url="function.imagick-setimagescene.php"/>
+<entry name="Imagick::setImageTicksPerSecond" url="function.imagick-setimagetickspersecond.php"/>
+<entry name="Imagick::setImageType" url="function.imagick-setimagetype.php"/>
+<entry name="Imagick::setImageUnits" url="function.imagick-setimageunits.php"/>
+<entry name="Imagick::setImageVirtualPixelMethod" url="function.imagick-setimagevirtualpixelmethod.php"/>
+<entry name="Imagick::setImageWhitePoint" url="function.imagick-setimagewhitepoint.php"/>
+<entry name="Imagick::setInterlaceScheme" url="function.imagick-setinterlacescheme.php"/>
+<entry name="Imagick::setIteratorIndex" url="function.imagick-setiteratorindex.php"/>
+<entry name="Imagick::setLastIterator" url="function.imagick-setlastiterator.php"/>
+<entry name="Imagick::setOption" url="function.imagick-setoption.php"/>
+<entry name="Imagick::setPage" url="function.imagick-setpage.php"/>
+<entry name="Imagick::setResolution" url="function.imagick-setresolution.php"/>
+<entry name="Imagick::setResourceLimit" url="function.imagick-setresourcelimit.php"/>
+<entry name="Imagick::setSamplingFactors" url="function.imagick-setsamplingfactors.php"/>
+<entry name="Imagick::setSize" url="function.imagick-setsize.php"/>
+<entry name="Imagick::setSizeOffset" url="function.imagick-setsizeoffset.php"/>
+<entry name="Imagick::setType" url="function.imagick-settype.php"/>
+<entry name="Imagick::shadeImage" url="function.imagick-shadeimage.php"/>
+<entry name="Imagick::shadowImage" url="function.imagick-shadowimage.php"/>
+<entry name="Imagick::sharpenImage" url="function.imagick-sharpenimage.php"/>
+<entry name="Imagick::shaveImage" url="function.imagick-shaveimage.php"/>
+<entry name="Imagick::shearImage" url="function.imagick-shearimage.php"/>
+<entry name="Imagick::sigmoidalContrastImage" url="function.imagick-sigmoidalcontrastimage.php"/>
+<entry name="Imagick::sketchImage" url="function.imagick-sketchimage.php"/>
+<entry name="Imagick::solarizeImage" url="function.imagick-solarizeimage.php"/>
+<entry name="Imagick::spliceImage" url="function.imagick-spliceimage.php"/>
+<entry name="Imagick::spreadImage" url="function.imagick-spreadimage.php"/>
+<entry name="Imagick::steganoImage" url="function.imagick-steganoimage.php"/>
+<entry name="Imagick::stereoImage" url="function.imagick-stereoimage.php"/>
+<entry name="Imagick::stripImage" url="function.imagick-stripimage.php"/>
+<entry name="Imagick::swirlImage" url="function.imagick-swirlimage.php"/>
+<entry name="Imagick::textureImage" url="function.imagick-textureimage.php"/>
+<entry name="Imagick::thresholdImage" url="function.imagick-thresholdimage.php"/>
+<entry name="Imagick::thumbnailImage" url="function.imagick-thumbnailimage.php"/>
+<entry name="Imagick::tintImage" url="function.imagick-tintimage.php"/>
+<entry name="Imagick::transformImage" url="function.imagick-transformimage.php"/>
+<entry name="Imagick::transverseImage" url="function.imagick-transverseimage.php"/>
+<entry name="Imagick::trimImage" url="function.imagick-trimimage.php"/>
+<entry name="Imagick::uniqueImageColors" url="function.imagick-uniqueimagecolors.php"/>
+<entry name="Imagick::unsharpMaskImage" url="function.imagick-unsharpmaskimage.php"/>
+<entry name="Imagick::valid" url="function.imagick-valid.php"/>
+<entry name="Imagick::vignetteImage" url="function.imagick-vignetteimage.php"/>
+<entry name="Imagick::waveImage" url="function.imagick-waveimage.php"/>
+<entry name="Imagick::whiteThresholdImage" url="function.imagick-whitethresholdimage.php"/>
+<entry name="Imagick::writeImage" url="function.imagick-writeimage.php"/>
+<entry name="Imagick::writeImages" url="function.imagick-writeimages.php"/>
+<entry name="ImagickDraw::affine" url="function.imagickdraw-affine.php"/>
+<entry name="ImagickDraw::annotation" url="function.imagickdraw-annotation.php"/>
+<entry name="ImagickDraw::arc" url="function.imagickdraw-arc.php"/>
+<entry name="ImagickDraw::bezier" url="function.imagickdraw-bezier.php"/>
+<entry name="ImagickDraw::circle" url="function.imagickdraw-circle.php"/>
+<entry name="ImagickDraw::clear" url="function.imagickdraw-clear.php"/>
+<entry name="ImagickDraw::clone" url="function.imagickdraw-clone.php"/>
+<entry name="ImagickDraw::color" url="function.imagickdraw-color.php"/>
+<entry name="ImagickDraw::comment" url="function.imagickdraw-comment.php"/>
+<entry name="ImagickDraw::composite" url="function.imagickdraw-composite.php"/>
+<entry name="ImagickDraw::__construct" url="function.imagickdraw-construct.php"/>
+<entry name="ImagickDraw::destroy" url="function.imagickdraw-destroy.php"/>
+<entry name="ImagickDraw::ellipse" url="function.imagickdraw-ellipse.php"/>
+<entry name="ImagickDraw::getClipPath" url="function.imagickdraw-getclippath.php"/>
+<entry name="ImagickDraw::getClipRule" url="function.imagickdraw-getcliprule.php"/>
+<entry name="ImagickDraw::getClipUnits" url="function.imagickdraw-getclipunits.php"/>
+<entry name="ImagickDraw::getFillColor" url="function.imagickdraw-getfillcolor.php"/>
+<entry name="ImagickDraw::getFillOpacity" url="function.imagickdraw-getfillopacity.php"/>
+<entry name="ImagickDraw::getFillRule" url="function.imagickdraw-getfillrule.php"/>
+<entry name="ImagickDraw::getFont" url="function.imagickdraw-getfont.php"/>
+<entry name="ImagickDraw::getFontFamily" url="function.imagickdraw-getfontfamily.php"/>
+<entry name="ImagickDraw::getFontSize" url="function.imagickdraw-getfontsize.php"/>
+<entry name="ImagickDraw::getFontStyle" url="function.imagickdraw-getfontstyle.php"/>
+<entry name="ImagickDraw::getFontWeight" url="function.imagickdraw-getfontweight.php"/>
+<entry name="ImagickDraw::getGravity" url="function.imagickdraw-getgravity.php"/>
+<entry name="ImagickDraw::getStrokeAntialias" url="function.imagickdraw-getstrokeantialias.php"/>
+<entry name="ImagickDraw::getStrokeColor" url="function.imagickdraw-getstrokecolor.php"/>
+<entry name="ImagickDraw::getStrokeDashArray" url="function.imagickdraw-getstrokedasharray.php"/>
+<entry name="ImagickDraw::getStrokeDashOffset" url="function.imagickdraw-getstrokedashoffset.php"/>
+<entry name="ImagickDraw::getStrokeLineCap" url="function.imagickdraw-getstrokelinecap.php"/>
+<entry name="ImagickDraw::getStrokeLineJoin" url="function.imagickdraw-getstrokelinejoin.php"/>
+<entry name="ImagickDraw::getStrokeMiterLimit" url="function.imagickdraw-getstrokemiterlimit.php"/>
+<entry name="ImagickDraw::getStrokeOpacity" url="function.imagickdraw-getstrokeopacity.php"/>
+<entry name="ImagickDraw::getStrokeWidth" url="function.imagickdraw-getstrokewidth.php"/>
+<entry name="ImagickDraw::getTextAlignment" url="function.imagickdraw-gettextalignment.php"/>
+<entry name="ImagickDraw::getTextAntialias" url="function.imagickdraw-gettextantialias.php"/>
+<entry name="ImagickDraw::getTextDecoration" url="function.imagickdraw-gettextdecoration.php"/>
+<entry name="ImagickDraw::getTextEncoding" url="function.imagickdraw-gettextencoding.php"/>
+<entry name="ImagickDraw::getTextUnderColor" url="function.imagickdraw-gettextundercolor.php"/>
+<entry name="ImagickDraw::getVectorGraphics" url="function.imagickdraw-getvectorgraphics.php"/>
+<entry name="ImagickDraw::line" url="function.imagickdraw-line.php"/>
+<entry name="ImagickDraw::matte" url="function.imagickdraw-matte.php"/>
+<entry name="ImagickDraw::pathClose" url="function.imagickdraw-pathclose.php"/>
+<entry name="ImagickDraw::pathCurveToAbsolute" url="function.imagickdraw-pathcurvetoabsolute.php"/>
+<entry name="ImagickDraw::pathCurveToQuadraticBezierAbsolute" url="function.imagickdraw-pathcurvetoquadraticbezierabsolute.php"/>
+<entry name="ImagickDraw::pathCurveToQuadraticBezierRelative" url="function.imagickdraw-pathcurvetoquadraticbezierrelative.php"/>
+<entry name="ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute" url="function.imagickdraw-pathcurvetoquadraticbeziersmoothabsolute.php"/>
+<entry name="ImagickDraw::pathCurveToQuadraticBezierSmoothRelative" url="function.imagickdraw-pathcurvetoquadraticbeziersmoothrelative.php"/>
+<entry name="ImagickDraw::pathCurveToRelative" url="function.imagickdraw-pathcurvetorelative.php"/>
+<entry name="ImagickDraw::pathCurveToSmoothAbsolute" url="function.imagickdraw-pathcurvetosmoothabsolute.php"/>
+<entry name="ImagickDraw::pathCurveToSmoothRelative" url="function.imagickdraw-pathcurvetosmoothrelative.php"/>
+<entry name="ImagickDraw::pathEllipticArcAbsolute" url="function.imagickdraw-pathellipticarcabsolute.php"/>
+<entry name="ImagickDraw::pathEllipticArcRelative" url="function.imagickdraw-pathellipticarcrelative.php"/>
+<entry name="ImagickDraw::pathFinish" url="function.imagickdraw-pathfinish.php"/>
+<entry name="ImagickDraw::pathLineToAbsolute" url="function.imagickdraw-pathlinetoabsolute.php"/>
+<entry name="ImagickDraw::pathLineToHorizontalAbsolute" url="function.imagickdraw-pathlinetohorizontalabsolute.php"/>
+<entry name="ImagickDraw::pathLineToHorizontalRelative" url="function.imagickdraw-pathlinetohorizontalrelative.php"/>
+<entry name="ImagickDraw::pathLineToRelative" url="function.imagickdraw-pathlinetorelative.php"/>
+<entry name="ImagickDraw::pathLineToVerticalAbsolute" url="function.imagickdraw-pathlinetoverticalabsolute.php"/>
+<entry name="ImagickDraw::pathLineToVerticalRelative" url="function.imagickdraw-pathlinetoverticalrelative.php"/>
+<entry name="ImagickDraw::pathMoveToAbsolute" url="function.imagickdraw-pathmovetoabsolute.php"/>
+<entry name="ImagickDraw::pathMoveToRelative" url="function.imagickdraw-pathmovetorelative.php"/>
+<entry name="ImagickDraw::pathStart" url="function.imagickdraw-pathstart.php"/>
+<entry name="ImagickDraw::point" url="function.imagickdraw-point.php"/>
+<entry name="ImagickDraw::polygon" url="function.imagickdraw-polygon.php"/>
+<entry name="ImagickDraw::polyline" url="function.imagickdraw-polyline.php"/>
+<entry name="ImagickDraw::pop" url="function.imagickdraw-pop.php"/>
+<entry name="ImagickDraw::popClipPath" url="function.imagickdraw-popclippath.php"/>
+<entry name="ImagickDraw::popDefs" url="function.imagickdraw-popdefs.php"/>
+<entry name="ImagickDraw::popPattern" url="function.imagickdraw-poppattern.php"/>
+<entry name="ImagickDraw::push" url="function.imagickdraw-push.php"/>
+<entry name="ImagickDraw::pushClipPath" url="function.imagickdraw-pushclippath.php"/>
+<entry name="ImagickDraw::pushDefs" url="function.imagickdraw-pushdefs.php"/>
+<entry name="ImagickDraw::pushPattern" url="function.imagickdraw-pushpattern.php"/>
+<entry name="ImagickDraw::rectangle" url="function.imagickdraw-rectangle.php"/>
+<entry name="ImagickDraw::render" url="function.imagickdraw-render.php"/>
+<entry name="ImagickDraw::rotate" url="function.imagickdraw-rotate.php"/>
+<entry name="ImagickDraw::roundRectangle" url="function.imagickdraw-roundrectangle.php"/>
+<entry name="ImagickDraw::scale" url="function.imagickdraw-scale.php"/>
+<entry name="ImagickDraw::setClipPath" url="function.imagickdraw-setclippath.php"/>
+<entry name="ImagickDraw::setClipRule" url="function.imagickdraw-setcliprule.php"/>
+<entry name="ImagickDraw::setClipUnits" url="function.imagickdraw-setclipunits.php"/>
+<entry name="ImagickDraw::setFillAlpha" url="function.imagickdraw-setfillalpha.php"/>
+<entry name="ImagickDraw::setFillColor" url="function.imagickdraw-setfillcolor.php"/>
+<entry name="ImagickDraw::setFillOpacity" url="function.imagickdraw-setfillopacity.php"/>
+<entry name="ImagickDraw::setFillPatternURL" url="function.imagickdraw-setfillpatternurl.php"/>
+<entry name="ImagickDraw::setFillRule" url="function.imagickdraw-setfillrule.php"/>
+<entry name="ImagickDraw::setFont" url="function.imagickdraw-setfont.php"/>
+<entry name="ImagickDraw::setFontFamily" url="function.imagickdraw-setfontfamily.php"/>
+<entry name="ImagickDraw::setFontSize" url="function.imagickdraw-setfontsize.php"/>
+<entry name="ImagickDraw::setFontStretch" url="function.imagickdraw-setfontstretch.php"/>
+<entry name="ImagickDraw::setFontStyle" url="function.imagickdraw-setfontstyle.php"/>
+<entry name="ImagickDraw::setFontWeight" url="function.imagickdraw-setfontweight.php"/>
+<entry name="ImagickDraw::setGravity" url="function.imagickdraw-setgravity.php"/>
+<entry name="ImagickDraw::setStrokeAlpha" url="function.imagickdraw-setstrokealpha.php"/>
+<entry name="ImagickDraw::setStrokeAntialias" url="function.imagickdraw-setstrokeantialias.php"/>
+<entry name="ImagickDraw::setStrokeColor" url="function.imagickdraw-setstrokecolor.php"/>
+<entry name="ImagickDraw::setStrokeDashArray" url="function.imagickdraw-setstrokedasharray.php"/>
+<entry name="ImagickDraw::setStrokeDashOffset" url="function.imagickdraw-setstrokedashoffset.php"/>
+<entry name="ImagickDraw::setStrokeLineCap" url="function.imagickdraw-setstrokelinecap.php"/>
+<entry name="ImagickDraw::setStrokeLineJoin" url="function.imagickdraw-setstrokelinejoin.php"/>
+<entry name="ImagickDraw::setStrokeMiterLimit" url="function.imagickdraw-setstrokemiterlimit.php"/>
+<entry name="ImagickDraw::setStrokeOpacity" url="function.imagickdraw-setstrokeopacity.php"/>
+<entry name="ImagickDraw::setStrokePatternURL" url="function.imagickdraw-setstrokepatternurl.php"/>
+<entry name="ImagickDraw::setStrokeWidth" url="function.imagickdraw-setstrokewidth.php"/>
+<entry name="ImagickDraw::setTextAlignment" url="function.imagickdraw-settextalignment.php"/>
+<entry name="ImagickDraw::setTextAntialias" url="function.imagickdraw-settextantialias.php"/>
+<entry name="ImagickDraw::setTextDecoration" url="function.imagickdraw-settextdecoration.php"/>
+<entry name="ImagickDraw::setTextEncoding" url="function.imagickdraw-settextencoding.php"/>
+<entry name="ImagickDraw::setTextUnderColor" url="function.imagickdraw-settextundercolor.php"/>
+<entry name="ImagickDraw::setVectorGraphics" url="function.imagickdraw-setvectorgraphics.php"/>
+<entry name="ImagickDraw::setViewbox" url="function.imagickdraw-setviewbox.php"/>
+<entry name="ImagickDraw::skewX" url="function.imagickdraw-skewx.php"/>
+<entry name="ImagickDraw::skewY" url="function.imagickdraw-skewy.php"/>
+<entry name="ImagickDraw::translate" url="function.imagickdraw-translate.php"/>
+<entry name="ImagickPixel::clear" url="function.imagickpixel-clear.php"/>
+<entry name="ImagickPixel::__construct" url="function.imagickpixel-construct.php"/>
+<entry name="ImagickPixel::destroy" url="function.imagickpixel-destroy.php"/>
+<entry name="ImagickPixel::getColor" url="function.imagickpixel-getcolor.php"/>
+<entry name="ImagickPixel::getColorAsString" url="function.imagickpixel-getcolorasstring.php"/>
+<entry name="ImagickPixel::getColorCount" url="function.imagickpixel-getcolorcount.php"/>
+<entry name="ImagickPixel::getColorValue" url="function.imagickpixel-getcolorvalue.php"/>
+<entry name="ImagickPixel::getHSL" url="function.imagickpixel-gethsl.php"/>
+<entry name="ImagickPixel::isSimilar" url="function.imagickpixel-issimilar.php"/>
+<entry name="ImagickPixel::setColor" url="function.imagickpixel-setcolor.php"/>
+<entry name="ImagickPixel::setColorValue" url="function.imagickpixel-setcolorvalue.php"/>
+<entry name="ImagickPixel::setHSL" url="function.imagickpixel-sethsl.php"/>
+<entry name="ImagickPixelIterator::clear" url="function.imagickpixeliterator-clear.php"/>
+<entry name="ImagickPixelIterator::__construct" url="function.imagickpixeliterator-construct.php"/>
+<entry name="ImagickPixelIterator::destroy" url="function.imagickpixeliterator-destroy.php"/>
+<entry name="ImagickPixelIterator::getCurrentIteratorRow" url="function.imagickpixeliterator-getcurrentiteratorrow.php"/>
+<entry name="ImagickPixelIterator::getIteratorRow" url="function.imagickpixeliterator-getiteratorrow.php"/>
+<entry name="ImagickPixelIterator::getNextIteratorRow" url="function.imagickpixeliterator-getnextiteratorrow.php"/>
+<entry name="ImagickPixelIterator::getPreviousIteratorRow" url="function.imagickpixeliterator-getpreviousiteratorrow.php"/>
+<entry name="ImagickPixelIterator::newPixelIterator" url="function.imagickpixeliterator-newpixeliterator.php"/>
+<entry name="ImagickPixelIterator::newPixelRegionIterator" url="function.imagickpixeliterator-newpixelregioniterator.php"/>
+<entry name="ImagickPixelIterator::resetIterator" url="function.imagickpixeliterator-resetiterator.php"/>
+<entry name="ImagickPixelIterator::setIteratorFirstRow" url="function.imagickpixeliterator-setiteratorfirstrow.php"/>
+<entry name="ImagickPixelIterator::setIteratorLastRow" url="function.imagickpixeliterator-setiteratorlastrow.php"/>
+<entry name="ImagickPixelIterator::setIteratorRow" url="function.imagickpixeliterator-setiteratorrow.php"/>
+<entry name="ImagickPixelIterator::syncIterator" url="function.imagickpixeliterator-synciterator.php"/>
+<entry name="cyrus_authenticate" url="function.cyrus-authenticate.php"/>
+<entry name="cyrus_bind" url="function.cyrus-bind.php"/>
+<entry name="cyrus_close" url="function.cyrus-close.php"/>
+<entry name="cyrus_connect" url="function.cyrus-connect.php"/>
+<entry name="cyrus_query" url="function.cyrus-query.php"/>
+<entry name="cyrus_unbind" url="function.cyrus-unbind.php"/>
+<entry name="imap_8bit" url="function.imap-8bit.php"/>
+<entry name="imap_alerts" url="function.imap-alerts.php"/>
+<entry name="imap_append" url="function.imap-append.php"/>
+<entry name="imap_base64" url="function.imap-base64.php"/>
+<entry name="imap_binary" url="function.imap-binary.php"/>
+<entry name="imap_body" url="function.imap-body.php"/>
+<entry name="imap_bodystruct" url="function.imap-bodystruct.php"/>
+<entry name="imap_check" url="function.imap-check.php"/>
+<entry name="imap_clearflag_full" url="function.imap-clearflag-full.php"/>
+<entry name="imap_close" url="function.imap-close.php"/>
+<entry name="imap_createmailbox" url="function.imap-createmailbox.php"/>
+<entry name="imap_delete" url="function.imap-delete.php"/>
+<entry name="imap_deletemailbox" url="function.imap-deletemailbox.php"/>
+<entry name="imap_errors" url="function.imap-errors.php"/>
+<entry name="imap_expunge" url="function.imap-expunge.php"/>
+<entry name="imap_fetch_overview" url="function.imap-fetch-overview.php"/>
+<entry name="imap_fetchbody" url="function.imap-fetchbody.php"/>
+<entry name="imap_fetchheader" url="function.imap-fetchheader.php"/>
+<entry name="imap_fetchstructure" url="function.imap-fetchstructure.php"/>
+<entry name="imap_get_quota" url="function.imap-get-quota.php"/>
+<entry name="imap_get_quotaroot" url="function.imap-get-quotaroot.php"/>
+<entry name="imap_getacl" url="function.imap-getacl.php"/>
+<entry name="imap_getmailboxes" url="function.imap-getmailboxes.php"/>
+<entry name="imap_getsubscribed" url="function.imap-getsubscribed.php"/>
+<entry name="imap_header" url="function.imap-header.php"/>
+<entry name="imap_headerinfo" url="function.imap-headerinfo.php"/>
+<entry name="imap_headers" url="function.imap-headers.php"/>
+<entry name="imap_last_error" url="function.imap-last-error.php"/>
+<entry name="imap_list" url="function.imap-list.php"/>
+<entry name="imap_listmailbox" url="function.imap-listmailbox.php"/>
+<entry name="imap_listscan" url="function.imap-listscan.php"/>
+<entry name="imap_listsubscribed" url="function.imap-listsubscribed.php"/>
+<entry name="imap_lsub" url="function.imap-lsub.php"/>
+<entry name="imap_mail_compose" url="function.imap-mail-compose.php"/>
+<entry name="imap_mail_copy" url="function.imap-mail-copy.php"/>
+<entry name="imap_mail_move" url="function.imap-mail-move.php"/>
+<entry name="imap_mail" url="function.imap-mail.php"/>
+<entry name="imap_mailboxmsginfo" url="function.imap-mailboxmsginfo.php"/>
+<entry name="imap_mime_header_decode" url="function.imap-mime-header-decode.php"/>
+<entry name="imap_msgno" url="function.imap-msgno.php"/>
+<entry name="imap_num_msg" url="function.imap-num-msg.php"/>
+<entry name="imap_num_recent" url="function.imap-num-recent.php"/>
+<entry name="imap_open" url="function.imap-open.php"/>
+<entry name="imap_ping" url="function.imap-ping.php"/>
+<entry name="imap_qprint" url="function.imap-qprint.php"/>
+<entry name="imap_renamemailbox" url="function.imap-renamemailbox.php"/>
+<entry name="imap_reopen" url="function.imap-reopen.php"/>
+<entry name="imap_rfc822_parse_adrlist" url="function.imap-rfc822-parse-adrlist.php"/>
+<entry name="imap_rfc822_parse_headers" url="function.imap-rfc822-parse-headers.php"/>
+<entry name="imap_rfc822_write_address" url="function.imap-rfc822-write-address.php"/>
+<entry name="imap_savebody" url="function.imap-savebody.php"/>
+<entry name="imap_scanmailbox" url="function.imap-scanmailbox.php"/>
+<entry name="imap_search" url="function.imap-search.php"/>
+<entry name="imap_set_quota" url="function.imap-set-quota.php"/>
+<entry name="imap_setacl" url="function.imap-setacl.php"/>
+<entry name="imap_setflag_full" url="function.imap-setflag-full.php"/>
+<entry name="imap_sort" url="function.imap-sort.php"/>
+<entry name="imap_status" url="function.imap-status.php"/>
+<entry name="imap_subscribe" url="function.imap-subscribe.php"/>
+<entry name="imap_thread" url="function.imap-thread.php"/>
+<entry name="imap_timeout" url="function.imap-timeout.php"/>
+<entry name="imap_uid" url="function.imap-uid.php"/>
+<entry name="imap_undelete" url="function.imap-undelete.php"/>
+<entry name="imap_unsubscribe" url="function.imap-unsubscribe.php"/>
+<entry name="imap_utf7_decode" url="function.imap-utf7-decode.php"/>
+<entry name="imap_utf7_encode" url="function.imap-utf7-encode.php"/>
+<entry name="imap_utf8" url="function.imap-utf8.php"/>
+<entry name="ezmlm_hash" url="function.ezmlm-hash.php"/>
+<entry name="mail" url="function.mail.php"/>
+<entry name="mailparse_determine_best_xfer_encoding" url="function.mailparse-determine-best-xfer-encoding.php"/>
+<entry name="mailparse_msg_create" url="function.mailparse-msg-create.php"/>
+<entry name="mailparse_msg_extract_part_file" url="function.mailparse-msg-extract-part-file.php"/>
+<entry name="mailparse_msg_extract_part" url="function.mailparse-msg-extract-part.php"/>
+<entry name="mailparse_msg_extract_whole_part_file" url="function.mailparse-msg-extract-whole-part-file.php"/>
+<entry name="mailparse_msg_free" url="function.mailparse-msg-free.php"/>
+<entry name="mailparse_msg_get_part_data" url="function.mailparse-msg-get-part-data.php"/>
+<entry name="mailparse_msg_get_part" url="function.mailparse-msg-get-part.php"/>
+<entry name="mailparse_msg_get_structure" url="function.mailparse-msg-get-structure.php"/>
+<entry name="mailparse_msg_parse_file" url="function.mailparse-msg-parse-file.php"/>
+<entry name="mailparse_msg_parse" url="function.mailparse-msg-parse.php"/>
+<entry name="mailparse_rfc822_parse_addresses" url="function.mailparse-rfc822-parse-addresses.php"/>
+<entry name="mailparse_stream_encode" url="function.mailparse-stream-encode.php"/>
+<entry name="mailparse_uudecode_all" url="function.mailparse-uudecode-all.php"/>
+<entry name="vpopmail_add_alias_domain_ex" url="function.vpopmail-add-alias-domain-ex.php"/>
+<entry name="vpopmail_add_alias_domain" url="function.vpopmail-add-alias-domain.php"/>
+<entry name="vpopmail_add_domain_ex" url="function.vpopmail-add-domain-ex.php"/>
+<entry name="vpopmail_add_domain" url="function.vpopmail-add-domain.php"/>
+<entry name="vpopmail_add_user" url="function.vpopmail-add-user.php"/>
+<entry name="vpopmail_alias_add" url="function.vpopmail-alias-add.php"/>
+<entry name="vpopmail_alias_del_domain" url="function.vpopmail-alias-del-domain.php"/>
+<entry name="vpopmail_alias_del" url="function.vpopmail-alias-del.php"/>
+<entry name="vpopmail_alias_get_all" url="function.vpopmail-alias-get-all.php"/>
+<entry name="vpopmail_alias_get" url="function.vpopmail-alias-get.php"/>
+<entry name="vpopmail_auth_user" url="function.vpopmail-auth-user.php"/>
+<entry name="vpopmail_del_domain_ex" url="function.vpopmail-del-domain-ex.php"/>
+<entry name="vpopmail_del_domain" url="function.vpopmail-del-domain.php"/>
+<entry name="vpopmail_del_user" url="function.vpopmail-del-user.php"/>
+<entry name="vpopmail_error" url="function.vpopmail-error.php"/>
+<entry name="vpopmail_passwd" url="function.vpopmail-passwd.php"/>
+<entry name="vpopmail_set_user_quota" url="function.vpopmail-set-user-quota.php"/>
+<entry name="bcadd" url="function.bcadd.php"/>
+<entry name="bccomp" url="function.bccomp.php"/>
+<entry name="bcdiv" url="function.bcdiv.php"/>
+<entry name="bcmod" url="function.bcmod.php"/>
+<entry name="bcmul" url="function.bcmul.php"/>
+<entry name="bcpow" url="function.bcpow.php"/>
+<entry name="bcpowmod" url="function.bcpowmod.php"/>
+<entry name="bcscale" url="function.bcscale.php"/>
+<entry name="bcsqrt" url="function.bcsqrt.php"/>
+<entry name="bcsub" url="function.bcsub.php"/>
+<entry name="gmp_abs" url="function.gmp-abs.php"/>
+<entry name="gmp_add" url="function.gmp-add.php"/>
+<entry name="gmp_and" url="function.gmp-and.php"/>
+<entry name="gmp_clrbit" url="function.gmp-clrbit.php"/>
+<entry name="gmp_cmp" url="function.gmp-cmp.php"/>
+<entry name="gmp_com" url="function.gmp-com.php"/>
+<entry name="gmp_div_q" url="function.gmp-div-q.php"/>
+<entry name="gmp_div_qr" url="function.gmp-div-qr.php"/>
+<entry name="gmp_div_r" url="function.gmp-div-r.php"/>
+<entry name="gmp_div" url="function.gmp-div.php"/>
+<entry name="gmp_divexact" url="function.gmp-divexact.php"/>
+<entry name="gmp_fact" url="function.gmp-fact.php"/>
+<entry name="gmp_gcd" url="function.gmp-gcd.php"/>
+<entry name="gmp_gcdext" url="function.gmp-gcdext.php"/>
+<entry name="gmp_hamdist" url="function.gmp-hamdist.php"/>
+<entry name="gmp_init" url="function.gmp-init.php"/>
+<entry name="gmp_intval" url="function.gmp-intval.php"/>
+<entry name="gmp_invert" url="function.gmp-invert.php"/>
+<entry name="gmp_jacobi" url="function.gmp-jacobi.php"/>
+<entry name="gmp_legendre" url="function.gmp-legendre.php"/>
+<entry name="gmp_mod" url="function.gmp-mod.php"/>
+<entry name="gmp_mul" url="function.gmp-mul.php"/>
+<entry name="gmp_neg" url="function.gmp-neg.php"/>
+<entry name="gmp_nextprime" url="function.gmp-nextprime.php"/>
+<entry name="gmp_or" url="function.gmp-or.php"/>
+<entry name="gmp_perfect_square" url="function.gmp-perfect-square.php"/>
+<entry name="gmp_popcount" url="function.gmp-popcount.php"/>
+<entry name="gmp_pow" url="function.gmp-pow.php"/>
+<entry name="gmp_powm" url="function.gmp-powm.php"/>
+<entry name="gmp_prob_prime" url="function.gmp-prob-prime.php"/>
+<entry name="gmp_random" url="function.gmp-random.php"/>
+<entry name="gmp_scan0" url="function.gmp-scan0.php"/>
+<entry name="gmp_scan1" url="function.gmp-scan1.php"/>
+<entry name="gmp_setbit" url="function.gmp-setbit.php"/>
+<entry name="gmp_sign" url="function.gmp-sign.php"/>
+<entry name="gmp_sqrt" url="function.gmp-sqrt.php"/>
+<entry name="gmp_sqrtrem" url="function.gmp-sqrtrem.php"/>
+<entry name="gmp_strval" url="function.gmp-strval.php"/>
+<entry name="gmp_sub" url="function.gmp-sub.php"/>
+<entry name="gmp_testbit" url="function.gmp-testbit.php"/>
+<entry name="gmp_xor" url="function.gmp-xor.php"/>
+<entry name="abs" url="function.abs.php"/>
+<entry name="acos" url="function.acos.php"/>
+<entry name="acosh" url="function.acosh.php"/>
+<entry name="asin" url="function.asin.php"/>
+<entry name="asinh" url="function.asinh.php"/>
+<entry name="atan2" url="function.atan2.php"/>
+<entry name="atan" url="function.atan.php"/>
+<entry name="atanh" url="function.atanh.php"/>
+<entry name="base_convert" url="function.base-convert.php"/>
+<entry name="bindec" url="function.bindec.php"/>
+<entry name="ceil" url="function.ceil.php"/>
+<entry name="cos" url="function.cos.php"/>
+<entry name="cosh" url="function.cosh.php"/>
+<entry name="decbin" url="function.decbin.php"/>
+<entry name="dechex" url="function.dechex.php"/>
+<entry name="decoct" url="function.decoct.php"/>
+<entry name="deg2rad" url="function.deg2rad.php"/>
+<entry name="exp" url="function.exp.php"/>
+<entry name="expm1" url="function.expm1.php"/>
+<entry name="floor" url="function.floor.php"/>
+<entry name="fmod" url="function.fmod.php"/>
+<entry name="getrandmax" url="function.getrandmax.php"/>
+<entry name="hexdec" url="function.hexdec.php"/>
+<entry name="hypot" url="function.hypot.php"/>
+<entry name="is_finite" url="function.is-finite.php"/>
+<entry name="is_infinite" url="function.is-infinite.php"/>
+<entry name="is_nan" url="function.is-nan.php"/>
+<entry name="lcg_value" url="function.lcg-value.php"/>
+<entry name="log10" url="function.log10.php"/>
+<entry name="log1p" url="function.log1p.php"/>
+<entry name="log" url="function.log.php"/>
+<entry name="max" url="function.max.php"/>
+<entry name="min" url="function.min.php"/>
+<entry name="mt_getrandmax" url="function.mt-getrandmax.php"/>
+<entry name="mt_rand" url="function.mt-rand.php"/>
+<entry name="mt_srand" url="function.mt-srand.php"/>
+<entry name="octdec" url="function.octdec.php"/>
+<entry name="pi" url="function.pi.php"/>
+<entry name="pow" url="function.pow.php"/>
+<entry name="rad2deg" url="function.rad2deg.php"/>
+<entry name="rand" url="function.rand.php"/>
+<entry name="round" url="function.round.php"/>
+<entry name="sin" url="function.sin.php"/>
+<entry name="sinh" url="function.sinh.php"/>
+<entry name="sqrt" url="function.sqrt.php"/>
+<entry name="srand" url="function.srand.php"/>
+<entry name="tan" url="function.tan.php"/>
+<entry name="tanh" url="function.tanh.php"/>
+<entry name="stats_absolute_deviation" url="function.stats-absolute-deviation.php"/>
+<entry name="stats_cdf_beta" url="function.stats-cdf-beta.php"/>
+<entry name="stats_cdf_binomial" url="function.stats-cdf-binomial.php"/>
+<entry name="stats_cdf_cauchy" url="function.stats-cdf-cauchy.php"/>
+<entry name="stats_cdf_chisquare" url="function.stats-cdf-chisquare.php"/>
+<entry name="stats_cdf_exponential" url="function.stats-cdf-exponential.php"/>
+<entry name="stats_cdf_f" url="function.stats-cdf-f.php"/>
+<entry name="stats_cdf_gamma" url="function.stats-cdf-gamma.php"/>
+<entry name="stats_cdf_laplace" url="function.stats-cdf-laplace.php"/>
+<entry name="stats_cdf_logistic" url="function.stats-cdf-logistic.php"/>
+<entry name="stats_cdf_negative_binomial" url="function.stats-cdf-negative-binomial.php"/>
+<entry name="stats_cdf_noncentral_chisquare" url="function.stats-cdf-noncentral-chisquare.php"/>
+<entry name="stats_cdf_noncentral_f" url="function.stats-cdf-noncentral-f.php"/>
+<entry name="stats_cdf_poisson" url="function.stats-cdf-poisson.php"/>
+<entry name="stats_cdf_t" url="function.stats-cdf-t.php"/>
+<entry name="stats_cdf_uniform" url="function.stats-cdf-uniform.php"/>
+<entry name="stats_cdf_weibull" url="function.stats-cdf-weibull.php"/>
+<entry name="stats_covariance" url="function.stats-covariance.php"/>
+<entry name="stats_den_uniform" url="function.stats-den-uniform.php"/>
+<entry name="stats_dens_beta" url="function.stats-dens-beta.php"/>
+<entry name="stats_dens_cauchy" url="function.stats-dens-cauchy.php"/>
+<entry name="stats_dens_chisquare" url="function.stats-dens-chisquare.php"/>
+<entry name="stats_dens_exponential" url="function.stats-dens-exponential.php"/>
+<entry name="stats_dens_f" url="function.stats-dens-f.php"/>
+<entry name="stats_dens_gamma" url="function.stats-dens-gamma.php"/>
+<entry name="stats_dens_laplace" url="function.stats-dens-laplace.php"/>
+<entry name="stats_dens_logistic" url="function.stats-dens-logistic.php"/>
+<entry name="stats_dens_negative_binomial" url="function.stats-dens-negative-binomial.php"/>
+<entry name="stats_dens_normal" url="function.stats-dens-normal.php"/>
+<entry name="stats_dens_pmf_binomial" url="function.stats-dens-pmf-binomial.php"/>
+<entry name="stats_dens_pmf_hypergeometric" url="function.stats-dens-pmf-hypergeometric.php"/>
+<entry name="stats_dens_pmf_poisson" url="function.stats-dens-pmf-poisson.php"/>
+<entry name="stats_dens_t" url="function.stats-dens-t.php"/>
+<entry name="stats_dens_weibull" url="function.stats-dens-weibull.php"/>
+<entry name="stats_harmonic_mean" url="function.stats-harmonic-mean.php"/>
+<entry name="stats_kurtosis" url="function.stats-kurtosis.php"/>
+<entry name="stats_rand_gen_beta" url="function.stats-rand-gen-beta.php"/>
+<entry name="stats_rand_gen_chisquare" url="function.stats-rand-gen-chisquare.php"/>
+<entry name="stats_rand_gen_exponential" url="function.stats-rand-gen-exponential.php"/>
+<entry name="stats_rand_gen_f" url="function.stats-rand-gen-f.php"/>
+<entry name="stats_rand_gen_funiform" url="function.stats-rand-gen-funiform.php"/>
+<entry name="stats_rand_gen_gamma" url="function.stats-rand-gen-gamma.php"/>
+<entry name="stats_rand_gen_ibinomial_negative" url="function.stats-rand-gen-ibinomial-negative.php"/>
+<entry name="stats_rand_gen_ibinomial" url="function.stats-rand-gen-ibinomial.php"/>
+<entry name="stats_rand_gen_int" url="function.stats-rand-gen-int.php"/>
+<entry name="stats_rand_gen_ipoisson" url="function.stats-rand-gen-ipoisson.php"/>
+<entry name="stats_rand_gen_iuniform" url="function.stats-rand-gen-iuniform.php"/>
+<entry name="stats_rand_gen_noncenral_chisquare" url="function.stats-rand-gen-noncenral-chisquare.php"/>
+<entry name="stats_rand_gen_noncentral_f" url="function.stats-rand-gen-noncentral-f.php"/>
+<entry name="stats_rand_gen_noncentral_t" url="function.stats-rand-gen-noncentral-t.php"/>
+<entry name="stats_rand_gen_normal" url="function.stats-rand-gen-normal.php"/>
+<entry name="stats_rand_gen_t" url="function.stats-rand-gen-t.php"/>
+<entry name="stats_rand_get_seeds" url="function.stats-rand-get-seeds.php"/>
+<entry name="stats_rand_phrase_to_seeds" url="function.stats-rand-phrase-to-seeds.php"/>
+<entry name="stats_rand_ranf" url="function.stats-rand-ranf.php"/>
+<entry name="stats_rand_setall" url="function.stats-rand-setall.php"/>
+<entry name="stats_skew" url="function.stats-skew.php"/>
+<entry name="stats_standard_deviation" url="function.stats-standard-deviation.php"/>
+<entry name="stats_stat_binomial_coef" url="function.stats-stat-binomial-coef.php"/>
+<entry name="stats_stat_correlation" url="function.stats-stat-correlation.php"/>
+<entry name="stats_stat_gennch" url="function.stats-stat-gennch.php"/>
+<entry name="stats_stat_independent_t" url="function.stats-stat-independent-t.php"/>
+<entry name="stats_stat_innerproduct" url="function.stats-stat-innerproduct.php"/>
+<entry name="stats_stat_noncentral_t" url="function.stats-stat-noncentral-t.php"/>
+<entry name="stats_stat_paired_t" url="function.stats-stat-paired-t.php"/>
+<entry name="stats_stat_percentile" url="function.stats-stat-percentile.php"/>
+<entry name="stats_stat_powersum" url="function.stats-stat-powersum.php"/>
+<entry name="stats_variance" url="function.stats-variance.php"/>
+<entry name="fdf_add_doc_javascript" url="function.fdf-add-doc-javascript.php"/>
+<entry name="fdf_add_template" url="function.fdf-add-template.php"/>
+<entry name="fdf_close" url="function.fdf-close.php"/>
+<entry name="fdf_create" url="function.fdf-create.php"/>
+<entry name="fdf_enum_values" url="function.fdf-enum-values.php"/>
+<entry name="fdf_errno" url="function.fdf-errno.php"/>
+<entry name="fdf_error" url="function.fdf-error.php"/>
+<entry name="fdf_get_ap" url="function.fdf-get-ap.php"/>
+<entry name="fdf_get_attachment" url="function.fdf-get-attachment.php"/>
+<entry name="fdf_get_encoding" url="function.fdf-get-encoding.php"/>
+<entry name="fdf_get_file" url="function.fdf-get-file.php"/>
+<entry name="fdf_get_flags" url="function.fdf-get-flags.php"/>
+<entry name="fdf_get_opt" url="function.fdf-get-opt.php"/>
+<entry name="fdf_get_status" url="function.fdf-get-status.php"/>
+<entry name="fdf_get_value" url="function.fdf-get-value.php"/>
+<entry name="fdf_get_version" url="function.fdf-get-version.php"/>
+<entry name="fdf_header" url="function.fdf-header.php"/>
+<entry name="fdf_next_field_name" url="function.fdf-next-field-name.php"/>
+<entry name="fdf_open_string" url="function.fdf-open-string.php"/>
+<entry name="fdf_open" url="function.fdf-open.php"/>
+<entry name="fdf_remove_item" url="function.fdf-remove-item.php"/>
+<entry name="fdf_save_string" url="function.fdf-save-string.php"/>
+<entry name="fdf_save" url="function.fdf-save.php"/>
+<entry name="fdf_set_ap" url="function.fdf-set-ap.php"/>
+<entry name="fdf_set_encoding" url="function.fdf-set-encoding.php"/>
+<entry name="fdf_set_file" url="function.fdf-set-file.php"/>
+<entry name="fdf_set_flags" url="function.fdf-set-flags.php"/>
+<entry name="fdf_set_javascript_action" url="function.fdf-set-javascript-action.php"/>
+<entry name="fdf_set_on_import_javascript" url="function.fdf-set-on-import-javascript.php"/>
+<entry name="fdf_set_opt" url="function.fdf-set-opt.php"/>
+<entry name="fdf_set_status" url="function.fdf-set-status.php"/>
+<entry name="fdf_set_submit_form_action" url="function.fdf-set-submit-form-action.php"/>
+<entry name="fdf_set_target_frame" url="function.fdf-set-target-frame.php"/>
+<entry name="fdf_set_value" url="function.fdf-set-value.php"/>
+<entry name="fdf_set_version" url="function.fdf-set-version.php"/>
+<entry name="gnupg_adddecryptkey" url="function.gnupg-adddecryptkey.php"/>
+<entry name="gnupg_addencryptkey" url="function.gnupg-addencryptkey.php"/>
+<entry name="gnupg_addsignkey" url="function.gnupg-addsignkey.php"/>
+<entry name="gnupg_cleardecryptkeys" url="function.gnupg-cleardecryptkeys.php"/>
+<entry name="gnupg_clearencryptkeys" url="function.gnupg-clearencryptkeys.php"/>
+<entry name="gnupg_clearsignkeys" url="function.gnupg-clearsignkeys.php"/>
+<entry name="gnupg_decrypt" url="function.gnupg-decrypt.php"/>
+<entry name="gnupg_decryptverify" url="function.gnupg-decryptverify.php"/>
+<entry name="gnupg_encrypt" url="function.gnupg-encrypt.php"/>
+<entry name="gnupg_encryptsign" url="function.gnupg-encryptsign.php"/>
+<entry name="gnupg_export" url="function.gnupg-export.php"/>
+<entry name="gnupg_geterror" url="function.gnupg-geterror.php"/>
+<entry name="gnupg_getprotocol" url="function.gnupg-getprotocol.php"/>
+<entry name="gnupg_import" url="function.gnupg-import.php"/>
+<entry name="gnupg_init" url="function.gnupg-init.php"/>
+<entry name="gnupg_keyinfo" url="function.gnupg-keyinfo.php"/>
+<entry name="gnupg_setarmor" url="function.gnupg-setarmor.php"/>
+<entry name="gnupg_seterrormode" url="function.gnupg-seterrormode.php"/>
+<entry name="gnupg_setsignmode" url="function.gnupg-setsignmode.php"/>
+<entry name="gnupg_sign" url="function.gnupg-sign.php"/>
+<entry name="gnupg_verify" url="function.gnupg-verify.php"/>
+<entry name="HaruDoc::addPage" url="function.harudoc-addpage.php"/>
+<entry name="HaruDoc::addPageLabel" url="function.harudoc-addpagelabel.php"/>
+<entry name="HaruDoc::__construct" url="function.harudoc-construct.php"/>
+<entry name="HaruDoc::createOutline" url="function.harudoc-createoutline.php"/>
+<entry name="HaruDoc::getCurrentEncoder" url="function.harudoc-getcurrentencoder.php"/>
+<entry name="HaruDoc::getCurrentPage" url="function.harudoc-getcurrentpage.php"/>
+<entry name="HaruDoc::getEncoder" url="function.harudoc-getencoder.php"/>
+<entry name="HaruDoc::getFont" url="function.harudoc-getfont.php"/>
+<entry name="HaruDoc::getInfoAttr" url="function.harudoc-getinfoattr.php"/>
+<entry name="HaruDoc::getPageLayout" url="function.harudoc-getpagelayout.php"/>
+<entry name="HaruDoc::getPageMode" url="function.harudoc-getpagemode.php"/>
+<entry name="HaruDoc::getStreamSize" url="function.harudoc-getstreamsize.php"/>
+<entry name="HaruDoc::insertPage" url="function.harudoc-insertpage.php"/>
+<entry name="HaruDoc::loadJPEG" url="function.harudoc-loadjpeg.php"/>
+<entry name="HaruDoc::loadPNG" url="function.harudoc-loadpng.php"/>
+<entry name="HaruDoc::loadRaw" url="function.harudoc-loadraw.php"/>
+<entry name="HaruDoc::loadTTC" url="function.harudoc-loadttc.php"/>
+<entry name="HaruDoc::loadTTF" url="function.harudoc-loadttf.php"/>
+<entry name="HaruDoc::loadType1" url="function.harudoc-loadtype1.php"/>
+<entry name="HaruDoc::output" url="function.harudoc-output.php"/>
+<entry name="HaruDoc::readFromStream" url="function.harudoc-readfromstream.php"/>
+<entry name="HaruDoc::resetError" url="function.harudoc-reseterror.php"/>
+<entry name="HaruDoc::resetStream" url="function.harudoc-resetstream.php"/>
+<entry name="HaruDoc::save" url="function.harudoc-save.php"/>
+<entry name="HaruDoc::saveToStream" url="function.harudoc-savetostream.php"/>
+<entry name="HaruDoc::setCompressionMode" url="function.harudoc-setcompressionmode.php"/>
+<entry name="HaruDoc::setCurrentEncoder" url="function.harudoc-setcurrentencoder.php"/>
+<entry name="HaruDoc::setEncryptionMode" url="function.harudoc-setencryptionmode.php"/>
+<entry name="HaruDoc::setInfoAttr" url="function.harudoc-setinfoattr.php"/>
+<entry name="HaruDoc::setInfoDateAttr" url="function.harudoc-setinfodateattr.php"/>
+<entry name="HaruDoc::setOpenAction" url="function.harudoc-setopenaction.php"/>
+<entry name="HaruDoc::setPageLayout" url="function.harudoc-setpagelayout.php"/>
+<entry name="HaruDoc::setPageMode" url="function.harudoc-setpagemode.php"/>
+<entry name="HaruDoc::setPagesConfiguration" url="function.harudoc-setpagesconfiguration.php"/>
+<entry name="HaruDoc::setPassword" url="function.harudoc-setpassword.php"/>
+<entry name="HaruDoc::setPermission" url="function.harudoc-setpermission.php"/>
+<entry name="HaruDoc::useCNSEncodings" url="function.harudoc-usecnsencodings.php"/>
+<entry name="HaruDoc::useCNSFonts" url="function.harudoc-usecnsfonts.php"/>
+<entry name="HaruDoc::useCNTEncodings" url="function.harudoc-usecntencodings.php"/>
+<entry name="HaruDoc::useCNTFonts" url="function.harudoc-usecntfonts.php"/>
+<entry name="HaruDoc::useJPEncodings" url="function.harudoc-usejpencodings.php"/>
+<entry name="HaruDoc::useJPFonts" url="function.harudoc-usejpfonts.php"/>
+<entry name="HaruDoc::useKREncodings" url="function.harudoc-usekrencodings.php"/>
+<entry name="HaruDoc::useKRFonts" url="function.harudoc-usekrfonts.php"/>
+<entry name="HaruPage::arc" url="function.harupage-arc.php"/>
+<entry name="HaruPage::beginText" url="function.harupage-begintext.php"/>
+<entry name="HaruPage::circle" url="function.harupage-circle.php"/>
+<entry name="HaruPage::closePath" url="function.harupage-closepath.php"/>
+<entry name="HaruPage::concat" url="function.harupage-concat.php"/>
+<entry name="HaruPage::createDestination" url="function.harupage-createdestination.php"/>
+<entry name="HaruPage::createLinkAnnotation" url="function.harupage-createlinkannotation.php"/>
+<entry name="HaruPage::createTextAnnotation" url="function.harupage-createtextannotation.php"/>
+<entry name="HaruPage::createURLAnnotation" url="function.harupage-createurlannotation.php"/>
+<entry name="HaruPage::curveTo2" url="function.harupage-curveto2.php"/>
+<entry name="HaruPage::curveTo3" url="function.harupage-curveto3.php"/>
+<entry name="HaruPage::curveTo" url="function.harupage-curveto.php"/>
+<entry name="HaruPage::drawImage" url="function.harupage-drawimage.php"/>
+<entry name="HaruPage::ellipse" url="function.harupage-ellipse.php"/>
+<entry name="HaruPage::endPath" url="function.harupage-endpath.php"/>
+<entry name="HaruPage::endText" url="function.harupage-endtext.php"/>
+<entry name="HaruPage::eofill" url="function.harupage-eofill.php"/>
+<entry name="HaruPage::eoFillStroke" url="function.harupage-eofillstroke.php"/>
+<entry name="HaruPage::fill" url="function.harupage-fill.php"/>
+<entry name="HaruPage::fillStroke" url="function.harupage-fillstroke.php"/>
+<entry name="HaruPage::getCharSpace" url="function.harupage-getcharspace.php"/>
+<entry name="HaruPage::getCMYKFill" url="function.harupage-getcmykfill.php"/>
+<entry name="HaruPage::getCMYKStroke" url="function.harupage-getcmykstroke.php"/>
+<entry name="HaruPage::getCurrentFont" url="function.harupage-getcurrentfont.php"/>
+<entry name="HaruPage::getCurrentFontSize" url="function.harupage-getcurrentfontsize.php"/>
+<entry name="HaruPage::getCurrentPos" url="function.harupage-getcurrentpos.php"/>
+<entry name="HaruPage::getCurrentTextPos" url="function.harupage-getcurrenttextpos.php"/>
+<entry name="HaruPage::getDash" url="function.harupage-getdash.php"/>
+<entry name="HaruPage::getFillingColorSpace" url="function.harupage-getfillingcolorspace.php"/>
+<entry name="HaruPage::getFlatness" url="function.harupage-getflatness.php"/>
+<entry name="HaruPage::getGMode" url="function.harupage-getgmode.php"/>
+<entry name="HaruPage::getGrayFill" url="function.harupage-getgrayfill.php"/>
+<entry name="HaruPage::getGrayStroke" url="function.harupage-getgraystroke.php"/>
+<entry name="HaruPage::getHeight" url="function.harupage-getheight.php"/>
+<entry name="HaruPage::getHorizontalScaling" url="function.harupage-gethorizontalscaling.php"/>
+<entry name="HaruPage::getLineCap" url="function.harupage-getlinecap.php"/>
+<entry name="HaruPage::getLineJoin" url="function.harupage-getlinejoin.php"/>
+<entry name="HaruPage::getLineWidth" url="function.harupage-getlinewidth.php"/>
+<entry name="HaruPage::getMiterLimit" url="function.harupage-getmiterlimit.php"/>
+<entry name="HaruPage::getRGBFill" url="function.harupage-getrgbfill.php"/>
+<entry name="HaruPage::getRGBStroke" url="function.harupage-getrgbstroke.php"/>
+<entry name="HaruPage::getStrokingColorSpace" url="function.harupage-getstrokingcolorspace.php"/>
+<entry name="HaruPage::getTextLeading" url="function.harupage-gettextleading.php"/>
+<entry name="HaruPage::getTextMatrix" url="function.harupage-gettextmatrix.php"/>
+<entry name="HaruPage::getTextRenderingMode" url="function.harupage-gettextrenderingmode.php"/>
+<entry name="HaruPage::getTextRise" url="function.harupage-gettextrise.php"/>
+<entry name="HaruPage::getTextWidth" url="function.harupage-gettextwidth.php"/>
+<entry name="HaruPage::getTransMatrix" url="function.harupage-gettransmatrix.php"/>
+<entry name="HaruPage::getWidth" url="function.harupage-getwidth.php"/>
+<entry name="HaruPage::getWordSpace" url="function.harupage-getwordspace.php"/>
+<entry name="HaruPage::lineTo" url="function.harupage-lineto.php"/>
+<entry name="HaruPage::measureText" url="function.harupage-measuretext.php"/>
+<entry name="HaruPage::moveTextPos" url="function.harupage-movetextpos.php"/>
+<entry name="HaruPage::moveTo" url="function.harupage-moveto.php"/>
+<entry name="HaruPage::moveToNextLine" url="function.harupage-movetonextline.php"/>
+<entry name="HaruPage::rectangle" url="function.harupage-rectangle.php"/>
+<entry name="HaruPage::setCharSpace" url="function.harupage-setcharspace.php"/>
+<entry name="HaruPage::setCMYKFill" url="function.harupage-setcmykfill.php"/>
+<entry name="HaruPage::setCMYKStroke" url="function.harupage-setcmykstroke.php"/>
+<entry name="HaruPage::setDash" url="function.harupage-setdash.php"/>
+<entry name="HaruPage::setFlatness" url="function.harupage-setflatness.php"/>
+<entry name="HaruPage::setFontAndSize" url="function.harupage-setfontandsize.php"/>
+<entry name="HaruPage::setGrayFill" url="function.harupage-setgrayfill.php"/>
+<entry name="HaruPage::setGrayStroke" url="function.harupage-setgraystroke.php"/>
+<entry name="HaruPage::setHeight" url="function.harupage-setheight.php"/>
+<entry name="HaruPage::setHorizontalScaling" url="function.harupage-sethorizontalscaling.php"/>
+<entry name="HaruPage::setLineCap" url="function.harupage-setlinecap.php"/>
+<entry name="HaruPage::setLineJoin" url="function.harupage-setlinejoin.php"/>
+<entry name="HaruPage::setLineWidth" url="function.harupage-setlinewidth.php"/>
+<entry name="HaruPage::setMiterLimit" url="function.harupage-setmiterlimit.php"/>
+<entry name="HaruPage::setRGBFill" url="function.harupage-setrgbfill.php"/>
+<entry name="HaruPage::setRGBStroke" url="function.harupage-setrgbstroke.php"/>
+<entry name="HaruPage::setRotate" url="function.harupage-setrotate.php"/>
+<entry name="HaruPage::setSize" url="function.harupage-setsize.php"/>
+<entry name="HaruPage::setSlideShow" url="function.harupage-setslideshow.php"/>
+<entry name="HaruPage::setTextLeading" url="function.harupage-settextleading.php"/>
+<entry name="HaruPage::setTextMatrix" url="function.harupage-settextmatrix.php"/>
+<entry name="HaruPage::setTextRenderingMode" url="function.harupage-settextrenderingmode.php"/>
+<entry name="HaruPage::setTextRise" url="function.harupage-settextrise.php"/>
+<entry name="HaruPage::setWidth" url="function.harupage-setwidth.php"/>
+<entry name="HaruPage::setWordSpace" url="function.harupage-setwordspace.php"/>
+<entry name="HaruPage::showText" url="function.harupage-showtext.php"/>
+<entry name="HaruPage::showTextNextLine" url="function.harupage-showtextnextline.php"/>
+<entry name="HaruPage::stroke" url="function.harupage-stroke.php"/>
+<entry name="HaruPage::textOut" url="function.harupage-textout.php"/>
+<entry name="HaruPage::textRect" url="function.harupage-textrect.php"/>
+<entry name="HaruFont::getAscent" url="function.harufont-getascent.php"/>
+<entry name="HaruFont::getCapHeight" url="function.harufont-getcapheight.php"/>
+<entry name="HaruFont::getDescent" url="function.harufont-getdescent.php"/>
+<entry name="HaruFont::getEncodingName" url="function.harufont-getencodingname.php"/>
+<entry name="HaruFont::getFontName" url="function.harufont-getfontname.php"/>
+<entry name="HaruFont::getTextWidth" url="function.harufont-gettextwidth.php"/>
+<entry name="HaruFont::getUnicodeWidth" url="function.harufont-getunicodewidth.php"/>
+<entry name="HaruFont::getXHeight" url="function.harufont-getxheight.php"/>
+<entry name="HaruFont::measureText" url="function.harufont-measuretext.php"/>
+<entry name="HaruImage::getBitsPerComponent" url="function.haruimage-getbitspercomponent.php"/>
+<entry name="HaruImage::getColorSpace" url="function.haruimage-getcolorspace.php"/>
+<entry name="HaruImage::getHeight" url="function.haruimage-getheight.php"/>
+<entry name="HaruImage::getSize" url="function.haruimage-getsize.php"/>
+<entry name="HaruImage::getWidth" url="function.haruimage-getwidth.php"/>
+<entry name="HaruImage::setColorMask" url="function.haruimage-setcolormask.php"/>
+<entry name="HaruImage::setMaskImage" url="function.haruimage-setmaskimage.php"/>
+<entry name="HaruEncoder::getByteType" url="function.haruencoder-getbytetype.php"/>
+<entry name="HaruEncoder::getType" url="function.haruencoder-gettype.php"/>
+<entry name="HaruEncoder::getUnicode" url="function.haruencoder-getunicode.php"/>
+<entry name="HaruEncoder::getWritingMode" url="function.haruencoder-getwritingmode.php"/>
+<entry name="HaruOutline::setDestination" url="function.haruoutline-setdestination.php"/>
+<entry name="HaruOutline::setOpened" url="function.haruoutline-setopened.php"/>
+<entry name="HaruAnnotation::setBorderStyle" url="function.haruannotation-setborderstyle.php"/>
+<entry name="HaruAnnotation::setHighlightMode" url="function.haruannotation-sethighlightmode.php"/>
+<entry name="HaruAnnotation::setIcon" url="function.haruannotation-seticon.php"/>
+<entry name="HaruAnnotation::setOpened" url="function.haruannotation-setopened.php"/>
+<entry name="HaruDestination::setFit" url="function.harudestination-setfit.php"/>
+<entry name="HaruDestination::setFitB" url="function.harudestination-setfitb.php"/>
+<entry name="HaruDestination::setFitBH" url="function.harudestination-setfitbh.php"/>
+<entry name="HaruDestination::setFitBV" url="function.harudestination-setfitbv.php"/>
+<entry name="HaruDestination::setFitH" url="function.harudestination-setfith.php"/>
+<entry name="HaruDestination::setFitR" url="function.harudestination-setfitr.php"/>
+<entry name="HaruDestination::setFitV" url="function.harudestination-setfitv.php"/>
+<entry name="HaruDestination::setXYZ" url="function.harudestination-setxyz.php"/>
+<entry name="ming_keypress" url="function.ming-keypress.php"/>
+<entry name="ming_setcubicthreshold" url="function.ming-setcubicthreshold.php"/>
+<entry name="ming_setscale" url="function.ming-setscale.php"/>
+<entry name="ming_setswfcompression" url="function.ming-setswfcompression.php"/>
+<entry name="ming_useconstants" url="function.ming-useconstants.php"/>
+<entry name="ming_useswfversion" url="function.ming-useswfversion.php"/>
+<entry name="SWFAction->__construct()" url="function.swfaction.construct.php"/>
+<entry name="SWFBitmap->__construct()" url="function.swfbitmap.construct.php"/>
+<entry name="SWFBitmap->getHeight()" url="function.swfbitmap.getheight.php"/>
+<entry name="SWFBitmap->getWidth()" url="function.swfbitmap.getwidth.php"/>
+<entry name="SWFButton->addAction()" url="function.swfbutton.addaction.php"/>
+<entry name="SWFButton->addASound()" url="function.swfbutton.addasound.php"/>
+<entry name="SWFButton->addShape()" url="function.swfbutton.addshape.php"/>
+<entry name="SWFButton->__construct()" url="function.swfbutton.construct.php"/>
+<entry name="SWFButton->setAction()" url="function.swfbutton.setaction.php"/>
+<entry name="SWFButton->setDown()" url="function.swfbutton.setdown.php"/>
+<entry name="SWFButton->setHit()" url="function.swfbutton.sethit.php"/>
+<entry name="SWFButton->setMenu()" url="function.swfbutton.setmenu.php"/>
+<entry name="SWFButton->setOver()" url="function.swfbutton.setover.php"/>
+<entry name="SWFButton->setUp()" url="function.swfbutton.setup.php"/>
+<entry name="SWFDisplayItem->addAction()" url="function.swfdisplayitem.addaction.php"/>
+<entry name="SWFDisplayItem->addColor()" url="function.swfdisplayitem.addcolor.php"/>
+<entry name="SWFDisplayItem->endMask()" url="function.swfdisplayitem.endmask.php"/>
+<entry name="SWFDisplayItem->getRot()" url="function.swfdisplayitem.getrot.php"/>
+<entry name="SWFDisplayItem->getX()" url="function.swfdisplayitem.getx.php"/>
+<entry name="SWFDisplayItem->getXScale()" url="function.swfdisplayitem.getxscale.php"/>
+<entry name="SWFDisplayItem->getXSkew()" url="function.swfdisplayitem.getxskew.php"/>
+<entry name="SWFDisplayItem->getY()" url="function.swfdisplayitem.gety.php"/>
+<entry name="SWFDisplayItem->getYScale()" url="function.swfdisplayitem.getyscale.php"/>
+<entry name="SWFDisplayItem->getYSkew()" url="function.swfdisplayitem.getyskew.php"/>
+<entry name="SWFDisplayItem->move()" url="function.swfdisplayitem.move.php"/>
+<entry name="SWFDisplayItem->moveTo()" url="function.swfdisplayitem.moveto.php"/>
+<entry name="SWFDisplayItem->multColor()" url="function.swfdisplayitem.multcolor.php"/>
+<entry name="SWFDisplayItem->remove()" url="function.swfdisplayitem.remove.php"/>
+<entry name="SWFDisplayItem->rotate()" url="function.swfdisplayitem.rotate.php"/>
+<entry name="SWFDisplayItem->rotateTo()" url="function.swfdisplayitem.rotateto.php"/>
+<entry name="SWFDisplayItem->scale()" url="function.swfdisplayitem.scale.php"/>
+<entry name="SWFDisplayItem->scaleTo()" url="function.swfdisplayitem.scaleto.php"/>
+<entry name="SWFDisplayItem->setDepth()" url="function.swfdisplayitem.setdepth.php"/>
+<entry name="SWFDisplayItem->setMaskLevel()" url="function.swfdisplayitem.setmasklevel.php"/>
+<entry name="SWFDisplayItem->setMatrix()" url="function.swfdisplayitem.setmatrix.php"/>
+<entry name="SWFDisplayItem->setName()" url="function.swfdisplayitem.setname.php"/>
+<entry name="SWFDisplayItem->setRatio()" url="function.swfdisplayitem.setratio.php"/>
+<entry name="SWFDisplayItem->skewX()" url="function.swfdisplayitem.skewx.php"/>
+<entry name="SWFDisplayItem->skewXTo()" url="function.swfdisplayitem.skewxto.php"/>
+<entry name="SWFDisplayItem->skewY()" url="function.swfdisplayitem.skewy.php"/>
+<entry name="SWFDisplayItem->skewYTo()" url="function.swfdisplayitem.skewyto.php"/>
+<entry name="SWFFill->moveTo()" url="function.swffill.moveto.php"/>
+<entry name="SWFFill->rotateTo()" url="function.swffill.rotateto.php"/>
+<entry name="SWFFill->scaleTo()" url="function.swffill.scaleto.php"/>
+<entry name="SWFFill->skewXTo()" url="function.swffill.skewxto.php"/>
+<entry name="SWFFill->skewYTo()" url="function.swffill.skewyto.php"/>
+<entry name="SWFFont->__construct()" url="function.swffont.construct.php"/>
+<entry name="SWFFont->getAscent()" url="function.swffont.getascent.php"/>
+<entry name="SWFFont->getDescent()" url="function.swffont.getdescent.php"/>
+<entry name="SWFFont->getLeading()" url="function.swffont.getleading.php"/>
+<entry name="SWFFont->getShape()" url="function.swffont.getshape.php"/>
+<entry name="SWFFont->getUTF8Width()" url="function.swffont.getutf8width.php"/>
+<entry name="SWFFont->getWidth()" url="function.swffont.getwidth.php"/>
+<entry name="SWFFontChar->addChars()" url="function.swffontchar.addchars.php"/>
+<entry name="SWFFontChar->addUTF8Chars()" url="function.swffontchar.addutf8chars.php"/>
+<entry name="SWFGradient->addEntry()" url="function.swfgradient.addentry.php"/>
+<entry name="SWFGradient->__construct()" url="function.swfgradient.construct.php"/>
+<entry name="SWFMorph->__construct()" url="function.swfmorph.construct.php"/>
+<entry name="SWFMorph->getShape1()" url="function.swfmorph.getshape1.php"/>
+<entry name="SWFMorph->getShape2()" url="function.swfmorph.getshape2.php"/>
+<entry name="SWFMovie->add()" url="function.swfmovie.add.php"/>
+<entry name="SWFMovie->addExport()" url="function.swfmovie.addexport.php"/>
+<entry name="SWFMovie->addFont()" url="function.swfmovie.addfont.php"/>
+<entry name="SWFMovie->__construct()" url="function.swfmovie.construct.php"/>
+<entry name="SWFMovie->importChar()" url="function.swfmovie.importchar.php"/>
+<entry name="SWFMovie->importFont()" url="function.swfmovie.importfont.php"/>
+<entry name="SWFMovie->labelFrame()" url="function.swfmovie.labelframe.php"/>
+<entry name="SWFMovie->nextFrame()" url="function.swfmovie.nextframe.php"/>
+<entry name="SWFMovie->output()" url="function.swfmovie.output.php"/>
+<entry name="SWFMovie->remove()" url="function.swfmovie.remove.php"/>
+<entry name="SWFMovie->save()" url="function.swfmovie.save.php"/>
+<entry name="SWFMovie->saveToFile()" url="function.swfmovie.savetofile.php"/>
+<entry name="SWFMovie->setbackground()" url="function.swfmovie.setbackground.php"/>
+<entry name="SWFMovie->setDimension()" url="function.swfmovie.setdimension.php"/>
+<entry name="SWFMovie->setFrames()" url="function.swfmovie.setframes.php"/>
+<entry name="SWFMovie->setRate()" url="function.swfmovie.setrate.php"/>
+<entry name="SWFMovie->startSound()" url="function.swfmovie.startsound.php"/>
+<entry name="SWFMovie->stopSound()" url="function.swfmovie.stopsound.php"/>
+<entry name="SWFMovie->streamMP3()" url="function.swfmovie.streammp3.php"/>
+<entry name="SWFMovie->writeExports()" url="function.swfmovie.writeexports.php"/>
+<entry name="SWFPrebuiltClip->__construct()" url="function.swfprebuiltclip.construct.php"/>
+<entry name="SWFShape->addFill()" url="function.swfshape.addfill.php"/>
+<entry name="SWFShape->__construct()" url="function.swfshape.construct.php"/>
+<entry name="SWFShape->drawArc()" url="function.swfshape.drawarc.php"/>
+<entry name="SWFShape->drawCircle()" url="function.swfshape.drawcircle.php"/>
+<entry name="SWFShape->drawCubic()" url="function.swfshape.drawcubic.php"/>
+<entry name="SWFShape->drawCubicTo()" url="function.swfshape.drawcubicto.php"/>
+<entry name="SWFShape->drawCurve()" url="function.swfshape.drawcurve.php"/>
+<entry name="SWFShape->drawCurveTo()" url="function.swfshape.drawcurveto.php"/>
+<entry name="SWFShape->drawGlyph()" url="function.swfshape.drawglyph.php"/>
+<entry name="SWFShape->drawLine()" url="function.swfshape.drawline.php"/>
+<entry name="SWFShape->drawLineTo()" url="function.swfshape.drawlineto.php"/>
+<entry name="SWFShape->movePen()" url="function.swfshape.movepen.php"/>
+<entry name="SWFShape->movePenTo()" url="function.swfshape.movepento.php"/>
+<entry name="SWFShape->setLeftFill()" url="function.swfshape.setleftfill.php"/>
+<entry name="SWFShape->setLine()" url="function.swfshape.setline.php"/>
+<entry name="SWFShape->setRightFill()" url="function.swfshape.setrightfill.php"/>
+<entry name="SWFSound" url="function.swfsound.construct.php"/>
+<entry name="SWFSoundInstance->loopCount()" url="function.swfsoundinstance.loopcount.php"/>
+<entry name="SWFSoundInstance->loopInPoint()" url="function.swfsoundinstance.loopinpoint.php"/>
+<entry name="SWFSoundInstance->loopOutPoint()" url="function.swfsoundinstance.loopoutpoint.php"/>
+<entry name="SWFSoundInstance->noMultiple()" url="function.swfsoundinstance.nomultiple.php"/>
+<entry name="SWFSprite->add()" url="function.swfsprite.add.php"/>
+<entry name="SWFSprite->__construct()" url="function.swfsprite.construct.php"/>
+<entry name="SWFSprite->labelFrame()" url="function.swfsprite.labelframe.php"/>
+<entry name="SWFSprite->nextFrame()" url="function.swfsprite.nextframe.php"/>
+<entry name="SWFSprite->remove()" url="function.swfsprite.remove.php"/>
+<entry name="SWFSprite->setFrames()" url="function.swfsprite.setframes.php"/>
+<entry name="SWFSprite->startSound()" url="function.swfsprite.startsound.php"/>
+<entry name="SWFSprite->stopSound()" url="function.swfsprite.stopsound.php"/>
+<entry name="SWFText->addString()" url="function.swftext.addstring.php"/>
+<entry name="SWFText->addUTF8String()" url="function.swftext.addutf8string.php"/>
+<entry name="SWFText->__construct()" url="function.swftext.construct.php"/>
+<entry name="SWFText->getAscent()" url="function.swftext.getascent.php"/>
+<entry name="SWFText->getDescent()" url="function.swftext.getdescent.php"/>
+<entry name="SWFText->getLeading()" url="function.swftext.getleading.php"/>
+<entry name="SWFText->getUTF8Width()" url="function.swftext.getutf8width.php"/>
+<entry name="SWFText->getWidth()" url="function.swftext.getwidth.php"/>
+<entry name="SWFText->moveTo()" url="function.swftext.moveto.php"/>
+<entry name="SWFText->setColor()" url="function.swftext.setcolor.php"/>
+<entry name="SWFText->setFont()" url="function.swftext.setfont.php"/>
+<entry name="SWFText->setHeight()" url="function.swftext.setheight.php"/>
+<entry name="SWFText->setSpacing()" url="function.swftext.setspacing.php"/>
+<entry name="SWFTextField->addChars()" url="function.swftextfield.addchars.php"/>
+<entry name="SWFTextField->addString()" url="function.swftextfield.addstring.php"/>
+<entry name="SWFTextField->align()" url="function.swftextfield.align.php"/>
+<entry name="SWFTextField->__construct()" url="function.swftextfield.construct.php"/>
+<entry name="SWFTextField->setBounds()" url="function.swftextfield.setbounds.php"/>
+<entry name="SWFTextField->setColor()" url="function.swftextfield.setcolor.php"/>
+<entry name="SWFTextField->setFont()" url="function.swftextfield.setfont.php"/>
+<entry name="SWFTextField->setHeight()" url="function.swftextfield.setheight.php"/>
+<entry name="SWFTextField->setIndentation()" url="function.swftextfield.setindentation.php"/>
+<entry name="SWFTextField->setLeftMargin()" url="function.swftextfield.setleftmargin.php"/>
+<entry name="SWFTextField->setLineSpacing()" url="function.swftextfield.setlinespacing.php"/>
+<entry name="SWFTextField->setMargins()" url="function.swftextfield.setmargins.php"/>
+<entry name="SWFTextField->setName()" url="function.swftextfield.setname.php"/>
+<entry name="SWFTextField->setPadding()" url="function.swftextfield.setpadding.php"/>
+<entry name="SWFTextField->setRightMargin()" url="function.swftextfield.setrightmargin.php"/>
+<entry name="SWFVideoStream->__construct()" url="function.swfvideostream.construct.php"/>
+<entry name="SWFVideoStream->getNumFrames()" url="function.swfvideostream.getnumframes.php"/>
+<entry name="SWFVideoStream->setDimension()" url="function.swfvideostream.setdimension.php"/>
+<entry name="PDF_activate_item" url="function.pdf-activate-item.php"/>
+<entry name="PDF_add_annotation" url="function.pdf-add-annotation.php"/>
+<entry name="PDF_add_bookmark" url="function.pdf-add-bookmark.php"/>
+<entry name="PDF_add_launchlink" url="function.pdf-add-launchlink.php"/>
+<entry name="PDF_add_locallink" url="function.pdf-add-locallink.php"/>
+<entry name="PDF_add_nameddest" url="function.pdf-add-nameddest.php"/>
+<entry name="PDF_add_note" url="function.pdf-add-note.php"/>
+<entry name="PDF_add_outline" url="function.pdf-add-outline.php"/>
+<entry name="PDF_add_pdflink" url="function.pdf-add-pdflink.php"/>
+<entry name="PDF_add_table_cell" url="function.pdf-add-table-cell.php"/>
+<entry name="PDF_add_textflow" url="function.pdf-add-textflow.php"/>
+<entry name="PDF_add_thumbnail" url="function.pdf-add-thumbnail.php"/>
+<entry name="PDF_add_weblink" url="function.pdf-add-weblink.php"/>
+<entry name="PDF_arc" url="function.pdf-arc.php"/>
+<entry name="PDF_arcn" url="function.pdf-arcn.php"/>
+<entry name="PDF_attach_file" url="function.pdf-attach-file.php"/>
+<entry name="PDF_begin_document" url="function.pdf-begin-document.php"/>
+<entry name="PDF_begin_font" url="function.pdf-begin-font.php"/>
+<entry name="PDF_begin_glyph" url="function.pdf-begin-glyph.php"/>
+<entry name="PDF_begin_item" url="function.pdf-begin-item.php"/>
+<entry name="PDF_begin_layer" url="function.pdf-begin-layer.php"/>
+<entry name="PDF_begin_page_ext" url="function.pdf-begin-page-ext.php"/>
+<entry name="PDF_begin_page" url="function.pdf-begin-page.php"/>
+<entry name="PDF_begin_pattern" url="function.pdf-begin-pattern.php"/>
+<entry name="PDF_begin_template_ext" url="function.pdf-begin-template-ext.php"/>
+<entry name="PDF_begin_template" url="function.pdf-begin-template.php"/>
+<entry name="PDF_circle" url="function.pdf-circle.php"/>
+<entry name="PDF_clip" url="function.pdf-clip.php"/>
+<entry name="PDF_close_image" url="function.pdf-close-image.php"/>
+<entry name="PDF_close_pdi_page" url="function.pdf-close-pdi-page.php"/>
+<entry name="PDF_close_pdi" url="function.pdf-close-pdi.php"/>
+<entry name="PDF_close" url="function.pdf-close.php"/>
+<entry name="PDF_closepath_fill_stroke" url="function.pdf-closepath-fill-stroke.php"/>
+<entry name="PDF_closepath_stroke" url="function.pdf-closepath-stroke.php"/>
+<entry name="PDF_closepath" url="function.pdf-closepath.php"/>
+<entry name="PDF_concat" url="function.pdf-concat.php"/>
+<entry name="PDF_continue_text" url="function.pdf-continue-text.php"/>
+<entry name="PDF_create_3dview" url="function.pdf-create-3dview.php"/>
+<entry name="PDF_create_action" url="function.pdf-create-action.php"/>
+<entry name="PDF_create_annotation" url="function.pdf-create-annotation.php"/>
+<entry name="PDF_create_bookmark" url="function.pdf-create-bookmark.php"/>
+<entry name="PDF_create_field" url="function.pdf-create-field.php"/>
+<entry name="PDF_create_fieldgroup" url="function.pdf-create-fieldgroup.php"/>
+<entry name="PDF_create_gstate" url="function.pdf-create-gstate.php"/>
+<entry name="PDF_create_pvf" url="function.pdf-create-pvf.php"/>
+<entry name="PDF_create_textflow" url="function.pdf-create-textflow.php"/>
+<entry name="PDF_curveto" url="function.pdf-curveto.php"/>
+<entry name="PDF_define_layer" url="function.pdf-define-layer.php"/>
+<entry name="PDF_delete_pvf" url="function.pdf-delete-pvf.php"/>
+<entry name="PDF_delete_table" url="function.pdf-delete-table.php"/>
+<entry name="PDF_delete_textflow" url="function.pdf-delete-textflow.php"/>
+<entry name="PDF_delete" url="function.pdf-delete.php"/>
+<entry name="PDF_encoding_set_char" url="function.pdf-encoding-set-char.php"/>
+<entry name="PDF_end_document" url="function.pdf-end-document.php"/>
+<entry name="PDF_end_font" url="function.pdf-end-font.php"/>
+<entry name="PDF_end_glyph" url="function.pdf-end-glyph.php"/>
+<entry name="PDF_end_item" url="function.pdf-end-item.php"/>
+<entry name="PDF_end_layer" url="function.pdf-end-layer.php"/>
+<entry name="PDF_end_page_ext" url="function.pdf-end-page-ext.php"/>
+<entry name="PDF_end_page" url="function.pdf-end-page.php"/>
+<entry name="PDF_end_pattern" url="function.pdf-end-pattern.php"/>
+<entry name="PDF_end_template" url="function.pdf-end-template.php"/>
+<entry name="PDF_endpath" url="function.pdf-endpath.php"/>
+<entry name="PDF_fill_imageblock" url="function.pdf-fill-imageblock.php"/>
+<entry name="PDF_fill_pdfblock" url="function.pdf-fill-pdfblock.php"/>
+<entry name="PDF_fill_stroke" url="function.pdf-fill-stroke.php"/>
+<entry name="PDF_fill_textblock" url="function.pdf-fill-textblock.php"/>
+<entry name="PDF_fill" url="function.pdf-fill.php"/>
+<entry name="PDF_findfont" url="function.pdf-findfont.php"/>
+<entry name="PDF_fit_image" url="function.pdf-fit-image.php"/>
+<entry name="PDF_fit_pdi_page" url="function.pdf-fit-pdi-page.php"/>
+<entry name="PDF_fit_table" url="function.pdf-fit-table.php"/>
+<entry name="PDF_fit_textflow" url="function.pdf-fit-textflow.php"/>
+<entry name="PDF_fit_textline" url="function.pdf-fit-textline.php"/>
+<entry name="PDF_get_apiname" url="function.pdf-get-apiname.php"/>
+<entry name="PDF_get_buffer" url="function.pdf-get-buffer.php"/>
+<entry name="PDF_get_errmsg" url="function.pdf-get-errmsg.php"/>
+<entry name="PDF_get_errnum" url="function.pdf-get-errnum.php"/>
+<entry name="PDF_get_font" url="function.pdf-get-font.php"/>
+<entry name="PDF_get_fontname" url="function.pdf-get-fontname.php"/>
+<entry name="PDF_get_fontsize" url="function.pdf-get-fontsize.php"/>
+<entry name="PDF_get_image_height" url="function.pdf-get-image-height.php"/>
+<entry name="PDF_get_image_width" url="function.pdf-get-image-width.php"/>
+<entry name="PDF_get_majorversion" url="function.pdf-get-majorversion.php"/>
+<entry name="PDF_get_minorversion" url="function.pdf-get-minorversion.php"/>
+<entry name="PDF_get_parameter" url="function.pdf-get-parameter.php"/>
+<entry name="PDF_get_pdi_parameter" url="function.pdf-get-pdi-parameter.php"/>
+<entry name="PDF_get_pdi_value" url="function.pdf-get-pdi-value.php"/>
+<entry name="PDF_get_value" url="function.pdf-get-value.php"/>
+<entry name="PDF_info_font" url="function.pdf-info-font.php"/>
+<entry name="PDF_info_matchbox" url="function.pdf-info-matchbox.php"/>
+<entry name="PDF_info_table" url="function.pdf-info-table.php"/>
+<entry name="PDF_info_textflow" url="function.pdf-info-textflow.php"/>
+<entry name="PDF_info_textline" url="function.pdf-info-textline.php"/>
+<entry name="PDF_initgraphics" url="function.pdf-initgraphics.php"/>
+<entry name="PDF_lineto" url="function.pdf-lineto.php"/>
+<entry name="PDF_load_3ddata" url="function.pdf-load-3ddata.php"/>
+<entry name="PDF_load_font" url="function.pdf-load-font.php"/>
+<entry name="PDF_load_iccprofile" url="function.pdf-load-iccprofile.php"/>
+<entry name="PDF_load_image" url="function.pdf-load-image.php"/>
+<entry name="PDF_makespotcolor" url="function.pdf-makespotcolor.php"/>
+<entry name="PDF_moveto" url="function.pdf-moveto.php"/>
+<entry name="PDF_new" url="function.pdf-new.php"/>
+<entry name="PDF_open_ccitt" url="function.pdf-open-ccitt.php"/>
+<entry name="PDF_open_file" url="function.pdf-open-file.php"/>
+<entry name="PDF_open_gif" url="function.pdf-open-gif.php"/>
+<entry name="PDF_open_image_file" url="function.pdf-open-image-file.php"/>
+<entry name="PDF_open_image" url="function.pdf-open-image.php"/>
+<entry name="PDF_open_jpeg" url="function.pdf-open-jpeg.php"/>
+<entry name="PDF_open_memory_image" url="function.pdf-open-memory-image.php"/>
+<entry name="PDF_open_pdi_page" url="function.pdf-open-pdi-page.php"/>
+<entry name="PDF_open_pdi" url="function.pdf-open-pdi.php"/>
+<entry name="PDF_open_tiff" url="function.pdf-open-tiff.php"/>
+<entry name="PDF_pcos_get_number" url="function.pdf-pcos-get-number.php"/>
+<entry name="PDF_pcos_get_stream" url="function.pdf-pcos-get-stream.php"/>
+<entry name="PDF_pcos_get_string" url="function.pdf-pcos-get-string.php"/>
+<entry name="PDF_place_image" url="function.pdf-place-image.php"/>
+<entry name="PDF_place_pdi_page" url="function.pdf-place-pdi-page.php"/>
+<entry name="PDF_process_pdi" url="function.pdf-process-pdi.php"/>
+<entry name="PDF_rect" url="function.pdf-rect.php"/>
+<entry name="PDF_restore" url="function.pdf-restore.php"/>
+<entry name="PDF_resume_page" url="function.pdf-resume-page.php"/>
+<entry name="PDF_rotate" url="function.pdf-rotate.php"/>
+<entry name="PDF_save" url="function.pdf-save.php"/>
+<entry name="PDF_scale" url="function.pdf-scale.php"/>
+<entry name="PDF_set_border_color" url="function.pdf-set-border-color.php"/>
+<entry name="PDF_set_border_dash" url="function.pdf-set-border-dash.php"/>
+<entry name="PDF_set_border_style" url="function.pdf-set-border-style.php"/>
+<entry name="PDF_set_char_spacing" url="function.pdf-set-char-spacing.php"/>
+<entry name="PDF_set_duration" url="function.pdf-set-duration.php"/>
+<entry name="PDF_set_gstate" url="function.pdf-set-gstate.php"/>
+<entry name="PDF_set_horiz_scaling" url="function.pdf-set-horiz-scaling.php"/>
+<entry name="PDF_set_info_author" url="function.pdf-set-info-author.php"/>
+<entry name="PDF_set_info_creator" url="function.pdf-set-info-creator.php"/>
+<entry name="PDF_set_info_keywords" url="function.pdf-set-info-keywords.php"/>
+<entry name="PDF_set_info_subject" url="function.pdf-set-info-subject.php"/>
+<entry name="PDF_set_info_title" url="function.pdf-set-info-title.php"/>
+<entry name="PDF_set_info" url="function.pdf-set-info.php"/>
+<entry name="PDF_set_layer_dependency" url="function.pdf-set-layer-dependency.php"/>
+<entry name="PDF_set_leading" url="function.pdf-set-leading.php"/>
+<entry name="PDF_set_parameter" url="function.pdf-set-parameter.php"/>
+<entry name="PDF_set_text_matrix" url="function.pdf-set-text-matrix.php"/>
+<entry name="PDF_set_text_pos" url="function.pdf-set-text-pos.php"/>
+<entry name="PDF_set_text_rendering" url="function.pdf-set-text-rendering.php"/>
+<entry name="PDF_set_text_rise" url="function.pdf-set-text-rise.php"/>
+<entry name="PDF_set_value" url="function.pdf-set-value.php"/>
+<entry name="PDF_set_word_spacing" url="function.pdf-set-word-spacing.php"/>
+<entry name="PDF_setcolor" url="function.pdf-setcolor.php"/>
+<entry name="PDF_setdash" url="function.pdf-setdash.php"/>
+<entry name="PDF_setdashpattern" url="function.pdf-setdashpattern.php"/>
+<entry name="PDF_setflat" url="function.pdf-setflat.php"/>
+<entry name="PDF_setfont" url="function.pdf-setfont.php"/>
+<entry name="PDF_setgray_fill" url="function.pdf-setgray-fill.php"/>
+<entry name="PDF_setgray_stroke" url="function.pdf-setgray-stroke.php"/>
+<entry name="PDF_setgray" url="function.pdf-setgray.php"/>
+<entry name="PDF_setlinecap" url="function.pdf-setlinecap.php"/>
+<entry name="PDF_setlinejoin" url="function.pdf-setlinejoin.php"/>
+<entry name="PDF_setlinewidth" url="function.pdf-setlinewidth.php"/>
+<entry name="PDF_setmatrix" url="function.pdf-setmatrix.php"/>
+<entry name="PDF_setmiterlimit" url="function.pdf-setmiterlimit.php"/>
+<entry name="PDF_setpolydash" url="function.pdf-setpolydash.php"/>
+<entry name="PDF_setrgbcolor_fill" url="function.pdf-setrgbcolor-fill.php"/>
+<entry name="PDF_setrgbcolor_stroke" url="function.pdf-setrgbcolor-stroke.php"/>
+<entry name="PDF_setrgbcolor" url="function.pdf-setrgbcolor.php"/>
+<entry name="PDF_shading_pattern" url="function.pdf-shading-pattern.php"/>
+<entry name="PDF_shading" url="function.pdf-shading.php"/>
+<entry name="PDF_shfill" url="function.pdf-shfill.php"/>
+<entry name="PDF_show_boxed" url="function.pdf-show-boxed.php"/>
+<entry name="PDF_show_xy" url="function.pdf-show-xy.php"/>
+<entry name="PDF_show" url="function.pdf-show.php"/>
+<entry name="PDF_skew" url="function.pdf-skew.php"/>
+<entry name="PDF_stringwidth" url="function.pdf-stringwidth.php"/>
+<entry name="PDF_stroke" url="function.pdf-stroke.php"/>
+<entry name="PDF_suspend_page" url="function.pdf-suspend-page.php"/>
+<entry name="PDF_translate" url="function.pdf-translate.php"/>
+<entry name="PDF_utf16_to_utf8" url="function.pdf-utf16-to-utf8.php"/>
+<entry name="PDF_utf32_to_utf16" url="function.pdf-utf32-to-utf16.php"/>
+<entry name="PDF_utf8_to_utf16" url="function.pdf-utf8-to-utf16.php"/>
+<entry name="ps_add_bookmark" url="function.ps-add-bookmark.php"/>
+<entry name="ps_add_launchlink" url="function.ps-add-launchlink.php"/>
+<entry name="ps_add_locallink" url="function.ps-add-locallink.php"/>
+<entry name="ps_add_note" url="function.ps-add-note.php"/>
+<entry name="ps_add_pdflink" url="function.ps-add-pdflink.php"/>
+<entry name="ps_add_weblink" url="function.ps-add-weblink.php"/>
+<entry name="ps_arc" url="function.ps-arc.php"/>
+<entry name="ps_arcn" url="function.ps-arcn.php"/>
+<entry name="ps_begin_page" url="function.ps-begin-page.php"/>
+<entry name="ps_begin_pattern" url="function.ps-begin-pattern.php"/>
+<entry name="ps_begin_template" url="function.ps-begin-template.php"/>
+<entry name="ps_circle" url="function.ps-circle.php"/>
+<entry name="ps_clip" url="function.ps-clip.php"/>
+<entry name="ps_close_image" url="function.ps-close-image.php"/>
+<entry name="ps_close" url="function.ps-close.php"/>
+<entry name="ps_closepath_stroke" url="function.ps-closepath-stroke.php"/>
+<entry name="ps_closepath" url="function.ps-closepath.php"/>
+<entry name="ps_continue_text" url="function.ps-continue-text.php"/>
+<entry name="ps_curveto" url="function.ps-curveto.php"/>
+<entry name="ps_delete" url="function.ps-delete.php"/>
+<entry name="ps_end_page" url="function.ps-end-page.php"/>
+<entry name="ps_end_pattern" url="function.ps-end-pattern.php"/>
+<entry name="ps_end_template" url="function.ps-end-template.php"/>
+<entry name="ps_fill_stroke" url="function.ps-fill-stroke.php"/>
+<entry name="ps_fill" url="function.ps-fill.php"/>
+<entry name="ps_findfont" url="function.ps-findfont.php"/>
+<entry name="ps_get_buffer" url="function.ps-get-buffer.php"/>
+<entry name="ps_get_parameter" url="function.ps-get-parameter.php"/>
+<entry name="ps_get_value" url="function.ps-get-value.php"/>
+<entry name="ps_hyphenate" url="function.ps-hyphenate.php"/>
+<entry name="ps_include_file" url="function.ps-include-file.php"/>
+<entry name="ps_lineto" url="function.ps-lineto.php"/>
+<entry name="ps_makespotcolor" url="function.ps-makespotcolor.php"/>
+<entry name="ps_moveto" url="function.ps-moveto.php"/>
+<entry name="ps_new" url="function.ps-new.php"/>
+<entry name="ps_open_file" url="function.ps-open-file.php"/>
+<entry name="ps_open_image_file" url="function.ps-open-image-file.php"/>
+<entry name="ps_open_image" url="function.ps-open-image.php"/>
+<entry name="ps_open_memory_image" url="function.ps-open-memory-image.php"/>
+<entry name="ps_place_image" url="function.ps-place-image.php"/>
+<entry name="ps_rect" url="function.ps-rect.php"/>
+<entry name="ps_restore" url="function.ps-restore.php"/>
+<entry name="ps_rotate" url="function.ps-rotate.php"/>
+<entry name="ps_save" url="function.ps-save.php"/>
+<entry name="ps_scale" url="function.ps-scale.php"/>
+<entry name="ps_set_border_color" url="function.ps-set-border-color.php"/>
+<entry name="ps_set_border_dash" url="function.ps-set-border-dash.php"/>
+<entry name="ps_set_border_style" url="function.ps-set-border-style.php"/>
+<entry name="ps_set_info" url="function.ps-set-info.php"/>
+<entry name="ps_set_parameter" url="function.ps-set-parameter.php"/>
+<entry name="ps_set_text_pos" url="function.ps-set-text-pos.php"/>
+<entry name="ps_set_value" url="function.ps-set-value.php"/>
+<entry name="ps_setcolor" url="function.ps-setcolor.php"/>
+<entry name="ps_setdash" url="function.ps-setdash.php"/>
+<entry name="ps_setflat" url="function.ps-setflat.php"/>
+<entry name="ps_setfont" url="function.ps-setfont.php"/>
+<entry name="ps_setgray" url="function.ps-setgray.php"/>
+<entry name="ps_setlinecap" url="function.ps-setlinecap.php"/>
+<entry name="ps_setlinejoin" url="function.ps-setlinejoin.php"/>
+<entry name="ps_setlinewidth" url="function.ps-setlinewidth.php"/>
+<entry name="ps_setmiterlimit" url="function.ps-setmiterlimit.php"/>
+<entry name="ps_setoverprintmode" url="function.ps-setoverprintmode.php"/>
+<entry name="ps_setpolydash" url="function.ps-setpolydash.php"/>
+<entry name="ps_shading_pattern" url="function.ps-shading-pattern.php"/>
+<entry name="ps_shading" url="function.ps-shading.php"/>
+<entry name="ps_shfill" url="function.ps-shfill.php"/>
+<entry name="ps_show_boxed" url="function.ps-show-boxed.php"/>
+<entry name="ps_show_xy2" url="function.ps-show-xy2.php"/>
+<entry name="ps_show_xy" url="function.ps-show-xy.php"/>
+<entry name="ps_show2" url="function.ps-show2.php"/>
+<entry name="ps_show" url="function.ps-show.php"/>
+<entry name="ps_string_geometry" url="function.ps-string-geometry.php"/>
+<entry name="ps_stringwidth" url="function.ps-stringwidth.php"/>
+<entry name="ps_stroke" url="function.ps-stroke.php"/>
+<entry name="ps_symbol_name" url="function.ps-symbol-name.php"/>
+<entry name="ps_symbol_width" url="function.ps-symbol-width.php"/>
+<entry name="ps_symbol" url="function.ps-symbol.php"/>
+<entry name="ps_translate" url="function.ps-translate.php"/>
+<entry name="rpm_close" url="function.rpm-close.php"/>
+<entry name="rpm_get_tag" url="function.rpm-get-tag.php"/>
+<entry name="rpm_is_valid" url="function.rpm-is-valid.php"/>
+<entry name="rpm_open" url="function.rpm-open.php"/>
+<entry name="rpm_version" url="function.rpm-version.php"/>
+<entry name="swf_actiongeturl" url="function.swf-actiongeturl.php"/>
+<entry name="swf_actiongotoframe" url="function.swf-actiongotoframe.php"/>
+<entry name="swf_actiongotolabel" url="function.swf-actiongotolabel.php"/>
+<entry name="swf_actionnextframe" url="function.swf-actionnextframe.php"/>
+<entry name="swf_actionplay" url="function.swf-actionplay.php"/>
+<entry name="swf_actionprevframe" url="function.swf-actionprevframe.php"/>
+<entry name="swf_actionsettarget" url="function.swf-actionsettarget.php"/>
+<entry name="swf_actionstop" url="function.swf-actionstop.php"/>
+<entry name="swf_actiontogglequality" url="function.swf-actiontogglequality.php"/>
+<entry name="swf_actionwaitforframe" url="function.swf-actionwaitforframe.php"/>
+<entry name="swf_addbuttonrecord" url="function.swf-addbuttonrecord.php"/>
+<entry name="swf_addcolor" url="function.swf-addcolor.php"/>
+<entry name="swf_closefile" url="function.swf-closefile.php"/>
+<entry name="swf_definebitmap" url="function.swf-definebitmap.php"/>
+<entry name="swf_definefont" url="function.swf-definefont.php"/>
+<entry name="swf_defineline" url="function.swf-defineline.php"/>
+<entry name="swf_definepoly" url="function.swf-definepoly.php"/>
+<entry name="swf_definerect" url="function.swf-definerect.php"/>
+<entry name="swf_definetext" url="function.swf-definetext.php"/>
+<entry name="swf_endbutton" url="function.swf-endbutton.php"/>
+<entry name="swf_enddoaction" url="function.swf-enddoaction.php"/>
+<entry name="swf_endshape" url="function.swf-endshape.php"/>
+<entry name="swf_endsymbol" url="function.swf-endsymbol.php"/>
+<entry name="swf_fontsize" url="function.swf-fontsize.php"/>
+<entry name="swf_fontslant" url="function.swf-fontslant.php"/>
+<entry name="swf_fonttracking" url="function.swf-fonttracking.php"/>
+<entry name="swf_getbitmapinfo" url="function.swf-getbitmapinfo.php"/>
+<entry name="swf_getfontinfo" url="function.swf-getfontinfo.php"/>
+<entry name="swf_getframe" url="function.swf-getframe.php"/>
+<entry name="swf_labelframe" url="function.swf-labelframe.php"/>
+<entry name="swf_lookat" url="function.swf-lookat.php"/>
+<entry name="swf_modifyobject" url="function.swf-modifyobject.php"/>
+<entry name="swf_mulcolor" url="function.swf-mulcolor.php"/>
+<entry name="swf_nextid" url="function.swf-nextid.php"/>
+<entry name="swf_oncondition" url="function.swf-oncondition.php"/>
+<entry name="swf_openfile" url="function.swf-openfile.php"/>
+<entry name="swf_ortho2" url="function.swf-ortho2.php"/>
+<entry name="swf_ortho" url="function.swf-ortho.php"/>
+<entry name="swf_perspective" url="function.swf-perspective.php"/>
+<entry name="swf_placeobject" url="function.swf-placeobject.php"/>
+<entry name="swf_polarview" url="function.swf-polarview.php"/>
+<entry name="swf_popmatrix" url="function.swf-popmatrix.php"/>
+<entry name="swf_posround" url="function.swf-posround.php"/>
+<entry name="swf_pushmatrix" url="function.swf-pushmatrix.php"/>
+<entry name="swf_removeobject" url="function.swf-removeobject.php"/>
+<entry name="swf_rotate" url="function.swf-rotate.php"/>
+<entry name="swf_scale" url="function.swf-scale.php"/>
+<entry name="swf_setfont" url="function.swf-setfont.php"/>
+<entry name="swf_setframe" url="function.swf-setframe.php"/>
+<entry name="swf_shapearc" url="function.swf-shapearc.php"/>
+<entry name="swf_shapecurveto3" url="function.swf-shapecurveto3.php"/>
+<entry name="swf_shapecurveto" url="function.swf-shapecurveto.php"/>
+<entry name="swf_shapefillbitmapclip" url="function.swf-shapefillbitmapclip.php"/>
+<entry name="swf_shapefillbitmaptile" url="function.swf-shapefillbitmaptile.php"/>
+<entry name="swf_shapefilloff" url="function.swf-shapefilloff.php"/>
+<entry name="swf_shapefillsolid" url="function.swf-shapefillsolid.php"/>
+<entry name="swf_shapelinesolid" url="function.swf-shapelinesolid.php"/>
+<entry name="swf_shapelineto" url="function.swf-shapelineto.php"/>
+<entry name="swf_shapemoveto" url="function.swf-shapemoveto.php"/>
+<entry name="swf_showframe" url="function.swf-showframe.php"/>
+<entry name="swf_startbutton" url="function.swf-startbutton.php"/>
+<entry name="swf_startdoaction" url="function.swf-startdoaction.php"/>
+<entry name="swf_startshape" url="function.swf-startshape.php"/>
+<entry name="swf_startsymbol" url="function.swf-startsymbol.php"/>
+<entry name="swf_textwidth" url="function.swf-textwidth.php"/>
+<entry name="swf_translate" url="function.swf-translate.php"/>
+<entry name="swf_viewport" url="function.swf-viewport.php"/>
+<entry name="Swish::__construct" url="function.swish-construct.php"/>
+<entry name="Swish->getMetaList" url="function.swish-getmetalist.php"/>
+<entry name="Swish->getPropertyList" url="function.swish-getpropertylist.php"/>
+<entry name="Swish->prepare" url="function.swish-prepare.php"/>
+<entry name="Swish->query" url="function.swish-query.php"/>
+<entry name="SwishResult->getMetaList" url="function.swishresult-getmetalist.php"/>
+<entry name="SwishResult->stem" url="function.swishresult-stem.php"/>
+<entry name="SwishResults->getParsedWords" url="function.swishresults-getparsedwords.php"/>
+<entry name="SwishResults->getRemovedStopwords" url="function.swishresults-getremovedstopwords.php"/>
+<entry name="SwishResults->nextResult" url="function.swishresults-nextresult.php"/>
+<entry name="SwishResults->seekResult" url="function.swishresults-seekresult.php"/>
+<entry name="SwishSearch->execute" url="function.swishsearch-execute.php"/>
+<entry name="SwishSearch->resetLimit" url="function.swishsearch-resetlimit.php"/>
+<entry name="SwishSearch->setLimit" url="function.swishsearch-setlimit.php"/>
+<entry name="SwishSearch->setPhraseDelimiter" url="function.swishsearch-setphrasedelimiter.php"/>
+<entry name="SwishSearch->setSort" url="function.swishsearch-setsort.php"/>
+<entry name="SwishSearch->setStructure" url="function.swishsearch-setstructure.php"/>
+<entry name="escapeshellarg" url="function.escapeshellarg.php"/>
+<entry name="escapeshellcmd" url="function.escapeshellcmd.php"/>
+<entry name="exec" url="function.exec.php"/>
+<entry name="passthru" url="function.passthru.php"/>
+<entry name="proc_close" url="function.proc-close.php"/>
+<entry name="proc_get_status" url="function.proc-get-status.php"/>
+<entry name="proc_nice" url="function.proc-nice.php"/>
+<entry name="proc_open" url="function.proc-open.php"/>
+<entry name="proc_terminate" url="function.proc-terminate.php"/>
+<entry name="shell_exec" url="function.shell-exec.php"/>
+<entry name="system" url="function.system.php"/>
+<entry name="expect_expectl" url="function.expect-expectl.php"/>
+<entry name="expect_popen" url="function.expect-popen.php"/>
+<entry name="pcntl_alarm" url="function.pcntl-alarm.php"/>
+<entry name="pcntl_exec" url="function.pcntl-exec.php"/>
+<entry name="pcntl_fork" url="function.pcntl-fork.php"/>
+<entry name="pcntl_getpriority" url="function.pcntl-getpriority.php"/>
+<entry name="pcntl_setpriority" url="function.pcntl-setpriority.php"/>
+<entry name="pcntl_signal" url="function.pcntl-signal.php"/>
+<entry name="pcntl_wait" url="function.pcntl-wait.php"/>
+<entry name="pcntl_waitpid" url="function.pcntl-waitpid.php"/>
+<entry name="pcntl_wexitstatus" url="function.pcntl-wexitstatus.php"/>
+<entry name="pcntl_wifexited" url="function.pcntl-wifexited.php"/>
+<entry name="pcntl_wifsignaled" url="function.pcntl-wifsignaled.php"/>
+<entry name="pcntl_wifstopped" url="function.pcntl-wifstopped.php"/>
+<entry name="pcntl_wstopsig" url="function.pcntl-wstopsig.php"/>
+<entry name="pcntl_wtermsig" url="function.pcntl-wtermsig.php"/>
+<entry name="posix_access" url="function.posix-access.php"/>
+<entry name="posix_ctermid" url="function.posix-ctermid.php"/>
+<entry name="posix_get_last_error" url="function.posix-get-last-error.php"/>
+<entry name="posix_getcwd" url="function.posix-getcwd.php"/>
+<entry name="posix_getegid" url="function.posix-getegid.php"/>
+<entry name="posix_geteuid" url="function.posix-geteuid.php"/>
+<entry name="posix_getgid" url="function.posix-getgid.php"/>
+<entry name="posix_getgrgid" url="function.posix-getgrgid.php"/>
+<entry name="posix_getgrnam" url="function.posix-getgrnam.php"/>
+<entry name="posix_getgroups" url="function.posix-getgroups.php"/>
+<entry name="posix_getlogin" url="function.posix-getlogin.php"/>
+<entry name="posix_getpgid" url="function.posix-getpgid.php"/>
+<entry name="posix_getpgrp" url="function.posix-getpgrp.php"/>
+<entry name="posix_getpid" url="function.posix-getpid.php"/>
+<entry name="posix_getppid" url="function.posix-getppid.php"/>
+<entry name="posix_getpwnam" url="function.posix-getpwnam.php"/>
+<entry name="posix_getpwuid" url="function.posix-getpwuid.php"/>
+<entry name="posix_getrlimit" url="function.posix-getrlimit.php"/>
+<entry name="posix_getsid" url="function.posix-getsid.php"/>
+<entry name="posix_getuid" url="function.posix-getuid.php"/>
+<entry name="posix_initgroups" url="function.posix-initgroups.php"/>
+<entry name="posix_isatty" url="function.posix-isatty.php"/>
+<entry name="posix_kill" url="function.posix-kill.php"/>
+<entry name="posix_mkfifo" url="function.posix-mkfifo.php"/>
+<entry name="posix_mknod" url="function.posix-mknod.php"/>
+<entry name="posix_setegid" url="function.posix-setegid.php"/>
+<entry name="posix_seteuid" url="function.posix-seteuid.php"/>
+<entry name="posix_setgid" url="function.posix-setgid.php"/>
+<entry name="posix_setpgid" url="function.posix-setpgid.php"/>
+<entry name="posix_setsid" url="function.posix-setsid.php"/>
+<entry name="posix_setuid" url="function.posix-setuid.php"/>
+<entry name="posix_strerror" url="function.posix-strerror.php"/>
+<entry name="posix_times" url="function.posix-times.php"/>
+<entry name="posix_ttyname" url="function.posix-ttyname.php"/>
+<entry name="posix_uname" url="function.posix-uname.php"/>
+<entry name="ftok" url="function.ftok.php"/>
+<entry name="msg_get_queue" url="function.msg-get-queue.php"/>
+<entry name="msg_queue_exists" url="function.msg-queue-exists.php"/>
+<entry name="msg_receive" url="function.msg-receive.php"/>
+<entry name="msg_remove_queue" url="function.msg-remove-queue.php"/>
+<entry name="msg_send" url="function.msg-send.php"/>
+<entry name="msg_set_queue" url="function.msg-set-queue.php"/>
+<entry name="msg_stat_queue" url="function.msg-stat-queue.php"/>
+<entry name="sem_acquire" url="function.sem-acquire.php"/>
+<entry name="sem_get" url="function.sem-get.php"/>
+<entry name="sem_release" url="function.sem-release.php"/>
+<entry name="sem_remove" url="function.sem-remove.php"/>
+<entry name="shm_attach" url="function.shm-attach.php"/>
+<entry name="shm_detach" url="function.shm-detach.php"/>
+<entry name="shm_get_var" url="function.shm-get-var.php"/>
+<entry name="shm_put_var" url="function.shm-put-var.php"/>
+<entry name="shm_remove_var" url="function.shm-remove-var.php"/>
+<entry name="shm_remove" url="function.shm-remove.php"/>
+<entry name="shmop_close" url="function.shmop-close.php"/>
+<entry name="shmop_delete" url="function.shmop-delete.php"/>
+<entry name="shmop_open" url="function.shmop-open.php"/>
+<entry name="shmop_read" url="function.shmop-read.php"/>
+<entry name="shmop_size" url="function.shmop-size.php"/>
+<entry name="shmop_write" url="function.shmop-write.php"/>
+<entry name="geoip_country_code_by_name" url="function.geoip-country-code-by-name.php"/>
+<entry name="geoip_country_code3_by_name" url="function.geoip-country-code3-by-name.php"/>
+<entry name="geoip_country_name_by_name" url="function.geoip-country-name-by-name.php"/>
+<entry name="geoip_database_info" url="function.geoip-database-info.php"/>
+<entry name="geoip_db_avail" url="function.geoip-db-avail.php"/>
+<entry name="geoip_db_filename" url="function.geoip-db-filename.php"/>
+<entry name="geoip_db_get_all_info" url="function.geoip-db-get-all-info.php"/>
+<entry name="geoip_id_by_name" url="function.geoip-id-by-name.php"/>
+<entry name="geoip_isp_by_name" url="function.geoip-isp-by-name.php"/>
+<entry name="geoip_org_by_name" url="function.geoip-org-by-name.php"/>
+<entry name="geoip_record_by_name" url="function.geoip-record-by-name.php"/>
+<entry name="geoip_region_by_name" url="function.geoip-region-by-name.php"/>
+<entry name="json_decode" url="function.json-decode.php"/>
+<entry name="json_encode" url="function.json-encode.php"/>
+<entry name="connection_aborted" url="function.connection-aborted.php"/>
+<entry name="connection_status" url="function.connection-status.php"/>
+<entry name="connection_timeout" url="function.connection-timeout.php"/>
+<entry name="constant" url="function.constant.php"/>
+<entry name="define" url="function.define.php"/>
+<entry name="defined" url="function.defined.php"/>
+<entry name="die" url="function.die.php"/>
+<entry name="eval" url="function.eval.php"/>
+<entry name="exit" url="function.exit.php"/>
+<entry name="get_browser" url="function.get-browser.php"/>
+<entry name="__halt_compiler" url="function.halt-compiler.php"/>
+<entry name="highlight_file" url="function.highlight-file.php"/>
+<entry name="highlight_string" url="function.highlight-string.php"/>
+<entry name="ignore_user_abort" url="function.ignore-user-abort.php"/>
+<entry name="pack" url="function.pack.php"/>
+<entry name="php_check_syntax" url="function.php-check-syntax.php"/>
+<entry name="php_strip_whitespace" url="function.php-strip-whitespace.php"/>
+<entry name="show_source" url="function.show-source.php"/>
+<entry name="sleep" url="function.sleep.php"/>
+<entry name="sys_getloadavg" url="function.sys-getloadavg.php"/>
+<entry name="time_nanosleep" url="function.time-nanosleep.php"/>
+<entry name="time_sleep_until" url="function.time-sleep-until.php"/>
+<entry name="uniqid" url="function.uniqid.php"/>
+<entry name="unpack" url="function.unpack.php"/>
+<entry name="usleep" url="function.usleep.php"/>
+<entry name="parsekit_compile_file" url="function.parsekit-compile-file.php"/>
+<entry name="parsekit_compile_string" url="function.parsekit-compile-string.php"/>
+<entry name="parsekit_func_arginfo" url="function.parsekit-func-arginfo.php"/>
+<entry name="class_implements" url="function.class-implements.php"/>
+<entry name="class_parents" url="function.class-parents.php"/>
+<entry name="iterator_count" url="function.iterator-count.php"/>
+<entry name="iterator_to_array" url="function.iterator-to-array.php"/>
+<entry name="spl_autoload_call" url="function.spl-autoload-call.php"/>
+<entry name="spl_autoload_extensions" url="function.spl-autoload-extensions.php"/>
+<entry name="spl_autoload_functions" url="function.spl-autoload-functions.php"/>
+<entry name="spl_autoload_register" url="function.spl-autoload-register.php"/>
+<entry name="spl_autoload_unregister" url="function.spl-autoload-unregister.php"/>
+<entry name="spl_autoload" url="function.spl-autoload.php"/>
+<entry name="spl_classes" url="function.spl-classes.php"/>
+<entry name="spl_object_hash" url="function.spl-object-hash.php"/>
+<entry name="ArrayIterator::current" url="arrayiterator.current.php"/>
+<entry name="ArrayIterator::key" url="arrayiterator.key.php"/>
+<entry name="ArrayIterator::next" url="arrayiterator.next.php"/>
+<entry name="ArrayIterator::rewind" url="arrayiterator.rewind.php"/>
+<entry name="ArrayIterator::seek" url="arrayiterator.seek.php"/>
+<entry name="ArrayIterator::valid" url="arrayiterator.valid.php"/>
+<entry name="ArrayObject::append" url="arrayobject.append.php"/>
+<entry name="ArrayObject::__construct" url="arrayobject.construct.php"/>
+<entry name="ArrayObject::count" url="arrayobject.count.php"/>
+<entry name="ArrayObject::getIterator" url="arrayobject.getiterator.php"/>
+<entry name="ArrayObject::offsetExists" url="arrayobject.offsetexists.php"/>
+<entry name="ArrayObject::offsetGet" url="arrayobject.offsetget.php"/>
+<entry name="ArrayObject::offsetSet" url="arrayobject.offsetset.php"/>
+<entry name="ArrayObject::offsetUnset" url="arrayobject.offsetunset.php"/>
+<entry name="CachingIterator::hasNext" url="cachingiterator.hasnext.php"/>
+<entry name="CachingIterator::next" url="cachingiterator.next.php"/>
+<entry name="CachingIterator::rewind" url="cachingiterator.rewind.php"/>
+<entry name="CachingIterator::__toString" url="cachingiterator.tostring.php"/>
+<entry name="CachingIterator::valid" url="cachingiterator.valid.php"/>
+<entry name="RecursiveCachingIterator::getChildren" url="recursivecachingiterator.getchildren.php"/>
+<entry name="RecursiveCachingIterator::hasChildren" url="recursivecachingiterator.haschildren.php"/>
+<entry name="DirectoryIterator::__construct" url="directoryiterator.construct.php"/>
+<entry name="DirectoryIterator::current" url="directoryiterator.current.php"/>
+<entry name="DirectoryIterator::getATime" url="directoryiterator.getatime.php"/>
+<entry name="DirectoryIterator::getCTime" url="directoryiterator.getctime.php"/>
+<entry name="DirectoryIterator::getFilename" url="directoryiterator.getfilename.php"/>
+<entry name="DirectoryIterator::getGroup" url="directoryiterator.getgroup.php"/>
+<entry name="DirectoryIterator::getInode" url="directoryiterator.getinode.php"/>
+<entry name="DirectoryIterator::getMTime" url="directoryiterator.getmtime.php"/>
+<entry name="DirectoryIterator::getOwner" url="directoryiterator.getowner.php"/>
+<entry name="DirectoryIterator::getPath" url="directoryiterator.getpath.php"/>
+<entry name="DirectoryIterator::getPathname" url="directoryiterator.getpathname.php"/>
+<entry name="DirectoryIterator::getPerms" url="directoryiterator.getperms.php"/>
+<entry name="DirectoryIterator::getSize" url="directoryiterator.getsize.php"/>
+<entry name="DirectoryIterator::getType" url="directoryiterator.gettype.php"/>
+<entry name="DirectoryIterator::isDir" url="directoryiterator.isdir.php"/>
+<entry name="DirectoryIterator::isDot" url="directoryiterator.isdot.php"/>
+<entry name="DirectoryIterator::isExecutable" url="directoryiterator.isexecutable.php"/>
+<entry name="DirectoryIterator::isFile" url="directoryiterator.isfile.php"/>
+<entry name="DirectoryIterator::isLink" url="directoryiterator.islink.php"/>
+<entry name="DirectoryIterator::isReadable" url="directoryiterator.isreadable.php"/>
+<entry name="DirectoryIterator::isWritable" url="directoryiterator.iswritable.php"/>
+<entry name="DirectoryIterator::key" url="directoryiterator.key.php"/>
+<entry name="DirectoryIterator::next" url="directoryiterator.next.php"/>
+<entry name="DirectoryIterator::rewind" url="directoryiterator.rewind.php"/>
+<entry name="DirectoryIterator::valid" url="directoryiterator.valid.php"/>
+<entry name="FilterIterator::current" url="filteriterator.current.php"/>
+<entry name="FilterIterator::getInnerIterator" url="filteriterator.getinneriterator.php"/>
+<entry name="FilterIterator::key" url="filteriterator.key.php"/>
+<entry name="FilterIterator::next" url="filteriterator.next.php"/>
+<entry name="FilterIterator::rewind" url="filteriterator.rewind.php"/>
+<entry name="FilterIterator::valid" url="filteriterator.valid.php"/>
+<entry name="LimitIterator::getPosition" url="limititerator.getposition.php"/>
+<entry name="LimitIterator::next" url="limititerator.next.php"/>
+<entry name="LimitIterator::rewind" url="limititerator.rewind.php"/>
+<entry name="LimitIterator::seek" url="limititerator.seek.php"/>
+<entry name="LimitIterator::valid" url="limititerator.valid.php"/>
+<entry name="ParentIterator::getChildren" url="parentiterator.getchildren.php"/>
+<entry name="ParentIterator::hasChildren" url="parentiterator.haschildren.php"/>
+<entry name="ParentIterator::next" url="parentiterator.next.php"/>
+<entry name="ParentIterator::rewind" url="parentiterator.rewind.php"/>
+<entry name="RecursiveDirectoryIterator::getChildren" url="recursivedirectoryiterator.getchildren.php"/>
+<entry name="RecursiveDirectoryIterator::hasChildren" url="recursivedirectoryiterator.haschildren.php"/>
+<entry name="RecursiveDirectoryIterator::key" url="recursivedirectoryiterator.key.php"/>
+<entry name="RecursiveDirectoryIterator::next" url="recursivedirectoryiterator.next.php"/>
+<entry name="RecursiveDirectoryIterator::rewind" url="recursivedirectoryiterator.rewind.php"/>
+<entry name="RecursiveIteratorIterator::current" url="recursiveiteratoriterator.current.php"/>
+<entry name="RecursiveIteratorIterator::getDepth" url="recursiveiteratoriterator.getdepth.php"/>
+<entry name="RecursiveIteratorIterator::getSubIterator" url="recursiveiteratoriterator.getsubiterator.php"/>
+<entry name="RecursiveIteratorIterator::key" url="recursiveiteratoriterator.key.php"/>
+<entry name="RecursiveIteratorIterator::next" url="recursiveiteratoriterator.next.php"/>
+<entry name="RecursiveIteratorIterator::rewind" url="recursiveiteratoriterator.rewind.php"/>
+<entry name="RecursiveIteratorIterator::valid" url="recursiveiteratoriterator.valid.php"/>
+<entry name="SimpleXMLIterator::current" url="simplexmliterator.current.php"/>
+<entry name="SimpleXMLIterator::getChildren" url="simplexmliterator.getchildren.php"/>
+<entry name="SimpleXMLIterator::hasChildren" url="simplexmliterator.haschildren.php"/>
+<entry name="SimpleXMLIterator::key" url="simplexmliterator.key.php"/>
+<entry name="SimpleXMLIterator::next" url="simplexmliterator.next.php"/>
+<entry name="SimpleXMLIterator::rewind" url="simplexmliterator.rewind.php"/>
+<entry name="SimpleXMLIterator::valid" url="simplexmliterator.valid.php"/>
+<entry name="SplDoublyLinkedList::bottom" url="spldoublylinkedlist.bottom.php"/>
+<entry name="SplDoublyLinkedList::__construct" url="spldoublylinkedlist.construct.php"/>
+<entry name="SplDoublyLinkedList::count" url="spldoublylinkedlist.count.php"/>
+<entry name="SplDoublyLinkedList::current" url="spldoublylinkedlist.current.php"/>
+<entry name="SplDoublyLinkedList::getIteratorMode" url="spldoublylinkedlist.getiteratormode.php"/>
+<entry name="SplDoublyLinkedList::isEmpty" url="spldoublylinkedlist.isempty.php"/>
+<entry name="SplDoublyLinkedList::key" url="spldoublylinkedlist.key.php"/>
+<entry name="SplDoublyLinkedList::next" url="spldoublylinkedlist.next.php"/>
+<entry name="SplDoublyLinkedList::offsetExists" url="spldoublylinkedlist.offsetexists.php"/>
+<entry name="SplDoublyLinkedList::offsetGet" url="spldoublylinkedlist.offsetget.php"/>
+<entry name="SplDoublyLinkedList::offsetSet" url="spldoublylinkedlist.offsetset.php"/>
+<entry name="SplDoublyLinkedList::offsetUnset" url="spldoublylinkedlist.offsetunset.php"/>
+<entry name="SplDoublyLinkedList::pop" url="spldoublylinkedlist.pop.php"/>
+<entry name="SplDoublyLinkedList::push" url="spldoublylinkedlist.push.php"/>
+<entry name="SplDoublyLinkedList::rewind" url="spldoublylinkedlist.rewind.php"/>
+<entry name="SplDoublyLinkedList::setIteratorMode" url="spldoublylinkedlist.setiteratormode.php"/>
+<entry name="SplDoublyLinkedList::shift" url="spldoublylinkedlist.shift.php"/>
+<entry name="SplDoublyLinkedList::top" url="spldoublylinkedlist.top.php"/>
+<entry name="SplDoublyLinkedList::unshift" url="spldoublylinkedlist.unshift.php"/>
+<entry name="SplDoublyLinkedList::valid" url="spldoublylinkedlist.valid.php"/>
+<entry name="SplStack::__construct" url="splstack.construct.php"/>
+<entry name="SplStack::setIteratorMode" url="splstack.setiteratormode.php"/>
+<entry name="SplQueue::__construct" url="splqueue.construct.php"/>
+<entry name="SplQueue::dequeue" url="splqueue.dequeue.php"/>
+<entry name="SplQueue::enqueue" url="splqueue.enqueue.php"/>
+<entry name="SplQueue::setIteratorMode" url="splqueue.setiteratormode.php"/>
+<entry name="SplHeap::compare" url="splheap.compare.php"/>
+<entry name="SplHeap::__construct" url="splheap.construct.php"/>
+<entry name="SplHeap::count" url="splheap.count.php"/>
+<entry name="SplHeap::current" url="splheap.current.php"/>
+<entry name="SplHeap::extract" url="splheap.extract.php"/>
+<entry name="SplHeap::insert" url="splheap.insert.php"/>
+<entry name="SplHeap::isEmpty" url="splheap.isempty.php"/>
+<entry name="SplHeap::key" url="splheap.key.php"/>
+<entry name="SplHeap::next" url="splheap.next.php"/>
+<entry name="SplHeap::recoverFromCorruption" url="splheap.recoverfromcorruption.php"/>
+<entry name="SplHeap::rewind" url="splheap.rewind.php"/>
+<entry name="SplHeap::top" url="splheap.top.php"/>
+<entry name="SplHeap::valid" url="splheap.valid.php"/>
+<entry name="SplMaxHeap::compare" url="splmaxheap.compare.php"/>
+<entry name="SplMinHeap::compare" url="splminheap.compare.php"/>
+<entry name="SplPriorityQueue::compare" url="splpriorityqueue.compare.php"/>
+<entry name="SplPriorityQueue::__construct" url="splpriorityqueue.construct.php"/>
+<entry name="SplPriorityQueue::count" url="splpriorityqueue.count.php"/>
+<entry name="SplPriorityQueue::current" url="splpriorityqueue.current.php"/>
+<entry name="SplPriorityQueue::extract" url="splpriorityqueue.extract.php"/>
+<entry name="SplPriorityQueue::insert" url="splpriorityqueue.insert.php"/>
+<entry name="SplPriorityQueue::isEmpty" url="splpriorityqueue.isempty.php"/>
+<entry name="SplPriorityQueue::key" url="splpriorityqueue.key.php"/>
+<entry name="SplPriorityQueue::next" url="splpriorityqueue.next.php"/>
+<entry name="SplPriorityQueue::recoverFromCorruption" url="splpriorityqueue.recoverfromcorruption.php"/>
+<entry name="SplPriorityQueue::rewind" url="splpriorityqueue.rewind.php"/>
+<entry name="SplPriorityQueue::setExtractFlags" url="splpriorityqueue.setextractflags.php"/>
+<entry name="SplPriorityQueue::top" url="splpriorityqueue.top.php"/>
+<entry name="SplPriorityQueue::valid" url="splpriorityqueue.valid.php"/>
+<entry name="stream_bucket_append" url="function.stream-bucket-append.php"/>
+<entry name="stream_bucket_make_writeable" url="function.stream-bucket-make-writeable.php"/>
+<entry name="stream_bucket_new" url="function.stream-bucket-new.php"/>
+<entry name="stream_bucket_prepend" url="function.stream-bucket-prepend.php"/>
+<entry name="stream_context_create" url="function.stream-context-create.php"/>
+<entry name="stream_context_get_default" url="function.stream-context-get-default.php"/>
+<entry name="stream_context_get_options" url="function.stream-context-get-options.php"/>
+<entry name="stream_context_set_option" url="function.stream-context-set-option.php"/>
+<entry name="stream_context_set_params" url="function.stream-context-set-params.php"/>
+<entry name="stream_copy_to_stream" url="function.stream-copy-to-stream.php"/>
+<entry name="stream_encoding" url="function.stream-encoding.php"/>
+<entry name="stream_filter_append" url="function.stream-filter-append.php"/>
+<entry name="stream_filter_prepend" url="function.stream-filter-prepend.php"/>
+<entry name="stream_filter_register" url="function.stream-filter-register.php"/>
+<entry name="stream_filter_remove" url="function.stream-filter-remove.php"/>
+<entry name="stream_get_contents" url="function.stream-get-contents.php"/>
+<entry name="stream_get_filters" url="function.stream-get-filters.php"/>
+<entry name="stream_get_line" url="function.stream-get-line.php"/>
+<entry name="stream_get_meta_data" url="function.stream-get-meta-data.php"/>
+<entry name="stream_get_transports" url="function.stream-get-transports.php"/>
+<entry name="stream_get_wrappers" url="function.stream-get-wrappers.php"/>
+<entry name="stream_notification_callback" url="function.stream-notification-callback.php"/>
+<entry name="stream_register_wrapper" url="function.stream-register-wrapper.php"/>
+<entry name="stream_resolve_include_path" url="function.stream-resolve-include-path.php"/>
+<entry name="stream_select" url="function.stream-select.php"/>
+<entry name="stream_set_blocking" url="function.stream-set-blocking.php"/>
+<entry name="stream_set_timeout" url="function.stream-set-timeout.php"/>
+<entry name="stream_set_write_buffer" url="function.stream-set-write-buffer.php"/>
+<entry name="stream_socket_accept" url="function.stream-socket-accept.php"/>
+<entry name="stream_socket_client" url="function.stream-socket-client.php"/>
+<entry name="stream_socket_enable_crypto" url="function.stream-socket-enable-crypto.php"/>
+<entry name="stream_socket_get_name" url="function.stream-socket-get-name.php"/>
+<entry name="stream_socket_pair" url="function.stream-socket-pair.php"/>
+<entry name="stream_socket_recvfrom" url="function.stream-socket-recvfrom.php"/>
+<entry name="stream_socket_sendto" url="function.stream-socket-sendto.php"/>
+<entry name="stream_socket_server" url="function.stream-socket-server.php"/>
+<entry name="stream_socket_shutdown" url="function.stream-socket-shutdown.php"/>
+<entry name="stream_wrapper_register" url="function.stream-wrapper-register.php"/>
+<entry name="stream_wrapper_restore" url="function.stream-wrapper-restore.php"/>
+<entry name="stream_wrapper_unregister" url="function.stream-wrapper-unregister.php"/>
+<entry name="ob_tidyhandler" url="function.ob-tidyhandler.php"/>
+<entry name="tidy_access_count" url="function.tidy-access-count.php"/>
+<entry name="tidy_clean_repair" url="function.tidy-clean-repair.php"/>
+<entry name="tidy_config_count" url="function.tidy-config-count.php"/>
+<entry name="tidy::__construct" url="function.tidy-construct.php"/>
+<entry name="tidy_diagnose" url="function.tidy-diagnose.php"/>
+<entry name="tidy_error_count" url="function.tidy-error-count.php"/>
+<entry name="tidy_get_body" url="function.tidy-get-body.php"/>
+<entry name="tidy_get_config" url="function.tidy-get-config.php"/>
+<entry name="tidy_get_error_buffer" url="function.tidy-get-error-buffer.php"/>
+<entry name="tidy_get_head" url="function.tidy-get-head.php"/>
+<entry name="tidy_get_html_ver" url="function.tidy-get-html-ver.php"/>
+<entry name="tidy_get_html" url="function.tidy-get-html.php"/>
+<entry name="tidy_get_opt_doc" url="function.tidy-get-opt-doc.php"/>
+<entry name="tidy_get_output" url="function.tidy-get-output.php"/>
+<entry name="tidy_get_release" url="function.tidy-get-release.php"/>
+<entry name="tidy_get_root" url="function.tidy-get-root.php"/>
+<entry name="tidy_get_status" url="function.tidy-get-status.php"/>
+<entry name="tidy_getopt" url="function.tidy-getopt.php"/>
+<entry name="tidy_is_xhtml" url="function.tidy-is-xhtml.php"/>
+<entry name="tidy_is_xml" url="function.tidy-is-xml.php"/>
+<entry name="tidy_load_config" url="function.tidy-load-config.php"/>
+<entry name="tidy_node->get_attr" url="function.tidy-node-get-attr.php"/>
+<entry name="tidy_node->get_nodes" url="function.tidy-node-get-nodes.php"/>
+<entry name="tidy_node->next" url="function.tidy-node-next.php"/>
+<entry name="tidy_node->prev" url="function.tidy-node-prev.php"/>
+<entry name="tidy_parse_file" url="function.tidy-parse-file.php"/>
+<entry name="tidy_parse_string" url="function.tidy-parse-string.php"/>
+<entry name="tidy_repair_file" url="function.tidy-repair-file.php"/>
+<entry name="tidy_repair_string" url="function.tidy-repair-string.php"/>
+<entry name="tidy_reset_config" url="function.tidy-reset-config.php"/>
+<entry name="tidy_save_config" url="function.tidy-save-config.php"/>
+<entry name="tidy_set_encoding" url="function.tidy-set-encoding.php"/>
+<entry name="tidy_setopt" url="function.tidy-setopt.php"/>
+<entry name="tidy_warning_count" url="function.tidy-warning-count.php"/>
+<entry name="tidyNode->hasChildren" url="function.tidynode-haschildren.php"/>
+<entry name="tidyNode->hasSiblings" url="function.tidynode-hassiblings.php"/>
+<entry name="tidyNode->isAsp" url="function.tidynode-isasp.php"/>
+<entry name="tidyNode->isComment" url="function.tidynode-iscomment.php"/>
+<entry name="tidyNode->isHtml" url="function.tidynode-ishtml.php"/>
+<entry name="tidyNode->isJste" url="function.tidynode-isjste.php"/>
+<entry name="tidyNode->isPhp" url="function.tidynode-isphp.php"/>
+<entry name="tidyNode->isText" url="function.tidynode-istext.php"/>
+<entry name="tidyNode::getParent" url="function.tidynode-getparent.php"/>
+<entry name="token_get_all" url="function.token-get-all.php"/>
+<entry name="token_name" url="function.token-name.php"/>
+<entry name="base64_decode" url="function.base64-decode.php"/>
+<entry name="base64_encode" url="function.base64-encode.php"/>
+<entry name="get_headers" url="function.get-headers.php"/>
+<entry name="get_meta_tags" url="function.get-meta-tags.php"/>
+<entry name="http_build_query" url="function.http-build-query.php"/>
+<entry name="parse_url" url="function.parse-url.php"/>
+<entry name="rawurldecode" url="function.rawurldecode.php"/>
+<entry name="rawurlencode" url="function.rawurlencode.php"/>
+<entry name="urldecode" url="function.urldecode.php"/>
+<entry name="urlencode" url="function.urlencode.php"/>
+<entry name="curl_close" url="function.curl-close.php"/>
+<entry name="curl_copy_handle" url="function.curl-copy-handle.php"/>
+<entry name="curl_errno" url="function.curl-errno.php"/>
+<entry name="curl_error" url="function.curl-error.php"/>
+<entry name="curl_exec" url="function.curl-exec.php"/>
+<entry name="curl_getinfo" url="function.curl-getinfo.php"/>
+<entry name="curl_init" url="function.curl-init.php"/>
+<entry name="curl_multi_add_handle" url="function.curl-multi-add-handle.php"/>
+<entry name="curl_multi_close" url="function.curl-multi-close.php"/>
+<entry name="curl_multi_exec" url="function.curl-multi-exec.php"/>
+<entry name="curl_multi_getcontent" url="function.curl-multi-getcontent.php"/>
+<entry name="curl_multi_info_read" url="function.curl-multi-info-read.php"/>
+<entry name="curl_multi_init" url="function.curl-multi-init.php"/>
+<entry name="curl_multi_remove_handle" url="function.curl-multi-remove-handle.php"/>
+<entry name="curl_multi_select" url="function.curl-multi-select.php"/>
+<entry name="curl_setopt_array" url="function.curl-setopt-array.php"/>
+<entry name="curl_setopt" url="function.curl-setopt.php"/>
+<entry name="curl_version" url="function.curl-version.php"/>
+<entry name="fam_cancel_monitor" url="function.fam-cancel-monitor.php"/>
+<entry name="fam_close" url="function.fam-close.php"/>
+<entry name="fam_monitor_collection" url="function.fam-monitor-collection.php"/>
+<entry name="fam_monitor_directory" url="function.fam-monitor-directory.php"/>
+<entry name="fam_monitor_file" url="function.fam-monitor-file.php"/>
+<entry name="fam_next_event" url="function.fam-next-event.php"/>
+<entry name="fam_open" url="function.fam-open.php"/>
+<entry name="fam_pending" url="function.fam-pending.php"/>
+<entry name="fam_resume_monitor" url="function.fam-resume-monitor.php"/>
+<entry name="fam_suspend_monitor" url="function.fam-suspend-monitor.php"/>
+<entry name="ftp_alloc" url="function.ftp-alloc.php"/>
+<entry name="ftp_cdup" url="function.ftp-cdup.php"/>
+<entry name="ftp_chdir" url="function.ftp-chdir.php"/>
+<entry name="ftp_chmod" url="function.ftp-chmod.php"/>
+<entry name="ftp_close" url="function.ftp-close.php"/>
+<entry name="ftp_connect" url="function.ftp-connect.php"/>
+<entry name="ftp_delete" url="function.ftp-delete.php"/>
+<entry name="ftp_exec" url="function.ftp-exec.php"/>
+<entry name="ftp_fget" url="function.ftp-fget.php"/>
+<entry name="ftp_fput" url="function.ftp-fput.php"/>
+<entry name="ftp_get_option" url="function.ftp-get-option.php"/>
+<entry name="ftp_get" url="function.ftp-get.php"/>
+<entry name="ftp_login" url="function.ftp-login.php"/>
+<entry name="ftp_mdtm" url="function.ftp-mdtm.php"/>
+<entry name="ftp_mkdir" url="function.ftp-mkdir.php"/>
+<entry name="ftp_nb_continue" url="function.ftp-nb-continue.php"/>
+<entry name="ftp_nb_fget" url="function.ftp-nb-fget.php"/>
+<entry name="ftp_nb_fput" url="function.ftp-nb-fput.php"/>
+<entry name="ftp_nb_get" url="function.ftp-nb-get.php"/>
+<entry name="ftp_nb_put" url="function.ftp-nb-put.php"/>
+<entry name="ftp_nlist" url="function.ftp-nlist.php"/>
+<entry name="ftp_pasv" url="function.ftp-pasv.php"/>
+<entry name="ftp_put" url="function.ftp-put.php"/>
+<entry name="ftp_pwd" url="function.ftp-pwd.php"/>
+<entry name="ftp_quit" url="function.ftp-quit.php"/>
+<entry name="ftp_raw" url="function.ftp-raw.php"/>
+<entry name="ftp_rawlist" url="function.ftp-rawlist.php"/>
+<entry name="ftp_rename" url="function.ftp-rename.php"/>
+<entry name="ftp_rmdir" url="function.ftp-rmdir.php"/>
+<entry name="ftp_set_option" url="function.ftp-set-option.php"/>
+<entry name="ftp_site" url="function.ftp-site.php"/>
+<entry name="ftp_size" url="function.ftp-size.php"/>
+<entry name="ftp_ssl_connect" url="function.ftp-ssl-connect.php"/>
+<entry name="ftp_systype" url="function.ftp-systype.php"/>
+<entry name="hw_Array2Objrec" url="function.hw-array2objrec.php"/>
+<entry name="hw_changeobject" url="function.hw-changeobject.php"/>
+<entry name="hw_Children" url="function.hw-children.php"/>
+<entry name="hw_ChildrenObj" url="function.hw-childrenobj.php"/>
+<entry name="hw_Close" url="function.hw-close.php"/>
+<entry name="hw_Connect" url="function.hw-connect.php"/>
+<entry name="hw_connection_info" url="function.hw-connection-info.php"/>
+<entry name="hw_cp" url="function.hw-cp.php"/>
+<entry name="hw_Deleteobject" url="function.hw-deleteobject.php"/>
+<entry name="hw_DocByAnchor" url="function.hw-docbyanchor.php"/>
+<entry name="hw_DocByAnchorObj" url="function.hw-docbyanchorobj.php"/>
+<entry name="hw_Document_Attributes" url="function.hw-document-attributes.php"/>
+<entry name="hw_Document_BodyTag" url="function.hw-document-bodytag.php"/>
+<entry name="hw_Document_Content" url="function.hw-document-content.php"/>
+<entry name="hw_Document_SetContent" url="function.hw-document-setcontent.php"/>
+<entry name="hw_Document_Size" url="function.hw-document-size.php"/>
+<entry name="hw_dummy" url="function.hw-dummy.php"/>
+<entry name="hw_EditText" url="function.hw-edittext.php"/>
+<entry name="hw_Error" url="function.hw-error.php"/>
+<entry name="hw_ErrorMsg" url="function.hw-errormsg.php"/>
+<entry name="hw_Free_Document" url="function.hw-free-document.php"/>
+<entry name="hw_GetAnchors" url="function.hw-getanchors.php"/>
+<entry name="hw_GetAnchorsObj" url="function.hw-getanchorsobj.php"/>
+<entry name="hw_GetAndLock" url="function.hw-getandlock.php"/>
+<entry name="hw_GetChildColl" url="function.hw-getchildcoll.php"/>
+<entry name="hw_GetChildCollObj" url="function.hw-getchildcollobj.php"/>
+<entry name="hw_GetChildDocColl" url="function.hw-getchilddoccoll.php"/>
+<entry name="hw_GetChildDocCollObj" url="function.hw-getchilddoccollobj.php"/>
+<entry name="hw_GetObject" url="function.hw-getobject.php"/>
+<entry name="hw_GetObjectByQuery" url="function.hw-getobjectbyquery.php"/>
+<entry name="hw_GetObjectByQueryColl" url="function.hw-getobjectbyquerycoll.php"/>
+<entry name="hw_GetObjectByQueryCollObj" url="function.hw-getobjectbyquerycollobj.php"/>
+<entry name="hw_GetObjectByQueryObj" url="function.hw-getobjectbyqueryobj.php"/>
+<entry name="hw_GetParents" url="function.hw-getparents.php"/>
+<entry name="hw_GetParentsObj" url="function.hw-getparentsobj.php"/>
+<entry name="hw_getrellink" url="function.hw-getrellink.php"/>
+<entry name="hw_GetRemote" url="function.hw-getremote.php"/>
+<entry name="hw_getremotechildren" url="function.hw-getremotechildren.php"/>
+<entry name="hw_GetSrcByDestObj" url="function.hw-getsrcbydestobj.php"/>
+<entry name="hw_GetText" url="function.hw-gettext.php"/>
+<entry name="hw_getusername" url="function.hw-getusername.php"/>
+<entry name="hw_Identify" url="function.hw-identify.php"/>
+<entry name="hw_InCollections" url="function.hw-incollections.php"/>
+<entry name="hw_Info" url="function.hw-info.php"/>
+<entry name="hw_InsColl" url="function.hw-inscoll.php"/>
+<entry name="hw_InsDoc" url="function.hw-insdoc.php"/>
+<entry name="hw_insertanchors" url="function.hw-insertanchors.php"/>
+<entry name="hw_InsertDocument" url="function.hw-insertdocument.php"/>
+<entry name="hw_InsertObject" url="function.hw-insertobject.php"/>
+<entry name="hw_mapid" url="function.hw-mapid.php"/>
+<entry name="hw_Modifyobject" url="function.hw-modifyobject.php"/>
+<entry name="hw_mv" url="function.hw-mv.php"/>
+<entry name="hw_New_Document" url="function.hw-new-document.php"/>
+<entry name="hw_objrec2array" url="function.hw-objrec2array.php"/>
+<entry name="hw_Output_Document" url="function.hw-output-document.php"/>
+<entry name="hw_pConnect" url="function.hw-pconnect.php"/>
+<entry name="hw_PipeDocument" url="function.hw-pipedocument.php"/>
+<entry name="hw_Root" url="function.hw-root.php"/>
+<entry name="hw_setlinkroot" url="function.hw-setlinkroot.php"/>
+<entry name="hw_stat" url="function.hw-stat.php"/>
+<entry name="hw_Unlock" url="function.hw-unlock.php"/>
+<entry name="hw_Who" url="function.hw-who.php"/>
+<entry name="hw_api_attribute->key" url="function.hwapi-attribute-key.php"/>
+<entry name="hw_api_attribute->langdepvalue" url="function.hwapi-attribute-langdepvalue.php"/>
+<entry name="hw_api_attribute->value" url="function.hwapi-attribute-value.php"/>
+<entry name="hw_api_attribute->values" url="function.hwapi-attribute-values.php"/>
+<entry name="hw_api_attribute" url="function.hwapi-attribute.php"/>
+<entry name="hw_api->checkin" url="function.hwapi-checkin.php"/>
+<entry name="hw_api->checkout" url="function.hwapi-checkout.php"/>
+<entry name="hw_api->children" url="function.hwapi-children.php"/>
+<entry name="hw_api_content->mimetype" url="function.hwapi-content-mimetype.php"/>
+<entry name="hw_api_content->read" url="function.hwapi-content-read.php"/>
+<entry name="hw_api->content" url="function.hwapi-content.php"/>
+<entry name="hw_api->copy" url="function.hwapi-copy.php"/>
+<entry name="hw_api->dbstat" url="function.hwapi-dbstat.php"/>
+<entry name="hw_api->dcstat" url="function.hwapi-dcstat.php"/>
+<entry name="hw_api->dstanchors" url="function.hwapi-dstanchors.php"/>
+<entry name="hw_api->dstofsrcanchor" url="function.hwapi-dstofsrcanchor.php"/>
+<entry name="hw_api_error->count" url="function.hwapi-error-count.php"/>
+<entry name="hw_api_error->reason" url="function.hwapi-error-reason.php"/>
+<entry name="hw_api->find" url="function.hwapi-find.php"/>
+<entry name="hw_api->ftstat" url="function.hwapi-ftstat.php"/>
+<entry name="hwapi_hgcsp" url="function.hwapi-hgcsp.php"/>
+<entry name="hw_api->hwstat" url="function.hwapi-hwstat.php"/>
+<entry name="hw_api->identify" url="function.hwapi-identify.php"/>
+<entry name="hw_api->info" url="function.hwapi-info.php"/>
+<entry name="hw_api->insert" url="function.hwapi-insert.php"/>
+<entry name="hw_api->insertanchor" url="function.hwapi-insertanchor.php"/>
+<entry name="hw_api->insertcollection" url="function.hwapi-insertcollection.php"/>
+<entry name="hw_api->insertdocument" url="function.hwapi-insertdocument.php"/>
+<entry name="hw_api->link" url="function.hwapi-link.php"/>
+<entry name="hw_api->lock" url="function.hwapi-lock.php"/>
+<entry name="hw_api->move" url="function.hwapi-move.php"/>
+<entry name="hw_api_content" url="function.hwapi-new-content.php"/>
+<entry name="hw_api_object->assign" url="function.hwapi-object-assign.php"/>
+<entry name="hw_api_object->attreditable" url="function.hwapi-object-attreditable.php"/>
+<entry name="hw_api_object->count" url="function.hwapi-object-count.php"/>
+<entry name="hw_api_object->insert" url="function.hwapi-object-insert.php"/>
+<entry name="hw_api_object" url="function.hwapi-object-new.php"/>
+<entry name="hw_api_object->remove" url="function.hwapi-object-remove.php"/>
+<entry name="hw_api_object->title" url="function.hwapi-object-title.php"/>
+<entry name="hw_api_object->value" url="function.hwapi-object-value.php"/>
+<entry name="hw_api->object" url="function.hwapi-object.php"/>
+<entry name="hw_api->objectbyanchor" url="function.hwapi-objectbyanchor.php"/>
+<entry name="hw_api->parents" url="function.hwapi-parents.php"/>
+<entry name="hw_api_reason->description" url="function.hwapi-reason-description.php"/>
+<entry name="hw_api_reason->type" url="function.hwapi-reason-type.php"/>
+<entry name="hw_api->remove" url="function.hwapi-remove.php"/>
+<entry name="hw_api->replace" url="function.hwapi-replace.php"/>
+<entry name="hw_api->setcommittedversion" url="function.hwapi-setcommittedversion.php"/>
+<entry name="hw_api->srcanchors" url="function.hwapi-srcanchors.php"/>
+<entry name="hw_api->srcsofdst" url="function.hwapi-srcsofdst.php"/>
+<entry name="hw_api->unlock" url="function.hwapi-unlock.php"/>
+<entry name="hw_api->user" url="function.hwapi-user.php"/>
+<entry name="hw_api->userlist" url="function.hwapi-userlist.php"/>
+<entry name="HttpDeflateStream::__construct" url="function.httpdeflatestream-construct.php"/>
+<entry name="HttpDeflateStream::factory" url="function.httpdeflatestream-factory.php"/>
+<entry name="HttpDeflateStream::finish" url="function.httpdeflatestream-finish.php"/>
+<entry name="HttpDeflateStream::flush" url="function.httpdeflatestream-flush.php"/>
+<entry name="HttpDeflateStream::update" url="function.httpdeflatestream-update.php"/>
+<entry name="HttpInflateStream::__construct" url="function.httpinflatestream-construct.php"/>
+<entry name="HttpInflateStream::factory" url="function.httpinflatestream-factory.php"/>
+<entry name="HttpInflateStream::finish" url="function.httpinflatestream-finish.php"/>
+<entry name="HttpInflateStream::flush" url="function.httpinflatestream-flush.php"/>
+<entry name="HttpInflateStream::update" url="function.httpinflatestream-update.php"/>
+<entry name="HttpMessage::addHeaders" url="function.httpmessage-addheaders.php"/>
+<entry name="HttpMessage::__construct" url="function.httpmessage-construct.php"/>
+<entry name="HttpMessage::detach" url="function.httpmessage-detach.php"/>
+<entry name="HttpMessage::factory" url="function.httpmessage-factory.php"/>
+<entry name="HttpMessage::fromEnv" url="function.httpmessage-fromenv.php"/>
+<entry name="HttpMessage::fromString" url="function.httpmessage-fromstring.php"/>
+<entry name="HttpMessage::getBody" url="function.httpmessage-getbody.php"/>
+<entry name="HttpMessage::getHeader" url="function.httpmessage-getheader.php"/>
+<entry name="HttpMessage::getHeaders" url="function.httpmessage-getheaders.php"/>
+<entry name="HttpMessage::getHttpVersion" url="function.httpmessage-gethttpversion.php"/>
+<entry name="HttpMessage::getParentMessage" url="function.httpmessage-getparentmessage.php"/>
+<entry name="HttpMessage::getRequestMethod" url="function.httpmessage-getrequestmethod.php"/>
+<entry name="HttpMessage::getRequestUrl" url="function.httpmessage-getrequesturl.php"/>
+<entry name="HttpMessage::getResponseCode" url="function.httpmessage-getresponsecode.php"/>
+<entry name="HttpMessage::getResponseStatus" url="function.httpmessage-getresponsestatus.php"/>
+<entry name="HttpMessage::getType" url="function.httpmessage-gettype.php"/>
+<entry name="HttpMessage::guessContentType" url="function.httpmessage-guesscontenttype.php"/>
+<entry name="HttpMessage::prepend" url="function.httpmessage-prepend.php"/>
+<entry name="HttpMessage::reverse" url="function.httpmessage-reverse.php"/>
+<entry name="HttpMessage::send" url="function.httpmessage-send.php"/>
+<entry name="HttpMessage::setBody" url="function.httpmessage-setbody.php"/>
+<entry name="HttpMessage::setHeaders" url="function.httpmessage-setheaders.php"/>
+<entry name="HttpMessage::setHttpVersion" url="function.httpmessage-sethttpversion.php"/>
+<entry name="HttpMessage::setRequestMethod" url="function.httpmessage-setrequestmethod.php"/>
+<entry name="HttpMessage::setRequestUrl" url="function.httpmessage-setrequesturl.php"/>
+<entry name="HttpMessage::setResponseCode" url="function.httpmessage-setresponsecode.php"/>
+<entry name="HttpMessage::setResponseStatus" url="function.httpmessage-setresponsestatus.php"/>
+<entry name="HttpMessage::setType" url="function.httpmessage-settype.php"/>
+<entry name="HttpMessage::toMessageTypeObject" url="function.httpmessage-tomessagetypeobject.php"/>
+<entry name="HttpMessage::toString" url="function.httpmessage-tostring.php"/>
+<entry name="HttpQueryString::__construct" url="function.httpquerystring-construct.php"/>
+<entry name="HttpQueryString::get" url="function.httpquerystring-get.php"/>
+<entry name="HttpQueryString::mod" url="function.httpquerystring-mod.php"/>
+<entry name="HttpQueryString::set" url="function.httpquerystring-set.php"/>
+<entry name="HttpQueryString::singleton" url="function.httpquerystring-singleton.php"/>
+<entry name="HttpQueryString::toArray" url="function.httpquerystring-toarray.php"/>
+<entry name="HttpQueryString::toString" url="function.httpquerystring-tostring.php"/>
+<entry name="HttpQueryString::xlate" url="function.httpquerystring-xlate.php"/>
+<entry name="HttpRequest::addCookies" url="function.httprequest-addcookies.php"/>
+<entry name="HttpRequest::addHeaders" url="function.httprequest-addheaders.php"/>
+<entry name="HttpRequest::addPostFields" url="function.httprequest-addpostfields.php"/>
+<entry name="HttpRequest::addPostFile" url="function.httprequest-addpostfile.php"/>
+<entry name="HttpRequest::addPutData" url="function.httprequest-addputdata.php"/>
+<entry name="HttpRequest::addQueryData" url="function.httprequest-addquerydata.php"/>
+<entry name="HttpRequest::addRawPostData" url="function.httprequest-addrawpostdata.php"/>
+<entry name="HttpRequest::addSslOptions" url="function.httprequest-addssloptions.php"/>
+<entry name="HttpRequest::clearHistory" url="function.httprequest-clearhistory.php"/>
+<entry name="HttpRequest::__construct" url="function.httprequest-construct.php"/>
+<entry name="HttpRequest::enableCookies" url="function.httprequest-enablecookies.php"/>
+<entry name="HttpRequest::getContentType" url="function.httprequest-getcontenttype.php"/>
+<entry name="HttpRequest::getCookies" url="function.httprequest-getcookies.php"/>
+<entry name="HttpRequest::getHeaders" url="function.httprequest-getheaders.php"/>
+<entry name="HttpRequest::getHistory" url="function.httprequest-gethistory.php"/>
+<entry name="HttpRequest::getMethod" url="function.httprequest-getmethod.php"/>
+<entry name="HttpRequest::getOptions" url="function.httprequest-getoptions.php"/>
+<entry name="HttpRequest::getPostFields" url="function.httprequest-getpostfields.php"/>
+<entry name="HttpRequest::getPostFiles" url="function.httprequest-getpostfiles.php"/>
+<entry name="HttpRequest::getPutData" url="function.httprequest-getputdata.php"/>
+<entry name="HttpRequest::getPutFile" url="function.httprequest-getputfile.php"/>
+<entry name="HttpRequest::getQueryData" url="function.httprequest-getquerydata.php"/>
+<entry name="HttpRequest::getRawPostData" url="function.httprequest-getrawpostdata.php"/>
+<entry name="HttpRequest::getRawRequestMessage" url="function.httprequest-getrawrequestmessage.php"/>
+<entry name="HttpRequest::getRawResponseMessage" url="function.httprequest-getrawresponsemessage.php"/>
+<entry name="HttpRequest::getRequestMessage" url="function.httprequest-getrequestmessage.php"/>
+<entry name="HttpRequest::getResponseBody" url="function.httprequest-getresponsebody.php"/>
+<entry name="HttpRequest::getResponseCode" url="function.httprequest-getresponsecode.php"/>
+<entry name="HttpRequest::getResponseCookies" url="function.httprequest-getresponsecookies.php"/>
+<entry name="HttpRequest::getResponseData" url="function.httprequest-getresponsedata.php"/>
+<entry name="HttpRequest::getResponseHeader" url="function.httprequest-getresponseheader.php"/>
+<entry name="HttpRequest::getResponseInfo" url="function.httprequest-getresponseinfo.php"/>
+<entry name="HttpRequest::getResponseMessage" url="function.httprequest-getresponsemessage.php"/>
+<entry name="HttpRequest::getResponseStatus" url="function.httprequest-getresponsestatus.php"/>
+<entry name="HttpRequest::getSslOptions" url="function.httprequest-getssloptions.php"/>
+<entry name="HttpRequest::getUrl" url="function.httprequest-geturl.php"/>
+<entry name="HttpRequest::resetCookies" url="function.httprequest-resetcookies.php"/>
+<entry name="HttpRequest::send" url="function.httprequest-send.php"/>
+<entry name="HttpRequest::setContentType" url="function.httprequest-setcontenttype.php"/>
+<entry name="HttpRequest::setCookies" url="function.httprequest-setcookies.php"/>
+<entry name="HttpRequest::setHeaders" url="function.httprequest-setheaders.php"/>
+<entry name="HttpRequest::setMethod" url="function.httprequest-setmethod.php"/>
+<entry name="HttpRequest::setOptions" url="function.httprequest-setoptions.php"/>
+<entry name="HttpRequest::setPostFields" url="function.httprequest-setpostfields.php"/>
+<entry name="HttpRequest::setPostFiles" url="function.httprequest-setpostfiles.php"/>
+<entry name="HttpRequest::setPutData" url="function.httprequest-setputdata.php"/>
+<entry name="HttpRequest::setPutFile" url="function.httprequest-setputfile.php"/>
+<entry name="HttpRequest::setQueryData" url="function.httprequest-setquerydata.php"/>
+<entry name="HttpRequest::setRawPostData" url="function.httprequest-setrawpostdata.php"/>
+<entry name="HttpRequest::setSslOptions" url="function.httprequest-setssloptions.php"/>
+<entry name="HttpRequest::setUrl" url="function.httprequest-seturl.php"/>
+<entry name="HttpRequestPool::attach" url="function.httprequestpool-attach.php"/>
+<entry name="HttpRequestPool::__construct" url="function.httprequestpool-construct.php"/>
+<entry name="HttpRequestPool::__destruct" url="function.httprequestpool-destruct.php"/>
+<entry name="HttpRequestPool::detach" url="function.httprequestpool-detach.php"/>
+<entry name="HttpRequestPool::getAttachedRequests" url="function.httprequestpool-getattachedrequests.php"/>
+<entry name="HttpRequestPool::getFinishedRequests" url="function.httprequestpool-getfinishedrequests.php"/>
+<entry name="HttpRequestPool::reset" url="function.httprequestpool-reset.php"/>
+<entry name="HttpRequestPool::send" url="function.httprequestpool-send.php"/>
+<entry name="HttpRequestPool::socketPerform" url="function.httprequestpool-socketperform.php"/>
+<entry name="HttpRequestPool::socketSelect" url="function.httprequestpool-socketselect.php"/>
+<entry name="HttpResponse::capture" url="function.httpresponse-capture.php"/>
+<entry name="HttpResponse::getBufferSize" url="function.httpresponse-getbuffersize.php"/>
+<entry name="HttpResponse::getCache" url="function.httpresponse-getcache.php"/>
+<entry name="HttpResponse::getCacheControl" url="function.httpresponse-getcachecontrol.php"/>
+<entry name="HttpResponse::getContentDisposition" url="function.httpresponse-getcontentdisposition.php"/>
+<entry name="HttpResponse::getContentType" url="function.httpresponse-getcontenttype.php"/>
+<entry name="HttpResponse::getData" url="function.httpresponse-getdata.php"/>
+<entry name="HttpResponse::getETag" url="function.httpresponse-getetag.php"/>
+<entry name="HttpResponse::getFile" url="function.httpresponse-getfile.php"/>
+<entry name="HttpResponse::getGzip" url="function.httpresponse-getgzip.php"/>
+<entry name="HttpResponse::getHeader" url="function.httpresponse-getheader.php"/>
+<entry name="HttpResponse::getLastModified" url="function.httpresponse-getlastmodified.php"/>
+<entry name="HttpResponse::getRequestBody" url="function.httpresponse-getrequestbody.php"/>
+<entry name="HttpResponse::getRequestBodyStream" url="function.httpresponse-getrequestbodystream.php"/>
+<entry name="HttpResponse::getRequestHeaders" url="function.httpresponse-getrequestheaders.php"/>
+<entry name="HttpResponse::getStream" url="function.httpresponse-getstream.php"/>
+<entry name="HttpResponse::getThrottleDelay" url="function.httpresponse-getthrottledelay.php"/>
+<entry name="HttpResponse::guessContentType" url="function.httpresponse-guesscontenttype.php"/>
+<entry name="HttpResponse::redirect" url="function.httpresponse-redirect.php"/>
+<entry name="HttpResponse::send" url="function.httpresponse-send.php"/>
+<entry name="HttpResponse::setBufferSize" url="function.httpresponse-setbuffersize.php"/>
+<entry name="HttpResponse::setCache" url="function.httpresponse-setcache.php"/>
+<entry name="HttpResponse::setCacheControl" url="function.httpresponse-setcachecontrol.php"/>
+<entry name="HttpResponse::setContentDisposition" url="function.httpresponse-setcontentdisposition.php"/>
+<entry name="HttpResponse::setContentType" url="function.httpresponse-setcontenttype.php"/>
+<entry name="HttpResponse::setData" url="function.httpresponse-setdata.php"/>
+<entry name="HttpResponse::setETag" url="function.httpresponse-setetag.php"/>
+<entry name="HttpResponse::setFile" url="function.httpresponse-setfile.php"/>
+<entry name="HttpResponse::setGzip" url="function.httpresponse-setgzip.php"/>
+<entry name="HttpResponse::setHeader" url="function.httpresponse-setheader.php"/>
+<entry name="HttpResponse::setLastModified" url="function.httpresponse-setlastmodified.php"/>
+<entry name="HttpResponse::setStream" url="function.httpresponse-setstream.php"/>
+<entry name="HttpResponse::setThrottleDelay" url="function.httpresponse-setthrottledelay.php"/>
+<entry name="HttpResponse::status" url="function.httpresponse-status.php"/>
+<entry name="http_cache_etag" url="function.http-cache-etag.php"/>
+<entry name="http_cache_last_modified" url="function.http-cache-last-modified.php"/>
+<entry name="http_chunked_decode" url="function.http-chunked-decode.php"/>
+<entry name="http_deflate" url="function.http-deflate.php"/>
+<entry name="http_inflate" url="function.http-inflate.php"/>
+<entry name="http_build_cookie" url="function.http-build-cookie.php"/>
+<entry name="http_date" url="function.http-date.php"/>
+<entry name="http_get_request_body_stream" url="function.http-get-request-body-stream.php"/>
+<entry name="http_get_request_body" url="function.http-get-request-body.php"/>
+<entry name="http_get_request_headers" url="function.http-get-request-headers.php"/>
+<entry name="http_match_etag" url="function.http-match-etag.php"/>
+<entry name="http_match_modified" url="function.http-match-modified.php"/>
+<entry name="http_match_request_header" url="function.http-match-request-header.php"/>
+<entry name="http_support" url="function.http-support.php"/>
+<entry name="http_negotiate_charset" url="function.http-negotiate-charset.php"/>
+<entry name="http_negotiate_content_type" url="function.http-negotiate-content-type.php"/>
+<entry name="http_negotiate_language" url="function.http-negotiate-language.php"/>
+<entry name="ob_deflatehandler" url="function.ob-deflatehandler.php"/>
+<entry name="ob_etaghandler" url="function.ob-etaghandler.php"/>
+<entry name="ob_inflatehandler" url="function.ob-inflatehandler.php"/>
+<entry name="http_parse_cookie" url="function.http-parse-cookie.php"/>
+<entry name="http_parse_headers" url="function.http-parse-headers.php"/>
+<entry name="http_parse_message" url="function.http-parse-message.php"/>
+<entry name="http_parse_params" url="function.http-parse-params.php"/>
+<entry name="http_persistent_handles_clean" url="function.http-persistent-handles-clean.php"/>
+<entry name="http_persistent_handles_count" url="function.http-persistent-handles-count.php"/>
+<entry name="http_persistent_handles_ident" url="function.http-persistent-handles-ident.php"/>
+<entry name="http_get" url="function.http-get.php"/>
+<entry name="http_head" url="function.http-head.php"/>
+<entry name="http_post_data" url="function.http-post-data.php"/>
+<entry name="http_post_fields" url="function.http-post-fields.php"/>
+<entry name="http_put_data" url="function.http-put-data.php"/>
+<entry name="http_put_file" url="function.http-put-file.php"/>
+<entry name="http_put_stream" url="function.http-put-stream.php"/>
+<entry name="http_request_body_encode" url="function.http-request-body-encode.php"/>
+<entry name="http_request_method_exists" url="function.http-request-method-exists.php"/>
+<entry name="http_request_method_name" url="function.http-request-method-name.php"/>
+<entry name="http_request_method_register" url="function.http-request-method-register.php"/>
+<entry name="http_request_method_unregister" url="function.http-request-method-unregister.php"/>
+<entry name="http_request" url="function.http-request.php"/>
+<entry name="http_redirect" url="function.http-redirect.php"/>
+<entry name="http_send_content_disposition" url="function.http-send-content-disposition.php"/>
+<entry name="http_send_content_type" url="function.http-send-content-type.php"/>
+<entry name="http_send_data" url="function.http-send-data.php"/>
+<entry name="http_send_file" url="function.http-send-file.php"/>
+<entry name="http_send_last_modified" url="function.http-send-last-modified.php"/>
+<entry name="http_send_status" url="function.http-send-status.php"/>
+<entry name="http_send_stream" url="function.http-send-stream.php"/>
+<entry name="http_throttle" url="function.http-throttle.php"/>
+<entry name="http_build_str" url="function.http-build-str.php"/>
+<entry name="http_build_url" url="function.http-build-url.php"/>
+<entry name="java_last_exception_clear" url="function.java-last-exception-clear.php"/>
+<entry name="java_last_exception_get" url="function.java-last-exception-get.php"/>
+<entry name="ldap_8859_to_t61" url="function.ldap-8859-to-t61.php"/>
+<entry name="ldap_add" url="function.ldap-add.php"/>
+<entry name="ldap_bind" url="function.ldap-bind.php"/>
+<entry name="ldap_close" url="function.ldap-close.php"/>
+<entry name="ldap_compare" url="function.ldap-compare.php"/>
+<entry name="ldap_connect" url="function.ldap-connect.php"/>
+<entry name="ldap_count_entries" url="function.ldap-count-entries.php"/>
+<entry name="ldap_delete" url="function.ldap-delete.php"/>
+<entry name="ldap_dn2ufn" url="function.ldap-dn2ufn.php"/>
+<entry name="ldap_err2str" url="function.ldap-err2str.php"/>
+<entry name="ldap_errno" url="function.ldap-errno.php"/>
+<entry name="ldap_error" url="function.ldap-error.php"/>
+<entry name="ldap_explode_dn" url="function.ldap-explode-dn.php"/>
+<entry name="ldap_first_attribute" url="function.ldap-first-attribute.php"/>
+<entry name="ldap_first_entry" url="function.ldap-first-entry.php"/>
+<entry name="ldap_first_reference" url="function.ldap-first-reference.php"/>
+<entry name="ldap_free_result" url="function.ldap-free-result.php"/>
+<entry name="ldap_get_attributes" url="function.ldap-get-attributes.php"/>
+<entry name="ldap_get_dn" url="function.ldap-get-dn.php"/>
+<entry name="ldap_get_entries" url="function.ldap-get-entries.php"/>
+<entry name="ldap_get_option" url="function.ldap-get-option.php"/>
+<entry name="ldap_get_values_len" url="function.ldap-get-values-len.php"/>
+<entry name="ldap_get_values" url="function.ldap-get-values.php"/>
+<entry name="ldap_list" url="function.ldap-list.php"/>
+<entry name="ldap_mod_add" url="function.ldap-mod-add.php"/>
+<entry name="ldap_mod_del" url="function.ldap-mod-del.php"/>
+<entry name="ldap_mod_replace" url="function.ldap-mod-replace.php"/>
+<entry name="ldap_modify" url="function.ldap-modify.php"/>
+<entry name="ldap_next_attribute" url="function.ldap-next-attribute.php"/>
+<entry name="ldap_next_entry" url="function.ldap-next-entry.php"/>
+<entry name="ldap_next_reference" url="function.ldap-next-reference.php"/>
+<entry name="ldap_parse_reference" url="function.ldap-parse-reference.php"/>
+<entry name="ldap_parse_result" url="function.ldap-parse-result.php"/>
+<entry name="ldap_read" url="function.ldap-read.php"/>
+<entry name="ldap_rename" url="function.ldap-rename.php"/>
+<entry name="ldap_sasl_bind" url="function.ldap-sasl-bind.php"/>
+<entry name="ldap_search" url="function.ldap-search.php"/>
+<entry name="ldap_set_option" url="function.ldap-set-option.php"/>
+<entry name="ldap_set_rebind_proc" url="function.ldap-set-rebind-proc.php"/>
+<entry name="ldap_sort" url="function.ldap-sort.php"/>
+<entry name="ldap_start_tls" url="function.ldap-start-tls.php"/>
+<entry name="ldap_t61_to_8859" url="function.ldap-t61-to-8859.php"/>
+<entry name="ldap_unbind" url="function.ldap-unbind.php"/>
+<entry name="notes_body" url="function.notes-body.php"/>
+<entry name="notes_copy_db" url="function.notes-copy-db.php"/>
+<entry name="notes_create_db" url="function.notes-create-db.php"/>
+<entry name="notes_create_note" url="function.notes-create-note.php"/>
+<entry name="notes_drop_db" url="function.notes-drop-db.php"/>
+<entry name="notes_find_note" url="function.notes-find-note.php"/>
+<entry name="notes_header_info" url="function.notes-header-info.php"/>
+<entry name="notes_list_msgs" url="function.notes-list-msgs.php"/>
+<entry name="notes_mark_read" url="function.notes-mark-read.php"/>
+<entry name="notes_mark_unread" url="function.notes-mark-unread.php"/>
+<entry name="notes_nav_create" url="function.notes-nav-create.php"/>
+<entry name="notes_search" url="function.notes-search.php"/>
+<entry name="notes_unread" url="function.notes-unread.php"/>
+<entry name="notes_version" url="function.notes-version.php"/>
+<entry name="Memcache::add" url="function.memcache-add.php"/>
+<entry name="Memcache::addServer" url="function.memcache-addserver.php"/>
+<entry name="Memcache::close" url="function.memcache-close.php"/>
+<entry name="Memcache::connect" url="function.memcache-connect.php"/>
+<entry name="memcache_debug" url="function.memcache-debug.php"/>
+<entry name="Memcache::decrement" url="function.memcache-decrement.php"/>
+<entry name="Memcache::delete" url="function.memcache-delete.php"/>
+<entry name="Memcache::flush" url="function.memcache-flush.php"/>
+<entry name="Memcache::get" url="function.memcache-get.php"/>
+<entry name="Memcache::getExtendedStats" url="function.memcache-getextendedstats.php"/>
+<entry name="Memcache::getServerStatus" url="function.memcache-getserverstatus.php"/>
+<entry name="Memcache::getStats" url="function.memcache-getstats.php"/>
+<entry name="Memcache::getVersion" url="function.memcache-getversion.php"/>
+<entry name="Memcache::increment" url="function.memcache-increment.php"/>
+<entry name="Memcache::pconnect" url="function.memcache-pconnect.php"/>
+<entry name="Memcache::replace" url="function.memcache-replace.php"/>
+<entry name="Memcache::set" url="function.memcache-set.php"/>
+<entry name="Memcache::setCompressThreshold" url="function.memcache-setcompressthreshold.php"/>
+<entry name="Memcache::setServerParams" url="function.memcache-setserverparams.php"/>
+<entry name="udm_add_search_limit" url="function.udm-add-search-limit.php"/>
+<entry name="udm_alloc_agent_array" url="function.udm-alloc-agent-array.php"/>
+<entry name="udm_alloc_agent" url="function.udm-alloc-agent.php"/>
+<entry name="udm_api_version" url="function.udm-api-version.php"/>
+<entry name="udm_cat_list" url="function.udm-cat-list.php"/>
+<entry name="udm_cat_path" url="function.udm-cat-path.php"/>
+<entry name="udm_check_charset" url="function.udm-check-charset.php"/>
+<entry name="udm_check_stored" url="function.udm-check-stored.php"/>
+<entry name="udm_clear_search_limits" url="function.udm-clear-search-limits.php"/>
+<entry name="udm_close_stored" url="function.udm-close-stored.php"/>
+<entry name="udm_crc32" url="function.udm-crc32.php"/>
+<entry name="udm_errno" url="function.udm-errno.php"/>
+<entry name="udm_error" url="function.udm-error.php"/>
+<entry name="udm_find" url="function.udm-find.php"/>
+<entry name="udm_free_agent" url="function.udm-free-agent.php"/>
+<entry name="udm_free_ispell_data" url="function.udm-free-ispell-data.php"/>
+<entry name="udm_free_res" url="function.udm-free-res.php"/>
+<entry name="udm_get_doc_count" url="function.udm-get-doc-count.php"/>
+<entry name="udm_get_res_field" url="function.udm-get-res-field.php"/>
+<entry name="udm_get_res_param" url="function.udm-get-res-param.php"/>
+<entry name="udm_hash32" url="function.udm-hash32.php"/>
+<entry name="udm_load_ispell_data" url="function.udm-load-ispell-data.php"/>
+<entry name="udm_open_stored" url="function.udm-open-stored.php"/>
+<entry name="udm_set_agent_param" url="function.udm-set-agent-param.php"/>
+<entry name="mqseries_back" url="function.mqseries-back.php"/>
+<entry name="mqseries_begin" url="function.mqseries-begin.php"/>
+<entry name="mqseries_close" url="function.mqseries-close.php"/>
+<entry name="mqseries_cmit" url="function.mqseries-cmit.php"/>
+<entry name="mqseries_conn" url="function.mqseries-conn.php"/>
+<entry name="mqseries_connx" url="function.mqseries-connx.php"/>
+<entry name="mqseries_disc" url="function.mqseries-disc.php"/>
+<entry name="mqseries_get" url="function.mqseries-get.php"/>
+<entry name="mqseries_inq" url="function.mqseries-inq.php"/>
+<entry name="mqseries_open" url="function.mqseries-open.php"/>
+<entry name="mqseries_put1" url="function.mqseries-put1.php"/>
+<entry name="mqseries_put" url="function.mqseries-put.php"/>
+<entry name="mqseries_set" url="function.mqseries-set.php"/>
+<entry name="mqseries_strerror" url="function.mqseries-strerror.php"/>
+<entry name="gopher_parsedir" url="function.gopher-parsedir.php"/>
+<entry name="checkdnsrr" url="function.checkdnsrr.php"/>
+<entry name="closelog" url="function.closelog.php"/>
+<entry name="define_syslog_variables" url="function.define-syslog-variables.php"/>
+<entry name="dns_check_record" url="function.dns-check-record.php"/>
+<entry name="dns_get_mx" url="function.dns-get-mx.php"/>
+<entry name="dns_get_record" url="function.dns-get-record.php"/>
+<entry name="fsockopen" url="function.fsockopen.php"/>
+<entry name="gethostbyaddr" url="function.gethostbyaddr.php"/>
+<entry name="gethostbyname" url="function.gethostbyname.php"/>
+<entry name="gethostbynamel" url="function.gethostbynamel.php"/>
+<entry name="getmxrr" url="function.getmxrr.php"/>
+<entry name="getprotobyname" url="function.getprotobyname.php"/>
+<entry name="getprotobynumber" url="function.getprotobynumber.php"/>
+<entry name="getservbyname" url="function.getservbyname.php"/>
+<entry name="getservbyport" url="function.getservbyport.php"/>
+<entry name="header" url="function.header.php"/>
+<entry name="headers_list" url="function.headers-list.php"/>
+<entry name="headers_sent" url="function.headers-sent.php"/>
+<entry name="inet_ntop" url="function.inet-ntop.php"/>
+<entry name="inet_pton" url="function.inet-pton.php"/>
+<entry name="ip2long" url="function.ip2long.php"/>
+<entry name="long2ip" url="function.long2ip.php"/>
+<entry name="openlog" url="function.openlog.php"/>
+<entry name="pfsockopen" url="function.pfsockopen.php"/>
+<entry name="setcookie" url="function.setcookie.php"/>
+<entry name="setrawcookie" url="function.setrawcookie.php"/>
+<entry name="socket_get_status" url="function.socket-get-status.php"/>
+<entry name="socket_set_blocking" url="function.socket-set-blocking.php"/>
+<entry name="socket_set_timeout" url="function.socket-set-timeout.php"/>
+<entry name="syslog" url="function.syslog.php"/>
+<entry name="SAMConnection->commit()" url="function.samconnection-commit.php"/>
+<entry name="SAMConnection->connect()" url="function.samconnection-connect.php"/>
+<entry name="SAMConnection->__construct()" url="function.samconnection-constructor.php"/>
+<entry name="SAMConnection->disconnect()" url="function.samconnection-disconnect.php"/>
+<entry name="SAMConnection->errno" url="function.samconnection-errno.php"/>
+<entry name="SAMConnection->error" url="function.samconnection-error.php"/>
+<entry name="SAMConnection->isConnected()" url="function.samconnection-isconnected.php"/>
+<entry name="SAMConnection->peek()" url="function.samconnection-peek.php"/>
+<entry name="SAMConnection->peekAll()" url="function.samconnection-peekall.php"/>
+<entry name="SAMConnection->receive()" url="function.samconnection-receive.php"/>
+<entry name="SAMConnection->remove()" url="function.samconnection-remove.php"/>
+<entry name="SAMConnection->rollback()" url="function.samconnection-rollback.php"/>
+<entry name="SAMConnection->send()" url="function.samconnection-send.php"/>
+<entry name="SAMConnection::setDebug()" url="function.samconnection-setDebug.php"/>
+<entry name="SAMConnection->subscribe()" url="function.samconnection-subscribe.php"/>
+<entry name="SAMConnection->unsubscribe()" url="function.samconnection-unsubscribe.php"/>
+<entry name="SAMMessage->body" url="function.sammessage-body.php"/>
+<entry name="SAMMessage->__construct()" url="function.sammessage-constructor.php"/>
+<entry name="SAMMessage->header" url="function.sammessage-header.php"/>
+<entry name="snmp_get_quick_print" url="function.snmp-get-quick-print.php"/>
+<entry name="snmp_get_valueretrieval" url="function.snmp-get-valueretrieval.php"/>
+<entry name="snmp_read_mib" url="function.snmp-read-mib.php"/>
+<entry name="snmp_set_enum_print" url="function.snmp-set-enum-print.php"/>
+<entry name="snmp_set_oid_numeric_print" url="function.snmp-set-oid-numeric-print.php"/>
+<entry name="snmp_set_oid_output_format" url="function.snmp-set-oid-output-format.php"/>
+<entry name="snmp_set_quick_print" url="function.snmp-set-quick-print.php"/>
+<entry name="snmp_set_valueretrieval" url="function.snmp-set-valueretrieval.php"/>
+<entry name="snmpget" url="function.snmpget.php"/>
+<entry name="snmpgetnext" url="function.snmpgetnext.php"/>
+<entry name="snmprealwalk" url="function.snmprealwalk.php"/>
+<entry name="snmpset" url="function.snmpset.php"/>
+<entry name="snmpwalk" url="function.snmpwalk.php"/>
+<entry name="snmpwalkoid" url="function.snmpwalkoid.php"/>
+<entry name="socket_accept" url="function.socket-accept.php"/>
+<entry name="socket_bind" url="function.socket-bind.php"/>
+<entry name="socket_clear_error" url="function.socket-clear-error.php"/>
+<entry name="socket_close" url="function.socket-close.php"/>
+<entry name="socket_connect" url="function.socket-connect.php"/>
+<entry name="socket_create_listen" url="function.socket-create-listen.php"/>
+<entry name="socket_create_pair" url="function.socket-create-pair.php"/>
+<entry name="socket_create" url="function.socket-create.php"/>
+<entry name="socket_get_option" url="function.socket-get-option.php"/>
+<entry name="socket_getpeername" url="function.socket-getpeername.php"/>
+<entry name="socket_getsockname" url="function.socket-getsockname.php"/>
+<entry name="socket_last_error" url="function.socket-last-error.php"/>
+<entry name="socket_listen" url="function.socket-listen.php"/>
+<entry name="socket_read" url="function.socket-read.php"/>
+<entry name="socket_recv" url="function.socket-recv.php"/>
+<entry name="socket_recvfrom" url="function.socket-recvfrom.php"/>
+<entry name="socket_select" url="function.socket-select.php"/>
+<entry name="socket_send" url="function.socket-send.php"/>
+<entry name="socket_sendto" url="function.socket-sendto.php"/>
+<entry name="socket_set_block" url="function.socket-set-block.php"/>
+<entry name="socket_set_nonblock" url="function.socket-set-nonblock.php"/>
+<entry name="socket_set_option" url="function.socket-set-option.php"/>
+<entry name="socket_shutdown" url="function.socket-shutdown.php"/>
+<entry name="socket_strerror" url="function.socket-strerror.php"/>
+<entry name="socket_write" url="function.socket-write.php"/>
+<entry name="ssh2_auth_hostbased_file" url="function.ssh2-auth-hostbased-file.php"/>
+<entry name="ssh2_auth_none" url="function.ssh2-auth-none.php"/>
+<entry name="ssh2_auth_password" url="function.ssh2-auth-password.php"/>
+<entry name="ssh2_auth_pubkey_file" url="function.ssh2-auth-pubkey-file.php"/>
+<entry name="ssh2_connect" url="function.ssh2-connect.php"/>
+<entry name="ssh2_exec" url="function.ssh2-exec.php"/>
+<entry name="ssh2_fetch_stream" url="function.ssh2-fetch-stream.php"/>
+<entry name="ssh2_fingerprint" url="function.ssh2-fingerprint.php"/>
+<entry name="ssh2_methods_negotiated" url="function.ssh2-methods-negotiated.php"/>
+<entry name="ssh2_publickey_add" url="function.ssh2-publickey-add.php"/>
+<entry name="ssh2_publickey_init" url="function.ssh2-publickey-init.php"/>
+<entry name="ssh2_publickey_list" url="function.ssh2-publickey-list.php"/>
+<entry name="ssh2_publickey_remove" url="function.ssh2-publickey-remove.php"/>
+<entry name="ssh2_scp_recv" url="function.ssh2-scp-recv.php"/>
+<entry name="ssh2_scp_send" url="function.ssh2-scp-send.php"/>
+<entry name="ssh2_sftp_lstat" url="function.ssh2-sftp-lstat.php"/>
+<entry name="ssh2_sftp_mkdir" url="function.ssh2-sftp-mkdir.php"/>
+<entry name="ssh2_sftp_readlink" url="function.ssh2-sftp-readlink.php"/>
+<entry name="ssh2_sftp_realpath" url="function.ssh2-sftp-realpath.php"/>
+<entry name="ssh2_sftp_rename" url="function.ssh2-sftp-rename.php"/>
+<entry name="ssh2_sftp_rmdir" url="function.ssh2-sftp-rmdir.php"/>
+<entry name="ssh2_sftp_stat" url="function.ssh2-sftp-stat.php"/>
+<entry name="ssh2_sftp_symlink" url="function.ssh2-sftp-symlink.php"/>
+<entry name="ssh2_sftp_unlink" url="function.ssh2-sftp-unlink.php"/>
+<entry name="ssh2_sftp" url="function.ssh2-sftp.php"/>
+<entry name="ssh2_shell" url="function.ssh2-shell.php"/>
+<entry name="ssh2_tunnel" url="function.ssh2-tunnel.php"/>
+<entry name="svn_add" url="function.svn-add.php"/>
+<entry name="svn_auth_get_parameter" url="function.svn-auth-get-parameter.php"/>
+<entry name="svn_auth_set_parameter" url="function.svn-auth-set-parameter.php"/>
+<entry name="svn_cat" url="function.svn-cat.php"/>
+<entry name="svn_checkout" url="function.svn-checkout.php"/>
+<entry name="svn_cleanup" url="function.svn-cleanup.php"/>
+<entry name="svn_client_version" url="function.svn-client-version.php"/>
+<entry name="svn_commit" url="function.svn-commit.php"/>
+<entry name="svn_diff" url="function.svn-diff.php"/>
+<entry name="svn_fs_abort_txn" url="function.svn-fs-abort-txn.php"/>
+<entry name="svn_fs_apply_text" url="function.svn-fs-apply-text.php"/>
+<entry name="svn_fs_begin_txn2" url="function.svn-fs-begin-txn2.php"/>
+<entry name="svn_fs_change_node_prop" url="function.svn-fs-change-node-prop.php"/>
+<entry name="svn_fs_check_path" url="function.svn-fs-check-path.php"/>
+<entry name="svn_fs_contents_changed" url="function.svn-fs-contents-changed.php"/>
+<entry name="svn_fs_copy" url="function.svn-fs-copy.php"/>
+<entry name="svn_fs_delete" url="function.svn-fs-delete.php"/>
+<entry name="svn_fs_dir_entries" url="function.svn-fs-dir-entries.php"/>
+<entry name="svn_fs_file_contents" url="function.svn-fs-file-contents.php"/>
+<entry name="svn_fs_file_length" url="function.svn-fs-file-length.php"/>
+<entry name="svn_fs_is_dir" url="function.svn-fs-is-dir.php"/>
+<entry name="svn_fs_is_file" url="function.svn-fs-is-file.php"/>
+<entry name="svn_fs_make_dir" url="function.svn-fs-make-dir.php"/>
+<entry name="svn_fs_make_file" url="function.svn-fs-make-file.php"/>
+<entry name="svn_fs_node_created_rev" url="function.svn-fs-node-created-rev.php"/>
+<entry name="svn_fs_node_prop" url="function.svn-fs-node-prop.php"/>
+<entry name="svn_fs_props_changed" url="function.svn-fs-props-changed.php"/>
+<entry name="svn_fs_revision_prop" url="function.svn-fs-revision-prop.php"/>
+<entry name="svn_fs_revision_root" url="function.svn-fs-revision-root.php"/>
+<entry name="svn_fs_txn_root" url="function.svn-fs-txn-root.php"/>
+<entry name="svn_fs_youngest_rev" url="function.svn-fs-youngest-rev.php"/>
+<entry name="svn_import" url="function.svn-import.php"/>
+<entry name="svn_log" url="function.svn-log.php"/>
+<entry name="svn_ls" url="function.svn-ls.php"/>
+<entry name="svn_repos_create" url="function.svn-repos-create.php"/>
+<entry name="svn_repos_fs_begin_txn_for_commit" url="function.svn-repos-fs-begin-txn-for-commit.php"/>
+<entry name="svn_repos_fs_commit_txn" url="function.svn-repos-fs-commit-txn.php"/>
+<entry name="svn_repos_fs" url="function.svn-repos-fs.php"/>
+<entry name="svn_repos_hotcopy" url="function.svn-repos-hotcopy.php"/>
+<entry name="svn_repos_open" url="function.svn-repos-open.php"/>
+<entry name="svn_repos_recover" url="function.svn-repos-recover.php"/>
+<entry name="svn_status" url="function.svn-status.php"/>
+<entry name="svn_update" url="function.svn-update.php"/>
+<entry name="tcpwrap_check" url="function.tcpwrap-check.php"/>
+<entry name="yaz_addinfo" url="function.yaz-addinfo.php"/>
+<entry name="yaz_ccl_conf" url="function.yaz-ccl-conf.php"/>
+<entry name="yaz_ccl_parse" url="function.yaz-ccl-parse.php"/>
+<entry name="yaz_close" url="function.yaz-close.php"/>
+<entry name="yaz_connect" url="function.yaz-connect.php"/>
+<entry name="yaz_database" url="function.yaz-database.php"/>
+<entry name="yaz_element" url="function.yaz-element.php"/>
+<entry name="yaz_errno" url="function.yaz-errno.php"/>
+<entry name="yaz_error" url="function.yaz-error.php"/>
+<entry name="yaz_es_result" url="function.yaz-es-result.php"/>
+<entry name="yaz_es" url="function.yaz-es.php"/>
+<entry name="yaz_get_option" url="function.yaz-get-option.php"/>
+<entry name="yaz_hits" url="function.yaz-hits.php"/>
+<entry name="yaz_itemorder" url="function.yaz-itemorder.php"/>
+<entry name="yaz_present" url="function.yaz-present.php"/>
+<entry name="yaz_range" url="function.yaz-range.php"/>
+<entry name="yaz_record" url="function.yaz-record.php"/>
+<entry name="yaz_scan_result" url="function.yaz-scan-result.php"/>
+<entry name="yaz_scan" url="function.yaz-scan.php"/>
+<entry name="yaz_schema" url="function.yaz-schema.php"/>
+<entry name="yaz_search" url="function.yaz-search.php"/>
+<entry name="yaz_set_option" url="function.yaz-set-option.php"/>
+<entry name="yaz_sort" url="function.yaz-sort.php"/>
+<entry name="yaz_syntax" url="function.yaz-syntax.php"/>
+<entry name="yaz_wait" url="function.yaz-wait.php"/>
+<entry name="yp_all" url="function.yp-all.php"/>
+<entry name="yp_cat" url="function.yp-cat.php"/>
+<entry name="yp_err_string" url="function.yp-err-string.php"/>
+<entry name="yp_errno" url="function.yp-errno.php"/>
+<entry name="yp_first" url="function.yp-first.php"/>
+<entry name="yp_get_default_domain" url="function.yp-get-default-domain.php"/>
+<entry name="yp_master" url="function.yp-master.php"/>
+<entry name="yp_match" url="function.yp-match.php"/>
+<entry name="yp_next" url="function.yp-next.php"/>
+<entry name="yp_order" url="function.yp-order.php"/>
+<entry name="apache_child_terminate" url="function.apache-child-terminate.php"/>
+<entry name="apache_get_modules" url="function.apache-get-modules.php"/>
+<entry name="apache_get_version" url="function.apache-get-version.php"/>
+<entry name="apache_getenv" url="function.apache-getenv.php"/>
+<entry name="apache_lookup_uri" url="function.apache-lookup-uri.php"/>
+<entry name="apache_note" url="function.apache-note.php"/>
+<entry name="apache_request_headers" url="function.apache-request-headers.php"/>
+<entry name="apache_reset_timeout" url="function.apache-reset-timeout.php"/>
+<entry name="apache_response_headers" url="function.apache-response-headers.php"/>
+<entry name="apache_setenv" url="function.apache-setenv.php"/>
+<entry name="ascii2ebcdic" url="function.ascii2ebcdic.php"/>
+<entry name="ebcdic2ascii" url="function.ebcdic2ascii.php"/>
+<entry name="getallheaders" url="function.getallheaders.php"/>
+<entry name="virtual" url="function.virtual.php"/>
+<entry name="iis_add_server" url="function.iis-add-server.php"/>
+<entry name="iis_get_dir_security" url="function.iis-get-dir-security.php"/>
+<entry name="iis_get_script_map" url="function.iis-get-script-map.php"/>
+<entry name="iis_get_server_by_comment" url="function.iis-get-server-by-comment.php"/>
+<entry name="iis_get_server_by_path" url="function.iis-get-server-by-path.php"/>
+<entry name="iis_get_server_rights" url="function.iis-get-server-rights.php"/>
+<entry name="iis_get_service_state" url="function.iis-get-service-state.php"/>
+<entry name="iis_remove_server" url="function.iis-remove-server.php"/>
+<entry name="iis_set_app_settings" url="function.iis-set-app-settings.php"/>
+<entry name="iis_set_dir_security" url="function.iis-set-dir-security.php"/>
+<entry name="iis_set_script_map" url="function.iis-set-script-map.php"/>
+<entry name="iis_set_server_rights" url="function.iis-set-server-rights.php"/>
+<entry name="iis_start_server" url="function.iis-start-server.php"/>
+<entry name="iis_start_service" url="function.iis-start-service.php"/>
+<entry name="iis_stop_server" url="function.iis-stop-server.php"/>
+<entry name="iis_stop_service" url="function.iis-stop-service.php"/>
+<entry name="nsapi_request_headers" url="function.nsapi-request-headers.php"/>
+<entry name="nsapi_response_headers" url="function.nsapi-response-headers.php"/>
+<entry name="nsapi_virtual" url="function.nsapi-virtual.php"/>
+<entry name="msession_connect" url="function.msession-connect.php"/>
+<entry name="msession_count" url="function.msession-count.php"/>
+<entry name="msession_create" url="function.msession-create.php"/>
+<entry name="msession_destroy" url="function.msession-destroy.php"/>
+<entry name="msession_disconnect" url="function.msession-disconnect.php"/>
+<entry name="msession_find" url="function.msession-find.php"/>
+<entry name="msession_get_array" url="function.msession-get-array.php"/>
+<entry name="msession_get_data" url="function.msession-get-data.php"/>
+<entry name="msession_get" url="function.msession-get.php"/>
+<entry name="msession_inc" url="function.msession-inc.php"/>
+<entry name="msession_list" url="function.msession-list.php"/>
+<entry name="msession_listvar" url="function.msession-listvar.php"/>
+<entry name="msession_lock" url="function.msession-lock.php"/>
+<entry name="msession_plugin" url="function.msession-plugin.php"/>
+<entry name="msession_randstr" url="function.msession-randstr.php"/>
+<entry name="msession_set_array" url="function.msession-set-array.php"/>
+<entry name="msession_set_data" url="function.msession-set-data.php"/>
+<entry name="msession_set" url="function.msession-set.php"/>
+<entry name="msession_timeout" url="function.msession-timeout.php"/>
+<entry name="msession_uniq" url="function.msession-uniq.php"/>
+<entry name="msession_unlock" url="function.msession-unlock.php"/>
+<entry name="session_cache_expire" url="function.session-cache-expire.php"/>
+<entry name="session_cache_limiter" url="function.session-cache-limiter.php"/>
+<entry name="session_commit" url="function.session-commit.php"/>
+<entry name="session_decode" url="function.session-decode.php"/>
+<entry name="session_destroy" url="function.session-destroy.php"/>
+<entry name="session_encode" url="function.session-encode.php"/>
+<entry name="session_get_cookie_params" url="function.session-get-cookie-params.php"/>
+<entry name="session_id" url="function.session-id.php"/>
+<entry name="session_is_registered" url="function.session-is-registered.php"/>
+<entry name="session_module_name" url="function.session-module-name.php"/>
+<entry name="session_name" url="function.session-name.php"/>
+<entry name="session_regenerate_id" url="function.session-regenerate-id.php"/>
+<entry name="session_register" url="function.session-register.php"/>
+<entry name="session_save_path" url="function.session-save-path.php"/>
+<entry name="session_set_cookie_params" url="function.session-set-cookie-params.php"/>
+<entry name="session_set_save_handler" url="function.session-set-save-handler.php"/>
+<entry name="session_start" url="function.session-start.php"/>
+<entry name="session_unregister" url="function.session-unregister.php"/>
+<entry name="session_unset" url="function.session-unset.php"/>
+<entry name="session_write_close" url="function.session-write-close.php"/>
+<entry name="session_pgsql_add_error" url="function.session-pgsql-add-error.php"/>
+<entry name="session_pgsql_get_error" url="function.session-pgsql-get-error.php"/>
+<entry name="session_pgsql_get_field" url="function.session-pgsql-get-field.php"/>
+<entry name="session_pgsql_reset" url="function.session-pgsql-reset.php"/>
+<entry name="session_pgsql_set_field" url="function.session-pgsql-set-field.php"/>
+<entry name="session_pgsql_status" url="function.session-pgsql-status.php"/>
+<entry name="bbcode_add_element" url="function.bbcode-add-element.php"/>
+<entry name="bbcode_add_smiley" url="function.bbcode-add-smiley.php"/>
+<entry name="bbcode_create" url="function.bbcode-create.php"/>
+<entry name="bbcode_destroy" url="function.bbcode-destroy.php"/>
+<entry name="bbcode_parse" url="function.bbcode-parse.php"/>
+<entry name="bbcode_set_arg_parser" url="function.bbcode-set-arg-parser.php"/>
+<entry name="bbcode_set_flags" url="function.bbcode-set-flags.php"/>
+<entry name="preg_grep" url="function.preg-grep.php"/>
+<entry name="preg_last_error" url="function.preg-last-error.php"/>
+<entry name="preg_match_all" url="function.preg-match-all.php"/>
+<entry name="preg_match" url="function.preg-match.php"/>
+<entry name="preg_quote" url="function.preg-quote.php"/>
+<entry name="preg_replace_callback" url="function.preg-replace-callback.php"/>
+<entry name="preg_replace" url="function.preg-replace.php"/>
+<entry name="preg_split" url="function.preg-split.php"/>
+<entry name="ereg_replace" url="function.ereg-replace.php"/>
+<entry name="ereg" url="function.ereg.php"/>
+<entry name="eregi_replace" url="function.eregi-replace.php"/>
+<entry name="eregi" url="function.eregi.php"/>
+<entry name="split" url="function.split.php"/>
+<entry name="spliti" url="function.spliti.php"/>
+<entry name="sql_regcase" url="function.sql-regcase.php"/>
+<entry name="addcslashes" url="function.addcslashes.php"/>
+<entry name="addslashes" url="function.addslashes.php"/>
+<entry name="bin2hex" url="function.bin2hex.php"/>
+<entry name="chop" url="function.chop.php"/>
+<entry name="chr" url="function.chr.php"/>
+<entry name="chunk_split" url="function.chunk-split.php"/>
+<entry name="convert_cyr_string" url="function.convert-cyr-string.php"/>
+<entry name="convert_uudecode" url="function.convert-uudecode.php"/>
+<entry name="convert_uuencode" url="function.convert-uuencode.php"/>
+<entry name="count_chars" url="function.count-chars.php"/>
+<entry name="crc32" url="function.crc32.php"/>
+<entry name="crypt" url="function.crypt.php"/>
+<entry name="echo" url="function.echo.php"/>
+<entry name="explode" url="function.explode.php"/>
+<entry name="fprintf" url="function.fprintf.php"/>
+<entry name="get_html_translation_table" url="function.get-html-translation-table.php"/>
+<entry name="hebrev" url="function.hebrev.php"/>
+<entry name="hebrevc" url="function.hebrevc.php"/>
+<entry name="html_entity_decode" url="function.html-entity-decode.php"/>
+<entry name="htmlentities" url="function.htmlentities.php"/>
+<entry name="htmlspecialchars_decode" url="function.htmlspecialchars-decode.php"/>
+<entry name="htmlspecialchars" url="function.htmlspecialchars.php"/>
+<entry name="implode" url="function.implode.php"/>
+<entry name="join" url="function.join.php"/>
+<entry name="lcfirst" url="function.lcfirst.php"/>
+<entry name="levenshtein" url="function.levenshtein.php"/>
+<entry name="localeconv" url="function.localeconv.php"/>
+<entry name="ltrim" url="function.ltrim.php"/>
+<entry name="md5_file" url="function.md5-file.php"/>
+<entry name="md5" url="function.md5.php"/>
+<entry name="metaphone" url="function.metaphone.php"/>
+<entry name="money_format" url="function.money-format.php"/>
+<entry name="nl_langinfo" url="function.nl-langinfo.php"/>
+<entry name="nl2br" url="function.nl2br.php"/>
+<entry name="number_format" url="function.number-format.php"/>
+<entry name="ord" url="function.ord.php"/>
+<entry name="parse_str" url="function.parse-str.php"/>
+<entry name="print" url="function.print.php"/>
+<entry name="printf" url="function.printf.php"/>
+<entry name="quoted_printable_decode" url="function.quoted-printable-decode.php"/>
+<entry name="quotemeta" url="function.quotemeta.php"/>
+<entry name="rtrim" url="function.rtrim.php"/>
+<entry name="setlocale" url="function.setlocale.php"/>
+<entry name="sha1_file" url="function.sha1-file.php"/>
+<entry name="sha1" url="function.sha1.php"/>
+<entry name="similar_text" url="function.similar-text.php"/>
+<entry name="soundex" url="function.soundex.php"/>
+<entry name="sprintf" url="function.sprintf.php"/>
+<entry name="sscanf" url="function.sscanf.php"/>
+<entry name="str_getcsv" url="function.str-getcsv.php"/>
+<entry name="str_ireplace" url="function.str-ireplace.php"/>
+<entry name="str_pad" url="function.str-pad.php"/>
+<entry name="str_repeat" url="function.str-repeat.php"/>
+<entry name="str_replace" url="function.str-replace.php"/>
+<entry name="str_rot13" url="function.str-rot13.php"/>
+<entry name="str_shuffle" url="function.str-shuffle.php"/>
+<entry name="str_split" url="function.str-split.php"/>
+<entry name="str_word_count" url="function.str-word-count.php"/>
+<entry name="strcasecmp" url="function.strcasecmp.php"/>
+<entry name="strchr" url="function.strchr.php"/>
+<entry name="strcmp" url="function.strcmp.php"/>
+<entry name="strcoll" url="function.strcoll.php"/>
+<entry name="strcspn" url="function.strcspn.php"/>
+<entry name="strip_tags" url="function.strip-tags.php"/>
+<entry name="stripcslashes" url="function.stripcslashes.php"/>
+<entry name="stripos" url="function.stripos.php"/>
+<entry name="stripslashes" url="function.stripslashes.php"/>
+<entry name="stristr" url="function.stristr.php"/>
+<entry name="strlen" url="function.strlen.php"/>
+<entry name="strnatcasecmp" url="function.strnatcasecmp.php"/>
+<entry name="strnatcmp" url="function.strnatcmp.php"/>
+<entry name="strncasecmp" url="function.strncasecmp.php"/>
+<entry name="strncmp" url="function.strncmp.php"/>
+<entry name="strpbrk" url="function.strpbrk.php"/>
+<entry name="strpos" url="function.strpos.php"/>
+<entry name="strrchr" url="function.strrchr.php"/>
+<entry name="strrev" url="function.strrev.php"/>
+<entry name="strripos" url="function.strripos.php"/>
+<entry name="strrpos" url="function.strrpos.php"/>
+<entry name="strspn" url="function.strspn.php"/>
+<entry name="strstr" url="function.strstr.php"/>
+<entry name="strtok" url="function.strtok.php"/>
+<entry name="strtolower" url="function.strtolower.php"/>
+<entry name="strtoupper" url="function.strtoupper.php"/>
+<entry name="strtr" url="function.strtr.php"/>
+<entry name="substr_compare" url="function.substr-compare.php"/>
+<entry name="substr_count" url="function.substr-count.php"/>
+<entry name="substr_replace" url="function.substr-replace.php"/>
+<entry name="substr" url="function.substr.php"/>
+<entry name="trim" url="function.trim.php"/>
+<entry name="ucfirst" url="function.ucfirst.php"/>
+<entry name="ucwords" url="function.ucwords.php"/>
+<entry name="vfprintf" url="function.vfprintf.php"/>
+<entry name="vprintf" url="function.vprintf.php"/>
+<entry name="vsprintf" url="function.vsprintf.php"/>
+<entry name="wordwrap" url="function.wordwrap.php"/>
+<entry name="array_change_key_case" url="function.array-change-key-case.php"/>
+<entry name="array_chunk" url="function.array-chunk.php"/>
+<entry name="array_combine" url="function.array-combine.php"/>
+<entry name="array_count_values" url="function.array-count-values.php"/>
+<entry name="array_diff_assoc" url="function.array-diff-assoc.php"/>
+<entry name="array_diff_key" url="function.array-diff-key.php"/>
+<entry name="array_diff_uassoc" url="function.array-diff-uassoc.php"/>
+<entry name="array_diff_ukey" url="function.array-diff-ukey.php"/>
+<entry name="array_diff" url="function.array-diff.php"/>
+<entry name="array_fill_keys" url="function.array-fill-keys.php"/>
+<entry name="array_fill" url="function.array-fill.php"/>
+<entry name="array_filter" url="function.array-filter.php"/>
+<entry name="array_flip" url="function.array-flip.php"/>
+<entry name="array_intersect_assoc" url="function.array-intersect-assoc.php"/>
+<entry name="array_intersect_key" url="function.array-intersect-key.php"/>
+<entry name="array_intersect_uassoc" url="function.array-intersect-uassoc.php"/>
+<entry name="array_intersect_ukey" url="function.array-intersect-ukey.php"/>
+<entry name="array_intersect" url="function.array-intersect.php"/>
+<entry name="array_key_exists" url="function.array-key-exists.php"/>
+<entry name="array_keys" url="function.array-keys.php"/>
+<entry name="array_map" url="function.array-map.php"/>
+<entry name="array_merge_recursive" url="function.array-merge-recursive.php"/>
+<entry name="array_merge" url="function.array-merge.php"/>
+<entry name="array_multisort" url="function.array-multisort.php"/>
+<entry name="array_pad" url="function.array-pad.php"/>
+<entry name="array_pop" url="function.array-pop.php"/>
+<entry name="array_product" url="function.array-product.php"/>
+<entry name="array_push" url="function.array-push.php"/>
+<entry name="array_rand" url="function.array-rand.php"/>
+<entry name="array_reduce" url="function.array-reduce.php"/>
+<entry name="array_reverse" url="function.array-reverse.php"/>
+<entry name="array_search" url="function.array-search.php"/>
+<entry name="array_shift" url="function.array-shift.php"/>
+<entry name="array_slice" url="function.array-slice.php"/>
+<entry name="array_splice" url="function.array-splice.php"/>
+<entry name="array_sum" url="function.array-sum.php"/>
+<entry name="array_udiff_assoc" url="function.array-udiff-assoc.php"/>
+<entry name="array_udiff_uassoc" url="function.array-udiff-uassoc.php"/>
+<entry name="array_udiff" url="function.array-udiff.php"/>
+<entry name="array_uintersect_assoc" url="function.array-uintersect-assoc.php"/>
+<entry name="array_uintersect_uassoc" url="function.array-uintersect-uassoc.php"/>
+<entry name="array_uintersect" url="function.array-uintersect.php"/>
+<entry name="array_unique" url="function.array-unique.php"/>
+<entry name="array_unshift" url="function.array-unshift.php"/>
+<entry name="array_values" url="function.array-values.php"/>
+<entry name="array_walk_recursive" url="function.array-walk-recursive.php"/>
+<entry name="array_walk" url="function.array-walk.php"/>
+<entry name="array" url="function.array.php"/>
+<entry name="arsort" url="function.arsort.php"/>
+<entry name="asort" url="function.asort.php"/>
+<entry name="compact" url="function.compact.php"/>
+<entry name="count" url="function.count.php"/>
+<entry name="current" url="function.current.php"/>
+<entry name="each" url="function.each.php"/>
+<entry name="end" url="function.end.php"/>
+<entry name="extract" url="function.extract.php"/>
+<entry name="in_array" url="function.in-array.php"/>
+<entry name="key" url="function.key.php"/>
+<entry name="krsort" url="function.krsort.php"/>
+<entry name="ksort" url="function.ksort.php"/>
+<entry name="list" url="function.list.php"/>
+<entry name="natcasesort" url="function.natcasesort.php"/>
+<entry name="natsort" url="function.natsort.php"/>
+<entry name="next" url="function.next.php"/>
+<entry name="pos" url="function.pos.php"/>
+<entry name="prev" url="function.prev.php"/>
+<entry name="range" url="function.range.php"/>
+<entry name="reset" url="function.reset.php"/>
+<entry name="rsort" url="function.rsort.php"/>
+<entry name="shuffle" url="function.shuffle.php"/>
+<entry name="sizeof" url="function.sizeof.php"/>
+<entry name="sort" url="function.sort.php"/>
+<entry name="uasort" url="function.uasort.php"/>
+<entry name="uksort" url="function.uksort.php"/>
+<entry name="usort" url="function.usort.php"/>
+<entry name="call_user_method_array" url="function.call-user-method-array.php"/>
+<entry name="call_user_method" url="function.call-user-method.php"/>
+<entry name="class_exists" url="function.class-exists.php"/>
+<entry name="get_class_methods" url="function.get-class-methods.php"/>
+<entry name="get_class_vars" url="function.get-class-vars.php"/>
+<entry name="get_class" url="function.get-class.php"/>
+<entry name="get_declared_classes" url="function.get-declared-classes.php"/>
+<entry name="get_declared_interfaces" url="function.get-declared-interfaces.php"/>
+<entry name="get_object_vars" url="function.get-object-vars.php"/>
+<entry name="get_parent_class" url="function.get-parent-class.php"/>
+<entry name="interface_exists" url="function.interface-exists.php"/>
+<entry name="is_a" url="function.is-a.php"/>
+<entry name="is_subclass_of" url="function.is-subclass-of.php"/>
+<entry name="method_exists" url="function.method-exists.php"/>
+<entry name="property_exists" url="function.property-exists.php"/>
+<entry name="classkit_import" url="function.classkit-import.php"/>
+<entry name="classkit_method_add" url="function.classkit-method-add.php"/>
+<entry name="classkit_method_copy" url="function.classkit-method-copy.php"/>
+<entry name="classkit_method_redefine" url="function.classkit-method-redefine.php"/>
+<entry name="classkit_method_remove" url="function.classkit-method-remove.php"/>
+<entry name="classkit_method_rename" url="function.classkit-method-rename.php"/>
+<entry name="ctype_alnum" url="function.ctype-alnum.php"/>
+<entry name="ctype_alpha" url="function.ctype-alpha.php"/>
+<entry name="ctype_cntrl" url="function.ctype-cntrl.php"/>
+<entry name="ctype_digit" url="function.ctype-digit.php"/>
+<entry name="ctype_graph" url="function.ctype-graph.php"/>
+<entry name="ctype_lower" url="function.ctype-lower.php"/>
+<entry name="ctype_print" url="function.ctype-print.php"/>
+<entry name="ctype_punct" url="function.ctype-punct.php"/>
+<entry name="ctype_space" url="function.ctype-space.php"/>
+<entry name="ctype_upper" url="function.ctype-upper.php"/>
+<entry name="ctype_xdigit" url="function.ctype-xdigit.php"/>
+<entry name="filter_has_var" url="function.filter-has-var.php"/>
+<entry name="filter_id" url="function.filter-id.php"/>
+<entry name="filter_input_array" url="function.filter-input-array.php"/>
+<entry name="filter_input" url="function.filter-input.php"/>
+<entry name="filter_list" url="function.filter-list.php"/>
+<entry name="filter_var_array" url="function.filter-var-array.php"/>
+<entry name="filter_var" url="function.filter-var.php"/>
+<entry name="call_user_func_array" url="function.call-user-func-array.php"/>
+<entry name="call_user_func" url="function.call-user-func.php"/>
+<entry name="create_function" url="function.create-function.php"/>
+<entry name="func_get_arg" url="function.func-get-arg.php"/>
+<entry name="func_get_args" url="function.func-get-args.php"/>
+<entry name="func_num_args" url="function.func-num-args.php"/>
+<entry name="function_exists" url="function.function-exists.php"/>
+<entry name="get_defined_functions" url="function.get-defined-functions.php"/>
+<entry name="register_shutdown_function" url="function.register-shutdown-function.php"/>
+<entry name="register_tick_function" url="function.register-tick-function.php"/>
+<entry name="unregister_tick_function" url="function.unregister-tick-function.php"/>
+<entry name="aggregate_info" url="function.aggregate-info.php"/>
+<entry name="aggregate_methods_by_list" url="function.aggregate-methods-by-list.php"/>
+<entry name="aggregate_methods_by_regexp" url="function.aggregate-methods-by-regexp.php"/>
+<entry name="aggregate_methods" url="function.aggregate-methods.php"/>
+<entry name="aggregate_properties_by_list" url="function.aggregate-properties-by-list.php"/>
+<entry name="aggregate_properties_by_regexp" url="function.aggregate-properties-by-regexp.php"/>
+<entry name="aggregate_properties" url="function.aggregate-properties.php"/>
+<entry name="aggregate" url="function.aggregate.php"/>
+<entry name="aggregation_info" url="function.aggregation-info.php"/>
+<entry name="deaggregate" url="function.deaggregate.php"/>
+<entry name="debug_zval_dump" url="function.debug-zval-dump.php"/>
+<entry name="doubleval" url="function.doubleval.php"/>
+<entry name="empty" url="function.empty.php"/>
+<entry name="floatval" url="function.floatval.php"/>
+<entry name="get_defined_vars" url="function.get-defined-vars.php"/>
+<entry name="get_resource_type" url="function.get-resource-type.php"/>
+<entry name="gettype" url="function.gettype.php"/>
+<entry name="import_request_variables" url="function.import-request-variables.php"/>
+<entry name="intval" url="function.intval.php"/>
+<entry name="is_array" url="function.is-array.php"/>
+<entry name="is_binary" url="function.is-binary.php"/>
+<entry name="is_bool" url="function.is-bool.php"/>
+<entry name="is_buffer" url="function.is-buffer.php"/>
+<entry name="is_callable" url="function.is-callable.php"/>
+<entry name="is_double" url="function.is-double.php"/>
+<entry name="is_float" url="function.is-float.php"/>
+<entry name="is_int" url="function.is-int.php"/>
+<entry name="is_integer" url="function.is-integer.php"/>
+<entry name="is_long" url="function.is-long.php"/>
+<entry name="is_null" url="function.is-null.php"/>
+<entry name="is_numeric" url="function.is-numeric.php"/>
+<entry name="is_object" url="function.is-object.php"/>
+<entry name="is_real" url="function.is-real.php"/>
+<entry name="is_resource" url="function.is-resource.php"/>
+<entry name="is_scalar" url="function.is-scalar.php"/>
+<entry name="is_string" url="function.is-string.php"/>
+<entry name="is_unicode" url="function.is-unicode.php"/>
+<entry name="isset" url="function.isset.php"/>
+<entry name="print_r" url="function.print-r.php"/>
+<entry name="serialize" url="function.serialize.php"/>
+<entry name="settype" url="function.settype.php"/>
+<entry name="strval" url="function.strval.php"/>
+<entry name="unserialize" url="function.unserialize.php"/>
+<entry name="unset" url="function.unset.php"/>
+<entry name="var_dump" url="function.var-dump.php"/>
+<entry name="var_export" url="function.var-export.php"/>
+<entry name="is_soap_fault" url="function.is-soap-fault.php"/>
+<entry name="SoapClient->__call()" url="function.soap-soapclient-call.php"/>
+<entry name="SoapClient->__construct()" url="function.soap-soapclient-construct.php"/>
+<entry name="SoapClient->__doRequest()" url="function.soap-soapclient-dorequest.php"/>
+<entry name="SoapClient->__getFunctions()" url="function.soap-soapclient-getfunctions.php"/>
+<entry name="SoapClient->__getLastRequest()" url="function.soap-soapclient-getlastrequest.php"/>
+<entry name="SoapClient->__getLastRequestHeaders()" url="function.soap-soapclient-getlastrequestheaders.php"/>
+<entry name="SoapClient->__getLastResponse()" url="function.soap-soapclient-getlastresponse.php"/>
+<entry name="SoapClient->__getLastResponseHeaders()" url="function.soap-soapclient-getlastresponseheaders.php"/>
+<entry name="SoapClient->__getTypes()" url="function.soap-soapclient-gettypes.php"/>
+<entry name="SoapClient->__setCookie()" url="function.soap-soapclient-setcookie.php"/>
+<entry name="SoapClient->__soapCall()" url="function.soap-soapclient-soapcall.php"/>
+<entry name="SoapFault->__construct()" url="function.soap-soapfault-construct.php"/>
+<entry name="SoapHeader->__construct()" url="function.soap-soapheader-construct.php"/>
+<entry name="SoapParam->__construct()" url="function.soap-soapparam-construct.php"/>
+<entry name="SoapServer->addFunction()" url="function.soap-soapserver-addfunction.php"/>
+<entry name="SoapServer->__construct()" url="function.soap-soapserver-construct.php"/>
+<entry name="SoapServer->fault()" url="function.soap-soapserver-fault.php"/>
+<entry name="SoapServer->getFunctions()" url="function.soap-soapserver-getfunctions.php"/>
+<entry name="SoapServer->handle()" url="function.soap-soapserver-handle.php"/>
+<entry name="SoapServer->setClass()" url="function.soap-soapserver-setclass.php"/>
+<entry name="SoapServer->setPersistence()" url="function.soap-soapserver-setpersistence.php"/>
+<entry name="SoapVar->__construct()" url="function.soap-soapvar-construct.php"/>
+<entry name="use_soap_error_handler" url="function.use-soap-error-handler.php"/>
+<entry name="xmlrpc_decode_request" url="function.xmlrpc-decode-request.php"/>
+<entry name="xmlrpc_decode" url="function.xmlrpc-decode.php"/>
+<entry name="xmlrpc_encode_request" url="function.xmlrpc-encode-request.php"/>
+<entry name="xmlrpc_encode" url="function.xmlrpc-encode.php"/>
+<entry name="xmlrpc_get_type" url="function.xmlrpc-get-type.php"/>
+<entry name="xmlrpc_is_fault" url="function.xmlrpc-is-fault.php"/>
+<entry name="xmlrpc_parse_method_descriptions" url="function.xmlrpc-parse-method-descriptions.php"/>
+<entry name="xmlrpc_server_add_introspection_data" url="function.xmlrpc-server-add-introspection-data.php"/>
+<entry name="xmlrpc_server_call_method" url="function.xmlrpc-server-call-method.php"/>
+<entry name="xmlrpc_server_create" url="function.xmlrpc-server-create.php"/>
+<entry name="xmlrpc_server_destroy" url="function.xmlrpc-server-destroy.php"/>
+<entry name="xmlrpc_server_register_introspection_callback" url="function.xmlrpc-server-register-introspection-callback.php"/>
+<entry name="xmlrpc_server_register_method" url="function.xmlrpc-server-register-method.php"/>
+<entry name="xmlrpc_set_type" url="function.xmlrpc-set-type.php"/>
+<entry name="dotnet_load" url="function.dotnet-load.php"/>
+<entry name="COM" url="class.com.php"/>
+<entry name="DOTNET" url="class.dotnet.php"/>
+<entry name="VARIANT" url="class.variant.php"/>
+<entry name="com_addref" url="function.com-addref.php"/>
+<entry name="com_create_guid" url="function.com-create-guid.php"/>
+<entry name="com_event_sink" url="function.com-event-sink.php"/>
+<entry name="com_get_active_object" url="function.com-get-active-object.php"/>
+<entry name="com_get" url="function.com-get.php"/>
+<entry name="com_invoke" url="function.com-invoke.php"/>
+<entry name="com_isenum" url="function.com-isenum.php"/>
+<entry name="com_load_typelib" url="function.com-load-typelib.php"/>
+<entry name="com_load" url="function.com-load.php"/>
+<entry name="com_message_pump" url="function.com-message-pump.php"/>
+<entry name="com_print_typeinfo" url="function.com-print-typeinfo.php"/>
+<entry name="com_propget" url="function.com-propget.php"/>
+<entry name="com_propput" url="function.com-propput.php"/>
+<entry name="com_propset" url="function.com-propset.php"/>
+<entry name="com_release" url="function.com-release.php"/>
+<entry name="com_set" url="function.com-set.php"/>
+<entry name="variant_abs" url="function.variant-abs.php"/>
+<entry name="variant_add" url="function.variant-add.php"/>
+<entry name="variant_and" url="function.variant-and.php"/>
+<entry name="variant_cast" url="function.variant-cast.php"/>
+<entry name="variant_cat" url="function.variant-cat.php"/>
+<entry name="variant_cmp" url="function.variant-cmp.php"/>
+<entry name="variant_date_from_timestamp" url="function.variant-date-from-timestamp.php"/>
+<entry name="variant_date_to_timestamp" url="function.variant-date-to-timestamp.php"/>
+<entry name="variant_div" url="function.variant-div.php"/>
+<entry name="variant_eqv" url="function.variant-eqv.php"/>
+<entry name="variant_fix" url="function.variant-fix.php"/>
+<entry name="variant_get_type" url="function.variant-get-type.php"/>
+<entry name="variant_idiv" url="function.variant-idiv.php"/>
+<entry name="variant_imp" url="function.variant-imp.php"/>
+<entry name="variant_int" url="function.variant-int.php"/>
+<entry name="variant_mod" url="function.variant-mod.php"/>
+<entry name="variant_mul" url="function.variant-mul.php"/>
+<entry name="variant_neg" url="function.variant-neg.php"/>
+<entry name="variant_not" url="function.variant-not.php"/>
+<entry name="variant_or" url="function.variant-or.php"/>
+<entry name="variant_pow" url="function.variant-pow.php"/>
+<entry name="variant_round" url="function.variant-round.php"/>
+<entry name="variant_set_type" url="function.variant-set-type.php"/>
+<entry name="variant_set" url="function.variant-set.php"/>
+<entry name="variant_sub" url="function.variant-sub.php"/>
+<entry name="variant_xor" url="function.variant-xor.php"/>
+<entry name="printer_abort" url="function.printer-abort.php"/>
+<entry name="printer_close" url="function.printer-close.php"/>
+<entry name="printer_create_brush" url="function.printer-create-brush.php"/>
+<entry name="printer_create_dc" url="function.printer-create-dc.php"/>
+<entry name="printer_create_font" url="function.printer-create-font.php"/>
+<entry name="printer_create_pen" url="function.printer-create-pen.php"/>
+<entry name="printer_delete_brush" url="function.printer-delete-brush.php"/>
+<entry name="printer_delete_dc" url="function.printer-delete-dc.php"/>
+<entry name="printer_delete_font" url="function.printer-delete-font.php"/>
+<entry name="printer_delete_pen" url="function.printer-delete-pen.php"/>
+<entry name="printer_draw_bmp" url="function.printer-draw-bmp.php"/>
+<entry name="printer_draw_chord" url="function.printer-draw-chord.php"/>
+<entry name="printer_draw_elipse" url="function.printer-draw-elipse.php"/>
+<entry name="printer_draw_line" url="function.printer-draw-line.php"/>
+<entry name="printer_draw_pie" url="function.printer-draw-pie.php"/>
+<entry name="printer_draw_rectangle" url="function.printer-draw-rectangle.php"/>
+<entry name="printer_draw_roundrect" url="function.printer-draw-roundrect.php"/>
+<entry name="printer_draw_text" url="function.printer-draw-text.php"/>
+<entry name="printer_end_doc" url="function.printer-end-doc.php"/>
+<entry name="printer_end_page" url="function.printer-end-page.php"/>
+<entry name="printer_get_option" url="function.printer-get-option.php"/>
+<entry name="printer_list" url="function.printer-list.php"/>
+<entry name="printer_logical_fontheight" url="function.printer-logical-fontheight.php"/>
+<entry name="printer_open" url="function.printer-open.php"/>
+<entry name="printer_select_brush" url="function.printer-select-brush.php"/>
+<entry name="printer_select_font" url="function.printer-select-font.php"/>
+<entry name="printer_select_pen" url="function.printer-select-pen.php"/>
+<entry name="printer_set_option" url="function.printer-set-option.php"/>
+<entry name="printer_start_doc" url="function.printer-start-doc.php"/>
+<entry name="printer_start_page" url="function.printer-start-page.php"/>
+<entry name="printer_write" url="function.printer-write.php"/>
+<entry name="w32api_deftype" url="function.w32api-deftype.php"/>
+<entry name="w32api_init_dtype" url="function.w32api-init-dtype.php"/>
+<entry name="w32api_invoke_function" url="function.w32api-invoke-function.php"/>
+<entry name="w32api_register_function" url="function.w32api-register-function.php"/>
+<entry name="w32api_set_call_method" url="function.w32api-set-call-method.php"/>
+<entry name="win32_ps_list_procs" url="function.win32-ps-list-procs.php"/>
+<entry name="win32_ps_stat_mem" url="function.win32-ps-stat-mem.php"/>
+<entry name="win32_ps_stat_proc" url="function.win32-ps-stat-proc.php"/>
+<entry name="win32_create_service" url="function.win32-create-service.php"/>
+<entry name="win32_delete_service" url="function.win32-delete-service.php"/>
+<entry name="win32_get_last_control_message" url="function.win32-get-last-control-message.php"/>
+<entry name="win32_query_service_status" url="function.win32-query-service-status.php"/>
+<entry name="win32_set_service_status" url="function.win32-set-service-status.php"/>
+<entry name="win32_start_service_ctrl_dispatcher" url="function.win32-start-service-ctrl-dispatcher.php"/>
+<entry name="win32_start_service" url="function.win32-start-service.php"/>
+<entry name="win32_stop_service" url="function.win32-stop-service.php"/>
+<entry name="DOMAttr::__construct" url="domattr.construct.php"/>
+<entry name="DOMAttr::isId" url="domattr.isid.php"/>
+<entry name="DOMCharacterData::appendData" url="domcharacterdata.appenddata.php"/>
+<entry name="DOMCharacterData::deleteData" url="domcharacterdata.deletedata.php"/>
+<entry name="DOMCharacterData::insertData" url="domcharacterdata.insertdata.php"/>
+<entry name="DOMCharacterData::replaceData" url="domcharacterdata.replacedata.php"/>
+<entry name="DOMCharacterData::substringData" url="domcharacterdata.substringdata.php"/>
+<entry name="DOMComment::__construct" url="domcomment.construct.php"/>
+<entry name="DOMDocument::__construct" url="domdocument.construct.php"/>
+<entry name="DOMDocument::createAttribute" url="domdocument.createattribute.php"/>
+<entry name="DOMDocument::createAttributeNS" url="domdocument.createattributens.php"/>
+<entry name="DOMDocument::createCDATASection" url="domdocument.createcdatasection.php"/>
+<entry name="DOMDocument::createComment" url="domdocument.createcomment.php"/>
+<entry name="DOMDocument::createDocumentFragment" url="domdocument.createdocumentfragment.php"/>
+<entry name="DOMDocument::createElement" url="domdocument.createelement.php"/>
+<entry name="DOMDocument::createElementNS" url="domdocument.createelementns.php"/>
+<entry name="DOMDocument::createEntityReference" url="domdocument.createentityreference.php"/>
+<entry name="DOMDocument::createProcessingInstruction" url="domdocument.createprocessinginstruction.php"/>
+<entry name="DOMDocument::createTextNode" url="domdocument.createtextnode.php"/>
+<entry name="DOMDocument::getElementById" url="domdocument.getelementbyid.php"/>
+<entry name="DOMDocument::getElementsByTagName" url="domdocument.getelementsbytagname.php"/>
+<entry name="DOMDocument::getElementsByTagNameNS" url="domdocument.getelementsbytagnamens.php"/>
+<entry name="DOMDocument::importNode" url="domdocument.importnode.php"/>
+<entry name="DOMDocument::load" url="domdocument.load.php"/>
+<entry name="DOMDocument::loadHTML" url="domdocument.loadhtml.php"/>
+<entry name="DOMDocument::loadHTMLFile" url="domdocument.loadhtmlfile.php"/>
+<entry name="DOMDocument::loadXML" url="domdocument.loadxml.php"/>
+<entry name="DOMDocument::normalizeDocument" url="domdocument.normalizedocument.php"/>
+<entry name="DOMDocument::registerNodeClass" url="domdocument.registernodeclass.php"/>
+<entry name="DOMDocument::relaxNGValidate" url="domdocument.relaxngvalidate.php"/>
+<entry name="DOMDocument::relaxNGValidateSource" url="domdocument.relaxngvalidatesource.php"/>
+<entry name="DOMDocument::save" url="domdocument.save.php"/>
+<entry name="DOMDocument::saveHTML" url="domdocument.savehtml.php"/>
+<entry name="DOMDocument::saveHTMLFile" url="domdocument.savehtmlfile.php"/>
+<entry name="DOMDocument::saveXML" url="domdocument.savexml.php"/>
+<entry name="DOMDocument::schemaValidate" url="domdocument.schemavalidate.php"/>
+<entry name="DOMDocument::schemaValidateSource" url="domdocument.schemavalidatesource.php"/>
+<entry name="DOMDocument::validate" url="domdocument.validate.php"/>
+<entry name="DOMDocument::xinclude" url="domdocument.xinclude.php"/>
+<entry name="DOMDocumentFragment::appendXML" url="domdocumentfragment.appendxml.php"/>
+<entry name="DOMElement::__construct" url="domelement.construct.php"/>
+<entry name="DOMElement::getAttribute" url="domelement.getattribute.php"/>
+<entry name="DOMElement::getAttributeNode" url="domelement.getattributenode.php"/>
+<entry name="DOMElement::getAttributeNodeNS" url="domelement.getattributenodens.php"/>
+<entry name="DOMElement::getAttributeNS" url="domelement.getattributens.php"/>
+<entry name="DOMElement::getElementsByTagName" url="domelement.getelementsbytagname.php"/>
+<entry name="DOMElement::getElementsByTagNameNS" url="domelement.getelementsbytagnamens.php"/>
+<entry name="DOMElement::hasAttribute" url="domelement.hasattribute.php"/>
+<entry name="DOMElement::hasAttributeNS" url="domelement.hasattributens.php"/>
+<entry name="DOMElement::removeAttribute" url="domelement.removeattribute.php"/>
+<entry name="DOMElement::removeAttributeNode" url="domelement.removeattributenode.php"/>
+<entry name="DOMElement::removeAttributeNS" url="domelement.removeattributens.php"/>
+<entry name="DOMElement::setAttribute" url="domelement.setattribute.php"/>
+<entry name="DOMElement::setAttributeNode" url="domelement.setattributenode.php"/>
+<entry name="DOMElement::setAttributeNodeNS" url="domelement.setattributenodens.php"/>
+<entry name="DOMElement::setAttributeNS" url="domelement.setattributens.php"/>
+<entry name="DOMElement::setIdAttribute" url="domelement.setidattribute.php"/>
+<entry name="DOMElement::setIdAttributeNode" url="domelement.setidattributenode.php"/>
+<entry name="DOMElement::setIdAttributeNS" url="domelement.setidattributens.php"/>
+<entry name="DOMEntityReference::__construct" url="domentityreference.construct.php"/>
+<entry name="DOMImplementation::__construct" url="domimplementation.construct.php"/>
+<entry name="DOMImplementation::createDocument" url="domimplementation.createdocument.php"/>
+<entry name="DOMImplementation::createDocumentType" url="domimplementation.createdocumenttype.php"/>
+<entry name="DOMImplementation::hasFeature" url="domimplementation.hasfeature.php"/>
+<entry name="DOMNamedNodeMap::getNamedItem" url="domnamednodemap.getnameditem.php"/>
+<entry name="DOMNamedNodeMap::getNamedItemNS" url="domnamednodemap.getnameditemns.php"/>
+<entry name="DOMNamedNodeMap::item" url="domnamednodemap.item.php"/>
+<entry name="DOMNode::appendChild" url="domnode.appendchild.php"/>
+<entry name="DOMNode::cloneNode" url="domnode.clonenode.php"/>
+<entry name="DOMNode::hasAttributes" url="domnode.hasattributes.php"/>
+<entry name="DOMNode::hasChildNodes" url="domnode.haschildnodes.php"/>
+<entry name="DOMNode::insertBefore" url="domnode.insertbefore.php"/>
+<entry name="DOMNode::isDefaultNamespace" url="domnode.isdefaultnamespace.php"/>
+<entry name="DOMNode::isSameNode" url="domnode.issamenode.php"/>
+<entry name="DOMNode::isSupported" url="domnode.issupported.php"/>
+<entry name="DOMNode::lookupNamespaceURI" url="domnode.lookupnamespaceuri.php"/>
+<entry name="DOMNode::lookupPrefix" url="domnode.lookupprefix.php"/>
+<entry name="DOMNode::normalize" url="domnode.normalize.php"/>
+<entry name="DOMNode::removeChild" url="domnode.removechild.php"/>
+<entry name="DOMNode::replaceChild" url="domnode.replacechild.php"/>
+<entry name="DOMNodelist::item" url="domnodelist.item.php"/>
+<entry name="DOMProcessingInstruction::__construct" url="domprocessinginstruction.construct.php"/>
+<entry name="DOMText::__construct" url="domtext.construct.php"/>
+<entry name="DOMText::isWhitespaceInElementContent" url="domtext.iswhitespaceinelementcontent.php"/>
+<entry name="DOMText::splitText" url="domtext.splittext.php"/>
+<entry name="DOMXPath::__construct" url="domxpath.construct.php"/>
+<entry name="DOMXPath::evaluate" url="domxpath.evaluate.php"/>
+<entry name="DOMXPath::query" url="domxpath.query.php"/>
+<entry name="DOMXPath::registerNamespace" url="domxpath.registernamespace.php"/>
+<entry name="dom_import_simplexml" url="function.dom-import-simplexml.php"/>
+<entry name="DomAttribute->name" url="function.domattribute-name.php"/>
+<entry name="DomAttribute->set_value" url="function.domattribute-set-value.php"/>
+<entry name="DomAttribute->specified" url="function.domattribute-specified.php"/>
+<entry name="DomAttribute->value" url="function.domattribute-value.php"/>
+<entry name="DomDocument->add_root" url="function.domdocument-add-root.php"/>
+<entry name="DomDocument->create_attribute" url="function.domdocument-create-attribute.php"/>
+<entry name="DomDocument->create_cdata_section" url="function.domdocument-create-cdata-section.php"/>
+<entry name="DomDocument->create_comment" url="function.domdocument-create-comment.php"/>
+<entry name="DomDocument->create_element_ns" url="function.domdocument-create-element-ns.php"/>
+<entry name="DomDocument->create_element" url="function.domdocument-create-element.php"/>
+<entry name="DomDocument->create_entity_reference" url="function.domdocument-create-entity-reference.php"/>
+<entry name="DomDocument->create_processing_instruction" url="function.domdocument-create-processing-instruction.php"/>
+<entry name="DomDocument->create_text_node" url="function.domdocument-create-text-node.php"/>
+<entry name="DomDocument->doctype" url="function.domdocument-doctype.php"/>
+<entry name="DomDocument->document_element" url="function.domdocument-document-element.php"/>
+<entry name="DomDocument->dump_file" url="function.domdocument-dump-file.php"/>
+<entry name="DomDocument->dump_mem" url="function.domdocument-dump-mem.php"/>
+<entry name="DomDocument->get_element_by_id" url="function.domdocument-get-element-by-id.php"/>
+<entry name="DomDocument->get_elements_by_tagname" url="function.domdocument-get-elements-by-tagname.php"/>
+<entry name="DomDocument->html_dump_mem" url="function.domdocument-html-dump-mem.php"/>
+<entry name="DomDocument->xinclude" url="function.domdocument-xinclude.php"/>
+<entry name="DomDocumentType->entities()" url="function.domdocumenttype-entities.php"/>
+<entry name="DomDocumentType->internal_subset()" url="function.domdocumenttype-internal-subset.php"/>
+<entry name="DomDocumentType->name()" url="function.domdocumenttype-name.php"/>
+<entry name="DomDocumentType->notations()" url="function.domdocumenttype-notations.php"/>
+<entry name="DomDocumentType->public_id()" url="function.domdocumenttype-public-id.php"/>
+<entry name="DomDocumentType->system_id()" url="function.domdocumenttype-system-id.php"/>
+<entry name="DomElement->get_attribute_node()" url="function.domelement-get-attribute-node.php"/>
+<entry name="DomElement->get_attribute()" url="function.domelement-get-attribute.php"/>
+<entry name="DomElement->get_elements_by_tagname()" url="function.domelement-get-elements-by-tagname.php"/>
+<entry name="DomElement->has_attribute()" url="function.domelement-has-attribute.php"/>
+<entry name="DomElement->remove_attribute()" url="function.domelement-remove-attribute.php"/>
+<entry name="DomElement->set_attribute_node()" url="function.domelement-set-attribute-node.php"/>
+<entry name="DomElement->set_attribute()" url="function.domelement-set-attribute.php"/>
+<entry name="DomElement->tagname()" url="function.domelement-tagname.php"/>
+<entry name="DomNode->add_namespace" url="function.domnode-add-namespace.php"/>
+<entry name="DomNode->append_child" url="function.domnode-append-child.php"/>
+<entry name="DomNode->append_sibling" url="function.domnode-append-sibling.php"/>
+<entry name="DomNode->attributes" url="function.domnode-attributes.php"/>
+<entry name="DomNode->child_nodes" url="function.domnode-child-nodes.php"/>
+<entry name="DomNode->clone_node" url="function.domnode-clone-node.php"/>
+<entry name="DomNode->dump_node" url="function.domnode-dump-node.php"/>
+<entry name="DomNode->first_child" url="function.domnode-first-child.php"/>
+<entry name="DomNode->get_content" url="function.domnode-get-content.php"/>
+<entry name="DomNode->has_attributes" url="function.domnode-has-attributes.php"/>
+<entry name="DomNode->has_child_nodes" url="function.domnode-has-child-nodes.php"/>
+<entry name="DomNode->insert_before" url="function.domnode-insert-before.php"/>
+<entry name="DomNode->is_blank_node" url="function.domnode-is-blank-node.php"/>
+<entry name="DomNode->last_child" url="function.domnode-last-child.php"/>
+<entry name="DomNode->next_sibling" url="function.domnode-next-sibling.php"/>
+<entry name="DomNode->node_name" url="function.domnode-node-name.php"/>
+<entry name="DomNode->node_type" url="function.domnode-node-type.php"/>
+<entry name="DomNode->node_value" url="function.domnode-node-value.php"/>
+<entry name="DomNode->owner_document" url="function.domnode-owner-document.php"/>
+<entry name="DomNode->parent_node" url="function.domnode-parent-node.php"/>
+<entry name="DomNode->prefix" url="function.domnode-prefix.php"/>
+<entry name="DomNode->previous_sibling" url="function.domnode-previous-sibling.php"/>
+<entry name="DomNode->remove_child" url="function.domnode-remove-child.php"/>
+<entry name="DomNode->replace_child" url="function.domnode-replace-child.php"/>
+<entry name="DomNode->replace_node" url="function.domnode-replace-node.php"/>
+<entry name="DomNode->set_content" url="function.domnode-set-content.php"/>
+<entry name="DomNode->set_name" url="function.domnode-set-name.php"/>
+<entry name="DomNode->set_namespace" url="function.domnode-set-namespace.php"/>
+<entry name="DomNode->unlink_node" url="function.domnode-unlink-node.php"/>
+<entry name="DomProcessingInstruction->data" url="function.domprocessinginstruction-data.php"/>
+<entry name="DomProcessingInstruction->target" url="function.domprocessinginstruction-target.php"/>
+<entry name="DomXsltStylesheet->process()" url="function.domxsltstylesheet-process.php"/>
+<entry name="DomXsltStylesheet->result_dump_file()" url="function.domxsltstylesheet-result-dump-file.php"/>
+<entry name="DomXsltStylesheet->result_dump_mem()" url="function.domxsltstylesheet-result-dump-mem.php"/>
+<entry name="domxml_new_doc" url="function.domxml-new-doc.php"/>
+<entry name="domxml_open_file" url="function.domxml-open-file.php"/>
+<entry name="domxml_open_mem" url="function.domxml-open-mem.php"/>
+<entry name="domxml_version" url="function.domxml-version.php"/>
+<entry name="domxml_xmltree" url="function.domxml-xmltree.php"/>
+<entry name="domxml_xslt_stylesheet_doc" url="function.domxml-xslt-stylesheet-doc.php"/>
+<entry name="domxml_xslt_stylesheet_file" url="function.domxml-xslt-stylesheet-file.php"/>
+<entry name="domxml_xslt_stylesheet" url="function.domxml-xslt-stylesheet.php"/>
+<entry name="domxml_xslt_version" url="function.domxml-xslt-version.php"/>
+<entry name="xpath_eval_expression" url="function.xpath-eval-expression.php"/>
+<entry name="xpath_eval" url="function.xpath-eval.php"/>
+<entry name="xpath_new_context" url="function.xpath-new-context.php"/>
+<entry name="xpath_register_ns_auto" url="function.xpath-register-ns-auto.php"/>
+<entry name="xpath_register_ns" url="function.xpath-register-ns.php"/>
+<entry name="xptr_eval" url="function.xptr-eval.php"/>
+<entry name="xptr_new_context" url="function.xptr-new-context.php"/>
+<entry name="libxml_clear_errors" url="function.libxml-clear-errors.php"/>
+<entry name="libxml_get_errors" url="function.libxml-get-errors.php"/>
+<entry name="libxml_get_last_error" url="function.libxml-get-last-error.php"/>
+<entry name="libxml_set_streams_context" url="function.libxml-set-streams-context.php"/>
+<entry name="libxml_use_internal_errors" url="function.libxml-use-internal-errors.php"/>
+<entry name="qdom_error" url="function.qdom-error.php"/>
+<entry name="qdom_tree" url="function.qdom-tree.php"/>
+<entry name="SCA_LocalProxy::createDataObject" url="function.sca-localproxy-createdataobject.php"/>
+<entry name="SCA_SoapProxy::createDataObject" url="function.sca-soapproxy-createdataobject.php"/>
+<entry name="SCA::createDataObject" url="function.sca-createdataobject.php"/>
+<entry name="SCA::getService" url="function.sca-getservice.php"/>
+<entry name="SDO_DAS_XML_Document::getRootDataObject" url="function.sdo-das-xml-document-getrootdataobject.php"/>
+<entry name="SDO_DAS_XML_Document::getRootElementName" url="function.sdo-das-xml-document-getrootelementname.php"/>
+<entry name="SDO_DAS_XML_Document::getRootElementURI" url="function.sdo-das-xml-document-getrootelementuri.php"/>
+<entry name="SDO_DAS_XML_Document::setEncoding" url="function.sdo-das-xml-document-setencoding.php"/>
+<entry name="SDO_DAS_XML_Document::setXMLDeclaration" url="function.sdo-das-xml-document-setxmldeclaration.php"/>
+<entry name="SDO_DAS_XML_Document::setXMLVersion" url="function.sdo-das-xml-document-setxmlversion.php"/>
+<entry name="SDO_DAS_XML::addTypes" url="function.sdo-das-xml-addtypes.php"/>
+<entry name="SDO_DAS_XML::create" url="function.sdo-das-xml-create.php"/>
+<entry name="SDO_DAS_XML::createDataObject" url="function.sdo-das-xml-createdataobject.php"/>
+<entry name="SDO_DAS_XML::createDocument" url="function.sdo-das-xml-createdocument.php"/>
+<entry name="SDO_DAS_XML::loadFile" url="function.sdo-das-xml-loadfile.php"/>
+<entry name="SDO_DAS_XML::loadString" url="function.sdo-das-xml-loadstring.php"/>
+<entry name="SDO_DAS_XML::saveFile" url="function.sdo-das-xml-savefile.php"/>
+<entry name="SDO_DAS_XML::saveString" url="function.sdo-das-xml-savestring.php"/>
+<entry name="SimpleXMLElement->addAttribute()" url="function.simplexml-element-addAttribute.php"/>
+<entry name="SimpleXMLElement->addChild()" url="function.simplexml-element-addChild.php"/>
+<entry name="SimpleXMLElement->asXML()" url="function.simplexml-element-asXML.php"/>
+<entry name="SimpleXMLElement->attributes()" url="function.simplexml-element-attributes.php"/>
+<entry name="SimpleXMLElement->children()" url="function.simplexml-element-children.php"/>
+<entry name="SimpleXMLElement->__construct()" url="function.simplexml-element-construct.php"/>
+<entry name="SimpleXMLElement->getDocNamespaces()" url="function.simplexml-element-getDocNamespaces.php"/>
+<entry name="SimpleXMLElement->getName()" url="function.simplexml-element-getName.php"/>
+<entry name="SimpleXMLElement->getNamespaces()" url="function.simplexml-element-getNamespaces.php"/>
+<entry name="SimpleXMLElement->registerXPathNamespace()" url="function.simplexml-element-registerXPathNamespace.php"/>
+<entry name="SimpleXMLElement->xpath()" url="function.simplexml-element-xpath.php"/>
+<entry name="simplexml_import_dom" url="function.simplexml-import-dom.php"/>
+<entry name="simplexml_load_file" url="function.simplexml-load-file.php"/>
+<entry name="simplexml_load_string" url="function.simplexml-load-string.php"/>
+<entry name="wddx_add_vars" url="function.wddx-add-vars.php"/>
+<entry name="wddx_deserialize" url="function.wddx-deserialize.php"/>
+<entry name="wddx_packet_end" url="function.wddx-packet-end.php"/>
+<entry name="wddx_packet_start" url="function.wddx-packet-start.php"/>
+<entry name="wddx_serialize_value" url="function.wddx-serialize-value.php"/>
+<entry name="wddx_serialize_vars" url="function.wddx-serialize-vars.php"/>
+<entry name="wddx_unserialize" url="function.wddx-unserialize.php"/>
+<entry name="utf8_decode" url="function.utf8-decode.php"/>
+<entry name="utf8_encode" url="function.utf8-encode.php"/>
+<entry name="xml_error_string" url="function.xml-error-string.php"/>
+<entry name="xml_get_current_byte_index" url="function.xml-get-current-byte-index.php"/>
+<entry name="xml_get_current_column_number" url="function.xml-get-current-column-number.php"/>
+<entry name="xml_get_current_line_number" url="function.xml-get-current-line-number.php"/>
+<entry name="xml_get_error_code" url="function.xml-get-error-code.php"/>
+<entry name="xml_parse_into_struct" url="function.xml-parse-into-struct.php"/>
+<entry name="xml_parse" url="function.xml-parse.php"/>
+<entry name="xml_parser_create_ns" url="function.xml-parser-create-ns.php"/>
+<entry name="xml_parser_create" url="function.xml-parser-create.php"/>
+<entry name="xml_parser_free" url="function.xml-parser-free.php"/>
+<entry name="xml_parser_get_option" url="function.xml-parser-get-option.php"/>
+<entry name="xml_parser_set_option" url="function.xml-parser-set-option.php"/>
+<entry name="xml_set_character_data_handler" url="function.xml-set-character-data-handler.php"/>
+<entry name="xml_set_default_handler" url="function.xml-set-default-handler.php"/>
+<entry name="xml_set_element_handler" url="function.xml-set-element-handler.php"/>
+<entry name="xml_set_end_namespace_decl_handler" url="function.xml-set-end-namespace-decl-handler.php"/>
+<entry name="xml_set_external_entity_ref_handler" url="function.xml-set-external-entity-ref-handler.php"/>
+<entry name="xml_set_notation_decl_handler" url="function.xml-set-notation-decl-handler.php"/>
+<entry name="xml_set_object" url="function.xml-set-object.php"/>
+<entry name="xml_set_processing_instruction_handler" url="function.xml-set-processing-instruction-handler.php"/>
+<entry name="xml_set_start_namespace_decl_handler" url="function.xml-set-start-namespace-decl-handler.php"/>
+<entry name="xml_set_unparsed_entity_decl_handler" url="function.xml-set-unparsed-entity-decl-handler.php"/>
+<entry name="XMLReader::close" url="xmlreader.close.php"/>
+<entry name="XMLReader::expand" url="xmlreader.expand.php"/>
+<entry name="XMLReader::getAttribute" url="xmlreader.getattribute.php"/>
+<entry name="XMLReader::getAttributeNo" url="xmlreader.getattributeno.php"/>
+<entry name="XMLReader::getAttributeNs" url="xmlreader.getattributens.php"/>
+<entry name="XMLReader::getParserProperty" url="xmlreader.getparserproperty.php"/>
+<entry name="XMLReader::isValid" url="xmlreader.isvalid.php"/>
+<entry name="XMLReader::lookupNamespace" url="xmlreader.lookupnamespace.php"/>
+<entry name="XMLReader::moveToAttribute" url="xmlreader.movetoattribute.php"/>
+<entry name="XMLReader::moveToAttributeNo" url="xmlreader.movetoattributeno.php"/>
+<entry name="XMLReader::moveToAttributeNs" url="xmlreader.movetoattributens.php"/>
+<entry name="XMLReader::moveToElement" url="xmlreader.movetoelement.php"/>
+<entry name="XMLReader::moveToFirstAttribute" url="xmlreader.movetofirstattribute.php"/>
+<entry name="XMLReader::moveToNextAttribute" url="xmlreader.movetonextattribute.php"/>
+<entry name="XMLReader::next" url="xmlreader.next.php"/>
+<entry name="XMLReader::open" url="xmlreader.open.php"/>
+<entry name="XMLReader::read" url="xmlreader.read.php"/>
+<entry name="XMLReader::setParserProperty" url="xmlreader.setparserproperty.php"/>
+<entry name="XMLReader::setRelaxNGSchema" url="xmlreader.setrelaxngschema.php"/>
+<entry name="XMLReader::setRelaxNGSchemaSource" url="xmlreader.setrelaxngschemasource.php"/>
+<entry name="XMLReader::XML" url="xmlreader.xml.php"/>
+<entry name="XMLWriter::endAttribute" url="function.xmlwriter-end-attribute.php"/>
+<entry name="XMLWriter::endCData" url="function.xmlwriter-end-cdata.php"/>
+<entry name="XMLWriter::endComment" url="function.xmlwriter-end-comment.php"/>
+<entry name="XMLWriter::endDocument" url="function.xmlwriter-end-document.php"/>
+<entry name="XMLWriter::endDTDAttlist" url="function.xmlwriter-end-dtd-attlist.php"/>
+<entry name="XMLWriter::endDTDElement" url="function.xmlwriter-end-dtd-element.php"/>
+<entry name="XMLWriter::endDTDEntity" url="function.xmlwriter-end-dtd-entity.php"/>
+<entry name="XMLWriter::endDTD" url="function.xmlwriter-end-dtd.php"/>
+<entry name="XMLWriter::endElement" url="function.xmlwriter-end-element.php"/>
+<entry name="XMLWriter::endPI" url="function.xmlwriter-end-pi.php"/>
+<entry name="XMLWriter::flush" url="function.xmlwriter-flush.php"/>
+<entry name="XMLWriter::fullEndElement" url="function.xmlwriter-full-end-element.php"/>
+<entry name="XMLWriter::openMemory" url="function.xmlwriter-open-memory.php"/>
+<entry name="XMLWriter::openURI" url="function.xmlwriter-open-uri.php"/>
+<entry name="XMLWriter::outputMemory" url="function.xmlwriter-output-memory.php"/>
+<entry name="XMLWriter::setIndentString" url="function.xmlwriter-set-indent-string.php"/>
+<entry name="XMLWriter::setIndent" url="function.xmlwriter-set-indent.php"/>
+<entry name="XMLWriter::startAttributeNS" url="function.xmlwriter-start-attribute-ns.php"/>
+<entry name="XMLWriter::startAttribute" url="function.xmlwriter-start-attribute.php"/>
+<entry name="XMLWriter::startCData" url="function.xmlwriter-start-cdata.php"/>
+<entry name="XMLWriter::startComment" url="function.xmlwriter-start-comment.php"/>
+<entry name="XMLWriter::startDocument" url="function.xmlwriter-start-document.php"/>
+<entry name="XMLWriter::startDTDAttlist" url="function.xmlwriter-start-dtd-attlist.php"/>
+<entry name="XMLWriter::startDTDElement" url="function.xmlwriter-start-dtd-element.php"/>
+<entry name="XMLWriter::startDTDEntity" url="function.xmlwriter-start-dtd-entity.php"/>
+<entry name="XMLWriter::startDTD" url="function.xmlwriter-start-dtd.php"/>
+<entry name="XMLWriter::startElementNS" url="function.xmlwriter-start-element-ns.php"/>
+<entry name="XMLWriter::startElement" url="function.xmlwriter-start-element.php"/>
+<entry name="XMLWriter::startPI" url="function.xmlwriter-start-pi.php"/>
+<entry name="XMLWriter::text" url="function.xmlwriter-text.php"/>
+<entry name="XMLWriter::writeAttributeNS" url="function.xmlwriter-write-attribute-ns.php"/>
+<entry name="XMLWriter::writeAttribute" url="function.xmlwriter-write-attribute.php"/>
+<entry name="XMLWriter::writeCData" url="function.xmlwriter-write-cdata.php"/>
+<entry name="XMLWriter::writeComment" url="function.xmlwriter-write-comment.php"/>
+<entry name="XMLWriter::writeDTDAttlist" url="function.xmlwriter-write-dtd-attlist.php"/>
+<entry name="XMLWriter::writeDTDElement" url="function.xmlwriter-write-dtd-element.php"/>
+<entry name="XMLWriter::writeDTDEntity" url="function.xmlwriter-write-dtd-entity.php"/>
+<entry name="XMLWriter::writeDTD" url="function.xmlwriter-write-dtd.php"/>
+<entry name="XMLWriter::writeElementNS" url="function.xmlwriter-write-element-ns.php"/>
+<entry name="XMLWriter::writeElement" url="function.xmlwriter-write-element.php"/>
+<entry name="XMLWriter::writePI" url="function.xmlwriter-write-pi.php"/>
+<entry name="XMLWriter::writeRaw" url="function.xmlwriter-write-raw.php"/>
+<entry name="XSLTProcessor::__construct" url="xsltprocessor.construct.php"/>
+<entry name="XSLTProcessor::getParameter" url="xsltprocessor.getparameter.php"/>
+<entry name="XSLTProcessor::hasExsltSupport" url="xsltprocessor.hasexsltsupport.php"/>
+<entry name="XSLTProcessor::importStylesheet" url="xsltprocessor.importstylesheet.php"/>
+<entry name="XSLTProcessor::registerPHPFunctions" url="xsltprocessor.registerphpfunctions.php"/>
+<entry name="XSLTProcessor::removeParameter" url="xsltprocessor.removeparameter.php"/>
+<entry name="XSLTProcessor::setParameter" url="xsltprocessor.setparameter.php"/>
+<entry name="XSLTProcessor::transformToDoc" url="xsltprocessor.transformtodoc.php"/>
+<entry name="XSLTProcessor::transformToURI" url="xsltprocessor.transformtouri.php"/>
+<entry name="XSLTProcessor::transformToXML" url="xsltprocessor.transformtoxml.php"/>
+<entry name="xslt_backend_info" url="function.xslt-backend-info.php"/>
+<entry name="xslt_backend_name" url="function.xslt-backend-name.php"/>
+<entry name="xslt_backend_version" url="function.xslt-backend-version.php"/>
+<entry name="xslt_create" url="function.xslt-create.php"/>
+<entry name="xslt_errno" url="function.xslt-errno.php"/>
+<entry name="xslt_error" url="function.xslt-error.php"/>
+<entry name="xslt_free" url="function.xslt-free.php"/>
+<entry name="xslt_getopt" url="function.xslt-getopt.php"/>
+<entry name="xslt_process" url="function.xslt-process.php"/>
+<entry name="xslt_set_base" url="function.xslt-set-base.php"/>
+<entry name="xslt_set_encoding" url="function.xslt-set-encoding.php"/>
+<entry name="xslt_set_error_handler" url="function.xslt-set-error-handler.php"/>
+<entry name="xslt_set_log" url="function.xslt-set-log.php"/>
+<entry name="xslt_set_object" url="function.xslt-set-object.php"/>
+<entry name="xslt_set_sax_handler" url="function.xslt-set-sax-handler.php"/>
+<entry name="xslt_set_sax_handlers" url="function.xslt-set-sax-handlers.php"/>
+<entry name="xslt_set_scheme_handler" url="function.xslt-set-scheme-handler.php"/>
+<entry name="xslt_set_scheme_handlers" url="function.xslt-set-scheme-handlers.php"/>
+<entry name="xslt_setopt" url="function.xslt-setopt.php"/>
+<entry name="Counter::__construct" url="internals2.counter.counter-class.construct.php"/>
+<entry name="Counter::getValue" url="internals2.counter.counter-class.getValue.php"/>
+<entry name="Counter::bumpValue" url="internals2.counter.counter-class.bumpValue.php"/>
+<entry name="Counter::resetValue" url="internals2.counter.counter-class.resetValue.php"/>
+<entry name="Counter::getMeta" url="internals2.counter.counter-class.getMeta.php"/>
+<entry name="Counter::getNamed" url="internals2.counter.counter-class.getNamed.php"/>
+<entry name="Counter::setCounterClass" url="internals2.counter.counter-class.setCounterClass.php"/>
+<entry name="counter_get" url="internals2.counter.function.counter-get.php"/>
+<entry name="counter_bump" url="internals2.counter.function.counter-bump.php"/>
+<entry name="counter_reset" url="internals2.counter.function.counter-reset.php"/>
+<entry name="counter_create" url="internals2.counter.function.counter-create.php"/>
+<entry name="counter_get_value" url="internals2.counter.function.counter-get-value.php"/>
+<entry name="counter_bump_value" url="internals2.counter.function.counter-bump-value.php"/>
+<entry name="counter_reset_value" url="internals2.counter.function.counter-reset-value.php"/>
+<entry name="counter_get_meta" url="internals2.counter.function.counter-get-meta.php"/>
+<entry name="counter_get_named" url="internals2.counter.function.counter-get-named.php"/>
+</index>
+</kdeveloptoc>
diff --git a/languages/php/doc/php_bugs.toc b/languages/php/doc/php_bugs.toc
new file mode 100644
index 00000000..48c180a6
--- /dev/null
+++ b/languages/php/doc/php_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>PHP bugs</title>
+<base href="http://bugs.php.net/"/>
+<tocsect1 name="Query" url="index.html">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/php/file_templates/Makefile.am b/languages/php/file_templates/Makefile.am
new file mode 100644
index 00000000..7f031b4a
--- /dev/null
+++ b/languages/php/file_templates/Makefile.am
@@ -0,0 +1,4 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = php
+
+
diff --git a/languages/php/file_templates/php b/languages/php/file_templates/php
new file mode 100644
index 00000000..393d4867
--- /dev/null
+++ b/languages/php/file_templates/php
@@ -0,0 +1,12 @@
+<?php
+// +----------------------------------------------------------------------
+// | PHP Source
+// +----------------------------------------------------------------------
+// | Copyright (C) $YEAR$ by $AUTHOR$ <$EMAIL$>
+// +----------------------------------------------------------------------
+// |
+// | Copyright: See COPYING file that comes with this distribution
+// +----------------------------------------------------------------------
+//
+
+?>
diff --git a/languages/php/kdevphpsupport.desktop b/languages/php/kdevphpsupport.desktop
new file mode 100644
index 00000000..f1dc6597
--- /dev/null
+++ b/languages/php/kdevphpsupport.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=PHP Support
+Comment[ca]=Suport per a PHP
+Comment[da]=PHP-understøttelse
+Comment[de]=PHP-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη PHP
+Comment[es]=Soporte para PHP
+Comment[et]=PHP toetus
+Comment[eu]=PHP euskarria
+Comment[fa]=پشتیبانی پی‌اچ‌پی
+Comment[fr]=Prise en charge du langage PHP
+Comment[ga]=Tacaíocht PHP
+Comment[gl]=Soporte para PHP
+Comment[hi]=पीएचपी समर्थन
+Comment[hu]=PHP-támogatás
+Comment[is]=PHP stuðningur
+Comment[it]=Supporto per PHP
+Comment[ja]=PHP サポート
+Comment[nds]=Ünnerstütten för PHP
+Comment[ne]=पी एच पी समर्थन
+Comment[nl]=Ondersteuning voor PHP
+Comment[pa]=PHP ਸਹਿਯੋਗ
+Comment[pl]=Obsługa PHP
+Comment[pt]=Suporte a PHP
+Comment[pt_BR]=Suporte ao PHP
+Comment[ru]=Поддержка языка PHP
+Comment[sk]=PHP podpora
+Comment[sl]=Podpora za PHP
+Comment[sr]=Подршка за PHP
+Comment[sr@Latn]=Podrška za PHP
+Comment[sv]=PHP-stöd
+Comment[ta]=பிஎச்பிஆதரவு
+Comment[tg]=Ёрӣ намудани забони PHP
+Comment[tr]=PHP Desteği
+Comment[zh_CN]=PHP 支持
+Comment[zh_TW]=PHP 支援
+Name=KDevPHPSupport
+Name[da]=KDevelop PHP-understøttelse
+Name[de]=Unterstützung für PHP (KDevelop)
+Name[hi]=के-डेव-पीएचपी-समर्थन
+Name[nds]=PHP-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaPHP
+Name[sk]=KDev PHP podpora
+Name[sv]=KDevelop PHP-stöd
+Name[ta]=கெடெவ் பிஎச்பி ஆதரவு
+Name[zh_TW]=KDevelop PHP 支援
+GenericName=PHP Support
+GenericName[ca]=Suport per a PHP
+GenericName[da]=PHP-understøttelse
+GenericName[de]=Unterstützung für PHP
+GenericName[el]=Υποστήριξη PHP
+GenericName[es]=Soporte para PHP
+GenericName[et]=PHP toetus
+GenericName[eu]=PHP euskarria
+GenericName[fa]=پشتیبانی پی‌اچ‌پی
+GenericName[fr]=Prise en charge du langage PHP
+GenericName[ga]=Tacaíocht PHP
+GenericName[gl]=Soporte para PHP
+GenericName[hi]=पीएचपी समर्थन
+GenericName[hu]=PHP-támogatás
+GenericName[it]=Supporto per PHP
+GenericName[ja]=PHP サポート
+GenericName[nds]=Ünnerstütten för PHP
+GenericName[ne]=पी एच पी समर्थन
+GenericName[nl]=Ondersteuning voor PHP
+GenericName[pl]=Obsługa PHP
+GenericName[pt]=Suporte a PHP
+GenericName[pt_BR]=Suporte ao PHP
+GenericName[ru]=Поддержка языка PHP
+GenericName[sk]=PHP podpora
+GenericName[sl]=Podpora za PHP
+GenericName[sr]=Подршка за PHP
+GenericName[sr@Latn]=Podrška za PHP
+GenericName[sv]=PHP-stöd
+GenericName[ta]=பிஎச்பி ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони PHP
+GenericName[tr]=PHP Desteği
+GenericName[zh_CN]=PHP 支持
+GenericName[zh_TW]=PHP 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevphpsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=PHP
+
diff --git a/languages/php/kdevphpsupport.rc b/languages/php/kdevphpsupport.rc
new file mode 100644
index 00000000..14ebd3ba
--- /dev/null
+++ b/languages/php/kdevphpsupport.rc
@@ -0,0 +1,18 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KPHPSupport" version="3">
+<MenuBar>
+ <Menu name="edit">
+ <Action name="edit_complete_text"/>
+ </Menu>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+ <Menu name="project" >
+ <Action name="project_new_class" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar">
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+</kpartgui>
+
diff --git a/languages/php/phpcodecompletion.cpp b/languages/php/phpcodecompletion.cpp
new file mode 100644
index 00000000..c9bd7213
--- /dev/null
+++ b/languages/php/phpcodecompletion.cpp
@@ -0,0 +1,712 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include "phpcodecompletion.h"
+#include "phpsupportpart.h"
+#include "phpconfigdata.h"
+
+#include <kdevcore.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+
+#include <iostream>
+
+#include "phpfile.h"
+
+using namespace std;
+
+PHPCodeCompletion::PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config) : QObject(), m_cursorInterface(0), m_codeInterface(0), m_editInterface(0), m_selectionInterface(0) {
+
+ m_phpSupport = phpSupport;
+ m_config = config;
+ m_model = phpSupport->codeModel();
+ m_argWidgetShow = false;
+ m_completionBoxShow = false;
+
+ readGlobalPHPFunctionsFile();
+}
+
+PHPCodeCompletion::~PHPCodeCompletion(){
+}
+
+void PHPCodeCompletion::readGlobalPHPFunctionsFile(){
+ KStandardDirs *dirs = PHPSupportFactory::instance()->dirs();
+ QString phpFuncFile = dirs->findResource("data","kdevphpsupport/phpfunctions");
+ QRegExp lineReg(":([0-9A-Za-z_]+) ([0-9A-Za-z_]+)\\((.*)\\)");
+ FunctionCompletionEntry e;
+
+ QFile f(phpFuncFile);
+ if ( f.open(IO_ReadOnly) ) { // file opened successfully
+ QTextStream t( &f ); // use a text stream
+ QString s;
+ while ( !t.eof() ) { // until end of file...
+ s = t.readLine(); // line of text excluding '\n'
+ if (lineReg.search(s.local8Bit()) != -1) {
+ e.prefix = lineReg.cap(1);
+ e.text = lineReg.cap(2);
+ e.postfix = "(" + QString(lineReg.cap(3)) + ")";
+ e.prototype = QString(lineReg.cap(1)) + " " + QString(lineReg.cap(2)) + "(" + QString(lineReg.cap(3)) + ")";
+ m_globalFunctions.append(e);
+ }
+ }
+ f.close();
+ }
+}
+
+void PHPCodeCompletion::argHintHided(){
+ kdDebug(9018) << "PHPCodeCompletion::argHintHided" << endl;
+ m_argWidgetShow = false;
+}
+
+void PHPCodeCompletion::completionBoxHided(){
+ kdDebug(9018) << "PHPCodeCompletion::completionBoxHided()" << endl;
+ m_completionBoxShow = false;
+}
+
+void PHPCodeCompletion::setActiveEditorPart(KParts::Part *part)
+{
+ if (!part || !part->widget())
+ return;
+
+ kdDebug(9018) << "PHPCodeCompletion::setActiveEditorPart" << endl;
+
+ if (!(m_config->getCodeCompletion() || m_config->getCodeHinting()))
+ return; // no help
+
+ m_editInterface = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!m_editInterface) {
+ kdDebug(9018) << "editor doesn't support the EditDocumentIface" << endl;
+ return;
+ }
+
+ m_cursorInterface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (!m_cursorInterface) {
+ kdDebug(9018) << "editor does not support the ViewCursorInterface" << endl;
+ return;
+ }
+
+ m_codeInterface = dynamic_cast<KTextEditor::CodeCompletionInterface*>(part->widget());
+ if (!m_codeInterface) { // no CodeCompletionDocument available
+ kdDebug(9018) << "editor doesn't support the CodeCompletionDocumentIface" << endl;
+ return;
+ }
+
+ m_selectionInterface = dynamic_cast<KTextEditor::SelectionInterface*>(part);
+ if (!m_selectionInterface) {
+ kdDebug(9018) << "editor doesn't support the SelectionInterface" << endl;
+ return;
+ }
+
+ disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice
+// connect(part->widget(), SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
+ connect( part, SIGNAL(textChanged()), this, SLOT(cursorPositionChanged()) );
+ connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHided()));
+ connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxHided()));
+ connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHided()));
+}
+
+void PHPCodeCompletion::cursorPositionChanged(){
+ uint line, col;
+ if( !m_cursorInterface || !m_selectionInterface || !m_codeInterface || !m_editInterface )
+ return;
+ m_cursorInterface->cursorPositionReal(&line, &col);
+
+ kdDebug(9018) << "cursorPositionChanged:" << line << ":" << col << endl;
+
+ m_currentLine = line;
+ QString lineStr = m_editInterface->textLine(line);
+ if (lineStr.isNull() || lineStr.isEmpty()) {
+ return;
+ }
+
+ if (m_selectionInterface->hasSelection()) {
+ kdDebug(9018) << "No CodeCompletion/ArgHinting at the moment, because text is selected" << endl;
+ return;
+ }
+
+ if (m_config->getCodeHinting()) {
+ int pos1 = lineStr.findRev("(", col - 1);
+ int pos2 = lineStr.findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), pos1 - 1);
+ int pos3 = lineStr.findRev(")", col);
+
+ if (pos1 > pos2 && pos1 != -1 && pos3 < pos1) {
+ QString line = lineStr.mid(pos2 + 1, pos1 - pos2 - 1).stripWhiteSpace();
+ checkForArgHint(line, col);
+ kdDebug(9018) << "end checkForArgHint" << endl;
+ }
+
+ }
+
+ if (m_config->getCodeCompletion()) {
+ if (m_completionBoxShow == true) {
+ return;
+ }
+
+ int pos = lineStr.findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
+ QString line = lineStr.mid(pos + 1, col - pos).stripWhiteSpace();
+
+ if (checkForVariable(line, col)) {
+kdDebug(9018) << "end checkForVariable" << endl;
+ return;
+ }
+ if (checkForStaticFunction(line, col)) {
+kdDebug(9018) << "end checkForStaticFunction" << endl;
+ return;
+ }
+
+ if(checkForGlobalFunction(line, col)) {
+kdDebug(9018) << "end checkForGlobalFunction" << endl;
+ return;
+ }
+
+ pos = lineStr.stripWhiteSpace().findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
+ line = lineStr.mid(pos + 1, col - pos);
+
+ if (checkForNew(line, col)) {
+kdDebug(9018) << "end checkForNew" << endl;
+ return;
+ }
+
+ if (checkForExtends(line, col)) {
+kdDebug(9018) << "end checkForExtends" << endl;
+ return;
+ }
+kdDebug(9018) << "end checkFor" << endl;
+ }
+}
+
+bool PHPCodeCompletion::showCompletionBox(QValueList<KTextEditor::CompletionEntry> list, unsigned long max) {
+ if (list.count() > 0) {
+ if (list.count() == 1) {
+ KTextEditor::CompletionEntry e = list.first();
+ if (e.text.length() == max)
+ return false;
+ }
+ m_completionBoxShow = true;
+ m_codeInterface->showCompletionBox(list, max, FALSE);
+ return true;
+ }
+ return false;
+}
+
+bool PHPCodeCompletion::checkForStaticFunction(QString line, int col) {
+ kdDebug(9018) << "checkForStaticFunction" << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+
+ if (line.find("::") == -1)
+ return false;
+
+ QRegExp Class("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
+ Class.setCaseSensitive(FALSE);
+
+ if (Class.search(line) != -1) {
+ QString classname = Class.cap(1);
+ QString function = Class.cap(2);
+
+ ClassList classList = getClassByName(classname);
+
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+ FunctionList funcList = nClass->functionList();
+ FunctionList::Iterator funcIt;
+
+ for (funcIt = funcList.begin(); funcIt != funcList.end(); ++funcIt) {
+ FunctionDom nFunc = *funcIt;
+ if ((function.isEmpty() || nFunc->name().startsWith(function, FALSE)) && nFunc->isStatic()) {
+ KTextEditor::CompletionEntry e;
+ e.prefix = nClass->name() + " ::";
+ e.text = nFunc->name();
+ ArgumentDom pArg = (*funcIt)->argumentList().first();
+ if (pArg)
+ e.postfix = "(" + pArg->type() +")";
+ else
+ e.postfix = "()";
+ list.append(e);
+ }
+ }
+
+ if (nClass->baseClassList().count() != 0) {
+ QStringList base = nClass->baseClassList();
+ QStringList::Iterator nameIt;
+ for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) {
+ ClassList baseList = getClassByName(*nameIt);
+ ClassList::Iterator baseIt;
+ for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt)
+ classList.append(*baseIt);
+ }
+ }
+ }
+ return showCompletionBox(list, Class.cap(2).length());
+ }
+ return false;
+}
+
+bool PHPCodeCompletion::checkForNew(QString line, int col){
+ kdDebug(9018) << "checkForNew" << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+
+ if (line.find("new ", 0, FALSE) == -1)
+ return false;
+
+ QRegExp New("[& \t]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
+ New.setCaseSensitive(FALSE);
+
+ if (New.search(line) != -1) {
+ list = getClasses( New.cap(1) );
+
+ if (New.cap(1).lower() == "ob") {
+ KTextEditor::CompletionEntry e;
+ e.text = "object";
+ list.append(e);
+ }
+
+ if (New.cap(1).lower() == "ar") {
+ KTextEditor::CompletionEntry e;
+ e.text = "array";
+ list.append(e);
+ }
+ return showCompletionBox(list, New.cap(1).length());
+ }
+
+ return false;
+}
+
+bool PHPCodeCompletion::checkForExtends(QString line, int col){
+ kdDebug(9018) << "checkForExtends" << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+
+ if (line.find("extends", 0, FALSE) == -1)
+ return false;
+
+ QRegExp extends("[ \t]*extends[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
+ extends.setCaseSensitive(FALSE);
+
+ if (extends.search(line) != -1) {
+ list = getClasses(extends.cap(1));
+ return showCompletionBox(list, extends.cap(1).length());
+ }
+
+ return false;
+}
+
+bool PHPCodeCompletion::checkForVariable(QString line, int col){
+ kdDebug(9018) << "checkForVariable" << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+ QString args;
+
+ if (line.find("->") == -1) {
+ return false;
+ }
+
+ if (line.left(2) != "->") {
+ int pos = line.findRev("->");
+ args = line.mid(pos + 2, line.length() - pos);
+ line = line.mid(0, pos);
+ }
+
+ QStringList vars = QStringList::split("->", line);
+ QString classname;
+
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) {
+ classname = getClassName(*it, classname);
+ }
+
+ if (classname.isEmpty()) {
+ return false;
+ }
+
+ this->setStatusBar(line, classname);
+
+ list = this->getFunctionsAndVars(classname, args);
+ return showCompletionBox(list, args.length());
+}
+
+bool PHPCodeCompletion::checkForGlobalFunction(QString line, int col) {
+ kdDebug(9018) << "checkForGlobalFunction(" + line + "," << col << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+
+ if (line.length() < 3)
+ return false;
+
+ list = this->getFunctionsAndVars("", line);
+ return showCompletionBox(list, line.length());
+}
+
+QValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getClasses(QString name) {
+ QValueList<KTextEditor::CompletionEntry> list;
+ QStringList added;
+
+ ClassList classList = m_model->globalNamespace()->classList();
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+ if (name == NULL || name.isEmpty() || nClass->name().startsWith(name, FALSE)) {
+ KTextEditor::CompletionEntry e;
+
+ QStringList::Iterator it = added.find(nClass->name());
+ if (it == added.end()) {
+ e.text = nClass->name();
+ list.append(e);
+ added.append(nClass->name());
+ }
+ }
+ }
+ return list;
+}
+
+QValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getFunctionsAndVars(QString classname, QString function) {
+ kdDebug(9018) << "getFunctionsAndVars " << classname << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+
+ if (classname.isEmpty()) {
+ QValueList<FunctionCompletionEntry>::Iterator it;
+ for( it = m_globalFunctions.begin(); it != m_globalFunctions.end(); ++it ) {
+ if((*it).text.startsWith(function, FALSE)){
+ KTextEditor::CompletionEntry e;
+ e = (*it);
+ list.append(e);
+ }
+ }
+
+ FunctionList methodList = m_model->globalNamespace()->functionList();
+ FunctionList::Iterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
+ if ((*methodIt)->name().startsWith(function, FALSE)){
+ KTextEditor::CompletionEntry e;
+ e.text = (*methodIt)->name();
+ ArgumentDom pArg = (*methodIt)->argumentList().first();
+ if (pArg)
+ e.postfix = "(" + pArg->type() +")";
+ else
+ e.postfix = "()";
+ list.append(e);
+ }
+ }
+ return list;
+ }
+
+ ClassList classList = getClassByName(classname);
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+
+ FunctionList methodList = nClass->functionList();
+ FunctionList::Iterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
+ FunctionDom pMethod = *methodIt;
+ if (function.isEmpty() || pMethod->name().startsWith(function, FALSE)) {
+ KTextEditor::CompletionEntry e;
+ ArgumentDom arg = pMethod->argumentList().first();
+
+ e.prefix = nClass->name() + " ::";
+ e.text = pMethod->name();
+ e.postfix = "(" + arg->type() + ")";
+ list.append(e);
+ }
+ }
+ VariableList attrList = nClass->variableList();
+ VariableList::Iterator attrIt;
+ for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) {
+ VariableDom pVar = *attrIt;
+ if (function.isEmpty() || pVar->name().startsWith(function, FALSE)) {
+ KTextEditor::CompletionEntry e;
+ e.prefix = nClass->name() + " ::";
+ e.text = pVar->name();
+ e.postfix = "";
+ list.append(e);
+ }
+ }
+
+ if (nClass->baseClassList().count() != 0) {
+ QStringList base = nClass->baseClassList();
+ QStringList::Iterator nameIt;
+ for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) {
+ ClassList baseList = getClassByName(*nameIt);
+ ClassList::Iterator baseIt;
+ for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt)
+ classList.append(*baseIt);
+ }
+ }
+ }
+ return list;
+}
+
+QStringList PHPCodeCompletion::getArguments(QString classname, QString function) {
+ kdDebug(9018) << "getArguments " << function << endl;
+ QStringList list;
+
+ if (classname.isEmpty()) {
+ QValueList<FunctionCompletionEntry>::Iterator it;
+ for( it = m_globalFunctions.begin(); it != m_globalFunctions.end(); ++it ) {
+ if((*it).text.lower() == function.lower()){
+ KTextEditor::CompletionEntry e = (*it);
+ list.append(e.text + e.postfix);
+ }
+ }
+
+ FunctionList methodList = m_model->globalNamespace()->functionList();
+ FunctionList::Iterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
+ if ((*methodIt)->name().lower() == function.lower()){
+ KTextEditor::CompletionEntry e;
+ ArgumentDom pArgs;
+ QString args = "()";
+
+ ArgumentDom pArg = (*methodIt)->argumentList().first();
+ if (pArgs)
+ args = "(" + pArg->type() +")";
+
+ list.append((*methodIt)->name() + "(" + args +")");
+ }
+ }
+ return list;
+ }
+
+ ClassList classList = getClassByName(classname);
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+
+ FunctionList methodList = nClass->functionList();
+ FunctionList::Iterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
+ if ((*methodIt)->name().lower() == function.lower()) {
+ ArgumentDom pArg = (*methodIt)->argumentList().first();
+ if (pArg)
+ list.append(nClass->name() + "::" + function + "(" + pArg->type() +")");
+ }
+ }
+
+ if (nClass->baseClassList().count() != 0) {
+ QStringList base = nClass->baseClassList();
+ QStringList::Iterator nameIt;
+ for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) {
+ ClassList baseList = getClassByName(*nameIt);
+ ClassList::Iterator baseIt;
+ for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt)
+ classList.append(*baseIt);
+ }
+ }
+
+ }
+ return list;
+}
+
+QString PHPCodeCompletion::getCurrentClassName() {
+ kdDebug(9018) << "getCurrentClassName" << endl;
+ QRegExp Class("^[ \t]*(abstract|final|)[ \t]*class[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*(extends[ \t]*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))?.*$");
+ Class.setCaseSensitive(FALSE);
+
+ for(int i = m_currentLine; i >= 0; i--){
+ QString line = m_editInterface->textLine(i);
+ if (!line.isNull()) {
+ if (Class.search(line) != -1)
+ return Class.cap(2);
+ }
+ }
+ return QString::null;
+}
+
+QString PHPCodeCompletion::getClassName(QString varName, QString classname) {
+ kdDebug(9018) << "getClassName " << varName << "::" << classname << endl;
+
+ if (varName.find("$") == 0)
+ varName = varName.mid(1);
+
+ if (varName.lower() == "this")
+ return this->getCurrentClassName();
+
+ if (classname.isEmpty()) {
+ VariableList attrList = m_model->globalNamespace()->variableList();
+ VariableList::Iterator attrIt;
+
+ for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) {
+ if ((*attrIt)->name().lower() == varName.lower())
+ return (*attrIt)->type();
+ }
+ }
+
+ ClassList classList = getClassByName( classname );
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom pClass = *classIt;
+
+ FunctionList funcList = pClass->functionList();
+ FunctionList::Iterator funcIt;
+
+ for (funcIt = funcList.begin(); funcIt != funcList.end(); ++funcIt) {
+ if (QString((*funcIt)->name().lower() + "(") == varName.lower())
+ return (*funcIt)->resultType();
+ }
+
+ VariableList attrList = pClass->variableList();
+ VariableList::Iterator attrIt;
+
+ for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) {
+ if ((*attrIt)->name().lower() == varName.lower())
+ return (*attrIt)->type();
+ }
+ }
+
+ kdDebug(9018) << "Need " << classname << " " << varName << endl;
+/*
+ /// @fixme peut devenir recursif voir xbutton.php ligne 204
+ QRegExp createmember("\\" + varName + "[ \t]*=[ \t]*(.*)[ \t]*;");
+
+ for(int i = m_currentLine; i >= 0; i--){
+ QString line = m_editInterface->textLine(i);
+ if (!line.isNull() && line.find(varName,0 , FALSE) != -1) {
+
+ if (createmember.search(line) != -1) {
+ QString right = createmember.cap(1).stripWhiteSpace();
+
+ QStringList vars = QStringList::split("->", right);
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) {
+ QString objet = *it;
+ ++it;
+ if (it == vars.end())
+ break;
+
+ QString var = *it;
+
+ if (objet.lower() == "$this")
+ objet = this->getCurrentClassName();
+
+ classname = getClassName(var, objet);
+
+ NamespaceDom varns = m_model->globalNamespace()->namespaceByName("varsns");
+ QString fromns;
+ if (varns) {
+ QString name = objet + "::" + var;
+ kdDebug(9018) << name << endl;
+ VariableDom nVar = varns->variableByName(name);
+ fromns = nVar->type();
+
+ }
+ kdDebug(9018) << "Need " << objet << " " << var << " " << fromns << " " << vars.size() << endl;
+
+ }
+ kdDebug(9018) << "Dehors" << " " << classname << endl;
+
+ return classname;
+ }
+ }
+ }
+ */
+ return "";
+}
+
+QValueList<ClassDom> PHPCodeCompletion::getClassByName(QString classname) {
+ QValueList<ClassDom> CList;
+
+ ClassList classList = m_model->globalNamespace()->classList();
+
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+ if (nClass->name().lower() == classname.lower())
+ CList.append( nClass );
+ }
+ return CList;
+}
+
+bool PHPCodeCompletion::checkForArgHint(QString line, int col) {
+ kdDebug(9018) << "checkForArgHint" << endl;
+ QValueList<KTextEditor::CompletionEntry> list;
+ QStringList argsList;
+
+ if (m_argWidgetShow == true)
+ return false;
+
+ if (line.find("::") != -1) {
+ QRegExp Static("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)");
+ Static.setCaseSensitive(FALSE);
+
+ if (Static.search(line) != -1) {
+ QString classname = Static.cap(1);
+ QString function = Static.cap(2);
+
+ argsList = getArguments(classname, function);
+
+ if (argsList.count() > 0) {
+ m_argWidgetShow = true;
+ m_codeInterface->showArgHint ( argsList, "()", "," );
+ return true;
+ }
+ }
+ }
+
+ if (line.findRev("->") != -1) {
+ int pos1 = line.findRev("->");
+
+ QString classname;
+ QString function = line.mid(pos1 + 2);
+
+ line = line.mid(0, pos1);
+
+kdDebug(9018) << "checkForArgHint 2 " << line << endl;
+
+ QStringList vars = QStringList::split("->", line);
+
+ for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) {
+kdDebug(9018) << "for " << line << endl;
+ classname = getClassName(*it, classname);
+kdDebug(9018) << "next " << line << endl;
+ }
+
+kdDebug(9018) << "checkForArgHint 4 " << line << endl;
+
+ argsList = getArguments(classname, function);
+ if (argsList.count() > 0) {
+ m_argWidgetShow = true;
+ m_codeInterface->showArgHint ( argsList, "()", "," );
+ return true;
+ }
+ }
+
+kdDebug(9018) << "checkForArgHint 0 " << line << endl;
+
+ argsList = getArguments("", line);
+ if (argsList.count() > 0) {
+ m_argWidgetShow = true;
+ m_codeInterface->showArgHint ( argsList, "()", "," );
+ return true;
+ }
+
+ argsList = getArguments(line, line);
+ if (argsList.count() > 0) {
+ m_argWidgetShow = true;
+ m_codeInterface->showArgHint ( argsList, "()", "," );
+ return true;
+ }
+
+ return false;
+}
+
+void PHPCodeCompletion::setStatusBar(QString expr, QString type) {
+ m_phpSupport->mainWindow()->statusBar()->message( i18n("Type of %1 is %2").arg(expr).arg(type), 1000 );
+}
+
+#include "phpcodecompletion.moc"
diff --git a/languages/php/phpcodecompletion.h b/languages/php/phpcodecompletion.h
new file mode 100644
index 00000000..41d79934
--- /dev/null
+++ b/languages/php/phpcodecompletion.h
@@ -0,0 +1,103 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+
+#ifndef PHPCODECOMPLETION_H
+#define PHPCODECOMPLETION_H
+
+#include <codemodel.h>
+
+#include <qobject.h>
+#include <kregexp.h>
+#include <kparts/part.h>
+
+#include <kdevmainwindow.h>
+#include <kstatusbar.h>
+
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+#include <ktexteditor/selectioninterface.h>
+
+
+class KDevCore;
+class PHPSupportPart;
+class PHPConfigData;
+
+class FunctionCompletionEntry : public KTextEditor::CompletionEntry {
+public:
+ QString prototype;
+};
+
+class PHPCodeCompletion : public QObject {
+ Q_OBJECT
+
+public:
+ PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config);
+ ~PHPCodeCompletion();
+ void setActiveEditorPart(KParts::Part *part);
+
+public slots:
+ void cursorPositionChanged();
+
+protected slots:
+ void argHintHided();
+ void completionBoxHided();
+
+protected:
+ bool showCompletionBox(QValueList<KTextEditor::CompletionEntry> list, unsigned long max);
+
+ bool checkForVariable(QString line, int col);
+ bool checkForStaticFunction(QString line, int col);
+ bool checkForNew(QString line, int col);
+ bool checkForExtends(QString line, int col);
+ bool checkForGlobalFunction(QString line, int col);
+
+ bool checkForArgHint(QString line, int col);
+
+ QValueList<KTextEditor::CompletionEntry> getClasses(QString name);
+ QValueList<KTextEditor::CompletionEntry> getFunctionsAndVars(QString classname, QString str);
+ QStringList getArguments(QString classname, QString function);
+ QString getCurrentClassName();
+ QString getClassName(QString varName, QString classname);
+ QValueList<ClassDom> getClassByName(QString classname);
+
+ void readGlobalPHPFunctionsFile();
+ void setStatusBar(QString expr, QString type);
+
+ private:
+ int m_currentLine;
+ QValueList<FunctionCompletionEntry> m_globalFunctions;
+
+ PHPSupportPart* m_phpSupport;
+ PHPConfigData* m_config;
+ CodeModel* m_model;
+
+ bool m_argWidgetShow;
+ bool m_completionBoxShow;
+
+ KTextEditor::EditInterface *m_editInterface;
+ KTextEditor::CodeCompletionInterface *m_codeInterface;
+ KTextEditor::ViewCursorInterface *m_cursorInterface;
+ KTextEditor::SelectionInterface *m_selectionInterface;
+
+ QString findDeclaration(QString name, int line = -1);
+};
+
+#endif
diff --git a/languages/php/phpconfigdata.cpp b/languages/php/phpconfigdata.cpp
new file mode 100644
index 00000000..45f27a79
--- /dev/null
+++ b/languages/php/phpconfigdata.cpp
@@ -0,0 +1,88 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include "kstandarddirs.h"
+#include "phpconfigdata.h"
+#include "domutil.h"
+#include <iostream>
+
+PHPConfigData::PHPConfigData(QDomDocument* dom) {
+ QString file = KStandardDirs::findExe("php");
+
+ if (file.isEmpty())
+ file = "/usr/local/bin/php";
+
+ document = dom;
+ invocationMode = (InvocationMode) DomUtil::readIntEntry(*dom, "/kdevphpsupport/general/invocationMode", Web);
+
+ webURL = DomUtil::readEntry(*document, "/kdevphpsupport/webInvocation/weburl");
+
+ phpExePath = DomUtil::readEntry(*document, "/kdevphpsupport/shell/phpexe", file);
+ phpIniPath = DomUtil::readEntry(*document, "/kdevphpsupport/shell/phpini");
+
+ phpIncludePath = DomUtil::readEntry(*document, "/kdevphpsupport/options/phpincludepath");
+ phpStartupFile = DomUtil::readEntry(*document, "/kdevphpsupport/options/defaultFile");
+ phpStartupFileMode = (StartupFileMode)DomUtil::readIntEntry(*document, "/kdevphpsupport/options/startupFileMode", Current);
+
+ m_codeCompletion = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion", true);
+ m_codeHinting = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting", true);
+ m_realtimeParsing = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing", true);
+}
+
+PHPConfigData::~PHPConfigData() {
+}
+
+void PHPConfigData::storeConfig() {
+ DomUtil::writeIntEntry(*document, "/kdevphpsupport/general/invocationMode",(int) invocationMode);
+
+ DomUtil::writeEntry(*document, "/kdevphpsupport/webInvocation/weburl",webURL);
+
+ DomUtil::writeEntry(*document, "/kdevphpsupport/shell/phpexe",phpExePath);
+ DomUtil::writeEntry(*document, "/kdevphpsupport/shell/phpini",phpIniPath);
+
+ DomUtil::writeEntry(*document, "/kdevphpsupport/options/phpincludepath",phpIncludePath);
+ DomUtil::writeEntry(*document, "/kdevphpsupport/options/defaultFile",phpStartupFile);
+ DomUtil::writeIntEntry(*document, "/kdevphpsupport/options/startupFileMode",(int) phpStartupFileMode);
+
+ DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion",m_codeCompletion);
+ DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting",m_codeHinting);
+ DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing",m_realtimeParsing);
+ emit configStored(); // inform all others
+}
+
+bool PHPConfigData::validateConfig(){
+ bool valid = false;
+ if (invocationMode == Web || invocationMode == Shell) {
+ valid = true;
+ }
+ if (valid) {
+ if (invocationMode == Web) {
+ if (!(!webURL.isEmpty() && (phpStartupFileMode == Default || phpStartupFileMode == Current))) {
+ valid = false;
+ }
+ }
+ if (invocationMode == Shell) {
+ if (phpExePath.isEmpty()) {
+ valid = false;
+ }
+ }
+ }
+ return valid;
+}
+#include "phpconfigdata.moc"
diff --git a/languages/php/phpconfigdata.h b/languages/php/phpconfigdata.h
new file mode 100644
index 00000000..0c7a49eb
--- /dev/null
+++ b/languages/php/phpconfigdata.h
@@ -0,0 +1,155 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef PHPCONFIGDATA_H
+#define PHPCONFIGDATA_H
+
+#include <qstring.h>
+#include <qdom.h>
+#include <qobject.h>
+
+/**
+ *@author Sandy Meier
+ */
+
+class PHPConfigData : public QObject {
+Q_OBJECT
+
+signals:
+ void configStored();
+
+public:
+ enum InvocationMode {Web=1,Shell=2};
+ enum StartupFileMode {Current=1,Default=2};
+
+ PHPConfigData(QDomDocument* document);
+ ~PHPConfigData();
+
+ /** returns true if the configuration is ok, false if something is missing
+ */
+ bool validateConfig();
+ /** write the configuration to the DOM document(project file)
+ */
+ void storeConfig();
+
+ InvocationMode getInvocationMode() {
+ return invocationMode;
+ }
+
+ void setInvocationMode(InvocationMode mode) {
+ invocationMode = mode;
+ }
+
+ // web
+ QString getWebURL() {
+ return webURL;
+ }
+ void setWebURL(QString weburl) {
+ webURL = weburl;
+ }
+
+ // shell
+ QString getPHPExecPath() {
+ return phpExePath;
+ }
+
+ void setPHPExePath(QString path) {
+ phpExePath = path;
+ }
+
+ // config
+ QString getPHPIniPath() {
+ return phpIniPath;
+ }
+
+ void setPHPIniPath(QString path) {
+ phpIniPath = path;
+ }
+
+ // options
+ QString getPHPIncludePath() {
+ return phpIncludePath;
+ }
+ void setPHPIncludePath(QString path) {
+ phpIncludePath = path;
+ }
+
+ QString getStartupFile() {
+ return phpStartupFile;
+ }
+ void setStartupFile(QString defaultFile) {
+ phpStartupFile = defaultFile;
+ }
+
+ StartupFileMode getStartupFileMode() {
+ return phpStartupFileMode;
+ }
+
+ void setStartupFileMode(StartupFileMode mode) {
+ phpStartupFileMode = mode;
+ }
+
+ // code help
+ void setCodeCompletion(bool enable) {
+ m_codeCompletion = enable;
+ }
+
+ bool getCodeCompletion() {
+ return m_codeCompletion;
+ }
+
+ void setCodeHinting(bool enable) {
+ m_codeHinting = enable;
+ }
+
+ bool getCodeHinting() {
+ return m_codeHinting;
+ }
+
+ void setRealtimeParsing(bool enable) {
+ m_realtimeParsing = enable;
+ }
+
+ bool getRealtimeParsing() {
+ return m_realtimeParsing;
+ }
+
+private:
+ QDomDocument* document;
+ InvocationMode invocationMode;
+ // web
+ QString webURL;
+
+ // shell
+ QString phpExePath;
+ QString phpIniPath;
+ QString phpStartupFile;
+
+ // options
+ QString phpIncludePath;
+ QString phpDefaultFile;
+ StartupFileMode phpStartupFileMode;
+
+ // code help
+ bool m_codeCompletion;
+ bool m_codeHinting;
+ bool m_realtimeParsing;
+};
+
+#endif
diff --git a/languages/php/phpconfigwidget.cpp b/languages/php/phpconfigwidget.cpp
new file mode 100644
index 00000000..829e3038
--- /dev/null
+++ b/languages/php/phpconfigwidget.cpp
@@ -0,0 +1,161 @@
+#include "domutil.h"
+#include <kprocess.h>
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qmultilineedit.h>
+#include <qcstring.h>
+#include <iostream>
+#include <qradiobutton.h>
+
+#include <kfiledialog.h>
+#include <kstandarddirs.h>
+
+#include "phpinfodlg.h"
+#include "phpconfigwidget.h"
+#include "phpconfigdata.h"
+
+using namespace std;
+
+PHPConfigWidget::PHPConfigWidget(PHPConfigData* data,QWidget* parent, const char* name, WFlags fl )
+ : PHPConfigWidgetBase( parent, name, fl )
+{
+ configData = data;
+ m_phpInfo = "";
+
+ PHPConfigData::InvocationMode mode = configData->getInvocationMode();
+
+ // page "Invocation"
+ if (mode == PHPConfigData::Shell) {
+ callPHPDirectly_radio->setChecked(true);
+ }
+
+ if (mode == PHPConfigData::Web) {
+ callWebserver_radio->setChecked(true);
+ }
+
+ // page webserver
+ QString weburl = configData->getWebURL();
+ if (weburl.isEmpty())
+ weburl = "http://localhost/";
+ weburl_edit->setText(weburl);
+
+ // page shell
+ QString exepath = configData->getPHPExecPath();
+ if (exepath.isEmpty()) {
+ QString fiexepath = KStandardDirs::findExe("php");
+
+ if (exepath.isEmpty())
+ exepath = "/usr/local/bin/php";
+ }
+
+ exe_edit->setText(exepath);
+
+ // page options
+ PHPConfigData::StartupFileMode phpStartupFileMode = configData->getStartupFileMode();
+ QString phpStartupFile = configData->getStartupFile();
+
+ useDefaultFile_edit->setText(phpStartupFile);
+
+ if(phpStartupFileMode == PHPConfigData::Current) {
+ useCurrentFile_radio->setChecked(true);
+ }
+
+ if(phpStartupFileMode == PHPConfigData::Default) {
+ useDefaultFile_radio->setChecked(true);
+ }
+
+ QString includepath = configData->getPHPIncludePath();
+ include_path_edit->setText(includepath);
+
+ codeCompletion_checkbox->setChecked(configData->getCodeCompletion());
+ codeHinting_checkbox->setChecked(configData->getCodeHinting());
+ realtimeParsing_checkbox->setChecked(configData->getRealtimeParsing());
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+PHPConfigWidget::~PHPConfigWidget()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+void PHPConfigWidget::accept()
+{
+ // invocation
+ if (callPHPDirectly_radio->isChecked()){
+ configData->setInvocationMode(PHPConfigData::Shell);
+ }
+ if (callWebserver_radio->isChecked()){
+ configData->setInvocationMode(PHPConfigData::Web);
+ }
+
+ // webserver
+ configData->setWebURL(weburl_edit->text());
+
+ // shell
+ configData->setPHPExePath(exe_edit->text());
+
+ // config
+ configData->setPHPIniPath(ini_edit->text());
+
+ // options
+ configData->setStartupFile(useDefaultFile_edit->text());
+
+ if (useCurrentFile_radio->isChecked()) {
+ configData->setStartupFileMode(PHPConfigData::Current);
+ }
+ if (useDefaultFile_radio->isChecked()){
+ configData->setStartupFileMode(PHPConfigData::Default);
+ }
+
+ configData->setPHPIncludePath(include_path_edit->text());
+ configData->setCodeCompletion(codeCompletion_checkbox->isChecked());
+ configData->setCodeHinting(codeHinting_checkbox->isChecked());
+ configData->setRealtimeParsing(realtimeParsing_checkbox->isChecked());
+
+ configData->storeConfig();
+}
+
+void PHPConfigWidget::slotZendButtonClicked()
+{
+ qWarning( "PHPConfigWidgetBase::slotZendButtonClicked(): Not implemented yet!" );
+}
+
+void PHPConfigWidget::slotAboutClicked()
+{
+ qWarning( "PHPConfigWidget::slotAboutClicked()" );
+ KShellProcess proc("/bin/sh");
+ proc << exe_edit->text();
+ proc << "-m";
+
+ connect( &proc, SIGNAL(receivedStdout (KProcess*, char*, int)),
+ this, SLOT(slotReceivedPHPInfo (KProcess*, char*, int)));
+ proc.start(KProcess::Block,KProcess::Stdout);
+ PHPInfoDlg dlg(this,"phpinfo",true);
+ dlg.php_edit->setText(m_phpInfo);
+ dlg.exec();
+ m_phpInfo = "";
+}
+
+void PHPConfigWidget::slotReceivedPHPInfo (KProcess* /*proc*/, char* buffer, int buflen){
+ m_phpInfo += QCString(buffer,buflen+1);
+}
+
+void PHPConfigWidget::slotPHPExeButtonClicked(){
+ QString exe = KFileDialog::getOpenFileName(QFileInfo(exe_edit->text()).filePath());
+ if (!exe.isEmpty()){
+ exe_edit->setText(exe);
+ }
+}
+
+void PHPConfigWidget::slotPHPIniButtonClicked()
+{
+ QString file = KFileDialog::getOpenFileName(QFileInfo(exe_edit->text()).filePath(), QString("*.ini|INI File (*.ini)"));
+
+ if (!file.isEmpty()){
+ ini_edit->setText(file);
+ }
+}
+
+#include "phpconfigwidget.moc"
diff --git a/languages/php/phpconfigwidget.h b/languages/php/phpconfigwidget.h
new file mode 100644
index 00000000..87bb6ab3
--- /dev/null
+++ b/languages/php/phpconfigwidget.h
@@ -0,0 +1,32 @@
+#ifndef PHPCONFIGWIDGET_H
+#define PHPCONFIGWIDGET_H
+
+#include "phpconfigwidgetbase.h"
+#include <qstring.h>
+class KProcess;
+class PHPConfigData;
+
+class PHPConfigWidget : public PHPConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ PHPConfigWidget( PHPConfigData* data,QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~PHPConfigWidget();
+
+public slots:
+ virtual void slotZendButtonClicked();
+ virtual void slotAboutClicked();
+ virtual void slotPHPExeButtonClicked();
+ virtual void slotPHPIniButtonClicked();
+ void accept();
+ void slotReceivedPHPInfo (KProcess* proc, char* buffer, int buflen);
+
+ private:
+ QDomDocument* dom;
+ QString m_phpInfo;
+ PHPConfigData* configData;
+
+};
+
+#endif
diff --git a/languages/php/phpconfigwidgetbase.ui b/languages/php/phpconfigwidgetbase.ui
new file mode 100644
index 00000000..8cfae9dc
--- /dev/null
+++ b/languages/php/phpconfigwidgetbase.ui
@@ -0,0 +1,561 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PHPConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PHPConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>545</width>
+ <height>510</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>PHP Options</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>TabWidget1</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Genera&amp;l</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup1_2</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Startup</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>useCurrentFile_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Use current file in editor</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>useDefaultFile_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;this file as default:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>useDefaultFile_edit</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox13</cstring>
+ </property>
+ <property name="title">
+ <string>Code Help</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>codeCompletion_checkbox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable code completion</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>codeHinting_checkbox</cstring>
+ </property>
+ <property name="text">
+ <string>Enable code &amp;hinting</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>GroupBox14</cstring>
+ </property>
+ <property name="title">
+ <string>Parser</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_3_3_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>PHP &amp;include path:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>include_path</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>include_path_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>realtimeParsing_checkbox</cstring>
+ </property>
+ <property name="text">
+ <string>Ena&amp;ble realtime parser</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>170</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>PixmapLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>In&amp;vocation</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>select_label</cstring>
+ </property>
+ <property name="text">
+ <string>Please select how KDevelop should execute your scripts.</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ButtonGroup3</cstring>
+ </property>
+ <property name="title">
+ <string>Invocation Mode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>callPHPDirectly_radio</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Ca&amp;lling the PHP interpreter directly</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;font size="+1"&gt;The php executable is called directly. Ideal for developers who want to develop terminal or graphical applications in PHP.
+You need a correctly installed php cgi version.&lt;/font&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ <property name="vAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>callWebserver_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Using an &amp;existing webserver (local or remote)</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;font size="+1"&gt;Uses an existing webserver. The pages are previewed in
+the internal web browser. Please make sure that the webserver was compiled with PHP support.&lt;/font&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter|AlignLeft</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer18</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>171</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Webserver</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Pro&amp;ject root URL on webserver:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>weburl_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>weburl_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer12</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>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Shell</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1_3_2</cstring>
+ </property>
+ <property name="text">
+ <string>PHP &amp;executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>exe_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>exe_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>exe_button</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>22</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>about_button</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="backgroundMode">
+ <enum>PaletteBackground</enum>
+ </property>
+ <property name="text">
+ <string>PHP &amp;Ini File:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>ini_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>ini_edit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>phpini_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>zend_checkbox</cstring>
+ </property>
+ <property name="text">
+ <string>Load &amp;Zend extension:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>zend_edit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QToolButton">
+ <property name="name">
+ <cstring>zend_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>343</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ </hbox>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="5423">89504e470d0a1a0a0000000d4948445200000078000000400806000000d14db312000014f649444154789ced9d6d881dd779c77f2a13742edcc24c58c34c90e04e59c18e90c077b1a0bb8e215ec7506d2ca8d649c12b8762af1b48e5b6d0bcd158fe90daca9758fdd2a8812676a08ea50f469b82aa75c0ce2a607bafa9c4bd02891d8144e78217664097cc015fb8c778e0f6c399fbb2ba3377df575bd77f58b4ab997b66cef99f97ff799ee73c77dfd2d2125fe0f38b3f79d02ff00576165f10fc3987f1a05f60a358beb9bfdd796b21d2fffcd27d377d2601504affa9921600adcedf0a40adba07004320babf17f4330c281802913eecf0d14ff76d473d760b7b96e00e914280280884808200cfd3ffd74f8c4af4bf2dd5214da05a6ae0bebe4fa4f7a57f264a979148e2a453a682a457b610600941b062b685109a78612184d8d3a4ef1982976fee6f8ba226d32a16281f03ab2806ee6b35557744c64d856c82fa44a19298962aa0540bd5212651b4125611753f046af55f09e80ed0b9d2eb0ca18a8118d1d76a4258042ba22d8a26c2286015cd3d45f8be07a9a297fdfd6dd3d2849ab626d4143d52a5529ac4468bb0a1909f28e286229431aa090a3dca004d625fd9835d631d18dadd7ba56bea5b99d72c211045075134b1f6c008df7582bba49a60db1605419754a914b15484518b7a28095662e2865a3d5d1a2979bb3af7dcdf5dd4aadf7b842b4856af0956d1c4b45d2ce1307e6cdfae13bd2b0477a65fd3123876414fbd2941715311ae684297ef8648d9590f7940646e04fdc4abeebf82982ed97d845ba6adc92eba8c97776754ef28c11d621d4760164114b532958d1641a4f0ef84049142293d4285c1d6c91cb2dec2363d23bff4bedf95fe496244a200d9d50ec22860d91ef688cba313851d257a47085ebeb9bf2d2c7046b4daeca8d92ea92b522b5883558265cb48c0b14dcac7dccccbea13c5d28d0025d52ecd0afd844b50318208a5e2ee0ce5d81eb6edf1e8635fde11a2b795e00eb166110ae956226c48828f157e3d4636f574b5ada4f62381d3cf4d12dc59228c02307a0dac9462eac9698215c1fce51a62532a6c2be83c504122a1194012a33ed36d621ff4700f94b79de86d696abd6755980fa9ae41200c23fc7a4b8fd644576fc7880548c01c3111a2c50ba75f40350737c0ee011765783bf812c3d0791f01860da60d8944347d542ba41ed4a80735829572fbf0e8d4b609b22d37b95e6725a2a0898d4285bf12134629b1db3d0de74001ce8845184599e40a21281f9be4c2e5e0018bb6be77334c3027104589ba570555c7f717a9dfa91144d36daf54def2166bd355ed8c5a0c6d1694b12288f488ed2ae0dd6cc8041c5b107dec675e764b368e691236e2cded91770429d98689e94ca19a11dcabd2523e4b575f27743de2e6a9f65684d8a628a8d6f6b73142045a15072b2d8295540defa84a1d0efb218babd7b309f6c60e133414aac91edc7669cb9928da88e214341c54b884efd7083e0e881a73eda74ffcd9a648deb037a97aaddd6e25210071b345f56e8c7f57f6c87d401006584558aa648b46cff3083b5bb23d89745b85c0b4cb38eed388a2896c442cfcf62cbffae5efdb9b2975439454afb5db2d620062c9ea513b0c6bec4dd78bdc3d6c02c2148822f8b7f3a6688ffac7714af090497ac8d2b22d7d63cda52bb5099836eed139027f917065918577cf13c5617be6f8dc86d6e57513fc61a5d556498c1002d950040dd55d6b8722015114cc3ee95128167ab6e375a295768e288c09ea2141a4d7fcfe4652803b6211ae04482907cad002ab8cc2c173adcc670044f76282ba36912aa5566fa51298faaa8b77c8d9741d946a110412bf1ea29a6af8562dd11dd13d3a8d1016feadb758fae002a80878a9bd5e92d745f08795565b36638480a8a108a3f5afb52a81a9475c94f239f72fe7b1526bd6baf025813d62e2d82ee56393cc1e9fc48f140beff8f877c3de884ec03d6022ef658f5e9528beffc3ef673e5b1404a669e2d80e9e57e6f4b7c75149994beff854ae07bd8e2404b327ca5cb8f806972e5fda503d3acf70473da68e4d32736292cab590c58f02dd9172db514122700f4d0050bbfe3a8b7f5800e0f0d1efafebd96b52d42117404a4528d7f3a9d5700f5a5cba789eabef5dddd807ef837dc066e6c434a79e9963e2d824177e5bedda7a4dcba256c9269884753f5b1405d35f9fe2f9ef7c8f716f92d7df5e4225e09a7ab8bd75f12d2a1f55b6540fef88c7ccc919661e9fa67647e1df0e878c66854a044e4a72e50fe759f8dd3ca6e5b65ffcbba7d71cc5434556f55abb2d65a81de22a2577831042dba17d3fa7f137806825e2df7ef1064f4c3f8192554effcda4de6818e098f9026b23504dc5fc7f2ef0d4f413c48d2a332726514d855b7200f0ef6ebd1efe2d9fb3af9ce5e51f9f62e2287863ce1a1a452f87aef738e53f9f05e0c2c573fce6e2876b0aaf5c82976fee6f878db0eb3cdf0cb92469448610f877834d14900dd5547c73f69bc42b55a6bfe621841658b51bb56d7b06c08bfff8225e09ec1193926be1dfae211b9b69886cf8b7ebbcf8f773940fadf6836743a194c43d3a4df991694093fce1fb7f1c4a72ee641b4a8952ba32a1dabc69c0322d6423208aa2cceba55209cb5c2d7c948a091b520ba6bc9e9dc00f7efc037e73e18adefec830536041c78429063e2f9b32d3ead541b412e1dfaae28d39b8b6c9c23b97b26f34c01bf310fdb6ef44d1522d64a71e39a8dfad33fff639a69e7a8985f7fc75d9c8bdf22c41bd8a6c44cc5f3ec7a38f9dcdbd3793e06a6d7f5b369653f52736ac1a3b500978a326b55a25b30c210497e6af60994e379eaa1f41dd67feedb778e3cd37323fefdff2a9551639757296c577e733efb16d9bea7f2fa112d155cb5d248adab525cebc7286fadd7a661da230c239e8619902ff56f6f4fcf85727b874e10aa1ccea2c0aff5695f3ff9eaf4116de5d64faa9d388a21808181840a2edfde5474e71f577e7a87c54e1ca3bffd3fec6f16c434826c1b10cbb8db1d5fdabed585cbd9e3d3d7b473c44d1e2d57f5decba0fa1e7e4770f389c79f9e778632e3ff8d1cb99652c7db0c8dc77e608ead9d3b377c4239482f3bfce5e9f674e4cf1eacbaff2ec5f3f9b5b07b3584018f93a62f2b129966e49de787b69d54cd1a9c7f81197b7fee30a2ffec3b3ccbf3d3ff079d990d46e54714cafb743190295289c431394ee4e50bf5b61e19d0b7ce3f899cc7b07d6e0e59bfbdba194a844abb74d4637016924e2108135f5d8144a69754ea2b425416941a79a8adaad80d77eb9c8d4f15398a6995946106aabdad2b56ae675ef908b944a478a3457ffc8a662e1dd2ae6434e6ea39aa68935a2475650cfe9a8a31ed1bdd4c7ab06ebb1f05e8db77e5be3f9e74ee7b655abe9774375d70301b8a39300f8b79772d7e20182e3a64435d3b8e26e84e126908030046651b07c7739f3166fcc236c740cee833f4268f29502e7809359866a2ae230ce1558eea847d868653f03700f58a8669cbd0c19603ee4600a81bf92af23cc871ced64c9a80306984541b0126365698114526ecc39a312700e96114513d594d46e644fff03044bd54a0bd8bacfc53205b21912ad64378c7dd0a51ec4c30be9543a69655eb64c8b200ab2c592019e378eef47b9264ed775f0fdecce619a26ce884d4108fcda907b6c9bb0d11a3ad715d622cf101b5c0ef55aec8da5a3f84ef62c393882a5ec7bd0e6495689dedff9b55aa6815f14058e6db3dcb1486521d1424c0808f23a896313d483cc67d823366ec9cb77111a6099f9f6ebf2c36554524008a8dec871628c7928554049993bcd2bc0342de228cc757698238326d4f5c01cd1010c71237bf91820783bbd2db663e5369e37eaa192825e7f87348c6b6b1b73de76c61b73893ece26df1b73f53ad827e0fad133c26437cee4c4240a315c604d4c1237d710a309b8ae493da8675f3774b449dc6c6dc84aa880c29fa681168d30f39e4143c75a327d9de8b8ef8220bb612626cac4728d0e9580e739d4aee55ba8bca3932c7db4987dcdf3f4c987ac6724bdb34d79e2c93de076efc933d47863a9c01a026180572ab0f0ce42e6f5d28112aeebe95960c348c5670e6f3b73ba30e98c0e41f556b6c03a3c368e6c66afaba085a86d9b782578fdd7af67dee31df1987cb8cce2fbd91dc02db93d81757ff9806b3b0477abd98608436b04530882153f5760d907dda15b1ba5a0fcb08b6a862cbc974df0f8b1718270d37276280609de26a7bd280e175825b74410a40d9bf47eb45b0d4c5370fab9492e5c7c9d7abd9e59c6ec33b3a8441245d93ddf3b3a897f6788c03a64e2dfcc9e61cc624f60d5aed5b20d35a98e08a238b71edea8c3a99365cefef46cae529ffefa0c7e7d8ba14446f6a707aa2e0c812266ab02ebf0a843e0fbf902eb80cbd55a84288adee90543e08e14f00ed94c3eec70e9edf39c7d25db0ce78d9538f3e3335cb97c25737a32474cdc92cbfcbbd5dc9a38230516739c07e587bdaec0cad511631e5000a57ab66443cf5eee010bef90c3e192e0cc8f5e60e177d9a377e6e40c143da4f4371cc32680d6277a0099c56c3bc1409156d1a4e31edc0a4a072d2a57b3b716f6888d655acc9e2c40e2ae7a1325437cbfc2d37f759edaf51ce78101affcf36b00b95b1c6fd4ebda1c72059600ff4ef6da3a5eee09aceacd6c234af96819f780cde9e7c657bd1b498b308af06b6ff1e277f267a0d26889d967bec7c2d5609387e5840ea207ac916c3bc1e0082e5a40a04785b1c95521155879c2a4be52677cfcf0c0d395ea1d6319869f9d7d056774922bef06f8b773c4cf2117a9188ccc8034caa4e3e5ca0bf1e909ac20a71e172e5e60fef2a0e95135d78efd1242f0da4f5fa376471fbadb4c04aa528ae0b61698ee81ec78efcc112c843e67ab2701938d2eff1df75dae0f3861a887251706bcf29357983a3ec7f937abcc7deb30954ab6f37d9505eb3e74b65f41ddcf75ffd9076d4c21081b51aec0ea76c80dc2b66d5efdc96b449fb8f8b7d7e7411a802190514014d5c180f2b1a9ccdb0644d678f9d37d8e69039d73b01bac40a24d7324addcedc766501a2df15ff3ffc5d4f139cefd62290da8cf7f8677d423b893637c48c03b64e3dfcc56dfa228700f78a9c05ada56dbc0e35f9be0576f5c214e5c163fd824b9e8a11706da3ce98d4db0216f9233e21036027d1aced8d8285668fbae7fb336d4d7ba2e18503e5266e65b339c7a668ea51b316ffc62318dc17208ead922ce1c317147c759a8ac21b02ee7ef6d3b026b3b8208445130f1489953cfcce17a532cbcbb4cb022377f3eca10445140ed869e9e271e9bc9bf35eb3fc78feddb1736dc76d808d0e7e83ba1a6eb202cb5efd62ad9aad1344da69e9cca5d734cd3c4322d1d68572e63da2e415df1da2fab44916e1495683bb71016337f39dd3d36031d13a95e8ff282dc85a10fc87963eee0e75b8a9993b3c40a5cf2455869b4c4d4c4a43e9c3e50be4014059669e1963cbc7219128ba55ac8e29b4bba3537bd49d11f5caecd43a2f08e4cf0c2b71fcd8dcdca5dda1ddbd59e25d5d932adf38dd2f8a8f91cf1327d7c8ad7cefd06ff6ef6ba063a1b4e742f66feaa246c2ce91053a3d728c280eaad80a79f1ce7f40f7f3e20ca84018bef87a8245bbc2860b11232fed829c6274e0dbc3f0afc2066f288cdf2ed6c057dfabba7993e3e4794b386b79476dc841f4b5e7f3b444abf17c2945bf3b52184c0afcd53bf5b0143307d626ee8fdb9048f973fdd1737dd76508f11c4e9d85d7baaee09acec9e5f7e6482c5eb01172e567404c3fde823ab13163bd0db0d900dc5f9379772d7d86101e6c280ca8d80caf5ec8368aaa9987daa8c5251aea106c3e2dcaf97b448bbbf8cfe0e67f49dacdca21149089368c5a7f2c10500a69f7a9ea74f1c1e1a5939f4914f3c56d877a5994ed5499caec743a6ea34c81df2a30fdd832ed13dedeaca2460bd8d30ec84c03aca18dae042e07a0e4b1f650b2c1d7c60e707afefc0111e610864a3cee23b67bb53f3ccf139e0d3a19f5bd316fd8de35fd967998e9e2209a1bb1e0fa2bbfdb85dcd3dc2e9945c2d30f6dc01b01e8400d74e63c932608e98148a56e6fabb23ef6308a48c58b8fc2aaa2929953c9e7feed5751d615997b3c12b7958a6b6946892259924a7de9f5c07fa888910167163eb96b21d43c7076d0c71231e1bef66cddb6908611245010bbf3d839211a592c7dc777fb6eedc1eeb1a47baa7786dbfae03f256afc9b02a4f94996ff9999c9844cacd5b6e76039d734e30cc065d463677fa4d74270bfcab5cfdc37950aa4bee131b48f3b0ee66ee901cac08c246d04d15a430e9accba2a8edbbb51c0f4df9e1327193f51d5a7b5048c02b992815e51a5184e910463b77905c1802a514b56b17a85dd7db4defc804cf3ff7ea86b3f26ca8990f1ffd74dfe1a35fe1f757453b58f1811682160a0b9234a34e5130f7dc1cb10cb93fadd0f4f169162bd991077b09a6251086c94bfff4d2c03551145845975a23dcfe4e9a26438da280eafbe7b5191298fe8be79939797a53e91c369d65e7c34aab1dac045d6f06145089895b72f03c3be3e541de532ce59cc0df33487702e3475c4c2b7b8cd66a0161941f83b571e86cb652460437e7bba3d61cb1997de67b3cfb4cbe21632d6c298dd2f2cdfded200a74caa2142ab1864664ee7efaa24d60d792a9e9594f2945706791daf5f96ec872f9916966bff5b75b4eabb42d79b23eacb4da511410f7f9911516ab2d607b3575c283409aca5129c28f6bf8372e75a7e352c963fac4f35b1ab5fdd8d64468bf7fff8fed70c55fd5fbbf20ba0f9db09a4411063582db0b44517a085c08664e9e66f2abb3db9ac772db5319566bfbdbb10c091b51dffa0c50407589feff42762fe92a89423642e27b3eb2e11346da13668fb81c7ef8712626a637b4fd592f762c19e9f24d4d74d488564ddd1a5964c3ff7dc27b7159803e38df94c4f70264c32796cbdd88156bc465e2d834e38f4cef68e6d95d4927fc61a5d596322696418678e9271b062d647b99f4be7735e8a60f963286cf02e2868f52fa0c722b6961152d1cbb8c579ec22b79bb92287c5713827747b594b49a618e525d8bf00e768bf861b25f75d35b2815c22721ad449fc2e82431174260991ea5431e874727773d29f8034be95faded6fb79a21b229899b2a5daffb49eb34ac3e52a90608dfcdfd56fa5e492707740b54846cb52089f47743a47a432502ab68615a2e8e6de396769fd47e3cd0ef6ce860f9e6feb6528ab819239b125448abf34d2899c823fffeebeb415fa7ea3f2edb39cda8527f709212f899ea799112a5ad4f86c0b49c34a3bb875574762da3fb5ad81304df8f0ee12da50957890215f748df0e37dd7d65a8fee3a95d02d36b694e67f1250142870a092128145dec11878230f70ca1f7634f9afcb5f8d8077c39fd49494fa0a5746a7cad4655977c80d67ddf91001916a99cce213aa7eb8d3410c110140c01c24a63ac867d8bca70a7fb83c49e24380bbd462dd0999a1f0cf62e9959f8e2bb0b3fe7f882e0cf39fe17a14b594f9ff48c020000000049454e44ae426082</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>about_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PHPConfigWidgetBase</receiver>
+ <slot>slotAboutClicked()</slot>
+ </connection>
+ <connection>
+ <sender>exe_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PHPConfigWidgetBase</receiver>
+ <slot>slotPHPExeButtonClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>TabWidget1</tabstop>
+ <tabstop>useCurrentFile_radio</tabstop>
+ <tabstop>useDefaultFile_edit</tabstop>
+ <tabstop>codeCompletion_checkbox</tabstop>
+ <tabstop>codeHinting_checkbox</tabstop>
+ <tabstop>include_path_edit</tabstop>
+ <tabstop>realtimeParsing_checkbox</tabstop>
+ <tabstop>callPHPDirectly_radio</tabstop>
+ <tabstop>callWebserver_radio</tabstop>
+ <tabstop>weburl_edit</tabstop>
+ <tabstop>exe_edit</tabstop>
+ <tabstop>exe_button</tabstop>
+ <tabstop>ini_edit</tabstop>
+ <tabstop>phpini_button</tabstop>
+ <tabstop>zend_checkbox</tabstop>
+ <tabstop>zend_edit</tabstop>
+ <tabstop>zend_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>slotAboutClicked()</slot>
+ <slot>slotPHPExeButtonClicked()</slot>
+ <slot>slotPHPIniButtonClicked()</slot>
+ <slot>slotZendButtonClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/php/phperrorview.cpp b/languages/php/phperrorview.cpp
new file mode 100644
index 00000000..011e8b77
--- /dev/null
+++ b/languages/php/phperrorview.cpp
@@ -0,0 +1,422 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include "phperrorview.h"
+#include "phpsupportpart.h"
+
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+
+#include <kdeversion.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/markinterface.h>
+
+#include <ktexteditor/markinterfaceextension.h>
+#include <ktexteditor/view.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kdialogbase.h>
+
+#include <kconfig.h>
+
+#include <qtimer.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qfileinfo.h>
+#include <qwhatsthis.h>
+#include <qtabbar.h>
+#include <qwidgetstack.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+
+class ProblemItem: public KListViewItem
+{
+public:
+ ProblemItem( QListView* parent, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, problem, file, line, column ) {}
+
+ ProblemItem( QListViewItem* parent, const QString& problem,
+ const QString& file, const QString& line, const QString& column )
+ : KListViewItem( parent, problem, file, line, column ) {}
+
+ int compare( QListViewItem* item, int column, bool ascending ) const {
+ if( column == 2 || column == 3 ){
+ int a = text( column ).toInt();
+ int b = item->text( column ).toInt();
+ if( a == b )
+ return 0;
+ return( a > b ? 1 : -1 );
+ }
+ return KListViewItem::compare( item, column, ascending );
+ }
+
+};
+
+PHPErrorView::PHPErrorView( PHPSupportPart* part, QWidget* parent, const char* name )
+ : QWidget( parent, name ? name : "problemreporter" ),
+ m_phpSupport( part ),
+ m_document( 0 ),
+ m_markIface( 0 )
+{
+ QWhatsThis::add(this, i18n("<b>Problem reporter</b><p>This window shows various \"problems\" in your project. "
+ "It displays TODO entries, FIXME's and errors reported by a language parser. "
+ "To add a TODO or FIXME entry, just type<br>"
+ "<tt>//@todo my todo</tt><br>"
+ "<tt>//TODO: my todo</tt><br>"
+ "<tt>//FIXME fix this</tt>"));
+
+ m_gridLayout = new QGridLayout(this,2,3);
+
+ m_errorList = new KListView(this);
+ m_fixmeList = new KListView(this);
+ m_todoList = new KListView(this);
+ m_filteredList = new KListView(this);
+ m_currentList = new KListView(this);
+
+ m_filteredList->addColumn( i18n("Level") );
+ m_currentList->addColumn( i18n("Level") );
+
+ //addColumn( i18n("Level") );
+ InitListView(m_errorList);
+ InitListView(m_fixmeList);
+ InitListView(m_todoList);
+ InitListView(m_filteredList);
+ InitListView(m_currentList);
+ m_currentList->removeColumn(1);
+
+ m_widgetStack = new QWidgetStack(this);
+ m_widgetStack->addWidget(m_currentList,0);
+ m_widgetStack->addWidget(m_errorList,1);
+ m_widgetStack->addWidget(m_fixmeList,2);
+ m_widgetStack->addWidget(m_todoList,3);
+ m_widgetStack->addWidget(m_filteredList,4);
+
+ m_tabBar = new QTabBar(this);
+ m_tabBar->insertTab(new QTab(i18n("Current")),0);
+ m_tabBar->insertTab(new QTab(i18n("Errors")),1);
+ m_tabBar->insertTab(new QTab(i18n("Fixme")),2);
+ m_tabBar->insertTab(new QTab(i18n("Todo")),3);
+ m_tabBar->insertTab(new QTab(i18n("Filtered")),4);
+ m_tabBar->setTabEnabled(0,false);
+ m_tabBar->setTabEnabled(4,false);
+
+ m_tabBar->setCurrentTab(0);
+
+ m_filterEdit = new KLineEdit(this);
+
+ QLabel* m_filterLabel = new QLabel(i18n("Lookup:"),this);
+
+ m_gridLayout->addWidget(m_tabBar,0,0);
+ m_gridLayout->addMultiCellWidget(m_widgetStack,1,1,0,2);
+ m_gridLayout->addWidget(m_filterLabel,0,1,Qt::AlignRight);
+ m_gridLayout->addWidget(m_filterEdit,0,2,Qt::AlignLeft);
+
+ connect( m_filterEdit, SIGNAL(returnPressed()), this, SLOT(slotFilter()) );
+ connect( m_filterEdit, SIGNAL(textChanged( const QString & )), this, SLOT(slotFilter()) );
+ connect( m_tabBar, SIGNAL(selected(int)), this, SLOT(slotTabSelected(int)) );
+ connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partAdded(KParts::Part*)), this, SLOT(slotPartAdded(KParts::Part*)) );
+ connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)), this, SLOT(slotPartRemoved(KParts::Part*)) );
+
+ slotActivePartChanged( part->partController()->activePart() );
+}
+
+void PHPErrorView::slotFilter()
+{
+ if(!m_tabBar->isTabEnabled(4))
+ m_tabBar->setTabEnabled(4,true);
+
+ m_tabBar->tab(4)->setText(i18n("Filtered: %1").arg( m_filterEdit->text() ));
+ m_tabBar->setCurrentTab(4);
+
+ m_filteredList->clear();
+
+ filterList(m_errorList,i18n("Error"));
+ filterList(m_fixmeList,i18n("Fixme"));
+ filterList(m_todoList,i18n("Todo"));
+
+}
+
+void PHPErrorView::filterList(KListView* listview, const QString& level)
+{
+ QListViewItemIterator it( listview );
+ while ( it.current() ) {
+ if ( it.current()->text(3).contains(m_filterEdit->text(),false))
+ new KListViewItem(m_filteredList,level,
+ it.current()->text(0),it.current()->text(1),it.current()->text(2),it.current()->text(3));
+ ++it;
+ }
+}
+
+void PHPErrorView::slotTabSelected( int tabindex )
+{
+ m_widgetStack->raiseWidget(tabindex);
+}
+
+void PHPErrorView::InitListView(KListView* listview)
+{
+ listview->addColumn( i18n("File") );
+ listview->addColumn( i18n("Line") );
+ listview->addColumn( i18n("Column") );
+ listview->addColumn( i18n("Problem") );
+ listview->setAllColumnsShowFocus( TRUE );
+
+ connect( listview, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem*)) );
+
+ connect( listview, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotSelected(QListViewItem* )) );
+
+}
+
+PHPErrorView::~PHPErrorView()
+{
+}
+
+void PHPErrorView::slotActivePartChanged( KParts::Part* part )
+{
+ if ( !part ) {
+ m_tabBar->setTabEnabled(0,false);
+ return;
+ }
+
+ if ( m_document )
+ disconnect( m_document, 0, this, 0 );
+
+ m_document = dynamic_cast<KTextEditor::Document*>( part );
+ m_markIface = 0;
+
+ if ( !m_document ) {
+ m_tabBar->setTabEnabled(0,false);
+ return;
+ }
+
+ m_fileName = m_document->url().path();
+
+ initCurrentList();
+
+ m_markIface = dynamic_cast<KTextEditor::MarkInterface*>( part );
+}
+
+void PHPErrorView::removeAllItems( QListView* listview, const QString& filename )
+{
+ QListViewItem* current = listview->firstChild();
+ while( current ){
+ QListViewItem* i = current;
+ current = current->nextSibling();
+
+ if( i->text(0) == filename )
+ delete( i );
+ }
+}
+
+void PHPErrorView::removeAllProblems( const QString& filename )
+{
+ QString relFileName = filename;
+ relFileName.remove(m_phpSupport->project()->projectDirectory());
+
+ kdDebug(9008) << "PHPErrorView::removeAllProblems()" << relFileName << endl;
+
+ if (filename == m_fileName)
+ m_currentList->clear();
+
+ removeAllItems(m_errorList,relFileName);
+ removeAllItems(m_fixmeList,relFileName);
+ removeAllItems(m_todoList,relFileName);
+
+ if ( m_document && m_markIface ) {
+ QPtrList<KTextEditor::Mark> marks = m_markIface->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while( it.current() ) {
+ m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 );
+ ++it;
+ }
+ }
+}
+
+void PHPErrorView::initCurrentList()
+{
+ m_tabBar->setTabEnabled(0,true);
+
+ QString relFileName = m_fileName;
+
+ if (m_phpSupport->project())
+ relFileName.remove(m_phpSupport->project()->projectDirectory());
+
+ m_currentList->clear();
+
+ updateCurrentWith(m_errorList, i18n("Error"),relFileName);
+ updateCurrentWith(m_fixmeList,i18n("Fixme"),relFileName);
+ updateCurrentWith(m_todoList,i18n("Todo"),relFileName);
+}
+
+void PHPErrorView::updateCurrentWith(QListView* listview, const QString& level, const QString& filename)
+{
+ QListViewItemIterator it(listview);
+ while ( it.current() ) {
+ if ( it.current()->text(0) == filename)
+ new QListViewItem(m_currentList,level,it.current()->text(1),it.current()->text(2),it.current()->text(3));
+ ++it;
+ }
+}
+
+void PHPErrorView::slotSelected( QListViewItem* item )
+{
+ bool is_filtered = false;
+ bool is_current = false;
+
+ if (item->listView() == m_filteredList)
+ is_filtered = true;
+ else if(item->listView() == m_currentList)
+ is_current = true;
+
+ KURL url( is_current ? m_fileName : item->text(0 + is_filtered) );
+ int line = item->text( 1 + is_filtered).toInt();
+ m_phpSupport->partController()->editDocument( url, line-1 );
+}
+
+void PHPErrorView::reportProblem( int level, const QString& fileName, int line, const QString& text)
+{
+ int markType = levelToMarkType( level );
+ if ( markType != -1 && m_document && m_markIface && m_fileName == fileName ) {
+ m_markIface->addMark( line, markType );
+ }
+
+ QString msg = text;
+ msg = msg.replace( QRegExp("\n"), "" );
+
+ QString relFileName = fileName;
+ relFileName.remove(m_phpSupport->project()->projectDirectory());
+
+ KListView* list;
+ switch( level )
+ {
+ case Error:
+ case ErrorNoSuchFunction:
+ case ErrorParse:
+ list = m_errorList;
+ m_tabBar->setCurrentTab(m_tabBar->tab(1));
+ break;
+
+ case Warning:
+ list = m_errorList;
+ break;
+
+ case Todo:
+ list = m_todoList;
+ break;
+
+ case Fixme:
+ list = m_fixmeList;
+ break;
+
+ default:
+ list = NULL;
+ break;
+ }
+
+ if (list) {
+ kdDebug(9018) << "PB " << msg << endl;
+ new ProblemItem( list, relFileName, QString::number( line + 1 ), 0, msg );
+ }
+
+ if (fileName == m_fileName)
+ new QListViewItem(m_currentList, levelToString( level ), QString::number( line + 1 ), 0, msg);
+}
+
+void PHPErrorView::slotPartAdded( KParts::Part* part )
+{
+ KTextEditor::MarkInterfaceExtension* iface = dynamic_cast<KTextEditor::MarkInterfaceExtension*>( part );
+
+ if ( !iface )
+ return;
+
+ iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") );
+}
+
+void PHPErrorView::slotPartRemoved( KParts::Part* part )
+{
+ kdDebug(9007) << "PHPErrorView::slotPartRemoved()" << endl;
+ if ( part == m_document ){
+ m_document = 0;
+ }
+}
+
+QString PHPErrorView::levelToString( int level ) const
+{
+ switch( level )
+ {
+ case ErrorNoSuchFunction:
+ return QString( i18n("Undefined function") );
+
+ case ErrorParse:
+ return QString( i18n("Parse Error") );
+
+ case Error:
+ return QString( i18n("Error") );
+
+ case Warning:
+ return QString( i18n("Warning") );
+
+ case Todo:
+ return QString( i18n("Todo") );
+
+ case Fixme:
+ return QString( i18n("Fixme") );
+
+ default:
+ return QString::null;
+ }
+
+}
+
+int PHPErrorView::levelToMarkType( int level ) const
+{
+ switch( level )
+ {
+ case ErrorNoSuchFunction:
+ case ErrorParse:
+ case Error:
+ return KTextEditor::MarkInterface::markType07;
+
+ case Warning:
+ return -1;
+
+ case Todo:
+ return -1;
+
+ case Fixme:
+ return -1;
+
+ default:
+ return -1;
+ }
+
+}
+
+#include "phperrorview.moc"
diff --git a/languages/php/phperrorview.h b/languages/php/phperrorview.h
new file mode 100644
index 00000000..bc8b0df5
--- /dev/null
+++ b/languages/php/phperrorview.h
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2002 by Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef PHPERRORVIEW_H
+#define PHPERRORVIEW_H
+
+#include <klistview.h>
+#include <klineedit.h>
+#include <qguardedptr.h>
+#include "phpfile.h"
+
+class PHPSupportPart;
+class QTimer;
+class QTabBar;
+class QWidgetStack;
+class QGridLayout;
+class KDialogBase;
+class Problem;
+class KURL;
+
+namespace KParts{
+ class Part;
+}
+
+namespace KTextEditor{
+ class MarkInterface;
+ class Document;
+}
+
+
+enum Errors
+{
+ Error = 0,
+ ErrorParse = 1,
+ ErrorNoSuchFunction = 2,
+ Warning = 3,
+ Todo = 4,
+ Fixme = 5
+};
+
+class PHPErrorView: public QWidget {
+Q_OBJECT
+public:
+ PHPErrorView( PHPSupportPart* part, QWidget* parent=0, const char* name=0 );
+ virtual ~PHPErrorView();
+
+ void removeAllProblems( const QString& filename );
+ void reportProblem( int level, const QString& fileName, int line, const QString& text);
+
+private slots:
+ void slotPartAdded( KParts::Part* );
+ void slotPartRemoved( KParts::Part* );
+ void slotActivePartChanged( KParts::Part* );
+ void slotSelected( QListViewItem* );
+ void slotTabSelected( int tabindex );
+ void slotFilter();
+
+private:
+ QString levelToString( int level ) const;
+ int levelToMarkType( int level ) const;
+ void InitListView(KListView* listview);
+ void removeAllItems( QListView* listview, const QString& filename );
+ void filterList(KListView* listview, const QString& level);
+ void updateCurrentWith(QListView* listview, const QString& level, const QString& filename);
+ void initCurrentList();
+
+private:
+ QGridLayout* m_gridLayout;
+ QTabBar* m_tabBar;
+ QWidgetStack* m_widgetStack;
+ KListView* m_currentList;
+ KListView* m_errorList;
+ KListView* m_fixmeList;
+ KListView* m_warningList;
+ KListView* m_todoList;
+ KListView* m_filteredList;
+ KLineEdit* m_filterEdit;
+
+ PHPSupportPart* m_phpSupport;
+ QGuardedPtr<KTextEditor::Document> m_document;
+ KTextEditor::MarkInterface* m_markIface;
+ QTimer* m_timer;
+ QString m_fileName;
+ int m_active;
+ int m_delay;
+};
+
+#endif
diff --git a/languages/php/phpfile.cpp b/languages/php/phpfile.cpp
new file mode 100644
index 00000000..afd741bd
--- /dev/null
+++ b/languages/php/phpfile.cpp
@@ -0,0 +1,639 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include <kapplication.h>
+#include <qstring.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+
+#include <urlutil.h>
+#include <kprocess.h>
+#include <kdebug.h>
+
+#include <kdevpartcontroller.h>
+
+#include "phphtmlview.h"
+#include "phperrorview.h"
+
+#include "phpfile.h"
+
+using namespace std;
+
+PHPFile::PHPFile(PHPSupportPart *phpSupport, const QString& fileName)
+{
+ m_fileinfo = new QFileInfo(fileName);
+ m_part = phpSupport;
+ modified = true;
+ inClass = FALSE;
+ inMethod = FALSE;
+
+ /*
+ phpCheckProc = new KShellProcess("/bin/sh");
+ connect(phpCheckProc, SIGNAL(receivedStdout (KProcess*, char*, int)), this, SLOT(slotReceivedPHPCheckStdout (KProcess*, char*, int)));
+ connect(phpCheckProc, SIGNAL(receivedStderr (KProcess*, char*, int)), this, SLOT(slotReceivedPHPCheckStderr (KProcess*, char*, int)));
+ connect(phpCheckProc, SIGNAL(processExited(KProcess*)), this, SLOT(slotPHPCheckExited(KProcess*)));
+ */
+}
+
+PHPFile::~PHPFile()
+{
+ if (m_fileinfo)
+ delete m_fileinfo;
+
+// delete phpCheckProc;
+}
+
+QStringList PHPFile::getContents()
+{
+ return m_contents;
+}
+
+QString PHPFile::fileName() {
+ return m_fileinfo->filePath();
+}
+
+QStringList PHPFile::readFromEditor()
+{
+ QStringList contents;
+
+ kapp->lock();
+ QPtrList<KParts::Part> parts( *m_part->partController()->parts() );
+ QPtrListIterator<KParts::Part> it( parts );
+ while( it.current() ){
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( it.current() );
+ ++it;
+
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if ( !doc || !editIface || doc->url().path() != fileName() )
+ continue;
+
+ contents = QStringList::split("\n", editIface->text().ascii(), true);
+ break;
+ }
+ kapp->unlock();
+
+ return contents;
+}
+
+QStringList PHPFile::readFromDisk()
+{
+ QStringList contents;
+ QFile f( fileName() );
+
+ if (f.open(IO_ReadOnly)) {
+ QTextStream stream( &f );
+ QStringList list;
+ QString rawline;
+ while (!stream.eof()) {
+ rawline = stream.readLine();
+ contents.append(rawline.stripWhiteSpace().local8Bit());
+ }
+ f.close();
+ }
+ return contents;
+}
+
+bool PHPFile::isModified() {
+ return modified;
+}
+
+void PHPFile::setModified(bool value) {
+ modified = value;
+}
+
+void PHPFile::Analyse() {
+
+ postEvent( new FileParseEvent( Event_StartParse, this->fileName() ) );
+
+ inClass = FALSE;
+ inMethod = FALSE;
+/*
+ m_contents = readFromEditor();
+
+ if (m_contents.isEmpty())
+*/
+ m_contents = readFromDisk();
+
+ ParseSource();
+
+ PHPCheck();
+ modified = false;
+
+ postEvent( new FileParseEvent( Event_EndParse, this->fileName() ) );
+}
+
+bool PHPFile::ParseClass(QString line, int lineNo) {
+ if (line.find("class ", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp Class("^[ \t]*(abstract|final|)[ \t]*class[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*(extends[ \t]*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))?.*$");
+ Class.setCaseSensitive(FALSE);
+
+ if (Class.search(line) != -1) {
+ if (AddClass(Class.cap(2), Class.cap(4), lineNo) == FALSE)
+ return FALSE;
+
+/// @fixme Activate when it exists in ClassModel
+// if (Class.cap(1).lower() == "abstract")
+// SetClass("abstract");
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseFunction(QString line, int lineNo) {
+ if (line.find("function", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp function("^[ \t]*(final|abstract|static|)[ \t]*(public|private|protected|)[ \t]*(static|)[ \t]*function[ \t&]*([_a-zA-Z\x7f-\xff][_a-zA-Z0-9\x7f-\xff]*)[ \t]*\\(([_a-zA-Z\x7f-\xff]*[_$, &'\\\"0-9A-Za-z\x7f-\xff\t-=]*)\\).*$");
+ function.setCaseSensitive(FALSE);
+
+ if (function.search(line) != -1) {
+ if (AddFunction(function.cap(4), function.cap(5), lineNo) == FALSE)
+ return FALSE;
+
+ if (function.cap(3).lower() == "static" || function.cap(1).lower() == "static")
+ SetFunction("static");
+
+ if (function.cap(1).lower() == "abstract") {
+ SetFunction("abstract");
+ CloseFunction( lineNo );
+ return FALSE;
+ }
+
+/// @fixme Activate when it exists in FunctionModel
+// if (function.cap(1).lower() == "final")
+// SetFunction("final");
+
+ if (function.cap(2).lower() == "private")
+ SetFunction("private");
+
+ if (function.cap(2).lower() == "public" || function.cap(2).isEmpty())
+ SetFunction("public");
+
+ if (function.cap(2).lower() == "protected")
+ SetFunction("protected");
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseVariable(QString line, int lineNo) {
+ if (line.find("var") == -1 && line.find("public") == -1 && line.find("private") == -1 && line.find("protected") == -1)
+ return FALSE;
+
+ QRegExp variable("^[ \t]*(var|public|private|protected|static)[ \t]*\\$([a-zA-Z_\x7f-\xff][0-9A-Za-z_\x7f-\xff]*)[ \t;=].*$");
+ variable.setCaseSensitive(FALSE);
+
+ if (variable.search(line) != -1) {
+ if (AddVariable(variable.cap(2), "", lineNo) == FALSE)
+ return FALSE;
+
+ if (variable.cap(1).lower() == "private")
+ SetVariable( "private" );
+
+ if (variable.cap(1).lower() == "public" || variable.cap(1).lower() == "var")
+ SetVariable( "public" );
+
+ if (variable.cap(1).lower() == "protected")
+ SetVariable( "protected" );
+
+ if (variable.cap(1).lower() == "static")
+ SetVariable( "static" );
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseThisMember(QString line, int lineNo) {
+ if (line.find("$this->", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp createthis;
+ createthis.setCaseSensitive(FALSE);
+
+ createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*([0-9]*)[ \t]*;");
+ if (createthis.search(line) != -1) {
+ if (AddVariable(createthis.cap(1), "integer", lineNo, TRUE) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+
+ if (line.find("true", 0, FALSE) != -1 || line.find("false", 0, FALSE) != -1) {
+ createthis.setPattern("\\$(this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*(true|false)[ \t]*;");
+ if (createthis.search(line) != -1) {
+ if (AddVariable(createthis.cap(1), "boolean", lineNo, TRUE) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ if (line.find("new", 0, FALSE) != -1) {
+ createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)");
+ if (createthis.search(line) != -1) {
+ if (AddVariable(createthis.cap(1), createthis.cap(2), lineNo, TRUE) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ if (line.find("array", 0, FALSE) != -1) {
+ createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*(new|)[ \t&]*(array)[ \t]*[\\(;]+");
+ if (createthis.search(line) != -1) {
+ if (AddVariable(createthis.cap(1), "array", lineNo, TRUE) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseMember(QString line, int lineNo) {
+ if (line.find("$", 0, FALSE) == -1)
+ return FALSE;
+
+ /// @todo Ajouter plus de test ....
+
+ QRegExp createmember;
+ createmember.setCaseSensitive(FALSE);
+
+ createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*([0-9]*)[ \t]*;");
+ if (createmember.search(line) != -1) {
+ if (AddVariable(createmember.cap(1), "integer", lineNo) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+
+ createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*[\"']+(.*)[\"']+[ \t]*;");
+ if (createmember.search(line) != -1) {
+ if (AddVariable(createmember.cap(1), "string", lineNo) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+
+ if (line.find("true", 0, FALSE) != -1 || line.find("false", 0, FALSE) != -1) {
+ createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*(true|false)[ \t]*;");
+ if (createmember.search(line) != -1) {
+ if (AddVariable(createmember.cap(1), "boolean", lineNo) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ if (line.find("new", 0, FALSE) != -1) {
+ createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)");
+ if (createmember.search(line) != -1) {
+ if (AddVariable(createmember.cap(1), createmember.cap(2), lineNo) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ if (line.find("array", 0, FALSE) != -1) {
+ createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*(new|)[ \t&]*(array)[ \t]*[\\(;]+");
+ if (createmember.search(line) != -1) {
+ if (AddVariable(createmember.cap(1), "array", lineNo) == FALSE)
+ return FALSE;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseReturn(QString line, int lineNo) {
+ QString rettype;
+
+ if (line.find("return", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp typeex;
+ typeex.setCaseSensitive(FALSE);
+ typeex.setPattern("return[ \t]*(\\(|)([a-zA-Z_\x7f-\xff$][a-zA-Z0-9_\x7f-\xff]*)(\\)|)[ \t]*;");
+
+ if (typeex.search(line) != -1) {
+ QString varname = typeex.cap(2).ascii();
+ rettype = varname;
+
+ if (varname.find("$") == 0) {
+ /// @todo search in variable
+ /*
+ varname = varname.mid(1);
+
+ QValueList<Action *>::ConstIterator it = m_vars.begin();
+ while ( it != m_vars.end() ) {
+ Action *p = *it++;
+
+ if (p->parent() == current && p->name() == varname) {
+ rettype = p->args();
+ }
+ }
+ */
+ } else if (varname == "true" || varname == "false") {
+ rettype = "boolean";
+ } else if (varname == "null") {
+ rettype = "null";
+ }
+
+ if (rettype.find("$") == 0)
+ kdDebug(9018) << "ParseReturn value" << " " << rettype.latin1() << endl;
+ }
+
+ SetFunction("result", rettype);
+ return TRUE;
+}
+
+bool PHPFile::ParseTodo(QString line, int lineNo) {
+ if (line.find("todo", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp todo("/[/]+[ \t]*[@]*todo([ \t]*:[ \t]*|[ \t]*)[ \t]*(.*)$");
+ todo.setCaseSensitive(FALSE);
+
+ if (todo.search(line) != -1) {
+ AddTodo( todo.cap(2), lineNo );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool PHPFile::ParseFixme(QString line, int lineNo) {
+ if (line.find("fixme", 0, FALSE) == -1)
+ return FALSE;
+
+ QRegExp fixme("/[/]+[ \t]*[@]*fixme([ \t]*:[ \t]*|[ \t]*)[ \t]*(.*)$");
+ fixme.setCaseSensitive(FALSE);
+
+ if (fixme.search(line) != -1) {
+ AddFixme( fixme.cap(2), lineNo );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void PHPFile::ParseSource() {
+ QString line;
+ int lineNo = 0;
+ int bracketOpen = 0;
+ int bracketClose = 0;
+ int bracketFuncOpen = 0;
+ int bracketFuncClose = 0;
+
+ QRegExp includere("^[ \t]*(include|require|include_once|require_once)[ \t]*(\\(|)[ \t]*[\"'](.*)[\"'][ \t]*(\\)|)[ \t]*;$");
+
+ includere.setCaseSensitive(FALSE);
+
+ for ( QStringList::Iterator it = m_contents.begin(); it != m_contents.end(); ++it ) {
+ line = (*it).local8Bit();
+
+ if (!line.isNull()) {
+ if (line.find("include", 0, FALSE) != -1 || line.find("require", 0, FALSE) != -1) {
+ if (includere.search(line) != -1) {
+ QStringList include_path;
+ include_path = include_path.split(":", m_part->getIncludePath());
+ include_path.append(URLUtil::directory(fileName()) + "/");
+ include_path.append("");
+
+ QStringList list = includere.capturedTexts();
+
+ for ( QStringList::Iterator it = include_path.begin(); it != include_path.end(); ++it ) {
+ QString abso = URLUtil::canonicalPath(*it + "/" + list[3]);
+ if (!abso.isNull()) {
+ QString rel = URLUtil::relativePathToFile (m_part->project()->projectDirectory(), abso);
+ postEvent( new FileParseEvent( Event_AddFile, abso ) );
+ }
+ }
+ }
+ }
+
+
+ if ( inMethod == TRUE ) {
+ bracketFuncOpen += line.contains("{");
+ bracketFuncClose += line.contains("}");
+ if (bracketFuncOpen == bracketFuncClose && bracketFuncOpen != 0 && bracketFuncClose != 0) {
+ CloseFunction( lineNo );
+ }
+ }
+
+ if ( inMethod == FALSE ) {
+ bracketOpen += line.contains("{");
+ bracketClose += line.contains("}");
+ if (bracketOpen == bracketClose && bracketOpen != 0 && bracketClose != 0 && inClass == TRUE) {
+ CloseClass( lineNo );
+ }
+ }
+
+ if ( inClass == FALSE ) {
+ if (ParseClass(line, lineNo) == TRUE) {
+ bracketOpen = line.contains("{");
+ bracketClose = line.contains("}");
+ }
+ }
+
+ if ( inClass == TRUE ) {
+ ParseThisMember(line, lineNo);
+ }
+
+ if (ParseFunction(line, lineNo) == TRUE) {
+ bracketFuncOpen = line.contains("{");
+ bracketFuncClose = line.contains("}");
+ }
+
+ if ( inMethod == TRUE )
+ ParseReturn(line, lineNo);
+
+ ParseVariable(line, lineNo);
+ ParseMember(line, lineNo);
+ ParseTodo(line, lineNo);
+ ParseFixme(line, lineNo);
+
+ ++lineNo;
+ }
+ }
+}
+
+void PHPFile::PHPCheck() {
+// int status = 0;
+ m_phpCheckOutput = "";
+
+/// @todo try with kprocess in futur version actually this create zombie
+/*
+ phpCheckProc->clearArguments();
+
+ *phpCheckProc << m_phpSupport->getExePath();
+ *phpCheckProc << "-l -f" << KShellProcess::quote(fileName());
+
+ phpCheckProc->start(KProcess::DontCare, KProcess::All);
+*/
+
+/*
+ char buf[255];
+ FILE *fd = popen(QString(m_phpSupport->getExePath() + " -l -f " + KShellProcess::quote(fileName())).ascii(), "r");
+ while (!feof(fd)) {
+ memset(buf, 0, 255);
+ fgets(buf, 255, fd);
+ m_phpCheckOutput += buf;
+ }
+ pclose(fd);
+
+ ParseStdout(m_phpCheckOutput);
+*/
+}
+
+/*
+void PHPFile::slotReceivedPHPCheckStdout (KProcess* proc, char* buffer, int buflen) {
+ kdDebug(9018) << "slotPHPExeStdout()" << endl;
+ m_phpCheckOutput += QString::fromLocal8Bit(buffer,buflen+1);
+}
+
+void PHPFile::slotReceivedPHPCheckStderr (KProcess* proc, char* buffer, int buflen) {
+ kdDebug(9018) << "slotPHPExeStderr()" << endl;
+ m_phpCheckOutput += QString::fromLocal8Bit(buffer,buflen+1);
+}
+
+void PHPFile::slotPHPCheckExited (KProcess* proc) {
+ kdDebug(v) << "slotPHPExeExited()" << endl;
+}
+*/
+
+void PHPFile::ParseStdout(QString phpOutput) {
+ kdDebug(9018) << "ParseStdout()" << endl;
+ QRegExp parseError("^(<b>|)Parse error(</b>|): parse error, (.*) in (<b>|)(.*)(</b>|) on line (<b>|)(.*)(</b>|).*$");
+ QRegExp undefFunctionError("^(<b>|)Fatal error(</b>|): Call to undefined function: (.*) in (<b>|)(.*)(</b>|) on line (<b>|)(.*)(</b>|).*$");
+ QRegExp warning("^(<b>|)Warning(</b>|): (<b>|)(.*)(</b>|) in (.*) on line (<b>|)(.*)(</b>|).*$");
+ QRegExp generalFatalError("^(<b>|)Fatal error(</b>|): (.*) in (<b>|)(.*)(</b>|) on line (<b>|)(.*)(</b>|).*$");
+
+ QStringList list = QStringList::split("\n", phpOutput);
+ QStringList::Iterator it;
+ for ( it = list.begin(); it != list.end(); ++it ) {
+ if (generalFatalError.search(*it) >= 0) {
+// m_errorview->reportProblem(Error, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3));
+ }
+ if(parseError.search(*it) >= 0){
+// m_errorview->reportProblem(ErrorParse, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3));
+ }
+ if(undefFunctionError.search(*it) >= 0){
+// m_errorview->reportProblem(ErrorNoSuchFunction, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3));
+ }
+ if (warning.search(*it) >= 0){
+// m_errorview->reportProblem(ErrorNoSuchFunction, parseError.cap(6), parseError.cap(8).toInt(), parseError.cap(4));
+ }
+ }
+
+}
+/*
+ClassDom PHPFile::classByName(QString filename, QString classname) {
+ QValueList<ClassDom> CList;
+ QString abso = URLUtil::canonicalPath(filename);
+ ClassList classList = m_model->globalNamespace()->classList();
+
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+ if (nClass->name().lower() == classname.lower() && nClass->fileName() == abso)
+ return nClass;
+ }
+ return NULL;
+}
+
+QValueList<ClassDom> PHPFile::classByName(QString classname) {
+ QValueList<ClassDom> CList;
+
+ ClassList classList = m_model->globalNamespace()->classList();
+
+ ClassList::Iterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
+ ClassDom nClass = *classIt;
+ if (nClass->name().lower() == classname.lower())
+ CList.append( nClass );
+ }
+ return CList;
+}
+*/
+
+void PHPFile::postEvent(FileParseEvent *event) {
+ KApplication::postEvent( m_part, event );
+ usleep(100);
+}
+
+bool PHPFile::AddClass(QString name, QString extends, int start) {
+ postEvent( new FileParseEvent( Event_AddClass, this->fileName(), name, extends, start ) );
+ inClass = TRUE;
+ return TRUE;
+}
+
+bool PHPFile::SetClass(QString arguments) {
+ postEvent( new FileParseEvent( Event_SetClass, this->fileName(), "", arguments ) );
+ return TRUE;
+}
+
+bool PHPFile::CloseClass(int end) {
+ postEvent( new FileParseEvent( Event_CloseClass, this->fileName(), end ) );
+ inClass = FALSE;
+ return TRUE;
+}
+
+bool PHPFile::AddFunction(QString name, QString arguments, int start) {
+ postEvent( new FileParseEvent( Event_AddFunction, this->fileName(), name, arguments, start ) );
+ inMethod = TRUE;
+ return TRUE;
+}
+
+bool PHPFile::SetFunction(QString name, QString arguments) {
+ postEvent( new FileParseEvent( Event_SetFunction, this->fileName(), name, arguments ) );
+ return TRUE;
+}
+
+bool PHPFile::CloseFunction(int end) {
+ postEvent( new FileParseEvent( Event_CloseFunction, this->fileName(), end ) );
+ inMethod = FALSE;
+ return TRUE;
+}
+
+bool PHPFile::AddVariable(QString name, QString type, int position, bool classvar) {
+ postEvent( new FileParseEvent( Event_AddVariable, this->fileName(), name, type, position, classvar ) );
+ return TRUE;
+}
+
+bool PHPFile::SetVariable(QString arguments) {
+ postEvent( new FileParseEvent( Event_SetVariable, this->fileName(), "", arguments ) );
+ return TRUE;
+}
+
+bool PHPFile::AddTodo(QString arguments, int position) {
+ postEvent( new FileParseEvent( Event_AddTodo, this->fileName(), "", arguments, position ) );
+ inClass = TRUE;
+ return TRUE;
+}
+
+bool PHPFile::AddFixme(QString arguments, int position) {
+ postEvent( new FileParseEvent( Event_AddFixme, this->fileName(), "", arguments, position ) );
+ inClass = TRUE;
+ return TRUE;
+}
+
+#include "phpfile.moc"
diff --git a/languages/php/phpfile.h b/languages/php/phpfile.h
new file mode 100644
index 00000000..cb1573f3
--- /dev/null
+++ b/languages/php/phpfile.h
@@ -0,0 +1,119 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef PHPFILE_H
+#define PHPFILE_H
+
+#include <kapplication.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+#include <qthread.h>
+
+#include <urlutil.h>
+#include <kprocess.h>
+#include <kdebug.h>
+
+#include <kdevproject.h>
+#include <kdevlanguagesupport.h>
+#include <kdevpartcontroller.h>
+
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+
+#include "phpsupportpart.h"
+#include "phperrorview.h"
+#include "phpparser.h"
+#include "phpsupport_event.h"
+
+/**
+@author Escuder Nicolas
+*/
+class PHPFile : public QObject {
+Q_OBJECT
+
+public:
+ PHPFile(PHPSupportPart *phpSupport, const QString& fileName);
+ ~PHPFile();
+
+ QStringList getContents();
+
+ bool isModified();
+ void setModified(bool value);
+ QString fileName();
+ void Analyse();
+ void ParseStdout(QString phpOutput);
+/*
+ ClassDom classByName(QString filename, QString classname);
+ QValueList<ClassDom> classByName(QString classname);
+*/
+
+/*
+private slots:
+ void slotReceivedPHPCheckStderr (KProcess* proc, char* buffer, int buflen);
+ void slotReceivedPHPCheckStdout (KProcess* proc, char* buffer, int buflen);
+ void slotPHPCheckExited (KProcess* proc);
+*/
+private:
+ QStringList readFromEditor();
+ QStringList readFromDisk();
+
+ bool ParseClass(QString line, int lineNo);
+ bool ParseFunction(QString line, int lineNo);
+ bool ParseVariable(QString line, int lineNo);
+
+ bool ParseThisMember(QString line, int lineNo);
+ bool ParseMember(QString line, int lineNo);
+ bool ParseReturn(QString line, int lineNo);
+ bool ParseTodo(QString line, int lineNo);
+ bool ParseFixme(QString line, int lineNo);
+
+ void ParseSource();
+ void PHPCheck();
+
+ void postEvent(FileParseEvent *event);
+
+ bool AddClass(QString name, QString extends, int start);
+ bool SetClass(QString arguments);
+ bool CloseClass(int end);
+
+ bool AddFunction(QString name, QString arguments, int start);
+ bool SetFunction(QString name, QString arguments = "");
+ bool CloseFunction(int end);
+
+ bool AddVariable(QString name, QString type, int position, bool classvar = FALSE);
+ bool SetVariable(QString arguments);
+
+ bool AddTodo(QString arguments, int position);
+ bool AddFixme(QString arguments, int position);
+
+ PHPSupportPart *m_part;
+
+ bool modified;
+
+ bool inClass;
+ bool inMethod;
+
+ QFileInfo* m_fileinfo;
+ QStringList m_contents;
+ QString m_phpCheckOutput;
+// KShellProcess* phpCheckProc;
+};
+
+#endif
diff --git a/languages/php/phphtmlview.cpp b/languages/php/phphtmlview.cpp
new file mode 100644
index 00000000..d21a6fa0
--- /dev/null
+++ b/languages/php/phphtmlview.cpp
@@ -0,0 +1,39 @@
+/***************************************************************************
+ phphtmlview.cpp - description
+ -------------------
+ begin : Sat May 26 2001
+ copyright : (C) 2001 by
+ email :
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "phphtmlview.h"
+
+#include "phpsupportpart.h"
+#include "kdevpartcontroller.h"
+
+PHPHTMLView::PHPHTMLView(PHPSupportPart *part):m_part(part) {
+ setOptions(CanOpenInNewWindow);
+}
+PHPHTMLView::~PHPHTMLView(){
+}
+
+void PHPHTMLView::slotDuplicate( )
+{
+ m_part->partController()->showDocument(url(), true);
+}
+
+void PHPHTMLView::slotOpenInNewWindow( const KURL & url )
+{
+ m_part->partController()->showDocument(url, true);
+}
+
+#include "phphtmlview.moc"
diff --git a/languages/php/phphtmlview.h b/languages/php/phphtmlview.h
new file mode 100644
index 00000000..e135cfa7
--- /dev/null
+++ b/languages/php/phphtmlview.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ phphtmlview.h - description
+ -------------------
+ begin : Sat May 26 2001
+ copyright : (C) 2001 by
+ email :
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 PHPHTMLVIEW_H
+#define PHPHTMLVIEW_H
+
+#include <kdevhtmlpart.h>
+
+/**
+ *@author
+ */
+class PHPSupportPart;
+
+class PHPHTMLView : public KDevHTMLPart {
+Q_OBJECT
+public:
+ PHPHTMLView(PHPSupportPart *part);
+ ~PHPHTMLView();
+
+protected slots:
+ virtual void slotDuplicate();
+ virtual void slotOpenInNewWindow(const KURL &url);
+
+private:
+ PHPSupportPart *m_part;
+};
+
+#endif
diff --git a/languages/php/phpinfodlg.ui b/languages/php/phpinfodlg.ui
new file mode 100644
index 00000000..77de8304
--- /dev/null
+++ b/languages/php/phpinfodlg.ui
@@ -0,0 +1,87 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>PHPInfoDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PHPInfoDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>412</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>PHP Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QMultiLineEdit" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>php_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="0">
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PHPInfoDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/languages/php/phpnewclassdlg.cpp b/languages/php/phpnewclassdlg.cpp
new file mode 100644
index 00000000..f17034db
--- /dev/null
+++ b/languages/php/phpnewclassdlg.cpp
@@ -0,0 +1,123 @@
+/***************************************************************************
+ phpnewclassdlg.cpp - description
+ -------------------
+ begin : Sat Aug 11 2001
+ copyright : (C) 2001 by Sandy Meier
+ email : smeier@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "phpnewclassdlg.h"
+#include <klineedit.h>
+#include <kcompletion.h>
+#include <kfiledialog.h>
+#include <qtoolbutton.h>
+#include <iostream>
+#include <qregexp.h>
+#include <qtextedit.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kinstance.h>
+#include <kdebug.h>
+
+using namespace std;
+
+PHPNewClassDlg::PHPNewClassDlg(const QStringList& baseClassNames,const QString& directory,QWidget *parent, const char *name) : PHPNewClassDlgBase(parent,name,true) {
+ m_filenameModified = false;
+ KCompletion *comp = new KCompletion();
+ comp->setItems(baseClassNames);
+ m_dirEdit->setText(directory);
+
+ // load the class template if available
+ QString templateFile = KGlobal::instance()->dirs()->findResource("data","kdevphpsupport/newclasstemplate.txt");
+ if(!templateFile.isNull()){
+ QFile file(templateFile);
+ QTextStream stream(&file);
+ if(file.open(IO_ReadOnly)){
+ m_classTemplate->setText(stream.read());
+ file.close();
+ }
+ }
+
+
+ m_baseClassEdit->setCompletionObject( comp ); /// @todo change it to KLineEdit
+ connect(m_baseClassEdit,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&)));
+ connect(m_classNameEdit,SIGNAL(textChanged(const QString&)),
+ this,SLOT(classNameTextChanged(const QString&)));
+ connect(m_fileNameEdit,SIGNAL(textChanged(const QString&)),
+ this,SLOT(fileNameTextChanged(const QString&)));
+ connect(m_dirButton,SIGNAL(clicked()),
+ this,SLOT(slotDirButtonClicked()));
+}
+PHPNewClassDlg::~PHPNewClassDlg(){
+}
+
+void PHPNewClassDlg::slotDirButtonClicked(){
+ QString dir = KFileDialog::getExistingDirectory(m_dirEdit->text(),this);
+ if(!dir.isEmpty()){
+ m_dirEdit->setText(dir);
+ }
+}
+void PHPNewClassDlg::classNameTextChanged(const QString& str){
+ if(!m_filenameModified){
+ m_fileNameEdit->setText(str.lower() + ".inc");
+ }
+}
+
+void PHPNewClassDlg::fileNameTextChanged(const QString&){
+ if(m_fileNameEdit->hasFocus()){
+ m_filenameModified = true;
+ }
+}
+void PHPNewClassDlg::accept(){
+ PHPNewClassDlgBase::accept(); // hide the dialog
+
+ QString text = m_classTemplate->text();
+ QString classDir = m_dirEdit->text();
+ if(!classDir.endsWith("/")) classDir += "/"; // append /
+ QString absFileName = classDir + m_fileNameEdit->text();
+
+ // save the template for the next time
+ QString templateDir = KGlobal::instance()->dirs()->saveLocation("data") + "/kdevphpsupport/";
+ QString templateFile = templateDir + "newclasstemplate.txt";
+ QDir dir(templateDir);
+ if(!dir.exists()){
+ if(!dir.mkdir(templateDir)){
+ kdWarning() << "Error on creating directory for the classtemplate" << templateDir << endl;
+ }
+ }
+ QFile file(templateFile);
+ QTextStream stream(&file);
+
+ if(file.open(IO_WriteOnly)){
+ stream << text; // write
+ file.close();
+ }
+
+ // generate the sourcecode for the class
+ if(m_baseClassEdit->text().isEmpty()){
+ text = text.replace(QRegExp("extends BASECLASS"),"");
+ text = text.replace(QRegExp("BASECLASS\\:\\:BASECLASS\\(\\);"),"");
+ }else{
+ text = text.replace(QRegExp("BASECLASS"),m_baseClassEdit->text());
+ }
+ text = text.replace(QRegExp("CLASSNAME"),m_classNameEdit->text());
+ text = text.replace(QRegExp("FILENAME"),m_fileNameEdit->text().upper());
+ text = text.replace(QRegExp("AUTHOR"),"not implemented");
+
+ file.setName(absFileName);
+ if(file.open(IO_WriteOnly)){
+ stream << text; // write
+ file.close();
+ }
+}
+
+#include "phpnewclassdlg.moc"
diff --git a/languages/php/phpnewclassdlg.h b/languages/php/phpnewclassdlg.h
new file mode 100644
index 00000000..d94bfffb
--- /dev/null
+++ b/languages/php/phpnewclassdlg.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ phpnewclassdlg.h - description
+ -------------------
+ begin : Sat Aug 11 2001
+ copyright : (C) 2001 by Sandy Meier
+ email : smeier@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef PHPNEWCLASSDLG_H
+#define PHPNEWCLASSDLG_H
+
+#include <qwidget.h>
+#include "phpnewclassdlgbase.h"
+
+/**
+ *@author Sandy Meier
+ */
+
+class PHPNewClassDlg : public PHPNewClassDlgBase {
+ Q_OBJECT
+public:
+ PHPNewClassDlg(const QStringList& baseClassNames,const QString& directory,QWidget *parent=0, const char *name=0);
+ ~PHPNewClassDlg();
+ protected slots:
+ void classNameTextChanged(const QString&);
+ void fileNameTextChanged(const QString&);
+ void accept();
+ void slotDirButtonClicked();
+ protected:
+ bool m_filenameModified;
+};
+
+#endif
diff --git a/languages/php/phpnewclassdlgbase.ui b/languages/php/phpnewclassdlgbase.ui
new file mode 100644
index 00000000..5b4df7c1
--- /dev/null
+++ b/languages/php/phpnewclassdlgbase.ui
@@ -0,0 +1,201 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>PHPNewClassDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>m_ClassDLG</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>439</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Class</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Class &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_classNameEdit</cstring>
+ </property>
+ </widget>
+ <spacer row="5" column="0" rowspan="1" colspan="3">
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="5" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="5" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="4" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>m_baseClassEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_classNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Base class:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_baseClassEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Class &amp;template:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_classTemplate</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_dirEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;File name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_fileNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="2" column="6">
+ <property name="name">
+ <cstring>m_dirButton</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string>...</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>m_fileNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>m_dirEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="4" column="0" rowspan="1" colspan="7">
+ <property name="name">
+ <cstring>m_classTemplate</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;?php
+if (!defined("FILENAME")){
+define("FILENAME",0);
+/*
+* @author AUTHOR
+*/
+
+class CLASSNAME extends BASECLASS {
+ //constructor
+ function CLASSNAME(){
+ BASECLASS::BASECLASS();
+ }
+ }
+}
+?&gt;</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>m_ClassDLG</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>m_ClassDLG</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_classNameEdit</tabstop>
+ <tabstop>m_baseClassEdit</tabstop>
+ <tabstop>m_fileNameEdit</tabstop>
+ <tabstop>m_dirEdit</tabstop>
+ <tabstop>m_dirButton</tabstop>
+ <tabstop>m_classTemplate</tabstop>
+ <tabstop>m_okButton</tabstop>
+ <tabstop>m_cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in declaration">klineedit.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/php/phpparser.cpp b/languages/php/phpparser.cpp
new file mode 100644
index 00000000..b13c5479
--- /dev/null
+++ b/languages/php/phpparser.cpp
@@ -0,0 +1,160 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include "phpparser.h"
+#include "phpsupportpart.h"
+#include <urlutil.h>
+
+#include <kapplication.h>
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <codemodel.h>
+
+#include <qregexp.h>
+#include <kdebug.h>
+
+#include <qfileinfo.h>
+#include <qtextstream.h>
+
+#include <iostream>
+
+#include "phpsupport_event.h"
+
+using namespace std;
+
+PHPParser::PHPParser(PHPSupportPart *part){
+ m_part = part;
+ m_close = false;
+}
+
+PHPParser::~PHPParser(){
+ removeAllFiles();
+}
+
+bool PHPParser::hasFile( const QString& fileName )
+{
+// kdDebug(9018) << "hasFile " << fileName.latin1() << endl;
+ QString abso = URLUtil::canonicalPath(fileName);
+ QMap<QString, PHPFile *>::Iterator it = m_files.find(abso);
+
+ if ( it == m_files.end() )
+ return false;
+ return true;
+}
+
+void PHPParser::addFile( const QString& fileName )
+{
+ QString abso = URLUtil::canonicalPath(fileName);
+
+ if ( hasFile(abso) )
+ return;
+
+ kdDebug(9018) << "addFile " << fileName.latin1() << endl;
+
+ QFileInfo fi( abso );
+ if ((fi.extension().contains("inc") || fi.extension().contains("php") || fi.extension().contains("html") || fi.extension().contains("php3") || !fi.extension()) && !fi.extension().contains("~")) {
+ m_files.insert(abso, new PHPFile(m_part, abso));
+ }
+}
+
+void PHPParser::removeFile( const QString& fileName )
+{
+// kdDebug(9018) << "removeFile " << fileName.latin1() << endl;
+ QString abso = URLUtil::canonicalPath(fileName);
+ QMap<QString, PHPFile *>::Iterator it = m_files.find(abso);
+
+ if ( it != m_files.end()) {
+ PHPFile *file = it.data();
+ m_files.remove( abso );
+ delete( file );
+ file = 0;
+ }
+}
+
+void PHPParser::removeAllFiles()
+{
+ kdDebug(9018) << "removeAllFiles" << endl;
+ QMap<QString, PHPFile *>::Iterator it = m_files.begin();
+
+ while( it != m_files.end() ){
+ PHPFile * file = it.data();
+ ++it;
+ delete( file );
+ file = 0;
+ }
+ m_files.clear();
+}
+
+void PHPParser::reparseFile( const QString& fileName )
+{
+ kdDebug(9018) << "reparseFile" << endl;
+ QString abso = URLUtil::canonicalPath(fileName);
+ QMap<QString, PHPFile *>::Iterator it = m_files.find(abso);
+
+ if ( it != m_files.end()) {
+ PHPFile *file = it.data();
+ file->setModified(true);
+ file = 0;
+ }
+ m_canParse.wakeAll();
+}
+
+void PHPParser::run() {
+ kdDebug(9018) << "run thread " << QThread::currentThread() << endl;
+ QMap<QString, PHPFile *>::Iterator it;
+
+ while ( !m_close ) {
+ m_canParse.wait();
+
+ if ( m_close )
+ break;
+
+ it = m_files.begin();
+
+ while( it != m_files.end() ){
+ PHPFile * file = it.data();
+ if (!m_close) {
+ if ( file->isModified() ) {
+ file->Analyse();
+ it = m_files.begin();
+ } else {
+ ++it;
+ }
+ file = 0;
+ } else {
+ it = m_files.end();
+ }
+ }
+ }
+}
+
+void PHPParser::close()
+{
+ kdDebug(9018) << "closing thread" << endl;
+ m_close = true;
+ m_canParse.wakeAll();
+
+ while (running()) {
+ kapp->processEvents();
+ }
+}
+
+void PHPParser::startParse() {
+ kdDebug(9018) << "startParse" << endl;
+ m_canParse.wakeAll();
+}
diff --git a/languages/php/phpparser.h b/languages/php/phpparser.h
new file mode 100644
index 00000000..c5d7e378
--- /dev/null
+++ b/languages/php/phpparser.h
@@ -0,0 +1,73 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef PHPPARSER_H
+#define PHPPARSER_H
+
+#include <qthread.h>
+
+#if QT_VERSION < 0x030100
+#include <kdevmutex.h>
+#else
+#include <qmutex.h>
+#endif
+
+#include <codemodel.h>
+
+#include <qwaitcondition.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include "phpfile.h"
+
+class KDevCore;
+class PHPSupportPart;
+
+/**
+ *@author Sandy Meier
+ */
+
+class PHPParser: public QThread {
+
+public:
+ PHPParser(PHPSupportPart *part);
+ ~PHPParser();
+
+ void addFile( const QString& fileName );
+ bool hasFile( const QString& fileName );
+ void reparseFile( const QString& fileName );
+ void removeFile( const QString& fileName );
+ void removeAllFiles();
+
+ void run();
+ void close();
+ void startParse();
+
+private:
+ CodeModel* m_model;
+ KDevCore* m_core;
+ PHPSupportPart* m_part;
+
+ QMutex m_mutex;
+ QWaitCondition m_canParse;
+ bool m_close;
+ QMap<QString, PHPFile*> m_files;
+};
+
+
+#endif
diff --git a/languages/php/phpsupport_event.h b/languages/php/phpsupport_event.h
new file mode 100644
index 00000000..4a1a175b
--- /dev/null
+++ b/languages/php/phpsupport_event.h
@@ -0,0 +1,110 @@
+/*
+ Copyright (C) 2003 by Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef __phpsupport_events_h
+#define __phpsupport_events_h
+
+#include <qevent.h>
+#include <qvaluelist.h>
+
+#if QT_VERSION < 0x030100
+#include <kdevmutex.h>
+#else
+#include <qmutex.h>
+#endif
+
+enum
+{
+ Event_AddFile = QEvent::User + 1000,
+ Event_StartParse,
+ Event_EndParse,
+ Event_AddClass,
+ Event_SetClass,
+ Event_CloseClass,
+ Event_AddFunction,
+ Event_SetFunction,
+ Event_CloseFunction,
+ Event_AddVariable,
+ Event_SetVariable,
+ Event_AddTodo,
+ Event_AddFixme
+};
+
+class FileParseEvent: public QCustomEvent
+{
+public:
+ FileParseEvent(long event, const QString& fileName )
+ : QCustomEvent(event), m_fileName( fileName )
+ {
+ m_name = "";
+ m_arguments = "";
+ m_position = 0;
+ m_global = FALSE;
+ }
+
+ FileParseEvent(long event, const QString& fileName, int position )
+ : QCustomEvent(event), m_fileName( fileName ), m_position( position )
+ {
+ m_name = "";
+ m_arguments = "";
+ m_global = FALSE;
+ }
+
+ FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments )
+ : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments )
+ {
+ m_position = 0;
+ m_global = FALSE;
+ }
+
+ FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments, int position )
+ : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments ), m_position( position )
+ {
+ m_global = FALSE;
+ }
+
+ FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments, int position, bool global )
+ : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments ), m_position( position ), m_global( global )
+ {
+ }
+
+ ~FileParseEvent()
+ {
+ }
+
+ QString fileName() const { return m_fileName; }
+ QString name() const { return m_name; }
+ QString arguments() const { return m_arguments; }
+ int posititon() const { return m_position; }
+ bool global() const { return m_global; }
+
+private:
+ QString m_fileName;
+ QString m_name;
+ QString m_arguments;
+ QString m_accesstype;
+ int m_position;
+ bool m_global;
+
+private:
+ FileParseEvent( const FileParseEvent& source );
+ void operator = ( const FileParseEvent& source );
+};
+
+#endif // __phpsupport_events_h
diff --git a/languages/php/phpsupportpart.cpp b/languages/php/phpsupportpart.cpp
new file mode 100644
index 00000000..4c4de794
--- /dev/null
+++ b/languages/php/phpsupportpart.cpp
@@ -0,0 +1,751 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#include "phpsupportpart.h"
+
+#include <iostream>
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qprogressbar.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <qthread.h>
+
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <khtmlview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kregexp.h>
+#include <kstatusbar.h>
+#include <kparts/browserextension.h>
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <codemodel.h>
+#include <domutil.h>
+#include <kdevplugininfo.h>
+#include <kiconloader.h>
+
+#include "phpconfigdata.h"
+#include "phpconfigwidget.h"
+#include "phpcodecompletion.h"
+#include "phpparser.h"
+#include "phpnewclassdlg.h"
+
+
+#include "phphtmlview.h"
+#include "phperrorview.h"
+
+#include "phpsupport_event.h"
+
+using namespace std;
+
+static const KDevPluginInfo data("kdevphpsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevphpsupport, PHPSupportFactory( data ) )
+
+PHPSupportPart::PHPSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "PHPSupportPart")
+{
+ m_htmlView = 0;
+ m_parser = 0;
+ phpExeProc = 0;
+ setInstance(PHPSupportFactory::instance());
+
+ setXMLFile("kdevphpsupport.rc");
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ KAction *action;
+
+ action = new KAction( i18n("&Run"), "exec",Key_F9,
+ this, SLOT(slotRun()),
+ actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Run"));
+ action->setWhatsThis(i18n("<b>Run</b><p>Executes script on a terminal or a webserver."));
+
+ action = new KAction( i18n("&New Class..."),0,
+ this, SLOT(slotNewClass()),
+ actionCollection(), "project_new_class" );
+ action->setToolTip(i18n("New class"));
+ action->setWhatsThis(i18n("<b>New class</b><p>Runs New Class wizard."));
+
+ m_phpErrorView = new PHPErrorView(this, 0, "phpErrorWidget");
+ m_phpErrorView->setIcon( SmallIcon("info") );
+
+ QWhatsThis::add(m_phpErrorView, i18n("<b>PHP problems</b><p>This view shows PHP parser warnings, errors, and fatal errors."));
+ mainWindow()->embedOutputView(m_phpErrorView, i18n("Problems"), i18n("Problems"));
+
+ phpExeProc = new KShellProcess("/bin/sh");
+ connect( phpExeProc, SIGNAL(receivedStdout (KProcess*, char*, int)),
+ this, SLOT(slotReceivedPHPExeStdout (KProcess*, char*, int)));
+ connect( phpExeProc, SIGNAL(receivedStderr (KProcess*, char*, int)),
+ this, SLOT(slotReceivedPHPExeStderr (KProcess*, char*, int)));
+ connect( phpExeProc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotPHPExeExited(KProcess*)));
+
+ m_htmlView = new PHPHTMLView(this);
+ mainWindow()->embedOutputView(m_htmlView->view(), i18n("PHP"), i18n("PHP"));
+ connect( m_htmlView, SIGNAL(started(KIO::Job*)),
+ this, SLOT(slotWebJobStarted(KIO::Job*)));
+
+ configData = new PHPConfigData(projectDom());
+ connect( configData, SIGNAL(configStored()),
+ this, SLOT(slotConfigStored()));
+
+ m_codeCompletion = new PHPCodeCompletion(this, configData);
+
+ new KAction(i18n("Complete Text"), CTRL+Key_Space, m_codeCompletion, SLOT(cursorPositionChanged()), actionCollection(), "edit_complete_text");
+
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part *)));
+ connect( this, SIGNAL(fileParsed( PHPFile* )), this, SLOT(slotfileParsed( PHPFile* )));
+}
+
+PHPSupportPart::~PHPSupportPart()
+{
+ LastClass = NULL;
+ LastMethod = NULL;
+ LastVariable = NULL;
+
+ if ( m_parser ) {
+ m_parser->close() ;
+ delete( m_parser );
+ m_parser = NULL;
+ }
+
+ if ( m_phpErrorView ) {
+ mainWindow()->removeView( m_phpErrorView );
+ delete( m_phpErrorView );
+ m_phpErrorView = NULL;
+ }
+
+ kdDebug(9018) << "remove codeCompletition" << endl;
+ if ( m_codeCompletion )
+ delete( m_codeCompletion );
+
+ kdDebug(9018) << "remove configData" << endl;
+ if ( configData )
+ delete( configData );
+
+ if ( m_htmlView ) {
+ kdDebug(9018) << "remove htmlView" << endl;
+ mainWindow()->removeView( m_htmlView->view() );
+ delete( m_htmlView );
+ m_htmlView = NULL;
+ }
+
+ kdDebug(9018) << "remove phpExec" << endl;
+ if ( phpExeProc )
+ delete( phpExeProc );
+
+ kdDebug(9018) << "finish" << endl;
+}
+
+void PHPSupportPart::slotActivePartChanged(KParts::Part *part) {
+ kdDebug(9018) << "enter slotActivePartChanged" << endl;
+ if (!part || !part->widget())
+ return;
+ m_editInterface = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (m_editInterface) { // connect to the editor
+ disconnect(part, 0, this, 0 ); // to make sure that it is't connected twice
+ if (configData->getRealtimeParsing()) {
+ connect(part,SIGNAL(textChanged()),this,SLOT(slotTextChanged()));
+ }
+ m_codeCompletion->setActiveEditorPart(part);
+ }
+ kdDebug(9018) << "exit slotActivePartChanged" << endl;
+}
+
+void PHPSupportPart::slotTextChanged() {
+ kdDebug(9018) << "enter text changed" << endl;
+
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if (!ro_part)
+ return;
+
+ QString fileName = ro_part->url().directory() + "/" + ro_part->url().fileName();
+
+ if (m_parser) {
+ if (m_parser->hasFile( fileName ))
+ m_parser->reparseFile( fileName );
+ }
+}
+
+void PHPSupportPart::slotConfigStored() {
+ // fake a changing, this will read the configuration again and install the connects
+ slotActivePartChanged(partController()->activePart());
+}
+
+void PHPSupportPart::projectConfigWidget(KDialogBase *dlg) {
+ QVBox *vbox = dlg->addVBoxPage(i18n( "PHP Specific" ), i18n("PHP Settings"), BarIcon( "source", KIcon::SizeMedium ));
+ PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+void PHPSupportPart::slotNewClass() {
+ QStringList classNames = sortedNameList( codeModel()->globalNamespace()->classList() );
+ PHPNewClassDlg dlg(classNames,project()->projectDirectory());
+ dlg.exec();
+ }
+
+void PHPSupportPart::slotRun() {
+ configData = new PHPConfigData(projectDom());
+ if (validateConfig()) {
+ mainWindow()->raiseView(m_htmlView->view());
+ PHPConfigData::InvocationMode mode = configData->getInvocationMode() ;
+ if (mode == PHPConfigData::Web) {
+ executeOnWebserver();
+ }
+ else if (mode == PHPConfigData::Shell) {
+ executeInTerminal();
+ }
+ }
+}
+
+bool PHPSupportPart::validateConfig() {
+ if (!configData->validateConfig()) {
+ KMessageBox::information(0,i18n("There is no configuration for executing a PHP file.\nPlease set the correct values in the next dialog."));
+ KDialogBase dlg(KDialogBase::TreeList, i18n("Customize PHP Mode"),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, 0,
+ "php config dialog");
+
+ QVBox *vbox = dlg.addVBoxPage(i18n("PHP Settings"));
+ PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget");
+ connect( &dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ dlg.exec();
+ }
+ if (configData->validateConfig()) {
+ return true;
+ }
+ return false;
+}
+
+void PHPSupportPart::executeOnWebserver() {
+ // Save all files once
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ // Figure out the name of the remote file
+ QString weburl = configData->getWebURL();
+ QString file = getExecuteFile();
+
+ // Force KHTMLPart to reload the page
+ KParts::BrowserExtension* be = m_htmlView->browserExtension();
+ if (be) {
+ KParts::URLArgs urlArgs( be->urlArgs() );
+ urlArgs.reload = true;
+ be->setURLArgs( urlArgs );
+ }
+
+ // Acutally do the request
+ m_phpExeOutput="";
+ m_htmlView->openURL(KURL(weburl + file));
+ m_htmlView->show();
+}
+
+QString PHPSupportPart::getExecuteFile() {
+ QString file;
+ PHPConfigData::StartupFileMode mode = configData->getStartupFileMode();
+
+ QString weburl = configData->getWebURL();
+ if (mode == PHPConfigData::Current) {
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if (ro_part) {
+ if ( configData->getInvocationMode() == PHPConfigData::Web )
+ file = URLUtil::relativePath( project()->projectDirectory(), ro_part->url().path() );
+ else
+ file = ro_part->url().path();
+ }
+ }
+ if (mode == PHPConfigData::Default) {
+ file = configData->getStartupFile();
+ }
+ return file;
+}
+
+void PHPSupportPart::slotWebJobStarted(KIO::Job* job) {
+ if (job && job->className() == QString("KIO::TransferJob")) {
+ kdDebug(9018) << endl << "job started" << job->progressId();
+ KIO::TransferJob *tjob = static_cast<KIO::TransferJob*>(job);
+ connect( tjob, SIGNAL(data(KIO::Job*, const QByteArray&)),
+ this, SLOT(slotWebData(KIO::Job*, const QByteArray&)));
+ connect( tjob, SIGNAL(result(KIO::Job*)),
+ this, SLOT(slotWebResult(KIO::Job*)));
+ }
+}
+
+void PHPSupportPart::slotWebData(KIO::Job* /*job*/,const QByteArray& data) {
+ kdDebug(9018) << "slotWebData()" << endl;
+ QString strData(data);
+ m_phpExeOutput += strData;
+}
+
+void PHPSupportPart::slotWebResult(KIO::Job* /*job*/) {
+ kdDebug(9018) << "slotWebResult()" << endl;
+ QString file = getExecuteFile();
+ PHPFile *pfile = new PHPFile(this, file);
+ pfile->ParseStdout(m_phpExeOutput);
+ delete pfile;
+}
+
+void PHPSupportPart::executeInTerminal() {
+ kdDebug(9018) << "slotExecuteInTerminal()" << endl;
+
+ // Save all files once
+ if (partController()->saveAllFiles()==false)
+ return; //user cancelled
+
+ QString file = getExecuteFile();
+
+ if (m_htmlView == 0) {
+ m_htmlView = new PHPHTMLView(this);
+ mainWindow()->embedOutputView(m_htmlView->view(), i18n("PHP"), i18n("PHP") );
+ }
+
+ m_htmlView->show();
+ m_htmlView->begin();
+
+ m_phpExeOutput = "";
+ phpExeProc->clearArguments();
+ *phpExeProc << configData->getPHPExecPath();
+ *phpExeProc << "-f";
+
+ *phpExeProc << KShellProcess::quote(file);
+ kdDebug(9018) << "" << file.latin1() << endl;
+ phpExeProc->start(KProcess::NotifyOnExit,KProcess::All);
+
+ // core()->gotoDocumentationFile(KURL("http://www.php.net"));
+}
+
+void PHPSupportPart::slotReceivedPHPExeStdout (KProcess* /*proc*/, char* buffer, int buflen) {
+ kdDebug(9018) << "slotPHPExeStdout()" << endl;
+ m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1);
+
+ QString buf = buffer;
+ if (configData->getInvocationMode() == PHPConfigData::Shell)
+ buf.replace("\n", "<br>");
+ m_htmlView->write(buf);
+}
+
+void PHPSupportPart::slotReceivedPHPExeStderr (KProcess* /*proc*/, char* buffer, int buflen) {
+ kdDebug(9018) << "slotPHPExeStderr()" << endl;
+ m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1);
+
+ QString buf = buffer;
+ if (configData->getInvocationMode() == PHPConfigData::Shell)
+ buf.replace("\n", "<br>");
+ m_htmlView->write(buf);
+}
+
+void PHPSupportPart::slotPHPExeExited (KProcess* /*proc*/) {
+ kdDebug(9018) << "slotPHPExeExited()" << endl;
+ m_htmlView->end();
+ QString file = getExecuteFile();
+ PHPFile *pfile = new PHPFile(this, file);
+ pfile->ParseStdout(m_phpExeOutput);
+ delete pfile;
+}
+
+void PHPSupportPart::projectOpened()
+{
+ kdDebug(9018) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ if (!m_parser) {
+ m_parser = new PHPParser( this );
+ m_parser->start();
+ }
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(500, this, SLOT( initialParse() ) );
+}
+
+void PHPSupportPart::initialParse( )
+{
+ // For debugging
+ if ( !project( ) )
+ {
+ // messagebox ?
+ kdDebug( 9018 ) << "No project" << endl;
+ return ;
+ }
+
+ parseProject( );
+ return ;
+}
+
+void PHPSupportPart::projectClosed()
+{
+ kdDebug(9018) << "projectClosed()" << endl;
+
+ if (m_parser) {
+ m_parser->close() ;
+ delete( m_parser );
+ m_parser = 0;
+ }
+}
+
+bool PHPSupportPart::parseProject()
+{
+ kdDebug(9018) << "parseProject()" << endl;
+ mainWindow() ->statusBar() ->message( i18n( "Updating..." ) );
+
+ kapp->setOverrideCursor( waitCursor );
+
+ _jd = new JobData;
+
+ _jd->files = project()->allFiles();
+
+ QProgressBar* bar = new QProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) );
+ bar->setMinimumWidth( 120 );
+ bar->setCenterIndicator( true );
+ mainWindow()->statusBar()->addWidget( bar );
+ bar->show();
+
+ _jd->progressBar = bar;
+ _jd->it = _jd->files.begin();
+ _jd->dir.setPath( project()->projectDirectory() );
+
+ QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) );
+ return TRUE;
+}
+
+void PHPSupportPart::slotParseFiles()
+{
+ kdDebug(9018) << "slotParseFiles()" << endl;
+
+ kapp->lock();
+
+ if ( _jd->it != _jd->files.end() )
+ {
+ _jd->progressBar->setProgress( _jd->progressBar->progress() + 1 );
+
+ QFileInfo fileInfo( _jd->dir, *( _jd->it ) );
+
+ if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() )
+ {
+ QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() );
+
+// if ( isValidSource( absFilePath ) )
+ {
+ if (m_parser)
+ m_parser->addFile( absFilePath );
+ }
+
+ ++( _jd->it );
+ }
+ QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) );
+ }
+ else // finished or interrupted
+ {
+ kapp->restoreOverrideCursor();
+ mainWindow()->statusBar()->removeWidget( _jd->progressBar );
+ mainWindow()->statusBar()->message( i18n( "Done" ), 2000 );
+
+ emit updatedSourceInfo();
+ if (m_parser)
+ m_parser->startParse();
+
+ delete _jd;
+ _jd = 0;
+ }
+
+ kapp->unlock();
+}
+
+void PHPSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9018) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QFileInfo fileInfo( project()->projectDirectory(), *it );
+ if (m_parser) {
+ m_parser->addFile( fileInfo.absFilePath() );
+ emit addedSourceInfo( fileInfo.absFilePath() );
+ }
+ }
+}
+
+void PHPSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9018) << "removedFilesFromProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QFileInfo fileInfo( project()->projectDirectory(), *it );
+ QString path = fileInfo.absFilePath();
+ if ( codeModel()->hasFile(path) ) {
+ emit aboutToRemoveSourceInfo( path );
+ codeModel()->removeFile( codeModel()->fileByName(path) );
+ }
+ }
+}
+
+void PHPSupportPart::savedFile(const KURL &fileName)
+{
+ kdDebug(9018) << "savedFile()" << fileName.fileName() << endl;
+/// @fixme when activated could cause stop
+/*
+ if (m_parser) {
+ if (m_parser->hasFile( fileName.path() )) {
+ m_parser->reparseFile( fileName.path() );
+ }
+ }
+*/
+}
+
+QString PHPSupportPart::getIncludePath()
+{
+ return configData->getPHPIncludePath();
+}
+
+QString PHPSupportPart::getExePath()
+{
+ return configData->getPHPExecPath();
+}
+
+KDevLanguageSupport::Features PHPSupportPart::features()
+{
+ return Features(Classes | Functions);
+}
+
+KMimeType::List PHPSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "application/x-php" );
+ if ( mime )
+ list << mime;
+
+ mime = KMimeType::mimeType( "text/plain" );
+ if ( mime )
+ list << mime;
+ return list;
+}
+
+void PHPSupportPart::customEvent( QCustomEvent* ev )
+{
+// kdDebug(9018) << "phpSupportPart::customEvent(" << ev->type() << ") " << QThread::currentThread() << endl;
+
+ if ( ev->type() < Event_AddFile || ev->type() > Event_AddFixme )
+ return;
+
+ kapp->lock();
+
+ FileParseEvent* event = (FileParseEvent*) ev;
+ NamespaceDom ns = codeModel()->globalNamespace();
+ FileDom m_file = codeModel()->fileByName( event->fileName() );
+
+ if (!m_file) {
+ m_file = codeModel()->create<FileModel>();
+ m_file->setName( event->fileName() );
+ codeModel()->addFile( m_file );
+ }
+
+ switch (int(ev->type())) {
+ case Event_AddFile:
+ m_parser->addFile( event->fileName() );
+ break;
+
+ case Event_StartParse:
+// kdDebug(9018) << "StartParse " << event->fileName() << endl;
+ LastClass = NULL;
+ LastMethod = NULL;
+ LastVariable = NULL;
+ if ( codeModel()->hasFile( event->fileName() ) ) {
+ emit aboutToRemoveSourceInfo( event->fileName() );
+ codeModel()->removeFile( codeModel()->fileByName( event->fileName() ) );
+ emit removedSourceInfo( event->fileName() );
+ }
+ ErrorView()->removeAllProblems( event->fileName() );
+ break;
+
+ case Event_AddClass:
+ {
+// kdDebug(9018) << "AddClass " << event->name() << endl;
+ ClassDom nClass = codeModel()->create<ClassModel>();
+ nClass->setFileName( event->fileName() );
+ nClass->setName( event->name() );
+ nClass->setStartPosition( event->posititon(), 0);
+
+ m_file->addClass( nClass );
+ if ( event->arguments().isEmpty() != TRUE )
+ nClass->addBaseClass( event->arguments() );
+
+ ns->addClass( nClass );
+ LastClass = nClass;
+ }
+ break;
+
+ case Event_CloseClass:
+ if ( LastClass != NULL ) {
+// kdDebug(9018) << "CloseClass " << LastClass->name() << endl;
+ LastClass->setEndPosition( event->posititon(), 0 );
+ LastClass = NULL;
+ LastMethod = NULL;
+ LastVariable = NULL;
+ }
+ break;
+
+ case Event_AddFunction:
+ {
+// kdDebug(9018) << "AddFunction " << event->name() << endl;
+ FunctionDom nMethod = codeModel()->create<FunctionModel>();
+ nMethod->setFileName( event->fileName() );
+ nMethod->setName( event->name() );
+ nMethod->setStartPosition( event->posititon(), 0 );
+
+ ArgumentDom nArgument;
+ nArgument = codeModel()->create<ArgumentModel>();
+ nArgument->setType(event->arguments().stripWhiteSpace().local8Bit());
+ nMethod->addArgument( nArgument );
+
+ if (LastClass != NULL) {
+ LastClass->addFunction(nMethod);
+ } else {
+ ns->addFunction(nMethod);
+ }
+ LastMethod = nMethod;
+ }
+ break;
+
+ case Event_SetFunction:
+ if ( LastMethod != NULL ) {
+// kdDebug(9018) << "SetFunction " << LastMethod->name() << " " << event->name() << endl;
+ if ( event->name() == "static" )
+ LastMethod->setStatic(true);
+ else if ( event->name() == "abstract" )
+ LastMethod->setAbstract(true);
+ else if ( event->name() == "private" )
+ LastMethod->setAccess(FunctionModel::Private);
+ else if ( event->name() == "public" )
+ LastMethod->setAccess(FunctionModel::Public);
+ else if ( event->name() == "protected" )
+ LastMethod->setAccess(FunctionModel::Protected);
+ else if ( event->name() == "result" ) {
+ QString ret = "";
+ if (event->arguments().lower() == "$this" && LastClass ) {
+ ret = LastClass->name();
+ }
+ LastMethod->setResultType(ret);
+ }
+ }
+ break;
+
+ case Event_CloseFunction:
+ if ( LastMethod != NULL ) {
+// kdDebug(9018) << "CloseFunction " << LastMethod->name() << endl;
+ LastMethod->setEndPosition( event->posititon(), 0 );
+ LastMethod = NULL;
+ LastVariable = NULL;
+ }
+ break;
+
+ case Event_AddVariable:
+ {
+ VariableDom nVariable = codeModel()->create<VariableModel>();
+
+ nVariable->setFileName( event->fileName() );
+ nVariable->setName( event->name() );
+ nVariable->setStartPosition( event->posititon(), 0 );
+ nVariable->setAccess(VariableModel::Public);
+
+ if ( event->arguments().isEmpty() != TRUE )
+ nVariable->setType( event->arguments() );
+
+ if ( LastClass != NULL && ( LastMethod == NULL || event->global() == TRUE ) ) {
+// kdDebug(9018) << "AddVariable To Class " << LastClass->name() << " " << nVariable->name() << endl;
+ LastClass->addVariable(nVariable);
+ } else {
+ if ( LastMethod != NULL ) {
+ kdDebug(9018) << "AddVariable " << LastMethod->name() << " " << nVariable->name() << endl;
+ } else {
+ ns->addVariable(nVariable);
+ }
+ }
+ LastVariable = nVariable;
+ }
+ break;
+
+ case Event_SetVariable:
+ if ( LastVariable != NULL ) {
+// kdDebug(9018) << "SetVariable " << LastVariable->name() << " " << event->arguments() << endl;
+ if ( event->arguments() == "static" )
+ LastVariable->setStatic(true);
+ else if ( event->arguments() == "private" )
+ LastVariable->setAccess(FunctionModel::Private);
+ else if ( event->arguments() == "public" )
+ LastVariable->setAccess(FunctionModel::Public);
+ else if ( event->arguments() == "protected" )
+ LastVariable->setAccess(FunctionModel::Protected);
+ }
+ break;
+
+ case Event_AddTodo:
+ ErrorView()->reportProblem(Todo, event->fileName(), event->posititon(), event->arguments());
+ break;
+
+ case Event_AddFixme:
+ ErrorView()->reportProblem(Fixme, event->fileName(), event->posititon(), event->arguments());
+ break;
+
+ case Event_EndParse:
+// kdDebug(9018) << "EndParse " << event->fileName() << endl;
+ emit addedSourceInfo( event->fileName() );
+ break;
+
+ }
+
+ kapp->unlock();
+ kapp->processEvents();
+}
+
+PHPErrorView *PHPSupportPart::ErrorView( ) {
+ return m_phpErrorView;
+}
+
+PHPParser *PHPSupportPart::Parser( ) {
+ return m_parser;
+}
+
+#include "phpsupportpart.moc"
diff --git a/languages/php/phpsupportpart.h b/languages/php/phpsupportpart.h
new file mode 100644
index 00000000..83478283
--- /dev/null
+++ b/languages/php/phpsupportpart.h
@@ -0,0 +1,133 @@
+/*
+ Copyright (C) 2005 by Nicolas Escuder <n.escuder@intra-links.com>
+ Copyright (C) 2001 by smeier@kdevelop.org
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ version 2, License 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.
+*/
+
+#ifndef _PHPSUPPORTPART_H_
+#define _PHPSUPPORTPART_H_
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qprogressbar.h>
+
+#include <kdialogbase.h>
+#include "kdevlanguagesupport.h"
+#include <kio/job.h>
+#include <kdevgenericfactory.h>
+
+#include <ktexteditor/editinterface.h>
+
+class QStringList;
+class PHPHTMLView;
+class KShellProcess;
+class KProcess;
+class PHPErrorView;
+class PHPConfigData;
+class PHPCodeCompletion;
+class PHPParser;
+class PHPFile;
+
+class PHPSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ PHPSupportPart( QObject *parent, const char *name, const QStringList & );
+ ~PHPSupportPart();
+
+ PHPErrorView *ErrorView();
+ PHPParser *Parser( ) ;
+
+ QString getIncludePath();
+ QString getExePath();
+
+ void emitFileParsed( PHPFile *file );
+ virtual void customEvent( QCustomEvent* ev );
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotRun();
+ void slotNewClass();
+ void projectConfigWidget(KDialogBase *dlg);
+ void slotReceivedPHPExeStderr (KProcess* proc, char* buffer, int buflen);
+ void slotReceivedPHPExeStdout (KProcess* proc, char* buffer, int buflen);
+ void slotPHPExeExited (KProcess* proc);
+ void slotWebData(KIO::Job* job,const QByteArray& data);
+ void slotWebResult(KIO::Job* job);
+ void slotWebJobStarted(KIO::Job* job);
+
+ // Internal
+ void initialParse();
+ void slotParseFiles();
+ bool parseProject();
+
+ void slotActivePartChanged(KParts::Part *part);
+ void slotTextChanged();
+ /* the configuration was written, mostly after a config dialog call
+ -> reorder connects
+ */
+ void slotConfigStored();
+
+private:
+ QString getExecuteFile();
+ void executeOnWebserver();
+ void executeInTerminal();
+ bool validateConfig();
+
+ PHPHTMLView* m_htmlView;
+ PHPErrorView* m_phpErrorView;
+ KShellProcess* phpExeProc;
+ QString m_phpExeOutput;
+ PHPConfigData* configData;
+ PHPCodeCompletion* m_codeCompletion;
+ PHPParser* m_parser;
+ KTextEditor::EditInterface *m_editInterface;
+
+ struct JobData
+ {
+ QDir dir;
+ QGuardedPtr<QProgressBar> progressBar;
+ QStringList::Iterator it;
+ QStringList files;
+ QMap< QString, QPair<uint, uint> > pcs;
+ QDataStream stream;
+ QFile file;
+
+ ~JobData()
+ {
+ delete progressBar;
+ }
+ };
+
+ JobData * _jd;
+
+ ClassDom LastClass;
+ FunctionDom LastMethod;
+ VariableDom LastVariable;
+};
+
+typedef KDevGenericFactory<PHPSupportPart> PHPSupportFactory;
+
+#endif
diff --git a/languages/php/phptemplates b/languages/php/phptemplates
new file mode 100644
index 00000000..3be3d265
--- /dev/null
+++ b/languages/php/phptemplates
@@ -0,0 +1,4 @@
+<!DOCTYPE Templates>
+<Templates>
+ <Template code="&lt;table&gt;&lt;tr&gt;&lt;td&gt;|&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" name="tab" description="table" suffixes="HTML (html)"/>
+</Templates>
diff --git a/languages/python/Makefile.am b/languages/python/Makefile.am
new file mode 100644
index 00000000..ddebc35d
--- /dev/null
+++ b/languages/python/Makefile.am
@@ -0,0 +1,31 @@
+# Here resides the Python support part.
+# Do not confuse this with the python part responsible for KDevelop scripting
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/languages/lib/designer_integration \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util -I$(top_builddir)/languages/lib/designer_integration \
+ $(all_includes)
+SUBDIRS = app_templates file_templates doc
+
+
+kde_module_LTLIBRARIES = libkdevpythonsupport.la kio_pydoc.la
+
+libkdevpythonsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevpythonsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/designer_integration/libdesignerintegration.la
+libkdevpythonsupport_la_SOURCES = pythonsupportpart.cpp pythonconfigwidget.cpp pythonconfigwidgetbase.ui \
+ pythonimplementationwidget.cpp qtdesignerpythonintegration.cpp
+
+kio_pydoc_la_SOURCES = pydoc.cpp
+kio_pydoc_la_LIBADD = $(LIB_KIO)
+kio_pydoc_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+
+METASOURCES = AUTO
+
+slavedir = $(kde_datadir)/kio_pydoc
+slave_DATA = kde_pydoc.py
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevpythonsupport.desktop pydoc.protocol
+
+rcdir = $(kde_datadir)/kdevpythonsupport
+rc_DATA = kdevpythonsupport.rc
diff --git a/languages/python/README.dox b/languages/python/README.dox
new file mode 100644
index 00000000..77d0f44c
--- /dev/null
+++ b/languages/python/README.dox
@@ -0,0 +1,48 @@
+/** \class PythonSupportPart
+This is a Python support plugin.
+
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Python support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/python/app_templates/Makefile.am b/languages/python/app_templates/Makefile.am
new file mode 100644
index 00000000..1ca030e1
--- /dev/null
+++ b/languages/python/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = pythonhello pytk pyqt
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PythonIDE
+profiles_DATA = python.appwizard
diff --git a/languages/python/app_templates/pyqt/.kdev_ignore b/languages/python/app_templates/pyqt/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pyqt/.kdev_ignore
diff --git a/languages/python/app_templates/pyqt/Makefile.am b/languages/python/app_templates/pyqt/Makefile.am
new file mode 100644
index 00000000..ea9502cc
--- /dev/null
+++ b/languages/python/app_templates/pyqt/Makefile.am
@@ -0,0 +1,20 @@
+dataFiles = app.py app.kdevelop fileopen.pyxpm fileprint.pyxpm \
+ filesave.pyxpm app-Makefile.am app-autogen.sh app-configure.ac \
+ documentdetails.ui missing install-sh mkinstalldirs \
+ pyqt-am-preproc.py templates-ui-dialog templates-ui-mainwin \
+ pyqt.png
+templateName = pyqt
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/python/app_templates/pyqt/app-Makefile.am b/languages/python/app_templates/pyqt/app-Makefile.am
new file mode 100644
index 00000000..78df3505
--- /dev/null
+++ b/languages/python/app_templates/pyqt/app-Makefile.am
@@ -0,0 +1,14 @@
+
+EXEEXT=
+
+pyui_files= documentdetails.py
+
+%.py : %.ui
+ pyuic $< >$@
+
+
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.py documentdetails.ui
+
+%{APPNAMELC}$(EXEEXT): $(pyui_files)
+ echo "Done"
diff --git a/languages/python/app_templates/pyqt/app-autogen.sh b/languages/python/app_templates/pyqt/app-autogen.sh
new file mode 100644
index 00000000..b380ddfd
--- /dev/null
+++ b/languages/python/app_templates/pyqt/app-autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+echo "Running aclocal"
+aclocal
+echo "Running autoconf"
+autoconf
+echo "Processing Makefile.am"
+python pyqt-am-preproc.py
+echo "Running automake"
+automake
+echo "Done."
diff --git a/languages/python/app_templates/pyqt/app-configure.ac b/languages/python/app_templates/pyqt/app-configure.ac
new file mode 100644
index 00000000..62903c0f
--- /dev/null
+++ b/languages/python/app_templates/pyqt/app-configure.ac
@@ -0,0 +1,32 @@
+
+AC_INIT
+AM_INIT_AUTOMAKE(testprog,[0.1])
+
+AC_PROG_MAKE_SET
+
+# python interpreter check
+AC_PATH_PROG([PYTHON],[python])
+if test -z "${PYTHON}" ; then
+ AC_MSG_ERROR([you need Python to use this program])
+fi
+
+# PyQT check
+AC_MSG_CHECKING([whether PyQT can be used by Python])
+pyqt_present=no
+cat >pyqttest.py <<END
+import qt
+END
+${PYTHON} pyqttest.py >/dev/null 2>&1 && pyqt_present=yes
+AC_MSG_RESULT([$pyqt_present])
+
+# pyuic check
+AC_PATH_PROG([PYUIC],[pyuic])
+if test -z "${PYUIC}" ; then
+ AC_MSG_ERROR([cannot find pyuic (part of the PyQT package)])
+fi
+AC_SUBST([PYUIC])
+AC_SUBST([PYTHON])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/languages/python/app_templates/pyqt/app.kdevelop b/languages/python/app_templates/pyqt/app.kdevelop
new file mode 100644
index 00000000..a8fb1726
--- /dev/null
+++ b/languages/python/app_templates/pyqt/app.kdevelop
@@ -0,0 +1,81 @@
+<?xml version = '1.0'?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Python</primarylanguage>
+ <keywords>
+ <keyword>Python</keyword>
+ <keyword>qt</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activedir/>
+ </general>
+ <run>
+ <mainprogram>./%{APPNAMELC}.py</mainprogram>
+ </run>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.py" name="Python files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ </groups>
+ </kdevfileview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="py"/>
+ <type ext="ui"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/python/app_templates/pyqt/app.py b/languages/python/app_templates/pyqt/app.py
new file mode 100644
index 00000000..ede8dc54
--- /dev/null
+++ b/languages/python/app_templates/pyqt/app.py
@@ -0,0 +1,271 @@
+#!/usr/bin/env python
+
+#############################################################################
+# %{APPNAME} - PyQT application template for KDevelop
+#
+# Translated from C++ qmakeapp.cpp
+# (qmakeapp.cpp - Copyright (C) 1992-2002 Trolltech AS. All rights reserved.)
+#
+# This file is part of an example program for Qt. This example
+# program may be used, distributed and modified without limitation.
+#
+#############################################################################
+
+import sys
+import os.path
+from qt import *
+
+import documentdetails
+
+false = 0
+true = 1
+
+def load_QPixMap(fileName):
+ f = open(os.path.join(sys.path[0],fileName),"r")
+ result = QPixmap(f.readlines())
+ f.close()
+ return result
+
+class %{APPNAME}(QMainWindow):
+ """An application called %{APPNAME}."""
+
+ def __init__(self):
+ QMainWindow.__init__(self, None, "%{APPNAME}")
+ self.initIcons()
+ self.setup()
+ self.initPrinter()
+ self.initToolBar()
+ self.initMenu()
+ self.initMainWidget()
+ self.setCaption(self.appTitle)
+
+ def setup(self):
+
+ self.appTitle = "%{APPNAME} - PyQT Application Example"
+
+ self.menu = [
+ ('&File',
+ [('&New', self.slotNewFile),
+ ('&Open...', self.slotOpenFile, self.openIcon),
+ ('&Save', self.slotSaveFile, self.saveIcon),
+ ('Save &as...', self.slotSaveAs),
+ ('&Print...', self.slotPrint, self.printIcon),
+ ('&Edit details...', self.slotEditDetails),
+ (None,)]),
+ ('&Help',
+ [('&About', self.slotAbout),
+ ('About &QT', self.slotAboutQT),
+ (None, ),
+ ('What\'s this', self.slotWhatsThis)])
+ ]
+
+ self.toolbar = [
+ ("filetools", "file operations", "File Operations",
+ [("fileopen",
+ (self.openIcon, "open file", "Open File", self.slotOpenFile),
+ "<p>Click this button to open a <em>new file</em>. <br>" + \
+ "You can also select the <b>Open</b> command " + \
+ "from the <b>File</b> menu.</p>"),
+ ("filesave",
+ (self.saveIcon, "save file", "Save File", self.slotSaveFile),
+ "<p>Click this button to save the file you " + \
+ "are editing. You will be prompted for a file name.\n" + \
+ "You can also select the <b>Save</b> command " + \
+ "from the <b>File</b> menu.</p>"),
+ ("fileprint",
+ (self.printIcon, "print file", "Print File", self.slotPrint),
+ "Click this button to print the file you " + \
+ "are editing.\n You can also select the Print " + \
+ "command from the File menu."
+ )])]
+
+ self.fileName = ""
+
+
+ def initMainWidget(self):
+ self.editor = QTextEdit(self, "editor")
+ self.editor.setFocus()
+ self.setCentralWidget(self.editor)
+ self.statusBar().message("Ready", 2000)
+ self.resize(450,600)
+
+ def initPrinter(self):
+ self.printer = QPrinter()
+
+ def initIcons(self):
+ self.openIcon = QIconSet( load_QPixMap("fileopen.pyxpm"))
+ self.saveIcon = QIconSet( load_QPixMap("filesave.pyxpm"))
+ self.printIcon = QIconSet( load_QPixMap("fileprint.pyxpm"))
+
+ def initToolBar(self):
+
+ self.toolbars = {}
+ for (toolBarID, toolBarName, toolBarDescr, toolBarButtons) in self.toolbar:
+ self.toolbars[toolBarID] = QToolBar(self, toolBarName)
+ self.toolbars[toolBarID].setLabel(toolBarDescr)
+ for (buttonID, (buttonIcon, buttonName, buttonText, buttonSlot), whatsThisText) in toolBarButtons:
+ toolButton = QToolButton(buttonIcon, buttonText, "", buttonSlot, self.toolbars[toolBarID], buttonName)
+ QWhatsThis.add( toolButton, whatsThisText )
+ self.whatsThisButton = QWhatsThis.whatsThisButton(self.toolbars[toolBarID])
+
+
+ def initMenu(self):
+
+ for (menuName, subMenu) in self.menu:
+ menu = QPopupMenu(self)
+ self.menuBar().insertItem( menuName, menu )
+ for menuOption in subMenu:
+ if len(menuOption)==1:
+ menu.insertSeparator()
+ elif len(menuOption)==2:
+ menu.insertItem( menuOption[0], menuOption[1] )
+ elif len(menuOption)==3:
+ menu.insertItem( menuOption[2], \
+ menuOption[0], \
+ menuOption[1] )
+
+
+
+ def slotNewFile(self):
+ ed = %{APPNAME}()
+ ed.setCaption(self.appTitle)
+ ed.show()
+
+ def slotOpenFile(self):
+ fileName = str(QFileDialog.getOpenFileName("", "", self))
+ print fileName
+ if not fileName=="":
+ self.load(fileName)
+ else:
+ self.statusBar().message("Loading aborted", 2000)
+
+ def slotSaveFile(self):
+ if self.fileName=="":
+ self.saveAs()
+ return
+ self.save()
+
+
+ def slotSaveAs(self):
+ pass
+
+ def slotPrint(self):
+ margin = 10
+ pageno = 1
+ if self.printer.setup(self):
+ self.statusBar().message("Printing...");
+ p = QPainter()
+ if not p.begin(self.printer): return
+
+ p.setFont( self.editor.font() )
+ yPos = 0
+ fontMetrics = p.fontMetrics()
+ metrics = QPaintDeviceMetrics(self.printer)
+ for i in range(self.editor.lines()):
+ if margin + yPos > metrics.height() - margin:
+ pageNo += 1
+ self.statusBar().message("Printing (page " + pageNo + ")...")
+ self.printer.newPage()
+ yPos = 0
+ p.drawText( margin, margin+yPos, \
+ metrics.width(), \
+ fontMetrics.lineSpacing(), \
+ QPainter.ExpandTabs | QPainter.DontClip, \
+ self.editor.text(i) )
+ yPos += fontMetrics.lineSpacing()
+ p.end()
+ self.statusBar().message("Printing completed", 2000)
+ else:
+ self.statusBar().message("Printing aborted", 2000)
+
+ def slotClose(self):
+ pass
+
+ def slotQuit(self):
+ pass
+
+ def slotEditDetails(self):
+ docDet = documentdetails.documentDetails(self)
+ docDet.show()
+
+ def slotWhatsThis(self):
+ self.whatsThis()
+
+ def slotAbout(self):
+ QMessageBox.about(self, self.appTitle, \
+ "This example demonstrates the simple use of\n" + \
+ "QMainWindow, QMenuBar and QToolBar using QT\n" + \
+ "and Python.")
+
+ def slotAboutQT(self):
+ QMessageBox.aboutQt(self, self.appTitle)
+
+ def load(self,fileName):
+ f = open(fileName,"r")
+ if f:
+ self.editor.setText( f.read() )
+ self.editor.setModified(false)
+ self.setCaption(fileName)
+ self.statusBar().message("Loaded document " + fileName, 2000)
+ self.fileName = fileName
+ else:
+ self.statusBar().message("Could not load " + fileName, 5000)
+ return
+
+ def saveAs(self):
+ fileName = str(QFileDialog.getSaveFileName(None, None, self))
+ if fileName!="":
+ self.fileName = fileName
+ self.save()
+ else:
+ self.statusBar().message("Saving aborted", 2000)
+
+ def save(self):
+ if self.fileName=="":
+ self.saveAs()
+ return
+ text = str(self.editor.text())
+ try:
+ f = open(self.fileName, "w")
+ f.write(text)
+ except:
+ self.statusBar().message("Could not write to " + self.fileName)
+ f.close()
+ return
+ f.close()
+ self.editor.setModified(false)
+ self.setCaption(self.fileName)
+ self.statusBar().message( "File " + self.fileName + " saved", 2000)
+
+ def closeEvent(self, closeEvent):
+ if not self.editor.isModified():
+ closeEvent.accept()
+ return
+
+ yesNoCancel = QMessageBox.information(self, self.appTitle,
+ "Do you want to save the changes\n" + \
+ "to the document?", \
+ "Yes", "No", "Cancel",
+ 0, 1)
+ if yesNoCancel == 0:
+ self.save()
+ closeEvent.accept()
+ elif yesNoCancel == 1:
+ closeEvent.accept()
+ else:
+ closeEvent.ignore()
+
+
+
+
+def main(args):
+ app=QApplication(args)
+ mainWindow = %{APPNAME}()
+ mainWindow.show()
+ app.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
+ app.exec_loop()
+
+
+
+if __name__ == "__main__":
+ main(sys.argv)
diff --git a/languages/python/app_templates/pyqt/documentdetails.ui b/languages/python/app_templates/pyqt/documentdetails.ui
new file mode 100644
index 00000000..130d30ef
--- /dev/null
+++ b/languages/python/app_templates/pyqt/documentdetails.ui
@@ -0,0 +1,80 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>documentDetails</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>documentDetails</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>561</width>
+ <height>555</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Document Details</string>
+ </property>
+ <vbox>
+ <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>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Enter details about this document below.</string>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Author</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>lineEdit1</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Company</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<includes>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/python/app_templates/pyqt/fileopen.pyxpm b/languages/python/app_templates/pyqt/fileopen.pyxpm
new file mode 100644
index 00000000..e90fcfee
--- /dev/null
+++ b/languages/python/app_templates/pyqt/fileopen.pyxpm
@@ -0,0 +1,19 @@
+ 16 13 5 1
+. c #040404
+# c #808304
+a c None
+b c #f3f704
+c c #f3f7f3
+aaaaaaaaa...aaaa
+aaaaaaaa.aaa.a.a
+aaaaaaaaaaaaa..a
+a...aaaaaaaa...a
+.bcb.......aaaaa
+.cbcbcbcbc.aaaaa
+.bcbcbcbcb.aaaaa
+.cbcb...........
+.bcb.#########.a
+.cb.#########.aa
+.b.#########.aaa
+..#########.aaaa
+...........aaaaa
diff --git a/languages/python/app_templates/pyqt/fileprint.pyxpm b/languages/python/app_templates/pyqt/fileprint.pyxpm
new file mode 100644
index 00000000..26f3ca9d
--- /dev/null
+++ b/languages/python/app_templates/pyqt/fileprint.pyxpm
@@ -0,0 +1,21 @@
+ 16 14 6 1
+. c #000000
+# c #848284
+a c #c6c3c6
+b c #ffff00
+c c #ffffff
+d c None
+ddddd.........dd
+dddd.cccccccc.dd
+dddd.c.....c.ddd
+ddd.cccccccc.ddd
+ddd.c.....c....d
+dd.cccccccc.a.a.
+d..........a.a..
+.aaaaaaaaaa.a.a.
+.............aa.
+.aaaaaa###aa.a.d
+.aaaaaabbbaa...d
+.............a.d
+d.aaaaaaaaa.a.dd
+dd...........ddd
diff --git a/languages/python/app_templates/pyqt/filesave.pyxpm b/languages/python/app_templates/pyqt/filesave.pyxpm
new file mode 100644
index 00000000..3f28c25d
--- /dev/null
+++ b/languages/python/app_templates/pyqt/filesave.pyxpm
@@ -0,0 +1,19 @@
+ 14 14 4 1
+. c #040404
+# c #808304
+a c #bfc2bf
+b c None
+..............
+.#.aaaaaaaa.a.
+.#.aaaaaaaa...
+.#.aaaaaaaa.#.
+.#.aaaaaaaa.#.
+.#.aaaaaaaa.#.
+.#.aaaaaaaa.#.
+.##........##.
+.############.
+.##.........#.
+.##......aa.#.
+.##......aa.#.
+.##......aa.#.
+b.............
diff --git a/languages/python/app_templates/pyqt/install-sh b/languages/python/app_templates/pyqt/install-sh
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pyqt/install-sh
diff --git a/languages/python/app_templates/pyqt/missing b/languages/python/app_templates/pyqt/missing
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pyqt/missing
diff --git a/languages/python/app_templates/pyqt/mkinstalldirs b/languages/python/app_templates/pyqt/mkinstalldirs
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pyqt/mkinstalldirs
diff --git a/languages/python/app_templates/pyqt/pyqt b/languages/python/app_templates/pyqt/pyqt
new file mode 100644
index 00000000..24b1b72f
--- /dev/null
+++ b/languages/python/app_templates/pyqt/pyqt
@@ -0,0 +1,10 @@
+# KDE Config file
+[General]
+Name=Python Qt application
+Name[fr]=Une application Qt avec PYTHON
+Icon=pyqt.png
+Category=Python
+Comment=This generates an application framework using Python and Qt
+Comment[fr]=Gnre un squelette d'application Qt dans le language PYTHON.
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.py
diff --git a/languages/python/app_templates/pyqt/pyqt-am-preproc.py b/languages/python/app_templates/pyqt/pyqt-am-preproc.py
new file mode 100644
index 00000000..dda5e2c3
--- /dev/null
+++ b/languages/python/app_templates/pyqt/pyqt-am-preproc.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python
+
+# Preprocess Makefile.am for PyQT project
+# Julian Rockey 2002
+
+# TODO:
+# Test real_lines properly
+# Process Makefile.am's in sub-directories
+
+from __future__ import generators
+import sys
+import re
+
+# function to convert list of lists with continuation chars
+# (bashslashes) to list of actual lines
+def real_lines(m):
+ while len(m)>0:
+ result = ""
+ if m[0][-1]=='\\':
+ while (len(m)>0 and m[0][-1]=='\\'):
+ result += m[0][:-1]
+ m=m[1:]
+ if len(m)>0:
+ result += m[0]
+ m=m[1:]
+ yield result
+
+# check for arguments
+if len(sys.argv)<2:
+ makefile_am = "Makefile.am"
+else:
+ makefile_am = sys.argv[1]
+
+
+# read in Makefile.am
+f = open(makefile_am,"r")
+mf = f.readlines()
+f.close()
+
+# parse for variables
+re_variable = re.compile("^(#kdevelop:[ \t]*)?([A-Za-z][A-Za-z0-9_]*)[ \t]*:?=[ \t]*(.*)$")
+variables = {}
+
+
+for l in real_lines(mf):
+ m = re_variable.match(l)
+ if m!=None:
+ (nowt, lhs, rhs) = m.groups()
+ variables[lhs]=rhs
+
+# look for app sources
+for (var,data) in variables.items():
+ spl = var.split("_",1)
+ spl.append("")
+ (prefix,primary) = (spl[0], spl[1])
+ if primary=="PROGRAMS":
+ target=data
+ if variables.has_key(target + "_SOURCES"):
+ sources = variables[target+"_SOURCES"].split()
+
+# change .ui into .py
+py_sources = []
+for s in sources:
+ py_sources.append(re.sub("\.ui$",".py",s))
+
+# replace dependencies of main target with list of .py sources
+# FIXME escape target
+re_maintarget = re.compile("(" + target + ".*?:).*")
+out = []
+for l in mf:
+ m = re_maintarget.match(l)
+ if m!=None:
+ (tar,)=m.groups()
+ l=tar + " " + " ".join(py_sources) + "\n"
+ out.append(l)
+
+# backup existing Makefile.am
+f = open(makefile_am + "~", "w")
+f.writelines(mf)
+f.close()
+
+# write file
+f = open(makefile_am, "w")
+f.writelines(out)
+f.close()
diff --git a/languages/python/app_templates/pyqt/pyqt.kdevtemplate b/languages/python/app_templates/pyqt/pyqt.kdevtemplate
new file mode 100644
index 00000000..bffbcd8c
--- /dev/null
+++ b/languages/python/app_templates/pyqt/pyqt.kdevtemplate
@@ -0,0 +1,168 @@
+# KDE Config File
+[General]
+Name=Python Qt application
+Name[ca]=Aplicació per a Qt en Python
+Name[da]=Python Qt program
+Name[de]=Python/Qt-Anwendung
+Name[el]=Εφαρμογή Python Qt
+Name[es]=Aplicación Qt en Python
+Name[et]=Pythoni Qt rakendus
+Name[eu]=Python Qt aplikazioa
+Name[fa]=کاربرد پیتون Qt
+Name[fr]=Application Qt Python
+Name[ga]=Feidhmchlár Qt Python
+Name[gl]=Aplicación Qt en Python
+Name[hu]=Python/Qt-alapú alkalmazás
+Name[it]=Applicazione Qt Python
+Name[ja]=Python Qt アプリケーション
+Name[nds]=Python Qt-Programm
+Name[ne]=पाइथोन क्यू टी अनुप्रयोग
+Name[nl]=Python Qt-toepassing
+Name[pl]=Program Qt w Pythonie
+Name[pt]=Aplicação Qt em Python
+Name[pt_BR]=Aplicação Qt em Python
+Name[ru]=Приложение Qt на Python
+Name[sk]=Python Qt aplikácia
+Name[sr]=Python-Qt програм
+Name[sr@Latn]=Python-Qt program
+Name[sv]=Python Qt-program
+Name[tr]=Python Qt Uygulaması
+Name[zh_CN]=Python Qt 应用程序
+Name[zh_TW]=Python Qt 應用程式
+Icon=pyqt.png
+Category=Python
+Comment=This generates an application framework using Python and Qt
+Comment[ca]=Genera una infraestructura d'aplicació usant Python i Qt
+Comment[da]=Dette genererer et programskelet ved brug af Python og Qt
+Comment[de]=Hiermit wird ein Anwendungsgerüst unter Verwendung von Python und Qt erstellt
+Comment[el]=Αυτό δημιουργεί ένα πλαίσιο εφαρμογής χρησιμοποιώντας τις Python και Qt
+Comment[es]=Genera una infraestructura de aplicación que usa Python y Qt
+Comment[et]=Rakenduse raamistiku loomine Pythoni ja Qt abil
+Comment[eu]=Honek Python eta Qt darabiltzan aplikazioen lan-marko bat sortzen du
+Comment[fa]=یک چارچوب کاربرد با استفاده از پیتون و Qt تولید می‌کند
+Comment[fr]=Génère une infrastructure d'application utilisant Python et Qt
+Comment[ga]=Cruthaíonn sé seo creatlach feidhmchláir le Python agus Qt
+Comment[gl]=Isto xera un contorno de traballo para unha aplicación usando Python e Qt
+Comment[hu]=Létrehoz egy alkalmazás-keretrendszert Python nyelven, a Qt felhasználásával
+Comment[it]=Genera l'infrastruttura applicativa usando Python e Qt
+Comment[ja]=Python と Qt を使ってアプリケーションフレームワークを作成します
+Comment[nds]=Dit stellt mit Python un Qt en Programmrahmenwark op.
+Comment[ne]=यसले पाइथोन र क्यू टी प्रयोग गरेर अनुप्रयोग फ्रेमवर्क उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een toepassingsframework met behulp van Python en Qt
+Comment[pl]=Generuje szablon programu używającego Pythona i Qt
+Comment[pt]=Isto cria a plataforma de uma aplicação que usa o Python e o Qt
+Comment[pt_BR]=Isto cria a plataforma de uma aplicação que usa o Python e o Qt
+Comment[ru]=Создание приложения Qt на Python
+Comment[sk]=Vygeneruje aplikačný framework používajúci Python a Qt
+Comment[sr]=Прави радни оквир програма користећи Python и Qt
+Comment[sr@Latn]=Pravi radni okvir programa koristeći Python i Qt
+Comment[sv]=Detta skapar ett programramverk med användning av Python och Qt
+Comment[tr]=Bu Python ve Qt kullanan bir uygulama çatısı yaratır.
+Comment[zh_CN]=这将生成一个使用 Python 和 Qt 的应用程序框架
+Comment[zh_TW]=產生一個使用 Python 與 Qt 的應用程式框架
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.py
+Archive=pyqt.tar.gz
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.py
+Dest=%{dest}/%{APPNAMELC}.py
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{src}/documentdetails.ui
+Dest=%{dest}/documentdetails.ui
+
+[FILE4]
+Type=install
+Source=%{src}/app-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE5]
+Type=install
+Source=%{src}/app-configure.ac
+Dest=%{dest}/configure.ac
+
+[FILE6]
+Type=install
+Source=%{src}/app-autogen.sh
+Dest=%{dest}/autogen.sh
+
+[FILE7]
+Type=install
+Source=%{src}/mkinstalldirs
+Dest=%{dest}/mkinstalldirs
+
+[FILE8]
+Type=install
+Source=%{src}/missing
+Dest=%{dest}/missing
+
+[FILE9]
+Type=install
+Source=%{src}/install-sh
+Dest=%{dest}/install-sh
+
+[FILE10]
+Type=install
+Source=%{src}/pyqt-am-preproc.py
+Dest=%{dest}/pyqt-am-preproc.py
+
+[FILE11]
+Type=install
+Source=%{src}/fileopen.pyxpm
+Dest=%{dest}/fileopen.pyxpm
+
+[FILE12]
+Type=install
+Source=%{src}/fileprint.pyxpm
+Dest=%{dest}/fileprint.pyxpm
+
+[FILE13]
+Type=install
+Source=%{src}/filesave.pyxpm
+Dest=%{dest}/filesave.pyxpm
+
+[MSG]
+Type=message
+Comment=A Python Qt application was created in %{dest}
+Comment[ca]=Una aplicació per a Qt en Python ha estat creada en %{dest}
+Comment[da]=Et Python Qt program blev oprettet i %{dest}
+Comment[de]=Eine Python/Qt-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Python Qt δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Qt en Python ha sido creada en %{dest}
+Comment[et]=Pythoni Qt rakendus loodi asukohta %{dest}
+Comment[eu]=Python eta Qt darabiltzan aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد پیتون Qt در %{dest} ایجاد شد
+Comment[fr]=Une application Qt Python a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár Python Qt i %{dest}
+Comment[gl]=Creouse unha aplicación Qt en Python en %{dest}
+Comment[hu]=Létrejött egy Python/Qt-alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Qt Python in %{dest}
+Comment[ja]=Python Qt アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Python-Qt-Programm opstellt.
+Comment[ne]=पाइथोन क्यू टी अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Python Qt-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program używający Pythona i Qt został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação Qt em Python em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação Qt em Python em %{dest}
+Comment[ru]=Приложение Qt на Python создано в %{dest}
+Comment[sk]=Python Qt aplikácia bola vytvorená v %{dest}
+Comment[sr]= Python-Qt програм је направљен у %{dest}
+Comment[sr@Latn]= Python-Qt program je napravljen u %{dest}
+Comment[sv]=Ett Python Qt-program skapades i %{dest}
+Comment[tr]=Bir Python Qt uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个 Python Qt 应用程序
+Comment[zh_TW]=一個 Python Qt 應用程式已建立於 %{dest}
diff --git a/languages/python/app_templates/pyqt/pyqt.png b/languages/python/app_templates/pyqt/pyqt.png
new file mode 100644
index 00000000..207b942f
--- /dev/null
+++ b/languages/python/app_templates/pyqt/pyqt.png
Binary files differ
diff --git a/languages/python/app_templates/pyqt/templates-ui-dialog b/languages/python/app_templates/pyqt/templates-ui-dialog
new file mode 100644
index 00000000..fc2aefce
--- /dev/null
+++ b/languages/python/app_templates/pyqt/templates-ui-dialog
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/python/app_templates/pyqt/templates-ui-mainwin b/languages/python/app_templates/pyqt/templates-ui-mainwin
new file mode 100644
index 00000000..854da009
--- /dev/null
+++ b/languages/python/app_templates/pyqt/templates-ui-mainwin
@@ -0,0 +1,436 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QMainWindow">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <action name="fileSaveAsAction"/>
+ <separator/>
+ <action name="filePrintAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="editUndoAction"/>
+ <action name="editRedoAction"/>
+ <separator/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <action name="editPasteAction"/>
+ <separator/>
+ <action name="editFindAction"/>
+ </item>
+ <item text="&amp;Help" name="helpMenu">
+ <action name="helpContentsAction"/>
+ <action name="helpIndexAction"/>
+ <separator/>
+ <action name="helpAboutAction"/>
+ </item>
+</menubar>
+<toolbars>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileNewAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image0</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileOpenAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image1</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Open...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+O</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image2</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Save As</string>
+ </property>
+ <property name="menuText">
+ <string>Save &amp;As...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>filePrintAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image3</iconset>
+ </property>
+ <property name="text">
+ <string>Print</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Print...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+P</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editUndoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image4</iconset>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Undo</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Z</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editRedoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image5</iconset>
+ </property>
+ <property name="text">
+ <string>Redo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Redo</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Y</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCutAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image6</iconset>
+ </property>
+ <property name="text">
+ <string>Cut</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Cut</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+X</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCopyAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image7</iconset>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ <property name="menuText">
+ <string>C&amp;opy</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editPasteAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image8</iconset>
+ </property>
+ <property name="text">
+ <string>Paste</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Paste</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+V</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editFindAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image9</iconset>
+ </property>
+ <property name="text">
+ <string>Find</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Find...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+F</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpContentsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Contents</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Contents...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpIndexAction</cstring>
+ </property>
+ <property name="text">
+ <string>Index</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Index...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutAction</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;About</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+</actions>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="721">789cedd2b10ac2301405d03d5ff148b62056035241fc04c5511087f425a2432b681d44fc777ba329d6b47fe07d19dee50cc9904cd376b3229d896b6deb13131fed85b4bb95e57db75f3e8434869a93d3548e841c13d3fa5c79ecaad9d52404b540351e83caa833c6a03ad4798e41f5a86c30a816f510126ee94d14d52611fb8e2ad49070a4445ca4447ca4446ca444da07fecac7ffd2956ebe64f81ff4c873215e0583a9b0</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data>
+ </image>
+ <image name="image2">
+ <data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b13082709340dc644310047193c1dcc424d314883958015846190b80ca24262a2721012087349964a030ba69c9c9303d403e9132087b68279388ecff4414193440948c32aa71d86470bb80863258a21b9a0eb0a7905a6b2e006d59a436</data>
+ </image>
+ <image name="image3">
+ <data format="XPM.GZ" length="2509">789c7d944973db461085effa152cf54d956a932089a55239c896572d96bcc4b253390033186ea2488aa416a7f2dfd3db0cbd44e6d340f8f8def43406209e1c742ecf4f3b074ff6d69b7a33711d37ae6f3a077e3b9f3ffcf5f71fffeced675987fecab293edffb6b77fb1e9b8ced9e2ba65c08c00baf2117e2f5c86d02d99e196b9d7ed963df53f2ab3c47789258fa7c26564688d4bf30f23673de113e6ac1719ae9459e27f4d5c893f17ae126f8d2be3ebc87d9dff4e3904f317ccfd5ef23f28b3c45f26963c7e510ec1fc9570157dd81857967f883c90cd8635f3208b8c0b6596f863e17a500fd597fe8744c35afc1be33aef8bff5ad9b5e637cc7993f7f346fca571637c1fb9d0f99f9543b07ab2df453ff9723d0551a1f3d791cb8170573904f3a5bf725034e66f133be96fa44c1246799e4a573495e461a29cfcbbc8e64f8d9df96564f5519e876a1019668975fda05c593d5c25d67a6f945d6ef3bdb08b3ed491eba1e467c6561fcf229bff4ad9b5c6c7ccf530fa8089bdf8136596703fb1f800c23ee5ff548e3e7a636f3c8ddc68bd8ab91926066596b05c5fe359c285b2cf8de5f7ed7296f050b825d6f74763dc1a0f227bcdbf60f679e29789353f5666093f4facfe857208e63f156e93df8bdc16c223e358ff28b2f939735b240eca2ce1678983f0a57208e6bf150ec96f8d83f127e650b084cf85e5a32fdf9d10b0c6c6e44835c9631dfd9ff235b618925ad1e89779278af5750df7681ea40316d8111eef876a79ad977ae773d8257ec8efead629fdeb3ca4ba9ae6e11fcdbbef6aa72b7934ef695702eddf4e631a13d2f4c73cd599e115f533a639bbc173e6788d0b5cf23a314fe915dee01a37df698bb77887f7f8805ff190e64c342fb59fe2333ca2e373d30b7c89aff035bec1634a9e904ef1417faf78866ff1fc275de03b7c4fa3a1553e50fd8f78a2ef0bfcf43fe973bcc4cff805bb74d6a3de0e31b37c9f561fe090c6583a19612e9d1dd179417db1575237191eeafb172b9cd22a7d409a7bcc8f0c4e68f01900ef44090db8547f4ee9a966456732445083078f779a8756dfdf52f19b1cd59c699254e31c46d0703f30b6fa5239a5d27faabc22b78409de838316bdd51fd1377730a531a12bd363c949aa3d936f1a6821e8fda566aef8fe011d612eba860569495a9196721ebe7d7ed0c30dac491b58d2bd21c116b634bf25ddd2fd9dd9f3f6efef7bff0111915e41</data>
+ </image>
+ <image name="image4">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b13103711c4b530b1308270f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020011bc73cc</data>
+ </image>
+ <image name="image5">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b13105719c4b530b1308270f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700f7fd8672</data>
+ </image>
+ <image name="image6">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53002abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fbd07ccb</data>
+ </image>
+ <image name="image7">
+ <data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da8214c44f505c0ae26226b1e8a20a5a1722febb9924a5af58c19b40e77238a1842431ecb66b881371afb03a2b5027bc41ac1f65f9dc1f562f11a52998bd80793411d114146cae9723cfd2cc7266c395ea9aa75c15d74c65aad05c35d79c727215b91636f6d860c689f40910b4e92147d840b3be39d8416d877c860eb9af478d23919c4b8a7a0ed68eb628e4a04521c7fd46c07138e47448dbf1f32fc767e8d43735741af287d3ced83b782fc5075b18a5a5</data>
+ </image>
+ <image name="image8">
+ <data format="XPM.GZ" length="736">789c7d92d10a82301486eff714c3dd49649984103d42d165105dcce3465d58507611d1bbb773d674aed93f85fd7efb183ab394ef771b9e66ecdecaf60c1c4ef2c6d3fad134cfc371fd62499e7373957c9e4c5832e5c0b7d78bc2b9307331a36055ae960556c05a16656e69e5aaa5355658c202965825566d62176b57b5a64da3f188c084841e0a29a5e831910ef8885e4854501922e8a6b923586a176a8e40051ec1e63b7d0267387c6738424775091d653f98565a858e26c110447107d1886350d4a1c41c3dea7864e87c37f3ce47fc3aee7cd5207ffe90f78a7d0007c6c175</data>
+ </image>
+ <image name="image9">
+ <data format="XPM.GZ" length="2798">789cb5d5594f1b491007f0773e8545bda1d53ff81a7bb4da07830103b603b92059edc34cf78c0ff0812f3051befb5677554f56c24428d2aa78e0a7aeaeea6be0dd41e9f6aa573a78b7b75c25ab91299961b2281dd8f564b2fdfb9fbfbeefed572a25fe291f46a5cafe1f7bfbd7ab9229f567d3cc81fa0caa945d785f78c72ebc2f9dabb10bef9e73ade2c21913e77ae2c28f2fc48d6a947ab7c4b169d6bc8f9ca3aa0b3fbfaf4e35ff4c5cccdf8813db34de1def34e4c3881b3cc38fb7d5a918f78525ff46dcaca9576a23a627715cd3f53e8a131b7b63edecba69fd8d3af41b1496fa6d7153f78f86b8a86f0bcbfe9ec5493d16cfc5695dfad34c6d651ca9f7cffdbd173743fd441cd64f0f85a5fe489c6a3fd4d5613c0d4eeade43b189747c1b2ce3683abbeebadf5a702ae343716c743d53313f1febc7bfa843bf1371581f9d06ebf8581df257e2b01eba57675a5fea19177e7c109cfa712271aceba58938b13a6ec4a13fba62ee27f53fa9b51fe5c1ba7f7f1f71cd85f7545cdcf73ad8f8ef137762de9fd4ef898b7e51b0d63f52877e65b10de3c785657eacced4fe7b77b763236fab36fa3e1ec5a9d5f341b0e4d3526c42bd4ab0eee7505cf4fb28ce1aea6fc146fa7f76e6d3e115fafa5d7112cebf254eeb328e6a70967b9f8b437fba13db4ceb2fc5453f7f5ffcfac2795f046bbd0fe2a2df486c42bd2bb18dd46375e89f89b99fccf7ef2dadbbf0eea8add6bf16db4cbd1067b9de8fafc7b7a1ef13cf6213e50defadd846b9acff569c3574fe833ad7fa5fc57943cfdb9f9f894cd8cf93982748fdb9386f64dee4df97c978ff52ef4c9d69ff9938cff53cfdf7ec5627f5ae576f8fdfcf0721410ac391c222fb753e720c30c408638e3bdcf31c7a3d9fb3279862c631c70316586285f5ae1e727fd8e091f3e678c216cf68e108c768e3e4957ccb2b39e5fc337470ce71814b74d143ffe59ae4ff01ae7825d7f8c0753fe213d7ff8c2ffcfb0deccefc016ef115df380e51460555d4504784069aafe48f798f87885126a04a4409a564c8be92bfc115655cb94c395a34409d8634a231afe7c58ee5ef35d7bae3dc2eddd384a634a339c7032d90efcce7bba225ad38525aa3461b7ae478da75037a5f2758d196525ec93359aedde23882a563ae95edc8cf90529b4ee894c6bcf2844f66e2ce1239cf9afc7755c5fbc9b8479fdabcc71b3aa38ee4d039d7b9a04b1ecb5ebe677ea1964712ead2f9cf8aac1ecfd10a6f79ffdc7b4d7dee92bcfd7be1bd5ff29ccedbbf2f90dbfbfffefdfef873ef5fce01d04a</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>fileNewAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileNew()</slot>
+ </connection>
+ <connection>
+ <sender>fileOpenAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileOpen()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAsAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileSaveAs()</slot>
+ </connection>
+ <connection>
+ <sender>filePrintAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>filePrint()</slot>
+ </connection>
+ <connection>
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection>
+ <sender>editUndoAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editUndo()</slot>
+ </connection>
+ <connection>
+ <sender>editRedoAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editRedo()</slot>
+ </connection>
+ <connection>
+ <sender>editCutAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editCut()</slot>
+ </connection>
+ <connection>
+ <sender>editCopyAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editCopy()</slot>
+ </connection>
+ <connection>
+ <sender>editPasteAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editPaste()</slot>
+ </connection>
+ <connection>
+ <sender>editFindAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editFind()</slot>
+ </connection>
+ <connection>
+ <sender>helpIndexAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpIndex()</slot>
+ </connection>
+ <connection>
+ <sender>helpContentsAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpContents()</slot>
+ </connection>
+ <connection>
+ <sender>helpAboutAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpAbout()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>fileNew()</slot>
+ <slot>fileOpen()</slot>
+ <slot>fileSave()</slot>
+ <slot>fileSaveAs()</slot>
+ <slot>filePrint()</slot>
+ <slot>fileExit()</slot>
+ <slot>editUndo()</slot>
+ <slot>editRedo()</slot>
+ <slot>editCut()</slot>
+ <slot>editCopy()</slot>
+ <slot>editPaste()</slot>
+ <slot>editFind()</slot>
+ <slot>helpIndex()</slot>
+ <slot>helpContents()</slot>
+ <slot>helpAbout()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/python/app_templates/python.appwizard b/languages/python/app_templates/python.appwizard
new file mode 100644
index 00000000..82c13adf
--- /dev/null
+++ b/languages/python/app_templates/python.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=pythonhello,pytk,pyqt
diff --git a/languages/python/app_templates/pythonhello/.kdev_ignore b/languages/python/app_templates/pythonhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/.kdev_ignore
diff --git a/languages/python/app_templates/pythonhello/Makefile.am b/languages/python/app_templates/pythonhello/Makefile.am
new file mode 100644
index 00000000..3d66b1a7
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/Makefile.am
@@ -0,0 +1,15 @@
+dataFiles = app.py app.kdevelop pythonhello.png
+templateName = pythonhello
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/python/app_templates/pythonhello/app.kdevelop b/languages/python/app_templates/pythonhello/app.kdevelop
new file mode 100644
index 00000000..2c494d6a
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/app.kdevelop
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Python</primarylanguage>
+ <keywords>
+ <keyword>Python</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>%{APPNAMELC}.py</mainprogram>
+ </run>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.py" name="Python files" />
+ </groups>
+ </kdevfileview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="py"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/python/app_templates/pythonhello/app.py b/languages/python/app_templates/pythonhello/app.py
new file mode 100644
index 00000000..3257ce62
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/app.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+def main():
+ print 'Hello world!'
+
+main()
+
diff --git a/languages/python/app_templates/pythonhello/pythonhello b/languages/python/app_templates/pythonhello/pythonhello
new file mode 100644
index 00000000..f1a4f86b
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/pythonhello
@@ -0,0 +1,12 @@
+# KDE Config File
+[General]
+Name=Simple Python script
+Name[fr]=Un simple script de test "Hello world"
+Name[de]=Ein einfaches Python-Script "Hello world"
+Icon=pythonhello.png
+Category=Python
+Comment=This generates a simplistic "Hello world" program in Python
+Comment[fr]=Gnre un simple script de test du type "Hello world" dans le language PYTHON.
+Comment[de]=Es wird ein einfaches "Hello world"-Programm in Python erzeugt.
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.py
diff --git a/languages/python/app_templates/pythonhello/pythonhello.kdevtemplate b/languages/python/app_templates/pythonhello/pythonhello.kdevtemplate
new file mode 100644
index 00000000..6d52cf8a
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/pythonhello.kdevtemplate
@@ -0,0 +1,107 @@
+# KDE Config File
+[General]
+Name=Simple Python script
+Name[ca]=Simple script en Python
+Name[da]=Simpelt Python script
+Name[de]=Einfaches Python-Skript
+Name[el]=Απλό σενάριο Python
+Name[es]=Guión sencillo en Python
+Name[et]=Lihtne Pythoni skript
+Name[eu]=Python script sinplea
+Name[fa]=دست‌نوشتۀ سادۀ پیتون
+Name[fr]=Script Python simple
+Name[ga]=Script shimplí Python
+Name[gl]=Script sinxelo en Python
+Name[hu]=Egyszerű Python-szkript
+Name[it]=Semplice script Python
+Name[ja]=簡単な Python スクリプト
+Name[nds]=Eenfach Python-Skript
+Name[ne]=साधारण पाइथोन स्क्रिप्ट
+Name[nl]=Eenvoudig Python-script
+Name[pl]=Prosty skrypt w Pythonie
+Name[pt]=Programa simples em Python
+Name[pt_BR]=Programa simples em Python
+Name[ru]=Простой скрипт Python
+Name[sk]=Jednoduchý Python skript
+Name[sr]=Једноставна Python скрипта
+Name[sr@Latn]=Jednostavna Python skripta
+Name[sv]=Enkelt Python-skript
+Name[tr]=Basit Python betiği
+Name[zh_CN]=简单的 Python 脚本
+Name[zh_TW]=簡單的 Python 文稿
+Icon=pythonhello.png
+Category=Python
+Comment=This generates a simplistic "Hello world" program in Python
+Comment[ca]=Genera un simple programa de "Hello world" en Python
+Comment[da]=Dette genererer et simplistisk "Goddag verden" program i Python
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in Python
+Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα "Γεια σου κόσμε" σε Python
+Comment[es]=Genera un sencillo programa «Hola mundo» en Python
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Pythonis
+Comment[eu]=Honek "Kaixo mundua" programa sinple bat sortzen du Python lengoaian
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در پیتون تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Python
+Comment[gl]=Isto xera un programa sinxelo "Ola mundo" en Python
+Comment[hu]=Létrehoz egy egyszerű Hello world programot Python nyelven
+Comment[it]=Genera un semplice programma di "Hello world" in Python
+Comment[ja]=簡単な Hello world プログラムを Python で作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm mit Python op.
+Comment[ne]=यसले पाइथोनमा साधारण "हेल्लो वोल्ड" कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een eenvoudig "Hello World"-programma in Python
+Comment[pl]=Generuje prosty program "Witaj świecie" w Pythonie
+Comment[pt]=Isto gera um programa simples "Olá mundo" em Python
+Comment[pt_BR]=Isto gera um programa simples "Olá mundo" em Python
+Comment[ru]=Создание простой программы "Hello world" на Python
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Python
+Comment[sr]=Прави једноставан „Здраво свете“ програм у Python-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ program u Python-u
+Comment[sv]=Detta skapar ett förenklat "Hello world"-program i Python
+Comment[tr]=Bu, Python'da basit bir "Merhaba Dünya" programı yaratır.
+Comment[zh_CN]=这将生成一个简单的 Python 语言“Hello world”程序
+Comment[zh_TW]=產生一個 Python 的簡單 Hello world 程式
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.py
+Archive=pythonhello.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.py
+Dest=%{dest}/%{APPNAMELC}.py
+
+[MSG]
+Type=message
+Comment=A simple python script was created in %{dest}
+Comment[ca]=Un simple script en Python ha estat creat en %{dest}
+Comment[da]=Et simpelt python script blev oprettet i %{dest}
+Comment[de]=Ein einfaches Python-Skript wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό σενάριο python δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo programa en Python ha sido creado en %{dest}
+Comment[et]=Lihtne Pythoni skript loodi asukohta %{dest}
+Comment[eu]=Python programa sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک دست‌نوشتۀ سادۀ پیتون در %{dest} ایجاد شد
+Comment[fr]=Un script Python simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh script shimplí Python i %{dest}
+Comment[gl]=Creouse un script sinxelo en python en %{dest}
+Comment[hu]=Létrejött egy egyszerű Python-szkript itt: %{dest}
+Comment[it]=È stato creato un semplice script python in %{dest}
+Comment[ja]=簡単な python スクリプトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Python-Skript opstellt.
+Comment[ne]=साधारण पाइथोन स्क्रिप्ट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Python-script is aangemaakt in %{dest}
+Comment[pl]=Prosty skrypt w Pythonie został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples em Python em %{dest}
+Comment[pt_BR]=Foi criado um programa simples em Python em %{dest}
+Comment[ru]=Простой скрипт Python создан в %{dest}
+Comment[sk]=Jednoduchý Python skript bol vytvorený v %{dest}
+Comment[sr]=Једноставна python скрипта направљена је у %{dest}
+Comment[sr@Latn]=Jednostavna python skripta napravljena je u %{dest}
+Comment[sv]=Ett enkelt Python-skript skapades i %{dest}
+Comment[tr]=Basit bir python betiği %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 Python 语言脚本
+Comment[zh_TW]=一個簡單的 python 文稿框架已建立於 %{dest}
diff --git a/languages/python/app_templates/pythonhello/pythonhello.png b/languages/python/app_templates/pythonhello/pythonhello.png
new file mode 100644
index 00000000..c27ab24d
--- /dev/null
+++ b/languages/python/app_templates/pythonhello/pythonhello.png
Binary files differ
diff --git a/languages/python/app_templates/pytk/.kdev_ignore b/languages/python/app_templates/pytk/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/python/app_templates/pytk/.kdev_ignore
diff --git a/languages/python/app_templates/pytk/Makefile.am b/languages/python/app_templates/pytk/Makefile.am
new file mode 100644
index 00000000..0639ee15
--- /dev/null
+++ b/languages/python/app_templates/pytk/Makefile.am
@@ -0,0 +1,15 @@
+dataFiles = app.py app.kdevelop pytk.png
+templateName = pytk
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/python/app_templates/pytk/app.kdevelop b/languages/python/app_templates/pytk/app.kdevelop
new file mode 100644
index 00000000..044ea0b7
--- /dev/null
+++ b/languages/python/app_templates/pytk/app.kdevelop
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Python</primarylanguage>
+ <keywords>
+ <keyword>Python</keyword>
+ </keywords>
+ <ignoreparts/>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir></activedir>
+ </general>
+ <run>
+ <mainprogram>%{APPNAMELC}.py</mainprogram>
+ </run>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.py" name="Python files" />
+ </groups>
+ </kdevfileview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="py"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/python/app_templates/pytk/app.py b/languages/python/app_templates/pytk/app.py
new file mode 100644
index 00000000..39f4aa84
--- /dev/null
+++ b/languages/python/app_templates/pytk/app.py
@@ -0,0 +1,4 @@
+from Tkinter import *
+widget = Label(None, text='Hello world!')
+widget.pack()
+widget.mainloop()
diff --git a/languages/python/app_templates/pytk/pytk b/languages/python/app_templates/pytk/pytk
new file mode 100644
index 00000000..36a92c47
--- /dev/null
+++ b/languages/python/app_templates/pytk/pytk
@@ -0,0 +1,12 @@
+# KDE Config File
+[General]
+Name=Simple Python/Tkinter script
+Name[fr]=Un simple Python/Tkinter script de test "Hello world"
+Name[de]=Ein einfaches Python/Tkinter Script Hello world
+Icon=pytk.png
+Category=Python
+Comment=This generates a simplistic "Hello world" program in Python/Tkinter
+Comment[fr]=Gnre un simple script de test du type "Hello world" dans le language PYTHON/Tkinter.
+Comment[de]=Es wird ein einfaches "Hello world"-Programm in Python/Tkinter erzeugt.
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.py
diff --git a/languages/python/app_templates/pytk/pytk.kdevtemplate b/languages/python/app_templates/pytk/pytk.kdevtemplate
new file mode 100644
index 00000000..3756df01
--- /dev/null
+++ b/languages/python/app_templates/pytk/pytk.kdevtemplate
@@ -0,0 +1,107 @@
+# KDE Config File
+[General]
+Name=Simple Python/Tkinter script
+Name[ca]=Simple script en Python/Tkinter
+Name[da]=Simpelt Python/Tkinter script
+Name[de]=Einfaches Python/Tkinter-Skript
+Name[el]=Απλό σενάριο Python/Tkinter
+Name[es]=Guión sencillo en Python/Tkinter
+Name[et]=Lihtne Pythoni/Tkinteri skript
+Name[eu]=Python/Tkinter script sinplea
+Name[fa]=دست‌نوشتۀ سادۀ پیتون/Tkinter
+Name[fr]=Script Python / Tkinter simple
+Name[ga]=Script shimplí Python/Tkinter
+Name[gl]=Script sinxelo Python/Tkinter
+Name[hu]=Egyszerű Python/Tkinter-szkript
+Name[it]=Semplice script Python/Tkinter
+Name[ja]=簡単な Python/Tkinter スクリプト
+Name[nds]=Eenfach Python/Tkinter-Skript
+Name[ne]=साधारण पाइथोन/Tkinter स्क्रिप्ट
+Name[nl]=Eenvoudig Python/Tkinter-script
+Name[pl]=Prosty skrypt Python/Tkinter
+Name[pt]=Programa simples em Python/Tkinter
+Name[pt_BR]=Programa simples em Python/Tkinter
+Name[ru]=Простой скрипт Python/Tkinter
+Name[sk]=Jednoduchý Python/Tkinter skript
+Name[sr]=Једноставна Python/Tkinter скрипта
+Name[sr@Latn]=Jednostavna Python/Tkinter skripta
+Name[sv]=Enkelt Python/Tkinter-skript
+Name[tr]=Basit Python/Tkinter betiği
+Name[zh_CN]=简单的 Python/Tkinter 脚本
+Name[zh_TW]=簡單的 Python/Tkinter 文稿
+Icon=pytk.png
+Category=Python
+Comment=This generates a simplistic "Hello world" program in Python/Tkinter
+Comment[ca]=Genera un simple programa de "Hello world" en Python/Tkinter
+Comment[da]=Dette genererer et simplistisk "Goddag verden" program i Python/Tkinter
+Comment[de]=Erstellt ein einfaches "Hello World"-Programm in Python/Tkinter
+Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα "Γεια σου κόσμε" σε Python/Tkinter
+Comment[es]=Genera un sencillo programa «Hola mundo» en Python/Tkinter
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Pythonis/Tkinteris
+Comment[eu]="Kaixo mundua" programa sinple bat sortzen du Python/Tkinter-en
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در پیتون/Tkinter تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Python / Tkinter
+Comment[gl]=Isto xera un programa sinxelo "Ola mundo" en Python/Tkinter
+Comment[hu]=Létrehoz egy egyszerű Hello world programot Python/Tkinter nyelven
+Comment[it]=Genera un semplice programma di "Hello world" in Python/Tkinter
+Comment[ja]=簡単な Hello world プログラムを Python/Tkinter で作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm in Python/Tkinter op.
+Comment[ne]=यसले पाइथोन/Tkinter मा साधारण "हेल्लो वोल्ड" कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een eenvoudig "Hallo Wereld"-programma in Python/Tkinter
+Comment[pl]=Generuje prosty skrypt "Witaj świecie" w Pythonie/Tkinterze
+Comment[pt]=Isto gera um programa simples "Olá mundo" em Python/Tkinter
+Comment[pt_BR]=Isto gera um programa simples "Olá mundo" em Python/Tkinter
+Comment[ru]=Создание простой программы "Hello world" на Python и Tkinter
+Comment[sk]=Vygeneruje jednoduchý "Ahoj svet" program v Python/Tkinter
+Comment[sr]=Прави једноставан „Здраво свете“ у Python/Tkinter-у
+Comment[sr@Latn]=Pravi jednostavan „Zdravo svete“ u Python/Tkinter-u
+Comment[sv]=Detta skapar ett förenklat "Hello world"-program i Python/Tkinter
+Comment[tr]=Bu Python/Tkinter'da basit bir "Merhaba Dünya" programı yaratır.
+Comment[zh_CN]=这将生成一个简单的 Python/Tkinter 语言“Hello world”程序
+Comment[zh_TW]=產生一個簡單的 Python/Tkinter 的 Hello World 程式
+FileTemplates=py,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.py
+Archive=pytk.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.py
+Dest=%{dest}/%{APPNAMELC}.py
+
+[MSG]
+Type=message
+Comment=A simple Python/Tkinter script was created in %{dest}
+Comment[ca]=Un simple script en Python/Tkinter ha estat creat en %{dest}
+Comment[da]=Et simpelt Python/Tkinter script blev oprettet i %{dest}
+Comment[de]=Ein einfaches Python/Tkinter-Skript wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό σενάριο Python/Tkinter δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo guión en Python/Tkinter ha sido creado en %{dest}
+Comment[et]=Lihtne Pythoni/Tkinteri skript loodi asukohta %{dest}
+Comment[eu]=Python/Tkinter script sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک دست‌نوشتۀ سادۀ پیتون/Tkinter در %{dest} ایجاد شد
+Comment[fr]=Un script Python / Tkinter simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh script shimplí Python/Tkinter i %{dest}
+Comment[gl]=Creouse un script sinxelo Python/Tkinter en %{dest}
+Comment[hu]=Létrejött egy egyszerű Python/Tkinter-szkript itt: %{dest}
+Comment[it]=È stato creato un semplice script Python/Tkinter in %{dest}
+Comment[ja]=簡単な Python/Tkinter スクリプトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Python-/Tkinter-Skript opstellt.
+Comment[ne]=साधारण पाइथोन/Tkinter स्क्रिप्ट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Python/Tkinter-script is aangemaakt in %{dest}
+Comment[pl]=Prosty skrypt Python/Tkinter został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples em Python/Tkinter em %{dest}
+Comment[pt_BR]=Foi criado um programa simples em Python/Tkinter em %{dest}
+Comment[ru]=Простой скрипт Python/Tkinter создан в %{dest}
+Comment[sk]=Jednoduchý Python/Tkinter skript bol vytvorený v %{dest}
+Comment[sr]=Једноставна Python/Tkinter скрипта направљена је у %{dest}
+Comment[sr@Latn]=Jednostavna Python/Tkinter skripta napravljena je u %{dest}
+Comment[sv]=Ett enkelt Python/Tkinter-skript skapades i %{dest}
+Comment[tr]=Basit Python/Tkinter betiği %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 Python/Tkinter 脚本
+Comment[zh_TW]=一個簡單的 Python/Tkinter 文稿已建立於 %{dest}
diff --git a/languages/python/app_templates/pytk/pytk.png b/languages/python/app_templates/pytk/pytk.png
new file mode 100644
index 00000000..c8c28f8d
--- /dev/null
+++ b/languages/python/app_templates/pytk/pytk.png
Binary files differ
diff --git a/languages/python/doc/Makefile.am b/languages/python/doc/Makefile.am
new file mode 100644
index 00000000..5159f5f0
--- /dev/null
+++ b/languages/python/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = python.toc python_bugs.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA = python.index
+
diff --git a/languages/python/doc/python.toc b/languages/python/doc/python.toc
new file mode 100644
index 00000000..e5c67dda
--- /dev/null
+++ b/languages/python/doc/python.toc
@@ -0,0 +1,1571 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Python</title>
+<base href="http://docs.python.org"/>
+<tocsect1 name="Tutorial" url="tut/tut.html">
+<tocsect2 name="Front Matter" url="tut/node1.html"/>
+<tocsect2 name="Contents" url="tut/node2.html"/>
+<tocsect2 name="1. Whetting Your Appetite " url="tut/node3.html">
+<tocsect3 name="1.1 Where From Here " url="tut/node3.html#SECTION003100000000000000000"/>
+</tocsect2>
+<tocsect2 name="2. Using the Python Interpreter " url="tut/node4.html">
+<tocsect3 name="2.1 Invoking the Interpreter " url="tut/node4.html#SECTION004100000000000000000">
+<tocsect4 name="2.1.1 Argument Passing " url="tut/node4.html#SECTION004110000000000000000"/>
+<tocsect4 name="2.1.2 Interactive Mode " url="tut/node4.html#SECTION004120000000000000000"/>
+</tocsect3>
+<tocsect3 name="2.2 The Interpreter and Its Environment " url="tut/node4.html#SECTION004200000000000000000">
+<tocsect4 name="2.2.1 Error Handling " url="tut/node4.html#SECTION004210000000000000000"/>
+<tocsect4 name="2.2.2 Executable Python Scripts " url="tut/node4.html#SECTION004220000000000000000"/>
+<tocsect4 name="2.2.3 The Interactive Startup File " url="tut/node4.html#SECTION004230000000000000000"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="3. An Informal Introduction to Python " url="tut/node5.html">
+<tocsect3 name="3.1 Using Python as a Calculator " url="tut/node5.html#SECTION005100000000000000000">
+<tocsect4 name="3.1.1 Numbers " url="tut/node5.html#SECTION005110000000000000000"/>
+<tocsect4 name="3.1.2 Strings " url="tut/node5.html#SECTION005120000000000000000"/>
+<tocsect4 name="3.1.3 Unicode Strings " url="tut/node5.html#SECTION005130000000000000000"/>
+<tocsect4 name="3.1.4 Lists " url="tut/node5.html#SECTION005140000000000000000"/>
+</tocsect3>
+<tocsect3 name="3.2 First Steps Towards Programming " url="tut/node5.html#SECTION005200000000000000000"/>
+</tocsect2>
+<tocsect2 name="4. More Control Flow Tools " url="tut/node6.html">
+<tocsect3 name="4.1 if Statements " url="tut/node6.html#SECTION006100000000000000000"/>
+<tocsect3 name="4.2 for Statements " url="tut/node6.html#SECTION006200000000000000000"/>
+<tocsect3 name="4.3 The range() Function " url="tut/node6.html#SECTION006300000000000000000"/>
+<tocsect3 name="4.5 pass Statements " url="tut/node6.html#SECTION006500000000000000000"/>
+<tocsect3 name="4.6 Defining Functions " url="tut/node6.html#SECTION006600000000000000000"/>
+<tocsect3 name="4.7 More on Defining Functions " url="tut/node6.html#SECTION006700000000000000000">
+<tocsect4 name="4.7.1 Default Argument Values " url="tut/node6.html#SECTION006710000000000000000"/>
+<tocsect4 name="4.7.2 Keyword Arguments " url="tut/node6.html#SECTION006720000000000000000"/>
+<tocsect4 name="4.7.3 Arbitrary Argument Lists " url="tut/node6.html#SECTION006730000000000000000"/>
+<tocsect4 name="4.7.4 Lambda Forms " url="tut/node6.html#SECTION006740000000000000000"/>
+<tocsect4 name="4.7.5 Documentation Strings " url="tut/node6.html#SECTION006750000000000000000"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="5. Data Structures " url="tut/node7.html">
+<tocsect3 name="5.1 More on Lists " url="tut/node7.html#SECTION007100000000000000000">
+<tocsect4 name="5.1.1 Using Lists as Stacks " url="tut/node7.html#SECTION007110000000000000000"/>
+<tocsect4 name="5.1.2 Using Lists as Queues " url="tut/node7.html#SECTION007120000000000000000"/>
+<tocsect4 name="5.1.3 Functional Programming Tools " url="tut/node7.html#SECTION007130000000000000000"/>
+<tocsect4 name="5.1.4 List Comprehensions" url="tut/node7.html#SECTION007140000000000000000"/>
+</tocsect3>
+<tocsect3 name="5.2 The del statement " url="tut/node7.html#SECTION007200000000000000000"/>
+<tocsect3 name="5.3 Tuples and Sequences " url="tut/node7.html#SECTION007300000000000000000"/>
+<tocsect3 name="5.4 Dictionaries " url="tut/node7.html#SECTION007400000000000000000"/>
+<tocsect3 name="5.5 More on Conditions " url="tut/node7.html#SECTION007500000000000000000"/>
+<tocsect3 name="5.6 Comparing Sequences and Other Types " url="tut/node7.html#SECTION007600000000000000000"/>
+</tocsect2>
+<tocsect2 name="6. Modules " url="tut/node8.html">
+<tocsect3 name="6.1 More on Modules " url="tut/node8.html#SECTION008100000000000000000">
+<tocsect4 name="6.1.1 The Module Search Path " url="tut/node8.html#SECTION008110000000000000000"/>
+<tocsect4 name="6.1.2 ``Compiled'' Python files" url="tut/node8.html#SECTION008120000000000000000"/>
+</tocsect3>
+<tocsect3 name="6.2 Standard Modules " url="tut/node8.html#SECTION008200000000000000000"/>
+<tocsect3 name="6.3 The dir() Function " url="tut/node8.html#SECTION008300000000000000000"/>
+<tocsect3 name="6.4 Packages " url="tut/node8.html#SECTION008400000000000000000">
+<tocsect4 name="6.4.1 Importing * From a Package " url="tut/node8.html#SECTION008410000000000000000"/>
+<tocsect4 name="6.4.2 Intra-package References" url="tut/node8.html#SECTION008420000000000000000"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="7. Input and Output " url="tut/node9.html">
+<tocsect3 name="7.1 Fancier Output Formatting " url="tut/node9.html#SECTION009100000000000000000"/>
+<tocsect3 name="7.2 Reading and Writing Files " url="tut/node9.html#SECTION009200000000000000000">
+<tocsect4 name="7.2.1 Methods of File Objects " url="tut/node9.html#SECTION009210000000000000000"/>
+<tocsect4 name="7.2.2 The pickle Module " url="tut/node9.html#SECTION009220000000000000000"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="8. Errors and Exceptions " url="tut/node10.html">
+<tocsect3 name="8.1 Syntax Errors " url="tut/node10.html#SECTION0010100000000000000000"/>
+<tocsect3 name="8.2 Exceptions " url="tut/node10.html#SECTION0010200000000000000000"/>
+<tocsect3 name="8.3 Handling Exceptions " url="tut/node10.html#SECTION0010300000000000000000"/>
+<tocsect3 name="8.4 Raising Exceptions " url="tut/node10.html#SECTION0010400000000000000000"/>
+<tocsect3 name="8.5 User-defined Exceptions " url="tut/node10.html#SECTION0010500000000000000000"/>
+<tocsect3 name="8.6 Defining Clean-up Actions " url="tut/node10.html#SECTION0010600000000000000000"/>
+</tocsect2>
+<tocsect2 name="9. Classes " url="tut/node11.html">
+<tocsect3 name="9.1 A Word About Terminology " url="tut/node11.html#SECTION0011100000000000000000"/>
+<tocsect3 name="9.2 Python Scopes and Name Spaces " url="tut/node11.html#SECTION0011200000000000000000"/>
+<tocsect3 name="9.3 A First Look at Classes " url="tut/node11.html#SECTION0011300000000000000000">
+<tocsect4 name="9.3.1 Class Definition Syntax " url="tut/node11.html#SECTION0011310000000000000000"/>
+<tocsect4 name="9.3.2 Class Objects " url="tut/node11.html#SECTION0011320000000000000000"/>
+<tocsect4 name="9.3.3 Instance Objects " url="tut/node11.html#SECTION0011330000000000000000"/>
+<tocsect4 name="9.3.4 Method Objects " url="tut/node11.html#SECTION0011340000000000000000"/>
+</tocsect3>
+<tocsect3 name="9.4 Random Remarks " url="tut/node11.html#SECTION0011400000000000000000"/>
+<tocsect3 name="9.5 Inheritance " url="tut/node11.html#SECTION0011500000000000000000">
+<tocsect4 name="9.5.1 Multiple Inheritance " url="tut/node11.html#SECTION0011510000000000000000"/>
+</tocsect3>
+<tocsect3 name="9.6 Private Variables " url="tut/node11.html#SECTION0011600000000000000000"/>
+<tocsect3 name="9.7 Odds and Ends " url="tut/node11.html#SECTION0011700000000000000000">
+<tocsect4 name="9.7.1 Exceptions Can Be Classes " url="tut/node11.html#SECTION0011710000000000000000"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="10. What Now? " url="tut/node12.html">
+<tocsect3 name="A.1 Line Editing " url="tut/node13.html#SECTION0013100000000000000000"/>
+<tocsect3 name="A.2 History Substitution " url="tut/node13.html#SECTION0013200000000000000000"/>
+<tocsect3 name="A.3 Key Bindings " url="tut/node13.html#SECTION0013300000000000000000"/>
+<tocsect3 name="A.4 Commentary " url="tut/node13.html#SECTION0013400000000000000000"/>
+</tocsect2>
+<tocsect2 name="About this document ..." url="tut/node14.html"/>
+</tocsect1>
+<tocsect1 name="Language Reference" url="ref/ref.html">
+<tocsect2 name="Front Matter" url="ref/front.html"/>
+<tocsect2 name="Contents" url="ref/contents.html"/>
+<tocsect2 name="1. Introduction" url="ref/introduction.html">
+<tocsect3 name="1.1 Notation" url="ref/notation.html"/>
+</tocsect2>
+<tocsect2 name="2. Lexical analysis" url="ref/lexical.html">
+<tocsect3 name="2.1 Line structure" url="ref/line-structure.html">
+<tocsect4 name="2.1.1 Logical lines" url="ref/logical.html"/>
+<tocsect4 name="2.1.2 Physical lines" url="ref/physical.html"/>
+<tocsect4 name="2.1.3 Comments" url="ref/comments.html"/>
+<tocsect4 name="2.1.4 Explicit line joining" url="ref/explicit-joining.html"/>
+<tocsect4 name="2.1.5 Implicit line joining" url="ref/implicit-joining.html"/>
+<tocsect4 name="2.1.6 Blank lines " url="ref/blank-lines.html"/>
+<tocsect4 name="2.1.7 Indentation" url="ref/indentation.html"/>
+<tocsect4 name="2.1.8 Whitespace between tokens" url="ref/whitespace.html"/>
+</tocsect3>
+<tocsect3 name="2.2 Other tokens" url="ref/other-tokens.html"/>
+<tocsect3 name="2.3 Identifiers and keywords" url="ref/identifiers.html">
+<tocsect4 name="2.3.1 Keywords" url="ref/keywords.html"/>
+<tocsect4 name="2.3.2 Reserved classes of identifiers" url="ref/id-classes.html"/>
+</tocsect3>
+<tocsect3 name="2.4 Literals" url="ref/literals.html">
+<tocsect4 name="2.4.1 String literals" url="ref/strings.html"/>
+<tocsect4 name="2.4.2 String literal concatenation" url="ref/string-catenation.html"/>
+<tocsect4 name="2.4.3 Numeric literals" url="ref/numbers.html"/>
+<tocsect4 name="2.4.4 Integer and long integer literals" url="ref/integers.html"/>
+<tocsect4 name="2.4.5 Floating point literals" url="ref/floating.html"/>
+<tocsect4 name="2.4.6 Imaginary literals" url="ref/imaginary.html"/>
+</tocsect3>
+<tocsect3 name="2.5 Operators" url="ref/operators.html"/>
+<tocsect3 name="2.6 Delimiters" url="ref/delimiters.html"/>
+</tocsect2>
+<tocsect2 name="3. Data model" url="ref/datamodel.html">
+<tocsect3 name="3.1 Objects, values and types" url="ref/objects.html"/>
+<tocsect3 name="3.2 The standard type hierarchy" url="ref/types.html"/>
+<tocsect3 name="3.3 Special method names" url="ref/specialnames.html">
+<tocsect4 name="3.3.1 Basic customization" url="ref/customization.html"/>
+<tocsect4 name="3.3.2 Customizing attribute access" url="ref/attribute-access.html"/>
+<tocsect4 name="3.3.3 Emulating callable objects" url="ref/callable-types.html"/>
+<tocsect4 name="3.3.4 Emulating sequence and mapping types" url="ref/sequence-types.html"/>
+<tocsect4 name="3.3.5 Additional methods for emulation of sequence types " url="ref/sequence-methods.html"/>
+<tocsect4 name="3.3.6 Emulating numeric types" url="ref/numeric-types.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="4. Execution model " url="ref/execmodel.html">
+<tocsect3 name="4.1 Code blocks, execution frames, and namespaces " url="ref/execframes.html"/>
+<tocsect3 name="4.2 Exceptions " url="ref/exceptions.html"/>
+</tocsect2>
+<tocsect2 name="5. Expressions" url="ref/expressions.html">
+<tocsect3 name="5.1 Arithmetic conversions" url="ref/conversions.html"/>
+<tocsect3 name="5.2 Atoms" url="ref/atoms.html">
+<tocsect4 name="5.2.1 Identifiers (Names)" url="ref/atom-identifiers.html"/>
+<tocsect4 name="5.2.2 Literals" url="ref/atom-literals.html"/>
+<tocsect4 name="5.2.3 Parenthesized forms" url="ref/parenthesized.html"/>
+<tocsect4 name="5.2.4 List displays" url="ref/lists.html"/>
+<tocsect4 name="5.2.5 Dictionary displays" url="ref/dict.html"/>
+<tocsect4 name="5.2.6 String conversions" url="ref/string-conversions.html"/>
+</tocsect3>
+<tocsect3 name="5.3 Primaries" url="ref/primaries.html">
+<tocsect4 name="5.3.1 Attribute references" url="ref/attribute-references.html"/>
+<tocsect4 name="5.3.2 Subscriptions" url="ref/subscriptions.html"/>
+<tocsect4 name="5.3.3 Slicings" url="ref/slicings.html"/>
+<tocsect4 name="5.3.4 Calls" url="ref/calls.html"/>
+</tocsect3>
+<tocsect3 name="5.4 The power operator" url="ref/power.html"/>
+<tocsect3 name="5.5 Unary arithmetic operations " url="ref/unary.html"/>
+<tocsect3 name="5.6 Binary arithmetic operations" url="ref/binary.html"/>
+<tocsect3 name="5.7 Shifting operations" url="ref/shifting.html"/>
+<tocsect3 name="5.8 Binary bit-wise operations" url="ref/bitwise.html"/>
+<tocsect3 name="5.9 Comparisons" url="ref/comparisons.html"/>
+<tocsect3 name="5.10 Boolean operations" url="ref/lambda.html"/>
+<tocsect3 name="5.11 Expression lists" url="ref/exprlists.html"/>
+<tocsect3 name="5.12 Summary" url="ref/summary.html"/>
+</tocsect2>
+<tocsect2 name="6. Simple statements " url="ref/simple.html">
+<tocsect3 name="6.1 Expression statements " url="ref/exprstmts.html"/>
+<tocsect3 name="6.2 Assert statements " url="ref/assert.html"/>
+<tocsect3 name="6.3 Assignment statements " url="ref/assignment.html">
+<tocsect4 name="6.3.1 Augmented Assignment statements " url="ref/augassign.html"/>
+</tocsect3>
+<tocsect3 name="6.4 The pass statement " url="ref/pass.html"/>
+<tocsect3 name="6.5 The del statement " url="ref/del.html"/>
+<tocsect3 name="6.6 The print statement " url="ref/print.html"/>
+<tocsect3 name="6.7 The return statement " url="ref/return.html"/>
+<tocsect3 name="6.8 The raise statement " url="ref/raise.html"/>
+<tocsect3 name="6.9 The break statement " url="ref/break.html"/>
+<tocsect3 name="6.10 The continue statement " url="ref/continue.html"/>
+<tocsect3 name="6.11 The import statement " url="ref/import.html"/>
+<tocsect3 name="6.12 The global statement " url="ref/global.html"/>
+<tocsect3 name="6.13 The exec statement " url="ref/exec.html"/>
+</tocsect2>
+<tocsect2 name="7. Compound statements" url="ref/compound.html">
+<tocsect3 name="7.1 The if statement" url="ref/if.html"/>
+<tocsect3 name="7.2 The while statement" url="ref/while.html"/>
+<tocsect3 name="7.3 The for statement" url="ref/for.html"/>
+<tocsect3 name="7.4 The try statement" url="ref/try.html"/>
+<tocsect3 name="7.5 Function definitions" url="ref/function.html"/>
+<tocsect3 name="7.6 Class definitions" url="ref/class.html"/>
+</tocsect2>
+<tocsect2 name="8. Top-level components" url="ref/top-level.html">
+<tocsect3 name="8.1 Complete Python programs" url="ref/programs.html"/>
+<tocsect3 name="8.2 File input" url="ref/file-input.html"/>
+<tocsect3 name="8.3 Interactive input" url="ref/interactive.html"/>
+<tocsect3 name="8.4 Expression input" url="ref/expression-input.html"/>
+</tocsect2>
+<tocsect2 name="Index" url="ref/genindex.html"/>
+<tocsect2 name="About this document ..." url="ref/about.html"/>
+</tocsect1>
+<tocsect1 name="Extending and Embedding" url="ext/ext.html">
+<tocsect2 name="Front Matter" url="ext/front.html"/>
+<tocsect2 name="Contents" url="ext/contents.html"/>
+<tocsect2 name="1. Extending Python with C or C++ " url="ext/intro.html">
+<tocsect3 name="1.1 A Simple Example " url="ext/simpleExample.html"/>
+<tocsect3 name="1.2 Intermezzo: Errors and Exceptions " url="ext/errors.html"/>
+<tocsect3 name="1.3 Back to the Example " url="ext/backToExample.html"/>
+<tocsect3 name="1.4 The Module's Method Table and Initialization Function " url="ext/methodTable.html"/>
+<tocsect3 name="1.5 Compilation and Linkage " url="ext/compilation.html"/>
+<tocsect3 name="1.6 Calling Python Functions from C " url="ext/callingPython.html"/>
+<tocsect3 name="1.7 Format Strings for PyArg_ParseTuple() " url="ext/parseTuple.html"/>
+<tocsect3 name="1.8 Keyword Parsing with PyArg_ParseTupleAndKeywords() " url="ext/parseTupleAndKeywords.html"/>
+<tocsect3 name="1.9 The Py_BuildValue() Function " url="ext/buildValue.html"/>
+<tocsect3 name="1.10 Reference Counts " url="ext/refcounts.html">
+<tocsect4 name="1.10.1 Reference Counting in Python " url="ext/refcountsInPython.html"/>
+<tocsect4 name="1.10.2 Ownership Rules " url="ext/ownershipRules.html"/>
+<tocsect4 name="1.10.3 Thin Ice " url="ext/thinIce.html"/>
+<tocsect4 name="1.10.4 NULL Pointers " url="ext/nullPointers.html"/>
+</tocsect3>
+<tocsect3 name="1.11 Writing Extensions in C++ " url="ext/cplusplus.html"/>
+<tocsect3 name="1.12 Providing a C API for an Extension Module " url="ext/using-cobjects.html"/>
+</tocsect2>
+<tocsect2 name="2. Building C and C++ Extensions on Unix " url="ext/building-on-unix.html">
+<tocsect3 name="2.1 Building Custom Interpreters " url="ext/custom-interps.html"/>
+<tocsect3 name="2.2 Module Definition Options " url="ext/module-defn-options.html"/>
+<tocsect3 name="2.3 Example " url="ext/module-defn-example.html"/>
+<tocsect3 name="2.4 Distributing your extension modules " url="ext/distributing.html"/>
+</tocsect2>
+<tocsect2 name="3. Building C and C++ Extensions on Windows " url="ext/building-on-windows.html">
+<tocsect3 name="3.1 A Cookbook Approach " url="ext/win-cookbook.html"/>
+<tocsect3 name="3.2 Differences Between Unix and Windows " url="ext/dynamic-linking.html"/>
+<tocsect3 name="3.3 Using DLLs in Practice " url="ext/win-dlls.html"/>
+</tocsect2>
+<tocsect2 name="4. Embedding Python in Another Application " url="ext/embedding.html">
+<tocsect3 name="4.1 Embedding Python in C++ " url="ext/embeddingInCplusplus.html"/>
+<tocsect3 name="4.2 Linking Requirements " url="ext/link-reqs.html"/>
+</tocsect2>
+<tocsect2 name="A. Reporting Bugs" url="ext/reporting-bugs.html"/>
+<tocsect2 name="About this document ..." url="ext/about.html"/>
+</tocsect1>
+<tocsect1 name="Python/C API Reference" url="api/api.html">
+<tocsect2 name="Front Matter" url="api/front.html"/>
+<tocsect2 name="Contents" url="api/contents.html"/>
+<tocsect2 name="1. Introduction " url="api/intro.html">
+<tocsect3 name="1.1 Include Files " url="api/includes.html"/>
+<tocsect3 name="1.2 Objects, Types and Reference Counts " url="api/objects.html">
+<tocsect4 name="1.2.1 Reference Counts " url="api/refcounts.html"/>
+<tocsect4 name="1.2.2 Types " url="api/types.html"/>
+</tocsect3>
+<tocsect3 name="1.3 Exceptions " url="api/exceptions.html"/>
+<tocsect3 name="1.4 Embedding Python " url="api/embedding.html"/>
+</tocsect2>
+<tocsect2 name="2. The Very High Level Layer " url="api/veryhigh.html"/>
+<tocsect2 name="3. Reference Counting " url="api/countingRefs.html"/>
+<tocsect2 name="4. Exception Handling " url="api/exceptionHandling.html">
+<tocsect3 name="4.1 Standard Exceptions " url="api/standardExceptions.html"/>
+<tocsect3 name="4.2 Deprecation of String Exceptions" url="api/node15.html"/>
+</tocsect2>
+<tocsect2 name="5. Utilities " url="api/utilities.html">
+<tocsect3 name="5.1 OS Utilities " url="api/os.html"/>
+<tocsect3 name="5.2 Process Control " url="api/processControl.html"/>
+<tocsect3 name="5.3 Importing Modules " url="api/importing.html"/>
+</tocsect2>
+<tocsect2 name="6. Abstract Objects Layer " url="api/abstract.html">
+<tocsect3 name="6.1 Object Protocol " url="api/object.html"/>
+<tocsect3 name="6.2 Number Protocol " url="api/number.html"/>
+<tocsect3 name="6.3 Sequence Protocol " url="api/sequence.html"/>
+<tocsect3 name="6.4 Mapping Protocol " url="api/mapping.html"/>
+</tocsect2>
+<tocsect2 name="7. Concrete Objects Layer " url="api/concrete.html">
+<tocsect3 name="7.1 Fundamental Objects " url="api/fundamental.html">
+<tocsect4 name="7.1.1 Type Objects " url="api/typeObjects.html"/>
+<tocsect4 name="7.1.2 The None Object " url="api/noneObject.html"/>
+</tocsect3>
+<tocsect3 name="7.2 Sequence Objects " url="api/sequenceObjects.html">
+<tocsect4 name="7.2.1 String Objects " url="api/stringObjects.html"/>
+<tocsect4 name="7.2.2 Unicode Objects " url="api/unicodeObjects.html"/>
+<tocsect4 name="7.2.3 Buffer Objects " url="api/bufferObjects.html"/>
+<tocsect4 name="7.2.4 Tuple Objects " url="api/tupleObjects.html"/>
+<tocsect4 name="7.2.5 List Objects " url="api/listObjects.html"/>
+</tocsect3>
+<tocsect3 name="7.3 Mapping Objects " url="api/mapObjects.html">
+<tocsect4 name="7.3.1 Dictionary Objects " url="api/dictObjects.html"/>
+</tocsect3>
+<tocsect3 name="7.4 Numeric Objects " url="api/numericObjects.html">
+<tocsect4 name="7.4.1 Plain Integer Objects " url="api/intObjects.html"/>
+<tocsect4 name="7.4.2 Long Integer Objects " url="api/longObjects.html"/>
+<tocsect4 name="7.4.3 Floating Point Objects " url="api/floatObjects.html"/>
+<tocsect4 name="7.4.4 Complex Number Objects " url="api/complexObjects.html"/>
+</tocsect3>
+<tocsect3 name="7.5 Other Objects " url="api/otherObjects.html">
+<tocsect4 name="7.5.1 File Objects " url="api/fileObjects.html"/>
+<tocsect4 name="7.5.2 Module Objects " url="api/moduleObjects.html"/>
+<tocsect4 name="7.5.3 CObjects " url="api/cObjects.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="8. Initialization, Finalization, and Threads " url="api/initialization.html">
+<tocsect3 name="8.1 Thread State and the Global Interpreter Lock " url="api/threads.html"/>
+</tocsect2>
+<tocsect2 name="9. Memory Management " url="api/memory.html">
+<tocsect3 name="9.1 Overview " url="api/memoryOverview.html"/>
+<tocsect3 name="9.2 Memory Interface " url="api/memoryInterface.html"/>
+<tocsect3 name="9.3 Examples " url="api/memoryExamples.html"/>
+</tocsect2>
+<tocsect2 name="10. Defining New Object Types " url="api/newTypes.html">
+<tocsect3 name="10.1 Common Object Structures " url="api/common-structs.html"/>
+<tocsect3 name="10.2 Mapping Object Structures " url="api/mapping-structs.html"/>
+<tocsect3 name="10.3 Number Object Structures " url="api/number-structs.html"/>
+<tocsect3 name="10.4 Sequence Object Structures " url="api/sequence-structs.html"/>
+<tocsect3 name="10.5 Buffer Object Structures " url="api/buffer-structs.html"/>
+</tocsect2>
+<tocsect2 name="A. Reporting Bugs" url="api/reporting-bugs.html"/>
+<tocsect2 name="Index" url="api/genindex.html"/>
+<tocsect2 name="About this document ..." url="api/about.html"/>
+</tocsect1>
+<tocsect1 name="Library" url="lib/lib.html">
+<tocsect2 name="Front Matter" url="lib/front.html"/>
+<tocsect2 name="Contents" url="lib/contents.html"/>
+<tocsect2 name="1. Introduction" url="lib/intro.html"/>
+<tocsect2 name="2. Built-in Types, Exceptions and Functions" url="lib/builtin.html">
+<tocsect3 name="2.1 Built-in Types " url="lib/types.html">
+<tocsect4 name="2.1.1 Truth Value Testing " url="lib/truth.html"/>
+<tocsect4 name="2.1.2 Boolean Operations " url="lib/boolean.html"/>
+<tocsect4 name="2.1.3 Comparisons " url="lib/comparisons.html"/>
+<tocsect4 name="2.1.4 Numeric Types " url="lib/typesnumeric.html"/>
+<tocsect4 name="2.1.5 Sequence Types " url="lib/typesseq.html"/>
+<tocsect4 name="2.1.6 Mapping Types " url="lib/typesmapping.html"/>
+<tocsect4 name="2.1.7 Other Built-in Types " url="lib/typesother.html"/>
+<tocsect4 name="2.1.8 Special Attributes " url="lib/specialattrs.html"/>
+</tocsect3>
+<tocsect3 name="2.2 Built-in Exceptions" url="lib/module-exceptions.html"/>
+<tocsect3 name="2.3 Built-in Functions " url="lib/built-in-funcs.html"/>
+</tocsect2>
+<tocsect2 name="3. Python Runtime Services " url="lib/python.html">
+<tocsect3 name="3.1 sys -- System-specific parameters and functions" url="lib/module-sys.html"/>
+<tocsect3 name="3.2 gc -- Garbage Collector interface" url="lib/module-gc.html"/>
+<tocsect3 name="3.3 atexit -- Exit handlers" url="lib/module-atexit.html">
+<tocsect4 name="3.3.1 atexit Example " url="lib/atexit-example.html"/>
+</tocsect3>
+<tocsect3 name="3.4 types -- Names for all built-in types" url="lib/module-types.html"/>
+<tocsect3 name="3.5 UserDict -- Class wrapper for dictionary objects" url="lib/module-UserDict.html"/>
+<tocsect3 name="3.6 UserList -- Class wrapper for list objects" url="lib/module-UserList.html"/>
+<tocsect3 name="3.7 UserString -- Class wrapper for string objects" url="lib/module-UserString.html"/>
+<tocsect3 name="3.8 operator -- Standard operators as functions." url="lib/module-operator.html"/>
+<tocsect3 name="3.9 traceback -- Print or retrieve a stack traceback" url="lib/module-traceback.html">
+<tocsect4 name="3.9.1 Traceback Example " url="lib/traceback-example.html"/>
+</tocsect3>
+<tocsect3 name="3.10 linecache -- Random access to text lines" url="lib/module-linecache.html"/>
+<tocsect3 name="3.11 pickle -- Python object serialization" url="lib/module-pickle.html">
+<tocsect4 name="3.11.1 Example " url="lib/pickle-example.html"/>
+</tocsect3>
+<tocsect3 name="3.12 cPickle -- Alternate implementation of pickle" url="lib/module-cPickle.html"/>
+<tocsect3 name="3.13 copy_reg -- Register pickle support functions" url="lib/module-copyreg.html"/>
+<tocsect3 name="3.14 shelve -- Python object persistence" url="lib/module-shelve.html"/>
+<tocsect3 name="3.15 copy -- Shallow and deep copy operations" url="lib/module-copy.html"/>
+<tocsect3 name="3.16 marshal -- Alternate Python object serialization" url="lib/module-marshal.html"/>
+<tocsect3 name="3.17 imp -- Access the import internals" url="lib/module-imp.html">
+<tocsect4 name="3.17.1 Examples" url="lib/examples-imp.html"/>
+</tocsect3>
+<tocsect3 name="3.18 code -- Interpreter base classes" url="lib/module-code.html">
+<tocsect4 name="3.18.1 Interactive Interpreter Objects " url="lib/interpreter-objects.html"/>
+<tocsect4 name="3.18.2 Interactive Console Objects " url="lib/console-objects.html"/>
+</tocsect3>
+<tocsect3 name="3.19 codeop -- Compile Python code" url="lib/module-codeop.html"/>
+<tocsect3 name="3.20 pprint -- Data pretty printer" url="lib/module-pprint.html">
+<tocsect4 name="3.20.1 PrettyPrinter Objects" url="lib/PrettyPrinter_Objects.html"/>
+</tocsect3>
+<tocsect3 name="3.21 repr -- Alternate repr() implementation" url="lib/module-repr.html">
+<tocsect4 name="3.21.1 Repr Objects " url="lib/Repr-objects.html"/>
+<tocsect4 name="3.21.2 Subclassing Repr Objects " url="lib/subclassing-reprs.html"/>
+</tocsect3>
+<tocsect3 name="3.22 new -- Creation of runtime internal objects" url="lib/module-new.html"/>
+<tocsect3 name="3.23 site -- Site-specific configuration hook" url="lib/module-site.html"/>
+<tocsect3 name="3.24 user -- User-specific configuration hook" url="lib/module-user.html"/>
+<tocsect3 name="3.25 __builtin__ -- Built-in functions" url="lib/module-builtin.html"/>
+<tocsect3 name="3.26 __main__ -- Top-level script environment" url="lib/module-main.html"/>
+</tocsect2>
+<tocsect2 name="4. String Services" url="lib/strings.html">
+<tocsect3 name="4.1 string -- Common string operations" url="lib/module-string.html"/>
+<tocsect3 name="4.2 re -- Regular expression operations" url="lib/module-re.html">
+<tocsect4 name="4.2.1 Regular Expression Syntax " url="lib/re-syntax.html"/>
+<tocsect4 name="4.2.2 Matching vs. Searching " url="lib/matching-searching.html"/>
+<tocsect4 name="4.2.3 Module Contents" url="lib/Contents_of_Module_re.html"/>
+<tocsect4 name="4.2.4 Regular Expression Objects " url="lib/re-objects.html"/>
+<tocsect4 name="4.2.5 Match Objects " url="lib/match-objects.html"/>
+</tocsect3>
+<tocsect3 name="4.3 struct -- Interpret strings as packed binary data" url="lib/module-struct.html"/>
+<tocsect3 name="4.4 fpformat -- Floating point conversions" url="lib/module-fpformat.html"/>
+<tocsect3 name="4.5 StringIO -- Read and write strings as files" url="lib/module-StringIO.html"/>
+<tocsect3 name="4.6 cStringIO -- Faster version of StringIO" url="lib/module-cStringIO.html"/>
+<tocsect3 name="4.7 codecs -- Codec registry and base classes" url="lib/module-codecs.html">
+<tocsect4 name="4.7.1 Codec Base Classes" url="lib/node80.html"/>
+</tocsect3>
+<tocsect3 name="4.8 unicodedata -- Unicode Database" url="lib/module-unicodedata.html"/>
+</tocsect2>
+<tocsect2 name="5. Miscellaneous Services" url="lib/misc.html">
+<tocsect3 name="5.1 math -- Mathematical functions" url="lib/module-math.html"/>
+<tocsect3 name="5.2 cmath -- Mathematical functions for complex numbers" url="lib/module-cmath.html"/>
+<tocsect3 name="5.3 random -- Generate pseudo-random numbers" url="lib/module-random.html">
+<tocsect4 name="5.3.1 The Random Number Generator Interface " url="lib/rng-objects.html"/>
+</tocsect3>
+<tocsect3 name="5.4 whrandom -- Pseudo-random number generator" url="lib/module-whrandom.html"/>
+<tocsect3 name="5.5 bisect -- Array bisection algorithm" url="lib/module-bisect.html">
+<tocsect4 name="5.5.1 Example" url="lib/bisect-example.html"/>
+</tocsect3>
+<tocsect3 name="5.6 array -- Efficient arrays of numeric values" url="lib/module-array.html"/>
+<tocsect3 name="5.7 ConfigParser -- Configuration file parser" url="lib/module-ConfigParser.html">
+<tocsect4 name="5.7.1 ConfigParser Objects " url="lib/ConfigParser-objects.html"/>
+</tocsect3>
+<tocsect3 name="5.8 fileinput -- Iterate over lines from multiple input streams" url="lib/module-fileinput.html"/>
+<tocsect3 name="5.9 calendar -- General calendar-related functions" url="lib/module-calendar.html"/>
+<tocsect3 name="5.10 cmd -- Support for line-oriented command interpreters" url="lib/module-cmd.html">
+<tocsect4 name="5.10.1 Cmd Objects" url="lib/Cmd-objects.html"/>
+</tocsect3>
+<tocsect3 name="5.11 shlex -- Simple lexical analysis" url="lib/module-shlex.html">
+<tocsect4 name="5.11.1 shlex Objects " url="lib/shlex-objects.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="6. Generic Operating System Services " url="lib/allos.html">
+<tocsect3 name="6.1 os -- Miscellaneous OS interfaces" url="lib/module-os.html">
+<tocsect4 name="6.1.1 Process Parameters " url="lib/os-procinfo.html"/>
+<tocsect4 name="6.1.2 File Object Creation " url="lib/os-newstreams.html"/>
+<tocsect4 name="6.1.3 File Descriptor Operations " url="lib/os-fd-ops.html"/>
+<tocsect4 name="6.1.4 Files and Directories " url="lib/os-file-dir.html"/>
+<tocsect4 name="6.1.5 Process Management " url="lib/os-process.html"/>
+<tocsect4 name="6.1.6 Miscellaneous System Information " url="lib/os-path.html"/>
+</tocsect3>
+<tocsect3 name="6.2 os.path -- Common pathname manipulations" url="lib/module-os.path.html"/>
+<tocsect3 name="6.3 dircache -- Cached directory listings" url="lib/module-dircache.html"/>
+<tocsect3 name="6.4 stat -- Interpreting stat() results" url="lib/module-stat.html"/>
+<tocsect3 name="6.5 statcache -- An optimization of os.stat()" url="lib/module-statcache.html"/>
+<tocsect3 name="6.6 statvfs -- Constants used with os.statvfs()" url="lib/module-statvfs.html"/>
+<tocsect3 name="6.7 filecmp -- File and Directory Comparisons" url="lib/module-filecmp.html">
+<tocsect4 name="6.7.1 The dircmp class " url="lib/dircmp-objects.html"/>
+</tocsect3>
+<tocsect3 name="6.8 popen2 -- Subprocesses with accessible I/O streams" url="lib/module-popen2.html">
+<tocsect4 name="6.8.1 Popen3 and Popen4 Objects " url="lib/popen3-objects.html"/>
+</tocsect3>
+<tocsect3 name="6.9 time -- Time access and conversions" url="lib/module-time.html"/>
+<tocsect3 name="6.10 sched -- Event scheduler" url="lib/module-sched.html">
+<tocsect4 name="6.10.1 Scheduler Objects " url="lib/scheduler-objects.html"/>
+</tocsect3>
+<tocsect3 name="6.11 getpass -- Portable password input" url="lib/module-getpass.html"/>
+<tocsect3 name="6.12 curses -- Terminal handling for character-cell displays" url="lib/module-curses.html">
+<tocsect4 name="6.12.1 Functions " url="lib/curses-functions.html"/>
+<tocsect4 name="6.12.2 Window Objects " url="lib/curses-window-objects.html"/>
+<tocsect4 name="6.12.3 Constants" url="lib/node128.html"/>
+</tocsect3>
+<tocsect3 name="6.13 curses.textpad -- Text input widget for curses programs" url="lib/module-curses.textpad.html">
+<tocsect4 name="6.13.1 Textbox objects " url="lib/curses-textpad-objects.html"/>
+</tocsect3>
+<tocsect3 name="6.14 curses.wrapper -- Terminal handler for curses programs" url="lib/module-curses.wrapper.html"/>
+<tocsect3 name="6.15 curses.ascii -- Utilities for ASCII characters" url="lib/module-curses.ascii.html"/>
+<tocsect3 name="6.16 getopt -- Parser for command line options" url="lib/module-getopt.html"/>
+<tocsect3 name="6.17 tempfile -- Generate temporary file names" url="lib/module-tempfile.html"/>
+<tocsect3 name="6.18 errno -- Standard errno system symbols" url="lib/module-errno.html"/>
+<tocsect3 name="6.19 glob -- Unix style pathname pattern expansion" url="lib/module-glob.html"/>
+<tocsect3 name="6.20 fnmatch -- Unix filename pattern matching" url="lib/module-fnmatch.html"/>
+<tocsect3 name="6.21 shutil -- High-level file operations" url="lib/module-shutil.html">
+<tocsect4 name="6.21.1 Example " url="lib/shutil-example.html"/>
+</tocsect3>
+<tocsect3 name="6.22 locale -- Internationalization services" url="lib/module-locale.html">
+<tocsect4 name="6.22.1 Background, details, hints, tips and caveats" url="lib/node141.html"/>
+<tocsect4 name="6.22.2 For extension writers and programs that embed Python" url="lib/embedding-locale.html"/>
+</tocsect3>
+<tocsect3 name="6.23 gettext -- Multilingual internationalization services" url="lib/module-gettext.html">
+<tocsect4 name="6.23.1 GNU gettext API" url="lib/node144.html"/>
+<tocsect4 name="6.23.2 Class-based API" url="lib/node145.html"/>
+<tocsect4 name="6.23.3 Internationalizing your programs and modules" url="lib/node150.html"/>
+<tocsect4 name="6.23.4 Acknowledgments" url="lib/node155.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="7. Optional Operating System Services" url="lib/someos.html">
+<tocsect3 name="7.1 signal -- Set handlers for asynchronous events" url="lib/module-signal.html">
+<tocsect4 name="7.1.1 Example" url="lib/Signal_Example.html"/>
+</tocsect3>
+<tocsect3 name="7.2 socket -- Low-level networking interface" url="lib/module-socket.html">
+<tocsect4 name="7.2.1 Socket Objects " url="lib/socket-objects.html"/>
+<tocsect4 name="7.2.2 Example " url="lib/socket-example.html"/>
+</tocsect3>
+<tocsect3 name="7.3 select -- Waiting for I/O completion" url="lib/module-select.html">
+<tocsect4 name="7.3.1 Polling Objects " url="lib/poll-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.4 thread -- Multiple threads of control" url="lib/module-thread.html"/>
+<tocsect3 name="7.5 threading -- Higher-level threading interface" url="lib/module-threading.html">
+<tocsect4 name="7.5.1 Lock Objects " url="lib/lock-objects.html"/>
+<tocsect4 name="7.5.2 RLock Objects " url="lib/rlock-objects.html"/>
+<tocsect4 name="7.5.3 Condition Objects " url="lib/condition-objects.html"/>
+<tocsect4 name="7.5.4 Semaphore Objects " url="lib/semaphore-objects.html"/>
+<tocsect4 name="7.5.5 Event Objects " url="lib/event-objects.html"/>
+<tocsect4 name="7.5.6 Thread Objects " url="lib/thread-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.6 mutex -- Mutual exclusion support" url="lib/module-mutex.html">
+<tocsect4 name="7.6.1 Mutex Objects " url="lib/mutex-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.7 Queue -- A synchronized queue class" url="lib/module-Queue.html">
+<tocsect4 name="7.7.1 Queue Objects" url="lib/QueueObjects.html"/>
+</tocsect3>
+<tocsect3 name="7.8 mmap -- Memory-mapped file support" url="lib/module-mmap.html"/>
+<tocsect3 name="7.9 anydbm -- Generic access to DBM-style databases" url="lib/module-anydbm.html"/>
+<tocsect3 name="7.10 dumbdbm -- Portable DBM implementation" url="lib/module-dumbdbm.html"/>
+<tocsect3 name="7.11 dbhash -- DBM-style interface to the BSD database library" url="lib/module-dbhash.html">
+<tocsect4 name="7.11.1 Database Objects " url="lib/dbhash-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.12 whichdb -- Guess which DBM module created a database" url="lib/module-whichdb.html"/>
+<tocsect3 name="7.13 bsddb -- Interface to Berkeley DB library" url="lib/module-bsddb.html">
+<tocsect4 name="7.13.1 Hash, BTree and Record Objects " url="lib/bsddb-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.14 zlib -- Compression compatible with gzip" url="lib/module-zlib.html"/>
+<tocsect3 name="7.15 gzip -- Support for gzip files" url="lib/module-gzip.html"/>
+<tocsect3 name="7.16 zipfile -- Work with ZIP archives" url="lib/module-zipfile.html">
+<tocsect4 name="7.16.1 ZipFile Objects " url="lib/zipfile-objects.html"/>
+<tocsect4 name="7.16.2 PyZipFile Objects " url="lib/pyzipfile-objects.html"/>
+<tocsect4 name="7.16.3 ZipInfo Objects " url="lib/zipinfo-objects.html"/>
+</tocsect3>
+<tocsect3 name="7.17 readline -- GNU readline interface" url="lib/module-readline.html">
+<tocsect4 name="7.17.1 Example " url="lib/readline-example.html"/>
+</tocsect3>
+<tocsect3 name="7.18 rlcompleter -- Completion function for GNU readline" url="lib/module-rlcompleter.html">
+<tocsect4 name="7.18.1 Completer Objects " url="lib/completer-objects.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="8. Unix Specific Services" url="lib/unix.html">
+<tocsect3 name="8.1 posix -- The most common POSIX system calls" url="lib/module-posix.html">
+<tocsect4 name="8.1.1 Large File Support " url="lib/posix-large-files.html"/>
+<tocsect4 name="8.1.2 Module Contents " url="lib/posix-contents.html"/>
+</tocsect3>
+<tocsect3 name="8.2 pwd -- The password database" url="lib/module-pwd.html"/>
+<tocsect3 name="8.3 grp -- The group database" url="lib/module-grp.html"/>
+<tocsect3 name="8.4 crypt -- Function to check Unix passwords" url="lib/module-crypt.html"/>
+<tocsect3 name="8.5 dl -- Call C functions in shared objects" url="lib/module-dl.html">
+<tocsect4 name="8.5.1 Dl Objects " url="lib/dl-objects.html"/>
+</tocsect3>
+<tocsect3 name="8.6 dbm -- Simple ``database'' interface" url="lib/module-dbm.html"/>
+<tocsect3 name="8.7 gdbm -- GNU's reinterpretation of dbm" url="lib/module-gdbm.html"/>
+<tocsect3 name="8.8 termios -- POSIX style tty control" url="lib/module-termios.html">
+<tocsect4 name="8.8.1 Example" url="lib/termios_Example.html"/>
+</tocsect3>
+<tocsect3 name="8.9 TERMIOS -- Constants used with the termios module" url="lib/module-TERMIOSuppercase.html"/>
+<tocsect3 name="8.10 tty -- Terminal control functions" url="lib/module-tty.html"/>
+<tocsect3 name="8.11 pty -- Pseudo-terminal utilities" url="lib/module-pty.html"/>
+<tocsect3 name="8.12 fcntl -- The fcntl() and ioctl() system calls" url="lib/module-fcntl.html"/>
+<tocsect3 name="8.13 pipes -- Interface to shell pipelines" url="lib/module-pipes.html">
+<tocsect4 name="8.13.1 Template Objects " url="lib/template-objects.html"/>
+</tocsect3>
+<tocsect3 name="8.14 posixfile -- File-like objects with locking support" url="lib/module-posixfile.html"/>
+<tocsect3 name="8.15 resource -- Resource usage information" url="lib/module-resource.html">
+<tocsect4 name="8.15.1 Resource Limits" url="lib/node215.html"/>
+<tocsect4 name="8.15.2 Resource Usage" url="lib/node216.html"/>
+</tocsect3>
+<tocsect3 name="8.16 nis -- Interface to Sun's NIS (Yellow Pages)" url="lib/module-nis.html"/>
+<tocsect3 name="8.17 syslog -- Unix syslog library routines" url="lib/module-syslog.html"/>
+<tocsect3 name="8.18 commands -- Utilities for running commands" url="lib/module-commands.html"/>
+</tocsect2>
+<tocsect2 name="9. The Python Debugger" url="lib/module-pdb.html">
+<tocsect3 name="9.1 Debugger Commands " url="lib/debugger-commands.html"/>
+<tocsect3 name="9.2 How It Works" url="lib/node222.html"/>
+</tocsect2>
+<tocsect2 name="10. The Python Profiler " url="lib/profile.html">
+<tocsect3 name="10.1 Introduction to the profiler" url="lib/Profiler_Introduction.html"/>
+<tocsect3 name="10.2 How Is This Profiler Different From The Old Profiler?" url="lib/Profiler_Changes.html"/>
+<tocsect3 name="10.3 Instant Users Manual " url="lib/profile-instant.html"/>
+<tocsect3 name="10.4 What Is Deterministic Profiling?" url="lib/Deterministic_Profiling.html"/>
+<tocsect3 name="10.5 Reference Manual" url="lib/module-profile.html">
+<tocsect4 name="10.5.1 The Stats Class " url="lib/profile-stats.html"/>
+</tocsect3>
+<tocsect3 name="10.6 Limitations " url="lib/profile-limits.html"/>
+<tocsect3 name="10.7 Calibration " url="lib/profile-calibration.html"/>
+<tocsect3 name="10.8 Extensions -- Deriving Better Profilers" url="lib/Profiler_Extensions.html">
+<tocsect4 name="10.8.1 OldProfile Class " url="lib/profile-old.html"/>
+<tocsect4 name="10.8.2 HotProfile Class " url="lib/profile-HotProfile.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="11. Internet Protocols and Support " url="lib/internet.html">
+<tocsect3 name="11.1 webbrowser -- Convenient Web-browser controller" url="lib/module-webbrowser.html">
+<tocsect4 name="11.1.1 Browser Controller Objects " url="lib/browser-controllers.html"/>
+</tocsect3>
+<tocsect3 name="11.2 cgi -- Common Gateway Interface support." url="lib/module-cgi.html">
+<tocsect4 name="11.2.1 Introduction" url="lib/cgi-intro.html"/>
+<tocsect4 name="11.2.2 Using the cgi module" url="lib/Using_the_cgi_module.html"/>
+<tocsect4 name="11.2.3 Old classes" url="lib/node241.html"/>
+<tocsect4 name="11.2.4 Functions" url="lib/Functions_in_cgi_module.html"/>
+<tocsect4 name="11.2.5 Caring about security" url="lib/node243.html"/>
+<tocsect4 name="11.2.6 Installing your CGI script on a Unix system" url="lib/node244.html"/>
+<tocsect4 name="11.2.7 Testing your CGI script" url="lib/node245.html"/>
+<tocsect4 name="11.2.8 Debugging CGI scripts" url="lib/node246.html"/>
+<tocsect4 name="11.2.9 Common problems and solutions" url="lib/node247.html"/>
+</tocsect3>
+<tocsect3 name="11.3 urllib -- Open arbitrary resources by URL" url="lib/module-urllib.html">
+<tocsect4 name="11.3.1 URLopener Objects " url="lib/urlopener-objs.html"/>
+<tocsect4 name="11.3.2 Examples" url="lib/Urllib_Examples.html"/>
+</tocsect3>
+<tocsect3 name="11.4 httplib -- HTTP protocol client" url="lib/module-httplib.html">
+<tocsect4 name="11.4.1 HTTP Objects" url="lib/node252.html"/>
+<tocsect4 name="11.4.2 Examples" url="lib/HTTP_Examples.html"/>
+</tocsect3>
+<tocsect3 name="11.5 ftplib -- FTP protocol client" url="lib/module-ftplib.html">
+<tocsect4 name="11.5.1 FTP Objects " url="lib/ftp-objects.html"/>
+</tocsect3>
+<tocsect3 name="11.6 gopherlib -- Gopher protocol client" url="lib/module-gopherlib.html"/>
+<tocsect3 name="11.7 poplib -- POP3 protocol client" url="lib/module-poplib.html">
+<tocsect4 name="11.7.1 POP3 Objects " url="lib/pop3-objects.html"/>
+<tocsect4 name="11.7.2 POP3 Example " url="lib/pop3-example.html"/>
+</tocsect3>
+<tocsect3 name="11.8 imaplib -- IMAP4 protocol client" url="lib/module-imaplib.html">
+<tocsect4 name="11.8.1 IMAP4 Objects " url="lib/imap4-objects.html"/>
+<tocsect4 name="11.8.2 IMAP4 Example " url="lib/imap4-example.html"/>
+</tocsect3>
+<tocsect3 name="11.9 nntplib -- NNTP protocol client" url="lib/module-nntplib.html">
+<tocsect4 name="11.9.1 NNTP Objects " url="lib/nntp-objects.html"/>
+</tocsect3>
+<tocsect3 name="11.10 smtplib -- SMTP protocol client" url="lib/module-smtplib.html">
+<tocsect4 name="11.10.1 SMTP Objects " url="lib/SMTP-objects.html"/>
+<tocsect4 name="11.10.2 SMTP Example " url="lib/SMTP-example.html"/>
+</tocsect3>
+<tocsect3 name="11.11 telnetlib -- Telnet client" url="lib/module-telnetlib.html">
+<tocsect4 name="11.11.1 Telnet Objects " url="lib/telnet-objects.html"/>
+<tocsect4 name="11.11.2 Telnet Example " url="lib/telnet-example.html"/>
+</tocsect3>
+<tocsect3 name="11.12 urlparse -- Parse URLs into components" url="lib/module-urlparse.html"/>
+<tocsect3 name="11.13 SocketServer -- A framework for network servers" url="lib/module-SocketServer.html"/>
+<tocsect3 name="11.14 BaseHTTPServer -- Basic HTTP server" url="lib/module-BaseHTTPServer.html"/>
+<tocsect3 name="11.15 SimpleHTTPServer -- Simple HTTP request handler" url="lib/module-SimpleHTTPServer.html"/>
+<tocsect3 name="11.16 CGIHTTPServer -- CGI-capable HTTP request handler" url="lib/module-CGIHTTPServer.html"/>
+<tocsect3 name="11.17 Cookie -- HTTP state management" url="lib/module-Cookie.html">
+<tocsect4 name="11.17.1 Cookie Objects " url="lib/cookie-objects.html"/>
+<tocsect4 name="11.17.2 Morsel Objects " url="lib/morsel-objects.html"/>
+<tocsect4 name="11.17.3 Example " url="lib/cookie-example.html"/>
+</tocsect3>
+<tocsect3 name="11.18 asyncore -- Asynchronous socket handler" url="lib/module-asyncore.html">
+<tocsect4 name="11.18.1 Example basic HTTP client " url="lib/asyncore-example.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="12. Internet Data Handling " url="lib/netdata.html">
+<tocsect3 name="12.1 formatter -- Generic output formatting" url="lib/module-formatter.html">
+<tocsect4 name="12.1.1 The Formatter Interface " url="lib/formatter-interface.html"/>
+<tocsect4 name="12.1.2 Formatter Implementations " url="lib/formatter-impls.html"/>
+<tocsect4 name="12.1.3 The Writer Interface " url="lib/writer-interface.html"/>
+<tocsect4 name="12.1.4 Writer Implementations " url="lib/writer-impls.html"/>
+</tocsect3>
+<tocsect3 name="12.2 rfc822 -- Parse RFC 822 mail headers" url="lib/module-rfc822.html">
+<tocsect4 name="12.2.1 Message Objects " url="lib/message-objects.html"/>
+<tocsect4 name="12.2.2 AddressList Objects " url="lib/addresslist-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.3 mimetools -- Tools for parsing MIME messages" url="lib/module-mimetools.html">
+<tocsect4 name="12.3.1 Additional Methods of Message Objects " url="lib/mimetools-message-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.4 MimeWriter -- Generic MIME file writer" url="lib/module-MimeWriter.html">
+<tocsect4 name="12.4.1 MimeWriter Objects " url="lib/MimeWriter-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.5 multifile -- Support for files containing distinct parts" url="lib/module-multifile.html">
+<tocsect4 name="12.5.1 MultiFile Objects " url="lib/MultiFile-objects.html"/>
+<tocsect4 name="12.5.2 MultiFile Example " url="lib/multifile-example.html"/>
+</tocsect3>
+<tocsect3 name="12.6 binhex -- Encode and decode binhex4 files" url="lib/module-binhex.html">
+<tocsect4 name="12.6.1 Notes " url="lib/binhex-notes.html"/>
+</tocsect3>
+<tocsect3 name="12.7 uu -- Encode and decode uuencode files" url="lib/module-uu.html"/>
+<tocsect3 name="12.8 binascii -- Convert between binary and ASCII" url="lib/module-binascii.html"/>
+<tocsect3 name="12.9 xdrlib -- Encode and decode XDR data" url="lib/module-xdrlib.html">
+<tocsect4 name="12.9.1 Packer Objects " url="lib/xdr-packer-objects.html"/>
+<tocsect4 name="12.9.2 Unpacker Objects " url="lib/xdr-unpacker-objects.html"/>
+<tocsect4 name="12.9.3 Exceptions " url="lib/xdr-exceptions.html"/>
+</tocsect3>
+<tocsect3 name="12.10 mailcap -- Mailcap file handling." url="lib/module-mailcap.html"/>
+<tocsect3 name="12.11 mimetypes -- Map filenames to MIME types" url="lib/module-mimetypes.html"/>
+<tocsect3 name="12.12 base64 -- Encode and decode MIME base64 data" url="lib/module-base64.html"/>
+<tocsect3 name="12.13 quopri -- Encode and decode MIME quoted-printable data" url="lib/module-quopri.html"/>
+<tocsect3 name="12.14 mailbox -- Read various mailbox formats" url="lib/module-mailbox.html">
+<tocsect4 name="12.14.1 Mailbox Objects " url="lib/mailbox-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.15 mhlib -- Access to MH mailboxes" url="lib/module-mhlib.html">
+<tocsect4 name="12.15.1 MH Objects " url="lib/mh-objects.html"/>
+<tocsect4 name="12.15.2 Folder Objects " url="lib/mh-folder-objects.html"/>
+<tocsect4 name="12.15.3 Message Objects " url="lib/mh-message-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.16 mimify -- MIME processing of mail messages" url="lib/module-mimify.html"/>
+<tocsect3 name="12.17 netrc -- netrc file processing" url="lib/module-netrc.html">
+<tocsect4 name="12.17.1 netrc Objects " url="lib/netrc-objects.html"/>
+</tocsect3>
+<tocsect3 name="12.18 robotparser -- Parser for robots.txt" url="lib/module-robotparser.html"/>
+</tocsect2>
+<tocsect2 name="13. Structured Markup Processing Tools " url="lib/markup.html">
+<tocsect3 name="13.1 sgmllib -- Simple SGML parser" url="lib/module-sgmllib.html"/>
+<tocsect3 name="13.2 htmllib -- A parser for HTML documents" url="lib/module-htmllib.html">
+<tocsect4 name="13.2.1 HTMLParser Objects " url="lib/html-parser-objects.html"/>
+</tocsect3>
+<tocsect3 name="13.3 htmlentitydefs -- Definitions of HTML general entities" url="lib/module-htmlentitydefs.html"/>
+<tocsect3 name="13.4 xml.parsers.expat -- Fast XML parsing using the Expat library" url="lib/module-xml.parsers.expat.html">
+<tocsect4 name="13.4.1 Example " url="lib/expat-example.html"/>
+<tocsect4 name="13.4.2 Expat error constants " url="lib/expat-errors.html"/>
+</tocsect3>
+<tocsect3 name="13.5 xml.sax -- Support for SAX2 parsers" url="lib/module-xml.sax.html">
+<tocsect4 name="13.5.1 SAXException Objects " url="lib/sax-exception-objects.html"/>
+</tocsect3>
+<tocsect3 name="13.6 xml.sax.handler -- Base classes for SAX handlers" url="lib/module-xml.sax.handler.html">
+<tocsect4 name="13.6.1 ContentHandler Objects " url="lib/content-handler-objects.html"/>
+<tocsect4 name="13.6.2 DTDHandler Objects " url="lib/dtd-handler-objects.html"/>
+<tocsect4 name="13.6.3 EntityResolver Objects " url="lib/entity-resolver-objects.html"/>
+</tocsect3>
+<tocsect3 name="13.7 xml.sax.saxutils -- SAX Utilities" url="lib/module-xml.sax.saxutils.html"/>
+<tocsect3 name="13.8 xml.sax.xmlreader -- Interface for XML parsers" url="lib/module-xml.sax.xmlreader.html">
+<tocsect4 name="13.8.1 XMLReader Objects " url="lib/xmlreader-objects.html"/>
+<tocsect4 name="13.8.2 IncrementalParser Objects " url="lib/incremental-parser-objects.html"/>
+<tocsect4 name="13.8.3 Locator Objects " url="lib/locator-objects.html"/>
+<tocsect4 name="13.8.4 InputSource Objects " url="lib/input-source-objects.html"/>
+<tocsect4 name="13.8.5 AttributesImpl Objects " url="lib/attributes-impl-objects.html"/>
+<tocsect4 name="13.8.6 AttributesNSImpl Objects " url="lib/attributes-ns-impl-objects.html"/>
+</tocsect3>
+<tocsect3 name="13.9 xmllib -- A parser for XML documents" url="lib/module-xmllib.html">
+<tocsect4 name="13.9.1 XML Namespaces " url="lib/xml-namespace.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="14. Multimedia Services" url="lib/mmedia.html">
+<tocsect3 name="14.1 audioop -- Manipulate raw audio data" url="lib/module-audioop.html"/>
+<tocsect3 name="14.2 imageop -- Manipulate raw image data" url="lib/module-imageop.html"/>
+<tocsect3 name="14.3 aifc -- Read and write AIFF and AIFC files" url="lib/module-aifc.html"/>
+<tocsect3 name="14.4 sunau -- Read and write Sun AU files" url="lib/module-sunau.html">
+<tocsect4 name="14.4.1 AU_read Objects " url="lib/au-read-objects.html"/>
+<tocsect4 name="14.4.2 AU_write Objects " url="lib/au-write-objects.html"/>
+</tocsect3>
+<tocsect3 name="14.5 wave -- Read and write WAV files" url="lib/module-wave.html">
+<tocsect4 name="14.5.1 Wave_read Objects " url="lib/Wave-read-objects.html"/>
+<tocsect4 name="14.5.2 Wave_write Objects " url="lib/Wave-write-objects.html"/>
+</tocsect3>
+<tocsect3 name="14.6 chunk -- Read IFF chunked data" url="lib/module-chunk.html"/>
+<tocsect3 name="14.7 colorsys -- Conversions between color systems" url="lib/module-colorsys.html"/>
+<tocsect3 name="14.8 rgbimg -- Read and write ``SGI RGB'' files" url="lib/module-rgbimg.html"/>
+<tocsect3 name="14.9 imghdr -- Determine the type of an image" url="lib/module-imghdr.html"/>
+<tocsect3 name="14.10 sndhdr -- Determine type of sound file" url="lib/module-sndhdr.html"/>
+</tocsect2>
+<tocsect2 name="15. Cryptographic Services" url="lib/crypto.html">
+<tocsect3 name="15.1 md5 -- MD5 message digest algorithm" url="lib/module-md5.html"/>
+<tocsect3 name="15.2 sha -- SHA message digest algorithm" url="lib/module-sha.html"/>
+<tocsect3 name="15.3 mpz -- GNU arbitrary magnitude integers" url="lib/module-mpz.html"/>
+<tocsect3 name="15.4 rotor -- Enigma-like encryption and decryption" url="lib/module-rotor.html"/>
+</tocsect2>
+<tocsect2 name="16. Restricted Execution " url="lib/restricted.html">
+<tocsect3 name="16.1 rexec -- Restricted execution framework" url="lib/module-rexec.html">
+<tocsect4 name="16.1.1 An example" url="lib/node366.html"/>
+</tocsect3>
+<tocsect3 name="16.2 Bastion -- Restricting access to objects" url="lib/module-Bastion.html"/>
+</tocsect2>
+<tocsect2 name="17. Python Language Services " url="lib/language.html">
+<tocsect3 name="17.1 parser -- Access Python parse trees" url="lib/module-parser.html">
+<tocsect4 name="17.1.1 Creating AST Objects " url="lib/Creating_ASTs.html"/>
+<tocsect4 name="17.1.2 Converting AST Objects " url="lib/Converting_ASTs.html"/>
+<tocsect4 name="17.1.3 Queries on AST Objects " url="lib/Querying_ASTs.html"/>
+<tocsect4 name="17.1.4 Exceptions and Error Handling " url="lib/AST_Errors.html"/>
+<tocsect4 name="17.1.5 AST Objects " url="lib/AST_Objects.html"/>
+<tocsect4 name="17.1.6 Examples " url="lib/AST_Examples.html"/>
+</tocsect3>
+<tocsect3 name="17.2 symbol -- Constants used with Python parse trees" url="lib/module-symbol.html"/>
+<tocsect3 name="17.3 token -- Constants used with Python parse trees" url="lib/module-token.html"/>
+<tocsect3 name="17.4 keyword -- Testing for Python keywords" url="lib/module-keyword.html"/>
+<tocsect3 name="17.5 tokenize -- Tokenizer for Python source" url="lib/module-tokenize.html"/>
+<tocsect3 name="17.6 tabnanny -- Detection of ambiguous indentation" url="lib/module-tabnanny.html"/>
+<tocsect3 name="17.7 pyclbr -- Python class browser support" url="lib/module-pyclbr.html">
+<tocsect4 name="17.7.1 Class Descriptor Objects " url="lib/pyclbr-class-objects.html"/>
+</tocsect3>
+<tocsect3 name="17.8 py_compile -- Compile Python source files" url="lib/module-pycompile.html"/>
+<tocsect3 name="17.9 compileall -- Byte-compile Python libraries" url="lib/module-compileall.html"/>
+<tocsect3 name="17.10 dis -- Disassembler for Python byte code" url="lib/module-dis.html">
+<tocsect4 name="17.10.1 Python Byte Code Instructions" url="lib/bytecodes.html"/>
+</tocsect3>
+</tocsect2>
+<tocsect2 name="18. SGI IRIX Specific Services" url="lib/sgi.html">
+<tocsect3 name="18.1 al -- Audio functions on the SGI" url="lib/module-al.html">
+<tocsect4 name="18.1.1 Configuration Objects " url="lib/al-config-objects.html"/>
+<tocsect4 name="18.1.2 Port Objects " url="lib/al-port-objects.html"/>
+</tocsect3>
+<tocsect3 name="18.2 AL -- Constants used with the al module" url="lib/module-al-constants.html"/>
+<tocsect3 name="18.3 cd -- CD-ROM access on SGI systems" url="lib/module-cd.html">
+<tocsect4 name="18.3.1 Player Objects" url="lib/player-objects.html"/>
+<tocsect4 name="18.3.2 Parser Objects" url="lib/cd-parser-objects.html"/>
+</tocsect3>
+<tocsect3 name="18.4 fl -- FORMS library interface for GUI applications" url="lib/module-fl.html">
+<tocsect4 name="18.4.1 Functions Defined in Module fl" url="lib/FL_Functions.html"/>
+<tocsect4 name="18.4.2 Form Objects" url="lib/form-objects.html"/>
+<tocsect4 name="18.4.3 FORMS Objects" url="lib/forms-objects.html"/>
+</tocsect3>
+<tocsect3 name="18.5 FL -- Constants used with the fl module" url="lib/module-fl-constants.html"/>
+<tocsect3 name="18.6 flp -- Functions for loading stored FORMS designs" url="lib/module-flp.html"/>
+<tocsect3 name="18.7 fm -- Font Manager interface" url="lib/module-fm.html"/>
+<tocsect3 name="18.8 gl -- Graphics Library interface" url="lib/module-gl.html"/>
+<tocsect3 name="18.9 DEVICE -- Constants used with the gl module" url="lib/module-DEVICE.html"/>
+<tocsect3 name="18.10 GL -- Constants used with the gl module" url="lib/module-gl-constants.html"/>
+<tocsect3 name="18.11 imgfile -- Support for SGI imglib files" url="lib/module-imgfile.html"/>
+<tocsect3 name="18.12 jpeg -- Read and write JPEG files" url="lib/module-jpeg.html"/>
+</tocsect2>
+<tocsect2 name="19. SunOS Specific Services" url="lib/sunos.html">
+<tocsect3 name="19.1 sunaudiodev -- Access to Sun audio hardware" url="lib/module-sunaudiodev.html">
+<tocsect4 name="19.1.1 Audio Device Objects " url="lib/audio-device-objects.html"/>
+</tocsect3>
+<tocsect3 name="19.2 SUNAUDIODEV -- Constants used with sunaudiodev" url="lib/module-sunaudiodev-constants.html"/>
+</tocsect2>
+<tocsect2 name="20. MS Windows Specific Services" url="lib/node413.html">
+<tocsect3 name="20.1 msvcrt - Useful routines from the MS VC++ runtime" url="lib/module-msvcrt.html">
+<tocsect4 name="20.1.1 File Operations " url="lib/msvcrt-files.html"/>
+<tocsect4 name="20.1.2 Console I/O " url="lib/msvcrt-console.html"/>
+<tocsect4 name="20.1.3 Other Functions " url="lib/msvcrt-other.html"/>
+</tocsect3>
+<tocsect3 name="20.2 _winreg - Windows registry access" url="lib/module--winreg.html">
+<tocsect4 name="20.2.1 Registry handle objects " url="lib/handle-object.html"/>
+</tocsect3>
+<tocsect3 name="20.3 winsound -- Sound-playing interface for Windows" url="lib/module-winsound.html"/>
+</tocsect2>
+<tocsect2 name="A. Undocumented Modules " url="lib/undoc.html">
+<tocsect3 name="A.1 Frameworks" url="lib/node422.html"/>
+<tocsect3 name="A.2 Miscellaneous useful utilities" url="lib/node423.html"/>
+<tocsect3 name="A.3 Platform specific modules" url="lib/node424.html"/>
+<tocsect3 name="A.4 Multimedia" url="lib/node425.html"/>
+<tocsect3 name="A.5 Obsolete " url="lib/obsolete-modules.html"/>
+<tocsect3 name="A.6 SGI-specific Extension modules" url="lib/node427.html"/>
+</tocsect2>
+<tocsect2 name="B. Reporting Bugs" url="lib/reporting-bugs.html"/>
+<tocsect2 name="Module Index" url="lib/modindex.html"/>
+<tocsect2 name="Index" url="lib/genindex.html"/>
+<tocsect2 name="About this document ..." url="lib/about.html"/>
+</tocsect1>
+
+<index>
+<entry name="__abs__() (numeric object method)" url="ref/numeric-types.html#l2h-209"/>
+<entry name="__add__() (numeric object method)" url="ref/numeric-types.html#l2h-183"/>
+<entry name="__add__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__and__() (numeric object method)" url="ref/numeric-types.html#l2h-192"/>
+<entry name="__bases__ (class attribute)" url="ref/types.html#l2h-47"/>
+<entry name="__builtin__ (built-in module)" url="ref/execframes.html#l2h-247"/>
+<entry name="__builtins__" url="ref/exec.html#l2h-399"/>
+<entry name="__call__() (object method)" url="ref/callable-types.html#l2h-163"/>
+<entry name="__class__ (instance attribute)" url="ref/types.html#l2h-49"/>
+<entry name="__cmp__() (object method)" url="ref/customization.html#l2h-137"/>
+<entry name="__coerce__() (numeric object method)" url="ref/sequence-types.html#l2h-170"/>
+<entry name="__complex__() (numeric object method)" url="ref/numeric-types.html#l2h-211"/>
+<entry name="__contains__() (sequence object method)" url="ref/sequence-methods.html#l2h-182"/>
+<entry name="__debug__" url="ref/assert.html#l2h-340"/>
+<entry name="__del__() (object method)" url="ref/customization.html#l2h-134"/>
+<entry name="__delattr__() (object method)" url="ref/attribute-access.html#l2h-162"/>
+<entry name="__delitem__() (mapping object method)" url="ref/sequence-types.html#l2h-176"/>
+<entry name="__delslice__() (sequence object method)" url="ref/sequence-methods.html#l2h-181"/>
+<entry name="__dict__ (class attribute)" url="ref/types.html#l2h-47"/>
+<entry name="__dict__ (instance attribute)" url="ref/types.html#l2h-49"/>
+<entry name="__dict__ (module attribute)" url="ref/types.html#l2h-43"/>
+<entry name="__div__() (numeric object method)" url="ref/numeric-types.html#l2h-186"/>
+<entry name="__divmod__() (numeric object method)" url="ref/numeric-types.html#l2h-188"/>
+<entry name="__doc__ (class attribute)" url="ref/types.html#l2h-47"/>
+<entry name="__doc__ (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="__doc__ (module attribute)" url="ref/types.html#l2h-45"/>
+<entry name="__file__ (module attribute)" url="ref/types.html#l2h-45"/>
+<entry name="__float__() (numeric object method)" url="ref/numeric-types.html#l2h-214"/>
+<entry name="__getattr__() (object method)" url="ref/attribute-access.html#l2h-156"/>
+<entry name="__getitem__() (mapping object method)" url="ref/specialnames.html#l2h-132"/>
+<entry name="__getslice__() (sequence object method)" url="ref/sequence-methods.html#l2h-179"/>
+<entry name="__hash__() (object method)" url="ref/customization.html#l2h-139"/>
+<entry name="__hex__() (numeric object method)" url="ref/numeric-types.html#l2h-216"/>
+<entry name="__iadd__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__import__() (built-in function)" url="ref/import.html#l2h-394"/>
+<entry name="__imul__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__init__() (object method)" url="ref/types.html#l2h-41"/>
+<entry name="__init__.py" url="ref/import.html#l2h-393"/>
+<entry name="__int__() (numeric object method)" url="ref/numeric-types.html#l2h-212"/>
+<entry name="__invert__() (numeric object method)" url="ref/numeric-types.html#l2h-210"/>
+<entry name="__len__() (mapping object method)" url="ref/customization.html#l2h-144"/>
+<entry name="__long__() (numeric object method)" url="ref/numeric-types.html#l2h-213"/>
+<entry name="__lshift__() (numeric object method)" url="ref/numeric-types.html#l2h-190"/>
+<entry name="__main__ (built-in module)" url="ref/execframes.html#l2h-235"/>
+<entry name="__members__ (built-in object attribute)" url="ref/types.html#l2h-31"/>
+<entry name="__methods__ (built-in object attribute)" url="ref/types.html#l2h-31"/>
+<entry name="__mod__() (numeric object method)" url="ref/numeric-types.html#l2h-187"/>
+<entry name="__module__ (class attribute)" url="ref/types.html#l2h-47"/>
+<entry name="__mul__() (numeric object method)" url="ref/numeric-types.html#l2h-185"/>
+<entry name="__mul__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__name__ (class attribute)" url="ref/types.html#l2h-47"/>
+<entry name="__name__ (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="__name__ (module attribute)" url="ref/types.html#l2h-45"/>
+<entry name="__neg__() (numeric object method)" url="ref/numeric-types.html#l2h-207"/>
+<entry name="__nonzero__() (object method)" url="ref/customization.html#l2h-142"/>
+<entry name="__oct__() (numeric object method)" url="ref/numeric-types.html#l2h-215"/>
+<entry name="__or__() (numeric object method)" url="ref/numeric-types.html#l2h-194"/>
+<entry name="__pos__() (numeric object method)" url="ref/numeric-types.html#l2h-208"/>
+<entry name="__pow__() (numeric object method)" url="ref/numeric-types.html#l2h-189"/>
+<entry name="__radd__() (numeric object method)" url="ref/numeric-types.html#l2h-195"/>
+<entry name="__radd__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__rand__() (numeric object method)" url="ref/numeric-types.html#l2h-204"/>
+<entry name="__rcmp__() (object method)" url="ref/customization.html#l2h-138"/>
+<entry name="__rdiv__() (numeric object method)" url="ref/numeric-types.html#l2h-198"/>
+<entry name="__rdivmod__() (numeric object method)" url="ref/numeric-types.html#l2h-200"/>
+<entry name="__repr__() (object method)" url="ref/customization.html#l2h-135"/>
+<entry name="__rlshift__() (numeric object method)" url="ref/numeric-types.html#l2h-202"/>
+<entry name="__rmod__() (numeric object method)" url="ref/numeric-types.html#l2h-199"/>
+<entry name="__rmul__() (numeric object method)" url="ref/numeric-types.html#l2h-197"/>
+<entry name="__rmul__() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="__ror__() (numeric object method)" url="ref/numeric-types.html#l2h-206"/>
+<entry name="__rpow__() (numeric object method)" url="ref/numeric-types.html#l2h-201"/>
+<entry name="__rrshift__() (numeric object method)" url="ref/numeric-types.html#l2h-203"/>
+<entry name="__rshift__() (numeric object method)" url="ref/numeric-types.html#l2h-191"/>
+<entry name="__rsub__() (numeric object method)" url="ref/numeric-types.html#l2h-196"/>
+<entry name="__rxor__() (numeric object method)" url="ref/numeric-types.html#l2h-205"/>
+<entry name="__setattr__() (object method)" url="ref/attribute-access.html#l2h-158"/>
+<entry name="__setitem__() (mapping object method)" url="ref/sequence-types.html#l2h-175"/>
+<entry name="__setslice__() (sequence object method)" url="ref/sequence-methods.html#l2h-180"/>
+<entry name="__str__() (object method)" url="ref/customization.html#l2h-136"/>
+<entry name="__sub__() (numeric object method)" url="ref/numeric-types.html#l2h-184"/>
+<entry name="__xor__() (numeric object method)" url="ref/numeric-types.html#l2h-193"/>
+<entry name="abs() (built-in function)" url="ref/numeric-types.html#l2h-224"/>
+<entry name="addition" url="ref/binary.html#l2h-311"/>
+<entry name="and, bit-wise" url="ref/bitwise.html#l2h-316"/>
+<entry name="and operator" url="ref/lambda.html#l2h-326"/>
+<entry name="anonmymous, function" url="ref/lambda.html#l2h-328"/>
+<entry name="append() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="argument, function" url="ref/types.html#l2h-102"/>
+<entry name="arithmetic, conversion" url="ref/conversions.html#l2h-260"/>
+<entry name="arithmetic, operation, binary" url="ref/binary.html#l2h-307"/>
+<entry name="arithmetic, operation, unary" url="ref/unary.html#l2h-302"/>
+<entry name="array (standard module)" url="ref/types.html#l2h-94"/>
+<entry name="ASCII" url="ref/notation.html#l2h-2"/>
+<entry name="assert statement" url="ref/assert.html#l2h-338"/>
+<entry name="AssertionError exception" url="ref/assert.html#l2h-341"/>
+<entry name="assertions, debugging" url="ref/assert.html#l2h-339"/>
+<entry name="assignment, attribute" url="ref/assignment.html#l2h-343"/>
+<entry name="assignment, augmented" url="ref/augassign.html#l2h-354"/>
+<entry name="assignment, class attribute" url="ref/types.html#l2h-112"/>
+<entry name="assignment (continued), class instance attribute" url="ref/types.html#l2h-115"/>
+<entry name="assignment (continued), slicing" url="ref/assignment.html#l2h-353"/>
+<entry name="assignment (continued), statement" url="ref/types.html#l2h-92"/>
+<entry name="assignment (continued), subscription" url="ref/assignment.html#l2h-350"/>
+<entry name="assignment (continued), target list" url="ref/assignment.html#l2h-346"/>
+<entry name="atom" url="ref/atoms.html#l2h-261"/>
+<entry name="attribute" url="ref/types.html#l2h-69"/>
+<entry name="assignment" url="ref/assignment.html#l2h-343"/>
+<entry name="assignment, class" url="ref/types.html#l2h-112"/>
+<entry name="assignment, class instance" url="ref/types.html#l2h-115"/>
+<entry name="class" url="ref/types.html#l2h-111"/>
+<entry name="class instance" url="ref/types.html#l2h-114"/>
+<entry name="deletion" url="ref/del.html#l2h-360"/>
+<entry name="generic special" url="ref/types.html#l2h-69"/>
+<entry name="reference" url="ref/attribute-references.html#l2h-282"/>
+<entry name="special" url="ref/types.html#l2h-69"/>
+<entry name="AttributeError exception" url="ref/attribute-references.html#l2h-283"/>
+<entry name="augmented, assignment" url="ref/augassign.html#l2h-354"/>
+<entry name="augmented, back-quotes" url="ref/customization.html#l2h-149"/>
+<entry name="augmented, backslash character" url="ref/explicit-joining.html#l2h-7"/>
+<entry name="backward, quotes" url="ref/customization.html#l2h-149"/>
+<entry name="binary, arithmetic operation" url="ref/binary.html#l2h-307"/>
+<entry name="binary, bit-wise operation" url="ref/bitwise.html#l2h-315"/>
+<entry name="binding, global name" url="ref/global.html#l2h-396"/>
+<entry name="binding, name" url="ref/execframes.html#l2h-241"/>
+<entry name="bit-wise, and" url="ref/bitwise.html#l2h-316"/>
+<entry name="bit-wise, operation, binary" url="ref/bitwise.html#l2h-315"/>
+<entry name="bit-wise, operation, unary" url="ref/unary.html#l2h-302"/>
+<entry name="bit-wise, or" url="ref/bitwise.html#l2h-318"/>
+<entry name="bit-wise, xor" url="ref/bitwise.html#l2h-317"/>
+<entry name="blank line" url="ref/blank-lines.html#l2h-8"/>
+<entry name="block, code" url="ref/execframes.html#l2h-238"/>
+<entry name="block, BNF" url="ref/notation.html#l2h-1"/>
+<entry name="Boolean, operation" url="ref/lambda.html#l2h-324"/>
+<entry name="break statement" url="ref/break.html#l2h-375"/>
+<entry name="bsddb (standard module)" url="ref/types.html#l2h-100"/>
+<entry name="built-in, method" url="ref/types.html#l2h-107"/>
+<entry name="built-in, module" url="ref/import.html#l2h-386"/>
+<entry name="built-in, name" url="ref/atom-identifiers.html#l2h-263"/>
+<entry name="built-in function, call" url="ref/calls.html#l2h-298"/>
+<entry name="built-in function object" url="ref/types.html#l2h-106"/>
+<entry name="built-in method, call" url="ref/calls.html#l2h-298"/>
+<entry name="built-in method object" url="ref/types.html#l2h-107"/>
+<entry name="byte" url="ref/types.html#l2h-85"/>
+<entry name="bytecode" url="ref/types.html#l2h-124"/>
+<entry name="C" url="ref/strings.html#l2h-17"/>
+<entry name="language" url="ref/types.html#l2h-68"/>
+<entry name="call" url="ref/calls.html#l2h-293"/>
+<entry name="built-in function" url="ref/calls.html#l2h-298"/>
+<entry name="built-in method" url="ref/calls.html#l2h-298"/>
+<entry name="class instance" url="ref/calls.html#l2h-300"/>
+<entry name="class object" url="ref/types.html#l2h-108"/>
+<entry name="function" url="ref/types.html#l2h-102"/>
+<entry name="instance" url="ref/callable-types.html#l2h-164"/>
+<entry name="method" url="ref/calls.html#l2h-298"/>
+<entry name="procedure" url="ref/exprstmts.html#l2h-337"/>
+<entry name="user-defined function" url="ref/calls.html#l2h-297"/>
+<entry name="callable object" url="ref/types.html#l2h-101"/>
+<entry name="chaining, comparisons" url="ref/comparisons.html#l2h-321"/>
+<entry name="character" url="ref/types.html#l2h-85"/>
+<entry name="character set" url="ref/types.html#l2h-86"/>
+<entry name="chr() (built-in function)" url="ref/types.html#l2h-83"/>
+<entry name="class, attribute" url="ref/types.html#l2h-111"/>
+<entry name="class, attribute assignment" url="ref/types.html#l2h-112"/>
+<entry name="class, constructor" url="ref/customization.html#l2h-145"/>
+<entry name="class, definition" url="ref/return.html#l2h-370"/>
+<entry name="class, instance" url="ref/types.html#l2h-114"/>
+<entry name="class, name" url="ref/class.html#l2h-434"/>
+<entry name="class instance, attribute" url="ref/types.html#l2h-114"/>
+<entry name="class instance, attribute assignment" url="ref/types.html#l2h-115"/>
+<entry name="class instance, call" url="ref/calls.html#l2h-300"/>
+<entry name="class instance object" url="ref/types.html#l2h-108"/>
+<entry name="class object" url="ref/types.html#l2h-108"/>
+<entry name="call" url="ref/types.html#l2h-108"/>
+<entry name="clause" url="ref/compound.html#l2h-403"/>
+<entry name="clear() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="cmp() (built-in function)" url="ref/customization.html#l2h-152"/>
+<entry name="co_argcount (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_code (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_consts (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_filename (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_firstlineno (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_flags (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_lnotab (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_name (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_names (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_nlocals (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_stacksize (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="co_varnames (code object attribute)" url="ref/types.html#l2h-57"/>
+<entry name="code, block" url="ref/execframes.html#l2h-238"/>
+<entry name="code block" url="ref/execframes.html#l2h-232"/>
+<entry name="code object" url="ref/types.html#l2h-124"/>
+<entry name="comma" url="ref/parenthesized.html#l2h-270"/>
+<entry name="trailing" url="ref/exprlists.html#l2h-331"/>
+<entry name="command line" url="ref/programs.html#l2h-439"/>
+<entry name="comment" url="ref/comments.html#l2h-6"/>
+<entry name="comparison" url="ref/comparisons.html#l2h-319"/>
+<entry name="string" url="ref/types.html#l2h-86"/>
+<entry name="comparisons" url="ref/customization.html#l2h-152"/>
+<entry name="chaining" url="ref/comparisons.html#l2h-321"/>
+<entry name="compile() (built-in function)" url="ref/global.html#l2h-397"/>
+<entry name="complex, number" url="ref/types.html#l2h-78"/>
+<entry name="complex() (built-in function)" url="ref/numeric-types.html#l2h-225"/>
+<entry name="complex literal" url="ref/numbers.html#l2h-20"/>
+<entry name="complex object" url="ref/types.html#l2h-78"/>
+<entry name="compound, statement" url="ref/compound.html#l2h-402"/>
+<entry name="comprehensions, list" url="ref/lists.html#l2h-271"/>
+<entry name="constant" url="ref/literals.html#l2h-13"/>
+<entry name="constructor, class" url="ref/customization.html#l2h-145"/>
+<entry name="container" url="ref/objects.html#l2h-29"/>
+<entry name="continue statement" url="ref/continue.html#l2h-380"/>
+<entry name="conversion, arithmetic" url="ref/conversions.html#l2h-260"/>
+<entry name="conversion, string" url="ref/customization.html#l2h-149"/>
+<entry name="copy() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="count() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="dangling, else" url="ref/compound.html#l2h-406"/>
+<entry name="data" url="ref/objects.html#l2h-24"/>
+<entry name="type" url="ref/types.html#l2h-68"/>
+<entry name="type, immutable" url="ref/atom-literals.html#l2h-267"/>
+<entry name="datum" url="ref/dict.html#l2h-275"/>
+<entry name="dbm (standard module)" url="ref/types.html#l2h-98"/>
+<entry name="debugging, assertions" url="ref/assert.html#l2h-339"/>
+<entry name="decimal literal" url="ref/numbers.html#l2h-20"/>
+<entry name="DEDENT token" url="ref/indentation.html#l2h-10"/>
+<entry name="default, parameter value" url="ref/function.html#l2h-430"/>
+<entry name="definition, class" url="ref/return.html#l2h-370"/>
+<entry name="definition, function" url="ref/return.html#l2h-370"/>
+<entry name="del statement" url="ref/types.html#l2h-92"/>
+<entry name="delete" url="ref/types.html#l2h-92"/>
+<entry name="deletion, attribute" url="ref/del.html#l2h-360"/>
+<entry name="deletion, target" url="ref/del.html#l2h-358"/>
+<entry name="deletion, target list" url="ref/del.html#l2h-358"/>
+<entry name="delimiters" url="ref/delimiters.html#l2h-22"/>
+<entry name="destructor" url="ref/customization.html#l2h-146"/>
+<entry name="dictionary, display" url="ref/dict.html#l2h-274"/>
+<entry name="dictionary object" url="ref/types.html#l2h-96"/>
+<entry name="display, dictionary" url="ref/dict.html#l2h-274"/>
+<entry name="display, list" url="ref/lists.html#l2h-271"/>
+<entry name="display, tuple" url="ref/parenthesized.html#l2h-270"/>
+<entry name="division" url="ref/binary.html#l2h-309"/>
+<entry name="divmod() (built-in function)" url="ref/numeric-types.html#l2h-218"/>
+<entry name="documentation string" url="ref/types.html#l2h-125"/>
+<entry name="EBCDIC" url="ref/types.html#l2h-86"/>
+<entry name="elif, keyword" url="ref/if.html#l2h-408"/>
+<entry name="Ellipsis" url="ref/types.html#l2h-71"/>
+<entry name="Ellipsis object" url="ref/types.html#l2h-71"/>
+<entry name="else, dangling" url="ref/compound.html#l2h-406"/>
+<entry name="else, keyword" url="ref/break.html#l2h-377"/>
+<entry name="empty, list" url="ref/lists.html#l2h-273"/>
+<entry name="empty, tuple" url="ref/types.html#l2h-91"/>
+<entry name="error handling" url="ref/exceptions.html#l2h-255"/>
+<entry name="errors" url="ref/exceptions.html#l2h-255"/>
+<entry name="escape sequence" url="ref/strings.html#l2h-17"/>
+<entry name="eval() (built-in function)" url="ref/global.html#l2h-397"/>
+<entry name="exc_info (in module sys)" url="ref/types.html#l2h-63"/>
+<entry name="exc_traceback (in module sys)" url="ref/types.html#l2h-63"/>
+<entry name="exc_type (in module sys)" url="ref/try.html#l2h-419"/>
+<entry name="exc_value (in module sys)" url="ref/try.html#l2h-419"/>
+<entry name="except, keyword" url="ref/try.html#l2h-421"/>
+<entry name="exception" url="ref/exceptions.html#l2h-250"/>
+<entry name="AssertionError" url="ref/assert.html#l2h-341"/>
+<entry name="AttributeError" url="ref/attribute-references.html#l2h-283"/>
+<entry name="handler" url="ref/types.html#l2h-127"/>
+<entry name="ImportError" url="ref/import.html#l2h-387"/>
+<entry name="NameError" url="ref/atom-identifiers.html#l2h-264"/>
+<entry name="exception (continued), raising" url="ref/raise.html#l2h-373"/>
+<entry name="exception (continued), RuntimeError" url="ref/print.html#l2h-367"/>
+<entry name="exception (continued), SyntaxError" url="ref/import.html#l2h-387"/>
+<entry name="exception (continued), TypeError" url="ref/unary.html#l2h-306"/>
+<entry name="exception (continued), ValueError" url="ref/shifting.html#l2h-314"/>
+<entry name="exception (continued), ZeroDivisionError" url="ref/binary.html#l2h-309"/>
+<entry name="exception handler" url="ref/exceptions.html#l2h-255"/>
+<entry name="exclusive, or" url="ref/bitwise.html#l2h-317"/>
+<entry name="exec statement" url="ref/execframes.html#l2h-249"/>
+<entry name="execfile() (built-in function)" url="ref/global.html#l2h-397"/>
+<entry name="execution, frame" url="ref/execframes.html#l2h-237"/>
+<entry name="execution, restricted" url="ref/execframes.html#l2h-248"/>
+<entry name="execution, stack" url="ref/types.html#l2h-127"/>
+<entry name="execution model" url="ref/execmodel.html#l2h-231"/>
+<entry name="expression" url="ref/expressions.html#l2h-257"/>
+<entry name="lambda" url="ref/lambda.html#l2h-328"/>
+<entry name="list" url="ref/exprlists.html#l2h-329"/>
+<entry name="statement" url="ref/exprstmts.html#l2h-334"/>
+<entry name="extended, slicing" url="ref/slicings.html#l2h-292"/>
+<entry name="extended print statement" url="ref/print.html#l2h-368"/>
+<entry name="extension, filename" url="ref/import.html#l2h-386"/>
+<entry name="extension, module" url="ref/types.html#l2h-68"/>
+<entry name="extension, f_back (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_builtins (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_code (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_exc_traceback (frame attribute)" url="ref/types.html#l2h-61"/>
+<entry name="extension, f_exc_type (frame attribute)" url="ref/types.html#l2h-61"/>
+<entry name="extension, f_exc_value (frame attribute)" url="ref/types.html#l2h-61"/>
+<entry name="extension, f_globals (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_lasti (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_lineno (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_locals (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_restricted (frame attribute)" url="ref/types.html#l2h-59"/>
+<entry name="extension, f_trace (frame attribute)" url="ref/types.html#l2h-61"/>
+<entry name="extension, file object" url="ref/types.html#l2h-117"/>
+<entry name="filename, extension" url="ref/import.html#l2h-386"/>
+<entry name="finally, keyword" url="ref/return.html#l2h-371"/>
+<entry name="float() (built-in function)" url="ref/numeric-types.html#l2h-228"/>
+<entry name="floating point, number" url="ref/types.html#l2h-77"/>
+<entry name="floating point literal" url="ref/numbers.html#l2h-20"/>
+<entry name="floating point object" url="ref/types.html#l2h-77"/>
+<entry name="for statement" url="ref/break.html#l2h-376"/>
+<entry name="form, lambda" url="ref/lambda.html#l2h-328"/>
+<entry name="frame, execution" url="ref/execframes.html#l2h-237"/>
+<entry name="frame object" url="ref/types.html#l2h-126"/>
+<entry name="from, keyword" url="ref/import.html#l2h-385"/>
+<entry name="from statement" url="ref/execframes.html#l2h-249"/>
+<entry name="func_code (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="func_defaults (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="func_doc (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="func_globals (function attribute)" url="ref/types.html#l2h-35"/>
+<entry name="function, anonmymous" url="ref/lambda.html#l2h-328"/>
+<entry name="function, argument" url="ref/types.html#l2h-102"/>
+<entry name="function, call" url="ref/types.html#l2h-102"/>
+<entry name="function, call, user-defined" url="ref/calls.html#l2h-297"/>
+<entry name="function, definition" url="ref/return.html#l2h-370"/>
+<entry name="function, name" url="ref/function.html#l2h-429"/>
+<entry name="function, user-defined" url="ref/types.html#l2h-103"/>
+<entry name="function object" url="ref/types.html#l2h-103"/>
+<entry name="garbage collection" url="ref/objects.html#l2h-28"/>
+<entry name="gdbm (standard module)" url="ref/types.html#l2h-99"/>
+<entry name="generic, special attribute" url="ref/types.html#l2h-69"/>
+<entry name="get() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="global, name" url="ref/atom-identifiers.html#l2h-263"/>
+<entry name="global, name binding" url="ref/global.html#l2h-396"/>
+<entry name="global (continued), namespace" url="ref/types.html#l2h-104"/>
+<entry name="global statement" url="ref/execframes.html#l2h-246"/>
+<entry name="globals() (built-in function)" url="ref/exec.html#l2h-400"/>
+<entry name="grammar" url="ref/notation.html#l2h-1"/>
+<entry name="grouping" url="ref/indentation.html#l2h-9"/>
+<entry name="handle an exception" url="ref/exceptions.html#l2h-254"/>
+<entry name="handler, exception" url="ref/types.html#l2h-127"/>
+<entry name="has_key() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="hash() (built-in function)" url="ref/customization.html#l2h-155"/>
+<entry name="hash character" url="ref/comments.html#l2h-6"/>
+<entry name="hex() (built-in function)" url="ref/numeric-types.html#l2h-230"/>
+<entry name="hexadecimal literal" url="ref/numbers.html#l2h-20"/>
+<entry name="hierarchical, module names" url="ref/import.html#l2h-391"/>
+<entry name="hierarchy, type" url="ref/types.html#l2h-68"/>
+<entry name="hierarchy, id() (built-in function)" url="ref/objects.html#l2h-25"/>
+<entry name="hierarchy, identifier" url="ref/identifiers.html#l2h-11"/>
+<entry name="identity, test" url="ref/comparisons.html#l2h-323"/>
+<entry name="identity of an object" url="ref/objects.html#l2h-27"/>
+<entry name="if statement" url="ref/if.html#l2h-407"/>
+<entry name="im_class (method attribute)" url="ref/types.html#l2h-39"/>
+<entry name="im_func (method attribute)" url="ref/types.html#l2h-37"/>
+<entry name="im_self (method attribute)" url="ref/types.html#l2h-37"/>
+<entry name="imaginary literal" url="ref/numbers.html#l2h-20"/>
+<entry name="immutable, data type" url="ref/atom-literals.html#l2h-267"/>
+<entry name="immutable, object" url="ref/atom-literals.html#l2h-267"/>
+<entry name="immutable object" url="ref/objects.html#l2h-27"/>
+<entry name="immutable sequence object" url="ref/types.html#l2h-82"/>
+<entry name="import statement" url="ref/types.html#l2h-109"/>
+<entry name="ImportError exception" url="ref/import.html#l2h-387"/>
+<entry name="importing, module" url="ref/import.html#l2h-385"/>
+<entry name="in, keyword" url="ref/for.html#l2h-414"/>
+<entry name="in operator" url="ref/comparisons.html#l2h-322"/>
+<entry name="inclusive, or" url="ref/bitwise.html#l2h-318"/>
+<entry name="INDENT token" url="ref/indentation.html#l2h-10"/>
+<entry name="indentation" url="ref/indentation.html#l2h-9"/>
+<entry name="index() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="index operation" url="ref/types.html#l2h-80"/>
+<entry name="inheritance" url="ref/class.html#l2h-434"/>
+<entry name="initialization, module" url="ref/import.html#l2h-387"/>
+<entry name="input" url="ref/expression-input.html#l2h-440"/>
+<entry name="raw" url="ref/expression-input.html#l2h-445"/>
+<entry name="input() (built-in function)" url="ref/expression-input.html#l2h-444"/>
+<entry name="insert() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="instance, call" url="ref/callable-types.html#l2h-164"/>
+<entry name="instance, class" url="ref/types.html#l2h-114"/>
+<entry name="instance object" url="ref/types.html#l2h-108"/>
+<entry name="int() (built-in function)" url="ref/numeric-types.html#l2h-226"/>
+<entry name="integer" url="ref/types.html#l2h-90"/>
+<entry name="representation" url="ref/types.html#l2h-76"/>
+<entry name="integer literal" url="ref/numbers.html#l2h-20"/>
+<entry name="integer object" url="ref/types.html#l2h-73"/>
+<entry name="interactive mode" url="ref/programs.html#l2h-438"/>
+<entry name="internal type" url="ref/types.html#l2h-123"/>
+<entry name="interpreter" url="ref/top-level.html#l2h-435"/>
+<entry name="inversion" url="ref/unary.html#l2h-305"/>
+<entry name="invocation" url="ref/types.html#l2h-102"/>
+<entry name="is not operator" url="ref/comparisons.html#l2h-323"/>
+<entry name="is operator" url="ref/comparisons.html#l2h-323"/>
+<entry name="item, sequence" url="ref/subscriptions.html#l2h-286"/>
+<entry name="item, string" url="ref/subscriptions.html#l2h-287"/>
+<entry name="item selection" url="ref/types.html#l2h-80"/>
+<entry name="items() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="key" url="ref/dict.html#l2h-275"/>
+<entry name="key/datum pair" url="ref/dict.html#l2h-275"/>
+<entry name="keys() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="keyword" url="ref/keywords.html#l2h-12"/>
+<entry name="elif" url="ref/if.html#l2h-408"/>
+<entry name="keyword (continued), else" url="ref/break.html#l2h-377"/>
+<entry name="keyword (continued), except" url="ref/try.html#l2h-421"/>
+<entry name="keyword (continued), finally" url="ref/return.html#l2h-371"/>
+<entry name="keyword (continued), from" url="ref/import.html#l2h-385"/>
+<entry name="keyword (continued), in" url="ref/for.html#l2h-414"/>
+<entry name="lambda, expression" url="ref/lambda.html#l2h-328"/>
+<entry name="lambda, form" url="ref/lambda.html#l2h-328"/>
+<entry name="language, C" url="ref/types.html#l2h-68"/>
+<entry name="language, Pascal" url="ref/for.html#l2h-416"/>
+<entry name="last_traceback (in module sys)" url="ref/types.html#l2h-63"/>
+<entry name="leading whitespace" url="ref/indentation.html#l2h-9"/>
+<entry name="len() (built-in function)" url="ref/types.html#l2h-79"/>
+<entry name="lexical analysis" url="ref/lexical.html#l2h-3"/>
+<entry name="lexical definitions" url="ref/notation.html#l2h-2"/>
+<entry name="line continuation" url="ref/explicit-joining.html#l2h-7"/>
+<entry name="line joining" url="ref/logical.html#l2h-5"/>
+<entry name="line structure" url="ref/line-structure.html#l2h-4"/>
+<entry name="list, assignment, target" url="ref/assignment.html#l2h-346"/>
+<entry name="list, comprehensions" url="ref/lists.html#l2h-271"/>
+<entry name="list, deletion target" url="ref/del.html#l2h-358"/>
+<entry name="list (continued), display" url="ref/lists.html#l2h-271"/>
+<entry name="list (continued), empty" url="ref/lists.html#l2h-273"/>
+<entry name="list (continued), expression" url="ref/exprlists.html#l2h-329"/>
+<entry name="list (continued), target" url="ref/assignment.html#l2h-345"/>
+<entry name="list object" url="ref/types.html#l2h-93"/>
+<entry name="literal" url="ref/literals.html#l2h-13"/>
+<entry name="local, namespace" url="ref/execframes.html#l2h-244"/>
+<entry name="locals() (built-in function)" url="ref/exec.html#l2h-400"/>
+<entry name="logical line" url="ref/logical.html#l2h-5"/>
+<entry name="long() (built-in function)" url="ref/numeric-types.html#l2h-227"/>
+<entry name="long integer literal" url="ref/numbers.html#l2h-20"/>
+<entry name="long integer object" url="ref/types.html#l2h-75"/>
+<entry name="loop, over mutable sequence" url="ref/for.html#l2h-417"/>
+<entry name="loop, statement" url="ref/break.html#l2h-376"/>
+<entry name="loop control, target" url="ref/break.html#l2h-378"/>
+<entry name="loop control, makefile() (socket method)" url="ref/types.html#l2h-53"/>
+<entry name="mangling, name" url="ref/atom-identifiers.html#l2h-265"/>
+<entry name="mapping object" url="ref/types.html#l2h-95"/>
+<entry name="membership, test" url="ref/comparisons.html#l2h-322"/>
+<entry name="method, built-in" url="ref/types.html#l2h-107"/>
+<entry name="method, call" url="ref/calls.html#l2h-298"/>
+<entry name="method, user-defined" url="ref/types.html#l2h-105"/>
+<entry name="method object" url="ref/types.html#l2h-105"/>
+<entry name="minus" url="ref/unary.html#l2h-303"/>
+<entry name="module, built-in" url="ref/import.html#l2h-386"/>
+<entry name="module, extension" url="ref/types.html#l2h-68"/>
+<entry name="module, importing" url="ref/import.html#l2h-385"/>
+<entry name="module, initialization" url="ref/import.html#l2h-387"/>
+<entry name="module (continued), name" url="ref/import.html#l2h-386"/>
+<entry name="module (continued), names, hierarchical" url="ref/import.html#l2h-391"/>
+<entry name="module (continued), namespace" url="ref/types.html#l2h-110"/>
+<entry name="module (continued), search path" url="ref/import.html#l2h-386"/>
+<entry name="module (continued), user-defined" url="ref/import.html#l2h-386"/>
+<entry name="module object" url="ref/types.html#l2h-109"/>
+<entry name="modules (in module sys)" url="ref/import.html#l2h-383"/>
+<entry name="modulo" url="ref/binary.html#l2h-310"/>
+<entry name="multiplication" url="ref/binary.html#l2h-308"/>
+<entry name="mutable object" url="ref/objects.html#l2h-27"/>
+<entry name="mutable sequence, loop over" url="ref/for.html#l2h-417"/>
+<entry name="mutable sequence object" url="ref/types.html#l2h-92"/>
+<entry name="name" url="ref/identifiers.html#l2h-11"/>
+<entry name="binding" url="ref/execframes.html#l2h-241"/>
+<entry name="binding, global" url="ref/global.html#l2h-396"/>
+<entry name="built-in" url="ref/atom-identifiers.html#l2h-263"/>
+<entry name="class" url="ref/class.html#l2h-434"/>
+<entry name="function" url="ref/function.html#l2h-429"/>
+<entry name="global" url="ref/atom-identifiers.html#l2h-263"/>
+<entry name="mangling" url="ref/atom-identifiers.html#l2h-265"/>
+<entry name="module" url="ref/import.html#l2h-386"/>
+<entry name="rebinding" url="ref/execframes.html#l2h-242"/>
+<entry name="unbinding" url="ref/execframes.html#l2h-243"/>
+<entry name="NameError exception" url="ref/atom-identifiers.html#l2h-264"/>
+<entry name="names, hierarchical module" url="ref/import.html#l2h-391"/>
+<entry name="names, private" url="ref/atom-identifiers.html#l2h-265"/>
+<entry name="namespace" url="ref/execframes.html#l2h-232"/>
+<entry name="global" url="ref/types.html#l2h-104"/>
+<entry name="namespace (continued), local" url="ref/execframes.html#l2h-244"/>
+<entry name="namespace (continued), module" url="ref/types.html#l2h-110"/>
+<entry name="negation" url="ref/unary.html#l2h-303"/>
+<entry name="newline, suppression" url="ref/print.html#l2h-365"/>
+<entry name="NEWLINE token" url="ref/logical.html#l2h-5"/>
+<entry name="None" url="ref/types.html#l2h-70"/>
+<entry name="None object" url="ref/types.html#l2h-70"/>
+<entry name="not in operator" url="ref/comparisons.html#l2h-322"/>
+<entry name="not operator" url="ref/lambda.html#l2h-325"/>
+<entry name="notation" url="ref/notation.html#l2h-1"/>
+<entry name="null, operation" url="ref/pass.html#l2h-356"/>
+<entry name="number" url="ref/numbers.html#l2h-20"/>
+<entry name="complex" url="ref/types.html#l2h-78"/>
+<entry name="floating point" url="ref/types.html#l2h-77"/>
+<entry name="numeric literal" url="ref/numbers.html#l2h-20"/>
+<entry name="numeric object" url="ref/types.html#l2h-72"/>
+<entry name="object" url="ref/objects.html#l2h-24"/>
+<entry name="built-in function" url="ref/types.html#l2h-106"/>
+<entry name="built-in method" url="ref/types.html#l2h-107"/>
+<entry name="callable" url="ref/types.html#l2h-101"/>
+<entry name="class" url="ref/types.html#l2h-108"/>
+<entry name="class instance" url="ref/types.html#l2h-108"/>
+<entry name="code" url="ref/types.html#l2h-124"/>
+<entry name="complex" url="ref/types.html#l2h-78"/>
+<entry name="dictionary" url="ref/types.html#l2h-96"/>
+<entry name="Ellipsis" url="ref/types.html#l2h-71"/>
+<entry name="file" url="ref/types.html#l2h-117"/>
+<entry name="floating point" url="ref/types.html#l2h-77"/>
+<entry name="frame" url="ref/types.html#l2h-126"/>
+<entry name="function" url="ref/types.html#l2h-103"/>
+<entry name="immutable" url="ref/types.html#l2h-82"/>
+<entry name="immutable sequence" url="ref/types.html#l2h-82"/>
+<entry name="instance" url="ref/types.html#l2h-108"/>
+<entry name="integer" url="ref/types.html#l2h-73"/>
+<entry name="list" url="ref/types.html#l2h-93"/>
+<entry name="long integer" url="ref/types.html#l2h-75"/>
+<entry name="mapping" url="ref/types.html#l2h-95"/>
+<entry name="method" url="ref/types.html#l2h-105"/>
+<entry name="module" url="ref/types.html#l2h-109"/>
+<entry name="mutable" url="ref/types.html#l2h-92"/>
+<entry name="mutable sequence" url="ref/types.html#l2h-92"/>
+<entry name="None" url="ref/types.html#l2h-70"/>
+<entry name="numeric" url="ref/types.html#l2h-72"/>
+<entry name="plain integer" url="ref/types.html#l2h-74"/>
+<entry name="recursive" url="ref/string-conversions.html#l2h-279"/>
+<entry name="sequence" url="ref/types.html#l2h-80"/>
+<entry name="slice" url="ref/sequence-types.html#l2h-178"/>
+<entry name="string" url="ref/types.html#l2h-85"/>
+<entry name="object (continued), traceback" url="ref/types.html#l2h-127"/>
+<entry name="object (continued), tuple" url="ref/types.html#l2h-91"/>
+<entry name="object (continued), unicode" url="ref/types.html#l2h-90"/>
+<entry name="object (continued), user-defined function" url="ref/types.html#l2h-103"/>
+<entry name="object (continued), user-defined method" url="ref/types.html#l2h-105"/>
+<entry name="oct() (built-in function)" url="ref/numeric-types.html#l2h-229"/>
+<entry name="octal literal" url="ref/numbers.html#l2h-20"/>
+<entry name="open() (built-in function)" url="ref/types.html#l2h-118"/>
+<entry name="operation, binary arithmetic" url="ref/binary.html#l2h-307"/>
+<entry name="operation, binary bit-wise" url="ref/bitwise.html#l2h-315"/>
+<entry name="operation, Boolean" url="ref/lambda.html#l2h-324"/>
+<entry name="operation, null" url="ref/pass.html#l2h-356"/>
+<entry name="operation, shifting" url="ref/shifting.html#l2h-313"/>
+<entry name="operation, unary arithmetic" url="ref/unary.html#l2h-302"/>
+<entry name="operation, unary bit-wise" url="ref/unary.html#l2h-302"/>
+<entry name="operator, and" url="ref/lambda.html#l2h-326"/>
+<entry name="operator, in" url="ref/comparisons.html#l2h-322"/>
+<entry name="operator, is" url="ref/comparisons.html#l2h-323"/>
+<entry name="operator, is not" url="ref/comparisons.html#l2h-323"/>
+<entry name="operator, not" url="ref/lambda.html#l2h-325"/>
+<entry name="operator, not in" url="ref/comparisons.html#l2h-322"/>
+<entry name="operator, or" url="ref/lambda.html#l2h-327"/>
+<entry name="operator, precedence" url="ref/summary.html#l2h-332"/>
+<entry name="operators" url="ref/operators.html#l2h-21"/>
+<entry name="or, bit-wise" url="ref/bitwise.html#l2h-318"/>
+<entry name="or, exclusive" url="ref/bitwise.html#l2h-317"/>
+<entry name="or, inclusive" url="ref/bitwise.html#l2h-318"/>
+<entry name="or operator" url="ref/lambda.html#l2h-327"/>
+<entry name="ord() (built-in function)" url="ref/types.html#l2h-84"/>
+<entry name="output" url="ref/exprstmts.html#l2h-337"/>
+<entry name="standard" url="ref/exprstmts.html#l2h-337"/>
+<entry name="OverflowError (built-in exception)" url="ref/types.html#l2h-33"/>
+<entry name="packages" url="ref/import.html#l2h-392"/>
+<entry name="parameter, value, default" url="ref/function.html#l2h-430"/>
+<entry name="parenthesized form" url="ref/parenthesized.html#l2h-268"/>
+<entry name="parser" url="ref/lexical.html#l2h-3"/>
+<entry name="Pascal, language" url="ref/for.html#l2h-416"/>
+<entry name="pass statement" url="ref/pass.html#l2h-355"/>
+<entry name="path, module search" url="ref/import.html#l2h-386"/>
+<entry name="physical line" url="ref/logical.html#l2h-5"/>
+<entry name="plain integer literal" url="ref/numbers.html#l2h-20"/>
+<entry name="plain integer object" url="ref/types.html#l2h-74"/>
+<entry name="plus" url="ref/unary.html#l2h-304"/>
+<entry name="pop() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="popen() (in module os)" url="ref/types.html#l2h-51"/>
+<entry name="pow() (built-in function)" url="ref/numeric-types.html#l2h-219"/>
+<entry name="precedence, operator" url="ref/summary.html#l2h-332"/>
+<entry name="primary" url="ref/primaries.html#l2h-281"/>
+<entry name="print statement" url="ref/customization.html#l2h-151"/>
+<entry name="private, names" url="ref/atom-identifiers.html#l2h-265"/>
+<entry name="procedure, call" url="ref/exprstmts.html#l2h-337"/>
+<entry name="program" url="ref/programs.html#l2h-436"/>
+<entry name="quotes, backward" url="ref/customization.html#l2h-149"/>
+<entry name="quotes (continued), reverse" url="ref/customization.html#l2h-149"/>
+<entry name="quotes (continued), raise an exception" url="ref/exceptions.html#l2h-253"/>
+<entry name="quotes (continued), raise statement" url="ref/raise.html#l2h-372"/>
+<entry name="raising, exception" url="ref/raise.html#l2h-373"/>
+<entry name="range() (built-in function)" url="ref/for.html#l2h-416"/>
+<entry name="raw input" url="ref/expression-input.html#l2h-445"/>
+<entry name="raw string" url="ref/strings.html#l2h-16"/>
+<entry name="raw_input() (built-in function)" url="ref/expression-input.html#l2h-445"/>
+<entry name="readline() (file method)" url="ref/expression-input.html#l2h-442"/>
+<entry name="rebinding, name" url="ref/execframes.html#l2h-242"/>
+<entry name="recursive object" url="ref/string-conversions.html#l2h-279"/>
+<entry name="reference, attribute" url="ref/attribute-references.html#l2h-282"/>
+<entry name="reference, reference counting" url="ref/objects.html#l2h-28"/>
+<entry name="reference, remove() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="reference, repr() (built-in function)" url="ref/customization.html#l2h-148"/>
+<entry name="representation, integer" url="ref/types.html#l2h-76"/>
+<entry name="reserved word" url="ref/keywords.html#l2h-12"/>
+<entry name="restricted, execution" url="ref/execframes.html#l2h-248"/>
+<entry name="return statement" url="ref/return.html#l2h-369"/>
+<entry name="reverse, quotes" url="ref/customization.html#l2h-149"/>
+<entry name="reverse() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="RuntimeError exception" url="ref/print.html#l2h-367"/>
+<entry name="search, path, module" url="ref/import.html#l2h-386"/>
+<entry name="sequence, item" url="ref/subscriptions.html#l2h-286"/>
+<entry name="sequence object" url="ref/types.html#l2h-80"/>
+<entry name="shifting, operation" url="ref/shifting.html#l2h-313"/>
+<entry name="simple, statement" url="ref/simple.html#l2h-333"/>
+<entry name="singleton, tuple" url="ref/types.html#l2h-91"/>
+<entry name="slice" url="ref/slicings.html#l2h-288"/>
+<entry name="slice() (built-in function)" url="ref/types.html#l2h-130"/>
+<entry name="slice object" url="ref/sequence-types.html#l2h-178"/>
+<entry name="slicing" url="ref/types.html#l2h-81"/>
+<entry name="assignment" url="ref/assignment.html#l2h-353"/>
+<entry name="extended" url="ref/slicings.html#l2h-292"/>
+<entry name="sort() (sequence object method)" url="ref/sequence-types.html#l2h-168"/>
+<entry name="space" url="ref/indentation.html#l2h-9"/>
+<entry name="special, attribute" url="ref/types.html#l2h-69"/>
+<entry name="special, attribute, generic" url="ref/types.html#l2h-69"/>
+<entry name="stack, execution" url="ref/types.html#l2h-127"/>
+<entry name="stack, trace" url="ref/types.html#l2h-127"/>
+<entry name="standard, output" url="ref/exprstmts.html#l2h-337"/>
+<entry name="Standard C" url="ref/strings.html#l2h-17"/>
+<entry name="standard input" url="ref/programs.html#l2h-439"/>
+<entry name="start (slice object attribute)" url="ref/types.html#l2h-67"/>
+<entry name="statement, assert" url="ref/assert.html#l2h-338"/>
+<entry name="statement, assignment" url="ref/types.html#l2h-92"/>
+<entry name="statement, assignment, augmented" url="ref/augassign.html#l2h-354"/>
+<entry name="statement, break" url="ref/break.html#l2h-375"/>
+<entry name="statement, compound" url="ref/compound.html#l2h-402"/>
+<entry name="statement, continue" url="ref/continue.html#l2h-380"/>
+<entry name="statement, del" url="ref/types.html#l2h-92"/>
+<entry name="statement, exec" url="ref/execframes.html#l2h-249"/>
+<entry name="statement, expression" url="ref/exprstmts.html#l2h-334"/>
+<entry name="statement, for" url="ref/break.html#l2h-376"/>
+<entry name="statement, from" url="ref/execframes.html#l2h-249"/>
+<entry name="statement, global" url="ref/execframes.html#l2h-246"/>
+<entry name="statement, if" url="ref/if.html#l2h-407"/>
+<entry name="statement, import" url="ref/types.html#l2h-109"/>
+<entry name="statement (continued), loop" url="ref/break.html#l2h-376"/>
+<entry name="statement (continued), pass" url="ref/pass.html#l2h-355"/>
+<entry name="statement (continued), print" url="ref/customization.html#l2h-151"/>
+<entry name="statement (continued), raise" url="ref/raise.html#l2h-372"/>
+<entry name="statement (continued), return" url="ref/return.html#l2h-369"/>
+<entry name="statement (continued), simple" url="ref/simple.html#l2h-333"/>
+<entry name="statement (continued), try" url="ref/types.html#l2h-129"/>
+<entry name="statement (continued), while" url="ref/break.html#l2h-376"/>
+<entry name="statement grouping" url="ref/indentation.html#l2h-9"/>
+<entry name="stderr (in module sys)" url="ref/types.html#l2h-55"/>
+<entry name="stdin (in module sys)" url="ref/types.html#l2h-55"/>
+<entry name="stdio" url="ref/types.html#l2h-122"/>
+<entry name="stdout (in module sys)" url="ref/types.html#l2h-55"/>
+<entry name="step (slice object attribute)" url="ref/types.html#l2h-67"/>
+<entry name="stop (slice object attribute)" url="ref/types.html#l2h-67"/>
+<entry name="str() (built-in function)" url="ref/customization.html#l2h-150"/>
+<entry name="string, comparison" url="ref/types.html#l2h-86"/>
+<entry name="string, conversion" url="ref/customization.html#l2h-149"/>
+<entry name="string, item" url="ref/subscriptions.html#l2h-287"/>
+<entry name="string literal" url="ref/strings.html#l2h-14"/>
+<entry name="string object" url="ref/types.html#l2h-85"/>
+<entry name="subscription" url="ref/types.html#l2h-80"/>
+<entry name="assignment" url="ref/assignment.html#l2h-350"/>
+<entry name="subtraction" url="ref/binary.html#l2h-312"/>
+<entry name="suite" url="ref/compound.html#l2h-403"/>
+<entry name="suppression, newline" url="ref/print.html#l2h-365"/>
+<entry name="syntax" url="ref/notation.html#l2h-1"/>
+<entry name="SyntaxError exception" url="ref/import.html#l2h-387"/>
+<entry name="sys (built-in module)" url="ref/print.html#l2h-366"/>
+<entry name="sys.exc_info" url="ref/types.html#l2h-128"/>
+<entry name="sys.exc_traceback" url="ref/types.html#l2h-128"/>
+<entry name="sys.last_traceback" url="ref/types.html#l2h-128"/>
+<entry name="sys.modules" url="ref/import.html#l2h-386"/>
+<entry name="sys.stderr" url="ref/types.html#l2h-121"/>
+<entry name="sys.stdin" url="ref/types.html#l2h-119"/>
+<entry name="sys.stdout" url="ref/types.html#l2h-120"/>
+<entry name="tab" url="ref/indentation.html#l2h-9"/>
+<entry name="target" url="ref/assignment.html#l2h-345"/>
+<entry name="deletion" url="ref/del.html#l2h-358"/>
+<entry name="list" url="ref/assignment.html#l2h-345"/>
+<entry name="list assignment" url="ref/assignment.html#l2h-346"/>
+<entry name="list, deletion" url="ref/del.html#l2h-358"/>
+<entry name="loop control" url="ref/break.html#l2h-378"/>
+<entry name="tb_frame (traceback attribute)" url="ref/types.html#l2h-65"/>
+<entry name="tb_lasti (traceback attribute)" url="ref/types.html#l2h-65"/>
+<entry name="tb_lineno (traceback attribute)" url="ref/types.html#l2h-65"/>
+<entry name="tb_next (traceback attribute)" url="ref/types.html#l2h-65"/>
+<entry name="termination model" url="ref/exceptions.html#l2h-256"/>
+<entry name="test, identity" url="ref/comparisons.html#l2h-323"/>
+<entry name="test, membership" url="ref/comparisons.html#l2h-322"/>
+<entry name="token" url="ref/lexical.html#l2h-3"/>
+<entry name="trace, stack" url="ref/types.html#l2h-127"/>
+<entry name="trace, traceback object" url="ref/types.html#l2h-127"/>
+<entry name="trailing, comma" url="ref/exprlists.html#l2h-331"/>
+<entry name="triple-quoted string" url="ref/strings.html#l2h-16"/>
+<entry name="try statement" url="ref/types.html#l2h-129"/>
+<entry name="tuple, display" url="ref/parenthesized.html#l2h-270"/>
+<entry name="tuple, empty" url="ref/types.html#l2h-91"/>
+<entry name="tuple, singleton" url="ref/types.html#l2h-91"/>
+<entry name="tuple object" url="ref/types.html#l2h-91"/>
+<entry name="type" url="ref/types.html#l2h-68"/>
+<entry name="data" url="ref/types.html#l2h-68"/>
+<entry name="hierarchy" url="ref/types.html#l2h-68"/>
+<entry name="immutable data" url="ref/atom-literals.html#l2h-267"/>
+<entry name="type() (built-in function)" url="ref/objects.html#l2h-26"/>
+<entry name="type of an object" url="ref/objects.html#l2h-27"/>
+<entry name="TypeError exception" url="ref/unary.html#l2h-306"/>
+<entry name="types, internal" url="ref/types.html#l2h-123"/>
+<entry name="unary, arithmetic operation" url="ref/unary.html#l2h-302"/>
+<entry name="unary, bit-wise operation" url="ref/unary.html#l2h-302"/>
+<entry name="unbinding, name" url="ref/execframes.html#l2h-243"/>
+<entry name="unichr() (built-in function)" url="ref/types.html#l2h-87"/>
+<entry name="Unicode" url="ref/types.html#l2h-90"/>
+<entry name="unicode() (built-in function)" url="ref/types.html#l2h-89"/>
+<entry name="unicode object" url="ref/types.html#l2h-90"/>
+<entry name="UNIX" url="ref/programs.html#l2h-439"/>
+<entry name="unreachable object" url="ref/objects.html#l2h-28"/>
+<entry name="unrecognized escape sequence" url="ref/strings.html#l2h-19"/>
+<entry name="update() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="user-defined, function" url="ref/types.html#l2h-103"/>
+<entry name="user-defined, function call" url="ref/calls.html#l2h-297"/>
+<entry name="user-defined, method" url="ref/types.html#l2h-105"/>
+<entry name="user-defined, module" url="ref/import.html#l2h-386"/>
+<entry name="user-defined function object" url="ref/types.html#l2h-103"/>
+<entry name="user-defined method object" url="ref/types.html#l2h-105"/>
+<entry name="value, default parameter" url="ref/function.html#l2h-430"/>
+<entry name="value of an object" url="ref/objects.html#l2h-27"/>
+<entry name="ValueError exception" url="ref/shifting.html#l2h-314"/>
+<entry name="values, writing" url="ref/exprstmts.html#l2h-337"/>
+<entry name="values() (mapping object method)" url="ref/sequence-types.html#l2h-166"/>
+<entry name="while statement" url="ref/break.html#l2h-376"/>
+<entry name="whitespace" url="ref/indentation.html#l2h-9"/>
+<entry name="writing, values" url="ref/exprstmts.html#l2h-337"/>
+<entry name="xor, bit-wise" url="ref/bitwise.html#l2h-317"/>
+<entry name="xor, ZeroDivisionError exception" url="ref/binary.html#l2h-309"/>
+</index>
+</kdeveloptoc>
+
diff --git a/languages/python/doc/python_bugs.toc b/languages/python/doc/python_bugs.toc
new file mode 100644
index 00000000..0b2a5196
--- /dev/null
+++ b/languages/python/doc/python_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Python bugs</title>
+<base href="http://sourceforge.net/"/>
+<tocsect1 name="Query" url="tracker/?group_id=5470&amp;atid=105470">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/python/file_templates/Makefile.am b/languages/python/file_templates/Makefile.am
new file mode 100644
index 00000000..0846fdf2
--- /dev/null
+++ b/languages/python/file_templates/Makefile.am
@@ -0,0 +1,4 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = py
+
+
diff --git a/languages/python/file_templates/py b/languages/python/file_templates/py
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/python/file_templates/py
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/python/kde_pydoc.py b/languages/python/kde_pydoc.py
new file mode 100755
index 00000000..0516f172
--- /dev/null
+++ b/languages/python/kde_pydoc.py
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+"""
+"""
+
+__author__ = "David Nolden<david.kde@art-master.de>, Ka-Ping Yee <ping@lfw.org>"
+__version__ = "6 April 2006"
+
+import sys, imp, os, stat, re, types, cgi
+from repr import Repr
+from string import expandtabs, find, join, lower, split, strip, rstrip
+import pydoc
+
+
+
+
+def cleanlinks(string):
+ """Changes the links to work with the pydoc:-notation"""
+ finalstring = ""
+ string = str(string).replace(".html","")
+ pos = 0
+ mark = "<a href=\""
+ l = len(mark)
+ while(pos != -1):
+ opos = pos
+ pos = string.find(mark, pos)
+ if(pos == -1):
+ finalstring += string[opos:]
+ break
+ finalstring += string[opos:pos+l]
+ pos+=l
+ if(string[pos] == '#' or string.find(":/",pos, pos+10) != -1): #leave local jumps or external references untouched
+ continue
+ finalstring += "pydoc:"
+ if(string[pos] == "." and string[pos+1] == "\""):
+ pos += 1
+ finalstring += "modules"
+
+ return finalstring
+
+
+#This maximum depth was introduced because the program needs a very long time to
+#complete the task in big file-system-trees(like my home), and can be invoked by a simple pydoc:.
+#and cannot be stopped through the browser(just by killing python)
+__maxdepth = 4
+
+def writedocs(path, pkgpath='', depth=0, notprocessed=[]):
+ if(path == "/."):
+ writedoc(path)
+ return
+ depth+=1
+
+ if os.path.isdir(path):
+ if(depth > __maxdepth):
+ notprocessed.append(path)
+ return
+ dir = path
+ for file in os.listdir(dir):
+ path = os.path.join(dir, file)
+ if os.path.isdir(path):
+ writedocs(path, file + '.' + pkgpath, depth)
+ if os.path.isfile(path):
+ writedocs(path, pkgpath, depth)
+ if os.path.isfile(path):
+ modname = pydoc.inspect.getmodulename(path)
+ if modname:
+ writedoc(pkgpath + modname)
+
+ if(depth == 1):
+ if(len(notprocessed) != 0):
+ print "<br> the following paths were not processed because they are deeper than the maximum depth of " + str(__maxdepth) + ":<br>"
+ for x in notprocessed:
+ print cgi.escape(x) + " <br>"
+
+def writedoc(key,top=False):
+ """Write HTML documentation to a file in the current directory."""
+ if(type(key) == str and (key == "modules" or key == "/.")):
+ heading = pydoc.html.heading(
+ '<br><big><big><strong>&nbsp;'
+ 'Python: Index of Modules'
+ '</strong></big></big>',
+ '#ffffff', '#7799ee')
+ builtins = []
+ for name in sys.builtin_module_names:
+ builtins.append('<a href="%s">%s</a>' % (cgi.escape(name,quote=True), cgi.escape(name)))
+ indices = ['<p>Built-in modules: ' + cgi.escape(join(builtins, ', '))]
+ seen = {}
+ for dir in pydoc.pathdirs():
+ indices.append(pydoc.html.index(dir, seen))
+ print cleanlinks(heading + join(indices))
+ return
+
+ if(type(key) != types.ModuleType):
+ object = pydoc.locate(key)
+ if(object == None and top):
+ print "could not locate module/object for key " + \
+ cgi.escape(key) + "<br><a href=\"pydoc:modules\">go to index</a>";
+ else:
+ object = key
+
+ if object:
+ print cleanlinks(pydoc.html.page(pydoc.describe(object), pydoc.html.document(object)))
+
+
+
+if __name__ == '__main__':
+ import getopt
+ class BadUsage: pass
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], 'k:p:w')
+
+ print "<html>"
+ print "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
+ print "</head><body>"
+
+ if args:
+ for arg in args:
+ try:
+ if os.path.isdir(arg): writedocs(arg)
+
+ if os.path.isfile(arg):
+ arg = pydoc.importfile(arg)
+ writedoc(arg, True)
+ except pydoc.ErrorDuringImport, value:
+ print 'problem in %s - %s' % (
+ cgi.escape(value.filename), cgi.escape(value.exc))
+ else:
+ raise BadUsage
+
+ except (getopt.error, BadUsage):
+ print "need parameters\n"
diff --git a/languages/python/kdevpythonsupport.desktop b/languages/python/kdevpythonsupport.desktop
new file mode 100644
index 00000000..9f15e39f
--- /dev/null
+++ b/languages/python/kdevpythonsupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Python Support
+Comment[ca]=Suport per a Python
+Comment[da]=Python-understøttelse
+Comment[de]=Unterstützung für Python
+Comment[el]=Υποστήριξη Python
+Comment[es]=Soporte para Python
+Comment[et]=Pythoni toetus
+Comment[eu]=Python euskarria
+Comment[fa]=پشتیبانی پیتون
+Comment[fr]=Prise en charge du langage PYTHON
+Comment[ga]=Tacaíocht Python
+Comment[gl]=Soporte para Python
+Comment[hi]=पायथन समर्थन
+Comment[hu]=Python-támogatás
+Comment[is]=Python stuðningur
+Comment[it]=Supporto per Python
+Comment[ja]=Python サポート
+Comment[nds]=Ünnerstütten för Python
+Comment[ne]=पाइथोन समर्थन
+Comment[nl]=Ondersteuning voor Python
+Comment[pl]=Obsługa Pythona
+Comment[pt]=Suporte a Python
+Comment[pt_BR]=Suporte ao Python
+Comment[ru]=Поддержка языка Python
+Comment[sk]=Python podpora
+Comment[sl]=Podpora za Python
+Comment[sr]=Подршка за Python
+Comment[sr@Latn]=Podrška za Python
+Comment[sv]=Python-stöd
+Comment[ta]=பைதான் ஆதரவு
+Comment[tg]=Ёрӣ намудани забони Python
+Comment[tr]=Python Desteği
+Comment[zh_CN]=Python 支持
+Comment[zh_TW]=Python 支援
+Name=KDevPythonSupport
+Name[da]=KDevelop Python-understøttelse
+Name[de]=Unterstützung für Python (KDevelop)
+Name[hi]=के-डेव-पायथन-समर्थन
+Name[nds]=Python-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaPythona
+Name[sk]=KDev Python podpora
+Name[sv]=KDevelop Python-stöd
+Name[ta]=கெடெவ் பைதான் ஆதரவு
+Name[tg]=Ёрӣ намудани забони Python
+Name[zh_TW]=KDevelop Python 支援
+GenericName=Python Support
+GenericName[ca]=Suport per a Python
+GenericName[da]=Python-understøttelse
+GenericName[de]=Unterstützung für Python
+GenericName[el]=Υποστήριξη Python
+GenericName[es]=Soporte para Python
+GenericName[et]=Pythoni toetus
+GenericName[eu]=Python euskarria
+GenericName[fa]=پشتیبانی پیتون
+GenericName[fr]=Prise en charge du langage PYTHON
+GenericName[ga]=Tacaíocht Python
+GenericName[gl]=Soporte para Python
+GenericName[hi]=पायथन समर्थन
+GenericName[hu]=Python-támogatás
+GenericName[it]=Supporto per Python
+GenericName[ja]=Python サポート
+GenericName[nds]=Ünnerstütten för Python
+GenericName[ne]=पाइथोन समर्थन
+GenericName[nl]=Ondersteuning voor Python
+GenericName[pl]=Obsługa Pythona
+GenericName[pt]=Suporte a Python
+GenericName[pt_BR]=Suporte ao Python
+GenericName[ru]=Поддержка языка Python
+GenericName[sk]=Python podpora
+GenericName[sl]=Podpora za Python
+GenericName[sr]=Подршка за Python
+GenericName[sr@Latn]=Podrška za Python
+GenericName[sv]=Python-stöd
+GenericName[ta]=பைதான் ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони Python
+GenericName[tr]=Python Desteği
+GenericName[zh_CN]=Python 支持
+GenericName[zh_TW]=Python 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevpythonsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Python
diff --git a/languages/python/kdevpythonsupport.rc b/languages/python/kdevpythonsupport.rc
new file mode 100644
index 00000000..d19011b8
--- /dev/null
+++ b/languages/python/kdevpythonsupport.rc
@@ -0,0 +1,16 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevPythonSupport" version="3">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_exec" />
+ <Action name="build_runinterpreter" />
+ <Action name="build_execstring" />
+ </Menu>
+ <Menu name="help">
+ <Action name="help_pydoc"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar">
+ <Action name="build_exec" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/python/pydoc.cpp b/languages/python/pydoc.cpp
new file mode 100644
index 00000000..79f184d7
--- /dev/null
+++ b/languages/python/pydoc.cpp
@@ -0,0 +1,113 @@
+#include "pydoc.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <qtextstream.h>
+#include <kstandarddirs.h>
+#include <kinstance.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kglobal.h>
+#include <klocale.h>
+
+using namespace KIO;
+
+
+PydocProtocol::PydocProtocol(const QCString &pool, const QCString &app)
+ : SlaveBase("pydoc", pool, app), key()
+{
+ python = KGlobal::dirs()->findExe("python");
+ script = locate("data", "kio_pydoc/kde_pydoc.py");
+}
+
+
+PydocProtocol::~PydocProtocol()
+{}
+
+
+void PydocProtocol::get(const KURL& url)
+{
+ mimeType("text/html");
+ key = url.path();
+
+ QString cmd = KProcess::quote(python);
+ cmd += " ";
+ cmd += KProcess::quote(script);
+ cmd += " -w ";
+ cmd += KProcess::quote(key);
+
+ FILE *fd = popen(cmd.local8Bit().data(), "r");
+ char buffer[4096];
+ QByteArray array;
+
+ while (!feof(fd)) {
+ int n = fread(buffer, 1, 2048, fd);
+ if (n == -1) {
+ pclose(fd);
+ return;
+ }
+ array.setRawData(buffer, n);
+ data(array);
+ array.resetRawData(buffer, n);
+ }
+
+ pclose(fd);
+ finished();
+}
+
+
+void PydocProtocol::mimetype(const KURL&)
+{
+ mimeType( "text/html" );
+ finished();
+}
+
+
+QCString PydocProtocol::errorMessage()
+{
+ return QCString( "<html><body bgcolor=\"#FFFFFF\">" + i18n("Error in pydoc").local8Bit() + "</body></html>" );
+}
+
+
+void PydocProtocol::stat(const KURL &/*url*/)
+{
+ UDSAtom uds_atom;
+ uds_atom.m_uds = KIO::UDS_FILE_TYPE;
+ uds_atom.m_long = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
+
+ UDSEntry uds_entry;
+ uds_entry.append(uds_atom);
+
+ statEntry(uds_entry);
+ finished();
+}
+
+
+void PydocProtocol::listDir(const KURL &url)
+{
+ error( KIO::ERR_CANNOT_ENTER_DIRECTORY, url.path() );
+}
+
+
+extern "C" {
+
+ int kdemain(int argc, char **argv)
+ {
+ KInstance instance( "kio_pydoc" );
+ KGlobal::locale()->setMainCatalogue("kdevelop");
+
+ if (argc != 4) {
+ fprintf(stderr, "Usage: kio_pydoc protocol domain-socket1 domain-socket2\n");
+ exit(-1);
+ }
+
+ PydocProtocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ return 0;
+ }
+
+}
diff --git a/languages/python/pydoc.h b/languages/python/pydoc.h
new file mode 100644
index 00000000..e17a257a
--- /dev/null
+++ b/languages/python/pydoc.h
@@ -0,0 +1,30 @@
+#ifndef _PYDOC_H_
+#define _PYDOC_H_
+
+#include <qobject.h>
+#include <kio/slavebase.h>
+
+
+class PydocProtocol : public KIO::SlaveBase
+{
+public:
+ PydocProtocol(const QCString &pool, const QCString &app);
+ virtual ~PydocProtocol();
+
+ virtual void get(const KURL& url);
+ virtual void stat(const KURL& url);
+ virtual void mimetype(const KURL& url);
+ virtual void listDir(const KURL& url);
+
+protected:
+ void decodeURL(const KURL &url);
+ void decodePath(QString path);
+ QCString errorMessage();
+
+private:
+ QString python;
+ QString script;
+ QString key;
+};
+
+#endif
diff --git a/languages/python/pydoc.protocol b/languages/python/pydoc.protocol
new file mode 100644
index 00000000..4801357f
--- /dev/null
+++ b/languages/python/pydoc.protocol
@@ -0,0 +1,9 @@
+[Protocol]
+exec=kio_pydoc
+protocol=pydoc
+input=none
+output=filesystem
+reading=true
+listing=Name
+determineMimetypeFromExtension=false
+Icon=help
diff --git a/languages/python/pythonconfigwidget.cpp b/languages/python/pythonconfigwidget.cpp
new file mode 100644
index 00000000..87472477
--- /dev/null
+++ b/languages/python/pythonconfigwidget.cpp
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "pythonconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include "domutil.h"
+
+
+PythonConfigWidget::PythonConfigWidget(QDomDocument &projectDom,
+ QWidget *parent, const char *name)
+ : PythonConfigWidgetBase(parent, name), dom(projectDom)
+{
+ interpreter_edit->setText(DomUtil::readEntry(dom, "/kdevpythonsupport/run/interpreter"));
+ terminal_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevpythonsupport/run/terminal"));
+}
+
+
+PythonConfigWidget::~PythonConfigWidget()
+{}
+
+
+void PythonConfigWidget::accept()
+{
+ DomUtil::writeEntry(dom, "/kdevpythonsupport/run/interpreter", interpreter_edit->text());
+ DomUtil::writeBoolEntry(dom, "/kdevpythonsupport/run/terminal", terminal_box->isChecked());
+}
+
+#include "pythonconfigwidget.moc"
diff --git a/languages/python/pythonconfigwidget.h b/languages/python/pythonconfigwidget.h
new file mode 100644
index 00000000..22708c29
--- /dev/null
+++ b/languages/python/pythonconfigwidget.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PYTHONCONFIGWIDGET_H_
+#define _PYTHONCONFIGWIDGET_H_
+
+#include "pythonconfigwidgetbase.h"
+#include <qdom.h>
+
+
+class PythonConfigWidget : public PythonConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ PythonConfigWidget( QDomDocument &projectDom, QWidget *parent=0, const char *name=0 );
+ ~PythonConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ QDomDocument &dom;
+};
+
+#endif
diff --git a/languages/python/pythonconfigwidgetbase.ui b/languages/python/pythonconfigwidgetbase.ui
new file mode 100644
index 00000000..d3228822
--- /dev/null
+++ b/languages/python/pythonconfigwidgetbase.ui
@@ -0,0 +1,121 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>PythonConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>python_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Python</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>interpreter_label</cstring>
+ </property>
+ <property name="text">
+ <string>Python &amp;interpreter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>interpreter_edit</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer1</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>
+ <spacer>
+ <property name="name" stdset="0">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>terminal_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Execute programs in a terminal</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name" stdset="0">
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/python/pythonimplementationwidget.cpp b/languages/python/pythonimplementationwidget.cpp
new file mode 100644
index 00000000..151fe9c3
--- /dev/null
+++ b/languages/python/pythonimplementationwidget.cpp
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pythonimplementationwidget.h"
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include <filetemplate.h>
+#include <kdevlanguagesupport.h>
+#include <kdevproject.h>
+
+PythonImplementationWidget::PythonImplementationWidget(KDevLanguageSupport* part,
+ QWidget* parent, const char* name, bool modal)
+ : ImplementationWidget(part, parent, name, modal)
+{
+}
+
+
+PythonImplementationWidget::~PythonImplementationWidget()
+{
+}
+
+
+QStringList PythonImplementationWidget::createClassFiles()
+{
+// QString template_py = "require '$BASEFILENAME$'\n\nclass $CLASSNAME$ < $BASECLASSNAME$\n\n def initialize(*k)\n super(*k)\n end\n\nend\n";
+ QString template_py = "from qt import *\nfrom $BASEFILENAME$ import *\nclass $CLASSNAME$($BASECLASSNAME$):\n\n def __init__(self,parent,name):\n $BASECLASSNAME$.__init__(self,parent,name)\n \n\n\n";
+
+ QFileInfo formInfo(m_formName);
+ template_py.replace(QRegExp("\\$BASEFILENAME\\$"), formInfo.baseName()+".py");
+ template_py.replace(QRegExp("\\$CLASSNAME\\$"), classNameEdit->text());
+ template_py.replace(QRegExp("\\$BASECLASSNAME\\$"), m_baseClassName);
+
+ template_py = FileTemplate::read(m_part, "py") + template_py;
+
+ QString file_py = fileNameEdit->text() + ".py";
+ if (!m_part->project()->activeDirectory().isEmpty())
+ file_py = m_part->project()->activeDirectory() + "/" + file_py;
+ QFile file(QDir::cleanDirPath(m_part->project()->projectDirectory() + "/" + file_py));
+ if (!file.open(IO_WriteOnly)) {
+ KMessageBox::error(0, i18n("Cannot write to file"));
+ return QStringList();
+ }
+ QTextStream stream(&file);
+ stream << template_py;
+ file.close();
+
+ QStringList files;
+ files.append(file_py);
+ return files;
+}
+
+#include "pythonimplementationwidget.moc"
diff --git a/languages/python/pythonimplementationwidget.h b/languages/python/pythonimplementationwidget.h
new file mode 100644
index 00000000..abae4a4c
--- /dev/null
+++ b/languages/python/pythonimplementationwidget.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PYTHONIMPLEMENTATIONWIDGET_H
+#define PYTHONIMPLEMENTATIONWIDGET_H
+
+#include <implementationwidget.h>
+
+class PythonImplementationWidget : public ImplementationWidget
+{
+Q_OBJECT
+public:
+ PythonImplementationWidget(KDevLanguageSupport* part, QWidget* parent = 0, const char* name = 0, bool modal = true);
+
+ ~PythonImplementationWidget();
+
+ virtual QStringList createClassFiles();
+
+};
+
+#endif
diff --git a/languages/python/pythonsupportpart.cpp b/languages/python/pythonsupportpart.cpp
new file mode 100644
index 00000000..1b0e76da
--- /dev/null
+++ b/languages/python/pythonsupportpart.cpp
@@ -0,0 +1,410 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "pythonsupportpart.h"
+#include "pythonconfigwidget.h"
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevappfrontend.h>
+#include <kdevpartcontroller.h>
+#include <codemodel.h>
+#include <domutil.h>
+
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <qregexp.h>
+
+#include "qtdesignerpythonintegration.h"
+#include "pythonimplementationwidget.h"
+
+typedef KDevGenericFactory<PythonSupportPart> PythonSupportFactory;
+static const KDevPluginInfo data("kdevpythonsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevpythonsupport, PythonSupportFactory( data ) )
+
+PythonSupportPart::PythonSupportPart(QObject *parent, const char *name, const QStringList &)
+ : KDevLanguageSupport(&data, parent, name ? name : "PythonSupportPart")
+{
+ setInstance(PythonSupportFactory::instance());
+
+ setXMLFile("kdevpythonsupport.rc");
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ KAction *action;
+
+ action = new KAction( i18n("Execute Program"), "exec", 0,
+ this, SLOT(slotExecute()),
+ actionCollection(), "build_exec" );
+ action->setToolTip( i18n("Execute program") );
+ action->setWhatsThis(i18n("<b>Execute program</b><p>Runs the Python program."));
+
+ action = new KAction( i18n("Execute String..."), "exec", 0,
+ this, SLOT(slotExecuteString()),
+ actionCollection(), "build_execstring" );
+ action->setToolTip( i18n("Execute string") );
+ action->setWhatsThis(i18n("<b>Execute String</b><p>Executes a string as Python code."));
+
+ action = new KAction( i18n("Start Python Interpreter"), "exec", 0,
+ this, SLOT(slotStartInterpreter()),
+ actionCollection(), "build_runinterpreter" );
+ action->setToolTip( i18n("Start Python interpreter") );
+ action->setWhatsThis(i18n("<b>Start python interpreter</b><p>Starts the Python interpreter without a program"));
+
+ action = new KAction( i18n("Python Documentation..."), 0,
+ this, SLOT(slotPydoc()),
+ actionCollection(), "help_pydoc" );
+ action->setToolTip( i18n("Python documentation") );
+ action->setWhatsThis(i18n("<b>Python documentation</b><p>Shows a Python documentation page."));
+}
+
+
+PythonSupportPart::~PythonSupportPart()
+{}
+
+
+void PythonSupportPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (context->hasType(Context::FileContext)){
+ const FileContext *fc = static_cast<const FileContext*>(context);
+ //this is a .ui file and only selection contains only one such file
+ KURL url = fc->urls().first();
+ if (url.fileName().endsWith(".ui"))
+ {
+ m_contextFileName = url.fileName();
+ int id = popup->insertItem(i18n("Create or Select Implementation..."), this, SLOT(slotCreateSubclass()));
+ popup->setWhatsThis(id, i18n("<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner."));
+ }
+ }
+}
+
+
+void PythonSupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Python"));
+ PythonConfigWidget *w = new PythonConfigWidget(*projectDom(), vbox, "python config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+
+void PythonSupportPart::projectOpened()
+{
+ kdDebug(9014) << "projectOpened()" << endl;
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+
+void PythonSupportPart::projectClosed()
+{
+}
+
+
+void PythonSupportPart::maybeParse(const QString fileName)
+{
+ QFileInfo fi(fileName);
+ if (fi.extension() == "py") {
+
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+
+ parse( fileName );
+ }
+}
+
+
+void PythonSupportPart::initialParse()
+{
+ kdDebug(9014) << "initialParse()" << endl;
+
+ if (project()) {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+ kdDebug(9014) << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ maybeParse(project()->projectDirectory() + "/" + *it);
+ }
+
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug(9014) << "No project" << endl;
+ }
+}
+
+
+void PythonSupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug(9014) << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ maybeParse( fileName );
+ emit addedSourceInfo( fileName );
+ }
+
+ //emit updatedSourceInfo();
+}
+
+
+void PythonSupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug(9014) << "removedFilesFromProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+ }
+
+ //emit updatedSourceInfo();
+}
+
+
+void PythonSupportPart::savedFile(const KURL &fileName)
+{
+ kdDebug(9014) << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) {
+ maybeParse(fileName.path());
+ emit addedSourceInfo( fileName.path() );
+ }
+}
+
+
+KDevLanguageSupport::Features PythonSupportPart::features()
+{
+ return Features(Classes | Functions);
+}
+
+
+KMimeType::List PythonSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "text/x-python" );
+ if( mime )
+ list << mime;
+
+ mime = KMimeType::mimeType( "application/x-python" );
+ if( mime )
+ list << mime;
+
+ return list;
+}
+
+void PythonSupportPart::parse(const QString &fileName)
+{
+ QFile f(QFile::encodeName(fileName));
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream stream(&f);
+
+ QRegExp classre("^[ \t]*class[ \t]+([A-Za-z0-9_]+)[ \t]*(\\(([A-Za-z0-9_, \t]+)\\))?.*$");
+ QRegExp methodre("^[ \t]*def[ \t]+([A-Za-z0-9_]+).*$");
+
+ FileDom m_file = codeModel()->create<FileModel>();
+ m_file->setName( fileName );
+
+ ClassDom lastClass;
+ QString rawline;
+ QCString line;
+ int lineNo = 0;
+ while (!stream.atEnd()) {
+ rawline = stream.readLine();
+ line = rawline.stripWhiteSpace().local8Bit();
+ if (classre.search(line) != -1) {
+
+ lastClass = codeModel()->create<ClassModel>();
+ lastClass->setName(classre.cap(1));
+ lastClass->setFileName( fileName );
+ lastClass->setStartPosition( lineNo, 0 );
+
+ QStringList parentList = QStringList::split(",", classre.cap(3));
+ QStringList::ConstIterator it;
+ for (it = parentList.begin(); it != parentList.end(); ++it) {
+ QString baseName = (*it).stripWhiteSpace();
+ kdDebug(9014) << "Add parent" << baseName << endl;
+ lastClass->addBaseClass( baseName );
+ }
+
+ if (m_file->hasClass(lastClass->name())) {
+ ClassDom old = m_file->classByName( lastClass->name() )[ 0 ];
+ old->setFileName( lastClass->fileName() );
+
+ int line, col;
+ lastClass->getStartPosition( &line, &col );
+ old->setStartPosition( line, col );
+
+ lastClass = old;
+ } else {
+ kdDebug(9014) << "Add class " << lastClass->name() << endl;
+ m_file->addClass( lastClass );
+ }
+
+ } else if (methodre.search(line) != -1 ) {
+
+ FunctionDom method = codeModel()->create<FunctionModel>();
+ method->setName(methodre.cap(1));
+ method->setFileName( fileName );
+ method->setStartPosition( lineNo, 0 );
+
+ if (lastClass && rawline.left(3) != "def") {
+ if( !lastClass->hasFunction(method->name()) )
+ lastClass->addFunction( method );
+ QStringList scope;
+ scope << lastClass->name();
+ method->setScope( scope );
+
+ } else if( !m_file->hasFunction(method->name()) ){
+ m_file->addFunction( method );
+ lastClass = 0;
+ }
+ }
+ ++lineNo;
+ }
+
+ f.close();
+
+ codeModel()->addFile( m_file );
+}
+
+
+QString PythonSupportPart::interpreter()
+{
+ QString prog = DomUtil::readEntry(*projectDom(), "/kdevpythonsupport/run/interpreter");
+ if (prog.isEmpty())
+ prog = "python";
+
+ return prog;
+}
+
+
+void PythonSupportPart::startApplication(const QString &program)
+{
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevpythonsupport/run/terminal");
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, inTerminal);
+}
+
+
+void PythonSupportPart::slotExecute()
+{
+ QString program = project()->mainProgram();
+ QString cmd = interpreter() + " " + program;
+ startApplication(cmd);
+}
+
+
+void PythonSupportPart::slotStartInterpreter()
+{
+ startApplication(interpreter());
+}
+
+
+void PythonSupportPart::slotExecuteString()
+{
+ bool ok;
+ QString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), QString::null, &ok, 0);
+ if (ok) {
+ cmd.prepend("'");
+ cmd.append("'");
+ startApplication(cmd);
+ }
+}
+
+
+void PythonSupportPart::slotPydoc()
+{
+ bool ok;
+ QString key = KInputDialog::getText(i18n("Show Python Documentation"), i18n("Show Python documentation on keyword:"), "", &ok, 0);
+ if (ok && !key.isEmpty()) {
+ QString url = "pydoc:";
+ url += key;
+ partController()->showDocument(KURL(url));
+ }
+}
+
+KDevDesignerIntegration *PythonSupportPart::designer(KInterfaceDesigner::DesignerType type)
+{
+ KDevDesignerIntegration *des = 0;
+ switch (type)
+ {
+ case KInterfaceDesigner::QtDesigner:
+ des = m_designers[type];
+ if (des == 0)
+ {
+ PythonImplementationWidget *impl = new PythonImplementationWidget(this);
+ des = new QtDesignerPythonIntegration(this, impl);
+ des->loadSettings(*project()->projectDom(),
+ "kdevpythonsupport/designerintegration");
+ m_designers[type] = des;
+ }
+ break;
+ case KInterfaceDesigner::Glade:
+ break;
+ }
+ return des;
+
+}
+
+void PythonSupportPart::slotCreateSubclass()
+{
+ QFileInfo fi(m_contextFileName);
+ kdDebug(9014) << k_funcinfo << " file: " << m_contextFileName << " ext: " << fi.extension(false) << endl;
+ if (fi.extension(false) != "ui")
+ return;
+ QtDesignerPythonIntegration *des = dynamic_cast<QtDesignerPythonIntegration*>(designer(KInterfaceDesigner::QtDesigner));
+ if (des)
+ {
+ kdDebug(9014) << "ok: " << des << endl;
+ kdDebug(9014) << "have impl: " << des->selectImplementation(m_contextFileName);
+ }
+ kdDebug(9014) << "end: " << des << endl;
+}
+
+#include "pythonsupportpart.moc"
diff --git a/languages/python/pythonsupportpart.h b/languages/python/pythonsupportpart.h
new file mode 100644
index 00000000..ad2085e5
--- /dev/null
+++ b/languages/python/pythonsupportpart.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PYTHONSUPPORTPART_H_
+#define _PYTHONSUPPORTPART_H_
+
+
+#include "kdevlanguagesupport.h"
+
+class KDialogBase;
+class QStringList;
+class QPopupMenu;
+class Context;
+
+class PythonSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+ PythonSupportPart( QObject *parent, const char *name, const QStringList & );
+ ~PythonSupportPart();
+
+ virtual KDevDesignerIntegration *designer(KInterfaceDesigner::DesignerType type);
+
+public slots:
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void slotCreateSubclass();
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotExecute();
+ void slotExecuteString();
+ void slotStartInterpreter();
+
+ // Internal
+ void initialParse();
+ void slotPydoc();
+
+private:
+ QString interpreter();
+ void startApplication(const QString &program);
+ void maybeParse(const QString fileName);
+ void parse(const QString &fileName);
+
+ QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*> m_designers;
+ QString m_contextFileName;
+};
+
+#endif
diff --git a/languages/python/qtdesignerpythonintegration.cpp b/languages/python/qtdesignerpythonintegration.cpp
new file mode 100644
index 00000000..5a47d810
--- /dev/null
+++ b/languages/python/qtdesignerpythonintegration.cpp
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qtdesignerpythonintegration.h"
+
+#include <qpair.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+#include <domutil.h>
+#include <kdevpartcontroller.h>
+#include <kdevcreatefile.h>
+#include <kdevlanguagesupport.h>
+
+#include "codemodel_utils.h"
+#include "implementationwidget.h"
+
+QtDesignerPythonIntegration::QtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl)
+ :QtDesignerIntegration(part, impl, false, 0)
+{
+}
+
+
+QtDesignerPythonIntegration::~QtDesignerPythonIntegration()
+{
+}
+
+
+void QtDesignerPythonIntegration::addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass)
+{
+ m_part->partController()->editDocument( KURL( klass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController()->activePart() );
+ if( !editIface ){
+ /// @todo show messagebox
+// QDialog::accept();
+ return;
+ }
+
+ kdDebug(9014) << "===============" << endl;
+
+ int line, column;
+ klass->getStartPosition( &line, &column );
+
+ // compute the insertion point
+ QPair<int,int> point;
+ point.first = line + 1;
+ point.second = column;
+
+ const FunctionList functionList = klass->functionList();
+ if (functionList.count() > 0)
+ {
+ int funEndLine, funEndColumn;
+ functionList.first()->getEndPosition(&funEndLine, &funEndColumn);
+ point.second = funEndColumn;
+ }
+
+ QString func = function.function;
+ func.replace("()", "");
+ QString str = " def " + func + "(self):\n\n";
+
+ kdDebug(9014) << "insert " << str << " into " << point.first << endl;
+
+ editIface->insertText(point.first, 0 /*pt.second*/, str );
+
+ KTextEditor::View *activeView = dynamic_cast<KTextEditor::View*>( m_part->partController()->activePart()->widget() );
+ if (activeView)
+ {
+ KTextEditor::ViewCursorInterface* cursor = dynamic_cast<KTextEditor::ViewCursorInterface*>(activeView );
+ if (cursor)
+ cursor->setCursorPositionReal(point.first, 4);
+ }
+}
+
+#include "qtdesignerpythonintegration.moc"
diff --git a/languages/python/qtdesignerpythonintegration.h b/languages/python/qtdesignerpythonintegration.h
new file mode 100644
index 00000000..8ac5d5be
--- /dev/null
+++ b/languages/python/qtdesignerpythonintegration.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QTDESIGNERPYTHONINTEGRATION_H
+#define QTDESIGNERPYTHONINTEGRATION_H
+
+#include <qtdesignerintegration.h>
+
+class QtDesignerPythonIntegration : public QtDesignerIntegration
+{
+Q_OBJECT
+public:
+ QtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl);
+
+ ~QtDesignerPythonIntegration();
+
+ virtual void addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass);
+
+};
+
+#endif
diff --git a/languages/ruby/Makefile.am b/languages/ruby/Makefile.am
new file mode 100644
index 00000000..1b5fb83b
--- /dev/null
+++ b/languages/ruby/Makefile.am
@@ -0,0 +1,31 @@
+#Here resides the Ruby support part.
+
+INCLUDES = -I$(top_srcdir)/languages/lib/designer_integration \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions \
+ -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ -I$(top_builddir)/languages/lib/designer_integration $(all_includes)
+SUBDIRS = app_templates file_templates doc debugger
+
+
+kde_module_LTLIBRARIES = libkdevrubysupport.la
+libkdevrubysupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevrubysupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/languages/lib/designer_integration/libdesignerintegration.la $(top_builddir)/lib/util/libkdevutil.la
+
+libkdevrubysupport_la_SOURCES = rubysupport_part.cpp rubyconfigwidgetbase.ui \
+ rubyconfigwidget.cpp qtdesignerrubyintegration.cpp rubyimplementationwidget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevrubysupport.desktop
+
+templatedir = ${kde_datadir}/kdevabbrev/templates
+template_DATA = rubytemplates
+
+rcdir = $(kde_datadir)/kdevrubysupport
+rc_DATA = kdevrubysupport.rc
+
+picsdirdir = $(kde_datadir)/kdevrubysupport/pics
+picsdir_DATA = ruby_config.png ruby_run.png
+noinst_HEADERS = qtdesignerrubyintegration.h rubyimplementationwidget.h
diff --git a/languages/ruby/README b/languages/ruby/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/languages/ruby/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/languages/ruby/README.dox b/languages/ruby/README.dox
new file mode 100644
index 00000000..aaa8823b
--- /dev/null
+++ b/languages/ruby/README.dox
@@ -0,0 +1,43 @@
+/** \class RubySupportPart
+This is a Ruby support plugin
+
+\authors <a href="mailto:marek AT janukowicz.net">Marek Janukowicz</a>
+
+\maintainer <a href="mailto:marek AT janukowicz.net">Marek Janukowicz</a>
+
+\feature Ruby language support
+\feature .rb template for New File
+\feature Ruby project template for Application Wizard
+\feature "Run" option in menu
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/ruby/app_templates/Makefile.am b/languages/ruby/app_templates/Makefile.am
new file mode 100644
index 00000000..52239564
--- /dev/null
+++ b/languages/ruby/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = rubyhello qtruby qtrubyapp dcopservice kapp kxt rails qtruby4app
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/RubyIDE
+profiles_DATA = ruby.appwizard
diff --git a/languages/ruby/app_templates/dcopservice/Makefile.am b/languages/ruby/app_templates/dcopservice/Makefile.am
new file mode 100644
index 00000000..441e9ceb
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = dcopservice.desktop app.cpp app-configure.in.in \
+ src-Makefile.am main.rb dcopservice.rb dcopservice.kdevelop \
+ subdirs
+templateName = dcopserviceruby
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/dcopservice/app-configure.in.in b/languages/ruby/app_templates/dcopservice/app-configure.in.in
new file mode 100644
index 00000000..5d41e618
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/app-configure.in.in
@@ -0,0 +1,51 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, 0.1)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+AC_PROG_MAKE_SET
+
+# ruby interpreter check
+AC_PATH_PROG([RUBY],[ruby])
+if test -z "${RUBY}" ; then
+ AC_MSG_ERROR([you need Ruby to use this program])
+fi
+
+AC_CHECK_PROG(RUBY, ruby, ruby)
+
+if test -z "$RUBY"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
+else
+ AC_MSG_CHECKING(for ruby dirs)
+ RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
+ RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
+ RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
+ RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
+ RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+ AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR, libdir $RUBY_LIBDIR, librubyarg $RUBY_LIBRUBYARG])
+ AC_SUBST(RUBY_ARCHDIR)
+ AC_SUBST(RUBY_SITEARCHDIR)
+ AC_SUBST(RUBY_SITEDIR)
+ AC_SUBST(RUBY_LIBDIR)
+ AC_SUBST(RUBY_LIBRUBYARG)
+fi
+
+# Korundum check
+AC_MSG_CHECKING([whether Korundum is installed])
+korundum_present=no
+cat >korundumtest.rb <<END
+require 'Korundum'
+END
+${RUBY} korundumtest.rb >/dev/null 2>&1 && korundum_present=yes
+AC_MSG_RESULT([$korundum_present])
+
+# rbuic check
+AC_PATH_PROG([RBUIC],[rbuic])
+if test -z "${RBUIC}" ; then
+ AC_MSG_ERROR([cannot find rbuic (part of the QtRuby package)])
+fi
+AC_SUBST([RBUIC])
+AC_SUBST([RUBY])
+
+
diff --git a/languages/ruby/app_templates/dcopservice/app.cpp b/languages/ruby/app_templates/dcopservice/app.cpp
new file mode 100644
index 00000000..8d6af02d
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/app.cpp
@@ -0,0 +1,30 @@
+#include <ruby.h>
+
+#include <qstring.h>
+#include <qfileinfo.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+
+int main(int argc, char **argv) {
+ KInstance * instance = new KInstance("%{APPNAMELC}");
+ QString appdir = ::locate("data", "%{APPNAMELC}/main.rb", instance);
+ delete instance;
+ if (appdir.isNull()) {
+ qFatal("Error: Can't find \"%{APPNAMELC}/main.rb\"\n");
+ }
+ QFileInfo program(appdir);
+
+ char ** rubyargs = (char **) calloc(argc+4, sizeof(char *));
+ rubyargs[0] = strdup(argv[0]);
+ rubyargs[1] = strdup("-KU");
+ rubyargs[2] = strdup(QString("-C%1").arg(program.dirPath()).latin1());
+ rubyargs[3] = strdup(QString("-I%1").arg(program.dirPath()).latin1());
+ rubyargs[4] = strdup(program.fileName().latin1());
+ for (int i = 1; i < argc; i++) {
+ rubyargs[i+4] = argv[i];
+ }
+
+ ruby_init();
+ ruby_options(argc+4, rubyargs);
+ ruby_run();
+}
diff --git a/languages/ruby/app_templates/dcopservice/dcopservice.desktop b/languages/ruby/app_templates/dcopservice/dcopservice.desktop
new file mode 100644
index 00000000..2ee5220f
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopservice.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Type=Service
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+X-DCOP-ServiceType=Unique
+X-KDE-StartupNotify=false
+Comment=Template for dcop services
+Comment[br]=Patrom evit servijoù dcop
+Comment[ca]=Plantilla per als serveis dcop
+Comment[cy]=Patrymlun ar gyfer gwasanaethau dcop
+Comment[da]=Skabelon for DCOP-tjenester
+Comment[de]=Vorlage für DCOP-Dienste
+Comment[el]=Πρότυπο για υπηρεσίες dcop
+Comment[es]=Plantilla para servicios DCOP
+Comment[et]=DCOP-teenuste mall
+Comment[eu]=DCOP zerbitzuentzako plantilla
+Comment[fa]=قالب برای خدمات dcop
+Comment[fr]=Modèle pour les services DCOP
+Comment[ga]=Teimpléad i gcomhair seirbhísí DCOP
+Comment[gl]=Modelo para servizos dcop
+Comment[hi]=डीसीओपी सेवाओं के लिए टेम्प्लेट
+Comment[hu]=Sablon DCOP-szolgáltatásokhoz
+Comment[is]=Snið fyrir dcop þjónustur
+Comment[it]=Modello per servizi dcop
+Comment[ja]=dcop サービスのためのテンプレート
+Comment[nds]=Vörlaag för DCOP-Deensten
+Comment[ne]=dcop सेवाका लागि टेम्प्लेट
+Comment[nl]=Sjabloon voor DCOP-services
+Comment[pl]=Szablon dla usług dcop
+Comment[pt]=Modelo para serviços dcop
+Comment[pt_BR]=Modelo para serviços dcop
+Comment[ru]=Шаблон для сервисов DCOP
+Comment[sk]=Šablóna pre DCOP služby
+Comment[sl]=Predloga za storitve DCOP
+Comment[sr]=Шаблон за dcop сервисе
+Comment[sr@Latn]=Šablon za dcop servise
+Comment[sv]=Mall för DCOP-tjänster
+Comment[ta]=டிகாப்சேவைக்கான மாதரி உரு
+Comment[tg]=Қолиб барои хидмадгори DCOP
+Comment[tr]=dcop hizmetleri için şablon
+Comment[zh_CN]=dcop 服务模板
+Comment[zh_TW]=DCOP 服務樣本
+
diff --git a/languages/ruby/app_templates/dcopservice/dcopservice.kdevelop b/languages/ruby/app_templates/dcopservice/dcopservice.kdevelop
new file mode 100644
index 00000000..f4e274da
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopservice.kdevelop
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Code</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activedir/>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Sources" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ <charactercoding>3</charactercoding>
+ <mainprogram>src/main.rb</mainprogram>
+ </run>
+ </kdevrubysupport>
+ <kdevdocumentation>
+ <projectdoc>
+ <docsystem>Doxygen Documentation Collection</docsystem>
+ <docurl>%{APPNAMELC}.tag</docurl>
+ </projectdoc>
+ </kdevdocumentation>
+</kdevelop>
diff --git a/languages/ruby/app_templates/dcopservice/dcopservice.rb b/languages/ruby/app_templates/dcopservice/dcopservice.rb
new file mode 100644
index 00000000..94a03ec9
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopservice.rb
@@ -0,0 +1,37 @@
+
+class %{APPNAME} < KDE::DCOPObject
+
+ k_dcop 'QString string(int)',
+ 'QStringList list()',
+ 'void add(QString)',
+ 'bool remove(QString)',
+ 'bool exit()'
+
+ def initialize()
+ super("serviceInterface")
+ puts "Starting new service... "
+ @list = []
+ end
+
+ def string(idx)
+ return @list[idx]
+ end
+
+ def list()
+ return @list
+ end
+
+ def add(arg)
+ puts "Adding " + arg + " to the list"
+ @list << arg
+ end
+
+ def remove(arg)
+ @list.delete(arg) ? true : false
+ end
+
+ def exit()
+ $kapp.quit()
+ return true
+ end
+end
diff --git a/languages/ruby/app_templates/dcopservice/dcopserviceruby.kdevtemplate b/languages/ruby/app_templates/dcopservice/dcopserviceruby.kdevtemplate
new file mode 100644
index 00000000..adf9c172
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopserviceruby.kdevtemplate
@@ -0,0 +1,199 @@
+# KDE Config File
+[General]
+Name=DCOP Service
+Name[br]=Servij DCOP
+Name[ca]=Servei DCOP
+Name[de]=DCOP-Dienst
+Name[el]=Υπηρεσία DCOP
+Name[es]=Servicio DCOP
+Name[et]=DCOP-teenus
+Name[eu]=DCOP zerbitzua
+Name[fa]=خدمت DCOP
+Name[fr]=Service DCOP
+Name[ga]=Seirbhís DCOP
+Name[gl]=Servizo DCOP
+Name[hu]=DCOP-szolgáltatás
+Name[it]=Servizio DCOP
+Name[ja]=DCOP サービス
+Name[nds]=DCOP-Deenst
+Name[ne]=DCOP सेवा
+Name[nl]=DCOP-service
+Name[pl]=Usługa DCOP
+Name[pt]=Serviço de DCOP
+Name[pt_BR]=Serviço DCOP
+Name[ru]=Сервис DCOP
+Name[sk]=DCOP služba
+Name[sr]=DCOP сервис
+Name[sr@Latn]=DCOP servis
+Name[sv]=DCOP-tjänst
+Name[tr]=DCOP Hizmeti
+Name[zh_CN]=DCOP 服务
+Name[zh_TW]=DCOP 服務
+Icon=kdcop.png
+Category=Ruby/KDE
+Comment=Generates a framework for a KDE DCOP service and client access library.
+Comment[ca]=Genera una infraestructura per a un servei DCOP de KDE i la biblioteca d'accés del client.
+Comment[da]=Genererer et skelet for en KDE dcop-tjeneste og klientadgangsbibliotek.
+Comment[de]=Erstellt das Grundgerüst für einen KDE-DCOP-Dienst und eine Bibliothek für den Client-Zugriff.
+Comment[el]=Δημιουργεί ένα πλαίσιο για μια υπηρεσία KDE DCOP και μια βιβλιοθήκη πρόσβασης πελάτη.
+Comment[es]=Genera una infraestructura para un servicio DCOP de KDE y una biblioteca de acceso cliente.
+Comment[et]=KDE DCOP-teenuse raamistiku ja kliendi ligipääsu teegi loomine.
+Comment[eu]=KDE-ren DCOP zerbitzu baterako lan-marko bat eta bezero liburutegi bat sortzen ditu.
+Comment[fa]=چارچوبی برای خدمت KDE DCOP و کتابخانۀ دستیابی کارخواه تولید می‌کند.
+Comment[fr]=Génère une infrastructure pour un service DCOP KDE et une bibliothèque d'accès client.
+Comment[ga]=Cruthaigh creatlach do sheirbhís DCOP KDE agus leabharlann rochtana cliaint.
+Comment[gl]=Xera un contorno de traballo para un servizo DCOP de KDE e unha biblioteca de acceso para clientes.
+Comment[hu]=Létrehoz egy alap KDE DCOP-szolgáltatást és klienselérési programkönyvtárat.
+Comment[it]=Genera l'infrastruttura per un servizio DCOP di KDE e una libreria per l'accesso da client.
+Comment[ja]=KDE DCOP サービスとクライアントアクセスライブラリのためのフレームワークを作成します
+Comment[nds]=Stellt en Rahmenwark för en KDE-DCOP-Deenst un en Clienttogriep-Bibliotheek op.
+Comment[ne]=KDE DCOP सेवा र ग्राहक पहुँच लाइब्रेरीका लागि फ्रेमवर्क उत्पन्न गर्दछ ।
+Comment[nl]=Genereert een framework voor een KDE DCOP-service- en client-bibliotheek.
+Comment[pl]=Generuje schemat dla usługi KDE DCOP i biblioteki dostępu użytkownika.
+Comment[pt]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes.
+Comment[pt_BR]=Gera a plataforma para um serviço de DCOP do KDE e a biblioteca de acesso dos clientes.
+Comment[ru]=Создание сервиса DCOP и библиотеки клиента.
+Comment[sk]=Vygeneruje framework pre KDE DCOP službu a klientskú prístupovú knižnicu.
+Comment[sr]=Прави једноставан радни оквир за KDE DCOP сервис и приступну библиотеку клијента.
+Comment[sr@Latn]=Pravi jednostavan radni okvir za KDE DCOP servis i pristupnu biblioteku klijenta.
+Comment[sv]=Skapar ett ramverk för en KDE DCOP-tjänst och klientåtkomstbibliotek.
+Comment[tr]=Bir KDE DCOP hizmeti ve istemci erişim kütüphanesi için bir çatı yaratır.
+Comment[zh_CN]=生成一个 KDE DCOP 服务和客户访问库的框架。
+Comment[zh_TW]=產生一個 KDE DCOP 服務的架構,以及客戶端存取的函式庫。
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/src/main.rb
+Archive=dcopserviceruby.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/dcopservice.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE7]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE9]
+Type=install
+Source=%{src}/app-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[FILE10]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE11]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE12]
+Type=install
+Source=%{src}/dcopservice.rb
+Dest=%{dest}/src/%{APPNAMELC}.rb
+
+[FILE13]
+Type=install
+Source=%{src}/dcopservice.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE14]
+Type=install
+Source=%{src}/main.rb
+Dest=%{dest}/src/main.rb
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[MSG]
+Type=message
+Comment=A KDE DCOP Service was created in %{dest}
+Comment[ca]=Un servei DCOP de KDE ha estat creada en %{dest}
+Comment[da]=En KDE DCOP tjeneste blev oprettet i %{dest}
+Comment[de]=Ein KDE-DCOP-Dienst wurde in %{dest} erstellt.
+Comment[el]=Μια υπηρεσία KDE DCOP δημιουργήθηκε στο %{dest}
+Comment[es]=Un servicio DCOP de KDE ha sido creado en %{dest}
+Comment[et]=KDE DCOP-teenus loodi asukohta %{dest}
+Comment[eu]=KDE-ren DCOP zerbitzu bat sortu da hemen: %{dest}
+Comment[fa]=یک خدمت KDE DCOP در %{dest} ایجاد شد
+Comment[fr]=Un service DCOP KDE a été créé dans %{dest}
+Comment[ga]=Cruthaíodh Seirbhís DCOP KDE i %{dest}
+Comment[gl]=Creouse un servizo DCOP de KDE en %{dest}
+Comment[hu]=Létrejött egy KDE DCOP-szolgáltatás itt: %{dest}
+Comment[it]=È stato creato un servizio DCOP di KDE in %{dest}
+Comment[ja]=KDE DCOP サービスを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en KDE-DCOP-Deenst opstellt
+Comment[ne]=KDE DCOP सेवा %{dest} मा सिर्जना गरियो
+Comment[nl]=Een DCOP-service is aangemaakt in %{dest}
+Comment[pl]=Usługa KDE DCOP została utworzona w %{dest}
+Comment[pt]=Foi criado um serviço de DCOP do KDE em %{dest}
+Comment[pt_BR]=Foi criado um serviço de DCOP do KDE em %{dest}
+Comment[ru]=Сервис DCOP создан в %{dest}
+Comment[sk]=KDE DCOP služba bola vytvorená v %{dest}
+Comment[sl]=Storitev DCOP za KDE je bila ustvarjena v %{dest}
+Comment[sr]=KDE DCOP сервис направљен је у %{dest}
+Comment[sr@Latn]=KDE DCOP servis napravljen je u %{dest}
+Comment[sv]=En KDE DCOP-tjänst skapades i %{dest}
+Comment[tr]=Bir KDE DCOP Hizmeti %{dest} içinde yaratılmıştır.
+Comment[zh_CN]=在 %{dest} 中创建了一个 KDE DCOP 服务
+Comment[zh_TW]=KDE DCOP 服務已建立於 %{dest}
diff --git a/languages/ruby/app_templates/dcopservice/dcopserviceruby.png b/languages/ruby/app_templates/dcopservice/dcopserviceruby.png
new file mode 100644
index 00000000..2cb4f1f3
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/dcopserviceruby.png
Binary files differ
diff --git a/languages/ruby/app_templates/dcopservice/main.rb b/languages/ruby/app_templates/dcopservice/main.rb
new file mode 100644
index 00000000..3122b087
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/main.rb
@@ -0,0 +1,30 @@
+require 'Korundum'
+require '%{APPNAMELC}.rb'
+
+description = I18N_NOOP("A KDE DCOP Application")
+version = "0.1"
+options = []
+
+KDE::Locale.mainCatalogue = "kdelibs"
+aboutdata = KDE::AboutData.new("%{APPNAMELC}", I18N_NOOP("KDE"),
+ version, description,
+ KDE::AboutData.License_GPL, "(C) %{YEAR}, %{AUTHOR}")
+aboutdata.addAuthor("%{AUTHOR}",I18N_NOOP("Developer"),"%{EMAIL}")
+
+KDE::CmdLineArgs.init( ARGV, aboutdata )
+KDE::CmdLineArgs.addCmdLineOptions( options )
+KDE::UniqueApplication.addCmdLineOptions()
+
+if !KDE::UniqueApplication.start
+ puts "%{APPNAMELC} is already running!"
+ exit(0)
+end
+
+app = KDE::UniqueApplication.new
+puts "starting %{APPNAMELC} "
+# This app is started automatically, no need for session management
+app.disableSessionManagement
+service = %{APPNAME}.new
+puts "starting %{APPNAMELC} "
+app.exec
+
diff --git a/languages/ruby/app_templates/dcopservice/src-Makefile.am b/languages/ruby/app_templates/dcopservice/src-Makefile.am
new file mode 100644
index 00000000..220c58e3
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/src-Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR)
+
+bin_PROGRAMS = %{APPNAMELC}
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH) -L$(RUBY_LIBDIR)
+%{APPNAMELC}_LDADD = $(LIB_KIO) $(RUBY_LIBRUBYARG)
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+METASOURCES = AUTO
+
+rubysrc_DATA = main.rb %{APPNAMELC}.rb
+rubysrcdir = $(kde_datadir)/%{APPNAMELC}
+
+service_DATA = %{APPNAMELC}.desktop
+servicedir = $(kde_servicesdir)
+
diff --git a/languages/ruby/app_templates/dcopservice/subdirs b/languages/ruby/app_templates/dcopservice/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/ruby/app_templates/dcopservice/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/ruby/app_templates/kapp/Makefile.am b/languages/ruby/app_templates/kapp/Makefile.am
new file mode 100644
index 00000000..20cf1f3f
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/Makefile.am
@@ -0,0 +1,19 @@
+dataFiles = app_client.rb appiface.rb app.rb appview.rb main.rb pref.rb app.cpp \
+ appui.rc app.desktop app.kdevelop app-Makefile.am app-configure.in.in \
+ src-Makefile.am subdirs README
+
+templateName = kappruby
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/kapp/README b/languages/ruby/app_templates/kapp/README
new file mode 100644
index 00000000..f04a5635
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/README
@@ -0,0 +1,81 @@
+-----------------------------------------------
+Kde application framework template quickstart
+Author: Thomas Nagy
+Date: 2004-03-22
+-----------------------------------------------
+
+This README file explains you basic things for starting with
+this application template.
+
+
+** Building and installing **
+
+* Build the configure script by "make -f Makefile.cvs"
+
+* To clean, use "make clean", and to clean everything
+(remove the makefiles, etc), use "make distclean"
+
+* To distribute your program, try "make dist".
+This will make a compact tarball archive of your release with the
+necessary scripts inside.
+
+* Modifying the auto-tools scripts
+for automake scripts there is an excellent tutorial there :
+http://developer.kde.org/documentation/other/makefile_am_howto.html
+
+* Simplify your life : install the project in your home directory for
+testing purposes.
+./configure --prefix=/home/user/dummyfolder/
+In the end when you finished the development you can
+rm -rf /home/user/dummyfolder/
+without fear.
+
+
+** Technologies **
+
+* Build the menus of your application easily
+kde applications now use an xml file (*ui.rc file) to build the menus.
+This allow a great customization of the application. However, when
+programming the menu is shown only after a "make install"
+
+For more details, consult :
+http://devel-home.kde.org/~larrosa/tutorial/p9.html
+http://developer.kde.org/documentation/tutorials/xmlui/preface.html
+
+* Use KConfig XT to create your configuration dialogs and make
+them more maintainable.
+
+For more details, consult :
+http://developer.kde.org/documentation/tutorials/kconfigxt/kconfigxt.html
+
+* With KParts, you can embed other kde components in your program, or make your program
+embeddable in other apps. For example, the kmplayer kpart can be called to play videos
+in your app.
+
+For more details, consult :
+http://www-106.ibm.com/developerworks/library/l-kparts/
+http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html
+http://developer.kde.org/documentation/tutorials/developing-a-plugin-structure/index.html
+
+* With dcop, you can control your app from other applications
+Make sure to include K_DCOP and a kdcop: section in your .h file
+http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html
+
+
+** Documentation **
+
+* For the translations :
+1. Download a patched gettext which can be found at:
+ http://public.kde.planetmirror.com/pub/kde/devel/gettext-kde/
+2. Install that gettext in ~/bin/
+3. cd ~/yourproject, export PATH=~/bin:$PATH, export
+KDEDIR=/where_your_KDE3_is
+4. make -f admin/Makefile.common package-messages
+5. make package-messages
+6. Translate the po files (not the pot!!) with kbabel or xemacs
+
+* Do not forget to write the documentation for your kde app
+edit the documentation template index.docbook in doc/
+
+
+
diff --git a/languages/ruby/app_templates/kapp/app-Makefile.am b/languages/ruby/app_templates/kapp/app-Makefile.am
new file mode 100644
index 00000000..bfe1c599
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app-Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = $(TOPSUBDIRS)
diff --git a/languages/ruby/app_templates/kapp/app-configure.in.in b/languages/ruby/app_templates/kapp/app-configure.in.in
new file mode 100644
index 00000000..7d849466
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app-configure.in.in
@@ -0,0 +1,45 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, 0.1)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+AC_PROG_MAKE_SET
+
+AC_CHECK_PROG(RUBY, ruby, ruby)
+
+if test -z "$RUBY"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
+else
+ AC_MSG_CHECKING(for ruby dirs)
+ RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
+ RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
+ RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
+ RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
+ RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+ AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR, libdir $RUBY_LIBDIR, librubyarg $RUBY_LIBRUBYARG])
+ AC_SUBST(RUBY_ARCHDIR)
+ AC_SUBST(RUBY_SITEARCHDIR)
+ AC_SUBST(RUBY_SITEDIR)
+ AC_SUBST(RUBY_LIBDIR)
+ AC_SUBST(RUBY_LIBRUBYARG)
+fi
+
+# Korundum check
+AC_MSG_CHECKING([whether Korundum is installed])
+korundum_present=no
+cat >korundumtest.rb <<END
+require 'Korundum'
+END
+${RUBY} korundumtest.rb >/dev/null 2>&1 && korundum_present=yes
+AC_MSG_RESULT([$korundum_present])
+
+# rbuic check
+AC_PATH_PROG([RBUIC],[rbuic])
+if test -z "${RBUIC}" ; then
+ AC_MSG_ERROR([cannot find rbuic (part of the QtRuby package)])
+fi
+AC_SUBST([RBUIC])
+AC_SUBST([RUBY])
+
+
diff --git a/languages/ruby/app_templates/kapp/app.cpp b/languages/ruby/app_templates/kapp/app.cpp
new file mode 100644
index 00000000..8d6af02d
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app.cpp
@@ -0,0 +1,30 @@
+#include <ruby.h>
+
+#include <qstring.h>
+#include <qfileinfo.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+
+int main(int argc, char **argv) {
+ KInstance * instance = new KInstance("%{APPNAMELC}");
+ QString appdir = ::locate("data", "%{APPNAMELC}/main.rb", instance);
+ delete instance;
+ if (appdir.isNull()) {
+ qFatal("Error: Can't find \"%{APPNAMELC}/main.rb\"\n");
+ }
+ QFileInfo program(appdir);
+
+ char ** rubyargs = (char **) calloc(argc+4, sizeof(char *));
+ rubyargs[0] = strdup(argv[0]);
+ rubyargs[1] = strdup("-KU");
+ rubyargs[2] = strdup(QString("-C%1").arg(program.dirPath()).latin1());
+ rubyargs[3] = strdup(QString("-I%1").arg(program.dirPath()).latin1());
+ rubyargs[4] = strdup(program.fileName().latin1());
+ for (int i = 1; i < argc; i++) {
+ rubyargs[i+4] = argv[i];
+ }
+
+ ruby_init();
+ ruby_options(argc+4, rubyargs);
+ ruby_run();
+}
diff --git a/languages/ruby/app_templates/kapp/app.desktop b/languages/ruby/app_templates/kapp/app.desktop
new file mode 100644
index 00000000..c8e5c86a
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=ruby %{APPNAMELC}/main.rb %i -caption "%c"
+Icon=%{APPNAMELC}
+Type=Application
+X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html
+Comment=A KDE KPart Application
+Comment[br]=Ur meziant Kpart evit KDE
+Comment[ca]=Una aplicació KPart per al KDE
+Comment[cy]=Cymhwysiad KPart KDE
+Comment[da]=Et KDE KPart-program
+Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung
+Comment[el]=Μια εφαρμογή KPart του KDE
+Comment[es]=Una aplicación KPart de KDE
+Comment[et]=KDE KPart rakendus
+Comment[eu]=KDE KPart aplikazio bat
+Comment[fa]=یک کاربرد KDE KPart
+Comment[fr]=Une application KPart pour KDE
+Comment[ga]=Feidhmchlár KPart KDE
+Comment[gl]=Unha aplicación KPart de KDE
+Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग
+Comment[hu]=KPart-alapú KDE-alkalmazás
+Comment[is]=KDE KPart forrit
+Comment[it]=Applicazione KPart di KDE
+Comment[ja]=KDE KPart アプリケーション
+Comment[lt]=KDE KPart programa
+Comment[nds]=En KPart-Deelprogramm för KDE
+Comment[ne]=एउटा केडीई KPart अनुप्रयोग
+Comment[nl]=Een KDE KPart-toepassing
+Comment[pl]=Osadzalny element KPart KDE
+Comment[pt]=Uma Aplicação KPart do KDE
+Comment[pt_BR]=Um Aplicativo KPart do KDE
+Comment[ru]=Приложение KPart для KDE
+Comment[sk]=KDE KPart aplikácia
+Comment[sl]=Program KPart za KDE
+Comment[sr]=KDE KPart програм
+Comment[sr@Latn]=KDE KPart program
+Comment[sv]=Ett KDE Kpart-program
+Comment[ta]=கெடி கெபார்ட் பயன்பாடு
+Comment[tg]=Ба кор андохтани KPart барои KDE
+Comment[tr]=Bir KDE KPart Uygulaması
+Comment[zh_CN]=一个 KDE KPart 应用程序
+Comment[zh_TW]=KDE KPart 應用程式
+Terminal=false
diff --git a/languages/ruby/app_templates/kapp/app.kdevelop b/languages/ruby/app_templates/kapp/app.kdevelop
new file mode 100644
index 00000000..3a1efdd9
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app.kdevelop
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activedir/>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ </kdevautoproject>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>CVS,.svn</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.rb" name="Ruby files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwindows_bugs</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ <type ext="ui"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ <charactercoding>3</charactercoding>
+ <mainprogram>src/main.rb</mainprogram>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/kapp/app.rb b/languages/ruby/app_templates/kapp/app.rb
new file mode 100644
index 00000000..470b0136
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app.rb
@@ -0,0 +1,216 @@
+=begin
+ This class serves as the main window for %{APPNAME}. It handles the
+ menus, toolbars, and status bars.
+
+ @short Main window class
+ @author %{AUTHOR} <%{EMAIL}>
+ @version %{VERSION}
+=end
+
+class %{APPNAMESC} < KDE::MainWindow
+
+ slots 'fileNew()',
+ 'fileOpen()',
+ 'fileSave()',
+ 'fileSaveAs()',
+ 'filePrint()',
+ 'optionsPreferences()',
+ 'changeStatusbar(const QString&)',
+ 'changeCaption(const QString&)'
+
+ def initialize()
+ super( nil, "%{APPNAMESC}" )
+ @view = %{APPNAMESC}View.new(self)
+ @printer = nil
+ # accept dnd
+ setAcceptDrops(true)
+
+ # tell the KDE::MainWindow that this is indeed the main widget
+ setCentralWidget(@view)
+
+ # then, setup our actions
+ setupActions()
+
+ # and a status bar
+ statusBar().show()
+
+ # Apply the create the main window and ask the mainwindow to
+ # automatically save settings if changed: window size, toolbar
+ # position, icon size, etc. Also to add actions for the statusbar
+ # toolbar, and keybindings if necessary.
+ setupGUI();
+
+ # allow the view to change the statusbar and caption
+ connect(@view, SIGNAL('signalChangeStatusbar(const QString&)'),
+ self, SLOT('changeStatusbar(const QString&)'))
+ connect(@view, SIGNAL('signalChangeCaption(const QString&)'),
+ self, SLOT('changeCaption(const QString&)'))
+
+ end
+
+
+ def load(url)
+ target = ""
+ # the below code is what you should normally do. in this
+ # example when, we want the url to our own. you probably
+ # want to use this code instead for your app
+
+ if false
+ # download the contents
+ if KIO::NetAccess.download(url, target, self)
+ # set our caption
+ setCaption(url.url)
+
+ # load in the file (target is always local)
+ @view.openURL(KDE::URL.new(target))
+
+ # and remove the temp file
+ KIO::NetAccess.removeTempFile(target)
+ end
+ end
+
+ setCaption(url.prettyURL())
+ @view.openURL(url)
+ end
+
+ def setupActions()
+ KDE::StdAction.openNew(self, SLOT('fileNew()'), actionCollection())
+ KDE::StdAction.open(self, SLOT('fileOpen()'), actionCollection())
+ KDE::StdAction.save(self, SLOT('fileSave()'), actionCollection())
+ KDE::StdAction.saveAs(self, SLOT('fileSaveAs()'), actionCollection())
+ KDE::StdAction.print(self, SLOT('filePrint()'), actionCollection())
+ KDE::StdAction.quit($kapp, SLOT('quit()'), actionCollection())
+
+ KDE::StdAction.preferences(self, SLOT('optionsPreferences()'), actionCollection())
+
+ # this doesn't do anything useful. it's just here to illustrate
+ # how to insert a custom menu and menu item
+ custom = KDE::Action.new(i18n("Cus&tom Menuitem"), KDE::Shortcut.new(),
+ self, SLOT('optionsPreferences()'),
+ actionCollection(), "custom_action")
+ end
+
+ def saveProperties(config)
+ # the 'config' object points to the session managed
+ # config file. anything you write here will be available
+ # later when this app is restored
+
+ if !@view.currentURL().empty?
+ config.writeEntry("lastURL", @view.currentURL())
+ end
+ end
+
+ def readProperties(config)
+ # the 'config' object points to the session managed
+ # config file. This function is automatically called whenever
+ # the app is being restored. read in here whatever you wrote
+ # in 'saveProperties'
+
+ url = config.readPathEntry("lastURL")
+
+ if !url.empty?
+ @view.openURL(KDE::URL.new(url))
+ end
+ end
+
+ def dragEnterEvent(event)
+ # accept uri drops only
+ event.accept(KDE::URLDrag.canDecode(event))
+ end
+
+ def dropEvent(event)
+ # This is a very simplistic implementation of a drop event. we
+ # will only accept a dropped URL. the Qt dnd code can do *much*
+ # much more, so please read the docs there
+ urls = []
+
+ # see if we can decode a URI.. if not, just ignore it
+ if KDE::URLDrag.decode(event, urls) && !urls.empty?
+ # okay, we have a URI.. process it
+ url = urls.shift
+
+ # load in the file
+ load(url)
+ end
+ end
+
+ def fileNew()
+ # This slot is called whenever the File.New menu is selected,
+ # the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ # button is clicked
+
+ # create a new window
+ %{APPNAMESC}.new.show()
+ end
+
+ def fileOpen()
+ # This slot is called whenever the File.Open menu is selected,
+ # the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
+ # button is clicked
+
+ # This brings up the generic open dialog
+ url = KDE::URLRequesterDlg.getURL(nil, self, i18n("Open Location") )
+
+ # standard filedialog
+ url = KDE::FileDialog.getOpenURL(nil, nil, self, i18n("Open Location"))
+ if !url.empty?
+ @view.openURL(url)
+ end
+ end
+
+ def fileSave()
+ # This slot is called whenever the File.Save menu is selected,
+ # the Save shortcut is pressed (usually CTRL+S) or the Save toolbar
+ # button is clicked
+
+ # save the current file
+ end
+
+ def fileSaveAs()
+ # This slot is called whenever the File.Save As menu is selected,
+ file_url = KDE::FileDialog.getSaveURL()
+ if !file_url.empty? && file_url.valid?
+ # save your info, here
+ end
+ end
+
+ def filePrint()
+ # This slot is called whenever the File.Print menu is selected,
+ # the Print shortcut is pressed (usually CTRL+P) or the Print toolbar
+ # button is clicked
+ if @printer.nil? then @printer = KDE::Printer.new end
+ if @printer.setup(self)
+ # setup the printer. with Qt, you always "print" to a
+ # Qt::Painter.. whether the output medium is a pixmap, a screen,
+ # or paper
+ p = Qt::Painter.new
+ p.begin(@printer)
+
+ # we let our view do the actual printing
+ metrics = Qt::PaintDeviceMetrics.new(@printer)
+ @view.print(p, metrics.height(), metrics.width())
+
+ # and send the result to the printer
+ p.end()
+ end
+ end
+
+ def optionsPreferences()
+ # popup some sort of preference dialog, here
+ dlg = %{APPNAMESC}Preferences.new
+ if dlg.exec()
+ # redo your settings
+ end
+ end
+
+ def changeStatusbar(text)
+ # display the text on the statusbar
+ statusBar().message(text)
+ end
+
+ def changeCaption(text)
+ # display the text on the caption
+ setCaption(text)
+ end
+
+end
diff --git a/languages/ruby/app_templates/kapp/app_client.rb b/languages/ruby/app_templates/kapp/app_client.rb
new file mode 100644
index 00000000..b08e9b21
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/app_client.rb
@@ -0,0 +1,18 @@
+require 'Korundum'
+include KDE
+
+about = AboutData.new("%{APPNAMELC}_client", "%{APPNAME} client", "0.1")
+CmdLineArgs.init(ARGV, about)
+
+app = Application.new
+
+# get our DCOP client and attach so that we may use it
+client = app.dcopClient
+client.attach
+
+# do a 'send' for now
+dcopRef = DCOPRef.new("%{APPNAMELC}", "%{APPNAMESC}Iface")
+dcopRef.openURL("http://www.kde.org")
+
+app.exec
+
diff --git a/languages/ruby/app_templates/kapp/appiface.rb b/languages/ruby/app_templates/kapp/appiface.rb
new file mode 100644
index 00000000..a8be16b5
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/appiface.rb
@@ -0,0 +1,14 @@
+class %{APPNAMESC}Iface < KDE::DCOPObject
+
+ k_dcop 'void openURL(QString)'
+
+ def initialize(app)
+ super("%{APPNAMESC}Iface")
+ @app = app
+ end
+
+ def openURL(url)
+ @app.openURL(url)
+ end
+end
+
diff --git a/languages/ruby/app_templates/kapp/appui.rc b/languages/ruby/app_templates/kapp/appui.rc
new file mode 100644
index 00000000..ceb4f14e
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="custom"><text>C&amp;ustom</text>
+ <Action name="custom_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/ruby/app_templates/kapp/appview.rb b/languages/ruby/app_templates/kapp/appview.rb
new file mode 100644
index 00000000..bc5b5140
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/appview.rb
@@ -0,0 +1,103 @@
+
+=begin
+ This is the main view class for %{APPNAME}. Most of the non-menu,
+ non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ here.
+
+ This %{APPNAMELC} uses an HTML component as an example.
+
+ @short Main view
+ @author %{AUTHOR} <%{EMAIL}>
+ @version %{VERSION}
+=end
+class %{APPNAMESC}View < Qt::Widget
+
+ #
+ # Use this signal to change the content of the statusbar
+ #
+ signals 'signalChangeStatusbar(const QString&)'
+
+ #
+ # Use this signal to change the content of the caption
+ #
+ signals 'signalChangeCaption(const QString&)'
+
+ slots 'slotOnURL(const QString&)',
+ 'slotSetTitle(const QString&)'
+
+ def initialize(parent)
+ super(parent)
+
+ # keep a reference to the DCOP Interface so it doesn't get gc'd
+ @dcop = %{APPNAMESC}Iface.new(self)
+
+ # setup our layout manager to automatically add our widgets
+ top_layout = Qt::HBoxLayout.new(self)
+ top_layout.setAutoAdd(true)
+
+ # we want to look for all components that satisfy our needs. the
+ # trader will actually search through *all* registered KDE
+ # applications and components -- not just KParts. So we have to
+ # specify two things: a service type and a constraint
+ #
+ # the service type is like a mime type. we say that we want all
+ # applications and components that can handle HTML -- 'text/html'
+ #
+ # however, by itself, this will return such things as Netscape..
+ # not what we wanted. so we constrain it by saying that the
+ # string 'KParts/ReadOnlyPart' must be found in the ServiceTypes
+ # field. with this, only components of the type we want will be
+ # returned.
+ offers = KDE::Trader.self().query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes")
+
+ factory = nil
+ # in theory, we only care about the first one.. but let's try all
+ # offers just in when the first can't be loaded for some reason
+ offers.each do |ptr|
+ # we now know that our offer can handle HTML and is a part.
+ # since it is a part, it must also have a library... let's try to
+ # load that now
+ factory = KDE::LibLoader.self().factory( ptr.library() )
+ if ! factory.nil?
+ @html = factory.create(self, ptr.name(), "KParts::ReadOnlyPart")
+ break
+ end
+ end
+
+ # if our factory is invalid, then we never found our component
+ # and we might as well just exit now
+ if factory.nil?
+ KDE::MessageBox.error(self, i18n("Could not find a suitable HTML component"))
+ return
+ end
+
+ connect(@html, SIGNAL('setWindowCaption(const QString&)'),
+ self, SLOT('slotSetTitle(const QString&)'))
+ connect(@html, SIGNAL('setStatusBarText(const QString&)'),
+ self, SLOT('slotOnURL(const QString&)'))
+
+ end
+
+
+ def print(p, height, width)
+ # do the actual printing, here
+ # p.drawText(etc..)
+ end
+
+ def currentURL()
+ return @html.url().url()
+ end
+
+ def openURL(url)
+ @html.openURL(KDE::URL.new(url))
+ end
+
+ def slotOnURL(url)
+ emit signalChangeStatusbar(url)
+ end
+
+ def slotSetTitle(title)
+ emit signalChangeCaption(title)
+ end
+
+end
diff --git a/languages/ruby/app_templates/kapp/kappruby.kdevtemplate b/languages/ruby/app_templates/kapp/kappruby.kdevtemplate
new file mode 100644
index 00000000..490d7591
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/kappruby.kdevtemplate
@@ -0,0 +1,238 @@
+# KDE Config File
+[General]
+Name=Application framework
+Name[ca]=Infraestructura d'aplicacions
+Name[da]=Programskelet
+Name[de]=Anwendungsgrundgerüst
+Name[el]=Πλαίσιο εφαρμογής
+Name[es]=Infraestructura de aplicación
+Name[et]=Rakenduse raamistik
+Name[eu]=Aplikazioen lan-markoa
+Name[fa]=چارچوب کاربرد
+Name[fr]=Infrastructure d'application
+Name[ga]=Creatlach feidhmchláir
+Name[gl]=Entorno de traballo para aplicación
+Name[hu]=Alkalmazás-keretrendszer
+Name[it]=Infrastruttura applicativa
+Name[ja]=アプリケーションフレームワーク
+Name[nds]=Programmrahmenwark
+Name[ne]=अनुप्रयोग फ्रेमवर्क
+Name[nl]=Applicationframework
+Name[pl]=Szablon programu
+Name[pt]=Plataforma de aplicações
+Name[pt_BR]=Plataforma de aplicações
+Name[ru]=Приложение KDE
+Name[sk]=Aplikačný framework
+Name[sl]=Ogrodje programa
+Name[sr]=Радни оквир програма
+Name[sr@Latn]=Radni okvir programa
+Name[sv]=Programramverk
+Name[tr]=Uygulama Çatısı
+Name[zh_CN]=应用程序框架
+Name[zh_TW]=應用程式框架
+Icon=kapp.png
+Category=Ruby/KDE
+Comment=Generates a simple Korundum application with one toplevel window, menus and toolbars. A DCOP interface is also provided, so that your application can provide a scripting interface
+Comment[ca]=Genera una simple aplicació Korundum amb una finestra principal, menús i barres d'eines. També es proveeix la interfície DCOP, de manera que la vostra aplicació podrà proveir d'una interfície per a scripts
+Comment[da]=Generere et simpelt Korundum program med et vindue på topniveau, menuer og værktøjslinjer. Der sørges også for en DCOP-grænseflade, så dit program kan give en script-grænseflade
+Comment[de]=Erstellt eine einfache Korundum-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. Dazu kommt eine DCOP-Schnittstelle, so dass Ihre Anwendung eine Schnittstelle für Skripte anbieten kann.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή Korundum με ένα ανώτερο παράθυρο, μενού και γραμμές εργαλείων. Προσφέρεται επίσης μια διασύνδεση DCOP, έτσι ώστε η εφαρμογή σας να προσφέρει ένα περιβάλλον γραφής σεναρίων
+Comment[es]=Genera una sencilla aplicación Korundum con una ventana principal, menús y barras de herramientas. También se proporciona una interfaz DCOP para que su aplicación pueda proporcionar una interfaz para guiones de órdenes.
+Comment[et]=Lihtsa Korundumi rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. Lisatakse ka DCOP-liides, mis võimaldab rakendusel pakkuda skriptikeelte toetust
+Comment[eu]=Goi-mailako lehio bat, menuak eta tresna-barrak dituen Korundum aplikazio sinple bat sortzen du . DCOP interfazea ere sortzen du, eta beraz, zure aplikazioak script-interfaze bat eskainiko du
+Comment[fa]=یک کاربرد سادۀ Korundum با یک پنجرۀ سطح بالا، گزینگان و میله ابزارها تولید می‌کند. همچنین یک واسط DCOP فراهم است. بنابراین، کاربرد شما یک واسط دست‌نوشته‌ای را می‌تواند فراهم کند
+Comment[fr]=Génère une application Korundum simple comprenant une fenêtre de premier niveau, des menus et des barres d'outils. Une interface DCOP est également fournie, afin que votre application puisse offrir une interface de scriptage
+Comment[gl]=Xera unha aplicación sinxela Korundum cunha fiestra, menús e barras de ferramentas. Proporciónase tamén unha interface DCOP de modo que a súa aplicación poida ofrecer unha interface de scripting.
+Comment[hu]=Létrehoz egy egyszerű Korundum-alkalmazást egy főablakkal, menükkel és eszköztárakkal. DCOP-felület is tartozik az alkalmazáshoz, így könnyen kialakítható hozzá szkriptelési felület.
+Comment[it]=Genera una semplice applicazione Korundum con una finestra toplevel, menu e barre degli strumenti. È anche fornita un'interfaccia DCOP, così che l'applicazione può fornire una interfaccia di scripting
+Comment[nds]=Stellt en eenfach Korundum-Programm mit een böverst Finster, Menüs un Warktüüchbalkens op. Ok warrt noch en DCOP-Koppelsteed praatstellt, so dat Dien Programm en Skriptkoppelsteed anbeden kann.
+Comment[ne]=एउटा उच्च तह सञ्झ्याल, मेनु र उपकरणपट्टीसँग साधारण Korundum अनुप्रयोग उत्पन्न गर्दछ । DCOP इन्टरफेस पनि प्रदान गरिन्छ, जसले गर्दा तपाईँको अनुप्रयोगले स्क्रिप्टिङ इन्टरफेस प्रदान गर्न सक्छ ।
+Comment[nl]=Dit genereert een eenvoudige Korundum-toepassing met één toplevel window, menu's en toolbars. Een DCOP-interface wordt ook aangeleverd, zodat uw toepassing een scripting interface kan aanleveren.
+Comment[pl]=Generuje prosty program Korundum z jednym oknem, menu i paskami narzędzi. Dostępny jest także interfejs DCOP, więc Twój program może umożliwiać korzystanie ze skryptów
+Comment[pt]=Gera uma aplicação Korundum simples com uma janela de topo, menus e barras de ferramentas. Também é fornecida uma interface de DCOP, para que a sua aplicação possa oferecer uma interface de programação
+Comment[pt_BR]=Gera uma aplicação Korundum simples com uma janela de topo, menus e barras de ferramentas. Também é fornecida uma interface de DCOP, para que a sua aplicação possa oferecer uma interface de programação
+Comment[ru]=Создание простого приложения Korundum с окном, меню, панелями инструментов и сервисом DCOP
+Comment[sk]=Vygeneruje jednoduchú Korundum aplikáciu s jedným oknom, menu a panelom nástrojov. Taktiež bude poskytnuté DCOP rozhranie, takže aj aplikáciamôže poskytnúť skriptovacie rozhranie
+Comment[sr]=Прави једноставан Korundum програм са једним прозором највишег нивоа, менијима и тракама са алатом. Дат је и DCOP интерфејс, тако да ваш програм може да омогући скриптовање
+Comment[sr@Latn]=Pravi jednostavan Korundum program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. Dat je i DCOP interfejs, tako da vaš program može da omogući skriptovanje
+Comment[sv]=Skapar ett enkelt Korundum-program med ett toppnivåfönster, menyer och verktygsrader. Ett DCOP-gränssnitt tillhandahålls också, så att programmet kan tillhandahålla ett skriptgränssnitt.
+Comment[tr]=Bir üst seviye penceresi, menüleri ve araç çubukları olan basit bir Korundum uygulaması yaratır. Uygulamanızın bir betik arayüzü sağlayabilmesi için bir DCOP arayüzü de sağlanmıştır.
+Comment[zh_TW]=產生一個簡單的 Korundum 應用程式,內含頂層視窗、選單與工具列。另外提供一個 DCOP 介面,讓您的應用程式可以使用文稿介面。
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.rb
+Archive=kappruby.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{src}/app-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.rb
+Dest=%{dest}/src/%{APPNAMELC}.rb
+
+[FILE17]
+Type=install
+Source=%{src}/appview.rb
+Dest=%{dest}/src/%{APPNAMELC}view.rb
+
+[FILE18]
+Type=install
+Source=%{src}/appiface.rb
+Dest=%{dest}/src/%{APPNAMELC}iface.rb
+
+[FILE19]
+Type=install
+Source=%{src}/app_client.rb
+Dest=%{dest}/src/%{APPNAMELC}_client.rb
+
+[FILE20]
+Type=install
+Source=%{src}/pref.rb
+Dest=%{dest}/src/pref.rb
+
+[FILE21]
+Type=install
+Source=%{src}/main.rb
+Dest=%{dest}/src/main.rb
+
+[FILE22]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE23]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[MSG]
+Type=message
+Comment=A Korundum Application was created at %{dest}
+Comment[ca]=Una aplicació Korundum ha estat creada a %{dest}
+Comment[da]=Et Korundum program blev oprettet i %{dest}
+Comment[de]=Eine Korundum-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Korundum δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Korundum ha sido creada en %{dest}
+Comment[et]=Korundumi rakendus loodi asukohta %{dest}
+Comment[eu]=Korundum aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد Korundum در %{dest} ایجاد شد
+Comment[fr]=Une application Korundum a été créée dans %{dest}
+Comment[ga]=Cruthaíodh Feidhmchlár Korundum ag %{dest}
+Comment[gl]=Creouse unha aplicación Korundum en %{dest}
+Comment[hu]=Létrejött egy Korundum-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Korundum in %{dest}
+Comment[ja]=Korundum アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Korundum-Programm opstellt.
+Comment[ne]=Korundum अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Korundum-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program Korundum został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação Korundum em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação Korundum em %{dest}
+Comment[ru]=Приложение Korundum создано в %{dest}
+Comment[sk]=Korundum aplikácia bola vytvorená v %{dest}
+Comment[sr]=Korundum програм је направљен у %{dest}
+Comment[sr@Latn]=Korundum program je napravljen u %{dest}
+Comment[sv]=Ett Korundum-program skapades i %{dest}
+Comment[tr]=Bir Korundum Uygulaması %{dest} içinde yaratıldı.
+Comment[zh_TW]=一個 Korundum 應用程式已建立於 %{dest}
diff --git a/languages/ruby/app_templates/kapp/kappruby.png b/languages/ruby/app_templates/kapp/kappruby.png
new file mode 100644
index 00000000..913ebb87
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/kappruby.png
Binary files differ
diff --git a/languages/ruby/app_templates/kapp/main.rb b/languages/ruby/app_templates/kapp/main.rb
new file mode 100644
index 00000000..31d5e868
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/main.rb
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+
+require 'Korundum'
+
+require '%{APPNAMELC}iface.rb'
+require '%{APPNAMELC}.rb'
+require '%{APPNAMELC}view.rb'
+require 'pref.rb'
+
+description = I18N_NOOP("A KDE Application")
+version = "%{VERSION}"
+options = [ [ "+[URL]", I18N_NOOP( "Document to open" ), "" ] ]
+
+about = KDE::AboutData.new("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KDE::AboutData.License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", nil, nil, "%{EMAIL}")
+about.addAuthor( "%{AUTHOR}", nil, "%{EMAIL}" )
+KDE::CmdLineArgs.init(ARGV, about)
+KDE::CmdLineArgs.addCmdLineOptions(options)
+app = KDE::Application.new
+
+# see if we are starting with session management
+if app.restored?
+ RESTORE(%{APPNAMESC})
+else
+ # no session.. just start up normally
+ args = KDE::CmdLineArgs.parsedArgs
+ if args.count == 0
+ widget = %{APPNAMESC}.new
+ widget.show
+ else
+ for i in 0...args.count do
+ widget = %{APPNAMESC}.new
+ widget.show
+ widget.load(args.url(i))
+ end
+ end
+end
+
+app.exec
+
diff --git a/languages/ruby/app_templates/kapp/pref.rb b/languages/ruby/app_templates/kapp/pref.rb
new file mode 100644
index 00000000..98669ad2
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/pref.rb
@@ -0,0 +1,38 @@
+
+class %{APPNAMESC}Preferences < KDE::DialogBase
+
+ def initialize()
+ super(TreeList, i18n("%{APPNAMESC} Preferences"),
+ Help|Default|Ok|Apply|Cancel, Ok)
+ # this is the base class for your preferences dialog. it is now
+ # a Treelist dialog.. but there are a number of other
+ # possibilities (including Tab, Swallow, and just Plain)
+ frame = addPage(i18n("First Page"), i18n("Page One Options"))
+ @pageOne = %{APPNAMESC}PrefPageOne.new(frame)
+
+ frame = addPage(i18n("Second Page"), i18n("Page Two Options"))
+ @pageTwo = %{APPNAMESC}PrefPageTwo.new(frame)
+ end
+end
+
+class %{APPNAMESC}PrefPageOne < Qt::Frame
+
+ def initialize(parent)
+ super(parent)
+ layout = Qt::HBoxLayout.new(self)
+ layout.setAutoAdd(true)
+
+ Qt::Label.new(i18n("Add something here"), self)
+ end
+end
+
+class %{APPNAMESC}PrefPageTwo < Qt::Frame
+
+ def initialize(parent)
+ super(parent)
+ layout = Qt::HBoxLayout.new(self)
+ layout.setAutoAdd(true)
+
+ Qt::Label.new(i18n("Add something here"), self)
+ end
+end
diff --git a/languages/ruby/app_templates/kapp/src-Makefile.am b/languages/ruby/app_templates/kapp/src-Makefile.am
new file mode 100644
index 00000000..d27aa6b3
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/src-Makefile.am
@@ -0,0 +1,43 @@
+## Makefile.am for %{APPNAMELC}
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH) -L$(RUBY_LIBDIR)
+
+# the libraries to link against.
+%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT) $(RUBY_LIBRUBYARG)
+
+# which sources should be compiled for %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
+
+rubysrc_DATA = main.rb %{APPNAMELC}.rb %{APPNAMELC}_client.rb %{APPNAMELC}iface.rb \
+ %{APPNAMELC}view.rb pref.rb
+
+rubysrcdir = $(kde_datadir)/%{APPNAMELC}
+
+rubyui_DATA =
+
+rubyuidir = $(kde_datadir)/%{APPNAMELC}
+
+%.rb: %.ui
+ $(RBUIC) -tr ${UIC_TR} -kde $< -o $@
+
diff --git a/languages/ruby/app_templates/kapp/subdirs b/languages/ruby/app_templates/kapp/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/ruby/app_templates/kapp/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/ruby/app_templates/kxt/Makefile.am b/languages/ruby/app_templates/kxt/Makefile.am
new file mode 100644
index 00000000..b642b88b
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/Makefile.am
@@ -0,0 +1,20 @@
+dataFiles = app.rb main.rb prefs.rb app.cpp appview.rb appview_base.ui prefs-base.ui \
+ appui.rc app.desktop kxtruby.png app.kdevelop \
+ app-Makefile.am app-configure.in.in \
+ app.kcfg settings.kcfgc src-Makefile.am subdirs README
+
+templateName = kxtruby
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/kxt/README b/languages/ruby/app_templates/kxt/README
new file mode 100644
index 00000000..490ddab8
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/README
@@ -0,0 +1,38 @@
+KConfig XT Ruby template quick start
+Author: Anne-Marie Mahfouf
+Date: 2006-12-12
+-----------------------------------------------
+
+This README file explains you some basic things for starting with
+this application template, a KConfig XT Ruby template.
+-----------------------------------------------
+
+-- REQUIREMENTS --
+you need
+- Qt version might be 3.3.4 or 3.3.5.
+- kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template.
+- Korundum either from your distribution or from the kdebindings module or also
+from
+http://rubyforge.org/projects/korundum/.
+
+-----------------------------------------------
+
+-- BUILD --
+In KDevelop Build menu choose:
+Run automake & friends
+Run Configure
+Build Project
+Install (or Install as root)
+-----------------------------------------------
+
+-- RUN --
+You will see that the Build menu in KDevelop is now adapted to Ruby.
+In the Build menu, choose
+Run or use Shift + F9 to see your project running.
+
+-----------------------------------------------
+
+-- RELEVANT LINK --
+http://developer.kde.org/language-bindings/ruby/index.html
+
+In KDevelop Documentation, you can find a Ruby tutorial. \ No newline at end of file
diff --git a/languages/ruby/app_templates/kxt/app-Makefile.am b/languages/ruby/app_templates/kxt/app-Makefile.am
new file mode 100644
index 00000000..bfe1c599
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app-Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = $(TOPSUBDIRS)
diff --git a/languages/ruby/app_templates/kxt/app-configure.in.in b/languages/ruby/app_templates/kxt/app-configure.in.in
new file mode 100644
index 00000000..7d849466
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app-configure.in.in
@@ -0,0 +1,45 @@
+#MIN_CONFIG(3.0.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, 0.1)
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
+AC_PROG_MAKE_SET
+
+AC_CHECK_PROG(RUBY, ruby, ruby)
+
+if test -z "$RUBY"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE qtruby"
+else
+ AC_MSG_CHECKING(for ruby dirs)
+ RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
+ RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
+ RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
+ RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
+ RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+ AC_MSG_RESULT([archdir $RUBY_ARCHDIR, sitearchdir $RUBY_SITEARCHDIR, sitedir $RUBY_SITEDIR, libdir $RUBY_LIBDIR, librubyarg $RUBY_LIBRUBYARG])
+ AC_SUBST(RUBY_ARCHDIR)
+ AC_SUBST(RUBY_SITEARCHDIR)
+ AC_SUBST(RUBY_SITEDIR)
+ AC_SUBST(RUBY_LIBDIR)
+ AC_SUBST(RUBY_LIBRUBYARG)
+fi
+
+# Korundum check
+AC_MSG_CHECKING([whether Korundum is installed])
+korundum_present=no
+cat >korundumtest.rb <<END
+require 'Korundum'
+END
+${RUBY} korundumtest.rb >/dev/null 2>&1 && korundum_present=yes
+AC_MSG_RESULT([$korundum_present])
+
+# rbuic check
+AC_PATH_PROG([RBUIC],[rbuic])
+if test -z "${RBUIC}" ; then
+ AC_MSG_ERROR([cannot find rbuic (part of the QtRuby package)])
+fi
+AC_SUBST([RBUIC])
+AC_SUBST([RUBY])
+
+
diff --git a/languages/ruby/app_templates/kxt/app.cpp b/languages/ruby/app_templates/kxt/app.cpp
new file mode 100644
index 00000000..8d6af02d
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app.cpp
@@ -0,0 +1,30 @@
+#include <ruby.h>
+
+#include <qstring.h>
+#include <qfileinfo.h>
+#include <kinstance.h>
+#include <kstandarddirs.h>
+
+int main(int argc, char **argv) {
+ KInstance * instance = new KInstance("%{APPNAMELC}");
+ QString appdir = ::locate("data", "%{APPNAMELC}/main.rb", instance);
+ delete instance;
+ if (appdir.isNull()) {
+ qFatal("Error: Can't find \"%{APPNAMELC}/main.rb\"\n");
+ }
+ QFileInfo program(appdir);
+
+ char ** rubyargs = (char **) calloc(argc+4, sizeof(char *));
+ rubyargs[0] = strdup(argv[0]);
+ rubyargs[1] = strdup("-KU");
+ rubyargs[2] = strdup(QString("-C%1").arg(program.dirPath()).latin1());
+ rubyargs[3] = strdup(QString("-I%1").arg(program.dirPath()).latin1());
+ rubyargs[4] = strdup(program.fileName().latin1());
+ for (int i = 1; i < argc; i++) {
+ rubyargs[i+4] = argv[i];
+ }
+
+ ruby_init();
+ ruby_options(argc+4, rubyargs);
+ ruby_run();
+}
diff --git a/languages/ruby/app_templates/kxt/app.desktop b/languages/ruby/app_templates/kxt/app.desktop
new file mode 100644
index 00000000..8b36e6e0
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC}
+Icon=%{APPNAMELC}
+Type=Application
+Comment=A simple KDE Application
+Comment[br]=Ur meziant eeun evit KDE
+Comment[ca]=Una simple aplicació per al KDE
+Comment[da]=Et simpelt KDE program
+Comment[de]=Eine einfache KDE-Anwendung
+Comment[el]=Μια απλή εφαρμογή του KDE
+Comment[es]=Una aplicación de KDE sencilla
+Comment[et]=Lihtne KDE rakendus
+Comment[eu]=KDE aplikazio simple bat
+Comment[fa]=یک کاربرد سادۀ KDE
+Comment[fr]=Une application simple pour KDE
+Comment[ga]=Feidhmchlár Simplí KDE
+Comment[gl]=Unha aplicación KDE sinxela
+Comment[hi]=एक सादा केडीई अनुप्रयोग
+Comment[hu]=Egyszerű KDE-alkalmazás
+Comment[is]=Einfalt KDE forrit
+Comment[it]=Una semplice applicazione KDE
+Comment[ja]=簡単な KDE アプリケーション
+Comment[nds]=En eenfach KDE-Programm
+Comment[ne]=एउटा साधारण केडीई अनुप्रयोग
+Comment[nl]=Een eenvoudige KDE-toepassing
+Comment[pl]=Prosty program KDE
+Comment[pt]=Uma aplicação simples do KDE
+Comment[pt_BR]=Um simples Aplicativo do KDE
+Comment[ru]=Простое приложение KDE
+Comment[sk]=Jednoduchá KDE aplikácia
+Comment[sl]=Preprost program za KDE
+Comment[sr]=Једноставан KDE програм
+Comment[sr@Latn]=Jednostavan KDE program
+Comment[sv]=Ett enkelt KDE-program
+Comment[ta]=ஒரு சாதாரண கெடிஇ பயன்பாடு
+Comment[tg]=Гузориши оддиKDE
+Comment[tr]=Basit bir KDE Uygulaması
+Comment[zh_CN]=一个简单的 KDE 应用程序
+Comment[zh_TW]=簡單的 KDE 應用程式
diff --git a/languages/ruby/app_templates/kxt/app.kcfg b/languages/ruby/app_templates/kxt/app.kcfg
new file mode 100644
index 00000000..d5325b92
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app.kcfg
@@ -0,0 +1,21 @@
+<?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" >
+ <kcfgfile name="%{APPNAME}rc"/>
+ <group name="Preferences">
+ <entry name="col_background" type="Color">
+ <label>color of the background</label>
+ <default>black</default>
+ </entry>
+ <entry name="col_foreground" type="Color">
+ <label>color of the foreground</label>
+ <default>yellow</default>
+ </entry>
+ <entry name="val_time" type="Int">
+ <label>size of a ball</label>
+ <default>2</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/languages/ruby/app_templates/kxt/app.kdevelop b/languages/ruby/app_templates/kxt/app.kdevelop
new file mode 100644
index 00000000..3a1efdd9
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app.kdevelop
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <activedir/>
+ </general>
+ <run>
+ <mainprogram>src/%{APPNAMELC}</mainprogram>
+ </run>
+ </kdevautoproject>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>CVS,.svn</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.rb" name="Ruby files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwindows_bugs</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ <type ext="ui"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ <charactercoding>3</charactercoding>
+ <mainprogram>src/main.rb</mainprogram>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/kxt/app.rb b/languages/ruby/app_templates/kxt/app.rb
new file mode 100644
index 00000000..39da5345
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/app.rb
@@ -0,0 +1,94 @@
+=begin
+ This class serves as the main window for %{APPNAME}. It handles the
+ menus, toolbars, and status bars.
+
+ @short Main window class
+ @author %{AUTHOR} <%{EMAIL}>
+ @version %{VERSION}
+=end
+
+class %{APPNAMESC} < KDE::MainWindow
+
+ slots 'fileNew()',
+ 'optionsPreferences()',
+ 'newToolbarConfig()',
+ 'changeStatusbar(const QString&)',
+ 'changeCaption(const QString&)'
+
+ def initialize()
+ super( nil, "%{APPNAMESC}" )
+ Settings.instance.readConfig
+ @view = %{APPNAMESC}View.new(self)
+ @printer = nil
+
+ # accept dnd
+ setAcceptDrops(true)
+
+ # tell the KDE::MainWindow that this is indeed the main widget
+ setCentralWidget(@view)
+
+ # then, setup our actions
+ setupActions()
+
+ # and a status bar
+ statusBar().show()
+
+ # Apply the create the main window and ask the mainwindow to
+ # automatically save settings if changed: window size, toolbar
+ # position, icon size, etc. Also to add actions for the statusbar
+ # toolbar, and keybindings if necessary.
+ setupGUI();
+
+ # allow the view to change the statusbar and caption
+ connect(@view, SIGNAL('signalChangeStatusbar(const QString&)'),
+ self, SLOT('changeStatusbar(const QString&)'))
+ connect(@view, SIGNAL('signalChangeCaption(const QString&)'),
+ self, SLOT('changeCaption(const QString&)'))
+
+ end
+
+ def setupActions()
+ KDE::StdAction.openNew(self, SLOT('fileNew()'), actionCollection())
+ KDE::StdAction.quit($kapp, SLOT('quit()'), actionCollection())
+
+ KDE::StdAction.preferences(self, SLOT('optionsPreferences()'), actionCollection())
+
+ # this doesn't do anything useful. it's just here to illustrate
+ # how to insert a custom menu and menu item
+ custom = KDE::Action.new(i18n("Swi&tch Colors"), KDE::Shortcut.new(),
+ @view, SLOT('switchColors()'),
+ actionCollection(), "switch_action")
+ end
+
+ def fileNew()
+ # This slot is called whenever the File.New menu is selected,
+ # the New shortcut is pressed (usually CTRL+N) or the New toolbar
+ # button is clicked
+
+ # create a new window
+ %{APPNAMESC}.new.show()
+ end
+
+ def optionsPreferences()
+ # The preference dialog is derived from prefs-base.ui which is subclassed into Prefs
+ #
+ # compare the names of the widgets in the .ui file
+ # to the names of the variables in the .kcfg file
+ dialog = KDE::ConfigDialog.new(self, "settings", Settings.instance, KDE::DialogBase::Swallow)
+ dialog.addPage(Prefs.new(), i18n("General"), "package_settings")
+ connect(dialog, SIGNAL('settingsChanged()'), @view, SLOT('settingsChanged()'))
+ dialog.show()
+
+ end
+
+ def changeStatusbar(text)
+ # display the text on the statusbar
+ statusBar().message(text)
+ end
+
+ def changeCaption(text)
+ # display the text on the caption
+ setCaption(text)
+ end
+
+end
diff --git a/languages/ruby/app_templates/kxt/appui.rc b/languages/ruby/app_templates/kxt/appui.rc
new file mode 100644
index 00000000..06549878
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/appui.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="%{APPNAMELC}" version="1">
+<MenuBar>
+ <Menu name="move"><text>&amp;Move</text>
+ <Action name="switch_action" />
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/languages/ruby/app_templates/kxt/appview.rb b/languages/ruby/app_templates/kxt/appview.rb
new file mode 100644
index 00000000..391f4c37
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/appview.rb
@@ -0,0 +1,55 @@
+
+=begin
+ This is the main view class for %{APPNAME}. Most of the non-menu,
+ non-toolbar, and non-statusbar (e.g., non frame) GUI code should go
+ here.
+
+ This %{APPNAMELC} uses an HTML component as an example.
+
+ @short Main view
+ @author %{AUTHOR} <%{EMAIL}>
+ @version %{VERSION}
+=end
+class %{APPNAMESC}View < %{APPNAMESC}view_base
+
+ #
+ # Use this signal to change the content of the statusbar
+ #
+ signals 'signalChangeStatusbar(const QString&)'
+
+ #
+ # Use this signal to change the content of the caption
+ #
+ signals 'signalChangeCaption(const QString&)'
+
+ slots 'switchColors()',
+ 'settingsChanged()'
+
+ def initialize(parent)
+ super(parent)
+
+ settingsChanged()
+ end
+
+ def switchColors()
+ color = Settings.instance.col_background
+ Settings.instance.setCol_background( Settings.instance.col_foreground )
+ Settings.instance.setCol_foreground( color )
+
+ settingsChanged()
+ end
+
+ def settingsChanged()
+ sillyLabel.setPaletteBackgroundColor( Settings.instance.col_background )
+ sillyLabel.setPaletteForegroundColor( Settings.instance.col_foreground )
+ # i18n : internationallization
+ sillyLabel.setText( i18n("This project is %d days old" % Settings.instance.val_time) )
+
+ emit signalChangeStatusbar( i18n("Settings changed") )
+ end
+
+ def slotSetTitle(title)
+ emit signalChangeCaption(title)
+ end
+
+end
diff --git a/languages/ruby/app_templates/kxt/appview_base.ui b/languages/ruby/app_templates/kxt/appview_base.ui
new file mode 100644
index 00000000..78009d08
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/appview_base.ui
@@ -0,0 +1,33 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>%{APPNAME}view_base</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>%{APPNAMESC}view_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>268</width>
+ <height>164</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>%{APPNAMESC}_base</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>sillyLabel</cstring>
+ </property>
+ <property name="text">
+ <string>hello, world</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/languages/ruby/app_templates/kxt/kxtruby.kdevtemplate b/languages/ruby/app_templates/kxt/kxtruby.kdevtemplate
new file mode 100644
index 00000000..fd2a5c1a
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/kxtruby.kdevtemplate
@@ -0,0 +1,251 @@
+# KDE Config File
+[General]
+
+Name=KConfig XT application
+Name[ca]=Aplicació KConfig XT
+Name[da]=KConfig XT program
+Name[de]=KConfigXT-Anwendung
+Name[el]=Εφαρμογή KConfig XT
+Name[es]=Aplicación KConfig XT
+Name[et]=KConfig XT rakendus
+Name[eu]=KConfig XT aplikazioa
+Name[fa]=کاربرد KConfig XT
+Name[fr]=Application KConfig XT
+Name[ga]=Feidhmchlár XT KConfig
+Name[gl]=Aplicación KConfig XT
+Name[hu]=KConfig XT-alapú alkalmazás
+Name[it]=Applicazione KConfig XT
+Name[ja]=KConfig XT アプリケーション
+Name[nds]=KConfig-XT-Programm
+Name[ne]=KConfig XT अनुप्रयोग
+Name[nl]=KConfig XT-toepassing
+Name[pl]=Program KConfig XT
+Name[pt]=Aplicação do KConfig XT
+Name[pt_BR]=Aplicação do KConfig XT
+Name[ru]=Приложение KDE с KConfig XT
+Name[sk]=KConfig XT aplikácia
+Name[sr]=KConfig XT програм
+Name[sr@Latn]=KConfig XT program
+Name[sv]=KConfig XT-program
+Name[tr]=KConfig XT uygulaması
+Name[zh_CN]=KConfig XT 应用程序
+Name[zh_TW]=KConfig XT 應用程式
+Category=Ruby/KDE
+Icon=kxtruby.png
+Comment=Generates a simple KDE application with one widget and a configuration dialog
+Comment[ca]=Genera una simple aplicació per al KDE amb un estri i un diàleg de configuració
+Comment[da]=Genererer et simpelt KDE-program med en kontrol og en indstillingsdialog
+Comment[de]=Erstellt eine einfache KDE-Anwendung mit einem Widget und einem Einstellungsdialog.
+Comment[el]=Δημιουργεί μια απλή εφαρμογή KDE με ένα γραφικό συστατικό, ένα διάλογο ρύθμισης
+Comment[en_GB]=Generates a simple KDE application with one widget and a configuration dialogue
+Comment[es]=Genera una sencilla aplicación para KDE con una ventana y un diálogo de configuración
+Comment[et]=Lihtsa KDE rakenduse loomine ühe vidina ja seadistustedialoogiga.
+Comment[eu]=Trepeta bat eta konfigurazio elkarrizketa-koadro bat duen KDE aplikazio sinple bat sortzen du
+Comment[fa]=یک کاربرد سادۀ KDE، با یک عنصر و یک محاورۀ پیکربندی تولید می‌کند
+Comment[fr]=Génère une application KDE simple comprenant un seul élément graphique (widget) et une boîte de dialogue de configuration
+Comment[ga]=Cruthaíonn sé seo feidhmchlár simplí KDE le giuirléid amháin agus dialóg chumraíochta
+Comment[gl]=Xera unha aplicación KDE sinxela cunha compoñente e un diálogo de configuración
+Comment[hu]=Létrehoz egy egyszerű KDE-alkalmazást egy grafikus elemmel és egy beállítóablakkal
+Comment[it]=Genera una semplice applicazione KDE con un elemento grafico e una finestra di configurazione
+Comment[ja]=一つのウィジェットと設定ダイアログを含む簡単な KDE アプリケーションを作成します
+Comment[nds]=Stellt en eenfach KDE-Programm mit een Element un en Instelldialoog op
+Comment[ne]=एउटा विगेट र कन्फिगरेसन संवादसँग साधारण केडीई अनुप्रयोग उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudige KDE-toepassing met één widget en een configuratiedialoog
+Comment[pl]=Generuje prosty program KDE z jednym widgetem i oknem konfiguracyjnym
+Comment[pt]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração
+Comment[pt_BR]=Gera uma aplicação simples do KDE com uma janela principal e outra para configuração
+Comment[ru]=Создание приложения KDE с окном конфигурации
+Comment[sk]=Vygeneruje jednoduchú KDE aplikáciu s jedným oknom a konfiguračným dialógom
+Comment[sr]=Прави једноставан KDE програм са једном контролом и дијалогом за подешавање
+Comment[sr@Latn]=Pravi jednostavan KDE program sa jednom kontrolom i dijalogom za podešavanje
+Comment[sv]=Skapar ett enkelt KDE-program med en grafisk komponent och en inställningsdialogruta
+Comment[tr]=Bir parçacığı ve ayar penceresi olan basit bir KDE uygulaması yaratır.
+Comment[zh_CN]=生成带一个部件和一个配置对话框的简单 KDE 应用程序
+Comment[zh_TW]=產生一個簡單的 KDE 應用程式,內含一個元件與一個設定對話框。
+ShowFilesAfterGeneration=%{dest}/src/%{APPNAMELC}.rb,%{dest}/src/README
+Archive=kxtruby.tar.gz
+
+[ADMIN]
+Type=include
+File=%{kdevelop}/template-common/admin.kdevtemplate
+
+[GNU]
+Type=include
+File=%{kdevelop}/template-common/gnu.kdevtemplate
+
+[MKDIR_DOCBOOK1]
+Type=mkdir
+Dir=%{dest}/doc
+
+[MKDIR_DOCBOOK2]
+Type=mkdir
+Dir=%{dest}/doc/en
+
+[FILE1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+
+[FILE2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+
+[FILE3]
+Type=install
+EscapeXML=true
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+
+[FILE4]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE5]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.am
+Dest=%{dest}/Makefile.am
+
+[FILE6]
+Type=install
+Source=%{kdevelop}/template-common/kde-Makefile.cvs
+Dest=%{dest}/Makefile.cvs
+
+[FILE7]
+Type=install
+Source=%{src}/app-configure.in.in
+Dest=%{dest}/configure.in.in
+
+[MkDir3]
+Type=mkdir
+Dir=%{dest}/src
+
+[FILE8]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.desktop
+Dest=%{dest}/src/%{APPNAMELC}.desktop
+
+[FILE9]
+Type=install
+Source=%{kdevelop}/template-common/kde-app.lsm
+Dest=%{dest}/src/%{APPNAMELC}.lsm
+
+[FILE10]
+Type=install
+Source=%{kdevelop}/template-common/hi16-app-app.png
+Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png
+Process=false
+
+[FILE11]
+Type=install
+Source=%{kdevelop}/template-common/hi32-app-app.png
+Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png
+Process=false
+
+[MkDir4]
+Type=mkdir
+Dir=%{dest}/po
+
+[FILE12]
+Type=install
+Source=%{kdevelop}/template-common/kde-po-Makefile.am
+Dest=%{dest}/po/Makefile.am
+
+[FILE13]
+Type=install
+Source=%{src}/subdirs
+Dest=%{dest}/subdirs
+
+[FILE14]
+Type=install
+Source=%{src}/src-Makefile.am
+Dest=%{dest}/src/Makefile.am
+
+[FILE15]
+Type=install
+Source=%{src}/app.cpp
+Dest=%{dest}/src/%{APPNAMELC}.cpp
+
+[FILE16]
+Type=install
+Source=%{src}/app.rb
+Dest=%{dest}/src/%{APPNAMELC}.rb
+
+[FILE17]
+Type=install
+Source=%{src}/appview.rb
+Dest=%{dest}/src/%{APPNAMELC}view.rb
+
+[FILE18]
+Type=install
+Source=%{src}/appview_base.ui
+Dest=%{dest}/src/appview_base.ui
+
+[FILE19]
+Type=install
+Source=%{src}/prefs-base.ui
+Dest=%{dest}/src/prefs-base.ui
+
+[FILE20]
+Type=install
+Source=%{src}/prefs.rb
+Dest=%{dest}/src/prefs.rb
+
+[FILE21]
+Type=install
+Source=%{src}/main.rb
+Dest=%{dest}/src/main.rb
+
+[FILE22]
+Type=install
+EscapeXML=true
+Source=%{src}/appui.rc
+Dest=%{dest}/src/%{APPNAMELC}ui.rc
+
+[FILE23]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/src/README
+
+[FILE24]
+Type=install
+Source=%{src}/app.kcfg
+Dest=%{dest}/src/%{APPNAMELC}.kcfg
+
+[FILE25]
+Type=install
+Source=%{src}/settings.kcfgc
+Dest=%{dest}/src/settings.kcfgc
+
+[MSG]
+Type=message
+Comment=A Korundum KConfig XT Application was created at %{dest}
+Comment[ca]=Una aplicació Korundum amb KConfig XT ha estat creada a %{dest}
+Comment[da]=Et Korundum KConfig XT program blev oprettet i %{dest}
+Comment[de]=Eine Korundum-KConfig-XT-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή Korundum KConfig XT δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación Korundum con KConfig XT ha sido creada en %{dest}
+Comment[et]=Korundumi KConfig XT rakendus loodi asukohta %{dest}
+Comment[eu]=Korundum KConfig XT aplikazio bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد Korundum KConfig XT در %{dest} ایجاد شد
+Comment[fr]=Une application KConfig XT Korundum a été créée dans %{dest}
+Comment[ga]=Cruthaíodh Feidhmchlár Korundum KConfig XT ag %{dest}
+Comment[gl]=Creouse unha aplicación KConfig XT con Korundum en %{dest}
+Comment[hu]=Létrejött egy Korundum-alapú KConfig XT-s alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione Korundum KConfig XT in %{dest}
+Comment[ja]=Korundum KConfig XT アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en Korundum/KConfig-XT-Programm opstellt.
+Comment[ne]=Korundum KConfig XT अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een Korundum KConfig XT-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program Korundum KConfig XT został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação Korundum com KConfig XT em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação Korundum com KConfig XT em %{dest}
+Comment[ru]=Приложение Korundum с KConfig XT создано в %{dest}
+Comment[sk]=Korundim KConfig XT aplikácia bola vytvorená v %{dest}
+Comment[sr]=Korundum KConfig XT програм направљен је у %{dest}
+Comment[sr@Latn]=Korundum KConfig XT program napravljen je u %{dest}
+Comment[sv]=Ett Korundum KConfig XT-program skapades i %{dest}
+Comment[tr]=Bir Korundum KConfig XT uygulaması %{dest} içinde yaratıldı.
+Comment[zh_TW]=一個 Korundum KConfig XT 應用程式已建立於 %{dest}
diff --git a/languages/ruby/app_templates/kxt/kxtruby.png b/languages/ruby/app_templates/kxt/kxtruby.png
new file mode 100644
index 00000000..419dfa33
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/kxtruby.png
Binary files differ
diff --git a/languages/ruby/app_templates/kxt/main.rb b/languages/ruby/app_templates/kxt/main.rb
new file mode 100644
index 00000000..930bff4f
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/main.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+
+require 'Korundum'
+
+require '%{APPNAMELC}.rb'
+require 'prefs-base.rb'
+require 'prefs.rb'
+require 'settings.rb'
+require 'appview_base.rb'
+require '%{APPNAMELC}view.rb'
+
+description = I18N_NOOP("A KDE Application")
+version = "%{VERSION}"
+options = [ [ "+[URL]", I18N_NOOP( "Document to open" ), "" ] ]
+
+about = KDE::AboutData.new("%{APPNAMELC}", I18N_NOOP("%{APPNAME}"), version, description,
+ KDE::AboutData.License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", nil, nil, "%{EMAIL}")
+about.addAuthor( "%{AUTHOR}", nil, "%{EMAIL}" )
+KDE::CmdLineArgs.init(ARGV, about)
+KDE::CmdLineArgs.addCmdLineOptions(options)
+app = KDE::Application.new
+
+# see if we are starting with session management
+if app.restored?
+ RESTORE(%{APPNAMESC})
+else
+ # no session.. just start up normally
+ args = KDE::CmdLineArgs.parsedArgs
+ if args.count == 0
+ widget = %{APPNAMESC}.new
+ widget.show
+ else
+ for i in 0...args.count do
+ widget = %{APPNAMESC}.new
+ widget.show
+ end
+ end
+end
+
+app.exec
+
diff --git a/languages/ruby/app_templates/kxt/prefs-base.ui b/languages/ruby/app_templates/kxt/prefs-base.ui
new file mode 100644
index 00000000..5c0fc860
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/prefs-base.ui
@@ -0,0 +1,127 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>Prefs_base</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Prefs_base</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>282</width>
+ <height>156</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Background color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>kcfg_col_background</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Project age:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Foreground color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>kcfg_col_foreground</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="0" 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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox" row="2" column="1">
+ <property name="name">
+ <cstring>kcfg_val_time</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ </widget>
+ <spacer row="2" column="2">
+ <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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/ruby/app_templates/kxt/prefs.rb b/languages/ruby/app_templates/kxt/prefs.rb
new file mode 100644
index 00000000..1469687e
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/prefs.rb
@@ -0,0 +1,7 @@
+
+class Prefs < Prefs_base
+
+ def initialize()
+ super()
+ end
+end
diff --git a/languages/ruby/app_templates/kxt/previewruby.png b/languages/ruby/app_templates/kxt/previewruby.png
new file mode 100644
index 00000000..e235c9cf
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/previewruby.png
Binary files differ
diff --git a/languages/ruby/app_templates/kxt/settings.kcfgc b/languages/ruby/app_templates/kxt/settings.kcfgc
new file mode 100644
index 00000000..384510cd
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/settings.kcfgc
@@ -0,0 +1,6 @@
+# Code generation options for kconfig_compiler
+File=%{APPNAMELC}.kcfg
+ClassName=Settings
+Singleton=true
+Mutators=col_background,col_foreground
+# will create the necessary code for setting those variables
diff --git a/languages/ruby/app_templates/kxt/src-Makefile.am b/languages/ruby/app_templates/kxt/src-Makefile.am
new file mode 100644
index 00000000..a8170abc
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/src-Makefile.am
@@ -0,0 +1,48 @@
+## Makefile.am for %{APPNAMELC}
+
+# this is the program that gets installed. it's name is used for all
+# of the other Makefile.am variables
+bin_PROGRAMS = %{APPNAMELC}
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes) -I$(RUBY_ARCHDIR)
+
+# the library search path.
+%{APPNAMELC}_LDFLAGS = $(all_libraries) $(KDE_RPATH) -L$(RUBY_LIBDIR)
+
+# the libraries to link against.
+%{APPNAMELC}_LDADD = $(LIB_KFILE) $(LIB_KDEPRINT) $(RUBY_LIBRUBYARG)
+
+# which sources should be compiled for %{APPNAMELC}
+%{APPNAMELC}_SOURCES = %{APPNAMELC}.cpp
+
+# let automoc handle all of the meta source files (moc)
+METASOURCES = AUTO
+
+KDE_ICON = AUTO
+
+# this is where the kdelnk file will go
+kdelnkdir = $(kde_appsdir)/Utilities
+kdelnk_DATA = %{APPNAMELC}.desktop
+
+# this is where the XML-GUI resource file goes
+rcdir = $(kde_datadir)/%{APPNAMELC}
+rc_DATA = %{APPNAMELC}ui.rc
+
+rubysrc_DATA = main.rb %{APPNAMELC}.rb %{APPNAMELC}view.rb prefs.rb \
+ appview_base.rb prefs-base.rb settings.rb
+
+rubysrcdir = $(kde_datadir)/%{APPNAMELC}
+
+rubyui_DATA = appview_base.ui prefs-base.ui
+
+rubyuidir = $(kde_datadir)/%{APPNAMELC}
+
+%.rb: %.ui
+ $(RBUIC) -tr ${UIC_TR} -kde $< -o $@
+
+RBKCONFIG_COMPILER = rbkconfig_compiler
+
+settings.rb: %{APPNAMELC}.kcfg settings.kcfgc
+ $(RBKCONFIG_COMPILER) ./%{APPNAMELC}.kcfg ./settings.kcfgc
+
diff --git a/languages/ruby/app_templates/kxt/subdirs b/languages/ruby/app_templates/kxt/subdirs
new file mode 100644
index 00000000..0e678106
--- /dev/null
+++ b/languages/ruby/app_templates/kxt/subdirs
@@ -0,0 +1,3 @@
+doc
+po
+src
diff --git a/languages/ruby/app_templates/qtruby/.kdev_ignore b/languages/ruby/app_templates/qtruby/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/.kdev_ignore
diff --git a/languages/ruby/app_templates/qtruby/Makefile.am b/languages/ruby/app_templates/qtruby/Makefile.am
new file mode 100644
index 00000000..68b7bd82
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.rb app.kdevelop app-Makefile app.filelist README
+templateName = qtruby
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/qtruby/README b/languages/ruby/app_templates/qtruby/README
new file mode 100644
index 00000000..34e85c43
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/README
@@ -0,0 +1,29 @@
+QtRuby Hello World template quick start
+Author: Anne-Marie Mahfouf
+Date: 2006-12-05
+-----------------------------------------------
+
+This README file explains you some basic things for starting with
+this application template, a simple QtRuby Hello world template.
+-----------------------------------------------
+
+-- REQUIREMENTS --
+you need
+- Qt version might be 3.3.4 or 3.3.5.
+- kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template.
+- qtruby either from your distribution or from the kdebindings module or also from
+http://rubyforge.org/projects/korundum/.
+If you use the kdebindings module you need to build kdebindings/smoke/qt and then kdebindings/qtruby.
+
+-----------------------------------------------
+
+-- RUN --
+You will see that the Build menu in KDevelop is now adapted to Ruby.
+In the Build menu, choose Run or use Shift + F9 to see your project running.
+
+-----------------------------------------------
+
+-- RELEVANT LINK --
+http://developer.kde.org/language-bindings/ruby/index.html
+
+In KDevelop Documentation, you can find a Ruby tutorial. \ No newline at end of file
diff --git a/languages/ruby/app_templates/qtruby/app-Makefile b/languages/ruby/app_templates/qtruby/app-Makefile
new file mode 100644
index 00000000..13da2847
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/app-Makefile
@@ -0,0 +1,7 @@
+uis := $(wildcard *.ui)
+
+all: $(uis)
+ @for name in $^; do rbuic $$name > `echo $$name | awk -F '\\\.ui$' '{ print $$1 }' 2> /dev/null`.rb; echo "Running rbuic on $$name"; done
+
+clean: $(uis)
+ @for name in $^; do rm -f `echo $$name | awk -F '\\\.ui$' '{ print $$1 }' 2> /dev/null`.rb; done
diff --git a/languages/ruby/app_templates/qtruby/app.filelist b/languages/ruby/app_templates/qtruby/app.filelist
new file mode 100644
index 00000000..202beb22
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/app.filelist
@@ -0,0 +1,2 @@
+# KDevelop Custom Project File List
+%{APPNAMELC}.rb
diff --git a/languages/ruby/app_templates/qtruby/app.kdevelop b/languages/ruby/app_templates/qtruby/app.kdevelop
new file mode 100644
index 00000000..ec464627
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/app.kdevelop
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Qt</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevcustomproject>
+ <general>
+ <activedir/>
+ </general>
+ </kdevcustomproject>
+ <kdevfileview>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>CVS,.svn</hidepatterns>
+ </tree>
+ <groups>
+ <group pattern="*.rb" name="Ruby files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwindows_bugs</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ <type ext="ui"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <mainprogram>./%{APPNAMELC}.rb</mainprogram>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/qtruby/app.rb b/languages/ruby/app_templates/qtruby/app.rb
new file mode 100755
index 00000000..da817328
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/app.rb
@@ -0,0 +1,12 @@
+#!/usr/bin/env ruby
+
+require 'Qt'
+
+app = Qt::Application.new(ARGV)
+widget = Qt::Widget.new
+widget.setGeometry(50, 500, 400, 400)
+widget.caption = "Hello World!"
+
+app.mainWidget = widget
+widget.show
+app.exec
diff --git a/languages/ruby/app_templates/qtruby/qtruby.kdevtemplate b/languages/ruby/app_templates/qtruby/qtruby.kdevtemplate
new file mode 100644
index 00000000..6e7328ac
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/qtruby.kdevtemplate
@@ -0,0 +1,114 @@
+# KDE Config File
+[General]
+Name=QtRuby Hello World
+Name[ca]=Hello World en QtRuby
+Name[da]=QtRuby Goddag verden
+Name[de]=QtRuby-"Hello World"-Programm
+Name[el]=Γεια σου κόσμε QtRuby
+Name[es]=«Hola mundo» en QtRuby
+Name[et]=QtRuby "Tere, maailm"
+Name[eu]=QtRuby "Kaixo mundua" programa
+Name[fr]=« Bonjour monde » en QtRuby
+Name[gl]=Ola mundo en QtRuby
+Name[hu]=QtRuby-alapú Hello world program
+Name[it]="Hello World" con QtRuby
+Name[nds]=QtRuby-"Moin Welt"
+Name[ne]=QtRuby हेल्लो वोल्ड
+Name[pl]="Witaj świecie" w QtRuby
+Name[pt]=Olá Mundo em QtRuby
+Name[pt_BR]=Olá Mundo em QtRuby
+Name[ru]=Hello World на QtRuby
+Name[sk]=QtRuby Ahoj svet
+Name[sr]=„Здраво свете“ у QtRuby-ју
+Name[sr@Latn]=„Zdravo svete“ u QtRuby-ju
+Name[tr]=QtRuby Merhaba Dünya
+Category=Ruby/Qt
+Comment=This generates a simple QtRuby Hello World application
+Comment[ca]=Genera una simple aplicació de Hello World en QtRuby
+Comment[da]=Dette generere et simpelt QtRuby Goddag verden program
+Comment[de]=Erstellt eine einfache auf QtRuby basierende "Hello World"-Anwendung
+Comment[el]=Αυτό δημιουργεί μια απλή εφαρμογή Γεια σου κόσμε σε QtRuby
+Comment[es]=Genera una sencilla aplicación «Hola mundo» en QtRuby
+Comment[et]=Lihtsa QtRuby "Tere, maailm" rakenduse loomine
+Comment[eu]=Honek QtRuby "Kaixo mundua" aplikazio sinple bat sortzen du
+Comment[fa]=یک کاربرد سادۀ QtRuby Hello World تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en QtRuby
+Comment[gl]=Isto xera unha aplicación sinxela Ola mundo QtRuby
+Comment[hu]=Létrehoz egy egyszerű QtRuby-alapú Hello world programot
+Comment[it]=Genera una semplice applicazione di "Hello World" con QtRuby
+Comment[ja]=簡単な QtRuby Hello World アプリケーションを作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm mit QtRuby op.
+Comment[ne]=यसले साधारण QtRuby हेल्लो वोल्ड अनुप्रयोग उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een eenvoudige QtRuby Hello World-toepassing
+Comment[pl]=Generuje prosty program "Witaj świecie" w QtRuby
+Comment[pt]=Isto gera uma aplicação Olá Mundo simples em QtRuby
+Comment[pt_BR]=Isto gera uma aplicação Olá Mundo simples em QtRuby
+Comment[ru]=Создание простого приложения Hello World на QtRuby
+Comment[sk]=Vygeneruje jednoduchú QtRuby Ahoj svet aplikáciu
+Comment[sr]=Ово прави једноставан „Здраво свете“ у QtRuby-ју
+Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ u QtRuby-ju
+Comment[sv]=Detta skapar ett enkelt Hello World-program i QtRuby
+Comment[tr]=Bu basit bir QtRuby Merhaba Dünya uygulaması yaratır.
+Comment[zh_TW]=產生一個簡單的 QtRuby Hello World 應用程式
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.rb,%{dest}/README
+Icon=qtruby.png
+Archive=qtruby.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.rb
+Dest=%{dest}/%{APPNAMELC}.rb
+
+[FILE3]
+Type=install
+Source=%{src}/app-Makefile
+Dest=%{dest}/Makefile
+
+[FILE4]
+Type=install
+Source=%{src}/app.filelist
+Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist
+
+[FILE5]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/README
+
+[MSG]
+Type=message
+Comment=A simple QtRuby application was created in %{dest}
+Comment[ca]=Una simple aplicació en QtRuby ha estat creada en %{dest}
+Comment[da]=Et simpelt QtRuby program blev oprettet i %{dest}
+Comment[de]=Eine einfache QtRuby-Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια απλή εφαρμογή QtRuby δημιουργήθηκε στο %{dest}
+Comment[es]=Una sencilla aplicación en QtRuby ha sido creada en %{dest}
+Comment[et]=Lihtne KQtRuby rakendus loodi asukohta %{dest}
+Comment[eu]=QtRuby aplikazio sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد سادۀ QtRuby در %{dest} ایجاد شد
+Comment[fr]=Une application QtRuby simple a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár simplí QtRuby i %{dest}
+Comment[gl]=Creouse unha aplicación sinxela QtRuby en %{dest}
+Comment[hu]=Létrejött egy egyszerű QtRuby-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata una semplice applicazione QtRuby in %{dest}
+Comment[ja]=簡単な QtRuby アプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach QtRuby-Programm opstellt.
+Comment[ne]=साधारण QtRuby अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudige QtRuby-toepassing is aangemaakt in %{dest}
+Comment[pl]=Prosty program w QtRuby został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação simples de QtRuby em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação simples de QtRuby em %{dest}
+Comment[ru]=Простое приложение QtRuby создано в %{dest}
+Comment[sk]=Jednoduchá QtRuby aplikácia bola vytvorená v %{dest}
+Comment[sr]=Једноставан QtRuby програм направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan QtRuby program napravljen je u %{dest}
+Comment[sv]=Ett enkelt QtRuby-program skapades i %{dest}
+Comment[tr]=Basit bir QtRuby uygulaması %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 创建了一个简单的 QtRuby 应用程序
+Comment[zh_TW]=一個簡單的 QtRuby 應用程式框架已建立於 %{dest}
diff --git a/languages/ruby/app_templates/qtruby/qtruby.png b/languages/ruby/app_templates/qtruby/qtruby.png
new file mode 100644
index 00000000..63935461
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby/qtruby.png
Binary files differ
diff --git a/languages/ruby/app_templates/qtruby4app/Makefile.am b/languages/ruby/app_templates/qtruby4app/Makefile.am
new file mode 100644
index 00000000..2bdc1ef9
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/Makefile.am
@@ -0,0 +1,20 @@
+dataFiles = main.rb qtruby4app.rb qtruby4app.png qtruby4app.kdevelop \
+ application.qrc ReadMe filesave.xpm fileopen.xpm filenew.xpm \
+ editcopy.xpm editpaste.xpm editcut.xpm app-Makefile app.filelist
+
+templateName = qtruby4app
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
+
diff --git a/languages/ruby/app_templates/qtruby4app/ReadMe b/languages/ruby/app_templates/qtruby4app/ReadMe
new file mode 100644
index 00000000..da28297a
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/ReadMe
@@ -0,0 +1,6 @@
+READ THIS IN ORDER TO Run THE QtRuby4 APPLICATION
+-------------------------------------------------
+
+Click the 'Build Project' button to generate the qrc_application.rb
+file from the application.qrc resource with the rbrcc tool.
+
diff --git a/languages/ruby/app_templates/qtruby4app/app-Makefile b/languages/ruby/app_templates/qtruby4app/app-Makefile
new file mode 100644
index 00000000..3b3e7944
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/app-Makefile
@@ -0,0 +1,18 @@
+qrcs := $(wildcard *.qrc)
+uis := $(wildcard *.ui)
+
+all: gen_qrcs gen_uis
+
+gen_qrcs: $(qrcs)
+ @for name in $^; do rbrcc $$name > `echo $$name | awk -F '\\\.qrc$$' '{ printf("qrc_%s", $$1) }' 2> /dev/null`.rb; echo "Running rbrcc on $$name"; done
+
+gen_uis: $(uis)
+ @for name in $^; do rbuic4 $$name > `echo $$name | awk -F '\\\.ui$$' '{ print $$1 }' 2> /dev/null`.rb; echo "Running rbuic4 on $$name"; done
+
+clean: clean_qrcs clean_uis
+
+clean_qrcs: $(qrcs)
+ @for name in $^; do rm -f `echo $$name | awk -F '\\\.qrc$$' '{ printf("qrc_%s", $$1) }' 2> /dev/null`.rb; done
+
+clean_uis: $(uis)
+ @for name in $^; do rm -f `echo $$name | awk -F '\\\.ui$$' '{ print $$1 }' 2> /dev/null`.rb; done
diff --git a/languages/ruby/app_templates/qtruby4app/app.filelist b/languages/ruby/app_templates/qtruby4app/app.filelist
new file mode 100644
index 00000000..339e6998
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/app.filelist
@@ -0,0 +1,3 @@
+# KDevelop Custom Project File List
+main.rb
+%{APPNAMELC}.rb
diff --git a/languages/ruby/app_templates/qtruby4app/application.qrc b/languages/ruby/app_templates/qtruby4app/application.qrc
new file mode 100644
index 00000000..c35b0695
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/application.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>editcopy.xpm</file>
+ <file>editcut.xpm</file>
+ <file>filenew.xpm</file>
+ <file>fileopen.xpm</file>
+ <file>editpaste.xpm</file>
+ <file>filesave.xpm</file>
+</qresource>
+</RCC> \ No newline at end of file
diff --git a/languages/ruby/app_templates/qtruby4app/editcopy.xpm b/languages/ruby/app_templates/qtruby4app/editcopy.xpm
new file mode 100644
index 00000000..8350ed0e
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/editcopy.xpm
@@ -0,0 +1,193 @@
+/* XPM */
+static char *editcopy[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 155 2",
+" c black",
+". c #191000",
+"X c #221700",
+"o c #2E2300",
+"O c #452E00",
+"+ c #433200",
+"@ c #493000",
+"# c #553800",
+"$ c #5D4600",
+"% c #6B5000",
+"& c #724B00",
+"* c #7D5E00",
+"= c #6E694F",
+"- c #7E795F",
+"; c #865900",
+": c #8A5C00",
+"> c #8B6800",
+", c #936200",
+"< c #926D00",
+"1 c #926B1A",
+"2 c #967000",
+"3 c #9B721D",
+"4 c #9B7625",
+"5 c #9E792A",
+"6 c #A47C00",
+"7 c #AA7D00",
+"8 c #A1761A",
+"9 c #A57816",
+"0 c #A4791D",
+"q c #AD8200",
+"w c #B28500",
+"e c #AE8530",
+"r c #B99626",
+"t c #97906D",
+"y c #B18D48",
+"u c #B49049",
+"i c #B89542",
+"p c #BA9C4D",
+"a c #BD9E52",
+"s c #BFA053",
+"d c #B8AE78",
+"f c #BEB47E",
+"g c #C49300",
+"h c #C89600",
+"j c #C19D2C",
+"k c #C1A43F",
+"l c #C09E4E",
+"z c #CFB457",
+"x c #C9B159",
+"c c #CAB573",
+"v c #D4BF7C",
+"b c #FFDF62",
+"n c #FFE064",
+"m c #FFE16D",
+"M c #FFE372",
+"N c #FFE479",
+"B c #A19D8E",
+"V c #ABA89A",
+"C c #BEB580",
+"Z c #BDB488",
+"A c #B8B496",
+"S c #AEADAA",
+"D c #B3AFA1",
+"F c #BCBBB6",
+"G c #BFBFB9",
+"H c #C0B680",
+"J c #C4BA85",
+"K c #C6BD8B",
+"L c #CBB589",
+"P c #C8BE88",
+"I c #C3BC90",
+"U c #CBC18C",
+"Y c #CCC493",
+"T c #D7CB8C",
+"R c #DAC786",
+"E c #D8C789",
+"W c #DAC98B",
+"Q c #D0C690",
+"! c #D4CA94",
+"~ c #D4CC9B",
+"^ c #D8CE98",
+"/ c #DCD29C",
+"( c #C6C3B7",
+") c #C8C6BE",
+"_ c #D5C5A5",
+"` c #DBC8A1",
+"' c #DBD4A2",
+"] c #DED9AE",
+"[ c #D9D5B1",
+"{ c #E0CC82",
+"} c #E8D98B",
+"| c #E8D991",
+" . c #E1D7A1",
+".. c #E5DBA5",
+"X. c #E4DCAB",
+"o. c #E8DDAA",
+"O. c #E1DCB2",
+"+. c #E1DCB8",
+"@. c #FFE683",
+"#. c #FFE78A",
+"$. c #FFE885",
+"%. c #FFE88D",
+"&. c #FFE992",
+"*. c #FFEC9D",
+"=. c #FFF09F",
+"-. c #ECE2AC",
+";. c #E5E0B6",
+":. c #E5E1B8",
+">. c #EBE4B6",
+",. c #EAE5BC",
+"<. c #F0E5A8",
+"1. c #FFEDA3",
+"2. c #FFEDA9",
+"3. c #F1E8B8",
+"4. c #FFEFB1",
+"5. c #FFF1A5",
+"6. c #FFF2AD",
+"7. c #FFF2B4",
+"8. c #FFF2BC",
+"9. c #CAC8C2",
+"0. c #D6D4CB",
+"q. c #DFDAC5",
+"w. c #D4D2D0",
+"e. c #E0D7C5",
+"r. c #E4DAC3",
+"t. c #E8DEC7",
+"y. c #E0DFD3",
+"u. c #E6E2C2",
+"i. c #E8E1C5",
+"p. c #EBE3CB",
+"a. c #EEE9C2",
+"s. c #E8E6DC",
+"d. c #F3EDC3",
+"f. c #F2EDCB",
+"g. c #F7F2CD",
+"h. c #FFF3C3",
+"j. c #FFF4CA",
+"k. c #FFF8C5",
+"l. c #FFF8CD",
+"z. c #FDF5D2",
+"x. c #FFF7D8",
+"c. c #FFF9D4",
+"v. c #FFF9DC",
+"b. c #E9E8E7",
+"n. c #F3EFE3",
+"m. c #F2F0E3",
+"M. c #F4F2EA",
+"N. c #FBF7E6",
+"B. c #FEF9E3",
+"V. c #FFFBEC",
+"C. c #F4F4F3",
+"Z. c #F8F7F6",
+"A. c #FEFCF4",
+"S. c #FEFEFC",
+"D. c None",
+/* pixels */
+"D.D.D.D.D.D.D.D.D.D.D.D.h g g g g g g g g g g w * D.D.D.D.D.",
+"D.D.D.D.D.D.D.D.D.D.D.D.g z.z.g.g.g.g.g.g.z.g.R 2 D.D.D.D.D.",
+"D.D.D.D.D.D.D.D.D.D.D.D.g z.d.3.3.3.3.3.3.>.f.g.z < D.D.D.D.",
+"D.D.D.D.D., : ; , : : : 7 a i a R -.-.-.-.' m.u.g.j > D.D.D.",
+"D.D.D.D., u y y L L L L ` t.t.e.e v -.-.-.Y b.S.+.d.q D.D.D.",
+"D.D.D.D., S.S.S.S.S.S.S.S.Z.b.S.e.i W o.o.K w.S.A.u.q D.D.D.",
+"D.D.D.D., S.S.S.A.S.S.S.S.M.w.S.S._ a E ..K 0.S.S.q.7 D.D.D.",
+"D.D.D.D., S.A.V.A.A.A.V.A.n.9.S.S.C._ a ..Y t = - A 6 D.D.D.",
+"D.D.D.D., A.A.V.A.V.V.V.A.n.9.S.S.S.Z.3 ' ' K Z A ] 7 D.D.D.",
+"D.D.D.D., A.V.B.V.V.B.V.V.n.( F S S G 5 ' | / / X.f.q D.D.D.",
+"D.D.D.D., A.V.x.B.x.V.B.N.B.e.D B V ) 3 / / ^ ^ ' a.q D.D.D.",
+"D.D.D.D., V.N.N.B.B.B.v.v.N.z.p.i.p.n.8 ^ / ! Q ' a.q D.D.D.",
+"D.D.D.D., B.B.x.v.x.z.j.j.x.z.z.c.B.B.0 ! ! ! ^ ' ,.q D.D.D.",
+"D.D.D.D., B.h.h.z.z.x.x.z.z.z.h.j.x.v.0 ! Q Y ! ~ ,.q D.D.D.",
+"D.D.D.D., v.c.k.x.h.j.j.j.z.8.h.k.j.v.0 U T U U ~ ,.q D.D.D.",
+"D.D.D.D., v.k.z.h.h.h.j.8.j.h.h.j.k.v.0 U U U U Y ;.q D.D.D.",
+"D.D.D.D., x.h.8.8.h.j.8.8.4.h.4.8.h.x.8 P H P P ~ ;.q D.D.D.",
+"D.D.D.D., v.h.4.4.8.8.4.1.z.h.8.4.h.c.8 H J H J Y ;.q D.D.D.",
+"D.D.D.D., c.2.z.j.4.*.1.1.8.2.2.*.2.l.8 J J H J U ] q D.D.D.",
+"D.D.D.D., l.h.2.4.4.1.%.1.&.2.4.8.7.k.8 f d f H U ] q D.D.D.",
+"D.D.D.D., z.8.#.1.4.1.*.1.1.1.*.N 4.l.8 f f C K ~ :.q D.D.D.",
+"D.D.D.D., 8.&.4.#.%.4.&.@.#.%.%.&.2.l.8 K K Y ~ ] ,.6 D.D.D.",
+"D.D.D.D., h.&.#.*.1.1.%.N N #.&.*.1.l.0 ' ] T x r 6 % D.D.D.",
+"D.D.D.D., 4.4.%.*.#.b &.N M b M 2.1.k.9 k 7 > $ o D.D.D.",
+"D.D.D.D., 7.&.N 5.&.N @.*.b N M N =.k., + D.D.D.",
+"D.D.D.D., 6.N N M M &.#.N 2.$.%.8.6.<.& D.D.D.D.D.",
+"D.D.D.D., 5.&.7.n $.m M 1.7.7.o.c 5 & @ D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 7.*.m %.=.&.7.} p 1 % # X D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 6.5.5.5.| a 1 & + . D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D., 6.-.a 1 & O . D.D.D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D.; : % O . D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.",
+"D.D.D.D. D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D.D."
+};
diff --git a/languages/ruby/app_templates/qtruby4app/editcut.xpm b/languages/ruby/app_templates/qtruby4app/editcut.xpm
new file mode 100644
index 00000000..9a118931
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/editcut.xpm
@@ -0,0 +1,252 @@
+/* XPM */
+static char *editcut[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 214 2",
+" c #000000",
+". c #0B0B0B",
+"X c #181300",
+"o c #1D190B",
+"O c #131313",
+"+ c #1B1B1B",
+"@ c #211E11",
+"# c #26231A",
+"$ c #2A2513",
+"% c #2E2912",
+"& c #2E2A19",
+"* c #372E0B",
+"= c #302A12",
+"- c #312C1B",
+"; c #3A320F",
+": c #3C3415",
+"> c #3C351B",
+", c #232323",
+"< c #2B2922",
+"1 c #2C2C2C",
+"2 c #302E26",
+"3 c #353120",
+"4 c #3F3B2D",
+"5 c #313131",
+"6 c #3A3A3A",
+"7 c #423814",
+"8 c #493E17",
+"9 c #413D2F",
+"0 c #423F32",
+"q c #4F4319",
+"w c #5C4A00",
+"e c #5F4F0D",
+"r c #514410",
+"t c #554813",
+"y c #4E472C",
+"u c #444136",
+"i c #4A483F",
+"p c #534B2B",
+"a c #504B37",
+"s c #514C3A",
+"d c #654F04",
+"f c #604F0B",
+"g c #665200",
+"h c #675509",
+"j c #6B5405",
+"k c #6C5807",
+"l c #6C590B",
+"z c #745B04",
+"x c #715D0A",
+"c c #7B5B02",
+"v c #625B3B",
+"b c #7E6815",
+"n c #6C643E",
+"m c #4D4B42",
+"M c #494949",
+"N c #504D43",
+"B c #54534C",
+"V c #515151",
+"C c #5D5B54",
+"Z c #656048",
+"A c #736A44",
+"S c #726C54",
+"D c #77725B",
+"F c #696968",
+"G c gray50",
+"H c #826203",
+"J c #806609",
+"K c #836907",
+"L c #8D6A03",
+"P c #9A6F00",
+"I c #9B7005",
+"U c #9E730E",
+"Y c #9C7511",
+"T c #85732C",
+"R c #88783B",
+"E c #AE7C00",
+"W c #A87B13",
+"Q c #847B53",
+"! c #827D64",
+"~ c #9C862E",
+"^ c #A98A1F",
+"/ c #B28D0A",
+"( c #B88D00",
+") c #B2821A",
+"_ c #B18E1B",
+"` c #B3941C",
+"' c #A88E2C",
+"] c #A28C36",
+"[ c #AE9224",
+"{ c #89815E",
+"} c #87826D",
+"| c #858174",
+" . c #888370",
+".. c #8E8A7D",
+"X. c #928C71",
+"o. c #A28E44",
+"O. c #AA9F74",
+"+. c #B9A456",
+"@. c #BDA85B",
+"#. c #B2A068",
+"$. c #C28700",
+"%. c #CC8E00",
+"&. c #C29A00",
+"*. c #C4962F",
+"=. c #CCA100",
+"-. c #D6A800",
+";. c #D1AC1B",
+":. c #DDB31A",
+">. c #D2A922",
+",. c #D4AE2B",
+"<. c #DBA12E",
+"1. c #DBA433",
+"2. c #DDB428",
+"3. c #D2B23B",
+"4. c #E6A200",
+"5. c #E8A509",
+"6. c #EAAF00",
+"7. c #EFAC1E",
+"8. c #F5A100",
+"9. c #FFAD02",
+"0. c #FCAF0D",
+"q. c #FCB005",
+"w. c #FFB60C",
+"e. c #FFBD00",
+"r. c #FFBD16",
+"t. c #E3B432",
+"y. c #E8BF3C",
+"u. c #F6BE2F",
+"i. c #C6A949",
+"p. c #D9A948",
+"a. c #D8AB52",
+"s. c #DBBA45",
+"d. c #C5B162",
+"f. c #ECB74D",
+"g. c #EFB841",
+"h. c #EFBE4A",
+"j. c #EABA55",
+"k. c #FDC006",
+"l. c #FFC10B",
+"z. c #FFC800",
+"x. c #FFC90D",
+"c. c #FAC113",
+"v. c #FBC11C",
+"b. c #FDC910",
+"n. c #EDC233",
+"m. c #F5C32D",
+"M. c #FFC728",
+"N. c #F4C537",
+"B. c #F6C63A",
+"V. c #F5CB36",
+"C. c #FFD73D",
+"Z. c #E9C659",
+"A. c #EAC85A",
+"S. c #FFDA4B",
+"D. c #FFDD5D",
+"F. c #E9CD6B",
+"G. c #FFD560",
+"H. c #FFE06C",
+"J. c gray56",
+"K. c #959595",
+"L. c gray62",
+"P. c #A6A18A",
+"I. c #A8A69E",
+"U. c #AEA895",
+"Y. c #B3AC8F",
+"T. c #B8AF8B",
+"R. c #B4AD96",
+"E. c #B8B199",
+"W. c #A4A4A4",
+"Q. c #AAAAAA",
+"!. c #B0ADA3",
+"~. c #BBB6A3",
+"^. c #B1B1B1",
+"/. c #B9B9B6",
+"(. c #BBBBBA",
+"). c #C5BC9D",
+"_. c #C2BCA2",
+"`. c #C1BEB5",
+"'. c #D2C38E",
+"]. c #DCC78C",
+"[. c #C7C0A7",
+"{. c #C7C2AE",
+"}. c #C7C3B2",
+"|. c #C5C2B8",
+" X c #CAC6B6",
+".X c #CBC9BE",
+"XX c #D9D3BB",
+"oX c #E6D08A",
+"OX c #E7DEBD",
+"+X c #ECDEB3",
+"@X c #FFF0B9",
+"#X c #C5C5C5",
+"$X c #CECCC7",
+"%X c #D0CEC5",
+"&X c #D0CFC8",
+"*X c #D2D1CB",
+"=X c #DBD6C5",
+"-X c #DBD7C9",
+";X c #D3D3D1",
+":X c #DBDBDB",
+">X c #E5E1D6",
+",X c #E5E3DA",
+"<X c #E8E5D9",
+"1X c #EDEADC",
+"2X c #FEF6DE",
+"3X c #E6E6E6",
+"4X c #E9E7E2",
+"5X c #E9E8E4",
+"6X c #EDECEA",
+"7X c #F2F1EB",
+"8X c #F1F1F1",
+"9X c #F8F7F4",
+"0X c #F9F8F8",
+"qX c None",
+/* pixels */
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqX5 5 5 1 , qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 V /.&XQ.F 1 , qXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 _.D.S.H.@X&X6 . qXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 S.=.w g &.C...+ qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqX5 -.' + o t z.d., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX5 C V.@.+ 3 :.3., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX5 '.b.F.6 , 1 s.,., qXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqX1 b ( n.OXE.E.F.^ + qXqXqXqXqXqXqXqX5 5 1 , ",
+"qXqXqXqXqXqXqX l x K A.oXoXZ.i., qXqXqXqXqXqX5 V &X0X6X, ",
+"qXqXqXqXqXqXqX 8 ( c.v.k.N.1 qXqXqXqX5 V $X0X0X9XXX, ",
+"qXqXqXqXqXqXqXqX O t 6.e.e.k.S O 5 5 V $X8X8X8X1XD : O ",
+"qXqXqXqXqXqXqXqXqXqX 3 J e.G.7X#.+ . 5 C |.3X3X5X4X_.4 % ",
+"qXqXqXqXqXqXqXqXqXqX q ].0X0X+X, B }.:X:X:X:X=XS & o ",
+"qXqXqXqXqXqXqXqXqXqXqX + M 8X8X7XU.Q.#X*X*X*XR.< % qX",
+"qXqXqXqXqXqXqXqXqXqXqXqX, 1 X6XW.G Q.L.^.{.Z @ . qXqX",
+"qXqXqXqXqXqXqXqXqXqX5 5 m P.W.:X6 . 3X/.X., @ qXqXqXqX",
+"qXqXqXqXqXqXqX5 5 5 n +.R.W.J.K.W.^.:X:X1Xm + qXqXqXqXqX",
+"qXqXqXqXqX5 5 i o.y.v.q./ P.I.} | R.&X*X;X8X ., qXqXqXqXqXqX",
+"qXqX5 5 5 R 3.M.5.E L 7.4._ 0 + O + i ).#X#X5X~., O qXqXqXqX",
+"qX5 u ] m.r.%.H r : , t.0.P 7 $ , { `.(.;X-X, + qXqXqX",
+"5 u 2.w.$.k t o , ~ h.P l , u T.^.#X<XN , qXqX",
+"5 >.9.U r . . , T B.*.x qX + , Q !.Q.<XC , qX",
+"p q.1.> . + 1 [ m.p.k . qXqXqXqX , u O.W.;X! + ",
+"4 8.j.` p 5 y ;.u.a.d % qXqXqXqXqXqX O , A P._., ",
+"1 x <.f.m.x.b.y.a.g ; qXqXqXqXqXqXqXqX + 0 v O ",
+" - h c W W W W z : qXqXqXqXqXqXqXqXqXqX . . ",
+" * e l l f X qXqXqXqXqXqXqXqXqXqXqXqXqX ",
+"qX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX qX",
+"qXqXqX qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX",
+"qXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqXqX"
+};
diff --git a/languages/ruby/app_templates/qtruby4app/editpaste.xpm b/languages/ruby/app_templates/qtruby4app/editpaste.xpm
new file mode 100644
index 00000000..c29ad36b
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/editpaste.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *editpaste[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c black",
+". c #0D0900",
+"X c #191000",
+"o c #221700",
+"O c #2A1B00",
+"+ c #332200",
+"@ c #3E2900",
+"# c #3A2804",
+"$ c #4D3300",
+"% c #4B3E15",
+"& c #44391B",
+"* c #543800",
+"= c #5A3B00",
+"- c #4D4015",
+"; c #524E25",
+": c #5A4F2C",
+"> c #524E3D",
+", c #58562F",
+"< c #53503E",
+"1 c #5E623B",
+"2 c #634100",
+"3 c #684500",
+"4 c #6E4900",
+"5 c #614F11",
+"6 c #685416",
+"7 c #734C00",
+"8 c #784F00",
+"9 c #755B00",
+"0 c #7C5200",
+"q c #7C5A00",
+"w c #7B570F",
+"e c #69562F",
+"r c #786600",
+"t c #7F6A00",
+"y c #766300",
+"u c #60613F",
+"i c #7C6422",
+"p c #545143",
+"a c #54524B",
+"s c gray32",
+"d c #5D5D57",
+"f c #616641",
+"g c #67695D",
+"h c #6B734D",
+"j c #6C7553",
+"k c #616261",
+"l c #686A64",
+"z c #6B7162",
+"x c #727272",
+"c c #003DFF",
+"v c #0043FF",
+"b c #004BFF",
+"n c #0053FF",
+"m c #015AFF",
+"M c #0063FF",
+"N c #046DFF",
+"B c #0865FF",
+"V c #0378FF",
+"C c #1663FF",
+"Z c #1576FF",
+"A c #2678FF",
+"S c #6F7B84",
+"D c #77856D",
+"F c #7B8B75",
+"G c #0083FF",
+"H c #0197FF",
+"J c #0B92FF",
+"K c #1385FF",
+"L c #01A5FF",
+"P c #0DB5FF",
+"I c #3096FF",
+"U c #2DADFF",
+"Y c #2FBCFF",
+"T c #22C6FF",
+"R c #2AC5FF",
+"E c #30D0FF",
+"W c #38D5FF",
+"Q c #4493F1",
+"! c #5F83FF",
+"~ c #5F8AFF",
+"^ c #5290E4",
+"/ c #5F92FF",
+"( c #4CAAFE",
+") c #40B8FF",
+"_ c #779DCB",
+"` c #6693E2",
+"' c #6290FF",
+"] c #649DFF",
+"[ c #71A6E5",
+"{ c #79A4FF",
+"} c #7FB3FF",
+"| c #68B8F3",
+" . c #42DCFF",
+".. c #47E0FF",
+"X. c #58E9FF",
+"o. c #64C0EB",
+"O. c #6ADFEF",
+"+. c #825600",
+"@. c #845A00",
+"#. c #8B5C00",
+"$. c #905F00",
+"%. c #8C6103",
+"&. c #876807",
+"*. c #8A6111",
+"=. c #886E1B",
+"-. c #887600",
+";. c #8C7A00",
+":. c #936200",
+">. c #986800",
+",. c #926C22",
+"<. c #987A3F",
+"1. c #A07200",
+"2. c #A27511",
+"3. c #A97D15",
+"4. c #A77B14",
+"5. c #998712",
+"6. c #A68000",
+"7. c #A78F00",
+"8. c #AD8016",
+"9. c #AC9600",
+"0. c #BB8F00",
+"q. c #A99B2A",
+"w. c #B9A000",
+"e. c #B3A63C",
+"r. c #958D43",
+"t. c #988F44",
+"y. c #9A9346",
+"u. c #9F9948",
+"i. c #8B897C",
+"p. c #958F6F",
+"a. c #98937B",
+"s. c #A68443",
+"d. c #B08C41",
+"f. c #AF9462",
+"g. c #B39864",
+"h. c #B2A850",
+"j. c #BDB355",
+"k. c #C3972F",
+"l. c #C5A400",
+"z. c #CCAC00",
+"x. c #D7BB00",
+"c. c #CCA030",
+"v. c #CBB43E",
+"b. c #E4AD0C",
+"n. c #ECB600",
+"m. c #EDB900",
+"M. c #F2BB00",
+"N. c #C1B84C",
+"B. c #C1B757",
+"V. c #C5BB58",
+"C. c #C9BE5A",
+"Z. c #C2A978",
+"A. c #DFC000",
+"S. c #FDCB00",
+"D. c #F6C300",
+"F. c #FFD100",
+"G. c #FEDB00",
+"H. c #FFDF0E",
+"J. c #F5D500",
+"K. c #FBCD39",
+"L. c #FFE832",
+"P. c #FFE432",
+"I. c #CEC25C",
+"U. c #D7C648",
+"Y. c #DDC74B",
+"T. c #D0C55E",
+"R. c #D3C85F",
+"E. c #D5C960",
+"W. c #DDD264",
+"Q. c #E0CA4C",
+"!. c #E7D14E",
+"~. c #EFDA51",
+"^. c #F4D050",
+"/. c #F9D452",
+"(. c #FEDD53",
+"). c #E2D765",
+"_. c #E9DD69",
+"`. c #E6DD68",
+"'. c #FDDB6E",
+"]. c #FFEE4F",
+"[. c #FEE354",
+"{. c #FEEA55",
+"}. c #F7E153",
+"|. c #FFF056",
+" X c #ECE16A",
+".X c #F1E56D",
+"XX c #F7EA6F",
+"oX c #F7EB70",
+"OX c #F9EC70",
+"+X c #FEF372",
+"@X c #979486",
+"#X c gray60",
+"$X c #969596",
+"%X c #8AA193",
+"&X c #82A89B",
+"*X c #8CAEA3",
+"=X c #86A7A9",
+"-X c #8BA2B1",
+";X c #ACA580",
+":X c #A5A291",
+">X c #B3AF98",
+",X c #B8B7AF",
+"<X c #B3B2AB",
+"1X c #B1B1B1",
+"2X c #A6B8FF",
+"3X c #88DEE0",
+"4X c #8BF0FE",
+"5X c #A4CFC6",
+"6X c #BFD5FF",
+"7X c #BFDCFF",
+"8X c #C2AD82",
+"9X c #CBB489",
+"0X c #D2BF9B",
+"qX c #D1C19F",
+"wX c #C8C4AA",
+"eX c #CFCBB7",
+"rX c #D8C7A6",
+"tX c #D2C2A3",
+"yX c #D5CCB3",
+"uX c #DAD1A1",
+"iX c #DDD5BB",
+"pX c #D7D1B3",
+"aX c #ECE5BB",
+"sX c #F5EBB5",
+"dX c #F5ECBC",
+"fX c #F8EEB8",
+"gX c #FCF2BC",
+"hX c #CBCBCB",
+"jX c #D8D6C7",
+"kX c #DDDDDD",
+"lX c #E4DAC2",
+"zX c #ECE6C7",
+"xX c #EBE6D9",
+"cX c #E9E3D0",
+"vX c #F5EDC4",
+"bX c #F6EFC9",
+"nX c #F0EBD5",
+"mX c #F3EFDB",
+"MX c #FCF3C5",
+"NX c #FCF4CA",
+"BX c #F7F0CA",
+"VX c #F6F0D2",
+"CX c #F9F3D3",
+"ZX c #F9F4DC",
+"AX c #FFF8D4",
+"SX c #FFF9DB",
+"DX c #E7E7E4",
+"FX c #EBEBE9",
+"GX c #F1EDE1",
+"HX c #F9F6E5",
+"JX c #FDF9E4",
+"KX c #FEFBEB",
+"LX c #F6F2E6",
+"PX c #FEFCF3",
+"IX c #FEFDFD",
+"UX c #F4F4F3",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYXYX:.:.+ IXIXIXIXIXIXIXIXFX# +.7 YXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX>.k.c.6 FXkXkXkXDXkXkXkXx i b.>.+ YXYXYXYXYXYXYXYXYXYX",
+"YXYXYX:.'.K.=.hX1X1X1X1X1X1X1Xd &.0.%.* 7 #.#.:.$.#.2 YXYXYX",
+"YXYXYX:./.M.%.$Xk k d s s s e w >.2.d.s.Z.9XrXlXxX0X7 YXYXYX",
+"YXYXYX:.^.M.1.: % % - % 5 6 &.GXIXIXPXPXPXPXPXLXIXIXg.3 YXYX",
+"YXYX#X:.^.m.v.y.r.r.r.r.h.h.2.IXPXPXKXKXPXKXHXxXUXIXIXf.4 YX",
+"YXYX#X:.^.m.Y.I.B.j.j.j.V.I.4.PXKXJXKXJXKXKXmXjXFXIXIXUX+. YX",
+"YXYX#X:.^.m.Y.E.I.j.j.j.I.R.8.PXKXSXJXJXJXSXnXeXDXIXIXUX<. YX",
+"YXYXYX:./.M.!.W.R.I.T.R.E.W.8.UXJXJXSXSXSXSXnXeX:X@Xi.<X7 ",
+"YXYXYX:./.D.~._.`.W.W.W.W. X8.PXJXSXAXSXSXSXVXjX>X@X@X,X4 ",
+"YXYXYX:.(.S.}..X X X X X X X8.PXSXAXAXAXAXAXNXzXpXwXwXjX7 ",
+"YXYXYX:.(.S.[.OXOXOXoXoXt.; O s a p p p p a.AXMXvXaXzXGX+. ",
+"YXYXYX:.(.S.[.+X+X+XOX+X; 7X2X] / / ~ ! 2Xp MXNXNXNXSXKX+. YX",
+"YXYXYX:.(.F.|.+X+X+X+X+Xy., _ A m b v c ! p MXMXgXMXAXKX+. YX",
+"YXYXYX:.(.F.|.+X+X+X+X+X+Xj.& ^ B n b v ' < gXMXgXgXNXKX+. YX",
+"YXYXYX:.(.F.U.W.+X+X+X+X).y.g Q N m n b ~ < gXgXgXgXAXJXq YX",
+"YXYXYX:.[.l.j j y.I.j.r.1 =X( K N M m b ~ < gXgXgXgXNXKX+. YX",
+"YXYXYX:.[.t 5X4X&XD F =X| U J G V Z A C / < fXgXgXgXMXHX+. YX",
+"YXYXYX:.[.l.h 3XX...W T P L H K I [ S ` { < fXfXfXfXMXKX+. YX",
+"YXYXYX:.[.G.e.1 *XO...E R Y Y | -Xd Z.k 6X> fXfXfXfXBXJX+. YX",
+"YXYXYX:.[.G.{.`.u.1 F &X*X%Xz l a.uXfXp.> p.sXsXsXfXBXJX+. YX",
+"YXYXYX:.{.G.|.+X+X XN.q.5.7.q cXvXsXsXsXsXsXsXsXsXsXBXKX+. YX",
+"YXYXYX:.|.G.].|.L.H.G.G.G.A.1.JXvXsXsXsXsXsXsXsXfXdXCXPX+. YX",
+"YXYXYX:.{.G.G.G.G.G.x.w.;.t :.HXdXsXsXsXsXsXdXvXBXZXLXtX= YX",
+"YXYXYX:.{.G.J.x.9.;.r 9 q 0 #.KXvXsXaXsXvXBXCXHXiXg.*.= O YX",
+"YXYXYX:.L.9.-.y 9 q 0 = + #.HXbXdXbXVXZXcX8X,.3 $ . YX",
+"YXYXYX%.z.9 q 7 * o $.PXZXmXmX0Xs.0 $ X YX",
+"YXYXYX8 0 = o :.IXpXg.*.= O YXYXYXYX",
+"YXYXYX YXYX@.#.2 @ . YXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYX YXYXYXYXYXYXYXYXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/ruby/app_templates/qtruby4app/filenew.xpm b/languages/ruby/app_templates/qtruby4app/filenew.xpm
new file mode 100644
index 00000000..85efceb2
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/filenew.xpm
@@ -0,0 +1,216 @@
+/* XPM */
+static char *filenew[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 178 2",
+" c black",
+". c #191000",
+"X c #221700",
+"o c #452E00",
+"O c #4A3100",
+"+ c #4E3400",
+"@ c #553800",
+"# c #604000",
+"$ c #6A4600",
+"% c #6D4800",
+"& c #704A00",
+"* c #724C00",
+"= c #744C00",
+"- c #764E00",
+"; c #785000",
+": c #805500",
+"> c #815500",
+", c #835700",
+"< c #865900",
+"1 c #875A00",
+"2 c #8A5B00",
+"3 c #8A5C00",
+"4 c #8B5C00",
+"5 c #8C5D00",
+"6 c #8D5D00",
+"7 c #8F5E00",
+"8 c #805911",
+"9 c #905F00",
+"0 c #906000",
+"q c #926000",
+"w c #946200",
+"e c #956300",
+"r c #966400",
+"t c #976400",
+"y c #956913",
+"u c #926C22",
+"i c #9B7732",
+"p c #B18D48",
+"a c #B28E49",
+"s c #B4904A",
+"d c #BAA373",
+"f c #A1A195",
+"g c #ABAB9F",
+"h c #ADADAB",
+"j c #AFAFAB",
+"k c #B3B3A6",
+"l c #BCBCB8",
+"z c #BFBFBC",
+"x c #CBB489",
+"c c #CBB58A",
+"v c #CDB78B",
+"b c #CAB891",
+"n c #C9BB9E",
+"m c #CEBEA2",
+"M c #C6C6BC",
+"N c #D9C8A8",
+"B c #E8E1BA",
+"V c #E8E1BB",
+"C c #FEFFA1",
+"Z c #FFFFA0",
+"A c #FEFFA3",
+"S c #FEFFA4",
+"D c #FEFFA6",
+"F c #FEFFA8",
+"G c #FEFFA9",
+"H c #FFFFA8",
+"J c #FEFFAA",
+"K c #FEFFAB",
+"L c #FFFFAB",
+"P c #FEFFAC",
+"I c #FFFFAC",
+"U c #FEFFAE",
+"Y c #FEFFAF",
+"T c #FEFFB0",
+"R c #FEFFB1",
+"E c #FFFFB0",
+"W c #FEFFB4",
+"Q c #FEFFB5",
+"! c #FFFFB4",
+"~ c #FEFFB8",
+"^ c #FEFFB9",
+"/ c #FFFFB8",
+"( c #FFFFB9",
+") c #FEFFBB",
+"_ c #FFFFBA",
+"` c #FEFFBD",
+"' c #FFFFBD",
+"] c #FEFFBE",
+"[ c #FFFFBE",
+"{ c #C8C8C1",
+"} c #CACAC4",
+"| c #CBCBC6",
+" . c #DBD2C1",
+".. c #DEDFCF",
+"X. c #D4D4D1",
+"o. c #E1D5C1",
+"O. c #E3D9C3",
+"+. c #E5DCCC",
+"@. c #E8E8D3",
+"#. c #ECECD7",
+"$. c #F0EBDA",
+"%. c #FEFFC2",
+"&. c #FEFFC3",
+"*. c #FFFFC2",
+"=. c #FEFFC7",
+"-. c #FFFFC7",
+";. c #FEFFCB",
+":. c #FEFFCC",
+">. c #FFFFCC",
+",. c #FEFFCE",
+"<. c #FEFFD0",
+"1. c #FEFFD1",
+"2. c #FFFFD0",
+"3. c #FFFFD1",
+"4. c #FFFFD3",
+"5. c #FEFFD5",
+"6. c #FFFFD5",
+"7. c #FEFFD6",
+"8. c #FEFFD7",
+"9. c #FFFFD6",
+"0. c #FFFFD8",
+"q. c #FEFFDA",
+"w. c #FFFFDA",
+"e. c #FFFFDB",
+"r. c #FFFFDC",
+"t. c #FEFFDE",
+"y. c #FEFFDF",
+"u. c #FFFFDE",
+"i. c #FFFFDF",
+"p. c #E9E9E7",
+"a. c #F3F3E9",
+"s. c #F3F3EB",
+"d. c #F5F5E8",
+"f. c #F8F8E3",
+"g. c #FEFFE0",
+"h. c LightYellow",
+"j. c #FFFFE1",
+"k. c #FEFFE3",
+"l. c #FFFFE3",
+"z. c #FDFEE7",
+"x. c #FEFFE4",
+"c. c #FEFFE5",
+"v. c #FFFFE4",
+"b. c #FBFBE9",
+"n. c #FEFFE8",
+"m. c #FFFFE8",
+"M. c #FFFFE9",
+"N. c #FFFFEA",
+"B. c #FEFFEC",
+"V. c #FEFFED",
+"C. c #FFFFEC",
+"Z. c #FFFFED",
+"A. c #FEFFEF",
+"S. c #F4F4F0",
+"D. c #F4F4F3",
+"F. c #F5F5F4",
+"G. c #F8F8F6",
+"H. c ivory",
+"J. c #FFFFF1",
+"K. c #FEFFF3",
+"L. c #FFFFF3",
+"P. c #FEFFF4",
+"I. c #FFFFF4",
+"U. c #FEFFF7",
+"Y. c #FFFFF6",
+"T. c #FFFFF7",
+"R. c #FBFBFB",
+"E. c #FFFFF8",
+"W. c #FFFFF9",
+"Q. c #FFFFFA",
+"!. c #FFFFFB",
+"~. c gray99",
+"^. c #FEFFFD",
+"/. c #FFFFFC",
+"(. c #FFFFFD",
+"). c #FFFFFE",
+"_. c gray100",
+"`. c None",
+/* pixels */
+"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.`.w 2 1 w 4 4 4 6 w 9 6 - `.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.r s p p c c c c N O.+.o.y # `.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.r ).).).).).).).).F.p.). .& o `.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w ).E.).E.).E.E.E.S.X.).R.n $ + `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w E.Y.Y.E.Y.E.E.E.a.| ).).D.m % `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w E.Y.Y.J.Y.J.Y.Y.a.| ).).).D.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.J.J.J.J.J.J.J.a.M l h h { ; `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.B.B.B.N.N.B.B.b...k f h } ; `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.N.N.N.N.N.N.N.l.f.#.@.#.a.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.l.l.l.l.l.l.l.l.l.l.l.l.J.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w J.r.l.l.r.l.r.l.r.l.r.l.r.J.1 `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w B.r.r.q.q.q.q.q.q.r.q.q.r.B.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w N.5.5.5.5.q.5.5.5.5.5.5.5.B., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w N.<.<.<.<.<.<.<.5.<.<.<.<.N., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.,.;.;.;.,.;.,.;.,.;.;.;.l., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.-.-.-.-.-.-.;.-.-.-.-.;.l.> `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w l.-.%.%.%.%.%.%.%.%.%.%.%.l., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w r.' ' ' ' ' ) ' ' ' ' ' ' r., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w r.) ) W ) ) ) ) ) ) W ) ) q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w q.W W W W W W W W W W W W q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.Y Y W Y Y Y Y Y Y Y Y Y 5., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.J J J Y J Y Y J Y J J Y q., `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w 5.J J D J J D J D J W ) ,.$.- `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w <.Z D D Z D J Y ' ,.B b i - O `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w <.Z Z Z Y ) <.B d u & @ X `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w ,.J ) ,.B d y & o . `.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.w Y.V d u & o . `.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`.1 4 & o . `.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.",
+"`.`.`.`.`.`.`.`. `.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`.`."
+};
diff --git a/languages/ruby/app_templates/qtruby4app/fileopen.xpm b/languages/ruby/app_templates/qtruby4app/fileopen.xpm
new file mode 100644
index 00000000..a6c33b62
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/fileopen.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *fileopen[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c black",
+". c #0B0900",
+"X c #130E00",
+"o c #161100",
+"O c #231A00",
+"+ c #352600",
+"@ c #3B311C",
+"# c #433100",
+"$ c #4F3B00",
+"% c #4A3E16",
+"& c #4A3D22",
+"* c #4D421A",
+"= c #54420D",
+"- c #4E4529",
+"; c #484338",
+": c #484233",
+"> c #5B4B24",
+", c #624500",
+"< c #674D00",
+"1 c #6D4D00",
+"2 c #6E4F17",
+"3 c #6D5200",
+"4 c #775500",
+"5 c #745B0F",
+"6 c #795200",
+"7 c #7A5A00",
+"8 c #715C18",
+"9 c #764B0A",
+"0 c #6C5423",
+"q c #6D592E",
+"w c #785E27",
+"e c #735626",
+"r c #665736",
+"t c #7A631D",
+"y c #7A672E",
+"u c #776535",
+"i c #5C5956",
+"p c #78704F",
+"a c #75726E",
+"s c #8D4F00",
+"d c #815700",
+"f c #835A00",
+"g c #8A5C00",
+"h c #866400",
+"j c #966100",
+"k c #956F00",
+"l c #9C6100",
+"z c #9D7500",
+"x c #856B2A",
+"c c #8C752A",
+"v c #8C723B",
+"b c #977939",
+"n c #A45D00",
+"m c #A26100",
+"M c #AA680D",
+"N c #AB6700",
+"B c #A07700",
+"V c #A57B00",
+"C c #AB7A00",
+"Z c #AA7300",
+"A c #AF721A",
+"S c #B87E00",
+"D c #B57B00",
+"F c #B0731A",
+"G c #B47C26",
+"H c #B77E28",
+"J c #897F59",
+"K c #977C40",
+"L c #927F58",
+"P c #807A6C",
+"I c #9C821D",
+"U c #9F8A35",
+"Y c #AC8000",
+"T c #B28500",
+"R c #B68800",
+"E c #BB8B00",
+"W c #A78337",
+"Q c #A28B31",
+"! c #AF9535",
+"~ c #B58E3A",
+"^ c #B88633",
+"/ c #B49936",
+"( c #BCA039",
+") c #998445",
+"_ c #978657",
+"` c #8B8264",
+"' c #8E8572",
+"] c #978864",
+"[ c #978C75",
+"{ c #9F9072",
+"} c #A38845",
+"| c #A48952",
+" . c #AA965C",
+".. c #A89156",
+"X. c #B5934D",
+"o. c #B39D45",
+"O. c #B49755",
+"+. c #AB984A",
+"@. c #AD9A65",
+"#. c #A79778",
+"$. c #A59874",
+"%. c #A29B7A",
+"&. c #A79775",
+"*. c #BDA959",
+"=. c #B3A46C",
+"-. c #B1A07F",
+";. c #B5A97A",
+":. c #BEB37B",
+">. c #C49200",
+",. c #C89500",
+"<. c #CC9800",
+"1. c #C69812",
+"2. c #D2A31C",
+"3. c #C2A63E",
+"4. c #D7AE37",
+"5. c #C29840",
+"6. c #C29B4E",
+"7. c #C2A641",
+"8. c #C6AA43",
+"9. c #C8AC45",
+"0. c #CBAF49",
+"q. c #CAA746",
+"w. c #C4A158",
+"e. c #CAA65D",
+"r. c #CEA857",
+"t. c #CFA95A",
+"y. c #C5AC50",
+"u. c #CDB14B",
+"i. c #CBB358",
+"p. c #CAB152",
+"a. c #D2AB59",
+"s. c #D1B54D",
+"d. c #D4B951",
+"f. c #D6BC5B",
+"g. c #DDB45E",
+"h. c #D9BD56",
+"j. c #D2B753",
+"k. c #DAAB48",
+"l. c #CEAE69",
+"z. c #CCAD67",
+"x. c #CCB662",
+"c. c #CAB26B",
+"v. c #C8B66B",
+"b. c #CEB775",
+"n. c #CEBE7F",
+"m. c #D3AD66",
+"M. c #D5BE64",
+"N. c #D4BF6D",
+"B. c #E4B34B",
+"V. c #E0B75F",
+"C. c #E1B85F",
+"Z. c #E4BA61",
+"A. c #E9BE63",
+"S. c #DDC159",
+"D. c #DAC269",
+"F. c #D4C176",
+"G. c #D8C67F",
+"H. c #E1C55D",
+"J. c #EFC05D",
+"K. c #F1C15E",
+"L. c #E0C264",
+"P. c #E5C961",
+"I. c #EDC164",
+"U. c #E9CD65",
+"Y. c #EFD36B",
+"T. c #F2C564",
+"R. c #F6C868",
+"E. c #F8C760",
+"W. c #FBCC6A",
+"Q. c #FDCB63",
+"!. c #F1D56D",
+"~. c #FFD06C",
+"^. c #F5D972",
+"/. c #FED175",
+"(. c #FADE77",
+"). c #E4C87A",
+"_. c #FEE27C",
+"`. c #8F9192",
+"'. c #9A9A96",
+"]. c #A79F83",
+"[. c #ADA583",
+"{. c #A7A399",
+"}. c #BBAC86",
+"|. c #BDB088",
+" X c #BBB298",
+".X c #A7A8A6",
+"XX c #ADAEB0",
+"oX c #B5B6B4",
+"OX c #BABCBC",
+"+X c #C6B38E",
+"@X c #D3BE80",
+"#X c #D0BC95",
+"$X c #C6BFA6",
+"%X c #C5C29D",
+"&X c #D2C283",
+"*X c #DAC789",
+"=X c #DBCA8B",
+"-X c #D5C489",
+";X c #DBCD94",
+":X c #D6C699",
+">X c #CFC8B1",
+",X c #C8C6B7",
+"<X c #D1C9A6",
+"1X c #DBD3BA",
+"2X c #E1C981",
+"3X c #E0CD91",
+"4X c #ECD686",
+"5X c #EBD69E",
+"6X c #FED682",
+"7X c #FED88B",
+"8X c #FEDC95",
+"9X c #E3CEA3",
+"0X c #EED9A9",
+"qX c #E7DCB9",
+"wX c #F4DDAF",
+"eX c #FFE68A",
+"rX c #FFE893",
+"tX c #FFEA9F",
+"yX c #FFE2A5",
+"uX c #FFE3AC",
+"iX c #FFECA7",
+"pX c #FFEDAE",
+"aX c #F1E0B6",
+"sX c #FDE5B4",
+"dX c #FFEEB4",
+"fX c #F8E5BB",
+"gX c #FFF0BC",
+"hX c #C5C7C8",
+"jX c #C7C8CA",
+"kX c #CCCECF",
+"lX c #CCCAC0",
+"zX c #CDCED0",
+"xX c #D1D1CF",
+"cX c #D1D3D4",
+"vX c #D6D8DA",
+"bX c #DADCDE",
+"nX c #DCDEE0",
+"mX c #DEE0E2",
+"MX c #E7DEC2",
+"NX c #EBE1C5",
+"BX c #F4E9C3",
+"VX c #F7EACE",
+"CX c #FEEAC3",
+"ZX c #FAEBCA",
+"AX c #FFF1C1",
+"SX c #FFF3CC",
+"DX c #FFF6DA",
+"FX c #E1E3E5",
+"GX c #E4E6E8",
+"HX c #E7E9EA",
+"JX c #E8E6E0",
+"KX c #E9EAEC",
+"LX c #ECEEF0",
+"PX c #EEF0F2",
+"IX c #F8F4E8",
+"UX c #F1F3F5",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX V E <.,.T YXYXYXYXYXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX< E 2.aXCXVXE 3 E <.E YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX R ,.5XCX8XQ.wX<.1.$.OX<. YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYX R >.L.ZXyXT.K.E.wX ..XKXKXR YXYX",
+"YXYXYXYXYXYXYXYXYXYXYXYX V E 4.ZXsXW.K.I.Z.O.{.KXUXUXMXk YXYX",
+"YXYXYXYXYXYX R E 7 YX< E 2.aXsX6XC.T.Z.w.[ xXUXUXUXUX2X3 YXYX",
+"YXYXYXYX R >.).5X,.T ,.5XCX8XK.T.A.a.] OXUXUXUXUXUXUX2.O YXYX",
+"YXYX Y E Z.ZXsX7XsX0XCXyXR.K.I.V._ .XUXUXUXUXUXLXKXJXV D N S 7 ",
+" z E 4.fXsX/.K.~./.6X~.I.I.C...'.KXUXPXPXPXLXKXGXbXl.N m.SXm.D ",
+" E 0XgX7XE.W.W.~.~.R.I.Z.w.' bXUXUXUXPXPXLXmXbX$X) ~ aXSXpXBXn ",
+" <.CXT.Q.~.W.W.R.I.A.t._ hXUXUXUXUXPXLXGXnX,X .t XAXSXeX4Xl.Z ",
+" <.sXB.W.W.W.T.A.g._ oXUXUXUXUXUXLXLXmXcX=.5 $.BXgXeX!.D.3Xm + ",
+" <.sXB.R.R.A.V.| {.KXUXUXUXUXLXKXGXvX|.c u qXdXgX^.U.f.3XH f ",
+" <.sXB.T.Z.m.[ nXUXUXUXUXPXKXHXbX,X) e <XdXiX_.S.u.P.F.t.h ",
+" <.sXk.Z.r.K jXUXUXUXPXLXKXmXcX@.5 %.DXiX_.Y.S.d.h.D.*Xl X ",
+" <.wXq.r.X.r UXUXPXPXKXmXvX|.y _ NXdXrX!.S.d.h.d.f.=XF 4 YX",
+" ,.0X5.X.) a PXPXKXGXnX>X) y >XAXAX_.S.h.h.u.s.d.F.6.g YX",
+" >.9X~ } u '.LXKXmXxX .5 [.IXAX_.!.S.h.h.d.8.s.D.n.j YXYX",
+" >.:XW v & kXmXvX;.t ] BXAXrX!.U.u.S.9.u.3.7.i.;XM 1 YXYXYX",
+" E #Xb u : nXcX_ u 1XSXgX^.U.H.S.d.8.s.d.u.b.-XG g YXYXYXYX",
+" R +Xc r a zX[.= -XdX_.U.d.P.h.d.u.3.8.N.=Xw.l 1 YXYXYXYX",
+" T }.x > `.oX> %.*.S.S.h.S.7.d.h.0.p.n.c.M d . YXYXYXYXYX",
+" C ].w @ XXu p *.( h.S.s.u.u.u.p.N.*X^ g + YXYXYXYXYXYX",
+" Z &.e ; ` * :.o.S.S.S.u.( 9.x.&XX.j , YXYXYXYXYXYX",
+" B { 0 i % [.o.u.S.d.h.9.M.&Xz.M 6 YXYXYXYXYXYXYXYX",
+" z { 0 - J *./ S.9.d.i.G.&XF g O YXYXYXYXYXYXYXYXYXYX",
+" z $.2 w =.! s.d.p.N.;X^ l , YXYXYXYXYXYXYXYXYXYXYX",
+" B &.9 ;.Q / j.x.@Xl.m 6 YXYXYXYXYXYXYXYXYXYXYXYXYX",
+" h W @.+.I y.&Xb.F 7 O YXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" $ s %XU F.=X^ j # YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" g O.<Xe.l 1 YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+" o f n d . YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/ruby/app_templates/qtruby4app/filesave.xpm b/languages/ruby/app_templates/qtruby4app/filesave.xpm
new file mode 100644
index 00000000..86ea7d63
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/filesave.xpm
@@ -0,0 +1,295 @@
+/* XPM */
+static char *filesave[] = {
+/* columns rows colors chars-per-pixel */
+"32 32 257 2",
+" c #000000",
+". c #06060A",
+"X c #09090D",
+"o c #0B0B16",
+"O c #101022",
+"+ c #1E1E28",
+"@ c #181829",
+"# c #151F3A",
+"$ c #1A263F",
+"% c #1D2A3F",
+"& c #272730",
+"* c #2E2E3F",
+"= c #212140",
+"- c #212E41",
+"; c #2F2F41",
+": c #292A4A",
+"> c #23224B",
+", c #262353",
+"< c #292655",
+"1 c #2B2C54",
+"2 c #2C2C5B",
+"3 c #293746",
+"4 c #2D304F",
+"5 c #243243",
+"6 c #2E315D",
+"7 c #363647",
+"8 c #303E4A",
+"9 c #30325E",
+"0 c #3C3C53",
+"q c #2E2E60",
+"w c #2F3160",
+"e c #302E63",
+"r c #313164",
+"t c #363861",
+"y c #353868",
+"u c #384650",
+"i c #284F6B",
+"p c #2D547B",
+"a c #3B486A",
+"s c #36597D",
+"d c #3D5D7C",
+"f c #4C4C4C",
+"g c #40405A",
+"h c #414E56",
+"j c #4B585E",
+"k c #49545E",
+"l c #555555",
+"z c #4D4D6B",
+"x c #434675",
+"c c #4B5660",
+"v c #4F5962",
+"b c #41517E",
+"n c #4B507D",
+"m c #515C67",
+"M c #505D6E",
+"N c #5C5D7D",
+"B c #546066",
+"V c #54626D",
+"C c #5B646D",
+"Z c #55677A",
+"A c #556B78",
+"S c #5D6772",
+"D c #6B6B6B",
+"F c #646464",
+"G c #616C73",
+"H c #63707D",
+"J c #6B7679",
+"K c gray45",
+"L c #00418E",
+"P c #004494",
+"I c #004894",
+"U c #044F98",
+"Y c #03509B",
+"T c #0A5198",
+"R c #13579C",
+"E c #185DA1",
+"W c #285888",
+"Q c #2B6094",
+"! c #396D9A",
+"~ c #336A96",
+"^ c #3D719B",
+"/ c #226EB8",
+"( c #326EA8",
+") c #326BA3",
+"_ c #3673AE",
+"` c #3A76B4",
+"' c #0B6FD1",
+"] c #0F75D8",
+"[ c #1479DA",
+"{ c #1B7CDC",
+"} c #466481",
+"| c #42749C",
+" . c #4A799E",
+".. c #506A84",
+"X. c #5F678D",
+"o. c #576391",
+"O. c #5A6592",
+"+. c #5F6893",
+"@. c #5B738B",
+"#. c #507DA1",
+"$. c #626283",
+"%. c #636A94",
+"&. c #656F98",
+"*. c #657A8F",
+"=. c #6B7299",
+"-. c #717191",
+";. c #797998",
+":. c #687BA6",
+">. c #2281DC",
+",. c #3F81C0",
+"<. c #3988D7",
+"1. c #2785E1",
+"2. c #2E8AE3",
+"3. c #368FE5",
+"4. c #3690E6",
+"5. c #3D93E7",
+"6. c #3D94E9",
+"7. c #57839E",
+"8. c #4787BC",
+"9. c #5480A1",
+"0. c #5B84A3",
+"q. c #6E8496",
+"w. c #6E8B9A",
+"e. c #7D848E",
+"r. c #728597",
+"t. c #738598",
+"y. c #768899",
+"u. c #7B8B9B",
+"i. c #6489A5",
+"p. c #698EA7",
+"a. c #6D8FA9",
+"s. c #6E81AB",
+"d. c #7683A6",
+"f. c #768CB7",
+"g. c #7395AD",
+"h. c #7C96B0",
+"j. c #4086CA",
+"k. c #4986C3",
+"l. c #4284C3",
+"z. c #498ED2",
+"x. c #4D95DB",
+"c. c #548DC5",
+"v. c #5D92C8",
+"b. c #5593C9",
+"n. c #5097DE",
+"m. c #5198DE",
+"M. c #4296E7",
+"N. c #4895E2",
+"B. c #4B99E5",
+"V. c #4A9CEB",
+"C. c #4599EB",
+"Z. c #529DE6",
+"A. c #589EE2",
+"S. c #54A1EB",
+"D. c #5AA1E6",
+"F. c #5AA5EB",
+"G. c #5EA8EF",
+"H. c #53A3F1",
+"J. c #5EAAF2",
+"K. c #6699CB",
+"L. c #799BC8",
+"P. c #7EA6C9",
+"I. c #60A2E5",
+"U. c #65A7E8",
+"Y. c #6BABE9",
+"T. c #68ADF2",
+"R. c #67B0F5",
+"E. c #6DB3F6",
+"W. c #70ADEA",
+"Q. c #75B0E9",
+"!. c #7CB5EB",
+"~. c #73B9F8",
+"^. c #7BBDFB",
+"/. c #7CBAF6",
+"(. c gray55",
+"). c #828899",
+"_. c #84949E",
+"`. c #918E8A",
+"'. c #949494",
+"]. c #8F8FA9",
+"[. c #8997A5",
+"{. c #8A9AA9",
+"}. c #9A9BAF",
+"|. c #9399A9",
+" X c #9FAAB5",
+".X c #A29E9B",
+"XX c #A7A7A7",
+"oX c #ABABAB",
+"OX c #A3A3B4",
+"+X c #A8A8B7",
+"@X c #A3ABB3",
+"#X c #B4B5B5",
+"$X c #B0B0BC",
+"%X c #B7B9BC",
+"&X c #BBB7B3",
+"*X c #BBBBBB",
+"=X c #82B1DB",
+"-X c #81B7EC",
+";X c #88BBED",
+":X c #86BAED",
+">X c #AEBBC8",
+",X c #A6BDCD",
+"<X c #BBBCC3",
+"1X c #81C1F6",
+"2X c #83C2FA",
+"3X c #89C4FA",
+"4X c #8CC8FC",
+"5X c #95C2EF",
+"6X c #93CBFD",
+"7X c #9BCFFF",
+"8X c #97D0FC",
+"9X c #9CD3FE",
+"0X c #BEC0C1",
+"qX c #A3C7E7",
+"wX c #A2CAF1",
+"eX c #A1D4FF",
+"rX c #A3D8FF",
+"tX c #AADBFF",
+"yX c #B0D1F2",
+"uX c #BDD9F4",
+"iX c #AAE0FF",
+"pX c #B3E1FF",
+"aX c #B9E6FF",
+"sX c #BEE9FF",
+"dX c #C4C4C4",
+"fX c #C6C5CD",
+"gX c #C6C8CB",
+"hX c #CAC7C4",
+"jX c #CAC8C6",
+"kX c #CBCCCB",
+"lX c #D1D0CE",
+"zX c #D3D3D3",
+"xX c #D4D7D9",
+"cX c #D8D8D7",
+"vX c #DBDBDB",
+"bX c #C4ECFF",
+"nX c #C9E0F6",
+"mX c #C4F5FF",
+"MX c #CCF2FF",
+"NX c #D5E6F7",
+"BX c #DDEBF9",
+"VX c #DCFDFF",
+"CX c #D3F1F5",
+"ZX c #E1E0DE",
+"AX c #E4E3E3",
+"SX c #E4E7EA",
+"DX c #E7E8E9",
+"FX c #E8E6E4",
+"GX c #EDE9E5",
+"HX c #EBEBEB",
+"JX c #E7EEF5",
+"KX c #EAF2FA",
+"LX c #F1EEEA",
+"PX c #F3F3F3",
+"IX c #F4F8FC",
+"UX c #FDFDFC",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXy y e 6 6 2 < < , , 1 YXYX",
+"YXYXYX2 < , , q w 2 e r r r w e w r e 2 6 1 6 s :.f.L.y YXYX",
+"YXYXYXx d.s.:.a # $ $ % - 5 3 8 u h k B S J ).,XF.b.7.r YXYX",
+"YXYXYX&.mX~.8.V #X#X%XdXfXzXxXvXZXZXDXFXFXDXLXDX>.U i 9 YXYX",
+"YXYXYXo.2X] L C UXDXcXzXkXkXkXjXjXdXdX%X%X&X%X*XN.' ~ 6 YXYX",
+"YXYXYXo.1X] P k hXoXXXXXoXoX#X#X*X%X&X%X%XdXkXxXx.[ ~ 6 YXYX",
+"YXYXYXO.3X[ I m FXkXjXjXkXkXkXkXkXkXzXzXzXcXZXSXx.{ ! 6 YXYX",
+"YXYXYXo.3X{ I S UXvXxXzXkXkXkXkXkXjXdX*X%X#X&X%XZ.1.^ 9 YXYX",
+"YXYXYXO.4X>.U j jX#X#X#X%XdXdXkXzXkXzXzXcXvXDXJXA.1.| 6 YXYX",
+"YXYXYXO.6X>.T V PXZXZXZXAXSXDXDXFXHXDXHXHXHXHXSXI.2.| 9 YXYX",
+"YXYXYXO.6X2.T G UXLXDXDXAXZXZXAXZXvXcXzXkXkXkXgXY.3. .6 YXYX",
+"YXYXYXO.9X4.R m zXdXdXkXzXvXAXDXHXLXPXPXIXUXUXUXQ.6. .9 YXYX",
+"YXYXYXO.9X5.R H UXIXUXUXUXUXUXUXUXUXUXUXIXKXJXBX-XC.#.9 YXYX",
+"YXYXYXO.eXM./ h.UXUXIXKXBXNXnXuXyXwX5X:X!.Y.Y.Y.D.H.9.6 YXYX",
+"YXYXYX+.rXB.<.x.Q.;X-XQ.Y.U.U.D.Z.Z.B.B.C.V.V.B.B.T.0.9 YXYX",
+"YXYXYX+.tXB.N.B.B.B.B.C.V.V.H.H.H.D.N.z.8._ ( <.D.R.0.9 YXYX",
+"YXYXYX+.tXS.Z.F.D.m.z.l.` ) Q W p s } @.r.[. X>XG.E.0.9 YXYX",
+"YXYXYX+.pXU.m.) p d ..*.u.|.+X<XzXZXGXLXGXZXzXjX/.~.p.r YXYX",
+"YXYXYX%.aXT.k.*.GXlX&X.X`..XhXlXzXvXvXvXvXxXkXgX2X^.a.w YXYX",
+"YXYXYX%.aXE.k.r.LXoXl f l F *XlXzXvXvXvXvXcXzXgX4X:Xa.w YXYX",
+"YXYXYX%.bX~.c.y.LX'.f D K D 0XkXzXvXvXvXvXvXzXfX6X4Xg.9 YXYX",
+"YXYXYX%.bX^.c.y.LX'.l D K D 0XlXzXcXvXvXvXxXkXkX9X6Xw.r YXYX",
+"YXYXYX%.bX2Xv.u.LX'.l K K K 0XlXzXcXvXvXvXvXkXfX9XP.M = YXYX",
+"YXYXYX%.bX2XK.u.LX'.l K K D 0XlXxXcXvXZXvXxXzXkXqXZ : . YXYX",
+"YXYXYX%.MX6XK.u.LX'.f F D D 0XkXzXcXvXvXvXvXcXkX_.: o YXYX",
+"YXYXYX%.MX6XK.u.LXXX(.XX&XdXkXzXvXZXDXAXzX<X+X}.N O YXYX",
+"YXYXYX%.VXiX=X{.FXzXkXkXjXdX<X$XOX].;.$.z 0 7 & X YXYXYX",
+"YXYXYX=.CXq.A ).fX+X|.).-.N z 0 * + o YXYXYXYX",
+"YXYXYXn $.t 6 , 4 0 * + . YXYXYXYXYXYX",
+"YXYXYX> @ o YXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX",
+"YXYXYX YXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYXYX"
+};
diff --git a/languages/ruby/app_templates/qtruby4app/main.rb b/languages/ruby/app_templates/qtruby4app/main.rb
new file mode 100644
index 00000000..7b5aaf60
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/main.rb
@@ -0,0 +1,10 @@
+require 'Qt4'
+require '%{APPNAMELC}.rb'
+require 'qrc_application.rb'
+
+app = Qt::Application.new(ARGV)
+mw = %{APPNAME}.new
+mw.show
+app.exec
+
+
diff --git a/languages/ruby/app_templates/qtruby4app/qrc_application.rb b/languages/ruby/app_templates/qtruby4app/qrc_application.rb
new file mode 100644
index 00000000..b2bd7673
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/qrc_application.rb
@@ -0,0 +1,2281 @@
+#****************************************************************************
+#** Ruby Resource object code
+#**
+#** Created: Mon Dec 3 14:03:30 2007
+#** by: The Ruby Resource Compiler for Qt version 4.3.0
+#**
+#** WARNING! All changes made in this file will be lost!
+#****************************************************************************/
+
+class QCleanupResources__dest_class__
+ def self.qt_resource_data
+ return @@qt_resource_data
+ end
+
+ def self.qt_resource_name
+ return @@qt_resource_name
+ end
+
+ def self.qt_resource_struct
+ return @@qt_resource_struct
+ end
+
+@@qt_resource_data = [
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/fileopen.xpm
+ 0x0,0x0,0x18,0xf9,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x66,0x69,0x6c,0x65,0x6f,0x70,0x65,0x6e,0x5b,0x5d,
+ 0x20,0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,0x20,
+ 0x72,0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,0x72,
+ 0x73,0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,0x22,
+ 0x33,0x32,0x20,0x33,0x32,0x20,0x32,0x35,0x37,0x20,0x32,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x20,0x63,0x20,0x62,0x6c,0x61,0x63,0x6b,0x22,0x2c,0xa,0x22,0x2e,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x42,0x30,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x58,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x33,0x30,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x6f,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x36,0x31,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x4f,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x33,0x31,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x2b,0x20,0x20,
+ 0x63,0x20,0x23,0x33,0x35,0x32,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x40,0x20,0x20,
+ 0x63,0x20,0x23,0x33,0x42,0x33,0x31,0x31,0x43,0x22,0x2c,0xa,0x22,0x23,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x33,0x33,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x24,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x46,0x33,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x41,0x33,0x45,0x31,0x36,0x22,0x2c,0xa,0x22,0x26,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x41,0x33,0x44,0x32,0x32,0x22,0x2c,0xa,0x22,0x2a,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x44,0x34,0x32,0x31,0x41,0x22,0x2c,0xa,0x22,0x3d,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x34,0x34,0x32,0x30,0x44,0x22,0x2c,0xa,0x22,0x2d,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x45,0x34,0x35,0x32,0x39,0x22,0x2c,0xa,0x22,0x3b,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x38,0x34,0x33,0x33,0x38,0x22,0x2c,0xa,0x22,0x3a,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x38,0x34,0x32,0x33,0x33,0x22,0x2c,0xa,0x22,0x3e,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x42,0x34,0x42,0x32,0x34,0x22,0x2c,0xa,0x22,0x2c,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x32,0x34,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x3c,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x37,0x34,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x31,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x44,0x34,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x32,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x45,0x34,0x46,0x31,0x37,0x22,0x2c,0xa,0x22,0x33,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x44,0x35,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x34,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x37,0x35,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x35,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x34,0x35,0x42,0x30,0x46,0x22,0x2c,0xa,0x22,0x36,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x39,0x35,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x37,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x41,0x35,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x38,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x31,0x35,0x43,0x31,0x38,0x22,0x2c,0xa,0x22,0x39,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x36,0x34,0x42,0x30,0x41,0x22,0x2c,0xa,0x22,0x30,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x43,0x35,0x34,0x32,0x33,0x22,0x2c,0xa,0x22,0x71,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x44,0x35,0x39,0x32,0x45,0x22,0x2c,0xa,0x22,0x77,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x38,0x35,0x45,0x32,0x37,0x22,0x2c,0xa,0x22,0x65,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x33,0x35,0x36,0x32,0x36,0x22,0x2c,0xa,0x22,0x72,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x36,0x35,0x37,0x33,0x36,0x22,0x2c,0xa,0x22,0x74,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x41,0x36,0x33,0x31,0x44,0x22,0x2c,0xa,0x22,0x79,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x41,0x36,0x37,0x32,0x45,0x22,0x2c,0xa,0x22,0x75,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x37,0x36,0x35,0x33,0x35,0x22,0x2c,0xa,0x22,0x69,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x43,0x35,0x39,0x35,0x36,0x22,0x2c,0xa,0x22,0x70,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x38,0x37,0x30,0x34,0x46,0x22,0x2c,0xa,0x22,0x61,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x35,0x37,0x32,0x36,0x45,0x22,0x2c,0xa,0x22,0x73,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x44,0x34,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x64,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x31,0x35,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x66,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x33,0x35,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x67,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x41,0x35,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x68,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x36,0x36,0x34,0x30,0x30,0x22,0x2c,0xa,0x22,0x6a,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x36,0x36,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x6b,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x35,0x36,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x6c,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x43,0x36,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x7a,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x44,0x37,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x78,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x35,0x36,0x42,0x32,0x41,0x22,0x2c,0xa,0x22,0x63,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x43,0x37,0x35,0x32,0x41,0x22,0x2c,0xa,0x22,0x76,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x43,0x37,0x32,0x33,0x42,0x22,0x2c,0xa,0x22,0x62,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x37,0x39,0x33,0x39,0x22,0x2c,0xa,0x22,0x6e,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x34,0x35,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x6d,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x36,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x4d,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x36,0x38,0x30,0x44,0x22,0x2c,0xa,0x22,0x4e,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x42,0x36,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x42,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x30,0x37,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x56,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x35,0x37,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x43,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x42,0x37,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x5a,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x37,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x41,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x46,0x37,0x32,0x31,0x41,0x22,0x2c,0xa,0x22,0x53,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x37,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x44,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x35,0x37,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x46,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x30,0x37,0x33,0x31,0x41,0x22,0x2c,0xa,0x22,0x47,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x34,0x37,0x43,0x32,0x36,0x22,0x2c,0xa,0x22,0x48,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x37,0x37,0x45,0x32,0x38,0x22,0x2c,0xa,0x22,0x4a,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x39,0x37,0x46,0x35,0x39,0x22,0x2c,0xa,0x22,0x4b,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x37,0x43,0x34,0x30,0x22,0x2c,0xa,0x22,0x4c,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x32,0x37,0x46,0x35,0x38,0x22,0x2c,0xa,0x22,0x50,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x30,0x37,0x41,0x36,0x43,0x22,0x2c,0xa,0x22,0x49,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x43,0x38,0x32,0x31,0x44,0x22,0x2c,0xa,0x22,0x55,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x46,0x38,0x41,0x33,0x35,0x22,0x2c,0xa,0x22,0x59,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x43,0x38,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x54,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x38,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x52,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x36,0x38,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x45,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x38,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x57,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x38,0x33,0x33,0x37,0x22,0x2c,0xa,0x22,0x51,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x38,0x42,0x33,0x31,0x22,0x2c,0xa,0x22,0x21,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x46,0x39,0x35,0x33,0x35,0x22,0x2c,0xa,0x22,0x7e,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x35,0x38,0x45,0x33,0x41,0x22,0x2c,0xa,0x22,0x5e,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x38,0x36,0x33,0x33,0x22,0x2c,0xa,0x22,0x2f,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x34,0x39,0x39,0x33,0x36,0x22,0x2c,0xa,0x22,0x28,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x43,0x41,0x30,0x33,0x39,0x22,0x2c,0xa,0x22,0x29,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x39,0x38,0x34,0x34,0x35,0x22,0x2c,0xa,0x22,0x5f,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x38,0x36,0x35,0x37,0x22,0x2c,0xa,0x22,0x60,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x42,0x38,0x32,0x36,0x34,0x22,0x2c,0xa,0x22,0x27,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x45,0x38,0x35,0x37,0x32,0x22,0x2c,0xa,0x22,0x5d,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x38,0x38,0x36,0x34,0x22,0x2c,0xa,0x22,0x5b,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x38,0x43,0x37,0x35,0x22,0x2c,0xa,0x22,0x7b,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x46,0x39,0x30,0x37,0x32,0x22,0x2c,0xa,0x22,0x7d,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x33,0x38,0x38,0x34,0x35,0x22,0x2c,0xa,0x22,0x7c,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x34,0x38,0x39,0x35,0x32,0x22,0x2c,0xa,0x22,0x20,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x39,0x36,0x35,0x43,0x22,0x2c,0xa,0x22,0x2e,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x38,0x39,0x31,0x35,0x36,0x22,0x2c,0xa,0x22,0x58,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x35,0x39,0x33,0x34,0x44,0x22,0x2c,0xa,0x22,0x6f,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x39,0x44,0x34,0x35,0x22,0x2c,0xa,0x22,0x4f,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x34,0x39,0x37,0x35,0x35,0x22,0x2c,0xa,0x22,0x2b,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x42,0x39,0x38,0x34,0x41,0x22,0x2c,0xa,0x22,0x40,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x44,0x39,0x41,0x36,0x35,0x22,0x2c,0xa,0x22,0x23,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x39,0x37,0x37,0x38,0x22,0x2c,0xa,0x22,0x24,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x35,0x39,0x38,0x37,0x34,0x22,0x2c,0xa,0x22,0x25,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x39,0x42,0x37,0x41,0x22,0x2c,0xa,0x22,0x26,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x39,0x37,0x37,0x35,0x22,0x2c,0xa,0x22,0x2a,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x41,0x39,0x35,0x39,0x22,0x2c,0xa,0x22,0x3d,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x41,0x34,0x36,0x43,0x22,0x2c,0xa,0x22,0x2d,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x31,0x41,0x30,0x37,0x46,0x22,0x2c,0xa,0x22,0x3b,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x35,0x41,0x39,0x37,0x41,0x22,0x2c,0xa,0x22,0x3a,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x45,0x42,0x33,0x37,0x42,0x22,0x2c,0xa,0x22,0x3e,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x39,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x2c,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x39,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x3c,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x39,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x31,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x39,0x38,0x31,0x32,0x22,0x2c,0xa,0x22,0x32,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x41,0x33,0x31,0x43,0x22,0x2c,0xa,0x22,0x33,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x41,0x36,0x33,0x45,0x22,0x2c,0xa,0x22,0x34,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x37,0x41,0x45,0x33,0x37,0x22,0x2c,0xa,0x22,0x35,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x39,0x38,0x34,0x30,0x22,0x2c,0xa,0x22,0x36,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x39,0x42,0x34,0x45,0x22,0x2c,0xa,0x22,0x37,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x41,0x36,0x34,0x31,0x22,0x2c,0xa,0x22,0x38,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x41,0x41,0x34,0x33,0x22,0x2c,0xa,0x22,0x39,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x41,0x43,0x34,0x35,0x22,0x2c,0xa,0x22,0x30,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x41,0x46,0x34,0x39,0x22,0x2c,0xa,0x22,0x71,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x41,0x37,0x34,0x36,0x22,0x2c,0xa,0x22,0x77,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x41,0x31,0x35,0x38,0x22,0x2c,0xa,0x22,0x65,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x41,0x36,0x35,0x44,0x22,0x2c,0xa,0x22,0x72,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x45,0x41,0x38,0x35,0x37,0x22,0x2c,0xa,0x22,0x74,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x46,0x41,0x39,0x35,0x41,0x22,0x2c,0xa,0x22,0x79,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x41,0x43,0x35,0x30,0x22,0x2c,0xa,0x22,0x75,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x44,0x42,0x31,0x34,0x42,0x22,0x2c,0xa,0x22,0x69,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x42,0x33,0x35,0x38,0x22,0x2c,0xa,0x22,0x70,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x42,0x31,0x35,0x32,0x22,0x2c,0xa,0x22,0x61,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x41,0x42,0x35,0x39,0x22,0x2c,0xa,0x22,0x73,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x42,0x35,0x34,0x44,0x22,0x2c,0xa,0x22,0x64,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x42,0x39,0x35,0x31,0x22,0x2c,0xa,0x22,0x66,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x36,0x42,0x43,0x35,0x42,0x22,0x2c,0xa,0x22,0x67,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x42,0x34,0x35,0x45,0x22,0x2c,0xa,0x22,0x68,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x39,0x42,0x44,0x35,0x36,0x22,0x2c,0xa,0x22,0x6a,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x42,0x37,0x35,0x33,0x22,0x2c,0xa,0x22,0x6b,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x41,0x42,0x34,0x38,0x22,0x2c,0xa,0x22,0x6c,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x45,0x41,0x45,0x36,0x39,0x22,0x2c,0xa,0x22,0x7a,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x41,0x44,0x36,0x37,0x22,0x2c,0xa,0x22,0x78,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x42,0x36,0x36,0x32,0x22,0x2c,0xa,0x22,0x63,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x42,0x32,0x36,0x42,0x22,0x2c,0xa,0x22,0x76,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x42,0x36,0x36,0x42,0x22,0x2c,0xa,0x22,0x62,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x45,0x42,0x37,0x37,0x35,0x22,0x2c,0xa,0x22,0x6e,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x45,0x42,0x45,0x37,0x46,0x22,0x2c,0xa,0x22,0x6d,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x33,0x41,0x44,0x36,0x36,0x22,0x2c,0xa,0x22,0x4d,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x35,0x42,0x45,0x36,0x34,0x22,0x2c,0xa,0x22,0x4e,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x42,0x46,0x36,0x44,0x22,0x2c,0xa,0x22,0x42,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x42,0x33,0x34,0x42,0x22,0x2c,0xa,0x22,0x56,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x42,0x37,0x35,0x46,0x22,0x2c,0xa,0x22,0x43,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x42,0x38,0x35,0x46,0x22,0x2c,0xa,0x22,0x5a,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x42,0x41,0x36,0x31,0x22,0x2c,0xa,0x22,0x41,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x42,0x45,0x36,0x33,0x22,0x2c,0xa,0x22,0x53,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x43,0x31,0x35,0x39,0x22,0x2c,0xa,0x22,0x44,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x43,0x32,0x36,0x39,0x22,0x2c,0xa,0x22,0x46,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x43,0x31,0x37,0x36,0x22,0x2c,0xa,0x22,0x47,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x38,0x43,0x36,0x37,0x46,0x22,0x2c,0xa,0x22,0x48,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x43,0x35,0x35,0x44,0x22,0x2c,0xa,0x22,0x4a,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x43,0x30,0x35,0x44,0x22,0x2c,0xa,0x22,0x4b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x43,0x31,0x35,0x45,0x22,0x2c,0xa,0x22,0x4c,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x43,0x32,0x36,0x34,0x22,0x2c,0xa,0x22,0x50,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x35,0x43,0x39,0x36,0x31,0x22,0x2c,0xa,0x22,0x49,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x44,0x43,0x31,0x36,0x34,0x22,0x2c,0xa,0x22,0x55,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x43,0x44,0x36,0x35,0x22,0x2c,0xa,0x22,0x59,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x44,0x33,0x36,0x42,0x22,0x2c,0xa,0x22,0x54,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x32,0x43,0x35,0x36,0x34,0x22,0x2c,0xa,0x22,0x52,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x36,0x43,0x38,0x36,0x38,0x22,0x2c,0xa,0x22,0x45,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x38,0x43,0x37,0x36,0x30,0x22,0x2c,0xa,0x22,0x57,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x42,0x43,0x43,0x36,0x41,0x22,0x2c,0xa,0x22,0x51,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x43,0x42,0x36,0x33,0x22,0x2c,0xa,0x22,0x21,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x44,0x35,0x36,0x44,0x22,0x2c,0xa,0x22,0x7e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x30,0x36,0x43,0x22,0x2c,0xa,0x22,0x5e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x35,0x44,0x39,0x37,0x32,0x22,0x2c,0xa,0x22,0x2f,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x31,0x37,0x35,0x22,0x2c,0xa,0x22,0x28,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x41,0x44,0x45,0x37,0x37,0x22,0x2c,0xa,0x22,0x29,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x43,0x38,0x37,0x41,0x22,0x2c,0xa,0x22,0x5f,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x45,0x32,0x37,0x43,0x22,0x2c,0xa,0x22,0x60,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x46,0x39,0x31,0x39,0x32,0x22,0x2c,0xa,0x22,0x27,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x41,0x39,0x41,0x39,0x36,0x22,0x2c,0xa,0x22,0x5d,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x39,0x46,0x38,0x33,0x22,0x2c,0xa,0x22,0x5b,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x44,0x41,0x35,0x38,0x33,0x22,0x2c,0xa,0x22,0x7b,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x41,0x33,0x39,0x39,0x22,0x2c,0xa,0x22,0x7d,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x41,0x43,0x38,0x36,0x22,0x2c,0xa,0x22,0x7c,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x42,0x30,0x38,0x38,0x22,0x2c,0xa,0x22,0x20,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x42,0x32,0x39,0x38,0x22,0x2c,0xa,0x22,0x2e,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x41,0x38,0x41,0x36,0x22,0x2c,0xa,0x22,0x58,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x44,0x41,0x45,0x42,0x30,0x22,0x2c,0xa,0x22,0x6f,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x35,0x42,0x36,0x42,0x34,0x22,0x2c,0xa,0x22,0x4f,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x41,0x42,0x43,0x42,0x43,0x22,0x2c,0xa,0x22,0x2b,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x42,0x33,0x38,0x45,0x22,0x2c,0xa,0x22,0x40,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x33,0x42,0x45,0x38,0x30,0x22,0x2c,0xa,0x22,0x23,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x30,0x42,0x43,0x39,0x35,0x22,0x2c,0xa,0x22,0x24,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x42,0x46,0x41,0x36,0x22,0x2c,0xa,0x22,0x25,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x43,0x32,0x39,0x44,0x22,0x2c,0xa,0x22,0x26,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x43,0x32,0x38,0x33,0x22,0x2c,0xa,0x22,0x2a,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x43,0x37,0x38,0x39,0x22,0x2c,0xa,0x22,0x3d,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x43,0x41,0x38,0x42,0x22,0x2c,0xa,0x22,0x2d,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x35,0x43,0x34,0x38,0x39,0x22,0x2c,0xa,0x22,0x3b,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x43,0x44,0x39,0x34,0x22,0x2c,0xa,0x22,0x3a,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x36,0x43,0x36,0x39,0x39,0x22,0x2c,0xa,0x22,0x3e,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x46,0x43,0x38,0x42,0x31,0x22,0x2c,0xa,0x22,0x2c,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x43,0x36,0x42,0x37,0x22,0x2c,0xa,0x22,0x3c,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x43,0x39,0x41,0x36,0x22,0x2c,0xa,0x22,0x31,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x44,0x33,0x42,0x41,0x22,0x2c,0xa,0x22,0x32,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x43,0x39,0x38,0x31,0x22,0x2c,0xa,0x22,0x33,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x43,0x44,0x39,0x31,0x22,0x2c,0xa,0x22,0x34,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x44,0x36,0x38,0x36,0x22,0x2c,0xa,0x22,0x35,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x42,0x44,0x36,0x39,0x45,0x22,0x2c,0xa,0x22,0x36,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x36,0x38,0x32,0x22,0x2c,0xa,0x22,0x37,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x38,0x38,0x42,0x22,0x2c,0xa,0x22,0x38,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x43,0x39,0x35,0x22,0x2c,0xa,0x22,0x39,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x33,0x43,0x45,0x41,0x33,0x22,0x2c,0xa,0x22,0x30,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x45,0x44,0x39,0x41,0x39,0x22,0x2c,0xa,0x22,0x71,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x44,0x43,0x42,0x39,0x22,0x2c,0xa,0x22,0x77,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x44,0x44,0x41,0x46,0x22,0x2c,0xa,0x22,0x65,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x36,0x38,0x41,0x22,0x2c,0xa,0x22,0x72,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x38,0x39,0x33,0x22,0x2c,0xa,0x22,0x74,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x41,0x39,0x46,0x22,0x2c,0xa,0x22,0x79,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x32,0x41,0x35,0x22,0x2c,0xa,0x22,0x75,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x33,0x41,0x43,0x22,0x2c,0xa,0x22,0x69,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x43,0x41,0x37,0x22,0x2c,0xa,0x22,0x70,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x44,0x41,0x45,0x22,0x2c,0xa,0x22,0x61,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x45,0x30,0x42,0x36,0x22,0x2c,0xa,0x22,0x73,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x45,0x35,0x42,0x34,0x22,0x2c,0xa,0x22,0x64,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x45,0x42,0x34,0x22,0x2c,0xa,0x22,0x66,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x38,0x45,0x35,0x42,0x42,0x22,0x2c,0xa,0x22,0x67,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x30,0x42,0x43,0x22,0x2c,0xa,0x22,0x68,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x43,0x37,0x43,0x38,0x22,0x2c,0xa,0x22,0x6a,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x37,0x43,0x38,0x43,0x41,0x22,0x2c,0xa,0x22,0x6b,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x43,0x45,0x43,0x46,0x22,0x2c,0xa,0x22,0x6c,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x43,0x41,0x43,0x30,0x22,0x2c,0xa,0x22,0x7a,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x44,0x43,0x45,0x44,0x30,0x22,0x2c,0xa,0x22,0x78,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x44,0x31,0x43,0x46,0x22,0x2c,0xa,0x22,0x63,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x44,0x33,0x44,0x34,0x22,0x2c,0xa,0x22,0x76,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x36,0x44,0x38,0x44,0x41,0x22,0x2c,0xa,0x22,0x62,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x44,0x43,0x44,0x45,0x22,0x2c,0xa,0x22,0x6e,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x43,0x44,0x45,0x45,0x30,0x22,0x2c,0xa,0x22,0x6d,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x45,0x45,0x30,0x45,0x32,0x22,0x2c,0xa,0x22,0x4d,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x44,0x45,0x43,0x32,0x22,0x2c,0xa,0x22,0x4e,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x42,0x45,0x31,0x43,0x35,0x22,0x2c,0xa,0x22,0x42,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x45,0x39,0x43,0x33,0x22,0x2c,0xa,0x22,0x56,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x37,0x45,0x41,0x43,0x45,0x22,0x2c,0xa,0x22,0x43,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x45,0x41,0x43,0x33,0x22,0x2c,0xa,0x22,0x5a,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x41,0x45,0x42,0x43,0x41,0x22,0x2c,0xa,0x22,0x41,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x31,0x43,0x31,0x22,0x2c,0xa,0x22,0x53,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x33,0x43,0x43,0x22,0x2c,0xa,0x22,0x44,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x36,0x44,0x41,0x22,0x2c,0xa,0x22,0x46,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x45,0x33,0x45,0x35,0x22,0x2c,0xa,0x22,0x47,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x45,0x36,0x45,0x38,0x22,0x2c,0xa,0x22,0x48,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x45,0x39,0x45,0x41,0x22,0x2c,0xa,0x22,0x4a,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x45,0x36,0x45,0x30,0x22,0x2c,0xa,0x22,0x4b,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x45,0x41,0x45,0x43,0x22,0x2c,0xa,0x22,0x4c,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x45,0x45,0x46,0x30,0x22,0x2c,0xa,0x22,0x50,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x45,0x46,0x30,0x46,0x32,0x22,0x2c,0xa,0x22,0x49,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x38,0x46,0x34,0x45,0x38,0x22,0x2c,0xa,0x22,0x55,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x46,0x33,0x46,0x35,0x22,0x2c,0xa,0x22,0x59,0x58,0x20,
+ 0x63,0x20,0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,
+ 0x6c,0x73,0x20,0x2a,0x2f,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x56,
+ 0x20,0x45,0x20,0x3c,0x2e,0x2c,0x2e,0x54,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x3c,
+ 0x20,0x45,0x20,0x32,0x2e,0x61,0x58,0x43,0x58,0x56,0x58,0x45,0x20,0x33,0x20,0x45,
+ 0x20,0x3c,0x2e,0x45,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,
+ 0x20,0x52,0x20,0x2c,0x2e,0x35,0x58,0x43,0x58,0x38,0x58,0x51,0x2e,0x77,0x58,0x3c,
+ 0x2e,0x31,0x2e,0x24,0x2e,0x4f,0x58,0x3c,0x2e,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,
+ 0x20,0x52,0x20,0x3e,0x2e,0x4c,0x2e,0x5a,0x58,0x79,0x58,0x54,0x2e,0x4b,0x2e,0x45,
+ 0x2e,0x77,0x58,0x20,0x2e,0x2e,0x58,0x4b,0x58,0x4b,0x58,0x52,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,
+ 0x20,0x56,0x20,0x45,0x20,0x34,0x2e,0x5a,0x58,0x73,0x58,0x57,0x2e,0x4b,0x2e,0x49,
+ 0x2e,0x5a,0x2e,0x4f,0x2e,0x7b,0x2e,0x4b,0x58,0x55,0x58,0x55,0x58,0x4d,0x58,0x6b,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x52,0x20,0x45,0x20,0x37,0x20,0x59,
+ 0x58,0x3c,0x20,0x45,0x20,0x32,0x2e,0x61,0x58,0x73,0x58,0x36,0x58,0x43,0x2e,0x54,
+ 0x2e,0x5a,0x2e,0x77,0x2e,0x5b,0x20,0x78,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x32,0x58,0x33,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x52,0x20,0x3e,0x2e,0x29,0x2e,0x35,
+ 0x58,0x2c,0x2e,0x54,0x20,0x2c,0x2e,0x35,0x58,0x43,0x58,0x38,0x58,0x4b,0x2e,0x54,
+ 0x2e,0x41,0x2e,0x61,0x2e,0x5d,0x20,0x4f,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x32,0x2e,0x4f,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x20,0x20,0x59,0x20,0x45,0x20,0x5a,0x2e,0x5a,
+ 0x58,0x73,0x58,0x37,0x58,0x73,0x58,0x30,0x58,0x43,0x58,0x79,0x58,0x52,0x2e,0x4b,
+ 0x2e,0x49,0x2e,0x56,0x2e,0x5f,0x20,0x2e,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x4c,0x58,0x4b,0x58,0x4a,0x58,0x56,0x20,0x44,0x20,0x4e,0x20,0x53,
+ 0x20,0x37,0x20,0x22,0x2c,0xa,0x22,0x20,0x20,0x7a,0x20,0x45,0x20,0x34,0x2e,0x66,
+ 0x58,0x73,0x58,0x2f,0x2e,0x4b,0x2e,0x7e,0x2e,0x2f,0x2e,0x36,0x58,0x7e,0x2e,0x49,
+ 0x2e,0x49,0x2e,0x43,0x2e,0x2e,0x2e,0x27,0x2e,0x4b,0x58,0x55,0x58,0x50,0x58,0x50,
+ 0x58,0x50,0x58,0x4c,0x58,0x4b,0x58,0x47,0x58,0x62,0x58,0x6c,0x2e,0x4e,0x20,0x6d,
+ 0x2e,0x53,0x58,0x6d,0x2e,0x44,0x20,0x22,0x2c,0xa,0x22,0x20,0x20,0x45,0x20,0x30,
+ 0x58,0x67,0x58,0x37,0x58,0x45,0x2e,0x57,0x2e,0x57,0x2e,0x7e,0x2e,0x7e,0x2e,0x52,
+ 0x2e,0x49,0x2e,0x5a,0x2e,0x77,0x2e,0x27,0x20,0x62,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x50,0x58,0x50,0x58,0x4c,0x58,0x6d,0x58,0x62,0x58,0x24,0x58,0x29,0x20,0x7e,
+ 0x20,0x61,0x58,0x53,0x58,0x70,0x58,0x42,0x58,0x6e,0x20,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x3c,0x2e,0x43,0x58,0x54,0x2e,0x51,0x2e,0x7e,0x2e,0x57,0x2e,0x57,0x2e,0x52,
+ 0x2e,0x49,0x2e,0x41,0x2e,0x74,0x2e,0x5f,0x20,0x68,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x50,0x58,0x4c,0x58,0x47,0x58,0x6e,0x58,0x2c,0x58,0x20,0x2e,0x74,
+ 0x20,0x20,0x58,0x41,0x58,0x53,0x58,0x65,0x58,0x34,0x58,0x6c,0x2e,0x5a,0x20,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x3c,0x2e,0x73,0x58,0x42,0x2e,0x57,0x2e,0x57,0x2e,0x57,
+ 0x2e,0x54,0x2e,0x41,0x2e,0x67,0x2e,0x5f,0x20,0x6f,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x4c,0x58,0x4c,0x58,0x6d,0x58,0x63,0x58,0x3d,0x2e,0x35,
+ 0x20,0x24,0x2e,0x42,0x58,0x67,0x58,0x65,0x58,0x21,0x2e,0x44,0x2e,0x33,0x58,0x6d,
+ 0x20,0x2b,0x20,0x22,0x2c,0xa,0x22,0x20,0x20,0x3c,0x2e,0x73,0x58,0x42,0x2e,0x52,
+ 0x2e,0x52,0x2e,0x41,0x2e,0x56,0x2e,0x7c,0x20,0x7b,0x2e,0x4b,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x4c,0x58,0x4b,0x58,0x47,0x58,0x76,0x58,0x7c,0x2e,0x63,
+ 0x20,0x75,0x20,0x71,0x58,0x64,0x58,0x67,0x58,0x5e,0x2e,0x55,0x2e,0x66,0x2e,0x33,
+ 0x58,0x48,0x20,0x66,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x20,0x20,0x3c,0x2e,0x73,
+ 0x58,0x42,0x2e,0x54,0x2e,0x5a,0x2e,0x6d,0x2e,0x5b,0x20,0x6e,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x50,0x58,0x4b,0x58,0x48,0x58,0x62,0x58,0x2c,0x58,0x29,
+ 0x20,0x65,0x20,0x3c,0x58,0x64,0x58,0x69,0x58,0x5f,0x2e,0x53,0x2e,0x75,0x2e,0x50,
+ 0x2e,0x46,0x2e,0x74,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x3c,0x2e,0x73,0x58,0x6b,0x2e,0x5a,0x2e,0x72,0x2e,0x4b,0x20,0x6a,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x50,0x58,0x4c,0x58,0x4b,0x58,0x6d,0x58,0x63,0x58,0x40,
+ 0x2e,0x35,0x20,0x25,0x2e,0x44,0x58,0x69,0x58,0x5f,0x2e,0x59,0x2e,0x53,0x2e,0x64,
+ 0x2e,0x68,0x2e,0x44,0x2e,0x2a,0x58,0x6c,0x20,0x58,0x20,0x20,0x20,0x20,0x20,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x3c,0x2e,0x77,0x58,0x71,0x2e,0x72,0x2e,0x58,0x2e,0x72,
+ 0x20,0x55,0x58,0x55,0x58,0x50,0x58,0x50,0x58,0x4b,0x58,0x6d,0x58,0x76,0x58,0x7c,
+ 0x2e,0x79,0x20,0x5f,0x20,0x4e,0x58,0x64,0x58,0x72,0x58,0x21,0x2e,0x53,0x2e,0x64,
+ 0x2e,0x68,0x2e,0x64,0x2e,0x66,0x2e,0x3d,0x58,0x46,0x20,0x34,0x20,0x20,0x20,0x20,
+ 0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x2c,0x2e,0x30,0x58,0x35,0x2e,0x58,
+ 0x2e,0x29,0x20,0x61,0x20,0x50,0x58,0x50,0x58,0x4b,0x58,0x47,0x58,0x6e,0x58,0x3e,
+ 0x58,0x29,0x20,0x79,0x20,0x3e,0x58,0x41,0x58,0x41,0x58,0x5f,0x2e,0x53,0x2e,0x68,
+ 0x2e,0x68,0x2e,0x75,0x2e,0x73,0x2e,0x64,0x2e,0x46,0x2e,0x36,0x2e,0x67,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x3e,0x2e,0x39,
+ 0x58,0x7e,0x20,0x7d,0x20,0x75,0x20,0x27,0x2e,0x4c,0x58,0x4b,0x58,0x6d,0x58,0x78,
+ 0x58,0x20,0x2e,0x35,0x20,0x5b,0x2e,0x49,0x58,0x41,0x58,0x5f,0x2e,0x21,0x2e,0x53,
+ 0x2e,0x68,0x2e,0x68,0x2e,0x64,0x2e,0x38,0x2e,0x73,0x2e,0x44,0x2e,0x6e,0x2e,0x6a,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x3e,0x2e,0x3a,0x58,0x57,0x20,0x76,0x20,0x26,0x20,0x6b,0x58,0x6d,0x58,0x76,
+ 0x58,0x3b,0x2e,0x74,0x20,0x5d,0x20,0x42,0x58,0x41,0x58,0x72,0x58,0x21,0x2e,0x55,
+ 0x2e,0x75,0x2e,0x53,0x2e,0x39,0x2e,0x75,0x2e,0x33,0x2e,0x37,0x2e,0x69,0x2e,0x3b,
+ 0x58,0x4d,0x20,0x31,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x45,0x20,0x23,0x58,0x62,0x20,0x75,0x20,0x3a,0x20,0x6e,
+ 0x58,0x63,0x58,0x5f,0x20,0x75,0x20,0x31,0x58,0x53,0x58,0x67,0x58,0x5e,0x2e,0x55,
+ 0x2e,0x48,0x2e,0x53,0x2e,0x64,0x2e,0x38,0x2e,0x73,0x2e,0x64,0x2e,0x75,0x2e,0x62,
+ 0x2e,0x2d,0x58,0x47,0x20,0x67,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x52,0x20,0x2b,0x58,0x63,0x20,0x72,
+ 0x20,0x61,0x20,0x7a,0x58,0x5b,0x2e,0x3d,0x20,0x2d,0x58,0x64,0x58,0x5f,0x2e,0x55,
+ 0x2e,0x64,0x2e,0x50,0x2e,0x68,0x2e,0x64,0x2e,0x75,0x2e,0x33,0x2e,0x38,0x2e,0x4e,
+ 0x2e,0x3d,0x58,0x77,0x2e,0x6c,0x20,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x54,0x20,0x7d,
+ 0x2e,0x78,0x20,0x3e,0x20,0x60,0x2e,0x6f,0x58,0x3e,0x20,0x25,0x2e,0x2a,0x2e,0x53,
+ 0x2e,0x53,0x2e,0x68,0x2e,0x53,0x2e,0x37,0x2e,0x64,0x2e,0x68,0x2e,0x30,0x2e,0x70,
+ 0x2e,0x6e,0x2e,0x63,0x2e,0x4d,0x20,0x64,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x43,0x20,0x5d,0x2e,0x77,0x20,0x40,0x20,0x58,0x58,0x75,0x20,0x70,0x20,0x2a,
+ 0x2e,0x28,0x20,0x68,0x2e,0x53,0x2e,0x73,0x2e,0x75,0x2e,0x75,0x2e,0x75,0x2e,0x70,
+ 0x2e,0x4e,0x2e,0x2a,0x58,0x5e,0x20,0x67,0x20,0x2b,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x5a,0x20,0x26,0x2e,0x65,0x20,0x3b,0x20,0x60,0x20,0x2a,
+ 0x20,0x3a,0x2e,0x6f,0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x75,0x2e,0x28,0x20,0x39,
+ 0x2e,0x78,0x2e,0x26,0x58,0x58,0x2e,0x6a,0x20,0x2c,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x42,0x20,0x7b,0x20,0x30,0x20,0x69,
+ 0x20,0x25,0x20,0x5b,0x2e,0x6f,0x2e,0x75,0x2e,0x53,0x2e,0x64,0x2e,0x68,0x2e,0x39,
+ 0x2e,0x4d,0x2e,0x26,0x58,0x7a,0x2e,0x4d,0x20,0x36,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x7a,0x20,0x7b,
+ 0x20,0x30,0x20,0x2d,0x20,0x4a,0x20,0x2a,0x2e,0x2f,0x20,0x53,0x2e,0x39,0x2e,0x64,
+ 0x2e,0x69,0x2e,0x47,0x2e,0x26,0x58,0x46,0x20,0x67,0x20,0x4f,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x7a,0x20,0x24,0x2e,0x32,0x20,0x77,0x20,0x3d,0x2e,0x21,0x20,0x73,0x2e,0x64,
+ 0x2e,0x70,0x2e,0x4e,0x2e,0x3b,0x58,0x5e,0x20,0x6c,0x20,0x2c,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x42,0x20,0x26,0x2e,0x39,0x20,0x3b,0x2e,0x51,0x20,0x2f,
+ 0x20,0x6a,0x2e,0x78,0x2e,0x40,0x58,0x6c,0x2e,0x6d,0x20,0x36,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x68,0x20,0x57,0x20,0x40,0x2e,0x2b,
+ 0x2e,0x49,0x20,0x79,0x2e,0x26,0x58,0x62,0x2e,0x46,0x20,0x37,0x20,0x4f,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,0x20,0x24,0x20,0x73,
+ 0x20,0x25,0x58,0x55,0x20,0x46,0x2e,0x3d,0x58,0x5e,0x20,0x6a,0x20,0x23,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x20,0x20,0x67,0x20,0x4f,0x2e,0x3c,0x58,0x65,0x2e,0x6c,0x20,0x31,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x20,0x20,0x20,0x20,0x6f,0x20,0x66,0x20,0x6e,0x20,0x64,0x20,0x2e,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0xa,0x7d,0x3b,0xa,
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/filesave.xpm
+ 0x0,0x0,0x18,0xf9,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x66,0x69,0x6c,0x65,0x73,0x61,0x76,0x65,0x5b,0x5d,
+ 0x20,0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,0x20,
+ 0x72,0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,0x72,
+ 0x73,0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,0x22,
+ 0x33,0x32,0x20,0x33,0x32,0x20,0x32,0x35,0x37,0x20,0x32,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x20,0x63,0x20,0x23,0x30,0x30,0x30,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x2e,
+ 0x20,0x20,0x63,0x20,0x23,0x30,0x36,0x30,0x36,0x30,0x41,0x22,0x2c,0xa,0x22,0x58,
+ 0x20,0x20,0x63,0x20,0x23,0x30,0x39,0x30,0x39,0x30,0x44,0x22,0x2c,0xa,0x22,0x6f,
+ 0x20,0x20,0x63,0x20,0x23,0x30,0x42,0x30,0x42,0x31,0x36,0x22,0x2c,0xa,0x22,0x4f,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x30,0x31,0x30,0x32,0x32,0x22,0x2c,0xa,0x22,0x2b,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x45,0x31,0x45,0x32,0x38,0x22,0x2c,0xa,0x22,0x40,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x38,0x31,0x38,0x32,0x39,0x22,0x2c,0xa,0x22,0x23,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x35,0x31,0x46,0x33,0x41,0x22,0x2c,0xa,0x22,0x24,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x41,0x32,0x36,0x33,0x46,0x22,0x2c,0xa,0x22,0x25,
+ 0x20,0x20,0x63,0x20,0x23,0x31,0x44,0x32,0x41,0x33,0x46,0x22,0x2c,0xa,0x22,0x26,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x37,0x32,0x37,0x33,0x30,0x22,0x2c,0xa,0x22,0x2a,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x45,0x32,0x45,0x33,0x46,0x22,0x2c,0xa,0x22,0x3d,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x31,0x32,0x31,0x34,0x30,0x22,0x2c,0xa,0x22,0x2d,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x31,0x32,0x45,0x34,0x31,0x22,0x2c,0xa,0x22,0x3b,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x46,0x32,0x46,0x34,0x31,0x22,0x2c,0xa,0x22,0x3a,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x39,0x32,0x41,0x34,0x41,0x22,0x2c,0xa,0x22,0x3e,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x33,0x32,0x32,0x34,0x42,0x22,0x2c,0xa,0x22,0x2c,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x36,0x32,0x33,0x35,0x33,0x22,0x2c,0xa,0x22,0x3c,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x39,0x32,0x36,0x35,0x35,0x22,0x2c,0xa,0x22,0x31,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x42,0x32,0x43,0x35,0x34,0x22,0x2c,0xa,0x22,0x32,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x43,0x32,0x43,0x35,0x42,0x22,0x2c,0xa,0x22,0x33,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x39,0x33,0x37,0x34,0x36,0x22,0x2c,0xa,0x22,0x34,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x44,0x33,0x30,0x34,0x46,0x22,0x2c,0xa,0x22,0x35,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x34,0x33,0x32,0x34,0x33,0x22,0x2c,0xa,0x22,0x36,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x45,0x33,0x31,0x35,0x44,0x22,0x2c,0xa,0x22,0x37,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x36,0x33,0x36,0x34,0x37,0x22,0x2c,0xa,0x22,0x38,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x30,0x33,0x45,0x34,0x41,0x22,0x2c,0xa,0x22,0x39,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x30,0x33,0x32,0x35,0x45,0x22,0x2c,0xa,0x22,0x30,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x43,0x33,0x43,0x35,0x33,0x22,0x2c,0xa,0x22,0x71,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x45,0x32,0x45,0x36,0x30,0x22,0x2c,0xa,0x22,0x77,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x46,0x33,0x31,0x36,0x30,0x22,0x2c,0xa,0x22,0x65,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x30,0x32,0x45,0x36,0x33,0x22,0x2c,0xa,0x22,0x72,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x31,0x33,0x31,0x36,0x34,0x22,0x2c,0xa,0x22,0x74,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x36,0x33,0x38,0x36,0x31,0x22,0x2c,0xa,0x22,0x79,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x35,0x33,0x38,0x36,0x38,0x22,0x2c,0xa,0x22,0x75,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x38,0x34,0x36,0x35,0x30,0x22,0x2c,0xa,0x22,0x69,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x38,0x34,0x46,0x36,0x42,0x22,0x2c,0xa,0x22,0x70,
+ 0x20,0x20,0x63,0x20,0x23,0x32,0x44,0x35,0x34,0x37,0x42,0x22,0x2c,0xa,0x22,0x61,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x42,0x34,0x38,0x36,0x41,0x22,0x2c,0xa,0x22,0x73,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x36,0x35,0x39,0x37,0x44,0x22,0x2c,0xa,0x22,0x64,
+ 0x20,0x20,0x63,0x20,0x23,0x33,0x44,0x35,0x44,0x37,0x43,0x22,0x2c,0xa,0x22,0x66,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x43,0x34,0x43,0x34,0x43,0x22,0x2c,0xa,0x22,0x67,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x30,0x34,0x30,0x35,0x41,0x22,0x2c,0xa,0x22,0x68,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x31,0x34,0x45,0x35,0x36,0x22,0x2c,0xa,0x22,0x6a,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x42,0x35,0x38,0x35,0x45,0x22,0x2c,0xa,0x22,0x6b,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x39,0x35,0x34,0x35,0x45,0x22,0x2c,0xa,0x22,0x6c,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x35,0x35,0x35,0x35,0x35,0x22,0x2c,0xa,0x22,0x7a,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x44,0x34,0x44,0x36,0x42,0x22,0x2c,0xa,0x22,0x78,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x33,0x34,0x36,0x37,0x35,0x22,0x2c,0xa,0x22,0x63,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x42,0x35,0x36,0x36,0x30,0x22,0x2c,0xa,0x22,0x76,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x46,0x35,0x39,0x36,0x32,0x22,0x2c,0xa,0x22,0x62,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x31,0x35,0x31,0x37,0x45,0x22,0x2c,0xa,0x22,0x6e,
+ 0x20,0x20,0x63,0x20,0x23,0x34,0x42,0x35,0x30,0x37,0x44,0x22,0x2c,0xa,0x22,0x6d,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x31,0x35,0x43,0x36,0x37,0x22,0x2c,0xa,0x22,0x4d,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x30,0x35,0x44,0x36,0x45,0x22,0x2c,0xa,0x22,0x4e,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x43,0x35,0x44,0x37,0x44,0x22,0x2c,0xa,0x22,0x42,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x34,0x36,0x30,0x36,0x36,0x22,0x2c,0xa,0x22,0x56,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x34,0x36,0x32,0x36,0x44,0x22,0x2c,0xa,0x22,0x43,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x42,0x36,0x34,0x36,0x44,0x22,0x2c,0xa,0x22,0x5a,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x35,0x36,0x37,0x37,0x41,0x22,0x2c,0xa,0x22,0x41,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x35,0x36,0x42,0x37,0x38,0x22,0x2c,0xa,0x22,0x53,
+ 0x20,0x20,0x63,0x20,0x23,0x35,0x44,0x36,0x37,0x37,0x32,0x22,0x2c,0xa,0x22,0x44,
+ 0x20,0x20,0x63,0x20,0x23,0x36,0x42,0x36,0x42,0x36,0x42,0x22,0x2c,0xa,0x22,0x46,
+ 0x20,0x20,0x63,0x20,0x23,0x36,0x34,0x36,0x34,0x36,0x34,0x22,0x2c,0xa,0x22,0x47,
+ 0x20,0x20,0x63,0x20,0x23,0x36,0x31,0x36,0x43,0x37,0x33,0x22,0x2c,0xa,0x22,0x48,
+ 0x20,0x20,0x63,0x20,0x23,0x36,0x33,0x37,0x30,0x37,0x44,0x22,0x2c,0xa,0x22,0x4a,
+ 0x20,0x20,0x63,0x20,0x23,0x36,0x42,0x37,0x36,0x37,0x39,0x22,0x2c,0xa,0x22,0x4b,
+ 0x20,0x20,0x63,0x20,0x67,0x72,0x61,0x79,0x34,0x35,0x22,0x2c,0xa,0x22,0x4c,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x30,0x34,0x31,0x38,0x45,0x22,0x2c,0xa,0x22,0x50,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x30,0x34,0x34,0x39,0x34,0x22,0x2c,0xa,0x22,0x49,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x30,0x34,0x38,0x39,0x34,0x22,0x2c,0xa,0x22,0x55,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x34,0x34,0x46,0x39,0x38,0x22,0x2c,0xa,0x22,0x59,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x33,0x35,0x30,0x39,0x42,0x22,0x2c,0xa,0x22,0x54,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x41,0x35,0x31,0x39,0x38,0x22,0x2c,0xa,0x22,0x52,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x33,0x35,0x37,0x39,0x43,0x22,0x2c,0xa,0x22,0x45,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x38,0x35,0x44,0x41,0x31,0x22,0x2c,0xa,0x22,0x57,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x38,0x35,0x38,0x38,0x38,0x22,0x2c,0xa,0x22,0x51,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x42,0x36,0x30,0x39,0x34,0x22,0x2c,0xa,0x22,0x21,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x39,0x36,0x44,0x39,0x41,0x22,0x2c,0xa,0x22,0x7e,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x33,0x36,0x41,0x39,0x36,0x22,0x2c,0xa,0x22,0x5e,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x44,0x37,0x31,0x39,0x42,0x22,0x2c,0xa,0x22,0x2f,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x32,0x36,0x45,0x42,0x38,0x22,0x2c,0xa,0x22,0x28,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x32,0x36,0x45,0x41,0x38,0x22,0x2c,0xa,0x22,0x29,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x32,0x36,0x42,0x41,0x33,0x22,0x2c,0xa,0x22,0x5f,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x36,0x37,0x33,0x41,0x45,0x22,0x2c,0xa,0x22,0x60,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x41,0x37,0x36,0x42,0x34,0x22,0x2c,0xa,0x22,0x27,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x42,0x36,0x46,0x44,0x31,0x22,0x2c,0xa,0x22,0x5d,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x46,0x37,0x35,0x44,0x38,0x22,0x2c,0xa,0x22,0x5b,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x34,0x37,0x39,0x44,0x41,0x22,0x2c,0xa,0x22,0x7b,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x42,0x37,0x43,0x44,0x43,0x22,0x2c,0xa,0x22,0x7d,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x36,0x36,0x34,0x38,0x31,0x22,0x2c,0xa,0x22,0x7c,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x32,0x37,0x34,0x39,0x43,0x22,0x2c,0xa,0x22,0x20,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x41,0x37,0x39,0x39,0x45,0x22,0x2c,0xa,0x22,0x2e,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x30,0x36,0x41,0x38,0x34,0x22,0x2c,0xa,0x22,0x58,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x46,0x36,0x37,0x38,0x44,0x22,0x2c,0xa,0x22,0x6f,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x37,0x36,0x33,0x39,0x31,0x22,0x2c,0xa,0x22,0x4f,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x41,0x36,0x35,0x39,0x32,0x22,0x2c,0xa,0x22,0x2b,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x46,0x36,0x38,0x39,0x33,0x22,0x2c,0xa,0x22,0x40,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x42,0x37,0x33,0x38,0x42,0x22,0x2c,0xa,0x22,0x23,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x30,0x37,0x44,0x41,0x31,0x22,0x2c,0xa,0x22,0x24,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x32,0x36,0x32,0x38,0x33,0x22,0x2c,0xa,0x22,0x25,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x33,0x36,0x41,0x39,0x34,0x22,0x2c,0xa,0x22,0x26,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x35,0x36,0x46,0x39,0x38,0x22,0x2c,0xa,0x22,0x2a,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x35,0x37,0x41,0x38,0x46,0x22,0x2c,0xa,0x22,0x3d,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x42,0x37,0x32,0x39,0x39,0x22,0x2c,0xa,0x22,0x2d,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x31,0x37,0x31,0x39,0x31,0x22,0x2c,0xa,0x22,0x3b,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x39,0x37,0x39,0x39,0x38,0x22,0x2c,0xa,0x22,0x3a,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x38,0x37,0x42,0x41,0x36,0x22,0x2c,0xa,0x22,0x3e,0x2e,
+ 0x20,0x63,0x20,0x23,0x32,0x32,0x38,0x31,0x44,0x43,0x22,0x2c,0xa,0x22,0x2c,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x46,0x38,0x31,0x43,0x30,0x22,0x2c,0xa,0x22,0x3c,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x39,0x38,0x38,0x44,0x37,0x22,0x2c,0xa,0x22,0x31,0x2e,
+ 0x20,0x63,0x20,0x23,0x32,0x37,0x38,0x35,0x45,0x31,0x22,0x2c,0xa,0x22,0x32,0x2e,
+ 0x20,0x63,0x20,0x23,0x32,0x45,0x38,0x41,0x45,0x33,0x22,0x2c,0xa,0x22,0x33,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x36,0x38,0x46,0x45,0x35,0x22,0x2c,0xa,0x22,0x34,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x36,0x39,0x30,0x45,0x36,0x22,0x2c,0xa,0x22,0x35,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x44,0x39,0x33,0x45,0x37,0x22,0x2c,0xa,0x22,0x36,0x2e,
+ 0x20,0x63,0x20,0x23,0x33,0x44,0x39,0x34,0x45,0x39,0x22,0x2c,0xa,0x22,0x37,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x37,0x38,0x33,0x39,0x45,0x22,0x2c,0xa,0x22,0x38,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x37,0x38,0x37,0x42,0x43,0x22,0x2c,0xa,0x22,0x39,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x38,0x30,0x41,0x31,0x22,0x2c,0xa,0x22,0x30,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x42,0x38,0x34,0x41,0x33,0x22,0x2c,0xa,0x22,0x71,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x45,0x38,0x34,0x39,0x36,0x22,0x2c,0xa,0x22,0x77,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x45,0x38,0x42,0x39,0x41,0x22,0x2c,0xa,0x22,0x65,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x44,0x38,0x34,0x38,0x45,0x22,0x2c,0xa,0x22,0x72,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x32,0x38,0x35,0x39,0x37,0x22,0x2c,0xa,0x22,0x74,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x33,0x38,0x35,0x39,0x38,0x22,0x2c,0xa,0x22,0x79,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x36,0x38,0x38,0x39,0x39,0x22,0x2c,0xa,0x22,0x75,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x42,0x38,0x42,0x39,0x42,0x22,0x2c,0xa,0x22,0x69,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x34,0x38,0x39,0x41,0x35,0x22,0x2c,0xa,0x22,0x70,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x39,0x38,0x45,0x41,0x37,0x22,0x2c,0xa,0x22,0x61,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x44,0x38,0x46,0x41,0x39,0x22,0x2c,0xa,0x22,0x73,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x45,0x38,0x31,0x41,0x42,0x22,0x2c,0xa,0x22,0x64,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x36,0x38,0x33,0x41,0x36,0x22,0x2c,0xa,0x22,0x66,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x36,0x38,0x43,0x42,0x37,0x22,0x2c,0xa,0x22,0x67,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x33,0x39,0x35,0x41,0x44,0x22,0x2c,0xa,0x22,0x68,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x39,0x36,0x42,0x30,0x22,0x2c,0xa,0x22,0x6a,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x30,0x38,0x36,0x43,0x41,0x22,0x2c,0xa,0x22,0x6b,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x39,0x38,0x36,0x43,0x33,0x22,0x2c,0xa,0x22,0x6c,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x32,0x38,0x34,0x43,0x33,0x22,0x2c,0xa,0x22,0x7a,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x39,0x38,0x45,0x44,0x32,0x22,0x2c,0xa,0x22,0x78,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x44,0x39,0x35,0x44,0x42,0x22,0x2c,0xa,0x22,0x63,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x38,0x44,0x43,0x35,0x22,0x2c,0xa,0x22,0x76,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x44,0x39,0x32,0x43,0x38,0x22,0x2c,0xa,0x22,0x62,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x35,0x39,0x33,0x43,0x39,0x22,0x2c,0xa,0x22,0x6e,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x30,0x39,0x37,0x44,0x45,0x22,0x2c,0xa,0x22,0x6d,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x31,0x39,0x38,0x44,0x45,0x22,0x2c,0xa,0x22,0x4d,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x32,0x39,0x36,0x45,0x37,0x22,0x2c,0xa,0x22,0x4e,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x38,0x39,0x35,0x45,0x32,0x22,0x2c,0xa,0x22,0x42,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x42,0x39,0x39,0x45,0x35,0x22,0x2c,0xa,0x22,0x56,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x41,0x39,0x43,0x45,0x42,0x22,0x2c,0xa,0x22,0x43,0x2e,
+ 0x20,0x63,0x20,0x23,0x34,0x35,0x39,0x39,0x45,0x42,0x22,0x2c,0xa,0x22,0x5a,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x32,0x39,0x44,0x45,0x36,0x22,0x2c,0xa,0x22,0x41,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x38,0x39,0x45,0x45,0x32,0x22,0x2c,0xa,0x22,0x53,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x41,0x31,0x45,0x42,0x22,0x2c,0xa,0x22,0x44,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x41,0x41,0x31,0x45,0x36,0x22,0x2c,0xa,0x22,0x46,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x41,0x41,0x35,0x45,0x42,0x22,0x2c,0xa,0x22,0x47,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x45,0x41,0x38,0x45,0x46,0x22,0x2c,0xa,0x22,0x48,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x33,0x41,0x33,0x46,0x31,0x22,0x2c,0xa,0x22,0x4a,0x2e,
+ 0x20,0x63,0x20,0x23,0x35,0x45,0x41,0x41,0x46,0x32,0x22,0x2c,0xa,0x22,0x4b,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x36,0x39,0x39,0x43,0x42,0x22,0x2c,0xa,0x22,0x4c,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x39,0x39,0x42,0x43,0x38,0x22,0x2c,0xa,0x22,0x50,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x45,0x41,0x36,0x43,0x39,0x22,0x2c,0xa,0x22,0x49,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x30,0x41,0x32,0x45,0x35,0x22,0x2c,0xa,0x22,0x55,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x35,0x41,0x37,0x45,0x38,0x22,0x2c,0xa,0x22,0x59,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x42,0x41,0x42,0x45,0x39,0x22,0x2c,0xa,0x22,0x54,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x38,0x41,0x44,0x46,0x32,0x22,0x2c,0xa,0x22,0x52,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x37,0x42,0x30,0x46,0x35,0x22,0x2c,0xa,0x22,0x45,0x2e,
+ 0x20,0x63,0x20,0x23,0x36,0x44,0x42,0x33,0x46,0x36,0x22,0x2c,0xa,0x22,0x57,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x30,0x41,0x44,0x45,0x41,0x22,0x2c,0xa,0x22,0x51,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x35,0x42,0x30,0x45,0x39,0x22,0x2c,0xa,0x22,0x21,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x42,0x35,0x45,0x42,0x22,0x2c,0xa,0x22,0x7e,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x33,0x42,0x39,0x46,0x38,0x22,0x2c,0xa,0x22,0x5e,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x42,0x42,0x44,0x46,0x42,0x22,0x2c,0xa,0x22,0x2f,0x2e,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x42,0x41,0x46,0x36,0x22,0x2c,0xa,0x22,0x28,0x2e,
+ 0x20,0x63,0x20,0x67,0x72,0x61,0x79,0x35,0x35,0x22,0x2c,0xa,0x22,0x29,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x32,0x38,0x38,0x39,0x39,0x22,0x2c,0xa,0x22,0x5f,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x34,0x39,0x34,0x39,0x45,0x22,0x2c,0xa,0x22,0x60,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x31,0x38,0x45,0x38,0x41,0x22,0x2c,0xa,0x22,0x27,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x34,0x39,0x34,0x39,0x34,0x22,0x2c,0xa,0x22,0x5d,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x46,0x38,0x46,0x41,0x39,0x22,0x2c,0xa,0x22,0x5b,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x39,0x39,0x37,0x41,0x35,0x22,0x2c,0xa,0x22,0x7b,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x41,0x39,0x41,0x41,0x39,0x22,0x2c,0xa,0x22,0x7d,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x41,0x39,0x42,0x41,0x46,0x22,0x2c,0xa,0x22,0x7c,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x33,0x39,0x39,0x41,0x39,0x22,0x2c,0xa,0x22,0x20,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x46,0x41,0x41,0x42,0x35,0x22,0x2c,0xa,0x22,0x2e,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x39,0x45,0x39,0x42,0x22,0x2c,0xa,0x22,0x58,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x41,0x37,0x41,0x37,0x22,0x2c,0xa,0x22,0x6f,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x42,0x41,0x42,0x41,0x42,0x22,0x2c,0xa,0x22,0x4f,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x33,0x41,0x33,0x42,0x34,0x22,0x2c,0xa,0x22,0x2b,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x38,0x41,0x38,0x42,0x37,0x22,0x2c,0xa,0x22,0x40,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x33,0x41,0x42,0x42,0x33,0x22,0x2c,0xa,0x22,0x23,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x34,0x42,0x35,0x42,0x35,0x22,0x2c,0xa,0x22,0x24,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x30,0x42,0x30,0x42,0x43,0x22,0x2c,0xa,0x22,0x25,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x37,0x42,0x39,0x42,0x43,0x22,0x2c,0xa,0x22,0x26,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x42,0x37,0x42,0x33,0x22,0x2c,0xa,0x22,0x2a,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x2c,0xa,0x22,0x3d,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x32,0x42,0x31,0x44,0x42,0x22,0x2c,0xa,0x22,0x2d,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x31,0x42,0x37,0x45,0x43,0x22,0x2c,0xa,0x22,0x3b,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x38,0x42,0x42,0x45,0x44,0x22,0x2c,0xa,0x22,0x3a,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x36,0x42,0x41,0x45,0x44,0x22,0x2c,0xa,0x22,0x3e,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x45,0x42,0x42,0x43,0x38,0x22,0x2c,0xa,0x22,0x2c,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x36,0x42,0x44,0x43,0x44,0x22,0x2c,0xa,0x22,0x3c,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x42,0x43,0x43,0x33,0x22,0x2c,0xa,0x22,0x31,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x31,0x43,0x31,0x46,0x36,0x22,0x2c,0xa,0x22,0x32,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x33,0x43,0x32,0x46,0x41,0x22,0x2c,0xa,0x22,0x33,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x39,0x43,0x34,0x46,0x41,0x22,0x2c,0xa,0x22,0x34,0x58,0x20,
+ 0x63,0x20,0x23,0x38,0x43,0x43,0x38,0x46,0x43,0x22,0x2c,0xa,0x22,0x35,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x35,0x43,0x32,0x45,0x46,0x22,0x2c,0xa,0x22,0x36,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x33,0x43,0x42,0x46,0x44,0x22,0x2c,0xa,0x22,0x37,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x42,0x43,0x46,0x46,0x46,0x22,0x2c,0xa,0x22,0x38,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x44,0x30,0x46,0x43,0x22,0x2c,0xa,0x22,0x39,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x43,0x44,0x33,0x46,0x45,0x22,0x2c,0xa,0x22,0x30,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x45,0x43,0x30,0x43,0x31,0x22,0x2c,0xa,0x22,0x71,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x33,0x43,0x37,0x45,0x37,0x22,0x2c,0xa,0x22,0x77,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x43,0x41,0x46,0x31,0x22,0x2c,0xa,0x22,0x65,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x31,0x44,0x34,0x46,0x46,0x22,0x2c,0xa,0x22,0x72,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x33,0x44,0x38,0x46,0x46,0x22,0x2c,0xa,0x22,0x74,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x44,0x42,0x46,0x46,0x22,0x2c,0xa,0x22,0x79,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x30,0x44,0x31,0x46,0x32,0x22,0x2c,0xa,0x22,0x75,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x44,0x39,0x46,0x34,0x22,0x2c,0xa,0x22,0x69,0x58,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x45,0x30,0x46,0x46,0x22,0x2c,0xa,0x22,0x70,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x45,0x31,0x46,0x46,0x22,0x2c,0xa,0x22,0x61,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x39,0x45,0x36,0x46,0x46,0x22,0x2c,0xa,0x22,0x73,0x58,0x20,
+ 0x63,0x20,0x23,0x42,0x45,0x45,0x39,0x46,0x46,0x22,0x2c,0xa,0x22,0x64,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x43,0x34,0x43,0x34,0x22,0x2c,0xa,0x22,0x66,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x43,0x35,0x43,0x44,0x22,0x2c,0xa,0x22,0x67,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x43,0x38,0x43,0x42,0x22,0x2c,0xa,0x22,0x68,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x43,0x37,0x43,0x34,0x22,0x2c,0xa,0x22,0x6a,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x43,0x38,0x43,0x36,0x22,0x2c,0xa,0x22,0x6b,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x43,0x43,0x43,0x42,0x22,0x2c,0xa,0x22,0x6c,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x44,0x30,0x43,0x45,0x22,0x2c,0xa,0x22,0x7a,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x33,0x44,0x33,0x44,0x33,0x22,0x2c,0xa,0x22,0x78,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x44,0x37,0x44,0x39,0x22,0x2c,0xa,0x22,0x63,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x38,0x44,0x38,0x44,0x37,0x22,0x2c,0xa,0x22,0x76,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x44,0x42,0x44,0x42,0x22,0x2c,0xa,0x22,0x62,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x45,0x43,0x46,0x46,0x22,0x2c,0xa,0x22,0x6e,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x39,0x45,0x30,0x46,0x36,0x22,0x2c,0xa,0x22,0x6d,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x46,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x4d,0x58,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x46,0x32,0x46,0x46,0x22,0x2c,0xa,0x22,0x4e,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x35,0x45,0x36,0x46,0x37,0x22,0x2c,0xa,0x22,0x42,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x45,0x42,0x46,0x39,0x22,0x2c,0xa,0x22,0x56,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x43,0x46,0x44,0x46,0x46,0x22,0x2c,0xa,0x22,0x43,0x58,0x20,
+ 0x63,0x20,0x23,0x44,0x33,0x46,0x31,0x46,0x35,0x22,0x2c,0xa,0x22,0x5a,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x45,0x30,0x44,0x45,0x22,0x2c,0xa,0x22,0x41,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x45,0x33,0x45,0x33,0x22,0x2c,0xa,0x22,0x53,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x45,0x37,0x45,0x41,0x22,0x2c,0xa,0x22,0x44,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x45,0x38,0x45,0x39,0x22,0x2c,0xa,0x22,0x46,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x45,0x36,0x45,0x34,0x22,0x2c,0xa,0x22,0x47,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x44,0x45,0x39,0x45,0x35,0x22,0x2c,0xa,0x22,0x48,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x42,0x45,0x42,0x45,0x42,0x22,0x2c,0xa,0x22,0x4a,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x45,0x45,0x46,0x35,0x22,0x2c,0xa,0x22,0x4b,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x41,0x46,0x32,0x46,0x41,0x22,0x2c,0xa,0x22,0x4c,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x45,0x45,0x45,0x41,0x22,0x2c,0xa,0x22,0x50,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x33,0x46,0x33,0x46,0x33,0x22,0x2c,0xa,0x22,0x49,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x46,0x38,0x46,0x43,0x22,0x2c,0xa,0x22,0x55,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x46,0x44,0x46,0x43,0x22,0x2c,0xa,0x22,0x59,0x58,0x20,
+ 0x63,0x20,0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,
+ 0x6c,0x73,0x20,0x2a,0x2f,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x79,0x20,0x79,0x20,0x65,0x20,0x36,
+ 0x20,0x36,0x20,0x32,0x20,0x3c,0x20,0x3c,0x20,0x2c,0x20,0x2c,0x20,0x31,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x32,0x20,0x3c,0x20,0x2c,0x20,0x2c,0x20,0x71,0x20,0x77,0x20,0x32,0x20,0x65,
+ 0x20,0x72,0x20,0x72,0x20,0x72,0x20,0x77,0x20,0x65,0x20,0x77,0x20,0x72,0x20,0x65,
+ 0x20,0x32,0x20,0x36,0x20,0x31,0x20,0x36,0x20,0x73,0x20,0x3a,0x2e,0x66,0x2e,0x4c,
+ 0x2e,0x79,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x78,0x20,0x64,0x2e,0x73,0x2e,0x3a,0x2e,0x61,0x20,0x23,
+ 0x20,0x24,0x20,0x24,0x20,0x25,0x20,0x2d,0x20,0x35,0x20,0x33,0x20,0x38,0x20,0x75,
+ 0x20,0x68,0x20,0x6b,0x20,0x42,0x20,0x53,0x20,0x4a,0x20,0x29,0x2e,0x2c,0x58,0x46,
+ 0x2e,0x62,0x2e,0x37,0x2e,0x72,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x26,0x2e,0x6d,0x58,0x7e,0x2e,0x38,
+ 0x2e,0x56,0x20,0x23,0x58,0x23,0x58,0x25,0x58,0x64,0x58,0x66,0x58,0x7a,0x58,0x78,
+ 0x58,0x76,0x58,0x5a,0x58,0x5a,0x58,0x44,0x58,0x46,0x58,0x46,0x58,0x44,0x58,0x4c,
+ 0x58,0x44,0x58,0x3e,0x2e,0x55,0x20,0x69,0x20,0x39,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x6f,0x2e,0x32,
+ 0x58,0x5d,0x20,0x4c,0x20,0x43,0x20,0x55,0x58,0x44,0x58,0x63,0x58,0x7a,0x58,0x6b,
+ 0x58,0x6b,0x58,0x6b,0x58,0x6a,0x58,0x6a,0x58,0x64,0x58,0x64,0x58,0x25,0x58,0x25,
+ 0x58,0x26,0x58,0x25,0x58,0x2a,0x58,0x4e,0x2e,0x27,0x20,0x7e,0x20,0x36,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x6f,0x2e,0x31,0x58,0x5d,0x20,0x50,0x20,0x6b,0x20,0x68,0x58,0x6f,0x58,0x58,
+ 0x58,0x58,0x58,0x6f,0x58,0x6f,0x58,0x23,0x58,0x23,0x58,0x2a,0x58,0x25,0x58,0x26,
+ 0x58,0x25,0x58,0x25,0x58,0x64,0x58,0x6b,0x58,0x78,0x58,0x78,0x2e,0x5b,0x20,0x7e,
+ 0x20,0x36,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x4f,0x2e,0x33,0x58,0x5b,0x20,0x49,0x20,0x6d,0x20,0x46,
+ 0x58,0x6b,0x58,0x6a,0x58,0x6a,0x58,0x6b,0x58,0x6b,0x58,0x6b,0x58,0x6b,0x58,0x6b,
+ 0x58,0x6b,0x58,0x7a,0x58,0x7a,0x58,0x7a,0x58,0x63,0x58,0x5a,0x58,0x53,0x58,0x78,
+ 0x2e,0x7b,0x20,0x21,0x20,0x36,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x6f,0x2e,0x33,0x58,0x7b,0x20,0x49,
+ 0x20,0x53,0x20,0x55,0x58,0x76,0x58,0x78,0x58,0x7a,0x58,0x6b,0x58,0x6b,0x58,0x6b,
+ 0x58,0x6b,0x58,0x6b,0x58,0x6a,0x58,0x64,0x58,0x2a,0x58,0x25,0x58,0x23,0x58,0x26,
+ 0x58,0x25,0x58,0x5a,0x2e,0x31,0x2e,0x5e,0x20,0x39,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x4f,0x2e,0x34,
+ 0x58,0x3e,0x2e,0x55,0x20,0x6a,0x20,0x6a,0x58,0x23,0x58,0x23,0x58,0x23,0x58,0x25,
+ 0x58,0x64,0x58,0x64,0x58,0x6b,0x58,0x7a,0x58,0x6b,0x58,0x7a,0x58,0x7a,0x58,0x63,
+ 0x58,0x76,0x58,0x44,0x58,0x4a,0x58,0x41,0x2e,0x31,0x2e,0x7c,0x20,0x36,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x4f,0x2e,0x36,0x58,0x3e,0x2e,0x54,0x20,0x56,0x20,0x50,0x58,0x5a,0x58,0x5a,
+ 0x58,0x5a,0x58,0x41,0x58,0x53,0x58,0x44,0x58,0x44,0x58,0x46,0x58,0x48,0x58,0x44,
+ 0x58,0x48,0x58,0x48,0x58,0x48,0x58,0x48,0x58,0x53,0x58,0x49,0x2e,0x32,0x2e,0x7c,
+ 0x20,0x39,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x4f,0x2e,0x36,0x58,0x32,0x2e,0x54,0x20,0x47,0x20,0x55,
+ 0x58,0x4c,0x58,0x44,0x58,0x44,0x58,0x41,0x58,0x5a,0x58,0x5a,0x58,0x41,0x58,0x5a,
+ 0x58,0x76,0x58,0x63,0x58,0x7a,0x58,0x6b,0x58,0x6b,0x58,0x6b,0x58,0x67,0x58,0x59,
+ 0x2e,0x33,0x2e,0x20,0x2e,0x36,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x4f,0x2e,0x39,0x58,0x34,0x2e,0x52,
+ 0x20,0x6d,0x20,0x7a,0x58,0x64,0x58,0x64,0x58,0x6b,0x58,0x7a,0x58,0x76,0x58,0x41,
+ 0x58,0x44,0x58,0x48,0x58,0x4c,0x58,0x50,0x58,0x50,0x58,0x49,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x51,0x2e,0x36,0x2e,0x20,0x2e,0x39,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x4f,0x2e,0x39,
+ 0x58,0x35,0x2e,0x52,0x20,0x48,0x20,0x55,0x58,0x49,0x58,0x55,0x58,0x55,0x58,0x55,
+ 0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x55,0x58,0x49,
+ 0x58,0x4b,0x58,0x4a,0x58,0x42,0x58,0x2d,0x58,0x43,0x2e,0x23,0x2e,0x39,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x4f,0x2e,0x65,0x58,0x4d,0x2e,0x2f,0x20,0x68,0x2e,0x55,0x58,0x55,0x58,0x49,
+ 0x58,0x4b,0x58,0x42,0x58,0x4e,0x58,0x6e,0x58,0x75,0x58,0x79,0x58,0x77,0x58,0x35,
+ 0x58,0x3a,0x58,0x21,0x2e,0x59,0x2e,0x59,0x2e,0x59,0x2e,0x44,0x2e,0x48,0x2e,0x39,
+ 0x2e,0x36,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x2b,0x2e,0x72,0x58,0x42,0x2e,0x3c,0x2e,0x78,0x2e,0x51,
+ 0x2e,0x3b,0x58,0x2d,0x58,0x51,0x2e,0x59,0x2e,0x55,0x2e,0x55,0x2e,0x44,0x2e,0x5a,
+ 0x2e,0x5a,0x2e,0x42,0x2e,0x42,0x2e,0x43,0x2e,0x56,0x2e,0x56,0x2e,0x42,0x2e,0x42,
+ 0x2e,0x54,0x2e,0x30,0x2e,0x39,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x2b,0x2e,0x74,0x58,0x42,0x2e,0x4e,
+ 0x2e,0x42,0x2e,0x42,0x2e,0x42,0x2e,0x42,0x2e,0x43,0x2e,0x56,0x2e,0x56,0x2e,0x48,
+ 0x2e,0x48,0x2e,0x48,0x2e,0x44,0x2e,0x4e,0x2e,0x7a,0x2e,0x38,0x2e,0x5f,0x20,0x28,
+ 0x20,0x3c,0x2e,0x44,0x2e,0x52,0x2e,0x30,0x2e,0x39,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x2b,0x2e,0x74,
+ 0x58,0x53,0x2e,0x5a,0x2e,0x46,0x2e,0x44,0x2e,0x6d,0x2e,0x7a,0x2e,0x6c,0x2e,0x60,
+ 0x20,0x29,0x20,0x51,0x20,0x57,0x20,0x70,0x20,0x73,0x20,0x7d,0x20,0x40,0x2e,0x72,
+ 0x2e,0x5b,0x2e,0x20,0x58,0x3e,0x58,0x47,0x2e,0x45,0x2e,0x30,0x2e,0x39,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x2b,0x2e,0x70,0x58,0x55,0x2e,0x6d,0x2e,0x29,0x20,0x70,0x20,0x64,0x20,0x2e,
+ 0x2e,0x2a,0x2e,0x75,0x2e,0x7c,0x2e,0x2b,0x58,0x3c,0x58,0x7a,0x58,0x5a,0x58,0x47,
+ 0x58,0x4c,0x58,0x47,0x58,0x5a,0x58,0x7a,0x58,0x6a,0x58,0x2f,0x2e,0x7e,0x2e,0x70,
+ 0x2e,0x72,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x61,0x58,0x54,0x2e,0x6b,0x2e,0x2a,0x2e,0x47,
+ 0x58,0x6c,0x58,0x26,0x58,0x2e,0x58,0x60,0x2e,0x2e,0x58,0x68,0x58,0x6c,0x58,0x7a,
+ 0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x78,0x58,0x6b,0x58,0x67,0x58,0x32,
+ 0x58,0x5e,0x2e,0x61,0x2e,0x77,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x61,0x58,0x45,0x2e,0x6b,
+ 0x2e,0x72,0x2e,0x4c,0x58,0x6f,0x58,0x6c,0x20,0x66,0x20,0x6c,0x20,0x46,0x20,0x2a,
+ 0x58,0x6c,0x58,0x7a,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x63,0x58,0x7a,
+ 0x58,0x67,0x58,0x34,0x58,0x3a,0x58,0x61,0x2e,0x77,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x62,
+ 0x58,0x7e,0x2e,0x63,0x2e,0x79,0x2e,0x4c,0x58,0x27,0x2e,0x66,0x20,0x44,0x20,0x4b,
+ 0x20,0x44,0x20,0x30,0x58,0x6b,0x58,0x7a,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x76,
+ 0x58,0x76,0x58,0x7a,0x58,0x66,0x58,0x36,0x58,0x34,0x58,0x67,0x2e,0x39,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x25,0x2e,0x62,0x58,0x5e,0x2e,0x63,0x2e,0x79,0x2e,0x4c,0x58,0x27,0x2e,0x6c,
+ 0x20,0x44,0x20,0x4b,0x20,0x44,0x20,0x30,0x58,0x6c,0x58,0x7a,0x58,0x63,0x58,0x76,
+ 0x58,0x76,0x58,0x76,0x58,0x78,0x58,0x6b,0x58,0x6b,0x58,0x39,0x58,0x36,0x58,0x77,
+ 0x2e,0x72,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x62,0x58,0x32,0x58,0x76,0x2e,0x75,0x2e,0x4c,
+ 0x58,0x27,0x2e,0x6c,0x20,0x4b,0x20,0x4b,0x20,0x4b,0x20,0x30,0x58,0x6c,0x58,0x7a,
+ 0x58,0x63,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x76,0x58,0x6b,0x58,0x66,0x58,0x39,
+ 0x58,0x50,0x2e,0x4d,0x20,0x3d,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x62,0x58,0x32,0x58,0x4b,
+ 0x2e,0x75,0x2e,0x4c,0x58,0x27,0x2e,0x6c,0x20,0x4b,0x20,0x4b,0x20,0x44,0x20,0x30,
+ 0x58,0x6c,0x58,0x78,0x58,0x63,0x58,0x76,0x58,0x5a,0x58,0x76,0x58,0x78,0x58,0x7a,
+ 0x58,0x6b,0x58,0x71,0x58,0x5a,0x20,0x3a,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x4d,
+ 0x58,0x36,0x58,0x4b,0x2e,0x75,0x2e,0x4c,0x58,0x27,0x2e,0x66,0x20,0x46,0x20,0x44,
+ 0x20,0x44,0x20,0x30,0x58,0x6b,0x58,0x7a,0x58,0x63,0x58,0x76,0x58,0x76,0x58,0x76,
+ 0x58,0x76,0x58,0x63,0x58,0x6b,0x58,0x5f,0x2e,0x3a,0x20,0x6f,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x25,0x2e,0x4d,0x58,0x36,0x58,0x4b,0x2e,0x75,0x2e,0x4c,0x58,0x58,0x58,0x28,
+ 0x2e,0x58,0x58,0x26,0x58,0x64,0x58,0x6b,0x58,0x7a,0x58,0x76,0x58,0x5a,0x58,0x44,
+ 0x58,0x41,0x58,0x7a,0x58,0x3c,0x58,0x2b,0x58,0x7d,0x2e,0x4e,0x20,0x4f,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x56,0x58,0x69,0x58,0x3d,0x58,0x7b,0x2e,0x46,
+ 0x58,0x7a,0x58,0x6b,0x58,0x6b,0x58,0x6a,0x58,0x64,0x58,0x3c,0x58,0x24,0x58,0x4f,
+ 0x58,0x5d,0x2e,0x3b,0x2e,0x24,0x2e,0x7a,0x20,0x30,0x20,0x37,0x20,0x26,0x20,0x58,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3d,0x2e,0x43,0x58,0x71,0x2e,0x41,
+ 0x20,0x29,0x2e,0x66,0x58,0x2b,0x58,0x7c,0x2e,0x29,0x2e,0x2d,0x2e,0x4e,0x20,0x7a,
+ 0x20,0x30,0x20,0x2a,0x20,0x2b,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x6e,0x20,0x24,
+ 0x2e,0x74,0x20,0x36,0x20,0x2c,0x20,0x34,0x20,0x30,0x20,0x2a,0x20,0x2b,0x20,0x2e,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x3e,0x20,0x40,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,
+ 0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,
+ 0x58,0x59,0x58,0x22,0xa,0x7d,0x3b,0xa,
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/editcopy.xpm
+ 0x0,0x0,0x12,0x99,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x65,0x64,0x69,0x74,0x63,0x6f,0x70,0x79,0x5b,0x5d,
+ 0x20,0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,0x20,
+ 0x72,0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,0x72,
+ 0x73,0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,0x22,
+ 0x33,0x32,0x20,0x33,0x32,0x20,0x31,0x35,0x35,0x20,0x32,0x22,0x2c,0xa,0x22,0x20,
+ 0x20,0x20,0x63,0x20,0x62,0x6c,0x61,0x63,0x6b,0x22,0x2c,0xa,0x22,0x2e,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x39,0x31,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x58,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x32,0x31,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x6f,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x45,0x32,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x4f,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x35,0x32,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x2b,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x33,0x33,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x40,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x39,0x33,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x23,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x35,0x33,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x24,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x44,0x34,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x42,0x35,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x26,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x32,0x34,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x2a,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x44,0x35,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x3d,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x45,0x36,0x39,0x34,0x46,0x22,0x2c,0xa,0x22,0x2d,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x45,0x37,0x39,0x35,0x46,0x22,0x2c,0xa,0x22,0x3b,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x36,0x35,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x3a,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x41,0x35,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x3e,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x42,0x36,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x2c,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x33,0x36,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x3c,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x32,0x36,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x31,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x32,0x36,0x42,0x31,0x41,0x22,0x2c,0xa,0x22,0x32,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x36,0x37,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x33,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x42,0x37,0x32,0x31,0x44,0x22,0x2c,0xa,0x22,0x34,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x42,0x37,0x36,0x32,0x35,0x22,0x2c,0xa,0x22,0x35,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x45,0x37,0x39,0x32,0x41,0x22,0x2c,0xa,0x22,0x36,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x34,0x37,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x37,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x37,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x38,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x31,0x37,0x36,0x31,0x41,0x22,0x2c,0xa,0x22,0x39,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x35,0x37,0x38,0x31,0x36,0x22,0x2c,0xa,0x22,0x30,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x34,0x37,0x39,0x31,0x44,0x22,0x2c,0xa,0x22,0x71,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x44,0x38,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x77,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x38,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x65,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x45,0x38,0x35,0x33,0x30,0x22,0x2c,0xa,0x22,0x72,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x39,0x39,0x36,0x32,0x36,0x22,0x2c,0xa,0x22,0x74,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x39,0x30,0x36,0x44,0x22,0x2c,0xa,0x22,0x79,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x31,0x38,0x44,0x34,0x38,0x22,0x2c,0xa,0x22,0x75,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x34,0x39,0x30,0x34,0x39,0x22,0x2c,0xa,0x22,0x69,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x39,0x35,0x34,0x32,0x22,0x2c,0xa,0x22,0x70,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x41,0x39,0x43,0x34,0x44,0x22,0x2c,0xa,0x22,0x61,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x39,0x45,0x35,0x32,0x22,0x2c,0xa,0x22,0x73,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x46,0x41,0x30,0x35,0x33,0x22,0x2c,0xa,0x22,0x64,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x41,0x45,0x37,0x38,0x22,0x2c,0xa,0x22,0x66,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x45,0x42,0x34,0x37,0x45,0x22,0x2c,0xa,0x22,0x67,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x39,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x68,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x39,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x6a,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x31,0x39,0x44,0x32,0x43,0x22,0x2c,0xa,0x22,0x6b,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x31,0x41,0x34,0x33,0x46,0x22,0x2c,0xa,0x22,0x6c,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x30,0x39,0x45,0x34,0x45,0x22,0x2c,0xa,0x22,0x7a,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x46,0x42,0x34,0x35,0x37,0x22,0x2c,0xa,0x22,0x78,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x39,0x42,0x31,0x35,0x39,0x22,0x2c,0xa,0x22,0x63,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x42,0x35,0x37,0x33,0x22,0x2c,0xa,0x22,0x76,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x42,0x46,0x37,0x43,0x22,0x2c,0xa,0x22,0x62,0x20,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x46,0x36,0x32,0x22,0x2c,0xa,0x22,0x6e,0x20,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x30,0x36,0x34,0x22,0x2c,0xa,0x22,0x6d,0x20,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x31,0x36,0x44,0x22,0x2c,0xa,0x22,0x4d,0x20,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x33,0x37,0x32,0x22,0x2c,0xa,0x22,0x4e,0x20,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x34,0x37,0x39,0x22,0x2c,0xa,0x22,0x42,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x31,0x39,0x44,0x38,0x45,0x22,0x2c,0xa,0x22,0x56,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x42,0x41,0x38,0x39,0x41,0x22,0x2c,0xa,0x22,0x43,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x45,0x42,0x35,0x38,0x30,0x22,0x2c,0xa,0x22,0x5a,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x42,0x34,0x38,0x38,0x22,0x2c,0xa,0x22,0x41,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x42,0x34,0x39,0x36,0x22,0x2c,0xa,0x22,0x53,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x45,0x41,0x44,0x41,0x41,0x22,0x2c,0xa,0x22,0x44,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x41,0x46,0x41,0x31,0x22,0x2c,0xa,0x22,0x46,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x43,0x42,0x42,0x42,0x36,0x22,0x2c,0xa,0x22,0x47,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x46,0x42,0x46,0x42,0x39,0x22,0x2c,0xa,0x22,0x48,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x30,0x42,0x36,0x38,0x30,0x22,0x2c,0xa,0x22,0x4a,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x42,0x41,0x38,0x35,0x22,0x2c,0xa,0x22,0x4b,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x42,0x44,0x38,0x42,0x22,0x2c,0xa,0x22,0x4c,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x42,0x35,0x38,0x39,0x22,0x2c,0xa,0x22,0x50,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x42,0x45,0x38,0x38,0x22,0x2c,0xa,0x22,0x49,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x33,0x42,0x43,0x39,0x30,0x22,0x2c,0xa,0x22,0x55,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x43,0x31,0x38,0x43,0x22,0x2c,0xa,0x22,0x59,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x43,0x34,0x39,0x33,0x22,0x2c,0xa,0x22,0x54,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x37,0x43,0x42,0x38,0x43,0x22,0x2c,0xa,0x22,0x52,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x43,0x37,0x38,0x36,0x22,0x2c,0xa,0x22,0x45,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x38,0x43,0x37,0x38,0x39,0x22,0x2c,0xa,0x22,0x57,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x41,0x43,0x39,0x38,0x42,0x22,0x2c,0xa,0x22,0x51,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x30,0x43,0x36,0x39,0x30,0x22,0x2c,0xa,0x22,0x21,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x43,0x41,0x39,0x34,0x22,0x2c,0xa,0x22,0x7e,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x43,0x43,0x39,0x42,0x22,0x2c,0xa,0x22,0x5e,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x38,0x43,0x45,0x39,0x38,0x22,0x2c,0xa,0x22,0x2f,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x43,0x44,0x32,0x39,0x43,0x22,0x2c,0xa,0x22,0x28,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x43,0x33,0x42,0x37,0x22,0x2c,0xa,0x22,0x29,0x20,0x20,
+ 0x63,0x20,0x23,0x43,0x38,0x43,0x36,0x42,0x45,0x22,0x2c,0xa,0x22,0x5f,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x35,0x43,0x35,0x41,0x35,0x22,0x2c,0xa,0x22,0x60,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x43,0x38,0x41,0x31,0x22,0x2c,0xa,0x22,0x27,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x44,0x34,0x41,0x32,0x22,0x2c,0xa,0x22,0x5d,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x45,0x44,0x39,0x41,0x45,0x22,0x2c,0xa,0x22,0x5b,0x20,0x20,
+ 0x63,0x20,0x23,0x44,0x39,0x44,0x35,0x42,0x31,0x22,0x2c,0xa,0x22,0x7b,0x20,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x43,0x43,0x38,0x32,0x22,0x2c,0xa,0x22,0x7d,0x20,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x44,0x39,0x38,0x42,0x22,0x2c,0xa,0x22,0x7c,0x20,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x44,0x39,0x39,0x31,0x22,0x2c,0xa,0x22,0x20,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x44,0x37,0x41,0x31,0x22,0x2c,0xa,0x22,0x2e,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x35,0x44,0x42,0x41,0x35,0x22,0x2c,0xa,0x22,0x58,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x44,0x43,0x41,0x42,0x22,0x2c,0xa,0x22,0x6f,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x44,0x44,0x41,0x41,0x22,0x2c,0xa,0x22,0x4f,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x44,0x43,0x42,0x32,0x22,0x2c,0xa,0x22,0x2b,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x31,0x44,0x43,0x42,0x38,0x22,0x2c,0xa,0x22,0x40,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x36,0x38,0x33,0x22,0x2c,0xa,0x22,0x23,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x37,0x38,0x41,0x22,0x2c,0xa,0x22,0x24,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x38,0x38,0x35,0x22,0x2c,0xa,0x22,0x25,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x38,0x38,0x44,0x22,0x2c,0xa,0x22,0x26,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x39,0x39,0x32,0x22,0x2c,0xa,0x22,0x2a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x43,0x39,0x44,0x22,0x2c,0xa,0x22,0x3d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x30,0x39,0x46,0x22,0x2c,0xa,0x22,0x2d,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x45,0x32,0x41,0x43,0x22,0x2c,0xa,0x22,0x3b,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x35,0x45,0x30,0x42,0x36,0x22,0x2c,0xa,0x22,0x3a,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x35,0x45,0x31,0x42,0x38,0x22,0x2c,0xa,0x22,0x3e,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x42,0x45,0x34,0x42,0x36,0x22,0x2c,0xa,0x22,0x2c,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x41,0x45,0x35,0x42,0x43,0x22,0x2c,0xa,0x22,0x3c,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x30,0x45,0x35,0x41,0x38,0x22,0x2c,0xa,0x22,0x31,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x44,0x41,0x33,0x22,0x2c,0xa,0x22,0x32,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x44,0x41,0x39,0x22,0x2c,0xa,0x22,0x33,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x45,0x38,0x42,0x38,0x22,0x2c,0xa,0x22,0x34,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x46,0x42,0x31,0x22,0x2c,0xa,0x22,0x35,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x31,0x41,0x35,0x22,0x2c,0xa,0x22,0x36,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x32,0x41,0x44,0x22,0x2c,0xa,0x22,0x37,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x32,0x42,0x34,0x22,0x2c,0xa,0x22,0x38,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x32,0x42,0x43,0x22,0x2c,0xa,0x22,0x39,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x41,0x43,0x38,0x43,0x32,0x22,0x2c,0xa,0x22,0x30,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x36,0x44,0x34,0x43,0x42,0x22,0x2c,0xa,0x22,0x71,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x46,0x44,0x41,0x43,0x35,0x22,0x2c,0xa,0x22,0x77,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x44,0x32,0x44,0x30,0x22,0x2c,0xa,0x22,0x65,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x44,0x37,0x43,0x35,0x22,0x2c,0xa,0x22,0x72,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x44,0x41,0x43,0x33,0x22,0x2c,0xa,0x22,0x74,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x44,0x45,0x43,0x37,0x22,0x2c,0xa,0x22,0x79,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x44,0x46,0x44,0x33,0x22,0x2c,0xa,0x22,0x75,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x36,0x45,0x32,0x43,0x32,0x22,0x2c,0xa,0x22,0x69,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x45,0x31,0x43,0x35,0x22,0x2c,0xa,0x22,0x70,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x42,0x45,0x33,0x43,0x42,0x22,0x2c,0xa,0x22,0x61,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x45,0x45,0x39,0x43,0x32,0x22,0x2c,0xa,0x22,0x73,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x45,0x36,0x44,0x43,0x22,0x2c,0xa,0x22,0x64,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x33,0x45,0x44,0x43,0x33,0x22,0x2c,0xa,0x22,0x66,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x32,0x45,0x44,0x43,0x42,0x22,0x2c,0xa,0x22,0x67,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x37,0x46,0x32,0x43,0x44,0x22,0x2c,0xa,0x22,0x68,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x33,0x43,0x33,0x22,0x2c,0xa,0x22,0x6a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x34,0x43,0x41,0x22,0x2c,0xa,0x22,0x6b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x38,0x43,0x35,0x22,0x2c,0xa,0x22,0x6c,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x38,0x43,0x44,0x22,0x2c,0xa,0x22,0x7a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x46,0x35,0x44,0x32,0x22,0x2c,0xa,0x22,0x78,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x37,0x44,0x38,0x22,0x2c,0xa,0x22,0x63,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x39,0x44,0x34,0x22,0x2c,0xa,0x22,0x76,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x39,0x44,0x43,0x22,0x2c,0xa,0x22,0x62,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x45,0x38,0x45,0x37,0x22,0x2c,0xa,0x22,0x6e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x33,0x45,0x46,0x45,0x33,0x22,0x2c,0xa,0x22,0x6d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x32,0x46,0x30,0x45,0x33,0x22,0x2c,0xa,0x22,0x4d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x46,0x32,0x45,0x41,0x22,0x2c,0xa,0x22,0x4e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x42,0x46,0x37,0x45,0x36,0x22,0x2c,0xa,0x22,0x42,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x46,0x39,0x45,0x33,0x22,0x2c,0xa,0x22,0x56,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x42,0x45,0x43,0x22,0x2c,0xa,0x22,0x43,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x46,0x34,0x46,0x33,0x22,0x2c,0xa,0x22,0x5a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x38,0x46,0x37,0x46,0x36,0x22,0x2c,0xa,0x22,0x41,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x46,0x43,0x46,0x34,0x22,0x2c,0xa,0x22,0x53,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x46,0x45,0x46,0x43,0x22,0x2c,0xa,0x22,0x44,0x2e,0x20,
+ 0x63,0x20,0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,
+ 0x6c,0x73,0x20,0x2a,0x2f,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x68,
+ 0x20,0x67,0x20,0x67,0x20,0x67,0x20,0x67,0x20,0x67,0x20,0x67,0x20,0x67,0x20,0x67,
+ 0x20,0x67,0x20,0x67,0x20,0x77,0x20,0x2a,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x67,0x20,0x7a,0x2e,0x7a,0x2e,0x67,0x2e,0x67,0x2e,0x67,0x2e,0x67,
+ 0x2e,0x67,0x2e,0x67,0x2e,0x7a,0x2e,0x67,0x2e,0x52,0x20,0x32,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x67,0x20,0x7a,0x2e,0x64,0x2e,0x33,0x2e,0x33,
+ 0x2e,0x33,0x2e,0x33,0x2e,0x33,0x2e,0x33,0x2e,0x3e,0x2e,0x66,0x2e,0x67,0x2e,0x7a,
+ 0x20,0x3c,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x3a,
+ 0x20,0x3b,0x20,0x2c,0x20,0x3a,0x20,0x3a,0x20,0x3a,0x20,0x37,0x20,0x61,0x20,0x69,
+ 0x20,0x61,0x20,0x52,0x20,0x2d,0x2e,0x2d,0x2e,0x2d,0x2e,0x2d,0x2e,0x27,0x20,0x6d,
+ 0x2e,0x75,0x2e,0x67,0x2e,0x6a,0x20,0x3e,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x75,0x20,0x79,0x20,0x79,0x20,0x4c,0x20,0x4c,0x20,0x4c,0x20,0x4c,0x20,0x60,
+ 0x20,0x74,0x2e,0x74,0x2e,0x65,0x2e,0x65,0x20,0x76,0x20,0x2d,0x2e,0x2d,0x2e,0x2d,
+ 0x2e,0x59,0x20,0x62,0x2e,0x53,0x2e,0x2b,0x2e,0x64,0x2e,0x71,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x53,
+ 0x2e,0x53,0x2e,0x53,0x2e,0x5a,0x2e,0x62,0x2e,0x53,0x2e,0x65,0x2e,0x69,0x20,0x57,
+ 0x20,0x6f,0x2e,0x6f,0x2e,0x4b,0x20,0x77,0x2e,0x53,0x2e,0x41,0x2e,0x75,0x2e,0x71,
+ 0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x41,
+ 0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x4d,0x2e,0x77,0x2e,0x53,0x2e,0x53,
+ 0x2e,0x5f,0x20,0x61,0x20,0x45,0x20,0x2e,0x2e,0x4b,0x20,0x30,0x2e,0x53,0x2e,0x53,
+ 0x2e,0x71,0x2e,0x37,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x53,0x2e,0x41,
+ 0x2e,0x56,0x2e,0x41,0x2e,0x41,0x2e,0x41,0x2e,0x56,0x2e,0x41,0x2e,0x6e,0x2e,0x39,
+ 0x2e,0x53,0x2e,0x53,0x2e,0x43,0x2e,0x5f,0x20,0x61,0x20,0x2e,0x2e,0x59,0x20,0x74,
+ 0x20,0x3d,0x20,0x2d,0x20,0x41,0x20,0x36,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x41,0x2e,0x41,0x2e,0x56,0x2e,0x41,0x2e,0x56,0x2e,0x56,0x2e,0x56,0x2e,0x41,
+ 0x2e,0x6e,0x2e,0x39,0x2e,0x53,0x2e,0x53,0x2e,0x53,0x2e,0x5a,0x2e,0x33,0x20,0x27,
+ 0x20,0x27,0x20,0x4b,0x20,0x5a,0x20,0x41,0x20,0x5d,0x20,0x37,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x41,0x2e,0x56,0x2e,0x42,0x2e,0x56,0x2e,0x56,0x2e,0x42,
+ 0x2e,0x56,0x2e,0x56,0x2e,0x6e,0x2e,0x28,0x20,0x46,0x20,0x53,0x20,0x53,0x20,0x47,
+ 0x20,0x35,0x20,0x27,0x20,0x7c,0x20,0x2f,0x20,0x2f,0x20,0x58,0x2e,0x66,0x2e,0x71,
+ 0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x41,0x2e,0x56,0x2e,0x78,0x2e,0x42,
+ 0x2e,0x78,0x2e,0x56,0x2e,0x42,0x2e,0x4e,0x2e,0x42,0x2e,0x65,0x2e,0x44,0x20,0x42,
+ 0x20,0x56,0x20,0x29,0x20,0x33,0x20,0x2f,0x20,0x2f,0x20,0x5e,0x20,0x5e,0x20,0x27,
+ 0x20,0x61,0x2e,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x56,0x2e,0x4e,
+ 0x2e,0x4e,0x2e,0x42,0x2e,0x42,0x2e,0x42,0x2e,0x76,0x2e,0x76,0x2e,0x4e,0x2e,0x7a,
+ 0x2e,0x70,0x2e,0x69,0x2e,0x70,0x2e,0x6e,0x2e,0x38,0x20,0x5e,0x20,0x2f,0x20,0x21,
+ 0x20,0x51,0x20,0x27,0x20,0x61,0x2e,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x42,0x2e,0x42,0x2e,0x78,0x2e,0x76,0x2e,0x78,0x2e,0x7a,0x2e,0x6a,0x2e,0x6a,
+ 0x2e,0x78,0x2e,0x7a,0x2e,0x7a,0x2e,0x63,0x2e,0x42,0x2e,0x42,0x2e,0x30,0x20,0x21,
+ 0x20,0x21,0x20,0x21,0x20,0x5e,0x20,0x27,0x20,0x2c,0x2e,0x71,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x42,0x2e,0x68,0x2e,0x68,0x2e,0x7a,0x2e,0x7a,0x2e,0x78,
+ 0x2e,0x78,0x2e,0x7a,0x2e,0x7a,0x2e,0x7a,0x2e,0x68,0x2e,0x6a,0x2e,0x78,0x2e,0x76,
+ 0x2e,0x30,0x20,0x21,0x20,0x51,0x20,0x59,0x20,0x21,0x20,0x7e,0x20,0x2c,0x2e,0x71,
+ 0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x76,0x2e,0x63,0x2e,0x6b,0x2e,0x78,
+ 0x2e,0x68,0x2e,0x6a,0x2e,0x6a,0x2e,0x6a,0x2e,0x7a,0x2e,0x38,0x2e,0x68,0x2e,0x6b,
+ 0x2e,0x6a,0x2e,0x76,0x2e,0x30,0x20,0x55,0x20,0x54,0x20,0x55,0x20,0x55,0x20,0x7e,
+ 0x20,0x2c,0x2e,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x76,0x2e,0x6b,
+ 0x2e,0x7a,0x2e,0x68,0x2e,0x68,0x2e,0x68,0x2e,0x6a,0x2e,0x38,0x2e,0x6a,0x2e,0x68,
+ 0x2e,0x68,0x2e,0x6a,0x2e,0x6b,0x2e,0x76,0x2e,0x30,0x20,0x55,0x20,0x55,0x20,0x55,
+ 0x20,0x55,0x20,0x59,0x20,0x3b,0x2e,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x78,0x2e,0x68,0x2e,0x38,0x2e,0x38,0x2e,0x68,0x2e,0x6a,0x2e,0x38,0x2e,0x38,
+ 0x2e,0x34,0x2e,0x68,0x2e,0x34,0x2e,0x38,0x2e,0x68,0x2e,0x78,0x2e,0x38,0x20,0x50,
+ 0x20,0x48,0x20,0x50,0x20,0x50,0x20,0x7e,0x20,0x3b,0x2e,0x71,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x76,0x2e,0x68,0x2e,0x34,0x2e,0x34,0x2e,0x38,0x2e,0x38,
+ 0x2e,0x34,0x2e,0x31,0x2e,0x7a,0x2e,0x68,0x2e,0x38,0x2e,0x34,0x2e,0x68,0x2e,0x63,
+ 0x2e,0x38,0x20,0x48,0x20,0x4a,0x20,0x48,0x20,0x4a,0x20,0x59,0x20,0x3b,0x2e,0x71,
+ 0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x63,0x2e,0x32,0x2e,0x7a,0x2e,0x6a,
+ 0x2e,0x34,0x2e,0x2a,0x2e,0x31,0x2e,0x31,0x2e,0x38,0x2e,0x32,0x2e,0x32,0x2e,0x2a,
+ 0x2e,0x32,0x2e,0x6c,0x2e,0x38,0x20,0x4a,0x20,0x4a,0x20,0x48,0x20,0x4a,0x20,0x55,
+ 0x20,0x5d,0x20,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x6c,0x2e,0x68,
+ 0x2e,0x32,0x2e,0x34,0x2e,0x34,0x2e,0x31,0x2e,0x25,0x2e,0x31,0x2e,0x26,0x2e,0x32,
+ 0x2e,0x34,0x2e,0x38,0x2e,0x37,0x2e,0x6b,0x2e,0x38,0x20,0x66,0x20,0x64,0x20,0x66,
+ 0x20,0x48,0x20,0x55,0x20,0x5d,0x20,0x71,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x7a,0x2e,0x38,0x2e,0x23,0x2e,0x31,0x2e,0x34,0x2e,0x31,0x2e,0x2a,0x2e,0x31,
+ 0x2e,0x31,0x2e,0x31,0x2e,0x2a,0x2e,0x4e,0x20,0x34,0x2e,0x6c,0x2e,0x38,0x20,0x66,
+ 0x20,0x66,0x20,0x43,0x20,0x4b,0x20,0x7e,0x20,0x3a,0x2e,0x71,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x38,0x2e,0x26,0x2e,0x34,0x2e,0x23,0x2e,0x25,0x2e,0x34,
+ 0x2e,0x26,0x2e,0x40,0x2e,0x23,0x2e,0x25,0x2e,0x25,0x2e,0x26,0x2e,0x32,0x2e,0x6c,
+ 0x2e,0x38,0x20,0x4b,0x20,0x4b,0x20,0x59,0x20,0x7e,0x20,0x5d,0x20,0x2c,0x2e,0x36,
+ 0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x68,0x2e,0x26,0x2e,0x23,0x2e,0x2a,
+ 0x2e,0x31,0x2e,0x31,0x2e,0x25,0x2e,0x4e,0x20,0x4e,0x20,0x23,0x2e,0x26,0x2e,0x2a,
+ 0x2e,0x31,0x2e,0x6c,0x2e,0x30,0x20,0x27,0x20,0x5d,0x20,0x54,0x20,0x78,0x20,0x72,
+ 0x20,0x36,0x20,0x25,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x34,0x2e,0x34,
+ 0x2e,0x25,0x2e,0x2a,0x2e,0x23,0x2e,0x62,0x20,0x26,0x2e,0x4e,0x20,0x4d,0x20,0x62,
+ 0x20,0x4d,0x20,0x32,0x2e,0x31,0x2e,0x6b,0x2e,0x39,0x20,0x6b,0x20,0x37,0x20,0x3e,
+ 0x20,0x24,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x37,0x2e,0x26,0x2e,0x4e,0x20,0x35,0x2e,0x26,0x2e,0x4e,0x20,0x40,0x2e,0x2a,
+ 0x2e,0x62,0x20,0x4e,0x20,0x4d,0x20,0x4e,0x20,0x3d,0x2e,0x6b,0x2e,0x2c,0x20,0x2b,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x36,0x2e,0x4e,0x20,0x4e,0x20,0x4d,0x20,0x4d,0x20,0x26,
+ 0x2e,0x23,0x2e,0x4e,0x20,0x32,0x2e,0x24,0x2e,0x25,0x2e,0x38,0x2e,0x36,0x2e,0x3c,
+ 0x2e,0x26,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x35,0x2e,0x26,0x2e,0x37,0x2e,0x6e,
+ 0x20,0x24,0x2e,0x6d,0x20,0x4d,0x20,0x31,0x2e,0x37,0x2e,0x37,0x2e,0x6f,0x2e,0x63,
+ 0x20,0x35,0x20,0x26,0x20,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,0x20,0x37,0x2e,0x2a,
+ 0x2e,0x6d,0x20,0x25,0x2e,0x3d,0x2e,0x26,0x2e,0x37,0x2e,0x7d,0x20,0x70,0x20,0x31,
+ 0x20,0x25,0x20,0x23,0x20,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x2c,
+ 0x20,0x36,0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x7c,0x20,0x61,0x20,0x31,0x20,0x26,
+ 0x20,0x2b,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x2c,0x20,0x36,0x2e,0x2d,0x2e,0x61,0x20,0x31,0x20,0x26,0x20,0x4f,
+ 0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,0x2c,0xa,0x22,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x3b,0x20,0x3a,0x20,0x25,0x20,0x4f,0x20,0x2e,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x22,
+ 0x2c,0xa,0x22,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,0x2e,0x44,
+ 0x2e,0x44,0x2e,0x22,0xa,0x7d,0x3b,0xa,
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/filenew.xpm
+ 0x0,0x0,0x14,0x9,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x66,0x69,0x6c,0x65,0x6e,0x65,0x77,0x5b,0x5d,0x20,
+ 0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,0x20,0x72,
+ 0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,0x72,0x73,
+ 0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,0x22,0x33,
+ 0x32,0x20,0x33,0x32,0x20,0x31,0x37,0x38,0x20,0x32,0x22,0x2c,0xa,0x22,0x20,0x20,
+ 0x20,0x63,0x20,0x62,0x6c,0x61,0x63,0x6b,0x22,0x2c,0xa,0x22,0x2e,0x20,0x20,0x63,
+ 0x20,0x23,0x31,0x39,0x31,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x58,0x20,0x20,0x63,
+ 0x20,0x23,0x32,0x32,0x31,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x6f,0x20,0x20,0x63,
+ 0x20,0x23,0x34,0x35,0x32,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x4f,0x20,0x20,0x63,
+ 0x20,0x23,0x34,0x41,0x33,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x2b,0x20,0x20,0x63,
+ 0x20,0x23,0x34,0x45,0x33,0x34,0x30,0x30,0x22,0x2c,0xa,0x22,0x40,0x20,0x20,0x63,
+ 0x20,0x23,0x35,0x35,0x33,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x23,0x20,0x20,0x63,
+ 0x20,0x23,0x36,0x30,0x34,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x24,0x20,0x20,0x63,
+ 0x20,0x23,0x36,0x41,0x34,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x20,0x20,0x63,
+ 0x20,0x23,0x36,0x44,0x34,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x26,0x20,0x20,0x63,
+ 0x20,0x23,0x37,0x30,0x34,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x2a,0x20,0x20,0x63,
+ 0x20,0x23,0x37,0x32,0x34,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x3d,0x20,0x20,0x63,
+ 0x20,0x23,0x37,0x34,0x34,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x2d,0x20,0x20,0x63,
+ 0x20,0x23,0x37,0x36,0x34,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x3b,0x20,0x20,0x63,
+ 0x20,0x23,0x37,0x38,0x35,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x3a,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x30,0x35,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x3e,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x31,0x35,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x2c,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x33,0x35,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x3c,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x36,0x35,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x31,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x37,0x35,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x32,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x41,0x35,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x33,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x41,0x35,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x34,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x42,0x35,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x35,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x43,0x35,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x36,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x44,0x35,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x37,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x46,0x35,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x38,0x20,0x20,0x63,
+ 0x20,0x23,0x38,0x30,0x35,0x39,0x31,0x31,0x22,0x2c,0xa,0x22,0x39,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x30,0x35,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x30,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x30,0x36,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x71,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x32,0x36,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x77,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x34,0x36,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x65,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x35,0x36,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x72,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x36,0x36,0x34,0x30,0x30,0x22,0x2c,0xa,0x22,0x74,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x37,0x36,0x34,0x30,0x30,0x22,0x2c,0xa,0x22,0x79,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x35,0x36,0x39,0x31,0x33,0x22,0x2c,0xa,0x22,0x75,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x32,0x36,0x43,0x32,0x32,0x22,0x2c,0xa,0x22,0x69,0x20,0x20,0x63,
+ 0x20,0x23,0x39,0x42,0x37,0x37,0x33,0x32,0x22,0x2c,0xa,0x22,0x70,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x31,0x38,0x44,0x34,0x38,0x22,0x2c,0xa,0x22,0x61,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x32,0x38,0x45,0x34,0x39,0x22,0x2c,0xa,0x22,0x73,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x34,0x39,0x30,0x34,0x41,0x22,0x2c,0xa,0x22,0x64,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x41,0x41,0x33,0x37,0x33,0x22,0x2c,0xa,0x22,0x66,0x20,0x20,0x63,
+ 0x20,0x23,0x41,0x31,0x41,0x31,0x39,0x35,0x22,0x2c,0xa,0x22,0x67,0x20,0x20,0x63,
+ 0x20,0x23,0x41,0x42,0x41,0x42,0x39,0x46,0x22,0x2c,0xa,0x22,0x68,0x20,0x20,0x63,
+ 0x20,0x23,0x41,0x44,0x41,0x44,0x41,0x42,0x22,0x2c,0xa,0x22,0x6a,0x20,0x20,0x63,
+ 0x20,0x23,0x41,0x46,0x41,0x46,0x41,0x42,0x22,0x2c,0xa,0x22,0x6b,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x33,0x42,0x33,0x41,0x36,0x22,0x2c,0xa,0x22,0x6c,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x43,0x42,0x43,0x42,0x38,0x22,0x2c,0xa,0x22,0x7a,0x20,0x20,0x63,
+ 0x20,0x23,0x42,0x46,0x42,0x46,0x42,0x43,0x22,0x2c,0xa,0x22,0x78,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x42,0x42,0x34,0x38,0x39,0x22,0x2c,0xa,0x22,0x63,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x42,0x42,0x35,0x38,0x41,0x22,0x2c,0xa,0x22,0x76,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x44,0x42,0x37,0x38,0x42,0x22,0x2c,0xa,0x22,0x62,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x41,0x42,0x38,0x39,0x31,0x22,0x2c,0xa,0x22,0x6e,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x39,0x42,0x42,0x39,0x45,0x22,0x2c,0xa,0x22,0x6d,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x45,0x42,0x45,0x41,0x32,0x22,0x2c,0xa,0x22,0x4d,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x36,0x43,0x36,0x42,0x43,0x22,0x2c,0xa,0x22,0x4e,0x20,0x20,0x63,
+ 0x20,0x23,0x44,0x39,0x43,0x38,0x41,0x38,0x22,0x2c,0xa,0x22,0x42,0x20,0x20,0x63,
+ 0x20,0x23,0x45,0x38,0x45,0x31,0x42,0x41,0x22,0x2c,0xa,0x22,0x56,0x20,0x20,0x63,
+ 0x20,0x23,0x45,0x38,0x45,0x31,0x42,0x42,0x22,0x2c,0xa,0x22,0x43,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x31,0x22,0x2c,0xa,0x22,0x5a,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x41,0x30,0x22,0x2c,0xa,0x22,0x41,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x33,0x22,0x2c,0xa,0x22,0x53,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x34,0x22,0x2c,0xa,0x22,0x44,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x36,0x22,0x2c,0xa,0x22,0x46,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x38,0x22,0x2c,0xa,0x22,0x47,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x39,0x22,0x2c,0xa,0x22,0x48,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x41,0x38,0x22,0x2c,0xa,0x22,0x4a,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x41,0x22,0x2c,0xa,0x22,0x4b,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x42,0x22,0x2c,0xa,0x22,0x4c,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x41,0x42,0x22,0x2c,0xa,0x22,0x50,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x43,0x22,0x2c,0xa,0x22,0x49,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x41,0x43,0x22,0x2c,0xa,0x22,0x55,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x45,0x22,0x2c,0xa,0x22,0x59,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x41,0x46,0x22,0x2c,0xa,0x22,0x54,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x30,0x22,0x2c,0xa,0x22,0x52,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x31,0x22,0x2c,0xa,0x22,0x45,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x30,0x22,0x2c,0xa,0x22,0x57,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x34,0x22,0x2c,0xa,0x22,0x51,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x35,0x22,0x2c,0xa,0x22,0x21,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x34,0x22,0x2c,0xa,0x22,0x7e,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x38,0x22,0x2c,0xa,0x22,0x5e,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x39,0x22,0x2c,0xa,0x22,0x2f,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x38,0x22,0x2c,0xa,0x22,0x28,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x39,0x22,0x2c,0xa,0x22,0x29,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x42,0x22,0x2c,0xa,0x22,0x5f,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x41,0x22,0x2c,0xa,0x22,0x60,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x44,0x22,0x2c,0xa,0x22,0x27,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x44,0x22,0x2c,0xa,0x22,0x5d,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x42,0x45,0x22,0x2c,0xa,0x22,0x5b,0x20,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x42,0x45,0x22,0x2c,0xa,0x22,0x7b,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x38,0x43,0x38,0x43,0x31,0x22,0x2c,0xa,0x22,0x7d,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x41,0x43,0x41,0x43,0x34,0x22,0x2c,0xa,0x22,0x7c,0x20,0x20,0x63,
+ 0x20,0x23,0x43,0x42,0x43,0x42,0x43,0x36,0x22,0x2c,0xa,0x22,0x20,0x2e,0x20,0x63,
+ 0x20,0x23,0x44,0x42,0x44,0x32,0x43,0x31,0x22,0x2c,0xa,0x22,0x2e,0x2e,0x20,0x63,
+ 0x20,0x23,0x44,0x45,0x44,0x46,0x43,0x46,0x22,0x2c,0xa,0x22,0x58,0x2e,0x20,0x63,
+ 0x20,0x23,0x44,0x34,0x44,0x34,0x44,0x31,0x22,0x2c,0xa,0x22,0x6f,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x31,0x44,0x35,0x43,0x31,0x22,0x2c,0xa,0x22,0x4f,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x33,0x44,0x39,0x43,0x33,0x22,0x2c,0xa,0x22,0x2b,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x35,0x44,0x43,0x43,0x43,0x22,0x2c,0xa,0x22,0x40,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x38,0x45,0x38,0x44,0x33,0x22,0x2c,0xa,0x22,0x23,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x43,0x45,0x43,0x44,0x37,0x22,0x2c,0xa,0x22,0x24,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x30,0x45,0x42,0x44,0x41,0x22,0x2c,0xa,0x22,0x25,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x32,0x22,0x2c,0xa,0x22,0x26,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x33,0x22,0x2c,0xa,0x22,0x2a,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x43,0x32,0x22,0x2c,0xa,0x22,0x3d,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x37,0x22,0x2c,0xa,0x22,0x2d,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x43,0x37,0x22,0x2c,0xa,0x22,0x3b,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x42,0x22,0x2c,0xa,0x22,0x3a,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x43,0x22,0x2c,0xa,0x22,0x3e,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x43,0x43,0x22,0x2c,0xa,0x22,0x2c,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x43,0x45,0x22,0x2c,0xa,0x22,0x3c,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x30,0x22,0x2c,0xa,0x22,0x31,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x31,0x22,0x2c,0xa,0x22,0x32,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x30,0x22,0x2c,0xa,0x22,0x33,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x31,0x22,0x2c,0xa,0x22,0x34,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x33,0x22,0x2c,0xa,0x22,0x35,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x35,0x22,0x2c,0xa,0x22,0x36,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x35,0x22,0x2c,0xa,0x22,0x37,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x36,0x22,0x2c,0xa,0x22,0x38,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x37,0x22,0x2c,0xa,0x22,0x39,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x36,0x22,0x2c,0xa,0x22,0x30,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x38,0x22,0x2c,0xa,0x22,0x71,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x41,0x22,0x2c,0xa,0x22,0x77,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x41,0x22,0x2c,0xa,0x22,0x65,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x42,0x22,0x2c,0xa,0x22,0x72,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x43,0x22,0x2c,0xa,0x22,0x74,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x45,0x22,0x2c,0xa,0x22,0x79,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x44,0x46,0x22,0x2c,0xa,0x22,0x75,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x45,0x22,0x2c,0xa,0x22,0x69,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x46,0x44,0x46,0x22,0x2c,0xa,0x22,0x70,0x2e,0x20,0x63,
+ 0x20,0x23,0x45,0x39,0x45,0x39,0x45,0x37,0x22,0x2c,0xa,0x22,0x61,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x33,0x46,0x33,0x45,0x39,0x22,0x2c,0xa,0x22,0x73,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x33,0x46,0x33,0x45,0x42,0x22,0x2c,0xa,0x22,0x64,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x35,0x46,0x35,0x45,0x38,0x22,0x2c,0xa,0x22,0x66,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x38,0x46,0x38,0x45,0x33,0x22,0x2c,0xa,0x22,0x67,0x2e,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x30,0x22,0x2c,0xa,0x22,0x68,0x2e,0x20,0x63,
+ 0x20,0x4c,0x69,0x67,0x68,0x74,0x59,0x65,0x6c,0x6c,0x6f,0x77,0x22,0x2c,0xa,0x22,
+ 0x6a,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x31,0x22,0x2c,0xa,0x22,
+ 0x6b,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x33,0x22,0x2c,0xa,0x22,
+ 0x6c,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x33,0x22,0x2c,0xa,0x22,
+ 0x7a,0x2e,0x20,0x63,0x20,0x23,0x46,0x44,0x46,0x45,0x45,0x37,0x22,0x2c,0xa,0x22,
+ 0x78,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x34,0x22,0x2c,0xa,0x22,
+ 0x63,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x35,0x22,0x2c,0xa,0x22,
+ 0x76,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x34,0x22,0x2c,0xa,0x22,
+ 0x62,0x2e,0x20,0x63,0x20,0x23,0x46,0x42,0x46,0x42,0x45,0x39,0x22,0x2c,0xa,0x22,
+ 0x6e,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x38,0x22,0x2c,0xa,0x22,
+ 0x6d,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x38,0x22,0x2c,0xa,0x22,
+ 0x4d,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x39,0x22,0x2c,0xa,0x22,
+ 0x4e,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x41,0x22,0x2c,0xa,0x22,
+ 0x42,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x43,0x22,0x2c,0xa,0x22,
+ 0x56,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x44,0x22,0x2c,0xa,0x22,
+ 0x43,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x43,0x22,0x2c,0xa,0x22,
+ 0x5a,0x2e,0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x45,0x44,0x22,0x2c,0xa,0x22,
+ 0x41,0x2e,0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x45,0x46,0x22,0x2c,0xa,0x22,
+ 0x53,0x2e,0x20,0x63,0x20,0x23,0x46,0x34,0x46,0x34,0x46,0x30,0x22,0x2c,0xa,0x22,
+ 0x44,0x2e,0x20,0x63,0x20,0x23,0x46,0x34,0x46,0x34,0x46,0x33,0x22,0x2c,0xa,0x22,
+ 0x46,0x2e,0x20,0x63,0x20,0x23,0x46,0x35,0x46,0x35,0x46,0x34,0x22,0x2c,0xa,0x22,
+ 0x47,0x2e,0x20,0x63,0x20,0x23,0x46,0x38,0x46,0x38,0x46,0x36,0x22,0x2c,0xa,0x22,
+ 0x48,0x2e,0x20,0x63,0x20,0x69,0x76,0x6f,0x72,0x79,0x22,0x2c,0xa,0x22,0x4a,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x31,0x22,0x2c,0xa,0x22,0x4b,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x46,0x33,0x22,0x2c,0xa,0x22,0x4c,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x33,0x22,0x2c,0xa,0x22,0x50,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x46,0x34,0x22,0x2c,0xa,0x22,0x49,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x34,0x22,0x2c,0xa,0x22,0x55,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x46,0x37,0x22,0x2c,0xa,0x22,0x59,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x36,0x22,0x2c,0xa,0x22,0x54,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x37,0x22,0x2c,0xa,0x22,0x52,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x42,0x46,0x42,0x46,0x42,0x22,0x2c,0xa,0x22,0x45,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x38,0x22,0x2c,0xa,0x22,0x57,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x39,0x22,0x2c,0xa,0x22,0x51,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x41,0x22,0x2c,0xa,0x22,0x21,0x2e,
+ 0x20,0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x42,0x22,0x2c,0xa,0x22,0x7e,0x2e,
+ 0x20,0x63,0x20,0x67,0x72,0x61,0x79,0x39,0x39,0x22,0x2c,0xa,0x22,0x5e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x46,0x46,0x46,0x44,0x22,0x2c,0xa,0x22,0x2f,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x43,0x22,0x2c,0xa,0x22,0x28,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x44,0x22,0x2c,0xa,0x22,0x29,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x46,0x46,0x45,0x22,0x2c,0xa,0x22,0x5f,0x2e,0x20,
+ 0x63,0x20,0x67,0x72,0x61,0x79,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x60,0x2e,0x20,
+ 0x63,0x20,0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,
+ 0x6c,0x73,0x20,0x2a,0x2f,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x77,0x20,0x32,0x20,0x31,0x20,0x77,0x20,0x34,0x20,0x34,0x20,0x34,0x20,0x36,
+ 0x20,0x77,0x20,0x39,0x20,0x36,0x20,0x2d,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x72,0x20,0x73,0x20,0x70,0x20,0x70,0x20,0x63,0x20,0x63,0x20,0x63,
+ 0x20,0x63,0x20,0x4e,0x20,0x4f,0x2e,0x2b,0x2e,0x6f,0x2e,0x79,0x20,0x23,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x72,0x20,0x29,0x2e,0x29,0x2e,0x29,0x2e,0x29,
+ 0x2e,0x29,0x2e,0x29,0x2e,0x29,0x2e,0x29,0x2e,0x46,0x2e,0x70,0x2e,0x29,0x2e,0x20,
+ 0x2e,0x26,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x29,0x2e,0x45,
+ 0x2e,0x29,0x2e,0x45,0x2e,0x29,0x2e,0x45,0x2e,0x45,0x2e,0x45,0x2e,0x53,0x2e,0x58,
+ 0x2e,0x29,0x2e,0x52,0x2e,0x6e,0x20,0x24,0x20,0x2b,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x45,0x2e,0x59,0x2e,0x59,0x2e,0x45,0x2e,0x59,0x2e,0x45,0x2e,0x45,0x2e,0x45,
+ 0x2e,0x61,0x2e,0x7c,0x20,0x29,0x2e,0x29,0x2e,0x44,0x2e,0x6d,0x20,0x25,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x45,0x2e,0x59,0x2e,0x59,0x2e,0x4a,0x2e,0x59,0x2e,0x4a,
+ 0x2e,0x59,0x2e,0x59,0x2e,0x61,0x2e,0x7c,0x20,0x29,0x2e,0x29,0x2e,0x29,0x2e,0x44,
+ 0x2e,0x3e,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x59,0x2e,0x4a,0x2e,0x4a,0x2e,0x4a,
+ 0x2e,0x4a,0x2e,0x4a,0x2e,0x4a,0x2e,0x4a,0x2e,0x61,0x2e,0x4d,0x20,0x6c,0x20,0x68,
+ 0x20,0x68,0x20,0x7b,0x20,0x3b,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x59,0x2e,0x42,
+ 0x2e,0x42,0x2e,0x42,0x2e,0x4e,0x2e,0x4e,0x2e,0x42,0x2e,0x42,0x2e,0x62,0x2e,0x2e,
+ 0x2e,0x6b,0x20,0x66,0x20,0x68,0x20,0x7d,0x20,0x3b,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x4a,0x2e,0x4e,0x2e,0x4e,0x2e,0x4e,0x2e,0x4e,0x2e,0x4e,0x2e,0x4e,0x2e,0x4e,
+ 0x2e,0x6c,0x2e,0x66,0x2e,0x23,0x2e,0x40,0x2e,0x23,0x2e,0x61,0x2e,0x3e,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x4a,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,
+ 0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x6c,0x2e,0x4a,
+ 0x2e,0x3e,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x4a,0x2e,0x72,0x2e,0x6c,0x2e,0x6c,
+ 0x2e,0x72,0x2e,0x6c,0x2e,0x72,0x2e,0x6c,0x2e,0x72,0x2e,0x6c,0x2e,0x72,0x2e,0x6c,
+ 0x2e,0x72,0x2e,0x4a,0x2e,0x31,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x42,0x2e,0x72,
+ 0x2e,0x72,0x2e,0x71,0x2e,0x71,0x2e,0x71,0x2e,0x71,0x2e,0x71,0x2e,0x71,0x2e,0x72,
+ 0x2e,0x71,0x2e,0x71,0x2e,0x72,0x2e,0x42,0x2e,0x3e,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x4e,0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x71,0x2e,0x35,0x2e,0x35,
+ 0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x35,0x2e,0x42,0x2e,0x2c,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x4e,0x2e,0x3c,0x2e,0x3c,0x2e,0x3c,0x2e,0x3c,0x2e,0x3c,
+ 0x2e,0x3c,0x2e,0x3c,0x2e,0x35,0x2e,0x3c,0x2e,0x3c,0x2e,0x3c,0x2e,0x3c,0x2e,0x4e,
+ 0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x6c,0x2e,0x2c,0x2e,0x3b,0x2e,0x3b,
+ 0x2e,0x3b,0x2e,0x2c,0x2e,0x3b,0x2e,0x2c,0x2e,0x3b,0x2e,0x2c,0x2e,0x3b,0x2e,0x3b,
+ 0x2e,0x3b,0x2e,0x6c,0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x6c,0x2e,0x2d,
+ 0x2e,0x2d,0x2e,0x2d,0x2e,0x2d,0x2e,0x2d,0x2e,0x2d,0x2e,0x3b,0x2e,0x2d,0x2e,0x2d,
+ 0x2e,0x2d,0x2e,0x2d,0x2e,0x3b,0x2e,0x6c,0x2e,0x3e,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x6c,0x2e,0x2d,0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x25,
+ 0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x25,0x2e,0x6c,0x2e,0x2c,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x72,0x2e,0x27,0x20,0x27,0x20,0x27,0x20,0x27,0x20,0x27,
+ 0x20,0x29,0x20,0x27,0x20,0x27,0x20,0x27,0x20,0x27,0x20,0x27,0x20,0x27,0x20,0x72,
+ 0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x72,0x2e,0x29,0x20,0x29,0x20,0x57,
+ 0x20,0x29,0x20,0x29,0x20,0x29,0x20,0x29,0x20,0x29,0x20,0x29,0x20,0x57,0x20,0x29,
+ 0x20,0x29,0x20,0x71,0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x71,0x2e,0x57,
+ 0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,
+ 0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x71,0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x35,0x2e,0x59,0x20,0x59,0x20,0x57,0x20,0x59,0x20,0x59,0x20,0x59,0x20,0x59,
+ 0x20,0x59,0x20,0x59,0x20,0x59,0x20,0x59,0x20,0x59,0x20,0x35,0x2e,0x2c,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x35,0x2e,0x4a,0x20,0x4a,0x20,0x4a,0x20,0x59,0x20,0x4a,
+ 0x20,0x59,0x20,0x59,0x20,0x4a,0x20,0x59,0x20,0x4a,0x20,0x4a,0x20,0x59,0x20,0x71,
+ 0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x35,0x2e,0x4a,0x20,0x4a,0x20,0x44,
+ 0x20,0x4a,0x20,0x4a,0x20,0x44,0x20,0x4a,0x20,0x44,0x20,0x4a,0x20,0x57,0x20,0x29,
+ 0x20,0x2c,0x2e,0x24,0x2e,0x2d,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x3c,0x2e,0x5a,
+ 0x20,0x44,0x20,0x44,0x20,0x5a,0x20,0x44,0x20,0x4a,0x20,0x59,0x20,0x27,0x20,0x2c,
+ 0x2e,0x42,0x20,0x62,0x20,0x69,0x20,0x2d,0x20,0x4f,0x20,0x20,0x20,0x20,0x20,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,
+ 0x20,0x3c,0x2e,0x5a,0x20,0x5a,0x20,0x5a,0x20,0x59,0x20,0x29,0x20,0x3c,0x2e,0x42,
+ 0x20,0x64,0x20,0x75,0x20,0x26,0x20,0x40,0x20,0x58,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x77,0x20,0x2c,0x2e,0x4a,0x20,0x29,0x20,0x2c,0x2e,0x42,0x20,0x64,
+ 0x20,0x79,0x20,0x26,0x20,0x6f,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x77,0x20,0x59,0x2e,0x56,0x20,0x64,0x20,0x75,
+ 0x20,0x26,0x20,0x6f,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x31,0x20,0x34,0x20,0x26,
+ 0x20,0x6f,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,0x2c,0xa,0x22,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x22,
+ 0x2c,0xa,0x22,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,0x2e,0x60,
+ 0x2e,0x60,0x2e,0x22,0xa,0x7d,0x3b,0xa,
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/editpaste.xpm
+ 0x0,0x0,0x18,0xf8,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x65,0x64,0x69,0x74,0x70,0x61,0x73,0x74,0x65,0x5b,
+ 0x5d,0x20,0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,
+ 0x20,0x72,0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,
+ 0x72,0x73,0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,
+ 0x22,0x33,0x32,0x20,0x33,0x32,0x20,0x32,0x35,0x37,0x20,0x32,0x22,0x2c,0xa,0x22,
+ 0x20,0x20,0x20,0x63,0x20,0x62,0x6c,0x61,0x63,0x6b,0x22,0x2c,0xa,0x22,0x2e,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x44,0x30,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x58,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x39,0x31,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x6f,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x32,0x31,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x4f,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x41,0x31,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x2b,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x33,0x32,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x40,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x45,0x32,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x23,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x41,0x32,0x38,0x30,0x34,0x22,0x2c,0xa,0x22,0x24,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x44,0x33,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x42,0x33,0x45,0x31,0x35,0x22,0x2c,0xa,0x22,0x26,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x34,0x33,0x39,0x31,0x42,0x22,0x2c,0xa,0x22,0x2a,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x33,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x3d,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x41,0x33,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x2d,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x44,0x34,0x30,0x31,0x35,0x22,0x2c,0xa,0x22,0x3b,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x32,0x34,0x45,0x32,0x35,0x22,0x2c,0xa,0x22,0x3a,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x41,0x34,0x46,0x32,0x43,0x22,0x2c,0xa,0x22,0x3e,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x32,0x34,0x45,0x33,0x44,0x22,0x2c,0xa,0x22,0x2c,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x38,0x35,0x36,0x32,0x46,0x22,0x2c,0xa,0x22,0x3c,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x33,0x35,0x30,0x33,0x45,0x22,0x2c,0xa,0x22,0x31,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x45,0x36,0x32,0x33,0x42,0x22,0x2c,0xa,0x22,0x32,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x33,0x34,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x33,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x38,0x34,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x34,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x45,0x34,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x35,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x31,0x34,0x46,0x31,0x31,0x22,0x2c,0xa,0x22,0x36,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x38,0x35,0x34,0x31,0x36,0x22,0x2c,0xa,0x22,0x37,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x33,0x34,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x38,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x38,0x34,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x39,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x35,0x35,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x30,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x35,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x71,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x35,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x77,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x42,0x35,0x37,0x30,0x46,0x22,0x2c,0xa,0x22,0x65,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x39,0x35,0x36,0x32,0x46,0x22,0x2c,0xa,0x22,0x72,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x38,0x36,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x74,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x46,0x36,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x79,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x36,0x36,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x75,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x30,0x36,0x31,0x33,0x46,0x22,0x2c,0xa,0x22,0x69,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x43,0x36,0x34,0x32,0x32,0x22,0x2c,0xa,0x22,0x70,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x35,0x31,0x34,0x33,0x22,0x2c,0xa,0x22,0x61,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x35,0x32,0x34,0x42,0x22,0x2c,0xa,0x22,0x73,0x20,
+ 0x20,0x63,0x20,0x67,0x72,0x61,0x79,0x33,0x32,0x22,0x2c,0xa,0x22,0x64,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x44,0x35,0x44,0x35,0x37,0x22,0x2c,0xa,0x22,0x66,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x31,0x36,0x36,0x34,0x31,0x22,0x2c,0xa,0x22,0x67,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x37,0x36,0x39,0x35,0x44,0x22,0x2c,0xa,0x22,0x68,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x42,0x37,0x33,0x34,0x44,0x22,0x2c,0xa,0x22,0x6a,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x43,0x37,0x35,0x35,0x33,0x22,0x2c,0xa,0x22,0x6b,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x31,0x36,0x32,0x36,0x31,0x22,0x2c,0xa,0x22,0x6c,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x38,0x36,0x41,0x36,0x34,0x22,0x2c,0xa,0x22,0x7a,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x42,0x37,0x31,0x36,0x32,0x22,0x2c,0xa,0x22,0x78,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x32,0x37,0x32,0x37,0x32,0x22,0x2c,0xa,0x22,0x63,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x33,0x44,0x46,0x46,0x22,0x2c,0xa,0x22,0x76,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x34,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x62,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x34,0x42,0x46,0x46,0x22,0x2c,0xa,0x22,0x6e,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x35,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x6d,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x31,0x35,0x41,0x46,0x46,0x22,0x2c,0xa,0x22,0x4d,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x36,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x4e,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x34,0x36,0x44,0x46,0x46,0x22,0x2c,0xa,0x22,0x42,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x38,0x36,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x56,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x33,0x37,0x38,0x46,0x46,0x22,0x2c,0xa,0x22,0x43,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x36,0x36,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x5a,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x35,0x37,0x36,0x46,0x46,0x22,0x2c,0xa,0x22,0x41,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x36,0x37,0x38,0x46,0x46,0x22,0x2c,0xa,0x22,0x53,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x46,0x37,0x42,0x38,0x34,0x22,0x2c,0xa,0x22,0x44,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x37,0x38,0x35,0x36,0x44,0x22,0x2c,0xa,0x22,0x46,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x42,0x38,0x42,0x37,0x35,0x22,0x2c,0xa,0x22,0x47,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x30,0x38,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x48,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x31,0x39,0x37,0x46,0x46,0x22,0x2c,0xa,0x22,0x4a,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x42,0x39,0x32,0x46,0x46,0x22,0x2c,0xa,0x22,0x4b,0x20,0x20,
+ 0x63,0x20,0x23,0x31,0x33,0x38,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x4c,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x31,0x41,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x50,0x20,0x20,
+ 0x63,0x20,0x23,0x30,0x44,0x42,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x49,0x20,0x20,
+ 0x63,0x20,0x23,0x33,0x30,0x39,0x36,0x46,0x46,0x22,0x2c,0xa,0x22,0x55,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x44,0x41,0x44,0x46,0x46,0x22,0x2c,0xa,0x22,0x59,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x46,0x42,0x43,0x46,0x46,0x22,0x2c,0xa,0x22,0x54,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x32,0x43,0x36,0x46,0x46,0x22,0x2c,0xa,0x22,0x52,0x20,0x20,
+ 0x63,0x20,0x23,0x32,0x41,0x43,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x45,0x20,0x20,
+ 0x63,0x20,0x23,0x33,0x30,0x44,0x30,0x46,0x46,0x22,0x2c,0xa,0x22,0x57,0x20,0x20,
+ 0x63,0x20,0x23,0x33,0x38,0x44,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x51,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x34,0x39,0x33,0x46,0x31,0x22,0x2c,0xa,0x22,0x21,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x46,0x38,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x7e,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x46,0x38,0x41,0x46,0x46,0x22,0x2c,0xa,0x22,0x5e,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x32,0x39,0x30,0x45,0x34,0x22,0x2c,0xa,0x22,0x2f,0x20,0x20,
+ 0x63,0x20,0x23,0x35,0x46,0x39,0x32,0x46,0x46,0x22,0x2c,0xa,0x22,0x28,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x43,0x41,0x41,0x46,0x45,0x22,0x2c,0xa,0x22,0x29,0x20,0x20,
+ 0x63,0x20,0x23,0x34,0x30,0x42,0x38,0x46,0x46,0x22,0x2c,0xa,0x22,0x5f,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x37,0x39,0x44,0x43,0x42,0x22,0x2c,0xa,0x22,0x60,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x36,0x39,0x33,0x45,0x32,0x22,0x2c,0xa,0x22,0x27,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x32,0x39,0x30,0x46,0x46,0x22,0x2c,0xa,0x22,0x5d,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x34,0x39,0x44,0x46,0x46,0x22,0x2c,0xa,0x22,0x5b,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x31,0x41,0x36,0x45,0x35,0x22,0x2c,0xa,0x22,0x7b,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x39,0x41,0x34,0x46,0x46,0x22,0x2c,0xa,0x22,0x7d,0x20,0x20,
+ 0x63,0x20,0x23,0x37,0x46,0x42,0x33,0x46,0x46,0x22,0x2c,0xa,0x22,0x7c,0x20,0x20,
+ 0x63,0x20,0x23,0x36,0x38,0x42,0x38,0x46,0x33,0x22,0x2c,0xa,0x22,0x20,0x2e,0x20,
+ 0x63,0x20,0x23,0x34,0x32,0x44,0x43,0x46,0x46,0x22,0x2c,0xa,0x22,0x2e,0x2e,0x20,
+ 0x63,0x20,0x23,0x34,0x37,0x45,0x30,0x46,0x46,0x22,0x2c,0xa,0x22,0x58,0x2e,0x20,
+ 0x63,0x20,0x23,0x35,0x38,0x45,0x39,0x46,0x46,0x22,0x2c,0xa,0x22,0x6f,0x2e,0x20,
+ 0x63,0x20,0x23,0x36,0x34,0x43,0x30,0x45,0x42,0x22,0x2c,0xa,0x22,0x4f,0x2e,0x20,
+ 0x63,0x20,0x23,0x36,0x41,0x44,0x46,0x45,0x46,0x22,0x2c,0xa,0x22,0x2b,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x32,0x35,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x40,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x34,0x35,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x23,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x42,0x35,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x24,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x30,0x35,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x43,0x36,0x31,0x30,0x33,0x22,0x2c,0xa,0x22,0x26,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x37,0x36,0x38,0x30,0x37,0x22,0x2c,0xa,0x22,0x2a,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x41,0x36,0x31,0x31,0x31,0x22,0x2c,0xa,0x22,0x3d,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x38,0x36,0x45,0x31,0x42,0x22,0x2c,0xa,0x22,0x2d,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x38,0x37,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x3b,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x43,0x37,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x3a,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x33,0x36,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x3e,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x38,0x36,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x2c,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x32,0x36,0x43,0x32,0x32,0x22,0x2c,0xa,0x22,0x3c,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x38,0x37,0x41,0x33,0x46,0x22,0x2c,0xa,0x22,0x31,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x30,0x37,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x32,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x37,0x35,0x31,0x31,0x22,0x2c,0xa,0x22,0x33,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x39,0x37,0x44,0x31,0x35,0x22,0x2c,0xa,0x22,0x34,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x37,0x42,0x31,0x34,0x22,0x2c,0xa,0x22,0x35,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x39,0x38,0x37,0x31,0x32,0x22,0x2c,0xa,0x22,0x36,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x36,0x38,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x37,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x37,0x38,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x38,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x44,0x38,0x30,0x31,0x36,0x22,0x2c,0xa,0x22,0x39,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x43,0x39,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x30,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x42,0x38,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x71,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x39,0x39,0x42,0x32,0x41,0x22,0x2c,0xa,0x22,0x77,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x39,0x41,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x65,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x41,0x36,0x33,0x43,0x22,0x2c,0xa,0x22,0x72,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x35,0x38,0x44,0x34,0x33,0x22,0x2c,0xa,0x22,0x74,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x38,0x38,0x46,0x34,0x34,0x22,0x2c,0xa,0x22,0x79,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x41,0x39,0x33,0x34,0x36,0x22,0x2c,0xa,0x22,0x75,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x46,0x39,0x39,0x34,0x38,0x22,0x2c,0xa,0x22,0x69,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x42,0x38,0x39,0x37,0x43,0x22,0x2c,0xa,0x22,0x70,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x35,0x38,0x46,0x36,0x46,0x22,0x2c,0xa,0x22,0x61,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x38,0x39,0x33,0x37,0x42,0x22,0x2c,0xa,0x22,0x73,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x36,0x38,0x34,0x34,0x33,0x22,0x2c,0xa,0x22,0x64,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x30,0x38,0x43,0x34,0x31,0x22,0x2c,0xa,0x22,0x66,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x46,0x39,0x34,0x36,0x32,0x22,0x2c,0xa,0x22,0x67,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x39,0x38,0x36,0x34,0x22,0x2c,0xa,0x22,0x68,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x41,0x38,0x35,0x30,0x22,0x2c,0xa,0x22,0x6a,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x42,0x33,0x35,0x35,0x22,0x2c,0xa,0x22,0x6b,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x33,0x39,0x37,0x32,0x46,0x22,0x2c,0xa,0x22,0x6c,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x41,0x34,0x30,0x30,0x22,0x2c,0xa,0x22,0x7a,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x41,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x78,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x37,0x42,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x63,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x41,0x30,0x33,0x30,0x22,0x2c,0xa,0x22,0x76,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x42,0x42,0x34,0x33,0x45,0x22,0x2c,0xa,0x22,0x62,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x34,0x41,0x44,0x30,0x43,0x22,0x2c,0xa,0x22,0x6e,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x42,0x36,0x30,0x30,0x22,0x2c,0xa,0x22,0x6d,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x44,0x42,0x39,0x30,0x30,0x22,0x2c,0xa,0x22,0x4d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x32,0x42,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x4e,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x31,0x42,0x38,0x34,0x43,0x22,0x2c,0xa,0x22,0x42,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x31,0x42,0x37,0x35,0x37,0x22,0x2c,0xa,0x22,0x56,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x42,0x42,0x35,0x38,0x22,0x2c,0xa,0x22,0x43,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x39,0x42,0x45,0x35,0x41,0x22,0x2c,0xa,0x22,0x5a,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x41,0x39,0x37,0x38,0x22,0x2c,0xa,0x22,0x41,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x46,0x43,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x53,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x43,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x44,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x36,0x43,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x46,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x47,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x42,0x30,0x30,0x22,0x2c,0xa,0x22,0x48,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x46,0x30,0x45,0x22,0x2c,0xa,0x22,0x4a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x35,0x44,0x35,0x30,0x30,0x22,0x2c,0xa,0x22,0x4b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x42,0x43,0x44,0x33,0x39,0x22,0x2c,0xa,0x22,0x4c,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x38,0x33,0x32,0x22,0x2c,0xa,0x22,0x50,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x34,0x33,0x32,0x22,0x2c,0xa,0x22,0x49,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x45,0x43,0x32,0x35,0x43,0x22,0x2c,0xa,0x22,0x55,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x37,0x43,0x36,0x34,0x38,0x22,0x2c,0xa,0x22,0x59,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x43,0x37,0x34,0x42,0x22,0x2c,0xa,0x22,0x54,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x30,0x43,0x35,0x35,0x45,0x22,0x2c,0xa,0x22,0x52,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x33,0x43,0x38,0x35,0x46,0x22,0x2c,0xa,0x22,0x45,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x35,0x43,0x39,0x36,0x30,0x22,0x2c,0xa,0x22,0x57,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x44,0x32,0x36,0x34,0x22,0x2c,0xa,0x22,0x51,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x30,0x43,0x41,0x34,0x43,0x22,0x2c,0xa,0x22,0x21,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x37,0x44,0x31,0x34,0x45,0x22,0x2c,0xa,0x22,0x7e,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x44,0x41,0x35,0x31,0x22,0x2c,0xa,0x22,0x5e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x44,0x30,0x35,0x30,0x22,0x2c,0xa,0x22,0x2f,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x39,0x44,0x34,0x35,0x32,0x22,0x2c,0xa,0x22,0x28,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x44,0x44,0x35,0x33,0x22,0x2c,0xa,0x22,0x29,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x32,0x44,0x37,0x36,0x35,0x22,0x2c,0xa,0x22,0x5f,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x44,0x44,0x36,0x39,0x22,0x2c,0xa,0x22,0x60,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x36,0x44,0x44,0x36,0x38,0x22,0x2c,0xa,0x22,0x27,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x44,0x42,0x36,0x45,0x22,0x2c,0xa,0x22,0x5d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x45,0x34,0x46,0x22,0x2c,0xa,0x22,0x5b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x45,0x33,0x35,0x34,0x22,0x2c,0xa,0x22,0x7b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x45,0x41,0x35,0x35,0x22,0x2c,0xa,0x22,0x7d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x37,0x45,0x31,0x35,0x33,0x22,0x2c,0xa,0x22,0x7c,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x46,0x30,0x35,0x36,0x22,0x2c,0xa,0x22,0x20,0x58,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x45,0x31,0x36,0x41,0x22,0x2c,0xa,0x22,0x2e,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x31,0x45,0x35,0x36,0x44,0x22,0x2c,0xa,0x22,0x58,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x37,0x45,0x41,0x36,0x46,0x22,0x2c,0xa,0x22,0x6f,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x37,0x45,0x42,0x37,0x30,0x22,0x2c,0xa,0x22,0x4f,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x39,0x45,0x43,0x37,0x30,0x22,0x2c,0xa,0x22,0x2b,0x58,0x20,
+ 0x63,0x20,0x23,0x46,0x45,0x46,0x33,0x37,0x32,0x22,0x2c,0xa,0x22,0x40,0x58,0x20,
+ 0x63,0x20,0x23,0x39,0x37,0x39,0x34,0x38,0x36,0x22,0x2c,0xa,0x22,0x23,0x58,0x20,
+ 0x63,0x20,0x67,0x72,0x61,0x79,0x36,0x30,0x22,0x2c,0xa,0x22,0x24,0x58,0x20,0x63,
+ 0x20,0x23,0x39,0x36,0x39,0x35,0x39,0x36,0x22,0x2c,0xa,0x22,0x25,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x41,0x41,0x31,0x39,0x33,0x22,0x2c,0xa,0x22,0x26,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x32,0x41,0x38,0x39,0x42,0x22,0x2c,0xa,0x22,0x2a,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x43,0x41,0x45,0x41,0x33,0x22,0x2c,0xa,0x22,0x3d,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x36,0x41,0x37,0x41,0x39,0x22,0x2c,0xa,0x22,0x2d,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x42,0x41,0x32,0x42,0x31,0x22,0x2c,0xa,0x22,0x3b,0x58,0x20,0x63,
+ 0x20,0x23,0x41,0x43,0x41,0x35,0x38,0x30,0x22,0x2c,0xa,0x22,0x3a,0x58,0x20,0x63,
+ 0x20,0x23,0x41,0x35,0x41,0x32,0x39,0x31,0x22,0x2c,0xa,0x22,0x3e,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x33,0x41,0x46,0x39,0x38,0x22,0x2c,0xa,0x22,0x2c,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x38,0x42,0x37,0x41,0x46,0x22,0x2c,0xa,0x22,0x3c,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x33,0x42,0x32,0x41,0x42,0x22,0x2c,0xa,0x22,0x31,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x31,0x42,0x31,0x42,0x31,0x22,0x2c,0xa,0x22,0x32,0x58,0x20,0x63,
+ 0x20,0x23,0x41,0x36,0x42,0x38,0x46,0x46,0x22,0x2c,0xa,0x22,0x33,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x38,0x44,0x45,0x45,0x30,0x22,0x2c,0xa,0x22,0x34,0x58,0x20,0x63,
+ 0x20,0x23,0x38,0x42,0x46,0x30,0x46,0x45,0x22,0x2c,0xa,0x22,0x35,0x58,0x20,0x63,
+ 0x20,0x23,0x41,0x34,0x43,0x46,0x43,0x36,0x22,0x2c,0xa,0x22,0x36,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x46,0x44,0x35,0x46,0x46,0x22,0x2c,0xa,0x22,0x37,0x58,0x20,0x63,
+ 0x20,0x23,0x42,0x46,0x44,0x43,0x46,0x46,0x22,0x2c,0xa,0x22,0x38,0x58,0x20,0x63,
+ 0x20,0x23,0x43,0x32,0x41,0x44,0x38,0x32,0x22,0x2c,0xa,0x22,0x39,0x58,0x20,0x63,
+ 0x20,0x23,0x43,0x42,0x42,0x34,0x38,0x39,0x22,0x2c,0xa,0x22,0x30,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x32,0x42,0x46,0x39,0x42,0x22,0x2c,0xa,0x22,0x71,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x31,0x43,0x31,0x39,0x46,0x22,0x2c,0xa,0x22,0x77,0x58,0x20,0x63,
+ 0x20,0x23,0x43,0x38,0x43,0x34,0x41,0x41,0x22,0x2c,0xa,0x22,0x65,0x58,0x20,0x63,
+ 0x20,0x23,0x43,0x46,0x43,0x42,0x42,0x37,0x22,0x2c,0xa,0x22,0x72,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x38,0x43,0x37,0x41,0x36,0x22,0x2c,0xa,0x22,0x74,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x32,0x43,0x32,0x41,0x33,0x22,0x2c,0xa,0x22,0x79,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x35,0x43,0x43,0x42,0x33,0x22,0x2c,0xa,0x22,0x75,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x41,0x44,0x31,0x41,0x31,0x22,0x2c,0xa,0x22,0x69,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x44,0x44,0x35,0x42,0x42,0x22,0x2c,0xa,0x22,0x70,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x37,0x44,0x31,0x42,0x33,0x22,0x2c,0xa,0x22,0x61,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x43,0x45,0x35,0x42,0x42,0x22,0x2c,0xa,0x22,0x73,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x35,0x45,0x42,0x42,0x35,0x22,0x2c,0xa,0x22,0x64,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x35,0x45,0x43,0x42,0x43,0x22,0x2c,0xa,0x22,0x66,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x38,0x45,0x45,0x42,0x38,0x22,0x2c,0xa,0x22,0x67,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x43,0x46,0x32,0x42,0x43,0x22,0x2c,0xa,0x22,0x68,0x58,0x20,0x63,
+ 0x20,0x23,0x43,0x42,0x43,0x42,0x43,0x42,0x22,0x2c,0xa,0x22,0x6a,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x38,0x44,0x36,0x43,0x37,0x22,0x2c,0xa,0x22,0x6b,0x58,0x20,0x63,
+ 0x20,0x23,0x44,0x44,0x44,0x44,0x44,0x44,0x22,0x2c,0xa,0x22,0x6c,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x34,0x44,0x41,0x43,0x32,0x22,0x2c,0xa,0x22,0x7a,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x43,0x45,0x36,0x43,0x37,0x22,0x2c,0xa,0x22,0x78,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x42,0x45,0x36,0x44,0x39,0x22,0x2c,0xa,0x22,0x63,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x39,0x45,0x33,0x44,0x30,0x22,0x2c,0xa,0x22,0x76,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x35,0x45,0x44,0x43,0x34,0x22,0x2c,0xa,0x22,0x62,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x36,0x45,0x46,0x43,0x39,0x22,0x2c,0xa,0x22,0x6e,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x30,0x45,0x42,0x44,0x35,0x22,0x2c,0xa,0x22,0x6d,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x33,0x45,0x46,0x44,0x42,0x22,0x2c,0xa,0x22,0x4d,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x43,0x46,0x33,0x43,0x35,0x22,0x2c,0xa,0x22,0x4e,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x43,0x46,0x34,0x43,0x41,0x22,0x2c,0xa,0x22,0x42,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x37,0x46,0x30,0x43,0x41,0x22,0x2c,0xa,0x22,0x56,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x36,0x46,0x30,0x44,0x32,0x22,0x2c,0xa,0x22,0x43,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x39,0x46,0x33,0x44,0x33,0x22,0x2c,0xa,0x22,0x5a,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x39,0x46,0x34,0x44,0x43,0x22,0x2c,0xa,0x22,0x41,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x38,0x44,0x34,0x22,0x2c,0xa,0x22,0x53,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x46,0x46,0x39,0x44,0x42,0x22,0x2c,0xa,0x22,0x44,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x37,0x45,0x37,0x45,0x34,0x22,0x2c,0xa,0x22,0x46,0x58,0x20,0x63,
+ 0x20,0x23,0x45,0x42,0x45,0x42,0x45,0x39,0x22,0x2c,0xa,0x22,0x47,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x31,0x45,0x44,0x45,0x31,0x22,0x2c,0xa,0x22,0x48,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x39,0x46,0x36,0x45,0x35,0x22,0x2c,0xa,0x22,0x4a,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x44,0x46,0x39,0x45,0x34,0x22,0x2c,0xa,0x22,0x4b,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x42,0x45,0x42,0x22,0x2c,0xa,0x22,0x4c,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x36,0x46,0x32,0x45,0x36,0x22,0x2c,0xa,0x22,0x50,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x43,0x46,0x33,0x22,0x2c,0xa,0x22,0x49,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x45,0x46,0x44,0x46,0x44,0x22,0x2c,0xa,0x22,0x55,0x58,0x20,0x63,
+ 0x20,0x23,0x46,0x34,0x46,0x34,0x46,0x33,0x22,0x2c,0xa,0x22,0x59,0x58,0x20,0x63,
+ 0x20,0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,0x6c,
+ 0x73,0x20,0x2a,0x2f,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x3a,0x2e,0x3a,0x2e,0x2b,0x20,0x49,0x58,0x49,0x58,0x49,0x58,0x49,0x58,
+ 0x49,0x58,0x49,0x58,0x49,0x58,0x49,0x58,0x46,0x58,0x23,0x20,0x2b,0x2e,0x37,0x20,
+ 0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3e,0x2e,0x6b,0x2e,0x63,0x2e,0x36,0x20,0x46,0x58,0x6b,0x58,
+ 0x6b,0x58,0x6b,0x58,0x44,0x58,0x6b,0x58,0x6b,0x58,0x6b,0x58,0x78,0x20,0x69,0x20,
+ 0x62,0x2e,0x3e,0x2e,0x2b,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x27,0x2e,0x4b,0x2e,0x3d,0x2e,
+ 0x68,0x58,0x31,0x58,0x31,0x58,0x31,0x58,0x31,0x58,0x31,0x58,0x31,0x58,0x31,0x58,
+ 0x64,0x20,0x26,0x2e,0x30,0x2e,0x25,0x2e,0x2a,0x20,0x37,0x20,0x23,0x2e,0x23,0x2e,
+ 0x3a,0x2e,0x24,0x2e,0x23,0x2e,0x32,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x2f,0x2e,
+ 0x4d,0x2e,0x25,0x2e,0x24,0x58,0x6b,0x20,0x6b,0x20,0x64,0x20,0x73,0x20,0x73,0x20,
+ 0x73,0x20,0x65,0x20,0x77,0x20,0x3e,0x2e,0x32,0x2e,0x64,0x2e,0x73,0x2e,0x5a,0x2e,
+ 0x39,0x58,0x72,0x58,0x6c,0x58,0x78,0x58,0x30,0x58,0x37,0x20,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x5e,0x2e,0x4d,0x2e,0x31,0x2e,0x3a,0x20,0x25,0x20,0x25,0x20,0x2d,0x20,
+ 0x25,0x20,0x35,0x20,0x36,0x20,0x26,0x2e,0x47,0x58,0x49,0x58,0x49,0x58,0x50,0x58,
+ 0x50,0x58,0x50,0x58,0x50,0x58,0x50,0x58,0x4c,0x58,0x49,0x58,0x49,0x58,0x67,0x2e,
+ 0x33,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x23,0x58,0x3a,0x2e,0x5e,0x2e,0x6d,0x2e,0x76,0x2e,0x79,0x2e,0x72,0x2e,
+ 0x72,0x2e,0x72,0x2e,0x72,0x2e,0x68,0x2e,0x68,0x2e,0x32,0x2e,0x49,0x58,0x50,0x58,
+ 0x50,0x58,0x4b,0x58,0x4b,0x58,0x50,0x58,0x4b,0x58,0x48,0x58,0x78,0x58,0x55,0x58,
+ 0x49,0x58,0x49,0x58,0x66,0x2e,0x34,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x23,0x58,0x3a,0x2e,0x5e,0x2e,0x6d,0x2e,0x59,0x2e,
+ 0x49,0x2e,0x42,0x2e,0x6a,0x2e,0x6a,0x2e,0x6a,0x2e,0x56,0x2e,0x49,0x2e,0x34,0x2e,
+ 0x50,0x58,0x4b,0x58,0x4a,0x58,0x4b,0x58,0x4a,0x58,0x4b,0x58,0x4b,0x58,0x6d,0x58,
+ 0x6a,0x58,0x46,0x58,0x49,0x58,0x49,0x58,0x55,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x23,0x58,0x3a,0x2e,0x5e,0x2e,
+ 0x6d,0x2e,0x59,0x2e,0x45,0x2e,0x49,0x2e,0x6a,0x2e,0x6a,0x2e,0x6a,0x2e,0x49,0x2e,
+ 0x52,0x2e,0x38,0x2e,0x50,0x58,0x4b,0x58,0x53,0x58,0x4a,0x58,0x4a,0x58,0x4a,0x58,
+ 0x53,0x58,0x6e,0x58,0x65,0x58,0x44,0x58,0x49,0x58,0x49,0x58,0x55,0x58,0x3c,0x2e,
+ 0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x2f,0x2e,0x4d,0x2e,0x21,0x2e,0x57,0x2e,0x52,0x2e,0x49,0x2e,0x54,0x2e,
+ 0x52,0x2e,0x45,0x2e,0x57,0x2e,0x38,0x2e,0x55,0x58,0x4a,0x58,0x4a,0x58,0x53,0x58,
+ 0x53,0x58,0x53,0x58,0x53,0x58,0x6e,0x58,0x65,0x58,0x3a,0x58,0x40,0x58,0x69,0x2e,
+ 0x3c,0x58,0x37,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3a,0x2e,0x2f,0x2e,0x44,0x2e,0x7e,0x2e,0x5f,0x2e,0x60,0x2e,
+ 0x57,0x2e,0x57,0x2e,0x57,0x2e,0x57,0x2e,0x20,0x58,0x38,0x2e,0x50,0x58,0x4a,0x58,
+ 0x53,0x58,0x41,0x58,0x53,0x58,0x53,0x58,0x53,0x58,0x56,0x58,0x6a,0x58,0x3e,0x58,
+ 0x40,0x58,0x40,0x58,0x2c,0x58,0x34,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x28,0x2e,0x53,0x2e,0x7d,0x2e,
+ 0x2e,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x20,0x58,0x38,0x2e,
+ 0x50,0x58,0x53,0x58,0x41,0x58,0x41,0x58,0x41,0x58,0x41,0x58,0x41,0x58,0x4e,0x58,
+ 0x7a,0x58,0x70,0x58,0x77,0x58,0x77,0x58,0x6a,0x58,0x37,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x28,0x2e,
+ 0x53,0x2e,0x5b,0x2e,0x4f,0x58,0x4f,0x58,0x4f,0x58,0x6f,0x58,0x6f,0x58,0x74,0x2e,
+ 0x3b,0x20,0x4f,0x20,0x73,0x20,0x61,0x20,0x70,0x20,0x70,0x20,0x70,0x20,0x70,0x20,
+ 0x61,0x2e,0x41,0x58,0x4d,0x58,0x76,0x58,0x61,0x58,0x7a,0x58,0x47,0x58,0x2b,0x2e,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x28,0x2e,0x53,0x2e,0x5b,0x2e,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x4f,0x58,
+ 0x2b,0x58,0x3b,0x20,0x37,0x58,0x32,0x58,0x5d,0x20,0x2f,0x20,0x2f,0x20,0x7e,0x20,
+ 0x21,0x20,0x32,0x58,0x70,0x20,0x4d,0x58,0x4e,0x58,0x4e,0x58,0x4e,0x58,0x53,0x58,
+ 0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3a,0x2e,0x28,0x2e,0x46,0x2e,0x7c,0x2e,0x2b,0x58,0x2b,0x58,
+ 0x2b,0x58,0x2b,0x58,0x2b,0x58,0x79,0x2e,0x2c,0x20,0x5f,0x20,0x41,0x20,0x6d,0x20,
+ 0x62,0x20,0x76,0x20,0x63,0x20,0x21,0x20,0x70,0x20,0x4d,0x58,0x4d,0x58,0x67,0x58,
+ 0x4d,0x58,0x41,0x58,0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x28,0x2e,0x46,0x2e,0x7c,0x2e,
+ 0x2b,0x58,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x6a,0x2e,0x26,0x20,
+ 0x5e,0x20,0x42,0x20,0x6e,0x20,0x62,0x20,0x76,0x20,0x27,0x20,0x3c,0x20,0x67,0x58,
+ 0x4d,0x58,0x67,0x58,0x67,0x58,0x4e,0x58,0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x28,0x2e,
+ 0x46,0x2e,0x55,0x2e,0x57,0x2e,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x2b,0x58,0x29,0x2e,
+ 0x79,0x2e,0x67,0x20,0x51,0x20,0x4e,0x20,0x6d,0x20,0x6e,0x20,0x62,0x20,0x7e,0x20,
+ 0x3c,0x20,0x67,0x58,0x67,0x58,0x67,0x58,0x67,0x58,0x41,0x58,0x4a,0x58,0x71,0x20,
+ 0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x5b,0x2e,0x6c,0x2e,0x6a,0x20,0x6a,0x20,0x79,0x2e,0x49,0x2e,0x6a,0x2e,
+ 0x72,0x2e,0x31,0x20,0x3d,0x58,0x28,0x20,0x4b,0x20,0x4e,0x20,0x4d,0x20,0x6d,0x20,
+ 0x62,0x20,0x7e,0x20,0x3c,0x20,0x67,0x58,0x67,0x58,0x67,0x58,0x67,0x58,0x4e,0x58,
+ 0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3a,0x2e,0x5b,0x2e,0x74,0x20,0x35,0x58,0x34,0x58,0x26,0x58,
+ 0x44,0x20,0x46,0x20,0x3d,0x58,0x7c,0x20,0x55,0x20,0x4a,0x20,0x47,0x20,0x56,0x20,
+ 0x5a,0x20,0x41,0x20,0x43,0x20,0x2f,0x20,0x3c,0x20,0x66,0x58,0x67,0x58,0x67,0x58,
+ 0x67,0x58,0x4d,0x58,0x48,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x5b,0x2e,0x6c,0x2e,0x68,0x20,
+ 0x33,0x58,0x58,0x2e,0x2e,0x2e,0x57,0x20,0x54,0x20,0x50,0x20,0x4c,0x20,0x48,0x20,
+ 0x4b,0x20,0x49,0x20,0x5b,0x20,0x53,0x20,0x60,0x20,0x7b,0x20,0x3c,0x20,0x66,0x58,
+ 0x66,0x58,0x66,0x58,0x66,0x58,0x4d,0x58,0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x5b,0x2e,
+ 0x47,0x2e,0x65,0x2e,0x31,0x20,0x2a,0x58,0x4f,0x2e,0x2e,0x2e,0x45,0x20,0x52,0x20,
+ 0x59,0x20,0x59,0x20,0x7c,0x20,0x2d,0x58,0x64,0x20,0x5a,0x2e,0x6b,0x20,0x36,0x58,
+ 0x3e,0x20,0x66,0x58,0x66,0x58,0x66,0x58,0x66,0x58,0x42,0x58,0x4a,0x58,0x2b,0x2e,
+ 0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x5b,0x2e,0x47,0x2e,0x7b,0x2e,0x60,0x2e,0x75,0x2e,0x31,0x20,0x46,0x20,
+ 0x26,0x58,0x2a,0x58,0x25,0x58,0x7a,0x20,0x6c,0x20,0x61,0x2e,0x75,0x58,0x66,0x58,
+ 0x70,0x2e,0x3e,0x20,0x70,0x2e,0x73,0x58,0x73,0x58,0x73,0x58,0x66,0x58,0x42,0x58,
+ 0x4a,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3a,0x2e,0x7b,0x2e,0x47,0x2e,0x7c,0x2e,0x2b,0x58,0x2b,0x58,
+ 0x20,0x58,0x4e,0x2e,0x71,0x2e,0x35,0x2e,0x37,0x2e,0x71,0x20,0x63,0x58,0x76,0x58,
+ 0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,
+ 0x73,0x58,0x42,0x58,0x4b,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x7c,0x2e,0x47,0x2e,0x5d,0x2e,
+ 0x7c,0x2e,0x4c,0x2e,0x48,0x2e,0x47,0x2e,0x47,0x2e,0x47,0x2e,0x41,0x2e,0x31,0x2e,
+ 0x4a,0x58,0x76,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,
+ 0x73,0x58,0x66,0x58,0x64,0x58,0x43,0x58,0x50,0x58,0x2b,0x2e,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x3a,0x2e,0x7b,0x2e,
+ 0x47,0x2e,0x47,0x2e,0x47,0x2e,0x47,0x2e,0x47,0x2e,0x78,0x2e,0x77,0x2e,0x3b,0x2e,
+ 0x74,0x20,0x3a,0x2e,0x48,0x58,0x64,0x58,0x73,0x58,0x73,0x58,0x73,0x58,0x73,0x58,
+ 0x73,0x58,0x64,0x58,0x76,0x58,0x42,0x58,0x5a,0x58,0x4c,0x58,0x74,0x58,0x3d,0x20,
+ 0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x3a,0x2e,0x7b,0x2e,0x47,0x2e,0x4a,0x2e,0x78,0x2e,0x39,0x2e,0x3b,0x2e,0x72,0x20,
+ 0x39,0x20,0x71,0x20,0x30,0x20,0x23,0x2e,0x4b,0x58,0x76,0x58,0x73,0x58,0x61,0x58,
+ 0x73,0x58,0x76,0x58,0x42,0x58,0x43,0x58,0x48,0x58,0x69,0x58,0x67,0x2e,0x2a,0x2e,
+ 0x3d,0x20,0x4f,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x3a,0x2e,0x4c,0x2e,0x39,0x2e,0x2d,0x2e,0x79,0x20,0x39,0x20,
+ 0x71,0x20,0x30,0x20,0x3d,0x20,0x2b,0x20,0x20,0x20,0x23,0x2e,0x48,0x58,0x62,0x58,
+ 0x64,0x58,0x62,0x58,0x56,0x58,0x5a,0x58,0x63,0x58,0x38,0x58,0x2c,0x2e,0x33,0x20,
+ 0x24,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x25,0x2e,0x7a,0x2e,0x39,0x20,0x71,0x20,
+ 0x37,0x20,0x2a,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x24,0x2e,
+ 0x50,0x58,0x5a,0x58,0x6d,0x58,0x6d,0x58,0x30,0x58,0x73,0x2e,0x30,0x20,0x24,0x20,
+ 0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x38,0x20,0x30,0x20,
+ 0x3d,0x20,0x6f,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x3a,0x2e,0x49,0x58,0x70,0x58,0x67,0x2e,0x2a,0x2e,0x3d,0x20,0x4f,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x59,0x58,0x59,0x58,0x40,0x2e,0x23,0x2e,0x32,0x20,0x40,0x20,0x2e,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,0xa,0x22,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x22,0x2c,
+ 0xa,0x22,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,0x59,0x58,
+ 0x59,0x58,0x22,0xa,0x7d,0x3b,0xa,
+ # /home/rdale/src/kde/branches/KDE/3.5/kdevelop/languages/ruby/app_templates/qtruby4makeapp/editcut.xpm
+ 0x0,0x0,0x16,0x47,
+ 0x2f,
+ 0x2a,0x20,0x58,0x50,0x4d,0x20,0x2a,0x2f,0xa,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
+ 0x63,0x68,0x61,0x72,0x20,0x2a,0x65,0x64,0x69,0x74,0x63,0x75,0x74,0x5b,0x5d,0x20,
+ 0x3d,0x20,0x7b,0xa,0x2f,0x2a,0x20,0x63,0x6f,0x6c,0x75,0x6d,0x6e,0x73,0x20,0x72,
+ 0x6f,0x77,0x73,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x20,0x63,0x68,0x61,0x72,0x73,
+ 0x2d,0x70,0x65,0x72,0x2d,0x70,0x69,0x78,0x65,0x6c,0x20,0x2a,0x2f,0xa,0x22,0x33,
+ 0x32,0x20,0x33,0x32,0x20,0x32,0x31,0x34,0x20,0x32,0x22,0x2c,0xa,0x22,0x20,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x30,0x30,0x30,0x30,0x30,0x22,0x2c,0xa,0x22,0x2e,0x20,
+ 0x20,0x63,0x20,0x23,0x30,0x42,0x30,0x42,0x30,0x42,0x22,0x2c,0xa,0x22,0x58,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x38,0x31,0x33,0x30,0x30,0x22,0x2c,0xa,0x22,0x6f,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x44,0x31,0x39,0x30,0x42,0x22,0x2c,0xa,0x22,0x4f,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x33,0x31,0x33,0x31,0x33,0x22,0x2c,0xa,0x22,0x2b,0x20,
+ 0x20,0x63,0x20,0x23,0x31,0x42,0x31,0x42,0x31,0x42,0x22,0x2c,0xa,0x22,0x40,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x31,0x31,0x45,0x31,0x31,0x22,0x2c,0xa,0x22,0x23,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x36,0x32,0x33,0x31,0x41,0x22,0x2c,0xa,0x22,0x24,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x41,0x32,0x35,0x31,0x33,0x22,0x2c,0xa,0x22,0x25,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x45,0x32,0x39,0x31,0x32,0x22,0x2c,0xa,0x22,0x26,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x45,0x32,0x41,0x31,0x39,0x22,0x2c,0xa,0x22,0x2a,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x37,0x32,0x45,0x30,0x42,0x22,0x2c,0xa,0x22,0x3d,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x30,0x32,0x41,0x31,0x32,0x22,0x2c,0xa,0x22,0x2d,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x31,0x32,0x43,0x31,0x42,0x22,0x2c,0xa,0x22,0x3b,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x41,0x33,0x32,0x30,0x46,0x22,0x2c,0xa,0x22,0x3a,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x43,0x33,0x34,0x31,0x35,0x22,0x2c,0xa,0x22,0x3e,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x43,0x33,0x35,0x31,0x42,0x22,0x2c,0xa,0x22,0x2c,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x33,0x32,0x33,0x32,0x33,0x22,0x2c,0xa,0x22,0x3c,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x42,0x32,0x39,0x32,0x32,0x22,0x2c,0xa,0x22,0x31,0x20,
+ 0x20,0x63,0x20,0x23,0x32,0x43,0x32,0x43,0x32,0x43,0x22,0x2c,0xa,0x22,0x32,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x30,0x32,0x45,0x32,0x36,0x22,0x2c,0xa,0x22,0x33,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x35,0x33,0x31,0x32,0x30,0x22,0x2c,0xa,0x22,0x34,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x46,0x33,0x42,0x32,0x44,0x22,0x2c,0xa,0x22,0x35,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x31,0x33,0x31,0x33,0x31,0x22,0x2c,0xa,0x22,0x36,0x20,
+ 0x20,0x63,0x20,0x23,0x33,0x41,0x33,0x41,0x33,0x41,0x22,0x2c,0xa,0x22,0x37,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x32,0x33,0x38,0x31,0x34,0x22,0x2c,0xa,0x22,0x38,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x39,0x33,0x45,0x31,0x37,0x22,0x2c,0xa,0x22,0x39,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x31,0x33,0x44,0x32,0x46,0x22,0x2c,0xa,0x22,0x30,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x32,0x33,0x46,0x33,0x32,0x22,0x2c,0xa,0x22,0x71,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x46,0x34,0x33,0x31,0x39,0x22,0x2c,0xa,0x22,0x77,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x43,0x34,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x65,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x46,0x34,0x46,0x30,0x44,0x22,0x2c,0xa,0x22,0x72,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x31,0x34,0x34,0x31,0x30,0x22,0x2c,0xa,0x22,0x74,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x35,0x34,0x38,0x31,0x33,0x22,0x2c,0xa,0x22,0x79,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x45,0x34,0x37,0x32,0x43,0x22,0x2c,0xa,0x22,0x75,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x34,0x34,0x31,0x33,0x36,0x22,0x2c,0xa,0x22,0x69,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x41,0x34,0x38,0x33,0x46,0x22,0x2c,0xa,0x22,0x70,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x33,0x34,0x42,0x32,0x42,0x22,0x2c,0xa,0x22,0x61,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x30,0x34,0x42,0x33,0x37,0x22,0x2c,0xa,0x22,0x73,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x31,0x34,0x43,0x33,0x41,0x22,0x2c,0xa,0x22,0x64,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x35,0x34,0x46,0x30,0x34,0x22,0x2c,0xa,0x22,0x66,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x30,0x34,0x46,0x30,0x42,0x22,0x2c,0xa,0x22,0x67,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x36,0x35,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x68,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x37,0x35,0x35,0x30,0x39,0x22,0x2c,0xa,0x22,0x6a,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x42,0x35,0x34,0x30,0x35,0x22,0x2c,0xa,0x22,0x6b,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x43,0x35,0x38,0x30,0x37,0x22,0x2c,0xa,0x22,0x6c,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x43,0x35,0x39,0x30,0x42,0x22,0x2c,0xa,0x22,0x7a,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x34,0x35,0x42,0x30,0x34,0x22,0x2c,0xa,0x22,0x78,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x31,0x35,0x44,0x30,0x41,0x22,0x2c,0xa,0x22,0x63,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x42,0x35,0x42,0x30,0x32,0x22,0x2c,0xa,0x22,0x76,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x32,0x35,0x42,0x33,0x42,0x22,0x2c,0xa,0x22,0x62,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x45,0x36,0x38,0x31,0x35,0x22,0x2c,0xa,0x22,0x6e,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x43,0x36,0x34,0x33,0x45,0x22,0x2c,0xa,0x22,0x6d,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x44,0x34,0x42,0x34,0x32,0x22,0x2c,0xa,0x22,0x4d,0x20,
+ 0x20,0x63,0x20,0x23,0x34,0x39,0x34,0x39,0x34,0x39,0x22,0x2c,0xa,0x22,0x4e,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x30,0x34,0x44,0x34,0x33,0x22,0x2c,0xa,0x22,0x42,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x34,0x35,0x33,0x34,0x43,0x22,0x2c,0xa,0x22,0x56,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x31,0x35,0x31,0x35,0x31,0x22,0x2c,0xa,0x22,0x43,0x20,
+ 0x20,0x63,0x20,0x23,0x35,0x44,0x35,0x42,0x35,0x34,0x22,0x2c,0xa,0x22,0x5a,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x35,0x36,0x30,0x34,0x38,0x22,0x2c,0xa,0x22,0x41,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x33,0x36,0x41,0x34,0x34,0x22,0x2c,0xa,0x22,0x53,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x32,0x36,0x43,0x35,0x34,0x22,0x2c,0xa,0x22,0x44,0x20,
+ 0x20,0x63,0x20,0x23,0x37,0x37,0x37,0x32,0x35,0x42,0x22,0x2c,0xa,0x22,0x46,0x20,
+ 0x20,0x63,0x20,0x23,0x36,0x39,0x36,0x39,0x36,0x38,0x22,0x2c,0xa,0x22,0x47,0x20,
+ 0x20,0x63,0x20,0x67,0x72,0x61,0x79,0x35,0x30,0x22,0x2c,0xa,0x22,0x48,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x32,0x36,0x32,0x30,0x33,0x22,0x2c,0xa,0x22,0x4a,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x30,0x36,0x36,0x30,0x39,0x22,0x2c,0xa,0x22,0x4b,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x33,0x36,0x39,0x30,0x37,0x22,0x2c,0xa,0x22,0x4c,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x44,0x36,0x41,0x30,0x33,0x22,0x2c,0xa,0x22,0x50,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x41,0x36,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x49,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x42,0x37,0x30,0x30,0x35,0x22,0x2c,0xa,0x22,0x55,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x45,0x37,0x33,0x30,0x45,0x22,0x2c,0xa,0x22,0x59,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x43,0x37,0x35,0x31,0x31,0x22,0x2c,0xa,0x22,0x54,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x35,0x37,0x33,0x32,0x43,0x22,0x2c,0xa,0x22,0x52,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x38,0x37,0x38,0x33,0x42,0x22,0x2c,0xa,0x22,0x45,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x45,0x37,0x43,0x30,0x30,0x22,0x2c,0xa,0x22,0x57,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x38,0x37,0x42,0x31,0x33,0x22,0x2c,0xa,0x22,0x51,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x34,0x37,0x42,0x35,0x33,0x22,0x2c,0xa,0x22,0x21,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x32,0x37,0x44,0x36,0x34,0x22,0x2c,0xa,0x22,0x7e,0x20,0x20,
+ 0x63,0x20,0x23,0x39,0x43,0x38,0x36,0x32,0x45,0x22,0x2c,0xa,0x22,0x5e,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x39,0x38,0x41,0x31,0x46,0x22,0x2c,0xa,0x22,0x2f,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x38,0x44,0x30,0x41,0x22,0x2c,0xa,0x22,0x28,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x38,0x38,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x29,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x38,0x32,0x31,0x41,0x22,0x2c,0xa,0x22,0x5f,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x31,0x38,0x45,0x31,0x42,0x22,0x2c,0xa,0x22,0x60,0x20,0x20,
+ 0x63,0x20,0x23,0x42,0x33,0x39,0x34,0x31,0x43,0x22,0x2c,0xa,0x22,0x27,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x38,0x38,0x45,0x32,0x43,0x22,0x2c,0xa,0x22,0x5d,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x38,0x43,0x33,0x36,0x22,0x2c,0xa,0x22,0x5b,0x20,0x20,
+ 0x63,0x20,0x23,0x41,0x45,0x39,0x32,0x32,0x34,0x22,0x2c,0xa,0x22,0x7b,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x39,0x38,0x31,0x35,0x45,0x22,0x2c,0xa,0x22,0x7d,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x37,0x38,0x32,0x36,0x44,0x22,0x2c,0xa,0x22,0x7c,0x20,0x20,
+ 0x63,0x20,0x23,0x38,0x35,0x38,0x31,0x37,0x34,0x22,0x2c,0xa,0x22,0x20,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x38,0x38,0x33,0x37,0x30,0x22,0x2c,0xa,0x22,0x2e,0x2e,0x20,
+ 0x63,0x20,0x23,0x38,0x45,0x38,0x41,0x37,0x44,0x22,0x2c,0xa,0x22,0x58,0x2e,0x20,
+ 0x63,0x20,0x23,0x39,0x32,0x38,0x43,0x37,0x31,0x22,0x2c,0xa,0x22,0x6f,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x32,0x38,0x45,0x34,0x34,0x22,0x2c,0xa,0x22,0x4f,0x2e,0x20,
+ 0x63,0x20,0x23,0x41,0x41,0x39,0x46,0x37,0x34,0x22,0x2c,0xa,0x22,0x2b,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x39,0x41,0x34,0x35,0x36,0x22,0x2c,0xa,0x22,0x40,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x44,0x41,0x38,0x35,0x42,0x22,0x2c,0xa,0x22,0x23,0x2e,0x20,
+ 0x63,0x20,0x23,0x42,0x32,0x41,0x30,0x36,0x38,0x22,0x2c,0xa,0x22,0x24,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x38,0x37,0x30,0x30,0x22,0x2c,0xa,0x22,0x25,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x38,0x45,0x30,0x30,0x22,0x2c,0xa,0x22,0x26,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x32,0x39,0x41,0x30,0x30,0x22,0x2c,0xa,0x22,0x2a,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x34,0x39,0x36,0x32,0x46,0x22,0x2c,0xa,0x22,0x3d,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x43,0x41,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x2d,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x36,0x41,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x3b,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x31,0x41,0x43,0x31,0x42,0x22,0x2c,0xa,0x22,0x3a,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x42,0x33,0x31,0x41,0x22,0x2c,0xa,0x22,0x3e,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x41,0x39,0x32,0x32,0x22,0x2c,0xa,0x22,0x2c,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x34,0x41,0x45,0x32,0x42,0x22,0x2c,0xa,0x22,0x3c,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x41,0x31,0x32,0x45,0x22,0x2c,0xa,0x22,0x31,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x41,0x34,0x33,0x33,0x22,0x2c,0xa,0x22,0x32,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x44,0x42,0x34,0x32,0x38,0x22,0x2c,0xa,0x22,0x33,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x32,0x42,0x32,0x33,0x42,0x22,0x2c,0xa,0x22,0x34,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x36,0x41,0x32,0x30,0x30,0x22,0x2c,0xa,0x22,0x35,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x41,0x35,0x30,0x39,0x22,0x2c,0xa,0x22,0x36,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x41,0x41,0x46,0x30,0x30,0x22,0x2c,0xa,0x22,0x37,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x41,0x43,0x31,0x45,0x22,0x2c,0xa,0x22,0x38,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x35,0x41,0x31,0x30,0x30,0x22,0x2c,0xa,0x22,0x39,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x41,0x44,0x30,0x32,0x22,0x2c,0xa,0x22,0x30,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x43,0x41,0x46,0x30,0x44,0x22,0x2c,0xa,0x22,0x71,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x43,0x42,0x30,0x30,0x35,0x22,0x2c,0xa,0x22,0x77,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x42,0x36,0x30,0x43,0x22,0x2c,0xa,0x22,0x65,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x42,0x44,0x30,0x30,0x22,0x2c,0xa,0x22,0x72,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x42,0x44,0x31,0x36,0x22,0x2c,0xa,0x22,0x74,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x33,0x42,0x34,0x33,0x32,0x22,0x2c,0xa,0x22,0x79,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x38,0x42,0x46,0x33,0x43,0x22,0x2c,0xa,0x22,0x75,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x36,0x42,0x45,0x32,0x46,0x22,0x2c,0xa,0x22,0x69,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x36,0x41,0x39,0x34,0x39,0x22,0x2c,0xa,0x22,0x70,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x39,0x41,0x39,0x34,0x38,0x22,0x2c,0xa,0x22,0x61,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x38,0x41,0x42,0x35,0x32,0x22,0x2c,0xa,0x22,0x73,0x2e,0x20,
+ 0x63,0x20,0x23,0x44,0x42,0x42,0x41,0x34,0x35,0x22,0x2c,0xa,0x22,0x64,0x2e,0x20,
+ 0x63,0x20,0x23,0x43,0x35,0x42,0x31,0x36,0x32,0x22,0x2c,0xa,0x22,0x66,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x43,0x42,0x37,0x34,0x44,0x22,0x2c,0xa,0x22,0x67,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x42,0x38,0x34,0x31,0x22,0x2c,0xa,0x22,0x68,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x46,0x42,0x45,0x34,0x41,0x22,0x2c,0xa,0x22,0x6a,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x41,0x42,0x41,0x35,0x35,0x22,0x2c,0xa,0x22,0x6b,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x43,0x30,0x30,0x36,0x22,0x2c,0xa,0x22,0x6c,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x43,0x31,0x30,0x42,0x22,0x2c,0xa,0x22,0x7a,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x43,0x38,0x30,0x30,0x22,0x2c,0xa,0x22,0x78,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x43,0x39,0x30,0x44,0x22,0x2c,0xa,0x22,0x63,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x41,0x43,0x31,0x31,0x33,0x22,0x2c,0xa,0x22,0x76,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x42,0x43,0x31,0x31,0x43,0x22,0x2c,0xa,0x22,0x62,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x44,0x43,0x39,0x31,0x30,0x22,0x2c,0xa,0x22,0x6e,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x44,0x43,0x32,0x33,0x33,0x22,0x2c,0xa,0x22,0x6d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x35,0x43,0x33,0x32,0x44,0x22,0x2c,0xa,0x22,0x4d,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x43,0x37,0x32,0x38,0x22,0x2c,0xa,0x22,0x4e,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x34,0x43,0x35,0x33,0x37,0x22,0x2c,0xa,0x22,0x42,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x36,0x43,0x36,0x33,0x41,0x22,0x2c,0xa,0x22,0x56,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x35,0x43,0x42,0x33,0x36,0x22,0x2c,0xa,0x22,0x43,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x37,0x33,0x44,0x22,0x2c,0xa,0x22,0x5a,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x43,0x36,0x35,0x39,0x22,0x2c,0xa,0x22,0x41,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x41,0x43,0x38,0x35,0x41,0x22,0x2c,0xa,0x22,0x53,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x41,0x34,0x42,0x22,0x2c,0xa,0x22,0x44,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x44,0x35,0x44,0x22,0x2c,0xa,0x22,0x46,0x2e,0x20,
+ 0x63,0x20,0x23,0x45,0x39,0x43,0x44,0x36,0x42,0x22,0x2c,0xa,0x22,0x47,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x44,0x35,0x36,0x30,0x22,0x2c,0xa,0x22,0x48,0x2e,0x20,
+ 0x63,0x20,0x23,0x46,0x46,0x45,0x30,0x36,0x43,0x22,0x2c,0xa,0x22,0x4a,0x2e,0x20,
+ 0x63,0x20,0x67,0x72,0x61,0x79,0x35,0x36,0x22,0x2c,0xa,0x22,0x4b,0x2e,0x20,0x63,
+ 0x20,0x23,0x39,0x35,0x39,0x35,0x39,0x35,0x22,0x2c,0xa,0x22,0x4c,0x2e,0x20,0x63,
+ 0x20,0x67,0x72,0x61,0x79,0x36,0x32,0x22,0x2c,0xa,0x22,0x50,0x2e,0x20,0x63,0x20,
+ 0x23,0x41,0x36,0x41,0x31,0x38,0x41,0x22,0x2c,0xa,0x22,0x49,0x2e,0x20,0x63,0x20,
+ 0x23,0x41,0x38,0x41,0x36,0x39,0x45,0x22,0x2c,0xa,0x22,0x55,0x2e,0x20,0x63,0x20,
+ 0x23,0x41,0x45,0x41,0x38,0x39,0x35,0x22,0x2c,0xa,0x22,0x59,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x33,0x41,0x43,0x38,0x46,0x22,0x2c,0xa,0x22,0x54,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x38,0x41,0x46,0x38,0x42,0x22,0x2c,0xa,0x22,0x52,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x34,0x41,0x44,0x39,0x36,0x22,0x2c,0xa,0x22,0x45,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x38,0x42,0x31,0x39,0x39,0x22,0x2c,0xa,0x22,0x57,0x2e,0x20,0x63,0x20,
+ 0x23,0x41,0x34,0x41,0x34,0x41,0x34,0x22,0x2c,0xa,0x22,0x51,0x2e,0x20,0x63,0x20,
+ 0x23,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x2c,0xa,0x22,0x21,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x30,0x41,0x44,0x41,0x33,0x22,0x2c,0xa,0x22,0x7e,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x42,0x42,0x36,0x41,0x33,0x22,0x2c,0xa,0x22,0x5e,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x31,0x42,0x31,0x42,0x31,0x22,0x2c,0xa,0x22,0x2f,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x39,0x42,0x39,0x42,0x36,0x22,0x2c,0xa,0x22,0x28,0x2e,0x20,0x63,0x20,
+ 0x23,0x42,0x42,0x42,0x42,0x42,0x41,0x22,0x2c,0xa,0x22,0x29,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x35,0x42,0x43,0x39,0x44,0x22,0x2c,0xa,0x22,0x5f,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x32,0x42,0x43,0x41,0x32,0x22,0x2c,0xa,0x22,0x60,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x31,0x42,0x45,0x42,0x35,0x22,0x2c,0xa,0x22,0x27,0x2e,0x20,0x63,0x20,
+ 0x23,0x44,0x32,0x43,0x33,0x38,0x45,0x22,0x2c,0xa,0x22,0x5d,0x2e,0x20,0x63,0x20,
+ 0x23,0x44,0x43,0x43,0x37,0x38,0x43,0x22,0x2c,0xa,0x22,0x5b,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x37,0x43,0x30,0x41,0x37,0x22,0x2c,0xa,0x22,0x7b,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x37,0x43,0x32,0x41,0x45,0x22,0x2c,0xa,0x22,0x7d,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x37,0x43,0x33,0x42,0x32,0x22,0x2c,0xa,0x22,0x7c,0x2e,0x20,0x63,0x20,
+ 0x23,0x43,0x35,0x43,0x32,0x42,0x38,0x22,0x2c,0xa,0x22,0x20,0x58,0x20,0x63,0x20,
+ 0x23,0x43,0x41,0x43,0x36,0x42,0x36,0x22,0x2c,0xa,0x22,0x2e,0x58,0x20,0x63,0x20,
+ 0x23,0x43,0x42,0x43,0x39,0x42,0x45,0x22,0x2c,0xa,0x22,0x58,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x39,0x44,0x33,0x42,0x42,0x22,0x2c,0xa,0x22,0x6f,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x36,0x44,0x30,0x38,0x41,0x22,0x2c,0xa,0x22,0x4f,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x37,0x44,0x45,0x42,0x44,0x22,0x2c,0xa,0x22,0x2b,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x43,0x44,0x45,0x42,0x33,0x22,0x2c,0xa,0x22,0x40,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x46,0x46,0x30,0x42,0x39,0x22,0x2c,0xa,0x22,0x23,0x58,0x20,0x63,0x20,
+ 0x23,0x43,0x35,0x43,0x35,0x43,0x35,0x22,0x2c,0xa,0x22,0x24,0x58,0x20,0x63,0x20,
+ 0x23,0x43,0x45,0x43,0x43,0x43,0x37,0x22,0x2c,0xa,0x22,0x25,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x30,0x43,0x45,0x43,0x35,0x22,0x2c,0xa,0x22,0x26,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x30,0x43,0x46,0x43,0x38,0x22,0x2c,0xa,0x22,0x2a,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x32,0x44,0x31,0x43,0x42,0x22,0x2c,0xa,0x22,0x3d,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x42,0x44,0x36,0x43,0x35,0x22,0x2c,0xa,0x22,0x2d,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x42,0x44,0x37,0x43,0x39,0x22,0x2c,0xa,0x22,0x3b,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x33,0x44,0x33,0x44,0x31,0x22,0x2c,0xa,0x22,0x3a,0x58,0x20,0x63,0x20,
+ 0x23,0x44,0x42,0x44,0x42,0x44,0x42,0x22,0x2c,0xa,0x22,0x3e,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x35,0x45,0x31,0x44,0x36,0x22,0x2c,0xa,0x22,0x2c,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x35,0x45,0x33,0x44,0x41,0x22,0x2c,0xa,0x22,0x3c,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x38,0x45,0x35,0x44,0x39,0x22,0x2c,0xa,0x22,0x31,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x44,0x45,0x41,0x44,0x43,0x22,0x2c,0xa,0x22,0x32,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x45,0x46,0x36,0x44,0x45,0x22,0x2c,0xa,0x22,0x33,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x36,0x45,0x36,0x45,0x36,0x22,0x2c,0xa,0x22,0x34,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x39,0x45,0x37,0x45,0x32,0x22,0x2c,0xa,0x22,0x35,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x39,0x45,0x38,0x45,0x34,0x22,0x2c,0xa,0x22,0x36,0x58,0x20,0x63,0x20,
+ 0x23,0x45,0x44,0x45,0x43,0x45,0x41,0x22,0x2c,0xa,0x22,0x37,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x32,0x46,0x31,0x45,0x42,0x22,0x2c,0xa,0x22,0x38,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x31,0x46,0x31,0x46,0x31,0x22,0x2c,0xa,0x22,0x39,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x38,0x46,0x37,0x46,0x34,0x22,0x2c,0xa,0x22,0x30,0x58,0x20,0x63,0x20,
+ 0x23,0x46,0x39,0x46,0x38,0x46,0x38,0x22,0x2c,0xa,0x22,0x71,0x58,0x20,0x63,0x20,
+ 0x4e,0x6f,0x6e,0x65,0x22,0x2c,0xa,0x2f,0x2a,0x20,0x70,0x69,0x78,0x65,0x6c,0x73,
+ 0x20,0x2a,0x2f,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x35,
+ 0x20,0x31,0x20,0x2c,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x56,
+ 0x20,0x2f,0x2e,0x26,0x58,0x51,0x2e,0x46,0x20,0x31,0x20,0x2c,0x20,0x20,0x20,0x20,
+ 0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x35,0x20,0x5f,0x2e,0x44,0x2e,0x53,0x2e,0x48,0x2e,0x40,0x58,0x26,0x58,0x36,
+ 0x20,0x2e,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x53,0x2e,0x3d,0x2e,0x77,0x20,0x67,0x20,0x26,
+ 0x2e,0x43,0x2e,0x2e,0x2e,0x2b,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x2d,0x2e,0x27,0x20,0x2b,
+ 0x20,0x6f,0x20,0x74,0x20,0x7a,0x2e,0x64,0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x43,0x20,0x56,
+ 0x2e,0x40,0x2e,0x2b,0x20,0x20,0x20,0x33,0x20,0x3a,0x2e,0x33,0x2e,0x2c,0x20,0x20,
+ 0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,
+ 0x20,0x27,0x2e,0x62,0x2e,0x46,0x2e,0x36,0x20,0x2c,0x20,0x31,0x20,0x73,0x2e,0x2c,
+ 0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x31,0x20,0x62,0x20,0x28,0x20,0x6e,0x2e,0x4f,0x58,0x45,0x2e,0x45,
+ 0x2e,0x46,0x2e,0x5e,0x20,0x2b,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x31,
+ 0x20,0x2c,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x6c,0x20,0x78,0x20,0x4b,0x20,0x41,
+ 0x2e,0x6f,0x58,0x6f,0x58,0x5a,0x2e,0x69,0x2e,0x2c,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x56,0x20,0x26,
+ 0x58,0x30,0x58,0x36,0x58,0x2c,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x38,0x20,0x28,0x20,0x63,0x2e,0x76,0x2e,0x6b,0x2e,0x4e,0x2e,0x31,0x20,0x20,
+ 0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x56,0x20,0x24,
+ 0x58,0x30,0x58,0x30,0x58,0x39,0x58,0x58,0x58,0x2c,0x20,0x20,0x20,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x20,0x20,0x20,0x20,0x4f,0x20,0x74,0x20,0x36,0x2e,0x65,0x2e,0x65,0x2e,0x6b,
+ 0x2e,0x53,0x20,0x4f,0x20,0x20,0x20,0x20,0x20,0x35,0x20,0x35,0x20,0x56,0x20,0x24,
+ 0x58,0x38,0x58,0x38,0x58,0x38,0x58,0x31,0x58,0x44,0x20,0x3a,0x20,0x4f,0x20,0x20,
+ 0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x33,0x20,0x4a,0x20,0x65,
+ 0x2e,0x47,0x2e,0x37,0x58,0x23,0x2e,0x2b,0x20,0x2e,0x20,0x35,0x20,0x43,0x20,0x7c,
+ 0x2e,0x33,0x58,0x33,0x58,0x35,0x58,0x34,0x58,0x5f,0x2e,0x34,0x20,0x25,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,
+ 0x20,0x71,0x20,0x5d,0x2e,0x30,0x58,0x30,0x58,0x2b,0x58,0x2c,0x20,0x42,0x20,0x7d,
+ 0x2e,0x3a,0x58,0x3a,0x58,0x3a,0x58,0x3a,0x58,0x3d,0x58,0x53,0x20,0x26,0x20,0x6f,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x20,0x20,0x2b,0x20,0x4d,0x20,0x38,0x58,0x38,0x58,0x37,0x58,0x55,
+ 0x2e,0x51,0x2e,0x23,0x58,0x2a,0x58,0x2a,0x58,0x2a,0x58,0x52,0x2e,0x3c,0x20,0x25,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x2c,0x20,0x31,0x20,0x20,0x58,0x36,
+ 0x58,0x57,0x2e,0x47,0x20,0x51,0x2e,0x4c,0x2e,0x5e,0x2e,0x7b,0x2e,0x5a,0x20,0x40,
+ 0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,
+ 0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x6d,0x20,0x50,
+ 0x2e,0x57,0x2e,0x3a,0x58,0x36,0x20,0x2e,0x20,0x33,0x58,0x2f,0x2e,0x58,0x2e,0x2c,
+ 0x20,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x35,0x20,0x6e,0x20,0x2b,
+ 0x2e,0x52,0x2e,0x57,0x2e,0x4a,0x2e,0x4b,0x2e,0x57,0x2e,0x5e,0x2e,0x3a,0x58,0x3a,
+ 0x58,0x31,0x58,0x6d,0x20,0x2b,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x69,0x20,0x6f,0x2e,0x79,
+ 0x2e,0x76,0x2e,0x71,0x2e,0x2f,0x20,0x50,0x2e,0x49,0x2e,0x7d,0x20,0x7c,0x20,0x52,
+ 0x2e,0x26,0x58,0x2a,0x58,0x3b,0x58,0x38,0x58,0x20,0x2e,0x2c,0x20,0x20,0x20,0x20,
+ 0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x35,0x20,0x35,0x20,0x35,0x20,0x52,0x20,0x33,0x2e,0x4d,
+ 0x2e,0x35,0x2e,0x45,0x20,0x4c,0x20,0x37,0x2e,0x34,0x2e,0x5f,0x20,0x30,0x20,0x2b,
+ 0x20,0x4f,0x20,0x2b,0x20,0x69,0x20,0x29,0x2e,0x23,0x58,0x23,0x58,0x35,0x58,0x7e,
+ 0x2e,0x2c,0x20,0x4f,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x35,0x20,0x75,0x20,0x5d,0x20,0x6d,0x2e,0x72,
+ 0x2e,0x25,0x2e,0x48,0x20,0x72,0x20,0x3a,0x20,0x2c,0x20,0x74,0x2e,0x30,0x2e,0x50,
+ 0x20,0x37,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x24,0x20,0x2c,0x20,0x7b,0x20,0x60,
+ 0x2e,0x28,0x2e,0x3b,0x58,0x2d,0x58,0x2c,0x20,0x2b,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x35,0x20,0x75,0x20,0x32,0x2e,0x77,
+ 0x2e,0x24,0x2e,0x6b,0x20,0x74,0x20,0x6f,0x20,0x20,0x20,0x2c,0x20,0x7e,0x20,0x68,
+ 0x2e,0x50,0x20,0x6c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x2c,0x20,0x75,0x20,0x54,0x2e,0x5e,0x2e,0x23,0x58,0x3c,0x58,0x4e,0x20,0x2c,
+ 0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x35,0x20,0x3e,
+ 0x2e,0x39,0x2e,0x55,0x20,0x72,0x20,0x2e,0x20,0x20,0x20,0x2e,0x20,0x2c,0x20,0x54,
+ 0x20,0x42,0x2e,0x2a,0x2e,0x78,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x2b,0x20,0x2c,0x20,0x51,0x20,0x21,0x2e,0x51,
+ 0x2e,0x3c,0x58,0x43,0x20,0x2c,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x70,0x20,0x71,0x2e,0x31,0x2e,0x3e,0x20,0x2e,0x20,0x20,0x20,0x2b,0x20,0x31,
+ 0x20,0x5b,0x20,0x6d,0x2e,0x70,0x2e,0x6b,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x2c,
+ 0x20,0x75,0x20,0x4f,0x2e,0x57,0x2e,0x3b,0x58,0x21,0x20,0x2b,0x20,0x20,0x20,0x20,
+ 0x20,0x22,0x2c,0xa,0x22,0x34,0x20,0x38,0x2e,0x6a,0x2e,0x60,0x20,0x70,0x20,0x35,
+ 0x20,0x79,0x20,0x3b,0x2e,0x75,0x2e,0x61,0x2e,0x64,0x20,0x25,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x4f,0x20,0x2c,0x20,0x41,0x20,0x50,0x2e,0x5f,0x2e,0x2c,
+ 0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x31,0x20,0x78,0x20,0x3c,0x2e,0x66,
+ 0x2e,0x6d,0x2e,0x78,0x2e,0x62,0x2e,0x79,0x2e,0x61,0x2e,0x67,0x20,0x3b,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x2b,0x20,0x30,
+ 0x20,0x76,0x20,0x4f,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,0x22,0x20,0x20,0x2d,
+ 0x20,0x68,0x20,0x63,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x57,0x20,0x7a,0x20,0x3a,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x2e,0x20,0x2e,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x22,0x2c,0xa,
+ 0x22,0x20,0x20,0x20,0x20,0x20,0x20,0x2a,0x20,0x65,0x20,0x6c,0x20,0x6c,0x20,0x66,
+ 0x20,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x22,0x2c,0xa,0x22,0x71,0x58,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x20,0x20,0x20,
+ 0x20,0x20,0x20,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x20,
+ 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,0x22,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x22,0x2c,0xa,
+ 0x22,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,0x58,0x71,
+ 0x58,0x22,0xa,0x7d,0x3b,0xa,
+ ]
+
+@@qt_resource_name = [
+ # fileopen.xpm
+ 0x0,0xc,
+ 0xb,0x21,0x7,0xad,
+ 0x0,0x66,
+ 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x6f,0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ # filesave.xpm
+ 0x0,0xc,
+ 0x5,0x68,0x6,0x4d,
+ 0x0,0x66,
+ 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x73,0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ # editcopy.xpm
+ 0x0,0xc,
+ 0xb,0xe,0x4a,0x2d,
+ 0x0,0x65,
+ 0x0,0x64,0x0,0x69,0x0,0x74,0x0,0x63,0x0,0x6f,0x0,0x70,0x0,0x79,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ # filenew.xpm
+ 0x0,0xb,
+ 0x4,0x14,0x5a,0xed,
+ 0x0,0x66,
+ 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x6e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ # editpaste.xpm
+ 0x0,0xd,
+ 0xd,0xc9,0x33,0xcd,
+ 0x0,0x65,
+ 0x0,0x64,0x0,0x69,0x0,0x74,0x0,0x70,0x0,0x61,0x0,0x73,0x0,0x74,0x0,0x65,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ # editcut.xpm
+ 0x0,0xb,
+ 0xa,0x10,0x3e,0x2d,
+ 0x0,0x65,
+ 0x0,0x64,0x0,0x69,0x0,0x74,0x0,0x63,0x0,0x75,0x0,0x74,0x0,0x2e,0x0,0x78,0x0,0x70,0x0,0x6d,
+ ]
+
+@@qt_resource_struct = [
+ # :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x1,
+ # :/filenew.xpm
+ 0x0,0x0,0x0,0x5a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x44,0x97,
+ # :/filesave.xpm
+ 0x0,0x0,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x18,0xfd,
+ # :/editcut.xpm
+ 0x0,0x0,0x0,0x96,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x71,0xa0,
+ # :/editcopy.xpm
+ 0x0,0x0,0x0,0x3c,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x31,0xfa,
+ # :/fileopen.xpm
+ 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+ # :/editpaste.xpm
+ 0x0,0x0,0x0,0x76,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x58,0xa4,
+]
+
+ def self.qInitResources_application()
+ Qt.qRegisterResourceData(0x01, QCleanupResources__dest_class__.qt_resource_struct.pack("C*"), QCleanupResources__dest_class__.qt_resource_name.pack("C*"), QCleanupResources__dest_class__.qt_resource_data.pack("C*"))
+ return 1
+ end
+ def self.qCleanupResources_application()
+ Qt.qUnregisterResourceData(0x01, QCleanupResources__dest_class__.qt_resource_struct.pack("C*"), QCleanupResources__dest_class__.qt_resource_name.pack("C*"), QCleanupResources__dest_class__.qt_resource_data.pack("C*"))
+ return 1
+ end
+
+end
+
+QCleanupResources__dest_class__.qInitResources_application()
diff --git a/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevelop b/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevelop
new file mode 100644
index 00000000..4afe7bca
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevelop
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevcustomproject>
+ <general>
+ <activedir/>
+ </general>
+ </kdevcustomproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Ruby files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>CVS,.svn</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="rb" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ <mainprogram>./main.rb</mainprogram>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevtemplate b/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevtemplate
new file mode 100644
index 00000000..bd778450
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/qtruby4app.kdevtemplate
@@ -0,0 +1,166 @@
+# KDE Config File
+[General]
+Name=QtRuby4 Application
+Name[ca]=Aplicació en QtRuby4
+Name[da]=QtRuby4-program
+Name[de]=QtRuby4-Anwendung
+Name[el]=Εφαρμογή QtRuby4
+Name[es]=Aplicación en QtRuby4
+Name[et]=QtRuby4 rakendus
+Name[hu]=QtRuby4-alapú alkalmazás
+Name[it]=Applicazione QtRuby4
+Name[nds]=QtRuby4-Programm
+Name[nl]=QtRuby4-programma
+Name[pl]=Program w QtRuby
+Name[pt]=Aplicação em QtRuby4
+Name[pt_BR]=Aplicativo QtRuby4
+Name[ru]=Приложение QtRuby4
+Name[sk]=QtRuby4 Aplikácia
+Name[sr]=QtRuby4 програм
+Name[sr@Latn]=QtRuby4 program
+Name[sv]=QtRuby 4-program
+Name[zh_TW]=QtRuby4 應用程式
+Icon=qtruby4app.png
+Category=Ruby/Qt
+Category[fr]=Ruby/Qt
+Comment=Generate a QtRuby4 based application (crossplatform compatible) - Needs QtRuby4
+Comment[ca]=Genera una aplicació basada en QtRuby4 (compatible plataforma creuada) - Necessita QtRuby4
+Comment[da]=Genererer et QtRuby4-baseret program (krydsplatformskompatibelt) - kræver QtRuby4
+Comment[de]=Erstellt eine auf QtRuby4 basierende Anwendung (plattformunabhängig). - Benötigt QtRuby4.
+Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης στην QtRuby4 (πολλαπλών πλατφόρμων) - Απαιτείται η QtRuby4
+Comment[es]=Genera una aplicación basada en QtRuby4 (con compatibilidad multiplataforma) - Necesita QtRuby4
+Comment[et]=Rakenduse loomine QtRuby4 põhjal (multiplatvormne) - vajalik on QtRuby4
+Comment[hu]=Létrehoz egy QtRuby4-alapú, keresztfordításra is alkalmas alkalmazást - QtRuby4-et igényel
+Comment[it]=Genera un'applicazione basata su QtRuby4 (compatibile multipiattaforma) - serve QtRuby4
+Comment[nds]=Stellt en op QRubyt4 opbuut Programm op (över Bedriefümgeven weg kompatibel) - QtRuby4 deit noot
+Comment[nl]=Genereer een QtRuby4-gebaseerd programma (crossplatform-compatible) - heeft QtRuby4 nodig
+Comment[pl]=Generuje program używający QtRuby4 (wieloplatformowy) - wymaga QtRuby4
+Comment[pt]=Gera uma aplicação baseada no QtRuby4 (compatível com várias plataformas) - Necessita do QtRuby4
+Comment[pt_BR]=Gera uma aplicação baseada no QtRuby4 (compatível com várias plataformas) - Necessita do QtRuby4
+Comment[ru]=Создание кроссплатформенного приложения Qt 4 на Ruby. Требует QtRuby4.
+Comment[sk]=Vygeneruje aplikáciu založenú na QtRuby4 (multiplatformovo kompatibilnú) - vyžaduje QtRuby4
+Comment[sr]=Прави програм на основи QtRuby4 (прекоплатформски компатибилан) — захтева QtRuby4
+Comment[sr@Latn]=Pravi program na osnovi QtRuby4 (prekoplatformski kompatibilan) — zahteva QtRuby4
+Comment[sv]=Skapar ett QtRuby 4-baserat program (fungerar på andra plattformar). Kräver QtRuby 4.
+Comment[zh_TW]=產生一個 QtRuby4 為基礎的應用程式(跨平台相容)─需要 QtRuby4
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.rb,%{dest}/ReadMe
+Archive=qtruby4app.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qtruby4app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/main.rb
+Dest=%{dest}/main.rb
+
+[FILE3]
+Type=install
+Source=%{src}/qtruby4app.rb
+Dest=%{dest}/%{APPNAMELC}.rb
+
+[FILE4]
+Type=install
+Source=%{src}/app-Makefile
+Dest=%{dest}/Makefile
+
+[FILE5]
+Type=install
+Source=%{src}/fileopen.xpm
+Dest=%{dest}/fileopen.xpm
+
+[FILE6]
+Type=install
+Source=%{src}/filesave.xpm
+Dest=%{dest}/filesave.xpm
+
+[FILE7]
+Type=install
+Source=%{src}/filenew.xpm
+Dest=%{dest}/filenew.xpm
+
+[FILE8]
+Type=install
+Source=%{src}/editcopy.xpm
+Dest=%{dest}/editcopy.xpm
+
+[FILE9]
+Type=install
+Source=%{src}/editpaste.xpm
+Dest=%{dest}/editpaste.xpm
+
+[FILE10]
+Type=install
+Source=%{src}/editcut.xpm
+Dest=%{dest}/editcut.xpm
+
+[FILE11]
+Type=install
+Source=%{src}/application.qrc
+Dest=%{dest}/application.qrc
+
+[FILE12]
+Type=install
+Source=%{src}/ReadMe
+Dest=%{dest}/ReadMe
+
+[FILE13]
+Type=install
+Source=%{src}/app.filelist
+Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist
+
+[MSG]
+Type=message
+Comment=A QtRuby4 based application was created in %{dest}
+Comment[ca]=Una aplicació basada en QtRuby4 ha estat creada en %{dest}
+Comment[da]=Et QtRuby4-baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf QtRuby4 basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μία εφαρμογή βασισμένη στην QtRuby4 δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en QtRuby4 ha sido creada en %{dest}
+Comment[et]=Rakendus QtRuby4 põhjal loodi asukohta %{dest}
+Comment[hu]=Létrejött egy QtRuby4-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su QtRuby4 in %{dest}
+Comment[nds]=In %{dest} wöör en op QtRuby4 opbuut Programm opstellt.
+Comment[nl]=Een QtRuby4-gebaseerd programma is aangemaakt in %{dest}
+Comment[pl]=Program używający QtRuby4 został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada em QtRuby4 em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada em QtRuby4 em %{dest}
+Comment[ru]=Приложение QtRuby4 создано в %{dest}
+Comment[sk]=QtRuby4 aplikácia bola vytvorená v %{dest}
+Comment[sr]=QtRuby4 програм је направљен у %{dest}
+Comment[sr@Latn]=QtRuby4 program je napravljen u %{dest}
+Comment[sv]=Ett program baserat på QtRuby 4 skapades i %{dest}
+Comment[zh_TW]=一個 QtRuby4 為基礎的應用程式框架已建立於 %{dest}
+
+Comment=
+
+[DESIGNER]
+Type=value
+ValueType=QString
+Value=DESIGNER
+Comment=Absolute Path for Designer (Qt4).
+Comment[ca]=Ruta absoluta per a Designer (Qt4).
+Comment[da]=Absolut søgesti til Designer (Qt4).
+Comment[de]=Absoluter Pfad für Designer (Qt4).
+Comment[el]=Απόλυτη διαδρομή για τον Σχεδιαστή (Qt4).
+Comment[es]=Ruta completa para Designer (Qt4).
+Comment[et]=Disaineri (Qt4) absoluutne asukoht.
+Comment[fr]=Chemin absolu pour Designer (Qt4).
+Comment[hu]=A Designer (Qt4) teljes elérési útja
+Comment[it]=Percorso assoluto del Designer (Qt4).
+Comment[ja]=Designer (Qt4) の絶対パス
+Comment[nds]=Afsluut Padd för Designer (Qt4)
+Comment[nl]=Absoluut pad naar Designer (Qt4).
+Comment[pl]=Ścieżka bezwzględna do Designera (Qt4).
+Comment[pt]=Localização Absoluta do Designer (Qt4).
+Comment[pt_BR]=Localização Absoluta do Designer (Qt4).
+Comment[ru]=Полный путь к Designer (Qt 4).
+Comment[sk]=Absolútna cesta ku Designer (Qt4).
+Comment[sr]=Апсолутна путања до Designer-а (Qt4).
+Comment[sr@Latn]=Apsolutna putanja do Designer-a (Qt4).
+Comment[sv]=Absolut sökväg till Designer (Qt4).
+Comment[zh_TW]=設計家(Qt4)的絕對路徑
+Default=
diff --git a/languages/ruby/app_templates/qtruby4app/qtruby4app.png b/languages/ruby/app_templates/qtruby4app/qtruby4app.png
new file mode 100644
index 00000000..96a7e0bf
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/qtruby4app.png
Binary files differ
diff --git a/languages/ruby/app_templates/qtruby4app/qtruby4app.rb b/languages/ruby/app_templates/qtruby4app/qtruby4app.rb
new file mode 100644
index 00000000..58dfa10a
--- /dev/null
+++ b/languages/ruby/app_templates/qtruby4app/qtruby4app.rb
@@ -0,0 +1,263 @@
+
+class %{APPNAME} < Qt::MainWindow
+
+ slots :newFile,
+ :open,
+ :save,
+ :saveAs,
+ :about,
+ :documentWasModified
+
+ def initialize
+ super
+ @textEdit = Qt::TextEdit.new
+ setCentralWidget(@textEdit)
+
+ createActions()
+ createMenus()
+ createToolBars()
+ createStatusBar()
+
+ readSettings()
+
+ connect(@textEdit.document, SIGNAL(:contentsChanged),
+ self, SLOT(:documentWasModified))
+
+ setCurrentFile("")
+ end
+
+ def closeEvent(event)
+ if maybeSave
+ writeSettings
+ event.accept
+ else
+ event.ignore
+ end
+ end
+
+ def newFile()
+ if maybeSave
+ @textEdit.clear
+ setCurrentFile("")
+ end
+ end
+
+ def open()
+ if maybeSave
+ fileName = Qt::FileDialog.getOpenFileName(self)
+ if !fileName.nil?
+ loadFile(fileName)
+ end
+ end
+ end
+
+ def save()
+ if @curFile.nil?
+ return saveAs()
+ else
+ return saveFile(@curFile);
+ end
+ end
+
+ def saveAs()
+ fileName = Qt::FileDialog.getSaveFileName(self)
+ if fileName.nil?
+ return false
+ end
+
+ return saveFile(fileName)
+ end
+
+ def about()
+ Qt::MessageBox.about(self, tr("About Application"),
+ tr("The <b>Application</b> example demonstrates how to " \
+ "write modern GUI applications using Qt, with a menu bar, " \
+ "toolbars, and a status bar."))
+ end
+
+ def documentWasModified()
+ setWindowModified(true)
+ end
+
+ def createActions()
+ @newAct = Qt::Action.new(Qt::Icon.new(":/filenew.xpm"), tr("&New"), self)
+ @newAct.shortcut = tr("Ctrl+N")
+ @newAct.statusTip = tr("Create a new file")
+ connect(@newAct, SIGNAL(:triggered), self, SLOT(:newFile))
+
+ @openAct = Qt::Action.new(Qt::Icon.new(":/fileopen.xpm"), tr("&Open..."), self)
+ @openAct.shortcut = tr("Ctrl+O")
+ @openAct.statusTip = tr("Open an existing file")
+ connect(@openAct, SIGNAL(:triggered), self, SLOT(:open))
+
+ @saveAct = Qt::Action.new(Qt::Icon.new(":/filesave.xpm"), tr("&Save"), self)
+ @saveAct.shortcut = tr("Ctrl+S")
+ @saveAct.statusTip = tr("Save the document to disk")
+ connect(@saveAct, SIGNAL(:triggered), self, SLOT(:save))
+
+ @saveAsAct = Qt::Action.new(tr("Save &As..."), self)
+ @saveAsAct.statusTip = tr("Save the document under a new name")
+ connect(@saveAsAct, SIGNAL(:triggered), self, SLOT(:saveAs))
+
+ @exitAct = Qt::Action.new(tr("E&xit"), self)
+ @exitAct.shortcut = tr("Ctrl+Q")
+ @exitAct.statusTip = tr("Exit the application")
+ connect(@exitAct, SIGNAL(:triggered), self, SLOT(:close))
+
+ @cutAct = Qt::Action.new(Qt::Icon.new(":/editcut.xpm"), tr("Cu&t"), self)
+ @cutAct.shortcut = tr("Ctrl+X")
+ @cutAct.statusTip = tr("Cut the current selection's contents to the " \
+ "clipboard")
+ connect(@cutAct, SIGNAL(:triggered), @textEdit, SLOT(:cut))
+
+ @copyAct = Qt::Action.new(Qt::Icon.new(":/editcopy.xpm"), tr("&Copy"), self)
+ @copyAct.shortcut = tr("Ctrl+C")
+ @copyAct.statusTip = tr("Copy the current selection's contents to the " \
+ "clipboard")
+ connect(@copyAct, SIGNAL(:triggered), @textEdit, SLOT(:copy))
+
+ @pasteAct = Qt::Action.new(Qt::Icon.new(":/editpaste.xpm"), tr("&Paste"), self)
+ @pasteAct.shortcut = tr("Ctrl+V")
+ @pasteAct.statusTip = tr("Paste the clipboard's contents into the current " \
+ "selection")
+ connect(@pasteAct, SIGNAL(:triggered), @textEdit, SLOT(:paste))
+
+ @aboutAct = Qt::Action.new(tr("&About"), self)
+ @aboutAct.statusTip = tr("Show the application's About box")
+ connect(@aboutAct, SIGNAL(:triggered), self, SLOT(:about))
+
+ @aboutQtAct = Qt::Action.new(tr("About &Qt"), self)
+ @aboutQtAct.statusTip = tr("Show the Qt library's About box")
+ connect(@aboutQtAct, SIGNAL(:triggered), $qApp, SLOT(:aboutQt))
+
+ @cutAct.setEnabled(false)
+ @copyAct.setEnabled(false)
+ connect(@textEdit, SIGNAL('copyAvailable(bool)'),
+ @cutAct, SLOT('setEnabled(bool)'))
+ connect(@textEdit, SIGNAL('copyAvailable(bool)'),
+ @copyAct, SLOT('setEnabled(bool)'))
+ end
+
+ def createMenus()
+ @fileMenu = menuBar().addMenu(tr("&File"))
+ @fileMenu.addAction(@newAct)
+ @fileMenu.addAction(@openAct)
+ @fileMenu.addAction(@saveAct)
+ @fileMenu.addAction(@saveAsAct)
+ @fileMenu.addSeparator()
+ @fileMenu.addAction(@exitAct)
+
+ @editMenu = menuBar.addMenu(tr("&Edit"))
+ @editMenu.addAction(@cutAct)
+ @editMenu.addAction(@copyAct)
+ @editMenu.addAction(@pasteAct)
+
+ menuBar.addSeparator()
+
+ @helpMenu = menuBar().addMenu(tr("&Help"))
+ @helpMenu.addAction(@aboutAct)
+ @helpMenu.addAction(@aboutQtAct)
+ end
+
+ def createToolBars()
+ @fileToolBar = addToolBar(tr("File"))
+ @fileToolBar.addAction(@newAct)
+ @fileToolBar.addAction(@openAct)
+ @fileToolBar.addAction(@saveAct)
+
+ @editToolBar = addToolBar(tr("Edit"))
+ @editToolBar.addAction(@cutAct)
+ @editToolBar.addAction(@copyAct)
+ @editToolBar.addAction(@pasteAct)
+ end
+
+ def createStatusBar()
+ statusBar.showMessage(tr("Ready"))
+ end
+
+ def readSettings()
+ settings = Qt::Settings.new("Trolltech", "Application Example")
+ pos = settings.value("pos", Qt::Variant.new(Qt::Point.new(200, 200))).toPoint()
+ size = settings.value("size", Qt::Variant.new(Qt::Size.new(400, 400))).toSize()
+ resize(size)
+ move(pos)
+ end
+
+ def writeSettings()
+ settings = Qt::Settings.new("Trolltech", "Application Example")
+ settings.setValue("pos", Qt::Variant.new(pos()))
+ settings.setValue("size", Qt::Variant.new(size()))
+ end
+
+ def maybeSave()
+ if @textEdit.document.modified?
+ ret = Qt::MessageBox.warning(self, tr("Application"),
+ tr("The document has been modified.\n" \
+ "Do you want to save your changes?"),
+ Qt::MessageBox::Yes | Qt::MessageBox::Default,
+ Qt::MessageBox::No,
+ Qt::MessageBox::Cancel | Qt::MessageBox::Escape)
+ if ret == Qt::MessageBox::Yes
+ return save()
+ elsif ret == Qt::MessageBox::Cancel
+ return false
+ end
+ end
+ return true
+ end
+
+ def loadFile(fileName)
+ file = Qt::File.new(fileName)
+ if !file.open(Qt::File::ReadOnly | Qt::File::Text)
+ Qt::MessageBox.warning( self, tr("Application"),
+ tr("Cannot read file %s\n%s." % [fileName, file.errorString]) )
+ return
+ end
+
+ inf = Qt::TextStream.new(file)
+ Qt::Application.overrideCursor = Qt::Cursor.new(Qt::WaitCursor)
+ @textEdit.setPlainText(inf.readAll)
+ Qt::Application.restoreOverrideCursor()
+
+ setCurrentFile(fileName)
+ statusBar.showMessage(tr("File loaded"), 2000)
+ end
+
+ def saveFile(fileName)
+ file = Qt::File.new(fileName)
+ if !file.open(Qt::File::WriteOnly | Qt::File::Text)
+ Qt::MessageBox.warning(self, tr("Application"),
+ tr("Cannot write file %s\n%s." % [fileName, file.errorString]) )
+ return false
+ end
+
+ outf = Qt::TextStream.new(file)
+ Qt::Application.overrideCursor = Qt::Cursor.new(Qt::WaitCursor)
+ outf << @textEdit.toPlainText()
+ Qt::Application.restoreOverrideCursor()
+ outf.flush
+
+ setCurrentFile(fileName)
+ statusBar().showMessage(tr("File saved"), 2000)
+ return true
+ end
+
+ def setCurrentFile(fileName)
+ @curFile = fileName;
+ @textEdit.document().modified = false
+ setWindowModified(false)
+
+ shownName = ""
+ if @curFile.nil?
+ shownName = "untitled.txt"
+ else
+ shownName = strippedName(@curFile)
+ end
+
+ setWindowTitle(tr("%s[*] - %s" % [shownName, tr("Application")]))
+ end
+
+ def strippedName(fullFileName)
+ return Qt::FileInfo.new(fullFileName).fileName()
+ end
+end \ No newline at end of file
diff --git a/languages/ruby/app_templates/qtrubyapp/Makefile.am b/languages/ruby/app_templates/qtrubyapp/Makefile.am
new file mode 100644
index 00000000..7fc1c803
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/Makefile.am
@@ -0,0 +1,18 @@
+dataFiles = main.rb qtrubyapp.rb qtrubyapp.png qtrubyapp.kdevelop \
+ filesave.xpm fileopen.xpm fileprint.xpm app.filelist app-Makefile README
+
+templateName = qtrubyapp
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/qtrubyapp/README b/languages/ruby/app_templates/qtrubyapp/README
new file mode 100644
index 00000000..9468893b
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/README
@@ -0,0 +1,29 @@
+QtRuby App template quick start
+Author: Anne-Marie Mahfouf
+Date: 2006-12-05
+-----------------------------------------------
+
+This README file explains you some basic things for starting with
+this application template.
+-----------------------------------------------
+
+-- REQUIREMENTS --
+you need
+- Qt version might be 3.3.4 or 3.3.5.
+- kdelibs 3.5 and kdelibs headers 3.5 (devel package) in order to build this template.
+- qtruby either from your distribution or from the kdebindings module or also from
+http://rubyforge.org/projects/korundum/.
+If you use the kdebindings module you need to build kdebindings/smoke/qt and then kdebindings/qtruby.
+
+-----------------------------------------------
+
+-- RUN --
+You will see that the Build menu in KDevelop is now adapted to Ruby.
+In the Build menu, choose Run or use Shift + F9 to see your project running.
+
+-----------------------------------------------
+
+-- RELEVANT LINK --
+http://developer.kde.org/language-bindings/ruby/index.html
+
+In KDevelop Documentation, you can find a Ruby tutorial. \ No newline at end of file
diff --git a/languages/ruby/app_templates/qtrubyapp/app-Makefile b/languages/ruby/app_templates/qtrubyapp/app-Makefile
new file mode 100644
index 00000000..88b5556e
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/app-Makefile
@@ -0,0 +1,7 @@
+uis := $(wildcard *.ui)
+
+all: $(uis)
+ @for name in $^; do rbuic $$name > `echo $$name | awk -F '\\\.ui$$' '{ print $$1 }' 2> /dev/null`.rb; echo "Running rbuic on $$name"; done
+
+clean: $(uis)
+ @for name in $^; do rm -f `echo $$name | awk -F '\\\.ui$$' '{ print $$1 }' 2> /dev/null`.rb; done
diff --git a/languages/ruby/app_templates/qtrubyapp/app.filelist b/languages/ruby/app_templates/qtrubyapp/app.filelist
new file mode 100644
index 00000000..339e6998
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/app.filelist
@@ -0,0 +1,3 @@
+# KDevelop Custom Project File List
+main.rb
+%{APPNAMELC}.rb
diff --git a/languages/ruby/app_templates/qtrubyapp/fileopen.xpm b/languages/ruby/app_templates/qtrubyapp/fileopen.xpm
new file mode 100644
index 00000000..880417ee
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/fileopen.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *fileopen[] = {
+" 16 13 5 1",
+". c #040404",
+"# c #808304",
+"a c None",
+"b c #f3f704",
+"c c #f3f7f3",
+"aaaaaaaaa...aaaa",
+"aaaaaaaa.aaa.a.a",
+"aaaaaaaaaaaaa..a",
+"a...aaaaaaaa...a",
+".bcb.......aaaaa",
+".cbcbcbcbc.aaaaa",
+".bcbcbcbcb.aaaaa",
+".cbcb...........",
+".bcb.#########.a",
+".cb.#########.aa",
+".b.#########.aaa",
+"..#########.aaaa",
+"...........aaaaa"
+};
diff --git a/languages/ruby/app_templates/qtrubyapp/fileprint.xpm b/languages/ruby/app_templates/qtrubyapp/fileprint.xpm
new file mode 100644
index 00000000..6ada912f
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/fileprint.xpm
@@ -0,0 +1,24 @@
+/* XPM */
+static const char *fileprint[] = {
+" 16 14 6 1",
+". c #000000",
+"# c #848284",
+"a c #c6c3c6",
+"b c #ffff00",
+"c c #ffffff",
+"d c None",
+"ddddd.........dd",
+"dddd.cccccccc.dd",
+"dddd.c.....c.ddd",
+"ddd.cccccccc.ddd",
+"ddd.c.....c....d",
+"dd.cccccccc.a.a.",
+"d..........a.a..",
+".aaaaaaaaaa.a.a.",
+".............aa.",
+".aaaaaa###aa.a.d",
+".aaaaaabbbaa...d",
+".............a.d",
+"d.aaaaaaaaa.a.dd",
+"dd...........ddd"
+};
diff --git a/languages/ruby/app_templates/qtrubyapp/filesave.xpm b/languages/ruby/app_templates/qtrubyapp/filesave.xpm
new file mode 100644
index 00000000..bd6870f4
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/filesave.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static const char *filesave[] = {
+" 14 14 4 1",
+". c #040404",
+"# c #808304",
+"a c #bfc2bf",
+"b c None",
+"..............",
+".#.aaaaaaaa.a.",
+".#.aaaaaaaa...",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".#.aaaaaaaa.#.",
+".##........##.",
+".############.",
+".##.........#.",
+".##......aa.#.",
+".##......aa.#.",
+".##......aa.#.",
+"b............."
+};
diff --git a/languages/ruby/app_templates/qtrubyapp/main.rb b/languages/ruby/app_templates/qtrubyapp/main.rb
new file mode 100644
index 00000000..6f4bceae
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/main.rb
@@ -0,0 +1,10 @@
+require 'Qt'
+require '%{APPNAMELC}.rb'
+
+a = Qt::Application.new( ARGV )
+mw = %{APPNAMESC}.new
+mw.caption = "%{APPNAMESC}"
+mw.show
+a.connect( a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()') )
+a.exec
+
diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevelop b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevelop
new file mode 100644
index 00000000..4afe7bca
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevelop
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevcustomproject>
+ <general>
+ <activedir/>
+ </general>
+ </kdevcustomproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Ruby files" />
+ <group pattern="*.ui" name="QT Designer files" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ <tree>
+ <hidenonprojectfiles>false</hidenonprojectfiles>
+ <hidepatterns>CVS,.svn</hidepatterns>
+ </tree>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <workspace>
+ <openfiles/>
+ </workspace>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="rb" />
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ <mainprogram>./main.rb</mainprogram>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate
new file mode 100644
index 00000000..5fd82925
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.kdevtemplate
@@ -0,0 +1,140 @@
+# KDE Config File
+[General]
+Name=QtRuby Application
+Name[ca]=Aplicació en QtRuby
+Name[da]=QtRuby-program
+Name[de]=QtRuby-Anwendung
+Name[el]=Εφαρμογή QtRuby
+Name[es]=Aplicación en QtRuby
+Name[et]=QtRuby rakendus
+Name[eu]=QtRuby aplikazioa
+Name[fa]=کاربرد QtRuby
+Name[fr]=Application QtRuby
+Name[ga]=Feidhmchlár QtRuby
+Name[gl]=Aplicación QtRuby
+Name[hu]=QtRuby-alapú alkalmazás
+Name[it]=Applicazione QtRuby
+Name[ja]=QtRuby アプリケーション
+Name[nds]=QtRuby-Programm
+Name[ne]=QtRuby अनुप्रयोग
+Name[nl]=QtRuby-toepassing
+Name[pl]=Program w QtRuby
+Name[pt]=Aplicação em QtRuby
+Name[pt_BR]=Aplicativo QtRuby
+Name[ru]=Приложение QtRuby
+Name[sk]=QtRuby Aplikácia
+Name[sr]=QtRuby програм
+Name[sr@Latn]=QtRuby program
+Name[sv]=QtRuby-program
+Name[tr]=QtRuby Uygulaması
+Name[zh_CN]=QtRuby 应用程序
+Name[zh_TW]=QtRuby 應用程式
+Icon=qtrubyapp.png
+Category=Ruby/Qt
+Category[fr]=Ruby/Qt
+Comment=Generate a QtRuby based application (crossplatform compatible)
+Comment[ca]=Genera una aplicació basada en QtRuby (multi plataforma)
+Comment[da]=Genererer et QtRuby baseret program (krydsplatform kompatibelt)
+Comment[de]=Erstellt eine auf QtRuby basierende Anwendung (plattformunabhängig)
+Comment[el]=Δημιουργία μιας εφαρμογής βασισμένης σε QtRuby (συμβατή με πολλαπλές πλατφόρμες)
+Comment[es]=Genera una aplicación basada en QtRuby (compatible multiplataforma)
+Comment[et]=Rakenduse loomine QtRuby põhjal (mitmeplatvormne)
+Comment[eu]=Sortu QtRuby lengoaian oinarritutako aplikazioa (plataforma gurutzatuekin bateragarria)
+Comment[fa]=یک کاربرد بر مبنای QtRuby تولید می‌کند )همساز بین سکویی(
+Comment[fr]=Génèrer une application basée sur QtRuby (compatible multi-plateforme)
+Comment[gl]=Xera unha aplicación baseada en QtRuby (compatibilidade multiplataforma)
+Comment[hu]=Létrehoz egy QtRuby-alapú, keresztfordításra is megfelelő alkalmazást
+Comment[it]=Genera un'applicazione basata su QtRuby (compatibile multipiattaforma)
+Comment[ja]=QtRuby ベースのアプリケーションを作成 (クロスプラットフォーム)
+Comment[nds]=Stellt en op QtRuby opbuut Programm op (över Bedriefümgeven weg kompatibel)
+Comment[ne]= QtRuby आधारित अनुप्रयोग (क्रसप्लाटफर्म उपयुक्त) उत्पन्न गर्नुहोस्
+Comment[nl]=Genereert een QtRuby-toepassing (crossplatform compatible)
+Comment[pl]=Generuj program używający QtRuby (wieloplatformowy)
+Comment[pt]=Gera uma aplicação baseada em QtRuby (compatível com várias plataformas)
+Comment[pt_BR]=Gera um aplicativo baseado no QtRuby (compatível com várias plataformas)
+Comment[ru]=Создание кроссплатформенного приложения на QtRuby
+Comment[sk]=Vygeneruje QtRuby aplikáciu (multiplatformovo kompatibilnú)
+Comment[sr]=Прави програм на основу QtRuby-ја (прекоплатформски компатибилан)
+Comment[sr@Latn]=Pravi program na osnovu QtRuby-ja (prekoplatformski kompatibilan)
+Comment[sv]=Skapa ett program baserat på QtRuby (fungerar på andra plattformar)
+Comment[tr]=QtRuby tabanlı bir uygulama yarat (platformlararası geçimli)
+Comment[zh_TW]=產生一個 QtRuby 為基礎的應用程式(跨平台相容)
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.rb,%{dest}/README
+Archive=qtrubyapp.tar.gz
+
+[FILE1]
+Type=install
+Source=%{src}/qtrubyapp.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/main.rb
+Dest=%{dest}/main.rb
+
+[FILE3]
+Type=install
+Source=%{src}/qtrubyapp.rb
+Dest=%{dest}/%{APPNAMELC}.rb
+
+[FILE4]
+Type=install
+Source=%{src}/fileopen.xpm
+Dest=%{dest}/fileopen.xpm
+
+[FILE5]
+Type=install
+Source=%{src}/filesave.xpm
+Dest=%{dest}/filesave.xpm
+
+[FILE6]
+Type=install
+Source=%{src}/fileprint.xpm
+Dest=%{dest}/fileprint.xpm
+
+[FILE7]
+Type=install
+Source=%{src}/app-Makefile
+Dest=%{dest}/Makefile
+
+[FILE8]
+Type=install
+Source=%{src}/app.filelist
+Dest=%{dest}/%{APPNAMELC}.kdevelop.filelist
+
+[FILE9]
+Type=install
+Source=%{src}/README
+Dest=%{dest}/README
+
+[MSG]
+Type=message
+Comment=A QtRuby based application was created in %{dest}
+Comment[ca]=Una aplicació basada en QtRuby ha estat creada en %{dest}
+Comment[da]=Et QtRuby baseret program blev oprettet i %{dest}
+Comment[de]=Eine auf QtRuby basierende Anwendung wurde in %{dest} erstellt.
+Comment[el]=Μια εφαρμογή βασισμένη σε QtRuby δημιουργήθηκε στο %{dest}
+Comment[es]=Una aplicación basada en QtRuby ha sido creada en %{dest}
+Comment[et]=Rakendus QtRuby põhjal loodi asukohta %{dest}
+Comment[eu]=QtRuby lengoaian oinarritutako aplikazioa sortu da hemen: %{dest}
+Comment[fa]=یک کاربرد بر مبنای QtRuby در %{dest} ایجاد شد
+Comment[fr]=Une application basée sur QtRuby a été créée dans %{dest}
+Comment[ga]=Cruthaíodh feidhmchlár bunaithe ar QtRuby i %{dest}
+Comment[gl]=Creouse unha aplicación baseada en QtRuby en %{dest}
+Comment[hu]=Létrejött egy QtRuby-alapú alkalmazás itt: %{dest}
+Comment[it]=È stata creata un'applicazione basata su QtRuby in %{dest}
+Comment[ja]=QtRuby ベースのアプリケーションを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en op QtRuby opbuut Programm opstellt.
+Comment[ne]=QtRuby आधारित अनुप्रयोग %{dest} मा सिर्जना गरियो
+Comment[nl]=Een QtRuby-toepassing is aangemaakt in %{dest}
+Comment[pl]=Program używający QtRuby został utworzony w %{dest}
+Comment[pt]=Foi criada uma aplicação baseada em QtRuby em %{dest}
+Comment[pt_BR]=Foi criada uma aplicação baseada em QtRuby em %{dest}
+Comment[ru]=Приложение QtRuby создано в %{dest}
+Comment[sk]=QtRuby aplikácia bola vytvorená v %{dest}
+Comment[sr]=QtRuby програм је направљен у %{dest}
+Comment[sr@Latn]=QtRuby program je napravljen u %{dest}
+Comment[sv]=Ett program baserat på QtRuby skapades i %{dest}
+Comment[tr]=Bir QtRuby tabanlı uygulama %{dest} içinde yaratıldı.
+Comment[zh_TW]=一個 QtRuby 為基礎的應用程式框架已建立於 %{dest}
diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.png b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.png
new file mode 100644
index 00000000..10f7ecec
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.png
Binary files differ
diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb
new file mode 100644
index 00000000..18ecdc3f
--- /dev/null
+++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb
@@ -0,0 +1,253 @@
+class %{APPNAMESC} < Qt::MainWindow
+
+ slots 'newDoc()',
+ 'choose()',
+ 'load( const QString& )',
+ 'save()',
+ 'saveAs()',
+ 'print()',
+ 'about()',
+ 'aboutQt()'
+
+ def initialize()
+ super( nil, "%{APPNAMESC}", WDestructiveClose )
+ @printer = Qt::Printer.new
+
+ fileTools = Qt::ToolBar.new( self, "file operations" )
+ fileTools.setLabel( tr("File Operations") )
+
+ openIcon = Qt::Pixmap.new( "fileopen.xpm" )
+ fileOpen = Qt::ToolButton.new( Qt::IconSet.new(openIcon), tr("Open File"), nil,
+ self, SLOT('choose()'), fileTools, "open file" )
+
+ saveIcon = Qt::Pixmap.new( "filesave.xpm" )
+ fileSave = Qt::ToolButton.new( Qt::IconSet.new(saveIcon), tr("Save File"), nil,
+ self, SLOT('save()'), fileTools, "save file" )
+
+ printIcon = Qt::Pixmap.new( "fileprint.xpm" )
+ filePrint = Qt::ToolButton.new( Qt::IconSet.new(printIcon), tr("Print File"), nil,
+ self, SLOT('print()'), fileTools, "print file" )
+
+
+ Qt::WhatsThis.whatsThisButton( fileTools )
+
+ fileOpenText = tr('<p><img source="fileopen"> ' +
+ "Click this button to open a <em>new file</em>. <br>" +
+ "You can also select the <b>Open</b> command " +
+ "from the <b>File</b> menu.</p>")
+
+ Qt::WhatsThis.add( fileOpen, fileOpenText )
+
+ Qt::MimeSourceFactory.defaultFactory().setPixmap( "fileopen", openIcon )
+
+ fileSaveText = tr("<p>Click this button to save the file you " +
+ "are editing. You will be prompted for a file name.\n" +
+ "You can also select the <b>Save</b> command " +
+ "from the <b>File</b> menu.</p>")
+
+ Qt::WhatsThis.add( fileSave, fileSaveText )
+
+ filePrintText = tr("Click this button to print the file you " +
+ "are editing.\n You can also select the Print " +
+ "command from the File menu.")
+
+ Qt::WhatsThis.add( filePrint, filePrintText )
+
+
+ file = Qt::PopupMenu.new( self )
+ menuBar().insertItem( tr("&File"), file )
+
+
+ file.insertItem( tr("&New"), self, SLOT('newDoc()'), Qt::KeySequence.new(CTRL+Key_N) )
+
+ id = file.insertItem( Qt::IconSet.new(openIcon), tr("&Open..."),
+ self, SLOT('choose()'), Qt::KeySequence.new(CTRL+Key_O) )
+ file.setWhatsThis( id, fileOpenText )
+
+ id = file.insertItem( Qt::IconSet.new(saveIcon), tr("&Save"),
+ self, SLOT('save()'), Qt::KeySequence.new(CTRL+Key_S) )
+ file.setWhatsThis( id, fileSaveText )
+
+ id = file.insertItem( tr("Save &As..."), self, SLOT('saveAs()') )
+ file.setWhatsThis( id, fileSaveText )
+
+ file.insertSeparator()
+
+ id = file.insertItem( Qt::IconSet.new(printIcon), tr("&Print..."),
+ self, SLOT('print()'), Qt::KeySequence.new(CTRL+Key_P) )
+ file.setWhatsThis( id, filePrintText )
+
+ file.insertSeparator()
+
+ file.insertItem( tr("&Close"), self, SLOT('close()'), Qt::KeySequence.new(CTRL+Key_W) )
+
+ file.insertItem( tr("&Quit"), $qApp, SLOT( 'closeAllWindows()' ), Qt::KeySequence.new(CTRL+Key_Q) )
+
+ menuBar().insertSeparator()
+
+ help = Qt::PopupMenu.new( self )
+ menuBar().insertItem( tr("&Help"), help )
+
+ help.insertItem( tr("&About"), self, SLOT('about()'), Qt::KeySequence.new(Key_F1) )
+ help.insertItem( tr("About &Qt"), self, SLOT('aboutQt()') )
+ help.insertSeparator()
+ help.insertItem( tr("What's &This"), self, SLOT('whatsThis()'), Qt::KeySequence.new(SHIFT+Key_F1) )
+
+ @e = Qt::TextEdit.new( self, "editor" )
+ @e.setFocus()
+ setCentralWidget( @e )
+ statusBar().message( tr("Ready"), 2000 )
+
+ resize( 450, 600 )
+ end
+
+ private
+
+ def newDoc()
+ ed = %{APPNAMESC}.new
+ ed.setCaption(tr("Qt Example - Application"))
+ ed.show()
+ end
+
+ def choose()
+ fn = Qt::FileDialog.getOpenFileName( nil, nil,
+ self)
+ if !fn.nil?
+ load( fn )
+ else
+ statusBar().message( tr("Loading aborted"), 2000 )
+ end
+ end
+
+
+ def load( filename )
+ f = Qt::File.new( filename )
+ if !f.open( Qt::IO_ReadOnly )
+ return
+ end
+
+ ts = Qt::TextStream.new( f )
+ @e.setText( ts.read() )
+ @e.setModified( false )
+ setCaption( filename )
+ statusBar().message( tr("Loaded document %s" % filename), 2000 )
+ end
+
+
+ def save()
+ if @filename.nil?
+ saveAs()
+ return
+ end
+
+ text = @e.text()
+ f = Qt::File.new( @filename )
+ if !f.open( Qt::IO_WriteOnly )
+ statusBar().message( tr("Could not write to %s" % @filename),
+ 2000 )
+ return
+ end
+
+ t = Qt::TextStream.new( f )
+ t << text
+ f.close()
+
+ @e.setModified( false )
+
+ setCaption( @filename )
+
+ statusBar().message( tr( "File %s saved" % @filename ), 2000 )
+ end
+
+
+ def saveAs()
+ fn = Qt::FileDialog.getSaveFileName( nil, nil,
+ self )
+ if !fn.nil?
+ @filename = fn
+ save()
+ else
+ statusBar().message( tr("Saving aborted"), 2000 )
+ end
+ end
+
+
+ def print()
+ # ###### Rewrite to use Qt::SimpleRichText to print here as well
+ margin = 10
+ pageNo = 1
+
+ if @printer.setup(self) # @printer dialog
+ statusBar().message( tr("Printing...") )
+ p = Qt::Painter.new
+ if !p.begin( @printer ) # paint on @printer
+ return
+ end
+
+ p.setFont( @e.font() )
+ yPos = 0 # y-position for each line
+ fm = p.fontMetrics()
+ metrics = Qt::PaintDeviceMetrics.new( @printer ) # need width/height
+ # of @printer surface
+ for i in 0...@e.lines() do
+ if margin + yPos > metrics.height() - margin
+ msg = "Printing (page "
+ msg += pageNo.to_s
+ pageNo += 1
+ msg += ")..."
+ statusBar().message( msg )
+ @printer.newPage() # no more room on self page
+ yPos = 0 # back to top of page
+ end
+ p.drawText( margin, margin + yPos,
+ metrics.width(), fm.lineSpacing(),
+ ExpandTabs | DontClip,
+ @e.text( i ) )
+ yPos = yPos + fm.lineSpacing()
+ end
+ p.end() # send job to @printer
+ statusBar().message( tr("Printing completed"), 2000 )
+ else
+ statusBar().message( tr("Printing aborted"), 2000 )
+ end
+ end
+
+ protected
+
+ def closeEvent( ce )
+ if !@e.modified?
+ ce.accept()
+ return
+ end
+
+ case Qt::MessageBox.information( self, tr("Qt Application Example"),
+ tr("Do you want to save the changes" +
+ " to the document?"),
+ tr("Yes"), tr("No"), tr("Cancel"),
+ 0, 1 )
+ when 0
+ save()
+ ce.accept()
+ when 1
+ ce.accept()
+ when 2
+ ce.ignore()
+ else # just for sanity
+ ce.ignore()
+ end
+ end
+
+ private
+
+ def about()
+ Qt::MessageBox.about( self, tr("Qt Application Example"),
+ tr("This example demonstrates simple use of " +
+ "Qt::MainWindow,\nQt::MenuBar and Qt::ToolBar."))
+ end
+
+
+ def aboutQt()
+ Qt::MessageBox.aboutQt( self, tr("Qt Application Example") )
+ end
+
+end
diff --git a/languages/ruby/app_templates/rails/CMakeLists.txt b/languages/ruby/app_templates/rails/CMakeLists.txt
new file mode 100644
index 00000000..34da0fde
--- /dev/null
+++ b/languages/ruby/app_templates/rails/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+
+#original Makefile.am contents follow:
+
+#dataFiles = app.rb app.kdevelop
+#templateName= rubyhello
+#
+#### no need to change below:
+#template_DATA = $(templateName).kdevtemplate
+#templatedir = ${appwizarddatadir}/templates
+#
+#appwizarddatadir = ${kde_datadir}/kdevappwizard
+#$(templateName).tar.gz:
+# $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+# $(GZIP) -9 $(templateName).tar
+#
+#archivedir = ${appwizarddatadir}
+#archive_DATA = $(templateName).tar.gz ${templateName}.png
+#
+#CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/ruby/app_templates/rails/Makefile.am b/languages/ruby/app_templates/rails/Makefile.am
new file mode 100644
index 00000000..49d77bdd
--- /dev/null
+++ b/languages/ruby/app_templates/rails/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.kdevelop
+templateName= rails
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz
diff --git a/languages/ruby/app_templates/rails/app.kdevelop b/languages/ruby/app_templates/rails/app.kdevelop
new file mode 100644
index 00000000..c02c2057
--- /dev/null
+++ b/languages/ruby/app_templates/rails/app.kdevelop
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <includepatterns>*.rb,*.rhtml,*.rxml,*.rjs,*.css,*.js,*.html.erb,*.js.rjs,*.xml.builder</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Scripts" />
+ <group pattern="*.css" name="StyleSheets" />
+ <group pattern="*.js" name="JavaScripts" />
+ <group pattern="*.rhtml,*.html.erb" name="Views" />
+ <group pattern="*.rxml,*.xml.builder" name="BuilderTemplates" />
+ <group pattern="*.rjs,*.js.rjs" name="Ruby JavaScript" />
+ <group pattern="*.yml" name="Config" />
+ <group pattern="*.gif,*.jpg,*.png,*.ico" name="Images" />
+ <group pattern="*.html,*.cgi,*.fcgi,*.txt" name="Public" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ <type ext="rhtml"/>
+ <type ext="html.erb"/>
+ <type ext="rxml"/>
+ <type ext="xml.builder"/>
+ <type ext="rjs"/>
+ <type ext="js.rjs"/>
+ <type ext="css"/>
+ <type ext="js"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <interpreter>ruby</interpreter>
+ <shell>%{dest}/script/console</shell>
+ <terminal>false</terminal>
+ <mainprogram>script/server</mainprogram>
+ </run>
+ </kdevrubysupport>
+</kdevelop>
diff --git a/languages/ruby/app_templates/rails/rails.kdevtemplate b/languages/ruby/app_templates/rails/rails.kdevtemplate
new file mode 100644
index 00000000..e377e1c4
--- /dev/null
+++ b/languages/ruby/app_templates/rails/rails.kdevtemplate
@@ -0,0 +1,72 @@
+# KDE Config File
+[General]
+Name=Ruby On Rails
+Name[de]=Ruby on Rails
+Name[ne]=रूबि अन रेल्स
+Name[sv]=Ruby on Rails
+Icon=rails.png
+Category=Ruby
+Comment=This generates a Ruby On Rails project
+Comment[ca]=Genera un projecte Ruby On Rails
+Comment[da]=Dette genererer et Ruby On Rails projekt
+Comment[de]=Erstellt ein einfaches Ruby-on-Rails-Projekt
+Comment[el]=Δημιουργεί ένα έργο Ruby On Rails
+Comment[es]=Genera un proyecto Ruby On Rails
+Comment[et]=Lihtsa Ruby On Rails projekti loomine
+Comment[eu]=Ruby On Rails proiektu bat sortzen du.
+Comment[fa]=یک پروژۀ Ruby On Rails تولید می‌کند
+Comment[fr]=Génère un projet Ruby On Rails
+Comment[gl]=Isto xera un proxecto de Ruby On Rails
+Comment[hu]=Létrehoz egy Ruby On Rails-projektet
+Comment[it]=Genera un progetto Ruby On Rails
+Comment[ja]=Ruby On Rails プロジェクトを作成します
+Comment[nds]=Stellt en eenfach "Ruby-On-Rails"-Projekt op
+Comment[ne]=यसले रूबि अन रेल्स परियोजना उत्पन्न गर्दछ
+Comment[nl]=Genereert een Ruby On Rails-project.
+Comment[pl]=Generuje projekt Ruby On Rails
+Comment[pt]=Gera um projecto de Ruby On Rails
+Comment[pt_BR]=Gera um projecto de Ruby On Rails
+Comment[ru]=Создание проекта на Ruby On Rails
+Comment[sk]=Vygeneruje Ruby On Rails projekt
+Comment[sr]=Прави једноставан Ruby On Rails пројекат
+Comment[sr@Latn]=Pravi jednostavan Ruby On Rails projekat
+Comment[sv]=Det här skapar ett Ruby on Rails-projekt
+Comment[zh_TW]=產生一個 Ruby On Rails 專案
+FileTemplates=rb,ShellStyle,rhtml,XMLStyle,html.erb,XMLStyle,rxml,XMLStyle,xml.builder,XMLStyle,rjs,ShellStyle,js.rjs,ShellStyle,css,CPPStyle,js,CPPStyle
+ShowFilesAfterGeneration=%{dest}/script/server
+Archive=rails.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[MSG]
+Type=message
+Comment=A Ruby On Rails project created in %{dest}
+Comment[ca]=A simple projecte Ruby On Rails ha estat creat en %{dest}
+Comment[da]=Et Ruby On Rails projekt oprettet i %{dest}
+Comment[de]=Ein einfaches Ruby-on-Rails-Project wurde in %{dest} erstellt.
+Comment[el]=Ένα έργο Ruby On Rails δημιουργήθηκε στο %{dest}.
+Comment[es]=Un proyecto de Ruby On Rails ha sido creado en %{dest}.
+Comment[et]=Lihtne Ruby On Rails projekt loodi asukohta %{dest}.
+Comment[eu]=Ruby On Rails proiektu bat sortu da hemen: %{dest}.
+Comment[fa]=یک پروژۀ Ruby On Rails در %{dest} ایجاد شد
+Comment[fr]=Un projet Ruby On Rails a été créé dans %{dest}
+Comment[gl]=Creouse un proxecto de Ruby On Rails en %{dest}
+Comment[hu]=Létrejött egy Ruby On Rails-projekt itt: %{dest}
+Comment[it]=È stato creato un progetto Ruby On Rails in %{dest}
+Comment[ja]=Ruby On Rails プロジェクトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach "Ruby-On-Rails"-Projekt opstellt.
+Comment[ne]=रूबि अन रेल्स परियोजना %{dest} मा सिर्जना गरिन्छ
+Comment[nl]=Een eenvoudig Ruby On Rails-project is aangemaakt in %{dest}.
+Comment[pl]=Projekt Ruby On Rails stworzony w %{dest}
+Comment[pt]=Foi criado um projecto de Ruby on Rails em %{dest}
+Comment[pt_BR]=Foi criado um projecto de Ruby on Rails em %{dest}
+Comment[ru]=Проект на Ruby On Rails создан в %{dest}
+Comment[sk]=Ruby On Rails projekt bol vytvorený v %{dest}
+Comment[sr]=Ruby On Rails пројекат направљен је у %{dest}
+Comment[sr@Latn]=Ruby On Rails projekat napravljen je u %{dest}
+Comment[sv]=Ett Ruby on Rails-projekt skapades i %{dest}
+Comment[zh_TW]=一個 Ruby On Rails 專案已建立於 %{dest}
diff --git a/languages/ruby/app_templates/rails/rails.png b/languages/ruby/app_templates/rails/rails.png
new file mode 100644
index 00000000..26d02009
--- /dev/null
+++ b/languages/ruby/app_templates/rails/rails.png
Binary files differ
diff --git a/languages/ruby/app_templates/ruby.appwizard b/languages/ruby/app_templates/ruby.appwizard
new file mode 100644
index 00000000..726daeed
--- /dev/null
+++ b/languages/ruby/app_templates/ruby.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=rubyhello,qtruby,qtrubyapp,dcopserviceruby,kappruby,kxtruby,rails
diff --git a/languages/ruby/app_templates/rubyhello/.kdev_ignore b/languages/ruby/app_templates/rubyhello/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/.kdev_ignore
diff --git a/languages/ruby/app_templates/rubyhello/Makefile.am b/languages/ruby/app_templates/rubyhello/Makefile.am
new file mode 100644
index 00000000..ecb3e535
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/Makefile.am
@@ -0,0 +1,16 @@
+dataFiles = app.rb app.kdevelop
+templateName= rubyhello
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/ruby/app_templates/rubyhello/app.kdevelop b/languages/ruby/app_templates/rubyhello/app.kdevelop
new file mode 100644
index 00000000..2d1d24c5
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/app.kdevelop
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <includepatterns>*.rb</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Scripts" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+ <kdevrubysupport>
+ <run>
+ <mainprogram>./%{APPNAMELC}.rb</mainprogram>
+ <interpreter>ruby</interpreter>
+ <terminal>false</terminal>
+ </run>
+ </kdevrubysupport>
+
+</kdevelop>
diff --git a/languages/ruby/app_templates/rubyhello/app.rb b/languages/ruby/app_templates/rubyhello/app.rb
new file mode 100644
index 00000000..c3bc962d
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/app.rb
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+
+puts "Hello world"
diff --git a/languages/ruby/app_templates/rubyhello/rubyhello b/languages/ruby/app_templates/rubyhello/rubyhello
new file mode 100644
index 00000000..4581605d
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/rubyhello
@@ -0,0 +1,9 @@
+# KDE Config File
+[General]
+Name=Simple Ruby script
+Name[fr]=Un simple script de test Hello world
+Category=Ruby
+Comment=This generates a simplistic 'Hello world' program in Ruby
+Comment[fr]=Gnre un simple script de test du type Hello world dans le language RUBY.
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=APPNAMELC.rb
diff --git a/languages/ruby/app_templates/rubyhello/rubyhello.kdevtemplate b/languages/ruby/app_templates/rubyhello/rubyhello.kdevtemplate
new file mode 100644
index 00000000..3612becb
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/rubyhello.kdevtemplate
@@ -0,0 +1,105 @@
+# KDE Config File
+[General]
+Name=Simple Ruby script
+Name[ca]=Simple script en Ruby
+Name[da]=Simpelt Ruby script
+Name[de]=Einfaches Ruby-Skript
+Name[el]=Απλό σενάριο Ruby
+Name[es]=Guión sencillo en Ruby
+Name[et]=Lihtne Ruby skript
+Name[eu]=Ruby script sinple bat
+Name[fa]=دست‌نوشتۀ سادۀ رابی
+Name[fr]=Script Ruby simple
+Name[ga]=Script shimplí Ruby
+Name[gl]=Script sinxelo en Ruby
+Name[hu]=Egyszerű Ruby-szkript
+Name[it]=Semplice script Ruby
+Name[ja]=簡単な Ruby スクリプト
+Name[nds]=Eenfach Ruby-Skript
+Name[ne]=साधारण रूबि स्क्रिप्ट
+Name[nl]=Eenvoudig Ruby-script
+Name[pl]=Prosty skrypt w języku Ruby
+Name[pt]=Programa simples em Ruby
+Name[pt_BR]=Programa simples em Ruby
+Name[ru]=Простой скрипт Ruby
+Name[sk]=Jednoduchý Ruby skript
+Name[sr]=Једноставна Ruby скрипта
+Name[sr@Latn]=Jednostavna Ruby skripta
+Name[sv]=Enkelt Ruby-skript
+Name[tg]=Скрипти Ruby оддӣ
+Name[tr]=Basit Ruby Betiği
+Name[zh_CN]=简单的 Ruyb 脚本
+Name[zh_TW]=簡單 Ruby 文稿
+Category=Ruby
+Comment=This generates a simplistic 'Hello world' program in Ruby
+Comment[ca]=Genera un simple programa de 'Hello world' en Ruby
+Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i Ruby
+Comment[de]=Erstellt ein einfaches "Hello World"'-Programm in Ruby
+Comment[el]=Αυτό δημιουργεί ένα απλό πρόγραμμα 'Γεια σου κόσμε' σε Ruby
+Comment[es]=Genera un sencillo programa «Hola mundo» en Ruby
+Comment[et]=Lihtsa "Tere, maailm" programmi loomine Rubys
+Comment[eu]=Honek "Kaixo mundua" programa sinple bat sortzen du Ruby lengoaian
+Comment[fa]=یک برنامۀ سادۀ «Hello world» در رابی تولید می‌کند
+Comment[fr]=Génère un programme « Bonjour monde » simple en Ruby
+Comment[gl]=Isto xera un programa sinxelo 'Ola mundo' en Ruby
+Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot Rubyban
+Comment[it]=Genera un semplice programma di "Hello world" in Ruby
+Comment[ja]=簡単な Hello world プログラムを Ruby で作成します
+Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm in Ruby op.
+Comment[ne]=यसले रूबिमा साधारण 'हेल्लो वोल्ड' कार्यक्रम उत्पन्न गर्दछ
+Comment[nl]=Dit genereert een eenvoudig Hello World-programma in Ruby
+Comment[pl]=Generuje prosty program "Witaj świecie" w języku Ruby
+Comment[pt]=Isto gera um programa simples 'Olá mundo' em Ruby
+Comment[pt_BR]=Isto gera um programa simples 'Olá mundo' em Ruby
+Comment[ru]=Создание простой программы 'Hello world' на Ruby
+Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v Ruby
+Comment[sr]=Ово прави једноставан „Здраво свете“ у Ruby-ју
+Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ u Ruby-ju
+Comment[sv]=Detta skapar ett förenklat 'Hello world'-program i Ruby
+Comment[tr]=Bu Ruby'de basit bir "Merhaba Dünya" programı yaratır.
+Comment[zh_TW]=產生一個簡單的 Ruby 的 Hello world 程式
+FileTemplates=rb,ShellStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.rb
+Archive=rubyhello.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.rb
+Dest=%{dest}/%{APPNAMELC}.rb
+
+[MSG]
+Type=message
+Comment=A simple ruby script was created in %{dest}
+Comment[ca]=Un simple script en Ruby ha estat creat en %{dest}
+Comment[da]=Et simpelt ruby script blev oprettet i %{dest}
+Comment[de]=Ein einfaches Ruby-Skript wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό σενάριο ruby δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo guión en Ruby ha sido creado en %{dest}
+Comment[et]=Lihtne Ruby skript loodi asukohta %{dest}
+Comment[eu]=Ruby script sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک دست‌نوشتۀ سادۀ رابی در %{dest} ایجاد شد
+Comment[fr]=Un script Ruby simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh script shimplí ruby i %{dest}
+Comment[gl]=Creouse un scrip sinxelo en ruby en %{dest}
+Comment[hu]=Létrejött egy egyszerű Ruby-szkript itt: %{dest}
+Comment[it]=È stato creato un semplice script ruby in %{dest}
+Comment[ja]=簡単な ruby スクリプトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach Ruby-Skript opstellt.
+Comment[ne]=साधारण रूबि स्क्रिप्ट %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig Ruby-script is aangemaakt in %{dest}
+Comment[pl]=Prosty skrypt w języku Ruby został utworzony w %{dest}
+Comment[pt]=Foi criado um programa simples em Ruby em %{dest}
+Comment[pt_BR]=Foi criado um programa simples em Ruby em %{dest}
+Comment[ru]=Простой скрипт Ruby создан в %{dest}
+Comment[sk]=Jednoduchý Ruby skript bol vytvorený v %{dest}
+Comment[sr]=Једноставна ruby скрипта направљена је у %{dest}
+Comment[sr@Latn]=Jednostavna ruby skripta napravljena je u %{dest}
+Comment[sv]=Ett enkelt Ruby-skript skapades i %{dest}
+Comment[tr]=Basit bir Ruby betiği %{dest} içinde yaratıldı.
+Comment[zh_TW]=一個簡單的 ruby 文稿已建立於 %{dest}
diff --git a/languages/ruby/app_templates/rubyhello/rubyhello.png b/languages/ruby/app_templates/rubyhello/rubyhello.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/ruby/app_templates/rubyhello/rubyhello.png
Binary files differ
diff --git a/languages/ruby/debugger/Makefile.am b/languages/ruby/debugger/Makefile.am
new file mode 100644
index 00000000..f4c512c2
--- /dev/null
+++ b/languages/ruby/debugger/Makefile.am
@@ -0,0 +1,25 @@
+# Here resides the debugger part.
+
+INCLUDES = -I$(top_srcdir)/languages/lib/debugger \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevrbdebugger.la
+libkdevrbdebugger_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevrbdebugger_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML) \
+ $(top_builddir)/languages/lib/debugger/liblang_debugger.la
+
+libkdevrbdebugger_la_SOURCES = debuggerpart.cpp dbgcontroller.cpp rdbcontroller.cpp dbgcommand.cpp rdbcommand.cpp rdbparser.cpp stty.cpp breakpoint.cpp variablewidget.cpp rdbbreakpointwidget.cpp framestackwidget.cpp dbgpsdlg.cpp dbgtoolbar.cpp rdboutputwidget.cpp rdbtable.cpp
+
+METASOURCES = AUTO
+KDE_ICON = AUTO
+
+rubysrc_DATA = debuggee.rb
+rubysrcdir = $(kde_datadir)/kdevrbdebugger
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevrbdebugger.desktop
+
+rcdir = $(kde_datadir)/kdevrbdebugger
+rc_DATA = kdevrbdebugger.rc
+noinst_HEADERS = rdbtable.h
diff --git a/languages/ruby/debugger/breakpoint.cpp b/languages/ruby/debugger/breakpoint.cpp
new file mode 100644
index 00000000..f210e359
--- /dev/null
+++ b/languages/ruby/debugger/breakpoint.cpp
@@ -0,0 +1,343 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "breakpoint.h"
+
+#include <klocale.h>
+
+#include <qfileinfo.h>
+#include <qfontmetrics.h>
+#include <qpainter.h>
+#include <qregexp.h>
+#include <qstring.h>
+
+#include <stdio.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+static int BPKey_ = 0;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+Breakpoint::Breakpoint(bool temporary, bool enabled)
+ : s_pending_(true),
+ s_actionAdd_(true),
+ s_actionClear_(false),
+ s_actionModify_(false),
+ s_actionDie_(false),
+ s_dbgProcessing_(false),
+ s_enabled_(enabled),
+ s_temporary_(temporary),
+ s_changedEnable_(false),
+ key_(BPKey_++),
+ active_(-1)
+{
+}
+
+/***************************************************************************/
+
+Breakpoint::~Breakpoint()
+{
+}
+
+/***************************************************************************/
+
+QString Breakpoint::dbgRemoveCommand() const
+{
+// if (dbgId_>0)
+// return QString("delete %1").arg(dbgId_); // gdb command - not translatable
+
+ return QString();
+}
+
+/***************************************************************************/
+
+// called when debugger ends
+void Breakpoint::reset()
+{
+ dbgId_ = -1;
+ s_pending_ = true;
+ s_actionAdd_ = true; // waiting for the debugger to start
+ s_actionClear_ = false;
+ s_changedEnable_ = !s_enabled_;
+ s_actionModify_ = s_changedEnable_;
+ s_dbgProcessing_ = false;
+// hits_ = 0;
+ active_ = -1;
+}
+
+/***************************************************************************/
+
+void Breakpoint::setActive(int active, int id)
+{
+ active_ = active;
+ dbgId_ = id;
+
+ if (s_pending_ && !(s_actionAdd_ && s_actionModify_)) {
+ s_pending_ = false;
+ s_actionModify_ = false;
+ }
+
+ s_actionAdd_ = false;
+ s_actionClear_ = false;
+ s_actionDie_ = false;
+ s_dbgProcessing_ = false;
+
+ if (!s_actionModify_) {
+ s_changedEnable_ = false;
+ }
+}
+
+/***************************************************************************/
+
+QString Breakpoint::statusDisplay(int activeFlag) const
+{
+ QString status="";
+ if (!s_enabled_)
+ status = i18n("Disabled");
+ else
+ if (s_pending_)
+ {
+ if (s_actionAdd_)
+ status = i18n("Pending (add)");
+ if (s_actionClear_)
+ status = i18n("Pending (clear)");
+ if (s_actionModify_)
+ status = i18n("Pending (modify)");
+ }
+ else
+ if (isActive(activeFlag))
+ status = i18n("Active");
+
+ return status;
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+FilePosBreakpoint::FilePosBreakpoint(const QString &fileName, int lineNum,
+ bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled),
+ fileName_(fileName),
+ lineNo_(lineNum)
+{
+}
+
+/***************************************************************************/
+
+FilePosBreakpoint::~FilePosBreakpoint()
+{
+}
+
+/***************************************************************************/
+
+QString FilePosBreakpoint::dbgSetCommand() const
+{
+ QString cmdStr;
+ if (fileName_.isEmpty())
+ cmdStr = QString("break %1").arg(lineNo_); // gdb command - not translatable
+ else {
+ cmdStr = QString("break %1:%2").arg(fileName_).arg(lineNo_);
+ }
+
+ if (isTemporary())
+ cmdStr = "t"+cmdStr; // gdb command
+
+ return cmdStr;
+}
+
+/***************************************************************************/
+
+bool FilePosBreakpoint::match(const Breakpoint *brkpt) const
+{
+ // simple case
+ if (this == brkpt)
+ return true;
+
+ // Type case
+ const FilePosBreakpoint* check = dynamic_cast<const FilePosBreakpoint*>(brkpt);
+ if (!check)
+ return false;
+
+ // member case
+ return ( (fileName_ == check->fileName_) &&
+ (lineNo_ == check->lineNo_));
+}
+
+/***************************************************************************/
+
+QString FilePosBreakpoint::location(bool compact)
+{
+ if (compact)
+ return QFileInfo(fileName_).fileName()+":"+QString::number(lineNo_);
+
+ return fileName_+":"+QString::number(lineNo_);
+}
+
+/***************************************************************************/
+
+void FilePosBreakpoint::setLocation(const QString& location)
+{
+ QRegExp regExp1("(.*):(\\d+)$");
+ regExp1.setMinimal(true);
+ if ( regExp1.search(location, 0) >= 0 )
+ {
+ QString t = regExp1.cap(1);
+ QString dirPath = QFileInfo(t).dirPath();
+ if ( dirPath == "." )
+ fileName_ = QFileInfo(fileName_).dirPath()+"/"+regExp1.cap(1);
+ else
+ fileName_ = regExp1.cap(1);
+
+ lineNo_ = regExp1.cap(2).toInt();
+ }
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+Watchpoint::Watchpoint(const QString& varName, bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled),
+ varName_(varName)
+{
+}
+
+/***************************************************************************/
+
+Watchpoint::~Watchpoint()
+{
+}
+
+/***************************************************************************/
+
+QString Watchpoint::dbgSetCommand() const
+{
+ return QString("watch ")+varName_; // gdb command - not translatable
+}
+
+/***************************************************************************/
+
+bool Watchpoint::match(const Breakpoint* brkpt) const
+{
+ // simple case
+ if (this == brkpt)
+ return true;
+
+ // Type case
+ const Watchpoint *watch = dynamic_cast<const Watchpoint*>(brkpt);
+ if (watch == 0)
+ return false;
+
+ // member case
+ return (varName_ == watch->varName_);
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+Catchpoint::Catchpoint(const QString& varName, bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled),
+ varName_(varName)
+{
+}
+
+/***************************************************************************/
+
+Catchpoint::~Catchpoint()
+{
+}
+
+/***************************************************************************/
+
+QString Catchpoint::dbgSetCommand() const
+{
+ return QString("catch ")+varName_; // gdb command - not translatable
+}
+
+/***************************************************************************/
+
+bool Catchpoint::match(const Breakpoint* brkpt) const
+{
+ // simple case
+ if (this == brkpt)
+ return true;
+
+ // Type case
+ const Catchpoint *check = dynamic_cast<const Catchpoint*>(brkpt);
+ if (check == 0)
+ return false;
+
+ // member case
+ return (varName_ == check->varName_);
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+FunctionBreakpoint::FunctionBreakpoint(const QString& functionName, bool temporary, bool enabled)
+ : Breakpoint(temporary, enabled),
+ m_functionName(functionName)
+{
+}
+
+/***************************************************************************/
+
+FunctionBreakpoint::~FunctionBreakpoint()
+{
+}
+
+/***************************************************************************/
+
+QString FunctionBreakpoint::dbgSetCommand() const
+{
+ return QString("break ")+m_functionName; // gdb command - not translatable
+}
+
+/***************************************************************************/
+
+bool FunctionBreakpoint::match(const Breakpoint* brkpt) const
+{
+ // simple case
+ if (this == brkpt)
+ return true;
+
+ // Type case
+ const FunctionBreakpoint *check = dynamic_cast<const FunctionBreakpoint*>(brkpt);
+ if (!check)
+ return false;
+
+ // member case
+ return (m_functionName == check->m_functionName);
+}
+
+
+}
diff --git a/languages/ruby/debugger/breakpoint.h b/languages/ruby/debugger/breakpoint.h
new file mode 100644
index 00000000..e45e3856
--- /dev/null
+++ b/languages/ruby/debugger/breakpoint.h
@@ -0,0 +1,214 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _BREAKPOINT_H_
+#define _BREAKPOINT_H_
+
+#include <klocale.h>
+
+#include <qstring.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+enum BP_TYPES
+{
+ BP_TYPE_Invalid,
+ BP_TYPE_FilePos,
+ BP_TYPE_Watchpoint,
+ BP_TYPE_Catchpoint,
+ BP_TYPE_Function
+};
+
+class Breakpoint
+{
+public:
+ Breakpoint(bool temporary=false, bool enabled=true);
+ virtual ~Breakpoint();
+
+ virtual QString dbgSetCommand() const = 0;
+ virtual QString dbgRemoveCommand() const;
+ virtual bool match(const Breakpoint* brkpt) const = 0;
+ virtual void reset();
+
+ void setActive(int active, int id);
+ bool isActive(int active) const { return (active_ == active) ||
+ (s_pending_ && !s_actionClear_); }
+ void setEnabled(bool enabled) { s_changedEnable_ = (s_enabled_ != enabled);
+ s_enabled_ = enabled; }
+ bool isEnabled() const { return s_enabled_; }
+ void setTemporary(bool temporary) { s_temporary_ = temporary; }
+ bool isTemporary() const { return s_temporary_; }
+
+ bool changedEnable() const { return s_changedEnable_; }
+
+ void setPending(bool pending) { s_pending_ = pending; }
+ bool isPending() const { return s_pending_; }
+ void setActionAdd(bool actionAdd) { s_actionDie_ = false;
+ s_actionAdd_ = actionAdd; }
+ bool isActionAdd() const { return s_actionAdd_; }
+ void setActionClear(bool actionClear) { s_actionClear_ = actionClear; }
+ bool isActionClear() const { return s_actionClear_; }
+ void setActionModify(bool actionModify) { s_actionDie_ = false;
+ s_actionModify_ = actionModify; }
+ bool isActionModify() const { return s_actionModify_; }
+ void setDbgProcessing(bool dbgProcessing) { s_dbgProcessing_ = dbgProcessing; }
+ bool isDbgProcessing() const { return s_dbgProcessing_; }
+ void setActionDie() { s_actionDie_ = true;
+ s_actionClear_ = false; }
+ bool isActionDie() const { return s_actionDie_; }
+
+ int key() const { return key_; }
+ void setDbgId(int dbgId) { dbgId_ = dbgId; }
+ int dbgId() const { return dbgId_; }
+
+ virtual QString statusDisplay(int activeFlag) const;
+ virtual BP_TYPES type() const { return BP_TYPE_Invalid; }
+ virtual QString displayType() const { return i18n( "Invalid" ); }
+
+ virtual QString location(bool compact=true) = 0;
+ virtual void setLocation(const QString& ) = 0;
+ virtual bool isValid() const = 0;
+
+private:
+ bool s_pending_ :1;
+ bool s_actionAdd_ :1;
+ bool s_actionClear_ :1;
+ bool s_actionModify_ :1;
+ bool s_actionDie_ :1;
+ bool s_dbgProcessing_ :1;
+ bool s_enabled_ :1;
+ bool s_temporary_ :1;
+ bool s_changedEnable_ :1;
+
+ int dbgId_; // assigned by gdb
+
+ int key_; // internal unique key
+ int active_; // counter incremented on receipt of all BP's
+
+ int ignoreCount_;
+ QString condition_;
+// QString type_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class FilePosBreakpoint : public Breakpoint
+{
+public:
+ FilePosBreakpoint(const QString &fileName, int lineNum,
+ bool temporary=false, bool enabled=true);
+ virtual ~FilePosBreakpoint();
+ virtual QString dbgSetCommand() const;
+ virtual bool match(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_FilePos; }
+ QString displayType() const { return i18n( "File:line" ); }
+ void setFileName(const QString& fileName) { fileName_ = fileName; }
+ QString fileName() const { return fileName_; }
+ void setLineNum(int lineNum) { lineNo_ = lineNum; }
+ int lineNum() const { return lineNo_; }
+ QString location(bool compact=true);
+ void setLocation(const QString& location);
+ bool isValid() const { return lineNo_>0 && !fileName_.isEmpty(); }
+
+private:
+ QString fileName_;
+ int lineNo_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class Watchpoint : public Breakpoint
+{
+public:
+ Watchpoint(const QString &varName, bool temporary=false, bool enabled=true);
+ virtual ~Watchpoint();
+ virtual QString dbgSetCommand() const;
+ bool match(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_Watchpoint; }
+ QString displayType() const { return i18n("Watchpoint"); }
+ void setVarName(const QString& varName) { varName_ = varName; }
+ QString varName() const { return varName_; }
+ QString location(bool) { return varName_; }
+ void setLocation(const QString& location) { varName_ = location; }
+ bool isValid() const { return !varName_.isEmpty(); }
+
+private:
+ QString varName_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class Catchpoint : public Breakpoint
+{
+public:
+ Catchpoint(const QString &varName, bool temporary=false, bool enabled=true);
+ virtual ~Catchpoint();
+ virtual QString dbgSetCommand() const;
+ bool match(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_Catchpoint; }
+ QString displayType() const { return i18n("Catchpoint"); }
+ void setVarName(const QString& varName) { varName_ = varName; }
+ QString varName() const { return varName_; }
+ QString location(bool) { return varName_; }
+ void setLocation(const QString& location) { varName_ = location; }
+ bool isValid() const { return !varName_.isEmpty(); }
+
+private:
+ QString varName_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class FunctionBreakpoint : public Breakpoint
+{
+public:
+ FunctionBreakpoint(const QString &functionName, bool temporary=false, bool enabled=true);
+ virtual ~FunctionBreakpoint();
+ virtual QString dbgSetCommand() const;
+ bool match(const Breakpoint *brkpt) const;
+
+ BP_TYPES type () const { return BP_TYPE_Function; }
+ QString displayType() const { return i18n("Method()"); }
+ void setfunctionName(const QString& functionName) { m_functionName = functionName; }
+ QString functionName() const { return m_functionName; }
+ QString location(bool) { return m_functionName; };
+ void setLocation(const QString& location) { m_functionName = location; }
+ bool isValid() const { return !m_functionName.isEmpty(); }
+
+private:
+ QString m_functionName;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/dbgcommand.cpp b/languages/ruby/debugger/dbgcommand.cpp
new file mode 100644
index 00000000..6c6a24ec
--- /dev/null
+++ b/languages/ruby/debugger/dbgcommand.cpp
@@ -0,0 +1,47 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "dbgcommand.h"
+
+#include <qstring.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+namespace RDBDebugger
+{
+
+
+DbgCommand::DbgCommand(const QCString& command, bool isRunCmd, bool isInfoCmd) :
+ command_(command),
+ isRunCmd_(isRunCmd),
+ isInfoCmd_(isInfoCmd),
+ sent_(false),
+ waitForReply_(true)
+{
+ cmdBuffer_ = command_+"\n";
+}
+
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
diff --git a/languages/ruby/debugger/dbgcommand.h b/languages/ruby/debugger/dbgcommand.h
new file mode 100644
index 00000000..32ec7f7a
--- /dev/null
+++ b/languages/ruby/debugger/dbgcommand.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 DBGCOMMAND_H
+#define DBGCOMMAND_H
+
+#include <qstring.h>
+
+/**
+ * @author John Birch
+ */
+
+namespace RDBDebugger
+{
+
+class DbgCommand
+{
+public:
+ DbgCommand(const QCString& command, bool isRunCmd, bool isInfoCmd);
+ virtual ~DbgCommand() {};
+
+ virtual QCString& cmdToSend() { sent_ = true; return cmdBuffer_; }
+ virtual int cmdLength() { return cmdBuffer_.length(); }
+
+ QCString rawDbgCommand() const { return command_; }
+ bool isARunCmd() const { return isRunCmd_;}
+ bool isAnInfoCmd() const { return isInfoCmd_; }
+ bool moreToSend() const { return !sent_; }
+ bool expectReply() const { return waitForReply_; }
+
+protected:
+ QCString cmdBuffer_;
+ QCString command_;
+ bool isRunCmd_;
+ bool isInfoCmd_;
+ bool sent_;
+ bool waitForReply_;
+};
+
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+#endif
diff --git a/languages/ruby/debugger/dbgcontroller.cpp b/languages/ruby/debugger/dbgcontroller.cpp
new file mode 100644
index 00000000..7ee560b7
--- /dev/null
+++ b/languages/ruby/debugger/dbgcontroller.cpp
@@ -0,0 +1,46 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "dbgcontroller.h"
+#include <kprocess.h>
+
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+DbgController::DbgController()
+ : dbgProcess_(0)
+{
+}
+
+/***************************************************************************/
+
+DbgController::~DbgController()
+{
+ delete dbgProcess_;
+}
+
+/***************************************************************************/
+
+}
+
+#include "dbgcontroller.moc"
diff --git a/languages/ruby/debugger/dbgcontroller.h b/languages/ruby/debugger/dbgcontroller.h
new file mode 100644
index 00000000..13ee4382
--- /dev/null
+++ b/languages/ruby/debugger/dbgcontroller.h
@@ -0,0 +1,161 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _DBGCONTROLLER_H_
+#define _DBGCONTROLLER_H_
+
+#include <qobject.h>
+#include <domutil.h>
+
+class KProcess;
+class QString;
+class QStrList;
+
+namespace RDBDebugger
+{
+
+class Breakpoint;
+class DbgCommand;
+class LazyFetchItem;
+class VarItem;
+
+/***************************************************************************/
+/**
+ * @author jbb
+ */
+/***************************************************************************/
+// sigh - namespace's don't work on some of the older compilers
+enum DBGStateFlags
+{
+ s_dbgNotStarted = 1 << 0,
+ s_appNotStarted = 1 << 1,
+ s_appBusy = 1 << 2,
+ s_waitForWrite = 1 << 3,
+ s_programExited = 1 << 4,
+ s_silent = 1 << 5,
+ s_fetchLocals = 1 << 6,
+ s_viewBT = 1 << 7,
+ s_viewBP = 1 << 8,
+ s_attached = 1 << 9,
+ s_fetchGlobals = 1 << 10,
+ s_waitTimer = 1 << 11,
+ s_shuttingDown = 1 << 12,
+ s_viewThreads = 1 << 13
+};
+
+
+enum RttiValues {
+ RTTI_WATCH_ROOT = 1001,
+ RTTI_GLOBAL_ROOT = 1002,
+ RTTI_VAR_FRAME_ROOT = 1003,
+ RTTI_LAZY_FETCH_ITEM = 1004,
+ RTTI_VAR_ITEM = 1005,
+ RTTI_WATCH_VAR_ITEM = 1006,
+ RTTI_THREAD_STACK_ITEM = 1007,
+ RTTI_FRAME_STACK_ITEM = 1008
+};
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class DbgController : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ DbgController();
+ virtual ~DbgController();
+
+ virtual bool stateIsOn( int state ) = 0;
+
+protected:
+ virtual void queueCmd(DbgCommand *cmd, bool executeNext) = 0;
+ virtual void parse(char *str) = 0;
+
+public slots:
+ virtual void configure() = 0;
+
+ /**
+ * Start the debugger
+ * \param ruby_interpreter shell
+ * \param character_coding -K option
+ * \param run_directory Directory from where the program should be run
+ * \param debuggee_path Absolute path to debuggee.rb debugger script
+ * \param application Absolute path to application
+ * \param run_arguments Command line arguments to be passed to the application
+ * \param show_constants Show ruby constants in the variables view
+ */
+ virtual void slotStart(const QString& ruby_interpreter,
+ const QString& character_coding,
+ const QString& run_directory,
+ const QString& debuggee_path,
+ const QString& application,
+ const QString& run_arguments,
+ bool show_constants,
+ bool trace_into_ruby) = 0;
+
+ virtual void slotStopDebugger() = 0;
+
+ virtual void slotRun() = 0;
+ virtual void slotRunUntil(const QString &fileName, int lineNum) = 0;
+ virtual void slotStepInto() = 0;
+ virtual void slotStepOver() = 0;
+ virtual void slotStepOutOff() = 0;
+
+ virtual void slotBreakInto() = 0;
+ virtual void slotBPState(const Breakpoint&) = 0;
+
+
+ virtual void slotExpandItem(VarItem *parent,
+ const QCString &userRequest) = 0;
+ virtual void slotSelectFrame(int frame, int thread,
+ const QString& frameName) = 0;
+ virtual void slotFetchGlobals(bool fetch) = 0;
+
+protected slots:
+ virtual void slotDbgStdout(KProcess *proc, char *buf, int buflen) = 0;
+ virtual void slotDbgStderr(KProcess*, char*, int) {} ;
+ virtual void slotDbgWroteStdin(KProcess *proc) = 0;
+ virtual void slotDbgProcessExited(KProcess *proc) = 0;
+
+ virtual void slotAcceptConnection(int passive_socket) = 0;
+ virtual void slotReadFromSocket(int socket) = 0;
+
+signals:
+ void gotoSourcePosition (const QString &fileName, int lineNum);
+ void rawRDBBreakpointList (char *buf);
+ void rawRDBBreakpointSet (char *buf, int key);
+ void ttyStdout (const char *output);
+ void ttyStderr (const char *output);
+ void rdbStdout (const char *output);
+ void rdbStderr (const char *output);
+ void showStepInSource (const QString &fileName, int lineNum, const QString &address);
+ void dbgStatus (const QString &status, int statusFlag);
+
+protected:
+ KProcess *dbgProcess_;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/dbgpsdlg.cpp b/languages/ruby/debugger/dbgpsdlg.cpp
new file mode 100644
index 00000000..83dd1666
--- /dev/null
+++ b/languages/ruby/debugger/dbgpsdlg.cpp
@@ -0,0 +1,170 @@
+/***************************************************************************
+ begin : Mon Sep 20 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "dbgpsdlg.h"
+
+#include <kbuttonbox.h>
+#include <kdialog.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include <qframe.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qtoolbutton.h>
+#include <qpushbutton.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+namespace RDBDebugger
+{
+
+/***************************************************************************/
+
+// Display a list of processes for the user to select one
+// only display processes that they can do something with so if the user
+// is root then display all processes
+// For use with the internal debugger, but this dialog doesn't know anything
+// about why it's doing it.
+
+Dbg_PS_Dialog::Dbg_PS_Dialog(QWidget *parent, const char *name)
+ : KDialog(parent, name, true), // modal
+ psProc_(0),
+ pids_(new QListBox(this)),
+ heading_(new QLabel(" ", this)),
+ pidLines_(QString())
+{
+ setCaption(i18n("Attach to Process"));
+
+ QBoxLayout *topLayout = new QVBoxLayout(this, 5);
+
+ heading_->setFont(KGlobalSettings::fixedFont());
+ heading_->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ heading_->setMaximumHeight(heading_->sizeHint().height());
+// heading_->setMinimumSize(heading_->sizeHint());
+ topLayout->addWidget(heading_, 5);
+
+ topLayout->addWidget(pids_, 5);
+ pids_->setFont(KGlobalSettings::fixedFont());
+
+ KButtonBox *buttonbox = new KButtonBox(this, Qt::Horizontal, 5);
+ QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
+ buttonbox->addStretch();
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+ buttonbox->layout();
+ topLayout->addWidget(buttonbox);
+
+ connect(ok, SIGNAL(clicked()), SLOT(accept()));
+ connect(cancel, SIGNAL(clicked()), SLOT(reject()));
+
+ psProc_ = new KShellProcess("/bin/sh");
+ #ifdef USE_SOLARIS
+ *psProc_ << "ps";
+ *psProc_ << "-opid";
+ *psProc_ << "-otty";
+ *psProc_ << "-os";
+ *psProc_ << "-otime";
+ *psProc_ << "-oargs";
+ pidCmd_ = "ps -opid -otty -os -otime -oargs";
+
+ if (getuid() == 0) {
+ *psProc_ << "-e";
+ pidCmd_ += " -e";
+ }
+ #else
+ *psProc_ << "ps";
+ *psProc_ << "x";
+ pidCmd_ = "ps x";
+
+ if (getuid() == 0) {
+ *psProc_ << "a";
+ pidCmd_ += " a";
+ }
+ #endif
+
+ connect( psProc_, SIGNAL(processExited(KProcess *)), SLOT(slotProcessExited()) );
+ connect( psProc_, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(slotReceivedOutput(KProcess *, char *, int)) );
+ psProc_->start(KProcess::NotifyOnExit, KProcess::Stdout);
+
+ // Default display to 40 chars wide, default height is okay
+ resize( ((KGlobalSettings::fixedFont()).pointSize())*40, height());
+ topLayout->activate();
+}
+
+/***************************************************************************/
+
+Dbg_PS_Dialog::~Dbg_PS_Dialog()
+{
+ delete psProc_;
+}
+
+/***************************************************************************/
+
+int Dbg_PS_Dialog::pidSelected()
+{
+ QString pidText = pids_->text(pids_->currentItem());
+ if (!pidText.isEmpty())
+ return atoi(pidText.latin1());
+
+ return 0;
+}
+
+/***************************************************************************/
+
+void Dbg_PS_Dialog::slotReceivedOutput(KProcess */*proc*/, char *buffer, int buflen)
+{
+ pidLines_ += QString::fromLocal8Bit(buffer, buflen+1);
+}
+
+/***************************************************************************/
+
+void Dbg_PS_Dialog::slotProcessExited()
+{
+ delete psProc_;
+ psProc_ = 0;
+
+ pidLines_ += '\n';
+
+ int start = pidLines_.find('\n', 0); // Skip the first line (header line)
+ int pos;
+ if (start != -1)
+ heading_->setText(pidLines_.left(start));
+ while ( (pos = pidLines_.find('\n', start)) != -1) {
+ QString item = pidLines_.mid(start, pos-start);
+ if (!item.isEmpty()) {
+ if (item.find(pidCmd_) == -1)
+ pids_->insertItem(item);
+ }
+
+ start = pos+1;
+ }
+}
+
+}
+
+/***************************************************************************/
+#include "dbgpsdlg.moc"
diff --git a/languages/ruby/debugger/dbgpsdlg.h b/languages/ruby/debugger/dbgpsdlg.h
new file mode 100644
index 00000000..641f7aa5
--- /dev/null
+++ b/languages/ruby/debugger/dbgpsdlg.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ begin : Mon Sep 20 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _DBGPSDLG_H_
+#define _DBGPSDLG_H_
+
+#include <kdialog.h>
+
+class QListBox;
+class KProcess;
+class QLabel;
+
+namespace RDBDebugger
+{
+
+/***************************************************************************/
+
+class Dbg_PS_Dialog : public KDialog
+{
+ Q_OBJECT
+
+public:
+ Dbg_PS_Dialog( QWidget *parent=0, const char *name=0 );
+ ~Dbg_PS_Dialog();
+
+ int pidSelected();
+
+private slots:
+ void slotReceivedOutput(KProcess *proc, char *buffer, int buflen);
+ void slotProcessExited();
+
+private:
+ KProcess* psProc_;
+ QListBox* pids_;
+ QLabel* heading_;
+ QString pidLines_;
+ QString pidCmd_;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/dbgtoolbar.cpp b/languages/ruby/debugger/dbgtoolbar.cpp
new file mode 100644
index 00000000..702c8e83
--- /dev/null
+++ b/languages/ruby/debugger/dbgtoolbar.cpp
@@ -0,0 +1,483 @@
+/***************************************************************************
+ begin : Thu Dec 23 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "dbgtoolbar.h"
+#include "debuggerpart.h"
+#include "dbgcontroller.h"
+
+#include <kdockwindow.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kstandarddirs.h>
+#include <kwin.h>
+#include <kwinmodule.h>
+
+#include <qapplication.h>
+#include <qcursor.h>
+#include <qframe.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// Implements a floating toolbar for the debugger.
+
+// Unfortunately, I couldn't get the KToolBar to work nicely when it
+// was floating, so I was forced to write these classes. I'm not sure whether
+// I didn't try hard enough or ... and I've forgotten what the problems were
+// now.
+
+// The problem with using this is that it will not dock as a normal toolbar.
+// I'm not convince that this is a real problem though.
+
+// So, if you can get it to work as a KToolBar, and it works well when the
+// app is running, then all these classes can be removed.
+
+// This code is very specific to the internal debugger in kdevelop.
+
+namespace RDBDebugger
+{
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// This just allows the user to click on the toolbar and drag it somewhere else.
+// I would have preferred to use normal decoration on the toolbar and removed
+// the iconify, close, etc buttons from the window title but again I kept running
+// into problems. Instead, I used no decoration and this class. Also this looks
+// similar to the KToolBar floating style.
+class DbgMoveHandle : public QFrame
+{
+public:
+ DbgMoveHandle(DbgToolBar *parent=0, const char * name=0, WFlags f=0);
+ virtual ~DbgMoveHandle();
+
+ virtual void mousePressEvent(QMouseEvent *e);
+ virtual void mouseReleaseEvent(QMouseEvent *e);
+ virtual void mouseMoveEvent(QMouseEvent *e);
+
+private:
+ DbgToolBar* toolBar_;
+ QPoint offset_;
+ bool moving_;
+};
+
+// **************************************************************************
+
+DbgMoveHandle::DbgMoveHandle(DbgToolBar *parent, const char * name, WFlags f)
+ : QFrame(parent, name, f),
+ toolBar_(parent),
+ offset_(QPoint(0,0)),
+ moving_(false)
+{
+ setFrameStyle(QFrame::Panel|QFrame::Raised);
+ setFixedHeight(12);
+}
+
+// **************************************************************************
+
+DbgMoveHandle::~DbgMoveHandle()
+{
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mousePressEvent(QMouseEvent *e)
+{
+ QFrame::mousePressEvent(e);
+ if (moving_)
+ return;
+
+ if (e->button() == RightButton) {
+ KPopupMenu *menu = new KPopupMenu(this);
+ menu->insertTitle(i18n("Debug Toolbar"));
+ menu->insertItem(i18n("Dock to Panel"),
+ parent(), SLOT(slotDock()));
+ menu->insertItem(i18n("Dock to Panel && Iconify KDevelop"),
+ parent(), SLOT(slotIconifyAndDock()));
+ menu->popup(e->globalPos());
+ } else {
+ moving_ = true;
+ offset_ = parentWidget()->pos() - e->globalPos();
+ setFrameStyle(QFrame::Panel|QFrame::Sunken);
+ QApplication::setOverrideCursor(QCursor(sizeAllCursor));
+ setPalette(QPalette(colorGroup().background()));
+ repaint();
+ }
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mouseReleaseEvent(QMouseEvent *e)
+{
+ QFrame::mouseReleaseEvent(e);
+ moving_ = false;
+ offset_ = QPoint(0,0);
+ setFrameStyle(QFrame::Panel|QFrame::Raised);
+ QApplication::restoreOverrideCursor();
+ setPalette(QPalette(colorGroup().background()));
+ repaint();
+}
+
+// **************************************************************************
+
+void DbgMoveHandle::mouseMoveEvent(QMouseEvent *e)
+{
+ QFrame::mouseMoveEvent(e);
+ if (!moving_)
+ return;
+
+ toolBar_->move(e->globalPos() + offset_);
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// This class adds text _and_ a pixmap to a button. Why doesn't QPushButton
+// support that? It only allowed text _or_ pixmap.
+class DbgButton : public QPushButton
+{
+public:
+ DbgButton(const QPixmap &pixmap, const QString &text,
+ DbgToolBar *parent, const char *name=0);
+ virtual ~DbgButton() {};
+ void drawButtonLabel(QPainter *painter);
+ QSize sizeHint() const;
+
+private:
+ QPixmap pixmap_;
+};
+
+// **************************************************************************
+
+DbgButton::DbgButton(const QPixmap& pixmap, const QString& text,
+ DbgToolBar* parent, const char* name)
+ : QPushButton(parent, name),
+ pixmap_(pixmap)
+{
+ setText(text);
+}
+
+// **************************************************************************
+
+void DbgButton::drawButtonLabel(QPainter *painter)
+{
+ // We always have a pixmap (today...)
+ // Centre it if there's no text
+
+ bool hasText = !text().isEmpty();
+ int x = ((hasText ? height() : width()) - pixmap_.width()) / 2;
+ int y = (height() - pixmap_.height()) / 2;
+ painter->drawPixmap(x, y, pixmap_);
+
+ if (hasText) {
+ painter->setPen(colorGroup().text());
+ painter->drawText(height()+2, 0, width()-(height()+2), height(), AlignLeft|AlignVCenter, text());
+ }
+}
+
+// **************************************************************************
+
+QSize DbgButton::sizeHint() const
+{
+ if (text().isEmpty())
+ return pixmap_.size();
+ else
+ return QPushButton::sizeHint();
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+DbgDocker::DbgDocker(QWidget* parent, DbgToolBar* toolBar, const QPixmap& pixmap) :
+ KSystemTray(parent, "DbgDocker"),
+ toolBar_(toolBar)
+{
+ setPixmap(pixmap);
+ QToolTip::add( this, i18n("KDevelop ruby debugger: Click to execute one line of code (\"step\")") );
+}
+
+// **************************************************************************
+
+void DbgDocker::mousePressEvent(QMouseEvent *e)
+{
+ if (!rect().contains( e->pos()))
+ return;
+
+ switch (e->button()) {
+ case LeftButton:
+ {
+ // Not really a click, but it'll hold for the time being !!!
+ emit clicked();
+ break;
+ }
+ case RightButton:
+ {
+ KPopupMenu* menu = new KPopupMenu(this);
+ menu->insertTitle(i18n("Debug Toolbar"));
+ menu->insertItem(i18n("Activate"), toolBar_, SLOT(slotUndock()));
+ menu->insertItem(i18n("Activate (KDevelop gets focus)"), toolBar_, SLOT(slotActivateAndUndock()));
+ menu->popup(e->globalPos());
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+DbgToolBar::DbgToolBar(RubyDebuggerPart* part,
+ QWidget* parent, const char* name)
+ : QFrame(0, name),
+ part_(part),
+ activeWindow_(0),
+ winModule_(0),
+ bKDevFocus_(0),
+ bPrevFocus_(0),
+ appIsActive_(false),
+ docked_(false),
+ docker_(0),
+ dockWindow_(new KSystemTray(parent))
+{
+ winModule_ = new KWinModule(this);
+ docker_ = new DbgDocker(parent, this, BarIcon("dbgnext"));
+ connect(docker_, SIGNAL(clicked()), part_, SLOT(slotStepOver()));
+
+ // Must have noFocus set so that we can see what window was active.
+ // see slotDbgKdevFocus() for more comments
+ // I do not want the user to be able to "close" this widget. If we have any
+ // decoration then they can and that is bad.
+ // This widget is closed when the debugger finishes i.e. they press "Stop"
+
+ // Do we need NoFocus???
+ KWin::setState(winId(), NET::StaysOnTop | NET::Modal | NET::SkipTaskbar);
+// KWin::setType(winId(), NET::Override); // So it has no decoration
+ KWin::setType(winId(), NET::Dock);
+
+ setFocusPolicy(NoFocus);
+ setFrameStyle( QFrame::Box | QFrame::Plain );
+ setLineWidth(4);
+ setMidLineWidth(0);
+
+ QBoxLayout* topLayout = new QVBoxLayout(this);
+
+ QBoxLayout* nextLayout = new QHBoxLayout();
+ QBoxLayout* stepLayout = new QHBoxLayout();
+ QBoxLayout* focusLayout = new QHBoxLayout();
+
+ DbgMoveHandle* moveHandle= new DbgMoveHandle(this);
+
+ QPushButton* bRun = new DbgButton(BarIcon("dbgrun"), i18n("Run"), this);
+ QPushButton* bInterrupt = new DbgButton(BarIcon("player_pause"), i18n("Interrupt"), this);
+ QPushButton* bNext = new DbgButton(BarIcon("dbgnext"), i18n("Step Over"), this);
+ QPushButton* bStep = new DbgButton(BarIcon("dbgstep"), i18n("Step Into"), this);
+ QPushButton* bFinish = new DbgButton(BarIcon("dbgstepout"), i18n("Step Out"), this);
+ QPushButton* bRunTo = new DbgButton(BarIcon("dbgrunto"), i18n("Run to Cursor"), this);
+ bPrevFocus_ = new DbgButton(BarIcon("dbgmemview"), QString::null, this);
+ bKDevFocus_ = new DbgButton(BarIcon("kdevelop"), QString::null, this);
+
+ connect(bRun, SIGNAL(clicked()), part_, SLOT(slotRun()));
+ connect(bInterrupt, SIGNAL(clicked()), part_, SLOT(slotPause()));
+ connect(bNext, SIGNAL(clicked()), part_, SLOT(slotStepOver()));
+ connect(bStep, SIGNAL(clicked()), part_, SLOT(slotStepInto()));
+ connect(bFinish, SIGNAL(clicked()), part_, SLOT(slotStepOut()));
+ connect(bRunTo, SIGNAL(clicked()), part_, SLOT(slotRunToCursor()));
+ connect(bKDevFocus_, SIGNAL(clicked()), this, SLOT(slotKdevFocus()));
+ connect(bPrevFocus_, SIGNAL(clicked()), this, SLOT(slotPrevFocus()));
+
+ QToolTip::add( bRun, i18n("Continue with application execution, may start the application") );
+ QToolTip::add( bInterrupt, i18n("Interrupt the application execution") );
+ QToolTip::add( bNext, i18n("Execute one line of code, but run through methods") );
+ QToolTip::add( bStep, i18n("Execute one line of code, stepping into methods if appropriate") );
+ QToolTip::add( bFinish, i18n("Execute to end of current stack frame") );
+ QToolTip::add( bRunTo, i18n("Continues execution until the cursor position is reached.") );
+ QToolTip::add( bKDevFocus_, i18n("Set focus on KDevelop") );
+ QToolTip::add( bPrevFocus_, i18n("Set focus on window that had focus when KDevelop got focus") );
+
+ QWhatsThis::add( bRun, i18n("Continue with application execution. May start the application.") );
+ QWhatsThis::add( bInterrupt, i18n("Interrupt the application execution.") );
+ QWhatsThis::add( bNext, i18n("Execute one line of code, but run through methods.") );
+
+ QWhatsThis::add( bStep, i18n("Execute one line of code, stepping into methods if appropriate.") );
+
+ QWhatsThis::add( bFinish, i18n("Execute to end of current stack frame.") );
+ QWhatsThis::add( bRunTo, i18n("Continues execution until the cursor position is reached.") );
+ QWhatsThis::add( bKDevFocus_, i18n("Set focus on KDevelop.") );
+ QWhatsThis::add( bPrevFocus_, i18n("Set focus on window that had focus when KDevelop got focus.") );
+
+ topLayout->addWidget(moveHandle);
+ topLayout->addWidget(bRun);
+ topLayout->addLayout(nextLayout);
+ topLayout->addLayout(stepLayout);
+ topLayout->addWidget(bFinish);
+ topLayout->addWidget(bRunTo);
+ topLayout->addWidget(bInterrupt);
+ topLayout->addLayout(focusLayout);
+
+ focusLayout->addWidget(bKDevFocus_);
+ focusLayout->addWidget(bPrevFocus_);
+
+ stepLayout->addWidget(bStep);
+
+ nextLayout->addWidget(bNext);
+
+// int w = QMAX(bRun->sizeHint().width(), bFinish->sizeHint().width());
+// w = QMAX(w, bInterrupt->sizeHint().width());
+// w = QMAX(w, bView->sizeHint().width());
+
+ // they should have the same height, so don't be too fussy
+// int h = bFinish->sizeHint().height();
+//
+// bNext->setMinimumHeight(h);
+// bNexti->setMinimumHeight(h);
+// bStep->setMinimumHeight(h);
+// bStepi->setMinimumHeight(h);
+// bKDevFocus_->setMinimumHeight(h);
+// bPrevFocus_->setMinimumHeight(h);
+
+// setMinimumSize(w+10, h*7);
+// setMaximumSize(w+10, h*7);
+
+ setAppIndicator(appIsActive_);
+ topLayout->activate();
+}
+
+// **************************************************************************
+
+DbgToolBar::~DbgToolBar()
+{
+ slotUndock();
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotKdevFocus()
+{
+ // I really want to be able to set the focus on the _application_ being debugged
+ // but this is the best compromise I can come up with. All we do is save the
+ // window that had focus when they switch to the kdevelop window. To do this
+ // the toolbar _cannot_ accept focus.
+ // If anyone has a way of determining what window the app is _actually_ running on
+ // then please fix and send a patch.
+
+ if (winModule_->activeWindow() != topLevelWidget()->winId())
+ activeWindow_ = winModule_->activeWindow();
+
+ KWin::activateWindow(topLevelWidget()->winId());
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotPrevFocus()
+{
+ KWin::activateWindow(activeWindow_);
+}
+
+// **************************************************************************
+
+// If the app is active then the app button is highlighted, otherwise
+// kdev button is highlighted.
+void DbgToolBar::slotDbgStatus(const QString&, int state)
+{
+ bool appIndicator = state & s_appBusy;
+ if (appIndicator != appIsActive_) {
+ setAppIndicator(appIndicator);
+ appIsActive_ = appIndicator;
+ }
+}
+
+// **************************************************************************
+
+void DbgToolBar::setAppIndicator(bool appIndicator)
+{
+ if (appIndicator) {
+ bPrevFocus_->setPalette(QPalette(colorGroup().mid()));
+ bKDevFocus_->setPalette(QPalette(colorGroup().background()));
+ } else {
+ bPrevFocus_->setPalette(QPalette(colorGroup().background()));
+ bKDevFocus_->setPalette(QPalette(colorGroup().mid()));
+ }
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotDock()
+{
+ if (docked_)
+ return;
+
+ // Q_ASSERT(!docker_);
+ hide();
+
+ docker_->show();
+ docked_ = true;
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotIconifyAndDock()
+{
+ if (docked_)
+ return;
+
+ // KWin::iconifyWindow(ckDevelop_->winId(), true);
+ slotDock();
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotUndock()
+{
+ if (!docked_)
+ return;
+
+ show();
+ docker_->hide();
+ docked_ = false;
+}
+
+// **************************************************************************
+
+void DbgToolBar::slotActivateAndUndock()
+{
+ if (!docked_)
+ return;
+
+ KWin::activateWindow(topLevelWidget()->winId());
+ slotUndock();
+}
+
+}
+
+// **************************************************************************
+#include "dbgtoolbar.moc"
diff --git a/languages/ruby/debugger/dbgtoolbar.h b/languages/ruby/debugger/dbgtoolbar.h
new file mode 100644
index 00000000..a19b2eae
--- /dev/null
+++ b/languages/ruby/debugger/dbgtoolbar.h
@@ -0,0 +1,90 @@
+/***************************************************************************
+ begin : Thu Dec 23 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 *q
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DBGTOOLBAR_H_
+#define _DBGTOOLBAR_H_
+
+class KWinModule;
+
+#include <ksystemtray.h>
+#include <kwin.h> // needed for WId :(
+
+#include <qframe.h>
+
+namespace RDBDebugger
+{
+
+class DbgButton;
+class DbgToolBar;
+class RubyDebuggerPart;
+
+class DbgDocker : public KSystemTray
+{
+ Q_OBJECT
+
+public:
+ DbgDocker(QWidget *parent, DbgToolBar *toolBar, const QPixmap &pixmap);
+ virtual ~DbgDocker() {};
+ virtual void mousePressEvent(QMouseEvent *e);
+
+signals:
+ void clicked();
+
+private:
+ DbgToolBar* toolBar_;
+};
+
+
+class DbgToolBar : public QFrame
+{
+ Q_OBJECT
+
+public:
+ DbgToolBar(RubyDebuggerPart *part, QWidget* parent, const char* name=0);
+ virtual ~DbgToolBar();
+
+private slots:
+ void slotDbgStatus(const QString&, int);
+ void slotDock();
+ void slotUndock();
+ void slotIconifyAndDock();
+ void slotActivateAndUndock();
+
+ void slotKdevFocus();
+ void slotPrevFocus();
+
+private:
+ void setAppIndicator(bool appIndicator);
+
+ RubyDebuggerPart* part_;
+ WId activeWindow_;
+ KWinModule* winModule_;
+ DbgButton* bKDevFocus_;
+ DbgButton* bPrevFocus_;
+ bool appIsActive_;
+ bool docked_;
+ DbgDocker* docker_;
+ KSystemTray* dockWindow_;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/debuggee.rb b/languages/ruby/debugger/debuggee.rb
new file mode 100644
index 00000000..38e2dea7
--- /dev/null
+++ b/languages/ruby/debugger/debuggee.rb
@@ -0,0 +1,1214 @@
+# Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+# Copyright (C) 2000 Information-technology Promotion Agency, Japan
+# Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+# Changes for the FreeRIDE IDE by Laurent JULLIARD. FreeRIDE uses
+# Distributed ruby (DRuby) to communicate with the debugger back
+# end. However, this can't interoperate with C++ in KDevelop and so
+# a Unix domain socket connection is used instead.
+
+# Adapted for KDevelop debugging
+# ------------------------------
+# begin : Mon Nov 1 2004
+# copyright : (C) 2004 by Richard Dale
+# email : Richard_Dale@tipitina.demon.co.uk
+
+if $SAFE > 0
+ STDERR.print "-r debug.rb is not available in safe mode\n"
+ exit 1
+end
+
+require 'tracer'
+require 'pp'
+require 'rbconfig'
+
+class Tracer
+ def Tracer.trace_func(*vars)
+ Single.trace_func(*vars)
+ end
+end
+
+# FreeRIDE/KDevelop must always intercept exits hence the exit! redefinition
+# at_exit calls the quit method to cleanly disconnect from the
+# FreeRIDE/KDevelop debugger client
+module Kernel
+ alias_method :exit!, :exit
+end
+
+BEGIN {
+ at_exit do
+ set_trace_func nil
+ DEBUGGER__.quit
+ end
+}
+
+SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
+
+class DEBUGGER__
+class Mutex
+ def initialize
+ @locker = nil
+ @waiting = []
+ @locked = false;
+ end
+
+ def locked?
+ @locked
+ end
+
+ def lock
+ return if Thread.critical
+ return if @locker == Thread.current
+ while (Thread.critical = true; @locked)
+ @waiting.push Thread.current
+ Thread.stop
+ end
+ @locked = true
+ @locker = Thread.current
+ Thread.critical = false
+ self
+ end
+
+ def unlock
+ return if Thread.critical
+ return unless @locked
+ unless @locker == Thread.current
+ raise RuntimeError, "unlocked by other"
+ end
+ Thread.critical = true
+ t = @waiting.shift
+ @locked = false
+ @locker = nil
+ Thread.critical = false
+ t.run if t
+ self
+ end
+end
+MUTEX = Mutex.new
+
+class Context
+ DEBUG_LAST_CMD = []
+
+ def readline(prompt_cmd, hist)
+ DEBUGGER__.client.readline(prompt_cmd)
+ end
+
+ def initialize
+ if Thread.current == Thread.main
+ @stop_next = 1
+ else
+ @stop_next = 0
+ end
+ @last_file = nil
+ @file = nil
+ @line = nil
+ @no_step = nil
+ @frames = []
+ @finish_pos = 0
+ @trace = false
+ @trace_ruby = false
+ @catch = "StandardError"
+ @suspend_next = false
+ end
+
+ def stop_next(n=1)
+ @stop_next = n
+ end
+
+ def set_suspend
+ @suspend_next = true
+ end
+
+ def clear_suspend
+ @suspend_next = false
+ end
+
+ def suspend_all
+ DEBUGGER__.suspend
+ end
+
+ def resume_all
+ DEBUGGER__.resume
+ end
+
+ def check_suspend
+ return if Thread.critical
+ while (Thread.critical = true; @suspend_next)
+ DEBUGGER__.waiting.push Thread.current
+ @suspend_next = false
+ Thread.stop
+ end
+ Thread.critical = false
+ end
+
+ def trace?
+ @trace
+ end
+
+ def set_trace(arg)
+ @trace = arg
+ end
+
+ def trace_ruby?
+ @trace_ruby
+ end
+
+ def set_trace_ruby(arg)
+ @trace_ruby = arg
+ end
+
+ def stdout
+ DEBUGGER__.stdout
+ end
+
+ def break_points
+ DEBUGGER__.break_points
+ end
+
+ def display
+ DEBUGGER__.display
+ end
+
+ def context(th)
+ DEBUGGER__.context(th)
+ end
+
+ def set_trace_all(arg)
+ DEBUGGER__.set_trace(arg)
+ end
+
+ def set_last_thread(th)
+ DEBUGGER__.set_last_thread(th)
+ end
+
+ def debug_eval(str, binding)
+ begin
+ val = eval(str, binding)
+ rescue StandardError, ScriptError => e
+ at = eval("caller(1)", binding)
+ stdout.printf "%s:%s\n", at.shift, e.to_s.sub(/\(eval\):1:(in `.*?':)?/, '')
+ for i in at
+ stdout.printf "\tfrom %s\n", i
+ end
+ throw :debug_error
+ end
+ end
+
+ def debug_silent_eval(str, binding)
+ begin
+ eval(str, binding)
+ rescue StandardError, ScriptError
+ nil
+ end
+ end
+
+ # Temporarily change the pretty_print methods to not expand arrays
+ # and hashes, just give the length
+ def customize_debug_pp
+ Array.module_eval %q{
+ def pretty_print(pp)
+ pp.pp "Array (%d element(s))" % length
+ end
+ }
+
+ Hash.module_eval %q{
+ def pretty_print(pp)
+ pp.pp "Hash (%d element(s))" % length
+ end
+ }
+ end
+
+ # Restore the original pretty_print methods for arrays and hashes
+ def restore_debug_pp
+ Array.module_eval %q{
+ def pretty_print(q)
+ q.group(1, '[', ']') {
+ self.each {|v|
+ q.comma_breakable unless q.first?
+ q.pp v
+ }
+ }
+ end
+ }
+ Hash.module_eval %q{
+ def pretty_print(q)
+ q.pp_hash self
+ end
+ }
+ end
+
+ # Prevent the 'var *' commands from expanding Arrays and Hashes
+ # This could be done by redefining inspect, but that would affect
+ # everywhere not just here and in the pp command.
+ def debug_inspect(obj)
+ if obj.kind_of? Array
+ "Array (%d element(s))" % obj.length
+ elsif obj.kind_of? Hash
+ "Hash (%d element(s))" % obj.length
+ elsif obj.kind_of? String
+ str = obj.inspect
+ if str.length > 255
+ "String (length %d)" % obj.length
+ else
+ str
+ end
+ else
+ obj.inspect
+ end
+ end
+
+ def var_list(ary, binding)
+ ary.sort!
+ for v in ary
+ stdout.printf " %s => %s\n", v, debug_inspect(eval(v, binding))
+ end
+ end
+
+ def const_list(ary, obj)
+ ary.sort!
+ for c in ary
+ str = debug_inspect(obj.module_eval(c))
+ if c.to_s != str &&
+ str !~ /^Qt::|^KDE::/ && c.to_s !~ /@@classes$|@@cpp_names$|@@idclass$|@@debug_level$/ &&
+ c.to_s !~ /^DCOPMeta$|^Meta$|SCRIPT_LINES__|TRUE|FALSE|NIL|MatchingData/ &&
+ c.to_s !~ /^PLATFORM$|^RELEASE_DATE$|^VERSION$|SilentClient|SilentObject/ &&
+ c.to_s !~ /^Client$|^Context$|^DEBUG_LAST_CMD$|^MUTEX$|^Mutex$|^SimpleDelegater$|^Delegater$/ &&
+ c.to_s !~ /IPsocket|IPserver|UDPsocket|UDPserver|TCPserver|TCPsocket|UNIXserver|UNIXsocket/
+ if c.to_s == "ENV"
+ stdout.printf " %s => Hash (%d element(s))\n", c, obj.module_eval(c).length
+ else
+ stdout.printf " %s => %s\n", c, str
+ end
+ end
+ end
+ end
+
+ def debug_variable_info(input, binding)
+ case input
+ when /^\s*g(?:lobal)?$/
+ var_list(global_variables, binding)
+
+ when /^\s*l(?:ocal)?$/
+ var_list(eval("local_variables", binding) << "self", binding)
+
+ when /^\s*i(?:nstance)?\s+/
+ obj = debug_eval($', binding)
+ var_list(obj.instance_variables, obj.instance_eval{binding()})
+
+ when /^\s*cl(?:ass)?\s+/
+ obj = debug_eval($', binding)
+ unless obj.kind_of? Module
+ stdout.print "Should be Class/Module: ", $', "\n"
+ else
+ const_list(obj.class_variables, obj)
+ end
+
+ when /^\s*c(?:onst(?:ant)?)?\s+/
+ obj = debug_eval($', binding)
+ unless obj.kind_of? Module
+ stdout.print "Should be Class/Module: ", $', "\n"
+ else
+ const_list(obj.constants, obj)
+ end
+ end
+ end
+
+ def debug_method_info(input, binding)
+ case input
+ when /^i(:?nstance)?\s+/
+ obj = debug_eval($', binding)
+
+ len = 0
+ for v in obj.methods.sort
+ len += v.size + 1
+ if len > 70
+ len = v.size + 1
+ stdout.print "\n"
+ end
+ stdout.print v, " "
+ end
+ stdout.print "\n"
+
+ else
+ obj = debug_eval(input, binding)
+ unless obj.kind_of? Module
+ stdout.print "Should be Class/Module: ", input, "\n"
+ else
+ len = 0
+ for v in obj.instance_methods(false).sort
+ len += v.size + 1
+ if len > 70
+ len = v.size + 1
+ stdout.print "\n"
+ end
+ stdout.print v, " "
+ end
+ stdout.print "\n"
+ end
+ end
+ end
+
+ def thnum
+ num = DEBUGGER__.instance_eval{@thread_list[Thread.current]}
+ unless num
+ DEBUGGER__.make_thread_list
+ num = DEBUGGER__.instance_eval{@thread_list[Thread.current]}
+ end
+ num
+ end
+
+ def debug_command(file, line, id, binding)
+ MUTEX.lock
+ set_last_thread(Thread.current)
+ frame_pos = 0
+ binding_file = file
+ binding_line = line
+ previous_line = nil
+ if ENV['EMACS']
+ stdout.printf "\032\032%s:%d:\n", binding_file, binding_line
+ else
+ stdout.printf "%s:%d:%s", binding_file, binding_line,
+ line_at(binding_file, binding_line)
+ end
+ @frames[0] = [binding, file, line, id]
+ display_expressions(binding)
+ prompt = true
+ while prompt and input = readline("(rdb:%d) "%thnum(), true)
+ catch(:debug_error) do
+ if input == ""
+ next unless DEBUG_LAST_CMD[0]
+ input = DEBUG_LAST_CMD[0]
+ stdout.print input, "\n"
+ else
+ DEBUG_LAST_CMD[0] = input
+ end
+
+ case input
+ when /^\s*trace_ruby(?:\s+(on|off))?$/
+ if defined?( $1 )
+ if $1 == 'on'
+ set_trace_ruby true
+ else
+ set_trace_ruby false
+ end
+ end
+
+ when /^\s*tr(?:ace)?(?:\s+(on|off))?(?:\s+(all))?$/
+ if defined?( $2 )
+ if $1 == 'on'
+ set_trace_all true
+ else
+ set_trace_all false
+ end
+ elsif defined?( $1 )
+ if $1 == 'on'
+ set_trace true
+ else
+ set_trace false
+ end
+ end
+ if trace?
+ stdout.print "Trace on.\n"
+ else
+ stdout.print "Trace off.\n"
+ end
+
+ when /^\s*b(?:reak)?\s+(?:(.+):)?([^.:]+)$/
+ pos = $2
+ if $1
+ klass = debug_silent_eval($1, binding)
+# file = $1
+ file = File.expand_path($1)
+ end
+ if pos =~ /^\d+$/
+ pname = pos
+ pos = pos.to_i
+ else
+ pname = pos = pos.intern.id2name
+ end
+ break_points.push [true, 0, klass || file, pos]
+ stdout.printf "Set breakpoint %d at %s:%s\n", break_points.size, klass || file, pname
+
+ when /^\s*b(?:reak)?\s+(.+)[#.]([^.:]+)$/
+ pos = $2.intern.id2name
+ klass = debug_eval($1, binding)
+ break_points.push [true, 0, klass, pos]
+ stdout.printf "Set breakpoint %d at %s.%s\n", break_points.size, klass, pos
+
+ when /^\s*wat(?:ch)?\s+(.+)$/
+ exp = $1
+ break_points.push [true, 1, exp]
+ stdout.printf "Set watchpoint %d\n", break_points.size, exp
+
+ when /^\s*b(?:reak)?$/
+ if break_points.find{|b| b[1] == 0}
+ n = 1
+ stdout.print "Breakpoints:\n"
+ for b in break_points
+ if b[0] and b[1] == 0
+ stdout.printf " %d %s:%s\n", n, b[2], b[3]
+ end
+ n += 1
+ end
+ end
+ if break_points.find{|b| b[1] == 1}
+ n = 1
+ stdout.print "\n"
+ stdout.print "Watchpoints:\n"
+ for b in break_points
+ if b[0] and b[1] == 1
+ stdout.printf " %d %s\n", n, b[2]
+ end
+ n += 1
+ end
+ end
+ if break_points.size == 0
+ stdout.print "No breakpoints\n"
+ else
+ stdout.print "\n"
+ end
+
+ when /^\s*del(?:ete)?(?:\s+(\d+))?$/
+ pos = $1
+ unless pos
+# input = readline("Clear all breakpoints? (y/n) ", false)
+# if input == "y"
+ for b in break_points
+ b[0] = false
+ end
+# end
+ else
+ pos = pos.to_i
+ if break_points[pos-1]
+ break_points[pos-1][0] = false
+ else
+ stdout.printf "Breakpoint %d is not defined\n", pos
+ end
+ end
+
+ when /^\s*disp(?:lay)?\s+(.+)$/
+ exp = $1
+ display.push [true, exp]
+ stdout.printf "%d: ", display.size
+ display_expression(exp, binding)
+
+ when /^\s*disp(?:lay)?$/
+ display_expressions(binding)
+
+ when /^\s*undisp(?:lay)?(?:\s+(\d+))?$/
+ pos = $1
+ unless pos
+# input = readline("Clear all expressions? (y/n) ", false)
+# if input == "y"
+ for d in display
+ d[0] = false
+ end
+# end
+ else
+ pos = pos.to_i
+ if display[pos-1]
+ display[pos-1][0] = false
+ else
+ stdout.printf "Display expression %d is not defined\n", pos
+ end
+ end
+
+ when /^\s*c(?:ont)?$/
+ prompt = false
+
+ when /^\s*s(?:tep)?(?:\s+(\d+))?$/
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ @stop_next = lev
+ prompt = false
+
+ when /^\s*n(?:ext)?(?:\s+(\d+))?$/
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ @stop_next = lev
+ @no_step = @frames.size - frame_pos
+ prompt = false
+
+ when /^\s*w(?:here)?$/, /^\s*f(?:rame)?$/
+ display_frames(frame_pos)
+
+ when /^\s*l(?:ist)?(?:\s+(.+))?$/
+ if not $1
+ b = previous_line ? previous_line + 10 : binding_line - 5
+ e = b + 9
+ elsif $1 == '-'
+ b = previous_line ? previous_line - 10 : binding_line - 5
+ e = b + 9
+ else
+ b, e = $1.split(/[-,]/)
+ if e
+ b = b.to_i
+ e = e.to_i
+ else
+ b = b.to_i - 5
+ e = b + 9
+ end
+ end
+ previous_line = b
+ display_list(b, e, binding_file, binding_line)
+
+ when /^\s*up(?:\s+(\d+))?$/
+ previous_line = nil
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ frame_pos += lev
+ if frame_pos >= @frames.size
+ frame_pos = @frames.size - 1
+ stdout.print "At toplevel\n"
+ end
+ binding, binding_file, binding_line = @frames[frame_pos]
+ stdout.print format_frame(frame_pos)
+
+ when /^\s*down(?:\s+(\d+))?$/
+ previous_line = nil
+ if $1
+ lev = $1.to_i
+ else
+ lev = 1
+ end
+ frame_pos -= lev
+ if frame_pos < 0
+ frame_pos = 0
+ stdout.print "At stack bottom\n"
+ end
+ binding, binding_file, binding_line = @frames[frame_pos]
+ stdout.print format_frame(frame_pos)
+
+ when /^\s*fin(?:ish)?$/
+ if frame_pos == @frames.size
+ stdout.print "\"finish\" not meaningful in the outermost frame.\n"
+ else
+ @finish_pos = @frames.size - frame_pos
+ frame_pos = 0
+ prompt = false
+ end
+
+ when /^\s*cat(?:ch)?(?:\s+(.+))?$/
+ if $1
+ excn = $1
+ if excn == 'off'
+ @catch = nil
+ stdout.print "Clear catchpoint.\n"
+ else
+ @catch = excn
+ stdout.printf "Set catchpoint %s.\n", @catch
+ end
+ else
+ if @catch
+ stdout.printf "Catchpoint %s.\n", @catch
+ else
+ stdout.print "No catchpoint.\n"
+ end
+ end
+
+ when /^\s*q(?:uit)?$/
+# input = readline("Really quit? (y/n) ", false)
+# if input == "y"
+ exit! # exit -> exit!: No graceful way to stop threads...
+# end
+
+
+ when /^\s*v(?:ar)?\s+/
+ debug_variable_info($', binding)
+
+ when /^\s*m(?:ethod)?\s+/
+ debug_method_info($', binding)
+
+ when /^\s*th(?:read)?\s+/
+ if DEBUGGER__.debug_thread_info($', binding) == :cont
+ prompt = false
+ end
+
+ when /^\s*pp\s+/
+ obj_name = $'
+ obj = debug_eval($', binding)
+ customize_debug_pp
+ if obj.kind_of? Array
+ obj.each_index { |i| stdout.printf "[%d]=%s\n", i.to_s, debug_inspect(obj[i]) }
+ elsif obj.kind_of? Hash or obj_name =~ /^ENV$/
+ # Special case ENV to print like a hash
+ obj.each { |key, value| stdout.printf "[%s]=%s\n", key.inspect, debug_inspect(value) }
+ elsif obj.kind_of?(String) && obj.inspect.length > 255
+ # Assume long strings contain packed data and show them as a
+ # sequence of 12 byte slices in hex
+ i = 0
+ while i < obj.length
+ j = (i + 12 < obj.length ? i + 12 : obj.length) - 1
+ stdout.printf "[%d..%d]=0x", i, j
+ for k in i..j
+ stdout.printf "%2.2x", obj[k]
+ end
+ stdout.printf " %s\n", obj[i..j].dump
+
+ i += 12
+ end
+ else
+ PP.pp(obj, stdout)
+ end
+ restore_debug_pp
+
+ when /^\s*p\s+/
+ stdout.printf "%s\n", debug_eval($', binding).inspect
+
+ when /^\s*h(?:elp)?$/
+ debug_print_help()
+
+ else
+ v = debug_eval(input, binding)
+ stdout.printf "%s\n", v.inspect
+ end
+ end
+ end
+ MUTEX.unlock
+ resume_all
+ end
+
+ def debug_print_help
+ stdout.print <<EOHELP
+Debugger help v.-0.002b
+Commands
+ b[reak] [file|class:]<line|method>
+ b[reak] [class.]<line|method>
+ set breakpoint to some position
+ wat[ch] <expression> set watchpoint to some expression
+ cat[ch] <an Exception> set catchpoint to an exception
+ b[reak] list breakpoints
+ cat[ch] show catchpoint
+ del[ete][ nnn] delete some or all breakpoints
+ disp[lay] <expression> add expression into display expression list
+ undisp[lay][ nnn] delete one particular or all display expressions
+ c[ont] run until program ends or hit breakpoint
+ s[tep][ nnn] step (into methods) one line or till line nnn
+ n[ext][ nnn] go over one line or till line nnn
+ w[here] display frames
+ f[rame] alias for where
+ l[ist][ (-|nn-mm)] list program, - lists backwards
+ nn-mm lists given lines
+ up[ nn] move to higher frame
+ down[ nn] move to lower frame
+ fin[ish] return to outer frame
+ tr[ace] (on|off) set trace mode of current thread
+ tr[ace] (on|off) all set trace mode of all threads
+ q[uit] exit from debugger
+ v[ar] g[lobal] show global variables
+ v[ar] l[ocal] show local variables
+ v[ar] i[nstance] <object> show instance variables of object
+ v[ar] cl[ass] <object> show class variables of object
+ v[ar] c[onst] <object> show constants of object
+ m[ethod] i[nstance] <obj> show methods of object
+ m[ethod] <class|module> show instance methods of class or module
+ th[read] l[ist] list all threads
+ th[read] c[ur[rent]] show current thread
+ th[read] [sw[itch]] <nnn> switch thread context to nnn
+ th[read] stop <nnn> stop thread nnn
+ th[read] resume <nnn> resume thread nnn
+ p expression evaluate expression and print its value
+ h[elp] print this help
+ <everything else> evaluate
+EOHELP
+ end
+
+ def display_expressions(binding)
+ n = 1
+ for d in display
+ if d[0]
+ stdout.printf "%d: ", n
+ display_expression(d[1], binding)
+ end
+ n += 1
+ end
+ end
+
+ def display_expression(exp, binding)
+ stdout.printf "%s = %s\n", exp, debug_silent_eval(exp, binding).to_s
+ end
+
+ def frame_set_pos(file, line)
+ if @frames[0]
+ @frames[0][1] = file
+ @frames[0][2] = line
+ end
+ end
+
+ def display_frames(pos)
+ 0.upto(@frames.size - 1) do |n|
+ if n == pos
+ stdout.print "--> "
+ else
+ stdout.print " "
+ end
+ stdout.print format_frame(n)
+ end
+ end
+
+ def format_frame(pos)
+ bind, file, line, id = @frames[pos]
+ sprintf "#%d %s:%s%s\n", pos + 1, file, line,
+ (id ? ":in `#{id.id2name}'" : "")
+ end
+
+ def display_list(b, e, file, line)
+ stdout.printf "[%d, %d] in %s\n", b, e, file
+ if lines = SCRIPT_LINES__[file] and lines != true
+ n = 0
+ b.upto(e) do |n|
+ if n > 0 && lines[n-1]
+ if n == line
+ stdout.printf "=> %d %s\n", n, lines[n-1].chomp
+ else
+ stdout.printf " %d %s\n", n, lines[n-1].chomp
+ end
+ end
+ end
+ else
+ stdout.printf "No sourcefile available for %s\n", file
+ end
+ end
+
+ def line_at(file, line)
+ lines = SCRIPT_LINES__[file]
+ if lines
+ return "\n" if lines == true
+ line = lines[line-1]
+ return "\n" unless line
+ return line
+ end
+ return "\n"
+ end
+
+ def debug_funcname(id)
+ if id.nil?
+ "toplevel"
+ else
+ id.id2name
+ end
+ end
+
+ def check_break_points(file, klass, pos, binding, id)
+ return false if break_points.empty?
+ n = 1
+ for b in break_points
+ if b[0] # valid
+ if b[1] == 0 # breakpoint
+ if (b[2] == file and b[3] == pos) or
+ (klass and b[2] == klass and b[3] == pos)
+ stdout.printf "Breakpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
+ return true
+ end
+ elsif b[1] == 1 # watchpoint
+ if debug_silent_eval(b[2], binding)
+ stdout.printf "Watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
+ return true
+ end
+ end
+ end
+ n += 1
+ end
+ return false
+ end
+
+ def excn_handle(file, line, id, binding)
+ if $!.class <= SystemExit
+ set_trace_func nil
+ exit
+ end
+
+ if @catch and ($!.class.ancestors.find { |e| e.to_s == @catch })
+ stdout.printf "%s:%d: `%s' (%s)\n", file, line, $!, $!.class
+ fs = @frames.size
+ tb = caller(0)[-fs..-1]
+ if tb
+ for i in tb
+ stdout.printf "\tfrom %s\n", i
+ end
+ end
+ suspend_all
+ debug_command(file, line, id, binding)
+ end
+ end
+
+ def trace_func(event, file, line, id, binding, klass)
+ Tracer.trace_func(event, file, line, id, binding, klass) if trace?
+ context(Thread.current).check_suspend
+
+ if not trace_ruby? and
+ ( file =~ /#{Config::CONFIG['sitelibdir']}/ or
+ file =~ /#{Config::CONFIG['rubylibdir']}/ or
+ file =~ %r{/debuggee.rb} )
+ case event
+ when 'line'
+ frame_set_pos(file, line)
+
+ when 'call'
+ @frames.unshift [binding, file, line, id]
+
+ when 'c-call'
+ frame_set_pos(file, line)
+
+ when 'class'
+ @frames.unshift [binding, file, line, id]
+
+ when 'return', 'end'
+ @frames.shift
+
+ when 'end'
+ @frames.shift
+
+ when 'raise'
+ excn_handle(file, line, id, binding)
+
+ end
+ return
+ end
+
+ @file = file
+ @line = line
+ case event
+ when 'line'
+ frame_set_pos(file, line)
+ if !@no_step or @frames.size == @no_step
+ @stop_next -= 1
+ @stop_next = -1 if @stop_next < 0
+ elsif @frames.size < @no_step
+ @stop_next = 0 # break here before leaving...
+ else
+ # nothing to do. skipped.
+ end
+ #LJ reverse the test here because we always want the breakpoint reached
+ # message to be display. if stop_next is null *AND* there is also a break point
+ # the message will never display.
+ if check_break_points(file, nil, line, binding, id) or @stop_next == 0
+ # LJ this test doesn't make sense and cause troubles when
+ # on a line with a recursive call and a breakpoint on it (e.g factorial)
+ # or when in a while loop with one line only inside the loop
+ #
+ # RJD: reinstated the test with a check on whether '@frames.size'
+ # has changed to catch the recursive factorial case LJ describes
+ # above. The while loop problem still exists though
+ if [file, line, @frames.size] == @last
+ @stop_next = 1
+ else
+ @no_step = nil
+ suspend_all
+ debug_command(file, line, id, binding)
+ @last = [file, line, @frames.size]
+ end
+ end
+
+ when 'call'
+ @frames.unshift [binding, file, line, id]
+ if check_break_points(file, klass, id.id2name, binding, id)
+ suspend_all
+ debug_command(file, line, id, binding)
+ end
+
+ when 'c-call'
+ frame_set_pos(file, line)
+
+ when 'class'
+ @frames.unshift [binding, file, line, id]
+
+ when 'return', 'end'
+ if @frames.size == @finish_pos
+ @stop_next = 1
+ @finish_pos = 0
+ end
+ @frames.shift
+
+ when 'end'
+ @frames.shift
+
+ when 'raise'
+ excn_handle(file, line, id, binding)
+
+ end
+ @last_file = file
+ end
+end
+
+trap("INT") { DEBUGGER__.interrupt }
+@last_thread = Thread::main
+@max_thread = 1
+@thread_list = {Thread::main => 1}
+@break_points = []
+@display = []
+@waiting = []
+@stdout = STDOUT
+
+ class SilentObject
+ def method_missing( msg_id, *a, &b ); end
+ end
+ SilentClient = SilentObject.new()
+ @client = SilentClient
+ @attached = false
+
+class << DEBUGGER__
+ def stdout
+ @stdout
+ end
+
+ def stdout=(s)
+ @stdout = s
+ end
+
+ def display
+ @display
+ end
+
+ def break_points
+ @break_points
+ end
+
+ def client
+ @client
+ end
+
+ def set_client( client )
+ @client = client
+ DEBUGGER__.stdout = Tracer.stdout = @client
+ end
+
+ def quit
+ #LJ flush STDOUT and ERR
+# @stdout.print "Quitting debugger"
+ STDERR.flush; STDOUT.flush
+ $stderr.flush; $stdout.flush
+# STDERR.close; STDOUT.close
+ detach
+ #DebugSvr.stop_service
+ end
+
+ def detach
+ @attached = false
+ @client.detach
+ set_client( SilentClient )
+ end
+
+ def waiting
+ @waiting
+ end
+
+ def set_trace( arg )
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ context(th).set_trace arg
+ end
+ Thread.critical = saved_crit
+ arg
+ end
+
+ def set_last_thread(th)
+ @last_thread = th
+ end
+
+ def suspend
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ next if th == Thread.current
+ context(th).set_suspend
+ end
+ Thread.critical = saved_crit
+ # Schedule other threads to suspend as soon as possible.
+ Thread.pass unless Thread.critical
+ end
+
+ def resume
+ saved_crit = Thread.critical
+ Thread.critical = true
+ make_thread_list
+ for th, in @thread_list
+ next if th == Thread.current
+ context(th).clear_suspend
+ end
+ waiting.each do |th|
+ th.run
+ end
+ waiting.clear
+ Thread.critical = saved_crit
+ # Schedule other threads to restart as soon as possible.
+ Thread.pass
+ end
+
+ def context(thread=Thread.current)
+ c = thread[:__debugger_data__]
+ unless c
+ thread[:__debugger_data__] = c = Context.new
+ end
+ c
+ end
+
+ def interrupt
+ context(@last_thread).stop_next
+ end
+
+ def get_thread(num)
+ th = @thread_list.index(num)
+ unless th
+ @stdout.print "No thread ##{num}\n"
+ throw :debug_error
+ end
+ th
+ end
+
+ def thread_list(num)
+ th = get_thread(num)
+ if th == Thread.current
+ @stdout.print "+"
+ else
+ @stdout.print " "
+ end
+ @stdout.printf "%d ", num
+ @stdout.print th.inspect, "\t"
+ file = context(th).instance_eval{@file}
+ if file
+ @stdout.print file,":",context(th).instance_eval{@line}
+ end
+ @stdout.print "\n"
+ end
+
+ def thread_list_all
+ for th in @thread_list.values.sort
+ thread_list(th)
+ end
+ end
+
+ def make_thread_list
+ hash = {}
+ for th in Thread::list
+ if @thread_list.key? th
+ hash[th] = @thread_list[th]
+ else
+ @max_thread += 1
+ hash[th] = @max_thread
+ end
+ end
+ @thread_list = hash
+ end
+
+ def debug_thread_info(input, binding)
+ case input
+ when /^l(?:ist)?/
+ make_thread_list
+ thread_list_all
+
+ when /^c(?:ur(?:rent)?)?$/
+ make_thread_list
+ thread_list(@thread_list[Thread.current])
+
+ when /^(?:sw(?:itch)?\s+)?(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ else
+ thread_list(@thread_list[th])
+ context(th).stop_next
+ th.run
+ return :cont
+ end
+
+ when /^stop\s+(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ elsif th.stop?
+ @stdout.print "Already stopped.\n"
+ else
+ thread_list(@thread_list[th])
+ context(th).suspend
+ end
+
+ when /^resume\s+(\d+)/
+ make_thread_list
+ th = get_thread($1.to_i)
+ if th == Thread.current
+ @stdout.print "It's the current thread.\n"
+ elsif !th.stop?
+ @stdout.print "Already running."
+ else
+ thread_list(@thread_list[th])
+ th.run
+ end
+ end
+ end
+end
+
+require 'socket'
+
+ ##
+ # DEBUGGEE -> socket -> KDevelop
+ # The Client class holds all the methods invoked from the debuggee that send and
+ # receive data from KDevelop via the Unix domain socket.
+ #
+ class Client
+ def initialize(path)
+ @debugger = UNIXSocket.open(path)
+ @debugger.sync=true
+ end
+
+ def detach
+# @debugger.close
+ end
+
+ def printf( *args )
+ str = sprintf(*args)
+ @debugger.send(str, 0)
+ end
+
+ def print( *args )
+ str = args.to_s
+ @debugger.send(str, 0)
+ end
+
+ def <<( arg )
+ @debugger.send(arg, 0)
+ end
+
+ # Return next command
+ def readline(prompt_cmd)
+ @debugger.send(prompt_cmd, 0)
+ msg = @debugger.recvfrom(2048)
+ return msg[0]
+ end
+ end
+
+#stdout.printf "Debug.rb\n"
+#stdout.printf "Emacs support available.\n\n"
+
+STDERR.sync=true
+STDOUT.sync=true
+
+path = $stdin.gets.chomp
+
+DEBUGGER__.set_client( Client.new(path) )
+
+set_trace_func proc { |event, file, line, id, binding, klass, *rest|
+
+ # LJ make sure the file path is always absolute. It is needed by
+ # the Debugger plugin in KDevelop and can only be determined here
+ # in the context of the debugged process
+ file = File.expand_path(file)
+
+ DEBUGGER__.context.trace_func event, file, line, id, binding, klass
+}
+
+end
diff --git a/languages/ruby/debugger/debuggerpart.cpp b/languages/ruby/debugger/debuggerpart.cpp
new file mode 100644
index 00000000..95b4dd09
--- /dev/null
+++ b/languages/ruby/debugger/debuggerpart.cpp
@@ -0,0 +1,785 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * Adapted for ruby debugging *
+ * -------------------------- *
+ * begin : Mon Nov 1 2004 *
+ * copyright : (C) 2004 by Richard Dale *
+ * email : Richard_Dale@tipitina.demon.co.uk *
+ * *
+ * 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 "debuggerpart.h"
+
+#include <qdir.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <qpopupmenu.h>
+
+#include <kaction.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kstatusbar.h>
+#include <kparts/part.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <qtimer.h>
+#include <kstringhandler.h>
+#include <kstandarddirs.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevappfrontend.h"
+#include "kdevpartcontroller.h"
+#include "kdevdebugger.h"
+#include "domutil.h"
+#include "variablewidget.h"
+#include "rdbbreakpointwidget.h"
+#include "framestackwidget.h"
+#include "processwidget.h"
+#include "rdbcontroller.h"
+#include "breakpoint.h"
+#include "dbgpsdlg.h"
+#include "dbgtoolbar.h"
+#include "rdbparser.h"
+#include "rdboutputwidget.h"
+#include "processlinemaker.h"
+
+#include <iostream>
+
+#include <kdevplugininfo.h>
+#include <debugger.h>
+
+
+namespace RDBDebugger
+{
+static const KDevPluginInfo data("kdevrbdebugger");
+
+typedef KDevGenericFactory<RubyDebuggerPart> RubyDebuggerFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevrbdebugger, RubyDebuggerFactory( data ) )
+
+RubyDebuggerPart::RubyDebuggerPart( QObject *parent, const char *name, const QStringList & ) :
+ KDevPlugin( &data, parent, name ? name : "RubyDebuggerPart" ),
+ controller(0)
+{
+// setObjId("RubyDebuggerInterface");
+ setInstance(RubyDebuggerFactory::instance());
+
+ setXMLFile("kdevrbdebugger.rc");
+
+ m_debugger = new Debugger( partController() );
+
+ statusBarIndicator = new QLabel(" ", mainWindow()->statusBar());
+ statusBarIndicator->setFixedWidth(15);
+ mainWindow()->statusBar()->addWidget(statusBarIndicator, 0, true);
+ statusBarIndicator->show();
+
+ // Setup widgets and dbgcontroller
+ variableWidget = new VariableWidget( 0, "rdbVariablewidget");
+// /*variableWidget*/->setEnabled(false);
+ variableWidget->setIcon(SmallIcon("math_brace"));
+ variableWidget->setCaption(i18n("Variable Tree"));
+ QWhatsThis::add
+ (variableWidget, i18n("<b>Variable tree</b><p>"
+ "The variable tree allows you to see "
+ "the variable values as you step "
+ "through your program using the internal "
+ "debugger. Click the right mouse button on items in "
+ "this view to get a popup menu.\n"
+ "To speed up stepping through your code "
+ "leave the tree items closed.\n"));
+ mainWindow()->embedSelectView(variableWidget, i18n("Variables"), i18n("Debugger variable-view"));
+
+// mainWindow()->setViewAvailable(variableWidget, false);
+
+ rdbBreakpointWidget = new RDBBreakpointWidget( 0, "rdbBreakpointWidget" );
+ rdbBreakpointWidget->setCaption(i18n("Breakpoint List"));
+ QWhatsThis::add
+ (rdbBreakpointWidget, i18n("<b>Breakpoint list</b><p>"
+ "Displays a list of breakpoints with "
+ "their current status. Clicking on a "
+ "breakpoint item allows you to change "
+ "the breakpoint and will take you "
+ "to the source in the editor window."));
+ rdbBreakpointWidget->setIcon( SmallIcon("stop") );
+ mainWindow()->embedOutputView(rdbBreakpointWidget, i18n("Breakpoints"), i18n("Debugger breakpoints"));
+
+ framestackWidget = new FramestackWidget( 0, "rdbFramestackWidget" );
+ framestackWidget->setEnabled(false);
+ framestackWidget->setCaption(i18n("Frame Stack"));
+ QWhatsThis::add
+ (framestackWidget, i18n("<b>Frame stack</b><p>"
+ "Often referred to as the \"call stack\", "
+ "this is a list showing what method is "
+ "currently active and who called each "
+ "method to get to this point in your "
+ "program. By clicking on an item you "
+ "can see the values in any of the "
+ "previous calling methods."));
+ framestackWidget->setIcon( SmallIcon("table") );
+ mainWindow()->embedOutputView(framestackWidget, i18n("Frame Stack"), i18n("Debugger method call stack"));
+ mainWindow()->setViewAvailable(framestackWidget, false);
+
+
+ rdbOutputWidget = new RDBOutputWidget( 0, "rdbOutputWidget" );
+ rdbOutputWidget->setEnabled(false);
+ rdbOutputWidget->setIcon( SmallIcon("inline_image") );
+ rdbOutputWidget->setCaption(i18n("RDB Output"));
+ QWhatsThis::add
+ (rdbOutputWidget, i18n("<b>RDB output</b><p>"
+ "Shows all rdb commands being executed. "
+ "You can also issue any other rdb command while debugging."));
+ mainWindow()->embedOutputView(rdbOutputWidget, i18n("RDB"),
+ i18n("RDB output"));
+ mainWindow()->setViewAvailable(rdbOutputWidget, false);
+
+ // rdbBreakpointWidget -> this
+ connect( rdbBreakpointWidget, SIGNAL(refreshBPState(const Breakpoint&)),
+ this, SLOT(slotRefreshBPState(const Breakpoint&)));
+ connect( rdbBreakpointWidget, SIGNAL(publishBPState(const Breakpoint&)),
+ this, SLOT(slotRefreshBPState(const Breakpoint&)));
+ connect( rdbBreakpointWidget, SIGNAL(gotoSourcePosition(const QString&, int)),
+ this, SLOT(slotGotoSource(const QString&, int)) );
+
+ // Now setup the actions
+ KAction *action;
+
+// action = new KAction(i18n("&Start"), "1rightarrow", CTRL+SHIFT+Key_F9,
+ action = new KAction(i18n("&Start"), "dbgrun", CTRL+SHIFT+Key_F9,
+ this, SLOT(slotRun()),
+ actionCollection(), "debug_run");
+ action->setToolTip( i18n("Start in debugger") );
+ action->setWhatsThis( i18n("<b>Start in debugger</b><p>"
+ "Starts the debugger with the project's main "
+ "executable. You may set some breakpoints "
+ "before this, or you can interrupt the program "
+ "while it is running, in order to get information "
+ "about variables, frame stack, and so on.") );
+
+ action = new KAction(i18n("Sto&p"), "stop", 0,
+ this, SLOT(slotStop()),
+ actionCollection(), "debug_stop");
+ action->setToolTip( i18n("Stop debugger") );
+ action->setWhatsThis(i18n("<b>Stop debugger</b><p>Kills the executable and exits the debugger."));
+
+ action = new KAction(i18n("Interrupt"), "player_pause", 0,
+ this, SLOT(slotPause()),
+ actionCollection(), "debug_pause");
+ action->setToolTip( i18n("Interrupt application") );
+ action->setWhatsThis(i18n("<b>Interrupt application</b><p>Interrupts the debugged process or current RDB command."));
+
+ action = new KAction(i18n("Run to &Cursor"), "dbgrunto", 0,
+ this, SLOT(slotRunToCursor()),
+ actionCollection(), "debug_runtocursor");
+ action->setToolTip( i18n("Run to cursor") );
+ action->setWhatsThis(i18n("<b>Run to cursor</b><p>Continues execution until the cursor position is reached."));
+
+
+ action = new KAction(i18n("Step &Over"), "dbgnext", 0,
+ this, SLOT(slotStepOver()),
+ actionCollection(), "debug_stepover");
+ action->setToolTip( i18n("Step over the next line") );
+ action->setWhatsThis( i18n("<b>Step over</b><p>"
+ "Executes one line of source in the current source file. "
+ "If the source line is a call to a method the whole "
+ "method is executed and the app will stop at the line "
+ "following the method call.") );
+
+
+ action = new KAction(i18n("Step &Into"), "dbgstep", 0,
+ this, SLOT(slotStepInto()),
+ actionCollection(), "debug_stepinto");
+ action->setToolTip( i18n("Step into the next statement") );
+ action->setWhatsThis( i18n("<b>Step into</b><p>"
+ "Executes exactly one line of source. If the source line "
+ "is a call to a method then execution will stop after "
+ "the method has been entered.") );
+
+
+
+ action = new KAction(i18n("Step O&ut"), "dbgstepout", 0,
+ this, SLOT(slotStepOut()),
+ actionCollection(), "debug_stepout");
+ action->setToolTip( i18n("Steps out of the current method") );
+ action->setWhatsThis( i18n("<b>Step out</b><p>"
+ "Executes the application until the currently executing "
+ "method is completed. The debugger will then display "
+ "the line after the original call to that method. If "
+ "program execution is in the outermost frame (i.e. in "
+ "the topleveltoggleWatchpoint) then this operation has no effect.") );
+
+
+ action = new KAction(i18n("Toggle Breakpoint"), 0, 0,
+ this, SLOT(toggleBreakpoint()),
+ actionCollection(), "debug_toggle_breakpoint");
+ action->setToolTip(i18n("Toggle breakpoint"));
+ action->setWhatsThis(i18n("<b>Toggle breakpoint</b><p>Toggles the breakpoint at the current line in editor."));
+
+ connect( mainWindow()->main()->guiFactory(), SIGNAL(clientAdded(KXMLGUIClient*)),
+ this, SLOT(guiClientAdded(KXMLGUIClient*)) );
+
+
+ connect( partController(), SIGNAL(loadedFile(const KURL &)),
+ rdbBreakpointWidget, SLOT(slotRefreshBP(const KURL &)) );
+ connect( debugger(), SIGNAL(toggledBreakpoint(const QString &, int)),
+ rdbBreakpointWidget, SLOT(slotToggleBreakpoint(const QString &, int)) );
+ connect( debugger(), SIGNAL(editedBreakpoint(const QString &, int)),
+ rdbBreakpointWidget, SLOT(slotEditBreakpoint(const QString &, int)) );
+ connect( debugger(), SIGNAL(toggledBreakpointEnabled(const QString &, int)),
+ rdbBreakpointWidget, SLOT(slotToggleBreakpointEnabled(const QString &, int)) );
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStop(KDevPlugin*)) );
+ connect( core(), SIGNAL(projectClosed()),
+ this, SLOT(projectClosed()) );
+
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+
+ procLineMaker = new ProcessLineMaker();
+
+ connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)),
+ appFrontend(), SLOT(insertStdoutLine(const QCString&)) );
+ connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)),
+ appFrontend(), SLOT(insertStderrLine(const QCString&)) );
+ connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)),
+ appFrontend(), SLOT(addPartialStdoutLine(const QCString&)) );
+ connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)),
+ appFrontend(), SLOT(addPartialStderrLine(const QCString&)) );
+
+ setupController();
+ QTimer::singleShot(0, this, SLOT(setupDcop()));
+}
+
+RubyDebuggerPart::~RubyDebuggerPart()
+{
+ kapp->dcopClient()->setNotifications(false);
+
+ if (variableWidget)
+ mainWindow()->removeView(variableWidget);
+ if (rdbBreakpointWidget)
+ mainWindow()->removeView(rdbBreakpointWidget);
+ if (framestackWidget)
+ mainWindow()->removeView(framestackWidget);
+ if(rdbOutputWidget)
+ mainWindow()->removeView(rdbOutputWidget);
+
+ delete variableWidget;
+ delete rdbBreakpointWidget;
+ delete framestackWidget;
+ delete rdbOutputWidget;
+ delete controller;
+ delete floatingToolBar;
+ delete statusBarIndicator;
+ delete procLineMaker;
+}
+
+
+void RubyDebuggerPart::guiClientAdded( KXMLGUIClient* client )
+{
+ // Can't change state until after XMLGUI has been loaded...
+ // Anyone know of a better way of doing this?
+ if( client == this )
+ stateChanged( QString("stopped") );
+}
+
+void RubyDebuggerPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::EditorContext ))
+ return;
+
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ m_contextIdent = econtext->currentWord();
+
+ popup->insertSeparator();
+ if (econtext->url().isLocalFile())
+ {
+ int id = popup->insertItem( i18n("Toggle Breakpoint"), this, SLOT(toggleBreakpoint()) );
+ popup->setWhatsThis(id, i18n("<b>Toggle breakpoint</b><p>Toggles breakpoint at the current line."));
+ }
+ if (!m_contextIdent.isEmpty())
+ {
+ QString squeezed = KStringHandler::csqueeze(m_contextIdent, 30);
+ int id = popup->insertItem( i18n("Watch: %1").arg(squeezed), this, SLOT(contextWatch()) );
+ popup->setWhatsThis(id, i18n("<b>Watch</b><p>Adds an expression under the cursor to the Variables/Watch list."));
+
+ id = popup->insertItem( i18n("Inspect: %1").arg(squeezed), this, SLOT(contextRubyInspect()) );
+ popup->setWhatsThis(id, i18n("<b>Inspect</b><p>Evaluates an expression under the cursor."));
+ }
+}
+
+
+void RubyDebuggerPart::toggleBreakpoint()
+{
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
+
+ if (!rwpart || !cursorIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ rdbBreakpointWidget->slotToggleBreakpoint(rwpart->url().path(), line);
+}
+
+
+void RubyDebuggerPart::contextWatch()
+{
+ variableWidget->slotAddWatchExpression(m_contextIdent);
+}
+
+// Evaluates the selected text
+void RubyDebuggerPart::contextRubyInspect()
+{
+ emit rubyInspect(m_contextIdent);
+}
+
+
+void RubyDebuggerPart::setupController()
+{
+ VariableTree *variableTree = variableWidget->varTree();
+
+ controller = new RDBController(variableTree, framestackWidget, *projectDom());
+
+ // this -> controller
+ connect( this, SIGNAL(rubyInspect(const QString&)),
+ controller, SLOT(slotRubyInspect(const QString&)));
+
+ // variableTree -> framestackWidget
+ connect( variableTree, SIGNAL(selectFrame(int, int)),
+ framestackWidget, SLOT(slotSelectFrame(int, int)));
+
+ // framestackWidget -> variableTree
+ connect( framestackWidget, SIGNAL(frameActive(int, int, const QString&)),
+ variableTree, SLOT(slotFrameActive(int, int, const QString&)));
+
+ // variableTree -> controller
+ connect( variableTree, SIGNAL(expandItem(VarItem*, const QCString&)),
+ controller, SLOT(slotExpandItem(VarItem*, const QCString&)));
+ connect( variableTree, SIGNAL(fetchGlobals(bool)),
+ controller, SLOT(slotFetchGlobals(bool)));
+ connect( variableTree, SIGNAL(addWatchExpression(const QString&, bool)),
+ controller, SLOT(slotAddWatchExpression(const QString&, bool)));
+ connect( variableTree, SIGNAL(removeWatchExpression(int)),
+ controller, SLOT(slotRemoveWatchExpression(int)));
+
+ // framestackWidget -> controller
+ connect( framestackWidget, SIGNAL(selectFrame(int,int,const QString&)),
+ controller, SLOT(slotSelectFrame(int,int,const QString&)));
+
+ // rdbBreakpointWidget -> controller
+ connect( rdbBreakpointWidget, SIGNAL(clearAllBreakpoints()),
+ controller, SLOT(slotClearAllBreakpoints()));
+ connect( rdbBreakpointWidget, SIGNAL(publishBPState(const Breakpoint&)),
+ controller, SLOT(slotBPState(const Breakpoint &)));
+
+
+ // rdbOutputWidget -> controller
+ connect( rdbOutputWidget, SIGNAL(userRDBCmd(const QString &)),
+ controller, SLOT(slotUserRDBCmd(const QString&)));
+ connect( rdbOutputWidget, SIGNAL(breakInto()),
+ controller, SLOT(slotBreakInto()));
+
+ // controller -> rdbBreakpointWidget
+ connect( controller, SIGNAL(acceptPendingBPs()),
+ rdbBreakpointWidget, SLOT(slotSetPendingBPs()));
+ connect( controller, SIGNAL(unableToSetBPNow(int)),
+ rdbBreakpointWidget, SLOT(slotUnableToSetBPNow(int)));
+ connect( controller, SIGNAL(rawRDBBreakpointList (char*)),
+ rdbBreakpointWidget, SLOT(slotParseRDBBrkptList(char*)));
+ connect( controller, SIGNAL(rawRDBBreakpointSet(char*, int)),
+ rdbBreakpointWidget, SLOT(slotParseRDBBreakpointSet(char*, int)));
+
+
+ // controller -> this
+ connect( controller, SIGNAL(dbgStatus(const QString&, int)),
+ this, SLOT(slotStatus(const QString&, int)));
+ connect( controller, SIGNAL(showStepInSource(const QString&, int, const QString&)),
+ this, SLOT(slotShowStep(const QString&, int)));
+
+ // controller -> procLineMaker
+ connect( controller, SIGNAL(ttyStdout(const char*)),
+ procLineMaker, SLOT(slotReceivedStdout(const char*)));
+ connect( controller, SIGNAL(ttyStderr(const char*)),
+ procLineMaker, SLOT(slotReceivedStderr(const char*)));
+
+ // controller -> rdbOutputWidget
+ connect( controller, SIGNAL(rdbStdout(const char*)),
+ rdbOutputWidget, SLOT(slotReceivedStdout(const char*)) );
+ connect( controller, SIGNAL(rdbStderr(const char*)),
+ rdbOutputWidget, SLOT(slotReceivedStderr(const char*)) );
+ connect( controller, SIGNAL(dbgStatus(const QString&, int)),
+ rdbOutputWidget, SLOT(slotDbgStatus(const QString&, int)));
+
+}
+
+
+bool RubyDebuggerPart::startDebugger()
+{
+ QString build_dir; // Currently selected build directory
+ QString run_directory; // Directory from where the program should be run
+ QString program; // Absolute path to application
+ QString run_arguments; // Command line arguments to be passed to the application
+ QString ruby_interpreter; // Absolute path to the ruby interpreter
+ QString debuggee_path; // Absolute path to debuggee.rb debugger script
+ bool show_constants; // Show constants in the debugger
+ bool trace_into_ruby; // Trace into the ruby code installed under sitedir
+
+ if (project()) {
+ build_dir = project()->buildDirectory();
+ run_directory = DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globalcwd");
+ if (run_directory.isEmpty())
+ run_directory = project()->buildDirectory();
+ }
+
+ int runMainProgram = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/runmainprogram");
+
+ if (runMainProgram == 0) {
+ program = project()->projectDirectory() + "/" + DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/mainprogram");
+ } else {
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if (ro_part != 0) {
+ program = ro_part->url().path();
+ }
+ }
+
+ run_arguments = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/programargs");
+
+ QString shell = DomUtil::readEntry(*projectDom(), "/kdevrbdebugger/general/dbgshell");
+ if( !shell.isEmpty() )
+ {
+ QFileInfo info( shell );
+ if( info.isRelative() )
+ {
+ shell = build_dir + "/" + shell;
+ info.setFile( shell );
+ }
+ if( !info.exists() )
+ {
+ KMessageBox::error(
+ mainWindow()->main(),
+ i18n("Could not locate the debugging shell '%1'.").arg( shell ),
+ i18n("Debugging Shell Not Found") );
+ return false;
+ }
+ }
+
+ core()->running(this, true);
+
+ stateChanged( QString("active") );
+
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Continue") );
+// ac->action("debug_run")->setIcon( "dbgrun" );
+ ac->action("debug_run")->setToolTip( i18n("Continues the application execution") );
+ ac->action("debug_run")->setWhatsThis( i18n("Continue application execution\n\n"
+ "Continues the execution of your application in the "
+ "debugger. This only takes effect when the application "
+ "has been halted by the debugger (i.e. a breakpoint has "
+ "been activated or the interrupt was pressed).") );
+
+
+// mainWindow()->setViewAvailable(variableWidget, true);
+ mainWindow()->setViewAvailable(framestackWidget, true);
+ mainWindow()->setViewAvailable(rdbOutputWidget, true);
+
+// variableWidget->setEnabled(true);
+ framestackWidget->setEnabled(true);
+
+ rdbOutputWidget->clear();
+ rdbOutputWidget->setEnabled(true);
+
+ if (DomUtil::readBoolEntry(*projectDom(), "/kdevrbdebugger/general/floatingtoolbar", false))
+ {
+ floatingToolBar = new DbgToolBar(this, mainWindow()->main());
+ floatingToolBar->show();
+ }
+
+ ruby_interpreter = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/interpreter");
+
+ int coding = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/charactercoding");
+ QString character_coding("-K");
+
+ switch (coding) {
+ case 0:
+ character_coding.append("A");
+ break;
+ case 1:
+ character_coding.append("E");
+ break;
+ case 2:
+ character_coding.append("S");
+ break;
+ case 3:
+ character_coding.append("U");
+ break;
+ }
+
+// ruby_interpreter.append(QString(" -K") + code);
+
+ debuggee_path = ::locate("data", "kdevrbdebugger/debuggee.rb", instance());
+
+ show_constants = DomUtil::readBoolEntry(*projectDom(), "/kdevrbdebugger/general/showconstants");
+ trace_into_ruby = DomUtil::readBoolEntry(*projectDom(), "/kdevrbdebugger/general/traceintoruby");
+
+ controller->slotStart(ruby_interpreter, character_coding, run_directory, debuggee_path, program, run_arguments, show_constants, trace_into_ruby);
+ return true;
+}
+
+void RubyDebuggerPart::slotStopDebugger()
+{
+ controller->slotStopDebugger();
+ debugger()->clearExecutionPoint();
+
+ delete floatingToolBar;
+ floatingToolBar = 0;
+
+ rdbBreakpointWidget->reset();
+ framestackWidget->clear();
+ variableWidget->varTree()->clear();
+
+// variableWidget->setEnabled(false);
+ framestackWidget->setEnabled(false);
+ rdbOutputWidget->setEnabled(false);
+
+// mainWindow()->setViewAvailable(variableWidget, false);
+ mainWindow()->setViewAvailable(framestackWidget, false);
+ mainWindow()->setViewAvailable(rdbOutputWidget, false);
+
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Start") );
+// ac->action("debug_run")->setIcon( "1rightarrow" );
+ ac->action("debug_run")->setToolTip( i18n("Runs the program in the debugger") );
+ ac->action("debug_run")->setWhatsThis( i18n("Start in debugger\n\n"
+ "Starts the debugger with the project's main "
+ "executable. You may set some breakpoints "
+ "before this, or you can interrupt the program "
+ "while it is running, in order to get information "
+ "about variables, frame stack, and so on.") );
+
+ stateChanged( QString("stopped") );
+
+ core()->running(this, false);
+}
+
+void RubyDebuggerPart::projectClosed()
+{
+ slotStopDebugger();
+}
+
+void RubyDebuggerPart::slotRun()
+{
+ if (controller->stateIsOn(s_programExited)) {
+ rdbBreakpointWidget->reset();
+ }
+
+ if ( controller->stateIsOn( s_dbgNotStarted ) ) {
+ mainWindow()->statusBar()->message(i18n("Debugging program"), 1000);
+ mainWindow()->raiseView(rdbOutputWidget);
+ appFrontend()->clearView();
+ startDebugger();
+ } else {
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("&Continue") );
+ ac->action("debug_run")->setToolTip( i18n("Continues the application execution") );
+ ac->action("debug_run")->setWhatsThis( i18n("Continue application execution\n\n"
+ "Continues the execution of your application in the "
+ "debugger. This only takes effect when the application "
+ "has been halted by the debugger (i.e. a breakpoint has "
+ "been activated or the interrupt was pressed).") );
+
+ mainWindow()->statusBar()->message(i18n("Continuing program"), 1000);
+ }
+
+ controller->slotRun();
+}
+
+
+
+void RubyDebuggerPart::slotStop(KDevPlugin* which)
+{
+ if( which != 0 && which != this )
+ return;
+
+// if( !controller->stateIsOn( s_dbgNotStarted ) && !controller->stateIsOn( s_shuttingDown ) )
+ slotStopDebugger();
+}
+
+
+void RubyDebuggerPart::slotPause()
+{
+ controller->slotBreakInto();
+}
+
+
+void RubyDebuggerPart::slotRunToCursor()
+{
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(partController()->activeWidget());
+
+ if (!rwpart || !rwpart->url().isLocalFile() || !cursorIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPosition(&line, &col);
+
+ controller->slotRunUntil(rwpart->url().path(), line);
+}
+
+void RubyDebuggerPart::slotStepOver()
+{
+ controller->slotStepOver();
+}
+
+
+
+void RubyDebuggerPart::slotStepInto()
+{
+ controller->slotStepInto();
+}
+
+
+void RubyDebuggerPart::slotStepOut()
+{
+ controller->slotStepOutOff();
+}
+
+
+
+
+void RubyDebuggerPart::slotRefreshBPState( const Breakpoint& BP)
+{
+ if (BP.type() == BP_TYPE_FilePos)
+ {
+ const FilePosBreakpoint& bp = dynamic_cast<const FilePosBreakpoint&>(BP);
+ if (bp.isActionDie())
+ debugger()->setBreakpoint(bp.fileName(), bp.lineNum()-1, -1, true, false);
+ else
+ debugger()->setBreakpoint(bp.fileName(), bp.lineNum()-1,
+ 1/*bp->id()*/, bp.isEnabled(), bp.isPending() );
+ }
+}
+
+
+void RubyDebuggerPart::slotStatus(const QString &msg, int state)
+{
+ QString stateIndicator;
+
+ if (state & s_dbgNotStarted)
+ {
+ stateIndicator = " ";
+ }
+ else if (state & s_appBusy)
+ {
+ stateIndicator = "A";
+ debugger()->clearExecutionPoint();
+ stateChanged( QString("active") );
+ }
+ else if (state & s_programExited)
+ {
+ stateIndicator = "E";
+ stateChanged( QString("stopped") );
+ KActionCollection *ac = actionCollection();
+ ac->action("debug_run")->setText( i18n("Restart") );
+// ac->action("debug_run")->setIcon( "1rightarrow" );
+ ac->action("debug_run")->setToolTip( i18n("Restart the program in the debugger") );
+ ac->action("debug_run")->setWhatsThis( i18n("Restart in debugger\n\n"
+ "Restarts the program in the debugger") );
+// slotStop();
+ }
+ else
+ {
+ stateIndicator = "P";
+ stateChanged( QString("paused") );
+ }
+
+ // And now? :-)
+ kdDebug(9012) << "Debugger state: " << stateIndicator << ": " << endl;
+ kdDebug(9012) << " " << msg << endl;
+
+ statusBarIndicator->setText(stateIndicator);
+ if (!msg.isEmpty())
+ mainWindow()->statusBar()->message(msg, 3000);
+}
+
+
+void RubyDebuggerPart::slotShowStep(const QString &fileName, int lineNum)
+{
+ if ( ! fileName.isEmpty() )
+ {
+ // Debugger counts lines from 1
+ debugger()->gotoExecutionPoint(KURL( fileName ), lineNum-1);
+ }
+}
+
+
+void RubyDebuggerPart::slotGotoSource(const QString &fileName, int lineNum)
+{
+ if ( ! fileName.isEmpty() )
+ partController()->editDocument(KURL( fileName ), lineNum);
+}
+
+
+void RubyDebuggerPart::slotActivePartChanged( KParts::Part* part )
+{
+ KAction* action = actionCollection()->action("debug_toggle_breakpoint");
+ if(!action)
+ return;
+
+ if(!part)
+ {
+ action->setEnabled(false);
+ return;
+ }
+ KTextEditor::ViewCursorInterface *iface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ action->setEnabled( iface != 0 );
+}
+
+void RubyDebuggerPart::restorePartialProjectSession(const QDomElement* el)
+{
+ rdbBreakpointWidget->restorePartialProjectSession(el);
+ variableWidget->restorePartialProjectSession(el);
+}
+
+void RubyDebuggerPart::savePartialProjectSession(QDomElement* el)
+{
+ rdbBreakpointWidget->savePartialProjectSession(el);
+ variableWidget->savePartialProjectSession(el);
+}
+
+}
+
+KDevAppFrontend * RDBDebugger::RubyDebuggerPart::appFrontend( )
+{
+ return extension<KDevAppFrontend>("KDevelop/AppFrontend");
+}
+
+KDevDebugger * RDBDebugger::RubyDebuggerPart::debugger()
+{
+ return m_debugger;
+}
+
+#include "debuggerpart.moc"
diff --git a/languages/ruby/debugger/debuggerpart.h b/languages/ruby/debugger/debuggerpart.h
new file mode 100644
index 00000000..2f35df9a
--- /dev/null
+++ b/languages/ruby/debugger/debuggerpart.h
@@ -0,0 +1,110 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by John Birch *
+ * jbb@kdevelop.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * Adapted for ruby debugging *
+ * -------------------------- *
+ * begin : Mon Nov 1 2004 *
+ * copyright : (C) 2004 by Richard Dale *
+ * email : Richard_Dale@tipitina.demon.co.uk *
+ * *
+ * 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 _DEBUGGERPART_H_
+#define _DEBUGGERPART_H_
+
+#include <qguardedptr.h>
+#include "kdevplugin.h"
+#include "kdevcore.h"
+
+namespace KParts { class Part; }
+
+class QLabel;
+class QPopupMenu;
+class KDialogBase;
+class ProcessWidget;
+class ProcessLineMaker;
+class KDevAppFrontend;
+class KDevDebugger;
+
+namespace RDBDebugger
+{
+
+class RDBBreakpointWidget;
+class FramestackWidget;
+class Breakpoint;
+class DbgController;
+class DbgToolBar;
+class VariableWidget;
+class RDBOutputWidget;
+
+class RubyDebuggerPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ RubyDebuggerPart( QObject *parent, const char *name, const QStringList & );
+ ~RubyDebuggerPart();
+ virtual void restorePartialProjectSession(const QDomElement* el);
+ virtual void savePartialProjectSession(QDomElement* el);
+
+private slots:
+ void guiClientAdded(KXMLGUIClient*);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void toggleBreakpoint();
+ void contextWatch();
+ void contextRubyInspect();
+// void projectOpened();
+ void projectClosed();
+ void slotActivePartChanged(KParts::Part*);
+
+ void slotRun();
+ void slotStopDebugger();
+ void slotStop(KDevPlugin* which = 0);
+ void slotPause();
+ void slotRunToCursor();
+ void slotStepOver();
+ void slotStepInto();
+ void slotStepOut();
+
+ void slotRefreshBPState(const Breakpoint&);
+ void slotStatus(const QString &msg, int state);
+ void slotShowStep(const QString &fileName, int lineNum);
+ void slotGotoSource(const QString &fileName, int lineNum);
+
+signals:
+ void rubyInspect(const QString&);
+
+private:
+ KDevAppFrontend *appFrontend();
+ KDevDebugger *debugger();
+
+ bool startDebugger();
+ void setupController();
+
+ QGuardedPtr<VariableWidget> variableWidget;
+ QGuardedPtr<RDBBreakpointWidget> rdbBreakpointWidget;
+ QGuardedPtr<FramestackWidget> framestackWidget;
+ QGuardedPtr<RDBOutputWidget> rdbOutputWidget;
+ DbgController *controller;
+ QGuardedPtr<QLabel> statusBarIndicator;
+ QGuardedPtr<DbgToolBar> floatingToolBar;
+ ProcessLineMaker* procLineMaker;
+ ProcessLineMaker* rdbLineMaker;
+
+ QString m_contextIdent;
+ QCString m_drkonqi;
+
+ KDevDebugger *m_debugger;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/framestackwidget.cpp b/languages/ruby/debugger/framestackwidget.cpp
new file mode 100644
index 00000000..836350b2
--- /dev/null
+++ b/languages/ruby/debugger/framestackwidget.cpp
@@ -0,0 +1,272 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "framestackwidget.h"
+#include "rdbparser.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <qheader.h>
+#include <qlistbox.h>
+#include <qregexp.h>
+#include <qstrlist.h>
+#include <qfileinfo.h>
+
+#include <ctype.h>
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+FramestackWidget::FramestackWidget(QWidget *parent, const char *name, WFlags f)
+ : QListView(parent, name, f),
+ viewedThread_(0)
+{
+ setRootIsDecorated(true);
+ setSelectionMode(Single);
+ addColumn(QString());
+ setSorting(0);
+ header()->hide();
+
+ connect( this, SIGNAL(clicked(QListViewItem*)),
+ this, SLOT(slotSelectionChanged(QListViewItem*)) );
+}
+
+
+/***************************************************************************/
+
+FramestackWidget::~FramestackWidget()
+{
+}
+
+
+// **************************************************************************
+
+void FramestackWidget::clear()
+{
+ viewedThread_ = 0;
+ QListView::clear();
+}
+
+/***************************************************************************/
+
+void FramestackWidget::slotSelectionChanged(QListViewItem * item)
+{
+ if (item == 0) {
+ return;
+ }
+
+ if (item->rtti() == RTTI_THREAD_STACK_ITEM) {
+ ThreadStackItem * thread = (ThreadStackItem*) item;
+ slotSelectFrame(1, thread->threadNo());
+ } else if (item->rtti() == RTTI_FRAME_STACK_ITEM) {
+ FrameStackItem * frame = (FrameStackItem*) item;
+ slotSelectFrame(frame->frameNo(), frame->threadNo());
+ }
+
+ return;
+}
+
+/***************************************************************************/
+
+void FramestackWidget::slotSelectFrame(int frameNo, int threadNo)
+{
+ FrameStackItem * frame = findFrame(frameNo, threadNo);
+
+ if (frame != 0) {
+ setSelected(frame, true);
+ emit selectFrame(frameNo, threadNo, frame->frameName());
+ } else {
+ emit selectFrame(frameNo, threadNo, QString());
+ }
+}
+
+/***************************************************************************/
+
+void FramestackWidget::parseRDBThreadList(char *str)
+{
+ // on receipt of a thread list we must always clear the list.
+ clear();
+
+ QRegExp thread_re("(\\+)?\\s*(\\d+)\\s*(#<[^>]+>\\s*[^:]+:\\d+)");
+ int pos = thread_re.search(str);
+ viewedThread_ = 0;
+
+ while (pos != -1) {
+ ThreadStackItem* thread;
+ thread = new ThreadStackItem( this,
+ thread_re.cap(2).toInt(),
+ QString("%1 %2").arg(thread_re.cap(2)).arg(thread_re.cap(3)) );
+ // The thread with a '+' is always the viewedthread
+ if (thread_re.cap(1) == "+") {
+ viewedThread_ = thread;
+ }
+
+ pos += thread_re.matchedLength();
+ pos = thread_re.search(str, pos);
+ }
+
+ return;
+}
+
+/***************************************************************************/
+
+void FramestackWidget::parseRDBBacktraceList(char *str)
+{
+ QRegExp frame_re("#(\\d+) ([^:]+):(\\d+)(:in `([^\\n]+)')?");
+ int pos = frame_re.search(str);
+
+ while (pos != -1) {
+ QString method(frame_re.cap(5));
+ if (method == "") {
+ method = "toplevel";
+ } else {
+ method.append("(...)");
+ }
+
+ int frameNo = frame_re.cap(1).toInt();
+ QString frameName = QString("T%1#%2 %3").arg(viewedThread_->threadNo()).arg(frame_re.cap(1)).arg(method);
+ new FrameStackItem(viewedThread_, frameNo, QString(frame_re.cap(0)), frameName);
+
+ // Tell the Variable Tree that this frame is active
+ emit frameActive(frameNo, viewedThread_->threadNo(), frameName);
+
+ pos += frame_re.matchedLength();
+ pos = frame_re.search(str, pos);
+ }
+
+ if (viewedThread_ != 0) {
+ viewedThread_->setOpen(true);
+ }
+
+ return;
+}
+
+// **************************************************************************
+
+ThreadStackItem *FramestackWidget::findThread(int threadNo)
+{
+ QListViewItem *sibling = firstChild();
+ while (sibling != 0) {
+ ThreadStackItem *thread = (ThreadStackItem*) sibling;
+ if (thread->threadNo() == threadNo) {
+ return thread;
+ }
+ sibling = sibling->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+
+FrameStackItem *FramestackWidget::findFrame(int frameNo, int threadNo)
+{
+ ThreadStackItem * thread = findThread(threadNo);
+ if (thread == 0) {
+ kdDebug(9012) << "FramestackWidget::findFrame: no matching thread " <<
+ frameNo << " thread: " << threadNo << endl;
+ return 0; // no matching thread?
+ }
+
+ QListViewItem * frameItem = thread->firstChild();
+
+ while (frameItem != 0) {
+ if (((FrameStackItem *) frameItem)->frameNo() == frameNo) {
+ return (FrameStackItem *) frameItem;
+ }
+
+ frameItem = frameItem->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+// **************************************************************************
+
+FrameStackItem::FrameStackItem(ThreadStackItem *parent, int frameNo, const QString &frameDesc, const QString& frameName)
+ : QListViewItem(parent),
+ frameNo_(frameNo),
+ threadNo_(parent->threadNo()),
+ frameName_(frameName)
+{
+ setText(0, frameDesc);
+ key_.sprintf("%.6d", frameNo_);
+}
+
+// **************************************************************************
+
+FrameStackItem::~FrameStackItem()
+{
+}
+
+// **************************************************************************
+
+QString FrameStackItem::key(int /*column*/, bool /*ascending*/) const
+{
+
+ return key_;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+ThreadStackItem::ThreadStackItem(FramestackWidget *parent, int threadNo, const QString &threadDesc)
+ : QListViewItem(parent),
+ threadNo_(threadNo)
+{
+ setText(0, threadDesc);
+ setExpandable(true);
+}
+
+// **************************************************************************
+
+ThreadStackItem::~ThreadStackItem()
+{
+}
+
+// **************************************************************************
+
+void ThreadStackItem::setOpen(bool open)
+{
+ if (open)
+ ((FramestackWidget*)listView())->slotSelectFrame(1, threadNo());
+
+ QListViewItem::setOpen(open);
+}
+
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+#include "framestackwidget.moc"
diff --git a/languages/ruby/debugger/framestackwidget.h b/languages/ruby/debugger/framestackwidget.h
new file mode 100644
index 00000000..373d0690
--- /dev/null
+++ b/languages/ruby/debugger/framestackwidget.h
@@ -0,0 +1,115 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _FRAMESTACKWIDGET_H_
+#define _FRAMESTACKWIDGET_H_
+
+#include <qlistview.h>
+#include <qstringlist.h>
+
+#include "rdbcontroller.h"
+
+namespace RDBDebugger
+{
+
+class FramestackWidget;
+
+
+class ThreadStackItem : public QListViewItem
+{
+public:
+ ThreadStackItem(FramestackWidget *parent, int threadNo, const QString &threadDesc);
+ virtual ~ThreadStackItem();
+
+ virtual int rtti() const { return RTTI_THREAD_STACK_ITEM; }
+
+ void setOpen(bool open);
+ int threadNo() { return threadNo_; }
+
+private:
+ int threadNo_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class FrameStackItem : public QListViewItem
+{
+public:
+ FrameStackItem(ThreadStackItem * parent, int frameNo, const QString & frameDesc, const QString & frameName);
+ virtual ~FrameStackItem();
+
+ virtual int rtti() const { return RTTI_FRAME_STACK_ITEM; }
+ virtual QString key(int column, bool ascending) const;
+
+ int frameNo() { return frameNo_; }
+ int threadNo() { return threadNo_; }
+ QString frameName() { return frameName_; }
+
+private:
+ int frameNo_;
+ int threadNo_;
+ QString frameName_;
+ QString key_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+/**
+ * @author John Birch
+ */
+class FramestackWidget : public QListView
+{
+ Q_OBJECT
+
+public:
+ FramestackWidget( QWidget *parent=0, const char *name=0, WFlags f=0 );
+ virtual ~FramestackWidget();
+
+ void clear();
+
+ void parseRDBThreadList(char *str);
+ void parseRDBBacktraceList(char *str);
+
+ ThreadStackItem *findThread(int threadNo);
+ FrameStackItem *findFrame(int frameNo, int threadNo);
+
+ int viewedThread()
+ { return viewedThread_ ? viewedThread_->threadNo() : -1; }
+
+public slots:
+ void slotSelectFrame(int frameNo, int threadNo);
+ void slotSelectionChanged(QListViewItem *thisItem);
+
+signals:
+ void selectFrame(int frameNo, int threadNo, const QString& frameName);
+ void frameActive(int frameNo, int threadNo, const QString& frameName);
+
+private:
+ ThreadStackItem *viewedThread_;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/hi16-action-breakpoint_add.png b/languages/ruby/debugger/hi16-action-breakpoint_add.png
new file mode 100644
index 00000000..1b41040c
--- /dev/null
+++ b/languages/ruby/debugger/hi16-action-breakpoint_add.png
Binary files differ
diff --git a/languages/ruby/debugger/hi16-action-breakpoint_delete.png b/languages/ruby/debugger/hi16-action-breakpoint_delete.png
new file mode 100644
index 00000000..c35e039f
--- /dev/null
+++ b/languages/ruby/debugger/hi16-action-breakpoint_delete.png
Binary files differ
diff --git a/languages/ruby/debugger/hi16-action-breakpoint_delete_all.png b/languages/ruby/debugger/hi16-action-breakpoint_delete_all.png
new file mode 100644
index 00000000..c35e039f
--- /dev/null
+++ b/languages/ruby/debugger/hi16-action-breakpoint_delete_all.png
Binary files differ
diff --git a/languages/ruby/debugger/hi16-action-breakpoint_edit.png b/languages/ruby/debugger/hi16-action-breakpoint_edit.png
new file mode 100644
index 00000000..ec92ced2
--- /dev/null
+++ b/languages/ruby/debugger/hi16-action-breakpoint_edit.png
Binary files differ
diff --git a/languages/ruby/debugger/kdevrbdebugger.desktop b/languages/ruby/debugger/kdevrbdebugger.desktop
new file mode 100644
index 00000000..47e59474
--- /dev/null
+++ b/languages/ruby/debugger/kdevrbdebugger.desktop
@@ -0,0 +1,73 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin provides a frontend for the source-level debugger for Ruby.
+Comment[ca]=Aquest connector proveeix una interfície per a la depuració a nivell de codi per a Ruby.
+Comment[da]=Dette plugin sørger for en grænseflade til Ruby kildekode-fejlretteren.
+Comment[de]=Dieses Modul stellt eine Oberfläche für den Quelltext-Debugger für Ruby bereit.
+Comment[el]=Αυτό το πρόσθετο προσφέρει ένα πρόγραμμα για τον αποσφαλματωτή πηγαίου κώδικα της γλώσσας Ruby.
+Comment[es]=Este complemento proporciona un entorno para depurar código de Ruby.
+Comment[et]=See plugin pakub Ruby lähtekoodi siluri kasutajaliidest.
+Comment[eu]=Plugin honek Ruby-ren iturburu-mailako araztailearen interfaze bat bat eskeintzen du.
+Comment[fa]=این وصله، یک پایانه برای اشکال‌زدای سطح منبع رابی فراهم می‌کند.
+Comment[fr]=Ce module externe fournit une interface pour le débogueur au niveau source pour Ruby.
+Comment[gl]=Esta extensión proporciona un frontal para o depurador a nivel de código de Ruby.
+Comment[hu]=Ez a bővítőmodul grafikus felületet biztosít a Ruby forrásszintű nyomkövetőjének használatához.
+Comment[it]=Questo plugin fornisce un'interfaccia per il debugger a livello sorgente di Ruby.
+Comment[ja]=このプラグインは、Ruby のソースレベルデバッガのフロントエンドを提供します。
+Comment[nds]=Dit Moduul stellt en Böversiet för den Ruby-Borntextfehlersöker praat.
+Comment[ne]=यो प्लगइनले रूबिका लागि स्रोत-तह डिबगरका लागि फ्रेन्टइन्ड प्रदान गर्दछ ।
+Comment[nl]=Deze plugin biedt een grafische schil voor de broncode-debugger voor Ruby.
+Comment[pl]=Ta wtyczka udostępnia interfejs do debugera poziomu źródłowego dla języka Ruby.
+Comment[pt]=Este 'plugin' oferece uma interface o depurador ao nível do código para Ruby.
+Comment[pt_BR]=Este plug-in fornece uma interface para o depurador a nível de código para Ruby.
+Comment[ru]=Этот модуль предоставляет интерфейс к отладчику исходного кода для Ruby.
+Comment[sk]=Modul pre rozhranie debugera pre Ruby.
+Comment[sr]=Овај прикључак обезбеђује интерфејс за исправљач на нивоу изворног кода за Ruby.
+Comment[sr@Latn]=Ovaj priključak obezbeđuje interfejs za ispravljač na nivou izvornog koda za Ruby.
+Comment[sv]=Insticksprogrammet tillhandahåller ett gränssnitt till källkodsavlusaren för Ruby.
+Comment[tr]=Bu eklenti, Ruby için kaynak-düzeyi hata ayıklayıcıya bir önuç sağlar.
+Comment[zh_CN]=此插件提供了一个 Ruby 的源代码级调试器的前端。
+Comment[zh_TW]=此外掛程式提供 Ruby 除錯器的前端介面。
+Name=KDevRbDebugger
+Name[da]=KDevelop Ruby fejlretter
+Name[nds]=Ruby-Fehlersöök för KDevelop
+Name[pl]=KDevDebugerRb
+Name[sk]=KDev Ruby debuger
+Name[sv]=KDevelop Ruby-avlusare
+Name[zh_TW]=KDevelop Ruby 除錯器
+GenericName=Ruby Debugger Frontend
+GenericName[ca]=Interfície per al depurador Ruby
+GenericName[da]=Ruby fejlretningsgrænseflade
+GenericName[de]=Debugger-Oberfläche für Ruby
+GenericName[el]=Πρόγραμμα αποσφαλματωτή Ruby
+GenericName[es]=Interfaz para el depurador de Ruby
+GenericName[et]=Ruby siluri kasutajaliides
+GenericName[eu]=Ruby araztailearen interfazea
+GenericName[fa]=پایانۀ اشکال‌زدای رابی
+GenericName[fr]=Interface du débogueur pour Ruby
+GenericName[gl]=Frontal do depurador Ruby
+GenericName[hu]=Grafikus felület a Ruby nyomkövetőjéhez
+GenericName[it]=Interfaccia di debug per Ruby
+GenericName[ja]=Ruby デバッガフロントエンド
+GenericName[nds]=Böversiet för den Ruby-Fehlersöker
+GenericName[ne]=रूबि डिबगर फ्रेन्टइन्ड
+GenericName[nl]=Grafische schil voor de Ruby-debugger
+GenericName[pl]=Interfejs do debugera dla języka Ruby
+GenericName[pt]=Interface de Depuração Ruby
+GenericName[pt_BR]=Interface para o Depurador Ruby
+GenericName[ru]=Интегрированный отладчик Ruby
+GenericName[sk]=Ruby debuger rozhranie
+GenericName[sr]=Интерфејс исправљача за Ruby
+GenericName[sr@Latn]=Interfejs ispravljača za Ruby
+GenericName[sv]=Gränssnitt för Ruby-avlusare
+GenericName[tr]=Ruby Hata Ayıklayıcı Önucu
+GenericName[zh_CN]=Ruby 调试器前端
+GenericName[zh_TW]=Ruby 除錯器前端介面
+Icon=
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevrbdebugger
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-ProgrammingLanguages=Ruby
+X-KDevelop-Properties=RubyDebugger
diff --git a/languages/ruby/debugger/kdevrbdebugger.rc b/languages/ruby/debugger/kdevrbdebugger.rc
new file mode 100644
index 00000000..c7e3b336
--- /dev/null
+++ b/languages/ruby/debugger/kdevrbdebugger.rc
@@ -0,0 +1,68 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevRbDebugger" version="10">
+<MenuBar>
+ <Menu name="debug">
+ <text>&amp;Debug</text>
+ <Action name="debug_run" group="debug"/>
+ <Action name="debug_stop" group="debug"/>
+ <Action name="debug_pause" group="debug"/>
+ <Action name="debug_runtocursor" group="debug"/>
+ <Separator group="debug"/>
+ <Action name="debug_stepover" group="debug"/>
+ <Action name="debug_stepinto" group="debug"/>
+ <Action name="debug_stepout" group="debug"/>
+ <Separator group="debug"/>
+ <Action name="debug_toggle_breakpoint" group="debug"/>
+ <Action name="debug_disable_breakpoint" group="debug"/>
+ <Separator group="debug"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="debugToolBar">
+ <text>Debugger Toolbar</text>
+ <Action name="debug_run"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepout"/>
+ <WeakSeparator/>
+</ToolBar>
+<State name="stopped">
+ <enable>
+ <Action name="debug_run"/>
+ </enable>
+ <disable>
+ <Action name="debug_stop"/>
+ <Action name="debug_pause"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepout"/>
+ </disable>
+</State>
+<State name="paused">
+ <enable>
+ <Action name="debug_run"/>
+ <Action name="debug_stop"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepout"/>
+ </enable>
+ <disable>
+ <Action name="debug_pause"/>
+ </disable>
+</State>
+<State name="active">
+ <enable>
+ <Action name="debug_pause"/>
+ <Action name="debug_stop"/>
+ </enable>
+ <disable>
+ <Action name="debug_run"/>
+ <Action name="debug_runtocursor"/>
+ <Action name="debug_stepover"/>
+ <Action name="debug_stepinto"/>
+ <Action name="debug_stepout"/>
+ </disable>
+</State>
+</kpartgui>
+
diff --git a/languages/ruby/debugger/rdbbreakpointwidget.cpp b/languages/ruby/debugger/rdbbreakpointwidget.cpp
new file mode 100644
index 00000000..e31831de
--- /dev/null
+++ b/languages/ruby/debugger/rdbbreakpointwidget.cpp
@@ -0,0 +1,921 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "rdbbreakpointwidget.h"
+#include "rdbtable.h"
+
+#include "breakpoint.h"
+#include "domutil.h"
+
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kurl.h>
+
+#include <qvbuttongroup.h>
+#include <qfileinfo.h>
+#include <qheader.h>
+#include <qtable.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qregexp.h>
+
+#include <stdlib.h>
+#include <ctype.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+enum Column {
+ Control = 0,
+ Enable = 1,
+ Type = 2,
+ Status = 3,
+ Location = 4
+};
+
+
+#define numCols 5
+
+static int m_activeFlag = 0;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class BreakpointTableRow : public QTableItem
+{
+public:
+
+ BreakpointTableRow(QTable* table, EditType editType, Breakpoint* bp);
+ ~BreakpointTableRow();
+
+ bool match (Breakpoint* bp) const;
+ void reset ();
+ void setRow();
+
+ Breakpoint* breakpoint() { return m_breakpoint; }
+
+private:
+ void appendEmptyRow();
+
+private:
+ Breakpoint* m_breakpoint;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+BreakpointTableRow::BreakpointTableRow(QTable* parent, EditType editType,
+ Breakpoint* bp) :
+ QTableItem(parent, editType, ""),
+ m_breakpoint(bp)
+{
+ appendEmptyRow();
+ setRow();
+}
+
+/***************************************************************************/
+
+BreakpointTableRow::~BreakpointTableRow()
+{
+ delete m_breakpoint;
+}
+
+/***************************************************************************/
+
+bool BreakpointTableRow::match(Breakpoint* breakpoint) const
+{
+ return m_breakpoint->match(breakpoint);
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::reset()
+{
+ m_breakpoint->reset();
+ setRow();
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::appendEmptyRow()
+{
+ int row = table()->numRows();
+ table()->setNumRows(row+1);
+
+ table()->setItem(row, Control, this);
+
+ QCheckTableItem* cti = new QCheckTableItem( table(), "");
+ table()->setItem(row, Enable, cti);
+}
+
+/***************************************************************************/
+
+void BreakpointTableRow::setRow()
+{
+ if ( m_breakpoint )
+ {
+ QTableItem *item = table()->item ( row(), Enable );
+ Q_ASSERT(item->rtti() == 2);
+ ((QCheckTableItem*)item)->setChecked(m_breakpoint->isEnabled());
+
+ QString status=m_breakpoint->statusDisplay(m_activeFlag);
+
+ table()->setText(row(), Status, status);
+
+ QString displayType = m_breakpoint->displayType();
+ table()->setText(row(), Location, m_breakpoint->location());
+
+ if (m_breakpoint->isTemporary())
+ displayType = i18n(" temporary");
+
+ table()->setText(row(), Type, displayType);
+ table()->adjustColumn(Type);
+ table()->adjustColumn(Status);
+ table()->adjustColumn(Location);
+ }
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+RDBBreakpointWidget::RDBBreakpointWidget(QWidget *parent, const char *name) :
+ QHBox(parent, name)
+{
+ QFrame* toolbar = new QFrame( this );
+ QVBoxLayout *l = new QVBoxLayout(toolbar, 0, 0);
+
+ toolbar->setFrameStyle( QFrame::ToolBarPanel | QFrame::Plain );
+ toolbar->setLineWidth( 0 );
+
+ m_add = new QToolButton( toolbar, "add breakpoint" );
+ m_add->setPixmap ( SmallIcon ( "breakpoint_add" ) );
+ QToolTip::add ( m_add, i18n ( "Add empty breakpoint" ) + I18N_NOOP(" <Alt+A>"));
+ QWhatsThis::add( m_add, i18n("<b>Add empty breakpoint</b><p>Shows a popup menu that allows you to choose "
+ "the type of breakpoint, then adds a breakpoint of the selected type to the breakpoints list."));
+
+ m_delete = new QToolButton( toolbar, "delete breakpoint" );
+ m_delete->setPixmap ( SmallIcon ( "breakpoint_delete" ) );
+ QToolTip::add ( m_delete, i18n ( "Delete selected breakpoint" ) + I18N_NOOP(" <Delete>") );
+ QWhatsThis::add( m_delete, i18n("<b>Delete selected breakpoint</b><p>Deletes the selected breakpoint in the breakpoints list."));
+
+ m_edit = new QToolButton( toolbar, "edit breakpoint" );
+ m_edit->setPixmap ( SmallIcon ( "breakpoint_edit" ) );
+ QToolTip::add ( m_edit, i18n ( "Edit selected breakpoint" ) + I18N_NOOP(" <Return>") );
+ QWhatsThis::add( m_edit, i18n("<b>Edit selected breakpoint</b><p>Allows to edit location, condition and ignore count properties of the selected breakpoint in the breakpoints list."));
+
+ m_removeAll = new QToolButton( toolbar, "Delete all breakppoints" );
+ m_removeAll->setPixmap ( SmallIcon ( "breakpoint_delete_all" ) );
+ QToolTip::add ( m_removeAll, i18n ( "Remove all breakpoints" ) );
+ QWhatsThis::add( m_removeAll, i18n("<b>Remove all breakpoints</b><p>Removes all breakpoints in the project."));
+
+ l->addWidget(m_add);
+ l->addWidget(m_edit);
+ l->addWidget(m_delete);
+ l->addWidget(m_removeAll);
+ QSpacerItem* spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ l->addItem(spacer);
+
+ QPopupMenu *addMenu = new QPopupMenu( this );
+ addMenu->insertItem( i18n( "File:line" ), BP_TYPE_FilePos );
+ addMenu->insertItem( i18n( "Watchpoint" ), BP_TYPE_Watchpoint );
+ addMenu->insertItem( i18n( "Catchpoint" ), BP_TYPE_Catchpoint );
+ addMenu->insertItem( i18n( "Method()" ), BP_TYPE_Function );
+ m_add->setPopup( addMenu );
+ m_add->setPopupDelay(1);
+
+ m_table = new RDBTable(0, numCols, this, name);
+ m_table->setSelectionMode(QTable::SingleRow);
+ m_table->setShowGrid (false);
+ m_table->setLeftMargin(0);
+ m_table->setFocusStyle(QTable::FollowStyle);
+
+ m_table->hideColumn(Control);
+ m_table->setColumnReadOnly(Type, true);
+ m_table->setColumnReadOnly(Status, true);
+ m_table->setColumnWidth( Enable, 20);
+
+ QHeader *header = m_table->horizontalHeader();
+
+ header->setLabel( Enable, "" );
+ header->setLabel( Type, i18n("Type") );
+ header->setLabel( Status, i18n("Status") );
+ header->setLabel( Location, i18n("Location") );
+
+ m_table->show();
+
+ m_ctxMenu = new QPopupMenu( this );
+ m_ctxMenu->insertItem( i18n( "Show" ), BW_ITEM_Show );
+ m_ctxMenu->insertItem( i18n( "Edit" ), BW_ITEM_Edit );
+ m_ctxMenu->insertItem( i18n( "Disable" ), BW_ITEM_Disable );
+ m_ctxMenu->insertItem( i18n( "Delete" ), BW_ITEM_Delete );
+
+ connect( addMenu, SIGNAL(activated(int)),
+ this, SLOT(slotAddBlankBreakpoint(int)) );
+ connect( m_delete, SIGNAL(clicked()),
+ this, SLOT(slotRemoveBreakpoint()) );
+ connect( m_edit, SIGNAL(clicked()),
+ this, SLOT(slotEditBreakpoint()) );
+ connect( m_removeAll, SIGNAL(clicked()),
+ this, SLOT(slotRemoveAllBreakpoints()) );
+
+ connect( m_table, SIGNAL(contextMenuRequested(int, int, const QPoint &)),
+ this, SLOT(slotContextMenuShow(int, int, const QPoint & )) );
+ connect( m_ctxMenu, SIGNAL(activated(int)),
+ this, SLOT(slotContextMenuSelect(int)) );
+
+ connect( m_table, SIGNAL(doubleClicked(int, int, int, const QPoint &)),
+ this, SLOT(slotRowDoubleClicked(int, int, int, const QPoint &)));
+
+ connect( m_table, SIGNAL(valueChanged(int, int)),
+ this, SLOT(slotNewValue(int, int)));
+
+ connect( m_table, SIGNAL(returnPressed()),
+ this, SLOT(slotEditBreakpoint()));
+// connect( m_table, SIGNAL(f2Pressed()),
+// this, SLOT(slotEditBreakpoint()));
+ connect( m_table, SIGNAL(deletePressed()),
+ this, SLOT(slotRemoveBreakpoint()));
+ connect( m_table, SIGNAL(insertPressed()),
+ this, SLOT(slotAddBreakpoint()));
+}
+
+/***************************************************************************/
+
+RDBBreakpointWidget::~RDBBreakpointWidget()
+{
+ delete m_table;
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::reset()
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ btr->reset();
+ emit publishBPState(*(btr->breakpoint()));
+ }
+ }
+}
+
+/***************************************************************************/
+
+// When a file is loaded then we need to tell the editor (display window)
+// which lines contain a breakpoint.
+void RDBBreakpointWidget::slotRefreshBP(const KURL &filename)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ FilePosBreakpoint* bp = dynamic_cast<FilePosBreakpoint*>(btr->breakpoint());
+ if (bp && (bp->fileName() == filename.path()))
+ emit refreshBPState(*bp);
+ }
+ }
+}
+
+/***************************************************************************/
+
+BreakpointTableRow* RDBBreakpointWidget::find(Breakpoint *breakpoint)
+{
+ // NOTE:- The match doesn't have to be equal. Each type of bp
+ // must decide on the match criteria.
+ Q_ASSERT (breakpoint);
+
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->match(breakpoint))
+ return btr;
+ }
+
+ return 0;
+}
+
+/***************************************************************************/
+
+// The Id is supplied by the debugger
+BreakpointTableRow* RDBBreakpointWidget::findId(int dbgId)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->breakpoint()->dbgId() == dbgId)
+ return btr;
+ }
+
+ return 0;
+}
+
+/***************************************************************************/
+
+// The key is a unique number supplied by us
+BreakpointTableRow* RDBBreakpointWidget::findKey(int BPKey)
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr && btr->breakpoint()->key() == BPKey)
+ return btr;
+ }
+
+ return 0;
+}
+
+/***************************************************************************/
+
+BreakpointTableRow* RDBBreakpointWidget::addBreakpoint(Breakpoint *bp)
+{
+ BreakpointTableRow* btr =
+ new BreakpointTableRow( m_table, QTableItem::WhenCurrent, bp );
+ emit publishBPState(*bp);
+ return btr;
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::removeBreakpoint(BreakpointTableRow* btr)
+{
+ if (!btr)
+ return;
+
+ // Pending but the debugger hasn't started processing this bp so
+ // we can just remove it.
+ Breakpoint* bp = btr->breakpoint();
+ if (bp->isPending() && !bp->isDbgProcessing())
+ {
+ bp->setActionDie();
+ emit publishBPState(*bp);
+ m_table->removeRow(btr->row());
+ }
+ else
+ {
+ bp->setPending(true);
+ bp->setActionClear(true);
+ emit publishBPState(*bp);
+ btr->setRow();
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotToggleBreakpoint(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ if (btr)
+ {
+ delete fpBP;
+ removeBreakpoint(btr);
+ }
+ else
+ addBreakpoint(fpBP);
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotToggleBreakpointEnabled(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ delete fpBP;
+ if (btr)
+ {
+ Breakpoint* bp=btr->breakpoint();
+ bp->setEnabled(!bp->isEnabled());
+ emit publishBPState(*bp);
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotToggleWatchpoint(const QString &varName)
+{
+ Watchpoint *watchpoint = new Watchpoint(varName, false, true);
+ BreakpointTableRow* btr = find(watchpoint);
+ if (btr)
+ {
+ removeBreakpoint(btr);
+ delete watchpoint;
+ }
+ else
+ addBreakpoint(watchpoint);
+}
+
+/***************************************************************************/
+
+// The debugger allows us to set pending breakpoints => do it
+void RDBBreakpointWidget::slotSetPendingBPs()
+{
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+
+ if (btr)
+ {
+ Breakpoint* bp = btr->breakpoint();
+ if (bp->isPending() && !bp->isDbgProcessing() && bp->isValid())
+ emit publishBPState(*bp);
+ }
+ }
+}
+
+/***************************************************************************/
+
+// The debugger is having trouble with this bp - probably because a library
+// was unloaded and invalidated a bp that was previously set in the library
+// code. Reset the bp so that we can try again later.
+void RDBBreakpointWidget::slotUnableToSetBPNow(int BPid)
+{
+ if (BPid == -1)
+ reset();
+ else
+ if (BreakpointTableRow *btr = findId(BPid))
+ btr->reset();
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotParseRDBBrkptList(char *str)
+{
+ // Another example of a not too uncommon occurance
+ // No breakpoints.
+
+ // Set the new active flag so that after we have read the
+ // breakpoint list we can trim the breakpoints that have been
+ // removed (temporary breakpoints do this)
+ m_activeFlag++;
+ QRegExp breakpoint_re("(\\d+) [^:]+:\\d+");
+ int pos = 0;
+
+ pos = breakpoint_re.search(str, pos);
+ while (pos >= 0) {
+ int id = breakpoint_re.cap(1).toInt();
+
+ BreakpointTableRow* btr = findId(id);
+ if (btr)
+ {
+ Breakpoint *bp = btr->breakpoint();
+ bp->setActive(m_activeFlag, id);
+ btr->setRow();
+ emit publishBPState(*bp);
+ }
+
+ pos += breakpoint_re.matchedLength();
+ pos = breakpoint_re.search(str, pos);
+ }
+
+ str = strstr(str, "Watchpoints:");
+ if (str != 0) {
+ QRegExp watchpoint_re("(\\d+) [^\n]+\n");
+ int pos = 0;
+
+ pos = watchpoint_re.search(str, pos);
+ while (pos >= 0) {
+ int id = watchpoint_re.cap(1).toInt();
+
+ BreakpointTableRow* btr = findId(id);
+ if (btr)
+ {
+ Breakpoint *bp = btr->breakpoint();
+ bp->setActive(m_activeFlag, id);
+ btr->setRow();
+ emit publishBPState(*bp);
+ }
+
+ pos += watchpoint_re.matchedLength();
+ pos = watchpoint_re.search(str, pos);
+ }
+ }
+
+ // Remove any inactive breakpoints.
+ for ( int row = m_table->numRows()-1; row >= 0 ; row-- )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ Breakpoint* bp = btr->breakpoint();
+ if (!(bp->isActive(m_activeFlag)))
+ removeBreakpoint(btr);
+ }
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotParseRDBBreakpointSet(char *str, int BPKey)
+{
+ BreakpointTableRow* btr = findKey(BPKey);
+ if (!btr)
+ return;
+
+ Breakpoint *bp = btr->breakpoint();
+ bp->setDbgProcessing(false);
+
+ QRegExp breakpoint_re("Set breakpoint (\\d+) at [^:]+:\\d+");
+ QRegExp watchpoint_re("Set watchpoint (\\d+)");
+
+ int id = 0;
+ if (breakpoint_re.search(str, 0) != -1) {
+ id = breakpoint_re.cap(1).toInt();
+ } else if (watchpoint_re.search(str, 0) != -1) {
+ id = watchpoint_re.cap(1).toInt();
+ }
+
+ if (id > 0)
+ {
+ bp->setActive(m_activeFlag, id);
+ emit publishBPState(*bp);
+ btr->setRow();
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotAddBlankBreakpoint(int idx)
+{
+ BreakpointTableRow* btr = 0;
+ switch (idx)
+ {
+ case BP_TYPE_FilePos:
+ btr = addBreakpoint(new FilePosBreakpoint("", 0));
+ break;
+
+ case BP_TYPE_Watchpoint:
+ btr = addBreakpoint(new Watchpoint(""));
+ break;
+
+ case BP_TYPE_Catchpoint:
+ btr = addBreakpoint(new Catchpoint(""));
+ break;
+
+ case BP_TYPE_Function:
+ btr = addBreakpoint(new FunctionBreakpoint(""));
+ break;
+
+ default:
+ break;
+ }
+
+ if (btr)
+ {
+ QTableSelection ts;
+ ts.init(btr->row(), 0);
+ ts.expandTo(btr->row(), numCols );
+ m_table->addSelection(ts);
+ m_table->editCell(btr->row(), Location, false);
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotRemoveBreakpoint()
+{
+ int row = m_table->currentRow();
+ if ( row != -1)
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ removeBreakpoint(btr);
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotRemoveAllBreakpoints()
+{
+ while (m_table->numRows() > 0)
+ {
+ for ( int row = m_table->numRows()-1; row>=0; row-- )
+ {
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ removeBreakpoint(btr);
+ }
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotRowDoubleClicked(int row, int col, int btn, const QPoint &)
+{
+ if ( btn == Qt::LeftButton )
+ {
+// kdDebug(9012) << "in slotRowSelected row=" << row << endl;
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ FilePosBreakpoint* bp = dynamic_cast<FilePosBreakpoint*>(btr->breakpoint());
+ if (bp)
+ emit gotoSourcePosition(bp->fileName(), bp->lineNum()-1);
+
+ // put the focus back on the clicked item if appropriate
+ if (col == Location)
+ m_table->editCell(row, col, false);
+ }
+ }
+}
+
+void RDBBreakpointWidget::slotContextMenuShow( int row, int /*col*/, const QPoint &mousePos )
+{
+ BreakpointTableRow *btr = (BreakpointTableRow *)m_table->item( row, Control );
+
+ if (btr != NULL)
+ {
+ m_ctxMenu->setItemEnabled( BW_ITEM_Show, (btr->breakpoint( )->type( ) == BP_TYPE_FilePos) );
+ if (btr->breakpoint( )->isEnabled( ))
+ {
+ m_ctxMenu->changeItem( BW_ITEM_Disable, i18n("Disable") );
+ }
+ else
+ {
+ m_ctxMenu->changeItem( BW_ITEM_Disable, i18n("Enable") );
+ }
+
+ //m_ctxMenu->popup( mapToGlobal( mousePos ) );
+ m_ctxMenu->popup( mousePos );
+ }
+}
+
+void RDBBreakpointWidget::slotContextMenuSelect( int item )
+{
+ int row, col;
+ BreakpointTableRow *btr;
+ Breakpoint *bp;
+ FilePosBreakpoint *fbp;
+
+ row= m_table->currentRow( );
+ if (row == -1)
+ return;
+ btr = (BreakpointTableRow *)m_table->item( row, Control );
+ if (btr == NULL)
+ return;
+ bp = btr->breakpoint( );
+ if (bp == NULL)
+ return;
+ fbp = dynamic_cast<FilePosBreakpoint*>(bp);
+
+ switch( item )
+ {
+ case BW_ITEM_Show:
+ if (fbp)
+ emit gotoSourcePosition(fbp->fileName(), fbp->lineNum()-1);
+ break;
+ case BW_ITEM_Edit:
+ col = m_table->currentColumn( );
+ if (col == Location)
+ m_table->editCell(row, col, false);
+ break;
+ case BW_ITEM_Disable:
+ bp->setEnabled( !bp->isEnabled( ) );
+ btr->setRow( );
+ emit publishBPState( *bp );
+ break;
+ case BW_ITEM_Delete:
+ slotRemoveBreakpoint( );
+ break;
+ default:
+ // oops, check it out! this case is not in sync with the
+ // m_ctxMenu. Check the enum in the header file.
+ return;
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotEditRow(int row, int col, const QPoint &)
+{
+// kdDebug(9012) << "in slotEditRow row=" << row << endl;
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+ if (btr)
+ {
+ if (col == Location)
+ m_table->editCell(row, col, false);
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotNewValue(int row, int col)
+{
+// kdDebug(9012) << "in slotNewValue row=" << row << endl;
+ BreakpointTableRow* btr = (BreakpointTableRow *) m_table->item(row, Control);
+
+ if (btr)
+ {
+ bool changed=false;
+ Breakpoint* bp = btr->breakpoint();
+ switch (col)
+ {
+
+ case Enable:
+ {
+ QCheckTableItem *item = (QCheckTableItem*)m_table->item ( row, Enable );
+ if ( item->isChecked() != bp->isEnabled() )
+ {
+ bp->setEnabled(item->isChecked());
+ bp->setPending(true);
+ bp->setActionModify(true);
+ changed = true;
+ }
+ break;
+ }
+
+ case Location:
+ {
+ if (bp->location() != m_table->text(btr->row(), Location))
+ {
+// kdDebug(9012) << "Old location [" << bp->location() << "]" << endl;
+// kdDebug(9012) << "New location [" << m_table->text(btr->row(), Location) << "]" << endl;
+ bp->setActionDie();
+ emit publishBPState(*bp);
+ bp->setPending(true);
+ bp->setActionAdd(true);
+ bp->setLocation(m_table->text(btr->row(), Location));
+ changed = true;
+ }
+ break;
+ }
+
+ case Type:
+ case Status:
+ default:
+ break;
+ }
+
+ if (changed)
+ {
+ btr->setRow();
+ emit publishBPState(*bp);
+ }
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotEditBreakpoint(const QString &fileName, int lineNum)
+{
+ FilePosBreakpoint *fpBP = new FilePosBreakpoint(fileName, lineNum+1);
+
+ BreakpointTableRow* btr = find(fpBP);
+ delete fpBP;
+
+ if (btr)
+ {
+ QTableSelection ts;
+ ts.init(btr->row(), 0);
+ ts.expandTo(btr->row(), numCols);
+ m_table->addSelection(ts);
+ m_table->editCell(btr->row(), Location, false);
+ }
+
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotEditBreakpoint()
+{
+ m_table->editCell(m_table->currentRow(), Location, false);
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::savePartialProjectSession(QDomElement* el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull())
+ return;
+
+ QDomElement breakpointListEl = domDoc.createElement("breakpointList");
+ for ( int row = 0; row < m_table->numRows(); row++ )
+ {
+ BreakpointTableRow* btr =
+ (BreakpointTableRow *) m_table->item(row, Control);
+ Breakpoint* bp = btr->breakpoint();
+
+ QDomElement breakpointEl =
+ domDoc.createElement("breakpoint"+QString::number(row));
+
+ breakpointEl.setAttribute("type", bp->type());
+ breakpointEl.setAttribute("location", bp->location(false));
+ breakpointEl.setAttribute("enabled", bp->isEnabled());
+
+ breakpointListEl.appendChild(breakpointEl);
+ }
+
+ if (!breakpointListEl.isNull())
+ el->appendChild(breakpointListEl);
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::restorePartialProjectSession(const QDomElement* el)
+{
+ QDomElement breakpointListEl = el->namedItem("breakpointList").toElement();
+ if (!breakpointListEl.isNull())
+ {
+ QDomElement breakpointEl;
+ for (breakpointEl = breakpointListEl.firstChild().toElement();
+ !breakpointEl.isNull();
+ breakpointEl = breakpointEl.nextSibling().toElement())
+ {
+ Breakpoint* bp=0;
+ BP_TYPES type = (BP_TYPES) breakpointEl.attribute( "type", "0").toInt();
+ switch (type)
+ {
+ case BP_TYPE_FilePos:
+ {
+ bp = new FilePosBreakpoint("", 0);
+ break;
+ }
+ case BP_TYPE_Watchpoint:
+ {
+ bp = new Watchpoint("");
+ break;
+ }
+ case BP_TYPE_Catchpoint:
+ {
+ bp = new Catchpoint("");
+ break;
+ }
+ case BP_TYPE_Function:
+ {
+ bp = new FunctionBreakpoint("");
+ break;
+ }
+ default:
+ break;
+ }
+
+ // Common settings for any type of breakpoint
+ if (bp)
+ {
+ bp->setLocation(breakpointEl.attribute( "location", ""));
+ bp->setEnabled(breakpointEl.attribute( "enabled", "1").toInt());
+
+ // Add the bp if we don't already have it.
+ if (!find(bp))
+ addBreakpoint(bp);
+ else
+ delete bp;
+ }
+ }
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::slotAddBreakpoint( )
+{
+ if (m_add->popup())
+ {
+ m_add->popup()->popup(mapToGlobal(this->geometry().topLeft()));
+ }
+}
+
+/***************************************************************************/
+
+void RDBBreakpointWidget::focusInEvent( QFocusEvent */* e*/ )
+{
+ m_table->setFocus();
+}
+
+}
+
+
+#include "rdbbreakpointwidget.moc"
diff --git a/languages/ruby/debugger/rdbbreakpointwidget.h b/languages/ruby/debugger/rdbbreakpointwidget.h
new file mode 100644
index 00000000..65e6e15b
--- /dev/null
+++ b/languages/ruby/debugger/rdbbreakpointwidget.h
@@ -0,0 +1,120 @@
+/***************************************************************************
+ begin : Tue May 13 2003
+ copyright : (C) 2003 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _RDBBreakpointWidget_H_
+#define _RDBBreakpointWidget_H_
+
+#include <qhbox.h>
+#include <qpopupmenu.h>
+
+class QDomElement;
+class QToolButton;
+class KURL;
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+class Breakpoint;
+class BreakpointTableRow;
+class RDBTable;
+
+class RDBBreakpointWidget : public QHBox
+{
+ Q_OBJECT
+
+public:
+ RDBBreakpointWidget( QWidget* parent=0, const char* name=0 );
+ virtual ~RDBBreakpointWidget();
+
+ void reset();
+
+ void savePartialProjectSession(QDomElement* el);
+ void restorePartialProjectSession(const QDomElement* el);
+
+
+public slots:
+ // Connected to from the editor widget:
+ void slotToggleBreakpoint(const QString &filename, int lineNum);
+ void slotToggleBreakpointEnabled(const QString &fileName, int lineNum);
+
+ // Connected to from the variable widget:
+ void slotToggleWatchpoint(const QString &varName);
+
+ // Connected to from the dbgcontroller:
+ void slotSetPendingBPs();
+ void slotUnableToSetBPNow(int BPNo);
+ void slotParseRDBBrkptList(char *str);
+ void slotParseRDBBreakpointSet(char *str, int BPKey);
+
+ void slotRefreshBP(const KURL &filename);
+
+protected:
+ enum BW_ITEMS { BW_ITEM_Show, BW_ITEM_Edit, BW_ITEM_Disable, BW_ITEM_Delete };
+ virtual void focusInEvent(QFocusEvent *e);
+
+private slots:
+ void slotRemoveBreakpoint();
+ void slotRemoveAllBreakpoints();
+ void slotEditBreakpoint(const QString &fileName, int lineNum);
+ void slotEditBreakpoint();
+ void slotAddBreakpoint();
+ void slotAddBlankBreakpoint(int idx);
+ void slotRowDoubleClicked(int row, int col, int button, const QPoint & mousePos);
+ void slotContextMenuShow( int row, int col, const QPoint &mousePos );
+ void slotContextMenuSelect( int item );
+ void slotEditRow(int row, int col, const QPoint & mousePos);
+ void slotNewValue(int row, int col);
+
+signals:
+ void publishBPState(const Breakpoint& brkpt);
+ void refreshBPState(const Breakpoint& brkpt);
+ void gotoSourcePosition(const QString &fileName, int lineNum);
+ void clearAllBreakpoints();
+
+private:
+ BreakpointTableRow* find(Breakpoint *bp);
+ BreakpointTableRow* findId(int id);
+ BreakpointTableRow* findKey(int BPKey);
+
+ void setActive();
+ BreakpointTableRow* addBreakpoint(Breakpoint *bp);
+ void removeBreakpoint(BreakpointTableRow* btr);
+
+private:
+ RDBTable* m_table;
+
+ QToolButton* m_add;
+ QToolButton* m_delete;
+ QToolButton* m_edit;
+ QToolButton* m_removeAll;
+ QPopupMenu* m_ctxMenu;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/rdbcommand.cpp b/languages/ruby/debugger/rdbcommand.cpp
new file mode 100644
index 00000000..98dc3a80
--- /dev/null
+++ b/languages/ruby/debugger/rdbcommand.cpp
@@ -0,0 +1,81 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 "rdbcommand.h"
+#include "breakpoint.h"
+#include "variablewidget.h"
+
+namespace RDBDebugger
+{
+
+
+RDBCommand::RDBCommand(const QCString &setCommand, bool isRunCmd, bool isInfoCmd)
+ : DbgCommand(setCommand, isRunCmd, isInfoCmd)
+{
+// if (prompt_) {
+// cmdBuffer_ = QCString().sprintf("set prompt %c%c\n", BLOCK_START, prompt_) +
+// command_ +
+// idlePrompt_;
+// }
+}
+
+/***************************************************************************/
+
+RDBCommand::~RDBCommand()
+{
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+RDBItemCommand::RDBItemCommand( VarItem *item,
+ const QCString &command,
+ bool isRunCmd)
+ : RDBCommand(command, isRunCmd, true),
+ item_(item)
+{
+}
+
+/***************************************************************************/
+
+RDBItemCommand::~RDBItemCommand()
+{
+}
+
+
+RDBSetBreakpointCommand::RDBSetBreakpointCommand(const QCString &command, int key)
+ : RDBCommand(command, false, false),
+ key_(key)
+{
+}
+
+/***************************************************************************/
+
+RDBSetBreakpointCommand::~RDBSetBreakpointCommand()
+{
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
diff --git a/languages/ruby/debugger/rdbcommand.h b/languages/ruby/debugger/rdbcommand.h
new file mode 100644
index 00000000..663c8119
--- /dev/null
+++ b/languages/ruby/debugger/rdbcommand.h
@@ -0,0 +1,99 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _RDBCOMMAND_H_
+#define _RDBCOMMAND_H_
+
+#include "dbgcommand.h"
+
+namespace RDBDebugger
+{
+
+class Breakpoint;
+class VarItem;
+
+// sigh - namespace's don't work on some of the older compilers
+enum RDBCmd
+{
+ CONSTANTS = 'C',
+ CVARS = 'V',
+ IVARS = 'I',
+ LOCALS = 'L'
+};
+
+#define RUNCMD (true)
+#define NOTRUNCMD (false)
+#define INFOCMD (true)
+#define NOTINFOCMD (false)
+
+/**
+ * @author John Birch
+ */
+
+class RDBCommand : public DbgCommand
+{
+public:
+ RDBCommand(const QCString& command, bool isRunCmd=false, bool isInfoCmd=true);
+ virtual ~RDBCommand();
+
+private:
+ static QCString idlePrompt_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class RDBItemCommand : public RDBCommand
+{
+public:
+ RDBItemCommand(VarItem *item, const QCString &command,
+ bool isRunCmd=false);
+ virtual ~RDBItemCommand();
+
+ VarItem *getItem() { return item_; }
+
+private:
+ VarItem *item_;
+};
+
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+class RDBSetBreakpointCommand : public RDBCommand
+{
+public:
+ RDBSetBreakpointCommand(const QCString& setCommand, int key);
+ virtual ~RDBSetBreakpointCommand();
+
+ int getKey() const { return key_; }
+
+private:
+ int key_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/rdbcontroller.cpp b/languages/ruby/debugger/rdbcontroller.cpp
new file mode 100644
index 00000000..160754a0
--- /dev/null
+++ b/languages/ruby/debugger/rdbcontroller.cpp
@@ -0,0 +1,1414 @@
+// *************************************************************************
+// rdbcontroller.cpp - description
+// -------------------
+// begin : Sun Aug 8 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+//
+// Adapted for ruby debugging
+// --------------------------
+// begin : Mon Nov 1 2004
+// copyright : (C) 2004 by Richard Dale
+// email : Richard_Dale@tipitina.demon.co.uk
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * 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 "rdbcontroller.h"
+
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <errno.h>
+
+#include "breakpoint.h"
+#include "framestackwidget.h"
+#include "rdbcommand.h"
+#include "stty.h"
+#include "variablewidget.h"
+#include "domutil.h"
+#include "settings.h"
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+
+#include <qdatetime.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+#include <qstring.h>
+#include <qtextstream.h>
+
+#include <iostream>
+#include <ctype.h>
+#include <stdlib.h>
+using namespace std;
+
+// **************************************************************************
+//
+// Does all the communication between rdb and the kdevelop's debugger code.
+// Significatant classes being used here are
+//
+// RDBParser - parses the "variable" data using the vartree and varitems
+// VarTree - where the variable data will end up
+// FrameStack - tracks the program frames and allows the user to switch between
+// and therefore view the calling funtions and their data
+// Breakpoint - Where and what to do with breakpoints.
+// STTY - the tty that the _application_ will run on.
+//
+// Significant variables
+// state_ - be very careful setting this. The controller is totally
+// dependent on this reflecting the correct state. For instance,
+// if the app is busy but we don't think so, then we lose control
+// of the app. The only way to get out of these situations is to
+// delete (stop) the controller.
+// currentFrame_
+// - Holds the frame number where and locals/variable information will
+// go to
+//
+//
+// **************************************************************************
+
+namespace RDBDebugger
+{
+
+// This is here so we can check for startup /shutdown problems
+int debug_controllerExists = false;
+
+// At the moment a Unix domain socket is used. It might be better to
+// change to tcp/ip and listen on a port instead
+QCString RDBController::unixSocketPath_;
+
+
+RDBController::RDBController(VariableTree *varTree, FramestackWidget *frameStack, QDomDocument &projectDom)
+ : DbgController(),
+ frameStack_(frameStack),
+ varTree_(varTree),
+ currentFrame_(1),
+ viewedThread_(-1),
+ stdoutOutputLen_(0),
+ stdoutOutput_(new char[4096]),
+ holdingZone_(),
+ rdbOutputLen_(0),
+ rdbOutput_(new char[49152]),
+ socketNotifier_(0),
+ currentCmd_(0),
+ currentPrompt_("(rdb:1) "),
+ tty_(0),
+ state_(s_dbgNotStarted|s_appNotStarted|s_silent),
+ programHasExited_(false),
+ dom(projectDom),
+ config_forceBPSet_(true),
+ config_dbgTerminal_(false)
+{
+ struct sockaddr_un sockaddr;
+ unixSocketPath_.sprintf("/tmp/.rubydebugger%d", getpid());
+ QFileInfo unixSocket(unixSocketPath_);
+
+ stdoutSizeofBuf_ = sizeof(stdoutOutput_);
+ rdbSizeofBuf_ = sizeof(rdbOutput_);
+
+ if (unixSocket.exists()) {
+ unlink(unixSocketPath_);
+ }
+
+ masterSocket_ = socket(AF_UNIX, SOCK_STREAM, 0);
+ sockaddr.sun_family = AF_UNIX;
+ strcpy(sockaddr.sun_path, unixSocketPath_);
+ bind(masterSocket_, (const struct sockaddr*) &sockaddr, sizeof(sockaddr));
+ listen(masterSocket_, 1);
+ acceptNotifier_ = new QSocketNotifier(masterSocket_, QSocketNotifier::Read, this);
+ QObject::connect( acceptNotifier_, SIGNAL(activated(int)),
+ this, SLOT(slotAcceptConnection(int)) );
+
+ configure();
+ cmdList_.setAutoDelete(true);
+
+ Q_ASSERT(! debug_controllerExists);
+ debug_controllerExists = true;
+}
+
+// **************************************************************************
+
+// Deleting the controller involves shutting down rdb nicely.
+// When were attached to a process, we must first detach so that the process
+// can continue running as it was before being attached. rdb is quite slow to
+// detach from a process, so we must process events within here to get a "clean"
+// shutdown.
+RDBController::~RDBController()
+{
+ delete[] stdoutOutput_;
+ delete[] rdbOutput_;
+ debug_controllerExists = false;
+
+ QFileInfo unixSocket(unixSocketPath_);
+ if (unixSocket.exists()) {
+ unlink(unixSocketPath_);
+ }
+}
+
+// **************************************************************************
+
+void RDBController::configure()
+{
+}
+
+// **************************************************************************
+
+// Fairly obvious that we'll add whatever command you give me to a queue
+// If you tell me to, I'll put it at the head of the queue so it'll run ASAP
+// Not quite so obvious though is that if we are going to run again. then any
+// information requests become redundent and must be removed.
+// We also try and run whatever command happens to be at the head of
+// the queue.
+void RDBController::queueCmd(DbgCommand *cmd, bool executeNext)
+{
+ // We remove any info command or _run_ command if we are about to
+ // add a run command.
+ if (cmd->isARunCmd())
+ removeInfoRequests();
+
+ if (executeNext)
+ cmdList_.insert(0, cmd);
+ else
+ cmdList_.append (cmd);
+}
+
+// **************************************************************************
+
+// If the appliction can accept a command and we've got one waiting
+// then send it.
+// Commands can be just request for data (or change rdbs state in someway)
+// or they can be "run" commands. If a command is sent to rdb our internal
+// state will get updated.
+void RDBController::executeCmd()
+{
+ if (stateIsOn(s_dbgNotStarted|s_waitForWrite|s_appBusy|s_shuttingDown) || !dbgProcess_)
+ return;
+
+ if (currentCmd_ == 0) {
+ if (cmdList_.isEmpty())
+ return;
+
+ currentCmd_ = cmdList_.take(0);
+ }
+
+ if (!currentCmd_->moreToSend()) {
+ delete currentCmd_;
+ if (cmdList_.isEmpty()) {
+ currentCmd_ = 0;
+ return;
+ }
+
+ currentCmd_ = cmdList_.take(0);
+ }
+
+ char * ptr = currentCmd_->cmdToSend().data();
+ int bytesToWrite = currentCmd_->cmdLength();
+ int bytesWritten = 0;
+
+ while (bytesToWrite > 0) {
+ bytesWritten = write(socket_, ptr, bytesToWrite);
+ bytesToWrite -= bytesWritten;
+ ptr += bytesWritten;
+ }
+
+ if (currentCmd_->isARunCmd()) {
+ setStateOn(s_appBusy);
+ kdDebug(9012) << "App is busy" << endl;
+ setStateOff(s_appNotStarted|s_programExited|s_silent);
+ }
+
+ QString prettyCmd = currentCmd_->cmdToSend();
+ prettyCmd = currentPrompt_ + prettyCmd;
+ emit rdbStdout( prettyCmd.latin1() );
+
+ if (!stateIsOn(s_silent))
+ emit dbgStatus("", state_);
+}
+
+// **************************************************************************
+
+void RDBController::destroyCmds()
+{
+ if (currentCmd_)
+ {
+ delete currentCmd_;
+ currentCmd_ = 0;
+ }
+
+ while (!cmdList_.isEmpty())
+ delete cmdList_.take(0);
+}
+
+// **********************************************************************
+
+void RDBController::removeInfoRequests()
+{
+ int i = cmdList_.count();
+ while (i)
+ {
+ i--;
+ DbgCommand *cmd = cmdList_.at(i);
+ if (cmd->isAnInfoCmd() || cmd->isARunCmd())
+ delete cmdList_.take(i);
+ }
+}
+
+// **********************************************************************
+
+// Pausing an app removes any pending run commands so that the app doesn't
+// start again. If we want to be silent then we remove any pending info
+// commands as well.
+void RDBController::pauseApp()
+{
+ int i = cmdList_.count();
+ while (i)
+ {
+ i--;
+ DbgCommand *cmd = cmdList_.at(i);
+ if ((stateIsOn(s_silent) && cmd->isAnInfoCmd()) || cmd->isARunCmd())
+ delete cmdList_.take(i);
+ }
+
+ if (dbgProcess_ && stateIsOn(s_appBusy))
+ dbgProcess_->kill(SIGINT);
+}
+
+// **********************************************************************
+
+// Whenever the program pauses we need to refresh the data visible to
+// the user. The reason we've stopped may be passed in to be emitted.
+void RDBController::actOnProgramPause(const QString &msg)
+{
+ // We're only stopping if we were running, of course.
+ if (stateIsOn(s_appBusy))
+ {
+ kdDebug(9012) << "App is paused" << endl;
+ setStateOff(s_appBusy);
+ if (stateIsOn(s_silent))
+ return;
+
+ emit dbgStatus (msg, state_);
+
+ // We're always at frame one when the program stops
+ // and we must reset the active flag
+ currentFrame_ = 1;
+ varTree_->nextActivationId();
+ setStateOn(s_fetchLocals);
+
+ queueCmd(new RDBCommand("where", NOTRUNCMD, INFOCMD), true);
+ queueCmd(new RDBCommand("thread list", NOTRUNCMD, INFOCMD), true);
+
+ if (stateIsOn(s_fetchGlobals)) {
+ queueCmd(new RDBCommand("var global", NOTRUNCMD, INFOCMD));
+ }
+
+ emit acceptPendingBPs();
+ }
+}
+
+// **************************************************************************
+
+// There is no app anymore. This can be caused by program exiting
+// an invalid program specified or ...
+// rdb is still running though, but only the run command (may) make sense
+// all other commands are disabled.
+void RDBController::programNoApp(const QString &msg, bool msgBox)
+{
+ state_ = (s_appNotStarted|s_programExited|(state_&(s_shuttingDown)));
+ destroyCmds();
+
+ // We're always at frame one when the program stops
+ // and we must reset the active flag
+ viewedThread_ = -1;
+ currentFrame_ = 1;
+ varTree_->nextActivationId();
+
+ // Now wipe the tree out
+ varTree_->viewport()->setUpdatesEnabled(false);
+ varTree_->prune();
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+
+ frameStack_->clear();
+
+ if (msgBox)
+ KMessageBox::error(0, i18n("rdb message:\n")+msg);
+
+ emit dbgStatus (msg, state_);
+}
+
+// **************************************************************************
+
+// The program location falls out of rdb. We treat
+// it as a wrapped command.
+// The data gets parsed here and emitted in its component parts.
+void RDBController::parseProgramLocation(char *buf)
+{
+ QString buffer(buf);
+ QString line;
+ QTextStream input(&buffer, IO_ReadOnly);
+ QString sourceFile;
+ int sourceLine = 0;
+
+ // "1: a = 1"
+ QRegExp display_re("^(\\d+):\\s(.*)$");
+
+ // "/opt/qt/src/widgets/qlistview.rb:1558:puts 'hello world'"
+ QRegExp sourcepos_re("^([^:]+):(\\d+):");
+
+ line = input.readLine();
+ while (! line.isNull()) {
+ if (sourcepos_re.search(line, 0) >= 0) {
+ sourceFile = sourcepos_re.cap(1);
+ sourceLine = sourcepos_re.cap(2).toInt();
+ } else if (display_re.search(line, 0) >= 0) {
+ varTree_->watchRoot()->updateWatchExpression(display_re.cap(1).toInt(), display_re.cap(2));
+ }
+
+ line = input.readLine();
+ }
+
+ if ( !sourceFile.isNull()
+ && ( traceIntoRuby_
+ || ( !sourceFile.endsWith("/qtruby.rb")
+ && !sourceFile.endsWith("/korundum.rb") ) )
+ && !sourceFile.endsWith("/debuggee.rb") )
+ {
+ actOnProgramPause(QString());
+ emit showStepInSource(sourceFile, sourceLine, "");
+ return;
+ }
+
+ if (stateIsOn(s_appBusy))
+ actOnProgramPause(i18n("No source: %1").arg(sourceFile));
+ else
+ emit dbgStatus (i18n("No source: %1").arg(sourceFile), state_);
+}
+
+// **************************************************************************
+
+// parsing the backtrace list will cause the vartree to be refreshed
+void RDBController::parseBacktraceList(char *buf)
+{
+ frameStack_->parseRDBBacktraceList(buf);
+}
+
+// **************************************************************************
+
+void RDBController::parseThreadList(char *buf)
+{
+ frameStack_->parseRDBThreadList(buf);
+ viewedThread_ = frameStack_->viewedThread();
+ varTree_->setCurrentThread(viewedThread_);
+}
+
+// **************************************************************************
+
+void RDBController::parseSwitchThread(char *buf)
+{
+ // Look for the thread number
+ // 2 #<Thread:0x30091998 sleep> /home/duke/play/testit/trykorundum/src/bar.rb:13
+ QRegExp thread_re("(\\d+)");
+ if (thread_re.search(buf) != -1) {
+ viewedThread_ = thread_re.cap(1).toInt();
+ currentFrame_ = 1;
+ }
+}
+
+// **************************************************************************
+
+// After an 'up nnn' or 'down nnn' command, get the new source file and line no.
+void RDBController::parseFrameMove(char *buf)
+{
+ QString sourceFile;
+ int sourceLine = 0;
+
+ if (stateIsOn(s_fetchLocals)) {
+ return;
+ }
+
+ // "#2 /home/duke/play/testit/trykorundum/src/main.rb:11"
+ QRegExp sourcepos_re("#\\d+\\s([^:]+):(\\d+)");
+ if (sourcepos_re.search(buf) != -1) {
+ sourceFile = sourcepos_re.cap(1);
+ sourceLine = sourcepos_re.cap(2).toInt();
+
+ if ( !sourceFile.isNull()
+ && ( traceIntoRuby_
+ || ( !sourceFile.endsWith("/qtruby.rb")
+ && !sourceFile.endsWith("/korundum.rb") ) )
+ && !sourceFile.endsWith("/debuggee.rb") )
+ {
+ emit showStepInSource(sourceFile, sourceLine, "");
+ return;
+ }
+ }
+
+ emit dbgStatus(i18n("No source: %1").arg(sourceFile), state_);
+}
+
+// **************************************************************************
+
+// When a breakpoint has been set, rdb responds with some data about the
+// new breakpoint. We just inform the breakpoint system about this.
+void RDBController::parseBreakpointSet(char *buf)
+{
+ if (RDBSetBreakpointCommand *BPCmd = dynamic_cast<RDBSetBreakpointCommand*>(currentCmd_))
+ {
+ // ... except in this case :-) A -1 key tells us that this is
+ // a special internal breakpoint, and we shouldn't do anything
+ // with it. Currently there are _no_ internal breakpoints.
+ if (BPCmd->getKey() != -1) {
+ emit rawRDBBreakpointSet(buf, BPCmd->getKey());
+ }
+ }
+}
+
+// **************************************************************************
+
+// Extra data needed by an item was requested. Here's the result.
+// If it's an ordinary 'p ' command then just echo the result on
+// the RDB console and don't bother parsing.
+void RDBController::parseRequestedData(char *buf)
+{
+ if (RDBItemCommand *rdbItemCommand = dynamic_cast<RDBItemCommand*> (currentCmd_))
+ {
+ // Fish out the item from the command and let it deal with the data
+ VarItem *item = rdbItemCommand->getItem();
+ varTree_->viewport()->setUpdatesEnabled(false);
+ item->expandValue(buf);
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+ }
+}
+
+
+// **************************************************************************
+
+// Select a different frame to view. We need to get and (maybe) display
+// where we are in the program source.
+void RDBController::parseFrameSelected(char *buf)
+{
+ if (!stateIsOn(s_silent)) {
+ emit showStepInSource("", -1, "");
+ emit dbgStatus (i18n("No source: %1").arg(QString(buf)), state_);
+ }
+}
+
+// **************************************************************************
+
+// Sets the id of the display in the VarTree and a current value.
+void RDBController::parseDisplay(char *buf, char * expr)
+{
+ varTree_->viewport()->setUpdatesEnabled(false);
+ varTree_->watchRoot()->setWatchExpression(buf, expr);
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+}
+
+// **************************************************************************
+
+// Updates the watch expressions with current values
+void RDBController::parseUpdateDisplay(char *buf)
+{
+ varTree_->viewport()->setUpdatesEnabled(false);
+
+ QRegExp display_re("(\\d+):\\s([^\n]*)\n");
+
+ int pos = display_re.search(buf);
+ while (pos != -1) {
+ varTree_->watchRoot()->updateWatchExpression(display_re.cap(1).toInt(), display_re.cap(2));
+
+ pos += display_re.matchedLength();
+ pos = display_re.search(buf, pos);
+ }
+
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+}
+
+// **************************************************************************
+
+// This is called on program stop to process the globals.
+void RDBController::parseGlobals(char *buf)
+{
+ varTree_->viewport()->setUpdatesEnabled(false);
+ varTree_->globalRoot()->setGlobals(buf);
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+}
+
+// **************************************************************************
+
+// This is called on program stop to process the locals.
+// Once the locals have been processed we prune the tree of items that are
+// inactive.
+void RDBController::parseLocals(char type, char *buf)
+{
+ varTree_->viewport()->setUpdatesEnabled(false);
+
+ // The locals are always attached to the currentFrame
+ VarFrameRoot *frame = varTree_->findFrame(currentFrame_, viewedThread_);
+ if (!frame)
+ {
+ frame = new VarFrameRoot(varTree_, currentFrame_, viewedThread_);
+ frame->setFrameName(
+ frameStack_->findFrame(currentFrame_, viewedThread_)->frameName());
+ }
+
+ Q_ASSERT(frame);
+
+ if (type == (char) CONSTANTS) {
+ frame->addLocals(buf);
+ } else if (type == (char) CVARS) {
+ frame->addLocals(buf);
+ } else if (type == (char) IVARS) {
+ frame->addLocals(buf);
+ } else {
+ frame->addLocals(buf);
+ frame->setLocals();
+ }
+
+ varTree_->viewport()->setUpdatesEnabled(true);
+ varTree_->repaint();
+}
+
+
+
+// **************************************************************************
+
+void RDBController::parse(char *buf)
+{
+ if (currentCmd_ == 0) {
+ return;
+ }
+
+ if (currentCmd_->isARunCmd()) {
+ parseProgramLocation(buf);
+ } else if (currentCmd_->rawDbgCommand() == "break") {
+ emit rawRDBBreakpointList(buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "break ", strlen("break ")) == 0) {
+ parseBreakpointSet(buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "watch ", strlen("watch ")) == 0) {
+ parseBreakpointSet(buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "display ", strlen("display ")) == 0) {
+ parseDisplay(buf, currentCmd_->rawDbgCommand().data() + strlen("display "));
+ } else if (currentCmd_->rawDbgCommand() == "display") {
+ parseUpdateDisplay(buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "undisplay ", strlen("undisplay ")) == 0) {
+ ;
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "method instance ", strlen("method instance ")) == 0) {
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "method ", strlen("method ")) == 0) {
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "pp ", strlen("pp ")) == 0) {
+ parseRequestedData(buf);
+ } else if (currentCmd_->rawDbgCommand() == "thread list") {
+ parseThreadList(buf);
+ } else if ( qstrncmp(currentCmd_->rawDbgCommand(), "up ", strlen("up ")) == 0
+ || qstrncmp(currentCmd_->rawDbgCommand(), "down ", strlen("down ")) == 0 )
+ {
+ parseFrameMove(buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "thread switch ", strlen("thread switch ")) == 0) {
+ parseSwitchThread(buf);
+ } else if (currentCmd_->rawDbgCommand() == "thread current") {
+ parseThreadList(buf);
+ } else if (currentCmd_->rawDbgCommand() == "where") {
+ parseBacktraceList(buf);
+ } else if (currentCmd_->rawDbgCommand() == "var global") {
+ parseGlobals(buf);
+ } else if (currentCmd_->rawDbgCommand() == "var local") {
+ parseLocals(LOCALS, buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "var instance ", strlen("var instance ")) == 0) {
+ parseLocals(IVARS, buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "var class ", strlen("var class ")) == 0) {
+ parseLocals(CVARS, buf);
+ } else if (qstrncmp(currentCmd_->rawDbgCommand(), "var const ", strlen("var const ")) == 0) {
+ parseLocals(CONSTANTS, buf);
+ }
+
+ return;
+}
+
+// **************************************************************************
+
+void RDBController::setBreakpoint(const QCString &BPSetCmd, int key)
+{
+ queueCmd(new RDBSetBreakpointCommand(BPSetCmd, key));
+}
+
+// **************************************************************************
+
+void RDBController::clearBreakpoint(const QCString &BPClearCmd)
+{
+ queueCmd(new RDBCommand(BPClearCmd, NOTRUNCMD, NOTINFOCMD));
+ // Note: this is NOT an info command, because rdb doesn't explictly tell
+ // us that the breakpoint has been deleted, so if we don't have it the
+ // BP list doesn't get updated.
+ queueCmd(new RDBCommand("break", NOTRUNCMD, NOTINFOCMD));
+}
+
+// **************************************************************************
+
+void RDBController::modifyBreakpoint( const Breakpoint& BP )
+{
+ Q_ASSERT(BP.isActionModify());
+ if (BP.dbgId() > 0)
+ {
+ if (BP.changedEnable())
+ queueCmd(new RDBCommand(QCString().sprintf("%s %d",
+ BP.isEnabled() ? "enable" : "disable",
+ BP.dbgId()), NOTRUNCMD, NOTINFOCMD));
+
+ // BP.setDbgProcessing(true);
+ // Note: this is NOT an info command, because rdb doesn't explictly tell
+ // us that the breakpoint has been deleted, so if we don't have it the
+ // BP list doesn't get updated.
+ queueCmd(new RDBCommand("break", NOTRUNCMD, NOTINFOCMD));
+ }
+}
+
+// **************************************************************************
+// SLOTS
+// *****
+// For most of these slots data can only be sent to rdb when it
+// isn't busy and it is running.
+
+// **************************************************************************
+
+void RDBController::slotStart(const QString& ruby_interpreter, const QString& character_coding, const QString& run_directory, const QString& debuggee_path, const QString &application, const QString& run_arguments, bool show_constants, bool trace_into_ruby)
+{
+ Q_ASSERT (!dbgProcess_ && !tty_);
+
+// tty_ = new STTY(config_dbgTerminal_, "konsole");
+ tty_ = new STTY(config_dbgTerminal_, Settings::terminalEmulatorName( *kapp->config() ));
+ if (!config_dbgTerminal_)
+ {
+ connect( tty_, SIGNAL(OutOutput(const char*)), SIGNAL(ttyStdout(const char*)) );
+ connect( tty_, SIGNAL(ErrOutput(const char*)), SIGNAL(ttyStderr(const char*)) );
+ }
+
+ QString tty(tty_->getSlave());
+ if (tty.isEmpty())
+ {
+ KMessageBox::error(0, i18n("The ruby debugger cannot use the tty* or pty* devices.\n"
+ "Check the settings on /dev/tty* and /dev/pty*\n"
+ "As root you may need to \"chmod ug+rw\" tty* and pty* devices "
+ "and/or add the user to the tty group using "
+ "\"usermod -G tty username\"."));
+
+ delete tty_;
+ tty_ = 0;
+ return;
+ }
+
+ dbgProcess_ = new KProcess;
+
+ connect( dbgProcess_, SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, SLOT(slotDbgStdout(KProcess *, char *, int)) );
+
+ connect( dbgProcess_, SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, SLOT(slotDbgStderr(KProcess *, char *, int)) );
+
+ connect( dbgProcess_, SIGNAL(wroteStdin(KProcess *)),
+ this, SLOT(slotDbgWroteStdin(KProcess *)) );
+
+ connect( dbgProcess_, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotDbgProcessExited(KProcess*)) );
+
+ rubyInterpreter_ = ruby_interpreter;
+ characterCoding_ = character_coding;
+ runDirectory_ = run_directory;
+ debuggeePath_ = debuggee_path;
+ application_ = application;
+ runArguments_ = run_arguments;
+ showConstants_ = show_constants;
+ traceIntoRuby_ = trace_into_ruby;
+
+ *dbgProcess_ << ruby_interpreter;
+ *dbgProcess_ << character_coding;
+ *dbgProcess_ << "-C" << QString(QFile::encodeName( run_directory ));
+ *dbgProcess_ << "-r" << debuggee_path;
+ *dbgProcess_ << application;
+
+ if (!run_arguments.isNull() && !run_arguments.isEmpty()) {
+ *dbgProcess_ << run_arguments;
+ }
+
+ emit rdbStdout(QString( ruby_interpreter + " " + character_coding
+ + " -C " + QString(QFile::encodeName( run_directory ))
+ + " -r " + debuggee_path + " "
+ + application + " " + run_arguments ).latin1() );
+
+ if (!dbgProcess_->start( KProcess::NotifyOnExit,
+ KProcess::Communication(KProcess::All)) )
+ {
+ kdDebug(9012) << "Couldn't start ruby debugger" << endl;
+ }
+
+ // Initialise rdb. At this stage rdb is sitting wondering what to do,
+ // and to whom. Organise a few things, then set up the tty for the application,
+ // and the application itself
+
+ // Now the ruby debugger has been started and the application has been loaded,
+ // BUT the app hasn't been started yet! A run command is about to be issued
+ // by whoever is controlling us.
+
+ if (!dbgProcess_->writeStdin(QString("%1\n").arg(unixSocketPath_).latin1(), strlen(unixSocketPath_) + 1)) {
+ kdDebug(9012) << "failed to write Unix domain socket path to rdb "
+ << QString("%1\n").arg(unixSocketPath_).latin1() << endl;
+ }
+
+ setStateOff(s_programExited);
+ setStateOn(s_dbgNotStarted|s_appNotStarted|s_silent);
+}
+
+// **************************************************************************
+
+void RDBController::slotStopDebugger()
+{
+ if (stateIsOn(s_shuttingDown) || !dbgProcess_)
+ return;
+
+ setStateOn(s_shuttingDown|s_silent);
+ destroyCmds();
+
+ QTime start;
+ QTime now;
+
+ // Get rdb's attention if it's busy. We need rdb to be at the
+ // command line so we can stop it.
+ if (stateIsOn(s_appBusy))
+ {
+ kdDebug(9012) << "ruby debugger busy on shutdown - stopping rdb (SIGINT)" << endl;
+ dbgProcess_->kill(SIGINT);
+ start = QTime::currentTime();
+ while (-1)
+ {
+ kapp->processEvents(20);
+ now = QTime::currentTime();
+ if (!stateIsOn(s_appBusy) || start.msecsTo( now ) > 2000)
+ break;
+ }
+ }
+
+
+ // Now try to stop the ruby debugger running.
+ kdDebug(9012) << "App is busy" << endl;
+ setStateOn(s_appBusy);
+ const char *quit="quit\n";
+ if (!dbgProcess_->writeStdin(quit, strlen(quit)))
+ kdDebug(9012) << "failed to write 'quit' to ruby debugger" << endl;
+
+ emit rdbStdout("(rdb:1) quit");
+ start = QTime::currentTime();
+ while (-1)
+ {
+ kapp->processEvents(20);
+ now = QTime::currentTime();
+ if (stateIsOn(s_programExited) || start.msecsTo( now ) > 2000)
+ break;
+ }
+
+ // We cannot wait forever.
+ if (!stateIsOn(s_programExited))
+ {
+ kdDebug(9012) << "rdb not shutdown - killing" << endl;
+ dbgProcess_->kill(SIGKILL);
+ }
+
+ delete dbgProcess_; dbgProcess_ = 0;
+ delete tty_; tty_ = 0;
+
+ state_ = s_dbgNotStarted | s_appNotStarted | s_silent;
+ emit dbgStatus (i18n("Debugger stopped"), state_);
+}
+
+
+
+// **************************************************************************
+
+void RDBController::slotRun()
+{
+ if (stateIsOn(s_appBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (stateIsOn(s_programExited)) {
+ slotStart(rubyInterpreter_, characterCoding_, runDirectory_, debuggeePath_, application_, runArguments_, showConstants_, traceIntoRuby_);
+ return;
+ }
+
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+// **************************************************************************
+
+void RDBController::slotRunUntil(const QString &fileName, int lineNum)
+{
+ if (stateIsOn(s_appBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ if (fileName.isEmpty())
+ queueCmd(new RDBCommand( QCString().sprintf("break %d", lineNum),
+ RUNCMD, NOTINFOCMD));
+ else
+ queueCmd(new RDBCommand(
+ QCString().sprintf("break %s:%d", fileName.latin1(), lineNum),
+ RUNCMD, NOTINFOCMD));
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+// **************************************************************************
+
+void RDBController::slotStepInto()
+{
+ if (stateIsOn(s_appBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ queueCmd(new RDBCommand("step", RUNCMD, NOTINFOCMD));
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+
+// **************************************************************************
+
+void RDBController::slotStepOver()
+{
+ if (stateIsOn(s_appBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ queueCmd(new RDBCommand("next", RUNCMD, NOTINFOCMD));
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+
+// **************************************************************************
+
+void RDBController::slotStepOutOff()
+{
+ if (stateIsOn(s_appBusy|s_appNotStarted|s_shuttingDown))
+ return;
+
+ queueCmd(new RDBCommand("finish", RUNCMD, NOTINFOCMD));
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+// **************************************************************************
+
+// Only interrupt a running program.
+void RDBController::slotBreakInto()
+{
+ pauseApp();
+}
+
+// **************************************************************************
+
+// See what, if anything needs doing to this breakpoint.
+void RDBController::slotBPState( const Breakpoint& BP )
+{
+ // Are we in a position to do anything to this breakpoint?
+ if (stateIsOn(s_dbgNotStarted|s_shuttingDown) || !BP.isPending() ||
+ BP.isActionDie())
+ return;
+
+ // We need this flag so that we can continue execution. I did use
+ // the s_silent state flag but it can be set prior to this method being
+ // called, hence is invalid.
+ bool restart = false;
+ if (stateIsOn(s_appBusy))
+ {
+ if (!config_forceBPSet_)
+ return;
+
+ // When forcing breakpoints to be set/unset, interrupt a running app
+ // and change the state.
+ setStateOn(s_silent);
+ pauseApp();
+ restart = true;
+ }
+
+ if (BP.isActionAdd())
+ {
+ setBreakpoint(BP.dbgSetCommand().latin1(), BP.key());
+ // BP.setDbgProcessing(true);
+ }
+ else
+ {
+ if (BP.isActionClear())
+ {
+ clearBreakpoint(BP.dbgRemoveCommand().latin1());
+ // BP.setDbgProcessing(true);
+ }
+ else
+ {
+ if (BP.isActionModify())
+ {
+ modifyBreakpoint(BP); // Note: DbgProcessing gets set in modify fn
+ }
+ }
+ }
+
+ if (restart)
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+}
+
+// **************************************************************************
+
+void RDBController::slotClearAllBreakpoints()
+{
+ // Are we in a position to do anything to this breakpoint?
+ if (stateIsOn(s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ bool restart = false;
+ if (stateIsOn(s_appBusy))
+ {
+ if (!config_forceBPSet_)
+ return;
+
+ // When forcing breakpoints to be set/unset, interrupt a running app
+ // and change the state.
+ setStateOn(s_silent);
+ pauseApp();
+ restart = true;
+ }
+
+ queueCmd(new RDBCommand("delete", NOTRUNCMD, NOTINFOCMD));
+ // Note: this is NOT an info command, because rdb doesn't explictly tell
+ // us that the breakpoint has been deleted, so if we don't have it the
+ // BP list doesn't get updated.
+ queueCmd(new RDBCommand("break", NOTRUNCMD, NOTINFOCMD));
+
+ if (restart)
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+
+ executeCmd();
+}
+
+
+
+// **************************************************************************
+
+void RDBController::slotSelectFrame(int frameNo, int threadNo, const QString& frameName)
+{
+ if (stateIsOn(s_appBusy|s_dbgNotStarted|s_shuttingDown)) {
+ kdDebug(9012) << "RDBController::slotSelectFrame wrong state" << endl;
+ return;
+ }
+
+ if (viewedThread_ != threadNo) {
+ // Note that 'thread switch nnn' is a run command
+ queueCmd(new RDBCommand(QCString().sprintf("thread switch %d",
+ threadNo), RUNCMD, INFOCMD));
+ executeCmd();
+ return;
+ }
+
+ if (frameNo > currentFrame_) {
+ queueCmd(new RDBCommand(QCString().sprintf("up %d", frameNo - currentFrame_), NOTRUNCMD, INFOCMD));
+ if (!stateIsOn(s_fetchLocals)) {
+ queueCmd(new RDBCommand("display", NOTRUNCMD, INFOCMD));
+ }
+ } else if (frameNo < currentFrame_) {
+ queueCmd(new RDBCommand(QCString().sprintf("down %d", currentFrame_ - frameNo), NOTRUNCMD, INFOCMD));
+ if (!stateIsOn(s_fetchLocals)) {
+ queueCmd(new RDBCommand("display", NOTRUNCMD, INFOCMD));
+ }
+ }
+
+ // Hold on to this thread/frame so that we know where to put the local
+ // variables if generated.
+ viewedThread_ = threadNo;
+ currentFrame_ = frameNo;
+
+ VarFrameRoot *frame = varTree_->findFrame(frameNo, viewedThread_);
+ if (frame == 0) {
+ frame = new VarFrameRoot(varTree_, currentFrame_, viewedThread_);
+ }
+
+ frame->setFrameName(frameName);
+ varTree_->setSelected(frame, true);
+
+ // Have we already got these details?
+ if (frame->needsVariables()) {
+ // Ask for the locals
+
+ if (showConstants_) {
+ queueCmd(new RDBCommand("var const self.class", NOTRUNCMD, INFOCMD));
+ }
+
+ queueCmd(new RDBCommand("var instance self", NOTRUNCMD, INFOCMD));
+ queueCmd(new RDBCommand("var class self.class", NOTRUNCMD, INFOCMD));
+ queueCmd(new RDBCommand("var local", NOTRUNCMD, INFOCMD));
+ frame->startWaitingForData();
+ }
+
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+
+ return;
+}
+
+
+
+// **************************************************************************
+
+// This is called when an item needs special processing to show a value.
+void RDBController::slotExpandItem(VarItem *item, const QCString &userRequest)
+{
+ if (stateIsOn(s_appBusy|s_dbgNotStarted|s_shuttingDown))
+ return;
+
+ Q_ASSERT(item != 0);
+
+ // Bad user data!!
+ if (userRequest.isEmpty())
+ return;
+
+ queueCmd(new RDBItemCommand(item, QCString("pp ") + userRequest.data(), false));
+
+ if (currentCmd_ == 0) {
+ executeCmd();
+ }
+}
+
+// **************************************************************************
+
+// This method evaluates text selected with the 'Inspect:' context menu
+void RDBController::slotRubyInspect(const QString &inspectText)
+{
+ queueCmd(new RDBCommand( QCString().sprintf("p %s", inspectText.latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ executeCmd();
+}
+
+
+// **************************************************************************
+
+// Add a new expression to be displayed in the Watch variable tree
+void RDBController::slotAddWatchExpression(const QString& expr, bool execute)
+{
+ queueCmd(new RDBCommand( QCString().sprintf("display %s", expr.latin1()),
+ NOTRUNCMD,
+ NOTINFOCMD ) );
+ if (execute) {
+ executeCmd();
+ }
+}
+
+// **************************************************************************
+
+// Add a new expression to be displayed in the Watch variable tree
+void RDBController::slotRemoveWatchExpression(int displayId)
+{
+ queueCmd(new RDBCommand( QCString().sprintf("undisplay %d", displayId),
+ NOTRUNCMD,
+ INFOCMD ) );
+ executeCmd();
+}
+
+
+// **************************************************************************
+
+// The user will only get globals if the Global frame is open
+void RDBController::slotFetchGlobals(bool fetch)
+{
+ if (fetch) {
+ setStateOn(s_fetchGlobals);
+ queueCmd(new RDBCommand("var global", NOTRUNCMD, INFOCMD));
+ executeCmd();
+ } else {
+ setStateOff(s_fetchGlobals);
+ }
+
+ kdDebug(9012) << (fetch ? "<Globals ON>": "<Globals OFF>") << endl;
+}
+
+// **************************************************************************
+
+// Data from the ruby program's stdout gets processed here.
+void RDBController::slotDbgStdout(KProcess *, char *buf, int buflen)
+{
+ QCString msg(buf, buflen+1);
+ emit ttyStdout(msg);
+}
+
+// **************************************************************************
+
+// Data from the ruby program's stderr gets processed here.
+void RDBController::slotDbgStderr(KProcess *, char *buf, int buflen)
+{
+ QCString msg(buf, buflen+1);
+ emit ttyStderr(msg);
+}
+
+// **************************************************************************
+
+void RDBController::slotDbgWroteStdin(KProcess *)
+{
+// setStateOff(s_waitForWrite);
+ // if (!stateIsOn(s_silent))
+ // emit dbgStatus ("", state_);
+// executeCmd();
+}
+
+// **************************************************************************
+
+void RDBController::slotAcceptConnection(int masterSocket)
+{
+ Q_ASSERT(masterSocket == masterSocket_);
+
+ struct sockaddr sockaddr;
+ socklen_t fromlen;
+
+ if (socketNotifier_ != 0) {
+ close(socket_);
+ delete socketNotifier_;
+ }
+
+ socket_ = accept(masterSocket, &sockaddr, &fromlen);
+ if (fcntl(socket_, F_SETFL, O_NONBLOCK) == -1) {
+ kdDebug(9012) << "RDBController::slotAcceptConnection can't set nonblocking socket " << errno << endl;
+ }
+
+ socketNotifier_ = new QSocketNotifier(socket_, QSocketNotifier::Read, 0);
+ QObject::connect( socketNotifier_, SIGNAL(activated(int)),
+ this, SLOT(slotReadFromSocket(int)) );
+
+ setStateOff(s_dbgNotStarted);
+ emit dbgStatus ("", state_);
+
+ cmdList_.clear();
+ rdbOutputLen_ = 0;
+
+ // Organise any breakpoints.
+ emit acceptPendingBPs();
+
+ if (traceIntoRuby_) {
+ queueCmd(new RDBCommand("trace_ruby on", NOTRUNCMD, NOTINFOCMD));
+ }
+
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+
+ // Reset the display id for any watch expressions already in the variable tree
+ varTree_->resetWatchVars();
+}
+
+// **************************************************************************
+
+// Output from rdb via the Unix socket gets processed here.
+void RDBController::slotReadFromSocket(int socket)
+{
+ Q_ASSERT(socket == socket_);
+
+ static bool parsing = false;
+
+ int bytesRead = read(socket, rdbOutput_ + rdbOutputLen_, rdbSizeofBuf_);
+
+ rdbOutputLen_ += bytesRead;
+ *(rdbOutput_ + rdbOutputLen_) = 0;
+
+
+ // Already parsing? then get out quick.
+ if (parsing)
+ {
+ kdDebug(9012) << "Already parsing" << endl;
+ return;
+ }
+
+// kdDebug(9012) << "RDBController::slotReadFromSocket length: " << rdbOutputLen_ << " input: " << rdbOutput_ << endl;
+
+ QRegExp prompt_re("(\\(rdb:(\\d+)\\) )$");
+ int promptPos = prompt_re.search(rdbOutput_, 0);
+
+ // Keep appending output to the rbdOutput_ buffer until the
+ // ruby debugger writes the next prompt
+ if (promptPos == -1) {
+ return;
+ }
+
+// kdDebug(9012) << "RDBController::slotReadFromSocket length: " << rdbOutputLen_ << " input: " << rdbOutput_ << endl;
+
+ // Save the prompt, and remove it from the buffer
+ currentPrompt_ = prompt_re.cap(1).latin1();
+ rdbOutputLen_ -= prompt_re.matchedLength();
+ *(rdbOutput_ + rdbOutputLen_) = 0;
+
+ emit rdbStdout(rdbOutput_);
+
+ parsing = true;
+ parse(rdbOutput_);
+ parsing = false;
+ rdbOutputLen_ = 0;
+
+ executeCmd();
+
+ if (currentCmd_ == 0 && stateIsOn(s_fetchLocals)) {
+ if (!varTree_->schedule()) {
+ setStateOff(s_fetchLocals);
+ }
+ }
+}
+
+// **************************************************************************
+
+void RDBController::slotDbgProcessExited(KProcess*)
+{
+ destroyCmds();
+ state_ = s_appNotStarted|s_programExited|(state_&(s_shuttingDown));
+ emit dbgStatus (i18n("Process exited"), state_);
+ emit rdbStdout("(rdb:1) Process exited\n");
+ frameStack_->clear();
+ varTree_->clear();
+
+ if (socketNotifier_ != 0) {
+ delete socketNotifier_;
+ socketNotifier_ = 0;
+ close(socket_);
+ }
+
+ delete dbgProcess_; dbgProcess_ = 0;
+ delete tty_; tty_ = 0;
+}
+
+
+// **************************************************************************
+
+// Takes abbreviated commands and expands them, before passing them on to rdb
+//
+void RDBController::slotUserRDBCmd(const QString& cmd)
+{
+ kdDebug(9012) << "Requested user cmd: " << cmd << endl;
+ QRegExp break_re("^b(reak)?(\\s.*)?");
+ QRegExp watch_re("^wat(ch)?\\s+(.*)");
+ QRegExp delete_re("^del(ete)?(\\s.*)?");
+ QRegExp display_re("^disp(lay)?(\\s.*)?");
+ QRegExp undisplay_re("^undisp(lay)?(\\s.*)?");
+ QRegExp step_re("^s(tep)?(\\s[\\d]+)?$");
+ QRegExp next_re("^n(ext)?(\\s[\\d]+)?$");
+ QRegExp varlocal_re("^v(ar)?\\s+l(ocal)?");
+ QRegExp varglobal_re("^v(ar)?\\s+g(lobal)?");
+ QRegExp varinstance_re("^v(ar)?\\s+i(nstance)?\\s(.*)");
+ QRegExp varconst_re("^v(ar)?\\s+c(onst)?\\s(.*)");
+ QRegExp threadlist_re("^th(read)?\\s+l(ist)?");
+ QRegExp threadcurrent_re("^th(read)?(\\sc(ur(rent)?)?)?$");
+ QRegExp threadswitch_re("^th(read)?(\\ssw(itch)?)?(\\s.*)");
+ QRegExp thread_re("^th(read)?(\\s+.*)?");
+ QRegExp methodinstance_re("^m(ethod)?\\s+i(nstance)?\\s+(.*)");
+ QRegExp method_re("^m(ethod)?\\s+(.*)");
+ QRegExp list_re("^l(ist)?(\\s+\\d+-\\d+)?$");
+
+ if ( break_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("break%s", break_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( watch_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("watch %s", watch_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( delete_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("delete%s", delete_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( display_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("display%s", display_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( undisplay_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("undisplay%s", undisplay_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( step_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("step%s", step_re.cap(2).latin1()),
+ RUNCMD,
+ INFOCMD ), true );
+ } else if ( next_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("next%s", next_re.cap(2).latin1()),
+ RUNCMD,
+ INFOCMD ), true );
+ } else if ( varlocal_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand("var local", NOTRUNCMD, INFOCMD));
+ } else if ( varglobal_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand("var global", NOTRUNCMD, INFOCMD));
+ } else if ( varinstance_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("var instance %s", varinstance_re.cap(3).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( varconst_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("var const %s", varconst_re.cap(3).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( methodinstance_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("method instance %s", methodinstance_re.cap(3).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( method_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("method %s", method_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if ( list_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("list%s", list_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if (cmd == "c" || cmd == "cont") {
+ queueCmd(new RDBCommand("cont", RUNCMD, NOTINFOCMD));
+ } else if (cmd == "fi" || cmd == "finish") {
+ queueCmd(new RDBCommand("finish", RUNCMD, NOTINFOCMD));
+ } else if ( threadlist_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand("thread list", NOTRUNCMD, INFOCMD), true);
+ } else if ( threadcurrent_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand("thread current", NOTRUNCMD, INFOCMD), true );
+ } else if ( threadswitch_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("thread switch%s", threadswitch_re.cap(4).latin1()),
+ RUNCMD,
+ INFOCMD ), true );
+ } else if ( thread_re.search(cmd) >= 0 ) {
+ queueCmd(new RDBCommand( QCString().sprintf("thread%s", thread_re.cap(2).latin1()),
+ NOTRUNCMD,
+ INFOCMD ), true );
+ } else if (cmd == "frame" || cmd == "f" || cmd == "where" || cmd == "w") {
+ queueCmd(new RDBCommand("where", NOTRUNCMD, INFOCMD), true);
+ } else if (cmd == "q" || cmd == "quit") {
+ slotStopDebugger();
+ return;
+ } else {
+ kdDebug(9012) << "Passing directly to rdb: " << cmd << endl;
+ queueCmd(new RDBCommand(cmd.latin1(), NOTRUNCMD, INFOCMD));
+ }
+
+ executeCmd();
+}
+
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+#include "rdbcontroller.moc"
diff --git a/languages/ruby/debugger/rdbcontroller.h b/languages/ruby/debugger/rdbcontroller.h
new file mode 100644
index 00000000..2d303218
--- /dev/null
+++ b/languages/ruby/debugger/rdbcontroller.h
@@ -0,0 +1,192 @@
+/***************************************************************************
+ rdbcontroller.h - description
+ -------------------
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _RDBCONTROLLER_H_
+#define _RDBCONTROLLER_H_
+
+#include "dbgcontroller.h"
+
+#include <qcstring.h>
+#include <qdom.h>
+#include <qobject.h>
+#include <qptrlist.h>
+#include <qstring.h>
+#include <qsocketnotifier.h>
+
+class KProcess;
+
+namespace RDBDebugger
+{
+
+class Breakpoint;
+class DbgCommand;
+class FramestackWidget;
+class VarItem;
+class VariableTree;
+class STTY;
+
+/**
+ * A front end implementation to the ruby command line debugger
+ * @author jbb
+ */
+
+class RDBController : public DbgController
+{
+ Q_OBJECT
+
+public:
+ RDBController(VariableTree *varTree, FramestackWidget *frameStack, QDomDocument &projectDom);
+ ~RDBController();
+
+protected:
+ void queueCmd(DbgCommand *cmd, bool executeNext=false);
+
+private:
+ void parseProgramLocation (char *buf);
+ void parseBacktraceList (char *buf);
+ void parseThreadList (char* buf);
+ void parseSwitchThread (char* buf);
+ void parseFrameMove (char *buf);
+ void parseBreakpointSet (char *buf);
+ void parseDisplay (char *buf, char * expr);
+ void parseUpdateDisplay (char *buf);
+ void parseGlobals (char *buf);
+ void parseLocals (char type, char *buf);
+ void parseRequestedData (char *buf);
+ void parseFrameSelected (char *buf);
+
+ void parse (char *buf);
+
+ void pauseApp();
+ void executeCmd ();
+ void destroyCmds();
+ void removeInfoRequests();
+ void actOnProgramPause(const QString &msg);
+ void programNoApp(const QString &msg, bool msgBox);
+
+ void setBreakpoint(const QCString &BPSetCmd, int key);
+ void clearBreakpoint(const QCString &BPClearCmd);
+ void modifyBreakpoint(const Breakpoint&);
+
+ void setStateOn(int stateOn) { state_ |= stateOn; }
+ void setStateOff(int stateOff) { state_ &= ~stateOff; }
+ bool stateIsOn(int state) { return state_ &state; }
+
+public slots:
+ void configure();
+
+ void slotStart( const QString& shell, const QString& characterCoding,
+ const QString& run_directory, const QString& debuggee_path,
+ const QString &application, const QString& run_arguments,
+ bool show_constants, bool trace_into_ruby );
+ //void slotStart(const QString& shell, const QString &application);
+
+ void slotStopDebugger();
+
+ void slotRun();
+ void slotRunUntil(const QString &filename, int lineNum);
+ void slotStepInto();
+ void slotStepOver();
+ void slotStepOutOff();
+
+ void slotBreakInto();
+ void slotBPState( const Breakpoint& );
+ void slotClearAllBreakpoints();
+
+ void slotExpandItem(VarItem *parent, const QCString &userRequest);
+ void slotRubyInspect(const QString &inspectText);
+ void slotSelectFrame(int frameNo, int threadNo, const QString& frameName);
+ void slotFetchGlobals(bool fetch);
+ void slotAddWatchExpression(const QString& expr, bool execute);
+ void slotRemoveWatchExpression(int displayId);
+
+ void slotUserRDBCmd(const QString&);
+
+protected slots:
+ void slotDbgStdout(KProcess *proc, char *buf, int buflen);
+ void slotDbgStderr(KProcess *proc, char *buf, int buflen);
+ void slotDbgWroteStdin(KProcess *proc);
+ void slotDbgProcessExited(KProcess *proc);
+
+ void slotAcceptConnection(int masterSocket);
+ void slotReadFromSocket(int socket);
+
+signals:
+ void acceptPendingBPs ();
+ void unableToSetBPNow (int BPNo);
+ void addWatchExpression (const QString&);
+
+private:
+ FramestackWidget* frameStack_;
+ VariableTree* varTree_;
+ int currentFrame_;
+ int viewedThread_;
+
+ int stdoutSizeofBuf_; // size of the buffer for holding stdout piped
+ // from the ruby program
+ int stdoutOutputLen_; // amount of data in the output buffer
+ char* stdoutOutput_; // buffer for the output from kprocess
+ QCString holdingZone_;
+
+ int rdbSizeofBuf_; // size of the output buffer from rdb
+ int rdbOutputLen_; // amount of data in the rdb buffer
+ char* rdbOutput_; // buffer for the output from rdb via the Unix socket
+
+ int masterSocket_; // The socket to accept connections
+ QSocketNotifier* acceptNotifier_;
+ static QCString unixSocketPath_; // The name of the Unix Domain socket
+ int socket_; // The socket to read and write to the debuggee
+ QSocketNotifier* socketNotifier_;
+
+ QPtrList<DbgCommand> cmdList_;
+ DbgCommand* currentCmd_;
+ QString currentPrompt_;
+
+ STTY* tty_;
+
+ // Details for starting the ruby debugger process
+ QString rubyInterpreter_;
+ QString characterCoding_;
+ QString runDirectory_;
+ QString debuggeePath_;
+ QString application_;
+ QString runArguments_;
+ bool showConstants_;
+ bool traceIntoRuby_;
+
+ // Some state variables
+ int state_;
+ bool programHasExited_;
+
+ // Configuration values
+ QDomDocument &dom;
+ bool config_forceBPSet_;
+ bool config_dbgTerminal_;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/rdboutputwidget.cpp b/languages/ruby/debugger/rdboutputwidget.cpp
new file mode 100644
index 00000000..5e08e116
--- /dev/null
+++ b/languages/ruby/debugger/rdboutputwidget.cpp
@@ -0,0 +1,171 @@
+// *************************************************************************
+// rdboutputwidget.cpp - description
+// -------------------
+// begin : 10th April 2003
+// copyright : (C) 2003 by John Birch
+// email : jbb@kdevelop.org
+//
+// Adapted for ruby debugging
+// --------------------------
+// begin : Mon Nov 1 2004
+// copyright : (C) 2004 by Richard Dale
+// email : Richard_Dale@tipitina.demon.co.uk
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * 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 "rdboutputwidget.h"
+#include "dbgcontroller.h"
+
+#include <kcombobox.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qtextedit.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+namespace RDBDebugger
+{
+
+/***************************************************************************/
+
+RDBOutputWidget::RDBOutputWidget( QWidget *parent, const char *name) :
+ QWidget(parent, name),
+ m_userRDBCmdEditor(0),
+ m_Interrupt(0),
+ m_rdbView(0)
+{
+
+ m_rdbView = new QTextEdit (this, name);
+ m_rdbView->setReadOnly(true);
+
+ QBoxLayout *userRDBCmdEntry = new QHBoxLayout();
+ m_userRDBCmdEditor = new KHistoryCombo (this, "rdb-user-cmd-editor");
+
+ QLabel *label = new QLabel(i18n("&RDB cmd:"), this);
+ label->setBuddy(m_userRDBCmdEditor);
+ userRDBCmdEntry->addWidget(label);
+
+ userRDBCmdEntry->addWidget(m_userRDBCmdEditor);
+ userRDBCmdEntry->setStretchFactor(m_userRDBCmdEditor, 1);
+
+ m_Interrupt = new QToolButton( this, "add breakpoint" );
+ m_Interrupt->setSizePolicy ( QSizePolicy ( (QSizePolicy::SizeType)0,
+ ( QSizePolicy::SizeType)0,
+ 0,
+ 0,
+ m_Interrupt->sizePolicy().hasHeightForWidth())
+ );
+ m_Interrupt->setPixmap ( SmallIcon ( "player_pause" ) );
+ userRDBCmdEntry->addWidget(m_Interrupt);
+ QToolTip::add ( m_Interrupt, i18n ( "Pause execution of the app to enter rdb commands" ) );
+
+ QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
+ topLayout->addWidget(m_rdbView, 10);
+ topLayout->addLayout(userRDBCmdEntry);
+
+ slotDbgStatus( "", s_dbgNotStarted);
+
+ connect( m_userRDBCmdEditor, SIGNAL(returnPressed()), SLOT(slotRDBCmd()) );
+ connect( m_Interrupt, SIGNAL(clicked()), SIGNAL(breakInto()));
+}
+
+/***************************************************************************/
+
+RDBOutputWidget::~RDBOutputWidget()
+{
+ delete m_rdbView;
+ delete m_userRDBCmdEditor;
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::clear()
+{
+ if (m_rdbView)
+ m_rdbView->clear();
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::slotReceivedStdout(const char* line)
+{
+ if (strncmp(line, "(rdb:", 5) == 0)
+ m_rdbView->append(QString("<font color=\"blue\">").append( line ).append("</font>") );
+ else
+ m_rdbView->append(line);
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::slotReceivedStderr(const char* line)
+{
+ m_rdbView->append(QString("<font color=\"red\">").append( line ).append("</font>") );
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::slotRDBCmd()
+{
+ QString RDBCmd(m_userRDBCmdEditor->currentText());
+ if (!RDBCmd.isEmpty())
+ {
+ m_userRDBCmdEditor->addToHistory(RDBCmd);
+ m_userRDBCmdEditor->clearEdit();
+ emit userRDBCmd(RDBCmd);
+ }
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::slotDbgStatus(const QString &, int statusFlag)
+{
+ if (statusFlag & s_dbgNotStarted)
+ {
+ m_Interrupt->setEnabled(false);
+ m_userRDBCmdEditor->setEnabled(false);
+ return;
+ }
+
+ if (statusFlag & s_appBusy)
+ {
+ m_Interrupt->setEnabled(true);
+ m_userRDBCmdEditor->setEnabled(false);
+ }
+ else
+ {
+ m_Interrupt->setEnabled(false);
+ m_userRDBCmdEditor->setEnabled(true);
+ }
+}
+
+/***************************************************************************/
+
+void RDBOutputWidget::focusInEvent(QFocusEvent */*e*/)
+{
+ m_userRDBCmdEditor->setFocus();
+}
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+}
+
+
+#include "rdboutputwidget.moc"
+
diff --git a/languages/ruby/debugger/rdboutputwidget.h b/languages/ruby/debugger/rdboutputwidget.h
new file mode 100644
index 00000000..ef466757
--- /dev/null
+++ b/languages/ruby/debugger/rdboutputwidget.h
@@ -0,0 +1,69 @@
+// *************************************************************************
+// gdboutputwidget.cpp - description
+// -------------------
+// begin : 10th April 2003
+// copyright : (C) 2003 by John Birch
+// email : jbb@kdevelop.org
+//
+// Adapted for ruby debugging
+// --------------------------
+// begin : Mon Nov 1 2004
+// copyright : (C) 2004 by Richard Dale
+// email : Richard_Dale@tipitina.demon.co.uk
+// **************************************************************************
+//
+// **************************************************************************
+// * *
+// * 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 _RDBOUTPUTWIDGET_H_
+#define _RDBOUTPUTWIDGET_H_
+
+#include <qwidget.h>
+
+class KHistoryCombo;
+
+class QTextEdit;
+class QToolButton;
+
+namespace RDBDebugger
+{
+
+class RDBOutputWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ RDBOutputWidget( QWidget *parent=0, const char *name=0 );
+ ~RDBOutputWidget();
+
+ void clear();
+
+public slots:
+ void slotReceivedStdout(const char* line);
+ void slotReceivedStderr(const char* line);
+ void slotDbgStatus (const QString &status, int statusFlag);
+
+ void slotRDBCmd();
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+signals:
+ void userRDBCmd(const QString &cmd);
+ void breakInto();
+
+private:
+ KHistoryCombo* m_userRDBCmdEditor;
+ QToolButton* m_Interrupt;
+ QTextEdit* m_rdbView;
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/rdbparser.cpp b/languages/ruby/debugger/rdbparser.cpp
new file mode 100644
index 00000000..7792acc5
--- /dev/null
+++ b/languages/ruby/debugger/rdbparser.cpp
@@ -0,0 +1,350 @@
+// **************************************************************************
+// begin : Tue Aug 17 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+//
+// Adapted for ruby debugging
+// --------------------------
+// begin : Mon Nov 1 2004
+// copyright : (C) 2004 by Richard Dale
+// email : Richard_Dale@tipitina.demon.co.uk
+// **************************************************************************
+
+// **************************************************************************
+// *
+// 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 "rdbparser.h"
+#include "variablewidget.h"
+
+#include <qregexp.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <kdebug.h>
+
+namespace RDBDebugger
+{
+
+
+// **************************************************************************
+
+void RDBParser::parseVariables(LazyFetchItem *parent, char *buf)
+{
+ static const char *unknown = "?";
+
+ QString varName;
+ QCString value;
+ int pos;
+
+ Q_ASSERT(parent);
+ if (buf == 0 || strlen(buf) == 0) {
+ return;
+ }
+
+ if (buf[0] == 0) {
+ buf = (char*)unknown;
+ }
+
+ QRegExp var_re("\\s*([^\\n\\s]+) => ([^\\n]+)");
+ QRegExp ref_re("(#<([^:]|::)+:0x[\\da-f]+)\\s*([^=]*)>?");
+ QRegExp struct_re("#<struct Struct::(\\w+)");
+
+ // Look for 'dataitem => value' pairs. For example:
+ // a => 1
+ // m => #<MyClass:0x30093540 @temp={"z"=>"zed", "p"=>"pee"}, @foobar="hello">
+ //
+ pos = var_re.search(buf);
+ if (pos != -1) {
+ while (pos != -1) {
+ varName = var_re.cap(1);
+ if (ref_re.search(var_re.cap(2)) != -1) {
+ if (var_re.cap(2).contains("=") > 0) {
+ value = (ref_re.cap(1) + ">").latin1();
+ } else {
+ // There are no 'name=value' pairs, as in #<Qt::Color:0x0 #ff0000>
+ value = var_re.cap(2).latin1();
+ }
+ } else if (struct_re.search(var_re.cap(2)) != -1) {
+ value = (QString("#<Struct::") + struct_re.cap(1) + ">").latin1();
+ } else {
+ value = var_re.cap(2).latin1();
+ }
+
+ DataType dataType = determineType((char *) var_re.cap(2).latin1());
+
+ // 'self' variables don't need to be expandable, as their details are
+ // already shown in the current frame. So always make them VALUE_TYPE's.
+ if (varName == "self") {
+ dataType = VALUE_TYPE;
+ }
+
+ setItem(parent, varName, dataType, value);
+
+ pos += var_re.matchedLength();
+ pos = var_re.search(buf, pos);
+ }
+
+ return;
+ }
+}
+
+void RDBParser::parseExpandedVariable(VarItem *parent, char *buf)
+{
+ DataType dataType;
+ int pos;
+ QString varName;
+ QCString value;
+ QRegExp ppref_re("(#<([^:]|::)+:0x[\\da-f]+)([^\\n>]*)(>?)");
+
+ switch (parent->dataType()) {
+ case REFERENCE_TYPE:
+ {
+ // Look for a reference type which has been printed via a 'pp' command, to
+ // expand its sub items on multiple lines. For example:
+ // #<MyClass:0x30093540
+ // @foobar="hello",
+ // @sleeper=#<Thread:0x3008fd18 sleep>,
+ // @temp={"z"=>"zed", "p"=>"pee"}>
+ //
+ QRegExp ppvalue_re("\\s*([^\\n\\s=]+)=([^\\n]+)[,>]");
+
+ pos = ppref_re.search(buf);
+ if (pos != -1) {
+ if (ppref_re.cap(4) != "") {
+ // The value is all on one line, so match against name=value
+ // pairs which can't have commas in their values
+ ppvalue_re = QRegExp("\\s*([^\\s=]+)=([^,>]+)([,>])");
+ }
+
+ pos = ppvalue_re.search(buf, pos);
+
+ while (pos != -1) {
+ varName = ppvalue_re.cap(1);
+
+ if (ppref_re.search(ppvalue_re.cap(2)) != -1) {
+ if (ppvalue_re.cap(2).contains("=") > 0) {
+ value = (ppref_re.cap(1) + ">").latin1();
+ } else {
+ // There are no 'name=value' pairs, as in #<Qt::Color:0x0 #ff0000>
+ value = ppvalue_re.cap(2).latin1();
+ }
+ } else {
+ value = ppvalue_re.cap(2).latin1();
+ }
+
+ dataType = determineType((char *) ppvalue_re.cap(2).latin1());
+ setItem(parent, varName, dataType, value);
+
+ pos += ppvalue_re.matchedLength();
+ pos = ppvalue_re.search(buf, pos);
+ }
+
+ }
+ return;
+ }
+
+ case ARRAY_TYPE:
+ {
+ // Look for a array type which has been printed via a 'pp' command, to
+ // expand its sub items. For example:
+ // [0]="hello"
+ // [1]=#"goodbye"
+ //
+ QRegExp pparray_re("\\s*([^=]+)=([^\\n]+)\\n");
+
+ pos = pparray_re.search(buf);
+
+ while (pos != -1) {
+ varName = pparray_re.cap(1);
+
+ if (ppref_re.search(pparray_re.cap(2)) != -1) {
+ value = (ppref_re.cap(1) + ">").latin1();
+ } else {
+ value = pparray_re.cap(2).latin1();
+ }
+
+ DataType dataType = determineType((char *) pparray_re.cap(2).latin1());
+ setItem(parent, varName, dataType, value);
+
+ pos += pparray_re.matchedLength();
+ pos = pparray_re.search(buf, pos);
+ }
+
+ return;
+ }
+
+ case HASH_TYPE:
+ {
+ // Look for a hash type which has been printed via a 'pp' command, to
+ // expand its sub items. For example:
+ // ["greeting"]="hello"
+ // ["farewell"]="goodbye"
+ //
+ QRegExp pphash_re("\\s*(\\[[^\\]]+\\])=([^\\n]+)\\n");
+ pos = pphash_re.search(buf);
+
+ while (pos != -1) {
+ varName = pphash_re.cap(1);
+ value = pphash_re.cap(2).latin1();
+ DataType dataType = determineType(value.data());
+ setItem(parent, varName, dataType, value);
+
+ pos += pphash_re.matchedLength();
+ pos = pphash_re.search(buf, pos);
+ }
+
+ return;
+ }
+
+ case STRUCT_TYPE:
+ {
+ // Look for a reference type which has been printed via a 'pp' command, to
+ // expand its sub items. For example:
+ // #<Struct::Customer
+ // @foobar="hello",
+ // @sleeper=#<Thread:0x3008fd18 sleep>,
+ // @temp={"z"=>"zed", "p"=>"pee"}>
+ //
+ QRegExp ppstruct_re("(#<Struct::\\w+)\\s([^\\n>]*)(>?)");
+ QRegExp ppvalue_re("\\s*([^\\n\\s=]+)=([^\\n]+)[,>]");
+
+ pos = ppstruct_re.search(buf);
+ if (pos != -1) {
+ if (ppstruct_re.cap(3) != "" && ppvalue_re.search(ppstruct_re.cap(0)) != -1) {
+ // The line ends with a '>', but we have this case now..
+ // If there is only one instance variable, pp puts everything
+ // on a single line:
+ // #<Struct::Customer @foobar="hello">
+ // So search for '@foobar="hello"', to use as the
+ // first name=value pair
+ pos = 0;
+ } else {
+ // Mltiple lines with name=value pairs:
+ // #<Struct::Customer
+ // @foobar="hello",
+ pos = ppvalue_re.search(buf, pos);
+ }
+
+ while (pos != -1) {
+ varName = ppvalue_re.cap(1);
+ value = ppvalue_re.cap(2).latin1();
+ dataType = determineType(value.data());
+ setItem(parent, varName, dataType, value);
+
+ pos += ppvalue_re.matchedLength();
+ pos = ppvalue_re.search(buf, pos);
+ }
+
+ }
+ return;
+ }
+
+ case STRING_TYPE:
+ {
+ // Look for a long String which has been printed via a 'pp' command, to
+ // show it as a sequence of 12 bytes slices in hex. For example:
+ // [0..11]=0x89504e470d0a1a0a0000000d
+ // [12..23]=0x494844520000001600000016
+ //
+ QRegExp ppstring_re("\\s*(\\[[^\\]]+\\])=([^\\n]+)\\n");
+ pos = ppstring_re.search(buf);
+
+ while (pos != -1) {
+ varName = ppstring_re.cap(1);
+ value = ppstring_re.cap(2).latin1();
+ DataType dataType = determineType(value.data());
+ setItem(parent, varName, dataType, value);
+
+ pos += ppstring_re.matchedLength();
+ pos = ppstring_re.search(buf, pos);
+ }
+
+ return;
+ }
+
+ default:
+ Q_ASSERT(false);
+ }
+
+ return;
+}
+
+
+// **************************************************************************
+
+void RDBParser::setItem(LazyFetchItem *parent, const QString &varName,
+ DataType dataType, const QCString &value)
+{
+ VarItem *item = parent->findItem(varName);
+ if (item == 0) {
+ item = new VarItem(parent, varName, dataType);
+ } else {
+ // The dataType of an item can change, so update it
+ item->setDataType(dataType);
+ }
+
+ switch (dataType) {
+ case HASH_TYPE:
+ case ARRAY_TYPE:
+ case REFERENCE_TYPE:
+ case STRUCT_TYPE:
+ case STRING_TYPE:
+ item->setText(VALUE_COLUMN, value);
+ item->setExpandable(true);
+ item->update();
+ break;
+
+ case COLOR_TYPE:
+ case VALUE_TYPE:
+ item->setText(VALUE_COLUMN, value);
+ item->setExpandable(false);
+ break;
+
+ default:
+ break;
+ }
+}
+
+// **************************************************************************
+
+DataType RDBParser::determineType(char *buf)
+{
+ QRegExp array_re("(Array \\(\\d+ element\\(s\\)\\))");
+ QRegExp hash_re("(Hash \\(\\d+ element\\(s\\)\\))");
+ QRegExp string_re("(String \\(length \\d+\\))");
+
+ if (qstrncmp(buf, "#<struct", strlen("#<struct")) == 0) {
+ return STRUCT_TYPE;
+ } else if (qstrncmp(buf, "#<Qt::Color:0x", strlen("#<Qt::Color:0x")) == 0) {
+ return COLOR_TYPE;
+ } else if (qstrncmp(buf, "#<", strlen("#<")) == 0 && strstr(buf, "=") != 0) {
+ // An object instance reference is only expandable and a 'REFERENCE_TYPE'
+ // if it contains an '=' (ie it has at least one '@instance_variable=value').
+ // Otherwise, treat it as a 'VALUE_TYPE'.
+ return REFERENCE_TYPE;
+ } else if (array_re.search(buf) != -1) {
+ return ARRAY_TYPE;
+ } else if (hash_re.search(buf) != -1) {
+ return HASH_TYPE;
+ } else if (string_re.search(buf) != -1) {
+ return STRING_TYPE;
+ } else if (qstrncmp(buf, "nil", strlen("nil")) == 0) {
+// return UNKNOWN_TYPE;
+ return VALUE_TYPE;
+ } else {
+ return VALUE_TYPE;
+ }
+}
+
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+}
diff --git a/languages/ruby/debugger/rdbparser.h b/languages/ruby/debugger/rdbparser.h
new file mode 100644
index 00000000..12bc937e
--- /dev/null
+++ b/languages/ruby/debugger/rdbparser.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ begin : Tue Aug 17 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _RDBPARSER_H_
+#define _RDBPARSER_H_
+
+#include "variablewidget.h"
+
+namespace RDBDebugger
+{
+
+namespace RDBParser
+{
+ void parseVariables(LazyFetchItem *parent, char *buf);
+ void parseExpandedVariable(VarItem *parent, char *buf);
+ DataType determineType(char *buf);
+ void setItem( LazyFetchItem *parent, const QString &varName,
+ DataType dataType, const QCString &value );
+}
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/rdbtable.cpp b/languages/ruby/debugger/rdbtable.cpp
new file mode 100644
index 00000000..2f470b2d
--- /dev/null
+++ b/languages/ruby/debugger/rdbtable.cpp
@@ -0,0 +1,62 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* *
+* *
+* Adapted for ruby debugging *
+* -------------------------- *
+* begin : Mon Nov 1 2004 *
+* copyright : (C) 2004 by Richard Dale *
+* email : Richard_Dale@tipitina.demon.co.uk *
+* *
+* 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 "rdbtable.h"
+
+namespace RDBDebugger {
+
+RDBTable::RDBTable(QWidget *parent, const char *name)
+ : QTable(parent, name)
+{
+}
+
+RDBTable::RDBTable(int nr, int nc, QWidget * parent, const char * name)
+ : QTable(nr, nc, parent, name)
+{
+}
+
+RDBTable::~RDBTable()
+{
+}
+
+void RDBTable::keyPressEvent( QKeyEvent * e )
+{
+ emit keyPressed(e->key());
+
+ if (e->key() == Key_Return)
+ emit returnPressed();
+ else if (e->key() == Key_F2)
+ emit f2Pressed();
+ else if ((e->text() == QString("a")) && (e->state() == AltButton))
+ {
+ emit insertPressed();
+ return;
+ }
+ else if ((e->text() == QString("A")) && (e->state() == AltButton))
+ {
+ emit insertPressed();
+ return;
+ }
+ else if (e->key() == Key_Delete)
+ emit deletePressed();
+
+ QTable::keyPressEvent(e);
+}
+
+}
+
+#include "rdbtable.moc"
+
diff --git a/languages/ruby/debugger/rdbtable.h b/languages/ruby/debugger/rdbtable.h
new file mode 100644
index 00000000..04f47c2b
--- /dev/null
+++ b/languages/ruby/debugger/rdbtable.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+* Copyright (C) 2003 by Alexander Dymo *
+* cloudtemple@mksat.net *
+* *
+* Adapted for ruby debugging *
+* -------------------------- *
+* begin : Mon Nov 1 2004 *
+* copyright : (C) 2004 by Richard Dale *
+* email : Richard_Dale@tipitina.demon.co.uk *
+* *
+* 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 RDBDEBUGGERRDBTABLE_H
+#define RDBDEBUGGERRDBTABLE_H
+
+#include <qtable.h>
+
+namespace RDBDebugger {
+
+class RDBTable : public QTable
+{
+Q_OBJECT
+public:
+ RDBTable(QWidget *parent = 0, const char *name = 0);
+ RDBTable( int numRows, int numCols, QWidget * parent = 0, const char * name = 0 );
+ ~RDBTable();
+
+ virtual void keyPressEvent ( QKeyEvent * e );
+
+signals:
+ void keyPressed(int key);
+
+ void returnPressed();
+ void f2Pressed();
+ void insertPressed();
+ void deletePressed();
+};
+
+}
+
+#endif
+
diff --git a/languages/ruby/debugger/stty.cpp b/languages/ruby/debugger/stty.cpp
new file mode 100644
index 00000000..44cb3795
--- /dev/null
+++ b/languages/ruby/debugger/stty.cpp
@@ -0,0 +1,370 @@
+/***************************************************************************
+ begin : Mon Sep 13 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ This code was originally written by Judin Maxim, from the
+ KDEStudio project.
+
+ It was then updated with later code from konsole (KDE).
+
+ It has also been enhanced with an idea from the code in kdbg
+ written by Johannes Sixt<Johannes.Sixt@telecom.at>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef __osf__
+#define _XOPEN_SOURCE_EXTENDED
+#define O_NDELAY O_NONBLOCK
+#endif
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#ifdef HAVE_SYS_STROPTS_H
+#include <sys/stropts.h>
+#define _NEW_TTY_CTRL
+#endif
+
+#include <assert.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <termios.h>
+#include <time.h>
+#include <unistd.h>
+
+#if defined (_HPUX_SOURCE)
+#define _TERMIOS_INCLUDED
+#include <bsdtty.h>
+#endif
+
+#include <qintdict.h>
+#include <qsocketnotifier.h>
+#include <qstring.h>
+#include <qfile.h>
+
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+
+#include "stty.h"
+
+#define PTY_FILENO 3
+#define BASE_CHOWN "konsole_grantpty"
+
+namespace RDBDebugger
+{
+
+static int chownpty(int fd, int grant)
+// param fd: the fd of a master pty.
+// param grant: 1 to grant, 0 to revoke
+// returns 1 on success 0 on fail
+{
+ void(*tmp)(int) = signal(SIGCHLD,SIG_DFL);
+ pid_t pid = fork();
+ if (pid < 0) {
+ signal(SIGCHLD,tmp);
+ return 0;
+ }
+ if (pid == 0) {
+ /* We pass the master pseudo terminal as file descriptor PTY_FILENO. */
+ if (fd != PTY_FILENO && dup2(fd, PTY_FILENO) < 0)
+ ::exit(1);
+
+ QString path = locate("exe", BASE_CHOWN);
+ execle(QFile::encodeName(path), BASE_CHOWN, grant?"--grant":"--revoke", (void *)0, NULL);
+ ::exit(1); // should not be reached
+ }
+ if (pid > 0) {
+ int w;
+ // retry:
+ int rc = waitpid (pid, &w, 0);
+ if (rc != pid)
+ ::exit(1);
+
+ // { // signal from other child, behave like catchChild.
+ // // guess this gives quite some control chaos...
+ // Shell* sh = shells.find(rc);
+ // if (sh) { shells.remove(rc); sh->doneShell(w); }
+ // goto retry;
+ // }
+ signal(SIGCHLD,tmp);
+ return (rc != -1 && WIFEXITED(w) && WEXITSTATUS(w) == 0);
+ }
+ signal(SIGCHLD,tmp);
+ return 0; //dummy.
+}
+
+// **************************************************************************
+
+STTY::STTY(bool ext, const QString &termAppName)
+ : QObject(),
+ out(0),
+ err(0),
+ ttySlave(""),
+ pid_(0)
+{
+ if (ext) {
+ findExternalTTY(termAppName);
+ } else {
+ fout = findTTY();
+ if (fout >= 0) {
+ ttySlave = QString(tty_slave);
+ out = new QSocketNotifier(fout, QSocketNotifier::Read, this);
+ connect( out, SIGNAL(activated(int)), this, SLOT(OutReceived(int)) );
+ }
+ }
+}
+
+// **************************************************************************
+
+STTY::~STTY()
+{
+ if (pid_)
+ ::kill(pid_, SIGTERM);
+
+ if (out) {
+ ::close(fout);
+ delete out;
+ }
+
+ // if ( err )
+ // {
+ // ::close( ferr );
+ // delete err;
+ // }
+}
+
+// **************************************************************************
+
+int STTY::findTTY()
+{
+ int ptyfd = -1;
+ bool needGrantPty = TRUE;
+
+ // Find a master pty that we can open ////////////////////////////////
+
+#ifdef __sgi__
+ ptyfd = open("/dev/ptmx",O_RDWR);
+ if (ptyfd < 0) {
+ perror("Can't open a pseudo teletype");
+ return(-1);
+ }
+ strncpy(tty_slave, ptsname(ptyfd), 50);
+ grantpt(ptyfd);
+ unlockpt(ptyfd);
+ needGrantPty = FALSE;
+#endif
+
+ // first we try UNIX PTY's
+#ifdef TIOCGPTN
+ strcpy(pty_master,"/dev/ptmx");
+ strcpy(tty_slave,"/dev/pts/");
+ ptyfd = open(pty_master,O_RDWR);
+ if (ptyfd >= 0) { // got the master pty
+ int ptyno;
+ if (ioctl(ptyfd, TIOCGPTN, &ptyno) == 0) {
+ struct stat sbuf;
+ sprintf(tty_slave,"/dev/pts/%d",ptyno);
+ if (stat(tty_slave,&sbuf) == 0 && S_ISCHR(sbuf.st_mode))
+ needGrantPty = FALSE;
+ else {
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ } else {
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ }
+#endif
+
+#if defined(_SCO_DS) || defined(__USLC__) /* SCO OSr5 and UnixWare */
+ if (ptyfd < 0) {
+ for (int idx = 0; idx < 256; idx++)
+ { sprintf(pty_master, "/dev/ptyp%d", idx);
+ sprintf(tty_slave, "/dev/ttyp%d", idx);
+ if (access(tty_slave, F_OK) < 0) { idx = 256; break; }
+ if ((ptyfd = open (pty_master, O_RDWR)) >= 0)
+ { if (access (tty_slave, R_OK|W_OK) == 0) break;
+ close(ptyfd); ptyfd = -1;
+ }
+ }
+ }
+#endif
+ if (ptyfd < 0) { /// \FIXME Linux, Trouble on other systems?
+ for (const char* s3 = "pqrstuvwxyzabcde"; *s3 != 0; s3++) {
+ for (const char* s4 = "0123456789abcdef"; *s4 != 0; s4++) {
+ sprintf(pty_master,"/dev/pty%c%c",*s3,*s4);
+ sprintf(tty_slave,"/dev/tty%c%c",*s3,*s4);
+ if ((ptyfd = open(pty_master, O_RDWR)) >= 0) {
+ if (geteuid() == 0 || access(tty_slave, R_OK|W_OK) == 0)
+ break;
+
+ close(ptyfd);
+ ptyfd = -1;
+ }
+ }
+
+ if (ptyfd >= 0)
+ break;
+ }
+ }
+
+ if (ptyfd >= 0) {
+ if (needGrantPty && !chownpty(ptyfd, TRUE)) {
+ fprintf(stderr,"kdevelop: chownpty failed for device %s::%s.\n",pty_master,tty_slave);
+ fprintf(stderr," : This means the session can be eavesdroped.\n");
+ fprintf(stderr," : Make sure konsole_grantpty is installed and setuid root.\n");
+ }
+
+ ::fcntl(ptyfd, F_SETFL, O_NDELAY);
+#ifdef TIOCSPTLCK
+ int flag = 0;
+ ioctl(ptyfd, TIOCSPTLCK, &flag); // unlock pty
+#endif
+ }
+
+ return ptyfd;
+}
+
+// **************************************************************************
+
+void STTY::OutReceived(int f)
+{
+ char buf[1024];
+ int n;
+
+ // read until socket is empty. We shouldn't be receiving a continuous
+ // stream of data, so the loop is unlikely to cause problems.
+ while ((n = ::read(f, buf, sizeof(buf)-1)) > 0) {
+ *(buf+n) = 0; // a standard string
+ if ( f == fout )
+ emit OutOutput(buf);
+ else
+ emit ErrOutput(buf);
+ }
+}
+
+// **************************************************************************
+
+#define FIFO_FILE "/tmp/debug_tty.XXXXXX"
+
+bool STTY::findExternalTTY(const QString &termApp)
+{
+ QString appName(termApp.isEmpty() ? QString("xterm") : termApp);
+
+ char fifo[] = FIFO_FILE;
+ int fifo_fd;
+ if ((fifo_fd = mkstemp(fifo)) == -1)
+ return false;
+
+ ::close(fifo_fd);
+ ::unlink(fifo);
+
+ // create a fifo that will pass in the tty name
+#ifdef HAVE_MKFIFO
+ if (::mkfifo(fifo, S_IRUSR|S_IWUSR) < 0)
+#else
+ if (::mknod(fifo, S_IFIFO | S_IRUSR|S_IWUSR, 0) < 0)
+#endif
+ return false;
+
+ int pid = ::fork();
+ if (pid < 0) { // No process
+ ::unlink(fifo);
+ return false;
+ }
+
+ if (pid == 0) { // child process
+ /*
+ * Spawn a console that in turn runs a shell script that passes us
+ * back the terminal name and then only sits and waits.
+ */
+
+ const char* prog = appName.latin1();
+ QString script = QString("tty>") + QString(fifo) +
+ QString(";" // fifo name
+ "trap \"\" INT QUIT TSTP;" // ignore various signals
+ "exec<&-;exec>&-;" // close stdin and stdout
+ "while :;do sleep 3600;done");
+ const char* scriptStr = script.latin1();
+ const char* end = 0;
+
+ if ( termApp == "konsole" )
+ {
+ ::execlp( prog, prog,
+ "-caption", i18n("kdevelop: Debug application console").local8Bit().data(),
+ "-e", "sh",
+ "-c", scriptStr,
+ end);
+ }
+ else
+ {
+ ::execlp( prog, prog,
+ "-e", "sh",
+ "-c", scriptStr,
+ end);
+ }
+
+ // Should not get here, as above should always work
+ ::exit(1);
+ }
+
+ // parent process
+ if (pid <= 0)
+ ::exit(1);
+
+ // Open the communication between us (the parent) and the
+ // child (the process running on a tty console)
+ fifo_fd = ::open(fifo, O_RDONLY);
+ if (fifo_fd < 0)
+ return false;
+
+ // Get the ttyname from the fifo buffer that the child process
+ // has sent.
+ char ttyname[50];
+ int n = ::read(fifo_fd, ttyname, sizeof(ttyname)-sizeof(char));
+
+ ::close(fifo_fd);
+ ::unlink(fifo);
+
+ // No name??
+ if (n <= 0)
+ return false;
+
+ // remove whitespace
+ ttyname[n] = 0;
+ if (char* newline = strchr(ttyname, '\n'))
+ *newline = 0; // clobber the new line
+
+ ttySlave = ttyname;
+ pid_ = pid;
+
+ return true;
+}
+
+}
+
+// **************************************************************************
+#include "stty.moc"
diff --git a/languages/ruby/debugger/stty.h b/languages/ruby/debugger/stty.h
new file mode 100644
index 00000000..31c8fbfe
--- /dev/null
+++ b/languages/ruby/debugger/stty.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ begin : Mon Sep 13 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ This code was originally written by Judin Maxim, from the
+ KDEStudio project.
+
+ It was then updated with later code from konsole (KDE).
+
+ It has also been enhanced with an idea from the code in kdbg
+ written by Johannes Sixt<Johannes.Sixt@telecom.at>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _STTY_H_
+#define _STTY_H_
+
+class QSocketNotifier;
+
+#include <qobject.h>
+#include <qstring.h>
+
+namespace RDBDebugger
+{
+
+class STTY : public QObject
+{
+ Q_OBJECT
+
+public:
+ STTY(bool ext=false, const QString &termAppName=QString());
+ ~STTY();
+
+ QString getSlave() { return ttySlave; };
+
+private slots:
+ void OutReceived(int);
+
+signals:
+ void OutOutput(const char *);
+ void ErrOutput(const char*);
+
+private:
+ int findTTY();
+ bool findExternalTTY(const QString &termApp);
+
+private:
+ int fout;
+ int ferr;
+ QSocketNotifier *out;
+ QSocketNotifier *err;
+ QString ttySlave;
+ int pid_;
+
+ char pty_master[50]; // "/dev/ptyxx" | "/dev/ptmx"
+ char tty_slave[50]; // "/dev/ttyxx" | "/dev/pts/########..."
+};
+
+}
+
+#endif
diff --git a/languages/ruby/debugger/variablewidget.cpp b/languages/ruby/debugger/variablewidget.cpp
new file mode 100644
index 00000000..0dbdce9a
--- /dev/null
+++ b/languages/ruby/debugger/variablewidget.cpp
@@ -0,0 +1,1018 @@
+// **************************************************************************
+// begin : Sun Aug 8 1999
+// copyright : (C) 1999 by John Birch
+// email : jbb@kdevelop.org
+//
+// Adapted for ruby debugging
+// --------------------------
+// begin : Mon Nov 1 2004
+// copyright : (C) 2004 by Richard Dale
+// email : Richard_Dale@tipitina.demon.co.uk
+// **************************************************************************
+
+// **************************************************************************
+// * *
+// * 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 "variablewidget.h"
+#include "rdbparser.h"
+#include "rdbcommand.h"
+
+#include <kdebug.h>
+#include <kpopupmenu.h>
+#include <klineedit.h>
+#include <kdeversion.h>
+
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qhbox.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qcursor.h>
+#include <klocale.h>
+
+#include <qpoint.h>
+#include <qclipboard.h>
+#include <kapplication.h>
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+namespace RDBDebugger
+{
+
+VariableWidget::VariableWidget(QWidget *parent, const char *name)
+ : QWidget(parent, name)
+{
+ varTree_ = new VariableTree(this);
+ QLabel *label = new QLabel(i18n("E&xpression to watch:"), this);
+
+ QHBox *watchEntry = new QHBox( this );
+ watchVarEditor_ = new KHistoryCombo( watchEntry, "var-to-watch editor");
+ label->setBuddy(watchVarEditor_);
+
+ QPushButton *addButton = new QPushButton(i18n("&Add"), watchEntry );
+ addButton->adjustSize();
+ addButton->setFixedWidth(addButton->width());
+
+ QBoxLayout * vbox = new QVBoxLayout();
+ vbox->addWidget( label );
+ vbox->addWidget( watchEntry );
+
+ QVBoxLayout *topLayout = new QVBoxLayout(this, 2);
+ topLayout->addWidget(varTree_, 10);
+ topLayout->addLayout( vbox );
+
+ connect( addButton, SIGNAL(clicked()), SLOT(slotAddWatchExpression()) );
+ connect( watchVarEditor_, SIGNAL(returnPressed()), SLOT(slotAddWatchExpression()) );
+}
+
+
+// **************************************************************************
+
+void VariableWidget::setEnabled(bool bEnabled)
+{
+ QWidget::setEnabled(bEnabled);
+ if (bEnabled && parentWidget() != 0) {
+ varTree_->setColumnWidth(0, parentWidget()->width()/2);
+ }
+}
+// **************************************************************************
+
+void VariableWidget::slotAddWatchExpression()
+{
+ QString watchVar(watchVarEditor_->currentText());
+ if (!watchVar.isEmpty()) {
+ slotAddWatchExpression(watchVar);
+ }
+}
+
+// **************************************************************************
+
+void VariableWidget::slotAddWatchExpression(const QString &ident)
+{
+ if (!ident.isEmpty()) {
+ watchVarEditor_->addToHistory(ident);
+ varTree_->slotAddWatchExpression(ident);
+ watchVarEditor_->clearEdit();
+ }
+}
+
+// **************************************************************************
+
+void VariableWidget::focusInEvent(QFocusEvent */*e*/)
+{
+ varTree_->setFocus();
+}
+
+void VariableWidget::restorePartialProjectSession(const QDomElement* el)
+{
+ varTree_->watchRoot()->restorePartialProjectSession(el);
+}
+
+void VariableWidget::savePartialProjectSession(QDomElement* el)
+{
+ varTree_->watchRoot()->savePartialProjectSession(el);
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+VariableTree::VariableTree(VariableWidget *parent, const char *name)
+ : KListView(parent, name),
+ QToolTip( viewport() ),
+ activationId_(0),
+ currentThread_(-1),
+ selectedFrame_(0),
+ watchRoot_(0),
+ globalRoot_(0)
+{
+ setRootIsDecorated(true);
+ setAllColumnsShowFocus(true);
+ setColumnWidthMode(0, Manual);
+ setSorting(VAR_NAME_COLUMN);
+ QListView::setSelectionMode(QListView::Single);
+
+ addColumn(i18n("Variable"), 100 );
+ addColumn(i18n("Value"), 100 );
+
+ connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ SLOT(slotContextMenu(KListView*, QListViewItem*)) );
+
+ connect( this, SIGNAL(pressed(QListViewItem*)),
+ this, SLOT(slotPressed(QListViewItem*)) );
+
+ watchRoot_ = new WatchRoot(this);
+}
+
+// **************************************************************************
+
+VariableTree::~VariableTree()
+{
+}
+
+// **************************************************************************
+
+void VariableTree::clear()
+{
+ QListViewItem *sibling = firstChild();
+ while (sibling != 0) {
+ QListViewItem * current = sibling;
+ sibling = sibling->nextSibling();
+ if (current->rtti() != RTTI_WATCH_ROOT) {
+ delete current;
+ }
+ }
+
+ globalRoot_ = 0;
+ selectedFrame_ = 0;
+ return;
+}
+
+// **************************************************************************
+
+void VariableTree::slotContextMenu(KListView *, QListViewItem *item)
+{
+ if (item == 0)
+ return;
+
+ setSelected(item, true); // Need to select this item.
+
+ if (item->parent() != 0) {
+ KPopupMenu popup(this);
+ popup.insertTitle(item->text(VAR_NAME_COLUMN));
+ int idRemoveWatch = -2;
+ if (item->rtti() == RTTI_WATCH_VAR_ITEM) {
+ idRemoveWatch = popup.insertItem( i18n("Remove Watch Expression") );
+ }
+
+ int idCopyToClipboard = popup.insertItem( i18n("Copy to Clipboard") );
+ int res = popup.exec(QCursor::pos());
+
+ if (res == idRemoveWatch) {
+ emit removeWatchExpression(((WatchVarItem*)item)->displayId());
+ delete item;
+ } else if (res == idCopyToClipboard) {
+ QClipboard *qb = KApplication::clipboard();
+ QString text = "{ \"" + item->text( VAR_NAME_COLUMN ) + "\", " +
+ "\"" + item->text( VALUE_COLUMN ) + "\" }";
+
+ qb->setText( text, QClipboard::Clipboard );
+ }
+ }
+}
+
+/***************************************************************************/
+
+void VariableTree::setSelected(QListViewItem * item, bool selected)
+{
+ // Save the last selected VarFrameRoot for slotPressed() to restore
+ if (item->rtti() == RTTI_VAR_FRAME_ROOT && selected) {
+ selectedFrame_ = (VarFrameRoot *) item;
+ }
+
+ QListView::setSelected(item, selected);
+}
+
+/***************************************************************************/
+
+// Makes sure that only VarFrameRoot items can be selected
+void VariableTree::slotPressed(QListViewItem * item)
+{
+ if (item == 0) {
+ return;
+ }
+
+ while (item->rtti() == RTTI_VAR_ITEM) {
+ item = item->parent();
+ }
+
+ if ( item->rtti() == RTTI_GLOBAL_ROOT
+ || item->rtti() == RTTI_WATCH_ROOT
+ || item->rtti() == RTTI_WATCH_VAR_ITEM )
+ {
+ if (selectedFrame_ != 0) {
+ setSelected(selectedFrame_, true);
+ }
+ return;
+ }
+
+ if (item->rtti() == RTTI_VAR_FRAME_ROOT) {
+ VarFrameRoot * frame = (VarFrameRoot*) item;
+ emit selectFrame(frame->frameNo(), frame->threadNo());
+ }
+
+ return;
+}
+
+// **************************************************************************
+
+void VariableTree::prune()
+{
+ QListViewItem *child = firstChild();
+
+ while (child != 0) {
+ QListViewItem *nextChild = child->nextSibling();
+
+ // Only prune var frames, not the watch or global root
+ if (child->rtti() == RTTI_VAR_FRAME_ROOT) {
+ if (((VarFrameRoot*) child)->isActive()) {
+ if (child->isOpen()) {
+ ((VarFrameRoot*) child)->prune();
+ }
+ } else {
+ delete child;
+ }
+ }
+
+ child = nextChild;
+ }
+}
+
+// **************************************************************************
+
+// The debugger has moved onto the next program pause, so invalidate
+// everything in the Variable Tree
+void VariableTree::nextActivationId()
+{
+ activationId_++;
+ globalRoot()->setActivationId();
+ watchRoot()->setActivationId();
+ // ..but that's only the Watch and Global roots
+}
+
+// **************************************************************************
+
+// VarFrameRoot frames in the Variable Tree from the previous program pause,
+// are set active here. Notified by the Frame Stack widget when it parses the
+// backtrace from the 'where' command after a pause.
+//
+// After that, any frames which aren't marked as active must have gone
+// out of scope and will end up pruned.
+void VariableTree::slotFrameActive(int frameNo, int threadNo, const QString& frameName)
+{
+ VarFrameRoot * frame = findFrame(frameNo, threadNo);
+ if (frameNo == 1) {
+ // If the current frame 1 doesn't exist, create it
+ if (frame == 0) {
+ frame = new VarFrameRoot(this, frameNo, threadNo);
+ }
+
+ frame->setFrameName(frameName);
+ }
+
+ if (frame != 0 && frame->text(VAR_NAME_COLUMN) == frameName) {
+ frame->setActivationId();
+ }
+}
+
+// **************************************************************************
+
+bool VariableTree::schedule()
+{
+ QListViewItem * child = firstChild();
+ VarFrameRoot * frame = 0;
+
+ while (child != 0) {
+ if (child->rtti() == RTTI_VAR_FRAME_ROOT) {
+ frame = (VarFrameRoot *) child;
+ Q_ASSERT( !frame->isWaitingForData() );
+
+ if (frame->needsVariables()) {
+ if (QApplication::overrideCursor() == 0) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ }
+
+ // Tell the controller to fetch the variable values
+ emit selectFrame(frame->frameNo(), frame->threadNo());
+ return true;
+ }
+ }
+
+ child = child->nextSibling();
+ }
+
+ frame = findFrame(1, currentThread_);
+ Q_ASSERT( frame != 0 );
+ Q_ASSERT( !frame->needsVariables() );
+
+ // All over, nothing left to fetch.
+ // Return to frame 1, and prune the inactive items
+ // from the variable tree..
+ QApplication::restoreOverrideCursor();
+ emit selectFrame(1, currentThread_);
+ prune();
+
+ return false;
+}
+
+// **************************************************************************
+
+void VariableTree::slotAddWatchExpression(const QString &watchVar)
+{
+ new WatchVarItem(watchRoot(), watchVar, UNKNOWN_TYPE);
+ emit addWatchExpression(watchVar, true);
+}
+
+
+// **************************************************************************
+
+void VariableTree::setFetchGlobals(bool fetch)
+{
+ emit fetchGlobals(fetch);
+}
+
+// **************************************************************************
+
+VarFrameRoot *VariableTree::findFrame(int frameNo, int threadNo) const
+{
+ // frames only exist on the top level so we only need to
+ // check the siblings
+ QListViewItem *sibling = firstChild();
+ while (sibling != 0) {
+ if ( sibling->rtti() == RTTI_VAR_FRAME_ROOT
+ && ((VarFrameRoot*) sibling)->frameNo() == frameNo
+ && ((VarFrameRoot*) sibling)->threadNo() == threadNo )
+ {
+ return (VarFrameRoot*) sibling;
+ }
+
+ sibling = sibling->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+
+WatchRoot *VariableTree::watchRoot()
+{
+ return watchRoot_;
+}
+
+// **************************************************************************
+
+GlobalRoot *VariableTree::globalRoot()
+{
+ if (globalRoot_ == 0) {
+ globalRoot_ = new GlobalRoot(this);
+ }
+
+ return globalRoot_;
+}
+
+// **************************************************************************
+
+// Watch variables can be added before the start of a debugging session,
+// so tell the controller about any already in the tree at start.
+void VariableTree::resetWatchVars()
+{
+ for (QListViewItem *child = watchRoot()->firstChild(); child != 0; child = child->nextSibling()) {
+ ((WatchVarItem*) child)->setDisplayId(-1);
+ emit addWatchExpression(child->text(VAR_NAME_COLUMN), false);
+ }
+}
+
+// **************************************************************************
+
+void VariableTree::maybeTip(const QPoint &p)
+{
+ VarItem * item = dynamic_cast<VarItem*>( itemAt(p) );
+ if (item != 0) {
+ QRect r = itemRect(item);
+ if (r.isValid()) {
+ tip(r, item->tipText());
+ }
+ }
+}
+
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+LazyFetchItem::LazyFetchItem(VariableTree *parent)
+ : KListViewItem(parent),
+ activationId_(0),
+ waitingForData_(false)
+{
+ setActivationId();
+}
+
+// **************************************************************************
+
+LazyFetchItem::LazyFetchItem(LazyFetchItem *parent)
+ : KListViewItem(parent),
+ activationId_(0),
+ waitingForData_(false)
+{
+ setActivationId();
+}
+
+// **************************************************************************
+
+LazyFetchItem::~LazyFetchItem()
+{
+}
+
+// **************************************************************************
+
+void LazyFetchItem::paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int align)
+{
+ if (p == 0) {
+ return;
+ }
+
+ // make toplevel item (watch and frame items) names bold
+ if (column == VAR_NAME_COLUMN && parent() == 0) {
+ QFont f = p->font();
+ f.setBold(true);
+ p->setFont(f);
+ }
+
+ QListViewItem::paintCell( p, cg, column, width, align );
+}
+
+// **************************************************************************
+
+VarItem *LazyFetchItem::findItem(const QString &name) const
+{
+ QListViewItem *child = firstChild();
+
+ // Check the siblings on this branch
+ while (child != 0) {
+ if (child->text(VAR_NAME_COLUMN) == name) {
+ return (VarItem*) child;
+ }
+
+ child = child->nextSibling();
+ }
+
+ return 0;
+}
+
+// **************************************************************************
+
+void LazyFetchItem::prune()
+{
+ QListViewItem *child = firstChild();
+
+ while (child != 0) {
+ LazyFetchItem *item = (LazyFetchItem*) child;
+ child = child->nextSibling();
+ // Never prune a branch if we are waiting on data to arrive.
+ if (!waitingForData_) {
+ if (item->isActive()) {
+ item->prune();
+ } else {
+ delete item;
+ }
+ }
+ }
+}
+
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+VarItem::VarItem(LazyFetchItem *parent, const QString &varName, DataType dataType)
+ : LazyFetchItem (parent),
+ cache_(QCString()),
+ dataType_(dataType),
+ highlight_(false)
+{
+ setText(VAR_NAME_COLUMN, varName);
+ setSelectable(false);
+
+ // Order the VarItems so that globals are first, then
+ // constants, class variables, instance variables and
+ // finally local variables
+
+ // Matches either an array element or a string slice,
+ // Order on the array index or the first number in the
+ // range specifying the slice.
+ QRegExp arrayelement_re("\\[(\\d+)(\\.\\.\\d+)?\\]");
+ key_ = varName;
+
+ if (arrayelement_re.search(varName) != -1) {
+ key_.sprintf("%.6d", arrayelement_re.cap(1).toInt());
+ } else if (key_.startsWith("$")) {
+ key_.prepend("1001"); // Global variable
+ } else if (QRegExp("^[A-Z]").search(varName) != -1) {
+ key_.prepend("1002"); // Constant
+ } else if (key_.startsWith("@@")) {
+ key_.prepend("1003"); // Class variable
+ } else if (key_.startsWith("@")) {
+ key_.prepend("1004"); // Instance variable
+ } else {
+ key_.prepend("1005"); // Local variable or parameter
+ }
+
+// kdDebug(9012) << " ### VarItem::VarItem *CONSTR* " << varName << endl;
+}
+
+// **************************************************************************
+
+VarItem::~VarItem()
+{
+}
+
+QString VarItem::key(int /*column*/, bool /*ascending*/) const
+{
+ return key_;
+}
+
+// **************************************************************************
+
+// Returns the path of a ruby item. If it is an instance variable, assume
+// that there is an attr_accessor method for it.
+// For example, @foobar within instance obj is accessed as obj.foobar.
+// But don't strip off the @ for an instance variable with no path,
+// and leave a plain '@foobar' as it is.
+QString VarItem::fullName() const
+{
+ QString itemName = text(VAR_NAME_COLUMN);
+ QString vPath("");
+ const VarItem *item = this;
+
+ if (item->parent()->rtti() != RTTI_VAR_ITEM) {
+ return itemName;
+ }
+
+ // This stops at the root item (FrameRoot or GlobalRoot)
+ while (item->rtti() == RTTI_VAR_ITEM) {
+ QString itemName = item->text(VAR_NAME_COLUMN);
+
+ if (vPath.startsWith("[")) {
+ // If it's a Hash or an Array, then just insert the value. As
+ // in adding '[0]' to foo.bar to give foo.bar[0]
+ vPath.prepend(itemName);
+ } else {
+ if (vPath.isEmpty()) {
+ vPath = itemName;
+ } else {
+ vPath.prepend(itemName + ".");
+ }
+ }
+ item = (VarItem*) item->parent();
+ }
+
+ // Change 'self.@foobar' to '@foobar'
+ vPath.replace(QRegExp("^self\\.@"), "@");
+
+ // Use instance_variable_get() to access any '@var's in the middle of a path
+ QRegExp re_instance_var("\\.(@[^\\[.]+)");
+ int pos = re_instance_var.search(vPath);
+ while (pos != -1) {
+ vPath.replace( pos,
+ re_instance_var.matchedLength(),
+ QString(".instance_variable_get(:") + re_instance_var.cap(1) + ")" );
+ pos = re_instance_var.search(vPath, pos);
+ }
+
+ return vPath;
+}
+
+// **************************************************************************
+
+void VarItem::setText(int column, const QString &data)
+{
+ setActivationId();
+
+ if (column == VALUE_COLUMN) {
+ highlight_ = (!text(VALUE_COLUMN).isEmpty() && text(VALUE_COLUMN) != data);
+ }
+
+ QListViewItem::setText(column, data);
+ repaint();
+}
+
+// **************************************************************************
+
+void VarItem::expandValue(char *buf)
+{
+ LazyFetchItem::stopWaitingForData();
+ RDBParser::parseExpandedVariable(this, buf);
+}
+
+// **************************************************************************
+
+void VarItem::setOpen(bool open)
+{
+ QListViewItem::setOpen(open);
+
+ Q_ASSERT( dataType_ == REFERENCE_TYPE
+ || dataType_ == ARRAY_TYPE
+ || dataType_ == HASH_TYPE
+ || dataType_ == STRING_TYPE
+ || dataType_ == STRUCT_TYPE );
+
+ update();
+ return;
+}
+
+// **************************************************************************
+
+void VarItem::update()
+{
+ if (isOpen()) {
+ startWaitingForData();
+// emit ((VariableTree*)listView())->expandItem(this, fullName().latin1());
+ ((VariableTree*)listView())->expandItem(this, fullName().latin1());
+ }
+
+ return;
+}
+
+// **************************************************************************
+
+DataType VarItem::dataType() const
+{
+ return dataType_;
+}
+
+// **************************************************************************
+
+void VarItem::setDataType(DataType dataType)
+{
+ dataType_ = dataType;
+}
+
+// **************************************************************************
+
+// Overridden to highlight the changed items
+void VarItem::paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int align)
+{
+ if (p == 0) {
+ return;
+ }
+
+ if (column == VALUE_COLUMN) {
+ // Show color values as colors, and make the text color the same
+ // as the base color
+ if (dataType_ == COLOR_TYPE) {
+ QRegExp color_re("\\s(#.*)>");
+
+ if (color_re.search(text(column)) != -1) {
+ QColorGroup color_cg( cg.foreground(), cg.background(),
+ cg.light(), cg.dark(), cg.mid(),
+ QColor(color_re.cap(1)), QColor(color_re.cap(1)) );
+ QListViewItem::paintCell(p, color_cg, column, width, align);
+ return;
+ }
+ }
+
+ // Highlight recently changed items in red
+ if (highlight_) {
+ QColorGroup hl_cg( cg.foreground(), cg.background(),
+ cg.light(), cg.dark(), cg.mid(),
+ red, cg.base() );
+ QListViewItem::paintCell(p, hl_cg, column, width, align);
+ return;
+ }
+ }
+
+ QListViewItem::paintCell(p, cg, column, width, align);
+ return;
+}
+
+// **************************************************************************
+
+QString VarItem::tipText() const
+{
+ const unsigned int MAX_TOOLTIP_SIZE = 70;
+ QString tip = text(VALUE_COLUMN);
+
+ if (tip.length() < MAX_TOOLTIP_SIZE) {
+ return tip;
+ } else {
+ return tip.mid(0, MAX_TOOLTIP_SIZE - 1) + " [...]";
+ }
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+VarFrameRoot::VarFrameRoot(VariableTree *parent, int frameNo, int threadNo)
+ : LazyFetchItem(parent),
+ needsVariables_(true),
+ frameNo_(frameNo),
+ threadNo_(threadNo),
+ cache_("")
+{
+ setExpandable(true);
+}
+
+// **************************************************************************
+
+VarFrameRoot::~VarFrameRoot()
+{
+}
+
+// **************************************************************************
+
+void VarFrameRoot::addLocals(char *variables)
+{
+ cache_.append(variables);
+}
+
+// **************************************************************************
+
+void VarFrameRoot::setLocals()
+{
+ RDBParser::parseVariables(this, cache_.data());
+ cache_ = "";
+ needsVariables_ = false;
+ stopWaitingForData();
+ prune();
+
+ return;
+}
+
+// **************************************************************************
+
+// Override setOpen so that we can decide what to do when we do change
+// state.
+void VarFrameRoot::setOpen(bool open)
+{
+ bool localsViewChanged = (isOpen() != open);
+ QListViewItem::setOpen(open);
+
+ if (localsViewChanged) {
+ ((VariableTree*)listView())->selectFrame(frameNo_, threadNo_);
+ }
+
+ return;
+}
+
+void VarFrameRoot::setFrameName(const QString &frameName)
+{
+ setText(VAR_NAME_COLUMN, frameName);
+ setText(VALUE_COLUMN, "");
+
+ return;
+}
+
+void VarFrameRoot::setActivationId()
+{
+ LazyFetchItem::setActivationId();
+ stopWaitingForData();
+ needsVariables_ = true;
+ cache_ = "";
+}
+
+bool VarFrameRoot::needsVariables() const
+{
+ return ( text(VAR_NAME_COLUMN).contains("try_initialize") == 0
+ && isOpen()
+ && !isWaitingForData()
+ && needsVariables_ );
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+
+GlobalRoot::GlobalRoot(VariableTree *parent)
+ : LazyFetchItem(parent)
+{
+ setText(0, i18n("Global"));
+ setExpandable(true);
+ setOpen(false);
+ setSelectable(false);
+}
+
+// **************************************************************************
+
+GlobalRoot::~GlobalRoot()
+{
+}
+
+// **************************************************************************
+
+void GlobalRoot::setGlobals(char * globals)
+{
+ setActivationId();
+ RDBParser::parseVariables(this, globals);
+
+ return;
+}
+
+// **************************************************************************
+
+void GlobalRoot::setOpen(bool open)
+{
+ bool globalsViewChanged = (isOpen() != open);
+ QListViewItem::setOpen(open);
+
+ if (globalsViewChanged) {
+ ((VariableTree*)listView())->setFetchGlobals(isOpen());
+ }
+
+ return;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+WatchVarItem::WatchVarItem( LazyFetchItem *parent, const QString &varName, DataType dataType, int displayId )
+ : VarItem(parent, varName, dataType),
+ displayId_(displayId)
+{
+}
+
+// **************************************************************************
+
+WatchVarItem::~WatchVarItem()
+{
+}
+
+// **************************************************************************
+
+void WatchVarItem::setDisplayId(int id)
+{
+ displayId_ = id;
+}
+
+// **************************************************************************
+
+int WatchVarItem::displayId()
+{
+ return displayId_;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+WatchRoot::WatchRoot(VariableTree *parent)
+ : LazyFetchItem(parent)
+{
+ setText(VAR_NAME_COLUMN, i18n("Watch"));
+ setOpen(true);
+ setSelectable(false);
+}
+
+// **************************************************************************
+
+WatchRoot::~WatchRoot()
+{
+}
+
+// **************************************************************************
+
+// Sets the initial value of a new Watch item, along with the
+// display id
+void WatchRoot::setWatchExpression(char * buf, char * expression)
+{
+ QString expr(expression);
+ QRegExp display_re("^(\\d+):\\s([^\n]+)\n");
+
+ for ( QListViewItem *child = firstChild();
+ child != 0;
+ child = child->nextSibling() )
+ {
+ WatchVarItem *varItem = (WatchVarItem*) child;
+ if ( varItem->text(VAR_NAME_COLUMN) == expr
+ && varItem->displayId() == -1
+ && display_re.search(buf) >= 0 )
+ {
+ varItem->setDisplayId(display_re.cap(1).toInt());
+ // Skip over the 'thing = ' part of expr to get the value
+ varItem->setText( VALUE_COLUMN,
+ display_re.cap(2).mid(varItem->text(VAR_NAME_COLUMN).length() + strlen(" = ")) );
+ return;
+ }
+ }
+}
+
+// After a program pause, this updates the new value of a Watch item
+// expr is the thing = value part of "1: a = 1", id is the display number
+void WatchRoot::updateWatchExpression(int id, const QString& expr)
+{
+ for ( QListViewItem *child = firstChild();
+ child != 0;
+ child = child->nextSibling() )
+ {
+ WatchVarItem *varItem = (WatchVarItem*) child;
+ if (varItem->displayId() == id) {
+ Q_ASSERT( expr.startsWith(varItem->text(VAR_NAME_COLUMN)) );
+ // Skip over the 'thing = ' part of expr to get the value
+ varItem->setText( VALUE_COLUMN,
+ expr.mid(varItem->text(VAR_NAME_COLUMN).length() + strlen(" = ")) );
+ return;
+ }
+ }
+}
+
+void WatchRoot::savePartialProjectSession(QDomElement* el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull()) {
+ return;
+ }
+
+ QDomElement watchEl = domDoc.createElement("watchExpressions");
+
+ for ( QListViewItem *child = firstChild();
+ child != 0;
+ child = child->nextSibling() )
+ {
+ QDomElement subEl = domDoc.createElement("el");
+ subEl.appendChild(domDoc.createTextNode(child->text(VAR_NAME_COLUMN)));
+ watchEl.appendChild(subEl);
+ }
+
+ if (!watchEl.isNull()) {
+ el->appendChild(watchEl);
+ }
+
+ return;
+}
+
+void WatchRoot::restorePartialProjectSession(const QDomElement* el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull()) {
+ return;
+ }
+
+ QDomElement watchEl = el->namedItem("watchExpressions").toElement();
+ QDomElement subEl = watchEl.firstChild().toElement();
+
+ while (!subEl.isNull()) {
+ new WatchVarItem(this, subEl.firstChild().toText().data(), UNKNOWN_TYPE);
+
+ subEl = subEl.nextSibling().toElement();
+ }
+
+ return;
+}
+
+// **************************************************************************
+// **************************************************************************
+// **************************************************************************
+
+}
+
+
+#include "variablewidget.moc"
+
diff --git a/languages/ruby/debugger/variablewidget.h b/languages/ruby/debugger/variablewidget.h
new file mode 100644
index 00000000..c608ec45
--- /dev/null
+++ b/languages/ruby/debugger/variablewidget.h
@@ -0,0 +1,348 @@
+/***************************************************************************
+ begin : Sun Aug 8 1999
+ copyright : (C) 1999 by John Birch
+ email : jbb@kdevelop.org
+
+ Adapted for ruby debugging
+ --------------------------
+ begin : Mon Nov 1 2004
+ copyright : (C) 2004 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 _VARIABLEWIDGET_H_
+#define _VARIABLEWIDGET_H_
+
+#include "rdbcontroller.h"
+
+#include <klistview.h>
+#include <kcombobox.h>
+#include <qwidget.h>
+#include <qtooltip.h>
+#include <kdebug.h>
+
+class KLineEdit;
+
+namespace RDBDebugger
+{
+
+class LazyFetchItem;
+class VarFrameRoot;
+class GlobalRoot;
+class WatchRoot;
+class VarItem;
+class VariableTree;
+class DbgController;
+class Breakpoint;
+
+enum {
+ VAR_NAME_COLUMN = 0,
+ VALUE_COLUMN = 1
+};
+
+enum DataType {
+ UNKNOWN_TYPE,
+ VALUE_TYPE,
+ REFERENCE_TYPE,
+ ARRAY_TYPE,
+ HASH_TYPE,
+ STRUCT_TYPE,
+ COLOR_TYPE,
+ STRING_TYPE
+};
+
+class VariableWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ VariableWidget( QWidget *parent=0, const char *name=0 );
+
+ VariableTree *varTree() const
+ { return varTree_; }
+
+ virtual void setEnabled(bool b);
+
+ void restorePartialProjectSession(const QDomElement* el);
+ void savePartialProjectSession(QDomElement* el);
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+public slots:
+ void slotAddWatchExpression();
+ void slotAddWatchExpression(const QString &expr);
+
+private:
+ VariableTree *varTree_;
+ KHistoryCombo *watchVarEditor_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VariableTree : public KListView, public QToolTip
+{
+ Q_OBJECT
+//we need this to be able to emit expandItem() from within LazyFetchItem
+friend class LazyFetchItem;
+
+public:
+ VariableTree( VariableWidget *parent, const char *name=0 );
+ virtual ~VariableTree();
+
+ // Clear everything but the Watch frame
+ void clear();
+
+ int activationId() const { return activationId_; }
+ void nextActivationId();
+
+ VarFrameRoot *findFrame(int frameNo, int threadNo) const;
+
+ GlobalRoot *globalRoot();
+ WatchRoot *watchRoot();
+
+ void resetWatchVars();
+ void setCurrentThread(int currentThread) { currentThread_ = currentThread; }
+
+ // Remove items that are not active
+ void prune();
+
+ // Look for a frame where 'needsVariables()' is true.
+ // If found, send commands to the debugger to fetch
+ // the variable values.
+ // Return true if a fetch has been scheduled, otherwise
+ // false.
+ bool schedule();
+
+ // Tell the controller whether or not to fetch the
+ // values of the global variables
+ void setFetchGlobals(bool fetch);
+
+ // (from QToolTip) Display a tooltip when the cursor is over an item
+ virtual void maybeTip(const QPoint &);
+
+ virtual void setSelected(QListViewItem * item, bool selected);
+
+signals:
+ void toggleWatchpoint(const QString &varName);
+ void selectFrame(int frame, int thread);
+ void expandItem(VarItem *item, const QCString &request);
+ void fetchGlobals(bool fetch);
+ void addWatchExpression(const QString& expr, bool execute);
+ void removeWatchExpression(int displayId);
+
+public slots:
+ void slotAddWatchExpression(const QString& watchVar);
+ void slotFrameActive(int frameNo, int threadNo, const QString& frameName);
+ void slotPressed(QListViewItem * item);
+
+private slots:
+ void slotContextMenu(KListView *, QListViewItem *item);
+
+private:
+ int activationId_;
+ int currentThread_;
+ VarFrameRoot * selectedFrame_;
+
+ WatchRoot * watchRoot_;
+ GlobalRoot * globalRoot_;
+
+ friend class VarFrameRoot;
+ friend class VarItem;
+ friend class WatchRoot;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class LazyFetchItem : public KListViewItem
+{
+public:
+ LazyFetchItem(VariableTree *parent);
+ LazyFetchItem(LazyFetchItem *parent);
+
+ virtual ~LazyFetchItem();
+
+ virtual int rtti() const { return RTTI_LAZY_FETCH_ITEM; }
+
+ virtual void prune();
+ virtual VarItem *findItem(const QString& name) const;
+
+ int currentActivationId() const { return ((VariableTree*) listView())->activationId(); }
+ virtual void setActivationId() { activationId_ = currentActivationId(); }
+ bool isActive() const { return activationId_ == currentActivationId(); }
+
+ void startWaitingForData() { waitingForData_ = true; }
+ void stopWaitingForData() { waitingForData_ = false; }
+ bool isWaitingForData() const { return waitingForData_; }
+
+protected:
+ void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int align );
+
+private:
+ int activationId_;
+ bool waitingForData_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VarItem : public LazyFetchItem
+{
+public:
+ VarItem( LazyFetchItem *parent, const QString &varName, DataType dataType );
+
+ virtual ~VarItem();
+
+ virtual int rtti() const { return RTTI_VAR_ITEM; }
+ virtual QString key(int column, bool ascending) const;
+
+ QString fullName() const;
+
+ DataType dataType() const;
+ void setDataType(DataType dataType);
+
+ void setOpen(bool open);
+ void setText (int column, const QString& text);
+
+ // Returns the text to be displayed as tooltip (the value)
+ QString tipText() const;
+
+ // If the item is open, fetch details via a pp command
+ void update();
+
+ // The details from the pp command have arrived, parse them
+ // and update the UI
+ void expandValue(char *data);
+
+private:
+ void paintCell( QPainter *p, const QColorGroup &cg,
+ int column, int width, int align );
+
+private:
+ QString key_;
+ QCString cache_;
+ DataType dataType_;
+ bool highlight_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class WatchVarItem : public VarItem
+{
+public:
+ WatchVarItem( LazyFetchItem *parent, const QString &varName, DataType dataType, int displayId = -1);
+
+ virtual ~WatchVarItem();
+
+ virtual int rtti() const { return RTTI_WATCH_VAR_ITEM; }
+
+ // The id returned by rdb after a display expression is added
+ void setDisplayId(int id);
+ int displayId();
+
+private:
+ int displayId_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class VarFrameRoot : public LazyFetchItem
+{
+public:
+ VarFrameRoot(VariableTree *parent, int frame, int thread);
+ virtual ~VarFrameRoot();
+
+ virtual int rtti() const { return RTTI_VAR_FRAME_ROOT; }
+
+ virtual QString key(int column, bool /*ascending*/) const {
+ return QString("%1%2").arg(RTTI_VAR_FRAME_ROOT).arg(text(column));
+ }
+
+ void addLocals(char *variables);
+ void setLocals();
+ void setOpen(bool open);
+
+ void setFrameName(const QString &frameName);
+
+ virtual void setActivationId();
+ bool needsVariables() const;
+
+ int frameNo() { return frameNo_; }
+ int threadNo() { return threadNo_; }
+
+private:
+ bool needsVariables_;
+ int frameNo_;
+ int threadNo_;
+ QCString cache_;
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class WatchRoot : public LazyFetchItem
+{
+public:
+ WatchRoot(VariableTree * parent);
+ virtual ~WatchRoot();
+
+ virtual int rtti() const { return RTTI_WATCH_ROOT; }
+
+ virtual QString key(int column, bool /*ascending*/) const {
+ return QString("%1%2").arg(RTTI_WATCH_ROOT).arg(text(column));
+ }
+
+ void setWatchExpression(char * buf, char * expr);
+ void updateWatchExpression(int id, const QString& expr);
+
+ void restorePartialProjectSession(const QDomElement* el);
+ void savePartialProjectSession(QDomElement* el);
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+class GlobalRoot : public LazyFetchItem
+{
+public:
+ GlobalRoot(VariableTree * parent);
+ virtual ~GlobalRoot();
+
+ virtual int rtti() const { return RTTI_GLOBAL_ROOT; }
+
+ virtual QString key(int column, bool /*ascending*/) const {
+ return QString("%1%2").arg(RTTI_GLOBAL_ROOT).arg(text(column));
+ }
+
+ void setOpen(bool open);
+ void setGlobals(char * globals);
+};
+
+/***************************************************************************/
+/***************************************************************************/
+/***************************************************************************/
+
+}
+
+#endif
diff --git a/languages/ruby/doc/Makefile.am b/languages/ruby/doc/Makefile.am
new file mode 100644
index 00000000..245b8fe5
--- /dev/null
+++ b/languages/ruby/doc/Makefile.am
@@ -0,0 +1,6 @@
+tocdir = ${kde_datadir}/kdevdocumentation/tocs
+toc_DATA = ruby.toc ruby_bugs.toc qtruby.toc rails.toc
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA = ruby.index
+
diff --git a/languages/ruby/doc/qtruby.toc b/languages/ruby/doc/qtruby.toc
new file mode 100644
index 00000000..85fc3836
--- /dev/null
+++ b/languages/ruby/doc/qtruby.toc
@@ -0,0 +1,9 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>QtRuby and Korundum</title>
+<base href="http://developer.kde.org/language-bindings/ruby/"/>
+<tocsect1 name="Qt Tutorial #1" url="tutorial/tutorial.html"></tocsect1>
+<tocsect1 name="Qt Tutorial #2" url="tutorial2/tutorial2.html"></tocsect1>
+<tocsect1 name="Qt Designer Tutorial" url="colortooltutorial/designer-manual-3.html"></tocsect1>
+<tocsect1 name="KDE 3.0 Tutorial" url="kde3tutorial/index.html"></tocsect1>
+</kdeveloptoc>
diff --git a/languages/ruby/doc/rails.toc b/languages/ruby/doc/rails.toc
new file mode 100644
index 00000000..6f92fcd6
--- /dev/null
+++ b/languages/ruby/doc/rails.toc
@@ -0,0 +1,9 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Rails</title>
+<base href="http://"/>
+<tocsect1 name="Rails Site" url="rubyonrails.org/"></tocsect1>
+<tocsect1 name="Rails API Reference" url="api.rubyonrails.com/"></tocsect1>
+<tocsect1 name="Wiki" url="wiki.rubyonrails.org/"></tocsect1>
+<tocsect1 name="Bug tracker" url="dev.rubyonrails.org/"></tocsect1>
+</kdeveloptoc>
diff --git a/languages/ruby/doc/ruby.toc b/languages/ruby/doc/ruby.toc
new file mode 100644
index 00000000..bce60158
--- /dev/null
+++ b/languages/ruby/doc/ruby.toc
@@ -0,0 +1,1399 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Ruby</title>
+<base href="http://www.ruby-doc.org/docs/ProgrammingRuby/"/>
+<tocsect1 name="Pickaxe Book" url="">
+<tocsect2 name="Contents" url="html/index.html"></tocsect2>
+<tocsect2 name="Foreword" url="html/foreword.html"></tocsect2>
+<tocsect2 name="Preface" url="html/preface.html"></tocsect2>
+<tocsect2 name="Roadmap" url="html/roadmap.html"></tocsect2>
+<tocsect2 name="Ruby.new" url="html/intro.html"></tocsect2>
+<tocsect2 name="Classes, Objects, and Variables" url="html/tut_classes.html"></tocsect2>
+<tocsect2 name="Containers, Blocks, and Iterators" url="html/tut_containers.html"></tocsect2>
+<tocsect2 name="Standard Types" url="html/tut_stdtypes.html"></tocsect2>
+<tocsect2 name="More About Methods" url="html/tut_methods.html"></tocsect2>
+<tocsect2 name="Expressions" url="html/tut_expressions.html"></tocsect2>
+<tocsect2 name="Exceptions, Catch, and Throw" url="html/tut_exceptions.html"></tocsect2>
+<tocsect2 name="Modules" url="html/tut_modules.html"></tocsect2>
+<tocsect2 name="Basic Input and Output" url="html/tut_io.html"></tocsect2>
+<tocsect2 name="Threads and Processes" url="html/tut_threads.html"></tocsect2>
+<tocsect2 name="When Trouble Strikes" url="html/trouble.html"></tocsect2>
+<tocsect2 name="Ruby and Its World" url="html/rubyworld.html"></tocsect2>
+<tocsect2 name="Ruby and the Web" url="html/web.html"></tocsect2>
+<tocsect2 name="Ruby Tk" url="html/ext_tk.html"></tocsect2>
+<tocsect2 name="Ruby and Microsoft Windows" url="html/win32.html"></tocsect2>
+<tocsect2 name="Extending Ruby" url="html/ext_ruby.html"></tocsect2>
+<tocsect2 name="The Ruby Language" url="html/language.html"></tocsect2>
+<tocsect2 name="Classes and Objects" url="html/classes.html"></tocsect2>
+<tocsect2 name="Locking Ruby in the Safe" url="html/taint.html"></tocsect2>
+<tocsect2 name="Reflection, ObjectSpace, and Distributed Ruby" url="html/ospace.html"></tocsect2>
+<tocsect2 name="Built-in Classes and Methods" url="html/builtins.html"></tocsect2>
+<tocsect2 name="Standard Library" url="html/lib_standard.html"></tocsect2>
+<tocsect2 name="Object-Oriented Design Libraries" url="html/lib_patterns.html"></tocsect2>
+<tocsect2 name="Network and Web Libraries" url="html/lib_network.html"></tocsect2>
+<tocsect2 name="Microsoft Windows Support" url="html/lib_windows.html"></tocsect2>
+<tocsect2 name="Embedded Documentation" url="html/rdtool.html"></tocsect2>
+<tocsect2 name="Interactive Ruby Shell" url="html/irb.html"></tocsect2>
+<tocsect2 name="Support" url="html/support.html"></tocsect2>
+</tocsect1>
+<index>
+<entry name="$CFLAGS (mkmf)" url="html/lib_standard.html#mkmf.$CFLAGS"/>
+<entry name="$LDFLAGS (mkmf)" url="html/lib_standard.html#mkmf.$LDFLAGS"/>
+<entry name="% (String)" url="html/ref_c_string.html#String._pc"/>
+<entry name="&amp; (Array)" url="html/ref_c_array.html#Array._et"/>
+<entry name="&amp; (FalseClass)" url="html/ref_c_falseclass.html#FalseClass._et"/>
+<entry name="&amp; (NilClass)" url="html/ref_c_nilclass.html#NilClass._et"/>
+<entry name="&amp; (TrueClass)" url="html/ref_c_trueclass.html#TrueClass._et"/>
+<entry name="* (Array)" url="html/ref_c_array.html#Array._st"/>
+<entry name="* (String)" url="html/ref_c_string.html#String._st"/>
+<entry name="+ (Array)" url="html/ref_c_array.html#Array._pl"/>
+<entry name="+ (Date)" url="html/lib_standard.html#Date._pl"/>
+<entry name="+ (String)" url="html/ref_c_string.html#String._pl"/>
+<entry name="+ (Time)" url="html/ref_c_time.html#Time._pl"/>
+<entry name="+@ (Numeric)" url="html/ref_c_numeric.html#Numeric._pl_at"/>
+<entry name="- (Array)" url="html/ref_c_array.html#Array._mi"/>
+<entry name="- (Time)" url="html/ref_c_time.html#Time._mi"/>
+<entry name="-- (Array)" url="html/ref_c_array.html#Array._mi_mi"/>
+<entry name="-- (Date)" url="html/lib_standard.html#Date._mi_mi"/>
+<entry name="-- (Time)" url="html/ref_c_time.html#Time._mi_mi"/>
+<entry name="--@ (Numeric)" url="html/ref_c_numeric.html#Numeric._mi_mi_at"/>
+<entry name="-@ (Numeric)" url="html/ref_c_numeric.html#Numeric._mi_at"/>
+<entry name="&lt;, &lt;=, &gt;, &gt;= (Module)" url="html/ref_c_module.html#Module._lt_cm_lt_eq_cm_lt_cm_lt_eq"/>
+<entry name="&lt;&lt; (Array)" url="html/ref_c_array.html#Array._lt_lt"/>
+<entry name="&lt;&lt; (Date)" url="html/lib_standard.html#Date._lt_lt"/>
+<entry name="&lt;&lt; (IO)" url="html/ref_c_io.html#IO._lt_lt"/>
+<entry name="&lt;&lt; (String)" url="html/ref_c_string.html#String._lt_lt"/>
+<entry name="&lt;=&gt; (Array)" url="html/ref_c_array.html#Array._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Bignum)" url="html/ref_c_bignum.html#Bignum._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Complex)" url="html/lib_standard.html#Complex._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Date)" url="html/lib_standard.html#Date._lt_eq_lt"/>
+<entry name="&lt;=&gt; (File::Stat)" url="html/ref_c_file__stat.html#File::Stat._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Fixnum)" url="html/ref_c_fixnum.html#Fixnum._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Float)" url="html/ref_c_float.html#Float._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Module)" url="html/ref_c_module.html#Module._lt_eq_lt"/>
+<entry name="&lt;=&gt; (String)" url="html/ref_c_string.html#String._lt_eq_lt"/>
+<entry name="&lt;=&gt; (Time)" url="html/ref_c_time.html#Time._lt_eq_lt"/>
+<entry name="== (Array)" url="html/ref_c_array.html#Array._eq_eq"/>
+<entry name="== (Comparable)" url="html/ref_m_comparable.html#Comparable._eq_eq"/>
+<entry name="== (Complex)" url="html/lib_standard.html#Complex._eq_eq"/>
+<entry name="== (Hash)" url="html/ref_c_hash.html#Hash._eq_eq"/>
+<entry name="== (Object)" url="html/ref_c_object.html#Object._eq_eq"/>
+<entry name="== (Regexp)" url="html/ref_c_regexp.html#Regexp._eq_eq"/>
+<entry name="== (String)" url="html/ref_c_string.html#String._eq_eq"/>
+<entry name="== (Struct)" url="html/ref_c_struct.html#Struct._eq_eq"/>
+<entry name="=== (Array)" url="html/ref_c_array.html#Array._eq_eq_eq"/>
+<entry name="=== (Date)" url="html/lib_standard.html#Date._eq_eq_eq"/>
+<entry name="=== (Module)" url="html/ref_c_module.html#Module._eq_eq_eq"/>
+<entry name="=== (Object)" url="html/ref_c_object.html#Object._eq_eq_eq"/>
+<entry name="=== (Range)" url="html/ref_c_range.html#Range._eq_eq_eq"/>
+<entry name="=== (Regexp)" url="html/ref_c_regexp.html#Regexp._eq_eq_eq"/>
+<entry name="=== (String)" url="html/ref_c_string.html#String._eq_eq_eq"/>
+<entry name="=~ (Object)" url="html/ref_c_object.html#Object._eq_sd"/>
+<entry name="=~ (Regexp)" url="html/ref_c_regexp.html#Regexp._eq_sd"/>
+<entry name="=~ (String)" url="html/ref_c_string.html#String._eq_sd"/>
+<entry name="&gt;&gt; (Date)" url="html/lib_standard.html#Date._lt_lt"/>
+<entry name="abort (Kernel)" url="html/ref_m_kernel.html#Kernel.abort"/>
+<entry name="abort (PStore)" url="html/lib_standard.html#PStore.abort"/>
+<entry name="abort_on_exception (Thread)" url="html/ref_c_thread.html#Thread.abort_on_exception"/>
+<entry name="abort_on_exception= (Thread)" url="html/ref_c_thread.html#Thread.abort_on_exception_eq"/>
+<entry name="abs (Complex)" url="html/lib_standard.html#Complex.abs"/>
+<entry name="abs (Numeric)" url="html/ref_c_numeric.html#Numeric.abs"/>
+<entry name="abs2 (Complex)" url="html/lib_standard.html#Complex.abs2"/>
+<entry name="accept (Socket)" url="html/lib_network.html#Socket.accept"/>
+<entry name="accept (TCPServer)" url="html/lib_network.html#TCPServer.accept"/>
+<entry name="accept (UNIXServer)" url="html/lib_network.html#UNIXServer.accept"/>
+<entry name="Access Control (classes)" url="html/tut_classes.html#S4"/>
+<entry name="Accessors (Date)" url="html/lib_standard.html#Date.Accessors"/>
+<entry name="Acknowledgments (preface)" url="html/preface.html#S9"/>
+<entry name="add (ThreadGroup)" url="html/ref_c_threadgroup.html#ThreadGroup.add"/>
+<entry name="Adding Information to Exceptions (exceptions)" url="html/tut_exceptions.html#UC"/>
+<entry name="addr (IPSocket)" url="html/lib_network.html#IPSocket.addr"/>
+<entry name="addr (UNIXSocket)" url="html/lib_network.html#UNIXSocket.addr"/>
+<entry name="alias_method (Module)" url="html/ref_c_module.html#Module.alias_method"/>
+<entry name="alive? (Thread)" url="html/ref_c_thread.html#Thread.alive_qm"/>
+<entry name="all (Net::POPMail)" url="html/lib_network.html#Net::POPMail.all"/>
+<entry name="Alternation (stdtypes)" url="html/tut_stdtypes.html#UI"/>
+<entry name="An Example (ruby)" url="html/ext_ruby.html#UF"/>
+<entry name="An Example (win32)" url="html/win32.html#UD"/>
+<entry name="ancestors (Module)" url="html/ref_c_module.html#Module.ancestors"/>
+<entry name="Anchors (stdtypes)" url="html/tut_stdtypes.html#UF"/>
+<entry name="append_features (Module)" url="html/ref_c_module.html#Module.append_features"/>
+<entry name="arg (Complex)" url="html/lib_standard.html#Complex.arg"/>
+<entry name="ARGV (rubyworld)" url="html/rubyworld.html#UB"/>
+<entry name="Arithmetic operations (Bignum)" url="html/ref_c_bignum.html#Bignum.Arithmeticoperations"/>
+<entry name="Arithmetic operations (Complex)" url="html/lib_standard.html#Complex.Arithmeticoperations"/>
+<entry name="Arithmetic operations (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.Arithmeticoperations"/>
+<entry name="Arithmetic operations (Float)" url="html/ref_c_float.html#Float.Arithmeticoperations"/>
+<entry name="arity (Method)" url="html/ref_c_method.html#Method.arity"/>
+<entry name="arity (Proc)" url="html/ref_c_proc.html#Proc.arity"/>
+<entry name="Array" url="html/ref_c_array.html"/>
+<entry name="Array (Kernel)" url="html/ref_m_kernel.html#Kernel.Array"/>
+<entry name="Arrays (containers)" url="html/tut_containers.html#UA"/>
+<entry name="Arrays (language)" url="html/language.html#UF"/>
+<entry name="Arrays and Hashes (intro)" url="html/intro.html#S3"/>
+<entry name="asctime (Time)" url="html/ref_c_time.html#Time.asctime"/>
+<entry name="Assignment (expressions)" url="html/tut_expressions.html#S3"/>
+<entry name="assoc (Array)" url="html/ref_c_array.html#Array.assoc"/>
+<entry name="at (Array)" url="html/ref_c_array.html#Array.at"/>
+<entry name="at (Time)" url="html/ref_c_time.html#Time.at"/>
+<entry name="atan2 (Math)" url="html/ref_m_math.html#Math.atan2"/>
+<entry name="atime (File)" url="html/ref_c_file.html#File.atime"/>
+<entry name="atime (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.atime"/>
+<entry name="attr (Module)" url="html/ref_c_module.html#Module.attr"/>
+<entry name="attr_accessor (Module)" url="html/ref_c_module.html#Module.attr_accessor"/>
+<entry name="attr_reader (Module)" url="html/ref_c_module.html#Module.attr_reader"/>
+<entry name="attr_writer (Module)" url="html/ref_c_module.html#Module.attr_writer"/>
+<entry name="at_exit (Kernel)" url="html/ref_m_kernel.html#Kernel.at_exit"/>
+<entry name="autoload (Kernel)" url="html/ref_m_kernel.html#Kernel.autoload"/>
+<entry name="Backquotes Are Soft (expressions)" url="html/tut_expressions.html#UB"/>
+<entry name="Backslash Sequences in the Substitution (stdtypes)" url="html/tut_stdtypes.html#UL"/>
+<entry name="backtrace (Exception)" url="html/ref_c_exception.html#Exception.backtrace"/>
+<entry name="basename (File)" url="html/ref_c_file.html#File.basename"/>
+<entry name="Basic Input and Output (io)" url="html/tut_io.html"/>
+<entry name="begin (MatchData)" url="html/ref_c_matchdata.html#MatchData.begin"/>
+<entry name="begin (Range)" url="html/ref_c_range.html#Range.begin"/>
+<entry name="BEGIN and END Blocks (language)" url="html/language.html#UA"/>
+<entry name="between? (Comparable)" url="html/ref_m_comparable.html#Comparable.between_qm"/>
+<entry name="Bignum" url="html/ref_c_bignum.html"/>
+<entry name="bind (Socket)" url="html/lib_network.html#Socket.bind"/>
+<entry name="bind (UDPSocket)" url="html/lib_network.html#UDPSocket.bind"/>
+<entry name="Binding" url="html/ref_c_binding.html"/>
+<entry name="binding (Kernel)" url="html/ref_m_kernel.html#Kernel.binding"/>
+<entry name="Binding Events (tk)" url="html/ext_tk.html#S3"/>
+<entry name="binmode (IO)" url="html/ref_c_io.html#IO.binmode"/>
+<entry name="binmode (Net::Telnet)" url="html/lib_network.html#Net::Telnet.binmode"/>
+<entry name="binmode= (Net::Telnet)" url="html/lib_network.html#Net::Telnet.binmode_eq"/>
+<entry name="Bit operations (Bignum)" url="html/ref_c_bignum.html#Bignum.Bitoperations"/>
+<entry name="Bit operations (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.Bitoperations"/>
+<entry name="blksize (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.blksize"/>
+<entry name="blockdev? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.blockdev_qm"/>
+<entry name="blockdev? (FileTest)" url="html/ref_m_filetest.html#FileTest.blockdev_qm"/>
+<entry name="blocks (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.blocks"/>
+<entry name="Blocks and Iterators (containers)" url="html/tut_containers.html#S2"/>
+<entry name="Blocks and Iterators (intro)" url="html/intro.html#S6"/>
+<entry name="Blocks and Subprocesses (threads)" url="html/tut_threads.html#UI"/>
+<entry name="Blocks Can Be Closures (containers)" url="html/tut_containers.html#UG"/>
+<entry name="Blocks for Transactions (containers)" url="html/tut_containers.html#UF"/>
+<entry name="block_given? (Kernel)" url="html/ref_m_kernel.html#Kernel.block_given_qm"/>
+<entry name="Boolean Expressions (expressions)" url="html/tut_expressions.html#UF"/>
+<entry name="Break, Redo, and Next (expressions)" url="html/tut_expressions.html#UL"/>
+<entry name="Bridging Ruby to Other Languages (ruby)" url="html/ext_ruby.html#S7"/>
+<entry name="broadcast (ConditionVariable)" url="html/lib_standard.html#ConditionVariable.broadcast"/>
+<entry name="Bug Reporting (support)" url="html/support.html#S5"/>
+<entry name="Build Environment (rubyworld)" url="html/rubyworld.html#S5"/>
+<entry name="Building Ruby (preface)" url="html/preface.html#UA"/>
+<entry name="Built-in Classes and Methods (builtins)" url="html/builtins.html"/>
+<entry name="But I Miss My C++ Iostream (io)" url="html/tut_io.html#UC"/>
+<entry name="But It Doesn't Work! (trouble)" url="html/trouble.html#S3"/>
+<entry name="But It's Too Slow! (trouble)" url="html/trouble.html#S4"/>
+<entry name="call (Continuation)" url="html/ref_c_continuation.html#Continuation.call"/>
+<entry name="call (Method)" url="html/ref_c_method.html#Method.call"/>
+<entry name="call (Proc)" url="html/ref_c_proc.html#Proc.call"/>
+<entry name="Call (Win32API)" url="html/lib_windows.html#Win32API.Call"/>
+<entry name="call (Win32API)" url="html/lib_windows.html#Win32API.call"/>
+<entry name="callcc (Kernel)" url="html/ref_m_kernel.html#Kernel.callcc"/>
+<entry name="caller (Kernel)" url="html/ref_m_kernel.html#Kernel.caller"/>
+<entry name="Calling a Method (methods)" url="html/tut_methods.html#S2"/>
+<entry name="Calling Methods Dynamically (ospace)" url="html/ospace.html#S3"/>
+<entry name="Canvas (tk)" url="html/ext_tk.html#S4"/>
+<entry name="capitalize (String)" url="html/ref_c_string.html#String.capitalize"/>
+<entry name="capitalize! (String)" url="html/ref_c_string.html#String.capitalize_oh"/>
+<entry name="Case Expressions (expressions)" url="html/tut_expressions.html#S5"/>
+<entry name="casefold? (Regexp)" url="html/ref_c_regexp.html#Regexp.casefold_qm"/>
+<entry name="catch (Kernel)" url="html/ref_m_kernel.html#Kernel.catch"/>
+<entry name="Catch and Throw (exceptions)" url="html/tut_exceptions.html#S4"/>
+<entry name="ceil (Float)" url="html/ref_c_float.html#Float.ceil"/>
+<entry name="center (String)" url="html/ref_c_string.html#String.center"/>
+<entry name="CGI Development (network)" url="html/lib_network.html#S3"/>
+<entry name="Character Classes (stdtypes)" url="html/tut_stdtypes.html#UG"/>
+<entry name="chardev? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.chardev_qm"/>
+<entry name="chardev? (FileTest)" url="html/ref_m_filetest.html#FileTest.chardev_qm"/>
+<entry name="chdir (Dir)" url="html/ref_c_dir.html#Dir.chdir"/>
+<entry name="chmod (File)" url="html/ref_c_file.html#File.chmod"/>
+<entry name="chomp (Kernel)" url="html/ref_m_kernel.html#Kernel.chomp"/>
+<entry name="chomp (String)" url="html/ref_c_string.html#String.chomp"/>
+<entry name="chomp! (Kernel)" url="html/ref_m_kernel.html#Kernel.chomp_oh"/>
+<entry name="chomp! (String)" url="html/ref_c_string.html#String.chomp_oh"/>
+<entry name="chop (Kernel)" url="html/ref_m_kernel.html#Kernel.chop"/>
+<entry name="chop (String)" url="html/ref_c_string.html#String.chop"/>
+<entry name="chop! (Kernel)" url="html/ref_m_kernel.html#Kernel.chop_oh"/>
+<entry name="chop! (String)" url="html/ref_c_string.html#String.chop_oh"/>
+<entry name="chown (File)" url="html/ref_c_file.html#File.chown"/>
+<entry name="chr (Integer)" url="html/ref_c_integer.html#Integer.chr"/>
+<entry name="chroot (Dir)" url="html/ref_c_dir.html#Dir.chroot"/>
+<entry name="Class" url="html/ref_c_class.html"/>
+<entry name="class (Object)" url="html/ref_c_object.html#Object.class"/>
+<entry name="Class and Module Definitions (classes)" url="html/classes.html#S2"/>
+<entry name="Class Methods (classes)" url="html/tut_classes.html#UE"/>
+<entry name="Class Names Are Constants (classes)" url="html/classes.html#UE"/>
+<entry name="Class Variables (classes)" url="html/tut_classes.html#UD"/>
+<entry name="Class Variables and Class Methods (classes)" url="html/tut_classes.html#S3"/>
+<entry name="Classes and Objects (classes)" url="html/classes.html"/>
+<entry name="Classes, Objects, and Variables (classes)" url="html/tut_classes.html"/>
+<entry name="class_eval (Module)" url="html/ref_c_module.html#Module.class_eval"/>
+<entry name="class_variables (Module)" url="html/ref_c_module.html#Module.class_variables"/>
+<entry name="clear (Array)" url="html/ref_c_array.html#Array.clear"/>
+<entry name="clear (Hash)" url="html/ref_c_hash.html#Hash.clear"/>
+<entry name="clone (IO)" url="html/ref_c_io.html#IO.clone"/>
+<entry name="clone (Module)" url="html/ref_c_module.html#Module.clone"/>
+<entry name="clone (Object)" url="html/ref_c_object.html#Object.clone"/>
+<entry name="close (Dir)" url="html/ref_c_dir.html#Dir.close"/>
+<entry name="close (IO)" url="html/ref_c_io.html#IO.close"/>
+<entry name="close (Net::FTP)" url="html/lib_network.html#Net::FTP.close"/>
+<entry name="close (SOCKSSocket)" url="html/lib_network.html#SOCKSSocket.close"/>
+<entry name="close (Tempfile)" url="html/lib_standard.html#Tempfile.close"/>
+<entry name="closed? (IO)" url="html/ref_c_io.html#IO.closed_qm"/>
+<entry name="closed? (Net::FTP)" url="html/lib_network.html#Net::FTP.closed_qm"/>
+<entry name="close_read (BasicSocket)" url="html/lib_network.html#BasicSocket.close_read"/>
+<entry name="close_read (IO)" url="html/ref_c_io.html#IO.close_read"/>
+<entry name="close_write (BasicSocket)" url="html/lib_network.html#BasicSocket.close_write"/>
+<entry name="close_write (IO)" url="html/ref_c_io.html#IO.close_write"/>
+<entry name="cmd (Net::Telnet)" url="html/lib_network.html#Net::Telnet.cmd"/>
+<entry name="cmp (File)" url="html/lib_standard.html#File.cmp"/>
+<entry name="code (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse.code"/>
+<entry name="coerce (Numeric)" url="html/ref_c_numeric.html#Numeric.coerce"/>
+<entry name="collect (Array)" url="html/ref_c_array.html#Array.collect"/>
+<entry name="collect (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.collect"/>
+<entry name="collect! (Array)" url="html/ref_c_array.html#Array.collect_oh"/>
+<entry name="Collecting Hash Arguments (methods)" url="html/tut_methods.html#UE"/>
+<entry name="Command Expansion (expressions)" url="html/tut_expressions.html#UA"/>
+<entry name="Command Line (irb)" url="html/irb.html#S1"/>
+<entry name="Command-Line Arguments (rubyworld)" url="html/rubyworld.html#S1"/>
+<entry name="Command-Line Options (rubyworld)" url="html/rubyworld.html#UA"/>
+<entry name="Commands (irb)" url="html/irb.html#S3"/>
+<entry name="commit (PStore)" url="html/lib_standard.html#PStore.commit"/>
+<entry name="compact (Array)" url="html/ref_c_array.html#Array.compact"/>
+<entry name="compact! (Array)" url="html/ref_c_array.html#Array.compact_oh"/>
+<entry name="Comparable" url="html/ref_m_comparable.html"/>
+<entry name="compare (File)" url="html/ref_c_file.html#File.compare"/>
+<entry name="Comparisons (Comparable)" url="html/ref_m_comparable.html#Comparable.Comparisons"/>
+<entry name="compile (Regexp)" url="html/ref_c_regexp.html#Regexp.compile"/>
+<entry name="Compile Time? Runtime? Anytime! (ospace)" url="html/ospace.html#S7"/>
+<entry name="concat (Array)" url="html/ref_c_array.html#Array.concat"/>
+<entry name="concat (String)" url="html/ref_c_string.html#String.concat"/>
+<entry name="Condition Variables (threads)" url="html/tut_threads.html#UF"/>
+<entry name="Conditional Execution (expressions)" url="html/tut_expressions.html#S4"/>
+<entry name="Configuring the Prompt (irb)" url="html/irb.html#UA"/>
+<entry name="conjugate (Complex)" url="html/lib_standard.html#Complex.conjugate"/>
+<entry name="connect (Net::FTP)" url="html/lib_network.html#Net::FTP.connect"/>
+<entry name="connect (Socket)" url="html/lib_network.html#Socket.connect"/>
+<entry name="connect (UDPSocket)" url="html/lib_network.html#UDPSocket.connect"/>
+<entry name="connect (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.connect"/>
+<entry name="constants (Module)" url="html/ref_c_module.html#Module.constants"/>
+<entry name="const_defined? (Module)" url="html/ref_c_module.html#Module.const_defined_qm"/>
+<entry name="const_get (Module)" url="html/ref_c_module.html#Module.const_get"/>
+<entry name="const_load (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.const_load"/>
+<entry name="const_set (Module)" url="html/ref_c_module.html#Module.const_set"/>
+<entry name="Containers" url="html/tut_containers.html#S1"/>
+<entry name="Containers, Blocks, and Iterators (containers)" url="html/tut_containers.html"/>
+<entry name="Continuation" url="html/ref_c_continuation.html"/>
+<entry name="Control Structures (intro)" url="html/intro.html#S4"/>
+<entry name="Controlling the Thread Scheduler (threads)" url="html/tut_threads.html#S2"/>
+<entry name="cookies (CGI)" url="html/lib_network.html#CGI.cookies"/>
+<entry name="Cookies (web)" url="html/web.html#UE"/>
+<entry name="copy (File)" url="html/ref_c_file.html#File.copy"/>
+<entry name="cos (Math)" url="html/ref_m_math.html#Math.cos"/>
+<entry name="count (String)" url="html/ref_c_string.html#String.count"/>
+<entry name="cp (File)" url="html/lib_standard.html#File.cp"/>
+<entry name="Create Locals Outside Blocks (trouble)" url="html/trouble.html#UB"/>
+<entry name="create_makefile (mkmf)" url="html/lib_standard.html#mkmf.create_makefile"/>
+<entry name="Creating a Makefile with extconf.rb (ruby)" url="html/ext_ruby.html#UG"/>
+<entry name="Creating an Extension (ruby)" url="html/ext_ruby.html#S5"/>
+<entry name="Creating Forms and HTML (web)" url="html/web.html#UD"/>
+<entry name="Creating Ruby Threads (threads)" url="html/tut_threads.html#UA"/>
+<entry name="critical (Thread)" url="html/ref_c_thread.html#Thread.critical"/>
+<entry name="critical= (Thread)" url="html/ref_c_thread.html#Thread.critical_eq"/>
+<entry name="Cross References (rdtool)" url="html/rdtool.html#S2"/>
+<entry name="crypt (String)" url="html/ref_c_string.html#String.crypt"/>
+<entry name="ctime (File)" url="html/ref_c_file.html#File.ctime"/>
+<entry name="ctime (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.ctime"/>
+<entry name="ctime (Time)" url="html/ref_c_time.html#Time.ctime"/>
+<entry name="current (Thread)" url="html/ref_c_thread.html#Thread.current"/>
+<entry name="Custom Serialization Strategy (ospace)" url="html/ospace.html#UF"/>
+<entry name="day (Time)" url="html/ref_c_time.html#Time.day"/>
+<entry name="debug_mode (Net::FTP)" url="html/lib_network.html#Net::FTP.debug_mode"/>
+<entry name="debug_mode= (Net::FTP)" url="html/lib_network.html#Net::FTP.debug_mode_eq"/>
+<entry name="default (Hash)" url="html/ref_c_hash.html#Hash.default"/>
+<entry name="Default (ThreadGroup)" url="html/ref_c_threadgroup.html#ThreadGroup.Default"/>
+<entry name="default= (Hash)" url="html/ref_c_hash.html#Hash.default_eq"/>
+<entry name="Defined?, And, Or, and Not (expressions)" url="html/tut_expressions.html#UG"/>
+<entry name="define_finalizer (ObjectSpace)" url="html/ref_m_objectspace.html#ObjectSpace.define_finalizer"/>
+<entry name="Defining a Method (methods)" url="html/tut_methods.html#S1"/>
+<entry name="delete (Array)" url="html/ref_c_array.html#Array.delete"/>
+<entry name="delete (CGI::Session)" url="html/lib_network.html#CGI::Session.delete"/>
+<entry name="delete (Dir)" url="html/ref_c_dir.html#Dir.delete"/>
+<entry name="delete (File)" url="html/ref_c_file.html#File.delete"/>
+<entry name="delete (Hash)" url="html/ref_c_hash.html#Hash.delete"/>
+<entry name="delete (Net::POPMail)" url="html/lib_network.html#Net::POPMail.delete"/>
+<entry name="delete (String)" url="html/ref_c_string.html#String.delete"/>
+<entry name="delete! (Net::POPMail)" url="html/lib_network.html#Net::POPMail.delete_oh"/>
+<entry name="delete! (String)" url="html/ref_c_string.html#String.delete_oh"/>
+<entry name="delete_at (Array)" url="html/ref_c_array.html#Array.delete_at"/>
+<entry name="delete_if (Array)" url="html/ref_c_array.html#Array.delete_if"/>
+<entry name="delete_if (Hash)" url="html/ref_c_hash.html#Hash.delete_if"/>
+<entry name="detect (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.detect"/>
+<entry name="dev (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.dev"/>
+<entry name="Dir" url="html/ref_c_dir.html"/>
+<entry name="dir (Net::FTP)" url="html/lib_network.html#Net::FTP.dir"/>
+<entry name="Directly Sharing Variables (ruby)" url="html/ext_ruby.html#UD"/>
+<entry name="directory? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.directory_qm"/>
+<entry name="directory? (FileTest)" url="html/ref_m_filetest.html#FileTest.directory_qm"/>
+<entry name="dirname (File)" url="html/ref_c_file.html#File.dirname"/>
+<entry name="dir_config (mkmf)" url="html/lib_standard.html#mkmf.dir_config"/>
+<entry name="disable (GC)" url="html/ref_m_gc.html#GC.disable"/>
+<entry name="display (Object)" url="html/ref_c_object.html#Object.display"/>
+<entry name="Distributed Ruby (ospace)" url="html/ospace.html#UG"/>
+<entry name="divmod (Numeric)" url="html/ref_c_numeric.html#Numeric.divmod"/>
+<entry name="downcase (String)" url="html/ref_c_string.html#String.downcase"/>
+<entry name="downcase! (String)" url="html/ref_c_string.html#String.downcase_oh"/>
+<entry name="Download Sites (support)" url="html/support.html#S2"/>
+<entry name="downto (Date)" url="html/lib_standard.html#Date.downto"/>
+<entry name="downto (Integer)" url="html/ref_c_integer.html#Integer.downto"/>
+<entry name="do_not_reverse_lookup (BasicSocket)" url="html/lib_network.html#BasicSocket.do_not_reverse_lookup"/>
+<entry name="do_not_reverse_lookup= (BasicSocket)" url="html/lib_network.html#BasicSocket.do_not_reverse_lookup_eq"/>
+<entry name="dump (Marshal)" url="html/ref_m_marshal.html#Marshal.dump"/>
+<entry name="dump (String)" url="html/ref_c_string.html#String.dump"/>
+<entry name="dup (Object)" url="html/ref_c_object.html#Object.dup"/>
+<entry name="E (Math)" url="html/ref_m_math.html#Math.E"/>
+<entry name="each (Array)" url="html/ref_c_array.html#Array.each"/>
+<entry name="each (Dir)" url="html/ref_c_dir.html#Dir.each"/>
+<entry name="each (GetoptLong)" url="html/lib_standard.html#GetoptLong.each"/>
+<entry name="each (Hash)" url="html/ref_c_hash.html#Hash.each"/>
+<entry name="each (IO)" url="html/ref_c_io.html#IO.each"/>
+<entry name="each (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse.each"/>
+<entry name="each (Net::POP)" url="html/lib_network.html#Net::POP.each"/>
+<entry name="each (Range)" url="html/ref_c_range.html#Range.each"/>
+<entry name="each (String)" url="html/ref_c_string.html#String.each"/>
+<entry name="each (Struct)" url="html/ref_c_struct.html#Struct.each"/>
+<entry name="each (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.each"/>
+<entry name="each_byte (IO)" url="html/ref_c_io.html#IO.each_byte"/>
+<entry name="each_byte (String)" url="html/ref_c_string.html#String.each_byte"/>
+<entry name="each_index (Array)" url="html/ref_c_array.html#Array.each_index"/>
+<entry name="each_key (Hash)" url="html/ref_c_hash.html#Hash.each_key"/>
+<entry name="each_line (IO)" url="html/ref_c_io.html#IO.each_line"/>
+<entry name="each_line (String)" url="html/ref_c_string.html#String.each_line"/>
+<entry name="each_object (ObjectSpace)" url="html/ref_m_objectspace.html#ObjectSpace.each_object"/>
+<entry name="each_pair (Hash)" url="html/ref_c_hash.html#Hash.each_pair"/>
+<entry name="each_value (Hash)" url="html/ref_c_hash.html#Hash.each_value"/>
+<entry name="each_with_index (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.each_with_index"/>
+<entry name="Editor Support (trouble)" url="html/trouble.html#UA"/>
+<entry name="egid (Process)" url="html/ref_m_process.html#Process.egid"/>
+<entry name="egid= (Process)" url="html/ref_m_process.html#Process.egid_eq"/>
+<entry name="Embedded Documentation (rdtool)" url="html/rdtool.html"/>
+<entry name="Embedding a Ruby Interpreter (ruby)" url="html/ext_ruby.html#S6"/>
+<entry name="Embedding Ruby in HTML (web)" url="html/web.html#S2"/>
+<entry name="empty? (Array)" url="html/ref_c_array.html#Array.empty_qm"/>
+<entry name="empty? (Hash)" url="html/ref_c_hash.html#Hash.empty_qm"/>
+<entry name="empty? (String)" url="html/ref_c_string.html#String.empty_qm"/>
+<entry name="enable (GC)" url="html/ref_m_gc.html#GC.enable"/>
+<entry name="end (MatchData)" url="html/ref_c_matchdata.html#MatchData.end"/>
+<entry name="end (Range)" url="html/ref_c_range.html#Range.end"/>
+<entry name="england (Date)" url="html/lib_standard.html#Date.england"/>
+<entry name="entries (Dir)" url="html/ref_c_dir.html#Dir.entries"/>
+<entry name="entries (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.entries"/>
+<entry name="Enumerable" url="html/ref_m_enumerable.html"/>
+<entry name="Environment Variables (rubyworld)" url="html/rubyworld.html#S3"/>
+<entry name="eof (IO)" url="html/ref_c_io.html#IO.eof"/>
+<entry name="eof? (IO)" url="html/ref_c_io.html#IO.eof_qm"/>
+<entry name="eql? (Array)" url="html/ref_c_array.html#Array.eql_qm"/>
+<entry name="eql? (Numeric)" url="html/ref_c_numeric.html#Numeric.eql_qm"/>
+<entry name="eql? (Object)" url="html/ref_c_object.html#Object.eql_qm"/>
+<entry name="equal? (Object)" url="html/ref_c_object.html#Object.equal_qm"/>
+<entry name="Errno" url="html/ref_m_errno.html"/>
+<entry name="error? (GetoptLong)" url="html/lib_standard.html#GetoptLong.error_qm"/>
+<entry name="error_message (GetoptLong)" url="html/lib_standard.html#GetoptLong.error_message"/>
+<entry name="escape (CGI)" url="html/lib_network.html#CGI.escape"/>
+<entry name="escape (Regexp)" url="html/ref_c_regexp.html#Regexp.escape"/>
+<entry name="escapeElement (CGI)" url="html/lib_network.html#CGI.escapeElement"/>
+<entry name="escapeHTML (CGI)" url="html/lib_network.html#CGI.escapeHTML"/>
+<entry name="euid (Process)" url="html/ref_m_process.html#Process.euid"/>
+<entry name="euid= (Process)" url="html/ref_m_process.html#Process.euid_eq"/>
+<entry name="eval (Kernel)" url="html/ref_m_kernel.html#Kernel.eval"/>
+<entry name="Evaluating Ruby Expressions in C (ruby)" url="html/ext_ruby.html#UC"/>
+<entry name="Exception" url="html/ref_c_exception.html"/>
+<entry name="exception" url="html/ref_c_exception.html#Exception.exception"/>
+<entry name="Exceptions, Catch, and Throw (exceptions)" url="html/tut_exceptions.html"/>
+<entry name="exclude_end? (Range)" url="html/ref_c_range.html#Range.exclude_end_qm"/>
+<entry name="exec (Kernel)" url="html/ref_m_kernel.html#Kernel.exec"/>
+<entry name="executable? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.executable_qm"/>
+<entry name="executable? (FileTest)" url="html/ref_m_filetest.html#FileTest.executable_qm"/>
+<entry name="executable_real? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.executable_real_qm"/>
+<entry name="executable_real? (FileTest)" url="html/ref_m_filetest.html#FileTest.executable_real_qm"/>
+<entry name="exist2? (Date)" url="html/lib_standard.html#Date.exist2_qm"/>
+<entry name="exist? (Date)" url="html/lib_standard.html#Date.exist_qm"/>
+<entry name="exist? (FileTest)" url="html/ref_m_filetest.html#FileTest.exist_qm"/>
+<entry name="exists? (FileTest)" url="html/ref_m_filetest.html#FileTest.exists_qm"/>
+<entry name="existw? (Date)" url="html/lib_standard.html#Date.existw_qm"/>
+<entry name="exit (Kernel)" url="html/ref_m_kernel.html#Kernel.exit"/>
+<entry name="exit (Thread)" url="html/ref_c_thread.html#Thread.exit"/>
+<entry name="exit! (Kernel)" url="html/ref_m_kernel.html#Kernel.exit_oh"/>
+<entry name="exit! (Process)" url="html/ref_m_process.html#Process.exit_oh"/>
+<entry name="exp (Math)" url="html/ref_m_math.html#Math.exp"/>
+<entry name="Expanding Arrays in Method Calls (methods)" url="html/tut_methods.html#UC"/>
+<entry name="expand_path (File)" url="html/ref_c_file.html#File.expand_path"/>
+<entry name="Expressions" url="html/tut_expressions.html"/>
+<entry name="extend (Object)" url="html/ref_c_object.html#Object.extend"/>
+<entry name="EXTENDED (Regexp)" url="html/ref_c_regexp.html#Regexp.EXTENDED"/>
+<entry name="Extending Objects (classes)" url="html/classes.html#UD"/>
+<entry name="Extending Ruby (ruby)" url="html/ext_ruby.html"/>
+<entry name="extend_object (Module)" url="html/ref_c_module.html#Module.extend_object"/>
+<entry name="Extensions (language)" url="html/language.html#UN"/>
+<entry name="fail (Kernel)" url="html/ref_m_kernel.html#Kernel.fail"/>
+<entry name="FalseClass" url="html/ref_c_falseclass.html"/>
+<entry name="fcntl (IO)" url="html/ref_c_io.html#IO.fcntl"/>
+<entry name="fetch (Hash)" url="html/ref_c_hash.html#Hash.fetch"/>
+<entry name="File" url="html/ref_c_file.html"/>
+<entry name="file? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.file_qm"/>
+<entry name="file? (FileTest)" url="html/ref_m_filetest.html#FileTest.file_qm"/>
+<entry name="fileno (IO)" url="html/ref_c_io.html#IO.fileno"/>
+<entry name="FileTest" url="html/ref_m_filetest.html"/>
+<entry name="fill (Array)" url="html/ref_c_array.html#Array.fill"/>
+<entry name="find" url="html/lib_standard.html#Find.find"/>
+<entry name="find (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.find"/>
+<entry name="find_all (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.find_all"/>
+<entry name="find_library (mkmf)" url="html/lib_standard.html#mkmf.find_library"/>
+<entry name="finish (Net::POP)" url="html/lib_network.html#Net::POP.finish"/>
+<entry name="finite? (Float)" url="html/ref_c_float.html#Float.finite_qm"/>
+<entry name="first (Array)" url="html/ref_c_array.html#Array.first"/>
+<entry name="first (Range)" url="html/ref_c_range.html#Range.first"/>
+<entry name="Fixnum" url="html/ref_c_fixnum.html"/>
+<entry name="flatten (Array)" url="html/ref_c_array.html#Array.flatten"/>
+<entry name="flatten! (Array)" url="html/ref_c_array.html#Array.flatten_oh"/>
+<entry name="Float" url="html/ref_c_float.html"/>
+<entry name="Float (Kernel)" url="html/ref_m_kernel.html#Kernel.Float"/>
+<entry name="flock (File)" url="html/ref_c_file.html#File.flock"/>
+<entry name="floor (Float)" url="html/ref_c_float.html#Float.floor"/>
+<entry name="flush (IO)" url="html/ref_c_io.html#IO.flush"/>
+<entry name="For ... In (expressions)" url="html/tut_expressions.html#UK"/>
+<entry name="for each (win32)" url="html/win32.html#UC"/>
+<entry name="foreach (Dir)" url="html/ref_c_dir.html#Dir.foreach"/>
+<entry name="foreach (IO)" url="html/ref_c_io.html#IO.foreach"/>
+<entry name="Foreword" url="html/foreword.html"/>
+<entry name="fork (Kernel)" url="html/ref_m_kernel.html#Kernel.fork"/>
+<entry name="fork (Process)" url="html/ref_m_process.html#Process.fork"/>
+<entry name="fork (Thread)" url="html/ref_c_thread.html#Thread.fork"/>
+<entry name="format (Kernel)" url="html/ref_m_kernel.html#Kernel.format"/>
+<entry name="Forms (web)" url="html/web.html#UC"/>
+<entry name="for_fd (Socket)" url="html/lib_network.html#Socket.for_fd"/>
+<entry name="freeze (Object)" url="html/ref_c_object.html#Object.freeze"/>
+<entry name="Freezing Objects (classes)" url="html/classes.html#S5"/>
+<entry name="frexp (Math)" url="html/ref_m_math.html#Math.frexp"/>
+<entry name="frozen? (Object)" url="html/ref_c_object.html#Object.frozen_qm"/>
+<entry name="FTP_PORT (Net::FTP)" url="html/lib_network.html#Net::FTP.FTP_PORT"/>
+<entry name="ftype (File)" url="html/ref_c_file.html#File.ftype"/>
+<entry name="ftype (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.ftype"/>
+<entry name="garbage_collect (GC)" url="html/ref_m_gc.html#GC.garbage_collect"/>
+<entry name="garbage_collect (ObjectSpace)" url="html/ref_m_objectspace.html#ObjectSpace.garbage_collect"/>
+<entry name="GC" url="html/ref_m_gc.html"/>
+<entry name="General Delimited Input (language)" url="html/language.html#UB"/>
+<entry name="get (GetoptLong)" url="html/lib_standard.html#GetoptLong.get"/>
+<entry name="get (Net::HTTP)" url="html/lib_network.html#Net::HTTP.get"/>
+<entry name="getaddress (IPSocket)" url="html/lib_network.html#IPSocket.getaddress"/>
+<entry name="getaddrinfo (Socket)" url="html/lib_network.html#Socket.getaddrinfo"/>
+<entry name="getbinaryfile (Net::FTP)" url="html/lib_network.html#Net::FTP.getbinaryfile"/>
+<entry name="getc (IO)" url="html/ref_c_io.html#IO.getc"/>
+<entry name="gethostbyaddr (Socket)" url="html/lib_network.html#Socket.gethostbyaddr"/>
+<entry name="gethostbyname (Socket)" url="html/lib_network.html#Socket.gethostbyname"/>
+<entry name="gethostbyname (TCPSocket)" url="html/lib_network.html#TCPSocket.gethostbyname"/>
+<entry name="gethostname (Socket)" url="html/lib_network.html#Socket.gethostname"/>
+<entry name="getnameinfo (Socket)" url="html/lib_network.html#Socket.getnameinfo"/>
+<entry name="getpeername (BasicSocket)" url="html/lib_network.html#BasicSocket.getpeername"/>
+<entry name="getpgid (Process)" url="html/ref_m_process.html#Process.getpgid"/>
+<entry name="getpgrp (Process)" url="html/ref_m_process.html#Process.getpgrp"/>
+<entry name="getpriority (Process)" url="html/ref_m_process.html#Process.getpriority"/>
+<entry name="gets (IO)" url="html/ref_c_io.html#IO.gets"/>
+<entry name="gets (Kernel)" url="html/ref_m_kernel.html#Kernel.gets"/>
+<entry name="getservbyname (Socket)" url="html/lib_network.html#Socket.getservbyname"/>
+<entry name="getsockname (BasicSocket)" url="html/lib_network.html#BasicSocket.getsockname"/>
+<entry name="getsockopt (BasicSocket)" url="html/lib_network.html#BasicSocket.getsockopt"/>
+<entry name="gettextfile (Net::FTP)" url="html/lib_network.html#Net::FTP.gettextfile"/>
+<entry name="Getting and Setting Properties (win32)" url="html/win32.html#UA"/>
+<entry name="Getting Widget Data (tk)" url="html/ext_tk.html#UB"/>
+<entry name="getwd (Dir)" url="html/ref_c_dir.html#Dir.getwd"/>
+<entry name="get_option (GetoptLong)" url="html/lib_standard.html#GetoptLong.get_option"/>
+<entry name="gid (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.gid"/>
+<entry name="gid (Process)" url="html/ref_m_process.html#Process.gid"/>
+<entry name="gid= (Process)" url="html/ref_m_process.html#Process.gid_eq"/>
+<entry name="glob (Dir)" url="html/ref_c_dir.html#Dir.glob"/>
+<entry name="global_variables (Kernel)" url="html/ref_m_kernel.html#Kernel.global_variables"/>
+<entry name="gm (Time)" url="html/ref_c_time.html#Time.gm"/>
+<entry name="gmt? (Time)" url="html/ref_c_time.html#Time.gmt_qm"/>
+<entry name="gmtime (Time)" url="html/ref_c_time.html#Time.gmtime"/>
+<entry name="gregorian (Date)" url="html/lib_standard.html#Date.gregorian"/>
+<entry name="gregorian_leap? (Date)" url="html/lib_standard.html#Date.gregorian_leap_qm"/>
+<entry name="grep (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.grep"/>
+<entry name="Grouping (stdtypes)" url="html/tut_stdtypes.html#UJ"/>
+<entry name="grpowned? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.grpowned_qm"/>
+<entry name="grpowned? (FileTest)" url="html/ref_m_filetest.html#FileTest.grpowned_qm"/>
+<entry name="gsub (Kernel)" url="html/ref_m_kernel.html#Kernel.gsub"/>
+<entry name="gsub (String)" url="html/ref_c_string.html#String.gsub"/>
+<entry name="gsub! (Kernel)" url="html/ref_m_kernel.html#Kernel.gsub_oh"/>
+<entry name="gsub! (String)" url="html/ref_c_string.html#String.gsub_oh"/>
+<entry name="Handling Exceptions (exceptions)" url="html/tut_exceptions.html#S2"/>
+<entry name="Hash" url="html/ref_c_hash.html"/>
+<entry name="hash (Object)" url="html/ref_c_object.html#Object.hash"/>
+<entry name="hash (String)" url="html/ref_c_string.html#String.hash"/>
+<entry name="Hashes (containers)" url="html/tut_containers.html#UB"/>
+<entry name="Hashes (language)" url="html/language.html#UG"/>
+<entry name="has_key? (CGI)" url="html/lib_network.html#CGI.has_key_qm"/>
+<entry name="has_key? (Hash)" url="html/ref_c_hash.html#Hash.has_key_qm"/>
+<entry name="has_value? (Hash)" url="html/ref_c_hash.html#Hash.has_value_qm"/>
+<entry name="have_func (mkmf)" url="html/lib_standard.html#mkmf.have_func"/>
+<entry name="have_header (mkmf)" url="html/lib_standard.html#mkmf.have_header"/>
+<entry name="have_library (mkmf)" url="html/lib_standard.html#mkmf.have_library"/>
+<entry name="head (Net::HTTP)" url="html/lib_network.html#Net::HTTP.head"/>
+<entry name="header (CGI)" url="html/lib_network.html#CGI.header"/>
+<entry name="header (Net::POPMail)" url="html/lib_network.html#Net::POPMail.header"/>
+<entry name="hex (String)" url="html/ref_c_string.html#String.hex"/>
+<entry name="Higher-Level Access (network)" url="html/lib_network.html#S2"/>
+<entry name="hour (Time)" url="html/ref_c_time.html#Time.hour"/>
+<entry name="How Classes and Objects Interact (classes)" url="html/classes.html#S1"/>
+<entry name="How Did We Get Here? (ospace)" url="html/ospace.html#UE"/>
+<entry name="HTML Output Methods (network)" url="html/lib_network.html#UA"/>
+<entry name="I (Complex)" url="html/lib_standard.html#Complex.Complex::I"/>
+<entry name="id (Object)" url="html/ref_c_object.html#Object.id"/>
+<entry name="id2name (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.id2name"/>
+<entry name="id2name (Symbol)" url="html/ref_c_symbol.html#Symbol.id2name"/>
+<entry name="If and Unless Expressions (expressions)" url="html/tut_expressions.html#UH"/>
+<entry name="If and Unless Modifiers (expressions)" url="html/tut_expressions.html#UI"/>
+<entry name="IGNORECASE (Regexp)" url="html/ref_c_regexp.html#Regexp.IGNORECASE"/>
+<entry name="im (Numeric)" url="html/ref_c_numeric.html#Numeric.im"/>
+<entry name="image (Complex)" url="html/lib_standard.html#Complex.image"/>
+<entry name="Implementing a SongList Container (containers)" url="html/tut_containers.html#UC"/>
+<entry name="Implementing Iterators (containers)" url="html/tut_containers.html#UD"/>
+<entry name="Improving Performance (web)" url="html/web.html#S3"/>
+<entry name="include (Module)" url="html/ref_c_module.html#Module.include"/>
+<entry name="include? (Array)" url="html/ref_c_array.html#Array.include_qm"/>
+<entry name="include? (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.include_qm"/>
+<entry name="include? (Hash)" url="html/ref_c_hash.html#Hash.include_qm"/>
+<entry name="include? (String)" url="html/ref_c_string.html#String.include_qm"/>
+<entry name="included_modules (Module)" url="html/ref_c_module.html#Module.included_modules"/>
+<entry name="Including Other Files (modules)" url="html/tut_modules.html#S4"/>
+<entry name="Including Other Files (rdtool)" url="html/rdtool.html#S4"/>
+<entry name="Independent Children (threads)" url="html/tut_threads.html#UH"/>
+<entry name="index (Array)" url="html/ref_c_array.html#Array.index"/>
+<entry name="index (Hash)" url="html/ref_c_hash.html#Hash.index"/>
+<entry name="index (String)" url="html/ref_c_string.html#String.index"/>
+<entry name="indexes (Array)" url="html/ref_c_array.html#Array.indexes"/>
+<entry name="indexes (Hash)" url="html/ref_c_hash.html#Hash.indexes"/>
+<entry name="indices (Array)" url="html/ref_c_array.html#Array.indices"/>
+<entry name="indices (Hash)" url="html/ref_c_hash.html#Hash.indices"/>
+<entry name="infinite? (Float)" url="html/ref_c_float.html#Float.infinite_qm"/>
+<entry name="Inheritance and Messages (classes)" url="html/tut_classes.html#S1"/>
+<entry name="Inheritance and Mixins (classes)" url="html/tut_classes.html#UA"/>
+<entry name="Inheritance and Visibility (classes)" url="html/classes.html#S4"/>
+<entry name="inherited (Class)" url="html/ref_c_class.html#Class.inherited"/>
+<entry name="Initialization File (irb)" url="html/irb.html#S2"/>
+<entry name="Inline Formatting (rdtool)" url="html/rdtool.html#S1"/>
+<entry name="ino (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.ino"/>
+<entry name="inspect (Object)" url="html/ref_c_object.html#Object.inspect"/>
+<entry name="inspect (Symbol)" url="html/ref_c_symbol.html#Symbol.inspect"/>
+<entry name="install (File)" url="html/lib_standard.html#File.install"/>
+<entry name="Installing eruby in Apache (web)" url="html/web.html#UH"/>
+<entry name="Installing Ruby (preface)" url="html/preface.html#S6"/>
+<entry name="Instance Variables in Mixins (modules)" url="html/tut_modules.html#UA"/>
+<entry name="instance_eval (Object)" url="html/ref_c_object.html#Object.instance_eval"/>
+<entry name="instance_methods (Module)" url="html/ref_c_module.html#Module.instance_methods"/>
+<entry name="instance_of? (Object)" url="html/ref_c_object.html#Object.instance_of_qm"/>
+<entry name="instance_variables (Object)" url="html/ref_c_object.html#Object.instance_variables"/>
+<entry name="Integer" url="html/ref_c_integer.html"/>
+<entry name="Integer (Kernel)" url="html/ref_m_kernel.html#Kernel.Integer"/>
+<entry name="Integer and Floating Point Numbers (language)" url="html/language.html#UC"/>
+<entry name="integer? (Integer)" url="html/ref_c_integer.html#Integer.integer_qm"/>
+<entry name="integer? (Numeric)" url="html/ref_c_numeric.html#Numeric.integer_qm"/>
+<entry name="Interactive Ruby (preface)" url="html/preface.html#UB"/>
+<entry name="Interactive Ruby (trouble)" url="html/trouble.html#S2"/>
+<entry name="Interactive Ruby Shell (irb)" url="html/irb.html"/>
+<entry name="intern (String)" url="html/ref_c_string.html#String.intern"/>
+<entry name="invert (Hash)" url="html/ref_c_hash.html#Hash.invert"/>
+<entry name="invoke (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.invoke"/>
+<entry name="IO" url="html/ref_c_io.html"/>
+<entry name="ioctl (IO)" url="html/ref_c_io.html#IO.ioctl"/>
+<entry name="Is Ruby for Me? (preface)" url="html/preface.html#S3"/>
+<entry name="isatty (IO)" url="html/ref_c_io.html#IO.isatty"/>
+<entry name="isdst (Time)" url="html/ref_c_time.html#Time.isdst"/>
+<entry name="is_a? (Object)" url="html/ref_c_object.html#Object.is_a_qm"/>
+<entry name="italy (Date)" url="html/lib_standard.html#Date.italy"/>
+<entry name="iterator? (Kernel)" url="html/ref_m_kernel.html#Kernel.iterator_qm"/>
+<entry name="Iterators (expressions)" url="html/tut_expressions.html#UJ"/>
+<entry name="Iterators and the Enumerable Module (modules)" url="html/tut_modules.html#S3"/>
+<entry name="Iterators for Reading (io)" url="html/tut_io.html#UA"/>
+<entry name="jd (Date)" url="html/lib_standard.html#Date.jd"/>
+<entry name="join (Array)" url="html/ref_c_array.html#Array.join"/>
+<entry name="join (File)" url="html/ref_c_file.html#File.join"/>
+<entry name="join (Thread)" url="html/ref_c_thread.html#Thread.join"/>
+<entry name="julian (Date)" url="html/lib_standard.html#Date.julian"/>
+<entry name="julian_leap? (Date)" url="html/lib_standard.html#Date.julian_leap_qm"/>
+<entry name="Just One More Thing (tk)" url="html/ext_tk.html#UE"/>
+<entry name="kcode (Regexp)" url="html/ref_c_regexp.html#Regexp.kcode"/>
+<entry name="Kernel" url="html/ref_m_kernel.html"/>
+<entry name="key? (Hash)" url="html/ref_c_hash.html#Hash.key_qm"/>
+<entry name="key? (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse.key_qm"/>
+<entry name="key? (Thread)" url="html/ref_c_thread.html#Thread.key_qm"/>
+<entry name="keys (CGI)" url="html/lib_network.html#CGI.keys"/>
+<entry name="keys (Hash)" url="html/ref_c_hash.html#Hash.keys"/>
+<entry name="kill (Process)" url="html/ref_m_process.html#Process.kill"/>
+<entry name="kill (Thread)" url="html/ref_c_thread.html#Thread.kill"/>
+<entry name="kind_of? (Object)" url="html/ref_c_object.html#Object.kind_of_qm"/>
+<entry name="lambda (Kernel)" url="html/ref_m_kernel.html#Kernel.lambda"/>
+<entry name="last (Array)" url="html/ref_c_array.html#Array.last"/>
+<entry name="last (Range)" url="html/ref_c_range.html#Range.last"/>
+<entry name="lastresp (Net::FTP)" url="html/lib_network.html#Net::FTP.lastresp"/>
+<entry name="last_match (Regexp)" url="html/ref_c_regexp.html#Regexp.last_match"/>
+<entry name="ldexp (Math)" url="html/ref_m_math.html#Math.ldexp"/>
+<entry name="leap? (Date)" url="html/lib_standard.html#Date.leap_qm"/>
+<entry name="length (Array)" url="html/ref_c_array.html#Array.length"/>
+<entry name="length (Hash)" url="html/ref_c_hash.html#Hash.length"/>
+<entry name="length (MatchData)" url="html/ref_c_matchdata.html#MatchData.length"/>
+<entry name="length (Range)" url="html/ref_c_range.html#Range.length"/>
+<entry name="length (String)" url="html/ref_c_string.html#String.length"/>
+<entry name="length (Struct)" url="html/ref_c_struct.html#Struct.length"/>
+<entry name="lineno (IO)" url="html/ref_c_io.html#IO.lineno"/>
+<entry name="lineno= (IO)" url="html/ref_c_io.html#IO.lineno_eq"/>
+<entry name="link (File)" url="html/ref_c_file.html#File.link"/>
+<entry name="list (Net::FTP)" url="html/lib_network.html#Net::FTP.list"/>
+<entry name="list (Thread)" url="html/ref_c_thread.html#Thread.list"/>
+<entry name="list (ThreadGroup)" url="html/ref_c_threadgroup.html#ThreadGroup.list"/>
+<entry name="listen (Socket)" url="html/lib_network.html#Socket.listen"/>
+<entry name="ljust (String)" url="html/ref_c_string.html#String.ljust"/>
+<entry name="load (Kernel)" url="html/ref_m_kernel.html#Kernel.load"/>
+<entry name="load (Marshal)" url="html/ref_m_marshal.html#Marshal.load"/>
+<entry name="local (Time)" url="html/ref_c_time.html#Time.local"/>
+<entry name="localtime (Time)" url="html/ref_c_time.html#Time.localtime"/>
+<entry name="local_variables (Kernel)" url="html/ref_m_kernel.html#Kernel.local_variables"/>
+<entry name="lock (Mutex)" url="html/lib_standard.html#Mutex.lock"/>
+<entry name="locked? (Mutex)" url="html/lib_standard.html#Mutex.locked_qm"/>
+<entry name="Locking Ruby in the Safe (taint)" url="html/taint.html"/>
+<entry name="log (Math)" url="html/ref_m_math.html#Math.log"/>
+<entry name="log10 (Math)" url="html/ref_m_math.html#Math.log10"/>
+<entry name="login (Net::FTP)" url="html/lib_network.html#Net::FTP.login"/>
+<entry name="login (Net::Telnet)" url="html/lib_network.html#Net::Telnet.login"/>
+<entry name="Looking at Classes (ospace)" url="html/ospace.html#S2"/>
+<entry name="Looking at Objects (ospace)" url="html/ospace.html#S1"/>
+<entry name="Looking Inside Classes (ospace)" url="html/ospace.html#UB"/>
+<entry name="Looking Inside Objects (ospace)" url="html/ospace.html#UA"/>
+<entry name="lookup_order (BasicSocket)" url="html/lib_network.html#BasicSocket.lookup_order"/>
+<entry name="lookup_order= (BasicSocket)" url="html/lib_network.html#BasicSocket.lookup_order_eq"/>
+<entry name="loop (Kernel)" url="html/ref_m_kernel.html#Kernel.loop"/>
+<entry name="Loops (expressions)" url="html/tut_expressions.html#S6"/>
+<entry name="ls (Net::FTP)" url="html/lib_network.html#Net::FTP.ls"/>
+<entry name="lstat (File)" url="html/ref_c_file.html#File.lstat"/>
+<entry name="Mailing Lists (support)" url="html/support.html#S4"/>
+<entry name="mails (Net::POP)" url="html/lib_network.html#Net::POP.mails"/>
+<entry name="main (Thread)" url="html/ref_c_thread.html#Thread.main"/>
+<entry name="makedirs (File)" url="html/ref_c_file.html#File.makedirs"/>
+<entry name="Making Blocks More Dynamic (methods)" url="html/tut_methods.html#UD"/>
+<entry name="Mandatory Disclaimer (rdtool)" url="html/rdtool.html#S6"/>
+<entry name="Manipulating Threads (threads)" url="html/tut_threads.html#UB"/>
+<entry name="map (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.map"/>
+<entry name="map! (Array)" url="html/ref_c_array.html#Array.map_oh"/>
+<entry name="Marshal" url="html/ref_m_marshal.html"/>
+<entry name="Marshaling and Distributed Ruby (ospace)" url="html/ospace.html#S6"/>
+<entry name="match (Regexp)" url="html/ref_c_regexp.html#Regexp.match"/>
+<entry name="MatchData" url="html/ref_c_matchdata.html"/>
+<entry name="Math" url="html/ref_m_math.html"/>
+<entry name="max (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.max"/>
+<entry name="mday (Time)" url="html/ref_c_time.html#Time.mday"/>
+<entry name="member? (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.member_qm"/>
+<entry name="member? (Hash)" url="html/ref_c_hash.html#Hash.member_qm"/>
+<entry name="members (Struct)" url="html/ref_c_struct.html#Struct.members"/>
+<entry name="Memory Allocation (ruby)" url="html/ext_ruby.html#S4"/>
+<entry name="message (Exception)" url="html/ref_c_exception.html#Exception.message"/>
+<entry name="message (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse.message"/>
+<entry name="message_loop (WIN32OLE_EVENT)" url="html/lib_windows.html#WIN32OLE_EVENT.message_loop"/>
+<entry name="Method" url="html/ref_c_method.html"/>
+<entry name="method (Object)" url="html/ref_c_object.html#Object.method"/>
+<entry name="Method Names (rdtool)" url="html/rdtool.html#S3"/>
+<entry name="methods (Object)" url="html/ref_c_object.html#Object.methods"/>
+<entry name="Methods and Blocks (methods)" url="html/tut_methods.html#UB"/>
+<entry name="method_added (Module)" url="html/ref_c_module.html#Module.method_added"/>
+<entry name="method_defined? (Module)" url="html/ref_c_module.html#Module.method_defined_qm"/>
+<entry name="method_missing (Object)" url="html/ref_c_object.html#Object.method_missing"/>
+<entry name="Microsoft Windows Support (windows)" url="html/lib_windows.html"/>
+<entry name="min (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.min"/>
+<entry name="min (Time)" url="html/ref_c_time.html#Time.min"/>
+<entry name="Miscellaneous Expressions (expressions)" url="html/tut_expressions.html#S2"/>
+<entry name="Mixin Modules (classes)" url="html/classes.html#UC"/>
+<entry name="Mixins (modules)" url="html/tut_modules.html#S2"/>
+<entry name="mjd (Date)" url="html/lib_standard.html#Date.mjd"/>
+<entry name="mkdir (Dir)" url="html/ref_c_dir.html#Dir.mkdir"/>
+<entry name="mkpath (File)" url="html/lib_standard.html#File.mkpath"/>
+<entry name="mktime (Time)" url="html/ref_c_time.html#Time.mktime"/>
+<entry name="mode (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.mode"/>
+<entry name="Module" url="html/ref_c_module.html"/>
+<entry name="Modules" url="html/tut_modules.html"/>
+<entry name="module_eval (Module)" url="html/ref_c_module.html#Module.module_eval"/>
+<entry name="module_function (Module)" url="html/ref_c_module.html#Module.module_function"/>
+<entry name="modulo (Numeric)" url="html/ref_c_numeric.html#Numeric.modulo"/>
+<entry name="mon (Time)" url="html/ref_c_time.html#Time.mon"/>
+<entry name="month (Time)" url="html/ref_c_time.html#Time.month"/>
+<entry name="More About Methods (methods)" url="html/tut_methods.html"/>
+<entry name="move (File)" url="html/ref_c_file.html#File.move"/>
+<entry name="mtime (File)" url="html/ref_c_file.html#File.mtime"/>
+<entry name="mtime (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.mtime"/>
+<entry name="mtime (Net::FTP)" url="html/lib_network.html#Net::FTP.mtime"/>
+<entry name="MULTILINE (Regexp)" url="html/ref_c_regexp.html#Regexp.MULTILINE"/>
+<entry name="Multipart Form Values (network)" url="html/lib_network.html#UB"/>
+<entry name="Multithreading (threads)" url="html/tut_threads.html#S1"/>
+<entry name="Mutual Exclusion (threads)" url="html/tut_threads.html#S3"/>
+<entry name="mv (File)" url="html/lib_standard.html#File.mv"/>
+<entry name="name (Module)" url="html/ref_c_module.html#Module.name"/>
+<entry name="Named Arguments (win32)" url="html/win32.html#UB"/>
+<entry name="Names (language)" url="html/language.html#S3"/>
+<entry name="Namespaces (modules)" url="html/tut_modules.html#S1"/>
+<entry name="nan? (Float)" url="html/ref_c_float.html#Float.nan_qm"/>
+<entry name="Nested Assignments (expressions)" url="html/tut_expressions.html#UD"/>
+<entry name="nesting (Module)" url="html/ref_c_module.html#Module.nesting"/>
+<entry name="Network and Web Libraries (network)" url="html/lib_network.html"/>
+<entry name="new (Array)" url="html/ref_c_array.html#Array.new"/>
+<entry name="new (CGI)" url="html/lib_network.html#CGI.new"/>
+<entry name="new (CGI::Session)" url="html/lib_network.html#CGI::Session.new"/>
+<entry name="new (Class)" url="html/ref_c_class.html#Class.new"/>
+<entry name="new (Complex)" url="html/lib_standard.html#Complex.new"/>
+<entry name="new (Date)" url="html/lib_standard.html#Date.new"/>
+<entry name="new (Dir)" url="html/ref_c_dir.html#Dir.new"/>
+<entry name="new (File)" url="html/ref_c_file.html#File.new"/>
+<entry name="new (GetoptLong)" url="html/lib_standard.html#GetoptLong.new"/>
+<entry name="new (Hash)" url="html/ref_c_hash.html#Hash.new"/>
+<entry name="new (intro)" url="html/intro.html"/>
+<entry name="new (IO)" url="html/ref_c_io.html#IO.new"/>
+<entry name="new (Module)" url="html/ref_c_module.html#Module.new"/>
+<entry name="new (Net::FTP)" url="html/lib_network.html#Net::FTP.new"/>
+<entry name="new (Net::HTTP)" url="html/lib_network.html#Net::HTTP.new"/>
+<entry name="new (Net::POP)" url="html/lib_network.html#Net::POP.new"/>
+<entry name="new (Net::SMTP)" url="html/lib_network.html#Net::SMTP.new"/>
+<entry name="new (Net::Telnet)" url="html/lib_network.html#Net::Telnet.new"/>
+<entry name="new (Proc)" url="html/ref_c_proc.html#Proc.new"/>
+<entry name="new (PStore)" url="html/lib_standard.html#PStore.new"/>
+<entry name="new (Range)" url="html/ref_c_range.html#Range.new"/>
+<entry name="new (Regexp)" url="html/ref_c_regexp.html#Regexp.new"/>
+<entry name="new (Socket)" url="html/lib_network.html#Socket.new"/>
+<entry name="new (SOCKSSocket)" url="html/lib_network.html#SOCKSSocket.new"/>
+<entry name="new (String)" url="html/ref_c_string.html#String.new"/>
+<entry name="new (Struct)" url="html/ref_c_struct.html#Struct.new"/>
+<entry name="new (TCPServer)" url="html/lib_network.html#TCPServer.new"/>
+<entry name="new (TCPSocket)" url="html/lib_network.html#TCPSocket.new"/>
+<entry name="new (Tempfile)" url="html/lib_standard.html#Tempfile.new"/>
+<entry name="new (Thread)" url="html/ref_c_thread.html#Thread.new"/>
+<entry name="new (ThreadGroup)" url="html/ref_c_threadgroup.html#ThreadGroup.new"/>
+<entry name="new (Time)" url="html/ref_c_time.html#Time.new"/>
+<entry name="new (UDPSocket)" url="html/lib_network.html#UDPSocket.new"/>
+<entry name="new (UNIXServer)" url="html/lib_network.html#UNIXServer.new"/>
+<entry name="new (UNIXSocket)" url="html/lib_network.html#UNIXSocket.new"/>
+<entry name="new (WeakRef)" url="html/lib_standard.html#WeakRef.new"/>
+<entry name="new (Win32API)" url="html/lib_windows.html#Win32API.new"/>
+<entry name="new (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.new"/>
+<entry name="new (WIN32OLE_EVENT)" url="html/lib_windows.html#WIN32OLE_EVENT.new"/>
+<entry name="new1 (Date)" url="html/lib_standard.html#Date.new1"/>
+<entry name="new2 (Date)" url="html/lib_standard.html#Date.new2"/>
+<entry name="new3 (Date)" url="html/lib_standard.html#Date.new3"/>
+<entry name="newsg (Date)" url="html/lib_standard.html#Date.newsg"/>
+<entry name="neww (Date)" url="html/lib_standard.html#Date.neww"/>
+<entry name="next (Date)" url="html/lib_standard.html#Date.next"/>
+<entry name="next (Integer)" url="html/ref_c_integer.html#Integer.next"/>
+<entry name="next (String)" url="html/ref_c_string.html#String.next"/>
+<entry name="next! (String)" url="html/ref_c_string.html#String.next_oh"/>
+<entry name="nil? (NilClass)" url="html/ref_c_nilclass.html#NilClass.nil_qm"/>
+<entry name="nil? (Object)" url="html/ref_c_object.html#Object.nil_qm"/>
+<entry name="NilClass" url="html/ref_c_nilclass.html"/>
+<entry name="nitems (Array)" url="html/ref_c_array.html#Array.nitems"/>
+<entry name="nlink (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.nlink"/>
+<entry name="nonzero? (Numeric)" url="html/ref_c_numeric.html#Numeric.nonzero_qm"/>
+<entry name="Notation Conventions (preface)" url="html/preface.html#S10"/>
+<entry name="now (Time)" url="html/ref_c_time.html#Time.now"/>
+<entry name="NO_ARGUMENT (GetoptLong)" url="html/lib_standard.html#GetoptLong.NO_ARGUMENT"/>
+<entry name="ns? (Date)" url="html/lib_standard.html#Date.ns_qm"/>
+<entry name="Numbers (stdtypes)" url="html/tut_stdtypes.html#S1"/>
+<entry name="Numeric" url="html/ref_c_numeric.html"/>
+<entry name="Object" url="html/ref_c_object.html"/>
+<entry name="Object Creation (tk)" url="html/ext_tk.html#UF"/>
+<entry name="Object-Oriented Design Libraries (patterns)" url="html/lib_patterns.html"/>
+<entry name="Object-Oriented Regular Expressions (stdtypes)" url="html/tut_stdtypes.html#UM"/>
+<entry name="Object-Specific Classes (classes)" url="html/classes.html#UB"/>
+<entry name="Objects and Attributes (classes)" url="html/tut_classes.html#S2"/>
+<entry name="ObjectSpace" url="html/ref_m_objectspace.html"/>
+<entry name="oct (String)" url="html/ref_c_string.html#String.oct"/>
+<entry name="offset (MatchData)" url="html/ref_c_matchdata.html#MatchData.offset"/>
+<entry name="Onward and Upward (intro)" url="html/intro.html#S8"/>
+<entry name="on_event (WIN32OLE_EVENT)" url="html/lib_windows.html#WIN32OLE_EVENT.on_event"/>
+<entry name="open (Dir)" url="html/ref_c_dir.html#Dir.open"/>
+<entry name="open (File)" url="html/ref_c_file.html#File.open"/>
+<entry name="open (Kernel)" url="html/ref_m_kernel.html#Kernel.open"/>
+<entry name="open (Net::FTP)" url="html/lib_network.html#Net::FTP.open"/>
+<entry name="open (Socket)" url="html/lib_network.html#Socket.open"/>
+<entry name="open (SOCKSSocket)" url="html/lib_network.html#SOCKSSocket.open"/>
+<entry name="open (TCPServer)" url="html/lib_network.html#TCPServer.open"/>
+<entry name="open (TCPSocket)" url="html/lib_network.html#TCPSocket.open"/>
+<entry name="open (Tempfile)" url="html/lib_standard.html#Tempfile.open"/>
+<entry name="open (UDPSocket)" url="html/lib_network.html#UDPSocket.open"/>
+<entry name="open (UNIXServer)" url="html/lib_network.html#UNIXServer.open"/>
+<entry name="open (UNIXSocket)" url="html/lib_network.html#UNIXSocket.open"/>
+<entry name="Opening and Closing Files (io)" url="html/tut_io.html#S2"/>
+<entry name="Operator Expressions (expressions)" url="html/tut_expressions.html#S1"/>
+<entry name="Optimizing (win32)" url="html/win32.html#UE"/>
+<entry name="OPTIONAL_ARGUMENT (GetoptLong)" url="html/lib_standard.html#GetoptLong.OPTIONAL_ARGUMENT"/>
+<entry name="Options (tk)" url="html/ext_tk.html#UG"/>
+<entry name="ordering (GetoptLong)" url="html/lib_standard.html#GetoptLong.ordering"/>
+<entry name="ordering= (GetoptLong)" url="html/lib_standard.html#GetoptLong.ordering_eq"/>
+<entry name="os? (Date)" url="html/lib_standard.html#Date.os_qm"/>
+<entry name="Other Forms of Assignment (expressions)" url="html/tut_expressions.html#UE"/>
+<entry name="out (CGI)" url="html/lib_network.html#CGI.out"/>
+<entry name="owned? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.owned_qm"/>
+<entry name="owned? (FileTest)" url="html/ref_m_filetest.html#FileTest.owned_qm"/>
+<entry name="p (Kernel)" url="html/ref_m_kernel.html#Kernel.p"/>
+<entry name="pack (Array)" url="html/ref_c_array.html#Array.pack"/>
+<entry name="pair (Socket)" url="html/lib_network.html#Socket.pair"/>
+<entry name="Parallel Assignment (expressions)" url="html/tut_expressions.html#UC"/>
+<entry name="params (CGI)" url="html/lib_network.html#CGI.params"/>
+<entry name="parse (CGI)" url="html/lib_network.html#CGI.parse"/>
+<entry name="parsedate" url="html/lib_standard.html#ParseDate.parsedate"/>
+<entry name="pass (Thread)" url="html/ref_c_thread.html#Thread.pass"/>
+<entry name="passive (Net::FTP)" url="html/lib_network.html#Net::FTP.passive"/>
+<entry name="passive= (Net::FTP)" url="html/lib_network.html#Net::FTP.passive_eq"/>
+<entry name="path (File)" url="html/ref_c_file.html#File.path"/>
+<entry name="path (PStore)" url="html/lib_standard.html#PStore.path"/>
+<entry name="path (Tempfile)" url="html/lib_standard.html#Tempfile.path"/>
+<entry name="path (UNIXSocket)" url="html/lib_network.html#UNIXSocket.path"/>
+<entry name="Pattern-Based Substitution (stdtypes)" url="html/tut_stdtypes.html#UK"/>
+<entry name="Patterns (stdtypes)" url="html/tut_stdtypes.html#UE"/>
+<entry name="peeraddr (IPSocket)" url="html/lib_network.html#IPSocket.peeraddr"/>
+<entry name="peeraddr (UNIXSocket)" url="html/lib_network.html#UNIXSocket.peeraddr"/>
+<entry name="Performance Considerations (ospace)" url="html/ospace.html#UC"/>
+<entry name="PERMUTE (GetoptLong)" url="html/lib_standard.html#GetoptLong.PERMUTE"/>
+<entry name="PI (Math)" url="html/ref_m_math.html#Math.PI"/>
+<entry name="pid (IO)" url="html/ref_c_io.html#IO.pid"/>
+<entry name="pid (Process)" url="html/ref_m_process.html#Process.pid"/>
+<entry name="pipe (IO)" url="html/ref_c_io.html#IO.pipe"/>
+<entry name="pipe? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.pipe_qm"/>
+<entry name="pipe? (FileTest)" url="html/ref_m_filetest.html#FileTest.pipe_qm"/>
+<entry name="PLATFORM (mkmf)" url="html/lib_standard.html#mkmf.PLATFORM"/>
+<entry name="Play It Again (exceptions)" url="html/tut_exceptions.html#UB"/>
+<entry name="polar (Complex)" url="html/lib_standard.html#Complex.polar"/>
+<entry name="pop (Array)" url="html/ref_c_array.html#Array.pop"/>
+<entry name="popen (IO)" url="html/ref_c_io.html#IO.popen"/>
+<entry name="port (Net::HTTP)" url="html/lib_network.html#Net::HTTP.port"/>
+<entry name="pos (IO)" url="html/ref_c_io.html#IO.pos"/>
+<entry name="pos= (IO)" url="html/ref_c_io.html#IO.pos_eq"/>
+<entry name="post (Net::HTTP)" url="html/lib_network.html#Net::HTTP.post"/>
+<entry name="post_match (MatchData)" url="html/ref_c_matchdata.html#MatchData.post_match"/>
+<entry name="ppid (Process)" url="html/ref_m_process.html#Process.ppid"/>
+<entry name="Preface" url="html/preface.html"/>
+<entry name="pretty (CGI)" url="html/lib_network.html#CGI.pretty"/>
+<entry name="pre_match (MatchData)" url="html/ref_c_matchdata.html#MatchData.pre_match"/>
+<entry name="print (IO)" url="html/ref_c_io.html#IO.print"/>
+<entry name="print (Kernel)" url="html/ref_m_kernel.html#Kernel.print"/>
+<entry name="print (Net::Telnet)" url="html/lib_network.html#Net::Telnet.print"/>
+<entry name="printf (IO)" url="html/ref_c_io.html#IO.printf"/>
+<entry name="printf (Kernel)" url="html/ref_m_kernel.html#Kernel.printf"/>
+<entry name="priority (Thread)" url="html/ref_c_thread.html#Thread.priority"/>
+<entry name="priority= (Thread)" url="html/ref_c_thread.html#Thread.priority_eq"/>
+<entry name="PRIO_PGRP (Process)" url="html/ref_m_process.html#Process.PRIO_PGRP"/>
+<entry name="PRIO_PROCESS (Process)" url="html/ref_m_process.html#Process.PRIO_PROCESS"/>
+<entry name="PRIO_USER (Process)" url="html/ref_m_process.html#Process.PRIO_USER"/>
+<entry name="private (Module)" url="html/ref_c_module.html#Module.private"/>
+<entry name="private_class_method (Module)" url="html/ref_c_module.html#Module.private_class_method"/>
+<entry name="private_instance_methods (Module)" url="html/ref_c_module.html#Module.private_instance_methods"/>
+<entry name="private_methods (Object)" url="html/ref_c_object.html#Object.private_methods"/>
+<entry name="Proc" url="html/ref_c_proc.html"/>
+<entry name="proc (Kernel)" url="html/ref_m_kernel.html#Kernel.proc"/>
+<entry name="Process" url="html/ref_m_process.html"/>
+<entry name="Program Termination (rubyworld)" url="html/rubyworld.html#S2"/>
+<entry name="protected (Module)" url="html/ref_c_module.html#Module.protected"/>
+<entry name="protected_instance_methods (Module)" url="html/ref_c_module.html#Module.protected_instance_methods"/>
+<entry name="protected_methods (Object)" url="html/ref_c_object.html#Object.protected_methods"/>
+<entry name="prune (Find)" url="html/lib_standard.html#Find.prune"/>
+<entry name="public (Module)" url="html/ref_c_module.html#Module.public"/>
+<entry name="public_class_method (Module)" url="html/ref_c_module.html#Module.public_class_method"/>
+<entry name="public_instance_methods (Module)" url="html/ref_c_module.html#Module.public_instance_methods"/>
+<entry name="public_methods (Object)" url="html/ref_c_object.html#Object.public_methods"/>
+<entry name="push (Array)" url="html/ref_c_array.html#Array.push"/>
+<entry name="putbinaryfile (Net::FTP)" url="html/lib_network.html#Net::FTP.putbinaryfile"/>
+<entry name="putc (IO)" url="html/ref_c_io.html#IO.putc"/>
+<entry name="putc (Kernel)" url="html/ref_m_kernel.html#Kernel.putc"/>
+<entry name="puts (IO)" url="html/ref_c_io.html#IO.puts"/>
+<entry name="puts (Kernel)" url="html/ref_m_kernel.html#Kernel.puts"/>
+<entry name="puttextfile (Net::FTP)" url="html/lib_network.html#Net::FTP.puttextfile"/>
+<entry name="pwd (Dir)" url="html/ref_c_dir.html#Dir.pwd"/>
+<entry name="quiet (GetoptLong)" url="html/lib_standard.html#GetoptLong.quiet"/>
+<entry name="quiet= (GetoptLong)" url="html/lib_standard.html#GetoptLong.quiet_eq"/>
+<entry name="quiet? (GetoptLong)" url="html/lib_standard.html#GetoptLong.quiet_qm"/>
+<entry name="quote (Regexp)" url="html/ref_c_regexp.html#Regexp.quote"/>
+<entry name="Quoting (web)" url="html/web.html#UB"/>
+<entry name="raise (Kernel)" url="html/ref_m_kernel.html#Kernel.raise"/>
+<entry name="raise (Thread)" url="html/ref_c_thread.html#Thread.raise"/>
+<entry name="Raising Exceptions (exceptions)" url="html/tut_exceptions.html#S3"/>
+<entry name="rand (Kernel)" url="html/ref_m_kernel.html#Kernel.rand"/>
+<entry name="Range" url="html/ref_c_range.html"/>
+<entry name="Ranges (language)" url="html/language.html#UE"/>
+<entry name="Ranges (stdtypes)" url="html/tut_stdtypes.html#S3"/>
+<entry name="Ranges as Conditions (stdtypes)" url="html/tut_stdtypes.html#UC"/>
+<entry name="Ranges as Intervals (stdtypes)" url="html/tut_stdtypes.html#UD"/>
+<entry name="Ranges as Sequences (stdtypes)" url="html/tut_stdtypes.html#UB"/>
+<entry name="rassoc (Array)" url="html/ref_c_array.html#Array.rassoc"/>
+<entry name="rdev (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.rdev"/>
+<entry name="read (Dir)" url="html/ref_c_dir.html#Dir.read"/>
+<entry name="read (IO)" url="html/ref_c_io.html#IO.read"/>
+<entry name="readable? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.readable_qm"/>
+<entry name="readable? (FileTest)" url="html/ref_m_filetest.html#FileTest.readable_qm"/>
+<entry name="readable_real? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.readable_real_qm"/>
+<entry name="readable_real? (FileTest)" url="html/ref_m_filetest.html#FileTest.readable_real_qm"/>
+<entry name="readchar (IO)" url="html/ref_c_io.html#IO.readchar"/>
+<entry name="Reading and 'Riting (intro)" url="html/intro.html#S7"/>
+<entry name="Reading and Writing Files (io)" url="html/tut_io.html#S3"/>
+<entry name="readline (IO)" url="html/ref_c_io.html#IO.readline"/>
+<entry name="readline (Kernel)" url="html/ref_m_kernel.html#Kernel.readline"/>
+<entry name="readlines (IO)" url="html/ref_c_io.html#IO.readlines"/>
+<entry name="readlines (Kernel)" url="html/ref_m_kernel.html#Kernel.readlines"/>
+<entry name="readlink (File)" url="html/ref_c_file.html#File.readlink"/>
+<entry name="ready (Net::SMTP)" url="html/lib_network.html#Net::SMTP.ready"/>
+<entry name="real (Complex)" url="html/lib_standard.html#Complex.real"/>
+<entry name="recv (BasicSocket)" url="html/lib_network.html#BasicSocket.recv"/>
+<entry name="recvfrom (Socket)" url="html/lib_network.html#Socket.recvfrom"/>
+<entry name="recvfrom (TCPSocket)" url="html/lib_network.html#TCPSocket.recvfrom"/>
+<entry name="recvfrom (UDPSocket)" url="html/lib_network.html#UDPSocket.recvfrom"/>
+<entry name="recvfrom (UNIXSocket)" url="html/lib_network.html#UNIXSocket.recvfrom"/>
+<entry name="Reflection, ObjectSpace, and Distributed Ruby (ospace)" url="html/ospace.html"/>
+<entry name="Regexp" url="html/ref_c_regexp.html"/>
+<entry name="Regular Expression Options (language)" url="html/language.html#UK"/>
+<entry name="Regular Expression Patterns (language)" url="html/language.html#UL"/>
+<entry name="Regular Expressions (intro)" url="html/intro.html#S5"/>
+<entry name="Regular Expressions (language)" url="html/language.html#UJ"/>
+<entry name="Regular Expressions (stdtypes)" url="html/tut_stdtypes.html#S4"/>
+<entry name="rehash (Hash)" url="html/ref_c_hash.html#Hash.rehash"/>
+<entry name="reject (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.reject"/>
+<entry name="reject (Hash)" url="html/ref_c_hash.html#Hash.reject"/>
+<entry name="reject! (Array)" url="html/ref_c_array.html#Array.reject_oh"/>
+<entry name="reject! (Hash)" url="html/ref_c_hash.html#Hash.reject_oh"/>
+<entry name="remainder (Numeric)" url="html/ref_c_numeric.html#Numeric.remainder"/>
+<entry name="remove_const (Module)" url="html/ref_c_module.html#Module.remove_const"/>
+<entry name="remove_method (Module)" url="html/ref_c_module.html#Module.remove_method"/>
+<entry name="rename (File)" url="html/ref_c_file.html#File.rename"/>
+<entry name="reopen (IO)" url="html/ref_c_io.html#IO.reopen"/>
+<entry name="Repetition (stdtypes)" url="html/tut_stdtypes.html#UH"/>
+<entry name="replace (Array)" url="html/ref_c_array.html#Array.replace"/>
+<entry name="replace (Hash)" url="html/ref_c_hash.html#Hash.replace"/>
+<entry name="replace (String)" url="html/ref_c_string.html#String.replace"/>
+<entry name="require (Kernel)" url="html/ref_m_kernel.html#Kernel.require"/>
+<entry name="REQUIRED_ARGUMENT (GetoptLong)" url="html/lib_standard.html#GetoptLong.REQUIRED_ARGUMENT"/>
+<entry name="Requirements for a Hash Key (language)" url="html/language.html#UH"/>
+<entry name="REQUIRE_ORDER (GetoptLong)" url="html/lib_standard.html#GetoptLong.REQUIRE_ORDER"/>
+<entry name="Resources (preface)" url="html/preface.html#S8"/>
+<entry name="respond_to? (Object)" url="html/ref_c_object.html#Object.respond_to_qm"/>
+<entry name="restore (Marshal)" url="html/ref_m_marshal.html#Marshal.restore"/>
+<entry name="Restrictions (irb)" url="html/irb.html#S4"/>
+<entry name="resume (Net::FTP)" url="html/lib_network.html#Net::FTP.resume"/>
+<entry name="resume= (Net::FTP)" url="html/lib_network.html#Net::FTP.resume_eq"/>
+<entry name="retrbinary (Net::FTP)" url="html/lib_network.html#Net::FTP.retrbinary"/>
+<entry name="retrlines (Net::FTP)" url="html/lib_network.html#Net::FTP.retrlines"/>
+<entry name="Retry (expressions)" url="html/tut_expressions.html#UM"/>
+<entry name="return_code (Net::FTP)" url="html/lib_network.html#Net::FTP.return_code"/>
+<entry name="RETURN_IN_ORDER (GetoptLong)" url="html/lib_standard.html#GetoptLong.RETURN_IN_ORDER"/>
+<entry name="reverse (Array)" url="html/ref_c_array.html#Array.reverse"/>
+<entry name="reverse (String)" url="html/ref_c_string.html#String.reverse"/>
+<entry name="reverse! (Array)" url="html/ref_c_array.html#Array.reverse_oh"/>
+<entry name="reverse! (String)" url="html/ref_c_string.html#String.reverse_oh"/>
+<entry name="reverse_each (Array)" url="html/ref_c_array.html#Array.reverse_each"/>
+<entry name="rewind (Dir)" url="html/ref_c_dir.html#Dir.rewind"/>
+<entry name="rewind (IO)" url="html/ref_c_io.html#IO.rewind"/>
+<entry name="rfc1123_date (CGI)" url="html/lib_network.html#CGI.rfc1123_date"/>
+<entry name="rindex (Array)" url="html/ref_c_array.html#Array.rindex"/>
+<entry name="rindex (String)" url="html/ref_c_string.html#String.rindex"/>
+<entry name="rjust (String)" url="html/ref_c_string.html#String.rjust"/>
+<entry name="rmdir (Dir)" url="html/ref_c_dir.html#Dir.rmdir"/>
+<entry name="rm_f (File)" url="html/lib_standard.html#File.rm_f"/>
+<entry name="Roadmap" url="html/roadmap.html"/>
+<entry name="root? (PStore)" url="html/lib_standard.html#PStore.root_qm"/>
+<entry name="roots (PStore)" url="html/lib_standard.html#PStore.roots"/>
+<entry name="round (Float)" url="html/ref_c_float.html#Float.round"/>
+<entry name="rtags (irb)" url="html/irb.html#UB"/>
+<entry name="rtags, xmp, and the Frame Class (irb)" url="html/irb.html#S5"/>
+<entry name="Ruby and Its World (rubyworld)" url="html/rubyworld.html"/>
+<entry name="Ruby and Microsoft Windows (win32)" url="html/win32.html"/>
+<entry name="Ruby and the Web (web)" url="html/web.html"/>
+<entry name="Ruby C Language API (ruby)" url="html/ext_ruby.html#S8"/>
+<entry name="Ruby Compared with C++ and Java (containers)" url="html/tut_containers.html#UE"/>
+<entry name="Ruby Debugger (trouble)" url="html/trouble.html#S1"/>
+<entry name="Ruby Is an Object-Oriented Language (intro)" url="html/intro.html#S1"/>
+<entry name="Ruby Objects in C (ruby)" url="html/ext_ruby.html#S1"/>
+<entry name="Ruby Ports (win32)" url="html/win32.html#S1"/>
+<entry name="Ruby Programs (preface)" url="html/preface.html#UC"/>
+<entry name="Ruby Sparkles (preface)" url="html/preface.html#S1"/>
+<entry name="Ruby Tk (tk)" url="html/ext_tk.html"/>
+<entry name="Ruby Versions (preface)" url="html/preface.html#S5"/>
+<entry name="run (Thread)" url="html/ref_c_thread.html#Thread.run"/>
+<entry name="Running Multiple Processes (threads)" url="html/tut_threads.html#S4"/>
+<entry name="Running Ruby (preface)" url="html/preface.html#S7"/>
+<entry name="Running Ruby Under Windows (win32)" url="html/win32.html#S2"/>
+<entry name="Runtime Callbacks (ospace)" url="html/ospace.html#UD"/>
+<entry name="Safe Levels (taint)" url="html/taint.html#S1"/>
+<entry name="safe_level (Thread)" url="html/ref_c_thread.html#Thread.safe_level"/>
+<entry name="safe_unlink (File)" url="html/ref_c_file.html#File.safe_unlink"/>
+<entry name="Sample Application (tk)" url="html/ext_tk.html#UD"/>
+<entry name="scan (Kernel)" url="html/ref_m_kernel.html#Kernel.scan"/>
+<entry name="scan (String)" url="html/ref_c_string.html#String.scan"/>
+<entry name="Scope of Constants and Variables (language)" url="html/language.html#UP"/>
+<entry name="Scrolling (tk)" url="html/ext_tk.html#S5"/>
+<entry name="sec (Time)" url="html/ref_c_time.html#Time.sec"/>
+<entry name="seek (Dir)" url="html/ref_c_dir.html#Dir.seek"/>
+<entry name="seek (IO)" url="html/ref_c_io.html#IO.seek"/>
+<entry name="SEEK_CUR (IO)" url="html/ref_c_io.html#IO.SEEK_CUR"/>
+<entry name="SEEK_END (IO)" url="html/ref_c_io.html#IO.SEEK_END"/>
+<entry name="SEEK_SET (IO)" url="html/ref_c_io.html#IO.SEEK_SET"/>
+<entry name="select (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.select"/>
+<entry name="select (IO)" url="html/ref_c_io.html#IO.select"/>
+<entry name="select (Kernel)" url="html/ref_m_kernel.html#Kernel.select"/>
+<entry name="send (BasicSocket)" url="html/lib_network.html#BasicSocket.send"/>
+<entry name="send (Object)" url="html/ref_c_object.html#Object.send"/>
+<entry name="send (UDPSocket)" url="html/lib_network.html#UDPSocket.send"/>
+<entry name="sendmail (Net::SMTP)" url="html/lib_network.html#Net::SMTP.sendmail"/>
+<entry name="SEPARATOR (File)" url="html/ref_c_file.html#File.SEPARATOR"/>
+<entry name="Server commands (Net::FTP)" url="html/lib_network.html#Net::FTP.Servercommands"/>
+<entry name="Sessions (web)" url="html/web.html#UF"/>
+<entry name="setgid? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.setgid_qm"/>
+<entry name="setgid? (FileTest)" url="html/ref_m_filetest.html#FileTest.setgid_qm"/>
+<entry name="setpgid (Process)" url="html/ref_m_process.html#Process.setpgid"/>
+<entry name="setpgrp (Process)" url="html/ref_m_process.html#Process.setpgrp"/>
+<entry name="setpriority (Process)" url="html/ref_m_process.html#Process.setpriority"/>
+<entry name="setsid (Process)" url="html/ref_m_process.html#Process.setsid"/>
+<entry name="setsockopt (BasicSocket)" url="html/lib_network.html#BasicSocket.setsockopt"/>
+<entry name="Setting Widget Options (tk)" url="html/ext_tk.html#UA"/>
+<entry name="Setting/Getting Options Dynamically (tk)" url="html/ext_tk.html#UC"/>
+<entry name="setuid? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.setuid_qm"/>
+<entry name="setuid? (FileTest)" url="html/ref_m_filetest.html#FileTest.setuid_qm"/>
+<entry name="set_backtrace (Exception)" url="html/ref_c_exception.html#Exception.set_backtrace"/>
+<entry name="set_options (GetoptLong)" url="html/lib_standard.html#GetoptLong.set_options"/>
+<entry name="set_trace_func (Kernel)" url="html/ref_m_kernel.html#Kernel.set_trace_func"/>
+<entry name="sg (Date)" url="html/lib_standard.html#Date.sg"/>
+<entry name="Sharing Data Between Ruby and C (ruby)" url="html/ext_ruby.html#S3"/>
+<entry name="shift (Array)" url="html/ref_c_array.html#Array.shift"/>
+<entry name="shift (Hash)" url="html/ref_c_hash.html#Hash.shift"/>
+<entry name="shutdown (BasicSocket)" url="html/lib_network.html#BasicSocket.shutdown"/>
+<entry name="signal (ConditionVariable)" url="html/lib_standard.html#ConditionVariable.signal"/>
+<entry name="Simple Tk Application (tk)" url="html/ext_tk.html#S1"/>
+<entry name="sin (Math)" url="html/ref_m_math.html#Math.sin"/>
+<entry name="Singletons and Other Constructors (classes)" url="html/tut_classes.html#UF"/>
+<entry name="singleton_methods (Object)" url="html/ref_c_object.html#Object.singleton_methods"/>
+<entry name="singleton_method_added (Kernel)" url="html/ref_m_kernel.html#Kernel.singleton_method_added"/>
+<entry name="size (Array)" url="html/ref_c_array.html#Array.size"/>
+<entry name="size (Bignum)" url="html/ref_c_bignum.html#Bignum.size"/>
+<entry name="size (File)" url="html/ref_c_file.html#File.size"/>
+<entry name="size (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.size"/>
+<entry name="size (FileTest)" url="html/ref_m_filetest.html#FileTest.size"/>
+<entry name="size (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.size"/>
+<entry name="size (Hash)" url="html/ref_c_hash.html#Hash.size"/>
+<entry name="size (MatchData)" url="html/ref_c_matchdata.html#MatchData.size"/>
+<entry name="size (Net::POPMail)" url="html/lib_network.html#Net::POPMail.size"/>
+<entry name="size (Range)" url="html/ref_c_range.html#Range.size"/>
+<entry name="size (String)" url="html/ref_c_string.html#String.size"/>
+<entry name="size (Struct)" url="html/ref_c_struct.html#Struct.size"/>
+<entry name="size? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.size_qm"/>
+<entry name="size? (FileTest)" url="html/ref_m_filetest.html#FileTest.size_qm"/>
+<entry name="sleep (Kernel)" url="html/ref_m_kernel.html#Kernel.sleep"/>
+<entry name="slice (Array)" url="html/ref_c_array.html#Array.slice"/>
+<entry name="slice (String)" url="html/ref_c_string.html#String.slice"/>
+<entry name="slice! (Array)" url="html/ref_c_array.html#Array.slice_oh"/>
+<entry name="slice! (String)" url="html/ref_c_string.html#String.slice_oh"/>
+<entry name="Socket-Level Access (network)" url="html/lib_network.html#S1"/>
+<entry name="socket? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.socket_qm"/>
+<entry name="socket? (FileTest)" url="html/ref_m_filetest.html#FileTest.socket_qm"/>
+<entry name="socketpair (Socket)" url="html/lib_network.html#Socket.socketpair"/>
+<entry name="Some Basic Ruby (intro)" url="html/intro.html#S2"/>
+<entry name="sort (Array)" url="html/ref_c_array.html#Array.sort"/>
+<entry name="sort (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.sort"/>
+<entry name="sort (Hash)" url="html/ref_c_hash.html#Hash.sort"/>
+<entry name="sort! (Array)" url="html/ref_c_array.html#Array.sort_oh"/>
+<entry name="source (Regexp)" url="html/ref_c_regexp.html#Regexp.source"/>
+<entry name="Source Layout (language)" url="html/language.html#S1"/>
+<entry name="Spawning New Processes (threads)" url="html/tut_threads.html#UG"/>
+<entry name="Specifying Access Control (classes)" url="html/tut_classes.html#UG"/>
+<entry name="split (File)" url="html/ref_c_file.html#File.split"/>
+<entry name="split (Kernel)" url="html/ref_m_kernel.html#Kernel.split"/>
+<entry name="split (String)" url="html/ref_c_string.html#String.split"/>
+<entry name="sprintf (Kernel)" url="html/ref_m_kernel.html#Kernel.sprintf"/>
+<entry name="sqrt (Math)" url="html/ref_m_math.html#Math.sqrt"/>
+<entry name="squeeze (String)" url="html/ref_c_string.html#String.squeeze"/>
+<entry name="squeeze! (String)" url="html/ref_c_string.html#String.squeeze_oh"/>
+<entry name="srand (Kernel)" url="html/ref_m_kernel.html#Kernel.srand"/>
+<entry name="Standard Library (standard)" url="html/lib_standard.html"/>
+<entry name="Standard Types (stdtypes)" url="html/tut_stdtypes.html"/>
+<entry name="start (GC)" url="html/ref_m_gc.html#GC.start"/>
+<entry name="start (Net::APOP)" url="html/lib_network.html#Net::APOP.start"/>
+<entry name="start (Net::HTTP)" url="html/lib_network.html#Net::HTTP.start"/>
+<entry name="start (Net::POP)" url="html/lib_network.html#Net::POP.start"/>
+<entry name="start (Net::SMTP)" url="html/lib_network.html#Net::SMTP.start"/>
+<entry name="start (Thread)" url="html/ref_c_thread.html#Thread.start"/>
+<entry name="Stat" url="html/ref_c_file__stat.html"/>
+<entry name="stat (File)" url="html/ref_c_file.html#File.stat"/>
+<entry name="stat (IO)" url="html/ref_c_io.html#IO.stat"/>
+<entry name="Static Linking (ruby)" url="html/ext_ruby.html#UH"/>
+<entry name="status (Thread)" url="html/ref_c_thread.html#Thread.status"/>
+<entry name="step (Date)" url="html/lib_standard.html#Date.step"/>
+<entry name="step (Integer)" url="html/ref_c_integer.html#Integer.step"/>
+<entry name="sticky? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.sticky_qm"/>
+<entry name="sticky? (FileTest)" url="html/ref_m_filetest.html#FileTest.sticky_qm"/>
+<entry name="stop (Thread)" url="html/ref_c_thread.html#Thread.stop"/>
+<entry name="stop? (Thread)" url="html/ref_c_thread.html#Thread.stop_qm"/>
+<entry name="storbinary (Net::FTP)" url="html/lib_network.html#Net::FTP.storbinary"/>
+<entry name="store (Hash)" url="html/ref_c_hash.html#Hash.store"/>
+<entry name="storlines (Net::FTP)" url="html/lib_network.html#Net::FTP.storlines"/>
+<entry name="strftime (Time)" url="html/ref_c_time.html#Time.strftime"/>
+<entry name="String" url="html/ref_c_string.html"/>
+<entry name="String (Kernel)" url="html/ref_m_kernel.html#Kernel.String"/>
+<entry name="string (MatchData)" url="html/ref_c_matchdata.html#MatchData.string"/>
+<entry name="Strings (language)" url="html/language.html#UD"/>
+<entry name="Strings (stdtypes)" url="html/tut_stdtypes.html#S2"/>
+<entry name="strip (String)" url="html/ref_c_string.html#String.strip"/>
+<entry name="strip! (String)" url="html/ref_c_string.html#String.strip_oh"/>
+<entry name="Struct" url="html/ref_c_struct.html"/>
+<entry name="sub (Kernel)" url="html/ref_m_kernel.html#Kernel.sub"/>
+<entry name="sub (String)" url="html/ref_c_string.html#String.sub"/>
+<entry name="sub! (Kernel)" url="html/ref_m_kernel.html#Kernel.sub_oh"/>
+<entry name="sub! (String)" url="html/ref_c_string.html#String.sub_oh"/>
+<entry name="Substitutions (language)" url="html/language.html#UM"/>
+<entry name="succ (Date)" url="html/lib_standard.html#Date.succ"/>
+<entry name="succ (Integer)" url="html/ref_c_integer.html#Integer.succ"/>
+<entry name="succ (String)" url="html/ref_c_string.html#String.succ"/>
+<entry name="succ! (String)" url="html/ref_c_string.html#String.succ_oh"/>
+<entry name="sum (String)" url="html/ref_c_string.html#String.sum"/>
+<entry name="superclass (Class)" url="html/ref_c_class.html#Class.superclass"/>
+<entry name="Support" url="html/support.html"/>
+<entry name="swapcase (String)" url="html/ref_c_string.html#String.swapcase"/>
+<entry name="swapcase! (String)" url="html/ref_c_string.html#String.swapcase_oh"/>
+<entry name="Symbol" url="html/ref_c_symbol.html"/>
+<entry name="Symbols (language)" url="html/language.html#UI"/>
+<entry name="symlink (File)" url="html/ref_c_file.html#File.symlink"/>
+<entry name="symlink? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.symlink_qm"/>
+<entry name="symlink? (FileTest)" url="html/ref_m_filetest.html#FileTest.symlink_qm"/>
+<entry name="sync (IO)" url="html/ref_c_io.html#IO.sync"/>
+<entry name="sync= (IO)" url="html/ref_c_io.html#IO.sync_eq"/>
+<entry name="synchronize (Mutex)" url="html/lib_standard.html#Mutex.synchronize"/>
+<entry name="syscall (Kernel)" url="html/ref_m_kernel.html#Kernel.syscall"/>
+<entry name="syscopy (File)" url="html/ref_c_file.html#File.syscopy"/>
+<entry name="sysread (IO)" url="html/ref_c_io.html#IO.sysread"/>
+<entry name="system (Kernel)" url="html/ref_m_kernel.html#Kernel.system"/>
+<entry name="System Hooks (ospace)" url="html/ospace.html#S4"/>
+<entry name="syswrite (IO)" url="html/ref_c_io.html#IO.syswrite"/>
+<entry name="taint (Object)" url="html/ref_c_object.html#Object.taint"/>
+<entry name="Tainted Objects (taint)" url="html/taint.html#S2"/>
+<entry name="tainted? (Object)" url="html/ref_c_object.html#Object.tainted_qm"/>
+<entry name="Talking to Networks (io)" url="html/tut_io.html#S4"/>
+<entry name="tan (Math)" url="html/ref_m_math.html#Math.tan"/>
+<entry name="tell (Dir)" url="html/ref_c_dir.html#Dir.tell"/>
+<entry name="tell (IO)" url="html/ref_c_io.html#IO.tell"/>
+<entry name="telnetmode (Net::Telnet)" url="html/lib_network.html#Net::Telnet.telnetmode"/>
+<entry name="telnetmode= (Net::Telnet)" url="html/lib_network.html#Net::Telnet.telnetmode_eq"/>
+<entry name="terminate (GetoptLong)" url="html/lib_standard.html#GetoptLong.terminate"/>
+<entry name="terminated? (GetoptLong)" url="html/lib_standard.html#GetoptLong.terminated_qm"/>
+<entry name="test (Kernel)" url="html/ref_m_kernel.html#Kernel.test"/>
+<entry name="thaw (Object)" url="html/ref_c_object.html#Object.thaw"/>
+<entry name="The Basic Types (language)" url="html/language.html#S2"/>
+<entry name="The Exception Class (exceptions)" url="html/tut_exceptions.html#S1"/>
+<entry name="The Frame Class (irb)" url="html/irb.html#UD"/>
+<entry name="The Mutex Class (threads)" url="html/tut_threads.html#UE"/>
+<entry name="The Ruby Language (language)" url="html/language.html"/>
+<entry name="The Visitor Pattern (patterns)" url="html/lib_patterns.html#S1"/>
+<entry name="Thread" url="html/ref_c_thread.html"/>
+<entry name="Thread Variables (threads)" url="html/tut_threads.html#UC"/>
+<entry name="ThreadGroup" url="html/ref_c_threadgroup.html"/>
+<entry name="Threads and Exceptions (threads)" url="html/tut_threads.html#UD"/>
+<entry name="Threads and Processes (threads)" url="html/tut_threads.html"/>
+<entry name="throw (Kernel)" url="html/ref_m_kernel.html#Kernel.throw"/>
+<entry name="Tidying Up (exceptions)" url="html/tut_exceptions.html#UA"/>
+<entry name="Time" url="html/ref_c_time.html"/>
+<entry name="times (Integer)" url="html/ref_c_integer.html#Integer.times"/>
+<entry name="times (Time)" url="html/ref_c_time.html#Time.times"/>
+<entry name="Tms" url="html/ref_c_struct__tms.html"/>
+<entry name="today (Date)" url="html/lib_standard.html#Date.today"/>
+<entry name="top (Net::POPMail)" url="html/lib_network.html#Net::POPMail.top"/>
+<entry name="Top-Level Execution Environment (classes)" url="html/classes.html#S3"/>
+<entry name="to_a (Array)" url="html/ref_c_array.html#Array.to_a"/>
+<entry name="to_a (Enumerable)" url="html/ref_m_enumerable.html#Enumerable.to_a"/>
+<entry name="to_a (Hash)" url="html/ref_c_hash.html#Hash.to_a"/>
+<entry name="to_a (MatchData)" url="html/ref_c_matchdata.html#MatchData.to_a"/>
+<entry name="to_a (NilClass)" url="html/ref_c_nilclass.html#NilClass.to_a"/>
+<entry name="to_a (Object)" url="html/ref_c_object.html#Object.to_a"/>
+<entry name="to_a (Struct)" url="html/ref_c_struct.html#Struct.to_a"/>
+<entry name="to_a (Time)" url="html/ref_c_time.html#Time.to_a"/>
+<entry name="to_ary (Array)" url="html/ref_c_array.html#Array.to_ary"/>
+<entry name="to_f (Bignum)" url="html/ref_c_bignum.html#Bignum.to_f"/>
+<entry name="to_f (Complex)" url="html/lib_standard.html#Complex.to_f"/>
+<entry name="to_f (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.to_f"/>
+<entry name="to_f (Float)" url="html/ref_c_float.html#Float.to_f"/>
+<entry name="to_f (String)" url="html/ref_c_string.html#String.to_f"/>
+<entry name="to_f (Time)" url="html/ref_c_time.html#Time.to_f"/>
+<entry name="to_i (Bignum)" url="html/ref_c_bignum.html#Bignum.to_i"/>
+<entry name="to_i (Complex)" url="html/lib_standard.html#Complex.to_i"/>
+<entry name="to_i (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.to_i"/>
+<entry name="to_i (Float)" url="html/ref_c_float.html#Float.to_i"/>
+<entry name="to_i (IO)" url="html/ref_c_io.html#IO.to_i"/>
+<entry name="to_i (NilClass)" url="html/ref_c_nilclass.html#NilClass.to_i"/>
+<entry name="to_i (String)" url="html/ref_c_string.html#String.to_i"/>
+<entry name="to_i (Symbol)" url="html/ref_c_symbol.html#Symbol.to_i"/>
+<entry name="to_i (Time)" url="html/ref_c_time.html#Time.to_i"/>
+<entry name="to_io (IO)" url="html/ref_c_io.html#IO.to_io"/>
+<entry name="to_proc (Method)" url="html/ref_c_method.html#Method.to_proc"/>
+<entry name="to_r (Complex)" url="html/lib_standard.html#Complex.to_r"/>
+<entry name="to_s (Array)" url="html/ref_c_array.html#Array.to_s"/>
+<entry name="to_s (Bignum)" url="html/ref_c_bignum.html#Bignum.to_s"/>
+<entry name="to_s (Complex)" url="html/lib_standard.html#Complex.to_s"/>
+<entry name="to_s (Date)" url="html/lib_standard.html#Date.to_s"/>
+<entry name="to_s (Fixnum)" url="html/ref_c_fixnum.html#Fixnum.to_s"/>
+<entry name="to_s (Float)" url="html/ref_c_float.html#Float.to_s"/>
+<entry name="to_s (Hash)" url="html/ref_c_hash.html#Hash.to_s"/>
+<entry name="to_s (MatchData)" url="html/ref_c_matchdata.html#MatchData.to_s"/>
+<entry name="to_s (NilClass)" url="html/ref_c_nilclass.html#NilClass.to_s"/>
+<entry name="to_s (Object)" url="html/ref_c_object.html#Object.to_s"/>
+<entry name="to_s (String)" url="html/ref_c_string.html#String.to_s"/>
+<entry name="to_s (Symbol)" url="html/ref_c_symbol.html#Symbol.to_s"/>
+<entry name="to_s (Time)" url="html/ref_c_time.html#Time.to_s"/>
+<entry name="to_str (String)" url="html/ref_c_string.html#String.to_str"/>
+<entry name="tr (String)" url="html/ref_c_string.html#String.tr"/>
+<entry name="tr! (String)" url="html/ref_c_string.html#String.tr_oh"/>
+<entry name="trace_var (Kernel)" url="html/ref_m_kernel.html#Kernel.trace_var"/>
+<entry name="Tracing Your Program's Execution (ospace)" url="html/ospace.html#S5"/>
+<entry name="transaction (PStore)" url="html/lib_standard.html#PStore.transaction"/>
+<entry name="Translating from Perl/Tk Documentation (tk)" url="html/ext_tk.html#S6"/>
+<entry name="trap (Kernel)" url="html/ref_m_kernel.html#Kernel.trap"/>
+<entry name="TrueClass" url="html/ref_c_trueclass.html"/>
+<entry name="truncate (File)" url="html/ref_c_file.html#File.truncate"/>
+<entry name="try_lock (Mutex)" url="html/lib_standard.html#Mutex.try_lock"/>
+<entry name="tr_s (String)" url="html/ref_c_string.html#String.tr_s"/>
+<entry name="tr_s! (String)" url="html/ref_c_string.html#String.tr_s_oh"/>
+<entry name="tty? (IO)" url="html/ref_c_io.html#IO.tty_qm"/>
+<entry name="tv_sec (Time)" url="html/ref_c_time.html#Time.tv_sec"/>
+<entry name="tv_usec (Time)" url="html/ref_c_time.html#Time.tv_usec"/>
+<entry name="type (Object)" url="html/ref_c_object.html#Object.type"/>
+<entry name="uid (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.uid"/>
+<entry name="uid (Process)" url="html/ref_m_process.html#Process.uid"/>
+<entry name="uid= (Process)" url="html/ref_m_process.html#Process.uid_eq"/>
+<entry name="uidl (Net::POPMail)" url="html/lib_network.html#Net::POPMail.uidl"/>
+<entry name="umask (File)" url="html/ref_c_file.html#File.umask"/>
+<entry name="undefine_finalizer (ObjectSpace)" url="html/ref_m_objectspace.html#ObjectSpace.undefine_finalizer"/>
+<entry name="undef_method (Module)" url="html/ref_c_module.html#Module.undef_method"/>
+<entry name="unescape (CGI)" url="html/lib_network.html#CGI.unescape"/>
+<entry name="unescapeElement (CGI)" url="html/lib_network.html#CGI.unescapeElement"/>
+<entry name="unescapeHTML (CGI)" url="html/lib_network.html#CGI.unescapeHTML"/>
+<entry name="ungetc (IO)" url="html/ref_c_io.html#IO.ungetc"/>
+<entry name="uniq (Array)" url="html/ref_c_array.html#Array.uniq"/>
+<entry name="uniq! (Array)" url="html/ref_c_array.html#Array.uniq_oh"/>
+<entry name="unlink (Dir)" url="html/ref_c_dir.html#Dir.unlink"/>
+<entry name="unlink (File)" url="html/ref_c_file.html#File.unlink"/>
+<entry name="unlock (Mutex)" url="html/lib_standard.html#Mutex.unlock"/>
+<entry name="unpack (String)" url="html/ref_c_string.html#String.unpack"/>
+<entry name="unshift (Array)" url="html/ref_c_array.html#Array.unshift"/>
+<entry name="untaint (Object)" url="html/ref_c_object.html#Object.untaint"/>
+<entry name="untrace_var (Kernel)" url="html/ref_m_kernel.html#Kernel.untrace_var"/>
+<entry name="upcase (String)" url="html/ref_c_string.html#String.upcase"/>
+<entry name="upcase! (String)" url="html/ref_c_string.html#String.upcase_oh"/>
+<entry name="update (CGI::Session)" url="html/lib_network.html#CGI::Session.update"/>
+<entry name="update (Hash)" url="html/ref_c_hash.html#Hash.update"/>
+<entry name="upto (Date)" url="html/lib_standard.html#Date.upto"/>
+<entry name="upto (Integer)" url="html/ref_c_integer.html#Integer.upto"/>
+<entry name="upto (String)" url="html/ref_c_string.html#String.upto"/>
+<entry name="Use the Profiler (trouble)" url="html/trouble.html#UC"/>
+<entry name="usec (Time)" url="html/ref_c_time.html#Time.usec"/>
+<entry name="Usenet Newsgroup (support)" url="html/support.html#S3"/>
+<entry name="Using cgi.rb (web)" url="html/web.html#UA"/>
+<entry name="Using eruby (web)" url="html/web.html#UG"/>
+<entry name="Using rdtool (rdtool)" url="html/rdtool.html#S5"/>
+<entry name="utc (Time)" url="html/ref_c_time.html#Time.utc"/>
+<entry name="utc? (Time)" url="html/ref_c_time.html#Time.utc_qm"/>
+<entry name="utime (File)" url="html/ref_c_file.html#File.utime"/>
+<entry name="value (Thread)" url="html/ref_c_thread.html#Thread.value"/>
+<entry name="VALUE as a Pointer (ruby)" url="html/ext_ruby.html#UA"/>
+<entry name="VALUE as an Immediate Object (ruby)" url="html/ext_ruby.html#UB"/>
+<entry name="value? (Hash)" url="html/ref_c_hash.html#Hash.value_qm"/>
+<entry name="values (Hash)" url="html/ref_c_hash.html#Hash.values"/>
+<entry name="values (Struct)" url="html/ref_c_struct.html#Struct.values"/>
+<entry name="Variable References (tk)" url="html/ext_tk.html#UH"/>
+<entry name="Variable Scope and Loops (expressions)" url="html/tut_expressions.html#S7"/>
+<entry name="Variable-Length Argument Lists (methods)" url="html/tut_methods.html#UA"/>
+<entry name="Variable/Method Ambiguity (language)" url="html/language.html#UO"/>
+<entry name="Variables (classes)" url="html/tut_classes.html#S5"/>
+<entry name="Variables and Constants (language)" url="html/language.html#S4"/>
+<entry name="VERSION (WIN32OLE)" url="html/lib_windows.html#WIN32OLE.WIN32OLE::VERSION"/>
+<entry name="Virtual Attributes (classes)" url="html/tut_classes.html#UC"/>
+<entry name="wait (ConditionVariable)" url="html/lib_standard.html#ConditionVariable.wait"/>
+<entry name="wait (Process)" url="html/ref_m_process.html#Process.wait"/>
+<entry name="wait2 (Process)" url="html/ref_m_process.html#Process.wait2"/>
+<entry name="waitfor (Net::Telnet)" url="html/lib_network.html#Net::Telnet.waitfor"/>
+<entry name="waitpid (Process)" url="html/ref_m_process.html#Process.waitpid"/>
+<entry name="waitpid2 (Process)" url="html/ref_m_process.html#Process.waitpid2"/>
+<entry name="wakeup (Thread)" url="html/ref_c_thread.html#Thread.wakeup"/>
+<entry name="wday (Time)" url="html/ref_c_time.html#Time.wday"/>
+<entry name="weakref_alive? (WeakRef)" url="html/lib_standard.html#WeakRef.weakref_alive_qm"/>
+<entry name="Web Sites (support)" url="html/support.html#S1"/>
+<entry name="welcome (Net::FTP)" url="html/lib_network.html#Net::FTP.welcome"/>
+<entry name="What Is an IO Object? (io)" url="html/tut_io.html#S1"/>
+<entry name="What Kind of Language Is Ruby? (preface)" url="html/preface.html#S2"/>
+<entry name="When Trouble Strikes (trouble)" url="html/trouble.html"/>
+<entry name="Where Ruby Finds Its Modules (rubyworld)" url="html/rubyworld.html#S4"/>
+<entry name="Why Did We Write This Book? (preface)" url="html/preface.html#S4"/>
+<entry name="Widgets (tk)" url="html/ext_tk.html#S2"/>
+<entry name="Win32API (win32)" url="html/win32.html#S3"/>
+<entry name="Windows Automation (win32)" url="html/win32.html#S4"/>
+<entry name="WNOHANG (Process)" url="html/ref_m_process.html#Process.WNOHANG"/>
+<entry name="Working with Strings (stdtypes)" url="html/tut_stdtypes.html#UA"/>
+<entry name="Wrapping C Structures (ruby)" url="html/ext_ruby.html#UE"/>
+<entry name="Writable Attributes (classes)" url="html/tut_classes.html#UB"/>
+<entry name="writable? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.writable_qm"/>
+<entry name="writable? (FileTest)" url="html/ref_m_filetest.html#FileTest.writable_qm"/>
+<entry name="writable_real? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.writable_real_qm"/>
+<entry name="writable_real? (FileTest)" url="html/ref_m_filetest.html#FileTest.writable_real_qm"/>
+<entry name="write (IO)" url="html/ref_c_io.html#IO.write"/>
+<entry name="write (Net::Telnet)" url="html/lib_network.html#Net::Telnet.write"/>
+<entry name="Writing CGI Scripts (web)" url="html/web.html#S1"/>
+<entry name="Writing Ruby in C (ruby)" url="html/ext_ruby.html#S2"/>
+<entry name="Writing to Environment Variables (rubyworld)" url="html/rubyworld.html#UC"/>
+<entry name="Writing to Files (io)" url="html/tut_io.html#UB"/>
+<entry name="WUNTRACED (Process)" url="html/ref_m_process.html#Process.WUNTRACED"/>
+<entry name="xmp (irb)" url="html/irb.html#UC"/>
+<entry name="yday (Time)" url="html/ref_c_time.html#Time.yday"/>
+<entry name="year (Time)" url="html/ref_c_time.html#Time.year"/>
+<entry name="Your Basic, Everyday Object (classes)" url="html/classes.html#UA"/>
+<entry name="zero? (File::Stat)" url="html/ref_c_file__stat.html#File::Stat.zero_qm"/>
+<entry name="zero? (FileTest)" url="html/ref_m_filetest.html#FileTest.zero_qm"/>
+<entry name="zero? (Numeric)" url="html/ref_c_numeric.html#Numeric.zero_qm"/>
+<entry name="zone (Time)" url="html/ref_c_time.html#Time.zone"/>
+<entry name="[] (Array)" url="html/ref_c_array.html#Array._ob_cb"/>
+<entry name="[] (Bignum)" url="html/ref_c_bignum.html#Bignum._ob_cb"/>
+<entry name="[] (CGI)" url="html/lib_network.html#CGI._ob_cb"/>
+<entry name="[] (CGI::Session)" url="html/lib_network.html#CGI::Session._ob_cb"/>
+<entry name="[] (Dir)" url="html/ref_c_dir.html#Dir._ob_cb"/>
+<entry name="[] (Fixnum)" url="html/ref_c_fixnum.html#Fixnum._ob_cb"/>
+<entry name="[] (Hash)" url="html/ref_c_hash.html#Hash._ob_cb"/>
+<entry name="[] (MatchData)" url="html/ref_c_matchdata.html#MatchData._ob_cb"/>
+<entry name="[] (Method)" url="html/ref_c_method.html#Method._ob_cb"/>
+<entry name="[] (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse._ob_cb"/>
+<entry name="[] (Proc)" url="html/ref_c_proc.html#Proc._ob_cb"/>
+<entry name="[] (PStore)" url="html/lib_standard.html#PStore._ob_cb"/>
+<entry name="[] (String)" url="html/ref_c_string.html#String._ob_cb"/>
+<entry name="[] (Struct)" url="html/ref_c_struct.html#Struct._ob_cb"/>
+<entry name="[] (Thread)" url="html/ref_c_thread.html#Thread._ob_cb"/>
+<entry name="[] (WIN32OLE)" url="html/lib_windows.html#WIN32OLE._ob_cb"/>
+<entry name="[]= (Array)" url="html/ref_c_array.html#Array._ob_cb_eq"/>
+<entry name="[]= (CGI::Session)" url="html/lib_network.html#CGI::Session._ob_cb_eq"/>
+<entry name="[]= (Hash)" url="html/ref_c_hash.html#Hash._ob_cb_eq"/>
+<entry name="[]= (Net::HTTPResponse)" url="html/lib_network.html#Net::HTTPResponse._ob_cb_eq"/>
+<entry name="[]= (PStore)" url="html/lib_standard.html#PStore._ob_cb_eq"/>
+<entry name="[]= (String)" url="html/ref_c_string.html#String._ob_cb_eq"/>
+<entry name="[]= (Struct)" url="html/ref_c_struct.html#Struct._ob_cb_eq"/>
+<entry name="[]= (Thread)" url="html/ref_c_thread.html#Thread._ob_cb_eq"/>
+<entry name="[]= (WIN32OLE)" url="html/lib_windows.html#WIN32OLE._ob_cb_eq"/>
+<entry name="^ (FalseClass)" url="html/ref_c_falseclass.html#FalseClass._up"/>
+<entry name="^ (NilClass)" url="html/ref_c_nilclass.html#NilClass._up"/>
+<entry name="^ (TrueClass)" url="html/ref_c_trueclass.html#TrueClass._up"/>
+<entry name="_id2ref (ObjectSpace)" url="html/ref_m_objectspace.html#ObjectSpace._id2ref"/>
+<entry name="__id__ (Object)" url="html/ref_c_object.html#Object.__id__"/>
+<entry name="__send__ (Object)" url="html/ref_c_object.html#Object.__send__"/>
+<entry name="` (backquote) (Kernel)" url="html/ref_m_kernel.html#Kernel._bq"/>
+<entry name="` (Kernel)" url="html/ref_m_kernel.html#Kernel._bq"/>
+<entry name="| (Array)" url="html/ref_c_array.html#Array._ba"/>
+<entry name="| (FalseClass)" url="html/ref_c_falseclass.html#FalseClass._ba"/>
+<entry name="| (NilClass)" url="html/ref_c_nilclass.html#NilClass._ba"/>
+<entry name="| (TrueClass)" url="html/ref_c_trueclass.html#TrueClass._ba"/>
+<entry name="~ (Regexp)" url="html/ref_c_regexp.html#Regexp._sd"/>
+<entry name="~ (String)" url="html/ref_c_string.html#String._sd"/>
+</index>
+</kdeveloptoc>
+
diff --git a/languages/ruby/doc/ruby_bugs.toc b/languages/ruby/doc/ruby_bugs.toc
new file mode 100644
index 00000000..8e70566d
--- /dev/null
+++ b/languages/ruby/doc/ruby_bugs.toc
@@ -0,0 +1,7 @@
+<!DOCTYPE kdeveloptoc>
+<kdeveloptoc>
+<title>Ruby bugs</title>
+<base href="http://www.rubyforge.org/"/>
+<tocsect1 name="Query" url="tracker/?atid=1698&amp;group_id=426&amp;func=browse">
+</tocsect1>
+</kdeveloptoc>
diff --git a/languages/ruby/file_templates/Makefile.am b/languages/ruby/file_templates/Makefile.am
new file mode 100644
index 00000000..7b449085
--- /dev/null
+++ b/languages/ruby/file_templates/Makefile.am
@@ -0,0 +1,5 @@
+templatedir = $(kde_datadir)/kdevfilecreate/file-templates
+template_DATA = rb rhtml rxml rjs js css html.erb xml.builder js.rjs
+
+
+
diff --git a/languages/ruby/file_templates/css b/languages/ruby/file_templates/css
new file mode 100644
index 00000000..23b3f500
--- /dev/null
+++ b/languages/ruby/file_templates/css
@@ -0,0 +1,11 @@
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/ruby/file_templates/html.erb b/languages/ruby/file_templates/html.erb
new file mode 100644
index 00000000..43b3830e
--- /dev/null
+++ b/languages/ruby/file_templates/html.erb
@@ -0,0 +1,4 @@
+<!-- Copyright (C) $YEAR$ by $AUTHOR$ -->
+<!-- <$EMAIL$> -->
+
+<!-- Copyright: See COPYING file that comes with this distribution -->
diff --git a/languages/ruby/file_templates/js b/languages/ruby/file_templates/js
new file mode 100644
index 00000000..23b3f500
--- /dev/null
+++ b/languages/ruby/file_templates/js
@@ -0,0 +1,11 @@
+//
+// C++ Implementation: $MODULE$
+//
+// Description:
+//
+//
+// Author: $AUTHOR$ <$EMAIL$>, (C) $YEAR$
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
diff --git a/languages/ruby/file_templates/js.rjs b/languages/ruby/file_templates/js.rjs
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/ruby/file_templates/js.rjs
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/ruby/file_templates/rb b/languages/ruby/file_templates/rb
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/ruby/file_templates/rb
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/ruby/file_templates/rhtml b/languages/ruby/file_templates/rhtml
new file mode 100644
index 00000000..43b3830e
--- /dev/null
+++ b/languages/ruby/file_templates/rhtml
@@ -0,0 +1,4 @@
+<!-- Copyright (C) $YEAR$ by $AUTHOR$ -->
+<!-- <$EMAIL$> -->
+
+<!-- Copyright: See COPYING file that comes with this distribution -->
diff --git a/languages/ruby/file_templates/rjs b/languages/ruby/file_templates/rjs
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/ruby/file_templates/rjs
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/ruby/file_templates/rxml b/languages/ruby/file_templates/rxml
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/ruby/file_templates/rxml
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/ruby/file_templates/xml.builder b/languages/ruby/file_templates/xml.builder
new file mode 100644
index 00000000..64192c64
--- /dev/null
+++ b/languages/ruby/file_templates/xml.builder
@@ -0,0 +1,7 @@
+###########################################################################
+# Copyright (C) $YEAR$ by $AUTHOR$
+# <$EMAIL$>
+#
+# Copyright: See COPYING file that comes with this distribution
+#
+###########################################################################
diff --git a/languages/ruby/kdevrubysupport.desktop b/languages/ruby/kdevrubysupport.desktop
new file mode 100644
index 00000000..f3e8f67d
--- /dev/null
+++ b/languages/ruby/kdevrubysupport.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Ruby Support
+Comment[ca]=Suport per a Ruby
+Comment[da]=Ruby-understøttelse
+Comment[de]=Ruby-Unterstützung für KDevelop
+Comment[el]=Υποστήριξη Ruby
+Comment[es]=Soporte para Ruby
+Comment[et]=Ruby toetus
+Comment[eu]=Ruby euskarria
+Comment[fa]=پشتیبانی رابی
+Comment[fr]=Prise en charge du langage Ruby
+Comment[ga]=Tacaíocht Ruby
+Comment[gl]=Soporte para Ruby
+Comment[hi]=रूबी समर्थन
+Comment[hu]=Ruby-támogatás
+Comment[is]=Ruby stuðningur
+Comment[it]=Supporto per Ruby
+Comment[ja]=Ruby サポート
+Comment[nds]=Ünnerstütten för Ruby
+Comment[ne]=रूबि समर्थन
+Comment[nl]=Ondersteuning voor Ruby
+Comment[pl]=Obsługa: Ruby
+Comment[pt]=Suporte a Ruby
+Comment[pt_BR]=Suporte ao Ruby
+Comment[ru]=Поддержка языка Ruby
+Comment[sk]=Ruby podpora
+Comment[sl]=Podpora za Ruby
+Comment[sr]=Подршка за Ruby
+Comment[sr@Latn]=Podrška za Ruby
+Comment[sv]=Ruby-stöd
+Comment[ta]=ருபி ஆதரவு
+Comment[tg]=Ёрӣ намудани забони Ruby
+Comment[tr]=Ruby Desteği
+Comment[zh_CN]=Ruby 支持
+Comment[zh_TW]=Ruby 支援
+Name=KDevRubySupport
+Name[da]=KDevelop Ruby-understøttelse
+Name[de]=Unterstützung für Ruby (KDevelop)
+Name[hi]=के-डेव-रूबी-समर्थन
+Name[nds]=Ünnerstütten för Ruby (KDevelop)
+Name[pl]=KDevObsługaRuby
+Name[sk]=KDev Ruby podpora
+Name[sv]=KDevelop Ruby-stöd
+Name[ta]=கெடெவ் ருபி ஆதரவு
+Name[zh_TW]=KDevelop Ruby 支援
+GenericName=Ruby Support
+GenericName[ca]=Suport per a Ruby
+GenericName[da]=Ruby-understøttelse
+GenericName[de]=Unterstützung für Ruby
+GenericName[el]=Υποστήριξη Ruby
+GenericName[es]=Soporte para Ruby
+GenericName[et]=Ruby toetus
+GenericName[eu]=Ruby euskarria
+GenericName[fa]=پشتیبانی رابی
+GenericName[fr]=Prise en charge du langage Ruby
+GenericName[ga]=Tacaíocht Ruby
+GenericName[gl]=Soporte para Ruby
+GenericName[hi]=रूबी समर्थन
+GenericName[hu]=Ruby-támogatás
+GenericName[it]=Supporto a Ruby
+GenericName[ja]=Ruby サポート
+GenericName[nds]=Ünnerstütten för Ruby
+GenericName[ne]=रूबि समर्थन
+GenericName[nl]=Ondersteuning voor Ruby
+GenericName[pl]=Obsługa: Ruby
+GenericName[pt]=Suporte a Ruby
+GenericName[pt_BR]=Suporte ao Ruby
+GenericName[ru]=Поддержка языка Ruby
+GenericName[sk]=Ruby podpora
+GenericName[sl]=Podpora za Ruby
+GenericName[sr]=Подршка за Ruby
+GenericName[sr@Latn]=Podrška za Ruby
+GenericName[sv]=Ruby-stöd
+GenericName[ta]=ருபி ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони Ruby
+GenericName[tr]=Ruby Desteği
+GenericName[zh_CN]=Ruby 支持
+GenericName[zh_TW]=Ruby 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevrubysupport
+X-KDevelop-Version=5
+X-KDevelop-Language=Ruby
diff --git a/languages/ruby/kdevrubysupport.rc b/languages/ruby/kdevrubysupport.rc
new file mode 100644
index 00000000..b9269aa2
--- /dev/null
+++ b/languages/ruby/kdevrubysupport.rc
@@ -0,0 +1,20 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevRubySupport" version="4">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ <Action name="build_execute_test_function" />
+ <Action name="build_launch_browser" />
+ </Menu>
+ <Menu name="tools" >
+ <Action name="switch_to_controller" group="tools_language_operations" />
+ <Action name="switch_to_model" group="tools_language_operations" />
+ <Action name="switch_to_view" group="tools_language_operations" />
+ <Action name="switch_to_test" group="tools_language_operations" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar">
+ <Action name="build_execute" group="build_operations" />
+ <Action name="build_launch_browser" group="build_operations" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/ruby/play_run.psd b/languages/ruby/play_run.psd
new file mode 100644
index 00000000..f5a8e301
--- /dev/null
+++ b/languages/ruby/play_run.psd
Binary files differ
diff --git a/languages/ruby/qtdesignerrubyintegration.cpp b/languages/ruby/qtdesignerrubyintegration.cpp
new file mode 100644
index 00000000..8a89d0d4
--- /dev/null
+++ b/languages/ruby/qtdesignerrubyintegration.cpp
@@ -0,0 +1,93 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.net *
+ * Portions Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "qtdesignerrubyintegration.h"
+
+#include <qpair.h>
+#include <qregexp.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+#include <domutil.h>
+#include <kdevpartcontroller.h>
+#include <kdevcreatefile.h>
+#include <kdevlanguagesupport.h>
+
+#include "codemodel_utils.h"
+#include "implementationwidget.h"
+
+QtDesignerRubyIntegration::QtDesignerRubyIntegration(KDevLanguageSupport *part,
+ ImplementationWidget *impl)
+ :QtDesignerIntegration(part, impl, false, 0)
+{
+}
+
+void QtDesignerRubyIntegration::addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass)
+{
+ m_part->partController()->editDocument( KURL( klass->fileName() ) );
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController()->activePart() );
+ if( !editIface ){
+ /// @todo show messagebox
+// QDialog::accept();
+ return;
+ }
+
+ kdDebug() << "===============" << endl;
+
+ int line, column;
+ klass->getStartPosition( &line, &column );
+
+ // compute the insertion point
+ QPair<int,int> point;
+ point.first = line + 1;
+ point.second = column;
+
+ const FunctionList functionList = klass->functionList();
+ if (functionList.count() > 0)
+ {
+ int funEndLine, funEndColumn;
+ functionList.first()->getEndPosition(&funEndLine, &funEndColumn);
+ point.second = funEndColumn;
+ }
+
+ QString str = function.function;
+ str += "\n \n end\n\n";
+ str = " def " + str;
+
+ kdDebug() << "insert " << str << " into " << point.first << endl;
+
+ editIface->insertText(point.first, 0 /*pt.second*/, str );
+
+ KTextEditor::View *activeView = dynamic_cast<KTextEditor::View*>( m_part->partController()->activePart()->widget() );
+ if (activeView)
+ {
+ KTextEditor::ViewCursorInterface* cursor = dynamic_cast<KTextEditor::ViewCursorInterface*>(activeView );
+ if (cursor)
+ cursor->setCursorPositionReal(point.first, 4);
+ }
+}
+
+#include "qtdesignerrubyintegration.moc"
diff --git a/languages/ruby/qtdesignerrubyintegration.h b/languages/ruby/qtdesignerrubyintegration.h
new file mode 100644
index 00000000..3f539286
--- /dev/null
+++ b/languages/ruby/qtdesignerrubyintegration.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef QTDESIGNERRUBYINTEGRATION_H
+#define QTDESIGNERRUBYINTEGRATION_H
+
+#include <qtdesignerintegration.h>
+
+class QtDesignerRubyIntegration : public QtDesignerIntegration
+{
+Q_OBJECT
+public:
+ QtDesignerRubyIntegration(KDevLanguageSupport *part, ImplementationWidget *impl);
+
+protected:
+ void addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass);
+};
+
+#endif
diff --git a/languages/ruby/ruby_config.png b/languages/ruby/ruby_config.png
new file mode 100644
index 00000000..bf8ac762
--- /dev/null
+++ b/languages/ruby/ruby_config.png
Binary files differ
diff --git a/languages/ruby/ruby_config.psd b/languages/ruby/ruby_config.psd
new file mode 100644
index 00000000..ebeff7dd
--- /dev/null
+++ b/languages/ruby/ruby_config.psd
Binary files differ
diff --git a/languages/ruby/ruby_run.png b/languages/ruby/ruby_run.png
new file mode 100644
index 00000000..fc4aa983
--- /dev/null
+++ b/languages/ruby/ruby_run.png
Binary files differ
diff --git a/languages/ruby/rubyconfigwidget.cpp b/languages/ruby/rubyconfigwidget.cpp
new file mode 100644
index 00000000..d0ffc5b4
--- /dev/null
+++ b/languages/ruby/rubyconfigwidget.cpp
@@ -0,0 +1,53 @@
+
+#include "rubyconfigwidget.h"
+#include "domutil.h"
+
+#include <stdlib.h>
+
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kdebug.h>
+
+RubyConfigWidget::RubyConfigWidget(QDomDocument &projectDom, QWidget* parent, const char* name)
+: RubyConfigWidgetBase(parent,name), dom (projectDom) {
+ kdDebug (9019) << "Creating RubyConfigWidget" << endl;
+ interpreterEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/interpreter"));
+ if (interpreterEdit->text().isEmpty()) {
+ interpreterEdit->setText("ruby");
+ }
+ shellEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/shell"));
+ if (shellEdit->text().isEmpty()) {
+ shellEdit->setText("irb");
+ }
+ mainProgramEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/mainprogram"));
+ programArgsEdit->setText(DomUtil::readEntry(dom, "/kdevrubysupport/run/programargs"));
+ runRadioBox->setButton(DomUtil::readIntEntry(dom, "/kdevrubysupport/run/runmainprogram"));
+ terminalCheckbox->setChecked(DomUtil::readBoolEntry(dom, "/kdevrubysupport/run/terminal"));
+ characterCodingRadioBox->setButton(DomUtil::readIntEntry(dom, "/kdevrubysupport/run/charactercoding"));
+ enableFloatingToolBarBox->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/floatingtoolbar", false));
+ showConstants->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/showconstants", false));
+ traceIntoRuby->setChecked( DomUtil::readBoolEntry(dom, "/kdevrbdebugger/general/traceintoruby", false));
+ workingDir->completionObject()->setMode(KURLCompletion::DirCompletion);
+ workingDir->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+ workingDir->setURL(DomUtil::readEntry(dom, "/kdevscriptproject/run/globalcwd", "") );
+}
+
+void RubyConfigWidget::accept() {
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/interpreter", interpreterEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/shell", shellEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/mainprogram", mainProgramEdit->text());
+ DomUtil::writeEntry(dom, "/kdevrubysupport/run/programargs", programArgsEdit->text());
+ DomUtil::writeIntEntry(dom, "/kdevrubysupport/run/runmainprogram", runRadioBox->selectedId());
+ DomUtil::writeBoolEntry(dom, "/kdevrubysupport/run/terminal", terminalCheckbox->isChecked());
+ DomUtil::writeIntEntry(dom, "/kdevrubysupport/run/charactercoding", characterCodingRadioBox->selectedId());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/floatingtoolbar", enableFloatingToolBarBox->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/showconstants", showConstants->isChecked());
+ DomUtil::writeBoolEntry(dom, "/kdevrbdebugger/general/traceintoruby", traceIntoRuby->isChecked());
+ DomUtil::writeEntry(dom, "/kdevscriptproject/run/globalcwd", workingDir->url() );
+}
+
+#include "rubyconfigwidget.moc"
+
diff --git a/languages/ruby/rubyconfigwidget.h b/languages/ruby/rubyconfigwidget.h
new file mode 100644
index 00000000..a4efa6f9
--- /dev/null
+++ b/languages/ruby/rubyconfigwidget.h
@@ -0,0 +1,27 @@
+
+#ifndef RUBYCONFIGWIDGET_H
+#define RUBYCONFIGWIDGET_H
+
+#include "rubyconfigwidgetbase.h"
+
+class QDomDocument;
+
+class RubyConfigWidget : public RubyConfigWidgetBase
+{
+ Q_OBJECT
+public:
+ RubyConfigWidget(QDomDocument &projectDom, QWidget* parent = 0, const char* name = 0);
+
+public slots:
+ void accept();
+
+protected:
+
+protected slots:
+
+private:
+ QDomDocument &dom;
+};
+
+#endif
+
diff --git a/languages/ruby/rubyconfigwidgetbase.ui b/languages/ruby/rubyconfigwidgetbase.ui
new file mode 100644
index 00000000..64ae3e1c
--- /dev/null
+++ b/languages/ruby/rubyconfigwidgetbase.ui
@@ -0,0 +1,363 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>RubyConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>RubyConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>485</width>
+ <height>582</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>programArgsEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>mainProgramEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Ru&amp;by shell:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mainProgramEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is the path (or just name, if in $PATH) to the Ruby shell. Defaults to "irb". Add this line to your .irbrc file:
+def cd(dir) Dir.chdir dir end</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>interpreterEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Program &amp;arguments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>programArgsEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>These are the arguments passed to the Ruby interpreter</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <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;Ruby interpreter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>interpreterEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is the path (or just name, if in $PATH) to the Ruby interpreter. Defaults to "ruby"</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_3</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;Main program:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>programArgsEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is the name of the main program source file</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>shellEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Working Directory:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="4" column="1">
+ <property name="name">
+ <cstring>workingDir</cstring>
+ </property>
+ </widget>
+ </grid>
+ </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>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>runRadioBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Run</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>mainProgramRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Main pr&amp;ogram</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>selectedWindowRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Selected wi&amp;ndow</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>terminalCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;un applications in terminal</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want your applications to be opened in terminal window.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>enableFloatingToolBarBox</cstring>
+ </property>
+ <property name="text">
+ <string>Enable &amp;debugger floating toolbar</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want to control the debugger via a floating toolbar.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showConstants</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;constants in the debugger</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want the debugger to show constants (with many constants this may be slow).</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>traceIntoRuby</cstring>
+ </property>
+ <property name="text">
+ <string>Trace &amp;into Ruby libraries</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Trace through the Ruby code installed under sitedir in the debugger</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>characterCodingRadioBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Character Coding</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>asciiOption</cstring>
+ </property>
+ <property name="text">
+ <string>ASCII</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>0</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>eucOption</cstring>
+ </property>
+ <property name="text">
+ <string>EUC</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>sjisOption</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;JIS</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>2</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>utf8Option</cstring>
+ </property>
+ <property name="text">
+ <string>UTF-&amp;8</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>3</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</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>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>interpreterEdit</tabstop>
+ <tabstop>shellEdit</tabstop>
+ <tabstop>mainProgramEdit</tabstop>
+ <tabstop>programArgsEdit</tabstop>
+ <tabstop>mainProgramRadio</tabstop>
+ <tabstop>selectedWindowRadio</tabstop>
+ <tabstop>terminalCheckbox</tabstop>
+ <tabstop>enableFloatingToolBarBox</tabstop>
+ <tabstop>showConstants</tabstop>
+ <tabstop>traceIntoRuby</tabstop>
+ <tabstop>asciiOption</tabstop>
+ <tabstop>eucOption</tabstop>
+ <tabstop>sjisOption</tabstop>
+ <tabstop>utf8Option</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/ruby/rubyimplementationwidget.cpp b/languages/ruby/rubyimplementationwidget.cpp
new file mode 100644
index 00000000..b035a283
--- /dev/null
+++ b/languages/ruby/rubyimplementationwidget.cpp
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "rubyimplementationwidget.h"
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include <filetemplate.h>
+#include <kdevlanguagesupport.h>
+#include <kdevproject.h>
+
+RubyImplementationWidget::RubyImplementationWidget(KDevLanguageSupport* part,
+ QWidget* parent, const char* name, bool modal)
+ :ImplementationWidget(part, parent, name, modal)
+{
+}
+
+QStringList RubyImplementationWidget::createClassFiles()
+{
+ QString template_rb = "require '$BASEFILENAME$'\n\nclass $CLASSNAME$ < $BASECLASSNAME$\n\n def initialize(*k)\n super(*k)\n end\n\nend\n";
+
+ QFileInfo formInfo(m_formName);
+ template_rb.replace(QRegExp("\\$BASEFILENAME\\$"), formInfo.baseName()+".rb");
+ template_rb.replace(QRegExp("\\$CLASSNAME\\$"), classNameEdit->text());
+ template_rb.replace(QRegExp("\\$BASECLASSNAME\\$"), m_baseClassName);
+
+ template_rb = FileTemplate::read(m_part, "rb") + template_rb;
+
+ QString file_rb = fileNameEdit->text() + ".rb";
+ if (!m_part->project()->activeDirectory().isEmpty())
+ file_rb = m_part->project()->activeDirectory() + "/" + file_rb;
+ QFile file(QDir::cleanDirPath(m_part->project()->projectDirectory() + "/" + file_rb));
+ if (!file.open(IO_WriteOnly)) {
+ KMessageBox::error(0, i18n("Cannot write to file"));
+ return QStringList();
+ }
+ QTextStream stream(&file);
+ stream << template_rb;
+ file.close();
+
+ QStringList files;
+ files.append(file_rb);
+ return files;
+}
+
+#include "rubyimplementationwidget.moc"
diff --git a/languages/ruby/rubyimplementationwidget.h b/languages/ruby/rubyimplementationwidget.h
new file mode 100644
index 00000000..5f79741e
--- /dev/null
+++ b/languages/ruby/rubyimplementationwidget.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef RUBYIMPLEMENTATIONWIDGET_H
+#define RUBYIMPLEMENTATIONWIDGET_H
+
+#include <implementationwidget.h>
+
+class RubyImplementationWidget : public ImplementationWidget {
+Q_OBJECT
+public:
+ RubyImplementationWidget(KDevLanguageSupport* part, QWidget* parent = 0,
+ const char* name = 0, bool modal = true);
+
+ virtual QStringList createClassFiles();
+
+};
+
+#endif
diff --git a/languages/ruby/rubysupport_part.cpp b/languages/ruby/rubysupport_part.cpp
new file mode 100644
index 00000000..c116c05d
--- /dev/null
+++ b/languages/ruby/rubysupport_part.cpp
@@ -0,0 +1,908 @@
+#include "rubysupport_part.h"
+#include "rubyconfigwidget.h"
+#include "domutil.h"
+
+#include "qtdesignerrubyintegration.h"
+#include "rubyimplementationwidget.h"
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevlanguagesupport.h"
+#include "kdevpartcontroller.h"
+#include "kdevproject.h"
+#include "kdevappfrontend.h"
+#include "kdevplugininfo.h"
+#include "kdevshellwidget.h"
+#include "kdevquickopen.h"
+
+#include <qdir.h>
+#include <qwhatsthis.h>
+#include <qtimer.h>
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qregexp.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kprocess.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdialogbase.h>
+#include <kapplication.h>
+#include <klibloader.h>
+
+#include <ktexteditor/viewcursorinterface.h>
+
+#include <codemodel_utils.h>
+
+typedef KDevGenericFactory<RubySupportPart> RubySupportFactory;
+static const KDevPluginInfo data("kdevrubysupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevrubysupport, RubySupportFactory( data ) )
+
+RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStringList& )
+ : KDevLanguageSupport (&data, parent, name ? name : "RubySupportPart" )
+{
+ setInstance(RubySupportFactory::instance());
+ setXMLFile("kdevrubysupport.rc");
+
+ KAction *action;
+ action = new KAction( i18n("&Run"), "exec", SHIFT + Key_F9,
+ this, SLOT(slotRun()),
+ actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Run"));
+ action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));
+ action->setIcon("ruby_run.png");
+
+ action = new KAction( i18n("Run Test Under Cursor"), "exec", ALT + Key_F9,
+ this, SLOT(slotRunTestUnderCursor()),
+ actionCollection(), "build_execute_test_function" );
+ action->setToolTip(i18n("Run Test Under Cursor"));
+ action->setWhatsThis(i18n("<b>Run Test Under Cursor</b><p>Runs the function under the cursor as test."));
+
+ action = new KAction( i18n("Launch Browser"), "network", 0, this, SLOT(slotBrowse()), actionCollection(), "build_launch_browser" );
+ action->setToolTip(i18n("Launch Browser"));
+ action->setWhatsThis(i18n("<b>Launch Browser</b><p>Opens a web browser pointing to the Ruby Rails server") );
+
+ action = new KAction( i18n("Switch To Controller"), 0, CTRL+ALT+Key_1, this, SLOT(slotSwitchToController()), actionCollection(), "switch_to_controller" );
+ action = new KAction( i18n("Switch To Model"), 0, CTRL+ALT+Key_2, this, SLOT(slotSwitchToModel()), actionCollection(), "switch_to_model" );
+ action = new KAction( i18n("Switch To View"), 0, CTRL+ALT+Key_3, this, SLOT(slotSwitchToView()), actionCollection(), "switch_to_view" );
+ action = new KAction( i18n("Switch To Test"), 0, CTRL+ALT+Key_4, this, SLOT(slotSwitchToTest()), actionCollection(), "switch_to_test" );
+
+ kdDebug() << "Creating RubySupportPart" << endl;
+
+ m_shellWidget = new KDevShellWidget( 0, "irb console");
+ m_shellWidget->setIcon( SmallIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
+ m_shellWidget->setCaption(i18n("Ruby Shell"));
+ mainWindow()->embedOutputView( m_shellWidget, i18n("Ruby Shell"), i18n("Ruby Shell"));
+ mainWindow()->raiseView( m_shellWidget );
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( partController(), SIGNAL(savedFile(const KURL&)),
+ this, SLOT(savedFile(const KURL&)) );
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+}
+
+
+RubySupportPart::~RubySupportPart()
+{
+ if ( m_shellWidget )
+ mainWindow()->removeView( m_shellWidget );
+ delete m_shellWidget;
+}
+
+
+void RubySupportPart::projectConfigWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Ruby"), i18n("Ruby"), BarIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
+ RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "ruby config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+void RubySupportPart::projectOpened()
+{
+ kdDebug() << "projectOpened()" << endl;
+
+ QStrList l;
+ l.append( shell().latin1() ) ;
+ m_shellWidget->setShell( shell().latin1(), l );
+ m_shellWidget->activate();
+ m_shellWidget->setAutoReactivateOnClose( true );
+
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
+ this, SLOT(addedFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
+ this, SLOT(removedFilesFromProject(const QStringList &)) );
+
+ QFileInfo program(mainProgram());
+
+ // If it's a Rails project, create the project files if they're missing
+ if (mainProgram().endsWith("script/server")) {
+ QString cmd;
+ QFileInfo server(project()->projectDirectory() + "/script/server");
+ if (! server.exists()) {
+ cmd += "rails " + project()->projectDirectory();
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(project()->projectDirectory(), cmd, false);
+ }
+ }
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot(0, this, SLOT(initialParse()));
+}
+
+void RubySupportPart::maybeParse(const QString fileName)
+{
+ QFileInfo fi(fileName);
+
+ if (fi.extension() == "rb") {
+ if (codeModel()->hasFile(fileName)) {
+ emit aboutToRemoveSourceInfo(fileName);
+ codeModel()->removeFile(codeModel()->fileByName(fileName));
+ }
+
+ parse(fileName);
+ emit addedSourceInfo( fileName );
+ }
+}
+
+void RubySupportPart::initialParse()
+{
+ kdDebug() << "initialParse()" << endl;
+
+ if (project()) {
+ kapp->setOverrideCursor(waitCursor);
+ QStringList files = project()->allFiles();
+ for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+ kdDebug() << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
+ maybeParse(project()->projectDirectory() + "/" + *it);
+ }
+
+ emit updatedSourceInfo();
+ kapp->restoreOverrideCursor();
+ } else {
+ kdDebug() << "No project" << endl;
+ }
+}
+
+void RubySupportPart::addedFilesToProject(const QStringList &fileList)
+{
+ kdDebug() << "addedFilesToProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+ maybeParse( fileName );
+ }
+}
+
+void RubySupportPart::removedFilesFromProject(const QStringList &fileList)
+{
+ kdDebug() << "removedFilesFromProject()" << endl;
+
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString fileName = project()->projectDirectory() + "/" + ( *it );
+
+ if( codeModel()->hasFile(fileName) ){
+ emit aboutToRemoveSourceInfo( fileName );
+ codeModel()->removeFile( codeModel()->fileByName(fileName) );
+ }
+ }
+}
+
+void RubySupportPart::savedFile(const KURL &fileName)
+{
+ kdDebug() << "savedFile()" << endl;
+
+ if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) {
+ maybeParse(fileName.path());
+ emit addedSourceInfo( fileName.path() );
+ }
+}
+
+KDevLanguageSupport::Features RubySupportPart::features()
+{
+ return Features(Classes | Functions | Variables | Declarations | Signals | Slots);
+}
+
+void RubySupportPart::parse(const QString &fileName)
+{
+ QFile f(QFile::encodeName(fileName));
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream stream(&f);
+
+ QRegExp classre("^\\s*(class|module)\\s+([A-Z][A-Za-z0-9_]+::)*([A-Z][A-Za-z0-9_]+)\\s*(<\\s*([A-Z][A-Za-z0-9_:]+))?$");
+ QRegExp methodre("^(\\s*)def\\s+(([A-Z][A-Za-z0-9_:]+|self)\\.)?([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~).*$");
+ QRegExp accessre("^\\s*(private|protected|public)\\s*((:([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~),?\\s*)*)$");
+ QRegExp attr_accessorre("^\\s*(attr_accessor|attr_reader|attr_writer)\\s*((:([A-Za-z0-9_]+),?\\s*)*)$");
+ QRegExp symbolre(":([^,]+),?");
+ QRegExp line_contre(",\\s*$");
+ QRegExp slot_signalre("^\\s*(slots|signals|k_dcop|k_dcop_signals)\\s*(('[^)]+\\)',?\\s*)*)$");
+ QRegExp memberre("'([A-Za-z0-9_ &*]+\\s)?([A-Za-z0-9_]+)\\([^)]*\\)',?");
+ QRegExp begin_commentre("^*=begin");
+ QRegExp end_commentre("^*=end");
+ QRegExp variablere("(@@?[A-Za-z0-9_]+)\\s*=\\s*((?:([A-Za-z0-9_:.]+)\\.new)|[\\[\"'%:/\\?\\{]|%r|<<|true|false|^\\?|0[0-7]+|[-+]?0b[01]+|[-+]?0x[1-9a-fA-F]+|[-+]?[0-9_\\.e]+|nil)?");
+ QRegExp endre("^(\\s*)end\\s*$");
+
+ FileDom m_file = codeModel()->create<FileModel>();
+ m_file->setName(fileName);
+
+ ClassDom lastClass;
+ FunctionDom lastMethod;
+ QString lastMethodIndentation;
+ int lastAccess = CodeModelItem::Public;
+ QString rawline;
+ QCString line;
+ int lineNo = 0;
+
+ while (!stream.atEnd()) {
+ rawline = stream.readLine();
+ line = rawline.stripWhiteSpace().local8Bit();
+ if (classre.search(line) != -1) {
+ if (m_file->hasClass(classre.cap(3))) {
+ lastClass = m_file->classByName( classre.cap(3) )[ 0 ];
+ } else {
+ lastClass = codeModel()->create<ClassModel>();
+ lastClass->setName(classre.cap(3));
+ lastClass->setFileName( fileName );
+ lastClass->setStartPosition( lineNo, 0 );
+ m_file->addClass( lastClass );
+ }
+
+ QString parent = classre.cap(5);
+ if (!parent.isEmpty())
+ {
+ kdDebug() << "Add parent " << parent << endl;
+ lastClass->addBaseClass( parent );
+ }
+
+ lastAccess = CodeModelItem::Public;
+ } else if (methodre.search(line) != -1) {
+ FunctionDom methodDecl;
+ if ( lastClass != 0 && lastClass->hasFunction( methodre.cap(4) ) ) {
+ FunctionList methods = lastClass->functionByName( methodre.cap(4) );
+ methodDecl = methods[0];
+ } else {
+ methodDecl = codeModel()->create<FunctionModel>();
+ methodDecl->setFileName( fileName );
+ methodDecl->setStartPosition( lineNo, 0 );
+ methodDecl->setName(methodre.cap(4));
+ }
+ FunctionDefinitionDom method = codeModel()->create<FunctionDefinitionModel>();
+ method->setName(methodre.cap(4));
+ kdDebug() << "Add method: " << method->name() << endl;
+ method->setFileName( fileName );
+ method->setStartPosition( lineNo, 0 );
+ if (methodDecl->name() == "initialize") {
+ // Ruby constructors are alway private
+ methodDecl->setAccess( CodeModelItem::Private );
+ } else {
+ methodDecl->setAccess( lastAccess );
+ }
+ if (methodre.cap(2) != "") {
+ // A ruby class/singleton method of the form <classname>.<methodname>
+ methodDecl->setStatic( true );
+ }
+
+ lastMethodIndentation = methodre.cap(1);
+
+ lastMethod = method;
+
+ if (lastClass != 0) {
+ QStringList scope( lastClass->name() );
+ method->setScope( scope );
+ methodDecl->setScope( scope );
+ if( !lastClass->hasFunction(methodDecl->name()) ) {
+ lastClass->addFunction( methodDecl );
+ }
+ if( !lastClass->hasFunctionDefinition(method->name()) ) {
+ lastClass->addFunctionDefinition( method );
+ }
+ } else if( !m_file->hasFunctionDefinition(method->name()) ){
+ m_file->addFunction( methodDecl );
+ m_file->addFunctionDefinition( method );
+ lastClass = 0;
+ }
+ } else if (endre.search(line) != -1 && lastMethod != 0 && endre.cap(1) == lastMethodIndentation ) {
+ int endCol, endLine;
+ lastMethod->getEndPosition(&endCol, &endLine);
+ if (endLine == 0) {
+ //hack to set end position of the previous method to the line
+ //where its corresponding "end" is found
+ //there's an assumption that method's "def" statement will have the same
+ //indentation level as method's "end"
+ lastMethod->setEndPosition(lineNo, 0);
+ }
+ }
+ else if (accessre.search(line) != -1 && lastClass != 0) {
+ int currentAccess = lastAccess;
+ if (accessre.cap(1) == "public") {
+ currentAccess = CodeModelItem::Public;
+ } else if (accessre.cap(1) == "protected") {
+ currentAccess = CodeModelItem::Protected;
+ } else if (accessre.cap(1) == "private") {
+ currentAccess = CodeModelItem::Private;
+ }
+
+ if (accessre.cap(2) == "") {
+ lastAccess = currentAccess;
+ } else {
+ QString symbolList( accessre.cap(2) );
+ int pos = 0;
+
+ while ( pos >= 0 ) {
+ pos = symbolre.search( symbolList, pos );
+ if (pos == -1) {
+ if (line_contre.search(line) != -1) {
+ rawline = stream.readLine();
+ if (!stream.atEnd()) {
+ line = rawline.stripWhiteSpace().local8Bit();
+ ++lineNo;
+ symbolList = line;
+ pos = 0;
+ }
+ }
+ } else {
+ if ( lastClass->hasFunction( symbolre.cap(1) ) ) {
+ FunctionList methods = lastClass->functionByName( symbolre.cap(1) );
+ methods[0]->setAccess( currentAccess );
+ }
+ pos += symbolre.matchedLength();
+ }
+ }
+ }
+ } else if (slot_signalre.search(line) != -1 && lastClass != 0) {
+ QString memberList( slot_signalre.cap(2) );
+ int pos = 0;
+
+ while ( pos >= 0 ) {
+ pos = memberre.search( memberList, pos );
+ if (pos == -1) {
+ if (line_contre.search(line) != -1) {
+ rawline = stream.readLine();
+ if (!stream.atEnd()) {
+ line = rawline.stripWhiteSpace().local8Bit();
+ ++lineNo;
+ memberList = line;
+ pos = 0;
+ }
+ }
+ } else {
+ FunctionDom method;
+ if ( lastClass->hasFunction( memberre.cap(2) ) ) {
+ FunctionList methods = lastClass->functionByName( memberre.cap(2) );
+ method = methods[0];
+ } else {
+ method = codeModel()->create<FunctionModel>();
+ }
+ QStringList scope( lastClass->name() );
+ method->setScope( scope );
+ method->setName(memberre.cap(2));
+ method->setFileName( fileName );
+ method->setStartPosition( lineNo, 0 );
+
+ if (slot_signalre.cap(1) == "slots" || slot_signalre.cap(1) == "k_dcop") {
+ method->setSlot( true );
+ } else {
+ method->setSignal( true );
+ }
+ if ( !lastClass->hasFunction(method->name()) ) {
+ lastClass->addFunction( method );
+ }
+ pos += memberre.matchedLength();
+ }
+ }
+ } else if (attr_accessorre.search(line) != -1 && lastClass != 0) {
+ QString attr( attr_accessorre.cap(1) );
+ QString symbolList( attr_accessorre.cap(2) );
+ int pos = 0;
+
+ while ( pos >= 0 ) {
+ pos = symbolre.search( symbolList, pos );
+ if (pos == -1) {
+ if (line_contre.search(line) != -1) {
+ rawline = stream.readLine();
+ if (!stream.atEnd()) {
+ line = rawline.stripWhiteSpace().local8Bit();
+ ++lineNo;
+ symbolList = line;
+ pos = 0;
+ }
+ }
+ } else {
+ QStringList scope( lastClass->name() );
+ if ( !lastClass->hasFunction(symbolre.cap(1))
+ && (attr == "attr_accessor" || attr == "attr_reader") )
+ {
+ FunctionDefinitionDom method = codeModel()->create<FunctionDefinitionModel>();
+ method->setName(symbolre.cap(1));
+ kdDebug() << "Add method: " << method->name() << endl;
+ method->setFileName( fileName );
+ method->setStartPosition( lineNo, 0 );
+ method->setScope(scope);
+ lastClass->addFunction( model_cast<FunctionDom>(method) );
+ lastClass->addFunctionDefinition( method );
+ }
+
+ if ( !lastClass->hasFunction(symbolre.cap(1) + "=")
+ && (attr == "attr_accessor" || attr == "attr_writer") )
+ {
+ FunctionDefinitionDom method = codeModel()->create<FunctionDefinitionModel>();
+ method->setName(symbolre.cap(1) + "=");
+ kdDebug() << "Add method: " << method->name() << endl;
+ method->setFileName( fileName );
+ method->setStartPosition( lineNo, 0 );
+ method->setScope(scope);
+ lastClass->addFunction( model_cast<FunctionDom>(method) );
+ lastClass->addFunctionDefinition( method );
+ }
+
+ pos += symbolre.matchedLength();
+ }
+ }
+ } else if (variablere.search(line) != -1 && lastClass != 0) {
+ VariableDom attr;
+ if ( lastClass->hasVariable( variablere.cap(1) ) ) {
+ attr = lastClass->variableByName( variablere.cap(1) );
+ } else {
+ attr = codeModel()->create<VariableModel>();
+ attr->setName( variablere.cap(1) );
+ attr->setFileName( fileName );
+ attr->setStartPosition( lineNo, 0 );
+ attr->setAccess( CodeModelItem::Private );
+ if (QRegExp("^@@").search(attr->name()) != -1) {
+ attr->setStatic( true );
+ }
+ lastClass->addVariable( attr );
+ }
+
+ // Give priority to any variable initialized in the constructor
+ // Otherwise, take the first one found in the source file
+ if (lastMethod != 0 && lastMethod->name() == "initialize") {
+ attr->setFileName( fileName );
+ attr->setStartPosition( lineNo, 0 );
+ }
+
+ if (QRegExp("^(/|%r)").search(variablere.cap(2)) != -1) {
+ attr->setType( "Regexp" );
+ } else if (QRegExp("^[\"'%<]").search(variablere.cap(2)) != -1) {
+ attr->setType( "String" );
+ } else if (QRegExp("^\\[").search(variablere.cap(2)) != -1) {
+ attr->setType( "Array" );
+ } else if (QRegExp("^\\{").search(variablere.cap(2)) != -1) {
+ attr->setType( "Hash" );
+ } else if (QRegExp("^:").search(variablere.cap(2)) != -1) {
+ attr->setType( "Symbol" );
+ } else if (QRegExp("\\.\\.").search(variablere.cap(2)) != -1) {
+ attr->setType( "Range" );
+ } else if (variablere.cap(2) == "true" || variablere.cap(2) == "false") {
+ attr->setType( "Boolean" );
+ } else if ( QRegExp("^[-+]?[0-9_]+").exactMatch(variablere.cap(2))
+ || QRegExp("^[-+]?(0x|0|0b|\\?)").search(variablere.cap(2)) != -1 )
+ {
+ attr->setType( "Integer" );
+ } else if (QRegExp("[0-9._]+(e[-+0-9]+)?").exactMatch(variablere.cap(2))) {
+ attr->setType( "Float" );
+ } else if (variablere.cap(2) != "nil" && variablere.cap(3) != "") {
+ attr->setType( variablere.cap(3) );
+ }
+ } else if (begin_commentre.search(line) != -1) {
+ while (!stream.atEnd() && end_commentre.search(line) == -1) {
+ rawline = stream.readLine();
+ line = rawline.stripWhiteSpace().local8Bit();
+ ++lineNo;
+ }
+ }
+
+ ++lineNo;
+ }
+
+ f.close();
+
+ codeModel()->addFile( m_file );
+}
+
+
+void RubySupportPart::slotRun ()
+{
+ // if we can't save all parts, then the user canceled
+ if ( partController()->saveAllFiles() == false )
+ return;
+ QFileInfo program(mainProgram());
+ if (mainProgram().endsWith("script/server")) {
+ QString cmd;
+ QFileInfo server(project()->projectDirectory() + "/script/server");
+
+ // Starting WEBrick for a Rails app. Translate a SIGTERM signal sent by KDevelop
+ // to a SIGINT expected by WEBrick (ie control&c) to terminate it.
+ cmd += "script/server& \n trap \"kill -s SIGINT $!\" TERM \n wait \n exit 0";
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(project()->projectDirectory(), cmd, false);
+ } else {
+ QString cmd = QString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
+ .arg(interpreter())
+ .arg(characterCoding())
+ .arg(runDirectory())
+ .arg(program.dirPath())
+ .arg(program.fileName())
+ .arg(programArgs());
+ startApplication(cmd);
+ }
+}
+
+QString RubySupportPart::interpreter() {
+ QString prog = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/interpreter");
+ if (prog.isEmpty()) prog = "ruby";
+ return prog;
+}
+
+QString RubySupportPart::shell() {
+ QString shell = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/shell");
+ if (shell.isEmpty()) shell = "irb";
+ return shell;
+}
+
+QString RubySupportPart::mainProgram() {
+ QString prog;
+ int runMainProgram = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/runmainprogram");
+
+ if (runMainProgram == 0) {
+ prog = project()->projectDirectory() + "/" + DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/mainprogram");
+ } else {
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if (ro_part != 0) {
+ prog = ro_part->url().path();
+ }
+ }
+
+ return prog;
+}
+
+QString RubySupportPart::runDirectory() {
+ QString cwd = DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globalcwd");
+ if (cwd.isEmpty())
+ {
+ QString mainProg = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/mainprogram");
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ if (mainProg.isEmpty() && ro_part)
+ cwd = ro_part->url().directory();
+ else
+ cwd = project()->buildDirectory();
+ }
+ return cwd;
+}
+
+QString RubySupportPart::programArgs() {
+ QString args = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/programargs");
+ return args;
+}
+
+QString RubySupportPart::characterCoding() {
+ int coding = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/charactercoding");
+ QString code("A");
+
+ switch (coding) {
+ case 0:
+ code = "A";
+ break;
+ case 1:
+ code = "E";
+ break;
+ case 2:
+ code = "S";
+ break;
+ case 3:
+ code = "U";
+ break;
+ }
+ return code;
+}
+
+
+void RubySupportPart::startApplication(const QString &program) {
+ bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevrubysupport/run/terminal");
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), program, inTerminal);
+}
+
+
+KMimeType::List RubySupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "text/x-ruby" );
+ if( mime )
+ list << mime;
+ return list;
+}
+
+KDevDesignerIntegration *RubySupportPart::designer(KInterfaceDesigner::DesignerType type)
+{
+ KDevDesignerIntegration *des = 0;
+ switch (type)
+ {
+ case KInterfaceDesigner::QtDesigner:
+ des = m_designers[type];
+ if (des == 0)
+ {
+ RubyImplementationWidget *impl = new RubyImplementationWidget(this);
+ des = new QtDesignerRubyIntegration(this, impl);
+ des->loadSettings(*project()->projectDom(),
+ "kdevrubysupport/designerintegration");
+ m_designers[type] = des;
+ }
+ break;
+ case KInterfaceDesigner::Glade:
+ break;
+ }
+ return des;
+}
+
+void RubySupportPart::projectClosed( )
+{
+ for (QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*>::const_iterator it = m_designers.begin();
+ it != m_designers.end(); ++it)
+ {
+ kdDebug() << "calling save settings fro designer integration" << endl;
+ it.data()->saveSettings(*project()->projectDom(), "kdevrubysupport/designerintegration");
+ }
+}
+
+void RubySupportPart::contextMenu( QPopupMenu * popup, const Context * context )
+{
+ if (context->hasType(Context::FileContext)){
+ const FileContext *fc = static_cast<const FileContext*>(context);
+ //this is a .ui file and only selection contains only one such file
+ KURL url = fc->urls().first();
+ if (url.fileName().endsWith(".ui"))
+ {
+ m_contextFileName = url.fileName();
+ int id = popup->insertItem(i18n("Create or Select Implementation..."), this, SLOT(slotCreateSubclass()));
+ popup->setWhatsThis(id, i18n("<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner."));
+ }
+ }
+}
+
+void RubySupportPart::slotCreateSubclass()
+{
+ QFileInfo fi(m_contextFileName);
+ if (fi.extension(false) != "ui")
+ return;
+ QtDesignerRubyIntegration *des = dynamic_cast<QtDesignerRubyIntegration*>(designer(KInterfaceDesigner::QtDesigner));
+ if (des)
+ des->selectImplementation(m_contextFileName);
+}
+
+void RubySupportPart::slotBrowse()
+{
+ kapp->invokeBrowser("http://localhost:3000/");
+}
+
+void RubySupportPart::slotSwitchToController()
+{
+ KParts::Part *activePart = partController()->activePart();
+ if (!activePart)
+ return;
+ KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
+ if (!ropart)
+ return;
+ QFileInfo file(ropart->url().path());
+ if (!file.exists())
+ return;
+ QString ext = file.extension();
+ QString name = file.baseName();
+ QString switchTo = "";
+ if ((ext == "rb") && !name.endsWith("_controller"))
+ {
+ if (name.endsWith("_test"))
+ {
+ switchTo = name.remove(QRegExp("_test$")); //the file is the test
+ switchTo = name.remove(QRegExp("_controller$")); //remove functional test name parts
+ }
+ else
+ switchTo = name;
+ }
+ else if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
+ {
+ //this is a view, we need to find the directory of this view and try to find
+ //the controller basing on the directory information
+ switchTo = file.dir().dirName();
+ }
+ QString controllersDir = project()->projectDirectory() + "/app/controllers/";
+ if (!switchTo.isEmpty())
+ {
+ if (switchTo.endsWith("s"))
+ switchTo = switchTo.mid(0, switchTo.length()-1);
+ QString singular = controllersDir + switchTo + "_controller.rb";
+ QString plural = controllersDir + switchTo + "s_controller.rb";
+ KURL url = KURL::fromPathOrURL(QFile::exists(singular) ? singular : plural);
+ partController()->editDocument(url);
+ }
+}
+
+void RubySupportPart::slotSwitchToTest()
+{
+ KParts::Part *activePart = partController()->activePart();
+ if (!activePart)
+ return;
+ KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
+ if (!ropart)
+ return;
+ QFileInfo file(ropart->url().path());
+ if (!file.exists())
+ return;
+ QString ext = file.extension();
+ QString name = file.baseName();
+ QString switchTo = "";
+
+ if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
+ {
+ //this is a view already, let's show the list of all views for this model
+ switchTo = file.dir().dirName();
+ }
+ else if (ext == "rb")
+ switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+
+ if (switchTo.isEmpty())
+ return;
+
+ if (switchTo.endsWith("s"))
+ switchTo = switchTo.mid(0, switchTo.length() - 1);
+
+ KURL::List urls;
+ QString testDir = project()->projectDirectory() + "/test/";
+ QString functionalTestS = testDir + "functional/" + switchTo + "_controller_test.rb";
+ QString functionalTestP = testDir + "functional/" + switchTo + "s_controller_test.rb";
+ QString integrationTestS = testDir + "integration/" + switchTo + "_test.rb";
+ QString integrationTestP = testDir + "integration/" + switchTo + "s_test.rb";
+ QString unitTestS = testDir + "unit/" + switchTo + "_test.rb";
+ QString unitTestP = testDir + "unit/" + switchTo + "s_test.rb";
+ if (QFile::exists(functionalTestP)) urls << KURL::fromPathOrURL(functionalTestP);
+ if (QFile::exists(integrationTestP)) urls << KURL::fromPathOrURL(integrationTestP);
+ if (QFile::exists(unitTestP)) urls << KURL::fromPathOrURL(unitTestP);
+ if (QFile::exists(functionalTestS)) urls << KURL::fromPathOrURL(functionalTestS);
+ if (QFile::exists(integrationTestS)) urls << KURL::fromPathOrURL(integrationTestS);
+ if (QFile::exists(unitTestS)) urls << KURL::fromPathOrURL(unitTestS);
+
+ KDevQuickOpen *qo = extension<KDevQuickOpen>("KDevelop/QuickOpen");
+ if (qo && !urls.isEmpty())
+ qo->quickOpenFile(urls);
+}
+
+void RubySupportPart::slotSwitchToModel()
+{
+ KParts::Part *activePart = partController()->activePart();
+ if (!activePart)
+ return;
+ KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
+ if (!ropart)
+ return;
+ QFileInfo file(ropart->url().path());
+ if (!file.exists())
+ return;
+ QString ext = file.extension();
+ QString name = file.baseName();
+ QString switchTo = "";
+
+ if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
+ {
+ //this is a view already, let's show the list of all views for this model
+ switchTo = file.dir().dirName();
+ }
+ else if (ext == "rb" && (name.endsWith("_controller") || name.endsWith("_test")))
+ {
+ switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+ }
+
+ if (switchTo.isEmpty())
+ return;
+
+ if (switchTo.endsWith("s"))
+ switchTo = switchTo.mid(0, switchTo.length() - 1);
+
+ QString modelsDir = project()->projectDirectory() + "/app/models/";
+ QString singular = modelsDir + switchTo + "_controller.rb";
+ QString plural = modelsDir + switchTo + "s_controller.rb";
+ KURL url = KURL::fromPathOrURL(QFile::exists(singular) ? singular : plural);
+
+ partController()->editDocument(KURL::fromPathOrURL(modelsDir + switchTo + ".rb"));
+}
+
+void RubySupportPart::slotSwitchToView()
+{
+ KParts::Part *activePart = partController()->activePart();
+ if (!activePart)
+ return;
+ KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
+ if (!ropart)
+ return;
+ QFileInfo file(ropart->url().path());
+ if (!file.exists())
+ return;
+ QString ext = file.extension();
+ QString name = file.baseName();
+ QString switchTo = "";
+
+ if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
+ {
+ //this is a view already, let's show the list of all views for this model
+ switchTo = file.dir().dirName();
+ }
+ else if (ext == "rb")
+ switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+
+ if (switchTo.isEmpty())
+ return;
+
+ if (switchTo.endsWith("s"))
+ switchTo = switchTo.mid(0, switchTo.length() - 1);
+
+ KURL::List urls;
+ QDir viewsDir;
+ QDir viewsDirS = QDir(project()->projectDirectory() + "/app/views/" + switchTo);
+ QDir viewsDirP = QDir(project()->projectDirectory() + "/app/views/" + switchTo + "s");
+ if (viewsDirS.exists())
+ viewsDir = viewsDirS;
+ else if (viewsDirP.exists())
+ viewsDir = viewsDirP;
+ else
+ return;
+
+ QStringList views = viewsDir.entryList();
+
+ for (QStringList::const_iterator it = views.begin(); it != views.end(); ++it)
+ {
+ QString viewName = *it;
+ if ( !(viewName.endsWith("~") || viewName == "." || viewName == "..") )
+ urls << KURL::fromPathOrURL(viewsDir.absPath() + "/" + viewName);
+ }
+ KDevQuickOpen *qo = extension<KDevQuickOpen>("KDevelop/QuickOpen");
+ if (qo)
+ qo->quickOpenFile(urls);
+}
+
+void RubySupportPart::slotRunTestUnderCursor()
+{
+ // if we can't save all parts, then the user canceled
+ if ( partController()->saveAllFiles() == false )
+ return;
+
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
+ QString prog;
+ if (ro_part != 0) {
+ prog = ro_part->url().path();
+ } else
+ return;
+
+ KTextEditor::ViewCursorInterface* activeViewCursor = dynamic_cast<KTextEditor::ViewCursorInterface*>( ro_part->widget() );
+ if (!activeViewCursor) return;
+
+ unsigned int line, column;
+ activeViewCursor->cursorPositionReal(&line, &column);
+ CodeModelUtils::CodeModelHelper hlp(codeModel(), codeModel()->fileByName(prog));
+ FunctionDom fun = hlp.functionAt(line, column);
+ if (fun == 0) return;
+
+ QFileInfo program(prog);
+ QString cmd = QString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
+ .arg(interpreter())
+ .arg(characterCoding())
+ .arg(runDirectory())
+ .arg(program.dirPath())
+ .arg(program.fileName())
+ .arg(" -n " + fun->name());
+ startApplication(cmd);
+}
+
+#include "rubysupport_part.moc"
diff --git a/languages/ruby/rubysupport_part.h b/languages/ruby/rubysupport_part.h
new file mode 100644
index 00000000..0d420cff
--- /dev/null
+++ b/languages/ruby/rubysupport_part.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2003 Marek Janukowicz <marek@janukowicz.net>
+ */
+
+
+#ifndef __KDEVPART_RUBYSUPPORT_H__
+#define __KDEVPART_RUBYSUPPORT_H__
+
+#include <qguardedptr.h>
+
+#include "kdevlanguagesupport.h"
+
+class KDialogBase;
+class QPopupMenu;
+class Context;
+class KDevShellWidget;
+
+class RubySupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+
+ RubySupportPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~RubySupportPart();
+
+ virtual KDevDesignerIntegration *designer(KInterfaceDesigner::DesignerType type);
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void slotRun();
+ void slotRunTestUnderCursor();
+ void slotCreateSubclass();
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void slotBrowse();
+
+ void initialParse();
+
+ void slotSwitchToController();
+ void slotSwitchToView();
+ void slotSwitchToModel();
+ void slotSwitchToTest();
+
+private:
+ void startApplication(const QString &program);
+ QString interpreter();
+ QString shell();
+ QString mainProgram();
+ QString runDirectory();
+ QString programArgs();
+ QString characterCoding();
+
+ void maybeParse(const QString fileName);
+ void parse(const QString &fileName);
+
+ QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*> m_designers;
+
+ QString m_contextFileName;
+ QCString m_shell;
+
+ QGuardedPtr<KDevShellWidget> m_shellWidget;
+};
+
+
+#endif
diff --git a/languages/ruby/rubytemplates b/languages/ruby/rubytemplates
new file mode 100644
index 00000000..00135842
--- /dev/null
+++ b/languages/ruby/rubytemplates
@@ -0,0 +1,101 @@
+<!DOCTYPE Templates>
+<Templates>
+ <Template code="if |
+else
+end" name="ife" description="if else" suffixes="Ruby (rb,rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)"/>
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;% | %>" name="e" description="embedded ruby code" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;% | -%>" name="en" description="embedded ruby code with newlines stripped" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;%- | -%>" name="enn" description="embedded ruby code with newlines stripped" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;%= | %>" name="pp" description="embedded ruby code that prints a result" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;%= | -%>" name="pn" description="embedded ruby code that prints a result with newlines stripped" />
+ <Template suffixes="Ruby (rb,rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="class |
+
+end" name="classd" description="class declaration" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;a&gt;|&lt;/a&gt;" name="a" description="a html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;abbr&gt;|&lt;/abbr&gt;" name="abbr" description="abbr html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;acronym&gt;|&lt;/acronym&gt;" name="acronym" description="acronym html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;address&gt;|&lt;/address&gt;" name="address" description="address html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;applet&gt;|&lt;/applet&gt;" name="applet" description="applet html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;area&gt;|&lt;/area&gt;" name="area" description="area html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;b&gt;|&lt;/b&gt;" name="b" description="b html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;base&gt;|&lt;/base&gt;" name="base" description="base html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;basefont&gt;|&lt;/basefont&gt;" name="basefont" description="basefont html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;bdo&gt;|&lt;/bdo&gt;" name="bdo" description="bdo html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;big&gt;|&lt;/big&gt;" name="big" description="big html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;blockquote&gt;|&lt;/blockquote&gt;" name="blockquote" description="blockquote html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;body&gt;|&lt;/body&gt;" name="body" description="body html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;br&gt;|&lt;/br&gt;" name="br" description="br html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;button&gt;|&lt;/button&gt;" name="button" description="button html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;caption&gt;|&lt;/caption&gt;" name="caption" description="caption html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;center&gt;|&lt;/center&gt;" name="center" description="center html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;cite&gt;|&lt;/cite&gt;" name="cite" description="cite html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;code&gt;|&lt;/code&gt;" name="code" description="code html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;col&gt;|&lt;/col&gt;" name="col" description="col html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;colgroup&gt;|&lt;/colgroup&gt;" name="colgroup" description="colgroup html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;dd&gt;|&lt;/dd&gt;" name="dd" description="dd html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;del&gt;|&lt;/del&gt;" name="del" description="del html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;dir&gt;|&lt;/dir&gt;" name="dir" description="dir html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;div&gt;|&lt;/div&gt;" name="div" description="div html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;dfn&gt;|&lt;/dfn&gt;" name="dfn" description="dfn html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;dl&gt;|&lt;/dl&gt;" name="dl" description="dl html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;dt&gt;|&lt;/dt&gt;" name="dt" description="dt html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;em&gt;|&lt;/em&gt;" name="em" description="em html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;fieldset&gt;|&lt;/fieldset&gt;" name="fieldset" description="fieldset html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;font&gt;|&lt;/font&gt;" name="font" description="font html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;form&gt;|&lt;/form&gt;" name="form" description="form html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;frame&gt;|&lt;/frame&gt;" name="frame" description="frame html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;frameset&gt;|&lt;/frameset&gt;" name="frameset" description="frameset html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;h1&gt;|&lt;/h1&gt;" name="h1" description="h1 html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;head&gt;|&lt;/head&gt;" name="head" description="head html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;hr&gt;|&lt;/hr&gt;" name="hr" description="hr html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;html&gt;|&lt;/html&gt;" name="html" description="html html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;i&gt;|&lt;/i&gt;" name="i" description="i html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;iframe&gt;|&lt;/iframe&gt;" name="iframe" description="iframe html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;img&gt;|&lt;/img&gt;" name="img" description="img html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;input&gt;|&lt;/input&gt;" name="input" description="input html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;ins&gt;|&lt;/ins&gt;" name="ins" description="ins html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;isindex&gt;|&lt;/isindex&gt;" name="isindex" description="isindex html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;kbd&gt;|&lt;/kbd&gt;" name="kbd" description="kbd html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;label&gt;|&lt;/label&gt;" name="label" description="label html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;legend&gt;|&lt;/legend&gt;" name="legend" description="legend html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;li&gt;|&lt;/li&gt;" name="li" description="li html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;link&gt;|&lt;/link&gt;" name="link" description="link html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;map&gt;|&lt;/map&gt;" name="map" description="map html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;menu&gt;|&lt;/menu&gt;" name="menu" description="menu html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;meta&gt;|&lt;/meta&gt;" name="meta" description="meta html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;noframes&gt;|&lt;/noframes&gt;" name="noframes" description="noframes html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;noscript&gt;|&lt;/noscript&gt;" name="noscript" description="noscript html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;object&gt;|&lt;/object&gt;" name="object" description="object html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;ol&gt;|&lt;/ol&gt;" name="ol" description="ol html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;optgroup&gt;|&lt;/optgroup&gt;" name="optgroup" description="optgroup html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;option&gt;|&lt;/option&gt;" name="option" description="option html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;p&gt;|&lt;/p&gt;" name="p" description="p html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;param&gt;|&lt;/param&gt;" name="param" description="param html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;pre&gt;|&lt;/pre&gt;" name="pre" description="pre html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;q&gt;|&lt;/q&gt;" name="q" description="q html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;s&gt;|&lt;/s&gt;" name="s" description="s html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;samp&gt;|&lt;/samp&gt;" name="samp" description="samp html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;script&gt;|&lt;/script&gt;" name="script" description="script html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;select&gt;|&lt;/select&gt;" name="select" description="select html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;small&gt;|&lt;/small&gt;" name="small" description="small html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;span&gt;|&lt;/span&gt;" name="span" description="span html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;strike&gt;|&lt;/strike&gt;" name="strike" description="strike html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;strong&gt;|&lt;/strong&gt;" name="strong" description="strong html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;style&gt;|&lt;/style&gt;" name="style" description="style html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;sub&gt;|&lt;/sub&gt;" name="sub" description="sub html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;sup&gt;|&lt;/sup&gt;" name="sup" description="sup html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;table&gt;|&lt;/table&gt;" name="table" description="table html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;tbody&gt;|&lt;/tbody&gt;" name="tbody" description="tbody html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;td&gt;|&lt;/td&gt;" name="td" description="td html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;textarea&gt;|&lt;/textarea&gt;" name="textarea" description="textarea html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;tfoot&gt;|&lt;/tfoot&gt;" name="tfoot" description="tfoot html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;th&gt;|&lt;/th&gt;" name="th" description="th html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;thead&gt;|&lt;/thead&gt;" name="thead" description="thead html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;title&gt;|&lt;/title&gt;" name="title" description="title html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;tr&gt;|&lt;/tr&gt;" name="tr" description="tr html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;tt&gt;|&lt;/tt&gt;" name="tt" description="tt html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;u&gt;|&lt;/u&gt;" name="u" description="u html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;ul&gt;|&lt;/ul&gt;" name="ul" description="ul html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;var&gt;|&lt;/var&gt;" name="var" description="var html tag" />
+ <Template suffixes="Ruby (rhtml,rjs,rxml,html.erb,js.rjs,xml.builder)" code="&lt;xmp&gt;|&lt;/xmp&gt;" name="xmp" description="xmp html tag" />
+</Templates>
diff --git a/languages/sql/Makefile.am b/languages/sql/Makefile.am
new file mode 100644
index 00000000..68cfbdea
--- /dev/null
+++ b/languages/sql/Makefile.am
@@ -0,0 +1,20 @@
+#Here resides the SQL support part.
+
+INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+SUBDIRS = app_templates doc
+
+kde_module_LTLIBRARIES = libkdevsqlsupport.la
+libkdevsqlsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevsqlsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevsqlsupport_la_SOURCES = sqlconfigwidget.ui sqlsupport_part.cpp sqlactions.cpp sqloutputwidget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevsqlsupport.desktop
+
+rcdir = $(kde_datadir)/kdevsqlsupport
+rc_DATA = kdevsqlsupport.rc
diff --git a/languages/sql/README.dox b/languages/sql/README.dox
new file mode 100644
index 00000000..bfa52e2e
--- /dev/null
+++ b/languages/sql/README.dox
@@ -0,0 +1,40 @@
+/** \class SQLSupportPart
+This is a SQL support plugin
+
+\authors <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a>
+
+\maintainer <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a>
+
+\feature SQL language support
+\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part.
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/languages/sql/app_templates/Makefile.am b/languages/sql/app_templates/Makefile.am
new file mode 100644
index 00000000..78c56300
--- /dev/null
+++ b/languages/sql/app_templates/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = sqlsimple
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/DatabaseIDE
+profiles_DATA = sql.appwizard
diff --git a/languages/sql/app_templates/sql.appwizard b/languages/sql/app_templates/sql.appwizard
new file mode 100644
index 00000000..425f4998
--- /dev/null
+++ b/languages/sql/app_templates/sql.appwizard
@@ -0,0 +1,2 @@
+[General]
+List=sqlsimple
diff --git a/languages/sql/app_templates/sqlsimple/.kdev_ignore b/languages/sql/app_templates/sqlsimple/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/.kdev_ignore
diff --git a/languages/sql/app_templates/sqlsimple/Makefile.am b/languages/sql/app_templates/sqlsimple/Makefile.am
new file mode 100644
index 00000000..f7b5a012
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/Makefile.am
@@ -0,0 +1,16 @@
+templateName = sqlsimple
+dataFiles = app.sql app.kdevelop
+
+### no need to change below:
+template_DATA = $(templateName).kdevtemplate
+templatedir = ${appwizarddatadir}/templates
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+$(templateName).tar.gz: ${dataFiles}
+ $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles}
+ $(GZIP_COMMAND) -f9 $(templateName).tar
+
+archivedir = ${appwizarddatadir}
+archive_DATA = $(templateName).tar.gz ${templateName}.png
+
+CLEANFILES = *.tar.gz \ No newline at end of file
diff --git a/languages/sql/app_templates/sqlsimple/app.kdevelop b/languages/sql/app_templates/sqlsimple/app.kdevelop
new file mode 100644
index 00000000..78f055cd
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/app.kdevelop
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>SQL</primarylanguage>
+ <keywords>
+ <keyword>SQL</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevdistpart</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir>src</activedir>
+ <includepatterns>*.sql</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.sql" name="SQL" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="sql"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/languages/sql/app_templates/sqlsimple/app.sql b/languages/sql/app_templates/sqlsimple/app.sql
new file mode 100644
index 00000000..72e73020
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/app.sql
@@ -0,0 +1 @@
+select * from foo; \ No newline at end of file
diff --git a/languages/sql/app_templates/sqlsimple/sqlsimple b/languages/sql/app_templates/sqlsimple/sqlsimple
new file mode 100644
index 00000000..e4bee598
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/sqlsimple
@@ -0,0 +1,7 @@
+# KDE Config File
+[General]
+Name=Simple SQL Project
+Category=Database
+Comment=Generates a simple SQL project.
+FileTemplates=sql,AdaStyle
+ShowFilesAfterGeneration=APPNAMELC.sql
diff --git a/languages/sql/app_templates/sqlsimple/sqlsimple.kdevtemplate b/languages/sql/app_templates/sqlsimple/sqlsimple.kdevtemplate
new file mode 100644
index 00000000..e3c100d8
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/sqlsimple.kdevtemplate
@@ -0,0 +1,106 @@
+# KDE Config File
+[General]
+Name=Simple SQL Project
+Name[ca]=Simple projecte en SQL
+Name[da]=Simpelt SQL-projekt
+Name[de]=Einfaches SQL-Projekt
+Name[el]=Απλό έργο SQL
+Name[es]=Proyecto SQL sencillo
+Name[et]=Lihtne SQL projekt
+Name[eu]=SQL proiektu sinplea
+Name[fa]=پروژۀ سادۀ SQL
+Name[fr]=Projet SQL simple
+Name[ga]=Tionscadal Simplí SQL
+Name[gl]=Proxecto sinxelo en SQL
+Name[hu]=Egyszerű SQL-projekt
+Name[it]=Semplice progetto SQL
+Name[ja]=簡単な SQL プロジェクト
+Name[nds]=Eenfach SQL-Projekt
+Name[ne]=साधारण SQL परियोजना
+Name[nl]=Eenvoudig SQL-project
+Name[pl]=Prosty projekt w SQL-u
+Name[pt]=Projecto Simples em SQL
+Name[pt_BR]=Projecto Simples em SQL
+Name[ru]=Простой проект SQL
+Name[sk]=Jednoduchý SQL projekt
+Name[sr]=Једноставан SQL пројекат
+Name[sr@Latn]=Jednostavan SQL projekat
+Name[sv]=Enkelt SQL-projekt
+Name[tr]=Basit SQL Projesi
+Name[zh_CN]=简单的 SQL 工程
+Name[zh_TW]=簡單的 SQL 專案
+Category=Database
+Comment=Generates a simple SQL project.
+Comment[ca]=Genera un simple projecte en SQL.
+Comment[da]=Genererer et simpelt SQL projekt.
+Comment[de]=Erstellt ein einfaches SQL-Projekt.
+Comment[el]=Δημιουργεί ένα απλό έργο SQL.
+Comment[es]=Genera un sencillo proyecto SQL.
+Comment[et]=Lihtsa SQL projekti loomine.
+Comment[eu]=SQL proiektu sinple bat sortzen du.
+Comment[fa]=یک پروژۀ سادۀ SQL تولید می‌کند.
+Comment[fr]=Génère un projet SQL simple.
+Comment[gl]=Xera un proxecto sinxelo en SQL.
+Comment[hu]=Létrehoz egy egyszerű SQL-projektet.
+Comment[it]=Genera un semplice progetto SQL.
+Comment[ja]=簡単な SQL プロジェクトを作成します
+Comment[nds]=Stellt en eenfach SQL-Projekt op.
+Comment[ne]=साधारण SQL परियोजना उत्पन्न गर्दछ
+Comment[nl]=Genereert een eenvoudig SQL-project.
+Comment[pl]=Generuje prosty projekt w SQL-u.
+Comment[pt]=Gera um projecto simples em SQL.
+Comment[pt_BR]=Gera um projecto simples em SQL.
+Comment[ru]=Простой проект SQL
+Comment[sk]=Vygeneruje jednoduchý SQL projekt.
+Comment[sr]=Прави једноставан SQL пројекат.
+Comment[sr@Latn]=Pravi jednostavan SQL projekat.
+Comment[sv]=Skapar ett enkelt SQL-projekt.
+Comment[tr]=Basit bir SQL Projesi yaratır
+Comment[zh_CN]=生成一个简单的 SQL 工程。
+Comment[zh_TW]=產生一個簡單的 SQL 專案
+FileTemplates=sql,AdaStyle
+ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.sql
+Archive=sqlsimple.tar.gz
+
+[FILE1]
+Type=install
+EscapeXML=true
+Source=%{src}/app.kdevelop
+Dest=%{dest}/%{APPNAMELC}.kdevelop
+
+[FILE2]
+Type=install
+Source=%{src}/app.sql
+Dest=%{dest}/%{APPNAMELC}.sql
+
+[MSG]
+Type=install
+Comment=A simple SQL project was created in %{dest}
+Comment[ca]=Un simple projecte en SQL ha estat creat en %{dest}
+Comment[da]=Et simpelt SQL projekt blev oprettet i %{dest}
+Comment[de]=Ein einfaches SQL-Projekt wurde in %{dest} erstellt.
+Comment[el]=Ένα απλό έργο SQL δημιουργήθηκε στο %{dest}
+Comment[es]=Un sencillo proyecto SQL ha sido creado en %{dest}
+Comment[et]=Lihtne SQL projekt loodi asukohta %{dest}
+Comment[eu]=SQL proiektu sinple bat sortu da hemen: %{dest}
+Comment[fa]=یک پروژۀ سادۀ SQL در %{dest} ایجاد شد
+Comment[fr]=Un projet SQL simple a été créé dans %{dest}
+Comment[ga]=Cruthaíodh tionscadal simplí SQL i %{dest}
+Comment[gl]=Creouse un proxecto sinxelo en SQL en %{dest}
+Comment[hu]=Létrejött egy egyszerű SQL-projekt itt: %{dest}
+Comment[it]=È stato creato un semplice progetto SQL in %{dest}
+Comment[ja]=簡単な SQL プロジェクトを %{dest} に作成しました
+Comment[nds]=In %{dest} wöör en eenfach SQL-Projekt opstellt.
+Comment[ne]=साधारण SQL परियोजना %{dest} मा सिर्जना गरियो
+Comment[nl]=Een eenvoudig SQL-project is aangemaakt in %{dest}
+Comment[pl]=Prosty projekt w SQL-u został utworzony w %{dest}
+Comment[pt]=Foi criado um projecto simples de SQL em %{dest}
+Comment[pt_BR]=Foi criado um projecto simples de SQL em %{dest}
+Comment[ru]=Простой проект SQL создан в %{dest}
+Comment[sk]=Jednoduchý SQL projekt bol vytvorený v %{dest}
+Comment[sr]=Једноставан SQL пројекат направљен је у %{dest}
+Comment[sr@Latn]=Jednostavan SQL projekat napravljen je u %{dest}
+Comment[sv]=Ett enkelt SQL-projekt skapades i %{dest}
+Comment[tr]=Basit bir SQL projesi %{dest} içinde yaratıldı.
+Comment[zh_CN]=在 %{dest} 中创建了简单的 SQL 工程
+Comment[zh_TW]=一個簡單的 SQL 專案已建立於 %{dest}
diff --git a/languages/sql/app_templates/sqlsimple/sqlsimple.png b/languages/sql/app_templates/sqlsimple/sqlsimple.png
new file mode 100644
index 00000000..840a953c
--- /dev/null
+++ b/languages/sql/app_templates/sqlsimple/sqlsimple.png
Binary files differ
diff --git a/languages/sql/doc/Makefile.am b/languages/sql/doc/Makefile.am
new file mode 100644
index 00000000..d42aec82
--- /dev/null
+++ b/languages/sql/doc/Makefile.am
@@ -0,0 +1,6 @@
+#tocdir = ${kde_datadir}/kdevdoctreeview/tocs
+#toc_DATA =
+
+#indexdir = ${kde_datadir}/devdoctreeview/indices
+#index_DATA =
+
diff --git a/languages/sql/kdevsqlsupport.desktop b/languages/sql/kdevsqlsupport.desktop
new file mode 100644
index 00000000..2880affa
--- /dev/null
+++ b/languages/sql/kdevsqlsupport.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=SQL Support
+Comment[ca]=Suport per a SQL
+Comment[da]=SQL-understøttelse
+Comment[de]=Unterstützung für SQL
+Comment[el]=Υποστήριξη SQL
+Comment[es]=Soporte para SQL
+Comment[et]=SQL toetus
+Comment[eu]=SQL euskarria
+Comment[fa]=پشتیبانی SQL
+Comment[fr]=Prise en charge du langage SQL
+Comment[ga]=Tacaíocht SQL
+Comment[gl]=Soporte para SQL
+Comment[hi]=एसक्यूएल समर्थन
+Comment[hu]=SQL-támogatás
+Comment[is]=SQL stuðningur
+Comment[it]=Supporto SQL
+Comment[ja]=SQL サポート
+Comment[nds]=SQL-Ünnerstütten
+Comment[ne]=SQL समर्थन
+Comment[nl]=Ondersteuning voor SQL
+Comment[pl]=Obsługa SQL-a
+Comment[pt]=Suporte a SQL
+Comment[pt_BR]=Suporte ao SQL
+Comment[ru]=Поддержка языка SQL
+Comment[sk]=SQL podpora
+Comment[sl]=Podpora za SQL
+Comment[sr]=Подршка за SQL
+Comment[sr@Latn]=Podrška za SQL
+Comment[sv]=SQL-stöd
+Comment[ta]=SQL ஆதரவு
+Comment[tg]=Ёрӣ намудани забони SQL
+Comment[tr]=SQL Desteği
+Comment[zh_CN]=SQL 语言支持
+Comment[zh_TW]=SQL 支援
+Name=KDevSQLSupport
+Name[da]=KDevelop SQL-understøttelse
+Name[de]=Unterstützung für SQL (KDevelop)
+Name[hi]=के-डेव-एसक्यूएल-समर्थन
+Name[nds]=SQL-Ünnerstütten för KDevelop
+Name[pl]=KDevObsługaSQL
+Name[sk]=KDev SQL podpora
+Name[sv]=KDevelop SQL-stöd
+Name[ta]=கெடெவ் எஸ்கியேல் ஆதரவு
+Name[zh_TW]=KDevelop SQL 支援
+GenericName=SQL Support
+GenericName[ca]=Suport per a SQL
+GenericName[da]=SQL-understøttelse
+GenericName[de]=Unterstützung für SQL
+GenericName[el]=Υποστήριξη SQL
+GenericName[es]=Soporte para SQL
+GenericName[et]=SQL toetus
+GenericName[eu]=SQL euskarria
+GenericName[fa]=پشتیبانی SQL
+GenericName[fr]=Langage SQL
+GenericName[ga]=Tacaíocht SQL
+GenericName[gl]=Soporte para SQL
+GenericName[hi]=एसक्यूएल समर्थन
+GenericName[hu]=SQL-támogatás
+GenericName[it]=Supporto SQL
+GenericName[ja]=SQL サポート
+GenericName[nds]=SQL-Ünnerstütten
+GenericName[ne]=SQL समर्थन
+GenericName[nl]=Ondersteuning voor SQL
+GenericName[pl]=Obsługa SQL-a
+GenericName[pt]=Suporte a SQL
+GenericName[pt_BR]=Suporte ao SQL
+GenericName[ru]=Поддержка языка SQL
+GenericName[sk]=SQL podpora
+GenericName[sl]=Podpora za SQL
+GenericName[sr]=Подршка за SQL
+GenericName[sr@Latn]=Podrška za SQL
+GenericName[sv]=SQL-stöd
+GenericName[ta]=SQL ஆதரவு
+GenericName[tg]=Ёрӣ намудани забони SQL
+GenericName[tr]=SQL Desteği
+GenericName[zh_CN]=SQL 支持
+GenericName[zh_TW]=SQL 支援
+ServiceTypes=KDevelop/LanguageSupport
+X-KDE-Library=libkdevsqlsupport
+X-KDevelop-Version=5
+X-KDevelop-Language=SQL
+X-KDevelop-Args=SQL
diff --git a/languages/sql/kdevsqlsupport.rc b/languages/sql/kdevsqlsupport.rc
new file mode 100644
index 00000000..36b91d7a
--- /dev/null
+++ b/languages/sql/kdevsqlsupport.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevSQLSupport" version="2">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_execute" />
+ </Menu>
+</MenuBar>
+<ToolBar name="buildToolBar">
+ <Action name="build_execute" group="build_operations" />
+</ToolBar>
+<ToolBar name="browserToolBar">
+ <Action name="connection_combo" />
+</ToolBar>
+</kpartgui>
diff --git a/languages/sql/sqlactions.cpp b/languages/sql/sqlactions.cpp
new file mode 100644
index 00000000..8cfac095
--- /dev/null
+++ b/languages/sql/sqlactions.cpp
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "sqlactions.h"
+
+#include <qpopupmenu.h>
+#include <qstringlist.h>
+#include <qsqldatabase.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <ktoolbar.h>
+#include <kiconloader.h>
+#include <kcombobox.h>
+
+#include "kdevplugin.h"
+#include "kdevlanguagesupport.h"
+#include "sqlsupport_part.h"
+
+SqlListAction::SqlListAction(SQLSupportPart *part, const QString &text,
+ const KShortcut& cut,
+ const QObject *receiver, const char *slot,
+ KActionCollection *parent, const char *name)
+ : KWidgetAction( m_combo = new KComboBox(), text, cut, 0, 0, parent, name), m_part(part)
+{
+#if (QT_VERSION >= 0x030100)
+ m_combo->setEditable( false );
+ m_combo->setAutoCompletion( true );
+#endif
+
+ m_combo->setMinimumWidth( 200 );
+ m_combo->setMaximumWidth( 400 );
+
+ connect( m_combo, SIGNAL(activated(const QString&)), receiver, slot );
+ connect( m_combo, SIGNAL(activated(int)), this, SLOT(activated(int)) );
+
+ setShortcutConfigurable( false );
+ setAutoSized( true );
+
+ refresh();
+}
+
+
+void SqlListAction::setCurrentConnectionName(const QString &name)
+{
+ int idx = m_part->connections().findIndex( name );
+ if ( idx < 0 )
+ m_combo->setCurrentItem( 0 );
+ else
+ m_combo->setCurrentItem( idx + 1 );
+}
+
+
+QString SqlListAction::currentConnectionName() const
+{
+ if ( m_combo->currentItem() <= 0 )
+ return QString::null;
+ return m_part->connections()[ m_combo->currentItem() - 1 ];
+}
+
+void SqlListAction::activated(int idx)
+{
+ if (idx < 1 || (int)m_part->connections().count() <= idx)
+ return;
+ const QSqlDatabase *db = QSqlDatabase::database(m_part->connections()[idx], true);
+ m_combo->changeItem( db->isOpen() ? SmallIcon( "ok" ) : SmallIcon( "no" ),
+ m_combo->text(idx), idx );
+}
+
+void SqlListAction::refresh()
+{
+ const QStringList& dbc = m_part->connections();
+
+ m_combo->clear();
+ m_combo->insertItem( i18n("<no database server>") );
+
+ QString cName;
+ for ( QStringList::ConstIterator it = dbc.begin(); it != dbc.end(); ++it ) {
+
+ QSqlDatabase* db = QSqlDatabase::database( (*it), false );
+ if ( !db ) {
+ kdDebug( 9000 ) << "Could not find database connection " << (*it) << endl;
+ m_combo->insertItem( SmallIcon( "no" ), i18n("<error - no connection %1>").arg( *it ) );
+ continue;
+ }
+ cName = db->driverName();
+ cName.append( "://" ).append( db->userName() ).append( "@" ).append( db->hostName() );
+ cName.append( "/" ).append( db->databaseName() );
+
+ m_combo->insertItem( db->open() ? SmallIcon( "ok" ) : SmallIcon( "no" ), cName );
+ }
+}
+
+
+#include "sqlactions.moc"
diff --git a/languages/sql/sqlactions.h b/languages/sql/sqlactions.h
new file mode 100644
index 00000000..e49794e5
--- /dev/null
+++ b/languages/sql/sqlactions.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SQLACTION_H_
+#define _SQLACTION_H_
+
+#include <kdeversion.h>
+#include <kxmlguiclient.h>
+#include <kaction.h>
+
+class SQLSupportPart;
+class KComboBox;
+
+class SqlListAction : public KWidgetAction
+{
+ Q_OBJECT
+public:
+ SqlListAction( SQLSupportPart *part, const QString &text, const KShortcut& cut,
+ const QObject *receiver, const char *slot,
+ KActionCollection *parent, const char *name );
+ void setCurrentConnectionName(const QString &name);
+ QString currentConnectionName() const;
+ void refresh();
+
+private slots:
+ void activated(int);
+
+private:
+ SQLSupportPart *m_part;
+ KComboBox* m_combo;
+};
+
+#endif
diff --git a/languages/sql/sqlconfigwidget.ui b/languages/sql/sqlconfigwidget.ui
new file mode 100644
index 00000000..e85b09d9
--- /dev/null
+++ b/languages/sql/sqlconfigwidget.ui
@@ -0,0 +1,189 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>SqlConfigWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SqlConfigWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>578</width>
+ <height>367</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTable">
+ <column>
+ <property name="text">
+ <string>Plugin</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Database Name</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Host</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Port</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Username</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Password</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>dbTable</cstring>
+ </property>
+ <property name="numRows">
+ <number>0</number>
+ </property>
+ <property name="numCols">
+ <number>6</number>
+ </property>
+ <property name="selectionMode">
+ <enum>SingleRow</enum>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;i&gt;Warning:&lt;/i&gt; password will be saved with weak encryption.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>removeBtn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>testBtn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Test</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>dbTable</sender>
+ <signal>valueChanged(int,int)</signal>
+ <receiver>SqlConfigWidget</receiver>
+ <slot>valueChanged(int,int)</slot>
+ </connection>
+ <connection>
+ <sender>removeBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlConfigWidget</receiver>
+ <slot>removeDb()</slot>
+ </connection>
+ <connection>
+ <sender>testBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SqlConfigWidget</receiver>
+ <slot>testDb()</slot>
+ </connection>
+ <connection>
+ <sender>dbTable</sender>
+ <signal>currentChanged(int,int)</signal>
+ <receiver>SqlConfigWidget</receiver>
+ <slot>updateButtons()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">sqlconfigwidget.ui.h</include>
+</includes>
+<forwards>
+ <forward>class QDomDocument;</forward>
+</forwards>
+<variables>
+ <variable access="private">QDomDocument* doc;</variable>
+ <variable access="private">bool changed;</variable>
+</variables>
+<signals>
+ <signal>newConfigSaved()</signal>
+</signals>
+<slots>
+ <slot>init()</slot>
+ <slot>valueChanged( int, int )</slot>
+ <slot>removeDb()</slot>
+ <slot>updateButtons()</slot>
+ <slot>testDb()</slot>
+ <slot>accept()</slot>
+ <slot>setProjectDom( QDomDocument * doc )</slot>
+ <slot>loadConfig()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/languages/sql/sqlconfigwidget.ui.h b/languages/sql/sqlconfigwidget.ui.h
new file mode 100644
index 00000000..c99d8722
--- /dev/null
+++ b/languages/sql/sqlconfigwidget.ui.h
@@ -0,0 +1,244 @@
+/****************************************************************************
+** 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.
+*****************************************************************************/
+
+#include <qsqldatabase.h>
+#include <qcombobox.h>
+#include <qspinbox.h>
+#include <qdom.h>
+#include <qstringlist.h>
+
+#include <klocale.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+
+#include <domutil.h>
+
+#include "sqlsupport_part.h"
+
+// displays a ComboBox on edit to let the user choose the plugin
+class PluginTableItem: public QTableItem
+{
+public:
+ PluginTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {}
+
+ virtual QWidget* createEditor() const
+ {
+ QComboBox* combo = new QComboBox( true, table() );
+ combo->insertStringList( QSqlDatabase::drivers() );
+ if ( !text().isEmpty() )
+ combo->setCurrentText( text() );
+ return combo;
+ }
+
+ virtual void setContentFromEditor( QWidget* w )
+ {
+ if ( w->inherits( "QComboBox" ) )
+ setText( ( (QComboBox*)w )->currentText() );
+ else
+ QTableItem::setContentFromEditor( w );
+ }
+};
+
+// uses a spinbox to let the user choose the port
+class PortTableItem: public QTableItem
+{
+public:
+ PortTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {}
+
+ virtual QWidget* createEditor() const
+ {
+ QSpinBox* sb = new QSpinBox( -1, 65535, 1, table() );
+ sb->setSpecialValueText( i18n("Default") );
+ if ( !text().isEmpty() )
+ sb->setValue( text().toInt() );
+ return sb;
+ }
+
+ virtual void setContentFromEditor( QWidget* w )
+ {
+ if ( w->inherits( "QSpinBox" ) )
+ setText( ( (QSpinBox*)w )->text() );
+ else
+ QTableItem::setContentFromEditor( w );
+ }
+};
+
+// uses a spinbox to let the user choose the port
+class PasswordTableItem: public QTableItem
+{
+public:
+ PasswordTableItem( QTable* table, const QString& text = QString::null ): QTableItem( table, QTableItem::OnTyping, text ) {}
+
+ virtual QWidget* createEditor() const
+ {
+ KLineEdit* le = new KLineEdit( table() );
+ le->setEchoMode( QLineEdit::Password );
+ return le;
+ }
+
+ virtual void setContentFromEditor( QWidget* w )
+ {
+ if ( w->inherits( "KLineEdit" ) ) {
+ password = ( (KLineEdit*)w )->text();
+ setText( QString().fill( '*', password.length() ) );
+ } else {
+ QTableItem::setContentFromEditor( w );
+ }
+ }
+
+ virtual void setText(const QString& bogus)
+ {
+ QTableItem::setText(QString().fill('*', bogus.length()));
+ }
+ QString password;
+};
+
+static bool isEmptyRow( QTable* tbl, int row )
+{
+ for ( int i = 0; i < tbl->numCols(); i++ ) {
+ if ( !tbl->text( row, i ).isEmpty() )
+ return false;
+ }
+ return true;
+}
+
+void SqlConfigWidget::init()
+{
+ int w = dbTable->fontMetrics().width( "W" );
+ dbTable->verticalHeader()->hide();
+ dbTable->setLeftMargin( 0 );
+ dbTable->setColumnWidth( 3, w * 5 );
+ updateButtons();
+ valueChanged( 0, 0 );
+ changed = false;
+}
+
+static void addRow( QTable* dbTable )
+{
+ dbTable->insertRows( dbTable->numRows() );
+ dbTable->setItem( dbTable->numRows() - 1, 0,
+ new PluginTableItem( dbTable ) );
+ dbTable->setItem( dbTable->numRows() - 1, 3,
+ new PortTableItem( dbTable ) );
+ dbTable->setItem( dbTable->numRows() - 1, 5,
+ new PasswordTableItem( dbTable ) );
+}
+
+void SqlConfigWidget::valueChanged( int, int )
+{
+ int lrow = dbTable->numRows() - 1;
+ if ( lrow < 0 || !isEmptyRow( dbTable, lrow ) ) {
+ addRow( dbTable );
+ }
+ changed = true;
+}
+
+
+void SqlConfigWidget::removeDb()
+{
+ if ( dbTable->currentRow() >= 0 )
+ dbTable->removeRow( dbTable->currentRow() );
+ valueChanged( 0, 0 );
+ updateButtons();
+}
+
+
+void SqlConfigWidget::updateButtons()
+{
+ if ( dbTable->currentRow() < 0 ) {
+ testBtn->setEnabled( false );
+ removeBtn->setEnabled( false );
+ return;
+ }
+ testBtn->setEnabled( !isEmptyRow( dbTable, dbTable->currentRow() ) );
+ removeBtn->setEnabled( dbTable->currentRow() + 1 < dbTable->numRows() );
+}
+
+
+void SqlConfigWidget::testDb()
+{
+ static const QString cName( "SqlConfigWidgetTest" );
+ int cr = dbTable->currentRow();
+ if (cr < 0)
+ return;
+
+ QSqlDatabase* db = QSqlDatabase::addDatabase( dbTable->text( cr, 0 ), cName );
+ db->setDatabaseName( dbTable->text( cr, 1 ) );
+ db->setHostName( dbTable->text( cr, 2 ) );
+ bool ok;
+ int port = dbTable->text( cr, 3 ).toInt( &ok );
+ if (ok && port >= 0)
+ db->setPort( port );
+ QString pass = ((PasswordTableItem*)dbTable->item( cr, 5 ))->password;
+
+ if ( db->open( dbTable->text( cr, 4 ), pass ) ) {
+ KMessageBox::information( this, i18n("Connection successful") );
+ db->close();
+ } else {
+ KMessageBox::detailedSorry( this, i18n("Unable to connect to database server"),
+ db->lastError().driverText() + "\n" +
+ db->lastError().databaseText() );
+ }
+
+ db = 0;
+ QSqlDatabase::removeDatabase( cName );
+}
+
+
+void SqlConfigWidget::accept()
+{
+ Q_ASSERT( doc );
+
+ QDomElement dbElem = DomUtil::createElementByPath( *doc, "/kdevsqlsupport/servers" );
+ DomUtil::makeEmpty( dbElem );
+
+ for ( int i = 0; i < dbTable->numRows() - 1; i++ ) {
+ QStringList db;
+ db << dbTable->text( i, 0 ) << dbTable->text( i, 1 )
+ << dbTable->text( i, 2 ) << dbTable->text( i, 3 )
+ << dbTable->text( i, 4 )
+ << SQLSupportPart::cryptStr( ((PasswordTableItem*)dbTable->item( i, 5 ))->password );
+
+ DomUtil::writeListEntry( *doc,
+ "/kdevsqlsupport/servers/server" + QString::number( i ),
+ "el", db );
+ }
+ if ( changed )
+ emit newConfigSaved();
+}
+
+
+void SqlConfigWidget::setProjectDom( QDomDocument * doc )
+{
+ this->doc = doc;
+}
+
+
+void SqlConfigWidget::loadConfig()
+{
+ Q_ASSERT( doc );
+
+ QStringList db;
+ int i = 0;
+ while ( true ) {
+ QStringList db = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + QString::number( i ), "el" );
+ if ( db.isEmpty() )
+ return;
+
+ addRow( dbTable );
+ int row = dbTable->numRows() - 2;
+ for ( int ii = 0; ii < 6; ii++ )
+ dbTable->setText( row, ii, db[ii] );
+ ((PasswordTableItem*)dbTable->item( row, 5 ))->password = SQLSupportPart::cryptStr( db[5] );
+
+ i++;
+ }
+ updateButtons();
+ changed = false;
+}
diff --git a/languages/sql/sqloutputwidget.cpp b/languages/sql/sqloutputwidget.cpp
new file mode 100644
index 00000000..a0d7368d
--- /dev/null
+++ b/languages/sql/sqloutputwidget.cpp
@@ -0,0 +1,127 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qsqldatabase.h>
+#include <qsqlerror.h>
+#include <qsqlcursor.h>
+#include <qsqldriver.h>
+#include <qsqlrecord.h>
+#include <qwidgetstack.h>
+#include <qdatatable.h>
+#include <qtextedit.h>
+#include <qlayout.h>
+#include <qstylesheet.h>
+
+#include <klocale.h>
+
+#include "sqloutputwidget.h"
+
+class QCustomSqlCursor: public QSqlCursor
+{
+public:
+ QCustomSqlCursor( const QString & query = QString::null, bool autopopulate = TRUE, QSqlDatabase* db = 0 ) :
+ QSqlCursor( QString::null, autopopulate, db )
+ {
+ exec( query );
+ if ( isSelect() && autopopulate ) {
+ QSqlRecordInfo inf = ((QSqlQuery*)this)->driver()->recordInfo( *(QSqlQuery*)this );
+ for ( QSqlRecordInfo::iterator it = inf.begin(); it != inf.end(); ++it ) {
+ append( *it );
+ }
+ }
+ setMode( QSqlCursor::ReadOnly );
+ }
+ QCustomSqlCursor( const QCustomSqlCursor & other ): QSqlCursor( other ) {}
+ bool select( const QString & /*filter*/, const QSqlIndex & /*sort*/ = QSqlIndex() )
+ { return exec( lastQuery() ); }
+ QSqlIndex primaryIndex( bool /*prime*/ = TRUE ) const
+ { return QSqlIndex(); }
+ int insert( bool /*invalidate*/ = TRUE )
+ { return FALSE; }
+ int update( bool /*invalidate*/ = TRUE )
+ { return FALSE; }
+ int del( bool /*invalidate*/ = TRUE )
+ { return FALSE; }
+ void setName( const QString& /*name*/, bool /*autopopulate*/ = TRUE ) {}
+};
+
+
+SqlOutputWidget::SqlOutputWidget ( QWidget* parent, const char* name ) :
+ QWidget( parent, name )
+{
+ m_stack = new QWidgetStack( this );
+ m_table = new QDataTable( this );
+ m_textEdit = new QTextEdit( this );
+
+ m_textEdit->setTextFormat( QTextEdit::RichText );
+ m_textEdit->setReadOnly( true );
+
+ m_stack->addWidget( m_textEdit );
+ m_stack->addWidget( m_table );
+
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ layout->addWidget( m_stack );
+}
+
+SqlOutputWidget::~SqlOutputWidget()
+{}
+
+void SqlOutputWidget::showQuery( const QString& connectionName, const QString& query )
+{
+ QSqlDatabase* db = QSqlDatabase::database( connectionName, true );
+ if ( !db ) {
+ showError( i18n("No such connection: %1").arg( connectionName ) );
+ return;
+ }
+ if ( !db->isOpen() ) {
+ showError( db->lastError() );
+ return;
+ }
+
+ QSqlCursor* cur = new QCustomSqlCursor( query, true, db );
+ if ( !cur->isActive() ) {
+ showError( cur->lastError() );
+ } else if ( cur->isSelect() ) {
+ m_table->setSqlCursor( cur, true, true );
+ m_table->refresh( QDataTable::RefreshAll );
+ m_stack->raiseWidget( m_table );
+ } else {
+ showSuccess( cur->numRowsAffected() );
+ }
+}
+
+void SqlOutputWidget::showSuccess( int rowsAffected )
+{
+ m_textEdit->clear();
+ m_textEdit->setText( i18n("Query successful, number of rows affected: %1").arg( rowsAffected ) );
+ m_stack->raiseWidget( m_textEdit );
+}
+
+void SqlOutputWidget::showError( const QString& message )
+{
+ m_textEdit->clear();
+ m_textEdit->setText( "<p><b>" + i18n("An error occurred:") + "</b></p>\n" + message );
+ m_stack->raiseWidget( m_textEdit );
+}
+
+void SqlOutputWidget::showError( const QSqlError& message )
+{
+ m_textEdit->clear();
+ m_textEdit->setText( "<p><b>" + i18n("An error occurred:") +
+ "</b></p>\n<p><i>" + i18n("Driver") + "</i>: " +
+ QStyleSheet::escape( message.driverText() ) +
+ "<br><i>" + i18n("Database") + ":</i>: " +
+ QStyleSheet::escape( message.databaseText() ) );
+ m_stack->raiseWidget( m_textEdit );
+}
+
+#include "sqloutputwidget.moc"
+
diff --git a/languages/sql/sqloutputwidget.h b/languages/sql/sqloutputwidget.h
new file mode 100644
index 00000000..40c8612a
--- /dev/null
+++ b/languages/sql/sqloutputwidget.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SQLOUTPUTWIDGET_H_
+#define _SQLOUTPUTWIDGET_H_
+
+#include <qwidget.h>
+
+class QWidgetStack;
+class QDataTable;
+class QTextEdit;
+class QSqlError;
+
+class SqlOutputWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ SqlOutputWidget( QWidget* parent = 0, const char* name = 0 );
+ virtual ~SqlOutputWidget();
+
+public:
+ void showQuery( const QString& connectionName, const QString& query );
+ void showError( const QSqlError& error );
+
+private:
+ void showError( const QString& msg );
+ void showSuccess( int rowsAffected );
+
+ QWidgetStack* m_stack;
+ QDataTable* m_table;
+ QTextEdit* m_textEdit;
+};
+
+#endif
diff --git a/languages/sql/sqlsupport_part.cpp b/languages/sql/sqlsupport_part.cpp
new file mode 100644
index 00000000..c1e13ac0
--- /dev/null
+++ b/languages/sql/sqlsupport_part.cpp
@@ -0,0 +1,284 @@
+#include "sqlsupport_part.h"
+#include <qwhatsthis.h>
+#include <qstringlist.h>
+#include <qtimer.h>
+#include <qsqldatabase.h>
+#include <qsqlrecord.h>
+
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdialogbase.h>
+#include <ktexteditor/editinterface.h>
+#include <kmessagebox.h>
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevlanguagesupport.h"
+#include "kdevpartcontroller.h"
+#include "kdevproject.h"
+#include "codemodel.h"
+#include "kdevplugininfo.h"
+
+#include "sqlconfigwidget.h"
+#include "sqlactions.h"
+#include "sqloutputwidget.h"
+#include "domutil.h"
+
+typedef KDevGenericFactory<SQLSupportPart> SQLSupportFactory;
+static const KDevPluginInfo data("kdevsqlsupport");
+K_EXPORT_COMPONENT_FACTORY( libkdevsqlsupport, SQLSupportFactory( data ) )
+
+SQLSupportPart::SQLSupportPart( QObject *parent, const char *name, const QStringList& )
+ : KDevLanguageSupport ( &data, parent, name ? name : "SQLSupportPart" )
+{
+ setInstance( SQLSupportFactory::instance() );
+ setXMLFile( "kdevsqlsupport.rc" );
+
+ KAction *action;
+ action = new KAction( i18n( "&Run" ), "exec", Key_F9, this, SLOT( slotRun() ), actionCollection(), "build_execute" );
+ action->setToolTip(i18n("Run"));
+ action->setWhatsThis(i18n("<b>Run</b><p>Executes a SQL script."));
+
+ dbAction = new SqlListAction( this, i18n( "&Database Connections" ), 0, this, SLOT(activeConnectionChanged()), actionCollection(), "connection_combo" );
+
+ kdDebug( 9000 ) << "Creating SQLSupportPart" << endl;
+
+ connect( core(), SIGNAL( projectConfigWidget( KDialogBase* ) ),
+ this, SLOT( projectConfigWidget( KDialogBase* ) ) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( core(), SIGNAL(languageChanged()), this, SLOT(projectOpened()) );
+ connect( partController(), SIGNAL( savedFile( const KURL& ) ), this, SLOT( savedFile( const KURL& ) ) );
+
+ m_widget = new SqlOutputWidget();
+ mainWindow()->embedOutputView( m_widget, i18n( "SQL" ), i18n( "Output of SQL commands" ) );
+ QWhatsThis::add(m_widget, i18n("<b>Output of SQL commands</b><p>This window shows the output of SQL commands being executed. It can display results of SQL \"select\" commands in a table."));
+}
+
+
+SQLSupportPart::~SQLSupportPart()
+{
+ mainWindow()->removeView(m_widget);
+ delete m_widget;
+}
+
+QString SQLSupportPart::cryptStr(const QString& aStr)
+{
+ QString result;
+ for (unsigned int i = 0; i < aStr.length(); i++)
+ result += (aStr[i].unicode() < 0x20) ? aStr[i] :
+ QChar(0x1001F - aStr[i].unicode());
+ return result;
+}
+
+void SQLSupportPart::activeConnectionChanged()
+{
+ updateCatalog();
+}
+
+void SQLSupportPart::clearConfig()
+{
+ for ( QStringList::Iterator it = conNames.begin(); it != conNames.end(); ++it ) {
+ if ( QSqlDatabase::contains( *it ) ) {
+ QSqlDatabase::database( *it, false )->close();
+ QSqlDatabase::removeDatabase( *it );
+ } else {
+ kdDebug( 9000 ) << "Could not find connection named " << (*it) << endl;
+ }
+ }
+ conNames.clear();
+
+ dbAction->refresh();
+}
+
+void SQLSupportPart::loadConfig()
+{
+ clearConfig();
+
+ QDomDocument* doc = projectDom();
+
+ QStringList db;
+ int i = 0;
+ QString conName;
+ while ( true ) {
+ QStringList sdb = DomUtil::readListEntry( *doc, "kdevsqlsupport/servers/server" + QString::number( i ), "el" );
+ if ( (int)sdb.size() < 6 )
+ break;
+
+ conName = "KDEVSQLSUPPORT_";
+ conName += QString::number( i );
+ conNames << conName;
+ QSqlDatabase* db = QSqlDatabase::addDatabase( sdb[0], QString( "KDEVSQLSUPPORT_%1" ).arg( i ) );
+ db->setDatabaseName( sdb[1] );
+ db->setHostName( sdb[2] );
+ bool ok;
+ int port = sdb[3].toInt( &ok );
+ if ( ok )
+ db->setPort( port );
+ db->setUserName( sdb[4] );
+ db->setPassword( cryptStr( sdb[5] ) );
+ db->open();
+
+ i++;
+ }
+
+ dbAction->refresh();
+}
+
+void SQLSupportPart::projectConfigWidget( KDialogBase *dlg )
+{
+ QVBox *vbox = dlg->addVBoxPage( QString( "SQL" ), i18n( "Specify Your Database Connections" ), BarIcon("source", KIcon::SizeMedium) );
+ SqlConfigWidget *w = new SqlConfigWidget( (QWidget*)vbox, "SQL config widget" );
+ w->setProjectDom( projectDom() );
+ w->loadConfig();
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ connect( w, SIGNAL(newConfigSaved()), this, SLOT(loadConfig()) );
+}
+
+void SQLSupportPart::projectOpened()
+{
+ connect( project(), SIGNAL( addedFilesToProject( const QStringList & ) ),
+ this, SLOT( addedFilesToProject( const QStringList & ) ) );
+ connect( project(), SIGNAL( removedFilesFromProject( const QStringList & ) ),
+ this, SLOT( removedFilesFromProject( const QStringList & ) ) );
+
+ loadConfig();
+
+ // We want to parse only after all components have been
+ // properly initialized
+ QTimer::singleShot( 0, this, SLOT( parse() ) );
+}
+
+
+void SQLSupportPart::projectClosed()
+{
+ clearConfig();
+}
+
+void SQLSupportPart::slotRun ()
+{
+ QString cName = dbAction->currentConnectionName();
+ if ( cName.isEmpty() ) {
+ KMessageBox::sorry( 0, i18n("Please select a valid database connection.") );
+ return;
+ }
+
+ KTextEditor::EditInterface* doc = dynamic_cast<KTextEditor::EditInterface*>(partController()->activePart());
+ if ( !doc )
+ return; // show error message?
+
+ mainWindow()->raiseView( m_widget );
+ m_widget->showQuery( cName, doc->text() );
+}
+
+#if 0
+static QString dbCaption(const QSqlDatabase* db)
+{
+ QString res;
+ if (!db)
+ return res;
+ res = db->driverName();
+ res += QString::fromLatin1("@");
+ res += db->hostName();
+ if (db->port() >= 0)
+ res += QString::fromLatin1(":") + QString::number(db->port());
+ return res;
+}
+#endif
+
+void SQLSupportPart::parse()
+{
+ // @todo
+}
+
+void SQLSupportPart::updateCatalog()
+{
+ if (!project() || !dbAction)
+ return;
+
+ codeModel()->wipeout();
+
+ QString curConnection = dbAction->currentConnectionName();
+ if (curConnection.isEmpty()) {
+ emit updatedSourceInfo();
+ return;
+ }
+
+ FileDom dbf = codeModel()->create<FileModel>();
+ dbf->setName(dbAction->currentConnectionName());
+ QSqlDatabase *db = QSqlDatabase::database(dbAction->currentConnectionName(), true);
+
+ // tables are classes and fields are methods
+ if (db->isOpen()) {
+ QSqlRecord inf;
+ QStringList tables = db->tables();
+ for (QStringList::Iterator it = tables.begin(); it != tables.end(); ++it) {
+ ClassDom dbc = codeModel()->create<ClassModel>();
+ dbc->setName(*it);
+ inf = db->record(*it);
+ for (int i = 0; i < (int)inf.count(); ++i) {
+ FunctionDom dbv = codeModel()->create<FunctionModel>();
+ dbv->setName(inf.fieldName(i));
+ dbv->setResultType(QVariant::typeToName(inf.field(i)->type()));
+ dbc->addFunction(dbv);
+ }
+ dbf->addClass(dbc);
+ }
+ }
+
+ codeModel()->addFile(dbf);
+
+ emit updatedSourceInfo();
+}
+
+void SQLSupportPart::addedFilesToProject( const QStringList &fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it ) {
+// parse( project() ->projectDirectory() + "/" + ( *it ) );
+ }
+
+ emit updatedSourceInfo();
+}
+
+
+void SQLSupportPart::removedFilesFromProject( const QStringList &fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it ) {
+// classStore() ->removeWithReferences( project() ->projectDirectory() + "/" + ( *it ) );
+ }
+
+ emit updatedSourceInfo();
+}
+
+void SQLSupportPart::savedFile( const KURL &fileName )
+{
+ if ( project() ->allFiles().contains( fileName.path().mid ( project() ->projectDirectory().length() + 1 ) ) ) {
+// parse( fileName );
+// emit updatedSourceInfo();
+ }
+}
+
+KDevLanguageSupport::Features SQLSupportPart::features()
+{
+ return Features( Classes | Functions );
+}
+
+KMimeType::List SQLSupportPart::mimeTypes( )
+{
+ KMimeType::List list;
+ KMimeType::Ptr mime = KMimeType::mimeType( "text/plain" );
+ if( mime )
+ list << mime;
+ return list;
+}
+
+#include "sqlsupport_part.moc"
diff --git a/languages/sql/sqlsupport_part.h b/languages/sql/sqlsupport_part.h
new file mode 100644
index 00000000..e9ad6dbd
--- /dev/null
+++ b/languages/sql/sqlsupport_part.h
@@ -0,0 +1,55 @@
+#ifndef __KDEVPART_SQLSUPPORT_H__
+#define __KDEVPART_SQLSUPPORT_H__
+
+#include <qguardedptr.h>
+#include <qstringlist.h>
+
+#include <kprocess.h>
+#include <kdialogbase.h>
+
+#include "kdevplugin.h"
+#include "kdevlanguagesupport.h"
+
+class SqlListAction;
+class SqlOutputWidget;
+class CodeModel;
+
+class SQLSupportPart : public KDevLanguageSupport
+{
+ Q_OBJECT
+
+public:
+
+ SQLSupportPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~SQLSupportPart();
+
+ static QString cryptStr(const QString& aStr);
+ const QStringList& connections() const { return conNames; }
+
+
+protected:
+ virtual Features features();
+ virtual KMimeType::List mimeTypes();
+
+private slots:
+ void slotRun();
+ void projectConfigWidget(KDialogBase *dlg);
+ void projectOpened();
+ void projectClosed();
+ void savedFile(const KURL &fileName);
+ void addedFilesToProject(const QStringList &fileList);
+ void removedFilesFromProject(const QStringList &fileList);
+ void parse();
+ void loadConfig();
+ void activeConnectionChanged();
+
+private:
+ void clearConfig();
+ void updateCatalog();
+ SqlListAction* dbAction;
+ SqlOutputWidget* m_widget;
+ QStringList conNames;
+ CodeModel *m_store;
+};
+
+#endif
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 00000000..e75b5d04
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,23 @@
+# Here resides the library of general KDevelop-related utilities,
+# which may be linked by any plugin or part. This is installed
+# as a shared library, including header files
+
+INCLUDES = $(all_includes)
+
+lib_LTLIBRARIES = libkdevelop.la
+libkdevelop_la_LDFLAGS = -no-undefined $(all_libraries) -version-info 1:0
+libkdevelop_la_LIBADD = $(top_builddir)/lib/interfaces/libkdevinterfaces.la \
+ $(top_builddir)/lib/widgets/propeditor/libkdevpropertyeditor.la $(LIB_KIO)
+
+# $(top_builddir)/lib/util/libkdevutil.la $(top_builddir)/lib/widgets/propeditor/libkdevpropertyeditor.la \
+# $(top_builddir)/lib/interfaces/external/libkinterfacedesigner.la $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la \
+# -lktexteditor $(LIB_KPARTS) $(LIB_KIO) -lkscript
+libkdevelop_la_SOURCES = dummy.cpp
+
+
+
+SUBDIRS = util interfaces widgets antlr catalog \
+ cppparser astyle
+
+DOXYGEN_EMPTY = YES
+include ../Doxyfile.am
diff --git a/lib/antlr/AUTHORS b/lib/antlr/AUTHORS
new file mode 100644
index 00000000..7bdc4852
--- /dev/null
+++ b/lib/antlr/AUTHORS
@@ -0,0 +1,2 @@
+Author:
+ Peter Wells <pete@yamuna.demon.co.uk>
diff --git a/lib/antlr/COPYING b/lib/antlr/COPYING
new file mode 100644
index 00000000..ce9ec595
--- /dev/null
+++ b/lib/antlr/COPYING
@@ -0,0 +1,32 @@
+
+SOFTWARE RIGHTS
+
+ANTLR MageLang Institute, 1989-1999
+http://www.ANTLR.org
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+MageLang Institute; http://www.MageLang.com
+parrt@jguru.com
+parrt@magelang.com
diff --git a/lib/antlr/ChangeLog b/lib/antlr/ChangeLog
new file mode 100644
index 00000000..735046e5
--- /dev/null
+++ b/lib/antlr/ChangeLog
@@ -0,0 +1,293 @@
+Not 100% complete. Changes from develtree are not listed yet.
+
+Change 400 on 2000/09/27 by klaren@klaren.hawking.main
+
+ Made little TCL script to pretty print a ChangeLog with C++ stuff.
+
+
+Change 399 on 2000/09/27 by klaren@klaren.hawking.main
+
+ Fixed generating too many ASTNULL checks in wrong places.
+
+
+Change 397 on 2000/09/27 by klaren@klaren.hawking.main
+
+ Some *UGLY* fixes for the last typecasting problems in Cpp codegen. It
+ now works. In 2.7.2 or later I'll fix this in a nice way.
+
+
+Change 397 on 2000/09/27 by klaren@klaren.hawking.main
+
+ Some *UGLY* fixes for the last typecasting problems in Cpp codegen. It
+ now works. In 2.7.2 or later I'll fix this in a nice way.
+
+
+Change 394 on 2000/09/26 by klaren@klaren.hawking.main
+
+ Prefixed Unicode optimization checks with a ASTNULL check.
+
+
+Change 393 on 2000/09/25 by klaren@klaren.hawking.main
+
+ Bumped up the version no from 2.7.1a4 to 2.7.1.
+
+
+Change 380 on 2000/09/24 by parrt@parrt.foggy
+
+ integrating ric's stuff into main
+
+
+Change 380 on 2000/09/24 by parrt@parrt.foggy
+
+ integrating ric's stuff into main
+
+
+Change 380 on 2000/09/24 by parrt@parrt.foggy
+
+ integrating ric's stuff into main
+
+
+Change 348 on 2000/09/07 by klaren@klaren.hawking.main
+
+ Small improvement in constructor of CommonAST.
+
+
+Change 344 on 2000/09/06 by klaren@klaren.hawking.main
+
+ Fixed missing namespace in generated TreeParsers as reported by Ross
+ Bencina.
+
+
+Change 341 on 2000/09/06 by klaren@klaren.hawking.main
+
+ Miniscule fix for Borland C++Builder 4.0/C++ 5.4. (extra parens)
+
+
+Change 317 on 2000/08/22 by klaren@klaren.hawking.main
+
+ Updated changelog for a5 (or was it 2.7.1) release..
+
+
+Change 316 on 2000/08/22 by klaren@klaren.hawking.main
+
+ All kinds of small Makefile/configure tweaks. All gcc-isms should be
+ gone now.
+
+
+Change 309 on 2000/08/15 by klaren@klaren.hawking.main
+
+ Integrate bugfixes from klaren.dev to MismatchedChar/TokenException.
+
+
+Change 297 on 2000/08/07 by klaren@klaren.kronecker.main
+
+ Fixes for namespace/namespaceAntlr/namespaceStd/genHashLines options.
+
+
+Change 296 on 2000/08/07 by klaren@klaren.kronecker.main
+
+ Virtualized all functions that someone should want to override. Probably
+ necessary for heteroAST stuff.
+
+
+Change 291 on 2000/08/07 by klaren@klaren.kronecker.main
+
+ Some tweaks to configure.in and Makefile.am's. Fix for CXXFLAGS being
+ set incorrectly when not using gcc.
+
+
+Change 290 on 2000/08/05 by klaren@klaren.kronecker.main
+
+ Updated prototype of toLower to definition in cpp file. It seems I
+ messed them up a while back.
+
+
+Change 289 on 2000/08/05 by klaren@klaren.kronecker.main
+
+ Added namespace macro to out_of_range exception.
+
+
+Change 288 on 2000/07/28 by parrt@parrt.foggy
+
+ re-added toLower return type fix
+
+
+Change 285 on 2000/07/19 by klaren@klaren.kronecker.main
+
+ Fixed thinko.
+
+
+Change 284 on 2000/07/19 by klaren@klaren.kronecker.main
+
+ Dumped output of p4 changes -l into it...
+
+
+Change 283 on 2000/07/19 by klaren@klaren.kronecker.main
+
+ Fix for bug found by Michael Ebner. Bitset size was not increased in add
+ method.
+
+
+Change 280 on 2000/07/19 by klaren@klaren.kronecker.main
+
+ Made namespaceAntlr, namespaceStd and genHashlines options file-level
+ options. Removed nameSpace member from Tool class all is now handled in
+ CppCodegenerator.java.
+
+
+Change 276 on 2000/07/18 by klaren@klaren.kronecker.main
+
+ C++ Changes for the indented traceXXXX output as invented by Monty Zukowski
+
+
+Change 275 on 2000/07/18 by klaren@klaren.kronecker.main
+
+ Added missing initializer in generated code for TreeParser
+
+
+Change 272 on 2000/07/17 by klaren@klaren.kronecker.main
+
+ Another workspace for MSVC6 has support for dll's (for version 2.6.1).
+
+
+Change 271 on 2000/07/17 by klaren@klaren.kronecker.main
+
+ New autoconf/automake stuff for the C++ support library.
+
+
+Change 270 on 2000/07/17 by klaren@klaren.kronecker.main
+
+ Fixed error within the NO_STATIC_CONSTS #ifdef
+
+
+Change 269 on 2000/07/17 by klaren@klaren.kronecker.main
+
+ Move C++ files to lib/cpp/src as first step for autoconf setup
+
+
+Change 268 on 2000/07/17 by klaren@klaren.kronecker.main
+
+ Add contrib dir and Microsoft Visual C++ 6.0 projects supplied by John
+ Millaway
+
+
+Change 260 on 2000/07/14 by klaren@klaren.kronecker.main
+
+ Fixed crashbugs/typos in constructors of Mismatched[Token|Char]Exception
+
+
+Change 258 on 2000/07/10 by parrt@parrt.foggy
+
+ fixes per klaren
+
+
+Change 258 on 2000/07/10 by parrt@parrt.foggy
+
+ fixes per klaren
+
+
+Change 248 on 2000/07/04 by parrt@parrt.foggy
+
+ Ric Klaren's changes to C++ lib
+
+
+Change 247 on 2000/07/04 by parrt@parrt.foggy
+
+ Ric Klaren's changes for namespaces
+
+
+Change 239 on 2000/06/03 by parrt@parrt.foggy
+
+ adjusted so it works; header actions got converted to Token objects from
+ Strings; lots of cast problems and then null ptr exceptions.
+
+Change 235 on 2000/05/31 by pete@pete.linux
+
+ More changes to support #line generation in C++ (from Ric Klaren)
+
+Change 220 on 2000/05/29 by parrt@parrt.foggy
+
+ changed char to int for toLower
+
+
+Change 219 on 2000/05/28 by pete@pete.linux
+
+ Mirroring Java changes
+
+
+Change 218 on 2000/05/28 by pete@pete.linux
+
+ Cleaned up the #line generator a little.
+
+
+Change 211 on 2000/05/27 by parrt@parrt.foggy
+
+ had same bug as JavaCodeGenerator related to ~(A|B)
+
+
+Change 205 on 2000/05/24 by pete@pete.linux
+
+ Add support for Metrowerks Codewarrior
+
+
+Change 203 on 2000/05/22 by pete@pete.linux
+
+ Fix for multithreading from Jan Mikkelsen
+
+
+Change 202 on 2000/05/21 by pete@pete.linux
+
+ Merged in some fixes from Ric Klaren for tracing TreeParsers, cleaner
+ namespace code, and #line generation.
+
+
+Change 202 on 2000/05/21 by pete@pete.linux
+
+ Merged in some fixes from Ric Klaren for tracing TreeParsers, cleaner
+ namespace code, and #line generation.
+
+Change 201 on 2000/05/21 by pete@pete.linux
+
+ Added destructors with empty throw specs, as suggested by Dan Field.
+
+
+Change 200 on 2000/05/21 by pete@pete.linux
+
+ Various performance improvements, mostly from Eric Dumas.
+
+
+Change 183 on 2000/02/08 by pete@pete.linux
+
+ Added support for Sun CC 5.0 (from Michael Schmitt)
+
+
+Change 182 on 2000/02/08 by pete@pete.linux
+
+ Fix a couple of minor problems with C++ generation (noted by Michael
+ Schmitt)
+
+Change 132 on 2000/01/18 by parrt@parrt.foggy
+
+ setting type to ktext for everything
+
+
+Change 132 on 2000/01/18 by parrt@parrt.foggy
+
+ setting type to ktext for everything
+
+
+Change 131 on 2000/01/18 by parrt@parrt.foggy
+
+ from dev back to main
+
+
+Change 131 on 2000/01/18 by parrt@parrt.foggy
+
+ from dev back to main
+
+
+Change 1 on 1999/12/13 by parrt@parrt.foggy
+
+ adding 2.6.0 from antlr site as initial main line
+
+
diff --git a/lib/antlr/INSTALL b/lib/antlr/INSTALL
new file mode 100644
index 00000000..30dd4d49
--- /dev/null
+++ b/lib/antlr/INSTALL
@@ -0,0 +1,183 @@
+Basic Installation
+==================
+
+ These are generic installation instructions. Check out the README for
+additional info.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/lib/antlr/Makefile.am b/lib/antlr/Makefile.am
new file mode 100644
index 00000000..2aa39c30
--- /dev/null
+++ b/lib/antlr/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src antlr
diff --git a/lib/antlr/NEWS b/lib/antlr/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/lib/antlr/NEWS
diff --git a/lib/antlr/README b/lib/antlr/README
new file mode 100644
index 00000000..6ca0913b
--- /dev/null
+++ b/lib/antlr/README
@@ -0,0 +1,72 @@
+C++ support libraries
+
+Original GNU autconf stuff contributed by Braden N. McDaniel. Slightly
+hacked up by me (Ric Klaren (klaren@cs.utwente.nl)) for who it's the first
+autoconf/automake/aclocal stuff ever, so suggestions additions welcome.
+
+HOW TO INSTALL
+
+In theory do:
+
+./configure --prefix=<basedirectory where you want it installed>
+make
+make install
+
+Now libantlr.a should reside under <basedir>/lib/libantlr.a and the
+includes should be at <basedir>/include/antlr.
+
+NOTE: this only installs the C++ library and header files.
+
+In the contrib directory a dsp/dsw project for Microsoft Visual C++ can be
+found.
+
+In general this library needs runtime typing information (RTTI) make sure
+you enable this in whatever compiler you are using.
+
+SUPPORTED COMPILERS
+
+Pasted from the FAQ entry on: http://www.jguru.com/jguru/faq/view.jsp?EID=121
+
+Compiler OS Version
+------------------ --------------------- ----------
+Sun Workshop 4.2 Solaris 2.6, 7 2.7.1a2
+Sun Workshop 5.0 Solaris 2.7 2.7.1a2
+Sun Workshop 6.0 Solaris 2.7 2.7.1a2
+egcs-1.1.2 Solaris 2.6,7 2.7.1a2
+egcs-1.1.2 Linux 2.2, Solaris 2.6 2.7.1a2
+gcc-2.95.2 Linux 2.2, Solaris 2.6,7 2.7.1a2
+gcc-2.96 (20000527) Solaris 2.6 2.7.1a2
+aCC A.01.21 HP-UX 10.20 2.7.0 no!
+Visual C++ 6.0 PC 2.7.1a2 (warnings)
+Intel C++ 4.0 NT 4.0 2.7.0
+Borland 5.0 NT 4.0 2.7.0
+
+IT DOESN'T WORK!?
+
+Check out the faq: http://www.jguru.com/jguru/faq/view.jsp?EID=120
+
+The text of that entry (by Peter Wells):
+
+The ANTLR code uses some relatively new features of C++ which not all
+compilers support yet (such as namespaces, and new style standard headers).
+
+There is work currently in progress to provide a compatibility mode for
+ANTLR, to enable older compilers to handle this.
+
+At the moment, you may be able to work around the problem with a few nasty
+tricks:
+
+Try creating some header files like 'iostream' just containing:
+
+#include <iostream.h>
+
+and compile with an option to define away the word 'std', such as
+
+CC .... -Dstd= ....
+
+Also in the antlr subdirectory there's a file config.hpp. Tweak this one to
+enable/disable the different bells and whistles used in the rest of the code.
+Don't forget to submit those changes back to us (along with compiler info)
+so we can incorporate them in our next release!
+
+Thanks!
diff --git a/lib/antlr/TODO b/lib/antlr/TODO
new file mode 100644
index 00000000..51d104c3
--- /dev/null
+++ b/lib/antlr/TODO
@@ -0,0 +1,34 @@
+* Improve configure scripts => KICK OUT automake!
+
+* Add allocators to the objects
+
+* Look more at exception handling
+
+* TreeParser.cpp around line 76 the MismatchedTokenException here does not
+ use ttype to improve it's errormessage. Would require changing a bit in
+ MismatchedTokenException.cpp
+
+* On Thu, Sep 21, 2000 at 12:33:48AM -0700, John Lambert <JohnL@jBASE.com> wrote:
+ > 1) The literal EOF is not defined and causes the define of EOF_CHAR in
+ > CharScanner.hpp to fail.
+
+ ANTLR with STL Port. Changing the EOF define to char_traits<char>::eof()
+ breaks things for gcc-2.95.2. Fix this in next release portably.
+ http://www.egroups.com/message/antlr-interest/2520
+
+* John Millaway requested some mechanism to add code to the constructor
+ of the parser/lexer/treewalker. This can be usefull.
+ http://www.egroups.com/message/antlr-interest/2501
+
+* Fix heterogeneous AST stuff. It boils down to adding a method to AST
+ types that knows how to duplicate the sucker. Atm duptree cannot work
+ because of this. Knowing one factory is not enough. Also look at having
+ to set the astfactory by hand (this is not 100% necessary).
+ http://www.egroups.com/message/antlr-interest/2496
+
+* Look at messageLog stuff Ross Bencina proposed. Looks good at first glance.
+ http://www.egroups.com/message/antlr-interest/2555
+
+* Add RW_STL & CC 4.2 patch from Ulrich Teichert:
+ See my mailbox.. and these comments from Ross Bencina:
+ http://www.egroups.com/message/antlr-interest/2494
diff --git a/lib/antlr/antlr/ANTLRException.hpp b/lib/antlr/antlr/ANTLRException.hpp
new file mode 100644
index 00000000..426595a2
--- /dev/null
+++ b/lib/antlr/antlr/ANTLRException.hpp
@@ -0,0 +1,59 @@
+#ifndef INC_ANTLRException_hpp__
+#define INC_ANTLRException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API ANTLRException
+{
+public:
+ /// Create ANTLR base exception without error message
+ ANTLRException() : text("")
+ {
+ }
+ /// Create ANTLR base exception with error message
+ ANTLRException(const ANTLR_USE_NAMESPACE(std)string& s)
+ : text(s)
+ {
+ }
+ virtual ~ANTLRException() throw()
+ {
+ }
+
+ /** Return complete error message with line/column number info (if present)
+ * @note for your own exceptions override this one. Call getMessage from
+ * here to get the 'clean' error message stored in the text attribute.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const
+ {
+ return text;
+ }
+
+ /** Return error message without additional info (if present)
+ * @note when making your own exceptions classes override toString
+ * and call in toString getMessage which relays the text attribute
+ * from here.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)string getMessage() const
+ {
+ return text;
+ }
+private:
+ ANTLR_USE_NAMESPACE(std)string text;
+};
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ANTLRException_hpp__
diff --git a/lib/antlr/antlr/ANTLRUtil.hpp b/lib/antlr/antlr/ANTLRUtil.hpp
new file mode 100644
index 00000000..4732588c
--- /dev/null
+++ b/lib/antlr/antlr/ANTLRUtil.hpp
@@ -0,0 +1,53 @@
+#ifndef INC_ANTLRUtil_hpp__
+#define INC_ANTLRUtil_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Eat whitespace from the input stream
+ * @param is the stream to read from
+ */
+ANTLR_USE_NAMESPACE(std)istream& eatwhite( ANTLR_USE_NAMESPACE(std)istream& is );
+
+/** Read a string enclosed by '"' from a stream. Also handles escaping of \".
+ * Skips leading whitespace.
+ * @param in the istream to read from.
+ * @returns the string read from file exclusive the '"'
+ * @throws ios_base::failure if string is badly formatted
+ */
+ANTLR_USE_NAMESPACE(std)string read_string( ANTLR_USE_NAMESPACE(std)istream& in );
+
+/* Read a ([A-Z][0-9][a-z]_)* kindoff thing. Skips leading whitespace.
+ * @param in the istream to read from.
+ */
+ANTLR_USE_NAMESPACE(std)string read_identifier( ANTLR_USE_NAMESPACE(std)istream& in );
+
+/** Read a attribute="value" thing. Leading whitespace is skipped.
+ * Between attribute and '=' no whitespace is allowed. After the '=' it is
+ * permitted.
+ * @param in the istream to read from.
+ * @param attribute string the attribute name is put in
+ * @param value string the value of the attribute is put in
+ * @throws ios_base::failure if something is fishy. E.g. malformed quoting
+ * or missing '='
+ */
+void read_AttributeNValue( ANTLR_USE_NAMESPACE(std)istream& in,
+ ANTLR_USE_NAMESPACE(std)string& attribute,
+ ANTLR_USE_NAMESPACE(std)string& value );
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/lib/antlr/antlr/AST.hpp b/lib/antlr/antlr/AST.hpp
new file mode 100644
index 00000000..b01a60a9
--- /dev/null
+++ b/lib/antlr/antlr/AST.hpp
@@ -0,0 +1,166 @@
+#ifndef INC_AST_hpp__
+#define INC_AST_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/ASTRefCount.hpp>
+#include <antlr/Token.hpp>
+#include <vector>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+struct ASTRef;
+
+class ANTLR_API AST {
+public:
+ AST() : ref(0) {}
+ AST(const AST&) : ref(0) {}
+ virtual ~AST() {}
+
+ /// Return the type name for this AST node. (for XML output)
+ virtual const char* typeName( void ) const = 0;
+ /// Clone this AST node.
+ virtual RefAST clone( void ) const = 0;
+ /// Is node t equal to this in terms of token type and text?
+ virtual bool equals(RefAST t) const = 0;
+ /** Is t an exact structural and equals() match of this tree. The
+ * 'this' reference is considered the start of a sibling list.
+ */
+ virtual bool equalsList(RefAST t) const = 0;
+
+ /** Is 't' a subtree of this list? The siblings of the root are NOT ignored.
+ */
+ virtual bool equalsListPartial(RefAST t) const = 0;
+ /** Is tree rooted at 'this' equal to 't'? The siblings of 'this' are
+ * ignored.
+ */
+ virtual bool equalsTree(RefAST t) const = 0;
+ /** Is 't' a subtree of the tree rooted at 'this'? The siblings of
+ * 'this' are ignored.
+ */
+ virtual bool equalsTreePartial(RefAST t) const = 0;
+
+ /** Walk the tree looking for all exact subtree matches. Return
+ * a vector of RefAST that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)vector<RefAST> findAll(RefAST t) = 0;
+
+ /** Walk the tree looking for all subtrees. Return
+ * a vector of RefAST that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)vector<RefAST> findAllPartial(RefAST t) = 0;
+
+ /// Add a node to the end of the child list for this node
+ virtual void addChild(RefAST c) = 0;
+ /// Get the number of children. Returns 0 if the node is a leaf
+ virtual size_t getNumberOfChildren() const = 0;
+
+ /// Get the first child of this node; null if no children
+ virtual RefAST getFirstChild() const = 0;
+ /// Get the next sibling in line after this one
+ virtual RefAST getNextSibling() const = 0;
+
+ /// Get the token text for this node
+ virtual ANTLR_USE_NAMESPACE(std)string getText() const = 0;
+ /// Get the token type for this node
+ virtual int getType() const = 0;
+
+ /** Various initialization routines. Used by several factories to initialize
+ * an AST element.
+ */
+ virtual void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt) = 0;
+ virtual void initialize(RefAST t) = 0;
+ virtual void initialize(RefToken t) = 0;
+
+#ifdef ANTLR_SUPPORT_XML
+ /** initialize this node from the contents of a stream.
+ * @param in the stream to read the AST attributes from.
+ */
+ virtual void initialize( ANTLR_USE_NAMESPACE(std)istream& in ) = 0;
+#endif
+
+ /// Set the first child of a node.
+ virtual void setFirstChild(RefAST c) = 0;
+ /// Set the next sibling after this one.
+ virtual void setNextSibling(RefAST n) = 0;
+
+ /// Set the token text for this node
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& txt) = 0;
+ /// Set the token type for this node
+ virtual void setType(int type) = 0;
+
+ /// Return this AST node as a string
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const = 0;
+
+ /// Print out a child-sibling tree in LISP notation
+ virtual ANTLR_USE_NAMESPACE(std)string toStringList() const = 0;
+ virtual ANTLR_USE_NAMESPACE(std)string toStringTree() const = 0;
+
+#ifdef ANTLR_SUPPORT_XML
+ /** get attributes of this node to 'out'. Override to customize XML
+ * output.
+ * @param out the stream to write the AST attributes to.
+ * @returns if a explicit closetag should be written
+ */
+ virtual bool attributesToStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const = 0;
+
+ /** Print a symbol over ostream. Overload this one to customize the XML
+ * output for AST derived AST-types
+ * @param output stream
+ */
+ virtual void toStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const = 0;
+
+ /** Dump AST contents in XML format to output stream.
+ * Works in conjunction with to_stream method. Overload that one is
+ * derived classes to customize behaviour.
+ * @param output stream to write to string to put the stuff in.
+ * @param ast RefAST object to write.
+ */
+ friend ANTLR_USE_NAMESPACE(std)ostream& operator<<( ANTLR_USE_NAMESPACE(std)ostream& output, const RefAST& ast );
+#endif
+
+private:
+ friend struct ASTRef;
+ ASTRef* ref;
+
+ AST(RefAST other);
+ AST& operator=(const AST& other);
+ AST& operator=(RefAST other);
+};
+
+#ifdef ANTLR_SUPPORT_XML
+inline ANTLR_USE_NAMESPACE(std)ostream& operator<<( ANTLR_USE_NAMESPACE(std)ostream& output, const RefAST& ast )
+{
+ ast->toStream(output);
+ return output;
+}
+#endif
+
+extern ANTLR_API RefAST nullAST;
+extern ANTLR_API AST* const nullASTptr;
+
+#ifdef NEEDS_OPERATOR_LESS_THAN
+// RK: apparently needed by MSVC and a SUN CC, up to and including
+// 2.7.2 this was undefined ?
+inline bool operator<( RefAST l, RefAST r )
+{
+ return nullAST == l ? ( nullAST == r ? false : true ) : l->getType() < r->getType();
+}
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_AST_hpp__
diff --git a/lib/antlr/antlr/ASTArray.hpp b/lib/antlr/antlr/ASTArray.hpp
new file mode 100644
index 00000000..2d224d32
--- /dev/null
+++ b/lib/antlr/antlr/ASTArray.hpp
@@ -0,0 +1,45 @@
+#ifndef INC_ASTArray_hpp__
+#define INC_ASTArray_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** ASTArray is a class that allows ANTLR to
+ * generate code that can create and initialize an array
+ * in one expression, like:
+ * (new ASTArray(3))->add(x)->add(y)->add(z)
+ */
+class ANTLR_API ASTArray {
+public:
+ int size; // = 0;
+ ANTLR_USE_NAMESPACE(std)vector<RefAST> array;
+
+ ASTArray(int capacity)
+ : size(0)
+ , array(capacity)
+ {
+ }
+
+ ASTArray* add(RefAST node)
+ {
+ array[size++] = node;
+ return this;
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ASTArray_hpp__
diff --git a/lib/antlr/antlr/ASTFactory.hpp b/lib/antlr/antlr/ASTFactory.hpp
new file mode 100644
index 00000000..968ab6c5
--- /dev/null
+++ b/lib/antlr/antlr/ASTFactory.hpp
@@ -0,0 +1,165 @@
+#ifndef INC_ASTFactory_hpp__
+#define INC_ASTFactory_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/ASTArray.hpp>
+#include <antlr/ASTPair.hpp>
+
+#include <istream>
+#include <utility>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+// Using these extra types to appease MSVC
+typedef RefAST (*factory_type_)();
+typedef ANTLR_USE_NAMESPACE(std)pair< const char*, factory_type_ > factory_descriptor_;
+typedef ANTLR_USE_NAMESPACE(std)vector< factory_descriptor_* > factory_descriptor_list_;
+
+/** AST Super Factory shared by TreeParser and Parser.
+ * This super factory maintains a map of all AST node types to their respective
+ * AST factories. One instance should be shared among a parser/treeparser
+ * chain.
+ *
+ * @todo check all this code for possible use of references in
+ * stead of RefAST's.
+ */
+class ANTLR_API ASTFactory {
+public:
+ typedef factory_type_ factory_type;
+ typedef factory_descriptor_ factory_descriptor;
+ typedef factory_descriptor_list_ factory_descriptor_list;
+protected:
+ /* The mapping of AST node type to factory..
+ */
+ factory_descriptor default_factory_descriptor;
+ factory_descriptor_list nodeFactories;
+public:
+ /// Make new factory. Per default (Ref)CommonAST instances are generated.
+ ASTFactory();
+ /** Initialize factory with a non default node type.
+ * factory_node_name should be the name of the AST node type the factory
+ * generates. (should exist during the existance of this ASTFactory
+ * instance)
+ */
+ ASTFactory( const char* factory_node_name, factory_type factory );
+ /// Destroy factory
+ virtual ~ASTFactory();
+
+ /// Register a node factory for the node type type with name ast_name
+ void registerFactory( int type, const char* ast_name, factory_type factory );
+ /// Set the maximum node (AST) type this factory may encounter
+ void setMaxNodeType( int type );
+
+ /// Add a child to the current AST
+ void addASTChild(ASTPair& currentAST, RefAST child);
+ /// Create new empty AST node. The right default type shou
+ virtual RefAST create();
+ /// Create AST node of the right type for 'type'
+ RefAST create(int type);
+ /// Create AST node of the right type for 'type' and initialize with txt
+ RefAST create(int type, const ANTLR_USE_NAMESPACE(std)string& txt);
+ /// Create duplicate of tr
+ RefAST create(RefAST tr);
+ /// Create new AST node and initialize contents from a token.
+ RefAST create(RefToken tok);
+ /// Create new AST node and initialize contents from a stream.
+ RefAST create(const ANTLR_USE_NAMESPACE(std)string& txt, ANTLR_USE_NAMESPACE(std)istream& infile );
+ /** Deep copy a single node. This function the new clone() methods in the
+ * AST interface. Returns a new RefAST(nullASTptr) if t is null.
+ */
+ RefAST dup(RefAST t);
+ /// Duplicate tree including siblings of root.
+ RefAST dupList(RefAST t);
+ /** Duplicate a tree, assuming this is a root node of a tree--
+ * duplicate that node and what's below; ignore siblings of root node.
+ */
+ RefAST dupTree(RefAST t);
+ /** Make a tree from a list of nodes. The first element in the
+ * array is the root. If the root is null, then the tree is
+ * a simple list not a tree. Handles null children nodes correctly.
+ * For example, make(a, b, null, c) yields tree (a b c). make(null,a,b)
+ * yields tree (nil a b).
+ */
+ RefAST make(ANTLR_USE_NAMESPACE(std)vector<RefAST>& nodes);
+ /** Make a tree from a list of nodes, where the nodes are contained
+ * in an ASTArray object. The ASTArray is deleted after use.
+ * @todo FIXME! I have a feeling we can get rid of this ugly ASTArray thing
+ */
+ RefAST make(ASTArray* nodes);
+ /// Make an AST the root of current AST
+ void makeASTRoot(ASTPair& currentAST, RefAST root);
+
+ /** Set a new default AST type.
+ * factory_node_name should be the name of the AST node type the factory
+ * generates. (should exist during the existance of this ASTFactory
+ * instance).
+ * Only change factory between parser runs. You might get unexpected results
+ * otherwise.
+ */
+ void setASTNodeFactory( const char* factory_node_name, factory_type factory );
+
+#ifdef ANTLR_SUPPORT_XML
+ /** Load a XML AST from stream. Make sure you have all the factories
+ * registered before use.
+ * @note this 'XML' stuff is quite rough still. YMMV.
+ */
+ RefAST LoadAST( ANTLR_USE_NAMESPACE(std)istream& infile );
+#endif
+protected:
+ void loadChildren( ANTLR_USE_NAMESPACE(std)istream& infile, RefAST current );
+ void loadSiblings( ANTLR_USE_NAMESPACE(std)istream& infile, RefAST current );
+ bool checkCloseTag( ANTLR_USE_NAMESPACE(std)istream& infile );
+
+#ifdef ANTLR_VECTOR_HAS_AT
+ /// construct a node of 'type'
+ inline RefAST getNodeOfType( unsigned int type )
+ {
+ return RefAST(nodeFactories.at(type)->second());
+ }
+ /// get the name of the node 'type'
+ const char* getASTNodeType( unsigned int type )
+ {
+ return nodeFactories.at(type)->first;
+ }
+ /// get the factory used for node 'type'
+ factory_type getASTNodeFactory( unsigned int type )
+ {
+ return nodeFactories.at(type)->second;
+ }
+#else
+ inline RefAST getNodeOfType( unsigned int type )
+ {
+ return RefAST(nodeFactories[type]->second());
+ }
+ /// get the name of the node 'type'
+ const char* getASTNodeType( unsigned int type )
+ {
+ return nodeFactories[type]->first;
+ }
+ factory_type getASTNodeFactory( unsigned int type )
+ {
+ return nodeFactories[type]->second;
+ }
+#endif
+
+private:
+ // no copying and such..
+ ASTFactory( const ASTFactory& );
+ ASTFactory& operator=( const ASTFactory& );
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ASTFactory_hpp__
diff --git a/lib/antlr/antlr/ASTNULLType.hpp b/lib/antlr/antlr/ASTNULLType.hpp
new file mode 100644
index 00000000..867f5e5b
--- /dev/null
+++ b/lib/antlr/antlr/ASTNULLType.hpp
@@ -0,0 +1,64 @@
+#ifndef INC_ASTNULLType_hpp__
+#define INC_ASTNULLType_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** There is only one instance of this class **/
+class ANTLR_API ASTNULLType : public AST {
+public:
+ const char* typeName( void ) const;
+ RefAST clone( void ) const;
+
+ void addChild(RefAST c);
+ size_t getNumberOfChildren() const;
+ void setFirstChild(RefAST c);
+ void setNextSibling(RefAST n);
+
+ bool equals(RefAST t) const;
+ bool equalsList(RefAST t) const;
+ bool equalsListPartial(RefAST t) const;
+ bool equalsTree(RefAST t) const;
+ bool equalsTreePartial(RefAST t) const;
+
+ ANTLR_USE_NAMESPACE(std)vector<RefAST> findAll(RefAST tree);
+ ANTLR_USE_NAMESPACE(std)vector<RefAST> findAllPartial(RefAST subtree);
+
+ RefAST getFirstChild() const;
+ RefAST getNextSibling() const;
+
+ ANTLR_USE_NAMESPACE(std)string getText() const;
+ int getType() const;
+
+ void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt);
+ void initialize(RefAST t);
+ void initialize(RefToken t);
+ void initialize(ANTLR_USE_NAMESPACE(std)istream& infile);
+
+ void setText(const ANTLR_USE_NAMESPACE(std)string& text);
+ void setType(int ttype);
+ ANTLR_USE_NAMESPACE(std)string toString() const;
+ ANTLR_USE_NAMESPACE(std)string toStringList() const;
+ ANTLR_USE_NAMESPACE(std)string toStringTree() const;
+
+ bool attributesToStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const;
+ void toStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ASTNULLType_hpp__
diff --git a/lib/antlr/antlr/ASTPair.hpp b/lib/antlr/antlr/ASTPair.hpp
new file mode 100644
index 00000000..d6237902
--- /dev/null
+++ b/lib/antlr/antlr/ASTPair.hpp
@@ -0,0 +1,57 @@
+#ifndef INC_ASTPair_hpp__
+#define INC_ASTPair_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** ASTPair: utility class used for manipulating a pair of ASTs
+ * representing the current AST root and current AST sibling.
+ * This exists to compensate for the lack of pointers or 'var'
+ * arguments in Java.
+ *
+ * OK, so we can do those things in C++, but it seems easier
+ * to stick with the Java way for now.
+ */
+class ANTLR_API ASTPair {
+public:
+ RefAST root; // current root of tree
+ RefAST child; // current child to which siblings are added
+
+ /** Make sure that child is the last sibling */
+ void advanceChildToEnd() {
+ if (child) {
+ while (child->getNextSibling()) {
+ child = child->getNextSibling();
+ }
+ }
+ }
+// /** Copy an ASTPair. Don't call it clone() because we want type-safety */
+// ASTPair copy() {
+// ASTPair tmp = new ASTPair();
+// tmp.root = root;
+// tmp.child = child;
+// return tmp;
+// }
+ ANTLR_USE_NAMESPACE(std)string toString() const {
+ ANTLR_USE_NAMESPACE(std)string r = !root ? ANTLR_USE_NAMESPACE(std)string("null") : root->getText();
+ ANTLR_USE_NAMESPACE(std)string c = !child ? ANTLR_USE_NAMESPACE(std)string("null") : child->getText();
+ return "["+r+","+c+"]";
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ASTPair_hpp__
diff --git a/lib/antlr/antlr/ASTRefCount.hpp b/lib/antlr/antlr/ASTRefCount.hpp
new file mode 100644
index 00000000..f5ef4422
--- /dev/null
+++ b/lib/antlr/antlr/ASTRefCount.hpp
@@ -0,0 +1,98 @@
+#ifndef INC_ASTRefCount_hpp__
+# define INC_ASTRefCount_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+# include <antlr/config.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+ class AST;
+
+struct ANTLR_API ASTRef
+{
+ AST* const ptr;
+ unsigned int count;
+
+ ASTRef(AST* p);
+ ~ASTRef();
+ ASTRef* increment()
+ {
+ ++count;
+ return this;
+ }
+ bool decrement()
+ {
+ return (--count==0);
+ }
+
+ static ASTRef* getRef(const AST* p);
+private:
+ ASTRef( const ASTRef& );
+ ASTRef& operator=( const ASTRef& );
+};
+
+template<class T>
+ class ANTLR_API ASTRefCount
+{
+private:
+ ASTRef* ref;
+
+public:
+ ASTRefCount(const AST* p=0)
+ : ref(p ? ASTRef::getRef(p) : 0)
+ {
+ }
+ ASTRefCount(const ASTRefCount<T>& other)
+ : ref(other.ref ? other.ref->increment() : 0)
+ {
+ }
+ ~ASTRefCount()
+ {
+ if (ref && ref->decrement())
+ delete ref;
+ }
+ ASTRefCount<T>& operator=(AST* other)
+ {
+ ASTRef* tmp = ASTRef::getRef(other);
+
+ if (ref && ref->decrement())
+ delete ref;
+
+ ref=tmp;
+
+ return *this;
+ }
+ ASTRefCount<T>& operator=(const ASTRefCount<T>& other)
+ {
+ if( other.ref != ref )
+ {
+ ASTRef* tmp = other.ref ? other.ref->increment() : 0;
+
+ if (ref && ref->decrement())
+ delete ref;
+
+ ref=tmp;
+ }
+ return *this;
+ }
+
+ operator T* () const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+ T* operator->() const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+ T* get() const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+};
+
+typedef ASTRefCount<AST> RefAST;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ASTRefCount_hpp__
diff --git a/lib/antlr/antlr/BaseAST.hpp b/lib/antlr/antlr/BaseAST.hpp
new file mode 100644
index 00000000..1bfc4e56
--- /dev/null
+++ b/lib/antlr/antlr/BaseAST.hpp
@@ -0,0 +1,193 @@
+#ifndef INC_BaseAST_hpp__
+#define INC_BaseAST_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API BaseAST;
+typedef ASTRefCount<BaseAST> RefBaseAST;
+
+class ANTLR_API BaseAST : public AST {
+public:
+ BaseAST() : AST()
+ {
+ }
+ BaseAST(const BaseAST& other)
+ : AST(other)
+ {
+ }
+ virtual ~BaseAST()
+ {
+ }
+
+ /// Return the class name
+ virtual const char* typeName( void ) const = 0;
+
+ /// Clone this AST node.
+ virtual RefAST clone( void ) const = 0;
+
+ /// Is node t equal to this in terms of token type and text?
+ virtual bool equals(RefAST t) const;
+
+ /** Is t an exact structural and equals() match of this tree. The
+ * 'this' reference is considered the start of a sibling list.
+ */
+ virtual bool equalsList(RefAST t) const;
+
+ /** Is 't' a subtree of this list? The siblings of the root are NOT ignored.
+ */
+ virtual bool equalsListPartial(RefAST t) const;
+
+ /** Is tree rooted at 'this' equal to 't'? The siblings of 'this' are
+ * ignored.
+ */
+ virtual bool equalsTree(RefAST t) const;
+
+ /** Is 't' a subtree of the tree rooted at 'this'? The siblings of
+ * 'this' are ignored.
+ */
+ virtual bool equalsTreePartial(RefAST t) const;
+
+ /** Walk the tree looking for all exact subtree matches. Return
+ * an ASTEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)vector<RefAST> findAll(RefAST t);
+
+ /** Walk the tree looking for all subtrees. Return
+ * an ASTEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ virtual ANTLR_USE_NAMESPACE(std)vector<RefAST> findAllPartial(RefAST t);
+
+ /// Add a node to the end of the child list for this node
+ virtual void addChild(RefAST c)
+ {
+ if( !c )
+ return;
+
+ RefBaseAST tmp = down;
+
+ if (tmp)
+ {
+ while (tmp->right)
+ tmp = tmp->right;
+ tmp->right = c;
+ }
+ else
+ down = c;
+ }
+
+ /** Get the number of child nodes of this node (shallow e.g. not of the
+ * whole tree it spans).
+ */
+ virtual size_t getNumberOfChildren() const;
+
+ /// Get the first child of this node; null if no children
+ virtual RefAST getFirstChild() const
+ {
+ return RefAST(down);
+ }
+ /// Get the next sibling in line after this one
+ virtual RefAST getNextSibling() const
+ {
+ return RefAST(right);
+ }
+
+ /// Get the token text for this node
+ virtual ANTLR_USE_NAMESPACE(std)string getText() const
+ {
+ return "";
+ }
+ /// Get the token type for this node
+ virtual int getType() const
+ {
+ return 0;
+ }
+
+ /// Remove all children
+ virtual void removeChildren()
+ {
+ down = static_cast<BaseAST*>(static_cast<AST*>(nullAST));
+ }
+
+ /// Set the first child of a node.
+ virtual void setFirstChild(RefAST c)
+ {
+ down = static_cast<BaseAST*>(static_cast<AST*>(c));
+ }
+
+ /// Set the next sibling after this one.
+ virtual void setNextSibling(RefAST n)
+ {
+ right = static_cast<BaseAST*>(static_cast<AST*>(n));
+ }
+
+ /// Set the token text for this node
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& txt)
+ {
+ }
+
+ /// Set the token type for this node
+ virtual void setType(int type)
+ {
+ }
+
+#ifdef ANTLR_SUPPORT_XML
+ /** print attributes of this node to 'out'. Override to customize XML
+ * output.
+ * @param out the stream to write the AST attributes to.
+ */
+ virtual bool attributesToStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const;
+ /** Write this subtree to a stream. Overload this one to customize the XML
+ * output for AST derived AST-types
+ * @param output stream
+ */
+ virtual void toStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const;
+#endif
+
+ /// Return string representation for the AST
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const
+ {
+ return getText();
+ }
+
+ /// Print out a child sibling tree in LISP notation
+ virtual ANTLR_USE_NAMESPACE(std)string toStringList() const;
+ virtual ANTLR_USE_NAMESPACE(std)string toStringTree() const;
+protected:
+ RefBaseAST down;
+ RefBaseAST right;
+private:
+ void doWorkForFindAll(ANTLR_USE_NAMESPACE(std)vector<RefAST>& v,
+ RefAST target,
+ bool partialMatch);
+};
+
+/** Is node t equal to this in terms of token type and text?
+ */
+inline bool BaseAST::equals(RefAST t) const
+{
+ if (!t)
+ return false;
+ return ((getType() == t->getType()) && (getText() == t->getText()));
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_BaseAST_hpp__
diff --git a/lib/antlr/antlr/BitSet.hpp b/lib/antlr/antlr/BitSet.hpp
new file mode 100644
index 00000000..f7619232
--- /dev/null
+++ b/lib/antlr/antlr/BitSet.hpp
@@ -0,0 +1,60 @@
+#ifndef INC_BitSet_hpp__
+#define INC_BitSet_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <vector>
+#include <stdexcept>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A BitSet to replace java.util.BitSet.
+ * Primary differences are that most set operators return new sets
+ * as opposed to oring and anding "in place". Further, a number of
+ * operations were added. I cannot contain a BitSet because there
+ * is no way to access the internal bits (which I need for speed)
+ * and, because it is final, I cannot subclass to add functionality.
+ * Consider defining set degree. Without access to the bits, I must
+ * call a method n times to test the ith bit...ack!
+ *
+ * Also seems like or() from util is wrong when size of incoming set is bigger
+ * than this.length.
+ *
+ * This is a C++ version of the Java class described above, with only
+ * a handful of the methods implemented, because we don't need the
+ * others at runtime. It's really just a wrapper around vector<bool>,
+ * which should probably be changed to a wrapper around bitset, once
+ * bitset is more widely available.
+ *
+ * @author Terence Parr, MageLang Institute
+ * @author <br><a href="mailto:pete@yamuna.demon.co.uk">Pete Wells</a>
+ */
+class ANTLR_API BitSet {
+private:
+ ANTLR_USE_NAMESPACE(std)vector<bool> storage;
+
+public:
+ BitSet( unsigned int nbits=64 );
+ BitSet( const unsigned long* bits_, unsigned int nlongs);
+ ~BitSet();
+
+ void add( unsigned int el );
+
+ bool member( unsigned int el ) const;
+
+ ANTLR_USE_NAMESPACE(std)vector<unsigned int> toArray() const;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_BitSet_hpp__
diff --git a/lib/antlr/antlr/CharBuffer.hpp b/lib/antlr/antlr/CharBuffer.hpp
new file mode 100644
index 00000000..fe2b1bc5
--- /dev/null
+++ b/lib/antlr/antlr/CharBuffer.hpp
@@ -0,0 +1,56 @@
+#ifndef INC_CharBuffer_hpp__
+#define INC_CharBuffer_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+
+#include <istream>
+
+#include <antlr/InputBuffer.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**A Stream of characters fed to the lexer from a InputStream that can
+ * be rewound via mark()/rewind() methods.
+ * <p>
+ * A dynamic array is used to buffer up all the input characters. Normally,
+ * "k" characters are stored in the buffer. More characters may be stored
+ * during guess mode (testing syntactic predicate), or when LT(i>k) is
+ * referenced.
+ * Consumption of characters is deferred. In other words, reading the next
+ * character is not done by consume(), but deferred until needed by LA or LT.
+ * <p>
+ *
+ * @see antlr.CharQueue
+ */
+
+class ANTLR_API CharBuffer : public InputBuffer {
+public:
+ /// Create a character buffer
+ CharBuffer( ANTLR_USE_NAMESPACE(std)istream& input );
+ /// Get the next character from the stream
+ int getChar();
+
+protected:
+ // character source
+ ANTLR_USE_NAMESPACE(std)istream& input;
+
+private:
+ // NOTE: Unimplemented
+ CharBuffer(const CharBuffer& other);
+ CharBuffer& operator=(const CharBuffer& other);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CharBuffer_hpp__
diff --git a/lib/antlr/antlr/CharInputBuffer.hpp b/lib/antlr/antlr/CharInputBuffer.hpp
new file mode 100644
index 00000000..543972a3
--- /dev/null
+++ b/lib/antlr/antlr/CharInputBuffer.hpp
@@ -0,0 +1,77 @@
+#ifndef INC_CharInputBuffer_hpp__
+# define INC_CharInputBuffer_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+# include <antlr/config.hpp>
+# include <antlr/InputBuffer.hpp>
+
+# ifdef HAS_NOT_CCTYPE_H
+# include <ctype.h>
+# else
+# include <cctype>
+# endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** CharInputBuffer.hpp provides an InputBuffer for plain character arrays (buffers).
+ */
+class CharInputBuffer : public InputBuffer
+{
+public:
+ /** Construct a CharInputBuffer.hpp object with a char* buffer of 'size'
+ * if 'owner' is true, then the buffer will be delete[]-ed on destruction.
+ * @note it is assumed the buffer was allocated with new[]!
+ */
+ CharInputBuffer( unsigned char* buf, size_t size, bool owner = false )
+ : buffer(buf)
+ , ptr(buf)
+ , end(buf + size)
+ , delete_buffer(owner)
+ {
+ }
+
+ /** Destructor
+ * @note If you're using malloced data, then you probably need to change
+ * this destructor. Or better use this class as template for your own.
+ */
+ ~CharInputBuffer( void )
+ {
+ if( delete_buffer && buffer )
+ delete [] buffer;
+ }
+
+ /** Reset the CharInputBuffer to initial state
+ * Called from LexerInputState::reset.
+ * @see LexerInputState
+ */
+ virtual inline void reset( void )
+ {
+ InputBuffer::reset();
+ ptr = buffer;
+ }
+
+ virtual int getChar( void )
+ {
+ return (ptr < end) ? *ptr++ : EOF;
+ }
+
+protected:
+ unsigned char* buffer; ///< the buffer with data
+ unsigned char* ptr; ///< position ptr into the buffer
+ unsigned char* end; ///< end sentry for buffer
+ bool delete_buffer; ///< flag signifying if we have to delete the buffer
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/lib/antlr/antlr/CharScanner.hpp b/lib/antlr/antlr/CharScanner.hpp
new file mode 100644
index 00000000..c426eba2
--- /dev/null
+++ b/lib/antlr/antlr/CharScanner.hpp
@@ -0,0 +1,575 @@
+#ifndef INC_CharScanner_hpp__
+#define INC_CharScanner_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+
+#include <map>
+
+#ifdef HAS_NOT_CCTYPE_H
+#include <ctype.h>
+#else
+#include <cctype>
+#endif
+#include <cstring>
+
+#if ( _MSC_VER == 1200 )
+// VC6 seems to need this
+// note that this is not a standard C++ include file.
+# include <stdio.h>
+#endif
+
+#include <antlr/TokenStream.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/SemanticException.hpp>
+#include <antlr/MismatchedCharException.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/LexerSharedInputState.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CharScanner;
+
+ANTLR_C_USING(tolower)
+
+#ifdef ANTLR_REALLY_NO_STRCASECMP
+// Apparently, neither strcasecmp nor stricmp is standard, and Codewarrior
+// on the mac has neither...
+inline int strcasecmp(const char *s1, const char *s2)
+{
+ while (true)
+ {
+ char c1 = tolower(*s1++),
+ c2 = tolower(*s2++);
+ if (c1 < c2) return -1;
+ if (c1 > c2) return 1;
+ if (c1 == 0) return 0;
+ }
+}
+#else
+#ifdef NO_STRCASECMP
+ANTLR_C_USING(stricmp)
+#else
+ANTLR_C_USING(strcasecmp)
+#endif
+#endif
+
+/** Functor for the literals map
+ */
+class ANTLR_API CharScannerLiteralsLess : public ANTLR_USE_NAMESPACE(std)binary_function<ANTLR_USE_NAMESPACE(std)string,ANTLR_USE_NAMESPACE(std)string,bool> {
+private:
+ const CharScanner* scanner;
+public:
+#ifdef NO_TEMPLATE_PARTS
+ CharScannerLiteralsLess() {} // not really used, definition to appease MSVC
+#endif
+ CharScannerLiteralsLess(const CharScanner* theScanner)
+ : scanner(theScanner)
+ {
+ }
+ bool operator() (const ANTLR_USE_NAMESPACE(std)string& x,const ANTLR_USE_NAMESPACE(std)string& y) const;
+// defaults are good enough..
+ // CharScannerLiteralsLess(const CharScannerLiteralsLess&);
+ // CharScannerLiteralsLess& operator=(const CharScannerLiteralsLess&);
+};
+
+/** Superclass of generated lexers
+ */
+class ANTLR_API CharScanner : public TokenStream {
+protected:
+ typedef RefToken (*factory_type)();
+public:
+ CharScanner(InputBuffer& cb, bool case_sensitive );
+ CharScanner(InputBuffer* cb, bool case_sensitive );
+ CharScanner(const LexerSharedInputState& state, bool case_sensitive );
+
+ virtual ~CharScanner()
+ {
+ }
+
+ virtual int LA(unsigned int i);
+
+ virtual void append(char c)
+ {
+ if (saveConsumedInput)
+ {
+ size_t l = text.length();
+
+ if ((l%256) == 0)
+ text.reserve(l+256);
+
+ text.replace(l,0,&c,1);
+ }
+ }
+
+ virtual void append(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ if( saveConsumedInput )
+ text += s;
+ }
+
+ virtual void commit()
+ {
+ inputState->getInput().commit();
+ }
+
+ /** called by the generated lexer to do error recovery, override to
+ * customize the behaviour.
+ */
+ virtual void recover(const RecognitionException& ex, const BitSet& tokenSet)
+ {
+ consume();
+ consumeUntil(tokenSet);
+ }
+
+ virtual void consume()
+ {
+ if (inputState->guessing == 0)
+ {
+ int c = LA(1);
+ if (caseSensitive)
+ {
+ append(c);
+ }
+ else
+ {
+ // use input.LA(), not LA(), to get original case
+ // CharScanner.LA() would toLower it.
+ append(inputState->getInput().LA(1));
+ }
+
+ // RK: in a sense I don't like this automatic handling.
+ if (c == '\t')
+ tab();
+ else
+ inputState->column++;
+ }
+ inputState->getInput().consume();
+ }
+
+ /** Consume chars until one matches the given char */
+ virtual void consumeUntil(int c)
+ {
+ for(;;)
+ {
+ int la_1 = LA(1);
+ if( la_1 == EOF_CHAR || la_1 == c )
+ break;
+ consume();
+ }
+ }
+
+ /** Consume chars until one matches the given set */
+ virtual void consumeUntil(const BitSet& set)
+ {
+ for(;;)
+ {
+ int la_1 = LA(1);
+ if( la_1 == EOF_CHAR || set.member(la_1) )
+ break;
+ consume();
+ }
+ }
+
+ /// Mark the current position and return a id for it
+ virtual unsigned int mark()
+ {
+ return inputState->getInput().mark();
+ }
+ /// Rewind the scanner to a previously marked position
+ virtual void rewind(unsigned int pos)
+ {
+ inputState->getInput().rewind(pos);
+ }
+
+ /// See if input contains character 'c' throw MismatchedCharException if not
+ virtual void match(int c)
+ {
+ int la_1 = LA(1);
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+ consume();
+ }
+
+ /** See if input contains element from bitset b
+ * throw MismatchedCharException if not
+ */
+ virtual void match(const BitSet& b)
+ {
+ int la_1 = LA(1);
+
+ if ( !b.member(la_1) )
+ throw MismatchedCharException( la_1, b, false, this );
+ consume();
+ }
+
+ /** See if input contains string 's' throw MismatchedCharException if not
+ * @note the string cannot match EOF
+ */
+ virtual void match( const char* s )
+ {
+ while( *s != '\0' )
+ {
+ // the & 0xFF is here to prevent sign extension lateron
+ int la_1 = LA(1), c = (*s++ & 0xFF);
+
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+
+ consume();
+ }
+ }
+ /** See if input contains string 's' throw MismatchedCharException if not
+ * @note the string cannot match EOF
+ */
+ virtual void match(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ size_t len = s.length();
+
+ for (size_t i = 0; i < len; i++)
+ {
+ // the & 0xFF is here to prevent sign extension lateron
+ int la_1 = LA(1), c = (s[i] & 0xFF);
+
+ if ( la_1 != c )
+ throw MismatchedCharException(la_1, c, false, this);
+
+ consume();
+ }
+ }
+ /** See if input does not contain character 'c'
+ * throw MismatchedCharException if not
+ */
+ virtual void matchNot(int c)
+ {
+ int la_1 = LA(1);
+
+ if ( la_1 == c )
+ throw MismatchedCharException(la_1, c, true, this);
+
+ consume();
+ }
+ /** See if input contains character in range c1-c2
+ * throw MismatchedCharException if not
+ */
+ virtual void matchRange(int c1, int c2)
+ {
+ int la_1 = LA(1);
+
+ if ( la_1 < c1 || la_1 > c2 )
+ throw MismatchedCharException(la_1, c1, c2, false, this);
+
+ consume();
+ }
+
+ virtual bool getCaseSensitive() const
+ {
+ return caseSensitive;
+ }
+
+ virtual void setCaseSensitive(bool t)
+ {
+ caseSensitive = t;
+ }
+
+ virtual bool getCaseSensitiveLiterals() const=0;
+
+ /// Get the line the scanner currently is in (starts at 1)
+ virtual int getLine() const
+ {
+ return inputState->line;
+ }
+
+ /// set the line number
+ virtual void setLine(int l)
+ {
+ inputState->line = l;
+ }
+
+ /// Get the column the scanner currently is in (starts at 1)
+ virtual int getColumn() const
+ {
+ return inputState->column;
+ }
+ /// set the column number
+ virtual void setColumn(int c)
+ {
+ inputState->column = c;
+ }
+
+ /// get the filename for the file currently used
+ virtual const ANTLR_USE_NAMESPACE(std)string& getFilename() const
+ {
+ return inputState->filename;
+ }
+ /// Set the filename the scanner is using (used in error messages)
+ virtual void setFilename(const ANTLR_USE_NAMESPACE(std)string& f)
+ {
+ inputState->filename = f;
+ }
+
+ virtual bool getCommitToPath() const
+ {
+ return commitToPath;
+ }
+
+ virtual void setCommitToPath(bool commit)
+ {
+ commitToPath = commit;
+ }
+
+ /** return a copy of the current text buffer */
+ virtual const ANTLR_USE_NAMESPACE(std)string& getText() const
+ {
+ return text;
+ }
+
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ text = s;
+ }
+
+ virtual void resetText()
+ {
+ text = "";
+ inputState->tokenStartColumn = inputState->column;
+ inputState->tokenStartLine = inputState->line;
+ }
+
+ virtual RefToken getTokenObject() const
+ {
+ return _returnToken;
+ }
+
+ /** Used to keep track of line breaks, needs to be called from
+ * within generated lexers when a \n \r is encountered.
+ */
+ virtual void newline()
+ {
+ ++inputState->line;
+ inputState->column = 1;
+ }
+
+ /** Advance the current column number by an appropriate amount according
+ * to the tabsize. This method needs to be explicitly called from the
+ * lexer rules encountering tabs.
+ */
+ virtual void tab()
+ {
+ int c = getColumn();
+ int nc = ( ((c-1)/tabsize) + 1) * tabsize + 1; // calculate tab stop
+ setColumn( nc );
+ }
+ /// set the tabsize. Returns the old tabsize
+ int setTabsize( int size )
+ {
+ int oldsize = tabsize;
+ tabsize = size;
+ return oldsize;
+ }
+ /// Return the tabsize used by the scanner
+ int getTabSize() const
+ {
+ return tabsize;
+ }
+
+ /** Report exception errors caught in nextToken() */
+ virtual void reportError(const RecognitionException& e);
+
+ /** Parser error-reporting function can be overridden in subclass */
+ virtual void reportError(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ /** Parser warning-reporting function can be overridden in subclass */
+ virtual void reportWarning(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ virtual InputBuffer& getInputBuffer()
+ {
+ return inputState->getInput();
+ }
+
+ virtual LexerSharedInputState getInputState()
+ {
+ return inputState;
+ }
+
+ /** set the input state for the lexer.
+ * @note state is a reference counted object, hence no reference */
+ virtual void setInputState(LexerSharedInputState state)
+ {
+ inputState = state;
+ }
+
+ /// Set the factory for created tokens
+ virtual void setTokenObjectFactory(factory_type factory)
+ {
+ tokenFactory = factory;
+ }
+
+ /** Test the token text against the literals table
+ * Override this method to perform a different literals test
+ */
+ virtual int testLiteralsTable(int ttype) const
+ {
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess>::const_iterator i = literals.find(text);
+ if (i != literals.end())
+ ttype = (*i).second;
+ return ttype;
+ }
+
+ /** Test the text passed in against the literals table
+ * Override this method to perform a different literals test
+ * This is used primarily when you want to test a portion of
+ * a token
+ */
+ virtual int testLiteralsTable(const ANTLR_USE_NAMESPACE(std)string& txt,int ttype) const
+ {
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess>::const_iterator i = literals.find(txt);
+ if (i != literals.end())
+ ttype = (*i).second;
+ return ttype;
+ }
+
+ /// Override this method to get more specific case handling
+ virtual int toLower(int c) const
+ {
+ // test on EOF_CHAR for buggy (?) STLPort tolower (or HPUX tolower?)
+ // also VC++ 6.0 does this. (see fix 422 (is reverted by this fix)
+ // this one is more structural. Maybe make this configurable.
+ return (c == EOF_CHAR ? EOF_CHAR : tolower(c));
+ }
+
+ /** This method is called by YourLexer::nextToken() when the lexer has
+ * hit EOF condition. EOF is NOT a character.
+ * This method is not called if EOF is reached during
+ * syntactic predicate evaluation or during evaluation
+ * of normal lexical rules, which presumably would be
+ * an IOException. This traps the "normal" EOF condition.
+ *
+ * uponEOF() is called after the complete evaluation of
+ * the previous token and only if your parser asks
+ * for another token beyond that last non-EOF token.
+ *
+ * You might want to throw token or char stream exceptions
+ * like: "Heh, premature eof" or a retry stream exception
+ * ("I found the end of this file, go back to referencing file").
+ */
+ virtual void uponEOF()
+ {
+ }
+
+ /// Methods used to change tracing behavior
+ virtual void traceIndent();
+ virtual void traceIn(const char* rname);
+ virtual void traceOut(const char* rname);
+
+#ifndef NO_STATIC_CONSTS
+ static const int EOF_CHAR = EOF;
+#else
+ enum {
+ EOF_CHAR = EOF
+ };
+#endif
+protected:
+ ANTLR_USE_NAMESPACE(std)string text; ///< Text of current token
+ /// flag indicating wether consume saves characters
+ bool saveConsumedInput;
+ factory_type tokenFactory; ///< Factory for tokens
+ bool caseSensitive; ///< Is this lexer case sensitive
+ ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,int,CharScannerLiteralsLess> literals; // set by subclass
+
+ RefToken _returnToken; ///< used to return tokens w/o using return val
+
+ /// Input state, gives access to input stream, shared among different lexers
+ LexerSharedInputState inputState;
+
+ /** Used during filter mode to indicate that path is desired.
+ * A subsequent scan error will report an error as usual
+ * if acceptPath=true;
+ */
+ bool commitToPath;
+
+ int tabsize; ///< tab size the scanner uses.
+
+ /// Create a new RefToken of type t
+ virtual RefToken makeToken(int t)
+ {
+ RefToken tok = tokenFactory();
+ tok->setType(t);
+ tok->setColumn(inputState->tokenStartColumn);
+ tok->setLine(inputState->tokenStartLine);
+ return tok;
+ }
+
+ /** Tracer class, used when -traceLexer is passed to antlr
+ */
+ class Tracer {
+ private:
+ CharScanner* parser;
+ const char* text;
+
+ Tracer(const Tracer& other); // undefined
+ Tracer& operator=(const Tracer& other); // undefined
+ public:
+ Tracer( CharScanner* p,const char* t )
+ : parser(p), text(t)
+ {
+ parser->traceIn(text);
+ }
+ ~Tracer()
+ {
+ parser->traceOut(text);
+ }
+ };
+
+ int traceDepth;
+private:
+ CharScanner( const CharScanner& other ); // undefined
+ CharScanner& operator=( const CharScanner& other ); // undefined
+
+#ifndef NO_STATIC_CONSTS
+ static const int NO_CHAR = 0;
+#else
+ enum {
+ NO_CHAR = 0
+ };
+#endif
+};
+
+inline int CharScanner::LA(unsigned int i)
+{
+ int c = inputState->getInput().LA(i);
+
+ if ( caseSensitive )
+ return c;
+ else
+ return toLower(c); // VC 6 tolower bug caught in toLower.
+}
+
+inline bool CharScannerLiteralsLess::operator() (const ANTLR_USE_NAMESPACE(std)string& x,const ANTLR_USE_NAMESPACE(std)string& y) const
+{
+ if (scanner->getCaseSensitiveLiterals())
+ return ANTLR_USE_NAMESPACE(std)less<ANTLR_USE_NAMESPACE(std)string>()(x,y);
+ else
+ {
+#ifdef NO_STRCASECMP
+ return (stricmp(x.c_str(),y.c_str())<0);
+#else
+ return (strcasecmp(x.c_str(),y.c_str())<0);
+#endif
+ }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CharScanner_hpp__
diff --git a/lib/antlr/antlr/CharStreamException.hpp b/lib/antlr/antlr/CharStreamException.hpp
new file mode 100644
index 00000000..a49e3bbb
--- /dev/null
+++ b/lib/antlr/antlr/CharStreamException.hpp
@@ -0,0 +1,29 @@
+#ifndef INC_CharStreamException_hpp__
+#define INC_CharStreamException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/ANTLRException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CharStreamException : public ANTLRException {
+public:
+ CharStreamException(const ANTLR_USE_NAMESPACE(std)string& s)
+ : ANTLRException(s) {}
+ ~CharStreamException() throw() {}
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CharStreamException_hpp__
diff --git a/lib/antlr/antlr/CharStreamIOException.hpp b/lib/antlr/antlr/CharStreamIOException.hpp
new file mode 100644
index 00000000..e3e3111e
--- /dev/null
+++ b/lib/antlr/antlr/CharStreamIOException.hpp
@@ -0,0 +1,31 @@
+#ifndef INC_CharStreamIOException_hpp__
+#define INC_CharStreamIOException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/CharStreamException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CharStreamIOException : public CharStreamException {
+public:
+ ANTLR_USE_NAMESPACE(std)exception io;
+
+ CharStreamIOException(ANTLR_USE_NAMESPACE(std)exception& e)
+ : CharStreamException(e.what()), io(e) {}
+ ~CharStreamIOException() throw() {}
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CharStreamIOException_hpp__
diff --git a/lib/antlr/antlr/CircularQueue.hpp b/lib/antlr/antlr/CircularQueue.hpp
new file mode 100644
index 00000000..506b4f56
--- /dev/null
+++ b/lib/antlr/antlr/CircularQueue.hpp
@@ -0,0 +1,100 @@
+#ifndef INC_CircularQueue_hpp__
+#define INC_CircularQueue_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/Token.hpp>
+#include <vector>
+#include <cassert>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+// Resize every 5000 items
+#define OFFSET_MAX_RESIZE 5000
+
+template <class T>
+class ANTLR_API CircularQueue {
+public:
+ CircularQueue()
+ : storage()
+ , m_offset(0)
+ {
+ }
+ ~CircularQueue()
+ {
+ }
+
+ /// Clear the queue
+ inline void clear( void )
+ {
+ m_offset = 0;
+ storage.clear();
+ }
+
+ /// @todo this should use at or should have a check
+ inline T elementAt( size_t idx ) const
+ {
+ return storage[idx+m_offset];
+ }
+ void removeFirst()
+ {
+ if (m_offset >= OFFSET_MAX_RESIZE)
+ {
+ storage.erase( storage.begin(), storage.begin() + m_offset + 1 );
+ m_offset = 0;
+ }
+ else
+ ++m_offset;
+ }
+ inline void removeItems( size_t nb )
+ {
+ // it would be nice if we would not get called with nb > entries
+ // (or to be precise when entries() == 0)
+ // This case is possible when lexer/parser::recover() calls
+ // consume+consumeUntil when the queue is empty.
+ // In recover the consume says to prepare to read another
+ // character/token. Then in the subsequent consumeUntil the
+ // LA() call will trigger
+ // syncConsume which calls this method *before* the same queue
+ // has been sufficiently filled.
+ if( nb > entries() )
+ nb = entries();
+
+ if (m_offset >= OFFSET_MAX_RESIZE)
+ {
+ storage.erase( storage.begin(), storage.begin() + m_offset + nb );
+ m_offset = 0;
+ }
+ else
+ m_offset += nb;
+ }
+ inline void append(const T& t)
+ {
+ storage.push_back(t);
+ }
+ inline size_t entries() const
+ {
+ return storage.size() - m_offset;
+ }
+
+private:
+ ANTLR_USE_NAMESPACE(std)vector<T> storage;
+ size_t m_offset;
+
+ CircularQueue(const CircularQueue&);
+ const CircularQueue& operator=(const CircularQueue&);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CircularQueue_hpp__
diff --git a/lib/antlr/antlr/CommonAST.hpp b/lib/antlr/antlr/CommonAST.hpp
new file mode 100644
index 00000000..091d7b6e
--- /dev/null
+++ b/lib/antlr/antlr/CommonAST.hpp
@@ -0,0 +1,110 @@
+#ifndef INC_CommonAST_hpp__
+#define INC_CommonAST_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/BaseAST.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CommonAST : public BaseAST {
+public:
+ CommonAST()
+ : BaseAST()
+ , ttype( Token::INVALID_TYPE )
+ , text()
+ {
+ }
+
+ CommonAST( RefToken t )
+ : BaseAST()
+ , ttype( t->getType() )
+ , text( t->getText() )
+ {
+ }
+
+ CommonAST( const CommonAST& other )
+ : BaseAST(other)
+ , ttype(other.ttype)
+ , text(other.text)
+ {
+ }
+
+ virtual ~CommonAST()
+ {
+ }
+
+ virtual const char* typeName( void ) const
+ {
+ return CommonAST::TYPE_NAME;
+ }
+
+ /// Clone this AST node.
+ virtual RefAST clone( void ) const
+ {
+ CommonAST *ast = new CommonAST( *this );
+ return RefAST(ast);
+ }
+
+ virtual ANTLR_USE_NAMESPACE(std)string getText() const
+ {
+ return text;
+ }
+ virtual int getType() const
+ {
+ return ttype;
+ }
+
+ virtual void initialize( int t, const ANTLR_USE_NAMESPACE(std)string& txt )
+ {
+ setType(t);
+ setText(txt);
+ }
+
+ virtual void initialize( RefAST t )
+ {
+ setType(t->getType());
+ setText(t->getText());
+ }
+ virtual void initialize( RefToken t )
+ {
+ setType(t->getType());
+ setText(t->getText());
+ }
+
+#ifdef ANTLR_SUPPORT_XML
+ virtual void initialize( ANTLR_USE_NAMESPACE(std)istream& in );
+#endif
+
+ virtual void setText( const ANTLR_USE_NAMESPACE(std)string& txt )
+ {
+ text = txt;
+ }
+ virtual void setType( int type )
+ {
+ ttype = type;
+ }
+
+ static RefAST factory();
+
+ static const char* const TYPE_NAME;
+protected:
+ int ttype;
+ ANTLR_USE_NAMESPACE(std)string text;
+};
+
+typedef ASTRefCount<CommonAST> RefCommonAST;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonAST_hpp__
diff --git a/lib/antlr/antlr/CommonASTWithHiddenTokens.hpp b/lib/antlr/antlr/CommonASTWithHiddenTokens.hpp
new file mode 100644
index 00000000..cac7c83e
--- /dev/null
+++ b/lib/antlr/antlr/CommonASTWithHiddenTokens.hpp
@@ -0,0 +1,60 @@
+#ifndef INC_CommonASTWithHiddenTokens_hpp__
+#define INC_CommonASTWithHiddenTokens_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/CommonAST.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A CommonAST whose initialization copies hidden token
+ * information from the Token used to create a node.
+ */
+class ANTLR_API CommonASTWithHiddenTokens : public CommonAST {
+public:
+ CommonASTWithHiddenTokens();
+ virtual ~CommonASTWithHiddenTokens();
+ virtual const char* typeName( void ) const
+ {
+ return CommonASTWithHiddenTokens::TYPE_NAME;
+ }
+ /// Clone this AST node.
+ virtual RefAST clone( void ) const;
+
+ // Borland C++ builder seems to need the decl's of the first two...
+ virtual void initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt);
+ virtual void initialize(RefAST t);
+ virtual void initialize(RefToken t);
+
+ virtual RefToken getHiddenAfter() const
+ {
+ return hiddenAfter;
+ }
+
+ virtual RefToken getHiddenBefore() const
+ {
+ return hiddenBefore;
+ }
+
+ static RefAST factory();
+
+ static const char* const TYPE_NAME;
+protected:
+ RefToken hiddenBefore,hiddenAfter; // references to hidden tokens
+};
+
+typedef ASTRefCount<CommonASTWithHiddenTokens> RefCommonASTWithHiddenTokens;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonASTWithHiddenTokens_hpp__
diff --git a/lib/antlr/antlr/CommonHiddenStreamToken.hpp b/lib/antlr/antlr/CommonHiddenStreamToken.hpp
new file mode 100644
index 00000000..f3b78c44
--- /dev/null
+++ b/lib/antlr/antlr/CommonHiddenStreamToken.hpp
@@ -0,0 +1,41 @@
+#ifndef INC_CommonHiddenStreamToken_hpp__
+#define INC_CommonHiddenStreamToken_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/CommonToken.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CommonHiddenStreamToken : public CommonToken {
+protected:
+ RefToken hiddenBefore;
+ RefToken hiddenAfter;
+
+public:
+ CommonHiddenStreamToken();
+ CommonHiddenStreamToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt);
+ CommonHiddenStreamToken(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ RefToken getHiddenAfter();
+ RefToken getHiddenBefore();
+
+ static RefToken factory();
+
+ void setHiddenAfter(RefToken t);
+ void setHiddenBefore(RefToken t);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonHiddenStreamToken_hpp__
diff --git a/lib/antlr/antlr/CommonToken.hpp b/lib/antlr/antlr/CommonToken.hpp
new file mode 100644
index 00000000..51d17b42
--- /dev/null
+++ b/lib/antlr/antlr/CommonToken.hpp
@@ -0,0 +1,83 @@
+#ifndef INC_CommonToken_hpp__
+#define INC_CommonToken_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/Token.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API CommonToken : public Token {
+public:
+ CommonToken();
+ CommonToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt);
+ CommonToken(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ /// return contents of token
+ virtual ANTLR_USE_NAMESPACE(std)string getText() const
+ {
+ return text;
+ }
+
+ /// set contents of token
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& s)
+ {
+ text = s;
+ }
+
+ /** get the line the token is at (starting at 1)
+ * @see CharScanner::newline()
+ * @see CharScanner::tab()
+ */
+ virtual int getLine() const
+ {
+ return line;
+ }
+ /** gt the column the token is at (starting at 1)
+ * @see CharScanner::newline()
+ * @see CharScanner::tab()
+ */
+ virtual int getColumn() const
+ {
+ return col;
+ }
+
+ /// set line for token
+ virtual void setLine(int l)
+ {
+ line = l;
+ }
+ /// set column for token
+ virtual void setColumn(int c)
+ {
+ col = c;
+ }
+
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const;
+ static RefToken factory();
+
+protected:
+ // most tokens will want line and text information
+ int line;
+ int col;
+ ANTLR_USE_NAMESPACE(std)string text;
+
+private:
+ CommonToken(const CommonToken&);
+ const CommonToken& operator=(const CommonToken&);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonToken_hpp__
diff --git a/lib/antlr/antlr/IOException.hpp b/lib/antlr/antlr/IOException.hpp
new file mode 100644
index 00000000..22566ecc
--- /dev/null
+++ b/lib/antlr/antlr/IOException.hpp
@@ -0,0 +1,45 @@
+#ifndef INC_IOException_hpp__
+#define INC_IOException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/ANTLRException.hpp>
+#include <exception>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Generic IOException used inside support code. (thrown by XML I/O routs)
+ * basically this is something I'm using since a lot of compilers don't
+ * support ios_base::failure.
+ */
+class ANTLR_API IOException : public ANTLRException
+{
+public:
+ ANTLR_USE_NAMESPACE(std)exception io;
+
+ IOException( ANTLR_USE_NAMESPACE(std)exception& e )
+ : ANTLRException(e.what())
+ {
+ }
+ IOException( const ANTLR_USE_NAMESPACE(std)string& mesg )
+ : ANTLRException(mesg)
+ {
+ }
+ virtual ~IOException() throw()
+ {
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_IOException_hpp__
diff --git a/lib/antlr/antlr/InputBuffer.hpp b/lib/antlr/antlr/InputBuffer.hpp
new file mode 100644
index 00000000..b979ef8c
--- /dev/null
+++ b/lib/antlr/antlr/InputBuffer.hpp
@@ -0,0 +1,146 @@
+#ifndef INC_InputBuffer_hpp__
+#define INC_InputBuffer_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/CircularQueue.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A Stream of characters fed to the lexer from a InputStream that can
+ * be rewound via mark()/rewind() methods.
+ * <p>
+ * A dynamic array is used to buffer up all the input characters. Normally,
+ * "k" characters are stored in the buffer. More characters may be stored during
+ * guess mode (testing syntactic predicate), or when LT(i>k) is referenced.
+ * Consumption of characters is deferred. In other words, reading the next
+ * character is not done by conume(), but deferred until needed by LA or LT.
+ * <p>
+ *
+ * @see antlr.CharQueue
+ */
+class ANTLR_API InputBuffer {
+public:
+ /** Create a character buffer */
+ InputBuffer()
+ : nMarkers(0)
+ , markerOffset(0)
+ , numToConsume(0)
+ {
+ }
+
+ virtual ~InputBuffer()
+ {
+ }
+
+ /// Reset the input buffer to empty state
+ virtual inline void reset( void )
+ {
+ nMarkers = 0;
+ markerOffset = 0;
+ numToConsume = 0;
+ queue.clear();
+ }
+
+ /** This method updates the state of the input buffer so that
+ * the text matched since the most recent mark() is no longer
+ * held by the buffer. So, you either do a mark/rewind for
+ * failed predicate or mark/commit to keep on parsing without
+ * rewinding the input.
+ */
+ inline void commit( void )
+ {
+ nMarkers--;
+ }
+
+ /** Mark another character for deferred consumption */
+ virtual inline void consume()
+ {
+ numToConsume++;
+ }
+
+ /** Ensure that the character buffer is sufficiently full */
+ virtual void fill(unsigned int amount);
+
+ /** Override this in subclasses to get the next character */
+ virtual int getChar()=0;
+
+ /** Get a lookahead character */
+ virtual inline int LA(unsigned int i)
+ {
+ fill(i);
+ return queue.elementAt(markerOffset + i - 1);
+ }
+
+ /** Return an integer marker that can be used to rewind the buffer to
+ * its current state.
+ */
+ virtual unsigned int mark();
+ /// Are there any marks active in the InputBuffer
+ virtual inline bool isMarked() const
+ {
+ return (nMarkers != 0);
+ }
+ /** Rewind the character buffer to a marker.
+ * @param mark Marker returned previously from mark()
+ */
+ virtual void rewind(unsigned int mark);
+
+ /** Get the number of non-consumed characters
+ */
+ virtual unsigned int entries() const;
+
+ ANTLR_USE_NAMESPACE(std)string getLAChars() const;
+
+ ANTLR_USE_NAMESPACE(std)string getMarkedChars() const;
+
+protected:
+ // char source
+ // leave to subclasses
+
+ // Number of active markers
+ unsigned int nMarkers; // = 0;
+
+ // Additional offset used when markers are active
+ unsigned int markerOffset; // = 0;
+
+ // Number of calls to consume() since last LA() or LT() call
+ unsigned int numToConsume; // = 0;
+
+ // Circular queue
+ CircularQueue<int> queue;
+
+ /** Sync up deferred consumption */
+ void syncConsume();
+
+private:
+ InputBuffer(const InputBuffer& other);
+ InputBuffer& operator=(const InputBuffer& other);
+};
+
+/** Sync up deferred consumption */
+inline void InputBuffer::syncConsume() {
+ if (numToConsume > 0)
+ {
+ if (nMarkers > 0)
+ markerOffset += numToConsume;
+ else
+ queue.removeItems( numToConsume );
+ numToConsume = 0;
+ }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_InputBuffer_hpp__
diff --git a/lib/antlr/antlr/LLkParser.hpp b/lib/antlr/antlr/LLkParser.hpp
new file mode 100644
index 00000000..32acd3dd
--- /dev/null
+++ b/lib/antlr/antlr/LLkParser.hpp
@@ -0,0 +1,67 @@
+#ifndef INC_LLkParser_hpp__
+#define INC_LLkParser_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/Parser.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**An LL(k) parser.
+ *
+ * @see antlr.Token
+ * @see antlr.TokenBuffer
+ * @see antlr.LL1Parser
+ */
+class ANTLR_API LLkParser : public Parser {
+public:
+ LLkParser(const ParserSharedInputState& lexer, int k_);
+
+ LLkParser(TokenBuffer& tokenBuf, int k_);
+
+ LLkParser(TokenStream& lexer, int k_);
+
+ /** Consume another token from the input stream. Can only write sequentially!
+ * If you need 3 tokens ahead, you must consume() 3 times.
+ * <p>
+ * Note that it is possible to overwrite tokens that have not been matched.
+ * For example, calling consume() 3 times when k=2, means that the first token
+ * consumed will be overwritten with the 3rd.
+ */
+ virtual inline void consume()
+ {
+ inputState->getInput().consume();
+ }
+
+ virtual inline int LA(unsigned int i)
+ {
+ return inputState->getInput().LA(i);
+ }
+
+ virtual inline RefToken LT(unsigned int i)
+ {
+ return inputState->getInput().LT(i);
+ }
+protected:
+ /// the lookahead this LL(k) parser is using.
+ int k;
+private:
+ void trace(const char* ee, const char* rname);
+public:
+ virtual void traceIn(const char* rname);
+ virtual void traceOut(const char* rname);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_LLkParser_hpp__
diff --git a/lib/antlr/antlr/LexerSharedInputState.hpp b/lib/antlr/antlr/LexerSharedInputState.hpp
new file mode 100644
index 00000000..2571bda3
--- /dev/null
+++ b/lib/antlr/antlr/LexerSharedInputState.hpp
@@ -0,0 +1,156 @@
+#ifndef INC_LexerSharedInputState_hpp__
+#define INC_LexerSharedInputState_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/InputBuffer.hpp>
+#include <antlr/RefCount.hpp>
+#include <antlr/CharBuffer.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This object contains the data associated with an
+ * input stream of characters. Multiple lexers
+ * share a single LexerSharedInputState to lex
+ * the same input stream.
+ */
+class ANTLR_API LexerInputState {
+public:
+ /** Construct a new LexerInputState
+ * @param inbuf the InputBuffer to read from. The object is deleted together
+ * with the LexerInputState object.
+ */
+ LexerInputState(InputBuffer* inbuf)
+ : column(1)
+ , line(1)
+ , tokenStartColumn(1)
+ , tokenStartLine(1)
+ , guessing(0)
+ , filename("")
+ , input(inbuf)
+ , inputResponsible(true)
+ {
+ }
+
+ /** Construct a new LexerInputState
+ * @param inbuf the InputBuffer to read from.
+ */
+ LexerInputState(InputBuffer& inbuf)
+ : column(1)
+ , line(1)
+ , tokenStartColumn(1)
+ , tokenStartLine(1)
+ , guessing(0)
+ , filename("")
+ , input(&inbuf)
+ , inputResponsible(false)
+ {
+ }
+
+ /** Construct a new LexerInputState
+ * @param in an istream to read from.
+ * @see antlr.CharBuffer
+ */
+ LexerInputState(ANTLR_USE_NAMESPACE(std)istream& in)
+ : column(1)
+ , line(1)
+ , tokenStartColumn(1)
+ , tokenStartLine(1)
+ , guessing(0)
+ , filename("")
+ , input(new CharBuffer(in))
+ , inputResponsible(true)
+ {
+ }
+
+ /** Reset the LexerInputState with a specified stream and filename.
+ * This method is a hack, dunno what I was thinking when I added it.
+ * This should actually be done in a subclass.
+ * @deprecated
+ */
+ virtual void initialize( ANTLR_USE_NAMESPACE(std)istream& in, const char* file = "" )
+ {
+ column = 1;
+ line = 1;
+ tokenStartColumn = 1;
+ tokenStartLine = 1;
+ guessing = 0;
+ filename = file;
+
+ if( input && inputResponsible )
+ delete input;
+
+ input = new CharBuffer(in);
+ inputResponsible = true;
+ }
+
+ /** Reset the LexerInputState to initial state.
+ * The underlying InputBuffer is also reset.
+ */
+ virtual void reset( void )
+ {
+ column = 1;
+ line = 1;
+ tokenStartColumn = 1;
+ tokenStartLine = 1;
+ guessing = 0;
+ input->reset();
+ }
+
+ /** Set the file position of the SharedLexerInputState.
+ * @param line_ line number to be set
+ * @param column_ column number to be set
+ */
+ void setPosition( int line_, int column_ )
+ {
+ line = line_;
+ column = column_;
+ }
+
+ virtual ~LexerInputState()
+ {
+ if (inputResponsible)
+ delete input;
+ }
+
+ int column;
+ int line;
+ int tokenStartColumn;
+ int tokenStartLine;
+ int guessing;
+ /** What file (if known) caused the problem? */
+ ANTLR_USE_NAMESPACE(std)string filename;
+ InputBuffer& getInput();
+private:
+ /// Input buffer we use
+ InputBuffer* input;
+ /// Who is responsible for cleaning up the InputBuffer?
+ bool inputResponsible;
+
+ // we don't want these:
+ LexerInputState(const LexerInputState&);
+ LexerInputState& operator=(const LexerInputState&);
+};
+
+inline InputBuffer& LexerInputState::getInput()
+{
+ return *input;
+}
+
+/// A reference counted LexerInputState object
+typedef RefCount<LexerInputState> LexerSharedInputState;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_LexerSharedInputState_hpp__
diff --git a/lib/antlr/antlr/Makefile.am b/lib/antlr/antlr/Makefile.am
new file mode 100644
index 00000000..717c43c0
--- /dev/null
+++ b/lib/antlr/antlr/Makefile.am
@@ -0,0 +1,2 @@
+
+noinst_HEADERS = ANTLRException.hpp ANTLRUtil.hpp AST.hpp ASTArray.hpp ASTFactory.hpp ASTNULLType.hpp ASTPair.hpp ASTRefCount.hpp BaseAST.hpp BitSet.hpp CharBuffer.hpp CharInputBuffer.hpp CharScanner.hpp CharStreamException.hpp CharStreamIOException.hpp CircularQueue.hpp CommonAST.hpp CommonASTWithHiddenTokens.hpp CommonHiddenStreamToken.hpp CommonToken.hpp InputBuffer.hpp IOException.hpp LLkParser.hpp LexerSharedInputState.hpp MismatchedCharException.hpp MismatchedTokenException.hpp NoViableAltException.hpp NoViableAltForCharException.hpp Parser.hpp ParserSharedInputState.hpp RecognitionException.hpp RefCount.hpp SemanticException.hpp String.hpp Token.hpp TokenBuffer.hpp TokenStream.hpp TokenStreamBasicFilter.hpp TokenStreamException.hpp TokenStreamHiddenTokenFilter.hpp TokenStreamIOException.hpp TokenStreamRecognitionException.hpp TokenStreamRetryException.hpp TokenStreamSelector.hpp TreeParser.hpp TreeParserSharedInputState.hpp config.hpp
diff --git a/lib/antlr/antlr/MismatchedCharException.hpp b/lib/antlr/antlr/MismatchedCharException.hpp
new file mode 100644
index 00000000..cc77f9e4
--- /dev/null
+++ b/lib/antlr/antlr/MismatchedCharException.hpp
@@ -0,0 +1,102 @@
+#ifndef INC_MismatchedCharException_hpp__
+#define INC_MismatchedCharException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/BitSet.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class CharScanner;
+
+class ANTLR_API MismatchedCharException : public RecognitionException {
+public:
+ // Types of chars
+#ifndef NO_STATIC_CONSTS
+ static const int CHAR = 1;
+ static const int NOT_CHAR = 2;
+ static const int RANGE = 3;
+ static const int NOT_RANGE = 4;
+ static const int SET = 5;
+ static const int NOT_SET = 6;
+#else
+ enum {
+ CHAR = 1,
+ NOT_CHAR = 2,
+ RANGE = 3,
+ NOT_RANGE = 4,
+ SET = 5,
+ NOT_SET = 6
+ };
+#endif
+
+public:
+ // One of the above
+ int mismatchType;
+
+ // what was found on the input stream
+ int foundChar;
+
+ // For CHAR/NOT_CHAR and RANGE/NOT_RANGE
+ int expecting;
+
+ // For RANGE/NOT_RANGE (expecting is lower bound of range)
+ int upper;
+
+ // For SET/NOT_SET
+ BitSet set;
+
+protected:
+ // who knows...they may want to ask scanner questions
+ CharScanner* scanner;
+
+public:
+ MismatchedCharException();
+
+ // Expected range / not range
+ MismatchedCharException(
+ int c,
+ int lower,
+ int upper_,
+ bool matchNot,
+ CharScanner* scanner_
+ );
+
+ // Expected token / not token
+ MismatchedCharException(
+ int c,
+ int expecting_,
+ bool matchNot,
+ CharScanner* scanner_
+ );
+
+ // Expected BitSet / not BitSet
+ MismatchedCharException(
+ int c,
+ BitSet set_,
+ bool matchNot,
+ CharScanner* scanner_
+ );
+
+ ~MismatchedCharException() throw() {}
+
+ /**
+ * Returns a clean error message (no line number/column information)
+ */
+ ANTLR_USE_NAMESPACE(std)string getMessage() const;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_MismatchedCharException_hpp__
diff --git a/lib/antlr/antlr/MismatchedTokenException.hpp b/lib/antlr/antlr/MismatchedTokenException.hpp
new file mode 100644
index 00000000..47fb44e6
--- /dev/null
+++ b/lib/antlr/antlr/MismatchedTokenException.hpp
@@ -0,0 +1,144 @@
+#ifndef INC_MismatchedTokenException_hpp__
+#define INC_MismatchedTokenException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+#include <vector>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API MismatchedTokenException : public RecognitionException {
+public:
+ MismatchedTokenException();
+
+ /// Expected range / not range
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ int lower,
+ int upper_,
+ bool matchNot
+ );
+
+ // Expected token / not token
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ int expecting_,
+ bool matchNot
+ );
+
+ // Expected BitSet / not BitSet
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ BitSet set_,
+ bool matchNot
+ );
+
+ // Expected range / not range
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ int lower,
+ int upper_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+ );
+
+ // Expected token / not token
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ int expecting_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+ );
+
+ // Expected BitSet / not BitSet
+ MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ BitSet set_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+ );
+ ~MismatchedTokenException() throw() {}
+
+ /**
+ * Returns a clean error message (no line number/column information)
+ */
+ ANTLR_USE_NAMESPACE(std)string getMessage() const;
+
+public:
+ /// The token that was encountered
+ const RefToken token;
+ /// The offending AST node if tree walking
+ const RefAST node;
+ /// taken from node or token object
+ ANTLR_USE_NAMESPACE(std)string tokenText;
+
+ /// Types of tokens
+#ifndef NO_STATIC_CONSTS
+ static const int TOKEN = 1;
+ static const int NOT_TOKEN = 2;
+ static const int RANGE = 3;
+ static const int NOT_RANGE = 4;
+ static const int SET = 5;
+ static const int NOT_SET = 6;
+#else
+ enum {
+ TOKEN = 1,
+ NOT_TOKEN = 2,
+ RANGE = 3,
+ NOT_RANGE = 4,
+ SET = 5,
+ NOT_SET = 6
+ };
+#endif
+
+public:
+ /// One of the above
+ int mismatchType;
+
+ /// For TOKEN/NOT_TOKEN and RANGE/NOT_RANGE
+ int expecting;
+
+ /// For RANGE/NOT_RANGE (expecting is lower bound of range)
+ int upper;
+
+ /// For SET/NOT_SET
+ BitSet set;
+
+private:
+ /// Token names array for formatting
+ const char* const* tokenNames;
+ /// Max number of tokens in tokenNames
+ const int numTokens;
+ /// Return token name for tokenType
+ ANTLR_USE_NAMESPACE(std)string tokenName(int tokenType) const;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_MismatchedTokenException_hpp__
diff --git a/lib/antlr/antlr/NoViableAltException.hpp b/lib/antlr/antlr/NoViableAltException.hpp
new file mode 100644
index 00000000..22236c90
--- /dev/null
+++ b/lib/antlr/antlr/NoViableAltException.hpp
@@ -0,0 +1,40 @@
+#ifndef INC_NoViableAltException_hpp__
+#define INC_NoViableAltException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/Token.hpp>
+#include <antlr/AST.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API NoViableAltException : public RecognitionException {
+public:
+ const RefToken token;
+ const RefAST node; // handles parsing and treeparsing
+
+ NoViableAltException(RefAST t);
+ NoViableAltException(RefToken t,const ANTLR_USE_NAMESPACE(std)string& fileName_);
+
+ ~NoViableAltException() throw() {}
+
+ /**
+ * Returns a clean error message (no line number/column information)
+ */
+ ANTLR_USE_NAMESPACE(std)string getMessage() const;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_NoViableAltException_hpp__
diff --git a/lib/antlr/antlr/NoViableAltForCharException.hpp b/lib/antlr/antlr/NoViableAltForCharException.hpp
new file mode 100644
index 00000000..0b16a0ea
--- /dev/null
+++ b/lib/antlr/antlr/NoViableAltForCharException.hpp
@@ -0,0 +1,41 @@
+#ifndef INC_NoViableAltForCharException_hpp__
+# define INC_NoViableAltForCharException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+# include <antlr/config.hpp>
+# include <antlr/RecognitionException.hpp>
+# include <antlr/CharScanner.hpp>
+
+# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr
+{
+# endif
+
+class ANTLR_API NoViableAltForCharException : public RecognitionException
+{
+public:
+ NoViableAltForCharException(int c, CharScanner* scanner);
+ NoViableAltForCharException(int c, const ANTLR_USE_NAMESPACE(std)string& fileName_,
+ int line_, int column_);
+
+ virtual ~NoViableAltForCharException() throw()
+ {
+ }
+
+ /// Returns a clean error message (no line number/column information)
+ ANTLR_USE_NAMESPACE(std)string getMessage() const;
+protected:
+ int foundChar;
+};
+
+# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+# endif
+
+#endif //INC_NoViableAltForCharException_hpp__
diff --git a/lib/antlr/antlr/Parser.hpp b/lib/antlr/antlr/Parser.hpp
new file mode 100644
index 00000000..f74be2a8
--- /dev/null
+++ b/lib/antlr/antlr/Parser.hpp
@@ -0,0 +1,319 @@
+#ifndef INC_Parser_hpp__
+#define INC_Parser_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+
+#include <iostream>
+#include <exception>
+
+#include <antlr/BitSet.hpp>
+#include <antlr/TokenBuffer.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/ASTFactory.hpp>
+#include <antlr/ParserSharedInputState.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+extern bool DEBUG_PARSER;
+
+/** A generic ANTLR parser (LL(k) for k>=1) containing a bunch of
+ * utility routines useful at any lookahead depth. We distinguish between
+ * the LL(1) and LL(k) parsers because of efficiency. This may not be
+ * necessary in the near future.
+ *
+ * Each parser object contains the state of the parse including a lookahead
+ * cache (the form of which is determined by the subclass), whether or
+ * not the parser is in guess mode, where tokens come from, etc...
+ *
+ * <p>
+ * During <b>guess</b> mode, the current lookahead token(s) and token type(s)
+ * cache must be saved because the token stream may not have been informed
+ * to save the token (via <tt>mark</tt>) before the <tt>try</tt> block.
+ * Guessing is started by:
+ * <ol>
+ * <li>saving the lookahead cache.
+ * <li>marking the current position in the TokenBuffer.
+ * <li>increasing the guessing level.
+ * </ol>
+ *
+ * After guessing, the parser state is restored by:
+ * <ol>
+ * <li>restoring the lookahead cache.
+ * <li>rewinding the TokenBuffer.
+ * <li>decreasing the guessing level.
+ * </ol>
+ *
+ * @see antlr.Token
+ * @see antlr.TokenBuffer
+ * @see antlr.TokenStream
+ * @see antlr.LL1Parser
+ * @see antlr.LLkParser
+ *
+ * @todo add constructors with ASTFactory.
+ */
+class ANTLR_API Parser {
+protected:
+ Parser(TokenBuffer& input)
+ : inputState(new ParserInputState(input)), astFactory(0), traceDepth(0)
+ {
+ }
+ Parser(TokenBuffer* input)
+ : inputState(new ParserInputState(input)), astFactory(0), traceDepth(0)
+ {
+ }
+ Parser(const ParserSharedInputState& state)
+ : inputState(state), astFactory(0), traceDepth(0)
+ {
+ }
+public:
+ virtual ~Parser()
+ {
+ }
+
+ /** Return the token type of the ith token of lookahead where i=1
+ * is the current token being examined by the parser (i.e., it
+ * has not been matched yet).
+ */
+ virtual int LA(unsigned int i)=0;
+
+ /// Return the i-th token of lookahead
+ virtual RefToken LT(unsigned int i)=0;
+
+ /** DEPRECATED! Specify the factory to be used during tree building. (Compulsory)
+ * Setting the factory is nowadays compulsory.
+ * @see setASTFactory
+ */
+ virtual void setASTNodeFactory( ASTFactory *factory )
+ {
+ astFactory = factory;
+ }
+ /** Specify the factory to be used during tree building. (Compulsory)
+ * Setting the factory is nowadays compulsory.
+ */
+ virtual void setASTFactory( ASTFactory *factory )
+ {
+ astFactory = factory;
+ }
+ /** Return a pointer to the ASTFactory used.
+ * So you might use it in subsequent treewalkers or to reload AST's
+ * from disk.
+ */
+ virtual ASTFactory* getASTFactory()
+ {
+ return astFactory;
+ }
+ /** Get the root AST node of the generated AST. When using a custom AST type
+ * or heterogenous AST's, you'll have to convert it to the right type
+ * yourself.
+ */
+ virtual RefAST getAST() = 0;
+
+ /// Return the filename of the input file.
+ virtual inline ANTLR_USE_NAMESPACE(std)string getFilename() const
+ {
+ return inputState->filename;
+ }
+ /// Set the filename of the input file (used for error reporting).
+ virtual void setFilename(const ANTLR_USE_NAMESPACE(std)string& f)
+ {
+ inputState->filename = f;
+ }
+
+ virtual void setInputState(ParserSharedInputState state)
+ {
+ inputState = state;
+ }
+ virtual inline ParserSharedInputState getInputState() const
+ {
+ return inputState;
+ }
+
+ /// Get another token object from the token stream
+ virtual void consume()=0;
+ /// Consume tokens until one matches the given token
+ virtual void consumeUntil(int tokenType)
+ {
+ while (LA(1) != Token::EOF_TYPE && LA(1) != tokenType)
+ consume();
+ }
+
+ /// Consume tokens until one matches the given token set
+ virtual void consumeUntil(const BitSet& set)
+ {
+ while (LA(1) != Token::EOF_TYPE && !set.member(LA(1)))
+ consume();
+ }
+
+ /** Make sure current lookahead symbol matches token type <tt>t</tt>.
+ * Throw an exception upon mismatch, which is catch by either the
+ * error handler or by the syntactic predicate.
+ */
+ virtual void match(int t)
+ {
+ if ( DEBUG_PARSER )
+ {
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "enter match(" << t << ") with LA(1)=" << LA(1) << ANTLR_USE_NAMESPACE(std)endl;
+ }
+ if ( LA(1) != t )
+ {
+ if ( DEBUG_PARSER )
+ {
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "token mismatch: " << LA(1) << "!=" << t << ANTLR_USE_NAMESPACE(std)endl;
+ }
+ throw MismatchedTokenException(getTokenNames(), getNumTokens(), LT(1), t, false, getFilename());
+ }
+ else
+ {
+ // mark token as consumed -- fetch next token deferred until LA/LT
+ consume();
+ }
+ }
+
+ virtual void matchNot(int t)
+ {
+ if ( LA(1)==t )
+ {
+ // Throws inverted-sense exception
+ throw MismatchedTokenException(getTokenNames(), getNumTokens(), LT(1), t, true, getFilename());
+ }
+ else
+ {
+ // mark token as consumed -- fetch next token deferred until LA/LT
+ consume();
+ }
+ }
+
+ /** Make sure current lookahead symbol matches the given set
+ * Throw an exception upon mismatch, which is catch by either the
+ * error handler or by the syntactic predicate.
+ */
+ virtual void match(const BitSet& b)
+ {
+ if ( DEBUG_PARSER )
+ {
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "enter match(" << "bitset" /*b.toString()*/
+ << ") with LA(1)=" << LA(1) << ANTLR_USE_NAMESPACE(std)endl;
+ }
+ if ( !b.member(LA(1)) )
+ {
+ if ( DEBUG_PARSER )
+ {
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "token mismatch: " << LA(1) << " not member of "
+ << "bitset" /*b.toString()*/ << ANTLR_USE_NAMESPACE(std)endl;
+ }
+ throw MismatchedTokenException(getTokenNames(), getNumTokens(), LT(1), b, false, getFilename());
+ }
+ else
+ {
+ // mark token as consumed -- fetch next token deferred until LA/LT
+ consume();
+ }
+ }
+
+ /** Mark a spot in the input and return the position.
+ * Forwarded to TokenBuffer.
+ */
+ virtual inline unsigned int mark()
+ {
+ return inputState->getInput().mark();
+ }
+ /// rewind to a previously marked position
+ virtual inline void rewind(unsigned int pos)
+ {
+ inputState->getInput().rewind(pos);
+ }
+ /** called by the generated parser to do error recovery, override to
+ * customize the behaviour.
+ */
+ virtual void recover(const RecognitionException& ex, const BitSet& tokenSet)
+ {
+ consume();
+ consumeUntil(tokenSet);
+ }
+
+ /// Parser error-reporting function can be overridden in subclass
+ virtual void reportError(const RecognitionException& ex);
+ /// Parser error-reporting function can be overridden in subclass
+ virtual void reportError(const ANTLR_USE_NAMESPACE(std)string& s);
+ /// Parser warning-reporting function can be overridden in subclass
+ virtual void reportWarning(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ /// get the token name for the token number 'num'
+ virtual const char* getTokenName(int num) const = 0;
+ /// get a vector with all token names
+ virtual const char* const* getTokenNames() const = 0;
+ /** Get the number of tokens defined.
+ * This one should be overridden in subclasses.
+ */
+ virtual int getNumTokens(void) const = 0;
+
+ /** Set or change the input token buffer */
+// void setTokenBuffer(TokenBuffer<Token>* t);
+
+ virtual void traceIndent();
+ virtual void traceIn(const char* rname);
+ virtual void traceOut(const char* rname);
+protected:
+// void setTokenNames(const char** tokenNames_);
+
+ ParserSharedInputState inputState;
+
+// /// AST return value for a rule is squirreled away here
+// RefAST returnAST;
+
+ /// AST support code; parser and treeparser delegate to this object
+ ASTFactory *astFactory;
+
+ // used to keep track of the indentation for the trace
+ int traceDepth;
+
+ /** Utility class which allows tracing to work even when exceptions are
+ * thrown.
+ */
+ class Tracer { /*{{{*/
+ private:
+ Parser* parser;
+ const char* text;
+ public:
+ Tracer(Parser* p,const char * t)
+ : parser(p), text(t)
+ {
+ parser->traceIn(text);
+ }
+ ~Tracer()
+ {
+#ifdef ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
+ // Only give trace if there's no uncaught exception..
+ if(!ANTLR_USE_NAMESPACE(std)uncaught_exception())
+#endif
+ parser->traceOut(text);
+ }
+ private:
+ Tracer(const Tracer&); // undefined
+ const Tracer& operator=(const Tracer&); // undefined
+ /*}}}*/
+ };
+private:
+ Parser(const Parser&); // undefined
+ const Parser& operator=(const Parser&); // undefined
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_Parser_hpp__
diff --git a/lib/antlr/antlr/ParserSharedInputState.hpp b/lib/antlr/antlr/ParserSharedInputState.hpp
new file mode 100644
index 00000000..b011bc15
--- /dev/null
+++ b/lib/antlr/antlr/ParserSharedInputState.hpp
@@ -0,0 +1,92 @@
+#ifndef INC_ParserSharedInputState_hpp__
+#define INC_ParserSharedInputState_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenBuffer.hpp>
+#include <antlr/RefCount.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This object contains the data associated with an
+ * input stream of tokens. Multiple parsers
+ * share a single ParserSharedInputState to parse
+ * the same stream of tokens.
+ */
+class ANTLR_API ParserInputState {
+public:
+ /** Construct a new ParserInputState
+ * @param in the TokenBuffer to read from. The object is deleted together
+ * with the ParserInputState object.
+ */
+ ParserInputState( TokenBuffer* in )
+ : guessing(0)
+ , filename()
+ , input(in)
+ , inputResponsible(true)
+ {
+ }
+ /** Construct a new ParserInputState
+ * @param in the TokenBuffer to read from.
+ */
+ ParserInputState( TokenBuffer& in )
+ : guessing(0)
+ , filename("")
+ , input(&in)
+ , inputResponsible(false)
+ {
+ }
+
+ virtual ~ParserInputState()
+ {
+ if (inputResponsible)
+ delete input;
+ }
+
+ TokenBuffer& getInput( void )
+ {
+ return *input;
+ }
+
+ /// Reset the ParserInputState and the underlying TokenBuffer
+ void reset( void )
+ {
+ input->reset();
+ guessing = 0;
+ }
+
+public:
+ /** Are we guessing (guessing>0)? */
+ int guessing;
+ /** What file (if known) caused the problem?
+ * @todo wrap this one..
+ */
+ ANTLR_USE_NAMESPACE(std)string filename;
+private:
+ /** Where to get token objects */
+ TokenBuffer* input;
+ /// Do we need to free the TokenBuffer or is it owned by another..
+ bool inputResponsible;
+
+ // we don't want these:
+ ParserInputState(const ParserInputState&);
+ ParserInputState& operator=(const ParserInputState&);
+};
+
+/// A reference counted ParserInputState
+typedef RefCount<ParserInputState> ParserSharedInputState;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_ParserSharedInputState_hpp__
diff --git a/lib/antlr/antlr/RecognitionException.hpp b/lib/antlr/antlr/RecognitionException.hpp
new file mode 100644
index 00000000..e61bc620
--- /dev/null
+++ b/lib/antlr/antlr/RecognitionException.hpp
@@ -0,0 +1,66 @@
+#ifndef INC_RecognitionException_hpp__
+# define INC_RecognitionException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+# include <antlr/config.hpp>
+# include <antlr/ANTLRException.hpp>
+
+# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr
+{
+# endif
+ class ANTLR_API RecognitionException : public ANTLRException
+ {
+ public:
+ RecognitionException();
+ RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s);
+ RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s,
+ const ANTLR_USE_NAMESPACE(std)string& fileName,
+ int line, int column );
+
+ virtual ~RecognitionException() throw()
+ {
+ }
+
+ /// Return file where mishap occurred.
+ virtual ANTLR_USE_NAMESPACE(std)string getFilename() const throw()
+ {
+ return fileName;
+ }
+ /**
+ * @return the line number that this exception happened on.
+ */
+ virtual int getLine() const throw()
+ {
+ return line;
+ }
+ /**
+ * @return the column number that this exception happened on.
+ */
+ virtual int getColumn() const throw()
+ {
+ return column;
+ }
+
+ /// Return complete error message with line/column number info (if present)
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const;
+
+ /// See what file/line/column info is present and return it as a string
+ virtual ANTLR_USE_NAMESPACE(std)string getFileLineColumnString() const;
+ protected:
+ ANTLR_USE_NAMESPACE(std)string fileName; // not used by treeparsers
+ int line; // not used by treeparsers
+ int column; // not used by treeparsers
+ };
+
+# ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+# endif
+
+#endif //INC_RecognitionException_hpp__
diff --git a/lib/antlr/antlr/RefCount.hpp b/lib/antlr/antlr/RefCount.hpp
new file mode 100644
index 00000000..8546a049
--- /dev/null
+++ b/lib/antlr/antlr/RefCount.hpp
@@ -0,0 +1,80 @@
+#ifndef INC_RefCount_hpp__
+#define INC_RefCount_hpp__
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+template<class T>
+class ANTLR_API RefCount {
+private:
+ struct Ref {
+ T* const ptr;
+ unsigned int count;
+
+ Ref(T* p) : ptr(p), count(1) {}
+ ~Ref() {delete ptr;}
+ Ref* increment() {++count;return this;}
+ bool decrement() {return (--count==0);}
+ private:
+ Ref(const Ref&);
+ Ref& operator=(const Ref&);
+ }* ref;
+
+public:
+ explicit RefCount(T* p = 0)
+ : ref(p ? new Ref(p) : 0)
+ {
+ }
+ RefCount(const RefCount<T>& other)
+ : ref(other.ref ? other.ref->increment() : 0)
+ {
+ }
+ ~RefCount()
+ {
+ if (ref && ref->decrement())
+ delete ref;
+ }
+ RefCount<T>& operator=(const RefCount<T>& other)
+ {
+ Ref* tmp = other.ref ? other.ref->increment() : 0;
+ if (ref && ref->decrement())
+ delete ref;
+ ref = tmp;
+ return *this;
+ }
+
+ operator T* () const
+ {
+ return ref ? ref->ptr : 0;
+ }
+
+ T* operator->() const
+ {
+ return ref ? ref->ptr : 0;
+ }
+
+ T* get() const
+ {
+ return ref ? ref->ptr : 0;
+ }
+
+ template<class newType> operator RefCount<newType>()
+ {
+ return RefCount<newType>(ref);
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_RefCount_hpp__
diff --git a/lib/antlr/antlr/SemanticException.hpp b/lib/antlr/antlr/SemanticException.hpp
new file mode 100644
index 00000000..dc68d5a9
--- /dev/null
+++ b/lib/antlr/antlr/SemanticException.hpp
@@ -0,0 +1,40 @@
+#ifndef INC_SemanticException_hpp__
+#define INC_SemanticException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/RecognitionException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API SemanticException : public RecognitionException {
+public:
+ SemanticException(const ANTLR_USE_NAMESPACE(std)string& s)
+ : RecognitionException(s)
+ {
+ }
+ SemanticException(const ANTLR_USE_NAMESPACE(std)string& s,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_,
+ int line_,int column_)
+ : RecognitionException(s,fileName_,line_,column_)
+ {
+ }
+
+ ~SemanticException() throw()
+ {
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_SemanticException_hpp__
diff --git a/lib/antlr/antlr/String.hpp b/lib/antlr/antlr/String.hpp
new file mode 100644
index 00000000..7e6dde5a
--- /dev/null
+++ b/lib/antlr/antlr/String.hpp
@@ -0,0 +1,27 @@
+#ifndef INC_String_hpp__
+#define INC_String_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+ANTLR_API ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, const int rhs );
+ANTLR_API ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, size_t rhs );
+
+ANTLR_API ANTLR_USE_NAMESPACE(std)string charName( int ch );
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_String_hpp__
diff --git a/lib/antlr/antlr/Token.hpp b/lib/antlr/antlr/Token.hpp
new file mode 100644
index 00000000..cd56fc3c
--- /dev/null
+++ b/lib/antlr/antlr/Token.hpp
@@ -0,0 +1,108 @@
+#ifndef INC_Token_hpp__
+#define INC_Token_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenRefCount.hpp>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+struct TokenRef;
+
+/** A token is minimally a token type. Subclasses can add the text matched
+ * for the token and line info.
+ */
+class ANTLR_API Token
+{
+public:
+ // constants
+#ifndef NO_STATIC_CONSTS
+ static const int MIN_USER_TYPE = 4;
+ static const int NULL_TREE_LOOKAHEAD = 3;
+ static const int INVALID_TYPE = 0;
+ static const int EOF_TYPE = 1;
+ static const int SKIP = -1;
+#else
+ enum {
+ MIN_USER_TYPE = 4,
+ NULL_TREE_LOOKAHEAD = 3,
+ INVALID_TYPE = 0,
+ EOF_TYPE = 1,
+ SKIP = -1
+ };
+#endif
+
+ Token()
+ : ref(0)
+ , type(INVALID_TYPE)
+ {
+ }
+ Token(int t)
+ : ref(0)
+ , type(t)
+ {
+ }
+ Token(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
+ : ref(0)
+ , type(t)
+ {
+ setText(txt);
+ }
+ virtual ~Token()
+ {
+ }
+
+ virtual int getColumn() const;
+ virtual int getLine() const;
+ virtual ANTLR_USE_NAMESPACE(std)string getText() const;
+ virtual const ANTLR_USE_NAMESPACE(std)string& getFilename() const;
+ virtual int getType() const;
+
+ virtual void setColumn(int c);
+
+ virtual void setLine(int l);
+ virtual void setText(const ANTLR_USE_NAMESPACE(std)string& t);
+ virtual void setType(int t);
+
+ virtual void setFilename( const std::string& file );
+
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const;
+
+private:
+ friend struct TokenRef;
+ TokenRef* ref;
+
+ int type; ///< the type of the token
+
+ Token(RefToken other);
+ Token& operator=(const Token& other);
+ Token& operator=(RefToken other);
+
+ Token(const Token&);
+};
+
+extern ANTLR_API RefToken nullToken;
+
+#ifdef NEEDS_OPERATOR_LESS_THAN
+// RK: Added after 2.7.2 previously it was undefined.
+// AL: what to return if l and/or r point to nullToken???
+inline bool operator<( RefToken l, RefToken r )
+{
+ return nullToken == l ? ( nullToken == r ? false : true ) : l->getType() < r->getType();
+}
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_Token_hpp__
diff --git a/lib/antlr/antlr/TokenBuffer.hpp b/lib/antlr/antlr/TokenBuffer.hpp
new file mode 100644
index 00000000..3077eead
--- /dev/null
+++ b/lib/antlr/antlr/TokenBuffer.hpp
@@ -0,0 +1,121 @@
+#ifndef INC_TokenBuffer_hpp__
+#define INC_TokenBuffer_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStream.hpp>
+#include <antlr/CircularQueue.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**A Stream of Token objects fed to the parser from a TokenStream that can
+ * be rewound via mark()/rewind() methods.
+ * <p>
+ * A dynamic array is used to buffer up all the input tokens. Normally,
+ * "k" tokens are stored in the buffer. More tokens may be stored during
+ * guess mode (testing syntactic predicate), or when LT(i>k) is referenced.
+ * Consumption of tokens is deferred. In other words, reading the next
+ * token is not done by conume(), but deferred until needed by LA or LT.
+ * <p>
+ *
+ * @todo: see if we can integrate this one with InputBuffer into one template
+ * or so.
+ *
+ * @see antlr.Token
+ * @see antlr.TokenStream
+ * @see antlr.TokenQueue
+ */
+class ANTLR_API TokenBuffer {
+public:
+ /** Create a token buffer */
+ TokenBuffer(TokenStream& input_);
+ virtual ~TokenBuffer();
+
+ /// Reset the input buffer to empty state
+ inline void reset( void )
+ {
+ nMarkers = 0;
+ markerOffset = 0;
+ numToConsume = 0;
+ queue.clear();
+ }
+
+ /** Get a lookahead token value */
+ int LA( unsigned int i );
+
+ /** Get a lookahead token */
+ RefToken LT( unsigned int i );
+
+ /** Return an integer marker that can be used to rewind the buffer to
+ * its current state.
+ */
+ unsigned int mark();
+
+ /**Rewind the token buffer to a marker.
+ * @param mark Marker returned previously from mark()
+ */
+ void rewind(unsigned int mark);
+
+ /** Mark another token for deferred consumption */
+ inline void consume()
+ {
+ numToConsume++;
+ }
+
+ /// Return the number of entries in the TokenBuffer
+ virtual unsigned int entries() const;
+
+private:
+ /** Ensure that the token buffer is sufficiently full */
+ void fill(unsigned int amount);
+ /** Sync up deferred consumption */
+ void syncConsume();
+
+protected:
+ /// Token source
+ TokenStream& input;
+
+ /// Number of active markers
+ unsigned int nMarkers;
+
+ /// Additional offset used when markers are active
+ unsigned int markerOffset;
+
+ /// Number of calls to consume() since last LA() or LT() call
+ unsigned int numToConsume;
+
+ /// Circular queue with Tokens
+ CircularQueue<RefToken> queue;
+
+private:
+ TokenBuffer(const TokenBuffer& other);
+ const TokenBuffer& operator=(const TokenBuffer& other);
+};
+
+/** Sync up deferred consumption */
+inline void TokenBuffer::syncConsume()
+{
+ if (numToConsume > 0)
+ {
+ if (nMarkers > 0)
+ markerOffset += numToConsume;
+ else
+ queue.removeItems( numToConsume );
+
+ numToConsume = 0;
+ }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenBuffer_hpp__
diff --git a/lib/antlr/antlr/TokenRefCount.hpp b/lib/antlr/antlr/TokenRefCount.hpp
new file mode 100644
index 00000000..9ccbb98c
--- /dev/null
+++ b/lib/antlr/antlr/TokenRefCount.hpp
@@ -0,0 +1,98 @@
+#ifndef INC_TokenRefCount_hpp__
+# define INC_TokenRefCount_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id:$
+ */
+
+# include <antlr/config.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class Token;
+
+struct ANTLR_API TokenRef
+{
+ Token* const ptr;
+ unsigned int count;
+
+ TokenRef(Token* p);
+ ~TokenRef();
+ TokenRef* increment()
+ {
+ ++count;
+ return this;
+ }
+ bool decrement()
+ {
+ return (--count==0);
+ }
+
+ static TokenRef* getRef(const Token* p);
+private:
+ TokenRef( const TokenRef& );
+ TokenRef& operator=( const TokenRef& );
+};
+
+template<class T>
+ class ANTLR_API TokenRefCount
+{
+private:
+ TokenRef* ref;
+
+public:
+ TokenRefCount(const Token* p=0)
+ : ref(p ? TokenRef::getRef(p) : 0)
+ {
+ }
+ TokenRefCount(const TokenRefCount<T>& other)
+ : ref(other.ref ? other.ref->increment() : 0)
+ {
+ }
+ ~TokenRefCount()
+ {
+ if (ref && ref->decrement())
+ delete ref;
+ }
+ TokenRefCount<T>& operator=(Token* other)
+ {
+ TokenRef* tmp = TokenRef::getRef(other);
+
+ if (ref && ref->decrement())
+ delete ref;
+
+ ref=tmp;
+
+ return *this;
+ }
+ TokenRefCount<T>& operator=(const TokenRefCount<T>& other)
+ {
+ if( other.ref != ref )
+ {
+ TokenRef* tmp = other.ref ? other.ref->increment() : 0;
+
+ if (ref && ref->decrement())
+ delete ref;
+
+ ref=tmp;
+ }
+ return *this;
+ }
+
+ operator T* () const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+ T* operator->() const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+ T* get() const { return ref ? static_cast<T*>(ref->ptr) : 0; }
+};
+
+typedef TokenRefCount<Token> RefToken;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenRefCount_hpp__
diff --git a/lib/antlr/antlr/TokenStream.hpp b/lib/antlr/antlr/TokenStream.hpp
new file mode 100644
index 00000000..dbf83a8c
--- /dev/null
+++ b/lib/antlr/antlr/TokenStream.hpp
@@ -0,0 +1,34 @@
+#ifndef INC_TokenStream_hpp__
+#define INC_TokenStream_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/Token.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This interface allows any object to pretend it is a stream
+ * of tokens.
+ * @author Terence Parr, MageLang Institute
+ */
+class ANTLR_API TokenStream {
+public:
+ virtual RefToken nextToken()=0;
+ virtual ~TokenStream()
+ {
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStream_hpp__
diff --git a/lib/antlr/antlr/TokenStreamBasicFilter.hpp b/lib/antlr/antlr/TokenStreamBasicFilter.hpp
new file mode 100644
index 00000000..bcdb131c
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamBasicFilter.hpp
@@ -0,0 +1,46 @@
+#ifndef INC_TokenStreamBasicFilter_hpp__
+#define INC_TokenStreamBasicFilter_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/TokenStream.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This object is a TokenStream that passes through all
+ * tokens except for those that you tell it to discard.
+ * There is no buffering of the tokens.
+ */
+class ANTLR_API TokenStreamBasicFilter : public TokenStream {
+ /** The set of token types to discard */
+protected:
+ BitSet discardMask;
+
+ /** The input stream */
+protected:
+ TokenStream* input;
+
+public:
+ TokenStreamBasicFilter(TokenStream& input_);
+
+ void discard(int ttype);
+
+ void discard(const BitSet& mask);
+
+ RefToken nextToken();
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamBasicFilter_hpp__
diff --git a/lib/antlr/antlr/TokenStreamException.hpp b/lib/antlr/antlr/TokenStreamException.hpp
new file mode 100644
index 00000000..dbddb442
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamException.hpp
@@ -0,0 +1,41 @@
+#ifndef INC_TokenStreamException_hpp__
+#define INC_TokenStreamException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/ANTLRException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Baseclass for exceptions thrown by classes implementing the TokenStream
+ * interface.
+ * @see TokenStream
+ */
+class ANTLR_API TokenStreamException : public ANTLRException {
+public:
+ TokenStreamException()
+ : ANTLRException()
+ {
+ }
+ TokenStreamException(const ANTLR_USE_NAMESPACE(std)string& s)
+ : ANTLRException(s)
+ {
+ }
+ virtual ~TokenStreamException() throw()
+ {
+ }
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamException_hpp__
diff --git a/lib/antlr/antlr/TokenStreamHiddenTokenFilter.hpp b/lib/antlr/antlr/TokenStreamHiddenTokenFilter.hpp
new file mode 100644
index 00000000..ed007a7a
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamHiddenTokenFilter.hpp
@@ -0,0 +1,95 @@
+#ifndef INC_TokenStreamHiddenTokenFilter_hpp__
+#define INC_TokenStreamHiddenTokenFilter_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStreamBasicFilter.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**This object filters a token stream coming from a lexer
+ * or another TokenStream so that only certain token channels
+ * get transmitted to the parser.
+ *
+ * Any of the channels can be filtered off as "hidden" channels whose
+ * tokens can be accessed from the parser.
+ */
+class ANTLR_API TokenStreamHiddenTokenFilter : public TokenStreamBasicFilter {
+ // protected BitSet discardMask;
+protected:
+ BitSet hideMask;
+
+private:
+ RefToken nextMonitoredToken;
+
+protected:
+ /** track tail of hidden list emanating from previous
+ * monitored token
+ */
+ RefToken lastHiddenToken;
+
+ RefToken firstHidden; // = null;
+
+public:
+ TokenStreamHiddenTokenFilter(TokenStream& input);
+
+protected:
+ void consume();
+
+private:
+ void consumeFirst();
+
+public:
+ BitSet getDiscardMask() const;
+
+ /** Return a ptr to the hidden token appearing immediately after
+ * token t in the input stream.
+ */
+ RefToken getHiddenAfter(RefToken t);
+
+ /** Return a ptr to the hidden token appearing immediately before
+ * token t in the input stream.
+ */
+ RefToken getHiddenBefore(RefToken t);
+
+ BitSet getHideMask() const;
+
+ /** Return the first hidden token if one appears
+ * before any monitored token.
+ */
+ RefToken getInitialHiddenToken();
+
+ void hide(int m);
+
+ void hide(const BitSet& mask);
+
+protected:
+ RefToken LA(int i);
+
+public:
+/** Return the next monitored token.
+ * Test the token following the monitored token.
+ * If following is another monitored token, save it
+ * for the next invocation of nextToken (like a single
+ * lookahead token) and return it then.
+ * If following is unmonitored, nondiscarded (hidden)
+ * channel token, add it to the monitored token.
+ *
+ * Note: EOF must be a monitored Token.
+ */
+ RefToken nextToken();
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamHiddenTokenFilter_hpp__
diff --git a/lib/antlr/antlr/TokenStreamIOException.hpp b/lib/antlr/antlr/TokenStreamIOException.hpp
new file mode 100644
index 00000000..fff72ced
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamIOException.hpp
@@ -0,0 +1,40 @@
+#ifndef INC_TokenStreamIOException_hpp__
+#define INC_TokenStreamIOException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStreamException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class TokenStreamIOException : public TokenStreamException {
+public:
+ TokenStreamIOException()
+ : TokenStreamException()
+ {
+ }
+ TokenStreamIOException(const ANTLR_USE_NAMESPACE(std)exception& e)
+ : TokenStreamException(e.what())
+ , io(e)
+ {
+ }
+ ~TokenStreamIOException() throw()
+ {
+ }
+private:
+ ANTLR_USE_NAMESPACE(std)exception io;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamIOException_hpp__
diff --git a/lib/antlr/antlr/TokenStreamRecognitionException.hpp b/lib/antlr/antlr/TokenStreamRecognitionException.hpp
new file mode 100644
index 00000000..687d7814
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamRecognitionException.hpp
@@ -0,0 +1,57 @@
+#ifndef INC_TokenStreamRecognitionException_hpp__
+#define INC_TokenStreamRecognitionException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStreamException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Exception thrown from generated lexers when there's no default error
+ * handler specified.
+ * @see TokenStream
+ */
+class TokenStreamRecognitionException : public TokenStreamException {
+public:
+ TokenStreamRecognitionException(RecognitionException& re)
+ : TokenStreamException(re.getMessage())
+ , recog(re)
+ {
+ }
+ virtual ~TokenStreamRecognitionException() throw()
+ {
+ }
+ virtual ANTLR_USE_NAMESPACE(std)string toString() const
+ {
+ return recog.getFileLineColumnString()+getMessage();
+ }
+
+ virtual ANTLR_USE_NAMESPACE(std)string getFilename() const throw()
+ {
+ return recog.getFilename();
+ }
+ virtual int getLine() const throw()
+ {
+ return recog.getLine();
+ }
+ virtual int getColumn() const throw()
+ {
+ return recog.getColumn();
+ }
+private:
+ RecognitionException recog;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamRecognitionException_hpp__
diff --git a/lib/antlr/antlr/TokenStreamRetryException.hpp b/lib/antlr/antlr/TokenStreamRetryException.hpp
new file mode 100644
index 00000000..5af21cde
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamRetryException.hpp
@@ -0,0 +1,28 @@
+#ifndef INC_TokenStreamRetryException_hpp__
+#define INC_TokenStreamRetryException_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStreamException.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class TokenStreamRetryException : public TokenStreamException {
+public:
+ TokenStreamRetryException() {}
+ ~TokenStreamRetryException() throw() {}
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamRetryException_hpp__
diff --git a/lib/antlr/antlr/TokenStreamRewriteEngine.hpp b/lib/antlr/antlr/TokenStreamRewriteEngine.hpp
new file mode 100644
index 00000000..9fab08c2
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamRewriteEngine.hpp
@@ -0,0 +1,439 @@
+#ifndef INC_TokenStreamRewriteEngine_hpp__
+#define INC_TokenStreamRewriteEngine_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ */
+
+#include <string>
+#include <list>
+#include <vector>
+#include <map>
+#include <utility>
+#include <iostream>
+#include <iterator>
+#include <cassert>
+#include <algorithm>
+
+#include <antlr/config.hpp>
+
+#include <antlr/TokenStream.hpp>
+#include <antlr/TokenWithIndex.hpp>
+#include <antlr/BitSet.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This token stream tracks the *entire* token stream coming from
+ * a lexer, but does not pass on the whitespace (or whatever else
+ * you want to discard) to the parser.
+ *
+ * This class can then be asked for the ith token in the input stream.
+ * Useful for dumping out the input stream exactly after doing some
+ * augmentation or other manipulations. Tokens are index from 0..n-1
+ *
+ * You can insert stuff, replace, and delete chunks. Note that the
+ * operations are done lazily--only if you convert the buffer to a
+ * String. This is very efficient because you are not moving data around
+ * all the time. As the buffer of tokens is converted to strings, the
+ * toString() method(s) check to see if there is an operation at the
+ * current index. If so, the operation is done and then normal String
+ * rendering continues on the buffer. This is like having multiple Turing
+ * machine instruction streams (programs) operating on a single input tape. :)
+ *
+ * Since the operations are done lazily at toString-time, operations do not
+ * screw up the token index values. That is, an insert operation at token
+ * index i does not change the index values for tokens i+1..n-1.
+ *
+ * Because operations never actually alter the buffer, you may always get
+ * the original token stream back without undoing anything. Since
+ * the instructions are queued up, you can easily simulate transactions and
+ * roll back any changes if there is an error just by removing instructions.
+ * For example,
+ *
+ * TokenStreamRewriteEngine rewriteEngine =
+ * new TokenStreamRewriteEngine(lexer);
+ * JavaRecognizer parser = new JavaRecognizer(rewriteEngine);
+ * ...
+ * rewriteEngine.insertAfter("pass1", t, "foobar");}
+ * rewriteEngine.insertAfter("pass2", u, "start");}
+ * System.out.println(rewriteEngine.toString("pass1"));
+ * System.out.println(rewriteEngine.toString("pass2"));
+ *
+ * You can also have multiple "instruction streams" and get multiple
+ * rewrites from a single pass over the input. Just name the instruction
+ * streams and use that name again when printing the buffer. This could be
+ * useful for generating a C file and also its header file--all from the
+ * same buffer.
+ *
+ * If you don't use named rewrite streams, a "default" stream is used.
+ *
+ * Terence Parr, parrt@cs.usfca.edu
+ * University of San Francisco
+ * February 2004
+ */
+class TokenStreamRewriteEngine : public TokenStream
+{
+public:
+ typedef ANTLR_USE_NAMESPACE(std)vector<antlr::RefTokenWithIndex> token_list;
+ static const char* DEFAULT_PROGRAM_NAME;
+#ifndef NO_STATIC_CONSTS
+ static const size_t MIN_TOKEN_INDEX;
+ static const int PROGRAM_INIT_SIZE;
+#else
+ enum {
+ MIN_TOKEN_INDEX = 0,
+ PROGRAM_INIT_SIZE = 100
+ };
+#endif
+
+ struct tokenToStream {
+ tokenToStream( ANTLR_USE_NAMESPACE(std)ostream& o ) : out(o) {}
+ template <typename T> void operator() ( const T& t ) {
+ out << t->getText();
+ }
+ ANTLR_USE_NAMESPACE(std)ostream& out;
+ };
+
+ class RewriteOperation {
+ protected:
+ RewriteOperation( size_t idx, const ANTLR_USE_NAMESPACE(std)string& txt )
+ : index(idx), text(txt)
+ {
+ }
+ public:
+ virtual ~RewriteOperation()
+ {
+ }
+ /** Execute the rewrite operation by possibly adding to the buffer.
+ * Return the index of the next token to operate on.
+ */
+ virtual size_t execute( ANTLR_USE_NAMESPACE(std)ostream& /* out */ ) {
+ return index;
+ }
+ virtual size_t getIndex() const {
+ return index;
+ }
+ virtual const char* type() const {
+ return "RewriteOperation";
+ }
+ protected:
+ size_t index;
+ ANTLR_USE_NAMESPACE(std)string text;
+ };
+
+ struct executeOperation {
+ ANTLR_USE_NAMESPACE(std)ostream& out;
+ executeOperation( ANTLR_USE_NAMESPACE(std)ostream& s ) : out(s) {}
+ void operator () ( RewriteOperation* t ) {
+ t->execute(out);
+ }
+ };
+
+ /// list of rewrite operations
+ typedef ANTLR_USE_NAMESPACE(std)list<RewriteOperation*> operation_list;
+ /// map program name to <program counter,program> tuple
+ typedef ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,operation_list> program_map;
+
+ class InsertBeforeOp : public RewriteOperation
+ {
+ public:
+ InsertBeforeOp( size_t index, const ANTLR_USE_NAMESPACE(std)string& text )
+ : RewriteOperation(index, text)
+ {
+ }
+ virtual ~InsertBeforeOp() {}
+ virtual size_t execute( ANTLR_USE_NAMESPACE(std)ostream& out )
+ {
+ out << text;
+ return index;
+ }
+ virtual const char* type() const {
+ return "InsertBeforeOp";
+ }
+ };
+
+ class ReplaceOp : public RewriteOperation
+ {
+ public:
+ ReplaceOp(size_t from, size_t to, ANTLR_USE_NAMESPACE(std)string text)
+ : RewriteOperation(from,text)
+ , lastIndex(to)
+ {
+ }
+ virtual ~ReplaceOp() {}
+ virtual size_t execute( ANTLR_USE_NAMESPACE(std)ostream& out ) {
+ out << text;
+ return lastIndex+1;
+ }
+ virtual const char* type() const {
+ return "ReplaceOp";
+ }
+ protected:
+ size_t lastIndex;
+ };
+
+ class DeleteOp : public ReplaceOp {
+ public:
+ DeleteOp(size_t from, size_t to)
+ : ReplaceOp(from,to,"")
+ {
+ }
+ virtual const char* type() const {
+ return "DeleteOp";
+ }
+ };
+
+ TokenStreamRewriteEngine(TokenStream& upstream);
+
+ TokenStreamRewriteEngine(TokenStream& upstream, size_t initialSize);
+
+ RefToken nextToken( void );
+
+ void rollback(size_t instructionIndex) {
+ rollback(DEFAULT_PROGRAM_NAME, instructionIndex);
+ }
+
+ /** Rollback the instruction stream for a program so that
+ * the indicated instruction (via instructionIndex) is no
+ * longer in the stream. UNTESTED!
+ */
+ void rollback(const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t instructionIndex );
+
+ void deleteProgram() {
+ deleteProgram(DEFAULT_PROGRAM_NAME);
+ }
+
+ /** Reset the program so that no instructions exist */
+ void deleteProgram(const ANTLR_USE_NAMESPACE(std)string& programName) {
+ rollback(programName, MIN_TOKEN_INDEX);
+ }
+
+ void insertAfter( RefTokenWithIndex t,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ insertAfter(DEFAULT_PROGRAM_NAME, t, text);
+ }
+
+ void insertAfter(size_t index, const ANTLR_USE_NAMESPACE(std)string& text) {
+ insertAfter(DEFAULT_PROGRAM_NAME, index, text);
+ }
+
+ void insertAfter( const ANTLR_USE_NAMESPACE(std)string& programName,
+ RefTokenWithIndex t,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ insertAfter(programName, t->getIndex(), text);
+ }
+
+ void insertAfter( const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t index,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ // to insert after, just insert before next index (even if past end)
+ insertBefore(programName,index+1, text);
+ }
+
+ void insertBefore( RefTokenWithIndex t,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ // std::cout << "insertBefore index " << t->getIndex() << " " << text << std::endl;
+ insertBefore(DEFAULT_PROGRAM_NAME, t, text);
+ }
+
+ void insertBefore(size_t index, const ANTLR_USE_NAMESPACE(std)string& text) {
+ insertBefore(DEFAULT_PROGRAM_NAME, index, text);
+ }
+
+ void insertBefore( const ANTLR_USE_NAMESPACE(std)string& programName,
+ RefTokenWithIndex t,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ insertBefore(programName, t->getIndex(), text);
+ }
+
+ void insertBefore( const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t index,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ addToSortedRewriteList(programName, new InsertBeforeOp(index,text));
+ }
+
+ void replace(size_t index, const ANTLR_USE_NAMESPACE(std)string& text)
+ {
+ replace(DEFAULT_PROGRAM_NAME, index, index, text);
+ }
+
+ void replace( size_t from, size_t to,
+ const ANTLR_USE_NAMESPACE(std)string& text)
+ {
+ replace(DEFAULT_PROGRAM_NAME, from, to, text);
+ }
+
+ void replace( RefTokenWithIndex indexT,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ replace(DEFAULT_PROGRAM_NAME, indexT->getIndex(), indexT->getIndex(), text);
+ }
+
+ void replace( RefTokenWithIndex from,
+ RefTokenWithIndex to,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ replace(DEFAULT_PROGRAM_NAME, from, to, text);
+ }
+
+ void replace(const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t from, size_t to,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ addToSortedRewriteList(programName,new ReplaceOp(from, to, text));
+ }
+
+ void replace( const ANTLR_USE_NAMESPACE(std)string& programName,
+ RefTokenWithIndex from,
+ RefTokenWithIndex to,
+ const ANTLR_USE_NAMESPACE(std)string& text )
+ {
+ replace(programName,
+ from->getIndex(),
+ to->getIndex(),
+ text);
+ }
+
+ void remove(size_t index) {
+ remove(DEFAULT_PROGRAM_NAME, index, index);
+ }
+
+ void remove(size_t from, size_t to) {
+ remove(DEFAULT_PROGRAM_NAME, from, to);
+ }
+
+ void remove(RefTokenWithIndex indexT) {
+ remove(DEFAULT_PROGRAM_NAME, indexT, indexT);
+ }
+
+ void remove(RefTokenWithIndex from, RefTokenWithIndex to) {
+ remove(DEFAULT_PROGRAM_NAME, from, to);
+ }
+
+ void remove( const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t from, size_t to)
+ {
+ replace(programName,from,to,"");
+ }
+
+ void remove( const ANTLR_USE_NAMESPACE(std)string& programName,
+ RefTokenWithIndex from, RefTokenWithIndex to )
+ {
+ replace(programName,from,to,"");
+ }
+
+ void discard(int ttype) {
+ discardMask.add(ttype);
+ }
+
+ RefToken getToken( size_t i )
+ {
+ return RefToken(tokens.at(i));
+ }
+
+ size_t getTokenStreamSize() const {
+ return tokens.size();
+ }
+
+ void originalToStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const {
+ ANTLR_USE_NAMESPACE(std)for_each( tokens.begin(), tokens.end(), tokenToStream(out) );
+ }
+
+ void originalToStream( ANTLR_USE_NAMESPACE(std)ostream& out,
+ size_t start, size_t end ) const;
+
+ void toStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const {
+ toStream( out, MIN_TOKEN_INDEX, getTokenStreamSize());
+ }
+
+ void toStream( ANTLR_USE_NAMESPACE(std)ostream& out,
+ const ANTLR_USE_NAMESPACE(std)string& programName ) const
+ {
+ toStream( out, programName, MIN_TOKEN_INDEX, getTokenStreamSize());
+ }
+
+ void toStream( ANTLR_USE_NAMESPACE(std)ostream& out,
+ size_t start, size_t end ) const
+ {
+ toStream(out, DEFAULT_PROGRAM_NAME, start, end);
+ }
+
+ void toStream( ANTLR_USE_NAMESPACE(std)ostream& out,
+ const ANTLR_USE_NAMESPACE(std)string& programName,
+ size_t firstToken, size_t lastToken ) const;
+
+ void toDebugStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const {
+ toDebugStream( out, MIN_TOKEN_INDEX, getTokenStreamSize());
+ }
+
+ void toDebugStream( ANTLR_USE_NAMESPACE(std)ostream& out,
+ size_t start, size_t end ) const;
+
+ size_t getLastRewriteTokenIndex() const {
+ return getLastRewriteTokenIndex(DEFAULT_PROGRAM_NAME);
+ }
+
+ /** Return the last index for the program named programName
+ * return 0 if the program does not exist or the program is empty.
+ * (Note this is different from the java implementation that returns -1)
+ */
+ size_t getLastRewriteTokenIndex(const ANTLR_USE_NAMESPACE(std)string& programName) const {
+ program_map::const_iterator rewrites = programs.find(programName);
+
+ if( rewrites == programs.end() )
+ return 0;
+
+ const operation_list& prog = rewrites->second;
+ if( !prog.empty() )
+ {
+ operation_list::const_iterator last = prog.end();
+ --last;
+ return (*last)->getIndex();
+ }
+ return 0;
+ }
+
+protected:
+ /** If op.index > lastRewriteTokenIndexes, just add to the end.
+ * Otherwise, do linear */
+ void addToSortedRewriteList(RewriteOperation* op) {
+ addToSortedRewriteList(DEFAULT_PROGRAM_NAME, op);
+ }
+
+ void addToSortedRewriteList( const ANTLR_USE_NAMESPACE(std)string& programName,
+ RewriteOperation* op );
+
+protected:
+ /** Who do we suck tokens from? */
+ TokenStream& stream;
+ /** track index of tokens */
+ size_t index;
+
+ /** Track the incoming list of tokens */
+ token_list tokens;
+
+ /** You may have multiple, named streams of rewrite operations.
+ * I'm calling these things "programs."
+ * Maps String (name) -> rewrite (List)
+ */
+ program_map programs;
+
+ /** Which (whitespace) token(s) to throw out */
+ BitSet discardMask;
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/lib/antlr/antlr/TokenStreamSelector.hpp b/lib/antlr/antlr/TokenStreamSelector.hpp
new file mode 100644
index 00000000..1dab8797
--- /dev/null
+++ b/lib/antlr/antlr/TokenStreamSelector.hpp
@@ -0,0 +1,87 @@
+#ifndef INC_TokenStreamSelector_hpp__
+#define INC_TokenStreamSelector_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/TokenStream.hpp>
+#include <map>
+#include <stack>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A token stream MUX (multiplexor) knows about n token streams
+ * and can multiplex them onto the same channel for use by token
+ * stream consumer like a parser. This is a way to have multiple
+ * lexers break up the same input stream for a single parser.
+ * Or, you can have multiple instances of the same lexer handle
+ * multiple input streams; this works great for includes.
+ */
+class ANTLR_API TokenStreamSelector : public TokenStream {
+protected:
+ /** The set of inputs to the MUX */
+#ifdef OS_NO_ALLOCATOR
+ typedef ANTLR_USE_NAMESPACE(std)less<ANTLR_USE_NAMESPACE(std)string> lessp;
+ typedef ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,TokenStream*,lessp> inputStreamNames_coll;
+#else
+ typedef ANTLR_USE_NAMESPACE(std)map<ANTLR_USE_NAMESPACE(std)string,TokenStream*> inputStreamNames_coll;
+#endif
+ inputStreamNames_coll inputStreamNames;
+
+ /** The currently-selected token stream input */
+ TokenStream* input;
+
+ /** Used to track stack of input streams */
+#ifdef OS_NO_ALLOCATOR
+ typedef ANTLR_USE_NAMESPACE(std)stack<TokenStream*, ANTLR_USE_NAMESPACE(std)deque<TokenStream*> > streamStack_coll;
+#else
+ typedef ANTLR_USE_NAMESPACE(std)stack<TokenStream*> streamStack_coll;
+#endif
+ streamStack_coll streamStack;
+
+public:
+ TokenStreamSelector();
+ ~TokenStreamSelector();
+
+ void addInputStream(TokenStream* stream, const ANTLR_USE_NAMESPACE(std)string& key);
+
+ /// Return the stream from which tokens are being pulled at the moment.
+ TokenStream* getCurrentStream() const;
+
+ TokenStream* getStream(const ANTLR_USE_NAMESPACE(std)string& sname) const;
+
+ RefToken nextToken();
+
+ TokenStream* pop();
+
+ void push(TokenStream* stream);
+
+ void push(const ANTLR_USE_NAMESPACE(std)string& sname);
+
+ /** Abort recognition of current Token and try again.
+ * A stream can push a new stream (for include files
+ * for example, and then retry(), which will cause
+ * the current stream to abort back to this.nextToken().
+ * this.nextToken() then asks for a token from the
+ * current stream, which is the new "substream."
+ */
+ void retry();
+
+ /** Set the stream without pushing old stream */
+ void select(TokenStream* stream);
+
+ void select(const ANTLR_USE_NAMESPACE(std)string& sname);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TokenStreamSelector_hpp__
diff --git a/lib/antlr/antlr/TokenWithIndex.hpp b/lib/antlr/antlr/TokenWithIndex.hpp
new file mode 100644
index 00000000..e4a3e37e
--- /dev/null
+++ b/lib/antlr/antlr/TokenWithIndex.hpp
@@ -0,0 +1,84 @@
+#ifndef INC_TokenWithIndex_hpp__
+#define INC_TokenWithIndex_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id:$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/CommonToken.hpp>
+#include <antlr/String.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API TokenWithIndex : public ANTLR_USE_NAMESPACE(antlr)CommonToken {
+public:
+ // static size_t count;
+ TokenWithIndex() : CommonToken(), index(0)
+ {
+ // std::cout << __PRETTY_FUNCTION__ << std::endl;
+ // count++;
+ }
+ TokenWithIndex(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
+ : CommonToken(t,txt)
+ , index(0)
+ {
+ // std::cout << __PRETTY_FUNCTION__ << std::endl;
+ // count++;
+ }
+ TokenWithIndex(const ANTLR_USE_NAMESPACE(std)string& s)
+ : CommonToken(s)
+ , index(0)
+ {
+ // std::cout << __PRETTY_FUNCTION__ << std::endl;
+ // count++;
+ }
+ ~TokenWithIndex()
+ {
+ // count--;
+ }
+ void setIndex( size_t idx )
+ {
+ index = idx;
+ }
+ size_t getIndex( void ) const
+ {
+ return index;
+ }
+
+ ANTLR_USE_NAMESPACE(std)string toString() const
+ {
+ return ANTLR_USE_NAMESPACE(std)string("[")+
+ index+
+ ":\""+
+ getText()+"\",<"+
+ getType()+">,line="+
+ getLine()+",column="+
+ getColumn()+"]";
+ }
+
+ static RefToken factory()
+ {
+ return RefToken(new TokenWithIndex());
+ }
+
+protected:
+ size_t index;
+
+private:
+ TokenWithIndex(const TokenWithIndex&);
+ const TokenWithIndex& operator=(const TokenWithIndex&);
+};
+
+typedef TokenRefCount<TokenWithIndex> RefTokenWithIndex;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_CommonToken_hpp__
diff --git a/lib/antlr/antlr/TreeParser.hpp b/lib/antlr/antlr/TreeParser.hpp
new file mode 100644
index 00000000..aeee3f9d
--- /dev/null
+++ b/lib/antlr/antlr/TreeParser.hpp
@@ -0,0 +1,155 @@
+#ifndef INC_TreeParser_hpp__
+#define INC_TreeParser_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/AST.hpp>
+#include <antlr/ASTFactory.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/RecognitionException.hpp>
+#include <antlr/MismatchedTokenException.hpp>
+#include <antlr/TreeParserSharedInputState.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+class ANTLR_API TreeParser {
+public:
+ TreeParser()
+ : astFactory(0)
+ , inputState(new TreeParserInputState())
+ , traceDepth(0)
+ {
+ }
+
+ TreeParser(const TreeParserSharedInputState& state)
+ : astFactory(0)
+ , inputState(state)
+ , traceDepth(0)
+ {
+ }
+
+ virtual ~TreeParser()
+ {
+ }
+
+ /// Get the AST return value squirreled away in the parser
+ virtual RefAST getAST() = 0;
+
+ /** Make sure current lookahead symbol matches the given set
+ * Throw an exception upon mismatch, which is caught by either the
+ * error handler or by a syntactic predicate.
+ */
+ virtual void match(RefAST t, const BitSet& b)
+ {
+ if ( !t || t==ASTNULL || !b.member(t->getType()) )
+ throw MismatchedTokenException( getTokenNames(), getNumTokens(),
+ t, b, false );
+ }
+
+ /** Specify the AST factory to be used during tree building. (Compulsory)
+ * Setting the factory is compulsory (if you intend to modify
+ * the tree in the treeparser). The AST Factory is shared between
+ * parser (who builds the initial AST) and treeparser.
+ * @see Parser::getASTFactory()
+ */
+ virtual void setASTFactory(ASTFactory* factory)
+ {
+ astFactory = factory;
+ }
+ /// Return pointer to ASTFactory
+ virtual ASTFactory* getASTFactory() const
+ {
+ return astFactory;
+ }
+ /// Get the name for token 'num'
+ virtual const char* getTokenName(int num) const = 0;
+ /// Return the number of tokens defined
+ virtual int getNumTokens() const = 0;
+ /// Return an array of getNumTokens() token names
+ virtual const char* const* getTokenNames() const = 0;
+
+ /// Parser error-reporting function can be overridden in subclass
+ virtual void reportError(const RecognitionException& ex);
+ /// Parser error-reporting function can be overridden in subclass
+ virtual void reportError(const ANTLR_USE_NAMESPACE(std)string& s);
+ /// Parser warning-reporting function can be overridden in subclass
+ virtual void reportWarning(const ANTLR_USE_NAMESPACE(std)string& s);
+
+ /// These are used during when traceTreeParser commandline option is passed.
+ virtual void traceIndent();
+ virtual void traceIn(const char* rname, RefAST t);
+ virtual void traceOut(const char* rname, RefAST t);
+
+ /** The AST Null object; the parsing cursor is set to this when
+ * it is found to be null. This way, we can test the
+ * token type of a node without having to have tests for 0
+ * everywhere.
+ */
+ static RefAST ASTNULL;
+
+protected:
+ virtual void match(RefAST t, int ttype)
+ {
+ if (!t || t == ASTNULL || t->getType() != ttype )
+ throw MismatchedTokenException( getTokenNames(), getNumTokens(),
+ t, ttype, false );
+ }
+
+ virtual void matchNot(RefAST t, int ttype)
+ {
+ if ( !t || t == ASTNULL || t->getType() == ttype )
+ throw MismatchedTokenException( getTokenNames(), getNumTokens(),
+ t, ttype, true );
+ }
+
+ /** AST support code; parser and treeparser delegate to this object */
+ ASTFactory* astFactory;
+
+ /// The input state of this tree parser.
+ TreeParserSharedInputState inputState;
+
+ /** Used to keep track of indent depth with -traceTreeParser */
+ int traceDepth;
+
+ /** Utility class which allows tracing to work even when exceptions are
+ * thrown.
+ */
+ class Tracer {
+ private:
+ TreeParser* parser;
+ const char* text;
+ RefAST tree;
+ public:
+ Tracer(TreeParser* p, const char* t, RefAST a)
+ : parser(p), text(t), tree(a)
+ {
+ parser->traceIn(text,tree);
+ }
+ ~Tracer()
+ {
+ parser->traceOut(text,tree);
+ }
+ private:
+ Tracer(const Tracer&); // undefined
+ const Tracer& operator=(const Tracer&); // undefined
+ };
+
+private:
+ // no copying of treeparser instantiations...
+ TreeParser(const TreeParser& other);
+ TreeParser& operator=(const TreeParser& other);
+};
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TreeParser_hpp__
diff --git a/lib/antlr/antlr/TreeParserSharedInputState.hpp b/lib/antlr/antlr/TreeParserSharedInputState.hpp
new file mode 100644
index 00000000..76ec6840
--- /dev/null
+++ b/lib/antlr/antlr/TreeParserSharedInputState.hpp
@@ -0,0 +1,45 @@
+#ifndef INC_TreeParserSharedInputState_hpp__
+#define INC_TreeParserSharedInputState_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/RefCount.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This object contains the data associated with an
+ * input AST. Multiple parsers
+ * share a single TreeParserSharedInputState to parse
+ * the same tree or to have the parser walk multiple
+ * trees.
+ */
+class ANTLR_API TreeParserInputState {
+public:
+ TreeParserInputState() : guessing(0) {}
+ virtual ~TreeParserInputState() {}
+
+public:
+ /** Are we guessing (guessing>0)? */
+ int guessing; //= 0;
+
+private:
+ // we don't want these:
+ TreeParserInputState(const TreeParserInputState&);
+ TreeParserInputState& operator=(const TreeParserInputState&);
+};
+
+typedef RefCount<TreeParserInputState> TreeParserSharedInputState;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+#endif //INC_TreeParserSharedInputState_hpp__
diff --git a/lib/antlr/antlr/config.hpp b/lib/antlr/antlr/config.hpp
new file mode 100644
index 00000000..db8fb28a
--- /dev/null
+++ b/lib/antlr/antlr/config.hpp
@@ -0,0 +1,290 @@
+#ifndef INC_config_hpp__
+#define INC_config_hpp__
+
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+/*
+ * Just a simple configuration file to differentiate between the
+ * various compilers used and reconfigure stuff for any oddities of the
+ * compiler in question.
+ *
+ * These are the defaults. Per compiler these are amended.
+ */
+#define ANTLR_USE_NAMESPACE(_x_) _x_::
+#define ANTLR_USING_NAMESPACE(_x_) using namespace _x_;
+#define ANTLR_CXX_SUPPORTS_NAMESPACE 1
+#define ANTLR_C_USING(_x_)
+#define ANTLR_API
+#ifndef CUSTOM_API
+# define CUSTOM_API
+#endif
+#define ANTLR_IOS_BASE ios_base
+/** define if cctype functions/macros need a std:: prefix. A lot of compilers
+ * define these as macros, in which case something barfs.
+ */
+#define ANTLR_CCTYPE_NEEDS_STD
+
+/// Define if C++ compiler supports std::uncaught_exception
+#define ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
+
+#define ANTLR_ATOI_IN_STD
+
+/******************************************************************************/
+/*{{{ Microsoft Visual C++ */
+// NOTE: If you provide patches for a specific MSVC version guard them for
+// the specific version!!!!
+// _MSC_VER == 1100 for Microsoft Visual C++ 5.0
+// _MSC_VER == 1200 for Microsoft Visual C++ 6.0
+// _MSC_VER == 1300 for Microsoft Visual C++ 7.0
+#if defined(_MSC_VER)
+
+# if _MSC_VER < 1300
+# define NOMINMAX
+# pragma warning(disable : 4786)
+# define min _cpp_min
+# endif
+
+// This warning really gets on my nerves.
+// It's the one about symbol longer than 256 chars, and it happens
+// all the time with STL.
+# pragma warning( disable : 4786 4231 )
+// this shuts up some DLL interface warnings for STL
+# pragma warning( disable : 4251 )
+
+# ifdef ANTLR_CXX_USE_STLPORT
+# undef ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
+# endif
+
+# if ( _MSC_VER < 1300 ) && ( defined(ANTLR_EXPORTS) || defined(ANTLR_IMPORTS) )
+# error "DLL Build not supported on these MSVC versions."
+// see comment in lib/cpp/src/dll.cpp
+# endif
+
+// For the DLL support originally contributed by Stephen Naughton
+// If you are building statically leave ANTLR_EXPORTS/ANTLR_IMPORTS undefined
+// If you are building the DLL define ANTLR_EXPORTS
+// If you are compiling code to be used with the DLL define ANTLR_IMPORTS
+# ifdef ANTLR_EXPORTS
+# undef ANTLR_API
+# define ANTLR_API __declspec(dllexport)
+# endif
+
+# ifdef ANTLR_IMPORTS
+# undef ANTLR_API
+# define ANTLR_API __declspec(dllimport)
+# endif
+
+# if ( _MSC_VER < 1200 )
+// supposedly only for MSVC5 and before...
+// Using vector<XXX> requires operator<(X,X) to be defined
+# define NEEDS_OPERATOR_LESS_THAN
+# endif
+
+// VC6
+# if ( _MSC_VER == 1200 )
+# undef ANTLR_ATOI_IN_STD
+# endif
+
+# if ( _MSC_VER < 1310 )
+// Supposedly only for MSVC7 and before...
+// Not allowed to put 'static const int XXX=20;' in a class definition
+# define NO_STATIC_CONSTS
+# define NO_TEMPLATE_PARTS
+# endif
+
+// No strcasecmp in the C library (so use stricmp instead)
+// - Anyone know which is in which standard?
+# define NO_STRCASECMP
+# undef ANTLR_CCTYPE_NEEDS_STD
+# define NO_STATIC_CONSTS
+#endif // End of Microsoft Visual C++
+
+/*}}}*/
+/******************************************************************************/
+/*{{{ SunPro Compiler (Using OBJECTSPACE STL)
+ *****************************************************************************/
+#ifdef __SUNPRO_CC
+
+# if (__SUNPRO_CC >= 0x500)
+
+# define NEEDS_OPERATOR_LESS_THAN
+# define NO_TEMPLATE_PARTS
+
+# else
+
+# undef namespace
+# define namespace
+
+# if (__SUNPRO_CC == 0x420)
+
+/* This code is specif to SunWspro Compiler 4.2, and will compile with
+ the objectspace 2.1 toolkit for Solaris2.6 */
+# define HAS_NOT_CASSERT_H
+# define HAS_NOT_CSTRING_H
+# define HAS_NOT_CCTYPE_H
+# define HAS_NOT_CSTDIO_H
+# define HAS_OSTREAM_H
+
+/* #define OS_SOLARIS_2_6
+ #define OS_NO_WSTRING
+ #define OS_NO_ALLOCATORS
+ #define OS_MULTI_THREADED
+ #define OS_SOLARIS_NATIVE
+ #define OS_REALTIME
+ #define __OSVERSION__=5
+ #define SVR4
+ */
+
+// ObjectSpace + some specific templates constructions with stl.
+/* #define OS_NO_ALLOCATOR */
+
+// This great compiler does not have the namespace feature.
+# undef ANTLR_USE_NAMESPACE
+# define ANTLR_USE_NAMESPACE(_x_)
+# undef ANTLR_USING_NAMESPACE
+# define ANTLR_USING_NAMESPACE(_x_)
+# undef ANTLR_CXX_SUPPORTS_NAMESPACE
+# endif // End __SUNPRO_CC == 0x420
+
+# undef explicit
+# define explicit
+
+# define exception os_exception
+# define bad_exception os_bad_exception
+
+// Not allowed to put 'static const int XXX=20;' in a class definition
+# define NO_STATIC_CONSTS
+// Using vector<XXX> requires operator<(X,X) to be defined
+# define NEEDS_OPERATOR_LESS_THAN
+
+# endif
+
+# undef ANTLR_CCTYPE_NEEDS_STD
+
+#endif // end __SUNPRO_CC
+/*}}}*/
+/*****************************************************************************/
+/*{{{ Inprise C++ Builder 3.0
+ *****************************************************************************/
+#ifdef __BCPLUSPLUS__
+# define NO_TEMPLATE_PARTS
+# define NO_STRCASECMP
+# undef ANTLR_CCTYPE_NEEDS_STD
+#endif // End of C++ Builder 3.0
+/*}}}*/
+/*****************************************************************************/
+/*{{{ IBM VisualAge C++ ( which includes the Dinkumware C++ Library )
+ *****************************************************************************/
+#ifdef __IBMCPP__
+
+// No strcasecmp in the C library (so use stricmp instead)
+// - Anyone know which is in which standard?
+#if (defined(_AIX) && (__IBMCPP__ >= 600))
+# define NO_STATIC_CONSTS
+#else
+# define NO_STRCASECMP
+# undef ANTLR_CCTYPE_NEEDS_STD
+#endif
+
+#endif // end IBM VisualAge C++
+/*}}}*/
+/*****************************************************************************/
+/*{{{ Metrowerks Codewarrior
+ *****************************************************************************/
+#ifdef __MWERKS__
+# if (__MWERKS__ <= 0x2201)
+# define NO_TEMPLATE_PARTS
+# endif
+
+// CW 6.0 and 7.0 still do not have it.
+# define ANTLR_REALLY_NO_STRCASECMP
+
+# undef ANTLR_C_USING
+# define ANTLR_C_USING(_x_) using std:: ## _x_;
+
+# define ANTLR_CCTYPE_NEEDS_STD
+# undef ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
+
+#endif // End of Metrowerks Codewarrior
+/*}}}*/
+/*****************************************************************************/
+/*{{{ SGI Irix 6.5.10 MIPSPro compiler
+ *****************************************************************************/
+// (contributed by Anna Winkler)
+// Note: you can't compile ANTLR with the MIPSPro compiler on
+// anything < 6.5.10 because SGI just fixed a big bug dealing with
+// namespaces in that release.
+#ifdef __sgi
+# define HAS_NOT_CCTYPE_H
+# define HAS_NOT_CSTRING_H
+# define HAS_NOT_CSTDIO_H
+# undef ANTLR_CCTYPE_NEEDS_STD
+#endif // End IRIX MIPSPro
+/*}}}*/
+/*****************************************************************************/
+/*{{{ G++ in various incarnations
+ *****************************************************************************/
+// With the gcc-2.95 and 3.0 being in the near future we should start handling
+// incompatabilities between the various libstdc++'s.
+#if defined(__GNUC__) || defined(__GNUG__)
+// gcc 2 branch..
+# if (__GNUC__ == 2 )
+# if (__GNUC_MINOR__ <= 8 )
+# undef ANTLR_USE_NAMESPACE
+# define ANTLR_USE_NAMESPACE(_x_)
+# undef ANTLR_USING_NAMESPACE
+# define ANTLR_USING_NAMESPACE(_x_)
+# undef ANTLR_CXX_SUPPORTS_NAMESPACE
+# endif
+# if (__GNUC_MINOR__ > 8 && __GNUC_MINOR__ <= 95 )
+# undef ANTLR_IOS_BASE
+# define ANTLR_IOS_BASE ios
+# undef ANTLR_CCTYPE_NEEDS_STD
+// compiling with -ansi ?
+# ifdef __STRICT_ANSI__
+# undef ANTLR_REALLY_NO_STRCASECMP
+# define ANTLR_REALLY_NO_STRCASECMP
+# endif
+# else
+// experimental .96 .97 branches..
+# undef ANTLR_CCTYPE_NEEDS_STD
+# endif
+# endif
+#endif // ! __GNUC__
+/*}}}*/
+/*****************************************************************************/
+/*{{{ Digital CXX (Tru64)
+ *****************************************************************************/
+#ifdef __DECCXX
+#define __USE_STD_IOSTREAM
+#endif
+/*}}}*/
+/*****************************************************************************/
+#ifdef __BORLANDC__
+# if __BORLANDC__ >= 560
+# include <ctype>
+# include <stdlib>
+# define ANTLR_CCTYPE_NEEDS_STD
+# else
+# error "sorry, compiler is too old - consider an update."
+# endif
+#endif
+
+// Redefine these for backwards compatability..
+#undef ANTLR_BEGIN_NAMESPACE
+#undef ANTLR_END_NAMESPACE
+
+#if ANTLR_CXX_SUPPORTS_NAMESPACE == 1
+# define ANTLR_BEGIN_NAMESPACE(_x_) namespace _x_ {
+# define ANTLR_END_NAMESPACE }
+#else
+# define ANTLR_BEGIN_NAMESPACE(_x_)
+# define ANTLR_END_NAMESPACE
+#endif
+
+#endif //INC_config_hpp__
diff --git a/lib/antlr/src/ANTLRUtil.cpp b/lib/antlr/src/ANTLRUtil.cpp
new file mode 100644
index 00000000..30e7ba21
--- /dev/null
+++ b/lib/antlr/src/ANTLRUtil.cpp
@@ -0,0 +1,163 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <antlr/config.hpp>
+#include <antlr/IOException.hpp>
+
+#include <iostream>
+#include <cctype>
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Eat whitespace from the input stream
+ * @param is the stream to read from
+ */
+ANTLR_USE_NAMESPACE(std)istream& eatwhite( ANTLR_USE_NAMESPACE(std)istream& is )
+{
+ char c;
+ while( is.get(c) )
+ {
+#ifdef ANTLR_CCTYPE_NEEDS_STD
+ if( !ANTLR_USE_NAMESPACE(std)isspace(c) )
+#else
+ if( !isspace(c) )
+#endif
+ {
+ is.putback(c);
+ break;
+ }
+ }
+ return is;
+}
+
+/** Read a string enclosed by '"' from a stream. Also handles escaping of \".
+ * Skips leading whitespace.
+ * @param in the istream to read from.
+ * @returns the string read from file exclusive the '"'
+ * @throws IOException if string is badly formatted
+ */
+ANTLR_USE_NAMESPACE(std)string read_string( ANTLR_USE_NAMESPACE(std)istream& in )
+{
+ char ch;
+ ANTLR_USE_NAMESPACE(std)string ret("");
+ // States for a simple state machine...
+ enum { START, READING, ESCAPE, FINISHED };
+ int state = START;
+
+ eatwhite(in);
+
+ while( state != FINISHED && in.get(ch) )
+ {
+ switch( state )
+ {
+ case START:
+ // start state: check wether starting with " then switch to READING
+ if( ch != '"' )
+ throw IOException("string must start with '\"'");
+ state = READING;
+ continue;
+ case READING:
+ // reading state: look out for escape sequences and closing "
+ if( ch == '\\' ) // got escape sequence
+ {
+ state = ESCAPE;
+ continue;
+ }
+ if( ch == '"' ) // close quote -> stop
+ {
+ state = FINISHED;
+ continue;
+ }
+ ret += ch; // else append...
+ continue;
+ case ESCAPE:
+ switch(ch)
+ {
+ case '\\':
+ ret += ch;
+ state = READING;
+ continue;
+ case '"':
+ ret += ch;
+ state = READING;
+ continue;
+ case '0':
+ ret += '\0';
+ state = READING;
+ continue;
+ default: // unrecognized escape is not mapped
+ ret += '\\';
+ ret += ch;
+ state = READING;
+ continue;
+ }
+ }
+ }
+ if( state != FINISHED )
+ throw IOException("badly formatted string: "+ret);
+
+ return ret;
+}
+
+/* Read a ([A-Z][0-9][a-z]_)* kindoff thing. Skips leading whitespace.
+ * @param in the istream to read from.
+ */
+ANTLR_USE_NAMESPACE(std)string read_identifier( ANTLR_USE_NAMESPACE(std)istream& in )
+{
+ char ch;
+ ANTLR_USE_NAMESPACE(std)string ret("");
+
+ eatwhite(in);
+
+ while( in.get(ch) )
+ {
+#ifdef ANTLR_CCTYPE_NEEDS_STD
+ if( ANTLR_USE_NAMESPACE(std)isupper(ch) ||
+ ANTLR_USE_NAMESPACE(std)islower(ch) ||
+ ANTLR_USE_NAMESPACE(std)isdigit(ch) ||
+ ch == '_' )
+#else
+ if( isupper(ch) || islower(ch) || isdigit(ch) || ch == '_' )
+#endif
+ ret += ch;
+ else
+ {
+ in.putback(ch);
+ break;
+ }
+ }
+ return ret;
+}
+
+/** Read a attribute="value" thing. Leading whitespace is skipped.
+ * Between attribute and '=' no whitespace is allowed. After the '=' it is
+ * permitted.
+ * @param in the istream to read from.
+ * @param attribute string the attribute name is put in
+ * @param value string the value of the attribute is put in
+ * @throws IOException if something is fishy. E.g. malformed quoting
+ * or missing '='
+ */
+void read_AttributeNValue( ANTLR_USE_NAMESPACE(std)istream& in,
+ ANTLR_USE_NAMESPACE(std)string& attribute,
+ ANTLR_USE_NAMESPACE(std)string& value )
+{
+ attribute = read_identifier(in);
+
+ char ch;
+ if( in.get(ch) && ch == '=' )
+ value = read_string(in);
+ else
+ throw IOException("invalid attribute=value thing "+attribute);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/ASTFactory.cpp b/lib/antlr/src/ASTFactory.cpp
new file mode 100644
index 00000000..98ce6b7a
--- /dev/null
+++ b/lib/antlr/src/ASTFactory.cpp
@@ -0,0 +1,504 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/CommonAST.hpp"
+#include "antlr/ANTLRException.hpp"
+#include "antlr/IOException.hpp"
+#include "antlr/ASTFactory.hpp"
+#include "antlr/ANTLRUtil.hpp"
+
+#include <iostream>
+#include <istream>
+
+using namespace std;
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** AST Support code shared by TreeParser and Parser.
+ * We use delegation to share code (and have only one
+ * bit of code to maintain) rather than subclassing
+ * or superclassing (forces AST support code to be
+ * loaded even when you don't want to do AST stuff).
+ *
+ * This class collects all factories of AST types used inside the code.
+ * New AST node types are registered with the registerFactory method.
+ * On creation of an ASTFactory object a default AST node factory may be
+ * specified.
+ *
+ * When registering types gaps between different types are filled with entries
+ * for the default factory.
+ */
+
+/// Initialize factory
+ASTFactory::ASTFactory()
+: default_factory_descriptor(ANTLR_USE_NAMESPACE(std)make_pair(CommonAST::TYPE_NAME,&CommonAST::factory))
+{
+ nodeFactories.resize( Token::MIN_USER_TYPE, &default_factory_descriptor );
+}
+
+/** Initialize factory with a non default node type.
+ * factory_node_name should be the name of the AST node type the factory
+ * generates. (should exist during the existance of this ASTFactory instance)
+ */
+ASTFactory::ASTFactory( const char* factory_node_name, factory_type fact )
+: default_factory_descriptor(ANTLR_USE_NAMESPACE(std)make_pair(factory_node_name, fact))
+{
+ nodeFactories.resize( Token::MIN_USER_TYPE, &default_factory_descriptor );
+}
+
+/// Delete ASTFactory
+ASTFactory::~ASTFactory()
+{
+ factory_descriptor_list::iterator i = nodeFactories.begin();
+
+ while( i != nodeFactories.end() )
+ {
+ if( *i != &default_factory_descriptor )
+ delete *i;
+ i++;
+ }
+}
+
+/// Register a factory for a given AST type
+void ASTFactory::registerFactory( int type, const char* ast_name, factory_type factory )
+{
+ // check validity of arguments...
+ if( type < Token::MIN_USER_TYPE )
+ throw ANTLRException("Internal parser error invalid type passed to RegisterFactory");
+ if( factory == 0 )
+ throw ANTLRException("Internal parser error 0 factory passed to RegisterFactory");
+
+ // resize up to and including 'type' and initalize any gaps to default
+ // factory.
+ if( nodeFactories.size() < (static_cast<unsigned int>(type)+1) )
+ nodeFactories.resize( type+1, &default_factory_descriptor );
+
+ // And add new thing..
+ nodeFactories[type] = new ANTLR_USE_NAMESPACE(std)pair<const char*, factory_type>( ast_name, factory );
+}
+
+void ASTFactory::setMaxNodeType( int type )
+{
+ if( nodeFactories.size() < (static_cast<unsigned int>(type)+1) )
+ nodeFactories.resize( type+1, &default_factory_descriptor );
+}
+
+/** Create a new empty AST node; if the user did not specify
+ * an AST node type, then create a default one: CommonAST.
+ */
+RefAST ASTFactory::create()
+{
+ RefAST node = nodeFactories[0]->second();
+ node->setType(Token::INVALID_TYPE);
+ return node;
+}
+
+RefAST ASTFactory::create(int type)
+{
+ RefAST t = nodeFactories[type]->second();
+ t->initialize(type,"");
+ return t;
+}
+
+RefAST ASTFactory::create(int type, const ANTLR_USE_NAMESPACE(std)string& txt)
+{
+ RefAST t = nodeFactories[type]->second();
+ t->initialize(type,txt);
+ return t;
+}
+
+#ifdef ANTLR_SUPPORT_XML
+RefAST ASTFactory::create(const ANTLR_USE_NAMESPACE(std)string& type_name, ANTLR_USE_NAMESPACE(std)istream& infile )
+{
+ factory_descriptor_list::iterator fact = nodeFactories.begin();
+
+ while( fact != nodeFactories.end() )
+ {
+ if( type_name == (*fact)->first )
+ {
+ RefAST t = (*fact)->second();
+ t->initialize(infile);
+ return t;
+ }
+ fact++;
+ }
+
+ string error = "ASTFactory::create: Unknown AST type '" + type_name + "'";
+ throw ANTLRException(error);
+}
+#endif
+
+/** Create a new empty AST node; if the user did not specify
+ * an AST node type, then create a default one: CommonAST.
+ */
+RefAST ASTFactory::create(RefAST tr)
+{
+ if (!tr)
+ return nullAST;
+
+// cout << "create(tr)" << endl;
+
+ RefAST t = nodeFactories[tr->getType()]->second();
+ t->initialize(tr);
+ return t;
+}
+
+RefAST ASTFactory::create(RefToken tok)
+{
+// cout << "create( tok="<< tok->getType() << ", " << tok->getText() << ")" << nodeFactories.size() << endl;
+ RefAST t = nodeFactories[tok->getType()]->second();
+ t->initialize(tok);
+ return t;
+}
+
+/** Add a child to the current AST */
+void ASTFactory::addASTChild(ASTPair& currentAST, RefAST child)
+{
+ if (child)
+ {
+ if (!currentAST.root)
+ {
+ // Make new child the current root
+ currentAST.root = child;
+ }
+ else
+ {
+ if (!currentAST.child)
+ {
+ // Add new child to current root
+ currentAST.root->setFirstChild(child);
+ }
+ else
+ {
+ currentAST.child->setNextSibling(child);
+ }
+ }
+ // Make new child the current child
+ currentAST.child = child;
+ currentAST.advanceChildToEnd();
+ }
+}
+
+/** Deep copy a single node. This function the new clone() methods in the AST
+ * interface. Returns nullAST if t is null.
+ */
+RefAST ASTFactory::dup(RefAST t)
+{
+ if( t )
+ return t->clone();
+ else
+ return RefAST(nullASTptr);
+}
+
+/** Duplicate tree including siblings of root. */
+RefAST ASTFactory::dupList(RefAST t)
+{
+ RefAST result = dupTree(t); // if t == null, then result==null
+ RefAST nt = result;
+
+ while( t )
+ { // for each sibling of the root
+ t = t->getNextSibling();
+ nt->setNextSibling(dupTree(t)); // dup each subtree, building new tree
+ nt = nt->getNextSibling();
+ }
+ return result;
+}
+
+/** Duplicate a tree, assuming this is a root node of a tree
+ * duplicate that node and what's below; ignore siblings of root node.
+ */
+RefAST ASTFactory::dupTree(RefAST t)
+{
+ RefAST result = dup(t); // make copy of root
+ // copy all children of root.
+ if( t )
+ result->setFirstChild( dupList(t->getFirstChild()) );
+ return result;
+}
+
+/** Make a tree from a list of nodes. The first element in the
+ * array is the root. If the root is null, then the tree is
+ * a simple list not a tree. Handles null children nodes correctly.
+ * For example, make(a, b, null, c) yields tree (a b c). make(null,a,b)
+ * yields tree (nil a b).
+ */
+RefAST ASTFactory::make(ANTLR_USE_NAMESPACE(std)vector<RefAST>& nodes)
+{
+ if ( nodes.size() == 0 )
+ return RefAST(nullASTptr);
+
+ RefAST root = nodes[0];
+ RefAST tail = RefAST(nullASTptr);
+
+ if( root )
+ root->setFirstChild(RefAST(nullASTptr)); // don't leave any old pointers set
+
+ // link in children;
+ for( unsigned int i = 1; i < nodes.size(); i++ )
+ {
+ if ( nodes[i] == 0 ) // ignore null nodes
+ continue;
+
+ if ( root == 0 ) // Set the root and set it up for a flat list
+ root = tail = nodes[i];
+ else if ( tail == 0 )
+ {
+ root->setFirstChild(nodes[i]);
+ tail = root->getFirstChild();
+ }
+ else
+ {
+ tail->setNextSibling(nodes[i]);
+ tail = tail->getNextSibling();
+ }
+
+ if( tail ) // RK: I cannot fathom why this missing check didn't bite anyone else...
+ {
+ // Chase tail to last sibling
+ while (tail->getNextSibling())
+ tail = tail->getNextSibling();
+ }
+ }
+
+ return root;
+}
+
+/** Make a tree from a list of nodes, where the nodes are contained
+ * in an ASTArray object
+ */
+RefAST ASTFactory::make(ASTArray* nodes)
+{
+ RefAST ret = make(nodes->array);
+ delete nodes;
+ return ret;
+}
+
+/// Make an AST the root of current AST
+void ASTFactory::makeASTRoot( ASTPair& currentAST, RefAST root )
+{
+ if (root)
+ {
+ // Add the current root as a child of new root
+ root->addChild(currentAST.root);
+ // The new current child is the last sibling of the old root
+ currentAST.child = currentAST.root;
+ currentAST.advanceChildToEnd();
+ // Set the new root
+ currentAST.root = root;
+ }
+}
+
+void ASTFactory::setASTNodeFactory( const char* factory_node_name,
+ factory_type factory )
+{
+ default_factory_descriptor.first = factory_node_name;
+ default_factory_descriptor.second = factory;
+}
+
+#ifdef ANTLR_SUPPORT_XML
+bool ASTFactory::checkCloseTag( ANTLR_USE_NAMESPACE(std)istream& in )
+{
+ char ch;
+
+ if( in.get(ch) )
+ {
+ if( ch == '<' )
+ {
+ char ch2;
+ if( in.get(ch2) )
+ {
+ if( ch2 == '/' )
+ {
+ in.putback(ch2);
+ in.putback(ch);
+ return true;
+ }
+ in.putback(ch2);
+ in.putback(ch);
+ return false;
+ }
+ }
+ in.putback(ch);
+ return false;
+ }
+ return false;
+}
+
+void ASTFactory::loadChildren( ANTLR_USE_NAMESPACE(std)istream& infile,
+ RefAST current )
+{
+ char ch;
+
+ for(;;) // for all children of this node....
+ {
+ eatwhite(infile);
+
+ infile.get(ch); // '<'
+ if( ch != '<' )
+ {
+ string error = "Invalid XML file... no '<' found (";
+ error += ch + ")";
+ throw IOException(error);
+ }
+
+ infile.get(ch); // / or text....
+
+ if( ch == '/' ) // check for close tag...
+ {
+ string temp;
+
+ // read until '>' and see if it matches the open tag... if not trouble
+ temp = read_identifier( infile );
+
+ if( strcmp(temp.c_str(), current->typeName() ) != 0 )
+ {
+ string error = "Invalid XML file... close tag does not match start tag: ";
+ error += current->typeName();
+ error += " closed by " + temp;
+ throw IOException(error);
+ }
+
+ infile.get(ch); // must be a '>'
+
+ if( ch != '>' )
+ {
+ string error = "Invalid XML file... no '>' found (";
+ error += ch + ")";
+ throw IOException(error);
+ }
+ // close tag => exit loop
+ break;
+ }
+
+ // put our 'look ahead' back where it came from
+ infile.putback(ch);
+ infile.putback('<');
+
+ // and recurse into the tree...
+ RefAST child = LoadAST(infile);
+
+ current->addChild( child );
+ }
+}
+
+void ASTFactory::loadSiblings(ANTLR_USE_NAMESPACE(std)istream& infile,
+ RefAST current )
+{
+ for(;;)
+ {
+ eatwhite(infile);
+
+ if( infile.eof() )
+ break;
+
+ if( checkCloseTag(infile) )
+ break;
+
+ RefAST sibling = LoadAST(infile);
+ current->setNextSibling(sibling);
+ }
+}
+
+RefAST ASTFactory::LoadAST( ANTLR_USE_NAMESPACE(std)istream& infile )
+{
+ RefAST current = nullAST;
+ char ch;
+
+ eatwhite(infile);
+
+ if( !infile.get(ch) )
+ return nullAST;
+
+ if( ch != '<' )
+ {
+ string error = "Invalid XML file... no '<' found (";
+ error += ch + ")";
+ throw IOException(error);
+ }
+
+ string ast_type = read_identifier(infile);
+
+ // create the ast of type 'ast_type'
+ current = create( ast_type, infile );
+ if( current == nullAST )
+ {
+ string error = "Unsuported AST type: " + ast_type;
+ throw IOException(error);
+ }
+
+ eatwhite(infile);
+
+ infile.get(ch);
+
+ // now if we have a '/' here it's a single node. If it's a '>' we get
+ // a tree with children
+
+ if( ch == '/' )
+ {
+ infile.get(ch); // get the closing '>'
+ if( ch != '>' )
+ {
+ string error = "Invalid XML file... no '>' found after '/' (";
+ error += ch + ")";
+ throw IOException(error);
+ }
+
+ // get the rest on this level
+ loadSiblings( infile, current );
+
+ return current;
+ }
+
+ // and finaly see if we got the close tag...
+ if( ch != '>' )
+ {
+ string error = "Invalid XML file... no '>' found (";
+ error += ch + ")";
+ throw IOException(error);
+ }
+
+ // handle the ones below this level..
+ loadChildren( infile, current );
+
+ // load the rest on this level...
+ loadSiblings( infile, current );
+
+ return current;
+}
+#endif // ANTLR_SUPPORT_XML
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
+/* Heterogeneous AST/XML-I/O ramblings...
+ *
+ * So there is some heterogeneous AST support....
+ * basically in the code generators a new custom ast is generated without
+ * going throug the factory. It also expects the RefXAST to be defined.
+ *
+ * Is it maybe better to register all AST types with the ASTFactory class
+ * together with the respective factory methods.
+ *
+ * More and more I get the impression that hetero ast was a kindoff hack
+ * on top of ANTLR's normal AST system.
+ *
+ * The heteroast stuff will generate trouble for all astFactory.create( ... )
+ * invocations. Most of this is handled via getASTCreateString methods in the
+ * codegenerator. At the moment getASTCreateString(GrammarAtom, String) has
+ * slightly to little info to do it's job (ok the hack that is in now
+ * works, but it's an ugly hack)
+ *
+ * An extra caveat is the 'nice' action.g thing. Which also judiciously calls
+ * getASTCreateString methods because it handles the #( ... ) syntax.
+ * And converts that to ASTFactory calls.
+ *
+ *
+ */
diff --git a/lib/antlr/src/ASTNULLType.cpp b/lib/antlr/src/ASTNULLType.cpp
new file mode 100644
index 00000000..7dd62724
--- /dev/null
+++ b/lib/antlr/src/ASTNULLType.cpp
@@ -0,0 +1,157 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/config.hpp"
+#include "antlr/AST.hpp"
+#include "antlr/ASTNULLType.hpp"
+
+#include <iostream>
+
+ANTLR_USING_NAMESPACE(std)
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+RefAST ASTNULLType::clone( void ) const
+{
+ return RefAST(this);
+}
+
+void ASTNULLType::addChild( RefAST )
+{
+}
+
+size_t ASTNULLType::getNumberOfChildren() const
+{
+ return 0;
+}
+
+bool ASTNULLType::equals( RefAST ) const
+{
+ return false;
+}
+
+bool ASTNULLType::equalsList( RefAST ) const
+{
+ return false;
+}
+
+bool ASTNULLType::equalsListPartial( RefAST ) const
+{
+ return false;
+}
+
+bool ASTNULLType::equalsTree( RefAST ) const
+{
+ return false;
+}
+
+bool ASTNULLType::equalsTreePartial( RefAST ) const
+{
+ return false;
+}
+
+vector<RefAST> ASTNULLType::findAll( RefAST )
+{
+ return vector<RefAST>();
+}
+
+vector<RefAST> ASTNULLType::findAllPartial( RefAST )
+{
+ return vector<RefAST>();
+}
+
+RefAST ASTNULLType::getFirstChild() const
+{
+ return this;
+}
+
+RefAST ASTNULLType::getNextSibling() const
+{
+ return this;
+}
+
+string ASTNULLType::getText() const
+{
+ return "<ASTNULL>";
+}
+
+int ASTNULLType::getType() const
+{
+ return Token::NULL_TREE_LOOKAHEAD;
+}
+
+void ASTNULLType::initialize( int, const string& )
+{
+}
+
+void ASTNULLType::initialize( RefAST )
+{
+}
+
+void ASTNULLType::initialize( RefToken )
+{
+}
+
+#ifdef ANTLR_SUPPORT_XML
+void ASTNULLType::initialize( istream& )
+{
+}
+#endif
+
+void ASTNULLType::setFirstChild( RefAST )
+{
+}
+
+void ASTNULLType::setNextSibling( RefAST )
+{
+}
+
+void ASTNULLType::setText( const string& )
+{
+}
+
+void ASTNULLType::setType( int )
+{
+}
+
+string ASTNULLType::toString() const
+{
+ return getText();
+}
+
+string ASTNULLType::toStringList() const
+{
+ return getText();
+}
+
+string ASTNULLType::toStringTree() const
+{
+ return getText();
+}
+
+#ifdef ANTLR_SUPPORT_XML
+bool ASTNULLType::attributesToStream( ostream& ) const
+{
+ return false;
+}
+
+void ASTNULLType::toStream( ostream& out ) const
+{
+ out << "</ASTNULL>" << endl;
+}
+#endif
+
+const char* ASTNULLType::typeName( void ) const
+{
+ return "ASTNULLType";
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/ASTRefCount.cpp b/lib/antlr/src/ASTRefCount.cpp
new file mode 100644
index 00000000..0ca54df0
--- /dev/null
+++ b/lib/antlr/src/ASTRefCount.cpp
@@ -0,0 +1,41 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/ASTRefCount.hpp"
+#include "antlr/AST.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+ASTRef::ASTRef(AST* p)
+: ptr(p), count(1)
+{
+ if (p && !p->ref)
+ p->ref = this;
+}
+
+ASTRef::~ASTRef()
+{
+ delete ptr;
+}
+
+ASTRef* ASTRef::getRef(const AST* p)
+{
+ if (p) {
+ AST* pp = const_cast<AST*>(p);
+ if (pp->ref)
+ return pp->ref->increment();
+ else
+ return new ASTRef(pp);
+ } else
+ return 0;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/BaseAST.cpp b/lib/antlr/src/BaseAST.cpp
new file mode 100644
index 00000000..f10f1e16
--- /dev/null
+++ b/lib/antlr/src/BaseAST.cpp
@@ -0,0 +1,281 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/config.hpp"
+
+#include <iostream>
+
+#include "antlr/AST.hpp"
+#include "antlr/BaseAST.hpp"
+
+ANTLR_USING_NAMESPACE(std)
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+size_t BaseAST::getNumberOfChildren() const
+{
+ RefBaseAST t = this->down;
+ size_t n = 0;
+ if( t )
+ {
+ n = 1;
+ while( t->right )
+ {
+ t = t->right;
+ n++;
+ }
+ return n;
+ }
+ return n;
+}
+
+void BaseAST::doWorkForFindAll(
+ ANTLR_USE_NAMESPACE(std)vector<RefAST>& v,
+ RefAST target,bool partialMatch)
+{
+ // Start walking sibling lists, looking for matches.
+ for (RefAST sibling=this;
+ sibling;
+ sibling=sibling->getNextSibling())
+ {
+ if ( (partialMatch && sibling->equalsTreePartial(target)) ||
+ (!partialMatch && sibling->equalsTree(target)) ) {
+ v.push_back(sibling);
+ }
+ // regardless of match or not, check any children for matches
+ if ( sibling->getFirstChild() ) {
+ RefBaseAST(sibling->getFirstChild())->doWorkForFindAll(v, target, partialMatch);
+ }
+ }
+}
+
+/** Is t an exact structural and equals() match of this tree. The
+ * 'this' reference is considered the start of a sibling list.
+ */
+bool BaseAST::equalsList(RefAST t) const
+{
+ // the empty tree is not a match of any non-null tree.
+ if (!t)
+ return false;
+
+ // Otherwise, start walking sibling lists. First mismatch, return false.
+ RefAST sibling=this;
+ for (;sibling && t;
+ sibling=sibling->getNextSibling(), t=t->getNextSibling()) {
+ // as a quick optimization, check roots first.
+ if (!sibling->equals(t))
+ return false;
+ // if roots match, do full list match test on children.
+ if (sibling->getFirstChild()) {
+ if (!sibling->getFirstChild()->equalsList(t->getFirstChild()))
+ return false;
+ }
+ // sibling has no kids, make sure t doesn't either
+ else if (t->getFirstChild())
+ return false;
+ }
+
+ if (!sibling && !t)
+ return true;
+
+ // one sibling list has more than the other
+ return false;
+}
+
+/** Is 'sub' a subtree of this list?
+ * The siblings of the root are NOT ignored.
+ */
+bool BaseAST::equalsListPartial(RefAST sub) const
+{
+ // the empty tree is always a subset of any tree.
+ if (!sub)
+ return true;
+
+ // Otherwise, start walking sibling lists. First mismatch, return false.
+ RefAST sibling=this;
+ for (;sibling && sub;
+ sibling=sibling->getNextSibling(), sub=sub->getNextSibling()) {
+ // as a quick optimization, check roots first.
+ if (!sibling->equals(sub))
+ return false;
+ // if roots match, do partial list match test on children.
+ if (sibling->getFirstChild())
+ if (!sibling->getFirstChild()->equalsListPartial(sub->getFirstChild()))
+ return false;
+ }
+
+ if (!sibling && sub)
+ // nothing left to match in this tree, but subtree has more
+ return false;
+
+ // either both are null or sibling has more, but subtree doesn't
+ return true;
+}
+
+/** Is tree rooted at 'this' equal to 't'? The siblings
+ * of 'this' are ignored.
+ */
+bool BaseAST::equalsTree(RefAST t) const
+{
+ // check roots first
+ if (!equals(t))
+ return false;
+ // if roots match, do full list match test on children.
+ if (getFirstChild()) {
+ if (!getFirstChild()->equalsList(t->getFirstChild()))
+ return false;
+ }
+ // sibling has no kids, make sure t doesn't either
+ else if (t->getFirstChild())
+ return false;
+
+ return true;
+}
+
+/** Is 'sub' a subtree of the tree rooted at 'this'? The siblings
+ * of 'this' are ignored.
+ */
+bool BaseAST::equalsTreePartial(RefAST sub) const
+{
+ // the empty tree is always a subset of any tree.
+ if (!sub)
+ return true;
+
+ // check roots first
+ if (!equals(sub))
+ return false;
+ // if roots match, do full list partial match test on children.
+ if (getFirstChild())
+ if (!getFirstChild()->equalsListPartial(sub->getFirstChild()))
+ return false;
+
+ return true;
+}
+
+/** Walk the tree looking for all exact subtree matches. Return
+ * an ASTEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ANTLR_USE_NAMESPACE(std)vector<RefAST> BaseAST::findAll(RefAST target)
+{
+ ANTLR_USE_NAMESPACE(std)vector<RefAST> roots;
+
+ // the empty tree cannot result in an enumeration
+ if (target) {
+ doWorkForFindAll(roots,target,false); // find all matches recursively
+ }
+
+ return roots;
+}
+
+/** Walk the tree looking for all subtrees. Return
+ * an ASTEnumerator that lets the caller walk the list
+ * of subtree roots found herein.
+ */
+ANTLR_USE_NAMESPACE(std)vector<RefAST> BaseAST::findAllPartial(RefAST target)
+{
+ ANTLR_USE_NAMESPACE(std)vector<RefAST> roots;
+
+ // the empty tree cannot result in an enumeration
+ if (target)
+ doWorkForFindAll(roots,target,true); // find all matches recursively
+
+ return roots;
+}
+
+ANTLR_USE_NAMESPACE(std)string BaseAST::toStringList() const
+{
+ ANTLR_USE_NAMESPACE(std)string ts="";
+
+ if (getFirstChild())
+ {
+ ts+=" ( ";
+ ts+=toString();
+ ts+=getFirstChild()->toStringList();
+ ts+=" )";
+ }
+ else
+ {
+ ts+=" ";
+ ts+=toString();
+ }
+
+ if (getNextSibling())
+ ts+=getNextSibling()->toStringList();
+
+ return ts;
+}
+
+ANTLR_USE_NAMESPACE(std)string BaseAST::toStringTree() const
+{
+ ANTLR_USE_NAMESPACE(std)string ts = "";
+
+ if (getFirstChild())
+ {
+ ts+=" ( ";
+ ts+=toString();
+ ts+=getFirstChild()->toStringList();
+ ts+=" )";
+ }
+ else
+ {
+ ts+=" ";
+ ts+=toString();
+ }
+ return ts;
+}
+
+#ifdef ANTLR_SUPPORT_XML
+/* This whole XML output stuff needs a little bit more thought
+ * I'd like to store extra XML data in the node. e.g. for custom ast's
+ * with for instance symboltable references. This
+ * should be more pluggable..
+ * @returns boolean value indicating wether a closetag should be produced.
+ */
+bool BaseAST::attributesToStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const
+{
+ out << "text=\"" << this->getText()
+ << "\" type=\"" << this->getType() << "\"";
+
+ return false;
+}
+
+void BaseAST::toStream( ANTLR_USE_NAMESPACE(std)ostream& out ) const
+{
+ for( RefAST node = this; node != 0; node = node->getNextSibling() )
+ {
+ out << "<" << this->typeName() << " ";
+
+ // Write out attributes and if there is extra data...
+ bool need_close_tag = node->attributesToStream( out );
+
+ if( need_close_tag )
+ {
+ // got children so write them...
+ if( node->getFirstChild() != 0 )
+ node->getFirstChild()->toStream( out );
+
+ // and a closing tag..
+ out << "</" << node->typeName() << ">" << endl;
+ }
+ }
+}
+#endif
+
+// this is nasty, but it makes the code generation easier
+ANTLR_API RefAST nullAST;
+
+#if defined(_MSC_VER) && !defined(__ICL) // Microsoft Visual C++
+extern ANTLR_API AST* const nullASTptr = 0;
+#else
+ANTLR_API AST* const nullASTptr = 0;
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/BitSet.cpp b/lib/antlr/src/BitSet.cpp
new file mode 100644
index 00000000..2a32404a
--- /dev/null
+++ b/lib/antlr/src/BitSet.cpp
@@ -0,0 +1,62 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/BitSet.hpp"
+#include <string>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+BitSet::BitSet(unsigned int nbits)
+: storage(nbits)
+{
+ for (unsigned int i = 0; i < nbits ; i++ )
+ storage[i] = false;
+}
+
+BitSet::BitSet( const unsigned long* bits_, unsigned int nlongs )
+: storage(nlongs*32)
+{
+ for ( unsigned int i = 0 ; i < (nlongs * 32); i++)
+ storage[i] = (bits_[i>>5] & (1UL << (i&31))) ? true : false;
+}
+
+BitSet::~BitSet()
+{
+}
+
+void BitSet::add(unsigned int el)
+{
+ if( el >= storage.size() )
+ storage.resize( el+1, false );
+
+ storage[el] = true;
+}
+
+bool BitSet::member(unsigned int el) const
+{
+ if ( el >= storage.size())
+ return false;
+
+ return storage[el];
+}
+
+ANTLR_USE_NAMESPACE(std)vector<unsigned int> BitSet::toArray() const
+{
+ ANTLR_USE_NAMESPACE(std)vector<unsigned int> elems;
+ for (unsigned int i = 0; i < storage.size(); i++)
+ {
+ if (storage[i])
+ elems.push_back(i);
+ }
+
+ return elems;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/CharBuffer.cpp b/lib/antlr/src/CharBuffer.cpp
new file mode 100644
index 00000000..a0e11eae
--- /dev/null
+++ b/lib/antlr/src/CharBuffer.cpp
@@ -0,0 +1,52 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/CharBuffer.hpp"
+#include <iostream>
+
+//#include <ios>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/* RK: Per default istream does not throw exceptions. This can be
+ * enabled with:
+ * stream.exceptions(ios_base::badbit|ios_base::failbit|ios_base::eofbit);
+ *
+ * We could try catching the bad/fail stuff. But handling eof via this is
+ * not a good idea. EOF is best handled as a 'normal' character.
+ *
+ * So this does not work yet with gcc... Comment it until I get to a platform
+ * that does..
+ */
+
+/** Create a character buffer. Enable fail and bad exceptions, if supported
+ * by platform. */
+CharBuffer::CharBuffer(ANTLR_USE_NAMESPACE(std)istream& input_)
+: input(input_)
+{
+// input.exceptions(ANTLR_USE_NAMESPACE(std)ios_base::badbit|
+// ANTLR_USE_NAMESPACE(std)ios_base::failbit);
+}
+
+/** Get the next character from the stream. May throw CharStreamIOException
+ * when something bad happens (not EOF) (if supported by platform).
+ */
+int CharBuffer::getChar()
+{
+// try {
+ return input.get();
+// }
+// catch (ANTLR_USE_NAMESPACE(std)ios_base::failure& e) {
+// throw CharStreamIOException(e);
+// }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/CharScanner.cpp b/lib/antlr/src/CharScanner.cpp
new file mode 100644
index 00000000..d5b1f753
--- /dev/null
+++ b/lib/antlr/src/CharScanner.cpp
@@ -0,0 +1,108 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include <iostream>
+
+#include "antlr/CharScanner.hpp"
+#include "antlr/CommonToken.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+ANTLR_C_USING(exit)
+
+CharScanner::CharScanner(InputBuffer& cb, bool case_sensitive )
+ : saveConsumedInput(true) //, caseSensitiveLiterals(true)
+ , caseSensitive(case_sensitive)
+ , literals(CharScannerLiteralsLess(this))
+ , inputState(new LexerInputState(cb))
+ , commitToPath(false)
+ , tabsize(8)
+ , traceDepth(0)
+{
+ setTokenObjectFactory(&CommonToken::factory);
+}
+
+CharScanner::CharScanner(InputBuffer* cb, bool case_sensitive )
+ : saveConsumedInput(true) //, caseSensitiveLiterals(true)
+ , caseSensitive(case_sensitive)
+ , literals(CharScannerLiteralsLess(this))
+ , inputState(new LexerInputState(cb))
+ , commitToPath(false)
+ , tabsize(8)
+ , traceDepth(0)
+{
+ setTokenObjectFactory(&CommonToken::factory);
+}
+
+CharScanner::CharScanner( const LexerSharedInputState& state, bool case_sensitive )
+ : saveConsumedInput(true) //, caseSensitiveLiterals(true)
+ , caseSensitive(case_sensitive)
+ , literals(CharScannerLiteralsLess(this))
+ , inputState(state)
+ , commitToPath(false)
+ , tabsize(8)
+ , traceDepth(0)
+{
+ setTokenObjectFactory(&CommonToken::factory);
+}
+
+/** Report exception errors caught in nextToken() */
+void CharScanner::reportError(const RecognitionException& ex)
+{
+ ANTLR_USE_NAMESPACE(std)cerr << ex.toString().c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser error-reporting function can be overridden in subclass */
+void CharScanner::reportError(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ if (getFilename() == "")
+ ANTLR_USE_NAMESPACE(std)cerr << "error: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+ else
+ ANTLR_USE_NAMESPACE(std)cerr << getFilename().c_str() << ": error: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser warning-reporting function can be overridden in subclass */
+void CharScanner::reportWarning(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ if (getFilename() == "")
+ ANTLR_USE_NAMESPACE(std)cerr << "warning: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+ else
+ ANTLR_USE_NAMESPACE(std)cerr << getFilename().c_str() << ": warning: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+void CharScanner::traceIndent()
+{
+ for( int i = 0; i < traceDepth; i++ )
+ ANTLR_USE_NAMESPACE(std)cout << " ";
+}
+
+void CharScanner::traceIn(const char* rname)
+{
+ traceDepth++;
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "> lexer " << rname
+ << "; c==" << LA(1) << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+void CharScanner::traceOut(const char* rname)
+{
+ traceIndent();
+ ANTLR_USE_NAMESPACE(std)cout << "< lexer " << rname
+ << "; c==" << LA(1) << ANTLR_USE_NAMESPACE(std)endl;
+ traceDepth--;
+}
+
+#ifndef NO_STATIC_CONSTS
+const int CharScanner::NO_CHAR;
+const int CharScanner::EOF_CHAR;
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/CommonAST.cpp b/lib/antlr/src/CommonAST.cpp
new file mode 100644
index 00000000..e132c0aa
--- /dev/null
+++ b/lib/antlr/src/CommonAST.cpp
@@ -0,0 +1,49 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/config.hpp"
+
+#include <cstdlib>
+#include <iostream>
+
+#include "antlr/CommonAST.hpp"
+#include "antlr/ANTLRUtil.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+const char* const CommonAST::TYPE_NAME = "CommonAST";
+
+#ifdef ANTLR_SUPPORT_XML
+void CommonAST::initialize( ANTLR_USE_NAMESPACE(std)istream& in )
+{
+ ANTLR_USE_NAMESPACE(std)string t1, t2, text;
+
+ // text
+ read_AttributeNValue( in, t1, text );
+
+ read_AttributeNValue( in, t1, t2 );
+#ifdef ANTLR_ATOI_IN_STD
+ int type = ANTLR_USE_NAMESPACE(std)atoi(t2.c_str());
+#else
+ int type = atoi(t2.c_str());
+#endif
+
+ // initialize first part of AST.
+ this->initialize( type, text );
+}
+#endif
+
+RefAST CommonAST::factory()
+{
+ return RefAST(new CommonAST);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/CommonASTWithHiddenTokens.cpp b/lib/antlr/src/CommonASTWithHiddenTokens.cpp
new file mode 100644
index 00000000..b0e1a3dd
--- /dev/null
+++ b/lib/antlr/src/CommonASTWithHiddenTokens.cpp
@@ -0,0 +1,64 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/config.hpp"
+#include "antlr/AST.hpp"
+#include "antlr/BaseAST.hpp"
+#include "antlr/CommonAST.hpp"
+#include "antlr/CommonASTWithHiddenTokens.hpp"
+#include "antlr/CommonHiddenStreamToken.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+const char* const CommonASTWithHiddenTokens::TYPE_NAME = "CommonASTWithHiddenTokens";
+// RK: Do not put constructor and destructor into the header file here..
+// this triggers something very obscure in gcc 2.95.3 (and 3.0)
+// missing vtables and stuff.
+// Although this may be a problem with with binutils.
+CommonASTWithHiddenTokens::CommonASTWithHiddenTokens()
+: CommonAST()
+{
+}
+
+CommonASTWithHiddenTokens::~CommonASTWithHiddenTokens()
+{
+}
+
+void CommonASTWithHiddenTokens::initialize(int t,const ANTLR_USE_NAMESPACE(std)string& txt)
+{
+ CommonAST::initialize(t,txt);
+}
+
+void CommonASTWithHiddenTokens::initialize(RefAST t)
+{
+ CommonAST::initialize(t);
+ hiddenBefore = RefCommonASTWithHiddenTokens(t)->getHiddenBefore();
+ hiddenAfter = RefCommonASTWithHiddenTokens(t)->getHiddenAfter();
+}
+
+void CommonASTWithHiddenTokens::initialize(RefToken t)
+{
+ CommonAST::initialize(t);
+ hiddenBefore = static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenBefore();
+ hiddenAfter = static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenAfter();
+}
+
+RefAST CommonASTWithHiddenTokens::factory()
+{
+ return RefAST(new CommonASTWithHiddenTokens);
+}
+
+RefAST CommonASTWithHiddenTokens::clone( void ) const
+{
+ CommonASTWithHiddenTokens *ast = new CommonASTWithHiddenTokens( *this );
+ return RefAST(ast);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/CommonHiddenStreamToken.cpp b/lib/antlr/src/CommonHiddenStreamToken.cpp
new file mode 100644
index 00000000..9396a43b
--- /dev/null
+++ b/lib/antlr/src/CommonHiddenStreamToken.cpp
@@ -0,0 +1,56 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/CommonHiddenStreamToken.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+CommonHiddenStreamToken::CommonHiddenStreamToken()
+: CommonToken()
+{
+}
+
+CommonHiddenStreamToken::CommonHiddenStreamToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
+: CommonToken(t,txt)
+{
+}
+
+CommonHiddenStreamToken::CommonHiddenStreamToken(const ANTLR_USE_NAMESPACE(std)string& s)
+: CommonToken(s)
+{
+}
+
+RefToken CommonHiddenStreamToken::getHiddenAfter()
+{
+ return hiddenAfter;
+}
+
+RefToken CommonHiddenStreamToken::getHiddenBefore()
+{
+ return hiddenBefore;
+}
+
+RefToken CommonHiddenStreamToken::factory()
+{
+ return RefToken(new CommonHiddenStreamToken);
+}
+
+void CommonHiddenStreamToken::setHiddenAfter(RefToken t)
+{
+ hiddenAfter = t;
+}
+
+void CommonHiddenStreamToken::setHiddenBefore(RefToken t)
+{
+ hiddenBefore = t;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/CommonToken.cpp b/lib/antlr/src/CommonToken.cpp
new file mode 100644
index 00000000..a223b239
--- /dev/null
+++ b/lib/antlr/src/CommonToken.cpp
@@ -0,0 +1,45 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/CommonToken.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+CommonToken::CommonToken() : Token(), line(1), col(1), text("")
+{}
+
+CommonToken::CommonToken(int t, const ANTLR_USE_NAMESPACE(std)string& txt)
+: Token(t)
+, line(1)
+, col(1)
+, text(txt)
+{}
+
+CommonToken::CommonToken(const ANTLR_USE_NAMESPACE(std)string& s)
+: Token()
+, line(1)
+, col(1)
+, text(s)
+{}
+
+ANTLR_USE_NAMESPACE(std)string CommonToken::toString() const
+{
+ return "[\""+getText()+"\",<"+getType()+">,line="+getLine()+",column="+getColumn()+"]";
+}
+
+RefToken CommonToken::factory()
+{
+ return RefToken(new CommonToken);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/InputBuffer.cpp b/lib/antlr/src/InputBuffer.cpp
new file mode 100644
index 00000000..c9eced7d
--- /dev/null
+++ b/lib/antlr/src/InputBuffer.cpp
@@ -0,0 +1,81 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/config.hpp"
+#include "antlr/InputBuffer.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** Ensure that the character buffer is sufficiently full */
+void InputBuffer::fill(unsigned int amount)
+{
+ syncConsume();
+ // Fill the buffer sufficiently to hold needed characters
+ while (queue.entries() < amount + markerOffset)
+ {
+ // Append the next character
+ queue.append(getChar());
+ }
+}
+
+/** get the current lookahead characters as a string
+ * @warning it may treat 0 and EOF values wrong
+ */
+ANTLR_USE_NAMESPACE(std)string InputBuffer::getLAChars( void ) const
+{
+ ANTLR_USE_NAMESPACE(std)string ret;
+
+ for(unsigned int i = markerOffset; i < queue.entries(); i++)
+ ret += queue.elementAt(i);
+
+ return ret;
+}
+
+/** get the current marked characters as a string
+ * @warning it may treat 0 and EOF values wrong
+ */
+ANTLR_USE_NAMESPACE(std)string InputBuffer::getMarkedChars( void ) const
+{
+ ANTLR_USE_NAMESPACE(std)string ret;
+
+ for(unsigned int i = 0; i < markerOffset; i++)
+ ret += queue.elementAt(i);
+
+ return ret;
+}
+
+/** Return an integer marker that can be used to rewind the buffer to
+ * its current state.
+ */
+unsigned int InputBuffer::mark()
+{
+ syncConsume();
+ nMarkers++;
+ return markerOffset;
+}
+
+/** Rewind the character buffer to a marker.
+ * @param mark Marker returned previously from mark()
+ */
+void InputBuffer::rewind(unsigned int mark)
+{
+ syncConsume();
+ markerOffset = mark;
+ nMarkers--;
+}
+
+unsigned int InputBuffer::entries() const
+{
+ //assert(queue.entries() >= markerOffset);
+ return queue.entries() - markerOffset;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/LLkParser.cpp b/lib/antlr/src/LLkParser.cpp
new file mode 100644
index 00000000..ab0d672a
--- /dev/null
+++ b/lib/antlr/src/LLkParser.cpp
@@ -0,0 +1,85 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/LLkParser.hpp"
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+ANTLR_USING_NAMESPACE(std)
+
+/**An LL(k) parser.
+ *
+ * @see antlr.Token
+ * @see antlr.TokenBuffer
+ * @see antlr.LL1Parser
+ */
+
+// LLkParser(int k_);
+
+LLkParser::LLkParser(const ParserSharedInputState& state, int k_)
+: Parser(state), k(k_)
+{
+}
+
+LLkParser::LLkParser(TokenBuffer& tokenBuf, int k_)
+: Parser(tokenBuf), k(k_)
+{
+}
+
+LLkParser::LLkParser(TokenStream& lexer, int k_)
+: Parser(new TokenBuffer(lexer)), k(k_)
+{
+}
+
+void LLkParser::trace(const char* ee, const char* rname)
+{
+ traceIndent();
+
+ cout << ee << rname << ((inputState->guessing>0)?"; [guessing]":"; ");
+
+ for (int i = 1; i <= k; i++)
+ {
+ if (i != 1) {
+ cout << ", ";
+ }
+ cout << "LA(" << i << ")==";
+
+ string temp;
+
+ try {
+ temp = LT(i)->getText().c_str();
+ }
+ catch( ANTLRException& ae )
+ {
+ temp = "[error: ";
+ temp += ae.toString();
+ temp += ']';
+ }
+ cout << temp;
+ }
+
+ cout << endl;
+}
+
+void LLkParser::traceIn(const char* rname)
+{
+ traceDepth++;
+ trace("> ",rname);
+}
+
+void LLkParser::traceOut(const char* rname)
+{
+ trace("< ",rname);
+ traceDepth--;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/Makefile.am b/lib/antlr/src/Makefile.am
new file mode 100644
index 00000000..b1af9fca
--- /dev/null
+++ b/lib/antlr/src/Makefile.am
@@ -0,0 +1,10 @@
+
+# Make #include <antlr/xxx> work..
+INCLUDES = -I$(srcdir)/..
+KDE_CXXFLAGS = $(USE_EXCEPTIONS)
+
+noinst_LTLIBRARIES = libantlr.la
+
+libantlr_la_LDFLAGS = -no-undefined
+
+libantlr_la_SOURCES = ANTLRUtil.cpp ASTFactory.cpp ASTNULLType.cpp ASTRefCount.cpp BaseAST.cpp BitSet.cpp CharBuffer.cpp CharScanner.cpp CommonAST.cpp CommonASTWithHiddenTokens.cpp CommonHiddenStreamToken.cpp CommonToken.cpp InputBuffer.cpp LLkParser.cpp MismatchedCharException.cpp MismatchedTokenException.cpp NoViableAltException.cpp NoViableAltForCharException.cpp Parser.cpp RecognitionException.cpp String.cpp Token.cpp TokenBuffer.cpp TokenRefCount.cpp TokenStreamBasicFilter.cpp TokenStreamHiddenTokenFilter.cpp TokenStreamRewriteEngine.cpp TokenStreamSelector.cpp TreeParser.cpp
diff --git a/lib/antlr/src/MismatchedCharException.cpp b/lib/antlr/src/MismatchedCharException.cpp
new file mode 100644
index 00000000..e73dbf36
--- /dev/null
+++ b/lib/antlr/src/MismatchedCharException.cpp
@@ -0,0 +1,120 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/CharScanner.hpp"
+#include "antlr/MismatchedCharException.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+MismatchedCharException::MismatchedCharException()
+ : RecognitionException("Mismatched char")
+{}
+
+// Expected range / not range
+MismatchedCharException::MismatchedCharException(
+ int c,
+ int lower,
+ int upper_,
+ bool matchNot,
+ CharScanner* scanner_
+) : RecognitionException("Mismatched char",
+ scanner_->getFilename(),
+ scanner_->getLine(), scanner_->getColumn())
+ , mismatchType(matchNot ? NOT_RANGE : RANGE)
+ , foundChar(c)
+ , expecting(lower)
+ , upper(upper_)
+ , scanner(scanner_)
+{
+}
+
+// Expected token / not token
+MismatchedCharException::MismatchedCharException(
+ int c,
+ int expecting_,
+ bool matchNot,
+ CharScanner* scanner_
+) : RecognitionException("Mismatched char",
+ scanner_->getFilename(),
+ scanner_->getLine(), scanner_->getColumn())
+ , mismatchType(matchNot ? NOT_CHAR : CHAR)
+ , foundChar(c)
+ , expecting(expecting_)
+ , scanner(scanner_)
+{
+}
+
+// Expected BitSet / not BitSet
+MismatchedCharException::MismatchedCharException(
+ int c,
+ BitSet set_,
+ bool matchNot,
+ CharScanner* scanner_
+) : RecognitionException("Mismatched char",
+ scanner_->getFilename(),
+ scanner_->getLine(), scanner_->getColumn())
+ , mismatchType(matchNot ? NOT_SET : SET)
+ , foundChar(c)
+ , set(set_)
+ , scanner(scanner_)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string MismatchedCharException::getMessage() const
+{
+ ANTLR_USE_NAMESPACE(std)string s;
+
+ switch (mismatchType) {
+ case CHAR :
+ s += "expecting '" + charName(expecting) + "', found '" + charName(foundChar) + "'";
+ break;
+ case NOT_CHAR :
+ s += "expecting anything but '" + charName(expecting) + "'; got it anyway";
+ break;
+ case RANGE :
+ s += "expecting token in range: '" + charName(expecting) + "'..'" + charName(upper) + "', found '" + charName(foundChar) + "'";
+ break;
+ case NOT_RANGE :
+ s += "expecting token NOT in range: " + charName(expecting) + "'..'" + charName(upper) + "', found '" + charName(foundChar) + "'";
+ break;
+ case SET :
+ case NOT_SET :
+ {
+ s += ANTLR_USE_NAMESPACE(std)string("expecting ") + (mismatchType == NOT_SET ? "NOT " : "") + "one of (";
+ ANTLR_USE_NAMESPACE(std)vector<unsigned int> elems = set.toArray();
+ for ( unsigned int i = 0; i < elems.size(); i++ )
+ {
+ s += " '";
+ s += charName(elems[i]);
+ s += "'";
+ }
+ s += "), found '" + charName(foundChar) + "'";
+ }
+ break;
+ default :
+ s += RecognitionException::getMessage();
+ break;
+ }
+
+ return s;
+}
+
+#ifndef NO_STATIC_CONSTS
+const int MismatchedCharException::CHAR;
+const int MismatchedCharException::NOT_CHAR;
+const int MismatchedCharException::RANGE;
+const int MismatchedCharException::NOT_RANGE;
+const int MismatchedCharException::SET;
+const int MismatchedCharException::NOT_SET;
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/MismatchedTokenException.cpp b/lib/antlr/src/MismatchedTokenException.cpp
new file mode 100644
index 00000000..7fc349f7
--- /dev/null
+++ b/lib/antlr/src/MismatchedTokenException.cpp
@@ -0,0 +1,196 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/MismatchedTokenException.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+MismatchedTokenException::MismatchedTokenException()
+ : RecognitionException("Mismatched Token: expecting any AST node","<AST>",-1,-1)
+ , token(0)
+ , node(nullASTptr)
+ , tokenNames(0)
+ , numTokens(0)
+{
+}
+
+// Expected range / not range
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ int lower,
+ int upper_,
+ bool matchNot
+) : RecognitionException("Mismatched Token","<AST>",-1,-1)
+ , token(0)
+ , node(node_)
+ , tokenText( (node_ ? node_->toString(): ANTLR_USE_NAMESPACE(std)string("<empty tree>")) )
+ , mismatchType(matchNot ? NOT_RANGE : RANGE)
+ , expecting(lower)
+ , upper(upper_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+// Expected token / not token
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ int expecting_,
+ bool matchNot
+) : RecognitionException("Mismatched Token","<AST>",-1,-1)
+ , token(0)
+ , node(node_)
+ , tokenText( (node_ ? node_->toString(): ANTLR_USE_NAMESPACE(std)string("<empty tree>")) )
+ , mismatchType(matchNot ? NOT_TOKEN : TOKEN)
+ , expecting(expecting_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+// Expected BitSet / not BitSet
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefAST node_,
+ BitSet set_,
+ bool matchNot
+) : RecognitionException("Mismatched Token","<AST>",-1,-1)
+ , token(0)
+ , node(node_)
+ , tokenText( (node_ ? node_->toString(): ANTLR_USE_NAMESPACE(std)string("<empty tree>")) )
+ , mismatchType(matchNot ? NOT_SET : SET)
+ , set(set_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+// Expected range / not range
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ int lower,
+ int upper_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+) : RecognitionException("Mismatched Token",fileName_,token_->getLine(),token_->getColumn())
+ , token(token_)
+ , node(nullASTptr)
+ , tokenText(token_->getText())
+ , mismatchType(matchNot ? NOT_RANGE : RANGE)
+ , expecting(lower)
+ , upper(upper_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+// Expected token / not token
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ int expecting_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+) : RecognitionException("Mismatched Token",fileName_,token_->getLine(),token_->getColumn())
+ , token(token_)
+ , node(nullASTptr)
+ , tokenText(token_->getText())
+ , mismatchType(matchNot ? NOT_TOKEN : TOKEN)
+ , expecting(expecting_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+// Expected BitSet / not BitSet
+MismatchedTokenException::MismatchedTokenException(
+ const char* const* tokenNames_,
+ const int numTokens_,
+ RefToken token_,
+ BitSet set_,
+ bool matchNot,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+) : RecognitionException("Mismatched Token",fileName_,token_->getLine(),token_->getColumn())
+ , token(token_)
+ , node(nullASTptr)
+ , tokenText(token_->getText())
+ , mismatchType(matchNot ? NOT_SET : SET)
+ , set(set_)
+ , tokenNames(tokenNames_)
+ , numTokens(numTokens_)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string MismatchedTokenException::getMessage() const
+{
+ ANTLR_USE_NAMESPACE(std)string s;
+ switch (mismatchType) {
+ case TOKEN:
+ s += "expecting " + tokenName(expecting) + ", found '" + tokenText + "'";
+ break;
+ case NOT_TOKEN:
+ s += "expecting anything but " + tokenName(expecting) + "; got it anyway";
+ break;
+ case RANGE:
+ s += "expecting token in range: " + tokenName(expecting) + ".." + tokenName(upper) + ", found '" + tokenText + "'";
+ break;
+ case NOT_RANGE:
+ s += "expecting token NOT in range: " + tokenName(expecting) + ".." + tokenName(upper) + ", found '" + tokenText + "'";
+ break;
+ case SET:
+ case NOT_SET:
+ {
+ s += ANTLR_USE_NAMESPACE(std)string("expecting ") + (mismatchType == NOT_SET ? "NOT " : "") + "one of (";
+ ANTLR_USE_NAMESPACE(std)vector<unsigned int> elems = set.toArray();
+ for ( unsigned int i = 0; i < elems.size(); i++ )
+ {
+ s += " ";
+ s += tokenName(elems[i]);
+ }
+ s += "), found '" + tokenText + "'";
+ }
+ break;
+ default:
+ s = RecognitionException::getMessage();
+ break;
+ }
+ return s;
+}
+
+ANTLR_USE_NAMESPACE(std)string MismatchedTokenException::tokenName(int tokenType) const
+{
+ if (tokenType == Token::INVALID_TYPE)
+ return "<Set of tokens>";
+ else if (tokenType < 0 || tokenType >= numTokens)
+ return ANTLR_USE_NAMESPACE(std)string("<") + tokenType + ">";
+ else
+ return tokenNames[tokenType];
+}
+
+#ifndef NO_STATIC_CONSTS
+const int MismatchedTokenException::TOKEN;
+const int MismatchedTokenException::NOT_TOKEN;
+const int MismatchedTokenException::RANGE;
+const int MismatchedTokenException::NOT_RANGE;
+const int MismatchedTokenException::SET;
+const int MismatchedTokenException::NOT_SET;
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/NoViableAltException.cpp b/lib/antlr/src/NoViableAltException.cpp
new file mode 100644
index 00000000..94da2cc4
--- /dev/null
+++ b/lib/antlr/src/NoViableAltException.cpp
@@ -0,0 +1,52 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/NoViableAltException.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+ANTLR_USING_NAMESPACE(std)
+
+NoViableAltException::NoViableAltException(RefAST t)
+ : RecognitionException("NoViableAlt","<AST>",-1,-1),
+ token(0), node(t)
+{
+}
+
+NoViableAltException::NoViableAltException(
+ RefToken t,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_
+) : RecognitionException("NoViableAlt",fileName_,t->getLine(),t->getColumn()),
+ token(t), node(nullASTptr)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string NoViableAltException::getMessage() const
+{
+ if (token)
+ {
+ if( token->getType() == Token::EOF_TYPE )
+ return string("unexpected end of file");
+ else if( token->getType() == Token::NULL_TREE_LOOKAHEAD )
+ return string("unexpected end of tree");
+ else
+ return string("unexpected token: ")+token->getText();
+ }
+
+ // must a tree parser error if token==null
+ if (!node)
+ return "unexpected end of subtree";
+
+ return string("unexpected AST node: ")+node->toString();
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/NoViableAltForCharException.cpp b/lib/antlr/src/NoViableAltForCharException.cpp
new file mode 100644
index 00000000..10d9447a
--- /dev/null
+++ b/lib/antlr/src/NoViableAltForCharException.cpp
@@ -0,0 +1,39 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/NoViableAltForCharException.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+NoViableAltForCharException::NoViableAltForCharException(int c, CharScanner* scanner)
+ : RecognitionException("NoViableAlt",
+ scanner->getFilename(),
+ scanner->getLine(),scanner->getColumn()),
+ foundChar(c)
+{
+}
+
+NoViableAltForCharException::NoViableAltForCharException(
+ int c,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_,
+ int line_, int column_)
+ : RecognitionException("NoViableAlt",fileName_,line_,column_),
+ foundChar(c)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string NoViableAltForCharException::getMessage() const
+{
+ return ANTLR_USE_NAMESPACE(std)string("unexpected char: ")+charName(foundChar);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/Parser.cpp b/lib/antlr/src/Parser.cpp
new file mode 100644
index 00000000..640da7b6
--- /dev/null
+++ b/lib/antlr/src/Parser.cpp
@@ -0,0 +1,113 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/Parser.hpp"
+
+#include <iostream>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A generic ANTLR parser (LL(k) for k>=1) containing a bunch of
+ * utility routines useful at any lookahead depth. We distinguish between
+ * the LL(1) and LL(k) parsers because of efficiency. This may not be
+ * necessary in the near future.
+ *
+ * Each parser object contains the state of the parse including a lookahead
+ * cache (the form of which is determined by the subclass), whether or
+ * not the parser is in guess mode, where tokens come from, etc...
+ *
+ * <p>
+ * During <b>guess</b> mode, the current lookahead token(s) and token type(s)
+ * cache must be saved because the token stream may not have been informed
+ * to save the token (via <tt>mark</tt>) before the <tt>try</tt> block.
+ * Guessing is started by:
+ * <ol>
+ * <li>saving the lookahead cache.
+ * <li>marking the current position in the TokenBuffer.
+ * <li>increasing the guessing level.
+ * </ol>
+ *
+ * After guessing, the parser state is restored by:
+ * <ol>
+ * <li>restoring the lookahead cache.
+ * <li>rewinding the TokenBuffer.
+ * <li>decreasing the guessing level.
+ * </ol>
+ *
+ * @see antlr.Token
+ * @see antlr.TokenBuffer
+ * @see antlr.TokenStream
+ * @see antlr.LL1Parser
+ * @see antlr.LLkParser
+ */
+
+bool DEBUG_PARSER = false;
+
+/** Parser error-reporting function can be overridden in subclass */
+void Parser::reportError(const RecognitionException& ex)
+{
+ ANTLR_USE_NAMESPACE(std)cerr << ex.toString().c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser error-reporting function can be overridden in subclass */
+void Parser::reportError(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ if ( getFilename()=="" )
+ ANTLR_USE_NAMESPACE(std)cerr << "error: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+ else
+ ANTLR_USE_NAMESPACE(std)cerr << getFilename().c_str() << ": error: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser warning-reporting function can be overridden in subclass */
+void Parser::reportWarning(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ if ( getFilename()=="" )
+ ANTLR_USE_NAMESPACE(std)cerr << "warning: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+ else
+ ANTLR_USE_NAMESPACE(std)cerr << getFilename().c_str() << ": warning: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Set or change the input token buffer */
+// void setTokenBuffer(TokenBuffer<Token>* t);
+
+void Parser::traceIndent()
+{
+ for( int i = 0; i < traceDepth; i++ )
+ ANTLR_USE_NAMESPACE(std)cout << " ";
+}
+
+void Parser::traceIn(const char* rname)
+{
+ traceDepth++;
+
+ for( int i = 0; i < traceDepth; i++ )
+ ANTLR_USE_NAMESPACE(std)cout << " ";
+
+ ANTLR_USE_NAMESPACE(std)cout << "> " << rname
+ << "; LA(1)==" << LT(1)->getText().c_str()
+ << ((inputState->guessing>0)?" [guessing]":"")
+ << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+void Parser::traceOut(const char* rname)
+{
+ for( int i = 0; i < traceDepth; i++ )
+ ANTLR_USE_NAMESPACE(std)cout << " ";
+
+ ANTLR_USE_NAMESPACE(std)cout << "< " << rname
+ << "; LA(1)==" << LT(1)->getText().c_str()
+ << ((inputState->guessing>0)?" [guessing]":"")
+ << ANTLR_USE_NAMESPACE(std)endl;
+
+ traceDepth--;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/RecognitionException.cpp b/lib/antlr/src/RecognitionException.cpp
new file mode 100644
index 00000000..9c185ccc
--- /dev/null
+++ b/lib/antlr/src/RecognitionException.cpp
@@ -0,0 +1,71 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/RecognitionException.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+RecognitionException::RecognitionException()
+: ANTLRException("parsing error")
+, line(-1)
+, column(-1)
+{
+}
+
+RecognitionException::RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s)
+: ANTLRException(s)
+, line(-1)
+, column(-1)
+{
+}
+
+RecognitionException::RecognitionException(const ANTLR_USE_NAMESPACE(std)string& s,
+ const ANTLR_USE_NAMESPACE(std)string& fileName_,
+ int line_,int column_)
+: ANTLRException(s)
+, fileName(fileName_)
+, line(line_)
+, column(column_)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string RecognitionException::getFileLineColumnString() const
+{
+ ANTLR_USE_NAMESPACE(std)string fileLineColumnString;
+
+ if ( fileName.length() > 0 )
+ fileLineColumnString = fileName + ":";
+
+ if ( line != -1 )
+ {
+ if ( fileName.length() == 0 )
+ fileLineColumnString = fileLineColumnString + "line ";
+
+ fileLineColumnString = fileLineColumnString + line;
+
+ if ( column != -1 )
+ fileLineColumnString = fileLineColumnString + ":" + column;
+
+ fileLineColumnString = fileLineColumnString + ":";
+ }
+
+ fileLineColumnString = fileLineColumnString + " ";
+
+ return fileLineColumnString;
+}
+
+ANTLR_USE_NAMESPACE(std)string RecognitionException::toString() const
+{
+ return getFileLineColumnString()+getMessage();
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/String.cpp b/lib/antlr/src/String.cpp
new file mode 100644
index 00000000..ae70f479
--- /dev/null
+++ b/lib/antlr/src/String.cpp
@@ -0,0 +1,90 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/String.hpp"
+
+#include <cctype>
+
+#ifdef HAS_NOT_CSTDIO_H
+#include <stdio.h>
+#else
+#include <cstdio>
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+// wh: hack for Borland C++ 5.6
+#if __BORLANDC__
+ using std::sprintf;
+#endif
+
+
+// RK: should be using snprintf actually... (or stringstream)
+ANTLR_C_USING(sprintf)
+
+ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, const int rhs )
+{
+ char tmp[100];
+ sprintf(tmp,"%d",rhs);
+ return lhs+tmp;
+}
+
+ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, size_t rhs )
+{
+ char tmp[100];
+ sprintf(tmp,"%u",rhs);
+ return lhs+tmp;
+}
+
+/** Convert character to readable string
+ */
+ANTLR_USE_NAMESPACE(std)string charName(int ch)
+{
+ if (ch == EOF)
+ return "EOF";
+ else
+ {
+ ANTLR_USE_NAMESPACE(std)string s;
+
+ // when you think you've seen it all.. an isprint that crashes...
+ ch = ch & 0xFF;
+#ifdef ANTLR_CCTYPE_NEEDS_STD
+ if( ANTLR_USE_NAMESPACE(std)isprint( ch ) )
+#else
+ if( isprint( ch ) )
+#endif
+ {
+ s.append("'");
+ s += ch;
+ s.append("'");
+// s += "'"+ch+"'";
+ }
+ else
+ {
+ s += "0x";
+
+ unsigned int t = ch >> 4;
+ if( t < 10 )
+ s += t | 0x30;
+ else
+ s += t + 0x37;
+ t = ch & 0xF;
+ if( t < 10 )
+ s += t | 0x30;
+ else
+ s += t + 0x37;
+ }
+ return s;
+ }
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/Token.cpp b/lib/antlr/src/Token.cpp
new file mode 100644
index 00000000..f8181634
--- /dev/null
+++ b/lib/antlr/src/Token.cpp
@@ -0,0 +1,80 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/Token.hpp"
+#include "antlr/String.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+int Token::getColumn() const
+{
+ return 0;
+}
+
+int Token::getLine() const
+{
+ return 0;
+}
+
+ANTLR_USE_NAMESPACE(std)string Token::getText() const
+{
+ return "<no text>";
+}
+
+int Token::getType() const
+{
+ return type;
+}
+
+void Token::setColumn(int)
+{
+}
+
+void Token::setLine(int)
+{
+}
+
+void Token::setText(const ANTLR_USE_NAMESPACE(std)string&)
+{
+}
+
+void Token::setType(int t)
+{
+ type = t;
+}
+
+void Token::setFilename(const ANTLR_USE_NAMESPACE(std)string&)
+{
+}
+
+ANTLR_USE_NAMESPACE(std)string emptyString("");
+
+const ANTLR_USE_NAMESPACE(std)string& Token::getFilename() const
+{
+ return emptyString;
+}
+
+ANTLR_USE_NAMESPACE(std)string Token::toString() const
+{
+ return "[\""+getText()+"\",<"+type+">]";
+}
+
+ANTLR_API RefToken nullToken;
+
+#ifndef NO_STATIC_CONSTS
+const int Token::MIN_USER_TYPE;
+const int Token::NULL_TREE_LOOKAHEAD;
+const int Token::INVALID_TYPE;
+const int Token::EOF_TYPE;
+const int Token::SKIP;
+#endif
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/TokenBuffer.cpp b/lib/antlr/src/TokenBuffer.cpp
new file mode 100644
index 00000000..ed69d6e0
--- /dev/null
+++ b/lib/antlr/src/TokenBuffer.cpp
@@ -0,0 +1,96 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/TokenBuffer.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**A Stream of Token objects fed to the parser from a TokenStream that can
+ * be rewound via mark()/rewind() methods.
+ * <p>
+ * A dynamic array is used to buffer up all the input tokens. Normally,
+ * "k" tokens are stored in the buffer. More tokens may be stored during
+ * guess mode (testing syntactic predicate), or when LT(i>k) is referenced.
+ * Consumption of tokens is deferred. In other words, reading the next
+ * token is not done by conume(), but deferred until needed by LA or LT.
+ * <p>
+ *
+ * @see antlr.Token
+ * @see antlr.TokenStream
+ * @see antlr.TokenQueue
+ */
+
+/** Create a token buffer */
+TokenBuffer::TokenBuffer( TokenStream& inp )
+: input(inp)
+, nMarkers(0)
+, markerOffset(0)
+, numToConsume(0)
+{
+}
+
+TokenBuffer::~TokenBuffer( void )
+{
+}
+
+/** Ensure that the token buffer is sufficiently full */
+void TokenBuffer::fill(unsigned int amount)
+{
+ syncConsume();
+ // Fill the buffer sufficiently to hold needed tokens
+ while (queue.entries() < (amount + markerOffset))
+ {
+ // Append the next token
+ queue.append(input.nextToken());
+ }
+}
+
+/** Get a lookahead token value */
+int TokenBuffer::LA(unsigned int i)
+{
+ fill(i);
+ return queue.elementAt(markerOffset+i-1)->getType();
+}
+
+/** Get a lookahead token */
+RefToken TokenBuffer::LT(unsigned int i)
+{
+ fill(i);
+ return queue.elementAt(markerOffset+i-1);
+}
+
+/** Return an integer marker that can be used to rewind the buffer to
+ * its current state.
+ */
+unsigned int TokenBuffer::mark()
+{
+ syncConsume();
+ nMarkers++;
+ return markerOffset;
+}
+
+/**Rewind the token buffer to a marker.
+ * @param mark Marker returned previously from mark()
+ */
+void TokenBuffer::rewind(unsigned int mark)
+{
+ syncConsume();
+ markerOffset=mark;
+ nMarkers--;
+}
+
+/// Get number of non-consumed tokens
+unsigned int TokenBuffer::entries() const
+{
+ return queue.entries() - markerOffset;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+ }
+#endif
diff --git a/lib/antlr/src/TokenRefCount.cpp b/lib/antlr/src/TokenRefCount.cpp
new file mode 100644
index 00000000..0afb0f84
--- /dev/null
+++ b/lib/antlr/src/TokenRefCount.cpp
@@ -0,0 +1,41 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id:$
+ */
+#include "antlr/TokenRefCount.hpp"
+#include "antlr/Token.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+TokenRef::TokenRef(Token* p)
+: ptr(p), count(1)
+{
+ if (p && !p->ref)
+ p->ref = this;
+}
+
+TokenRef::~TokenRef()
+{
+ delete ptr;
+}
+
+TokenRef* TokenRef::getRef(const Token* p)
+{
+ if (p) {
+ Token* pp = const_cast<Token*>(p);
+ if (pp->ref)
+ return pp->ref->increment();
+ else
+ return new TokenRef(pp);
+ } else
+ return 0;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/TokenStreamBasicFilter.cpp b/lib/antlr/src/TokenStreamBasicFilter.cpp
new file mode 100644
index 00000000..982e8645
--- /dev/null
+++ b/lib/antlr/src/TokenStreamBasicFilter.cpp
@@ -0,0 +1,44 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/TokenStreamBasicFilter.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** This object is a TokenStream that passes through all
+ * tokens except for those that you tell it to discard.
+ * There is no buffering of the tokens.
+ */
+TokenStreamBasicFilter::TokenStreamBasicFilter(TokenStream& input_)
+: input(&input_)
+{
+}
+
+void TokenStreamBasicFilter::discard(int ttype)
+{
+ discardMask.add(ttype);
+}
+
+void TokenStreamBasicFilter::discard(const BitSet& mask)
+{
+ discardMask = mask;
+}
+
+RefToken TokenStreamBasicFilter::nextToken()
+{
+ RefToken tok = input->nextToken();
+ while ( tok && discardMask.member(tok->getType()) ) {
+ tok = input->nextToken();
+ }
+ return tok;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/TokenStreamHiddenTokenFilter.cpp b/lib/antlr/src/TokenStreamHiddenTokenFilter.cpp
new file mode 100644
index 00000000..431df0c3
--- /dev/null
+++ b/lib/antlr/src/TokenStreamHiddenTokenFilter.cpp
@@ -0,0 +1,156 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/TokenStreamHiddenTokenFilter.hpp"
+#include "antlr/CommonHiddenStreamToken.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/**This object filters a token stream coming from a lexer
+ * or another TokenStream so that only certain token channels
+ * get transmitted to the parser.
+ *
+ * Any of the channels can be filtered off as "hidden" channels whose
+ * tokens can be accessed from the parser.
+ */
+
+TokenStreamHiddenTokenFilter::TokenStreamHiddenTokenFilter(TokenStream& input)
+: TokenStreamBasicFilter(input)
+{
+}
+
+void TokenStreamHiddenTokenFilter::consume()
+{
+ nextMonitoredToken = input->nextToken();
+}
+
+void TokenStreamHiddenTokenFilter::consumeFirst()
+{
+ consume();
+
+ // Handle situation where hidden or discarded tokens
+ // appear first in input stream
+ RefToken p;
+ // while hidden or discarded scarf tokens
+ while ( hideMask.member(LA(1)->getType()) || discardMask.member(LA(1)->getType()) ) {
+ if ( hideMask.member(LA(1)->getType()) ) {
+ if ( !p ) {
+ p = LA(1);
+ }
+ else {
+ static_cast<CommonHiddenStreamToken*>(p.get())->setHiddenAfter(LA(1));
+ static_cast<CommonHiddenStreamToken*>(LA(1).get())->setHiddenBefore(p); // double-link
+ p = LA(1);
+ }
+ lastHiddenToken = p;
+ if (!firstHidden)
+ firstHidden = p; // record hidden token if first
+ }
+ consume();
+ }
+}
+
+BitSet TokenStreamHiddenTokenFilter::getDiscardMask() const
+{
+ return discardMask;
+}
+
+/** Return a ptr to the hidden token appearing immediately after
+ * token t in the input stream.
+ */
+RefToken TokenStreamHiddenTokenFilter::getHiddenAfter(RefToken t)
+{
+ return static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenAfter();
+}
+
+/** Return a ptr to the hidden token appearing immediately before
+ * token t in the input stream.
+ */
+RefToken TokenStreamHiddenTokenFilter::getHiddenBefore(RefToken t)
+{
+ return static_cast<CommonHiddenStreamToken*>(t.get())->getHiddenBefore();
+}
+
+BitSet TokenStreamHiddenTokenFilter::getHideMask() const
+{
+ return hideMask;
+}
+
+/** Return the first hidden token if one appears
+ * before any monitored token.
+ */
+RefToken TokenStreamHiddenTokenFilter::getInitialHiddenToken()
+{
+ return firstHidden;
+}
+
+void TokenStreamHiddenTokenFilter::hide(int m)
+{
+ hideMask.add(m);
+}
+
+void TokenStreamHiddenTokenFilter::hide(const BitSet& mask)
+{
+ hideMask = mask;
+}
+
+RefToken TokenStreamHiddenTokenFilter::LA(int)
+{
+ return nextMonitoredToken;
+}
+
+/** Return the next monitored token.
+* Test the token following the monitored token.
+* If following is another monitored token, save it
+* for the next invocation of nextToken (like a single
+* lookahead token) and return it then.
+* If following is unmonitored, nondiscarded (hidden)
+* channel token, add it to the monitored token.
+*
+* Note: EOF must be a monitored Token.
+*/
+RefToken TokenStreamHiddenTokenFilter::nextToken()
+{
+ // handle an initial condition; don't want to get lookahead
+ // token of this splitter until first call to nextToken
+ if ( !LA(1) ) {
+ consumeFirst();
+ }
+
+ // we always consume hidden tokens after monitored, thus,
+ // upon entry LA(1) is a monitored token.
+ RefToken monitored = LA(1);
+ // point to hidden tokens found during last invocation
+ static_cast<CommonHiddenStreamToken*>(monitored.get())->setHiddenBefore(lastHiddenToken);
+ lastHiddenToken = nullToken;
+
+ // Look for hidden tokens, hook them into list emanating
+ // from the monitored tokens.
+ consume();
+ RefToken p = monitored;
+ // while hidden or discarded scarf tokens
+ while ( hideMask.member(LA(1)->getType()) || discardMask.member(LA(1)->getType()) ) {
+ if ( hideMask.member(LA(1)->getType()) ) {
+ // attach the hidden token to the monitored in a chain
+ // link forwards
+ static_cast<CommonHiddenStreamToken*>(p.get())->setHiddenAfter(LA(1));
+ // link backwards
+ if (p != monitored) { //hidden cannot point to monitored tokens
+ static_cast<CommonHiddenStreamToken*>(LA(1).get())->setHiddenBefore(p);
+ }
+ p = lastHiddenToken = LA(1);
+ }
+ consume();
+ }
+ return monitored;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/TokenStreamRewriteEngine.cpp b/lib/antlr/src/TokenStreamRewriteEngine.cpp
new file mode 100644
index 00000000..2f171eb6
--- /dev/null
+++ b/lib/antlr/src/TokenStreamRewriteEngine.cpp
@@ -0,0 +1,214 @@
+#include <antlr/config.hpp>
+
+#include <string>
+#include <list>
+#include <vector>
+#include <map>
+#include <utility>
+#include <iostream>
+#include <iterator>
+#include <sstream>
+#include <cassert>
+
+#include <antlr/TokenStream.hpp>
+#include <antlr/TokenWithIndex.hpp>
+#include <antlr/BitSet.hpp>
+#include <antlr/TokenStreamRewriteEngine.hpp>
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+#ifndef NO_STATIC_CONSTS
+const size_t TokenStreamRewriteEngine::MIN_TOKEN_INDEX = 0;
+const int TokenStreamRewriteEngine::PROGRAM_INIT_SIZE = 100;
+#endif
+
+const char* TokenStreamRewriteEngine::DEFAULT_PROGRAM_NAME = "default";
+
+namespace {
+
+ struct compareOperationIndex {
+ typedef TokenStreamRewriteEngine::RewriteOperation RewriteOperation;
+ bool operator() ( const RewriteOperation* a, const RewriteOperation* b ) const
+ {
+ return a->getIndex() < b->getIndex();
+ }
+ };
+ struct dumpTokenWithIndex {
+ dumpTokenWithIndex( ANTLR_USE_NAMESPACE(std)ostream& o ) : out(o) {}
+ void operator() ( const RefTokenWithIndex& t ) {
+ out << "[txt='" << t->getText() << "' tp=" << t->getType() << " idx=" << t->getIndex() << "]\n";
+ }
+ ANTLR_USE_NAMESPACE(std)ostream& out;
+ };
+}
+
+TokenStreamRewriteEngine::TokenStreamRewriteEngine(TokenStream& upstream)
+: stream(upstream)
+, index(MIN_TOKEN_INDEX)
+, tokens()
+, programs()
+, discardMask()
+{
+}
+
+TokenStreamRewriteEngine::TokenStreamRewriteEngine(TokenStream& upstream, size_t initialSize )
+: stream(upstream)
+, index(MIN_TOKEN_INDEX)
+, tokens(initialSize)
+, programs()
+, discardMask()
+{
+}
+
+RefToken TokenStreamRewriteEngine::nextToken( void )
+{
+ RefTokenWithIndex t;
+ // suck tokens until end of stream or we find a non-discarded token
+ do {
+ t = RefTokenWithIndex(stream.nextToken());
+ if ( t )
+ {
+ t->setIndex(index); // what is t's index in list?
+ if ( t->getType() != Token::EOF_TYPE ) {
+ tokens.push_back(t); // track all tokens except EOF
+ }
+ index++; // move to next position
+ }
+ } while ( t && discardMask.member(t->getType()) );
+ return RefToken(t);
+}
+
+void TokenStreamRewriteEngine::rollback( const std::string& programName,
+ size_t instructionIndex )
+{
+ program_map::iterator rewrite = programs.find(programName);
+ if( rewrite != programs.end() )
+ {
+ operation_list& prog = rewrite->second;
+ operation_list::iterator
+ j = prog.begin(),
+ end = prog.end();
+
+ std::advance(j,instructionIndex);
+ if( j != end )
+ prog.erase(j, end);
+ }
+}
+
+void TokenStreamRewriteEngine::originalToStream( std::ostream& out,
+ size_t start,
+ size_t end ) const
+{
+ token_list::const_iterator s = tokens.begin();
+ std::advance( s, start );
+ token_list::const_iterator e = s;
+ std::advance( e, end-start );
+ std::for_each( s, e, tokenToStream(out) );
+}
+
+void TokenStreamRewriteEngine::toStream( std::ostream& out,
+ const std::string& programName,
+ size_t firstToken,
+ size_t lastToken ) const
+{
+ if( tokens.size() == 0 )
+ return;
+
+ program_map::const_iterator rewriter = programs.find(programName);
+
+ if ( rewriter == programs.end() )
+ return;
+
+ // get the prog and some iterators in it...
+ const operation_list& prog = rewriter->second;
+ operation_list::const_iterator
+ rewriteOpIndex = prog.begin(),
+ rewriteOpEnd = prog.end();
+
+ size_t tokenCursor = firstToken;
+ // make sure we don't run out of the tokens we have...
+ if( lastToken > (tokens.size() - 1) )
+ lastToken = tokens.size() - 1;
+
+ while ( tokenCursor <= lastToken )
+ {
+// std::cout << "tokenCursor = " << tokenCursor << " first prog index = " << (*rewriteOpIndex)->getIndex() << std::endl;
+
+ if( rewriteOpIndex != rewriteOpEnd )
+ {
+ size_t up_to_here = std::min(lastToken,(*rewriteOpIndex)->getIndex());
+ while( tokenCursor < up_to_here )
+ out << tokens[tokenCursor++]->getText();
+ }
+ while ( rewriteOpIndex != rewriteOpEnd &&
+ tokenCursor == (*rewriteOpIndex)->getIndex() &&
+ tokenCursor <= lastToken )
+ {
+ tokenCursor = (*rewriteOpIndex)->execute(out);
+ ++rewriteOpIndex;
+ }
+ if( tokenCursor <= lastToken )
+ out << tokens[tokenCursor++]->getText();
+ }
+ // std::cout << "Handling tail operations # left = " << std::distance(rewriteOpIndex,rewriteOpEnd) << std::endl;
+ // now see if there are operations (append) beyond last token index
+ std::for_each( rewriteOpIndex, rewriteOpEnd, executeOperation(out) );
+ rewriteOpIndex = rewriteOpEnd;
+}
+
+void TokenStreamRewriteEngine::toDebugStream( std::ostream& out,
+ size_t start,
+ size_t end ) const
+{
+ token_list::const_iterator s = tokens.begin();
+ std::advance( s, start );
+ token_list::const_iterator e = s;
+ std::advance( e, end-start );
+ std::for_each( s, e, dumpTokenWithIndex(out) );
+}
+
+void TokenStreamRewriteEngine::addToSortedRewriteList( const std::string& programName,
+ RewriteOperation* op )
+{
+ program_map::iterator rewrites = programs.find(programName);
+ // check if we got the program already..
+ if ( rewrites == programs.end() )
+ {
+ // no prog make a new one...
+ operation_list ops;
+ ops.push_back(op);
+ programs.insert(std::make_pair(programName,ops));
+ return;
+ }
+ operation_list& prog = rewrites->second;
+
+ if( prog.empty() )
+ {
+ prog.push_back(op);
+ return;
+ }
+
+ operation_list::iterator i, end = prog.end();
+ i = end;
+ --i;
+ // if at or beyond last op's index, just append
+ if ( op->getIndex() >= (*i)->getIndex() ) {
+ prog.push_back(op); // append to list of operations
+ return;
+ }
+ i = prog.begin();
+
+ if( i != end )
+ {
+ operation_list::iterator pos = std::upper_bound( i, end, op, compareOperationIndex() );
+ prog.insert(pos,op);
+ }
+ else
+ prog.push_back(op);
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/antlr/src/TokenStreamSelector.cpp b/lib/antlr/src/TokenStreamSelector.cpp
new file mode 100644
index 00000000..602e50dc
--- /dev/null
+++ b/lib/antlr/src/TokenStreamSelector.cpp
@@ -0,0 +1,107 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+#include "antlr/TokenStreamSelector.hpp"
+#include "antlr/TokenStreamRetryException.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** A token stream MUX (multiplexor) knows about n token streams
+ * and can multiplex them onto the same channel for use by token
+ * stream consumer like a parser. This is a way to have multiple
+ * lexers break up the same input stream for a single parser.
+ * Or, you can have multiple instances of the same lexer handle
+ * multiple input streams; this works great for includes.
+ */
+
+TokenStreamSelector::TokenStreamSelector()
+: input(0)
+{
+}
+
+TokenStreamSelector::~TokenStreamSelector()
+{
+}
+
+void TokenStreamSelector::addInputStream(TokenStream* stream, const ANTLR_USE_NAMESPACE(std)string& key)
+{
+ inputStreamNames[key] = stream;
+}
+
+TokenStream* TokenStreamSelector::getCurrentStream() const
+{
+ return input;
+}
+
+TokenStream* TokenStreamSelector::getStream(const ANTLR_USE_NAMESPACE(std)string& sname) const
+{
+ inputStreamNames_coll::const_iterator i = inputStreamNames.find(sname);
+ if (i == inputStreamNames.end()) {
+ throw ANTLR_USE_NAMESPACE(std)string("TokenStream ")+sname+" not found";
+ }
+ return (*i).second;
+}
+
+RefToken TokenStreamSelector::nextToken()
+{
+ // keep looking for a token until you don't
+ // get a retry exception
+ for (;;) {
+ try {
+ return input->nextToken();
+ }
+ catch (TokenStreamRetryException&) {
+ // just retry "forever"
+ }
+ }
+}
+
+TokenStream* TokenStreamSelector::pop()
+{
+ TokenStream* stream = streamStack.top();
+ streamStack.pop();
+ select(stream);
+ return stream;
+}
+
+void TokenStreamSelector::push(TokenStream* stream)
+{
+ streamStack.push(input);
+ select(stream);
+}
+
+void TokenStreamSelector::push(const ANTLR_USE_NAMESPACE(std)string& sname)
+{
+ streamStack.push(input);
+ select(sname);
+}
+
+void TokenStreamSelector::retry()
+{
+ throw TokenStreamRetryException();
+}
+
+/** Set the stream without pushing old stream */
+void TokenStreamSelector::select(TokenStream* stream)
+{
+ input = stream;
+}
+
+void TokenStreamSelector::select(const ANTLR_USE_NAMESPACE(std)string& sname)
+{
+ inputStreamNames_coll::const_iterator i = inputStreamNames.find(sname);
+ if (i == inputStreamNames.end()) {
+ throw ANTLR_USE_NAMESPACE(std)string("TokenStream ")+sname+" not found";
+ }
+ input = (*i).second;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
+
diff --git a/lib/antlr/src/TreeParser.cpp b/lib/antlr/src/TreeParser.cpp
new file mode 100644
index 00000000..6b3f2ca1
--- /dev/null
+++ b/lib/antlr/src/TreeParser.cpp
@@ -0,0 +1,72 @@
+/* ANTLR Translator Generator
+ * Project led by Terence Parr at http://www.jGuru.com
+ * Software rights: http://www.antlr.org/license.html
+ *
+ * $Id$
+ */
+
+#include "antlr/TreeParser.hpp"
+#include "antlr/ASTNULLType.hpp"
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+namespace antlr {
+#endif
+
+/** The AST Null object; the parsing cursor is set to this when
+ * it is found to be null. This way, we can test the
+ * token type of a node without having to have tests for null
+ * everywhere.
+ */
+RefAST TreeParser::ASTNULL(new ASTNULLType);
+
+/** Parser error-reporting function can be overridden in subclass */
+void TreeParser::reportError(const RecognitionException& ex)
+{
+ ANTLR_USE_NAMESPACE(std)cerr << ex.toString().c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser error-reporting function can be overridden in subclass */
+void TreeParser::reportError(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ ANTLR_USE_NAMESPACE(std)cerr << "error: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Parser warning-reporting function can be overridden in subclass */
+void TreeParser::reportWarning(const ANTLR_USE_NAMESPACE(std)string& s)
+{
+ ANTLR_USE_NAMESPACE(std)cerr << "warning: " << s.c_str() << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+/** Procedure to write out an indent for traceIn and traceOut */
+void TreeParser::traceIndent()
+{
+ for( int i = 0; i < traceDepth; i++ )
+ ANTLR_USE_NAMESPACE(std)cout << " ";
+}
+
+void TreeParser::traceIn(const char* rname, RefAST t)
+{
+ traceDepth++;
+ traceIndent();
+
+ ANTLR_USE_NAMESPACE(std)cout << "> " << rname
+ << "(" << (t ? t->toString().c_str() : "null") << ")"
+ << ((inputState->guessing>0)?" [guessing]":"")
+ << ANTLR_USE_NAMESPACE(std)endl;
+}
+
+void TreeParser::traceOut(const char* rname, RefAST t)
+{
+ traceIndent();
+
+ ANTLR_USE_NAMESPACE(std)cout << "< " << rname
+ << "(" << (t ? t->toString().c_str() : "null") << ")"
+ << ((inputState->guessing>0)?" [guessing]":"")
+ << ANTLR_USE_NAMESPACE(std)endl;
+
+ traceDepth--;
+}
+
+#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
+}
+#endif
diff --git a/lib/astyle/ASBeautifier.cpp b/lib/astyle/ASBeautifier.cpp
new file mode 100644
index 00000000..432d58a9
--- /dev/null
+++ b/lib/astyle/ASBeautifier.cpp
@@ -0,0 +1,1933 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * ASBeautifier.cpp
+ *
+ * This file is a part of "Artistic Style" - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * http://astyle.sourceforge.net
+ *
+ * The "Artistic Style" project, including all files needed to
+ * compile it, is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this project; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+#include <algorithm>
+#include <iostream>
+
+
+#define INIT_CONTAINER(container, value) {if ( (container) != NULL ) delete (container); (container) = (value); }
+#define DELETE_CONTAINER(container) {if ( (container) != NULL ) delete (container); }
+
+
+namespace astyle
+{
+vector<const string*> ASBeautifier::headers;
+vector<const string*> ASBeautifier::nonParenHeaders;
+vector<const string*> ASBeautifier::preBlockStatements;
+vector<const string*> ASBeautifier::assignmentOperators;
+vector<const string*> ASBeautifier::nonAssignmentOperators;
+
+
+/*
+ * initialize the static vars
+ */
+void ASBeautifier::initStatic()
+{
+ static int beautifierFileType = 9; // initialized with an invalid type
+
+ if (fileType == beautifierFileType) // don't build unless necessary
+ return;
+
+ beautifierFileType = fileType;
+
+ headers.clear();
+ nonParenHeaders.clear();
+ assignmentOperators.clear();
+ nonAssignmentOperators.clear();
+ preBlockStatements.clear();
+
+ ASResource::buildHeaders(headers, fileType, true);
+ ASResource::buildNonParenHeaders(nonParenHeaders, fileType, true);
+ ASResource::buildAssignmentOperators(assignmentOperators);
+ ASResource::buildNonAssignmentOperators(nonAssignmentOperators);
+ ASResource::buildPreBlockStatements(preBlockStatements);
+
+// cout << "beaut" << endl;
+}
+
+/**
+ * ASBeautifier's constructor
+ */
+ASBeautifier::ASBeautifier()
+{
+ waitingBeautifierStack = NULL;
+ activeBeautifierStack = NULL;
+ waitingBeautifierStackLengthStack = NULL;
+ activeBeautifierStackLengthStack = NULL;
+
+ headerStack = NULL;
+ tempStacks = NULL;
+ blockParenDepthStack = NULL;
+ blockStatementStack = NULL;
+ parenStatementStack = NULL;
+ bracketBlockStateStack = NULL;
+ inStatementIndentStack = NULL;
+ inStatementIndentStackSizeStack = NULL;
+ parenIndentStack = NULL;
+ sourceIterator = NULL;
+
+ isMinimalConditinalIndentSet = false;
+ shouldForceTabIndentation = false;
+
+ setSpaceIndentation(4);
+ setMaxInStatementIndentLength(40);
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setCaseIndent(false);
+ setBlockIndent(false);
+ setBracketIndent(false);
+ setNamespaceIndent(false);
+ setLabelIndent(false);
+ setEmptyLineFill(false);
+ fileType = C_TYPE;
+ setCStyle();
+ setPreprocessorIndent(false);
+}
+
+/**
+ * ASBeautifier's copy constructor
+ */
+ASBeautifier::ASBeautifier(const ASBeautifier &other)
+{
+ waitingBeautifierStack = NULL;
+ activeBeautifierStack = NULL;
+ waitingBeautifierStackLengthStack = NULL;
+ activeBeautifierStackLengthStack = NULL;
+
+ headerStack = new vector<const string*>;
+ *headerStack = *other.headerStack;
+
+ tempStacks = new vector<vector<const string*>*>;
+ vector<vector<const string*>*>::iterator iter;
+ for (iter = other.tempStacks->begin();
+ iter != other.tempStacks->end();
+ ++iter)
+ {
+ vector<const string*> *newVec = new vector<const string*>;
+ *newVec = **iter;
+ tempStacks->push_back(newVec);
+ }
+ blockParenDepthStack = new vector<int>;
+ *blockParenDepthStack = *other.blockParenDepthStack;
+
+ blockStatementStack = new vector<bool>;
+ *blockStatementStack = *other.blockStatementStack;
+
+ parenStatementStack = new vector<bool>;
+ *parenStatementStack = *other.parenStatementStack;
+
+ bracketBlockStateStack = new vector<bool>;
+ *bracketBlockStateStack = *other.bracketBlockStateStack;
+
+ inStatementIndentStack = new vector<int>;
+ *inStatementIndentStack = *other.inStatementIndentStack;
+
+ inStatementIndentStackSizeStack = new vector<int>;
+ *inStatementIndentStackSizeStack = *other.inStatementIndentStackSizeStack;
+
+ parenIndentStack = new vector<int>;
+ *parenIndentStack = *other.parenIndentStack;
+
+ sourceIterator = other.sourceIterator;
+
+ // protected variables
+ fileType = other.fileType;
+ isCStyle = other.isCStyle;
+ isJavaStyle = other.isJavaStyle;
+ isSharpStyle = other.isSharpStyle;
+
+ // variables set by ASFormatter
+ // must also be updated in preprocessor
+ inLineNumber = other.inLineNumber;
+ outLineNumber = other.outLineNumber;
+ lineCommentNoBeautify = other.lineCommentNoBeautify;
+ isNonInStatementArray = other.isNonInStatementArray;
+
+ // private variables
+ indentString = other.indentString;
+ currentHeader = other.currentHeader;
+ previousLastLineHeader = other.previousLastLineHeader;
+ immediatelyPreviousAssignmentOp = other.immediatelyPreviousAssignmentOp;
+ probationHeader = other.probationHeader;
+ isInQuote = other.isInQuote;
+ isInComment = other.isInComment;
+ isInCase = other.isInCase;
+ isInQuestion = other.isInQuestion;
+ isInStatement = other.isInStatement;
+ isInHeader = other.isInHeader;
+ isInOperator = other.isInOperator;
+ isInTemplate = other.isInTemplate;
+ isInDefine = other.isInDefine;
+ isInDefineDefinition = other.isInDefineDefinition;
+ classIndent = other.classIndent;
+ isInClassHeader = other.isInClassHeader;
+ isInClassHeaderTab = other.isInClassHeaderTab;
+ switchIndent = other.switchIndent;
+ caseIndent = other.caseIndent;
+ namespaceIndent = other.namespaceIndent;
+ bracketIndent = other.bracketIndent;
+ blockIndent = other.blockIndent;
+ labelIndent = other.labelIndent;
+ preprocessorIndent = other.preprocessorIndent;
+ isInConditional = other.isInConditional;
+ isMinimalConditinalIndentSet = other.isMinimalConditinalIndentSet;
+ shouldForceTabIndentation = other.shouldForceTabIndentation;
+ emptyLineFill = other.emptyLineFill;
+ backslashEndsPrevLine = other.backslashEndsPrevLine;
+ blockCommentNoIndent = other.blockCommentNoIndent;
+ blockCommentNoBeautify = other.blockCommentNoBeautify;
+ previousLineProbationTab = other.previousLineProbationTab;
+ minConditionalIndent = other.minConditionalIndent;
+ parenDepth = other.parenDepth;
+ indentLength = other.indentLength;
+ blockTabCount = other.blockTabCount;
+ leadingWhiteSpaces = other.leadingWhiteSpaces;
+ maxInStatementIndent = other.maxInStatementIndent;
+ templateDepth = other.templateDepth;
+ prevFinalLineSpaceTabCount = other.prevFinalLineSpaceTabCount;
+ prevFinalLineTabCount = other.prevFinalLineTabCount;
+ defineTabCount = other.defineTabCount;
+ quoteChar = other.quoteChar;
+ prevNonSpaceCh = other.prevNonSpaceCh;
+ currentNonSpaceCh = other.currentNonSpaceCh;
+ currentNonLegalCh = other.currentNonLegalCh;
+ prevNonLegalCh = other.prevNonLegalCh;
+}
+
+/**
+ * ASBeautifier's destructor
+ */
+ASBeautifier::~ASBeautifier()
+{
+ DELETE_CONTAINER(headerStack);
+ DELETE_CONTAINER(tempStacks);
+ DELETE_CONTAINER(blockParenDepthStack);
+ DELETE_CONTAINER(blockStatementStack);
+ DELETE_CONTAINER(parenStatementStack);
+ DELETE_CONTAINER(bracketBlockStateStack);
+ DELETE_CONTAINER(inStatementIndentStack);
+ DELETE_CONTAINER(inStatementIndentStackSizeStack);
+ DELETE_CONTAINER(parenIndentStack);
+}
+
+/**
+ * initialize the ASBeautifier.
+ *
+ * init() should be called every time a ABeautifier object is to start
+ * beautifying a NEW source file.
+ * init() recieves a pointer to a DYNAMICALLY CREATED ASSourceIterator object
+ * that will be used to iterate through the source code. This object will be
+ * deleted during the ASBeautifier's destruction, and thus should not be
+ * deleted elsewhere.
+ *
+ * @param iter a pointer to the DYNAMICALLY CREATED ASSourceIterator object.
+ */
+void ASBeautifier::init(ASSourceIterator *iter)
+{
+ sourceIterator = iter;
+ init();
+}
+
+/**
+ * initialize the ASBeautifier.
+ */
+void ASBeautifier::init()
+{
+ initStatic();
+
+ INIT_CONTAINER(waitingBeautifierStack, new vector<ASBeautifier*>);
+ INIT_CONTAINER(activeBeautifierStack, new vector<ASBeautifier*>);
+
+ INIT_CONTAINER(waitingBeautifierStackLengthStack, new vector<int>);
+ INIT_CONTAINER(activeBeautifierStackLengthStack, new vector<int>);
+
+ INIT_CONTAINER(headerStack, new vector<const string*>);
+ INIT_CONTAINER(tempStacks, new vector<vector<const string*>*>);
+ tempStacks->push_back(new vector<const string*>);
+
+ INIT_CONTAINER(blockParenDepthStack, new vector<int>);
+ INIT_CONTAINER(blockStatementStack, new vector<bool>);
+ INIT_CONTAINER(parenStatementStack, new vector<bool>);
+
+ INIT_CONTAINER(bracketBlockStateStack, new vector<bool>);
+ bracketBlockStateStack->push_back(true);
+
+ INIT_CONTAINER(inStatementIndentStack, new vector<int>);
+ INIT_CONTAINER(inStatementIndentStackSizeStack, new vector<int>);
+ inStatementIndentStackSizeStack->push_back(0);
+ INIT_CONTAINER(parenIndentStack, new vector<int>);
+
+ immediatelyPreviousAssignmentOp = NULL;
+ previousLastLineHeader = NULL;
+ currentHeader = NULL;
+
+ isInQuote = false;
+ isInComment = false;
+ isInStatement = false;
+ isInCase = false;
+ isInQuestion = false;
+ isInClassHeader = false;
+ isInClassHeaderTab = false;
+ isInHeader = false;
+ isInOperator = false;
+ isInTemplate = false;
+ isInConditional = false;
+ templateDepth = 0;
+ parenDepth = 0;
+ blockTabCount = 0;
+ leadingWhiteSpaces = 0;
+ prevNonSpaceCh = '{';
+ currentNonSpaceCh = '{';
+ prevNonLegalCh = '{';
+ currentNonLegalCh = '{';
+ quoteChar = ' ';
+ prevFinalLineSpaceTabCount = 0;
+ prevFinalLineTabCount = 0;
+ probationHeader = NULL;
+ backslashEndsPrevLine = false;
+ isInDefine = false;
+ isInDefineDefinition = false;
+ defineTabCount = 0;
+ lineCommentNoBeautify = false;
+ blockCommentNoIndent = false;
+ blockCommentNoBeautify = false;
+ previousLineProbationTab = false;
+ isNonInStatementArray = false;
+ inLineNumber = -1; // for debugging
+ outLineNumber = 0; // for debugging
+}
+
+/**
+ * set indentation style to C/C++.
+ */
+void ASBeautifier::setCStyle()
+{
+ fileType = C_TYPE;
+ isCStyle = true;
+ isJavaStyle = false;
+ isSharpStyle = false;
+}
+
+/**
+ * set indentation style to Java.
+ */
+void ASBeautifier::setJavaStyle()
+{
+ fileType = JAVA_TYPE;
+ isJavaStyle = true;
+ isCStyle = false;
+ isSharpStyle = false;
+}
+
+/**
+ * set indentation style to C#.
+ */
+void ASBeautifier::setSharpStyle()
+{
+ fileType = SHARP_TYPE;
+ isSharpStyle = true;
+ isCStyle = false;
+ isJavaStyle = false;
+}
+
+/**
+ * indent using one tab per indentation
+ */
+void ASBeautifier::setTabIndentation(int length, bool forceTabs)
+{
+ indentString = "\t";
+ indentLength = length;
+ shouldForceTabIndentation = forceTabs;
+
+ if (!isMinimalConditinalIndentSet)
+ minConditionalIndent = indentLength * 2;
+}
+
+/**
+ * indent using a number of spaces per indentation.
+ *
+ * @param length number of spaces per indent.
+ */
+void ASBeautifier::setSpaceIndentation(int length)
+{
+ indentString = string(length, ' ');
+ indentLength = length;
+
+ if (!isMinimalConditinalIndentSet)
+ minConditionalIndent = indentLength * 2;
+}
+
+/**
+ * set the maximum indentation between two lines in a multi-line statement.
+ *
+ * @param max maximum indentation length.
+ */
+void ASBeautifier::setMaxInStatementIndentLength(int max)
+{
+ maxInStatementIndent = max;
+}
+
+/**
+ * set the minimum indentation between two lines in a multi-line condition.
+ *
+ * @param min minimal indentation length.
+ */
+void ASBeautifier::setMinConditionalIndentLength(int min)
+{
+ minConditionalIndent = min;
+ isMinimalConditinalIndentSet = true;
+}
+
+/**
+ * set the state of the bracket indentation option. If true, brackets will
+ * be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setBracketIndent(bool state)
+{
+ bracketIndent = state;
+}
+
+/**
+ * set the state of the block indentation option. If true, entire blocks
+ * will be indented one additional indent, similar to the GNU indent style.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setBlockIndent(bool state)
+{
+ if (state)
+ setBracketIndent(false); // so that we don't have both bracket and block indent
+ blockIndent = state;
+}
+
+/**
+ * set the state of the class indentation option. If true, C++ class
+ * definitions will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setClassIndent(bool state)
+{
+ classIndent = state;
+}
+
+/**
+ * set the state of the switch indentation option. If true, blocks of 'switch'
+ * statements will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setSwitchIndent(bool state)
+{
+ switchIndent = state;
+}
+
+/**
+ * set the state of the case indentation option. If true, lines of 'case'
+ * statements will be indented one additional indent.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setCaseIndent(bool state)
+{
+ caseIndent = state;
+}
+
+/**
+ * set the state of the namespace indentation option.
+ * If true, blocks of 'namespace' statements will be indented one
+ * additional indent. Otherwise, NO indentation will be added.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setNamespaceIndent(bool state)
+{
+ namespaceIndent = state;
+}
+
+/**
+ * set the state of the label indentation option.
+ * If true, labels will be indented one indent LESS than the
+ * current indentation level.
+ * If false, labels will be flushed to the left with NO
+ * indent at all.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setLabelIndent(bool state)
+{
+ labelIndent = state;
+}
+
+/**
+ * set the state of the preprocessor indentation option.
+ * If true, multiline #define statements will be indented.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setPreprocessorIndent(bool state)
+{
+ preprocessorIndent = state;
+}
+
+/**
+ * set the state of the empty line fill option.
+ * If true, empty lines will be filled with the whitespace.
+ * of their previous lines.
+ * If false, these lines will remain empty.
+ *
+ * @param state state of option.
+ */
+void ASBeautifier::setEmptyLineFill(bool state)
+{
+ emptyLineFill = state;
+}
+
+/**
+ * get the number of spaces per indent
+ *
+ * @return value of indentLength option.
+*/
+int ASBeautifier::getIndentLength(void)
+{
+ return indentLength;
+}
+
+/**
+ * get the char used for indentation, space or tab
+ *
+ * @return the char used for indentation.
+ */
+string ASBeautifier::getIndentString(void)
+{
+ return indentString;
+}
+
+/**
+ * get the state of the case indentation option. If true, lines of 'case'
+ * statements will be indented one additional indent.
+ *
+ * @return state of caseIndent option.
+ */
+bool ASBeautifier::getCaseIndent(void)
+{
+ return caseIndent;
+}
+
+/**
+ * get C style identifier.
+ * If true, a C source is being indented.
+ *
+ * @return state of isCStyle option.
+ */
+bool ASBeautifier::getCStyle(void)
+{
+ return isCStyle;
+}
+
+/**
+ * get Java style identifier.
+ * If true, a Java source is being indented.
+ *
+ * @return state of isJavaStyle option.
+ */
+bool ASBeautifier::getJavaStyle(void)
+{
+ return isJavaStyle;
+}
+
+/**
+ * get C# style identifier.
+ * If true, a C# source is being indented.
+ *
+ * @return state of isSharpStyle option.
+ */
+bool ASBeautifier::getSharpStyle(void)
+{
+ return isSharpStyle;
+}
+
+/**
+ * get the state of the empty line fill option.
+ * If true, empty lines will be filled with the whitespace.
+ * of their previous lines.
+ * If false, these lines will remain empty.
+ *
+ * @return state of emptyLineFill option.
+ */
+bool ASBeautifier::getEmptyLineFill(void)
+{
+ return emptyLineFill;
+}
+
+/**
+ * check if there are any indented lines ready to be read by nextLine()
+ *
+ * @return are there any indented lines ready?
+ */
+bool ASBeautifier::hasMoreLines() const
+{
+ return sourceIterator->hasMoreLines();
+}
+
+/**
+ * get the next indented line.
+ *
+ * @return indented line.
+ */
+string ASBeautifier::nextLine()
+{
+ return beautify(sourceIterator->nextLine());
+}
+
+/**
+ * beautify a line of source code.
+ * every line of source code in a source code file should be sent
+ * one after the other to the beautify method.
+ *
+ * @return the indented line.
+ * @param originalLine the original unindented line.
+ */
+string ASBeautifier::beautify(const string &originalLine)
+{
+ string line;
+ bool isInLineComment = false;
+ bool lineStartsInComment = false;
+ bool isInClass = false;
+ bool isInSwitch = false;
+ bool isImmediatelyAfterConst = false;
+ bool isSpecialChar = false;
+ char ch = ' ';
+ char prevCh;
+ string outBuffer; // the newly idented line is bufferd here
+ int tabCount = 0;
+ const string *lastLineHeader = NULL;
+ bool closingBracketReached = false;
+ int spaceTabCount = 0;
+ char tempCh;
+ size_t headerStackSize = headerStack->size();
+ bool shouldIndentBrackettedLine = true;
+ int lineOpeningBlocksNum = 0;
+ int lineClosingBlocksNum = 0;
+ bool previousLineProbation = (probationHeader != NULL);
+ int i;
+
+ currentHeader = NULL;
+ lineStartsInComment = isInComment;
+ blockCommentNoBeautify = blockCommentNoIndent;
+ previousLineProbationTab = false;
+ outLineNumber++;
+
+ // handle and remove white spaces around the line:
+ // If not in comment, first find out size of white space before line,
+ // so that possible comments starting in the line continue in
+ // relation to the preliminary white-space.
+ if (!isInComment)
+ {
+ int strlen = originalLine.length();
+ leadingWhiteSpaces = 0;
+
+ for (int j = 0; j < strlen && isWhiteSpace(originalLine[j]); j++)
+ {
+ if (originalLine[j] == '\t')
+ leadingWhiteSpaces += indentLength;
+ else
+ leadingWhiteSpaces++;
+ }
+ line = trim(originalLine);
+ }
+ else
+ {
+ // convert leading tabs to spaces
+ string spaceTabs(indentLength, ' ');
+ string newLine = originalLine;
+ int strlen = newLine.length();
+
+ for (int j=0; j < leadingWhiteSpaces && j < strlen; j++)
+ {
+ if (newLine[j] == '\t')
+ {
+ newLine.replace(j, 1, spaceTabs);
+ strlen = newLine.length();
+ }
+ }
+
+ // trim the comment leaving the new leading whitespace
+ int trimSize = 0;
+ strlen = newLine.length();
+
+ while (trimSize < strlen
+ && trimSize < leadingWhiteSpaces
+ && isWhiteSpace(newLine[trimSize]))
+ trimSize++;
+
+
+ while (trimSize < strlen && isWhiteSpace(newLine[strlen-1]))
+ strlen--;
+
+ line = newLine.substr(trimSize, strlen);
+ size_t trimEnd = line.find_last_not_of(" \t");
+ if (trimEnd != string::npos)
+ {
+ int spacesToDelete = line.length() - 1 - trimEnd;
+ if (spacesToDelete > 0)
+ line.erase(trimEnd + 1, spacesToDelete);
+ }
+ }
+
+
+ if (line.length() == 0)
+ {
+ if (backslashEndsPrevLine) // must continue to clear variables
+ line = ' ';
+ else if (emptyLineFill)
+ return preLineWS(prevFinalLineSpaceTabCount, prevFinalLineTabCount);
+ else
+ return line;
+ }
+
+ // handle preprocessor commands
+
+ if (isCStyle && !isInComment && (line[0] == '#' || backslashEndsPrevLine))
+ {
+ if (line[0] == '#')
+ {
+ string preproc = trim(string(line.c_str() + 1));
+
+ // When finding a multi-lined #define statement, the original beautifier
+ // 1. sets its isInDefineDefinition flag
+ // 2. clones a new beautifier that will be used for the actual indentation
+ // of the #define. This clone is put into the activeBeautifierStack in order
+ // to be called for the actual indentation.
+ // The original beautifier will have isInDefineDefinition = true, isInDefine = false
+ // The cloned beautifier will have isInDefineDefinition = true, isInDefine = true
+ if (preprocessorIndent && preproc.compare(0, 6, "define") == 0 && line[line.length() - 1] == '\\')
+ {
+ if (!isInDefineDefinition)
+ {
+ ASBeautifier *defineBeautifier;
+
+ // this is the original beautifier
+ isInDefineDefinition = true;
+
+ // push a new beautifier into the active stack
+ // this beautifier will be used for the indentation of this define
+ defineBeautifier = new ASBeautifier(*this);
+ activeBeautifierStack->push_back(defineBeautifier);
+ }
+ else
+ {
+ // the is the cloned beautifier that is in charge of indenting the #define.
+ isInDefine = true;
+ }
+ }
+ else if (preproc.compare(0, 2, "if") == 0)
+ {
+ // push a new beautifier into the stack
+ waitingBeautifierStackLengthStack->push_back(waitingBeautifierStack->size());
+ activeBeautifierStackLengthStack->push_back(activeBeautifierStack->size());
+ waitingBeautifierStack->push_back(new ASBeautifier(*this));
+ }
+ else if (preproc.compare(0, 4/*2*/, "else") == 0)
+ {
+ if (waitingBeautifierStack && !waitingBeautifierStack->empty())
+ {
+ // MOVE current waiting beautifier to active stack.
+ activeBeautifierStack->push_back(waitingBeautifierStack->back());
+ waitingBeautifierStack->pop_back();
+ }
+ }
+ else if (preproc.compare(0, 4, "elif") == 0)
+ {
+ if (waitingBeautifierStack && !waitingBeautifierStack->empty())
+ {
+ // append a COPY current waiting beautifier to active stack, WITHOUT deleting the original.
+ activeBeautifierStack->push_back(new ASBeautifier(*(waitingBeautifierStack->back())));
+ }
+ }
+ else if (preproc.compare(0, 5, "endif") == 0)
+ {
+ int stackLength;
+ ASBeautifier *beautifier;
+
+ if (waitingBeautifierStackLengthStack && !waitingBeautifierStackLengthStack->empty())
+ {
+ stackLength = waitingBeautifierStackLengthStack->back();
+ waitingBeautifierStackLengthStack->pop_back();
+ while ((int) waitingBeautifierStack->size() > stackLength)
+ {
+ beautifier = waitingBeautifierStack->back();
+ waitingBeautifierStack->pop_back();
+ delete beautifier;
+ }
+ }
+
+ if (!activeBeautifierStackLengthStack->empty())
+ {
+ stackLength = activeBeautifierStackLengthStack->back();
+ activeBeautifierStackLengthStack->pop_back();
+ while ((int) activeBeautifierStack->size() > stackLength)
+ {
+ beautifier = activeBeautifierStack->back();
+ activeBeautifierStack->pop_back();
+ delete beautifier;
+ }
+ }
+ }
+ }
+
+ // check if the last char is a backslash
+ if (line.length() > 0)
+ backslashEndsPrevLine = (line[line.length() - 1] == '\\');
+ else
+ backslashEndsPrevLine = false;
+
+ // check if this line ends a multi-line #define
+ // if so, use the #define's cloned beautifier for the line's indentation
+ // and then remove it from the active beautifier stack and delete it.
+ if (!backslashEndsPrevLine && isInDefineDefinition && !isInDefine)
+ {
+ string beautifiedLine;
+ ASBeautifier *defineBeautifier;
+
+ isInDefineDefinition = false;
+ defineBeautifier = activeBeautifierStack->back();
+ activeBeautifierStack->pop_back();
+
+ beautifiedLine = defineBeautifier->beautify(line);
+ delete defineBeautifier;
+ return beautifiedLine;
+ }
+
+ // unless this is a multi-line #define, return this precompiler line as is.
+ if (!isInDefine && !isInDefineDefinition)
+ return originalLine;
+ }
+
+ // if there exists any worker beautifier in the activeBeautifierStack,
+ // then use it instead of me to indent the current line.
+ // variables set by ASFormatter must be updated.
+ if (!isInDefine && activeBeautifierStack != NULL && !activeBeautifierStack->empty())
+ {
+ activeBeautifierStack->back()->inLineNumber = inLineNumber;
+ activeBeautifierStack->back()->outLineNumber = outLineNumber;
+ activeBeautifierStack->back()->lineCommentNoBeautify = lineCommentNoBeautify;
+ activeBeautifierStack->back()->isNonInStatementArray = isNonInStatementArray;
+ return activeBeautifierStack->back()->beautify(line);
+ }
+
+ // calculate preliminary indentation based on data from past lines
+ if (!inStatementIndentStack->empty())
+ spaceTabCount = inStatementIndentStack->back();
+
+
+ for (i = 0; i < (int) headerStackSize; i++)
+ {
+ isInClass = false;
+
+ if (blockIndent || (!(i > 0 && (*headerStack)[i-1] != &AS_OPEN_BRACKET
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)))
+ ++tabCount;
+
+ if (!isJavaStyle && !namespaceIndent && i >= 1
+ && (*headerStack)[i-1] == &AS_NAMESPACE
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)
+ --tabCount;
+
+ if (isCStyle && i >= 1
+ && (*headerStack)[i-1] == &AS_CLASS
+ && (*headerStack)[i] == &AS_OPEN_BRACKET)
+ {
+ if (classIndent)
+ ++tabCount;
+ isInClass = true;
+ }
+
+ // is the switchIndent option is on, indent switch statements an additional indent.
+ else if (switchIndent && i > 1 &&
+ (*headerStack)[i-1] == &AS_SWITCH &&
+ (*headerStack)[i] == &AS_OPEN_BRACKET
+ )
+ {
+ ++tabCount;
+ isInSwitch = true;
+ }
+
+ }
+
+ if (!lineStartsInComment
+ && isCStyle
+ && isInClass
+ && classIndent
+ && headerStackSize >= 2
+ && (*headerStack)[headerStackSize-2] == &AS_CLASS
+ && (*headerStack)[headerStackSize-1] == &AS_OPEN_BRACKET
+ && line[0] == '}')
+ --tabCount;
+
+ else if (!lineStartsInComment
+ && isInSwitch
+ && switchIndent
+ && headerStackSize >= 2
+ && (*headerStack)[headerStackSize-2] == &AS_SWITCH
+ && (*headerStack)[headerStackSize-1] == &AS_OPEN_BRACKET
+ && line[0] == '}')
+ --tabCount;
+
+ if (isInClassHeader)
+ {
+ isInClassHeaderTab = true;
+ tabCount += 2;
+ }
+
+ if (isInConditional)
+ {
+ --tabCount;
+ }
+
+
+ // parse characters in the current line.
+
+ for (i = 0; i < (int) line.length(); i++)
+ {
+ tempCh = line[i];
+
+ prevCh = ch;
+ ch = tempCh;
+
+ outBuffer.append(1, ch);
+
+ if (isWhiteSpace(ch))
+ continue;
+
+ // check for utf8 characters
+ // isalnum() will display an assert message in debug if not bypassed here
+ if (ch < 0)
+ continue;
+
+ // handle special characters (i.e. backslash+character such as \n, \t, ...)
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ continue;
+ }
+ if (!(isInComment || isInLineComment) && line.compare(i, 2, "\\\\") == 0)
+ {
+ outBuffer.append(1, '\\');
+ i++;
+ continue;
+ }
+ if (!(isInComment || isInLineComment) && ch == '\\')
+ {
+ isSpecialChar = true;
+ continue;
+ }
+
+ // handle quotes (such as 'x' and "Hello Dolly")
+ if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\''))
+ if (!isInQuote)
+ {
+ quoteChar = ch;
+ isInQuote = true;
+ }
+ else if (quoteChar == ch)
+ {
+ isInQuote = false;
+ isInStatement = true;
+ continue;
+ }
+ if (isInQuote)
+ continue;
+
+ // handle comments
+
+ if (!(isInComment || isInLineComment) && line.compare(i, 2, "//") == 0)
+ {
+ isInLineComment = true;
+ outBuffer.append(1, '/');
+ i++;
+ continue;
+ }
+ else if (!(isInComment || isInLineComment) && line.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ outBuffer.append(1, '*');
+ i++;
+ size_t j = line.find_first_not_of(" \t");
+ if (!line.compare(j, 2, "/*") == 0) // does line start with comment?
+ blockCommentNoIndent = true; // if no, cannot indent continuation lines
+ continue;
+ }
+ else if ((isInComment || isInLineComment) && line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ outBuffer.append(1, '/');
+ i++;
+ blockCommentNoIndent = false; // ok to indent next comment
+ continue;
+ }
+
+ if (isInComment || isInLineComment)
+ continue;
+
+ // if we have reached this far then we are NOT in a comment or string of special character...
+
+ if (probationHeader != NULL)
+ {
+ if (((probationHeader == &AS_STATIC || probationHeader == &AS_CONST) && ch == '{')
+ || (probationHeader == &AS_SYNCHRONIZED && ch == '('))
+ {
+ // insert the probation header as a new header
+ isInHeader = true;
+ headerStack->push_back(probationHeader);
+
+ // handle the specific probation header
+ isInConditional = (probationHeader == &AS_SYNCHRONIZED);
+ if (probationHeader == &AS_CONST)
+ isImmediatelyAfterConst = true;
+
+ isInStatement = false;
+ // if the probation comes from the previous line, then indent by 1 tab count.
+ if (previousLineProbation && ch == '{')
+ {
+ tabCount++;
+ previousLineProbationTab = true;
+ }
+ previousLineProbation = false;
+ }
+
+ // dismiss the probation header
+ probationHeader = NULL;
+ }
+
+ prevNonSpaceCh = currentNonSpaceCh;
+ currentNonSpaceCh = ch;
+ if (!isLegalNameChar(ch) && ch != ',' && ch != ';')
+ {
+ prevNonLegalCh = currentNonLegalCh;
+ currentNonLegalCh = ch;
+ }
+
+ if (isInHeader)
+ {
+ isInHeader = false;
+ currentHeader = headerStack->back();
+ }
+ else
+ currentHeader = NULL;
+
+ if (isCStyle && isInTemplate
+ && (ch == '<' || ch == '>')
+ && findHeader(line, i, nonAssignmentOperators) == NULL)
+ {
+ if (ch == '<')
+ {
+ ++templateDepth;
+ }
+ else if (ch == '>')
+ {
+ if (--templateDepth <= 0)
+ {
+ if (isInTemplate)
+ ch = ';';
+ else
+ ch = 't';
+ isInTemplate = false;
+ templateDepth = 0;
+ }
+ }
+ }
+
+ // handle parenthesies
+ if (ch == '(' || ch == '[' || ch == ')' || ch == ']')
+ {
+ if (ch == '(' || ch == '[')
+ {
+ if (parenDepth == 0)
+ {
+ parenStatementStack->push_back(isInStatement);
+ isInStatement = true;
+ }
+ parenDepth++;
+
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+
+ if (currentHeader != NULL)
+ registerInStatementIndent(line, i, spaceTabCount, minConditionalIndent/*indentLength*2*/, true);
+ else
+ registerInStatementIndent(line, i, spaceTabCount, 0, true);
+ }
+ else if (ch == ')' || ch == ']')
+ {
+ parenDepth--;
+ if (parenDepth == 0)
+ {
+ isInStatement = parenStatementStack->back();
+ parenStatementStack->pop_back();
+ ch = ' ';
+
+ isInConditional = false;
+ }
+
+ if (!inStatementIndentStackSizeStack->empty())
+ {
+ int previousIndentStackSize = inStatementIndentStackSizeStack->back();
+ inStatementIndentStackSizeStack->pop_back();
+ while (previousIndentStackSize < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+
+ if (!parenIndentStack->empty())
+ {
+ int poppedIndent = parenIndentStack->back();
+ parenIndentStack->pop_back();
+
+ if (i == 0)
+ spaceTabCount = poppedIndent;
+ }
+ }
+ }
+
+ continue;
+ }
+
+
+ if (ch == '{')
+ {
+ bool isBlockOpener;
+ // first, check if '{' is a block-opener or an static-array opener
+ isBlockOpener = ((prevNonSpaceCh == '{' && bracketBlockStateStack->back())
+ || prevNonSpaceCh == '}'
+ || prevNonSpaceCh == ')'
+ || prevNonSpaceCh == ';'
+ || peekNextChar(line, i) == '{'
+ || isNonInStatementArray
+ || isInClassHeader
+// || isBlockOpener
+ || isImmediatelyAfterConst
+ || (isInDefine &&
+ (prevNonSpaceCh == '('
+ || prevNonSpaceCh == '_'
+ || isalnum(prevNonSpaceCh))));
+
+ isInClassHeader = false;
+ if (!isBlockOpener && currentHeader != NULL)
+ {
+ for (size_t n = 0; n < nonParenHeaders.size(); n++)
+ if (currentHeader == nonParenHeaders[n])
+ {
+ isBlockOpener = true;
+ break;
+ }
+ }
+ bracketBlockStateStack->push_back(isBlockOpener);
+ if (!isBlockOpener)
+ {
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+ registerInStatementIndent(line, i, spaceTabCount, 0, true);
+ parenDepth++;
+ if (i == 0)
+ shouldIndentBrackettedLine = false;
+
+ continue;
+ }
+
+ // this bracket is a block opener...
+
+ ++lineOpeningBlocksNum;
+// if (isInClassHeader)
+// isInClassHeader = false;
+
+ if (isInClassHeaderTab)
+ {
+ isInClassHeaderTab = false;
+ // decrease tab count if bracket is broken
+ size_t firstChar = line.find_first_not_of(" \t");
+ if (firstChar != string::npos)
+ if (line[firstChar] == '{' && (int) firstChar == i)
+ tabCount -= 2;
+ }
+
+ // do not allow inStatementIndent - should occur for Java files only
+ if (inStatementIndentStack->size() > 0)
+ {
+ spaceTabCount = 0;
+ inStatementIndentStack->back() = 0;
+ }
+
+ blockParenDepthStack->push_back(parenDepth);
+ blockStatementStack->push_back(isInStatement);
+
+ inStatementIndentStackSizeStack->push_back(inStatementIndentStack->size());
+ if (inStatementIndentStack->size() > 0)
+ inStatementIndentStack->back() = 0;
+
+ blockTabCount += isInStatement ? 1 : 0;
+ parenDepth = 0;
+ isInStatement = false;
+
+ tempStacks->push_back(new vector<const string*>);
+ headerStack->push_back(&AS_OPEN_BRACKET);
+ lastLineHeader = &AS_OPEN_BRACKET;
+
+ continue;
+ }
+
+ //check if a header has been reached
+ if (isWhiteSpace(prevCh))
+ {
+ bool isIndentableHeader = true;
+ const string *newHeader = findHeader(line, i, headers);
+ if (newHeader != NULL)
+ {
+ // if we reached here, then this is a header...
+ isInHeader = true;
+
+ vector<const string*> *lastTempStack;
+ if (tempStacks->empty())
+ lastTempStack = NULL;
+ else
+ lastTempStack = tempStacks->back();
+
+ // if a new block is opened, push a new stack into tempStacks to hold the
+ // future list of headers in the new block.
+
+ // take care of the special case: 'else if (...)'
+ if (newHeader == &AS_IF && lastLineHeader == &AS_ELSE)
+ {
+ headerStack->pop_back();
+ }
+
+ // take care of 'else'
+ else if (newHeader == &AS_ELSE)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfIf = indexOf(*lastTempStack, &AS_IF);
+ if (indexOfIf != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'if'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfIf - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ /*
+ * If the above if is not true, i.e. no 'if' before the 'else',
+ * then nothing beautiful will come out of this...
+ * I should think about inserting an Exception here to notify the caller of this...
+ */
+ }
+ }
+
+ // check if 'while' closes a previous 'do'
+ else if (newHeader == &AS_WHILE)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfDo = indexOf(*lastTempStack, &AS_DO);
+ if (indexOfDo != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'do'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfDo - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ }
+ }
+ // check if 'catch' closes a previous 'try' or 'catch'
+ else if (newHeader == &AS_CATCH || newHeader == &AS_FINALLY)
+ {
+ if (lastTempStack != NULL)
+ {
+ int indexOfTry = indexOf(*lastTempStack, &AS_TRY);
+ if (indexOfTry == -1)
+ indexOfTry = indexOf(*lastTempStack, &AS_CATCH);
+ if (indexOfTry != -1)
+ {
+ // recreate the header list in headerStack up to the previous 'try'
+ // from the temporary snapshot stored in lastTempStack.
+ int restackSize = lastTempStack->size() - indexOfTry - 1;
+ for (int r = 0; r < restackSize; r++)
+ {
+ headerStack->push_back(lastTempStack->back());
+ lastTempStack->pop_back();
+ }
+
+ if (!closingBracketReached)
+ tabCount += restackSize;
+ }
+ }
+ }
+ else if (newHeader == &AS_CASE)
+ {
+ isInCase = true;
+ --tabCount;
+ }
+ else if (newHeader == &AS_DEFAULT)
+ {
+ isInCase = true;
+ --tabCount;
+ }
+ else if (newHeader == &AS_STATIC
+ || newHeader == &AS_SYNCHRONIZED
+ || (newHeader == &AS_CONST && isCStyle))
+ {
+ if (!headerStack->empty() &&
+ (headerStack->back() == &AS_STATIC
+ || headerStack->back() == &AS_SYNCHRONIZED
+ || headerStack->back() == &AS_CONST))
+ {
+ isIndentableHeader = false;
+ }
+ else
+ {
+ isIndentableHeader = false;
+ probationHeader = newHeader;
+ }
+ }
+ else if (newHeader == &AS_CONST)
+ {
+ isIndentableHeader = false;
+ }
+ else if (newHeader == &AS_TEMPLATE)
+ {
+ if (isCStyle)
+ isInTemplate = true;
+ isIndentableHeader = false;
+ }
+
+
+ if (isIndentableHeader)
+ {
+ headerStack->push_back(newHeader);
+ isInStatement = false;
+ if (indexOf(nonParenHeaders, newHeader) == -1)
+ {
+ isInConditional = true;
+ }
+ lastLineHeader = newHeader;
+ }
+ else
+ isInHeader = false;
+
+ outBuffer.append(newHeader->substr(1));
+ i += newHeader->length() - 1;
+
+ continue;
+ }
+ }
+
+ if (isCStyle && !isalpha(prevCh)
+ && line.compare(i, 8, "operator") == 0 && !isalnum(line[i+8]))
+ {
+ isInOperator = true;
+ outBuffer.append(AS_OPERATOR.substr(1));
+ i += 7;
+ continue;
+ }
+
+ // "new" operator is a pointer, not a calculation
+ if (!isalpha(prevCh)
+ && line.compare(i, 3, "new") == 0 && !isalnum(line[i+3]))
+ {
+ if (prevNonSpaceCh == '=' && isInStatement && !inStatementIndentStack->empty())
+ inStatementIndentStack->back() = 0;
+ }
+
+ if (ch == '?')
+ isInQuestion = true;
+
+
+ // special handling of 'case' statements
+ if (ch == ':')
+ {
+ if ((int) line.length() > i + 1 && line[i+1] == ':') // look for ::
+ {
+ ++i;
+ outBuffer.append(1, ':');
+ ch = ' ';
+ continue;
+ }
+
+ else if (isInQuestion)
+ {
+ isInQuestion = false;
+ }
+
+ else if (isCStyle && isInClass && prevNonSpaceCh != ')')
+ {
+ --tabCount;
+ // found a 'private:' or 'public:' inside a class definition
+ // so do nothing special
+ }
+
+ else if (!isJavaStyle && isInClassHeader)
+ {
+ // found a 'class A : public B' definition
+ // so do nothing special
+ }
+
+ else if (isJavaStyle && lastLineHeader == &AS_FOR)
+ {
+ // found a java for-each statement
+ // so do nothing special
+ }
+
+ else if (isCStyle && prevNonSpaceCh == ')')
+ {
+ isInClassHeader = true;
+ if (i == 0)
+ tabCount += 2;
+ }
+ else
+ {
+ currentNonSpaceCh = ';'; // so that brackets after the ':' will appear as block-openers
+ if (isInCase)
+ {
+ isInCase = false;
+ ch = ';'; // from here on, treat char as ';'
+ }
+
+
+ else // is in a label (e.g. 'label1:')
+ {
+ if (labelIndent)
+ --tabCount; // unindent label by one indent
+ else
+ tabCount = 0; // completely flush indent to left
+ }
+
+
+
+ }
+ }
+
+ if ((ch == ';' || (parenDepth > 0 && ch == ',')) && !inStatementIndentStackSizeStack->empty())
+ while ((int) inStatementIndentStackSizeStack->back() + (parenDepth > 0 ? 1 : 0)
+ < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+
+
+ // handle ends of statements
+ if ((ch == ';' && parenDepth == 0) || ch == '}'/* || (ch == ',' && parenDepth == 0)*/)
+ {
+ if (ch == '}')
+ {
+ // first check if this '}' closes a previous block, or a static array...
+ if (!bracketBlockStateStack->empty())
+ {
+ bool bracketBlockState = bracketBlockStateStack->back();
+ bracketBlockStateStack->pop_back();
+ if (!bracketBlockState)
+ {
+ if (!inStatementIndentStackSizeStack->empty())
+ {
+ // this bracket is a static array
+
+ int previousIndentStackSize = inStatementIndentStackSizeStack->back();
+ inStatementIndentStackSizeStack->pop_back();
+ while (previousIndentStackSize < (int) inStatementIndentStack->size())
+ inStatementIndentStack->pop_back();
+ parenDepth--;
+ if (i == 0)
+ shouldIndentBrackettedLine = false;
+
+ if (!parenIndentStack->empty())
+ {
+ int poppedIndent = parenIndentStack->back();
+ parenIndentStack->pop_back();
+ if (i == 0)
+ spaceTabCount = poppedIndent;
+ }
+ }
+ continue;
+ }
+ }
+
+ // this bracket is block closer...
+
+ ++lineClosingBlocksNum;
+
+ if (!inStatementIndentStackSizeStack->empty())
+ inStatementIndentStackSizeStack->pop_back();
+
+ if (!blockParenDepthStack->empty())
+ {
+ parenDepth = blockParenDepthStack->back();
+ blockParenDepthStack->pop_back();
+ isInStatement = blockStatementStack->back();
+ blockStatementStack->pop_back();
+
+ if (isInStatement)
+ blockTabCount--;
+ }
+
+ closingBracketReached = true;
+ int headerPlace = indexOf(*headerStack, &AS_OPEN_BRACKET);
+ if (headerPlace != -1)
+ {
+ const string *popped = headerStack->back();
+ while (popped != &AS_OPEN_BRACKET)
+ {
+ headerStack->pop_back();
+ popped = headerStack->back();
+ }
+ headerStack->pop_back();
+
+ if (!tempStacks->empty())
+ {
+ vector<const string*> *temp = tempStacks->back();
+ tempStacks->pop_back();
+ delete temp;
+ }
+ }
+
+
+ ch = ' '; // needed due to cases such as '}else{', so that headers ('else' tn tih case) will be identified...
+ }
+
+ /*
+ * Create a temporary snapshot of the current block's header-list in the
+ * uppermost inner stack in tempStacks, and clear the headerStack up to
+ * the begining of the block.
+ * Thus, the next future statement will think it comes one indent past
+ * the block's '{' unless it specifically checks for a companion-header
+ * (such as a previous 'if' for an 'else' header) within the tempStacks,
+ * and recreates the temporary snapshot by manipulating the tempStacks.
+ */
+ if (!tempStacks->back()->empty())
+ while (!tempStacks->back()->empty())
+ tempStacks->back()->pop_back();
+ while (!headerStack->empty() && headerStack->back() != &AS_OPEN_BRACKET)
+ {
+ tempStacks->back()->push_back(headerStack->back());
+ headerStack->pop_back();
+ }
+
+ if (parenDepth == 0 && ch == ';')
+ isInStatement = false;
+
+ previousLastLineHeader = NULL;
+ isInClassHeader = false;
+ isInQuestion = false;
+
+ continue;
+ }
+
+
+ // check for preBlockStatements ONLY if not within parenthesies
+ // (otherwise 'struct XXX' statements would be wrongly interpreted...)
+ if (isWhiteSpace(prevCh) && !isInTemplate && parenDepth == 0)
+ {
+ const string *newHeader = findHeader(line, i, preBlockStatements);
+ if (newHeader != NULL)
+ {
+ isInClassHeader = true;
+ outBuffer.append(newHeader->substr(1));
+ i += newHeader->length() - 1;
+ headerStack->push_back(newHeader);
+ }
+ }
+
+ // Handle operators
+
+ immediatelyPreviousAssignmentOp = NULL;
+
+ // Check if an operator has been reached.
+ const string *foundAssignmentOp = findHeader(line, i, assignmentOperators, false);
+ if (foundAssignmentOp == &AS_RETURN)
+ foundAssignmentOp = findHeader(line, i, assignmentOperators, true);
+ const string *foundNonAssignmentOp = findHeader(line, i, nonAssignmentOperators, false);
+
+ // Since findHeader's boundry checking was not used above, it is possible
+ // that both an assignment op and a non-assignment op where found,
+ // e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the
+ // found operator.
+ if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL)
+ if (foundAssignmentOp->length() < foundNonAssignmentOp->length())
+ foundAssignmentOp = NULL;
+ else
+ foundNonAssignmentOp = NULL;
+
+ if (foundNonAssignmentOp != NULL)
+ {
+ if (foundNonAssignmentOp->length() > 1)
+ {
+ outBuffer.append(foundNonAssignmentOp->substr(1));
+ i += foundNonAssignmentOp->length() - 1;
+ }
+ }
+
+ else if (foundAssignmentOp != NULL)
+ {
+ if (foundAssignmentOp->length() > 1)
+ {
+ outBuffer.append(foundAssignmentOp->substr(1));
+ i += foundAssignmentOp->length() - 1;
+ }
+
+ if (!isInOperator && !isInTemplate && !isNonInStatementArray)
+ {
+ registerInStatementIndent(line, i, spaceTabCount, 0, false);
+ immediatelyPreviousAssignmentOp = foundAssignmentOp;
+ isInStatement = true;
+ }
+ }
+
+ if (isInOperator)
+ isInOperator = false;
+ }
+
+ // handle special cases of unindentation:
+
+ /*
+ * if '{' doesn't follow an immediately previous '{' in the headerStack
+ * (but rather another header such as "for" or "if", then unindent it
+ * by one indentation relative to its block.
+ */
+
+ if (!lineStartsInComment
+ && !blockIndent
+ && outBuffer.length() > 0
+ && outBuffer[0] == '{'
+ && !(lineOpeningBlocksNum > 0 && lineOpeningBlocksNum == lineClosingBlocksNum)
+ && !(headerStack->size() > 1 && (*headerStack)[headerStack->size()-2] == &AS_OPEN_BRACKET)
+ && shouldIndentBrackettedLine)
+ --tabCount;
+
+ else if (!lineStartsInComment
+ && outBuffer.length() > 0
+ && outBuffer[0] == '}'
+ && shouldIndentBrackettedLine)
+ --tabCount;
+
+ // correctly indent one-line-blocks...
+ else if (!lineStartsInComment
+ && outBuffer.length() > 0
+ && lineOpeningBlocksNum > 0
+ && lineOpeningBlocksNum == lineClosingBlocksNum
+ && previousLineProbationTab)
+ --tabCount; //lineOpeningBlocksNum - (blockIndent ? 1 : 0);
+
+ if (tabCount < 0)
+ tabCount = 0;
+
+ // take care of extra bracket indentatation option...
+ if (bracketIndent && outBuffer.length() > 0 && shouldIndentBrackettedLine)
+ if (outBuffer[0] == '{' || outBuffer[0] == '}')
+ tabCount++;
+
+
+ if (isInDefine)
+ {
+ if (outBuffer[0] == '#')
+ {
+ string preproc = trim(string(outBuffer.c_str() + 1));
+ if (preproc.compare(0, 6, "define") == 0)
+ {
+ if (!inStatementIndentStack->empty()
+ && inStatementIndentStack->back() > 0)
+ {
+ defineTabCount = tabCount;
+ }
+ else
+ {
+ defineTabCount = tabCount - 1;
+ tabCount--;
+ }
+ }
+ }
+
+ tabCount -= defineTabCount;
+ }
+
+ if (tabCount < 0)
+ tabCount = 0;
+ if (lineCommentNoBeautify || blockCommentNoBeautify)
+ tabCount = spaceTabCount = 0;
+
+ // finally, insert indentations into begining of line
+
+ prevFinalLineSpaceTabCount = spaceTabCount;
+ prevFinalLineTabCount = tabCount;
+
+ if (shouldForceTabIndentation)
+ {
+ tabCount += spaceTabCount / indentLength;
+ spaceTabCount = spaceTabCount % indentLength;
+ }
+
+ outBuffer = preLineWS(spaceTabCount, tabCount) + outBuffer;
+
+ if (lastLineHeader != NULL)
+ previousLastLineHeader = lastLineHeader;
+
+ return outBuffer;
+}
+
+
+string ASBeautifier::preLineWS(int spaceTabCount, int tabCount)
+{
+ string ws;
+
+ for (int i = 0; i < tabCount; i++)
+ ws += indentString;
+
+ while ((spaceTabCount--) > 0)
+ ws += string(" ");
+
+ return ws;
+
+}
+
+/**
+ * register an in-statement indent.
+ */
+void ASBeautifier::registerInStatementIndent(const string &line, int i, int spaceTabCount,
+ int minIndent, bool updateParenStack)
+{
+ int inStatementIndent;
+ int remainingCharNum = line.length() - i;
+ int nextNonWSChar = getNextProgramCharDistance(line, i);
+
+ // if indent is around the last char in the line, indent instead 2 spaces from the previous indent
+ if (nextNonWSChar == remainingCharNum)
+ {
+ int previousIndent = spaceTabCount;
+ if (!inStatementIndentStack->empty())
+ previousIndent = inStatementIndentStack->back();
+
+ inStatementIndentStack->push_back(/*2*/ indentLength + previousIndent);
+ if (updateParenStack)
+ parenIndentStack->push_back(previousIndent);
+ return;
+ }
+
+ if (updateParenStack)
+ parenIndentStack->push_back(i + spaceTabCount);
+
+ inStatementIndent = i + nextNonWSChar + spaceTabCount;
+
+ if (i + nextNonWSChar < minIndent)
+ inStatementIndent = minIndent + spaceTabCount;
+
+ if (i + nextNonWSChar > maxInStatementIndent)
+ inStatementIndent = indentLength * 2 + spaceTabCount;
+
+ if (!inStatementIndentStack->empty() &&
+ inStatementIndent < inStatementIndentStack->back())
+ inStatementIndent = inStatementIndentStack->back();
+
+ if (isNonInStatementArray)
+ inStatementIndent = 0;
+
+ inStatementIndentStack->push_back(inStatementIndent);
+}
+
+/**
+ * get distance to the next non-white sspace, non-comment character in the line.
+ * if no such character exists, return the length remaining to the end of the line.
+ */
+int ASBeautifier::getNextProgramCharDistance(const string &line, int i)
+{
+ bool inComment = false;
+ int remainingCharNum = line.length() - i;
+ int charDistance;
+ char ch;
+
+ for (charDistance = 1; charDistance < remainingCharNum; charDistance++)
+ {
+ ch = line[i + charDistance];
+ if (inComment)
+ {
+ if (line.compare(i + charDistance, 2, "*/") == 0)
+ {
+ charDistance++;
+ inComment = false;
+ }
+ continue;
+ }
+ else if (isWhiteSpace(ch))
+ continue;
+ else if (ch == '/')
+ {
+ if (line.compare(i + charDistance, 2, "//") == 0)
+ return remainingCharNum;
+ else if (line.compare(i + charDistance, 2, "/*") == 0)
+ {
+ charDistance++;
+ inComment = true;
+ }
+ }
+ else
+ return charDistance;
+ }
+
+ return charDistance;
+}
+
+
+/**
+ * check if a specific line position contains a header, out of several possible headers.
+ *
+ * @return a pointer to the found header. if no header was found then return NULL.
+ */
+const string *ASBeautifier::findHeader(const string &line, int i, const vector<const string*> &possibleHeaders, bool checkBoundry)
+{
+ int maxHeaders = possibleHeaders.size();
+ // const string *header = NULL;
+ int p;
+
+ for (p = 0; p < maxHeaders; p++)
+ {
+ const string *header = possibleHeaders[p];
+
+ if (line.compare(i, header->length(), header->c_str()) == 0)
+ {
+ // check that this is a header and not a part of a longer word
+ // (e.g. not at its begining, not at its middle...)
+
+ int lineLength = line.length();
+ int headerEnd = i + header->length();
+ char startCh = (*header)[0]; // first char of header
+ char endCh = 0; // char just after header
+ char prevCh = 0; // char just before header
+
+ if (headerEnd < lineLength)
+ {
+ endCh = line[headerEnd];
+ }
+ if (i > 0)
+ {
+ prevCh = line[i-1];
+ }
+
+ if (!checkBoundry)
+ {
+ return header;
+ }
+ else if (prevCh != 0
+ && isLegalNameChar(startCh)
+ && isLegalNameChar(prevCh))
+ {
+ return NULL;
+ }
+ else if (headerEnd >= lineLength
+ || !isLegalNameChar(startCh)
+ || !isLegalNameChar(endCh))
+ {
+ return header;
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+/**
+ * find the index number of a string element in a container of strings
+ *
+ * @return the index number of element in the ocntainer. -1 if element not found.
+ * @param container a vector of strings.
+ * @param element the element to find .
+ */
+int ASBeautifier::indexOf(vector<const string*> &container, const string *element)
+{
+ vector<const string*>::const_iterator where;
+
+ where = find(container.begin(), container.end(), element);
+ if (where == container.end())
+ return -1;
+ else
+ return (int) (where - container.begin());
+}
+
+/**
+ * trim removes the white space surrounding a line.
+ *
+ * @return the trimmed line.
+ * @param str the line to trim.
+ */
+string ASBeautifier::trim(const string &str)
+{
+
+ int start = 0;
+ int end = str.length() - 1;
+
+ while (start < end && isWhiteSpace(str[start]))
+ start++;
+
+ while (start <= end && isWhiteSpace(str[end]))
+ end--;
+
+ string returnStr(str, start, end + 1 - start);
+ return returnStr;
+}
+
+/**
+* peek at the next unread character.
+*
+* @return the next unread character.
+* @param line the line to check.
+* @param i the current char position on the line.
+*/
+char ASBeautifier::peekNextChar(string &line, int i)
+{
+ char ch = ' ';
+ size_t peekNum = line.find_first_not_of(" \t", i + 1);
+
+ if (peekNum == string::npos)
+ return ch;
+
+ ch = line[peekNum];
+
+ return ch;
+}
+
+
+} // end namespace astyle
+
diff --git a/lib/astyle/ASEnhancer.cpp b/lib/astyle/ASEnhancer.cpp
new file mode 100644
index 00000000..6fea5970
--- /dev/null
+++ b/lib/astyle/ASEnhancer.cpp
@@ -0,0 +1,483 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * ASEnhancer.cpp
+ *
+ * This file is a part of "Artistic Style" - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * http://astyle.sourceforge.net
+ *
+ * The "Artistic Style" project, including all files needed to
+ * compile it, is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this project; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+// can trace only if NDEBUG is not defined
+#ifndef NDEBUG
+// #define TRACEswitch
+// #define TRACEcase
+// #define TRACEmisc
+#endif
+
+#include "astyle.h"
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+#ifdef TRACEswitch
+#define TRswitch(a,b) *traceOut << lineNumber << a << b << endl;
+#else
+#define TRswitch(a,b) ((void)0)
+#endif // TRACEswitch
+#ifdef TRACEcase
+#define TRcase(a,b) *traceOut << lineNumber << a << b << endl;
+#else
+#define TRcase(a,b) ((void)0)
+#endif // TRACEcase
+#ifdef TRACEmisc
+#define TRmisc(a) *traceOut << lineNumber << a << endl;
+#else
+#define TRmisc(a) ((void)0)
+#endif // TRACEmisc
+
+
+namespace astyle
+{
+
+// ---------------------------- functions for ASEnhancer Class -------------------------------------
+
+/**
+ * ASEnhancer constructor
+ */
+ASEnhancer::ASEnhancer()
+{
+ // variables are initialized by init()
+ traceOut = new stringstream;
+}
+
+/**
+ * Destructor of ASEnhancer
+ * Display the TRACE entries.
+ */
+ASEnhancer::~ASEnhancer()
+{
+#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
+ string line;
+ string msg = "TRACE Entries\n\n";
+ char countLine[50];
+ int count = 0;
+
+ while (getline(*traceOut, line))
+ {
+ msg += line + '\n';
+ count++;
+ }
+ sprintf(countLine, "\n%d Entries", count);
+ msg += countLine;
+ // write a text file to "My Documents" (Windows)
+ char filename [_MAX_PATH + _MAX_FNAME + _MAX_EXT + 1]; // full path and filename
+ strcpy(filename, getenv("USERPROFILE"));
+ strcat(filename, "\\My Documents\\tracee.txt");
+ ofstream outfile(filename);
+ outfile << msg;
+ outfile.close();
+#endif
+ delete traceOut;
+}
+
+/**
+ * initialize the ASEnhancer.
+ *
+ * init() is called each time an ASFormatter object is initialized.
+ */
+void ASEnhancer::init(int _indentLength,
+ string _indentString,
+ bool _isCStyle,
+ bool _isJavaStyle,
+ bool _isSharpStyle,
+ bool _caseIndent,
+ bool _emptyLineFill)
+{
+ // formatting variables from ASFormatter and ASBeautifier
+ indentLength = _indentLength;
+ if (_indentString.compare(0, 1, "\t") == 0)
+ useTabs = true;
+ else
+ useTabs = false;
+ isCStyle = _isCStyle;
+ isJavaStyle = _isJavaStyle;
+ isSharpStyle = _isSharpStyle;
+ caseIndent = _caseIndent;
+ emptyLineFill = _emptyLineFill;
+
+ // unindent variables
+ lineNumber = 0;
+ bracketCount = 0;
+ isInComment = false;
+ isInQuote = false;
+ switchDepth = 0;
+ lookingForCaseBracket = false;
+ unindentNextLine = false;
+
+#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
+ *traceOut << "New file -------------" << endl;
+#endif
+}
+
+/**
+ * additional formatting for line of source code.
+ * every line of source code in a source code file should be sent
+ * one after the other to this function.
+ * indents event tables
+ * unindents the case blocks
+ *
+ * @param line the original formatted line will be updated if necessary.
+ */
+void ASEnhancer::enhance(string &line)
+{
+ static vector<switchVariables> swVector; // stack vector of switch variables
+ static switchVariables sw; // switch variables struct
+
+ static bool nextLineIsEventTable; // begin event table is reached
+ static bool isInEventTable; // need to indent an event table
+
+ bool isSpecialChar = false;
+ size_t lineLength; // length of the line being parsed
+
+ lineNumber++;
+ lineLength = line.length();
+
+ // check for beginning of event table
+ if (nextLineIsEventTable)
+ {
+ isInEventTable = true;
+ nextLineIsEventTable = false;
+ }
+
+ if (lineLength == 0
+ && ! isInEventTable
+ && ! emptyLineFill)
+ return;
+
+ // test for unindent on attached brackets
+ if (unindentNextLine)
+ {
+ sw.unindentDepth++;
+ sw.unindentCase = true;
+ unindentNextLine = false;
+ TRcase(" unindent case ", sw.unindentDepth);
+ }
+
+ // parse characters in the current line.
+
+ for (size_t i = 0; i < lineLength; i++)
+ {
+ char ch = line[i];
+
+ // bypass whitespace
+ if (isWhiteSpaceX(ch))
+ continue;
+
+ // handle special characters (i.e. backslash+character such as \n, \t, ...)
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ continue;
+ }
+ if (!(isInComment) && line.compare(i, 2, "\\\\") == 0)
+ {
+ i++;
+ continue;
+ }
+ if (!(isInComment) && ch == '\\')
+ {
+ isSpecialChar = true;
+ continue;
+ }
+
+ // handle quotes (such as 'x' and "Hello Dolly")
+ if (!(isInComment) && (ch == '"' || ch == '\''))
+ if (!isInQuote)
+ {
+ quoteChar = ch;
+ isInQuote = true;
+ }
+ else if (quoteChar == ch)
+ {
+ isInQuote = false;
+ continue;
+ }
+
+ if (isInQuote)
+ continue;
+
+ // handle comments
+
+ if (!(isInComment) && line.compare(i, 2, "//") == 0)
+ {
+ // check for windows line markers
+ if (line.compare(i + 2, 1, "\xf0") > 0)
+ lineNumber--;
+ break; // finished with the line
+ }
+ else if (!(isInComment) && line.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ i++;
+ continue;
+ }
+ else if ((isInComment) && line.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ i++;
+ continue;
+ }
+
+ if (isInComment)
+ continue;
+
+ // if we have reached this far then we are NOT in a comment or string of special characters
+
+ if (line[i] == '{') // if open bracket
+ bracketCount++;
+
+ if (line[i] == '}') // if close bracket
+ bracketCount--;
+
+ // ---------------- process event tables --------------------------------------
+
+ // check for event table begin
+ if (findKeyword(line, i, "BEGIN_EVENT_TABLE")
+ || findKeyword(line, i, "BEGIN_MESSAGE_MAP"))
+ nextLineIsEventTable = true;
+
+ // check for event table end
+ if (findKeyword(line, i, "END_EVENT_TABLE")
+ || findKeyword(line, i, "END_MESSAGE_MAP"))
+ isInEventTable = false;
+
+ // ---------------- process switch statements ---------------------------------
+
+ if (findKeyword(line, i, "switch")) // if switch statement
+ {
+ switchDepth++; // bump switch depth
+ TRswitch(" switch ", switchDepth);
+ swVector.push_back(sw); // save current variables
+ sw.switchBracketCount = 0;
+ sw.unindentCase = false; // don't clear case until end of switch
+ i += 5; // bypass switch statement
+ continue;
+ }
+
+ // just want switch statements from this point
+
+ if (caseIndent || switchDepth == 0) // from here just want switch statements
+ continue; // get next char
+
+ if (line[i] == '{') // if open bracket
+ {
+ sw.switchBracketCount++;
+ if (lookingForCaseBracket) // if 1st after case statement
+ {
+ sw.unindentCase = true; // unindenting this case
+ sw.unindentDepth++; // bump depth
+ lookingForCaseBracket = false; // not looking now
+ TRcase(" unindent case ", sw.unindentDepth);
+ }
+ continue;
+ }
+
+ lookingForCaseBracket = false; // no opening bracket, don't indent
+
+ if (line[i] == '}') // if close bracket
+ {
+ sw.switchBracketCount--;
+ if (sw.switchBracketCount == 0) // if end of switch statement
+ {
+ TRswitch(" endsw ", switchDepth);
+ switchDepth--; // one less switch
+ sw = swVector.back(); // restore sw struct
+ swVector.pop_back(); // remove last entry from stack
+ }
+ continue;
+ }
+
+ // look for case or default header
+
+ if (findKeyword(line, i, "case") || findKeyword(line, i, "default"))
+ {
+ if (sw.unindentCase) // if unindented last case
+ {
+ sw.unindentCase = false; // stop unindenting previous case
+ sw.unindentDepth--; // reduce depth
+ }
+ for (; i < lineLength; i++) // bypass colon
+ {
+ if (line[i] == ':')
+ if ((i + 1 < lineLength) && (line[i + 1] == ':'))
+ i++; // bypass scope resolution operator
+ else
+ break;
+ }
+ i++;
+ for (; i < lineLength; i++) // bypass whitespace
+ {
+ if (!(isWhiteSpaceX(line[i])))
+ break;
+ }
+ if (i < lineLength) // check for bracket
+ {
+ if (line[i] == '{') // if bracket found
+ {
+ sw.switchBracketCount++;
+ unindentNextLine = true; // start unindenting on next line
+ continue;
+ }
+ }
+ lookingForCaseBracket = true; // bracket must be on next line
+ i--; // need to check for comments
+ continue;
+ }
+ } // end of for loop
+
+ if (isInEventTable) // if need to indent
+ indentLine(line, 1); // do it
+
+ if (sw.unindentDepth > 0) // if need to unindent
+ unindentLine(line, sw.unindentDepth); // do it
+}
+
+/**
+ * indent a line by a given number of tabsets
+ * by inserting leading whitespace to the line argument.
+ *
+ * @param line a pointer to the line to indent.
+ * @param unindent the number of tabsets to insert.
+ * @return the number of characters inserted.
+ */
+int ASEnhancer::indentLine(string &line, const int indent) const
+{
+ if (line.length() == 0
+ && ! emptyLineFill)
+ return 0;
+
+ size_t charsToInsert; // number of chars to insert
+
+ if (useTabs) // if formatted with tabs
+ {
+ charsToInsert = indent; // tabs to insert
+ line.insert((size_t) 0, charsToInsert, '\t'); // insert the tabs
+ }
+ else
+ {
+ charsToInsert = indent * indentLength; // compute chars to insert
+ line.insert((size_t)0, charsToInsert, ' '); // insert the spaces
+ }
+
+ return charsToInsert;
+}
+
+/**
+ * unindent a line by a given number of tabsets
+ * by erasing the leading whitespace from the line argument.
+ *
+ * @param line a pointer to the line to unindent.
+ * @param unindent the number of tabsets to erase.
+ * @return the number of characters erased.
+ */
+int ASEnhancer::unindentLine(string &line, const int unindent) const
+{
+ size_t whitespace = line.find_first_not_of(" \t");
+
+ if (whitespace == string::npos) // if line is blank
+ whitespace = line.length(); // must remove padding, if any
+
+ if (whitespace == 0)
+ return 0;
+
+ size_t charsToErase; // number of chars to erase
+
+ if (useTabs) // if formatted with tabs
+ {
+ charsToErase = unindent; // tabs to erase
+ if (charsToErase <= whitespace) // if there is enough whitespace
+ line.erase(0, charsToErase); // erase the tabs
+ else
+ charsToErase = 0;
+ }
+ else
+ {
+ charsToErase = unindent * indentLength; // compute chars to erase
+ if (charsToErase <= whitespace) // if there is enough whitespace
+ line.erase(0, charsToErase); // erase the spaces
+ else
+ charsToErase = 0;
+ }
+
+ return charsToErase;
+}
+
+/**
+ * check if a specific line position contains a keyword.
+ *
+ * @return true if the word was found. false if the word was not found.
+ */
+bool ASEnhancer::findKeyword(const string &line, int i, const char *keyword) const
+{
+ if (line.compare(i, strlen(keyword), keyword) == 0)
+ {
+ // check that this is a header and not a part of a longer word
+ // (e.g. not at its begining, not at its middle...)
+
+ int lineLength = line.length();
+ int wordEnd = i + strlen(keyword);
+ char startCh = keyword[0]; // first char of header
+ char endCh = 0; // char just after header
+ char prevCh = 0; // char just before header
+
+ if (wordEnd < lineLength)
+ {
+ endCh = line[wordEnd];
+ }
+ if (i > 0)
+ {
+ prevCh = line[i-1];
+ }
+
+ if (prevCh != 0
+ && isLegalNameCharX(startCh)
+ && isLegalNameCharX(prevCh))
+ {
+ return false;
+ }
+ else if (wordEnd >= lineLength
+ || !isLegalNameCharX(startCh)
+ || !isLegalNameCharX(endCh))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ return false;
+}
+
+} // end namespace astyle
diff --git a/lib/astyle/ASFormatter.cpp b/lib/astyle/ASFormatter.cpp
new file mode 100644
index 00000000..eb418760
--- /dev/null
+++ b/lib/astyle/ASFormatter.cpp
@@ -0,0 +1,2197 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * ASFormatter.cpp
+ *
+ * This file is a part of "Artistic Style" - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * http://astyle.sourceforge.net
+ *
+ * The "Artistic Style" project, including all files needed to
+ * compile it, is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this project; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+#include <algorithm>
+#include <fstream>
+#include <iostream>
+#ifdef __VMS
+#include <assert>
+#else
+#include <cassert>
+#endif
+
+// can trace only if NDEBUG is not defined
+#ifndef NDEBUG
+// #define TRACEunpad
+// #define TRACEcomment
+// #define TRACEheader
+// #define TRACEbracket
+// #define TRACEarray
+#if defined(TRACEunpad) || defined(TRACEcomment) || defined(TRACEheader) \
+|| defined(TRACEbracket) || defined(TRACEarray)
+ofstream *traceOutF;
+#define TRACEF
+#endif
+#endif
+
+#ifdef TRACEunpad
+#define TRunpad(a,b,c) if(b > 0 || c > 0) *traceOutF << outLineNumber << " " << b << a << c << endl
+#else
+#define TRunpad(a,b,c) ((void)0)
+#endif
+
+#ifdef TRACEcomment
+#define TRcomment(a) *traceOutF << outLineNumber << " " << a << endl
+#else
+#define TRcomment(a) ((void)0)
+#endif
+
+#ifdef TRACEheader
+#define TRxtra(a) *traceOutF << outLineNumber << " " << a << endl
+#else
+#define TRxtra(a) ((void)0)
+#endif
+
+#ifdef TRACEbracket
+#define TRbracket(a) *traceOutF << outLineNumber << " " << a << endl
+#else
+#define TRbracket(a) ((void)0)
+#endif
+
+#ifdef TRACEarray
+#define TRarray(a) *traceOutF << outLineNumber << " " << a << endl
+#else
+#define TRarray(a) ((void)0)
+#endif
+
+#define INIT_CONTAINER(container, value) {if ( (container) != NULL ) delete (container); (container) = (value); }
+#define DELETE_CONTAINER(container) {if ( (container) != NULL ) delete (container); }
+#define IS_A(a,b) ( ((a) & (b)) == (b))
+
+using namespace std;
+
+namespace astyle
+{
+vector<const string*> ASFormatter::headers;
+vector<const string*> ASFormatter::nonParenHeaders;
+vector<const string*> ASFormatter::preDefinitionHeaders;
+vector<const string*> ASFormatter::preCommandHeaders;
+vector<const string*> ASFormatter::operators;
+vector<const string*> ASFormatter::assignmentOperators;
+vector<const string*> ASFormatter::castOperators;
+
+/**
+ * Constructor of ASFormatter
+ */
+ASFormatter::ASFormatter()
+{
+ preBracketHeaderStack = NULL;
+ bracketTypeStack = NULL;
+ parenStack = NULL;
+ lineCommentNoIndent = false;
+ sourceIterator = NULL;
+ bracketFormatMode = NONE_MODE;
+ shouldPadOperators = false;
+ shouldPadParensOutside = false;
+ shouldPadParensInside = false;
+ shouldUnPadParens = false;
+ shouldBreakOneLineBlocks = true;
+ shouldBreakOneLineStatements = true;
+ shouldConvertTabs = false;
+ shouldBreakBlocks = false;
+ shouldBreakClosingHeaderBlocks = false;
+ shouldBreakClosingHeaderBrackets = false;
+ shouldBreakElseIfs = false;
+#ifdef TRACEF
+ // create a trace text file
+ string filename = "tracef.txt";
+ char* env = getenv("HOME");
+ if (env != NULL)
+ filename = string(env) + string("/tracef.txt");
+ else
+ {
+ env = getenv("USERPROFILE");
+ if (env != NULL)
+ filename = string(env) + string("\\My Documents\\tracef.txt");
+ else
+ {
+ cout << "\nCould not open tracef.txt\n" << endl;
+ exit(1);
+ }
+ }
+ traceOutF = new ofstream(filename.c_str());
+#endif
+}
+
+/**
+ * Destructor of ASFormatter
+ */
+ASFormatter::~ASFormatter()
+{
+ DELETE_CONTAINER(preBracketHeaderStack);
+#ifdef TRACEF
+ delete traceOutF;
+#endif
+}
+
+/**
+ * initialization of static data of ASFormatter.
+ */
+void ASFormatter::staticInit()
+{
+ static int formatterFileType = 9; // initialized with an invalid type
+
+ if (fileType == formatterFileType) // don't build unless necessary
+ return;
+
+ formatterFileType = fileType;
+
+ headers.clear();
+ nonParenHeaders.clear();
+ assignmentOperators.clear();
+ operators.clear();
+ preDefinitionHeaders.clear();
+ preCommandHeaders.clear();
+ castOperators.clear();
+
+ ASResource::buildHeaders(headers, fileType);
+ ASResource::buildNonParenHeaders(nonParenHeaders, fileType);
+ ASResource::buildAssignmentOperators(assignmentOperators);
+ ASResource::buildOperators(operators);
+ ASResource::buildPreDefinitionHeaders(preDefinitionHeaders);
+ ASResource::buildPreCommandHeaders(preCommandHeaders);
+ ASResource::buildCastOperators(castOperators);
+}
+
+/**
+ * initialize the ASFormatter.
+ *
+ * init() should be called every time a ASFormatter object is to start
+ * formatting a NEW source file.
+ * init() recieves a pointer to a DYNAMICALLY CREATED ASSourceIterator object
+ * that will be used to iterate through the source code. This object will be
+ * deleted during the ASFormatter's destruction, and thus should not be
+ * deleted elsewhere.
+ *
+ * @param iter a pointer to the DYNAMICALLY CREATED ASSourceIterator object.
+ */
+void ASFormatter::init(ASSourceIterator *si)
+{
+ staticInit();
+
+ ASBeautifier::init(si);
+ ASEnhancer::init(ASBeautifier::getIndentLength(),
+ ASBeautifier::getIndentString(),
+ ASBeautifier::getCStyle(),
+ ASBeautifier::getJavaStyle(),
+ ASBeautifier::getSharpStyle(),
+ ASBeautifier::getCaseIndent(),
+ ASBeautifier::getEmptyLineFill());
+ sourceIterator = si;
+
+ INIT_CONTAINER(preBracketHeaderStack, new vector<const string*>);
+ INIT_CONTAINER(bracketTypeStack, new vector<BracketType>);
+ bracketTypeStack->push_back(NULL_TYPE);
+ INIT_CONTAINER(parenStack, new vector<int>);
+ parenStack->push_back(0);
+
+ currentHeader = NULL;
+ currentLine = string("");
+ readyFormattedLine = string("");
+ formattedLine = "";
+ currentChar = ' ';
+ previousChar = ' ';
+ previousCommandChar = ' ';
+ previousNonWSChar = ' ';
+ quoteChar = '"';
+ charNum = 0;
+ spacePadNum = 0;
+ previousReadyFormattedLineLength = string::npos;
+ templateDepth = 0;
+ previousBracketType = NULL_TYPE;
+ previousOperator = NULL;
+
+ isVirgin = true;
+ isInLineComment = false;
+ isInComment = false;
+ isInPreprocessor = false;
+ doesLineStartComment = false;
+ isInQuote = false;
+ isSpecialChar = false;
+ isNonParenHeader = true;
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ foundCastOperator = false;
+ foundQuestionMark = false;
+ isInLineBreak = false;
+ endOfCodeReached = false;
+ isLineReady = false;
+ isPreviousBracketBlockRelated = true;
+ isInPotentialCalculation = false;
+ shouldReparseCurrentChar = false;
+ passedSemicolon = false;
+ passedColon = false;
+ isInTemplate = false;
+ isInBlParen = false;
+ shouldBreakLineAfterComments = false;
+ isImmediatelyPostComment = false;
+ isImmediatelyPostLineComment = false;
+ isImmediatelyPostEmptyBlock = false;
+ isImmediatelyPostPreprocessor = false;
+
+ isPrependPostBlockEmptyLineRequested = false;
+ isAppendPostBlockEmptyLineRequested = false;
+ prependEmptyLine = false;
+ appendOpeningBracket = false;
+
+ foundClosingHeader = false;
+ previousReadyFormattedLineLength = 0;
+
+ isImmediatelyPostHeader = false;
+ isInHeader = false;
+#ifdef TRACEF
+ // fileName will be empty if ASTYLE_LIB is defined
+ if (fileName.empty())
+ *traceOutF << "new file" << endl;
+ else
+ *traceOutF << fileName << endl;
+#endif
+}
+
+/**
+ * get the next formatted line.
+ *
+ * @return formatted line.
+ */
+
+string ASFormatter::nextLine()
+{
+ // these are reset with each new line
+ const string *newHeader;
+ bool isInVirginLine = isVirgin;
+ isCharImmediatelyPostComment = false;
+ isPreviousCharPostComment = false;
+ isCharImmediatelyPostLineComment = false;
+ isCharImmediatelyPostOpenBlock = false;
+ isCharImmediatelyPostCloseBlock = false;
+ isCharImmediatelyPostTemplate = false;
+
+ while (!isLineReady)
+ {
+ if (shouldReparseCurrentChar)
+ shouldReparseCurrentChar = false;
+ else if (!getNextChar())
+ {
+ breakLine();
+ return beautify(readyFormattedLine);
+ }
+ else // stuff to do when reading a new character...
+ {
+ // make sure that a virgin '{' at the begining ofthe file will be treated as a block...
+ if (isInVirginLine && currentChar == '{')
+ previousCommandChar = '{';
+ isPreviousCharPostComment = isCharImmediatelyPostComment;
+ isCharImmediatelyPostComment = false;
+ isCharImmediatelyPostTemplate = false;
+ }
+
+ //if (inLineNumber >= 185)
+ // int x = 1;
+
+ if (isInLineComment)
+ {
+ appendCurrentChar();
+
+ // explicitely break a line when a line comment's end is found.
+ if (charNum + 1 == (int) currentLine.length())
+ {
+ isInLineBreak = true;
+ isInLineComment = false;
+ isImmediatelyPostLineComment = true;
+ currentChar = 0; //make sure it is a neutral char.
+ }
+ continue;
+ }
+ else if (isInComment)
+ {
+ if (isSequenceReached("*/"))
+ {
+ isInComment = false;
+ isImmediatelyPostComment = true;
+ appendSequence(AS_CLOSE_COMMENT);
+ goForward(1);
+ }
+ else
+ appendCurrentChar();
+
+ continue;
+ }
+
+ // not in line comment or comment
+
+ else if (isInQuote)
+ {
+ if (isSpecialChar)
+ {
+ isSpecialChar = false;
+ appendCurrentChar();
+ }
+ else if (currentChar == '\\')
+ {
+ isSpecialChar = true;
+ appendCurrentChar();
+ }
+ else if (quoteChar == currentChar)
+ {
+ isInQuote = false;
+ appendCurrentChar();
+ }
+ else
+ {
+ appendCurrentChar();
+ }
+
+ continue;
+ }
+
+ // handle white space - needed to simplify the rest.
+ if (isWhiteSpace(currentChar) || isInPreprocessor)
+ {
+ appendCurrentChar();
+ continue;
+ }
+
+ /* not in MIDDLE of quote or comment or white-space of any type ... */
+
+ if (isSequenceReached("//"))
+ {
+ if (currentLine[charNum+2] == '\xf2') // check for windows line marker
+ isAppendPostBlockEmptyLineRequested = false;
+ isInLineComment = true;
+ // do not indent if in column 1 or 2
+ if (lineCommentNoIndent == false)
+ {
+ if (charNum == 0)
+ lineCommentNoIndent = true;
+ else if (charNum == 1 && currentLine[0] == ' ')
+ lineCommentNoIndent = true;
+ }
+ // move comment if spaces were added or deleted
+ if (lineCommentNoIndent == false && spacePadNum != 0)
+ adjustComments();
+ formattedLineCommentNum = formattedLine.length();
+ appendSequence(AS_OPEN_LINE_COMMENT);
+ goForward(1);
+ // explicitely break a line when a line comment's end is found.
+ if (charNum + 1 == (int) currentLine.length())
+ {
+ isInLineBreak = true;
+ isInLineComment = false;
+ isImmediatelyPostLineComment = true;
+ currentChar = 0; //make sure it is a neutral char.
+ }
+ continue;
+ }
+ else if (isSequenceReached("/*"))
+ {
+ isInComment = true;
+ if (spacePadNum != 0)
+ adjustComments();
+ formattedLineCommentNum = formattedLine.length();
+ appendSequence(AS_OPEN_COMMENT);
+ goForward(1);
+ continue;
+ }
+ else if (currentChar == '"' || currentChar == '\'')
+ {
+ isInQuote = true;
+ quoteChar = currentChar;
+ appendCurrentChar();
+ continue;
+ }
+
+ /* not in quote or comment or white-space of any type ... */
+
+ // check if in preprocessor
+ // ** isInPreprocessor will be automatically reset at the begining
+ // of a new line in getnextChar()
+ if (currentChar == '#')
+ {
+ isInPreprocessor = true;
+ appendCurrentChar();
+ continue;
+ }
+
+ /* not in preprocessor ... */
+
+ if (isImmediatelyPostComment)
+ {
+ isImmediatelyPostComment = false;
+ isCharImmediatelyPostComment = true;
+ }
+
+ if (isImmediatelyPostLineComment)
+ {
+ isImmediatelyPostLineComment = false;
+ isCharImmediatelyPostLineComment = true;
+ }
+
+ if (shouldBreakLineAfterComments)
+ {
+ shouldBreakLineAfterComments = false;
+ shouldReparseCurrentChar = true;
+ breakLine();
+ continue;
+ }
+
+ // reset isImmediatelyPostHeader information
+ if (isImmediatelyPostHeader)
+ {
+ isImmediatelyPostHeader = false;
+
+ // Make sure headers are broken from their succeeding blocks
+ // (e.g.
+ // if (isFoo) DoBar();
+ // should become
+ // if (isFoo)
+ // DoBar;
+ // )
+ // But treat else if() as a special case which should not be broken!
+ if (shouldBreakOneLineStatements)
+ {
+ // if may break 'else if()'s, then simply break the line
+
+ if (shouldBreakElseIfs)
+ isInLineBreak = true;
+ }
+ }
+
+ if (passedSemicolon) // need to break the formattedLine
+ {
+ passedSemicolon = false;
+ if (parenStack->back() == 0 && currentChar != ';') // allow ;;
+ {
+ // does a one-line statement have ending comments?
+ if (IS_A(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ {
+ size_t blockEnd = currentLine.rfind(AS_CLOSE_BRACKET);
+ assert(blockEnd != string::npos);
+ // move ending comments to this formattedLine
+ if (isBeforeLineEndComment(blockEnd))
+ {
+ size_t commentStart = currentLine.find_first_not_of(" \t", blockEnd + 1);
+ assert(commentStart != string::npos);
+ assert((currentLine.compare(commentStart, 2, "//") == 0)
+ || (currentLine.compare(commentStart, 2, "/*") == 0));
+ size_t commentLength = currentLine.length() - commentStart;
+ int tabCount = getIndentLength();
+ appendSpacePad();
+ for (int i=1; i<tabCount; i++)
+ formattedLine.append(1, ' ');
+ formattedLine.append(currentLine, commentStart, commentLength);
+ currentLine.erase(commentStart, commentLength);
+ }
+ }
+ shouldReparseCurrentChar = true;
+ isInLineBreak = true;
+ continue;
+ }
+ }
+
+ if (passedColon)
+ {
+ passedColon = false;
+ if (parenStack->back() == 0 && !isBeforeComment())
+ {
+ shouldReparseCurrentChar = true;
+ isInLineBreak = true;
+ continue;
+ }
+ }
+
+ // Check if in template declaration, e.g. foo<bar> or foo<bar,fig>
+ // If so, set isInTemplate to true
+ if (!isInTemplate && currentChar == '<')
+ {
+ int maxTemplateDepth = 0;
+ templateDepth = 0;
+ const string *oper;
+ for (size_t i = charNum;
+ i < currentLine.length();
+ i += (oper ? oper->length() : 1))
+ {
+ oper = ASBeautifier::findHeader(currentLine, i, operators);
+
+ if (oper == &AS_LS)
+ {
+ templateDepth++;
+ maxTemplateDepth++;
+ }
+ else if (oper == &AS_GR)
+ {
+ templateDepth--;
+ if (templateDepth == 0)
+ {
+ // this is a template!
+ isInTemplate = true;
+ templateDepth = maxTemplateDepth;
+ break;
+ }
+ }
+ else if (oper == &AS_COMMA // comma, e.g. A<int, char>
+ || oper == &AS_BIT_AND // reference, e.g. A<int&>
+ || oper == &AS_MULT // pointer, e.g. A<int*>
+ || oper == &AS_COLON_COLON) // ::, e.g. std::string
+ {
+ continue;
+ }
+ else if (!isLegalNameChar(currentLine[i]) && !isWhiteSpace(currentLine[i]))
+ {
+ // this is not a template -> leave...
+ isInTemplate = false;
+ break;
+ }
+ }
+ }
+
+ // handle parenthesies
+ if (currentChar == '(' || currentChar == '[' || (isInTemplate && currentChar == '<'))
+ {
+ parenStack->back()++;
+ if (currentChar == '[')
+ isInBlParen = true;
+ }
+ else if (currentChar == ')' || currentChar == ']' || (isInTemplate && currentChar == '>'))
+ {
+ parenStack->back()--;
+ if (isInTemplate && currentChar == '>')
+ {
+ templateDepth--;
+ if (templateDepth == 0)
+ {
+ isInTemplate = false;
+ isCharImmediatelyPostTemplate = true;
+ }
+ }
+
+ // check if this parenthesis closes a header, e.g. if (...), while (...)
+ if (isInHeader && parenStack->back() == 0)
+ {
+ isInHeader = false;
+ isImmediatelyPostHeader = true;
+ }
+ if (currentChar == ']')
+ isInBlParen = false;
+ if (currentChar == ')')
+ foundCastOperator = false;
+ }
+
+ // handle brackets
+ if (currentChar == '{' || currentChar == '}')
+ {
+ if (currentChar == '{')
+ {
+ BracketType newBracketType = getBracketType();
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ isInPotentialCalculation = false;
+
+ bracketTypeStack->push_back(newBracketType);
+ preBracketHeaderStack->push_back(currentHeader);
+ currentHeader = NULL;
+
+ isPreviousBracketBlockRelated = !IS_A(newBracketType, ARRAY_TYPE);
+ }
+
+ // this must be done before the bracketTypeStack is popped
+ BracketType bracketType = bracketTypeStack->back();
+ bool isOpeningArrayBracket = (IS_A(bracketType, ARRAY_TYPE)
+ && bracketTypeStack->size() >= 2
+ && !IS_A((*bracketTypeStack)[bracketTypeStack->size()-2], ARRAY_TYPE)
+ );
+
+ if (currentChar == '}')
+ {
+ // if a request has been made to append a post block empty line,
+ // but the block exists immediately before a closing bracket,
+ // then there is not need for the post block empty line.
+ //
+ isAppendPostBlockEmptyLineRequested = false;
+
+ if (!bracketTypeStack->empty())
+ {
+ previousBracketType = bracketTypeStack->back();
+ bracketTypeStack->pop_back();
+ isPreviousBracketBlockRelated = !IS_A(bracketType, ARRAY_TYPE);
+ }
+
+ if (!preBracketHeaderStack->empty())
+ {
+ currentHeader = preBracketHeaderStack->back();
+ preBracketHeaderStack->pop_back();
+ }
+ else
+ currentHeader = NULL;
+ }
+
+ // format brackets
+ if (IS_A(bracketType, ARRAY_TYPE))
+ formatArrayBrackets(bracketType, isOpeningArrayBracket);
+ else
+ formatBrackets(bracketType);
+ continue;
+ }
+
+ if (((previousCommandChar == '{' && isPreviousBracketBlockRelated)
+ || (previousCommandChar == '}'
+ && bracketFormatMode != NONE_MODE
+ && !isImmediatelyPostEmptyBlock
+ && isPreviousBracketBlockRelated
+ && !isPreviousCharPostComment // Fixes wrongly appended newlines after '}' immediately after comments
+ && peekNextChar() != ' '
+ && !IS_A(previousBracketType, DEFINITION_TYPE)
+ && !(ASBeautifier::isJavaStyle && currentChar == ')'))
+ && !IS_A(bracketTypeStack->back(), DEFINITION_TYPE))
+ && (shouldBreakOneLineBlocks
+ || !IS_A(bracketTypeStack->back(), SINGLE_LINE_TYPE)))
+ {
+ isCharImmediatelyPostOpenBlock = (previousCommandChar == '{');
+ isCharImmediatelyPostCloseBlock = (previousCommandChar == '}');
+
+ //if (bracketFormatMode != NONE_MODE)
+ //{
+ previousCommandChar = ' ';
+ isInLineBreak = true;
+ //}
+ }
+
+ // reset block handling flags
+ isImmediatelyPostEmptyBlock = false;
+
+ // look for headers
+ if (!isInTemplate)
+ {
+ if ((newHeader = findHeader(headers)) != NULL)
+ {
+ foundClosingHeader = false;
+ const string *previousHeader;
+
+ // recognize closing headers of do..while, if..else, try..catch..finally
+ if ((newHeader == &AS_ELSE && currentHeader == &AS_IF)
+ || (newHeader == &AS_WHILE && currentHeader == &AS_DO)
+ || (newHeader == &AS_CATCH && currentHeader == &AS_TRY)
+ || (newHeader == &AS_CATCH && currentHeader == &AS_CATCH)
+ || (newHeader == &AS_FINALLY && currentHeader == &AS_TRY)
+ || (newHeader == &AS_FINALLY && currentHeader == &AS_CATCH))
+ foundClosingHeader = true;
+
+ previousHeader = currentHeader;
+ currentHeader = newHeader;
+
+ // If in ATTACH or LINUX bracket modes, attach closing headers (e.g. 'else', 'catch')
+ // to their preceding bracket,
+ // But do not perform the attachment if the shouldBreakClosingHeaderBrackets is set!
+ if (!shouldBreakClosingHeaderBrackets
+ && foundClosingHeader
+ && (bracketFormatMode == ATTACH_MODE || bracketFormatMode == BDAC_MODE)
+ && (shouldBreakOneLineBlocks || !IS_A(previousBracketType, SINGLE_LINE_TYPE))
+ && previousNonWSChar == '}')
+ {
+ spacePadNum = 0; // don't count as padding
+
+ size_t firstChar = formattedLine.find_first_not_of(" \t");
+ if (firstChar != string::npos) // if a blank line does not preceed this
+ {
+ isInLineBreak = false;
+ appendSpacePad();
+ }
+
+ if (shouldBreakBlocks)
+ isAppendPostBlockEmptyLineRequested = false;
+ }
+
+ // If NONE bracket mode, leave closing headers as they are (e.g. 'else', 'catch')
+ if (foundClosingHeader && bracketFormatMode == NONE_MODE && previousCommandChar == '}')
+ {
+ if (lineBeginsWith('}')) // is closing bracket broken?
+ {
+ isInLineBreak = false;
+ appendSpacePad();
+ }
+
+ if (shouldBreakBlocks)
+ isAppendPostBlockEmptyLineRequested = false;
+ }
+
+ if (foundClosingHeader && bracketFormatMode == BREAK_MODE && previousCommandChar == '}')
+ breakLine();
+
+ //Check if a template definition as been reached, e.g. template<class A>
+ //if (newHeader == &AS_TEMPLATE)
+ //{
+ // isInTemplate = true;
+ //}
+
+ // check if the found header is non-paren header
+ isNonParenHeader = (find(nonParenHeaders.begin(), nonParenHeaders.end(),
+ newHeader) != nonParenHeaders.end());
+
+ appendSequence(*currentHeader);
+ goForward(currentHeader->length() - 1);
+ // if a paren-header is found add a space after it, if needed
+ // this checks currentLine, appendSpacePad() checks formattedLine
+ if (!isNonParenHeader && charNum < (int) currentLine.length() && !isWhiteSpace(currentLine[charNum+1]))
+ appendSpacePad();
+
+ // Signal that a header has been reached
+ // *** But treat a closing while() (as in do...while)
+ // as if it where NOT a header since a closing while()
+ // should never have a block after it!
+ if (!(foundClosingHeader && currentHeader == &AS_WHILE))
+ {
+ isInHeader = true;
+ if (isNonParenHeader)
+ {
+ isImmediatelyPostHeader = true;
+ isInHeader = false;
+ }
+ }
+
+ if (currentHeader == &AS_IF && previousHeader == &AS_ELSE)
+ isInLineBreak = false;
+
+ if (shouldBreakBlocks)
+ {
+ if (previousHeader == NULL
+ && !foundClosingHeader
+ && !isCharImmediatelyPostOpenBlock)
+ {
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+
+ if (currentHeader == &AS_ELSE
+ || currentHeader == &AS_CATCH
+ || currentHeader == &AS_FINALLY
+ || foundClosingHeader)
+ {
+ isPrependPostBlockEmptyLineRequested = false;
+ }
+
+ if (shouldBreakClosingHeaderBlocks
+ && isCharImmediatelyPostCloseBlock)
+ {
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+
+ }
+
+ continue;
+ }
+ else if ((newHeader = findHeader(preDefinitionHeaders)) != NULL
+ && parenStack->back() == 0)
+ {
+ if (newHeader == &AS_NAMESPACE)
+ foundNamespaceHeader = true;
+ if (newHeader == &AS_CLASS)
+ foundClassHeader = true;
+ foundPreDefinitionHeader = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+
+ if (shouldBreakBlocks)
+ isPrependPostBlockEmptyLineRequested = true;
+
+ continue;
+ }
+ else if ((newHeader = findHeader(preCommandHeaders)) != NULL)
+ {
+ if (ASBeautifier::isJavaStyle
+ || (*newHeader == AS_CONST && previousCommandChar == ')') // 'const' member functions is a command bracket
+ || *newHeader == AS_EXTERN)
+ foundPreCommandHeader = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+
+ continue;
+ }
+ else if ((newHeader = findHeader(castOperators)) != NULL)
+ {
+ foundCastOperator = true;
+ appendSequence(*newHeader);
+ goForward(newHeader->length() - 1);
+
+ continue;
+ }
+
+ }
+
+ if (isInLineBreak) // OK to break line here
+ breakLine();
+
+ if (previousNonWSChar == '}' || currentChar == ';')
+ {
+ if (shouldBreakOneLineStatements && currentChar == ';'
+ && (shouldBreakOneLineBlocks || !IS_A(bracketTypeStack->back(), SINGLE_LINE_TYPE))
+ //&& (! bracketFormatMode == NONE_MODE)
+ )
+ {
+ passedSemicolon = true;
+ }
+
+ if (shouldBreakBlocks && currentHeader != NULL && parenStack->back() == 0)
+ {
+ isAppendPostBlockEmptyLineRequested = true;
+ }
+
+ if (currentChar != ';')
+ currentHeader = NULL;
+
+ foundQuestionMark = false;
+ foundNamespaceHeader = false;
+ foundClassHeader = false;
+ foundPreDefinitionHeader = false;
+ foundPreCommandHeader = false;
+ foundCastOperator = false;
+ isInPotentialCalculation = false;
+ isNonInStatementArray = false;
+ }
+
+ if (currentChar == ':'
+ && shouldBreakOneLineStatements
+ && !foundQuestionMark // not in a ... ? ... : ... sequence
+ && !foundPreDefinitionHeader // not in a definition block (e.g. class foo : public bar
+ && previousCommandChar != ')' // not immediately after closing paren of a method header, e.g. ASFormatter::ASFormatter(...) : ASBeautifier(...)
+ && previousChar != ':' // not part of '::'
+ && peekNextChar() != ':') // not part of '::'
+ {
+ passedColon = true;
+ if (shouldBreakBlocks)
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+
+ if (currentChar == '?')
+ foundQuestionMark = true;
+
+ // determine if this is a potential calculation
+ newHeader = findHeader(operators);
+
+ if (newHeader != NULL)
+ {
+ if (!isInPotentialCalculation)
+ {
+ if (find(assignmentOperators.begin(), assignmentOperators.end(), newHeader)
+ != assignmentOperators.end())
+ {
+ char peekedChar = peekNextChar();
+ isInPotentialCalculation = (newHeader != &AS_RETURN
+ && !(newHeader == &AS_EQUAL && peekedChar == '*')
+ && !(newHeader == &AS_EQUAL && peekedChar == '&'));
+ }
+ }
+ }
+ else
+ {
+ // the following are not calculations
+ if (currentLine.compare(charNum, 3, "new") == 0 && !isLegalNameChar(currentLine[charNum+3]))
+ isInPotentialCalculation = false;
+ }
+
+ if (shouldPadOperators && newHeader != NULL)
+ {
+ padOperators(newHeader);
+ continue;
+ }
+
+ if ((shouldPadParensOutside || shouldPadParensInside || shouldUnPadParens)
+ && (currentChar == '(' || currentChar == ')'))
+ {
+ padParens();
+ continue;
+ }
+
+ appendCurrentChar();
+ } // end of while loop * end of while loop * end of while loop * end of while loop
+
+ // return a beautified (i.e. correctly indented) line.
+
+ string beautifiedLine;
+ size_t readyFormattedLineLength = trim(readyFormattedLine).length();
+
+ if (prependEmptyLine // prepend a blank line before this formatted line
+ && readyFormattedLineLength > 0
+ && previousReadyFormattedLineLength > 0)
+ {
+ isLineReady = true; // signal that a readyFormattedLine is still waiting
+ beautifiedLine = beautify("");
+ previousReadyFormattedLineLength = 0;
+ }
+ else // format the current formatted line
+ {
+ isLineReady = false;
+ beautifiedLine = beautify(readyFormattedLine);
+ previousReadyFormattedLineLength = readyFormattedLineLength;
+ lineCommentNoBeautify = lineCommentNoIndent;
+ lineCommentNoIndent = false;
+ if (appendOpeningBracket) // insert bracket after this formatted line
+ {
+ appendOpeningBracket = false;
+ isLineReady = true; // signal that a readyFormattedLine is still waiting
+ readyFormattedLine = "{";
+ isPrependPostBlockEmptyLineRequested = false; // next line should not be empty
+ }
+ }
+
+ prependEmptyLine = false;
+ enhance(beautifiedLine); // call the enhancer function
+ return beautifiedLine;
+}
+
+
+/**
+* check if there are any indented lines ready to be read by nextLine()
+*
+* @return are there any indented lines ready?
+*/
+bool ASFormatter::hasMoreLines() const
+{
+ return !endOfCodeReached;
+}
+
+/**
+ * set the bracket formatting mode.
+ * options:
+ * astyle::NONE_MODE no formatting of brackets.
+ * astyle::ATTACH_MODE Java, K&R style bracket placement.
+ * astyle::BREAK_MODE ANSI C/C++ style bracket placement.
+ *
+ * @param mode the bracket formatting mode.
+ */
+void ASFormatter::setBracketFormatMode(BracketMode mode)
+{
+ bracketFormatMode = mode;
+}
+
+/**
+ * set closing header bracket breaking mode
+ * options:
+ * true brackets just before closing headers (e.g. 'else', 'catch')
+ * will be broken, even if standard brackets are attached.
+ * false closing header brackets will be treated as standard brackets.
+ *
+ * @param state the closing header bracket breaking mode.
+ */
+void ASFormatter::setBreakClosingHeaderBracketsMode(bool state)
+{
+ shouldBreakClosingHeaderBrackets = state;
+}
+
+/**
+ * set 'else if()' breaking mode
+ * options:
+ * true 'else' headers will be broken from their succeeding 'if' headers.
+ * false 'else' headers will be attached to their succeeding 'if' headers.
+ *
+ * @param state the 'else if()' breaking mode.
+ */
+void ASFormatter::setBreakElseIfsMode(bool state)
+{
+ shouldBreakElseIfs = state;
+}
+
+/**
+ * set operator padding mode.
+ * options:
+ * true statement operators will be padded with spaces around them.
+ * false statement operators will not be padded.
+ *
+ * @param state the padding mode.
+ */
+void ASFormatter::setOperatorPaddingMode(bool state)
+{
+ shouldPadOperators = state;
+}
+
+/**
+* set parenthesis outside padding mode.
+* options:
+* true statement parenthesiss will be padded with spaces around them.
+* false statement parenthesiss will not be padded.
+*
+* @param state the padding mode.
+*/
+void ASFormatter::setParensOutsidePaddingMode(bool state)
+{
+ shouldPadParensOutside = state;
+}
+
+/**
+* set parenthesis inside padding mode.
+* options:
+* true statement parenthesis will be padded with spaces around them.
+* false statement parenthesis will not be padded.
+*
+* @param state the padding mode.
+*/
+void ASFormatter::setParensInsidePaddingMode(bool state)
+{
+ shouldPadParensInside = state;
+}
+
+/**
+* set parenthesis unpadding mode.
+* options:
+* true statement parenthesis will be unpadded with spaces removed around them.
+* false statement parenthesis will not be unpadded.
+*
+* @param state the padding mode.
+*/
+void ASFormatter::setParensUnPaddingMode(bool state)
+{
+ shouldUnPadParens = state;
+}
+
+/**
+ * set option to break/not break one-line blocks
+ *
+ * @param state true = break, false = don't break.
+ */
+void ASFormatter::setBreakOneLineBlocksMode(bool state)
+{
+ shouldBreakOneLineBlocks = state;
+}
+
+/**
+ * set option to break/not break lines consisting of multiple statements.
+ *
+ * @param state true = break, false = don't break.
+ */
+void ASFormatter::setSingleStatementsMode(bool state)
+{
+ shouldBreakOneLineStatements = state;
+}
+
+/**
+ * set option to convert tabs to spaces.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setTabSpaceConversionMode(bool state)
+{
+ shouldConvertTabs = state;
+}
+
+
+/**
+ * set option to break unrelated blocks of code with empty lines.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setBreakBlocksMode(bool state)
+{
+ shouldBreakBlocks = state;
+}
+
+/**
+ * set option to break closing header blocks of code (such as 'else', 'catch', ...) with empty lines.
+ *
+ * @param state true = convert, false = don't convert.
+ */
+void ASFormatter::setBreakClosingHeaderBlocksMode(bool state)
+{
+ shouldBreakClosingHeaderBlocks = state;
+}
+
+/**
+ * jump over several characters.
+ *
+ * @param i the number of characters to jump over.
+ */
+void ASFormatter::goForward(int i)
+{
+ while (--i >= 0)
+ getNextChar();
+}
+
+/**
+* peek at the next unread character.
+*
+* @return the next unread character.
+*/
+char ASFormatter::peekNextChar() const
+{
+ char ch = ' ';
+ size_t peekNum = currentLine.find_first_not_of(" \t", charNum + 1);
+
+ if (peekNum == string::npos)
+ return ch;
+
+ ch = currentLine[peekNum];
+
+// if (shouldConvertTabs && ch == '\t')
+// ch = ' ';
+
+ return ch;
+}
+
+/**
+* check if current placement is before a comment or line-comment
+*
+* @return is before a comment or line-comment.
+*/
+bool ASFormatter::isBeforeComment() const
+{
+ bool foundComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", charNum + 1);
+
+ if (peekNum == string::npos)
+ return foundComment;
+
+ foundComment = (currentLine.compare(peekNum, 2, "/*") == 0
+ || currentLine.compare(peekNum, 2, "//") == 0);
+
+ return foundComment;
+}
+
+/**
+* check if current placement is before a comment or line-comment
+* if a block comment it must be at the end of the line
+*
+* @return is before a comment or line-comment.
+*/
+bool ASFormatter::isBeforeLineEndComment(int startPos) const
+{
+ bool foundLineEndComment = false;
+ size_t peekNum = currentLine.find_first_not_of(" \t", startPos + 1);
+
+ if (peekNum != string::npos)
+ {
+ if (currentLine.compare(peekNum, 2, "//") == 0)
+ foundLineEndComment = true;
+ else if (currentLine.compare(peekNum, 2, "/*") == 0)
+ {
+ // comment must be closed on this line with nothing after it
+ size_t endNum = currentLine.find("*/", peekNum + 2);
+ if (endNum != string::npos)
+ if (currentLine.find_first_not_of(" \t", endNum + 2) == string::npos)
+ foundLineEndComment = true;
+ }
+ }
+ return foundLineEndComment;
+}
+
+
+/**
+* get the next character, increasing the current placement in the process.
+* the new character is inserted into the variable currentChar.
+*
+* @return whether succeded to recieve the new character.
+*/
+bool ASFormatter::getNextChar()
+{
+ isInLineBreak = false;
+ previousChar = currentChar;
+
+ if (!isWhiteSpace(currentChar))
+ {
+ previousNonWSChar = currentChar;
+ if (!isInComment && !isInLineComment && !isInQuote
+ && !isImmediatelyPostComment
+ && !isImmediatelyPostLineComment
+ && !isSequenceReached("/*")
+ && !isSequenceReached("//"))
+ previousCommandChar = previousNonWSChar;
+ }
+
+ int currentLineLength = currentLine.length();
+
+ if (charNum + 1 < currentLineLength
+ && (!isWhiteSpace(peekNextChar()) || isInComment || isInLineComment))
+ {
+ currentChar = currentLine[++charNum];
+
+ if (shouldConvertTabs && currentChar == '\t')
+ currentChar = ' ';
+
+ return true;
+ }
+ else // end of line has been reached
+ {
+ if (sourceIterator->hasMoreLines())
+ {
+ currentLine = sourceIterator->nextLine();
+ spacePadNum = 0;
+ inLineNumber++;
+
+ if (currentLine.length() == 0)
+ {
+ currentLine = string(" "); // a null is inserted if this is not done
+ }
+
+ // unless reading in the first line of the file,
+ // break a new line.
+ if (!isVirgin)
+ isInLineBreak = true;
+ else
+ isVirgin = false;
+
+ if (isInLineComment)
+ isImmediatelyPostLineComment = true;
+ isInLineComment = false;
+
+ // check if is in preprocessor before line trimming
+ isImmediatelyPostPreprocessor = isInPreprocessor;
+ if (previousNonWSChar != '\\')
+ isInPreprocessor = false;
+
+ trimNewLine();
+ currentChar = currentLine[charNum];
+
+ if (shouldConvertTabs && currentChar == '\t')
+ currentChar = ' ';
+
+ return true;
+ }
+ else
+ {
+ endOfCodeReached = true;
+ return false;
+ }
+ }
+}
+
+/**
+* jump over the leading white space in the current line,
+* IF the line does not begin a comment or is in a preprocessor definition.
+*/
+void ASFormatter::trimNewLine()
+{
+ int len = currentLine.length();
+ charNum = 0;
+
+ if (isInComment || isInPreprocessor)
+ return;
+
+ while (isWhiteSpace(currentLine[charNum]) && charNum + 1 < len)
+ ++charNum;
+
+ doesLineStartComment = false;
+ if (isSequenceReached("/*"))
+ {
+ charNum = 0;
+ doesLineStartComment = true;
+ }
+}
+
+/**
+ * append a character to the current formatted line.
+ * Unless disabled (via canBreakLine == false), first check if a
+ * line-break has been registered, and if so break the
+ * formatted line, and only then append the character into
+ * the next formatted line.
+ *
+ * @param ch the character to append.
+ * @param canBreakLine if true, a registered line-break
+ */
+void ASFormatter::appendChar(char ch, bool canBreakLine)
+{
+ if (canBreakLine && isInLineBreak)
+ breakLine();
+ formattedLine.append(1, ch);
+}
+
+/**
+ * append a string sequence to the current formatted line.
+ * Unless disabled (via canBreakLine == false), first check if a
+ * line-break has been registered, and if so break the
+ * formatted line, and only then append the sequence into
+ * the next formatted line.
+ *
+ * @param sequence the sequence to append.
+ * @param canBreakLine if true, a registered line-break
+ */
+void ASFormatter::appendSequence(const string &sequence, bool canBreakLine)
+{
+ if (canBreakLine && isInLineBreak)
+ breakLine();
+ formattedLine.append(sequence);
+}
+
+/**
+ * append a space to the current formattedline, UNLESS the
+ * last character is already a white-space character.
+ */
+void ASFormatter::appendSpacePad()
+{
+ int len = formattedLine.length();
+ if (len > 0 && !isWhiteSpace(formattedLine[len-1]))
+ {
+ formattedLine.append(1, ' ');
+ spacePadNum++;
+ }
+}
+
+/**
+ * append a space to the current formattedline, UNLESS the
+ * next character is already a white-space character.
+ */
+void ASFormatter::appendSpaceAfter()
+{
+ int len = currentLine.length();
+ if (charNum + 1 < len && !isWhiteSpace(currentLine[charNum+1]))
+ {
+ formattedLine.append(1, ' ');
+ spacePadNum++;
+ }
+}
+
+/**
+ * register a line break for the formatted line.
+ */
+void ASFormatter::breakLine()
+{
+ isLineReady = true;
+ isInLineBreak = false;
+ spacePadNum = 0;
+ formattedLineCommentNum = string::npos;
+
+ // queue an empty line prepend request if one exists
+ prependEmptyLine = isPrependPostBlockEmptyLineRequested;
+
+ readyFormattedLine = formattedLine;
+ if (isAppendPostBlockEmptyLineRequested)
+ {
+ isAppendPostBlockEmptyLineRequested = false;
+ isPrependPostBlockEmptyLineRequested = true;
+ }
+ else
+ {
+ isPrependPostBlockEmptyLineRequested = false;
+ }
+
+ formattedLine = "";
+}
+
+/**
+ * check if the currently reached open-bracket (i.e. '{')
+ * opens a:
+ * - a definition type block (such as a class or namespace),
+ * - a command block (such as a method block)
+ * - a static array
+ * this method takes for granted that the current character
+ * is an opening bracket.
+ *
+ * @return the type of the opened block.
+ */
+BracketType ASFormatter::getBracketType() const
+{
+ BracketType returnVal;
+
+ if (foundPreDefinitionHeader)
+ {
+ returnVal = DEFINITION_TYPE;
+ if (foundNamespaceHeader)
+ returnVal = (BracketType)(returnVal | NAMESPACE_TYPE);
+ else if (foundClassHeader)
+ returnVal = (BracketType)(returnVal | CLASS_TYPE);
+ }
+ else
+ {
+ bool isCommandType = false;
+
+ if (previousNonWSChar != '=')
+ isCommandType = (foundPreCommandHeader
+ || (currentHeader != NULL && isNonParenHeader)
+ || (previousCommandChar == ')')
+ || (previousCommandChar == ':' && !foundQuestionMark)
+ || (previousCommandChar == ';')
+ || ((previousCommandChar == '{' || previousCommandChar == '}')
+ && isPreviousBracketBlockRelated));
+
+ returnVal = (isCommandType ? COMMAND_TYPE : ARRAY_TYPE);
+ }
+
+ if (isOneLineBlockReached())
+ returnVal = (BracketType)(returnVal | SINGLE_LINE_TYPE);
+
+ TRbracket(returnVal);
+ return returnVal;
+}
+
+/**
+ * check if the currently reached '*' or '&' character is
+ * a pointer-or-reference symbol, or another operator.
+ * this method takes for granted that the current character
+ * is either a '*' or '&'.
+ *
+ * @return whether current character is a reference-or-pointer
+ */
+bool ASFormatter::isPointerOrReference() const
+{
+ bool isPR;
+ isPR = (!isInPotentialCalculation
+ || IS_A(bracketTypeStack->back(), DEFINITION_TYPE)
+ || (!isLegalNameChar(previousNonWSChar)
+ && previousNonWSChar != ')'
+ && previousNonWSChar != ']')
+ );
+
+ if (!isPR)
+ {
+ char nextChar = peekNextChar();
+ isPR |= (!isWhiteSpace(nextChar)
+ && nextChar != '-'
+ && nextChar != '('
+ && nextChar != '['
+ && !isLegalNameChar(nextChar));
+ }
+
+ return isPR;
+}
+
+
+/**
+ * check if the currently reached '-' character is
+ * a unary minus
+ * this method takes for granted that the current character
+ * is a '-'.
+ *
+ * @return whether the current '-' is a unary minus.
+ */
+bool ASFormatter::isUnaryMinus() const
+{
+ return ((previousOperator == &AS_RETURN || !isalnum(previousCommandChar))
+ && previousCommandChar != '.'
+ && previousCommandChar != ')'
+ && previousCommandChar != ']');
+}
+
+
+/**
+ * check if the currently reached '-' or '+' character is
+ * part of an exponent, i.e. 0.2E-5.
+ * this method takes for granted that the current character
+ * is a '-' or '+'.
+ *
+ * @return whether the current '-' is in an exponent.
+ */
+bool ASFormatter::isInExponent() const
+{
+ int formattedLineLength = formattedLine.length();
+ if (formattedLineLength >= 2)
+ {
+ char prevPrevFormattedChar = formattedLine[formattedLineLength - 2];
+ char prevFormattedChar = formattedLine[formattedLineLength - 1];
+
+ return ((prevFormattedChar == 'e' || prevFormattedChar == 'E')
+ && (prevPrevFormattedChar == '.' || isdigit(prevPrevFormattedChar)));
+ }
+ else
+ return false;
+}
+
+/**
+ * check if a one-line bracket has been reached,
+ * i.e. if the currently reached '{' character is closed
+ * with a complimentry '}' elsewhere on the current line,
+ *.
+ * @return has a one-line bracket been reached?
+ */
+bool ASFormatter::isOneLineBlockReached() const
+{
+ bool isInComment = false;
+ bool isInQuote = false;
+ int bracketCount = 1;
+ int currentLineLength = currentLine.length();
+ char quoteChar = ' ';
+
+ for (int i = charNum + 1; i < currentLineLength; ++i)
+ {
+ char ch = currentLine[i];
+
+ if (isInComment)
+ {
+ if (currentLine.compare(i, 2, "*/") == 0)
+ {
+ isInComment = false;
+ ++i;
+ }
+ continue;
+ }
+
+ if (ch == '\\')
+ {
+ ++i;
+ continue;
+ }
+
+ if (isInQuote)
+ {
+ if (ch == quoteChar)
+ isInQuote = false;
+ continue;
+ }
+
+ if (ch == '"' || ch == '\'')
+ {
+ isInQuote = true;
+ quoteChar = ch;
+ continue;
+ }
+
+ if (currentLine.compare(i, 2, "//") == 0)
+ break;
+
+ if (currentLine.compare(i, 2, "/*") == 0)
+ {
+ isInComment = true;
+ ++i;
+ continue;
+ }
+
+ if (ch == '{')
+ ++bracketCount;
+ else if (ch == '}')
+ --bracketCount;
+
+ if (bracketCount == 0)
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * check if one of a set of headers has been reached in the
+ * current position of the current line.
+ *
+ * @return a pointer to the found header. Or a NULL if no header has been reached.
+ * @param headers a vector of headers.
+ * @param checkBoundry
+ */
+const string *ASFormatter::findHeader(const vector<const string*> &headers, bool checkBoundry)
+{
+ return ASBeautifier::findHeader(currentLine, charNum, headers, checkBoundry);
+}
+
+/**
+ * check if a line begins with the specified character
+ * i.e. if the current line begins with a open bracket.
+ *
+ * @return true or false
+ */
+bool ASFormatter::lineBeginsWith(char charToCheck) const
+{
+ bool beginsWith = false;
+ size_t i = currentLine.find_first_not_of(" \t");
+
+ if (i != string::npos)
+ if (currentLine[i] == charToCheck && (int) i == charNum)
+ beginsWith = true;
+
+ return beginsWith;
+}
+
+/**
+ * adjust comment position because of adding or deleting spaces
+ * the spaces are added or deleted to formattedLine
+ * spacePadNum contains the adjustment
+ */
+void ASFormatter::adjustComments(void)
+{
+ assert(spacePadNum != 0);
+ assert(currentLine.compare(charNum, 2, "//") == 0
+ || currentLine.compare(charNum, 2, "/*") == 0);
+
+
+ // block comment must be closed on this line with nothing after it
+ if (currentLine.compare(charNum, 2, "/*") == 0)
+ {
+ size_t endNum = currentLine.find("*/", charNum + 2);
+ if (endNum == string::npos)
+ return;
+ if (currentLine.find_first_not_of(" \t", endNum + 2) != string::npos)
+ return;
+ }
+
+ size_t len = formattedLine.length();
+ // if spaces were removed, need to add spaces before the comment
+ if (spacePadNum < 0)
+ {
+ int adjust = -spacePadNum; // make the number positive
+ if (formattedLine[len-1] != '\t') // don't adjust if a tab
+ formattedLine.append(adjust, ' ');
+// else // comment out to avoid compiler warning
+// adjust = 0;
+// TRcomment(adjust); // trace macro
+ }
+ // if spaces were added, need to delete spaces before the comment, if possible
+ else if (spacePadNum > 0)
+ {
+ int adjust = spacePadNum;
+ if (formattedLine.find_last_not_of(' ') < len - adjust - 1
+ && formattedLine[len-1] != '\t') // don't adjust a tab
+ formattedLine.resize(len - adjust);
+ // the following are commented out to avoid a Borland compiler warning
+ //else
+ // adjust = 0;
+ TRcomment(-adjust); // trace macro
+ }
+}
+
+/**
+ * append the current bracket inside the end of line comments
+ * currentChar contains the bracket, it will be appended to formattedLine
+ * formattedLineCommentNum is the comment location on formattedLine
+ */
+void ASFormatter::appendCharInsideComments(void)
+{
+ if (formattedLineCommentNum == string::npos // does the comment start on the previous line?
+ || isBeforeComment()) // does a comment follow on this line?
+ {
+ appendCurrentChar(true); // don't attach
+ return;
+ }
+ assert(formattedLine.compare(formattedLineCommentNum, 2, "//") == 0
+ || formattedLine.compare(formattedLineCommentNum, 2, "/*") == 0);
+
+ // find the previous non space char
+ size_t end = formattedLineCommentNum;
+ size_t beg = formattedLine.find_last_not_of(" \t", end-1);
+ if (beg == string::npos) // is the previous line comment only?
+ {
+ appendCurrentChar(true); // don't attach
+ return;
+ }
+ beg++;
+
+ // insert the bracket
+ if (end - beg < 3) // is there room to insert?
+ formattedLine.insert(beg, 3-end+beg, ' ');
+ if (formattedLine[beg] == '\t') // don't pad with a tab
+ formattedLine.insert(beg, 1, ' ');
+ formattedLine[beg+1] = currentChar;
+}
+
+/**
+ * add or remove space padding to operators
+ * currentChar contains the paren
+ * the operators and necessary padding will be appended to formattedLine
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param *newOperator the operator to be padded
+ */
+void ASFormatter::padOperators(const string *newOperator)
+{
+ assert (shouldPadOperators);
+ assert(newOperator != NULL);
+
+ bool shouldPad = (newOperator != &AS_COLON_COLON
+ && newOperator != &AS_PAREN_PAREN
+ && newOperator != &AS_BLPAREN_BLPAREN
+ && newOperator != &AS_PLUS_PLUS
+ && newOperator != &AS_MINUS_MINUS
+ && newOperator != &AS_NOT
+ && newOperator != &AS_BIT_NOT
+ && newOperator != &AS_ARROW
+ && newOperator != &AS_OPERATOR
+ && newOperator != &AS_RETURN
+ && !(newOperator == &AS_MINUS && isInExponent())
+ && !(newOperator == &AS_MINUS // check for negative number
+ && (previousNonWSChar == '('
+ || previousNonWSChar == '='
+ || previousNonWSChar == ','))
+ && !(newOperator == &AS_PLUS && isInExponent())
+ && previousOperator != &AS_OPERATOR
+ && !((newOperator == &AS_MULT || newOperator == &AS_BIT_AND)
+ && isPointerOrReference())
+ && !(newOperator == &AS_MULT
+ && (previousNonWSChar == '.'
+ || previousNonWSChar == '>')) // check for ->
+ && !((isInTemplate || isCharImmediatelyPostTemplate)
+ && (newOperator == &AS_LS || newOperator == &AS_GR))
+ );
+ // pad before operator
+ if (shouldPad
+ && !isInBlParen
+ && !(newOperator == &AS_COLON && !foundQuestionMark)
+ && newOperator != &AS_SEMICOLON
+ && newOperator != &AS_COMMA)
+ appendSpacePad();
+ appendSequence(*newOperator);
+ goForward(newOperator->length() - 1);
+
+ // since this block handles '()' and '[]',
+ // the parenStack must be updated here accordingly!
+ if (newOperator == &AS_PAREN_PAREN
+ || newOperator == &AS_BLPAREN_BLPAREN)
+ parenStack->back()--;
+
+ currentChar = (*newOperator)[newOperator->length() - 1];
+ // pad after operator
+ // but do not pad after a '-' that is a unary-minus.
+ if (shouldPad
+ && !isInBlParen
+ && !isBeforeComment()
+ && !(newOperator == &AS_MINUS && isUnaryMinus())
+ && !(currentLine.compare(charNum + 1, 1, ";") == 0)
+ && !(currentLine.compare(charNum + 1, 2, "::") == 0))
+ appendSpaceAfter();
+
+ previousOperator = newOperator;
+ return;
+}
+
+/**
+ * add or remove space padding to parens
+ * currentChar contains the paren
+ * the parens and necessary padding will be appended to formattedLine
+ * the calling function should have a continue statement after calling this method
+ */
+void ASFormatter::padParens(void)
+{
+ assert(shouldPadParensOutside || shouldPadParensInside || shouldUnPadParens);
+ assert (currentChar == '(' || currentChar == ')');
+
+ if (currentChar == '(')
+ {
+ int spacesOutsideToDelete = formattedLine.length() - 1;
+ int spacesInsideToDelete = 0;
+
+ // compute spaces outside the opening paren to delete
+ if (shouldUnPadParens)
+ {
+ char lastChar = ' ';
+ bool prevIsParenHeader = false;
+ size_t i = formattedLine.find_last_not_of(" \t");
+ if (i != string::npos)
+ {
+ size_t end = i;
+ spacesOutsideToDelete -= i;
+ lastChar = formattedLine[i];
+ // was last word a paren header?
+ int start; // start of the previous word
+ for (start = i; start > 0; start--)
+ {
+ if (isLegalNameChar(formattedLine[start]) || formattedLine[start] == '*')
+ continue;
+ start++;
+ break;
+ }
+ string prevWord = formattedLine.substr(start, end-start+1);
+ // if previous word is a header, it will be a paren header
+ const string *prevWordH = ASBeautifier::findHeader(formattedLine, start, headers);
+ if (prevWordH != NULL)
+ {
+ prevIsParenHeader = true;
+ TRxtra(*prevWordH); // trace macro
+ }
+ else if (prevWord == "return" // don't unpad return statements
+ || prevWord == "*") // don't unpad multiply or pointer
+ {
+ prevIsParenHeader = true;
+ TRxtra(prevWord); // trace macro
+ }
+ // don't unpad variables
+ else if (prevWord == "bool"
+ || prevWord == "int"
+ || prevWord == "void"
+ || prevWord == "void*"
+ || (prevWord.length() >= 6 // check end of word for _t
+ && prevWord.compare(prevWord.length()-2, 2, "_t") == 0)
+ || prevWord == "BOOL"
+ || prevWord == "DWORD"
+ || prevWord == "HWND"
+ || prevWord == "INT"
+ || prevWord == "LPSTR"
+ || prevWord == "VOID"
+ || prevWord == "LPVOID"
+ )
+ {
+ prevIsParenHeader = true;
+ TRxtra(prevWord); // trace macro
+ }
+ }
+ // do not unpad operators, but leave them if already padded
+ if (shouldPadParensOutside || prevIsParenHeader)
+ spacesOutsideToDelete--;
+ else if (lastChar == '|' // check for ||
+ || lastChar == '&' // check for &&
+ || lastChar == ','
+ || (lastChar == '>' && !foundCastOperator)
+ || lastChar == '<'
+ || lastChar == '?'
+ || lastChar == ':'
+ || lastChar == ';'
+ || lastChar == '='
+ || lastChar == '+'
+ || lastChar == '-'
+ || (lastChar == '*' && isInPotentialCalculation)
+ || lastChar == '/'
+ || lastChar == '%')
+ spacesOutsideToDelete--;
+
+ if (spacesOutsideToDelete > 0)
+ {
+ formattedLine.erase(i + 1, spacesOutsideToDelete);
+ spacePadNum -= spacesOutsideToDelete;
+ }
+ }
+
+ // pad open paren outside
+ char peekedCharOutside = peekNextChar();
+ if (shouldPadParensOutside)
+ if (!(currentChar == '(' && peekedCharOutside == ')'))
+ appendSpacePad();
+
+ appendCurrentChar();
+
+ // unpad open paren inside
+ if (shouldUnPadParens)
+ {
+ size_t j = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (j != string::npos)
+ spacesInsideToDelete = j - charNum - 1;
+ if (shouldPadParensInside)
+ spacesInsideToDelete--;
+ if (spacesInsideToDelete > 0)
+ {
+ currentLine.erase(charNum + 1, spacesInsideToDelete);
+ spacePadNum -= spacesInsideToDelete;
+ }
+ }
+
+ // pad open paren inside
+ char peekedCharInside = peekNextChar();
+ if (shouldPadParensInside)
+ if (!(currentChar == '(' && peekedCharInside == ')'))
+ appendSpaceAfter();
+
+ TRunpad('(', spacesOutsideToDelete, spacesInsideToDelete); // trace macro
+ }
+ else if (currentChar == ')' /*|| currentChar == ']'*/)
+ {
+ int spacesOutsideToDelete = 0;
+ int spacesInsideToDelete = formattedLine.length();
+
+ // unpad close paren inside
+ if (shouldUnPadParens)
+ {
+ size_t i = formattedLine.find_last_not_of(" \t");
+ if (i != string::npos)
+ spacesInsideToDelete = formattedLine.length() - 1 - i;
+ if (shouldPadParensInside)
+ spacesInsideToDelete--;
+ if (spacesInsideToDelete > 0)
+ {
+ formattedLine.erase(i + 1, spacesInsideToDelete);
+ spacePadNum -= spacesInsideToDelete;
+ }
+ }
+
+ // pad close paren inside
+ if (shouldPadParensInside)
+ if (!(previousChar == '(' && currentChar == ')'))
+ appendSpacePad();
+
+ appendCurrentChar();
+
+ // unpad close paren outside
+ if (shouldUnPadParens)
+ {
+ // may have end of line comments
+ size_t j = currentLine.find_first_not_of(" \t", charNum + 1);
+ if (j != string::npos)
+ if (currentLine[j] == '[' || currentLine[j] == ']')
+ spacesOutsideToDelete = j - charNum - 1;
+ if (shouldPadParensOutside)
+ spacesOutsideToDelete--;
+// spacesOutsideToDelete--; // always leave 1 space
+
+ if (spacesOutsideToDelete > 0)
+ {
+ currentLine.erase(charNum + 1, spacesOutsideToDelete);
+ spacePadNum -= spacesOutsideToDelete;
+ }
+ }
+
+ // pad close paren outside
+ char peekedCharOutside = peekNextChar();
+ if (shouldPadParensOutside)
+ if (peekedCharOutside != ';'
+ && peekedCharOutside != ','
+ && peekedCharOutside != '.'
+ && peekedCharOutside != '-') // check for ->
+// && !(currentChar == ']' && peekedCharOutside == '['))
+ appendSpaceAfter();
+
+ TRunpad(')', spacesInsideToDelete, 0 /*spacesOutsideToDelete*/); // trace macro
+ }
+ return;
+}
+
+/**
+ * format brackets as attached or broken
+ * currentChar contains the bracket
+ * the brackets will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param bracketType the type of bracket to be formatted.
+ */
+void ASFormatter::formatBrackets(BracketType bracketType)
+{
+ assert(!IS_A(bracketType, ARRAY_TYPE));
+ assert (currentChar == '{' || currentChar == '}');
+
+ if (currentChar == '{')
+ {
+ parenStack->push_back(0);
+ }
+ else if (currentChar == '}')
+ {
+ if (!parenStack->empty())
+ {
+ parenStack->pop_back();
+ }
+ }
+
+ if (currentChar == '{')
+ {
+ bool bdacBreak = false;
+ // should a Linux bracket be broken?
+ if (bracketFormatMode == BDAC_MODE)
+ {
+ // always break a class
+ if (IS_A((*bracketTypeStack)[bracketTypeStack->size()-1], CLASS_TYPE))
+ bdacBreak = true;
+ // break a namespace and the first bracket if a function
+ else if (bracketTypeStack->size() <= 2)
+ {
+ if (IS_A((*bracketTypeStack)[bracketTypeStack->size()-1], NAMESPACE_TYPE)
+ || IS_A((*bracketTypeStack)[bracketTypeStack->size()-1], COMMAND_TYPE))
+ bdacBreak = true;
+ }
+ // break the first bracket after a namespace if a function
+ else if (IS_A((*bracketTypeStack)[bracketTypeStack->size()-2], NAMESPACE_TYPE))
+ {
+ if (IS_A((*bracketTypeStack)[bracketTypeStack->size()-1], COMMAND_TYPE))
+ bdacBreak = true;
+ }
+ // if not C style then break the first bracket after a class if a function
+ else if (!ASBeautifier::isCStyle)
+ {
+ if (IS_A((*bracketTypeStack)[bracketTypeStack->size()-2], CLASS_TYPE)
+ && IS_A((*bracketTypeStack)[bracketTypeStack->size()-1], COMMAND_TYPE))
+ bdacBreak = true;
+ }
+ }
+ if (bracketFormatMode == ATTACH_MODE
+ || (bracketFormatMode == BDAC_MODE && !bdacBreak))
+ {
+ // are there comments before the bracket?
+ if (isCharImmediatelyPostComment || isCharImmediatelyPostLineComment)
+ {
+ if ((shouldBreakOneLineBlocks || !IS_A(bracketType, SINGLE_LINE_TYPE))
+ && peekNextChar() != '}')
+ appendCharInsideComments();
+ else
+ appendCurrentChar(true); // don't attach
+ }
+ else if (previousCommandChar == '{'
+ || previousCommandChar == '}'
+ || previousCommandChar == ';') // '}' , ';' chars added for proper handling of '{' immediately after a '}' or ';'
+ {
+ appendCurrentChar(true); // don't attach
+ }
+ else
+ {
+ size_t firstChar = formattedLine.find_first_not_of(" \t");
+ if (firstChar == string::npos) // if a blank line preceeds this
+ appendCurrentChar(true); // don't attach
+ else if (shouldBreakOneLineBlocks
+ || !IS_A(bracketType, SINGLE_LINE_TYPE)
+ || peekNextChar() == '}')
+ {
+ appendSpacePad();
+ appendCurrentChar(false); // OK to attach
+ }
+ else
+ appendCurrentChar(true); // don't attach
+ }
+ }
+ else if (bracketFormatMode == BREAK_MODE
+ || (bracketFormatMode == BDAC_MODE && bdacBreak))
+ {
+ if (isBeforeComment())
+ {
+ // do not break unless comment is at line end
+ if (isBeforeLineEndComment(charNum))
+ {
+ currentChar = ' '; // remove bracket from current line
+ appendOpeningBracket = true; // append bracket to following line
+ }
+ }
+ else if (!IS_A(bracketType, SINGLE_LINE_TYPE))
+ breakLine();
+ else if (shouldBreakOneLineBlocks && peekNextChar() != '}')
+ breakLine();
+
+ appendCurrentChar();
+ }
+ else if (bracketFormatMode == NONE_MODE)
+ {
+ if (lineBeginsWith('{')) // is opening bracket broken?
+ appendCurrentChar(true);
+ else
+ appendCurrentChar(false);
+ }
+ }
+ else if (currentChar == '}')
+ {
+ // mark state of immediately after empty block
+ // this state will be used for locating brackets that appear immedately AFTER an empty block (e.g. '{} \n}').
+ if (previousCommandChar == '{')
+ isImmediatelyPostEmptyBlock = true;
+
+ if ((!(previousCommandChar == '{' && isPreviousBracketBlockRelated)) // this '{' does not close an empty block
+ && (shouldBreakOneLineBlocks || !IS_A(bracketType, SINGLE_LINE_TYPE)) // astyle is allowed to break on line blocks
+ && (!(bracketFormatMode == NONE_MODE && IS_A(bracketType, SINGLE_LINE_TYPE)))
+ && !isImmediatelyPostEmptyBlock) // this '}' does not immediately follow an empty block
+ {
+ breakLine();
+ appendCurrentChar();
+ }
+ else
+ {
+ if (!isCharImmediatelyPostComment
+ && !bracketFormatMode == NONE_MODE
+ && !isImmediatelyPostEmptyBlock)
+ isInLineBreak = false;
+
+ appendCurrentChar();
+
+ //if (!bracketFormatMode == NONE_MODE)
+ // if ((shouldBreakOneLineBlocks || !IS_A(bracketType, SINGLE_LINE_TYPE))
+ // && !(currentChar == '}' && peekNextChar() == ';')) // fixes }; placed on separate lines
+ // shouldBreakLineAfterComments = true;
+ }
+
+ if (shouldBreakBlocks)
+ {
+ isAppendPostBlockEmptyLineRequested = true;
+ }
+ }
+ return;
+}
+
+/**
+ * format array brackets as attached or broken
+ * determine if the brackets can have an inStatement indent
+ * currentChar contains the bracket
+ * the brackets will be appended to the current formattedLine or a new formattedLine as necessary
+ * the calling function should have a continue statement after calling this method
+ *
+ * @param bracketType the type of bracket to be formatted, must be an ARRAY_TYPE.
+ * @param isOpeningArrayBracket indicates if this is the opening bracket for the array block.
+ */
+void ASFormatter::formatArrayBrackets(BracketType bracketType, bool isOpeningArrayBracket)
+{
+ assert(IS_A(bracketType, ARRAY_TYPE));
+ assert (currentChar == '{' || currentChar == '}');
+
+ if (currentChar == '{')
+ {
+ // is this the first opening bracket in the array?
+ if (isOpeningArrayBracket)
+ {
+ if (bracketFormatMode == ATTACH_MODE || bracketFormatMode == BDAC_MODE)
+ {
+ // don't attach to a preprocessor directive
+ if (isImmediatelyPostPreprocessor)
+ appendCurrentChar(true); // don't attach
+ // are there comments before the bracket?
+ else if (isCharImmediatelyPostComment || isCharImmediatelyPostLineComment)
+ {
+ appendCharInsideComments();
+ }
+ else
+ {
+ // if bracket is broken or not an assignment
+ if (lineBeginsWith('{') || previousNonWSChar != '=')
+ appendSpacePad();
+ appendCurrentChar(false); // OK to attach
+ }
+ }
+ else if (bracketFormatMode == BREAK_MODE)
+ {
+ if (isWhiteSpace(peekNextChar()))
+ breakLine();
+ else if (isBeforeComment())
+ {
+ // do not break unless comment is at line end
+ if (isBeforeLineEndComment(charNum))
+ {
+ currentChar = ' '; // remove bracket from current line
+ appendOpeningBracket = true; // append bracket to following line
+ }
+ }
+ appendCurrentChar();
+ }
+ else if (bracketFormatMode == NONE_MODE)
+ {
+ if (lineBeginsWith('{')) // is opening bracket broken?
+ appendCurrentChar();
+ else
+ appendCurrentChar(false);
+ }
+ }
+ else
+ appendCurrentChar(); // not the first opening bracket - don't change
+
+ // if an opening bracket ends the line there will be no inStatement indent
+ char nextChar = peekNextChar();
+ if (isWhiteSpace(nextChar)
+ || isBeforeLineEndComment(charNum)
+ || nextChar == '{')
+ isNonInStatementArray = true;
+ if (isNonInStatementArray)
+ TRarray('x');
+ else
+ TRarray(' ');
+
+ }
+ else if (currentChar == '}')
+ {
+ // does this close the first opening bracket in the array?
+ if (isOpeningArrayBracket && !IS_A(bracketType, SINGLE_LINE_TYPE) )
+ {
+ breakLine();
+ appendCurrentChar();
+ }
+ else
+ appendCurrentChar();
+ }
+}
+
+
+} // end namespace astyle
diff --git a/lib/astyle/ASResource.cpp b/lib/astyle/ASResource.cpp
new file mode 100644
index 00000000..0c554ac0
--- /dev/null
+++ b/lib/astyle/ASResource.cpp
@@ -0,0 +1,389 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * ASResource.cpp
+ *
+ * This file is a part of "Artistic Style" - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * http://astyle.sourceforge.net
+ *
+ * The "Artistic Style" project, including all files needed to
+ * compile it, is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this project; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#include "astyle.h"
+
+
+namespace astyle
+{
+const string ASResource::AS_IF = string("if");
+const string ASResource::AS_ELSE = string("else");
+const string ASResource::AS_FOR = string("for");
+const string ASResource::AS_DO = string("do");
+const string ASResource::AS_WHILE = string("while");
+const string ASResource::AS_SWITCH = string("switch");
+const string ASResource::AS_CASE = string("case");
+const string ASResource::AS_DEFAULT = string("default");
+const string ASResource::AS_CLASS = string("class");
+const string ASResource::AS_STRUCT = string("struct");
+const string ASResource::AS_UNION = string("union");
+const string ASResource::AS_INTERFACE = string("interface");
+const string ASResource::AS_NAMESPACE = string("namespace");
+const string ASResource::AS_EXTERN = string("extern");
+const string ASResource::AS_PUBLIC = string("public");
+const string ASResource::AS_PROTECTED = string("protected");
+const string ASResource::AS_PRIVATE = string("private");
+const string ASResource::AS_STATIC = string("static");
+const string ASResource::AS_SYNCHRONIZED = string("synchronized");
+const string ASResource::AS_OPERATOR = string("operator");
+const string ASResource::AS_TEMPLATE = string("template");
+const string ASResource::AS_TRY = string("try");
+const string ASResource::AS_CATCH = string("catch");
+const string ASResource::AS_FINALLY = string("finally");
+const string ASResource::AS_THROWS = string("throws");
+const string ASResource::AS_CONST = string("const");
+
+const string ASResource::AS_ASM = string("asm");
+
+const string ASResource::AS_BAR_DEFINE = string("#define");
+const string ASResource::AS_BAR_INCLUDE = string("#include");
+const string ASResource::AS_BAR_IF = string("#if");
+const string ASResource::AS_BAR_EL = string("#el");
+const string ASResource::AS_BAR_ENDIF = string("#endif");
+
+const string ASResource::AS_OPEN_BRACKET = string("{");
+const string ASResource::AS_CLOSE_BRACKET = string("}");
+const string ASResource::AS_OPEN_LINE_COMMENT = string("//");
+const string ASResource::AS_OPEN_COMMENT = string("/*");
+const string ASResource::AS_CLOSE_COMMENT = string("*/");
+
+const string ASResource::AS_ASSIGN = string("=");
+const string ASResource::AS_PLUS_ASSIGN = string("+=");
+const string ASResource::AS_MINUS_ASSIGN = string("-=");
+const string ASResource::AS_MULT_ASSIGN = string("*=");
+const string ASResource::AS_DIV_ASSIGN = string("/=");
+const string ASResource::AS_MOD_ASSIGN = string("%=");
+const string ASResource::AS_OR_ASSIGN = string("|=");
+const string ASResource::AS_AND_ASSIGN = string("&=");
+const string ASResource::AS_XOR_ASSIGN = string("^=");
+const string ASResource::AS_GR_GR_ASSIGN = string(">>=");
+const string ASResource::AS_LS_LS_ASSIGN = string("<<=");
+const string ASResource::AS_GR_GR_GR_ASSIGN = string(">>>=");
+const string ASResource::AS_LS_LS_LS_ASSIGN = string("<<<=");
+const string ASResource::AS_RETURN = string("return");
+
+const string ASResource::AS_EQUAL = string("==");
+const string ASResource::AS_PLUS_PLUS = string("++");
+const string ASResource::AS_MINUS_MINUS = string("--");
+const string ASResource::AS_NOT_EQUAL = string("!=");
+const string ASResource::AS_GR_EQUAL = string(">=");
+const string ASResource::AS_GR_GR = string(">>");
+const string ASResource::AS_GR_GR_GR = string(">>>");
+const string ASResource::AS_LS_EQUAL = string("<=");
+const string ASResource::AS_LS_LS = string("<<");
+const string ASResource::AS_LS_LS_LS = string("<<<");
+const string ASResource::AS_ARROW = string("->");
+const string ASResource::AS_AND = string("&&");
+const string ASResource::AS_OR = string("||");
+const string ASResource::AS_COLON_COLON = string("::");
+const string ASResource::AS_PAREN_PAREN = string("()");
+const string ASResource::AS_BLPAREN_BLPAREN = string("[]");
+
+const string ASResource::AS_PLUS = string("+");
+const string ASResource::AS_MINUS = string("-");
+const string ASResource::AS_MULT = string("*");
+const string ASResource::AS_DIV = string("/");
+const string ASResource::AS_MOD = string("%");
+const string ASResource::AS_GR = string(">");
+const string ASResource::AS_LS = string("<");
+const string ASResource::AS_NOT = string("!");
+const string ASResource::AS_BIT_OR = string("|");
+const string ASResource::AS_BIT_AND = string("&");
+const string ASResource::AS_BIT_NOT = string("~");
+const string ASResource::AS_BIT_XOR = string("^");
+const string ASResource::AS_QUESTION = string("?");
+const string ASResource::AS_COLON = string(":");
+const string ASResource::AS_COMMA = string(",");
+const string ASResource::AS_SEMICOLON = string(";");
+
+const string ASResource::AS_FOREACH = string("foreach");
+const string ASResource::AS_LOCK = string("lock");
+const string ASResource::AS_UNSAFE = string("unsafe");
+const string ASResource::AS_FIXED = string("fixed");
+const string ASResource::AS_GET = string("get");
+const string ASResource::AS_SET = string("set");
+const string ASResource::AS_ADD = string("add");
+const string ASResource::AS_REMOVE = string("remove");
+
+const string ASResource::AS_CONST_CAST = string("const_cast");
+const string ASResource::AS_DYNAMIC_CAST = string("dynamic_cast");
+const string ASResource::AS_REINTERPRET_CAST = string("reinterpret_cast");
+const string ASResource::AS_STATIC_CAST = string("static_cast");
+
+
+/**
+ * Build the vector of assignment operators.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param assignmentOperators a reference to the vector to be built.
+ */
+void ASResource::buildAssignmentOperators(vector<const string*> &assignmentOperators)
+{
+ assignmentOperators.push_back(&AS_ASSIGN);
+ assignmentOperators.push_back(&AS_PLUS_ASSIGN);
+ assignmentOperators.push_back(&AS_MINUS_ASSIGN);
+ assignmentOperators.push_back(&AS_MULT_ASSIGN);
+ assignmentOperators.push_back(&AS_DIV_ASSIGN);
+ assignmentOperators.push_back(&AS_MOD_ASSIGN);
+ assignmentOperators.push_back(&AS_OR_ASSIGN);
+ assignmentOperators.push_back(&AS_AND_ASSIGN);
+ assignmentOperators.push_back(&AS_XOR_ASSIGN);
+
+ // Java
+ assignmentOperators.push_back(&AS_GR_GR_GR_ASSIGN);
+ assignmentOperators.push_back(&AS_GR_GR_ASSIGN);
+ assignmentOperators.push_back(&AS_LS_LS_ASSIGN);
+
+ // Unknown
+ assignmentOperators.push_back(&AS_LS_LS_LS_ASSIGN);
+
+ assignmentOperators.push_back(&AS_RETURN);
+}
+
+/**
+ * Build the vector of C++ cast operators.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param castOperators a reference to the vector to be built.
+ */
+void ASResource::buildCastOperators(vector<const string*> &castOperators)
+{
+ castOperators.push_back(&AS_CONST_CAST);
+ castOperators.push_back(&AS_DYNAMIC_CAST);
+ castOperators.push_back(&AS_REINTERPRET_CAST);
+ castOperators.push_back(&AS_STATIC_CAST);
+}
+
+/**
+ * Build the vector of header words.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param headers a reference to the vector to be built.
+ */
+void ASResource::buildHeaders(vector<const string*> &headers, int fileType, bool beautifier)
+{
+ headers.push_back(&AS_IF);
+ headers.push_back(&AS_ELSE);
+ headers.push_back(&AS_FOR);
+ headers.push_back(&AS_WHILE);
+ headers.push_back(&AS_DO);
+ headers.push_back(&AS_SWITCH);
+ headers.push_back(&AS_TRY);
+ headers.push_back(&AS_CATCH);
+
+ if (beautifier)
+ {
+ headers.push_back(&AS_CASE);
+ headers.push_back(&AS_DEFAULT);
+ headers.push_back(&AS_CONST);
+ headers.push_back(&AS_STATIC);
+ headers.push_back(&AS_EXTERN);
+ headers.push_back(&AS_TEMPLATE);
+ }
+
+ if (fileType == JAVA_TYPE)
+ {
+ headers.push_back(&AS_FINALLY);
+ headers.push_back(&AS_SYNCHRONIZED);
+ }
+
+ if (fileType == SHARP_TYPE)
+ {
+ headers.push_back(&AS_FINALLY);
+ headers.push_back(&AS_FOREACH);
+ headers.push_back(&AS_LOCK);
+ headers.push_back(&AS_UNSAFE);
+ headers.push_back(&AS_FIXED);
+ headers.push_back(&AS_GET);
+ headers.push_back(&AS_SET);
+ headers.push_back(&AS_ADD);
+ headers.push_back(&AS_REMOVE);
+ }
+}
+
+/**
+ * Build the vector of non-assignment operators.
+ * Used by ONLY ASBeautifier.cpp
+ *
+ * @param nonParenHeaders a reference to the vector to be built.
+ */
+void ASResource::buildNonAssignmentOperators(vector<const string*> &nonAssignmentOperators)
+{
+ nonAssignmentOperators.push_back(&AS_EQUAL);
+ nonAssignmentOperators.push_back(&AS_PLUS_PLUS);
+ nonAssignmentOperators.push_back(&AS_MINUS_MINUS);
+ nonAssignmentOperators.push_back(&AS_NOT_EQUAL);
+ nonAssignmentOperators.push_back(&AS_GR_EQUAL);
+ nonAssignmentOperators.push_back(&AS_GR_GR_GR);
+ nonAssignmentOperators.push_back(&AS_GR_GR);
+ nonAssignmentOperators.push_back(&AS_LS_EQUAL);
+ nonAssignmentOperators.push_back(&AS_LS_LS_LS);
+ nonAssignmentOperators.push_back(&AS_LS_LS);
+ nonAssignmentOperators.push_back(&AS_ARROW);
+ nonAssignmentOperators.push_back(&AS_AND);
+ nonAssignmentOperators.push_back(&AS_OR);
+}
+
+/**
+ * Build the vector of header non-paren headers.
+ * Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
+ *
+ * @param nonParenHeaders a reference to the vector to be built.
+ */
+void ASResource::buildNonParenHeaders(vector<const string*> &nonParenHeaders, int fileType, bool beautifier)
+{
+ nonParenHeaders.push_back(&AS_ELSE);
+ nonParenHeaders.push_back(&AS_DO);
+ nonParenHeaders.push_back(&AS_TRY);
+
+ if (beautifier)
+ {
+ nonParenHeaders.push_back(&AS_CASE);
+ nonParenHeaders.push_back(&AS_DEFAULT);
+ nonParenHeaders.push_back(&AS_CONST);
+ nonParenHeaders.push_back(&AS_STATIC);
+ nonParenHeaders.push_back(&AS_EXTERN);
+ nonParenHeaders.push_back(&AS_TEMPLATE);
+ }
+
+ if (fileType == JAVA_TYPE)
+ {
+ nonParenHeaders.push_back(&AS_FINALLY);
+ }
+
+ if (fileType == SHARP_TYPE)
+ {
+ nonParenHeaders.push_back(&AS_FINALLY);
+ nonParenHeaders.push_back(&AS_UNSAFE);
+ nonParenHeaders.push_back(&AS_GET);
+ nonParenHeaders.push_back(&AS_SET);
+ nonParenHeaders.push_back(&AS_ADD);
+ nonParenHeaders.push_back(&AS_REMOVE);
+ }
+}
+
+/**
+ * Build the vector of operators.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param operators a reference to the vector to be built.
+ */
+void ASResource::buildOperators(vector<const string*> &operators)
+{
+ operators.push_back(&AS_PLUS_ASSIGN);
+ operators.push_back(&AS_MINUS_ASSIGN);
+ operators.push_back(&AS_MULT_ASSIGN);
+ operators.push_back(&AS_DIV_ASSIGN);
+ operators.push_back(&AS_MOD_ASSIGN);
+ operators.push_back(&AS_OR_ASSIGN);
+ operators.push_back(&AS_AND_ASSIGN);
+ operators.push_back(&AS_XOR_ASSIGN);
+ operators.push_back(&AS_EQUAL);
+ operators.push_back(&AS_PLUS_PLUS);
+ operators.push_back(&AS_MINUS_MINUS);
+ operators.push_back(&AS_NOT_EQUAL);
+ operators.push_back(&AS_GR_EQUAL);
+ operators.push_back(&AS_GR_GR_GR_ASSIGN);
+ operators.push_back(&AS_GR_GR_ASSIGN);
+ operators.push_back(&AS_GR_GR_GR);
+ operators.push_back(&AS_GR_GR);
+ operators.push_back(&AS_LS_EQUAL);
+ operators.push_back(&AS_LS_LS_LS_ASSIGN);
+ operators.push_back(&AS_LS_LS_ASSIGN);
+ operators.push_back(&AS_LS_LS_LS);
+ operators.push_back(&AS_LS_LS);
+ operators.push_back(&AS_ARROW);
+ operators.push_back(&AS_AND);
+ operators.push_back(&AS_OR);
+ operators.push_back(&AS_COLON_COLON);
+ operators.push_back(&AS_PLUS);
+ operators.push_back(&AS_MINUS);
+ operators.push_back(&AS_MULT);
+ operators.push_back(&AS_DIV);
+ operators.push_back(&AS_MOD);
+ operators.push_back(&AS_QUESTION);
+ operators.push_back(&AS_COLON);
+ operators.push_back(&AS_ASSIGN);
+ operators.push_back(&AS_LS);
+ operators.push_back(&AS_GR);
+ operators.push_back(&AS_NOT);
+ operators.push_back(&AS_BIT_OR);
+ operators.push_back(&AS_BIT_AND);
+ operators.push_back(&AS_BIT_NOT);
+ operators.push_back(&AS_BIT_XOR);
+ operators.push_back(&AS_OPERATOR);
+ operators.push_back(&AS_COMMA);
+ operators.push_back(&AS_RETURN);
+}
+
+/**
+ * Build the vector of pre-block statements.
+ * Used by ONLY ASBeautifier.cpp
+ *
+ * @param preBlockStatements a reference to the vector to be built.
+ */
+void ASResource::buildPreBlockStatements(vector<const string*> &preBlockStatements)
+{
+ preBlockStatements.push_back(&AS_CLASS);
+ preBlockStatements.push_back(&AS_STRUCT);
+ preBlockStatements.push_back(&AS_UNION);
+ preBlockStatements.push_back(&AS_INTERFACE);
+ preBlockStatements.push_back(&AS_NAMESPACE);
+ preBlockStatements.push_back(&AS_THROWS);
+ preBlockStatements.push_back(&AS_EXTERN);
+}
+
+/**
+ * Build the vector of pre-command headers.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param preCommandHeaders a reference to the vector to be built.
+ */
+void ASResource::buildPreCommandHeaders(vector<const string*> &preCommandHeaders)
+{
+ preCommandHeaders.push_back(&AS_EXTERN);
+ preCommandHeaders.push_back(&AS_THROWS);
+ preCommandHeaders.push_back(&AS_CONST);
+}
+
+/**
+ * Build the vector of pre-definition headers.
+ * Used by ONLY ASFormatter.cpp
+ *
+ * @param preDefinitionHeaders a reference to the vector to be built.
+ */
+void ASResource::buildPreDefinitionHeaders(vector<const string*> &preDefinitionHeaders)
+{
+ preDefinitionHeaders.push_back(&AS_CLASS);
+ preDefinitionHeaders.push_back(&AS_INTERFACE);
+ preDefinitionHeaders.push_back(&AS_NAMESPACE);
+ preDefinitionHeaders.push_back(&AS_STRUCT);
+}
+
+
+} // end namespace astyle
diff --git a/lib/astyle/Makefile.am b/lib/astyle/Makefile.am
new file mode 100644
index 00000000..dbafd18e
--- /dev/null
+++ b/lib/astyle/Makefile.am
@@ -0,0 +1,4 @@
+INCLUDES = $(all_includes)
+noinst_LTLIBRARIES = libastyle.la
+libastyle_la_LDFLAGS = $(all_libraries)
+libastyle_la_SOURCES = ASBeautifier.cpp ASEnhancer.cpp ASFormatter.cpp ASResource.cpp
diff --git a/lib/astyle/astyle.h b/lib/astyle/astyle.h
new file mode 100644
index 00000000..445aacf6
--- /dev/null
+++ b/lib/astyle/astyle.h
@@ -0,0 +1,497 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * astyle.h
+ *
+ * This file is a part of "Artistic Style" - an indentation and
+ * reformatting tool for C, C++, C# and Java source files.
+ * http://astyle.sourceforge.net
+ *
+ * The "Artistic Style" project, including all files needed to
+ * compile it, is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this project; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+#ifndef ASTYLE_H
+#define ASTYLE_H
+
+#ifdef __VMS
+#define __USE_STD_IOSTREAM 1
+#include <sstream>
+#endif
+
+#include <string>
+#include <vector>
+#include <cctype>
+
+#include <string.h>
+
+using namespace std;
+
+
+// 4996 - secure version deprecation warnings for .NET 2005
+// 4267 - 64 bit signed/unsigned loss of data
+#ifdef _MSC_VER
+#pragma warning(disable: 4996)
+#pragma warning(disable: 4267)
+#endif
+
+namespace astyle
+{
+
+enum FileType { C_TYPE=0, JAVA_TYPE=1, SHARP_TYPE=2 };
+
+/* The enums below are not recognized by 'vectors' in Microsoft Visual C++
+ V5 when they are part of a namespace!!! Use Visual C++ V6 or higher.
+*/
+enum BracketMode { NONE_MODE, ATTACH_MODE, BREAK_MODE, BDAC_MODE };
+
+enum BracketType { NULL_TYPE = 0,
+ NAMESPACE_TYPE = 1, // also a DEFINITION_TYPE
+ CLASS_TYPE = 2, // also a DEFINITION_TYPE
+ DEFINITION_TYPE = 4,
+ COMMAND_TYPE = 8,
+ ARRAY_TYPE = 16, // arrays and enums
+ SINGLE_LINE_TYPE = 32
+ };
+
+class ASSourceIterator
+{
+ public:
+ int eolWindows;
+ int eolLinux;
+ int eolMacOld;
+ char outputEOL[4]; // output end of line char
+ ASSourceIterator() { eolWindows = eolLinux = eolMacOld = 0; }
+ virtual ~ASSourceIterator() {}
+ virtual bool hasMoreLines() const = 0;
+ virtual string nextLine() = 0;
+};
+
+class ASResource
+{
+ public:
+ void buildAssignmentOperators(vector<const string*> &assignmentOperators);
+ void buildCastOperators(vector<const string*> &castOperators);
+ void buildHeaders(vector<const string*> &headers, int fileType, bool beautifier=false);
+ void buildNonAssignmentOperators(vector<const string*> &nonAssignmentOperators);
+ void buildNonParenHeaders(vector<const string*> &nonParenHeaders, int fileType, bool beautifier=false);
+ void buildOperators(vector<const string*> &operators);
+ void buildPreBlockStatements(vector<const string*> &preBlockStatements);
+ void buildPreCommandHeaders(vector<const string*> &preCommandHeaders);
+ void buildPreDefinitionHeaders(vector<const string*> &preDefinitionHeaders);
+
+ public:
+ static const string AS_IF, AS_ELSE;
+ static const string AS_DO, AS_WHILE;
+ static const string AS_FOR;
+ static const string AS_SWITCH, AS_CASE, AS_DEFAULT;
+ static const string AS_TRY, AS_CATCH, AS_THROWS, AS_FINALLY;
+ static const string AS_PUBLIC, AS_PROTECTED, AS_PRIVATE;
+ static const string AS_CLASS, AS_STRUCT, AS_UNION, AS_INTERFACE, AS_NAMESPACE, AS_EXTERN;
+ static const string AS_STATIC;
+ static const string AS_CONST;
+ static const string AS_SYNCHRONIZED;
+ static const string AS_OPERATOR, AS_TEMPLATE;
+ static const string AS_OPEN_BRACKET, AS_CLOSE_BRACKET;
+ static const string AS_OPEN_LINE_COMMENT, AS_OPEN_COMMENT, AS_CLOSE_COMMENT;
+ static const string AS_BAR_DEFINE, AS_BAR_INCLUDE, AS_BAR_IF, AS_BAR_EL, AS_BAR_ENDIF;
+ static const string AS_RETURN;
+ static const string AS_ASSIGN, AS_PLUS_ASSIGN, AS_MINUS_ASSIGN, AS_MULT_ASSIGN;
+ static const string AS_DIV_ASSIGN, AS_MOD_ASSIGN, AS_XOR_ASSIGN, AS_OR_ASSIGN, AS_AND_ASSIGN;
+ static const string AS_GR_GR_ASSIGN, AS_LS_LS_ASSIGN, AS_GR_GR_GR_ASSIGN, AS_LS_LS_LS_ASSIGN;
+ static const string AS_EQUAL, AS_PLUS_PLUS, AS_MINUS_MINUS, AS_NOT_EQUAL, AS_GR_EQUAL, AS_GR_GR_GR, AS_GR_GR;
+ static const string AS_LS_EQUAL, AS_LS_LS_LS, AS_LS_LS, AS_ARROW, AS_AND, AS_OR;
+ static const string AS_COLON_COLON, AS_PAREN_PAREN, AS_BLPAREN_BLPAREN;
+ static const string AS_PLUS, AS_MINUS, AS_MULT, AS_DIV, AS_MOD, AS_GR, AS_LS;
+ static const string AS_NOT, AS_BIT_XOR, AS_BIT_OR, AS_BIT_AND, AS_BIT_NOT;
+ static const string AS_QUESTION, AS_COLON, AS_SEMICOLON, AS_COMMA;
+ static const string AS_ASM;
+ static const string AS_FOREACH, AS_LOCK, AS_UNSAFE, AS_FIXED;
+ static const string AS_GET, AS_SET, AS_ADD, AS_REMOVE;
+ static const string AS_CONST_CAST, AS_DYNAMIC_CAST, AS_REINTERPRET_CAST, AS_STATIC_CAST;
+};
+
+class ASBeautifier : protected ASResource
+{
+ public:
+ ASBeautifier();
+ virtual ~ASBeautifier();
+ virtual void init(ASSourceIterator* iter); // pointer to dynamically created iterator.
+ void init();
+ virtual bool hasMoreLines() const;
+ virtual string nextLine();
+ virtual string beautify(const string &line);
+ void setTabIndentation(int length = 4, bool forceTabs = false);
+ void setSpaceIndentation(int length = 4);
+ void setMaxInStatementIndentLength(int max);
+ void setMinConditionalIndentLength(int min);
+ void setClassIndent(bool state);
+ void setSwitchIndent(bool state);
+ void setCaseIndent(bool state);
+ void setBracketIndent(bool state);
+ void setBlockIndent(bool state);
+ void setNamespaceIndent(bool state);
+ void setLabelIndent(bool state);
+ void setCStyle();
+ void setJavaStyle();
+ void setSharpStyle();
+ void setEmptyLineFill(bool state);
+ void setPreprocessorIndent(bool state);
+ int getIndentLength(void);
+ string getIndentString(void);
+ bool getCaseIndent(void);
+ bool getCStyle(void);
+ bool getJavaStyle(void);
+ bool getSharpStyle(void);
+ bool getEmptyLineFill(void);
+
+ protected:
+ int getNextProgramCharDistance(const string &line, int i);
+// bool isLegalNameChar(char ch) const;
+ const string *findHeader(const string &line, int i,
+ const vector<const string*> &possibleHeaders,
+ bool checkBoundry = true);
+ string trim(const string &str);
+ int indexOf(vector<const string*> &container, const string *element);
+ int fileType;
+ bool isCStyle;
+ bool isJavaStyle;
+ bool isSharpStyle;
+
+ // variables set by ASFormatter - must be updated in preprocessor
+ int inLineNumber; // for debugging
+ int outLineNumber; // for debugging
+ bool lineCommentNoBeautify;
+ bool isNonInStatementArray;
+
+ private:
+ ASBeautifier(const ASBeautifier &copy);
+ void operator=(ASBeautifier&); // not to be implemented
+
+ void initStatic();
+ void registerInStatementIndent(const string &line, int i, int spaceTabCount,
+ int minIndent, bool updateParenStack);
+ string preLineWS(int spaceTabCount, int tabCount);
+
+ static vector<const string*> headers;
+ static vector<const string*> nonParenHeaders;
+ static vector<const string*> preBlockStatements;
+ static vector<const string*> assignmentOperators;
+ static vector<const string*> nonAssignmentOperators;
+
+ ASSourceIterator *sourceIterator;
+ vector<ASBeautifier*> *waitingBeautifierStack;
+ vector<ASBeautifier*> *activeBeautifierStack;
+ vector<int> *waitingBeautifierStackLengthStack;
+ vector<int> *activeBeautifierStackLengthStack;
+ vector<const string*> *headerStack;
+ vector< vector<const string*>* > *tempStacks;
+ vector<int> *blockParenDepthStack;
+ vector<bool> *blockStatementStack;
+ vector<bool> *parenStatementStack;
+ vector<int> *inStatementIndentStack;
+ vector<int> *inStatementIndentStackSizeStack;
+ vector<int> *parenIndentStack;
+ vector<bool> *bracketBlockStateStack;
+ string indentString;
+ const string *currentHeader;
+ const string *previousLastLineHeader;
+ const string *immediatelyPreviousAssignmentOp;
+ const string *probationHeader;
+ bool isInQuote;
+ bool isInComment;
+ bool isInCase;
+ bool isInQuestion;
+ bool isInStatement;
+ bool isInHeader;
+ bool isInOperator;
+ bool isInTemplate;
+ bool isInDefine;
+ bool isInDefineDefinition;
+ bool classIndent;
+ bool isInClassHeader;
+ bool isInClassHeaderTab;
+ bool switchIndent;
+ bool caseIndent;
+ bool namespaceIndent;
+ bool bracketIndent;
+ bool blockIndent;
+ bool labelIndent;
+ bool preprocessorIndent;
+ bool isInConditional;
+ bool isMinimalConditinalIndentSet;
+ bool shouldForceTabIndentation;
+ bool emptyLineFill;
+ bool backslashEndsPrevLine;
+ bool blockCommentNoIndent;
+ bool blockCommentNoBeautify;
+ bool previousLineProbationTab;
+ int minConditionalIndent;
+ int parenDepth;
+ int indentLength;
+ int blockTabCount;
+ int leadingWhiteSpaces;
+ int maxInStatementIndent;
+ int templateDepth;
+ int prevFinalLineSpaceTabCount;
+ int prevFinalLineTabCount;
+ int defineTabCount;
+ char quoteChar;
+ char prevNonSpaceCh;
+ char currentNonSpaceCh;
+ char currentNonLegalCh;
+ char prevNonLegalCh;
+ char peekNextChar(string &line, int i);
+
+ protected: // inline functions
+ // check if a specific character can be used in a legal variable/method/class name
+ inline bool isLegalNameChar(char ch) const {
+ return (isalnum(ch) || ch == '.' || ch == '_' || (isJavaStyle && ch == '$') || (isCStyle && ch == '~'));
+ }
+
+ // check if a specific character is a whitespace character
+ inline bool isWhiteSpace(char ch) const {
+ return (ch == ' ' || ch == '\t');
+ }
+};
+
+
+class ASEnhancer
+{
+ public:
+ // functions
+ ASEnhancer();
+ ~ASEnhancer();
+ void init(int, string, bool, bool, bool, bool, bool);
+ void enhance(string &line);
+
+ private:
+ // set by init function
+ int indentLength;
+ bool useTabs;
+ bool isCStyle;
+ bool isJavaStyle;
+ bool isSharpStyle;
+ bool caseIndent;
+ bool emptyLineFill;
+
+ // parsing variables
+ int lineNumber;
+ bool isInQuote;
+ bool isInComment;
+ char quoteChar;
+
+ // unindent variables
+ int bracketCount;
+ int switchDepth;
+ bool lookingForCaseBracket;
+ bool unindentNextLine;
+
+ // stringstream for trace
+ stringstream *traceOut;
+
+ private: // private functions
+ bool findKeyword(const string &line, int i, const char *header) const;
+ int indentLine(string &line, const int indent) const;
+ int unindentLine(string &line, const int unindent) const;
+
+ private:
+ // struct used by ParseFormattedLine function
+ // contains variables used to unindent the case blocks
+ struct switchVariables {
+ int switchBracketCount;
+ int unindentDepth;
+ bool unindentCase;
+
+ switchVariables() { // constructor
+ switchBracketCount = 0;
+ unindentDepth = 0;
+ unindentCase = false;
+ }
+ };
+
+ private: // inline functions
+ // check if a specific character can be used in a legal variable/method/class name
+ inline bool isLegalNameCharX(char ch) const {
+ return (isalnum(ch) || ch == '.' || ch == '_' || (isJavaStyle && ch == '$') || (isCStyle && ch == '~'));
+ }
+
+ // check if a specific character is a whitespace character
+ inline bool isWhiteSpaceX(char ch) const {
+ return (ch == ' ' || ch == '\t');
+ }
+};
+
+
+class ASFormatter : public ASBeautifier, private ASEnhancer
+{
+ public:
+ ASFormatter();
+ virtual ~ASFormatter();
+ virtual void init(ASSourceIterator* iter);
+ virtual bool hasMoreLines() const;
+ virtual string nextLine();
+ void setBracketFormatMode(BracketMode mode);
+ void setBreakClosingHeaderBracketsMode(bool state);
+ void setOperatorPaddingMode(bool mode);
+ void setParensOutsidePaddingMode(bool mode);
+ void setParensInsidePaddingMode(bool mode);
+ void setParensUnPaddingMode(bool state);
+ void setBreakOneLineBlocksMode(bool state);
+ void setSingleStatementsMode(bool state);
+ void setTabSpaceConversionMode(bool state);
+ void setBreakBlocksMode(bool state);
+ void setBreakClosingHeaderBlocksMode(bool state);
+ void setBreakElseIfsMode(bool state);
+ string fileName;
+
+ private:
+ void ASformatter(ASFormatter &copy); // not to be imlpemented
+ void operator=(ASFormatter&); // not to be implemented
+ void staticInit();
+ void goForward(int i);
+ void trimNewLine();
+ char peekNextChar() const;
+ BracketType getBracketType() const;
+ bool getNextChar();
+ bool isBeforeComment() const;
+ bool isBeforeLineEndComment(int startPos) const;
+ bool isPointerOrReference() const;
+ bool isUnaryMinus() const;
+ bool isInExponent() const;
+ bool isOneLineBlockReached() const;
+// bool isNextCharWhiteSpace() const;
+ bool lineBeginsWith(char charToCheck) const;
+ void appendChar(char ch, bool canBreakLine = true);
+ void appendCharInsideComments();
+ void appendSequence(const string &sequence, bool canBreakLine = true);
+ void appendSpacePad();
+ void appendSpaceAfter();
+ void breakLine();
+ void padOperators(const string *newOperator);
+ void padParens();
+ void formatBrackets(BracketType bracketType);
+ void formatArrayBrackets(BracketType bracketType, bool isOpeningArrayBracket);
+ void adjustComments();
+ const string *findHeader(const vector<const string*> &headers, bool checkBoundry = true);
+
+ static vector<const string*> headers;
+ static vector<const string*> nonParenHeaders;
+ static vector<const string*> preDefinitionHeaders;
+ static vector<const string*> preCommandHeaders;
+ static vector<const string*> operators;
+ static vector<const string*> assignmentOperators;
+ static vector<const string*> castOperators;
+
+ ASSourceIterator *sourceIterator;
+ vector<const string*> *preBracketHeaderStack;
+ vector<BracketType> *bracketTypeStack;
+ vector<int> *parenStack;
+ string readyFormattedLine;
+ string currentLine;
+ string formattedLine;
+ const string *currentHeader;
+ const string *previousOperator; // used ONLY by pad=oper
+ char currentChar;
+ char previousChar;
+ char previousNonWSChar;
+ char previousCommandChar;
+ char quoteChar;
+ int charNum;
+ int spacePadNum;
+ int templateDepth;
+ int traceFileNumber;
+ size_t formattedLineCommentNum; // comment location on formattedLine
+ size_t previousReadyFormattedLineLength;
+ BracketMode bracketFormatMode;
+ BracketType previousBracketType;
+ bool isVirgin;
+ bool shouldPadOperators;
+ bool shouldPadParensOutside;
+ bool shouldPadParensInside;
+ bool shouldUnPadParens;
+ bool shouldConvertTabs;
+ bool isInLineComment;
+ bool isInComment;
+ bool isInPreprocessor;
+ bool isInTemplate; // true both in template definitions (e.g. template<class A>) and template usage (e.g. F<int>).
+ bool doesLineStartComment;
+ bool isInQuote;
+ bool isInBlParen;
+ bool isSpecialChar;
+ bool isNonParenHeader;
+ bool foundQuestionMark;
+ bool foundPreDefinitionHeader;
+ bool foundNamespaceHeader;
+ bool foundClassHeader;
+ bool foundPreCommandHeader;
+ bool foundCastOperator;
+ bool isInLineBreak;
+// bool isInClosingBracketLineBreak;
+ bool endOfCodeReached;
+ bool lineCommentNoIndent;
+ bool isLineReady;
+ bool isPreviousBracketBlockRelated;
+ bool isInPotentialCalculation;
+ bool isCharImmediatelyPostComment;
+ bool isPreviousCharPostComment;
+ bool isCharImmediatelyPostLineComment;
+ bool isCharImmediatelyPostOpenBlock;
+ bool isCharImmediatelyPostCloseBlock;
+ bool isCharImmediatelyPostTemplate;
+ bool shouldBreakOneLineBlocks;
+ bool shouldReparseCurrentChar;
+ bool shouldBreakOneLineStatements;
+ bool shouldBreakLineAfterComments;
+ bool shouldBreakClosingHeaderBrackets;
+ bool shouldBreakElseIfs;
+ bool passedSemicolon;
+ bool passedColon;
+ bool isImmediatelyPostComment;
+ bool isImmediatelyPostLineComment;
+ bool isImmediatelyPostEmptyBlock;
+ bool isImmediatelyPostPreprocessor;
+
+ bool shouldBreakBlocks;
+ bool shouldBreakClosingHeaderBlocks;
+ bool isPrependPostBlockEmptyLineRequested;
+ bool isAppendPostBlockEmptyLineRequested;
+
+ bool prependEmptyLine;
+ bool appendOpeningBracket;
+ bool foundClosingHeader;
+
+ bool isInHeader;
+ bool isImmediatelyPostHeader;
+
+ private: // inline functions
+ // append the CURRENT character (curentChar)to the current formatted line.
+ inline void appendCurrentChar(bool canBreakLine = true) {
+ appendChar(currentChar, canBreakLine);
+ }
+
+ // check if a specific sequence exists in the current placement of the current line
+ inline bool isSequenceReached(const char *sequence) const {
+ return currentLine.compare(charNum, strlen(sequence), sequence) == 0;
+ }
+};
+
+} // end of namespace astyle
+
+#endif // closes ASTYLE_H
+
diff --git a/lib/astyle/compiler_defines.h b/lib/astyle/compiler_defines.h
new file mode 100644
index 00000000..347ac40d
--- /dev/null
+++ b/lib/astyle/compiler_defines.h
@@ -0,0 +1,49 @@
+
+/*
+ * Copyright (c) 1998, 1999 Tal Davidson. All rights reserved.
+ *
+ * compiler_defines.h (1 January 1999)
+ * by Tal Davidson (davidsont@bigfoot.com)
+ * This file is a part of "Artistic Style" - an indentater and reformatter
+ * of C++, C, and Java source files.
+ *
+ * The "Artistic Style" project, including all files needed to compile it,
+ * is free software; you can redistribute it and/or use it and/or modify it
+ * under the terms of EITHER the "Artistic License" OR
+ * 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.
+ *
+ * You should have received a copy of EITHER the "Artistic License" or
+ * the GNU General Public License along with this program.
+ */
+
+
+
+
+
+/*
+ * comment out the line below if your compiler does NOT understand NAMESPACES
+ */
+#define USES_NAMESPACE
+
+
+#if defined(__GNUC__) && __GNUC__ < 3
+// for G++ implementation of string.compare:
+#define COMPARE(place, length, str) compare((str), (place), (length))
+#else
+// for standard implementation of string.compare:
+#define COMPARE(place, length, str) compare((place), (length), (str))
+#endif
+
+
+// Fix by John A. McNamara
+// Get rid of annoying MSVC warnings on debug builds about lengths of
+// identifiers in template instantiations.
+#ifdef _MSC_VER
+#pragma warning( disable:4786 )
+#endif
+
diff --git a/lib/catalog/Mainpage.dox b/lib/catalog/Mainpage.dox
new file mode 100644
index 00000000..f18b8ced
--- /dev/null
+++ b/lib/catalog/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Catalog Library
+
+This is the persistant symbol store library working with BerkeleyDb backend.
+
+<b>Link with</b>: -lkdevcatalog \$(KDEDIR)/kdevbdb/libdb.a
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/catalog -I\$(KDEDIR)/kdevbdb/include
+*/
+
diff --git a/lib/catalog/Makefile.am b/lib/catalog/Makefile.am
new file mode 100644
index 00000000..ff01a6f6
--- /dev/null
+++ b/lib/catalog/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = $(all_includes) $(DB3INCLUDES)
+lib_LTLIBRARIES = libkdevcatalog.la
+libkdevcatalog_la_SOURCES = tag.cpp catalog.cpp
+libkdevcatalog_la_LDFLAGS = -no-undefined $(all_libraries) $(DB3LDFLAGS)
+libkdevcatalog_la_LIBADD = -l$(DB3LIB) $(LIB_KDECORE) $(LIB_QT)
+
+kdevcatalogincludedir = $(includedir)/kdevelop/catalog
+kdevcataloginclude_HEADERS = catalog.h tag.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils
+DOXYGEN_PROJECTNAME = KDevelop Catalog Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../Doxyfile.am
diff --git a/lib/catalog/catalog.cpp b/lib/catalog/catalog.cpp
new file mode 100644
index 00000000..b3438f1e
--- /dev/null
+++ b/lib/catalog/catalog.cpp
@@ -0,0 +1,462 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "catalog.h"
+#include <qdir.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdatastream.h>
+
+#include <krandomsequence.h>
+#include <kdebug.h>
+
+
+#include <cstring>
+#include <cstdlib>
+#include <db.h>
+
+#include <config.h>
+
+struct _Catalog_Private
+{
+ QString dbName;
+
+ DB* dbp;
+ QMap<QCString, DB*> indexList;
+ KRandomSequence rnd;
+ bool enabled;
+
+ _Catalog_Private()
+ : dbp( 0 ), enabled( true )
+ {
+ }
+
+ bool hasIndex( const QCString& name ) const
+ {
+ return indexList.contains( name );
+ }
+
+ DB* index( const QCString& name )
+ {
+ return indexList[ name ];
+ }
+
+ bool addItem( DB* dbp, const QCString& id, const Tag& tag )
+ {
+ Q_ASSERT( dbp != 0 );
+
+ DBT key, data;
+ int ret;
+
+ std::memset( &key, 0, sizeof(key) );
+ std::memset( &data, 0, sizeof(data) );
+
+ QByteArray a1;
+ {
+ QDataStream stream( a1, IO_WriteOnly );
+ stream << id;
+ key.data = a1.data();
+ key.size = a1.size();
+ }
+
+ QByteArray a2;
+ {
+ QDataStream stream( a2, IO_WriteOnly );
+ tag.store( stream );
+ data.data = a2.data();
+ data.size = a2.size();
+ }
+
+ ret = dbp->put( dbp, 0, &key, &data, 0 );
+
+ return ret == 0;
+ }
+
+ bool addItem( DB* dbp, const QVariant& id, const QCString& v )
+ {
+ Q_ASSERT( dbp != 0 );
+
+ DBT key, data;
+ int ret;
+
+ std::memset( &key, 0, sizeof(key) );
+ std::memset( &data, 0, sizeof(data) );
+
+ QByteArray a1;
+ {
+ QDataStream stream( a1, IO_WriteOnly );
+ stream << id;
+ key.data = a1.data();
+ key.size = a1.size();
+ }
+
+ QByteArray a2;
+ {
+ QDataStream stream( a2, IO_WriteOnly );
+ stream << v;
+ data.data = a2.data();
+ data.size = a2.size();
+ }
+
+ ret = dbp->put( dbp, 0, &key, &data, 0 );
+
+ return ret == 0;
+ }
+
+};
+
+
+/*!
+ \fn Catalog::Catalog
+ */
+ Catalog::Catalog()
+ : d( new _Catalog_Private() )
+{
+}
+
+/*!
+ \fn Catalog::~Catalog
+ */
+ Catalog::~Catalog()
+{
+ close();
+ delete( d );
+ d = 0;
+}
+
+/*!
+ \fn Catalog::indexList() const
+ */
+ QValueList<QCString> Catalog::indexList() const
+{
+ QValueList<QCString> l;
+ QMap<QCString, DB*>::Iterator it = d->indexList.begin();
+ while( it != d->indexList.end() ){
+ l << it.key();
+ ++it;
+ }
+
+ return l;
+}
+
+bool Catalog::enabled() const
+{
+ return d->enabled;
+}
+
+void Catalog::setEnabled( bool isEnabled )
+{
+ d->enabled = isEnabled;
+}
+
+/*!
+ \fn Catalog::addIndex( const QString& name )
+ @todo document these functions
+ */
+ void Catalog::addIndex( const QCString& name )
+{
+ Q_ASSERT( d->dbp != 0 );
+
+ QMap<QCString, DB*>::Iterator it = d->indexList.find( name );
+ if( it == d->indexList.end() ){
+ DB* dbp = 0;
+
+ int ret;
+
+ if ((ret = db_create(&dbp, 0, 0)) != 0) {
+ kdDebug() << "db_create: " << db_strerror(ret) << endl;
+ return /*false*/;
+ }
+
+ if ((ret = dbp->set_flags(dbp, DB_DUP | DB_DUPSORT)) != 0) {
+ dbp->err(dbp, ret, "set_flags: DB_DUP | DB_DUPSORT");
+ dbp->close( dbp, 0 );
+ return;
+ }
+
+ QFileInfo fileInfo( d->dbName );
+ QString indexName = fileInfo.dirPath(true) + "/" + fileInfo.baseName(true) + "." + QString(name) + ".idx";
+
+ if( (ret = dbp->set_cachesize( dbp, 0, 2 * 1024 * 1024, 0 )) != 0 ){
+ kdDebug() << "set_cachesize: " << db_strerror(ret) << endl;
+ }
+
+ if ((ret = dbp->open(
+ dbp, NULL, QFile::encodeName( indexName ).data(), 0, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ kdDebug() << "db_open: " << db_strerror(ret) << endl;
+ dbp->close( dbp, 0 );
+ return;
+ }
+
+ d->indexList[ name ] = dbp;
+ }
+}
+
+/*!
+ \fn Catalog::close()
+ */
+
+ void Catalog::close()
+{
+ d->dbName = QString::null;
+
+ QMap<QCString, DB*>::Iterator it = d->indexList.begin();
+ while( it != d->indexList.end() ){
+ if( it.data() ){
+ it.data()->close( it.data(), 0 );
+ }
+ ++it;
+ }
+ d->indexList.clear();
+
+ if( d->dbp != 0 ){
+ d->dbp->close( d->dbp, 0 );
+ d->dbp = 0;
+ }
+}
+
+/*!
+ \fn Catalog::open( const QString& dbName )
+ */
+
+ void Catalog::open( const QString& dbName )
+{
+ Q_ASSERT( d->dbp == 0 );
+
+ d->dbName = dbName;
+
+ int ret;
+
+ if ((ret = db_create(&d->dbp, 0, 0)) != 0) {
+ kdDebug() << "db_create: " << db_strerror(ret) << endl;
+ return /*false*/;
+ }
+
+ if ((ret = d->dbp->set_flags(d->dbp, DB_RECNUM)) != 0) {
+ d->dbp->err(d->dbp, ret, "set_flags: DB_RECNUM");
+ close();
+ return;
+ }
+
+ if( (ret = d->dbp->set_cachesize( d->dbp, 0, 2 * 1024 * 1024, 0 )) != 0 ){
+ kdDebug() << "set_cachesize: " << db_strerror(ret) << endl;
+ }
+
+ if ((ret = d->dbp->open(
+ d->dbp, NULL, d->dbName.local8Bit(), 0, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ kdDebug() << "db_open: " << db_strerror(ret) << endl;
+ close();
+ return;
+ }
+}
+
+/*!
+ \fn Catalog::dbName() const
+ */
+
+ QString Catalog::dbName() const
+{
+ return d->dbName;
+}
+
+/*!
+ \fn Catalog::isValid() const
+ */
+
+ bool Catalog::isValid() const
+{
+ return d->dbp != 0;
+}
+
+/*!
+ \fn Catalog::addItem( Tag& tag )
+ */
+
+ void Catalog::addItem( Tag& tag )
+{
+ if( tag.name().isEmpty() )
+ return;
+
+ QCString id = generateId();
+
+ tag.setId( id );
+ if( d->addItem(d->dbp, id, tag) ){
+ QMap<QCString, DB*>::Iterator it = d->indexList.begin();
+ while( it != d->indexList.end() ){
+ if( tag.hasAttribute(it.key()) )
+ d->addItem( it.data(), tag.attribute(it.key()), id );
+ ++it;
+ }
+ }
+}
+
+/*!
+ \fn Catalog::getItemById( const QString& id )
+ */
+
+ Tag Catalog::getItemById( const QCString& id )
+{
+ Q_ASSERT( d->dbp != 0 );
+
+ DBT key, data;
+ std::memset( &key, 0, sizeof(key) );
+ std::memset( &data, 0, sizeof(data) );
+
+ QByteArray a1;
+ {
+ QDataStream stream( a1, IO_WriteOnly );
+ stream << id;
+ key.data = a1.data();
+ key.size = a1.size();
+ }
+
+ int ret = d->dbp->get( d->dbp, 0, &key, &data, 0 );
+ Q_ASSERT( ret == 0 );
+
+ Tag tag;
+
+ if( ret == 0 ){
+ QByteArray a;
+ a.setRawData( (const char*) data.data, data.size );
+ QDataStream stream( a, IO_ReadOnly );
+ tag.load( stream );
+ a.resetRawData( (const char*) data.data, data.size );
+ }
+
+ return tag;
+}
+
+/*!
+ \fn Catalog::sync()
+*/
+
+ void Catalog::sync()
+{
+ Q_ASSERT( d->dbp != 0 );
+ d->dbp->sync( d->dbp, 0 );
+
+ QMap<QCString, DB*>::Iterator it = d->indexList.begin();
+ while( it != d->indexList.end() ){
+ it.data()->sync( it.data(), 0 );
+ ++it;
+ }
+}
+
+/*!
+ \fn Catalog::query( const QValueList<QueryArgument>& args )
+*/
+
+ QValueList<Tag> Catalog::query( const QValueList<QueryArgument>& args )
+{
+ QValueList<Tag> tags;
+
+ DBT key, data;
+
+ DBC** cursors = new DBC* [ args.size() + 1 ];
+
+ QValueList< QPair<QCString,QVariant> >::ConstIterator it = args.begin();
+ int current = 0;
+ while( it != args.end() ){
+ QCString indexName = (*it).first;
+ QVariant value = (*it).second;
+
+ if( d->hasIndex(indexName) ) {
+ DB* dbp = d->index( indexName );
+ Q_ASSERT( dbp != 0 );
+
+ std::memset( &key, 0, sizeof(key) );
+ std::memset( &data, 0, sizeof(data) );
+
+ QByteArray a1;
+ {
+ QDataStream stream( a1, IO_WriteOnly );
+ stream << value;
+ key.data = a1.data();
+ key.size = a1.size();
+ }
+
+ DBC* cursor = 0;
+ int rtn = dbp->cursor( dbp, 0, &cursor, 0 );
+
+ if ( rtn == 0 ) {
+
+ rtn = cursor->c_get( cursor, &key, &data, DB_SET );
+
+ if ( rtn == 0 ) {
+ cursors[ current++ ] = cursor;
+ }
+ else if ( rtn != DB_NOTFOUND) {
+ kdDebug() << "fetching cursor failed: " << db_strerror(rtn) << endl;
+ cursor->c_close(cursor);
+ }
+ }
+ else {
+ kdDebug() << "creating cursor failed: " << db_strerror(rtn) << endl;
+ }
+ }
+ ++it;
+ }
+
+ cursors[ current ] = 0;
+
+ if( current == args.size() ) {
+
+ DBC* join_curs = 0;
+ int rtn = d->dbp->join( d->dbp, cursors, &join_curs, 0 );
+
+ if ( rtn == 0 ) {
+
+ std::memset( &key, 0, sizeof(key) );
+ std::memset( &data, 0, sizeof(data) );
+
+ while( join_curs->c_get(join_curs, &key, &data, 0) == 0 ) {
+
+ QByteArray a2;
+ a2.setRawData( (const char*) data.data, data.size );
+ QDataStream s( a2, IO_ReadOnly );
+ Tag tag;
+ tag.load( s );
+ a2.resetRawData( (const char*) data.data, data.size );
+ tags << tag;
+ }
+
+ join_curs->c_close( join_curs );
+ }
+ else {
+ kdDebug() << "joining results failed: " << db_strerror(rtn) << endl;
+ }
+ }
+
+ DBC** c = cursors;
+ while( *c != 0 ){
+ (*c)->c_close( *c );
+ ++c;
+ }
+ delete[] cursors;
+
+ return tags;
+}
+
+ QCString Catalog::generateId()
+{
+ static int n = 1;
+ QCString asStr;
+ asStr.sprintf( "%05d", n++ );
+ return asStr;
+}
+
diff --git a/lib/catalog/catalog.h b/lib/catalog/catalog.h
new file mode 100644
index 00000000..8183acaf
--- /dev/null
+++ b/lib/catalog/catalog.h
@@ -0,0 +1,80 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef CATALOG_H
+#define CATALOG_H
+
+#include <qvaluelist.h>
+#include <qpair.h>
+#include <qvariant.h>
+
+
+#include "tag.h"
+/**
+@file catalog.h
+Catalog database - the persistent symbol store database.
+*/
+
+/**
+Catalog objects represent separate symbol databases.
+Catalogs can be created/loaded/unloaded dynamically.
+To find a symbol in the repository each catalog should be queried.
+
+Persistent symbol store is useful to keep information about code that
+never or rarely changes. System libraries are perfect examples of such code.
+*/
+class Catalog
+{
+public:
+ typedef QPair<QCString, QVariant> QueryArgument;
+
+public:
+ Catalog();
+ virtual ~Catalog();
+
+ bool isValid() const;
+ QString dbName() const;
+
+ bool enabled() const;
+ void setEnabled( bool en );
+
+ virtual void open( const QString& dbName );
+ virtual void close();
+ virtual void sync();
+
+ QValueList<QCString> indexList() const;
+ void addIndex( const QCString& name );
+
+ void addItem( Tag& tag );
+
+ Tag getItemById( const QCString& id );
+ QValueList<Tag> query( const QValueList<QueryArgument>& args );
+
+ QCString generateId();
+
+private:
+ class _Catalog_Private* d;
+
+private:
+ Catalog( const Catalog& source );
+ void operator = ( const Catalog& source );
+};
+
+
+#endif
diff --git a/lib/catalog/tag.cpp b/lib/catalog/tag.cpp
new file mode 100644
index 00000000..f4dbda67
--- /dev/null
+++ b/lib/catalog/tag.cpp
@@ -0,0 +1,127 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "tag.h"
+#include <qdatastream.h>
+
+Tag::Tag()
+{
+ data = new TagData();
+ data->kind = 0;
+ data->flags = 0;
+ data->startLine = 0;
+ data->startColumn = 0;
+ data->endLine = 0;
+ data->endColumn = 0;
+}
+
+Tag::Tag( const Tag& source )
+{
+ data = source.data;
+ data->ref();
+}
+
+Tag::~Tag()
+{
+ if( data->deref() ){
+ delete( data );
+ data = 0;
+ }
+}
+
+void Tag::detach()
+{
+ if( data->count != 1 )
+ *this = copy();
+}
+
+Tag Tag::copy()
+{
+ Tag t;
+
+ t.data->id = data->id;
+ t.data->kind = data->kind;
+ t.data->flags = data->flags;
+ t.data->name = data->name;
+ t.data->scope = data->scope;
+ t.data->fileName = data->fileName;
+ t.data->startLine = data->startLine;
+ t.data->startColumn = data->startColumn;
+ t.data->endLine = data->endLine;
+ t.data->endColumn = data->endColumn;
+ t.data->attributes = data->attributes;
+
+ return t;
+}
+
+Tag& Tag::operator = ( const Tag& source )
+{
+ source.data->ref();
+ if ( data->deref() ){
+ delete data;
+ }
+ data = source.data;
+
+ return( *this );
+}
+
+void Tag::load( QDataStream& stream )
+{
+ stream
+ >> data->id
+ >> data->kind
+ >> data->flags
+ >> data->name
+ >> data->scope
+ >> data->fileName
+ >> data->startLine
+ >> data->startColumn
+ >> data->endLine
+ >> data->endColumn
+ >> data->attributes;
+}
+
+void Tag::store( QDataStream& stream ) const
+{
+ stream
+ << data->id
+ << data->kind
+ << data->flags
+ << data->name
+ << data->scope
+ << data->fileName
+ << data->startLine
+ << data->startColumn
+ << data->endLine
+ << data->endColumn
+ << data->attributes;
+}
+
+QDataStream& operator << ( QDataStream& s, const Tag& t)
+{
+ t.store( s );
+ return s;
+}
+
+QDataStream& operator >> ( QDataStream& s, Tag& t )
+{
+ t.load( s );
+ return s;
+}
+
diff --git a/lib/catalog/tag.h b/lib/catalog/tag.h
new file mode 100644
index 00000000..af5879a6
--- /dev/null
+++ b/lib/catalog/tag.h
@@ -0,0 +1,309 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef TAG_H
+#define TAG_H
+
+#include <qmap.h>
+#include <qvariant.h>
+#include <qshared.h>
+
+class QDataStream;
+
+union TagFlags
+{
+ unsigned long flags;
+ struct
+ {
+ unsigned long access:
+ 3;
+ unsigned long isVirtual:
+ 1;
+ }
+ data;
+} ;
+
+class Tag
+{
+public:
+ enum Kind
+ {
+ Kind_Unknown,
+
+ Kind_Typedef = 1000,
+ Kind_Namespace,
+ Kind_UsingDirective,
+ Kind_Base_class,
+ Kind_Enum,
+ Kind_Enumerator,
+ Kind_Class,
+ Kind_Struct,
+ Kind_Union,
+ Kind_VariableDeclaration,
+ Kind_Variable,
+ Kind_FunctionDeclaration,
+ Kind_Function,
+ Kind_NamespaceAlias,
+ Kind_TranslationUnit,
+
+ // ...
+
+ Kind_Custom = 2000
+ };
+
+public:
+ Tag();
+ Tag( const Tag& source );
+ ~Tag();
+
+ operator bool() const {
+ return kind() != Kind_Unknown && kind() != 0;
+ }
+
+ Tag& operator = ( const Tag& source );
+
+ QCString id() const
+ {
+ return data->id;
+ }
+
+ void setId( const QCString& id )
+ {
+ detach();
+ data->id = id;
+ }
+
+ int kind() const
+ {
+ return data->kind;
+ }
+
+ void setKind( int kind )
+ {
+ detach();
+ data->kind = kind;
+ }
+
+ unsigned long flags() const
+ {
+ return data->flags;
+ }
+
+ void setFlags( unsigned long flags )
+ {
+ detach();
+ data->flags = flags;
+ }
+
+ QString fileName() const
+ {
+ return data->fileName;
+ }
+
+ void setFileName( const QString& fileName )
+ {
+ detach();
+ data->fileName = fileName;
+ }
+
+ QString path( const QString& sep = QString::fromLatin1("::") ) const
+ {
+ QString s = scope().join( sep );
+ if( s.isNull() )
+ return name();
+ return s + sep + name();
+ }
+
+ QString name() const
+ {
+ return data->name;
+ }
+
+ QString comment() const {
+ if( hasAttribute( "cmt" ) ) {
+ return attribute( "cmt" ).asString();
+ } else {
+ return "";
+ }
+ }
+
+ void setComment( const QString& comment ) {
+ setAttribute( "cmt", comment );
+ }
+
+ void setName( const QString& name )
+ {
+ detach();
+ data->name = name;
+ }
+
+ QStringList scope() const
+ {
+ return data->scope;
+ }
+
+ void setScope( const QStringList& scope )
+ {
+ detach();
+ data->scope = scope;
+ }
+
+ void getStartPosition( int* line, int* column ) const
+ {
+ if( line ) *line = data->startLine;
+ if( column ) *column = data->startColumn;
+ }
+
+ void setStartPosition( int line, int column )
+ {
+ detach();
+ data->startLine = line;
+ data->startColumn = column;
+ }
+
+ void getEndPosition( int* line, int* column ) const
+ {
+ if( line ) *line = data->endLine;
+ if( column ) *column = data->endColumn;
+ }
+
+ void setEndPosition( int line, int column )
+ {
+ detach();
+ data->endLine = line;
+ data->endColumn = column;
+ }
+
+ QString getSpecializationDeclaration() const {
+ if( hasAttribute( "spc" ) )
+ return data->attributes["spc"].asString();
+ else
+ return QString::null;
+ }
+
+ bool hasSpecializationDeclaration() const {
+ return data->attributes.contains( "spc" );
+ }
+
+ void setSpecializationDeclaration( const QString& str ) {
+ data->attributes["spc"] = str;
+ }
+
+ bool hasAttribute( const QCString& name ) const
+ {
+ if( name == "kind" ||
+ name == "name" ||
+ name == "scope" ||
+ name == "fileName" ||
+ name == "startLine" ||
+ name == "startColumn" ||
+ name == "endLine" ||
+ name == "endColumn" )
+ return true;
+ return data->attributes.contains( name );
+ }
+
+ QVariant attribute( const QCString& name ) const
+ {
+ if( name == "id" )
+ return data->id;
+ else if( name == "kind" )
+ return data->kind;
+ else if( name == "name" )
+ return data->name;
+ else if( name == "scope" )
+ return data->scope;
+ else if( name == "fileName" )
+ return data->fileName;
+ else if( name == "startLine" )
+ return data->startLine;
+ else if( name == "startColumn" )
+ return data->startColumn;
+ else if( name == "endLine" )
+ return data->endLine;
+ else if( name == "endColumn" )
+ return data->endColumn;
+ else if( name == "prefix" )
+ return data->name.left( 2 );
+ return data->attributes[ name ];
+ }
+
+ void setAttribute( const QCString& name, const QVariant& value )
+ {
+ detach();
+ if( name == "id" )
+ data->id = value.toCString();
+ else if( name == "kind" )
+ data->kind = value.toInt();
+ else if( name == "name" )
+ data->name = value.toString();
+ else if( name == "scope" )
+ data->scope = value.toStringList();
+ else if( name == "fileName" )
+ data->fileName = value.toString();
+ else if( name == "startLine" )
+ data->startLine = value.toInt();
+ else if( name == "startColumn" )
+ data->startColumn = value.toInt();
+ else if( name == "endLine" )
+ data->endLine = value.toInt();
+ else if( name == "endColumn" )
+ data->endColumn = value.toInt();
+ else
+ data->attributes[ name ] = value;
+ }
+
+ void addTemplateParam( const QString& param , const QString& def = "" ) {
+ QMap<QCString, QVariant>::iterator it = data->attributes.find( "tpl" );
+ if( it != data->attributes.end() && (*it).type() == QVariant::StringList ) {
+ }else{
+ it = data->attributes.insert( "tpl", QVariant( QStringList() ) );
+ }
+
+ QStringList& l( (*it).asStringList() );
+ l << param;
+ l << def;
+ }
+
+ void load( QDataStream& stream );
+ void store( QDataStream& stream ) const;
+
+private:
+ Tag copy();
+ void detach();
+
+private:
+ struct TagData: public QShared
+ {
+ QCString id;
+ int kind;
+ unsigned long flags;
+ QString name;
+ QStringList scope;
+ QString fileName;
+ int startLine, startColumn;
+ int endLine, endColumn;
+ QMap<QCString, QVariant> attributes;
+ } *data;
+};
+
+QDataStream& operator << ( QDataStream&, const Tag& );
+QDataStream& operator >> ( QDataStream&, Tag& );
+
+#endif
diff --git a/lib/cppparser/Makefile.am b/lib/cppparser/Makefile.am
new file mode 100644
index 00000000..1ee03ce7
--- /dev/null
+++ b/lib/cppparser/Makefile.am
@@ -0,0 +1,11 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+AM_CXXFLAGS = -DKDEVELOP_BGPARSER
+lib_LTLIBRARIES = libkdevcppparser.la
+libkdevcppparser_la_LDFLAGS = $(all_libraries)
+libkdevcppparser_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(top_builddir)/lib/interfaces/libkdevinterfaces.la -lDCOP $(LIB_KDEUI) $(LIB_KPARTS) -lktexteditor $(LIB_KIO) -lkscript
+libkdevcppparser_la_SOURCES = ast.cpp cachemanager.cpp driver.cpp errors.cpp \
+ lexer.cpp lexercache.cpp lookup.cpp parser.cpp tree_parser.cpp
+
+kdevcppparserincludedir = $(includedir)/kdevelop/cppparser
+kdevcppparserinclude_HEADERS = ast.h driver.h lexer.h parser.h tree_parser.h errors.h lookup.h cachemanager.h lexercache.h macro.h
+
diff --git a/lib/cppparser/ast.cpp b/lib/cppparser/ast.cpp
new file mode 100644
index 00000000..b6f452c0
--- /dev/null
+++ b/lib/cppparser/ast.cpp
@@ -0,0 +1,1262 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "ast.h"
+#include <qstringlist.h>
+#include <kdebug.h>
+
+QString nodeTypeToString( int type )
+{
+ switch( type )
+ {
+ case NodeType_Generic:
+ return "Generic";
+ case NodeType_TemplateArgumentList:
+ return "TemplateArgumentList";
+ case NodeType_ClassOrNamespaceName:
+ return "ClassOrNamespaceName";
+ case NodeType_Name:
+ return "Name";
+ case NodeType_Declaration:
+ return "Declaration";
+ case NodeType_TypeSpecifier:
+ return "TypeSpecifier";
+ case NodeType_BaseSpecifier:
+ return "BaseSpecifier";
+ case NodeType_BaseClause:
+ return "BaseClause";
+ case NodeType_ClassSpecifier:
+ return "ClassSpecifier";
+ case NodeType_Enumerator:
+ return "Enumerator";
+ case NodeType_EnumSpecifier:
+ return "EnumSpecifier";
+ case NodeType_ElaboratedTypeSpecifier:
+ return "ElaboratedTypeSpecifier";
+ case NodeType_LinkageBody:
+ return "LinkageBody";
+ case NodeType_LinkageSpecification:
+ return "LinkageSpecification";
+ case NodeType_Namespace:
+ return "Namespace";
+ case NodeType_NamespaceAlias:
+ return "NamespaceAlias";
+ case NodeType_Using:
+ return "Using";
+ case NodeType_UsingDirective:
+ return "UsingDirective";
+ case NodeType_InitDeclaratorList:
+ return "InitDeclaratorList";
+ case NodeType_Typedef:
+ return "Typedef";
+ case NodeType_Declarator:
+ return "Declarator";
+ case NodeType_InitDeclarator:
+ return "InitDeclarator";
+ case NodeType_TemplateDeclaration:
+ return "TemplateDeclaration";
+ case NodeType_SimpleDeclaration:
+ return "SimpleDeclaration";
+ case NodeType_Statement:
+ return "Statement";
+ case NodeType_IfStatement:
+ return "IfStatement";
+ case NodeType_WhileStatement:
+ return "WhileStatement";
+ case NodeType_DoStatement:
+ return "DoStatement";
+ case NodeType_ForStatement:
+ return "ForStatement";
+ case NodeType_ForEachStatement: // qt4 [erbsland]
+ return "ForEachStatement";
+ case NodeType_SwitchStatement:
+ return "SwitchStatement";
+ case NodeType_CatchStatement:
+ return "CatchStatement";
+ case NodeType_CatchStatementList:
+ return "CatchStatementList";
+ case NodeType_TryBlockStatement:
+ return "TryBlockStatement";
+ case NodeType_DeclarationStatement:
+ return "DeclarationStatement";
+ case NodeType_StatementList:
+ return "StatementList";
+ case NodeType_TranslationUnit:
+ return "TranslationUnit";
+ case NodeType_FunctionDefinition:
+ return "FunctionDefinition";
+ case NodeType_ExpressionStatement:
+ return "ExpressionStatement";
+ case NodeType_ParameterDeclaration:
+ return "ParameterDeclaration";
+ case NodeType_ParameterDeclarationList:
+ return "ParameterDeclarationList";
+ case NodeType_ParameterDeclarationClause:
+ return "ParameterDeclarationClause";
+ case NodeType_Group:
+ return "Group";
+ case NodeType_AccessDeclaration:
+ return "AccessDeclaration";
+ case NodeType_TypeParameter:
+ return "TypeParameter";
+ case NodeType_TemplateParameter:
+ return "TemplateParameter";
+ case NodeType_TemplateParameterList:
+ return "TemplateParameterList";
+ case NodeType_Condition:
+ return "Condition";
+ case NodeType_Custom:
+ return "Custom";
+ }
+
+ return QString::null;
+}
+
+
+// ------------------------------------------------------------------------
+AST::AST()
+ : m_nodeType( NodeType_Generic ), m_parent( 0 ),
+ m_startLine( 0 ), m_startColumn( 0 ),
+ m_endLine( 0 ), m_endColumn( 0 )
+{
+#ifndef CPPPARSER_NO_CHILDREN
+ m_children.setAutoDelete( false );
+#endif
+}
+
+AST::~AST()
+{
+#ifndef CPPPARSER_NO_CHILDREN
+ if( m_parent )
+ m_parent->removeChild( this );
+#endif
+}
+
+void AST::setStartPosition( int line, int col )
+{
+ m_startLine = line;
+ m_startColumn = col;
+}
+
+void AST::getStartPosition( int* line, int* col ) const
+{
+ if( line )
+ *line = m_startLine;
+
+ if( col )
+ * col = m_startColumn;
+}
+
+void AST::setEndPosition( int line, int col )
+{
+ m_endLine = line;
+ m_endColumn = col;
+}
+
+void AST::getEndPosition( int* line, int* col ) const
+{
+ if( line )
+ *line = m_endLine;
+
+ if( col )
+ * col = m_endColumn;
+}
+
+void AST::setParent( AST* parent )
+{
+#ifndef CPPPARSER_NO_CHILDREN
+ if( m_parent )
+ m_parent->removeChild( this );
+#endif
+
+ m_parent = parent;
+
+#ifndef CPPPARSER_NO_CHILDREN
+ if( m_parent )
+ m_parent->appendChild( this );
+#endif
+}
+
+#ifndef CPPPARSER_NO_CHILDREN
+void AST::appendChild( AST* child )
+{
+ m_children.append( child );
+}
+
+void AST::removeChild( AST* child )
+{
+ m_children.remove( child );
+}
+#endif
+
+// ------------------------------------------------------------------------
+NameAST::NameAST()
+ : m_global( false )
+{
+ m_classOrNamespaceNameList.setAutoDelete( true );
+}
+
+void NameAST::setGlobal( bool b )
+{
+ m_global = b;
+}
+
+void NameAST::setUnqualifiedName( ClassOrNamespaceNameAST::Node& unqualifiedName )
+{
+ m_unqualifiedName = unqualifiedName;
+ if( m_unqualifiedName.get() ) m_unqualifiedName->setParent( this );
+}
+
+void NameAST::addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNamespaceName )
+{
+ if( !classOrNamespaceName.get() )
+ return;
+
+ classOrNamespaceName->setParent( this );
+ m_classOrNamespaceNameList.append( classOrNamespaceName.release() );
+}
+
+QString NameAST::text() const
+{
+ if( !m_unqualifiedName.get() )
+ return QString::null;
+
+ QString str;
+
+ if( m_global )
+ str += "::";
+
+ QStringList l;
+ QPtrListIterator<ClassOrNamespaceNameAST> it( m_classOrNamespaceNameList );
+ while( it.current() ){
+ str += it.current()->text() + "::";
+ ++it;
+ }
+
+ if( m_unqualifiedName.get() )
+ str += m_unqualifiedName->text();
+
+ return str;
+}
+
+// ------------------------------------------------------------------------
+DeclarationAST::DeclarationAST()
+{
+}
+
+// ------------------------------------------------------------------------
+LinkageBodyAST::LinkageBodyAST()
+{
+ m_declarationList.setAutoDelete( true );
+}
+
+void LinkageBodyAST::addDeclaration( DeclarationAST::Node& ast )
+{
+ if( !ast.get() )
+ return;
+
+ ast->setParent( this );
+ m_declarationList.append( ast.release() );
+}
+
+// ------------------------------------------------------------------------
+LinkageSpecificationAST::LinkageSpecificationAST()
+{
+}
+
+void LinkageSpecificationAST::setExternType( AST::Node& externType )
+{
+ m_externType = externType;
+ if( m_externType.get() ) m_externType->setParent( this );
+}
+
+void LinkageSpecificationAST::setLinkageBody( LinkageBodyAST::Node& linkageBody )
+{
+ m_linkageBody = linkageBody;
+ if( m_linkageBody.get() ) m_linkageBody->setParent( this );
+}
+
+void LinkageSpecificationAST::setDeclaration( DeclarationAST::Node& decl )
+{
+ m_declaration = decl;
+ if( m_declaration.get() ) m_declaration->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+TranslationUnitAST::TranslationUnitAST()
+{
+ ////kdDebug(9007) << "++ TranslationUnitAST::TranslationUnitAST()" << endl;
+ m_declarationList.setAutoDelete( true );
+}
+
+void TranslationUnitAST::addDeclaration( DeclarationAST::Node& ast )
+{
+ if( !ast.get() )
+ return;
+
+ ast->setParent( this );
+ m_declarationList.append( ast.release() );
+}
+
+// ------------------------------------------------------------------------
+NamespaceAST::NamespaceAST()
+{
+}
+
+void NamespaceAST::setNamespaceName( AST::Node& namespaceName )
+{
+ m_namespaceName = namespaceName;
+ if( m_namespaceName.get() ) m_namespaceName->setParent( this );
+}
+
+void NamespaceAST::setLinkageBody( LinkageBodyAST::Node& linkageBody )
+{
+ m_linkageBody = linkageBody;
+ if( m_linkageBody.get() ) m_linkageBody->setParent( this );
+}
+
+
+// ------------------------------------------------------------------------
+NamespaceAliasAST::NamespaceAliasAST()
+{
+}
+
+void NamespaceAliasAST::setNamespaceName( AST::Node& namespaceName )
+{
+ m_namespaceName = namespaceName;
+ if( m_namespaceName.get() ) m_namespaceName->setParent( this );
+}
+
+void NamespaceAliasAST::setAliasName( NameAST::Node& name )
+{
+ m_aliasName = name;
+ if( m_aliasName.get() ) m_aliasName->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+UsingAST::UsingAST()
+{
+}
+
+void UsingAST::setTypeName( AST::Node& typeName )
+{
+ m_typeName = typeName;
+ if( m_typeName.get() ) m_typeName->setParent( this );
+}
+
+void UsingAST::setName( NameAST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+UsingDirectiveAST::UsingDirectiveAST()
+{
+}
+
+void UsingDirectiveAST::setName( NameAST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+TypedefAST::TypedefAST()
+{
+}
+
+void TypeSpecifierAST::setName( NameAST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+void TypedefAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
+{
+ m_typeSpec = typeSpec;
+ if( m_typeSpec.get() ) m_typeSpec->setParent( this );
+}
+
+void TypedefAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList )
+{
+ m_initDeclaratorList = initDeclaratorList;
+ if( m_initDeclaratorList.get() ) m_initDeclaratorList->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+TemplateArgumentListAST::TemplateArgumentListAST()
+{
+ m_argumentList.setAutoDelete( true );
+}
+
+void TemplateArgumentListAST::addArgument( AST::Node& arg )
+{
+ if( !arg.get() )
+ return;
+
+ arg->setParent( this );
+ m_argumentList.append( arg.release() );
+}
+
+QString TemplateArgumentListAST::text() const
+{
+ QStringList l;
+
+ QPtrListIterator<AST> it( m_argumentList );
+ while( it.current() ){
+ l.append( it.current()->text() );
+ ++it;
+ }
+
+ return l.join( ", " );
+}
+
+// ------------------------------------------------------------------------
+TemplateDeclarationAST::TemplateDeclarationAST()
+{
+}
+
+void TemplateDeclarationAST::setExported( AST::Node& exported )
+{
+ m_exported = exported;
+ if( m_exported.get() ) m_exported->setParent( this );
+}
+
+void TemplateDeclarationAST::setTemplateParameterList( TemplateParameterListAST::Node& templateParameterList )
+{
+ m_templateParameterList = templateParameterList;
+ if( m_templateParameterList.get() ) m_templateParameterList->setParent( this );
+}
+
+void TemplateDeclarationAST::setDeclaration( DeclarationAST::Node& declaration )
+{
+ m_declaration = declaration;
+ if( m_declaration.get() ) m_declaration->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+ClassOrNamespaceNameAST::ClassOrNamespaceNameAST()
+{
+}
+
+void ClassOrNamespaceNameAST::setName( AST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+void ClassOrNamespaceNameAST::setTemplateArgumentList( TemplateArgumentListAST::Node& templateArgumentList )
+{
+ m_templateArgumentList = templateArgumentList;
+ if( m_templateArgumentList.get() ) m_templateArgumentList->setParent( this );
+}
+
+QString ClassOrNamespaceNameAST::text() const
+{
+ if( !m_name.get() )
+ return QString::null;
+
+ QString str = m_name->text();
+ if( m_templateArgumentList.get() )
+ str += QString::fromLatin1("< ") + m_templateArgumentList->text() + QString::fromLatin1(" >");
+
+ return str;
+}
+
+// ------------------------------------------------------------------------
+TypeSpecifierAST::TypeSpecifierAST()
+{
+}
+
+void TypeSpecifierAST::setCvQualify( GroupAST::Node& cvQualify )
+{
+ m_cvQualify = cvQualify;
+ if( m_cvQualify.get() ) m_cvQualify->setParent( this );
+}
+
+void TypeSpecifierAST::setCv2Qualify( GroupAST::Node& cv2Qualify )
+{
+ m_cv2Qualify = cv2Qualify;
+ if( m_cv2Qualify.get() ) m_cv2Qualify->setParent( this );
+}
+
+QString TypeSpecifierAST::text() const
+{
+ QString str;
+
+ if( m_cvQualify.get() )
+ str += m_cvQualify->text() + " ";
+
+ if( m_name.get() )
+ str += m_name->text();
+
+ if( m_cv2Qualify.get() )
+ str += QString(" ") + m_cv2Qualify->text();
+
+ return str;
+}
+
+// ------------------------------------------------------------------------
+ClassSpecifierAST::ClassSpecifierAST()
+{
+ m_declarationList.setAutoDelete( true );
+}
+
+void ClassSpecifierAST::setClassKey( AST::Node& classKey )
+{
+ m_classKey = classKey;
+ if( m_classKey.get() ) m_classKey->setParent( this );
+}
+
+void ClassSpecifierAST::addDeclaration( DeclarationAST::Node& declaration )
+{
+ if( !declaration.get() )
+ return;
+
+ declaration->setParent( this );
+ m_declarationList.append( declaration.release() );
+}
+
+void ClassSpecifierAST::setBaseClause( BaseClauseAST::Node& baseClause )
+{
+ m_baseClause = baseClause;
+ if( m_baseClause.get() ) m_baseClause->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+EnumSpecifierAST::EnumSpecifierAST()
+{
+ m_enumeratorList.setAutoDelete( true );
+}
+
+void EnumSpecifierAST::addEnumerator( EnumeratorAST::Node& enumerator )
+{
+ if( !enumerator.get() )
+ return;
+
+ enumerator->setParent( this );
+ m_enumeratorList.append( enumerator.release() );
+}
+
+
+// ------------------------------------------------------------------------
+ElaboratedTypeSpecifierAST::ElaboratedTypeSpecifierAST()
+{
+}
+
+void ElaboratedTypeSpecifierAST::setKind( AST::Node& kind )
+{
+ m_kind = kind;
+ if( m_kind.get() ) m_kind->setParent( this );
+}
+
+QString ElaboratedTypeSpecifierAST::text() const
+{
+ if( m_kind.get() )
+ return m_kind->text() + " " + TypeSpecifierAST::text();
+
+ return TypeSpecifierAST::text();
+}
+
+// ------------------------------------------------------------------------
+StatementAST::StatementAST()
+{
+}
+
+// ------------------------------------------------------------------------
+EnumeratorAST::EnumeratorAST()
+{
+}
+
+void EnumeratorAST::setId( AST::Node& id )
+{
+ m_id = id;
+ if( m_id.get() ) m_id->setParent( this );
+}
+
+void EnumeratorAST::setExpr( AST::Node& expr )
+{
+ m_expr = expr;
+ if( m_expr.get() ) m_expr->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+BaseClauseAST::BaseClauseAST()
+{
+ m_baseSpecifierList.setAutoDelete( true );
+}
+
+void BaseClauseAST::addBaseSpecifier( BaseSpecifierAST::Node& baseSpecifier )
+{
+ if( !baseSpecifier.get() )
+ return;
+
+ baseSpecifier->setParent( this );
+ m_baseSpecifierList.append( baseSpecifier.release() );
+}
+
+// ------------------------------------------------------------------------
+BaseSpecifierAST::BaseSpecifierAST()
+{
+}
+
+void BaseSpecifierAST::setIsVirtual( AST::Node& isVirtual )
+{
+ m_isVirtual = isVirtual;
+ if( m_isVirtual.get() ) m_isVirtual->setParent( this );
+}
+
+void BaseSpecifierAST::setAccess( AST::Node& access )
+{
+ m_access = access;
+ if( m_access.get() ) m_access->setParent( this );
+}
+
+void BaseSpecifierAST::setName( NameAST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+// ------------------------------------------------------------------------
+SimpleDeclarationAST::SimpleDeclarationAST()
+{
+}
+
+void SimpleDeclarationAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier )
+{
+ m_functionSpecifier = functionSpecifier;
+ if( m_functionSpecifier.get() ) m_functionSpecifier->setParent( this );
+}
+
+void SimpleDeclarationAST::setStorageSpecifier( GroupAST::Node& storageSpecifier )
+{
+ m_storageSpecifier = storageSpecifier;
+ if( m_storageSpecifier.get() ) m_storageSpecifier->setParent( this );
+}
+
+void SimpleDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
+{
+ m_typeSpec = typeSpec;
+ if( m_typeSpec.get() ) m_typeSpec->setParent( this );
+}
+
+void SimpleDeclarationAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList )
+{
+ m_initDeclaratorList = initDeclaratorList;
+ if( m_initDeclaratorList.get() ) m_initDeclaratorList->setParent( this );
+}
+
+void SimpleDeclarationAST::setWinDeclSpec( GroupAST::Node& winDeclSpec )
+{
+ m_winDeclSpec = winDeclSpec;
+ if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this );
+}
+
+
+// ------------------------------------------------------------------------
+InitDeclaratorListAST::InitDeclaratorListAST()
+{
+ m_initDeclaratorList.setAutoDelete( true );
+}
+
+void InitDeclaratorListAST::addInitDeclarator( InitDeclaratorAST::Node& decl )
+{
+ if( !decl.get() )
+ return;
+
+ decl->setParent( this );
+ m_initDeclaratorList.append( decl.release() );
+}
+
+// ------------------------------------------------------------------------
+DeclaratorAST::DeclaratorAST()
+{
+ m_ptrOpList.setAutoDelete( true );
+ m_arrayDimensionList.setAutoDelete( true );
+}
+
+void DeclaratorAST::setSubDeclarator( DeclaratorAST::Node& subDeclarator )
+{
+ m_subDeclarator = subDeclarator;
+ if( m_subDeclarator.get() ) m_subDeclarator->setParent( this );
+}
+
+void DeclaratorAST::setDeclaratorId( NameAST::Node& declaratorId )
+{
+ m_declaratorId = declaratorId;
+ if( m_declaratorId.get() ) m_declaratorId->setParent( this );
+}
+
+void DeclaratorAST::setBitfieldInitialization( AST::Node& bitfieldInitialization )
+{
+ m_bitfieldInitialization = bitfieldInitialization;
+ if( m_bitfieldInitialization.get() ) m_bitfieldInitialization->setParent( this );
+}
+
+void DeclaratorAST::addArrayDimension( AST::Node& arrayDimension )
+{
+ if( !arrayDimension.get() )
+ return;
+
+ arrayDimension->setParent( this );
+ m_arrayDimensionList.append( arrayDimension.release() );
+}
+
+void DeclaratorAST::setParameterDeclarationClause( ParameterDeclarationClauseAST::Node& parameterDeclarationClause )
+{
+ m_parameterDeclarationClause = parameterDeclarationClause;
+ if( m_parameterDeclarationClause.get() ) m_parameterDeclarationClause->setParent( this );
+}
+
+void DeclaratorAST::setConstant( AST::Node& constant )
+{
+ m_constant = constant;
+ if( m_constant.get() ) m_constant->setParent( this );
+}
+
+void DeclaratorAST::setExceptionSpecification( GroupAST::Node& exceptionSpecification )
+{
+ m_exceptionSpecification = exceptionSpecification;
+ if( m_exceptionSpecification.get() ) m_exceptionSpecification->setParent( this );
+}
+
+void DeclaratorAST::addPtrOp( AST::Node& ptrOp )
+{
+ if( !ptrOp.get() )
+ return;
+
+ ptrOp->setParent( this );
+ m_ptrOpList.append( ptrOp.release() );
+}
+
+// --------------------------------------------------------------------------
+InitDeclaratorAST::InitDeclaratorAST()
+{
+}
+
+void InitDeclaratorAST::setDeclarator( DeclaratorAST::Node& declarator )
+{
+ m_declarator = declarator;
+ if( m_declarator.get() ) m_declarator->setParent( this );
+}
+
+void InitDeclaratorAST::setInitializer( AST::Node& initializer )
+{
+ m_initializer = initializer;
+ if( m_initializer.get() ) m_initializer->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+FunctionDefinitionAST::FunctionDefinitionAST()
+{
+}
+
+void FunctionDefinitionAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier )
+{
+ m_functionSpecifier = functionSpecifier;
+ if( m_functionSpecifier.get() ) m_functionSpecifier->setParent( this );
+}
+
+void FunctionDefinitionAST::setStorageSpecifier( GroupAST::Node& storageSpecifier )
+{
+ m_storageSpecifier = storageSpecifier;
+ if( m_storageSpecifier.get() ) m_storageSpecifier->setParent( this );
+}
+
+void FunctionDefinitionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
+{
+ m_typeSpec = typeSpec;
+ if( m_typeSpec.get() ) m_typeSpec->setParent( this );
+}
+
+void FunctionDefinitionAST::setInitDeclarator( InitDeclaratorAST::Node& initDeclarator )
+{
+ m_initDeclarator = initDeclarator;
+ if( m_initDeclarator.get() ) m_initDeclarator->setParent( this );
+}
+
+void FunctionDefinitionAST::setFunctionBody( StatementListAST::Node& functionBody )
+{
+ m_functionBody = functionBody;
+ if( m_functionBody.get() ) m_functionBody->setParent( this );
+}
+
+void FunctionDefinitionAST::setWinDeclSpec( GroupAST::Node& winDeclSpec )
+{
+ m_winDeclSpec = winDeclSpec;
+ if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+StatementListAST::StatementListAST()
+{
+ m_statementList.setAutoDelete( true );
+}
+
+void StatementListAST::addStatement( StatementAST::Node& statement )
+{
+ if( !statement.get() )
+ return;
+
+ statement->setParent( this );
+ m_statementList.append( statement.release() );
+}
+
+// --------------------------------------------------------------------------
+IfStatementAST::IfStatementAST()
+{
+}
+
+void IfStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void IfStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+void IfStatementAST::setElseStatement( StatementAST::Node& elseStatement )
+{
+ m_elseStatement = elseStatement;
+ if( m_elseStatement.get() ) m_elseStatement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+WhileStatementAST::WhileStatementAST()
+{
+}
+
+void WhileStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void WhileStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+DoStatementAST::DoStatementAST()
+{
+}
+
+void DoStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void DoStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+ForStatementAST::ForStatementAST()
+{
+}
+
+void ForStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void ForStatementAST::setExpression( AST::Node& expression )
+{
+ m_expression = expression;
+ if( m_expression.get() ) m_expression->setParent( this );
+}
+
+void ForStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+void ForStatementAST::setInitStatement( StatementAST::Node& initStatement )
+{
+ m_initStatement = initStatement;
+ if( m_initStatement.get() ) m_initStatement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+ForEachStatementAST::ForEachStatementAST()
+{
+}
+
+void ForEachStatementAST::setExpression( AST::Node& expression )
+{
+ m_expression = expression;
+ if( m_expression.get() ) m_expression->setParent( this );
+}
+
+void ForEachStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+void ForEachStatementAST::setInitStatement( StatementAST::Node& initStatement )
+{
+ m_initStatement = initStatement;
+ if( m_initStatement.get() ) m_initStatement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+SwitchStatementAST::SwitchStatementAST()
+{
+}
+
+void SwitchStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void SwitchStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+CatchStatementListAST::CatchStatementListAST()
+{
+ m_statementList.setAutoDelete( true );
+}
+
+void CatchStatementListAST::addStatement( CatchStatementAST::Node& statement )
+{
+ if( !statement.get() )
+ return;
+
+ statement->setParent( this );
+ m_statementList.append( statement.release() );
+}
+
+// --------------------------------------------------------------------------
+CatchStatementAST::CatchStatementAST()
+{
+}
+
+void CatchStatementAST::setCondition( ConditionAST::Node& condition )
+{
+ m_condition = condition;
+ if( m_condition.get() ) m_condition->setParent( this );
+}
+
+void CatchStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+TryBlockStatementAST::TryBlockStatementAST()
+{
+}
+
+void TryBlockStatementAST::setStatement( StatementAST::Node& statement )
+{
+ m_statement = statement;
+ if( m_statement.get() ) m_statement->setParent( this );
+}
+
+void TryBlockStatementAST::setCatchStatementList( CatchStatementListAST::Node& statementList )
+{
+ m_catchStatementList = statementList;
+ if( m_catchStatementList.get() ) m_catchStatementList->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+DeclarationStatementAST::DeclarationStatementAST()
+{
+}
+
+void DeclarationStatementAST::setDeclaration( DeclarationAST::Node& declaration )
+{
+ m_declaration = declaration;
+ if( m_declaration.get() ) m_declaration->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+ExpressionStatementAST::ExpressionStatementAST()
+{
+}
+
+void ExpressionStatementAST::setExpression( AST::Node& expression )
+{
+ m_expression = expression;
+ if( m_expression.get() ) m_expression->setParent( this );
+}
+
+
+// --------------------------------------------------------------------------
+ParameterDeclarationAST::ParameterDeclarationAST()
+{
+}
+
+void ParameterDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
+{
+ m_typeSpec = typeSpec;
+ if( m_typeSpec.get() ) m_typeSpec->setParent( this );
+}
+
+void ParameterDeclarationAST::setDeclarator( DeclaratorAST::Node& declarator )
+{
+ m_declarator = declarator;
+ if( m_declarator.get() ) m_declarator->setParent( this );
+}
+
+void ParameterDeclarationAST::setExpression( AST::Node& expression )
+{
+ m_expression = expression;
+ if( m_expression.get() ) m_expression->setParent( this );
+}
+
+QString ParameterDeclarationAST::text() const
+{
+ QString str;
+ if( m_typeSpec.get() )
+ str += m_typeSpec->text() + " ";
+
+ if( m_declarator.get() )
+ str += m_declarator->text();
+
+ if( m_expression.get() )
+ str += QString( " = " ) + m_expression->text();
+
+ return str;
+}
+
+// --------------------------------------------------------------------------
+ParameterDeclarationListAST::ParameterDeclarationListAST()
+{
+ m_parameterList.setAutoDelete( true );
+}
+
+void ParameterDeclarationListAST::addParameter( ParameterDeclarationAST::Node& parameter )
+{
+ if( !parameter.get() )
+ return;
+
+ parameter->setParent( this );
+ m_parameterList.append( parameter.release() );
+}
+
+QString ParameterDeclarationListAST::text() const
+{
+ QStringList l;
+
+ QPtrListIterator<ParameterDeclarationAST> it( m_parameterList );
+ while( it.current() ){
+ l.append( it.current()->text() );
+ ++it;
+ }
+
+ return l.join( ", " );
+}
+
+
+// --------------------------------------------------------------------------
+ParameterDeclarationClauseAST::ParameterDeclarationClauseAST()
+{
+}
+
+void ParameterDeclarationClauseAST::setParameterDeclarationList( ParameterDeclarationListAST::Node& parameterDeclarationList )
+{
+ m_parameterDeclarationList = parameterDeclarationList;
+ if( m_parameterDeclarationList.get() ) m_parameterDeclarationList->setParent( this );
+}
+
+void ParameterDeclarationClauseAST::setEllipsis( AST::Node& ellipsis )
+{
+ m_ellipsis = ellipsis;
+ if( m_ellipsis.get() ) m_ellipsis->setParent( this );
+}
+
+QString ParameterDeclarationClauseAST::text() const
+{
+ QString str;
+
+ if( m_parameterDeclarationList.get() )
+ str += m_parameterDeclarationList->text();
+
+ if( m_ellipsis.get() )
+ str += " ...";
+
+ return str;
+}
+
+
+// --------------------------------------------------------------------------
+GroupAST::GroupAST()
+{
+ m_nodeList.setAutoDelete( true );
+}
+
+void GroupAST::addNode( AST::Node& node )
+{
+ if( !node.get() )
+ return;
+
+ node->setParent( this );
+ m_nodeList.append( node.release() );
+}
+
+QString GroupAST::text() const
+{
+ QStringList l;
+
+ QPtrListIterator<AST> it( m_nodeList );
+ while( it.current() ){
+ l.append( it.current()->text() );
+ ++it;
+ }
+
+ return l.join( " " );
+}
+
+// --------------------------------------------------------------------------
+AccessDeclarationAST::AccessDeclarationAST()
+{
+ m_accessList.setAutoDelete( true );
+}
+
+void AccessDeclarationAST::addAccess( AST::Node& access )
+{
+ if( !access.get() )
+ return;
+
+ access->setParent( this );
+ m_accessList.append( access.release() );
+}
+
+QString AccessDeclarationAST::text() const
+{
+ QStringList l;
+
+ QPtrListIterator<AST> it( m_accessList );
+ while( it.current() ){
+ l.append( it.current()->text() );
+ ++it;
+ }
+
+ return l.join( " " );
+}
+
+// --------------------------------------------------------------------------
+TypeParameterAST::TypeParameterAST()
+{
+}
+
+void TypeParameterAST::setKind( AST::Node& kind )
+{
+ m_kind = kind;
+ if( m_kind.get() ) m_kind->setParent( this );
+}
+
+void TypeParameterAST::setTemplateParameterList( TemplateParameterListAST::Node& templateParameterList )
+{
+ m_templateParameterList = templateParameterList;
+ if( m_templateParameterList.get() ) m_templateParameterList->setParent( this );
+}
+
+void TypeParameterAST::setName( NameAST::Node& name )
+{
+ m_name = name;
+ if( m_name.get() ) m_name->setParent( this );
+}
+
+void TypeParameterAST::setTypeId( AST::Node& typeId )
+{
+ m_typeId = typeId;
+ if( m_typeId.get() ) m_typeId->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+TemplateParameterAST::TemplateParameterAST()
+{
+}
+
+void TemplateParameterAST::setTypeParameter( TypeParameterAST::Node& typeParameter )
+{
+ m_typeParameter = typeParameter;
+ if( m_typeParameter.get() ) m_typeParameter->setParent( this );
+}
+
+void TemplateParameterAST::setTypeValueParameter( ParameterDeclarationAST::Node& typeValueParameter )
+{
+ m_typeValueParameter = typeValueParameter;
+ if( m_typeValueParameter.get() ) m_typeValueParameter->setParent( this );
+}
+
+// --------------------------------------------------------------------------
+TemplateParameterListAST::TemplateParameterListAST()
+{
+ m_templateParameterList.setAutoDelete( true );
+}
+
+void TemplateParameterListAST::addTemplateParameter( TemplateParameterAST::Node& templateParameter )
+{
+ if( !templateParameter.get() )
+ return;
+
+ templateParameter->setParent( this );
+ m_templateParameterList.append( templateParameter.release() );
+}
+
+// --------------------------------------------------------------------------
+ConditionAST::ConditionAST()
+{
+}
+
+void ConditionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
+{
+ m_typeSpec = typeSpec;
+ if( m_typeSpec.get() ) m_typeSpec->setParent( this );
+}
+
+void ConditionAST::setDeclarator( DeclaratorAST::Node& declarator )
+{
+ m_declarator = declarator;
+ if( m_declarator.get() ) m_declarator->setParent( this );
+}
+
+void ConditionAST::setExpression( AST::Node& expression )
+{
+ m_expression = expression;
+ if( m_expression.get() ) m_expression->setParent( this );
+}
+
+void ClassSpecifierAST::setWinDeclSpec( GroupAST::Node & winDeclSpec )
+{
+ m_winDeclSpec = winDeclSpec;
+ if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this );
+}
diff --git a/lib/cppparser/ast.h b/lib/cppparser/ast.h
new file mode 100644
index 00000000..4e877e0e
--- /dev/null
+++ b/lib/cppparser/ast.h
@@ -0,0 +1,1578 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __ast_h
+#define __ast_h
+
+#include <memory>
+#include <qstring.h>
+#include <qptrlist.h>
+#include <qstringlist.h>
+#include <ksharedptr.h>
+
+#if defined( Q_OS_WIN32 ) || defined( Q_CC_SUN )
+
+#ifndef _THROW0
+# define _THROW0()
+#endif
+
+template <class _Tp> class AUTO_PTR {
+private:
+ _Tp* _M_ptr;
+
+public:
+ typedef _Tp element_type;
+
+ explicit AUTO_PTR(_Tp* __p = 0) _THROW0() : _M_ptr(__p) {}
+
+ template <class _Tp1> AUTO_PTR(AUTO_PTR<_Tp1>& __a) _THROW0()
+ : _M_ptr(__a.release()) {}
+
+ AUTO_PTR(AUTO_PTR& __a) _THROW0() : _M_ptr(__a.release()) {}
+
+
+
+ template <class _Tp1>
+ AUTO_PTR& operator=(AUTO_PTR<_Tp1>& __a) _THROW0() {
+ if (__a.get() != this->get()) {
+ delete _M_ptr;
+ _M_ptr = __a.release();
+ }
+ return *this;
+ }
+
+ AUTO_PTR& operator=(AUTO_PTR& __a) _THROW0() {
+ if (&__a != this) {
+ delete _M_ptr;
+ _M_ptr = __a.release();
+ }
+ return *this;
+ }
+
+ ~AUTO_PTR() _THROW0() { delete _M_ptr; }
+
+ _Tp& operator*() const _THROW0() {
+ return *_M_ptr;
+ }
+ _Tp* operator->() const _THROW0() {
+ return _M_ptr;
+ }
+ _Tp* get() const _THROW0() {
+ return _M_ptr;
+ }
+ _Tp* release() _THROW0() {
+ _Tp* __tmp = _M_ptr;
+ _M_ptr = 0;
+ return __tmp;
+ }
+ void reset(_Tp* __p = 0) _THROW0() {
+ delete _M_ptr;
+ _M_ptr = __p;
+ }
+
+ // According to the C++ standard, these conversions are required. Most
+ // present-day compilers, however, do not enforce that requirement---and,
+ // in fact, most present-day compilers do not support the language
+ // features that these conversions rely on.
+
+
+private:
+ template<class _Tp1> struct AUTO_PTR_ref {
+ _Tp1* _M_ptr;
+ AUTO_PTR_ref(_Tp1* __p) : _M_ptr(__p) {}
+ };
+
+public:
+ AUTO_PTR(AUTO_PTR_ref<_Tp> __ref) _THROW0()
+ : _M_ptr(__ref._M_ptr) {}
+ template <class _Tp1> operator AUTO_PTR_ref<_Tp1>() _THROW0()
+ { return AUTO_PTR_ref<_Tp>(this->release()); }
+ template <class _Tp1> operator AUTO_PTR<_Tp1>() _THROW0()
+ { return AUTO_PTR<_Tp1>(this->release()) }
+
+};
+
+#else
+#define AUTO_PTR std::auto_ptr
+#endif
+
+template <class T> typename T::Node CreateNode()
+{
+ typename T::Node node( new T );
+ node->setNodeType( T::Type );
+ return node;
+}
+
+template <class T> typename T::Node NullNode()
+{
+ typename T::Node node;
+ return node;
+}
+
+enum NodeType
+{
+ NodeType_Generic = 0,
+
+ NodeType_TemplateArgumentList = 1000,
+ NodeType_ClassOrNamespaceName,
+ NodeType_Name,
+ NodeType_Declaration,
+ NodeType_TypeSpecifier,
+ NodeType_BaseSpecifier,
+ NodeType_BaseClause,
+ NodeType_ClassSpecifier,
+ NodeType_Enumerator,
+ NodeType_EnumSpecifier,
+ NodeType_ElaboratedTypeSpecifier,
+ NodeType_LinkageBody,
+ NodeType_LinkageSpecification,
+ NodeType_Namespace,
+ NodeType_NamespaceAlias,
+ NodeType_Using,
+ NodeType_UsingDirective,
+ NodeType_InitDeclaratorList,
+ NodeType_Typedef,
+ NodeType_Declarator,
+ NodeType_InitDeclarator,
+ NodeType_TemplateDeclaration,
+ NodeType_SimpleDeclaration,
+ NodeType_Statement,
+ NodeType_StatementList,
+ NodeType_IfStatement,
+ NodeType_WhileStatement,
+ NodeType_DoStatement,
+ NodeType_ForStatement,
+ NodeType_ForEachStatement, // qt4 [erbsland]
+ NodeType_SwitchStatement,
+ NodeType_CatchStatement,
+ NodeType_CatchStatementList,
+ NodeType_TryBlockStatement,
+ NodeType_DeclarationStatement,
+ NodeType_TranslationUnit,
+ NodeType_FunctionDefinition,
+ NodeType_ExpressionStatement,
+ NodeType_ParameterDeclaration,
+ NodeType_ParameterDeclarationList,
+ NodeType_ParameterDeclarationClause,
+ NodeType_Group,
+ NodeType_AccessDeclaration,
+ NodeType_TypeParameter,
+ NodeType_TemplateParameter,
+ NodeType_TemplateParameterList,
+ NodeType_Condition,
+
+ NodeType_Custom = 2000
+};
+
+QString nodeTypeToString( int type );
+
+
+#if defined(CPPPARSER_QUICK_ALLOCATOR)
+
+#include <quick_allocator.h>
+
+#define DECLARE_ALLOC(tp) \
+ void * operator new(std::size_t) \
+ { \
+ return quick_allocator< tp >::alloc(); \
+ } \
+ \
+ void operator delete(void * p) \
+ { \
+ quick_allocator< tp >::dealloc(p); \
+ }
+#else
+
+#define DECLARE_ALLOC(tp)
+
+#endif
+
+struct Slice
+{
+ QString source;
+ int position;
+ int length;
+
+ inline Slice()
+ : position(0), length(0) {}
+};
+
+
+class CommentAST {
+ QString m_comment;
+ public:
+ void setComment( const QString& comment ) {
+ m_comment = comment;
+ }
+
+ void addComment( const QString& comment ) {
+ if( !m_comment.isEmpty() ) {
+ m_comment += "\n(" + comment + ")";
+ } else {
+ m_comment = comment;
+ }
+ }
+
+ QString comment() const {
+ return m_comment;
+ }
+
+ bool haveComment() const {
+ return !m_comment.isEmpty();
+ }
+};
+
+class AST : public CommentAST
+{
+public:
+ typedef AUTO_PTR<AST> Node;
+ enum { Type=NodeType_Generic };
+
+ DECLARE_ALLOC( AST )
+
+public:
+ AST();
+ virtual ~AST();
+
+ int nodeType() const { return m_nodeType; }
+ void setNodeType( int nodeType ) { m_nodeType = nodeType; }
+
+ AST* parent() { return m_parent; }
+ void setParent( AST* parent );
+
+ void setStartPosition( int line, int col );
+ void getStartPosition( int* line, int* col ) const;
+
+ void setEndPosition( int line, int col );
+ void getEndPosition( int* line, int* col ) const;
+
+#ifndef CPPPARSER_NO_CHILDREN
+ QPtrList<AST> children() { return m_children; }
+ void appendChild( AST* child );
+ void removeChild( AST* child );
+#endif
+
+ virtual inline QString text() const
+ { return m_slice.source.mid(m_slice.position, m_slice.length); }
+
+ inline void setSlice( const Slice& slice )
+ { m_slice = slice; }
+
+ inline void setSlice( const QString &text, int position, int length )
+ {
+ CommentAST a;
+ m_slice.source = text;
+ m_slice.position = position;
+ m_slice.length = length;
+ }
+
+ inline void setText(const QString &text)
+ { setSlice(text, 0, text.length()); }
+
+private:
+ int m_nodeType;
+ AST* m_parent;
+ int m_startLine, m_startColumn;
+ int m_endLine, m_endColumn;
+ Slice m_slice;
+#ifndef CPPPARSER_NO_CHILDREN
+ QPtrList<AST> m_children;
+#endif
+
+private:
+ AST( const AST& source );
+ void operator = ( const AST& source );
+};
+
+class GroupAST: public AST
+{
+public:
+ typedef AUTO_PTR<GroupAST> Node;
+ enum { Type = NodeType_Group };
+
+ DECLARE_ALLOC( GroupAST )
+
+public:
+ GroupAST();
+
+ QPtrList<AST> nodeList() { return m_nodeList; }
+ void addNode( AST::Node& node );
+
+ virtual QString text() const;
+
+private:
+ QPtrList<AST> m_nodeList;
+
+private:
+ GroupAST( const GroupAST& source );
+ void operator = ( const GroupAST& source );
+};
+
+
+class TemplateArgumentListAST: public AST
+{
+public:
+ typedef AUTO_PTR<TemplateArgumentListAST> Node;
+ enum { Type = NodeType_TemplateArgumentList };
+
+ DECLARE_ALLOC( TemplateArgumentListAST )
+
+public:
+ TemplateArgumentListAST();
+
+ void addArgument( AST::Node& arg );
+ QPtrList<AST> argumentList() { return m_argumentList; }
+
+ virtual QString text() const;
+
+private:
+ QPtrList<AST> m_argumentList;
+
+private:
+ TemplateArgumentListAST( const TemplateArgumentListAST& source );
+ void operator = ( const TemplateArgumentListAST& source );
+};
+
+class ClassOrNamespaceNameAST: public AST
+{
+public:
+ typedef AUTO_PTR<ClassOrNamespaceNameAST> Node;
+ enum { Type = NodeType_ClassOrNamespaceName };
+
+ DECLARE_ALLOC( ClassOrNamespaceNameAST )
+
+public:
+ ClassOrNamespaceNameAST();
+
+ AST* name() { return m_name.get(); }
+ void setName( AST::Node& name );
+
+ TemplateArgumentListAST* templateArgumentList() { return m_templateArgumentList.get(); }
+ void setTemplateArgumentList( TemplateArgumentListAST::Node& templateArgumentList );
+
+ virtual QString text() const;
+
+private:
+ AST::Node m_name;
+ TemplateArgumentListAST::Node m_templateArgumentList;
+
+private:
+ ClassOrNamespaceNameAST( const ClassOrNamespaceNameAST& source );
+ void operator = ( const ClassOrNamespaceNameAST& source );
+};
+
+class NameAST: public AST
+{
+public:
+ typedef AUTO_PTR<NameAST> Node;
+ enum { Type = NodeType_Name };
+
+ DECLARE_ALLOC( NameAST )
+
+public:
+ NameAST();
+
+ bool isGlobal() const { return m_global; }
+ void setGlobal( bool b );
+
+ void addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNamespaceName );
+ QPtrList<ClassOrNamespaceNameAST> classOrNamespaceNameList() { return m_classOrNamespaceNameList; }
+
+ ClassOrNamespaceNameAST* unqualifiedName() { return m_unqualifiedName.get(); }
+ void setUnqualifiedName( ClassOrNamespaceNameAST::Node& unqualifiedName );
+
+ virtual QString text() const;
+
+private:
+ bool m_global;
+ ClassOrNamespaceNameAST::Node m_unqualifiedName;
+ QPtrList<ClassOrNamespaceNameAST> m_classOrNamespaceNameList;
+
+private:
+ NameAST( const NameAST& source );
+ void operator = ( const NameAST& source );
+};
+
+class TypeParameterAST: public AST
+{
+public:
+ typedef AUTO_PTR<TypeParameterAST> Node;
+ enum { Type = NodeType_TypeParameter };
+
+ DECLARE_ALLOC( TypeParameterAST )
+
+public:
+ TypeParameterAST();
+
+ AST* kind() { return m_kind.get(); }
+ void setKind( AST::Node& kind );
+
+ class TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); }
+ void setTemplateParameterList( AUTO_PTR<class TemplateParameterListAST>& templateParameterList );
+
+ NameAST* name() { return m_name.get(); }
+ void setName( NameAST::Node& name );
+
+ AST* typeId() { return m_typeId.get(); }
+ void setTypeId( AST::Node& typeId );
+
+private:
+ AST::Node m_kind;
+ AUTO_PTR<class TemplateParameterListAST> m_templateParameterList;
+ NameAST::Node m_name;
+ AST::Node m_typeId;
+
+private:
+ TypeParameterAST( const TypeParameterAST& source );
+ void operator = ( const TypeParameterAST& source );
+};
+
+class DeclarationAST: public AST
+{
+public:
+ typedef AUTO_PTR<DeclarationAST> Node;
+ enum { Type = NodeType_Declaration };
+
+ DECLARE_ALLOC( DeclarationAST )
+
+public:
+ DeclarationAST();
+
+private:
+ DeclarationAST( const DeclarationAST& source );
+ void operator = ( const DeclarationAST& source );
+};
+
+class AccessDeclarationAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<AccessDeclarationAST> Node;
+ enum { Type = NodeType_AccessDeclaration };
+
+ DECLARE_ALLOC( AccessDeclarationAST )
+
+public:
+ AccessDeclarationAST();
+
+ QPtrList<AST> accessList() { return m_accessList; }
+ void addAccess( AST::Node& access );
+
+ virtual QString text() const;
+
+private:
+ QPtrList<AST> m_accessList;
+
+private:
+ AccessDeclarationAST( const AccessDeclarationAST& source );
+ void operator = ( const AccessDeclarationAST& source );
+};
+
+class TypeSpecifierAST: public AST
+{
+public:
+ typedef AUTO_PTR<TypeSpecifierAST> Node;
+ enum { Type = NodeType_TypeSpecifier };
+
+ DECLARE_ALLOC( TypeSpecifierAST )
+
+public:
+ TypeSpecifierAST();
+
+ virtual NameAST* name() { return m_name.get(); }
+ virtual void setName( NameAST::Node& name );
+
+ GroupAST* cvQualify() { return m_cvQualify.get(); }
+ void setCvQualify( GroupAST::Node& cvQualify );
+
+ GroupAST* cv2Qualify() { return m_cv2Qualify.get(); }
+ void setCv2Qualify( GroupAST::Node& cv2Qualify );
+
+ virtual QString text() const;
+
+private:
+ NameAST::Node m_name;
+ GroupAST::Node m_cvQualify;
+ GroupAST::Node m_cv2Qualify;
+
+private:
+ TypeSpecifierAST( const TypeSpecifierAST& source );
+ void operator = ( const TypeSpecifierAST& source );
+};
+
+class BaseSpecifierAST: public AST
+{
+public:
+ typedef AUTO_PTR<BaseSpecifierAST> Node;
+ enum { Type = NodeType_BaseSpecifier };
+
+ DECLARE_ALLOC( BaseSpecifierAST )
+
+public:
+ BaseSpecifierAST();
+
+ AST* isVirtual() { return m_isVirtual.get(); }
+ void setIsVirtual( AST::Node& isVirtual );
+
+ AST* access() { return m_access.get(); }
+ void setAccess( AST::Node& access );
+
+ NameAST* name() { return m_name.get(); }
+ void setName( NameAST::Node& name );
+
+private:
+ AST::Node m_isVirtual;
+ AST::Node m_access;
+ NameAST::Node m_name;
+
+private:
+ BaseSpecifierAST( const BaseSpecifierAST& source );
+ void operator = ( const BaseSpecifierAST& source );
+};
+
+class BaseClauseAST: public AST
+{
+public:
+ typedef AUTO_PTR<BaseClauseAST> Node;
+ enum { Type = NodeType_BaseClause };
+
+ DECLARE_ALLOC( BaseClauseAST )
+
+public:
+ BaseClauseAST();
+
+ void addBaseSpecifier( BaseSpecifierAST::Node& baseSpecifier );
+ QPtrList<BaseSpecifierAST> baseSpecifierList() { return m_baseSpecifierList; }
+
+private:
+ QPtrList<BaseSpecifierAST> m_baseSpecifierList;
+
+private:
+ BaseClauseAST( const BaseClauseAST& source );
+ void operator = ( const BaseClauseAST& source );
+};
+
+class ClassSpecifierAST: public TypeSpecifierAST
+{
+public:
+ typedef AUTO_PTR<ClassSpecifierAST> Node;
+ enum { Type = NodeType_ClassSpecifier };
+
+ DECLARE_ALLOC( ClassSpecifierAST )
+
+public:
+ ClassSpecifierAST();
+
+ GroupAST* winDeclSpec() { return m_winDeclSpec.get(); }
+ void setWinDeclSpec( GroupAST::Node& winDeclSpec );
+
+ AST* classKey() { return m_classKey.get(); }
+ void setClassKey( AST::Node& classKey );
+
+ BaseClauseAST* baseClause() { return m_baseClause.get(); }
+ void setBaseClause( BaseClauseAST::Node& baseClause );
+
+ QPtrList<DeclarationAST> declarationList() { return m_declarationList; }
+ void addDeclaration( DeclarationAST::Node& declaration );
+
+private:
+ GroupAST::Node m_winDeclSpec;
+ AST::Node m_classKey;
+ BaseClauseAST::Node m_baseClause;
+ QPtrList<DeclarationAST> m_declarationList;
+private:
+ ClassSpecifierAST( const ClassSpecifierAST& source );
+ void operator = ( const ClassSpecifierAST& source );
+};
+
+class EnumeratorAST: public AST
+{
+public:
+ typedef AUTO_PTR<EnumeratorAST> Node;
+ enum { Type = NodeType_Enumerator };
+
+ DECLARE_ALLOC( EnumeratorAST )
+
+public:
+ EnumeratorAST();
+
+ AST* id() { return m_id.get(); }
+ void setId( AST::Node& id );
+
+ AST* expr() { return m_expr.get(); }
+ void setExpr( AST::Node& expr );
+
+private:
+ AST::Node m_id;
+ AST::Node m_expr;
+
+private:
+ EnumeratorAST( const EnumeratorAST& source );
+ void operator = ( const EnumeratorAST& source );
+};
+
+class EnumSpecifierAST: public TypeSpecifierAST
+{
+public:
+ typedef AUTO_PTR<EnumSpecifierAST> Node;
+ enum { Type = NodeType_EnumSpecifier };
+
+ DECLARE_ALLOC( EnumSpecifierAST )
+
+public:
+ EnumSpecifierAST();
+
+ void addEnumerator( EnumeratorAST::Node& enumerator );
+ QPtrList<EnumeratorAST> enumeratorList() { return m_enumeratorList; }
+
+private:
+ QPtrList<EnumeratorAST> m_enumeratorList;
+
+private:
+ EnumSpecifierAST( const EnumSpecifierAST& source );
+ void operator = ( const EnumSpecifierAST& source );
+};
+
+class ElaboratedTypeSpecifierAST: public TypeSpecifierAST
+{
+public:
+ typedef AUTO_PTR<ElaboratedTypeSpecifierAST> Node;
+ enum { Type = NodeType_ElaboratedTypeSpecifier };
+
+ DECLARE_ALLOC( ElaboratedTypeSpecifierAST )
+
+public:
+ ElaboratedTypeSpecifierAST();
+
+ AST* kind() { return m_kind.get(); }
+ void setKind( AST::Node& kind );
+
+ virtual QString text() const;
+
+private:
+ AST::Node m_kind;
+
+private:
+ ElaboratedTypeSpecifierAST( const ElaboratedTypeSpecifierAST& source );
+ void operator = ( const ElaboratedTypeSpecifierAST& source );
+};
+
+
+class LinkageBodyAST: public AST
+{
+public:
+ typedef AUTO_PTR<LinkageBodyAST> Node;
+ enum { Type = NodeType_LinkageBody };
+
+ DECLARE_ALLOC( LinkageBodyAST )
+
+public:
+ LinkageBodyAST();
+
+ void addDeclaration( DeclarationAST::Node& ast );
+ QPtrList<DeclarationAST> declarationList() { return m_declarationList; }
+
+private:
+ QPtrList<DeclarationAST> m_declarationList;
+
+private:
+ LinkageBodyAST( const LinkageBodyAST& source );
+ void operator = ( const LinkageBodyAST& source );
+};
+
+class LinkageSpecificationAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<LinkageSpecificationAST> Node;
+ enum { Type = NodeType_LinkageSpecification };
+
+ DECLARE_ALLOC( LinkageSpecificationAST )
+
+public:
+ LinkageSpecificationAST();
+
+ AST* externType() { return m_externType.get(); }
+ void setExternType( AST::Node& externType );
+
+ LinkageBodyAST* linkageBody() { return m_linkageBody.get(); }
+ void setLinkageBody( LinkageBodyAST::Node& linkageBody );
+
+ DeclarationAST* declaration() { return m_declaration.get(); }
+ void setDeclaration( DeclarationAST::Node& decl );
+
+private:
+ AST::Node m_externType;
+ LinkageBodyAST::Node m_linkageBody;
+ DeclarationAST::Node m_declaration;
+
+private:
+ LinkageSpecificationAST( const LinkageSpecificationAST& source );
+ void operator = ( const LinkageSpecificationAST& source );
+};
+
+class NamespaceAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<NamespaceAST> Node;
+ enum { Type = NodeType_Namespace };
+
+ DECLARE_ALLOC( NamespaceAST )
+
+public:
+ NamespaceAST();
+
+ AST* namespaceName() { return m_namespaceName.get(); }
+ void setNamespaceName( AST::Node& namespaceName );
+
+ LinkageBodyAST* linkageBody() { return m_linkageBody.get(); }
+ void setLinkageBody( LinkageBodyAST::Node& linkageBody );
+
+private:
+ AST::Node m_namespaceName;
+ LinkageBodyAST::Node m_linkageBody;
+
+private:
+ NamespaceAST( const NamespaceAST& source );
+ void operator = ( const NamespaceAST& source );
+};
+
+class NamespaceAliasAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<NamespaceAliasAST> Node;
+ enum { Type = NodeType_NamespaceAlias };
+
+ DECLARE_ALLOC( NamespaceAliasAST )
+
+public:
+ NamespaceAliasAST();
+
+ AST* namespaceName() { return m_namespaceName.get(); }
+ void setNamespaceName( AST::Node& name );
+
+ NameAST* aliasName() { return m_aliasName.get(); }
+ void setAliasName( NameAST::Node& name );
+
+private:
+ AST::Node m_namespaceName;
+ NameAST::Node m_aliasName;
+
+private:
+ NamespaceAliasAST( const NamespaceAliasAST& source );
+ void operator = ( const NamespaceAliasAST& source );
+};
+
+class UsingAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<UsingAST> Node;
+ enum { Type = NodeType_Using };
+
+ DECLARE_ALLOC( UsingAST )
+
+public:
+ UsingAST();
+
+ AST* typeName() { return m_typeName.get(); }
+ void setTypeName( AST::Node& typeName );
+
+ NameAST* name() { return m_name.get(); }
+ void setName( NameAST::Node& name );
+
+private:
+ AST::Node m_typeName;
+ NameAST::Node m_name;
+
+private:
+ UsingAST( const UsingAST& source );
+ void operator = ( const UsingAST& source );
+};
+
+class UsingDirectiveAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<UsingDirectiveAST> Node;
+ enum { Type = NodeType_UsingDirective };
+
+ DECLARE_ALLOC( UsingDirectiveAST )
+
+public:
+ UsingDirectiveAST();
+
+ NameAST* name() { return m_name.get(); }
+ void setName( NameAST::Node& name );
+
+private:
+ NameAST::Node m_name;
+
+private:
+ UsingDirectiveAST( const UsingDirectiveAST& source );
+ void operator = ( const UsingDirectiveAST& source );
+};
+
+class DeclaratorAST: public AST
+{
+public:
+ typedef AUTO_PTR<DeclaratorAST> Node;
+ enum { Type = NodeType_Declarator };
+
+ DECLARE_ALLOC( DeclaratorAST )
+
+public:
+ DeclaratorAST();
+
+ QPtrList<AST> ptrOpList() { return m_ptrOpList; }
+ void addPtrOp( AST::Node& ptrOp );
+
+ DeclaratorAST* subDeclarator() { return m_subDeclarator.get(); }
+ void setSubDeclarator( AUTO_PTR<DeclaratorAST>& subDeclarator );
+
+ NameAST* declaratorId() { return m_declaratorId.get(); }
+ void setDeclaratorId( NameAST::Node& declaratorId );
+
+ AST* bitfieldInitialization() { return m_bitfieldInitialization.get(); }
+ void setBitfieldInitialization( AST::Node& bitfieldInitialization );
+
+ QPtrList<AST> arrayDimensionList() { return m_arrayDimensionList; }
+ void addArrayDimension( AST::Node& arrayDimension );
+
+ class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); }
+ void setParameterDeclarationClause( AUTO_PTR<class ParameterDeclarationClauseAST>& parameterDeclarationClause );
+
+ // ### replace 'constant' with cvQualify
+ AST* constant() { return m_constant.get(); }
+ void setConstant( AST::Node& constant );
+
+ GroupAST* exceptionSpecification() { return m_exceptionSpecification.get(); }
+ void setExceptionSpecification( GroupAST::Node& exceptionSpecification );
+
+private:
+ QPtrList<AST> m_ptrOpList;
+ AUTO_PTR<DeclaratorAST> m_subDeclarator;
+ NameAST::Node m_declaratorId;
+ AST::Node m_bitfieldInitialization;
+ QPtrList<AST> m_arrayDimensionList;
+ AUTO_PTR<class ParameterDeclarationClauseAST> m_parameterDeclarationClause;
+ AST::Node m_constant;
+ GroupAST::Node m_exceptionSpecification;
+
+private:
+ DeclaratorAST( const DeclaratorAST& source );
+ void operator = ( const DeclaratorAST& source );
+};
+
+class ParameterDeclarationAST: public AST
+{
+public:
+ typedef AUTO_PTR<ParameterDeclarationAST> Node;
+ enum { Type = NodeType_ParameterDeclaration };
+
+ DECLARE_ALLOC( ParameterDeclarationAST )
+
+public:
+ ParameterDeclarationAST();
+
+ TypeSpecifierAST* typeSpec() { return m_typeSpec.get(); }
+ void setTypeSpec( TypeSpecifierAST::Node& typeSpec );
+
+ DeclaratorAST* declarator() { return m_declarator.get(); }
+ void setDeclarator( DeclaratorAST::Node& declarator );
+
+ AST* expression() { return m_expression.get(); }
+ void setExpression( AST::Node& expression );
+
+ virtual QString text() const;
+
+private:
+ TypeSpecifierAST::Node m_typeSpec;
+ DeclaratorAST::Node m_declarator;
+ AST::Node m_expression;
+
+private:
+ ParameterDeclarationAST( const ParameterDeclarationAST& source );
+ void operator = ( const ParameterDeclarationAST& source );
+};
+
+class ParameterDeclarationListAST: public AST
+{
+public:
+ typedef AUTO_PTR<ParameterDeclarationListAST> Node;
+ enum { Type = NodeType_ParameterDeclarationList };
+
+ DECLARE_ALLOC( ParameterDeclarationListAST )
+
+public:
+ ParameterDeclarationListAST();
+
+ QPtrList<ParameterDeclarationAST> parameterList() { return m_parameterList; }
+ void addParameter( ParameterDeclarationAST::Node& parameter );
+
+ virtual QString text() const;
+
+private:
+ QPtrList<ParameterDeclarationAST> m_parameterList;
+
+private:
+ ParameterDeclarationListAST( const ParameterDeclarationListAST& source );
+ void operator = ( const ParameterDeclarationListAST& source );
+};
+
+class ParameterDeclarationClauseAST: public AST
+{
+public:
+ typedef AUTO_PTR<ParameterDeclarationClauseAST> Node;
+ enum { Type = NodeType_ParameterDeclarationClause };
+
+ DECLARE_ALLOC( ParameterDeclarationClauseAST )
+
+public:
+ ParameterDeclarationClauseAST();
+
+ ParameterDeclarationListAST* parameterDeclarationList() { return m_parameterDeclarationList.get(); }
+ void setParameterDeclarationList( ParameterDeclarationListAST::Node& parameterDeclarationList );
+
+ AST* ellipsis() { return m_ellipsis.get(); }
+ void setEllipsis( AST::Node& ellipsis );
+
+ virtual QString text() const;
+
+private:
+ ParameterDeclarationListAST::Node m_parameterDeclarationList;
+ AST::Node m_ellipsis;
+
+private:
+ ParameterDeclarationClauseAST( const ParameterDeclarationClauseAST& source );
+ void operator = ( const ParameterDeclarationClauseAST& source );
+};
+
+
+class InitDeclaratorAST: public AST
+{
+public:
+ typedef AUTO_PTR<InitDeclaratorAST> Node;
+ enum { Type = NodeType_InitDeclarator };
+
+ DECLARE_ALLOC( InitDeclaratorAST )
+
+public:
+ InitDeclaratorAST();
+
+ DeclaratorAST* declarator() { return m_declarator.get(); }
+ void setDeclarator( DeclaratorAST::Node& declarator );
+
+ AST* initializer() { return m_initializer.get(); }
+ void setInitializer( AST::Node& initializer );
+
+private:
+ DeclaratorAST::Node m_declarator;
+ AST::Node m_initializer;
+
+private:
+ InitDeclaratorAST( const InitDeclaratorAST& source );
+ void operator = ( const InitDeclaratorAST& source );
+};
+
+class InitDeclaratorListAST: public AST
+{
+public:
+ typedef AUTO_PTR<InitDeclaratorListAST> Node;
+ enum { Type = NodeType_InitDeclaratorList };
+
+ DECLARE_ALLOC( InitDeclaratorListAST )
+
+public:
+ InitDeclaratorListAST();
+
+ QPtrList<InitDeclaratorAST> initDeclaratorList() { return m_initDeclaratorList; }
+ void addInitDeclarator( InitDeclaratorAST::Node& decl );
+
+private:
+ QPtrList<InitDeclaratorAST> m_initDeclaratorList;
+
+private:
+ InitDeclaratorListAST( const InitDeclaratorListAST& source );
+ void operator = ( const InitDeclaratorListAST& source );
+};
+
+class TypedefAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<TypedefAST> Node;
+ enum { Type = NodeType_Typedef };
+
+ DECLARE_ALLOC( TypedefAST )
+
+public:
+ TypedefAST();
+
+ TypeSpecifierAST* typeSpec() { return m_typeSpec.get(); }
+ void setTypeSpec( TypeSpecifierAST::Node& typeSpec );
+
+ InitDeclaratorListAST* initDeclaratorList() { return m_initDeclaratorList.get(); }
+ void setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList );
+
+private:
+ TypeSpecifierAST::Node m_typeSpec;
+ InitDeclaratorListAST::Node m_initDeclaratorList;
+
+private:
+ TypedefAST( const TypedefAST& source );
+ void operator = ( const TypedefAST& source );
+};
+
+class TemplateParameterAST: public AST
+{
+public:
+ typedef AUTO_PTR<TemplateParameterAST> Node;
+ enum { Type = NodeType_TemplateParameter };
+
+ DECLARE_ALLOC( TemplateParameterAST )
+
+public:
+ TemplateParameterAST();
+
+ TypeParameterAST* typeParameter() { return m_typeParameter.get(); }
+ void setTypeParameter( TypeParameterAST::Node& typeParameter );
+
+ ParameterDeclarationAST* typeValueParameter() { return m_typeValueParameter.get(); }
+ void setTypeValueParameter( ParameterDeclarationAST::Node& typeValueParameter );
+
+private:
+ TypeParameterAST::Node m_typeParameter;
+ ParameterDeclarationAST::Node m_typeValueParameter;
+
+private:
+ TemplateParameterAST( const TemplateParameterAST& source );
+ void operator = ( const TemplateParameterAST& source );
+};
+
+class TemplateParameterListAST: public AST
+{
+public:
+ typedef AUTO_PTR<TemplateParameterListAST> Node;
+ enum { Type = NodeType_TemplateParameterList };
+
+ DECLARE_ALLOC( TemplateParameterListAST )
+
+public:
+ TemplateParameterListAST();
+
+ QPtrList<TemplateParameterAST> templateParameterList() { return m_templateParameterList; }
+ void addTemplateParameter( TemplateParameterAST::Node& templateParameter );
+
+private:
+ QPtrList<TemplateParameterAST> m_templateParameterList;
+
+private:
+ TemplateParameterListAST( const TemplateParameterListAST& source );
+ void operator = ( const TemplateParameterListAST& source );
+};
+
+class TemplateDeclarationAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<TemplateDeclarationAST> Node;
+ enum { Type = NodeType_TemplateDeclaration };
+
+ DECLARE_ALLOC( TemplateDeclarationAST )
+
+public:
+ TemplateDeclarationAST();
+
+ AST* exported() { return m_exported.get(); }
+ void setExported( AST::Node& exported );
+
+ TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); }
+ void setTemplateParameterList( TemplateParameterListAST::Node& templateParameterList );
+
+ DeclarationAST* declaration() { return m_declaration.get(); }
+ void setDeclaration( DeclarationAST::Node& declaration );
+
+private:
+ AST::Node m_exported;
+ TemplateParameterListAST::Node m_templateParameterList;
+ DeclarationAST::Node m_declaration;
+
+private:
+ TemplateDeclarationAST( const TemplateDeclarationAST& source );
+ void operator = ( const TemplateDeclarationAST& source );
+};
+
+class SimpleDeclarationAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<SimpleDeclarationAST> Node;
+ enum { Type = NodeType_SimpleDeclaration };
+
+ DECLARE_ALLOC( SimpleDeclarationAST )
+
+public:
+ SimpleDeclarationAST();
+
+ GroupAST* functionSpecifier() { return m_functionSpecifier.get(); }
+ void setFunctionSpecifier( GroupAST::Node& functionSpecifier );
+
+ GroupAST* storageSpecifier() { return m_storageSpecifier.get(); }
+ void setStorageSpecifier( GroupAST::Node& storageSpecifier );
+
+ TypeSpecifierAST* typeSpec() { return m_typeSpec.get(); }
+ void setTypeSpec( TypeSpecifierAST::Node& typeSpec );
+
+ InitDeclaratorListAST* initDeclaratorList() { return m_initDeclaratorList.get(); }
+ void setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList );
+
+ GroupAST* winDeclSpec() { return m_winDeclSpec.get(); }
+ void setWinDeclSpec( GroupAST::Node& winDeclSpec );
+
+private:
+ GroupAST::Node m_functionSpecifier;
+ GroupAST::Node m_storageSpecifier;
+ TypeSpecifierAST::Node m_typeSpec;
+ InitDeclaratorListAST::Node m_initDeclaratorList;
+ GroupAST::Node m_winDeclSpec;
+
+private:
+ SimpleDeclarationAST( const SimpleDeclarationAST& source );
+ void operator = ( const SimpleDeclarationAST& source );
+};
+
+class StatementAST: public AST
+{
+public:
+ typedef AUTO_PTR<StatementAST> Node;
+ enum { Type = NodeType_Statement };
+
+ DECLARE_ALLOC( StatementAST )
+
+public:
+ StatementAST();
+
+private:
+ StatementAST( const StatementAST& source );
+ void operator = ( const StatementAST& source );
+};
+
+class ExpressionStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<ExpressionStatementAST> Node;
+ enum { Type = NodeType_ExpressionStatement };
+
+ DECLARE_ALLOC( ExpressionStatementAST )
+
+public:
+ ExpressionStatementAST();
+
+ AST* expression() { return m_expression.get(); }
+ void setExpression( AST::Node& expression );
+
+private:
+ AST::Node m_expression;
+
+private:
+ ExpressionStatementAST( const ExpressionStatementAST& source );
+ void operator = ( const ExpressionStatementAST& source );
+};
+
+class ConditionAST: public AST
+{
+public:
+ typedef AUTO_PTR<ConditionAST> Node;
+ enum { Type = NodeType_Condition };
+
+ DECLARE_ALLOC( ConditionAST )
+
+public:
+ ConditionAST();
+
+ TypeSpecifierAST* typeSpec() { return m_typeSpec.get(); }
+ void setTypeSpec( TypeSpecifierAST::Node& typeSpec );
+
+ DeclaratorAST* declarator() { return m_declarator.get(); }
+ void setDeclarator( DeclaratorAST::Node& declarator );
+
+ AST* expression() { return m_expression.get(); }
+ void setExpression( AST::Node& expression );
+
+private:
+ TypeSpecifierAST::Node m_typeSpec;
+ DeclaratorAST::Node m_declarator;
+ AST::Node m_expression;
+
+private:
+ ConditionAST( const ConditionAST& source );
+ void operator = ( const ConditionAST& source );
+};
+
+class IfStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<IfStatementAST> Node;
+ enum { Type = NodeType_IfStatement };
+
+ DECLARE_ALLOC( IfStatementAST )
+
+public:
+ IfStatementAST();
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+ StatementAST* elseStatement() { return m_elseStatement.get(); }
+ void setElseStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_statement;
+ StatementAST::Node m_elseStatement;
+
+private:
+ IfStatementAST( const IfStatementAST& source );
+ void operator = ( const IfStatementAST& source );
+};
+
+class WhileStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<WhileStatementAST> Node;
+ enum { Type = NodeType_WhileStatement };
+
+ DECLARE_ALLOC( WhileStatementAST )
+
+public:
+ WhileStatementAST();
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_statement;
+
+private:
+ WhileStatementAST( const WhileStatementAST& source );
+ void operator = ( const WhileStatementAST& source );
+};
+
+class DoStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<DoStatementAST> Node;
+ enum { Type = NodeType_DoStatement };
+
+ DECLARE_ALLOC( DoStatementAST )
+
+public:
+ DoStatementAST();
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_statement;
+
+private:
+ DoStatementAST( const DoStatementAST& source );
+ void operator = ( const DoStatementAST& source );
+};
+
+class ForStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<ForStatementAST> Node;
+ enum { Type = NodeType_ForStatement };
+
+ DECLARE_ALLOC( ForStatementAST )
+
+public:
+ ForStatementAST();
+
+ StatementAST* initStatement() { return m_initStatement.get(); }
+ void setInitStatement( StatementAST::Node& statement );
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ AST* expression() const { return m_expression.get(); }
+ void setExpression( AST::Node& expression );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_initStatement;
+ StatementAST::Node m_statement;
+ AST::Node m_expression;
+
+private:
+ ForStatementAST( const ForStatementAST& source );
+ void operator = ( const ForStatementAST& source );
+};
+
+// qt4 [erbsland]
+class ForEachStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<ForEachStatementAST> Node;
+ enum { Type = NodeType_ForEachStatement };
+
+ DECLARE_ALLOC( ForEachStatementAST )
+
+public:
+ ForEachStatementAST();
+
+ StatementAST* initStatement() { return m_initStatement.get(); }
+ void setInitStatement( StatementAST::Node& statement );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+ AST* expression() const { return m_expression.get(); }
+ void setExpression( AST::Node& expression );
+
+private:
+ StatementAST::Node m_initStatement;
+ StatementAST::Node m_statement;
+ AST::Node m_expression;
+
+private:
+ ForEachStatementAST( const ForEachStatementAST& source );
+ void operator = ( const ForEachStatementAST& source );
+};
+
+class SwitchStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<SwitchStatementAST> Node;
+ enum { Type = NodeType_SwitchStatement };
+
+ DECLARE_ALLOC( SwitchStatementAST )
+
+public:
+ SwitchStatementAST();
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_statement;
+
+private:
+ SwitchStatementAST( const SwitchStatementAST& source );
+ void operator = ( const SwitchStatementAST& source );
+};
+
+class StatementListAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<StatementListAST> Node;
+ enum { Type = NodeType_StatementList };
+
+ DECLARE_ALLOC( StatementListAST )
+
+public:
+ StatementListAST();
+
+ QPtrList<StatementAST> statementList() { return m_statementList; }
+ void addStatement( StatementAST::Node& statement );
+
+private:
+ QPtrList<StatementAST> m_statementList;
+
+private:
+ StatementListAST( const StatementListAST& source );
+ void operator = ( const StatementListAST& source );
+};
+
+class CatchStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<CatchStatementAST> Node;
+ enum { Type = NodeType_CatchStatement };
+
+ DECLARE_ALLOC( CatchStatementAST )
+
+public:
+ CatchStatementAST();
+
+ ConditionAST* condition() const { return m_condition.get(); }
+ void setCondition( ConditionAST::Node& condition );
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+private:
+ ConditionAST::Node m_condition;
+ StatementAST::Node m_statement;
+
+private:
+ CatchStatementAST( const CatchStatementAST& source );
+ void operator = ( const CatchStatementAST& source );
+};
+
+class CatchStatementListAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<CatchStatementListAST> Node;
+ enum { Type = NodeType_CatchStatementList };
+
+ DECLARE_ALLOC( CatchStatementListAST )
+
+public:
+ CatchStatementListAST();
+
+ QPtrList<CatchStatementAST> statementList() { return m_statementList; }
+ void addStatement( CatchStatementAST::Node& statement );
+
+private:
+ QPtrList<CatchStatementAST> m_statementList;
+
+private:
+ CatchStatementListAST( const CatchStatementListAST& source );
+ void operator = ( const CatchStatementListAST& source );
+};
+
+class TryBlockStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<TryBlockStatementAST> Node;
+ enum { Type = NodeType_TryBlockStatement };
+
+ DECLARE_ALLOC( TryBlockStatementAST )
+
+public:
+ TryBlockStatementAST();
+
+ StatementAST* statement() { return m_statement.get(); }
+ void setStatement( StatementAST::Node& statement );
+
+ CatchStatementListAST* catchStatementList() { return m_catchStatementList.get(); }
+ void setCatchStatementList( CatchStatementListAST::Node& statementList );
+
+private:
+ StatementAST::Node m_statement;
+ CatchStatementListAST::Node m_catchStatementList;
+
+private:
+ TryBlockStatementAST( const TryBlockStatementAST& source );
+ void operator = ( const TryBlockStatementAST& source );
+};
+
+class DeclarationStatementAST: public StatementAST
+{
+public:
+ typedef AUTO_PTR<DeclarationStatementAST> Node;
+ enum { Type = NodeType_DeclarationStatement };
+
+ DECLARE_ALLOC( DeclarationStatementAST )
+
+public:
+ DeclarationStatementAST();
+
+ DeclarationAST* declaration() { return m_declaration.get(); }
+ void setDeclaration( DeclarationAST::Node& declaration );
+
+private:
+ DeclarationAST::Node m_declaration;
+
+private:
+ DeclarationStatementAST( const DeclarationStatementAST& source );
+ void operator = ( const DeclarationStatementAST& source );
+};
+
+class FunctionDefinitionAST: public DeclarationAST
+{
+public:
+ typedef AUTO_PTR<FunctionDefinitionAST> Node;
+ enum { Type = NodeType_FunctionDefinition };
+
+ DECLARE_ALLOC( FunctionDefinitionAST )
+
+public:
+ FunctionDefinitionAST();
+
+ GroupAST* functionSpecifier() { return m_functionSpecifier.get(); }
+ void setFunctionSpecifier( GroupAST::Node& functionSpecifier );
+
+ GroupAST* storageSpecifier() { return m_storageSpecifier.get(); }
+ void setStorageSpecifier( GroupAST::Node& storageSpecifier );
+
+ TypeSpecifierAST* typeSpec() { return m_typeSpec.get(); }
+ void setTypeSpec( TypeSpecifierAST::Node& typeSpec );
+
+ InitDeclaratorAST* initDeclarator() { return m_initDeclarator.get(); }
+ void setInitDeclarator( InitDeclaratorAST::Node& initDeclarator );
+
+ StatementListAST* functionBody() { return m_functionBody.get(); }
+ void setFunctionBody( StatementListAST::Node& functionBody );
+
+ GroupAST* winDeclSpec() { return m_winDeclSpec.get(); }
+ void setWinDeclSpec( GroupAST::Node& winDeclSpec );
+
+private:
+ GroupAST::Node m_functionSpecifier;
+ GroupAST::Node m_storageSpecifier;
+ TypeSpecifierAST::Node m_typeSpec;
+ InitDeclaratorAST::Node m_initDeclarator;
+ StatementListAST::Node m_functionBody;
+ GroupAST::Node m_winDeclSpec;
+
+private:
+ FunctionDefinitionAST( const FunctionDefinitionAST& source );
+ void operator = ( const FunctionDefinitionAST& source );
+};
+
+
+class TranslationUnitAST: public AST, public KShared
+{
+public:
+ typedef KSharedPtr<TranslationUnitAST> Node;
+ enum { Type = NodeType_TranslationUnit };
+
+ DECLARE_ALLOC( TranslationUnitAST )
+
+public:
+ TranslationUnitAST();
+
+ void addDeclaration( DeclarationAST::Node& ast );
+ QPtrList<DeclarationAST> declarationList() { return m_declarationList; }
+
+private:
+ QPtrList<DeclarationAST> m_declarationList;
+
+private:
+ TranslationUnitAST( const TranslationUnitAST& source );
+ void operator = ( const TranslationUnitAST& source );
+};
+
+#endif
diff --git a/lib/cppparser/cachemanager.cpp b/lib/cppparser/cachemanager.cpp
new file mode 100644
index 00000000..966f4440
--- /dev/null
+++ b/lib/cppparser/cachemanager.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "cachemanager.h"
+#include <kdebug.h>
+
+void CacheNode::access() const {
+ m_manager->access( this );
+}
+
+void CacheManager::remove( const CacheNode* node ) {
+ m_set.erase( node );
+}
+
+void CacheManager::add( const CacheNode* node ) {
+ m_set.insert( node );
+}
+
+CacheNode::CacheNode( Manager* manager ) : m_manager( manager ), m_value(manager->currentMax()) { //initialize m_value with the current maximum, so the new node has a chance even in a cache full of high-rated nodes
+ m_manager->add( this );
+}
+
+CacheNode::~CacheNode() {
+ m_manager->remove( this );
+};
+
+void CacheManager::restart( uint normalizeby ) {
+ m_currentFrame = 1;
+ m_currentMax = 1;
+ SetType oldSet = m_set;
+ m_set = SetType();
+ for( SetType::iterator it = oldSet.begin(); it != oldSet.end(); ++it ) {
+ int newValue = (*it)->value() / ( normalizeby / 1000 );
+ if( newValue > m_currentMax ) m_currentMax = newValue;
+ (*it)->setValue( newValue ); ///This way not all information is discarded
+ m_set.insert( *it );
+ }
+}
+
+void CacheManager::access( const CacheNode* node ) {
+ static const int limit = (std::numeric_limits<uint>::max() / 3)*2;
+ m_set.erase( node );
+ node->setValue( m_currentMax+1 );
+ m_set.insert( node );
+ if( node->value() > m_currentMax )
+ m_currentMax = node->value();
+ if( node->value() > limit )
+ restart( node->value() );
+}
+
+void CacheManager::setMaxNodes ( int maxNodes ) {
+ m_maxNodes = maxNodes;
+ increaseFrame();
+}
+
+void CacheManager::increaseFrame() {
+ m_currentFrame ++;
+ if( m_set.size() > m_maxNodes ) {
+ //kdDebug( 9007 ) << "CacheManager: Have " << m_set.size() << " nodes, maximum is " << m_maxNodes << ", erasing." << endl;
+ int mustErase = m_set.size() - m_maxNodes;
+ while( !m_set.empty() && mustErase != 0 ) {
+ --mustErase;
+ SetType::iterator it = m_set.begin();
+ erase( *it );
+ }
+ //kdDebug( 9007 ) << "CacheManager: Have " << m_set.size() << " nodes after erasing." << endl;
+ }
+}
+
+void CacheManager::removeLowerHalf() {
+ int maxNodes = m_maxNodes;
+ setMaxNodes( m_set.size() / 2 );
+ setMaxNodes( maxNodes );
+}
+
+void CacheManager::saveMemory() {
+ removeLowerHalf();
+}
diff --git a/lib/cppparser/cachemanager.h b/lib/cppparser/cachemanager.h
new file mode 100644
index 00000000..3804356f
--- /dev/null
+++ b/lib/cppparser/cachemanager.h
@@ -0,0 +1,102 @@
+
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 CACHEMANAGER_H
+#define CACHEMANAGER_H
+#include <cstdlib>
+#include <set>
+#include <limits>
+
+class CacheManager;
+
+
+class CacheNode {
+ typedef CacheManager Manager;
+ public:
+ CacheNode( Manager* manager );
+
+ virtual ~CacheNode();
+
+ void access() const;
+
+ inline uint value() const {
+ return m_value;
+ }
+
+ inline void setValue( const uint v ) const {
+ m_value = v;
+ }
+
+ inline void addValue( const uint diff ) const {
+ m_value += diff;
+ }
+
+ private:
+ Manager* m_manager;
+ mutable uint m_value; //This value stands for the priority of the node(higher is better)
+};
+
+class CacheNodeCompare {
+ public:
+ bool operator() ( const CacheNode* lhs, const CacheNode* rhs ) const {
+ if( lhs->value() != rhs->value() )
+ return lhs->value() < rhs->value();
+ else
+ return lhs < rhs; //To be able to identify nodes precisely
+ }
+};
+
+
+class CacheManager {
+ typedef std::set< const CacheNode*, CacheNodeCompare > SetType;
+ public:
+ CacheManager( int maxNodes = 1000 ) : m_currentFrame(1), m_maxNodes( maxNodes ), m_currentMax(1) {
+ };
+
+ inline int currentFrame() const {
+ return m_currentFrame;
+ }
+
+ void access( const CacheNode* node );
+
+ ///Can be used from outside to set the maximum count of nodes to keep.
+ void setMaxNodes ( int maxNodes );
+
+ void increaseFrame();
+
+ ///Can be used on a regular basis(time-triggered) to save memory: Removes half of all triggered
+ void removeLowerHalf();
+
+ virtual void saveMemory();
+
+ int currentMax() const {
+ return m_currentMax;
+ }
+
+ ///This triggered function should erase the given node.
+ virtual void erase( const CacheNode* node ) = 0;
+ private:
+ void restart( uint normalizeby );
+ friend class CacheNode;
+ void remove( const CacheNode* node );
+ void add( const CacheNode* node );
+ int m_currentFrame;
+ int m_maxNodes;
+ int m_currentMax;
+ SetType m_set;
+};
+
+
+#endif
diff --git a/lib/cppparser/driver.cpp b/lib/cppparser/driver.cpp
new file mode 100644
index 00000000..c5614d3e
--- /dev/null
+++ b/lib/cppparser/driver.cpp
@@ -0,0 +1,965 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2006 David Nolden <david.nolden.kdevelop@art-master.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#define CACHELEXER
+
+#include "driver.h"
+#include "lexer.h"
+#include "parser.h"
+#include <kdebug.h>
+#include <klocale.h>
+#include <stdlib.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qdatastream.h>
+#include <qbuffer.h>
+#include <assert.h>
+
+#include <iostream>
+
+
+// void Macro::read( QDataStream& stream ) {
+// stream >> m_idHashValid;
+// stream >> m_valueHashValid;
+// stream >> m_idHash;
+// stream >> m_valueHash;
+// stream >> m_name;
+// stream >> m_body;
+// stream >> m_fileName;
+// stream >> m_hasArguments;
+// stream >> m_argumentList;
+// }
+//
+// void Macro::write( QDataStream& stream ) const {
+// stream << m_idHashValid;
+// stream << m_valueHashValid;
+// stream << m_idHash;
+// stream << m_valueHash;
+// stream << m_name;
+// stream << m_body;
+// stream << m_fileName;
+// stream << m_hasArguments;
+// stream << m_argumentList;
+// }
+
+
+class IntIncreaser {
+ public:
+ IntIncreaser( int& i ) : m_i( i ) {
+ ++m_i;
+ }
+ ~IntIncreaser() {
+ --m_i;
+ }
+ private:
+ int& m_i;
+};
+
+class DefaultSourceProvider: public SourceProvider {
+ public:
+ DefaultSourceProvider() {}
+
+ virtual QString contents( const QString& fileName ) {
+ QString source;
+
+ QFile f( fileName );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream s( &f );
+ source = s.read();
+ f.close();
+ }
+ return source;
+ }
+
+ virtual bool isModified( const QString& fileName ) {
+ Q_UNUSED( fileName );
+ return true;
+ }
+
+ private:
+ DefaultSourceProvider( const DefaultSourceProvider& source );
+ void operator = ( const DefaultSourceProvider& source );
+};
+
+
+Driver::Driver()
+ : depresolv( FALSE ), lexer( 0 ), m_lexerCache( this ), m_dependenceDepth( 0 ), m_maxDependenceDepth( 20 ) {
+ m_sourceProvider = new DefaultSourceProvider();
+}
+
+Driver::~Driver() {
+ reset();
+ delete m_sourceProvider;
+}
+
+void Driver::setMaxDependenceDepth( int depth ) {
+ m_maxDependenceDepth = depth;
+}
+
+SourceProvider* Driver::sourceProvider() {
+ return m_sourceProvider;
+}
+
+void Driver::setSourceProvider( SourceProvider* sourceProvider ) {
+ delete m_sourceProvider;
+ m_sourceProvider = sourceProvider;
+}
+
+void Driver::reset( ) {
+ m_lexerCache.clear();
+ m_dependences.clear();
+ m_macros.clear();
+ m_problems.clear();
+ m_includePaths.clear();
+
+ while ( m_parsedUnits.size() ) {
+ //TranslationUnitAST* unit = **m_parsedUnits.begin();
+ m_parsedUnits.remove( m_parsedUnits.begin() );
+ //delete( unit );
+ }
+}
+
+QStringList Driver::getCustomIncludePath( const QString& ) {
+ return includePaths();
+}
+
+void Driver::remove
+ ( const QString & fileName ) {
+ m_dependences.remove( fileName );
+ m_problems.remove( fileName );
+ if( !isResolveDependencesEnabled() )
+ removeAllMacrosInFile( fileName );
+
+ QMap<QString, ParsedFilePointer>::Iterator it = m_parsedUnits.find( fileName );
+ if ( it != m_parsedUnits.end() ) {
+ //TranslationUnitAST * unit = **it;
+ m_parsedUnits.remove( it );
+ //delete( unit );
+ }
+}
+
+void Driver::removeAllMacrosInFile( const QString& fileName ) {
+ MacroMap::iterator it = m_macros.begin();
+ while ( it != m_macros.end() ) {
+ Macro m = ( *it ).second;
+ if ( m.fileName() == fileName ) {
+ m_macros.erase( it++ );
+ } else {
+ ++it;
+ }
+ }
+}
+
+void Driver::usingString( const HashedString& str ) {
+ #ifdef CACHELEXER
+ if( m_currentLexerCache ) {
+ m_currentLexerCache->addString( m_lexerCache.unifyString( str ) );
+ }
+ #endif
+}
+
+bool Driver::hasMacro( const HashedString& name ) {
+ std::pair< MacroMap::const_iterator, MacroMap::const_iterator > range = m_macros.equal_range( name );
+ if ( range.first == range.second ) {
+ return false;
+ } else {
+ const Macro& m( ( *( --range.second ) ).second );
+ if ( m.isUndef() )
+ return false;
+ else
+ return true;
+ }
+ return false;
+}
+
+QString deepCopy( const QString& str ) {
+ return str;
+ //return str.ascii();
+}
+
+const Macro& Driver::macro( const HashedString& name ) const {
+ std::pair< MacroMap::const_iterator, MacroMap::const_iterator > range = m_macros.equal_range( name );
+ if ( range.first == range.second ) {
+ return ( *const_cast<MacroMap&>( m_macros ).insert( std::make_pair( deepCopy( name.str() ), Macro() ) ) ).second; ///Since we need to return a reference, there's no other way.
+ } else {
+ return ( *( --range.second ) ).second;
+ }
+}
+Macro& Driver::macro( const HashedString& name ) {
+ std::pair< MacroMap::iterator, MacroMap::iterator > range = m_macros.equal_range( name );
+ if ( range.first == range.second ) {
+ return ( *m_macros.insert( std::make_pair( deepCopy( name.str() ), Macro() ) ) ).second;
+ } else {
+ return ( *( --range.second ) ).second;
+ }
+}
+
+void Driver::addMacro( const Macro & macro ) {
+ std::pair< MacroMap::iterator, MacroMap::iterator > range = m_macros.equal_range( macro.name() );
+
+ if ( range.first == range.second ) {
+ m_macros.insert( std::make_pair( deepCopy( macro.name() ), macro ) );
+ } else {
+ ///Insert behind the other macros
+ m_macros.insert( range.second, std::make_pair( deepCopy( macro.name() ), macro ) );
+ Macro cp = this->macro( macro.name() );
+ assert( macro == cp );
+ }
+
+#ifdef CACHELEXER
+ if( m_currentLexerCache )
+ m_currentLexerCache->addDefinedMacro( macro );
+#endif
+}
+
+void Driver::removeMacro( const HashedString& macroName ) {
+ std::pair< MacroMap::iterator, MacroMap::iterator > range = m_macros.equal_range( macroName );
+ if ( range.first != range.second ) {
+ m_macros.erase( --range.second );
+ }
+}
+
+ParsedFilePointer Driver::takeTranslationUnit( const QString& fileName ) {
+ QMap<QString, ParsedFilePointer>::Iterator it = m_parsedUnits.find( fileName );
+ ParsedFilePointer unit( *it );
+ //m_parsedUnits.remove( it );
+ m_parsedUnits[ fileName ] = 0;
+ return unit;
+}
+
+void Driver::takeTranslationUnit( const ParsedFile& file ) {
+ QMap<QString, ParsedFilePointer>::Iterator it = m_parsedUnits.find( file.fileName() );
+ m_parsedUnits[ file.fileName() ] = 0;
+}
+
+ParsedFilePointer Driver::translationUnit( const QString& fileName ) const {
+ QMap<QString, ParsedFilePointer>::ConstIterator it = m_parsedUnits.find( fileName );
+ return it != m_parsedUnits.end() ? *it : 0;
+}
+
+class Driver::ParseHelper {
+ public:
+ ParseHelper( const QString& fileName, bool force, Driver* driver, bool reportMessages = true, QString includedFrom = QString() ) : m_wasReset( false ), m_fileName( fileName ), m_previousFileName( driver->m_currentFileName ), m_previousLexer( driver->lexer ), m_previousParsedFile( driver->m_currentParsedFile ), m_previousCachedLexedFile( driver->m_currentLexerCache ), m_force( force ), m_driver( driver ), m_lex( m_driver ) {
+ QFileInfo fileInfo( fileName );
+ m_driver->m_currentParsedFile = new ParsedFile( fileName, fileInfo.lastModified() );
+ if( !includedFrom.isEmpty() )
+ m_driver->m_currentParsedFile->setIncludedFrom( includedFrom );
+#ifdef CACHELEXER
+ m_driver->m_currentLexerCache = new CachedLexedFile( fileName, &m_driver->m_lexerCache );
+#endif
+ m_absFilePath = fileInfo.absFilePath();
+
+ QMap<QString, ParsedFilePointer>::Iterator it = m_driver->m_parsedUnits.find( m_absFilePath );
+
+ if ( force && it != m_driver->m_parsedUnits.end() ) {
+ m_driver->takeTranslationUnit( m_absFilePath );
+ } else if ( it != m_driver->m_parsedUnits.end() && *it != 0 ) {
+ // file already processed
+ return ;
+ }
+
+ CachedLexedFilePointer lexedFileP = m_driver->m_lexerCache.lexedFile( HashedString( fileName ) );
+
+ m_driver->m_dependences.remove( fileName );
+ m_driver->m_problems.remove( fileName );
+
+ driver->m_currentFileName = fileName;
+
+ m_driver->lexer = &m_lex;
+ m_driver->setupLexer( &m_lex );
+
+ m_lex.setReportMessages( reportMessages );
+
+ //kdDebug( 9007 ) << "lexing file " << fileName << endl;
+ m_lex.setSource( m_driver->sourceProvider() ->contents( fileName ) );
+ if(m_previousCachedLexedFile)
+ m_previousCachedLexedFile->merge( *m_driver->m_currentLexerCache );
+ else
+ m_driver->findOrInsertProblemList( m_driver->m_currentMasterFileName ) += m_driver->m_currentLexerCache->problems();
+
+ if( !lexedFileP && m_previousParsedFile ) //only add the new cache-instance if a fitting isn't already stored, and if this file was included by another one.
+ m_driver->m_lexerCache.addLexedFile( m_driver->m_currentLexerCache );
+
+ //Copy the recursive include-files into the ParsedFile
+ m_driver->m_currentParsedFile->addIncludeFiles( m_driver->m_currentLexerCache->includeFiles() );
+ m_driver->m_currentParsedFile->setSkippedLines( m_lex.skippedLines() );
+ }
+
+ void parse() {
+ QString oldMasterFileName = m_driver->m_currentMasterFileName; //Change the master-file so problems will be reported correctly
+ m_driver->m_currentMasterFileName = m_absFilePath;
+
+ CachedLexedFilePointer lf = m_driver->m_currentLexerCache; //Set the lexer-cache to zero, so the problems registered through addProblem go directly into the file
+ m_driver->m_currentLexerCache = 0;
+
+ Parser parser( m_driver, m_driver->lexer );
+ m_driver->setupParser( &parser );
+
+ TranslationUnitAST::Node unit;
+ parser.parseTranslationUnit( unit );
+ m_driver->m_currentParsedFile->setTranslationUnit( unit );
+ m_driver->m_parsedUnits.insert( m_fileName, m_driver->m_currentParsedFile );
+ m_driver->fileParsed( *m_driver->m_currentParsedFile );
+
+ m_driver->m_currentLexerCache = lf;
+
+ m_driver->m_currentMasterFileName = oldMasterFileName;
+ }
+
+ ParsedFilePointer parsedFile() const {
+ return m_driver->m_currentParsedFile;
+ }
+
+ void reset() {
+ if ( !m_wasReset ) {
+ m_driver->m_currentFileName = m_previousFileName;
+ m_driver->lexer = m_previousLexer;
+ m_driver->m_currentParsedFile = m_previousParsedFile;
+ m_driver->m_currentLexerCache = m_previousCachedLexedFile;
+ if( m_driver->m_currentLexerCache == 0 ) {
+
+ }
+
+ m_wasReset = true;
+ }
+ }
+
+ ~ParseHelper() {
+ reset();
+ }
+
+
+ private:
+ bool m_wasReset;
+ QString m_fileName;
+ QString m_absFilePath;
+ QString m_previousFileName;
+ Lexer* m_previousLexer;
+ ParsedFilePointer m_previousParsedFile;
+ CachedLexedFilePointer m_previousCachedLexedFile;
+ bool m_force;
+ Driver* m_driver;
+ Lexer m_lex;
+};
+
+
+void Driver::addDependence( const QString & fileName, const Dependence & dep ) {
+
+ // this can happen if the parser was invoked on a snippet of text and not a file
+ if ( fileName.isEmpty() || !m_currentParsedFile )
+ return;
+
+ //@todo prevent cyclic dependency-loops
+ QFileInfo fileInfo( dep.first );
+ QString fn = fileInfo.absFilePath();
+
+ if ( !depresolv ) {
+ findOrInsertDependenceList( fileName ).insert( fn, dep );
+ m_currentParsedFile->addIncludeFile( dep.first, 0, dep.second == Dep_Local );
+ return ;
+ }
+
+ QString file = findIncludeFile( dep );
+
+ findOrInsertDependenceList( fileName ).insert( file, dep );
+ m_currentParsedFile->addIncludeFile( file, 0, dep.second == Dep_Local );
+
+ if ( !QFile::exists( file ) ) {
+ Problem p( i18n( "Could not find include file %1" ).arg( dep.first ),
+ lexer ? lexer->currentLine() : -1,
+ lexer ? lexer->currentColumn() : -1, Problem::Level_Warning );
+ addProblem( fileName, p );
+ return ;
+ }
+
+ if( m_currentLexerCache )
+ m_currentLexerCache->addIncludeFile( file, QDateTime() ); ///The time will be overwritten in CachedLexedFile::merge(...)
+
+ /**What should be done:
+ * 1. Lex the file to get all the macros etc.
+ * 2. TODO: Check what previously set macros the file was affected by, and compare those macros to any previously parsed instances of this file.
+ * 2.1 If there is a parse-instance of the file where all macros that played a role had the same values, we do not need to reparse this file.
+ * 2.2 If there is no such fitting instance, the file needs to be parsed and put to the code-model.
+ *
+ * It'll be necessary to have multiple versions of one file in the code-model.
+ */
+
+ IntIncreaser i( m_dependenceDepth );
+ if( m_dependenceDepth > m_maxDependenceDepth ) {
+ //kdDebug( 9007 ) << "maximum dependence-depth of " << m_maxDependenceDepth << " was reached, " << fileName << " will not be processed" << endl;
+ return;
+ }
+
+ CachedLexedFilePointer lexedFileP = m_lexerCache.lexedFile( HashedString( file ) );
+ if( lexedFileP ) {
+ CachedLexedFile& lexedFile( *lexedFileP );
+ m_currentLexerCache->merge( lexedFile ); //The ParseHelper will will copy the include-files into the result later
+ for( MacroSet::Macros::const_iterator it = lexedFile.definedMacros().macros().begin(); it != lexedFile.definedMacros().macros().end(); ++it ) {
+ addMacro( (*it) );
+ }
+ ///@todo fill usingMacro(...)
+ return;
+ }
+
+ ParseHelper h( file, true, this, false, m_currentMasterFileName );
+
+ /*if ( m_parsedUnits.find(file) != m_parsedUnits.end() )
+ return;*/
+
+ if( shouldParseIncludedFile( m_currentParsedFile ) ) ///Until the ParseHelper is destroyed, m_currentParsedFile will stay the included file
+ h.parse();
+}
+
+void Driver::addProblem( const QString & fileName, const Problem & problem ) {
+ Problem p( problem );
+ p.setFileName( fileName );
+
+ if( m_currentLexerCache )
+ m_currentLexerCache->addProblem( p );
+ else
+ findOrInsertProblemList( m_currentMasterFileName ).append( problem );
+}
+
+QMap< QString, Dependence >& Driver::findOrInsertDependenceList( const QString & fileName ) {
+ QMap<QString, QMap<QString, Dependence> >::Iterator it = m_dependences.find( fileName );
+ if ( it != m_dependences.end() )
+ return it.data();
+
+ QMap<QString, Dependence> l;
+ m_dependences.insert( deepCopy( fileName ), l );
+ return m_dependences[ fileName ];
+}
+
+QValueList < Problem >& Driver::findOrInsertProblemList( const QString & fileName ) {
+ QMap<QString, QValueList<Problem> >::Iterator it = m_problems.find( fileName );
+ if ( it != m_problems.end() )
+ return it.data();
+
+ QValueList<Problem> l;
+ m_problems.insert( fileName, l );
+ return m_problems[ fileName ];
+}
+
+QMap< QString, Dependence > Driver::dependences( const QString & fileName ) const {
+ QMap<QString, QMap<QString, Dependence> >::ConstIterator it = m_dependences.find( fileName );
+ if ( it != m_dependences.end() )
+ return it.data();
+ return QMap<QString, Dependence>();
+}
+
+const Driver::MacroMap& Driver::macros() const {
+ return m_macros;
+}
+
+void Driver::insertMacros( const MacroSet& macros ) {
+ for( MacroSet::Macros::const_iterator it = macros.m_usedMacros.begin(); it != macros.m_usedMacros.end(); ++it ) {
+ addMacro( *it );
+ }
+}
+
+QValueList < Problem > Driver::problems( const QString & fileName ) const {
+ QMap<QString, QValueList<Problem> >::ConstIterator it = m_problems.find( fileName );
+ if ( it != m_problems.end() )
+ return it.data();
+ return QValueList<Problem>();
+}
+
+void Driver::clearMacros() {
+ m_macros.clear();
+}
+
+void Driver::clearParsedMacros() {
+ //Keep global macros
+ for( MacroMap::iterator it = m_macros.begin(); it != m_macros.end(); ) {
+ if( !(*it).second.fileName().isEmpty() ) {
+ m_macros.erase( it++ );
+ } else {
+ ++it;
+ }
+ }
+}
+
+void Driver::parseFile( const QString& fileName, bool onlyPreProcess, bool force , bool macrosGlobal )
+{
+ QString oldMasterFileName = m_currentMasterFileName;
+ m_currentMasterFileName = fileName;
+
+ //if( isResolveDependencesEnabled() )
+ clearParsedMacros(); ///Since everything will be re-lexed, we do not need any old macros
+
+ m_lexerCache.increaseFrame();
+
+ //Remove the problems now instead of in ParseHelper, because this way the problems reported by getCustomIncludePath(...) will not be discarded
+ m_problems.remove( fileName );
+
+ QStringList oldIncludePaths = m_includePaths;
+ m_includePaths = getCustomIncludePath( fileName );
+
+ ParseHelper p( fileName, force, this );
+ if( !onlyPreProcess ){
+ p.parse();
+ }
+ if( macrosGlobal ) {
+ for( MacroMap::iterator it = m_macros.begin(); it != m_macros.end(); ++it) {
+ if( (*it).second.fileName() == fileName ) {
+ (*it).second.setFileName( QString::null );
+ }
+ }
+ }
+
+ m_includePaths = oldIncludePaths;
+ m_currentMasterFileName = oldMasterFileName;
+}
+
+void Driver::setupLexer( Lexer * lexer ) {
+ // stl
+ lexer->addSkipWord( "__STL_BEGIN_NAMESPACE" );
+ lexer->addSkipWord( "__STL_END_NAMESPACE" );
+ lexer->addSkipWord( "__STL_BEGIN_RELOPS_NAMESPACE" );
+ lexer->addSkipWord( "__STL_END_RELOPS_NAMESPACE" );
+ lexer->addSkipWord( "__STL_TEMPLATE_NULL" );
+ lexer->addSkipWord( "__STL_TRY" );
+ lexer->addSkipWord( "__STL_UNWIND" );
+ lexer->addSkipWord( "__STL_NOTHROW" );
+ lexer->addSkipWord( "__STL_NULL_TMPL_ARGS" );
+ lexer->addSkipWord( "__STL_UNWIND", SkipWordAndArguments );
+ lexer->addSkipWord( "__GC_CONST" );
+ lexer->addSkipWord( "__HASH_ALLOC_INIT", SkipWordAndArguments );
+ lexer->addSkipWord( "__STL_DEFAULT_ALLOCATOR", SkipWordAndArguments, "T" );
+ lexer->addSkipWord( "__STL_MUTEX_INITIALIZER" );
+ lexer->addSkipWord( "__STL_NULL_TMPL_ARGS" );
+
+ // antlr
+ lexer->addSkipWord( "ANTLR_BEGIN_NAMESPACE", SkipWordAndArguments );
+ lexer->addSkipWord( "ANTLR_USE_NAMESPACE", SkipWordAndArguments );
+ lexer->addSkipWord( "ANTLR_USING_NAMESPACE", SkipWordAndArguments );
+ lexer->addSkipWord( "ANTLR_END_NAMESPACE" );
+ lexer->addSkipWord( "ANTLR_C_USING", SkipWordAndArguments );
+ lexer->addSkipWord( "ANTLR_API" );
+
+ // gnu
+ lexer->addSkipWord( "__extension__", SkipWordAndArguments );
+ lexer->addSkipWord( "__attribute__", SkipWordAndArguments );
+ lexer->addSkipWord( "__BEGIN_DECLS" );
+ lexer->addSkipWord( "__END_DECLS" );
+ lexer->addSkipWord( "__THROW" );
+ lexer->addSkipWord( "__restrict" );
+ lexer->addSkipWord( "__restrict__" );
+ lexer->addSkipWord( "__attribute_pure__" );
+ lexer->addSkipWord( "__attribute_malloc__" );
+ lexer->addSkipWord( "__attribute_format_strfmon__" );
+ lexer->addSkipWord( "__asm__", SkipWordAndArguments );
+ lexer->addSkipWord( "__devinit" );
+ lexer->addSkipWord( "__devinit__" );
+ lexer->addSkipWord( "__init" );
+ lexer->addSkipWord( "__init__" );
+ lexer->addSkipWord( "__signed" );
+ lexer->addSkipWord( "__signed__" );
+ lexer->addSkipWord( "__unsigned" );
+ lexer->addSkipWord( "__unsigned__" );
+ lexer->addSkipWord( "asmlinkage" );
+ lexer->addSkipWord( "____cacheline_aligned" );
+ lexer->addSkipWord( "__glibcpp_class_requires", SkipWordAndArguments );
+ lexer->addSkipWord( "__glibcpp_class2_requires", SkipWordAndArguments );
+ lexer->addSkipWord( "__glibcpp_class4_requires", SkipWordAndArguments );
+ lexer->addSkipWord( "__glibcpp_function_requires", SkipWordAndArguments );
+ lexer->addSkipWord( "restrict" );
+
+ lexer->addSkipWord( "__BEGIN_NAMESPACE_STD" );
+ lexer->addSkipWord( "__END_NAMESPACE_STD" );
+ lexer->addSkipWord( "__BEGIN_NAMESPACE_C99" );
+ lexer->addSkipWord( "__END_NAMESPACE_C99" );
+ lexer->addSkipWord( "__USING_NAMESPACE_STD", SkipWordAndArguments );
+
+ // kde
+ lexer->addSkipWord( "K_SYCOCATYPE", SkipWordAndArguments );
+ lexer->addSkipWord( "EXPORT_DOCKCLASS" );
+ lexer->addSkipWord( "K_EXPORT_COMPONENT_FACTORY", SkipWordAndArguments );
+ lexer->addSkipWord( "K_SYCOCAFACTORY", SkipWordAndArguments );
+ lexer->addSkipWord( "KDE_DEPRECATED" );
+
+ // qt
+ lexer->addSkipWord( "Q_OBJECT" );
+ lexer->addSkipWord( "Q_OVERRIDE", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_ENUMS", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_PROPERTY", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_CLASSINFO", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_SETS", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_UNUSED", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_CREATE_INSTANCE", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_DUMMY_COMPARISON_OPERATOR", SkipWordAndArguments );
+ lexer->addSkipWord( "ACTIVATE_SIGNAL_WITH_PARAM", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_INLINE_TEMPLATES" );
+ lexer->addSkipWord( "Q_TEMPLATE_EXTERN" );
+ lexer->addSkipWord( "Q_TYPENAME" );
+ lexer->addSkipWord( "Q_REFCOUNT" );
+ lexer->addSkipWord( "Q_EXPLICIT" );
+ lexer->addSkipWord( "QMAC_PASCAL" );
+ lexer->addSkipWord( "QT_STATIC_CONST" );
+ lexer->addSkipWord( "QT_STATIC_CONST_IMPL" );
+ lexer->addSkipWord( "QT_WIN_PAINTER_MEMBERS" );
+ lexer->addSkipWord( "QT_NC_MSGBOX" );
+ lexer->addSkipWord( "Q_VARIANT_AS", SkipWordAndArguments );
+ lexer->addSkipWord( "CALLBACK_CALL_TYPE" );
+
+ // qt4 [erbsland]
+ lexer->addSkipWord( "Q_DECLARE_FLAGS", SkipWordAndArguments );
+ lexer->addSkipWord( "Q_DECLARE_OPERATORS_FOR_FLAGS", SkipWordAndArguments );
+
+ // flex
+ lexer->addSkipWord( "yyconst" );
+ lexer->addSkipWord( "YY_RULE_SETUP" );
+ lexer->addSkipWord( "YY_BREAK" );
+ lexer->addSkipWord( "YY_RESTORE_YY_MORE_OFFSET" );
+
+ // gtk
+ lexer->addSkipWord( "G_BEGIN_DECLS" );
+ lexer->addSkipWord( "G_END_DECLS" );
+ lexer->addSkipWord( "G_GNUC_CONST" );
+ lexer->addSkipWord( "G_CONST_RETURN" );
+ lexer->addSkipWord( "GTKMAIN_C_VAR" );
+ lexer->addSkipWord( "GTKVAR" );
+ lexer->addSkipWord( "GDKVAR" );
+ lexer->addSkipWord( "G_GNUC_PRINTF", SkipWordAndArguments );
+
+ // windows
+ lexer->addSkipWord( "WINAPI" );
+ lexer->addSkipWord( "__stdcall" );
+ lexer->addSkipWord( "__cdecl" );
+ lexer->addSkipWord( "_cdecl" );
+ lexer->addSkipWord( "CALLBACK" );
+
+ // gcc extensions
+ if( !hasMacro( "__asm__" ) ) addMacro( Macro( "__asm__", "asm" ) );
+ if( !hasMacro( "__inline" ) ) addMacro( Macro( "__inline", "inline" ) );
+ if( !hasMacro( "__inline__" ) ) addMacro( Macro( "__inline__", "inline" ) );
+ if( !hasMacro( "__const" ) ) addMacro( Macro( "__const", "const" ) );
+ if( !hasMacro( "__const__" ) ) addMacro( Macro( "__const__", "const" ) );
+ if( !hasMacro( "__volatile__" ) ) addMacro( Macro( "__volatile__", "volatile" ) );
+ if( !hasMacro( "__complex__" ) ) addMacro( Macro( "__complex__", "" ) );
+}
+
+void Driver::setupParser( Parser * parser ) {
+ Q_UNUSED( parser );
+}
+
+void Driver::clearIncludePaths() {
+ m_includePaths.clear();
+}
+
+void Driver::addIncludePath( const QString &path ) {
+ if ( !path.stripWhiteSpace().isEmpty() )
+ m_includePaths << path;
+}
+
+QString Driver::findIncludeFile( const Dependence& dep, const QString& fromFile ) {
+ QString fileName = dep.first;
+
+ if ( dep.second == Dep_Local ) {
+ QString path = QFileInfo( fromFile ).dirPath( true );
+ QFileInfo fileInfo( QFileInfo( path, fileName ) );
+ if ( fileInfo.exists() && fileInfo.isFile() )
+ return fileInfo.absFilePath();
+ }
+
+ QStringList includePaths = getCustomIncludePath( fromFile );
+
+ for ( QStringList::ConstIterator it = includePaths.begin(); it != includePaths.end(); ++it ) {
+ QFileInfo fileInfo( *it, fileName );
+ if ( fileInfo.exists() && fileInfo.isFile() )
+ return fileInfo.absFilePath();
+ }
+
+ return QString::null;
+}
+
+QString Driver::findIncludeFile( const Dependence& dep ) const {
+ QString fileName = dep.first;
+
+ if ( dep.second == Dep_Local ) {
+ QString path = QFileInfo( currentFileName() ).dirPath( true );
+ QFileInfo fileInfo( QFileInfo( path, fileName ) );
+ if ( fileInfo.exists() && fileInfo.isFile() )
+ return fileInfo.absFilePath();
+ }
+
+ for ( QStringList::ConstIterator it = m_includePaths.begin(); it != m_includePaths.end(); ++it ) {
+ QFileInfo fileInfo( *it, fileName );
+ if ( fileInfo.exists() && fileInfo.isFile() )
+ return fileInfo.absFilePath();
+ }
+
+ return QString::null;
+}
+
+void Driver::setResolveDependencesEnabled( bool enabled ) {
+ depresolv = enabled;
+ if ( depresolv )
+ setupPreProcessor();
+}
+
+bool Driver::shouldParseIncludedFile( const ParsedFilePointer& /*file*/) {
+ return false;
+}
+
+void Driver::setupPreProcessor() {}
+
+void Driver::fileParsed( ParsedFile & fileName ) {
+ Q_UNUSED( fileName );
+}
+
+void Driver::usingMacro( const Macro& macro ) {
+ if( m_currentParsedFile )
+ m_currentParsedFile->usedMacros().addMacro( macro );
+#ifdef CACHELEXER
+ if( m_currentLexerCache )
+ m_currentLexerCache->addUsedMacro( macro );
+#endif
+}
+
+// void Macro::computeHash() const {
+// m_idHash = 7 * ( HashedString::hashString( m_name ) + m_argumentList.count() * 13 );
+// int a = 1;
+// m_idHash += 31 * m_argumentList.count();
+//
+// m_valueHash = 27 * ( HashedString::hashString( m_body ) + (m_isUndefMacro ? 1 : 0 ) );
+//
+// for( QValueList<Argument>::const_iterator it = m_argumentList.begin(); it != m_argumentList.end(); ++it ) {
+// a *= 19;
+// m_valueHash += a * HashedString::hashString( *it );
+// }
+// m_valueHashValid = true;
+// m_idHashValid = true;
+// }
+
+// MacroSet::MacroSet() : m_idHashValid( false ), m_valueHashValid( false ) {
+// }
+
+void MacroSet::addMacro( const Macro& macro ) {
+ std::pair<Macros::const_iterator, bool> r = m_usedMacros.insert( macro );
+ if( !r.second ) {
+ //Make sure the macro added later will be used
+ m_usedMacros.erase( r.first );
+ m_usedMacros.insert( macro );
+ }
+
+ m_idHashValid = m_valueHashValid = false;
+}
+
+void MacroSet::merge( const MacroSet& macros ) {
+ Macros m = macros.m_usedMacros; //Swap is needed so the merged macros take precedence
+ m.insert( m_usedMacros.begin(), m_usedMacros.end() );
+ m_usedMacros = m;
+ m_idHashValid = m_valueHashValid = false;
+}
+
+
+size_t MacroSet::idHash() const {
+ if( !m_idHashValid ) computeHash();
+ return m_idHash;
+}
+
+size_t MacroSet::valueHash() const {
+ if( !m_valueHashValid ) computeHash();
+ return m_valueHash;
+}
+
+void MacroSet::computeHash() const {
+ m_idHash = 0;
+ m_valueHash = 0;
+ int mult = 1;
+ for( Macros::const_iterator it = m_usedMacros.begin(); it != m_usedMacros.end(); ++it ) {
+ mult *= 31;
+ m_idHash += (*it).idHash();
+ m_valueHash += (*it).valueHash();
+ }
+}
+
+// void MacroSet::read( QDataStream& stream ) {
+// stream >> m_idHashValid >> m_idHash >> m_valueHashValid >> m_valueHash;
+// int cnt;
+// stream >> cnt;
+// m_usedMacros.clear();
+// Macro m;
+// for( int a = 0; a < cnt; a++ ) {
+// m.read( stream );
+// m_usedMacros.insert( m );
+// }
+// }
+//
+// void MacroSet::write( QDataStream& stream ) const {
+// stream << m_idHashValid << m_idHash << m_valueHashValid << m_valueHash;
+// stream << m_usedMacros.size();
+// for( Macros::const_iterator it = m_usedMacros.begin(); it != m_usedMacros.end(); ++it ) {
+// (*it).write( stream );
+// }
+// }
+
+/**
+ * @return All Macros that were used while processing this translation-unit
+ * */
+MacroSet& ParsedFile::usedMacros() {
+ return m_usedMacros;
+}
+
+const MacroSet& ParsedFile::usedMacros() const {
+ return m_usedMacros;
+}
+
+ParsedFile::ParsedFile( const QString& fileName, const QDateTime& timeStamp ) : m_translationUnit( 0 ), m_fileName( fileName ), m_timeStamp( timeStamp ) {
+ m_includeFiles.insert( fileName );
+}
+
+ParsedFile::ParsedFile( const QByteArray& array ) {
+ QBuffer b( array );
+ QDataStream d( &b );
+ read( d );
+}
+
+QString ParsedFile::includedFrom() const {
+ return m_includedFrom;
+}
+
+void ParsedFile::setIncludedFrom( const QString& str ) {
+ m_includedFrom = str;
+}
+
+QByteArray ParsedFile::serialize() const {
+ QByteArray array;
+ QBuffer b( array );
+ QDataStream d( &b );
+ write( d );
+ return array;
+}
+
+// void ParsedFile::read( QDataStream& stream ) {
+// int directIncludeFilesCount;
+// stream >> directIncludeFilesCount;
+// m_directIncludeFiles.clear();
+// for( int a = 0; a < directIncludeFilesCount; a++ ) {
+// IncludeDesc i;
+// stream >> i.local;
+// stream >> i.includePath;
+// //"parsed" will not be reconstructed
+// m_directIncludeFiles.push_back( i );
+// }
+// stream >> m_fileName;
+// stream >> m_timeStamp;
+// m_usedMacros.read( stream );
+// m_translationUnit = 0;
+// m_includeFiles.read( stream );
+// }
+//
+// void ParsedFile::write( QDataStream& stream ) const {
+// for( QValueList<IncludeDesc>::const_iterator it = m_directIncludeFiles.begin(); it != m_directIncludeFiles.end(); ++it ) {
+// stream << (*it).local;
+// stream << (*it).includePath;
+// }
+// stream << m_fileName;
+// stream << m_timeStamp;
+// m_usedMacros.write( stream );
+// m_includeFiles.write( stream );
+// }
+
+ParsedFile::operator TranslationUnitAST* () const {
+ if( !this ) return 0;
+ return m_translationUnit;
+}
+
+void ParsedFile::setTranslationUnit( const TranslationUnitAST::Node& trans ) {
+ m_translationUnit = trans;
+}
+
+// HashedStringSet& ParsedFile::includeFiles() {
+// return m_includeFiles;
+// }
+
+int ParsedFile::skippedLines() const {
+ return m_skippedLines;
+}
+
+void ParsedFile::setSkippedLines( int lines ) {
+ m_skippedLines = lines;
+}
+
+const HashedStringSet& ParsedFile::includeFiles() const {
+ return m_includeFiles;
+}
+
+QString ParsedFile::fileName() const {
+ return m_fileName;
+}
+
+QDateTime ParsedFile::timeStamp() const {
+ return m_timeStamp;
+}
+
+void ParsedFile::addIncludeFiles( const HashedStringSet& includeFiles ) {
+ m_includeFiles += includeFiles;
+}
+
+void ParsedFile::addIncludeFile( const QString& includePath, const ParsedFilePointer& parsed, bool localInclude ) {
+ m_includeFiles.insert( includePath );
+ if( parsed )
+ m_includeFiles += parsed->includeFiles();
+ IncludeDesc d;
+ d.local = localInclude;
+ d.includePath = includePath;
+ d.parsed = parsed;
+ m_directIncludeFiles << d;
+}
+
+const QValueList<ParsedFile::IncludeDesc>& ParsedFile::directIncludeFiles() const {
+ return m_directIncludeFiles;
+}
+
+bool MacroSet::hasMacro( const QString& name ) const {
+ Macros::const_iterator it = m_usedMacros.find( Macro( name, "" ) );
+ if( it != m_usedMacros.end() ) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool MacroSet::hasMacro( const HashedString& name ) const {
+ Macros::const_iterator it = m_usedMacros.find( Macro( name.str(), "" ) );
+ if( it != m_usedMacros.end() ) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+Macro MacroSet::macro( const QString& name ) const {
+ Macros::const_iterator it = m_usedMacros.find( Macro( name, "" ) );
+
+ if( it != m_usedMacros.end() ) {
+ return *it;
+ } else {
+ return Macro();
+ }
+}
+
+LexerCache* Driver::lexerCache() {
+ return &m_lexerCache;
+}
+
diff --git a/lib/cppparser/driver.h b/lib/cppparser/driver.h
new file mode 100644
index 00000000..31f62443
--- /dev/null
+++ b/lib/cppparser/driver.h
@@ -0,0 +1,460 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef DRIVER_H
+#define DRIVER_H
+
+#include "ast.h"
+
+#include "macro.h"
+#include <qpair.h>
+#include <qvaluestack.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+#include <qdatastream.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qvaluelist.h>
+#include <map>
+#include <set>
+#include <hashedstring.h>
+#include <ksharedptr.h>
+#include <codemodel.h>
+#include <ext/hash_map>
+#include "lexercache.h"
+
+
+class Lexer;
+class Parser;
+
+enum
+{
+ Dep_Global,
+ Dep_Local
+};
+
+typedef QPair<QString, int> Dependence;
+
+class ParsedFile;
+typedef KSharedPtr< ParsedFile > ParsedFilePointer;
+
+class ParsedFile : public AbstractParseResult {
+ public:
+ struct IncludeDesc {
+ bool local; //Whether it is a local include(#include "local.h", not #include <global.h>)
+ QString includePath;
+ ParsedFilePointer parsed; //May be zero!
+ };
+// ParsedFile() {
+// }
+ ParsedFile( QDataStream& s ) {
+ read( s );
+ }
+
+ ParsedFile( const QString& fileName, const QDateTime& timeStamp );
+
+ ///Deserializes the ParsedFile from a previous call to serialize(). AST will always be zero after a call to this.
+ ParsedFile( const QByteArray& array );
+
+ /**
+ * @return All Macros that were used while processing this translation-unit. May be modified.
+ */
+ MacroSet& usedMacros();
+ const MacroSet& usedMacros() const;
+
+ /**
+ * @return the count of lines that were skipped while preprocessing the file
+ * */
+ int skippedLines() const;
+
+ void setSkippedLines( int lines );
+ /**
+ * @return Absolutely all files included by this one(no matter through how many other files they were included)
+ */
+// HashedStringSet& includeFiles();
+
+ const HashedStringSet& includeFiles() const;
+
+ void addIncludeFiles( const HashedStringSet& includeFiles );
+
+ void addIncludeFile( const QString& includePath, const ParsedFilePointer& parsed, bool localInclude );
+
+ ///If this file was parsed while resolving the dependencies of another file, this returns the file this one was included from. Else returns an empty string.
+ QString includedFrom() const;
+
+ void setIncludedFrom( const QString& str );
+ /**
+ * @return Reference to the internal list of all directly included files(without those included indirectly)
+ */
+ const QValueList<IncludeDesc>& directIncludeFiles() const;
+
+ operator TranslationUnitAST* () const; //May be zero!
+
+ TranslationUnitAST* operator -> () const {
+ if( !this ) return 0;
+ return m_translationUnit;
+ }
+
+ void setTranslationUnit( const TranslationUnitAST::Node& trans );
+
+ QString fileName() const;
+
+ QDateTime timeStamp() const;
+
+ ///Serializes the content of this class into a byte-array. Note that this does not serialize the AST.
+ QByteArray serialize() const;
+
+ /*void read( QDataStream& stream );
+ void write( QDataStream& stream ) const;*/
+
+ virtual void read( QDataStream& stream ) {
+ int directIncludeFilesCount;
+ stream >> directIncludeFilesCount;
+ m_directIncludeFiles.clear();
+ for( int a = 0; a < directIncludeFilesCount; a++ ) {
+ IncludeDesc i;
+ Q_INT8 in;
+ stream >> in;
+ i.local = in;
+ stream >> i.includePath;
+ //"parsed" will not be reconstructed
+ m_directIncludeFiles.push_back( i );
+ }
+ stream >> m_skippedLines;
+ stream >> m_fileName;
+ stream >> m_timeStamp;
+ stream >> m_includedFrom;
+ m_usedMacros.read( stream );
+ m_translationUnit = 0;
+ m_includeFiles.read( stream );
+ }
+
+ virtual void write( QDataStream& stream ) const {
+ int i = m_directIncludeFiles.size();
+ stream << i;
+ for( QValueList<IncludeDesc>::const_iterator it = m_directIncludeFiles.begin(); it != m_directIncludeFiles.end(); ++it ) {
+ Q_INT8 i = (*it).local;
+ stream << i;
+ stream << (*it).includePath;
+ }
+ stream << m_skippedLines;
+ stream << m_fileName;
+ stream << m_timeStamp;
+ stream << m_includedFrom;
+ m_usedMacros.write( stream );
+ m_includeFiles.write( stream );
+ }
+
+ virtual ParsedFileType type() const {
+ return CppParsedFile;
+ }
+
+ private:
+ QValueList<IncludeDesc> m_directIncludeFiles;
+ MacroSet m_usedMacros;
+ TranslationUnitAST::Node m_translationUnit;
+ HashedStringSet m_includeFiles;
+ int m_skippedLines;
+ QString m_fileName;
+ QDateTime m_timeStamp;
+ QString m_includedFrom;
+};
+
+/**
+ * An interface that provides source code to the Driver
+ */
+class SourceProvider {
+ public:
+ SourceProvider() {}
+ virtual ~SourceProvider() {}
+
+ /**
+ * Get the contents of a file
+ * \param fileName The name of the file to get the contents for. An absolute
+ * path should be used.
+ * \return A QString that contains the contents of the file
+ */
+ virtual QString contents( const QString& fileName ) = 0;
+
+ /**
+ * Check to see if a file has been modified
+ * \param fileName The name of hte file to get the modification state of. An
+ * absolute path should be used.
+ * \return true if the file has been modified
+ * \return false if the file has not been modified
+ */
+ virtual bool isModified( const QString& fileName ) = 0;
+
+ private:
+ SourceProvider( const SourceProvider& source );
+ void operator = ( const SourceProvider& source );
+};
+
+class Driver {
+ public:
+ Driver();
+ virtual ~Driver();
+
+ typedef std::multimap< HashedString, Macro > MacroMap;
+
+ /**
+ * Get the source provider for this driver. This would be useful for
+ * getting the text the driver is working with.
+ */
+ SourceProvider* sourceProvider();
+ /**
+ * Sets the source provider the driver will use
+ * @param sourceProvider the SourceProvider the driver will use
+ */
+ void setSourceProvider( SourceProvider* sourceProvider );
+
+ /**
+ * @brief Resets the driver
+ *
+ * Clears the driver of all problems, dependencies, macros, and include paths and
+ * removes any translation units that have been parsed
+ */
+ virtual void reset();
+
+ /**
+ * Tells the driver to start parsing a file
+ * @param fileName The name of the file to parse
+ * @param onlyPreProcesss Tells the driver to only run the file through the preprocessor. Defaults to false
+ * @param force Force the parsing of the file. Defaults to false
+ * @param macrosGlobal Should the macros be global? (Global macros are not deleted once a new translation-unit is parsed)
+ */
+ virtual void parseFile( const QString& fileName, bool onlyPreProcesss = false, bool force = false, bool macrosGlobal = false );
+
+ /**
+ * Indicates that the file has been parsed
+ * @param fileName The name of the file parsed. It is legal to create a ParsedFilePointer on the given item.
+ */
+ virtual void fileParsed( ParsedFile& fileName );
+
+ /**
+ * Removes the file specified by @p fileName from the driver
+ * @param fileName The name of the file to remove
+ */
+ virtual void remove
+ ( const QString& fileName );
+
+ /**
+ * Add a dependency on another header file for @p fileName
+ * @param fileName The file name to add the dependency for
+ * @param dep The dependency to add
+ */
+ virtual void addDependence( const QString& fileName, const Dependence& dep );
+
+ /**
+ * Add a macro to the driver
+ * @param macro The macro to add to the driver
+ */
+ virtual void addMacro( const Macro& macro );
+
+ /**
+ * Add a problem to the driver
+ * @param fileName The file name to add the problem for
+ * @param problem The problem to add
+ */
+ virtual void addProblem( const QString& fileName, const Problem& problem );
+
+ /**
+ * The current file name the driver is working with
+ */
+ QString currentFileName() const {
+ return m_currentFileName;
+ }
+ ParsedFilePointer takeTranslationUnit( const QString& fileName );
+
+ void takeTranslationUnit( const ParsedFile& file );
+ /**
+ * Get the translation unit contained in the driver for @p fileName.
+ * @param fileName The name of the file to get the translation unit for
+ * @return The TranslationUnitAST pointer that represents the translation unit
+ * @return 0 if no translation unit exists for the file
+ */
+ ParsedFilePointer translationUnit( const QString& fileName ) const;
+ /**
+ * Get the dependencies for a file
+ * @param fileName The file name to get dependencies for
+ * @return The dependencies for the file
+ */
+ QMap<QString, Dependence> dependences( const QString& fileName ) const;
+ /**
+ * Get all the macros the driver contains
+ * @return The macros
+ */
+ const MacroMap& macros() const;
+
+ /**
+ * Take all macros from the given map(forgetting own macros) */
+ void insertMacros( const MacroSet& macros );
+ /**
+ * Get the list of problem areas the driver contains
+ * @param fileName The filename to get problems for
+ * @return The list of problems for @p fileName
+ */
+ QValueList<Problem> problems( const QString& fileName ) const;
+
+ void usingString( const HashedString& str );
+ /**
+ * Check if we have a macro in the driver
+ * If the last stacked macro of that name is an undef-macro, false is returned.
+ * @param name The name of the macro to check for
+ * @return true if we have the macro in the driver
+ * @return false if we don't have the macro in the driver
+ */
+ bool hasMacro( const HashedString& name ) ;
+ /**
+ * Get the macro identified by @p name
+ * @param name The name of the macro to get
+ * @return A const reference of the macro object represented by @p name
+ */
+ const Macro& macro( const HashedString& name ) const;
+ /**
+ * Get the last inserted macro identified by @p name
+ * @override
+ * @param name The name of the macro to get
+ * @return A non-const reference of the macro object represented by @p name
+ *
+ */
+ Macro& macro( const HashedString& name );
+
+ /**
+ * Remove the last inserted Macro of that name
+ * @param macroName The name of the macro to remove
+ */
+ virtual void removeMacro( const HashedString& macroName );
+
+ /**
+ * Remove all macros from the driver for a certain file
+ * @param fileName The file name
+ */
+ virtual void removeAllMacrosInFile( const QString& fileName ); ///Check when this is called. It may be wrong.
+
+ QStringList includePaths() const {
+ return m_includePaths;
+ }
+
+ virtual QStringList getCustomIncludePath( const QString& );
+
+
+ virtual void addIncludePath( const QString &path );
+
+ virtual void clearIncludePaths();
+
+ /// @todo remove
+ const QMap<QString, ParsedFilePointer> &parsedUnits() const {
+ return m_parsedUnits;
+ }
+
+ /**
+ * Set whether or not to enable dependency resolving for files added to the driver
+ */
+ virtual void setResolveDependencesEnabled( bool enabled );
+ /**
+ * Check if dependency resolving is enabled
+ * \return true if dependency resolving is enabled
+ * \return false if dependency resolving is disabled
+ */
+ bool isResolveDependencesEnabled() const {
+ return depresolv;
+ }
+
+ void setMaxDependenceDepth( int depth );
+
+ /**
+ * Used by the Lexer to indicate that a Macro was used
+ * @param macro The used macro
+ * */
+ void usingMacro( const Macro& macro );
+
+ /**
+ * Returns the local instance of the lexer-cache, can be used from outside to control the cache-behavior.
+ * */
+ LexerCache* lexerCache();
+
+ ///This uses getCustomIncludePath(..) to resolve the include-path internally
+ QString findIncludeFile( const Dependence& dep, const QString& fromFile );
+
+ protected:
+ ///This uses the state of the parser to find the include-file
+ QString findIncludeFile( const Dependence& dep ) const;
+
+ /**
+ * Set up the lexer.
+ */
+ virtual void setupLexer( Lexer* lexer );
+ /**
+ * Setup the parser
+ */
+ virtual void setupParser( Parser* parser );
+ /**
+ * Set up the preprocessor
+ */
+ virtual void setupPreProcessor();
+
+ /**
+ * Is code-information for this file already available? If false is returned, the file will be parsed.
+ * Code-model and static repository should be checked to find out whether the file is already available.
+ * This function is only used when dependency-resolving is activated.
+ * @arg file absolute path to the file
+ */
+ virtual bool shouldParseIncludedFile( const ParsedFilePointer& /*file*/ );
+
+ void clearMacros();
+
+ void clearParsedMacros();
+
+ private:
+ QMap<QString, Dependence>& findOrInsertDependenceList( const QString& fileName );
+ QValueList<Problem>& findOrInsertProblemList( const QString& fileName );
+
+
+ private:
+ QString m_currentFileName;
+ QString m_currentMasterFileName;
+ typedef QMap<QString, Dependence> DependenceMap;
+ typedef QMap< QString, DependenceMap> DependencesMap;
+ DependencesMap m_dependences;
+ MacroMap m_macros;
+ QMap< QString, QValueList<Problem> > m_problems;
+ QMap<QString, ParsedFilePointer> m_parsedUnits;
+ QStringList m_includePaths;
+ uint depresolv :
+ 1;
+ Lexer *lexer;
+ SourceProvider* m_sourceProvider;
+
+ ParsedFilePointer m_currentParsedFile;
+ CachedLexedFilePointer m_currentLexerCache;
+ LexerCache m_lexerCache;
+
+ int m_dependenceDepth;
+ int m_maxDependenceDepth;
+
+ class ParseHelper;
+ friend class ParseHelper;
+
+ private:
+ Driver( const Driver& source );
+ void operator = ( const Driver& source );
+};
+
+#endif
diff --git a/lib/cppparser/errors.cpp b/lib/cppparser/errors.cpp
new file mode 100644
index 00000000..154301c6
--- /dev/null
+++ b/lib/cppparser/errors.cpp
@@ -0,0 +1,25 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "errors.h"
+#include <klocale.h>
+
+QT_STATIC_CONST_IMPL Error& Errors::InternalError = Error( 1, -1, i18n("Internal Error") );
+QT_STATIC_CONST_IMPL Error& Errors::SyntaxError = Error( 2, -1, i18n("Syntax Error before '%1'") );
+QT_STATIC_CONST_IMPL Error& Errors::ParseError = Error( 3, -1, i18n("Parse Error before '%1'") );
diff --git a/lib/cppparser/errors.h b/lib/cppparser/errors.h
new file mode 100644
index 00000000..f846533d
--- /dev/null
+++ b/lib/cppparser/errors.h
@@ -0,0 +1,45 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef ERRORS_H
+#define ERRORS_H
+
+#include <qstring.h>
+
+
+struct Error{
+ int code;
+ int level;
+ QString text;
+
+ Error( int c, int l, const QString& s )
+ : code( c ), level( l ), text( s )
+ {}
+};
+
+class Errors{
+public:
+ QT_STATIC_CONST Error& InternalError;
+ QT_STATIC_CONST Error& SyntaxError;
+ QT_STATIC_CONST Error& ParseError;
+};
+
+
+
+#endif
diff --git a/lib/cppparser/keywords.h b/lib/cppparser/keywords.h
new file mode 100644
index 00000000..e649a5a9
--- /dev/null
+++ b/lib/cppparser/keywords.h
@@ -0,0 +1,95 @@
+//
+// Keywords file is included in lookup.cpp
+// [erbsland] replacement for old hash table
+//
+#define INSERT( x, y ) keywords.insert( std::pair<HashedString, Type>( x, y ) )
+// KDE Keywords
+INSERT( "K_DCOP", Token_K_DCOP );
+INSERT( "k_dcop", Token_k_dcop );
+INSERT( "k_dcop_signals", Token_k_dcop_signals );
+
+// Qt Keywords
+INSERT( "Q_OBJECT", Token_Q_OBJECT );
+INSERT( "signals", Token_signals );
+INSERT( "slots", Token_slots );
+INSERT( "emit", Token_emit );
+INSERT( "foreach", Token_foreach );
+
+// C++ Keywords
+INSERT( "__int64", Token_int );
+INSERT( "__asm__", Token_asm );
+INSERT( "and", Token_and );
+INSERT( "and_eq", Token_and_eq );
+INSERT( "asm", Token_asm );
+INSERT( "auto", Token_auto );
+INSERT( "bitand", Token_bitand );
+INSERT( "bitor", Token_bitor );
+INSERT( "bool", Token_bool );
+INSERT( "break", Token_break );
+INSERT( "case", Token_case );
+INSERT( "catch", Token_catch );
+INSERT( "char", Token_char );
+INSERT( "class", Token_class );
+INSERT( "compl", Token_compl );
+INSERT( "const", Token_const );
+INSERT( "const_cast", Token_const_cast );
+INSERT( "continue", Token_continue );
+INSERT( "default", Token_default );
+INSERT( "delete", Token_delete );
+INSERT( "do", Token_do );
+INSERT( "double", Token_double );
+INSERT( "dynamic_cast", Token_dynamic_cast );
+INSERT( "else", Token_else );
+INSERT( "enum", Token_enum );
+INSERT( "explicit", Token_explicit );
+INSERT( "export", Token_export );
+INSERT( "extern", Token_extern );
+INSERT( "float", Token_float );
+INSERT( "for", Token_for );
+INSERT( "friend", Token_friend );
+INSERT( "goto", Token_goto );
+INSERT( "if", Token_if );
+INSERT( "inline", Token_inline );
+INSERT( "int", Token_int );
+INSERT( "long", Token_long );
+INSERT( "mutable", Token_mutable );
+INSERT( "namespace", Token_namespace );
+INSERT( "new", Token_new );
+INSERT( "not", Token_not );
+INSERT( "not_eq", Token_not_eq );
+INSERT( "operator", Token_operator );
+INSERT( "or", Token_or );
+INSERT( "or_eq", Token_or_eq );
+INSERT( "private", Token_private );
+INSERT( "protected", Token_protected );
+INSERT( "public", Token_public );
+INSERT( "register", Token_register );
+INSERT( "reinterpret_cast", Token_reinterpret_cast );
+INSERT( "return", Token_return );
+INSERT( "short", Token_short );
+INSERT( "signed", Token_signed );
+INSERT( "sizeof", Token_sizeof );
+INSERT( "static", Token_static );
+INSERT( "static_cast", Token_static_cast );
+INSERT( "struct", Token_struct );
+INSERT( "switch", Token_switch );
+INSERT( "template", Token_template );
+INSERT( "this", Token_this );
+INSERT( "throw", Token_throw );
+INSERT( "try", Token_try );
+INSERT( "typedef", Token_typedef );
+INSERT( "typeid", Token_typeid );
+INSERT( "typename", Token_typename );
+INSERT( "union", Token_union );
+INSERT( "unsigned", Token_unsigned );
+INSERT( "using", Token_using );
+INSERT( "virtual", Token_virtual );
+INSERT( "void", Token_void );
+INSERT( "volatile", Token_volatile );
+INSERT( "while", Token_while );
+INSERT( "xor", Token_xor );
+INSERT( "xor_eq", Token_xor_eq );
+
+//
+// End of file
+//
diff --git a/lib/cppparser/lexer.cpp b/lib/cppparser/lexer.cpp
new file mode 100644
index 00000000..972b0bad
--- /dev/null
+++ b/lib/cppparser/lexer.cpp
@@ -0,0 +1,1032 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "lexer.h"
+#include "lookup.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+
+#include <qregexp.h>
+#include <qmap.h>
+#include <qvaluelist.h>
+
+#if defined( KDEVELOP_BGPARSER )
+#include <qthread.h>
+
+class KDevTread: public QThread
+{
+public:
+ static void yield()
+ {
+ msleep( 0 );
+ }
+};
+
+inline void qthread_yield()
+{
+ KDevTread::yield();
+}
+
+#endif
+
+#define CREATE_TOKEN(type, start, len) Token( (type), (start), (len), m_source )
+#define ADD_TOKEN(tk) m_tokens.insert( m_size++, new Token(tk) );
+
+using namespace std;
+
+struct LexerData
+{
+ typedef QMap<QString, QString> Scope;
+ typedef QValueList<Scope> StaticChain;
+
+ StaticChain staticChain;
+
+ void beginScope()
+ {
+ Scope scope;
+ staticChain.push_front( scope );
+ }
+
+ void endScope()
+ {
+ staticChain.pop_front();
+ }
+
+ void bind( const QString& name, const QString& value )
+ {
+ Q_ASSERT( staticChain.size() > 0 );
+ staticChain.front().insert( name, value );
+ }
+
+ bool hasBind( const QString& name ) const
+ {
+ StaticChain::ConstIterator it = staticChain.begin();
+ while( it != staticChain.end() ){
+ const Scope& scope = *it;
+ ++it;
+
+ if( scope.contains(name) )
+ return true;
+ }
+
+ return false;
+ }
+
+ QString apply( const QString& name ) const
+ {
+ StaticChain::ConstIterator it = staticChain.begin();
+ while( it != staticChain.end() ){
+ const Scope& scope = *it;
+ ++it;
+
+ if( scope.contains(name) )
+ return scope[ name ];
+ }
+
+ return QString::null;
+ }
+
+};
+
+Lexer::Lexer( Driver* driver )
+ : d( new LexerData),
+ m_driver( driver ),
+ m_recordComments( true ),
+ m_recordWhiteSpaces( false ),
+ m_skipWordsEnabled( true ),
+ m_preprocessorEnabled( true ),
+ m_reportWarnings( false ),
+ m_reportMessages( false )
+{
+ m_tokens.setAutoDelete( true );
+ reset();
+ d->beginScope();
+}
+
+Lexer::~Lexer()
+{
+ d->endScope();
+ delete( d );
+}
+
+void Lexer::setSource( const QString& source )
+{
+ reset();
+ m_source = source;
+ m_ptr = offset( 0 );
+ m_endPtr = offset( m_source.length() );
+ m_inPreproc = false;
+ if( !source.isEmpty() ) {
+ m_currentChar = m_source[0];
+ } else {
+ m_currentChar = QChar::null;
+ }
+
+ tokenize();
+}
+
+int Lexer::skippedLines() const {
+ return m_skippedLines;
+}
+
+void Lexer::reset()
+{
+ m_skippedLines = 0;
+ m_index = 0;
+ m_size = 0;
+ m_tokens.clear();
+ m_source = QString::null;
+ m_ptr = 0;
+ m_endPtr = 0;
+ m_startLine = false;
+ m_ifLevel = 0;
+ m_skipping.resize( 200 );
+ m_skipping.fill( 0 );
+ m_trueTest.resize( 200 );
+ m_trueTest.fill( 0 );
+
+ m_currentLine = 0;
+ m_currentColumn = 0;
+}
+
+// ### should all be done with a "long" type IMO
+int Lexer::toInt( const Token& token )
+{
+ QString s = token.text();
+ if( token.type() == Token_number_literal ){
+ // hex literal ?
+ if( s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
+ return s.mid( 2 ).toInt( 0, 16 );
+ QString n;
+ int i = 0;
+ while( i < int(s.length()) && s[i].isDigit() )
+ n += s[i++];
+ // ### respect more prefixes and suffixes ?
+ return n.toInt();
+ } else if( token.type() == Token_char_literal ){
+ int i = s[0] == 'L' ? 2 : 1; // wide char ?
+ if( s[i] == '\\' ){
+ // escaped char
+ int c = s[i+1].unicode();
+ switch( c ) {
+ case '0':
+ return 0;
+ case 'n':
+ return '\n';
+ // ### more
+ default:
+ return c;
+ }
+ } else {
+ return s[i].unicode();
+ }
+ } else {
+ return 0;
+ }
+}
+
+void Lexer::getTokenPosition( const Token& token, int* line, int* col )
+{
+ token.getStartPosition( line, col );
+}
+
+void Lexer::nextToken( Token& tk, bool stopOnNewline )
+{
+ int op = 0;
+
+ if( m_size == (int)m_tokens.size() ){
+ m_tokens.resize( m_tokens.size() + 5000 + 1 );
+ }
+
+ readWhiteSpaces( !stopOnNewline );
+
+ int startLine = m_currentLine;
+ int startColumn = m_currentColumn;
+
+ QChar ch = currentChar();
+ QChar ch1 = peekChar();
+
+ if( ch.isNull() || ch.isSpace() ){
+ /* skip */
+ } else if( m_startLine && ch == '#' ){
+
+ nextChar(); // skip #
+ readWhiteSpaces( false ); // skip white spaces
+ m_startLine = false;
+
+ int start = currentPosition();
+ readIdentifier(); // read the directive
+ QString directive = m_source.mid( start, currentPosition() - start );
+
+ handleDirective( directive );
+ } else if( m_startLine && m_skipping[ m_ifLevel ] ){
+ // skip line and continue
+ m_startLine = false;
+ int ppe = preprocessorEnabled();
+ setPreprocessorEnabled( false );
+ while( !currentChar().isNull() && currentChar() != '\n' ){
+ Token tok(m_source);
+ nextToken( tok, true );
+ }
+ ++m_skippedLines;
+ m_startLine = true;
+ setPreprocessorEnabled( ppe );
+ return;
+ } else if( ch == '/' && ch1 == '/' ){
+ int start = currentPosition();
+ readLineComment();
+ if( recordComments() ){
+ tk = CREATE_TOKEN( Token_comment, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ }
+ } else if( ch == '/' && ch1 == '*' ){
+ int start = currentPosition();
+ nextChar( 2 );
+ readMultiLineComment();
+
+ if( recordComments() ){
+ tk = CREATE_TOKEN( Token_comment, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ }
+ } else if( ch == '\'' || (ch == 'L' && ch1 == '\'') ){
+ int start = currentPosition();
+ readCharLiteral();
+ tk = CREATE_TOKEN( Token_char_literal, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else if( ch == '"' ){
+ int start = currentPosition();
+ readStringLiteral();
+ tk = CREATE_TOKEN( Token_string_literal, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else if( ch.isLetter() || ch == '_' ){
+ int start = currentPosition();
+ readIdentifier();
+ HashedString ide = m_source.mid( start, currentPosition() - start );
+ int k = Lookup::find( ide );
+ if( k == -1 && m_preprocessorEnabled ) m_driver->usingString( ide );
+
+ if( m_preprocessorEnabled && m_driver->hasMacro(ide) &&
+ (k == -1 || !m_driver->macro(ide).body().isEmpty()) ){
+
+
+ bool preproc = m_preprocessorEnabled;
+ m_preprocessorEnabled = false;
+
+ d->beginScope();
+
+ int svLine = currentLine();
+ int svColumn = currentColumn();
+
+ Macro m = m_driver->macro( ide );
+ m_driver->usingMacro( m );
+
+ QString ellipsisArg;
+
+ if( m.hasArguments() ){
+ int endIde = currentPosition();
+
+ readWhiteSpaces();
+ if( currentChar() == '(' ){
+ nextChar();
+ int argIdx = 0;
+ int argCount = m.argumentList().size();
+ while( currentChar() && argIdx<argCount ){
+ readWhiteSpaces();
+
+ QString argName = m.argumentList()[ argIdx ];
+
+ bool ellipsis = argName == "...";
+
+ QString arg = readArgument();
+
+ if( !ellipsis )
+ d->bind( argName, arg );
+ else
+ ellipsisArg += arg;
+
+ if( currentChar() == ',' ){
+ nextChar();
+ if( !ellipsis ){
+ ++argIdx;
+ } else {
+ ellipsisArg += ", ";
+ }
+ } else if( currentChar() == ')' ){
+ break;
+ }
+ }
+ if( currentChar() == ')' ){
+ // valid macro
+ nextChar();
+ }
+ } else {
+ tk = CREATE_TOKEN( Token_identifier, start, endIde - start );
+ tk.setStartPosition( svLine, svColumn );
+ tk.setEndPosition( svLine, svColumn + (endIde - start) );
+
+ m_startLine = false;
+
+ d->endScope(); // OPS!!
+ m_preprocessorEnabled = preproc;
+ return;
+ }
+ }
+
+ int argsEndAtLine = currentLine();
+ int argsEndAtColumn = currentColumn();
+
+#if defined( KDEVELOP_BGPARSER )
+ qthread_yield();
+#endif
+ insertCurrent( m.body() );
+
+ // tokenize the macro body
+
+ QString textToInsert;
+
+ setEndPtr( offset( currentPosition() + m.body().length() ) );
+
+ while( currentChar() ){
+
+ readWhiteSpaces();
+
+ Token tok(m_source);
+ nextToken( tok );
+
+ bool stringify = !m_inPreproc && tok == '#';
+ bool merge = !m_inPreproc && tok == Token_concat;
+
+ if( stringify || merge )
+ nextToken( tok );
+
+ if( tok == Token_eof )
+ break;
+
+ QString tokText = tok.text();
+ HashedString str = (tok == Token_identifier && d->hasBind(tokText)) ? d->apply( tokText ) : tokText;
+ if( str == ide ){
+ //Problem p( i18n("unsafe use of macro '%1', macro is ignored").arg(ide.str()), m_currentLine, m_currentColumn, Problem::Level_Warning );
+ //m_driver->addProblem( m_driver->currentFileName(), p );
+ m_driver->removeMacro( ide );
+ // str = QString::null;
+ }
+
+ if( stringify ) {
+ textToInsert.append( QString::fromLatin1("\"") + str.str() + QString::fromLatin1("\" ") );
+ } else if( merge ){
+ textToInsert.truncate( textToInsert.length() - 1 );
+ textToInsert.append( str.str() + QString::fromLatin1(" ") );
+ } else if( tok == Token_ellipsis && d->hasBind("...") ){
+ textToInsert.append( ellipsisArg );
+ } else {
+ textToInsert.append( str.str() + QString::fromLatin1(" ") );
+ }
+ }
+
+#if defined( KDEVELOP_BGPARSER )
+ qthread_yield();
+#endif
+ insertCurrent( textToInsert ); //also corrects the end-pointer
+
+ d->endScope();
+ m_preprocessorEnabled = preproc;
+ //m_driver->addMacro( m );
+ m_currentLine = argsEndAtLine;
+ m_currentColumn = argsEndAtColumn;
+ } else if( k != -1 ){
+ tk = CREATE_TOKEN( k, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else if( m_skipWordsEnabled ){
+ __gnu_cxx::hash_map< HashedString, QPair<SkipType, QString> >::iterator pos = m_words.find( ide );
+ if( pos != m_words.end() ){
+ if( (*pos).second.first == SkipWordAndArguments ){
+ readWhiteSpaces();
+ if( currentChar() == '(' )
+ skip( '(', ')' );
+ }
+ if( !(*pos).second.second.isEmpty() ){
+#if defined( KDEVELOP_BGPARSER )
+ qthread_yield();
+#endif
+ insertCurrent( QString(" ") + (*pos).second.second + QString(" ") );
+ }
+ } else if( /*qt_rx.exactMatch(ide) ||*/
+ ide.str().endsWith("EXPORT") ||
+ (ide.str().startsWith("Q_EXPORT") && ide.str() != "Q_EXPORT_INTERFACE") ||
+ ide.str().startsWith("QM_EXPORT") ||
+ ide.str().startsWith("QM_TEMPLATE")){
+
+ readWhiteSpaces();
+ if( currentChar() == '(' )
+ skip( '(', ')' );
+ } else if( ide.str().startsWith("K_TYPELIST_") || ide.str().startsWith("TYPELIST_") ){
+ tk = CREATE_TOKEN( Token_identifier, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ readWhiteSpaces();
+ if( currentChar() == '(' )
+ skip( '(', ')' );
+ } else{
+ tk = CREATE_TOKEN( Token_identifier, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ }
+ } else {
+ tk = CREATE_TOKEN( Token_identifier, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ }
+ } else if( ch.isNumber() ){
+ int start = currentPosition();
+ readNumberLiteral();
+ tk = CREATE_TOKEN( Token_number_literal, start, currentPosition() - start );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else if( -1 != (op = findOperator3()) ){
+ tk = CREATE_TOKEN( op, currentPosition(), 3 );
+ nextChar( 3 );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else if( -1 != (op = findOperator2()) ){
+ tk = CREATE_TOKEN( op, currentPosition(), 2 );
+ nextChar( 2 );
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ } else {
+ tk = CREATE_TOKEN( ch, currentPosition(), 1 );
+ nextChar();
+ tk.setStartPosition( startLine, startColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ }
+
+ m_startLine = false;
+}
+
+
+void Lexer::tokenize()
+{
+ m_startLine = true;
+ m_size = 0;
+
+ for( ;; ) {
+ Token tk(m_source);
+ nextToken( tk );
+
+ if( tk.type() != -1 )
+ ADD_TOKEN( tk );
+
+ if( currentChar().isNull() )
+ break;
+ }
+
+ Token tk = CREATE_TOKEN( Token_eof, currentPosition(), 0 );
+ tk.setStartPosition( m_currentLine, m_currentColumn );
+ tk.setEndPosition( m_currentLine, m_currentColumn );
+ ADD_TOKEN( tk );
+}
+
+void Lexer::resetSkipWords()
+{
+ m_words.clear();
+}
+
+void Lexer::addSkipWord( const QString& word, SkipType skipType, const QString& str )
+{
+ m_words[ word ] = qMakePair( skipType, str );
+}
+
+void Lexer::skip( int l, int r )
+{
+ int svCurrentLine = m_currentLine;
+ int svCurrentColumn = m_currentColumn;
+
+ int count = 0;
+
+ while( !eof() ){
+ Token tk(m_source);
+ nextToken( tk );
+
+ if( (int)tk == l )
+ ++count;
+ else if( (int)tk == r )
+ --count;
+
+ if( count == 0 )
+ break;
+ }
+
+ m_currentLine = svCurrentLine;
+ m_currentColumn = svCurrentColumn;
+}
+
+QString Lexer::readArgument()
+{
+ int count = 0;
+
+ QString arg;
+
+ readWhiteSpaces();
+ while( currentChar() ){
+
+ readWhiteSpaces();
+ QChar ch = currentChar();
+
+ if( ch.isNull() || (!count && (ch == ',' || ch == ')')) )
+ break;
+
+ Token tk(m_source);
+ nextToken( tk );
+
+ if( tk == '(' ){
+ ++count;
+ } else if( tk == ')' ){
+ --count;
+ }
+
+ if( tk != -1 )
+ arg += tk.text() + " ";
+ }
+
+ return arg.stripWhiteSpace();
+}
+
+void Lexer::handleDirective( const QString& directive )
+{
+ m_inPreproc = true;
+
+ bool skip = skipWordsEnabled();
+ bool preproc = preprocessorEnabled();
+
+ setSkipWordsEnabled( false );
+ setPreprocessorEnabled( false );
+
+ if( directive == "define" ){
+ if( !m_skipping[ m_ifLevel ] ){
+ Macro m;
+ processDefine( m );
+ }
+ } else if( directive == "else" ){
+ processElse();
+ } else if( directive == "elif" ){
+ processElif();
+ } else if( directive == "endif" ){
+ processEndif();
+ } else if( directive == "if" ){
+ processIf();
+ } else if( directive == "ifdef" ){
+ processIfdef();
+ } else if( directive == "ifndef" ){
+ processIfndef();
+ } else if( directive == "include" ){
+ if( !m_skipping[ m_ifLevel ] ){
+ processInclude();
+ }
+ } else if( directive == "undef" ){
+ if( !m_skipping[ m_ifLevel ] ){
+ processUndef();
+ }
+ }
+
+ // skip line
+ while( currentChar() && currentChar() != '\n' ){
+ Token tk(m_source);
+ nextToken( tk, true );
+ }
+
+ setSkipWordsEnabled( skip );
+ setPreprocessorEnabled( preproc );
+
+ m_inPreproc = false;
+}
+
+int Lexer::testIfLevel()
+{
+ int rtn = !m_skipping[ m_ifLevel++ ];
+ m_skipping[ m_ifLevel ] = m_skipping[ m_ifLevel - 1 ];
+ return rtn;
+}
+
+int Lexer::macroDefined()
+{
+ readWhiteSpaces( false );
+ int startWord = currentPosition();
+ readIdentifier();
+ HashedString word = m_source.mid( startWord, currentPosition() - startWord );
+ m_driver->usingString( word );
+ bool r = m_driver->hasMacro( word );
+
+ if( r ) m_driver->usingMacro( m_driver->macro( word ) );
+
+ return r;
+}
+
+void Lexer::processDefine( Macro& m )
+{
+ m.setFileName( m_driver->currentFileName() );
+ m.setLine( m_currentLine );
+ m.setColumn( m_currentColumn );
+ readWhiteSpaces( false );
+
+ int startMacroName = currentPosition();
+ readIdentifier();
+ QString macroName = m_source.mid( startMacroName, int(currentPosition()-startMacroName) );
+ m.setName( macroName );
+
+ if( currentChar() == '(' ){
+ m.setHasArguments( true );
+ nextChar();
+
+ readWhiteSpaces( false );
+
+ while( currentChar() && currentChar() != ')' ){
+ readWhiteSpaces( false );
+
+ int startArg = currentPosition();
+
+ if( currentChar() == '.' && peekChar() == '.' && peekChar(2) == '.' )
+ nextChar( 3 );
+ else
+ readIdentifier();
+
+ QString arg = m_source.mid( startArg, int(currentPosition()-startArg) );
+
+ m.addArgument( Macro::Argument(arg) );
+
+ readWhiteSpaces( false );
+ if( currentChar() != ',' )
+ break;
+
+ nextChar(); // skip ','
+ }
+
+ if( currentChar() == ')' )
+ nextChar(); // skip ')'
+ }
+
+ setPreprocessorEnabled( true );
+
+ QString body;
+ while( currentChar() && currentChar() != '\n' ){
+
+ if( currentChar().isSpace() ){
+ readWhiteSpaces( false );
+ body += " ";
+ } else {
+
+ Token tk(m_source);
+ nextToken( tk, true );
+
+ //Do not ignore c-style comments, those may be useful in the body, and ignoring them using this check causes problems
+ if( tk.type() != -1 && (tk.type() != Token_comment || ( tk.text().length() >= 2 && tk.text()[1] == '*') ) ){
+ QString s = tk.text();
+ body += s;
+ }
+ }
+ }
+
+ m.setBody( body );
+ m_driver->addMacro( m );
+}
+
+void Lexer::processElse()
+{
+ if( m_ifLevel == 0 )
+ /// @todo report error
+ return;
+
+ if( m_ifLevel > 0 && m_skipping[m_ifLevel-1] )
+ m_skipping[ m_ifLevel ] = m_skipping[ m_ifLevel - 1 ];
+ else
+ m_skipping[ m_ifLevel ] = m_trueTest[ m_ifLevel ];
+}
+
+void Lexer::processElif()
+{
+ if( m_ifLevel == 0 )
+ /// @todo report error
+ return;
+
+ if( !m_trueTest[m_ifLevel] ){
+ /// @todo implement the correct semantic for elif!!
+ bool inSkip = m_ifLevel > 0 && m_skipping[ m_ifLevel-1 ];
+ m_trueTest[ m_ifLevel ] = macroExpression() != 0;
+ m_skipping[ m_ifLevel ] = inSkip ? inSkip : !m_trueTest[ m_ifLevel ];
+ }
+ else
+ m_skipping[ m_ifLevel ] = true;
+}
+
+void Lexer::processEndif()
+{
+ if( m_ifLevel == 0 )
+ /// @todo report error
+ return;
+
+ m_skipping[ m_ifLevel ] = 0;
+ m_trueTest[ m_ifLevel-- ] = 0;
+}
+
+void Lexer::processIf()
+{
+ bool inSkip = m_skipping[ m_ifLevel ];
+
+ if( testIfLevel() ) {
+#if 0
+ int n;
+ if( (n = testDefined()) != 0 ) {
+ int isdef = macroDefined();
+ m_trueTest[ m_ifLevel ] = (n == 1 && isdef) || (n == -1 && !isdef);
+ } else
+#endif
+ m_trueTest[ m_ifLevel ] = macroExpression() != 0;
+ m_skipping[ m_ifLevel ] = inSkip ? inSkip : !m_trueTest[ m_ifLevel ];
+ }
+}
+
+void Lexer::processIfdef()
+{
+ bool inSkip = m_skipping[ m_ifLevel ];
+
+ if( testIfLevel() ){
+ m_trueTest[ m_ifLevel ] = macroDefined();
+ m_skipping[ m_ifLevel ] = inSkip ? inSkip : !m_trueTest[ m_ifLevel ];
+ }
+}
+
+void Lexer::processIfndef()
+{
+ bool inSkip = m_skipping[ m_ifLevel ];
+
+ if( testIfLevel() ){
+ m_trueTest[ m_ifLevel ] = !macroDefined();
+ m_skipping[ m_ifLevel ] = inSkip ? inSkip : !m_trueTest[ m_ifLevel ];
+ }
+}
+
+void Lexer::processInclude()
+{
+ if( m_skipping[m_ifLevel] )
+ return;
+
+ readWhiteSpaces( false );
+ if( currentChar() ){
+ QChar ch = currentChar();
+ if( ch == '"' || ch == '<' ){
+ nextChar();
+ QChar ch2 = ch == QChar('"') ? QChar('"') : QChar('>');
+
+ int startWord = currentPosition();
+ while( currentChar() && currentChar() != ch2 )
+ nextChar();
+ if( currentChar() ){
+ QString word = m_source.mid( startWord, int(currentPosition()-startWord) );
+ m_driver->addDependence( m_driver->currentFileName(),
+ Dependence(word, ch == '"' ? Dep_Local : Dep_Global) );
+ nextChar();
+ }
+ }
+ }
+}
+
+void Lexer::processUndef()
+{
+ readWhiteSpaces();
+ int startWord = currentPosition();
+ readIdentifier();
+ QString word = m_source.mid( startWord, currentPosition() - startWord );
+
+ Macro m( word, "" );
+ m.setFileName( m_driver->currentFileName() );
+ m.setUndef();
+
+ ///Adds an undef-macro that shadows the previous macro
+ m_driver->addMacro( m );
+}
+
+int Lexer::macroPrimary()
+{
+ readWhiteSpaces( false );
+ int result = 0;
+ switch( currentChar() ) {
+ case '(':
+ nextChar();
+ result = macroExpression();
+ if( currentChar() != ')' ){
+ /// @todo report error
+ return 0;
+ }
+ nextChar();
+ return result;
+
+ case '+':
+ case '-':
+ case '!':
+ case '~':
+ {
+ QChar tk = currentChar();
+ nextChar();
+ int result = macroPrimary();
+ if( tk == '-' ) return -result;
+ else if( tk == '!' ) return !result;
+ else if( tk == '~' ) return ~result;
+ }
+ break;
+
+ default:
+ {
+ Token tk(m_source);
+ nextToken( tk, false );
+ switch( tk.type() ){
+ case Token_identifier:
+ if( tk.text() == "defined" ){
+ return macroPrimary();
+ }
+ /// @todo implement
+ {
+ HashedString h( tk.text() );
+ m_driver->usingString( h );
+ if( m_driver->hasMacro( h ) ) {
+ m_driver->usingMacro( m_driver->macro( h ) );
+ return true;
+ } else {
+ return false;
+ }
+ }
+ case Token_number_literal:
+ case Token_char_literal:
+ return toInt( tk );
+ default:
+ break;
+ } // end switch
+
+ } // end default
+
+ } // end switch
+
+ return 0;
+}
+
+int Lexer::macroMultiplyDivide()
+{
+ int result = macroPrimary();
+ int iresult, op;
+ for (;;) {
+ readWhiteSpaces( false );
+ if( currentChar() == '*' )
+ op = 0;
+ else if( currentChar() == '/' && !(peekChar() == '*' || peekChar() == '/') )
+ op = 1;
+ else if( currentChar() == '%' )
+ op = 2;
+ else
+ break;
+ nextChar();
+ iresult = macroPrimary();
+ result = op == 0 ? (result * iresult) :
+ op == 1 ? (iresult == 0 ? 0 : (result / iresult)) :
+ (iresult == 0 ? 0 : (result % iresult)) ;
+ }
+ return result;
+}
+
+int Lexer::macroAddSubtract()
+{
+ int result = macroMultiplyDivide();
+ int iresult, ad;
+ readWhiteSpaces( false );
+ while( currentChar() == '+' || currentChar() == '-') {
+ ad = currentChar() == '+';
+ nextChar();
+ iresult = macroMultiplyDivide();
+ result = ad ? (result+iresult) : (result-iresult);
+ }
+ return result;
+}
+
+int Lexer::macroRelational()
+{
+ int result = macroAddSubtract();
+ int iresult;
+ readWhiteSpaces( false );
+ while( currentChar() == '<' || currentChar() == '>') {
+ int lt = currentChar() == '<';
+ nextChar();
+ if( currentChar() == '=') {
+ nextChar();
+
+ iresult = macroAddSubtract();
+ result = lt ? (result <= iresult) : (result >= iresult);
+ }
+ else {
+ iresult = macroAddSubtract();
+ result = lt ? (result < iresult) : (result > iresult);
+ }
+ }
+
+ return result;
+}
+
+int Lexer::macroEquality()
+{
+ int result = macroRelational();
+ int iresult, eq;
+ readWhiteSpaces( false );
+ while ((currentChar() == '=' || currentChar() == '!') && peekChar() == '=') {
+ eq = currentChar() == '=';
+ nextChar( 2 );
+ iresult = macroRelational();
+ result = eq ? (result==iresult) : (result!=iresult);
+ }
+ return result;
+}
+
+int Lexer::macroBoolAnd()
+{
+ int result = macroEquality();
+ readWhiteSpaces( false );
+ while( currentChar() == '&' && peekChar() != '&') {
+ nextChar();
+ result &= macroEquality();
+ }
+ return result;
+}
+
+int Lexer::macroBoolXor()
+{
+ int result = macroBoolAnd();
+ readWhiteSpaces( false );
+ while( currentChar() == '^') {
+ nextChar();
+ result ^= macroBoolAnd();
+ }
+ return result;
+}
+
+int Lexer::macroBoolOr()
+{
+ int result = macroBoolXor();
+ readWhiteSpaces( false );
+ while( currentChar() == '|' && peekChar() != '|') {
+ nextChar();
+ result |= macroBoolXor();
+ }
+ return result;
+}
+
+int Lexer::macroLogicalAnd()
+{
+ int result = macroBoolOr();
+ readWhiteSpaces( false );
+ while( currentChar() == '&' && peekChar() == '&') {
+ nextChar( 2 );
+ int start = currentPosition();
+ result = macroBoolOr() && result;
+ QString s = m_source.mid( start, currentPosition() - start );
+ }
+ return result;
+}
+
+int Lexer::macroLogicalOr()
+{
+ int result = macroLogicalAnd();
+ readWhiteSpaces( false );
+ while( currentChar() == '|' && peekChar() == '|') {
+ nextChar( 2 );
+ result = macroLogicalAnd() || result;
+ }
+ return result;
+}
+
+int Lexer::macroExpression()
+{
+ readWhiteSpaces( false );
+ return macroLogicalOr();
+}
+
+// *IMPORTANT*
+// please, don't include lexer.moc here, because Lexer isn't a QObject class!!
+// if you have problem while recompiling try to remove cppsupport/.deps,
+// cppsupport/Makefile.in and rerun automake/autoconf
+
diff --git a/lib/cppparser/lexer.h b/lib/cppparser/lexer.h
new file mode 100644
index 00000000..8b3f57ed
--- /dev/null
+++ b/lib/cppparser/lexer.h
@@ -0,0 +1,867 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef LEXER_H
+#define LEXER_H
+
+#include "driver.h"
+
+#include <qstring.h>
+#include <qmap.h>
+#include <qvaluestack.h>
+#include <qpair.h>
+#include <qptrvector.h>
+#include <hashedstring.h>
+#include <ext/hash_map>
+
+#define CHARTYPE QChar
+
+enum Type {
+ Token_eof = 0,
+ Token_identifier = 1000,
+ Token_number_literal,
+ Token_char_literal,
+ Token_string_literal,
+ Token_whitespaces,
+ Token_comment,
+ Token_preproc,
+
+ Token_assign = 2000,
+ Token_ptrmem,
+ Token_ellipsis,
+ Token_scope,
+ Token_shift,
+ Token_eq,
+ Token_leq,
+ Token_geq,
+ Token_incr,
+ Token_decr,
+ Token_arrow,
+
+ Token_concat,
+
+ Token_K_DCOP,
+ Token_k_dcop,
+ Token_k_dcop_signals,
+
+ Token_Q_OBJECT,
+ Token_signals,
+ Token_slots,
+ Token_emit,
+ Token_foreach, // qt4 [erbsland]
+
+ Token_and,
+ Token_and_eq,
+ Token_asm,
+ Token_auto,
+ Token_bitand,
+ Token_bitor,
+ Token_bool,
+ Token_break,
+ Token_case,
+ Token_catch,
+ Token_char,
+ Token_class,
+ Token_compl,
+ Token_const,
+ Token_const_cast,
+ Token_continue,
+ Token_default,
+ Token_delete,
+ Token_do,
+ Token_double,
+ Token_dynamic_cast,
+ Token_else,
+ Token_enum,
+ Token_explicit,
+ Token_export,
+ Token_extern,
+ Token_false,
+ Token_float,
+ Token_for,
+ Token_friend,
+ Token_goto,
+ Token_if,
+ Token_inline,
+ Token_int,
+ Token_long,
+ Token_mutable,
+ Token_namespace,
+ Token_new,
+ Token_not,
+ Token_not_eq,
+ Token_operator,
+ Token_or,
+ Token_or_eq,
+ Token_private,
+ Token_protected,
+ Token_public,
+ Token_register,
+ Token_reinterpret_cast,
+ Token_return,
+ Token_short,
+ Token_signed,
+ Token_sizeof,
+ Token_static,
+ Token_static_cast,
+ Token_struct,
+ Token_switch,
+ Token_template,
+ Token_this,
+ Token_throw,
+ Token_true,
+ Token_try,
+ Token_typedef,
+ Token_typeid,
+ Token_typename,
+ Token_union,
+ Token_unsigned,
+ Token_using,
+ Token_virtual,
+ Token_void,
+ Token_volatile,
+ Token_wchar_t,
+ Token_while,
+ Token_xor,
+ Token_xor_eq
+};
+
+enum SkipType {
+ SkipWord,
+ SkipWordAndArguments
+};
+
+struct LexerData;
+
+class Token
+{
+ Token(const QString &);
+ Token( int type, int position, int length, const QString& text );
+ Token( const Token& source );
+
+ Token& operator = ( const Token& source );
+ bool operator == ( const Token& token ) const;
+ operator int () const;
+
+public:
+ bool isNull() const;
+
+ int type() const;
+ void setType( int type );
+
+ void getStartPosition( int* line, int* column ) const;
+ void setStartPosition( int line, int column );
+ void getEndPosition( int* line, int* column ) const;
+ void setEndPosition( int line, int column );
+
+ unsigned int length() const;
+ void setLength( unsigned int length );
+
+ int position() const;
+ void setPosition( int position );
+
+ QString text() const;
+
+private:
+ int m_type;
+ int m_position;
+ int m_length;
+ int m_startLine;
+ int m_startColumn;
+ int m_endLine;
+ int m_endColumn;
+ const QString & m_text;
+
+ friend class Lexer;
+ friend class Parser;
+}; // class Token
+
+class Lexer
+{
+public:
+ Lexer( Driver* driver );
+ ~Lexer();
+
+ bool recordComments() const;
+ void setRecordComments( bool record );
+
+ bool recordWhiteSpaces() const;
+ void setRecordWhiteSpaces( bool record );
+
+ bool reportWarnings() const;
+ void setReportWarnings( bool enable );
+
+ bool reportMessages() const;
+ void setReportMessages( bool enable );
+
+ bool skipWordsEnabled() const;
+ void setSkipWordsEnabled( bool enabled );
+
+ bool preprocessorEnabled() const;
+ void setPreprocessorEnabled( bool enabled );
+
+ void resetSkipWords();
+ void addSkipWord( const QString& word, SkipType skipType=SkipWord, const QString& str = QString::null );
+
+ QString source() const;
+ void setSource( const QString& source );
+
+ int index() const;
+ void setIndex( int index );
+
+ //returns the count of lines that wer skipped due to #ifdef's
+ int skippedLines() const;
+
+ void reset();
+
+ const Token& tokenAt( int position ) const;
+ const Token& nextToken();
+ const Token& lookAhead( int n ) const;
+
+ static int toInt( const Token& token );
+
+ int tokenPosition( const Token& token ) const;
+ void getTokenPosition( const Token& token, int* line, int* col );
+
+ int currentLine() const { return m_currentLine; }
+ int currentColumn() const { return m_currentColumn; }
+
+ inline const CHARTYPE* offset( int offset ) const {
+ return m_source.unicode() + offset;
+ }
+
+ inline int getOffset( const QChar* p ) const {
+ return int(p - (m_source.unicode()));
+ }
+
+private:
+ void setEndPtr( const QChar* c ) {
+ m_endPtr = c;
+ if( m_ptr < m_endPtr )
+ m_currentChar = *m_ptr;
+ else
+ m_currentChar = QChar::null;
+ }
+ const QChar currentChar() const;
+ QChar peekChar( int n=1 ) const;
+ int currentPosition() const;
+
+ void insertCurrent( const QString& str );
+
+ void tokenize();
+ void nextToken( Token& token, bool stopOnNewline=false );
+ void nextChar();
+ void nextChar( int n );
+ void skip( int l, int r );
+ void readIdentifier();
+ void readWhiteSpaces( bool skipNewLine=true, bool skipOnlyOnce=false );
+ void readLineComment();
+ void readMultiLineComment();
+ void readCharLiteral();
+ void readStringLiteral();
+ void readNumberLiteral();
+
+ int findOperator3() const;
+ int findOperator2() const;
+ bool eof() const;
+
+ // preprocessor (based on an article of Al Stevens on Dr.Dobb's journal)
+ int testIfLevel();
+ int macroDefined();
+ QString readArgument();
+
+ int macroPrimary();
+ int macroMultiplyDivide();
+ int macroAddSubtract();
+ int macroRelational();
+ int macroEquality();
+ int macroBoolAnd();
+ int macroBoolXor();
+ int macroBoolOr();
+ int macroLogicalAnd();
+ int macroLogicalOr();
+ int macroExpression();
+
+ void handleDirective( const QString& directive );
+ void processDefine( Macro& macro );
+ void processElse();
+ void processElif();
+ void processEndif();
+ void processIf();
+ void processIfdef();
+ void processIfndef();
+ void processInclude();
+ void processUndef();
+
+private:
+ LexerData* d;
+ Driver* m_driver;
+ QPtrVector< Token > m_tokens;
+ int m_size;
+ int m_index;
+ QString m_source;
+ const QChar* m_ptr;
+ const QChar* m_endPtr;
+ QChar m_currentChar;
+ bool m_recordComments;
+ bool m_recordWhiteSpaces;
+ bool m_startLine;
+ __gnu_cxx::hash_map< HashedString, QPair<SkipType, QString> > m_words;
+
+
+ int m_skippedLines;
+ int m_currentLine;
+ int m_currentColumn;
+ bool m_skipWordsEnabled;
+
+ // preprocessor
+ QMemArray<bool> m_skipping;
+ QMemArray<bool> m_trueTest;
+ int m_ifLevel;
+ bool m_preprocessorEnabled;
+ bool m_inPreproc;
+
+ bool m_reportWarnings;
+ bool m_reportMessages;
+
+private:
+ Lexer( const Lexer& source );
+ void operator = ( const Lexer& source );
+};
+
+
+inline Token::Token(const QString & text = "")
+ : m_type( -1 ),
+ m_position( 0 ),
+ m_length( 0 ),
+ m_text( text )
+{
+}
+
+inline Token::Token( int type, int position, int length, const QString& text )
+ : m_type( type ),
+ m_position( position ),
+ m_length( length ),
+ m_text( text )
+{
+}
+
+inline Token::Token( const Token& source )
+ : m_type( source.m_type ),
+ m_position( source.m_position ),
+ m_length( source.m_length ),
+ m_startLine( source.m_startLine ),
+ m_startColumn( source.m_startColumn ),
+ m_endLine( source.m_endLine ),
+ m_endColumn( source.m_endColumn ),
+ m_text( source.m_text )
+{
+}
+
+inline Token& Token::operator = ( const Token& source )
+{
+ m_type = source.m_type;
+ m_position = source.m_position;
+ m_length = source.m_length;
+ m_startLine = source.m_startLine;
+ m_startColumn = source.m_startColumn;
+ m_endLine = source.m_endLine;
+ m_endColumn = source.m_endColumn;
+// m_text = source.m_text;
+ return( *this );
+}
+
+inline Token::operator int () const
+{
+ return m_type;
+}
+
+inline bool Token::operator == ( const Token& token ) const
+{
+ return m_type == token.m_type &&
+ m_position == token.m_position &&
+ m_length == token.m_length &&
+ m_startLine == token.m_startLine &&
+ m_startColumn == token.m_startColumn &&
+ m_endLine == token.m_endLine &&
+ m_endColumn == token.m_endColumn &&
+ m_text == token.m_text;
+}
+
+inline bool Token::isNull() const
+{
+ return m_type == Token_eof || m_length == 0;
+}
+
+inline int Token::type() const
+{
+ return m_type;
+}
+
+inline void Token::setType( int type )
+{
+ m_type = type;
+}
+
+inline int Token::position() const
+{
+ return m_position;
+}
+
+inline QString Token::text() const
+{
+ return m_text.mid(m_position, m_length);
+}
+
+inline void Token::setStartPosition( int line, int column )
+{
+ m_startLine = line;
+ m_startColumn = column;
+}
+
+inline void Token::setEndPosition( int line, int column )
+{
+ m_endLine = line;
+ m_endColumn = column;
+}
+
+inline void Token::getStartPosition( int* line, int* column ) const
+{
+ if( line ) *line = m_startLine;
+ if( column ) *column = m_startColumn;
+}
+
+inline void Token::getEndPosition( int* line, int* column ) const
+{
+ if( line ) *line = m_endLine;
+ if( column ) *column = m_endColumn;
+}
+
+inline void Token::setPosition( int position )
+{
+ m_position = position;
+}
+
+inline unsigned int Token::length() const
+{
+ return m_length;
+}
+
+inline void Token::setLength( unsigned int length )
+{
+ m_length = length;
+}
+
+inline bool Lexer::recordComments() const
+{
+ return m_recordComments;
+}
+
+inline void Lexer::setRecordComments( bool record )
+{
+ m_recordComments = record;
+}
+
+inline bool Lexer::recordWhiteSpaces() const
+{
+ return m_recordWhiteSpaces;
+}
+
+inline void Lexer::setRecordWhiteSpaces( bool record )
+{
+ m_recordWhiteSpaces = record;
+}
+
+inline QString Lexer::source() const
+{
+ return m_source;
+}
+
+inline int Lexer::index() const
+{
+ return m_index;
+}
+
+inline void Lexer::setIndex( int index )
+{
+ m_index = index;
+}
+
+inline const Token& Lexer::nextToken()
+{
+ if( m_index < m_size )
+ return *m_tokens[ m_index++ ];
+
+ return *m_tokens[ m_index ];
+}
+
+inline const Token& Lexer::tokenAt( int n ) const
+{
+ return *m_tokens[ QMIN(n, m_size-1) ];
+}
+
+inline const Token& Lexer::lookAhead( int n ) const
+{
+ return *m_tokens[ QMIN(m_index + n, m_size-1) ];
+}
+
+inline int Lexer::tokenPosition( const Token& token ) const
+{
+ return token.position();
+}
+
+inline void Lexer::nextChar()
+{
+ if(*m_ptr == '\n') {
+ ++m_currentLine;
+ m_currentColumn = 0;
+ m_startLine = true;
+ } else {
+ ++m_currentColumn;
+ }
+ ++m_ptr;
+
+ if( m_ptr < m_endPtr )
+ m_currentChar = *m_ptr;
+ else
+ m_currentChar = QChar::null;
+}
+
+inline void Lexer::nextChar( int n )
+{
+ m_currentColumn += n;
+ m_ptr += n;
+
+ if( m_ptr < m_endPtr )
+ m_currentChar = *m_ptr;
+ else
+ m_currentChar = QChar::null;
+}
+
+inline void Lexer::readIdentifier()
+{
+ while( currentChar().isLetterOrNumber() || currentChar() == '_' )
+ nextChar();
+}
+
+inline void Lexer::readWhiteSpaces( bool skipNewLine, bool skipOnlyOnce )
+{
+ while( !currentChar().isNull() ){
+ QChar ch = currentChar();
+
+ if( ch == '\n' && !skipNewLine ){
+ break;
+ } else if( ch.isSpace() ){
+ nextChar();
+ } else if( m_inPreproc && currentChar() == '\\' ){
+ nextChar();
+ readWhiteSpaces( true, true );
+ } else {
+ break;
+ }
+ if( skipOnlyOnce && ch == '\n' ) {
+ skipNewLine = false;
+ }
+ }
+}
+
+//little hack for better performance
+inline bool isTodo( const QString& txt, int position ) {
+ if( txt.length() < position + 4 ) return false;
+ return (txt[ position ] == 't' || txt[ position ] == 'T')
+ && (txt[ position+1 ] == 'o' || txt[ position+1 ] == 'O')
+ && (txt[ position+2 ] == 'd' || txt[ position+2 ] == 'D')
+ && (txt[ position+3 ] == 'o' || txt[ position+3 ] == 'O');
+}
+
+inline bool isFixme( const QString& txt, int position ) {
+ if( txt.length() < position + 5 ) return false;
+ return (txt[ position ] == 'f' || txt[ position ] == 'F')
+ && (txt[ position+1 ] == 'i' || txt[ position+1 ] == 'I')
+ && (txt[ position+2 ] == 'x' || txt[ position+2 ] == 'X')
+ && (txt[ position+3 ] == 'm' || txt[ position+3 ] == 'M')
+ && (txt[ position+4 ] == 'e' || txt[ position+4 ] == 'E');
+}
+
+inline void Lexer::readLineComment()
+{
+ while( !currentChar().isNull() && currentChar() != '\n' ){
+ if( m_reportMessages && isTodo( m_source, currentPosition() ) ){
+ nextChar( 4 );
+ QString msg;
+ int line = m_currentLine;
+ int col = m_currentColumn;
+
+ while( currentChar() ){
+ if( currentChar() == '*' && peekChar() == '/' )
+ break;
+ else if( currentChar() == '\n' )
+ break;
+
+ msg += currentChar();
+ nextChar();
+ }
+ m_driver->addProblem( m_driver->currentFileName(), Problem(msg, line, col, Problem::Level_Todo) );
+ } else
+ if( m_reportMessages && isFixme( m_source, currentPosition() ) ){
+ nextChar( 5 );
+ QString msg;
+ int line = m_currentLine;
+ int col = m_currentColumn;
+
+ while( currentChar() ){
+ if( currentChar() == '*' && peekChar() == '/' )
+ break;
+ else if( currentChar() == '\n' )
+ break;
+
+ msg += currentChar();
+ nextChar();
+ }
+ m_driver->addProblem( m_driver->currentFileName(), Problem(msg, line, col, Problem::Level_Fixme) );
+ } else
+ nextChar();
+ }
+}
+
+inline void Lexer::readMultiLineComment()
+{
+ while( !currentChar().isNull() ){
+ if( currentChar() == '*' && peekChar() == '/' ){
+ nextChar( 2 );
+ return;
+ } else if( m_reportMessages && isTodo( m_source, currentPosition() ) ){
+ nextChar( 4 );
+ QString msg;
+ int line = m_currentLine;
+ int col = m_currentColumn;
+
+ while( currentChar() ){
+ if( currentChar() == '*' && peekChar() == '/' )
+ break;
+ else if( currentChar() == '\n' )
+ break;
+ msg += currentChar();
+ nextChar();
+ }
+ m_driver->addProblem( m_driver->currentFileName(), Problem(msg, line, col, Problem::Level_Todo) );
+ } else
+ if( m_reportMessages && isFixme( m_source, currentPosition() ) ) {
+ nextChar( 5 );
+ QString msg;
+ int line = m_currentLine;
+ int col = m_currentColumn;
+
+ while( currentChar() ){
+ if( currentChar() == '*' && peekChar() == '/' )
+ break;
+ else if( currentChar() == '\n' )
+ break;
+
+ msg += currentChar();
+ nextChar();
+ }
+ m_driver->addProblem( m_driver->currentFileName(), Problem(msg, line, col, Problem::Level_Fixme) );
+ } else
+ nextChar();
+ }
+}
+
+inline void Lexer::readCharLiteral()
+{
+ if( currentChar() == '\'' )
+ nextChar(); // skip '
+ else if( currentChar() == 'L' && peekChar() == '\'' )
+ nextChar( 2 ); // slip L'
+ else
+ return;
+
+ while( !currentChar().isNull() ){
+ int len = getOffset( m_endPtr ) - currentPosition();
+
+ if( len>=2 && (currentChar() == '\\' && peekChar() == '\'') ){
+ nextChar( 2 );
+ } else if( len>=2 && (currentChar() == '\\' && peekChar() == '\\') ){
+ nextChar( 2 );
+ } else if( currentChar() == '\'' ){
+ nextChar();
+ break;
+ } else {
+ nextChar();
+ }
+ }
+}
+
+inline void Lexer::readStringLiteral()
+{
+ if( currentChar() != '"' )
+ return;
+
+ nextChar(); // skip "
+
+ while( !currentChar().isNull() ){
+ int len = getOffset( m_endPtr ) - currentPosition();
+
+ if( len>=2 && currentChar() == '\\' && peekChar() == '"' ){
+ nextChar( 2 );
+ } else if( len>=2 && currentChar() == '\\' && peekChar() == '\\' ){
+ nextChar( 2 );
+ } else if( currentChar() == '"' ){
+ nextChar();
+ break;
+ } else {
+ nextChar();
+ }
+ }
+}
+
+inline void Lexer::readNumberLiteral()
+{
+ while( currentChar().isLetterOrNumber() || currentChar() == '.' )
+ nextChar();
+}
+
+inline int Lexer::findOperator3() const
+{
+ int n = getOffset( m_endPtr ) - currentPosition();
+
+ if( n >= 3){
+ QChar ch = currentChar(), ch1=peekChar(), ch2=peekChar(2);
+
+ if( ch == '<' && ch1 == '<' && ch2 == '=' ) return Token_assign;
+ else if( ch == '>' && ch1 == '>' && ch2 == '=' ) return Token_assign;
+ else if( ch == '-' && ch1 == '>' && ch2 == '*' ) return Token_ptrmem;
+ else if( ch == '.' && ch1 == '.' && ch2 == '.' ) return Token_ellipsis;
+ }
+
+ return -1;
+}
+
+inline int Lexer::findOperator2() const
+{
+ int n = getOffset( m_endPtr ) - currentPosition();
+
+ if( n>=2 ){
+ QChar ch = currentChar(), ch1=peekChar();
+
+ if( ch == ':' && ch1 == ':' ) return Token_scope;
+ else if( ch == '.' && ch1 == '*' ) return Token_ptrmem;
+ else if( ch == '+' && ch1 == '=' ) return Token_assign;
+ else if( ch == '-' && ch1 == '=' ) return Token_assign;
+ else if( ch == '*' && ch1 == '=' ) return Token_assign;
+ else if( ch == '/' && ch1 == '=' ) return Token_assign;
+ else if( ch == '%' && ch1 == '=' ) return Token_assign;
+ else if( ch == '^' && ch1 == '=' ) return Token_assign;
+ else if( ch == '&' && ch1 == '=' ) return Token_assign;
+ else if( ch == '|' && ch1 == '=' ) return Token_assign;
+ else if( ch == '<' && ch1 == '<' ) return Token_shift;
+ else if( ch == '>' && ch1 == '>' ) return Token_shift;
+ else if( ch == '=' && ch1 == '=' ) return Token_eq;
+ else if( ch == '!' && ch1 == '=' ) return Token_eq;
+ else if( ch == '<' && ch1 == '=' ) return Token_leq;
+ else if( ch == '>' && ch1 == '=' ) return Token_geq;
+ else if( ch == '&' && ch1 == '&' ) return Token_and;
+ else if( ch == '|' && ch1 == '|' ) return Token_or;
+ else if( ch == '+' && ch1 == '+' ) return Token_incr;
+ else if( ch == '-' && ch1 == '-' ) return Token_decr;
+ else if( ch == '-' && ch1 == '>' ) return Token_arrow;
+ else if( ch == '#' && ch1 == '#' ) return Token_concat;
+ }
+
+ return -1;
+}
+
+inline bool Lexer::skipWordsEnabled() const
+{
+ return m_skipWordsEnabled;
+}
+
+inline void Lexer::setSkipWordsEnabled( bool enabled )
+{
+ m_skipWordsEnabled = enabled;
+}
+
+inline bool Lexer::preprocessorEnabled() const
+{
+ return m_preprocessorEnabled;
+}
+
+inline void Lexer::setPreprocessorEnabled( bool enabled )
+{
+ m_preprocessorEnabled = enabled;
+}
+
+inline int Lexer::currentPosition() const
+{
+ return getOffset( m_ptr );
+}
+
+inline const QChar Lexer::currentChar() const
+{
+ return m_currentChar;
+}
+
+inline QChar Lexer::peekChar( int n ) const
+{
+ const QChar* p = m_ptr + n;
+
+ if( p < m_endPtr )
+ return *p;
+ else
+ return QChar::null;
+}
+
+inline bool Lexer::eof() const
+{
+ return m_ptr >= m_endPtr;
+}
+
+inline bool Lexer::reportWarnings() const
+{
+ return m_reportWarnings;
+}
+
+inline void Lexer::setReportWarnings( bool enable )
+{
+ m_reportWarnings = enable;
+}
+
+inline bool Lexer::reportMessages() const
+{
+ return m_reportMessages;
+}
+
+inline void Lexer::setReportMessages( bool enable )
+{
+ m_reportMessages = enable;
+}
+
+inline void Lexer::insertCurrent( const QString& str ) {
+ int posi = currentPosition();
+ m_source.insert( posi, str );
+
+ m_ptr = offset( posi );
+ m_endPtr = offset( m_source.length() );
+ if( m_ptr < m_endPtr )
+ m_currentChar = *m_ptr;
+ else
+ m_currentChar = QChar::null;
+}
+
+#endif
diff --git a/lib/cppparser/lexercache.cpp b/lib/cppparser/lexercache.cpp
new file mode 100644
index 00000000..a7e40dd6
--- /dev/null
+++ b/lib/cppparser/lexercache.cpp
@@ -0,0 +1,249 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "lexercache.h"
+#include "driver.h"
+#include <kdebug.h>
+
+LexerCache::LexerCache( Driver* d ) : m_driver( d ) {}
+
+void LexerCache::addLexedFile( const CachedLexedFilePointer& file ) {
+ //kdDebug( 9007 ) << "LexerCache: adding an instance of " << file->fileName().str() << endl;
+
+ std::pair< CachedLexedFileMap::iterator, CachedLexedFileMap::iterator> files = m_files.equal_range( file->fileName() );
+
+ if ( files.first == files.second ) {
+ m_files.insert( std::make_pair( file->fileName(), file ) );
+ } else {
+ //Make sure newer files appear first
+ m_files.insert( files.first, std::make_pair( file->fileName(), file ) );
+ }
+
+ int cnt = 0;
+ while ( files.first != files.second ) {
+ if ( sourceChanged( *( *( files.first ) ).second ) ) {
+ m_files.erase( files.first++ );
+ } else {
+ cnt++;
+ files.first++;
+ }
+ }
+ //kdDebug( 9007 ) << "LexerCache: new count of cached instances for the file: " << cnt << endl;
+}
+
+CachedLexedFilePointer LexerCache::lexedFile( const HashedString& fileName ) {
+ initFileModificationCache();
+ std::pair< CachedLexedFileMap::iterator, CachedLexedFileMap::iterator> files = m_files.equal_range( fileName );
+
+ ///@todo optimize with standard-algorithms(by first computing the intersection)
+
+ /* if( files.first != files.second )
+ //kdDebug( 9007 ) << "LexerCache: cache for file " << fileName.str() << " is not empty" << endl;
+ else
+ //kdDebug( 9007 ) << "LexerCache: cache for file " << fileName.str() << " is empty" << endl;*/
+
+ while ( files.first != files.second ) {
+ const CachedLexedFile& file( *( *( files.first ) ).second );
+ if ( sourceChanged( file ) ) {
+ //kdDebug( 9007 ) << "LexerCache: cache for file " << fileName.str() << " is being discarded because the file was modified" << endl;
+ m_files.erase( files.first++ );
+ continue;
+ }
+ bool success = true;
+ //Make sure that none of the macros stored in the driver affect the file in a different way than the one before
+ Driver::MacroMap::const_iterator end = m_driver->macros().end();
+ for ( Driver::MacroMap::const_iterator rit = m_driver->macros().begin(); rit != end; ) {
+ Driver::MacroMap::const_iterator it = rit;
+ ++rit;
+ if ( rit != end && ( *it ).first == ( *rit ).first ) continue; //Always only use the last macro of the same name for comparison, it is on top of the macro-stack
+ if (( *it ).second.isUndef() ) continue; //Undef-macros theoretically don't exist
+
+ if ( file.hasString(( *it ).first ) ) {
+ if ( file.m_usedMacros.hasMacro(( *it ).first ) ) {
+ Macro m( file.m_usedMacros.macro(( *it ).first.str() ) );
+ if ( !( m == ( *it ).second ) ) {
+ //kdDebug( 9007 ) << "LexerCache: The cached file " << fileName.str() << " depends on the string \"" << ( *it ).first.str() << "\" and used a macro for it with the body \"" << m.body() << "\"(from " << m.fileName() << "), but the driver contains the same macro with body \"" << ( *it ).second.body() << "\"(from " << ( *it ).second.fileName() << "), cache is not used" << endl;
+
+ //Macro with the same name was used, but it is different
+ success = false;
+ break;
+ }
+
+ } else {
+ //There is a macro that affects the file, but was not used while the previous parse
+ //kdDebug( 9007 ) << "LexerCache: The cached file " << fileName.str() << " depends on the string \"" << ( *it ).first.str() << "\" and the driver contains a macro of that name with body \"" << ( *it ).second.body() << "\"(from " << ( *it ).second.fileName() << "), the cached file is not used" << endl;
+ success = false;
+ break;
+ }
+ }
+ }
+ //Make sure that all external macros used by the file now exist too
+ MacroSet::Macros::const_iterator end2 = file.usedMacros().macros().end();
+ for ( MacroSet::Macros::const_iterator it = file.usedMacros().macros().begin(); it != end2; ++it ) {
+ if ( !m_driver->hasMacro( HashedString(( *it ).name() ) ) ) {
+ //kdDebug( 9007 ) << "LexerCache: The cached file " << fileName.str() << " used a macro called \"" << it->name() << "\"(from " << it->fileName() << "), but the driver does not contain that macro, the cached file is not used" << endl;
+ success = false;
+ break;
+ }
+ }
+
+ if ( success ) {
+ //kdDebug( 9007 ) << "LexerCache: Using cached file " << fileName.str() << endl;
+ (*files.first).second->access();
+ return ( *files.first ).second;
+ }
+ ++files.first;
+ }
+ return CachedLexedFilePointer();
+}
+
+QDateTime LexerCache::fileModificationTimeCached( const HashedString& fileName ) {
+ FileModificationMap::const_iterator it = m_fileModificationCache.find( fileName );
+ if( it != m_fileModificationCache.end() ) {
+ ///Use the cache for 10 seconds
+ if( (*it).second.m_readTime.secsTo( m_currentDateTime ) < 10 ) {
+ return (*it).second.m_modificationTime;
+ }
+ }
+
+ QFileInfo fileInfo( fileName.str() );
+ m_fileModificationCache[fileName].m_readTime = QDateTime::currentDateTime();
+ m_fileModificationCache[fileName].m_modificationTime = fileInfo.lastModified();
+ return fileInfo.lastModified();
+
+}
+
+//Should be cached too!
+bool LexerCache::sourceChanged( const CachedLexedFile& file ) {
+ //@todo Check if any of the dependencies changed
+
+ QDateTime modTime = fileModificationTimeCached( file.fileName() );
+
+ if ( modTime != file.modificationTime() )
+ return true;
+
+ for( QMap<HashedString, QDateTime>::const_iterator it = file.allModificationTimes().begin(); it != file.allModificationTimes().end(); ++it ) {
+ QDateTime modTime = fileModificationTimeCached( it.key() );
+ if( modTime != *it )
+ return true;
+ }
+
+ return false;
+}
+
+
+void LexerCache::clear() {
+ m_files.clear();
+ m_totalStringSet.clear();
+ m_fileModificationCache.clear();
+}
+
+void LexerCache::erase( const CacheNode* node ) {
+ std::pair< CachedLexedFileMap::iterator, CachedLexedFileMap::iterator> files = m_files.equal_range( ((const CachedLexedFile*)(node))->fileName() );
+ while ( files.first != files.second ) {
+ if( (*files.first).second.data() == ((const CachedLexedFile*)(node)) ) {
+ m_files.erase( files.first );
+ return;
+ }
+ files.first++;
+ }
+ //kdDebug( 9007 ) << "Error: could not find a node in the list for file " << ((const CachedLexedFile*)(node))->fileName().str() << endl;
+}
+
+CachedLexedFile::CachedLexedFile( const HashedString& fileName, LexerCache* manager ) : CacheNode( manager ), m_fileName( fileName ) {
+ QFileInfo fileInfo( fileName.str() );
+ m_modificationTime = fileInfo.lastModified();
+ m_allModificationTimes[ fileName ] = m_modificationTime;
+}
+
+void CachedLexedFile::addDefinedMacro( const Macro& macro ) {
+#ifdef LEXERCACHE_DEBUG
+ //kdDebug( 9007 ) << "defined macro " << macro.name() << endl;
+#endif
+ m_definedMacros.addMacro( macro );
+ m_definedMacroNames.insert( HashedString( macro.name() ) );
+}
+
+void CachedLexedFile::addUsedMacro( const Macro& macro ) {
+ if ( !m_definedMacros.hasMacro( macro.name() ) ) {
+#ifdef LEXERCACHE_DEBUG
+ //kdDebug( 9007 ) << "used macro " << macro.name() << endl;
+#endif
+ m_usedMacros.addMacro( macro );
+ }
+}
+
+void CachedLexedFile::addIncludeFile( const HashedString& file, const QDateTime& modificationTime ) {
+ m_includeFiles.insert( file );
+ m_allModificationTimes[file] = modificationTime;
+}
+
+
+QDateTime CachedLexedFile::modificationTime() const {
+ return m_modificationTime;
+}
+
+void CachedLexedFile::addProblem( const Problem& p ) {
+ m_problems << p;
+}
+
+QValueList<Problem> CachedLexedFile::problems() const {
+ return m_problems;
+}
+
+//The parameter should be a CachedLexedFile that was lexed AFTER the content of this file
+void CachedLexedFile::merge( const CachedLexedFile& file ) {
+#ifdef LEXERCACHE_DEBUG
+ //kdDebug( 9007 ) << fileName().str() << ": merging " << file.fileName().str() << endl << "defined in this: " << m_definedMacroNames.print().c_str() << endl << "defined macros in other: " << file.m_definedMacroNames.print().c_str() << endl;;
+#endif
+ HashedStringSet tempStrings = file.m_strings;
+ tempStrings -= m_definedMacroNames;
+ m_strings += tempStrings;
+ m_includeFiles += file.m_includeFiles;
+ //Only add macros to the usedMacros-list that were not defined locally
+ for ( MacroSet::Macros::const_iterator it = file.m_usedMacros.macros().begin(); it != file.m_usedMacros.macros().end(); ++it ) {
+ if ( !m_definedMacros.hasMacro(( *it ).name() ) ) {///If the macro was not defined locally, add it to the macros-list.
+#ifdef LEXERCACHE_DEBUG
+ //kdDebug( 9007 ) << "inserting used macro " << ( *it ).name() << endl;
+#endif
+ m_usedMacros.addMacro( *it );
+ }
+ }
+
+ m_definedMacros.merge( file.m_definedMacros );
+ m_definedMacroNames += file.m_definedMacroNames;
+
+ for( QMap<HashedString, QDateTime>::const_iterator it = file.m_allModificationTimes.begin(); it != file.m_allModificationTimes.end(); ++it )
+ m_allModificationTimes[it.key()] = *it;
+
+
+#ifdef LEXERCACHE_DEBUG
+ //kdDebug( 9007 ) << fileName().str() << ": defined in this after merge: " << m_definedMacroNames.print().c_str() << endl;
+#endif
+ m_problems += file.m_problems;
+}
+
+size_t CachedLexedFile::hash() const {
+ return m_usedMacros.valueHash() + m_usedMacros.idHash() + m_definedMacros.idHash() + m_definedMacros.valueHash() + m_strings.hash();
+}
+
+void LexerCache::initFileModificationCache() {
+ m_currentDateTime = QDateTime::currentDateTime();
+}
+
+void LexerCache::saveMemory() {
+ m_fileModificationCache.clear();
+
+ m_totalStringSet.clear(); ///it's unclear how often this should be emptied. It may happen that completely unused strings end up in this set, then deleting it will save us memory.
+}
diff --git a/lib/cppparser/lexercache.h b/lib/cppparser/lexercache.h
new file mode 100644
index 00000000..c32d5406
--- /dev/null
+++ b/lib/cppparser/lexercache.h
@@ -0,0 +1,162 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 LEXERCACHE_H
+#define LEXERCACHE_H
+#include <hashedstring.h>
+#include <ext/hash_map>
+#include <ksharedptr.h>
+#include "macro.h"
+#include <kdebug.h>
+#include <qdatetime.h>
+#include <qfileinfo.h>
+#include <ext/hash_set>
+#include "cachemanager.h"
+
+//#define LEXERCACHE_DEBUG
+
+class LexerCache;
+
+class CachedLexedFile : public KShared, public CacheNode {
+ public:
+ ///@todo add and manage the set of included files
+ CachedLexedFile( const HashedString& fileName, LexerCache* manager );
+
+ inline void addString( const HashedString& string ) {
+ if( !m_definedMacroNames[ string ] ) {
+ m_strings.insert( string );
+ }
+ }
+
+ void addDefinedMacro( const Macro& macro );
+
+ void addUsedMacro( const Macro& macro );
+
+ void addIncludeFile( const HashedString& file, const QDateTime& modificationTime );
+
+ inline bool hasString( const HashedString& string ) const {
+ return m_strings[string];
+ }
+
+ QDateTime modificationTime() const;
+
+ void addProblem( const Problem& p );
+
+ QValueList<Problem> problems() const;
+
+ //The parameter should be a CachedLexedFile that was lexed AFTER the content of this file
+ void merge( const CachedLexedFile& file );
+
+ bool operator < ( const CachedLexedFile& rhs ) const {
+ return m_fileName < rhs.m_fileName;
+ }
+
+ size_t hash() const;
+
+ HashedString fileName() const {
+ return m_fileName;
+ }
+
+ const HashedStringSet& includeFiles() const {
+ return m_includeFiles;
+ }
+
+ const MacroSet& definedMacros() const {
+ return m_definedMacros;
+ }
+
+ const MacroSet& usedMacros() const {
+ return m_usedMacros;
+ }
+
+ ///Should contain a modification-time for each include-file
+ const QMap<HashedString, QDateTime>& allModificationTimes() const {
+ return m_allModificationTimes;
+ }
+
+ private:
+ friend class LexerCache;
+ HashedString m_fileName;
+ QDateTime m_modificationTime;
+ HashedStringSet m_strings; //Set of all strings that can be affected by macros from outside
+ HashedStringSet m_includeFiles; //Set of all files
+ MacroSet m_usedMacros; //Set of all macros that were used, and were defined outside of this file
+ MacroSet m_definedMacros; //Set of all macros that were defined while lexing this file
+ HashedStringSet m_definedMacroNames;
+ QValueList<Problem> m_problems;
+ QMap<HashedString, QDateTime> m_allModificationTimes;
+ /*
+ Needed data:
+ 1. Set of all strings that appear in this file(For memory-reasons they should be taken from a global string-repository, because many will be the same)
+ 2. Set of all macros that were defined outside of, but affected the file
+
+ Algorithm:
+ Iterate over all available macros, and check whether they affect the file. If it does, make sure that the macro is in the macro-set and has the same body.
+ If the check fails: We need to reparse.
+ */
+};
+
+typedef KSharedPtr<CachedLexedFile> CachedLexedFilePointer;
+
+struct CachedLexedFilePointerCompare {
+ bool operator() ( const CachedLexedFilePointer& lhs, const CachedLexedFilePointer& rhs ) const {
+ return (*lhs) < (*rhs );
+ }
+};
+
+class Driver;
+
+class LexerCache : public CacheManager {
+ public:
+ LexerCache( Driver* d );
+
+ void addLexedFile( const CachedLexedFilePointer& file );
+
+ ///Returns zero if no fitting file is available for the current context
+ CachedLexedFilePointer lexedFile( const HashedString& fileName );
+
+ void clear();
+
+ const HashedString& unifyString( const HashedString& str ) {
+ __gnu_cxx::hash_set<HashedString>::const_iterator it = m_totalStringSet.find( str );
+ if( it != m_totalStringSet.end() ) {
+ return *it;
+ } else {
+ m_totalStringSet.insert( str );
+ return str;
+ }
+ }
+ virtual void saveMemory();
+ private:
+ ///before this can be called, initFileModificationCache should be called once
+ QDateTime fileModificationTimeCached( const HashedString& fileName );
+ void initFileModificationCache();
+ virtual void erase( const CacheNode* node );
+ bool sourceChanged( const CachedLexedFile& file );///Returns true if the file itself, or any of its dependencies was modified.
+ //typedef __gnu_cxx::hash_multimap<HashedString, CachedLexedFilePointer> CachedLexedFileMap;
+ typedef std::multimap<HashedString, CachedLexedFilePointer> CachedLexedFileMap;
+ CachedLexedFileMap m_files;
+ __gnu_cxx::hash_set<HashedString> m_totalStringSet; ///This is used to reduce memory-usage: Most strings appear again and again. Because QString is reference-counted, this set contains a unique copy of each string to used for each appearance of the string
+ struct FileModificationCache {
+ QDateTime m_readTime;
+ QDateTime m_modificationTime;
+ };
+ typedef __gnu_cxx::hash_map<HashedString, FileModificationCache> FileModificationMap;
+ FileModificationMap m_fileModificationCache;
+ Driver* m_driver;
+ QDateTime m_currentDateTime;
+};
+
+
+#endif
diff --git a/lib/cppparser/lookup.cpp b/lib/cppparser/lookup.cpp
new file mode 100644
index 00000000..192b4d4c
--- /dev/null
+++ b/lib/cppparser/lookup.cpp
@@ -0,0 +1,42 @@
+/* This file is part of KDevelop
+ Copyright (C) 2005 Tobias Erbsland <te@profzone.ch>
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "lookup.h"
+
+int Lookup::find( const HashedString& s )
+{
+ KeywordMap::const_iterator it = keywords().find( s );
+ if( it == keywords().end() )
+ return -1;
+ return static_cast<int>((*it).second);
+}
+
+const Lookup::KeywordMap& Lookup::keywords()
+{
+ static KeywordMap keywords;
+
+ if( keywords.empty() )
+ {
+#include "keywords.h"
+ }
+
+ return keywords;
+}
+
diff --git a/lib/cppparser/lookup.h b/lib/cppparser/lookup.h
new file mode 100644
index 00000000..6e41481e
--- /dev/null
+++ b/lib/cppparser/lookup.h
@@ -0,0 +1,45 @@
+/* This file is part of KDevelop
+ Copyright (C) 2005 Tobias Erbsland <te@profzone.ch>
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _LOOKUP_H_
+#define _LOOKUP_H_
+
+#include <qstring.h>
+#include <qmap.h>
+
+#include "lexer.h"
+#include <ext/hash_map>
+#include <hashedstring.h>
+
+/**
+* @short Fast keyword lookup.
+*/
+class Lookup {
+public:
+ typedef __gnu_cxx::hash_map<HashedString,Type> KeywordMap;
+ /**
+ * Find an entry in the table, and return its value
+ */
+ static int find( const HashedString& s );
+
+ static const KeywordMap& keywords();
+};
+
+#endif
diff --git a/lib/cppparser/macro.h b/lib/cppparser/macro.h
new file mode 100644
index 00000000..03e76984
--- /dev/null
+++ b/lib/cppparser/macro.h
@@ -0,0 +1,452 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 MACRO_H
+#define MACRO_H
+
+#include <qpair.h>
+#include <qvaluestack.h>
+#include <qstringlist.h>
+#include <qcstring.h>
+#include <qdatastream.h>
+#include <qmap.h>
+#include <qdatetime.h>
+#include <qvaluelist.h>
+#include <map>
+#include <set>
+#include <hashedstring.h>
+#include <ksharedptr.h>
+#include <codemodel.h>
+#include <ext/hash_map>
+
+//This files should be renamed to something like "helpers.h"
+
+/**
+ * Encapsulates a problem in a piece of source code.
+ */
+class Problem {
+ public:
+ enum
+ {
+ Level_Error = 0, ///< Indicates an error that will prevent the code from compiling
+ Level_Warning, ///< Indicates a warning
+ Level_Todo, ///< Indicates there is still something left to do
+ Level_Fixme ///< Indicates that something needs to be fixed
+ };
+
+ public:
+ Problem() {}
+ Problem( const Problem& source )
+ : m_text( source.m_text ), m_line( source.m_line ),
+ m_column( source.m_column ), m_level( source.m_level ), m_file( source.m_file ) {}
+ Problem( const QString& text, int line, int column, int level = Level_Error )
+ : m_text( text ), m_line( line ), m_column( column ), m_level( level ) {}
+
+ Problem( const Problem& source, bool /*threadSafeClone*/ )
+ : m_text( QString::fromUtf8( source.m_text.utf8().data() ) ), m_line( source.m_line ),
+ m_column( source.m_column ), m_level( source.m_level ), m_file( QString::fromUtf8( source.m_file.utf8().data() ) ) {}
+
+ Problem& operator = ( const Problem& source ) {
+ m_text = source.m_text;
+ m_line = source.m_line;
+ m_column = source.m_column;
+ m_level = source.m_level;
+ m_file = source.m_file;
+ return ( *this );
+ }
+
+ void setFileName( const QString& fileName ) {
+ m_file = fileName;
+ }
+
+ bool operator == ( const Problem& p ) const {
+ return m_text == p.m_text && m_line == p.m_line && m_column == p.m_column && m_level == p.m_level && m_file == p.m_file;
+ }
+
+ /** Get the filename in which the problem was encountered */
+ QString fileName() const {
+ return m_file;
+ }
+
+ /** Get the text for the problem */
+ QString text() const {
+ return m_text;
+ }
+ /** Get the line number of the problem */
+ int line() const {
+ return m_line;
+ }
+ /** Get the column of the problem */
+ int column() const {
+ return m_column;
+ }
+ /**
+ * Get the seriousness of the problem. There are four possibilities:
+ * \li Error
+ * \li Warning
+ * \li Todo
+ * \li Fixme
+ */
+ int level() const {
+ return m_level;
+ }
+
+ private:
+ QString m_text;
+ int m_line;
+ int m_column;
+ int m_level;
+ QString m_file;
+};
+
+
+/**
+ * A datatype that represents a preprocessor macro.
+ * Most of the functions in this class need to be inline, so we do not have to import cppparser to many modules. The other solution would be moving macro into interfaces.
+ */
+class Macro {
+ public:
+ typedef QString Argument;
+
+ public:
+ Macro( bool hasArguments = false ) : m_idHashValid( false ), m_valueHashValid( false ), m_line( 0 ), m_column( 0 ), m_hasArguments( hasArguments ), m_isUndefMacro( false ) {}
+ Macro( const QString &n, const QString &b ) : m_idHashValid( false ), m_valueHashValid( false ), m_name( n ), m_line( 0 ), m_column( 0 ), m_body( b ), m_hasArguments( false ), m_isUndefMacro( false ) {}
+
+ //Sorts the macros by their hash-value, then by their name.
+ struct NameArgCompare {
+ bool operator () ( const Macro& lhs, const Macro& rhs ) const {
+ size_t lhash = lhs.idHash();
+ size_t rhash = rhs.idHash();
+ if( lhash < rhash ) return true;
+ else if( lhash > rhash ) return false;
+
+ int df = lhs.m_name.compare( rhs.m_name );
+ if ( df < 0 )
+ return true;
+ if ( df == 0 ) {
+ if ( !lhs.m_hasArguments && rhs.m_hasArguments ) {
+ return true;
+ } else if ( lhs.m_hasArguments == rhs.m_hasArguments ) {
+ return lhs.m_argumentList.count() < rhs.m_argumentList.count();
+
+ } else {
+ return false;
+ }
+ }
+ return false;
+ }
+ };
+ struct NameCompare {
+ bool operator () ( const Macro& lhs, const Macro& rhs ) const {
+ size_t lhash = lhs.idHash();
+ size_t rhash = rhs.idHash();
+ if( lhash < rhash ) return true;
+ else if( lhash > rhash ) return false;
+
+ int df = lhs.m_name.compare( rhs.m_name );
+ return df < 0;
+ }
+ };
+
+ struct NameArgHash {
+ size_t operator () ( const Macro& macro ) const {
+ return macro.idHash();
+ }
+ };
+
+ struct NameArgEqual {
+ bool operator () ( const Macro& lhs, const Macro& rhs ) const {
+ int df = lhs.m_name.compare( rhs.m_name );
+ if ( df == 0 ) {
+ if ( lhs.m_hasArguments != rhs.m_hasArguments ) {
+ return false;
+ } else {
+ if( lhs.m_argumentList.count() != rhs.m_argumentList.count() ) return false;
+ /*QStringList::const_iterator it2 = rhs.m_argumentList.begin();
+ for( QStringList::const_iterator it = lhs.m_argumentList.begin(); it != lhs.m_argumentList.end(); ) {
+ if( *it != *it2 ) return false;
+
+ ++it;
+ ++it2;
+ }*/
+ return true;
+
+ }
+ }
+ return false;
+ }
+ };
+
+ Macro( const Macro& source )
+ : m_idHashValid( source.m_idHashValid ), m_valueHashValid( source.m_valueHashValid ), m_idHash( source.m_idHash ), m_valueHash( source.m_valueHash ), m_name( source.m_name ),
+ m_fileName( source.m_fileName ),
+ m_line( source.m_line ),
+ m_column( source.m_column ),
+ m_body( source.m_body ),
+ m_hasArguments( source.m_hasArguments ),
+ m_argumentList( source.m_argumentList ), m_isUndefMacro( source.m_isUndefMacro ) {}
+
+ Macro& operator = ( const Macro& source ) {
+ m_idHashValid = source.m_idHashValid;
+ m_valueHashValid = source.m_valueHashValid;
+ m_idHash = source.m_idHash;
+ m_valueHash = source.m_valueHash;
+ m_name = source.m_name;
+ m_fileName = source.m_fileName;
+ m_line = source.m_line;
+ m_column = source.m_column;
+ m_body = source.m_body;
+ m_hasArguments = source.m_hasArguments;
+ m_argumentList = source.m_argumentList;
+ m_isUndefMacro = source.m_isUndefMacro;
+ return *this;
+ }
+
+ bool operator == ( const Macro& source ) const {
+ if( !m_idHashValid || !m_valueHashValid ) computeHash();
+ if( !source.m_idHashValid || !source.m_valueHashValid ) source.computeHash();
+
+ if( m_idHash != source.m_idHash ) return false;
+ if( m_valueHash != source.m_valueHash ) return false;
+
+ return m_name == source.m_name &&
+ m_fileName == source.m_fileName &&
+ m_body == source.m_body &&
+ m_hasArguments == source.m_hasArguments &&
+ m_argumentList == source.m_argumentList && m_isUndefMacro == source.m_isUndefMacro;
+ }
+
+ void read( QDataStream& stream ) {
+ Q_INT8 i;
+ stream >> i; m_idHashValid = i;
+ stream >> i; m_valueHashValid = i;
+ stream >> i; m_hasArguments = i;
+
+ stream >> m_idHash;
+ stream >> m_valueHash;
+ stream >> m_name;
+ stream >> m_line;
+ stream >> m_column;
+ stream >> m_body;
+ stream >> m_fileName;
+ stream >> m_argumentList;
+ }
+
+ void write( QDataStream& stream ) const {
+ Q_INT8 i;
+ i = m_idHashValid; stream << i;
+ i = m_valueHashValid; stream << i;
+ i = m_hasArguments; stream << i;
+
+ stream << m_idHash;
+ stream << m_valueHash;
+ stream << m_name;
+ stream << m_line;
+ stream << m_column;
+ stream << m_body;
+ stream << m_fileName;
+ stream << m_argumentList;
+ }
+
+ /** Get the name for this macro */
+ QString name() const {
+ return m_name;
+ }
+ /** Set the name for this macro */
+ void setName( const QString& name ) {
+ m_name = name;
+ invalidateHash();
+ }
+
+ /** Get the file name that contains this macro */
+ QString fileName() const {
+ return m_fileName;
+ }
+ /** Set the file name that contains this macro */
+ void setFileName( const QString& fileName ) {
+ m_fileName = fileName;
+ invalidateHash();
+ }
+
+ /** Get the line the macro is defined on */
+ int line() const {
+ return m_line;
+ }
+ /** Set the line the macro is defined on */
+ void setLine( int line ) {
+ m_line = line;
+ }
+
+ /** Get the column the macro starts at */
+ int column() const {
+ return m_column;
+ }
+ /** Set the column the macro starts at */
+ void setColumn( int column ) {
+ m_column = column;
+ }
+
+ /** Get the body of the macro */
+ QString body() const {
+ return m_body;
+ }
+ /** Set the body of the macro */
+ void setBody( const QString& body ) {
+ m_body = body;
+ invalidateHash();
+ }
+
+ /** This is used so the lexer does not have to remove macros that should really stay(they are just temporarily shadowed by an isUndef-macro */
+ bool isUndef() const {
+ return m_isUndefMacro;
+ };
+
+ void setUndef() {
+ m_isUndefMacro = true;
+ invalidateHash();
+ };
+
+ /** Check whether the macro has arguments that are passed to it */
+ bool hasArguments() const {
+ return m_hasArguments;
+ }
+ void setHasArguments( bool hasArguments ) {
+ m_hasArguments = hasArguments;
+ invalidateHash();
+ }
+ /** Get a list of arguments passed to this macro */
+ QValueList<Argument> argumentList() const {
+ return m_argumentList;
+ }
+
+ /** Clear the list of arguments this macro has */
+ void clearArgumentList() {
+ m_argumentList.clear();
+ m_hasArguments = false;
+ invalidateHash();
+ }
+ /** Add an argument to this macro */
+ void addArgument( const Argument& argument ) {
+ m_argumentList << argument;
+ }
+ /** Add a list of arguments to this macro */
+ void addArgumentList( const QValueList<Argument>& arguments ) {
+ m_argumentList += arguments;
+ invalidateHash();
+ }
+
+ ///This hash respects macro-name and argument-count
+ size_t idHash() const {
+ if( !m_idHashValid ) computeHash();
+ return m_idHash;
+ }
+
+ ///This hash respects body and if it is an undef-macro
+ size_t valueHash() const {
+ if( !m_valueHashValid ) computeHash();
+ return m_valueHash;
+ }
+
+ private:
+ inline void invalidateHash() const {
+ m_idHashValid = m_valueHashValid = false;
+ }
+
+ void computeHash() const {
+ m_idHash = 7 * ( HashedString::hashString( m_name ) );
+ int a = 1;
+ //m_idHash += 31 * m_argumentList.count();
+
+ m_valueHash = 27 * ( HashedString::hashString( m_body ) + (m_isUndefMacro ? 1 : 0 ) );
+
+ for( QValueList<Argument>::const_iterator it = m_argumentList.begin(); it != m_argumentList.end(); ++it ) {
+ a *= 19;
+ m_valueHash += a * HashedString::hashString( *it );
+ }
+ m_valueHashValid = true;
+ m_idHashValid = true;
+ }
+
+ mutable bool m_idHashValid;
+ mutable bool m_valueHashValid;
+ mutable size_t m_idHash; //Hash that represents the ids of all macros
+ mutable size_t m_valueHash; //Hash that represents the values of all macros
+
+ QString m_name;
+ QString m_fileName;
+ int m_line;
+ int m_column;
+ QString m_body;
+ bool m_hasArguments;
+ QStringList m_argumentList; //While identification, only the count plays a role, not the values.
+ bool m_isUndefMacro;
+ friend class NameCompare;
+ friend class NameArgEqual;
+};
+
+class MacroSet {
+ public:
+ //typedef __gnu_cxx::hash_set< Macro, Macro::NameArgHash, Macro::NameArgEqual > Macros;
+ typedef std::set< Macro, Macro::NameCompare > Macros;
+ MacroSet() : m_idHashValid( false ), m_valueHashValid( false ) {
+ }
+
+ void addMacro( const Macro& macro );
+
+ void read( QDataStream& stream ) {
+ //stream >> m_idHashValid >> m_idHash >> m_valueHashValid >> m_valueHash;
+ m_idHashValid = false;
+ m_valueHashValid = false;
+ int cnt;
+ stream >> cnt;
+ m_usedMacros.clear();
+ Macro m;
+ for( int a = 0; a < cnt; a++ ) {
+ m.read( stream );
+ m_usedMacros.insert( m );
+ }
+ }
+
+ void write( QDataStream& stream ) const {
+ //stream << m_idHashValid << m_idHash << m_valueHashValid << m_valueHash;
+ stream << int( m_usedMacros.size() );
+ for( Macros::const_iterator it = m_usedMacros.begin(); it != m_usedMacros.end(); ++it ) {
+ (*it).write( stream );
+ }
+ }
+
+ bool hasMacro( const QString& name ) const;
+ bool hasMacro( const HashedString& name ) const;
+ Macro macro( const QString& name ) const;
+
+ size_t idHash() const;
+ size_t valueHash() const;
+
+ const Macros& macros() const {
+ return m_usedMacros;
+ }
+
+ void merge( const MacroSet& macros );
+ private:
+ void computeHash() const;
+ Macros m_usedMacros;
+ mutable bool m_idHashValid;
+ mutable bool m_valueHashValid;
+ mutable size_t m_idHash; //Hash that represents the ids of all macros
+ mutable size_t m_valueHash; //Hash that represents the values of all macros
+
+ friend class Driver;
+};
+
+#endif
diff --git a/lib/cppparser/parser.cpp b/lib/cppparser/parser.cpp
new file mode 100644
index 00000000..b790f5a1
--- /dev/null
+++ b/lib/cppparser/parser.cpp
@@ -0,0 +1,4330 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+// c++ support
+#include "driver.h"
+#include "lexer.h"
+#include "parser.h"
+#include "errors.h"
+
+// qt
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qasciidict.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+
+using namespace std;
+
+#define ADVANCE(tk, descr) \
+{ \
+ const Token& token = lex->lookAhead( 0 ); \
+ if( token != tk ){ \
+ reportError( i18n("'%1' expected found '%2'").arg(descr).arg(token.text()) ); \
+ return false; \
+ } \
+ nextToken(); \
+}
+
+#define ADVANCE_NR(tk, descr) \
+{ \
+ const Token& token = lex->lookAhead( 0 ); \
+ if( token != tk ){ \
+ reportError( i18n("'%1' expected found '%2'").arg(descr).arg(token.text()) ); \
+ } \
+ else \
+ nextToken(); \
+}
+
+#define CHECK(tk, descr) \
+{ \
+ const Token& token = lex->lookAhead( 0 ); \
+ if( token != tk ){ \
+ return false; \
+ } \
+ nextToken(); \
+}
+
+#define MATCH(tk, descr) \
+{ \
+ const Token& token = lex->lookAhead( 0 ); \
+ if( token != tk ){ \
+ reportError( Errors::SyntaxError ); \
+ return false; \
+ } \
+}
+
+
+
+#define UPDATE_POS(node, start, end) \
+{ \
+ int line, col; \
+ const Token &a = lex->tokenAt(start); \
+ const Token &b = lex->tokenAt( end!=start ? end-1 : end ); \
+ a.getStartPosition( &line, &col ); \
+ (node)->setStartPosition( line, col ); \
+ b.getEndPosition( &line, &col ); \
+ (node)->setEndPosition( line, col ); \
+ if( (node)->nodeType() == NodeType_Generic ) { \
+ if ((start) == (end) || (end) == (start)+1) \
+ (node)->setSlice(lex->source(), a.position(), a.length()); \
+ else \
+ (node)->setText( toString((start),(end)) ); \
+ } \
+}
+
+#define AST_FROM_TOKEN(node, tk) \
+ AST::Node node = CreateNode<AST>(); \
+ UPDATE_POS( node, (tk), (tk)+1 );
+
+
+//@todo remove me
+enum
+{
+ OBJC_CLASS,
+ OBJC_PROTOCOL,
+ OBJC_ALIAS
+};
+
+struct ParserPrivateData
+{
+ ParserPrivateData()
+ {}
+};
+
+Parser::Parser( Driver* driver, Lexer* lexer )
+ : m_driver( driver ),
+ lex( lexer ), m_problems(0)
+{
+ d = new ParserPrivateData();
+
+ m_maxProblems = 5;
+ objcp = false;
+}
+
+Parser::~Parser()
+{
+ delete d;
+ d = 0;
+}
+
+bool Parser::reportError( const Error& err )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::reportError()" << endl;
+ if( m_problems < m_maxProblems ){
+ ++m_problems;
+ int line=0, col=0;
+ const Token& token = lex->lookAhead( 0 );
+ lex->getTokenPosition( token, &line, &col );
+
+ QString s = lex->lookAhead(0).text();
+ s = s.left( 30 ).stripWhiteSpace();
+ if( s.isEmpty() )
+ s = i18n( "<eof>" );
+
+ m_driver->addProblem( m_driver->currentFileName(), Problem(err.text.arg(s), line, col) );
+ }
+
+ return true;
+}
+
+bool Parser::reportError( const QString& msg )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::reportError()" << endl;
+ if( m_problems < m_maxProblems ){
+ ++m_problems;
+ int line=0, col=0;
+ const Token& token = lex->lookAhead( 0 );
+ lex->getTokenPosition( token, &line, &col );
+
+ m_driver->addProblem( m_driver->currentFileName(), Problem(msg, line, col) );
+ }
+
+ return true;
+}
+
+void Parser::syntaxError()
+{
+ (void) reportError( Errors::SyntaxError );
+}
+
+bool Parser::skipUntil( int token )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipUntil()" << endl;
+ while( !lex->lookAhead(0).isNull() ){
+ if( lex->lookAhead(0) == token )
+ return true;
+
+ nextToken();
+ }
+
+ return false;
+}
+
+bool Parser::skipUntilDeclaration()
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipUntilDeclaration()" << endl;
+ clearComment();
+
+ while( !lex->lookAhead(0).isNull() ){
+
+ switch( lex->lookAhead(0) ){
+ case ';':
+ case '~':
+ case Token_scope:
+ case Token_identifier:
+ case Token_operator:
+ case Token_char:
+ case Token_wchar_t:
+ case Token_bool:
+ case Token_short:
+ case Token_int:
+ case Token_long:
+ case Token_signed:
+ case Token_unsigned:
+ case Token_float:
+ case Token_double:
+ case Token_void:
+ case Token_extern:
+ case Token_namespace:
+ case Token_using:
+ case Token_typedef:
+ case Token_asm:
+ case Token_template:
+ case Token_export:
+
+ case Token_const: // cv
+ case Token_volatile: // cv
+
+ case Token_public:
+ case Token_protected:
+ case Token_private:
+ case Token_signals: // Qt
+ case Token_slots: // Qt
+ return true;
+
+ default:
+ nextToken();
+ }
+ }
+
+ return false;
+}
+
+bool Parser::skipUntilStatement()
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipUntilStatement() -- token = " << lex->lookAhead(0).text() << endl;
+
+ while( !lex->lookAhead(0).isNull() ){
+ switch( lex->lookAhead(0) ){
+ case ';':
+ case '{':
+ case '}':
+ case Token_const:
+ case Token_volatile:
+ case Token_identifier:
+ case Token_case:
+ case Token_default:
+ case Token_if:
+ case Token_switch:
+ case Token_while:
+ case Token_do:
+ case Token_for:
+ case Token_break:
+ case Token_continue:
+ case Token_return:
+ case Token_goto:
+ case Token_try:
+ case Token_catch:
+ case Token_throw:
+ case Token_char:
+ case Token_wchar_t:
+ case Token_bool:
+ case Token_short:
+ case Token_int:
+ case Token_long:
+ case Token_signed:
+ case Token_unsigned:
+ case Token_float:
+ case Token_double:
+ case Token_void:
+ case Token_class:
+ case Token_struct:
+ case Token_union:
+ case Token_enum:
+ case Token_scope:
+ case Token_template:
+ case Token_using:
+ return true;
+
+ default:
+ nextToken();
+ }
+ }
+
+ return false;
+}
+
+bool Parser::skip( int l, int r )
+{
+ int count = 0;
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+
+ if( tk == l )
+ ++count;
+ else if( tk == r )
+ --count;
+ else if( l != '{' && (tk == '{' || tk == '}' || tk == ';') )
+ return false;
+
+ if( count == 0 )
+ return true;
+
+ nextToken();
+ }
+
+ return false;
+}
+
+bool Parser::skipCommaExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipCommaExpression()" << endl;
+
+ int start = lex->index();
+
+ AST::Node expr;
+ if( !skipExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !skipExpression(expr) ){
+ reportError( i18n("expression expected") );
+ return false;
+ }
+ }
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::skipExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipExpression()" << endl;
+
+ int start = lex->index();
+
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+
+ switch( tk ){
+ case '(':
+ skip( '(', ')' );
+ nextToken();
+ break;
+
+ case '[':
+ skip( '[', ']' );
+ nextToken();
+ break;
+
+#if 0
+ case Token_identifier:
+ nextToken();
+ if( lex->lookAhead( 0 ) == Token_identifier )
+ return true;
+ break;
+#endif
+
+ case ';':
+ case ',':
+ case ']':
+ case ')':
+ case '{':
+ case '}':
+ case Token_case:
+ case Token_default:
+ case Token_if:
+ case Token_while:
+ case Token_do:
+ case Token_for:
+ case Token_break:
+ case Token_continue:
+ case Token_return:
+ case Token_goto:
+ {
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ }
+ return true;
+
+ default:
+ nextToken();
+ }
+ }
+
+ return false;
+}
+
+bool Parser::parseName( NameAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseName()" << endl;
+
+ GroupAST::Node winDeclSpec;
+ parseWinDeclSpec( winDeclSpec );
+
+ int start = lex->index();
+
+ NameAST::Node ast = CreateNode<NameAST>();
+
+ if( lex->lookAhead(0) == Token_scope ){
+ ast->setGlobal( true );
+ nextToken();
+ }
+
+ int idx = lex->index();
+
+ while( true ){
+ ClassOrNamespaceNameAST::Node n;
+ if( !parseUnqualifiedName(n) ) {
+ return false;
+ }
+
+ if( lex->lookAhead(0) == Token_scope ){
+ nextToken();
+ ast->addClassOrNamespaceName( n );
+ if( lex->lookAhead(0) == Token_template )
+ nextToken(); /// skip optional template #### @todo CHECK
+ } else {
+ ast->setUnqualifiedName( n );
+ break;
+ }
+ }
+
+ if( idx == lex->index() )
+ return false;
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseTranslationUnit( TranslationUnitAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTranslationUnit()" << endl;
+
+ int start = lex->index();
+
+ m_problems = 0;
+ TranslationUnitAST::Node tun = CreateNode<TranslationUnitAST>();
+ node = tun;
+ if( lex->lookAhead(0) == Token_comment ) {
+ node->setComment( lex->lookAhead(0).text() );
+ nextToken();
+ }
+
+ while( !lex->lookAhead(0).isNull() ){
+ DeclarationAST::Node def;
+ int startDecl = lex->index();
+ if( !parseDeclaration(def) ){
+ // error recovery
+ if( startDecl == lex->index() )
+ nextToken(); // skip at least one token
+ skipUntilDeclaration();
+ }
+ node->addDeclaration( def );
+ }
+
+ UPDATE_POS( node, start, lex->index() );
+
+ // force (0,0) as start position
+ node->setStartPosition( 0, 0 );
+
+ return m_problems == 0;
+}
+
+bool Parser::parseDeclaration( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclaration()" << endl;
+
+ int start = lex->index();
+
+ switch( lex->lookAhead(0) ){
+
+ case ';':
+ nextToken();
+ return true;
+
+ case Token_extern:
+ return parseLinkageSpecification( node );
+
+ case Token_namespace:
+ return parseNamespace( node );
+
+ case Token_using:
+ return parseUsing( node );
+
+ case Token_typedef:
+ return parseTypedef( node );
+
+ case Token_asm:
+ return parseAsmDefinition( node );
+
+ case Token_template:
+ case Token_export:
+ return parseTemplateDeclaration( node );
+
+ default:
+ {
+ // lex->setIndex( start );
+
+ if( objcp && parseObjcDef(node) )
+ return true;
+
+ lex->setIndex( start );
+
+ GroupAST::Node storageSpec;
+ parseStorageClassSpecifier( storageSpec );
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ TypeSpecifierAST::Node spec;
+ AST::Node declarator;
+ if( parseEnumSpecifier(spec) || parseClassSpecifier(spec) ) {
+ int line, c;
+ spec->getEndPosition( &line, &c );
+ spec->setCvQualify( cv );
+
+ GroupAST::Node cv2;
+ parseCvQualify( cv2 );
+ spec->setCv2Qualify( cv2 );
+
+ InitDeclaratorListAST::Node declarators;
+ parseInitDeclaratorList(declarators);
+
+ SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
+
+ ADVANCE( ';', ";" );
+
+ preparseLineComments( line );
+
+ ast->setComment( m_commentStore.getCommentInRange( line ) );
+
+ ast->setStorageSpecifier( storageSpec );
+ ast->setTypeSpec( spec );
+ ast->setInitDeclaratorList( declarators );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+ }
+
+ lex->setIndex( start );
+ return parseDeclarationInternal( node );
+ }
+
+ } // end switch
+}
+
+bool Parser::parseLinkageSpecification( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseLinkageSpecification()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_extern ){
+ return false;
+ }
+ nextToken();
+
+ LinkageSpecificationAST::Node ast = CreateNode<LinkageSpecificationAST>();
+
+ int startExternType = lex->index();
+ if( lex->lookAhead(0) == Token_string_literal ){
+ nextToken();
+ AST::Node externType = CreateNode<AST>();
+ UPDATE_POS( externType, startExternType, lex->index() );
+
+ ast->setExternType( externType );
+ }
+
+ if( lex->lookAhead(0) == '{' ){
+ LinkageBodyAST::Node linkageBody;
+ parseLinkageBody( linkageBody );
+ ast->setLinkageBody( linkageBody );
+ } else {
+ DeclarationAST::Node decl;
+ if( !parseDeclaration(decl) ){
+ reportError( i18n("Declaration syntax error") );
+ }
+ ast->setDeclaration( decl );
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseLinkageBody( LinkageBodyAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseLinkageBody()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != '{' ){
+ return false;
+ }
+ nextToken();
+
+ LinkageBodyAST::Node lba = CreateNode<LinkageBodyAST>();
+ node = lba;
+
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+
+ if( tk == '}' )
+ break;
+
+ DeclarationAST::Node def;
+ int startDecl = lex->index();
+ if( parseDeclaration(def) ){
+ node->addDeclaration( def );
+ } else {
+ // error recovery
+ if( startDecl == lex->index() )
+ nextToken(); // skip at least one token
+ skipUntilDeclaration();
+ }
+ }
+
+ clearComment();
+
+ if( lex->lookAhead(0) != '}' ){
+ reportError( i18n("} expected") );
+ } else
+ nextToken();
+
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+}
+
+bool Parser::parseNamespace( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseNamespace()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_namespace ){
+ return false;
+ }
+ nextToken();
+
+ int startNamespaceName = lex->index();
+ if( lex->lookAhead(0) == Token_identifier ){
+ nextToken();
+ }
+ AST::Node namespaceName = CreateNode<AST>();
+ UPDATE_POS( namespaceName, startNamespaceName, lex->index() );
+
+ if ( lex->lookAhead(0) == '=' ) {
+ // namespace alias
+ nextToken();
+
+ NameAST::Node name;
+ if( parseName(name) ){
+ ADVANCE( ';', ";" );
+
+ NamespaceAliasAST::Node ast = CreateNode<NamespaceAliasAST>();
+ ast->setNamespaceName( namespaceName );
+ ast->setAliasName( name );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+ } else {
+ reportError( i18n("namespace expected") );
+ return false;
+ }
+ } else if( lex->lookAhead(0) != '{' ){
+ reportError( i18n("{ expected") );
+ return false;
+ }
+
+ NamespaceAST::Node ast = CreateNode<NamespaceAST>();
+ ast->setNamespaceName( namespaceName );
+
+ LinkageBodyAST::Node linkageBody;
+ parseLinkageBody( linkageBody );
+
+ ast->setLinkageBody( linkageBody );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseUsing( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseUsing()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_using ){
+ return false;
+ }
+ nextToken();
+
+ if( lex->lookAhead(0) == Token_namespace ){
+ if( !parseUsingDirective(node) ){
+ return false;
+ }
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+
+ UsingAST::Node ast = CreateNode<UsingAST>();
+
+ int startTypeName = lex->index();
+ if( lex->lookAhead(0) == Token_typename ){
+ nextToken();
+ AST::Node tn = CreateNode<AST>();
+ UPDATE_POS( tn, startTypeName, lex->index() );
+ ast->setTypeName( tn );
+ }
+
+ NameAST::Node name;
+ if( !parseName(name) )
+ return false;
+
+ ast->setName( name );
+
+ ADVANCE( ';', ";" );
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseUsingDirective( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseUsingDirective()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_namespace ){
+ return false;
+ }
+ nextToken();
+
+ NameAST::Node name;
+ if( !parseName(name) ){
+ reportError( i18n("Namespace name expected") );
+ return false;
+ }
+
+ ADVANCE( ';', ";" );
+
+ UsingDirectiveAST::Node ast = CreateNode<UsingDirectiveAST>();
+ ast->setName( name );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+bool Parser::parseOperatorFunctionId( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseOperatorFunctionId()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_operator ){
+ return false;
+ }
+ nextToken();
+
+ AST::Node op;
+ if( parseOperator(op) ){
+ AST::Node asn = CreateNode<AST>();
+ node = asn;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ } else {
+ // parse cast operator
+ GroupAST::Node cv;
+ parseCvQualify(cv);
+
+ TypeSpecifierAST::Node spec;
+ if( !parseSimpleTypeSpecifier(spec) ){
+ syntaxError();
+ return false;
+ }
+ spec->setCvQualify( cv );
+
+ GroupAST::Node cv2;
+ parseCvQualify(cv2);
+ spec->setCv2Qualify( cv2 );
+
+ AST::Node ptrOp;
+ while( parsePtrOperator(ptrOp) )
+ ;
+
+ AST::Node asn = CreateNode<AST>();
+ node = asn;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+}
+
+bool Parser::parseTemplateArgumentList( TemplateArgumentListAST::Node& node, bool reportError )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTemplateArgumentList()" << endl;
+
+ int start = lex->index();
+
+ TemplateArgumentListAST::Node ast = CreateNode<TemplateArgumentListAST>();
+
+ AST::Node templArg;
+ if( !parseTemplateArgument(templArg) )
+ return false;
+ ast->addArgument( templArg );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseTemplateArgument(templArg) ){
+ if( reportError ){
+ syntaxError();
+ break;
+ } else
+ return false;
+ }
+ ast->addArgument( templArg );
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseTypedef( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTypedef()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_typedef ){
+ return false;
+ }
+ nextToken();
+
+ TypeSpecifierAST::Node spec;
+ if( !parseTypeSpecifierOrClassSpec(spec) ){
+ reportError( i18n("Need a type specifier to declare") );
+ return false;
+ }
+
+ InitDeclaratorListAST::Node declarators;
+ if( !parseInitDeclaratorList(declarators) ){
+ //reportError( i18n("Need an identifier to declare") );
+ //return false;
+ }
+
+ TypedefAST::Node ast = CreateNode<TypedefAST>();
+
+
+ if( comment() ) {
+ ast->setComment( comment() );
+ clearComment();
+
+ preparseLineComments( currentLine() );
+
+ if( comment() ) {
+ ast->addComment( comment() );
+ clearComment();
+ }
+ }
+
+ ADVANCE( ';', ";" );
+
+ ast->setTypeSpec( spec );
+ ast->setInitDeclaratorList( declarators );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseAsmDefinition( DeclarationAST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseAsmDefinition()" << endl;
+
+ ADVANCE( Token_asm, "asm" );
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ skip( '(', ')' );
+ ADVANCE( ')', ")" );
+ ADVANCE( ';', ';' );
+
+ return true;
+}
+
+bool Parser::parseTemplateDeclaration( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTemplateDeclaration()" << endl;
+
+ int start = lex->index();
+
+ AST::Node exp;
+
+ int startExport = lex->index();
+ if( lex->lookAhead(0) == Token_export ){
+ nextToken();
+ AST::Node n = CreateNode<AST>();
+ UPDATE_POS( n, startExport, lex->index() );
+ exp = n;
+ }
+
+ if( lex->lookAhead(0) != Token_template ){
+ return false;
+ }
+ nextToken();
+
+ TemplateParameterListAST::Node params;
+ if( lex->lookAhead(0) == '<' ){
+ nextToken();
+ parseTemplateParameterList( params );
+
+ ADVANCE( '>', ">" );
+ }
+
+ DeclarationAST::Node def;
+ if( !parseDeclaration(def) ){
+ reportError( i18n("expected a declaration") );
+ }
+
+ TemplateDeclarationAST::Node ast = CreateNode<TemplateDeclarationAST>();
+ ast->setExported( exp );
+ ast->setTemplateParameterList( params );
+ ast->setDeclaration( def );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseOperator( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseOperator()" << endl;
+ QString text = lex->lookAhead(0).text();
+
+ switch( lex->lookAhead(0) ){
+ case Token_new:
+ case Token_delete:
+ nextToken();
+ if( lex->lookAhead(0) == '[' && lex->lookAhead(1) == ']' ){
+ nextToken();
+ nextToken();
+ text += "[]";
+ }
+ return true;
+
+ case '+':
+ case '-':
+ case '*':
+ case '/':
+ case '%':
+ case '^':
+ case '&':
+ case '|':
+ case '~':
+ case '!':
+ case '=':
+ case '<':
+ case '>':
+ case ',':
+ case Token_assign:
+ case Token_shift:
+ case Token_eq:
+ case Token_not_eq:
+ case Token_leq:
+ case Token_geq:
+ case Token_and:
+ case Token_or:
+ case Token_incr:
+ case Token_decr:
+ case Token_ptrmem:
+ case Token_arrow:
+ nextToken();
+ return true;
+
+ default:
+ if( lex->lookAhead(0) == '(' && lex->lookAhead(1) == ')' ){
+ nextToken();
+ nextToken();
+ return true;
+ } else if( lex->lookAhead(0) == '[' && lex->lookAhead(1) == ']' ){
+ nextToken();
+ nextToken();
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Parser::parseCvQualify( GroupAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCvQualify()" << endl;
+
+ int start = lex->index();
+
+ GroupAST::Node ast = CreateNode<GroupAST>();
+
+ int n = 0;
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+ if( tk == Token_const || tk == Token_volatile ){
+ ++n;
+ int startWord = lex->index();
+ nextToken();
+ AST::Node word = CreateNode<AST>();
+ UPDATE_POS( word, startWord, lex->index() );
+ ast->addNode( word );
+ } else
+ break;
+ }
+
+ if( n == 0 )
+ return false;
+
+
+ ////kdDebug(9007)<< "-----------------> token = " << lex->lookAhead(0).text() << endl;
+ UPDATE_POS( ast, start, lex->index() );
+
+ node = ast;
+ return true;
+}
+
+bool Parser::parseSimpleTypeSpecifier( TypeSpecifierAST::Node& node )
+{
+ int start = lex->index();
+ bool isIntegral = false;
+ bool done = false;
+
+ while( !done ){
+
+ switch( lex->lookAhead(0) ){
+ case Token_char:
+ case Token_wchar_t:
+ case Token_bool:
+ case Token_short:
+ case Token_int:
+ case Token_long:
+ case Token_signed:
+ case Token_unsigned:
+ case Token_float:
+ case Token_double:
+ case Token_void:
+ isIntegral = true;
+ nextToken();
+ break;
+
+ default:
+ done = true;
+ }
+ }
+
+ TypeSpecifierAST::Node ast = CreateNode<TypeSpecifierAST>();
+ if( isIntegral ){
+ ClassOrNamespaceNameAST::Node cl = CreateNode<ClassOrNamespaceNameAST>();
+
+ AST::Node n = CreateNode<AST>();
+ UPDATE_POS( n, start, lex->index() );
+ cl->setName( n );
+ UPDATE_POS( cl, start, lex->index() );
+
+ NameAST::Node name = CreateNode<NameAST>();
+ name->setUnqualifiedName( cl );
+ UPDATE_POS( name, start, lex->index() );
+ ast->setName( name );
+
+ } else {
+ NameAST::Node name;
+ if( !parseName(name) ){
+ lex->setIndex( start );
+ return false;
+ }
+ ast->setName( name );
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parsePtrOperator( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parsePtrOperator()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) == '&' ){
+ nextToken();
+ } else if( lex->lookAhead(0) == '*' ){
+ nextToken();
+ } else {
+ int index = lex->index();
+ AST::Node memPtr;
+ if( !parsePtrToMember(memPtr) ){
+ lex->setIndex( index );
+ return false;
+ }
+ }
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+bool Parser::parseTemplateArgument( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTemplateArgument()" << endl;
+
+ int start = lex->index();
+ if( parseTypeId(node) ){
+ if( lex->lookAhead(0) == ',' || lex->lookAhead(0) == '>' )
+ return true;
+ }
+
+ lex->setIndex( start );
+ if( !parseLogicalOrExpression(node, true) ){
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseTypeSpecifier( TypeSpecifierAST::Node& spec )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTypeSpecifier()" << endl;
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ if( parseElaboratedTypeSpecifier(spec) || parseSimpleTypeSpecifier(spec) ){
+ spec->setCvQualify( cv );
+
+ GroupAST::Node cv2;
+ parseCvQualify( cv2 );
+ spec->setCv2Qualify( cv2 );
+
+ return true;
+ }
+
+ return false;
+}
+
+bool Parser::parseDeclarator( DeclaratorAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclarator()" << endl;
+
+ int start = lex->index();
+
+ DeclaratorAST::Node ast = CreateNode<DeclaratorAST>();
+
+ DeclaratorAST::Node decl;
+ NameAST::Node declId;
+
+ AST::Node ptrOp;
+ while( parsePtrOperator(ptrOp) ){
+ ast->addPtrOp( ptrOp );
+ }
+
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+
+ if( !parseDeclarator(decl) ){
+ return false;
+ }
+ ast->setSubDeclarator( decl );
+
+ if( lex->lookAhead(0) != ')'){
+ return false;
+ }
+ nextToken();
+ } else {
+
+ if( lex->lookAhead(0) == ':' ){
+ // unnamed bitfield
+ } else if( parseDeclaratorId(declId) ){
+ ast->setDeclaratorId( declId );
+ } else {
+ lex->setIndex( start );
+ return false;
+ }
+
+ if( lex->lookAhead(0) == ':' ){
+ nextToken();
+ AST::Node expr;
+ if( !parseConstantExpression(expr) ){
+ reportError( i18n("Constant expression expected") );
+ }
+ goto update_pos;
+ }
+ }
+
+ {
+ bool isVector = true;
+
+ while( lex->lookAhead(0) == '[' ){
+ int startArray = lex->index();
+ nextToken();
+ AST::Node expr;
+ parseCommaExpression( expr );
+
+ ADVANCE( ']', "]" );
+ AST::Node array = CreateNode<AST>();
+ UPDATE_POS( array, startArray, lex->index() );
+ ast->addArrayDimension( array );
+ isVector = true;
+ }
+
+ bool skipParen = false;
+ if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(1) == '(' && lex->lookAhead(2) == '(' ){
+ nextToken();
+ nextToken();
+ skipParen = true;
+ }
+
+ if( ast->subDeclarator() && (!isVector || lex->lookAhead(0) != '(') ){
+ lex->setIndex( start );
+ return false;
+ }
+
+ int index = lex->index();
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+
+ ParameterDeclarationClauseAST::Node params;
+ if( !parseParameterDeclarationClause(params) ){
+ ////kdDebug(9007)<< "----------------------> not a parameter declaration, maybe an initializer!?" << endl;
+ lex->setIndex( index );
+ goto update_pos;
+ }
+ ast->setParameterDeclarationClause( params );
+
+ if( lex->lookAhead(0) != ')' ){
+ lex->setIndex( index );
+ goto update_pos;
+ }
+
+ nextToken(); // skip ')'
+
+ int startConstant = lex->index();
+ if( lex->lookAhead(0) == Token_const ){
+ nextToken();
+ AST::Node constant = CreateNode<AST>();
+ UPDATE_POS( constant, startConstant, lex->index() );
+ ast->setConstant( constant );
+ }
+
+ GroupAST::Node except;
+ if( parseExceptionSpecification(except) ){
+ ast->setExceptionSpecification( except );
+ }
+ }
+
+ if( skipParen ){
+ if( lex->lookAhead(0) != ')' ){
+ reportError( i18n("')' expected") );
+ } else
+ nextToken();
+ }
+
+ }
+
+update_pos:
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseAbstractDeclarator( DeclaratorAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclarator()" << endl;
+ int start = lex->index();
+
+ DeclaratorAST::Node ast = CreateNode<DeclaratorAST>();
+
+ DeclaratorAST::Node decl;
+ NameAST::Node declId;
+
+ AST::Node ptrOp;
+ while( parsePtrOperator(ptrOp) ){
+ ast->addPtrOp( ptrOp );
+ }
+
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+
+ if( !parseAbstractDeclarator(decl) ){
+ return false;
+ }
+ ast->setSubDeclarator( decl );
+
+ if( lex->lookAhead(0) != ')'){
+ return false;
+ }
+ nextToken();
+ }
+
+ {
+
+ while( lex->lookAhead(0) == '[' ){
+ int startArray = lex->index();
+ nextToken();
+ AST::Node expr;
+ skipCommaExpression( expr );
+
+ ADVANCE( ']', "]" );
+ AST::Node array = CreateNode<AST>();
+ UPDATE_POS( array, startArray, lex->index() );
+ ast->addArrayDimension( array );
+ }
+
+ bool skipParen = false;
+ if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(1) == '(' && lex->lookAhead(2) == '(' ){
+ nextToken();
+ nextToken();
+ skipParen = true;
+ }
+
+ int index = lex->index();
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+
+ ParameterDeclarationClauseAST::Node params;
+ if( !parseParameterDeclarationClause(params) ){
+ lex->setIndex( index );
+ goto UPDATE_POS;
+ }
+ ast->setParameterDeclarationClause( params );
+
+ if( lex->lookAhead(0) != ')' ){
+ lex->setIndex( index );
+ goto UPDATE_POS;
+ } else
+ nextToken();
+
+ int startConstant = lex->index();
+ if( lex->lookAhead(0) == Token_const ){
+ nextToken();
+ AST::Node constant = CreateNode<AST>();
+ UPDATE_POS( constant, startConstant, lex->index() );
+ ast->setConstant( constant );
+ }
+
+ GroupAST::Node except;
+ if( parseExceptionSpecification(except) ){
+ ast->setExceptionSpecification( except );
+ }
+ }
+
+ if( skipParen ){
+ if( lex->lookAhead(0) != ')' ){
+ reportError( i18n("')' expected") );
+ } else
+ nextToken();
+ }
+
+ }
+
+UPDATE_POS:
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+bool Parser::parseEnumSpecifier( TypeSpecifierAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseEnumSpecifier()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_enum ){
+ return false;
+ }
+
+ nextToken();
+
+ Comment c = comment();
+ clearComment();
+ NameAST::Node name;
+ parseName( name );
+
+ if( lex->lookAhead(0) != '{' ){
+ lex->setIndex( start );
+ return false;
+ }
+ nextToken();
+
+ EnumSpecifierAST::Node ast = CreateNode<EnumSpecifierAST>();
+ ast->setName( name );
+
+ ast->setComment( c );
+
+ EnumeratorAST::Node enumerator;
+ if( parseEnumerator(enumerator) ){
+ ast->addEnumerator( enumerator );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseEnumerator(enumerator) ){
+ //reportError( i18n("Enumerator expected") );
+ break;
+ }
+
+ ast->addEnumerator( enumerator );
+ }
+ }
+
+ clearComment( );
+
+ if( lex->lookAhead(0) != '}' )
+ reportError( i18n("} missing") );
+ else
+ nextToken();
+
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseTemplateParameterList( TemplateParameterListAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTemplateParameterList()" << endl;
+
+ int start = lex->index();
+
+ TemplateParameterListAST::Node ast = CreateNode<TemplateParameterListAST>();
+
+ TemplateParameterAST::Node param;
+ if( !parseTemplateParameter(param) ){
+ return false;
+ }
+ ast->addTemplateParameter( param );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseTemplateParameter(param) ){
+ syntaxError();
+ break;
+ } else {
+ ast->addTemplateParameter( param );
+ }
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseTemplateParameter( TemplateParameterAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTemplateParameter()" << endl;
+
+ int start = lex->index();
+ TemplateParameterAST::Node ast = CreateNode<TemplateParameterAST>();
+
+ TypeParameterAST::Node typeParameter;
+ ParameterDeclarationAST::Node param;
+
+ int tk = lex->lookAhead( 0 );
+
+ if( (tk == Token_class || tk == Token_typename || tk == Token_template) && parseTypeParameter(typeParameter) ){
+ ast->setTypeParameter( typeParameter );
+ goto ok;
+ }
+
+ if( !parseParameterDeclaration(param) )
+ return false;
+ ast->setTypeValueParameter( param );
+
+ok:
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseTypeParameter( TypeParameterAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTypeParameter()" << endl;
+
+ int start = lex->index();
+ TypeParameterAST::Node ast = CreateNode<TypeParameterAST>();
+
+ AST_FROM_TOKEN( kind, lex->index() );
+ ast->setKind( kind );
+
+ switch( lex->lookAhead(0) ){
+
+ case Token_class:
+ case Token_typename:
+ {
+ nextToken(); // skip class
+
+ // parse optional name
+ NameAST::Node name;
+ if( parseName(name) ){
+ ast->setName( name );
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ AST::Node typeId;
+ if( !parseTypeId(typeId) ){
+ syntaxError();
+ return false;
+ }
+ ast->setTypeId( typeId );
+ }
+ }
+ }
+ break;
+
+ case Token_template:
+ {
+ nextToken(); // skip template
+ ADVANCE( '<', '<' );
+
+ TemplateParameterListAST::Node params;
+ if( !parseTemplateParameterList(params) ){
+ return false;
+ }
+ ast->setTemplateParameterList( params );
+
+ ADVANCE( '>', ">" );
+
+ if( lex->lookAhead(0) == Token_class )
+ nextToken();
+
+ // parse optional name
+ NameAST::Node name;
+ if( parseName(name) ){
+ ast->setName( name );
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ AST::Node typeId;
+ if( !parseTypeId(typeId) ){
+ syntaxError();
+ return false;
+ }
+ ast->setTypeId( typeId );
+ }
+ }
+
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ NameAST::Node templ_name;
+ parseName( templ_name );
+ }
+ }
+ break;
+
+ default:
+ return false;
+
+ } // end switch
+
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseStorageClassSpecifier( GroupAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseStorageClassSpecifier()" << endl;
+
+ int start = lex->index();
+ GroupAST::Node ast = CreateNode<GroupAST>();
+
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+ if( tk == Token_friend || tk == Token_auto || tk == Token_register || tk == Token_static ||
+ tk == Token_extern || tk == Token_mutable ){
+ int startNode = lex->index();
+ nextToken();
+
+ AST::Node n = CreateNode<AST>();
+ UPDATE_POS( n, startNode, lex->index() );
+ ast->addNode( n );
+ } else
+ break;
+ }
+
+ if( ast->nodeList().count() == 0 )
+ return false;
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseFunctionSpecifier( GroupAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseFunctionSpecifier()" << endl;
+
+ int start = lex->index();
+ GroupAST::Node ast = CreateNode<GroupAST>();
+
+ while( !lex->lookAhead(0).isNull() ){
+ int tk = lex->lookAhead( 0 );
+ if( tk == Token_inline || tk == Token_virtual || tk == Token_explicit ){
+ int startNode = lex->index();
+ nextToken();
+
+ AST::Node n = CreateNode<AST>();
+ UPDATE_POS( n, startNode, lex->index() );
+ ast->addNode( n );
+ } else {
+ break;
+ }
+ }
+
+ if( ast->nodeList().count() == 0 )
+ return false;
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseTypeId( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTypeId()" << endl;
+
+ /// @todo implement the AST for typeId
+ int start = lex->index();
+ AST::Node ast = CreateNode<AST>();
+
+ TypeSpecifierAST::Node spec;
+ if( !parseTypeSpecifier(spec) ){
+ return false;
+ }
+
+ DeclaratorAST::Node decl;
+ parseAbstractDeclarator( decl );
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseInitDeclaratorList( InitDeclaratorListAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitDeclaratorList()" << endl;
+
+ int start = lex->index();
+
+ InitDeclaratorListAST::Node ast = CreateNode<InitDeclaratorListAST>();
+ InitDeclaratorAST::Node decl;
+
+ if( !parseInitDeclarator(decl) ){
+ return false;
+ }
+ ast->addInitDeclarator( decl );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseInitDeclarator(decl) ){
+ syntaxError();
+ break;
+ }
+ ast->addInitDeclarator( decl );
+ }
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitDeclaratorList() -- end" << endl;
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseParameterDeclarationClause( ParameterDeclarationClauseAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseParameterDeclarationClause()" << endl;
+
+ int start = lex->index();
+
+ ParameterDeclarationClauseAST::Node ast = CreateNode<ParameterDeclarationClauseAST>();
+
+ ParameterDeclarationListAST::Node params;
+ if( !parseParameterDeclarationList(params) ){
+
+ if ( lex->lookAhead(0) == ')' )
+ goto good;
+
+ if( lex->lookAhead(0) == Token_ellipsis && lex->lookAhead(1) == ')' ){
+ AST_FROM_TOKEN( ellipsis, lex->index() );
+ ast->setEllipsis( ellipsis );
+ nextToken();
+ goto good;
+ }
+ return false;
+ }
+
+ if( lex->lookAhead(0) == Token_ellipsis ){
+ AST_FROM_TOKEN( ellipsis, lex->index() );
+ ast->setEllipsis( ellipsis );
+ nextToken();
+ }
+
+good:
+ ast->setParameterDeclarationList( params );
+
+ /// @todo add ellipsis
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+void Parser::nextToken( bool skipComm ) {
+ lex->nextToken();
+ if( skipComm ) {
+ if( lex->lookAhead(0) == Token_comment ) {
+ processComment();
+ nextToken();
+ }
+ }
+}
+
+
+Comment Parser::comment() {
+ return m_commentStore.latestComment();
+}
+
+
+void Parser::preparseLineComments( int l ) {
+ for( int a = 0; a < 40; a++ ) {
+ if( lex->lookAhead(a).isNull() ) break;
+ int line, col;
+ lex->lookAhead( a ).getStartPosition( &line, &col );
+ if( line < l ) {
+ continue;
+ } else if( line == l ) {
+ if( lex->lookAhead( a ) == Token_comment ) {
+ processComment( a );
+ }
+ } else {
+ break;
+ }
+ }
+}
+
+
+void Parser::processComment( int offset ) {
+ int line, col;
+ lex->lookAhead( offset ).getStartPosition( &line, &col );
+ m_commentStore.addComment( Comment( lex->lookAhead(offset).text(), line ) );
+}
+
+template<class Type>
+void Parser::eventuallyTakeComment( int startLn, int endLn, Type& ast ) {
+ if( comment().line() >= startLn && comment().line() <= endLn ) {
+ if( &(*ast) ) {
+ if( comment() ) {
+ ast->setComment( comment() );
+ }
+ }
+
+ clearComment();
+ }
+}
+
+template<class Type>
+void Parser::eventuallyTakeComment( Type& ast ) {
+ if( &(*ast) && comment() ) {
+ ast->setComment( comment() );
+ }
+
+ clearComment();
+}
+
+void Parser::clearComment( ) {
+
+ m_commentStore.clear();
+
+}
+
+int Parser::currentLine() {
+ int ln, col;
+ lex->lookAhead( 0 ).getStartPosition( &ln, &col );
+ return ln;
+}
+
+bool Parser::parseParameterDeclarationList( ParameterDeclarationListAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseParameterDeclarationList()" << endl;
+
+ int start = lex->index();
+
+ ParameterDeclarationListAST::Node ast = CreateNode<ParameterDeclarationListAST>();
+
+ ParameterDeclarationAST::Node param;
+ if( !parseParameterDeclaration(param) ){
+ lex->setIndex( start );
+ return false;
+ }
+ ast->addParameter( param );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( lex->lookAhead(0) == Token_ellipsis )
+ break;
+
+ if( !parseParameterDeclaration(param) ){
+ lex->setIndex( start );
+ return false;
+ }
+ ast->addParameter( param );
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseParameterDeclaration( ParameterDeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseParameterDeclaration()" << endl;
+
+ int start = lex->index();
+
+ // parse decl spec
+ TypeSpecifierAST::Node spec;
+ if( !parseTypeSpecifier(spec) ){
+ lex->setIndex( start );
+ return false;
+ }
+
+ int index = lex->index();
+
+ DeclaratorAST::Node decl;
+ if( !parseDeclarator(decl) ){
+ lex->setIndex( index );
+
+ // try with abstract declarator
+ if( !parseAbstractDeclarator(decl) )
+ return false;
+ }
+
+ AST::Node expr;
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+ if( !parseLogicalOrExpression(expr,true) ){
+ //reportError( i18n("Expression expected") );
+ }
+ }
+
+ ParameterDeclarationAST::Node ast = CreateNode<ParameterDeclarationAST>();
+ ast->setTypeSpec( spec );
+ ast->setDeclarator( decl );
+ ast->setExpression( expr );
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+bool Parser::parseClassSpecifier( TypeSpecifierAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseClassSpecifier()" << endl;
+
+ int start = lex->index();
+
+ AST::Node classKey;
+ int classKeyStart = lex->index();
+
+ int kind = lex->lookAhead( 0 );
+ if( kind == Token_class || kind == Token_struct || kind == Token_union ){
+ AST::Node asn = CreateNode<AST>();
+ classKey = asn;
+ nextToken();
+ UPDATE_POS( classKey, classKeyStart, lex->index() );
+ } else {
+ return false;
+ }
+
+ GroupAST::Node winDeclSpec;
+ parseWinDeclSpec( winDeclSpec );
+
+ while( lex->lookAhead(0) == Token_identifier && lex->lookAhead(1) == Token_identifier )
+ nextToken();
+
+ NameAST::Node name;
+ parseName( name );
+
+ BaseClauseAST::Node bases;
+ if( lex->lookAhead(0) == ':' ){
+ if( !parseBaseClause(bases) ){
+ skipUntil( '{' );
+ }
+ }
+
+ if( lex->lookAhead(0) != '{' ){
+ lex->setIndex( start );
+ return false;
+ }
+
+ ClassSpecifierAST::Node ast = CreateNode<ClassSpecifierAST>();
+
+ eventuallyTakeComment( ast );
+
+ ADVANCE( '{', '{' );
+
+
+ ast->setWinDeclSpec( winDeclSpec );
+ ast->setClassKey( classKey );
+ ast->setName( name );
+ ast->setBaseClause( bases );
+
+
+ while( !lex->lookAhead(0).isNull() ){
+ if( lex->lookAhead(0) == '}' )
+ break;
+
+ DeclarationAST::Node memSpec;
+ int startDecl = lex->index();
+ if( !parseMemberSpecification(memSpec) ){
+ if( startDecl == lex->index() )
+ nextToken(); // skip at least one token
+ skipUntilDeclaration();
+ } else
+ ast->addDeclaration( memSpec );
+ }
+
+ clearComment();
+
+ if( lex->lookAhead(0) != '}' ){
+ reportError( i18n("} missing") );
+ } else
+ nextToken();
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseAccessSpecifier( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseAccessSpecifier()" << endl;
+
+ int start = lex->index();
+
+ switch( lex->lookAhead(0) ){
+ case Token_public:
+ case Token_protected:
+ case Token_private: {
+ AST::Node asn = CreateNode<AST>();
+ node = asn;
+ nextToken();
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Parser::parseMemberSpecification( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMemberSpecification()" << endl;
+
+ int start = lex->index();
+
+ AST::Node access;
+
+ if( lex->lookAhead(0) == ';' ){
+ nextToken();
+ return true;
+ } else if( lex->lookAhead(0) == Token_Q_OBJECT || lex->lookAhead(0) == Token_K_DCOP ){
+ nextToken();
+ return true;
+ } else if( lex->lookAhead(0) == Token_signals || lex->lookAhead(0) == Token_k_dcop || lex->lookAhead(0) == Token_k_dcop_signals ){
+ AccessDeclarationAST::Node ast = CreateNode<AccessDeclarationAST>();
+ nextToken();
+ AST::Node n = CreateNode<AST>();
+ UPDATE_POS( n, start, lex->index() );
+ ast->addAccess( n );
+ ADVANCE( ':', ":" );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+ } else if( parseTypedef(node) ){
+ return true;
+ } else if( parseUsing(node) ){
+ return true;
+ } else if( parseTemplateDeclaration(node) ){
+ return true;
+ } else if( parseAccessSpecifier(access) ){
+ AccessDeclarationAST::Node ast = CreateNode<AccessDeclarationAST>();
+ ast->addAccess( access );
+
+ int startSlot = lex->index();
+ if( lex->lookAhead(0) == Token_slots ){
+ nextToken();
+ AST::Node sl = CreateNode<AST>();
+ UPDATE_POS( sl, startSlot, lex->index() );
+ ast->addAccess( sl );
+ }
+ ADVANCE( ':', ":" );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+ }
+
+ lex->setIndex( start );
+
+ GroupAST::Node storageSpec;
+ parseStorageClassSpecifier( storageSpec );
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ TypeSpecifierAST::Node spec;
+ if( parseEnumSpecifier(spec) || parseClassSpecifier(spec) ){
+ spec->setCvQualify( cv );
+
+ GroupAST::Node cv2;
+ parseCvQualify( cv2 );
+ spec->setCv2Qualify( cv2 );
+
+ InitDeclaratorListAST::Node declarators;
+ parseInitDeclaratorList( declarators );
+ ADVANCE( ';', ";" );
+
+ SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
+ ast->setTypeSpec( spec );
+ ast->setInitDeclaratorList( declarators );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+ }
+
+ lex->setIndex( start );
+ return parseDeclarationInternal( node );
+}
+
+bool Parser::parseCtorInitializer( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCtorInitializer()" << endl;
+
+ if( lex->lookAhead(0) != ':' ){
+ return false;
+ }
+ nextToken();
+
+ AST::Node inits;
+ if( !parseMemInitializerList(inits) ){
+ reportError( i18n("Member initializers expected") );
+ }
+
+ return true;
+}
+
+bool Parser::parseElaboratedTypeSpecifier( TypeSpecifierAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseElaboratedTypeSpecifier()" << endl;
+
+ int start = lex->index();
+
+ int tk = lex->lookAhead( 0 );
+ if( tk == Token_class ||
+ tk == Token_struct ||
+ tk == Token_union ||
+ tk == Token_enum ||
+ tk == Token_typename )
+ {
+ AST::Node kind = CreateNode<AST>();
+ nextToken();
+ UPDATE_POS( kind, start, lex->index() );
+
+ NameAST::Node name;
+
+ if( parseName(name) ){
+ ElaboratedTypeSpecifierAST::Node ast = CreateNode<ElaboratedTypeSpecifierAST>();
+ ast->setKind( kind );
+ ast->setName( name );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+ }
+ }
+
+ lex->setIndex( start );
+ return false;
+}
+
+bool Parser::parseDeclaratorId( NameAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclaratorId()" << endl;
+ return parseName( node );
+}
+
+bool Parser::parseExceptionSpecification( GroupAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseExceptionSpecification()" << endl;
+
+ if( lex->lookAhead(0) != Token_throw ){
+ return false;
+ }
+ nextToken();
+
+ ADVANCE( '(', "(" );
+ if( lex->lookAhead(0) == Token_ellipsis ){
+ // extension found in MSVC++ 7.x headers
+ int start = lex->index();
+ GroupAST::Node ast = CreateNode<GroupAST>();
+ AST_FROM_TOKEN( ellipsis, lex->index() );
+ ast->addNode( ellipsis );
+ nextToken();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ } else if( lex->lookAhead(0) == ')' ) {
+ node = CreateNode<GroupAST>();
+ } else {
+ parseTypeIdList( node );
+ }
+ ADVANCE( ')', ")" );
+
+ return true;
+}
+
+bool Parser::parseEnumerator( EnumeratorAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseEnumerator()" << endl;
+
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_identifier ){
+ return false;
+ }
+
+ nextToken();
+
+
+ EnumeratorAST::Node ena = CreateNode<EnumeratorAST>();
+ node = ena;
+
+ AST::Node id = CreateNode<AST>();
+ UPDATE_POS( id, start, lex->index() );
+ node->setId( id );
+ int line = currentLine();
+
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ AST::Node expr;
+ line = currentLine();
+ if( !parseConstantExpression(expr) ){
+ reportError( i18n("Constant expression expected") );
+ }
+ node->setExpr( expr );
+ }
+
+ UPDATE_POS( node, start, lex->index() );
+
+ preparseLineComments( line );
+
+ node->setComment( m_commentStore.getCommentInRange( line ) );
+
+ return true;
+}
+
+bool Parser::parseInitDeclarator( InitDeclaratorAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitDeclarator()" << endl;
+
+ int start = lex->index();
+
+ DeclaratorAST::Node decl;
+ AST::Node init;
+ if( !parseDeclarator(decl) ){
+ return false;
+ }
+
+ parseInitializer( init );
+
+ InitDeclaratorAST::Node ast = CreateNode<InitDeclaratorAST>();
+ ast->setDeclarator( decl );
+ ast->setInitializer( init );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+
+bool Parser::parseBaseClause( BaseClauseAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseBaseClause()" << endl;
+
+ int start = lex->index();
+ if( lex->lookAhead(0) != ':' ){
+ return false;
+ }
+ nextToken();
+
+ BaseClauseAST::Node bca = CreateNode<BaseClauseAST>();
+
+ BaseSpecifierAST::Node baseSpec;
+ if( parseBaseSpecifier(baseSpec) ){
+ bca->addBaseSpecifier( baseSpec );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseBaseSpecifier(baseSpec) ){
+ reportError( i18n("Base class specifier expected") );
+ return false;
+ }
+ bca->addBaseSpecifier( baseSpec );
+ }
+ } else
+ return false;
+
+ UPDATE_POS( bca, start, lex->index() );
+ node = bca;
+
+ return true;
+}
+
+bool Parser::parseInitializer( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitializer()" << endl;
+
+ if( lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ AST::Node init;
+ if( !parseInitializerClause(node) ){
+ reportError( i18n("Initializer clause expected") );
+ return false;
+ }
+ } else if( lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node expr;
+ skipCommaExpression( expr );
+
+ ADVANCE( ')', ")" );
+ }
+
+ return false;
+}
+
+bool Parser::parseMemInitializerList( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMemInitializerList()" << endl;
+
+ AST::Node init;
+ if( !parseMemInitializer(init) ){
+ return false;
+ }
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( parseMemInitializer(init) ){
+ } else {
+ break;
+ }
+ }
+
+ return true;
+}
+
+bool Parser::parseMemInitializer( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMemInitializer()" << endl;
+
+ NameAST::Node initId;
+ if( !parseMemInitializerId(initId) ){
+ reportError( i18n("Identifier expected") );
+ return false;
+ }
+ ADVANCE( '(', '(' );
+ AST::Node expr;
+ skipCommaExpression( expr );
+ ADVANCE( ')', ')' );
+
+ return true;
+}
+
+bool Parser::parseTypeIdList( GroupAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTypeIdList()" << endl;
+
+ int start = lex->index();
+
+ AST::Node typeId;
+ if( !parseTypeId(typeId) ){
+ return false;
+ }
+
+ GroupAST::Node ast = CreateNode<GroupAST>();
+ ast->addNode( typeId );
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+ if( parseTypeId(typeId) ){
+ ast->addNode( typeId );
+ } else {
+ reportError( i18n("Type id expected") );
+ break;
+ }
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseBaseSpecifier( BaseSpecifierAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseBaseSpecifier()" << endl;
+
+ int start = lex->index();
+ BaseSpecifierAST::Node ast = CreateNode<BaseSpecifierAST>();
+
+ AST::Node access;
+ if( lex->lookAhead(0) == Token_virtual ){
+ AST_FROM_TOKEN( virt, lex->index() );
+ ast->setIsVirtual( virt );
+
+ nextToken();
+
+ parseAccessSpecifier( access );
+ } else {
+ parseAccessSpecifier( access );
+
+ if( lex->lookAhead(0) == Token_virtual ){
+ AST_FROM_TOKEN( virt, lex->index() );
+ ast->setIsVirtual( virt );
+ nextToken();
+ }
+ }
+
+ NameAST::Node name;
+ if( !parseName(name) ){
+ reportError( i18n("Class name expected") );
+ }
+
+ ast->setAccess( access );
+ ast->setName( name );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+
+bool Parser::parseInitializerClause( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitializerClause()" << endl;
+
+ if( lex->lookAhead(0) == '{' ){
+ if( !skip('{','}') ){
+ reportError( i18n("} missing") );
+ } else {
+ clearComment();
+ nextToken();
+ }
+ } else {
+ if( !parseAssignmentExpression(node) ){
+ //reportError( i18n("Expression expected") );
+ }
+ }
+
+ return true;
+}
+
+bool Parser::parseMemInitializerId( NameAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMemInitializerId()" << endl;
+
+ return parseName( node );
+}
+
+bool Parser::parsePtrToMember( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parsePtrToMember()" << endl;
+
+ if( lex->lookAhead(0) == Token_scope ){
+ nextToken();
+ }
+
+ while( lex->lookAhead(0) == Token_identifier ){
+ nextToken();
+
+ if( lex->lookAhead(0) == Token_scope && lex->lookAhead(1) == '*' ){
+ nextToken(); // skip ::
+ nextToken(); // skip *
+ return true;
+ } else
+ break;
+ }
+
+ return false;
+}
+
+bool Parser::parseUnqualifiedName( ClassOrNamespaceNameAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseUnqualifiedName()" << endl;
+
+ int start = lex->index();
+ bool isDestructor = false;
+
+ ClassOrNamespaceNameAST::Node ast = CreateNode<ClassOrNamespaceNameAST>();
+
+ if( lex->lookAhead(0) == Token_identifier ){
+ int startName = lex->index();
+ AST::Node n = CreateNode<AST>();
+ nextToken();
+ UPDATE_POS( n, startName, lex->index() );
+ ast->setName( n );
+ } else if( lex->lookAhead(0) == '~' && lex->lookAhead(1) == Token_identifier ){
+ int startName = lex->index();
+ AST::Node n = CreateNode<AST>();
+ nextToken(); // skip ~
+ nextToken(); // skip classname
+ UPDATE_POS( n, startName, lex->index() );
+ ast->setName( n );
+ isDestructor = true;
+ } else if( lex->lookAhead(0) == Token_operator ){
+ AST::Node n;
+ if( !parseOperatorFunctionId(n) )
+ return false;
+ ast->setName( n );
+ } else {
+ return false;
+ }
+
+ if( !isDestructor ){
+
+ int index = lex->index();
+
+ if( lex->lookAhead(0) == '<' ){
+ nextToken();
+
+ // optional template arguments
+ TemplateArgumentListAST::Node args;
+ parseTemplateArgumentList( args );
+
+ if( lex->lookAhead(0) != '>' ){
+ lex->setIndex( index );
+ } else {
+ nextToken();
+ ast->setTemplateArgumentList( args );
+ }
+ }
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseStringLiteral( AST::Node& /*node*/ )
+{
+ while( !lex->lookAhead(0).isNull() ) {
+ if( lex->lookAhead(0) == Token_identifier &&
+ lex->lookAhead(0).text() == "L" && lex->lookAhead(1) == Token_string_literal ) {
+
+ nextToken();
+ nextToken();
+ } else if( lex->lookAhead(0) == Token_string_literal ) {
+ nextToken();
+ } else
+ return false;
+ }
+ return true;
+}
+
+bool Parser::skipExpressionStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::skipExpressionStatement()" << endl;
+
+ int start = lex->index();
+
+ AST::Node expr;
+ skipCommaExpression( expr );
+
+ ADVANCE( ';', ";" );
+
+ ExpressionStatementAST::Node ast = CreateNode<ExpressionStatementAST>();
+ ast->setExpression( expr );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseStatement( StatementAST::Node& node ) // thanks to fiore@8080.it ;)
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseStatement()" << endl;
+ switch( lex->lookAhead(0) ){
+
+ case Token_while:
+ return parseWhileStatement( node );
+
+ case Token_do:
+ return parseDoStatement( node );
+
+ case Token_for:
+ return parseForStatement( node );
+
+ case Token_foreach:
+ return parseForEachStatement( node );
+
+ case Token_if:
+ return parseIfStatement( node );
+
+ case Token_switch:
+ return parseSwitchStatement( node );
+
+ case Token_try:
+ return parseTryBlockStatement( node );
+
+ case Token_case:
+ case Token_default:
+ return parseLabeledStatement( node );
+
+ case Token_break:
+ case Token_continue:
+ nextToken();
+ ADVANCE( ';', ";" );
+ return true;
+
+ case Token_goto:
+ nextToken();
+ ADVANCE( Token_identifier, "identifier" );
+ ADVANCE( ';', ";" );
+ return true;
+
+ case Token_return:
+ {
+ nextToken();
+ AST::Node expr;
+ skipCommaExpression( expr );
+ ADVANCE( ';', ";" );
+ }
+ return true;
+
+ case '{':
+ return parseCompoundStatement( node );
+
+ case Token_identifier:
+ if( parseLabeledStatement(node) )
+ return true;
+ break;
+ }
+
+ ////kdDebug(9007)<< "------------> try with declaration statement" << endl;
+ if ( parseDeclarationStatement(node) )
+ return true;
+
+ return skipExpressionStatement( node );
+}
+
+bool Parser::parseCondition( ConditionAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCondition()" << endl;
+
+ int start = lex->index();
+
+ ConditionAST::Node ast = CreateNode<ConditionAST>();
+
+ TypeSpecifierAST::Node spec;
+ if( parseTypeSpecifier(spec) ){
+ DeclaratorAST::Node decl;
+ if( parseDeclarator(decl) ) {
+ if( lex->lookAhead(0) == '=' ) {
+ nextToken();
+
+ AST::Node expr;
+ if( skipExpression(expr) ){
+ ast->setTypeSpec( spec );
+ ast->setDeclarator( decl );
+ ast->setExpression( expr );
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+ }
+ } else {
+ ast->setTypeSpec( spec );
+ ast->setDeclarator( decl );
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+ }
+ }
+ }
+
+ lex->setIndex( start );
+
+ AST::Node expr;
+ if( !skipCommaExpression(expr) )
+ return false;
+
+ ast->setExpression( expr );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+
+bool Parser::parseWhileStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseWhileStatement()" << endl;
+ int start = lex->index();
+
+ ADVANCE( Token_while, "while" );
+ ADVANCE( '(' , "(" );
+
+ ConditionAST::Node cond;
+ if( !parseCondition(cond) ){
+ reportError( i18n("condition expected") );
+ return false;
+ }
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node body;
+ if( !parseStatement(body) ){
+ reportError( i18n("statement expected") );
+ }
+
+ WhileStatementAST::Node ast = CreateNode<WhileStatementAST>();
+ ast->setCondition( cond );
+ ast->setStatement( body );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseDoStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDoStatement()" << endl;
+ int start = lex->index();
+
+ ADVANCE( Token_do, "do" );
+
+ StatementAST::Node body;
+ if( !parseStatement(body) ){
+ reportError( i18n("statement expected") );
+ //return false;
+ }
+
+ ADVANCE_NR( Token_while, "while" );
+ ADVANCE_NR( '(' , "(" );
+
+ AST::Node expr;
+ if( !skipCommaExpression(expr) ){
+ reportError( i18n("expression expected") );
+ //return false;
+ }
+
+ ADVANCE_NR( ')', ")" );
+ ADVANCE_NR( ';', ";" );
+
+ DoStatementAST::Node ast = CreateNode<DoStatementAST>();
+ ast->setStatement( body );
+ //ast->setCondition( condition );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseForStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseForStatement()" << endl;
+ int start = lex->index();
+
+ ADVANCE( Token_for, "for" );
+ ADVANCE( '(', "(" );
+
+ StatementAST::Node init;
+ if( !parseForInitStatement(init) ){
+ reportError( i18n("for initialization expected") );
+ return false;
+ }
+
+ ConditionAST::Node cond;
+ parseCondition( cond );
+ ADVANCE( ';', ";" );
+
+ AST::Node expr;
+ skipCommaExpression( expr );
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node body;
+ parseStatement(body);
+
+ ForStatementAST::Node ast = CreateNode<ForStatementAST>();
+ ast->setInitStatement( init );
+ ast->setCondition( cond );
+ // ast->setExpression( expression );
+ ast->setStatement( body );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+// qt4 [erbsland]
+///@todo add the right parsing for the foreach statement
+bool Parser::parseForEachStatement( StatementAST::Node& node )
+{
+ int start = lex->index();
+
+ ADVANCE( Token_foreach, "foreach" );
+ ADVANCE( '(', "(" );
+
+ AST::Node expr;
+ // replace with the right parsing
+ skipCommaExpression( expr );
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node body;
+ parseStatement(body);
+
+ ForEachStatementAST::Node ast = CreateNode<ForEachStatementAST>();
+ // add here the parser results
+ ast->setStatement( body );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseForInitStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseForInitStatement()" << endl;
+
+ if ( parseDeclarationStatement(node) )
+ return true;
+
+ return skipExpressionStatement( node );
+}
+
+bool Parser::parseCompoundStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCompoundStatement()" << endl;
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != '{' ){
+ return false;
+ }
+ nextToken();
+
+ StatementListAST::Node ast = CreateNode<StatementListAST>();
+
+ while( !lex->lookAhead(0).isNull() ){
+ if( lex->lookAhead(0) == '}' )
+ break;
+
+ StatementAST::Node stmt;
+ int startStmt = lex->index();
+ if( !parseStatement(stmt) ){
+ if( startStmt == lex->index() )
+ nextToken();
+ skipUntilStatement();
+ } else {
+ ast->addStatement( stmt );
+ }
+ }
+
+ clearComment();
+
+ if( lex->lookAhead(0) != '}' ){
+ reportError( i18n("} expected") );
+ } else {
+ nextToken();
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseIfStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseIfStatement()" << endl;
+
+ int start = lex->index();
+
+ ADVANCE( Token_if, "if" );
+
+ ADVANCE( '(' , "(" );
+
+ IfStatementAST::Node ast = CreateNode<IfStatementAST>();
+
+ ConditionAST::Node cond;
+ if( !parseCondition(cond) ){
+ reportError( i18n("condition expected") );
+ return false;
+ }
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node stmt;
+ if( !parseStatement(stmt) ){
+ reportError( i18n("statement expected") );
+ }
+
+ ast->setCondition( cond );
+ ast->setStatement( stmt );
+
+ if( lex->lookAhead(0) == Token_else ){
+ nextToken();
+ StatementAST::Node elseStmt;
+ if( !parseStatement(elseStmt) ) {
+ reportError( i18n("statement expected") );
+ }
+ ast->setElseStatement( elseStmt );
+ }
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseSwitchStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseSwitchStatement()" << endl;
+ int start = lex->index();
+ ADVANCE( Token_switch, "switch" );
+
+ ADVANCE( '(' , "(" );
+
+ ConditionAST::Node cond;
+ if( !parseCondition(cond) ){
+ reportError( i18n("condition expected") );
+ return false;
+ }
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node stmt;
+ if( !parseCompoundStatement(stmt) ){
+ syntaxError();
+ return false;
+ }
+
+ SwitchStatementAST::Node ast = CreateNode<SwitchStatementAST>();
+ ast->setCondition( cond );
+ ast->setStatement( stmt );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseLabeledStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseLabeledStatement()" << endl;
+ switch( lex->lookAhead(0) ){
+ case Token_identifier:
+ case Token_default:
+ if( lex->lookAhead(1) == ':' ){
+ nextToken();
+ nextToken();
+
+ StatementAST::Node stmt;
+ if( parseStatement(stmt) ){
+ node = stmt;
+ return true;
+ }
+ }
+ break;
+
+ case Token_case:
+ {
+ nextToken();
+ AST::Node expr;
+ if( !parseConstantExpression(expr) ){
+ reportError( i18n("expression expected") );
+ } else if( lex->lookAhead(0) == Token_ellipsis ){
+ nextToken();
+
+ AST::Node expr2;
+ if( !parseConstantExpression(expr2) ){
+ reportError( i18n("expression expected") );
+ }
+ }
+ ADVANCE( ':', ":" );
+
+ StatementAST::Node stmt;
+ if( parseStatement(stmt) ){
+ node = stmt;
+ return true;
+ }
+ }
+ break;
+
+ }
+
+ return false;
+}
+
+bool Parser::parseBlockDeclaration( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseBlockDeclaration()" << endl;
+ switch( lex->lookAhead(0) ) {
+ case Token_typedef:
+ return parseTypedef( node );
+ case Token_using:
+ return parseUsing( node );
+ case Token_asm:
+ return parseAsmDefinition( node );
+ case Token_namespace:
+ return parseNamespaceAliasDefinition( node );
+ }
+
+ int start = lex->index();
+
+ GroupAST::Node storageSpec;
+ parseStorageClassSpecifier( storageSpec );
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ TypeSpecifierAST::Node spec;
+ if ( !parseTypeSpecifierOrClassSpec(spec) ) { // replace with simpleTypeSpecifier?!?!
+ lex->setIndex( start );
+ return false;
+ }
+ spec->setCvQualify( cv );
+
+ GroupAST::Node cv2;
+ parseCvQualify( cv2 );
+ spec->setCv2Qualify( cv2 );
+
+ InitDeclaratorListAST::Node declarators;
+ parseInitDeclaratorList( declarators );
+
+ if( lex->lookAhead(0) != ';' ){
+ lex->setIndex( start );
+ return false;
+ }
+ nextToken();
+
+ SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
+ ast->setTypeSpec( spec );
+ ast->setInitDeclaratorList( declarators );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parseNamespaceAliasDefinition( DeclarationAST::Node& /*node*/ )
+{
+ if ( lex->lookAhead(0) != Token_namespace ) {
+ return false;
+ }
+ nextToken();
+
+ ADVANCE( Token_identifier, "identifier" );
+ ADVANCE( '=', "=" );
+
+ NameAST::Node name;
+ if( !parseName(name) ){
+ reportError( i18n("Namespace name expected") );
+ }
+
+ ADVANCE( ';', ";" );
+
+ return true;
+
+}
+
+bool Parser::parseDeclarationStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclarationStatement()" << endl;
+
+ int start = lex->index();
+
+ DeclarationAST::Node decl;
+ if ( !parseBlockDeclaration(decl) ){
+ return false;
+ }
+
+ DeclarationStatementAST::Node ast = CreateNode<DeclarationStatementAST>();
+ ast->setDeclaration( decl );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ ////kdDebug(9007)<< "---------------------> found a block declaration" << endl;
+ return true;
+}
+
+bool Parser::parseDeclarationInternal( DeclarationAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeclarationInternal()" << endl;
+
+ int start = lex->index();
+
+ // that is for the case '__declspec(dllexport) int ...' or
+ // '__declspec(dllexport) inline int ...', etc.
+ GroupAST::Node winDeclSpec;
+ parseWinDeclSpec( winDeclSpec );
+
+ GroupAST::Node funSpec;
+ bool hasFunSpec = parseFunctionSpecifier( funSpec );
+
+ GroupAST::Node storageSpec;
+ bool hasStorageSpec = parseStorageClassSpecifier( storageSpec );
+
+ if( hasStorageSpec && !hasFunSpec )
+ hasFunSpec = parseFunctionSpecifier( funSpec );
+
+ // that is for the case 'friend __declspec(dllexport) ....'
+ GroupAST::Node winDeclSpec2;
+ parseWinDeclSpec( winDeclSpec2 );
+
+ GroupAST::Node cv;
+ parseCvQualify( cv );
+
+ int index = lex->index();
+ NameAST::Node name;
+ if( parseName(name) && lex->lookAhead(0) == '(' ){
+ // no type specifier, maybe a constructor or a cast operator??
+
+ lex->setIndex( index );
+
+ InitDeclaratorAST::Node declarator;
+ if( parseInitDeclarator(declarator) ){
+ int endSignature = lex->index();
+
+ switch( lex->lookAhead(0) ){
+ case ';':
+ {
+ nextToken();
+
+ InitDeclaratorListAST::Node declarators = CreateNode<InitDeclaratorListAST>();
+
+ // update declarators position
+ int startLine, startColumn, endLine, endColumn;
+ if( declarator.get() ){
+ declarator->getStartPosition( &startLine, &startColumn );
+ declarator->getEndPosition( &endLine, &endColumn );
+ declarators->setStartPosition( startLine, startColumn );
+ declarators->setEndPosition( endLine, endColumn );
+ }
+ declarators->addInitDeclarator( declarator );
+
+ SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
+ ast->setInitDeclaratorList( declarators );
+ ast->setText( toString(start, endSignature) );
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+
+ }
+ break;
+
+ case ':':
+ {
+ AST::Node ctorInit;
+ StatementListAST::Node funBody;
+ if( parseCtorInitializer(ctorInit) && parseFunctionBody(funBody) ){
+ FunctionDefinitionAST::Node ast = CreateNode<FunctionDefinitionAST>();
+ ast->setStorageSpecifier( storageSpec );
+ ast->setFunctionSpecifier( funSpec );
+ ast->setInitDeclarator( declarator );
+ ast->setFunctionBody( funBody );
+ ast->setText( toString(start, endSignature) );
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+ }
+ break;
+
+ case '{':
+ {
+ StatementListAST::Node funBody;
+ if( parseFunctionBody(funBody) ){
+ FunctionDefinitionAST::Node ast = CreateNode<FunctionDefinitionAST>();
+ ast->setStorageSpecifier( storageSpec );
+ ast->setFunctionSpecifier( funSpec );
+ ast->setInitDeclarator( declarator );
+ ast->setText( toString(start, endSignature) );
+ ast->setFunctionBody( funBody );
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+ }
+ break;
+
+ case '(':
+ case '[':
+ // ops!! it seems a declarator
+ goto start_decl;
+ break;
+ }
+
+ }
+
+ syntaxError();
+ return false;
+ }
+
+start_decl:
+ lex->setIndex( index );
+
+ if( lex->lookAhead(0) == Token_const && lex->lookAhead(1) == Token_identifier && lex->lookAhead(2) == '=' ){
+ // constant definition
+ nextToken();
+ InitDeclaratorListAST::Node declarators;
+ if( parseInitDeclaratorList(declarators) ){
+ ADVANCE( ';', ";" );
+ DeclarationAST::Node ast = CreateNode<DeclarationAST>();
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+ syntaxError();
+ return false;
+ }
+
+ Comment mcomment = comment();
+ clearComment();
+
+ TypeSpecifierAST::Node spec;
+ if( parseTypeSpecifier(spec) ){
+ if ( !hasFunSpec )
+ parseFunctionSpecifier( funSpec ); // e.g. "void inline"
+ spec->setCvQualify( cv );
+
+ InitDeclaratorListAST::Node declarators;
+
+ InitDeclaratorAST::Node decl;
+ int startDeclarator = lex->index();
+ bool maybeFunctionDefinition = false;
+
+ if( lex->lookAhead(0) != ';' ){
+ if( parseInitDeclarator(decl) && lex->lookAhead(0) == '{' ){
+ // function definition
+ maybeFunctionDefinition = true;
+ } else {
+ lex->setIndex( startDeclarator );
+ if( !parseInitDeclaratorList(declarators) ){
+ syntaxError();
+ return false;
+ }
+ }
+ }
+
+ int endSignature = lex->index();
+ switch( lex->lookAhead(0) ){
+ case ';':
+ {
+ nextToken();
+ SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
+ int line, col;
+ ast->setComment( mcomment );
+ if( &(*decl) ) {
+ decl->getEndPosition( &line, &col );
+
+ preparseLineComments( line );
+ Comment c = m_commentStore.getCommentInRange( line );
+ if( c ) {
+ ast->addComment( c );
+ }
+ }
+
+ ast->setStorageSpecifier( storageSpec );
+ ast->setFunctionSpecifier( funSpec );
+ ast->setText( toString(start, endSignature) );
+ ast->setTypeSpec( spec );
+ ast->setWinDeclSpec( winDeclSpec );
+ ast->setInitDeclaratorList( declarators );
+
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ }
+ return true;
+
+ case '{':
+ {
+ if( !maybeFunctionDefinition ){
+ syntaxError();
+ return false;
+ }
+ StatementListAST::Node funBody;
+ if ( parseFunctionBody(funBody) ) {
+ FunctionDefinitionAST::Node ast = CreateNode<FunctionDefinitionAST>();
+
+ ast->setComment( mcomment );
+
+ ast->setWinDeclSpec( winDeclSpec );
+ ast->setStorageSpecifier( storageSpec );
+ ast->setFunctionSpecifier( funSpec );
+ ast->setText( toString(start, endSignature) );
+ ast->setTypeSpec( spec );
+ ast->setFunctionBody( funBody );
+ ast->setInitDeclarator( decl );
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+ }
+ break;
+
+ }
+ }
+
+ syntaxError();
+ return false;
+}
+
+bool Parser::parseFunctionBody( StatementListAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseFunctionBody()" << endl;
+
+ int start = lex->index();
+ if( lex->lookAhead(0) != '{' ){
+ return false;
+ }
+ nextToken();
+
+ StatementListAST::Node ast = CreateNode<StatementListAST>();
+
+ while( !lex->lookAhead(0).isNull() ){
+ if( lex->lookAhead(0) == '}' )
+ break;
+
+ StatementAST::Node stmt;
+ int startStmt = lex->index();
+ if( !parseStatement(stmt) ){
+ if( startStmt == lex->index() )
+ nextToken();
+ skipUntilStatement();
+ } else
+ ast->addStatement( stmt );
+ }
+
+ clearComment();
+
+ if( lex->lookAhead(0) != '}' ){
+ reportError( i18n("} expected") );
+ } else
+ nextToken();
+
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+QString Parser::toString( int start, int end, const QString& sep ) const
+{
+ QStringList l;
+
+ for( int i=start; i<end; ++i ){
+ const Token& t = lex->tokenAt(i);
+ if( t != Token_comment )
+ l << t.text();
+ }
+
+ return l.join( sep ).stripWhiteSpace();
+}
+
+bool Parser::parseTypeSpecifierOrClassSpec( TypeSpecifierAST::Node& node )
+{
+ if( parseClassSpecifier(node) )
+ return true;
+ else if( parseEnumSpecifier(node) )
+ return true;
+ else if( parseTypeSpecifier(node) )
+ return true;
+
+ return false;
+}
+
+bool Parser::parseTryBlockStatement( StatementAST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseTryBlockStatement()" << endl;
+
+ int start = lex->index();
+ if( lex->lookAhead(0) != Token_try ){
+ return false;
+ }
+ nextToken();
+
+ StatementAST::Node stmt;
+ if( !parseCompoundStatement(stmt) ){
+ syntaxError();
+ }
+
+ if( lex->lookAhead(0) != Token_catch ){
+ reportError( i18n("catch expected") );
+ }
+
+ CatchStatementListAST::Node list = CreateNode<CatchStatementListAST>();
+
+ while( lex->lookAhead(0) == Token_catch ){
+
+ nextToken();
+ ADVANCE( '(', "(" );
+ ConditionAST::Node cond;
+ if( !parseCondition(cond) ){
+ reportError( i18n("condition expected") );
+ return false;
+ }
+ ADVANCE( ')', ")" );
+
+ StatementAST::Node body;
+ if( !parseCompoundStatement(body) ){
+ syntaxError();
+ }
+
+ CatchStatementAST::Node cstmt = CreateNode<CatchStatementAST>();
+ cstmt->setCondition( cond );
+ cstmt->setStatement( body );
+ int l=0, c=0;
+ if( cond.get() )
+ cond->getStartPosition( &l, &c );
+ else if( body.get() )
+ body->getStartPosition( &l, &c );
+
+ cstmt->setStartPosition( l, c );
+ if( body.get() )
+ body->getEndPosition( &l, &c );
+
+ cstmt->setEndPosition( l, c );
+ list->addStatement( cstmt );
+ }
+
+ TryBlockStatementAST::Node ast = CreateNode<TryBlockStatementAST>();
+ ast->setStatement( stmt );
+ ast->setCatchStatementList( list );
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+
+ return true;
+}
+
+bool Parser::parsePrimaryExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parsePrimarExpression()" << endl;
+
+
+ switch( lex->lookAhead(0) ){
+ case Token_string_literal:
+ {
+ AST::Node lit;
+ parseStringLiteral( lit );
+ }
+ return true;
+
+ case Token_number_literal:
+ case Token_char_literal:
+ case Token_true:
+ case Token_false:
+ nextToken();
+ return true;
+
+ case Token_this:
+ nextToken();
+ return true;
+
+ case Token_dynamic_cast:
+ case Token_static_cast:
+ case Token_reinterpret_cast:
+ case Token_const_cast:
+ {
+ nextToken();
+
+ CHECK( '<', "<" );
+ AST::Node typeId;
+ parseTypeId( typeId );
+ CHECK( '>', ">" );
+
+ CHECK( '(', "(" );
+ AST::Node expr;
+ parseCommaExpression( expr );
+ CHECK( ')', ")" );
+ }
+ return true;
+
+ case Token_typeid:
+ {
+ nextToken();
+ CHECK( '(', "(" );
+ AST::Node expr;
+ parseCommaExpression( expr );
+ CHECK( ')', ")" );
+ }
+ return true;
+
+ case '(':
+ {
+ nextToken();
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "token = " << lex->lookAhead(0).text() << endl;
+ AST::Node expr;
+ if( !parseExpression(expr) ){
+ return false;
+ }
+ CHECK( ')', ")" );
+ }
+ return true;
+
+ default:
+ {
+ int start = lex->index();
+ TypeSpecifierAST::Node typeSpec;
+ if( parseSimpleTypeSpecifier(typeSpec) && lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node expr;
+ parseCommaExpression( expr );
+ CHECK( ')', ")" );
+ return true;
+ }
+
+ lex->setIndex( start );
+ NameAST::Node name;
+ if( parseName(name) )
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool Parser::parsePostfixExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parsePostfixExpression()" << endl;
+
+ AST::Node expr;
+ if( !parsePrimaryExpression(expr) )
+ return false;
+
+ while( true ){
+ switch(lex->lookAhead(0))
+ {
+ case '[':
+ {
+ nextToken();
+ AST::Node e;
+ parseCommaExpression( e );
+ CHECK( ']', "]" );
+ }
+ break;
+
+ case '(':
+ {
+ nextToken();
+ AST::Node funArgs;
+ parseCommaExpression( funArgs );
+ CHECK( ')', ")" );
+ }
+ break;
+
+ case Token_incr:
+ case Token_decr:
+ nextToken();
+ break;
+
+ case '.':
+ case Token_arrow:
+ {
+ nextToken();
+ if( lex->lookAhead(0) == Token_template )
+ nextToken();
+
+ NameAST::Node name;
+ if( !parseName(name) ){
+ return false;
+ }
+ }
+ break;
+
+ case Token_typename:
+ {
+ nextToken();
+
+ NameAST::Node name;
+ if( !parseName(name) ){
+ return false;
+ }
+
+ CHECK( '(', "(" );
+ AST::Node expr;
+ parseCommaExpression(expr);
+ CHECK( ')', ")" );
+ }
+ return true;
+
+ default:
+ return true;
+
+ } // end switch
+
+ } // end while
+
+ return true;
+}
+
+bool Parser::parseUnaryExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseUnaryExpression()" << endl;
+
+ switch( lex->lookAhead(0) ){
+ case Token_incr:
+ case Token_decr:
+ case '*':
+ case '&':
+ case '+':
+ case '-':
+ case '!':
+ case '~':
+ {
+ nextToken();
+ AST::Node expr;
+ return parseCastExpression( expr );
+ }
+
+ case Token_sizeof:
+ {
+ nextToken();
+ int index = lex->index();
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node typeId;
+ if( parseTypeId(typeId) && lex->lookAhead(0) == ')' ){
+ nextToken();
+ return true;
+ }
+ lex->setIndex( index );
+ }
+ AST::Node expr;
+ return parseUnaryExpression( expr );
+ }
+
+ case Token_new:
+ return parseNewExpression( node );
+
+ case Token_delete:
+ return parseDeleteExpression( node );
+ }
+
+ return parsePostfixExpression( node );
+}
+
+bool Parser::parseNewExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseNewExpression()" << endl;
+ if( lex->lookAhead(0) == Token_scope && lex->lookAhead(1) == Token_new )
+ nextToken();
+
+ CHECK( Token_new, "new");
+
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node expr;
+ parseCommaExpression( expr );
+ CHECK( ')', ")" );
+ }
+
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node typeId;
+ parseTypeId( typeId );
+ CHECK( ')', ")" );
+ } else {
+ AST::Node typeId;
+ parseNewTypeId( typeId );
+ }
+
+ AST::Node init;
+ parseNewInitializer( init );
+ return true;
+}
+
+bool Parser::parseNewTypeId( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseNewTypeId()" << endl;
+ TypeSpecifierAST::Node typeSpec;
+ if( parseTypeSpecifier(typeSpec) ){
+ AST::Node declarator;
+ parseNewDeclarator( declarator );
+ return true;
+ }
+
+ return false;
+}
+
+bool Parser::parseNewDeclarator( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseNewDeclarator()" << endl;
+ AST::Node ptrOp;
+ if( parsePtrOperator(ptrOp) ){
+ AST::Node declarator;
+ parseNewDeclarator( declarator );
+ return true;
+ }
+
+ if( lex->lookAhead(0) == '[' ){
+ while( lex->lookAhead(0) == '[' ){
+ nextToken();
+ AST::Node expr;
+ parseExpression( expr );
+ ADVANCE( ']', "]" );
+ }
+ return true;
+ }
+
+ return false;
+}
+
+bool Parser::parseNewInitializer( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseNewInitializer()" << endl;
+ if( lex->lookAhead(0) != '(' )
+ return false;
+
+ nextToken();
+ AST::Node expr;
+ parseCommaExpression( expr );
+ CHECK( ')', ")" );
+
+ return true;
+}
+
+bool Parser::parseDeleteExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseDeleteExpression()" << endl;
+ if( lex->lookAhead(0) == Token_scope && lex->lookAhead(1) == Token_delete )
+ nextToken();
+
+ CHECK( Token_delete, "delete" );
+
+ if( lex->lookAhead(0) == '[' ){
+ nextToken();
+ CHECK( ']', "]" );
+ }
+
+ AST::Node expr;
+ return parseCastExpression( expr );
+}
+
+bool Parser::parseCastExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCastExpression()" << endl;
+
+ int index = lex->index();
+
+ if( lex->lookAhead(0) == '(' ){
+ nextToken();
+ AST::Node typeId;
+ if ( parseTypeId(typeId) ) {
+ if ( lex->lookAhead(0) == ')' ) {
+ nextToken();
+ AST::Node expr;
+ if( parseCastExpression(expr) )
+ return true;
+ }
+ }
+ }
+
+ lex->setIndex( index );
+
+ AST::Node expr;
+ return parseUnaryExpression( expr );
+}
+
+bool Parser::parsePmExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser:parsePmExpression()" << endl;
+ AST::Node expr;
+ if( !parseCastExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_ptrmem ){
+ nextToken();
+
+ if( !parseCastExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseMultiplicativeExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseMultiplicativeExpression()" << endl;
+ AST::Node expr;
+ if( !parsePmExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == '*' || lex->lookAhead(0) == '/' || lex->lookAhead(0) == '%' ){
+ nextToken();
+
+ if( !parsePmExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+
+bool Parser::parseAdditiveExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseAdditiveExpression()" << endl;
+ AST::Node expr;
+ if( !parseMultiplicativeExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == '+' || lex->lookAhead(0) == '-' ){
+ nextToken();
+
+ if( !parseMultiplicativeExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseShiftExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseShiftExpression()" << endl;
+ AST::Node expr;
+ if( !parseAdditiveExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_shift ){
+ nextToken();
+
+ if( !parseAdditiveExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseRelationalExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseRelationalExpression()" << endl;
+ AST::Node expr;
+ if( !parseShiftExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == '<' || (lex->lookAhead(0) == '>' && !templArgs) ||
+ lex->lookAhead(0) == Token_leq || lex->lookAhead(0) == Token_geq ){
+ nextToken();
+
+ if( !parseShiftExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseEqualityExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseEqualityExpression()" << endl;
+ AST::Node expr;
+ if( !parseRelationalExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_eq || lex->lookAhead(0) == Token_not_eq ){
+ nextToken();
+
+ if( !parseRelationalExpression(expr, templArgs) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseAndExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseAndExpression()" << endl;
+ AST::Node expr;
+ if( !parseEqualityExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == '&' ){
+ nextToken();
+
+ if( !parseEqualityExpression(expr, templArgs) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseExclusiveOrExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseExclusiveOrExpression()" << endl;
+ AST::Node expr;
+ if( !parseAndExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == '^' ){
+ nextToken();
+
+ if( !parseAndExpression(expr, templArgs) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseInclusiveOrExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInclusiveOrExpression()" << endl;
+ AST::Node expr;
+ if( !parseExclusiveOrExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == '|' ){
+ nextToken();
+
+ if( !parseExclusiveOrExpression(expr, templArgs) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseLogicalAndExpression( AST::Node& /*node*/, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseLogicalAndExpression()" << endl;
+
+ AST::Node expr;
+ if( !parseInclusiveOrExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_and ){
+ nextToken();
+
+ if( !parseInclusiveOrExpression(expr, templArgs) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseLogicalOrExpression( AST::Node& node, bool templArgs )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseLogicalOrExpression()" << endl;
+
+ int start = lex->index();
+
+ AST::Node expr;
+ if( !parseLogicalAndExpression(expr, templArgs) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_or ){
+ nextToken();
+
+ if( !parseLogicalAndExpression(expr, templArgs) )
+ return false;
+ }
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseConditionalExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseConditionalExpression()" << endl;
+ AST::Node expr;
+ if( !parseLogicalOrExpression(expr) )
+ return false;
+
+ if( lex->lookAhead(0) == '?' ){
+ nextToken();
+
+ if( !parseExpression(expr) )
+ return false;
+
+ CHECK( ':', ":" );
+
+ if( !parseAssignmentExpression(expr) )
+ return false;
+ }
+
+ return true;
+}
+
+bool Parser::parseAssignmentExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseAssignmentExpression()" << endl;
+ int start = lex->index();
+ AST::Node expr;
+ if( lex->lookAhead(0) == Token_throw && !parseThrowExpression(expr) )
+ return false;
+ else if( !parseConditionalExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == Token_assign || lex->lookAhead(0) == '=' ){
+ nextToken();
+
+ if( !parseConditionalExpression(expr) )
+ return false;
+ }
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseConstantExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseConstantExpression()" << endl;
+ int start = lex->index();
+ if( parseConditionalExpression(node) ){
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+ }
+ return false;
+}
+
+bool Parser::parseExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseExpression()" << endl;
+
+ int start = lex->index();
+
+ if( !parseCommaExpression(node) )
+ return false;
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseCommaExpression( AST::Node& node )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseCommaExpression()" << endl;
+ int start = lex->index();
+
+ AST::Node expr;
+ if( !parseAssignmentExpression(expr) )
+ return false;
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+
+ if( !parseAssignmentExpression(expr) )
+ return false;
+ }
+
+ AST::Node ast = CreateNode<AST>();
+ UPDATE_POS( ast, start, lex->index() );
+ node = ast;
+ return true;
+}
+
+bool Parser::parseThrowExpression( AST::Node& /*node*/ )
+{
+ ////kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseThrowExpression()" << endl;
+ if( lex->lookAhead(0) != Token_throw )
+ return false;
+
+ CHECK( Token_throw, "throw" );
+ AST::Node expr;
+ if( !parseAssignmentExpression(expr) )
+ return false;
+
+ return true;
+}
+
+bool Parser::parseIvarDeclList( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseIvarDecls( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseIvarDecl( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseIvars( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseIvarDeclarator( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseMethodDecl( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseUnarySelector( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordSelector( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseSelector( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordDecl( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseReceiver( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcMessageExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseMessageArgs( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordArgList( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordArg( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseReservedWord( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseMyParms( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseMyParm( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseOptParmList( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcSelectorExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseSelectorArg( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordNameList( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseKeywordName( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcEncodeExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcString( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseProtocolRefs( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseIdentifierList( GroupAST::Node & node )
+{
+ int start = lex->index();
+
+ if( lex->lookAhead(0) != Token_identifier )
+ return false;
+
+ GroupAST::Node ast = CreateNode<GroupAST>();
+
+ AST_FROM_TOKEN( tk, lex->index() );
+ ast->addNode( tk );
+ nextToken();
+
+ while( lex->lookAhead(0) == ',' ){
+ nextToken();
+ if( lex->lookAhead(0) == Token_identifier ){
+ AST_FROM_TOKEN( tk, lex->index() );
+ ast->addNode( tk );
+// nextToken();
+ }
+ ADVANCE( Token_identifier, "identifier" );
+ }
+
+ node = ast;
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+}
+
+bool Parser::parseIdentifierColon( AST::Node & node )
+{
+ Q_UNUSED( node );
+
+ if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(1) == ':' ){
+ nextToken();
+ nextToken();
+ return true;
+ } // ### else if PTYPENAME -> return true ;
+
+ return false;
+}
+
+bool Parser::parseObjcProtocolExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcOpenBracketExpr( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcCloseBracket( AST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcDef( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcClassDef( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcClassDecl( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+
+ ADVANCE( OBJC_CLASS, "@class" );
+
+ GroupAST::Node idList;
+ if ( !parseIdentifierList( idList ) )
+ return false;
+
+ ADVANCE( ';', ";" );
+
+ return true;
+}
+
+bool Parser::parseObjcProtocolDecl( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+
+ ADVANCE( OBJC_PROTOCOL, "@protocol" );
+
+ GroupAST::Node idList;
+ if ( !parseIdentifierList( idList ) )
+ return false;
+
+ ADVANCE( ';', ";" );
+
+ return true;
+}
+
+bool Parser::parseObjcAliasDecl( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+
+ ADVANCE( OBJC_ALIAS, "@alias" );
+
+ GroupAST::Node idList;
+ if ( !parseIdentifierList( idList ) )
+ return false;
+
+ ADVANCE( ';', ";" );
+
+ return true;
+}
+
+bool Parser::parseObjcProtocolDef( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseObjcMethodDef( DeclarationAST::Node & node )
+{
+ Q_UNUSED( node );
+ return false;
+}
+
+bool Parser::parseWinDeclSpec( GroupAST::Node & node )
+{
+ if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(0).text() == "__declspec" && lex->lookAhead(1) == '(' && lex->lookAhead(2) != ')'){
+ int start = lex->index();
+ nextToken();
+ nextToken(); // skip '('
+
+ if ( !parseIdentifierList( node ) )
+ return false;
+
+ ADVANCE( ')', ")" );
+
+ UPDATE_POS( node, start, lex->index() );
+ return true;
+ }
+
+ return false;
+}
+
diff --git a/lib/cppparser/parser.h b/lib/cppparser/parser.h
new file mode 100644
index 00000000..ff3891ac
--- /dev/null
+++ b/lib/cppparser/parser.h
@@ -0,0 +1,459 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef PARSER_H
+#define PARSER_H
+
+#include "ast.h"
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include <qvaluestack.h>
+#include <set>
+#include <iostream>
+
+struct ParserPrivateData;
+
+class Driver;
+class Lexer;
+class Token;
+struct Error;
+
+
+class CommentFormatter {
+ static inline bool isWhite( QChar c ) {
+ return c.isSpace();
+ }
+
+ static void rStrip( QString str, QString& from ) {
+ if( str.isEmpty() ) return;
+
+ int i = 0;
+ int ip = from.length();
+ int s = from.length();
+
+ for( int a = s-1; a >= 0; a-- ) {
+ if( isWhite( from[a] ) ) {
+ continue;
+ } else {
+ if( from[a] == str[i] ) {
+ i++;
+ ip = a;
+ if( i == (int)str.length() ) break;
+ } else {
+ break;
+ }
+ }
+ }
+
+ if( ip != (int)from.length() ) from = from.left( ip );
+ }
+
+ static void strip( QString str, QString& from ) {
+ if( str.isEmpty() ) return;
+
+ int i = 0;
+ int ip = 0;
+ int s = from.length();
+
+ for( int a = 0; a < s; a++ ) {
+ if( isWhite( from[a] ) ) {
+ continue;
+ } else {
+ if( from[a] == str[i] ) {
+ i++;
+ ip = a+1;
+ if( i == (int)str.length() ) break;
+ } else {
+ break;
+ }
+ }
+ }
+
+ if( ip ) from = from.mid( ip );
+ }
+
+ public:
+
+ static QString formatComment( QString comment ) {
+ QString ret;
+ int i = 0;
+ int s = comment.length();
+ while( i < s && comment[i] == '/' ) {
+ i++;
+ }
+
+ if( i > 1 ) {
+ ret = comment.mid( i );
+ } else {
+ ///remove the star in each line
+ QStringList lines = QStringList::split( "\n", comment );
+
+ if( lines.isEmpty() ) return ret;
+
+ strip( "/**", lines.front() );
+ rStrip( "/**", lines.back() );
+
+ QStringList::iterator it = lines.begin();
+ ++it;
+ QStringList::iterator eit = lines.end();
+
+ if( it != lines.end() ) {
+ --eit;
+
+ for( ; it != eit; ++it ) {
+ strip( "*", *it );
+ }
+
+ if( lines.front().stripWhiteSpace().isEmpty() )
+ lines.pop_front();
+
+ if( lines.back().stripWhiteSpace().isEmpty() )
+ lines.pop_back();
+ }
+
+ ret = lines.join( "\n" );
+ }
+
+ return ret;
+ }
+};
+
+class Comment {
+ QString m_text;
+ int m_line;
+ bool m_formatted;
+
+
+ void format() {
+ if( m_formatted ) return;
+ m_formatted = true;
+ m_text = CommentFormatter::formatComment( m_text );
+ }
+
+ public:
+ Comment( QString text = "", int line = -1 ) : m_text( text ), m_line( line ), m_formatted(false) {
+ }
+
+ Comment( int line ) : m_line( line ) {
+ }
+
+ void operator += ( Comment rhs ) {
+ format();
+ rhs.format();
+ m_text += " " + rhs.m_text;
+ }
+
+ operator bool() const {
+ return !m_text.isEmpty();
+ }
+
+ operator QString() {
+ format();
+ return m_text;
+ }
+
+ inline int line() const {
+ return m_line;
+ }
+
+ bool operator < ( Comment& rhs ) const {
+ return m_line < rhs.m_line;
+ }
+
+ bool isSame ( const Comment& rhs ) {
+ if( rhs.m_formatted ) format();
+ return m_text == rhs.m_text;
+ }
+
+ struct cmp {
+ bool operator () ( const Comment& c1, const Comment& c2 ) const {
+ return c1.line() < c2.line();
+ }
+ };
+};
+
+
+class CommentStore {
+ private:
+ typedef std::set< Comment, Comment::cmp > CommentSet;
+ CommentSet m_comments;
+
+ public:
+
+ ///Returns the comment nearest to "end"(inclusive), and returns & removes it
+ Comment getCommentInRange( int end, int start = 0 ) {
+ CommentSet::iterator it = m_comments.lower_bound( end );
+
+
+ while( it != m_comments.begin() && (*it).line() > end ) {
+ --it;
+ }
+
+ if( it != m_comments.end() && (*it).line() >= start && (*it).line() <= end ) {
+ Comment ret = *it;
+ m_comments.erase( it );
+ return ret;
+ } else {
+ return Comment();
+ }
+ }
+
+ ///Returns and removes the comment in the line
+ Comment getComment( int line ) {
+ CommentSet::iterator it = m_comments.find( line );
+ if( it != m_comments.end() ) {
+ Comment ret = *it;
+ m_comments.erase( it );
+ return ret;
+ } else {
+ return Comment();
+ }
+ }
+
+ void addComment( Comment comment ) {
+
+ CommentSet::iterator it = m_comments.find( comment );
+ if( it != m_comments.end() ) {
+ if( comment.isSame( *it ) ) return;
+ Comment c = *it;
+ c += comment;
+ comment = c;
+ m_comments.erase( it );
+ }
+
+ m_comments.insert( comment );
+ }
+
+ ///Does not delete the comment
+ Comment latestComment() {
+ CommentSet::iterator it = m_comments.end();
+ if( it == m_comments.begin() ) return Comment();
+ --it;
+ return *it;
+ }
+
+ void clear() {
+ m_comments.clear();
+ }
+};
+
+
+class Parser
+{
+public:
+ Parser( Driver* driver, Lexer* lexer );
+ virtual ~Parser();
+
+private:
+ virtual bool reportError( const Error& err );
+ /** @todo remove*/ virtual bool reportError( const QString& msg );
+ /** @todo remove*/ virtual void syntaxError();
+
+public /*rules*/ :
+
+ bool parseTranslationUnit( TranslationUnitAST::Node& node );
+
+ bool parseDeclaration( DeclarationAST::Node& node );
+ bool parseBlockDeclaration( DeclarationAST::Node& node );
+ bool parseLinkageSpecification( DeclarationAST::Node& node );
+ bool parseLinkageBody( LinkageBodyAST::Node& node );
+ bool parseNamespace( DeclarationAST::Node& node );
+ bool parseNamespaceAliasDefinition( DeclarationAST::Node& node );
+ bool parseUsing( DeclarationAST::Node& node );
+ bool parseUsingDirective( DeclarationAST::Node& node );
+ bool parseTypedef( DeclarationAST::Node& node );
+ bool parseAsmDefinition( DeclarationAST::Node& node );
+ bool parseTemplateDeclaration( DeclarationAST::Node& node );
+ bool parseDeclarationInternal( DeclarationAST::Node& node );
+
+ bool parseUnqualifiedName( ClassOrNamespaceNameAST::Node& node );
+ bool parseStringLiteral( AST::Node& node );
+ bool parseName( NameAST::Node& node );
+ bool parseOperatorFunctionId( AST::Node& node );
+ bool parseTemplateArgumentList( TemplateArgumentListAST::Node& node, bool reportError=true );
+ bool parseOperator( AST::Node& node );
+ bool parseCvQualify( GroupAST::Node& node );
+ bool parseSimpleTypeSpecifier( TypeSpecifierAST::Node& node );
+ bool parsePtrOperator( AST::Node& node );
+ bool parseTemplateArgument( AST::Node& node );
+ bool parseTypeSpecifier( TypeSpecifierAST::Node& node );
+ bool parseTypeSpecifierOrClassSpec( TypeSpecifierAST::Node& node );
+ bool parseDeclarator( DeclaratorAST::Node& node );
+ bool parseTemplateParameterList( TemplateParameterListAST::Node& node );
+ bool parseTemplateParameter( TemplateParameterAST::Node& node );
+ bool parseStorageClassSpecifier( GroupAST::Node& node );
+ bool parseFunctionSpecifier( GroupAST::Node& node );
+ bool parseInitDeclaratorList( InitDeclaratorListAST::Node& node );
+ bool parseInitDeclarator( InitDeclaratorAST::Node& node );
+ bool parseParameterDeclarationClause( ParameterDeclarationClauseAST::Node& node );
+ bool parseCtorInitializer( AST::Node& node );
+ bool parsePtrToMember( AST::Node& node );
+ bool parseEnumSpecifier( TypeSpecifierAST::Node& node );
+ bool parseClassSpecifier( TypeSpecifierAST::Node& node );
+ bool parseWinDeclSpec( GroupAST::Node& node );
+ bool parseElaboratedTypeSpecifier( TypeSpecifierAST::Node& node );
+ bool parseDeclaratorId( NameAST::Node& node );
+ bool parseExceptionSpecification( GroupAST::Node& node );
+ bool parseEnumerator( EnumeratorAST::Node& node );
+ bool parseTypeParameter( TypeParameterAST::Node& node );
+ bool parseParameterDeclaration( ParameterDeclarationAST::Node& node );
+ bool parseTypeId( AST::Node& node );
+ bool parseAbstractDeclarator( DeclaratorAST::Node& node );
+ bool parseParameterDeclarationList( ParameterDeclarationListAST::Node& node );
+ bool parseMemberSpecification( DeclarationAST::Node& node );
+ bool parseAccessSpecifier( AST::Node& node );
+ bool parseTypeIdList( GroupAST::Node& node );
+ bool parseMemInitializerList( AST::Node& node );
+ bool parseMemInitializer( AST::Node& node );
+ bool parseInitializer( AST::Node& node );
+ bool parseBaseClause( BaseClauseAST::Node& node );
+ bool parseBaseSpecifier( BaseSpecifierAST::Node& node );
+ bool parseInitializerClause( AST::Node& node );
+ bool parseMemInitializerId( NameAST::Node& node );
+ bool parseFunctionBody( StatementListAST::Node& node );
+
+ // expression
+ bool skipExpression( AST::Node& node );
+ bool skipCommaExpression( AST::Node& node );
+ bool skipExpressionStatement( StatementAST::Node& node );
+
+ bool parseExpression( AST::Node& node );
+ bool parsePrimaryExpression( AST::Node& node );
+ bool parsePostfixExpression( AST::Node& node );
+ bool parseUnaryExpression( AST::Node& node );
+ bool parseNewExpression( AST::Node& node );
+ bool parseNewTypeId( AST::Node& node );
+ bool parseNewDeclarator( AST::Node& node );
+ bool parseNewInitializer( AST::Node& node );
+ bool parseDeleteExpression( AST::Node& node );
+ bool parseCastExpression( AST::Node& node );
+ bool parsePmExpression( AST::Node& node );
+ bool parseMultiplicativeExpression( AST::Node& node );
+ bool parseAdditiveExpression( AST::Node& node );
+ bool parseShiftExpression( AST::Node& node );
+ bool parseRelationalExpression( AST::Node& node, bool templArgs=false );
+ bool parseEqualityExpression( AST::Node& node, bool templArgs=false );
+ bool parseAndExpression( AST::Node& node, bool templArgs=false );
+ bool parseExclusiveOrExpression( AST::Node& node, bool templArgs=false );
+ bool parseInclusiveOrExpression( AST::Node& node, bool templArgs=false );
+ bool parseLogicalAndExpression( AST::Node& node, bool templArgs=false );
+ bool parseLogicalOrExpression( AST::Node& node, bool templArgs=false );
+ bool parseConditionalExpression( AST::Node& node );
+ bool parseAssignmentExpression( AST::Node& node );
+ bool parseConstantExpression( AST::Node& node );
+ bool parseCommaExpression( AST::Node& node );
+ bool parseThrowExpression( AST::Node& node );
+
+ // statement
+ bool parseCondition( ConditionAST::Node& node );
+ bool parseStatement( StatementAST::Node& node );
+ bool parseWhileStatement( StatementAST::Node& node );
+ bool parseDoStatement( StatementAST::Node& node );
+ bool parseForStatement( StatementAST::Node& node );
+ bool parseForEachStatement( StatementAST::Node& node ); // qt4 [erbsland]
+ bool parseCompoundStatement( StatementAST::Node& node );
+ bool parseForInitStatement( StatementAST::Node& node );
+ bool parseIfStatement( StatementAST::Node& node );
+ bool parseSwitchStatement( StatementAST::Node& node );
+ bool parseLabeledStatement( StatementAST::Node& node );
+ bool parseDeclarationStatement( StatementAST::Node& node );
+ bool parseTryBlockStatement( StatementAST::Node& node );
+
+ // objective c
+ bool parseObjcDef( DeclarationAST::Node& node );
+ bool parseObjcClassDef( DeclarationAST::Node& node );
+ bool parseObjcClassDecl( DeclarationAST::Node& node );
+ bool parseObjcProtocolDecl( DeclarationAST::Node& node );
+ bool parseObjcAliasDecl( DeclarationAST::Node& node );
+ bool parseObjcProtocolDef( DeclarationAST::Node& node );
+ bool parseObjcMethodDef( DeclarationAST::Node& node );
+
+ bool parseIvarDeclList( AST::Node& node );
+ bool parseIvarDecls( AST::Node& node );
+ bool parseIvarDecl( AST::Node& node );
+ bool parseIvars( AST::Node& node );
+ bool parseIvarDeclarator( AST::Node& node );
+ bool parseMethodDecl( AST::Node& node );
+ bool parseUnarySelector( AST::Node& node );
+ bool parseKeywordSelector( AST::Node& node );
+ bool parseSelector( AST::Node& node );
+ bool parseKeywordDecl( AST::Node& node );
+ bool parseReceiver( AST::Node& node );
+ bool parseObjcMessageExpr( AST::Node& node );
+ bool parseMessageArgs( AST::Node& node );
+ bool parseKeywordExpr( AST::Node& node );
+ bool parseKeywordArgList( AST::Node& node );
+ bool parseKeywordArg( AST::Node& node );
+ bool parseReservedWord( AST::Node& node );
+ bool parseMyParms( AST::Node& node );
+ bool parseMyParm( AST::Node& node );
+ bool parseOptParmList( AST::Node& node );
+ bool parseObjcSelectorExpr( AST::Node& node );
+ bool parseSelectorArg( AST::Node& node );
+ bool parseKeywordNameList( AST::Node& node );
+ bool parseKeywordName( AST::Node& node );
+ bool parseObjcEncodeExpr( AST::Node& node );
+ bool parseObjcString( AST::Node& node );
+ bool parseProtocolRefs( AST::Node& node );
+ bool parseIdentifierList( GroupAST::Node& node );
+ bool parseIdentifierColon( AST::Node& node );
+ bool parseObjcProtocolExpr( AST::Node& node );
+ bool parseObjcOpenBracketExpr( AST::Node& node );
+ bool parseObjcCloseBracket( AST::Node& node );
+
+ void nextToken( bool skipComments = true );
+
+ ///parses all comments until the end of the line
+ Comment comment();
+ void preparseLineComments( int line );
+ void processComment( int offset = 0 );
+ void clearComment( );
+
+ bool skipUntil( int token );
+ bool skipUntilDeclaration();
+ bool skipUntilStatement();
+ bool skip( int l, int r );
+ QString toString( int start, int end, const QString& sep=" " ) const;
+
+private:
+ int currentLine();
+ CommentStore m_commentStore;
+
+ template<class Type>
+ void eventuallyTakeComment( int startLn, int line, Type& ast );
+ template<class Type>
+ void eventuallyTakeComment( Type& ast );
+
+ ParserPrivateData* d;
+ Driver* m_driver;
+ Lexer* lex;
+ Comment m_currentComment;
+ int m_problems;
+ int m_maxProblems;
+ bool objcp;
+
+private:
+ Parser( const Parser& source );
+ void operator = ( const Parser& source );
+};
+
+
+#endif
diff --git a/lib/cppparser/tree_parser.cpp b/lib/cppparser/tree_parser.cpp
new file mode 100644
index 00000000..780d86a2
--- /dev/null
+++ b/lib/cppparser/tree_parser.cpp
@@ -0,0 +1,212 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "tree_parser.h"
+#include "driver.h"
+#include <kdebug.h>
+
+TreeParser::TreeParser()
+{
+}
+
+TreeParser::~TreeParser()
+{
+}
+
+void TreeParser::parseTranslationUnit( const ParsedFile& translationUnit )
+{
+ ////kdDebug(9007) << "TreeParser::parseTranslationUnit()" << endl;
+
+ QPtrList<DeclarationAST> declarations = translationUnit->declarationList();
+ QPtrListIterator<DeclarationAST> it( declarations );
+ while( it.current() ){
+ if( (it.current() == 0 ) ) {
+ //kdDebug( 9007 ) << "declaration is zero" << endl;
+ continue;
+ }
+ parseDeclaration( it.current() );
+ ++it;
+ }
+}
+
+void TreeParser::parseDeclaration( DeclarationAST* declaration )
+{
+ ////kdDebug(9007) << "TreeParser::parseDeclaration()" << endl;
+
+ if( !declaration )
+ return;
+
+ switch( declaration->nodeType() )
+ {
+ case NodeType_LinkageSpecification:
+ parseLinkageSpecification( static_cast<LinkageSpecificationAST*>(declaration) );
+ break;
+
+ case NodeType_Namespace:
+ parseNamespace( static_cast<NamespaceAST*>(declaration) );
+ break;
+
+ case NodeType_NamespaceAlias:
+ parseNamespaceAlias( static_cast<NamespaceAliasAST*>(declaration) );
+ break;
+
+ case NodeType_Using:
+ parseUsing( static_cast<UsingAST*>(declaration) );
+ break;
+
+ case NodeType_UsingDirective:
+ parseUsingDirective( static_cast<UsingDirectiveAST*>(declaration) );
+ break;
+
+ case NodeType_Typedef:
+ parseTypedef( static_cast<TypedefAST*>(declaration) );
+ break;
+
+ case NodeType_TemplateDeclaration:
+ parseTemplateDeclaration( static_cast<TemplateDeclarationAST*>(declaration) );
+ break;
+
+ case NodeType_SimpleDeclaration:
+ parseSimpleDeclaration( static_cast<SimpleDeclarationAST*>(declaration) );
+ break;
+
+ case NodeType_FunctionDefinition:
+ parseFunctionDefinition( static_cast<FunctionDefinitionAST*>(declaration) );
+ break;
+
+ case NodeType_AccessDeclaration:
+ parseAccessDeclaration( static_cast<AccessDeclarationAST*>(declaration) );
+ break;
+ }
+}
+
+void TreeParser::parseLinkageSpecification( LinkageSpecificationAST* ast )
+{
+ ////kdDebug(9007) << "TreeParser::parseLinkageSpecification()" << endl;
+ if( ast->linkageBody() )
+ parseLinkageBody( ast->linkageBody() );
+ else if( ast->declaration() )
+ parseDeclaration( ast->declaration() );
+}
+
+void TreeParser::parseNamespace( NamespaceAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseNamespace()" << endl;
+ if( decl->linkageBody() )
+ parseLinkageBody( decl->linkageBody() );
+}
+
+void TreeParser::parseNamespaceAlias( NamespaceAliasAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseNamespaceAlias()" << endl;
+ Q_UNUSED( decl );
+}
+
+void TreeParser::parseUsing( UsingAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseUsing()" << endl;
+ Q_UNUSED( decl );
+}
+
+void TreeParser::parseUsingDirective( UsingDirectiveAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseUsingDirective()" << endl;
+ Q_UNUSED( decl );
+}
+
+void TreeParser::parseTypedef( TypedefAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseTypedef()" << endl;
+ if( decl->typeSpec() )
+ parseTypeSpecifier( decl->typeSpec() );
+}
+
+void TreeParser::parseTemplateDeclaration( TemplateDeclarationAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseTemplateDeclaration()" << endl;
+ Q_UNUSED( decl );
+}
+
+void TreeParser::parseSimpleDeclaration( SimpleDeclarationAST* decl )
+{
+ ////kdDebug(9007) << "TreeParser::parseSimpleDeclaration()" << endl;
+ Q_UNUSED( decl );
+}
+
+void TreeParser::parseFunctionDefinition( FunctionDefinitionAST* def )
+{
+ ////kdDebug(9007) << "TreeParser::parseFunctionDefinition()" << endl;
+ Q_UNUSED( def );
+}
+
+void TreeParser::parseLinkageBody( LinkageBodyAST* linkageBody )
+{
+ ////kdDebug(9007) << "TreeParser::parseLinkageBody()" << endl;
+ QPtrList<DeclarationAST> declarations = linkageBody->declarationList();
+ for( QPtrListIterator<DeclarationAST> it(declarations); it.current(); ++it ){
+ parseDeclaration( it.current() );
+ }
+}
+
+void TreeParser::parseTypeSpecifier( TypeSpecifierAST* typeSpec )
+{
+ ////kdDebug(9007) << "TreeParser::parseTypeSpecifier()" << endl;
+ switch( typeSpec->nodeType() )
+ {
+ case NodeType_ClassSpecifier:
+ parseClassSpecifier( static_cast<ClassSpecifierAST*>(typeSpec) );
+ break;
+
+ case NodeType_EnumSpecifier:
+ parseEnumSpecifier( static_cast<EnumSpecifierAST*>(typeSpec) );
+ break;
+
+ case NodeType_ElaboratedTypeSpecifier:
+ parseElaboratedTypeSpecifier( static_cast<ElaboratedTypeSpecifierAST*>(typeSpec) );
+ break;
+ }
+}
+
+void TreeParser::parseClassSpecifier( ClassSpecifierAST* classSpec )
+{
+ ////kdDebug(9007) << "TreeParser::parseClassSpecifier()" << endl;
+ QPtrList<DeclarationAST> declarations = classSpec->declarationList();
+ for( QPtrListIterator<DeclarationAST> it(declarations); it.current(); ++it ){
+ parseDeclaration( it.current() );
+ }
+}
+
+void TreeParser::parseEnumSpecifier( EnumSpecifierAST* enumSpec )
+{
+ ////kdDebug(9007) << "TreeParser::parseEnumSpecifier()" << endl;
+ Q_UNUSED( enumSpec );
+}
+
+void TreeParser::parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* typeSpec )
+{
+ ////kdDebug(9007) << "TreeParser::parseElaboratedTypeSpecifier()" << endl;
+ Q_UNUSED( typeSpec );
+}
+
+void TreeParser::parseAccessDeclaration ( AccessDeclarationAST * access )
+{
+ ////kdDebug(9007) << "TreeParser::parseAccessDeclaration()" << endl;
+ Q_UNUSED( access );
+}
+
diff --git a/lib/cppparser/tree_parser.h b/lib/cppparser/tree_parser.h
new file mode 100644
index 00000000..a7477a16
--- /dev/null
+++ b/lib/cppparser/tree_parser.h
@@ -0,0 +1,60 @@
+/* This file is part of KDevelop
+ Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __tree_parser_h
+#define __tree_parser_h
+
+#include "ast.h"
+class ParsedFile;
+
+class TreeParser
+{
+public:
+ TreeParser();
+ virtual ~TreeParser();
+
+ // translation-unit
+ virtual void parseTranslationUnit( const ParsedFile& );
+
+ // declarations
+ virtual void parseDeclaration( DeclarationAST* );
+ virtual void parseLinkageSpecification( LinkageSpecificationAST* );
+ virtual void parseNamespace( NamespaceAST* );
+ virtual void parseNamespaceAlias( NamespaceAliasAST* );
+ virtual void parseUsing( UsingAST* );
+ virtual void parseUsingDirective( UsingDirectiveAST* );
+ virtual void parseTypedef( TypedefAST* );
+ virtual void parseTemplateDeclaration( TemplateDeclarationAST* );
+ virtual void parseSimpleDeclaration( SimpleDeclarationAST* );
+ virtual void parseFunctionDefinition( FunctionDefinitionAST* );
+ virtual void parseLinkageBody( LinkageBodyAST* );
+ virtual void parseAccessDeclaration( AccessDeclarationAST* );
+
+ // type-specifier
+ virtual void parseTypeSpecifier( TypeSpecifierAST* );
+ virtual void parseClassSpecifier( ClassSpecifierAST* );
+ virtual void parseEnumSpecifier( EnumSpecifierAST* );
+ virtual void parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* );
+
+private:
+ TreeParser( const TreeParser& source );
+ void operator = ( const TreeParser& source );
+};
+
+#endif // __tree_parser_h
diff --git a/lib/dummy.cpp b/lib/dummy.cpp
new file mode 100644
index 00000000..8d1c8b69
--- /dev/null
+++ b/lib/dummy.cpp
@@ -0,0 +1 @@
+
diff --git a/lib/interfaces/KDevCoreIface.cpp b/lib/interfaces/KDevCoreIface.cpp
new file mode 100644
index 00000000..e2e53346
--- /dev/null
+++ b/lib/interfaces/KDevCoreIface.cpp
@@ -0,0 +1,59 @@
+
+
+/* This file is part of the KDE project
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2001-2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <kdebug.h>
+#include <dcopclient.h>
+#include "KDevCoreIface.h"
+#include "kdevcore.h"
+
+
+KDevCoreIface::KDevCoreIface(KDevCore *core)
+ : QObject(core), DCOPObject("KDevCore"), m_core(core)
+{
+ connect( m_core, SIGNAL(projectOpened()), this, SLOT(forwardProjectOpened()) );
+ connect( m_core, SIGNAL(projectClosed()), this, SLOT(forwardProjectClosed()) );
+}
+
+
+KDevCoreIface::~KDevCoreIface()
+{}
+
+
+void KDevCoreIface::forwardProjectOpened()
+{
+ kdDebug(9000) << "dcop emitting project opened" << endl;
+ emitDCOPSignal("projectOpened()", QByteArray());
+}
+
+
+void KDevCoreIface::forwardProjectClosed()
+{
+ kdDebug(9000) << "dcop emitting project closed" << endl;
+ emitDCOPSignal("projectClosed()", QByteArray());
+}
+
+void KDevCoreIface::openProject( const QString & projectFileName )
+{
+ m_core->openProject(projectFileName);
+}
+
+#include "KDevCoreIface.moc"
diff --git a/lib/interfaces/KDevCoreIface.h b/lib/interfaces/KDevCoreIface.h
new file mode 100644
index 00000000..5bf5b0ab
--- /dev/null
+++ b/lib/interfaces/KDevCoreIface.h
@@ -0,0 +1,51 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2001-2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef _KDEVCOREIFACE_H_
+#define _KDEVCOREIFACE_H_
+
+#include <dcopobject.h>
+#include <dcopref.h>
+
+class KDevCore;
+
+
+class KDevCoreIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+
+public:
+
+ KDevCoreIface( KDevCore *core );
+ ~KDevCoreIface();
+
+k_dcop:
+ void openProject(const QString& projectFileName);
+
+private slots:
+ void forwardProjectOpened();
+ void forwardProjectClosed();
+
+private:
+ KDevCore *m_core;
+};
+
+#endif
diff --git a/lib/interfaces/KDevPartControllerIface.cpp b/lib/interfaces/KDevPartControllerIface.cpp
new file mode 100644
index 00000000..be6564d4
--- /dev/null
+++ b/lib/interfaces/KDevPartControllerIface.cpp
@@ -0,0 +1,95 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <kdebug.h>
+#include <dcopclient.h>
+#include <kurl.h>
+
+
+#include "KDevPartControllerIface.h"
+#include "kdevpartcontroller.h"
+
+
+KDevPartControllerIface::KDevPartControllerIface(KDevPartController *pc)
+ : QObject(pc), DCOPObject("KDevPartController"), m_controller(pc)
+{
+ connect(pc, SIGNAL(loadedFile(const KURL &)), this, SLOT(forwardLoadedFile(const KURL &)));
+ connect(pc, SIGNAL(savedFile(const KURL &)), this, SLOT(forwardSavedFile(const KURL &)));
+ connect(pc, SIGNAL(closedFile(const KURL &)), this, SLOT(forwardClosedFile(const KURL &)));
+}
+
+
+KDevPartControllerIface::~KDevPartControllerIface()
+{
+}
+
+
+void KDevPartControllerIface::editDocument(const QString &url, int lineNum)
+{
+ m_controller->editDocument(KURL(url), lineNum);
+}
+
+
+void KDevPartControllerIface::showDocument(const QString &url, bool newWin)
+{
+ m_controller->showDocument(KURL(url), newWin);
+}
+
+
+void KDevPartControllerIface::saveAllFiles()
+{
+ m_controller->saveAllFiles();
+}
+
+
+void KDevPartControllerIface::revertAllFiles()
+{
+ m_controller->revertAllFiles();
+}
+
+
+void KDevPartControllerIface::forwardLoadedFile(const KURL &fileName)
+{
+ kdDebug(9000) << "dcop emitting loadedFile " << fileName << endl;
+ emitDCOPSignal("projectOpened()", QByteArray());
+}
+
+
+void KDevPartControllerIface::forwardSavedFile(const KURL &fileName)
+{
+ kdDebug(9000) << "dcop emitting savedFile " << fileName << endl;
+ emitDCOPSignal("projectClosed()", QByteArray());
+}
+
+void KDevPartControllerIface::forwardClosedFile(const KURL &fileName)
+{
+ kdDebug(9000) << "dcop emitting closedFile " << fileName << endl;
+ emitDCOPSignal("projectClosed()", QByteArray());
+}
+
+bool KDevPartControllerIface::closeAllFiles( )
+{
+ return m_controller->closeAllFiles();
+}
+
+uint KDevPartControllerIface::documentState( const KURL & url )
+{
+ return (uint) m_controller->documentState(url);
+}
+
+#include "KDevPartControllerIface.moc"
diff --git a/lib/interfaces/KDevPartControllerIface.h b/lib/interfaces/KDevPartControllerIface.h
new file mode 100644
index 00000000..90de786a
--- /dev/null
+++ b/lib/interfaces/KDevPartControllerIface.h
@@ -0,0 +1,63 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef _KDEVPARTCONTROLLERIFACE_H_
+#define _KDEVPARTCONTROLLERIFACE_H_
+
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <kurl.h>
+
+class KDevPartController;
+
+class KDevPartControllerIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+
+public:
+
+ KDevPartControllerIface(KDevPartController *pc);
+ ~KDevPartControllerIface();
+
+
+k_dcop:
+
+ void editDocument(const QString &url, int lineNum);
+ void showDocument(const QString &url, bool newWin);
+
+ void saveAllFiles();
+ void revertAllFiles();
+
+ bool closeAllFiles();
+ uint documentState( const KURL & url );
+
+private slots:
+
+ void forwardLoadedFile(const KURL &fileName);
+ void forwardSavedFile(const KURL &fileName);
+ void forwardClosedFile(const KURL &fileName);
+
+private:
+
+ KDevPartController *m_controller;
+
+};
+
+
+#endif
diff --git a/lib/interfaces/Mainpage.dox b/lib/interfaces/Mainpage.dox
new file mode 100644
index 00000000..2b4d818a
--- /dev/null
+++ b/lib/interfaces/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Interfaces Library
+
+This library contains all interfaces and classes that form KDevelop plugin architecture.
+
+<b>Link with</b>: -lkdevelop
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/interfaces
+*/
+
diff --git a/lib/interfaces/Makefile.am b/lib/interfaces/Makefile.am
new file mode 100644
index 00000000..6b171b10
--- /dev/null
+++ b/lib/interfaces/Makefile.am
@@ -0,0 +1,40 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/cppparser \
+ $(all_includes)
+
+noinst_LTLIBRARIES = libkdevinterfaces.la
+
+libkdevinterfaces_la_SOURCES = kdevcore.cpp kdevproject.cpp \
+ kdevlanguagesupport.cpp kdevpartcontroller.cpp kdevapi.cpp KDevCoreIface.skel \
+ kdevmainwindow.cpp KDevPartControllerIface.skel kdevplugin.cpp kdevcoderepository.cpp \
+ codemodel.cpp codemodel_treeparser.cpp codemodel_utils.cpp \
+ kdevdesignerintegration.cpp kdevplugincontroller.cpp kdevplugininfo.cpp KDevCoreIface.cpp \
+ KDevPartControllerIface.cpp katedocumentmanagerinterface.cpp katedocumentmanagerinterface.skel \
+ kdevprojectiface.cpp kdevprojectiface.skel kdevdesignerintegrationiface.cpp \
+ kdevdesignerintegrationiface.skel hashedstring.cpp
+libkdevinterfaces_la_LDFLAGS = -no-undefined $(all_libraries)
+libkdevinterfaces_la_LIBADD = $(top_builddir)/lib/interfaces/external/libkinterfacedesigner.la \
+ $(top_builddir)/lib/util/libkdevutil.la \
+ $(LIB_KDEUI) $(LIB_KHTML) $(LIB_KPARTS) -lktexteditor -lkscript -lDCOP
+
+kdevelopincludedir = $(includedir)/kdevelop/interfaces
+kdevelopinclude_HEADERS = kdevlanguagesupport.h kdevmainwindow.h \
+ kdevpartcontroller.h kdevplugin.h kdevproject.h kdevcore.h kdevcoderepository.h codemodel.h \
+ codemodel_utils.h codemodel_treeparser.h kdevgenericfactory.h kdevapi.h \
+ kdevdesignerintegration.h kdevplugincontroller.h kdevplugininfo.h KDevCoreIface.h \
+ KDevPartControllerIface.h katedocumentmanagerinterface.h \
+ hashedstring.h
+
+
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = kdevelopproject.desktop kdeveloplanguagesupport.desktop \
+ kdevelopplugin.desktop
+
+METASOURCES = AUTO
+
+SUBDIRS = extensions external extras
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil designer_integration kdevcatalog kdevprofileslib kdevextensions
+DOXYGEN_PROJECTNAME = KDevelop Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../Doxyfile.am
+noinst_HEADERS = kdevprojectiface.h kdevdesignerintegrationiface.h
diff --git a/lib/interfaces/codemodel.cpp b/lib/interfaces/codemodel.cpp
new file mode 100644
index 00000000..567f785a
--- /dev/null
+++ b/lib/interfaces/codemodel.cpp
@@ -0,0 +1,1823 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "codemodel.h"
+#include "driver.h"
+#include <kdebug.h>
+#include <kdatastream.h>
+
+///Little helper-functions to save a lot of typing and possible errors
+template<class MapContainer>
+bool eachCanUpdate( const MapContainer& old, const MapContainer& newMap ) {
+ if( old.size() != newMap.size() ) return false;
+
+ typename MapContainer::const_iterator oldIt = old.begin();
+ typename MapContainer::const_iterator newIt = newMap.begin();
+ while( oldIt != old.end() ) {
+ typedef typename MapContainer::mapped_type ListType;
+ if( (*oldIt).size() != (*newIt).size() ) return false;
+ typename ListType::const_iterator it1 = (*oldIt).begin();
+ typename ListType::const_iterator it2 = (*newIt).begin();
+
+ while( it1 != (*oldIt).end() ) {
+ if( !(*it1)->canUpdate( *it2 ) ) return false;
+ ++it1;
+ ++it2;
+ }
+ ++oldIt;
+ ++newIt;
+ }
+ return true;
+}
+
+template<class MapContainer>
+void eachUpdate( MapContainer& old, const MapContainer& newMap ) {
+ if( old.size() != newMap.size() ) kdError( 9007 ) << "error in eachUpdate(...) 1" << endl;
+ typename MapContainer::iterator oldIt = old.begin();
+ typename MapContainer::const_iterator newIt = newMap.begin();
+ while( oldIt != old.end() ) {
+ if( (*oldIt).size() != (*newIt).size() ) kdError( 9007 ) << "error in eachUpdate(...) 2" << endl;
+ typedef typename MapContainer::mapped_type ListType;
+ typename ListType::iterator it1 = (*oldIt).begin();
+ typename ListType::const_iterator it2 = (*newIt).begin();
+ while( it1 != (*oldIt).end() ) {
+ (*it1)->update( *it2 );
+ ++it1;
+ ++it2;
+ }
+ ++oldIt;
+ ++newIt;
+ }
+}
+
+///Versions for contains that do not contain maps again
+template<class MapContainer>
+bool eachCanUpdateSingle( const MapContainer& old, const MapContainer& newMap ) {
+ if( old.size() != newMap.size() ) return false;
+
+ typename MapContainer::const_iterator oldIt = old.begin();
+ typename MapContainer::const_iterator newIt = newMap.begin();
+ while( oldIt != old.end() ) {
+ if( !(*oldIt)->canUpdate( *newIt ) ) return false;
+ ++oldIt;
+ ++newIt;
+ }
+ return true;
+}
+
+template<class MapContainer>
+void eachUpdateSingle( MapContainer& old, const MapContainer& newMap ) {
+ if( old.size() != newMap.size() ) kdError( 9007 ) << "error in eachUpdate(...) 1" << endl;
+ typename MapContainer::iterator oldIt = old.begin();
+ typename MapContainer::const_iterator newIt = newMap.begin();
+ while( oldIt != old.end() ) {
+ (*oldIt)->update( *newIt );
+ ++oldIt;
+ ++newIt;
+ }
+}
+
+CodeModel::CodeModel()
+{
+ wipeout();
+ m_currentGroupId = 1; ///0 stands for invalid group
+}
+
+CodeModel::~ CodeModel( )
+{
+}
+
+int CodeModel::newGroupId() {
+ return (m_currentGroupId++) * 2;
+}
+
+inline bool isSingleGroup( const int group ) {
+ return (group % 2) == 0;
+}
+
+QStringList CodeModel::getGroupStrings(int gid) const {
+ QStringList ret;
+ for(QMap<QString, FileDom>::ConstIterator it = m_files.begin(); it != m_files.end(); ++it) {
+ if((*it)->groupId() == gid) ret.append( (*it)-> name() );
+ }
+ return ret;
+}
+
+
+FileList CodeModel::getGroup(int gid) const {
+ FileList ret;
+ for(QMap<QString, FileDom>::ConstIterator it = m_files.begin(); it != m_files.end(); ++it) {
+ if((*it)->groupId() == gid) ret.append(*it);
+ }
+ return ret;
+}
+
+FileList CodeModel::getGroup( const FileDom& dom) const {
+ return getGroup( dom->groupId() );
+}
+
+int CodeModel::mergeGroups( int g1, int g2) {
+ if( !g1 || !g2 ) return 0;
+ if( g1 == g2 ) return g1;
+ int ng = isSingleGroup( g1 ) ? g2 : g1;
+ if( isSingleGroup( ng ) )
+ ng = newGroupId() + 1;
+
+ for( QMap<QString, FileDom>::iterator it = m_files.begin(); it != m_files.end(); ++it ) {
+ if( (*it)->groupId() == g2 || (*it)->groupId() == g1 ) (*it)->setGroupId( ng );
+ }
+ return ng;
+}
+
+template<class Type> static void dumpMap( std::ostream& file, QMap<QString, Type>& map ) {
+ typename QMap<QString, Type>::Iterator it = map.begin();
+ for( ; it != map.end(); ++it) {
+ typename Type::Iterator it2 = (*it).begin();
+ for( ; it2 != (*it).end(); ++it2) {
+ (*it2) -> dump( file, true );
+ }
+ }
+}
+
+template<class Type> static void dumpMapDirect( std::ostream& file, QMap<QString, Type>& map ) {
+ typename QMap<QString, Type>::Iterator it = map.begin();
+ for( ; it != map.end(); ++it) {
+ (*it) -> dump( file, true );
+ }
+}
+
+void CodeModelItem::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "name: " << name().ascii() << "\n";
+ str << "kind: " << m_kind << " ";
+
+ if( isFile() ) str << "isFile ";
+ if( isNamespace() ) str << "isNamespace ";
+ if( isClass() ) str << "isClass ";
+ if( isFunction() ) str << "isFunction ";
+ if( isFunctionDefinition() ) str << "isFunctionDefinition ";
+ if( isVariable() ) str << "isVariable ";
+ if( isArgument() ) str << "isArgument ";
+ if( isEnum() ) str << "isEnum ";
+ if( isEnumerator() ) str << "isEnumerator ";
+ if( isTypeAlias() ) str << "isTypeAlias ";
+ if( isCustom() ) str << "isCustom ";
+ str << "\n";
+ str << "File: " << fileName().ascii() << " ";
+ int line, col;
+ getStartPosition( &line, &col );
+ str << "s:(" << line << ", " << col << ") ";
+ getEndPosition( &line, &col );
+ str << "e:(" << line << ", " << col << ")\n";
+
+
+ Info.prepend( str.str().c_str() );
+
+ file << Info.ascii() << "\n";
+ if(recurse) {} ///just to get rid of the warning
+}
+
+void ClassModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+
+ str << "scope: " << m_scope.join("::").ascii() << "\n";
+ str << "bases: " << m_baseClassList.join(" ").ascii() << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if( recurse ) {
+ dumpMap( file, m_classes );
+ }
+}
+
+void NamespaceAliasModel::read( QDataStream& stream ) {
+ QString tempFileName;
+ stream >> m_name >> m_aliasName >> tempFileName;
+ m_fileName = HashedString( tempFileName );
+}
+
+void NamespaceAliasModel::write( QDataStream& stream ) const {
+ stream << m_name << m_aliasName << m_fileName.str();
+}
+
+void NamespaceImportModel::read( QDataStream& stream ) {
+ QString tempFileName;
+ stream >> m_name >> tempFileName;
+ m_fileName = HashedString( tempFileName );
+}
+
+void NamespaceImportModel::write( QDataStream& stream ) const {
+ stream << m_name << m_fileName.str();
+}
+
+void NamespaceModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ Info.prepend( str.str().c_str() );
+
+ ClassModel::dump( file, false, Info );
+
+ if( recurse ) {
+ dumpMapDirect( file, m_namespaces );
+ }
+}
+
+void ArgumentModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "type: " << m_type.ascii() << " default: " << m_defaultValue.ascii() << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if(recurse) {} ///just to get rid of the warning
+}
+
+void FunctionModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "access: " << m_access;
+
+ str << " scope: " << m_scope.join("::").ascii() << "\n";
+
+ if(isAbstract()) str << "isAbstract ";
+ if(isConstant()) str << "isConstant ";
+ if(isFunction()) str << "isFunction ";
+ if(isInline()) str << "isInline ";
+ if(isSignal()) str << "isSignal ";
+ if(isSlot()) str << "isSlot ";
+ if(isStatic()) str << "isStatic ";
+ if(isVirtual()) str << "isVirtual ";
+
+ str << "\n";
+ str << "result-type: " << resultType().ascii() << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if(recurse) {
+ for( ArgumentList::iterator it = m_arguments.begin(); it != m_arguments.end(); ++it) {
+ (*it) -> dump( file, true );
+ }
+ }
+}
+
+void VariableModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "access: " << m_access << "type: " << m_type.ascii() << "\n";
+
+ if(isStatic()) str << "isStatic ";
+
+ str << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if(recurse) {} ///just to get rid of the warning
+}
+
+void CodeModel::dump( std::ostream& file, QString Info ) {
+ ostringstream str(ostringstream::out);
+
+ Info.prepend( str.str().c_str() );
+
+ file << Info.ascii() << "\n";
+
+ QMap<QString, FileDom>::iterator it = m_files.begin();
+ for(; it != m_files.end(); ++it) {
+ (*it) -> dump( file, true );
+ }
+}
+
+void EnumModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "access: " << m_access << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if( recurse ) {
+ dumpMapDirect( file, m_enumerators );
+ }
+}
+
+void EnumeratorModel::dump( std::ostream& file, bool recurse, QString Info )
+{
+ ostringstream str( ostringstream::out );
+
+ str << "value: " << m_value.ascii() << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if(recurse) {} ///just to get rid of the warning
+}
+
+void TypeAliasModel::dump( std::ostream& file, bool recurse, QString Info ) {
+ ostringstream str( ostringstream::out );
+
+ str << "type: " << m_type.ascii() << "\n";
+
+ Info.prepend( str.str().c_str() );
+
+ CodeModelItem::dump( file, false, Info );
+
+ if(recurse) {} ///just to get rid of the warning
+}
+
+void CodeModel::wipeout()
+{
+ m_files.clear();
+ NamespaceDom ns = create<NamespaceModel>();
+ ns->setName( "::" );
+
+ m_globalNamespace = ns;
+}
+
+FileList CodeModel::fileList( )
+{
+ return m_files.values();
+}
+
+const FileList CodeModel::fileList( ) const
+{
+ return m_files.values();
+}
+
+bool CodeModel::hasFile( const QString & name ) const
+{
+ return m_files.contains( name );
+}
+
+FileDom CodeModel::fileByName( const QString & name )
+{
+ QMap<QString, FileDom>::const_iterator it = m_files.find( name );
+ if( it != m_files.end() ) {
+ return *it;
+ } else {
+ return FileDom();
+ }
+}
+
+const FileDom CodeModel::fileByName( const QString & name ) const
+{
+ QMap<QString, FileDom>::const_iterator it = m_files.find( name );
+ if( it != m_files.end() ) {
+ return *it;
+ } else {
+ return FileDom();
+ }
+}
+
+void CodeModel::addNamespace( NamespaceDom target, NamespaceDom source )
+{
+ if( source->name().isEmpty() ){
+ return;
+ } else if( !target->hasNamespace(source->name()) ){
+ NamespaceDom ns = this->create<NamespaceModel>();
+ ns->setName( source->name() );
+ ns->setFileName( source->fileName() ); /// \FIXME ROBE
+ ns->setScope( source->scope() );
+ target->addNamespace( ns );
+ }
+
+ NamespaceDom ns = target->namespaceByName( source->name() );
+
+ NamespaceList namespaceList = source->namespaceList();
+ ClassList classList = source->classList();
+ FunctionList functionList = source->functionList();
+ FunctionDefinitionList functionDefinitionList = source->functionDefinitionList();
+ VariableList variableList = source->variableList();
+ EnumList enumList = source->enumList();
+ TypeAliasList typeAliasList = source->typeAliasList();
+ const NamespaceModel::NamespaceAliasModelList& namespaceAliases = source->namespaceAliases();
+ const NamespaceModel::NamespaceImportModelList& namespaceImports = source->namespaceImports();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ addNamespace( ns, *it );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ ns->addClass( *it );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ ns->addFunction( *it );
+ for( FunctionDefinitionList::Iterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ ns->addFunctionDefinition( *it );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ ns->addVariable( *it );
+ for( EnumList::Iterator it=enumList.begin(); it!=enumList.end(); ++it )
+ ns->addEnum( *it );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ ns->addTypeAlias( *it );
+ for( NamespaceModel::NamespaceAliasModelList::const_iterator it=namespaceAliases.begin(); it != namespaceAliases.end(); ++it )
+ ns->addNamespaceAlias( *it );
+ for( NamespaceModel::NamespaceImportModelList::const_iterator it=namespaceImports.begin(); it != namespaceImports.end(); ++it )
+ ns->addNamespaceImport( *it );
+}
+
+void CodeModel::removeNamespace( NamespaceDom target, NamespaceDom source )
+{
+ if( source->name().isEmpty() || !target->hasNamespace(source->name()) )
+ return;
+
+ NamespaceDom ns = target->namespaceByName( source->name() );
+
+ NamespaceList namespaceList = source->namespaceList();
+ ClassList classList = source->classList();
+ FunctionList functionList = source->functionList();
+ FunctionDefinitionList functionDefinitionList = source->functionDefinitionList();
+ VariableList variableList = source->variableList();
+ EnumList enumList = source->enumList();
+ TypeAliasList typeAliasList = source->typeAliasList();
+ const NamespaceModel::NamespaceAliasModelList& namespaceAliases = source->namespaceAliases();
+ const NamespaceModel::NamespaceImportModelList& namespaceImports = source->namespaceImports();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ removeNamespace( ns, *it );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ ns->removeClass( *it );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ ns->removeFunction( *it );
+ for( FunctionDefinitionList::Iterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ ns->removeFunctionDefinition( *it );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ ns->removeVariable( *it );
+ for( EnumList::Iterator it=enumList.begin(); it!=enumList.end(); ++it )
+ ns->removeEnum( *it );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ ns->removeTypeAlias( *it );
+ for( NamespaceModel::NamespaceAliasModelList::const_iterator it=namespaceAliases.begin(); it != namespaceAliases.end(); ++it )
+ ns->removeNamespaceAlias( *it );
+ for( NamespaceModel::NamespaceImportModelList::const_iterator it=namespaceImports.begin(); it != namespaceImports.end(); ++it )
+ ns->removeNamespaceImport( *it );
+
+ if( ns->namespaceList().isEmpty() &&
+ ns->classList().isEmpty() &&
+ ns->functionList().isEmpty() &&
+ ns->functionDefinitionList().isEmpty() &&
+ ns->variableList().isEmpty() &&
+ ns->enumList().isEmpty() &&
+ ns->typeAliasList().isEmpty() &&
+ ns->namespaceImports().empty() &&
+ ns->namespaceAliases().empty() )
+ {
+ target->removeNamespace( ns );
+ }
+}
+
+bool CodeModel::addFile( FileDom file )
+{
+ if( file->name().isEmpty() )
+ return false;
+
+ if( m_files.find( file->name() ) != m_files.end() ) {
+ ///the error-channel is set to 9007 because this problem appears with the cpp-support, so it is needed while debugging it
+ kdDebug(9007) << "file " << file->name() << " was added to code-model without removing it before! \n" << kdBacktrace() << endl;
+ removeFile( fileByName( file->name() ) );
+ }
+
+ // update global namespace
+ NamespaceList namespaceList = file->namespaceList();
+ ClassList classList = file->classList();
+ FunctionList functionList = file->functionList();
+ FunctionDefinitionList functionDefinitionList = file->functionDefinitionList();
+ VariableList variableList = file->variableList();
+ EnumList enumList = file->enumList();
+ TypeAliasList typeAliasList = file->typeAliasList();
+ const NamespaceModel::NamespaceAliasModelList& namespaceAliases = file->namespaceAliases();
+ const NamespaceModel::NamespaceImportModelList& namespaceImports = file->namespaceImports();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ addNamespace( m_globalNamespace, *it );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ m_globalNamespace->addClass( *it );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ m_globalNamespace->addFunction( *it );
+ for( FunctionDefinitionList::Iterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ m_globalNamespace->addFunctionDefinition( *it );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ m_globalNamespace->addVariable( *it );
+ for( EnumList::Iterator it=enumList.begin(); it!=enumList.end(); ++it )
+ m_globalNamespace->addEnum( *it );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ m_globalNamespace->addTypeAlias( *it );
+ for( NamespaceModel::NamespaceAliasModelList::const_iterator it=namespaceAliases.begin(); it != namespaceAliases.end(); ++it )
+ m_globalNamespace->addNamespaceAlias( *it );
+ for( NamespaceModel::NamespaceImportModelList::const_iterator it=namespaceImports.begin(); it != namespaceImports.end(); ++it )
+ m_globalNamespace->addNamespaceImport( *it );
+
+ m_files.insert( file->name(), file );
+ return true;
+}
+
+void CodeModel::removeFile( FileDom file )
+{
+ // update global namespace
+ NamespaceList namespaceList = file->namespaceList();
+ ClassList classList = file->classList();
+ FunctionList functionList = file->functionList();
+ FunctionDefinitionList functionDefinitionList = file->functionDefinitionList();
+ VariableList variableList = file->variableList();
+ EnumList enumList = file->enumList();
+ TypeAliasList typeAliasList = file->typeAliasList();
+ const NamespaceModel::NamespaceAliasModelList& namespaceAliases = file->namespaceAliases();
+ const NamespaceModel::NamespaceImportModelList& namespaceImports = file->namespaceImports();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ removeNamespace( m_globalNamespace, *it );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ m_globalNamespace->removeClass( *it );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ m_globalNamespace->removeFunction( *it );
+ for( FunctionDefinitionList::Iterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ m_globalNamespace->removeFunctionDefinition( *it );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ m_globalNamespace->removeVariable( *it );
+ for( EnumList::Iterator it=enumList.begin(); it!=enumList.end(); ++it )
+ m_globalNamespace->removeEnum( *it );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ m_globalNamespace->removeTypeAlias( *it );
+ for( NamespaceModel::NamespaceAliasModelList::const_iterator it=namespaceAliases.begin(); it != namespaceAliases.end(); ++it )
+ m_globalNamespace->removeNamespaceAlias( *it );
+ for( NamespaceModel::NamespaceImportModelList::const_iterator it=namespaceImports.begin(); it != namespaceImports.end(); ++it )
+ m_globalNamespace->removeNamespaceImport( *it );
+
+ m_files.remove( file->name() );
+}
+
+// ------------------------------------------------------------------------
+CodeModelItem::CodeModelItem( int kind, CodeModel* model )
+ : m_kind( kind ), m_model( model )
+{
+ //kdDebug() << "CodeModelItem::CodeModelItem()" << endl;
+ m_startLine = 0;
+ m_startColumn = 0;
+ m_endLine = 0;
+ m_endColumn = 0;
+}
+
+CodeModelItem::~ CodeModelItem( )
+{
+}
+
+QString CodeModelItem::name( ) const
+{
+ return m_name;
+}
+
+void CodeModelItem::setName( const QString & name )
+{
+ m_name = name;
+}
+
+const FileDom CodeModelItem::file( ) const
+{
+ return m_model->fileByName( m_fileName );
+}
+
+FileDom CodeModelItem::file( )
+{
+ return m_model->fileByName( m_fileName );
+}
+
+QString CodeModelItem::fileName() const
+{
+ return m_fileName;
+}
+
+void CodeModelItem::setFileName( const QString& fileName )
+{
+ m_fileName = fileName;
+}
+
+void CodeModelItem::getStartPosition( int * line, int * column ) const
+{
+ if( line ) *line = m_startLine;
+ if( column ) *column = m_startColumn;
+}
+
+void CodeModelItem::setStartPosition( int line, int column )
+{
+ m_startLine = line;
+ m_startColumn = column;
+}
+
+void CodeModelItem::getEndPosition( int * line, int * column ) const
+{
+ if( line ) *line = m_endLine;
+ if( column ) *column = m_endColumn;
+}
+
+void CodeModelItem::setEndPosition( int line, int column )
+{
+ m_endLine = line;
+ m_endColumn = column;
+}
+
+void CodeModelItem::update( const CodeModelItem* i ) {
+ m_startLine = i->m_startLine;
+ m_startColumn = i->m_startColumn;
+ m_endLine = i->m_endLine;
+ m_endColumn = i->m_endColumn;
+}
+
+bool CodeModelItem::canUpdate( const CodeModelItem* i ) const {
+ if( i->m_kind != m_kind || i->m_name != m_name )
+ return false;
+ return true;
+}
+
+
+// ------------------------------------------------------------------------
+NamespaceModel::NamespaceModel( CodeModel* model )
+ : ClassModel( model )
+{
+ setKind( Namespace );
+}
+
+NamespaceList NamespaceModel::namespaceList( )
+{
+ return m_namespaces.values();
+}
+
+const NamespaceList NamespaceModel::namespaceList( ) const
+{
+ return m_namespaces.values();
+}
+
+NamespaceDom NamespaceModel::namespaceByName( const QString & name )
+{
+ return m_namespaces.contains( name ) ? m_namespaces[ name ] : NamespaceDom();
+}
+
+const NamespaceDom NamespaceModel::namespaceByName( const QString & name ) const
+{
+ return m_namespaces.contains( name ) ? m_namespaces[ name ] : NamespaceDom();
+}
+
+bool NamespaceModel::hasNamespace( const QString & name ) const
+{
+ return m_namespaces.contains( name );
+}
+
+bool NamespaceModel::addNamespace( NamespaceDom ns )
+{
+ if( ns->name().isEmpty() )
+ return false;
+
+ m_namespaces[ ns->name() ] = ns;
+ return true;
+}
+
+void NamespaceModel::removeNamespace( NamespaceDom ns )
+{
+ m_namespaces.remove( ns->name() );
+}
+
+// ------------------------------------------------------------------------
+FileModel::FileModel( CodeModel* model )
+ : NamespaceModel( model ), m_groupId( model->newGroupId() ), m_parseResult( 0 )
+{
+}
+
+// ------------------------------------------------------------------------
+ClassModel::ClassModel( CodeModel* model )
+ : CodeModelItem( Class, model)
+{
+}
+
+QStringList ClassModel::baseClassList( ) const
+{
+ return m_baseClassList;
+}
+
+bool ClassModel::addBaseClass( const QString & baseClass )
+{
+ m_baseClassList.push_back( baseClass );
+ return true;
+}
+
+void ClassModel::removeBaseClass( const QString & baseClass )
+{
+ m_baseClassList.remove( baseClass );
+}
+
+ClassList ClassModel::classList( )
+{
+ ClassList l;
+ QMap<QString, ClassList>::Iterator it = m_classes.begin();
+ while( it != m_classes.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+const ClassList ClassModel::classList( ) const
+{
+ ClassList l;
+ QMap<QString, ClassList>::ConstIterator it = m_classes.begin();
+ while( it != m_classes.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+bool ClassModel::hasClass( const QString & name ) const
+{
+ return m_classes.contains( name );
+}
+
+ClassList ClassModel::classByName( const QString & name )
+{
+ return m_classes.contains( name ) ? m_classes[ name ] : ClassList();
+}
+
+const ClassList ClassModel::classByName( const QString & name ) const
+{
+ return m_classes.contains( name ) ? m_classes[ name ] : ClassList();
+}
+
+bool ClassModel::addClass( ClassDom klass )
+{
+ if( klass->name().isEmpty() )
+ return false;
+
+ m_classes[ klass->name() ].push_back( klass );
+ return true;
+}
+
+void ClassModel::removeClass( ClassDom klass )
+{
+ m_classes[ klass->name() ].remove( klass );
+
+ if( m_classes[klass->name()].isEmpty() )
+ m_classes.remove( klass->name() );
+}
+
+FunctionList ClassModel::functionList( )
+{
+ FunctionList l;
+ QMap<QString, FunctionList>::Iterator it = m_functions.begin();
+ while( it != m_functions.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+const FunctionList ClassModel::functionList( ) const
+{
+ FunctionList l;
+ QMap<QString, FunctionList>::ConstIterator it = m_functions.begin();
+ while( it != m_functions.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+bool ClassModel::hasFunction( const QString & name ) const
+{
+ return m_functions.contains( name );
+}
+
+FunctionList ClassModel::functionByName( const QString & name )
+{
+ return m_functions.contains( name ) ? m_functions[ name ] : FunctionList();
+}
+
+const FunctionList ClassModel::functionByName( const QString & name ) const
+{
+ return m_functions.contains( name ) ? m_functions[ name ] : FunctionList();
+}
+
+bool ClassModel::addFunction( FunctionDom fun )
+{
+ if( fun->name().isEmpty() )
+ return false;
+
+ m_functions[ fun->name() ].push_back( fun );
+ return true;
+}
+
+void ClassModel::removeFunction( FunctionDom fun )
+{
+ m_functions[ fun->name() ].remove( fun );
+
+ if( m_functions[fun->name()].isEmpty() )
+ m_functions.remove( fun->name() );
+}
+
+FunctionDefinitionList ClassModel::functionDefinitionList( )
+{
+ FunctionDefinitionList l;
+ QMap<QString, FunctionDefinitionList>::Iterator it = m_functionDefinitions.begin();
+ while( it != m_functionDefinitions.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+const FunctionDefinitionList ClassModel::functionDefinitionList( ) const
+{
+ FunctionDefinitionList l;
+ QMap<QString, FunctionDefinitionList>::ConstIterator it = m_functionDefinitions.begin();
+ while( it != m_functionDefinitions.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+bool ClassModel::hasFunctionDefinition( const QString & name ) const
+{
+ return m_functionDefinitions.contains( name );
+}
+
+FunctionDefinitionList ClassModel::functionDefinitionByName( const QString & name )
+{
+ return m_functionDefinitions.contains( name ) ? m_functionDefinitions[ name ] : FunctionDefinitionList();
+}
+
+const FunctionDefinitionList ClassModel::functionDefinitionByName( const QString & name ) const
+{
+ return m_functionDefinitions.contains( name ) ? m_functionDefinitions[ name ] : FunctionDefinitionList();
+}
+
+bool ClassModel::addFunctionDefinition( FunctionDefinitionDom fun )
+{
+ if( fun->name().isEmpty() )
+ return false;
+
+ m_functionDefinitions[ fun->name() ].push_back( fun );
+ return true;
+}
+
+void ClassModel::removeFunctionDefinition( FunctionDefinitionDom fun )
+{
+ m_functionDefinitions[ fun->name() ].remove( fun );
+
+ if( m_functionDefinitions[fun->name()].isEmpty() )
+ m_functionDefinitions.remove( fun->name() );
+}
+
+VariableList ClassModel::variableList( )
+{
+ return m_variables.values();
+}
+
+const VariableList ClassModel::variableList( ) const
+{
+ return m_variables.values();
+}
+
+VariableDom ClassModel::variableByName( const QString & name )
+{
+ return m_variables.contains( name ) ? m_variables[ name ] : VariableDom();
+}
+
+const VariableDom ClassModel::variableByName( const QString & name ) const
+{
+ return m_variables.contains( name ) ? m_variables[ name ] : VariableDom();
+}
+
+bool ClassModel::hasVariable( const QString & name ) const
+{
+ return m_variables.contains( name );
+}
+
+bool ClassModel::addVariable( VariableDom var )
+{
+ if( var->name().isEmpty() )
+ return false;
+
+ m_variables.insert( var->name(), var );
+ return true;
+}
+
+void ClassModel::removeVariable( VariableDom var )
+{
+ m_variables.remove( var->name() );
+}
+
+EnumList ClassModel::enumList( )
+{
+ return m_enumerators.values();
+}
+
+const EnumList ClassModel::enumList( ) const
+{
+ return m_enumerators.values();
+}
+
+EnumDom ClassModel::enumByName( const QString & name )
+{
+ return m_enumerators.contains( name ) ? m_enumerators[ name ] : EnumDom();
+}
+
+const EnumDom ClassModel::enumByName( const QString & name ) const
+{
+ return m_enumerators.contains( name ) ? m_enumerators[ name ] : EnumDom();
+}
+
+bool ClassModel::hasEnum( const QString & name ) const
+{
+ return m_enumerators.contains( name );
+}
+
+bool ClassModel::addEnum( EnumDom e )
+{
+ if( e->name().isEmpty() )
+ return false;
+
+ m_enumerators.insert( e->name(), e );
+ return true;
+}
+
+void ClassModel::update( const ClassModel* klass ) {
+ CodeModelItem::update( klass );
+ eachUpdate( m_classes, klass->m_classes ) ;
+ eachUpdate( m_functions, klass->m_functions ) ;
+ eachUpdate( m_functionDefinitions, klass->m_functionDefinitions ) ;
+ eachUpdateSingle( m_variables, klass->m_variables ) ;
+ eachUpdateSingle( m_enumerators, klass->m_enumerators ) ;
+ eachUpdate( m_typeAliases, klass->m_typeAliases );
+}
+
+bool ClassModel::canUpdate( const ClassModel* klass ) const {
+ if( !CodeModelItem::canUpdate( klass ) )
+ return false;
+
+ return eachCanUpdate( m_classes, klass->m_classes ) &&
+ eachCanUpdate( m_functions, klass->m_functions ) &&
+ eachCanUpdate( m_functionDefinitions, klass->m_functionDefinitions ) &&
+ eachCanUpdateSingle( m_variables, klass->m_variables ) &&
+ eachCanUpdateSingle( m_enumerators, klass->m_enumerators ) &&
+ eachCanUpdate( m_typeAliases, klass->m_typeAliases );
+}
+
+void ClassModel::removeEnum( EnumDom e )
+{
+ m_enumerators.remove( e->name() );
+}
+
+TypeAliasList ClassModel::typeAliasList( )
+{
+ TypeAliasList l;
+ QMap<QString, TypeAliasList>::Iterator it = m_typeAliases.begin();
+ while( it != m_typeAliases.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+const TypeAliasList ClassModel::typeAliasList( ) const
+{
+ TypeAliasList l;
+ QMap<QString, TypeAliasList>::ConstIterator it = m_typeAliases.begin();
+ while( it != m_typeAliases.end() ){
+ l += *it;
+ ++it;
+ }
+
+ return l;
+}
+
+bool ClassModel::hasTypeAlias( const QString & name ) const
+{
+ return m_typeAliases.contains( name );
+}
+
+TypeAliasList ClassModel::typeAliasByName( const QString & name )
+{
+ return m_typeAliases.contains( name ) ? m_typeAliases[ name ] : TypeAliasList();
+}
+
+const TypeAliasList ClassModel::typeAliasByName( const QString & name ) const
+{
+ return m_typeAliases.contains( name ) ? m_typeAliases[ name ] : TypeAliasList();
+}
+
+bool ClassModel::addTypeAlias( TypeAliasDom typeAlias )
+{
+ if( typeAlias->name().isEmpty() )
+ return false;
+
+ m_typeAliases[ typeAlias->name() ].push_back( typeAlias );
+ return true;
+}
+
+void ClassModel::removeTypeAlias( TypeAliasDom typeAlias )
+{
+ m_typeAliases[ typeAlias->name() ].remove( typeAlias );
+
+ if( m_typeAliases[typeAlias->name()].isEmpty() )
+ m_typeAliases.remove( typeAlias->name() );
+}
+
+
+
+// ------------------------------------------------------------------------
+ArgumentModel::ArgumentModel( CodeModel* model )
+ : CodeModelItem( Argument, model)
+{
+}
+
+QString ArgumentModel::type( ) const
+{
+ return m_type;
+}
+
+void ArgumentModel::setType( const QString& type )
+{
+ m_type = type;
+}
+
+QString ArgumentModel::defaultValue( ) const
+{
+ return m_defaultValue;
+}
+
+void ArgumentModel::setDefaultValue( const QString & defaultValue )
+{
+ m_defaultValue = defaultValue;
+}
+
+// ------------------------------------------------------------------------
+FunctionModel::FunctionModel( CodeModel* model )
+ : CodeModelItem( Function, model)
+{
+ m_access = Public;
+ d.v.m_signal = false;
+ d.v.m_slot = false;
+ d.v.m_virtual = false;
+ d.v.m_static = false;
+ d.v.m_inline = false;
+ d.v.m_constant = false;
+ d.v.m_abstract = false;
+}
+
+bool FunctionModel::isVirtual( ) const
+{
+ return d.v.m_virtual;
+}
+
+void FunctionModel::setVirtual( bool isVirtual )
+{
+ d.v.m_virtual = isVirtual;
+}
+
+bool FunctionModel::isStatic( ) const
+{
+ return d.v.m_static;
+}
+
+void FunctionModel::setStatic( bool isStatic )
+{
+ d.v.m_static = isStatic;
+}
+
+bool FunctionModel::isInline( ) const
+{
+ return d.v.m_inline;
+}
+
+void FunctionModel::setInline( bool isInline )
+{
+ d.v.m_inline = isInline;
+}
+
+bool FunctionModel::isConstant( ) const
+{
+ return d.v.m_constant;
+}
+
+void FunctionModel::setConstant( bool isConstant )
+{
+ d.v.m_constant = isConstant;
+}
+
+bool FunctionModel::isAbstract( ) const
+{
+ return d.v.m_abstract;
+}
+
+void FunctionModel::setAbstract( bool isAbstract )
+{
+ d.v.m_abstract = isAbstract;
+}
+
+QString FunctionModel::resultType( ) const
+{
+ return m_resultType;
+}
+
+void FunctionModel::setResultType( const QString& type )
+{
+ m_resultType = type;
+}
+
+ArgumentList FunctionModel::argumentList( )
+{
+ return m_arguments;
+}
+
+const ArgumentList FunctionModel::argumentList( ) const
+{
+ return m_arguments;
+}
+
+bool FunctionModel::addArgument( ArgumentDom arg )
+{
+ m_arguments.push_back( arg );
+ return true;
+}
+
+void FunctionModel::removeArgument( ArgumentDom arg )
+{
+ m_arguments.remove( arg );
+}
+
+void FunctionModel::update( const FunctionModel* i ) {
+ m_access = i->m_access;
+ CodeModelItem::update( i );
+}
+
+bool FunctionModel::canUpdate( const FunctionModel* i ) const {
+ if( !CodeModelItem::canUpdate( i ) )
+ return false;
+ if( m_resultType != i->m_resultType || m_arguments.count() != i->m_arguments.count() || m_scope != i->m_scope )
+ return false;
+ return true;
+}
+
+
+// ------------------------------------------------------------------------
+VariableModel::VariableModel( CodeModel* model )
+ : CodeModelItem( Variable, model)
+{
+ m_access = Public;
+ m_static = false;
+ m_isEnumeratorVariable = false;
+}
+
+bool VariableModel::isStatic( ) const
+{
+ return m_static;
+}
+
+void VariableModel::setStatic( bool isStatic )
+{
+ m_static = isStatic;
+}
+
+QString VariableModel::type( ) const
+{
+ return m_type;
+}
+
+void VariableModel::setType( const QString& type )
+{
+ m_type = type;
+}
+
+bool VariableModel::isEnumeratorVariable() const {
+ return m_isEnumeratorVariable;
+}
+
+void VariableModel::setEnumeratorVariable( bool b) {
+ m_isEnumeratorVariable = b;
+}
+
+int FunctionModel::access( ) const
+{
+ return m_access;
+}
+
+void FunctionModel::setAccess( int access )
+{
+ m_access = access;
+}
+
+bool FunctionModel::isSignal( ) const
+{
+ return d.v.m_signal;
+}
+
+void FunctionModel::setSignal( bool isSignal )
+{
+ d.v.m_signal = isSignal;
+}
+
+bool FunctionModel::isSlot( ) const
+{
+ return d.v.m_slot;
+}
+
+void FunctionModel::setSlot( bool isSlot )
+{
+ d.v.m_slot = isSlot;
+}
+
+FunctionDefinitionModel::FunctionDefinitionModel( CodeModel* model )
+ : FunctionModel( model )
+{
+}
+
+int VariableModel::access( ) const
+{
+ return m_access;
+}
+
+void VariableModel::setAccess( int access )
+{
+ m_access = access;
+}
+
+const NamespaceDom CodeModel::globalNamespace( ) const
+{
+ return m_globalNamespace;
+}
+
+void CodeModelItem::read( QDataStream & stream )
+{
+ stream
+ >> m_kind
+ >> m_name
+ >> m_fileName
+ >> m_startLine
+ >> m_startColumn
+ >> m_endLine
+ >> m_endColumn
+ >> m_comment;
+
+ if( isTemplateable() ) {
+ TemplateModelItem* t = (TemplateModelItem*)( this );
+
+ t->read( stream );
+ }
+}
+
+void CodeModelItem::write( QDataStream & stream ) const
+{
+ stream
+ << m_kind
+ << m_name
+ << m_fileName
+ << m_startLine
+ << m_startColumn
+ << m_endLine
+ << m_endColumn
+ << m_comment;
+
+ if( isTemplateable() ) {
+ TemplateModelItem* t = (TemplateModelItem*)( this );
+ t-> write( stream );
+ }
+}
+
+void ClassModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+
+ TemplateModelItem::read( stream );
+
+ stream >> m_scope >> m_baseClassList;
+
+ int n;
+
+ m_classes.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ ClassDom klass = codeModel()->create<ClassModel>();
+ klass->read( stream );
+ addClass( klass );
+ }
+
+ m_functions.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ FunctionDom fun = codeModel()->create<FunctionModel>();
+ fun->read( stream );
+ addFunction( fun );
+ }
+
+ m_functionDefinitions.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ FunctionDefinitionDom fun = codeModel()->create<FunctionDefinitionModel>();
+ fun->read( stream );
+ addFunctionDefinition( fun );
+ }
+
+ m_variables.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ VariableDom var = codeModel()->create<VariableModel>();
+ var->read( stream );
+ addVariable( var );
+ }
+
+ m_enumerators.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ EnumDom e = codeModel()->create<EnumModel>();
+ e->read( stream );
+ addEnum( e );
+ }
+
+ m_typeAliases.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ TypeAliasDom typeAlias = codeModel()->create<TypeAliasModel>();
+ typeAlias->read( stream );
+ addTypeAlias( typeAlias );
+ }
+}
+
+void ClassModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+
+ TemplateModelItem::write( stream );
+
+ stream << m_scope << m_baseClassList;
+
+ const ClassList class_list = classList();
+ stream << int( class_list.size() );
+ for( ClassList::ConstIterator it = class_list.begin(); it!=class_list.end(); ++it )
+ (*it)->write( stream );
+
+ const FunctionList function_list = functionList();
+ stream << int( function_list.size() );
+ for( FunctionList::ConstIterator it = function_list.begin(); it!=function_list.end(); ++it )
+ (*it)->write( stream );
+
+ const FunctionDefinitionList function_definition_list = functionDefinitionList();
+ stream << int( function_definition_list.size() );
+ for( FunctionDefinitionList::ConstIterator it = function_definition_list.begin(); it!=function_definition_list.end(); ++it )
+ (*it)->write( stream );
+
+ const VariableList variable_list = variableList();
+ stream << int( variable_list.size() );
+ for( VariableList::ConstIterator it = variable_list.begin(); it!=variable_list.end(); ++it )
+ (*it)->write( stream );
+
+ const EnumList enum_list = enumList();
+ stream << int( enum_list.size() );
+ for( EnumList::ConstIterator it = enum_list.begin(); it!=enum_list.end(); ++it )
+ (*it)->write( stream );
+
+ const TypeAliasList type_alias_list = typeAliasList();
+ stream << int( type_alias_list.size() );
+ for( TypeAliasList::ConstIterator it = type_alias_list.begin(); it!=type_alias_list.end(); ++it )
+ (*it)->write( stream );
+
+}
+
+void NamespaceModel::read( QDataStream & stream )
+{
+ ClassModel::read( stream );
+
+ int n;
+
+ m_namespaces.clear(); m_namespaceAliases.clear(); m_namespaceImports.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ NamespaceDom ns = codeModel()->create<NamespaceModel>();
+ ns->read( stream );
+ addNamespace( ns );
+ }
+
+ stream >> n;
+ for( int a = 0; a < n; a++ ) {
+ NamespaceAliasModel m;
+ m.read( stream );
+ m_namespaceAliases.insert( m );
+ }
+ stream >> n;
+ for( int a = 0; a < n; a++ ) {
+ NamespaceImportModel m;
+ m.read( stream );
+ m_namespaceImports.insert( m );
+ }
+}
+
+void NamespaceModel::addNamespaceImport( const NamespaceImportModel& import ) {
+ m_namespaceImports.insert( import );
+}
+
+void NamespaceModel::addNamespaceAlias( const NamespaceAliasModel& alias ) {
+ m_namespaceAliases.insert( alias );
+}
+
+void NamespaceModel::removeNamespaceImport( const NamespaceImportModel& import ) {
+ m_namespaceImports.erase( import );
+}
+
+void NamespaceModel::removeNamespaceAlias( const NamespaceAliasModel& alias ) {
+ m_namespaceAliases.erase( alias );
+}
+
+void NamespaceModel::write( QDataStream & stream ) const
+{
+ ClassModel::write( stream );
+
+ const NamespaceList namespace_list = namespaceList();
+ stream << int( namespace_list.size() );
+ for( NamespaceList::ConstIterator it = namespace_list.begin(); it!=namespace_list.end(); ++it )
+ (*it)->write( stream );
+
+ stream << int( m_namespaceAliases.size() );
+ for( NamespaceAliasModelList::const_iterator it = m_namespaceAliases.begin(); it != m_namespaceAliases.end(); ++it )
+ (*it).write( stream );
+ stream << int( m_namespaceImports.size() );
+ for( NamespaceImportModelList::const_iterator it = m_namespaceImports.begin(); it != m_namespaceImports.end(); ++it )
+ (*it).write( stream );
+}
+
+bool NamespaceModel::canUpdate( const NamespaceModel* ns ) const {
+ if( !ClassModel::canUpdate( ns ) )
+ return false;
+
+ const NamespaceAliasModelList& aliases = namespaceAliases();
+ const NamespaceImportModelList& imports = namespaceImports();
+ const NamespaceAliasModelList& aliases2 = ns->namespaceAliases();
+ const NamespaceImportModelList& imports2 = ns->namespaceImports();
+
+ if( aliases.size() != aliases2.size() ) return false;
+ if( imports.size() != imports2.size() ) return false;
+
+ ///Test if all aliases are same, if not return false
+ NamespaceModel::NamespaceAliasModelList::const_iterator it_al1 = aliases.begin();
+ NamespaceModel::NamespaceAliasModelList::const_iterator it_al2 = aliases2.begin();
+ while( it_al1 != aliases.end() ) {
+ if( !(*it_al1 == *it_al2) )
+ return false;
+
+ ++it_al1;
+ ++it_al2;
+ }
+
+ ///Test if all imports are same, if not return false
+ NamespaceModel::NamespaceImportModelList::const_iterator it_ip1 = imports.begin();
+ NamespaceModel::NamespaceImportModelList::const_iterator it_ip2 = imports2.begin();
+ while( it_ip1 != imports.end() ) {
+ if( !(*it_ip1 == *it_ip2) )
+ return false;
+
+ ++it_ip1;
+ ++it_ip2;
+ }
+
+ return eachCanUpdateSingle( m_namespaces, ns->m_namespaces );
+}
+
+void NamespaceModel::update( const NamespaceModel* ns )
+{
+ ClassModel::update( ns );
+
+ eachUpdateSingle( m_namespaces, ns->m_namespaces );
+}
+
+void FileModel::read( QDataStream & stream )
+{
+ stream >> m_groupId;
+ bool b;
+ stream >> b;
+ if( b ) {
+ int i;
+ stream >> i;
+ ParsedFileType t( (ParsedFileType) i );
+ switch( t ) {
+ case CppParsedFile:
+ m_parseResult = (AbstractParseResult*)(new ParsedFile( stream ));
+ break;
+ }
+ }
+
+ NamespaceModel::read( stream );
+}
+
+void FileModel::write( QDataStream & stream ) const
+{
+ stream << m_groupId;
+ bool b = m_parseResult;
+ stream << b;
+ if( b ) {
+ int i = m_parseResult->type();
+ stream << i;
+ m_parseResult->write( stream );
+ }
+
+ NamespaceModel::write( stream );
+}
+
+void ArgumentModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+
+
+ stream >> m_type >> m_defaultValue;
+}
+
+void ArgumentModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+
+ stream << m_type << m_defaultValue;
+}
+
+void FunctionModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+ TemplateModelItem::read( stream );
+
+ stream >> m_scope;
+ stream >> d.flags;
+
+ int n;
+
+ m_arguments.clear();
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ ArgumentDom arg = codeModel()->create<ArgumentModel>();
+ arg->read( stream );
+ addArgument( arg );
+ }
+
+ stream
+ >> m_resultType;
+}
+
+void FunctionModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+ TemplateModelItem::write( stream );
+
+ stream << m_scope;
+ stream << d.flags;
+
+ const ArgumentList argument_list = argumentList();
+ stream << int( argument_list.size() );
+ for( ArgumentList::ConstIterator it = argument_list.begin(); it!=argument_list.end(); ++it )
+ (*it)->write( stream );
+
+ stream
+ << m_resultType;
+}
+
+void CodeModel::read( QDataStream & stream )
+{
+ int n;
+
+ m_files.clear();
+
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ FileDom file = this->create<FileModel>();
+ file->read( stream );
+ addFile( file );
+ }
+}
+
+void CodeModel::write( QDataStream & stream ) const
+{
+ const FileList file_list = fileList();
+ stream << int( file_list.size() );
+ for( FileList::ConstIterator it = file_list.begin(); it!=file_list.end(); ++it )
+ (*it)->write( stream );
+}
+
+void VariableModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+ stream >> m_access >> m_static >> m_type >> m_isEnumeratorVariable;
+}
+
+void VariableModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+ stream << m_access << m_static << m_type << m_isEnumeratorVariable;
+}
+
+void VariableModel::update( const VariableModel* i ) {
+ m_access = i->m_access;
+ CodeModelItem::update( i );
+}
+
+bool VariableModel::canUpdate( const VariableModel* i ) const {
+ if( !CodeModelItem::canUpdate( i ) )
+ return false;
+ if( m_access != i->m_access || m_static != i->m_static || m_type != i->m_type || m_isEnumeratorVariable != i->m_isEnumeratorVariable )
+ return false;
+ return true;
+}
+
+// -------------------------------------------------------
+EnumModel::EnumModel( CodeModel * model )
+ : CodeModelItem( Enum, model)
+{
+}
+
+int EnumModel::access( ) const
+{
+ return m_access;
+}
+
+void EnumModel::setAccess( int access )
+{
+ m_access = access;
+}
+
+EnumeratorList EnumModel::enumeratorList( )
+{
+ return m_enumerators.values();
+}
+
+const EnumeratorList EnumModel::enumeratorList( ) const
+{
+ return m_enumerators.values();
+}
+
+void EnumModel::addEnumerator( EnumeratorDom enumerator )
+{
+ m_enumerators.insert( enumerator->name(), enumerator );
+}
+
+void EnumModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+ stream >> m_access;
+
+ int n;
+ stream >> n;
+ for( int i=0; i<n; ++i ){
+ EnumeratorDom e = codeModel()->create<EnumeratorModel>();
+ e->read( stream );
+ addEnumerator( e );
+ }
+}
+
+void EnumModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+
+ stream << m_access;
+ const EnumeratorList enumerator_list = enumeratorList();
+ stream << int( enumerator_list.size() );
+ for( EnumeratorList::ConstIterator it = enumerator_list.begin(); it!=enumerator_list.end(); ++it )
+ (*it)->write( stream );
+}
+
+EnumeratorModel::EnumeratorModel( CodeModel * model )
+ : CodeModelItem( Enumerator, model )
+{
+}
+
+QString EnumeratorModel::value( ) const
+{
+ return m_value;
+}
+
+void EnumeratorModel::setValue( const QString & value )
+{
+ m_value = value;
+}
+
+void EnumeratorModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+ stream >> m_value;
+}
+
+void EnumeratorModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+ stream << m_value;
+}
+
+void EnumModel::removeEnumerator( EnumeratorDom e )
+{
+ m_enumerators.remove( e->name() );
+}
+
+void EnumModel::update( const EnumModel* i ) {
+ m_access = i->m_access;
+ CodeModelItem::update( i );
+}
+
+bool EnumModel::canUpdate( const EnumModel* i ) const {
+ if( !CodeModelItem::canUpdate( i ) )
+ return false;
+ ///@todo check not complete
+ if( m_access != i->m_access || m_enumerators.count() != i->m_enumerators.count() )
+ return false;
+ return true;
+}
+
+// ---------------------------------------------------------------
+TypeAliasModel::TypeAliasModel( CodeModel * model )
+ : CodeModelItem( TypeAlias, model )
+{
+}
+
+void TypeAliasModel::read( QDataStream & stream )
+{
+ CodeModelItem::read( stream );
+
+ stream >> m_type;
+}
+
+void TypeAliasModel::write( QDataStream & stream ) const
+{
+ CodeModelItem::write( stream );
+
+ stream << m_type;
+}
+
+QString TypeAliasModel::type( ) const
+{
+ return m_type;
+}
+
+void TypeAliasModel::setType( const QString & type )
+{
+ m_type = type;
+}
+
+void TypeAliasModel::update( const TypeAliasModel* i ) {
+ CodeModelItem::update( i );
+}
+
+bool TypeAliasModel::canUpdate( const TypeAliasModel* i ) const {
+ if( !CodeModelItem::canUpdate( i ) )
+ return false;
+ return m_type == i->m_type;
+}
+
+void FileModel::update( const FileModel* file ) {
+ m_parseResult = file->m_parseResult;
+ NamespaceModel::update( file );
+}
+
+FileList FileModel::wholeGroup() {
+ if( isSingleGroup( m_groupId ) ) return ( FileList() << FileDom(this) );
+ return codeModel()->getGroup( m_groupId );
+}
+
+QStringList FileModel::wholeGroupStrings() const {
+ if( isSingleGroup( m_groupId ) ) return (QStringList() << name() );
+ return codeModel()->getGroupStrings( m_groupId );
+}
+
+ParseResultPointer FileModel::parseResult() const {
+ return m_parseResult;
+}
+
+void FileModel::setParseResult( const ParseResultPointer& result ) {
+ m_parseResult = result;
+}
diff --git a/lib/interfaces/codemodel.h b/lib/interfaces/codemodel.h
new file mode 100644
index 00000000..b8c0c894
--- /dev/null
+++ b/lib/interfaces/codemodel.h
@@ -0,0 +1,1612 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2004 Matt Rogers <mattr@kde.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef CODEMODEL_H
+#define CODEMODEL_H
+
+/**
+@file codemodel.h
+Code Model - a memory symbol store.
+*/
+
+
+#include <qmap.h>
+#include <qstringlist.h>
+#include <ksharedptr.h>
+#include <qvaluevector.h>
+#include "hashedstring.h"
+
+#include <iostream>
+#include <ostream>
+#include <string>
+#include <sstream>
+#include <set>
+
+enum ParsedFileType {
+ CppParsedFile
+};
+
+class AbstractParseResult : public KShared {
+public:
+ virtual void read( QDataStream& stream ) = 0;
+
+ virtual void write( QDataStream& stream ) const = 0;
+
+ virtual ParsedFileType type() const = 0;
+};
+
+typedef KSharedPtr<AbstractParseResult> ParseResultPointer;
+
+using namespace std;
+
+class CodeModel;
+class CodeModelItem;
+class FileModel;
+class NamespaceModel;
+class ClassModel;
+class FunctionModel;
+class FunctionDefinitionModel;
+class VariableModel;
+class ArgumentModel;
+class EnumModel;
+class EnumeratorModel;
+class TypeAliasModel;
+
+/**
+@class ItemDom
+Safe pointer to the @ref CodeModelItem.
+This is a type definition: @code typedef KSharedPtr<CodeModelItem> ItemDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<CodeModelItem> ItemDom;
+
+/**
+@class FileDom
+Safe pointer to the @ref FileModel.
+This is a type definition: @code typedef KSharedPtr<FileModel> FileDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<FileModel> FileDom;
+
+/**
+@class NamespaceDom
+Safe pointer to the @ref NamespaceModel.
+This is a type definition: @code typedef KSharedPtr<NamespaceModel> NamespaceDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<NamespaceModel> NamespaceDom;
+
+/**
+@class ClassDom
+Safe pointer to the @ref ClassModel.
+This is a type definition: @code typedef KSharedPtr<ClassModel> ClassDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<ClassModel> ClassDom;
+
+/**
+@class FunctionDom
+Safe pointer to the @ref FunctionModel.
+This is a type definition: @code typedef KSharedPtr<FunctionModel> FunctionDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<FunctionModel> FunctionDom;
+
+/**
+@class FunctionDefinitionDom
+Safe pointer to the @ref FunctionDefinitionModel.
+This is a type definition: @code typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<FunctionDefinitionModel> FunctionDefinitionDom;
+
+/**
+@class VariableDom
+Safe pointer to the @ref VariableModel.
+This is a type definition: @code typedef KSharedPtr<VariableModel> VariableDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<VariableModel> VariableDom;
+
+/**
+@class ArgumentDom
+Safe pointer to the @ref ArgumentModel.
+This is a type definition: @code typedef KSharedPtr<ArgumentModel> ArgumentDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<ArgumentModel> ArgumentDom;
+
+/**
+@class EnumDom
+Safe pointer to the @ref EnumModel.
+This is a type definition: @code typedef KSharedPtr<EnumModel> EnumDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<EnumModel> EnumDom;
+
+/**
+@class TypeAliasDom
+Safe pointer to the @ref TypeAliasModel.
+This is a type definition: @code typedef KSharedPtr<TypeAliasModel> TypeAliasDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<TypeAliasModel> TypeAliasDom;
+
+/**
+@class EnumeratorDom
+Safe pointer to the @ref EnumeratorModel.
+This is a type definition: @code typedef KSharedPtr<EnumeratorModel> EnumeratorDom; @endcode
+@sa KSharedPtr
+*/
+typedef KSharedPtr<EnumeratorModel> EnumeratorDom;
+
+/**
+@class ItemList
+The list of code model items.
+This is a type definition: @code typedef QValueList<ItemDom> ItemList; @endcode
+@sa QValueList
+*/
+typedef QValueList<ItemDom> ItemList;
+
+/**
+@class FileList
+The list of code model files.
+This is a type definition: @code typedef QValueList<FileDom> FileList; @endcode
+@sa QValueList
+*/
+typedef QValueList<FileDom> FileList;
+
+/**
+@class NamespaceList
+The list of code model namespaces.
+This is a type definition: @code typedef QValueList<NamespaceDom> NamespaceList; @endcode
+@sa QValueList
+*/
+typedef QValueList<NamespaceDom> NamespaceList;
+
+/**
+@class ClassList
+The list of code model classes.
+This is a type definition: @code typedef QValueList<ClassDom> ClassList; @endcode
+@sa QValueList
+*/
+typedef QValueList<ClassDom> ClassList;
+
+/**
+@class FunctionList
+The list of code model functions.
+This is a type definition: @code typedef QValueList<FunctionDom> FunctionList; @endcode
+@sa QValueList
+*/
+typedef QValueList<FunctionDom> FunctionList;
+
+/**
+@class FunctionDefinitionList
+The list of code model function definitions.
+This is a type definition: @code typedef QValueList<FunctionDefinitionDom> FunctionDefinitionList; @endcode
+@sa QValueList
+*/
+
+typedef QValueList<FunctionDefinitionDom> FunctionDefinitionList;
+/**
+@class VariableList
+The list of code model variables.
+This is a type definition: @code typedef QValueList<VariableDom> VariableList; @endcode
+@sa QValueList
+*/
+typedef QValueList<VariableDom> VariableList;
+
+/**
+@class ArgumentList
+The list of code model arguments.
+This is a type definition: @code typedef QValueList<ArgumentDom> ArgumentList; @endcode
+@sa QValueList
+*/
+typedef QValueList<ArgumentDom> ArgumentList;
+
+/**
+@class EnumList
+The list of code model enums.
+This is a type definition: @code typedef QValueList<EnumDom> EnumList; @endcode
+@sa QValueList
+*/
+typedef QValueList<EnumDom> EnumList;
+
+/**
+@class TypeAliasList
+The list of code model type aliases.
+This is a type definition: @code typedef QValueList<TypeAliasDom> TypeAliasList; @endcode
+@sa QValueList
+*/
+typedef QValueList<TypeAliasDom> TypeAliasList;
+
+/**
+@class EnumeratorList
+The list of code model enumerators.
+This is a type definition: @code typedef QValueList<EnumeratorDom> EnumeratorList; @endcode
+@sa QValueList
+*/
+typedef QValueList<EnumeratorDom> EnumeratorList;
+
+/**
+Iterates through @p lst and creates sorted list of code model item names.
+Can be used, for example, to get the list of classes in the store:
+@code
+QStringList classList = sortedNameList(codeModel()->globalNamespace()->classList());
+@endcode
+@param lst The list to iterate.
+@return Sorted list of code model item names.
+*/
+template <class ItemList>
+QStringList sortedNameList( const ItemList& lst )
+{
+ QStringList nameList;
+
+ typename ItemList::ConstIterator it = lst.begin();
+ while( it != lst.end() ){
+ if( !(*it)->name().isEmpty() )
+ nameList << (*it)->name();
+ ++it;
+ }
+
+ nameList.sort();
+ return nameList;
+}
+
+/**
+Casts safe code model pointers (@p KSharedPtr<T> objects like
+FileDom, NamespaceDom, etc.) to the @p Result type.
+
+Example:
+@code
+//ns is of type NamespaceDom
+ClassDom cl = model_cast<ClassDom>(ns);
+@endcode
+@param x Object to cast.
+*/
+template <class Result, class T>
+Result model_cast( KSharedPtr<T> x )
+{
+ Result r( static_cast<T*>(x) );
+ return r;
+}
+
+/**
+Casts code model pointers (objects like
+FileModel, NamespaceModel, etc.) to the @p Result type.
+
+Example:
+@code
+//ns is of type NamespaceModel*
+ClassDom cl = model_cast<ClassDom>(ns);
+@endcode
+@param x Object to cast.
+*/
+template <class Result, class T>
+Result model_cast( T* x )
+{
+ Result r( static_cast<T*>(x) );
+ return r;
+}
+
+
+/**
+Code Model - a memory symbol store.
+Symbol store (aka class store) is a database of symbols
+found in code with the important information about those symbols.
+
+For example, programming language support plugins use symbol store
+to remember information about classes, functions, etc. For each type
+of symbol a certain information can be stored - symbol name, the
+location in source file, etc.
+
+@sa codemodel.h documentation for a list of typedefs and other convenience functions.
+
+@sa codemodel_utils.h documentation for an additional code model utility functions and classes reference.
+*/
+class CodeModel
+{
+public:
+ /**Constructor.*/
+ CodeModel();
+ /**Destructor.*/
+ virtual ~CodeModel();
+
+ /**Creates a code model item. This should be used to create
+ code model items.
+
+ For example, to create a class model somewhere in your plugin, use:
+ @code
+ klass = codeModel()->create<ClassModel>();
+ klass->setName("ClassName");
+ klass->setFileName("FileName");
+ klass->setStartPosition(line, column);
+ @endcode
+ @return Created code model item.*/
+ template <class T> typename T::Ptr create()
+ {
+ typename T::Ptr ptr( new T(this) );
+ return ptr;
+ }
+
+ /**Resets the CodeModel.*/
+ void wipeout();
+
+ /**Gets the list of files in the store.
+ @return The FileList object that contains the list of files.*/
+ FileList fileList();
+
+ /**Gets the list of files in the store.
+ This is a const version for convenience.
+ @return The FileList object that contains the list of files.*/
+ const FileList fileList() const;
+
+ /**Checks to see if a file is in the store.
+ @return true if @p name is in the file list.*/
+ bool hasFile( const QString& name ) const;
+
+ /**Gets the FileDom object for a file.
+ @param name The name of the file to get the FileDom object for.*/
+ FileDom fileByName( const QString& name );
+
+ /**Gets the FileDom object for a file.
+ This is a const version provided for convenience.
+ @param name the name of the file to get the FileDom object for.*/
+ const FileDom fileByName( const QString& name ) const;
+
+ /**Adds a file to the store.
+ @param file The FileDom object to add to the store.
+ @return true if the file was added successfully.*/
+ bool addFile( FileDom file );
+
+ /**Removes a file from the store.
+ @param file the FileDom object to remove from the store.*/
+ void removeFile( FileDom file );
+
+ /**Gets the global namespace
+ @return The NamespaceDom object that represents the global namespace.*/
+ const NamespaceDom globalNamespace() const;
+
+ /**Reads the model from a stream.
+ Use this to save the memory symbol store to a file.
+
+ Language support plugins usually save symbols from projects before the project is
+ closed to avoid reparsing when the project is opened next time.
+ @param stream Stream to read from.
+ @return whether the read succeeded(may fail when the store-format is deprecated).*/
+ virtual void read( QDataStream& stream );
+ /**Writes the model to a stream.
+ Use this to restore the memory symbol store to a file.
+
+ Language support plugins usually save symbols from projects before the project is
+ closed to avoid reparsing when the project is opened next time.
+ @param stream Stream to write to.*/
+ virtual void write( QDataStream& stream ) const;
+
+ /** this will dump the whole tree into dot-file-format so it can be inspected, not ready yet*/
+ virtual void dump( std::ostream& file, QString Info="" );
+
+ /** Merges two groups, by changing the group-ids of the files.
+ Returns the id of the new group, or 0 on fail.
+ @param g1 first group
+ @param g2 second group */
+ int mergeGroups( int g1, int g2 );
+
+ /** Returns all files within the given group
+ it should be preferred calling FileModel::wholeGroup and
+ FileModel::wholeGroupStrings because those return in constant
+ time if they are the only member of the group */
+ FileList getGroup( int gid ) const;
+
+ FileList getGroup( const FileDom& file) const;
+
+ /** Same as above, but returns the names instead of the objects */
+ virtual QStringList getGroupStrings( int gid ) const;
+
+private:
+ /**Adds a namespace to the store.
+ @param target The NamespaceDom object that the namespace will be added to.
+ @param source The NamespaceDom object that contains the namespace to remove.*/
+ void addNamespace( NamespaceDom target, NamespaceDom source );
+
+ /**Removes a namespace from the store.
+ @param target The NamespaceDom object that the namespace will be removed from.
+ @param source The NamespaceDom object that contains the namespace to remove.*/
+ void removeNamespace( NamespaceDom target, NamespaceDom source );
+
+private:
+ QMap<QString, FileDom> m_files;
+ NamespaceDom m_globalNamespace;
+
+ virtual int newGroupId();
+ ///the groups were introduced to represent dependencies between different files.
+ ///Files can have slaves that are owned by other files within the same group.
+ ///While parsing, whole groups should always be parsed/reparsed together.
+ int m_currentGroupId; ///normally, each file has its own group.
+
+private:
+ CodeModel( const CodeModel& source );
+ void operator = ( const CodeModel& source );
+ friend class CodeModelItem;
+ friend class FileModel;
+};
+
+
+/**
+Item in code model (symbol store).
+Item is a symbol in a store. Code model provides several predefined classes
+for predefined item types (files, namespaces, classes, functions and function definitions,
+variables, arguments, enums and enumerators, type aliases.
+
+Instances of this class should be created using @ref CodeModel::create method but usually
+it is better to create instances of derived classes like ClassModel, NamespaceModel, FileModel, etc.
+*/
+class CodeModelItem: public KShared
+{
+public:
+ /**A definition of safe pointer to the code model item.*/
+ typedef ItemDom Ptr;
+
+ /**A type of a code model item.*/
+ enum Kind
+ {
+ File, /**<File.*/
+ Namespace, /**<Namespace.*/
+ Class, /**<Class.*/
+ Function, /**<Function or class method.*/
+ Variable, /**<Variable.*/
+ Argument, /**<Function or method parameter.*/
+ FunctionDefinition, /**<Function definition.*/
+ Enum, /**<Enum.*/
+ Enumerator, /**<Enumerator - a member of an Enum (example: @code enum Type { A, B, C} @endcode
+ Type will be an Enum; A, B and C - Enumerators.*/
+ TypeAlias, /**<Type alias (aka typedef in c++).*/
+
+ Custom = 1000 /**<Custom model items should have type greater than 1000*/
+ };
+
+ /**An access to the code model item.*/
+ enum Access
+ {
+ Public, /**<Public.*/
+ Protected, /**<Protected.*/
+ Private /**<Private.*/
+ };
+ void update( const CodeModelItem* i );
+ bool canUpdate( const CodeModelItem* i ) const;
+
+protected:
+ /**Constructor.
+ @param kind The type, see also @ref CodeModelItem::Kind.
+ @param model Code model which stores this item.*/
+ CodeModelItem( int kind, CodeModel* model );
+
+public:
+ /**Destructor.*/
+ virtual ~CodeModelItem();
+
+ /**@return The type (kind) of item.*/
+ int kind() const { return m_kind; }
+
+ /**Sets the type (kind) of item.
+ @param kind The type, see also @ref CodeModelItem::Kind.*/
+ void setKind( int kind ) { m_kind = kind; }
+
+ /**@return The name of the item.*/
+ QString name() const;
+
+ QString comment() const {
+ return m_comment;
+ }
+
+ void setComment( QString comment ) {
+ m_comment = comment;
+ }
+
+ /**Sets the name of the item.
+ @param name The name.*/
+ void setName( const QString& name );
+
+ /**Gets the file of the item.
+ @return The FileDom object for the item.*/
+ FileDom file();
+
+ /**Gets the file of the item
+ This is a const version provided for convenience.
+ @return The FileDom object for the item.*/
+ const FileDom file() const;
+
+ /**@return The filename of the item.*/
+ QString fileName() const;
+
+ /**Sets the filename of the item.
+ @param fileName The file name.*/
+ void setFileName( const QString& fileName );
+
+ /**Gets the start position of the item.
+ @param line Will be set to the line number of the items start position. Pass 0 if line number is not necessary.
+ @param col Will be set to the column number of the items start position. Pass 0 if column number is not necessary.*/
+ void getStartPosition( int* line, int* col ) const;
+
+ /**Sets the start position of the item.
+ @param line Line number.
+ @param col Column number.*/
+ void setStartPosition( int line, int col );
+
+ /**Get the end position of the item.
+ @param line Will be set to the line number of the items end position. Pass 0 if line number is not necessary.
+ @param col Will be set to the column number of the items end position. Pass 0 if column number is not necessary.*/
+ void getEndPosition( int* line, int* col ) const;
+
+ /**Set the end position of the item.
+ @param line Line number.
+ @param col Column number.*/
+ void setEndPosition( int line, int col );
+
+ /**@return true if an item is a FileModel.*/
+ virtual bool isFile() const { return false; }
+ /**@return true if an item is a NamespaceModel.*/
+ virtual bool isNamespace() const { return false; }
+ /**@return true if an item is a ClassModel.*/
+ virtual bool isClass() const { return false; }
+ /**@return true if an item is a FunctionModel.*/
+ virtual bool isFunction() const { return false; }
+ /**@return true if an item is a FileDefinitionModel.*/
+ virtual bool isFunctionDefinition() const { return false; }
+ /**@return true if an item is a VariableModel.*/
+ virtual bool isVariable() const { return false; }
+ /**@return true if an item is an ArgumentModel.*/
+ virtual bool isArgument() const { return false; }
+ /**@return true if an item is a EnumModel.*/
+ virtual bool isEnum() const { return false; }
+ /**@return true if an item is a EnumeratorModel.*/
+ virtual bool isEnumerator() const { return false; }
+ /**@return true if an item is a TypeAliasModel.*/
+ virtual bool isTypeAlias() const { return false; }
+ /**@return true if an item is a custom item.*/
+ virtual bool isCustom() const { return false; }
+
+ virtual bool isTemplateable() const { return false; }
+
+ /**Reads an item from the stream.
+ @param stream The stream to read from.*/
+ virtual void read( QDataStream& stream );
+ /**Writes an item to the stream.
+ @param stream The stream to write to.*/
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ /**@return The code model for this item.*/
+ CodeModel* codeModel() { return m_model; }
+
+ /**@note This is a const version provided for convenience.
+ @return The code model for this item*/
+ const CodeModel* codeModel() const { return m_model; }
+
+private:
+ int m_kind;
+ CodeModel* m_model;
+ QString m_name;
+ QString m_fileName;
+ QString m_comment; ///not stored yet
+ int m_startLine, m_startColumn;
+ int m_endLine, m_endColumn;
+
+private:
+ CodeModelItem( const CodeModelItem& source );
+ void operator = ( const CodeModelItem& source );
+};
+
+
+
+class TemplateModelItem {
+ public:
+ typedef QPair< QString, QString > ParamPair;
+ typedef QValueVector< ParamPair > ParamMap; ///The first is the name, and the second the default-parameter, or "" if there is none.
+
+ virtual const ParamMap& getTemplateParams() {
+ return m_params;
+ }
+
+ virtual void addTemplateParam( QString name, QString def = "" ) {
+ m_params.push_back( ParamPair( name, def ) );
+ }
+
+ virtual void clearTemplateParams() {
+ m_params.clear();
+ }
+
+ bool hasSpecializationDeclaration() const {
+ return !m_specialization.isEmpty();
+ }
+
+ virtual QString getSpecializationDeclaration() const {
+ return m_specialization;
+ }
+
+ void setSpecializationDeclaration( const QString& str ) {
+ m_specialization = str;
+ }
+
+ ///returns -1 if the parameter does not exist
+ virtual int findTemplateParam( const QString& name ) const {
+ for( unsigned int a = 0; a< m_params.size(); a++)
+ if( m_params[a].first == name ) return a;
+ return -1;
+ }
+
+ const ParamPair getParam( int index ) const {
+ return m_params[index];
+ }
+
+ virtual bool isTemplateable() const { return true; }
+
+ void write( QDataStream & stream ) const {
+ stream << m_specialization;
+ stream << (int)m_params.size();
+ for( ParamMap::const_iterator it = m_params.begin(); it != m_params.end(); ++it ) {
+ stream << (*it).first;
+ stream << (*it).second;
+ }
+ }
+
+ void read( QDataStream & stream ) {
+ int count;
+ stream >> m_specialization;
+ stream >> count;
+ for( int a = 0; a < count; a++ ) {
+ ParamPair tmp;
+ stream >> tmp.first;
+ stream >> tmp.second;
+ m_params.push_back( tmp );
+ }
+ }
+
+ protected:
+ ParamMap m_params;
+ QString m_specialization;
+};
+
+
+
+/**
+Class model.
+Represents a class in the code model.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class ClassModel: public CodeModelItem, public TemplateModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ ClassModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the class model.*/
+ typedef ClassDom Ptr;
+
+ virtual bool isClass() const { return true; }
+
+ /**@return The scope of the class. Scope is a string list composed from names of parent classes and namespaces.*/
+ QStringList scope() const { return m_scope; }
+ /**Sets the scope of this class.
+ @param scope The scope - a list of parent classes and namespaces.*/
+ void setScope( const QStringList& scope ) { m_scope = scope; }
+
+ /**@return The list of base class names.*/
+ QStringList baseClassList() const;
+
+ /**Adds a base class to the list of base classes.
+ @param baseClass The base class name.*/
+ bool addBaseClass( const QString& baseClass );
+
+ /**Removes a base class from the list of base classes.
+ @param baseClass The base class name.*/
+ void removeBaseClass( const QString& baseClass );
+
+ /**@return The list of (sub)classes in this model.*/
+ ClassList classList();
+
+ /**@note This is a const version provided for convenience.
+ @return The list of (sub)classes in this model.*/
+ const ClassList classList() const;
+
+ /**Checks if the class specified by @p name is in this model.
+ @param name The name of a class to look for.
+ @return true if the model has a class.*/
+ bool hasClass( const QString& name ) const;
+
+ /**@param name The name of a class.
+ @return A list of classes that match the name given by @p name.*/
+ ClassList classByName( const QString& name );
+
+ /**@param name The name of a class.
+ @return A list of classes that match the name given by @p name.
+ @note This is a const version provided for convenience.*/
+ const ClassList classByName( const QString& name ) const;
+
+ /**Adds a class to the model.
+ @param klass The class model to add.
+ @return true if addition was successful.*/
+ bool addClass( ClassDom klass );
+
+ /**Removes a class from the model.
+ @param klass The class model to remove.*/
+ void removeClass( ClassDom klass );
+
+ /**@return A list of functions in the model.*/
+ FunctionList functionList();
+
+ /**@return A list of functions in the model.
+ @note This is a const version provided for convenience.*/
+ const FunctionList functionList() const;
+
+ /**Check if the function specified by @p name is in the model.
+ @param name The name of a function to look for.
+ @return true if the model has a class.*/
+ bool hasFunction( const QString& name ) const;
+
+ /**@param name The name of a function to look for.
+ @return A list of functions that match the name given by @p name.*/
+ FunctionList functionByName( const QString& name );
+
+ /**@param name The name of a function to look for.
+ @return A list of functions that match the name given by @p name.
+ @note This is a const version provided for convenience.*/
+ const FunctionList functionByName( const QString& name ) const;
+
+ /**Adds a function to the class model.
+ @param fun The function model to add.
+ @return true if addition was successful.*/
+ bool addFunction( FunctionDom fun );
+
+ /**Removes a function from the class model.
+ @param fun The FunctionDom object to remove from the model.*/
+ void removeFunction( FunctionDom fun );
+
+ /**@return The list of function definitions in the model.*/
+ FunctionDefinitionList functionDefinitionList();
+
+ /**@return The list of function definitions
+ @note This is a const version provided for convenience.*/
+ const FunctionDefinitionList functionDefinitionList() const;
+
+ /**Checks if the function definition specified by \p name is in the model.
+ @param name The name of a function definition to look for.
+ @return true if the function definition was found.*/
+ bool hasFunctionDefinition( const QString& name ) const;
+
+ /**Gets the list of functions that match the name given by \p name.
+ If there are no matches, then the list returned is empty.
+ @param name The name of a function definition to look for.
+ @return The FunctionDefinitionList object containing the definitions that match.*/
+ FunctionDefinitionList functionDefinitionByName( const QString& name );
+
+ /**Gets the list of functions that match the name given by \p name.
+ If there are no matches, then the list returned is empty.
+ @param name The name of a function definition to look for.
+ @return The FunctionDefinitionList object containing the definitions that match.
+ @note This is a const version provided for convenience.*/
+ const FunctionDefinitionList functionDefinitionByName( const QString& name ) const;
+
+ /**Adds a function definition to the model.
+ @param fun The function fefinition model to add to the model.
+ @return true if the addition was successful.*/
+ bool addFunctionDefinition( FunctionDefinitionDom fun );
+
+ /**Removes a function definition from the model.
+ @param fun The function fefinition model to remove from the model.*/
+ void removeFunctionDefinition( FunctionDefinitionDom fun );
+
+ /**@return The list of variables in the model.*/
+ VariableList variableList();
+
+ /**@return The list of variables in the model.
+ @note This is a const version provided for convenience.*/
+ const VariableList variableList() const;
+
+ /**Checks if the variable specified by @p name is in the model.
+ @param name The name of a variable.
+ @return true if the variable was found.*/
+ bool hasVariable( const QString& name ) const;
+
+ /**Gets the variable specified by @p name.
+ If there are no matches, then the VariableDom object returned is empty.
+ @param name The name of a variable.
+ @return A VariableDom object that matches the name specified.*/
+ VariableDom variableByName( const QString& name );
+
+ /**Gets the variable specified by @p name.
+ If there are no matches, then the VariableDom object returned is empty.
+ @param name The name of a variable.
+ @return A VariableDom object that matches the name specified.
+ @note This is a const version provided for convenience.*/
+ const VariableDom variableByName( const QString& name ) const;
+
+ /**Adds a variable to the model.
+ @param var The variable model to add to the model.
+ @return true if the addition was successful.*/
+ bool addVariable( VariableDom var );
+
+ /**Removes a variable from the model.
+ @param var The variable model to remove from the model.*/
+ void removeVariable( VariableDom var );
+
+ /**@return The type alias list for this model.*/
+ TypeAliasList typeAliasList();
+
+ /**@return The type alias list for this model.
+ @note This is a const version provided for convenience.*/
+ const TypeAliasList typeAliasList() const;
+
+ /**Checks if the type alias specified by @p name is in the model.
+ @param name The name of a type alias.
+ @return true if the type alias was found.*/
+ bool hasTypeAlias( const QString& name ) const;
+
+ /**Gets the list of type aliases that match @p name.
+ If there are no matches, the TypeAliasList object is empty.
+ @param name The name of a type alias.
+ @return A TypeAliasList object that contains the matches.*/
+ TypeAliasList typeAliasByName( const QString& name );
+
+ /**Gets the list of type aliases that match @p name.
+ If there are no matches, the TypeAliasList object is empty.
+ @param name The name of a type alias.
+ @return A TypeAliasList object that contains the matches.
+ @note This is a const version provided for convenience.*/
+ const TypeAliasList typeAliasByName( const QString& name ) const;
+
+ /**Adds a type alias to the model.
+ @param typeAlias The type alias model to add to the model.
+ @return true if the addition was successful.*/
+ bool addTypeAlias( TypeAliasDom typeAlias );
+
+ /**Removes a type alias from the model.
+ @param typeAlias The TypeAliasDom object to remove from the model.*/
+ void removeTypeAlias( TypeAliasDom typeAlias );
+
+ /**@return The list of enums in the model.*/
+ EnumList enumList();
+
+ /**@return The list of enums in the model.
+ @note This is a const version provided for convenience.*/
+ const EnumList enumList() const;
+
+ /**Checks if the enum specified by @p name is in the model.
+ @param name The name of an enum.
+ @return true if the enum was found.*/
+ bool hasEnum( const QString& name ) const;
+
+ /**Gets the enum specified by @p name.
+ The EnumDom object returned will be empty if no match is found.
+ @param name The name of an enum.
+ @return The EnumDom object that contains the match.*/
+ EnumDom enumByName( const QString& name );
+
+ /**Gets the enum specified by @p name.
+ The EnumDom object returned will be empty if no match is found.
+ @param name The name of an enum.
+ @return The EnumDom object that contains the match.*/
+ const EnumDom enumByName( const QString& name ) const;
+
+ /**Adds an enum to the model.
+ @param e The enum model to add to the model.
+ @return true if the addition was successful.*/
+ bool addEnum( EnumDom e );
+
+ /**Removes an enum from the model.
+ @param e The enum model to remove from the model.*/
+ void removeEnum( EnumDom e );
+
+ void update( const ClassModel* i );
+ bool canUpdate( const ClassModel* i ) const;
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+private:
+ QStringList m_scope;
+ QStringList m_baseClassList;
+ QMap<QString, ClassList> m_classes;
+ QMap<QString, FunctionList> m_functions;
+ QMap<QString, FunctionDefinitionList> m_functionDefinitions;
+ QMap<QString, VariableDom> m_variables;
+ QMap<QString, TypeAliasList> m_typeAliases;
+ QMap<QString, EnumDom> m_enumerators;
+
+private:
+ ClassModel( const ClassModel& source );
+ void operator = ( const ClassModel& source );
+ friend class CodeModel;
+};
+
+class NamespaceAliasModel {
+public:
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ QString name() const {
+ return m_name;
+ }
+
+ void setName( const QString& name ) {
+ m_name = name;
+ }
+
+ void setAliasName( const QString& theValue ) {
+ m_aliasName = theValue;
+ }
+
+ QString aliasName() const {
+ return m_aliasName;
+ }
+
+ void setFileName( const HashedString& theValue ) {
+ m_fileName = theValue;
+ }
+
+ HashedString fileName() const {
+ return m_fileName;
+ }
+
+ bool operator < ( const NamespaceAliasModel& rhs ) const {
+ if( m_name < rhs.m_name ) return true;
+ if( m_name == rhs.m_name ) {
+ if( m_aliasName < rhs.m_aliasName ) return true;
+ if( m_aliasName == rhs.m_aliasName && m_fileName < rhs.m_fileName ) return true;
+ }
+ return false;
+ }
+
+ bool operator == ( const NamespaceAliasModel& rhs ) const {
+ return m_name == rhs.m_name && m_aliasName == rhs.m_aliasName && m_fileName == rhs.m_fileName;
+ }
+
+private:
+ QString m_name;
+ QString m_aliasName;
+ HashedString m_fileName;
+};
+
+class NamespaceImportModel {
+public:
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ QString name() const {
+ return m_name;
+ }
+
+ HashedString fileName() const {
+ return m_fileName;
+ }
+
+ void setName( const QString& name ) {
+ m_name = name;
+ }
+
+ void setFileName( const HashedString& file ) {
+ m_fileName = file;
+ }
+
+ bool operator < ( const NamespaceImportModel& rhs ) const {
+ if( m_name < rhs.m_name ) return true;
+ if( m_name == rhs.m_name )
+ if( m_fileName < rhs.m_fileName ) return true;
+
+ return false;
+ }
+
+ bool operator == ( const NamespaceImportModel& rhs ) const {
+ return m_name == rhs.m_name && m_fileName == rhs.m_fileName;
+ }
+
+private:
+ QString m_name;
+ HashedString m_fileName;
+};
+
+/**
+Namespace model.
+Represents a namespace in the code model.
+Namespace model can represent either usual c++ namespaces
+and packages or modules from other languages.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class NamespaceModel: public ClassModel
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ NamespaceModel( CodeModel* model );
+
+public:
+ typedef std::set<NamespaceAliasModel> NamespaceAliasModelList; ///I'm using std-sets here, because Qt-3 has no appropriate replacement
+ typedef std::set<NamespaceImportModel> NamespaceImportModelList;
+
+ /**A definition of safe pointer to the namespace model.*/
+ typedef NamespaceDom Ptr;
+
+ virtual bool isClass() const { return false; }
+ virtual bool isNamespace() const { return true; }
+
+ /**@return The list of namespaces in this model.*/
+ NamespaceList namespaceList();
+
+ /**@return The list of namespaces in this model.
+ @note This is a const version provided for convenience.*/
+ const NamespaceList namespaceList() const;
+
+ /**Checks if the namespace referenced by @p name is in the model.
+ @param name The name of a namespace.
+ @return true if the namespace was found.*/
+ bool hasNamespace( const QString& name ) const;
+
+ /**Gets the namespace specified by @p name.
+ If there are no matches, then the NamespaceDom object returned is empty.
+ @param name The name of a namespace.
+ @return The NamespaceDom object that contains the match.*/
+ NamespaceDom namespaceByName( const QString& name );
+
+ /**Gets the namespace specified by @p name.
+ If there are no matches, then the NamespaceDom object returned is empty.
+ @param name The name of a namespace.
+ @return The NamespaceDom object that contains the match.
+ @note This is a const version provided for convenience.*/
+ const NamespaceDom namespaceByName( const QString& name ) const;
+
+ /**Adds a namespace to the model.
+ @param ns The namespace model to add to the model.
+ @return true if addition was successful.*/
+ bool addNamespace( NamespaceDom ns );
+
+ /**Removes the namespace from the model.
+ @param ns The namespace model to remove from the model.*/
+ void removeNamespace( NamespaceDom ns );
+
+ /**Updates this model so it has the same content as the other one. Only the line/column is updated. canUpdate(..) must be tested before.
+ * @param ns the namespace to match
+ */
+ void update( const NamespaceModel* ns );
+ bool canUpdate( const NamespaceModel* ns ) const;
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ void addNamespaceImport( const NamespaceImportModel& import );
+ void addNamespaceAlias( const NamespaceAliasModel& alias );
+ void removeNamespaceImport( const NamespaceImportModel& import );
+ void removeNamespaceAlias( const NamespaceAliasModel& alias );
+
+ ///Must not be called on temporary objects because a reference is returned(for performance-reasons)
+ const NamespaceAliasModelList& namespaceAliases() const {
+ return m_namespaceAliases;
+ }
+
+ ///Must not be called on temporary objects because a reference is returned(for performance-reasons)
+ const NamespaceImportModelList& namespaceImports() const {
+ return m_namespaceImports;
+ }
+private:
+ QMap<QString, NamespaceDom> m_namespaces;
+ NamespaceAliasModelList m_namespaceAliases;
+ NamespaceImportModelList m_namespaceImports;
+
+private:
+
+ NamespaceModel( const NamespaceModel& source );
+ void operator = ( const NamespaceModel& source );
+ friend class CodeModel;
+};
+
+
+
+
+/**
+File model.
+Represents a file in the code model.
+Files in general contain classes, namespaces, functions,
+types, etc. Therefore FileModel is derived from NamespaceModel.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class FileModel: public NamespaceModel
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ FileModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the file model.*/
+ typedef FileDom Ptr;
+
+ virtual bool isFile() const { return true; }
+
+ virtual int groupId() const {
+ return m_groupId;
+ }
+
+ virtual void setGroupId(int newId) {
+ m_groupId = newId;
+ }
+
+ /** This function additionally does version-checking and
+ should be used instead of read when read should be called
+ from outside.
+ @return whether the read was successful */
+
+ virtual void write( QDataStream& stream ) const;
+
+ FileList wholeGroup() ;
+
+ QStringList wholeGroupStrings() const;
+
+ virtual void read( QDataStream& stream );
+
+ ParseResultPointer parseResult() const;
+ void setParseResult( const ParseResultPointer& result );
+
+ void update( const FileModel* i );
+private:
+ int m_groupId;
+ ParseResultPointer m_parseResult;
+ FileModel( const FileModel& );
+ void operator = ( const FileModel& );
+ friend class CodeModel;
+};
+
+
+/**
+Function (procedure) argument model.
+Represents an argument in the function.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class ArgumentModel: public CodeModelItem
+{
+protected:
+ ArgumentModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the argument model.*/
+ typedef ArgumentDom Ptr;
+
+ virtual bool isArgument() const { return true; }
+
+ /**@return The type of this argument.*/
+ QString type() const;
+
+ /**Sets the type of this argument.
+ @param type The type to set.*/
+ void setType( const QString& type );
+
+ /**@return The default value of this argument.*/
+ QString defaultValue() const;
+
+ /**Sets the default value of this argument.
+ @param defaultValue The default value to set.*/
+ void setDefaultValue( const QString& defaultValue );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+private:
+ QString m_type;
+ QString m_defaultValue;
+
+private:
+ ArgumentModel( const ArgumentModel& source );
+ void operator = ( const ArgumentModel& source );
+ friend class CodeModel;
+};
+
+
+/**
+Function model.
+Represents:
+- functions;
+- procedures;
+- class methods;
+.
+In languages that have separate function declarations and definitions (c++)
+this represents only function declarations. @see FunctionDefinitionModel
+for a model of function definitions.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class FunctionModel: public CodeModelItem, public TemplateModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ FunctionModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the function model.*/
+ typedef FunctionDom Ptr;
+
+ virtual bool isFunction() const { return true; }
+
+ /**@return The scope of the function. Scope is a string list composed
+ from names of parent functions, classes and namespaces.*/
+ QStringList scope() const { return m_scope; }
+
+ /**Sets the scope of the function.
+ @param scope The scope to set.*/
+ void setScope( const QStringList& scope ) { m_scope = scope; }
+
+ /**@return The access level of the function. Can return either values of type @ref CodeModelItem::Access or
+ other integers if the function has other access level (for example pascal methods can have "published"
+ access level).*/
+ int access() const;
+
+ /**Sets the access level of the function.
+ @param access The access level.*/
+ void setAccess( int access );
+
+ /**@return true if the function is a signal.*/
+ bool isSignal() const;
+ /**Sets the function to be a signal.
+ @param isSignal The signal flag.*/
+ void setSignal( bool isSignal );
+
+ /**@return true if the function is a slot.*/
+ bool isSlot() const;
+ /**Sets the function to be a slot.
+ @param isSlot The slot flag.*/
+ void setSlot( bool isSlot );
+
+ /**@return true if the function is a virtual function.*/
+ bool isVirtual() const;
+ /**Sets the function to be a virtual function.
+ @param isVirtual The virtual flag.*/
+ void setVirtual( bool isVirtual );
+
+ /**@return true if the function is a static function.*/
+ bool isStatic() const;
+ /**Sets the function to be a static function.
+ @param isStatic The static flag.*/
+ void setStatic( bool isStatic );
+
+ /**@return true if the function is an inline function.*/
+ bool isInline() const;
+ /**Sets the function to be an inline function.
+ @param isInline The inline flag.*/
+ void setInline( bool isInline );
+
+ /**@return true if the function is a constant function.*/
+ bool isConstant() const;
+ /**Sets the function to be a constant function.
+ @param isConstant The constant flag.*/
+ void setConstant( bool isConstant );
+
+ /**@return true if the function is an abstract function.*/
+ bool isAbstract() const;
+ /**Sets the function to be an inline function.
+ @param isAbstract The abstract flag.*/
+ void setAbstract( bool isAbstract );
+
+ /**@return The result type of a function.*/
+ QString resultType() const;
+ /**Sets the result type of a function.
+ @param type The type of a function result.*/
+ void setResultType( const QString& type );
+
+ /**Gets the list of arguments being passed to the function.
+ If there are no arguments, then the list is empty.
+ @return The ArgumentList object that contains the arguments for this function.*/
+ ArgumentList argumentList();
+
+ /**Gets the list of arguments being passed to the function.
+ If there are no arguments, then the list is empty.
+ @return The ArgumentList object that contains the arguments for this function.
+ @note This is a const version provided for convenience.*/
+ const ArgumentList argumentList() const;
+
+ /**Adds an argument to the function.
+ @param arg The argument model to add as an argument to the function.
+ @return true if the addition was successful.*/
+ bool addArgument( ArgumentDom arg );
+
+ /**Removes an argument from the function.
+ @param arg The argument model to remove from the function.*/
+ void removeArgument( ArgumentDom arg );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ void update( const FunctionModel* i );
+ bool canUpdate( const FunctionModel* i ) const;
+
+private:
+ QStringList m_scope;
+ int m_access;
+
+ union {
+ struct {
+ int m_signal : 1;
+ int m_slot : 1;
+ int m_virtual : 1;
+ int m_static : 1;
+ int m_inline : 1;
+ int m_constant : 1;
+ int m_abstract : 1;
+ } v;
+ int flags;
+ } d;
+
+ QString m_resultType;
+ ArgumentList m_arguments;
+
+private:
+ FunctionModel( const FunctionModel& source );
+ void operator = ( const FunctionModel& source );
+ friend class CodeModel;
+};
+
+/**
+Function model.
+Represents function definition for languages that have such.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class FunctionDefinitionModel: public FunctionModel
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ FunctionDefinitionModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the function definition model.*/
+ typedef FunctionDefinitionDom Ptr;
+
+ virtual bool isFunctionDefinition() const { return true; }
+
+private:
+ FunctionDefinitionModel( const FunctionDefinitionModel& source );
+ void operator = ( const FunctionDefinitionModel& source );
+ friend class CodeModel;
+};
+
+
+/**
+Variable model.
+Represents variables and class attributes.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class VariableModel: public CodeModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ VariableModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the variable model.*/
+ typedef VariableDom Ptr;
+
+ virtual bool isVariable() const { return true; }
+
+ /**@return The access level of the variable. Can return either values of type @ref CodeModelItem::Access or
+ other integers if the variable has other access level (for example pascal attributes can have "published"
+ access level).*/
+ int access() const;
+ /**Sets the access level of the variable.
+ @param access The access level.*/
+ void setAccess( int access );
+
+ /**@return true if the variable is a static variable.*/
+ bool isStatic() const;
+ /**Sets the variable to be a static variable.
+ @param isStatic The static flag.*/
+ void setStatic( bool isStatic );
+
+ /**@return A type of the variable.*/
+ QString type() const;
+ /**Sets the type of the variable.
+ @param type The type name.*/
+ void setType( const QString& type );
+
+ /**@return If this is an enumerator, the enum it is part of, else an empty string. This is just a hack, necessary because EnumeratorModel is not used at all by the cpp-code-model. */
+ bool isEnumeratorVariable() const;
+
+ void setEnumeratorVariable( bool b );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ void update( const VariableModel* i );
+ bool canUpdate( const VariableModel* i ) const;
+
+private:
+ int m_access;
+ int m_static;
+ QString m_type;
+ int m_isEnumeratorVariable;
+
+private:
+ VariableModel( const VariableModel& source );
+ void operator = ( const VariableModel& source );
+ friend class CodeModel;
+};
+
+
+/**
+Enum model.
+Represents enums.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class EnumModel: public CodeModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ EnumModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the enum model.*/
+ typedef EnumDom Ptr;
+
+ virtual bool isEnum() const { return true; }
+
+ /**@return The access level of the enum. Can return either values
+ of type @ref CodeModelItem::Access or other integers if the enum has other access level.*/
+ int access() const;
+ /**Sets the access level of the enum.
+ @param access The access level.*/
+ void setAccess( int access );
+
+ /**@return The list of enumerators in this enum.*/
+ EnumeratorList enumeratorList();
+ /**@return The list of enumerators in this enum.
+ @note This is a const version provided for convenience.*/
+ const EnumeratorList enumeratorList() const;
+ /**Adds an enumerator to the model.
+ @param e The enumerator model to add.*/
+ void addEnumerator( EnumeratorDom e );
+ /**Removes an enumerator from the model.
+ @param e The enumerator model to remove.*/
+ void removeEnumerator( EnumeratorDom e );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ ///The dump-function is not ready yet
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ void update( const EnumModel* i );
+ bool canUpdate( const EnumModel* i ) const;
+
+private:
+ int m_access;
+ QMap<QString, EnumeratorDom> m_enumerators;
+
+private:
+ EnumModel( const EnumModel& source );
+ void operator = ( const EnumModel& source );
+ friend class CodeModel;
+};
+
+
+/**
+Enumerator model.
+Represents enumerators. Enums consist of enumerators, for example in code:
+@code
+enum Type { A, B, C};
+@endcode
+Type is represented as EnumModel;\n
+A, B, C are represented with EnumeratorModel.
+
+Instances of this class should be created using @ref CodeModel::create method.
+*/
+class EnumeratorModel: public CodeModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ EnumeratorModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the enumerator model.*/
+ typedef EnumeratorDom Ptr;
+
+ virtual bool isEnumerator() const { return true; }
+
+ /**@return The value of an enumerator.*/
+ QString value() const;
+ /**Sets the value of an enumerator.
+ @param value The value.*/
+ void setValue( const QString& value );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+private:
+ QString m_value;
+
+private:
+ EnumeratorModel( const EnumeratorModel& source );
+ void operator = ( const EnumeratorModel& source );
+ friend class CodeModel;
+};
+
+
+/**
+Type alias model.
+Represents type aliases (like subtypes/derived types in Ada and typedefs in c++).
+*/
+class TypeAliasModel: public CodeModelItem
+{
+protected:
+ /**Constructor.
+ @param model Code model which stores this item.*/
+ TypeAliasModel( CodeModel* model );
+
+public:
+ /**A definition of safe pointer to the type alias model.*/
+ typedef TypeAliasDom Ptr;
+
+ virtual bool isTypeAlias() const { return true; }
+
+ /**@return The actual type of an alias.*/
+ QString type() const;
+ /**Sets the type of an alias.
+ @param type The type name.*/
+ void setType( const QString& type );
+
+ virtual void read( QDataStream& stream );
+ virtual void write( QDataStream& stream ) const;
+
+
+ virtual void dump( std::ostream& file, bool recurse=false, QString Info="" );
+
+ void update( const TypeAliasModel* i );
+ bool canUpdate( const TypeAliasModel* i ) const;
+
+private:
+ QString m_type;
+
+private:
+ TypeAliasModel( const TypeAliasModel& source );
+ void operator = ( const TypeAliasModel& source );
+ friend class CodeModel;
+};
+
+#endif
diff --git a/lib/interfaces/codemodel_treeparser.cpp b/lib/interfaces/codemodel_treeparser.cpp
new file mode 100644
index 00000000..b514a90e
--- /dev/null
+++ b/lib/interfaces/codemodel_treeparser.cpp
@@ -0,0 +1,108 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "codemodel.h"
+#include "codemodel_treeparser.h"
+
+CodeModelTreeParser::CodeModelTreeParser( )
+{
+}
+
+CodeModelTreeParser::~CodeModelTreeParser( )
+{
+}
+
+void CodeModelTreeParser::parseCode( const CodeModel * model )
+{
+ const FileList fileList = model->fileList();
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ parseFile( *it );
+}
+
+void CodeModelTreeParser::parseFile( const FileModel * file )
+{
+ const NamespaceList namespaceList = file->namespaceList();
+ const ClassList classList = file->classList();
+ const FunctionList functionList = file->functionList();
+ const FunctionDefinitionList functionDefinitionList = file->functionDefinitionList();
+ const VariableList variableList = file->variableList();
+
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ parseNamespace( *it );
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseNamespace( const NamespaceModel * ns )
+{
+ const NamespaceList namespaceList = ns->namespaceList();
+ const ClassList classList = ns->classList();
+ const FunctionList functionList = ns->functionList();
+ const FunctionDefinitionList functionDefinitionList = ns->functionDefinitionList();
+ const VariableList variableList = ns->variableList();
+
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ parseNamespace( *it );
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseClass( const ClassModel * klass )
+{
+ const ClassList classList = klass->classList();
+ const FunctionList functionList = klass->functionList();
+ const FunctionDefinitionList functionDefinitionList = klass->functionDefinitionList();
+ const VariableList variableList = klass->variableList();
+
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ parseClass( *it );
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ parseFunction( *it );
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ parseFunctionDefinition( *it );
+ for( VariableList::ConstIterator it=variableList.begin(); it!=variableList.end(); ++it )
+ parseVariable( *it );
+}
+
+void CodeModelTreeParser::parseFunction( const FunctionModel * /*fun*/ )
+{
+}
+
+void CodeModelTreeParser::parseFunctionDefinition( const FunctionDefinitionModel * /*fun*/ )
+{
+}
+
+void CodeModelTreeParser::parseVariable( const VariableModel * /*var*/ )
+{
+}
+
+
+
diff --git a/lib/interfaces/codemodel_treeparser.h b/lib/interfaces/codemodel_treeparser.h
new file mode 100644
index 00000000..9271ae64
--- /dev/null
+++ b/lib/interfaces/codemodel_treeparser.h
@@ -0,0 +1,85 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef CODEMODEL_TREEPARSER_H
+#define CODEMODEL_TREEPARSER_H
+
+/**
+@file codemodel_treeparser.h
+Tree parser for a code model.
+*/
+
+class FileModel;
+class NamespaceModel;
+class ClassModel;
+class FunctionModel;
+class FunctionDefinitionModel;
+class VariableModel;
+
+/**
+Tree parser for a code model.
+This is a base class which can be subclassed to create a code model "tree parser".
+Such tree parsers can be used to recursively walk through the whole code model
+or its parts and do some actions.
+
+Default implementation only walks through the model and does nothing. You need
+to reimplement necessary virtual methods of this class to add desired functionality.
+*/
+class CodeModelTreeParser
+{
+public:
+ /**Constructor.*/
+ CodeModelTreeParser();
+ /**Destructor.*/
+ virtual ~CodeModelTreeParser();
+
+ /**Parses recursively all code in the @p model.
+ @param model CodeModel to parse.*/
+ virtual void parseCode(const CodeModel* model);
+
+ /**Parses recursively all code in the @p file.
+ @param file FileModel to parse.*/
+ virtual void parseFile(const FileModel* file);
+
+ /**Parses recursively all code in the namespace @p ns.
+ @param ns NamespaceModel to parse.*/
+ virtual void parseNamespace(const NamespaceModel* ns);
+
+ /**Parses recursively all code in the class @p klass.
+ @param klass ClassModel to parse.*/
+ virtual void parseClass(const ClassModel* klass);
+
+ /**Parses function (function declaration) @p fun.
+ @param fun FunctionModel to parse.*/
+ virtual void parseFunction(const FunctionModel* fun);
+
+ /**Parses function definition @p fun.
+ @param fun FunctionDefinitionModel to parse.*/
+ virtual void parseFunctionDefinition(const FunctionDefinitionModel* fun);
+
+ /**Parses variable @p var.
+ @param var VariableModel to parse.*/
+ virtual void parseVariable(const VariableModel* var);
+
+private:
+ CodeModelTreeParser( const CodeModelTreeParser& source );
+ void operator = ( const CodeModelTreeParser& source );
+};
+
+#endif
diff --git a/lib/interfaces/codemodel_utils.cpp b/lib/interfaces/codemodel_utils.cpp
new file mode 100644
index 00000000..68211f34
--- /dev/null
+++ b/lib/interfaces/codemodel_utils.cpp
@@ -0,0 +1,747 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Alexander Dymo <adymo@kdevelop.org>
+ Copyright (C) 2004 Jonas Jacobi <j.jacobi@gmx.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "codemodel_utils.h"
+
+namespace CodeModelUtils
+{
+
+namespace Functions
+{
+
+void processClasses(FunctionList &list, const ClassDom dom)
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ }
+}
+
+void processNamespaces(FunctionList &list, const NamespaceDom dom)
+{
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list, *it);
+ }
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ }
+}
+
+void processNamespaces( FunctionList & list, const NamespaceDom dom, QMap< FunctionDom, Scope > & relations )
+{
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list, *it, relations);
+ }
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations, dom);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].ns = dom;
+ }
+}
+
+void processClasses( FunctionList & list, const ClassDom dom, QMap< FunctionDom, Scope > & relations )
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].klass = dom;
+ }
+}
+
+void processClasses( FunctionList & list, const ClassDom dom, QMap< FunctionDom, Scope > & relations, const NamespaceDom & nsdom )
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations, nsdom);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].klass = dom;
+ relations[*it].ns = nsdom;
+ }
+}
+
+} // end of Functions namespace
+
+
+
+namespace FunctionDefinitions
+{
+
+void processClasses(FunctionDefinitionList &list, const ClassDom dom)
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ }
+}
+
+void processNamespaces(FunctionDefinitionList &list, const NamespaceDom dom)
+{
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list, *it);
+ }
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ }
+}
+
+void processNamespaces( FunctionDefinitionList & list, const NamespaceDom dom, QMap< FunctionDefinitionDom, Scope > & relations )
+{
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list, *it, relations);
+ }
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations, dom);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].ns = dom;
+ }
+}
+
+void processClasses( FunctionDefinitionList & list, const ClassDom dom, QMap< FunctionDefinitionDom, Scope > & relations )
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].klass = dom;
+ }
+}
+
+void processClasses( FunctionDefinitionList & list, const ClassDom dom, QMap< FunctionDefinitionDom, Scope > & relations, const NamespaceDom & nsdom )
+{
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it, relations, nsdom);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ relations[*it].klass = dom;
+ relations[*it].ns = nsdom;
+ }
+}
+
+} // end of FunctionDefinitions namespace
+
+
+
+FunctionList allFunctions(const FileDom &dom)
+{
+ using namespace Functions;
+ FunctionList list;
+
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list, *it);
+ }
+
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list, *it);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.append(*it);
+ }
+
+ return list;
+}
+
+AllFunctions allFunctionsDetailed( const FileDom & dom )
+{
+ using namespace Functions;
+ AllFunctions list;
+
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list.functionList, *it, list.relations);
+ }
+
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list.functionList, *it, list.relations);
+ }
+
+ const FunctionList fnlist = dom->functionList();
+ for (FunctionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.functionList.append(*it);
+ }
+
+ return list;
+}
+
+AllFunctionDefinitions allFunctionDefinitionsDetailed( const FileDom & dom )
+{
+ using namespace FunctionDefinitions;
+ AllFunctionDefinitions list;
+
+ const NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::ConstIterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ processNamespaces(list.functionList, *it, list.relations);
+ }
+
+ const ClassList cllist = dom->classList();
+ for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it)
+ {
+ processClasses(list.functionList, *it, list.relations);
+ }
+
+ const FunctionDefinitionList fnlist = dom->functionDefinitionList();
+ for (FunctionDefinitionList::ConstIterator it = fnlist.begin(); it != fnlist.end(); ++it)
+ {
+ list.functionList.append(*it);
+ }
+
+ return list;
+}
+
+
+bool resultTypesFit( const FunctionDom & dec, const FunctionDefinitionDom & def ) {
+ if( !def->resultType().contains("::") ) return dec->resultType() == def->resultType();
+ QStringList l1 = dec->scope() + QStringList::split("::", dec->resultType() );
+ QStringList l2 = QStringList::split("::", def->resultType() );
+
+ if( l1.isEmpty() || l2.isEmpty() || l1.back() != l2.back() ) return false;
+
+ while( !l1.isEmpty() && !l2.isEmpty() ) {
+ if( l1.back() == l2.back() ) {
+ l1.pop_back();
+ l2.pop_back();
+ } else {
+ l1.pop_back();
+ }
+ }
+
+ if( l2.isEmpty() ) return true;
+
+ return false;
+}
+
+
+bool compareDeclarationToDefinition( const FunctionDom & dec, const FunctionDefinitionDom & def )
+{
+ if (dec->scope() == def->scope() && dec->name() == def->name() && resultTypesFit( dec, def ) && dec->isConstant() == def->isConstant())
+ {
+ const ArgumentList defList = def->argumentList(), decList = dec->argumentList();
+ if (defList.size() != decList.size())
+ return false;
+
+ size_t n = defList.size();
+ for(size_t i = 0; i < n; ++i)
+ if (defList[i]->type() != decList[i]->type())
+ return false;
+
+ return true;
+ }
+ return false;
+}
+
+
+bool compareDeclarationToDefinition( const FunctionDom & dec, const FunctionDefinitionDom & def, const std::set<NamespaceImportModel> & nsImports )
+{
+ if (dec->name() == def->name() && resultTypesFit( dec, def ) && dec->isConstant() == def->isConstant())
+ {
+ const ArgumentList defList = def->argumentList(), decList = dec->argumentList();
+ if (defList.size() != decList.size())
+ return false;
+
+ size_t n = defList.size();
+ for(size_t i = 0; i < n; ++i)
+ if (defList[i]->type() != decList[i]->type())
+ return false;
+
+ const QStringList &defScope = def->scope(), &decScope = dec->scope();
+ if (defScope != decScope)
+ {
+ if (defScope.size() >= decScope.size())
+ return false;
+
+ n = decScope.size();
+ for(size_t i1 = 0, i2 = 0; i1 < n; ++i1)
+ {
+ if (i2 >= defScope.size() || decScope[i1] != defScope[i2])
+ {
+ NamespaceImportModel model;
+ model.setName(decScope[i1]);
+ model.setFileName(def->fileName());
+ if (nsImports.find(model) == nsImports.end())
+ return false;
+ }
+ else
+ {
+ ++i2;
+ }
+ }
+ }
+
+ return true;
+ }
+ return false;
+}
+
+
+
+FunctionList allFunctionsExhaustive(FileDom &dom) {
+ PredAmOwner<FunctionDom> ow( dom );
+ FunctionList ret;
+
+ findFunctionDeclarations( ow, dom->wholeGroup(), ret );
+
+ return ret;
+}
+
+
+FunctionDefinitionList allFunctionDefinitionsExhaustive(FileDom &dom) {
+ PredAmOwner<FunctionDefinitionDom> ow( dom );
+ FunctionDefinitionList ret;
+
+ findFunctionDefinitions( ow, dom->wholeGroup(), ret );
+
+ return ret;
+}
+
+
+
+ClassDom findClassByPosition( NamespaceModel* nameSpace, int line, int col )
+{
+ if (nameSpace == 0)
+ return 0;
+
+ NamespaceList nsList = nameSpace->namespaceList();
+ for (NamespaceList::iterator i = nsList.begin(); i != nsList.end(); ++i)
+ {
+ ClassDom result = findClassByPosition(*i, line, col);
+ if (result != 0)
+ return result;
+ }
+
+ ClassList classes = nameSpace->classList();
+ for(ClassList::iterator i = classes.begin(); i != classes.end(); ++i)
+ {
+ ClassDom result = findClassByPosition( *i, line, col );
+ if (result != 0)
+ return result;
+ }
+
+ return 0;
+}
+
+ClassDom findClassByPosition( ClassModel* aClass, int line, int col )
+{
+ if (aClass == 0)
+ return 0;
+
+ ClassList classes = aClass->classList();
+ for(ClassList::iterator i = classes.begin(); i != classes.end(); ++i)
+ {
+ ClassDom result = findClassByPosition( *i, line, col );
+ if (result != 0)
+ return result;
+ }
+
+ int startLine, startCol;
+ aClass->getStartPosition(&startLine, &startCol);
+
+ if (startLine <= line)
+ {
+ int endLine, endCol;
+ aClass->getEndPosition(&endLine, &endCol);
+ if (endLine >= line)
+ return (aClass);
+ }
+
+ return 0;
+}
+
+int findLastMethodLine( ClassDom aClass, CodeModelItem::Access access )
+{
+ int point = -1;
+
+ const FunctionList functionList = aClass->functionList();
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ {
+ int funEndLine, funEndColumn;
+ (*it)->getEndPosition( &funEndLine, &funEndColumn );
+
+ if ((*it)->access() == access && point < funEndLine)
+ point = funEndLine;
+ }
+
+ return point;
+}
+
+int findLastVariableLine( ClassDom aClass, CodeModelItem::Access access )
+{
+ int point = -1;
+
+ const VariableList varList = aClass->variableList();
+ for( VariableList::ConstIterator it= varList.begin(); it!= varList.end(); ++it )
+ {
+ int varEndLine, varEndColumn;
+ (*it)->getEndPosition( &varEndLine, &varEndColumn );
+
+ if ((*it)->access() == access && point < varEndLine)
+ point = varEndLine;
+ }
+
+ return point;
+}
+
+QString accessSpecifierToString( CodeModelItem::Access access )
+{
+ switch(access)
+ {
+ case CodeModelItem::Public: return "public";
+ case CodeModelItem::Protected: return "protected";
+ case CodeModelItem::Private: return "private";
+ default: return "unknown";
+ }
+}
+
+FunctionDefinitionDom CodeModelHelper::functionDefinitionAt(NamespaceDom ns, int line, int column)
+{
+ NamespaceList namespaceList = ns->namespaceList();
+ NamespaceList::iterator nslEnd = namespaceList.end();
+
+ for (NamespaceList::iterator it=namespaceList.begin(); it!=nslEnd; ++it)
+ {
+ if (FunctionDefinitionDom def = functionDefinitionAt(*it, line, column))
+ return def;
+ }
+
+ ClassList classList = ns->classList();
+ ClassList::iterator clEnd = classList.end();
+
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (FunctionDefinitionDom def = functionDefinitionAt(*it, line, column))
+ return def;
+ }
+
+ FunctionDefinitionList functionDefinitionList = ns->functionDefinitionList();
+ FunctionDefinitionList::iterator fdlEnd = functionDefinitionList.end();
+
+ for (FunctionDefinitionList::iterator it=functionDefinitionList.begin();
+ it!=fdlEnd; ++it )
+ {
+ if (FunctionDefinitionDom def = functionDefinitionAt(*it, line, column))
+ return def;
+ }
+
+ return FunctionDefinitionDom();
+}
+
+FunctionDefinitionDom CodeModelHelper::functionDefinitionAt(ClassDom klass, int line, int column)
+{
+ ClassList classList = klass->classList();
+ ClassList::iterator clEnd = classList.end();
+
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (FunctionDefinitionDom def = functionDefinitionAt(*it, line, column))
+ return def;
+ }
+
+ FunctionDefinitionList functionDefinitionList = klass->functionDefinitionList();
+ FunctionDefinitionList::iterator fdlEnd = functionDefinitionList.end();
+ for (FunctionDefinitionList::Iterator it=functionDefinitionList.begin();
+ it!=fdlEnd; ++it)
+ {
+ if (FunctionDefinitionDom def = functionDefinitionAt(*it, line, column))
+ return def;
+ }
+
+ return FunctionDefinitionDom();
+}
+
+FunctionDefinitionDom CodeModelHelper::functionDefinitionAt(FunctionDefinitionDom fun, int line, int // column
+ )
+{
+ int startLine, startColumn;
+ int endLine, endColumn;
+
+ fun->getStartPosition(&startLine, &startColumn);
+ fun->getEndPosition(&endLine, &endColumn);
+
+ if (!(line >= startLine && line <= endLine) || fun->fileName() != m_fileName )
+ return FunctionDefinitionDom();
+
+ /*
+ if (line == startLine && column < startColumn)
+ return FunctionDefinitionDom();
+
+ if (line == endLine && column > endColumn)
+ return FunctionDefinitionDom();*/
+
+ return fun;
+}
+
+
+
+FunctionDom CodeModelHelper::functionDeclarationAt(NamespaceDom ns, int line, int column)
+{
+ NamespaceList namespaceList = ns->namespaceList();
+ NamespaceList::iterator nsEnd = namespaceList.end();
+ for (NamespaceList::iterator it=namespaceList.begin(); it!=nsEnd; ++it)
+ {
+ if (FunctionDom def = functionDeclarationAt(*it, line, column))
+ return def;
+ }
+
+ ClassList classList = ns->classList();
+ ClassList::iterator clEnd = classList.end();
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (FunctionDom def = functionDeclarationAt(*it, line, column))
+ return def;
+ }
+
+ FunctionList functionList = ns->functionList();
+ FunctionList::iterator flEnd = functionList.end();
+ for (FunctionList::iterator it=functionList.begin();
+ it!=flEnd; ++it )
+ {
+ if (FunctionDom def = functionDeclarationAt(*it, line, column))
+ return def;
+ }
+
+ return FunctionDom();
+}
+
+FunctionDom CodeModelHelper::functionDeclarationAt(ClassDom klass, int line, int column)
+{
+ ClassList classList = klass->classList();
+ ClassList::iterator clEnd = classList.end();
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (FunctionDom def = functionDeclarationAt(*it, line, column))
+ return def;
+ }
+
+ FunctionList functionList = klass->functionList();
+ FunctionList::iterator flEnd = functionList.end();
+ for (FunctionList::Iterator it=functionList.begin();
+ it!=flEnd; ++it)
+ {
+ if (FunctionDom def = functionDeclarationAt(*it, line, column))
+ return def;
+ }
+
+ return FunctionDom();
+}
+
+FunctionDom CodeModelHelper::functionDeclarationAt(FunctionDom fun, int line, int // column
+ )
+{
+ int startLine, startColumn;
+ int endLine, endColumn;
+
+ fun->getStartPosition(&startLine, &startColumn);
+ fun->getEndPosition(&endLine, &endColumn);
+
+ if (!(line >= startLine && line <= endLine) || fun->fileName() != m_fileName )
+ return FunctionDom();
+
+
+ /* if (line == startLine && column < startColumn)
+ return FunctionDom();
+
+ if (line == endLine && column > endColumn)
+ return FunctionDom();*/
+
+ return fun;
+}
+
+
+
+
+ClassDom CodeModelHelper::classAt(NamespaceDom ns, int line, int column)
+{
+ NamespaceList namespaceList = ns->namespaceList();
+ NamespaceList::iterator nsEnd = namespaceList.end();
+
+ for (NamespaceList::iterator it=namespaceList.begin(); it!=nsEnd; ++it)
+ {
+ if (ClassDom def = classAt(*it, line, column))
+ return def;
+ }
+
+ ClassList classList = ns->classList();
+ ClassList::iterator clEnd = classList.end();
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (ClassDom def = classAt(*it, line, column))
+ return def;
+ }
+
+ return ClassDom();
+}
+
+ClassDom CodeModelHelper::classAt(ClassDom klass, int line, int column)
+{
+ ClassList classList = klass->classList();
+ ClassList::iterator clEnd = classList.end();
+ for (ClassList::iterator it=classList.begin(); it!=clEnd; ++it)
+ {
+ if (ClassDom def = classAt(*it, line, column))
+ return def;
+ }
+
+ int startLine, startColumn;
+ int endLine, endColumn;
+
+ klass->getStartPosition(&startLine, &startColumn);
+ klass->getEndPosition(&endLine, &endColumn);
+
+ if (!(line >= startLine && line <= endLine) || klass->fileName() != m_fileName )
+ return ClassDom();
+
+ return klass;
+}
+
+
+CodeModelHelper::CodeModelHelper( CodeModel* model, FileDom file ) : m_model( model ) {
+ if( !file ) return;
+ m_files = file->wholeGroup();
+ m_fileName = file->name();
+}
+
+
+FunctionDom CodeModelHelper::functionAt( int line, int column, FunctionTypes types ) {
+ if( m_files.isEmpty() ) return FunctionDom();
+
+
+ FunctionDom ret;
+ FileList::iterator it = m_files.begin();
+ while( it != m_files.end() ) {
+ if( types & Declaration ) {
+ ret = functionDeclarationAt(model_cast<NamespaceDom>(*it), line, column);
+ if(ret) return ret;
+ }
+ if( types & Definition ) {
+ FunctionDefinitionDom r = functionDefinitionAt(model_cast<NamespaceDom>(*it), line, column);
+ if(r) {
+ ret = model_cast<FunctionDom>( r );
+ return ret;
+ }
+ }
+ ++it;
+ }
+
+ return ret;
+}
+
+ClassDom CodeModelHelper::classAt( int line, int column ) {
+ if( m_files.isEmpty() ) return ClassDom();
+
+ ClassDom ret;
+ FileList::iterator it = m_files.begin();
+ while( it != m_files.end() ) {
+ ret = classAt( model_cast<NamespaceDom>(*it), line, column );
+ if(ret) return ret;
+ ++it;
+ }
+
+ return ret;
+}
+
+}//end of namespace CodeModeUtils
diff --git a/lib/interfaces/codemodel_utils.h b/lib/interfaces/codemodel_utils.h
new file mode 100644
index 00000000..dc970366
--- /dev/null
+++ b/lib/interfaces/codemodel_utils.h
@@ -0,0 +1,570 @@
+/* This file is part of KDevelop
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.org>
+ Copyright (C) 2004 Jonas Jacobi<j.jacobi@gmx.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef CODEMODEL_UTILS_H
+#define CODEMODEL_UTILS_H
+
+#include "codemodel.h"
+
+/**
+@file codemodel_utils.h
+Utility functions and classes for the CodeModel.
+*/
+
+/**
+@class Pred
+The predicate.
+Pred is not a real class, it is only a template parameter used in @ref CodeModelUtils functions.
+
+<b>How to create the predicate:</b>@n
+Predicate is simply a class that have
+@code bool operator() (predicateArgument) @endcode.
+The return value of that operator is the result of a predicate.
+
+For example we want to find all function definitions with a particular name.
+We can use @ref CodeModelUtils::findFunctionDefinitions functions that require
+you to write a predicate for function definition DOM's.
+This can be done with following code:
+@code
+class MyPred{
+public:
+ MyPred(const QString &name): m_name(name) {}
+
+ bool operator() (const FunctionDefinitionDom &def) const
+ {
+ return def->name() == m_name;
+ }
+
+private:
+ QString m_name;
+};
+@endcode
+*/
+
+
+/**Namespace which contains utility functions and classes for the CodeModel.*/
+namespace CodeModelUtils
+{
+
+/**Finds function definitions which match given predicate in files.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param fileList The list of files to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const FileList& fileList, FunctionDefinitionList & lst );
+
+/**Finds function definitions which match given predicate in the namespace.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param ns The namespace to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const NamespaceDom& ns, FunctionDefinitionList & lst );
+
+/**Finds function definitions which match given predicate in namespaces.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param namespaceList The list of namespaces to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const NamespaceList& namespaceList, FunctionDefinitionList & lst );
+
+/**Finds function definitions which match given predicate in classes.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param classList The list of classes to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const ClassList& classList, FunctionDefinitionList & lst );
+
+/**Finds function definitions which match given predicate in the list of function definitions.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param functionDefinitionList The list of function definitions to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const FunctionDefinitionList& functionDefinitionList, FunctionDefinitionList & lst );
+
+/**Finds function definitions which match given predicate in the class.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param klass The class to find function definitions in.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const ClassDom& klass, FunctionDefinitionList & lst );
+
+/**Applies a predicate to a function definition.
+
+Predicate can be considered as a condition. If it is true then the function definition is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function definition before it is returned.
+@param fun The function definition.
+@param lst The reference to a list of function definitions. Will be filled by this function.*/
+template <class Pred> void findFunctionDefinitions( Pred pred, const FunctionDefinitionDom& fun, FunctionDefinitionList & lst );
+
+/**Finds function declarations which match given predicate in files.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param fileList The list of files to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const FileList& fileList, FunctionList & lst );
+
+/**Finds function declarations which match given predicate in the namespace.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param ns The namespace to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const NamespaceDom& ns, FunctionList & lst );
+
+/**Finds function declarations which match given predicate in namespaces.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param namespaceList The list of namespaces to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const NamespaceList& namespaceList, FunctionList & lst );
+
+/**Finds function declarations which match given predicate in classes.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param classList The list of classes to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const ClassList& classList, FunctionList & lst );
+
+/**Finds function declarations which match given predicate in the list of function declarations.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param functionList The list of function declarations to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const FunctionList& functionList, FunctionList & lst );
+
+/**Finds function declarations which match given predicate in the class.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param klass The class to find function declarations in.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const ClassDom& klass, FunctionList & lst );
+
+/**Applies a predicate to a function declaration.
+
+Predicate can be considered as a condition. If it is true then the function declaration is
+added to the result list otherwise it is skipped.
+@see Pred class documentation for a detailed description on how to create and use predicates.
+
+@param pred Predicate which is applied to a function declaration before it is returned.
+@param fun The function declaration.
+@param lst The reference to a list of function declarations. Will be filled by this function.*/
+template <class Pred> void findFunctionDeclarations( Pred pred, const FunctionDom& fun, FunctionList & lst );
+
+
+//implementations of function templates defined above:
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const FileList& fileList, FunctionDefinitionList & lst )
+{
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ findFunctionDefinitions( pred, model_cast<NamespaceDom>(*it), lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const NamespaceDom& ns, FunctionDefinitionList & lst )
+{
+ findFunctionDefinitions( pred, ns->namespaceList(), lst );
+ findFunctionDefinitions( pred, ns->classList(), lst );
+ findFunctionDefinitions( pred, ns->functionDefinitionList(), lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const NamespaceList& namespaceList, FunctionDefinitionList & lst )
+{
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ findFunctionDefinitions( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const ClassList& classList, FunctionDefinitionList & lst )
+{
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ findFunctionDefinitions( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const FunctionDefinitionList& functionDefinitionList, FunctionDefinitionList & lst )
+{
+ for( FunctionDefinitionList::ConstIterator it=functionDefinitionList.begin(); it!=functionDefinitionList.end(); ++it )
+ findFunctionDefinitions( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const ClassDom& klass, FunctionDefinitionList & lst )
+{
+ findFunctionDefinitions( pred, klass->classList(), lst );
+ findFunctionDefinitions( pred, klass->functionDefinitionList(), lst );
+}
+
+template <class Pred>
+void findFunctionDefinitions( Pred pred, const FunctionDefinitionDom& fun, FunctionDefinitionList & lst )
+{
+ if( pred(fun) )
+ lst << fun;
+}
+
+
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const FileList& fileList, FunctionList & lst )
+{
+ for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ findFunctionDeclarations( pred, model_cast<NamespaceDom>(*it), lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const NamespaceDom& ns, FunctionList & lst )
+{
+ findFunctionDeclarations( pred, ns->namespaceList(), lst );
+ findFunctionDeclarations( pred, ns->classList(), lst );
+ findFunctionDeclarations( pred, ns->functionList(), lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const NamespaceList& namespaceList, FunctionList & lst )
+{
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ findFunctionDeclarations( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const ClassList& classList, FunctionList & lst )
+{
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ findFunctionDeclarations( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const FunctionList& functionList, FunctionList & lst )
+{
+ for( FunctionList::ConstIterator it=functionList.begin(); it!=functionList.end(); ++it )
+ findFunctionDeclarations( pred, *it, lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const ClassDom& klass, FunctionList & lst )
+{
+ findFunctionDeclarations( pred, klass->classList(), lst );
+ findFunctionDeclarations( pred, klass->functionList(), lst );
+}
+
+template <class Pred>
+void findFunctionDeclarations( Pred pred, const FunctionDom& fun, FunctionList & lst )
+{
+ if( pred(fun) )
+ lst << fun;
+}
+
+/**A scope.*/
+struct Scope{
+ /**Class.*/
+ ClassDom klass;
+ /**Namespace.*/
+ NamespaceDom ns;
+};
+
+/**Information about functions.*/
+struct AllFunctions{
+ /**Scope of functions.*/
+ QMap<FunctionDom, Scope> relations;
+ /**List of functions.*/
+ FunctionList functionList;
+};
+/**Information about function definitions.*/
+struct AllFunctionDefinitions{
+ /**Scope of function definitions.*/
+ QMap<FunctionDefinitionDom, Scope> relations;
+ /**List of function definitions.*/
+ FunctionDefinitionList functionList;
+};
+
+/**Namespace with utilities to find functions in the @ref CodeModel.*/
+namespace Functions{
+/**Looks for functions in the class.
+@param list The list of functions found by this routine.
+@param dom The class to look for functions.*/
+void processClasses(FunctionList &list, const ClassDom dom);
+
+/**Looks for functions in the namespace.
+@param list The list of functions found by this routine.
+@param dom The namespace to look for functions.*/
+void processNamespaces(FunctionList &list, const NamespaceDom dom);
+
+/**Looks for functions in the class and also saves their scope.
+@param list The list of functions found by this routine.
+@param dom The class to look for functions.
+@param relations The scope information.*/
+void processClasses(FunctionList &list, const ClassDom dom, QMap<FunctionDom, Scope> &relations);
+
+/**Looks for functions in the class and also saves their scope.
+Used for classes withing a namespace.
+@param list The list of functions found by this routine.
+@param dom The class to look for functions.
+@param relations The scope information.
+@param nsdom The namespace which contains a class.*/
+void processClasses(FunctionList &list, const ClassDom dom, QMap<FunctionDom, Scope> &relations, const NamespaceDom &nsdom);
+
+/**Looks for functions in the namespace and also saves their scope.
+@param list The list of functions found by this routine.
+@param dom The namespace to look for functions.
+@param relations The scope information.*/
+void processNamespaces(FunctionList &list, const NamespaceDom dom, QMap<FunctionDom, Scope> &relations);
+}
+
+/**Namespace with utilities to find function definitions in the @ref CodeModel.*/
+namespace FunctionDefinitions{
+/**Looks for function definitions in the class.
+@param list The list of function definitions found by this routine.
+@param dom The class to look for function definitions.*/
+void processClasses(FunctionDefinitionList &list, const ClassDom dom);
+
+/**Looks for function definitions in the namespace.
+@param list The list of function definitions found by this routine.
+@param dom The namespace to look for function definitions.*/
+void processNamespaces(FunctionDefinitionList &list, const NamespaceDom dom);
+
+/**Looks for function definitions in the class and also saves their scope.
+@param list The list of function definitions found by this routine.
+@param dom The class to look for function definitions.
+@param relations The scope information.*/
+void processClasses(FunctionDefinitionList &list, const ClassDom dom, QMap<FunctionDefinitionDom, Scope> &relations);
+
+/**Looks for function definitions in the class and also saves their scope.
+Used for classes withing a namespace.
+@param list The list of function definitions found by this routine.
+@param dom The class to look for function definitions .
+@param relations The scope information.
+@param nsdom The namespace which contains a class.*/
+void processClasses(FunctionDefinitionList &list, const ClassDom dom, QMap<FunctionDefinitionDom, Scope> &relations, const NamespaceDom &nsdom);
+
+/**Looks for function definitions in the namespace and also saves their scope.
+@param list The list of function definitions found by this routine.
+@param dom The namespace to look for function definitions.
+@param relations The scope information.*/
+void processNamespaces(FunctionDefinitionList &list, const NamespaceDom dom, QMap<FunctionDefinitionDom, Scope> &relations);
+}
+
+/**
+ * Compares a declaration and a defintion of a function.
+ * @param dec declaration
+ * @param def definition
+ * @return true, if dec is the declaration of the function definition def, false otherwise
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+bool compareDeclarationToDefinition(const FunctionDom& dec, const FunctionDefinitionDom& def);
+
+/**
+ * Compares a declaration and a defintion of a function.
+ * @param dec declaration
+ * @param def definition
+ * @param nsImports namespace imports for the namespace the definition appears in
+ * @return true, if dec is the declaration of the function definition def, false otherwise
+ */
+bool compareDeclarationToDefinition(const FunctionDom& dec, const FunctionDefinitionDom& def, const std::set<NamespaceImportModel>& nsImports);
+
+/**
+ * Predicate for use with findFunctionDefintions. Searches for a defintion matching a declaration.
+ * @sa Pred documentation to learn more about predicates used with code model.
+ * @author Jonas Jacobi
+ */
+class PredDefinitionMatchesDeclaration{
+public:
+ PredDefinitionMatchesDeclaration(const FunctionDom& func) : m_declaration(func){};
+ bool operator() (const FunctionDefinitionDom& def) const
+ {
+ return compareDeclarationToDefinition(m_declaration, def);
+ }
+
+private:
+ const FunctionDom m_declaration;
+};
+
+template <class InputDomType>
+class PredAmOwner{
+ public:
+ PredAmOwner(const FileDom& file) : m_file(file){};
+ bool operator() (const InputDomType& def) const
+ {
+ return def->file() == m_file;
+ }
+
+ private:
+ const FileDom m_file;
+};
+
+/**@return A list of all functions in the file.
+@param dom File Dom to look for functions in.*/
+FunctionList allFunctions(const FileDom &dom);
+/**@return A detailed list of all functions in the file (detailed list contains
+the information about a scope of each FunctionDom found).
+@param dom File Dom to look for functions in.*/
+AllFunctions allFunctionsDetailed(const FileDom &dom);
+/**@return A detailed list of all function definitions in the file (detailed list contains
+the information about a scope of each FunctionDefinitionDom found).
+@param dom File Dom to look for functions in.*/
+AllFunctionDefinitions allFunctionDefinitionsDetailed(const FileDom &dom);
+
+/**@return A list of all functions in the file.
+This version searches the file's whole group for
+functions that may have been inserted into the other file's
+structure.
+Unlike the methods above, this guarantees that all returned
+functions physically belong to that file.
+@param dom File Dom to look for functions in. */
+FunctionList allFunctionsExhaustive(FileDom &dom);
+
+/**@return A list of all function-definitions in the file.
+This version searches the file's whole group for
+functions that may have been inserted into the other file's
+structure.
+Unlike the methods above, this guarantees that all returned
+functions physically belong to that file.
+@param dom File Dom to look for functions in. */
+FunctionDefinitionList allFunctionDefinitionsExhaustive(FileDom &dom);
+
+/**
+ * Finds a class by its position in a file(position inside the part of the file, where the class is declared).
+ * In the case of nested classes the innermost class which is declared at/around the provided position.
+ * @param nameSpace A namespace to search for the class.
+ * @param line A linenumber inside the class declaration.
+ * @param col The colum of line.
+ * @return The innermost class, which is declared at/around position defined with line / col, or 0 if no class is found.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+ClassDom findClassByPosition( NamespaceModel* nameSpace, int line, int col );
+
+/**
+ * Same as above, just searches inside a class instead of a namespace.
+ */
+ClassDom findClassByPosition( ClassModel* aClass, int line, int col );
+
+/**
+ * Finds the last occurrence (line of file wise) of a method inside a class declaration with specific access specificer.
+ * This can be used e.g. to find a position to new methods to the class.
+ * @param aClass class to search for method.
+ * @param access the access specifier with which methods are searched for.
+ * @return The last line a Method with access specifier access is found,
+ * or -1 if no method with that access specifier was found.
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+int findLastMethodLine( ClassDom aClass, CodeModelItem::Access access );
+
+/**
+ * Same as above, but finds a membervariable instead of a method.
+ */
+int findLastVariableLine( ClassDom aClass, CodeModelItem::Access access );
+
+/**
+ * Get the string representation of an accesss pecifier
+ * @param access An access specifier to get a string representation of.
+ * @return string The representation of an access (e.g. "public").
+ * @author Jonas Jacobi <j.jacobi@gmx.de>
+ */
+QString accessSpecifierToString( CodeModelItem::Access access );
+
+
+class CodeModelHelper {
+ private:
+ CodeModel* m_model;
+ FileList m_files;
+ QString m_fileName;
+
+ FunctionDefinitionDom functionDefinitionAt(NamespaceDom ns, int line, int column);
+
+ FunctionDefinitionDom functionDefinitionAt(ClassDom klass, int line, int column);
+
+ FunctionDefinitionDom functionDefinitionAt(FunctionDefinitionDom fun, int line, int );
+
+ FunctionDom functionDeclarationAt(NamespaceDom ns, int line, int column);
+
+ FunctionDom functionDeclarationAt(ClassDom klass, int line, int column);
+
+ FunctionDom functionDeclarationAt(FunctionDom fun, int line, int column );
+
+
+ ClassDom classAt(NamespaceDom ns, int line, int column);
+
+ ClassDom classAt(ClassDom klass, int line, int column);
+
+ public:
+ CodeModelHelper( CodeModel* model, FileDom file );
+
+ enum FunctionTypes {
+ Declaration = 1,
+ Definition = 2
+ };
+
+ FunctionDom functionAt( int line, int column, FunctionTypes types = (FunctionTypes)3 );
+ ClassDom classAt( int line, int column );
+};
+
+}
+
+#endif
diff --git a/lib/interfaces/extensions/Mainpage.dox b/lib/interfaces/extensions/Mainpage.dox
new file mode 100644
index 00000000..d306a1e8
--- /dev/null
+++ b/lib/interfaces/extensions/Mainpage.dox
@@ -0,0 +1,61 @@
+/**
+@mainpage The KDevelop Extension Interfaces Library
+
+This library contains extension interfaces used by KDevelop plugin architecture.
+
+<b>Link with</b>: -lkdevelop
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/interfaces/extensions
+
+\section whatisextension What is the KDevelop extension
+
+Extension is a KDevelop plugin which implements one of extension interfaces.
+Extension is usually not important enough to be returned by @ref KDevApi and @ref KDevPlugin
+methods. Therefore extension instance can be obtained by @ref KDevPlugin::extension method.
+
+Note: extension plugins can be either core, global and project plugins. They are loaded
+in the same way other plugins are. But extensions differ from usual plugins.
+
+Note: many plugins implementing extension interface can be created but only one of
+those should be loaded at a time. This can be accomplished by:
+- using a shell plugin profile (as done in current generic shell implementation) - define
+ different X-KDevelop-Properties for different extension implementations;
+- writing project manager which looks into the project file and loads the neccesary extension.
+
+\section creatingextension Creating and using an extension
+- Define a service, use following .desktop file:
+ @code
+ [Desktop Entry]
+ Encoding=UTF-8
+ Type=ServiceType
+ X-KDE-ServiceType=KDevelop/MyExtension
+ X-KDE-Derived=KDevelop/Plugin
+ Name=My Extension Interface
+ [PropertyDef::X-KDevelop-Version]
+ Type=int
+ @endcode
+- Define an abstract base class for an extension like:
+ @code
+ class KDevMyExtension: public KDevPlugin {
+ public:
+ KDevMyExtension(const KDevPluginInfo *info, QObject* parent, const char* name)
+ :KDevPlugin(info, parent, name) {}
+
+ virtual void doSomething() = 0;
+ };
+ @endcode
+- Create an usual plugin, but instead of setting service type to "KDevelop/Plugin", set:
+ @code
+ ServiceTypes=KDevelop/MyExtension
+ @endcode
+- Use your extension:
+ @code
+ KDevMyExtension *myext = extension<KDevMyExtension>("KDevelop/MyExtension");
+ if (sf) {
+ // do something
+ } else {
+ // fail
+ }
+ @endcode
+*/
+
diff --git a/lib/interfaces/extensions/Makefile.am b/lib/interfaces/extensions/Makefile.am
new file mode 100644
index 00000000..4bc069cb
--- /dev/null
+++ b/lib/interfaces/extensions/Makefile.am
@@ -0,0 +1,23 @@
+kdevelopincludeextdir = $(includedir)/kdevelop/interfaces/extensions
+kdevelopincludeext_HEADERS = codebrowserfrontend.h kdevappfrontend.h \
+ kdevcreatefile.h kdevdifffrontend.h kdevmakefrontend.h kdevquickopen.h \
+ kdevsourceformatter.h kdevversioncontrol.h
+
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = kdevelopappfrontend.desktop \
+ kdevelopcodebrowserfrontend.desktop kdevelopcreatefile.desktop kdevelopdifffrontend.desktop \
+ kdevelopmakefrontend.desktop kdevelopquickopen.desktop kdevelopsourceformatter.desktop \
+ kdevelopversioncontrol.desktop
+
+SUBDIRS = dcop
+libkdevextensions_la_LDFLAGS = $(all_libraries)
+noinst_LTLIBRARIES = libkdevextensions.la
+libkdevextensions_la_SOURCES = kdevappfrontend.cpp kdevmakefrontend.cpp
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Extension Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../../Doxyfile.am
+noinst_HEADERS = codebrowserfrontend.h
diff --git a/lib/interfaces/extensions/codebrowserfrontend.h b/lib/interfaces/extensions/codebrowserfrontend.h
new file mode 100644
index 00000000..57852ac8
--- /dev/null
+++ b/lib/interfaces/extensions/codebrowserfrontend.h
@@ -0,0 +1,40 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 David Nolden <david.nolden.kdevelop@art-master.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef CODEBROWSERRONTEND_H
+#define CODEBROWSERRONTEND_H
+
+
+#include <kdevplugin.h>
+#include <codemodel.h>
+
+namespace Extensions {
+
+class KDevCodeBrowserFrontend : public KDevPlugin {
+ Q_OBJECT
+
+ public:
+ KDevCodeBrowserFrontend(const KDevPluginInfo *info, QObject *parent=0, const char *name=0 )
+ :KDevPlugin(info, parent, name ? name : "CodeBrowserFrontend") {}
+
+ ///Used by the quickopen-plugin to notify extensions that it jumped to a searched item
+ virtual bool jumpedToItem( ItemDom item ) = 0;
+};
+}
+
+#endif
diff --git a/lib/interfaces/extensions/dcop/KDevAppFrontendIface.cpp b/lib/interfaces/extensions/dcop/KDevAppFrontendIface.cpp
new file mode 100644
index 00000000..8bf5b7ce
--- /dev/null
+++ b/lib/interfaces/extensions/dcop/KDevAppFrontendIface.cpp
@@ -0,0 +1,76 @@
+
+
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "KDevAppFrontendIface.h"
+#include "kdevappfrontend.h"
+
+
+KDevAppFrontendIface::KDevAppFrontendIface(KDevAppFrontend *appFrontend)
+ : DCOPObject("KDevAppFrontend"), m_appFrontend(appFrontend)
+{
+}
+
+
+KDevAppFrontendIface::~KDevAppFrontendIface()
+{}
+
+
+void KDevAppFrontendIface::startAppCommand(const QString &directory, const QString &command, bool inTerminal)
+{
+ m_appFrontend->startAppCommand(directory, command, inTerminal);
+}
+
+void KDevAppFrontendIface::stopApplication( )
+{
+ m_appFrontend->stopApplication();
+}
+
+bool KDevAppFrontendIface::isRunning( )
+{
+ return m_appFrontend->isRunning();
+}
+
+void KDevAppFrontendIface::clearView( )
+{
+ m_appFrontend->clearView();
+}
+
+void KDevAppFrontendIface::insertStderrLine( const QCString & line )
+{
+ m_appFrontend->insertStderrLine(line);
+}
+
+void KDevAppFrontendIface::insertStdoutLine( const QCString & line )
+{
+ m_appFrontend->insertStdoutLine(line);
+}
+
+void KDevAppFrontendIface::addPartialStderrLine( const QCString& line )
+{
+ m_appFrontend->addPartialStderrLine(line);
+}
+
+void KDevAppFrontendIface::addPartialStdoutLine( const QCString& line )
+{
+ m_appFrontend->addPartialStdoutLine(line);
+}
diff --git a/lib/interfaces/extensions/dcop/KDevAppFrontendIface.h b/lib/interfaces/extensions/dcop/KDevAppFrontendIface.h
new file mode 100644
index 00000000..e54e25b0
--- /dev/null
+++ b/lib/interfaces/extensions/dcop/KDevAppFrontendIface.h
@@ -0,0 +1,52 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef _KDEVAPPFRONTENDIFACE_H_
+#define _KDEVAPPFRONTENDIFACE_H_
+
+#include <dcopobject.h>
+
+class KDevAppFrontend;
+
+class KDevAppFrontendIface : public DCOPObject
+{
+ K_DCOP
+
+public:
+
+ KDevAppFrontendIface( KDevAppFrontend *appFrontend );
+ ~KDevAppFrontendIface();
+
+k_dcop:
+ void startAppCommand(const QString &directory, const QString &command, bool inTerminal);
+ void stopApplication();
+ bool isRunning();
+ void clearView();
+ void insertStderrLine(const QCString &line);
+ void insertStdoutLine(const QCString &line);
+ void addPartialStderrLine(const QCString &line);
+ void addPartialStdoutLine(const QCString &line);
+
+private:
+ KDevAppFrontend *m_appFrontend;
+};
+
+#endif
diff --git a/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.cpp b/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.cpp
new file mode 100644
index 00000000..2050a970
--- /dev/null
+++ b/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.cpp
@@ -0,0 +1,46 @@
+
+
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "KDevMakeFrontendIface.h"
+#include "kdevmakefrontend.h"
+
+
+KDevMakeFrontendIface::KDevMakeFrontendIface(KDevMakeFrontend *makeFrontend)
+ : DCOPObject("KDevMakeFrontend")
+{
+ m_makeFrontend = makeFrontend;
+}
+
+
+KDevMakeFrontendIface::~KDevMakeFrontendIface()
+{}
+
+
+void KDevMakeFrontendIface::queueCommand(const QString &dir, const QString &command)
+{
+ m_makeFrontend->queueCommand(dir, command);
+}
+
+bool KDevMakeFrontendIface::isRunning( )
+{
+ return m_makeFrontend->isRunning();
+}
diff --git a/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.h b/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.h
new file mode 100644
index 00000000..89ecdf5e
--- /dev/null
+++ b/lib/interfaces/extensions/dcop/KDevMakeFrontendIface.h
@@ -0,0 +1,45 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef _KDEVMAKEFRONTENDIFACE_H_
+#define _KDEVMAKEFRONTENDIFACE_H_
+
+#include <dcopobject.h>
+
+class KDevMakeFrontend;
+
+class KDevMakeFrontendIface : public DCOPObject
+{
+ K_DCOP
+
+public:
+
+ KDevMakeFrontendIface( KDevMakeFrontend *makeFrontend );
+ ~KDevMakeFrontendIface();
+
+k_dcop:
+ void queueCommand(const QString &dir, const QString &command);
+ bool isRunning();
+
+private:
+ KDevMakeFrontend *m_makeFrontend;
+};
+
+#endif
diff --git a/lib/interfaces/extensions/dcop/Makefile.am b/lib/interfaces/extensions/dcop/Makefile.am
new file mode 100644
index 00000000..0b904eeb
--- /dev/null
+++ b/lib/interfaces/extensions/dcop/Makefile.am
@@ -0,0 +1,10 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions $(all_includes)
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libkdevdcopextensions.la
+libkdevdcopextensions_la_LDFLAGS = $(all_libraries)
+libkdevdcopextensions_la_SOURCES = KDevAppFrontendIface.cpp \
+ KDevMakeFrontendIface.cpp KDevAppFrontendIface.skel KDevMakeFrontendIface.skel
+
+dcopincludeextdir = $(includedir)/kdevelop/interfaces/extensions/dcop
+dcopincludeext_HEADERS = KDevAppFrontendIface.h KDevMakeFrontendIface.h
diff --git a/lib/interfaces/extensions/kdevappfrontend.cpp b/lib/interfaces/extensions/kdevappfrontend.cpp
new file mode 100644
index 00000000..3d918fe2
--- /dev/null
+++ b/lib/interfaces/extensions/kdevappfrontend.cpp
@@ -0,0 +1,2 @@
+#include "kdevappfrontend.h"
+#include "kdevappfrontend.moc"
diff --git a/lib/interfaces/extensions/kdevappfrontend.h b/lib/interfaces/extensions/kdevappfrontend.h
new file mode 100644
index 00000000..65424ed9
--- /dev/null
+++ b/lib/interfaces/extensions/kdevappfrontend.h
@@ -0,0 +1,115 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVAPPFRONTEND_H
+#define KDEVAPPFRONTEND_H
+
+#include <qstringlist.h>
+#include <kdevplugin.h>
+
+/**
+@file kdevappfrontend.h
+Application frontend interface.
+*/
+
+/**
+Application frontend interface.
+This interface is responsible for handling the running of an application in KDevelop.
+Currently, this interface defines ways to do the following:
+- check if the application is running;
+- execute the application;
+- stop the currently running application;
+- control the output view as seen in the 'Application' tool dock.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevAppFrontend *apf = extension<KDevAppFrontend>("KDevelop/AppFrontend");
+if (apf) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa KDevPlugin::extension method documentation.
+*/
+class KDevAppFrontend : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevAppFrontend(const KDevPluginInfo *info, QObject *parent=0, const char *name=0 )
+ :KDevPlugin(info, parent, name ? name : "KDevAppFrontend") {}
+
+ /**@return Whether the application is currently running.*/
+ virtual bool isRunning() = 0;
+
+public slots:
+ /**
+ * The component shall start to execute an app-like command.
+ * Running the application is always asynchronous.
+ * @param directory The working directory to start the app in,
+ * if empty then the user's home directory is used.
+ * @param program A program to start.
+ * @param inTerminal If true then the program is started in an external konsole.
+ */
+ virtual void startAppCommand(const QString &directory, const QString &program, bool inTerminal) = 0;
+
+ /**
+ * Stops the currently running application.
+ */
+ virtual void stopApplication() = 0;
+
+ /**
+ * Inserts a string into the application output view.
+ * @param line A string to insert.
+ */
+ virtual void insertStdoutLine(const QCString &line) = 0;
+
+ /**
+ * Inserts a string into the application output view marked as stderr output
+ * (usually colored).
+ * @param line An error string to insert.
+ */
+ virtual void insertStderrLine(const QCString &line) = 0;
+
+ virtual void addPartialStderrLine( const QCString& line ) = 0;
+ virtual void addPartialStdoutLine( const QCString& line ) = 0;
+
+ /**
+ * Clears the output view.
+ */
+ virtual void clearView() = 0;
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevcreatefile.h b/lib/interfaces/extensions/kdevcreatefile.h
new file mode 100644
index 00000000..b142cd4d
--- /dev/null
+++ b/lib/interfaces/extensions/kdevcreatefile.h
@@ -0,0 +1,146 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVCREATEFILE_H
+#define KDEVCREATEFILE_H
+
+#include <qstring.h>
+
+#include <kdevplugin.h>
+
+/**
+@file kdevcreatefile.h
+File creation facility interface.
+*/
+
+/**
+File creation facility interface.
+
+An abstract class for all extensions that are responsible for file creation.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevCreateFile *cf = extension<KDevCreateFile>("KDevelop/CreateFile");
+if (cf) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa KDevPlugin::extension method documentation.
+*/
+class KDevCreateFile : public KDevPlugin
+{
+
+public:
+ /**File created with @ref KDevCreateFile implementation.*/
+ class CreatedFile {
+
+ public:
+ /**The status of a file.*/
+ enum Status {
+ STATUS_OK /**<File was successfuly created.*/,
+ STATUS_CANCELED /**<File was not created due to user intervention.*/,
+ STATUS_NOTCREATED /**<File was not created due to error.*/,
+ STATUS_NOTWITHINPROJECT /**<File was successfuly created but not added to a project.*/
+ };
+
+ /**Constructor.
+ Sets status to STATUS_NOTCREATED.*/
+ CreatedFile()
+ : status( STATUS_NOTCREATED ) {}
+
+ CreatedFile( const CreatedFile& source )
+ : dir( source.dir ), filename( source.filename ),
+ ext( source.ext ), subtype( source.subtype ),
+ status( source.status ), addToProject(false) {}
+
+ CreatedFile& operator = ( const CreatedFile& source )
+ {
+ dir = source.dir;
+ filename = source.filename;
+ ext = source.ext;
+ subtype = source.subtype;
+ status = source.status;
+ addToProject = source.addToProject;
+ return( *this );
+ }
+
+ bool operator == ( const CreatedFile& source ) const
+ {
+ return
+ dir == source.dir &&
+ filename == source.filename &&
+ ext == source.ext &&
+ subtype == source.subtype &&
+ status == source.status &&
+ addToProject == source.addToProject;
+ }
+
+ // this should be private
+ /**The directory.*/
+ QString dir;
+ /**The name (without directory path).*/
+ QString filename;
+ /**The extension of a file. Extension defines a "type" of the file template
+ to use during file creation.*/
+ QString ext;
+ /**The subtype of a file. "Subtype" defines a file template to use when
+ there are several file templates for each extension.*/
+ QString subtype;
+ /**Current status.*/
+ Status status;
+ /**true if the file should be added to a project.*/
+ bool addToProject;
+ };
+
+
+public:
+
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevCreateFile(const KDevPluginInfo *info, QObject * parent = 0, const char * name = 0)
+ :KDevPlugin(info, parent, name) {}
+
+ /**Creates a new file, within or without the project.
+ Supply as much information as you know. Leave what you don't know as QString::null.
+ The user will be prompted as necessary for the missing information, and the
+ file created, and added to the project as necessary.
+ @param ext File extension (type).
+ @param dir The absolute path to a directory.
+ @param name The name of a file.
+ @param subtype The subtype, pass this only if an extension is not enough to find the
+ file template.
+ @return @ref CreatedFile instance with information about file and file creation process.*/
+ virtual CreatedFile createNewFile(QString ext = QString::null,
+ QString dir = QString::null,
+ QString name = QString::null,
+ QString subtype = QString::null) = 0;
+
+
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevdifffrontend.cpp b/lib/interfaces/extensions/kdevdifffrontend.cpp
new file mode 100644
index 00000000..a2e2c49b
--- /dev/null
+++ b/lib/interfaces/extensions/kdevdifffrontend.cpp
@@ -0,0 +1,33 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevdifffrontend.h"
+
+
+KDevDiffFrontend::KDevDiffFrontend(const KDevPluginInfo *info, QObject *parent, const char *name)
+ : KDevPlugin(info, parent, name ? name : "KDevDiffFrontend")
+{
+}
+
+KDevDiffFrontend::~KDevDiffFrontend()
+{
+}
+
+#include "kdevdifffrontend.moc"
diff --git a/lib/interfaces/extensions/kdevdifffrontend.h b/lib/interfaces/extensions/kdevdifffrontend.h
new file mode 100644
index 00000000..7c5874a2
--- /dev/null
+++ b/lib/interfaces/extensions/kdevdifffrontend.h
@@ -0,0 +1,79 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVDIFFFRONTEND_H
+#define KDEVDIFFFRONTEND_H
+
+#include <kurl.h>
+#include <kdevplugin.h>
+
+/**
+@file kdevdifffrontend.h
+Diff frontend interface.
+*/
+
+/**
+KDevelop diff frontend interface.
+This is the abstract base class for plugins that want to display differencies between
+files.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevDiffFrontend *df = extension<KDevDiffFrontend>("KDevelop/DiffFrontend");
+if (df) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa KDevPlugin::extension method documentation.
+*/
+class KDevDiffFrontend : public KDevPlugin
+{
+
+public:
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevDiffFrontend( const KDevPluginInfo *info, QObject *parent=0, const char *name=0 )
+ :KDevPlugin(info, parent, name ? name : "KDevDiffFrontend") {}
+
+ /**Displays the patch.
+ @param diff A string which contains a patch in unified format.*/
+ virtual void showDiff( const QString& diff ) = 0;
+
+ /**Displays a patch file.
+ @param url An url of the patch file.*/
+ virtual void openURL( const KURL &url ) = 0;
+
+ /**Displays the difference between the two files.
+ @param url1 First file to compare.
+ @param url2 Second file to compare.*/
+ virtual void showDiff( const KURL &url1, const KURL &url2 ) = 0;
+
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevelopappfrontend.desktop b/lib/interfaces/extensions/kdevelopappfrontend.desktop
new file mode 100644
index 00000000..60cd678b
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopappfrontend.desktop
@@ -0,0 +1,38 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/AppFrontend
+X-KDE-Derived=KDevelop/Plugin
+Name=App Frontend Interface
+Name[ca]=Interfície de l'entorn de les aplicacions
+Name[da]=Programbrugerflade-grænseflade
+Name[de]=Oberflächen-Schnittstelle (KDevelop)
+Name[el]=Διασύνδεση προγράμματος App
+Name[es]=Interfaz de entorno de aplicación
+Name[et]=Rakenduse kasutajaliides
+Name[eu]=Aplikazioaren inguruneko interfazea
+Name[fa]=واسط پایانۀ کاربرد
+Name[fr]=Interface graphique pour une application
+Name[gl]=Interface do frontal da aplicación
+Name[hu]=Alkalmazás kezelőfelülete
+Name[it]=Applicazione per le interfacce
+Name[ja]=App フロントエンド インターフェース
+Name[nds]=Programmböversiet-Koppelsteed
+Name[ne]=एप फ्रेन्टइन्ड इन्टरफेस
+Name[pl]=Interfejs do programów
+Name[pt]=Interface da Aplicação
+Name[pt_BR]=Interface Frontend para Aplicativos
+Name[ru]=Интерфейс менеджера приложений
+Name[sk]=Aplikačné rozhranie
+Name[sr]=Кориснички интерфејс програма
+Name[sr@Latn]=Korisnički interfejs programa
+Name[sv]=Programgränssnitt
+Name[ta]=ஆப் முன்னிருந்த இடைமுகம்
+Name[tg]=Интерфейси мудири гузориш
+Name[tr]=Uygulama Önucu Arayüzü
+Name[zh_CN]=应用程序前端接口
+Name[zh_TW]=App 前端介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopcodebrowserfrontend.desktop b/lib/interfaces/extensions/kdevelopcodebrowserfrontend.desktop
new file mode 100644
index 00000000..9dd7f8d2
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopcodebrowserfrontend.desktop
@@ -0,0 +1,28 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/CodeBrowserFrontend
+X-KDE-Derived=KDevelop/Plugin
+Name=Code Browser Frontend
+Name[ca]=Interfície per al navegador de codi
+Name[da]=Kodebrowser-grænseflade
+Name[de]=Quelltextbrowser-Oberfläche
+Name[el]=Πρόγραμμα περιήγησης κώδικα
+Name[es]=Interfaz para el navegador de código
+Name[et]=Koodibrauseri kasutajaliides
+Name[fr]=Interface de navigation dans le code
+Name[hu]=Kódböngésző
+Name[it]=Interfaccia di navigazione del codice
+Name[ja]=コードブラウザのフロントエンド
+Name[nds]=Kodekieker-Böversiet
+Name[pl]=Interfejs do przeglądarki kodu
+Name[pt]=Interface de Navegação do Código
+Name[pt_BR]=Interface de Navegação do Código
+Name[ru]=Навигатор по коду
+Name[sk]=Rozhranie pre prehliadač kódu
+Name[sr]=Интерфејс прегледача кода
+Name[sr@Latn]=Interfejs pregledača koda
+Name[sv]=Kodbläddringsgränssnitt
+Name[zh_TW]=源碼瀏覽器前端介面
+
+[PropertyDef::X-KDevelop-Version]
+Type=int
diff --git a/lib/interfaces/extensions/kdevelopcreatefile.desktop b/lib/interfaces/extensions/kdevelopcreatefile.desktop
new file mode 100644
index 00000000..d100b330
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopcreatefile.desktop
@@ -0,0 +1,38 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/CreateFile
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Create File Interface
+Name[ca]=Interfície de creació de fitxers per a KDevelop
+Name[da]=KDevelop opret filgrænseflade
+Name[de]=KDevelop-Schnittstelle zum Anlegen von Dateien
+Name[el]=Διασύνδεση δημιουργίας αρχείου KDevelop
+Name[es]=Interfaz de creación de archivos de KDevelop
+Name[et]=KDevelopi faili loomise liides
+Name[eu]=KDevelop-en "Sortu fitxategia" interfazea
+Name[fa]=واسط پروندۀ ایجاد KDevelop
+Name[fr]=Interface de création de fichiers pour KDevelop
+Name[gl]=Interface de crear ficheiro de KDevelop
+Name[hu]=KDevelop fájllétrehozási felület
+Name[it]=Interfaccia KDevelop per creare file
+Name[ja]=KDevelop Create File インターフェース
+Name[nds]=KDevelop-Koppelsteed för't Dateiopstellen
+Name[ne]=केडीई विकास फाइल इन्टरफेस सिर्जना
+Name[nl]=KDevelop Bestand aanmaken-interface
+Name[pl]=Interfejs KDevelopa do tworzenia pliku
+Name[pt]=Interface de Criação de Ficheiro do KDevelop
+Name[pt_BR]=Interface para Criar Arquivo do KDevelop
+Name[ru]=Интерфейс средства создания файлов для KDevelop
+Name[sk]=KDevelop rozhranie na vytvorenie súboru
+Name[sl]=Vmesnik za ustvarjanje datotek v KDevelopu
+Name[sr]=KDevelop-ов интерфејс за прављење фајла
+Name[sr@Latn]=KDevelop-ov interfejs za pravljenje fajla
+Name[sv]=KDevelop gränssnitt för att skapa filer
+Name[tr]=KDevelop Dosya Yaratma Arayüzü
+Name[zh_CN]=KDevelop 文件创建接口
+Name[zh_TW]=KDevelop 建立檔案介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopdifffrontend.desktop b/lib/interfaces/extensions/kdevelopdifffrontend.desktop
new file mode 100644
index 00000000..31dec5af
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopdifffrontend.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/DiffFrontend
+X-KDE-Derived=KDevelop/Plugin
+Name=Diff Frontend Interface
+Name[ca]=Interfície de l'entorn per a diff
+Name[da]=Diff-brugerflade grænseflade
+Name[de]=Schnittstelle für Diff-Oberflächen (KDevelop)
+Name[el]=Διασύνδεση προγράμματος Diff
+Name[es]=Interfaz del entorno de diff
+Name[et]=Diff kasutajaliides
+Name[eu]=Desberdintasun ingurunearen interfazea
+Name[fa]=واسط پایانۀ تفاوت
+Name[fr]=Interface du programme « Diff »
+Name[gl]=Interface do frontal de Diff
+Name[hi]=डिफ़ फ्रन्टएण्ड इंटरफ़ेस
+Name[hu]=Diff-kezelési felület
+Name[it]=Interfaccia a Diff
+Name[ja]=Diff フロントエンド インターフェース
+Name[nds]=Koppelsteed för "Diff"-Böversiet
+Name[ne]=डिफ फ्रेन्टइन्ड इन्टरफेस
+Name[nl]=Diff Frontend-interface
+Name[pl]=Interfejs do programu diff
+Name[pt]=Interface para o 'Diff'
+Name[pt_BR]=Interface de Frontend do Diff
+Name[ru]=Интерфейс системы нахождения различий
+Name[sk]=Rozhranie rozdielu
+Name[sl]=Vmesnik za diff
+Name[sr]=Кориснички интерфејс за diff
+Name[sr@Latn]=Korisnički interfejs za diff
+Name[sv]=Gränssnitt för jämförelse
+Name[ta]=டிப் முன்நிறுத்த இடைமுகம்
+Name[tg]=Барномаи интерфейс барои ёфтани тағирпазирӣ
+Name[tr]=Diff Önuç Arayüzü
+Name[zh_CN]=Diff 前端接口
+Name[zh_TW]=Diff 前端介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopmakefrontend.desktop b/lib/interfaces/extensions/kdevelopmakefrontend.desktop
new file mode 100644
index 00000000..f38d2d14
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopmakefrontend.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/MakeFrontend
+X-KDE-Derived=KDevelop/Plugin
+Name=Make Frontend Interface
+Name[ca]=Interfície de l'entorn per a make
+Name[da]=Make brugerflade-grænseflade
+Name[de]=Schnittstelle für Make-Oberflächen (KDevelop)
+Name[el]=Διασύνδεση προγράμματος Make
+Name[es]=Interfaz del entorno de make
+Name[et]=Make kasutajaliides
+Name[eu]=Make ingurunearen interfazea
+Name[fa]=واسط پایانۀ Make
+Name[fr]=Interface du programme « make »
+Name[gl]=Interface do frontal de Make
+Name[hi]=मेक फ्रन्टएण्ड इंटरफ़ेस
+Name[hu]=Make kezelőfelület
+Name[it]=Interfaccia per Make
+Name[ja]=Make フロントエンド インターフェース
+Name[nds]=Koppelsteed för "Make"-Böversiet
+Name[ne]=मेक फ्रेन्टइन्ड इन्टरफेस
+Name[nl]=Make Frontend-interface
+Name[pl]=Interfejs do Make
+Name[pt]=Interface para o Make
+Name[pt_BR]=Interface de Frontend do Make
+Name[ru]=Интерфейс Make
+Name[sk]=Rozhranie pre make
+Name[sl]=Vmesnik za make
+Name[sr]=Кориснички интерфејс за make
+Name[sr@Latn]=Korisnički interfejs za make
+Name[sv]=Byggränssnitt
+Name[ta]=முன்பகுதி இடை விளிம்பை அமை
+Name[tg]=Интерфейс пӯсти Make
+Name[tr]=Make Önuç Arayüzü
+Name[zh_CN]=Make 前端接口
+Name[zh_TW]=Make 前端介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopquickopen.desktop b/lib/interfaces/extensions/kdevelopquickopen.desktop
new file mode 100644
index 00000000..57ae2fd5
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopquickopen.desktop
@@ -0,0 +1,58 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/QuickOpen
+X-KDE-Derived=KDevelop/Plugin
+Name=Quick Open Interface
+Name[ca]=Interfície Open Quick
+Name[da]=Quick Open-grænseflade
+Name[de]=Schnittstelle für Schnellöffnen
+Name[el]=Διασύνδεση γρήγορου ανοίγματος
+Name[es]=Interfaz de apertura rápida
+Name[et]=Kiiravamise kasutajaliides
+Name[hu]=Gyors megnyitási kezelőfelület
+Name[it]=Interfaccia Quick Open
+Name[nds]=Fixopmaak-Koppelsteed
+Name[nl]=Snelopen-interface
+Name[pl]=Open Interface
+Name[pt]=Interface de Abertura Rápida
+Name[pt_BR]=Interface de Abertura Rápida
+Name[ru]=Интерфейс быстрого открытия
+Name[sk]=Rozhranie pre Quick Open
+Name[sr]=Интерфејс брзог отварања
+Name[sr@Latn]=Interfejs brzog otvaranja
+Name[sv]=Snabböppningsgränssnitt
+Name[zh_TW]=快速開啟介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/QuickOpen
+X-KDE-Derived=KDevelop/Plugin
+Name=Quick Open Interface
+Name[ca]=Interfície Open Quick
+Name[da]=Quick Open-grænseflade
+Name[de]=Schnittstelle für Schnellöffnen
+Name[el]=Διασύνδεση γρήγορου ανοίγματος
+Name[es]=Interfaz de apertura rápida
+Name[et]=Kiiravamise kasutajaliides
+Name[hu]=Gyors megnyitási kezelőfelület
+Name[it]=Interfaccia Quick Open
+Name[nds]=Fixopmaak-Koppelsteed
+Name[nl]=Snelopen-interface
+Name[pl]=Open Interface
+Name[pt]=Interface de Abertura Rápida
+Name[pt_BR]=Interface de Abertura Rápida
+Name[ru]=Интерфейс быстрого открытия
+Name[sk]=Rozhranie pre Quick Open
+Name[sr]=Интерфејс брзог отварања
+Name[sr@Latn]=Interfejs brzog otvaranja
+Name[sv]=Snabböppningsgränssnitt
+Name[zh_TW]=快速開啟介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopsourceformatter.desktop b/lib/interfaces/extensions/kdevelopsourceformatter.desktop
new file mode 100644
index 00000000..2bdadc38
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopsourceformatter.desktop
@@ -0,0 +1,39 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/SourceFormatter
+X-KDE-Derived=KDevelop/Plugin
+Name=Source Formatter Interface
+Name[ca]=Interfície del formatador de codi font
+Name[da]=Kildekodeformatering grænseflade
+Name[de]=Quelltext-Formatierer-Schnittstelle (KDevelop)
+Name[el]=Διασύνδεση μορφοποίησης κώδικα
+Name[es]=Interfaz del formateador de código fuente
+Name[et]=Koodi vormindamise liides
+Name[eu]=Iturburu formateatzailearen interfazea
+Name[fa]=واسط قالب‌دهندۀ منبع
+Name[fr]=Interface pour le formatage de code source
+Name[gl]=Interface do formateador de código
+Name[hu]=Forrásformázási felület
+Name[it]=Interfaccia per il formattatore del codice sorgente
+Name[ja]=ソースフォーマッタ インターフェース
+Name[nds]=Koppelsteed för Borntext-Formaterer
+Name[ne]=स्रोत ढाँचाबद्धक इन्टरफेस
+Name[nl]=Broncode formatteren-interface
+Name[pl]=Interfejs do programu formatowania źródeł
+Name[pt]=Interface de Formatação de Código
+Name[pt_BR]=Interface de Formatação de Fonte
+Name[ru]=Интерфейс форматирования исходного кода
+Name[sk]=Rozhranie pre formátovanie
+Name[sr]=Интерфејс форматера изворног кода
+Name[sr@Latn]=Interfejs formatera izvornog koda
+Name[sv]=Gränssnitt för källkodsformatering
+Name[ta]=வடிவமைப்பவரின் இடை விளிம்பு மூலம்
+Name[tg]=Интерфейс қолабгузори коди берунӣ
+Name[tr]=Kaynak Biçimleyici Arayüzü
+Name[zh_CN]=源代码格式化接口
+Name[zh_TW]=程式碼格式化介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevelopversioncontrol.desktop b/lib/interfaces/extensions/kdevelopversioncontrol.desktop
new file mode 100644
index 00000000..c772b9a6
--- /dev/null
+++ b/lib/interfaces/extensions/kdevelopversioncontrol.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/VersionControl
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Version Control Interface
+Name[ca]=Interfície del control de versions per a KDevelop
+Name[da]=KDevelop versionskontrol grænseflade
+Name[de]=Versionsverwaltung-Schnittstelle (KDevelop)
+Name[el]=Διασύνδεση ελέγχου εκδόσεων KDevelop
+Name[es]=Interfaz del control de versiones de KDevelop
+Name[et]=KDevelopi versioonide kontrollimise liides
+Name[eu]=KDevelop bertsio kontrol interfazea
+Name[fa]=واسط کنترل نسخۀ KDevelop
+Name[fr]=Interface pour le contrôle de versions de KDevelop
+Name[gl]=Interface do control de versións de KDevelop
+Name[hi]=के-डेवलप संस्करण नियंत्रण इंटरफ़ेस
+Name[hu]=KDevelop verziókezelési felület
+Name[ja]=KDevelop バージョンコントロール インターフェース
+Name[nds]=Verschoonkuntrull-Koppelsteed vun KDevelop
+Name[ne]=केडीई विकास संस्करण नियन्त्रण इन्टरफेस
+Name[nl]=KDevelop Versiebeheer-interface
+Name[pl]=Interfejs Kdevelopa do kontroli wersji
+Name[pt]=Interface de Controlo de Versões do KDevelop
+Name[pt_BR]=Interface de Controle de Versão do KDevelop
+Name[ru]=Интерфейс системы управления версиями
+Name[sk]=KDevelop rozhranie pre riadenie verzií
+Name[sl]=Vmesnik nadzora različic za KDevelop
+Name[sr]=KDevelop-ов интерфејс за контролу верзије
+Name[sr@Latn]=KDevelop-ov interfejs za kontrolu verzije
+Name[sv]=KDevelop gränssnitt för versionskontroll
+Name[ta]=KDevelop பதிப்பு கட்டுப்பாட்டு இடைஇணைப்பு
+Name[tg]=Интерфейс барномаи идоракунии тафсирҳо
+Name[tr]=KDevelop Sürüm Kontrol Arayüzü
+Name[zh_CN]=KDevelop 版本控制接口
+Name[zh_TW]=KDevelop 版本控制介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extensions/kdevmakefrontend.cpp b/lib/interfaces/extensions/kdevmakefrontend.cpp
new file mode 100644
index 00000000..5e035270
--- /dev/null
+++ b/lib/interfaces/extensions/kdevmakefrontend.cpp
@@ -0,0 +1,2 @@
+#include "kdevmakefrontend.h"
+#include "kdevmakefrontend.moc"
diff --git a/lib/interfaces/extensions/kdevmakefrontend.h b/lib/interfaces/extensions/kdevmakefrontend.h
new file mode 100644
index 00000000..6014ff34
--- /dev/null
+++ b/lib/interfaces/extensions/kdevmakefrontend.h
@@ -0,0 +1,106 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001 Sandy Meier <smeier@kdevelop.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+ Copyright (C) 2003 Hamish Rodda <rodda@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVMAKEFRONTEND_H
+#define KDEVMAKEFRONTEND_H
+
+#include <qstringlist.h>
+#include <kdevplugin.h>
+
+/**
+@file kdevmakefrontend.h
+Make frontend interface.
+*/
+
+/**
+KDevelop make frontend interface.
+This is the abstract base class for plugins that are able to run "make"
+or similar commands to build a project, api documentation, etc.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevMakeFrontend *mf = extension<KDevMakeFrontend>("KDevelop/MakeFrontend");
+if (mf) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa KDevPlugin::extension method documentation.
+*/
+class KDevMakeFrontend : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevMakeFrontend(const KDevPluginInfo *info, QObject *parent=0, const char *name=0 )
+ :KDevPlugin(info, parent, name ? name : "KDevMakeFrontend") {}
+
+ /**@return The widget where the make output is shown.*/
+ virtual QWidget* widget() { return 0L; }
+
+ /**The component shall start to execute a make-like command.
+ * Commands are always asynchronous. You can submit several jobs
+ * without caring about another job already running. There are
+ * executed in the order in which they are submitted. If one of
+ * then fails, all following jobs are dropped.
+ * You should not make any assumptions about the directory in which
+ * the command is started. If the command depends on that, put and
+ * explicit 'cd' into the command.
+ * @param dir A starting directory to find files when parsing compiler error
+ * messages.
+ * @param command A shell command to execute.
+ */
+ virtual void queueCommand(const QString &dir, const QString &command) = 0;
+
+ /**@return Whether the application is currently running.*/
+ virtual bool isRunning() = 0;
+
+ /**Advices to synchronize the settings from KConfig because they were changed externally.*/
+ virtual void updateSettingsFromConfig() = 0;
+
+signals:
+ /**
+ * Only emitted if the command was succesfully finished.
+ */
+ void commandFinished(const QString &command);
+
+ /**
+ * Emitted if a command failed.
+ */
+ void commandFailed(const QString &command);
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevquickopen.h b/lib/interfaces/extensions/kdevquickopen.h
new file mode 100644
index 00000000..3fd108c8
--- /dev/null
+++ b/lib/interfaces/extensions/kdevquickopen.h
@@ -0,0 +1,130 @@
+/* This file is part of the KDE project
+ Copyright (C) 2007 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVQUICKOPEN_H
+#define KDEVQUICKOPEN_H
+
+#include <kdevplugin.h>
+#include <kurl.h>
+
+/**
+@file kdevquickopen.h
+Source formatter interface.
+*/
+
+/**
+Quick open plugin interface.
+
+Use it when you need to present a dialog to choose between files to open.
+@code
+KDevQuickOpen *qo = extension<KDevQuickOpen>("KDevelop/QuickOpen");
+if (qo) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa @ref KDevPlugin::extension method documentation.
+@sa @ref whatisextension and @ref creatingextension sections of Platform API documentation.
+*/
+class KDevQuickOpen : public KDevPlugin
+{
+public:
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevQuickOpen(const KDevPluginInfo *info, QObject* parent, const char* name)
+ :KDevPlugin(info, parent, name) {}
+
+ /**Shows the file selection dialog.
+ @param text A list of urls to open.*/
+ virtual void quickOpenFile(const KURL::List urls) = 0;
+};
+
+#endif
+/* This file is part of the KDE project
+ Copyright (C) 2007 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVQUICKOPEN_H
+#define KDEVQUICKOPEN_H
+
+#include <kdevplugin.h>
+#include <kurl.h>
+
+/**
+@file kdevquickopen.h
+Source formatter interface.
+*/
+
+/**
+Quick open plugin interface.
+
+Use it when you need to present a dialog to choose between files to open.
+@code
+KDevQuickOpen *qo = extension<KDevQuickOpen>("KDevelop/QuickOpen");
+if (qo) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa @ref KDevPlugin::extension method documentation.
+@sa @ref whatisextension and @ref creatingextension sections of Platform API documentation.
+*/
+class KDevQuickOpen : public KDevPlugin
+{
+public:
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevQuickOpen(const KDevPluginInfo *info, QObject* parent, const char* name)
+ :KDevPlugin(info, parent, name) {}
+
+ /**Shows the file selection dialog.
+ @param text A list of urls to open.*/
+ virtual void quickOpenFile(const KURL::List urls) = 0;
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevsourceformatter.h b/lib/interfaces/extensions/kdevsourceformatter.h
new file mode 100644
index 00000000..82a9531f
--- /dev/null
+++ b/lib/interfaces/extensions/kdevsourceformatter.h
@@ -0,0 +1,69 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVSOURCEFORMATTER_H
+#define KDEVSOURCEFORMATTER_H
+
+#include <kdevplugin.h>
+
+/**
+@file kdevsourceformatter.h
+Source formatter interface.
+*/
+
+/**
+Source formatter interface.
+This interface is responsible for formatting source files and strings of code.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevSourceFormatter *sf = extension<KDevSourceFormatter>("KDevelop/SourceFormatter");
+if (sf) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa @ref KDevPlugin::extension method documentation.
+@sa @ref whatisextension and @ref creatingextension sections of Platform API documentation.
+*/
+class KDevSourceFormatter : public KDevPlugin
+{
+public:
+ /**Constructor.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevSourceFormatter(const KDevPluginInfo *info, QObject* parent, const char* name)
+ :KDevPlugin(info, parent, name) {}
+
+ /**Formats the source.
+ @param text A string with a code.
+ @return The formatted string.*/
+ virtual QString formatSource(const QString text) = 0;
+
+ /**@return The indentation string. For example, tab or four spaces can be returned.*/
+ virtual QString indentString() const = 0;
+};
+
+#endif
diff --git a/lib/interfaces/extensions/kdevversioncontrol.h b/lib/interfaces/extensions/kdevversioncontrol.h
new file mode 100644
index 00000000..d6e69e08
--- /dev/null
+++ b/lib/interfaces/extensions/kdevversioncontrol.h
@@ -0,0 +1,237 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVVERSIONCONTROL_H
+#define KDEVVERSIONCONTROL_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qwidget.h>
+#include <qmap.h>
+#include <qvaluelist.h>
+
+#include <kdevplugin.h>
+
+/**
+@file kdevversioncontrol.h
+Version control system interface and utility classes.
+*/
+
+/**
+Info about file state in VCS.
+
+Used, for example in file views to display VCS related information about files.
+*/
+struct VCSFileInfo
+{
+ /**State of the file.*/
+ enum FileState {
+ Unknown /**<No VCS information about a file is known.*/,
+ Added /**<File was added to the repository but not commited.*/,
+ Uptodate /**<File was updated or it is already at up to date version.*/,
+ Modified /**<File was modified locally.*/,
+ Conflict /**<Local version conflicts with the one in a repository.*/,
+ Sticky /**<File is sticky.*/,
+ NeedsPatch /**<File needs a patch.*/,
+ NeedsCheckout /**<File needs to be checkout again.*/,
+ Directory /**<This is a directory.*/ ,
+ Deleted /**<File or Directory is scheduled to be deleted. */ ,
+ Replaced /**<File was scheduled for deletion, and then a new file with the same name was scheduled for addition in its place. */
+ };
+
+ /**Constructor.*/
+ VCSFileInfo() {}
+ /**Constructor.
+ @param fn The file name (without a path).
+ @param workRev The current working revision of a file.
+ @param repoRev The last revision of a file in the repository.
+ @param aState The state of a file.*/
+ VCSFileInfo( QString fn, QString workRev, QString repoRev, FileState aState )
+ : fileName(fn), workRevision(workRev), repoRevision(repoRev), state(aState) {}
+
+ /**The file name.*/
+ QString fileName; // Yeah, _just_ the file name ;-)
+ /**The working revision number.*/
+ QString workRevision;
+ /**The repository revision number.*/
+ QString repoRevision;
+ /**The state of a file.*/
+ FileState state;
+
+ /**@return A descriptive string with all VCS related info about the file.*/
+ QString toString() const
+ {
+ return "(" + fileName + ", " + workRevision + ", " + repoRevision + ", " + state2String( state ) + ")";
+ }
+
+ /**@return A textual VCS state description.*/
+ static QString state2String( FileState state )
+ {
+ switch (state)
+ {
+ case Added: return "added";
+ case Uptodate: return "up-to-date";
+ case Modified: return "modified";
+ case Conflict: return "conflict";
+ case Sticky: return "sticky";
+ case NeedsPatch: return "needs patch";
+ case NeedsCheckout: return "needs check-out";
+ case Directory: return "directory";
+ case Deleted: return "deleted";
+ case Replaced: return "replaced";
+ case Unknown:
+ default:
+ return "unknown";
+ }
+ }
+
+};
+
+/**@class FileDom
+Info for a bunch of files that got modified.
+This is a type definition: @code QMap<QString,VCSFileInfo> VCSFileInfoMap; @endcode
+*/
+typedef QMap<QString,VCSFileInfo> VCSFileInfoMap;
+
+class KDevVCSFileInfoProvider;
+
+
+/**
+KDevelop version control system interface.
+This is the abstract base class which encapsulates everything
+necessary for communicating with version control systems.
+VCS support plugins should implement this interface.
+
+Instances that implement this interface are available through extension architecture:
+@code
+KDevVersionControl *vcs = extension<KDevVersionControl>("KDevelop/VersionControl");
+if (vcs) {
+ // do something
+} else {
+ // fail
+}
+@endcode
+@sa KDevPlugin::extension method documentation.
+*/
+class KDevVersionControl: public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ /**Constructs a VCS plugin.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevVersionControl(const KDevPluginInfo *info, QObject *parent, const char *name )
+ :KDevPlugin(info, parent, name ) {}
+
+ /**Creates a new project in the passed path @p dir. This should instantiate
+ VCS infrastructure and import a project into the VCS in that directory.
+ @param dir The absolute path to the directory where VCS infrastructure should be
+ created.*/
+ virtual void createNewProject(const QString& dir) = 0;
+
+ /**Fetches a module from remote repository, so it can be used for importing.
+ @return true in case of success.*/
+ virtual bool fetchFromRepository() = 0;
+
+ /**@return The file info provider for this version control (0 if none is available).*/
+ virtual KDevVCSFileInfoProvider *fileInfoProvider() const = 0;
+
+ /**Checks if the directory is valid for this version control (for example
+ CVS may check for the presence of "<dirPath>/CVS/" subdir and something else)
+ @param dirPath The absolute path of the directory.
+ @return true if the directory is valid for this version control
+ <b>warning</b>: this returns false by default.*/
+ virtual bool isValidDirectory(const QString &dirPath) const = 0;
+
+
+signals:
+ /**Emitted when the Version Control has finished importing a module from remote
+ repository
+ @param destinationDir The directory where the module has been fetched.*/
+ void finishedFetching(QString destinationDir);
+
+};
+
+/**
+Basic interface for providing info on file registered in a version control repository repository.
+*/
+class KDevVCSFileInfoProvider: public QObject
+{
+ Q_OBJECT
+public:
+ /**Constructor.
+ @param parent The parent VCS plugin.
+ @param name The name of a provider object.*/
+ KDevVCSFileInfoProvider(KDevVersionControl *parent, const char *name)
+ : QObject( parent, name ), m_owner(parent) {}
+
+ /**Gets the status for local files in the specified directory:
+ the info are collected locally so they are necessarily in sync with the repository
+
+ This is a <b>synchronous operation</b> (blocking).
+ @param dirPath The relative (to project dir) directory path to stat.
+ @return Status for all <b>registered</b> files.*/
+ virtual const VCSFileInfoMap *status(const QString &dirPath) = 0;
+
+ /**Starts a request for directory status to the remote repository.
+ Requests and answers are asynchronous.
+
+ This is an <b>asynchronous operation for requesting data</b>, so
+ for obvious reasons: the caller must connect the statusReady() signal and
+ check for the return value of this method.
+ @param dirPath The (relative to project directory) directory which status you are asking for.
+ @param callerData The pointer to some data you want the provider will return
+ to you when it has done.
+ @param recursive If false, retrieve information only for dirPath's immediate children.
+ @param checkRepos If true, contact remote repository and augment repository's status.
+ If false, retrieve only for local modification information.
+ @return true if the request has been successfully started, false otherwise.*/
+ virtual bool requestStatus( const QString &dirPath, void *callerData, bool recursive = true, bool checkRepos = true ) = 0;
+
+signals:
+ /**Emitted when the status request to remote repository has finished.
+ @param fileInfoMap The status for <b>registered in repository</b> files.
+ @param callerData The pointer to some data you want the provider will return
+ to you when it has done
+ @see requestStatus for to find out when this signal should be used.*/
+ void statusReady(const VCSFileInfoMap &fileInfoMap, void *callerData);
+
+protected:
+ /**@return The version control which owns this provider.*/
+ KDevVersionControl *owner() const { return m_owner; }
+
+private:
+ KDevVersionControl *m_owner;
+
+private:
+ KDevVCSFileInfoProvider( const KDevVCSFileInfoProvider & );
+ KDevVCSFileInfoProvider &operator=( const KDevVCSFileInfoProvider & );
+};
+
+#endif
diff --git a/lib/interfaces/external/Mainpage.dox b/lib/interfaces/external/Mainpage.dox
new file mode 100644
index 00000000..4618c3d5
--- /dev/null
+++ b/lib/interfaces/external/Mainpage.dox
@@ -0,0 +1,57 @@
+/**
+@mainpage The %KInterfaceDesigner Library
+
+This library contains all %KInterfaceDesigner classes and interfaces which form the core of
+GUI Designer integration framework.
+
+<b>Link with</b>: -lkinterfacedesigner
+
+<b>Include path</b>: -I\$(kde_includes)/kinterfacedesigner
+
+\section designerintegration Overview of GUI designer integration process
+Each KPart that wants to act as a GUI Designer must implement @ref KInterfaceDesigner::Designer
+interface. It defines necessary signals to communicate with an IDE and abstract virtual
+functions to determine designer type.
+
+If a part which can "design" user interface files of a certain mimetype
+implements this interface and sets itself as a default handler for that
+mimetype then it becomes automatically integrated into KDevelop IDE.
+
+When a part is embedded into KDevelop shell, its signals (defined in @ref
+KInterfaceDesigner::Designer interface):
+@code
+ void addedFunction(DesignerType type, const QString &formName, Function function)
+ void removedFunction(DesignerType type, const QString &formName, Function function)
+ void editedFunction(DesignerType type, const QString &formName, Function oldFunction, Function function)
+ void editFunction(DesignerType type, const QString &formName, const QString &functionName)
+ void editSource(DesignerType type, const QString &formName);
+@endcode
+are connected to corresponding slots of KDevelop designer integration engine which can be implemented in KDevelop language support plugin.
+
+Each language support which wants to use integrated designer, must reimplement
+@code
+virtual KDevDesignerIntegration *KDevLanguageSupport::designer(KInterfaceDesigner::DesignerType type)
+@endcode
+method and return designer integration object.
+
+Convenience designer integration support library is available for programming language support
+developers. With the convenience library writing %Qt designer integration for the language is a
+trivial task.
+
+
+\section kdevdesigner KDevelop Designer technical overview
+KDevelop version >= 3.1 comes with a customized version (fork ;)) of %Qt Designer. It is called KDevelop Designer (KDevDesigner, kdevdesigner from the command line). KDevDesigner has some important differences:
+- KDevDesigner provides a read/write KPart which can be embedded into any application which wants to edit .ui files. KDevelop IDE embeds KDevDesigner this way.
+- KDevDesigner uses %KDE icons and dialogs and thus provides better integration with a system.
+.
+
+It is safe to preview forms with some %KDE widgets from kdeui and kio libraries - KDevDesigner part is linked to those libraries so it will not crash under some circumstances.
+
+KDevDesigner will not create .ui.h files - this feature is completely disabled. Integrated KDevDesigner will use subclassing approach, standalone does not allow to enter code.
+
+\section other Other information
+
+@note It is technically possible to integrate not only %Qt Designer, but also, for example, Glade. Glade-3 can be compiled as a library and probably be embedded via XParts technology.
+
+*/
+
diff --git a/lib/interfaces/external/Makefile.am b/lib/interfaces/external/Makefile.am
new file mode 100644
index 00000000..bcad37b3
--- /dev/null
+++ b/lib/interfaces/external/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = $(all_includes)
+
+METASOURCES = AUTO
+
+kinterfacedesignerdir = $(includedir)/kinterfacedesigner
+kinterfacedesigner_HEADERS = designer.h
+
+lib_LTLIBRARIES = libkinterfacedesigner.la
+libkinterfacedesigner_la_LIBADD = $(LIB_QT) $(LIB_KPARTS) $(LIB_KDEUI)
+libkinterfacedesigner_la_LDFLAGS = $(all_libraries)
+libkinterfacedesigner_la_SOURCES = designer.cpp
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils
+DOXYGEN_PROJECTNAME = KInterfaceDesigner Library
+include ../../../Doxyfile.am
diff --git a/lib/interfaces/external/designer.cpp b/lib/interfaces/external/designer.cpp
new file mode 100644
index 00000000..b7c5de7a
--- /dev/null
+++ b/lib/interfaces/external/designer.cpp
@@ -0,0 +1,30 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "designer.h"
+
+namespace KInterfaceDesigner{
+
+Designer::Designer(QObject *parent, const char *name)
+ :KParts::ReadWritePart(parent, name)
+{
+}
+
+}
+
+#include "designer.moc"
diff --git a/lib/interfaces/external/designer.h b/lib/interfaces/external/designer.h
new file mode 100644
index 00000000..5c7821fa
--- /dev/null
+++ b/lib/interfaces/external/designer.h
@@ -0,0 +1,98 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KINTERFACEDESIGNER_FORMEDITOR_H
+#define KINTERFACEDESIGNER_FORMEDITOR_H
+
+#include <kparts/part.h>
+
+/**Contains KInterfaceDesigner classes.*/
+namespace KInterfaceDesigner{
+
+/**The type of a GUI Designer.*/
+enum DesignerType {
+ QtDesigner /**<Qt Designer.*/,
+ Glade /**<Glade (version >= 3).*/
+};
+
+/**Function type.*/
+enum FunctionType {
+ ftFunction /**<Simple function or a callback.*/,
+ ftQtSlot /**<Qt slot.*/
+};
+
+/**Function.*/
+struct Function{
+ /**Return type.*/
+ QString returnType;
+ /**Function name.*/
+ QString function;
+ /**Specifier, e.g. virtual, static, etc.*/
+ QString specifier;
+ /**Access, e.g. private, protected, public, etc.*/
+ QString access;
+ /**Function type.*/
+ FunctionType type;
+};
+
+/**
+GUI Designer Part Interface.
+Each KPart that wants to act as a GUI Designer must implement this interface.
+It defines necessary signals to communicate with an IDE and abstract virtual
+functions to determine designer type.
+
+Parts that implement this interface must emit its signals when necessary.
+See signals documentation for an explanation on when to emit those.
+
+If a part which can "design" user interface files of a certain mimetype
+implements this interface and sets itself as a default handler for that
+mimetype then it becomes automatically integrated into KDevelop IDE.
+*/
+class Designer: public KParts::ReadWritePart{
+ Q_OBJECT
+public:
+ Designer(QObject *parent, const char *name);
+
+ /**Reimplement this to be able to open projects.*/
+ virtual void openProject(const QString &projectFile) = 0;
+ /**Reimplement this return the type of this designer.*/
+ virtual DesignerType designerType() = 0;
+
+signals:
+ /**Emit this signal when a function was added by a designer. For example, when a slot
+ or a callback function was defined.*/
+ void addedFunction(DesignerType type, const QString &formName, Function function);
+ /**Emit this signal when a function was removed by a designer.*/
+ void removedFunction(DesignerType type, const QString &formName, Function function);
+ /**Emit this signal when a function signature was edited by a designer.*/
+ void editedFunction(DesignerType type, const QString &formName, Function oldFunction, Function function);
+
+ /**Emit this signal when a designer wants to open the editor with function definition.*/
+ void editFunction(DesignerType type, const QString &formName, const QString &functionName);
+ /**Emit this signal when a designer wants to open the editor for a form sources.*/
+ void editSource(DesignerType type, const QString &formName);
+
+ /**Emitted when a form state is changed in the designer.
+ @param formName An absolute name of the form file.
+ @param status 0: form is clean, 1: form is modified.*/
+ void newStatus(const QString &formName, int status);
+};
+
+}
+
+#endif
diff --git a/lib/interfaces/extras/Mainpage.dox b/lib/interfaces/extras/Mainpage.dox
new file mode 100644
index 00000000..f72dade5
--- /dev/null
+++ b/lib/interfaces/extras/Mainpage.dox
@@ -0,0 +1,11 @@
+/**
+@mainpage The KDevelop Extra Interfaces Library
+
+This library contains extra interfaces that are not the part of KDevelop plugin architecture
+but that can be implemented by extra plugins or "plugins for plugins".
+
+<b>Link with</b>: -lkdevextras
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/interfaces/extras
+*/
+
diff --git a/lib/interfaces/extras/Makefile.am b/lib/interfaces/extras/Makefile.am
new file mode 100644
index 00000000..b8b3e091
--- /dev/null
+++ b/lib/interfaces/extras/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+libkdevextras_la_LIBADD = $(LIB_QT)
+libkdevextras_la_LDFLAGS = $(all_libraries)
+lib_LTLIBRARIES = libkdevextras.la
+kdevelopincludedir = $(includedir)/kdevelop/interfaces/extras
+servicetypedir = $(kde_servicetypesdir)
+
+kdevelopinclude_HEADERS = kdevcompileroptions.h kdevvcsintegrator.h
+libkdevextras_la_SOURCES = kdevcompileroptions.cpp kdevvcsintegrator.cpp
+servicetype_DATA = kdevelopcompileroptions.desktop \
+ kdevelopvcsintegrator.desktop
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Extra Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../../Doxyfile.am
diff --git a/lib/interfaces/extras/kdevcompileroptions.cpp b/lib/interfaces/extras/kdevcompileroptions.cpp
new file mode 100644
index 00000000..5d87eec7
--- /dev/null
+++ b/lib/interfaces/extras/kdevcompileroptions.cpp
@@ -0,0 +1,6 @@
+#include "kdevcompileroptions.h"
+
+KDevCompilerOptions::KDevCompilerOptions( QObject * parent, const char * name )
+ :QObject(parent, name)
+{
+}
diff --git a/lib/interfaces/extras/kdevcompileroptions.h b/lib/interfaces/extras/kdevcompileroptions.h
new file mode 100644
index 00000000..268ce0af
--- /dev/null
+++ b/lib/interfaces/extras/kdevcompileroptions.h
@@ -0,0 +1,90 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+@file kdevcompileroptions.h
+The interface to compiler options configuration.
+*/
+
+#ifndef _KDEVCOMPILEROPTIONS_H_
+#define _KDEVCOMPILEROPTIONS_H_
+
+#include <qobject.h>
+
+/**
+The interface to compiler options configuration.
+Used by build systems to give users a compiler options configuration dialog.
+
+Common use case:
+@code
+static KDevCompilerOptions *createCompilerOptions( const QString &name, QObject *parent )
+{
+ KService::Ptr service = KService::serviceByDesktopName( name );
+ if ( !service )
+ return 0;
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory)
+ return 0;
+
+ QStringList args;
+ QVariant prop = service->property("X-KDevelop-Args");
+ if (prop.isValid())
+ args = QStringList::split(" ", prop.toString());
+
+ QObject *obj = factory->create(parent, service->name().latin1(),
+ "KDevCompilerOptions", args);
+
+ if (!obj->inherits("KDevCompilerOptions"))
+ return 0;
+
+ KDevCompilerOptions *dlg = (KDevCompilerOptions*) obj;
+ return dlg;
+}
+
+...
+KDevCompilerOptions *plugin = createCompilerOptions(compilerName, parent);
+QString flags = ""; //old compiler flags
+if ( plugin )
+{
+ flags = plugin->exec( parent, flags ); //new compiler flags are returned
+ delete plugin;
+}
+@endcode
+*/
+class KDevCompilerOptions : public QObject
+{
+ Q_OBJECT
+
+public:
+ KDevCompilerOptions( QObject *parent=0, const char *name=0 );
+
+ /**
+ * Opens a dialog which allows the user to configure the
+ * compiler options. The initial settings in the dialog
+ * will be set from the flags argument of this method.
+ * After the dialog is accepted, the new settings will
+ * be returned as a string. If the dialog was cancelled,
+ * QString::null is returned.
+ */
+ virtual QString exec(QWidget *parent, const QString &flags) = 0;
+};
+
+#endif
diff --git a/lib/interfaces/extras/kdevelopcompileroptions.desktop b/lib/interfaces/extras/kdevelopcompileroptions.desktop
new file mode 100644
index 00000000..7ed1df67
--- /dev/null
+++ b/lib/interfaces/extras/kdevelopcompileroptions.desktop
@@ -0,0 +1,48 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/CompilerOptions
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Compiler Options Dialog Interface
+Name[ca]=Interfície del diàleg d'opcions del compilador per a KDevelop
+Name[da]=KDevelop grænseflade til oversætterindstillinger
+Name[de]=Schnittstelle für Compiler-Einstellungsdialoge (KDevelop)
+Name[el]=Διασύνδεση διαλόγου επιλογών μεταγλωττιστή KDevelop
+Name[en_GB]=KDevelop Compiler Options Dialogue Interface
+Name[es]=Interfaz del diálogo de opciones del compilador de KDevelop
+Name[et]=KDevelopi kompilaatori valikute dialoogiliides
+Name[eu]=KDevelop-en konpiladore aukeren elkarrizketa-koadro interfazea
+Name[fa]=واسط محاورۀ گزینه‌های مترجم KDevelop
+Name[fr]=Interface de la boîte de dialogue des options du compilateur de KDevelop
+Name[gl]=Interface do diálogo de opcións de compilación de KDevelop
+Name[hi]=के-डेवलप कम्पायलर विकल्प संवाद इंटरफ़ेस
+Name[hu]=A KDevelop fordítási opcióinak párbeszédablaka
+Name[it]=Interfaccia KDevelop per le opzioni di compilazione
+Name[ja]=KDevelop コンパイラオプションダイアログ インターフェース
+Name[nds]=KDevelop-Dialoogkoppelsteed för Kompilerer-Optschonen
+Name[ne]=केडीई विकास कम्पाइलर विकल्प संवाद इन्टरफेस
+Name[nl]=KDevelop Compileroptiesdialoog-interface
+Name[pl]=Interfejs KDevelopa do okna dialogowego opcji kompilatora
+Name[pt]=Interface da Janela de Opções do Compilador do KDevelop
+Name[pt_BR]=Interface de Diálogo de Opções do Compilador do KDevelop
+Name[ru]=Интерфейс диалога опций компилятора
+Name[sk]=KDevelop rozhranie pre možnosti kompilátora
+Name[sl]=Vmesnik za možnosti prevajanja v KDevelopu
+Name[sr]=KDevelop-ов интерфејс дијалога „Опције преводиоца“
+Name[sr@Latn]=KDevelop-ov interfejs dijaloga „Opcije prevodioca“
+Name[sv]=KDevelop dialoggränssnitt för kompilatoralternativ
+Name[ta]=கெடெவலப் தொகுப்பித் தேர்வுகள் உரை இடைமுகம்
+Name[tg]=Гуфтугуи интерфейси талфифгари интихоб
+Name[tr]=KDevelop Derleyici Seçenekleri Pencere Arayüzü
+Name[zh_CN]=KDevelop编译器选项对话框接口
+Name[zh_TW]=KDevelop 編譯器選項對話框介面
+
+[PropertyDef::X-KDevelop-Language]
+Type=QString
+
+[PropertyDef::X-KDevelop-Default]
+Type=bool
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extras/kdevelopvcsintegrator.desktop b/lib/interfaces/extras/kdevelopvcsintegrator.desktop
new file mode 100644
index 00000000..141bf189
--- /dev/null
+++ b/lib/interfaces/extras/kdevelopvcsintegrator.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/VCSIntegrator
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop VCS Integrator
+Name[ca]=Integrador VCS per a KDevelop
+Name[da]=KDevelop VCS-importør
+Name[de]=VCS-Integration für KDevelop
+Name[el]=Ενσωματωτής VCS του KDevelop
+Name[es]=Integrador VCS de KDevelop
+Name[et]=KDevelopi VCS põimija
+Name[eu]=KDevelop-en VCS integratzailea
+Name[fa]=مجتمع‌ساز KDevelop VCS
+Name[fr]=Intégrateur VCS de KDevelop
+Name[gl]=Integrador de VCS de KDevelop
+Name[hu]=KDevelop VCS-integráló
+Name[it]=Integratore VCS di KDevelop
+Name[ja]=KDevelop VCS インテグレータ
+Name[nds]=VKS-Integreren för KDevelop
+Name[ne]=KDevelop VCS इन्टिगेटर
+Name[pl]=KDevelop: integracja z VCS
+Name[pt]=Importador de VCS do KDevelop
+Name[pt_BR]=Integrador VCS para o KDevelop
+Name[ru]=Модуль работы с системами контроля версий для KDevelop
+Name[sk]=Kdevelop VCS integrácia
+Name[sr]=KDevelop-ов VCS интегратор
+Name[sr@Latn]=KDevelop-ov VCS integrator
+Name[sv]=KDevelop VCS-import
+Name[tr]=KDevelop VCS Bütünleyicisi
+Name[zh_CN]=KDevelop VCS 集成器
+Name[zh_TW]=KDevelop VCS 整合器
+
+[PropertyDef::X-KDevelop-VCS]
+Type=QString
+
+[PropertyDef::X-KDevelop-VCSPlugin]
+Type=QString
+
+[PropertyDef::X-KDevelop-Default]
+Type=bool
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/extras/kdevvcsintegrator.cpp b/lib/interfaces/extras/kdevvcsintegrator.cpp
new file mode 100644
index 00000000..d231030a
--- /dev/null
+++ b/lib/interfaces/extras/kdevvcsintegrator.cpp
@@ -0,0 +1,26 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevvcsintegrator.h"
+
+KDevVCSIntegrator::KDevVCSIntegrator(QObject *parent, const char *name)
+ :QObject(parent, name)
+{
+}
+
+#include "kdevvcsintegrator.moc"
diff --git a/lib/interfaces/extras/kdevvcsintegrator.h b/lib/interfaces/extras/kdevvcsintegrator.h
new file mode 100644
index 00000000..d180e55f
--- /dev/null
+++ b/lib/interfaces/extras/kdevvcsintegrator.h
@@ -0,0 +1,76 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVVCSINTEGRATOR_H
+#define KDEVVCSINTEGRATOR_H
+
+#include <qobject.h>
+
+/**
+@file kdevvcsintegrator.h
+The interface to VCS integrators.
+*/
+
+class QDomDocument;
+class QWidget;
+
+/**
+VCS Integration Dialog.
+
+Usually it is created as:
+@code
+class MyVCSDialog: public QWidget, public VCSDialog {
+ MyVCSDialog(QWidget *parent = 0, const char *name = 0);
+ virtual void accept() { ... }
+ virtual void init(const QString &projectName, const QString &projectLocation) { ... }
+ virtual QWidget *self() {
+ return const_cast<MyVCSDialog*>(this);
+ }
+}
+@endcode
+*/
+class VCSDialog {
+public:
+ VCSDialog() { }
+ /**Implement all integration actions here. Do not use QDialog::accept method
+ to perform integration actions.*/
+ virtual void accept() = 0;
+ /**Init integration dialog with the project name and location.*/
+ virtual void init(const QString &projectName, const QString &projectLocation) = 0;
+ /**Reimplement to return an actual integration widget. Use QWidgets for that, not
+ QDialogs because integrator dialogs are usually have parent containers.*/
+ virtual QWidget *self() = 0;
+};
+
+/**
+The interface to VCS integrators.
+VCS integrator takes care about setting up VCS for new and existing projects.
+It can, for example, perform checkout or import operations.
+*/
+class KDevVCSIntegrator: public QObject {
+ Q_OBJECT
+public:
+ KDevVCSIntegrator(QObject *parent = 0, const char *name = 0);
+
+ /**Reimplement to return a dialog to fetch the project from VCS.*/
+ virtual VCSDialog *fetcher(QWidget *parent) = 0;
+ /**Reimplement to return a dialog to integrate the project into VCS.*/
+ virtual VCSDialog *integrator(QWidget *parent) = 0;
+};
+
+#endif
diff --git a/lib/interfaces/hashedstring.cpp b/lib/interfaces/hashedstring.cpp
new file mode 100644
index 00000000..38fdf4a9
--- /dev/null
+++ b/lib/interfaces/hashedstring.cpp
@@ -0,0 +1,362 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 "hashedstring.h"
+#include <kdatastream.h>
+#include <sstream>
+#include <algorithm>
+#include <iterator>
+#include<ext/hash_set>
+#include<set>
+#include<algorithm>
+
+//It needs to be measured whether this flag should be turned on or off. It seems just to move the complexity from one position to the other, without any variant being really better.
+#define USE_HASHMAP
+
+size_t fastHashString( const QString& str );
+
+size_t hashStringSafe( const QString& str ) {
+ size_t hash = 0;
+ int len = str.length();
+ for( int a = 0; a < len; a++ ) {
+ hash = str[a].unicode() + (hash * 17);
+ }
+ return hash;
+}
+
+size_t HashedString::hashString( const QString& str )
+{
+ return fastHashString( str );
+}
+
+size_t fastHashString( const QString& str ) {
+ size_t hash = 0;
+ if( !str.isEmpty() ) {
+ const QChar* curr = str.unicode();
+ const QChar* end = curr + str.length();
+ QChar c;
+ for(; curr < end ;) {
+ c = *curr;
+ hash = c.unicode() + ( hash * 17 );
+ ++curr;
+ }
+ }
+ return hash;
+}
+
+void HashedString::initHash() {
+ m_hash = hashString( m_str );
+}
+
+
+class HashedStringSetData : public KShared {
+ public:
+#ifdef USE_HASHMAP
+ typedef __gnu_cxx::hash_set<HashedString> StringSet;
+#else
+ typedef std::set<HashedString> StringSet; //must be a set, so the set-algorithms work
+#endif
+ StringSet m_files;
+ mutable bool m_hashValid;
+ mutable size_t m_hash;
+ HashedStringSetData() : m_hashValid( false ) {
+ }
+ inline void invalidateHash() {
+ m_hashValid = false;
+ }
+
+ void computeHash() const;
+};
+
+void HashedStringSetData::computeHash() const {
+ int num = 1;
+ m_hash = 0;
+ for( StringSet::const_iterator it = m_files.begin(); it != m_files.end(); ++it ) {
+ num *= 7;
+ m_hash += num * (*it).hash();
+ }
+ m_hashValid = true;
+}
+
+HashedStringSet::HashedStringSet() {}
+
+HashedStringSet::~HashedStringSet() {}
+
+HashedStringSet::HashedStringSet( const HashedString& file ) {
+ insert( file );
+}
+
+HashedStringSet::HashedStringSet( const HashedStringSet& rhs ) : m_data( rhs.m_data ) {}
+
+HashedStringSet operator + ( const HashedStringSet& lhs, const HashedStringSet& rhs ) {
+ HashedStringSet ret = lhs;
+ ret += rhs;
+
+ return ret;
+}
+
+int HashedStringSet::size() const {
+ if( !m_data ) return 0;
+ return m_data->m_files.size();
+}
+
+HashedStringSet& HashedStringSet::operator = ( const HashedStringSet& rhs ) {
+ m_data = rhs.m_data;
+ return *this;
+}
+
+HashedStringSet& HashedStringSet::operator +=( const HashedStringSet& rhs ) {
+ if ( !rhs.m_data )
+ return * this;
+
+#ifndef USE_HASHMAP
+ KSharedPtr<HashedStringSetData> oldData = m_data;
+ if( !oldData ) oldData = new HashedStringSetData();
+ m_data = new HashedStringSetData();
+ std::set_union( oldData->m_files.begin(), oldData->m_files.end(), rhs.m_data->m_files.begin(), rhs.m_data->m_files.end(), std::insert_iterator<HashedStringSetData::StringSet>( m_data->m_files, m_data->m_files.end() ) );
+#else
+ makeDataPrivate();
+ m_data->m_files.insert( rhs.m_data->m_files.begin(), rhs.m_data->m_files.end() );
+ /*HashedStringSetData::StringSet::const_iterator end = rhs.m_data->m_files.end();
+ HashedStringSetData::StringSet& mySet( m_data->m_files );
+ for( HashedStringSetData::StringSet::const_iterator it = rhs.m_data->m_files.begin(); it != end; ++it ) {
+ mySet.insert( *it );
+ }*/
+
+#endif
+ return *this;
+}
+
+HashedStringSet& HashedStringSet::operator -=( const HashedStringSet& rhs ) {
+ if( !m_data ) return *this;
+ if( !rhs.m_data ) return *this;
+#ifndef USE_HASHMAP
+ KSharedPtr<HashedStringSetData> oldData = m_data;
+ m_data = new HashedStringSetData();
+ std::set_difference( oldData->m_files.begin(), oldData->m_files.end(), rhs.m_data->m_files.begin(), rhs.m_data->m_files.end(), std::insert_iterator<HashedStringSetData::StringSet>( m_data->m_files, m_data->m_files.end() ) );
+#else
+ makeDataPrivate();
+ HashedStringSetData::StringSet::const_iterator end = rhs.m_data->m_files.end();
+ HashedStringSetData::StringSet::const_iterator myEnd = m_data->m_files.end();
+ HashedStringSetData::StringSet& mySet( m_data->m_files );
+ for( HashedStringSetData::StringSet::const_iterator it = rhs.m_data->m_files.begin(); it != end; ++it ) {
+ mySet.erase( *it );
+ }
+
+#endif
+ return *this;
+}
+
+
+void HashedStringSet::makeDataPrivate() {
+ if ( !m_data ) {
+ m_data = new HashedStringSetData();
+ return ;
+ }
+ if ( m_data->_KShared_count() != 1 )
+ m_data = new HashedStringSetData( *m_data );
+}
+
+bool HashedStringSet::operator[] ( const HashedString& rhs ) const {
+ //if ( rhs.str() == "*" )
+ //return true; /// * stands for "any file"
+ if ( !m_data )
+ return false;
+ return m_data->m_files.find( rhs ) != m_data->m_files.end();
+}
+
+void HashedStringSet::insert( const HashedString& str ) {
+ if( str.str().isEmpty() ) return;
+ makeDataPrivate();
+ m_data->m_files.insert( str );
+ m_data->invalidateHash();
+}
+
+bool HashedStringSet::operator <= ( const HashedStringSet& rhs ) const {
+ if ( !m_data )
+ return true;
+ if ( m_data->m_files.empty() )
+ return true;
+ if ( !rhs.m_data )
+ return false;
+#ifndef USE_HASHMAP
+ return std::includes( rhs.m_data->m_files.begin(), rhs.m_data->m_files.end(), m_data->m_files.begin(), m_data->m_files.end() );
+#else
+ const HashedStringSetData::StringSet& otherSet( rhs.m_data->m_files );
+ HashedStringSetData::StringSet::const_iterator end = rhs.m_data->m_files.end();
+ HashedStringSetData::StringSet::const_iterator myEnd = m_data->m_files.end();
+
+ for( HashedStringSetData::StringSet::const_iterator it = m_data->m_files.begin(); it != myEnd; ++it ) {
+ HashedStringSetData::StringSet::const_iterator i = otherSet.find( *it );
+ if( i == end ) return false;
+ }
+ return true;
+#endif
+}
+
+bool HashedStringSet::operator == ( const HashedStringSet& rhs ) const {
+ if( hash() != rhs.hash() ) return false;
+
+ bool empty1 = false;
+ if ( !m_data )
+ empty1 = true;
+ else if ( m_data->m_files.empty() )
+ empty1 = true;
+ bool empty2 = false;
+ if ( !rhs.m_data )
+ empty2 = true;
+ else if ( rhs.m_data->m_files.empty() )
+ empty2 = true;
+
+ if ( empty1 && empty2 )
+ return true;
+ if ( empty1 || empty2 )
+ return false;
+
+ return m_data->m_files == rhs.m_data->m_files;
+}
+
+size_t HashedStringSet::hash() const {
+ if( !m_data ) return 0;
+ if( !m_data->m_hashValid ) m_data->computeHash();
+ return m_data->m_hash;
+}
+
+void HashedStringSet::read( QDataStream& stream ) {
+ bool b;
+ stream >> b;
+ if( b ) {
+ m_data = new HashedStringSetData();
+ int cnt;
+ stream >> cnt;
+ HashedString s;
+ for( int a = 0; a < cnt; a++ ) {
+ stream >> s;
+ m_data->m_files.insert( s );
+ }
+ } else {
+ m_data = 0;
+ }
+}
+
+void HashedStringSet::write( QDataStream& stream ) const {
+ bool b = m_data;
+ stream << b;
+ if( b ) {
+ int cnt = m_data->m_files.size();
+ stream << cnt;
+ for( HashedStringSetData::StringSet::const_iterator it = m_data->m_files.begin(); it != m_data->m_files.end(); ++it ) {
+ stream << *it;
+ }
+ }
+}
+
+std::string HashedStringSet::print() const {
+ std::ostringstream s;
+ if( m_data ) {
+ for( HashedStringSetData::StringSet::const_iterator it = m_data->m_files.begin(); it != m_data->m_files.end(); ++it ) {
+ s << (*it).str().ascii() << "\n";
+ }
+ }
+ return s.str();
+}
+
+QDataStream& operator << ( QDataStream& stream, const HashedString& str ) {
+ stream << str.m_str;
+ stream << str.m_hash;
+ return stream;
+}
+
+QDataStream& operator >> ( QDataStream& stream, HashedString& str ) {
+ stream >> str.m_str;
+ stream >> str.m_hash;
+ return stream;
+}
+
+void HashedStringSetGroup::addSet( size_t id, const HashedStringSet& set ) {
+ if( set.m_data && !set.m_data->m_files.empty() ) {
+ m_sizeMap[ id ] = set.size();
+ for( HashedStringSetData::StringSet::const_iterator it = set.m_data->m_files.begin(); it != set.m_data->m_files.end(); ++it ) {
+ GroupMap::iterator itr = m_map.find( *it );
+ if( itr == m_map.end() ) {
+ itr = m_map.insert( std::make_pair( *it, ItemSet() ) ).first;
+ }
+ itr->second.insert( id );
+ }
+ } else {
+ m_global.insert( id );
+ }
+}
+
+void HashedStringSetGroup::disableSet( size_t id ) {
+ m_disabled.insert( id );
+}
+
+void HashedStringSetGroup::enableSet( size_t id ) {
+ m_disabled.erase( id );
+}
+
+bool HashedStringSetGroup::isDisabled( size_t id ) const {
+ return m_disabled.find( id ) != m_disabled.end();
+}
+
+void HashedStringSetGroup::removeSet( size_t id ) {
+ m_disabled.erase( id );
+ m_global.erase( id );
+ m_sizeMap.erase( id );
+ for( GroupMap::iterator it = m_map.begin(); it != m_map.end(); ++it ) {
+ it->second.erase( id );
+ }
+}
+
+void HashedStringSetGroup::findGroups( HashedStringSet strings, ItemSet& target ) const {
+ target.clear();
+ if( !strings.m_data ) {
+ std::set_difference( m_global.begin(), m_global.end(), m_disabled.begin(), m_disabled.end(), std::insert_iterator<ItemSet>( target, target.end() ) );
+ return;
+ }
+ //This might yet be optimized by sorting the sets according to their size, and starting the intersectioning with the smallest ones.
+ __gnu_cxx::hash_map<size_t, int> hitCounts;
+
+ for( HashedStringSetData::StringSet::const_iterator it = strings.m_data->m_files.begin(); it != strings.m_data->m_files.end(); ++it ) {
+ GroupMap::const_iterator itr = m_map.find( *it );
+ if( itr == m_map.end() ) {
+ //There are no string-sets that include the currently searched for string
+ continue;
+ }
+
+ for( ItemSet::const_iterator it2 = itr->second.begin(); it2 != itr->second.end(); ++it2 ) {
+ __gnu_cxx::hash_map<size_t, int>::iterator v = hitCounts.find( *it2 );
+ if( v != hitCounts.end() ) {
+ ++(*v).second;
+ } else {
+ hitCounts[*it2] = 1;
+ }
+ }
+ }
+
+ //Now count together all groups that are completely within the given string-set(their hitCount equals their size)
+ ItemSet found;
+ for( __gnu_cxx::hash_map<size_t, int>::const_iterator it = hitCounts.begin(); it != hitCounts.end(); ++it ) {
+ if( (*it).second == (*m_sizeMap.find( (*it).first )).second )
+ found.insert( (*it).first );
+ }
+
+
+ std::set_union( found.begin(), found.end(), m_global.begin(), m_global.end(), std::insert_iterator<ItemSet>( target, target.end() ) );
+
+ target.swap( found );
+ target.clear();
+ std::set_difference( found.begin(), found.end(), m_disabled.begin(), m_disabled.end(), std::insert_iterator<ItemSet>( target, target.end() ) );
+}
diff --git a/lib/interfaces/hashedstring.h b/lib/interfaces/hashedstring.h
new file mode 100644
index 00000000..e62ab2e3
--- /dev/null
+++ b/lib/interfaces/hashedstring.h
@@ -0,0 +1,155 @@
+/***************************************************************************
+ copyright : (C) 2006 by David Nolden
+ email : david.nolden.kdevelop@art-master.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 HASHED_STRING_H
+#define HASHED_STRING_H
+
+#include<qstring.h>
+#include<qdatastream.h>
+#include<ksharedptr.h>
+#include<set>
+#include <ext/hash_map>
+#include <string>
+
+///A simple class that stores a string together with it's appropriate hash-key
+class HashedString {
+ public:
+ HashedString() : m_hash( 0 ) {}
+
+ HashedString( const QString& str ) : m_str( str ) {
+ initHash();
+ }
+
+ HashedString( const char* str ) : m_str( str ) {
+ initHash();
+ }
+
+ inline size_t hash() const {
+ return m_hash;
+ }
+
+ QString str() const {
+ return m_str;
+ }
+
+ bool operator == ( const HashedString& rhs ) const {
+ if ( m_hash != rhs.m_hash )
+ return false;
+ return m_str == rhs.m_str;
+ }
+
+ ///Does not compare alphabetically, uses the hash-key for ordering.
+ bool operator < ( const HashedString& rhs ) const {
+ if ( m_hash < rhs.m_hash )
+ return true;
+ if ( m_hash == rhs.m_hash )
+ return m_str < rhs.m_str;
+ return false;
+ }
+
+ static size_t hashString( const QString& str );
+
+ private:
+ void initHash();
+
+ QString m_str;
+ size_t m_hash;
+
+ friend QDataStream& operator << ( QDataStream& stream, const HashedString& str );
+ friend QDataStream& operator >> ( QDataStream& stream, HashedString& str );
+};
+
+QDataStream& operator << ( QDataStream& stream, const HashedString& str );
+
+QDataStream& operator >> ( QDataStream& stream, HashedString& str );
+
+class HashedStringSetData;
+class HashedStringSetGroup;
+
+///This is a reference-counting string-set optimized for fast lookup of hashed strings
+class HashedStringSet {
+ public:
+ HashedStringSet();
+
+ ~HashedStringSet();
+
+ ///Constructs a string-set from one single file
+ HashedStringSet( const HashedString& file );
+
+ HashedStringSet( const HashedStringSet& rhs );
+
+ int size() const;
+
+ HashedStringSet& operator = ( const HashedStringSet& rhs );
+ ///@return whether the given file-name was included
+ bool operator[] ( const HashedString& rhs ) const;
+
+ void insert( const HashedString& str );
+
+ HashedStringSet& operator +=( const HashedStringSet& );
+
+ HashedStringSet& operator -=( const HashedStringSet& );
+
+ ///intersection-test
+ ///Returns true if all files that are part of this set are also part of the given set
+ bool operator <= ( const HashedStringSet& rhs ) const;
+
+ bool operator == ( const HashedStringSet& rhs ) const;
+
+ void read( QDataStream& stream );
+ void write( QDataStream& stream ) const;
+
+ std::string print() const;
+
+ size_t hash() const;
+ private:
+ friend class HashedStringSetGroup;
+ void makeDataPrivate();
+ KSharedPtr<HashedStringSetData> m_data; //this implies some additional cost because KShared's destructor is virtual. Maybe change that by copying KShared without the virtual destructor.
+ friend HashedStringSet operator + ( const HashedStringSet& lhs, const HashedStringSet& rhs );
+};
+
+HashedStringSet operator + ( const HashedStringSet& lhs, const HashedStringSet& rhs );
+
+namespace __gnu_cxx {
+template<>
+struct hash<HashedString> {
+ size_t operator () ( const HashedString& str ) const {
+ return str.hash();
+ }
+};
+}
+
+///Used to find all registered HashedStringSet's that contain all strings given to findGroups(..)
+class HashedStringSetGroup {
+ public:
+ typedef std::set<size_t> ItemSet;
+ void addSet( size_t id, const HashedStringSet& set );
+ void enableSet( size_t id );
+ bool isDisabled( size_t id ) const;
+ void disableSet( size_t id );
+ void removeSet( size_t id );
+
+ //Writes the ids of all registered and not disabled HashedStringSet's that are completely included in the given HashedStringSet efficiently)
+ void findGroups( HashedStringSet strings, ItemSet& target ) const;
+
+ private:
+ typedef __gnu_cxx::hash_map<HashedString, ItemSet> GroupMap;
+ typedef __gnu_cxx::hash_map<size_t, size_t> SizeMap;
+ GroupMap m_map;
+ SizeMap m_sizeMap;
+ ItemSet m_disabled;
+ ItemSet m_global;
+};
+#endif
diff --git a/lib/interfaces/katedocumentmanagerinterface.cpp b/lib/interfaces/katedocumentmanagerinterface.cpp
new file mode 100644
index 00000000..3ad76dd7
--- /dev/null
+++ b/lib/interfaces/katedocumentmanagerinterface.cpp
@@ -0,0 +1,104 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Ian Reinhart Geiser <geiser@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "katedocumentmanagerinterface.h"
+#include "kdevpartcontroller.h"
+#include <kurl.h>
+#include <dcopclient.h>
+#include <kapplication.h>
+#include <dcopref.h>
+#include <kate/document.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+KateDocumentManagerInterface::KateDocumentManagerInterface( KDevPartController *pc)
+ : QObject(pc), DCOPObject("KateDocumentManager"), m_controller(pc)
+{
+
+}
+
+
+KateDocumentManagerInterface::~KateDocumentManagerInterface() {}
+
+
+
+DCOPRef KateDocumentManagerInterface::activeDocument( )
+{
+ return documentWithID(activeDocumentNumber());
+}
+
+DCOPRef KateDocumentManagerInterface::document( uint n )
+{
+ return documentWithID(n);
+}
+
+DCOPRef KateDocumentManagerInterface::documentWithID( uint id )
+{
+ QString dcopobj = "KateDocument#" + QString::number(id);
+ return DCOPRef(kapp->dcopClient()->appId(), dcopobj.latin1() );
+}
+
+DCOPRef KateDocumentManagerInterface::openURL( const KURL &url, const QString &encoding )
+{
+ m_controller->editDocument(url);
+ m_controller->setEncoding(encoding);
+ int idx = findDocument( url );
+ return documentWithID(idx);
+}
+
+bool KateDocumentManagerInterface::closeAllDocuments( )
+{
+ return m_controller->closeAllFiles();
+}
+
+bool KateDocumentManagerInterface::closeDocument( uint n )
+{
+ return false;
+}
+
+bool KateDocumentManagerInterface::isOpen( const KURL &url )
+{
+ return (m_controller->partForURL(url) != 0L);
+}
+
+int KateDocumentManagerInterface::findDocument( const KURL &url )
+{
+ KTextEditor::Document *doc = dynamic_cast<KTextEditor::Document*>(m_controller->partForURL(url));
+ if( doc )
+ return doc->documentNumber();
+ else
+ return 0L;
+}
+
+uint KateDocumentManagerInterface::activeDocumentNumber( )
+{
+ KTextEditor::Document *doc = dynamic_cast<KTextEditor::Document*>(m_controller->activePart());
+ if( doc )
+ {
+ return doc->documentNumber();
+ }
+ else
+ return 0;
+}
+
+uint KateDocumentManagerInterface::documents( )
+{
+ return m_controller->openURLs().count();
+}
+
+#include "katedocumentmanagerinterface.moc"
diff --git a/lib/interfaces/katedocumentmanagerinterface.h b/lib/interfaces/katedocumentmanagerinterface.h
new file mode 100644
index 00000000..f6adfd4f
--- /dev/null
+++ b/lib/interfaces/katedocumentmanagerinterface.h
@@ -0,0 +1,58 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Ian Reinhart Geiser <geiser@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KATEDOCUMENTMANAGERINTERFACE_H
+#define KATEDOCUMENTMANAGERINTERFACE_H
+
+#include <qobject.h>
+#include <dcopobject.h>
+#include <dcopref.h>
+#include <kurl.h>
+class KDevPartController;
+
+/**
+This is an emulated interface to provide compatibility with Kate scripts.
+
+@author KDevelop Authors
+*/
+class KateDocumentManagerInterface : public QObject, public DCOPObject {
+
+ Q_OBJECT
+ K_DCOP
+public:
+ KateDocumentManagerInterface( KDevPartController *pc );
+
+ ~KateDocumentManagerInterface();
+
+k_dcop:
+ DCOPRef activeDocument();
+ DCOPRef document( uint n );
+ DCOPRef documentWithID( uint id );
+ DCOPRef openURL( const KURL &url, const QString &encoding );
+ bool closeAllDocuments();
+ bool closeDocument( uint n );
+ bool isOpen( const KURL &url );
+ int findDocument( const KURL &url );
+ uint activeDocumentNumber();
+ uint documents();
+private:
+
+ KDevPartController *m_controller;
+};
+
+#endif
diff --git a/lib/interfaces/kdevapi.cpp b/lib/interfaces/kdevapi.cpp
new file mode 100644
index 00000000..fb178683
--- /dev/null
+++ b/lib/interfaces/kdevapi.cpp
@@ -0,0 +1,93 @@
+/* This file is part of the KDE project
+ Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevapi.h"
+
+#include "kdevcoderepository.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class KDevApi::Private
+///////////////////////////////////////////////////////////////////////////////
+
+class KDevApi::Private
+{
+public:
+ Private()
+ : m_projectDom(0), m_project(0), m_languageSupport(0),
+ m_codeRepository(0)
+ {}
+
+ QDomDocument *m_projectDom;
+ KDevProject *m_project;
+ KDevLanguageSupport *m_languageSupport;
+ KDevCodeRepository* m_codeRepository;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class KDevApi
+///////////////////////////////////////////////////////////////////////////////
+
+KDevApi::KDevApi()
+{
+ d = new KDevApi::Private;
+ d->m_codeRepository = new KDevCodeRepository();
+}
+
+KDevApi::~KDevApi()
+{
+ delete d->m_codeRepository;
+ delete d;
+}
+
+KDevProject *KDevApi::project() const
+{
+ return d->m_project;
+}
+
+void KDevApi::setProject(KDevProject *project)
+{
+ d->m_project = project;
+}
+
+KDevLanguageSupport *KDevApi::languageSupport() const
+{
+ return d->m_languageSupport;
+}
+
+void KDevApi::setLanguageSupport(KDevLanguageSupport *languageSupport)
+{
+ d->m_languageSupport = languageSupport;
+}
+
+QDomDocument *KDevApi::projectDom() const
+{
+ return d->m_projectDom;
+}
+
+void KDevApi::setProjectDom(QDomDocument *dom)
+{
+ d->m_projectDom = dom;
+}
+
+KDevCodeRepository *KDevApi::codeRepository() const
+{
+ return d->m_codeRepository;
+}
+
+#include "kdevapi.moc"
diff --git a/lib/interfaces/kdevapi.h b/lib/interfaces/kdevapi.h
new file mode 100644
index 00000000..1b6115b0
--- /dev/null
+++ b/lib/interfaces/kdevapi.h
@@ -0,0 +1,103 @@
+/* This file is part of the KDE project
+ Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVAPI_H
+#define KDEVAPI_H
+
+#include <qobject.h>
+
+class QStringList;
+class QDomDocument;
+class KDevCore;
+class KDevProject;
+class KDevLanguageSupport;
+class CodeModel;
+class KDevPartController;
+class KDevMainWindow;
+class KDevCodeRepository;
+class KDevPlugin;
+class KDevPluginController;
+
+/**
+@file kdevapi.h
+KDevelop API interface.
+*/
+
+/**
+The interface to KDevelop's core components.
+Needs to be implemented in a shell. Developers do not need to use this
+class because @ref KDevPlugin already provides API convenience methods.
+*/
+class KDevApi: public QObject
+{
+ Q_OBJECT
+public:
+ /**Constructor.*/
+ KDevApi();
+
+ /**Destructor.*/
+ virtual ~KDevApi();
+
+ /**@return A reference to the toplevel widget.*/
+ virtual KDevMainWindow *mainWindow() const = 0;
+
+ /**@return A reference to the part controller which is used to manipulate loaded KParts.*/
+ virtual KDevPartController *partController() const = 0;
+
+ /**@return A reference to the plugin controller which is used to manipulate loaded plugin.*/
+ virtual KDevPluginController *pluginController() const = 0;
+
+ /**@return A reference to the application core - an object which provides
+ basic functionalities for inter-parts communications / cooperation.*/
+ virtual KDevCore *core() const = 0;
+
+ /**@return A reference to the memory symbol store.*/
+ virtual CodeModel *codeModel() const = 0;
+
+ /**@return A reference to the DOM tree that represents the project file or 0 if no project is loaded.*/
+ QDomDocument *projectDom() const;
+
+ /**Sets the Document Object Model for the current project.
+ @param dom The project DOM.*/
+ void setProjectDom(QDomDocument *dom);
+
+ /**@return A reference to the current project component or 0 if no project is loaded.*/
+ KDevProject *project() const;
+
+ /**Sets the current project.
+ @param project The project plugin which becames the current project.*/
+ void setProject(KDevProject *project);
+
+ /**@return A reference to the language support component or 0 if no support available.*/
+ KDevLanguageSupport *languageSupport() const;
+
+ /**Sets the object charged of providing handling for the source files written in particular
+ language (languages support component).
+ @param languageSupport The language support plugin.*/
+ void setLanguageSupport(KDevLanguageSupport *languageSupport);
+
+ /**@return A reference to the code repository (accessor to persistent symbol stores).*/
+ KDevCodeRepository *codeRepository() const;
+
+private:
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/lib/interfaces/kdevcoderepository.cpp b/lib/interfaces/kdevcoderepository.cpp
new file mode 100644
index 00000000..81480940
--- /dev/null
+++ b/lib/interfaces/kdevcoderepository.cpp
@@ -0,0 +1,71 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevcoderepository.h"
+
+struct KDevCodeRepositoryData
+{
+ Catalog* mainCatalog;
+ QValueList<Catalog*> catalogs;
+
+ KDevCodeRepositoryData(): mainCatalog( 0 ) {}
+};
+
+KDevCodeRepository::KDevCodeRepository( )
+ : d( new KDevCodeRepositoryData )
+{
+}
+
+KDevCodeRepository::~KDevCodeRepository( )
+{
+ delete( d );
+}
+
+Catalog* KDevCodeRepository::mainCatalog()
+{
+ return d->mainCatalog;
+}
+
+void KDevCodeRepository::setMainCatalog( Catalog * mainCatalog )
+{
+ d->mainCatalog = mainCatalog;
+}
+
+void KDevCodeRepository::registerCatalog( Catalog * catalog )
+{
+ d->catalogs.append( catalog );
+ emit catalogRegistered( catalog );
+}
+
+void KDevCodeRepository::unregisterCatalog( Catalog * catalog )
+{
+ d->catalogs.remove( catalog );
+ emit catalogUnregistered( catalog );
+}
+
+void KDevCodeRepository::touchCatalog( Catalog * catalog )
+{
+ emit catalogChanged( catalog );
+}
+
+QValueList< Catalog * > KDevCodeRepository::registeredCatalogs( )
+{
+ return d->catalogs;
+}
+
+#include "kdevcoderepository.moc"
diff --git a/lib/interfaces/kdevcoderepository.h b/lib/interfaces/kdevcoderepository.h
new file mode 100644
index 00000000..9012c428
--- /dev/null
+++ b/lib/interfaces/kdevcoderepository.h
@@ -0,0 +1,94 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVCODEREPOSITORY_H
+#define KDEVCODEREPOSITORY_H
+
+#include <qobject.h>
+#include <qvaluelist.h>
+
+/**
+@file kdevcoderepository.h
+Code repository - the persistent symbol store accessor.
+*/
+
+class KDevCodeRepositoryData;
+class Catalog;
+
+/**
+Code repository - the persistent symbol store accessor.
+Symbols from parsed files can be saved to the persistent symbol store.
+Persistence in this case means that symbol database is never loaded into memory
+and works like a usual database which executes queries.
+
+Code repository consists from @ref Catalog objects that represent separate symbol
+databases. Catalogs can be created/loaded/unloaded dynamically.
+To find a symbol in the repository each catalog should be queried.
+
+Persistent symbol store is useful to keep information about code that
+never or rarely changes. System libraries are perfect examples of such code.
+Symbols from code contained in project files are better stored in memory
+symbol store like @ref CodeModel.
+*/
+class KDevCodeRepository : public QObject
+{
+ Q_OBJECT
+public:
+ /**Constructor.*/
+ KDevCodeRepository();
+ /**Destructor.*/
+ virtual ~KDevCodeRepository();
+
+ /**@return The main catalog. Each catalog can be marked is main
+ to provide easy access to it.*/
+ Catalog* mainCatalog();
+ /**Sets the main catalog.
+ @param mainCatalog The catalog to be marked as main.*/
+ void setMainCatalog( Catalog* mainCatalog );
+
+ /**@return The list of registered catalogs.*/
+ QValueList<Catalog*> registeredCatalogs();
+
+ /**Registers catalog in the repository.
+ @param catalog The catalog to register.*/
+ void registerCatalog( Catalog* catalog );
+ /**Unregisters catalog from the repository.
+ @param catalog The catalog to unregister.*/
+ void unregisterCatalog( Catalog* catalog );
+ /**Marks catalog as changed and emits @ref catalogChanged signal.
+ @param catalog The catalog to touch.*/
+ void touchCatalog( Catalog* catalog );
+
+signals:
+ /**Emitted when a new catalog is registered.
+ @param catalog The new catalog.*/
+ void catalogRegistered( Catalog* catalog );
+
+ /**Emitted when a catalog in removed
+ @param catalog The catalog that was removed.*/
+ void catalogUnregistered( Catalog* catalog );
+
+ /**Emitted when the contens of catalog is changed.
+ @param catalog Changed catalog.*/
+ void catalogChanged( Catalog* catalog );
+
+private:
+ KDevCodeRepositoryData* d;
+};
+
+#endif
diff --git a/lib/interfaces/kdevcore.cpp b/lib/interfaces/kdevcore.cpp
new file mode 100644
index 00000000..c10f9626
--- /dev/null
+++ b/lib/interfaces/kdevcore.cpp
@@ -0,0 +1,298 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "KDevCoreIface.h"
+#include "kdevcore.h"
+
+#include "urlutil.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class Context
+///////////////////////////////////////////////////////////////////////////////
+
+Context::Context()
+{
+}
+
+Context::~Context()
+{
+}
+
+bool Context::hasType( int aType ) const
+{
+ return aType == this->type();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class EditorContext
+///////////////////////////////////////////////////////////////////////////////
+
+class EditorContext::Private
+{
+public:
+ Private( const KURL &url, int line, int col, const QString &linestr,
+ const QString &wordstr )
+ : m_url(url), m_line(line), m_col(col),
+ m_linestr(linestr), m_wordstr(wordstr)
+ {
+ }
+
+ KURL m_url;
+ int m_line, m_col;
+ QString m_linestr, m_wordstr;
+};
+
+EditorContext::EditorContext( const KURL &url, int line, int col,
+ const QString &linestr, const QString &wordstr )
+ : Context(), d( new Private(url, line, col, linestr, wordstr) )
+{
+}
+
+EditorContext::~EditorContext()
+{
+ delete d;
+ d = 0;
+}
+
+int EditorContext::type() const
+{
+ return Context::EditorContext;
+}
+
+const KURL &EditorContext::url() const
+{
+ return d->m_url;
+}
+
+int EditorContext::line() const
+{
+ return d->m_line;
+}
+
+int EditorContext::col() const
+{
+ return d->m_col;
+}
+
+QString EditorContext::currentLine() const
+{
+ return d->m_linestr;
+}
+
+QString EditorContext::currentWord() const
+{
+ return d->m_wordstr;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileContext
+///////////////////////////////////////////////////////////////////////////////
+
+class FileContext::Private
+{
+public:
+ Private( const KURL::List &someURLs ) : m_urls(someURLs)
+ {
+ if (m_urls.count() == 0)
+ {
+ m_fileName = "INVALID-FILENAME";
+ m_isDirectory = false; // well, "true" should be ok too ...
+ }
+ else
+ {
+ m_fileName = m_urls[0].path();
+ m_isDirectory = URLUtil::isDirectory( m_urls[0] );
+ }
+ }
+ Private( const QString &fileName, bool isDirectory )
+ : m_fileName(fileName), m_isDirectory(isDirectory)
+ {
+ }
+
+ KURL::List m_urls;
+ /// \FIXME the following data members should be removed, but first other
+ // parts should be modified to comply with this change.
+ QString m_fileName;
+ bool m_isDirectory;
+};
+
+FileContext::FileContext( const KURL::List &someURLs )
+ : Context(), d( new Private(someURLs) )
+{
+}
+
+FileContext::~FileContext()
+{
+ delete d;
+ d = 0;
+}
+
+int FileContext::type() const
+{
+ return Context::FileContext;
+}
+
+const KURL::List &FileContext::urls() const
+{
+ return d->m_urls;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class DocumentationContext
+///////////////////////////////////////////////////////////////////////////////
+
+class DocumentationContext::Private
+{
+public:
+ Private( const QString &url, const QString &selection )
+ : m_url(url), m_selection(selection)
+ {
+ }
+
+ QString m_url;
+ QString m_selection;
+};
+
+DocumentationContext::DocumentationContext( const QString &url, const QString &selection )
+ : Context(), d( new Private(url, selection) )
+{
+}
+
+DocumentationContext::DocumentationContext( const DocumentationContext &aContext )
+ : Context(), d( 0 )
+{
+ *this = aContext;
+}
+
+DocumentationContext &DocumentationContext::operator=( const DocumentationContext &aContext)
+{
+ if (d) {
+ delete d; d = 0;
+ }
+ d = new Private( *aContext.d );
+ return *this;
+}
+
+DocumentationContext::~DocumentationContext()
+{
+ delete d;
+ d = 0;
+}
+
+int DocumentationContext::type() const
+{
+ return Context::DocumentationContext;
+}
+
+QString DocumentationContext::url() const
+{
+ return d->m_url;
+}
+
+QString DocumentationContext::selection() const
+{
+ return d->m_selection;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class CodeModelItemContext
+///////////////////////////////////////////////////////////////////////////////
+
+class CodeModelItemContext::Private
+{
+public:
+ Private( const CodeModelItem* item ) : m_item( item ) {}
+
+ const CodeModelItem* m_item;
+};
+
+CodeModelItemContext::CodeModelItemContext( const CodeModelItem* item )
+ : Context(), d( new Private(item) )
+{
+}
+
+CodeModelItemContext::~CodeModelItemContext()
+{
+ delete d;
+ d = 0;
+}
+
+int CodeModelItemContext::type() const
+{
+ return Context::CodeModelItemContext;
+}
+
+const CodeModelItem* CodeModelItemContext::item() const
+{
+ return d->m_item;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class ProjectModelItemContext
+///////////////////////////////////////////////////////////////////////////////
+
+class ProjectModelItemContext::Private
+{
+public:
+ Private( const ProjectModelItem* item ) : m_item( item ) {}
+
+ const ProjectModelItem* m_item;
+};
+
+ProjectModelItemContext::ProjectModelItemContext( const ProjectModelItem* item )
+ : Context(), d( new Private(item) )
+{
+}
+
+ProjectModelItemContext::~ProjectModelItemContext()
+{
+ delete d;
+ d = 0;
+}
+
+int ProjectModelItemContext::type() const
+{
+ return Context::ProjectModelItemContext;
+}
+
+const ProjectModelItem* ProjectModelItemContext::item() const
+{
+ return d->m_item;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// class KDevCore
+///////////////////////////////////////////////////////////////////////////////
+
+KDevCore::KDevCore( QObject *parent, const char *name )
+ : QObject( parent, name )
+{
+ new KDevCoreIface(this);
+}
+
+KDevCore::~KDevCore()
+{
+}
+
+#include "kdevcore.moc"
diff --git a/lib/interfaces/kdevcore.h b/lib/interfaces/kdevcore.h
new file mode 100644
index 00000000..cdc5ca87
--- /dev/null
+++ b/lib/interfaces/kdevcore.h
@@ -0,0 +1,387 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001-2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2001 Sandy Meier <smeier@kdevelop.org>
+ Copyright (C) 2002 Daniel Engelschalt <daniel.engelschalt@gmx.net>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2003 Harald Fernengel <harry@kdevelop.org>
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVCORE_H
+#define KDEVCORE_H
+
+/**
+@file kdevcore.h
+The interface to the application core and context menu classes.
+*/
+
+#include <qstringlist.h>
+#include <qdict.h>
+#include <qobject.h>
+
+#include <kurl.h>
+
+class KDialogBase;
+class KDevPlugin;
+class CodeModelItem;
+class ProjectModelItem;
+
+namespace KParts
+{
+ class Part;
+}
+
+class QStatusBar;
+class QPopupMenu;
+
+/**
+Base class for every context.
+Think of a Context-based class as "useful
+info associated to a context menu". Several context menu can be defined,
+each defining different information: because of these context menus being
+used in many modules, they are defined here.
+
+When context menu with a certain "context" associated appears, KDevelop core
+sends a notification signal and all plugins which receive this signal have
+the ability to add own items into the menu. For example, VCS plugin could
+add "commit" and "update" menu items to the context menu of a file.
+
+<b>How to use context from a plugin:</b>
+-# Create a popup menu in context menu event handler: @code KPopupMenu menu(this); @endcode
+-# Create a context: @code MyContext context(param). @endcode
+-# Fill a context menu: @code core()->fillContextMenu(&menu, &context); @endcode
+-# Show the popup menu: @code menu.exec(event->globalPos()); @endcode
+.
+In this example @em event is an object of QContextMenuEvent class which you have access
+to if you reimplement QWidget::contextMenuEvent method.
+
+<b>How to fill context menu from a plugin:</b>
+-# Create a @code contextMenu(QPopupMenu *, const Context *) @endcode slot in your plugin class.
+-# Connect KDevCore::contextMenu(QPopupMenu *, const Context *) signal to that slot in
+the constructor of your plugin:\n
+@code
+connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+@endcode
+-# Fill the menu in the slot you created, for example:\n
+@code
+if (context->hasType(Context::EditorContext))
+{
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ int id = popup->insertItem(i18n("My Menu Item 1"), this, SLOT(myMenuAction1()));
+ popup->setWhatsThis(id, i18n("What's this for my menu item 1"));
+}
+else if context->hasType(MyContext))
+{
+ int id = popup->insertItem(...
+ ...
+}
+...
+@endcode
+*/
+class Context
+{
+public:
+ /**Pre-defined context types. More may be added so it is possible to add custom
+ contexts. <strong>We reserve enum values until 1000 (yeah, it is one thousand )
+ for kdevelop official context types.</strong>*/
+ enum Type
+ {
+ EditorContext, /**<Editor context menu.*/
+ DocumentationContext, /**<Documentation browser context menu.*/
+ FileContext, /**<File context menu.*/
+ ProjectModelItemContext, /**<Project tree context menu.*/
+ CodeModelItemContext /**<Class tree context menu.*/
+ };
+
+ /**Implement this in the context so we can provide rtti.*/
+ virtual int type() const = 0;
+
+ /**@return The type of this Context, so clients can discriminate
+ between different file contexts.*/
+ virtual bool hasType(int type) const;
+
+protected:
+ /**Constructor.*/
+ Context();
+
+ /**Destructor.*/
+ virtual ~Context();
+};
+
+/**A context for the popup menu in the editor.*/
+class EditorContext: public Context
+{
+public:
+ /**Builds a context for an editor part.
+ @param url The url of a file in the editor.
+ @param line The line number where the cursor is.
+ @param col The column number where the cursor is.
+ @param linestr The content of the line where the cursor is.
+ @param wordstr The current word under the cursor.*/
+ EditorContext(const KURL &url, int line, int col,
+ const QString &linestr, const QString &wordstr);
+
+ /**Destructor.*/
+ virtual ~EditorContext();
+
+ virtual int type() const;
+
+ /**@return The url for the file which this context was invoked for.*/
+ const KURL &url() const;
+
+ /**@return The line number for the cursor position.*/
+ int line() const;
+
+ /**@return The column number for the cursor position.*/
+ int col() const;
+
+ /**@return A QString with the content of the line which this context was
+ invoked for.*/
+ QString currentLine() const;
+
+ /**@return A QString containing the word near to the cursor when this
+ context object was created.*/
+ QString currentWord() const;
+
+private:
+ class Private;
+ Private *d;
+
+ EditorContext( const EditorContext &);
+ EditorContext &operator=( const EditorContext &);
+};
+
+
+/**
+A context for the popup menu in the documentation browser widget.
+*/
+class DocumentationContext: public Context
+{
+public:
+
+ /**Builds a DocumentationContext.
+ @param url The URL that the context will be for.
+ @param selection Selected text.*/
+ DocumentationContext(const QString &url, const QString &selection );
+
+ /**Copy constructor.*/
+ DocumentationContext(const DocumentationContext &);
+ DocumentationContext &operator=(const DocumentationContext &);
+
+ /**Destructor.*/
+ virtual ~DocumentationContext();
+
+ virtual int type() const;
+
+ /**@return The url of the document this context was invoked for.*/
+ QString url() const;
+
+ /**@return The selected text in the document.*/
+ QString selection() const;
+
+private:
+ class Private;
+ Private *d;
+};
+
+/**
+A context for the popup menu in file views and other parts that show files.
+Context allows multiple selections of files.
+*/
+class FileContext : public Context
+{
+public:
+ /**Builds the file context using a @ref KURL::List
+ @param someURLs The list of selected files URLs.*/
+ FileContext(const KURL::List &someURLs);
+
+ /**Destructor.*/
+ virtual ~FileContext();
+
+ virtual int type() const;
+
+ /**@return A reference to the selected of URLs.*/
+ const KURL::List &urls() const;
+
+private:
+ class Private;
+ Private *d;
+
+ FileContext( const FileContext &);
+ FileContext &operator=( const FileContext &);
+};
+
+/**
+A context for the popup menu in class views.
+*/
+class CodeModelItemContext: public Context
+{
+public:
+ /**Builds the context.
+ @param item Selected code model item representation. Usually a symbol from the code
+ like class, function, etc.*/
+ CodeModelItemContext(const CodeModelItem* item);
+
+ /**Destructor.*/
+ virtual ~CodeModelItemContext();
+
+ virtual int type() const;
+
+ /**@return The code model item for the selected item.*/
+ const CodeModelItem* item() const;
+
+private:
+ class Private;
+ Private *d;
+
+ CodeModelItemContext( const CodeModelItemContext &);
+ CodeModelItemContext &operator=( const CodeModelItemContext &);
+};
+
+/**
+A context for the popup menu in project views.
+*/
+class ProjectModelItemContext : public Context
+{
+public:
+ /**Builds the context.
+ @param item The item to build the context from.*/
+ ProjectModelItemContext(const ProjectModelItem* item);
+
+ /**Destructor.*/
+ virtual ~ProjectModelItemContext();
+
+ virtual int type() const;
+
+ /**@return The code model item for the selected item.*/
+ const ProjectModelItem* item() const;
+
+private:
+ class Private;
+ Private *d;
+
+ ProjectModelItemContext( const ProjectModelItemContext &);
+ ProjectModelItemContext &operator=( const ProjectModelItemContext &);
+};
+
+
+
+
+/**
+A KDevCore class defines an object which takes care about the cooperation
+between the various plug-in which compose KDevelop.
+It defines:
+- signals that can be captured for menu customization;
+- notifications about opening / closing projects;
+- methods to access functionality of KDevelop core;
+- requests to fill project and global settings widgets;
+- etc.
+.
+*/
+class KDevCore: public QObject
+{
+ Q_OBJECT
+public:
+ /**Constructor
+ @param parent The QObject that's the parent of this class.
+ @param name The name of the class.*/
+ KDevCore(QObject *parent=0, const char *name=0);
+
+ /**Destructor.*/
+ virtual ~KDevCore();
+
+ /**Fills the context menu.
+ This method should be called by a part that wants to show a
+ context menu. The parameter @p context should be filled with
+ information about the context in which this happens (see
+ EditorContext, DocumentationContext, ClassContext, ...).
+ Essentially, this method emits the signal contextMenu()
+ which other parts can use to hook in.
+ @sa Context for a detailed explanation of context menu initializations and usage.
+ @param popup The popup menu to fill.
+ @param context The pointer to a Context object of this popup menu.*/
+ virtual void fillContextMenu(QPopupMenu *popup, const Context *context) = 0;
+
+ /**Closes the current project and open the new one. You cannot use the @ref KDevPlugin::project()
+ * method right after opening a new project, as it will return a null pointer.
+ *You must wait for the eventloop to be reentered, so use a signleshot timer
+ *to do the job needed after the project is opened or connect a slot to the
+ *@ref projectOpened signal.
+ * @param projectFileName The file name of the project to open.*/
+ virtual void openProject(const QString& projectFileName) = 0;
+
+ /**Marks the component as running (or not running). As long as at least one
+ component is running, the stop button is enabled. When it is pressed,
+ component get a stopButtonClicked(). This is usable for plugins which
+ run certain commands and want KDevelop core to be notified of that.
+ If core is notified, it can allow the user to stop(interrupt) the command
+ manually by means of stop button.
+ @param which The plugin to mark.
+ @param runs true if plugin is running something, false if it is not.*/
+ virtual void running(KDevPlugin *which, bool runs) = 0;
+
+signals:
+ /**Emitted after the core has done all initializations and
+ the main window has been shown.*/
+ void coreInitialized();
+
+ /**A project has been opened.*/
+ void projectOpened();
+
+ /**The project is about to be closed.*/
+ void projectClosed();
+
+ /**The language support part has been changed.*/
+ void languageChanged();
+
+ /**The user has clicked the stop button.
+ If all actions should be cancelled, pass 0 to @p which
+ @param which The KDevPlugin object to stop.*/
+ void stopButtonClicked(KDevPlugin *which);
+
+ /**A context menu has been requested somewhere. Components
+ may hook some entries into it. More information on the
+ context can be obtained by looking for the type of
+ @p context and casting it accordingly.
+ @sa Context for a detailed explanation of context menu initializations and usage.
+ @param popupMenu The popup menu to fill.
+ @param context The Context of this popup menu.*/
+ void contextMenu(QPopupMenu *popupMenu, const Context *context);
+
+ /**Expects that a configuration page for use in the
+ KDevelop settings dialog is created by the component.
+ The configuration page is not demand-loading, it will be created before
+ global settings dialog is shown. Use @ref ConfigWidgetProxy in your plugin
+ to create demand-loading configuration pages.
+ @param dlg The dialog which the configuration widget should be added to.*/
+ void configWidget(KDialogBase *dlg);
+
+ /**Expects that a configuration page for use in the
+ Project settings dialog is created by the component.
+ The configuration page is not demand-loading, it will be created before
+ project settings dialog is shown. Use @ref ConfigWidgetProxy in your plugin
+ to create demand-loading configuration pages.
+ @param dlg The dialog which the configuration widget should be added to.*/
+ void projectConfigWidget(KDialogBase *dlg);
+};
+
+#endif
diff --git a/lib/interfaces/kdevdesignerintegration.cpp b/lib/interfaces/kdevdesignerintegration.cpp
new file mode 100644
index 00000000..60dbd61b
--- /dev/null
+++ b/lib/interfaces/kdevdesignerintegration.cpp
@@ -0,0 +1,40 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevdesignerintegration.h"
+#include "kdevdesignerintegrationiface.h"
+
+class KDevDesignerIntegration::KDevDesignerIntegrationPrivate {
+public:
+ KDevDesignerIntegrationIface *m_iface;
+};
+
+KDevDesignerIntegration::KDevDesignerIntegration(QObject *parent, const char *name)
+ : QObject(parent, name)
+{
+ dptr = new KDevDesignerIntegrationPrivate();
+
+ dptr->m_iface = new KDevDesignerIntegrationIface(this);
+}
+
+KDevDesignerIntegration::~KDevDesignerIntegration()
+{
+ delete dptr;
+}
+
+#include "kdevdesignerintegration.moc"
diff --git a/lib/interfaces/kdevdesignerintegration.h b/lib/interfaces/kdevdesignerintegration.h
new file mode 100644
index 00000000..7e2c7fc5
--- /dev/null
+++ b/lib/interfaces/kdevdesignerintegration.h
@@ -0,0 +1,97 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVDESIGNERINTEGRATION_H
+#define KDEVDESIGNERINTEGRATION_H
+
+#include <designer.h>
+#include <qobject.h>
+#include <qdom.h>
+
+/**
+@file kdevdesignerintegration.h
+KDevelop designer integration interface.
+*/
+
+/**
+KDevelop designer integration interface.
+Designer integration object provides functionality which is used by integrated
+into KDevelop GUI designers:
+- adding/removing/editing functions (class methods);
+- opening form implementation files;
+- saving and loading designer integration settings.
+.
+
+Designer integration is a layer between visual form (GUI) designer of any type
+and the current language support. Usually designers create some kind of forms
+and allow developers to define actions which are executed upon some GUI events
+(for example, Qt Designer allows to define slots connected to GUI signals).
+The actual code with action implementations needs to be written by hand in source
+files. Designer integration captures such implementation requests and opens
+necessary files at desired line numbers and adds (edits, removes) code for implementations.
+
+For example, Qt Designer integration should be able to create an subclass for a form
+and reimplement slots defined in the form.
+*/
+class KDevDesignerIntegration : public QObject
+{
+Q_OBJECT
+public:
+ /**Constructor.
+ @param parent Parent object.
+ @param name Internal name.*/
+ KDevDesignerIntegration(QObject *parent = 0, const char *name = 0);
+ /**Destructor.*/
+ ~KDevDesignerIntegration();
+
+ /**Saves designer integration settings.*/
+ virtual void saveSettings(QDomDocument dom, QString path) = 0;
+ /**Loads designer integration settings.*/
+ virtual void loadSettings(QDomDocument dom, QString path) = 0;
+
+public slots:
+ /**Adds the implementation for a function.
+ @param formName The name of a GUI form.
+ @param function The function which needs to be implemented in the source.*/
+ virtual void addFunction(const QString &formName, KInterfaceDesigner::Function function) = 0;
+
+ /**Removes the implementation of a function.
+ @param formName The name of a GUI form.
+ @param function The function which needs to be removed from the source.*/
+ virtual void removeFunction(const QString &formName, KInterfaceDesigner::Function function) = 0;
+
+ /**Edites the implementation of a function.
+ @param formName The name of a GUI form.
+ @param oldFunction The function which needs to be edited from the source.
+ @param function The new function declaration.*/
+ virtual void editFunction(const QString &formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function) = 0;
+
+ /**Opens the function and jumps to the line number of its definition (declaration).
+ @param formName The name of a GUI form.
+ @param functionName The name of a function to find in the source.*/
+ virtual void openFunction(const QString &formName, const QString &functionName) = 0;
+
+ /**Opens the form source.
+ @param formName The name of a GUI form.*/
+ virtual void openSource(const QString &formName) = 0;
+ private:
+ class KDevDesignerIntegrationPrivate;
+ KDevDesignerIntegrationPrivate *dptr;
+};
+
+#endif
diff --git a/lib/interfaces/kdevdesignerintegrationiface.cpp b/lib/interfaces/kdevdesignerintegrationiface.cpp
new file mode 100644
index 00000000..459e3ee9
--- /dev/null
+++ b/lib/interfaces/kdevdesignerintegrationiface.cpp
@@ -0,0 +1,63 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Ian Reinhart Geiser <geiseri@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevdesignerintegrationiface.h"
+#include <designer.h>
+#include "kdevdesignerintegration.h"
+
+KDevDesignerIntegrationIface::KDevDesignerIntegrationIface(KDevDesignerIntegration *p)
+ : DCOPObject("GUIDesigner"), m_designer(p)
+{
+ //FIXME figure out what number our interface is...
+}
+
+
+KDevDesignerIntegrationIface::~KDevDesignerIntegrationIface()
+{
+}
+
+void KDevDesignerIntegrationIface::addFunction( const QString & formName, QString returnType, QString function, QString specifier, QString access, uint type )
+{
+ KInterfaceDesigner::Function f = {returnType, function, specifier, access, (KInterfaceDesigner::FunctionType)type };
+ m_designer->addFunction(formName, f);
+}
+
+void KDevDesignerIntegrationIface::removeFunction( const QString & formName, QString returnType, QString function, QString specifier, QString access, uint type )
+{
+ KInterfaceDesigner::Function f = {returnType, function, specifier, access, (KInterfaceDesigner::FunctionType)type };
+ m_designer->addFunction(formName, f);
+}
+
+void KDevDesignerIntegrationIface::editFunction( const QString & formName, QString oldReturnType, QString oldFunction, QString oldSpecifier, QString oldAccess, uint oldType, QString returnType, QString function, QString specifier, QString access, uint type )
+{
+ KInterfaceDesigner::Function fold = {oldReturnType, oldFunction, oldSpecifier, oldAccess, (KInterfaceDesigner::FunctionType)oldType };
+ KInterfaceDesigner::Function fnew = {returnType, function, specifier, access, (KInterfaceDesigner::FunctionType)type };
+ m_designer->editFunction(formName,fold,fnew);
+}
+
+void KDevDesignerIntegrationIface::openFunction( const QString & formName, const QString & functionName )
+{
+ m_designer->openFunction(formName,functionName);
+}
+
+void KDevDesignerIntegrationIface::openSource( const QString & formName )
+{
+ m_designer->openSource(formName);
+}
+
+
diff --git a/lib/interfaces/kdevdesignerintegrationiface.h b/lib/interfaces/kdevdesignerintegrationiface.h
new file mode 100644
index 00000000..38993f8f
--- /dev/null
+++ b/lib/interfaces/kdevdesignerintegrationiface.h
@@ -0,0 +1,49 @@
+/* I am drunk.
+ Copyright (C) 2005 Ian Reinhart Geiser <geiseri@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVDESIGNERINTEGRATIONIFACE_H
+#define KDEVDESIGNERINTEGRATIONIFACE_H
+
+#include <dcopobject.h>
+class KDevDesignerIntegration;
+/**
+The dcop interface for GUI designers in KDevelop.
+
+@author KDevelop Authors
+*/
+class KDevDesignerIntegrationIface : public DCOPObject
+{
+ K_DCOP
+public:
+ KDevDesignerIntegrationIface(KDevDesignerIntegration *p);
+
+ ~KDevDesignerIntegrationIface();
+k_dcop:
+ void addFunction(const QString &formName, QString returnType, QString function,QString specifier,QString access,uint type);
+ void removeFunction(const QString &formName, QString returnType, QString function,QString specifier,QString access,uint type);
+ void editFunction(const QString &formName, QString oldReturnType, QString oldFunction,
+ QString oldSpecifier,QString oldAccess,uint oldType,
+ QString returnType, QString function,QString specifier,QString access,uint type);
+ void openFunction(const QString &formName, const QString &functionName);
+ void openSource(const QString &formName);
+
+ private:
+ KDevDesignerIntegration *m_designer;
+};
+
+#endif
diff --git a/lib/interfaces/kdeveloplanguagesupport.desktop b/lib/interfaces/kdeveloplanguagesupport.desktop
new file mode 100644
index 00000000..217bfc44
--- /dev/null
+++ b/lib/interfaces/kdeveloplanguagesupport.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/LanguageSupport
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Language Support Interface
+Name[ca]=Interfície del suport de llenguatges per a KDevelop
+Name[da]=KDevelop grænseflade for sprogunderstøttelse
+Name[de]=Schnittstelle für Sprachunterstützung (KDevelop)
+Name[el]=Διασύνδεση υποστήριξης γλώσσας KDevelop
+Name[es]=Interfaz del soporte de lenguajes de KDevelop
+Name[et]=KDevelopi keeletoetuse liides
+Name[eu]=KDevelop-en lengoaien euskarrien interfazea
+Name[fa]=واسط پشتیبانی زبان KDevelop
+Name[fr]=Interface de prise en charge de langage de KDevelop
+Name[gl]=Interface de soporte de linguaxes de KDevelop
+Name[hi]=के-डेवलप भाषा समर्थन इंटरफ़ेस
+Name[hu]=KDevelop nyelvtámogatási felület
+Name[it]=Interfaccia KDevelop per il supporto di linguaggio
+Name[ja]=KDevelop 言語サポート インターフェース
+Name[nds]=KDevelop-Koppelsteed för Spraakünnerstütten
+Name[ne]=केडीई विकास भाषा समर्थन इन्टरफेस
+Name[nl]=KDevelop Interface voor taalondersteuning
+Name[pl]=Interfejs KDevelopa do obsługi języków
+Name[pt]=Interface de Suporte a Linguagens do KDevelop
+Name[pt_BR]=Interface de Suporte à Linguagem do KDevelop
+Name[ru]=Интерфейс языковой поддержки
+Name[sk]=KDevelop rozhranie pre podporu jazykov
+Name[sl]=Vmesnik jezikovne podpore za KDevelop
+Name[sr]=KDevelop-ов интерфејс за језичку подршку
+Name[sr@Latn]=KDevelop-ov interfejs za jezičku podršku
+Name[sv]=KDevelop gränssnitt för språkstöd
+Name[ta]=KDevelop மொழி ஆதரவான இடைவிளிம்பு
+Name[tg]=Интерфейс ёрӣ расони забонӣ
+Name[tr]=KDevelop Dil Desteği Arayüzü
+Name[zh_CN]=KDevelop 语言支持接口
+Name[zh_TW]=KDevelop 語言支援介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
diff --git a/lib/interfaces/kdevelopplugin.desktop b/lib/interfaces/kdevelopplugin.desktop
new file mode 100644
index 00000000..c1a9998c
--- /dev/null
+++ b/lib/interfaces/kdevelopplugin.desktop
@@ -0,0 +1,75 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/Plugin
+Name=KDevelop Plugin
+Name[br]=Lugent KDevelop
+Name[ca]=Connector per a KDevelop
+Name[da]=KDevelop plugin
+Name[de]=KDevelop-Modul
+Name[el]=Πρόσθετο KDevelop
+Name[es]=Complemento para KDevelop
+Name[et]=KDevelopi plugin
+Name[eu]=KDevelop plugin-a
+Name[fa]=وصلۀ KDevelop
+Name[fr]=Module externe de KDevelop
+Name[ga]=Breiseán KDevelop
+Name[gl]=Extensión para KDevelop
+Name[hi]=के-डेवलप प्लगइन
+Name[hu]=KDevelop-bővítőmodul
+Name[it]=Plugin di KDevelop
+Name[ja]=KDevelop プラグイン
+Name[nds]=KDevelop-Moduul
+Name[ne]=केडीई विकास प्लगइन
+Name[pl]=Wtyczka do KDevelopa
+Name[pt]='Plugin' do KDevelop
+Name[pt_BR]=Plug-in do KDevelop
+Name[ru]=Модуль KDevelop
+Name[sk]=KDevelop modul
+Name[sl]=Vstavek za KDevelop
+Name[sr]=Прикључак за KDevelop
+Name[sr@Latn]=Priključak za KDevelop
+Name[sv]=KDevelop insticksmodul
+Name[ta]=KDevelop சொருகு
+Name[tg]=Модули KDevelop
+Name[tr]=KDevelop Eklentisi
+Name[zh_CN]=KDevelop 插件
+Name[zh_TW]=KDevelop 外掛程式
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
+
+[PropertyDef::X-KDevelop-Scope]
+Type=QString
+
+[PropertyDef::X-KDevelop-Mode]
+Type=QString
+
+[PropertyDef::X-KDevelop-Plugin-Version]
+Type=QString
+
+[PropertyDef::X-KDevelop-Plugin-Homepage]
+Type=QString
+
+[PropertyDef::X-KDevelop-Plugin-License]
+Type=QString
+
+[PropertyDef::X-KDevelop-Plugin-BugsEmailAddress]
+Type=QString
+
+[PropertyDef::X-KDevelop-Plugin-Copyright]
+Type=QString
+
+# defines a list of properties which the plugin has
+# a profile will query all plugins for properties and will load only
+# those that have queried properties
+[PropertyDef::X-KDevelop-Properties]
+Type=QStringList
+
+# only important for project plugins, you can add a list of programming languages which are supported
+# the plugin will be loaded by default, if the project use this language
+[PropertyDef::X-KDevelop-ProgrammingLanguages]
+Type=QStringList
+
+[PropertyDef::X-KDevelop-Args]
+Type=QString
diff --git a/lib/interfaces/kdevelopproject.desktop b/lib/interfaces/kdevelopproject.desktop
new file mode 100644
index 00000000..e8cad380
--- /dev/null
+++ b/lib/interfaces/kdevelopproject.desktop
@@ -0,0 +1,40 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/Project
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Project Interface
+Name[ca]=Interfície de projecte per a KDevelop
+Name[da]=KDevelop projektgrænseflade
+Name[de]=Projekt-Schnittstelle (KDevelop)
+Name[el]=Διασύνδεση έργου KDevelop
+Name[es]=Interfaz de proyecto de KDevelop
+Name[et]=KDevelopi projektiliides
+Name[eu]=KDevelop-en proiektu interfazea
+Name[fa]=واسط پروژۀ KDevelop
+Name[fr]=Interface de projet de KDevelop
+Name[gl]=Interface de proxecto KDevelop
+Name[hi]=के-डेवलप परियोजना इंटरफ़ेस
+Name[hu]=KDevelop projektkezelő felület
+Name[it]=Interfaccia KDevelop di progetto
+Name[ja]=KDevelop プロジェクト インターフェース
+Name[nds]=KDevelop-Projektkoppelsteed
+Name[ne]=केडीई विकास परियोजना इन्टरफेस
+Name[nl]=KDevelop Projectinterface
+Name[pl]=Interfejs KDevelopa do projektu
+Name[pt]=Interface de Projecto do KDevelop
+Name[pt_BR]=Interface de Projeto do KDevelop
+Name[ru]=Интерфейс проекта
+Name[sk]=KDevelop rozhranie pre projekt
+Name[sl]=Projektni vmesnik v KDevelopu
+Name[sr]=KDevelop-ов интерфејс пројекта
+Name[sr@Latn]=KDevelop-ov interfejs projekta
+Name[sv]=KDevelop projektgränssnitt
+Name[ta]=KDevelop திட்ட இடைஇணைப்பு
+Name[tg]=Лоиҳаи интерфейс
+Name[tr]=KDevelop Proje Arayüzü
+Name[zh_CN]=KDevelop 工程接口
+Name[zh_TW]=KDevelop 專案介面
+
+# versioning - prevent DLL hell
+[PropertyDef::X-KDevelop-Version]
+Type=int
diff --git a/lib/interfaces/kdevgenericfactory.h b/lib/interfaces/kdevgenericfactory.h
new file mode 100644
index 00000000..581aa36a
--- /dev/null
+++ b/lib/interfaces/kdevgenericfactory.h
@@ -0,0 +1,91 @@
+/* This file is part of the KDE project
+ * Copyright (C) 2003 Harald Fernengel <harry@kdevelop.org>
+ * Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include <kgenericfactory.h>
+#include <kaboutdata.h>
+
+/**
+@file kdevgenericfactory.h
+KDevelop generic plugin factory.
+*/
+
+/**
+This class provides a generic implementation of a KLibFactory for
+use with KDevelop plugins.
+Usually it is convenient to use K_EXPORT_COMPONENT_FACTORY macro
+to create factories for KDevelop plugins. For example, for DummyPlugin
+the factory can be created (in dummyplugin.cpp file) as:
+@code
+typedef KDevGenericFactory<DummyPlugin> DummyPluginFactory;
+K_EXPORT_COMPONENT_FACTORY(libkdevdummyplugin, DummyPluginFactory( data ) )
+@endcode
+Data should be a const static object. This way it complies with the requirements
+for data objecs of KDevGenericFactory constructor.
+
+<b>Important:</b><br>
+There is no need to create @ref KAboutData objects. It is more useful to create
+a static const @ref KDevPluginInfo object which can be used also in the constructor
+of a plugin.
+
+For example, dummyplugin.cpp file could contain:
+@code
+#include <kdevplugininfo.h>
+
+static const KDevPluginInfo data("KDevDummyPlugin");
+typedef KDevGenericFactory<DummyPlugin> DummyPluginFactory;
+K_EXPORT_COMPONENT_FACTORY(libkdevdummyplugin, DummyPluginFactory( data ) )
+
+DummyPlugin::DummyPlugin(QObject *parent, const char *name, const QStringList & )
+ :KDevPlugin(&data, parent, name)
+{
+}
+@endcode
+
+In the example above the duplication of information is avoided as same @ref KDevPluginInfo
+objects are used for plugin and for plugin factory. This is possible because @ref KDevPluginInfo
+class has an operator to cast @ref KDevPluginInfo to @ref KAboutData.
+*/
+template <class T, class ParentType = QObject>
+class KDevGenericFactory: public KGenericFactory<T, ParentType>
+{
+public:
+ /**Constructor.
+ @param data A reference to KAboutData with an information about the plugin.
+ Data should have:
+ - plugin name as an application name;
+ - untranslated plugin generic name as a product name;
+ - license type number.
+ .
+ data object should live as long as factory lives.*/
+ KDevGenericFactory(KAboutData *data)
+ :KGenericFactory<T, ParentType>(data->appName()), aboutData(data)
+ {
+ }
+
+ /**Creates an instance.*/
+ KInstance *createInstance()
+ {
+ return new KInstance(aboutData);
+ }
+
+private:
+ KAboutData *aboutData;
+
+};
+
diff --git a/lib/interfaces/kdevlanguagesupport.cpp b/lib/interfaces/kdevlanguagesupport.cpp
new file mode 100644
index 00000000..3a0b7c9e
--- /dev/null
+++ b/lib/interfaces/kdevlanguagesupport.cpp
@@ -0,0 +1,166 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Alexander Dymo <adymo@kdevelop.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "codemodel.h"
+
+#include <kdebug.h>
+
+#include "kdevdesignerintegration.h"
+#include "kdevlanguagesupport.h"
+
+KDevLanguageSupport::KDevLanguageSupport(const KDevPluginInfo *info, QObject *parent, const char *name)
+ : KDevPlugin(info, parent, name ? name : "KDevLanguageSupport" )
+{
+}
+
+KDevLanguageSupport::~KDevLanguageSupport()
+{
+}
+
+KDevLanguageSupport::Features KDevLanguageSupport::features()
+{
+ return Features(0);
+}
+
+KMimeType::List KDevLanguageSupport::mimeTypes()
+{
+ return KMimeType::List();
+}
+
+QString KDevLanguageSupport::formatTag( const Tag& /*tag*/ )
+{
+ return QString::null;
+}
+
+QString KDevLanguageSupport::formatClassName(const QString &name)
+{
+ return name;
+}
+
+QString KDevLanguageSupport::unformatClassName(const QString &name)
+{
+ return name;
+}
+
+bool KDevLanguageSupport::shouldSplitDocument(const KURL &url)
+{
+ return false;
+}
+
+Qt::Orientation KDevLanguageSupport::splitOrientation() const
+{
+ return Qt::Vertical;
+}
+
+void KDevLanguageSupport::addClass()
+{
+}
+
+void KDevLanguageSupport::addMethod( ClassDom /*klass*/ )
+{
+}
+
+void KDevLanguageSupport::implementVirtualMethods( ClassDom /*klass*/ )
+{
+}
+
+void KDevLanguageSupport::addAttribute( ClassDom /*klass*/ )
+{
+}
+
+QStringList KDevLanguageSupport::subclassWidget(const QString& /*formName*/)
+{
+ return QStringList();
+}
+
+QStringList KDevLanguageSupport::updateWidget(const QString& /*formName*/, const QString& /*fileName*/)
+{
+ return QStringList();
+}
+
+QString KDevLanguageSupport::formatModelItem( const CodeModelItem *item, bool /*shortDescription*/ )
+{
+ return item->name();
+}
+
+void KDevLanguageSupport::addFunction( DesignerType type, const QString & formName, Function function )
+{
+// kdDebug() << "KDevLanguageSupport::addFunction: 1" << endl;
+ KDevDesignerIntegration *designerIntegration = designer(type);
+// kdDebug() << "KDevLanguageSupport::addFunction: 2" << endl;
+ if (!designerIntegration)
+ {
+// kdDebug() << "KDevLanguageSupport::addFunction: x" << endl;
+ return;
+ }
+// kdDebug() << "KDevLanguageSupport::addFunction: 3" << endl;
+ designerIntegration->addFunction(formName, function);
+// kdDebug() << "KDevLanguageSupport::addFunction: 4" << endl;
+}
+
+void KDevLanguageSupport::editFunction( DesignerType type, const QString & formName, Function oldFunction, Function function )
+{
+ KDevDesignerIntegration *designerIntegration = designer(type);
+ if (!designerIntegration)
+ return;
+ designerIntegration->editFunction(formName, oldFunction, function);
+}
+
+void KDevLanguageSupport::removeFunction( DesignerType type, const QString & formName, Function function )
+{
+ KDevDesignerIntegration *designerIntegration = designer(type);
+ if (!designerIntegration)
+ return;
+ designerIntegration->removeFunction(formName, function);
+}
+
+KDevDesignerIntegration * KDevLanguageSupport::designer( DesignerType // type
+ )
+{
+ return 0;
+}
+
+void KDevLanguageSupport::openFunction( DesignerType type, const QString & formName, const QString & functionName )
+{
+ KDevDesignerIntegration *designerIntegration = designer(type);
+ if (!designerIntegration)
+ return;
+ designerIntegration->openFunction(formName, functionName);
+}
+
+void KDevLanguageSupport::createAccessMethods( ClassDom // theClass
+ , VariableDom // theVariable
+ )
+{
+}
+
+void KDevLanguageSupport::openSource( DesignerType type, const QString & formName)
+{
+ KDevDesignerIntegration *designerIntegration = designer(type);
+ if (!designerIntegration)
+ return;
+ designerIntegration->openSource(formName);
+}
+
+#include "kdevlanguagesupport.moc"
diff --git a/lib/interfaces/kdevlanguagesupport.h b/lib/interfaces/kdevlanguagesupport.h
new file mode 100644
index 00000000..06be2f26
--- /dev/null
+++ b/lib/interfaces/kdevlanguagesupport.h
@@ -0,0 +1,260 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVLANGUAGESUPPORT_H
+#define KDEVLANGUAGESUPPORT_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <kmimetype.h>
+#include "kdevplugin.h"
+#include "codemodel.h"
+#include <designer.h>
+
+/**
+@file kdevlanguagesupport.h
+Interface to programming language specific features.
+*/
+
+class Tag;
+class KDevDesignerIntegration;
+
+using namespace KInterfaceDesigner;
+
+/**
+KDevelop language support interface - the base class for all programming language support plugins.
+Language support is used to load facilities specific to certain programming language.
+Language supports are usually loaded among with a project. In this case project file defines
+which language support to load.
+
+Language support plugin is a good place for:
+- a language parser which fills memory and persistent symbol store
+(see @ref CodeModel and @ref KDevCodeRepository);
+- code wizards specific to a programming language (like new class wizard);
+- GUI designer integration (see @ref KDevLanguageSupport::designer method
+documentation and @ref KDevDesignerIntegration class documentation;
+- symbol (class, function, etc.) name formatting to a human-readable convention (pretty
+formatted name).
+.
+*/
+class KDevLanguageSupport: public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ /**Features supported by this language support.*/
+ enum Features {
+ /*features of the language itself*/
+ Classes=1 /**<Language has classes (or class-like packages).*/,
+ Structs=2 /**<Language has structures or records.*/,
+ Functions=4 /**<Language has functions.*/,
+ Variables=8 /**<Language has variables.*/,
+
+ Namespaces=16 /**<Language has namespaces.*/,
+ Signals=32 /**<Language has signals (or qt library bindings are available).*/,
+ Slots=64 /**<Language has slots (or qt library bindings are available).*/,
+ Declarations=128 /**<Language has function declarations (like c, c++ and pascal).*/,
+
+ /*features of the language support part*/
+ NewClass=512 /**<Language support can create classes.*/,
+ AddMethod=1024 /**<Language support can create methods.*/,
+ AddAttribute=2048 /**<Language support can create class attributes.*/,
+ CreateAccessMethods=4096 /**<Language support can create get/set methods for attributes.*/
+ };
+
+ /**Constructs a language support plugin.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevLanguageSupport(const KDevPluginInfo *info, QObject *parent, const char *name);
+ /**Destructor.*/
+ ~KDevLanguageSupport();
+
+ /**@return The feature set of the language. This is e.g. used
+ by the class view to decide which organizer items to display and which not.*/
+ virtual Features features();
+
+ /**@return A typical mimetype list for the support language, this list
+ should be configurable in the languagesupport dialog.*/
+ virtual KMimeType::List mimeTypes();
+
+ /**Formats a Tag as used by the persistent symbol store to the human-readable convention.
+ @param tag Tag to format.*/
+ virtual QString formatTag(const Tag& tag);
+
+ /**Formats a CodeModelItem as used by the CodeModel to the human-readable convention.
+ @param item Symbol to format.
+ @param shortDescription Show short description of a symbol. For example, when
+ formatting functions short description could be a function signature without
+ the return type and argument default values.*/
+ virtual QString formatModelItem(const CodeModelItem *item, bool shortDescription=false);
+
+ /**Formats a canonicalized class path as used by the symbol store to the
+ human-readable convention. For example, the C++ support part formats the
+ string "KParts.Part" into "KParts::Part".
+ @param name Class name.*/
+ virtual QString formatClassName(const QString &name);
+
+ /**The opposite of @ref formatClassName. Reverts formatting.
+ @param name Class name.*/
+ virtual QString unformatClassName(const QString &name);
+
+ /**Determines whether the document should be opened in a split view. The
+ language part can determine this internally and then set the active document
+ and if so, set the active document so that the newly opened one will be split
+ with it.
+ @param name URL of the document in question.*/
+ virtual bool shouldSplitDocument( const KURL &url );
+
+ /**Returns the language parts Split View orientation.
+ By default Qt::Vertical.*/
+ virtual Qt::Orientation splitOrientation() const;
+
+ /**Opens a "New class" dialog and adds the configured class to the sources.
+ Define NewClass feature if you reimplement this method.*/
+ virtual void addClass();
+
+ /**Opens an "Add method" dialog and adds the configured method to the sources.
+ Define AddMethod feature if you reimplement this method.
+ @param klass The class DOM to add a method to.*/
+ virtual void addMethod(ClassDom klass);
+
+ /**Opens an "Implement Virtual Methods" dialog and adds the configured methods
+ to the sources. Define AddMethod feature if you reimplement this method.
+ @param klass The class DOM to add a virtual method to.*/
+ virtual void implementVirtualMethods(ClassDom klass);
+
+ /**Opens an "Add attribute" dialog and adds the configured attribute to the sources.
+ Define AddAttribute feature if you reimplement this method.
+ @param klass The class DOM to add an attribute to.*/
+ virtual void addAttribute(ClassDom klass);
+
+ /**
+ * Opens an "create get/set methods" dialog and adds the configured methods to the sources.
+ * Define CreateAccessMethods feature if you reimplement this method.
+ * @param theClass The class the methods should be added to.
+ * @param theVariable The attribute the access methods should be generated for.
+ */
+ virtual void createAccessMethods(ClassDom theClass, VariableDom theVariable);
+
+ /**Opens an "Subclass Widget" dialog for given Qt .ui file (formName)
+ and propmts to implement it's slots.
+ @param formName The name of a form to subclass.
+ @return A list of newly created files.*/
+ virtual QStringList subclassWidget(const QString& formName);
+
+ /**Opens an "Update Widget" dialog for given Qt .ui file (formName)
+ and prompts to add missing slot implementations
+ in the subclass located in fileName.
+ @param formName The name of a form which is being subclassed.
+ @param fileName The name of a file with a subclass.
+ @return A list of updated files. Can be empty because usually no additional
+ actions are required on updated files.*/
+ virtual QStringList updateWidget(const QString& formName, const QString& fileName);
+
+ /**Reimplement this method if you want to use integrated GUI designer for the language.
+ Implementation could look like (in pseudo code):
+ @code
+ KDevDesignerIntegration *des = 0;
+ switch (type)
+ {
+ case KInterfaceDesigner::QtDesigner:
+ des = getDesignerFromCache(type);
+ if (des == 0)
+ {
+ MyLanguageImplementationWidget *impl = new MyLanguageImplementationWidget(this);
+ des = new QtDesignerMyLanguageIntegration(this, impl);
+ des->loadSettings(*project()->projectDom(), "kdevmylangsupport/designerintegration");
+ saveDesignerToCache(type, des);
+ }
+ break;
+ }
+ return des;
+ @endcode
+ @ref ImplementationWidget and @ref QtDesignerIntegration classes are available
+ from designerintegration support library.
+ @param type The type of the designer to integrate.
+ @return The pointer to designer integration of given type or 0.*/
+ virtual KDevDesignerIntegration *designer(KInterfaceDesigner::DesignerType type);
+
+public slots:
+ /**Adds a function requested by a GUI designer. No need to reimplement this slot
+ unless you want to use specific implementation of KDevDesignerIntegration interface.
+ @param type The type of integrated designer.
+ @param formName The name of a GUI form.
+ @param function The function to implement (add).*/
+ void addFunction(DesignerType type, const QString &formName, Function function);
+
+ /**Removes a function requested by a GUI designer. No need to reimplement this slot
+ unless you want to use specific implementation of KDevDesignerIntegration interface.
+ @param type The type of integrated designer.
+ @param formName The name of a GUI form.
+ @param function The function to remove.*/
+ void removeFunction(DesignerType type, const QString &formName, Function function);
+
+ /**Edits a function requested by a GUI designer. No need to reimplement this slot
+ unless you want to use specific implementation of KDevDesignerIntegration interface.
+ @param type The type of integrated designer.
+ @param formName The name of a GUI form.
+ @param oldFunction The old function signature before editing.
+ @param function The new function signature after editing.*/
+ void editFunction(DesignerType type, const QString &formName, Function oldFunction, Function function);
+
+ /**Opens a function requested by a GUI designer. No need to reimplement this slot
+ unless you want to use specific implementation of KDevDesignerIntegration interface.
+ @param type The type of integrated designer.
+ @param formName The name of a GUI form.
+ @param functionName The name of a function to seek in the code for.*/
+ void openFunction(DesignerType type, const QString &formName, const QString &functionName);
+
+ /**Opens a form source requested by a GUI designer. No need to reimplement this slot
+ unless you want to use specific implementation of KDevDesignerIntegration interface.
+ @param type The type of integrated designer.
+ @param formName The name of a GUI form.*/
+ void openSource(DesignerType type, const QString &formName);
+
+signals:
+ /**Emitted when the content of the memory symbol store has been modified.*/
+ void updatedSourceInfo();
+
+ /**Emitted before removing the file from the memory symbol store.*/
+ void aboutToRemoveSourceInfo(const QString& fileName);
+
+ /**Emitted when a file has been removed from the memory symbol store.*/
+ void removedSourceInfo(const QString& fileName);
+
+ /**Emitted when a file has been added to the memory symbol store.*/
+ void addedSourceInfo( const QString& fileName );
+
+ /**Emitted when the language part changes the Split View orientation.*/
+ void splitOrientationChanged( Qt::Orientation orientation );
+};
+
+#endif
diff --git a/lib/interfaces/kdevmainwindow.cpp b/lib/interfaces/kdevmainwindow.cpp
new file mode 100644
index 00000000..e54b616e
--- /dev/null
+++ b/lib/interfaces/kdevmainwindow.cpp
@@ -0,0 +1,28 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevmainwindow.h"
+
+#include <kmainwindow.h>
+#include <kstatusbar.h>
+
+KStatusBar *KDevMainWindow::statusBar()
+{
+ return main()->statusBar();
+}
diff --git a/lib/interfaces/kdevmainwindow.h b/lib/interfaces/kdevmainwindow.h
new file mode 100644
index 00000000..3e2553b3
--- /dev/null
+++ b/lib/interfaces/kdevmainwindow.h
@@ -0,0 +1,101 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 John Firebaugh <jfirebaugh@kde.org>
+ Copyright (C) 2003 Amilcar do Carmo Lucas <amilcar@ida.ing.tu-bs.de>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEV_MAINWINDOW_H
+#define KDEV_MAINWINDOW_H
+
+#include <qstring.h>
+
+class QWidget;
+class KStatusBar;
+class KMainWindow;
+
+/**
+@file kdevmainwindow.h
+KDevelop main window interface.
+*/
+
+/**
+KDevelop main window interface.
+Provides methods to control the main window of an application.
+*/
+class KDevMainWindow
+{
+public:
+ /**Destroys the main window*/
+ virtual ~KDevMainWindow() {} // must be virtual!
+
+ /**Embeds a view of a part into the main window.
+ @param view The view to embed. Must be a KPart.
+ @param title The title of a view.
+ @param toolTip The tooltip of a view.*/
+ virtual void embedPartView(QWidget *view, const QString &title, const QString& toolTip = QString::null) = 0;
+
+ /**Embeds a toolview at the left of the main window.
+ @param view The view to embed. Must be a KPart.
+ @param title The title of a view.
+ @param toolTip The tooltip of a view.*/
+ virtual void embedSelectView(QWidget *view, const QString &title, const QString &toolTip) = 0;
+
+ /**Embeds a toolview at the bottom of the main window.
+ @param view The view to embed. Must be a KPart.
+ @param title The title of a view.
+ @param toolTip The tooltip of a view.*/
+ virtual void embedOutputView(QWidget *view, const QString &title, const QString &toolTip) = 0;
+
+ /**Embeds a toolview at the right of the main window.
+ @param view The view to embed. Must be a KPart.
+ @param title The title of a view.
+ @param toolTip The tooltip of a view.*/
+ virtual void embedSelectViewRight(QWidget* view, const QString& title, const QString &toolTip) = 0;
+
+ /**Removes a view from the main window.
+ @param view The view to remove.*/
+ virtual void removeView(QWidget *view) = 0;
+
+ /**Shows or hides a view.
+ @param pView The view to show or hide.
+ @param bEnabled true if view should be shown, false it it is not.*/
+ virtual void setViewAvailable(QWidget *pView, bool bEnabled) = 0;
+
+ /**Raises a view (shows it if it was minimized).
+ @param view The view to be raised.*/
+ virtual void raiseView(QWidget *view) = 0;
+
+ /**Minimize a view.
+ @param view The view to be lowered.*/
+ virtual void lowerView(QWidget *view) = 0;
+
+ /**Loads main window settings.*/
+ virtual void loadSettings() = 0;
+
+ /**Sets the current document's caption, if applicable.
+ @param caption the caption to set.*/
+ virtual void setCurrentDocumentCaption( const QString &caption ) = 0;
+
+ /**@return KMainWindow object which actually represents the main window.*/
+ virtual KMainWindow *main() = 0;
+
+ /**@return KStatusBar object which actually represents the status bar in the main window.*/
+ KStatusBar *statusBar();
+};
+
+#endif
diff --git a/lib/interfaces/kdevpartcontroller.cpp b/lib/interfaces/kdevpartcontroller.cpp
new file mode 100644
index 00000000..66afa81f
--- /dev/null
+++ b/lib/interfaces/kdevpartcontroller.cpp
@@ -0,0 +1,30 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "KDevPartControllerIface.h"
+#include "kdevpartcontroller.h"
+#include "katedocumentmanagerinterface.h"
+
+KDevPartController::KDevPartController(QWidget *parent)
+ : KParts::PartManager(parent)
+{
+ new KDevPartControllerIface(this);
+ new KateDocumentManagerInterface(this);
+}
+
+#include "kdevpartcontroller.moc"
diff --git a/lib/interfaces/kdevpartcontroller.h b/lib/interfaces/kdevpartcontroller.h
new file mode 100644
index 00000000..dced10ac
--- /dev/null
+++ b/lib/interfaces/kdevpartcontroller.h
@@ -0,0 +1,175 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Hamish Rodda <rodda@kde.org>
+ Copyright (C) 2003 Harald Fernengel <harry@kdevelop.org>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEV_PARTCONTROLLER_H
+#define KDEV_PARTCONTROLLER_H
+
+#include <kurl.h>
+#include <kparts/partmanager.h>
+#include <ktrader.h>
+
+/**
+@file kdevpartcontroller.h
+KDevelop part controller interface.
+*/
+
+namespace KParts
+{
+ class ReadOnlyPart;
+}
+
+/**Document state enum.*/
+enum DocumentState
+{
+ Clean, /**<Document is not touched.*/
+ Modified, /**<Document is modified inside a shell.*/
+ Dirty, /**<Document is modified by an external process.*/
+ DirtyAndModified /**<Document is modified inside a shell and at the same time by an external process.*/
+};
+
+/**
+Interface to control loaded parts and other documents.
+Part controller works with embedded into the shell parts. Such parts are usually editors,
+GUI designers, etc.
+*/
+class KDevPartController: public KParts::PartManager
+{
+ Q_OBJECT
+
+public:
+ /**Constructor.
+ @param parent The parent object.*/
+ KDevPartController(QWidget *parent);
+
+ /**Call this before a call to @ref editDocument to set the encoding of the
+ document to be opened.
+ @param encoding The encoding to open as.*/
+ virtual void setEncoding(const QString &encoding) = 0;
+
+ /**Opens a new or existing document.
+ @param url The URL of the document to open.
+ @param lineNum The line number to place the cursor at, if applicable.
+ @param col The column number to place the cursor at, if applicable.*/
+ virtual void editDocument(const KURL &url, int lineNum=-1, int col=-1) = 0;
+
+ /**Opens a new or existing document by splitting the view with the current,
+ if applicable. Offers split views of source code and header files for instance.
+ @param url The URL of the document to open.
+ @param lineNum The line number to place the cursor at, if applicable.
+ @param col The column number to place the cursor at, if applicable.*/
+ virtual void splitCurrentDocument(const KURL &url, int lineNum=-1, int col=-1) = 0;
+
+ /**Scrolls the viewport of the already opened document to the specified line
+ and column if applicable, but does not give focus to the document.
+ @param url The URL of the already opened document.
+ @param lineNum The line number to place the cursor at, if applicable.
+ @param col The column number to place the cursor at, if applicable.*/
+ virtual void scrollToLineColumn(const KURL &url, int lineNum=-1, int col=-1, bool storeHistory = false ) = 0;
+
+ /**Shows a HTML document in the documentation viewer.
+ @param url The URL of the document to view.
+ @param newWin If true, the new window will be created instead of using current.*/
+ virtual void showDocument(const KURL &url, bool newWin = false) = 0;
+
+ /**Embeds a part into the main area of the mainwindow.
+ @param part The part to embed.
+ @param name The name of the part.
+ @param shortDescription Currently not used.*/
+ virtual void showPart(KParts::Part* part, const QString& name, const QString& shortDescription ) = 0;
+
+ /**Finds the embedded part corresponding to a given URL.
+ @param url The URL of the document.
+ @return The corresponding part, 0 if not found.*/
+ virtual KParts::ReadOnlyPart *partForURL(const KURL & url) = 0;
+
+ /**Finds the embedded part corresponding to a given main widget
+ @param widget The parts main widget.
+ @return The corresponding part, 0 if not found.*/
+ virtual KParts::Part *partForWidget(const QWidget *widget) = 0;
+
+ /**@return The list of open documents*/
+ virtual KURL::List openURLs() = 0;
+
+ /**Saves all open files.
+ @return false if it was cancelled by the user, true otherwise */
+ virtual bool saveAllFiles() = 0;
+
+ /**Saves a list of files.
+ @param list The list of URLs to save.
+ @return false if it was cancelled by the user, true otherwise */
+ virtual bool saveFiles(const KURL::List &list) = 0;
+
+ /**Reloads all open files.*/
+ virtual void revertAllFiles() = 0;
+
+ /**Reloads a list of files.
+ * @param list The list of URLs to reload.*/
+ virtual void revertFiles(const KURL::List &list) = 0;
+
+ /**Closes all open files.*/
+ virtual bool closeAllFiles() = 0;
+
+ /**Closes a list of files.
+ @param list The list of URLs for the files to close.*/
+ virtual bool closeFiles(const KURL::List &list) = 0;
+
+ /**Closes this part (closes the window/tab for this part).
+ @param part The part to close.
+ @return true if the part was sucessfuly closed.*/
+ virtual bool closePart(KParts::Part *part) = 0;
+
+ /**Activate this part.
+ @param part The part to activate.*/
+ virtual void activatePart( KParts::Part * part ) = 0;
+
+ /**Checks the state of a document.
+ @param url The URL to check.
+ @return The DocumentState enum corresponding to the document state.*/
+ virtual DocumentState documentState( KURL const & url ) = 0;
+
+signals:
+
+ /**Emitted when a document has been saved.*/
+ void savedFile(const KURL &);
+
+ /**Emitted when a document has been loaded.*/
+ void loadedFile(const KURL &);
+
+ /**Emitted when a document has been closed.*/
+ void closedFile(const KURL &);
+
+ /**Emitted when a file has been modified outside of KDevelop.*/
+ void fileDirty(const KURL &);
+
+ /**This is typically emitted when an editorpart does "save as"
+ which will change the part's URL.*/
+ void partURLChanged(KParts::ReadOnlyPart *);
+
+ /**This is emitted when the document changes,
+ either internally or on disc.*/
+ void documentChangedState(const KURL &, DocumentState);
+
+};
+
+#endif
diff --git a/lib/interfaces/kdevplugin.cpp b/lib/interfaces/kdevplugin.cpp
new file mode 100644
index 00000000..fa289ab8
--- /dev/null
+++ b/lib/interfaces/kdevplugin.cpp
@@ -0,0 +1,139 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2002 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.org>
+ Copyright (C) 2002 F@lk Brettschneider <falkbr@kdevelop.org>
+ Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevplugin.h"
+
+#include "kdevapi.h"
+#include "kdevcore.h"
+#include "kdevplugininfo.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugincontroller.h"
+
+#include <kaction.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include <qdom.h>
+#include <qmap.h>
+
+#include <assert.h>
+
+///////////////////////////////////////////////////////////////////////////////
+// struct KDevPlugin::Private
+///////////////////////////////////////////////////////////////////////////////
+
+struct KDevPlugin::Private
+{
+ const KDevPluginInfo *info;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class KDevPlugin
+///////////////////////////////////////////////////////////////////////////////
+
+KDevPlugin::KDevPlugin(const KDevPluginInfo *info, QObject *parent, const char *name)
+ :QObject(parent, name), d(new Private)
+{
+ assert(parent->inherits( "KDevApi" ));
+ m_api = static_cast<KDevApi *>( parent );
+
+ actionCollection()->setHighlightingEnabled( true );
+
+ d->info = info;
+ KGlobal::iconLoader()->addAppDir("kdevelop");
+}
+
+KDevPlugin::~KDevPlugin()
+{
+ delete( d );
+}
+
+KDevMainWindow *KDevPlugin::mainWindow()
+{
+ return m_api->mainWindow();
+}
+
+KDevCore *KDevPlugin::core() const
+{
+ return m_api->core();
+}
+
+KDevProject *KDevPlugin::project() const
+{
+ return m_api->project();
+}
+
+CodeModel *KDevPlugin::codeModel() const
+{
+ return m_api->codeModel();
+}
+
+QDomDocument *KDevPlugin::projectDom() const
+{
+ return m_api->projectDom();
+}
+
+KDevLanguageSupport *KDevPlugin::languageSupport() const
+{
+ return m_api->languageSupport();
+}
+
+KDevPartController *KDevPlugin::partController() const
+{
+ return m_api->partController();
+}
+
+KDevPluginController *KDevPlugin::pluginController() const
+{
+ return m_api->pluginController();
+}
+
+void KDevPlugin::restorePartialProjectSession(const QDomElement* /*el*/)
+{
+ // there's still nothing to do in the base class
+}
+
+void KDevPlugin::savePartialProjectSession(QDomElement* /*el*/)
+{
+ // there's still nothing to do in the base class
+}
+
+KDevCodeRepository * KDevPlugin::codeRepository() const
+{
+ return m_api->codeRepository();
+}
+
+KDevPlugin * KDevPlugin::extension_internal(const QString &serviceType, const QString &constraint)
+{
+ return m_api->pluginController()->extension(serviceType, constraint);
+}
+
+const KDevPluginInfo *KDevPlugin::info()
+{
+ return d->info;
+}
+
+#include "kdevplugin.moc"
diff --git a/lib/interfaces/kdevplugin.h b/lib/interfaces/kdevplugin.h
new file mode 100644
index 00000000..b65b411f
--- /dev/null
+++ b/lib/interfaces/kdevplugin.h
@@ -0,0 +1,200 @@
+/* This file is part of the KDE project
+ Copyright (C) 1999-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVPLUGIN_H
+#define KDEVPLUGIN_H
+
+#include <qobject.h>
+#include <kxmlguiclient.h>
+#include "kdevapi.h"
+
+class KDevCore;
+class KDevProject;
+class KDevVersionControl;
+class KDevLanguageSupport;
+class KDevPartController;
+class KDevMainWindow;
+class KDevCodeRepository;
+class CodeModel;
+class KDevPluginInfo;
+class QDomElement;
+
+/**
+@file kdevplugin.h
+KDevelop plugin interface.
+*/
+
+/**Current KDevelop plugin interface version. Interfaces declare plugin version to make sure
+old source (or binary) incompatible plugins are not loaded. Increase this if
+it is necessary that old plugins stop working.*/
+#define KDEVELOP_PLUGIN_VERSION 5
+
+/**
+The base class for all KDevelop plugins.
+Plugin is a component which is loaded into KDevelop shell at startup or by request.
+Each plugin should have corresponding .desktop file with a description.
+.desktop file template looks like:
+@code
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Name=
+GenericName=
+Comment=
+Icon=
+X-KDevelop-Plugin-Version=
+X-KDevelop-Plugin-Homepage=
+X-KDevelop-Plugin-BugsEmailAddress=
+X-KDevelop-Plugin-Copyright=
+X-KDE-Library=
+X-KDevelop-Version=
+X-KDevelop-Scope=
+X-KDevelop-Properties=
+X-KDevelop-Args=
+@endcode
+<b>Description of parameters in .desktop file:</b>
+- <i>Name</i> is a non-translatable name of a plugin, it is used in KTrader queries
+to search for a plugin (required);
+- <i>GenericName</i> is a translatable name of a plugin, it is used to show
+plugin names in GUI (required);
+- <i>Comment</i> is a short description about the plugin (optional);
+- <i>Icon</i> is a plugin icon (preferred);
+- <i>X-KDevelop-Plugin-Version</i> is a version of a plugin (optional);
+- <i>X-KDevelop-Plugin-Homepage</i> is a home page of a plugin (optional);
+- <i>X-KDevelop-Plugin-License</i> is a license (optional). can be: GPL, LGPL, BSD, Artistic,
+QPL or Custom. If this property is not set, license is considered as unknown;
+- <i>X-KDevelop-Plugin-BugsEmailAddress</i> is an email address for bug reports (optional);
+- <i>X-KDevelop-Plugin-Copyright</i> is a copyright statement (optional);
+- <i>X-KDE-Library</i> is a name of library which contains the plugin (required);
+- <i>X-KDevelop-Version</i> is a version of KDevelop interfaces which is supported by the plugin (required);
+- <i>X-KDevelop-Scope</i> is a scope of a plugin (see below for explanation) (required);
+- <i>X-KDevelop-Args</i> is a list of additional arguments passed to plugins constructor (optional);
+- <i>X-KDevelop-Properties</i> is a list of properties which this plugin supports, see @ref Profile class documentation for explanation (required to work with shells that support profiles).
+.
+Plugin scope can be either:
+- Core
+- Global
+- Project
+.
+Global plugins are plugins which require only shell to be loaded and do not operate on @ref KDevProject interface and/or do not use project wide information.\n
+Core plugins are global plugins which offer some important "core" functionality and thus
+are not selectable by user in plugin configuration pages.\n
+Project plugins require a project to be loaded and are usually loaded/unloaded among with the project.
+If your plugin use @ref KDevProject interface and/or operate on project-related information then this is the project plugin.
+
+@sa KDevGenericFactory class documentation for an information about plugin instantiation
+and writing factories for plugins.
+
+@sa KDevCore class documentation for an information about features which are available to plugins
+from shell applications.
+*/
+class KDevPlugin: public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+
+public:
+ /**Constructs a plugin.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevPlugin(const KDevPluginInfo *info, QObject *parent, const char *name = 0);
+
+ /**Destructs a plugin.*/
+ virtual ~KDevPlugin();
+
+ /**Provides an information about the plugin.
+ @return KAboutData object which was initialized in the constructor.*/
+ const KDevPluginInfo* info();
+
+ /**@return A reference to the toplevel widget.*/
+ KDevMainWindow *mainWindow();
+
+ /**@return A reference to the application core - an object which provides
+ basic functionalities for inter-parts communications / cooperation.*/
+ KDevCore *core() const;
+
+ /**@return A reference to the current project component or 0 if no project is loaded.*/
+ KDevProject *project() const;
+
+ /**@return A reference to the language support component or 0 if no support available.*/
+ KDevLanguageSupport *languageSupport() const;
+
+ /**@return A reference to the memory symbol store.*/
+ CodeModel *codeModel() const;
+
+ /**@return A reference to the DOM tree that represents the project file or 0 if no project is loaded.*/
+ QDomDocument *projectDom() const;
+
+ /**@return A reference to the part controller which is used to manipulate loaded KParts.*/
+ KDevPartController *partController() const;
+
+ /**@return A reference to the plugin controller which is used to manipulate loaded plugin.*/
+ virtual KDevPluginController *pluginController() const;
+
+ /**@return A reference to the code repository (accessor to persistent symbol stores).*/
+ KDevCodeRepository* codeRepository() const;
+
+ /**Queries for the plugin which supports given service type (such plugins are called extensions in KDevelop).
+ All already loaded plugins will be queried and the <b>first loaded one</b> to support
+ the service type will be returned. Any plugin can be an extension, only "ServiceTypes=..."
+ entry is required in .desktop file for that plugin.
+
+ Template argument is used as a type to cast the result to. This is done because extension
+ is usually derived from a certain base class and not directly from KDevPlugin.
+ @param serviceType The service type of an extension (like "KDevelop/SourceFormatter").
+ @param constraint The constraint which is applied when quering for the service. This
+ constraint is a usual KTrader constraint statement (like "[X-KDevelop-Foo]=='MyFoo'").
+ @return A KDevelop extension plugin for given service type or 0 if no plugin supports it*/
+ template <class Extension>
+ Extension *extension(const QString &serviceType, const QString &constraint = "")
+ {
+ return static_cast<Extension*>(extension_internal(serviceType, constraint));
+ }
+
+ /**Override this base class method to restore any settings which differs from project to project.
+ Data can be read from a certain subtree of the project session file.
+ During project loading, respectively project session (.kdevses) loading,
+ this method will be called to give a chance to adapt the plugin to
+ the newly loaded project. For instance, the debugger plugin might restore the
+ list of breakpoints from the previous debug session for the certain project.
+ @note Take attention to the difference to common not-project-related session stuff.
+ They belong to the application rc file (kdeveloprc)
+ @note Project session file is useful for settings which cannot be shared between
+ developers. If a setting should be shared, modify projectDom instead.
+ @param el The parent DOM element for plugins session settings.*/
+ virtual void restorePartialProjectSession(const QDomElement* el);
+
+ /**Saves session settings.
+ @sa restorePartialProjectSession - this is the other way round, the same just for saving.*/
+ virtual void savePartialProjectSession(QDomElement* el);
+
+private:
+ KDevPlugin *extension_internal(const QString &serviceType, const QString &constraint = "");
+
+ KDevApi *m_api;
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/lib/interfaces/kdevplugincontroller.cpp b/lib/interfaces/kdevplugincontroller.cpp
new file mode 100644
index 00000000..ca2321de
--- /dev/null
+++ b/lib/interfaces/kdevplugincontroller.cpp
@@ -0,0 +1,49 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevplugincontroller.h"
+
+#include "kdevplugin.h"
+
+KDevPluginController::KDevPluginController()
+{
+}
+
+KTrader::OfferList KDevPluginController::query(const QString &serviceType,
+ const QString &constraint)
+{
+ return KTrader::self()->query(serviceType,
+ QString("%1 and [X-KDevelop-Version] == %2").arg(constraint).arg(KDEVELOP_PLUGIN_VERSION));
+}
+
+KTrader::OfferList KDevPluginController::queryPlugins(const QString &constraint)
+{
+ return query("KDevelop/Plugin", constraint);
+}
+
+KURL::List KDevPluginController::profileResources(const QString &/*nameFilter*/)
+{
+ return KURL::List();
+}
+
+KURL::List KDevPluginController::profileResourcesRecursive(const QString &/*nameFilter*/)
+{
+ return KURL::List();
+}
+
+#include "kdevplugincontroller.moc"
diff --git a/lib/interfaces/kdevplugincontroller.h b/lib/interfaces/kdevplugincontroller.h
new file mode 100644
index 00000000..8bb70bd0
--- /dev/null
+++ b/lib/interfaces/kdevplugincontroller.h
@@ -0,0 +1,118 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVPLUGINCONTROLLER_H
+#define KDEVPLUGINCONTROLLER_H
+
+#include <qobject.h>
+
+#include <kurl.h>
+#include <ktrader.h>
+
+/**
+@file kdevplugincontroller.h
+KDevelop plugin controller interface.
+*/
+
+class KDevPlugin;
+class ProfileEngine;
+
+/**
+The base class for KDevelop plugin controller.
+Plugin controller is responsible for quering, loading and unloading available plugins.
+*/
+class KDevPluginController: public QObject
+{
+ Q_OBJECT
+public:
+
+ /**
+ * Returns a uniquely specified plugin. If it isn't already loaded, it will be.
+ * Use with caution! See extension for parameter details.
+ */
+ virtual KDevPlugin * loadPlugin( const QString & serviceType, const QString & constraint ) = 0;
+
+ /**
+ * Unloads the plugin specified by @p plugin
+ * @param plugin The plugin desktopEntryName of the plugin to unload
+ */
+ virtual void unloadPlugin( const QString & plugin ) = 0;
+
+ /**Unloads plugins specified by @p list.
+ @param list The list of plugin names to unload. plugin name corresponds
+ to the "Name" property in plugin .desktop file.*/
+ virtual void unloadPlugins(QStringList const &list) = 0;
+
+ /**@return The list of currently loaded plugins.*/
+ virtual const QValueList<KDevPlugin*> loadedPlugins() = 0;
+
+ /**Queries for the plugin which supports given service type.
+ All already loaded plugins will be queried and the first one to support the service type
+ will be returned. Any plugin can be an extension, only "ServiceTypes=..." entry is
+ required in .desktop file for that plugin.
+ @param serviceType The service type of an extension (like "KDevelop/SourceFormatter")
+ @param constraint The constraint which is applied when quering for the service. This
+ constraint is a usual KTrader constraint statement (like "[X-KDevelop-Foo]=='MyFoo'").
+ @return A KDevelop extension plugin for given service type or 0 if no plugin supports it*/
+ virtual KDevPlugin *extension(const QString &serviceType, const QString &constraint = "") = 0;
+
+ /**Queries KDevelop services. Version is checked automatically
+ by adding proper X-KDevelop-Version=N statement into the query.
+ @param serviceType The service type to query, for example "KDevelop/Plugin" or
+ "KDevelop/SourceFormatter."
+ @param constraint A constraint for the service. Do not include plugin version number - it
+ is done automatically.
+ @return The list of plugin offers.*/
+ static KTrader::OfferList query(const QString &serviceType, const QString &constraint);
+
+ /**Queries KDevelop plugins. Works like
+ KDevPluginController::query with serviceType set to "KDevelop/Plugin".
+ @param constraint A constraint for the service. Do not include plugin version number - it
+ is done automatically.
+ @return The list of plugin offers.*/
+ static KTrader::OfferList queryPlugins(const QString &constraint);
+
+ /**Reimplement this function only if your shell supports plugin profiles.
+ @return The list of URLs to the profile resources (files) with given @p extension.
+ @param nameFilter Name filter for files. @see QDir::setNameFilter documentation
+ for name filters syntax.*/
+ virtual KURL::List profileResources(const QString &nameFilter);
+
+ /**Reimplement this function only if your shell supports plugin profiles.
+ @return The list of URLs to the resources (files) with given @p extension.
+ This list is obtained by a recursive search that process given profile
+ and all it's subprofiles.
+ @param nameFilter Name filter for files. @see QDir::setNameFilter documentation
+ for name filters syntax.*/
+ virtual KURL::List profileResourcesRecursive(const QString &nameFilter);
+
+ /** @return The current Profile Engine */
+ virtual ProfileEngine &engine() = 0;
+
+signals:
+ /**Emitted when a plugin profile was changed (reloaded, other profile opened, etc.).
+ Should work only on shells with plugin profiles support.*/
+ void profileChanged();
+
+protected:
+ /**Constructor.*/
+ KDevPluginController();
+
+};
+
+#endif
diff --git a/lib/interfaces/kdevplugininfo.cpp b/lib/interfaces/kdevplugininfo.cpp
new file mode 100644
index 00000000..98f8d03d
--- /dev/null
+++ b/lib/interfaces/kdevplugininfo.cpp
@@ -0,0 +1,181 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevplugininfo.h"
+
+#include <qvariant.h>
+
+#include <kservice.h>
+#include <kdebug.h>
+
+#include "kdevplugincontroller.h"
+
+struct KDevPluginInfo::Private {
+ QString m_pluginName;
+ QString m_rawGenericName;
+
+ QString m_genericName;
+ QString m_description;
+ QString m_icon;
+
+ QString m_version;
+ int m_licenseType;
+ QString m_copyrightStatement;
+ QString m_homePageAddress;
+ QString m_bugsEmailAddress;
+
+ QValueList<KAboutPerson> m_authors;
+ QValueList<KAboutPerson> m_credits;
+
+ KAboutData *m_data;
+};
+
+
+KDevPluginInfo::KDevPluginInfo(const QString &pluginName)
+ :d(new Private())
+{
+ d->m_pluginName = pluginName;
+
+ KService::Ptr offer = KService::serviceByDesktopName(pluginName);
+ if (offer != 0)
+ {
+ d->m_genericName = offer->genericName();
+ d->m_icon = offer->icon();
+ d->m_description = offer->comment();
+
+ d->m_rawGenericName = offer->untranslatedGenericName();
+
+ d->m_version = offer->property("X-KDevelop-Plugin-Version").toString();
+ d->m_homePageAddress = offer->property("X-KDevelop-Plugin-Homepage").toString();
+ d->m_bugsEmailAddress = offer->property("X-KDevelop-Plugin-BugsEmailAddress").toString();
+ d->m_copyrightStatement = offer->property("X-KDevelop-Plugin-Copyright").toString();
+
+ QString lic = offer->property("X-KDevelop-Plugin-License").toString();
+ if (lic == "GPL")
+ d->m_licenseType = KAboutData::License_GPL;
+ else if (lic == "LGPL")
+ d->m_licenseType = KAboutData::License_LGPL;
+ else if (lic == "BSD")
+ d->m_licenseType = KAboutData::License_BSD;
+ else if (lic == "QPL")
+ d->m_licenseType = KAboutData::License_QPL;
+ else if (lic == "Artistic")
+ d->m_licenseType = KAboutData::License_Artistic;
+ else if (lic == "Custom")
+ d->m_licenseType = KAboutData::License_Custom;
+ else
+ d->m_licenseType = KAboutData::License_Unknown;
+
+ d->m_data = new KAboutData(d->m_pluginName.ascii(), d->m_rawGenericName.ascii(), "1", 0, d->m_licenseType);
+ }
+ else
+ kdDebug() << "Unable to load information for plugin: " << pluginName
+ << ". Check if " << pluginName << ".desktop exists." << endl;
+}
+
+
+KDevPluginInfo::operator KAboutData *() const
+{
+ return d->m_data;
+}
+
+QString KDevPluginInfo::pluginName() const
+{
+ return d->m_pluginName;
+}
+
+QString KDevPluginInfo::genericName() const
+{
+ return d->m_genericName;
+}
+
+QString KDevPluginInfo::icon() const
+{
+ return d->m_icon;
+}
+
+QString KDevPluginInfo::description() const
+{
+ return d->m_description;
+}
+
+QString KDevPluginInfo::version() const
+{
+ return d->m_version;
+}
+
+int KDevPluginInfo::licenseType() const
+{
+ return d->m_licenseType;
+}
+
+QString KDevPluginInfo::license() const
+{
+ KDevPluginInfo &info = *const_cast<KDevPluginInfo*>(this);
+// return KAboutData(info).license();
+ KAboutData *data = info;
+ return data->license();
+}
+
+QString KDevPluginInfo::copyrightStatement() const
+{
+ return d->m_copyrightStatement;
+}
+
+QString KDevPluginInfo::homePageAddress() const
+{
+ return d->m_homePageAddress;
+}
+
+QString KDevPluginInfo::bugsEmailAddress() const
+{
+ return d->m_bugsEmailAddress;
+}
+
+QVariant KDevPluginInfo::property(const QString &name) const
+{
+ KTrader::OfferList offers = KDevPluginController::queryPlugins(QString("Name='%1'").arg(d->m_pluginName));
+ if (offers.count() == 1)
+ return offers.first()->property(name);
+ return QVariant();
+}
+
+QVariant KDevPluginInfo::operator [](const QString &name) const
+{
+ return property(name);
+}
+
+QStringList KDevPluginInfo::propertyNames( ) const
+{
+ KTrader::OfferList offers = KDevPluginController::queryPlugins(QString("Name='%1'").arg(d->m_pluginName));
+ if (offers.count() == 1)
+ return offers.first()->propertyNames();
+ return QStringList();
+}
+
+void KDevPluginInfo::addAuthor(const char *name, const char *task,
+ const char *emailAddress, const char *webAddress)
+{
+ d->m_authors.append(KAboutPerson(name, task, emailAddress, webAddress));
+}
+
+void KDevPluginInfo::addCredit(const char *name, const char *task,
+ const char *emailAddress, const char *webAddress)
+{
+ d->m_credits.append(KAboutPerson(name, task, emailAddress, webAddress));
+}
diff --git a/lib/interfaces/kdevplugininfo.h b/lib/interfaces/kdevplugininfo.h
new file mode 100644
index 00000000..b8a2b954
--- /dev/null
+++ b/lib/interfaces/kdevplugininfo.h
@@ -0,0 +1,111 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVPLUGININFO_H
+#define KDEVPLUGININFO_H
+
+#include <qvariant.h>
+
+#include <kaboutdata.h>
+
+/**
+@file kdevplugininfo.h
+KDevelop plugin information container class.
+*/
+
+/**
+Information about KDevelop plugin.
+It uses plugin name to query plugin .desktop files and
+retrieve most information. Names of authors and credits to other people
+must be added manually using KDevPluginInfo::addAuthor and KDevPluginInfo::addCredit
+methods.
+@sa KDevPlugin class documentation for more information about .desktop files.
+*/
+class KDevPluginInfo
+{
+public:
+ /**Constructor.
+ @param pluginName A name of a plugin. Must be the same as the name of a .desktop file
+ and the same as the location of plugin resource files.*/
+ KDevPluginInfo(const QString &pluginName);
+
+ /**Casts KDevPluginInfo to KAboutData. Uses KDevPluginInfo::pluginName as KAboutData::appName,
+ KDevPluginInfo::rawGenericName as KAboutData::programName KDevPluginInfo::licenseType as KAboutData::licenseType. Other parameters are ignored.*/
+ operator KAboutData*() const;
+
+ /**@return A name of a plugin (always untranslated).*/
+ QString pluginName() const;
+ /**@return A generic name of a plugin (translated). Use this in GUI. Information is taken from .desktop file.*/
+ QString genericName() const;
+ /**@return An icon name of a plugin. Information is taken from .desktop file.*/
+ QString icon() const;
+ /**@return A description of a plugin. Information is taken from .desktop file.*/
+ QString description() const;
+ /**@return A version of a plugin. Information is taken from .desktop file.*/
+ QString version() const;
+ /**@return A license type of a plugin. Information is taken from .desktop file.*/
+ int licenseType() const;
+ /**@return A license text for known license types (GPL, LGPL, BSD, Artistic, QPL).*/
+ QString license() const;
+ /**@return A copyright statement of a plugin. Information is taken from .desktop file.*/
+ QString copyrightStatement() const;
+ /**@return A home page of a plugin. Information is taken from .desktop file.*/
+ QString homePageAddress() const;
+ /**@return A email address for bugs of a plugin. Information is taken from .desktop file.*/
+ QString bugsEmailAddress() const;
+
+ /**@param name The name of a property.
+ @return Any property value which exists in .desktop file.*/
+ QVariant property(const QString &name) const;
+ /**@param name The name of a property.
+ @return Any property value which exists in .desktop file.*/
+ QVariant operator [] (const QString &name) const;
+ /**@return A list of property names set in .desktop file.*/
+ QStringList propertyNames() const;
+
+ /**@return A list of plugin authors.*/
+ const QValueList<KAboutPerson> authors() const;
+ /**@return A list of other plugin contributors.*/
+ const QValueList<KAboutPerson> credits() const;
+
+ /**Adds an author to the list of authors.
+ You can call this function as many times you need. Each entry is appended to a list.
+ @param name The developer's name in UTF-8 encoding.
+ @param task What the person is responsible for. This text can contain newlines. It should be marked for translation like this: I18N_NOOP("Task description..."). Can be 0.
+ @param emailAddress An Email address where the person can be reached. Can be 0.
+ @param webAddress The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be 0.*/
+ void addAuthor(const char *name, const char *task,
+ const char *emailAddress = 0, const char *webAddress = 0);
+ /**Adds a contributor to the list of contributors.
+ You can call this function as many times you need. Each entry is appended to a list.
+ @param name The developer's name in UTF-8 encoding.
+ @param task What the person is responsible for. This text can contain newlines. It should be marked for translation like this: I18N_NOOP("Task description..."). Can be 0.
+ @param emailAddress An Email address where the person can be reached. Can be 0.
+ @param webAddress The person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be 0.*/
+ void addCredit(const char *name, const char *task = 0,
+ const char *emailAddress = 0, const char *webAddress = 0);
+
+private:
+ /**Returns the untranslated generic name of a plugin as set in .desktop file.*/
+ const char *rawGenericName() const;
+
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/lib/interfaces/kdevproject.cpp b/lib/interfaces/kdevproject.cpp
new file mode 100644
index 00000000..e4e3281d
--- /dev/null
+++ b/lib/interfaces/kdevproject.cpp
@@ -0,0 +1,164 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <kdebug.h>
+
+#include "kdevproject.h"
+#include <urlutil.h>
+#include <qfileinfo.h>
+#include <qtimer.h>
+#include "kdevprojectiface.h"
+
+struct KDevProject::Private {
+ QMap<QString, QString> m_absToRel;
+ QStringList m_symlinkList;
+ QTimer *m_timer;
+ KDevProjectIface *m_iface;
+};
+
+KDevProject::KDevProject(const KDevPluginInfo *info, QObject *parent, const char *name)
+ : KDevPlugin(info, parent, name), d(new KDevProject::Private())
+{
+ connect( this, SIGNAL(addedFilesToProject(const QStringList& )), this, SLOT(buildFileMap()) );
+ connect( this, SIGNAL(removedFilesFromProject(const QStringList& )), this, SLOT(buildFileMap()) );
+
+ connect( this, SIGNAL(addedFilesToProject(const QStringList& )), this, SLOT(slotAddFilesToFileMap(const QStringList& )) );
+ connect( this, SIGNAL(removedFilesFromProject(const QStringList& )), this, SLOT(slotRemoveFilesFromFileMap(const QStringList& )) );
+
+ d->m_timer = new QTimer(this);
+ connect(d->m_timer, SIGNAL(timeout()), this, SLOT(slotBuildFileMap()));
+ d->m_iface = new KDevProjectIface(this);
+}
+
+KDevProject::~KDevProject()
+{
+ d->m_timer->stop();
+ delete d->m_iface;
+ delete d->m_timer;
+ delete d;
+}
+
+void KDevProject::changedFile( const QString & fileName )
+{
+ QStringList fileList;
+ fileList.append ( fileName );
+
+ emit changedFilesInProject( fileList );
+
+}
+
+void KDevProject::changedFiles( const QStringList & fileList )
+{
+ emit changedFilesInProject( fileList );
+}
+
+KDevProject::Options KDevProject::options() const
+{
+ return (KDevProject::Options)0;
+}
+
+bool KDevProject::isProjectFile( const QString & absFileName )
+{
+ return d->m_absToRel.contains( absFileName );
+}
+
+QString KDevProject::relativeProjectFile( const QString & absFileName )
+{
+ if( isProjectFile(absFileName) )
+ return d->m_absToRel[ absFileName ];
+ return QString::null;
+}
+
+void KDevProject::buildFileMap()
+{
+ d->m_timer->stop();
+ d->m_timer->start(0, true);
+}
+
+void KDevProject::slotBuildFileMap()
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ d->m_absToRel.clear();
+ d->m_symlinkList.clear();
+ const QStringList fileList = allFiles();
+ for( QStringList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it )
+ {
+ QFileInfo fileInfo( projectDirectory() + "/" + *it );
+ d->m_absToRel[ URLUtil::canonicalPath(fileInfo.absFilePath()) ] = *it;
+
+ if ( URLUtil::canonicalPath( fileInfo.absFilePath() ) != fileInfo.absFilePath() )
+ {
+ d->m_symlinkList << *it;
+ }
+ }
+}
+
+void KDevProject::openProject( const QString & /*dirName*/, const QString & /*projectName*/ )
+{
+ buildFileMap();
+}
+
+QStringList KDevProject::symlinkProjectFiles( )
+{
+ return d->m_symlinkList;
+}
+
+QString KDevProject::defaultRunDirectory(const QString& projectPluginName) const
+{
+ return DomUtil::readEntry(*projectDom(), "/" + projectPluginName + "/run/globalcwd");
+}
+
+void KDevProject::slotAddFilesToFileMap( const QStringList & fileList )
+{
+ QStringList::ConstIterator it = fileList.begin();
+ while( it != fileList.end() )
+ {
+ QFileInfo fileInfo( projectDirectory() + "/" + *it );
+ d->m_absToRel[ URLUtil::canonicalPath(fileInfo.absFilePath()) ] = *it;
+
+ if ( URLUtil::canonicalPath( fileInfo.absFilePath() ) != fileInfo.absFilePath() )
+ {
+ d->m_symlinkList << *it;
+ }
+
+ ++it;
+ }
+}
+
+void KDevProject::slotRemoveFilesFromFileMap( const QStringList & fileList )
+{
+ QStringList::ConstIterator it = fileList.begin();
+ while( it != fileList.end() )
+ {
+ QFileInfo fileInfo( projectDirectory() + "/" + *it );
+ d->m_absToRel.remove( URLUtil::canonicalPath(fileInfo.absFilePath()) );
+
+ d->m_symlinkList.remove( *it );
+
+ ++it;
+ }
+}
+
+#include "kdevproject.moc"
diff --git a/lib/interfaces/kdevproject.h b/lib/interfaces/kdevproject.h
new file mode 100644
index 00000000..64c8ed80
--- /dev/null
+++ b/lib/interfaces/kdevproject.h
@@ -0,0 +1,218 @@
+/* This file is part of the KDE project
+ Copyright (C) 2001 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
+ Copyright (C) 2001-2002 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2002-2003 Roberto Raggi <roberto@kdevelop.org>
+ Copyright (C) 2002 Simon Hausmann <hausmann@kde.org>
+ Copyright (C) 2003 Jens Dagerbo <jens.dagerbo@swipnet.se>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+ Copyright (C) 2003-2004 Alexander Dymo <adymo@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVPROJECT_H
+#define KDEVPROJECT_H
+
+#include "kdevplugin.h"
+#include "domutil.h"
+
+#include <qstringlist.h>
+#include <qmap.h>
+
+/**
+@file kdevproject.h
+KDevelop project interface.
+*/
+
+class QTimer;
+
+/**
+KDevelop project interface.
+Plugins implementing the KDevProject interfaces are used to manage projects.
+
+Project can be considered as a way of grouping files (in text editors) or
+as a way of providing support for a build system (like it is done in KDevelop IDE buildtools).
+*/
+class KDevProject: public KDevPlugin
+{
+ Q_OBJECT
+public:
+ /**Constructs a project plugin.
+ @param info Important information about the plugin - plugin internal and generic
+ (GUI) name, description, a list of authors, etc. That information is used to show
+ plugin information in various places like "about application" dialog, plugin selector
+ dialog, etc. Plugin does not take ownership on info object, also its lifetime should
+ be equal to the lifetime of the plugin.
+ @param parent The parent object for the plugin. Parent object must implement @ref KDevApi
+ interface. Otherwise the plugin will not be constructed.
+ @param name The internal name which identifies the plugin.*/
+ KDevProject(const KDevPluginInfo *info, QObject *parent=0, const char *name=0);
+ /**Destructor.*/
+ virtual ~KDevProject();
+
+ /**Options of the project plugin.*/
+ enum Options {
+ UsesOtherBuildSystem = 0 /**<Project uses unknown or unspecified build system or build system is not used at all.*/,
+ UsesAutotoolsBuildSystem = 1 /**<Project uses autotools for building.*/,
+ UsesQMakeBuildSystem =2 /**<Project uses qmake for building.*/
+ };
+
+ /**This method is invoked when the project is opened
+ (i.e. actually just after this class has been
+ instantiated).
+ @param dirName The project directory, which should afterwards be returned by
+ the projectDirectory() method.
+ @param projectName The project name, which is equivalent
+ to the project file name without the suffix.*/
+ virtual void openProject(const QString &dirName, const QString &projectName);
+
+ /**This method is invoked when the project is about to be closed.*/
+ virtual void closeProject() = 0;
+
+ /**Reimplement this method to set project plugin options. Default implementation
+ returns KDevProject::UsesOtherBuildSystem.*/
+ virtual Options options() const;
+
+ /**@return The canonical absolute directory of the project. Canonical means that
+ a path does not contain symbolic links or redundant "." or ".." elements.*/
+ virtual QString projectDirectory() const = 0;
+
+ /**Returns the name of the project.*/
+ virtual QString projectName() const = 0;
+
+ /**@return The environment variables that sould be set before running mainProgram().*/
+ virtual DomUtil::PairList runEnvironmentVars() const = 0;
+
+ /**@return The path to main binary program of the project.
+ @param relative if true then the path returned is relative to the project directory.*/
+ virtual QString mainProgram() const = 0;
+
+ /**Absolute path (directory) from where the mainProgram() should be run.*/
+ virtual QString runDirectory() const = 0;
+
+ /**The command line arguments that the mainProgram() should be run with.*/
+ virtual QString runArguments() const = 0;
+
+ /**The command line arguments that the mainProgram() should be debugged with.*/
+ virtual QString debugArguments() const = 0;
+
+ /**Returns the path (relative to the project directory)
+ of the active directory. All newly automatically generated
+ classes and files are usually added here.*/
+ virtual QString activeDirectory() const = 0;
+
+ /**@return The canonical build directory of the project.
+ If the separate build directory is not supported, this should
+ return the same as projectDiretory(). Canonical means that
+ a path does not contain symbolic links or redundant "." or ".." elements.*/
+ virtual QString buildDirectory() const = 0;
+
+ /**@return The list of all files in the project. The names are relative to
+ the project directory.*/
+ virtual QStringList allFiles() const = 0;
+
+ /**@return The list of files that are part of the distribution but not under
+ project control. Used mainly to package and publish extra files among with the project.*/
+ virtual QStringList distFiles() const = 0;
+
+ /**Adds a list of files to the project. Provided for convenience when adding many files.
+ @param fileList The list of file names relative to the project directory.*/
+ virtual void addFiles(const QStringList &fileList) = 0;
+
+ /**Adds a file to the project.
+ @param fileName The file name relative to the project directory.*/
+ virtual void addFile(const QString &fileName)= 0;
+
+ /**Removes a list of files from the project. Provided for convenience when removing many files.
+ @param fileList The list of file names relative to the project directory.*/
+ virtual void removeFiles(const QStringList& fileList)= 0;
+
+ /**Removes a file from the project.
+ @param fileName The file name relative to the project directory.*/
+ virtual void removeFile(const QString &fileName) = 0;
+
+ /**Notifies the project about changes to the files. Provided for
+ convenience when changing many files.
+ @param fileList The list of file names relative to the project directory..*/
+ virtual void changedFiles(const QStringList &fileList);
+
+ /**Notifies the project of a change to one of the files.
+ @param fileName The file name relative to the project directory.*/
+ virtual void changedFile(const QString &fileName);
+
+ /**@return true if the file @p absFileName is a part of the project.
+ @param absFileName Absolute name of a file to check.*/
+ virtual bool isProjectFile(const QString &absFileName);
+
+ /**@return The path (relative to the project directory) of the file @p absFileName.
+ @param absFileName Absolute name of a file.*/
+ virtual QString relativeProjectFile(const QString &absFileName);
+
+ /**@return The list of files known to the project through symlinks.*/
+ virtual QStringList symlinkProjectFiles();
+
+protected:
+
+ /** Default implementation of runDirectory method.
+ * Uses 'projectPluginName' to obtain configuration from
+ * project DOM and returns:
+ *
+ * if /<projectPluginName>/run/directoryradio == executable
+ * The directory where the executable is.
+ * if /<projectPluginName>/run/directoryradio == build
+ * The build directory.
+ * if /kdevautoproject/run/directoryradio == custom
+ * The custom directory absolute path.
+ * Derived classes are supposed to explicitly call this implementation
+ */
+ QString defaultRunDirectory(const QString& projectPluginName) const;
+
+private slots:
+ void buildFileMap();
+ void slotBuildFileMap();
+ void slotAddFilesToFileMap(const QStringList & fileList );
+ void slotRemoveFilesFromFileMap(const QStringList & fileList );
+
+signals:
+ /**Emitted when a new list of files has been added to the
+ project. Provided for convenience when many files were added.
+ @param fileList The file names relative to the project directory.*/
+ void addedFilesToProject(const QStringList& fileList);
+
+ /**Emitted when a list of files has been removed from the project.
+ Provided for convenience when many files were removed.
+ @param fileList The file names relative to the project directory.*/
+ void removedFilesFromProject(const QStringList& fileList);
+
+ /**Emitted when a list of files has changed in the project.
+ @param fileList The file names relative to the project directory.*/
+ void changedFilesInProject(const QStringList& fileList);
+
+ /**Emitted when one compile related command (make, make install, make ...) ends sucessfuly.
+ Used to reparse the files after a sucessful compilation.*/
+ void projectCompiled();
+
+ /**Emitted when the active directory of the project changes
+ * @param olddir The old active directory
+ * @param newdir The new active directory
+ */
+ void activeDirectoryChanged( const QString& olddir, const QString& newdir );
+
+private:
+ class Private;
+ Private *d;
+};
+
+#endif
diff --git a/lib/interfaces/kdevprojectiface.cpp b/lib/interfaces/kdevprojectiface.cpp
new file mode 100644
index 00000000..07cc78b1
--- /dev/null
+++ b/lib/interfaces/kdevprojectiface.cpp
@@ -0,0 +1,186 @@
+
+
+/* This file is part of the KDE project
+ Copyright (C) 2005 Ian Reinhart Geiser <geiseri@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "kdevprojectiface.h"
+#include "kdevproject.h"
+#include "domutil.h"
+
+KDevProjectIface::KDevProjectIface(KDevProject *prj)
+ : QObject(prj), DCOPObject("KDevProject"), m_prj(prj)
+{
+}
+
+
+KDevProjectIface::~KDevProjectIface()
+{
+}
+
+void KDevProjectIface::openProject( const QString & dirName, const QString & projectName )
+{
+ m_prj->openProject(dirName,projectName);
+}
+
+void KDevProjectIface::closeProject( )
+{
+ m_prj->closeProject();
+}
+
+uint KDevProjectIface::options( ) const
+{
+ return (uint)m_prj->options();
+}
+
+QString KDevProjectIface::projectDirectory( ) const
+{
+ return m_prj->projectDirectory();
+}
+
+QString KDevProjectIface::projectName( ) const
+{
+ return m_prj->projectName();
+}
+
+QString KDevProjectIface::mainProgram() const
+{
+ return m_prj->mainProgram();
+}
+
+QString KDevProjectIface::runDirectory( ) const
+{
+ return m_prj->runDirectory();
+}
+
+QString KDevProjectIface::activeDirectory( ) const
+{
+ return m_prj->activeDirectory();
+}
+
+QString KDevProjectIface::buildDirectory( ) const
+{
+ return m_prj->buildDirectory();
+}
+
+QStringList KDevProjectIface::allFiles( ) const
+{
+ return m_prj->allFiles();
+}
+
+QStringList KDevProjectIface::distFiles( ) const
+{
+ return m_prj->distFiles();
+}
+
+void KDevProjectIface::addFiles( const QStringList & fileList )
+{
+ m_prj->addFiles(fileList);
+}
+
+void KDevProjectIface::addFile( const QString & fileName )
+{
+ m_prj->addFile(fileName);
+}
+
+void KDevProjectIface::removeFiles( const QStringList & fileList )
+{
+ m_prj->removeFiles(fileList);
+}
+
+void KDevProjectIface::removeFile( const QString & fileName )
+{
+ m_prj->removeFile(fileName);
+}
+
+void KDevProjectIface::changedFiles( const QStringList & fileList )
+{
+ m_prj->changedFiles(fileList);
+}
+
+void KDevProjectIface::changedFile( const QString & fileName )
+{
+ m_prj->changedFile(fileName);
+}
+
+bool KDevProjectIface::isProjectFile( const QString & absFileName )
+{
+ return m_prj->isProjectFile(absFileName);
+}
+
+QString KDevProjectIface::relativeProjectFile( const QString & absFileName )
+{
+ return m_prj->relativeProjectFile(absFileName);
+}
+
+QStringList KDevProjectIface::symlinkProjectFiles( )
+{
+ return m_prj->symlinkProjectFiles();
+}
+
+QString KDevProjectIface::readEntry( const QString & path, const QString & defaultEntry )
+{
+ return DomUtil::readEntry( *m_prj->projectDom(), path, defaultEntry);
+}
+
+int KDevProjectIface::readIntEntry( const QString & path, int defaultEntry )
+{
+ return DomUtil::readIntEntry(*m_prj->projectDom(), path,defaultEntry);
+}
+
+bool KDevProjectIface::readBoolEntry( const QString & path, bool defaultEntry )
+{
+ return DomUtil::readBoolEntry(*m_prj->projectDom(), path, defaultEntry);
+}
+
+QStringList KDevProjectIface::readListEntry( const QString & path, const QString & tag )
+{
+ return DomUtil::readListEntry(*m_prj->projectDom(), path, tag);
+}
+
+QMap< QString, QString > KDevProjectIface::readMapEntry( const QString & path )
+{
+ return DomUtil::readMapEntry(*m_prj->projectDom(), path);
+}
+
+void KDevProjectIface::writeEntry( const QString & path, const QString & value )
+{
+ DomUtil::writeEntry(*m_prj->projectDom(), path, value);
+}
+
+void KDevProjectIface::writeIntEntry( const QString & path, int value )
+{
+ DomUtil::writeIntEntry(*m_prj->projectDom(), path, value);
+}
+
+void KDevProjectIface::writeBoolEntry( const QString & path, bool value )
+{
+ DomUtil::writeBoolEntry(*m_prj->projectDom(), path, value);
+}
+
+void KDevProjectIface::writeListEntry( const QString & path, const QString & tag, const QStringList & value )
+{
+ DomUtil::writeListEntry(*m_prj->projectDom(), path, tag, value);
+}
+
+void KDevProjectIface::writeMapEntry( const QString & path, const QMap< QString, QString > & map )
+{
+ DomUtil::writeMapEntry(*m_prj->projectDom(), path, map);
+}
+
+#include "kdevprojectiface.moc"
diff --git a/lib/interfaces/kdevprojectiface.h b/lib/interfaces/kdevprojectiface.h
new file mode 100644
index 00000000..ba299dfc
--- /dev/null
+++ b/lib/interfaces/kdevprojectiface.h
@@ -0,0 +1,81 @@
+/* This file is part of the KDE project
+ Copyright (C) 2005 Ian Reinhart Geiser <geiseri@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef KDEVPROJECTIFACE_H
+#define KDEVPROJECTIFACE_H
+
+#include <dcopobject.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+class KDevProject;
+
+/**
+DCOP Interface for the @ref KDevProject object.
+
+@author KDevelop Authors
+*/
+class KDevProjectIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+public:
+ KDevProjectIface(KDevProject *prj);
+
+ ~KDevProjectIface();
+k_dcop:
+ void openProject(const QString &dirName, const QString &projectName);
+ void closeProject();
+ uint options() const;
+ QString projectDirectory() const;
+ QString projectName() const;
+ QString mainProgram() const;
+ QString runDirectory() const;
+ QString activeDirectory() const;
+ QString buildDirectory() const;
+ QStringList allFiles() const;
+ QStringList distFiles() const;
+ void addFiles(const QStringList &fileList);
+ void addFile(const QString &fileName);
+ void removeFiles(const QStringList& fileList);
+ void removeFile(const QString &fileName);
+ void changedFiles(const QStringList &fileList);
+ void changedFile(const QString &fileName);
+ bool isProjectFile(const QString &absFileName);
+ QString relativeProjectFile(const QString &absFileName);
+ QStringList symlinkProjectFiles();
+
+ // Project DOM access
+ QString readEntry(const QString &path, const QString &defaultEntry = QString::null);
+ int readIntEntry(const QString &path, int defaultEntry = 0);
+ bool readBoolEntry(const QString &path, bool defaultEntry = false);
+ QStringList readListEntry(const QString &path, const QString &tag);
+ QMap<QString, QString> readMapEntry(const QString &path);
+
+ void writeEntry(const QString &path, const QString &value);
+ void writeIntEntry(const QString &path, int value);
+ void writeBoolEntry( const QString &path, bool value);
+ void writeListEntry(const QString &path, const QString &tag, const QStringList &value);
+ void writeMapEntry(const QString& path, const QMap<QString,QString> &map);
+
+ private:
+ KDevProject *m_prj;
+};
+
+#endif
diff --git a/lib/util/Mainpage.dox b/lib/util/Mainpage.dox
new file mode 100644
index 00000000..dad04de5
--- /dev/null
+++ b/lib/util/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Utility Library
+
+This library contains utility classes for the KDevelop architecture.
+
+<b>Link with</b>: -lkdevelop
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/util
+*/
+
diff --git a/lib/util/Makefile.am b/lib/util/Makefile.am
new file mode 100644
index 00000000..c170787e
--- /dev/null
+++ b/lib/util/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/sourceinfo $(all_includes)
+
+noinst_LTLIBRARIES = libkdevutil.la
+
+libkdevutil_la_SOURCES = blockingkprocess.cpp configwidgetproxy.cpp domutil.cpp \
+ execcommand.cpp filetemplate.cpp kdeveditorutil.cpp kdevjobtimer.cpp \
+ kdevshellwidget.cpp kscriptactionmanager.cpp rurl.cpp settings.cpp urlutil.cpp
+
+METASOURCES = AUTO
+
+kdevelopincludedir = $(includedir)/kdevelop/util
+kdevelopinclude_HEADERS = domutil.h execcommand.h filetemplate.h urlutil.h \
+ configwidgetproxy.h rurl.h kscriptactionmanager.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevextensions kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Utility Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../Doxyfile.am
+
+noinst_HEADERS = blockingkprocess.h kdeveditorutil.h kdevjobtimer.h \
+ kdevshellwidget.h settings.h
diff --git a/lib/util/blockingkprocess.cpp b/lib/util/blockingkprocess.cpp
new file mode 100644
index 00000000..f0d6e6c3
--- /dev/null
+++ b/lib/util/blockingkprocess.cpp
@@ -0,0 +1,105 @@
+/***************************************************************************
+* Copyright (C) 2006 by Andras Mantia *
+* amantia@kde.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+#include "blockingkprocess.h"
+
+#include <qapplication.h>
+#include <qtimer.h>
+
+BlockingKProcess::BlockingKProcess(QObject *parent, const char *name)
+ : KProcess(parent, name)
+{
+ m_stdOut = "";
+ m_stdErr = "";
+ m_timeoutValue = 60;
+ m_timer = 0L;
+
+ connect(this, SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, SLOT(slotReceivedStdOut(KProcess *, char *, int)));
+ connect(this, SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, SLOT(slotReceivedStdErr(KProcess *, char *, int)));
+ connect(this, SIGNAL(processExited(KProcess *)),
+ this, SLOT(slotProcessExited(KProcess *)));
+}
+
+BlockingKProcess::BlockingKProcess()
+ : KProcess()
+{
+ m_stdOut = "";
+ m_stdErr = "";
+ m_timeoutValue = 60;
+ m_timer = 0L;
+ connect(this, SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, SLOT(slotReceivedStdOut(KProcess *, char *, int)));
+ connect(this, SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, SLOT(slotReceivedStdErr(KProcess *, char *, int)));
+ connect(this, SIGNAL(processExited(KProcess *)),
+ this, SLOT(slotProcessExited(KProcess *)));
+}
+
+
+BlockingKProcess::~BlockingKProcess()
+{
+}
+bool BlockingKProcess::start(RunMode runmode, Communication comm)
+{
+ if (KProcess::start(runmode, comm))
+ {
+ m_timeout = false;
+ m_timer = new QTimer();
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
+ m_timer->start(m_timeoutValue*1000, true);
+ enter_loop();
+ delete m_timer;
+ m_timer = 0L;
+ return !m_timeout;
+ } else
+ return false;
+}
+
+
+void BlockingKProcess::slotReceivedStdOut(KProcess *, char *buffer, int buflen)
+{
+ m_stdOut += QString::fromLatin1(buffer, buflen);
+}
+
+void BlockingKProcess::slotReceivedStdErr(KProcess *, char *buffer, int buflen)
+{
+ m_stdErr += QString::fromLatin1(buffer, buflen);
+}
+
+void BlockingKProcess::slotProcessExited(KProcess *)
+{
+ qApp->exit_loop();
+}
+
+void BlockingKProcess::slotTimeOut()
+{
+ m_timeout = true;
+ kill();
+ qApp->exit_loop();
+}
+
+
+void qt_enter_modal( QWidget *widget );
+void qt_leave_modal( QWidget *widget );
+
+void BlockingKProcess::enter_loop()
+{
+ QWidget dummy(0,0,WType_Dialog | WShowModal);
+ dummy.setFocusPolicy( QWidget::NoFocus );
+ qt_enter_modal(&dummy);
+ qApp->enter_loop();
+ qt_leave_modal(&dummy);
+}
+
+
+#include "blockingkprocess.moc"
diff --git a/lib/util/blockingkprocess.h b/lib/util/blockingkprocess.h
new file mode 100644
index 00000000..c5c8f5d9
--- /dev/null
+++ b/lib/util/blockingkprocess.h
@@ -0,0 +1,92 @@
+
+/***************************************************************************
+* Copyright (C) 2006 by Andras Mantia *
+* amantia@kde.org *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
+
+#ifndef BLOCKINGKPROCESS_H
+#define BLOCKINGKPROCESS_H
+
+#include <kprocess.h>
+
+/**
+ * Blocking version of KProcess, which stores the stdout.
+ * Differences between start(KProcess::Block, KProcess::StdOut) and this
+ * class are:
+ * - the GUI update is not blocked why the external process is running
+ * - in case of problems there is a timeout (defaults to 60 seconds), after which the
+ * process is terminated.
+ * - the stdout is caught - it the caller request it - and can be read by the caller
+ * @author Andras Mantia <amantia@kde.org>
+*/
+
+class QTimer;
+class BlockingKProcess : public KProcess
+{
+ Q_OBJECT
+
+public:
+ BlockingKProcess(QObject *parent, const char *name=0);
+ BlockingKProcess();
+
+ virtual ~BlockingKProcess();
+
+ /**
+ * Start the process. It waits until the process exits or the timeout is hit.
+ * @param runmode @see KProcess, use KProcess::NotifyOnExit to get proper behaviour,
+ * not KProcess::Block
+ * @param comm if Stdout is passed, it catches the output. For the rest @see KProcess
+ * @return true in case of success, false if there are problems to start the process
+ * or it was killed because of the timeout.
+ */
+ virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication);
+
+ /**
+ * Get the output of the run process
+ * @return the output
+ */
+ QString stdOut() { return m_stdOut;}
+ /**
+ * Clear the internal stdout buffer. Useful in case the class is reused.
+ */
+ void clearStdOut() { m_stdOut = "";}
+ /**
+ * Get the error output of the run process
+ * @return the output
+ */
+ QString stdErr() { return m_stdErr;}
+ /**
+ * Clear the internal stderr buffer. Useful in case the class is reused.
+ */
+ void clearStdErr() { m_stdErr = "";}
+
+ /**
+ * Sets the timeout
+ * @param timeout seconds after which the process is considered hung and killed. 0 disables the timeout.
+ */
+ void setTimeOut(int timeout) { m_timeoutValue = timeout; }
+
+private slots:
+ void slotReceivedStdOut(KProcess *proc, char *buffer, int buflen);
+ void slotReceivedStdErr(KProcess *proc, char *buffer, int buflen);
+ void slotProcessExited(KProcess *proc);
+ void slotTimeOut();
+
+private:
+ void enter_loop();
+
+ QString m_stdOut;
+ QString m_stdErr;
+ bool m_timeout;
+ int m_timeoutValue;
+ QTimer *m_timer;
+};
+
+#endif
diff --git a/lib/util/configwidgetproxy.cpp b/lib/util/configwidgetproxy.cpp
new file mode 100644
index 00000000..128fa2ad
--- /dev/null
+++ b/lib/util/configwidgetproxy.cpp
@@ -0,0 +1,105 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+
+
+#include <qstring.h>
+#include <qvbox.h>
+
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+
+#include <kdevcore.h>
+
+
+#include "configwidgetproxy.h"
+
+
+ConfigWidgetProxy::ConfigWidgetProxy( KDevCore * core )
+{
+ connect( core, SIGNAL(configWidget(KDialogBase*)), this, SLOT(slotConfigWidget( KDialogBase*)) );
+ connect( core, SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(slotProjectConfigWidget( KDialogBase*)) );
+}
+
+ConfigWidgetProxy::~ConfigWidgetProxy()
+{}
+
+void ConfigWidgetProxy::createGlobalConfigPage( QString const & title, unsigned int pagenumber, QString const & icon )
+{
+ _globalTitleMap.insert( pagenumber, qMakePair( title, icon ) );
+}
+
+void ConfigWidgetProxy::createProjectConfigPage( QString const & title, unsigned int pagenumber, QString const & icon )
+{
+ _projectTitleMap.insert( pagenumber, qMakePair( title, icon ) );
+}
+
+void ConfigWidgetProxy::removeConfigPage( int pagenumber )
+{
+ _globalTitleMap.remove( pagenumber );
+ _projectTitleMap.remove( pagenumber );
+}
+
+void ConfigWidgetProxy::slotConfigWidget( KDialogBase * dlg )
+{
+ TitleMap::Iterator it = _globalTitleMap.begin();
+ while ( it != _globalTitleMap.end() )
+ {
+ _pageMap.insert( dlg->addVBoxPage( it.data().first, it.data().first, BarIcon( it.data().second, KIcon::SizeMedium ) ), it.key() );
+ ++it;
+ }
+
+ connect( dlg, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT( slotAboutToShowPage(QWidget*)) );
+ connect( dlg, SIGNAL(destroyed()), this, SLOT(slotConfigWidgetDestroyed()) );
+}
+
+void ConfigWidgetProxy::slotProjectConfigWidget( KDialogBase * dlg )
+{
+ TitleMap::Iterator it = _projectTitleMap.begin();
+ while ( it != _projectTitleMap.end() )
+ {
+ _pageMap.insert( dlg->addVBoxPage( it.data().first, it.data().first, BarIcon( it.data().second, KIcon::SizeMedium ) ), it.key() );
+ ++it;
+ }
+
+ connect( dlg, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT( slotAboutToShowPage(QWidget*)) );
+ connect( dlg, SIGNAL(destroyed()), this, SLOT(slotConfigWidgetDestroyed()) );
+}
+
+void ConfigWidgetProxy::slotConfigWidgetDestroyed( )
+{
+ _pageMap.clear();
+}
+
+void ConfigWidgetProxy::slotAboutToShowPage( QWidget * page )
+{
+ if ( !page ) return;
+
+ PageMap::Iterator it = _pageMap.find( page );
+ if ( it != _pageMap.end() )
+ {
+ emit insertConfigWidget( static_cast<KDialogBase*>(const_cast<QObject*>(sender())), page, it.data() );
+ _pageMap.remove( it );
+ }
+}
+
+#include "configwidgetproxy.moc"
+
+// kate: space-indent off; indent-width 4; replace-tabs off; tab-width 4;
diff --git a/lib/util/configwidgetproxy.h b/lib/util/configwidgetproxy.h
new file mode 100644
index 00000000..6380d002
--- /dev/null
+++ b/lib/util/configwidgetproxy.h
@@ -0,0 +1,129 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Jens Dagerbo <jens.dagerbo@swipnet.se>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _CONFIGWIDGETPROXY_H
+#define _CONFIGWIDGETPROXY_H
+
+#include <qobject.h>
+#include <qstring.h>
+#include <qmap.h>
+
+class KDevCore;
+class KDialogBase;
+
+/**
+@file configwidgetproxy.h
+Configuration widget proxy class.
+*/
+
+/**
+This class can be used to implement demand-loading of config pages.
+In order to avoid the potentially heavy and unneccessary creation
+of a config page that might not be needed, this class can be used
+to delay the config page creation until the user explicitly asks
+for it.
+
+A typical case looks like this:
+@code
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+_configProxy = new ConfigWidgetProxy( core() );
+_configProxy->createGlobalConfigPage( i18n("My Part"), GLOBALDOC_OPTIONS, info()->icon() );
+_configProxy->createProjectConfigPage( i18n("My Part"), PROJECTDOC_OPTIONS, info()->icon() );
+connect( _configProxy, SIGNAL(insertConfigWidget(const QObject*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const QObject*, QWidget*, unsigned int )) );
+
+...
+...
+
+void MyPart::insertConfigWidget( QObject const * dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == PROJECTDOC_OPTIONS ) {
+ MyPartGlobalSettings * w = new MyPartGlobalSettings( this, page );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ } else if ( pagenumber == PROJECTDOC_OPTIONS ) {
+ MyPartProjectSettings * w = new MyPartProjectSettings( this, page );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ }
+}
+@endcode
+
+Note that this replaces the functionality of typical KDevCore::configWidget() and
+KDevCore::projectConfigWidget() slots.
+*/
+class ConfigWidgetProxy : public QObject
+{
+Q_OBJECT
+
+public:
+ /**Constructor.
+ @param core An instance of KDevelop Core.*/
+ ConfigWidgetProxy( KDevCore * core );
+ virtual ~ConfigWidgetProxy();
+
+ /**
+ * Tells the proxy you want a page in the Global Settings.
+ * @param title The title of the config page, shown in the settings dialog.
+ * @param pagenumber A per-proxy unique identifier, used when responding to insertConfigWidget() signal.
+ * @param icon The name of the icon to use.
+ */
+ void createGlobalConfigPage( QString const & title, unsigned int pagenumber, QString const & icon = "kdevelop" );
+
+ /**
+ * Tells the proxy you want a page in the Project Settings.
+ * @param title The title of the config page, shown in the settings dialog.
+ * @param pagenumber A per-proxy unique identifier, used when responding to insertConfigWidget() signal.
+ * @param icon The name of the icon to use.
+ */
+ void createProjectConfigPage( QString const & title, unsigned int pagenumber, QString const & icon = "kdevelop" );
+
+ /**
+ * Removes a config page from the proxy. Next time the settings dialog opens, this page will not be available.
+ * @param pagenumber The identifier set in createGlobalConfigPage() or createProjectConfigPage().
+ */
+ void removeConfigPage( int pagenumber );
+
+signals:
+ /**
+ * The proxy emits this signal to notify the client that a specific config page has been requested.
+ * @param dlg The settings dialog. The client should connect to its okClicked() signal.
+ * @param page The setting page. The client should use this as parent to the config widget.
+ * @param pagenumber The identifier set in createGlobalConfigPage() or createProjectConfigPage(). Identifies the requested config page.
+ */
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber );
+
+private slots:
+ void slotConfigWidget( KDialogBase * );
+ void slotProjectConfigWidget( KDialogBase * );
+ void slotConfigWidgetDestroyed();
+ void slotAboutToShowPage( QWidget * page );
+
+private:
+ typedef QMap<unsigned int, QPair<QString,QString> > TitleMap;
+ typedef QMap<QWidget*, int> PageMap;
+
+ TitleMap _globalTitleMap;
+ TitleMap _projectTitleMap;
+ PageMap _pageMap;
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; replace-tabs off; tab-width 4;
diff --git a/lib/util/domutil.cpp b/lib/util/domutil.cpp
new file mode 100644
index 00000000..b183717f
--- /dev/null
+++ b/lib/util/domutil.cpp
@@ -0,0 +1,367 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * default support: Eray Ozkural (exa) *
+ * additions: John Firebaugh <jfirebaugh@kde.org> *
+ * Jakob Simon-Gaarde <jakob@simon-gaarde.dk> *
+ * *
+ * 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 "domutil.h"
+
+#include <kdebug.h>
+#include <qstringlist.h>
+#include <qfile.h>
+
+
+void DomUtil::makeEmpty( QDomElement& e )
+{
+ while( !e.firstChild().isNull() )
+ e.removeChild( e.firstChild() );
+}
+
+QDomElement DomUtil::elementByPath(const QDomDocument &doc, const QString &path)
+{
+ QStringList l = QStringList::split('/', path);
+
+ QDomElement el;
+ if(&doc) el = doc.documentElement();
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it) {
+ el = el.namedItem(*it).toElement();
+ }
+
+ return el;
+}
+
+
+QString DomUtil::readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry)
+{
+ QDomElement el = elementByPath(doc, path);
+ if (el.isNull())
+ return defaultEntry;
+ else
+ return el.firstChild().toText().data();
+}
+
+/// @todo consider whether it's okay to accept empty string == default value
+/// if not use the below type
+///typedef pair<bool,QString> EltInfo;
+
+QString DomUtil::readEntryAux(const QDomDocument &doc, const QString &path)
+{
+ QDomElement el = elementByPath(doc, path);
+ if (el.isNull())
+ return QString::null;
+ else
+ return el.firstChild().toText().data();
+}
+
+int DomUtil::readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry)
+{
+ QString entry = readEntryAux(doc, path);
+ if (entry.isNull())
+ return defaultEntry;
+ else
+ return entry.toInt();
+}
+
+
+bool DomUtil::readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry)
+{
+ QString entry = readEntryAux(doc, path);
+ if (entry.isNull())
+ return defaultEntry;
+ else
+ return entry == "TRUE" || entry == "true";
+}
+
+
+QStringList DomUtil::readListEntry(const QDomDocument &doc, const QString &path, const QString &tag)
+{
+ QStringList list;
+
+ QDomElement el = elementByPath(doc, path);
+ QDomElement subEl = el.firstChild().toElement();
+ while (!subEl.isNull()) {
+ if (subEl.tagName() == tag)
+ list << subEl.firstChild().toText().data();
+ subEl = subEl.nextSibling().toElement();
+ }
+
+ return list;
+}
+
+
+DomUtil::PairList DomUtil::readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
+ const QString &firstAttr, const QString &secondAttr)
+{
+ PairList list;
+
+ QDomElement el = elementByPath(doc, path);
+ QDomElement subEl = el.firstChild().toElement();
+ while (!subEl.isNull()) {
+ if (subEl.tagName() == tag) {
+ QString first = subEl.attribute(firstAttr);
+ QString second = subEl.attribute(secondAttr);
+ list << Pair(first, second);
+ }
+ subEl = subEl.nextSibling().toElement();
+ }
+
+ return list;
+}
+
+QMap<QString, QString> DomUtil::readMapEntry(const QDomDocument &doc, const QString& path)
+{
+ QMap<QString, QString> map;
+
+ QDomElement el = elementByPath(doc, path);
+ QDomElement subEl = el.firstChild().toElement();
+ while (!subEl.isNull()) {
+ map[subEl.tagName()] = subEl.firstChild().toText().data();
+ subEl = subEl.nextSibling().toElement();
+ }
+
+ return map;
+}
+
+QDomElement DomUtil::namedChildElement( QDomElement& el, const QString& name )
+{
+ QDomElement child = el.namedItem( name ).toElement();
+ if (child.isNull()) {
+ child = el.ownerDocument().createElement( name );
+ el.appendChild(child);
+ }
+ return child;
+}
+
+
+QDomElement DomUtil::createElementByPath(QDomDocument &doc, const QString &path)
+{
+ QStringList l = QStringList::split('/', path);
+
+ QDomElement el;
+ if(&doc) el = doc.documentElement();
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it)
+ el = DomUtil::namedChildElement( el, *it );
+
+ while (!el.firstChild().isNull())
+ el.removeChild(el.firstChild());
+
+ return el;
+}
+
+
+void DomUtil::writeEntry(QDomDocument &doc, const QString &path, const QString &value)
+{
+ QDomElement el = createElementByPath(doc, path);
+ el.appendChild(doc.createTextNode(value));
+}
+
+void DomUtil::writeMapEntry(QDomDocument &doc, const QString &path, const QMap<QString, QString> &map)
+{
+ QString basePath( path + "/" );
+ QMap<QString,QString>::ConstIterator it;
+ for (it = map.begin(); it != map.end(); ++it)
+ {
+ kdDebug( 9010 ) << "writing " << basePath << ";" << it.key() << ";" << it.data() << endl;
+ if( ! it.key().isEmpty() )
+ writeEntry(doc, basePath + it.key(), it.data() );
+ }
+}
+
+void DomUtil::writeIntEntry(QDomDocument &doc, const QString &path, int value)
+{
+ writeEntry(doc, path, QString::number(value));
+}
+
+
+void DomUtil::writeBoolEntry(QDomDocument &doc, const QString &path, bool value)
+{
+ writeEntry(doc, path, value? "true" : "false");
+}
+
+
+void DomUtil::writeListEntry(QDomDocument &doc, const QString &path, const QString &tag,
+ const QStringList &value)
+{
+ QDomElement el = createElementByPath(doc, path);
+
+ QStringList::ConstIterator it;
+ for (it = value.begin(); it != value.end(); ++it) {
+ QDomElement subEl = doc.createElement(tag);
+ subEl.appendChild(doc.createTextNode(*it));
+ el.appendChild(subEl);
+ }
+}
+
+
+void DomUtil::writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag,
+ const QString &firstAttr, const QString &secondAttr,
+ const PairList &value)
+{
+ QDomElement el = createElementByPath(doc, path);
+
+ PairList::ConstIterator it;
+ for (it = value.begin(); it != value.end(); ++it) {
+ QDomElement subEl = doc.createElement(tag);
+ subEl.setAttribute(firstAttr, (*it).first);
+ subEl.setAttribute(secondAttr, (*it).second);
+ el.appendChild(subEl);
+ }
+}
+
+DomPath DomUtil::resolvPathStringExt(const QString pathstring)
+{
+ // parse path
+ unsigned int i;
+ QStringList pathParts = QStringList::split('/',pathstring);
+ DomPath dompath;
+ for (i=0; i<pathParts.count(); i++)
+ {
+ QStringList pathElemParts = QStringList::split('|',pathParts[i],TRUE);
+ DomPathElement dompathelem;
+ dompathelem.tagName = pathElemParts[0].simplifyWhiteSpace();
+ if (pathElemParts.count()>1)
+ {
+ // handle attributes
+ QStringList attrParts = QStringList::split(';',pathElemParts[1]);
+ for (unsigned int j=0; j<attrParts.count(); j++)
+ {
+ QStringList attribSet = QStringList::split('=',attrParts[j]);
+ if (attribSet.count()<2)
+ continue;
+ DomAttribute domattribute;
+ domattribute.name = attribSet[0].simplifyWhiteSpace();
+ domattribute.value = attribSet[1].simplifyWhiteSpace();
+ dompathelem.attribute.append(domattribute);
+ }
+ }
+ if (pathElemParts.count()>2)
+ dompathelem.matchNumber = pathElemParts[2].toInt();
+ else
+ dompathelem.matchNumber = 0; // or else the first
+ dompath.append(dompathelem);
+ }
+ return dompath;
+}
+
+
+#define rightchild !wrongchild
+
+QDomElement DomUtil::elementByPathExt(QDomDocument &doc, const QString &pathstring)
+{
+ DomPath dompath = resolvPathStringExt(pathstring);
+ QDomElement elem = doc.documentElement();
+ QDomNodeList children;
+ QDomElement nextElem = elem;
+ for (unsigned int j=0; j<dompath.count(); j++)
+ {
+ children = nextElem.childNodes();
+ DomPathElement dompathelement= dompath[j];
+ bool wrongchild = false;
+ int matchCount = 0;
+ for (unsigned int i=0; i<children.count(); i++)
+ {
+ wrongchild = false;
+ QDomElement child = children.item(i).toElement();
+ QString tag = child.tagName();
+ tag = dompathelement.tagName;
+ if (child.tagName() == dompathelement.tagName)
+ {
+ for (unsigned int k=0; k<dompathelement.attribute.count(); k++)
+ {
+ DomAttribute domattribute = dompathelement.attribute[k];
+ QDomAttr domattr = child.attributeNode(domattribute.name);
+ if (domattr.isNull() ||
+ domattr.value() != domattribute.value)
+ {
+ wrongchild = true;
+ break;
+ }
+ }
+ }
+ else
+ wrongchild=true;
+ if (rightchild)
+ {
+ if (dompathelement.matchNumber == matchCount++)
+ {
+ nextElem = child;
+ break;
+ }
+ }
+ }
+ if (wrongchild)
+ {
+ QDomElement nullDummy;
+ nullDummy.clear();
+ return nullDummy;
+ }
+ }
+ return nextElem;
+}
+
+
+bool DomUtil::openDOMFile(QDomDocument &doc, QString filename)
+{
+ QFile file( filename );
+ if ( !file.open( IO_ReadOnly ) )
+ return false;
+ if ( !doc.setContent( &file ) ) {
+ file.close();
+ return false;
+ }
+ file.close();
+ return true;
+}
+
+bool DomUtil::saveDOMFile(QDomDocument &doc, QString filename)
+{
+ QFile file( filename );
+ if ( !file.open( IO_ReadWrite | IO_Truncate ) )
+ return false;
+ QTextStream t( &file );
+ t << doc.toString();
+ file.close();
+ return true;
+}
+
+bool DomUtil::removeTextNodes(QDomDocument doc,QString pathExt)
+{
+ QDomElement elem = elementByPathExt(doc,pathExt);
+ if (elem.isNull())
+ return false;
+ QDomNodeList children = elem.childNodes();
+ for (unsigned int i=0;i<children.count();i++)
+ if (children.item(i).isText())
+ elem.removeChild(children.item(i));
+ return true;
+}
+
+
+bool DomUtil::appendText(QDomDocument doc, QString pathExt, QString text)
+{
+ QDomElement elem = elementByPathExt(doc,pathExt);
+ if (elem.isNull())
+ return false;
+ elem.appendChild(doc.createTextNode(text));
+ return true;
+}
+
+
+bool DomUtil::replaceText(QDomDocument doc, QString pathExt, QString text)
+{
+ if (removeTextNodes(doc,pathExt) &&
+ appendText(doc,pathExt,text))
+ return true;
+ else
+ return false;
+}
diff --git a/lib/util/domutil.h b/lib/util/domutil.h
new file mode 100644
index 00000000..a301ef00
--- /dev/null
+++ b/lib/util/domutil.h
@@ -0,0 +1,226 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * jakob@simon-gaarde.dk *
+ * *
+ * 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 _DOMUTIL_H_
+#define _DOMUTIL_H_
+
+#include <qdom.h>
+#include <qpair.h>
+#include <qstringlist.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+
+/**
+@file domutil.h
+Utility functions to operate on %DOM.
+*/
+
+struct DomAttribute
+{
+ QString name;
+ QString value;
+};
+
+struct DomPathElement
+{
+ QString tagName;
+ QValueList<DomAttribute> attribute;
+ int matchNumber; // for use when more than one element matches the path
+};
+
+typedef QValueList<DomPathElement> DomPath;
+
+/**
+ * Utility class for conveniently accessing data in a %DOM tree.
+ */
+class DomUtil
+{
+public:
+ typedef QPair<QString, QString> Pair;
+ typedef QValueList<Pair> PairList;
+ /**
+ * Remove all child elements from a given element.
+ */
+ static void makeEmpty( QDomElement& );
+ /**
+ * Reads a string entry.
+ */
+ static QString readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry = QString::null);
+ /**
+ * Reads a number entry.
+ */
+ static int readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry = 0);
+ /**
+ * Reads a boolean entry. The strings "true" and "TRUE" are interpreted
+ * as true, all other as false.
+ */
+ static bool readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry = false);
+ /**
+ * Reads a list entry. See writeListEntry().
+ */
+ static QStringList readListEntry(const QDomDocument &doc, const QString &path, const QString &tag);
+ /**
+ * Reads a list of string pairs. See writePairListEntry().
+ */
+ static PairList readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
+ const QString &firstAttr, const QString &secondAttr);
+ /**
+ * Reads a string to string map. See writeMapEntry()
+ */
+ static QMap<QString, QString> readMapEntry(const QDomDocument &doc, const QString &path);
+ /**
+ * Retrieves an element by path, return null if any item along
+ * the path does not exist.
+ */
+ static QDomElement elementByPath( const QDomDocument& doc, const QString& path );
+ /**
+ * Retrieves an element by path, creating the necessary nodes.
+ */
+ static QDomElement createElementByPath( QDomDocument& doc, const QString& path );
+ /**
+ * Retrieves a child element, creating it if it does not exist.
+ * The return value is guaranteed to be non isNull()
+ */
+ static QDomElement namedChildElement( QDomElement& el, const QString& name );
+ /**
+ Writes a string entry. For example,
+ \verbatim
+ <code>
+ writeEntry(doc, "/general/special", "foo");
+ </code>
+ \endverbatim creates the %DOM fragment: \verbatim
+ <code>
+ <general><special>foo</special></general>
+ </code>
+ \endverbatim
+ */
+ static void writeEntry(QDomDocument &doc, const QString &path, const QString &value);
+ /**
+ * Writes a number entry.
+ */
+ static void writeIntEntry(QDomDocument &doc, const QString &path, int value);
+ /**
+ * Writes a boolean entry. Booleans are stored as "true", "false" resp.
+ */
+ static void writeBoolEntry(QDomDocument &doc, const QString &path, bool value);
+ /**
+ Writes a string list element. The list elements are separated by tag. For example,
+ \verbatim
+ <code>
+ QStringList l; l << "one" << "two";
+ writeListEntry(doc, "/general/special", "el", l);
+ </code>
+ \endverbatim creates the %DOM fragment: \verbatim
+ <code>
+ <general><special><el>one</el><el>two</el></special></general>
+ </code>
+ \endverbatim
+ */
+ static void writeListEntry(QDomDocument &doc, const QString &path, const QString &tag,
+ const QStringList &value);
+ /**
+ Writes a list of string pairs. The list elements are stored in the attributes
+ firstAttr and secondAttr of elements named tag. For example,
+ \verbatim
+ <code>
+ DomUtil::PairList l;
+ l << DomUtil::StringPair("one", "1");
+ l << DomUtil::StringPair("two", "2");
+ writePairListEntry(doc, "/general/special", "el", "first", "second", l);
+ </code>
+ \endverbatim creates the %DOM fragment: \verbatim
+ <code>
+ <general><special>
+ <el first="one" second="1"/>
+ <el first="two" second="2"/>
+ </special></general>
+ </code>
+ \endverbatim
+ */
+ static void writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag,
+ const QString &firstAttr, const QString &secondAttr,
+ const PairList &value);
+ /**
+ * Writes a string to string map. This map is stored in a way, that it can be read with
+ * readMapEntry() and readEntry()
+ */
+ static void writeMapEntry(QDomDocument &doc, const QString& path, const QMap<QString,QString> &map);
+
+ /**
+ * Resolves an extended path
+ * Extended path format:
+ * pathpart: tag[|attr1=value[;attr2=value;..][|matchNumber]]
+ * where matchNumber is zero-based
+ * path: pathpart[/pathpart/..]
+ */
+ static DomPath resolvPathStringExt(const QString pathstring);
+
+ /**
+ Retrieve an element specified with extended path
+ examples:
+
+ - 1: "widget|class=QDialog/property|name=geometry"
+ or "widget|class=QDialog/property||1"
+ - 2: "widget/property|name=caption/string"
+ or "widget/property||2/string"
+ .
+ \verbatim
+ <widget class="QDialog">
+ <property name="name">
+ <cstring>KdevFormName</cstring>
+ </property>
+ <property name="geometry"> <-- 1. reaches this node
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>KdevFormCaption</string> <-- 2. reaches this node
+ </property>
+ </widget>
+ \endverbatim
+ */
+ static QDomElement elementByPathExt(QDomDocument &doc, const QString &pathstring);
+
+ /**
+ * Open file - filename - and set setContents of doc
+ */
+ static bool openDOMFile(QDomDocument &doc, QString filename);
+
+ /**
+ * Store contents of doc in file - filename. Existing file will be truncated!
+ */
+ static bool saveDOMFile(QDomDocument &doc, QString filename);
+
+ /**
+ * Remove all child text nodes of parent described in pathExt
+ */
+ static bool removeTextNodes(QDomDocument doc,QString pathExt);
+
+ /**
+ * Add child text node to parent described in pathExt
+ */
+ static bool appendText(QDomDocument doc, QString pathExt, QString text);
+
+ /**
+ * Replace all chilt text nodes of parent described in pathExt with one new.
+ */
+ static bool replaceText(QDomDocument doc, QString pathExt, QString text);
+
+private:
+ static QString readEntryAux(const QDomDocument &doc, const QString &path);
+};
+
+#endif
diff --git a/lib/util/execcommand.cpp b/lib/util/execcommand.cpp
new file mode 100644
index 00000000..73fc9320
--- /dev/null
+++ b/lib/util/execcommand.cpp
@@ -0,0 +1,101 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "execcommand.h"
+
+#include <kprocess.h>
+#include <kprogress.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+ExecCommand::ExecCommand( const QString& executable, const QStringList& args,
+ const QString& workingDir, const QStringList& env,
+ QObject* parent, const char* name ):
+ QObject( parent, name ), out( "" ) /* make sure out is not QString::null since that would mean "error" */
+
+{
+ progressDlg = 0;
+
+ proc = new KProcess();
+ proc->setWorkingDirectory( workingDir );
+ for ( QStringList::ConstIterator it = env.begin(); it != env.end(); ++it )
+ proc->setEnvironment( (*it).section( '=', 0, 0 ), (*it).section( '=', 1, 1 ) );
+ *proc << executable;
+ *proc << args;
+
+ connect( proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(processExited()) );
+ connect( proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, SLOT(receivedStdout(KProcess*,char*,int)) );
+ connect( proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(receivedStderr(KProcess*,char*,int)) );
+
+ bool ok = proc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
+
+ if ( !ok ) {
+ KMessageBox::error( 0, i18n("Could not invoke \"%1\". Please make sure it is installed correctly").arg( executable ),
+ i18n("Error Invoking Command") );
+
+ emit finished( QString::null, QString::null );
+ deleteLater();
+
+ } else {
+ progressDlg = new KProgressDialog( 0, 0, i18n("Command running..."),
+ i18n("Please wait until the \"%1\" command finishes.").arg( executable ), false );
+ connect( progressDlg, SIGNAL(cancelClicked()),
+ this, SLOT(cancelClicked()) );
+ }
+}
+
+void ExecCommand::receivedStdout (KProcess*, char *buffer, int buflen)
+{
+ out += QString::fromUtf8( buffer, buflen );
+}
+
+void ExecCommand::receivedStderr (KProcess*, char *buffer, int buflen)
+{
+ err += QString::fromUtf8( buffer, buflen );
+}
+
+void ExecCommand::processExited()
+{
+ delete progressDlg;
+ progressDlg = 0;
+
+ emit finished( out, err );
+ deleteLater();
+}
+
+void ExecCommand::cancelClicked()
+{
+ delete progressDlg;
+ progressDlg = 0;
+ proc->kill();
+
+ emit finished( QString::null, QString::null );
+ deleteLater();
+}
+
+ExecCommand::~ExecCommand()
+{
+ delete proc;
+ delete progressDlg;
+}
+
+#include "execcommand.moc"
diff --git a/lib/util/execcommand.h b/lib/util/execcommand.h
new file mode 100644
index 00000000..b5545e0d
--- /dev/null
+++ b/lib/util/execcommand.h
@@ -0,0 +1,70 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _EXECCOMMAND_H_
+#define _EXECCOMMAND_H_
+
+#include <qobject.h>
+#include <qstringlist.h>
+
+class KProcess;
+class KProgressDialog;
+
+/**
+@file execcommand.h
+Command execution facilities.
+*/
+
+/**
+ * This class invokes a binary with the arguments passed in the constructor and
+ * emits the signal finished() with the output. It also displays
+ * a progress dialog with the possibility to cancel the command.
+ *
+ * If there was an error or the user pressed cancel, finished ()
+ * will emit a QString::null, otherwise QStrings containing the stdout/stderr.
+ *
+ * The object will delete itself after the finished signal has been emitted.
+ * Additional environment can be set in the QStringList env via QStrings with the format "foo=blah"
+ */
+class ExecCommand : public QObject
+{
+ Q_OBJECT
+public:
+ ExecCommand( const QString& executable, const QStringList& args,
+ const QString& workingDir = QString::null,
+ const QStringList& env = QStringList(), QObject* parent = 0, const char* name = 0 );
+ ~ExecCommand();
+
+signals:
+ void finished( const QString& output, const QString& errorOutput );
+
+private slots:
+ void receivedStdout (KProcess *, char *buffer, int buflen);
+ void receivedStderr (KProcess *, char *buffer, int buflen);
+ void processExited();
+ void cancelClicked();
+
+private:
+ KProcess* proc;
+ KProgressDialog* progressDlg;
+ QString out;
+ QString err;
+};
+
+#endif
diff --git a/lib/util/filetemplate.cpp b/lib/util/filetemplate.cpp
new file mode 100644
index 00000000..82221891
--- /dev/null
+++ b/lib/util/filetemplate.cpp
@@ -0,0 +1,128 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Sandy Meier <smeier@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "filetemplate.h"
+
+#include <qdatetime.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+
+#include <kstandarddirs.h>
+
+#include "kdevplugin.h"
+#include "kdevproject.h"
+#include "domutil.h"
+
+
+bool FileTemplate::exists(KDevPlugin *part, const QString &name, Policy p)
+{
+ //QString fileName = (p == Default) ?
+ // (part->project()->projectDirectory() + "/templates/" + name) : name;
+
+ return QFile::exists( fullPathForName(part,name,p) );
+}
+
+QString FileTemplate::read(KDevPlugin *part, const QString &name, Policy p)
+{
+
+ //KDevProject *project = part->project();
+ //QString fileName = (p == Default) ? (project->projectDirectory() +
+// "/templates/" + name) : name;
+
+ return readFile(part, fullPathForName(part, name, p) );
+}
+
+QString FileTemplate::readFile(KDevPlugin *part, const QString &fileName)
+{
+ QDomDocument &dom = *part->projectDom();
+
+ QFile f(fileName);
+ if (!f.open(IO_ReadOnly))
+ return QString::null;
+ QTextStream stream(&f);
+ QString str = stream.read();
+
+ return makeSubstitutions( dom, str );
+}
+
+QString FileTemplate::makeSubstitutions( QDomDocument & dom, const QString & text )
+{
+ QString author = DomUtil::readEntry(dom, "/general/author");
+ QString email = DomUtil::readEntry(dom, "/general/email");
+ QString version = DomUtil::readEntry(dom, "/general/version");
+ QString appname = DomUtil::readEntry(dom, "/general/projectname");
+ QString date = QDate::currentDate().toString();
+ QString year = QString::number(QDate::currentDate().year());
+
+ QString str = text;
+ str.replace(QRegExp("\\$EMAIL\\$"),email);
+ str.replace(QRegExp("\\$AUTHOR\\$"),author);
+ str.replace(QRegExp("\\$VERSION\\$"),version);
+ str.replace(QRegExp("\\$DATE\\$"),date);
+ str.replace(QRegExp("\\$YEAR\\$"),year);
+ str.replace(QRegExp("\\$APPNAME\\$"),appname);
+ str.replace(QRegExp("\\$APPNAME\\$"),appname);
+ str.replace(QRegExp("\\$APPNAMEUC\\$"),appname.upper());
+ str.replace(QRegExp("\\$APPNAMELC\\$"),appname.lower());
+
+ return str;
+}
+
+
+bool FileTemplate::copy(KDevPlugin *part, const QString &name,
+ const QString &dest, Policy p)
+{
+ QString text = read(part, name, p);
+
+ QFile f(dest);
+ if (!f.open(IO_WriteOnly))
+ return false;
+
+ QFileInfo fi(f);
+ QString module = fi.baseName();
+ QString basefilename = fi.baseName(true);
+ text.replace(QRegExp("\\$MODULE\\$"),module);
+ text.replace(QRegExp("\\$FILENAME\\$"),basefilename);
+
+ QTextStream stream(&f);
+ stream << text;
+ f.close();
+
+ return true;
+}
+
+QString FileTemplate::fullPathForName(KDevPlugin *part, const QString &name,
+ Policy p) {
+ // if Policy is not default, full path is just the name
+ if (p!=Default) return name;
+
+ QString fileName;
+ // first try project-specific
+ if (part->project())
+ {
+ fileName = (part->project()->projectDirectory() + "/templates/" + name);
+ if (QFile::exists(fileName)) return fileName;
+ }
+
+ // next try global
+ QString globalName = ::locate("data", "kdevfilecreate/file-templates/" + name);
+ return globalName.isNull() ? fileName : globalName;
+}
diff --git a/lib/util/filetemplate.h b/lib/util/filetemplate.h
new file mode 100644
index 00000000..e126176d
--- /dev/null
+++ b/lib/util/filetemplate.h
@@ -0,0 +1,88 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _FILETEMPLATE_H_
+#define _FILETEMPLATE_H_
+
+#include <qstring.h>
+
+class KDevPlugin;
+class QDomDocument;
+
+/**
+@file filetemplate.h
+FileTemplate class with utility methods to work with file templates.
+*/
+
+/**
+Utilities to work with file templates in the current project.
+*/
+class FileTemplate
+{
+public:
+
+ /**Policy of finding file templates.*/
+ typedef enum {
+ Default /**<Checks for templates in project and also for global filecreate templates.*/,
+ Custom /**<Checks for templates in custom directories. This usually means that
+ full paths are given for FileTemplate methods.*/
+ } Policy;
+
+ /**
+ * @return Whether a template with the given name
+ * exists in the current project. File templates
+ * are stored in the "templates" subdirectory of a project or in application shared dirs.
+ */
+ static bool exists(KDevPlugin *part, const QString &name, Policy p = Default);
+
+ /**
+ * Reads a template with the given name (e.g. "cpp")
+ * and makes variable substitutions (like $AUTHOR$ etc.)
+ * in it. The resulting string is returned.
+ */
+ static QString read(KDevPlugin *part, const QString &name, Policy p = Default);
+
+ /**
+ * Reads a template with the given URL
+ * and makes variable substitutions (like $AUTHOR$ etc.)
+ * in it. The resulting string is returned.
+ */
+ static QString readFile(KDevPlugin *part, const QString &fileName);
+
+ /**
+ * Makes variable substitutions on a text, based on a specified QDomDocument
+ * describing a KDevelop project file. The resulting string is returned.
+ */
+ static QString makeSubstitutions(QDomDocument &dom, const QString &text);
+
+ /**
+ * Copies a file template with the given name to the
+ * file with the name dest and - while copying -
+ * performs variable substitutions.
+ */
+ static bool copy(KDevPlugin *part, const QString &name,
+ const QString &dest, Policy p = Default);
+ /**
+ * Translates a template name into a full path, or suggests a full path
+ * for the template in the project directory if it doesn't exist.
+ */
+ static QString fullPathForName(KDevPlugin *part, const QString &name, Policy p = Default);
+};
+
+#endif
diff --git a/lib/util/kdeveditorutil.cpp b/lib/util/kdeveditorutil.cpp
new file mode 100644
index 00000000..fdf044d5
--- /dev/null
+++ b/lib/util/kdeveditorutil.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 "kdeveditorutil.h"
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/selectioninterface.h>
+
+bool KDevEditorUtil::currentPositionReal( unsigned int * line, unsigned int * col, KTextEditor::Document * doc, KTextEditor::View * view )
+{
+ if ( !line || !col ) return false;
+
+ KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if ( !editIface ) return false;
+
+ view = view ? view : dynamic_cast<KTextEditor::View*>( doc->widget() );
+
+ KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( view );
+ if ( !cursorIface ) return false;
+
+ cursorIface->cursorPositionReal( line, col );
+ return true;
+}
+
+QString KDevEditorUtil::currentLine( KTextEditor::Document * doc, KTextEditor::View * view )
+{
+ KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if ( !editIface ) return QString();
+
+ view = view ? view : dynamic_cast<KTextEditor::View*>( doc->widget() );
+
+ KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( view );
+ if ( !cursorIface ) return QString();
+
+ uint line = 0;
+ uint col = 0;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ return editIface->textLine(line);
+}
+
+QString KDevEditorUtil::currentWord( KTextEditor::Document * doc, KTextEditor::View * view )
+{
+ KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
+ if ( !editIface ) return QString();
+
+ view = view ? view : dynamic_cast<KTextEditor::View*>( doc->widget() );
+
+ KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( view );
+ if ( !cursorIface ) return QString();
+
+ uint line = 0;
+ uint col = 0;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ QString linestr = editIface->textLine(line);
+
+ int startPos = QMAX( QMIN( (int)col, (int)linestr.length()-1 ), 0 );
+ int endPos = startPos;
+ startPos--;
+ while (startPos >= 0 && ( linestr[startPos].isLetterOrNumber() || linestr[startPos] == '_' || linestr[startPos] == '~') )
+ startPos--;
+ while (endPos < (int)linestr.length() && ( linestr[endPos].isLetterOrNumber() || linestr[endPos] == '_' ) )
+ endPos++;
+
+ return ( ( startPos == endPos ) ? QString::null : linestr.mid( startPos+1, endPos-startPos-1 ) );
+}
+
+
+QString KDevEditorUtil::currentSelection( KTextEditor::Document * doc )
+{
+ KTextEditor::SelectionInterface * selectIface = dynamic_cast<KTextEditor::SelectionInterface*>( doc );
+ return selectIface ? selectIface->selection() : QString();
+}
+
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs on;
+
diff --git a/lib/util/kdeveditorutil.h b/lib/util/kdeveditorutil.h
new file mode 100644
index 00000000..7b788fc3
--- /dev/null
+++ b/lib/util/kdeveditorutil.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * Copyright (C) 2007 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 KDEVEDITOR_H
+#define KDEVEDITOR_H
+
+namespace KTextEditor
+{
+class Document;
+class View;
+}
+
+#include <qstring.h>
+
+/**
+Class with some common utility operations not currently supported by KTE
+
+ @author Jens Dagerbo <jens.dagerbo@swipnet.se>
+*/
+class KDevEditorUtil
+{
+ KDevEditorUtil() {}
+public:
+
+ /**
+ *
+ * @param line
+ * @param col
+ * @param doc
+ * @param view
+ * @return
+ */
+ static bool currentPositionReal( unsigned int * line, unsigned int * col, KTextEditor::Document * doc, KTextEditor::View * view = 0 );
+
+ /**
+ *
+ * @param doc
+ * @param view
+ * @return
+ */
+ static QString currentLine( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
+
+ /**
+ * Call to get the text under the cursor of the currently active view.
+ * @return the text under the cursor of the currently active view
+ */
+ static QString currentWord( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
+
+ /**
+ * Call to get the selection in the currently active view
+ * @return the selection in the currently active view
+ */
+ static QString currentSelection( KTextEditor::Document * doc );
+};
+
+#endif
+
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs on;
diff --git a/lib/util/kdevjobtimer.cpp b/lib/util/kdevjobtimer.cpp
new file mode 100644
index 00000000..b7f9e2ae
--- /dev/null
+++ b/lib/util/kdevjobtimer.cpp
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 "kdevjobtimer.h"
+
+KDevJobTimer::KDevJobTimer( void * payload, QObject *parent, const char *name)
+ : QTimer(parent, name)
+{
+ m_payload = payload;
+ connect( this, SIGNAL(timeout()), this, SLOT(slotTimeout()) );
+}
+
+KDevJobTimer::~KDevJobTimer()
+{
+}
+
+void KDevJobTimer::singleShot(int msec, QObject * receiver, const char * member, void * payload)
+{
+ KDevJobTimer * p = new KDevJobTimer( payload );
+ p->start( msec, true );
+ connect( p, SIGNAL(timeout(void*)), receiver, member );
+}
+
+void KDevJobTimer::slotTimeout()
+{
+ emit timeout( m_payload );
+ m_payload = 0;
+ deleteLater();
+}
+
+#include "kdevjobtimer.moc"
diff --git a/lib/util/kdevjobtimer.h b/lib/util/kdevjobtimer.h
new file mode 100644
index 00000000..972a654a
--- /dev/null
+++ b/lib/util/kdevjobtimer.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 KDEVJOBTIMER_H
+#define KDEVJOBTIMER_H
+
+#include <qtimer.h>
+
+class KDevJobTimer : public QTimer
+{
+Q_OBJECT
+public:
+ static void singleShot( int msec, QObject * receiver, const char * member, void * payload );
+
+signals:
+ void timeout(void*);
+
+private:
+ KDevJobTimer( void * payload, QObject *parent = 0, const char *name = 0);
+ ~KDevJobTimer();
+
+private slots:
+ void slotTimeout();
+
+private:
+ void * m_payload;
+
+};
+
+
+#endif
diff --git a/lib/util/kdevshellwidget.cpp b/lib/util/kdevshellwidget.cpp
new file mode 100644
index 00000000..f9a61fea
--- /dev/null
+++ b/lib/util/kdevshellwidget.cpp
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qtimer.h>
+#include <qframe.h>
+
+#include <kdebug.h>
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kde_terminal_interface.h>
+#include <kprocess.h>
+
+#include "kdevshellwidget.h"
+
+KDevShellWidget::KDevShellWidget(QWidget *parent, const char *name)
+ : QVBox(parent, name), m_doAutoActivate( false ), m_isRunning( false )
+{
+}
+
+
+KDevShellWidget::~KDevShellWidget()
+{
+}
+
+void KDevShellWidget::setShell( const QString & shell, const QStrList & arguments )
+{
+ m_shellName = shell;
+ m_shellArguments = arguments;
+}
+
+void KDevShellWidget::activate( )
+{
+ KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart");
+ if ( !factory ) return;
+
+ m_konsolePart = (KParts::ReadOnlyPart *) factory->create( this, "libkonsolepart", "KParts::ReadOnlyPart" );
+ if ( !m_konsolePart ) return;
+
+ connect( m_konsolePart, SIGNAL( processExited(KProcess *) ), this, SLOT( processExited(KProcess *) ) );
+ connect( m_konsolePart, SIGNAL( receivedData( const QString& ) ), this, SIGNAL( receivedData( const QString& ) ) );
+ connect( m_konsolePart, SIGNAL(destroyed()), this, SLOT(partDestroyed()) );
+
+ m_konsolePart->widget()->setFocusPolicy( QWidget::WheelFocus );
+ setFocusProxy( m_konsolePart->widget() );
+ m_konsolePart->widget()->setFocus();
+
+ if ( m_konsolePart->widget()->inherits("QFrame") )
+ ((QFrame*)m_konsolePart->widget())->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+
+ m_konsolePart->widget()->show();
+
+ TerminalInterface* ti = static_cast<TerminalInterface*>( m_konsolePart->qt_cast( "TerminalInterface" ) );
+ if( !ti ) return;
+
+ if ( !m_shellName.isEmpty() )
+ ti->startProgram( m_shellName, m_shellArguments );
+
+ m_isRunning = true;
+
+}
+
+void KDevShellWidget::partDestroyed( )
+{
+ if ( m_doAutoActivate )
+ {
+ activate();
+ }
+}
+
+void KDevShellWidget::processExited( KProcess * proc )
+{
+ m_isRunning = false;
+
+ if ( !proc ) return;
+
+ kdDebug(9000) << proc->args() << endl;
+
+ if ( proc->normalExit() )
+ emit shellExited( proc->exitStatus() );
+ else if ( proc->signalled() )
+ emit shellSignalled( proc->exitSignal() );
+}
+
+void KDevShellWidget::sendInput( const QString & text )
+{
+ if ( !m_konsolePart ) return;
+ TerminalInterface* ti = static_cast<TerminalInterface*>( m_konsolePart->qt_cast( "TerminalInterface" ) );
+ if( !ti ) return;
+
+ ti->sendInput( text );
+}
+
+bool KDevShellWidget::isRunning( )
+{
+ return m_isRunning;
+}
+
+void KDevShellWidget::setAutoReactivateOnClose( bool doAutoActivate )
+{
+ // to auto reactivate can be dangerous, do it like this to avoid
+ // reactivating with a non-working setting (the partDestroyed()
+ // slot will have ran before m_doAutoActivate is set)
+ if ( doAutoActivate )
+ QTimer::singleShot( 3000, this, SLOT(setAutoReactivateOnCloseDelayed()) );
+ else
+ m_doAutoActivate = false;
+}
+
+void KDevShellWidget::setAutoReactivateOnCloseDelayed( )
+{
+ m_doAutoActivate = true;
+}
+
+
+#include "kdevshellwidget.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/lib/util/kdevshellwidget.h b/lib/util/kdevshellwidget.h
new file mode 100644
index 00000000..3f1500aa
--- /dev/null
+++ b/lib/util/kdevshellwidget.h
@@ -0,0 +1,100 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 KDEVSHELLWIDGET_H
+#define KDEVSHELLWIDGET_H
+
+#include <qstrlist.h>
+#include <qvbox.h>
+#include <qguardedptr.h>
+
+class KProcess;
+namespace KParts
+{
+ class ReadOnlyPart;
+}
+
+class KDevShellWidget : public QVBox
+{
+
+Q_OBJECT
+
+public:
+ KDevShellWidget(QWidget *parent = 0, const char *name = 0);
+ virtual ~KDevShellWidget();
+
+ /**
+ * Stores the shell name and arguments, that will be used in @ref activate()
+ * @param shell The shell name, for example 'irb' or '/bin/bash'
+ * @param arguments Any optional arguments
+ */
+ void setShell( const QString & shell, const QStrList & arguments = QStrList() );
+
+ /**
+ * Executes the previously set shell. If @ref setShell wasn't called before
+ * konsolepart will decide what to use.
+ */
+ void activate();
+
+ /**
+ * Should we auto launch the shell again if it was terminated?
+ * @param doAutoActivate
+ */
+ void setAutoReactivateOnClose( bool doAutoActivate );
+
+ /**
+ * Send text to the running shell
+ * @param text The text to send to the shell
+ */
+ void sendInput( const QString & text );
+
+ /**
+ * Call to check if the shell is currently running
+ * @return true if the shell is currently running
+ */
+ bool isRunning();
+
+signals:
+ /**
+ * This signal will be emmitted when the started shell exits normally
+ * @param exitcode The return code of the process
+ */
+ void shellExited( int exitcode );
+
+ /**
+ * This signal will be emitted when the started shell is terminated by a signal
+ * @param signalcode The signal the process was killed with
+ */
+ void shellSignalled( int signalcode );
+
+ /**
+ * This signal will be emitted when the process receives data
+ * @param text received data
+ */
+ void receivedData( const QString & );
+
+private slots:
+ void partDestroyed();
+ void processExited( KProcess * );
+ void setAutoReactivateOnCloseDelayed( );
+
+private:
+ QGuardedPtr<KParts::ReadOnlyPart> m_konsolePart;
+ QString m_shellName;
+ QStrList m_shellArguments;
+ bool m_doAutoActivate;
+ bool m_isRunning;
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/lib/util/kscriptactionmanager.cpp b/lib/util/kscriptactionmanager.cpp
new file mode 100644
index 00000000..cf73e949
--- /dev/null
+++ b/lib/util/kscriptactionmanager.cpp
@@ -0,0 +1,177 @@
+/***************************************************************************
+* Copyright (C) 2004 by ian geiser *
+* geiseri@sourcextreme.com *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#include "kscriptactionmanager.h"
+#include <kparts/part.h>
+#include <kparts/componentfactory.h>
+#include <kapplication.h>
+#include <kdesktopfile.h>
+#include <kstandarddirs.h>
+
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <scriptinterface.h>
+#include <kaction.h>
+#include <qfileinfo.h>
+#include <qtimer.h>
+
+KScriptAction::KScriptAction( const QString &scriptDesktopFile, QObject *interface, KActionCollection *ac )
+ : QObject(interface), KScriptClientInterface( )
+{
+ m_interface = 0L;
+ m_action = 0L;
+ m_isValid = false;
+ m_refs = 0;
+ // Read the desktop file
+ if(KDesktopFile::isDesktopFile(scriptDesktopFile))
+ {
+ KDesktopFile desktop(scriptDesktopFile, true);
+ QFileInfo scriptPath(scriptDesktopFile);
+
+ m_scriptFile = scriptPath.dirPath(true) + "/" + desktop.readEntry("X-KDE-ScriptName", "");
+ m_scriptName = desktop.readName();
+ m_scriptType = desktop.readType();
+ QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
+ KTrader::OfferList offers = KTrader::self()->query( "KScriptRunner/KScriptRunner", scriptTypeQuery );
+ if ( !offers.isEmpty() )
+ {
+ m_action = new KAction(m_scriptName, KShortcut(), this, SLOT(activate()), ac, "script");
+ m_isValid = true;
+ m_timeout = new QTimer(this);
+ QString icon = desktop.readIcon();
+ m_action->setStatusText(desktop.readComment());
+ if( !icon.isEmpty() )
+ m_action->setIcon(icon);
+ m_action->setShortcutConfigurable(true);
+ connect( m_timeout, SIGNAL(timeout()), SLOT(cleanup()) );
+ }
+ }
+}
+
+KScriptAction::~KScriptAction()
+{
+ if( m_interface ) delete m_interface;
+ if( m_action ) delete m_action;
+}
+
+
+
+KAction * KScriptAction::action( )
+{
+ return m_action;
+}
+
+void KScriptAction::activate( )
+{
+ if( m_interface == 0L)
+ {
+ QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
+ m_interface= KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>( "KScriptRunner/KScriptRunner", scriptTypeQuery, this );
+ if ( m_interface != 0L)
+ {
+ m_interface->ScriptClientInterface= this;
+ if( m_scriptMethod.isEmpty() )
+ m_interface->setScript(m_scriptFile);
+ else
+ m_interface->setScript(m_scriptFile, m_scriptMethod);
+ connect(this, SIGNAL(done(KScriptClientInterface::Result, const QVariant &)), this, SLOT(scriptFinished()));
+ }
+ else
+ {
+ KMessageBox::sorry(0, i18n("Unable to get KScript Runner for type \"%1\".").arg(m_scriptType), i18n("KScript Error"));
+ kdDebug() << "Query string: " << scriptTypeQuery << endl;
+ return;
+ }
+ }
+ m_interface->run(parent(), QVariant());
+ m_timeout->start(60000,FALSE); // after 1 minute unload
+ m_refs++;
+}
+
+void KScriptAction::cleanup()
+{
+ if( m_interface && m_refs == 0)
+ {
+ delete m_interface;
+ m_interface = 0L;
+ }
+}
+
+void KScriptAction::scriptFinished()
+{
+ m_refs--;
+}
+
+KScriptActionManager::KScriptActionManager( QObject *parent, KActionCollection * ac ) : QObject(parent), m_ac(ac)
+{
+ m_actions.setAutoDelete(true);
+}
+
+KScriptActionManager::~ KScriptActionManager( )
+{
+ m_actions.clear();
+}
+
+QPtrList< KAction > KScriptActionManager::scripts( QObject * interface , const QStringList &dirs) const
+{
+ m_actions.clear();
+ QPtrList<KAction> actions;
+ QStringList scripts;
+
+ scripts += KGlobal::dirs()->findAllResources("data",
+ QString(kapp->name())+"/scripts/*.desktop", false, true );
+
+ for( QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
+ {
+ scripts += KGlobal::dirs()->findAllResources("data",
+ (*it)+"/*.desktop", false, true );
+ }
+
+ for (QStringList::Iterator it = scripts.begin(); it != scripts.end(); ++it )
+ {
+ kdDebug() << "Loading " << *it << endl;
+ KScriptAction *script = new KScriptAction(*it, interface, m_ac);
+ if( script->isValid())
+ {
+ actions.append(script->action());
+ m_actions.append(script);
+ connect(script, SIGNAL(error( const QString&)), this,
+ SIGNAL(scriptError( const QString&)));
+ connect(script, SIGNAL(warning( const QString&)), this,
+ SIGNAL(scriptWarning( const QString&)));
+ connect(script, SIGNAL(output( const QString&)), this,
+ SIGNAL(scriptOutput( const QString&)));
+ connect(script, SIGNAL(progress( int )), this,
+ SIGNAL(scriptProgress(int)));
+ connect(script, SIGNAL(done( KScriptClientInterface::Result, const QVariant &)),this,
+ SIGNAL(scriptDone( KScriptClientInterface::Result, const QVariant &)));
+ }
+ else
+ delete script;
+ }
+ return actions;
+}
+
+bool KScriptAction::isValid( ) const
+{
+ return m_isValid;
+}
+
+#include "kscriptactionmanager.moc"
diff --git a/lib/util/kscriptactionmanager.h b/lib/util/kscriptactionmanager.h
new file mode 100644
index 00000000..234e4a3c
--- /dev/null
+++ b/lib/util/kscriptactionmanager.h
@@ -0,0 +1,139 @@
+/***************************************************************************
+* Copyright (C) 2004 by ian geiser *
+* geiseri@sourcextreme.com *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+#ifndef KScriptAction_H
+#define KScriptAction_H
+
+#include <scriptclientinterface.h>
+#include <qobject.h>
+#include <qptrlist.h>
+
+class KAction;
+class KActionCollection;
+class KScriptInterface;
+class KScriptActionManager;
+class QTimer;
+
+/**
+* Connects a KAction to a script runner.
+*
+* @author ian geiser geiseri@sourcextreme.com
+*/
+class KScriptAction : public QObject, public KScriptClientInterface {
+ Q_OBJECT
+public:
+
+ KScriptAction( const QString &scriptDesktopFile, QObject *interface, KActionCollection *ac );
+
+ virtual ~KScriptAction();
+
+ /**
+ * KAction for the current script
+ */
+ KAction *action();
+
+ /**
+ * Returns the validity of the current script.
+ */
+ bool isValid() const;
+
+signals:
+ // Reimplemented from KScript
+ void error ( const QString &msg );
+ void warning ( const QString &msg );
+ void output ( const QString &msg );
+ void progress ( int percent );
+ void done ( KScriptClientInterface::Result result, const QVariant &returned );
+
+signals:
+ void scriptError ( const QString &msg );
+ void scriptWarning ( const QString &msg );
+ void scriptOutput ( const QString &msg );
+ void scriptProgress ( int percent );
+ void scriptDone ( KScriptClientInterface::Result result, const QVariant &returned );
+
+private slots:
+ void activate();
+ void cleanup();
+ void scriptFinished();
+
+private:
+ KAction *m_action;
+ QString m_scriptName;
+ QString m_scriptType;
+ QString m_scriptFile;
+ QString m_scriptMethod;
+ KScriptInterface *m_interface;
+ bool m_isValid;
+ QTimer *m_timeout;
+ uint m_refs;
+};
+
+/**
+ * Provides an actionlist of scripts that are currently available.
+ * Scripts are not actually loaded until they are actually executed.
+ * @author ian geiser <geiseri@sourcextreme.com>
+ */
+class KScriptActionManager : public QObject {
+Q_OBJECT
+
+public:
+ /**
+ * Create a script manager that is attached to an action collection.
+ */
+ KScriptActionManager( QObject *parent, KActionCollection *ac );
+ ~KScriptActionManager();
+
+ /**
+ * Return all currently loaded scripts in a direcotry and attaches them
+ * to a QObject interface. If the dirs are empty the current applications
+ * scripts directory is used. The dirs are actual directories to search
+ * in the $KDEPATH/data/ direcories. So if you add "coolapp/data" then
+ * the manager will search in $KDEPATH/data/coolapp/data for all desktop
+ * files that are scripts.
+ */
+ QPtrList<KAction> scripts( QObject *interface, const QStringList &dirs = QStringList() ) const;
+
+signals:
+ /**
+ * Returns an error message from a script.
+ */
+ void scriptError ( const QString &msg );
+ /**
+ * Returns a warning message from a script.
+ */
+ void scriptWarning ( const QString &msg );
+ /**
+ * Returns a standard out message from a script.
+ */
+ void scriptOutput ( const QString &msg );
+ /**
+ * Returns the percentage complete of an operation in the script.
+ */
+ void scriptProgress ( int percent );
+ /**
+ * Notifies that the script has finished.
+ */
+ void scriptDone( KScriptClientInterface::Result result, const QVariant &returned );
+
+private:
+ mutable QPtrList<KScriptAction> m_actions;
+ KActionCollection *m_ac;
+};
+#endif
diff --git a/lib/util/rurl.cpp b/lib/util/rurl.cpp
new file mode 100644
index 00000000..1ec23434
--- /dev/null
+++ b/lib/util/rurl.cpp
@@ -0,0 +1,369 @@
+#include <qstringlist.h>
+
+#include "rurl.h"
+
+namespace Relative{
+
+
+//class Name
+
+Name::Name( const QString & rurl, const Type type )
+ :m_rurl(rurl), m_type(type)
+{
+ correct();
+}
+
+Name::Name( const char * rurl, const Type type )
+ :m_rurl(rurl), m_type(type)
+{
+ correct();
+}
+
+void Name::correct()
+{
+ cleanRURL();
+ if (m_rurl[0] == '/')
+ m_rurl = m_rurl.mid(1);
+ switch (m_type)
+ {
+ case File:
+ if (m_rurl.endsWith("/"))
+ m_rurl = m_rurl.mid(0, m_rurl.length()-1);
+ break;
+ case Directory:
+ if (!m_rurl.endsWith("/"))
+ m_rurl += "/";
+ break;
+ case Auto:
+ if (m_rurl.endsWith("/"))
+ m_type = Directory;
+ else
+ m_type = File;
+ break;
+ }
+}
+
+QString Name::correctName( const QString & rurl, const Type type )
+{
+ QString temp = rurl;
+ temp = Name::cleanName(temp);
+ if (temp[0] == '/')
+ temp = temp.mid(1);
+
+ switch (type)
+ {
+ case File:
+ if (temp.endsWith("/"))
+ temp = temp.mid(0, temp.length()-1);
+ break;
+ case Directory:
+ if (!temp.endsWith("/"))
+ temp += "/";
+ break;
+ }
+
+ return temp;
+}
+
+void Name::setRURL( const QString & rurl, const Type type )
+{
+ m_rurl = rurl;
+ m_type = type;
+ correct();
+}
+
+QString Name::rurl( ) const
+{
+ return m_rurl;
+}
+
+void Name::addPath( const QString & addendum )
+{
+ QString temp = correctName(addendum, Directory);
+ m_rurl = directory() + temp + fileName();
+}
+
+void Name::cleanRURL( )
+{
+ m_rurl = cleanName(m_rurl);
+}
+
+QString Name::cleanName( const QString & rurl )
+{
+ QString temp;
+ bool wasSlash = false;
+ for (unsigned int i = 0; i < rurl.length(); ++i)
+ {
+ if (wasSlash && (rurl[i] == '/'))
+ continue;
+
+ temp += rurl[i];
+ if (rurl[i] == '/')
+ wasSlash = true;
+ else if (wasSlash)
+ wasSlash = false;
+ }
+
+ return temp;
+}
+
+QString Name::extension( bool complete ) const
+{
+ if (m_type == File)
+ {
+ QString temp = fileName();
+ if (complete)
+ return temp.mid(temp.find('.')+1);
+ else
+ return temp.mid(temp.findRev('.')+1);
+ }
+ return QString::null;
+}
+
+QString Name::fileName( ) const
+{
+ if (m_type == File)
+ return m_rurl.section('/', -1);
+ return QString::null;
+}
+
+QString Name::directory( ) const
+{
+ if ( (m_type == File) && (m_rurl.findRev('/') == -1) )
+ return QString::null;
+
+ return m_rurl.mid(0, m_rurl.findRev('/')+1);
+}
+
+bool Name::isFile( ) const
+{
+ return m_type == File;
+}
+
+bool Name::isDirectory( ) const
+{
+ return m_type == Directory;
+}
+
+bool Name::operator ==( const Name & rname )
+{
+ return rname.rurl() == m_rurl;
+}
+
+bool Name::operator !=( const Name & rname )
+{
+ return rname.rurl() != m_rurl;
+}
+
+bool Name::isValid( ) const
+{
+ if (m_rurl.startsWith("/"))
+ return false;
+ if (m_rurl.contains("//"))
+ return false;
+ if ( (m_rurl.endsWith("/")) && (m_type == File) )
+ return false;
+ if ( (!m_rurl.endsWith("/")) && (m_type == Directory) )
+ return false;
+ if (m_type == Auto)
+ return false;
+
+ return true;
+}
+
+Name::Type Name::type( ) const
+{
+ return m_type;
+}
+
+void Name::setType( const Type type )
+{
+ m_type = type;
+}
+
+Name Name::relativeName( const QString &base, const QString &url )
+{
+ QString dirUrl = base;
+ QString fileUrl = url;
+
+ if (dirUrl.isEmpty() || (dirUrl == "/"))
+ return Name(fileUrl);
+
+ QStringList dir = QStringList::split("/", dirUrl, false);
+ QStringList file = QStringList::split("/", fileUrl, false);
+
+ QString resFileName = file.last();
+ if (url.endsWith("/"))
+ resFileName += "/";
+ file.remove(file.last());
+
+ uint i = 0;
+ while ( (i < dir.count()) && (i < (file.count())) && (dir[i] == file[i]) )
+ i++;
+
+ QString result_up;
+ QString result_down;
+ QString currDir;
+ QString currFile;
+ do
+ {
+ i >= dir.count() ? currDir = "" : currDir = dir[i];
+ i >= file.count() ? currFile = "" : currFile = file[i];
+// qWarning("i = %d, currDir = %s, currFile = %s", i, currDir.latin1(), currFile.latin1());
+ if (currDir.isEmpty() && currFile.isEmpty())
+ break;
+ else if (currDir.isEmpty())
+ result_down += file[i] + "/";
+ else if (currFile.isEmpty())
+ result_up += "../";
+ else
+ {
+ result_down += file[i] + "/";
+ result_up += "../";
+ }
+ i++;
+ }
+ while ( (!currDir.isEmpty()) || (!currFile.isEmpty()) );
+
+ return result_up + result_down + resFileName;
+}
+
+
+
+//class URL
+
+URL::URL( KURL base, KURL url, Type type )
+ :Name(Name::relativeName(base.path(), url.path()).rurl(), type), m_base(base)
+{
+}
+
+URL::URL( KURL base, QString url, bool isUrlRelative, Type type )
+ :Name(isUrlRelative ? url : Name::relativeName(base.path(), url).rurl(), type), m_base(base)
+{
+}
+
+void URL::setBase( const KURL & base )
+{
+ m_base = base;
+}
+
+void URL::setBase( const QString & base )
+{
+ KURL url;
+ url.setPath(base);
+ m_base = url;
+}
+
+KURL URL::base( ) const
+{
+ return m_base;
+}
+
+QString URL::basePath( ) const
+{
+ return m_base.path(1);
+}
+
+KURL URL::url( ) const
+{
+ KURL url = m_base;
+ url.addPath(rurl());
+ url.cleanPath();
+ return url;
+}
+
+QString URL::urlPath( ) const
+{
+ KURL url = m_base;
+ url.addPath(rurl());
+ int mod = 0;
+ if (type() == File)
+ mod = -1;
+ else if (type() == Directory)
+ mod = 1;
+ url.cleanPath();
+ return url.path(mod);
+}
+
+QString URL::urlDirectory( ) const
+{
+ KURL url = m_base;
+ url.addPath(rurl());
+ url.cleanPath();
+ return url.directory(false, false);
+}
+
+URL URL::relativeTo( KURL base )
+{
+ return URL(base, url(), type());
+}
+
+URL URL::relativeURL( KURL base, KURL url )
+{
+ return URL(base, url);
+}
+
+URL URL::relativeURL( KURL base, QString url, bool isUrlRelative )
+{
+ return URL(base, url, isUrlRelative);
+}
+
+bool Relative::URL::operator ==( const URL & url )
+{
+ return (m_base == url.base()) && (rurl() == url.rurl());
+}
+
+bool Relative::URL::operator !=( const URL & url )
+{
+ return (m_base != url.base()) || (rurl() != url.rurl());
+}
+
+
+
+// Directory class
+
+Directory::Directory( KURL base, KURL url )
+ :URL(base, url, Name::Directory)
+{
+}
+
+Directory::Directory( KURL base, QString url, bool isRelativeUrl )
+ :URL(base, url, isRelativeUrl, Name::Directory)
+{
+}
+
+void Directory::setRURL( QString rurl )
+{
+ URL::setRURL(rurl, Name::Directory);
+}
+
+void Directory::setRURL( QString rurl, Type type )
+{
+ URL::setRURL(rurl, type);
+}
+
+
+
+//File class
+
+File::File( KURL base, KURL url )
+ :URL(base, url, Name::File)
+{
+}
+
+File::File( KURL base, QString url, bool isRelativeUrl )
+ :URL(base, url, isRelativeUrl, Name::File)
+{
+}
+
+void File::setRURL( QString rurl, Type type )
+{
+ URL::setRURL(rurl, type);
+}
+
+void File::setRURL( QString rurl )
+{
+ URL::setRURL(rurl, Name::File);
+}
+
+}
diff --git a/lib/util/rurl.h b/lib/util/rurl.h
new file mode 100644
index 00000000..342b3e3d
--- /dev/null
+++ b/lib/util/rurl.h
@@ -0,0 +1,182 @@
+#ifndef RURL_H_LIB
+#define RURL_H_LIB
+
+#include <kurl.h>
+
+/**
+@file rurl.h
+Classes and functions to work with relative URLs.
+*/
+
+/**Classes and functions to work with relative URLs.*/
+namespace Relative
+{
+
+/**Relative name of a file or directory.*/
+class Name{
+public:
+ enum Type { File, Directory, Auto };
+
+ /**Constructor takes the relative name of a directory or file.
+ Leading slash in the name will be deleted.
+ If type is Auto names like:
+ name/name/ are directories
+ name/name are files.
+ Trailing slash will be deleted for files (type == File).*/
+ Name(const QString &rurl, const Type type = Auto);
+ Name(const char *rurl, const Type type = Auto);
+
+ /**Sets the relative name.*/
+ void setRURL(const QString &rurl, const Type type);
+ /**Gets the relative name in form
+ dir/dir/ -> directory
+ or
+ dir/dir/file -> file.*/
+ QString rurl() const;
+
+ /**Adds addendum to the directory path. This honors file names so
+ if RName represents /dir1/dir2/fname.ext
+ addPath(dir3) will change RName to /dir1/dir2/dir3/fname.ext*/
+ void addPath(const QString &addendum);
+ /**Removes "//" from the name.*/
+ void cleanRURL();
+
+ /**Returns the extension of a file or QString::null for directories.
+ If complete is true then returns extensions like "tar.gz".
+ Else returns "gz".*/
+ QString extension(bool complete = true) const;
+ /**Returns the name of the file without the path or QString::null
+ for directories.*/
+ QString fileName() const;
+ /**Returns the name of the directory or QString::null if there are no dirs in path.*/
+ QString directory() const;
+
+ /**Returns true if the type of RName is file.*/
+ bool isFile() const;
+ /**Returns true if the type of RName is directory.*/
+ bool isDirectory() const;
+ /**Checks if RName is valid.*/
+ bool isValid() const;
+
+ /**Returns a type of the relative name - file or directory.*/
+ Type type() const;
+ /**Sets a type of the relative name - file or directory.
+ If Auto is passed, nothing happens.*/
+ void setType(const Type type);
+
+ /**Creates and returns relative name between base and url. Base and url should be absolute.
+ Base is considered to be a directory.*/
+ static Name relativeName(const QString &base, const QString &url);
+ /**Cleans rurl by removing extra slashes.*/
+ static QString cleanName(const QString &rurl);
+ /**Corrects rurl according to the given type and returns corrected url.
+ Also cleans url (see @ref cleanRURL).*/
+ static QString correctName(const QString &rurl, const Type type = Auto);
+
+ bool operator == (const Name &rname);
+ bool operator != (const Name &rname);
+
+protected:
+ /**Corrects m_rurl and m_type according to the relative name storing policy,
+ i.e. removes leading slash, removes trailing slash for files, changes type
+ to be either File or Directory, but not Auto. Also cleans url (see @ref cleanRURL).*/
+ void correct();
+
+private:
+ QString m_rurl;
+ Type m_type;
+};
+
+/**Relative name of file or directory to some base location.*/
+class URL: public Name{
+public:
+ /**Evaluates the relative path between url and base and creates RURL object.
+ base should be an url to the directory or location, not a file.
+ The check is not performed. url should be the usual url. Only the
+ path of this url is taken into account when evaluating relative path.*/
+ URL(KURL base, KURL url, Type type = Auto);
+ /**Creates RURL object with given base and relative or full url (according to
+ the isUrlRelative value).*/
+ URL(KURL base, QString url, bool isUrlRelative, Type type = Auto);
+
+ /**Sets a new base for a RURL.*/
+ void setBase(const KURL &base);
+ /**Sets a new base for a RURL. Base is is considered to be a
+ directory and converted to KURL using KURL::setPath().*/
+ void setBase(const QString &base);
+ /**Returns RURL base.*/
+ KURL base() const;
+ /**Returns a path of a base KURL (using KURL::path()). Trailing slash is guaranteed.*/
+ QString basePath() const;
+
+ /**Returns a complete url to the RURL location. This is basically base + rurl.
+ This also resolves ".." components in path.
+ Directories always have trailing slash in KURL
+ (this means that if url() == "file:/test/dir/" then
+ url() != KURL("/test/dir") and
+ url() == KURL("/test/dir/").*/
+ KURL url() const;
+ /**Returns a path of a complete url to the location. The url is basically base + rurl.
+ This method only returns a path part of the KURL (using KURL::path()).
+ Trailing slash is guaranteed for directories and no trailing slash - for files.
+ This also resolves ".." components in path.*/
+ QString urlPath() const;
+ /**Returns a directory of a complete url to the location. The url is constructed as base + rurl.
+ Returns the same as urlPath() for directories.
+ This method uses KURL::directory to determine the directory.
+ Trailing slash is guaranteed.
+ This also resolves ".." components in path.*/
+ QString urlDirectory() const;
+
+ /**Returns a new URL that is relative to given base. Relative part is taken from
+ current URL object.*/
+ URL relativeTo(KURL base);
+
+ /**Returns a new relative URL constructed from base and given url.*/
+ static URL relativeURL(KURL base, KURL url);
+ /**Returns a new relative URL constructed from base and given url. url parameter
+ is either relative or full (depends on isUrlRelative value).*/
+ static URL relativeURL(KURL base, QString url, bool isUrlRelative);
+
+ bool operator == (const URL &url);
+ bool operator != (const URL &url);
+
+private:
+ KURL m_base;
+};
+
+/**Relative directory name.*/
+class Directory: public URL{
+public:
+ /**Works as URL::URL(KURL, KURL), only implies Name::Directory mode.*/
+ Directory(KURL base, KURL url);
+ /**Works as URL::URL(KURL, QString, bool), only implies Name::Directory mode.*/
+ Directory(KURL base, QString url, bool isRelativeUrl);
+
+ /**Works as URL::setRURL(QString), only implies Name::Directory mode.*/
+ void setRURL(QString rurl);
+
+private:
+ void setRURL(QString rurl, Type type);
+
+};
+
+/**Relative file name.*/
+class File: public URL{
+public:
+ /**Works as URL::URL(KURL, KURL), only implies Name::File mode.*/
+ File(KURL base, KURL url);
+ /**Works as URL::URL(KURL, KURL), only implies Name::File mode.*/
+ File(KURL base, QString url, bool isRelativeUrl);
+
+ /**Works as URL::setRURL(QString), only implies Name::File mode.*/
+ void setRURL(QString rurl);
+
+private:
+ void setRURL(QString rurl, Type type);
+
+};
+
+}
+
+#endif
diff --git a/lib/util/settings.cpp b/lib/util/settings.cpp
new file mode 100644
index 00000000..4e246e5b
--- /dev/null
+++ b/lib/util/settings.cpp
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <kconfig.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+
+#include "settings.h"
+
+QString Settings::terminalEmulatorName( KConfig & config )
+{
+ config.setGroup("TerminalEmulator");
+ bool useKDESetting = config.readBoolEntry( "UseKDESetting", true );
+ QString terminal;
+
+ if ( useKDESetting )
+ {
+ KConfigGroup confGroup( KGlobal::config(), QString::fromLatin1("General") );
+ terminal = confGroup.readEntry("TerminalApplication", QString::fromLatin1("konsole"));
+ }
+ else
+ {
+ terminal = config.readEntry( "TerminalApplication", QString::fromLatin1("konsole"));
+ }
+ return terminal;
+}
+
+QString Settings::profileByAttributes(const QString &language, const QStringList &keywords)
+{
+ KConfig config(locate("data", "kdevelop/profiles/projectprofiles"));
+ config.setGroup(language);
+
+ QStringList profileKeywords = QStringList::split("/", "Empty");
+ if (config.hasKey("Keywords"))
+ profileKeywords = config.readListEntry("Keywords");
+
+ int idx = 0;
+ for (QStringList::const_iterator it = profileKeywords.constBegin();
+ it != profileKeywords.constEnd(); ++it)
+ {
+ if (keywords.contains(*it))
+ {
+ idx = profileKeywords.findIndex(*it);
+ break;
+ }
+ }
+
+ QStringList profiles;
+ if (config.hasKey("Profiles"))
+ {
+ profiles = config.readListEntry("Profiles");
+ return profiles[idx];
+ }
+ return "KDevelop";
+}
diff --git a/lib/util/settings.h b/lib/util/settings.h
new file mode 100644
index 00000000..cd241cad
--- /dev/null
+++ b/lib/util/settings.h
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 SETTINGS_H
+#define SETTINGS_H
+
+class KConfig;
+
+/// Utility functions for settings
+class Settings
+{
+public:
+ static QString terminalEmulatorName( KConfig & config );
+ static QString profileByAttributes(const QString &language, const QStringList &keywords);
+
+};
+
+#endif
diff --git a/lib/util/urlutil.cpp b/lib/util/urlutil.cpp
new file mode 100644
index 00000000..942f1900
--- /dev/null
+++ b/lib/util/urlutil.cpp
@@ -0,0 +1,319 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <qstringlist.h>
+
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <kdebug.h>
+
+#include <unistd.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "urlutil.h"
+
+#include <kdeversion.h>
+
+///////////////////////////////////////////////////////////////////////////////
+// Namespace URLUtil
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::filename(const QString & name) {
+ int slashPos = name.findRev("/");
+ return slashPos<0 ? name : name.mid(slashPos+1);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::directory(const QString & name) {
+ int slashPos = name.findRev("/");
+ return slashPos<0 ? QString("") : name.left(slashPos);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::getRelativePath(const QString& basepath, const QString& destpath)
+{
+ QString relpath = ".";
+ if (!QFile::exists(basepath) ||
+ !QFile::exists(destpath))
+ return "";
+ QStringList basedirs = QStringList::split(QString( QChar( QDir::separator() ) ),basepath);
+ QStringList destdirs = QStringList::split(QString( QChar( QDir::separator() ) ),destpath);
+
+ int maxCompare=0;
+ if (basedirs.count()>=destdirs.count())
+ maxCompare=destdirs.count();
+ else
+ maxCompare=basedirs.count();
+ int lastCommonDir=-1;
+ for (int i=0; i<maxCompare; i++)
+ {
+ if (basedirs[i] != destdirs[i])
+ break;
+ lastCommonDir=i;
+ }
+ for (uint i=0;i<basedirs.count()-(lastCommonDir+1); i++)
+ relpath += QString( QChar( QDir::separator() ) )+QString("..");
+ for (int i=0; i<lastCommonDir+1; i++)
+ destdirs.pop_front();
+ if (destdirs.count())
+ relpath += QString( QChar( QDir::separator() ) )+destdirs.join( QChar( QDir::separator() ) );
+ return QDir::cleanDirPath(relpath);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) {
+ bool slashPrefix = slashPolicy & SLASH_PREFIX;
+ bool slashSuffix = slashPolicy & SLASH_SUFFIX;
+ if (parent.equals(child,true))
+ return slashPrefix ? QString("/") : QString("");
+
+ if (!parent.isParentOf(child)) return QString();
+ int a=slashPrefix ? -1 : 1;
+ int b=slashSuffix ? 1 : -1;
+ return child.path(b).mid(parent.path(a).length());
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::relativePath(const QString & parent, const QString & child, uint slashPolicy) {
+ return relativePath(KURL(parent), KURL(child), slashPolicy);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::upDir(const QString & path, bool slashSuffix) {
+ int slashPos = path.findRev("/");
+ if (slashPos<1) return QString::null;
+ return path.mid(0,slashPos+ (slashSuffix ? 1 : 0) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KURL URLUtil::mergeURL(const KURL & source, const KURL & dest, const KURL & child) {
+
+ // if already a child of source, then fine
+ if (source.isParentOf(child) || source.equals(child,true)) return child;
+
+ // if not a child of dest, return blank URL (error)
+ if (!dest.isParentOf(child) && !dest.equals(child,true)) return KURL();
+
+ // if child is same as dest, return source
+ if (dest.equals(child,true)) return source;
+
+ // calculate
+ QString childUrlStr = child.url(-1);
+ QString destStemStr = dest.url(1);
+ QString sourceStemStr = source.url(1);
+ return KURL(sourceStemStr.append( childUrlStr.mid( destStemStr.length() ) ) );
+
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::getExtension(const QString & path) {
+ int dotPos = path.findRev('.');
+ if (dotPos<0) return QString("");
+ return path.mid(dotPos+1);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &url )
+{
+ QString absBase = extractPathNameAbsolute( baseDirUrl ),
+ absRef = extractPathNameAbsolute( url );
+ int i = absRef.find( absBase, 0, true );
+
+ if (i == -1)
+ return QString();
+
+ if (absRef == absBase)
+ return QString( "." );
+ else
+ return absRef.replace( 0, absBase.length(), QString() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::extractPathNameRelative(const QString &basePath, const KURL &url )
+{
+ KURL baseDirUrl = KURL::fromPathOrURL( basePath );
+ return extractPathNameRelative( baseDirUrl, url );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::extractPathNameRelative(const QString &basePath, const QString &absFilePath )
+{
+ KURL baseDirUrl = KURL::fromPathOrURL( basePath ),
+ fileUrl = KURL::fromPathOrURL( absFilePath );
+ return extractPathNameRelative( baseDirUrl, fileUrl );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::extractPathNameAbsolute( const KURL &url )
+{
+ if (isDirectory( url ))
+ return url.path( +1 ); // with trailing "/" if none is present
+ else
+ {
+ // Ok, this is an over-tight pre-condition on "url" since I hope nobody will never
+ // stress this function with absurd cases ... but who knows?
+ /*
+ QString path = url.path();
+ QFileInfo fi( path ); // Argh: QFileInfo is back ;))
+ return ( fi.exists()? path : QString() );
+ */
+ return url.path();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool URLUtil::isDirectory( const KURL &url )
+{
+ return isDirectory( url.path() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool URLUtil::isDirectory( const QString &absFilePath )
+{
+ return QDir( absFilePath ).exists();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void URLUtil::dump( const KURL::List &urls, const QString &aMessage )
+{
+ if (!aMessage.isNull())
+ {
+ kdDebug(9000) << aMessage << endl;
+ }
+ kdDebug(9000) << " List has " << urls.count() << " elements." << endl;
+
+ for (size_t i = 0; i<urls.count(); ++i)
+ {
+ KURL url = urls[ i ];
+// kdDebug(9000) << " * Element = " << url.path() << endl;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList URLUtil::toRelativePaths( const QString &baseDir, const KURL::List &urls)
+{
+ QStringList paths;
+
+ for (size_t i=0; i<urls.count(); ++i)
+ {
+ paths << extractPathNameRelative( baseDir, urls[i] );
+ }
+
+ return paths;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString URLUtil::relativePathToFile( const QString & dirUrl, const QString & fileUrl )
+{
+ if (dirUrl.isEmpty() || (dirUrl == "/"))
+ return fileUrl;
+
+ QStringList dir = QStringList::split("/", dirUrl, false);
+ QStringList file = QStringList::split("/", fileUrl, false);
+
+ QString resFileName = file.last();
+ file.remove(file.last());
+
+ uint i = 0;
+ while ( (i < dir.count()) && (i < (file.count())) && (dir[i] == file[i]) )
+ i++;
+
+ QString result_up;
+ QString result_down;
+ QString currDir;
+ QString currFile;
+ do
+ {
+ i >= dir.count() ? currDir = "" : currDir = dir[i];
+ i >= file.count() ? currFile = "" : currFile = file[i];
+ //qWarning("i = %d, currDir = %s, currFile = %s", i, currDir.latin1(), currFile.latin1());
+ if (currDir.isEmpty() && currFile.isEmpty())
+ break;
+ else if (currDir.isEmpty())
+ result_down += file[i] + "/";
+ else if (currFile.isEmpty())
+ result_up += "../";
+ else
+ {
+ result_down += file[i] + "/";
+ result_up += "../";
+ }
+ i++;
+ }
+ while ( (!currDir.isEmpty()) || (!currFile.isEmpty()) );
+
+ return result_up + result_down + resFileName;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+//TODO: remove for KDE4
+QString URLUtil::canonicalPath( const QString & path )
+{
+ QDir dir(path);
+ return dir.canonicalPath();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+//written by "Dawit A." <adawit@kde.org>
+//borrowed from his patch to KShell
+QString URLUtil::envExpand ( const QString& str )
+{
+ uint len = str.length();
+
+ if (len > 1 && str[0] == '$')
+ {
+ int pos = str.find ('/');
+
+ if (pos < 0)
+ pos = len;
+
+ char* ret = getenv( QConstString(str.unicode()+1, pos-1).string().local8Bit().data() );
+
+ if (ret)
+ {
+ QString expandedStr ( QFile::decodeName( ret ) );
+ if (pos < (int)len)
+ expandedStr += str.mid(pos);
+ return expandedStr;
+ }
+ }
+
+ return str;
+}
+
diff --git a/lib/util/urlutil.h b/lib/util/urlutil.h
new file mode 100644
index 00000000..4f9ddbab
--- /dev/null
+++ b/lib/util/urlutil.h
@@ -0,0 +1,190 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Julian Rockey <linux@jrockey.com>
+ Copyright (C) 2003 Mario Scalas <mario.scalas@libero.it>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _URLUTIL_H_
+#define _URLUTIL_H_
+
+#include <qstring.h>
+#include <qvaluelist.h>
+#include <kurl.h>
+
+/**
+@file urlutil.h
+Utility functions to operate on URLs.
+*/
+
+/**Utility functions to operate on URLs.*/
+namespace URLUtil
+{
+ /**Position of a slash in the URL.*/
+ enum SlashesPosition {
+ SLASH_PREFIX = 1 /**<URL has slash as a prefix.*/,
+ SLASH_SUFFIX = 2 /**<URL has slash as a suffix.*/
+ };
+
+ /**
+ * @return The filename part of a pathname (i.e. everything past the last slash).
+ * @param pathName The absolute path to a file.
+ */
+ QString filename(const QString & pathName);
+ /**
+ * @return The directory part of a path (i.e. everything up to but not including the last slash)
+ * @param pathName The absolute path to a directory.
+ */
+ QString directory(const QString & pathName);
+ /**
+ * @return The relative path between a parent and child URL, or blank if the specified
+ * child is not a child of parent.
+ * @param parent The parent URL.
+ * @param child The child URL.
+ * @param slashPolicy If parent and child are equal then the function returns "/" if
+ * slashPolicy contains SLASH_PREFIX and otherwise "".\n"/" is appended to a result
+ * if slashPolicy contains SLASH_SUFFIX.\n"/" is prepended to a result if
+ * slashPolicy contains SLASH_PREFIX.
+ */
+ QString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX);
+ /**
+ * @return The relative path between a parent and child URL, or blank if the specified
+ * child is not a child of parent.
+ * @param parent The parent URL.
+ * @param child The child URL.
+ * @param slashPolicy If parent and child are equal then the function returns "/" if
+ * slashPolicy contains SLASH_PREFIX and otherwise "".\n"/" is appended to a result
+ * if slashPolicy contains SLASH_SUFFIX.\n"/" is prepended to a result if
+ * slashPolicy contains SLASH_PREFIX.
+ */
+ QString relativePath(const QString & parent, const QString & child, uint slashPolicy = SLASH_PREFIX);
+ /**
+ * @return The relative path between a base path and destination path or.
+ * @param base The base Path.
+ * @param dest The destination path.
+ */
+ QString getRelativePath( const QString& base, const QString& dest );
+ /**
+ * @param dirUrl An URL of a directory.
+ * @param fileUrl An URL of a file.
+ * @return The relative path between a directory and file. Should never return empty path.\n
+ * <pre>Example:
+ * dirUrl: /home/test/src
+ * fileUrl: /home/test/lib/mylib.cpp
+ * returns: ../lib/mylib.cpp</pre>
+ */
+ QString relativePathToFile( const QString & dirUrl, const QString & fileUrl );
+ /**
+ *@param path A path (absolute or relative).
+ *@param slashSuffix if true then "/" is appended to a path.
+ *@returns The path 'up one level' - the opposite of what filename returns.
+ */
+ QString upDir(const QString & path, bool slashSuffix = false);
+ /**
+ * 'Merges' URLs - changes a URL that starts with dest to start with source instead.\n
+ * <pre>Example:
+ * source is /home/me/
+ * dest is /home/you/
+ * child is /home/you/dir1/file1
+ * returns /home/me/dir1/fil1</pre>
+ * @param source An URL of a source.
+ * @param dest An URL of a destination.
+ * @param child An URL to change.
+ * @return The result of merge.
+ */
+ KURL mergeURL(const KURL & source, const KURL & dest, const KURL & child);
+ /**
+ * @return The file extension for a filename or path.
+ * @param path Absolute or relative path.
+ */
+ QString getExtension(const QString & path);
+
+ /**
+ * Given a base directory url in @p baseDirUrl and the url referring to the
+ * sub-directory or file, it will return the path relative to @p baseDirUrl.
+ * If baseDirUrl == url.path() then it will return ".".
+ * @code
+ * KURL baseUrl, dirUrl;
+ * baseUrl.setPath( "/home/mario/src/kdevelop/" );
+ * dirUrl.setPath( "/home/mario/src/kdevelop/parts/cvs/" );
+ * QString relPathName = extractDirPathRelative( baseUrl, url ); // == "parts/cvs/"
+ * QString absPathName = extractDirPathAbsolute( url ); // == "/home/mario/src/kdevelop/parts/cvs/"
+ * @endcode
+ * Note that if you pass a file name in @p url (instead of a directory) or the
+ * @p baseUrl is not contained in @p url then the function will return "" (void string).
+ *
+ * @param baseDirUrl Base directory URL.
+ * @param url Base directory URL.
+ * @return The relative path between @p url and @p baseDirUrl.
+ */
+ QString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url );
+ /**Same as above. @p basePath is QString.*/
+ QString extractPathNameRelative(const QString &basePath, const KURL &url );
+ /**Same as above. Both @p basePath and @p absFilePath are QStrings.*/
+ QString extractPathNameRelative(const QString &basePath, const QString &absFilePath );
+
+ /**
+ * @param url The url to extract the absolute path from.
+ * @return The absolute path name referred in @p url.
+ * Look at @ref extractPathNameRelative documentation for an example.
+ */
+ QString extractPathNameAbsolute( const KURL &url );
+
+ /**
+ * @param baseDir Base directory for relative URLs.
+ * @param urls The list of urls to extract the relative paths from.
+ * @return A QStringList of relative (to @p baseDir) paths from a list of KURLs in @p urls.
+ */
+ QStringList toRelativePaths( const QString &baseDir, const KURL::List &urls);
+
+ /**
+ * @param url The absolute URL.
+ * @return true if @p url is a directory, false otherwise.
+ */
+ bool isDirectory( const KURL &url );
+ /**
+ * @param absFilePath The absolute path.
+ * @return true if @p url is a directory, false otherwise.
+ */
+ bool isDirectory( const QString &absFilePath );
+
+ /**
+ * Dumps the list of KURL @p urls on standard output, eventually printing @p aMessage if it
+ * is not null.
+ * @param urls URLs to dump.
+ * @param aMessage Message to be written onto a stdout.
+ */
+ void dump( const KURL::List &urls, const QString &aMessage = QString::null );
+
+ /**
+ * Same as QDir::canonicalPath in later versions of Qt. Earlier versions of Qt
+ * had this broken, so it's reproduced here.
+ * Deprecated, use QDir::canonicalPath instead.
+ */
+ QString canonicalPath( const QString & path );
+
+ /**
+ * Performs environment variable expansion on @p variable.
+ *
+ * @param variable The string with the environment variable to expand.
+ * @return The expanded environment variable value. if the variable
+ * cannot be expanded, @p variable itself is returned.
+ */
+ QString envExpand ( const QString &variable );
+
+}
+
+#endif
diff --git a/lib/widgets/Mainpage.dox b/lib/widgets/Mainpage.dox
new file mode 100644
index 00000000..82ae4551
--- /dev/null
+++ b/lib/widgets/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Widgets Library
+
+This library contains a collection of widgets.
+
+<b>Link with</b>: -lkdevwidgets
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/widgets
+*/
+
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
new file mode 100644
index 00000000..442f0c1c
--- /dev/null
+++ b/lib/widgets/Makefile.am
@@ -0,0 +1,30 @@
+INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces $(all_includes)
+
+METASOURCES = AUTO
+
+lib_LTLIBRARIES = libkdevwidgets.la
+
+kdevwidgetsincludedir = $(includedir)/kdevelop/widgets
+
+libkdevwidgets_la_SOURCES = flagboxes.cpp qcomboview.cpp klistviewaction.cpp \
+ kcomboview.cpp resizablecombo.cpp kdevhtmlpart.cpp processlinemaker.cpp \
+ processwidget.cpp ksavealldialog.cpp fancylistviewitem.cpp
+
+
+kdevwidgetsinclude_HEADERS = klistviewaction.h qcomboview.h flagboxes.h \
+ ksavealldialog.h resizablecombo.h kcomboview.h kdevhtmlpart.h processlinemaker.h \
+ processwidget.h fancylistviewitem.h
+
+
+SUBDIRS = propeditor
+
+libkdevwidgets_la_LIBADD = $(top_builddir)/lib/interfaces/libkdevinterfaces.la
+libkdevwidgets_la_LDFLAGS = -no-undefined $(all_libraries)
+rcdir = $(kde_datadir)/kdevelop
+
+rc_DATA = kdevhtml_partui.rc
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Widgets Library
+DOXYGEN_DOCDIRPREFIX = kdev
+include ../../Doxyfile.am
diff --git a/lib/widgets/fancylistviewitem.cpp b/lib/widgets/fancylistviewitem.cpp
new file mode 100644
index 00000000..d2bdcd1e
--- /dev/null
+++ b/lib/widgets/fancylistviewitem.cpp
@@ -0,0 +1,203 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 David Nolden <david.nolden.kdevelop@art-master.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qpixmap.h>
+#include <qapplication.h>
+#include <qnamespace.h>
+#include <kdeversion.h>
+
+#include "fancylistviewitem.h"
+
+
+void FancyListViewItem::init(const QString& label1, const QString& /*label2*/) {
+ if( !label1.isEmpty() ) {
+ setText(0, label1);
+ }
+}
+
+
+void FancyListViewItem::setItem(int column, TextPaintItem item) {
+ if( column >= int(m_items.size()) ) {
+ m_items.append( item );
+ }else{
+ m_items[column] = item;
+ }
+}
+
+
+void FancyListViewItem::setText ( int column, const QString & text ) {
+ if( column >= int(m_items.size()) ) {
+ m_items.append( TextPaintItem(text) );
+ }else{
+ m_items[column] = TextPaintItem(text);
+ }
+}
+
+
+QString FancyListViewItem::text(int column) const {
+ if( m_items.isEmpty() ) return "";
+ return (QString)m_items[column];
+}
+
+
+QColor FancyListViewItem::backgroundColor(int col) {
+
+ return KListViewItem::backgroundColor(col);
+}
+
+
+///this is a modified version of the original QListViewItem::paintCell from the qt source
+///multiline is not supported!
+
+void FancyListViewItem::paintCell( QPainter *painter, const QColorGroup &cg,
+ int column, int width, int align)
+{
+ if(column < 0 || column >= int(m_items.size()) || m_items[column].items().isEmpty()) {
+ QListViewItem::paintCell(painter, cg, column, width, align);
+ return;
+ }
+
+ painter->save();
+ QColorGroup grp(cg);
+
+ int styleNum = m_items[column].items()[0].style;
+ TextPaintStyleStore::Item& style = m_styles.getStyle( styleNum );
+ ///currently only the first background-color is used
+ if( style.bgValid() ) {
+ grp.setColor( QColorGroup::Base, style.background );
+ }else{
+ if(backgroundColor(column).isValid())
+ grp.setColor( QColorGroup::Base, backgroundColor(column) ); ///use the nice kde background-color
+ }
+
+ QListView *lv = listView();
+ if ( !lv )
+ return;
+ QPainter* p = painter;
+ QFontMetrics fm( p->fontMetrics() );
+
+ QString t = text( column );
+
+ int marg = lv->itemMargin();
+ int r = marg;
+ const QPixmap * icon = pixmap( column );
+
+ const BackgroundMode bgmode = lv->viewport()->backgroundMode();
+ const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode );
+ p->fillRect( 0, 0, width, height(), grp.brush( crole ) );
+
+ if ( isSelected() && (column == 0 || lv->allColumnsShowFocus()) ) {
+ p->fillRect( r - marg, 0, width - r + marg, height(), cg.brush( QColorGroup::Highlight ) );
+
+ if ( isEnabled() || !lv )
+ p->setPen( cg.highlightedText() );
+ else if ( !isEnabled() && lv)
+ p->setPen( lv->palette().disabled().highlightedText() );
+ }
+ {
+ if ( isEnabled() || !lv )
+ p->setPen( cg.text() );
+ else if ( !isEnabled() && lv)
+ p->setPen( lv->palette().disabled().text() );
+
+
+ int iconWidth = 0;
+
+ if ( icon ) {
+ iconWidth = icon->width() + lv->itemMargin();
+ int xo = r;
+ int yo = ( height() - icon->height() ) / 2;
+
+ if ( align & AlignBottom )
+ yo = height() - icon->height();
+ else if ( align & AlignTop )
+ yo = 0;
+
+// respect horizontal alignment when there is no text for an item.
+ if ( t.isEmpty() ) {
+ if ( align & AlignRight )
+ xo = width - 2 * marg - iconWidth;
+ else if ( align & AlignHCenter )
+ xo = ( width - iconWidth ) / 2;
+ }
+ p->drawPixmap( xo, yo, *icon );
+ }
+
+
+ if ( !t.isEmpty() ) {
+ if ( !(align & AlignTop || align & AlignBottom) )
+ align |= AlignVCenter;
+
+ r += iconWidth;
+
+ TextPaintItem::Chain::iterator it = m_items[column].items().begin();
+ while(it != m_items[column].items().end())
+ {
+ int styleNum = (*it).style;
+ TextPaintStyleStore::Item& style = m_styles.getStyle( styleNum );
+
+ painter->setFont(style.font);
+ p->drawText( r, 0, width-marg-r, height(), align, (*it).text );
+ r += textWidth( style.font, (*it).text );
+ ++it;
+ }
+ }
+ }
+
+ painter->restore();
+}
+
+
+int FancyListViewItem::textWidth(const QFont& font, const QString& text)
+{
+ QFontMetrics fm( font );
+ if ( multiLinesEnabled() )
+ return fm.size( AlignVCenter, text ).width();
+ else
+ return fm.width( text );
+
+}
+
+
+int FancyListViewItem::width(const QFontMetrics &fm, const QListView *lv, int column)
+{
+ int width = 0;
+ if (column >= 0 && column < (int)m_items.size() && !multiLinesEnabled()) {
+ TextPaintItem::Chain::iterator it = m_items[column].items().begin();
+ while(it != m_items[column].items().end()) {
+ int styleNum = (*it).style;
+ TextPaintStyleStore::Item& style = m_styles.getStyle( styleNum );
+
+ width += textWidth( style.font, (*it).text);
+ ++it;
+ }
+ width += lv->itemMargin() * 2;// - lv->d->minLeftBearing - lv->d->minRightBearing;
+
+ const QPixmap * pm = pixmap( column );
+ if ( pm )
+ width += pm->width() + lv->itemMargin();
+
+ width = QMAX( width, QApplication::globalStrut().width() );
+ }
+ else
+ width = QListViewItem::width(fm, lv, column);
+ return width;
+}
+
+
diff --git a/lib/widgets/fancylistviewitem.h b/lib/widgets/fancylistviewitem.h
new file mode 100644
index 00000000..95375af4
--- /dev/null
+++ b/lib/widgets/fancylistviewitem.h
@@ -0,0 +1,162 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 David Nolden <david.nolden.kdevelop@art-master.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef FANCYLISTVIEWITEM
+#define FANCYLISTVIEWITEM
+
+#include <qvaluevector.h>
+#include <qpainter.h>
+#include <qfont.h>
+#include <qlistview.h>
+#include <klistview.h>
+
+class TextPaintStyleStore {
+ public:
+ class Item {
+ public:
+ QFont font;
+ QColor color;
+ QColor background;
+
+ Item(const QFont& f = QFont(), const QColor& c = QColor(), const QColor b = QColor() ) : font(f), color(c), background(b) {
+ }
+
+ bool bgValid() {
+ return background.isValid();
+ }
+
+ bool colValid() {
+ return color.isValid();
+ }
+ };
+
+ typedef QMap<int, Item> Store ;
+
+ TextPaintStyleStore( QFont defaultFont=QFont() ) {
+ m_styles.insert( 0, Item( defaultFont ) );
+ }
+
+ Item& getStyle( int num ) {
+ Store::Iterator it = m_styles.find( num );
+ if( it != m_styles.end() ) return *it;
+ return m_styles[0];
+ }
+
+ void addStyle( int num, Item& style ) {
+ m_styles[num] = style;
+ }
+
+ void addStyle( int num, const QFont& font ) {
+ m_styles[num] = Item( font );
+ }
+
+ bool hasStyle( int num ) {
+ Store::Iterator it = m_styles.find( num );
+ return ( it != m_styles.end() );
+ }
+
+ private:
+ Store m_styles;
+};
+
+class TextPaintItem {
+ public:
+ struct Item {
+ QString text;
+ int style;
+
+ Item( const QString& t = "", int st = 0 ) : text(t), style(st) {
+ }
+
+ };
+ typedef QValueList<Item> Chain;
+
+ Chain& items() {
+ return m_chain;
+ }
+
+ TextPaintItem(const QString& text="") {
+ addItem( text );
+ }
+
+ Item& addItem(const QString& item, int style = 0) {
+ m_chain.append( Item(item, style) );
+ return m_chain.back();
+ }
+
+ void clear() {
+ m_chain.clear();
+ }
+
+ operator QString () const {
+ QString ret;
+ Chain::const_iterator it = m_chain.begin();
+ while(it != m_chain.end()) {
+ ret += (*it).text;
+ ++it;
+ }
+ return ret;
+ }
+
+ private:
+ Chain m_chain;
+};
+
+///does not support multiple column, a "column" represents a part of the real first column
+///KListViewItem is only needed for the background-color
+
+class FancyListViewItem : public KListViewItem
+{
+ public:
+ FancyListViewItem(TextPaintStyleStore& styles, QListView *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) {
+ init(label1, label2);
+ }
+
+ FancyListViewItem(TextPaintStyleStore& styles, QListViewItem *parent, const QString &label1, const QString &label2="") : KListViewItem(parent, label1, label2), m_styles(styles) {
+ init(label1, label2);
+ }
+
+ virtual void paintCell(QPainter *painter, const QColorGroup &cg, int column, int width, int align);
+ virtual int width(const QFontMetrics &fm, const QListView *lv, int column);
+ virtual void setText ( int column, const QString & text );
+ virtual QString text(int column) const;
+
+ inline void clear() {
+ m_items.clear();
+ }
+
+ inline TextPaintItem& item(int column = 0) {
+ if(m_items.isEmpty()) {
+ m_items.append( TextPaintItem() );
+ }
+
+ return m_items[column];
+ }
+
+ void setItem(int column, TextPaintItem item);
+ private:
+ virtual QColor backgroundColor(int col);
+ void init(const QString& label1, const QString& label2);
+ int textWidth(const QFont& font, const QString& text);
+ QValueVector<TextPaintItem> m_items;
+ protected:
+ TextPaintStyleStore& m_styles;
+};
+
+#endif
diff --git a/lib/widgets/flagboxes.cpp b/lib/widgets/flagboxes.cpp
new file mode 100644
index 00000000..dbbae793
--- /dev/null
+++ b/lib/widgets/flagboxes.cpp
@@ -0,0 +1,643 @@
+/* This file is part of the KDE project
+ Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <klocale.h>
+#include <kdebug.h>
+#include <kurlrequester.h>
+#include <klineedit.h>
+#include <kdialogbase.h>
+#include <kdeversion.h>
+
+#include <qapplication.h>
+#include <qtooltip.h>
+#include <qheader.h>
+#include <qstringlist.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qregexp.h>
+#include <qspinbox.h>
+
+#include "flagboxes.h"
+
+// partial copy of Qt-3.1 for back-compatibility to KDE-3.0
+QString QRegExp_escape( const QString& str )
+{
+ static const char meta[] = "$()*+.?[\\]^{|}";
+ QString quoted = str;
+ int i = 0;
+
+ while ( i < (int) quoted.length() ) {
+ if ( strchr(meta, quoted[i].latin1()) != 0 )
+ quoted.insert( i++, "\\" );
+ i++;
+ }
+ return quoted;
+}
+
+
+class FlagListToolTip : public QToolTip
+{
+public:
+ FlagListToolTip(QWidget *parent);
+protected:
+ void maybeTip(const QPoint &p);
+};
+
+
+FlagListToolTip::FlagListToolTip(QWidget *parent)
+ : QToolTip(parent)
+{}
+
+
+void FlagListToolTip::maybeTip(const QPoint &pos)
+{
+ FlagListBox *listbox = static_cast<FlagListBox*>(parentWidget());
+ QListViewItem *item = listbox->itemAt(pos);
+ FlagListItem *flitem = static_cast<FlagListItem*>(item);
+
+ if (item)
+ tip(listbox->itemRect(item), flitem->desc);
+}
+
+
+FlagListItem::FlagListItem(FlagListBox *parent, const QString &flagstr,
+ const QString &description)
+ : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox),
+ flag(flagstr), desc(description)
+{}
+
+
+FlagListItem::FlagListItem(FlagListBox *parent, const QString &flagstr,
+ const QString &description, const QString &offstr)
+ : QCheckListItem(parent, flagstr, QCheckListItem::CheckBox),
+ flag(flagstr), off(offstr), desc(description)
+{}
+
+
+FlagListBox::FlagListBox(QWidget *parent, const char *name)
+ : QListView(parent, name)
+{
+ setResizeMode(LastColumn);
+ header()->hide();
+ addColumn(i18n("Flags"));
+ (void) new FlagListToolTip(this);
+}
+
+
+void FlagListBox::readFlags(QStringList *list)
+{
+ QListViewItem *item = firstChild();
+ for (; item; item = item->nextSibling()) {
+ FlagListItem *flitem = static_cast<FlagListItem*>(item);
+ QStringList::Iterator sli = list->find(flitem->flag);
+ if (sli != list->end()) {
+ flitem->setOn(true);
+ list->remove(sli);
+ }
+ sli = list->find(flitem->off);
+ if (sli != list->end()) {
+ flitem->setOn(false);
+ list->remove(sli);
+ }
+ }
+}
+
+
+void FlagListBox::writeFlags(QStringList *list)
+{
+ QListViewItem *item = firstChild();
+ for (; item; item = item->nextSibling()) {
+ FlagListItem *flitem = static_cast<FlagListItem*>(item);
+ if (flitem->isOn())
+ (*list) << flitem->flag;
+ }
+}
+
+
+FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description)
+ : QCheckBox(description, parent), flag(flagstr), includeOff(false), useDef(false), defSet(false)
+{
+ QToolTip::add(this, flagstr);
+ controller->addCheckBox(this);
+}
+
+
+FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description,
+ const QString &offstr)
+ : QCheckBox(description, parent), flag(flagstr), off(offstr), includeOff(false), useDef(false), defSet(false)
+{
+ QToolTip::add(this, flagstr);
+ controller->addCheckBox(this);
+}
+
+FlagCheckBox::FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description,
+ const QString &offstr, const QString &defstr)
+ : QCheckBox(description, parent), flag(flagstr), off(offstr), def(defstr), includeOff(false), useDef(true), defSet(false)
+{
+ QToolTip::add(this, flagstr);
+ controller->addCheckBox(this);
+}
+
+FlagCheckBoxController::FlagCheckBoxController(QStringList multiKeys)
+ :m_multiKeys(multiKeys)
+{
+}
+
+
+void FlagCheckBoxController::addCheckBox(FlagCheckBox *item)
+{
+ cblist.append(item);
+}
+
+
+void FlagCheckBoxController::readFlags(QStringList *list)
+{
+ //handle keys like -vxyz -> transform they into -vx -vy -vz
+ //very "effective" algo :(
+/* QStringList addons;
+ for (QStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk)
+ {
+ kdDebug() << "multikey " << *mk << endl;
+ for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli)
+ {
+ QString key = *sli;
+ kdDebug() << "current key: " << key << endl;
+ if ( (key.length() > 3) && (key.startsWith(*mk)) )
+ {
+ list->remove(sli);
+ key = key.remove(*mk);
+ kdDebug() << "refined key " << key << endl;
+ for (int i = 0; i < key.length(); ++i)
+ {
+ kdDebug() << "adding key " << *mk + key[i] << endl;
+ addons << *mk + key[i];
+ }
+ }
+ }
+ }
+ kdDebug() << "good" << endl;
+ *list += addons;
+
+ for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli)
+ {
+ kdDebug() << "KEYS: " << *sli << endl;
+ }
+*/
+ QPtrListIterator<FlagCheckBox> it(cblist);
+ for (; it.current(); ++it) {
+ FlagCheckBox *fitem = it.current();
+ QStringList::Iterator sli = list->find(fitem->flag);
+ if (sli != list->end()) {
+ fitem->setChecked(true);
+ fitem->useDef = false;
+ list->remove(sli);
+ }
+ sli = list->find(fitem->off);
+ if (sli != list->end()) {
+ fitem->setChecked(false);
+ fitem->includeOff = true;
+ fitem->useDef = false;
+ list->remove(sli);
+ }
+ if (!fitem->def.isEmpty())
+ if (fitem->useDef && (fitem->def == fitem->flag))
+ {
+ fitem->setChecked(true);
+ fitem->defSet = true;
+ }
+ else
+ fitem->useDef = false;
+ }
+}
+
+
+void FlagCheckBoxController::writeFlags(QStringList *list)
+{
+ QPtrListIterator<FlagCheckBox> it(cblist);
+ for (; it.current(); ++it) {
+ FlagCheckBox *fitem = it.current();
+ if (fitem->isChecked() && (!fitem->useDef))
+ {
+ (*list) << fitem->flag;
+ }
+ else if ((!fitem->off.isEmpty()) && fitem->includeOff)
+ (*list) << fitem->off;
+ else if ((fitem->def == fitem->flag) && (!fitem->isChecked()))
+ (*list) << fitem->off;
+ else if ((fitem->def == fitem->off) && (fitem->isChecked()))
+ (*list) << fitem->flag;
+ }
+}
+
+ FlagPathEditController::FlagPathEditController( )
+{
+}
+
+ FlagPathEditController::~ FlagPathEditController( )
+{
+}
+
+void FlagPathEditController::readFlags( QStringList * list )
+{
+// kdDebug() << "read path flags" << endl;
+ QPtrListIterator<FlagPathEdit> it(plist);
+ for (; it.current(); ++it) {
+ FlagPathEdit *peitem = it.current();
+
+ QStringList::Iterator sli = list->begin();
+ while ( sli != list->end() )
+ {
+ // kdDebug() << "option: " << (*sli) << " flag is: " << peitem->flag << endl;
+ if ((*sli).startsWith(peitem->flag))
+ {
+// kdDebug() << "Processing.." << endl;
+ peitem->setText((*sli).replace(QRegExp(QRegExp_escape(peitem->flag)),""));
+ sli = list->remove(sli);
+ continue;
+ }
+ ++sli;
+ }
+/* QStringList::Iterator sli = list->find(peitem->flag);
+ if (sli != list->end()) {
+ peitem->setText((*sli).remove(peitem->flag));
+ list->remove(sli);
+ }*/
+ }
+}
+
+void FlagPathEditController::writeFlags( QStringList * list )
+{
+ QPtrListIterator<FlagPathEdit> it(plist);
+ for (; it.current(); ++it) {
+ FlagPathEdit *pitem = it.current();
+ if (!pitem->isEmpty())
+ (*list) << pitem->flag + pitem->text();
+ }
+}
+
+void FlagPathEditController::addPathEdit( FlagPathEdit * item )
+{
+ plist.append(item);
+}
+
+FlagPathEdit::FlagPathEdit( QWidget * parent, QString pathDelimiter,
+ FlagPathEditController * controller, const QString & flagstr, const QString & description,
+ KFile::Mode mode )
+ : QWidget(parent), delimiter(pathDelimiter), flag(flagstr), m_description(description)
+{
+ QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1);
+ topLayout->addWidget(new QLabel(description, this));
+ QBoxLayout *layout = new QHBoxLayout(topLayout, KDialog::spacingHint());
+
+ if (delimiter.isEmpty())
+ {
+ url = new KURLRequester(this);
+ url->setMode(mode);
+ layout->addWidget(url);
+ }
+ else
+ {
+ edit = new KLineEdit(this);
+ layout->addWidget(edit);
+ details = new QPushButton("...", this);
+ details->setMaximumWidth(30);
+ connect(details, SIGNAL(clicked()), this, SLOT(showPathDetails()));
+ layout->addWidget(details);
+ }
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QToolTip::add(this, flagstr);
+ controller->addPathEdit(this);
+}
+
+void FlagPathEdit::showPathDetails( )
+{
+ KDialogBase *dia = new KDialogBase(0, "flag_path_edit_dia", true, m_description,
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true);
+
+ QBoxLayout *diaLayout = new QVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint());
+ diaLayout->setAutoAdd(true);
+
+ KURLRequester *req = new KURLRequester( dia );
+ req->setMode(KFile::Directory);
+ KEditListBox::CustomEditor pCustomEditor;
+ pCustomEditor = req->customEditor();
+ KEditListBox *elb = new KEditListBox( "", pCustomEditor, dia );
+ dia->setMainWidget(elb);
+
+ elb->insertStringList(QStringList::split(delimiter, text()));
+
+ if (dia->exec() == QDialog::Accepted)
+ {
+ setText(elb->items().join(delimiter));
+ }
+
+ delete dia;
+}
+
+void FlagPathEdit::setText( const QString text )
+{
+ if (delimiter.isEmpty())
+ url->setURL(text);
+ else
+ edit->setText(text);
+}
+
+QString FlagPathEdit::text( )
+{
+ if (delimiter.isEmpty())
+ return url->url();
+ else
+ return edit->text();
+}
+
+bool FlagPathEdit::isEmpty( )
+{
+ if (delimiter.isEmpty())
+ return url->url().isEmpty();
+ else
+ return edit->text().isEmpty();
+}
+
+FlagRadioButton::FlagRadioButton( QWidget * parent, FlagRadioButtonController * controller, const QString & flagstr, const QString & description )
+ : QRadioButton(description, parent), flag(flagstr)
+{
+ QToolTip::add(this, flagstr);
+ controller->addRadioButton(this);
+}
+
+FlagRadioButtonController::FlagRadioButtonController(QStringList multiKeys)
+ :m_multiKeys(multiKeys)
+{
+}
+
+void FlagRadioButtonController::addRadioButton(FlagRadioButton *item)
+{
+ cblist.append(item);
+}
+
+
+void FlagRadioButtonController::readFlags(QStringList *list)
+{
+ //handle keys like -vxyz -> transform they into -vx -vy -vz
+ //very "effective" algo :(
+/* QStringList addons;
+ for (QStringList::Iterator mk = m_multiKeys.begin(); mk != m_multiKeys.end(); ++ mk)
+ {
+ kdDebug() << "multikey " << *mk << endl;
+ for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli)
+ {
+ QString key = *sli;
+ kdDebug() << "current key: " << key << endl;
+ if ( (key.length() > 3) && (key.startsWith(*mk)) )
+ {
+ list->remove(sli);
+ key = key.remove(*mk);
+ kdDebug() << "refined key " << key << endl;
+ for (int i = 0; i < key.length(); ++i)
+ {
+ kdDebug() << "adding key " << *mk + key[i] << endl;
+ addons << *mk + key[i];
+ }
+ }
+ }
+ }
+ kdDebug() << "good" << endl;
+ *list += addons;
+
+ for (QStringList::Iterator sli = list->begin(); sli != list->end(); ++sli)
+ {
+ kdDebug() << "KEYS: " << *sli << endl;
+ }
+*/
+ QPtrListIterator<FlagRadioButton> it(cblist);
+ for (; it.current(); ++it) {
+ FlagRadioButton *fitem = it.current();
+ QStringList::Iterator sli = list->find(fitem->flag);
+ if (sli != list->end()) {
+ fitem->setChecked(true);
+ list->remove(sli);
+ }
+ }
+}
+
+
+void FlagRadioButtonController::writeFlags(QStringList *list)
+{
+ QPtrListIterator<FlagRadioButton> it(cblist);
+ for (; it.current(); ++it) {
+ FlagRadioButton *fitem = it.current();
+ if (fitem->isChecked())
+ (*list) << fitem->flag;
+ }
+}
+
+ FlagEditController::FlagEditController( )
+{
+}
+
+ FlagEditController::~ FlagEditController( )
+{
+}
+
+void FlagEditController::readFlags( QStringList * list )
+{
+ QPtrListIterator<FlagListEdit> it(plist);
+ for (; it.current(); ++it) {
+ FlagListEdit *peitem = it.current();
+
+ QStringList::Iterator sli = list->begin();
+ while (sli != list->end())
+ {
+ if ((*sli).startsWith(peitem->flag))
+ {
+ peitem->appendText((*sli).replace(QRegExp(QRegExp_escape(peitem->flag)),""));
+ sli = list->remove(sli);
+ continue;
+ }
+ ++sli;
+ }
+ }
+
+
+ QPtrListIterator<FlagSpinEdit> it2(slist);
+ for (; it2.current(); ++it2) {
+ FlagSpinEdit *sitem = it2.current();
+
+ QStringList::Iterator sli = list->begin();
+ while ( sli != list->end() )
+ {
+ if ((*sli).startsWith(sitem->flag))
+ {
+ sitem->setText((*sli).replace(QRegExp(QRegExp_escape(sitem->flag)),""));
+ sli = list->remove(sli);
+ continue;
+ }
+ ++sli;
+ }
+ }
+}
+
+void FlagEditController::writeFlags( QStringList * list )
+{
+ QPtrListIterator<FlagListEdit> it(plist);
+ for (; it.current(); ++it) {
+ FlagListEdit *pitem = it.current();
+ if (!pitem->isEmpty())
+ (*list) += pitem->flags();
+ }
+
+ QPtrListIterator<FlagSpinEdit> it2(slist);
+ for (; it2.current(); ++it2) {
+ FlagSpinEdit *sitem = it2.current();
+ if (!sitem->isDefault())
+ (*list) << sitem->flags();
+ }
+}
+
+void FlagEditController::addListEdit( FlagListEdit * item )
+{
+ plist.append(item);
+}
+
+void FlagEditController::addSpinBox(FlagSpinEdit *item)
+{
+ slist.append(item);
+}
+
+
+FlagListEdit::FlagListEdit( QWidget * parent, QString listDelimiter, FlagEditController * controller,
+ const QString & flagstr, const QString & description)
+ : QWidget(parent), delimiter(listDelimiter), flag(flagstr), m_description(description)
+{
+ QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1);
+ topLayout->addWidget(new QLabel(description, this));
+ QBoxLayout *layout = new QHBoxLayout(topLayout, KDialog::spacingHint());
+
+ edit = new KLineEdit(this);
+ layout->addWidget(edit);
+ if (! listDelimiter.isEmpty())
+ {
+ details = new QPushButton("...", this);
+ details->setMaximumWidth(30);
+ connect(details, SIGNAL(clicked()), this, SLOT(showListDetails()));
+ layout->addWidget(details);
+ }
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QToolTip::add(this, flagstr);
+ controller->addListEdit(this);
+}
+
+void FlagListEdit::setText( const QString text )
+{
+ edit->setText(text);
+}
+
+bool FlagListEdit::isEmpty( )
+{
+ return edit->text().isEmpty();
+}
+
+QString FlagListEdit::text( )
+{
+ return edit->text();
+}
+
+void FlagListEdit::showListDetails( )
+{
+ KDialogBase *dia = new KDialogBase(0, "flag_list_edit_dia", true, m_description,
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true);
+
+ QBoxLayout *diaLayout = new QVBoxLayout(dia, KDialog::marginHint(), KDialog::spacingHint());
+ diaLayout->setAutoAdd(true);
+
+ KEditListBox *elb = new KEditListBox( "", dia );
+ dia->setMainWidget(elb);
+
+ elb->insertStringList(QStringList::split(delimiter, text()));
+
+ if (dia->exec() == QDialog::Accepted)
+ {
+ setText(elb->items().join(delimiter));
+ }
+
+ delete dia;
+}
+
+void FlagListEdit::appendText( const QString text )
+{
+ edit->setText(edit->text() + (edit->text().isEmpty()?QString(""):delimiter) + text);
+}
+
+QStringList FlagListEdit::flags( )
+{
+ QStringList fl = QStringList::split(delimiter, text());
+ for (QStringList::iterator it = fl.begin(); it != fl.end(); ++it)
+ {
+ (*it).prepend(flag);
+ }
+ return fl;
+}
+
+FlagSpinEdit::FlagSpinEdit( QWidget * parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController * controller, const QString & flagstr, const QString & description )
+ :QWidget(parent), m_defaultVal(defaultVal), flag(flagstr)
+{
+ QBoxLayout *topLayout = new QVBoxLayout(this, 0, 1);
+ topLayout->addWidget(new QLabel(description, this));
+
+ spb = new QSpinBox(minVal, maxVal, incr, this);
+ spb->setValue(defaultVal);
+ topLayout->addWidget(spb);
+
+ QApplication::sendPostedEvents(this, QEvent::ChildInserted);
+
+ QToolTip::add(this, flagstr);
+ controller->addSpinBox(this);
+}
+
+void FlagSpinEdit::setText( const QString text )
+{
+ spb->setValue(text.toInt());
+}
+
+QString FlagSpinEdit::text( )
+{
+ return QString("%1").arg(spb->value());
+}
+
+QString FlagSpinEdit::flags( )
+{
+ return flag + text();
+}
+
+bool FlagSpinEdit::isDefault( )
+{
+ if (spb->value() == m_defaultVal)
+ return true;
+ return false;
+}
+
+
+#include "flagboxes.moc"
diff --git a/lib/widgets/flagboxes.h b/lib/widgets/flagboxes.h
new file mode 100644
index 00000000..a64a47eb
--- /dev/null
+++ b/lib/widgets/flagboxes.h
@@ -0,0 +1,283 @@
+/* This file is part of the KDE project
+ Copyright (C) 2000-2001 Bernd Gehrmann <bernd@kdevelop.org>
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _FLAGBOXES_H_
+#define _FLAGBOXES_H_
+
+#include <kfile.h>
+
+/**
+@file flagboxes.h
+Support classes for compiler plugins.
+*/
+
+#include <qlistview.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qptrlist.h>
+#include <qstringlist.h>
+
+class QSpinBox;
+class FlagListBox;
+class FlagListToolTip;
+class FlagCheckBoxController;
+class FlagRadioButtonController;
+class FlagPathEditController;
+class FlagEditController;
+class KLineEdit;
+class QPushButton;
+class KURLRequester;
+
+/**List item holding a compiler flag.*/
+class FlagListItem : public QCheckListItem
+{
+public:
+ FlagListItem(FlagListBox *parent, const QString &flagstr,
+ const QString &description);
+ FlagListItem(FlagListBox *parent, const QString &flagstr,
+ const QString &description, const QString &offstr);
+ ~FlagListItem()
+ {}
+private:
+ QString flag;
+ QString off;
+ QString desc;
+ friend class FlagListToolTip;
+ friend class FlagListBox;
+};
+
+
+/**List box item holding a compiler flag.*/
+class FlagListBox : public QListView
+{
+ Q_OBJECT
+public:
+ FlagListBox( QWidget *parent=0, const char *name=0 );
+ ~FlagListBox()
+ {}
+
+ void readFlags(QStringList *list);
+ void writeFlags(QStringList *list);
+};
+
+
+/**Check box item holding a compiler flag.*/
+class FlagCheckBox : public QCheckBox
+{
+ Q_OBJECT
+public:
+ FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description);
+ FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description,
+ const QString &offstr);
+ FlagCheckBox(QWidget *parent, FlagCheckBoxController *controller,
+ const QString &flagstr, const QString &description,
+ const QString &offstr, const QString &defstr);
+ ~FlagCheckBox()
+ {}
+
+private:
+ QString flag;
+ QString off;
+ QString def;
+ bool includeOff;
+ bool useDef;
+ bool defSet;
+ friend class FlagCheckBoxController;
+};
+
+/**Radiobutton item holding an option of a compiler flag.*/
+class FlagRadioButton : public QRadioButton
+{
+ Q_OBJECT
+public:
+ FlagRadioButton(QWidget *parent, FlagRadioButtonController *controller,
+ const QString &flagstr, const QString &description);
+ ~FlagRadioButton()
+ {}
+
+private:
+ QString flag;
+ friend class FlagRadioButtonController;
+};
+
+/**Path editor if path is a compiler flag.*/
+class FlagPathEdit: public QWidget
+{
+ Q_OBJECT
+public:
+ /**If the pathDelimiter is not empty then path edit can contain a list of paths*/
+ FlagPathEdit(QWidget *parent, QString pathDelimiter, FlagPathEditController *controller,
+ const QString &flagstr, const QString &description, KFile::Mode mode = KFile::Directory);
+
+ ~FlagPathEdit() {}
+
+ void setText(const QString text);
+ bool isEmpty();
+ QString text();
+
+private slots:
+ void showPathDetails();
+
+private:
+ KLineEdit *edit;
+ QPushButton *details;
+ KURLRequester *url;
+
+ QString delimiter;
+ QString flag;
+ QString m_description;
+ friend class FlagPathEditController;
+};
+
+/**List editor if list is a compiler flag.*/
+class FlagListEdit: public QWidget
+{
+ Q_OBJECT
+public:
+ /**If the listDelimiter is not empty then list edit can contain a list of entries*/
+ FlagListEdit(QWidget *parent, QString listDelimiter, FlagEditController *controller,
+ const QString &flagstr, const QString &description);
+
+ ~FlagListEdit() {}
+
+ void setText(const QString text);
+ void appendText(const QString text);
+ bool isEmpty();
+ QString text();
+ QStringList flags();
+
+private slots:
+ void showListDetails();
+
+private:
+ KLineEdit *edit;
+ QPushButton *details;
+
+ QString delimiter;
+ QString flag;
+ QString m_description;
+ friend class FlagEditController;
+};
+
+/**Spin editor of a compiler flag.*/
+class FlagSpinEdit: public QWidget
+{
+public:
+ FlagSpinEdit(QWidget *parent, int minVal, int maxVal, int incr, int defaultVal, FlagEditController *controller,
+ const QString &flagstr, const QString &description);
+ ~FlagSpinEdit() {}
+
+ void setText(const QString text);
+ QString text();
+ bool isDefault();
+
+ QString flags();
+
+private:
+ int m_defaultVal;
+ QString flag;
+
+ QSpinBox *spb;
+
+ friend class FlagEditController;
+};
+
+/**Controller for path editors.*/
+class FlagPathEditController
+{
+public:
+ FlagPathEditController();
+ ~FlagPathEditController();
+
+ void readFlags(QStringList *list);
+ void writeFlags(QStringList *list);
+
+private:
+ void addPathEdit(FlagPathEdit *item);
+ QPtrList<FlagPathEdit> plist;
+ friend class FlagPathEdit;
+};
+
+/**Controller for flag editors.*/
+class FlagEditController
+{
+public:
+ FlagEditController();
+ ~FlagEditController();
+
+ void readFlags(QStringList *list);
+ void writeFlags(QStringList *list);
+
+private:
+ void addListEdit(FlagListEdit *item);
+ void addSpinBox(FlagSpinEdit *item);
+ QPtrList<FlagListEdit> plist;
+ QPtrList<FlagSpinEdit> slist;
+ friend class FlagListEdit;
+ friend class FlagSpinEdit;
+};
+
+/**Controller for check box editors.*/
+class FlagCheckBoxController
+{
+public:
+ /**"multi key" is a list of options like -vxyz (-vx -vy -vz)
+ multiKeys must contain a list of option names like {-v}
+ in the above example.
+ */
+ FlagCheckBoxController(QStringList multiKeys = QStringList());
+ ~FlagCheckBoxController()
+ {}
+
+ void readFlags(QStringList *list);
+ void writeFlags(QStringList *list);
+
+ void addCheckBox(FlagCheckBox *item);
+private:
+ QPtrList<FlagCheckBox> cblist;
+
+ QStringList m_multiKeys;
+};
+
+/**Controller for radiobutton editors.*/
+class FlagRadioButtonController
+{
+public:
+ /**multiKeys is a list of options like -vxyz (-vx -vy -vz)
+ multiKeys must contain a list of option names like {-v}
+ in the above example.
+ */
+ FlagRadioButtonController(QStringList multiKeys = QStringList());
+ ~FlagRadioButtonController()
+ {}
+
+ void readFlags(QStringList *list);
+ void writeFlags(QStringList *list);
+
+ void addRadioButton(FlagRadioButton *item);
+private:
+ QPtrList<FlagRadioButton> cblist;
+
+ QStringList m_multiKeys;
+};
+
+#endif
diff --git a/lib/widgets/kcomboview.cpp b/lib/widgets/kcomboview.cpp
new file mode 100644
index 00000000..ecaf4593
--- /dev/null
+++ b/lib/widgets/kcomboview.cpp
@@ -0,0 +1,101 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include <klineedit.h>
+#include <klistview.h>
+#include <kcompletionbox.h>
+#include <qheader.h>
+#include <qmap.h>
+
+#include "kcomboview.h"
+
+
+KComboView::KComboView( bool rw, int defaultWidth, QWidget* parent, const char* name , CustomCompleter* comp)
+ :QComboView(rw, parent, name), m_comp( comp ), m_defaultWidth(defaultWidth)
+{
+ if (rw)
+ {
+ KLineEdit *ed = new KLineEdit(this, "combo edit");
+ ed->setCompletionMode(KGlobalSettings::CompletionPopup);
+ ed->setCompletionObject(m_comp);
+ ed->completionBox()->setHScrollBarMode(QListBox::Auto);
+ setLineEdit(ed);
+ }
+ setMinimumWidth(defaultWidth);
+}
+
+KComboView::~KComboView() {
+ delete m_comp;
+}
+
+void KComboView::addItem(QListViewItem *it)
+{
+ m_comp->addItem(it->text(0));
+}
+
+void KComboView::removeItem(QListViewItem *it)
+{
+ if (it == currentItem())
+ {
+ setCurrentItem(0);
+ setCurrentText(m_defaultText);
+ }
+ m_comp->removeItem(it->text(0));
+ delete it;
+}
+
+void KComboView::renameItem(QListViewItem *it, const QString &newName)
+{
+ m_comp->removeItem(it->text(0));
+ it->setText(0, newName);
+ m_comp->addItem(newName);
+}
+
+void KComboView::clear( )
+{
+ m_comp->clear();
+ QComboView::clear();
+
+ setCurrentText(m_defaultText);
+}
+
+int KComboView::defaultWidth( )
+{
+ return m_defaultWidth;
+}
+
+void KComboView::setDefaultText( const QString & text )
+{
+ m_defaultText = text;
+}
+
+void KComboView::setUpListView()
+{
+ KListView *listView = new KListView( this, "in-combo" );
+ listView->setRootIsDecorated( false );
+ listView->setAllColumnsShowFocus(true);
+ listView->addColumn("");
+ listView->setResizeMode(QListView::LastColumn);
+
+ listView->header()->hide();
+
+ setListView(listView);
+}
+
+
+#include "kcomboview.moc"
diff --git a/lib/widgets/kcomboview.h b/lib/widgets/kcomboview.h
new file mode 100644
index 00000000..9696d328
--- /dev/null
+++ b/lib/widgets/kcomboview.h
@@ -0,0 +1,80 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KCOMBOVIEW_H
+#define KCOMBOVIEW_H
+
+#include <kcompletion.h>
+
+#include "qcomboview.h"
+
+/**
+@file kcomboview.h
+KComboView class.
+*/
+
+/**
+KComboView - a combo with a QListView as a popup widget.
+KComboView provides text completion.
+@sa QComboView for a description.
+*/
+
+
+///This can be used to insert own KCompletion-implementations
+class CustomCompleter : public KCompletion {
+ public:
+ virtual void addItem (const QString &item) {
+ KCompletion::addItem( item );
+ }
+
+ virtual void removeItem (const QString &item) {
+ KCompletion::removeItem( item );
+ }
+
+ virtual void clear() {
+ KCompletion::clear();
+ }
+};
+
+
+class KComboView: public QComboView
+{
+ Q_OBJECT
+public:
+ ///The combo-view takes the ownership of the completer and deletes it on destruction
+ KComboView( bool rw, int defaultWidth = 100, QWidget* parent=0, const char* name=0, CustomCompleter* completer = new CustomCompleter() );
+ virtual ~KComboView();
+
+ virtual void addItem(QListViewItem *it);
+ virtual void removeItem(QListViewItem *it);
+ virtual void renameItem(QListViewItem *it, const QString &newName);
+
+ virtual void setDefaultText(const QString &text);
+
+ virtual void clear();
+
+ int defaultWidth();
+private:
+ virtual void setUpListView();
+
+ CustomCompleter* m_comp;
+ int m_defaultWidth;
+ QString m_defaultText;
+};
+
+#endif
diff --git a/lib/widgets/kdevhtml_partui.rc b/lib/widgets/kdevhtml_partui.rc
new file mode 100644
index 00000000..5a55b7bf
--- /dev/null
+++ b/lib/widgets/kdevhtml_partui.rc
@@ -0,0 +1,18 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui version="3" name="KDevHTMLPart" >
+
+<MenuBar>
+ <Menu name="file" noMerge="0"><text>&amp;File</text>
+ <Action name="print_doc" group="print_merge"/>
+ </Menu>
+ <Menu name="edit" noMerge="0">
+ <Action name="copy_doc_selection" group="edit_paste_merge"/>
+ </Menu>
+</MenuBar>
+
+<ToolBar name="browserToolBar">
+ <Action name="browser_back" group="browser_operations"/>
+ <Action name="browser_forward" group="browser_operations"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/lib/widgets/kdevhtmlpart.cpp b/lib/widgets/kdevhtmlpart.cpp
new file mode 100644
index 00000000..688e373a
--- /dev/null
+++ b/lib/widgets/kdevhtmlpart.cpp
@@ -0,0 +1,512 @@
+#include <qfile.h>
+#include <qclipboard.h>
+#include <qapplication.h>
+
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kmainwindow.h>
+#include <khtmlview.h>
+#include <khtml_settings.h>
+#include <kconfig.h>
+
+#include <kdevmainwindow.h>
+
+
+#include "kdevhtmlpart.h"
+
+KDevHTMLPart::KDevHTMLPart()
+ : KHTMLPart(0L, 0L, 0L, "KDevHTMLPart", DefaultGUI )
+{
+ setXMLFile(locate("data", "kdevelop/kdevhtml_partui.rc"), true);
+
+ connect(browserExtension(), SIGNAL(openURLRequestDelayed(const KURL &,const KParts::URLArgs &)),
+ this, SLOT(openURLRequest(const KURL &)) );
+
+ connect(this, SIGNAL(started(KIO::Job *)), this, SLOT(slotStarted(KIO::Job* )));
+ connect(this, SIGNAL(completed()), this, SLOT(slotCompleted()));
+ connect(this, SIGNAL(canceled(const QString &)), this, SLOT(slotCancelled(const QString &)));
+
+ KActionCollection * actions = actionCollection();// new KActionCollection( this );
+ reloadAction = new KAction( i18n( "Reload" ), "reload", 0,
+ this, SLOT( slotReload() ), actions, "doc_reload" );
+ reloadAction->setWhatsThis(i18n("<b>Reload</b><p>Reloads the current document."));
+ stopAction = new KAction( i18n( "Stop" ), "stop", 0,
+ this, SLOT( slotStop() ), actions, "doc_stop" );
+ stopAction->setWhatsThis(i18n("<b>Stop</b><p>Stops the loading of current document."));
+ duplicateAction = new KAction( i18n( "Duplicate Tab" ), "window_new", 0,
+ this, SLOT( slotDuplicate() ), actions, "doc_dup" );
+ duplicateAction->setWhatsThis(i18n("<b>Duplicate window</b><p>Opens current document in a new window."));
+ printAction = KStdAction::print(this, SLOT(slotPrint()), actions, "print_doc");
+ copyAction = KStdAction::copy(this, SLOT(slotCopy()), actions, "copy_doc_selection");
+
+ connect( this, SIGNAL(popupMenu(const QString &, const QPoint &)), this, SLOT(popup(const QString &, const QPoint &)));
+ connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
+
+//BEGIN documentation history stuff
+
+ m_backAction = new KToolBarPopupAction(i18n("Back"), "back", 0,
+ this, SLOT(slotBack()),
+ actions, "browser_back");
+ m_backAction->setEnabled( false );
+ m_backAction->setToolTip(i18n("Back"));
+ m_backAction->setWhatsThis(i18n("<b>Back</b><p>Moves backwards one step in the <b>documentation</b> browsing history."));
+
+ connect(m_backAction->popupMenu(), SIGNAL(aboutToShow()),
+ this, SLOT(slotBackAboutToShow()));
+ connect(m_backAction->popupMenu(), SIGNAL(activated(int)),
+ this, SLOT(slotPopupActivated(int)));
+
+ m_forwardAction = new KToolBarPopupAction(i18n("Forward"), "forward", 0,
+ this, SLOT(slotForward()),
+ actions, "browser_forward");
+ m_forwardAction->setEnabled( false );
+ m_forwardAction->setToolTip(i18n("Forward"));
+ m_forwardAction->setWhatsThis(i18n("<b>Forward</b><p>Moves forward one step in the <b>documentation</b> browsing history."));
+
+ connect(m_forwardAction->popupMenu(), SIGNAL(aboutToShow()),
+ this, SLOT(slotForwardAboutToShow()));
+ connect(m_forwardAction->popupMenu(), SIGNAL(activated(int)),
+ this, SLOT(slotPopupActivated(int)));
+
+ m_restoring = false;
+ m_Current = m_history.end();
+//END documentation history stuff
+
+ //settings:
+ KConfig *appConfig = KGlobal::config();
+ appConfig->setGroup("KHTMLPart");
+ setStandardFont(appConfig->readEntry("StandardFont",
+ settings()->stdFontName()));
+ setFixedFont(appConfig->readEntry("FixedFont",
+ settings()->fixedFontName()));
+ setZoomFactor(appConfig->readEntry("Zoom", "100").toInt());
+}
+
+void KDevHTMLPart::popup( const QString & url, const QPoint & p )
+{
+// KPopupMenu popup( i18n( "Documentation Viewer" ), this->widget() );
+ KPopupMenu popup(this->widget());
+
+ bool needSep = false;
+ int idNewWindow = -2;
+ if (!url.isEmpty() && (m_options & CanOpenInNewWindow))
+ {
+ idNewWindow = popup.insertItem(SmallIcon("window_new"),i18n("Open in New Tab"));
+ popup.setWhatsThis(idNewWindow, i18n("<b>Open in new window</b><p>Opens current link in a new window."));
+ needSep = true;
+ }
+ if (m_options & CanDuplicate)
+ {
+ duplicateAction->plug(&popup);
+ needSep = true;
+ }
+ if (needSep)
+ popup.insertSeparator();
+
+ m_backAction->plug( &popup );
+ m_forwardAction->plug( &popup );
+ reloadAction->plug(&popup);
+// stopAction->plug(&popup);
+ popup.insertSeparator();
+
+ copyAction->plug( &popup );
+ popup.insertSeparator();
+
+ printAction->plug(&popup);
+ popup.insertSeparator();
+
+ KAction * incFontAction = this->action("incFontSizes");
+ KAction * decFontAction = this->action("decFontSizes");
+ if ( incFontAction && decFontAction )
+ {
+ incFontAction->plug( &popup );
+ decFontAction->plug( &popup );
+ popup.insertSeparator();
+ }
+
+ KAction *ac = action("setEncoding");
+ if (ac)
+ ac->plug(&popup);
+
+ int r = popup.exec(p);
+
+ if (r == idNewWindow)
+ {
+ KURL kurl;
+ if (!KURL(url).path().startsWith("/"))
+ {
+ kdDebug() << "processing relative url: " << url << endl;
+ if (url.startsWith("#"))
+ {
+ kurl = KURL(KDevHTMLPart::url());
+ kurl.setRef(url.mid(1));
+ }
+ else
+ kurl = KURL(KDevHTMLPart::url().upURL().url(true)+url);
+ }
+ else
+ kurl = KURL(url);
+
+ if (kurl.isValid())
+ slotOpenInNewWindow(kurl);
+ }
+}
+
+void KDevHTMLPart::setContext(const QString &context)
+{
+ m_context = context;
+}
+
+
+QString KDevHTMLPart::context() const
+{
+ return m_context;
+}
+
+
+// Note: this function is a copy of code in kdecore/kconfigbase.cpp ;)
+static bool isUtf8(const char *buf) {
+ int i, n;
+ register unsigned char c;
+ bool gotone = false;
+
+#define F 0 /* character never appears in text */
+#define T 1 /* character appears in plain ASCII text */
+#define I 2 /* character appears in ISO-8859 text */
+#define X 3 /* character appears in non-ISO extended ASCII (Mac, IBM PC) */
+
+ static const unsigned char text_chars[256] = {
+ /* BEL BS HT LF FF CR */
+ F, F, F, F, F, F, F, T, T, T, T, F, T, T, F, F, /* 0x0X */
+ /* ESC */
+ F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, F, /* 0x1X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x2X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x3X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x4X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x5X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x6X */
+ T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, /* 0x7X */
+ /* NEL */
+ X, X, X, X, X, T, X, X, X, X, X, X, X, X, X, X, /* 0x8X */
+ X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, /* 0x9X */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xaX */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xbX */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xcX */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xdX */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xeX */
+ I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I /* 0xfX */
+ };
+
+ /* *ulen = 0; */
+ for (i = 0; (c = buf[i]); i++) {
+ if ((c & 0x80) == 0) { /* 0xxxxxxx is plain ASCII */
+ /*
+ * Even if the whole file is valid UTF-8 sequences,
+ * still reject it if it uses weird control characters.
+ */
+
+ if (text_chars[c] != T)
+ return false;
+
+ } else if ((c & 0x40) == 0) { /* 10xxxxxx never 1st byte */
+ return false;
+ } else { /* 11xxxxxx begins UTF-8 */
+ int following;
+
+ if ((c & 0x20) == 0) { /* 110xxxxx */
+ following = 1;
+ } else if ((c & 0x10) == 0) { /* 1110xxxx */
+ following = 2;
+ } else if ((c & 0x08) == 0) { /* 11110xxx */
+ following = 3;
+ } else if ((c & 0x04) == 0) { /* 111110xx */
+ following = 4;
+ } else if ((c & 0x02) == 0) { /* 1111110x */
+ following = 5;
+ } else
+ return false;
+
+ for (n = 0; n < following; n++) {
+ i++;
+ if (!(c = buf[i]))
+ goto done;
+
+ if ((c & 0x80) == 0 || (c & 0x40))
+ return false;
+ }
+ gotone = true;
+ }
+ }
+done:
+ return gotone; /* don't claim it's UTF-8 if it's all 7-bit */
+}
+#undef F
+#undef T
+#undef I
+#undef X
+
+QString KDevHTMLPart::resolveEnvVarsInURL(const QString& url)
+{
+ // check for environment variables and make necessary translations
+ QString path = url;
+ int nDollarPos = path.find( '$' );
+
+ // Note: the while loop below is a copy of code in kdecore/kconfigbase.cpp ;)
+ while( nDollarPos != -1 && nDollarPos+1 < static_cast<int>(path.length())) {
+ // there is at least one $
+ if( (path)[nDollarPos+1] == '(' ) {
+ uint nEndPos = nDollarPos+1;
+ // the next character is no $
+ while ( (nEndPos <= path.length()) && (path[nEndPos]!=')') )
+ nEndPos++;
+ nEndPos++;
+ QString cmd = path.mid( nDollarPos+2, nEndPos-nDollarPos-3 );
+
+ QString result;
+ FILE *fs = popen(QFile::encodeName(cmd).data(), "r");
+ if (fs)
+ {
+ QTextStream ts(fs, IO_ReadOnly);
+ result = ts.read().stripWhiteSpace();
+ pclose(fs);
+ }
+ path.replace( nDollarPos, nEndPos-nDollarPos, result );
+ } else if( (path)[nDollarPos+1] != '$' ) {
+ uint nEndPos = nDollarPos+1;
+ // the next character is no $
+ QString aVarName;
+ if (path[nEndPos]=='{')
+ {
+ while ( (nEndPos <= path.length()) && (path[nEndPos]!='}') )
+ nEndPos++;
+ nEndPos++;
+ aVarName = path.mid( nDollarPos+2, nEndPos-nDollarPos-3 );
+ }
+ else
+ {
+ while ( nEndPos <= path.length() && (path[nEndPos].isNumber()
+ || path[nEndPos].isLetter() || path[nEndPos]=='_' ) )
+ nEndPos++;
+ aVarName = path.mid( nDollarPos+1, nEndPos-nDollarPos-1 );
+ }
+ const char* pEnv = 0;
+ if (!aVarName.isEmpty())
+ pEnv = getenv( aVarName.ascii() );
+ if( pEnv ) {
+ // !!! Sergey A. Sukiyazov <corwin@micom.don.ru> !!!
+ // A environment variables may contain values in 8bit
+ // locale cpecified encoding or in UTF8 encoding.
+ if (isUtf8( pEnv ))
+ path.replace( nDollarPos, nEndPos-nDollarPos, QString::fromUtf8(pEnv) );
+ else
+ path.replace( nDollarPos, nEndPos-nDollarPos, QString::fromLocal8Bit(pEnv) );
+ } else
+ path.remove( nDollarPos, nEndPos-nDollarPos );
+ } else {
+ // remove one of the dollar signs
+ path.remove( nDollarPos, 1 );
+ nDollarPos++;
+ }
+ nDollarPos = path.find( '$', nDollarPos );
+ }
+
+ return path;
+}
+
+bool KDevHTMLPart::openURL(const KURL &url)
+{
+ QString path = resolveEnvVarsInURL(url.url());
+ KURL newUrl(path);
+
+ bool retval = KHTMLPart::openURL(newUrl);
+ if ( retval )
+ {
+ emit fileNameChanged(this);
+ if ( !m_restoring )
+ {
+ addHistoryEntry();
+ }
+ }
+
+ m_backAction->setEnabled( m_Current != m_history.begin() );
+ m_forwardAction->setEnabled( m_Current != m_history.fromLast() );
+
+ return retval;
+}
+
+void KDevHTMLPart::openURLRequest(const KURL &url)
+{
+ openURL( url );
+}
+
+void KDevHTMLPart::slotReload( )
+{
+ openURL( url() );
+}
+
+void KDevHTMLPart::slotStop( )
+{
+ closeURL();
+}
+
+void KDevHTMLPart::slotStarted( KIO::Job * )
+{
+ stopAction->setEnabled(true);
+}
+
+void KDevHTMLPart::slotCompleted( )
+{
+ stopAction->setEnabled(false);
+}
+
+void KDevHTMLPart::slotCancelled( const QString & /*errMsg*/ )
+{
+ stopAction->setEnabled(false);
+}
+
+/*void KDevHTMLPart::slotDuplicate( )
+{
+ PartController::getInstance()->showDocument(url(), true);
+}*/
+
+void KDevHTMLPart::slotPrint( )
+{
+ view()->print();
+}
+
+void KDevHTMLPart::slotBack()
+{
+ if ( m_Current != m_history.begin() )
+ {
+ --m_Current;
+ m_restoring = true;
+ openURL( (*m_Current).url );
+ m_restoring = false;
+ }
+}
+
+void KDevHTMLPart::slotForward()
+{
+ if ( m_Current != m_history.fromLast() )
+ {
+ ++m_Current;
+ m_restoring = true;
+ openURL( (*m_Current).url );
+ m_restoring = false;
+ }
+}
+
+void KDevHTMLPart::slotBackAboutToShow()
+{
+ KPopupMenu *popup = m_backAction->popupMenu();
+ popup->clear();
+
+ if ( m_Current == m_history.begin() ) return;
+
+ QValueList<DocumentationHistoryEntry>::Iterator it = m_Current;
+ --it;
+
+ int i = 0;
+ while( i < 10 )
+ {
+ if ( it == m_history.begin() )
+ {
+ popup->insertItem( (*it).url.url(), (*it).id );
+ return;
+ }
+
+ popup->insertItem( (*it).url.url(), (*it).id );
+ ++i;
+ --it;
+ }
+}
+
+void KDevHTMLPart::slotForwardAboutToShow()
+{
+ KPopupMenu *popup = m_forwardAction->popupMenu();
+ popup->clear();
+
+ if ( m_Current == m_history.fromLast() ) return;
+
+ QValueList<DocumentationHistoryEntry>::Iterator it = m_Current;
+ ++it;
+
+ int i = 0;
+ while( i < 10 )
+ {
+ if ( it == m_history.fromLast() )
+ {
+ popup->insertItem( (*it).url.url(), (*it).id );
+ return;
+ }
+
+ popup->insertItem( (*it).url.url(), (*it).id );
+ ++i;
+ ++it;
+ }
+}
+
+void KDevHTMLPart::slotPopupActivated( int id )
+{
+ kdDebug(9000) << "id: " << id << endl;
+
+ QValueList<DocumentationHistoryEntry>::Iterator it = m_history.begin();
+ while( it != m_history.end() )
+ {
+ kdDebug(9000) << "(*it).id: " << (*it).id << endl;
+ if ( (*it).id == id )
+ {
+ m_Current = it;
+ m_restoring = true;
+ openURL( (*m_Current).url );
+ m_restoring = false;
+ return;
+ }
+ ++it;
+ }
+}
+
+void KDevHTMLPart::addHistoryEntry()
+{
+ QValueList<DocumentationHistoryEntry>::Iterator it = m_Current;
+
+ // if We're not already the last entry, we truncate the list here before adding an entry
+ if ( it != m_history.end() && it != m_history.fromLast() )
+ {
+ m_history.erase( ++it, m_history.end() );
+ }
+
+ DocumentationHistoryEntry newEntry( url() );
+
+ // Only save the new entry if it is different from the last
+ if ( newEntry.url != (*m_Current).url )
+ {
+ m_history.append( newEntry );
+ m_Current = m_history.fromLast();
+ }
+}
+
+void KDevHTMLPart::slotCopy( )
+{
+ QString text = selectedText();
+ text.replace( QChar( 0xa0 ), ' ' );
+ QClipboard *cb = QApplication::clipboard();
+ disconnect( cb, SIGNAL( selectionChanged() ), this, SLOT( slotClearSelection() ) );
+ cb->setText(text);
+ connect( cb, SIGNAL( selectionChanged() ), this, SLOT( slotClearSelection() ) );
+}
+
+void KDevHTMLPart::slotSelectionChanged( )
+{
+ if (selectedText().isEmpty())
+ copyAction->setEnabled(false);
+ else
+ copyAction->setEnabled(true);
+}
+
+#include "kdevhtmlpart.moc"
diff --git a/lib/widgets/kdevhtmlpart.h b/lib/widgets/kdevhtmlpart.h
new file mode 100644
index 00000000..944f1e9b
--- /dev/null
+++ b/lib/widgets/kdevhtmlpart.h
@@ -0,0 +1,111 @@
+#ifndef __KDEVHTMLPART_H__
+#define __KDEVHTMLPART_H__
+
+#include <stdlib.h>
+
+#include <qdatetime.h>
+
+#include <khtml_part.h>
+
+/**
+@file kdevhtmlpart.h
+Customized KHTML part for KDevelop.
+*/
+
+class KAction;
+class KToolBarPopupAction;
+class KParts::ReadOnlyPart;
+
+struct DocumentationHistoryEntry {
+ KURL url;
+ int id;
+
+ DocumentationHistoryEntry() {}
+ DocumentationHistoryEntry( const KURL& u ): url( u )
+ {
+ id = abs( QTime::currentTime().msecsTo( QTime() ) ); // nasty, but should provide a reasonably unique number
+ }
+};
+
+/**
+Customized KHTML part for KDevelop.
+Used as HTML documentation and file viewer.
+
+Represents customized BrowserViewGUI mode of KHTMLPart. Provides also actions for:
+- reload;
+- stop;
+- duplicate;
+- print;
+- copy text;
+- back;
+- forward.
+.
+It has it's own popup menu and font/zoom settings.
+*/
+class KDevHTMLPart : public KHTMLPart
+{
+ Q_OBJECT
+
+public:
+
+ enum Options { CanDuplicate=1, CanOpenInNewWindow=2 };
+
+ KDevHTMLPart();
+
+ void setContext(const QString &context);
+ QString context() const;
+ virtual bool openURL(const KURL &url);
+ static QString resolveEnvVarsInURL(const QString& url);
+
+ void setOptions(int options) { m_options = options; }
+
+signals:
+ void fileNameChanged(KParts::ReadOnlyPart *part);
+
+protected slots:
+
+ void slotStarted(KIO::Job *);
+ void slotCompleted();
+ void slotCancelled(const QString &errMsg);
+
+ void openURLRequest(const KURL &url);
+ void popup( const QString & url, const QPoint & p );
+
+ void slotReload();
+ void slotStop();
+ virtual void slotDuplicate() = 0;
+ virtual void slotOpenInNewWindow(const KURL &url) = 0;
+ void slotPrint();
+ void slotCopy();
+ void slotSelectionChanged();
+
+ void slotBack();
+ void slotForward();
+ void slotBackAboutToShow();
+ void slotForwardAboutToShow();
+
+ void slotPopupActivated( int id );
+ void addHistoryEntry();
+
+
+private:
+
+ QValueList< DocumentationHistoryEntry > m_history;
+ QValueList< DocumentationHistoryEntry >::Iterator m_Current;
+
+ KToolBarPopupAction* m_backAction;
+ KToolBarPopupAction* m_forwardAction;
+
+ bool m_restoring;
+
+ QString m_context;
+ KAction *stopAction;
+ KAction *reloadAction;
+ KAction *duplicateAction;
+ KAction *printAction;
+ KAction *copyAction;
+
+ int m_options;
+};
+
+#endif
diff --git a/lib/widgets/kdevtabwidget.cpp b/lib/widgets/kdevtabwidget.cpp
new file mode 100644
index 00000000..49925115
--- /dev/null
+++ b/lib/widgets/kdevtabwidget.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2001-2003 *
+ * The KDevelop Team *
+ * *
+ * 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 <qpopupmenu.h>
+
+#include <kglobal.h>
+#include <klocale.h>
+#include <kicontheme.h>
+#include <kiconloader.h>
+
+#include "kdevtabwidget.h"
+
+KDevTabWidget::KDevTabWidget(QWidget *parent, const char *name) : QTabWidget(parent,name)
+{
+ m_pTabBar = new KTabBar(this, "tabbar");
+ setTabBar(m_pTabBar);
+ connect(m_pTabBar, SIGNAL(closeWindow(const QWidget*)), this, SIGNAL(closeWindow(const QWidget*)));
+ connect(m_pTabBar, SIGNAL(closeOthers(QWidget*)), this, SIGNAL(closeOthers(QWidget*)));
+}
+
+KTabBar::KTabBar(QWidget *parent, const char *name) : QTabBar(parent,name)
+{
+ m_pPopupMenu = new QPopupMenu(this);
+
+ QPixmap closePixmap = KGlobal::instance()->iconLoader()->loadIcon( "tab_remove", KIcon::Small, 0, KIcon::DefaultState, 0, true );
+ if (closePixmap.isNull())
+ closePixmap = SmallIcon("fileclose");
+
+ m_pPopupMenu->insertItem(closePixmap, i18n("&Close"), this, SLOT(closeWindowSlot()));
+ m_pPopupMenu->insertItem(i18n("Close &Others"), this, SLOT(closeOthersSlot()));
+}
+
+void KTabBar::closeWindowSlot()
+{
+ emit closeWindow(m_pPage);
+}
+
+void KTabBar::closeOthersSlot()
+{
+ emit closeOthers(m_pPage);
+}
+
+void KTabBar::mousePressEvent(QMouseEvent *e)
+{
+ if(e->button() == Qt::RightButton) {
+
+ QTab *tab = selectTab(e->pos() );
+ if( tab == 0L ) return;
+
+ m_pPage = ((KDevTabWidget*)parent())->page(indexOf(tab->identifier() ) );
+ if(m_pPage == 0L) return;
+
+ m_pPopupMenu->exec(mapToGlobal(e->pos()));
+ }
+ QTabBar::mousePressEvent(e);
+}
+
+#include "kdevtabwidget.moc"
diff --git a/lib/widgets/klistviewaction.cpp b/lib/widgets/klistviewaction.cpp
new file mode 100644
index 00000000..f9e4e1b9
--- /dev/null
+++ b/lib/widgets/klistviewaction.cpp
@@ -0,0 +1,86 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "klistviewaction.h"
+#include "kcomboview.h"
+#include "resizablecombo.h"
+
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+#include <kconfig.h>
+#include <kglobal.h>
+
+KListViewAction::~KListViewAction()
+{
+ KConfig *config = KGlobal::config();
+ if (config && m_view->name())
+ {
+ config->setGroup("KListViewAction");
+ config->writeEntry(m_view->name(), m_view->width());
+ }
+ delete m_view;
+}
+
+KListViewAction::KListViewAction(KComboView *view, const QString & text, const KShortcut & cut,
+ const QObject * receiver, const char * slot, KActionCollection * parent, const char * name ):
+ KWidgetAction(view, text, cut, receiver, slot, parent, name), m_view(view)
+{
+ m_view->setDuplicatesEnabled(false);
+ m_view->setInsertionPolicy(KComboView::NoInsertion);
+
+ loadComboWidth();
+}
+
+KListViewAction::KListViewAction( KComboView * view, const QString & text, const KShortcut & cut,
+ const QObject * receiver, const char * slot, KActionCollection * parent, const char * name, const bool /*dummy*/ ):
+ KWidgetAction(new ResizableCombo(view), text, cut, receiver, slot, parent, name), m_view(view)
+{
+ m_view->setDuplicatesEnabled(false);
+ m_view->setInsertionPolicy(KComboView::NoInsertion);
+
+ loadComboWidth();
+}
+
+KComboView * KListViewAction::view( ) const
+{
+ return m_view;
+}
+
+void KListViewAction::setToolTip( const QString & str )
+{
+ QToolTip::remove(m_view);
+ QToolTip::add(m_view, str);
+}
+
+void KListViewAction::setWhatsThis( const QString & str )
+{
+ QWhatsThis::remove(m_view);
+ QWhatsThis::add(m_view, str);
+}
+
+void KListViewAction::loadComboWidth( )
+{
+ KConfig *config = KGlobal::config();
+ if (config && m_view->name())
+ {
+ config->setGroup("KListViewAction");
+ m_view->setMinimumWidth(config->readNumEntry(m_view->name(), m_view->defaultWidth()));
+ }
+}
+
diff --git a/lib/widgets/klistviewaction.h b/lib/widgets/klistviewaction.h
new file mode 100644
index 00000000..1dbacf09
--- /dev/null
+++ b/lib/widgets/klistviewaction.h
@@ -0,0 +1,56 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KLISTVIEWACTION_H
+#define KLISTVIEWACTION_H
+
+#include <kxmlguiclient.h>
+#include <kdeversion.h>
+#include <kaction.h>
+
+class KComboView;
+
+/**
+@file klistviewaction.h
+Widget action with KComboView.
+*/
+
+
+/**
+Widget action with KComboView.
+Can be used on toolbars. It appears as @ref ResizableCombo.
+*/
+class KListViewAction: public KWidgetAction
+{
+public:
+ KListViewAction(KComboView *view, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name);
+ KListViewAction(KComboView *view, const QString &text, const KShortcut &cut, const QObject *receiver, const char *slot, KActionCollection *parent, const char *name, const bool);
+
+ ~KListViewAction();
+
+ KComboView *view() const;
+ void setToolTip(const QString & str);
+ void setWhatsThis(const QString &str);
+
+private:
+ void loadComboWidth();
+
+ KComboView *m_view;
+};
+
+#endif
diff --git a/lib/widgets/ksavealldialog.cpp b/lib/widgets/ksavealldialog.cpp
new file mode 100644
index 00000000..dec2a80c
--- /dev/null
+++ b/lib/widgets/ksavealldialog.cpp
@@ -0,0 +1,189 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qvbox.h>
+#include <qlabel.h>
+#include <qheader.h>
+
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <klistbox.h>
+#include <klistview.h>
+#include <kstdguiitem.h>
+
+#include "ksavealldialog.h"
+
+namespace
+{
+
+class CheckURL : public QCheckListItem
+{
+public:
+ CheckURL( QListView * lv, KURL const & url )
+ : QCheckListItem( lv, url.path(), QCheckListItem::CheckBox),
+ _url( url )
+ {}
+
+ KURL const & url() const { return _url; }
+
+private:
+ KURL _url;
+};
+
+}
+
+
+KSaveSelectDialog::KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, QWidget * parent ) :
+ KDialogBase( parent, "SaveAllDialog", true, i18n("Save Modified Files?"),
+ Ok | User1 | Close )
+{
+ QVBox *top = makeVBoxMainWidget();
+
+ (void)new QLabel( i18n("The following files have been modified. Save them?"), top );
+
+ _listview = new KListView( top );
+ _listview->addColumn( "" );
+ _listview->header()->hide();
+ _listview->setResizeMode( QListView::LastColumn );
+
+ setButtonOK( KGuiItem(i18n("Save &Selected"), QString::null, i18n("Saves all selected files")) );
+ setButtonText( User1, i18n("Save &None") );
+ setButtonText( Close, KStdGuiItem::cancel().text() );
+ setButtonTip( User1, i18n("Lose all modifications") );
+ setButtonTip( Close, i18n("Cancels the action") );
+
+ KURL::List::ConstIterator it = filelist.begin();
+ while ( it != filelist.end() )
+ {
+ if ( !ignorelist.contains( *it ) )
+ {
+ QCheckListItem * x = new CheckURL( _listview, *it );
+ x->setOn( true );
+ }
+ ++it;
+ }
+
+ connect( this, SIGNAL(closeClicked()), this, SLOT(cancel()) );
+ connect( this, SIGNAL(okClicked()), this, SLOT(save()) );
+ connect( this, SIGNAL(user1Clicked()), this, SLOT(saveNone()) );
+}
+
+KSaveSelectDialog::~KSaveSelectDialog() {}
+
+void KSaveSelectDialog::saveNone( )
+{
+ // deselect all
+ CheckURL * item = static_cast<CheckURL*>( _listview->firstChild() );
+ while ( item )
+ {
+ item->setOn( false );
+ item = static_cast<CheckURL*>( item->nextSibling() );
+ }
+
+ QDialog::accept();
+}
+
+void KSaveSelectDialog::save( )
+{
+ QDialog::accept();
+}
+
+void KSaveSelectDialog::cancel( )
+{
+ QDialog::reject();
+}
+
+KURL::List KSaveSelectDialog::filesToSave( )
+{
+ KURL::List filelist;
+ CheckURL const * item = static_cast<CheckURL*>( _listview->firstChild() );
+ while ( item )
+ {
+ if ( item->isOn() )
+ {
+ filelist << item->url();
+ }
+ item = static_cast<CheckURL*>( item->nextSibling() );
+ }
+ return filelist;
+}
+
+KURL::List KSaveSelectDialog::filesNotToSave( )
+{
+ KURL::List filelist;
+ CheckURL const * item = static_cast<CheckURL*>( _listview->firstChild() );
+ while ( item )
+ {
+ if ( ! item->isOn() )
+ {
+ filelist << item->url();
+ }
+ item = static_cast<CheckURL*>( item->nextSibling() );
+ }
+ return filelist;
+}
+
+
+KSaveAllDialog::KSaveAllDialog( const QStringList& filenames, QWidget* parent ) :
+ KDialogBase( parent, "SaveAllDialog", true, i18n("Save Modified Files?"),
+ Ok | User1 | Close )
+{
+ m_result = Cancel;
+
+ QVBox *top = makeVBoxMainWidget();
+
+ (void)new QLabel( i18n("The following files have been modified. Save them?"), top );
+ KListBox* lb = new KListBox( top );
+ lb->setMinimumHeight( lb->fontMetrics().height() * 5 );
+ lb->insertStringList( filenames );
+
+ setButtonOK( KGuiItem(i18n("Save &All"), QString::null, i18n("Saves all modified files")) );
+ setButtonText( User1, i18n("Save &None") );
+ setButtonText( Close, KStdGuiItem::cancel().text() );
+ setButtonTip( User1, i18n("Lose all modifications") );
+ setButtonTip( Close, i18n("Cancels the action") );
+
+ connect( this, SIGNAL(closeClicked()), this, SLOT(cancel()) );
+ connect( this, SIGNAL(okClicked()), this, SLOT(saveAll()) );
+ connect( this, SIGNAL(user1Clicked()), this, SLOT(revert()) );
+}
+
+KSaveAllDialog::~KSaveAllDialog()
+{
+}
+
+void KSaveAllDialog::revert()
+{
+ m_result = Revert;
+ QDialog::accept();
+}
+
+void KSaveAllDialog::saveAll()
+{
+ m_result = SaveAll;
+ QDialog::accept();
+}
+
+void KSaveAllDialog::cancel()
+{
+ m_result = Cancel;
+ QDialog::reject();
+}
+
+#include "ksavealldialog.moc"
diff --git a/lib/widgets/ksavealldialog.h b/lib/widgets/ksavealldialog.h
new file mode 100644
index 00000000..9d204bb7
--- /dev/null
+++ b/lib/widgets/ksavealldialog.h
@@ -0,0 +1,83 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Harald Fernengel <harry@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef SAVEALLDIALOG_H
+#define SAVEALLDIALOG_H
+
+#include <qstringlist.h>
+#include <kdialogbase.h>
+#include <kurl.h>
+
+class KListView;
+/**
+@file ksavealldialog.h
+Dialogs to save multiple files.
+*/
+
+/**
+Dialog to save selected files.
+*/
+class KSaveSelectDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KSaveSelectDialog( KURL::List const & filelist, KURL::List const & ignorelist, QWidget * parent );
+ virtual ~KSaveSelectDialog();
+
+ KURL::List filesToSave();
+ KURL::List filesNotToSave();
+
+private slots:
+ void saveNone();
+ void save();
+ void cancel();
+
+private:
+ KListView * _listview;
+
+};
+
+
+/**
+Dialog to save all files.
+*/
+class KSaveAllDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ enum SaveAllResult{ SaveAll, Cancel, Revert };
+
+ KSaveAllDialog( const QStringList& filenames, QWidget* parent );
+ virtual ~KSaveAllDialog();
+
+ SaveAllResult result() const { return m_result; }
+
+private slots:
+ void revert();
+ void saveAll();
+ void cancel();
+
+private:
+ SaveAllResult m_result;
+
+};
+
+#endif
diff --git a/lib/widgets/processlinemaker.cpp b/lib/widgets/processlinemaker.cpp
new file mode 100644
index 00000000..9cb19971
--- /dev/null
+++ b/lib/widgets/processlinemaker.cpp
@@ -0,0 +1,93 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "processlinemaker.h"
+#include "processlinemaker.moc"
+
+#include <kprocess.h>
+
+ProcessLineMaker::ProcessLineMaker()
+{
+}
+
+ProcessLineMaker::ProcessLineMaker( const KProcess* proc )
+{
+ connect(proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, SLOT(slotReceivedStdout(KProcess*,char*,int)) );
+
+ connect(proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, SLOT(slotReceivedStderr(KProcess*,char*,int)) );
+}
+
+void ProcessLineMaker::slotReceivedStdout( const char *buffer )
+{
+ stdoutbuf += buffer;
+ int pos;
+ while ( (pos = stdoutbuf.find('\n')) != -1) {
+ QCString line = stdoutbuf.left( pos );
+ emit receivedStdoutLine(line);
+ stdoutbuf.remove(0, pos+1);
+ }
+ if( !stdoutbuf.isEmpty() ) {
+ emit receivedPartialStdoutLine( stdoutbuf );
+ stdoutbuf.truncate(0);
+ }
+}
+
+void ProcessLineMaker::slotReceivedStdout( KProcess*, char *buffer, int )
+{
+ slotReceivedStdout(buffer); // It is zero-terminated
+}
+
+
+void ProcessLineMaker::slotReceivedStderr( const char *buffer )
+{
+ stderrbuf += buffer;
+ int pos;
+ while ( (pos = stderrbuf.find('\n')) != -1) {
+ QCString line = stderrbuf.left( pos );
+ emit receivedStderrLine(line);
+ stderrbuf.remove(0, pos+1);
+ }
+ if( !stderrbuf.isEmpty() ) {
+ emit receivedPartialStderrLine( stderrbuf );
+ stderrbuf.truncate(0);
+ }
+}
+
+void ProcessLineMaker::slotReceivedStderr( KProcess*, char *buffer, int )
+{
+ slotReceivedStderr(buffer); // It is zero-terminated
+}
+
+void ProcessLineMaker::clearBuffers( )
+{
+ stderrbuf.truncate(0);
+ stdoutbuf.truncate(0);
+}
+
+void ProcessLineMaker::flush()
+{
+ if( !stderrbuf.isEmpty() )
+ emit receivedStderrLine(stderrbuf);
+ if( !stdoutbuf.isEmpty() )
+ emit receivedStdoutLine(stdoutbuf);
+ clearBuffers();
+}
+
diff --git a/lib/widgets/processlinemaker.h b/lib/widgets/processlinemaker.h
new file mode 100644
index 00000000..a529467f
--- /dev/null
+++ b/lib/widgets/processlinemaker.h
@@ -0,0 +1,67 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 John Firebaugh <jfirebaugh@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _PROCESSLINEMAKER_H_
+#define _PROCESSLINEMAKER_H_
+
+#include <qobject.h>
+
+/**
+@file processlinemaker.h
+Utility objects for process output views.
+*/
+
+class KProcess;
+
+/**
+Convenience class to catch output of KProcess.
+*/
+class ProcessLineMaker : public QObject
+{
+Q_OBJECT
+
+public:
+ ProcessLineMaker();
+ ProcessLineMaker( const KProcess* );
+
+ void clearBuffers();
+ void flush();
+
+public slots:
+ void slotReceivedStdout(const char*);
+ void slotReceivedStderr(const char*);
+
+protected slots:
+ void slotReceivedStdout(KProcess *, char *buffer, int buflen);
+ void slotReceivedStderr(KProcess *, char *buffer, int buflen);
+
+signals:
+ void receivedStdoutLine( const QCString& line );
+ void receivedStderrLine( const QCString& line );
+ void receivedPartialStdoutLine( const QCString& line );
+ void receivedPartialStderrLine( const QCString& line );
+
+private:
+ QCString stdoutbuf;
+ QCString stderrbuf;
+};
+
+#endif
+
+//kate: replace-tabs off; indent-spaces off;
diff --git a/lib/widgets/processwidget.cpp b/lib/widgets/processwidget.cpp
new file mode 100644
index 00000000..54dd1751
--- /dev/null
+++ b/lib/widgets/processwidget.cpp
@@ -0,0 +1,283 @@
+/* This file is part of the KDE project
+ Copyright (C) 1999-2001 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "processwidget.h"
+#include "processlinemaker.h"
+
+#include <kdeversion.h>
+#include <qdir.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <qpainter.h>
+#include <qapplication.h>
+
+
+ProcessListBoxItem::ProcessListBoxItem(const QString &s, Type type)
+ : QListBoxText(s), t(type)
+{
+ QString clean = s;
+ clean.replace( QChar('\t'), QString(" ") );
+ clean.replace( QChar('\n'), QString() );
+ clean.replace( QChar('\r'), QString() );
+ setText( clean );
+
+ setCustomHighlighting(true);
+}
+
+
+bool ProcessListBoxItem::isCustomItem()
+{
+ return false;
+}
+
+static inline unsigned char normalize(int a)
+{
+ return (a < 0 ? 0 : a > 255 ? 255 : a);
+}
+
+static inline double blend1(double a, double b, double k)
+{
+ return a + (b - a) * k;
+}
+
+QColor ProcessListBoxItem::blend(const QColor &c1, const QColor &c2, double k) const
+{
+ if (k < 0.0) return c1;
+ if (k > 1.0) return c2;
+
+ int r = normalize((int)blend1((double)c1.red(), (double)c2.red(), k));
+ int g = normalize((int)blend1((double)c1.green(), (double)c2.green(), k));
+ int b = normalize((int)blend1((double)c1.blue(), (double)c2.blue(), k));
+
+ return QColor(qRgb(r, g, b));
+}
+
+void ProcessListBoxItem::paint(QPainter *p)
+{
+ QColor dim, warn, err, back;
+ if (listBox()) {
+ const QColorGroup& group = listBox()->palette().active();
+ if (isSelected()) {
+ back = group.button();
+ warn = group.buttonText();
+ }
+ else
+ {
+ back = group.base();
+ warn = group.text();
+ }
+ err = group.linkVisited();
+ dim = blend(warn, back);
+ }
+ else
+ {
+ warn = Qt::black;
+ dim = Qt::darkBlue;
+ err = Qt::darkRed;
+ if (isSelected())
+ back = Qt::lightGray;
+ else
+ back = Qt::white;
+ }
+ p->fillRect(p->window(), QBrush(back));
+ p->setPen((t==Error)? err :
+ (t==Diagnostic)? warn : dim);
+ QListBoxText::paint(p);
+}
+
+
+ProcessWidget::ProcessWidget(QWidget *parent, const char *name)
+ : KListBox(parent, name)
+{
+ setFocusPolicy(QWidget::NoFocus);
+
+ // Don't override the palette, as that can mess up styles. Instead, draw
+ // the background ourselves (see ProcessListBoxItem::paint).
+
+
+ childproc = new KProcess();
+ childproc->setUseShell(true);
+
+ procLineMaker = new ProcessLineMaker( childproc );
+
+ connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)),
+ this, SLOT(insertStdoutLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)),
+ this, SLOT(insertStderrLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)),
+ this, SLOT(addPartialStdoutLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)),
+ this, SLOT(addPartialStderrLine(const QCString&) ));
+
+ connect(childproc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*) )) ;
+}
+
+
+ProcessWidget::~ProcessWidget()
+{
+ delete childproc;
+ delete procLineMaker;
+}
+
+
+void ProcessWidget::startJob(const QString &dir, const QString &command)
+{
+ procLineMaker->clearBuffers();
+ procLineMaker->blockSignals( false );
+
+ clear();
+ insertItem(new ProcessListBoxItem(command, ProcessListBoxItem::Diagnostic));
+ childproc->clearArguments();
+ if (!dir.isNull()) {
+ childproc->setWorkingDirectory( dir );
+ }
+
+ *childproc << command;
+ childproc->start(KProcess::OwnGroup, KProcess::AllOutput);
+}
+
+
+void ProcessWidget::killJob( int signo )
+{
+ procLineMaker->blockSignals( true );
+
+ childproc->kill( signo );
+}
+
+
+bool ProcessWidget::isRunning()
+{
+ return childproc->isRunning();
+}
+
+
+void ProcessWidget::slotProcessExited(KProcess *)
+{
+ procLineMaker->flush();
+ if( !stdoutbuf.isEmpty() )
+ insertStdoutLine("");
+ if( !stderrbuf.isEmpty() )
+ insertStderrLine("");
+ childFinished(childproc->normalExit(), childproc->exitStatus());
+ maybeScrollToBottom();
+ emit processExited(childproc);
+}
+
+
+void ProcessWidget::insertStdoutLine(const QCString &line)
+{
+ if( !stdoutbuf.isEmpty() )
+ {
+ stdoutbuf += line;
+ insertItem( new ProcessListBoxItem( QString::fromLocal8Bit(stdoutbuf),
+ ProcessListBoxItem::Normal ),
+ lastRowStdout+1 );
+ stdoutbuf.truncate( 0 );
+ }else
+ {
+ insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ),
+ ProcessListBoxItem::Normal) );
+ }
+ lastRowStdout = count() - 1;
+ maybeScrollToBottom();
+}
+
+
+void ProcessWidget::insertStderrLine(const QCString &line)
+{
+ if( !stderrbuf.isEmpty() )
+ {
+ stderrbuf += line;
+ insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( stderrbuf ),
+ ProcessListBoxItem::Error ),
+ lastRowStderr+1 );
+ stderrbuf.truncate( 0 );
+ } else
+ {
+ insertItem( new ProcessListBoxItem( QString::fromLocal8Bit( line ),
+ ProcessListBoxItem::Error) );
+ }
+ lastRowStderr = count() - 1;
+ maybeScrollToBottom();
+}
+
+
+void ProcessWidget::childFinished(bool normal, int status)
+{
+ QString s;
+ ProcessListBoxItem::Type t;
+
+ if (normal) {
+ if (status) {
+ s = i18n("*** Exited with status: %1 ***").arg(status);
+ t = ProcessListBoxItem::Error;
+ } else {
+ s = i18n("*** Exited normally ***");
+ t = ProcessListBoxItem::Diagnostic;
+ }
+ } else {
+ if ( childproc->signalled() && childproc->exitSignal() == SIGSEGV )
+ {
+ s = i18n("*** Process aborted. Segmentation fault ***");
+ }
+ else
+ {
+ s = i18n("*** Process aborted ***");
+ }
+ t = ProcessListBoxItem::Error;
+ }
+
+ insertItem(new ProcessListBoxItem(s, t));
+}
+
+
+QSize ProcessWidget::minimumSizeHint() const
+{
+ // I'm not sure about this, but when I don't use override minimumSizeHint(),
+ // the initial size in clearly too small
+
+ return QSize( QListBox::sizeHint().width(),
+ (fontMetrics().lineSpacing()+2)*4 );
+}
+
+/** Should be called right after an insertItem(),
+ will automatic scroll the listbox if it is already at the bottom
+ to prevent automatic scrolling when the user has scrolled up
+*/
+void ProcessWidget::maybeScrollToBottom()
+{
+ if ( verticalScrollBar()->value() == verticalScrollBar()->maxValue() )
+ {
+ setBottomItem( count() -1 );
+ }
+}
+
+void ProcessWidget::addPartialStderrLine(const QCString& linepart)
+{
+ stderrbuf += linepart;
+}
+
+void ProcessWidget::addPartialStdoutLine(const QCString& linepart)
+{
+ stdoutbuf += linepart;
+}
+
+#include "processwidget.moc"
diff --git a/lib/widgets/processwidget.h b/lib/widgets/processwidget.h
new file mode 100644
index 00000000..ac9693e2
--- /dev/null
+++ b/lib/widgets/processwidget.h
@@ -0,0 +1,127 @@
+/* This file is part of the KDE project
+ Copyright (C) 1999-2001 Bernd Gehrmann <bernd@kdevelop.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _PROCESSWIDGET_H_
+#define _PROCESSWIDGET_H_
+
+#include <klistbox.h>
+#include <kprocess.h>
+
+/**
+@file processwidget.h
+Widgets for various output views.
+*/
+
+class ProcessLineMaker;
+
+/**
+Listbox item for process widgets.
+*/
+class ProcessListBoxItem : public QListBoxText
+{
+public:
+ enum Type { Diagnostic, Normal, Error };
+
+ ProcessListBoxItem(const QString &s, Type type);
+
+ virtual bool isCustomItem();
+
+protected:
+ QColor blend(const QColor &c1, const QColor &c2, double k = 0.25) const;
+
+private:
+ virtual void paint(QPainter *p);
+ Type t;
+};
+
+
+/**
+ * This class is designed to share code between the
+ * grep and application output widgets.
+ */
+class ProcessWidget : public KListBox
+{
+ Q_OBJECT
+
+public:
+ ProcessWidget(QWidget *parent, const char *name=0);
+ ~ProcessWidget();
+
+ /**
+ * Returns whether a process is running in this view.
+ */
+ bool isRunning();
+
+public slots:
+ /**
+ * Starts the child process.
+ */
+ void startJob(const QString &dir, const QString &command);
+ /**
+ * Kills the child processss.
+ */
+ void killJob( int signo = SIGTERM );
+ /**
+ * Inserts one line from stdin into the listbox. This can
+ * be overridden by subclasses to implement
+ * syntax highlighting.
+ */
+ virtual void insertStdoutLine(const QCString &line);
+ /**
+ * Inserts one line from stderr into the listbox. This can
+ * be overridden by subclasses to implement
+ * syntax highlighting. By default, a ProcessListBoxItem
+ * is used.
+ */
+ virtual void insertStderrLine(const QCString &line);
+
+ virtual void addPartialStdoutLine(const QCString&);
+ virtual void addPartialStderrLine(const QCString&);
+
+protected:
+ /**
+ * This is called when the child process exits.
+ * The flag 'normal' is true if the process exited
+ * normally (i.e. not by a signal or similar), otherwise
+ * the exit status can be taken from 'status'.
+ */
+ virtual void childFinished(bool normal, int status);
+
+signals:
+ void processExited(KProcess *);
+ void rowSelected(int row);
+
+protected:
+ virtual QSize minimumSizeHint() const;
+ void maybeScrollToBottom();
+
+protected slots:
+ void slotProcessExited(KProcess*);
+
+private:
+ KProcess *childproc;
+ ProcessLineMaker* procLineMaker;
+ QCString stderrbuf;
+ QCString stdoutbuf;
+ int lastRowStdout;
+ int lastRowStderr;
+};
+
+
+#endif
diff --git a/lib/widgets/propeditor/Mainpage.dox b/lib/widgets/propeditor/Mainpage.dox
new file mode 100644
index 00000000..6bc81be0
--- /dev/null
+++ b/lib/widgets/propeditor/Mainpage.dox
@@ -0,0 +1,116 @@
+/**
+@mainpage The KDevelop Property Editing Library
+
+<b>Link with</b>: -lkdevelop
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/propeditor
+
+
+\section whatis What is Property Editor?
+
+%Property editor is a collection of facilities to store and edit the
+properties of an object. For example, look at %Qt Designer. Each widget
+has a list of properties that can be edited in a nice table form.
+Same ideology is used to edit properties in Kugar Report Designer
+(from KOffice distribution). In KDevelop project manager can also display
+the properties of currently selected build item in property editor.
+
+\section over Library Overview
+
+This PropertyEditor library is a redesign of Kugar property editing library
+with the goal to be more generic and extensible.
+
+Library provides a @ref PropertyLib::Property class which stores property name, value and some
+more important information like description or the list of possible values.
+Using @ref PropertyLib::Property class adds more overhead over Q_PROPERTY but provides more
+flexibility. You can subclass @ref PropertyLib::Property and create your custom properties.
+Custom properties can have either predefined type (see @ref PropertyLib::Property::PropertyType) or
+custom type. Custom type should be used if a custom property editor widget is
+necessary.
+
+Properties are organized into lists. @ref PropertyLib::PropertyList is designed
+to store such lists in most efficient manner. It also allows to group
+properties (for example think about "geometrical" properties like "x", "y", etc.).
+
+Property lists can be displayed in @ref PropertyLib::PropertyEditor widget which will
+display them in a table form. @ref PropertyLib::PropertyEditor takes a pointer to a @ref PropertyLib::PropertyList object so @ref PropertyLib::PropertyBuffer can be used too.
+
+@ref PropertyLib::PropertyBuffer is designed to provide a method to access an intersection
+of property lists. For example, let's consider object A with property list a_list
+abd object B with list b_list. Now let's imagine we want to display common properties
+from a_list and b_list in one @ref PropertyLib::PropertyEditor widget. Obviously, we need to
+"intersect" a_list with b_list and display the result of intersection.
+This is why @ref PropertyLib::PropertyBuffer is used for editing. If we change
+the value of a property in the editor, @ref PropertyLib::PropertyBuffer will update
+both properties from underlying a_list and b_list.
+
+@ref PropertyLib::PropertyEditor at the same time shows only one editor for selected
+property in the list. Each @ref PropertyLib::Property::PropertyType has corresponding @ref PropertyLib::PropertyWidget
+which displays property editor or draws a property in the list if it is not edited.
+More exactly, if @ref PropertyLib::PropertyEditor needs to display editor widget, it displays
+@ref PropertyLib::PropertyWidget, else it calls @ref PropertyLib::PropertyWidget::drawViewer function.
+Custom property widgets should be subclasses of @ref PropertyLib::PropertyWidget.
+
+To create property widgets at runtime, a factory is used. Factory class is
+called @ref PropertyLib::PropertyMachineFactory. Static function @ref PropertyLib::PropertyMachineFactory::getInstance
+can be used to obtain the reference to the factory instance. Factory creates and returns
+so-called @ref PropertyLib::Machine for each registered property type (either predefined or user defined).
+
+@ref PropertyLib::Machine contains @ref PropertyLib::PropertyWidget and a list of "detailed" machines.
+Usually only property widget is necessary for a property but there are
+complex properties like "Font" for example. We would like to see separate editors
+for font family, size, etc. and a button to choose all of these in the dialog.
+For that "Font" property, a PropertyWidget with a "choose font" button
+and also number of detailed widgets like "font family" combo, etc. can be created.
+
+\section Examples
+A simple example on how to create a property editor and use it with one property list:
+\code
+ using namespace PropertyLib;
+
+ PropertyEditor *m_editor = new PropertyEditor(this);
+
+ PropertyList *list = new PropertyList;
+ list->addProperty("My Group", new Property(Property::Integer, "First Property",
+ "This is my first property", -5));
+ list->addProperty("My Group", new Property(Property::String, "Second Property",
+ "This is my second property", "Hello"));
+ list->addProperty(new Property(Property::Color, "Third Property",
+ "This is my third property", QColor("green")));
+
+ m_editor->populateProperties(*list);
+\endcode
+\image html propeditor1.png "Simple property editor"
+
+More advanced example with property buffers and list intersection:
+\code
+ using namespace PropertyLib;
+
+ PropertyEditor *m_editor = new PropertyEditor(this);
+
+ PropertyList *list = new PropertyList;
+ list->addProperty("My Group", new Property(Property::Integer, "First Property",
+ "This is my first property", -5));
+ list->addProperty("My Group", new Property(Property::String, "Second Property",
+ "This is my second property", "Hello"));
+ list->addProperty(new Property(Property::Color, "Third Property",
+ "This is my third property", QColor("green")));
+
+ PropertyList *list2 = new PropertyList;
+ list2->addProperty("My Group", new Property(Property::Integer, "First Property",
+ "This is my first property", -7));
+ list2->addProperty("My Group", new Property(Property::String, "Second Property",
+ "This is my second property", "Hello"));
+ list2->addProperty(new Property(Property::String, "Third Property",
+ "This is my third property", "green"));
+
+ PropertyBuffer buf(list);
+ buf.intersect(list2);
+
+ m_editor->populateProperties(&buf);
+\endcode
+\image html propeditor2.png "Result of property list intersection"
+In this example only properties named "First Property" and "Second Property" will be shown in editor.
+"Third Property" has different types in list and list2 and will not be included in intersection.
+
+*/
diff --git a/lib/widgets/propeditor/Makefile.am b/lib/widgets/propeditor/Makefile.am
new file mode 100644
index 00000000..bd055733
--- /dev/null
+++ b/lib/widgets/propeditor/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/lib/compat $(all_includes)
+METASOURCES = AUTO
+
+lib_LTLIBRARIES = libkdevpropertyeditor.la
+libkdevpropertyeditor_la_LIBADD = $(LIB_KIO)
+libkdevpropertyeditor_la_LDFLAGS = -no-undefined $(all_libraries)
+libkdevpropertyeditor_la_SOURCES = childproperty.cpp pcombobox.cpp pdummywidget.cpp ppointedit.cpp propertymachinefactory.cpp pstringlistedit.cpp\
+multiproperty.cpp pcursoredit.cpp pfontbutton.cpp prectedit.cpp propertywidget.cpp psymbolcombo.cpp\
+pcheckbox.cpp pdateedit.cpp pfontcombo.cpp property.cpp psizeedit.cpp purledit.cpp\
+pcolorbutton.cpp pdatetimeedit.cpp plineedit.cpp propertyeditor.cpp psizepolicyedit.cpp pyesnobutton.cpp\
+pcolorcombo.cpp pdoublenuminput.cpp ppixmapedit.cpp propertylist.cpp pspinbox.cpp propertywidgetproxy.cpp plinestyleedit.cpp qeditlistbox.cpp
+
+kdevpropeditorincludedir = $(includedir)/kdevelop/propeditor
+kdevpropeditorinclude_HEADERS = childproperty.h pcombobox.h pdummywidget.h ppointedit.h propertymachinefactory.h pcursoredit.h pfontbutton.h prectedit.h propertywidget.h pdateedit.h pfontcombo.h property.h psizeedit.h pdatetimeedit.h plineedit.h propertyeditor.h psizepolicyedit.h pdoublenuminput.h ppixmapedit.h propertylist.h pspinbox.h propertywidgetproxy.h multiproperty.h pyesnobutton.h purledit.h psymbolcombo.h pstringlistedit.h pcolorcombo.h pcolorbutton.h pcheckbox.h plinestyleedit.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils
+DOXYGEN_PROJECTNAME = KDevelop Property Editing Library
+include ../../../Doxyfile.am
diff --git a/lib/widgets/propeditor/childproperty.cpp b/lib/widgets/propeditor/childproperty.cpp
new file mode 100644
index 00000000..72cfb053
--- /dev/null
+++ b/lib/widgets/propeditor/childproperty.cpp
@@ -0,0 +1,145 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "childproperty.h"
+
+#include <qsize.h>
+#include <qpoint.h>
+#include <qrect.h>
+#include <qsizepolicy.h>
+
+#include "multiproperty.h"
+
+namespace PropertyLib{
+
+ChildProperty::ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const QString &name,
+ const QString &description, const QVariant &value, bool save, bool readOnly)
+ :Property(type, name, description, value, save, readOnly), m_parent(parent), m_childType(childType)
+{
+}
+
+ChildProperty::ChildProperty(MultiProperty *parent, const QString & name, ChildPropertyType childType,
+ const QMap<QString, QVariant> &v_valueList, const QString &description,
+ const QVariant &value, bool save, bool readOnly)
+ :Property(name, v_valueList, description, value, save, readOnly), m_parent(parent), m_childType(childType)
+{
+}
+
+void ChildProperty::setValue(const QVariant &value, bool // rememberOldValue
+ )
+{
+ qWarning("ChildProperty::setValue");
+ if (!m_parent->valid())
+ return;
+ switch (m_parent->type())
+ {
+ case Size:
+ {
+ qWarning("ChildProperty::setValue for QSize");
+ QSize v = m_parent->value().toSize();
+ if (m_childType == Size_Height)
+ v.setHeight(value.toInt());
+ else if (m_childType == Size_Width)
+ v.setWidth(value.toInt());
+ m_parent->setValue(v);
+ break;
+ }
+ case Point:
+ {
+ qWarning("ChildProperty::setValue for QPoint");
+ QPoint v = m_parent->value().toPoint();
+ if (m_childType == Point_X)
+ v.setX(value.toInt());
+ else if (m_childType == Point_Y)
+ v.setY(value.toInt());
+ m_parent->setValue(v);
+ break;
+ }
+ case Rect:
+ {
+ qWarning("ChildProperty::setValue for QRect");
+ QRect v = m_parent->value().toRect();
+ if (m_childType == Rect_X)
+ v.setX(value.toInt());
+ else if (m_childType == Rect_Y)
+ v.setY(value.toInt());
+ else if (m_childType == Rect_Width)
+ v.setWidth(value.toInt());
+ else if (m_childType == Rect_Height)
+ v.setHeight(value.toInt());
+ m_parent->setValue(v);
+ break;
+ }
+ case SizePolicy:
+ {
+ qWarning("ChildProperty::setValue for QSizePolicy");
+ QSizePolicy v = m_parent->value().toSizePolicy();
+ if (m_childType == SizePolicy_HorData)
+ v.setHorData(QSizePolicy::SizeType(value.toInt()));
+ else if (m_childType == SizePolicy_VerData)
+ v.setVerData(QSizePolicy::SizeType(value.toInt()));
+ else if (m_childType == SizePolicy_HorStretch)
+ v.setHorStretch(value.toInt());
+ else if (m_childType == SizePolicy_VerStretch)
+ v.setVerStretch(value.toInt());
+ m_parent->setValue(v);
+ break;
+ }
+ }
+}
+
+QVariant ChildProperty::value( ) const
+{
+ if (!m_parent->valid())
+ return QVariant();
+ switch (m_parent->type())
+ {
+ case Size:
+ if (m_childType == Size_Height)
+ return m_parent->value().toSize().height();
+ else if (m_childType == Size_Width)
+ return m_parent->value().toSize().width();
+ case Point:
+ if (m_childType == Point_X)
+ return m_parent->value().toPoint().x();
+ else if (m_childType == Point_Y)
+ return m_parent->value().toPoint().y();
+ case Rect:
+ if (m_childType == Rect_X)
+ return m_parent->value().toRect().x();
+ else if (m_childType == Rect_Y)
+ return m_parent->value().toRect().y();
+ else if (m_childType == Rect_Width)
+ return m_parent->value().toRect().width();
+ else if (m_childType == Rect_Height)
+ return m_parent->value().toRect().height();
+ case SizePolicy:
+ if (m_childType == SizePolicy_HorData)
+ return m_parent->value().toSizePolicy().horData();
+ else if (m_childType == SizePolicy_VerData)
+ return m_parent->value().toSizePolicy().verData();
+ else if (m_childType == SizePolicy_HorStretch)
+ return m_parent->value().toSizePolicy().horStretch();
+ else if (m_childType == SizePolicy_VerStretch)
+ return m_parent->value().toSizePolicy().verStretch();
+ }
+ return QVariant();
+}
+
+}
diff --git a/lib/widgets/propeditor/childproperty.h b/lib/widgets/propeditor/childproperty.h
new file mode 100644
index 00000000..13399a08
--- /dev/null
+++ b/lib/widgets/propeditor/childproperty.h
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef CHILDPROPERTY_H
+#define CHILDPROPERTY_H
+
+#include "property.h"
+
+namespace PropertyLib{
+
+class MultiProperty;
+
+/**
+@short Child property
+
+Child property is a detailed property for complex parent properties.
+For example, to edit a property of Point type one can request two
+child properties for "x" and "y" components of a point.
+
+Child properties instances usually belong to MultiProperty class
+which is used to fetch and display them in the property editor.
+Child properties are created by a PropertyMachineFactory.
+Factory in such case does not only creates a machine for a property,
+but also fills corrresponding multiproperty with a list of child
+properties.
+*/
+class ChildProperty: public Property{
+public:
+ enum ChildPropertyType {
+ Size_Height,
+ Size_Width,
+ Point_X,
+ Point_Y,
+ Rect_X,
+ Rect_Y,
+ Rect_Width,
+ Rect_Height,
+ SizePolicy_HorData,
+ SizePolicy_VerData,
+ SizePolicy_HorStretch,
+ SizePolicy_VerStretch
+ };
+
+ /**Constructs empty property.*/
+ ChildProperty() {}
+ /**Constructs property.*/
+ ChildProperty(MultiProperty *parent, int type, ChildPropertyType childType, const QString &name,
+ const QString &description, const QVariant &value = QVariant(),
+ bool save = true, bool readOnly = false);
+ /**Constructs property with @ref ValueFromList type.*/
+ ChildProperty(MultiProperty *parent, const QString &name, ChildPropertyType childType,
+ const QMap<QString, QVariant> &v_valueList, const QString &description,
+ const QVariant &value = QVariant(), bool save = true, bool readOnly = false);
+
+ /**@return the value of the property.*/
+ virtual QVariant value() const;
+ /**Sets the value of the property.*/
+ virtual void setValue(const QVariant &value, bool rememberOldValue = true);
+
+private:
+ MultiProperty *m_parent;
+ ChildPropertyType m_childType;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/compat_tools.h b/lib/widgets/propeditor/compat_tools.h
new file mode 100644
index 00000000..1a1a8735
--- /dev/null
+++ b/lib/widgets/propeditor/compat_tools.h
@@ -0,0 +1,6 @@
+#ifndef COMPAT_TOOLS_H
+#define COMPAT_TOOLS_H
+
+#define i18n QObject::tr
+
+#endif
diff --git a/lib/widgets/propeditor/multiproperty.cpp b/lib/widgets/propeditor/multiproperty.cpp
new file mode 100644
index 00000000..7e32345a
--- /dev/null
+++ b/lib/widgets/propeditor/multiproperty.cpp
@@ -0,0 +1,273 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <cloudtemple@mskat.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "multiproperty.h"
+
+#include "propertylist.h"
+
+namespace PropertyLib{
+
+MultiProperty::MultiProperty(Property *prop)
+ :m_propertyList(0)
+{
+ list.append(prop);
+}
+
+MultiProperty::MultiProperty(PropertyList *propertyList)
+ :m_propertyList(propertyList)
+{
+}
+
+MultiProperty::MultiProperty(PropertyList *propertyList, Property *prop)
+ :m_propertyList(propertyList)
+{
+ list.append(prop);
+}
+
+MultiProperty::~MultiProperty()
+{
+}
+
+QString MultiProperty::name() const
+{
+ if (list.count() >= 1)
+ return list.getFirst()->name();
+ return QString::null;
+}
+
+int MultiProperty::type() const
+{
+ if (list.count() >= 1)
+ return list.getFirst()->type();
+ return QVariant::Invalid;
+}
+
+QVariant MultiProperty::value() const
+{
+ QVariant value;
+ if (list.count() >= 1)
+ value = list.getFirst()->value();
+
+ QPtrListIterator<Property> it(list);
+ Property *property;
+ while ((property = it.current()) != 0)
+ {
+ if (property->value() != value)
+ return QVariant::Invalid;
+ ++it;
+ }
+
+ return value;
+}
+
+QString MultiProperty::description() const
+{
+ QString description;
+ if (list.count() >= 1)
+ description = list.getFirst()->description();
+
+ QPtrListIterator<Property> it(list);
+ Property *property;
+ while ((property = it.current()) != 0)
+ {
+ if (property->description() != description)
+ return QString::null;
+ ++it;
+ }
+
+ return description;
+}
+
+bool MultiProperty::readOnly() const
+{
+ bool v = true;
+ if (list.count() >= 1)
+ v = list.getFirst()->readOnly();
+
+ QPtrListIterator<Property> it(list);
+ Property *property;
+ while ((property = it.current()) != 0)
+ {
+ if (property->readOnly() != v)
+ return false;
+ ++it;
+ }
+
+ return v;
+}
+
+bool MultiProperty::visible() const
+{
+ bool v = true;
+ if (list.count() >= 1)
+ v = list.getFirst()->readOnly();
+
+ QPtrListIterator<Property> it(list);
+ Property *property;
+ while ((property = it.current()) != 0)
+ {
+ if (property->visible() != v)
+ return false;
+ ++it;
+ }
+
+ return v;
+}
+
+QMap<QString, QVariant> MultiProperty::valueList() const
+{
+ if (list.count() >= 1)
+ return list.getFirst()->valueList;
+ return QMap<QString, QVariant>();
+}
+
+void MultiProperty::setDescription(const QString &description)
+{
+ Property *property;
+ for (property = list.first(); property; property = list.next())
+ property->setDescription(description);
+}
+
+/*void MultiProperty::setName(const QString &name)
+{
+}
+
+void MultiProperty::setType(int type)
+{
+}
+*/
+void MultiProperty::setValue(const QVariant &value)
+{
+ Property *property;
+ for (property = list.first(); property; property = list.next())
+ {
+ property->setValue(value);
+ if (m_propertyList)
+ {
+// qWarning("emit change");
+ emit m_propertyList->propertyValueChanged(property);
+ }
+ }
+}
+
+void MultiProperty::setValue(const QVariant &value, bool emitChange)
+{
+ Property *property;
+ for (property = list.first(); property; property = list.next())
+ {
+ property->setValue(value);
+ if (emitChange && m_propertyList)
+ emit m_propertyList->propertyValueChanged(property);
+ }
+}
+
+void MultiProperty::setValueList(const QMap<QString, QVariant> &valueList)
+{
+ Property *property;
+ for (property = list.first(); property; property = list.next())
+ property->setValueList(valueList);
+}
+
+void MultiProperty::addProperty(Property *prop)
+{
+ list.append(prop);
+}
+
+void MultiProperty::removeProperty(Property *prop)
+{
+/* qWarning("op >> removing %s", prop->name().ascii());
+ qWarning("op >> list is %d", list.count());*/
+ /*bool b = */list.remove(prop);
+/* qWarning("op >> list is %d", list.count());
+ qWarning("op >> removal is %s", b?"true":"false"); */
+}
+
+bool MultiProperty::operator ==(const MultiProperty &prop) const
+{
+ if ( (type() == prop.type()) && (name() == prop.name()) )
+ return true;
+ return false;
+}
+
+bool MultiProperty::operator ==(const Property &prop) const
+{
+/* qWarning("MultiProperty::operator == for %s = %s", name().ascii(), prop.name().ascii());
+ qWarning("MultiProperty::operator == for %d = %d", type(), prop.type());*/
+ if ( (type() == prop.type()) && (name() == prop.name()) )
+ return true;
+ return false;
+}
+
+void MultiProperty::addProperty( MultiProperty *prop)
+{
+ Property *property;
+ for (property = prop->list.first(); property; property = prop->list.next())
+ addProperty(property);
+}
+
+void MultiProperty::removeProperty( MultiProperty *prop)
+{
+ Property *property;
+ for (property = prop->list.first(); property; property = prop->list.next())
+ removeProperty(property);
+}
+
+QVariant MultiProperty::findValueDescription() const
+{
+ QVariant val = value();
+ if (type() != Property::ValueFromList)
+ return val;
+ QMap<QString, QVariant> vl = valueList();
+ for (QMap<QString, QVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it)
+ {
+ if (it.data() == val)
+ return it.key();
+ }
+ return "";
+}
+
+QVariant MultiProperty::findValueDescription(QVariant val) const
+{
+ if (type() != Property::ValueFromList)
+ return val;
+ QMap<QString, QVariant> vl = valueList();
+ for (QMap<QString, QVariant>::const_iterator it = vl.begin(); it != vl.end(); ++ it)
+ {
+ if (it.data() == val)
+ return it.key();
+ }
+ return "";
+}
+
+bool MultiProperty::valid() const
+{
+ return list.count() != 0;
+}
+
+void MultiProperty::undo()
+{
+ Property *property;
+ for (property = list.first(); property; property = list.next())
+ {
+ property->setValue(property->oldValue(), false);
+ if (m_propertyList)
+ emit m_propertyList->propertyValueChanged(property);
+ }
+}
+
+}
diff --git a/lib/widgets/propeditor/multiproperty.h b/lib/widgets/propeditor/multiproperty.h
new file mode 100644
index 00000000..e6402027
--- /dev/null
+++ b/lib/widgets/propeditor/multiproperty.h
@@ -0,0 +1,126 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <cloudtemple@mskat.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef MULTIPROPERTY_H
+#define MULTIPROPERTY_H
+
+#include <qptrlist.h>
+#include <qmap.h>
+#include <qvariant.h>
+
+#include "property.h"
+#include "childproperty.h"
+
+namespace PropertyLib{
+
+class PropertyList;
+
+/** @file multiproperty.h
+@short Contains @ref PropertyLib::MultiProperty class.
+*/
+
+/**
+@short Holds a list of properties with the same name and type.
+
+It is used by @ref PropertyLib::PropertyList to store properties. Generally, @ref PropertyLib::PropertyList
+stores a list of multiproperties instead of properties. This allows working
+with many properties of the same name and type at the same type.
+
+MultiProperty is also responsible for storing detailed %property editors (instances
+of @ref ChildProperty class. It's too much overhead to store child properties
+with their parent properties. MultiProperty provides a way to store child properties
+only once for all properties with the same name and same type.
+*/
+class MultiProperty
+{
+public:
+ /**Constructs multiproperty with one property which is not connected to a property list.*/
+ MultiProperty(Property *prop);
+ /**Constructs empty multiproperty.*/
+ MultiProperty(PropertyList *propertyList);
+ /**Constructs multiproperty with one Property in the list.*/
+ MultiProperty(PropertyList *propertyList, Property *prop);
+ ~MultiProperty();
+
+ /**Compares two multiproperties.*/
+ bool operator ==(const MultiProperty &prop) const;
+ /**Compares %multiproperty with %property.*/
+ bool operator ==(const Property &prop) const;
+
+ /**Adds %property to the list.*/
+ void addProperty(Property *prop);
+ /**Removes %property from the list.*/
+ void removeProperty(Property *prop);
+ /**Adds all properties from the %multiproperty prop.*/
+ void addProperty(MultiProperty *prop);
+ /**Removes all properties that exists in the %multiproperty prop.*/
+ void removeProperty(MultiProperty *prop);
+
+ /**Returns the name of a %property.*/
+ QString name() const;
+ /**Returns the type of a %property.*/
+ int type() const;
+ /**Returns the value of a %property.*/
+ QVariant value() const;
+ /**Returns the description of a %property.*/
+ QString description() const;
+ /**Returns the readonly attribute of a %property.*/
+ bool readOnly() const;
+ /**Returns the visibility attribute of a %property.*/
+ bool visible() const;
+ /**The string-to-value correspondence list of the %property.*/
+ QMap<QString, QVariant> valueList() const;
+
+ /**Sets the value of a %property.*/
+ void setValue(const QVariant& value);
+ /**Sets the value of a %property.
+ @param value new value of thus %multiproperty
+ @param emitChange if set to true then %property list which owns this %multiproperty
+ emits propertyValueChanged signal.*/
+ void setValue(const QVariant& value, bool emitChange);
+ /**Sets the description of a %property.*/
+ void setDescription(const QString &description);
+ /**Sets the list of possible values of a %property.*/
+ void setValueList(const QMap< QString, QVariant >& valueList);
+
+ /**Finds string description for a value.*/
+ QVariant findValueDescription() const;
+ /**Finds string description for a value.*/
+ QVariant findValueDescription(QVariant val) const;
+
+ /**Returns true if the %multiproperty has no properties in the list (i.e. it's invalid).*/
+ bool valid() const;
+
+ /**Reverts the property value to previous setting.*/
+ void undo();
+
+ /**The list of child properties.*/
+ QValueList<ChildProperty> details;
+
+private:
+ QPtrList<Property> list;
+
+ PropertyList *m_propertyList;
+
+friend class PropertyList;
+friend class PropertyBuffer;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pcheckbox.cpp b/lib/widgets/propeditor/pcheckbox.cpp
new file mode 100644
index 00000000..7b0b187e
--- /dev/null
+++ b/lib/widgets/propeditor/pcheckbox.cpp
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pcheckbox.h"
+
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qpainter.h>
+
+#ifndef PURE_QT
+#include <klocale.h>
+#else
+#include "compat_tools.h"
+#endif
+
+namespace PropertyLib{
+
+PCheckBox::PCheckBox(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QCheckBox(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+}
+
+QVariant PCheckBox::value() const
+{
+ return QVariant(m_edit->isChecked());
+}
+
+void PCheckBox::setValue(const QVariant &value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+ m_edit->setChecked(value.toBool());
+ connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PCheckBox::updateProperty(bool val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+void PCheckBox::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+{
+ p->setBrush(cg.background());
+ p->setPen(Qt::NoPen);
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toBool() ? i18n("true") : i18n("false"));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pcheckbox.moc"
+#endif
diff --git a/lib/widgets/propeditor/pcheckbox.h b/lib/widgets/propeditor/pcheckbox.h
new file mode 100644
index 00000000..374617f7
--- /dev/null
+++ b/lib/widgets/propeditor/pcheckbox.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PCHECKBOX_H
+#define PCHECKBOX_H
+
+#include "propertywidget.h"
+
+class QCheckBox;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with checkbox.
+*/
+class PCheckBox: public PropertyWidget{
+ Q_OBJECT
+public:
+ PCheckBox(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+private slots:
+ void updateProperty(bool val);
+
+private:
+ QCheckBox *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pcolorbutton.cpp b/lib/widgets/propeditor/pcolorbutton.cpp
new file mode 100644
index 00000000..7404e1de
--- /dev/null
+++ b/lib/widgets/propeditor/pcolorbutton.cpp
@@ -0,0 +1,120 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pcolorbutton.h"
+
+#include <qlayout.h>
+#include <qpainter.h>
+
+#ifndef PURE_QT
+#include <kcolorbutton.h>
+#else
+#include <qpushbutton.h>
+#include <qpixmap.h>
+#include <qiconset.h>
+#endif
+#include <qcolordialog.h>
+
+namespace PropertyLib {
+
+PColorButton::PColorButton(MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+#ifndef PURE_QT
+ m_edit = new KColorButton(this);
+ connect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&)));
+#else
+ m_edit = new QPushButton(this);
+ connect(m_edit, SIGNAL(clicked()), this, SLOT(changeColor()));
+#endif
+
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+}
+
+QVariant PColorButton::value() const
+{
+#ifndef PURE_QT
+ return QVariant(m_edit->color());
+#else
+ return QVariant(m_color);
+#endif
+}
+
+void PColorButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+/* p->setBrush(value.toColor());
+ p->setPen(Qt::NoPen);
+ p->drawRect(r);*/
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+
+ p->setBrush(value.toColor());
+ p->setPen(Qt::SolidLine);
+ QRect r2(r);
+ r2.setTopLeft(r.topLeft() + QPoint(5,5));
+ r2.setBottomRight(r.bottomRight() - QPoint(5,5));
+ p->drawRect(r2);
+}
+
+void PColorButton::setValue(const QVariant& value, bool emitChange)
+{
+#ifndef PURE_QT
+ disconnect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&)));
+ m_edit->setColor(value.toColor());
+ connect(m_edit, SIGNAL(changed(const QColor&)), this, SLOT(updateProperty(const QColor&)));
+#else
+ m_color = value.toColor();
+ m_edit->setText(m_color.name());
+ QPixmap px;
+ px.resize(14,14);
+ px.fill(m_color);
+ m_edit->setIconSet(px);
+#endif
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+
+}
+
+void PColorButton::updateProperty(const QColor &// color
+ )
+{
+ emit propertyChanged(m_property, value());
+}
+
+void PColorButton::changeColor()
+{
+#ifdef PURE_QT
+ m_color = QColorDialog::getColor(m_color,this);
+ updateProperty(m_color);
+ m_edit->setText(m_color.name());
+ QPixmap px;
+ px.resize(14,14);
+ px.fill(m_color);
+ m_edit->setIconSet(px);
+
+#endif
+}
+
+}
+#ifndef PURE_QT
+#include "pcolorbutton.moc"
+#endif
diff --git a/lib/widgets/propeditor/pcolorbutton.h b/lib/widgets/propeditor/pcolorbutton.h
new file mode 100644
index 00000000..67e02ef9
--- /dev/null
+++ b/lib/widgets/propeditor/pcolorbutton.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PCOLORBUTTON_H
+#define PCOLORBUTTON_H
+
+#include "propertywidget.h"
+
+#ifndef PURE_QT
+class KColorButton;
+#else
+class QPushButton;
+#include <qcolor.h>
+#endif
+namespace PropertyLib{
+
+/**
+@short %Property editor with color chooser button.
+*/
+class PColorButton: public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PColorButton(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+protected slots:
+ void updateProperty(const QColor& color);
+
+ void changeColor();
+
+private:
+#ifndef PURE_QT
+ KColorButton *m_edit;
+#else
+ QPushButton *m_edit;
+ QColor m_color;
+#endif
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pcolorcombo.cpp b/lib/widgets/propeditor/pcolorcombo.cpp
new file mode 100644
index 00000000..4d09a10f
--- /dev/null
+++ b/lib/widgets/propeditor/pcolorcombo.cpp
@@ -0,0 +1,78 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pcolorcombo.h"
+
+#include <qlayout.h>
+#include <qpainter.h>
+
+#include <kcolorcombo.h>
+
+namespace PropertyLib{
+
+PColorCombo::PColorCombo(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KColorCombo(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+}
+
+QVariant PColorCombo::value() const
+{
+ return QVariant(m_edit->color());
+}
+
+void PColorCombo::setValue(const QVariant &value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ m_edit->setColor(value.toColor());
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PColorCombo::updateProperty(int /*val*/)
+{
+ emit propertyChanged(m_property, value());
+}
+
+void PColorCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+
+ p->setBrush(value.toColor());
+ p->setPen(Qt::SolidLine);
+ QRect r2(r);
+ r2.setTopLeft(r.topLeft() + QPoint(5,5));
+ r2.setBottomRight(r.bottomRight() - QPoint(5,5));
+ p->drawRect(r2);
+}
+
+}
+
+#ifndef PURE_QT
+#include "pcolorcombo.moc"
+#endif
+
diff --git a/lib/widgets/propeditor/pcolorcombo.h b/lib/widgets/propeditor/pcolorcombo.h
new file mode 100644
index 00000000..512fa9ad
--- /dev/null
+++ b/lib/widgets/propeditor/pcolorcombo.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PCOLORCOMBO_H
+#define PCOLORCOMBO_H
+
+#include "propertywidget.h"
+
+class KColorCombo;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with color combobox.
+*/
+class PColorCombo: public PropertyWidget{
+ Q_OBJECT
+public:
+ PColorCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+private slots:
+ void updateProperty(int val);
+
+private:
+ KColorCombo *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pcombobox.cpp b/lib/widgets/propeditor/pcombobox.cpp
new file mode 100644
index 00000000..9c1619cf
--- /dev/null
+++ b/lib/widgets/propeditor/pcombobox.cpp
@@ -0,0 +1,110 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pcombobox.h"
+
+#include <qcombobox.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PComboBox::PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name), m_valueList(list)
+{
+ init(false);
+}
+
+PComboBox::PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, bool rw, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name), m_valueList(list)
+{
+ init(rw);
+}
+
+void PComboBox::init(bool rw)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QComboBox(rw, this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ fillBox();
+
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+}
+
+void PComboBox::fillBox()
+{
+ for (QMap<QString, QVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); it++)
+ {
+ m_edit->insertItem(it.key());
+ }
+}
+
+QVariant PComboBox::value() const
+{
+ QMap<QString, QVariant>::const_iterator it = m_valueList.find(m_edit->currentText());
+ if (it == m_valueList.end())
+ return QVariant("");
+ return QVariant(it.data());
+}
+
+void PComboBox::setValue(const QVariant &value, bool emitChange)
+{
+#if QT_VERSION >= 0x030100
+ if (!value.isNull())
+#else
+ if (value.canCast(QVariant::String))
+#endif
+ {
+ disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ m_edit->setCurrentText(findDescription(value));
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+ }
+}
+
+void PComboBox::updateProperty(int /*val*/)
+{
+ emit propertyChanged(m_property, value());
+}
+
+QString PComboBox::findDescription(const QVariant &value)
+{
+ for (QMap<QString, QVariant>::const_iterator it = m_valueList.begin(); it != m_valueList.end(); ++ it)
+ {
+ if (it.data() == value)
+ return it.key();
+ }
+ return "";
+}
+
+void PComboBox::setValueList(const QMap<QString, QVariant> &valueList)
+{
+ m_valueList = valueList;
+ m_edit->clear();
+ fillBox();
+}
+
+}
+
+#ifndef PURE_QT
+#include "pcombobox.moc"
+#endif
+
diff --git a/lib/widgets/propeditor/pcombobox.h b/lib/widgets/propeditor/pcombobox.h
new file mode 100644
index 00000000..c2f8dc2f
--- /dev/null
+++ b/lib/widgets/propeditor/pcombobox.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PCOMBOBOX_H
+#define PCOMBOBOX_H
+
+#include <qmap.h>
+
+#include <qcombobox.h>
+
+#include "propertywidget.h"
+
+class QComboBox;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with combobox.
+*/
+class PComboBox: public PropertyWidget{
+ Q_OBJECT
+public:
+ /**This constructor is used for read-only selection combo. It provides a value from valueList*/
+ PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, QWidget *parent = 0, const char *name = 0);
+ /**This constructor is used for read-write selection combo. It provides a value from valueList*/
+ PComboBox(MultiProperty *property, const QMap<QString, QVariant> &list, bool rw, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+ /**Sets the list of possible values shown in the editor widget. This method
+ does not emit propertyChanged signal. Reimplemented because combobox is used
+ to display possible values from valueList.*/
+ virtual void setValueList(const QMap<QString, QVariant> &valueList);
+
+protected:
+ QString findDescription(const QVariant &value);
+
+protected slots:
+ void updateProperty(int val);
+
+private:
+ virtual void fillBox();
+ void init(bool rw = false);
+
+ /** map<description, value>*/
+ QMap<QString, QVariant> m_valueList;
+
+ QComboBox *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pcursoredit.cpp b/lib/widgets/propeditor/pcursoredit.cpp
new file mode 100644
index 00000000..5667421d
--- /dev/null
+++ b/lib/widgets/propeditor/pcursoredit.cpp
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pcursoredit.h"
+
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PCursorEdit::PCursorEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues,
+ QWidget* parent, const char* name)
+ :PComboBox(property, spValues, parent, name)
+{
+}
+
+void PCursorEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ PropertyWidget::drawViewer(p, cg, r, findDescription(value));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pcursoredit.moc"
+#endif
diff --git a/lib/widgets/propeditor/pcursoredit.h b/lib/widgets/propeditor/pcursoredit.h
new file mode 100644
index 00000000..0a9ccb9a
--- /dev/null
+++ b/lib/widgets/propeditor/pcursoredit.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PCURSOREDIT_H
+#define PCURSOREDIT_H
+
+#include "pcombobox.h"
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QCursor values.
+*/
+class PCursorEdit: public PComboBox
+{
+ Q_OBJECT
+public:
+ PCursorEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues,
+ QWidget* parent = 0, const char* name = 0);
+
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pdateedit.cpp b/lib/widgets/propeditor/pdateedit.cpp
new file mode 100644
index 00000000..48a020e8
--- /dev/null
+++ b/lib/widgets/propeditor/pdateedit.cpp
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pdateedit.h"
+
+#include <qdatetimeedit.h>
+#include <qpainter.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PDateEdit::PDateEdit(MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QDateEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&)));
+}
+
+QVariant PDateEdit::value() const
+{
+ return QVariant(m_edit->date());
+}
+
+void PDateEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toDate().toString(Qt::LocalDate));
+}
+
+void PDateEdit::setValue(const QVariant& value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&)));
+ m_edit->setDate(value.toDate());
+ connect(m_edit, SIGNAL(valueChanged(const QDate&)), this, SLOT(updateProperty(const QDate&)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PDateEdit::updateProperty(const QDate &val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pdateedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/pdateedit.h b/lib/widgets/propeditor/pdateedit.h
new file mode 100644
index 00000000..166e1e3f
--- /dev/null
+++ b/lib/widgets/propeditor/pdateedit.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PDATEEDIT_H
+#define PDATEEDIT_H
+
+#include "propertywidget.h"
+
+class QDateEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QDate values.
+*/
+class PDateEdit : public PropertyWidget
+{
+Q_OBJECT
+public:
+ PDateEdit(MultiProperty* property, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private slots:
+ void updateProperty(const QDate &val);
+
+private:
+ QDateEdit *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pdatetimeedit.cpp b/lib/widgets/propeditor/pdatetimeedit.cpp
new file mode 100644
index 00000000..ec9025ec
--- /dev/null
+++ b/lib/widgets/propeditor/pdatetimeedit.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pdatetimeedit.h"
+
+#include <qdatetimeedit.h>
+#include <qpainter.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PDateTimeEdit::PDateTimeEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QDateTimeEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&)));
+}
+
+QVariant PDateTimeEdit::value() const
+{
+ return QVariant(m_edit->dateTime());
+}
+
+void PDateTimeEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toDateTime().toString(Qt::LocalDate));
+}
+
+void PDateTimeEdit::setValue(const QVariant& value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&)));
+ m_edit->setDateTime(value.toDateTime());
+ connect(m_edit, SIGNAL(valueChanged(const QDateTime&)), this, SLOT(updateProperty(const QDateTime&)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PDateTimeEdit::updateProperty(const QDateTime &val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pdatetimeedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/pdatetimeedit.h b/lib/widgets/propeditor/pdatetimeedit.h
new file mode 100644
index 00000000..6421ef03
--- /dev/null
+++ b/lib/widgets/propeditor/pdatetimeedit.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PDATETIMEEDIT_H
+#define PDATETIMEEDIT_H
+
+#include "propertywidget.h"
+
+class QDateTimeEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QDateTime values.
+*/
+class PDateTimeEdit : public PropertyWidget
+{
+Q_OBJECT
+public:
+ PDateTimeEdit(MultiProperty* property, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private slots:
+ void updateProperty(const QDateTime &val);
+
+private:
+ QDateTimeEdit *m_edit;
+
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pdoublenuminput.cpp b/lib/widgets/propeditor/pdoublenuminput.cpp
new file mode 100644
index 00000000..5be997e4
--- /dev/null
+++ b/lib/widgets/propeditor/pdoublenuminput.cpp
@@ -0,0 +1,94 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pdoublenuminput.h"
+
+#ifndef PURE_QT
+#include <knuminput.h>
+#else
+#include "qfloatinput.h"
+#endif
+
+#include <limits.h>
+#include <math.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PDoubleNumInput::PDoubleNumInput(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+#ifndef PURE_QT
+ m_edit = new KDoubleNumInput(-999999.0, 999999.0, 0.0, 0.01, 2, this);
+ m_edit->setLabel(QString::null);
+ connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
+#else
+ m_edit = new QFloatInput(-999999, 999999, 0.01, 2, this );
+ connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+#endif
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+/* m_edit->setMinValue(-999999999);
+ m_edit->setMaxValue(+999999999);
+ m_edit->setPrecision(2);*/
+ l->addWidget(m_edit);
+
+}
+
+QVariant PDoubleNumInput::value() const
+{
+ return QVariant(m_edit->value());
+}
+
+void PDoubleNumInput::setValue(const QVariant &value, bool emitChange)
+{
+#ifndef PURE_QT
+ disconnect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
+ m_edit->setValue(value.toDouble());
+ connect(m_edit, SIGNAL(valueChanged(double)), this, SLOT(updateProperty(double)));
+#else
+ disconnect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+ m_edit->setValue(int(value.toDouble()*pow(m_edit->digits(),10)));
+ connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+#endif
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PDoubleNumInput::updateProperty(double val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+void PDoubleNumInput::updateProperty(int val)
+{
+#ifdef PURE_QT
+ QString format = QString("%.%1f").arg( m_edit->digits() );
+ QString strVal = QString().sprintf(format.latin1(),
+ (val/(float)pow(m_edit->digits(),10)) );
+ emit propertyChanged(m_property, QVariant(strVal));
+#else
+ Q_UNUSED(val);
+#endif
+}
+
+}
+
+#ifndef PURE_QT
+#include "pdoublenuminput.moc"
+#endif
diff --git a/lib/widgets/propeditor/pdoublenuminput.h b/lib/widgets/propeditor/pdoublenuminput.h
new file mode 100644
index 00000000..f38622ed
--- /dev/null
+++ b/lib/widgets/propeditor/pdoublenuminput.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PDOUBLENUMINPUT_H
+#define PDOUBLENUMINPUT_H
+
+#include "propertywidget.h"
+
+#ifndef PURE_QT
+class KDoubleNumInput;
+#else
+class QFloatInput;
+#endif
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with double num input box.
+*/
+class PDoubleNumInput: public PropertyWidget
+{
+Q_OBJECT
+public:
+ PDoubleNumInput(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+
+private slots:
+ //because of a bug in moc which doesn't detect conditional slots
+ //we need them both
+ void updateProperty(double val);
+ void updateProperty(int val);
+
+private:
+#ifndef PURE_QT
+ KDoubleNumInput *m_edit;
+#else
+ QFloatInput *m_edit;
+#endif
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pdummywidget.cpp b/lib/widgets/propeditor/pdummywidget.cpp
new file mode 100644
index 00000000..ddf09d12
--- /dev/null
+++ b/lib/widgets/propeditor/pdummywidget.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pdummywidget.h"
+
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PDummyWidget::PDummyWidget(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+}
+
+QVariant PDummyWidget::value() const
+{
+ return m_value;
+}
+
+void PDummyWidget::setValue(const QVariant &value, bool emitChange)
+{
+ m_value = value;
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PDummyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &/*value*/)
+{
+ p->setBrush(cg.background());
+ p->setPen(Qt::NoPen);
+ p->drawRect(r);
+}
+
+}
+
+#ifndef PURE_QT
+#include "pdummywidget.moc"
+#endif
diff --git a/lib/widgets/propeditor/pdummywidget.h b/lib/widgets/propeditor/pdummywidget.h
new file mode 100644
index 00000000..24a30837
--- /dev/null
+++ b/lib/widgets/propeditor/pdummywidget.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PDUMMYWIDGET_H
+#define PDUMMYWIDGET_H
+
+#include "propertywidget.h"
+#include "multiproperty.h"
+
+class QWidget;
+class QVariant;
+class QPainter;
+class QColorGroup;
+class QRect;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with empty widget.
+
+This is usefull for properties which can't be edited in a generic way
+like QValueList's or QMap's stored in a variant.
+*/
+class PDummyWidget: public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PDummyWidget(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant& value, bool emitChange);
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+private:
+ QVariant m_value;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pfontbutton.cpp b/lib/widgets/propeditor/pfontbutton.cpp
new file mode 100644
index 00000000..3b999dd3
--- /dev/null
+++ b/lib/widgets/propeditor/pfontbutton.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pfontbutton.h"
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+
+#include <kfontrequester.h>
+
+#ifndef PURE_QT
+#include <klocale.h>
+#else
+#include "compat_tools.h"
+#endif
+
+namespace PropertyLib{
+
+PFontButton::PFontButton(MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KFontRequester(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+#ifndef PURE_QT
+ m_edit->button()->setText(i18n("..."));
+#endif
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, SLOT(updateProperty(const QFont& )));
+}
+
+QVariant PFontButton::value() const
+{
+ return QVariant(m_edit->font());
+}
+
+void PFontButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ QFontInfo fi(value.toFont());
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine,
+ fi.family() + (fi.bold() ? i18n(" Bold") : QString("")) +
+ (fi.italic() ? i18n(" Italic") : QString("")) +
+ " " + QString("%1").arg(fi.pointSize()) );
+}
+
+void PFontButton::setValue(const QVariant& value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(fontSelected(const QFont&)), this, SLOT(updateProperty(const QFont&)));
+ m_edit->setFont(value.toFont());
+ connect(m_edit, SIGNAL(fontSelected(const QFont& )), this, SLOT(updateProperty(const QFont& )));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PFontButton::updateProperty(const QFont &// font
+ )
+{
+ emit propertyChanged(m_property, value());
+}
+
+}
+
+#ifndef PURE_QT
+#include "pfontbutton.moc"
+#endif
diff --git a/lib/widgets/propeditor/pfontbutton.h b/lib/widgets/propeditor/pfontbutton.h
new file mode 100644
index 00000000..20dcd566
--- /dev/null
+++ b/lib/widgets/propeditor/pfontbutton.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PFONTBUTTON_H
+#define PFONTBUTTON_H
+
+#include "propertywidget.h"
+
+class KFontRequester;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with font chooser button.
+*/
+class PFontButton : public PropertyWidget
+{
+Q_OBJECT
+public:
+ PFontButton(MultiProperty* property, QWidget* parent = 0, const char* name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+protected slots:
+ void updateProperty(const QFont& font);
+
+private:
+ KFontRequester *m_edit;
+
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pfontcombo.cpp b/lib/widgets/propeditor/pfontcombo.cpp
new file mode 100644
index 00000000..7c648a30
--- /dev/null
+++ b/lib/widgets/propeditor/pfontcombo.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pfontcombo.h"
+
+#ifndef PURE_QT
+#include <kfontcombo.h>
+#else
+#include <qcombobox.h>
+#endif
+
+#include <qlayout.h>
+
+#ifdef PURE_QT
+#include <qfontdatabase.h>
+#endif
+
+namespace PropertyLib{
+
+PFontCombo::PFontCombo(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KFontCombo(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ /*adymo: KFontCombo seems to have a bug: when it is not editable, the signals
+ activated(int) and textChanged(const QString &) are not emitted*/
+#ifdef PURE_QT
+ QFontDatabase fonts;
+ m_edit->insertStringList(fonts.families());
+ connect(m_edit, SIGNAL(activated(const QString &)), this, SLOT(updateProperty(const QString&)));
+#else
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+#endif
+}
+
+QVariant PFontCombo::value() const
+{
+#ifndef PURE_QT
+ return QVariant(m_edit->currentFont());
+#else
+ return QVariant(m_edit->currentText());
+#endif
+}
+
+void PFontCombo::setValue(const QVariant &value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+#ifndef PURE_QT
+ m_edit->setCurrentFont(value.toString());
+#else
+ m_edit->setCurrentText(value.toString());
+#endif
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PFontCombo::updateProperty(const QString &val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pfontcombo.moc"
+#endif
diff --git a/lib/widgets/propeditor/pfontcombo.h b/lib/widgets/propeditor/pfontcombo.h
new file mode 100644
index 00000000..be2671db
--- /dev/null
+++ b/lib/widgets/propeditor/pfontcombo.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PFONTCOMBO_H
+#define PFONTCOMBO_H
+
+#include "propertywidget.h"
+
+#ifdef PURE_QT
+#define KFontCombo QComboBox
+#endif
+
+class KFontCombo;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with font combo box.
+*/
+class PFontCombo: public PropertyWidget{
+ Q_OBJECT
+public:
+ PFontCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+
+private slots:
+ void updateProperty(const QString &val);
+
+private:
+ KFontCombo *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/plineedit.cpp b/lib/widgets/propeditor/plineedit.cpp
new file mode 100644
index 00000000..ac5d7c2a
--- /dev/null
+++ b/lib/widgets/propeditor/plineedit.cpp
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "plineedit.h"
+
+#include <klineedit.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PLineEdit::PLineEdit(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+}
+
+QVariant PLineEdit::value() const
+{
+ return QVariant(m_edit->text());
+}
+
+void PLineEdit::setValue(const QVariant &value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ m_edit->setText(value.toString());
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PLineEdit::updateProperty(const QString& val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "plineedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/plineedit.h b/lib/widgets/propeditor/plineedit.h
new file mode 100644
index 00000000..ea6f0bd9
--- /dev/null
+++ b/lib/widgets/propeditor/plineedit.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PLINEEDIT_H
+#define PLINEEDIT_H
+
+#include "propertywidget.h"
+
+class KLineEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with line edit.
+*/
+class PLineEdit: public PropertyWidget{
+ Q_OBJECT
+public:
+ PLineEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+
+private slots:
+ void updateProperty(const QString &val);
+
+private:
+ KLineEdit *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/plinestyleedit.cpp b/lib/widgets/propeditor/plinestyleedit.cpp
new file mode 100644
index 00000000..d596ad93
--- /dev/null
+++ b/lib/widgets/propeditor/plinestyleedit.cpp
@@ -0,0 +1,205 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "plinestyleedit.h"
+
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qcombobox.h>
+#include <qlayout.h>
+
+namespace PropertyLib {
+
+ const char *nopen[]={
+ "48 16 1 1",
+ ". c None",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................"};
+ const char *solid[]={
+ "48 16 2 1",
+ ". c None",
+ "# c #000000",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ ".###########################################....",
+ ".###########################################....",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................"};
+ const char *dash[]={
+ "48 16 2 1",
+ ". c None",
+ "# c #000000",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ ".#########..#########..#########..##########....",
+ ".#########..#########..#########..##########....",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................"};
+ const char *dashdot[]={
+ "48 16 2 1",
+ ". c None",
+ "# c #000000",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ ".#########..##..#########..##..#########..##....",
+ ".#########..##..#########..##..#########..##....",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................"};
+ const char *dashdotdot[]={
+ "48 16 2 1",
+ ". c None",
+ "# c #000000",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ ".#########..##..##..#########..##..##..#####....",
+ ".#########..##..##..#########..##..##..#####....",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................",
+ "................................................"};
+
+
+PLineStyleEdit::PLineStyleEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QComboBox(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ m_edit->insertItem(QPixmap(nopen));
+ m_edit->insertItem(QPixmap(solid));
+ m_edit->insertItem(QPixmap(dash));
+ m_edit->insertItem(QPixmap(dashdot));
+ m_edit->insertItem(QPixmap(dashdotdot));
+
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+}
+
+QVariant PLineStyleEdit::value() const
+{
+ return m_edit->currentItem();
+}
+
+void PLineStyleEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+
+ if (!value.canCast(QVariant::Int))
+ if ((value.toInt() > 5) || (value.toInt() < 0))
+ return;
+
+ switch (value.toInt()) {
+ case 0:
+ p->drawPixmap(r, QPixmap(nopen));
+ break;
+ case 1:
+ p->drawPixmap(r, QPixmap(solid));
+ break;
+ case 2:
+ p->drawPixmap(r, QPixmap(dash));
+ break;
+ case 3:
+ p->drawPixmap(r, QPixmap(dashdot));
+ break;
+ case 4:
+ p->drawPixmap(r, QPixmap(dashdot));
+ break;
+ case 5:
+ p->drawPixmap(r, QPixmap(dashdotdot));
+ break;
+ }
+}
+
+void PLineStyleEdit::setValue(const QVariant& value, bool emitChange)
+{
+ if (!value.canCast(QVariant::Int))
+ return;
+ if ((value.toInt() > 5) || (value.toInt() < 0))
+ return;
+ disconnect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ m_edit->setCurrentItem(value.toInt());
+ connect(m_edit, SIGNAL(activated(int)), this, SLOT(updateProperty(int)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PLineStyleEdit::updateProperty(int val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "plinestyleedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/plinestyleedit.h b/lib/widgets/propeditor/plinestyleedit.h
new file mode 100644
index 00000000..1992efba
--- /dev/null
+++ b/lib/widgets/propeditor/plinestyleedit.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYLIBPLINESTYLEEDIT_H
+#define PROPERTYLIBPLINESTYLEEDIT_H
+
+#include "propertywidget.h"
+
+class QComboBox;
+
+namespace PropertyLib {
+
+/**
+@short Line style editor
+*/
+class PLineStyleEdit : public PropertyWidget {
+ Q_OBJECT
+public:
+ PLineStyleEdit(MultiProperty* property, QWidget* parent = 0, const char* name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private slots:
+ void updateProperty(int val);
+
+private:
+ QComboBox *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/ppixmapedit.cpp b/lib/widgets/propeditor/ppixmapedit.cpp
new file mode 100644
index 00000000..b20cc7b3
--- /dev/null
+++ b/lib/widgets/propeditor/ppixmapedit.cpp
@@ -0,0 +1,149 @@
+/***************************************************************************
+ * Copyright (C) 2003 Cedric Pasteur *
+ * <cedric.pasteur@free.fr> *
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "ppixmapedit.h"
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qlabel.h>
+#include <qcursor.h>
+
+#ifndef PURE_QT
+#include <klocale.h>
+#else
+#include "compat_tools.h"
+#endif
+
+#ifndef PURE_QT
+#include <kfiledialog.h>
+#else
+#include <qfiledialog.h>
+#endif
+#include <qpushbutton.h>
+
+namespace PropertyLib{
+
+PPixmapEdit::PPixmapEdit(MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QLabel(this);
+ m_edit->setAlignment(Qt::AlignTop);
+ m_edit->resize(width(), height()-1);
+ m_edit->setBackgroundMode(Qt::PaletteBase);
+ m_edit->installEventFilter(this);
+
+ m_button = new QPushButton(i18n("..."), this);
+ m_button->resize(height(), height()-8);
+ m_button->move(width() - m_button->width() -1, 0);
+ m_button->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
+ l->addWidget(m_edit);
+ l->addWidget(m_button);
+ m_popup = new QLabel(0, 0, Qt::WStyle_NoBorder|Qt::WX11BypassWM|WStyle_StaysOnTop);
+ m_popup->hide();
+
+
+ connect(m_button, SIGNAL(clicked()), this, SLOT(updateProperty()));
+}
+
+QVariant PPixmapEdit::value() const
+{
+ return QVariant(*(m_edit->pixmap()));
+}
+
+void PPixmapEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawPixmap(r.topLeft().x(), r.topLeft().y(), value.toPixmap());
+}
+
+void PPixmapEdit::setValue(const QVariant& value, bool emitChange)
+{
+ m_edit->setPixmap(value.toPixmap());
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PPixmapEdit::updateProperty()
+{
+#ifndef PURE_QT
+ KURL url = KFileDialog::getImageOpenURL(QString::null, this);
+ if (!url.isEmpty())
+ {
+ m_edit->setPixmap(QPixmap(url.path()));
+ emit propertyChanged(m_property, value());
+ }
+#else
+ QString url = QFileDialog::getOpenFileName();
+ if (!url.isEmpty())
+ {
+ m_edit->setPixmap(QPixmap(url));
+ emit propertyChanged(m_property, value());
+ }
+#endif
+}
+
+void PPixmapEdit::resizeEvent(QResizeEvent *ev)
+{
+ m_edit->resize(ev->size().width(), ev->size().height()-1);
+ m_button->move(ev->size().width() - m_button->width(), 0);
+ m_edit->setMaximumHeight(m_button->height());
+}
+
+bool PPixmapEdit::eventFilter(QObject *o, QEvent *ev)
+{
+ if(o == m_edit)
+ {
+ if(ev->type() == QEvent::MouseButtonPress)
+ {
+ if(m_edit->pixmap()->size().height() < height()-2
+ && m_edit->pixmap()->size().width() < width()-20)
+ return false;
+ m_popup->setPixmap(*(m_edit->pixmap()));
+ m_popup->resize(m_edit->pixmap()->size());
+ m_popup->move(QCursor::pos());
+ m_popup->show();
+ }
+ if(ev->type() == QEvent::MouseButtonRelease)
+ {
+ if(m_popup->isVisible())
+ m_popup->hide();
+ }
+ if(ev->type() == QEvent::KeyPress)
+ {
+ QKeyEvent* e = static_cast<QKeyEvent*>(ev);
+ if((e->key() == Key_Enter) || (e->key()== Key_Space) || (e->key() == Key_Return))
+ {
+ m_button->animateClick();
+ return true;
+ }
+ }
+ }
+ return PropertyWidget::eventFilter(o, ev);
+}
+
+}
+
+#ifndef PURE_QT
+#include "ppixmapedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/ppixmapedit.h b/lib/widgets/propeditor/ppixmapedit.h
new file mode 100644
index 00000000..e61dc73c
--- /dev/null
+++ b/lib/widgets/propeditor/ppixmapedit.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PPIXMAPEDIT_H
+#define PPIXMAPEDIT_H
+
+#include "propertywidget.h"
+
+class QLabel;
+class QPushButton;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor which shows a pixmap and allows to load it from file.
+*/
+class PPixmapEdit : public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PPixmapEdit(MultiProperty* property, QWidget* parent = 0, const char* name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+ virtual void resizeEvent(QResizeEvent *ev);
+ virtual bool eventFilter(QObject *o, QEvent *ev);
+
+protected slots:
+ void updateProperty();
+
+private:
+ QLabel *m_edit;
+ QLabel *m_popup;
+ QPushButton *m_button;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/ppointedit.cpp b/lib/widgets/propeditor/ppointedit.cpp
new file mode 100644
index 00000000..f9f37bf0
--- /dev/null
+++ b/lib/widgets/propeditor/ppointedit.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "ppointedit.h"
+
+#include <klineedit.h>
+#include <qlayout.h>
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PPointEdit::PPointEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ m_edit->setReadOnly(true);
+}
+
+QVariant PPointEdit::value() const
+{
+ return m_value;
+}
+
+void PPointEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y()));
+}
+
+void PPointEdit::setValue(const QVariant& value, bool emitChange)
+{
+ m_value = value;
+ m_edit->setText(QString("[ %1, %2 ]").arg(value.toPoint().x()).arg(value.toPoint().y()));
+
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+}
+
+#ifndef PURE_QT
+#include "ppointedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/ppointedit.h b/lib/widgets/propeditor/ppointedit.h
new file mode 100644
index 00000000..9b571ced
--- /dev/null
+++ b/lib/widgets/propeditor/ppointedit.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PPOINTEDIT_H
+#define PPOINTEDIT_H
+
+#include "propertywidget.h"
+
+class KLineEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QPoint values.
+*/
+class PPointEdit : public PropertyWidget
+{
+Q_OBJECT
+public:
+ PPointEdit(MultiProperty* property, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private:
+ KLineEdit *m_edit;
+ QVariant m_value;
+
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/prectedit.cpp b/lib/widgets/propeditor/prectedit.cpp
new file mode 100644
index 00000000..c049b5d6
--- /dev/null
+++ b/lib/widgets/propeditor/prectedit.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "prectedit.h"
+
+#include <klineedit.h>
+#include <qlayout.h>
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PRectEdit::PRectEdit(MultiProperty* property, QWidget* parent, const char* name): PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ m_edit->setReadOnly(true);
+}
+
+QVariant PRectEdit::value() const
+{
+ return m_value;
+}
+
+void PRectEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height()));
+}
+
+void PRectEdit::setValue(const QVariant& value, bool emitChange)
+{
+ m_value = value;
+ m_edit->setText(QString("[ %1, %2, %3, %4 ]").arg(value.toRect().x()).arg(value.toRect().y()).arg(value.toRect().width()).arg(value.toRect().height()));
+
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+}
+
+#ifndef PURE_QT
+#include "prectedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/prectedit.h b/lib/widgets/propeditor/prectedit.h
new file mode 100644
index 00000000..44bcfed4
--- /dev/null
+++ b/lib/widgets/propeditor/prectedit.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PRECTEDIT_H
+#define PRECTEDIT_H
+
+#include "propertywidget.h"
+
+class KLineEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QRect values.
+*/
+class PRectEdit : public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PRectEdit(MultiProperty* property, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private:
+ KLineEdit *m_edit;
+ QVariant m_value;
+
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/property.cpp b/lib/widgets/propeditor/property.cpp
new file mode 100644
index 00000000..d53af8cf
--- /dev/null
+++ b/lib/widgets/propeditor/property.cpp
@@ -0,0 +1,129 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo <cloudtemple@mskat.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "property.h"
+
+#include <qstring.h>
+
+namespace PropertyLib{
+
+Property::Property(int type, const QString &name, const QString &description,
+ const QVariant &value, bool save, bool readOnly):
+ m_type(type), m_name(name), m_description(description), m_value(value), m_save(save),
+ m_readOnly(readOnly), m_visible(true)
+{
+}
+
+Property::Property(const QString &name, const QMap<QString, QVariant> &v_valueList,
+ const QString &description, const QVariant &value, bool save, bool readOnly):
+ valueList(v_valueList), m_type(ValueFromList), m_name(name),
+ m_description(description), m_value(value), m_save(save), m_readOnly(readOnly),
+ m_visible(true)
+{
+}
+
+Property::~Property()
+{
+}
+
+bool Property::allowSaving() const
+{
+ return m_save;
+}
+
+bool Property::operator<(const Property &prop) const
+{
+ if ((type() < prop.type()) && (name() < prop.name()))
+ return true;
+ else
+ return false;
+}
+
+QString Property::name() const
+{
+ return m_name;
+}
+
+void Property::setName(const QString &name)
+{
+ m_name = name;
+}
+
+int Property::type() const
+{
+ return m_type;
+}
+
+void Property::setType(int type)
+{
+ m_type = type;
+}
+
+QVariant Property::value() const
+{
+ return m_value;
+}
+
+void Property::setValue(const QVariant &value, bool rememberOldValue)
+{
+ if (rememberOldValue)
+ m_oldValue = m_value;
+ else
+ m_oldValue = value;
+ m_value = value;
+}
+
+QString Property::description() const
+{
+ return m_description;
+}
+
+void Property::setDescription(const QString &description)
+{
+ m_description = description;
+}
+
+void Property::setValueList(const QMap<QString, QVariant> &v_valueList)
+{
+ valueList = v_valueList;
+}
+
+bool Property::readOnly() const
+{
+ return m_readOnly;
+}
+
+bool Property::visible() const
+{
+ return m_visible;
+}
+
+void Property::setVisible( const bool visible )
+{
+ m_visible = visible;
+}
+
+QVariant Property::oldValue() const
+{
+ if (m_oldValue.isNull())
+ return m_value;
+ else
+ return m_oldValue;
+}
+
+}
diff --git a/lib/widgets/propeditor/property.h b/lib/widgets/propeditor/property.h
new file mode 100644
index 00000000..13a1ad8b
--- /dev/null
+++ b/lib/widgets/propeditor/property.h
@@ -0,0 +1,181 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo <cloudtemple@mskat.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTY_H
+#define PROPERTY_H
+
+#include <qvariant.h>
+
+#include <qmap.h>
+
+class QWidget;
+class QString;
+
+/**Namespace which contain property editing classes.*/
+namespace PropertyLib{
+
+/** @file property.h
+@short Contains @ref PropertyLib::Property class and @ref PropertyLib::Property::PropertyType enum.
+*/
+
+/**
+@short Property.
+
+It includes support for QStringList properties, an i18n'ed label and stores an old value to allow undo.
+
+Contains name, type and value.
+
+Type can be one of predefined types (including standard @ref QVariant types) by @ref PropertyLib::Property::PropertyType
+enum or custom user type. User defined types should have values more than 3000.
+
+Value is a @ref QVariant.
+
+Property can optionally have a list of possible values.
+In that case use @ref ValueFromList type and valueList member.
+Use @ref description for i18n'ed label.
+
+Examples:
+creating property:
+\code
+Property *property = new Property(String, name, description, value)
+\endcode
+using convenience constructor to create property of ValueFromList type:
+\code
+Property *property = new Property(name, possibleValuesList, description, value);
+\endcode
+*/
+class Property {
+public:
+ /** PropertyType.
+ Integers that represent the type of the property. */
+ enum PropertyType {
+ //standard supported QVariant types
+ Invalid = QVariant::Invalid /**<invalid property type*/,
+ Map = QVariant::Map /**<QMap<QString, QVariant>*/,
+ List = QVariant::List /**<QValueList<QVariant>*/,
+ String = QVariant::String /**<string*/,
+ StringList = QVariant::StringList /**<string list*/,
+ Font = QVariant::Font /**<font*/,
+ Pixmap = QVariant::Pixmap /**<pixmap*/,
+ //@todo implement QVariant::Brush
+ Rect = QVariant::Rect /**<rectangle (x,y, width, height)*/,
+ Size = QVariant::Size /**<size (width, height)*/,
+ Color = QVariant::Color /**<color*/,
+ //@todo implement QVariant::Palette
+ //@todo implement QVariant::ColorGroup
+ //@todo implement QVariant::IconSet
+ Point = QVariant::Point /**<point (x,y)*/,
+ //@todo implement QVariant::Image
+ Integer = QVariant::Int /**<integer*/,
+ //@todo implement QVariant::UInt
+ Boolean = QVariant::Bool /**<boolean*/,
+ Double = QVariant::Double /**<double*/,
+ //@todo implement QVariant::CString
+ //@todo implement QVariant::PointArray
+ //@todo implement QVariant::Region
+ //@todo implement QVariant::Bitmap
+ Cursor = QVariant::Cursor /**<cursor*/,
+ SizePolicy = QVariant::SizePolicy /**<size policy (horizontal, vertical)*/,
+ Date = QVariant::Date /**<date*/,
+ //@todo implement QVariant::Time
+ DateTime = QVariant::DateTime /**<date and time*/,
+ //@todo implement QVariant::ByteArray
+ //@todo implement QVariant::BitArray
+ //@todo implement QVariant::KeySequence
+ //@todo implement QVariant::Pen
+ //@todo implement QVariant::Long
+ //@todo implement QVariant::LongLong
+ //@todo implement QVariant::ULongLong
+
+
+ //predefined custom types
+ ValueFromList = 2000 /**<string value from a list*/,
+ Symbol = 2001 /**<unicode symbol code*/,
+ FontName = 2002 /**<font name, e.g. "times new roman"*/,
+ FileURL = 2003 /**<url of a file*/,
+ DirectoryURL = 2004 /**<url of a directory*/,
+ LineStyle = 2005 /**<line style*/,
+
+ UserDefined = 3000 /**<plugin defined properties should start here*/
+ };
+
+ /**Constructs empty property.*/
+ Property() {}
+ /**Constructs property.*/
+ Property(int type, const QString &name, const QString &description,
+ const QVariant &value = QVariant(), bool save = true, bool readOnly = false);
+ /**Constructs property with @ref ValueFromList type.*/
+ Property(const QString &name, const QMap<QString, QVariant> &v_valueList,
+ const QString &description, const QVariant &value = QVariant(), bool save = true, bool readOnly = false);
+ virtual ~Property();
+
+ virtual bool operator<(const Property &prop) const;
+
+ /**@return the name of the property.*/
+ virtual QString name() const;
+ /**Sets the name of the property.*/
+ virtual void setName(const QString &name);
+ /**@return the type of the property.*/
+ virtual int type() const;
+ /**Sets the type of the property.*/
+ virtual void setType(int type);
+ /**@return the value of the property.*/
+ virtual QVariant value() const;
+ /**Sets the value of the property.*/
+ virtual void setValue(const QVariant &value, bool rememberOldValue = true);
+ /**@return the description of the property.*/
+ virtual QString description() const;
+ /**Sets the description of the property.*/
+ virtual void setDescription(const QString &description);
+ /**Sets the string-to-value correspondence list of the property.
+ This is used to create comboboxes-like property editors.*/
+ virtual void setValueList(const QMap<QString, QVariant> &list);
+ /**The string-to-value correspondence list of the property.*/
+ QMap<QString, QVariant> valueList;
+
+ /**Tells if the property can be saved to a stream, xml, etc.
+ There is a possibility to use "GUI" properties that aren't
+ stored but used only in a GUI.*/
+ virtual bool allowSaving() const;
+ /**Tells if the property is read only.*/
+ virtual bool readOnly() const;
+ /**Tells if the property is visible.*/
+ virtual bool visible() const;
+ /**Set the visibility.*/
+ virtual void setVisible(const bool visible);
+
+ /**Gets the previous property value.*/
+ virtual QVariant oldValue() const;
+
+private:
+// Property(Property &property) {};
+// void operator=(Property &property) {};
+
+ int m_type;
+ QString m_name;
+ QString m_description;
+ QVariant m_value;
+ QVariant m_oldValue;
+ bool m_save;
+ bool m_readOnly;
+ bool m_visible;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/propertyeditor.cpp b/lib/widgets/propeditor/propertyeditor.cpp
new file mode 100644
index 00000000..58c2b936
--- /dev/null
+++ b/lib/widgets/propeditor/propertyeditor.cpp
@@ -0,0 +1,480 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "propertyeditor.h"
+
+#ifndef PURE_QT
+#include <klocale.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#else
+#include "compat_tools.h"
+#endif
+
+#include <qtable.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qptrlist.h>
+#include <qvaluelist.h>
+#include <qpushbutton.h>
+
+#include "property.h"
+#include "multiproperty.h"
+#include "propertymachinefactory.h"
+
+namespace PropertyLib{
+
+class PropertyItem: public KListViewItem{
+public:
+ PropertyItem(PropertyEditor *parent, MultiProperty *property)
+ :KListViewItem(parent, property->description()), m_editor(parent), m_property(property),
+ m_changed(false)
+ {
+ }
+
+ PropertyItem(PropertyEditor *editor, KListViewItem *parent, MultiProperty *property)
+ :KListViewItem(parent, property->description()), m_editor(editor),
+ m_property(property), m_changed(false)
+ {
+ }
+
+/* int type() const
+ {
+ return m_property->type();
+ }
+
+ QString name() const
+ {
+ return m_property->name();
+ }
+ */
+ MultiProperty *property() const
+ {
+ return m_property;
+ }
+
+ virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align)
+ {
+ if ((column == 0) && m_changed)
+ {
+ QFont font;
+ font.setBold(true);
+ p->setFont(font);
+ p->setBrush(cg.highlight());
+ p->setPen(cg.highlightedText());
+ }
+ if (column == 1)
+ {
+ QRect r(0, 0, m_editor->header()->sectionSize(1), height());
+ //FIXME: this is ugly, but how else can we deal with ValueFromList properties?
+ QVariant valueToDraw;
+ if (m_property->type() == Property::ValueFromList)
+ valueToDraw = m_property->findValueDescription();
+ else
+ valueToDraw = m_property->value();
+ QColorGroup icg(cg);
+#ifndef PURE_QT
+ icg.setColor(QColorGroup::Background, backgroundColor());
+#else
+ icg.setColor(QColorGroup::Background, white);
+#endif
+ m_editor->machine(m_property)->propertyEditor->drawViewer(p, icg, r, valueToDraw);
+ return;
+ }
+ KListViewItem::paintCell(p, cg, column, width, align);
+ }
+
+ virtual void setup()
+ {
+ KListViewItem::setup();
+ setHeight(static_cast<int>(height()*1.5));
+ }
+
+ void setChanged(bool changed)
+ {
+ m_changed = changed;
+ }
+
+private:
+ PropertyEditor *m_editor;
+ MultiProperty *m_property;
+ bool m_changed;
+};
+
+
+class PropertyGroupItem: public KListViewItem{
+public:
+ PropertyGroupItem(KListView *parent, const QString &name)
+ :KListViewItem(parent, name)
+ {
+ init();
+ }
+ PropertyGroupItem(KListViewItem *parent, const QString &name)
+ :KListViewItem(parent, name)
+ {
+ init();
+ }
+
+ virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align)
+ {
+ if (column == 0)
+ {
+ QFont font;
+ font.setBold(true);
+ p->setFont(font);
+ p->setBrush(cg.highlight());
+ p->setPen(cg.highlightedText());
+ }
+ KListViewItem::paintCell(p, cg, column, width, align);
+ }
+ virtual void setup()
+ {
+ KListViewItem::setup();
+ setHeight(static_cast<int>(height()*1.4));
+ }
+
+private:
+ void init()
+ {
+ setOpen(true);
+ }
+};
+
+class SeparatorItem: public KListViewItem{
+public:
+ SeparatorItem(KListView *parent)
+ :KListViewItem(parent)
+ {
+ setSelectable(false);
+ }
+};
+PropertyEditor::PropertyEditor(QWidget *parent, const char *name)
+ :KListView(parent, name)
+{
+ setSorting(-1);
+
+ addColumn(i18n("Name"));
+ addColumn(i18n("Value"));
+ setAllColumnsShowFocus(true);
+ setColumnWidthMode(0, QListView::Maximum);
+ setResizeMode(QListView::LastColumn);
+
+ header()->setClickEnabled(false);
+
+ connect(header(), SIGNAL(sizeChange(int, int, int)),
+ this, SLOT(updateEditorSize()));
+ connect(this, SIGNAL(currentChanged(QListViewItem*)),
+ this, SLOT(slotClicked(QListViewItem*)));
+
+ m_currentEditItem = 0;
+ m_doubleClickForEdit = true;
+ m_lastClickedItem = 0;
+ m_currentEditWidget = 0;
+ m_list = 0;
+
+ m_currentEditArea = new QWidget(viewport());
+ m_currentEditArea->hide();
+ m_undoButton = new QPushButton(m_currentEditArea);
+#ifndef PURE_QT
+ m_undoButton->setPixmap(SmallIcon("undo"));
+#else
+ m_undoButton->setPixmap( QPixmap("undo.xpm") );
+#endif
+ m_undoButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
+ m_undoButton->resize(m_undoButton->height(), m_undoButton->height());
+ m_undoButton->hide();
+ connect(m_undoButton, SIGNAL(clicked()), this, SLOT(undo()));
+ m_currentEditLayout = new QGridLayout(m_currentEditArea, 1, 2, 0, 0);
+// m_currentEditLayout->addWidget(m_undoButton, 0, 1);
+}
+
+PropertyEditor::~PropertyEditor()
+{
+ clearMachineCache();
+}
+
+void PropertyEditor::populateProperties(PropertyList *list)
+{
+ if (list == 0)
+ return;
+ m_list = list;
+ connect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*)));
+ const QValueList<QPair<QString, QValueList<QString> > >& groups = m_list->propertiesOfGroup();
+ for (QValueList<QPair<QString, QValueList<QString> > >::const_iterator it = groups.begin();
+ it != groups.end(); ++it)
+ {
+// qWarning("PropertyEditor::populateProperties: adding group %s", (*it).first.ascii());
+ PropertyGroupItem *group = 0;
+ if ( (!(*it).first.isEmpty()) && ((*it).second.count() > 0) )
+ group = new PropertyGroupItem(this, (*it).first);
+ const QValueList<QString> &properties = (*it).second;
+ for (QValueList<QString>::const_iterator it2 = properties.begin(); it2 != properties.end(); ++it2)
+ {
+// qWarning("PropertyEditor::populateProperties: adding property %s", (*it2).ascii());
+ if (group)
+ addProperty(group, *it2);
+ else
+ addProperty(*it2);
+ }
+ }
+ if (firstChild())
+ {
+ setCurrentItem(firstChild());
+ setSelected(firstChild(), true);
+ slotClicked(firstChild());
+ }
+}
+
+void PropertyEditor::addProperty(PropertyGroupItem *group, const QString &name)
+{
+ if ((*m_list)[name] == 0)
+ return;
+// qWarning("%s = name : object null ", name.ascii());
+ PropertyItem *pitem = new PropertyItem(this, group, (*m_list)[name]);
+ addChildProperties(pitem);
+}
+
+void PropertyEditor::addProperty(const QString &name)
+{
+ if ((*m_list)[name] == 0)
+ return;
+// qWarning("%s = name : object null ", name.ascii());
+ PropertyItem *pitem = new PropertyItem(this, (*m_list)[name]);
+ addChildProperties(pitem);
+}
+
+void PropertyEditor::addChildProperties(PropertyItem *parent)
+{
+ MultiProperty *prop = parent->property();
+ //force machine creation to get detailed properties appended to current multiproperty
+ if ( !m_registeredForType.contains(prop->name())
+ && (PropertyMachineFactory::getInstance()->hasDetailedEditors(prop->type())) )
+ {
+ //FIXME: find better solution
+ machine(prop);
+ }
+
+// qWarning("seeking children: count: %d", prop->details.count());
+
+ parent->setOpen(true);
+ for (QValueList<ChildProperty>::iterator it = prop->details.begin(); it != prop->details.end(); ++it)
+ {
+// qWarning("found child %s", (*it).name().ascii());
+ new PropertyItem(this, parent, new MultiProperty(&m_detailedList, &(*it)));
+ }
+}
+
+void PropertyEditor::clearProperties()
+{
+ m_detailedList.clear();
+ if (!m_list)
+ return;
+
+ hideEditor();
+
+ disconnect(m_list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(propertyValueChanged(Property*)));
+ clear();
+ delete m_list;
+ m_list = 0;
+}
+
+void PropertyEditor::propertyValueChanged(Property *property)
+{
+// qWarning("PropertyEditor::propertyValueChanged");
+ if (m_currentEditWidget->propertyName() == property->name())
+ m_currentEditWidget->setValue(property->value(), false);
+ else
+ {
+// repaint all items
+ QListViewItemIterator it(this);
+ while (it.current())
+ {
+ repaintItem(it.current());
+ ++it;
+ }
+ }
+}
+
+void PropertyEditor::propertyChanged(MultiProperty *property, const QVariant &value)
+{
+ if (!property)
+ return;
+
+ qWarning("editor: assign %s to %s", property->name().latin1(), value.toString().latin1());
+ property->setValue(value, false);
+
+ //highlight changed properties
+ if (m_currentEditItem && (m_currentEditItem->property() == property))
+ {
+ m_currentEditItem->setChanged(true);
+ repaintItem(m_currentEditItem);
+ }
+
+ emit changed();
+
+/* if (m_list->contains(name))
+ {
+ (*m_list)[name]->setValue(value, false);
+// else if (m_detailedList->contains(*/
+}
+
+void PropertyEditor::hideEditor()
+{
+ m_lastClickedItem = 0;
+ m_currentEditItem = 0;
+ if (m_currentEditWidget)
+ {
+ m_currentEditLayout->remove(m_currentEditWidget);
+ m_currentEditWidget->hide();
+ }
+ m_currentEditLayout->remove(m_undoButton);
+ m_undoButton->hide();
+ m_currentEditArea->hide();
+ m_currentEditWidget = 0;
+}
+
+void PropertyEditor::showEditor(PropertyItem *item)
+{
+ m_currentEditItem = item;
+ placeEditor(item);
+ m_currentEditWidget->show();
+ m_undoButton->show();
+ m_currentEditArea->show();
+}
+
+void PropertyEditor::placeEditor(PropertyItem *item)
+{
+ QRect r = itemRect(item);
+ if (!r.size().isValid())
+ {
+ ensureItemVisible(item);
+ r = itemRect(item);
+ }
+
+ r.setX(header()->sectionPos(1));
+ r.setWidth(header()->sectionSize(1));
+
+ // check if the column is fully visible
+ if (visibleWidth() < r.right())
+ r.setRight(visibleWidth());
+
+ r = QRect(viewportToContents(r.topLeft()), r.size());
+
+ if (item->pixmap(1))
+ {
+ r.setX(r.x() + item->pixmap(1)->width());
+ }
+
+ if (PropertyWidget* editor = prepareEditor(item))
+ {
+ m_currentEditLayout->addWidget(editor, 0, 0);
+ m_currentEditLayout->addWidget(m_undoButton, 0, 1);
+ m_currentEditArea->resize(r.size());
+// m_currentEditLayout->invalidate();
+ moveChild(m_currentEditArea, r.x(), r.y());
+ m_currentEditWidget = editor;
+ }
+}
+
+PropertyWidget* PropertyEditor::prepareEditor(PropertyItem *item)
+{
+ PropertyWidget *editorWidget = 0;
+/* if (item->depth() >= 2)
+ {
+ editorWidget = machine(item->name())->propertyEditor;
+ editorWidget->setValue(m_accessor->value(item->name()), false);
+ }
+ else
+ {*/
+ editorWidget = machine(item->property())->propertyEditor;
+ editorWidget->setProperty(item->property());
+ if (item->property()->type() == Property::ValueFromList)
+ editorWidget->setValueList(item->property()->valueList());
+ editorWidget->setValue(item->property()->value(), false);
+ //}
+ return editorWidget;
+}
+
+void PropertyEditor::updateEditorSize()
+{
+ if (m_currentEditItem)
+ placeEditor(m_currentEditItem);
+}
+
+void PropertyEditor::slotClicked(QListViewItem *item)
+{
+ if (item == 0)
+ {
+ hideEditor();
+ return;
+ }
+ if (item != m_lastClickedItem)
+ {
+ hideEditor();
+ PropertyItem *it = dynamic_cast<PropertyItem*>(item);
+ if (it)
+ {
+ showEditor(it);
+ }
+ }
+
+ m_lastClickedItem = item;
+}
+
+Machine *PropertyEditor::machine(MultiProperty *property)
+{
+// int type = property->type();
+ QString name = property->name();
+ QMap<QString, QVariant> values = property->valueList();
+ if (m_registeredForType[name] == 0)
+ {
+ m_registeredForType[name] = PropertyMachineFactory::getInstance()->machineForProperty(property);
+ connect(m_registeredForType[name]->propertyEditor, SIGNAL(propertyChanged(MultiProperty*, const QVariant&)),
+ this, SLOT(propertyChanged(MultiProperty*, const QVariant&)));
+ m_registeredForType[name]->propertyEditor->reparent(m_currentEditArea, 0, m_currentEditArea->childrenRect().topLeft());
+ m_registeredForType[name]->propertyEditor->hide();
+ }
+ return m_registeredForType[name];
+}
+
+void PropertyEditor::clearMachineCache()
+{
+ for (QMap<QString, Machine* >::iterator it = m_registeredForType.begin(); it != m_registeredForType.end(); ++it)
+ {
+ delete it.data();
+ }
+ m_registeredForType.clear();
+}
+
+void PropertyEditor::undo()
+{
+ if ((m_currentEditItem == 0) || (m_currentEditWidget == 0)
+ || (!m_currentEditWidget->isVisible()))
+ return;
+
+ m_currentEditWidget->undo();
+ m_currentEditItem->setChanged(false);
+ repaintItem(m_currentEditItem);
+}
+
+}
+
+#ifndef PURE_QT
+#include "propertyeditor.moc"
+#endif
diff --git a/lib/widgets/propeditor/propertyeditor.h b/lib/widgets/propeditor/propertyeditor.h
new file mode 100644
index 00000000..f641118c
--- /dev/null
+++ b/lib/widgets/propeditor/propertyeditor.h
@@ -0,0 +1,129 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYEDITOR_H
+#define PROPERTYEDITOR_H
+
+#ifndef PURE_QT
+#include <klistview.h>
+#else
+#include <qlistview.h>
+#define KListView QListView
+#define KListViewItem QListViewItem
+#endif
+
+#include "propertylist.h"
+
+class QPushButton;
+class QGridLayout;
+
+namespace PropertyLib{
+
+class PropertyItem;
+class PropertyGroupItem;
+class PropertyWidget;
+class Property;
+class MultiProperty;
+struct Machine;
+
+/** @file propertyeditor.h
+@short Contains @ref PropertyLib::PropertyEditor class.
+*/
+
+/**
+@short %Property editor.
+
+Displays a list of properties in a table form. Also performs grouping and
+creation of property widgets from the machine factory.
+@see PropertyWidget
+@see Machine
+@see PropertyMachineFactory
+*/
+class PropertyEditor: public KListView{
+ Q_OBJECT
+public:
+ /**Constructs the property editor.*/
+ PropertyEditor(QWidget *parent = 0, const char *name = 0);
+ ~PropertyEditor();
+
+ /**@return @ref Machine for given property.
+ Uses cache to store created machines.
+ Cache will be cleared only with @ref clearMachineCache.*/
+ Machine *machine(MultiProperty *property);
+
+public slots:
+ /**Shows properties from a list.*/
+ void populateProperties(PropertyList *list);
+ /**Clears property list, disconnects accessor from the editor and deletes it.*/
+ void clearProperties();
+ /**Deletes cached machines.*/
+ void clearMachineCache();
+
+signals:
+ /**Emitted when something is changed in property editor.*/
+ void changed();
+
+protected slots:
+ /**Updates property widget in the editor.*/
+ void propertyValueChanged(Property* property);
+ /**Updates property in the list when new value is selected in the editor.*/
+ void propertyChanged(MultiProperty *property, const QVariant &value);
+
+ /**Shows property editor.*/
+ void slotClicked(QListViewItem* item);
+ void updateEditorSize();
+
+ /**Undoes the last change in property editor.*/
+ void undo();
+
+protected:
+ void editItem(QListViewItem*, int);
+ void hideEditor();
+ void showEditor(PropertyItem *item);
+ void placeEditor(PropertyItem *item);
+ PropertyWidget *prepareEditor(PropertyItem *item);
+
+ void addGroup(const QString &name);
+ void addProperty(PropertyGroupItem *group, const QString &name);
+ void addProperty(const QString &name);
+ void addChildProperties(PropertyItem *parent);
+
+private:
+ PropertyList *m_list;
+ PropertyList m_detailedList;
+
+ //machines cache for property types, machines will be deleted
+ QMap<QString, Machine* > m_registeredForType;
+
+ PropertyItem *m_currentEditItem;
+ PropertyWidget *m_currentEditWidget;
+ QWidget *m_currentEditArea;
+ QGridLayout *m_currentEditLayout;
+
+ bool m_doubleClickForEdit;
+ QListViewItem* m_lastClickedItem;
+
+ QPushButton *m_undoButton;
+
+friend class PropertyItem;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/propertyeditor.pro b/lib/widgets/propeditor/propertyeditor.pro
new file mode 100644
index 00000000..125ce510
--- /dev/null
+++ b/lib/widgets/propeditor/propertyeditor.pro
@@ -0,0 +1,40 @@
+TEMPLATE = lib
+CONFIG += debug
+DEFINES += PURE_QT
+
+SOURCES += childproperty.cpp pcombobox.cpp \
+ pdummywidget.cpp ppointedit.cpp \
+ propertymachinefactory.cpp pstringlistedit.cpp \
+ multiproperty.cpp pcursoredit.cpp \
+ prectedit.cpp propertywidget.cpp \
+ psymbolcombo.cpp pcheckbox.cpp \
+ pdateedit.cpp pfontcombo.cpp \
+ property.cpp psizeedit.cpp \
+ pdatetimeedit.cpp \
+ plineedit.cpp propertyeditor.cpp \
+ psizepolicyedit.cpp pyesnobutton.cpp \
+ ppixmapedit.cpp \
+ propertylist.cpp pspinbox.cpp \
+ propertywidgetproxy.cpp plinestyleedit.cpp \
+ qeditlistbox.cpp pdoublenuminput.cpp \
+ qfloatinput.cpp pcolorbutton.cpp \
+ purledit.cpp
+
+HEADERS += childproperty.h pcombobox.h \
+ pdummywidget.h ppointedit.h \
+ propertymachinefactory.h pcursoredit.h \
+ prectedit.h propertywidget.h \
+ pdateedit.h pfontcombo.h \
+ property.h psizeedit.h \
+ pdatetimeedit.h plineedit.h \
+ propertyeditor.h psizepolicyedit.h \
+ ppixmapedit.h propertylist.h \
+ pspinbox.h propertywidgetproxy.h \
+ multiproperty.h pyesnobutton.h \
+ psymbolcombo.h pstringlistedit.h \
+ pcheckbox.h plinestyleedit.h \
+ qeditlistbox.h pdoublenuminput.h \
+ qfloatinput.h pcolorbutton.h \
+ purledit.h
+
+IMAGES += undo.xpm
diff --git a/lib/widgets/propeditor/propertylist.cpp b/lib/widgets/propeditor/propertylist.cpp
new file mode 100644
index 00000000..3ea79a87
--- /dev/null
+++ b/lib/widgets/propeditor/propertylist.cpp
@@ -0,0 +1,369 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "propertylist.h"
+
+#include "property.h"
+#include "multiproperty.h"
+
+namespace PropertyLib{
+
+PropertyList::PropertyList()
+ :QObject(0, 0), m_propertyOwner(true)
+{
+}
+
+PropertyList::PropertyList(bool propertyOwner)
+ :QObject(0, 0), m_propertyOwner(propertyOwner)
+{
+}
+
+PropertyList::~PropertyList()
+{
+ clear();
+}
+
+MultiProperty *PropertyList::operator[](const QString &name)
+{
+ if (m_list.contains(name))
+ return m_list[name];
+ else
+ return new MultiProperty(this);
+}
+
+MultiProperty *PropertyList::property( const QString &name )
+{
+ if (m_list.contains(name))
+ return m_list[name];
+ else
+ return new MultiProperty(this);
+}
+
+void PropertyList::addProperty(Property *property)
+{
+ if (property == 0)
+ return;
+ MultiProperty *mp = 0;
+ if ( m_list.contains(property->name()) )
+ {
+ mp = m_list[property->name()];
+ mp->addProperty(property);
+ }
+ else
+ {
+ mp = new MultiProperty(this, property);
+ m_list[property->name()] = mp;
+ addToGroup("", mp);
+ }
+}
+
+void PropertyList::addProperty(const QString &group, Property *property)
+{
+ if (property == 0)
+ return;
+
+ MultiProperty *mp = 0;
+ if (m_list.contains(property->name()))
+ {
+ mp = m_list[property->name()];
+ mp->addProperty(property);
+ }
+ else
+ {
+ mp = new MultiProperty(this, property);
+ m_list[property->name()] = mp;
+ addToGroup(group, mp);
+ }
+}
+
+void PropertyList::removeProperty(Property *property)
+{
+ if (property == 0)
+ return;
+
+ if (m_propertyOwner)
+ emit aboutToDeleteProperty(property);
+
+ MultiProperty *mp = m_list[property->name()];
+ QString group = m_groupOfProperty[mp];
+ removeFromGroup(mp);
+ QString pname = property->name();
+ mp->removeProperty(property);
+ if (m_propertyOwner)
+ delete property;
+ if (mp->list.count() == 0)
+ {
+// qWarning("rp: removing mp for %s itself", pname.ascii());
+ m_list.remove(pname);
+ delete mp;
+ }
+ else
+ addToGroup(group, mp);
+}
+
+void PropertyList::removeProperty(const QString &name)
+{
+ if (m_list.contains(name))
+ {
+ QString group = m_groupOfProperty[m_list[name]];
+ removeFromGroup(m_list[name]);
+ Property *property;
+ for (property = m_list[name]->list.first(); property; property = m_list[name]->list.next())
+ {
+ if (m_propertyOwner)
+ emit aboutToDeleteProperty(property);
+
+ m_list[property->name()]->removeProperty(property);
+ if (m_propertyOwner)
+ delete property;
+ }
+ if (m_list[name]->list.count() == 0)
+ {
+// qWarning("rp2: removing mp for %s itself", name.ascii());
+ delete m_list[name];
+ m_list.remove(name);
+ }
+ else
+ {
+ addToGroup(group, m_list[name]);
+ }
+ }
+}
+
+const QValueList<QPair<QString, QValueList<QString> > >& PropertyList::propertiesOfGroup() const
+{
+ return m_propertiesOfGroup;
+}
+
+const QMap<MultiProperty*, QString>& PropertyList::groupOfProperty() const
+{
+ return m_groupOfProperty;
+}
+
+void PropertyList::addToGroup(const QString &group, MultiProperty *property)
+{
+ if (!property)
+ return;
+
+ //do not add same property to the group twice
+ if (m_groupOfProperty.contains(property) && (m_groupOfProperty[property] == group))
+ return;
+
+ QPair<QString, QValueList<QString> > *groupPair = 0;
+ for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = m_propertiesOfGroup.begin();
+ it != m_propertiesOfGroup.end(); ++it)
+ {
+ if ((*it).first == group)
+ {
+ groupPair = &(*it);
+ break;
+ }
+ }
+ if (groupPair == 0)
+ {
+ groupPair = new QPair<QString, QValueList<QString> >();
+ groupPair->first = group;
+ groupPair->second.append(property->name());
+ m_propertiesOfGroup.append(*groupPair);
+ m_groupOfProperty[property] = group;
+ return;
+ }
+ //check if group already contains property with the same name
+ if (!groupPair->second.contains(property->name()))
+ groupPair->second.append(property->name());
+
+ m_groupOfProperty[property] = group;
+}
+
+void PropertyList::removeFromGroup(MultiProperty *property)
+{
+ QString group = m_groupOfProperty[property];
+// qWarning("removeFromGroup group=%s", group.ascii());
+
+ for(QValueList<QPair<QString, QValueList<QString> > >::iterator it = m_propertiesOfGroup.begin();
+ it != m_propertiesOfGroup.end(); ++it)
+ {
+// qWarning("removeFromGroup checking %s", (*it).first.ascii());
+ if ((*it).first == group)
+ {
+// qWarning("removeFromGroup removing %s", property->name().ascii());
+ (*it).second.remove(property->name());
+ break;
+ }
+ }
+
+ m_groupOfProperty.remove(property);
+}
+
+void PropertyList::clear( )
+{
+ for (QMap<QString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it)
+ removeProperty(it.key());
+}
+
+bool PropertyList::contains( const QString & name )
+{
+ if (m_list.contains(name))
+ return true;
+ return false;
+}
+
+QPtrList<Property> PropertyList::properties(const QString &name)
+{
+ if (m_list.contains(name))
+ return m_list[name]->list;
+ return QPtrList<Property>();
+}
+
+PropertyList::Iterator PropertyList::begin()
+{
+ return Iterator(this);
+}
+
+PropertyList::Iterator PropertyList::end()
+{
+ return Iterator(this, true);
+}
+
+//PropertyList::Iterator class
+
+PropertyList::Iterator::Iterator(PropertyList *list)
+ :m_list(list)
+{
+ current = m_list->m_list.begin();
+}
+
+PropertyList::Iterator::Iterator(PropertyList *list, bool // end
+ )
+ :m_list(list)
+{
+ current = m_list->m_list.end();
+}
+
+void PropertyList::Iterator::operator ++()
+{
+ next();
+}
+
+void PropertyList::Iterator::operator ++(int)
+{
+ next();
+}
+
+void PropertyList::Iterator::next()
+{
+ ++current;
+}
+
+MultiProperty *PropertyList::Iterator::operator *()
+{
+ return data();
+}
+
+QString PropertyList::Iterator::key()
+{
+ return current.key();
+}
+
+MultiProperty *PropertyList::Iterator::data()
+{
+ return current.data();
+}
+
+bool PropertyList::Iterator::operator !=(Iterator it)
+{
+ return current != it.current;
+}
+
+
+// PropertyBuffer class
+
+
+
+
+
+PropertyBuffer::PropertyBuffer( )
+ :PropertyList(false)
+{
+}
+
+void PropertyBuffer::intersect(const PropertyList *list)
+{
+ qWarning("PropertyBuffer::intersect");
+ for (QMap<QString, MultiProperty*>::iterator it = m_list.begin(); it != m_list.end(); ++it)
+ {
+// qWarning("intersect:: for mp = %s", it.data()->name().ascii());
+ if (list->m_list.contains(it.key()))
+ {
+/* qWarning("intersect:: list contains %s", it.key().ascii());
+ if ( (*(it.data()) == *(list->m_list[it.key()])))
+ qWarning("intersect:: equal properties");
+ else
+ qWarning("intersect:: not equal properties");*/
+ if ( ((*it.data()) == *(list->m_list[it.key()]))
+ && (list->m_groupOfProperty[list->m_list[it.key()]] == m_groupOfProperty[it.data()]) )
+ {
+// qWarning("intersect:: equal properties, adding");
+ it.data()->addProperty(list->m_list[it.key()]);
+ continue;
+ }
+ }
+// qWarning("intersect:: removing %s from intersection", it.key().ascii());
+ removeProperty(it.key());
+ }
+ connect(list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(intersectedValueChanged(Property*)));
+}
+
+void PropertyBuffer::intersectedValueChanged(Property *property)
+{
+// qWarning("PropertyBuffer::intersectedValueChanged");
+ QString propertyName = property->name();
+ if (!contains(propertyName))
+ return;
+
+ MultiProperty mp(property);
+ if (mp == *m_list[propertyName])
+ {
+ Property *prop;
+ QPtrList<Property> props = properties(propertyName);
+ for (prop = props.first(); prop; prop = props.next())
+ emit propertyValueChanged(prop);
+ }
+}
+
+PropertyBuffer::PropertyBuffer(PropertyList *list)
+ :PropertyList(false)
+{
+ //deep copy of m_list
+ for (QMap<QString, MultiProperty*>::const_iterator it = list->m_list.begin();
+ it != list->m_list.end(); ++it)
+ {
+ MultiProperty *mp = new MultiProperty(*it.data());
+ mp->m_propertyList = this;
+ addToGroup(list->m_groupOfProperty[it.data()], mp);
+ m_list[it.key()] = mp;
+ }
+ connect(list, SIGNAL(propertyValueChanged(Property*)), this, SLOT(intersectedValueChanged(Property*)));
+}
+
+}
+
+#ifndef PURE_QT
+#include "propertylist.moc"
+#endif
diff --git a/lib/widgets/propeditor/propertylist.h b/lib/widgets/propeditor/propertylist.h
new file mode 100644
index 00000000..c07cebbd
--- /dev/null
+++ b/lib/widgets/propeditor/propertylist.h
@@ -0,0 +1,200 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYLIST_H
+#define PROPERTYLIST_H
+
+#include <qobject.h>
+#include <qmap.h>
+#include <qptrlist.h>
+#include <qvaluelist.h>
+#include <qpair.h>
+
+namespace PropertyLib{
+
+class Property;
+class MultiProperty;
+
+/** @file propertylist.h
+@short Contains @ref PropertyLib::PropertyList class.
+*/
+
+/**
+@short The list of properties.
+
+Every object in a program should operate with properties through
+this list in order to:
+- be informed about property changes
+- allow property lists intersections
+- display properties in the property editor widget (see @ref PropertyLib::PropertyEditor).
+.
+
+PropertyList owns properties and deletes them itself. For a list that does not own
+it's properties, look at @ref PropertyLib::PropertyBuffer class.
+
+PropertyList is also capable of grouping properties.
+You can have unsorted list of groups of properties or a plain
+alphabetically sorted list of properties or both at the same time.
+*/
+class PropertyList: public QObject
+{
+ Q_OBJECT
+
+public:
+ class Iterator {
+ public:
+ void operator ++();
+ void operator ++(int);
+
+ MultiProperty *operator *();
+
+ bool operator != (Iterator it);
+
+ QString key();
+ MultiProperty *data();
+
+ private:
+ Iterator(PropertyList *list);
+ Iterator(PropertyList *list, bool end);
+
+ void next();
+ QMap<QString, MultiProperty*>::iterator current;
+
+ PropertyList *m_list;
+ friend class PropertyList;
+ };
+
+ typedef Iterator iterator;
+
+ PropertyList();
+ virtual ~PropertyList();
+
+ /**Accesses a property by it's name. All property modifications are allowed
+ trough this method. For example, to set a value of a property, use:
+ /code
+ PropertyList list;
+ ...
+ list["My Property"]->setValue("My Value");
+ /endcode
+ @return @ref MultiProperty with given name.*/
+ virtual MultiProperty *operator[](const QString &name);
+ /**Accesses a property by it's name. All property modifications are allowed
+ trough this method. For example, to set a value of a property
+ */
+ MultiProperty *property( const QString &name );
+
+ /**Adds the property to the list to the "common" group.*/
+ virtual void addProperty(Property *property);
+ /**Adds the property to the list in group.*/
+ virtual void addProperty(const QString &group, Property *property);
+ /**Removes property from the list. Emits aboutToDeleteProperty before removing.*/
+ virtual void removeProperty(Property *property);
+ /**Removes property with the given name from the list.
+ Emits @ref aboutToDeleteProperty before removing.*/
+ virtual void removeProperty(const QString &name);
+
+ /**@return the list of grouped properties.*/
+ virtual const QValueList<QPair<QString, QValueList<QString> > >& propertiesOfGroup() const;
+ /**@return the map: property - group name.*/
+ virtual const QMap<MultiProperty*, QString>& groupOfProperty() const;
+
+ /**Clears the list of properties.*/
+ virtual void clear();
+ /**Returns true if the list of properties contains property with given name.*/
+ virtual bool contains(const QString &name);
+
+ /**The list of properties with given name.*/
+ QPtrList<Property> properties(const QString &name);
+
+ Iterator begin();
+ Iterator end();
+
+signals:
+ /**Emitted when the value of the property is changed.*/
+ void propertyValueChanged(Property* property);
+ /**Emitted when property is about to be deleted.*/
+ void aboutToDeleteProperty(Property* property);
+
+protected:
+ /**Constructs a list which owns or does not own it's properties.*/
+ PropertyList(bool propertyOwner);
+
+ /**Adds property to a group.*/
+ void addToGroup(const QString &group, MultiProperty *property);
+ /**Removes property from a group.*/
+ void removeFromGroup(MultiProperty *property);
+
+private:
+ //sorted list of properties in form name: property
+ QMap<QString, MultiProperty*> m_list;
+
+ //groups of properties:
+ // list of group name: (list of property names)
+ QValueList<QPair<QString, QValueList<QString> > > m_propertiesOfGroup;
+ // map of property: group
+ QMap<MultiProperty*, QString> m_groupOfProperty;
+
+ //indicates that this list will delete properties after removeProperty()
+ //and also in destructor
+ bool m_propertyOwner;
+
+friend class MultiProperty;
+friend class PropertyBuffer;
+friend class Iterator;
+};
+
+
+/**
+@short The list of properties which does not own them.
+
+This class acts as @ref PropertyLib::PropertyList but it does not delete properties
+in destructor (i.e. it does not own properties).
+This class should be used to store results of property intersections.
+
+Example:
+/code
+PropertyList *list = new PropertyList();
+PropertyList *list2 = new PropertyList();
+PropertyList *list3 = new PropertyList();
+...
+PropertyBuffer *buf = new PropertyBuffer(list);
+buf->intersect(list2);
+buf->intersect(list3);
+...
+/endcode
+*/
+class PropertyBuffer: public PropertyList{
+ Q_OBJECT
+public:
+ /**Constructs a buffer from given property list.*/
+ PropertyBuffer(PropertyList *list);
+ /**Constructs an empty property buffer.*/
+ PropertyBuffer();
+
+ /**Intersects with other @ref PropertyLib::PropertyList.*/
+ virtual void intersect(const PropertyList *list);
+
+protected slots:
+ void intersectedValueChanged(Property *property);
+
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/propertymachinefactory.cpp b/lib/widgets/propeditor/propertymachinefactory.cpp
new file mode 100644
index 00000000..222aa930
--- /dev/null
+++ b/lib/widgets/propeditor/propertymachinefactory.cpp
@@ -0,0 +1,207 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "propertymachinefactory.h"
+
+#ifndef PURE_QT
+#include <klocale.h>
+#else
+#define i18n QObject::tr
+#endif
+
+#include <qmap.h>
+
+#include "property.h"
+#include "childproperty.h"
+#include "multiproperty.h"
+#include "plineedit.h"
+#include "pspinbox.h"
+#include "pdoublenuminput.h"
+#include "pcheckbox.h"
+#include "pstringlistedit.h"
+#include "pdummywidget.h"
+#include "pcombobox.h"
+#include "psymbolcombo.h"
+#include "pfontcombo.h"
+#include "psizeedit.h"
+#include "pdateedit.h"
+#include "pdatetimeedit.h"
+#include "ppointedit.h"
+#include "prectedit.h"
+#include "psizepolicyedit.h"
+#include "pcolorbutton.h"
+#include "pyesnobutton.h"
+#include "ppixmapedit.h"
+#include "pcursoredit.h"
+#include "plinestyleedit.h"
+#include "purledit.h"
+
+
+#ifndef PURE_QT
+#include "pfontbutton.h"
+#include "pcolorcombo.h"
+#endif
+
+namespace PropertyLib{
+
+PropertyMachineFactory *PropertyMachineFactory::m_factory = 0;
+
+PropertyMachineFactory::PropertyMachineFactory()
+{
+}
+
+PropertyMachineFactory::~PropertyMachineFactory()
+{
+}
+
+Machine *PropertyMachineFactory::machineForProperty(MultiProperty *property)
+{
+ int type = property->type();
+ QString propertyName = property->name();
+ QMap<QString, QVariant> valueList = property->valueList();
+
+ if (m_registeredForType.contains(propertyName))
+ return (*m_registeredForType[propertyName])();
+
+ switch (type)
+ {
+ case Property::String:
+ return new Machine(new PLineEdit(property));
+ case Property::Integer:
+ return new Machine(new PSpinBox(property));
+ case Property::Boolean:
+ return new Machine(new PYesNoButton(property));
+ case Property::Date:
+ return new Machine(new PDateEdit(property));
+ case Property::DateTime:
+ return new Machine(new PDateTimeEdit(property));
+ case Property::StringList:
+ return new Machine(new PStringListEdit(property));
+ case Property::Color:
+ return new Machine(new PColorButton(property));
+#ifndef PURE_QT
+ case Property::Font:
+ return new Machine(new PFontButton(property));
+#endif
+ case Property::FileURL:
+ return new Machine(new PUrlEdit(PUrlEdit::File, property));
+ case Property::DirectoryURL:
+ return new Machine(new PUrlEdit(PUrlEdit::Directory, property));
+
+ case Property::Double:
+ return new Machine(new PDoubleNumInput(property));
+ case Property::Pixmap:
+ return new Machine(new PPixmapEdit(property));
+
+ case Property::ValueFromList:
+ return new Machine(new PComboBox(property, valueList));
+ case Property::Symbol:
+ return new Machine(new PSymbolCombo(property));
+ case Property::FontName:
+ return new Machine(new PFontCombo(property));
+ case Property::LineStyle:
+ return new Machine(new PLineStyleEdit(property));
+
+ case Property::Size:
+ {
+ Machine *mach = new Machine(new PSizeEdit(property));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Size_Width, i18n("Width"), i18n("Width")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Size_Height, i18n("Height"), i18n("Height")));
+ return mach;
+ }
+ case Property::Point:
+ {
+ Machine *mach = new Machine(new PPointEdit(property));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Point_X, i18n("x"), i18n("x")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Point_Y, i18n("y"), i18n("y")));
+ return mach;
+ }
+ case Property::Rect:
+ {
+ Machine *mach = new Machine(new PRectEdit(property));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Rect_X, i18n("x"), i18n("x")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Rect_Y, i18n("y"), i18n("y")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Rect_Width, i18n("Width"), i18n("Width")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::Rect_Height, i18n("Height"), i18n("Height")));
+ return mach;
+ }
+ case Property::SizePolicy:
+ {
+ QMap<QString, QVariant> spValues;
+ spValues[i18n("Fixed")] = QSizePolicy::Fixed;
+ spValues[i18n("Minimum")] = QSizePolicy::Minimum;
+ spValues[i18n("Maximum")] = QSizePolicy::Maximum;
+ spValues[i18n("Preferred")] = QSizePolicy::Preferred;
+ spValues[i18n("Expanding")] = QSizePolicy::Expanding;
+ spValues[i18n("Minimum Expanding")] = QSizePolicy::MinimumExpanding;
+ spValues[i18n("Ignored")] = QSizePolicy::Ignored;
+
+ Machine *mach = new Machine(new PSizePolicyEdit(property, spValues));
+ property->details.append(ChildProperty(property, i18n("hSizeType"), ChildProperty::SizePolicy_HorData, spValues, i18n("Horizontal Size Type")));
+ property->details.append(ChildProperty(property, i18n("vSizeType"), ChildProperty::SizePolicy_VerData, spValues, i18n("Vertical Size Type")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::SizePolicy_HorStretch, i18n("hStretch"), i18n("Horizontal Stretch")));
+ property->details.append(ChildProperty(property, Property::Integer, ChildProperty::SizePolicy_VerStretch, i18n("vStretch"), i18n("Vertical Stretch")));
+ return mach;
+ }
+ case Property::Cursor:
+ {
+ QMap<QString, QVariant> spValues;
+ spValues[i18n("Arrow")] = Qt::ArrowCursor;
+ spValues[i18n("Up Arrow")] = Qt::UpArrowCursor;
+ spValues[i18n("Cross")] = Qt::CrossCursor;
+ spValues[i18n("Waiting")] = Qt::WaitCursor;
+ spValues[i18n("iBeam")] = Qt::IbeamCursor;
+ spValues[i18n("Size Vertical")] = Qt::SizeVerCursor;
+ spValues[i18n("Size Horizontal")] = Qt::SizeHorCursor;
+ spValues[i18n("Size Slash")] = Qt::SizeBDiagCursor;
+ spValues[i18n("Size Backslash")] = Qt::SizeFDiagCursor;
+ spValues[i18n("Size All")] = Qt::SizeAllCursor;
+ spValues[i18n("Blank")] = Qt::BlankCursor;
+ spValues[i18n("Split Vertical")] = Qt::SplitVCursor;
+ spValues[i18n("Split Horizontal")] = Qt::SplitHCursor;
+ spValues[i18n("Pointing Hand")] = Qt::PointingHandCursor;
+ spValues[i18n("Forbidden")] = Qt::ForbiddenCursor;
+ spValues[i18n("What's this")] = Qt::WhatsThisCursor;
+ Machine *mach = new Machine(new PCursorEdit(property, spValues));
+ return mach;
+ }
+
+ case Property::List:
+ case Property::Map:
+ default:
+ return new Machine(new PDummyWidget(property));
+ }
+}
+
+PropertyMachineFactory *PropertyMachineFactory::getInstance()
+{
+ if (m_factory == 0)
+ m_factory = new PropertyMachineFactory();
+ return m_factory;
+}
+
+bool PropertyMachineFactory::hasDetailedEditors( int type )
+{
+ if ( (type==Property::Size) || (type==Property::Point) ||
+ (type==Property::Rect) || (type==Property::SizePolicy) )
+ return true;
+ return 0;
+}
+
+}
diff --git a/lib/widgets/propeditor/propertymachinefactory.h b/lib/widgets/propeditor/propertymachinefactory.h
new file mode 100644
index 00000000..fe776b63
--- /dev/null
+++ b/lib/widgets/propeditor/propertymachinefactory.h
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYMACHINEFACTORY_H
+#define PROPERTYMACHINEFACTORY_H
+
+#include <qmap.h>
+
+#include "propertywidget.h"
+
+class QWidget;
+
+namespace PropertyLib{
+
+class Property;
+class MultiProperty;
+class ChildProperty;
+
+/** @file propertymachinefactory.h
+@short Contains @ref PropertyLib::PropertyMachineFactory class and @ref PropertyLib::Machine structure.
+*/
+
+/**
+@short Machine for a property type.
+
+Contains a pointer to a property viewer,
+property editor and a list of detailed property
+editors and viewers.
+*/
+struct Machine{
+ Machine()
+ {
+ }
+ Machine(PropertyWidget *widget)
+ {
+ propertyEditor = widget;
+ }
+ ~Machine()
+ {
+ delete propertyEditor;
+ }
+
+ /**Property viewer and editor widget.*/
+ PropertyWidget *propertyEditor;
+};
+
+/**A pointer to factory function which creates and returns machine for a property.*/
+typedef Machine *(*createMachine)();
+
+/**
+@short Factory to create property editors and property viewers.
+*/
+class PropertyMachineFactory{
+public:
+ /**Registers property editor factory function for a type.
+ This factory functions are considered before defaults
+ when @ref machineForProperty is called.*/
+ void registerEditor(int type, createMachine creator);
+
+ /**Creates and returns the editor for given property type.
+ Warning: editor and viewer widgets won't have parent widget. %Property editor
+ cares about reparenting and deletion of returned widgets in machines.*/
+ Machine *machineForProperty(MultiProperty *property);
+ bool hasDetailedEditors(int type);
+
+ /**@return a pointer to a property machine factory instance.*/
+ static PropertyMachineFactory *getInstance();
+
+ static PropertyMachineFactory *m_factory;
+
+private:
+ PropertyMachineFactory();
+ virtual ~PropertyMachineFactory();
+
+ //registered machines for property types
+ QMap<QString, createMachine > m_registeredForType;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/propertywidget.cpp b/lib/widgets/propeditor/propertywidget.cpp
new file mode 100644
index 00000000..7895acb1
--- /dev/null
+++ b/lib/widgets/propeditor/propertywidget.cpp
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "propertywidget.h"
+
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PropertyWidget::PropertyWidget(MultiProperty *property, QWidget *parent, const char *name)
+ :QWidget(parent, name), m_property(property)
+{
+}
+
+QString PropertyWidget::propertyName() const
+{
+ return m_property->name();
+}
+
+void PropertyWidget::setProperty(MultiProperty *property)
+{
+ m_property = property;
+}
+
+void PropertyWidget::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toString());
+}
+
+void PropertyWidget::setValueList(const QMap<QString, QVariant> &// valueList
+ )
+{
+ //this does nothing
+}
+
+void PropertyWidget::undo()
+{
+ m_property->undo();
+}
+
+}
+
+#ifndef PURE_QT
+#include "propertywidget.moc"
+#endif
diff --git a/lib/widgets/propeditor/propertywidget.h b/lib/widgets/propeditor/propertywidget.h
new file mode 100644
index 00000000..3383a206
--- /dev/null
+++ b/lib/widgets/propeditor/propertywidget.h
@@ -0,0 +1,88 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYWIDGET_H
+#define PROPERTYWIDGET_H
+
+#include <qwidget.h>
+#include <qvariant.h>
+
+/** @file propertywidget.h
+@short Contains @ref PropertyLib::PropertyWidget class.
+*/
+
+#include "multiproperty.h"
+
+namespace PropertyLib{
+
+/**
+@short An abstract base class of property viewer and editor vidget.
+
+Subclass this class to create custom property viewer and editor widget.
+
+Descendants should implement value() and setValue() methods.
+
+Hint: in case you want to implement your property editor widget using
+existing widgets like QLineEdit, QComboBox, etc. you can't use multiple
+inheritance from two QObject descendants due to Qt library restriction.
+Therefore use line edits and combo boxes as child widgets.
+
+A set of predefined widgets for predefined property types are available
+in the library.
+*/
+class PropertyWidget: public QWidget{
+ Q_OBJECT
+public:
+ /**Constructs widget for property with name "propertyName".*/
+ PropertyWidget(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+ virtual ~PropertyWidget() {}
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const = 0;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true) = 0;
+ /**@return the name of edited property.*/
+ virtual QString propertyName() const;
+ /**Sets the name of edited property.*/
+ virtual void setProperty(MultiProperty *property);
+ /**Sets the list of possible values shown in the editor widget. This method
+ does not emit propertyChanged signal.*/
+ virtual void setValueList(const QMap<QString, QVariant> &valueList);
+
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+ /**Reverts the property value to previous setting.*/
+ virtual void undo();
+
+signals:
+ /**Emit this signal when property value is changed. Probably you want
+ to emit it only from @ref setValue() method.
+ @ref PropertyLib::PropertyEditor widget will connect this to the appropriate slot which
+ will make updates to the @ref PropertyLib::PropertyList that hold propeties.*/
+ void propertyChanged(MultiProperty *property, const QVariant &value);
+
+protected:
+ MultiProperty *m_property;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/propertywidgetproxy.cpp b/lib/widgets/propeditor/propertywidgetproxy.cpp
new file mode 100644
index 00000000..35fdc73b
--- /dev/null
+++ b/lib/widgets/propeditor/propertywidgetproxy.cpp
@@ -0,0 +1,106 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "propertywidgetproxy.h"
+
+#include <qlayout.h>
+
+#include "propertywidget.h"
+#include "propertymachinefactory.h"
+
+namespace PropertyLib{
+
+PropertyWidgetProxy::PropertyWidgetProxy(QWidget *parent, const char *name)
+ :QWidget(parent, name), mp(0), m_propertyType(Property::Invalid), m_editor(0)
+{
+ p = new Property();
+ m_layout = new QHBoxLayout(this, 0, 0);
+}
+
+PropertyWidgetProxy::~PropertyWidgetProxy()
+{
+ delete mp;
+ delete p;
+}
+
+void PropertyWidgetProxy::setPropertyType(int propertyType)
+{
+ m_propertyType = static_cast<PropertyType>(propertyType);
+ setWidget();
+}
+
+void PropertyWidgetProxy::setPropertyType2(PropertyType propertyType)
+{
+ m_propertyType = propertyType;
+ setWidget();
+}
+
+void PropertyWidgetProxy::setWidget()
+{
+ if (m_editor)
+ delete m_editor;
+ p->setType(m_propertyType);
+ mp = new MultiProperty(p);
+ m_editor = PropertyMachineFactory::getInstance()->machineForProperty(mp)->propertyEditor;
+ if (m_editor)
+ {
+ m_editor->reparent(this, QPoint(0,0), true);
+ m_layout->addWidget(m_editor);
+ }
+}
+
+QVariant PropertyWidgetProxy::value() const
+{
+ if (m_editor)
+ return m_editor->value();
+ else
+ return QVariant();
+}
+
+void PropertyWidgetProxy::setValue(const QVariant &value)
+{
+ if (m_editor)
+ m_editor->setValue(value, false);
+}
+
+bool PropertyWidgetProxy::setProperty( const char * name, const QVariant & value )
+{
+ if( strcmp( name, "value") == 0 )
+ {
+ setPropertyType((int) value.type() );
+ setValue( value );
+ return true;
+ }
+ else
+ return QWidget::setProperty(name, value);
+}
+
+QVariant PropertyWidgetProxy::property( const char * name ) const
+{
+ if( strcmp( name, "value") == 0 )
+ return value( );
+ else
+ return QWidget::property(name);
+}
+
+}
+
+#ifndef PURE_QT
+#include "propertywidgetproxy.moc"
+#endif
diff --git a/lib/widgets/propeditor/propertywidgetproxy.h b/lib/widgets/propeditor/propertywidgetproxy.h
new file mode 100644
index 00000000..6a88b8b1
--- /dev/null
+++ b/lib/widgets/propeditor/propertywidgetproxy.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROPERTYWIDGETPROXY_H
+#define PROPERTYWIDGETPROXY_H
+
+#include <qwidget.h>
+#include <qvariant.h>
+
+#include "multiproperty.h"
+
+class QHBoxLayout;
+
+namespace PropertyLib{
+
+class PropertyWidget;
+
+#define PropertyType Property::PropertyType
+
+/**
+Property Widget Proxy.
+It is sometimes useful to create single property editor widgets instead of having them
+all in the property editor. Proxy creates an empty widget and shows the property editor
+depending on the property type.
+*/
+class PropertyWidgetProxy: public QWidget
+{
+Q_OBJECT
+Q_PROPERTY( int propertyType READ propertyType WRITE setPropertyType DESIGNABLE true )
+Q_PROPERTY( PropertyType propertyType2 READ propertyType2 WRITE setPropertyType2 DESIGNABLE false )
+public:
+ PropertyWidgetProxy(QWidget *parent = 0, const char *name = 0);
+ ~PropertyWidgetProxy();
+
+ /**Sets the type of a property editor to appear.*/
+ void setPropertyType(int propertyType);
+ int propertyType() const { return m_propertyType; }
+ /**Sets the type of a property editor to appear.*/
+ void setPropertyType2(PropertyType propertyType);
+ PropertyType propertyType2() const { return m_propertyType; }
+
+ QVariant value() const;
+ void setValue(const QVariant &value);
+
+ /**Sets the type of an editor basing on the @p value if the name is "value".
+ Otherwise works as QWidget::setProperty.*/
+ bool setProperty( const char *name, const QVariant &value);
+ QVariant property( const char *name) const;
+
+protected:
+ virtual void setWidget();
+
+private:
+ Property *p;
+ MultiProperty *mp;
+
+ PropertyType m_propertyType;
+ PropertyWidget *m_editor;
+
+ QHBoxLayout *m_layout;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/psizeedit.cpp b/lib/widgets/propeditor/psizeedit.cpp
new file mode 100644
index 00000000..7e322ba5
--- /dev/null
+++ b/lib/widgets/propeditor/psizeedit.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "psizeedit.h"
+
+#include <klineedit.h>
+#include <qlayout.h>
+#include <qpainter.h>
+
+namespace PropertyLib{
+
+PSizeEdit::PSizeEdit(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ m_edit->setReadOnly(true);
+}
+
+QVariant PSizeEdit::value() const
+{
+ return m_value;
+}
+
+void PSizeEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height()));
+}
+
+void PSizeEdit::setValue(const QVariant& value, bool emitChange)
+{
+ m_value = value;
+ m_edit->setText(QString("[ %1, %2 ]").arg(value.toSize().width()).arg(value.toSize().height()));
+
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+}
+
+#ifndef PURE_QT
+#include "psizeedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/psizeedit.h b/lib/widgets/propeditor/psizeedit.h
new file mode 100644
index 00000000..53ea5201
--- /dev/null
+++ b/lib/widgets/propeditor/psizeedit.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PSIZEEDIT_H
+#define PSIZEEDIT_H
+
+#include "propertywidget.h"
+#include "multiproperty.h"
+
+class KLineEdit;
+class QPainter;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QSize values.
+*/
+class PSizeEdit: public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PSizeEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private:
+ KLineEdit *m_edit;
+ QVariant m_value;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/psizepolicyedit.cpp b/lib/widgets/propeditor/psizepolicyedit.cpp
new file mode 100644
index 00000000..d903c95a
--- /dev/null
+++ b/lib/widgets/propeditor/psizepolicyedit.cpp
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "psizepolicyedit.h"
+
+#include <klineedit.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qsizepolicy.h>
+
+namespace PropertyLib{
+
+PSizePolicyEdit::PSizePolicyEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name), m_spValues(spValues)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ m_edit->setReadOnly(true);
+}
+
+QVariant PSizePolicyEdit::value() const
+{
+ return m_value;
+}
+
+void PSizePolicyEdit::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch()));
+}
+
+void PSizePolicyEdit::setValue(const QVariant& value, bool emitChange)
+{
+ m_value = value;
+ m_edit->setText(QString("%1/%2/%3/%4").arg(findValueDescription(value.toSizePolicy().horData())).arg(findValueDescription(value.toSizePolicy().verData())).arg(value.toSizePolicy().horStretch()).arg(value.toSizePolicy().verStretch()));
+
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+QString PSizePolicyEdit::findValueDescription(QVariant val) const
+{
+// qWarning("PSizePolicyEdit::findValueDescription : %d", val.toInt());
+ for (QMap<QString, QVariant>::const_iterator it = m_spValues.begin(); it != m_spValues.end(); ++ it)
+ {
+ if (it.data() == val)
+ return it.key();
+ }
+ return "";
+}
+
+}
+
+#ifndef PURE_QT
+#include "psizepolicyedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/psizepolicyedit.h b/lib/widgets/propeditor/psizepolicyedit.h
new file mode 100644
index 00000000..42651eac
--- /dev/null
+++ b/lib/widgets/propeditor/psizepolicyedit.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PSIZEPOLICYEDIT_H
+#define PSIZEPOLICYEDIT_H
+
+#include "propertywidget.h"
+
+#include <qmap.h>
+
+class KLineEdit;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor for QSizePolicy values.
+*/
+class PSizePolicyEdit : public PropertyWidget
+{
+Q_OBJECT
+public:
+ PSizePolicyEdit(MultiProperty* property, const QMap<QString, QVariant> &spValues, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+ QString findValueDescription(QVariant val) const;
+
+private:
+ KLineEdit *m_edit;
+ QVariant m_value;
+ QMap<QString, QVariant> m_spValues;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pspinbox.cpp b/lib/widgets/propeditor/pspinbox.cpp
new file mode 100644
index 00000000..2e83f66c
--- /dev/null
+++ b/lib/widgets/propeditor/pspinbox.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pspinbox.h"
+
+#include <limits.h>
+
+#include <qspinbox.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PSpinBox::PSpinBox(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QSpinBox(INT_MIN, INT_MAX, 1, this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+}
+
+PSpinBox::PSpinBox(MultiProperty *property, int minValue, int maxValue, int step, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QSpinBox(minValue, maxValue, step, this);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+}
+
+QVariant PSpinBox::value() const
+{
+ return QVariant(m_edit->cleanText().toInt());
+}
+
+void PSpinBox::setValue(const QVariant &value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+ m_edit->setValue(value.toInt());
+ connect(m_edit, SIGNAL(valueChanged(int)), this, SLOT(updateProperty(int)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PSpinBox::updateProperty(int val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pspinbox.moc"
+#endif
diff --git a/lib/widgets/propeditor/pspinbox.h b/lib/widgets/propeditor/pspinbox.h
new file mode 100644
index 00000000..1ca839b8
--- /dev/null
+++ b/lib/widgets/propeditor/pspinbox.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PSPINBOX_H
+#define PSPINBOX_H
+
+#include "propertywidget.h"
+
+class QSpinBox;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with integer num input box.
+*/
+class PSpinBox: public PropertyWidget{
+ Q_OBJECT
+public:
+ PSpinBox(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+ PSpinBox(MultiProperty *property, int minValue, int maxValue, int step = 1, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+
+private slots:
+ void updateProperty(int val);
+
+private:
+ QSpinBox *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pstringlistedit.cpp b/lib/widgets/propeditor/pstringlistedit.cpp
new file mode 100644
index 00000000..227050f9
--- /dev/null
+++ b/lib/widgets/propeditor/pstringlistedit.cpp
@@ -0,0 +1,121 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pstringlistedit.h"
+
+#include <qlayout.h>
+#include <qdialog.h>
+#include <qpainter.h>
+#include <klineedit.h>
+
+#ifndef PURE_QT
+#include <keditlistbox.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
+#else
+#include "qeditlistbox.h"
+#include <qpushbutton.h>
+#include "compat_tools.h"
+#endif
+
+namespace PropertyLib{
+
+PStringListEdit::PStringListEdit(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ l = new QHBoxLayout(this);
+
+ edit = new KLineEdit(this);
+ edit->setReadOnly(true);
+ edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(edit);
+ pbSelect = new QPushButton("...", this);
+ pbSelect->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
+ l->addWidget(pbSelect);
+
+ connect(pbSelect, SIGNAL(clicked()), this, SLOT(showEditor()));
+}
+
+QVariant PStringListEdit::value() const
+{
+ return QVariant(m_list);
+}
+
+void PStringListEdit::setValue(const QVariant &value, bool emitChange)
+{
+ m_list = value.toStringList();
+ edit->setText(value.toStringList().join(", "));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PStringListEdit::showEditor()
+{
+ QDialog* dia = new QDialog(this, "stringlist_dialog", true);
+ QVBoxLayout *dv = new QVBoxLayout(dia, 2);
+
+#ifdef PURE_QT
+ QEditListBox *select = new QEditListBox(dia, "select_char");
+#else
+ KEditListBox *select = new KEditListBox(dia, "select_char");
+#endif
+ dv->addWidget(select);
+
+ QHBoxLayout *dh = new QHBoxLayout(dv, 6);
+#ifndef PURE_QT
+ KPushButton *pbOk = new KPushButton(KStdGuiItem::ok(), dia);
+ KPushButton *pbCancel = new KPushButton(KStdGuiItem::cancel(), dia);
+#else
+ QPushButton *pbOk = new QPushButton(i18n("Ok"), dia);
+ QPushButton *pbCancel = new QPushButton(i18n("Cancel"), dia);
+#endif
+ QSpacerItem *si = new QSpacerItem(30, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ connect(pbOk, SIGNAL(clicked()), dia, SLOT(accept()));
+ connect(pbCancel, SIGNAL(clicked()), dia, SLOT(reject()));
+
+ dh->addItem(si);
+ dh->addWidget(pbOk);
+ dh->addWidget(pbCancel);
+
+ select->insertStringList(m_list);
+
+ if (dia->exec() == QDialog::Accepted)
+ {
+ m_list = select->items();
+ edit->setText(select->items().join(", "));
+ }
+ delete dia;
+
+ emit propertyChanged(m_property, m_list);
+}
+
+void PStringListEdit::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+{
+ p->setPen(Qt::NoPen);
+ p->setBrush(cg.background());
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, value.toStringList().join(", "));
+}
+
+}
+
+#ifndef PURE_QT
+#include "pstringlistedit.moc"
+#endif
diff --git a/lib/widgets/propeditor/pstringlistedit.h b/lib/widgets/propeditor/pstringlistedit.h
new file mode 100644
index 00000000..25d6db19
--- /dev/null
+++ b/lib/widgets/propeditor/pstringlistedit.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PSTRINGLISTEDIT_H
+#define PSTRINGLISTEDIT_H
+
+#include "propertywidget.h"
+
+
+class KLineEdit;
+class QPushButton;
+class QHBoxLayout;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with string list editor.
+*/
+class PStringListEdit: public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PStringListEdit(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+private slots:
+ void showEditor();
+
+private:
+ QPushButton *pbSelect;
+ QHBoxLayout *l;
+ KLineEdit *edit;
+
+ QStringList m_list;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/psymbolcombo.cpp b/lib/widgets/propeditor/psymbolcombo.cpp
new file mode 100644
index 00000000..70dd7ba9
--- /dev/null
+++ b/lib/widgets/propeditor/psymbolcombo.cpp
@@ -0,0 +1,131 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+#include <klineedit.h>
+
+#ifndef PURE_QT
+#include <kcharselect.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
+#include <qdialog.h>
+#endif
+
+#include "psymbolcombo.h"
+
+namespace PropertyLib{
+
+PSymbolCombo::PSymbolCombo(MultiProperty *property, QWidget *parent, const char *name)
+ :PropertyWidget(property, parent, name)
+{
+ l = new QHBoxLayout(this);
+ m_edit = new KLineEdit(this);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ m_edit->setMaxLength(1);
+ l->addWidget(m_edit);
+ m_select = new QPushButton("...", this);
+ m_select->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_select);
+
+#ifdef PURE_QT
+ m_select->hide();
+#endif
+
+ connect(m_select, SIGNAL(clicked()), this, SLOT(selectChar()));
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+}
+
+QVariant PSymbolCombo::value() const
+{
+ if (!(m_edit->text().isNull()))
+ return QVariant(QString("%1").arg(m_edit->text().at(0).unicode()));
+ else
+ return QVariant(0);
+}
+
+void PSymbolCombo::setValue(const QVariant &value, bool emitChange)
+{
+#if QT_VERSION >= 0x030100
+ if (!(value.isNull()))
+#else
+ if (value.canCast(QVariant::Int))
+#endif
+ {
+ disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ m_edit->setText(QChar(value.toInt()));
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+ }
+}
+
+void PSymbolCombo::selectChar()
+{
+#ifndef PURE_QT
+ QDialog* dia = new QDialog(this, "select_dialog", true);
+ QVBoxLayout *dv = new QVBoxLayout(dia, 2);
+
+ KCharSelect *select = new KCharSelect(dia, "select_char");
+ dv->addWidget(select);
+
+ QHBoxLayout *dh = new QHBoxLayout(dv, 6);
+ KPushButton *pbOk = new KPushButton(KStdGuiItem::ok(), dia);
+ KPushButton *pbCancel = new KPushButton(KStdGuiItem::cancel(), dia);
+ QSpacerItem *si = new QSpacerItem(30, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ connect(pbOk, SIGNAL(clicked()), dia, SLOT(accept()));
+ connect(pbCancel, SIGNAL(clicked()), dia, SLOT(reject()));
+
+ dh->addItem(si);
+ dh->addWidget(pbOk);
+ dh->addWidget(pbCancel);
+
+ if (!(m_edit->text().isNull()))
+ select->setChar(m_edit->text().at(0));
+
+ if (dia->exec() == QDialog::Accepted)
+ {
+ m_edit->setText(select->chr());
+ }
+ delete dia;
+#endif
+}
+
+void PSymbolCombo::updateProperty(const QString& val)
+{
+ emit propertyChanged(m_property, QVariant(QString("%1").arg(val.at(0).unicode())));
+}
+
+void PSymbolCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+{
+ p->setBrush(cg.background());
+ p->setPen(Qt::NoPen);
+ p->drawRect(r);
+ p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QChar(value.toInt()));
+}
+
+}
+
+#ifndef PURE_QT
+#include "psymbolcombo.moc"
+#endif
diff --git a/lib/widgets/propeditor/psymbolcombo.h b/lib/widgets/propeditor/psymbolcombo.h
new file mode 100644
index 00000000..fd6e57ec
--- /dev/null
+++ b/lib/widgets/propeditor/psymbolcombo.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2002-2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PSYMBOLCOMBO_H
+#define PSYMBOLCOMBO_H
+
+#include "propertywidget.h"
+
+class KLineEdit;
+class QPushButton;
+class QHBoxLayout;
+
+namespace PropertyLib{
+
+
+/**
+@short %Property editor with char selector.
+*/
+class PSymbolCombo: public PropertyWidget{
+ Q_OBJECT
+public:
+ PSymbolCombo(MultiProperty *property, QWidget *parent = 0, const char *name = 0);
+
+ /**@return the value currently entered in the editor widget.*/
+ virtual QVariant value() const;
+ /**Sets the value shown in the editor widget. Set emitChange to false
+ if you don't want to emit propertyChanged signal.*/
+ virtual void setValue(const QVariant &value, bool emitChange=true);
+ /**Function to draw a property viewer when the editor isn't shown.*/
+ virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
+
+public slots:
+ void selectChar();
+
+private slots:
+ void updateProperty(const QString &val);
+
+private:
+ KLineEdit *m_edit;
+ QPushButton *m_select;
+ QHBoxLayout *l;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/purledit.cpp b/lib/widgets/propeditor/purledit.cpp
new file mode 100644
index 00000000..9d90273a
--- /dev/null
+++ b/lib/widgets/propeditor/purledit.cpp
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "purledit.h"
+
+#ifndef PURE_QT
+#include <kurlrequester.h>
+#else
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#endif
+#include <qfiledialog.h>
+#include <qlayout.h>
+
+namespace PropertyLib{
+
+PUrlEdit::PUrlEdit(Mode mode, MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+#ifndef PURE_QT
+ m_edit = new KURLRequester(this);
+ l->addWidget(m_edit);
+ m_edit->setMode((KFile::Mode)mode);
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+#else
+ m_edit = new KLineEdit(this);
+ m_select = new QPushButton("...",this);
+ l->addWidget(m_edit);
+ l->addWidget(m_select);
+ m_mode = mode;
+ connect( m_select, SIGNAL(clicked()),this,SLOT(select()));
+#endif
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+}
+
+QVariant PUrlEdit::value() const
+{
+#ifndef PURE_QT
+ return QVariant(m_edit->url());
+#else
+ return QVariant(m_url);
+#endif
+}
+
+void PUrlEdit::setValue(const QVariant& value, bool emitChange)
+{
+#ifndef PURE_QT
+ disconnect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+ m_edit->setURL(value.toString());
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(updateProperty(const QString&)));
+#else
+ m_edit->setText(value.toString());
+#endif
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PUrlEdit::updateProperty(const QString &val)
+{
+ emit propertyChanged(m_property, QVariant(val));
+}
+
+void PUrlEdit::select()
+{
+#ifdef PURE_QT
+ QString path = m_url;
+ if( m_mode == Directory )
+ m_url = QFileDialog::getExistingDirectory( m_url,this);
+ else
+ m_url = QFileDialog::getOpenFileName(m_url, QString::null, this);
+ updateProperty(m_url);
+ m_edit->setText(m_url);
+#endif
+}
+
+}
+
+#ifndef PURE_QT
+#include "purledit.moc"
+#endif
diff --git a/lib/widgets/propeditor/purledit.h b/lib/widgets/propeditor/purledit.h
new file mode 100644
index 00000000..5da0108d
--- /dev/null
+++ b/lib/widgets/propeditor/purledit.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PURLEDIT_H
+#define PURLEDIT_H
+
+#include "propertywidget.h"
+
+#ifndef PURE_QT
+#include <kfile.h>
+class KURLRequester;
+#else
+#include <klineedit.h>
+class QPushButton;
+#endif
+
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with an url editor to choose the location of file or directory.
+*/
+class PUrlEdit : public PropertyWidget
+{
+Q_OBJECT
+public:
+#ifndef PURE_QT
+ enum Mode {File = KFile::File,Directory = KFile::Directory};
+#else
+ enum Mode {File,Directory};
+#endif
+
+ PUrlEdit(Mode mode, MultiProperty* property, QWidget* parent=0, const char* name=0);
+
+ virtual QVariant value() const;
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+private slots:
+ void updateProperty(const QString &val);
+ void select();
+private:
+#ifndef PURE_QT
+ KURLRequester *m_edit;
+#else
+ KLineEdit *m_edit;
+ QPushButton *m_select;
+ QString m_url;
+ Mode m_mode;
+#endif
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/pyesnobutton.cpp b/lib/widgets/propeditor/pyesnobutton.cpp
new file mode 100644
index 00000000..c27f4a60
--- /dev/null
+++ b/lib/widgets/propeditor/pyesnobutton.cpp
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pyesnobutton.h"
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpushbutton.h>
+
+#ifndef PURE_QT
+#include <klocale.h>
+#else
+#include "compat_tools.h"
+#endif
+
+namespace PropertyLib{
+
+PYesNoButton::PYesNoButton(MultiProperty* property, QWidget* parent, const char* name)
+ :PropertyWidget(property, parent, name)
+{
+ QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ m_edit = new QPushButton(this);
+ m_edit->setToggleButton(true);
+ m_edit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+ l->addWidget(m_edit);
+
+ connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+}
+
+QVariant PYesNoButton::value() const
+{
+ return QVariant(m_edit->isOn());
+}
+
+void PYesNoButton::drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value)
+{
+ PropertyWidget::drawViewer(p, cg, r, value.toBool() ? i18n("Yes") : i18n("No"));
+}
+
+void PYesNoButton::setValue(const QVariant& value, bool emitChange)
+{
+ disconnect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+ m_edit->setDown(value.toBool());
+ value.toBool() ? m_edit->setText(i18n("Yes")) : m_edit->setText(i18n("No"));
+ connect(m_edit, SIGNAL(toggled(bool)), this, SLOT(updateProperty(bool)));
+ if (emitChange)
+ emit propertyChanged(m_property, value);
+}
+
+void PYesNoButton::updateProperty(bool toggled)
+{
+ toggled ? m_edit->setText(i18n("Yes")) : m_edit->setText(i18n("No"));
+ emit propertyChanged(m_property, value());
+}
+
+}
+
+#ifndef PURE_QT
+#include "pyesnobutton.moc"
+#endif
diff --git a/lib/widgets/propeditor/pyesnobutton.h b/lib/widgets/propeditor/pyesnobutton.h
new file mode 100644
index 00000000..f0596a8f
--- /dev/null
+++ b/lib/widgets/propeditor/pyesnobutton.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mskat.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PYESNOBUTTON_H
+#define PYESNOBUTTON_H
+
+#include <propertywidget.h>
+
+class QPushButton;
+
+namespace PropertyLib{
+
+/**
+@short %Property editor with yes-no button to edit boolean values.
+*/
+class PYesNoButton : public PropertyWidget
+{
+ Q_OBJECT
+public:
+ PYesNoButton(MultiProperty* property, QWidget* parent = 0, const char* name = 0);
+
+ virtual QVariant value() const;
+ virtual void drawViewer(QPainter* p, const QColorGroup& cg, const QRect& r, const QVariant& value);
+ virtual void setValue(const QVariant& value, bool emitChange);
+
+protected slots:
+ void updateProperty(bool toggled);
+
+private:
+ QPushButton *m_edit;
+};
+
+}
+
+#endif
diff --git a/lib/widgets/propeditor/qeditlistbox.cpp b/lib/widgets/propeditor/qeditlistbox.cpp
new file mode 100644
index 00000000..e9b17d54
--- /dev/null
+++ b/lib/widgets/propeditor/qeditlistbox.cpp
@@ -0,0 +1,401 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org>
+ 2000, 2002 Carsten Pfeiffer <pfeiffer@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "qeditlistbox.h"
+
+#include "compat_tools.h"
+
+#include <klineedit.h>
+
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qlistbox.h>
+#include <qwhatsthis.h>
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qapplication.h>
+#include <qstringlist.h>
+
+#include <assert.h>
+
+//same as kdialog.cpp ones
+#define MarginSize 11
+#define SpazingSize 6
+
+class QEditListBoxPrivate
+{
+public:
+ bool m_checkAtEntering;
+ int buttons;
+};
+
+QEditListBox::QEditListBox(QWidget *parent, const char *name,
+ bool checkAtEntering, int buttons )
+ :QGroupBox(parent, name )
+{
+ init( checkAtEntering, buttons );
+}
+
+QEditListBox::QEditListBox(const QString& title, QWidget *parent,
+ const char *name, bool checkAtEntering, int buttons)
+ :QGroupBox(title, parent, name )
+{
+ init( checkAtEntering, buttons );
+}
+
+QEditListBox::QEditListBox(const QString& title, const CustomEditor& custom,
+ QWidget *parent, const char *name,
+ bool checkAtEntering, int buttons)
+ :QGroupBox(title, parent, name )
+{
+ m_lineEdit = custom.lineEdit();
+ init( checkAtEntering, buttons, custom.representationWidget() );
+}
+
+QEditListBox::~QEditListBox()
+{
+ delete d;
+ d=0;
+}
+
+void QEditListBox::init( bool checkAtEntering, int buttons,
+ QWidget *representationWidget )
+{
+ d=new QEditListBoxPrivate;
+ d->m_checkAtEntering=checkAtEntering;
+ d->buttons = buttons;
+
+ int lostButtons = 0;
+ if ( (buttons & Add) == 0 )
+ lostButtons++;
+ if ( (buttons & Remove) == 0 )
+ lostButtons++;
+ if ( (buttons & UpDown) == 0 )
+ lostButtons += 2;
+
+
+ servNewButton = servRemoveButton = servUpButton = servDownButton = 0L;
+ setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,
+ QSizePolicy::MinimumExpanding));
+
+ QWidget * gb = this;
+ QGridLayout * grid = new QGridLayout(gb, 7 - lostButtons, 2,
+ MarginSize,
+ SpazingSize);
+ grid->addRowSpacing(0, fontMetrics().lineSpacing());
+ for ( int i = 1; i < 7 - lostButtons; i++ )
+ grid->setRowStretch(i, 1);
+
+ grid->setMargin(15);
+
+ if ( representationWidget )
+ representationWidget->reparent( gb, QPoint(0,0) );
+ else
+ m_lineEdit=new KLineEdit(gb);
+
+ m_listBox = new QListBox(gb);
+
+ QWidget *editingWidget = representationWidget ?
+ representationWidget : m_lineEdit;
+ grid->addMultiCellWidget(editingWidget,1,1,0,1);
+ grid->addMultiCellWidget(m_listBox, 2, 6 - lostButtons, 0, 0);
+ int row = 2;
+ if ( buttons & Add ) {
+ servNewButton = new QPushButton(i18n("&Add"), gb);
+ servNewButton->setEnabled(false);
+ connect(servNewButton, SIGNAL(clicked()), SLOT(addItem()));
+
+ grid->addWidget(servNewButton, row++, 1);
+ }
+
+ if ( buttons & Remove ) {
+ servRemoveButton = new QPushButton(i18n("&Remove"), gb);
+ servRemoveButton->setEnabled(false);
+ connect(servRemoveButton, SIGNAL(clicked()), SLOT(removeItem()));
+
+ grid->addWidget(servRemoveButton, row++, 1);
+ }
+
+ if ( buttons & UpDown ) {
+ servUpButton = new QPushButton(i18n("Move &Up"), gb);
+ servUpButton->setEnabled(false);
+ connect(servUpButton, SIGNAL(clicked()), SLOT(moveItemUp()));
+
+ servDownButton = new QPushButton(i18n("Move &Down"), gb);
+ servDownButton->setEnabled(false);
+ connect(servDownButton, SIGNAL(clicked()), SLOT(moveItemDown()));
+
+ grid->addWidget(servUpButton, row++, 1);
+ grid->addWidget(servDownButton, row++, 1);
+ }
+
+ connect(m_lineEdit,SIGNAL(textChanged(const QString&)),this,SLOT(typedSomething(const QString&)));
+
+ connect(m_lineEdit,SIGNAL(returnPressed()),this,SLOT(addItem()));
+ connect(m_listBox, SIGNAL(highlighted(int)), SLOT(enableMoveButtons(int)));
+
+ // maybe supplied lineedit has some text already
+ typedSomething( m_lineEdit->text() );
+}
+
+void QEditListBox::typedSomething(const QString& text)
+{
+ if(currentItem() >= 0) {
+ if(currentText() != m_lineEdit->text())
+ {
+ // IMHO changeItem() shouldn't do anything with the value
+ // of currentItem() ... like changing it or emitting signals ...
+ // but TT disagree with me on this one (it's been that way since ages ... grrr)
+ bool block = m_listBox->signalsBlocked();
+ m_listBox->blockSignals( true );
+ m_listBox->changeItem(text, currentItem());
+ m_listBox->blockSignals( block );
+ emit changed();
+ }
+ }
+
+ if ( !servNewButton )
+ return;
+
+ if (!d->m_checkAtEntering)
+ servNewButton->setEnabled(!text.isEmpty());
+ else
+ {
+ if (text.isEmpty())
+ {
+ servNewButton->setEnabled(false);
+ }
+ else
+ {
+ StringComparisonMode mode = (StringComparisonMode) (ExactMatch | CaseSensitive );
+ bool enable = (m_listBox->findItem( text, mode ) == 0L);
+ servNewButton->setEnabled( enable );
+ }
+ }
+}
+
+void QEditListBox::moveItemUp()
+{
+ if (!m_listBox->isEnabled())
+ {
+ qDebug("beep");
+ return;
+ }
+
+ unsigned int selIndex = m_listBox->currentItem();
+ if (selIndex == 0)
+ {
+ qDebug("beep");
+ return;
+ }
+
+ QListBoxItem *selItem = m_listBox->item(selIndex);
+ m_listBox->takeItem(selItem);
+ m_listBox->insertItem(selItem, selIndex-1);
+ m_listBox->setCurrentItem(selIndex - 1);
+
+ emit changed();
+}
+
+void QEditListBox::moveItemDown()
+{
+ if (!m_listBox->isEnabled())
+ {
+ qDebug("beep");
+ return;
+ }
+
+ unsigned int selIndex = m_listBox->currentItem();
+ if (selIndex == m_listBox->count() - 1)
+ {
+ qDebug("beep");
+ return;
+ }
+
+ QListBoxItem *selItem = m_listBox->item(selIndex);
+ m_listBox->takeItem(selItem);
+ m_listBox->insertItem(selItem, selIndex+1);
+ m_listBox->setCurrentItem(selIndex + 1);
+
+ emit changed();
+}
+
+void QEditListBox::addItem()
+{
+ // when m_checkAtEntering is true, the add-button is disabled, but this
+ // slot can still be called through Key_Return/Key_Enter. So we guard
+ // against this.
+ if ( !servNewButton || !servNewButton->isEnabled() )
+ return;
+
+ const QString& currentTextLE=m_lineEdit->text();
+ bool alreadyInList(false);
+ //if we didn't check for dupes at the inserting we have to do it now
+ if (!d->m_checkAtEntering)
+ {
+ // first check current item instead of dumb iterating the entire list
+ if ( m_listBox->currentText() == currentTextLE )
+ alreadyInList = true;
+ else
+ {
+ StringComparisonMode mode = (StringComparisonMode) (ExactMatch | CaseSensitive );
+ alreadyInList =(m_listBox->findItem(currentTextLE, mode) != 0);
+ }
+ }
+
+ if ( servNewButton )
+ servNewButton->setEnabled(false);
+
+ bool block = m_lineEdit->signalsBlocked();
+ m_lineEdit->blockSignals(true);
+ m_lineEdit->clear();
+ m_lineEdit->blockSignals(block);
+
+ m_listBox->setSelected(currentItem(), false);
+
+ if (!alreadyInList)
+ {
+ block = m_listBox->signalsBlocked();
+ m_listBox->blockSignals( true );
+ m_listBox->insertItem(currentTextLE);
+ m_listBox->blockSignals( block );
+ emit changed();
+ emit added( currentTextLE );
+ }
+}
+
+int QEditListBox::currentItem() const
+{
+ int nr = m_listBox->currentItem();
+ if(nr >= 0 && !m_listBox->item(nr)->isSelected()) return -1;
+ return nr;
+}
+
+void QEditListBox::removeItem()
+{
+ int selected = m_listBox->currentItem();
+
+ if ( selected >= 0 )
+ {
+ QString removedText = m_listBox->currentText();
+
+ m_listBox->removeItem( selected );
+ if ( count() > 0 )
+ m_listBox->setSelected( QMIN( selected, count() - 1 ), true );
+
+ emit changed();
+ emit removed( removedText );
+ }
+
+ if ( servRemoveButton && m_listBox->currentItem() == -1 )
+ servRemoveButton->setEnabled(false);
+}
+
+void QEditListBox::enableMoveButtons(int index)
+{
+ // Update the lineEdit when we select a different line.
+ if(currentText() != m_lineEdit->text())
+ m_lineEdit->setText(currentText());
+
+ bool moveEnabled = servUpButton && servDownButton;
+
+ if (moveEnabled )
+ {
+ if (m_listBox->count() <= 1)
+ {
+ servUpButton->setEnabled(false);
+ servDownButton->setEnabled(false);
+ }
+ else if ((uint) index == (m_listBox->count() - 1))
+ {
+ servUpButton->setEnabled(true);
+ servDownButton->setEnabled(false);
+ }
+ else if (index == 0)
+ {
+ servUpButton->setEnabled(false);
+ servDownButton->setEnabled(true);
+ }
+ else
+ {
+ servUpButton->setEnabled(true);
+ servDownButton->setEnabled(true);
+ }
+ }
+
+ if ( servRemoveButton )
+ servRemoveButton->setEnabled(true);
+}
+
+void QEditListBox::clear()
+{
+ m_lineEdit->clear();
+ m_listBox->clear();
+ emit changed();
+}
+
+void QEditListBox::insertStringList(const QStringList& list, int index)
+{
+ m_listBox->insertStringList(list,index);
+}
+
+void QEditListBox::insertStrList(const QStrList* list, int index)
+{
+ m_listBox->insertStrList(list,index);
+}
+
+void QEditListBox::insertStrList(const QStrList& list, int index)
+{
+ m_listBox->insertStrList(list,index);
+}
+
+void QEditListBox::insertStrList(const char ** list, int numStrings, int index)
+{
+ m_listBox->insertStrList(list,numStrings,index);
+}
+
+QStringList QEditListBox::items() const
+{
+ QStringList list;
+ for ( uint i = 0; i < m_listBox->count(); i++ )
+ list.append( m_listBox->text( i ));
+
+ return list;
+}
+
+void QEditListBox::setItems(const QStringList& items)
+{
+ m_listBox->clear();
+ m_listBox->insertStringList(items, 0);
+}
+
+void QEditListBox::virtual_hook( int, void* )
+{ /*BASE::virtual_hook( id, data );*/ }
+
+
+///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+
+QEditListBox::CustomEditor::CustomEditor( QComboBox *combo )
+{
+ m_representationWidget = combo;
+ m_lineEdit = dynamic_cast<KLineEdit*>( combo->lineEdit() );
+ assert( m_lineEdit );
+}
diff --git a/lib/widgets/propeditor/qeditlistbox.h b/lib/widgets/propeditor/qeditlistbox.h
new file mode 100644
index 00000000..0b95a919
--- /dev/null
+++ b/lib/widgets/propeditor/qeditlistbox.h
@@ -0,0 +1,255 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef QEDITLISTBOX_H
+#define QEDITLISTBOX_H
+
+#include <qgroupbox.h>
+#include <qlistbox.h>
+
+class KLineEdit;
+class QComboBox;
+class QPushButton;
+
+/**
+ * An editable listbox
+ *
+ * This class provides a editable listbox ;-), this means
+ * a listbox which is accompanied by a line edit to enter new
+ * items into the listbox and pushbuttons to add and remove
+ * items from the listbox and two buttons to move items up and down.
+ *
+ * \image html keditlistbox.png "KDE Edit List Box Widget"
+ *
+ */
+
+
+class QEditListBoxPrivate;
+
+class QEditListBox : public QGroupBox
+{
+ Q_OBJECT
+
+ Q_PROPERTY( QStringList items READ items WRITE setItems )
+
+public:
+ // @since 3.1
+ class CustomEditor
+ {
+ public:
+ CustomEditor()
+ : m_representationWidget( 0L ),
+ m_lineEdit( 0L ) {}
+ CustomEditor( QWidget *repWidget, KLineEdit *edit )
+ : m_representationWidget( repWidget ),
+ m_lineEdit( edit ) {}
+ CustomEditor( QComboBox *combo );
+
+ void setRepresentationWidget( QWidget *repWidget ) {
+ m_representationWidget = repWidget;
+ }
+ void setLineEdit( KLineEdit *edit ) {
+ m_lineEdit = edit;
+ }
+
+ virtual QWidget *representationWidget() const {
+ return m_representationWidget;
+ }
+ virtual KLineEdit *lineEdit() const {
+ return m_lineEdit;
+ }
+
+ protected:
+ QWidget *m_representationWidget;
+ KLineEdit *m_lineEdit;
+ };
+
+ public:
+
+ /**
+ * Enumeration of the buttons, the listbox offers. Specify them in the
+ * constructor in the buttons parameter.
+ */
+ enum Button { Add = 1, Remove = 2, UpDown = 4, All = Add|Remove|UpDown };
+
+ /**
+ * Create an editable listbox.
+ *
+ * If @p checkAtEntering is true, after every character you type
+ * in the line edit QEditListBox will enable or disable
+ * the Add-button, depending whether the current content of the
+ * line edit is already in the listbox. Maybe this can become a
+ * performance hit with large lists on slow machines.
+ * If @p checkAtEntering is false,
+ * it will be checked if you press the Add-button. It is not
+ * possible to enter items twice into the listbox.
+ */
+ QEditListBox(QWidget *parent = 0, const char *name = 0,
+ bool checkAtEntering=false, int buttons = All );
+ /**
+ * Create an editable listbox.
+ *
+ * The same as the other constructor, additionally it takes
+ * @p title, which will be the title of the frame around the listbox.
+ */
+ QEditListBox(const QString& title, QWidget *parent = 0,
+ const char *name = 0, bool checkAtEntering=false,
+ int buttons = All );
+
+ /**
+ * Another constructor, which allows to use a custom editing widget
+ * instead of the standard QLineEdit widget. E.g. you can use a
+ * KURLRequester or a QComboBox as input widget. The custom
+ * editor must consist of a lineedit and optionally another widget that
+ * is used as representation. A QComboBox or a KURLRequester have a
+ * QLineEdit as child-widget for example, so the QComboBox is used as
+ * the representation widget.
+ *
+ * @see KURLRequester::customEditor()
+ * @since 3.1
+ */
+ QEditListBox( const QString& title,
+ const CustomEditor &customEditor,
+ QWidget *parent = 0, const char *name = 0,
+ bool checkAtEntering = false, int buttons = All );
+
+ virtual ~QEditListBox();
+
+ /**
+ * Return a pointer to the embedded QListBox.
+ */
+ QListBox* listBox() const { return m_listBox; }
+ /**
+ * Return a pointer to the embedded KLineEdit.
+ */
+ KLineEdit* lineEdit() const { return m_lineEdit; }
+ /**
+ * Return a pointer to the Add button
+ */
+ QPushButton* addButton() const { return servNewButton; }
+ /**
+ * Return a pointer to the Remove button
+ */
+ QPushButton* removeButton() const { return servRemoveButton; }
+ /**
+ * Return a pointer to the Up button
+ */
+ QPushButton* upButton() const { return servUpButton; }
+ /**
+ * Return a pointer to the Down button
+ */
+ QPushButton* downButton() const { return servDownButton; }
+
+ /**
+ * See QListBox::count()
+ */
+ int count() const { return int(m_listBox->count()); }
+ /**
+ * See QListBox::insertStringList()
+ */
+ void insertStringList(const QStringList& list, int index=-1);
+ /**
+ * See QListBox::insertStringList()
+ */
+ void insertStrList(const QStrList* list, int index=-1);
+ /**
+ * See QListBox::insertStrList()
+ */
+ void insertStrList(const QStrList& list, int index=-1);
+ /**
+ * See QListBox::insertStrList()
+ */
+ void insertStrList(const char ** list, int numStrings=-1, int index=-1);
+ /**
+ * See QListBox::insertItem()
+ */
+ void insertItem(const QString& text, int index=-1) {m_listBox->insertItem(text,index);}
+ /**
+ * Clears both the listbox and the line edit.
+ */
+ void clear();
+ /**
+ * See QListBox::text()
+ */
+ QString text(int index) const { return m_listBox->text(index); }
+ /**
+ * See QListBox::currentItem()
+ */
+ int currentItem() const;
+ /**
+ * See QListBox::currentText()
+ */
+ QString currentText() const { return m_listBox->currentText(); }
+
+ /**
+ * @returns a stringlist of all items in the listbox
+ */
+ QStringList items() const;
+
+ /**
+ * Clears the listbox and sets the contents to @p items
+ *
+ * @since 3.4
+ */
+ void setItems(const QStringList& items);
+
+ signals:
+ void changed();
+
+ /**
+ * This signal is emitted when the user adds a new string to the list,
+ * the parameter is the added string.
+ * @since 3.2
+ */
+ void added( const QString & text );
+
+ /**
+ * This signal is emitted when the user removes a string from the list,
+ * the parameter is the removed string.
+ * @since 3.2
+ */
+ void removed( const QString & text );
+
+ protected slots:
+ //the names should be self-explaining
+ void moveItemUp();
+ void moveItemDown();
+ void addItem();
+ void removeItem();
+ void enableMoveButtons(int index);
+ void typedSomething(const QString& text);
+
+ private:
+ QListBox *m_listBox;
+ QPushButton *servUpButton, *servDownButton;
+ QPushButton *servNewButton, *servRemoveButton;
+ KLineEdit *m_lineEdit;
+
+ //this is called in both ctors, to avoid code duplication
+ void init( bool checkAtEntering, int buttons,
+ QWidget *representationWidget = 0L );
+
+ protected:
+ virtual void virtual_hook( int id, void* data );
+ private:
+ //our lovely private d-pointer
+ QEditListBoxPrivate *d;
+};
+
+#endif
diff --git a/lib/widgets/propeditor/qfloatinput.cpp b/lib/widgets/propeditor/qfloatinput.cpp
new file mode 100644
index 00000000..ea3b17f1
--- /dev/null
+++ b/lib/widgets/propeditor/qfloatinput.cpp
@@ -0,0 +1,51 @@
+/*
+ * qfloatinput.cpp
+ *
+ * Copyright (C) 2004 David Faure <faure@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA
+ */
+#include "qfloatinput.h"
+
+#include <math.h>
+
+QFloatInput::QFloatInput( int min, int max, float step, int digits,
+ QWidget *parent, const char *name )
+ : QSpinBox( (int) (min*pow(digits,10)),
+ (int) (max*pow(digits,10)),
+ (int) (step*pow(digits,10)), parent, name ),
+ m_digits( digits )
+{
+ setValue( (int) (min*pow(digits,10)) );
+ delete validator();
+ QDoubleValidator* validator =
+ new QDoubleValidator( min, max, m_digits, this );
+ setValidator( validator );
+}
+
+QString QFloatInput::mapValueToText( int value )
+{
+ QString format = QString("%.%1f").arg( m_digits );
+ return QString().sprintf(format.latin1(),
+ (value/(float)pow(m_digits,10)) );
+}
+
+int QFloatInput::mapTextToValue( bool* ok )
+{
+ return int(cleanText().toFloat(ok)*pow(m_digits,10));
+}
+
+
diff --git a/lib/widgets/propeditor/qfloatinput.h b/lib/widgets/propeditor/qfloatinput.h
new file mode 100644
index 00000000..72977dd5
--- /dev/null
+++ b/lib/widgets/propeditor/qfloatinput.h
@@ -0,0 +1,48 @@
+/**
+ * qfloatinput.h
+ *
+ * Copyright (C) 2004 David Faure <faure@kde.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA
+ */
+#ifndef QFLOATINPUT_H
+#define QFLOATINPUT_H
+
+#include <qapplication.h>
+#include <qspinbox.h>
+#include <qvalidator.h>
+
+class QFloatInput : public QSpinBox
+{
+public:
+ QFloatInput( int min, int max, float step, int digits,
+ QWidget *parent, const char *name = 0 );
+
+ virtual QString mapValueToText( int value );
+
+ virtual int mapTextToValue( bool* ok );
+
+ int digits() const
+ {
+ return m_digits;
+ }
+
+private:
+ int m_digits;
+};
+
+
+#endif
diff --git a/lib/widgets/propeditor/test.cpp b/lib/widgets/propeditor/test.cpp
new file mode 100644
index 00000000..db49addc
--- /dev/null
+++ b/lib/widgets/propeditor/test.cpp
@@ -0,0 +1,86 @@
+/***************************************************************************
+ * Copyright (C) 2004 by SourceXtreme, Inc *
+ * oss@sourcextreme.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <qapplication.h>
+
+#include "propertyeditor.h"
+#include "propertylist.h"
+#include "multiproperty.h"
+
+using namespace PropertyLib;
+
+int main( int argc, char **argv )
+{
+ QApplication app( argc, argv );
+
+ PropertyEditor *editor = new PropertyEditor( 0 );
+
+ PropertyList *currentList = new PropertyList();
+
+ currentList->addProperty(
+ new Property(Property::String, "Sample string",
+ "Sample description", "value" ) );
+ currentList->addProperty(
+ new Property(Property::Color, "Color",
+ "Sample color description", Qt::red ) );
+ currentList->addProperty(
+ new Property( Property::Pixmap, "Pixmap",
+ "sample pixmap description" ) );
+ currentList->addProperty(
+ new Property( Property::Rect, "Rectangle",
+ "sample rectangle", QRect( 10, 11, 30, 40 ) ) );
+ currentList->addProperty(
+ new Property( Property::Point, "Point",
+ "sample point", QPoint( 20, 30 ) ) );
+ currentList->addProperty(
+ new Property( Property::Boolean, "Boolean",
+ "sample bool", false ) );
+ currentList->addProperty(
+ new Property( Property::Integer, "Integer",
+ "sample integer", 7 ) );
+
+ currentList->addProperty(
+ new Property( Property::Double, "Double",
+ "sample double", 7.0 ) );
+
+ QStringList things;
+ things += "Thing 1";
+ things += "Thing 2";
+
+ currentList->addProperty(
+ new Property( Property::StringList, "StringList",
+ "sample stringlist", things ) );
+
+
+ currentList->addProperty(
+ new Property( Property::DirectoryURL, "Directory",
+ "sample dir", "C:/" ) );
+
+ currentList->addProperty(
+ new Property( Property::FileURL, "File",
+ "sample file", "C:/" ) );
+
+ editor->populateProperties( currentList );
+
+ app.setMainWidget( editor );
+ editor->show();
+
+ return app.exec();
+}
+
diff --git a/lib/widgets/propeditor/test.pro b/lib/widgets/propeditor/test.pro
new file mode 100755
index 00000000..c5b53846
--- /dev/null
+++ b/lib/widgets/propeditor/test.pro
@@ -0,0 +1,40 @@
+TEMPLATE = app
+CONFIG += release
+DEFINES += PURE_QT
+
+SOURCES += childproperty.cpp pcombobox.cpp \
+ pdummywidget.cpp ppointedit.cpp \
+ propertymachinefactory.cpp pstringlistedit.cpp \
+ multiproperty.cpp pcursoredit.cpp \
+ prectedit.cpp propertywidget.cpp \
+ psymbolcombo.cpp pcheckbox.cpp \
+ pdateedit.cpp pfontcombo.cpp \
+ property.cpp psizeedit.cpp \
+ pdatetimeedit.cpp \
+ plineedit.cpp propertyeditor.cpp \
+ psizepolicyedit.cpp pyesnobutton.cpp \
+ ppixmapedit.cpp \
+ propertylist.cpp pspinbox.cpp \
+ propertywidgetproxy.cpp plinestyleedit.cpp \
+ qeditlistbox.cpp pcolorbutton.cpp \
+ pdoublenuminput.cpp qfloatinput.cpp \
+ purledit.cpp test.cpp
+
+HEADERS += childproperty.h pcombobox.h \
+ pdummywidget.h ppointedit.h \
+ propertymachinefactory.h pcursoredit.h \
+ prectedit.h propertywidget.h \
+ pdateedit.h pfontcombo.h \
+ property.h psizeedit.h \
+ pdatetimeedit.h plineedit.h \
+ propertyeditor.h psizepolicyedit.h \
+ ppixmapedit.h propertylist.h \
+ pspinbox.h propertywidgetproxy.h \
+ multiproperty.h pyesnobutton.h \
+ psymbolcombo.h pstringlistedit.h \
+ pcheckbox.h plinestyleedit.h \
+ qeditlistbox.h pcolorbutton.h \
+ pdoublenuminput.h qfloatinput.h \
+ compat_tools.h purledit.h
+
+IMAGES += undo.xpm
diff --git a/lib/widgets/propeditor/undo.xpm b/lib/widgets/propeditor/undo.xpm
new file mode 100644
index 00000000..42cbaed0
--- /dev/null
+++ b/lib/widgets/propeditor/undo.xpm
@@ -0,0 +1,44 @@
+/* XPM */
+static char *undo[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 23 1",
+" c #000100010001",
+". c #0170016F0162",
+"X c #02B802E802C8",
+"o c #037D026B0273",
+"O c #048802AC02C1",
+"+ c #055D031C0338",
+"@ c #08D206B006B1",
+"# c #14B10C350C95",
+"$ c #20CA134E13E8",
+"% c #216B13B71451",
+"& c #230A14A51546",
+"* c #2EDD2EF02D48",
+"= c #3F0D25332654",
+"- c #4EA039B73A18",
+"; c #542530E9329F",
+": c #4FBD4FDA4D09",
+"> c #4FDD506B4D88",
+", c #558351244ECB",
+"< c #7CAF498E4BCC",
+"1 c #7CF25FC15FA7",
+"2 c #CB51C348BD5B",
+"3 c #CF18CD55C654",
+"4 c None",
+/* pixels */
+"4444444444444444",
+"4444444444444444",
+"4444444444444444",
+"44444 444444444",
+"44444 444444444",
+"4444 ,-@@ 44444",
+"444 *321;& 44444",
+"4444 ,>X%<#44444",
+"44444 4 &= 4444",
+"44444 44 O 4444",
+"444444444 4444",
+"444444444 44444",
+"4444444444444444",
+"4444444444444444",
+"4444444444444444"
+};
diff --git a/lib/widgets/qcomboview.cpp b/lib/widgets/qcomboview.cpp
new file mode 100644
index 00000000..2cab4fea
--- /dev/null
+++ b/lib/widgets/qcomboview.cpp
@@ -0,0 +1,1505 @@
+/**********************************************************************
+**
+**
+** Implementation of QComboView widget class
+**
+** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+**********************************************************************/
+
+#include "qcomboview.h"
+#include <kdeversion.h>
+#ifndef QT_NO_COMBOBOX
+#include "qpopupmenu.h"
+#include "qlistview.h"
+#include "qpainter.h"
+#include "qdrawutil.h"
+#include "qstrlist.h"
+#include "qpixmap.h"
+#include "qtimer.h"
+#include "qapplication.h"
+#include "qlineedit.h"
+#include "qbitmap.h"
+#include "private/qeffects_p.h"
+#include "qstringlist.h"
+#include "qcombobox.h"
+#include "qstyle.h"
+#include "qheader.h"
+#include <limits.h>
+
+class QComboViewData
+{
+public:
+ QComboViewData( QComboView *cb ): current(0), lView( 0 ), combo( cb )
+ {
+ duplicatesEnabled = TRUE;
+ cb->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
+ }
+
+ inline QListView * listView() { return lView; }
+ void updateLinedGeometry();
+
+ void setListView( QListView *l ) { lView = l ;
+ l->setMouseTracking( TRUE );}
+
+ QListViewItem *current;
+ int maxCount;
+ int sizeLimit;
+ QComboView::Policy p;
+ bool autoresize;
+ bool poppedUp;
+ bool mouseWasInsidePopup;
+ bool arrowPressed;
+ bool arrowDown;
+ bool discardNextMousePress;
+ bool shortClick;
+ bool useCompletion;
+ bool completeNow;
+ int completeAt;
+ bool duplicatesEnabled;
+ int fullHeight, currHeight;
+
+ QLineEdit * ed; // /bin/ed rules!
+ QTimer *completionTimer;
+
+ QSize sizeHint;
+
+private:
+ bool usinglView;
+ QListView *lView;
+ QComboView *combo;
+
+};
+
+void QComboViewData::updateLinedGeometry()
+{
+ if ( !ed || !combo )
+ return;
+ QRect r = QStyle::visualRect( combo->style().querySubControlMetrics(QStyle::CC_ComboBox, combo,
+ QStyle::SC_ComboBoxEditField), combo );
+
+// qWarning("updateLinedGeometry(): currentItem is %d", combo->currentItem() == 0 ? 0 : 1);
+ const QPixmap *pix = combo->currentItem() ? combo->currentItem()->pixmap(0) : 0;
+ if ( pix && pix->width() < r.width() )
+ r.setLeft( r.left() + pix->width() + 4 );
+ if ( r != ed->geometry() )
+ ed->setGeometry( r );
+}
+
+static inline bool checkInsertIndex( const char *method, const char * name,
+ int count, int *index)
+{
+ bool range_err = (*index > count);
+#if defined(QT_CHECK_RANGE)
+ if ( range_err )
+ qWarning( "QComboView::%s: (%s) Index %d out of range",
+ method, name ? name : "<no name>", *index );
+#else
+ Q_UNUSED( method )
+ Q_UNUSED( name )
+#endif
+ if ( *index < 0 ) // append
+ *index = count;
+ return !range_err;
+}
+
+
+static inline bool checkIndex( const char *method, const char * name,
+ int count, int index )
+{
+ bool range_err = (index >= count);
+#if defined(QT_CHECK_RANGE)
+ if ( range_err )
+ qWarning( "QComboView::%s: (%s) Index %i out of range",
+ method, name ? name : "<no name>", index );
+#else
+ Q_UNUSED( method )
+ Q_UNUSED( name )
+#endif
+ return !range_err;
+}
+
+
+/*!
+ Constructs a combobox with a maximum size and either Motif 2.0 or
+ Windows look and feel.
+
+ The input field can be edited if \a rw is TRUE, otherwise the user
+ may only choose one of the items in the combobox.
+
+ The \a parent and \a name arguments are passed on to the QWidget
+ constructor.
+*/
+
+
+QComboView::QComboView( bool rw, QWidget *parent, const char *name )
+ : QWidget( parent, name, WResizeNoErase )
+{
+ d = new QComboViewData( this );
+ setUpListView();
+
+ d->current = 0;
+ d->maxCount = INT_MAX;
+ setSizeLimit(10);
+ d->p = AtBottom;
+ d->autoresize = FALSE;
+ d->poppedUp = FALSE;
+ d->arrowDown = FALSE;
+ d->discardNextMousePress = FALSE;
+ d->shortClick = FALSE;
+ d->useCompletion = FALSE;
+ d->completeAt = 0;
+ d->completeNow = FALSE;
+ d->completionTimer = new QTimer( this );
+
+ setFocusPolicy( StrongFocus );
+
+ d->ed = 0;
+ if ( rw )
+ setUpLineEdit();
+ setBackgroundMode( PaletteButton, PaletteBase );
+}
+
+
+
+/*!
+ Destroys the combobox.
+*/
+
+QComboView::~QComboView()
+{
+ delete d;
+}
+
+void QComboView::setDuplicatesEnabled( bool enable )
+{
+ d->duplicatesEnabled = enable;
+}
+
+bool QComboView::duplicatesEnabled() const
+{
+ return d->duplicatesEnabled;
+}
+
+int QComboView::childCount() const
+{
+ return d->listView()->childCount();
+}
+
+
+/*!
+ Removes all comboview items.
+*/
+
+void QComboView::clear()
+{
+ d->listView()->resize( 0, 0 );
+ d->listView()->clear();
+
+ d->current = 0;
+ if ( d->ed ) {
+ d->ed->setText( QString::fromLatin1("") );
+ d->updateLinedGeometry();
+ }
+ currentChanged();
+}
+
+QListViewItem *QComboView::currentItem() const
+{
+ return d->current;
+}
+
+void QComboView::setCurrentItem( QListViewItem *item )
+{
+ if ( item == d->current && !d->ed ) {
+ return;
+ }
+
+ if (!item)
+ {
+ d->current = 0;
+ if ( d->ed ) {
+// d->ed->setText( "" );
+ d->updateLinedGeometry();
+ }
+ return;
+ }
+
+ d->current = item;
+ d->completeAt = 0;
+ if ( d->ed ) {
+ d->ed->setText( item->text(0) );
+// qWarning("setCurrentItem( %s )", item->text(0).latin1());
+ d->updateLinedGeometry();
+ }
+ if ( d->listView() ) {
+ d->listView()->setCurrentItem( item );
+ } else {
+ internalHighlight( item );
+ // internalActivate( item ); ### this leads to weird behavior, as in 3.0.1
+ }
+
+ currentChanged();
+
+ d->listView()->ensureItemVisible(item);
+}
+
+bool QComboView::autoResize() const
+{
+ return d->autoresize;
+}
+
+void QComboView::setAutoResize( bool enable )
+{
+ if ( (bool)d->autoresize != enable ) {
+ d->autoresize = enable;
+ if ( enable )
+ adjustSize();
+ }
+}
+
+
+/*!
+ reimp
+
+ This implementation caches the size hint to avoid resizing when
+ the contents change dynamically. To invalidate the cached value
+ call setFont().
+*/
+QSize QComboView::sizeHint() const
+{
+ if ( isVisible() && d->sizeHint.isValid() )
+ return d->sizeHint;
+
+ constPolish();
+// int i, w;
+ QFontMetrics fm = fontMetrics();
+
+ int maxW = childCount() ? 18 : 7 * fm.width(QChar('x')) + 18;
+ int maxH = QMAX( fm.lineSpacing(), 14 ) + 2;
+
+/* for( i = 0; i < count(); i++ ) {
+ w = d->listView()->item( i )->width( d->listView() );
+ if ( w > maxW )
+ maxW = w;
+ }
+*/
+ d->sizeHint = (style().sizeFromContents(QStyle::CT_ComboBox, this,
+ QSize(maxW, maxH)).expandedTo(QApplication::globalStrut()));
+
+ return d->sizeHint;
+}
+
+
+/*!
+ \internal
+ Receives activated signals from an internal popup list and emits
+ the activated() signal.
+*/
+
+void QComboView::internalActivate( QListViewItem * item )
+{
+ if (!item)
+ {
+ d->current = 0;
+ if ( d->ed ) {
+// d->ed->setText( "" );
+ d->updateLinedGeometry();
+ }
+ return;
+ }
+ popDownListView();
+ d->poppedUp = FALSE;
+
+ d->current = item;
+
+ QString t( item->text(0) );
+ if ( d->ed ) {
+ d->ed->setText( t );
+// qWarning("internalActivate( %s )", item->text(0).latin1());
+ d->updateLinedGeometry();
+ }
+ emit activated( item );
+ emit activated( t );
+
+// item->setOpen(true);
+}
+
+/*!
+ \internal
+ Receives highlighted signals from an internal popup list and emits
+ the highlighted() signal.
+*/
+
+void QComboView::internalHighlight( QListViewItem * item )
+{
+ if (!item)
+ {
+ d->current = 0;
+ if ( d->ed ) {
+// d->ed->setText( "" );
+ d->updateLinedGeometry();
+ }
+ return;
+ }
+ emit highlighted( item );
+ QString t = item->text(0);
+ if ( !t.isNull() )
+ emit highlighted( t );
+}
+
+/*!
+ \internal
+ Receives timeouts after a click. Used to decide if a Motif style
+ popup should stay up or not after a click.
+*/
+void QComboView::internalClickTimeout()
+{
+ d->shortClick = FALSE;
+}
+
+/*!
+ Sets the palette for both the combobox button and the combobox
+ popup list to \a palette.
+*/
+
+void QComboView::setPalette( const QPalette &palette )
+{
+ QWidget::setPalette( palette );
+ if( d ) {
+ if(d->listView())
+ d->listView()->setPalette( palette );
+ }
+}
+
+/*!
+ Sets the font for both the combobox button and the combobox popup
+ list to \a font.
+*/
+
+void QComboView::setFont( const QFont &font )
+{
+ d->sizeHint = QSize(); // invalidate size hint
+ QWidget::setFont( font );
+ d->listView()->setFont( font );
+ if (d->ed)
+ d->ed->setFont( font );
+ if ( d->autoresize )
+ adjustSize();
+}
+
+
+/*!reimp
+*/
+
+void QComboView::resizeEvent( QResizeEvent * e )
+{
+ if ( d->ed )
+ d->updateLinedGeometry();
+ d->listView()->resize( width(), d->listView()->height() );
+ QWidget::resizeEvent( e );
+}
+
+/*!reimp
+*/
+
+void QComboView::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+ const QColorGroup & g = colorGroup();
+ p.setPen(g.text());
+
+ QStyle::SFlags flags = QStyle::Style_Default;
+ if (isEnabled())
+ flags |= QStyle::Style_Enabled;
+ if (hasFocus())
+ flags |= QStyle::Style_HasFocus;
+
+ if ( width() < 5 || height() < 5 ) {
+ qDrawShadePanel( &p, rect(), g, FALSE, 2,
+ &g.brush( QColorGroup::Button ) );
+ return;
+ }
+
+// bool reverse = QApplication::reverseLayout();
+ style().drawComplexControl( QStyle::CC_ComboBox, &p, this, rect(), g,
+ flags, QStyle::SC_All,
+ (d->arrowDown ?
+ QStyle::SC_ComboBoxArrow :
+ QStyle::SC_None ));
+
+ QRect re = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxEditField );
+ re = QStyle::visualRect(re, this);
+ p.setClipRect( re );
+
+ if ( !d->ed ) {
+ QListViewItem * item = d->current;
+ if ( item ) {
+ // we calculate the QListBoxTexts height (ignoring strut)
+ int itemh = d->listView()->fontMetrics().lineSpacing() + 2;
+ p.translate( re.x(), re.y() + (re.height() - itemh)/2 );
+ item->paintCell( &p, d->listView()->colorGroup(), 0, width(), AlignLeft | AlignVCenter );
+ }
+ } else if ( d->listView() && d->listView()->currentItem( ) && d->current ) {
+ QListViewItem * item = d->current ;
+ const QPixmap *pix = item->pixmap(0);
+ if ( pix ) {
+ p.fillRect( re.x(), re.y(), pix->width() + 4, re.height(),
+ colorGroup().brush( QColorGroup::Base ) );
+ p.drawPixmap( re.x() + 2, re.y() +
+ ( re.height() - pix->height() ) / 2, *pix );
+ }
+ }
+ p.setClipping( FALSE );
+}
+
+
+/*!reimp
+*/
+
+void QComboView::mousePressEvent( QMouseEvent *e )
+{
+ if ( e->button() != LeftButton )
+ return;
+ if ( d->discardNextMousePress ) {
+ d->discardNextMousePress = FALSE;
+ return;
+ }
+ QRect arrowRect = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxArrow);
+ arrowRect = QStyle::visualRect(arrowRect, this);
+
+ // Correction for motif style, where arrow is smaller
+ // and thus has a rect that doesn't fit the button.
+ arrowRect.setHeight( QMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) );
+
+ if ( childCount() && ( !editable() || arrowRect.contains( e->pos() ) ) ) {
+ d->arrowPressed = FALSE;
+ listView()->blockSignals( TRUE );
+ qApp->sendEvent( listView(), e ); // trigger the listbox's autoscroll
+ listView()->blockSignals( FALSE );
+ popup();
+ if ( arrowRect.contains( e->pos() ) ) {
+ d->arrowPressed = TRUE;
+ d->arrowDown = TRUE;
+ repaint( FALSE );
+ }
+ QTimer::singleShot( 200, this, SLOT(internalClickTimeout()));
+ d->shortClick = TRUE;
+ }
+}
+
+/*!reimp
+*/
+
+void QComboView::mouseMoveEvent( QMouseEvent * )
+{
+}
+
+/*!reimp
+*/
+
+void QComboView::mouseReleaseEvent( QMouseEvent * )
+{
+}
+
+/*!reimp
+*/
+
+void QComboView::mouseDoubleClickEvent( QMouseEvent *e )
+{
+ mousePressEvent( e );
+}
+
+
+/*!reimp
+*/
+
+void QComboView::keyPressEvent( QKeyEvent *e )
+{
+ QListViewItem *c = currentItem();
+ if ( ( e->key() == Key_F4 && e->state() == 0 ) ||
+ ( e->key() == Key_Down && (e->state() & AltButton) ) ||
+ ( !d->ed && e->key() == Key_Space ) ) {
+ if ( childCount() ) {
+ popup();
+ }
+ return;
+ } else if ( e->key() == Key_Up ) {
+/* if ((!c) && (listView()->firstChild()))
+ setCurrentItem(listView()->firstChild());*/
+ if (c && c->itemAbove() )
+ setCurrentItem( c->itemAbove() );
+ else
+ return;
+ } else if ( e->key() == Key_Down ) {
+ if ((!c) && (listView()->firstChild()))
+ {
+ setCurrentItem(listView()->firstChild());
+ return;
+ }
+ if ( c && c->itemBelow() )
+ setCurrentItem( c->itemBelow() );
+ else
+ return;
+ } else if ( e->key() == Key_Home && ( !d->ed || !d->ed->hasFocus() ) ) {
+ if (listView()->firstChild())
+ setCurrentItem( listView()->firstChild() );
+ else
+ return;
+ } else if ( e->key() == Key_End && ( !d->ed || !d->ed->hasFocus() ) ) {
+ if (listView()->lastItem())
+ setCurrentItem( listView()->lastItem() );
+ else
+ return;
+ } else if ( !d->ed && e->ascii() >= 32 && !e->text().isEmpty() ) {
+ if ( !d->completionTimer->isActive() ) {
+ d->completeAt = 0;
+ c = completionIndex( e->text(), c->itemBelow() );
+ if ( c ) {
+ setCurrentItem( c );
+ d->completeAt = e->text().length();
+ }
+ else
+ return;
+ } else {
+ d->completionTimer->stop();
+ QString ct = currentText().left( d->completeAt ) + e->text();
+ c = completionIndex( ct, c );
+ if ( c == 0 && d->completeAt > 0 ) {
+ c = completionIndex( e->text(), listView()->firstChild() );
+ ct = e->text();
+ }
+ d->completeAt = 0;
+ if ( c ) {
+ setCurrentItem( c );
+ d->completeAt = ct.length();
+ }
+ else
+ return;
+ }
+ d->completionTimer->start( 400, TRUE );
+ } else {
+ e->ignore();
+ return;
+ }
+
+ c = currentItem();
+ if ( childCount() && c && !c->text(0).isNull() )
+ emit activated( c->text(0) );
+ emit activated( c );
+}
+
+QString QComboView::currentText() const
+{
+ if ( d->ed )
+ return d->ed->text();
+ else if ( d->current )
+ return currentItem()->text(0);
+ else
+ return QString::null;
+}
+
+/*!reimp
+*/
+
+void QComboView::focusInEvent( QFocusEvent * e )
+{
+ QWidget::focusInEvent( e );
+ d->completeNow = FALSE;
+ d->completeAt = 0;
+
+ emit focusGranted();
+}
+
+/*!reimp
+*/
+
+void QComboView::focusOutEvent( QFocusEvent * e )
+{
+ QWidget::focusOutEvent( e );
+ d->completeNow = FALSE;
+ d->completeAt = 0;
+
+ emit focusLost();
+}
+
+/*!reimp
+*/
+
+void QComboView::wheelEvent( QWheelEvent *e )
+{
+ if ( d->poppedUp ) {
+ QApplication::sendEvent( d->listView(), e );
+ } else {
+ if ( e->delta() > 0 ) {
+ QListViewItem *c = currentItem();
+ if ( c && c->itemAbove() ) {
+ setCurrentItem( c->itemAbove() );
+ emit activated( currentItem() );
+ emit activated( currentText() );
+ }
+ } else {
+ QListViewItem *c = currentItem();
+ if ( c && c->itemBelow() ) {
+ setCurrentItem( c->itemBelow() );
+ emit activated( currentItem() );
+ emit activated( currentText() );
+ }
+ }
+ e->accept();
+ }
+}
+
+int childCount(QListViewItem *it)
+{
+ int count = 1;
+ QListViewItem * myChild = it->firstChild();
+ while( myChild ) {
+ count += childCount(myChild);
+ myChild = myChild->nextSibling();
+ }
+ return count;
+}
+
+int childCount(QListView *lv)
+{
+ int count = 0;
+ QListViewItem * myChild = lv->firstChild();
+ while( myChild ) {
+ count += childCount(myChild);
+// count += 1;
+ myChild = myChild->nextSibling();
+ }
+ return count;
+}
+
+/*!
+ \internal
+ Calculates the listbox height needed to contain all items, or as
+ many as the list box is supposed to contain.
+*/
+static int listHeight( QListView *l, int /*sl*/ )
+{
+/* if ( l->childCount() > 0 )
+ return QMIN( l->childCount(), (uint)sl) * l->firstChild()->height();
+ else*/
+
+ int prefH = 0;
+ int ch = childCount(l);
+ ch = QMIN(ch, 10);
+ if (l->firstChild())
+ {
+ prefH = ch * l->firstChild()->height();
+ }
+ else
+ prefH = l->sizeHint().height();
+
+ if (l->header()->isVisible())
+ prefH += l->header()->sizeHint().height();
+
+// return prefH < l->sizeHint().height() ? prefH : l->sizeHint().height();
+
+ return prefH+2;
+}
+
+/*!
+ Pops up the combobox popup list.
+
+ If the list is empty, no items appear.
+*/
+
+void QComboView::popup()
+{
+ if ( !childCount() )
+ return;
+
+ // Send all listbox events to eventFilter():
+ QListView* lb = d->listView();
+ lb->triggerUpdate( );
+ lb->installEventFilter( this );
+ lb->viewport()->installEventFilter( this );
+ d->mouseWasInsidePopup = FALSE;
+// int w = lb->variableWidth() ? lb->sizeHint().width() : width();
+ int w = width();
+ int h = listHeight( lb, d->sizeLimit );
+ QRect screen = QApplication::desktop()->availableGeometry( const_cast<QComboView*>(this) );
+
+ int sx = screen.x(); // screen pos
+ int sy = screen.y();
+ int sw = screen.width(); // screen width
+ int sh = screen.height(); // screen height
+ QPoint pos = mapToGlobal( QPoint(0,height()) );
+ // ## Similar code is in QPopupMenu
+ int x = pos.x();
+ int y = pos.y();
+
+ // the complete widget must be visible
+ if ( x + w > sx + sw )
+ x = sx+sw - w;
+ if ( x < sx )
+ x = sx;
+ if (y + h > sy+sh && y - h - height() >= 0 )
+ y = y - h - height();
+ QRect rect =
+ style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxListBoxPopup,
+ QStyleOption( x, y, w, h ) );
+ if ( rect.isNull() )
+ rect.setRect( x, y, w, h );
+ lb->setGeometry( rect );
+
+ lb->raise();
+ bool block = lb->signalsBlocked();
+ lb->blockSignals( TRUE );
+ QListViewItem *currentLBItem = d->current ;
+ lb->setCurrentItem( currentLBItem );
+ // set the current item to also be the selected item if it isn't already
+ if ( currentLBItem && currentLBItem->isSelectable() && !currentLBItem->isSelected() )
+ lb->setSelected( currentLBItem, TRUE );
+ lb->blockSignals( block );
+ lb->setVScrollBarMode(QScrollView::Auto);
+
+//#ifndef QT_NO_EFFECTS
+/* if ( QApplication::isEffectEnabled( UI_AnimateCombo ) ) {
+ if ( lb->y() < mapToGlobal(QPoint(0,0)).y() )
+ qScrollEffect( lb, QEffects::UpScroll );
+ else
+ qScrollEffect( lb );
+ } else*/
+//#endif
+ lb->show();
+ d->poppedUp = TRUE;
+}
+
+
+/*!
+ reimp
+*/
+void QComboView::updateMask()
+{
+ QBitmap bm( size() );
+ bm.fill( color0 );
+
+ {
+ QPainter p( &bm, this );
+ style().drawComplexControlMask(QStyle::CC_ComboBox, &p, this, rect());
+ }
+
+ setMask( bm );
+}
+
+/*!
+ \internal
+ Pops down (removes) the combobox popup list box.
+*/
+void QComboView::popDownListView()
+{
+ d->listView()->removeEventFilter( this );
+ d->listView()->viewport()->removeEventFilter( this );
+ d->listView()->hide();
+ d->listView()->setCurrentItem( d->current );
+ if ( d->arrowDown ) {
+ d->arrowDown = FALSE;
+ repaint( FALSE );
+ }
+ d->poppedUp = FALSE;
+}
+
+
+/*!
+ \internal
+ Re-indexes the identifiers in the popup list.
+*/
+
+void QComboView::reIndex()
+{
+}
+
+/*!
+ \internal
+ Repaints the combobox.
+*/
+
+void QComboView::currentChanged()
+{
+ if ( d->autoresize )
+ adjustSize();
+ update();
+}
+
+/*! reimp
+
+ \internal
+
+ The event filter steals events from the popup or listbox when they
+ are popped up. It makes the popup stay up after a short click in
+ motif style. In windows style it toggles the arrow button of the
+ combobox field, and activates an item and takes down the listbox
+ when the mouse button is released.
+*/
+
+bool QComboView::eventFilter( QObject *object, QEvent *event )
+{
+ if ( !event )
+ return TRUE;
+ else if ( object == d->ed ) {
+ if ( event->type() == QEvent::KeyPress ) {
+ bool isAccepted = ( (QKeyEvent*)event )->isAccepted();
+ keyPressEvent( (QKeyEvent *)event );
+ if ( ((QKeyEvent *)event)->isAccepted() ) {
+ d->completeNow = FALSE;
+ return TRUE;
+ } else if ( ((QKeyEvent *)event)->key() != Key_End ) {
+ d->completeNow = TRUE;
+ d->completeAt = d->ed->cursorPosition();
+ }
+ if ( isAccepted )
+ ( (QKeyEvent*)event )->accept();
+ else
+ ( (QKeyEvent*)event )->ignore();
+ } else if ( event->type() == QEvent::KeyRelease ) {
+ d->completeNow = FALSE;
+ keyReleaseEvent( (QKeyEvent *)event );
+ return ((QKeyEvent *)event)->isAccepted();
+ } else if ( event->type() == QEvent::FocusIn ) {
+ focusInEvent( (QFocusEvent *)event );
+ } else if ( event->type() == QEvent::FocusOut ) {
+ focusOutEvent( (QFocusEvent *)event );
+ } else if ( d->useCompletion && d->completeNow ) {
+ if ( !d->ed->text().isNull() &&
+ d->ed->cursorPosition() > d->completeAt &&
+ d->ed->cursorPosition() == (int)d->ed->text().length() ) {
+ d->completeNow = FALSE;
+ QString ct( d->ed->text() );
+ QListViewItem *i = completionIndex( ct, currentItem() );
+ if ( i ) {
+ QString it = i->text(0);
+ d->ed->validateAndSet( it, ct.length(),
+ ct.length(), it.length() );
+ }
+ }
+ }
+ } else if ( ( object == d->listView() ||
+ object == d->listView()->viewport() )) {
+ QMouseEvent *e = (QMouseEvent*)event;
+ switch( event->type() ) {
+ case QEvent::MouseMove:
+ if ( !d->mouseWasInsidePopup ) {
+// qWarning("!d->mouseWasInsidePopup");
+ QPoint pos = e->pos();
+ if ( d->listView()->rect().contains( pos ) )
+ d->mouseWasInsidePopup = TRUE;
+ // Check if arrow button should toggle
+ if ( d->arrowPressed ) {
+ QPoint comboPos;
+ comboPos = mapFromGlobal( d->listView()->mapToGlobal(pos) );
+ QRect arrowRect =
+ style().querySubControlMetrics( QStyle::CC_ComboBox, this,
+ QStyle::SC_ComboBoxArrow);
+ arrowRect = QStyle::visualRect(arrowRect, this);
+ if ( arrowRect.contains( comboPos ) ) {
+ if ( !d->arrowDown ) {
+ d->arrowDown = TRUE;
+ repaint( FALSE );
+ }
+ } else {
+ if ( d->arrowDown ) {
+ d->arrowDown = FALSE;
+ repaint( FALSE );
+ }
+ }
+ }
+ } else if ((e->state() & ( RightButton | LeftButton | MidButton ) ) == 0 &&
+ style().styleHint(QStyle::SH_ComboBox_ListMouseTracking, this)) {
+// qWarning("event filter:: emu");
+ QWidget *mouseW = QApplication::widgetAt( e->globalPos(), TRUE );
+// if ( mouseW == d->listView()->viewport() ) { //###
+ if ( mouseW == d->listView()->viewport() ) {
+ QListViewItem *sel = d->listView()->itemAt(e->pos());
+ if (sel)
+ {
+ d->listView()->setCurrentItem(sel);
+ d->listView()->setSelected(sel, true);
+ }
+ return TRUE;
+ }
+ }
+
+ break;
+ case QEvent::MouseButtonRelease:
+ if ( d->listView()->rect().contains( e->pos() ) ) {
+ QMouseEvent tmp( QEvent::MouseButtonDblClick,
+ e->pos(), e->button(), e->state() ) ;
+ // will hide popup
+ QApplication::sendEvent( object, &tmp );
+ return TRUE;
+ } else {
+ if ( d->mouseWasInsidePopup ) {
+ popDownListView();
+ } else {
+ d->arrowPressed = FALSE;
+ if ( d->arrowDown ) {
+ d->arrowDown = FALSE;
+ repaint( FALSE );
+ }
+ }
+ }
+ break;
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseButtonPress:
+ if ( !d->listView()->rect().contains( e->pos() ) ) {
+ QPoint globalPos = d->listView()->mapToGlobal(e->pos());
+ if ( QApplication::widgetAt( globalPos, TRUE ) == this ) {
+ d->discardNextMousePress = TRUE;
+ // avoid popping up again
+ }
+ popDownListView();
+ return TRUE;
+ }
+ break;
+ case QEvent::KeyPress:
+ switch( ((QKeyEvent *)event)->key() ) {
+ case Key_Up:
+ case Key_Down:
+ if ( !(((QKeyEvent *)event)->state() & AltButton) )
+ break;
+ case Key_F4:
+ case Key_Escape:
+ if ( d->poppedUp ) {
+ popDownListView();
+ return TRUE;
+ }
+ break;
+ case Key_Enter:
+ case Key_Return:
+ // work around QDialog's enter handling
+ return FALSE;
+ default:
+ break;
+ }
+ break;
+ case QEvent::Hide:
+ popDownListView();
+ break;
+ default:
+ break;
+ }
+ }
+ return QWidget::eventFilter( object, event );
+}
+
+
+/*!
+ Returns the index of the first item \e after \a startingAt of
+ which \a prefix is a case-insensitive prefix. Returns -1 if no
+ items start with \a prefix.
+*/
+
+QListViewItem *QComboView::completionIndex( const QString & prefix,
+ QListViewItem *startingAt ) const
+{
+ QListViewItem *start = startingAt;
+/* if ( start < 0 || start >= count() )
+ start = 0;
+ if ( start >= count() )
+ return -1;*/
+ if (!start)
+ start = listView()->firstChild();
+ if (!start)
+ return 0;
+/* if (!start->itemBelow())
+ return 0;*/
+ QString match = prefix.lower();
+ if ( match.length() < 1 )
+ return start;
+
+ QString current;
+ QListViewItem *i = start;
+ do {
+ current = i->text(0).lower();
+ if ( current.startsWith( match ) )
+ return i;
+ i = i->itemBelow();
+ if ( i )
+ i = listView()->firstChild();
+ } while ( i != start );
+ return 0;
+}
+
+
+int QComboView::sizeLimit() const
+{
+ return d ? d->sizeLimit : INT_MAX;
+}
+
+void QComboView::setSizeLimit( int lines )
+{
+ d->sizeLimit = lines;
+}
+
+
+/*int QComboView::maxCount() const
+{
+ return d ? d->maxCount : INT_MAX;
+}
+
+void QComboView::setMaxCount( int count )
+{
+ int l = this->count();
+ while( --l > count )
+ removeItem( l );
+ d->maxCount = count;
+}
+*/
+QComboView::Policy QComboView::insertionPolicy() const
+{
+ return d->p;
+}
+
+void QComboView::setInsertionPolicy( Policy policy )
+{
+ d->p = policy;
+}
+
+
+
+/*!
+ Internal slot to keep the line editor up to date.
+*/
+
+void QComboView::returnPressed()
+{
+ QString s( d->ed->text() );
+
+ if ( s.isEmpty() )
+ return;
+
+ QListViewItem *c = 0;
+ bool doInsert = TRUE;
+ if ( !d->duplicatesEnabled ) {
+ c = listView()->findItem(s, 0);
+ if ( c )
+ doInsert = FALSE;
+ }
+
+ if ( doInsert ) {
+ if ( insertionPolicy() != NoInsertion ) {
+/* int cnt = count();
+ while ( cnt >= d->maxCount ) {
+ removeItem( --cnt );
+ }*/
+ }
+
+ switch ( insertionPolicy() ) {
+ case AtCurrent:
+ if ( s != currentItem()->text(0) )
+ currentItem()->setText(0, s);
+ emit activated( currentItem() );
+ emit activated( s );
+ return;
+ case NoInsertion:
+ emit activated( s );
+ return;
+ case AtTop:
+ c = 0;
+ return;
+// break;
+ case AtBottom:
+ c = new QListViewItem(listView(), listView()->lastItem(), s);
+ break;
+ case BeforeCurrent:
+ if (currentItem() && currentItem()->itemAbove())
+ c = new QListViewItem(listView(), currentItem()->itemAbove(), s);
+ else
+ {
+ c = 0;
+ return;
+ }
+ break;
+ case AfterCurrent:
+ if (currentItem() && currentItem()->itemBelow())
+ c = new QListViewItem(listView(), currentItem()->itemBelow(), s);
+ else
+ {
+ c = 0;
+ return;
+ }
+ break;
+ }
+ }
+
+ if (c)
+ {
+ setCurrentItem( c );
+ emit activated( c );
+ emit activated( s );
+ }
+}
+
+
+/*! reimp
+*/
+
+void QComboView::setEnabled( bool enable )
+{
+ QWidget::setEnabled( enable );
+}
+
+
+
+/*!
+ Applies the validator \a v to the combobox so that only text which
+ is valid according to \a v is accepted.
+
+ This function does nothing if the combobox is not editable.
+
+ \sa validator() clearValidator() QValidator
+*/
+
+void QComboView::setValidator( const QValidator * v )
+{
+ if ( d && d->ed )
+ d->ed->setValidator( v );
+}
+
+
+/*!
+ Returns the validator which constrains editing for this combobox
+ if there is one; otherwise returns 0.
+
+ \sa setValidator() clearValidator() QValidator
+*/
+
+const QValidator * QComboView::validator() const
+{
+ return d && d->ed ? d->ed->validator() : 0;
+}
+
+
+/*!
+ This slot is equivalent to setValidator( 0 ).
+*/
+
+void QComboView::clearValidator()
+{
+ if ( d && d->ed )
+ d->ed->setValidator( 0 );
+}
+
+
+/*!
+ Sets the combobox to use \a newListBox instead of the current list
+ box or popup. As a side effect, it clears the combobox of its
+ current contents.
+
+ \warning QComboView assumes that newListBox->text(n) returns
+ non-null for 0 \<= n \< newListbox->count(). This assumption is
+ necessary because of the line edit in QComboView.
+*/
+
+void QComboView::setListView( QListView * newListView )
+{
+ clear();
+
+ delete d->listView();
+
+ newListView->reparent( this, WType_Popup, QPoint(0,0), FALSE );
+ d->setListView( newListView );
+ d->listView()->setFont( font() );
+ d->listView()->setPalette( palette() );
+/* d->listView()->setVScrollBarMode(QScrollView::AlwaysOff);
+ d->listView()->setHScrollBarMode(QScrollView::AlwaysOff);*/
+ d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain );
+ d->listView()->setLineWidth( 1 );
+/* d->listView()->setRootIsDecorated( true );
+ d->listView()->setAllColumnsShowFocus(true);*/
+ d->listView()->resize( 100, 10 );
+
+ if (d->listView()->firstChild())
+ d->current = d->listView()->firstChild();
+
+// d->listView()->header()->hide();
+
+
+/* d->listView()->setFont( font() );
+ d->listView()->setPalette( palette() );
+ d->listView()->setVScrollBarMode( QScrollView::AlwaysOff );
+ d->listView()->setHScrollBarMode( QScrollView::AlwaysOff );
+ d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain );
+ d->listView()->setLineWidth( 1 );
+ d->listView()->setRootIsDecorated( true );
+ d->listView()->setAllColumnsShowFocus(true);
+ d->listView()->addColumn("");
+ d->listView()->resize( 100, 10 );
+*/
+
+ connect( d->listView(), SIGNAL(returnPressed(QListViewItem*)),
+ SLOT(internalActivate(QListViewItem*)));
+ connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)),
+ SLOT(internalActivate(QListViewItem*)));
+ connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)),
+ SLOT(checkState(QListViewItem*)));
+ connect( d->listView(), SIGNAL(currentChanged(QListViewItem*)),
+ SLOT(internalHighlight(QListViewItem*)));
+ connect( d->listView(), SIGNAL(selectionChanged(QListViewItem*)),
+ SLOT(internalHighlight(QListViewItem*)));
+}
+
+
+/*!
+ Returns the current list box, or 0 if there is no list box.
+ (QComboView can use QPopupMenu instead of QListBox.) Provided to
+ match setlistView().
+
+ \sa setlistView()
+*/
+
+QListView * QComboView::listView() const
+{
+ return d ? d->listView() : 0;
+}
+
+/*!
+ Returns the line edit, or 0 if there is no line edit.
+
+ Only editable listboxes have a line editor.
+*/
+QLineEdit* QComboView::lineEdit() const
+{
+ return d->ed;
+}
+
+
+
+/*!
+ Clears the line edit without changing the combobox's contents.
+ Does nothing if the combobox isn't editable.
+
+ This is particularly useful when using a combobox as a line edit
+ with history. For example you can connect the combobox's
+ activated() signal to clearEdit() in order to present the user
+ with a new, empty line as soon as Enter is pressed.
+
+ \sa setEditText()
+*/
+
+void QComboView::clearEdit()
+{
+ if ( d && d->ed )
+ d->ed->clear();
+}
+
+
+/*!
+ Sets the text in the line edit to \a newText without changing the
+ combobox's contents. Does nothing if the combobox isn't editable.
+
+ This is useful e.g. for providing a good starting point for the
+ user's editing and entering the change in the combobox only when
+ the user presses Enter.
+
+ \sa clearEdit() insertItem()
+*/
+
+void QComboView::setEditText( const QString &newText )
+{
+ if ( d && d->ed ) {
+ d->updateLinedGeometry();
+ d->ed->setText( newText );
+ }
+}
+
+void QComboView::setAutoCompletion( bool enable )
+{
+ d->useCompletion = enable;
+ d->completeNow = FALSE;
+}
+
+
+bool QComboView::autoCompletion() const
+{
+ return d->useCompletion;
+}
+
+/*!reimp
+ */
+void QComboView::styleChange( QStyle& s )
+{
+ d->sizeHint = QSize(); // invalidate size hint...
+ if ( d->ed )
+ d->updateLinedGeometry();
+ QWidget::styleChange( s );
+}
+
+bool QComboView::editable() const
+{
+ return d->ed != 0;
+}
+
+void QComboView::setEditable( bool y )
+{
+ if ( y == editable() )
+ return;
+ if ( y ) {
+ setUpListView();
+ setUpLineEdit();
+ d->ed->show();
+ if ( currentItem() )
+ setEditText( currentText() );
+ } else {
+ delete d->ed;
+ d->ed = 0;
+ }
+
+ setFocusPolicy( StrongFocus );
+ updateGeometry();
+ update();
+}
+
+
+void QComboView::setUpListView()
+{
+ d->setListView( new QListView( this, "in-combo", WType_Popup ) );
+
+ d->listView()->setFont( font() );
+ d->listView()->setPalette( palette() );
+/* d->listView()->setVScrollBarMode( QScrollView::AlwaysOff );
+ d->listView()->setHScrollBarMode( QScrollView::AlwaysOff );*/
+ d->listView()->setFrameStyle( QFrame::Box | QFrame::Plain );
+ d->listView()->setLineWidth( 1 );
+ d->listView()->setRootIsDecorated( false );
+ d->listView()->setAllColumnsShowFocus(true);
+ d->listView()->addColumn("");
+ d->listView()->resize( 100, 10 );
+ d->listView()->setResizeMode(QListView::LastColumn);
+
+ if (d->listView()->firstChild())
+ d->current = d->listView()->firstChild();
+
+ d->listView()->header()->hide();
+
+ connect( d->listView(), SIGNAL(returnPressed(QListViewItem*)),
+ SLOT(internalActivate(QListViewItem*)));
+ connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)),
+ SLOT(internalActivate(QListViewItem*)));
+ connect( d->listView(), SIGNAL(doubleClicked(QListViewItem*)),
+ SLOT(checkState(QListViewItem*)));
+ connect( d->listView(), SIGNAL(currentChanged(QListViewItem*)),
+ SLOT(internalHighlight(QListViewItem*)));
+ connect( d->listView(), SIGNAL(selectionChanged(QListViewItem*)),
+ SLOT(internalHighlight(QListViewItem*)));
+}
+
+
+void QComboView::setUpLineEdit()
+{
+ if ( !d->ed )
+ setLineEdit( new QLineEdit( this, "combo edit" ) );
+}
+
+/*!
+ Sets the line edit to use \a edit instead of the current line edit.
+*/
+
+void QComboView::setLineEdit( QLineEdit *edit )
+{
+ if ( !edit ) {
+#if defined(QT_CHECK_NULL)
+ Q_ASSERT( edit != 0 );
+#endif
+ return;
+ }
+
+ edit->setText( currentText() );
+ if ( d->ed ) {
+ int start = 0, end = 0;
+ d->ed->getSelection( &start, &end );
+ edit->setSelection( start, end );
+ edit->setCursorPosition( d->ed->cursorPosition() );
+ edit->setEdited( d->ed->edited() );
+ delete d->ed;
+ }
+
+ d->ed = edit;
+
+ if ( edit->parent() != this ) {
+ edit->reparent( this, QPoint(0,0), FALSE );
+ edit->setFont( font() );
+ }
+
+ connect (edit, SIGNAL( textChanged( const QString& ) ),
+ this, SIGNAL( textChanged( const QString& ) ) );
+ connect( edit, SIGNAL(returnPressed()), SLOT(returnPressed()) );
+
+ edit->setFrame( FALSE );
+ d->updateLinedGeometry();
+ edit->installEventFilter( this );
+ setFocusProxy( edit );
+ setFocusPolicy( StrongFocus );
+
+ setUpListView();
+
+ if ( isVisible() )
+ edit->show();
+
+ updateGeometry();
+ update();
+}
+
+void QComboView::setCurrentText( const QString& txt )
+{
+ QListViewItem *i;
+ i = listView()->findItem(txt, 0);
+ if ( i )
+ setCurrentItem( i );
+ else if ( d->ed )
+ d->ed->setText( txt );
+ else if (currentItem())
+ currentItem()->setText(0, txt);
+}
+
+void QComboView::checkState( QListViewItem * item)
+{
+ item->setOpen(!item->isOpen());
+}
+
+void QComboView::setCurrentActiveItem( QListViewItem * item )
+{
+ if ( item == d->current && !d->ed ) {
+ return;
+ }
+
+ d->current = item;
+ d->completeAt = 0;
+ if ( d->ed ) {
+ d->ed->setText( item->text(0) );
+ d->ed->setCursorPosition(0);
+// qWarning("setCurrentActiveItem( %s )", item->text(0).latin1());
+ d->updateLinedGeometry();
+ }
+ if ( d->listView() ) {
+ d->listView()->setCurrentItem( item );
+ emit activated( item );
+ emit activated( item->text(0) );
+ } else {
+ internalHighlight( item );
+ internalActivate( item );
+ }
+
+ currentChanged();
+
+ d->listView()->ensureItemVisible(item);
+}
+
+#include "qcomboview.moc"
+
+#endif // QT_NO_COMBOBOX
+
diff --git a/lib/widgets/qcomboview.h b/lib/widgets/qcomboview.h
new file mode 100644
index 00000000..8f618f50
--- /dev/null
+++ b/lib/widgets/qcomboview.h
@@ -0,0 +1,172 @@
+/**********************************************************************
+**
+**
+** Definition of QComboView class
+**
+** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+**********************************************************************/
+
+#ifndef QCOMBOVIEW_H
+#define QCOMBOVIEW_H
+
+#ifndef QT_H
+#include "qwidget.h"
+#endif // QT_H
+
+#ifndef QT_NO_COMBOBOX
+
+/**
+@file qcomboview.h
+QComboView class.
+*/
+
+class QStrList;
+class QStringList;
+class QLineEdit;
+class QValidator;
+class QListView;
+class QListViewItem;
+class QComboViewData;
+
+/**
+QComboView - a combo with a QListView as a popup widget.
+This means that you can have a treeview inside of a combo. Otherwise it works
+in the same way as QComboBox and have similar API.
+*/
+class Q_EXPORT QComboView : public QWidget
+{
+ Q_OBJECT
+ Q_ENUMS( Policy )
+ Q_PROPERTY( bool editable READ editable WRITE setEditable )
+// Q_PROPERTY( int count READ count )
+ Q_PROPERTY( QString currentText READ currentText WRITE setCurrentText DESIGNABLE false )
+// Q_PROPERTY( QListView *currentItem READ currentItem WRITE setCurrentItem )
+ Q_PROPERTY( bool autoResize READ autoResize WRITE setAutoResize DESIGNABLE false )
+ Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit )
+// Q_PROPERTY( int maxCount READ maxCount WRITE setMaxCount )
+ Q_PROPERTY( Policy insertionPolicy READ insertionPolicy WRITE setInsertionPolicy )
+ Q_PROPERTY( bool autoCompletion READ autoCompletion WRITE setAutoCompletion )
+ Q_PROPERTY( bool duplicatesEnabled READ duplicatesEnabled WRITE setDuplicatesEnabled )
+ Q_OVERRIDE( bool autoMask DESIGNABLE true SCRIPTABLE true )
+
+public:
+// QComboView( QWidget* parent=0, const char* name=0 );
+ QComboView( bool rw, QWidget* parent=0, const char* name=0 );
+ ~QComboView();
+
+ int childCount() const;
+
+ QListViewItem *currentItem() const;
+ virtual void setCurrentItem( QListViewItem * );
+ virtual void setCurrentActiveItem( QListViewItem * );
+
+ bool autoResize() const;
+ virtual void setAutoResize( bool );
+ QSize sizeHint() const;
+
+ void setPalette( const QPalette & );
+ void setFont( const QFont & );
+ void setEnabled( bool );
+
+ virtual void setSizeLimit( int );
+ int sizeLimit() const;
+
+/* virtual void setMaxCount( int );
+ int maxCount() const;*/
+
+ enum Policy { NoInsertion, AtTop, AtCurrent, AtBottom,
+ AfterCurrent, BeforeCurrent };
+
+ virtual void setInsertionPolicy( Policy policy );
+ Policy insertionPolicy() const;
+
+ virtual void setValidator( const QValidator * );
+ const QValidator * validator() const;
+
+ virtual void setListView( QListView * );
+ QListView * listView() const;
+
+ virtual void setLineEdit( QLineEdit *edit );
+ QLineEdit* lineEdit() const;
+
+ virtual void setAutoCompletion( bool );
+ bool autoCompletion() const;
+
+ bool eventFilter( QObject *object, QEvent *event );
+
+ void setDuplicatesEnabled( bool enable );
+ bool duplicatesEnabled() const;
+
+ bool editable() const;
+ void setEditable( bool );
+
+ virtual void popup();
+
+ QString currentText() const;
+ void setCurrentText( const QString& );
+
+public slots:
+ virtual void clear();
+ void clearValidator();
+ void clearEdit();
+ virtual void setEditText( const QString &);
+
+signals:
+ void activated( QListViewItem * item );
+ void highlighted( QListViewItem * item );
+ void activated( const QString &);
+ void highlighted( const QString &);
+ void textChanged( const QString &);
+ void focusGranted();
+ void focusLost();
+
+private slots:
+ void internalActivate( QListViewItem * );
+ void internalHighlight( QListViewItem * );
+ void internalClickTimeout();
+ void returnPressed();
+ void checkState(QListViewItem*);
+
+protected:
+ void paintEvent( QPaintEvent * );
+ void resizeEvent( QResizeEvent * );
+ void mousePressEvent( QMouseEvent * );
+ void mouseMoveEvent( QMouseEvent * );
+ void mouseReleaseEvent( QMouseEvent * );
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void keyPressEvent( QKeyEvent *e );
+ void focusInEvent( QFocusEvent *e );
+ void focusOutEvent( QFocusEvent *e );
+ void wheelEvent( QWheelEvent *e );
+ void styleChange( QStyle& );
+
+ void updateMask();
+
+private:
+ virtual void setUpListView();
+ void setUpLineEdit();
+ void popDownListView();
+ void reIndex();
+ void currentChanged();
+ QListViewItem *completionIndex( const QString &, QListViewItem * ) const;
+
+ QComboViewData *d;
+
+private: // Disabled copy constructor and operator=
+#if defined(Q_DISABLE_COPY)
+ QComboView( const QComboView & );
+ QComboView &operator=( const QComboView & );
+#endif
+};
+
+
+#endif // QT_NO_COMBOBOX
+
+#endif // QCOMBOVIEW_H
diff --git a/lib/widgets/resizablecombo.cpp b/lib/widgets/resizablecombo.cpp
new file mode 100644
index 00000000..436125a9
--- /dev/null
+++ b/lib/widgets/resizablecombo.cpp
@@ -0,0 +1,98 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "resizablecombo.h"
+
+#include "kcomboview.h"
+
+#include <qevent.h>
+#include <qlayout.h>
+#include <qpixmap.h>
+#include <qapplication.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+
+static const char * resize_xpm[] = {
+"9 18 2 1",
+" c None",
+". c #000000",
+" . ",
+" ",
+" . ",
+" ",
+" . ",
+" ",
+" . . . ",
+" .. .. ",
+".........",
+" .. .. ",
+" . . . ",
+" ",
+" . ",
+" ",
+" . ",
+" ",
+" . ",
+" "};
+
+ResizableCombo::ResizableCombo(KComboView *view, QWidget *parent, const char *name):
+ QWidget(parent, name), m_sizer(0), m_combo(view)
+{
+ QHBoxLayout *l = new QHBoxLayout(this);
+ view->reparent(this, QPoint(0,0));
+ l->addWidget(view);
+
+ m_sizer = new MyPushButton(this);
+ m_sizer->setPixmap(QPixmap(resize_xpm));
+ QWhatsThis::add(m_sizer, i18n("Drag this to resize the combobox."));
+ l->addWidget(m_sizer);
+}
+
+void MyPushButton::mousePressEvent( QMouseEvent * e )
+{
+ m_resizing = true;
+ m_pressedPos = e->globalPos();
+ m_width = m_combo->m_combo->width();
+ QPushButton::mousePressEvent(e);
+}
+
+void MyPushButton::mouseReleaseEvent( QMouseEvent * e )
+{
+ m_resizing = false;
+ QPushButton::mouseReleaseEvent(e);
+}
+
+void MyPushButton::mouseMoveEvent( QMouseEvent * e )
+{
+ if (m_resizing)
+ m_combo->m_combo->setMinimumWidth(m_width + e->globalPos().x() - pressedPos().x());
+
+ QPushButton::mouseMoveEvent(e);
+}
+
+MyPushButton::MyPushButton( ResizableCombo * parent, const char * name )
+ :QPushButton(parent, name), m_resizing(false), m_combo(parent)
+{
+ setFocusPolicy(NoFocus);
+ setFlat(true);
+ m_width = m_combo->m_combo->width();
+}
+
+
+#include "resizablecombo.moc"
diff --git a/lib/widgets/resizablecombo.h b/lib/widgets/resizablecombo.h
new file mode 100644
index 00000000..587712d0
--- /dev/null
+++ b/lib/widgets/resizablecombo.h
@@ -0,0 +1,72 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef RESIZABLECOMBO_H
+#define RESIZABLECOMBO_H
+
+#include <qpushbutton.h>
+#include <qpoint.h>
+
+class KComboView;
+class QMouseEvent;
+class MyPushButton;
+
+/**
+@file resizablecombo.h
+Resizable combo box.
+*/
+
+/**
+Resizable combo box.
+Used to place resizable KComboBox onto toolbars.
+*/
+class ResizableCombo: public QWidget{
+ Q_OBJECT
+public:
+ ResizableCombo(KComboView *view, QWidget *parent = 0, const char *name = 0);
+
+private:
+ MyPushButton *m_sizer;
+ KComboView *m_combo;
+
+friend class MyPushButton;
+};
+
+class MyPushButton: public QPushButton
+{
+public:
+ MyPushButton(ResizableCombo *parent = 0, const char *name = 0 );
+
+ QPoint pressedPos()
+ {
+ return m_pressedPos;
+ }
+
+protected:
+ virtual void mouseReleaseEvent ( QMouseEvent * e );
+ virtual void mousePressEvent ( QMouseEvent * e );
+ virtual void mouseMoveEvent ( QMouseEvent * e );
+
+private:
+ bool m_resizing;
+ QPoint m_pressedPos;
+ int m_width;
+ ResizableCombo *m_combo;
+};
+
+#endif
diff --git a/lib/widgets/sticky.xpm b/lib/widgets/sticky.xpm
new file mode 100644
index 00000000..f6c5c5af
--- /dev/null
+++ b/lib/widgets/sticky.xpm
@@ -0,0 +1,13 @@
+/* XPM */
+static const char * const sticky[] = {
+/* width height num_colors chars_per_pixel */
+" 4 4 2 1",
+/* colors */
+". c #ffffff",
+"x c #000000",
+/* pixels */
+".xx.",
+"xxxx",
+"xxxx",
+".xx."
+};
diff --git a/mimetypes/Makefile.am b/mimetypes/Makefile.am
new file mode 100644
index 00000000..0c1f28ff
--- /dev/null
+++ b/mimetypes/Makefile.am
@@ -0,0 +1,5 @@
+
+text_DATA = x-fortran.desktop
+textdir = $(kde_mimedir)/text
+
+EXTRA_DIST = $(text_DATA)
diff --git a/mimetypes/chm.desktop b/mimetypes/chm.desktop
new file mode 100644
index 00000000..f737702f
--- /dev/null
+++ b/mimetypes/chm.desktop
@@ -0,0 +1,33 @@
+[Desktop Entry]
+Comment=HTML Help Document
+Comment[br]=Teul skoazell HTML
+Comment[ca]=Document d'ajuda HTML
+Comment[da]=HTML-hjælpedokument
+Comment[de]=HTML-Hilfedokument
+Comment[el]=Έγγραφο HTML βοήθειας
+Comment[es]=Documento de ayuda HTML
+Comment[et]=HTML abi dokument
+Comment[fr]=Document d'aide en HTML
+Comment[ga]=Cáipéis Chabhrach HTML
+Comment[hi]=एचटीएमएल मदद दस्तावेज़
+Comment[hu]=HTML dokumentációs fájl
+Comment[it]=Documentazione in HTML
+Comment[ja]=HTML ヘルプ文書
+Comment[nds]=HTML-Hülpdokment
+Comment[nl]=HTML Help-document
+Comment[pl]=Dokument pomocy HTML
+Comment[pt]=Documento de Ajuda em HTML
+Comment[pt_BR]=Documento de Ajuda HTML
+Comment[ru]=Документ справки в HTML
+Comment[sk]=HTML Help dokument
+Comment[sr]=HTML документ помоћи
+Comment[sr@Latn]=HTML dokument pomoći
+Comment[sv]=HTML-hjälpdokument
+Comment[ta]=HTML உதவி ஆவணம்
+Comment[tr]=HTML Yardım Belgesi
+Comment[zh_TW]=HTML 說明文件
+Hidden=false
+Icon=help
+MimeType=application/chm
+Patterns=*.chm;*.CHM
+Type=MimeType
diff --git a/mimetypes/x-fortran.desktop b/mimetypes/x-fortran.desktop
new file mode 100644
index 00000000..dca61887
--- /dev/null
+++ b/mimetypes/x-fortran.desktop
@@ -0,0 +1,46 @@
+[Desktop Entry]
+Comment=Fortran Source File
+Comment[br]=Restr tarzh Fortran
+Comment[ca]=Fitxer font Fortran
+Comment[da]=Fortran kildefil
+Comment[de]=Fortran-Quelltextdatei
+Comment[el]=Αρχείο κώδικα Fortran
+Comment[es]=Archivo de fuente Fortran
+Comment[et]=Fortrani lähtefail
+Comment[eu]=Fortran iturburu fitxategia
+Comment[fa]=پروندۀ منبع فرترن
+Comment[fr]=Fichier source en Fortran
+Comment[ga]=Comhad Foinseach Fortran
+Comment[gl]=Ficheiro fonte Fortran
+Comment[hi]=फोरट्रॉन स्रोत फ़ाइल
+Comment[hu]=Fortran forrásfájl
+Comment[is]=Fortran frumkóðaskrá
+Comment[it]=File sorgente per Fortran
+Comment[ja]=Fortran ソースファイル
+Comment[ms]=Fail Sumber Fortran
+Comment[nds]=Fortran-Borntextdatei
+Comment[ne]=फोर्ट्रान स्रोत फाइल
+Comment[nl]=Fortran Bronbestand
+Comment[pl]=Plik źródłowy Fortrana
+Comment[pt]=Ficheiro de Código em Fortran
+Comment[pt_BR]=Arquivo Fonte do Fortran
+Comment[ru]=Программа на Fortran
+Comment[sk]=Zdrojový súbor Fortran
+Comment[sl]=Izvorna datoteka za Fortran
+Comment[sr]=Fortran изворни фајл
+Comment[sr@Latn]=Fortran izvorni fajl
+Comment[sv]=Fortran källkodsfil
+Comment[ta]=Fortran மூலக்கோப்பு
+Comment[tg]=Файли берунии Fortran
+Comment[tr]=Fortran Kaynak Dosyası
+Comment[zh_CN]=Fortran 源文件
+Comment[zh_TW]=Fortran 程式源碼檔
+Hidden=false
+Icon=source_f
+MimeType=text/x-fortran
+Patterns=*.f;*.F;*.f77;*.f90;*.f95;*.for;*.ftn;*.fpp
+Type=MimeType
+
+[Property::X-KDE-text]
+Type=bool
+Value=true
diff --git a/parts/Makefile.am b/parts/Makefile.am
new file mode 100644
index 00000000..ca6b7f6b
--- /dev/null
+++ b/parts/Makefile.am
@@ -0,0 +1,11 @@
+# This is the collection of parts. These are derived from various
+# interfaces in kdevelop/lib/interfaces which are in turn derived
+# from KPart.
+
+SUBDIRS = abbrev appwizard astyle bookmarks classview diff filecreate fileview \
+ fullscreen outputviews grepview valgrind distpart konsole tools regexptest doxygen \
+ fileselector tipofday filter uimode openwith texttools replace partexplorer \
+ quickopen snippet filelist ctags2 documentation scripting vcsmanager
+
+DOXYGEN_EMPTY = YES
+include ../Doxyfile.am
diff --git a/parts/abbrev/Makefile.am b/parts/abbrev/Makefile.am
new file mode 100644
index 00000000..0319852f
--- /dev/null
+++ b/parts/abbrev/Makefile.am
@@ -0,0 +1,20 @@
+# Here resides the abbrev part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevabbrev.la
+libkdevabbrev_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevabbrev_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevabbrev_la_SOURCES = abbrevpart.cpp abbrevconfigwidget.cpp abbrevconfigwidgetbase.ui addtemplatedlg.cpp addtemplatedlgbase.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevabbrev.desktop
+
+sourcesdir = $(kde_datadir)/kdevabbrev/sources
+sources_DATA = qt_classes cpp_keywords
+
+rcdir = $(kde_datadir)/kdevabbrev
+rc_DATA = kdevabbrev.rc
diff --git a/parts/abbrev/README.dox b/parts/abbrev/README.dox
new file mode 100644
index 00000000..1c8b3002
--- /dev/null
+++ b/parts/abbrev/README.dox
@@ -0,0 +1,20 @@
+/** \class AbbrevPart
+Provides support for customizable abbrevations - short words which expand into commonly needed code structures.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+
+\feature Feature 1
+\feature Feature 2
+
+\bug Bug1
+\bug Bug2
+
+\note
+Put you notes here (if you have them!) :)
+\verbatim
+Verbatin code here
+\endverbatim
+
+*/
diff --git a/parts/abbrev/abbrevconfigwidget.cpp b/parts/abbrev/abbrevconfigwidget.cpp
new file mode 100644
index 00000000..d7729249
--- /dev/null
+++ b/parts/abbrev/abbrevconfigwidget.cpp
@@ -0,0 +1,121 @@
+/***************************************************************************
+ * Copyright (C) 2002 Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 "abbrevconfigwidget.h"
+
+#include <kconfig.h>
+#include <kiconloader.h>
+
+#include <qlistview.h>
+#include <qmultilineedit.h>
+#include <qcheckbox.h>
+
+#include "addtemplatedlg.h"
+#include "abbrevpart.h"
+
+AbbrevConfigWidget::AbbrevConfigWidget(AbbrevPart *part, QWidget *parent, const char *name)
+ : AbbrevConfigWidgetBase(parent, name)
+{
+ m_part = part;
+
+ qWarning("creating abbrevconfigwidget for %d abbrevs", part->templates().allTemplates().count());
+ QPtrList<CodeTemplate> templates = part->templates().allTemplates();
+ CodeTemplate *templ;
+ for (templ = templates.first(); templ; templ = templates.next())
+ {
+ qWarning("creating item for code template ");
+ QListViewItem *it = new QListViewItem( listTemplates,
+ templ->name,
+ templ->description,
+ templ->suffixes,
+ templ->code,
+ templ->code );
+ it->setPixmap( 0, SmallIcon("template_source"));
+ }
+
+ checkWordCompletion->setChecked( part->autoWordCompletionEnabled() );
+ listTemplates->setSorting(2);
+}
+
+
+AbbrevConfigWidget::~AbbrevConfigWidget()
+{}
+
+
+void AbbrevConfigWidget::addTemplate()
+{
+ QStringList suffixesList = m_part->templates().suffixes();
+
+ AddTemplateDialog dlg( suffixesList, this );
+ if( dlg.exec() ){
+ QString templ = dlg.templ();
+ QString description = dlg.description();
+ QString suffixes = dlg.suffixes();
+ if( !(templ.isEmpty() || description.isEmpty()) || suffixes.isEmpty()) {
+ QListViewItem* item = new QListViewItem( listTemplates, templ, description, suffixes );
+ listTemplates->setSelected( item, true );
+ editCode->setFocus();
+ }
+ }
+}
+
+
+void AbbrevConfigWidget::removeTemplate()
+{
+ if (!listTemplates->selectedItem())
+ return;
+ delete listTemplates->selectedItem();
+}
+
+
+void AbbrevConfigWidget::selectionChanged()
+{
+ QListViewItem* item = listTemplates->selectedItem();
+ if( item ){
+ editCode->setText( item->text(3) );
+ }
+}
+
+
+void AbbrevConfigWidget::codeChanged()
+{
+ QListViewItem* item = listTemplates->selectedItem();
+ if( item ){
+ item->setText( 3, editCode->text() );
+ if (item->text(3) == item->text(4))
+ item->setPixmap( 0, SmallIcon("template_source") );
+ else
+ item->setPixmap( 0, SmallIcon("filesave") );
+ }
+}
+
+
+void AbbrevConfigWidget::accept()
+{
+ m_part->clearTemplates();
+
+ QListViewItem* item = listTemplates->firstChild();
+ while( item ){
+ m_part->addTemplate( item->text(0),
+ item->text(1),
+ item->text(2),
+ item->text(3) );
+ item = item->nextSibling();
+ }
+
+ m_part->setAutoWordCompletionEnabled( checkWordCompletion->isChecked() );
+}
+
+#include "abbrevconfigwidget.moc"
diff --git a/parts/abbrev/abbrevconfigwidget.h b/parts/abbrev/abbrevconfigwidget.h
new file mode 100644
index 00000000..b8cc1983
--- /dev/null
+++ b/parts/abbrev/abbrevconfigwidget.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2002 Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 _ABBREVCONFIGWIDGET_H_
+#define _ABBREVCONFIGWIDGET_H_
+
+#include "abbrevconfigwidgetbase.h"
+#include "abbrevpart.h"
+
+
+class AbbrevConfigWidget : public AbbrevConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ AbbrevConfigWidget(AbbrevPart *part, QWidget *parent=0, const char *name=0);
+ ~AbbrevConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ virtual void addTemplate();
+ virtual void removeTemplate();
+ virtual void selectionChanged();
+ virtual void codeChanged();
+
+ AbbrevPart *m_part;
+};
+
+#endif
diff --git a/parts/abbrev/abbrevconfigwidgetbase.ui b/parts/abbrev/abbrevconfigwidgetbase.ui
new file mode 100644
index 00000000..fd432a3e
--- /dev/null
+++ b/parts/abbrev/abbrevconfigwidgetbase.ui
@@ -0,0 +1,190 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AbbrevConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>abbrev_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>474</width>
+ <height>410</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Code Templates</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;de:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editCode</cstring>
+ </property>
+ </widget>
+ <widget class="QMultiLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>editCode</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>checkWordCompletion</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enable automatic word completion</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>buttonRemoveTemplate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="1" column="0" rowspan="3" colspan="1">
+ <column>
+ <property name="text">
+ <string>Template</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Suffixes</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listTemplates</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonAddTemplate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Templates:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listTemplates</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonAddTemplate</sender>
+ <signal>clicked()</signal>
+ <receiver>abbrev_config_widget</receiver>
+ <slot>addTemplate()</slot>
+ </connection>
+ <connection>
+ <sender>buttonRemoveTemplate</sender>
+ <signal>clicked()</signal>
+ <receiver>abbrev_config_widget</receiver>
+ <slot>removeTemplate()</slot>
+ </connection>
+ <connection>
+ <sender>editCode</sender>
+ <signal>textChanged()</signal>
+ <receiver>abbrev_config_widget</receiver>
+ <slot>codeChanged()</slot>
+ </connection>
+ <connection>
+ <sender>listTemplates</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>abbrev_config_widget</receiver>
+ <slot>selectionChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>checkWordCompletion</tabstop>
+ <tabstop>listTemplates</tabstop>
+ <tabstop>buttonAddTemplate</tabstop>
+ <tabstop>buttonRemoveTemplate</tabstop>
+ <tabstop>editCode</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">addTemplate()</slot>
+ <slot access="protected">codeChanged()</slot>
+ <slot access="protected">removeTemplate()</slot>
+ <slot access="protected">selectionChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/abbrev/abbrevpart.cpp b/parts/abbrev/abbrevpart.cpp
new file mode 100644
index 00000000..181606f4
--- /dev/null
+++ b/parts/abbrev/abbrevpart.cpp
@@ -0,0 +1,696 @@
+/***************************************************************************
+ * Copyright (C) 2002 Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 "abbrevpart.h"
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <kstandarddirs.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kconfig.h>
+#include <kio/netaccess.h>
+#include <kiconloader.h>
+#include <kdevplugininfo.h>
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/codecompletioninterface.h>
+
+#include "kdevcore.h"
+#include "kdevpartcontroller.h"
+#include "abbrevconfigwidget.h"
+#include "kdeveditorutil.h"
+
+static const KDevPluginInfo data("kdevabbrev");
+
+class AbbrevFactory : public KDevGenericFactory<AbbrevPart>
+{
+public:
+ AbbrevFactory()
+ : KDevGenericFactory<AbbrevPart>( data )
+ { }
+
+ virtual KInstance *createInstance()
+ {
+ KInstance *instance = KDevGenericFactory<AbbrevPart>::createInstance();
+ KStandardDirs *dirs = instance->dirs();
+ dirs->addResourceType( "codetemplates",
+ KStandardDirs::kde_default( "data" ) + "kdevabbrev/templates/" );
+ dirs->addResourceType( "sources",
+ KStandardDirs::kde_default( "data" ) + "kdevabbrev/sources" );
+
+ return instance;
+ }
+};
+
+K_EXPORT_COMPONENT_FACTORY( libkdevabbrev, AbbrevFactory )
+
+AbbrevPart::AbbrevPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "AbbrevPart")
+{
+ setInstance(AbbrevFactory::instance());
+ setXMLFile("kdevabbrev.rc");
+
+ connect(partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(slotActivePartChanged(KParts::Part*)) );
+
+ connect(core(), SIGNAL(configWidget(KDialogBase*)), this, SLOT(configWidget(KDialogBase*)));
+
+ KAction *action;
+ action = new KAction( i18n("Expand Text"), CTRL + Key_J,
+ this, SLOT(slotExpandText()),
+ actionCollection(), "edit_expandtext" );
+ action->setToolTip( i18n("Expand current word") );
+ action->setWhatsThis( i18n("<b>Expand current word</b><p>Current word can be completed using the list of similar words in source files.") );
+
+ action = new KAction( i18n("Expand Abbreviation"), CTRL + Key_L,
+ this, SLOT(slotExpandAbbrev()),
+ actionCollection(), "edit_expandabbrev" );
+ action->setToolTip( i18n("Expand abbreviation") );
+ action->setWhatsThis( i18n("<b>Expand abbreviation</b><p>Enable and configure abbreviations in <b>KDevelop Settings</b>, <b>Abbreviations</b> tab.") );
+
+ load();
+
+ m_inCompletion = false;
+ docIface = 0;
+ editIface = 0;
+ viewCursorIface = 0;
+ completionIface = 0;
+
+ m_prevLine = -1;
+ m_prevColumn = -1;
+ m_sequenceLength = 0;
+
+ KConfig* config = AbbrevFactory::instance()->config();
+ KConfigGroupSaver group( config, "General" );
+ m_autoWordCompletionEnabled = config->readBoolEntry( "AutoWordCompletion", false );
+
+ updateActions();
+
+ slotActivePartChanged( partController()->activePart() );
+}
+
+
+AbbrevPart::~AbbrevPart()
+{
+ save();
+}
+
+bool AbbrevPart::autoWordCompletionEnabled() const
+{
+ return m_autoWordCompletionEnabled;
+}
+
+void AbbrevPart::setAutoWordCompletionEnabled( bool enabled )
+{
+ if( enabled == m_autoWordCompletionEnabled )
+ return;
+
+ KConfig* config = AbbrevFactory::instance()->config();
+ KConfigGroupSaver group( config, "General" );
+
+ m_autoWordCompletionEnabled = enabled;
+ config->writeEntry( "AutoWordCompletion", m_autoWordCompletionEnabled );
+ config->sync();
+
+ if( !docIface || !docIface->widget() )
+ return;
+
+ disconnect( docIface, 0, this, 0 );
+ disconnect( docIface->widget(), 0, this, 0 );
+
+ if( m_autoWordCompletionEnabled ){
+ connect( docIface->widget(), SIGNAL(completionAborted()),
+ this, SLOT(slotCompletionAborted()) );
+ connect( docIface->widget(), SIGNAL(completionDone()),
+ this, SLOT(slotCompletionDone()) );
+ connect( docIface->widget(), SIGNAL(aboutToShowCompletionBox()),
+ this, SLOT(slotAboutToShowCompletionBox()) );
+
+ connect( docIface, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+ }
+}
+void AbbrevPart::load()
+{
+ KStandardDirs *dirs = AbbrevFactory::instance()->dirs();
+ QString localTemplatesFile = locateLocal("codetemplates", "templates", AbbrevFactory::instance());
+ QStringList files;
+ if (QFileInfo(localTemplatesFile).exists())
+ files << localTemplatesFile;
+ else
+ files = dirs->findAllResources("codetemplates", QString::null, false, true);
+
+ QString localSourcesFile = locateLocal("sources", "sources", AbbrevFactory::instance());
+ QStringList sourceFiles;
+ if (QFileInfo(localSourcesFile).exists())
+ sourceFiles << localSourcesFile;
+ else
+ sourceFiles = dirs->findAllResources("sources", QString::null, false, true);
+ kdDebug(9028) << "=========> sourceFiles: " << sourceFiles.join(" ") << endl;
+
+ this->m_completionFile = QString::null;
+ for( QStringList::Iterator it=sourceFiles.begin(); it!=sourceFiles.end(); ++it ) {
+ QString fn = *it;
+ kdDebug(9028) << "===> load file: " << fn << endl;
+ QFile f( fn );
+ if ( f.open(IO_ReadOnly) ) {
+ QTextStream stream( &f );
+ m_completionFile += ( stream.read() + QString("\n") );
+ f.close();
+ }
+ }
+
+ QStringList::ConstIterator it;
+ for (it = files.begin(); it != files.end(); ++it) {
+ QString fn = *it;
+ kdDebug(9028) << "fn = " << fn << endl;
+ QFile f( fn );
+ if ( f.open(IO_ReadOnly) ) {
+ QDomDocument doc;
+ doc.setContent( &f );
+ QDomElement root = doc.firstChild().toElement();
+ QDomElement e = root.firstChild().toElement();
+ while ( !e.isNull() ){
+ addTemplate( e.attribute("name"),
+ e.attribute("description"),
+ e.attribute("suffixes"),
+ e.attribute("code") );
+ e = e.nextSibling().toElement();
+ }
+ f.close();
+ }
+ }
+}
+
+
+void AbbrevPart::save()
+{
+ QString fn = AbbrevFactory::instance()->dirs()->saveLocation("codetemplates", "", true);
+ kdDebug(9028) << "fn = " << fn << endl;
+
+ QDomDocument doc( "Templates" );
+ QDomElement root = doc.createElement( "Templates" );
+ doc.appendChild( root );
+
+ QPtrList<CodeTemplate> templates = m_templates.allTemplates();
+ CodeTemplate *templ;
+ for (templ = templates.first(); templ; templ = templates.next())
+ {
+ QDomElement e = doc.createElement( "Template" );
+ e.setAttribute( "name", templ->name );
+ e.setAttribute( "description", templ->description );
+ e.setAttribute( "suffixes", templ->suffixes );
+ e.setAttribute( "code", templ->code );
+ root.appendChild( e );
+ }
+
+ QFile f( fn + "templates" );
+ if( f.open(IO_WriteOnly) ){
+ QTextStream stream( &f );
+ stream << doc.toString();
+ f.close();
+ }
+}
+
+
+QString AbbrevPart::currentWord() const
+{
+ return KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+}
+
+
+void AbbrevPart::configWidget(KDialogBase *dlg)
+{
+ QVBox *vbox = dlg->addVBoxPage(i18n("Abbreviations"), i18n("Abbreviations"), BarIcon( info()->icon(), KIcon::SizeMedium) );
+ AbbrevConfigWidget *w = new AbbrevConfigWidget(this, vbox, "abbrev config widget");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+}
+
+
+void AbbrevPart::slotExpandText()
+{
+ if( !editIface || !completionIface || !viewCursorIface )
+ return;
+
+ QString word = currentWord();
+ if (word.isEmpty())
+ return;
+
+ QValueList<KTextEditor::CompletionEntry> entries = findAllWords(editIface->text(), word);
+ if (entries.count() == 0) {
+ ; // some statusbar message?
+// } else if (entries.count() == 1) {
+// uint line, col;
+// viewCursorIface->cursorPositionReal(&line, &col);
+// QString txt = entries[0].text.mid(word.length());
+// editIface->insertText( line, col, txt );
+// viewCursorIface->setCursorPositionReal( line, col + txt.length() );
+ } else {
+ m_inCompletion = true;
+ completionIface->showCompletionBox(entries, word.length());
+ }
+}
+
+
+QValueList<KTextEditor::CompletionEntry> AbbrevPart::findAllWords(const QString &text, const QString &prefix)
+{
+ QValueList<KTextEditor::CompletionEntry> entries;
+
+ KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ QWidget *view = partController()->activeWidget();
+ if (!part || !view) {
+ kdDebug(9028) << "no rw part" << endl;
+ return entries;
+ }
+
+ QString suffix = part->url().url();
+ int pos = suffix.findRev('.');
+ if (pos != -1)
+ suffix.remove(0, pos+1);
+ kdDebug(9028) << "AbbrevPart::findAllWords with suffix " << suffix << endl;
+
+ QMap<QString, bool> map;
+ QRegExp rx( QString("\\b") + prefix + "[a-zA-Z0-9_]+\\b" );
+
+ int idx = 0;
+ pos = 0;
+ int len = 0;
+ while ( (pos = rx.search(text, idx)) != -1 ) {
+ len = rx.matchedLength();
+ QString word = text.mid(pos, len);
+ if (map.find(word) == map.end()) {
+ KTextEditor::CompletionEntry e;
+ e.text = word;
+ entries << e;
+ map[ word ] = TRUE;
+ }
+ idx = pos + len + 1;
+ }
+
+ idx = 0;
+ pos = 0;
+ len = 0;
+ while ( (pos = rx.search(m_completionFile, idx)) != -1 ) {
+ len = rx.matchedLength();
+ QString word = m_completionFile.mid(pos, len);
+ if (map.find(word) == map.end()) {
+ KTextEditor::CompletionEntry e;
+ e.text = word;
+ entries << e;
+ map[ word ] = TRUE;
+ }
+ idx = pos + len + 1;
+ }
+
+
+ QMap<QString, CodeTemplate*> m = m_templates[suffix];
+ for (QMap<QString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) {
+ KTextEditor::CompletionEntry e;
+ e.text = it.data()->description + " <abbrev>";
+ e.userdata = it.key();
+ entries << e;
+ }
+
+ return entries;
+}
+
+
+void AbbrevPart::slotExpandAbbrev()
+{
+ KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ QWidget *view = partController()->activeWidget();
+ if (!part || !view) {
+ kdDebug(9028) << "no rw part" << endl;
+ return;
+ }
+
+ QString suffix = part->url().url();
+ int pos = suffix.findRev('.');
+ if (pos != -1)
+ suffix.remove(0, pos+1);
+
+ KTextEditor::EditInterface *editiface
+ = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!editiface) {
+ kdDebug(9028) << "no editiface" << endl;
+ return;
+ }
+ KTextEditor::ViewCursorInterface *cursoriface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(view);
+ if (!cursoriface) {
+ kdDebug(9028) << "no viewcursoriface" << endl;
+ return;
+ }
+
+ QString word = currentWord();
+ kdDebug(9028) << "Expanding word " << word << " with suffix " << suffix << "." << endl;
+
+ QMap<QString, CodeTemplate*> m = m_templates[suffix];
+ for (QMap<QString, CodeTemplate*>::const_iterator it = m.begin(); it != m.end() ; ++it) {
+ if (it.key() != word)
+ continue;
+
+ uint line, col;
+ cursoriface->cursorPositionReal(&line, &col);
+
+ QString linestr = editIface->textLine(line);
+ int startPos = QMAX( QMIN( (int)col, (int)linestr.length()-1 ), 0 );
+ int endPos = startPos;
+ startPos--;
+ while (startPos >= 0 && ( linestr[startPos].isLetterOrNumber() || linestr[startPos] == '_' || linestr[startPos] == '~') )
+ startPos--;
+ while (endPos < (int)linestr.length() && ( linestr[endPos].isLetterOrNumber() || linestr[endPos] == '_' ) )
+ endPos++;
+
+ editiface->removeText( line, startPos+1, line, endPos );
+ insertChars(it.data()->code );
+ }
+}
+
+
+void AbbrevPart::insertChars( const QString &chars )
+{
+ unsigned line=0, col=0;
+ viewCursorIface->cursorPositionReal( &line, &col );
+
+ unsigned int currentLine=line, currentCol=col;
+
+ QString spaces;
+ QString s = editIface->textLine( currentLine );
+ uint i=0;
+ while( i<s.length() && s[ i ].isSpace() ){
+ spaces += s[ i ];
+ ++i;
+ }
+
+ bool foundPipe = false;
+ QString str;
+ QTextStream stream( &str, IO_WriteOnly );
+ QStringList lines = QStringList::split( "\n", chars );
+ QStringList::Iterator it = lines.begin();
+ line = currentLine;
+ while( it != lines.end() ){
+ QString lineText = *it;
+ if( it != lines.begin() ){
+ stream << spaces;
+ if( !foundPipe )
+ currentCol += spaces.length();
+ }
+
+ int idx = lineText.find( '|' );
+ if( idx != -1 ){
+ stream << lineText.left( idx ) << lineText.mid( idx+1 );
+ if( !foundPipe ){
+ foundPipe = true;
+ currentCol += lineText.left( idx ).length();
+ kdDebug(9007) << "found pipe at " << currentLine << ", " << currentCol << endl;
+ }
+ } else {
+ stream << lineText;
+ }
+
+ ++it;
+
+ if( it != lines.end() ){
+ stream << "\n";
+ if( !foundPipe ){
+ ++currentLine;
+ currentCol = 0;
+ }
+ }
+ }
+ editIface->insertText( line, col, str );
+ kdDebug(9007) << "go to " << currentLine << ", " << currentCol << endl;
+ viewCursorIface->setCursorPositionReal( currentLine, currentCol );
+}
+
+void AbbrevPart::addTemplate( const QString& templ,
+ const QString& descr,
+ const QString& suffixes,
+ const QString& code)
+{
+ m_templates.insert(templ, descr, code, suffixes);
+}
+
+
+void AbbrevPart::removeTemplate( const QString &suffixes, const QString &name )
+{
+ m_templates.remove( suffixes, name );
+}
+
+
+void AbbrevPart::clearTemplates()
+{
+ m_templates.clear();
+}
+
+CodeTemplateList AbbrevPart::templates() const
+{
+ return m_templates;
+}
+
+void AbbrevPart::slotActivePartChanged( KParts::Part* part )
+{
+ kdDebug(9028) << "AbbrevPart::slotActivePartChanged()" << endl;
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
+
+ if( !doc || !part->widget() || doc == docIface )
+ {
+ actionCollection()->action( "edit_expandtext" )->setEnabled( false );
+ actionCollection()->action( "edit_expandabbrev" )->setEnabled( false );
+ return;
+ }
+
+ docIface = doc;
+
+ if( !docIface ){
+ docIface = 0;
+ editIface = 0;
+ viewCursorIface = 0;
+ completionIface = 0;
+ }
+
+ editIface = dynamic_cast<KTextEditor::EditInterface*>( part );
+ viewCursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( part->widget() );
+ completionIface = dynamic_cast<KTextEditor::CodeCompletionInterface*>( part->widget() );
+
+ updateActions();
+
+ if( !editIface || !viewCursorIface || !completionIface )
+ return;
+
+ disconnect( part->widget(), 0, this, 0 );
+ disconnect( doc, 0, this, 0 );
+
+ connect( part->widget(), SIGNAL(filterInsertString(KTextEditor::CompletionEntry*, QString*)),
+ this, SLOT(slotFilterInsertString(KTextEditor::CompletionEntry*, QString*)) );
+
+ if( autoWordCompletionEnabled() ){
+ connect( part->widget(), SIGNAL(completionAborted()), this, SLOT(slotCompletionAborted()) );
+ connect( part->widget(), SIGNAL(completionDone()), this, SLOT(slotCompletionDone()) );
+ connect( part->widget(), SIGNAL(aboutToShowCompletionBox()), this, SLOT(slotAboutToShowCompletionBox()) );
+ connect( doc, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+ }
+
+ m_prevLine = -1;
+ m_prevColumn = -1;
+ m_sequenceLength = 0;
+ kdDebug(9028) << "AbbrevPart::slotActivePartChanged() -- OK" << endl;
+}
+
+void AbbrevPart::slotTextChanged()
+{
+ if( m_inCompletion )
+ return;
+
+ unsigned int line, col;
+ viewCursorIface->cursorPositionReal( &line, &col );
+
+ if( m_prevLine != int(line) || m_prevColumn+1 != int(col) || col == 0 ){
+ m_prevLine = line;
+ m_prevColumn = col;
+ m_sequenceLength = 1;
+ return;
+ }
+
+ QString textLine = editIface->textLine( line );
+ QChar ch = textLine[ col-1 ];
+ QChar currentChar = textLine[ col ];
+
+ if( currentChar.isLetterOrNumber() || currentChar == QChar('_') || !(ch.isLetterOrNumber() || ch == QChar('_')) ){
+ // reset
+ m_prevLine = -1;
+ return;
+ }
+
+ if( m_sequenceLength >= 3 )
+ slotExpandText();
+
+ ++m_sequenceLength;
+ m_prevLine = line;
+ m_prevColumn = col;
+}
+
+void AbbrevPart::slotFilterInsertString( KTextEditor::CompletionEntry* entry, QString* text )
+{
+ kdDebug(9028) << "AbbrevPart::slotFilterInsertString()" << endl;
+ KParts::ReadWritePart *part = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ QWidget *view = partController()->activeWidget();
+ if (!part || !view) {
+ kdDebug(9028) << "no rw part" << endl;
+ return;
+ }
+
+ QString suffix = part->url().url();
+ int pos = suffix.findRev('.');
+ if (pos != -1)
+ suffix.remove(0, pos+1);
+ kdDebug(9028) << "AbbrevPart::slotFilterInsertString with suffix " << suffix << endl;
+
+ if( !entry || !text || !viewCursorIface || !editIface )
+ return;
+
+ QString expand( " <abbrev>" );
+ if( !entry->userdata.isNull() && entry->text.endsWith(expand) ){
+ QString macro = entry->text.left( entry->text.length() - expand.length() );
+ *text = "";
+ uint line, col;
+ viewCursorIface->cursorPositionReal( &line, &col );
+ editIface->removeText( line, col-currentWord().length(), line, col );
+ insertChars( m_templates[suffix][entry->userdata]->code );
+ }
+}
+
+void AbbrevPart::updateActions()
+{
+ actionCollection()->action( "edit_expandtext" )->setEnabled( docIface != 0 );
+ actionCollection()->action( "edit_expandabbrev" )->setEnabled( docIface != 0 );
+}
+
+void AbbrevPart::slotCompletionAborted()
+{
+ kdDebug(9028) << "AbbrevPart::slotCompletionAborted()" << endl;
+ m_inCompletion = false;
+}
+
+void AbbrevPart::slotCompletionDone()
+{
+ kdDebug(9028) << "AbbrevPart::slotCompletionDone()" << endl;
+ m_inCompletion = false;
+}
+
+void AbbrevPart::slotAboutToShowCompletionBox()
+{
+ kdDebug(9028) << "AbbrevPart::slotAboutToShowCompletionBox()" << endl;
+ m_inCompletion = true;
+}
+
+CodeTemplateList::CodeTemplateList( )
+{
+ allCodeTemplates.setAutoDelete(true);
+}
+
+CodeTemplateList::~ CodeTemplateList( )
+{
+}
+
+QMap< QString, CodeTemplate * > CodeTemplateList::operator [ ]( QString suffix )
+{
+ kdDebug(9028) << "CodeTemplateList::operator []" << endl;
+ QMap< QString, CodeTemplate * > selectedTemplates;
+ for (QMap<QString, QMap<QString, CodeTemplate* > >::const_iterator it = templates.begin(); it != templates.end(); ++it)
+ {
+ kdDebug(9028) << "CodeTemplateList::operator [] - suffixes " << it.key() << endl;
+ if (QStringList::split(",", it.key()).contains(suffix))
+ {
+ kdDebug(9028) << "CodeTemplateList::operator [] - suffixes " << it.key() << " contains " << suffix << endl;
+
+ QMap<QString, CodeTemplate* > m = it.data();
+ for (QMap<QString, CodeTemplate* >::const_iterator itt = m.begin(); itt != m.end(); ++itt)
+ {
+ kdDebug(9028) << "x" << endl;
+ selectedTemplates[itt.key()] = itt.data();
+ }
+ }
+ }
+ return selectedTemplates;
+}
+
+void CodeTemplateList::insert( QString name, QString description, QString code, QString suffixes )
+{
+ QString origSuffixes = suffixes;
+// QStringList suffixList;
+ int pos = suffixes.find('(');
+ if (pos == -1)
+ return;
+ suffixes.remove(0, pos+1);
+ pos = suffixes.find(')');
+ if (pos == -1)
+ return;
+ suffixes.remove(pos, suffixes.length()-pos);
+// suffixList = QStringList::split(",", suffixes);
+
+ CodeTemplate *t;
+ if (templates.contains(suffixes) && templates[suffixes].contains(name))
+ {
+ kdDebug(9028) << "found template for suffixes " << suffixes << " and name " << name << endl;
+ t = templates[suffixes][name];
+ }
+ else
+ {
+ kdDebug(9028) << "creating template for suffixes " << suffixes << " and name " << name << endl;
+ t = new CodeTemplate();
+ allCodeTemplates.append(t);
+ templates[suffixes][name] = t;
+ }
+ t->name = name;
+ t->description = description;
+ t->code = code;
+ t->suffixes = origSuffixes;
+ if (!m_suffixes.contains(origSuffixes))
+ m_suffixes.append(origSuffixes);
+}
+
+QPtrList< CodeTemplate > CodeTemplateList::allTemplates( ) const
+{
+ return allCodeTemplates;
+}
+
+void CodeTemplateList::remove( const QString & suffixes, const QString & name )
+{
+ allCodeTemplates.remove(templates[suffixes][name]);
+ templates[suffixes].remove(name);
+}
+
+void CodeTemplateList::clear( )
+{
+ templates.clear();
+ allCodeTemplates.clear();
+}
+
+QStringList CodeTemplateList::suffixes( )
+{
+ return m_suffixes;
+}
+
+#include "abbrevpart.moc"
diff --git a/parts/abbrev/abbrevpart.h b/parts/abbrev/abbrevpart.h
new file mode 100644
index 00000000..f0029b51
--- /dev/null
+++ b/parts/abbrev/abbrevpart.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2002 Roberto Raggi *
+ * roberto@kdevelop.org *
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 _ABBREVPART_H_
+#define _ABBREVPART_H_
+
+#include <qmap.h>
+#include <qptrlist.h>
+#include "kdevplugin.h"
+
+#include <ktexteditor/codecompletioninterface.h>
+
+class KDialogBase;
+
+namespace KParts{
+ class Part;
+}
+
+namespace KTextEditor{
+ class Document;
+ class EditInterface;
+ class ViewCursorInterface;
+}
+
+struct CodeTemplate {
+ QString name;
+ QString description;
+ QString code;
+ QString suffixes;
+};
+
+class CodeTemplateList {
+public:
+ CodeTemplateList();
+ ~CodeTemplateList();
+
+ QMap<QString, CodeTemplate* > operator[](QString suffix);
+ void insert(QString name, QString description, QString code, QString suffixes);
+ void remove(const QString &suffixes, const QString &name);
+ void clear();
+ QStringList suffixes();
+
+ QPtrList<CodeTemplate> allTemplates() const;
+
+private:
+ QMap<QString, QMap<QString, CodeTemplate* > > templates;
+ QPtrList<CodeTemplate> allCodeTemplates;
+ QStringList m_suffixes;
+};
+
+class AbbrevPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ AbbrevPart( QObject *parent, const char *name, const QStringList & );
+ ~AbbrevPart();
+
+ bool autoWordCompletionEnabled() const;
+ void setAutoWordCompletionEnabled( bool enabled );
+
+ void addTemplate(const QString &templ, const QString &descr,
+ const QString &suffixes, const QString &code);
+ void removeTemplate(const QString &suffixes, const QString &name);
+ void clearTemplates();
+ CodeTemplateList templates() const;
+
+private slots:
+ void slotExpandText();
+ void slotExpandAbbrev();
+ void configWidget(KDialogBase *dlg);
+ void slotActivePartChanged( KParts::Part* );
+ void slotTextChanged();
+ void slotCompletionAborted();
+ void slotCompletionDone();
+ void slotFilterInsertString( KTextEditor::CompletionEntry*, QString* );
+ void slotAboutToShowCompletionBox();
+
+private:
+ void updateActions();
+ void load();
+ void save();
+ QString currentWord() const;
+ QValueList<KTextEditor::CompletionEntry> findAllWords(const QString &text, const QString &prefix);
+ void insertChars( const QString &chars );
+// QAsciiDict<CodeTemplate> m_templates;
+ CodeTemplateList m_templates;
+ bool m_inCompletion;
+ int m_prevLine;
+ int m_prevColumn;
+ int m_sequenceLength;
+ bool m_autoWordCompletionEnabled;
+ QString m_completionFile;
+
+ KTextEditor::Document* docIface;
+ KTextEditor::EditInterface* editIface;
+ KTextEditor::ViewCursorInterface* viewCursorIface;
+ KTextEditor::CodeCompletionInterface* completionIface;
+};
+
+#endif
diff --git a/parts/abbrev/addtemplatedlg.cpp b/parts/abbrev/addtemplatedlg.cpp
new file mode 100644
index 00000000..3c84c2e1
--- /dev/null
+++ b/parts/abbrev/addtemplatedlg.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2002 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+#include "addtemplatedlg.h"
+#include <qcombobox.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+
+AddTemplateDialog::AddTemplateDialog( QStringList suffixesList, QWidget *parent, const char *name )
+ : AddTemplateDialogBase( parent, name )
+{
+ setFocusProxy( editTemplate );
+ comboSuffixes->insertStringList(suffixesList);
+ connect( editTemplate, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged()));
+ connect( editDescription, SIGNAL(textChanged ( const QString & )), this, SLOT( textChanged()));
+ buttonOk->setEnabled(false);
+}
+
+AddTemplateDialog::~AddTemplateDialog()
+{
+}
+
+void AddTemplateDialog::textChanged()
+{
+ buttonOk->setEnabled( !editTemplate->text().isEmpty() && !editDescription->text().isEmpty() );
+}
+
+QString AddTemplateDialog::templ() const
+{
+ return editTemplate->text();
+}
+
+QString AddTemplateDialog::description() const
+{
+ return editDescription->text();
+}
+
+QString AddTemplateDialog::suffixes() const
+{
+ return comboSuffixes->currentText();
+}
+
+#include "addtemplatedlg.moc"
diff --git a/parts/abbrev/addtemplatedlg.h b/parts/abbrev/addtemplatedlg.h
new file mode 100644
index 00000000..ddc22eb7
--- /dev/null
+++ b/parts/abbrev/addtemplatedlg.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2002 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+#ifndef caddtemplatedialog_h
+#define caddtemplatedialog_h
+
+#include "addtemplatedlgbase.h"
+
+
+class AddTemplateDialog: public AddTemplateDialogBase
+{
+ Q_OBJECT
+
+public:
+ AddTemplateDialog( QStringList suffixesList, QWidget *parent=0, const char *name=0 );
+ virtual ~AddTemplateDialog();
+
+ QString templ() const;
+ QString description() const;
+ QString suffixes() const;
+private slots:
+ void textChanged();
+};
+
+#endif
diff --git a/parts/abbrev/addtemplatedlgbase.ui b/parts/abbrev/addtemplatedlgbase.ui
new file mode 100644
index 00000000..bfe5f0bb
--- /dev/null
+++ b/parts/abbrev/addtemplatedlgbase.ui
@@ -0,0 +1,176 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddTemplateDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddTemplateDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>348</width>
+ <height>161</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Code Template</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Template:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editTemplate</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Description:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>editDescription</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>editTemplate</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>editDescription</cstring>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QComboBox" row="2" column="1">
+ <property name="name">
+ <cstring>comboSuffixes</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>labelSuffixes</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Suffixes:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboSuffixes</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>AddTemplateDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>AddTemplateDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>editTemplate</tabstop>
+ <tabstop>editDescription</tabstop>
+ <tabstop>comboSuffixes</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/abbrev/cpp_keywords b/parts/abbrev/cpp_keywords
new file mode 100644
index 00000000..72d96901
--- /dev/null
+++ b/parts/abbrev/cpp_keywords
@@ -0,0 +1,84 @@
+K_DCOP
+k_dcop
+k_dcop_signals
+Q_OBJECT
+signals
+slots
+emit
+__int64
+__asm__
+and
+and_eq
+asm
+auto
+bitand
+bitor
+bool
+break
+case
+catch
+char
+class
+compl
+const
+const_cast
+continue
+default
+delete
+do
+double
+dynamic_cast
+else
+enum
+explicit
+export
+extern
+false
+float
+for
+friend
+goto
+if
+inline
+int
+long
+mutable
+namespace
+new
+not
+not_eq
+operator
+or
+or_eq
+private
+protected
+public
+register
+reinterpret_cast
+return
+short
+signed
+sizeof
+static
+static_cast
+struct
+switch
+template
+this
+throw
+true
+try
+typedef
+typeid
+typename
+union
+unsigned
+using
+virtual
+void
+volatile
+while
+xor
+xor_eq
+
+
diff --git a/parts/abbrev/kdevabbrev.desktop b/parts/abbrev/kdevabbrev.desktop
new file mode 100644
index 00000000..3e913e8d
--- /dev/null
+++ b/parts/abbrev/kdevabbrev.desktop
@@ -0,0 +1,83 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides support for customizable abbreviations - short words which expand into commonly needed code structures.
+Comment[ca]=Proporciona suport per a abreviatures personalitzables - paraules curtes que en expandir-se formen estructures de codi usades habitualment.
+Comment[da]=Sørger for støtte til brugerindrettede forkortelser - korte ord som udvides til almindeligt nyttige kodestrukturer.
+Comment[de]=Unterstützung für benutzerdefinierte Abkürzungen - Kurzbegriffe, die zu häufig verwendeten Quelltextstrukturen erweitert werden.
+Comment[el]=Προσφέρει υποστήριξη για προσαρμοσμένες συντομογραφίες - σύντομες λέξεις οι οποίες αναπτύσσονται σε συχνά χρησιμοποιούμενες δομές κώδικα.
+Comment[en_GB]=Provides support for customisable abbreviations - short words which expand into commonly needed code structures.
+Comment[es]=Proporciona soporte para las abreviaturas personalizables - palabras cortas que se expanden en estructuras utilizadas habitualmente.
+Comment[et]=Pakub kohandatavate lühendite toetust. Viimased on lühendid, mis laienevad sagedamini vajaminevateks koodistruktuurideks.
+Comment[eu]=Laburdura pertsonalizatuen euskarria eskeintzen du-normalean behar diren kode-egitura bezala zabalduko diren hitz motzak.
+Comment[fa]=پشتیبانی برای مختصرسازیهای سفارشی فراهم می‌کند - واژه‌های کوتاه که اغلب به ساختارهای کد مورد نیاز بسط می‌یابد.
+Comment[fr]=Fournit une prise en charge pour les abréviations personnalisables - mots abrégés qui s'étendent en structures de code communément nécessaires.
+Comment[gl]=Proporciona soporte para abreviaturas persoalizadas - palabras curtas que se expanden en estructuras de código usadas frecuentemente.
+Comment[hi]=मनपसंद किए जा सकने योग्य संक्षिप्त शब्दों जो कि सामान्यतया आवश्यक कोड स्ट्रक्चर में एक्सपांड हो सकें, के लिए समर्थन प्रदान करता है.
+Comment[hu]=Lehetővé teszi különféle rövidítések használatát (rövid kifejezések kódstruktúrává kibontását)
+Comment[it]=Offre il supporto per le abbreviazioni personalizzate - brevi parole che vengono espanse in strutture di codice richieste comunemente.
+Comment[ja]=短い単語を一般に必要とされるコードに展開する、カスタマイズ可能な略語のサポートを提供します。
+Comment[ms]=Menyediakan sokongan untuk kependekan boleh ditetapkan - perkataan pendek yang berkembang kepada struktur kod yang biasa diperlukan.
+Comment[nds]=Ünnerstütten för egen Afkörten - Kortwöör, de na faken bruukt Kodestrukturen utfooldt warrt.
+Comment[ne]=साझा आवश्यक सङ्केत बनावटमा विस्तार गरिने छोटो शब्द - अनुकूलन संक्षिप्त रूपका लागि समर्थन प्रदान गर्दछ ।
+Comment[nl]=Biedt ondersteuning voor afkortingen - korte stukjes tekst die expanderen tot veelgebruikte codestructuren.
+Comment[pl]=Umożliwia obsługę konfigurowalnych skrótów - krótkich słow rozszerzających się w często używane struktury kodu.
+Comment[pt]=Oferece o suporte para abreviaturas personalizadas - palavras curtas que podem expandir para estruturas de código normalmente necessárias.
+Comment[pt_BR]=Fornece suporte para abreviaturas personalizadas - palavras curtas que se expandem em estruturas de código normalmente necessárias.
+Comment[ru]=Предоставляет поддержку для настраиваемых сокращений - коротких слов, которые заменяются на часто используемые структуры кода.
+Comment[sk]=Poskytuje podporu pre prispôsobiteľné skratky - krátke slová, ktoré sa rozvinú do bežne potrebných kódových štruktúr.
+Comment[sr]=Обезбеђује подршку за прилагодљиве скраћенице — кратке речи које се проширују у уобичајено потребне структуре кôда.
+Comment[sr@Latn]=Obezbeđuje podršku za prilagodljive skraćenice — kratke reči koje se proširuju u uobičajeno potrebne strukture kôda.
+Comment[sv]=Ger stöd för anpassningsbara förkortningar: korta ord som expanderas till vanligt använda kodstrukturer.
+Comment[ta]=தேவைக்கேற்ப சுருக்கத்திற்கு இது ஆதரவு தரும்-குறியிடு வடிவத்திற்கு இந்த சுருக்கங்கள் மிகவும் உதவும்.
+Comment[tg]=Барои кӯтоҳ намоӣ ёрдами худро саҳм мегузорад, яъне калимаҳои кӯтоҳе, ки як хел вақт ба структураҳои коди истифода намоии истифода бурда мешавад.
+Comment[tr]=Özelleştirilebilir kısaltmalar için destek sağlar - sık ihtiyaç duyualan kod yapıları yerine geçen kısa kelimeler.
+Comment[zh_CN]=为自定义缩写提供支持 - 按需要扩展为所需代码结构的简短文字。
+Comment[zh_TW]=提供可調整的縮寫支援 - 將短的字擴展到常用的程式源碼結構。
+Name=KDevAbbrev
+Name[da]=KDevelop Forkortelser
+Name[de]=Abkürzungsmodul (KDevelop)
+Name[hi]=के-डेव-एब्रिवि
+Name[nds]=KDevelop-Afkörtenmoduul
+Name[pl]=KDevSkróty
+Name[sk]=KDev skratky
+Name[sv]=KDevelop förkortningar
+Name[zh_TW]=KDevelop 縮寫
+GenericName=Abbreviation Expansion
+GenericName[ca]=Expansió d'abreviatures
+GenericName[da]=Forkortelsesudvidelse
+GenericName[de]=Abkürzungsvervollständigung
+GenericName[el]=Ανάπτυξη συντομογραφιών
+GenericName[es]=Expansión de abreviaturas
+GenericName[et]=Lühendite laienemine
+GenericName[eu]=Laburduren zabalkuntza
+GenericName[fa]=بسط مختصرسازی
+GenericName[fr]=Expansion des abréviations
+GenericName[gl]=Expansión de abreviaturas
+GenericName[hi]=संक्षिप्त शब्द एक्सपांशन
+GenericName[hu]=Rövidítéskezelő
+GenericName[it]=Espansione delle abbreviazioni
+GenericName[ja]=略語拡張
+GenericName[ms]=Pengembang Kependekan
+GenericName[nds]=Afkörtenutfoolden
+GenericName[ne]=संक्षिप्त रूप विस्तार
+GenericName[nl]=Afkortingen expanderen
+GenericName[pl]=Rozwijanie skrótów
+GenericName[pt]=Expansão de Abreviaturas
+GenericName[pt_BR]=Expansão de Abreviaturas
+GenericName[ru]=Расширение сокращений
+GenericName[sk]=Rozvinutie skratiek
+GenericName[sr]=Проширење скраћеница
+GenericName[sr@Latn]=Proširenje skraćenica
+GenericName[sv]=Expansion av förkortningar
+GenericName[ta]=சுருக்கத்தின் விரிவாக்கம்
+GenericName[tg]=Васеъкунии кӯтоҳ карда шуда
+GenericName[tr]=Kısaltma Genişlemesi
+GenericName[zh_CN]=缩写扩展
+GenericName[zh_TW]=縮寫擴展
+ServiceTypes=KDevelop/Plugin
+Icon=fontsizeup
+X-KDE-Library=libkdevabbrev
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=CodeEditing
diff --git a/parts/abbrev/kdevabbrev.rc b/parts/abbrev/kdevabbrev.rc
new file mode 100644
index 00000000..e994ee76
--- /dev/null
+++ b/parts/abbrev/kdevabbrev.rc
@@ -0,0 +1,10 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevAbbrevPart" version="1">
+<MenuBar>
+ <Menu name="edit" >
+ <Action name="edit_expandtext"/>
+ <Action name="edit_expandabbrev"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/abbrev/qt_classes b/parts/abbrev/qt_classes
new file mode 100644
index 00000000..266307bc
--- /dev/null
+++ b/parts/abbrev/qt_classes
@@ -0,0 +1,409 @@
+QAccel
+QAccessible
+QApplication
+QAsciiDict
+QAsyncIO
+QAuBucket
+QBackInsertIterator
+QBaseBucket
+QBitArray
+QBitVal
+QBitmap
+QBoxLayout
+QBoxLayoutData
+QBrush
+QButton
+QButtonData
+QButtonGroup
+QButtonList
+QCDict
+QCList
+QCListIt
+QCString
+QCache
+QCanvas
+QCanvasChunk
+QCanvasData
+QCanvasEllipse
+QCanvasItem
+QCanvasItemExtra
+QCanvasLine
+QCanvasPixmap
+QCanvasPixmapArray
+QCanvasPolygon
+QCanvasPolygonalItem
+QCanvasRectangle
+QCanvasSprite
+QCanvasText
+QCanvasTextExtra
+QCanvasView
+QCanvasViewData
+QChar
+QCharRef
+QCharRef
+QCheckBox
+QCheckListItem
+QCleanupHandler
+QClipboard
+QColor
+QColorGroup
+QComboBox
+QComboBoxData
+QConnection
+QConnectionList
+QConnectionListIt
+QCursor
+QCustomMenuItem
+QDataSource
+QDataStream
+QDataStream
+QDate
+QDateTime
+QDeepCopy
+QDialog
+QDict
+QDir
+QDiskFont
+QDockArea
+QDockAreaLayout
+QDockWindow
+QDockWindowHandle
+QDockWindowResizeHandle
+QDockWindowTitleBar
+QDomAttr
+QDomCDATASection
+QDomCharacterData
+QDomComment
+QDomDocument
+QDomDocumentFragment
+QDomDocumentType
+QDomElement
+QDomEntity
+QDomEntityReference
+QDomImplementation
+QDomNamedNodeMap
+QDomNode
+QDomNodeList
+QDomNotation
+QDomProcessingInstruction
+QDomText
+QDragEnterEvent
+QDragLeaveEvent
+QDragMoveEvent
+QDragObject
+QDragObjectData
+QDropSite
+QEvent
+QEventLoop
+QFileDialog
+QFileDialogQFileListView
+QFileInfo
+QFilePreview
+QFocusData
+QFocusData
+QFocusEvent
+QFont
+QFontDatabase
+QFontEngine
+QFontInfo
+QFontMetrics
+QFontPrivate
+QFontStylePrivate
+QFtpCommand
+QGArray
+QGCacheIterator
+QGDItList
+QGDict
+QGDictIterator
+QGDictIterator
+QGL
+QGLCmap
+QGLColormap
+QGLOverlayWidget
+QGList
+QGListIterator
+QGListIteratorList
+QGListStdIterator
+QGVector
+QGfx
+QGridLayout
+QGridLayoutBox
+QGridLayoutData
+QGroupBox
+QGuardedPtr
+QHBoxLayout
+QHeader
+QHeaderData
+QHostAddress
+QHttpHeader
+QHttpRequest
+QIODevice
+QIconDragItem
+QIconFactory
+QIconSet
+QIconView
+QIconViewItem
+QIconViewItemLineEdit
+QIconViewPrivate
+QIconViewToolTip
+QImage
+QImageConsumer
+QImageDataMisc
+QImageDecoder
+QImageDrag
+QImageDragData
+QImageFormat
+QImageFormat
+QImageFormatType
+QImageIO
+QImageTextKeyLang
+QIntDict
+QInternal
+QJpUnicodeConv
+QKeyEvent
+QKeySequence
+QLNode
+QLabel
+QLayout
+QLayoutItem
+QLayoutIterator
+QLibrary
+QLineEdit
+QListBox
+QListBoxItem
+QListView
+QListViewItem
+QListViewItemIterator
+QListViewToolTip
+QLocale
+QMacDndExtra
+QMacMime
+QMacSavedPortInfo
+QMainWindow
+QMainWindowLayout
+QMap
+QMapConstIterator
+QMapIterator
+QMemberDict
+QMembuf
+QMenuBar
+QMenuData
+QMenuDataData
+QMenuItem
+QMenuItem
+QMenuItemData
+QMetaObject
+QMetaObject
+QMetaObjectCleanUp
+QMetaProperty
+QMetaProperty
+QMimeSource
+QMimeSourceFactory
+QMimeSourceFactory
+QMimeSourceFactoryData
+QMouseEvent
+QMovie
+QMovie
+QMultiCellPixmap
+QMultiLineEditCommand
+QMultiLineEditData
+QMutex
+QMutexLocker
+QNPInstance
+QNPStream
+QNPlugin
+QNetworkOperation
+QNetworkProtocol
+QNetworkProtocolFactoryBase
+QObject
+QObjectList
+QObjectListIt
+QObjectUserData
+QObjectUserData
+QOleDropTarget
+QPaintDevice
+QPaintDevice
+QPaintDeviceMetrics
+QPaintDeviceMetrics
+QPaintEvent
+QPainter
+QPalette
+QPen
+QPicture
+QPixmap
+QPixmapCache
+QPoint
+QPointArray
+QPolygonScanner
+QPolygonalProcessor
+QPopupMenu
+QPostEventList
+QPrinter
+QProcess
+QProgressDialogData
+QPtrCollection
+QPtrDict
+QPtrList
+QPtrVector
+QPushButton
+QRangeControl
+QRect
+QRect
+QRegExp
+QRegExpEngine
+QRegion
+QResizeEvent
+QSArgument
+QSEditor
+QSInterpreter
+QSObjectFactory
+QSProject
+QSScript
+QSStackFrame
+QSWrapperFactory
+QScrollViewData
+QSemaphore
+QSenderObjectList
+QSessionManager
+QSessionManagerData
+QSettings
+QSharedCleanupHandler
+QShowEvent
+QSignal
+QSignalMapperData
+QSignalVec
+QSimpleRichText
+QSimpleRichTextData
+QSingleCleanupHandler
+QSize
+QSizePolicy
+QSocket
+QSocketDevice
+QSocketNotifier
+QSoundData
+QSpacerItem
+QSpinBox
+QSplitter
+QSplitterHandle
+QSplitterLayoutStruct
+QSql
+QSqlCursor
+QSqlDatabase
+QSqlDriver
+QSqlDriverCreatorBase
+QSqlDriverExtension
+QSqlEditorFactory
+QSqlError
+QSqlExtension
+QSqlField
+QSqlFieldInfo
+QSqlForm
+QSqlIndex
+QSqlPropertyMap
+QSqlPropertyMap
+QSqlQuery
+QSqlRecord
+QSqlRecordInfo
+QSqlResult
+QStatusBar
+QStoredDragData
+QStrList
+QString
+QStringList
+QStyle
+QStyleFactory
+QStyleHintReturn
+QStyleOption
+QStyleSheet
+QStyleSheetItemData
+QSyntaxHighlighter
+QSyntaxHighlighterInternal
+QTSManip
+QTab
+QTabBar
+QTabWidgetData
+QTable
+QTableHeader
+QTableSelection
+QTextBrowser
+QTextBrowserData
+QTextCodec
+QTextCodec
+QTextCodecFactory
+QTextCommand
+QTextCursor
+QTextCustomItem
+QTextDecoder
+QTextDecoder
+QTextDocument
+QTextDrag
+QTextEdit
+QTextEncoder
+QTextFormat
+QTextFormatCollection
+QTextItem
+QTextOStreamIterator
+QTextParag
+QTextParagraph
+QTextStream
+QTextString
+QTextView
+QThread
+QThreadInstance
+QThreadStorage
+QThreadStorageData
+QTime
+QTimer
+QTimerEvent
+QTipManager
+QToolBar
+QToolButton
+QToolTipGroup
+QTranslator
+QTranslatorMessage
+QUrl
+QUrlInfo
+QUrlOperator
+QVBoxLayout
+QValidator
+QValueList
+QValueListConstIterator
+QValueListIterator
+QValueListNode
+QValueVector
+QVariant
+QWMatrix
+QWMatrix
+QWSDecoration
+QWSDisplay
+QWSManager
+QWSRegionManager
+QWaitCondition
+QWheelEvent
+QWidget
+QWidgetFactory
+QWidgetList
+QWidgetListIt
+QWidgetMapper
+QWidgetResizeHandler
+QWidgetStack
+QWindowsMime
+QWindowsXPStyle
+QWorkspaceChild
+QXmlAttributes
+QXmlContentHandler
+QXmlDTDHandler
+QXmlDeclHandler
+QXmlDefaultHandler
+QXmlEntityResolver
+QXmlErrorHandler
+QXmlInputSource
+QXmlLexicalHandler
+QXmlLocator
+QXmlNamespaceSupport
+QXmlParseException
+QXmlReader
+QXmlSimpleReader
+QPNGImageWriter
+QuickInterpreter
+UibStrTable
diff --git a/parts/appwizard/Makefile.am b/parts/appwizard/Makefile.am
new file mode 100644
index 00000000..cd37f1cb
--- /dev/null
+++ b/parts/appwizard/Makefile.am
@@ -0,0 +1,28 @@
+
+# Here resides the app wizard part.
+
+SUBDIRS = . imports common licenses
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \
+ -I$(top_srcdir)/src/profileengine/lib $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevappwizard.la
+libkdevappwizard_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevappwizard_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(top_builddir)/lib/util/libkdevutil.la \
+ $(top_builddir)/lib/widgets/propeditor/libkdevpropertyeditor.la $(top_builddir)/src/profileengine/lib/libprofileengine.la
+
+libkdevappwizard_la_SOURCES = appwizardfactory.cpp appwizardpart.cpp \
+ appwizarddlg.cpp importdlg.cpp filepropspagebase.ui filepropspage.cpp \
+ appwizarddlgbase.ui importdlgbase.ui misc.cpp vcs_form.ui\
+ kdevfile.cpp kdevlicense.cpp profilesupport.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevappwizard.desktop
+
+rcdir = $(kde_datadir)/kdevappwizard
+rc_DATA = kdevappwizard.rc
+noinst_HEADERS = profilesupport.h
diff --git a/parts/appwizard/README b/parts/appwizard/README
new file mode 100644
index 00000000..f3657a61
--- /dev/null
+++ b/parts/appwizard/README
@@ -0,0 +1 @@
+Please read the README.dox file \ No newline at end of file
diff --git a/parts/appwizard/README.dox b/parts/appwizard/README.dox
new file mode 100644
index 00000000..4e2858b0
--- /dev/null
+++ b/parts/appwizard/README.dox
@@ -0,0 +1,80 @@
+/** \class AppWizardPart
+Application Wizard.
+
+\verbatim
+The config files for the application Wizard understands following options
+
+Group [General]
+Name: this name will be displayed in the Treeview (Application Wizard)
+Icon: a screenshot from your application (190x140 pixel)
+Category: the category, will we displayed hierarchic in a
+ treeview (current implementation)
+Comment: a small comment for the template, longer comments should go
+ into a README.devel and shown on startup
+ShowFilesAfterGeneration:
+ this comma separated list of files will be opened after the project
+ generation, for instance a readme, path is relative to the project dir,
+ APPNAMEUC will be replaced with the project name in uppercase,
+ APPNAMELC will be replaced with the project name in lowercase,
+ APPNAME will be replaced with the project name.
+ (example: ShowFilesAfterGeneration=README.devel,APPNAMELC_plugin.cpp)
+DefaultDestinatonDir:
+ changes the default destination dir for the project (~)
+ to your value, HOMEDIR is a keyword
+FileTemplates:
+ a list of pairs of strings, where the first element is the
+ name a file template to be created, and the second element
+ is either CStyle, PStyle, ShellStyle, or None. With CStyle, the
+ application wizard proposes a file header in C comment style.
+ With PStyle the application wizard creates a header
+ in Pascal comment style. With ShellStyle, the application
+ wizard creates a header in shell comment style.
+
+an example for a php template:
+
+[General]
+Name=Simple PHP script
+Category=PHP
+Comment=This generates a simplistic 'Hello world' program in PHP (http://www.php.net)
+Icon= php.png
+ShowFilesAfterGeneration=README.devel
+DefaultDestinatonDir=HOMEDIR/public_html
+FileTemplates=php,ShellStyle
+
+The template project files (*.kdevelop) defines which parts are
+loaded for the project and how they are configured. The set of
+loaded parts is primarily determined by a set of key words.
+The following keywords are currently used:
+
+C C language
+C++ C++ language
+Java Java language
+Pascal Pascal language
+Python Python language
+PHP PHP language
+Perl Perl language
+Code Compiled to native, debuggable code
+JVM Executed and debugged in the Java VM
+GBA Game Boy Advance
+KDE KDE application/applet
+Qt Qt based
+Kicker Kicker applet
+kioslave KDE ioslave
+KOffice KOffice application
+KDevelop KDevelop plugin
+GNOME GNOME application
+\endverbatim
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\feature Provide a basic application framework (for plugins and applications for many languages) that you can use as a starting point.
+\feature Development for 3rd party developers made easy. :)
+\feature A further step to rapid application development (RAD).
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=appwizard&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">appwizard component at Bugzilla database</a>
+\bug The C/C++ applications use libtool as a degugging shell. That doesn't work. Please remove libtool from "Project Options...-> Debugger -> Debugging Shell" to make them work.
+
+\requirement <a href="http://www.perl.com"> perl </a> >= 5.004
+
+
+*/
diff --git a/parts/appwizard/appwizarddlg.cpp b/parts/appwizard/appwizarddlg.cpp
new file mode 100644
index 00000000..816786ff
--- /dev/null
+++ b/parts/appwizard/appwizarddlg.cpp
@@ -0,0 +1,1374 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2001 by Sandy Meier *
+ * smeier@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "appwizarddlg.h"
+
+#include <qvbox.h>
+#include <qbuttongroup.h>
+#include <qcombobox.h>
+#include <qtabwidget.h>
+#include <qwidgetstack.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qgrid.h>
+#include <qheader.h>
+#include <qmap.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qradiobutton.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include <qtextview.h>
+#include <qtoolbutton.h>
+#include <qtooltip.h>
+#include <qvalidator.h>
+#include <qtimer.h>
+#include <klistview.h>
+#include <kiconview.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <ktempfile.h>
+#include <kiconloader.h>
+#include <kfiledialog.h>
+#include <kfile.h>
+#include <kapplication.h>
+#include <kpopupmenu.h>
+
+#include <ktrader.h>
+#include <kparts/componentfactory.h>
+#include <kio/netaccess.h>
+#include <qfile.h>
+#include <kmacroexpander.h>
+#include <karchive.h>
+#include <ktar.h>
+#include <ktempdir.h>
+#include <kfileitem.h>
+#include <kio/chmodjob.h>
+
+#include <qlayout.h>
+
+#include "domutil.h"
+#include "kdevversioncontrol.h"
+#include "kdevmakefrontend.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugincontroller.h"
+#include "kdevappfrontend.h"
+#include "kdevplugininfo.h"
+#include "kdevlicense.h"
+#include "kdevcore.h"
+#include "appwizardfactory.h"
+#include "appwizardpart.h"
+#include "filepropspage.h"
+#include "misc.h"
+#include "profilesupport.h"
+#include "filetemplate.h"
+#include "settings.h"
+
+#include "blockingkprocess.h"
+
+#include "profileengine.h"
+#include "profile.h"
+
+#include "propeditor/property.h"
+#include "propeditor/multiproperty.h"
+#include "propeditor/propertylist.h"
+#include "propeditor/propertyeditor.h"
+
+AppWizardDialog::AppWizardDialog(AppWizardPart *part, QWidget *parent, const char *name)
+ : AppWizardDialogBase(parent, name,true), m_pCurrentAppInfo(0),
+ m_profileSupport(new ProfileSupport(part))
+{
+ kdDebug( 9010 ) << " ** AppWizardDialog::AppWizardDialog()" << endl;
+
+ m_customOptions = 0L;
+ loadLicenses();
+ connect( this, SIGNAL( selected( const QString & ) ), this, SLOT( pageChanged() ) );
+
+ helpButton()->hide();
+ templates_listview->header()->hide();
+ templates_listview->setColumnWidthMode(0, QListView::Maximum); //to provide horiz scrollbar.
+
+ m_templatesMenu = new KPopupMenu(templates_listview);
+ m_templatesMenu->insertItem(i18n("&Add to Favorites"), this, SLOT(addTemplateToFavourites()));
+
+ m_favouritesMenu = new KPopupMenu(favourites_iconview);
+ m_favouritesMenu->insertItem(i18n("&Remove Favorite"), this, SLOT(removeFavourite()));
+
+ m_pathIsValid=false;
+ m_part = part;
+ m_projectLocationWasChanged=false;
+ m_appsInfo.setAutoDelete(true);
+ m_tempFiles.setAutoDelete(true);
+
+ KConfig *config = kapp->config();
+
+ //config->setGroup("AppWizard");
+ //templates_tabwidget->setCurrentPage(config->readNumEntry("CurrentTab", 0));
+
+ config->setGroup("General Options");
+ QString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/");
+
+ KStandardDirs *dirs = AppWizardFactory::instance()->dirs();
+ QStringList m_templateNames = dirs->findAllResources("apptemplates", QString::null, false, true);
+
+ kdDebug(9010) << "Templates: " << endl;
+ QStringList categories;
+
+ QStringList::Iterator it;
+ for (it = m_templateNames.begin(); it != m_templateNames.end(); ++it) {
+ kdDebug(9010) << (*it) << endl;
+
+ ApplicationInfo *info = new ApplicationInfo;
+ info->propValues = new PropertyLib::PropertyList();
+ info->templateFile = KGlobal::dirs()->findResource("apptemplates", *it);
+ info->templateName = (*it);
+
+ KConfig templateConfig(info->templateFile);
+ templateConfig.setGroup("General");
+
+ info->name = templateConfig.readEntry("Name");
+ info->icon = templateConfig.readEntry("Icon");
+ info->comment = templateConfig.readEntry("Comment");
+ info->fileTemplates = templateConfig.readEntry("FileTemplates");
+ info->openFilesAfterGeneration = templateConfig.readListEntry("ShowFilesAfterGeneration");
+ QString destDir = templateConfig.readPathEntry("DefaultDestinatonDir", defaultProjectsDir);
+ destDir.replace(QRegExp("HOMEDIR"), QDir::homeDirPath());
+ info->defaultDestDir = destDir;
+ QString category = templateConfig.readEntry("Category");
+ // format category to a unique status
+ if (category.right(1) == "/")
+ category.remove(category.length()-1, 1); // remove /
+ if (category.left(1) != "/")
+ category.prepend("/"); // prepend /
+ categories.append(category);
+ info->category = category;
+ info->sourceArchive = templateConfig.readEntry("Archive");
+
+ // Grab includes list
+ QStringList groups = templateConfig.groupList();
+ groups.remove("General");
+ QStringList::Iterator group = groups.begin();
+ for( ; group != groups.end(); ++group)
+ {
+ templateConfig.setGroup( (*group) );
+ QString type = templateConfig.readEntry("Type").lower();
+ if( type == "include" ) // Add value
+ {
+ info->includes.append( templateConfig.readEntry( "File" ) );
+ kdDebug(9010) << "Adding: " << templateConfig.readEntry( "File" ) << endl;
+ }
+ }
+
+ // Build builtins map to bootstrap.
+ QString source = kdevRoot( info->templateName );
+ info->subMap.insert("kdevelop", source );
+
+ // Add includes to the main template...
+ QStringList::Iterator include = info->includes.begin();
+ for( ; include != info->includes.end(); ++include)
+ {
+ if( !(*include).isEmpty() )
+ {
+ QString file = KMacroExpander::expandMacros( ( *include ), info->subMap);
+ KConfig tmpCfg( file );
+ tmpCfg.copyTo( "", &templateConfig);
+ kdDebug(9010) << "Merging: " << tmpCfg.name() << endl;
+ }
+ }
+
+ groups = templateConfig.groupList(); // Must get this again since its changed!
+ group = groups.begin();
+ for( ; group != groups.end(); ++group)
+ {
+ templateConfig.setGroup( (*group) );
+ QString type = templateConfig.readEntry("Type", "value").lower();
+ kdDebug(9010) << "Reading " << (*group) << " of type " << type << endl;
+ if( type == "value" ) // Add value
+ {
+ QString name = templateConfig.readEntry( "Value" );
+ QString label = templateConfig.readEntry( "Comment" );
+ QString type = templateConfig.readEntry( "ValueType", "String" );
+ QVariant::Type variantType = QVariant::nameToType( type.latin1());
+ QVariant value = templateConfig.readPropertyEntry( "Default", variantType );
+ value.cast( variantType ); // fix this in kdelibs...
+ if( !name.isEmpty() && !label.isEmpty() )
+ info->propValues->addProperty( new PropertyLib::Property( (int)variantType, name, label, value ) );
+
+ }
+ else if( type == "install" ) // copy dir
+ {
+ installFile file;
+ file.source = templateConfig.readPathEntry("Source");
+ file.dest = templateConfig.readPathEntry("Dest");
+ file.process = templateConfig.readBoolEntry("Process",true);
+ file.isXML = templateConfig.readBoolEntry("EscapeXML",false);
+ file.option = templateConfig.readEntry("Option");
+ info->fileList.append(file);
+ }
+ else if( type == "install archive" )
+ {
+ installArchive arch;
+ arch.source = templateConfig.readPathEntry("Source");
+ arch.dest = templateConfig.readPathEntry("Dest");
+ arch.process = templateConfig.readBoolEntry("Process",true);
+ arch.option = templateConfig.readEntry("Option", "" );
+ info->archList.append(arch);
+ }
+ else if( type == "mkdir" )
+ {
+ installDir dir;
+ dir.dir = templateConfig.readPathEntry("Dir");
+ dir.option = templateConfig.readEntry("Option", "" );
+ dir.perms = templateConfig.readNumEntry("Perms", 0777 );
+ info->dirList.append(dir);
+ }
+ else if( type == "finishcmd" )
+ {
+ info->finishCmd=templateConfig.readPathEntry("Command");
+ info->finishCmdDir=templateConfig.readPathEntry("Directory");
+ }
+ else if( type == "ui")
+ {
+ QString name = templateConfig.readPathEntry("File");
+ info->customUI = name;
+ }
+ else if( type == "message" )
+ {
+ info->message = templateConfig.readEntry( "Comment" );
+ }
+ }
+
+
+ m_appsInfo.append(info);
+ }
+
+ // Insert categories into list view
+ categories.sort();
+ for (it = categories.begin(); it != categories.end(); ++it)
+ insertCategoryIntoTreeView(*it);
+
+ // Insert items into list view
+ QPtrListIterator<ApplicationInfo> ait(m_appsInfo);
+ for (; ait.current(); ++ait) {
+ QListViewItem *item = m_categoryMap.find(ait.current()->category);
+ if (item)
+ {
+ item = new KListViewItem(item, ait.current()->name);
+ item->setPixmap(0, SmallIcon("kdevelop"));
+ }
+ else
+ kdDebug(9010) << "Error can't find category in categoryMap: "
+ << ait.current()->category << endl;
+ ait.current()->item = item;
+ }
+
+ //Load favourites from config
+ populateFavourites();
+
+ QString author, email;
+ AppWizardUtil::guessAuthorAndEmail(&author, &email);
+ author_edit->setText(author);
+ email_edit->setText(email);
+ QToolTip::add( dest_edit->button(), i18n("Choose projects directory") );
+ dest_edit->setURL(defaultProjectsDir);
+ dest_edit->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
+
+ loadVcs();
+
+ // addPage(m_sdi_fileprops_page,"Class/File Properties");
+
+ // licenseChanged();
+
+ setNextEnabled(generalPage, false);
+
+// QRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*"); //Non-Unicode version
+ /* appname will start with a letter, and will contain letters,
+ digits or underscores. */
+ QRegExp appname_regexp ("[a-zA-Z][a-zA-Z0-9_]*");
+ // How about names like "__" or "123" for project name? Are they legal?
+ QRegExpValidator *appname_edit_validator;
+ appname_edit_validator = new QRegExpValidator (appname_regexp,
+ appname_edit,
+ "AppNameValidator");
+ appname_edit->setValidator(appname_edit_validator);
+
+ // insert the licenses into the license_combo
+ QDict< KDevLicense > lics( licenses() );
+ QDictIterator< KDevLicense > dit(lics);
+ int idx=1;
+ for( ; dit.current(); ++dit )
+ {
+ license_combo->insertItem( dit.currentKey(), idx++ );
+ if( dit.currentKey() == "GPL" )
+ license_combo->setCurrentItem( idx - 1 );
+ }
+
+ connect( license_combo, SIGNAL(activated(int)), this, SLOT(licenseChanged()) );
+
+ m_custom_options_layout = new QHBoxLayout( custom_options );
+ m_custom_options_layout->setAutoAdd(true);
+
+ showTemplates(false);
+}
+
+AppWizardDialog::~AppWizardDialog()
+{}
+
+void AppWizardDialog::loadVcs()
+{
+ m_vcsForm = new VcsForm();
+
+ int i=0;
+ m_vcsForm->combo->insertItem( i18n("no version control system", "None"), i );
+ m_vcsForm->stack->addWidget( 0, i++ );
+
+ // We query for all vcs integrators for KDevelop
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/VCSIntegrator", "");
+ KTrader::OfferList::const_iterator serviceIt = offers.begin();
+ for (; serviceIt != offers.end(); ++serviceIt)
+ {
+ KService::Ptr service = *serviceIt;
+ kdDebug(9010) << "AppWizardDialog::loadVcs: creating vcs integrator "
+ << service->name() << endl;
+
+ KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ if (!factory) {
+ QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ kdDebug(9010) << "There was an error loading the module " << service->name() << endl <<
+ "The diagnostics is:" << endl << errorMessage << endl;
+ continue;
+ }
+ QStringList args;
+ QObject *obj = factory->create(0, service->name().latin1(),
+ "KDevVCSIntegrator", args);
+ KDevVCSIntegrator *integrator = (KDevVCSIntegrator*) obj;
+
+ if (!integrator)
+ kdDebug(9010) << " failed to create vcs integrator " << service->name() << endl;
+ else
+ {
+ kdDebug(9010) << " success" << endl;
+
+ QString vcsName = service->property("X-KDevelop-VCS").toString();
+ m_vcsForm->combo->insertItem(vcsName, i);
+ m_integrators.insert(vcsName, integrator);
+
+ VCSDialog *vcs = integrator->integrator(m_vcsForm->stack);
+ if (vcs)
+ {
+ m_integratorDialogs[i] = vcs;
+ QWidget *w = vcs->self();
+ if (w)
+ m_vcsForm->stack->addWidget(w, i++);
+ else
+ kdDebug(9010) << " integrator widget is 0" << endl;
+ }
+ else
+ kdDebug(9010) << " integrator is 0" << endl;
+ }
+ }
+
+ addPage(m_vcsForm, i18n("Version Control System"));
+}
+
+void AppWizardDialog::updateNextButtons()
+{
+ bool validGeneralPage = m_pCurrentAppInfo
+ && !appname_edit->text().isEmpty()
+ && m_pathIsValid;
+ bool validPropsPage = !version_edit->text().isEmpty()
+ && !author_edit->text().isEmpty();
+
+ setFinishEnabled(m_lastPage, validGeneralPage && validPropsPage);
+ nextButton()->setEnabled(
+ currentPage() == generalPage ? validGeneralPage : validPropsPage );
+}
+
+void AppWizardDialog::textChanged()
+{
+// licenseChanged();
+
+ updateNextButtons();
+}
+
+void AppWizardDialog::licenseChanged()
+{
+ QValueList<AppWizardFileTemplate>::Iterator it;
+ if( license_combo->currentItem() == 0 )
+ {
+ for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it)
+ {
+ QMultiLineEdit *edit = (*it).edit;
+ edit->setText( QString::null );
+ }
+ } else {
+ KDevLicense* lic = licenses()[ license_combo->currentText() ];
+ for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) {
+ QString style = (*it).style;
+ QMultiLineEdit *edit = (*it).edit;
+
+ KDevFile::CommentingStyle commentStyle = KDevFile::CPPStyle;
+ if (style == "PStyle") {
+ commentStyle = KDevFile::PascalStyle;
+ } else if (style == "AdaStyle") {
+ commentStyle = KDevFile::AdaStyle;
+ } else if (style == "ShellStyle") {
+ commentStyle = KDevFile::BashStyle;
+ } else if (style == "XMLStyle") {
+ commentStyle = KDevFile::XMLStyle;
+ }
+
+ QString text;
+ text = lic->assemble( commentStyle, author_edit->text(), email_edit->text() , 0 );
+ edit->setText(text);
+ }
+ }
+}
+
+QString AppWizardDialog::kdevRoot(const QString &templateName ) const
+{
+ QString source;
+ QFileInfo finfo(templateName);
+ QDir dir(finfo.dir());
+ dir.cdUp();
+ return dir.absPath();
+}
+
+void AppWizardDialog::accept()
+{
+ QFileInfo fi(finalLoc_label->text());
+ // check /again/ whether the dir already exists; maybe users create it in the meantime
+ if (fi.exists() ) {
+ KMessageBox::sorry(this, i18n("The directory you have chosen as the location for "
+ "the project already exists."));
+ showPage(generalPage);
+ appname_edit->setFocus();
+ projectLocationChanged();
+ return;
+ }
+
+ if( !QFileInfo(dest_edit->url()).isWritable() ){
+ KMessageBox::sorry(this, i18n("The directory you have chosen as the location for "
+ "the project is not writeable."));
+ showPage(generalPage);
+ appname_edit->setFocus();
+ projectLocationChanged();
+ return;
+ }
+
+ QString source = kdevRoot( m_pCurrentAppInfo->templateName );
+
+ // Unpack template archive to temp dir, and get the name
+ kdDebug(9010) << "Unpacking archive to temp dir" << endl;
+ KTempDir archDir;
+ archDir.setAutoDelete(true);
+ KTar templateArchive( source + "/" + m_pCurrentAppInfo->sourceArchive, "application/x-gzip" );
+ if( templateArchive.open( IO_ReadOnly ) )
+ {
+ //templateArchive.directory()->copyTo(archDir.name(), true);
+ unpackArchive(templateArchive.directory(), archDir.name(), false);
+ }
+ else
+ {
+ KMessageBox::sorry(this, i18n("The template %1 cannot be opened.").arg( source + "/" + m_pCurrentAppInfo->sourceArchive ) );
+ templateArchive.close();
+ return;
+ }
+ templateArchive.close();
+
+ kdDebug(9010) << "build macro map" << endl;
+ // Build KMacroExpander map
+ //m_customOptions->dataForm()->fillPropertyMap(&m_pCurrentAppInfo->subMap);
+ PropertyLib::PropertyList::Iterator idx = m_pCurrentAppInfo->propValues->begin();
+ for( ; idx != m_pCurrentAppInfo->propValues->end(); ++idx)
+ m_pCurrentAppInfo->subMap.insert( idx.data()->name(), idx.data()->value().toString() );
+
+ m_pCurrentAppInfo->subMap.insert("src", archDir.name() );
+ m_pCurrentAppInfo->subMap.insert("dest", finalLoc_label->text() );
+ m_pCurrentAppInfo->subMap.insert("APPNAME", appname_edit->text() );
+ m_pCurrentAppInfo->subMap.insert("APPNAMELC", appname_edit->text().lower() );
+ m_pCurrentAppInfo->subMap.insert("APPNAMESC", QString(appname_edit->text()[0]).upper() + appname_edit->text().mid(1));
+ m_pCurrentAppInfo->subMap.insert("APPNAMEUC", appname_edit->text().upper() );
+ m_pCurrentAppInfo->subMap.insert("AUTHOR", author_edit->text() );
+ m_pCurrentAppInfo->subMap.insert("EMAIL", email_edit->text() );
+ m_pCurrentAppInfo->subMap.insert("VERSION", version_edit->text());
+ m_pCurrentAppInfo->subMap.insert( "I18N", "i18n" );
+ m_pCurrentAppInfo->subMap.insert("YEAR", QString::number( QDate::currentDate().year() ) );
+
+ // This isn't too pretty, but we have several templates that use KAboutData::License_${LICENSE}
+ // and unsurprisingly, KAboutData doesn't cover every imaginable case.
+ // These are the licenses known to KDE-3.2 KAboutData, KDevelop doesn't have all of these as prepared options today
+ QString license = license_combo->currentText();
+ if ( license == "GPL" || license == "GPL_V2" || license == "LGPL" || license == "LGPL_V2"||
+ license == "BSD" || license == "NCSA" || license == "MIT" || license == "Artistic" ||
+ license == "QPL" || license == "QPL_V1_0" )
+ {
+ m_pCurrentAppInfo->subMap.insert("LICENSE", license );
+ }
+ else
+ {
+ m_pCurrentAppInfo->subMap.insert("LICENSE", "Custom" );
+ }
+
+
+ QStringList cleanUpSubstMap;
+ cleanUpSubstMap << "src" << "I18N" << "kdevelop";
+
+
+ kdDebug(9010) << "add template files" << endl;
+ // Add template files to the fileList
+ installDir templateDir;
+ templateDir.dir = "%{dest}/templates";
+ m_pCurrentAppInfo->dirList.prepend(templateDir);
+
+ installDir baseDir;
+ baseDir.dir = "%{dest}";
+ m_pCurrentAppInfo->dirList.prepend( baseDir );
+
+ // This is too silly for words, but it's either this or reimplementing FileTemplate
+ QString tempProjectDomSource = "<!DOCTYPE kdevelop><kdevelop><general><author>%1</author><email>%2</email><version>%3</version></general></kdevelop>";
+ tempProjectDomSource = tempProjectDomSource.arg( author_edit->text() ).arg( email_edit->text() ).arg( version_edit->text() );
+ QDomDocument tempProjectDom;
+ tempProjectDom.setContent( tempProjectDomSource );
+
+ QValueList<AppWizardFileTemplate>::Iterator it;
+ for (it = m_fileTemplates.begin(); it != m_fileTemplates.end(); ++it) {
+ KTempFile *tempFile = new KTempFile();
+ m_tempFiles.append(tempFile);
+
+ QString templateText( FileTemplate::makeSubstitutions( tempProjectDom, (*it).edit->text() ) );
+ QFile f;
+ f.open(IO_WriteOnly, tempFile->handle());
+ QTextStream temps(&f);
+ temps.setEncoding(QTextStream::UnicodeUTF8);
+ temps << templateText;
+ f.flush();
+ QString templateName( QString( "%1_TEMPLATE" ).arg( (*it).suffix ).upper() );
+ cleanUpSubstMap << templateName;
+ m_pCurrentAppInfo->subMap.insert( templateName, KMacroExpander::expandMacros(templateText , m_pCurrentAppInfo->subMap) );
+
+ installFile file;
+ file.source = tempFile->name();
+ file.dest = QString( "%{dest}/templates/%1" ).arg( (*it).suffix );
+ file.process = true;
+ file.isXML = false;
+ m_pCurrentAppInfo->fileList.append( file );
+ }
+
+ // Add license file to the file list
+ QString licenseFile, licenseName = i18n("Custom");
+
+ if( license_combo->currentItem() != 0 )
+ {
+ licenseName = license_combo->currentText();
+ KDevLicense* lic = licenses()[ licenseName ];
+ if( lic )
+ {
+ QStringList files( lic->copyFiles() );
+ QStringList::Iterator it = files.begin();
+ for( ; it != files.end(); ++it )
+ {
+ installFile file;
+ file.source = QString( "%{kdevelop}/template-common/%1" ).arg( *it );
+ file.dest = QString("%{dest}/%1").arg( *it );
+ file.process = true;
+ file.isXML = false;
+ m_pCurrentAppInfo->fileList.append( file );
+ }
+
+ m_pCurrentAppInfo->subMap.insert("LICENSEFILE", files.first() );
+ }
+ }
+
+ // Run macro expander on both the dir map and file maps
+ QValueList<installFile>::Iterator fileIt = m_pCurrentAppInfo->fileList.begin();
+ for( ; fileIt != m_pCurrentAppInfo->fileList.end(); ++fileIt)
+ {
+ (*fileIt).source = KMacroExpander::expandMacros((*fileIt).source , m_pCurrentAppInfo->subMap);
+ kdDebug(9010) << "Updating file dest: " << (*fileIt).dest << " with " << KMacroExpander::expandMacros((*fileIt).dest , m_pCurrentAppInfo->subMap) << endl;
+ (*fileIt).dest = KMacroExpander::expandMacros((*fileIt).dest , m_pCurrentAppInfo->subMap);
+ }
+
+ QValueList<installArchive>::Iterator archIt = m_pCurrentAppInfo->archList.begin();
+ for( ; archIt != m_pCurrentAppInfo->archList.end(); ++archIt)
+ {
+ (*archIt).source = KMacroExpander::expandMacros((*archIt).source , m_pCurrentAppInfo->subMap);
+ (*archIt).dest = KMacroExpander::expandMacros((*archIt).dest , m_pCurrentAppInfo->subMap);
+ }
+
+ QValueList<installDir>::Iterator dirIt = m_pCurrentAppInfo->dirList.begin();
+ for( ; dirIt != m_pCurrentAppInfo->dirList.end(); ++dirIt)
+ {
+ (*dirIt).dir = KMacroExpander::expandMacros((*dirIt).dir , m_pCurrentAppInfo->subMap);
+ }
+
+ if( !m_pCurrentAppInfo->finishCmd.isEmpty() )
+ {
+ m_pCurrentAppInfo->finishCmd = KMacroExpander::expandMacros(
+ m_pCurrentAppInfo->finishCmd, m_pCurrentAppInfo->subMap );
+ m_pCurrentAppInfo->finishCmdDir = KMacroExpander::expandMacros(
+ m_pCurrentAppInfo->finishCmdDir, m_pCurrentAppInfo->subMap );
+ }
+
+ QMap<QString,QString>::Iterator mapIt( m_pCurrentAppInfo->subMap.begin() );
+ for( ; mapIt != m_pCurrentAppInfo->subMap.end(); ++mapIt )
+ {
+ QString escaped( mapIt.data() );
+ escaped.replace( "&", "&amp;" );
+ escaped.replace( "<", "&lt;" );
+ escaped.replace( ">", "&gt;" );
+ m_pCurrentAppInfo->subMapXML.insert( mapIt.key(), escaped );
+ }
+
+ // Create dirs
+ dirIt = m_pCurrentAppInfo->dirList.begin();
+ for( ; dirIt != m_pCurrentAppInfo->dirList.end(); ++dirIt)
+ {
+ kdDebug( 9010 ) << "Process dir " << (*dirIt).dir << endl;
+ if( m_pCurrentAppInfo->subMap[(*dirIt).option] != "false" )
+ {
+ if( ! KIO::NetAccess::mkdir( (*dirIt).dir, this ) )
+ {
+ KMessageBox::sorry(this, i18n("The directory %1 cannot be created.").arg( (*dirIt).dir ) );
+ return;
+ }
+ }
+ }
+ // Unpack archives
+ archIt = m_pCurrentAppInfo->archList.begin();
+ for( ; archIt != m_pCurrentAppInfo->archList.end(); ++archIt)
+ {
+ if( m_pCurrentAppInfo->subMap[(*archIt).option] != "false" )
+ {
+ kdDebug( 9010 ) << "unpacking archive " << (*archIt).source << endl;
+ KTar archive( (*archIt).source, "application/x-gzip" );
+ if( archive.open( IO_ReadOnly ) )
+ {
+ unpackArchive( archive.directory(), (*archIt).dest, (*archIt).process );
+ }
+ else
+ {
+ KMessageBox::sorry(this, i18n("The archive %1 cannot be opened.").arg( (*archIt).source ) );
+ archive.close();
+ return;
+ }
+ archive.close();
+ }
+
+ }
+
+ // Copy files & Process
+ fileIt = m_pCurrentAppInfo->fileList.begin();
+ for( ; fileIt != m_pCurrentAppInfo->fileList.end(); ++fileIt)
+ {
+ kdDebug( 9010 ) << "Process file " << (*fileIt).source << endl;
+ if( m_pCurrentAppInfo->subMap[(*fileIt).option] != "false" )
+ {
+ if( !copyFile( *fileIt ) )
+ {
+ KMessageBox::sorry(this, i18n("The file %1 cannot be created.").arg( (*fileIt).dest) );
+ return;
+ }
+ setPermissions(*fileIt);
+ }
+ }
+ // if dir still does not exist
+ if (!fi.dir().exists()) {
+ KMessageBox::sorry(this, i18n("The directory above the chosen location does not exist and cannot be created."));
+ showPage(generalPage);
+ dest_edit->setFocus();
+ return;
+ }
+
+// KMessageBox::information(this, KMacroExpander::expandMacros(m_pCurrentAppInfo->message, m_pCurrentAppInfo->subMap));
+
+ QStringList::Iterator cleanIt = cleanUpSubstMap.begin();
+ for(;cleanIt != cleanUpSubstMap.end(); ++cleanIt )
+ {
+ m_pCurrentAppInfo->subMap.remove( *cleanIt );
+ }
+
+ if (!m_pCurrentAppInfo->finishCmd.isEmpty())
+ {
+ BlockingKProcess proc;
+ proc.setWorkingDirectory( m_pCurrentAppInfo->finishCmdDir );
+ proc.setUseShell( true );
+ proc << "cd" << m_pCurrentAppInfo->finishCmdDir << "&&";
+ proc << m_pCurrentAppInfo->finishCmd;
+ kdDebug(9010) << "Executing:" << proc.args() << endl;
+ proc.start( KProcess::NotifyOnExit );
+ if( !proc.isRunning() && !proc.normalExit() )
+ {
+ kdDebug(9010) << "Couldn't execute: " << proc.args() << endl;
+ }
+ }
+
+
+
+ int id = m_vcsForm->stack->id(m_vcsForm->stack->visibleWidget());
+ if (id)
+ {
+ VCSDialog *vcs = m_integratorDialogs[id];
+ if (vcs)
+ {
+ kdDebug(9010) << "vcs integrator dialog is ready" << endl;
+ vcs->accept();
+ }
+ else
+ kdDebug(9010) << "no vcs integrator dialog" << endl;
+ }
+ else
+ kdDebug(9010) << "vcs integrator wasn't selected" << endl;
+
+ openAfterGeneration();
+ QWizard::accept();
+}
+
+bool AppWizardDialog::copyFile( const installFile& file )
+{
+ kdDebug(9010) << "Copying file" << file.dest << endl;
+ return
+ copyFile( file.source, file.dest, file.isXML, file.process );
+}
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+bool AppWizardDialog::copyFile( const QString &source, const QString &dest, bool isXML, bool process )
+{
+ kdDebug( 9010 ) << "Copy: " << source << " to " << dest << endl;
+ if( process )
+ {
+ // Process the file and save it at the destFile location
+ QFile inputFile( source);
+ QFile outputFile( dest );
+
+ const QMap<QString,QString> &subMap = isXML ?
+ m_pCurrentAppInfo->subMapXML : m_pCurrentAppInfo->subMap;
+ if( inputFile.open( IO_ReadOnly ) && outputFile.open(IO_WriteOnly) )
+ {
+ QTextStream input( &inputFile );
+ input.setEncoding(QTextStream::UnicodeUTF8);
+ QTextStream output( &outputFile );
+ output.setEncoding(QTextStream::UnicodeUTF8);
+ while( !input.atEnd() )
+ output << KMacroExpander::expandMacros(input.readLine(), subMap) << "\n";
+ // Preserve file mode...
+ struct stat fmode;
+ ::fstat( inputFile.handle(), &fmode);
+ ::fchmod( outputFile.handle(), fmode.st_mode );
+
+ }
+ else
+ {
+ inputFile.close();
+ outputFile.close();
+ return false;
+ }
+ }
+ else
+ {
+ // Copy the source file to the destFile.
+ return KIO::NetAccess::copy( source, dest, this );
+ }
+ return true;
+}
+
+void AppWizardDialog::unpackArchive( const KArchiveDirectory *dir, const QString &dest, bool process )
+{
+ KIO::NetAccess::mkdir( dest , this );
+ kdDebug(9010) << "Dir : " << dir->name() << " at " << dest << endl;
+ QStringList entries = dir->entries();
+ kdDebug(9010) << "Entries : " << entries.join(",") << endl;
+
+ KTempDir tdir;
+
+ QStringList::Iterator entry = entries.begin();
+ for( ; entry != entries.end(); ++entry )
+ {
+
+ if( dir->entry( (*entry) )->isDirectory() )
+ {
+ const KArchiveDirectory *file = (KArchiveDirectory *)dir->entry( (*entry) );
+ unpackArchive( file , dest + "/" + file->name(), process);
+ }
+ else if( dir->entry( (*entry) )->isFile() )
+ {
+ const KArchiveFile *file = (KArchiveFile *) dir->entry( (*entry) );
+ if( !process )
+ {
+ file->copyTo( dest );
+ setPermissions(file, dest + "/" + file->name());
+ }
+ else
+ {
+ file->copyTo(tdir.name());
+ // assume that an archive does not contain XML files
+ // ( where should we currently get that info from? )
+ if ( !copyFile( QDir::cleanDirPath(tdir.name()+"/"+file->name()), dest + "/" + file->name(), false, process ) )
+ {
+ KMessageBox::sorry(this, i18n("The file %1 cannot be created.").arg( dest) );
+ return;
+ }
+ setPermissions(file, dest + "/" + file->name());
+ }
+ }
+ }
+ tdir.unlink();
+}
+
+void AppWizardDialog::templatesTreeViewClicked(QListViewItem *item)
+{
+ if( m_customOptions )
+ delete m_customOptions;
+
+ // Delete old file template pages
+ while (!m_fileTemplates.isEmpty()) {
+ QMultiLineEdit *edit = m_fileTemplates.first().edit;
+ removePage(edit);
+ delete edit;
+ m_fileTemplates.remove(m_fileTemplates.begin());
+ }
+ m_lastPage = 0;
+
+ ApplicationInfo *info = templateForItem(item);
+ if (info) {
+ m_pCurrentAppInfo = info;
+ if (!info->icon.isEmpty()) {
+ QFileInfo fi(info->templateName);
+ QDir dir(fi.dir());
+ dir.cdUp();
+ QPixmap pm;
+ pm.load(dir.filePath(info->icon));
+ icon_label->setPixmap(pm);
+ } else {
+ icon_label->clear();
+ }
+ desc_textview->setText(info->comment);
+// dest_edit->setURL(info->defaultDestDir);
+ m_projectLocationWasChanged = false;
+ //projectNameChanged(); // set the dest new
+
+ // Populate new custom options form
+ m_customOptions = new PropertyLib::PropertyEditor( custom_options );
+ m_customOptions->populateProperties(info->propValues);
+
+
+ // Create new file template pages
+ QStringList l = QStringList::split(",", info->fileTemplates);
+ if (l.empty()) //if the app template doesn't show file templates, we need to set another m_lastPage, aleXXX
+ m_lastPage=m_vcsForm;
+
+ QStringList::ConstIterator it = l.begin();
+ while (it != l.end()) {
+ AppWizardFileTemplate fileTemplate;
+ fileTemplate.suffix = *it;
+ ++it;
+ if (it != l.end()) {
+ fileTemplate.style = *it;
+ ++it;
+ } else
+ fileTemplate.style = "";
+
+ QMultiLineEdit *edit = new QMultiLineEdit(this);
+ edit->setWordWrap(QTextEdit::NoWrap);
+ edit->setFont(KGlobalSettings::fixedFont());
+ if (it == l.end())
+ m_lastPage = edit;
+ fileTemplate.edit = edit;
+ addPage(edit, i18n("Template for .%1 Files").arg(fileTemplate.suffix));
+ m_fileTemplates.append(fileTemplate);
+ }
+ licenseChanged(); // to populate the template views
+ textChanged(); // update Next button state
+ } else {
+ m_customOptions=0;
+ m_pCurrentAppInfo=0;
+ icon_label->clear();
+ desc_textview->clear();
+ nextButton()->setEnabled(false);
+ }
+}
+
+
+void AppWizardDialog::destButtonClicked(const QString& dir)
+{
+ if(!dir.isEmpty()) {
+
+ // set new location as default project dir?
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+ QDir defPrjDir( config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()) );
+ QDir newDir (dir);
+ kdDebug(9010) << "DevPrjDir == newdir?: " << defPrjDir.absPath() << " == " << newDir.absPath() << endl;
+ if (defPrjDir != newDir) {
+ if (KMessageBox::questionYesNo(this, i18n("Set default project location to: %1?").arg( newDir.absPath() ),
+ i18n("New Project"), i18n("Set"), i18n("Do Not Set")) == KMessageBox::Yes)
+ {
+ config->writePathEntry("DefaultProjectsDir", newDir.absPath() + "/");
+ config->sync();
+ }
+ }
+ }
+}
+
+
+void AppWizardDialog::projectNameChanged()
+{
+ // Location was already edited by hand => don't change
+}
+
+
+void AppWizardDialog::projectLocationChanged()
+{
+ // Jakob Simon-Gaarde: Got tired of the anoying bug with the appname/location confussion.
+ // This version insures WYSIWYG and checks pathvalidity
+ finalLoc_label->setText(dest_edit->url() + (dest_edit->url().right(1)=="/" ? "":"/") + appname_edit->text());
+ QDir qd(dest_edit->url());
+ QFileInfo fi(dest_edit->url() + "/" + appname_edit->text());
+ if (!qd.exists() || appname_edit->displayText().isEmpty()||fi.exists())
+ {
+ if (!fi.exists() || appname_edit->displayText().isEmpty()) {
+ finalLoc_label->setText(finalLoc_label->text() + i18n("invalid location", " (invalid)"));
+ } else {
+ finalLoc_label->setText(finalLoc_label->text() + i18n(" (dir/file already exists)"));
+ }
+ m_pathIsValid=false;
+ } else {
+ m_pathIsValid=true;
+ }
+ updateNextButtons();
+}
+
+
+void AppWizardDialog::insertCategoryIntoTreeView(const QString &completeCategoryPath)
+{
+ kdDebug(9010) << "TemplateCategory: " << completeCategoryPath << endl;
+ QStringList categories = QStringList::split("/", completeCategoryPath);
+ QString category ="";
+ QListViewItem* pParentItem=0;
+
+ QStringList::ConstIterator it;
+ for (it = categories.begin(); it != categories.end(); ++it) {
+ category = category + "/" + *it;
+ QListViewItem *item = m_categoryMap.find(category);
+ if (!item) { // not found, create it
+ if (!pParentItem)
+ pParentItem = new KListViewItem(templates_listview,*it);
+ else
+ pParentItem = new KListViewItem(pParentItem,*it);
+
+ pParentItem->setPixmap(0, SmallIcon("folder"));
+ //pParentItem->setOpen(true);
+ kdDebug(9010) << "Category: " << category << endl;
+ m_categoryMap.insert(category,pParentItem);
+ m_categoryItems.append(pParentItem);
+ } else {
+ pParentItem = item;
+ }
+ }
+}
+
+
+ApplicationInfo *AppWizardDialog::templateForItem(QListViewItem *item)
+{
+ QPtrListIterator<ApplicationInfo> it(m_appsInfo);
+ for (; it.current(); ++it)
+ if (it.current()->item == item)
+ return it.current();
+
+ return 0;
+}
+
+void AppWizardDialog::openAfterGeneration()
+{
+ QString projectFile( finalLoc_label->text() + "/" + appname_edit->text().lower() + ".kdevelop" );
+
+ // Read the DOM of the newly created project
+ QFile file( projectFile );
+ if( !file.open( IO_ReadOnly ) )
+ return;
+ QDomDocument projectDOM;
+
+ int errorLine, errorCol;
+ QString errorMsg;
+ bool success = projectDOM.setContent( &file, &errorMsg, &errorLine, &errorCol);
+ file.close();
+ if ( !success )
+ {
+ KMessageBox::sorry( 0, i18n("This is not a valid project file.\n"
+ "XML error in line %1, column %2:\n%3")
+ .arg(errorLine).arg(errorCol).arg(errorMsg));
+ return;
+ }
+
+ // DOM Modifications go here
+ DomUtil::writeMapEntry( projectDOM, "substmap", m_pCurrentAppInfo->subMap );
+
+ //save the selected vcs
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/VCSIntegrator", QString("[X-KDevelop-VCS]=='%1'").arg(m_vcsForm->combo->currentText()));
+ if (offers.count() == 1)
+ {
+ KService::Ptr service = offers.first();
+ DomUtil::writeEntry(projectDOM, "/general/versioncontrol", service->property("X-KDevelop-VCSPlugin").toString());
+ }
+
+ // figure out what plugins we should disable by default
+ QString profileName = DomUtil::readEntry( projectDOM, "general/profile" );
+ if ( profileName.isEmpty() )
+ {
+ QString language = DomUtil::readEntry( projectDOM, "general/primarylanguage" );
+ QStringList keywords = DomUtil::readListEntry( projectDOM, "general/keywords", "keyword" );
+
+ profileName = Settings::profileByAttributes( language, keywords );
+ }
+
+ ProfileEngine & engine = m_part->pluginController()->engine();
+ Profile * profile = engine.findProfile( profileName );
+
+ QStringList disableList;
+ Profile::EntryList disableEntryList = profile->list( Profile::ExplicitDisable );
+ for ( Profile::EntryList::const_iterator it = disableEntryList.constBegin(); it != disableEntryList.constEnd(); ++it )
+ {
+ disableList << (*it).name;
+ }
+
+ QStringList projectIgnoreparts = DomUtil::readListEntry( projectDOM, "/general/ignoreparts", "part" );
+ projectIgnoreparts += disableList;
+ DomUtil::writeListEntry( projectDOM, "/general/ignoreparts", "part", projectIgnoreparts );
+
+ DomUtil::writeEntry( projectDOM, "/general/projectname", appname_edit->text() );
+
+ // write the dom back
+ if( !file.open( IO_WriteOnly ) )
+ return;
+ QTextStream ts( &file );
+ ts.setEncoding(QTextStream::UnicodeUTF8);
+ ts << projectDOM.toString(2);
+ file.close();
+
+ // open the new project
+ m_part->core()->openProject( projectFile );
+
+ // calculate the list of files to open after generation and use
+ // timer to queue opening (so that files will not be opened before the project
+ // which is also queued by ProjectManager )
+ KURL::List urlsToOpen;
+ QStringList::Iterator it = m_pCurrentAppInfo->openFilesAfterGeneration.begin();
+ for( ; it != m_pCurrentAppInfo->openFilesAfterGeneration.end(); ++it )
+ {
+ QString fileName( *it );
+ if ( !fileName.isNull() )
+ {
+ fileName = KMacroExpander::expandMacros(fileName, m_pCurrentAppInfo->subMap);
+ urlsToOpen.append(KURL::fromPathOrURL(fileName));
+ }
+ }
+ m_part->openFilesAfterGeneration(urlsToOpen);
+}
+
+void AppWizardDialog::pageChanged()
+{
+ kdDebug(9010) << "AppWizardDialog::pageChanged()" << endl;
+ projectLocationChanged();
+ if (currentPage() == m_lastPage)
+ finishButton()->setDefault(true);
+
+
+ //it is possible that project name was changed - we need to update all vcs integrator dialogs
+ for (QMap<int, VCSDialog*>::iterator it = m_integratorDialogs.begin();
+ it != m_integratorDialogs.end(); ++it)
+ (*it)->init(getProjectName(), getProjectLocation());
+}
+
+void AppWizardDialog::addTemplateToFavourites()
+{
+ addFavourite(templates_listview->currentItem());
+}
+
+void AppWizardDialog::addFavourite(QListViewItem* item, QString favouriteName)
+{
+ if(item->childCount())
+ return;
+
+ ApplicationInfo* info = templateForItem(item);
+
+ if(!info->favourite)
+ {
+ info->favourite = new KIconViewItem(favourites_iconview,
+ ((favouriteName=="")?info->name:favouriteName),
+ DesktopIcon("kdevelop"));
+
+ info->favourite->setRenameEnabled(true);
+ }
+}
+
+ApplicationInfo* AppWizardDialog::findFavouriteInfo(QIconViewItem* item)
+{
+ QPtrListIterator<ApplicationInfo> info(m_appsInfo);
+ for (; info.current(); ++info)
+ if (info.current()->favourite == item)
+ return info.current();
+
+ return 0;
+}
+
+void AppWizardDialog::favouritesIconViewClicked( QIconViewItem* item)
+{
+ ApplicationInfo* info = findFavouriteInfo(item);
+ templatesTreeViewClicked(info->item);
+}
+
+void AppWizardDialog::removeFavourite()
+{
+ QIconViewItem* curFavourite = favourites_iconview->currentItem();
+
+ //remove reference to favourite from associated appinfo
+ QPtrListIterator<ApplicationInfo> info(m_appsInfo);
+ for (; info.current(); ++info)
+ {
+ if(info.current()->favourite && info.current()->favourite == curFavourite)
+ {
+ info.current()->favourite = 0;
+ }
+ }
+
+ //remove favourite from iconview
+ delete curFavourite;
+ curFavourite=0;
+ favourites_iconview->sort(); //re-arrange all items.
+}
+
+void AppWizardDialog::populateFavourites()
+{
+ KConfig* config = kapp->config();
+ config->setGroup("AppWizard");
+
+ //favourites are stored in config as a list of templates and a seperate
+ //list of icon names.
+ QStringList templatesList = config->readPathListEntry("FavTemplates");
+ QStringList iconNamesList = config->readListEntry("FavNames");
+
+ QStringList::Iterator curTemplate = templatesList.begin();
+ QStringList::Iterator curIconName = iconNamesList.begin();
+ while(curTemplate != templatesList.end())
+ {
+ QPtrListIterator<ApplicationInfo> info(m_appsInfo);
+ for (; info.current(); ++info)
+ {
+ if(info.current()->templateName == *curTemplate)
+ {
+ addFavourite(info.current()->item, *curIconName);
+ break;
+ }
+ }
+ curTemplate++;
+ curIconName++;
+ }
+}
+
+void AppWizardDialog::done(int r)
+{
+ //need to save the template for each favourite and
+ //it's icon name. We have a one list for the templates
+ //and one for the names.
+
+ QStringList templatesList;
+ QStringList iconNamesList;
+
+ //Built the stringlists for each template that has a favourite.
+ QPtrListIterator<ApplicationInfo> it(m_appsInfo);
+ for (; it.current(); ++it)
+ {
+ if(it.current()->favourite)
+ {
+ templatesList.append(it.current()->templateName);
+ iconNamesList.append(it.current()->favourite->text());
+ }
+ }
+
+ KConfig* config = kapp->config();
+ config->setGroup("AppWizard");
+ config->writePathEntry("FavTemplates", templatesList);
+ config->writeEntry("FavNames", iconNamesList);
+ //config->writeEntry("CurrentTab", templates_tabwidget->currentPageIndex());
+ config->sync();
+
+ QDialog::done(r);
+}
+
+void AppWizardDialog::templatesContextMenu(QListViewItem* item, const QPoint& point, int)
+{
+ if(item && !item->childCount())
+ m_templatesMenu->popup(point);
+}
+
+void AppWizardDialog::favouritesContextMenu(QIconViewItem* item, const QPoint& point)
+{
+ if(item)
+ m_favouritesMenu->popup(point);
+}
+
+void AppWizardDialog::setPermissions(const KArchiveFile *source, QString dest)
+{
+ kdDebug(9010) << "AppWizardDialog::setPermissions(const KArchiveFile *source, QString dest)" << endl;
+ kdDebug(9010) << " dest: " << dest << endl;
+
+ if (source->permissions() & 00100)
+ {
+ kdDebug(9010) << "source is executable" << endl;
+ KIO::UDSEntry entry;
+ KURL kurl = KURL::fromPathOrURL(dest);
+ if (KIO::NetAccess::stat(kurl, entry, 0))
+ {
+ KFileItem it(entry, kurl);
+ int mode = it.permissions();
+ kdDebug(9010) << "stat shows permissions: " << mode << endl;
+ KIO::chmod(KURL::fromPathOrURL(dest), mode | 00100 );
+ }
+ }
+}
+
+void AppWizardDialog::setPermissions(const installFile &file)
+{
+ kdDebug(9010) << "AppWizardDialog::setPermissions(const installFile &file)" << endl;
+ kdDebug(9010) << " dest: " << file.dest << endl;
+
+ KIO::UDSEntry sourceentry;
+ KURL sourceurl = KURL::fromPathOrURL(file.source);
+ if (KIO::NetAccess::stat(sourceurl, sourceentry, 0))
+ {
+ KFileItem sourceit(sourceentry, sourceurl);
+ int sourcemode = sourceit.permissions();
+ if (sourcemode & 00100)
+ {
+ kdDebug(9010) << "source is executable" << endl;
+ KIO::UDSEntry entry;
+ KURL kurl = KURL::fromPathOrURL(file.dest);
+ if (KIO::NetAccess::stat(kurl, entry, 0))
+ {
+ KFileItem it(entry, kurl);
+ int mode = it.permissions();
+ kdDebug(9010) << "stat shows permissions: " << mode << endl;
+ KIO::chmod(KURL::fromPathOrURL(file.dest), mode | 00100 );
+ }
+ }
+ }
+}
+
+QDict<KDevLicense> AppWizardDialog::licenses()
+{
+ return m_licenses;
+}
+
+void AppWizardDialog::loadLicenses()
+{
+ // kdDebug(9010) << "======================== Entering loadLicenses" << endl;
+ KStandardDirs* dirs = KGlobal::dirs();
+ dirs->addResourceType( "licenses", KStandardDirs::kde_default( "data" ) + "kdevelop/licenses/" );
+ QStringList licNames = dirs->findAllResources( "licenses", QString::null, false, true );
+
+ QStringList::Iterator it;
+ for (it = licNames.begin(); it != licNames.end(); ++it)
+ {
+ QString licPath( dirs->findResource( "licenses", *it ) );
+ kdDebug(9010) << "Loading license file: " << licPath << endl;
+ QString licName = licPath.mid( licPath.findRev('/') + 1 );
+ KDevLicense* lic = new KDevLicense( licName, licPath );
+ m_licenses.insert( licName, lic );
+ }
+ // kdDebug(9010) << "======================== Done loadLicenses" << endl;
+}
+
+void AppWizardDialog::showTemplates(bool all)
+{
+ if (all)
+ {
+ QListViewItemIterator it(templates_listview);
+ while ( it.current() ) {
+ it.current()->setVisible(true);
+ ++it;
+ }
+ }
+ else
+ {
+ QPtrListIterator<ApplicationInfo> ait(m_appsInfo);
+ for (; ait.current(); ++ait)
+ {
+ ait.current()->item->setVisible(m_profileSupport->isInTemplateList(ait.current()->templateName));
+ }
+
+ QDictIterator<QListViewItem> dit(m_categoryMap);
+ for (; dit.current(); ++dit)
+ {
+ //checking whether all children are not visible
+ kdDebug(9010) << "check: " << dit.current()->text(0) << endl;
+ bool visible = false;
+ QListViewItemIterator it(dit.current());
+ while ( it.current() ) {
+ if ((it.current()->childCount() == 0) && it.current()->isVisible())
+ {
+ kdDebug(9010) << " visible: " << it.current()->text(0) << endl;
+ visible = true;
+ break;
+ }
+ ++it;
+ }
+ dit.current()->setVisible(visible);
+ }
+ checkAndHideItems(templates_listview);
+ }
+}
+
+void AppWizardDialog::checkAndHideItems(QListView *view)
+{
+ QListViewItem *item = view->firstChild();
+ while (item)
+ {
+ if (!m_categoryItems.contains(item))
+ continue;
+ checkAndHideItems(item);
+ item = item->nextSibling();
+ }
+}
+
+bool AppWizardDialog::checkAndHideItems(QListViewItem *item)
+{
+ if (!m_categoryItems.contains(item))
+ return !item->isVisible();
+ QListViewItem *child = item->firstChild();
+ bool hide = true;
+ while (child)
+ {
+ hide = hide && checkAndHideItems(child);
+ child = child->nextSibling();
+ }
+ kdDebug(9010) << "check_: " << item->text(0) << " hide: " << hide << endl;
+ if (hide)
+ {
+ item->setVisible(false);
+ return true;
+ }
+ return false;
+}
+
+#include "appwizarddlg.moc"
+
+// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;
diff --git a/parts/appwizard/appwizarddlg.h b/parts/appwizard/appwizarddlg.h
new file mode 100644
index 00000000..7ce8c2ff
--- /dev/null
+++ b/parts/appwizard/appwizarddlg.h
@@ -0,0 +1,209 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2001 by Sandy Meier *
+ * smeier@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _APPWIZARDDIALOG_H_
+#define _APPWIZARDDIALOG_H_
+
+class AppWizardPart;
+class QMultiLineEdit;
+class QRadioButton;
+class KTempFile;
+class QWidgetStack;
+class QVBox;
+class KPopupMenu;
+class QHBoxLayout;
+class KArchiveDirectory;
+class KArchiveFile;
+class ProfileSupport;
+#include <qptrlist.h>
+#include <qdict.h>
+#include <klineedit.h>
+#include <qlabel.h>
+#include <qstringlist.h>
+#include <klistview.h>
+#include <kiconview.h>
+#include "kdevversioncontrol.h"
+#include "kdevvcsintegrator.h"
+#include "appwizarddlgbase.h"
+#include "vcs_form.h"
+//#include "autoform.h"
+#include "kdevlicense.h"
+
+namespace PropertyLib {
+ class PropertyList;
+ class PropertyEditor;
+}
+
+struct installFile
+{
+ QString source;
+ QString dest;
+ QString option;
+ bool process;
+ bool isXML;
+};
+
+struct installArchive
+{
+ QString source;
+ QString dest;
+ QString option;
+ bool process;
+};
+
+struct installDir
+{
+ QString dir;
+ QString option;
+ int perms;
+};
+
+struct ApplicationInfo
+{
+ QString templateName;
+ QString name;
+ QString comment;
+ QString icon;
+ QString category;
+ QString defaultDestDir;
+ QString fileTemplates;
+ QStringList openFilesAfterGeneration;
+ QString templateFile;
+ QMap<QString,QString> subMap;
+ QMap<QString,QString> subMapXML;
+ QStringList includes;
+
+ //QMap<autoKey,QVariant> subValues;
+ PropertyLib::PropertyList *propValues;
+
+ QValueList<installFile> fileList;
+ QValueList<installArchive> archList;
+ QValueList<installDir> dirList;
+ QString customUI;
+ QString message;
+ QString finishCmd;
+ QString finishCmdDir;
+ QString sourceArchive;
+
+ //! item pointer to the listview
+ QListViewItem *item;
+
+ //! pointer to favourite icon (NULL if there isn't one)
+ QIconViewItem *favourite;
+
+ ApplicationInfo()
+ : item( 0 ), favourite( 0 )
+ {}
+};
+
+struct AppWizardFileTemplate
+{
+ QString suffix;
+ QString style;
+ QMultiLineEdit *edit;
+
+ AppWizardFileTemplate()
+ : edit( 0 )
+ {}
+};
+
+
+class AppWizardDialog : public AppWizardDialogBase
+{
+ Q_OBJECT
+
+public:
+ AppWizardDialog( AppWizardPart *part, QWidget *parent=0, const char *name=0 );
+ ~AppWizardDialog();
+ QString getProjectName() { return appname_edit->text(); }
+ QString getProjectLocation() { return finalLoc_label->text(); }
+
+protected:
+ virtual void accept();
+
+ virtual QDict<KDevLicense> licenses();
+ void loadLicenses();
+
+protected slots:
+ virtual void templatesTreeViewClicked(QListViewItem*);
+ virtual void textChanged();
+ virtual void licenseChanged();
+ virtual void destButtonClicked(const QString&);
+ virtual void projectNameChanged();
+ virtual void projectLocationChanged();
+ virtual void favouritesIconViewClicked( QIconViewItem * );
+ virtual void templatesContextMenu(QListViewItem*, const QPoint&, int);
+ virtual void favouritesContextMenu(QIconViewItem* item, const QPoint& point);
+ virtual void addTemplateToFavourites();
+ virtual void done(int r);
+ virtual void removeFavourite();
+ virtual void pageChanged();
+
+private: //methods
+
+ ApplicationInfo *templateForItem(QListViewItem *item);
+ void insertCategoryIntoTreeView(const QString &completeCategoryPath);
+ void loadVcs();
+ void updateNextButtons();
+
+ void populateFavourites();
+ void addFavourite(QListViewItem* item, QString favouriteName="");
+ ApplicationInfo* findFavouriteInfo(QIconViewItem* item);
+
+ void unpackArchive( const KArchiveDirectory *dir, const QString &dest, bool process );
+ bool copyFile( const installFile& file );
+ bool copyFile( const QString &source, const QString &dest, bool isXML, bool process );
+ QString kdevRoot(const QString &templateName ) const;
+ void openAfterGeneration();
+
+ void setPermissions(const KArchiveFile *source, QString dest);
+ void setPermissions(const installFile &file);
+
+ void checkAndHideItems(QListView *view);
+ bool checkAndHideItems(QListViewItem *item);
+
+private: //data
+
+ QPtrList<ApplicationInfo> m_appsInfo;
+ QValueList<AppWizardFileTemplate> m_fileTemplates;
+ //! Store the category name and the pointer in the treeview
+ QDict<QListViewItem> m_categoryMap;
+ QValueList<QListViewItem*> m_categoryItems;
+ //! A list of currently available version control systems
+// QDict<KDevVersionControl> m_availVcs;
+
+ QHBoxLayout *m_custom_options_layout;
+ PropertyLib::PropertyEditor *m_customOptions;
+ AppWizardPart *m_part;
+ QWidget *m_lastPage;
+ QPtrList<KTempFile> m_tempFiles;
+ ApplicationInfo* m_pCurrentAppInfo;
+ bool m_projectLocationWasChanged;
+ VcsForm *m_vcsForm;
+ bool m_pathIsValid;
+ KPopupMenu* m_favouritesMenu;
+ KPopupMenu* m_templatesMenu;
+
+ QDict<KDevLicense> m_licenses;
+ QDict<KDevVCSIntegrator> m_integrators;
+ QMap<int, VCSDialog*> m_integratorDialogs;
+
+ ProfileSupport *m_profileSupport;
+
+public slots:
+ virtual void showTemplates(bool all);
+};
+
+#endif
+
+// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;
diff --git a/parts/appwizard/appwizarddlgbase.ui b/parts/appwizard/appwizarddlgbase.ui
new file mode 100644
index 00000000..f6d1fa49
--- /dev/null
+++ b/parts/appwizard/appwizarddlgbase.ui
@@ -0,0 +1,659 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AppWizardDialogBase</class>
+<widget class="QWizard">
+ <property name="name">
+ <cstring>AppWizardDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>616</width>
+ <height>615</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create New Project</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>generalPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>templates_tabwidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>m_allProjectsPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;All Projects</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>templates_listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="hScrollBarMode">
+ <enum>Auto</enum>
+ </property>
+ <property name="selectionMode" stdset="0">
+ <enum>Single</enum>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>false</bool>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>showAll_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Show all project templates</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>m_favouritesPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Favorites</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIconView" row="0" column="0">
+ <property name="name">
+ <cstring>favourites_iconview</cstring>
+ </property>
+ <property name="arrangement">
+ <enum>LeftToRight</enum>
+ </property>
+ <property name="itemsMovable">
+ <bool>false</bool>
+ </property>
+ <property name="mode">
+ <enum>Select</enum>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>icon_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>250</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>250</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>LineEditPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ <property name="hAlign" stdset="0">
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Properties</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>appname_label</cstring>
+ </property>
+ <property name="text">
+ <string>Application &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>appname_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>location_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>dest_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Final location:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>appname_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>dest_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>finalLoc_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>TextLabel4</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QMultiLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>desc_textview</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>250</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="wordWrap">
+ <enum>WidgetWidth</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WizardPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Project Options</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>projectOptions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>General Options</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>author_label</cstring>
+ </property>
+ <property name="text">
+ <string>Author:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>author_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>email_label</cstring>
+ </property>
+ <property name="text">
+ <string>Email:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>email_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>version_label</cstring>
+ </property>
+ <property name="text">
+ <string>Version:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>version_edit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>author_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>email_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>version_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>0.1</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>license_label</cstring>
+ </property>
+ <property name="text">
+ <string>License:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>license_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>license_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>optionsGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>550</width>
+ <height>270</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Custom Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QFrame" row="0" column="0">
+ <property name="name">
+ <cstring>custom_options</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>templates_listview</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>templatesTreeViewClicked(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>author_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>textChanged()</slot>
+ </connection>
+ <connection>
+ <sender>version_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>textChanged()</slot>
+ </connection>
+ <connection>
+ <sender>appname_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>textChanged()</slot>
+ </connection>
+ <connection>
+ <sender>appname_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>projectLocationChanged()</slot>
+ </connection>
+ <connection>
+ <sender>dest_edit</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>destButtonClicked(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>dest_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>projectLocationChanged()</slot>
+ </connection>
+ <connection>
+ <sender>favourites_iconview</sender>
+ <signal>selectionChanged(QIconViewItem*)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>favouritesIconViewClicked(QIconViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>templates_listview</sender>
+ <signal>contextMenuRequested(QListViewItem*,const QPoint&amp;,int)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>templatesContextMenu(QListViewItem*,const QPoint&amp;,int)</slot>
+ </connection>
+ <connection>
+ <sender>favourites_iconview</sender>
+ <signal>contextMenuRequested(QIconViewItem*,const QPoint&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>favouritesContextMenu(QIconViewItem*,const QPoint&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>favourites_iconview</sender>
+ <signal>contextMenuRequested(QIconViewItem*,const QPoint&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>favouritesContextMenu(QIconViewItem*,const QPoint&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>showAll_box</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>showTemplates(bool)</slot>
+ </connection>
+ <connection>
+ <sender>dest_edit</sender>
+ <signal>returnPressed(const QString&amp;)</signal>
+ <receiver>AppWizardDialogBase</receiver>
+ <slot>projectLocationChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>author_edit</tabstop>
+ <tabstop>email_edit</tabstop>
+ <tabstop>version_edit</tabstop>
+ <tabstop>license_combo</tabstop>
+ <tabstop>appname_edit</tabstop>
+ <tabstop>dest_edit</tabstop>
+ <tabstop>templates_tabwidget</tabstop>
+ <tabstop>templates_listview</tabstop>
+ <tabstop>favourites_iconview</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in implementation">klistview.h</include>
+ <include location="global" impldecl="in implementation">kiconview.h</include>
+ <include location="global" impldecl="in declaration">kurlrequester.h</include>
+</includes>
+<slots>
+ <slot access="protected">licenseChanged()</slot>
+ <slot access="protected">destButtonClicked( const QString &amp; )</slot>
+ <slot access="protected">projectLocationChanged()</slot>
+ <slot access="protected">projectNameChanged()</slot>
+ <slot access="protected">textChanged()</slot>
+ <slot access="protected">templatesTreeViewClicked( QListViewItem * )</slot>
+ <slot access="protected">favouritesIconViewClicked( QIconViewItem * )</slot>
+ <slot access="protected">templatesContextMenu( QListViewItem *, const QPoint &amp;, int )</slot>
+ <slot access="protected">favouritesContextMenu( QIconViewItem *, const QPoint &amp; )</slot>
+ <slot>showTemplates(bool)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kiconview.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/appwizard/appwizardfactory.cpp b/parts/appwizard/appwizardfactory.cpp
new file mode 100644
index 00000000..2ed254be
--- /dev/null
+++ b/parts/appwizard/appwizardfactory.cpp
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+
+#include <kstandarddirs.h>
+#include <kdevplugininfo.h>
+
+#include "appwizardfactory.h"
+
+static const KDevPluginInfo data("kdevappwizard");
+K_EXPORT_COMPONENT_FACTORY( libkdevappwizard, AppWizardFactory )
+
+AppWizardFactory::AppWizardFactory()
+ : KDevGenericFactory<AppWizardPart>( data )
+{
+}
+
+KInstance *AppWizardFactory::createInstance()
+{
+ KInstance *instance = KDevGenericFactory<AppWizardPart>::createInstance();
+ KStandardDirs *dirs = instance->dirs();
+ dirs->addResourceType("apptemplates", KStandardDirs::kde_default("data") + "kdevappwizard/templates/");
+ dirs->addResourceType("appimports", KStandardDirs::kde_default("data") + "kdevappwizard/imports/");
+ dirs->addResourceType("appimportfiles", KStandardDirs::kde_default("data") + "kdevappwizard/importfiles/");
+
+ return instance;
+}
+
+const KDevPluginInfo *AppWizardFactory::info()
+{
+ return &data;
+}
+
diff --git a/parts/appwizard/appwizardfactory.h b/parts/appwizard/appwizardfactory.h
new file mode 100644
index 00000000..b162d1a2
--- /dev/null
+++ b/parts/appwizard/appwizardfactory.h
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _APPWIZARDFACTORY_H_
+#define _APPWIZARDFACTORY_H_
+
+#include <kdevgenericfactory.h>
+
+#include "appwizardpart.h"
+
+class KDevPluginInfo;
+
+class AppWizardFactory : public KDevGenericFactory<AppWizardPart>
+{
+public:
+ AppWizardFactory();
+
+ static const KDevPluginInfo *info();
+
+protected:
+ virtual KInstance *createInstance();
+};
+
+#endif
diff --git a/parts/appwizard/appwizardpart.cpp b/parts/appwizard/appwizardpart.cpp
new file mode 100644
index 00000000..8a19f548
--- /dev/null
+++ b/parts/appwizard/appwizardpart.cpp
@@ -0,0 +1,98 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdir.h>
+#include <qwidget.h>
+#include <qtimer.h>
+
+#include "appwizardpart.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kdevcore.h>
+#include <kgenericfactory.h>
+#include <kstandarddirs.h>
+#include <kaction.h>
+#include <qmessagebox.h>
+
+#include "importdlg.h"
+#include "appwizarddlg.h"
+#include "appwizardfactory.h"
+#include <kdevmakefrontend.h>
+#include <kdevpartcontroller.h>
+#include <kdevlanguagesupport.h>
+#include <kdevcore.h>
+#include <codemodel.h>
+
+AppWizardPart::AppWizardPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(AppWizardFactory::info(), parent, name ? name : "AppWizardPart")
+{
+ setInstance(AppWizardFactory::instance());
+ setXMLFile("kdevappwizard.rc");
+
+ KAction *action;
+
+ action = new KAction( i18n("&New Project..."), "window_new", 0,
+ this, SLOT(slotNewProject()),
+ actionCollection(), "project_new" );
+ action->setToolTip( i18n("Generate a new project from a template") );
+ action->setWhatsThis( i18n("<b>New project</b><p>"
+ "This starts KDevelop's application wizard. "
+ "It helps you to generate a skeleton for your "
+ "application from a set of templates.") );
+
+ action = new KAction( i18n("&Import Existing Project..."),"wizard", 0,
+ this, SLOT(slotImportProject()),
+ actionCollection(), "project_import" );
+ action->setToolTip( i18n("Import existing project") );
+ action->setWhatsThis( i18n("<b>Import existing project</b><p>Creates a project file for a given directory.") );
+}
+
+
+AppWizardPart::~AppWizardPart()
+{
+}
+
+
+void AppWizardPart::slotNewProject()
+{
+ kdDebug(9010) << "new project" << endl;
+ AppWizardDialog dlg(this, 0, "app wizard");
+ dlg.templates_listview->setFocus();
+ dlg.exec();
+}
+
+
+void AppWizardPart::slotImportProject()
+{
+ ImportDialog dlg(this, 0, "import dialog");
+ dlg.exec();
+}
+
+void AppWizardPart::openFilesAfterGeneration(const KURL::List urlsToOpen)
+{
+ m_urlsToOpen = urlsToOpen;
+ connect( core(), SIGNAL( projectOpened() ), this, SLOT( openFilesAfterGeneration() ) );
+}
+
+void AppWizardPart::openFilesAfterGeneration()
+{
+ for (KURL::List::const_iterator it = m_urlsToOpen.begin(); it != m_urlsToOpen.end(); ++it)
+ partController()->editDocument(*it);
+ m_urlsToOpen.clear();
+ disconnect( core(), SIGNAL( projectOpened() ), this, SLOT( openFilesAfterGeneration() ) );
+}
+
+#include "appwizardpart.moc"
+
+// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off;
diff --git a/parts/appwizard/appwizardpart.h b/parts/appwizard/appwizardpart.h
new file mode 100644
index 00000000..0678d04a
--- /dev/null
+++ b/parts/appwizard/appwizardpart.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _APPWIZARDPART_H_
+#define _APPWIZARDPART_H_
+
+#include <qguardedptr.h>
+#include "kdevplugin.h"
+#include <qstring.h>
+#include <qstringlist.h>
+#include <kurl.h>
+
+class AppWizardDialog;
+
+
+class AppWizardPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ AppWizardPart( QObject *parent, const char *name, const QStringList & );
+ ~AppWizardPart();
+
+ void openFilesAfterGeneration(const KURL::List urlsToOpen);
+
+public slots:
+ void openFilesAfterGeneration();
+
+private slots:
+ void slotNewProject();
+ void slotImportProject();
+
+private:
+ KURL::List m_urlsToOpen;
+};
+
+#endif
diff --git a/parts/appwizard/common/Artistic b/parts/appwizard/common/Artistic
new file mode 100644
index 00000000..8f9bdefc
--- /dev/null
+++ b/parts/appwizard/common/Artistic
@@ -0,0 +1,124 @@
+The "Artistic License"
+
+ Preamble
+
+ The intent of this document is to state the conditions under which a
+ Package may be copied, such that the Copyright Holder maintains some
+ semblance of artistic control over the development of the package,
+ while giving the users of the package the right to use and distribute
+ the Package in a more-or-less customary fashion, plus the right to
+ make reasonable modifications.
+
+ Definitions
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes of the
+ Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing this
+ Package.
+
+ "Reasonable copying fee" is whatever you can justify on the basis
+ of media cost, duplication charges, time of people involved, and so
+ on. (You will not be required to justify it to the Copyright
+ Holder, but only to the computing community at large as a market
+ that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item. It
+ also means that recipients of the item may redistribute it under
+ the same conditions they received it.
+
+ 1. You may make and give away verbatim copies of the source form of
+ the Standard Version of this Package without restriction, provided
+ that you duplicate all of the original copyright notices and
+ associated disclaimers.
+ 2. You may apply bug fixes, portability fixes and other modifications
+ derived from the Public Domain or from the Copyright Holder. A
+ Package modified in such a way shall still be considered the
+ Standard Version.
+ 3. You may otherwise modify your copy of this Package in any way,
+ provided that you insert a prominent notice in each changed file
+ stating how and when you changed that file, and provided that you
+ do at least ONE of the following:
+
+ a. place your modifications in the Public Domain or otherwise make
+ them Freely Available, such as by posting said modifications to
+ Usenet or an equivalent medium, or placing the modifications on a
+ major archive site such as uunet.uu.net, or by allowing the
+ Copyright Holder to include your modifications in the Standard
+ Version of the Package.
+ b. use the modified Package only within your corporation or
+ organization.
+ c. rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and
+ provide a separate manual page for each non-standard executable
+ that clearly documents how it differs from the Standard Version.
+ d. make other distribution arrangements with the Copyright Holder.
+
+ You may distribute the programs of this Package in object code or
+ executable form, provided that you do at least ONE of the following:
+
+ a. distribute a Standard Version of the executables and library
+ files, together with instructions (in the manual page or
+ equivalent) on where to get the Standard Version.
+ b. accompany the distribution with the machine-readable source of the
+ Package with your modifications.
+ c. give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+ d. make other distribution arrangements with the Copyright Holder.
+
+ You may charge a reasonable copying fee for any distribution of this
+ Package. You may charge any fee you choose for support of this
+ Package. You may not charge a fee for this Package itself. However,
+ you may distribute this Package in aggregate with other (possibly
+ commercial) programs as part of a larger (possibly commercial)
+ software distribution provided that you do not advertise this Package
+ as a product of your own. You may embed this Package's interpreter
+ within an executable of yours (by linking); this shall be construed as
+ a mere form of aggregation, provided that the complete Standard
+ Version of the interpreter is so embedded.
+
+ The scripts and library files supplied as input to or produced as
+ output from the programs of this Package do not automatically fall
+ under the copyright of this Package, but belong to whomever generated
+ them, and may be sold commercially, and may be aggregated with this
+ Package. If such scripts or library files are aggregated with this
+ Package via the so-called "undump" or "unexec" methods of producing a
+ binary executable image, then distribution of such an image shall
+ neither be construed as a distribution of this Package nor shall it
+ fall under the restrictions of Paragraphs 3 and 4, provided that you
+ do not represent such an executable image as a Standard Version of
+ this Package.
+
+ C subroutines (or comparably compiled subroutines in other
+ languages) supplied by you and linked into this Package in order to
+ emulate subroutines and variables of the language defined by this
+ Package shall not be considered part of this Package, but are the
+ equivalent of input as in Paragraph 6, provided these subroutines do
+ not change the language in any way that would cause it to fail the
+ regression tests for the language.
+
+ Aggregation of this Package with a commercial distribution is always
+ permitted provided that the use of this Package is embedded; that is,
+ when no overt attempt is made to make this Package's interfaces
+ visible to the end user of the commercial distribution. Such use shall
+ not be construed as a distribution of this Package.
+
+ The name of the Copyright Holder may not be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+ THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
diff --git a/parts/appwizard/common/COPYING b/parts/appwizard/common/COPYING
new file mode 100644
index 00000000..5b6e7c66
--- /dev/null
+++ b/parts/appwizard/common/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/parts/appwizard/common/COPYING.LIB b/parts/appwizard/common/COPYING.LIB
new file mode 100644
index 00000000..e38ffa83
--- /dev/null
+++ b/parts/appwizard/common/COPYING.LIB
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place - Suite 330
+ Boston, MA 02111-1307, USA.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/parts/appwizard/common/LICENSE.BSD b/parts/appwizard/common/LICENSE.BSD
new file mode 100644
index 00000000..cca2a5c9
--- /dev/null
+++ b/parts/appwizard/common/LICENSE.BSD
@@ -0,0 +1,20 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/parts/appwizard/common/LICENSE.QPL b/parts/appwizard/common/LICENSE.QPL
new file mode 100644
index 00000000..85bc6356
--- /dev/null
+++ b/parts/appwizard/common/LICENSE.QPL
@@ -0,0 +1,103 @@
+ THE Q PUBLIC LICENSE
+ version 1.0
+
+ Copyright (C) 1999-2000 Troll Tech AS, Norway.
+ Everyone is permitted to copy and
+ distribute this license document.
+
+The intent of this license is to establish freedom to share and change the
+software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the
+copyright holder saying that it may be distributed under the terms of
+the Q Public License version 1.0. Such software is herein referred to as
+the Software. This license covers modification and distribution of the
+Software, use of third-party application programs based on the Software,
+and development of free software which uses the Software.
+
+ Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license
+ provided you agree to and comply with any and all conditions in this
+ license. Whole or partial distribution of the Software, or software
+ items that link with the Software, in any form signifies acceptance of
+ this license.
+
+2. You may copy and distribute the Software in unmodified form provided
+ that the entire package, including - but not restricted to - copyright,
+ trademark notices and disclaimers, as released by the initial developer
+ of the Software, is distributed.
+
+3. You may make modifications to the Software and distribute your
+ modifications, in a form that is separate from the Software, such as
+ patches. The following restrictions apply to modifications:
+
+ a. Modifications must not alter or remove any copyright notices in
+ the Software.
+
+ b. When modifications to the Software are released under this
+ license, a non-exclusive royalty-free right is granted to the
+ initial developer of the Software to distribute your modification
+ in future versions of the Software provided such versions remain
+ available under these terms in addition to any other license(s) of
+ the initial developer.
+
+4. You may distribute machine-executable forms of the Software or
+ machine-executable forms of modified versions of the Software, provided
+ that you meet these restrictions:
+
+ a. You must include this license document in the distribution.
+
+ b. You must ensure that all recipients of the machine-executable forms
+ are also able to receive the complete machine-readable source code
+ to the distributed Software, including all modifications, without
+ any charge beyond the costs of data transfer, and place prominent
+ notices in the distribution explaining this.
+
+ c. You must ensure that all modifications included in the
+ machine-executable forms are available under the terms of this
+ license.
+
+5. You may use the original or modified versions of the Software to
+ compile, link and run application programs legally developed by you
+ or by others.
+
+6. You may develop application programs, reusable components and other
+ software items that link with the original or modified versions of the
+ Software. These items, when distributed, are subject to the following
+ requirements:
+
+ a. You must ensure that all recipients of machine-executable forms of
+ these items are also able to receive and use the complete
+ machine-readable source code to the items without any charge
+ beyond the costs of data transfer.
+
+ b. You must explicitly license all recipients of your items to use
+ and re-distribute original and modified versions of the items in
+ both machine-executable and source code forms. The recipients must
+ be able to do so without any charges whatsoever, and they must be
+ able to re-distribute to anyone they choose.
+
+
+ c. If the items are not available to the general public, and the
+ initial developer of the Software requests a copy of the items,
+ then you must supply one.
+
+ Limitations of Liability
+
+In no event shall the initial developers or copyright holders be liable
+for any damages whatsoever, including - but not restricted to - lost
+revenue or profits or other direct, indirect, special, incidental or
+consequential damages, even if they have been advised of the possibility
+of such damages, except to the extent invariable law, if any, provides
+otherwise.
+
+ No Warranty
+
+The Software and this license document are provided AS IS with NO WARRANTY
+OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE.
+ Choice of Law
+
+This license is governed by the Laws of Norway. Disputes shall be settled
+by Oslo City Court.
diff --git a/parts/appwizard/common/Makefile.am b/parts/appwizard/common/Makefile.am
new file mode 100644
index 00000000..0a2b63f6
--- /dev/null
+++ b/parts/appwizard/common/Makefile.am
@@ -0,0 +1,46 @@
+CLEANFILES = *.tar.gz
+
+admin.tar.gz:
+ $(TAR) -cf admin.tar --exclude=.svn -C $(srcdir) admin
+ gzip admin.tar
+
+gnome.tar.gz:
+ $(TAR) -cf gnome.tar --exclude=.svn -C $(srcdir)/gnome macros
+ gzip gnome.tar
+
+gnome2.tar.gz:
+ $(TAR) -cf gnome2.tar --exclude=.svn -C $(srcdir)/gnome2 macros
+ gzip gnome2.tar
+
+gnu.tar.gz:
+ $(TAR) -cf gnu.tar --exclude=.svn -C $(srcdir)/gnu AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README TODO
+ gzip gnu.tar
+
+wxwidgets.tar.gz:
+ $(TAR) -cf wxwidgets.tar --exclude=.svn -C $(srcdir)/wx macros
+ gzip wxwidgets.tar
+
+incadmin.tar.gz:
+ $(TAR) -cf incadmin.tar --exclude=.svn -C $(srcdir)/incadmin \
+ config.guess config.sub depcomp install-sh \
+ ltmain.sh missing mkinstalldirs
+ gzip incadmin.tar
+
+scons.tar.gz:
+ $(TAR) -cf scons.tar --exclude=.svn -C $(srcdir)/scons configure admin/scons-mini.tar.bz2 admin/generic.py admin/kde.py
+ gzip scons.tar
+
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+commondatadir = ${appwizarddatadir}/template-common
+commondata_DATA = admin.tar.gz gnu.tar.gz incadmin.tar.gz gnome.tar.gz gnome2.tar.gz wxwidgets.tar.gz \
+ kde-app.lsm kde-Makefile.am kde-Makefile.cvs kde-configure.in.in \
+ kde-index.docbook kde-po-Makefile.am kde-doc-Makefile.am kde-doc-en-Makefile.am \
+ hi16-app-app.png hi32-app-app.png kde-app.desktop kde-part.desktop \
+ gnome-app.lsm gnome-Makefile.am gnome-Makefile.cvs \
+ gnome-pixmaps-Makefile.am gnome-app.png \
+ wx-configure.in wx-Makefile.am wx-Makefile.cvs \
+ COPYING COPYING.LIB LICENSE.QPL LICENSE.BSD Artistic \
+ admin.kdevtemplate gnu.kdevtemplate dockbook.kdevtemplate\
+ incadmin.kdevtemplate gnome2.kdevtemplate scons.kdevtemplate scons.tar.gz
+
diff --git a/parts/appwizard/common/admin.kdevtemplate b/parts/appwizard/common/admin.kdevtemplate
new file mode 100644
index 00000000..67172eda
--- /dev/null
+++ b/parts/appwizard/common/admin.kdevtemplate
@@ -0,0 +1,5 @@
+[ADMIN]
+Type=install archive
+Source=%{kdevelop}/template-common/admin.tar.gz
+Dest=%{dest}
+Process=false
diff --git a/parts/appwizard/common/dockbook.kdevtemplate b/parts/appwizard/common/dockbook.kdevtemplate
new file mode 100644
index 00000000..a6cacf95
--- /dev/null
+++ b/parts/appwizard/common/dockbook.kdevtemplate
@@ -0,0 +1,64 @@
+[DOCSOPT]
+Type = value
+ValueType=bool
+Value=INSTALL_DOCS
+Comment= Install Docbook documentation templates.
+Comment[ca]= Instal·la plantilles de documentació en Docbook.
+Comment[da]= Installerer Docbook dokumentationsskabeloner.
+Comment[de]= Installiert Docbook-Vorlagen für Dokumentation
+Comment[el]= Εγκατάσταση προτύπων τεκμηρίωσης Docbook.
+Comment[es]=Instalar plantillas de documentación Docbook.
+Comment[et]= Docbook-dokumendimallide paigaldamine.
+Comment[eu]= Instalatu Docbook dokumentazioaren txantiloiak.
+Comment[fa]= قالبهای مستندات Docbook را نصب می‌کند.
+Comment[fr]=Installe des modèles de documentation en Docbook.
+Comment[gl]=Instalar modelos de documentación Docbook
+Comment[hu]=DocBook-alapú dokumentációsablonok telepítése.
+Comment[it]=Installa modelli di documentazione docbook.
+Comment[ja]=Docbook ドキュメントテンプレートをインストール
+Comment[ms]=Pasang templat dokumentasi Docbook.
+Comment[nds]= Docbook-Dokmentatschoonvörlagen installeren
+Comment[ne]= डकबुक मिसिलीकरण टेम्प्लेट स्थापना गर्नुहोस्
+Comment[nl]=Installeert Docbook-documentatie-sjablonen.
+Comment[pl]=Instalacja szablonów dokumentacji Docbook.
+Comment[pt]= Instala os modelos de documentação em Docbook.
+Comment[pt_BR]= Instala os modelos de documentação em Docbook.
+Comment[ru]=Установка шаблонов Docbook.
+Comment[sk]=Nainštaluje šablóny dokumentácie Docbook.
+Comment[sr]=Инсталира Docbook документационе шаблоне.
+Comment[sr@Latn]=Instalira Docbook dokumentacione šablone.
+Comment[sv]= Installera Docbook-dokumentationsmallar.
+Comment[tr]=Docbook belgelendirme şablonlarını yükle.
+Comment[zh_CN]=安装 Docbook 文档模板。
+Comment[zh_TW]=安裝 Docbook 文件樣本。
+Default=true
+
+[DOCSDIR]
+Type=mkdir
+Dir=%{dest}/doc
+Option=INSTALL_DOCS
+
+[DOCSDIREN]
+Type=mkdir
+Dir=%{dest}/doc/en
+Option=INSTALL_DOCS
+
+[DOCSMAKEFILE.AM1]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-Makefile.am
+Dest=%{dest}/doc/Makefile.am
+Option=INSTALL_DOCS
+
+[DOCSMAKEFILE.AM2]
+Type=install
+Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am
+Dest=%{dest}/doc/en/Makefile.am
+Option=INSTALL_DOCS
+
+[DOCS]
+Type=install
+Source=%{kdevelop}/template-common/kde-index.docbook
+Dest=%{dest}/doc/en/index.docbook
+Option=INSTALL_DOCS
+
+
diff --git a/parts/appwizard/common/gnome-Makefile.am b/parts/appwizard/common/gnome-Makefile.am
new file mode 100644
index 00000000..101299f8
--- /dev/null
+++ b/parts/appwizard/common/gnome-Makefile.am
@@ -0,0 +1,16 @@
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 1.4
+
+SUBDIRS = src pixmaps macros
+
+EXTRA_DIST = %{APPNAMELC}.lsm %{APPNAMELC}.desktop
+
+install-data-local:
+ $(mkinstalldirs) $(datadir)/gnome/apps/Applications/
+ $(INSTALL_DATA) $(srcdir)/%{APPNAMELC}.desktop $(datadir)/gnome/apps/Applications
+
+uninstall-local:
+ -rm -f $(datadir)/gnome/apps/Applications
+
+
diff --git a/parts/appwizard/common/gnome-Makefile.cvs b/parts/appwizard/common/gnome-Makefile.cvs
new file mode 100644
index 00000000..9d2c21a3
--- /dev/null
+++ b/parts/appwizard/common/gnome-Makefile.cvs
@@ -0,0 +1,5 @@
+default: all
+
+all:
+ srcdir=`pwd` NOCONFIGURE=1 sh macros/autogen.sh
+
diff --git a/parts/appwizard/common/gnome-app.lsm b/parts/appwizard/common/gnome-app.lsm
new file mode 100644
index 00000000..5c3ce51b
--- /dev/null
+++ b/parts/appwizard/common/gnome-app.lsm
@@ -0,0 +1,15 @@
+Begin3
+Title: %{APPNAME} -- Some description
+Version: %{VERSION}
+Entered-date:
+Description:
+Keywords: GNOME
+Author: %{AUTHOR} <%{EMAIL}>
+Maintained-by: %{AUTHOR} <%{EMAIL}>
+Home-page:
+Alternate-site:
+Primary-site: xxxxxx %{APPNAMELC}-%{VERSION}.tar.gz
+ xxx %{APPNAMELC}-%{VERSION}.lsm
+Platform: Linux. Needs GNOME 1.4
+Copying-policy: %{LICENSE}
+End
diff --git a/parts/appwizard/common/gnome-app.png b/parts/appwizard/common/gnome-app.png
new file mode 100644
index 00000000..b52af4b2
--- /dev/null
+++ b/parts/appwizard/common/gnome-app.png
Binary files differ
diff --git a/parts/appwizard/common/gnome-pixmaps-Makefile.am b/parts/appwizard/common/gnome-pixmaps-Makefile.am
new file mode 100644
index 00000000..eae71afa
--- /dev/null
+++ b/parts/appwizard/common/gnome-pixmaps-Makefile.am
@@ -0,0 +1,8 @@
+EXTRA_DIST = $APPNAMELC$.png
+
+install-data-local:
+ $(mkinstalldirs) $(datadir)
+ $(INSTALL_DATA) $(srcdir)/%{APPNAMELC}.png $(datadir)/pixmaps
+
+uninstall-local:
+ -rm -f $(datadir)/pixmaps
diff --git a/parts/appwizard/common/gnome/macros/ChangeLog b/parts/appwizard/common/gnome/macros/ChangeLog
new file mode 100644
index 00000000..1cd754ed
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/ChangeLog
@@ -0,0 +1,859 @@
+1999-08-02 Peter Teichman <pat4@acpub.duke.edu>
+
+ * removed gnome-conduit-check.m4 - it should be distributed with
+ gnome-pilot
+
+1999-07-30 Peter Teichman <pat4@acpub.duke.edu>
+
+ * gnome-conduit-check.m4: added new file of checks. anything that
+ provides a pilot conduit is going to want this
+
+1999-07-07 Tuomas J. Lukka <lukka@iki.fi>
+ * gnome-x-checks.m4: add a comment on how to get gtk-1.3 and
+ glib 1.3 from CVS
+
+1999-07-06 Tuomas J. Lukka <lukka@iki.fi>
+
+ * gnome-x-checks.m4: forbid compiling with Gtk-1.3 for now.
+ gnome only works with 1.2 so far.
+
+1999-07-05 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4: Make "extra library" message slightly easier to read.
+
+Sat Jun 26 01:47:53 1999 Tim Janik <timj@gtk.org>
+
+ * compiler-flags.m4: give -Wunused to gcc instead of -Wno-unused.
+
+1999-06-11 Tuomas J. Lukka <lukka@iki.fi>
+
+ * gnome-guile-checks.m4: Debian has qt_null in -lqthreads but
+ no main. Changed both checks for 'main' to qt_null.
+ I hope this is correct - it shouldn't break anything.
+
+1999-05-11 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MACROS): Add `gnome-bonobo-check.m4'.
+
+1999-05-09 Jacob Berkman <jberk+@cmu.edu>
+
+ * gnome-bonobo-check.m4: made test program return 0,
+ changed BONOBO_CHECK to not return "failure" on success
+
+1999-04-16 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-print-check.m4 (GNOME_PRINT_CHECK): Fix invocation of
+ AM_PATH_GNOME_PRINT.
+ * Makefile.am (MACROS): Sort lines.
+
+Sun Mar 28 23:39:48 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
+
+ * gnome-vfs.m4: Add --with-vfs option. GNOME_VFS_LIBS still needs
+ to be fixed but that's not a problem because there's no libvfs, yet.
+
+1999-03-10 Tomislav Vujec <tvujec@carnet.hr>
+
+ * aclocal-include.m4 (AM_ACLOCAL_INCLUDE): Add ACLOCAL_FLAGS in
+ ACLOCAL. This allows maintainer rules to work if any of the macros
+ change.
+
+1999-03-10 Tomislav Vujec <tvujec@carnet.hr>
+
+ * gnome.m4 (GNOME_INIT_HOOK): Wrapped position parameter in
+ testing for additional inits. It gets expanded while generating
+ configure, resulting in an empty parameter list - syntax error in
+ for statement.
+
+1999-03-09 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4 (GNOME_INIT): Add a new paramater, which is passed to
+ GNOME_INIT_HOOK.
+ (GNOME_INIT_HOOK): New parameter "additional inits". This is a
+ list like "applets capplet", and the corresponding
+ GNOME_APPLETS_LIBS and GNOME_CAPPLETS_LIBS are defined.
+
+1998-03-01 Mark Crichton <crichton@gimp.org>
+
+ * gnome-objc-checks : Added HAVE_GNOME_OBJC conditional
+
+1998-02-27 Gregory McLean <gregm@comstar.net>
+
+ * gnome-x-checks.m4 : Require at least gtk+ 1.2 (pointless getting
+ bug reports with an old glib/gtk/gdk set..)
+
+1999-02-25 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-checks.m4: Require LibGTop >= 1.0.0.
+
+1999-02-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * compiler-flags.m4: Only add the compilation warnings if the
+ compiler is GCC.
+
+1999-02-20 Timur Bakeyev <mc@bat.ru>
+
+ * gnome.m4: Added and exported ZVT_LIBS.
+
+Tue Feb 16 19:35:42 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gnome-x-checks.m4: Require GTK+-1.1.16.
+
+1999-02-15 Timur Bakeyev <mc@bat.ru>
+
+ * gnome-gettext.m4: Work around a bug in BSDI's native sh, which in-
+ correctly expands ${LINGUAS=$ALL_LINGUAS}. Switched to if/fi variant.
+
+1999-02-15 Chris Lahey <clahey@umich.edu>
+
+ * gnome-print-check.m4: Copied this from libhnj/libhnj.m4. Almost
+ completely replaced the old version. The only usage difference is
+ that it defines GNOME_PRINT_LIBS instead of GNOME_PRINT_LIB and
+ defines GNOME_PRINT_CFLAGS as well.
+
+1999-02-10 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-objc-checks.m4: Applied a patch from Kenneth Stailey;
+ use $CFLAGS when invoking $OBJC so the user can add additional
+ include paths.
+
+1999-02-05 Martin Baulig <martin@home-of-linux.org>
+
+ * compiler-flags.m4: Don't add warning and compiler flags to
+ the CFLAGS and CXXFLAGS when they're cached. This fixes the
+ problem that CFLAGS and CXXFLAGS get longer and longer each
+ time you run a `config.status --recheck'.
+
+1999-02-04 Martin Baulig <martin@home-of-linux.org>
+
+ * aclocal-include.m4 (INSIDE_GNOME_COMMON): New automake
+ conditional that's always false.
+
+ * gnome-common.m4: New file. This defines a `GNOME_COMMON_INIT'
+ macro that should be used in all GNOME Applications outside
+ the CVS tree.
+
+ * Makefile.am: If we are `INSIDE_GNOME_COMMON', install all
+ $(MACROS), autogen.sh, gnome-common.m4 and a newly created
+ gnome-macros.dep in `$(datadir)/aclocal/gnome'.
+
+1999-01-24 Timur Bakeyev <mc@bat.ru>
+
+ * gnome-pthread-check.m4: Add recognition of 2 more libraries -
+ pthreads and pthread-support build in libc (as on BSDI).
+
+1999-01-23 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-checks.m4 (GNOME_LIBGTOP_DOCU): New macro. This
+ checks whether you have the LibGTop documentation installed and
+ defines `HAVE_LIBGTOP_DOCU' if appropriate. Also provides automake
+ conditional.
+
+1999-01-20 Martin Baulig <martin@home-of-linux.org>
+
+ * acinclude.m4 (ac_result): Unset CATOBJEXT so
+ that the macros and Makefiles correctly handle
+ disabling NLS when no gettext is found.
+
+1999-01-19 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-cxx-check.m4 (GNOME_CHECK_CXX): Rewrite to be saner.
+ Don't limit yourself to a fixed set of names for the compiler.
+
+1999-01-06 Nat Friedman <nat@nat.org>
+
+ * Makefile.am (MACROS): Added gnome-print-check.m4 to MACROS
+
+1999-01-05 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Include dirent.h before checking whether
+ `scandir' needs to be declared.
+ * need-declaration.m4: Revert change.
+
+1999-01-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * need-declaration.m4, gnome-support.m4: Fixed the scandir detection.
+
+1998-12-22 Jeff Garzik <jgarzik@pobox.com>
+
+ * gnome.m4: Added and exported GNOME_APPLET_LIBS.
+
+1998-12-16 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gnome-support.m4: Removed all the stuff for argp, that was
+ causing gnomesupport not to build.
+
+1998-12-15 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-gettext.m4: Add the hacked version of the gettext
+ macros that is used in Gtk+ here.
+
+ * autogen.sh: Accept both AM_GNU_GETTEXT and AM_GNOME_GETTEXT.
+
+1998-12-15 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: All parts of GNOME will now require
+ LibGTop >= 0.99.0 which is the latest version from CVS and
+ already feature-freezed for GNOME 1.0.
+
+1998-12-09 Martin Baulig <martin@home-of-linux.org>
+
+ * aclocal-include.m4 (AM_ACLOCAL_INCLUDE): Make this work
+ with more than one directory.
+
+1998-12-08 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Moved into the LibGTop module.
+ This file contains too much stuff that should only be used
+ internally in LibGTop, so it's better to have it there.
+
+1998-12-06 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Recognice OpenBSD as a valid
+ system and use the `freebsd' sysdeps directory for it.
+
+Sat Dec 5 23:30:01 PST 1998 Manish Singh <yosh@gimp.org>
+
+ * gnome-guile-checks.m4: clear GUILE_LIBS and GUILE_INCS if
+ guile isn't there (quick fix)
+
+1998-12-05 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Recognice NetBSD as a valid
+ system and use the `freebsd' sysdeps directory for it.
+
+1998-12-03 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (GLIBTOP_LINUX_VERSION_CODE):
+ Define this to be the same as LINUX_VERSION_CODE either from
+ <linux/version.h> or from the running kernel.
+
+1998-12-02 Raja R Harinath <harinath@cs.umn.edu>
+
+ * autogen.sh: "Improve" indentation and messages somewhat.
+
+1998-12-01 Jeff Garzik <jgarzik@pobox.com>
+
+ * autogen.sh:
+ Platform fixes. grep -q is not portable, do not use.
+
+1998-12-01 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
+
+ * autogen.sh: Run gettextize if needed.
+ : Run libtoolize only if configure.in has "^AM_PROG_LIBTOOL".
+
+1998-11-30 Jeff Garzik <jgarzik@pobox.com>
+
+ * gnome.m4: Re-arranged tests such that "--without-gnome" is
+ fully supported. Not only is the logic now correct, programs
+ can test "want_gnome=yes/no" for the results of this arg.
+
+1998-11-27 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: All parts of GNOME will now require
+ LibGTop >= 0.29.0 which is the latest version from CVS.
+
+1998-11-20 James Henstridge <james@daa.com.au>
+
+ * gnome.m4(GNOME_INIT_HOOK): Changed the call to GNOME_GNORBA_CHECK
+ to GNOME_GNORBA_HOOK([],$2). Before if you specified that the
+ macro should not exit on errors, and you didn't have ORBit, the
+ script would fail anyway.
+
+1998-11-17 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: We need to check for <net/if_var.h>
+ and conditionally include it before <net/if_isppp.h> in the code
+ that check for I4B to make it work on FreeBSD 3.0.
+
+1998-10-25 Marius Vollmer <mvo@zagadka.ping.de>
+
+ * gnome-guile-checks.m4: Add GUILE_LIBS to LIBS when checking
+ whether guile works. Adding them to LDFLAGS does not work on all
+ systems. (Thanks to Rusty Chris Holleman)
+
+1998-11-12 Andrew T. Veliath <andrewtv@usa.net>
+
+ * gnome-orbit-check.m4: Remove AC_DEFINE(HAVE_ORBIT). Add
+ AM_CONDITIONAL for HAVE_ORBIT. gnome-gnorba-check.m4: Same with
+ HAVE_GNORBA. Change GNOME_ORBIT_HOOK and GNOME_GNORBA_HOOK to use
+ AC_CACHE_CHECK, setting both gnome_cv_orbit_found and
+ gnome_cv_gnorba_found.
+
+ * gnome.m4: (GNOME_INIT_HOOK): Add GNOME_GNORBA_CHECK if
+ gnome-config is found. New GNOMEGNORBA_LIBS library variable
+ (GNOMEGNORBA_LIBS is a superset of GNOMEUI_LIBS). Update
+ GNOME_LIBDIR and GNOME_INCLUDEDIR to to include the required
+ Gnorba info, if it is in a different location.
+
+ * Makefile.am (MACROS): Add gnome-gnorba-check.m4 to Makefile.
+
+ * gnome-gnorba-check.m4: New file.
+
+1998-11-12 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (vsnprintf): Remove easy-vsnprintf hack -- it
+ doesn't work for Solaris 2.5 binaries running on Solaris 2.6.
+ From Frederic Devernay <devernay@istar.fr>.
+
+1998-11-06 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Fix stupid type (sterror_r -> strerror_r).
+
+1998-11-04 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (need_gnome_support): Set this unconditionally
+ to `yes'. We'll soon be losing this variable.
+
+1998-10-20 Andrew Veliath <andrewtv@usa.net>
+
+ * gnome-orbit-check.m4 (GNOME_ORBIT_HOOK): Add ORBIT_IDL
+ detection; fix failure flag.
+
+1998-10-12 Martin Baulig <martin@home-of-linux.org>
+
+ * compiler-flags.m4 (warnCFLAGS): Added `-Wno-unused'.
+
+1998-10-11 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (libgtop_postinstall): Use `:' instead
+ of the empty string if there is nothing to do since the empty string
+ is no valid shell sytax.
+
+1998-10-11 Marius Vollmer <mvo@zagadka.ping.de>
+
+ * gnome-guile-checks.m4: Check for "guile-config" and then for
+ "build-guile", if guile-config couldn't be found. Do not
+ explicitely include output from "info libdir", it is already
+ included in "link". Use "compile" instead of "info includedir". Do
+ not include "1.2" in error message when Guile can't be found at
+ all.
+
+1998-10-11 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Added optional
+ third parameter which is the `script-if-enabled' parameter of
+ the GNOME_LIBGTOP_HOOOK.
+
+1998-10-05 Karl Eichwalder <ke@suse.de>
+
+ * gnome-xml-check.m4: Fix typo while signaling the error.
+
+1998-10-05 Raja R Harinath <harinath@cs.umn.edu>
+
+ * compiler-flags.m4 (warnCFLAGS): Remove `-W'.
+ (warn-unused): Remove.
+
+1998-10-01 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (libgtop_postinstall):
+ Added `AC_SUBST(libgtop_postinstall)'. This is used in
+ `src/daemon/Makefile.am' to make the server suid root or
+ sgid kmem if required.
+
+1998-09-28 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Make it accept libgtop >= 0.25.0 again.
+
+ * gnome-libgtop-sysdeps.m4: Make the default not to build the
+ LibGTop examples.
+
+ * compiler-flags.m4 (--enable-warn-unused): New configure parameter
+ to add `-Wunused' to the warning flags.
+
+1998-09-27 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Make it require libgtop >= 0.26.2.
+
+1998-09-24 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-ghttp-check.m4: Add checks for -lsocket -lnsl.
+
+1998-09-18 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Remove commented out code.
+
+1998-09-12 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Added (AC_SUBST): `libgtop_have_sysinfo'.
+
+1998-09-09 Martin Baulig <baulig@merkur.uni-trier.de>
+
+ * gnome-libgtop-sysdeps.m4: Added check for SMP support.
+ (--with-libgtop-smp): New parameter, default is to enable
+ it only if you're running configure on a SMP system.
+ Added (AC_DEFINE): `HAVE_LIBGTOP_SMP' if enabled.
+ (LIBGTOP_SMP): New automake conditional.
+
+1998-09-02 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Remove check for `canonicalize_file_name'.
+
+1998-09-02 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-support.m4: Check for canonicalize_file_name () and
+ realpath () and add `canonicalize.o' to LIBOBJS if required.
+
+1998-08-30 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Added (AC_SUBST): `LIBGTOP_VERSION_CODE'.
+ Added (AC_DEFINE_UNQUOTED): `LIBGTOP_VERSION', `LIBGTOP_VERSION_CODE',
+ `LIBGTOP_{MAJOR,MINOR,MICRO,SERVER}_VERSION'.
+
+1998-08-29 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Make it require libgtop >= 0.26.0.
+ Added (AC_SUBST): `LIBGTOP_INTERFACE_AGE' and `LIBGTOP_BINARY_AGE'.
+
+1998-08-27 Christopher Blizzard <blizzard@appliedtheory.com>
+
+ * gnome-ghttp-check.m4: Umm...I think this works better. Doesn't
+ break anything anyway.
+ Oooo...it actually works now. Forgot a ,
+
+1998-08-26 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Make it work
+ with a brain-dead /bin/sh and a brain-dead /bin/test.
+
+ * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): Use `AC_MSG_WARN'
+ if LibGTop cannot be found and the `fail' argument is not given.
+
+1998-08-24 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-support.m4 (GCC_NEED_DECLARATIONS): Added `setreuid',
+ `setregid' and `getpagesize'.
+ (AC_TYPE_UID_T): New check.
+
+1998-08-24 Christopher Blizzard <blizzard@appliedtheory.com>
+
+ * Makefile.am (MACROS): Add gnome-ghttp-check.m4 to the Makefile.
+
+1998-08-23 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4 (GNOME_INIT_LIBGTOP): You can give
+ this macro two parameters: the required version number and
+ an optional `fail' argument to make it fail if LibGTop is
+ not found.
+
+1998-08-22 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-guile-checks.m4: Added check for `-lnsl' and `-lsocket'
+ if `build-guile' cannot be found.
+
+1998-08-20 Raja R Harinath <harinath@cs.umn.edu>
+
+ * compiler-flags.m4: New file. Defines the
+ GNOME_COMPILER_WARNINGS macro.
+ * autogen.sh (conf_flags): Add `--enable-compile-warnings' to list
+ of flags passed to `configure'.
+ * Makefile.am (MACROS): Add compiler-flags.m4.
+
+1998-08-18 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: make it require libgtop >= 0.25.0.
+ Added (AC_SUBST): `LIBGTOP_MICRO_VERSION' and `LIBGTOP_EXTRA_LIBS'.
+
+1998-08-17 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Completely rewrote this file. It
+ uses now the `libgtop-config' script and also checks for
+ correct libgtop version.
+
+1998-08-06 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Added `freebsd' directory.
+
+1998-08-04 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-x-checks.m4: Define USE_DEVGTK unconditionally to `true'.
+
+1998-08-04 Stuart Parmenter <pavlov@innerx.net>
+
+ * gnome-x-checks.m4: (AM_PATH_GTK) make it require GTK >= 1.1.1
+ dnl'd the dev_gtk since they will have to anyways.
+
+1998-08-04 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+
+ * gnome.m4: (GNOME_INIT_HOOK): Call $1 also, if `gnome-config' is
+ found and used
+
+1998-08-02 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4 (GNOME_CONFIG): Use the `gnome-config' program if it
+ exists.
+
+1998-08-01 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (EXTRA_DIST): Remove `macros.dep'.
+
+1998-07-30 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4 (GNOME_LIBGTOP_TYPES): New macro.
+ Checks for `u_int64_t' and `int64_t'.
+
+1998-07-29 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: Added (AC_SUBST):
+ `LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS',
+ `LIBGTOP_GUILE_LIBS', `LIBGTOP_GUILE_NAMES_LIBS',
+ `LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION',
+ `LIBGTOP_VERSION'.
+
+ * gnome-libgtop-sysdeps.m4 (libgtop_sysdeps_dir):
+ Added `AC_SUBST(libgtop_sysdeps_dir)'.
+
+1998-07-29 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Check for functions that `error.c' looks for.
+
+1998-07-29 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-fileutils.m4 (AM_FUNC_ERROR_AT_LINE): Removed.
+
+ * gnome-support.m4 (AM_FUNC_ERROR_AT_LINE): New check.
+
+1998-07-27 Federico Mena Quintero <federico@nuclecu.unam.mx>
+
+ * gnome-x-checks.m4: Changed Gtk version test to use
+ GTK_HAVE_FEATURES_1_1_0.
+
+Sun Jul 26 13:59:53 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
+
+ * Makefile.am (MACROS): Added gnome-xml-check.m4
+ * gnome-xml-check.m4: New file.
+
+1998-07-24 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4: No longer requiring
+ `GNOME_LIBGTOP_SYSDEPS'.
+
+Fri Jul 24 00:45:38 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.am (MACROS): Added linger.m4.
+ * linger.m4: New file.
+
+Thu Jul 23 22:41:23 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.am (MACROS): Added gnome-undelfs.m4, gnome-vfs.m4.
+ * gnome-undelfs.m4: New file.
+ * gnome-vfs.m4: New file.
+
+1998-07-22 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-fileutils.m4: Added some reasonable defaults to allow
+ cross compiling; removed `mountlist.o' and `fsusage.o' from
+ LIBOBJS.
+
+Tue Jul 21 23:44:53 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-guile-checks.m4: If no build-guile, link against readline
+ before termcap.
+
+1998-07-15 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MACROS): Add `need-declaration.m4'.
+
+ * gnome-support.m4 (AC_REPLACE_FUNCS): Add memmove, strtod,
+ strtol, strtoul.
+ (GCC_NEED_DECLARATIONS): New check. Check whether `gethostname'
+ needs to be declared.
+
+ * need-declaration.m4: New file. Stolen from EGCS.
+
+1998-07-13 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (AC_REPLACE_FUNCS): Add check for `mkstemp'.
+
+Wed Jul 1 13:50:39 1998 Scott D. Heavner <sdh@po.cwru.edu>
+
+ * curses.m4: add some docs and start using with tcd
+
+1998-06-29 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MACROS): Add all the `.m4' files here.
+
+Mon Jun 29 11:12:04 1998 Scott D. Heavner <sdh@po.cwru.edu>
+
+ * curses.m4: Need AC_SUBST(CURSES_INCLUDEDIR) not CURSES_INCLUDES
+
+Mon Jun 29 10:35:22 1998 Scott D. Heavner <sdh@po.cwru.edu>
+
+ * curses.m4: rm conftext* should read rm conftest*, was leaving
+ conftest.c files around.
+
+1998-06-27 Christopher Blizzard <blizzard@foo.appliedtheory.com>
+
+ * gnome-objc-checks.m4: Use egcs if it's available. The gcc that
+ ships with RedHat 5.1 doesn't do objc, egcs does.
+
+Fri Jun 26 14:36:08 1998 Scott D. Heavner <sdh@po.cwru.edu>
+
+ * curses.m4 (AC_CHECK_CURSES): New check. mangled out of mc's
+ configure.in
+
+1998-06-24 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-fileutils.m4 (AM_FUNC_ERROR_AT_LINE): New check.
+ (vprintf): New check.
+ (ftruncate.c): Remove check.
+ This needs to be further cleaned up to only list what is
+ needed for gdiskfree.
+ * Makefile.am (MACROS): Add gnome-fileutils.m4.
+
+1998-06-14 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (LINUX_TABLE): New automake conditional;
+ also defines HAVE_LINUX_TABLE.
+
+1998-06-13 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4: Added check for the table ()
+ system call in the linux kernel.
+
+1998-06-11 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-x-checks.m4 (USE_DEVGTK): Use AC_EGREP_CPP rather than
+ AC_CHECK_HEADER. AC_CHECK_HEADER is fooled by warnings.
+
+ * gnome-support.m4 (AC_PROG_AWK): Look for awk.
+ (CROSS_COMPILING): Remove conditional.
+
+Wed Jun 10 14:19:39 EDT 1998 Gregory McLean <gregm@comstar.net>
+
+ * gnome-x-checks.m4: More tweeks to make building against gtk 1.0
+ and gtk1.1 less painful.
+
+1998-06-08 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-support.m4 (CROSS_COMPILING): New automake conditional;
+ (need_gnome_support): added `AC_SUBST(need_gnome_support)'.
+
+1998-06-07 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-guile-checks.m4 (GNOME_CHECK_GUILE): When
+ cross-compiling, we now check for `$host_alias-buile-guile'.
+
+1998-06-03 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-guile-checks.m4 (GNOME_CHECK_GUILE): Looks also
+ in $GNOME_LIBDIR; added failflag: GNOME_CHECK_GUILE(fail)
+ will abort if guile cannot be found.
+
+1998-05-23 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (GNOME_LIBGTOP_HOOK):
+ (libgtop_use_machine_h): Set this to true on SunOS.
+
+1998-05-22 Martin Baulig <baulig@merkur.uni-trier.de>
+
+ * gnome-fileutils.m4 (GNOME_FILEUTILS_CHECKS): New file.
+ Imported from `configure.in' in GNU fileutils 3.16. It does
+ all the checks that are needed for the diskusage applet.
+
+1998-05-22 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-check.m4 (GNOME_LIBGTOP_HOOK): New file.
+ Checks whether libgtop is installed and reads its `libgtopConf.sh'
+ file if it can be found. Defines HAVE_LIBGTOP on success and
+ provides HAVE_LIBGTOP automake conditional.
+
+1998-05-21 Martin Baulig <martin@home-of-linux.org>
+
+ * gnome-libgtop-sysdeps.m4 (GNOME_LIBGTOP_SYSDEPS): New file.
+ (libgtop_sysdeps_dir): sysdeps directory libgtop uses.
+ (libgtop_use_machine_h): define HAVE_GLIBTOP_MACHINE_H if this
+ is `yes'.
+ (libgtop_need_server): we only need the libgtop server, when
+ this has a value of `yes'. Defines NEED_LIBGTOP and NEED_LIBGTOP
+ automake conditional.
+
+1998-05-19 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (strerror): New check.
+ (sys_errlist): Check for this variable, needed for `strerror'.
+ (program_invocation_name, program_invocation_short_name): Change
+ method used to check for these.
+
+1998-05-09 Raja R Harinath <harinath@cs.umn.edu>
+
+ * autogen.sh: Remove simple-minded check for `gtk+'.
+
+Fri Apr 24 16:43:38 1998 Owen Taylor <otaylor@gtk.org>
+
+ * autogen.sh: Pass the results of the environment variable
+ ACLOCAL_FLAGS to aclocal. This allows, for instance,
+
+ ACLOCAL_FLAGS="-I /home/owen/share/aclocal/" autogen.sh
+
+Sun Apr 19 01:35:53 EDT 1998 Gregory McLean <gregm@comstar.net>
+
+ * gnome-x-checks.m4: Updated the gtk check to check for 1.0.0.
+
+1998-04-08 Raja R Harinath <harinath@cs.umn.edu>
+
+ * autogen.sh: Update to list newer versions of packages.
+ * gnome-support.m4: Add `scandir' to AC_REPLACE_FUNCS.
+ Also run AC_HEADER_DIRENT.
+
+1998-03-31 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (AC_REPLACE_FUNCS): Look for vasprintf.
+
+Thu Mar 19 23:23:30 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome.m4: An empty true branch of an `if' statement is not valid
+ sh syntax. If GNOME_INIT_HOOK argument $1 is empty, use ":"
+ instead.
+
+1998-03-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
+
+ * gnome.m4 (GNOME_INIT_HOOK): Provide a way to hook some code to
+ execute; Accept a probe mode.
+
+ (GNOME_INIT): Define in terms of GNOME_INIT_HOOK.
+
+Thu Mar 19 00:17:46 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-support.m4: Cache results of check for
+ program_invocation_short_name, program_invocation_name. Check to
+ make sure argp functions are in a library.
+
+ * gnome-support.m4: Cache results of argp check.
+
+Sun Mar 15 15:54:43 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gnome-x-checks.m4: Replaced checks for X and GTK
+ with AM_PATH_GTK. x_include, X_LIBS, etc, variables no longer
+ defined.
+
+1998-03-12 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Add a check for <linewrap.h> -- this enables
+ some optimizations when compiling `argp'.
+
+Mon Mar 9 19:32:42 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-support.m4: Build vsnprintf.o, not vsnprint.o.
+
+1998-03-09 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: Add check for `vsnprintf'.
+
+Sun Mar 8 17:04:28 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-support.m4: Set need_gnome_support shell variable. Define
+ BUILD_GNOME_SUPPORT automake conditional. Define LTLIBOBJS. Look
+ for argp_domain element in struct argp.
+
+Sat Mar 7 00:04:22 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Add argp-pvh.o to
+ LIBOBJS.
+
+ * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Check for strnlen().
+
+Wed Mar 4 01:02:55 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Check for argp code,
+ strndup, program_invocation_name, program_invocation_short_name.
+
+Mon Mar 2 15:27:44 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-x-checks.m4 (GNOME_X_CHECKS): Also check for SMlib.h; some
+ Solaris systems have -lSM but not SMlib.h.
+
+Sun Mar 1 17:49:42 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome.m4 (GNOME_INIT): Changed spacing so --help output looks
+ right.
+
+Fri Feb 27 10:05:34 1998 Tom Tromey <tromey@cygnus.com>
+
+ * gnome-objc-checks.m4 (GNOME_CHECK_OBJC): Set OBJECTIVE_C shell
+ variable.
+
+1998-02-26 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-x-checks.m4 (CPPFLAGS): Put $X_CFLAGS here, not in
+ $CFLAGS.
+ (GNOME_HAVE_SM): New var. `true' if we have libSM, `false'
+ otherwise.
+
+1998-02-19 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4: Remove `GNOME_CHECK_GNOME'.
+
+1998-02-18 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4 (GNOME_SUPPORT_CHECKS): Replace `strcasecmp' if
+ necessary.
+
+1998-02-15 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (MACROS): Add `gnome-pthread-check.m4'.
+ * gnome-pthread-check.m4: New file. Moved pthread check from
+ gnome-x-checks.m4 to here.
+ * gnome-objc-checks.m4: Use `gnome-pthread-check'.
+ (OBJC_LIBS): New config var.
+ * gnome-x-checks.m4: Add `AC_DEFINE(HAVE_LIBSM)' if `-lSM' is
+ already part of `$x_libs'.
+ Move pthread check to new file.
+
+Sat Feb 14 12:45:35 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.am (macros.dep): Use single quotes, not double quotes.
+ Otherwise bash will interpret `$(...)' incorrectly.
+ (EXTRA_DIST): Include macros.dep in distribution.
+
+1998-02-14 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (macros.dep): Put back doubled `$'. We want the
+ expansion to occur in the including Makefile, not here.
+ Otherwise, there will be an extra `../' in the rule.
+
+Sat Feb 14 17:41:28 KST 1998 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
+
+ * autogen.sh: multilple aclocal -I directories.
+
+Sat Feb 14 01:09:37 1998 Tom Tromey <tromey@cygnus.com>
+
+ * Makefile.am (macros.dep): Removed extra `$' from rule.
+
+ * gnome-x-checks.m4: Only check for -lSM if not already in
+ x_libs.
+
+1998-02-13 Raja R Harinath <harinath@cs.umn.edu>
+
+ * Makefile.am (EXTRA_DIST): Add `autogen.sh'.
+
+ * gnome-objc-checks.m4 (GNOME_INIT_OBJC): Solaris /bin/sh doesn't
+ understand `test -e'.
+
+ * autogen.sh: New file.
+
+ * gnome.m4 (GNOME_INIT): Look for gnomeConf.sh in $libdir, where
+ the installation actually installs it.
+
+ * Makefile.am (macros.dep): New maintainer rule for handling
+ automatic rebuilding of aclocal.m4 if any of the macros change.
+ (MACROS): New variable. List of all `m4' macros in this
+ directory.
+
+1998-02-12 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome-support.m4: New file. Defines GNOME_SUPPORT_CHECKS for
+ libsupport.a support.
+
+1998-02-10 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnome.m4: New file. Moved AC_CHECK_GNOME from `configure.in' to
+ here, and renamed macro to GNOME_CHECK_GNOME.
+ * gnome-x-checks.m4: Likewise, move and renaming AC_GNOME_X_CHECKS
+ to GNOME_X_CHECKS.
+
+ * aclocal-include.m4: New file. Defines AM_ACLOCAL_INCLUDE macro
+ to provide extra search directories to `aclocal'.
+
+*Local Variables:
+*backup-inhibited: t
+*End:
diff --git a/parts/appwizard/common/gnome/macros/aclocal-include.m4 b/parts/appwizard/common/gnome/macros/aclocal-include.m4
new file mode 100644
index 00000000..abf6533f
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/aclocal-include.m4
@@ -0,0 +1,16 @@
+# aclocal-include.m4
+#
+# This macro adds the name macrodir to the set of directories
+# that `aclocal' searches for macros.
+
+# serial 1
+
+dnl AM_ACLOCAL_INCLUDE(macrodir)
+AC_DEFUN([AM_ACLOCAL_INCLUDE],
+[
+ AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y)
+
+ test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+ for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
+])
diff --git a/parts/appwizard/common/gnome/macros/autogen.sh b/parts/appwizard/common/gnome/macros/autogen.sh
new file mode 100644
index 00000000..70273913
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/autogen.sh
@@ -0,0 +1,145 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed to compile Gnome."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
+ (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`libtool' installed to compile Gnome."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed to compile Gnome."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
+ grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
+ (gettext --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gettext' installed to compile Gnome."
+ echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`automake' installed to compile Gnome."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run \`configure' with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo \`$0\'" command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.in -print`
+do
+ dr=`dirname $coin`
+ if test -f $dr/NO-AUTO-GEN; then
+ echo skipping $dr -- flagged as no auto-gen
+ else
+ echo processing $dr
+ macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
+ ( cd $dr
+ aclocalinclude="$ACLOCAL_FLAGS"
+ for k in $macrodirs; do
+ if test -d $k; then
+ aclocalinclude="$aclocalinclude -I $k"
+ ##else
+ ## echo "**Warning**: No such directory \`$k'. Ignored."
+ fi
+ done
+ if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
+ if grep "sed.*POTFILES" configure.in >/dev/null; then
+ : do nothing -- we still have an old unmodified configure.in
+ else
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ fi
+ if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running gettextize... Ignore non-fatal messages."
+ echo "no" | gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+ fi
+ echo "Running aclocal $aclocalinclude ..."
+ aclocal $aclocalinclude
+ if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+ fi
+ echo "Running automake --gnu $am_opt ..."
+ automake --add-missing --gnu $am_opt
+ echo "Running autoconf ..."
+ autoconf
+ )
+ fi
+done
+
+conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
+
+if test x$NOCONFIGURE = x; then
+ echo Running $srcdir/configure $conf_flags "$@" ...
+ $srcdir/configure $conf_flags "$@" \
+ && echo Now type \`make\' to compile $PKG_NAME || exit 1
+else
+ echo Skipping configure process.
+fi
diff --git a/parts/appwizard/common/gnome/macros/compiler-flags.m4 b/parts/appwizard/common/gnome/macros/compiler-flags.m4
new file mode 100644
index 00000000..278d5099
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/compiler-flags.m4
@@ -0,0 +1,109 @@
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings
+dnl For now, only works on GCC
+AC_DEFUN([GNOME_COMPILE_WARNINGS],[
+ AC_ARG_ENABLE(compile-warnings,
+ [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_compile_warnings=minimum)
+
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ warnCFLAGS=
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+
+ if test "x$enable_compile_warnings" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCFLAGS="-Wall -Wunused" ;;
+ esac
+
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_compile_warnings" = "xyes"; then
+ warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCFLAGS)
+
+ AC_ARG_ENABLE(iso-c,
+ [ --enable-iso-c Try to warn if code is not ISO C ],,
+ enable_iso_c=no)
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+ complCFLAGS=
+ if test "x$enable_iso_c" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -ansi" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCFLAGS)
+ if test "x$cflags_set" != "xyes"; then
+ CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS"
+ cflags_set=yes
+ AC_SUBST(cflags_set)
+ fi
+])
+
+dnl For C++, do basically the same thing.
+
+AC_DEFUN([GNOME_CXX_WARNINGS],[
+ AC_ARG_ENABLE(cxx-warnings,
+ [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum)
+
+ AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+ warnCXXFLAGS=
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+ if test "x$enable_cxx_warnings" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+ esac
+
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_cxx_warnings" = "xyes"; then
+ warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wshadow -Woverloaded-virtual"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCXXFLAGS)
+
+ AC_ARG_ENABLE(iso-cxx,
+ [ --enable-iso-cxx Try to warn if code is not ISO C++ ],,
+ enable_iso_cxx=no)
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+ complCXXFLAGS=
+ if test "x$enable_iso_cxx" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+ esac
+
+ case " $CXXFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCXXFLAGS)
+ if test "x$cxxflags_set" != "xyes"; then
+ CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+ cxxflags_set=yes
+ AC_SUBST(cxxflags_set)
+ fi
+])
diff --git a/parts/appwizard/common/gnome/macros/curses.m4 b/parts/appwizard/common/gnome/macros/curses.m4
new file mode 100644
index 00000000..3dd4ffaa
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/curses.m4
@@ -0,0 +1,318 @@
+dnl Curses detection: Munged from Midnight Commander's configure.in
+dnl
+dnl What it does:
+dnl =============
+dnl
+dnl - Determine which version of curses is installed on your system
+dnl and set the -I/-L/-l compiler entries and add a few preprocessor
+dnl symbols
+dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
+dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
+dnl Makefile.in's
+dnl - Modify the following configure variables (these are the only
+dnl curses.m4 variables you can access from within configure.in)
+dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
+dnl an ncurses.h that's been renamed to curses.h
+dnl is found.
+dnl CURSES_LIBS - sets -L and -l's appropriately
+dnl CFLAGS - if --with-sco, add -D_SVID3
+dnl has_curses - exports result of tests to rest of configure
+dnl
+dnl Usage:
+dnl ======
+dnl 1) Add lines indicated below to acconfig.h
+dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
+dnl 3) Instead of #include <curses.h> you should use the following to
+dnl properly locate ncurses or curses header file
+dnl
+dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
+dnl #include <ncurses.h>
+dnl #else
+dnl #include <curses.h>
+dnl #endif
+dnl
+dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
+dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
+dnl
+dnl Notes with automake:
+dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
+dnl configure.in
+dnl - your Makefile.am can look something like this
+dnl -----------------------------------------------
+dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
+dnl if HAS_CURSES
+dnl CURSES_TARGETS=name_of_curses_prog
+dnl endif
+dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
+dnl other_programs_SOURCES = blah blah blah
+dnl name_of_curses_prog_SOURCES = blah blah blah
+dnl other_programs_LDADD = blah
+dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
+dnl -----------------------------------------------
+dnl
+dnl
+dnl The following lines should be added to acconfig.h:
+dnl ==================================================
+dnl
+dnl /*=== Curses version detection defines ===*/
+dnl /* Found some version of curses that we're going to use */
+dnl #undef HAS_CURSES
+dnl
+dnl /* Use SunOS SysV curses? */
+dnl #undef USE_SUNOS_CURSES
+dnl
+dnl /* Use old BSD curses - not used right now */
+dnl #undef USE_BSD_CURSES
+dnl
+dnl /* Use SystemV curses? */
+dnl #undef USE_SYSV_CURSES
+dnl
+dnl /* Use Ncurses? */
+dnl #undef USE_NCURSES
+dnl
+dnl /* If you Curses does not have color define this one */
+dnl #undef NO_COLOR_CURSES
+dnl
+dnl /* Define if you want to turn on SCO-specific code */
+dnl #undef SCO_FLAVOR
+dnl
+dnl /* Set to reflect version of ncurses *
+dnl * 0 = version 1.*
+dnl * 1 = version 1.9.9g
+dnl * 2 = version 4.0/4.1 */
+dnl #undef NCURSES_970530
+dnl
+dnl /*=== End new stuff for acconfig.h ===*/
+dnl
+
+
+AC_DEFUN(AC_CHECK_CURSES,[
+ search_ncurses=true
+ screen_manager=""
+ has_curses=false
+
+ CFLAGS=${CFLAGS--O}
+
+ AC_SUBST(CURSES_LIBS)
+ AC_SUBST(CURSES_INCLUDEDIR)
+
+ AC_ARG_WITH(sco,
+ [ --with-sco Use this to turn on SCO-specific code],[
+ if test x$withval = xyes; then
+ AC_DEFINE(SCO_FLAVOR)
+ CFLAGS="$CFLAGS -D_SVID3"
+ fi
+ ])
+
+ AC_ARG_WITH(sunos-curses,
+ [ --with-sunos-curses Used to force SunOS 4.x curses],[
+ if test x$withval = xyes; then
+ AC_USE_SUNOS_CURSES
+ fi
+ ])
+
+ AC_ARG_WITH(osf1-curses,
+ [ --with-osf1-curses Used to force OSF/1 curses],[
+ if test x$withval = xyes; then
+ AC_USE_OSF1_CURSES
+ fi
+ ])
+
+ AC_ARG_WITH(vcurses,
+ [ --with-vcurses[=incdir] Used to force SysV curses],
+ if test x$withval != xyes; then
+ CURSES_INCLUDEDIR="-I$withval"
+ fi
+ AC_USE_SYSV_CURSES
+ )
+
+ AC_ARG_WITH(ncurses,
+ [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
+ if test x$withval = xno ; then
+ search_ncurses=false
+ elif test x$withval != xyes ; then
+ CURSES_LIBS="$LIBS -L$withval/lib -lncurses"
+ CURSES_INCLUDEDIR="-I$withval/include"
+ search_ncurses=false
+ screen_manager="ncurses"
+ AC_DEFINE(USE_NCURSES)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ fi
+ )
+
+ if $search_ncurses
+ then
+ AC_SEARCH_NCURSES()
+ fi
+
+
+])
+
+
+AC_DEFUN(AC_USE_SUNOS_CURSES, [
+ search_ncurses=false
+ screen_manager="SunOS 4.x /usr/5include curses"
+ AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
+ AC_DEFINE(USE_SUNOS_CURSES)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(NO_COLOR_CURSES)
+ AC_DEFINE(USE_SYSV_CURSES)
+ CURSES_INCLUDEDIR="-I/usr/5include"
+ CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
+ AC_MSG_RESULT(Please note that some screen refreshs may fail)
+])
+
+AC_DEFUN(AC_USE_OSF1_CURSES, [
+ AC_MSG_RESULT(Using OSF1 curses)
+ search_ncurses=false
+ screen_manager="OSF1 curses"
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(NO_COLOR_CURSES)
+ AC_DEFINE(USE_SYSV_CURSES)
+ CURSES_LIBS="-lcurses"
+])
+
+AC_DEFUN(AC_USE_SYSV_CURSES, [
+ AC_MSG_RESULT(Using SysV curses)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_SYSV_CURSES)
+ search_ncurses=false
+ screen_manager="SysV/curses"
+ CURSES_LIBS="-lcurses"
+])
+
+dnl AC_ARG_WITH(bsd-curses,
+dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
+dnl search_ncurses=false
+dnl screen_manager="Ultrix/cursesX"
+dnl if test $system = ULTRIX
+dnl then
+dnl THIS_CURSES=cursesX
+dnl else
+dnl THIS_CURSES=curses
+dnl fi
+dnl
+dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
+dnl AC_DEFINE(HAS_CURSES)
+dnl has_curses=true
+dnl AC_DEFINE(USE_BSD_CURSES)
+dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
+dnl AC_WARN(Use of the bsdcurses extension has some)
+dnl AC_WARN(display/input problems.)
+dnl AC_WARN(Reconsider using xcurses)
+dnl)
+
+
+dnl
+dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
+dnl
+AC_DEFUN(AC_NCURSES, [
+ if $search_ncurses
+ then
+ if test -f $1/$2
+ then
+ AC_MSG_RESULT(Found ncurses on $1/$2)
+ CURSES_LIBS="$3"
+ CURSES_INCLUDEDIR="$4"
+ search_ncurses=false
+ screen_manager=$5
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_NCURSES)
+ fi
+ fi
+])
+
+AC_DEFUN(AC_SEARCH_NCURSES, [
+ AC_CHECKING("location of ncurses.h file")
+
+ AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
+ AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
+ AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
+ AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
+
+ AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
+
+ AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
+
+ dnl
+ dnl We couldn't find ncurses, try SysV curses
+ dnl
+ if $search_ncurses
+ then
+ AC_EGREP_HEADER(init_color, /usr/include/curses.h,
+ AC_USE_SYSV_CURSES)
+ AC_EGREP_CPP(USE_NCURSES,[
+#include <curses.h>
+#ifdef __NCURSES_H
+#undef USE_NCURSES
+USE_NCURSES
+#endif
+],[
+ CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_NCURSES)
+ search_ncurses=false
+ screen_manager="ncurses installed as curses"
+])
+ fi
+
+ dnl
+ dnl Try SunOS 4.x /usr/5{lib,include} ncurses
+ dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
+ dnl should be replaced by a more fine grained selection routine
+ dnl
+ if $search_ncurses
+ then
+ if test -f /usr/5include/curses.h
+ then
+ AC_USE_SUNOS_CURSES
+ fi
+ else
+ # check for ncurses version, to properly ifdef mouse-fix
+ AC_MSG_CHECKING(for ncurses version)
+ ncurses_version=unknown
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+#ifdef RENAMED_NCURSES
+#include <curses.h>
+#else
+#include <ncurses.h>
+#endif
+#undef VERSION
+VERSION:NCURSES_VERSION
+EOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
+ egrep "VERSION:" >conftest.out 2>&1; then
+changequote(,)dnl
+ ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
+changequote([,])dnl
+ fi
+ rm -rf conftest*
+ AC_MSG_RESULT($ncurses_version)
+ case "$ncurses_version" in
+changequote(,)dnl
+ 4.[01])
+changequote([,])dnl
+ AC_DEFINE(NCURSES_970530,2)
+ ;;
+ 1.9.9g)
+ AC_DEFINE(NCURSES_970530,1)
+ ;;
+ 1*)
+ AC_DEFINE(NCURSES_970530,0)
+ ;;
+ esac
+ fi
+])
+
+
+
+
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-Makefile.am b/parts/appwizard/common/gnome/macros/gnome-Makefile.am
new file mode 100644
index 00000000..e03dbeed
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-Makefile.am
@@ -0,0 +1,40 @@
+## Please update this variable if any new macros are created
+MACROS= \
+ aclocal-include.m4 \
+ compiler-flags.m4 \
+ curses.m4 \
+ gnome-bonobo-check.m4 \
+ gnome-fileutils.m4 \
+ gnome-gettext.m4 \
+ gnome-ghttp-check.m4 \
+ gnome-gnorba-check.m4 \
+ gnome-guile-checks.m4 \
+ gnome-libgtop-check.m4 \
+ gnome-objc-checks.m4 \
+ gnome-orbit-check.m4 \
+ gnome-print-check.m4 \
+ gnome-pthread-check.m4 \
+ gnome-support.m4 \
+ gnome-undelfs.m4 \
+ gnome-vfs.m4 \
+ gnome-x-checks.m4 \
+ gnome-xml-check.m4 \
+ gnome.m4 \
+ linger.m4 \
+ need-declaration.m4
+
+EXTRA_DIST=$(MACROS) gnome-common.m4 autogen.sh
+MAINTAINERCLEANFILES=macros.dep
+
+@MAINT@macros.dep: Makefile.am
+@MAINT@ @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=macros/%)' > $@
+
+if INSIDE_GNOME_COMMON
+gnome_aclocaldir = $(datadir)/aclocal/gnome
+
+gnome-macros.dep: Makefile.am
+ @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=$(gnome_aclocaldir)/%)' > $@
+
+gnome_aclocal_DATA = $(MACROS) gnome-macros.dep gnome-common.m4 autogen.sh
+
+endif
diff --git a/parts/appwizard/common/gnome/macros/gnome-bonobo-check.m4 b/parts/appwizard/common/gnome/macros/gnome-bonobo-check.m4
new file mode 100644
index 00000000..65e272cf
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-bonobo-check.m4
@@ -0,0 +1,150 @@
+# Configure paths for Bonobo
+# Miguel de Icaza, 99-04-12
+# Stolen from Chris Lahey 99-2-5
+# stolen from Manish Singh again
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_BONOBO ([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for Bonobo, and define BONOBO_CFLAGS and BONOBO_LIBS
+dnl
+AC_DEFUN([AM_PATH_BONOBO],
+[
+dnl
+dnl Get the cflags and libraries from the gnome-config script
+dnl
+AC_ARG_WITH(bonobo-prefix,[ --with-bonobo-prefix=PFX Prefix where Bonobo is installed (optional)],
+ bonobo_prefix="$withval", bonobo_prefix="")
+AC_ARG_WITH(bonobo-exec-prefix,[ --with-bonobo-exec-prefix=PFX Exec prefix where Bonobo is installed (optional)],
+ bonobo_exec_prefix="$withval", bonobo_exec_prefix="")
+AC_ARG_ENABLE(bonobotest, [ --disable-bonobotest Do not try to compile and run a test Bonobo program],
+ , enable_bonobotest=yes)
+
+ if test x$bonobo_exec_prefix != x ; then
+ bonobo_args="$bonobo_args --exec-prefix=$bonobo_exec_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$bonobo_exec_prefix/bin/gnome-config
+ fi
+ fi
+ if test x$bonobo_prefix != x ; then
+ bonobo_args="$bonobo_args --prefix=$bonobo_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$bonobo_prefix/bin/gnome-config
+ fi
+ fi
+
+ AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
+ min_bonobo_version=ifelse([$1], ,0.1.0,$1)
+ AC_MSG_CHECKING(for BONOBO - version >= $min_bonobo_version)
+ no_bonobo=""
+ if test "$GNOME_CONFIG" = "no" ; then
+ no_bonobo=yes
+ else
+ BONOBO_CFLAGS=`$GNOME_CONFIG $bonoboconf_args --cflags bonobo`
+ BONOBO_LIBS=`$GNOME_CONFIG $bonoboconf_args --libs bonobo`
+
+ bonobo_major_version=`$GNOME_CONFIG $bonobo_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ bonobo_minor_version=`$GNOME_CONFIG $bonobo_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ bonobo_micro_version=`$GNOME_CONFIG $bonobo_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_bonobotest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $BONOBO_CFLAGS"
+ LIBS="$LIBS $BONOBO_LIBS"
+dnl
+dnl Now check if the installed BONOBO is sufficiently new. (Also sanity
+dnl checks the results of gnome-config to some extent
+dnl
+ rm -f conf.bonobotest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <bonobo/gnome-object.h>
+
+static char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.bonobotest");
+ gnome_object_get_type ();
+ return 0;
+}
+
+],, no_bonobo=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_bonobo" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$GNOME_CONFIG" = "no" ; then
+ echo "*** The gnome-config script installed by GNOME-LIBS could not be found"
+ echo "*** If BONOBO was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the GNOME_CONFIG environment variable to the"
+ echo "*** full path to gnome-config."
+ else
+ if test -f conf.bonobotest ; then
+ :
+ else
+ echo "*** Could not run BONOBO test program, checking why..."
+ CFLAGS="$CFLAGS $BONOBO_CFLAGS"
+ LIBS="$LIBS $BONOBO_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <bonobo/gnome-object.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding BONOBO or finding the wrong"
+ echo "*** version of BONOBO. If it is not finding BONOBO, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means BONOBO was incorrectly installed"
+ echo "*** or that you have moved BONOBO since it was installed. In the latter case, you"
+ echo "*** may want to edit the gnome-config script: $GNOME_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ BONOBO_CFLAGS=""
+ BONOBO_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(BONOBO_CFLAGS)
+ AC_SUBST(BONOBO_LIBS)
+ rm -f conf.bonobotest
+])
+
+AC_DEFUN([BONOBO_CHECK], [
+ AM_PATH_BONOBO(0.1.0,,[AC_MSG_ERROR(BONOBO not found)])
+])
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-common.m4 b/parts/appwizard/common/gnome/macros/gnome-common.m4
new file mode 100644
index 00000000..b7238297
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-common.m4
@@ -0,0 +1,14 @@
+# gnome-common.m4
+#
+# This only for packages that are not in the GNOME CVS tree.
+
+dnl GNOME_COMMON_INIT
+
+AC_DEFUN([GNOME_COMMON_INIT],
+[
+ GNOME_ACLOCAL_DIR=`$ACLOCAL --print-ac-dir`/gnome
+ AC_SUBST(GNOME_ACLOCAL_DIR)
+
+ ACLOCAL="$ACLOCAL -I $GNOME_ACLOCAL_DIR"
+])
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-fileutils.m4 b/parts/appwizard/common/gnome/macros/gnome-fileutils.m4
new file mode 100644
index 00000000..7c11a785
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-fileutils.m4
@@ -0,0 +1,414 @@
+dnl
+dnl GNOME_FILEUTILS_CHECKS
+dnl
+dnl checks that are needed for the diskusage applet.
+dnl
+
+AC_DEFUN([GNOME_FILEUTILS_CHECKS],
+[
+AC_CHECK_HEADERS(fcntl.h sys/param.h sys/statfs.h sys/fstyp.h \
+mnttab.h mntent.h sys/statvfs.h sys/vfs.h sys/mount.h \
+sys/filsys.h sys/fs_types.h sys/fs/s5param.h)
+
+AC_CHECK_FUNCS(bcopy endgrent endpwent fchdir ftime ftruncate \
+getcwd getmntinfo gettimeofday isascii lchown \
+listmntent memcpy mkfifo strchr strerror strrchr vprintf)
+
+dnl Set some defaults when cross-compiling
+
+if test x$cross_compiling = xyes ; then
+ case "$host_os" in
+ linux*)
+ fu_cv_sys_mounted_getmntent1=yes
+ fu_cv_sys_stat_statfs2_bsize=yes
+ ;;
+ sunos*)
+ fu_cv_sys_stat_statfs4=yes
+ ;;
+ freebsd*)
+ fu_cv_sys_stat_statfs2_bsize=yes
+ ;;
+ osf*)
+ fu_cv_sys_stat_statfs3_osf1=yes
+ ;;
+ esac
+fi
+
+# Determine how to get the list of mounted filesystems.
+list_mounted_fs=
+
+# If the getmntent function is available but not in the standard library,
+# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
+AC_FUNC_GETMNTENT
+
+# This test must precede the ones for getmntent because Unicos-9 is
+# reported to have the getmntent function, but its support is incompatible
+# with other getmntent implementations.
+
+# NOTE: Normally, I wouldn't use a check for system type as I've done for
+# `CRAY' below since that goes against the whole autoconf philosophy. But
+# I think there is too great a chance that some non-Cray system has a
+# function named listmntent to risk the false positive.
+
+if test -z "$list_mounted_fs"; then
+# Cray UNICOS 9
+AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
+AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
+[fu_cv_sys_mounted_cray_listmntent=no
+AC_EGREP_CPP(yes,
+[#ifdef _CRAY
+yes
+#endif
+], [test $ac_cv_func_listmntent = yes \
+&& fu_cv_sys_mounted_cray_listmntent=yes]
+)
+]
+)
+AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
+if test $fu_cv_sys_mounted_cray_listmntent = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_LISTMNTENT)
+fi
+fi
+
+if test $ac_cv_func_getmntent = yes; then
+
+# This system has the getmntent function.
+# Determine whether it's the one-argument variant or the two-argument one.
+
+if test -z "$list_mounted_fs"; then
+# 4.3BSD, SunOS, HP-UX, Dynix, Irix
+AC_MSG_CHECKING([for one-argument getmntent function])
+AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
+[test $ac_cv_header_mntent_h = yes \
+&& fu_cv_sys_mounted_getmntent1=yes \
+|| fu_cv_sys_mounted_getmntent1=no])
+AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
+if test $fu_cv_sys_mounted_getmntent1 = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_GETMNTENT1)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+# SVR4
+AC_MSG_CHECKING([for two-argument getmntent function])
+AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
+[AC_EGREP_HEADER(getmntent, sys/mnttab.h,
+fu_cv_sys_mounted_getmntent2=yes,
+fu_cv_sys_mounted_getmntent2=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
+if test $fu_cv_sys_mounted_getmntent2 = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_GETMNTENT2)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
+fi
+
+fi
+
+if test -z "$list_mounted_fs"; then
+# DEC Alpha running OSF/1.
+AC_MSG_CHECKING([for getfsstat function])
+AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
+[AC_TRY_LINK([
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/fs_types.h>],
+[struct statfs *stats;
+int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT); ],
+fu_cv_sys_mounted_getsstat=yes,
+fu_cv_sys_mounted_getsstat=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
+if test $fu_cv_sys_mounted_getsstat = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_GETFSSTAT)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+# AIX.
+AC_MSG_CHECKING([for mntctl function and struct vmount])
+AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
+[AC_TRY_CPP([#include <fshelp.h>],
+fu_cv_sys_mounted_vmount=yes,
+fu_cv_sys_mounted_vmount=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
+if test $fu_cv_sys_mounted_vmount = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_VMOUNT)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+# SVR3
+AC_MSG_CHECKING([for FIXME existence of three headers])
+AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
+[AC_TRY_CPP([
+#include <sys/statfs.h>
+#include <sys/fstyp.h>
+#include <mnttab.h>],
+fu_cv_sys_mounted_fread_fstyp=yes,
+fu_cv_sys_mounted_fread_fstyp=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
+if test $fu_cv_sys_mounted_fread_fstyp = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_FREAD_FSTYP)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+# 4.4BSD and DEC OSF/1.
+AC_MSG_CHECKING([for getmntinfo function])
+AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
+[
+ok=
+if test $ac_cv_func_getmntinfo = yes; then
+AC_EGREP_HEADER(f_type;, sys/mount.h,
+ok=yes)
+fi
+test -n "$ok" \
+&& fu_cv_sys_mounted_getmntinfo=yes \
+|| fu_cv_sys_mounted_getmntinfo=no
+])
+AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
+if test $fu_cv_sys_mounted_getmntinfo = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_GETMNTINFO)
+fi
+fi
+
+# FIXME: add a test for netbsd-1.1 here
+
+if test -z "$list_mounted_fs"; then
+# Ultrix
+AC_MSG_CHECKING([for getmnt function])
+AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
+[AC_TRY_CPP([
+#include <sys/fs_types.h>
+#include <sys/mount.h>],
+fu_cv_sys_mounted_getmnt=yes,
+fu_cv_sys_mounted_getmnt=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
+if test $fu_cv_sys_mounted_getmnt = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_GETMNT)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+# SVR2
+AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
+AC_CACHE_VAL(fu_cv_sys_mounted_fread,
+[AC_TRY_CPP([#include <mnttab.h>],
+fu_cv_sys_mounted_fread=yes,
+fu_cv_sys_mounted_fread=no)])
+AC_MSG_RESULT($fu_cv_sys_mounted_fread)
+if test $fu_cv_sys_mounted_fread = yes; then
+list_mounted_fs=found
+AC_DEFINE(MOUNTED_FREAD)
+fi
+fi
+
+if test -z "$list_mounted_fs"; then
+AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
+# FIXME -- no need to abort building the whole package
+# Can't build mountlist.c or anything that needs its functions
+fi
+
+AC_CHECKING(how to get filesystem space usage)
+space=no
+
+# Perform only the link test since it seems there are no variants of the
+# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
+# because that got a false positive on SCO OSR5. Adding the declaration
+# of a `struct statvfs' causes this test to fail (as it should) on such
+# systems. That system is reported to work fine with STAT_STATFS4 which
+# is what it gets when this test fails.
+if test $space = no; then
+# SVR4
+AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
+[AC_TRY_LINK([#include <sys/types.h>
+#include <sys/statvfs.h>],
+[struct statvfs fsd; statvfs (0, &fsd);],
+fu_cv_sys_stat_statvfs=yes,
+fu_cv_sys_stat_statvfs=no)])
+if test $fu_cv_sys_stat_statvfs = yes; then
+space=yes
+AC_DEFINE(STAT_STATVFS)
+fi
+fi
+
+if test $space = no; then
+# DEC Alpha running OSF/1
+AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
+AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
+[AC_TRY_RUN([
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/mount.h>
+main ()
+{
+struct statfs fsd;
+fsd.f_fsize = 0;
+exit (statfs (".", &fsd, sizeof (struct statfs)));
+}],
+fu_cv_sys_stat_statfs3_osf1=yes,
+fu_cv_sys_stat_statfs3_osf1=no,
+fu_cv_sys_stat_statfs3_osf1=no)])
+AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
+if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
+space=yes
+AC_DEFINE(STAT_STATFS3_OSF1)
+fi
+fi
+
+if test $space = no; then
+# AIX
+AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
+member (AIX, 4.3BSD)])
+AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
+[AC_TRY_RUN([
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+main ()
+{
+struct statfs fsd;
+fsd.f_bsize = 0;
+exit (statfs (".", &fsd));
+}],
+fu_cv_sys_stat_statfs2_bsize=yes,
+fu_cv_sys_stat_statfs2_bsize=no,
+fu_cv_sys_stat_statfs2_bsize=no)])
+AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
+if test $fu_cv_sys_stat_statfs2_bsize = yes; then
+space=yes
+AC_DEFINE(STAT_STATFS2_BSIZE)
+fi
+fi
+
+if test $space = no; then
+# SVR3
+AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
+AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
+[AC_TRY_RUN([#include <sys/types.h>
+#include <sys/statfs.h>
+main ()
+{
+struct statfs fsd;
+exit (statfs (".", &fsd, sizeof fsd, 0));
+}],
+fu_cv_sys_stat_statfs4=yes,
+fu_cv_sys_stat_statfs4=no,
+fu_cv_sys_stat_statfs4=no)])
+AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
+if test $fu_cv_sys_stat_statfs4 = yes; then
+space=yes
+AC_DEFINE(STAT_STATFS4)
+fi
+fi
+
+if test $space = no; then
+# 4.4BSD and NetBSD
+AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
+member (4.4BSD and NetBSD)])
+AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
+[AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+main ()
+{
+struct statfs fsd;
+fsd.f_fsize = 0;
+exit (statfs (".", &fsd));
+}],
+fu_cv_sys_stat_statfs2_fsize=yes,
+fu_cv_sys_stat_statfs2_fsize=no,
+fu_cv_sys_stat_statfs2_fsize=no)])
+AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
+if test $fu_cv_sys_stat_statfs2_fsize = yes; then
+space=yes
+AC_DEFINE(STAT_STATFS2_FSIZE)
+fi
+fi
+
+if test $space = no; then
+# Ultrix
+AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
+AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
+[AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_SYS_FS_TYPES_H
+#include <sys/fs_types.h>
+#endif
+main ()
+{
+struct fs_data fsd;
+/* Ultrix's statfs returns 1 for success,
+0 for not mounted, -1 for failure. */
+exit (statfs (".", &fsd) != 1);
+}],
+fu_cv_sys_stat_fs_data=yes,
+fu_cv_sys_stat_fs_data=no,
+fu_cv_sys_stat_fs_data=no)])
+AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
+if test $fu_cv_sys_stat_fs_data = yes; then
+space=yes
+AC_DEFINE(STAT_STATFS2_FS_DATA)
+fi
+fi
+
+if test $space = no; then
+# SVR2
+AC_TRY_CPP([#include <sys/filsys.h>],
+AC_DEFINE(STAT_READ_FILSYS) space=yes)
+fi
+
+if test -n "$list_mounted_fs" && test $space != no; then
+DF_PROG="df"
+# LIBOBJS="$LIBOBJS fsusage.o"
+# LIBOBJS="$LIBOBJS mountlist.o"
+fi
+
+# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
+# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
+# enable the work-around code in fsusage.c.
+AC_MSG_CHECKING([for statfs that truncates block counts])
+AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
+[AC_TRY_COMPILE([
+#if !defined(sun) && !defined(__sun)
+choke -- this is a workaround for a Sun-specific problem
+#endif
+#include <sys/types.h>
+#include <sys/vfs.h>],
+[struct statfs t; long c = *(t.f_spare);],
+fu_cv_sys_truncating_statfs=yes,
+fu_cv_sys_truncating_statfs=no,
+)])
+if test $fu_cv_sys_truncating_statfs = yes; then
+AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS)
+fi
+AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
+
+AC_CHECKING(for AFS)
+test -d /afs && AC_DEFINE(AFS)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-gettext.m4 b/parts/appwizard/common/gnome/macros/gnome-gettext.m4
new file mode 100644
index 00000000..1dac989c
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-gettext.m4
@@ -0,0 +1,336 @@
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# Modified to never use included libintl.
+# Owen Taylor <otaylor@redhat.com>, 12/15/1998
+#
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 5
+
+AC_DEFUN(AM_GNOME_WITH_NLS,
+ [AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+
+ USE_INCLUDED_LIBINTL=no
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ AC_DEFINE(ENABLE_NLS)
+# AC_MSG_CHECKING([whether included gettext is requested])
+# AC_ARG_WITH(included-gettext,
+# [ --with-included-gettext use the GNU gettext library included here],
+# nls_cv_force_use_gnu_gettext=$withval,
+# nls_cv_force_use_gnu_gettext=no)
+# AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+ nls_cv_force_use_gnu_gettext="no"
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If gettext or catgets are available (in this order) we
+ dnl use this. Else we have to fall back to GNU NLS library.
+ dnl catgets is only used if permitted by option --with-catgets.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ AC_CHECK_HEADER(libintl.h,
+ [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CACHE_CHECK([for gettext in libintl],
+ gt_cv_func_gettext_libintl,
+ [AC_CHECK_LIB(intl, gettext,
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)],
+ gt_cv_func_gettext_libintl=no)])
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT)
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ AC_CHECK_FUNCS(dcgettext)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ INSTOBJEXT=.mo
+ fi
+ fi
+
+ # Added by Martin Baulig 12/15/98 for libc5 systems
+ if test "$gt_cv_func_gettext_libc" != "yes" \
+ && test "$gt_cv_func_gettext_libintl" = "yes"; then
+ INTLLIBS=-lintl
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ fi
+ ])
+
+ if test "$CATOBJEXT" = "NONE"; then
+ AC_MSG_CHECKING([whether catgets can be used])
+ AC_ARG_WITH(catgets,
+ [ --with-catgets use catgets functions if available],
+ nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
+ AC_MSG_RESULT($nls_cv_use_catgets)
+
+ if test "$nls_cv_use_catgets" = "yes"; then
+ dnl No gettext in C library. Try catgets next.
+ AC_CHECK_LIB(i, main)
+ AC_CHECK_FUNC(catgets,
+ [AC_DEFINE(HAVE_CATGETS)
+ INTLOBJS="\$(CATOBJS)"
+ AC_PATH_PROG(GENCAT, gencat, no)dnl
+# if test "$GENCAT" != "no"; then
+# AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
+# if test "$GMSGFMT" = "no"; then
+# AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
+# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
+# fi
+# AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+# USE_INCLUDED_LIBINTL=yes
+# CATOBJEXT=.cat
+# INSTOBJEXT=.cat
+# DATADIRNAME=lib
+# INTLDEPS='$(top_builddir)/intl/libintl.a'
+# INTLLIBS=$INTLDEPS
+# LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+# nls_cv_header_intl=intl/libintl.h
+# nls_cv_header_libgt=intl/libgettext.h
+# fi
+ ])
+ fi
+ fi
+
+ if test "$CATOBJEXT" = "NONE"; then
+ dnl Neither gettext nor catgets in included in the C library.
+ dnl Fall back on GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" != "yes"; then
+ AC_DEFINE(ENABLE_NLS)
+ else
+ # Unset this variable since we use the non-zero value as a flag.
+ CATOBJEXT=
+# dnl Mark actions used to generate GNU NLS library.
+# INTLOBJS="\$(GETTOBJS)"
+# AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+# AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+# AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+# [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+# AC_SUBST(MSGFMT)
+# USE_INCLUDED_LIBINTL=yes
+# CATOBJEXT=.gmo
+# INSTOBJEXT=.mo
+# DATADIRNAME=share
+# INTLDEPS='$(top_builddir)/intl/libintl.a'
+# INTLLIBS=$INTLDEPS
+# LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+# nls_cv_header_intl=intl/libintl.h
+# nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext program is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+ AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+ AC_OUTPUT_COMMANDS(
+ [case "$CONFIG_FILES" in *po/Makefile.in*)
+ sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
+ esac])
+
+
+# # If this is used in GNU gettext we have to set USE_NLS to `yes'
+# # because some of the sources are only built for this goal.
+# if test "$PACKAGE" = gettext; then
+# USE_NLS=yes
+# USE_INCLUDED_LIBINTL=yes
+# fi
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLDEPS)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(INTLOBJS)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+AC_DEFUN(AM_GNOME_GETTEXT,
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+strdup __argz_count __argz_stringify __argz_next])
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ AC_CHECK_FUNCS(stpcpy)
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ AC_DEFINE(HAVE_STPCPY)
+ fi
+
+ AM_LC_MESSAGES
+ AM_GNOME_WITH_NLS
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ if test "x$LINGUAS" = "x"; then
+ LINGUAS=$ALL_LINGUAS
+ fi
+ for lang in $LINGUAS; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl The reference to <locale.h> in the installed <libintl.h> file
+ dnl must be resolved because we cannot expect the users of this
+ dnl to define HAVE_LOCALE_H.
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+ AC_SUBST(INCLUDE_LOCALE_H)
+
+ dnl Determine which catalog format we have (if any is needed)
+ dnl For now we know about two different formats:
+ dnl Linux libc-5 and the normal X/Open format
+ test -d intl || mkdir intl
+ if test "$CATOBJEXT" = ".cat"; then
+ AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+ dnl Transform the SED scripts while copying because some dumb SEDs
+ dnl cannot handle comments.
+ sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+ fi
+ dnl po2tbl.sed is always needed.
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+
+ dnl In the intl/Makefile.in we have a special dependency which makes
+ dnl only sense for gettext. We comment this out for non-gettext
+ dnl packages.
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+ AC_SUBST(GT_NO)
+ AC_SUBST(GT_YES)
+
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+ dnl Try to locate is.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl *** For now the libtool support in intl/Makefile is not for real.
+ l=
+ AC_SUBST(l)
+
+ dnl Generate list of files to be processed by xgettext which will
+ dnl be included in po/Makefile.
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ ])
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-ghttp-check.m4 b/parts/appwizard/common/gnome/macros/gnome-ghttp-check.m4
new file mode 100644
index 00000000..1fc85783
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-ghttp-check.m4
@@ -0,0 +1,14 @@
+AC_DEFUN([GNOME_GHTTP_CHECK],[
+ AC_REQUIRE([GNOME_INIT_HOOK])
+ GHTTP_LIB=
+ AC_CHECK_FUNC(connect,,[
+ AC_CHECK_LIB(socket,connect,
+ GHTTP_LIB="-lsocket $GHTTP_LIB",,$GHTTP_LIB)])
+ AC_CHECK_FUNC(gethostbyname,,[
+ AC_CHECK_LIB(nsl,gethostbyname,
+ GHTTP_LIB="-lnsl $GHTTP_LIB",,$GHTTP_LIB)])
+ AC_CHECK_LIB(ghttp, ghttp_request_new,
+ GHTTP_LIB="-lghttp $GHTTP_LIB",,-L$gnome_prefix $GHTTP_LIB)
+ AC_SUBST(GHTTP_LIB)
+ AC_PROVIDE([GNOME_GHTTP_CHECK])
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-gnorba-check.m4 b/parts/appwizard/common/gnome/macros/gnome-gnorba-check.m4
new file mode 100644
index 00000000..dbac0a6c
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-gnorba-check.m4
@@ -0,0 +1,35 @@
+dnl
+dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
+dnl
+dnl if failflag is "failure" it aborts if gnorba is not found.
+dnl
+
+AC_DEFUN([GNOME_GNORBA_HOOK],[
+ GNOME_ORBIT_HOOK([],$2)
+ AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
+ gnome_cv_gnorba_found=no
+ if test x$gnome_cv_orbit_found = xyes; then
+ GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
+ GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
+ if test -n "$GNORBA_LIBS"; then
+ gnome_cv_gnorba_found=yes
+ fi
+ fi
+ ])
+ AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
+ if test x$gnome_cv_orbit_found = xyes; then
+ $1
+ GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
+ GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
+ AC_SUBST(GNORBA_CFLAGS)
+ AC_SUBST(GNORBA_LIBS)
+ else
+ if test x$2 = xfailure; then
+ AC_MSG_ERROR(gnorba library not installed or installation problem)
+ fi
+ fi
+])
+
+AC_DEFUN([GNOME_GNORBA_CHECK], [
+ GNOME_GNORBA_HOOK([],failure)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-guile-checks.m4 b/parts/appwizard/common/gnome/macros/gnome-guile-checks.m4
new file mode 100644
index 00000000..1086d30a
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-guile-checks.m4
@@ -0,0 +1,119 @@
+dnl
+dnl GNOME_CHECK_GUILE (failflag)
+dnl
+dnl if failflag is "fail" then GNOME_CHECK_GUILE will abort if guile is not found.
+dnl
+
+AC_DEFUN([GNOME_CHECK_GUILE],
+[
+ saved_ldflags="$LDFLAGS"
+ saved_cppflags="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $GNOME_LIBDIR"
+
+ AC_CHECK_LIB(qthreads,qt_null,[
+ QTTHREADS_LIB="-lqthreads"
+ ],[
+ AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt")
+ ],$LIBS)
+ AC_SUBST(QTTHREADS_LIB)
+
+ AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap")
+ AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline",,$TERMCAP_LIB)
+
+ AC_SUBST(TERMCAP_LIB)
+ AC_SUBST(READLINE_LIB)
+
+ if test "x$cross_compiling" = "xyes" ; then
+ name_build_guile="$target_alias-guile-config"
+ else
+ name_build_guile="guile-config"
+ fi
+
+ AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
+
+ if test "x$BUILD_GUILE" = "xyes"; then
+ AC_MSG_CHECKING(whether $name_build_guile works)
+ if test x`$name_build_guile --version >/dev/null 2>&1 || \
+ echo no` = xno; then
+ BUILD_GUILE=no
+ fi
+ AC_MSG_RESULT($BUILD_GUILE)
+ else
+
+ if test "x$cross_compiling" = "xyes" ; then
+ name_build_guile="$target_alias-build-guile"
+ else
+ name_build_guile="build-guile"
+ fi
+
+ AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
+
+ if test "x$BUILD_GUILE" = "xyes"; then
+ AC_MSG_CHECKING(whether $name_build_guile works)
+ if test x`$name_build_guile --version >/dev/null 2>&1 || \
+ echo no` = xno; then
+ BUILD_GUILE=no
+ fi
+ AC_MSG_RESULT($BUILD_GUILE)
+ fi
+ fi
+
+ AC_CHECK_LIB(m, sin)
+
+ if test "x$BUILD_GUILE" = "xyes"; then
+ AC_MSG_CHECKING(for guile libraries)
+ GUILE_LIBS="`$name_build_guile link`"
+ AC_MSG_RESULT($GUILE_LIBS)
+ AC_MSG_CHECKING(for guile headers)
+ GUILE_INCS="`$name_build_guile compile`"
+ AC_MSG_RESULT($GUILE_INCS)
+ else
+ GUILE_LIBS="$GNOME_LIBDIR"
+ GUILE_INCS="$GNOME_INCLUDEDIR"
+ AC_CHECK_LIB(rx, main, GUILE_LIBS="-lrx $GUILE_LIBS")
+ AC_CHECK_LIB(qt, qt_null, GUILE_LIBS="-lqt $GUILE_LIBS")
+ AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS")
+ AC_CHECK_LIB(nsl, t_accept, GUILE_LIBS="$GUILE_LIBS -lnsl")
+ AC_CHECK_LIB(socket, socket, GUILE_LIBS="$GUILE_LIBS -lsocket")
+ GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $READLINE_LIB $TERMCAP_LIB"
+ fi
+
+ AC_SUBST(GUILE_LIBS)
+ AC_SUBST(GUILE_INCS)
+
+ saved_LIBS="$LIBS"
+ LIBS="$LIBS $GUILE_LIBS"
+ CPPFLAGS="$saved_cppflags $GUILE_INCS"
+
+ AC_MSG_CHECKING(whether guile works)
+ AC_TRY_LINK([
+ #include <libguile.h>
+ #include <guile/gh.h>
+ ],[
+ gh_eval_str("(newline)");
+ scm_boot_guile(0,NULL,NULL,NULL);
+ ],[
+ ac_cv_guile_found=yes
+ AC_DEFINE(HAVE_GUILE)
+ ],[
+ ac_cv_guile_found=no
+ ])
+ AC_MSG_RESULT($ac_cv_guile_found)
+
+ if test x$ac_cv_guile_found = xno ; then
+ if test x$1 = xfail ; then
+ AC_MSG_ERROR(Can not find Guile on this system)
+ else
+ AC_MSG_WARN(Can not find Guile on this system)
+ fi
+ ac_cv_guile_found=no
+ GUILE_LIBS= GUILE_INCS=
+ fi
+
+ LIBS="$saved_LIBS"
+ LDFLAGS="$saved_ldflags"
+ CPPFLAGS="$saved_cppflags"
+
+ AC_SUBST(GUILE_LIBS)
+ AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-libgtop-check.m4 b/parts/appwizard/common/gnome/macros/gnome-libgtop-check.m4
new file mode 100644
index 00000000..81fbb601
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-libgtop-check.m4
@@ -0,0 +1,182 @@
+dnl
+dnl GNOME_LIBGTOP_TYPES
+dnl
+dnl some typechecks for libgtop.
+dnl
+
+AC_DEFUN([GNOME_LIBGTOP_TYPES],
+[
+ AC_CHECK_TYPE(u_int64_t, unsigned long long int)
+ AC_CHECK_TYPE(int64_t, long long int)
+])
+
+dnl
+dnl GNOME_LIBGTOP_HOOK (minversion, script-if-libgtop-enabled, failflag)
+dnl
+dnl if failflag is "fail" then GNOME_LIBGTOP_HOOK will abort if LibGTop
+dnl is not found.
+dnl
+
+AC_DEFUN([GNOME_LIBGTOP_HOOK],
+[
+ AC_REQUIRE([GNOME_LIBGTOP_TYPES])
+
+ AC_SUBST(LIBGTOP_LIBDIR)
+ AC_SUBST(LIBGTOP_INCLUDEDIR)
+ AC_SUBST(LIBGTOP_EXTRA_LIBS)
+ AC_SUBST(LIBGTOP_LIBS)
+ AC_SUBST(LIBGTOP_INCS)
+ AC_SUBST(LIBGTOP_NAMES_LIBS)
+ AC_SUBST(LIBGTOP_NAMES_INCS)
+ AC_SUBST(LIBGTOP_GUILE_INCS)
+ AC_SUBST(LIBGTOP_GUILE_LIBS)
+ AC_SUBST(LIBGTOP_GUILE_NAMES_INCS)
+ AC_SUBST(LIBGTOP_GUILE_NAMES_LIBS)
+ AC_SUBST(LIBGTOP_MAJOR_VERSION)
+ AC_SUBST(LIBGTOP_MINOR_VERSION)
+ AC_SUBST(LIBGTOP_MICRO_VERSION)
+ AC_SUBST(LIBGTOP_VERSION)
+ AC_SUBST(LIBGTOP_VERSION_CODE)
+ AC_SUBST(LIBGTOP_SERVER_VERSION)
+ AC_SUBST(LIBGTOP_INTERFACE_AGE)
+ AC_SUBST(LIBGTOP_BINARY_AGE)
+ AC_SUBST(LIBGTOP_BINDIR)
+ AC_SUBST(LIBGTOP_SERVER)
+
+ dnl Get the cflags and libraries from the libgtop-config script
+ dnl
+ AC_ARG_WITH(libgtop,
+ [ --with-libgtop=PFX Prefix where LIBGTOP is installed (optional)],
+ libgtop_config_prefix="$withval", libgtop_config_prefix="")
+ AC_ARG_WITH(libgtop-exec,
+ [ --with-libgtop-exec=PFX Exec prefix where LIBGTOP is installed (optional)],
+ libgtop_config_exec_prefix="$withval", libgtop_config_exec_prefix="")
+
+ if test x$libgtop_config_exec_prefix != x ; then
+ libgtop_config_args="$libgtop_config_args --exec-prefix=$libgtop_config_exec_prefix"
+ if test x${LIBGTOP_CONFIG+set} != xset ; then
+ LIBGTOP_CONFIG=$libgtop_config_exec_prefix/bin/libgtop-config
+ fi
+ fi
+ if test x$libgtop_config_prefix != x ; then
+ libgtop_config_args="$libgtop_config_args --prefix=$libgtop_config_prefix"
+ if test x${LIBGTOP_CONFIG+set} != xset ; then
+ LIBGTOP_CONFIG=$libgtop_config_prefix/bin/libgtop-config
+ fi
+ fi
+
+ AC_PATH_PROG(LIBGTOP_CONFIG, libgtop-config, no)
+ dnl IMPORTANT NOTICE:
+ dnl If you increase this number here, this means that *ALL*
+ dnl modules will require the new version, even if they explicitly
+ dnl give a lower number in their `configure.in' !!!
+ real_min_libgtop_version=1.0.0
+ min_libgtop_version=ifelse([$1], ,$real_min_libgtop_version,$1)
+ dnl I know, the following code looks really ugly, but if you want
+ dnl to make changes, please test it with a brain-dead /bin/sh and
+ dnl with a brain-dead /bin/test (not all shells/tests support the
+ dnl `<' operator to compare strings, that's why I convert everything
+ dnl into numbers and test them).
+ min_libgtop_major=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ min_libgtop_minor=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ min_libgtop_micro=`echo $min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test x$min_libgtop_micro = x && min_libgtop_micro=0
+ real_min_libgtop_major=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ real_min_libgtop_minor=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ real_min_libgtop_micro=`echo $real_min_libgtop_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test x$real_min_libgtop_micro = x && real_min_libgtop_micro=0
+ dnl You cannot require a version less then $real_min_libgtop_version,
+ dnl so you don't need to update each `configure.in' when it's increased.
+ if test $real_min_libgtop_major -gt $min_libgtop_major ; then
+ min_libgtop_major=$real_min_libgtop_major
+ min_libgtop_minor=$real_min_libgtop_minor
+ min_libgtop_micro=$real_min_libgtop_micro
+ elif test $real_min_libgtop_major = $min_libgtop_major ; then
+ if test $real_min_libgtop_minor -gt $min_libgtop_minor ; then
+ min_libgtop_minor=$real_min_libgtop_minor
+ min_libgtop_micro=$real_min_libgtop_micro
+ elif test $real_min_libgtop_minor = $min_libgtop_minor ; then
+ if test $real_min_libgtop_micro -gt $min_libgtop_micro ; then
+ min_libgtop_micro=$real_min_libgtop_micro
+ fi
+ fi
+ fi
+ min_libgtop_version="$min_libgtop_major.$min_libgtop_minor.$min_libgtop_micro"
+ AC_MSG_CHECKING(for libgtop - version >= $min_libgtop_version)
+ no_libgtop=""
+ if test "$LIBGTOP_CONFIG" = "no" ; then
+ no_libgtop=yes
+ else
+ configfile=`$LIBGTOP_CONFIG --config`
+ libgtop_major_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ libgtop_minor_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ libgtop_micro_version=`$LIBGTOP_CONFIG --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ test $libgtop_major_version != $min_libgtop_major && no_libgtop=yes
+ test $libgtop_minor_version -lt $min_libgtop_minor && no_libgtop=yes
+ if test $libgtop_minor_version = $min_libgtop_minor ; then
+ test $libgtop_micro_version -lt $min_libgtop_micro && no_libgtop=yes
+ fi
+ . $configfile
+ fi
+ if test x$no_libgtop = x ; then
+ AC_DEFINE(HAVE_LIBGTOP)
+ AC_DEFINE_UNQUOTED(LIBGTOP_VERSION, "$LIBGTOP_VERSION")
+ AC_DEFINE_UNQUOTED(LIBGTOP_VERSION_CODE, $LIBGTOP_VERSION_CODE)
+ AC_DEFINE_UNQUOTED(LIBGTOP_MAJOR_VERSION, $LIBGTOP_MAJOR_VERSION)
+ AC_DEFINE_UNQUOTED(LIBGTOP_MINOR_VERSION, $LIBGTOP_MINOR_VERSION)
+ AC_DEFINE_UNQUOTED(LIBGTOP_MICRO_VERSION, $LIBGTOP_MICRO_VERSION)
+ AC_DEFINE_UNQUOTED(LIBGTOP_SERVER_VERSION, $LIBGTOP_SERVER_VERSION)
+ AC_MSG_RESULT(yes)
+ dnl Note that an empty true branch is not valid sh syntax.
+ ifelse([$2], [], :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "x$3" = "xfail"; then
+ AC_MSG_ERROR(LibGTop >= $min_libgtop_version not found)
+ else
+ AC_MSG_WARN(LibGTop >= $min_libgtop_version not found)
+ fi
+ fi
+
+ AM_CONDITIONAL(HAVE_LIBGTOP, test x$no_libgtop != xyes)
+])
+
+AC_DEFUN([GNOME_INIT_LIBGTOP],[
+ GNOME_LIBGTOP_HOOK($1,[ifelse([$3], [], :, [$3])],$2)
+])
+
+dnl
+dnl GNOME_LIBGTOP_DOCU
+dnl
+dnl checks whether the documentation of LibGTop is installed
+dnl
+
+AC_DEFUN([GNOME_LIBGTOP_DOCU],
+[
+ AC_REQUIRE([GNOME_LIBGTOP_HOOK])
+
+ helpdir="$LIBGTOP_DATADIR/gnome/help/libgtop"
+
+ AC_MSG_CHECKING(whether you have the LibGTop Documentation)
+
+ if test -f "$helpdir/C/topic.dat" ; then
+ have_libgtop_docu=yes
+ AC_DEFINE(HAVE_LIBGTOP_DOCU)
+ else
+ have_libgtop_docu=no
+ fi
+
+ AC_MSG_RESULT($have_libgtop_docu)
+
+ AM_CONDITIONAL(HAVE_LIBGTOP_DOCU, test x$have_libgtop_docu = xyes)
+])
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-objc-checks.m4 b/parts/appwizard/common/gnome/macros/gnome-objc-checks.m4
new file mode 100644
index 00000000..dc9691cf
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-objc-checks.m4
@@ -0,0 +1,79 @@
+AC_DEFUN([GNOME_CHECK_OBJC],
+[
+dnl Look for an ObjC compiler.
+dnl FIXME: extend list of possible names of ObjC compilers.
+ AC_CHECK_PROGS(OBJC, $OBJC egcs, "")
+ if test "x$OBJC" = "x" ; then
+ AC_CHECK_PROGS(OBJC, $OBJC egcc, "")
+ if test "x$OBJC" = "x" ; then
+ AC_CHECK_PROGS(OBJC, $OBJC gcc, "")
+ fi
+ fi
+
+ AC_REQUIRE([GNOME_PTHREAD_CHECK])
+
+ OBJC_LIBS="-lobjc $PTHREAD_LIB"
+ AC_CHECK_FUNC(sched_yield,,[
+ AC_CHECK_LIB(posix4,sched_yield,
+ OBJC_LIBS="$OBJC_LIBS -lposix4",, $OBJC_LIBS)])
+ AC_SUBST(OBJC_LIBS)
+
+ AC_CACHE_CHECK([if Objective C compiler ($OBJC) works],
+ ac_cv_prog_objc_works, [
+ if test -n "$OBJC"; then
+ cat > conftest.m <<EOF
+#include <objc/Object.h>
+@interface myRandomObj : Object
+{
+}
+@end
+@implementation myRandomObj
+@end
+int main () {
+ /* No, you are not seeing double. Remember that square brackets
+ are the autoconf m4 quotes. */
+ id myid = [[myRandomObj alloc]];
+ [[myid free]];
+ return 0;
+}
+EOF
+
+ $OBJC $CFLAGS -o conftest $LDFLAGS conftest.m $OBJC_LIBS 1>&AC_FD_CC 2>&1
+ result=$?
+ rm -f conftest*
+
+ if test $result -eq 0; then
+ ac_cv_prog_objc_works=yes
+ fi
+ else
+ ac_cv_prog_objc_works=no
+ fi
+ ])
+
+ AM_CONDITIONAL(OBJECTIVE_C, test x$ac_cv_prog_objc_works = xyes)
+ dnl Also set the shell variable OBJECTIVE_C to "yes" or "no".
+ OBJECTIVE_C=$ac_cv_prog_objc_works
+])
+
+AC_DEFUN([GNOME_INIT_OBJC],
+[
+ AC_MSG_CHECKING(for an obGnomeConf.sh)
+ my_gnome_libdir=`$GNOME_CONFIG --libdir`
+ if test -f $my_gnome_libdir/obGnomeConf.sh; then
+ . $my_gnome_libdir/obGnomeConf.sh
+ AC_MSG_RESULT(found $my_gnome_libdir)
+ ac_cv_have_gnome_objc=yes
+ else
+ AC_MSG_RESULT(not found)
+ AC_MSG_WARN(Could not find the obGnomeConf.sh file that is generated by gnome-objc install)
+ ac_cv_have_gnome_objc=no
+ fi
+
+ dnl Add a conditional on whether or not we have gnome-objc
+ AM_CONDITIONAL(HAVE_GNOME_OBJC, test x$ac_cv_have_gnome_objc = xyes)
+ HAVE_GNOME_OBJC=$ac_cv_have_gnome_objc
+
+ AC_SUBST(OBGNOME_INCLUDEDIR)
+ AC_SUBST(OBGNOME_LIBS)
+ AC_SUBST(OBGTK_LIBS)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-orbit-check.m4 b/parts/appwizard/common/gnome/macros/gnome-orbit-check.m4
new file mode 100644
index 00000000..54bf33aa
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-orbit-check.m4
@@ -0,0 +1,33 @@
+dnl
+dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
+dnl
+dnl if failflag is "failure" it aborts if orbit is not found.
+dnl
+
+AC_DEFUN([GNOME_ORBIT_HOOK],[
+ AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
+ AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
+ AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
+ if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
+ gnome_cv_orbit_found=no
+ else
+ gnome_cv_orbit_found=yes
+ fi
+ ])
+ AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
+ if test x$gnome_cv_orbit_found = xyes; then
+ $1
+ ORBIT_CFLAGS=`orbit-config --cflags client server`
+ ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
+ AC_SUBST(ORBIT_CFLAGS)
+ AC_SUBST(ORBIT_LIBS)
+ else
+ if test x$2 = xfailure; then
+ AC_MSG_ERROR(ORBit not installed or installation problem)
+ fi
+ fi
+])
+
+AC_DEFUN([GNOME_ORBIT_CHECK], [
+ GNOME_ORBIT_HOOK([],failure)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-print-check.m4 b/parts/appwizard/common/gnome/macros/gnome-print-check.m4
new file mode 100644
index 00000000..7d98281d
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-print-check.m4
@@ -0,0 +1,171 @@
+# Configure paths for GNOME-PRINT
+# Chris Lahey 99-2-5
+# stolen from Manish Singh again
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_GNOME_PRINT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GNOME-PRINT, and define GNOME_PRINT_CFLAGS and GNOME_PRINT_LIBS
+dnl
+AC_DEFUN(AM_PATH_GNOME_PRINT,
+[dnl
+dnl Get the cflags and libraries from the gnome-config script
+dnl
+AC_ARG_WITH(gnome-print-prefix,[ --with-gnome-print-prefix=PFX Prefix where GNOME-PRINT is installed (optional)],
+ gnome_print_prefix="$withval", gnome_print_prefix="")
+AC_ARG_WITH(gnome-print-exec-prefix,[ --with-gnome-print-exec-prefix=PFX Exec prefix where GNOME-PRINT is installed (optional)],
+ gnome_print_exec_prefix="$withval", gnome_print_exec_prefix="")
+AC_ARG_ENABLE(gnome-printtest, [ --disable-gnome-printtest Do not try to compile and run a test GNOME-PRINT program],
+ , enable_gnome_printtest=yes)
+
+ if test x$gnome_print_exec_prefix != x ; then
+ gnome_print_args="$gnome_print_args --exec-prefix=$gnome_print_exec_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$gnome_print_exec_prefix/bin/gnome-config
+ fi
+ fi
+ if test x$gnome_print_prefix != x ; then
+ gnome_print_args="$gnome_print_args --prefix=$gnome_print_prefix"
+ if test x${GNOME_CONFIG+set} != xset ; then
+ GNOME_CONFIG=$gnome_print_prefix/bin/gnome-config
+ fi
+ fi
+
+ AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
+ min_gnome_print_version=ifelse([$1], ,0.1.0,$1)
+ AC_MSG_CHECKING(for GNOME-PRINT - version >= $min_gnome_print_version)
+ no_gnome_print=""
+ if test "$GNOME_CONFIG" = "no" ; then
+ no_gnome_print=yes
+ else
+ GNOME_PRINT_CFLAGS=`$GNOME_CONFIG $gnome_printconf_args --cflags print`
+ GNOME_PRINT_LIBS=`$GNOME_CONFIG $gnome_printconf_args --libs print`
+
+ gnome_print_major_version=`$GNOME_CONFIG $gnome_print_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ gnome_print_minor_version=`$GNOME_CONFIG $gnome_print_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ gnome_print_micro_version=`$GNOME_CONFIG $gnome_print_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_gnome_printtest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GNOME_PRINT_CFLAGS"
+ LIBS="$LIBS $GNOME_PRINT_LIBS"
+dnl
+dnl Now check if the installed GNOME-PRINT is sufficiently new. (Also sanity
+dnl checks the results of gnome-config to some extent
+dnl
+ rm -f conf.gnome_printtest
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libgnomeprint/gnome-print.h>
+
+static char*
+my_strdup (char *str)
+{
+ char *new_str;
+
+ if (str)
+ {
+ new_str = malloc ((strlen (str) + 1) * sizeof(char));
+ strcpy (new_str, str);
+ }
+ else
+ new_str = NULL;
+
+ return new_str;
+}
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.gnome_printtest");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = my_strdup("$min_gnome_print_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gnome_print_version");
+ exit(1);
+ }
+ return 0;
+#if 0
+ if (($gnome_print_major_version > major) ||
+ (($gnome_print_major_version == major) && ($gnome_print_minor_version > minor)) ||
+ (($gnome_print_major_version == major) && ($gnome_print_minor_version == minor) && ($gnome_print_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** 'gnome-config print --version' returned %d.%d.%d, but the minimum version\n", $gnome_print_major_version, $gnome_print_minor_version, $gnome_print_micro_version);
+ printf("*** of GNOME-PRINT required is %d.%d.%d. If gnome-config is correct, then it is\n", major, minor, micro);
+ printf("*** best to upgrade to the required version.\n");
+ printf("*** If gnome-config was wrong, set the environment variable GNOME_CONFIG\n");
+ printf("*** to point to the correct copy of gnome-config, and remove the file\n");
+ printf("*** config.cache before re-running configure\n");
+ return 1;
+ }
+#endif
+}
+
+],, no_gnome_print=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_gnome_print" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$GNOME_CONFIG" = "no" ; then
+ echo "*** The gnome-config script installed by GNOME-LIBS could not be found"
+ echo "*** If GNOME-PRINT was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the GNOME_CONFIG environment variable to the"
+ echo "*** full path to gnome-config."
+ else
+ if test -f conf.gnome_printtest ; then
+ :
+ else
+ echo "*** Could not run GNOME-PRINT test program, checking why..."
+ CFLAGS="$CFLAGS $GNOME_PRINT_CFLAGS"
+ LIBS="$LIBS $GNOME_PRINT_LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <libgnomeprint/gnome-print.h>
+], [ return 0; ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding GNOME-PRINT or finding the wrong"
+ echo "*** version of GNOME-PRINT. If it is not finding GNOME-PRINT, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means GNOME-PRINT was incorrectly installed"
+ echo "*** or that you have moved GNOME-PRINT since it was installed. In the latter case, you"
+ echo "*** may want to edit the gnome-config script: $GNOME_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ GNOME_PRINT_CFLAGS=""
+ GNOME_PRINT_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GNOME_PRINT_CFLAGS)
+ AC_SUBST(GNOME_PRINT_LIBS)
+ rm -f conf.gnome_printtest
+])
+
+AC_DEFUN([GNOME_PRINT_CHECK], [
+ AM_PATH_GNOME_PRINT(0.1.0,,[AC_MSG_ERROR(GNOME-PRINT not found)])
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-pthread-check.m4 b/parts/appwizard/common/gnome/macros/gnome-pthread-check.m4
new file mode 100644
index 00000000..a4eb3b48
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-pthread-check.m4
@@ -0,0 +1,16 @@
+dnl
+dnl And better, use gthreads instead...
+dnl
+
+AC_DEFUN([GNOME_PTHREAD_CHECK],[
+ PTHREAD_LIB=""
+ AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
+ [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads",
+ [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r",
+ [AC_CHECK_FUNC(pthread_create)]
+ )]
+ )]
+ )
+ AC_SUBST(PTHREAD_LIB)
+ AC_PROVIDE([GNOME_PTHREAD_CHECK])
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-support.m4 b/parts/appwizard/common/gnome/macros/gnome-support.m4
new file mode 100644
index 00000000..2c1d0498
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-support.m4
@@ -0,0 +1,68 @@
+dnl GNOME_SUPPORT_CHECKS
+dnl Check for various support functions needed by the standard
+dnl Gnome libraries. Sets LIBOBJS, might define some macros.
+dnl This should only be used when building the Gnome libs;
+dnl Gnome clients should not need this macro.
+AC_DEFUN([GNOME_SUPPORT_CHECKS],[
+ # we need an `awk' to build `gnomesupport.h'
+ AC_REQUIRE([AC_PROG_AWK])
+
+ # this should go away soon
+ need_gnome_support=yes
+
+ save_LIBOBJS="$LIBOBJS"
+ LIBOBJS=
+
+ AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o")
+
+ # for `scandir'
+ AC_HEADER_DIRENT
+
+ # copied from `configure.in' of `libiberty'
+ vars="program_invocation_short_name program_invocation_name sys_errlist"
+ for v in $vars; do
+ AC_MSG_CHECKING([for $v])
+ AC_CACHE_VAL(gnome_cv_var_$v,
+ [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;],
+ [eval "gnome_cv_var_$v=yes"],
+ [eval "gnome_cv_var_$v=no"])])
+ if eval "test \"`echo '$gnome_cv_var_'$v`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($n)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+
+ AC_REPLACE_FUNCS(memmove mkstemp scandir strcasecmp strerror strndup strnlen)
+ AC_REPLACE_FUNCS(strtok_r strtod strtol strtoul vasprintf vsnprintf)
+
+ AC_CHECK_FUNCS(realpath,,LIBOBJS="$LIBOBJS canonicalize.o")
+
+ # to include `error.c' error.c has some HAVE_* checks
+ AC_CHECK_FUNCS(vprintf doprnt strerror_r)
+ AM_FUNC_ERROR_AT_LINE
+
+ # This is required if we declare setreuid () and setregid ().
+ AC_TYPE_UID_T
+
+ # see if we need to declare some functions. Solaris is notorious for
+ # putting functions into the `libc' but not listing them in the headers
+ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h dirent.h)
+ GCC_NEED_DECLARATIONS(gethostname setreuid setregid getpagesize)
+ GCC_NEED_DECLARATION(scandir,[
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+])
+
+ # Turn our LIBOBJS into libtool objects. This is gross, but it
+ # requires changes to autoconf before it goes away.
+ LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'`
+ AC_SUBST(need_gnome_support)
+ AC_SUBST(LTLIBOBJS)
+
+ LIBOBJS="$save_LIBOBJS"
+ AM_CONDITIONAL(BUILD_GNOME_SUPPORT, test "$need_gnome_support" = yes)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-undelfs.m4 b/parts/appwizard/common/gnome/macros/gnome-undelfs.m4
new file mode 100644
index 00000000..c8ea6f4b
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-undelfs.m4
@@ -0,0 +1,20 @@
+dnl GNOME_UNDELFS_CHECKS
+dnl Check for ext2fs undel support.
+dnl Set shell variable ext2fs_undel to "yes" if we have it,
+dnl "no" otherwise. May define USE_EXT2FSLIB for cpp.
+dnl Will set EXT2FS_UNDEL_LIBS to required libraries.
+
+AC_DEFUN([GNOME_UNDELFS_CHECKS], [
+ AC_CHECK_HEADERS(ext2fs/ext2fs.h linux/ext2_fs.h)
+ ext2fs_undel=no
+ EXT2FS_UNDEL_LIBS=
+ if test x$ac_cv_header_ext2fs_ext2fs_h = xyes
+ then
+ if test x$ac_cv_header_linux_ext2_fs_h = xyes
+ then
+ AC_DEFINE(USE_EXT2FSLIB)
+ ext2fs_undel=yes
+ EXT2FS_UNDEL_LIBS="-lext2fs -lcom_err"
+ fi
+ fi
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-vfs.m4 b/parts/appwizard/common/gnome/macros/gnome-vfs.m4
new file mode 100644
index 00000000..137a39dd
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-vfs.m4
@@ -0,0 +1,120 @@
+dnl GNOME_VFS_CHECKS
+dnl Check for various functions needed by libvfs.
+dnl This has various effects:
+dnl Sets GNOME_VFS_LIBS to libraries required
+dnl Sets termnet to true or false depending on whether it is required.
+dnl If yes, defines USE_TERMNET.
+dnl Sets vfs_flags to "pretty" list of vfs implementations we include.
+dnl Sets shell variable use_vfs to yes (default, --with-vfs) or
+dnl "no" (--without-vfs).
+dnl Calls AC_SUBST(mcserv), which is either empty or "mcserv".
+
+dnl Private define
+AC_DEFUN([GNOME_WITH_VFS],[
+ dnl FIXME: network checks should probably be in their own macro.
+ AC_CHECK_LIB(nsl, t_accept)
+ AC_CHECK_LIB(socket, socket)
+
+ have_socket=no
+ AC_CHECK_FUNCS(socket, have_socket=yes)
+ if test $have_socket = no; then
+ # socket is not in the default libraries. See if it's in some other.
+ for lib in bsd socket inet; do
+ AC_CHECK_LIB($lib, socket, [
+ LIBS="$LIBS -l$lib"
+ have_socket=yes
+ AC_DEFINE(HAVE_SOCKET)
+ break])
+ done
+ fi
+
+ have_gethostbyname=no
+ AC_CHECK_FUNC(gethostbyname, have_gethostbyname=yes)
+ if test $have_gethostbyname = no; then
+ # gethostbyname is not in the default libraries. See if it's in some other.
+ for lib in bsd socket inet; do
+ AC_CHECK_LIB($lib, gethostbyname, [LIBS="$LIBS -l$lib"; have_gethostbyname=yes; break])
+ done
+ fi
+
+ vfs_flags="tarfs"
+ use_net_code=false
+ if test $have_socket = yes; then
+ AC_STRUCT_LINGER
+ AC_CHECK_FUNCS(pmap_set, , [
+ AC_CHECK_LIB(rpc, pmap_set, [
+ LIBS="-lrpc $LIBS"
+ AC_DEFINE(HAVE_PMAP_SET)
+ ])])
+ AC_CHECK_FUNCS(pmap_getport pmap_getmaps rresvport)
+ dnl add for source routing support setsockopt
+ AC_CHECK_HEADERS(rpc/pmap_clnt.h)
+ vfs_flags="$vfs_flags, mcfs, ftpfs, fish"
+ use_net_code=true
+ fi
+
+ dnl
+ dnl Samba support
+ dnl
+ smbfs=""
+ SAMBAFILES=""
+ AC_ARG_WITH(samba,
+ [--with-samba Support smb virtual file system],[
+ if test "x$withval != xno"; then
+ AC_DEFINE(WITH_SMBFS)
+ vfs_flags="$vfs_flags, smbfs"
+ smbfs="smbfs.o"
+ SAMBAFILES="\$(SAMBAFILES)"
+ fi
+ ])
+ AC_SUBST(smbfs)
+ AC_SUBST(SAMBAFILES)
+
+ dnl
+ dnl The termnet support
+ dnl
+ termnet=false
+ AC_ARG_WITH(termnet,
+ [--with-termnet If you want a termified net support],[
+ if test x$withval = xyes; then
+ AC_DEFINE(USE_TERMNET)
+ termnet=true
+ fi
+ ])
+
+ TERMNET=""
+ AC_DEFINE(USE_VFS)
+ if $use_net_code; then
+ AC_DEFINE(USE_NETCODE)
+ fi
+ mcserv=
+ if test $have_socket = yes; then
+ mcserv="mcserv"
+ if $termnet; then
+ TERMNET="-ltermnet"
+ fi
+ fi
+
+ AC_SUBST(TERMNET)
+ AC_SUBST(mcserv)
+
+dnl FIXME:
+dnl GNOME_VFS_LIBS=
+
+])
+
+AC_DEFUN([GNOME_VFS_CHECKS],[
+ use_vfs=yes
+ AC_ARG_WITH(vfs,
+ [--with-vfs Compile with the VFS code],
+ use_vfs=$withval
+ )
+ case $use_vfs in
+ yes) GNOME_WITH_VFS;;
+ no) use_vfs=no;;
+ *) use_vfs=no;;
+ dnl Should we issue a warning?
+ esac
+])
+
+
diff --git a/parts/appwizard/common/gnome/macros/gnome-x-checks.m4 b/parts/appwizard/common/gnome/macros/gnome-x-checks.m4
new file mode 100644
index 00000000..1e397ef8
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-x-checks.m4
@@ -0,0 +1,80 @@
+dnl GNOME_X_CHECKS
+dnl
+dnl Basic X11 related checks for X11. At the end, the following will be
+dnl defined/changed:
+dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK
+dnl CPPFLAGS Will include $X_CFLAGS
+dnl GNOME_HAVE_SM `true' or `false' depending on whether session
+dnl management is available. It is available if
+dnl both -lSM and X11/SM/SMlib.h exist. (Some
+dnl Solaris boxes have the library but not the header)
+dnl XPM_LIBS -lXpm if Xpm library is present, otherwise ""
+dnl
+dnl The following configure cache variables are defined (but not used):
+dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS}
+dnl
+AC_DEFUN([GNOME_X_CHECKS],
+[
+ AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path))
+ dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could
+ dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes"
+ dnl
+ dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses
+ dnl CPPFLAGS, not CFLAGS
+ CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
+
+ saved_ldflags="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $GTK_LIBS"
+
+ gnome_cv_passdown_x_libs="$GTK_LIBS"
+ gnome_cv_passdown_X_LIBS="$GTK_LIBS"
+ gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS"
+ gnome_cv_passdown_GTK_LIBS="$GTK_LIBS"
+
+ LDFLAGS="$saved_ldflags $GTK_LIBS"
+
+dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow.
+ USE_DEVGTK=true
+
+dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x])
+dnl AC_EGREP_CPP(answer_affirmatively,
+dnl [#include <gtk/gtkfeatures.h>
+dnl #ifdef GTK_HAVE_FEATURES_1_1_0
+dnl answer_affirmatively
+dnl #endif
+dnl ], dev_gtk=yes, dev_gtk=no)
+dnl if test "$dev_gtk" = "yes"; then
+dnl USE_DEVGTK=true
+dnl fi
+dnl AC_MSG_RESULT("$dev_gtk")
+
+ GNOME_HAVE_SM=true
+ case "$GTK_LIBS" in
+ *-lSM*)
+ dnl Already found it.
+ ;;
+ *)
+ dnl Assume that if we have -lSM then we also have -lICE.
+ AC_CHECK_LIB(SM, SmcSaveYourselfDone,
+ [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false,
+ $x_libs -lICE)
+ ;;
+ esac
+
+ if test "$GNOME_HAVE_SM" = true; then
+ AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false)
+ fi
+
+ if test "$GNOME_HAVE_SM" = true; then
+ AC_DEFINE(HAVE_LIBSM)
+ fi
+
+ XPM_LIBS=""
+ AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs)
+ AC_SUBST(XPM_LIBS)
+
+ AC_REQUIRE([GNOME_PTHREAD_CHECK])
+ LDFLAGS="$saved_ldflags"
+
+ AC_PROVIDE([GNOME_X_CHECKS])
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome-xml-check.m4 b/parts/appwizard/common/gnome/macros/gnome-xml-check.m4
new file mode 100644
index 00000000..5d379d16
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome-xml-check.m4
@@ -0,0 +1,30 @@
+dnl
+dnl GNOME_XML_HOOK (script-if-xml-found, failflag)
+dnl
+dnl If failflag is "failure", script aborts due to lack of XML
+dnl
+dnl Check for availability of the libxml library
+dnl the XML parser uses libz if available too
+dnl
+
+AC_DEFUN([GNOME_XML_HOOK],[
+ AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
+ if test "$GNOME_CONFIG" = no; then
+ if test x$2 = xfailure; then
+ AC_MSG_ERROR(Could not find gnome-config)
+ fi
+ fi
+ AC_CHECK_LIB(xml, xmlNewDoc, [
+ $1
+ AC_SUBST(GNOME_XML_LIB)
+ GNOME_XML_LIB=`gnome-config --libs xml`
+ ], [
+ if test x$2 = xfailure; then
+ AC_MSG_ERROR(Could not link sample xml program)
+ fi
+ ], `gnome-config --libs xml`)
+])
+
+AC_DEFUN([GNOME_XML_CHECK], [
+ GNOME_XML_HOOK([],failure)
+])
diff --git a/parts/appwizard/common/gnome/macros/gnome.m4 b/parts/appwizard/common/gnome/macros/gnome.m4
new file mode 100644
index 00000000..a3a9ca74
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/gnome.m4
@@ -0,0 +1,124 @@
+dnl
+dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits])
+dnl
+dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
+dnl is not found.
+dnl
+
+AC_DEFUN([GNOME_INIT_HOOK],[
+ AC_SUBST(GNOME_LIBS)
+ AC_SUBST(GNOMEUI_LIBS)
+ AC_SUBST(GNOMEGNORBA_LIBS)
+ AC_SUBST(GTKXMHTML_LIBS)
+ AC_SUBST(ZVT_LIBS)
+ AC_SUBST(GNOME_LIBDIR)
+ AC_SUBST(GNOME_INCLUDEDIR)
+
+ AC_ARG_WITH(gnome-includes,
+ [ --with-gnome-includes Specify location of GNOME headers],[
+ CFLAGS="$CFLAGS -I$withval"
+ ])
+
+ AC_ARG_WITH(gnome-libs,
+ [ --with-gnome-libs Specify location of GNOME libs],[
+ LDFLAGS="$LDFLAGS -L$withval"
+ gnome_prefix=$withval
+ ])
+
+ AC_ARG_WITH(gnome,
+ [ --with-gnome Specify prefix for GNOME files],
+ if test x$withval = xyes; then
+ want_gnome=yes
+ dnl Note that an empty true branch is not
+ dnl valid sh syntax.
+ ifelse([$1], [], :, [$1])
+ else
+ if test "x$withval" = xno; then
+ want_gnome=no
+ else
+ want_gnome=yes
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CFLAGS="$CFLAGS -I$withval/include"
+ gnome_prefix=$withval/lib
+ fi
+ fi,
+ want_gnome=yes)
+
+ if test "x$want_gnome" = xyes; then
+
+ AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
+ if test "$GNOME_CONFIG" = "no"; then
+ no_gnome_config="yes"
+ else
+ AC_MSG_CHECKING(if $GNOME_CONFIG works)
+ if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ GNOME_GNORBA_HOOK([],$2)
+ GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
+ GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
+ GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
+ GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
+ ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
+ GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
+ GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
+ $1
+ else
+ AC_MSG_RESULT(no)
+ no_gnome_config="yes"
+ fi
+ fi
+
+ if test x$exec_prefix = xNONE; then
+ if test x$prefix = xNONE; then
+ gnome_prefix=$ac_default_prefix/lib
+ else
+ gnome_prefix=$prefix/lib
+ fi
+ else
+ gnome_prefix=`eval echo \`echo $libdir\``
+ fi
+
+ if test "$no_gnome_config" = "yes"; then
+ AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
+ if test -f $gnome_prefix/gnomeConf.sh; then
+ AC_MSG_RESULT(found)
+ echo "loading gnome configuration from" \
+ "$gnome_prefix/gnomeConf.sh"
+ . $gnome_prefix/gnomeConf.sh
+ $1
+ else
+ AC_MSG_RESULT(not found)
+ if test x$2 = xfail; then
+ AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
+ fi
+ fi
+ fi
+ fi
+
+ if test -n "$3"; then
+ n="$3"
+ for i in $n; do
+ AC_MSG_CHECKING(extra library \"$i\")
+ case $i in
+ applets)
+ AC_SUBST(GNOME_APPLETS_LIBS)
+ GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets`
+ AC_MSG_RESULT($GNOME_APPLETS_LIBS);;
+ capplet)
+ AC_SUBST(GNOME_CAPPLET_LIBS)
+ GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet`
+ AC_MSG_RESULT($GNOME_CAPPLET_LIBS);;
+ *)
+ AC_MSG_RESULT(unknown library)
+ esac
+ done
+ fi
+])
+
+dnl
+dnl GNOME_INIT ([additional-inits])
+dnl
+
+AC_DEFUN([GNOME_INIT],[
+ GNOME_INIT_HOOK([],fail,$1)
+])
diff --git a/parts/appwizard/common/gnome/macros/linger.m4 b/parts/appwizard/common/gnome/macros/linger.m4
new file mode 100644
index 00000000..dfa7c8ae
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/linger.m4
@@ -0,0 +1,28 @@
+dnl
+dnl Check for struct linger
+dnl
+AC_DEFUN(AC_STRUCT_LINGER, [
+av_struct_linger=no
+AC_MSG_CHECKING(struct linger is available)
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/socket.h>
+
+struct linger li;
+
+main ()
+{
+ li.l_onoff = 1;
+ li.l_linger = 120;
+ exit (0);
+}
+],[
+AC_DEFINE(HAVE_STRUCT_LINGER)
+av_struct_linger=yes
+],[
+av_struct_linger=no
+],[
+av_struct_linger=no
+])
+AC_MSG_RESULT($av_struct_linger)
+])
diff --git a/parts/appwizard/common/gnome/macros/need-declaration.m4 b/parts/appwizard/common/gnome/macros/need-declaration.m4
new file mode 100644
index 00000000..d5b7bc66
--- /dev/null
+++ b/parts/appwizard/common/gnome/macros/need-declaration.m4
@@ -0,0 +1,42 @@
+dnl See whether we need a declaration for a function.
+dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
+AC_DEFUN(GCC_NEED_DECLARATION,
+[AC_MSG_CHECKING([whether $1 must be declared])
+AC_CACHE_VAL(gcc_cv_decl_needed_$1,
+[AC_TRY_COMPILE([
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+$2],
+[char *(*pfn) = (char *(*)) $1],
+eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
+if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ gcc_need_declarations="$gcc_need_declarations $1"
+ gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($gcc_tr_decl)
+else
+ AC_MSG_RESULT(no)
+fi
+])dnl
+
+dnl Check multiple functions to see whether each needs a declaration.
+dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
+AC_DEFUN(GCC_NEED_DECLARATIONS,
+[for ac_func in $1
+do
+GCC_NEED_DECLARATION($ac_func, $2)
+done
+]
+)
diff --git a/parts/appwizard/common/gnome2.kdevtemplate b/parts/appwizard/common/gnome2.kdevtemplate
new file mode 100644
index 00000000..02f631bf
--- /dev/null
+++ b/parts/appwizard/common/gnome2.kdevtemplate
@@ -0,0 +1,5 @@
+[GNOME2]
+Type=install archive
+Source=%{kdevelop}/template-common/gnome2.tar.gz
+Dest=%{dest}
+
diff --git a/parts/appwizard/common/gnome2/macros/aclocal-include.m4 b/parts/appwizard/common/gnome2/macros/aclocal-include.m4
new file mode 100644
index 00000000..43f9dbc4
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/aclocal-include.m4
@@ -0,0 +1,16 @@
+# aclocal-include.m4
+#
+# This macro adds the name macrodir to the set of directories
+# that `aclocal' searches for macros.
+
+# serial 1
+
+dnl AM_ACLOCAL_INCLUDE(macrodir)
+AC_DEFUN([AM_ACLOCAL_INCLUDE],
+[
+ AM_CONDITIONAL(INSIDE_GNOME_COMMON, false)
+
+ test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+ for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
+])
diff --git a/parts/appwizard/common/gnome2/macros/autogen.sh b/parts/appwizard/common/gnome2/macros/autogen.sh
new file mode 100755
index 00000000..ac9e0b68
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/autogen.sh
@@ -0,0 +1,384 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+#name of package
+PKG_NAME=${PKG_NAME:-Package}
+srcdir=${srcdir:-.}
+
+# default version requirements ...
+REQUIRED_AUTOCONF_VERSION=${REQUIRED_AUTOCONF_VERSION:-2.53}
+REQUIRED_AUTOMAKE_VERSION=${REQUIRED_AUTOMAKE_VERSION:-1.4}
+REQUIRED_LIBTOOL_VERSION=${REQUIRED_LIBTOOL_VERSION:-1.4.3}
+REQUIRED_GETTEXT_VERSION=${REQUIRED_GETTEXT_VERSION:-0.10.40}
+REQUIRED_GLIB_GETTEXT_VERSION=${REQUIRED_GLIB_GETTEXT_VERSION:-2.2.0}
+REQUIRED_INTLTOOL_VERSION=${REQUIRED_INTLTOOL_VERSION:-0.25}
+REQUIRED_PKG_CONFIG_VERSION=${REQUIRED_PKG_CONFIG_VERSION:-0.14.0}
+REQUIRED_GTK_DOC_VERSION=${REQUIRED_GTK_DOC_VERSION:-1.0}
+REQUIRED_DOC_COMMON_VERSION=${REQUIRED_DOC_COMMON_VERSION:-2.3.0}
+
+# a list of required m4 macros. Package can set an initial value
+REQUIRED_M4MACROS=${REQUIRED_M4MACROS:-}
+FORBIDDEN_M4MACROS=${FORBIDDEN_M4MACROS:-}
+
+# if GNOME2_DIR set, modify ACLOCAL_FLAGS ...
+if [ -n "$GNOME2_DIR" ]; then
+ ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
+ LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
+ PATH="$GNOME2_DIR/bin:$PATH"
+ export PATH
+ export LD_LIBRARY_PATH
+fi
+
+
+# Not all echo versions allow -n, so we check what is possible. This test is
+# based on the one in autoconf.
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ;;
+ *c*,* ) ECHO_N=-n ;;
+ *) ECHO_N= ;;
+esac
+
+# some terminal codes ...
+boldface="`tput bold 2>/dev/null`"
+normal="`tput sgr0 2>/dev/null`"
+printbold() {
+ echo $ECHO_N "$boldface"
+ echo "$@"
+ echo $ECHO_N "$normal"
+}
+printerr() {
+ echo "$@" >&2
+}
+
+# Usage:
+# compare_versions MIN_VERSION ACTUAL_VERSION
+# returns true if ACTUAL_VERSION >= MIN_VERSION
+compare_versions() {
+ ch_min_version=$1
+ ch_actual_version=$2
+ ch_status=0
+ IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
+ set $ch_actual_version
+ for min in $ch_min_version; do
+ ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
+ if [ -z "$ch_min" ]; then break; fi
+ if [ -z "$ch_cur" ]; then ch_status=1; break; fi
+ if [ $ch_cur -gt $ch_min ]; then break; fi
+ if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
+ done
+ IFS="$ch_save_IFS"
+ return $ch_status
+}
+
+# Usage:
+# version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
+# checks to see if the package is available
+version_check() {
+ vc_package=$1
+ vc_variable=$2
+ vc_checkprogs=$3
+ vc_min_version=$4
+ vc_source=$5
+ vc_status=1
+
+ vc_checkprog=`eval echo "\\$$vc_variable"`
+ if [ -n "$vc_checkprog" ]; then
+ printbold "using $vc_checkprog for $vc_package"
+ return 0
+ fi
+
+ printbold "checking for $vc_package >= $vc_min_version..."
+ for vc_checkprog in $vc_checkprogs; do
+ echo $ECHO_N " testing $vc_checkprog... "
+ if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
+ vc_actual_version=`$vc_checkprog --version | head -1 | \
+ sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
+ if compare_versions $vc_min_version $vc_actual_version; then
+ echo "found $vc_actual_version"
+ # set variable
+ eval "$vc_variable=$vc_checkprog"
+ vc_status=0
+ break
+ else
+ echo "too old (found version $vc_actual_version)"
+ fi
+ else
+ echo "not found."
+ fi
+ done
+ if [ "$vc_status" != 0 ]; then
+ printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
+ printerr " to build $PKG_NAME. Download the appropriate package for"
+ printerr " from your distribution or get the source tarball at"
+ printerr " $vc_source"
+ printerr
+ fi
+ return $vc_status
+}
+
+# Usage:
+# require_m4macro filename.m4
+# adds filename.m4 to the list of required macros
+require_m4macro() {
+ case "$REQUIRED_M4MACROS" in
+ $1\ * | *\ $1\ * | *\ $1) ;;
+ *) REQUIRED_M4MACROS="$REQUIRED_M4MACROS $1" ;;
+ esac
+}
+
+forbid_m4macro() {
+ case "$FORBIDDEN_M4MACROS" in
+ $1\ * | *\ $1\ * | *\ $1) ;;
+ *) FORBIDDEN_M4MACROS="$FORBIDDEN_M4MACROS $1" ;;
+ esac
+}
+
+# Usage:
+# check_m4macros
+# Checks that all the requested macro files are in the aclocal macro path
+# Uses REQUIRED_M4MACROS and ACLOCAL variables.
+check_m4macros() {
+ # construct list of macro directories
+ cm_macrodirs="`$ACLOCAL --print-ac-dir`"
+ set - $ACLOCAL_FLAGS
+ while [ $# -gt 0 ]; do
+ if [ "$1" = "-I" ]; then
+ cm_macrodirs="$cm_macrodirs $2"
+ shift
+ fi
+ shift
+ done
+
+ cm_status=0
+ if [ -n "$REQUIRED_M4MACROS" ]; then
+ printbold "Checking for required M4 macros..."
+ # check that each macro file is in one of the macro dirs
+ for cm_macro in $REQUIRED_M4MACROS; do
+ cm_macrofound=false
+ for cm_dir in $cm_macrodirs; do
+ if [ -f "$cm_dir/$cm_macro" ]; then
+ cm_macrofound=true
+ break
+ fi
+ # The macro dir in Cygwin environments may contain a file
+ # called dirlist containing other directories to look in.
+ if [ -f "$cm_dir/dirlist" ]; then
+ for cm_otherdir in `cat $cm_dir/dirlist`; do
+ if [ -f "$cm_otherdir/$cm_macro" ]; then
+ cm_macrofound=true
+ break
+ fi
+ done
+ fi
+ done
+ if $cm_macrofound; then
+ :
+ else
+ printerr " $cm_macro not found"
+ cm_status=1
+ fi
+ done
+ fi
+ if [ -n "$FORBIDDEN_M4MACROS" ]; then
+ printbold "Checking for forbidden M4 macros..."
+ # check that each macro file is in one of the macro dirs
+ for cm_macro in $FORBIDDEN_M4MACROS; do
+ cm_macrofound=false
+ for cm_dir in $cm_macrodirs; do
+ if [ -f "$cm_dir/$cm_macro" ]; then
+ cm_macrofound=true
+ break
+ fi
+ done
+ if $cm_macrofound; then
+ printerr " $cm_macro found (should be cleared from macros dir)"
+ cm_status=1
+ fi
+ done
+ fi
+ if [ "$cm_status" != 0 ]; then
+ printerr "***Error***: some autoconf macros required to build $PKG_NAME"
+ printerr " were not found in your aclocal path, or some forbidden"
+ printerr " macros were found. Perhaps you need to adjust your"
+ printerr " ACLOCAL_PATH?"
+ printerr
+ fi
+ return $cm_status
+}
+
+# try to catch the case where the macros2/ directory hasn't been cleared out.
+forbid_m4macro gnome-cxx-check.m4
+
+want_libtool=false
+want_gettext=false
+want_glib_gettext=false
+want_intltool=false
+want_pkg_config=false
+want_gtk_doc=false
+
+configure_files="`find $srcdir -name '{arch}' -prune -o -name configure.ac -print -or -name configure.in -print`"
+for configure_ac in $configure_files; do
+ if grep "^A[CM]_PROG_LIBTOOL" $configure_ac >/dev/null; then
+ want_libtool=true
+ fi
+ if grep "^AM_GNU_GETTEXT" $configure_ac >/dev/null; then
+ want_gettext=true
+ fi
+ if grep "^AM_GLIB_GNU_GETTEXT" $configure_ac >/dev/null; then
+ want_glib_gettext=true
+ fi
+ if grep "^AC_PROG_INTLTOOL" $configure_ac >/dev/null; then
+ want_intltool=true
+ fi
+ if grep "^PKG_CHECK_MODULES" $configure_ac >/dev/null; then
+ want_pkg_config=true
+ fi
+ if grep "^GTK_DOC_CHECK" $configure_ac >/dev/null; then
+ want_gtk_doc=true
+ fi
+done
+
+DIE=0
+
+#tell Mandrake autoconf wrapper we want autoconf 2.5x, not 2.13
+WANT_AUTOCONF_2_5=1
+export WANT_AUTOCONF_2_5
+version_check autoconf AUTOCONF 'autoconf2.50 autoconf autoconf-2.53' $REQUIRED_AUTOCONF_VERSION \
+ "http://ftp.gnu.org/pub/gnu/autoconf/autoconf-$REQUIRED_AUTOCONF_VERSION.tar.gz" || DIE=1
+AUTOHEADER=`echo $AUTOCONF | sed s/autoconf/autoheader/`
+
+case $REQUIRED_AUTOMAKE_VERSION in
+ 1.4*) automake_progs="automake-1.4" ;;
+ 1.5*) automake_progs="automake-1.7 automake-1.6 automake-1.5" ;;
+ 1.6*) automake_progs="automake-1.7 automake-1.6" ;;
+ 1.7*) automake_progs="automake-1.7" ;;
+ 1.8*) automake_progs="automake-1.8" ;;
+esac
+version_check automake AUTOMAKE "$automake_progs automake" $REQUIRED_AUTOMAKE_VERSION \
+ "http://ftp.gnu.org/pub/gnu/automake/automake-$REQUIRED_AUTOMAKE_VERSION.tar.gz" || DIE=1
+ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
+
+if $want_libtool; then
+ version_check libtool LIBTOOLIZE libtoolize $REQUIRED_LIBTOOL_VERSION \
+ "http://ftp.gnu.org/pub/gnu/libtool/libtool-$REQUIRED_LIBTOOL_VERSION.tar.gz" || DIE=1
+ require_m4macro libtool.m4
+fi
+
+if $want_gettext; then
+ version_check gettext GETTEXTIZE gettextize $REQUIRED_GETTEXT_VERSION \
+ "http://ftp.gnu.org/pub/gnu/gettext/gettext-$REQUIRED_GETTEXT_VERSION.tar.gz" || DIE=1
+ require_m4macro gettext.m4
+fi
+
+if $want_glib_gettext; then
+ version_check glib-gettext GLIB_GETTEXTIZE glib-gettextize $REQUIRED_GLIB_GETTEXT_VERSION \
+ "ftp://ftp.gtk.org/pub/gtk/v2.2/glib-$REQUIRED_GLIB_GETTEXT_VERSION.tar.gz" || DIE=1
+ require_m4macro glib-gettext.m4
+fi
+
+if $want_intltool; then
+ version_check intltool INTLTOOLIZE intltoolize $REQUIRED_INTLTOOL_VERSION \
+ "http://ftp.gnome.org/pub/GNOME/sources/intltool/" || DIE=1
+ require_m4macro intltool.m4
+fi
+
+if $want_pkg_config; then
+ version_check pkg-config PKG_CONFIG pkg-config $REQUIRED_PKG_CONFIG_VERSION \
+ "'http://www.freedesktop.org/software/pkgconfig/releases/pkgconfig-$REQUIRED_PKG_CONFIG_VERSION.tar.gz" || DIE=1
+ require_m4macro pkg.m4
+fi
+
+if $want_gtk_doc; then
+ version_check gtk-doc GTKDOCIZE gtkdocize $REQUIRED_GTK_DOC_VERSION \
+ "http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/" || DIE=1
+ require_m4macro gtk-doc.m4
+fi
+
+if [ "x$USE_COMMON_DOC_BUILD" = "xyes" ]; then
+ version_check gnome-common DOC_COMMON gnome-doc-common \
+ $REQUIRED_DOC_COMMON_VERSION " " || DIE=1
+fi
+
+check_m4macros || DIE=1
+
+if [ "$DIE" -eq 1 ]; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ printerr "**Warning**: I am going to run \`configure' with no arguments."
+ printerr "If you wish to pass any to it, please specify them on the"
+ printerr \`$0\'" command line."
+ printerr
+fi
+
+topdir=`pwd`
+for configure_ac in $configure_files; do
+ dirname=`dirname $configure_ac`
+ basename=`basename $configure_ac`
+ if test -f $dirname/NO-AUTO-GEN; then
+ echo skipping $dirname -- flagged as no auto-gen
+ else
+ printbold "Processing $configure_ac"
+ cd $dirname
+
+ aclocalinclude="$ACLOCAL_FLAGS"
+ printbold "Running $ACLOCAL..."
+ $ACLOCAL $aclocalinclude # || exit 1
+
+ if grep "GNOME_AUTOGEN_OBSOLETE" aclocal.m4 >/dev/null; then
+ printerr "*** obsolete gnome macros were used in $configure_ac"
+ fi
+
+ if grep "^A[CM]_PROG_LIBTOOL" $basename >/dev/null; then
+ printbold "Running $LIBTOOLIZE..."
+ $LIBTOOLIZE --force || exit 1
+ fi
+ if grep "^AM_GLIB_GNU_GETTEXT" $basename >/dev/null; then
+ printbold "Running $GLIB_GETTEXTIZE... Ignore non-fatal messages."
+ echo "no" | $GLIB_GETTEXTIZE --force --copy || exit 1
+ elif grep "^AM_GNU_GETTEXT" $basename >/dev/null; then
+ if grep "^AM_GNU_GETTEXT_VERSION" $basename > /dev/null; then
+ printbold "Running autopoint..."
+ autopoint --force || exit 1
+ else
+ printbold "Running $GETTEXTIZE... Ignore non-fatal messages."
+ echo "no" | $GETTEXTIZE --force --copy || exit 1
+ fi
+ fi
+ if grep "^AC_PROG_INTLTOOL" $basename >/dev/null; then
+ printbold "Running $INTLTOOLIZE..."
+ $INTLTOOLIZE --force --automake || exit 1
+ fi
+ if grep "^GTK_DOC_CHECK" $basename >/dev/null; then
+ printbold "Running $GTKDOCIZE..."
+ $GTKDOCIZE || exit 1
+ fi
+ if grep "^A[CM]_CONFIG_HEADER" $basename >/dev/null; then
+ printbold "Running $AUTOHEADER..."
+ $AUTOHEADER || exit 1
+ fi
+ if [ "x$USE_COMMON_DOC_BUILD" = "xyes" ]; then
+ printbold "Running gnome-doc-common..."
+ gnome-doc-common --copy || exit 1
+ fi
+
+ printbold "Running $AUTOMAKE..."
+ $AUTOMAKE --gnu --add-missing || exit 1
+
+ printbold "Running $AUTOCONF..."
+ $AUTOCONF || exit 1
+
+ cd $topdir
+ fi
+done
+
+conf_flags="--enable-maintainer-mode"
+
+#if test x$NOCONFIGURE = x; then
+# printbold Running $srcdir/configure $conf_flags "$@" ...
+# $srcdir/configure $conf_flags "$@" \
+# && echo Now type \`make\' to compile $PKG_NAME || exit 1
+#else
+# echo Skipping configure process.
+#fi
diff --git a/parts/appwizard/common/gnome2/macros/compiler-flags.m4 b/parts/appwizard/common/gnome2/macros/compiler-flags.m4
new file mode 100644
index 00000000..b2b022c0
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/compiler-flags.m4
@@ -0,0 +1,141 @@
+dnl GNOME_COMPILE_WARNINGS
+dnl Turn on many useful compiler warnings
+dnl For now, only works on GCC
+AC_DEFUN([GNOME_COMPILE_WARNINGS],[
+ dnl ******************************
+ dnl More compiler warnings
+ dnl ******************************
+
+ if test -z "$1" ; then
+ default_compile_warnings=yes
+ else
+ default_compile_warnings="$1"
+ fi
+
+ AC_ARG_ENABLE(compile-warnings,
+ [ --enable-compile-warnings=[no/minimum/yes/maximum/error] Turn on compiler warnings.],, [enable_compile_warnings="$default_compile_warnings"])
+
+ warnCFLAGS=
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+
+ warning_flags=
+ realsave_CFLAGS="$CFLAGS"
+
+ case "$enable_compile_warnings" in
+ no)
+ warning_flags=
+ ;;
+ minimum)
+ warning_flags="-Wall"
+ ;;
+ yes)
+ warning_flags="-Wall -Wmissing-prototypes"
+ ;;
+ maximum|error)
+ warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
+ CFLAGS="$warning_flags $CFLAGS"
+ for option in -Wno-sign-compare; do
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $option"
+ AC_MSG_CHECKING([whether gcc understands $option])
+ AC_TRY_COMPILE([], [],
+ has_option=yes,
+ has_option=no,)
+ CFLAGS="$SAVE_CFLAGS"
+ AC_MSG_RESULT($has_option)
+ if test $has_option = yes; then
+ warning_flags="$warning_flags $option"
+ fi
+ unset has_option
+ unset SAVE_CFLAGS
+ done
+ unset option
+ if test "$enable_compile_warnings" = "error" ; then
+ warning_flags="$warning_flags -Werror"
+ fi
+ ;;
+ *)
+ AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
+ ;;
+ esac
+ CFLAGS="$realsave_CFLAGS"
+ AC_MSG_CHECKING(what warning flags to pass to the C compiler)
+ AC_MSG_RESULT($warning_flags)
+
+ AC_ARG_ENABLE(iso-c,
+ [ --enable-iso-c Try to warn if code is not ISO C ],,
+ enable_iso_c=no)
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
+ complCFLAGS=
+ if test "x$enable_iso_c" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -ansi" ;;
+ esac
+ case " $CFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCFLAGS="$complCFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCFLAGS)
+
+ WARN_CFLAGS="$warning_flags $complCFLAGS"
+ AC_SUBST(WARN_CFLAGS)
+])
+
+dnl For C++, do basically the same thing.
+
+AC_DEFUN([GNOME_CXX_WARNINGS],[
+ AC_ARG_ENABLE(cxx-warnings,
+ [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum)
+
+ AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
+ warnCXXFLAGS=
+ if test "x$GCC" != xyes; then
+ enable_compile_warnings=no
+ fi
+ if test "x$enable_cxx_warnings" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-Wall[\ \ ]*) ;;
+ *) warnCXXFLAGS="-Wall -Wno-unused" ;;
+ esac
+
+ ## -W is not all that useful. And it cannot be controlled
+ ## with individual -Wno-xxx flags, unlike -Wall
+ if test "x$enable_cxx_warnings" = "xyes"; then
+ warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
+ fi
+ fi
+ fi
+ AC_MSG_RESULT($warnCXXFLAGS)
+
+ AC_ARG_ENABLE(iso-cxx,
+ [ --enable-iso-cxx Try to warn if code is not ISO C++ ],,
+ enable_iso_cxx=no)
+
+ AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
+ complCXXFLAGS=
+ if test "x$enable_iso_cxx" != "xno"; then
+ if test "x$GCC" = "xyes"; then
+ case " $CXXFLAGS " in
+ *[\ \ ]-ansi[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
+ esac
+
+ case " $CXXFLAGS " in
+ *[\ \ ]-pedantic[\ \ ]*) ;;
+ *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
+ esac
+ fi
+ fi
+ AC_MSG_RESULT($complCXXFLAGS)
+
+ WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
+ AC_SUBST(WARN_CXXFLAGS)
+])
diff --git a/parts/appwizard/common/gnome2/macros/curses.m4 b/parts/appwizard/common/gnome2/macros/curses.m4
new file mode 100644
index 00000000..5307e13d
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/curses.m4
@@ -0,0 +1,318 @@
+dnl Curses detection: Munged from Midnight Commander's configure.in
+dnl
+dnl What it does:
+dnl =============
+dnl
+dnl - Determine which version of curses is installed on your system
+dnl and set the -I/-L/-l compiler entries and add a few preprocessor
+dnl symbols
+dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
+dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
+dnl Makefile.in's
+dnl - Modify the following configure variables (these are the only
+dnl curses.m4 variables you can access from within configure.in)
+dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
+dnl an ncurses.h that's been renamed to curses.h
+dnl is found.
+dnl CURSES_LIBS - sets -L and -l's appropriately
+dnl CFLAGS - if --with-sco, add -D_SVID3
+dnl has_curses - exports result of tests to rest of configure
+dnl
+dnl Usage:
+dnl ======
+dnl 1) Add lines indicated below to acconfig.h
+dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
+dnl 3) Instead of #include <curses.h> you should use the following to
+dnl properly locate ncurses or curses header file
+dnl
+dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
+dnl #include <ncurses.h>
+dnl #else
+dnl #include <curses.h>
+dnl #endif
+dnl
+dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
+dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
+dnl
+dnl Notes with automake:
+dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
+dnl configure.in
+dnl - your Makefile.am can look something like this
+dnl -----------------------------------------------
+dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
+dnl if HAS_CURSES
+dnl CURSES_TARGETS=name_of_curses_prog
+dnl endif
+dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
+dnl other_programs_SOURCES = blah blah blah
+dnl name_of_curses_prog_SOURCES = blah blah blah
+dnl other_programs_LDADD = blah
+dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
+dnl -----------------------------------------------
+dnl
+dnl
+dnl The following lines should be added to acconfig.h:
+dnl ==================================================
+dnl
+dnl /*=== Curses version detection defines ===*/
+dnl /* Found some version of curses that we're going to use */
+dnl #undef HAS_CURSES
+dnl
+dnl /* Use SunOS SysV curses? */
+dnl #undef USE_SUNOS_CURSES
+dnl
+dnl /* Use old BSD curses - not used right now */
+dnl #undef USE_BSD_CURSES
+dnl
+dnl /* Use SystemV curses? */
+dnl #undef USE_SYSV_CURSES
+dnl
+dnl /* Use Ncurses? */
+dnl #undef USE_NCURSES
+dnl
+dnl /* If you Curses does not have color define this one */
+dnl #undef NO_COLOR_CURSES
+dnl
+dnl /* Define if you want to turn on SCO-specific code */
+dnl #undef SCO_FLAVOR
+dnl
+dnl /* Set to reflect version of ncurses *
+dnl * 0 = version 1.*
+dnl * 1 = version 1.9.9g
+dnl * 2 = version 4.0/4.1 */
+dnl #undef NCURSES_970530
+dnl
+dnl /*=== End new stuff for acconfig.h ===*/
+dnl
+
+
+AC_DEFUN([AC_CHECK_CURSES],[
+ search_ncurses=true
+ screen_manager=""
+ has_curses=false
+
+ CFLAGS=${CFLAGS--O}
+
+ AC_SUBST(CURSES_LIBS)
+ AC_SUBST(CURSES_INCLUDEDIR)
+
+ AC_ARG_WITH(sco,
+ [ --with-sco Use this to turn on SCO-specific code],[
+ if test x$withval = xyes; then
+ AC_DEFINE(SCO_FLAVOR)
+ CFLAGS="$CFLAGS -D_SVID3"
+ fi
+ ])
+
+ AC_ARG_WITH(sunos-curses,
+ [ --with-sunos-curses Used to force SunOS 4.x curses],[
+ if test x$withval = xyes; then
+ AC_USE_SUNOS_CURSES
+ fi
+ ])
+
+ AC_ARG_WITH(osf1-curses,
+ [ --with-osf1-curses Used to force OSF/1 curses],[
+ if test x$withval = xyes; then
+ AC_USE_OSF1_CURSES
+ fi
+ ])
+
+ AC_ARG_WITH(vcurses,
+ [ --with-vcurses[=incdir] Used to force SysV curses],
+ if test x$withval != xyes; then
+ CURSES_INCLUDEDIR="-I$withval"
+ fi
+ AC_USE_SYSV_CURSES
+ )
+
+ AC_ARG_WITH(ncurses,
+ [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
+ if test x$withval = xno ; then
+ search_ncurses=false
+ elif test x$withval != xyes ; then
+ CURSES_LIBS="$LIBS -L$withval/lib -lncurses"
+ CURSES_INCLUDEDIR="-I$withval/include"
+ search_ncurses=false
+ screen_manager="ncurses"
+ AC_DEFINE(USE_NCURSES)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ fi
+ )
+
+ if $search_ncurses
+ then
+ AC_SEARCH_NCURSES()
+ fi
+
+
+])
+
+
+AC_DEFUN([AC_USE_SUNOS_CURSES], [
+ search_ncurses=false
+ screen_manager="SunOS 4.x /usr/5include curses"
+ AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
+ AC_DEFINE(USE_SUNOS_CURSES)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(NO_COLOR_CURSES)
+ AC_DEFINE(USE_SYSV_CURSES)
+ CURSES_INCLUDEDIR="-I/usr/5include"
+ CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
+ AC_MSG_RESULT(Please note that some screen refreshs may fail)
+])
+
+AC_DEFUN([AC_USE_OSF1_CURSES], [
+ AC_MSG_RESULT(Using OSF1 curses)
+ search_ncurses=false
+ screen_manager="OSF1 curses"
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(NO_COLOR_CURSES)
+ AC_DEFINE(USE_SYSV_CURSES)
+ CURSES_LIBS="-lcurses"
+])
+
+AC_DEFUN([AC_USE_SYSV_CURSES], [
+ AC_MSG_RESULT(Using SysV curses)
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_SYSV_CURSES)
+ search_ncurses=false
+ screen_manager="SysV/curses"
+ CURSES_LIBS="-lcurses"
+])
+
+dnl AC_ARG_WITH(bsd-curses,
+dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
+dnl search_ncurses=false
+dnl screen_manager="Ultrix/cursesX"
+dnl if test $system = ULTRIX
+dnl then
+dnl THIS_CURSES=cursesX
+dnl else
+dnl THIS_CURSES=curses
+dnl fi
+dnl
+dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
+dnl AC_DEFINE(HAS_CURSES)
+dnl has_curses=true
+dnl AC_DEFINE(USE_BSD_CURSES)
+dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
+dnl AC_MSG_WARN(Use of the bsdcurses extension has some)
+dnl AC_MSG_WARN(display/input problems.)
+dnl AC_MSG_WARN(Reconsider using xcurses)
+dnl)
+
+
+dnl
+dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
+dnl
+AC_DEFUN([AC_NCURSES], [
+ if $search_ncurses
+ then
+ if test -f $1/$2
+ then
+ AC_MSG_RESULT(Found ncurses on $1/$2)
+ CURSES_LIBS="$3"
+ CURSES_INCLUDEDIR="$4"
+ search_ncurses=false
+ screen_manager=$5
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_NCURSES)
+ fi
+ fi
+])
+
+AC_DEFUN([AC_SEARCH_NCURSES], [
+ AC_CHECKING("location of ncurses.h file")
+
+ AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
+ AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
+ AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
+ AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
+
+ AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
+
+ AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
+
+ dnl
+ dnl We couldn't find ncurses, try SysV curses
+ dnl
+ if $search_ncurses
+ then
+ AC_EGREP_HEADER(init_color, /usr/include/curses.h,
+ AC_USE_SYSV_CURSES)
+ AC_EGREP_CPP(USE_NCURSES,[
+#include <curses.h>
+#ifdef __NCURSES_H
+#undef USE_NCURSES
+USE_NCURSES
+#endif
+],[
+ CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
+ AC_DEFINE(HAS_CURSES)
+ has_curses=true
+ AC_DEFINE(USE_NCURSES)
+ search_ncurses=false
+ screen_manager="ncurses installed as curses"
+])
+ fi
+
+ dnl
+ dnl Try SunOS 4.x /usr/5{lib,include} ncurses
+ dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
+ dnl should be replaced by a more fine grained selection routine
+ dnl
+ if $search_ncurses
+ then
+ if test -f /usr/5include/curses.h
+ then
+ AC_USE_SUNOS_CURSES
+ fi
+ else
+ # check for ncurses version, to properly ifdef mouse-fix
+ AC_MSG_CHECKING(for ncurses version)
+ ncurses_version=unknown
+cat > conftest.$ac_ext <<EOF
+[#]line __oline__ "configure"
+#include "confdefs.h"
+#ifdef RENAMED_NCURSES
+#include <curses.h>
+#else
+#include <ncurses.h>
+#endif
+#undef VERSION
+VERSION:NCURSES_VERSION
+EOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
+ egrep "VERSION:" >conftest.out 2>&1; then
+changequote(,)dnl
+ ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
+changequote([,])dnl
+ fi
+ rm -rf conftest*
+ AC_MSG_RESULT($ncurses_version)
+ case "$ncurses_version" in
+changequote(,)dnl
+ 4.[01])
+changequote([,])dnl
+ AC_DEFINE(NCURSES_970530,2)
+ ;;
+ 1.9.9g)
+ AC_DEFINE(NCURSES_970530,1)
+ ;;
+ 1*)
+ AC_DEFINE(NCURSES_970530,0)
+ ;;
+ esac
+ fi
+])
+
+
+
+
+
diff --git a/parts/appwizard/common/gnome2/macros/gnome-common.m4 b/parts/appwizard/common/gnome2/macros/gnome-common.m4
new file mode 100644
index 00000000..20302d1f
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/gnome-common.m4
@@ -0,0 +1,30 @@
+# gnome-common.m4
+#
+
+dnl GNOME_COMMON_INIT
+
+AC_DEFUN([GNOME_COMMON_INIT],
+[
+ AC_CACHE_VAL(ac_cv_gnome_aclocal_dir,
+ [ac_cv_gnome_aclocal_dir="$GNOME_COMMON_MACROS_DIR"])
+ AC_CACHE_VAL(ac_cv_gnome_aclocal_flags,
+ [ac_cv_gnome_aclocal_flags="$ACLOCAL_FLAGS"])
+ GNOME_ACLOCAL_DIR="$ac_cv_gnome_aclocal_dir"
+ GNOME_ACLOCAL_FLAGS="$ac_cv_gnome_aclocal_flags"
+ AC_SUBST(GNOME_ACLOCAL_DIR)
+ AC_SUBST(GNOME_ACLOCAL_FLAGS)
+
+ ACLOCAL="$ACLOCAL $GNOME_ACLOCAL_FLAGS"
+
+ AM_CONDITIONAL(INSIDE_GNOME_DOCU, false)
+])
+
+AC_DEFUN([GNOME_DEBUG_CHECK],
+[
+ AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]], enable_debug="$enableval", enable_debug=no)
+
+ if test x$enable_debug = xyes ; then
+ AC_DEFINE(GNOME_ENABLE_DEBUG,1,
+ [Enable additional debugging at the expense of performance and size])
+ fi
+])
diff --git a/parts/appwizard/common/gnome2/macros/gnome-deprecated-macros.m4 b/parts/appwizard/common/gnome2/macros/gnome-deprecated-macros.m4
new file mode 100644
index 00000000..b27ba528
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/gnome-deprecated-macros.m4
@@ -0,0 +1,32 @@
+-*- mode: autoconf -*-
+
+# GNOME_AUTOGEN_OBSOLETE
+# this marker is checked for in the aclocal.m4 file to check for bad macros ...
+
+AU_DEFUN([AM_GNOME2_GETTEXT], [AM_GLIB_GNU_GETTEXT])
+AU_DEFUN([GNOME_GTKDOC_CHECK], [GTK_DOC_CHECK])
+AU_DEFUN([GNOME2_X_CHECKS], [])
+AU_DEFUN([GNOME_PTHREAD_CHECK], [])
+AU_DEFUN([GNOME_CHECK_PKGCONFIG], [])
+AU_DEFUN([GNOME_REQUIRE_PKGCONFIG], [])
+AU_DEFUN([GNOME_PLATFORM_GNOME_2], [])
+
+AU_DEFUN([GNOME_CHECK_CXX],
+[
+ # see if a C++ compiler exists and works
+ AC_PROG_CXX
+ if test "x$ac_cv_prog_cxx_works" = xno; then
+ AC_MSG_WARN(ifelse([$1], , "No C++ compiler", [$1]))
+ fi
+ AM_CONDITIONAL(CXX_PRESENT, test "x$ac_cv_prog_cxx_works" != xno)
+])
+
+# for aclocal-1.4's benefit
+# AC_DEFUN([AM_GNOME2_GETTEXT], [])
+# AC_DEFUN([GNOME_GTKDOC_CHECK], [])
+# AC_DEFUN([GNOME2_X_CHECKS], [])
+# AC_DEFUN([GNOME_PTHREAD_CHECK], [])
+# AC_DEFUN([GNOME_CHECK_PKGCONFIG], [])
+# AC_DEFUN([GNOME_REQUIRE_PKGCONFIG], [])
+# AC_DEFUN([GNOME_PLATFORM_GNOME_2], [])
+# AC_DEFUN([GNOME_CHECK_CXX], [])
diff --git a/parts/appwizard/common/gnome2/macros/gnome2-macros.dep b/parts/appwizard/common/gnome2/macros/gnome2-macros.dep
new file mode 100644
index 00000000..89233770
--- /dev/null
+++ b/parts/appwizard/common/gnome2/macros/gnome2-macros.dep
@@ -0,0 +1 @@
+$(top_srcdir)/aclocal.m4: /opt/gnome/share/aclocal/gnome2-macros/compiler-flags.m4 /opt/gnome/share/aclocal/gnome2-macros/curses.m4 /opt/gnome/share/aclocal/gnome2-macros/gnome-common.m4 /opt/gnome/share/aclocal/gnome2-macros/gnome-deprecated-macros.m4
diff --git a/parts/appwizard/common/gnu.kdevtemplate b/parts/appwizard/common/gnu.kdevtemplate
new file mode 100644
index 00000000..29e75291
--- /dev/null
+++ b/parts/appwizard/common/gnu.kdevtemplate
@@ -0,0 +1,5 @@
+[GNU]
+Type=install archive
+Source=%{kdevelop}/template-common/gnu.tar.gz
+Dest=%{dest}
+
diff --git a/parts/appwizard/common/gnu/AUTHORS b/parts/appwizard/common/gnu/AUTHORS
new file mode 100644
index 00000000..09a8c466
--- /dev/null
+++ b/parts/appwizard/common/gnu/AUTHORS
@@ -0,0 +1 @@
+%{AUTHOR} <%{EMAIL}>
diff --git a/parts/appwizard/common/gnu/COPYING b/parts/appwizard/common/gnu/COPYING
new file mode 100644
index 00000000..5b6e7c66
--- /dev/null
+++ b/parts/appwizard/common/gnu/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/parts/appwizard/common/gnu/ChangeLog b/parts/appwizard/common/gnu/ChangeLog
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/parts/appwizard/common/gnu/ChangeLog
diff --git a/parts/appwizard/common/gnu/INSTALL b/parts/appwizard/common/gnu/INSTALL
new file mode 100644
index 00000000..02a4a074
--- /dev/null
+++ b/parts/appwizard/common/gnu/INSTALL
@@ -0,0 +1,167 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/parts/appwizard/common/gnu/NEWS b/parts/appwizard/common/gnu/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/parts/appwizard/common/gnu/NEWS
diff --git a/parts/appwizard/common/gnu/README b/parts/appwizard/common/gnu/README
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/parts/appwizard/common/gnu/README
diff --git a/parts/appwizard/common/gnu/TODO b/parts/appwizard/common/gnu/TODO
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/parts/appwizard/common/gnu/TODO
diff --git a/parts/appwizard/common/hi16-app-app.png b/parts/appwizard/common/hi16-app-app.png
new file mode 100644
index 00000000..4ed606c1
--- /dev/null
+++ b/parts/appwizard/common/hi16-app-app.png
Binary files differ
diff --git a/parts/appwizard/common/hi32-app-app.png b/parts/appwizard/common/hi32-app-app.png
new file mode 100644
index 00000000..45ae1a11
--- /dev/null
+++ b/parts/appwizard/common/hi32-app-app.png
Binary files differ
diff --git a/parts/appwizard/common/incadmin.kdevtemplate b/parts/appwizard/common/incadmin.kdevtemplate
new file mode 100644
index 00000000..c94c2be5
--- /dev/null
+++ b/parts/appwizard/common/incadmin.kdevtemplate
@@ -0,0 +1,5 @@
+[INCADMIN]
+Type=install archive
+Source=%{kdevelop}/template-common/incadmin.tar.gz
+Dest=%{dest}
+Process=false
diff --git a/parts/appwizard/common/incadmin/config.guess b/parts/appwizard/common/incadmin/config.guess
new file mode 100755
index 00000000..5145e357
--- /dev/null
+++ b/parts/appwizard/common/incadmin/config.guess
@@ -0,0 +1,1363 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-10-21'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# This shell variable is my proudest work .. or something. --bje
+
+set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
+(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
+ || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
+dummy=$tmpdir/dummy ;
+files="$dummy.c $dummy.o $dummy.rel $dummy" ;
+trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ rm -f $files ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ;
+unset files'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ eval $set_cc_for_build
+ cat <<EOF >$dummy.s
+ .data
+\$Lformat:
+ .byte 37,100,45,37,120,10,0 # "%d-%x\n"
+
+ .text
+ .globl main
+ .align 4
+ .ent main
+main:
+ .frame \$30,16,\$26,0
+ ldgp \$29,0(\$27)
+ .prologue 1
+ .long 0x47e03d80 # implver \$0
+ lda \$2,-1
+ .long 0x47e20c21 # amask \$2,\$1
+ lda \$16,\$Lformat
+ mov \$0,\$17
+ not \$1,\$18
+ jsr \$26,printf
+ ldgp \$29,0(\$26)
+ mov 0,\$16
+ jsr \$26,exit
+ .end main
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
+ if test "$?" = 0 ; then
+ case `$dummy` in
+ 0-0)
+ UNAME_MACHINE="alpha"
+ ;;
+ 1-0)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 1-1)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 1-101)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 2-303)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ 2-307)
+ UNAME_MACHINE="alphaev67"
+ ;;
+ 2-1307)
+ UNAME_MACHINE="alphaev68"
+ ;;
+ 3-1307)
+ UNAME_MACHINE="alphaev7"
+ ;;
+ esac
+ fi
+ rm -f $dummy.s $dummy && rmdir $tmpdir
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ rm -f $dummy.c $dummy && rmdir $tmpdir
+ fi ;;
+ esac
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+ rm -f $dummy.c $dummy && rmdir $tmpdir
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3D:*:*:*)
+ echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ rm -f $dummy.c && rmdir $tmpdir
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:3*)
+ echo i386-pc-interix3
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i386-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ rm -f $dummy.c && rmdir $tmpdir
+ test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit 0 ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ rm -f $dummy.c && rmdir $tmpdir
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit 0 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+rm -f $dummy.c $dummy && rmdir $tmpdir
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/parts/appwizard/common/incadmin/config.sub b/parts/appwizard/common/incadmin/config.sub
new file mode 100755
index 00000000..1dea9b79
--- /dev/null
+++ b/parts/appwizard/common/incadmin/config.sub
@@ -0,0 +1,1470 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002 Free Software Foundation, Inc.
+
+timestamp='2002-09-05'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39 | mipstx39el \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+ basic_machine=i686-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3d)
+ basic_machine=alpha-cray
+ os=-unicos
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic4x | c4x*)
+ basic_machine=tic4x-unknown
+ os=-coff
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ windows32)
+ basic_machine=i386-pc
+ os=-windows32-msvcrt
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto*)
+ os=-nto-qnx
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/parts/appwizard/common/incadmin/depcomp b/parts/appwizard/common/incadmin/depcomp
new file mode 100755
index 00000000..4c20c6c9
--- /dev/null
+++ b/parts/appwizard/common/incadmin/depcomp
@@ -0,0 +1,441 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. This file always lives in the current directory.
+ # Also, the AIX compiler puts `$object:' at the start of each line;
+ # $object doesn't have directory information.
+ stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ outname="$stripped.o"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Must come before tru64.
+
+ # Intel's C compiler understands `-MD -MF file'. However
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 AIX compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+
+ tmpdepfile1="$object.d"
+ tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
+ if test "$libtool" = yes; then
+ "$@" -Wc,-MD
+ else
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile1"; then
+ tmpdepfile="$tmpdepfile1"
+ else
+ tmpdepfile="$tmpdepfile2"
+ fi
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a space and a tab in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ test -z "$dashmflag" && dashmflag=-M
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*) # this is libtool, let us make it quiet
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ # X makedepend
+ (
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in no)
+ set ""; shift
+ cleared=yes
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case $arg in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/parts/appwizard/common/incadmin/install-sh b/parts/appwizard/common/incadmin/install-sh
new file mode 100755
index 00000000..36f96f3e
--- /dev/null
+++ b/parts/appwizard/common/incadmin/install-sh
@@ -0,0 +1,276 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "$0: no input file specified" >&2
+ exit 1
+else
+ :
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d "$dst" ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f "$src" ] || [ -d "$src" ]
+ then
+ :
+ else
+ echo "$0: $src does not exist" >&2
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "$0: no destination specified" >&2
+ exit 1
+ else
+ :
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d "$dst" ]
+ then
+ dst=$dst/`basename "$src"`
+ else
+ :
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
+
+oIFS=$IFS
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp=$pathcomp$1
+ shift
+
+ if [ ! -d "$pathcomp" ] ;
+ then
+ $mkdirprog "$pathcomp"
+ else
+ :
+ fi
+
+ pathcomp=$pathcomp/
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd "$dst" &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ :
+ fi
+
+# Make a couple of temp file names in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
+
+# Trap to clean up temp files at exit.
+
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd "$src" "$dsttmp" &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
+
+# Now rename the file to the real destination.
+
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+
+{
+ (exit 0); exit
+}
diff --git a/parts/appwizard/common/incadmin/ltmain.sh b/parts/appwizard/common/incadmin/ltmain.sh
new file mode 100644
index 00000000..b36e997f
--- /dev/null
+++ b/parts/appwizard/common/incadmin/ltmain.sh
@@ -0,0 +1,6343 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5a
+TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS=" "}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+ if test "X$win32_nmres" = "Ximport" ; then
+ win32_libid_type="x86 archive import"
+ else
+ win32_libid_type="x86 archive static"
+ fi
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
+
+ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo
+ $echo "Copyright (C) 2003 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit 0
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+ done
+ exit 0
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ ;;
+
+ --tag) prevopt="--tag" prev=tag ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_output=
+ arg_mode=normal
+ libobj=
+
+ for arg
+ do
+ case "$arg_mode" in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit 1
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base compile
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case "$base_compile " in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit 1" 1 2 15
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $run ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+ $echo $srcfile > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $srcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ else
+ command="$base_compile $srcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args="$nonopt"
+ base_compile="$nonopt"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ add_flags=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ prefer_static_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ base_compile="$base_compile $arg"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit 1
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit 1
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-pw32* | *-*-beos*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-freebsd*-gnu*)
+ # prevent being parsed by the freebsd regexp below
+ ;;
+ *-*-mingw* | *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-freebsd*-gnu*)
+ # prevent being parsed by the freebsd regexp below
+ ;;
+ *-*-openbsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # gcc -m* arguments should be passed to the linker via $compiler_flags
+ # in order to pass architecture information to the linker
+ # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
+ # but this is not reliable with gcc because gcc may use -mfoo to
+ # select a different linker, different libraries, etc, while
+ # -Wl,-mfoo simply passes -mfoo to the linker.
+ -m*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ if test "$with_gcc" = "yes" ; then
+ compiler_flags="$compiler_flags $arg"
+ fi
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # in order for the loader to find any dlls it needs.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ add_flags="$add_flags $arg"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ add_flags="$add_flags $arg"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done # argument parsing loop
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base link
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case $base_compile in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in $compile_command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $status
+ fi
+ fi
+
+ # Determine the type of output
+ case $output in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplcations in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+ case $linkmode in
+ lib)
+ passes="conv link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+ for pass in $passes; do
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+ if test "$pass" = conv && test "$allow_undefined" = yes; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ for search_ext in .la $shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+
+ # Read the .la file
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ #echo "Adding $deplib to \$deplibs"
+ deplibs="$deplib $deplibs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi # $installed = yes
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw*)
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$extract_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$old_archive_from_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against it, someone
+ # is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ convenience="$convenience $dir/$old_library"
+ old_convenience="$old_convenience $dir/$old_library"
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ #if test -n "$dependency_libs" &&
+ # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+ # test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ #fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ if test "$absdir" != "$libdir"; then
+ # Sure, some shells/systems don't implement the -ef.
+ # Those will have to live with the warning.
+ test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs, but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ path=""
+ fi
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$deplibs $depdepl" ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$deplibs $path" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit 1
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor - 1`
+ age="$number_minor"
+ revision="$number_minor"
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $revision in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $age in
+ 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ minor_current=`expr $current + 1`
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ irix | nonstopux)
+ major=`expr $current - $age + 1`
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+ fi
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ for path in $notinst_path; do
+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+ deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+ done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs -framework System"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-freebsd*-gnu*)
+ # Prevent $arg from being parsed by the freebsd regexp below.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ $LTCC -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" -ne "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ $LTCC -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Add all flags from the command line. We here create a library,
+ # but those flags were only added to compile_command and
+ # finalize_command, which are only used when creating executables.
+ # So do it by hand here.
+ compiler_flags="$compiler_flags $add_flags"
+ # Only add it to commands which use CC, instead of LD, i.e.
+ # only to $compiler_flags
+ #linker_flags="$linker_flags $add_flags"
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval cmds=\"$module_expsym_cmds\"
+ else
+ eval cmds=\"$module_cmds\"
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$save_output-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$save_output-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$save_output-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadale object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~$rm $delfiles\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+ exit 0
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case $output in
+ *.lo)
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
+ # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
+ # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
+ # This does not apply on AIX for ia64, which uses a SysV linker.
+ case "$host" in
+ ia64-*-aix5*) ;;
+ *-*-aix4* | *-*-aix5*)
+ compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
+ finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
+ esac
+
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $run $rm $output
+ # Link the executable and exit
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+ exit 0
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+ case $0 in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ cwrappersource=`$echo ${objdir}/lt-${output}.c`
+ cwrapper=`$echo ${output}.exe`
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup ((char *) basename (argv[0]));
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = "$SHELL";
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = fnqualify(argv[0]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+EOF
+
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha (name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+ size_t size;
+ char *p;
+ char tmp[LT_PATHMAX + 1];
+
+ assert(path != NULL);
+
+ /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha (path[0]) && path[1] == ':')
+ return xstrdup (path);
+#endif
+ if (IS_DIR_SEPARATOR (path[0]))
+ return xstrdup (path);
+
+ /* prepend the current directory */
+ /* doesn't handle '~' */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+ p = XMALLOC(char, size);
+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+ return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \$progdir/\$program \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+
+ compiler_flags="$compiler_flags $add_flags"
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+ # encoded into archives. This makes 'ar r' malfunction in
+ # this piecewise linking case whenever conflicting object
+ # names appear in distinct ar calls; check, warn and compensate.
+ if (for obj in $save_oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+ $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+ AR_FLAGS=cq
+ fi
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $rm $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
+ $echo >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit 1
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit 1
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $0 --finish$current_libdirs'
+ else
+ exit 0
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ exit 0
+
+ $echo "----------------------------------------------------------------------"
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "----------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+ if test "$mode" = uninstall; then
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
+ fi
+ done
+
+ exit $exit_status
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit 1
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit 0
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/parts/appwizard/common/incadmin/missing b/parts/appwizard/common/incadmin/missing
new file mode 100755
index 00000000..6a37006e
--- /dev/null
+++ b/parts/appwizard/common/incadmin/missing
@@ -0,0 +1,336 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing 0.4 - GNU automake"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/parts/appwizard/common/incadmin/mkinstalldirs b/parts/appwizard/common/incadmin/mkinstalldirs
new file mode 100755
index 00000000..d2d5f21b
--- /dev/null
+++ b/parts/appwizard/common/incadmin/mkinstalldirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage" 1>&2
+ exit 0
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+case $dirmode in
+ '')
+ if mkdir -p -- . 2>/dev/null; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ fi
+ ;;
+esac
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=""
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here
diff --git a/parts/appwizard/common/kde-Makefile.am b/parts/appwizard/common/kde-Makefile.am
new file mode 100644
index 00000000..06057100
--- /dev/null
+++ b/parts/appwizard/common/kde-Makefile.am
@@ -0,0 +1,22 @@
+SUBDIRS = $(TOPSUBDIRS)
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+ cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+ cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+ @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
+
+package-messages:
+ cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
+ $(MAKE) -C po merge
+
+EXTRA_DIST = admin %{LICENSEFILE} configure.in.in
+
+dist-hook:
+ cd $(top_distdir) && perl admin/am_edit -padmin
+ cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
diff --git a/parts/appwizard/common/kde-Makefile.cvs b/parts/appwizard/common/kde-Makefile.cvs
new file mode 100644
index 00000000..4c0afd1a
--- /dev/null
+++ b/parts/appwizard/common/kde-Makefile.cvs
@@ -0,0 +1,10 @@
+all:
+ @echo "This Makefile is only for the CVS repository"
+ @echo "This will be deleted before making the distribution"
+ @echo ""
+ $(MAKE) -f admin/Makefile.common cvs
+
+dist:
+ $(MAKE) -f admin/Makefile.common dist
+
+.SILENT:
diff --git a/parts/appwizard/common/kde-app.desktop b/parts/appwizard/common/kde-app.desktop
new file mode 100644
index 00000000..7389904a
--- /dev/null
+++ b/parts/appwizard/common/kde-app.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Name=%{APPNAME}
+Exec=%{APPNAMELC} %i -caption "%c"
+Icon=%{APPNAMELC}
+Type=Application
+X-DocPath=%{APPNAMELC}/%{APPNAMELC}.html
+Comment=A KDE KPart Application
+Comment[br]=Ur meziant Kpart evit KDE
+Comment[ca]=Una aplicació KPart per al KDE
+Comment[cy]=Cymhwysiad KPart KDE
+Comment[da]=Et KDE KPart-program
+Comment[de]=Eine auf der Komponententechnik KPart basierende KDE-Anwendung
+Comment[el]=Μια εφαρμογή KPart του KDE
+Comment[es]=Una aplicación KPart de KDE
+Comment[et]=KDE KPart rakendus
+Comment[eu]=KDE KPart aplikazio bat
+Comment[fa]=یک کاربرد KDE KPart
+Comment[fr]=Une application KPart pour KDE
+Comment[ga]=Feidhmchlár KPart KDE
+Comment[gl]=Unha aplicación KPart de KDE
+Comment[hi]=एक केडीई के-पार्ट अनुप्रयोग
+Comment[hu]=KPart-alapú KDE-alkalmazás
+Comment[is]=KDE KPart forrit
+Comment[it]=Applicazione KPart di KDE
+Comment[ja]=KDE KPart アプリケーション
+Comment[lt]=KDE KPart programa
+Comment[nds]=En KPart-Deelprogramm för KDE
+Comment[ne]=एउटा केडीई KPart अनुप्रयोग
+Comment[nl]=Een KDE KPart-toepassing
+Comment[pl]=Osadzalny element KPart KDE
+Comment[pt]=Uma Aplicação KPart do KDE
+Comment[pt_BR]=Um Aplicativo KPart do KDE
+Comment[ru]=Приложение KPart для KDE
+Comment[sk]=KDE KPart aplikácia
+Comment[sl]=Program KPart za KDE
+Comment[sr]=KDE KPart програм
+Comment[sr@Latn]=KDE KPart program
+Comment[sv]=Ett KDE Kpart-program
+Comment[ta]=கெடி கெபார்ட் பயன்பாடு
+Comment[tg]=Ба кор андохтани KPart барои KDE
+Comment[tr]=Bir KDE KPart Uygulaması
+Comment[zh_CN]=一个 KDE KPart 应用程序
+Comment[zh_TW]=KDE KPart 應用程式
+Terminal=false
diff --git a/parts/appwizard/common/kde-app.lsm b/parts/appwizard/common/kde-app.lsm
new file mode 100644
index 00000000..54a725e6
--- /dev/null
+++ b/parts/appwizard/common/kde-app.lsm
@@ -0,0 +1,16 @@
+Begin3
+Title: %{APPNAME} -- Some description
+Version: %{VERSION}
+Entered-date:
+Description:
+Keywords: KDE Qt
+Author: %{AUTHOR} <%{EMAIL}>
+Maintained-by: %{AUTHOR} <%{EMAIL}>
+Home-page:
+Alternate-site:
+Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils
+ xxxxxx %{APPNAMELC}-%{VERSION}.tar.gz
+ xxx %{APPNAMELC}-%{VERSION}.lsm
+Platform: Linux. Needs KDE
+Copying-policy: %{LICENSE}
+End
diff --git a/parts/appwizard/common/kde-configure.in.in b/parts/appwizard/common/kde-configure.in.in
new file mode 100644
index 00000000..f1244521
--- /dev/null
+++ b/parts/appwizard/common/kde-configure.in.in
@@ -0,0 +1,6 @@
+#MIN_CONFIG(3.2.0)
+
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+AC_C_BIGENDIAN
+AC_CHECK_KDEMAXPATHLEN
+
diff --git a/parts/appwizard/common/kde-doc-Makefile.am b/parts/appwizard/common/kde-doc-Makefile.am
new file mode 100644
index 00000000..a1f777a1
--- /dev/null
+++ b/parts/appwizard/common/kde-doc-Makefile.am
@@ -0,0 +1,6 @@
+# the SUBDIRS is filled automatically by am_edit. If files are
+# in this directory they are installed into the english dir
+
+KDE_LANG = en
+KDE_DOCS = %{APPNAMELC}
+SUBDIRS = $(AUTODIRS)
diff --git a/parts/appwizard/common/kde-doc-en-Makefile.am b/parts/appwizard/common/kde-doc-en-Makefile.am
new file mode 100644
index 00000000..bdd63b79
--- /dev/null
+++ b/parts/appwizard/common/kde-doc-en-Makefile.am
@@ -0,0 +1,2 @@
+KDE_DOCS = %{APPNAMELC}
+KDE_LANG = en
diff --git a/parts/appwizard/common/kde-index.docbook b/parts/appwizard/common/kde-index.docbook
new file mode 100644
index 00000000..036d8dba
--- /dev/null
+++ b/parts/appwizard/common/kde-index.docbook
@@ -0,0 +1,555 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
+ <!ENTITY %{APPNAMELC} "<application>%{APPNAME} %{VERSION}</application>">
+ <!ENTITY kappname "&%{APPNAMELC};"><!-- Do *not* replace kappname-->
+ <!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
+ <!ENTITY % addindex "IGNORE">
+ <!ENTITY % English "INCLUDE"><!-- change language only here -->
+
+
+ <!-- Do not define any other entities; instead, use the entities
+ from kde-genent.entities and $LANG/user.entities. -->
+]>
+<!-- kdoctemplate v0.8 October 1 1999
+ Minor update to "Credits and Licenses" section on August 24, 2000
+ Removed "Revision history" section on 22 January 2001
+ Changed to Installation/Help menu entities 18 October 2001
+ Other minor cleanup and changes 18 October 2001 -->
+
+
+<!--
+This template was designed by: David Rugge davidrugge@mindspring.com
+with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr
+and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de
+of the KDE DocBook team.
+
+You may freely use this template for writing any sort of KDE documentation.
+If you have any changes or improvements, please let us know.
+
+Remember:
+- in XML, the case of the <tags> and attributes is relevant ;
+- also, quote all attributes.
+
+Please don't forget to remove all these comments in your final documentation,
+thanks ;-).
+-->
+
+<!-- ................................................................ -->
+
+<!-- The language must NOT be changed here. -->
+
+<book lang="&language;">
+
+<!-- This header contains all of the meta-information for the document such
+as Authors, publish date, the abstract, and Keywords -->
+
+<bookinfo>
+<title>The &%{APPNAMELC}; Handbook</title>
+
+<authorgroup>
+<author>
+<firstname></firstname>
+<othername></othername>
+<surname>%{AUTHOR}</surname>
+<affiliation>
+<address><email>%{EMAIL}</email></address>
+</affiliation>
+</author>
+</authorgroup>
+
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
+
+<copyright>
+<year>1999</year>
+<year>%{YEAR}</year>
+<holder>%{AUTHOR}</holder>
+</copyright>
+<!-- Translators: put here the copyright notice of the translation -->
+<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
+ and in the FDL itself on how to use it. -->
+<legalnotice>&FDLNotice;</legalnotice>
+
+<!-- Date and version information of the documentation
+Don't forget to include this last date and this last revision number, we
+need them for translation coordination !
+Please respect the format of the date (YYYY-MM-DD) and of the version
+(V.MM.LL), it could be used by automation scripts.
+Do NOT change these in the translation. -->
+
+<date>2001-10-18</date>
+<releaseinfo>%{VERSION}</releaseinfo>
+
+<!-- Abstract about this handbook -->
+
+<abstract>
+<para>
+&%{APPNAMELC}; is an application specially designed to do nothing you would
+ever want.
+</para>
+</abstract>
+
+<!-- This is a set of Keywords for indexing by search engines.
+Please at least include KDE, the KDE package it is in, the name
+ of your application, and a few relevant keywords. -->
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>%{APPNAME}</keyword>
+<keyword>nothing</keyword>
+<keyword>nothing else</keyword>
+</keywordset>
+
+</bookinfo>
+
+<!-- The contents of the documentation begin here. Label
+each chapter so with the id attribute. This is necessary for two reasons: it
+allows you to easily reference the chapter from other chapters of your
+document, and if there is no ID, the name of the generated HTML files will vary
+from time to time making it hard to manage for maintainers and for the CVS
+system. Any chapter labelled (OPTIONAL) may be left out at the author's
+discretion. Other chapters should not be left out in order to maintain a
+consistent documentation style across all KDE apps. -->
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<!-- The introduction chapter contains a brief introduction for the
+application that explains what it does and where to report
+problems. Basically a long version of the abstract. Don't include a
+revision history. (see installation appendix comment) -->
+
+<para>
+&%{APPNAMELC}; is a program that lets you do absolutely nothing. Please report
+any problems or feature requests to the &kde; mailing lists.
+</para>
+</chapter>
+
+<chapter id="using-%{APPNAMELC}">
+<title>Using &%{APPNAMELC};</title>
+
+<!-- This chapter should tell the user how to use your app. You should use as
+many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
+your application. -->
+
+<para>
+
+<!-- Note that all graphics should be in .png format. Use no gifs because of
+patent issues. -->
+
+<screenshot>
+<screeninfo>Here's a screenshot of &%{APPNAMELC};</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshot.png" format="PNG"/>
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="screenshot.eps" format="EPS"/>
+ </imageobject>
+ <textobject>
+ <phrase>Screenshot</phrase>
+ </textobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+
+<sect1 id="%{APPNAMELC}-features">
+<title>More &%{APPNAMELC}; features</title>
+
+<para>It slices! It dices! and it comes with a free toaster!</para>
+<para>
+The Squiggle Tool <guiicon><inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="squiggle.png" format="PNG"/>
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="squiggle.eps" format="EPS"/>
+ </imageobject>
+ <textobject>
+ <phrase>Squiggle</phrase>
+ </textobject>
+</inlinemediaobject></guiicon> is used to draw squiggly lines all over
+the &%{APPNAMELC}; main window. It's not a bug, it's a feature!
+</para>
+
+</sect1>
+</chapter>
+
+<chapter id="commands">
+<title>Command Reference</title>
+
+<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
+application windows and their menubar and toolbar commands for easy reference.
+Also include any keys that have a special function but have no equivalent in the
+menus or toolbars. This may not be necessary for small apps or apps with no tool
+or menu bars. -->
+
+<sect1 id="%{APPNAMELC}-mainwindow">
+<title>The main &%{APPNAMELC}; window</title>
+
+<sect2>
+<title>The File Menu</title>
+<para>
+<variablelist>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>New</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Creates a new document</action></para></listitem>
+</varlistentry>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Save</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Saves the document</action></para></listitem>
+</varlistentry>
+<varlistentry>
+<term><menuchoice>
+<shortcut>
+<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
+</shortcut>
+<guimenu>File</guimenu>
+<guimenuitem>Quit</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Quits</action> &%{APPNAMELC};</para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+
+</sect2>
+
+<sect2>
+<title>The <guimenu>Help</guimenu> Menu</title>
+
+<!-- Assuming you have a standard help menu (help, what's this, about -->
+<!-- &%{APPNAMELC};, about KDE) then the documentation is already written. -->
+<!-- The following entity is valid anywhere that a variablelist is -->
+<!-- valid. -->
+
+&help.menu.documentation;
+
+</sect2>
+
+</sect1>
+</chapter>
+
+<chapter id="developers">
+<title>Developer's Guide to &%{APPNAMELC};</title>
+
+<!-- (OPTIONAL) A Programming/Scripting reference chapter should be
+used for apps that use plugins or that provide their own scripting hooks
+and/or development libraries. -->
+
+<para>
+Programming &%{APPNAMELC}; plugins is a joy to behold. Just read through the next
+66 pages of API's to learn how!
+</para>
+
+<!-- Use refentries to describe APIs. Refentries are fairly complicated and you
+should consult the docbook reference for further details. The example below was
+taken from that reference and shortened a bit for readability. -->
+
+<refentry id="re-1007-unmanagechildren-1">
+<refmeta>
+<refentrytitle>XtUnmanageChildren</refentrytitle>
+<refmiscinfo>Xt - Geometry Management</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>XtUnmanageChildren
+</refname>
+<refpurpose>remove a list of children from a parent widget's managed
+list.
+<indexterm id="ix-1007-unmanagechildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
+<indexterm id="ix-1007-unmanagechildren-2"><primary>XtUnmanageChildren</primary></indexterm>
+</refpurpose>
+
+</refnamediv>
+<refsynopsisdiv>
+<refsynopsisdivinfo>
+<date>4 March 1996</date>
+</refsynopsisdivinfo>
+<synopsis>
+void XtUnmanageChildren(<replaceable class="parameter">children</replaceable>, <replaceable class="parameter">num_children</replaceable>)
+ WidgetList <replaceable class="parameter">children</replaceable>;
+ Cardinal <replaceable class="parameter">num_children</replaceable>;
+</synopsis>
+
+<refsect2 id="r2-1007-unmanagechildren-1">
+<title>Inputs</title>
+<variablelist>
+<varlistentry>
+<term><replaceable class="parameter">children</replaceable>
+</term>
+<listitem>
+<para>Specifies an array of child widgets. Each child must be of
+class RectObj or any subclass thereof.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term><replaceable class="parameter">num_children</replaceable>
+</term>
+<listitem>
+<para>Specifies the number of elements in <replaceable class="parameter">children</replaceable>.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+</refsect2></refsynopsisdiv>
+
+<refsect1 id="r1-1007-unmanagechildren-1">
+<title>Description
+</title>
+<para><function>XtUnmanageChildren()</function> unmaps the specified widgets
+and removes them from their parent's geometry management.
+The widgets will disappear from the screen, and (depending
+on its parent) may no longer have screen space allocated for
+them.
+</para>
+<para>Each of the widgets in the <replaceable class="parameter">children</replaceable> array must have
+the same parent.
+</para>
+<para>See the &ldquo;Algorithm&rdquo; section below for full details of the
+widget unmanagement procedure.
+</para>
+</refsect1>
+
+<refsect1 id="r1-1007-unmanagechildren-2">
+<title>Usage</title>
+<para>Unmanaging widgets is the usual method for temporarily
+making them invisible. They can be re-managed with
+<function>XtManageChildren()</function>.
+</para>
+<para>You can unmap a widget, but leave it under geometry
+management by calling <function>XtUnmapWidget()</function>. You can
+destroy a widget's window without destroying the widget by
+calling <function>XtUnrealizeWidget()</function>. You can destroy a
+widget completely with <function>XtDestroyWidget()</function>.
+</para>
+<para>If you are only going to unmanage a single widget, it is
+more convenient to call <function>XtUnmanageChild()</function>. It is
+often more convenient to call <function>XtUnmanageChild()</function>
+several times than it is to declare and initialize an array
+of widgets to pass to <function>XtUnmanageChildren()</function>. Calling
+<function>XtUnmanageChildren()</function> is more efficient, however,
+because it only calls the parent's <function>change_managed()</function>
+method once.
+</para>
+</refsect1>
+
+<refsect1 id="r1-1007-unmanagechildren-3">
+<title>Algorithm
+</title>
+<para><function>XtUnmanageChildren()</function> performs the following:
+</para>
+<variablelist>
+<varlistentry>
+<term>-
+</term>
+<listitem>
+<para>Ignores the child if it already is unmanaged or is being
+destroyed.
+</para>
+</listitem>
+</varlistentry>
+<varlistentry>
+<term>-
+</term>
+<listitem>
+<para>Otherwise, if the child is realized, it makes it nonvisible
+by unmapping it.
+</para>
+</listitem>
+</varlistentry>
+</variablelist>
+<para>
+</para>
+</refsect1>
+
+<refsect1 id="r1-1007-unmanagechildren-4">
+<title>Structures</title>
+<para>The <type>WidgetList</type> type is simply an array of widgets:
+</para>
+<screen id="sc-1007-unmanagechildren-1">typedef Widget *WidgetList;
+</screen>
+</refsect1>
+</refentry>
+
+</chapter>
+
+<chapter id="faq">
+<title>Questions and Answers</title>
+
+<!-- (OPTIONAL but recommended) This chapter should include all of the silly
+(and not-so-silly) newbie questions that fill up your mailbox. This chapter
+should be reserved for BRIEF questions and answers! If one question uses more
+than a page or so then it should probably be part of the
+"Using this Application" chapter instead. You should use links to
+cross-reference questions to the parts of your documentation that answer them.
+This is also a great place to provide pointers to other FAQ's if your users
+must do some complicated configuration on other programs in order for your
+application work. -->
+
+&reporting.bugs;
+&updating.documentation;
+
+<qandaset id="faqlist">
+<qandaentry>
+<question>
+<para>My Mouse doesn't work. How do I quit &%{APPNAMELC};?</para>
+</question>
+<answer>
+<para>You silly goose! Check out the <link linkend="commands">Commands
+Section</link> for the answer.</para>
+</answer>
+</qandaentry>
+<qandaentry>
+<question>
+<para>Why can't I twiddle my documents?</para>
+</question>
+<answer>
+<para>You can only twiddle your documents if you have the foobar.lib
+installed.</para>
+</answer>
+</qandaentry>
+</qandaset>
+</chapter>
+
+<chapter id="credits">
+
+<!-- Include credits for the programmers, documentation writers, and
+contributors here. The license for your software should then be included below
+the credits with a reference to the appropriate license file included in the KDE
+distribution. -->
+
+<title>Credits and License</title>
+
+<para>
+&%{APPNAMELC};
+</para>
+<para>
+Program copyright %{YEAR} %{AUTHOR} <email>%{EMAIL}</email>
+</para>
+<para>
+Contributors:
+<itemizedlist>
+<listitem><para>Konqui the KDE Dragon <email>konqui@kde.org</email></para>
+</listitem>
+<listitem><para>Tux the Linux Penguin <email>tux@linux.org</email></para>
+</listitem>
+</itemizedlist>
+</para>
+
+<para>
+Documentation copyright %{YEAR} %{AUTHOR} <email>%{EMAIL}</email>
+</para>
+
+<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
+
+&underFDL; <!-- FDL: do not remove -->
+
+<!-- Determine which license your application is licensed under,
+ and delete all the remaining licenses below:
+
+ (NOTE: All documentation are licensed under the FDL,
+ regardless of what license the application uses) -->
+
+&underGPL; <!-- GPL License -->
+&underBSDLicense; <!-- BSD License -->
+&underArtisticLicense; <!-- BSD Artistic License -->
+&underX11License; <!-- X11 License -->
+
+</chapter>
+
+<appendix id="installation">
+<title>Installation</title>
+
+<sect1 id="getting-%{APPNAMELC}">
+<title>How to obtain &%{APPNAMELC};</title>
+
+<!-- This first entity contains boiler plate for applications that are
+part of KDE CVS. You should remove it if you are releasing your
+application -->
+
+&install.intro.documentation;
+
+</sect1>
+
+<sect1 id="requirements">
+<title>Requirements</title>
+
+<!--
+List any special requirements for your application here. This should include:
+.Libraries or other software that is not included in kdesupport,
+kdelibs, or kdebase.
+.Hardware requirements like amount of RAM, disk space, graphics card
+capabilities, screen resolution, special expansion cards, etc.
+.Operating systems the app will run on. If your app is designed only for a
+specific OS, (you wrote a graphical LILO configurator for example) put this
+information here.
+-->
+
+<para>
+In order to successfully use &%{APPNAMELC};, you need &kde; 1.1. Foobar.lib is
+required in order to support the advanced &%{APPNAMELC}; features. &%{APPNAMELC}; uses
+about 5 megs of memory to run, but this may vary depending on your
+platform and configuration.
+</para>
+
+<para>
+All required libraries as well as &%{APPNAMELC}; itself can be found
+on <ulink url="ftp://ftp.%{APPNAMELC}.org">The &%{APPNAMELC}; home page</ulink>.
+</para>
+
+<!-- For a list of updates, you may refer to the application web site
+or the ChangeLog file, or ... -->
+<para>
+You can find a list of changes at <ulink
+url="http://apps.kde.org/%{APPNAMELC}">http://apps.kde.org/%{APPNAMELC}</ulink>.
+</para>
+</sect1>
+
+<sect1 id="compilation">
+<title>Compilation and Installation</title>
+
+<!-- This entity contains the boilerplate text for standard -->
+<!-- compilation instructions. If your application requires any -->
+<!-- special handling, remove it, and replace with your own text. -->
+
+&install.compile.documentation;
+
+</sect1>
+
+<sect1 id="configuration">
+<title>Configuration</title>
+
+<para>Don't forget to tell your system to start the <filename>dtd</filename>
+dicer-toaster daemon first, or &%{APPNAMELC}; won't work !</para>
+
+</sect1>
+
+</appendix>
+
+&documentation.index;
+</book>
+
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes:nil
+sgml-general-insert-case:lower
+sgml-indent-step:0
+sgml-indent-data:nil
+End:
+
+vim:tabstop=2:shiftwidth=2:expandtab
+-->
+
diff --git a/parts/appwizard/common/kde-part.desktop b/parts/appwizard/common/kde-part.desktop
new file mode 100644
index 00000000..01cc9d37
--- /dev/null
+++ b/parts/appwizard/common/kde-part.desktop
@@ -0,0 +1,18 @@
+[Desktop Entry]
+Name=%{APPNAME}Part
+Name[br]=Perzh%{APPNAME}
+Name[ca]=Part per a %{APPNAME}
+Name[el]=Τμήμα%{APPNAME}
+Name[et]=%{APPNAME} komponent
+Name[fa]=جزء %{APPNAME}
+Name[gl]=%{APPNAME} Part
+Name[ja]=%{APPNAME} パート
+Name[ne]=%{APPNAME}भाग
+Name[pt_BR]=Parte %{APPNAME}
+Name[sv]=%{APPNAME}-del
+Name[ta]=%{APPNAME}பாகம்
+Name[tr]=%{APPNAME} Bileşeni
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=lib%{APPNAMELC}part
+Type=Service
diff --git a/parts/appwizard/common/kde-po-Makefile.am b/parts/appwizard/common/kde-po-Makefile.am
new file mode 100644
index 00000000..0fa209cd
--- /dev/null
+++ b/parts/appwizard/common/kde-po-Makefile.am
@@ -0,0 +1 @@
+POFILES = AUTO
diff --git a/parts/appwizard/common/scons.kdevtemplate b/parts/appwizard/common/scons.kdevtemplate
new file mode 100644
index 00000000..7cf03e0b
--- /dev/null
+++ b/parts/appwizard/common/scons.kdevtemplate
@@ -0,0 +1,5 @@
+[SCONS]
+Type=install archive
+Source=%{kdevelop}/template-common/scons.tar.gz
+Dest=%{dest}
+Process=false
diff --git a/parts/appwizard/common/scons/admin/generic.py b/parts/appwizard/common/scons/admin/generic.py
new file mode 100644
index 00000000..55c37c90
--- /dev/null
+++ b/parts/appwizard/common/scons/admin/generic.py
@@ -0,0 +1,194 @@
+## Thomas Nagy, 2005
+
+"""
+Detect and store the most common options
+* kdecxxflags : debug=1 (-g) or debug=full (-g3, slower)
+ else use the user CXXFLAGS if any, - or -O2 by default
+* prefix : the installation path
+* extraincludes : a list of paths separated by ':'
+ie: scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
+"""
+
+BOLD ="\033[1m"
+RED ="\033[91m"
+GREEN ="\033[92m"
+YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds
+CYAN ="\033[96m"
+NORMAL ="\033[0m"
+
+import os
+
+def exists(env):
+ return true
+
+def generate(env):
+ ## Bksys requires scons 0.96
+ env.EnsureSConsVersion(0, 96)
+
+ import sys
+ env['HELP']=0
+ if '--help' in sys.argv or '-h' in sys.argv or 'help' in sys.argv:
+ env['HELP']=1
+
+ if env['HELP']:
+ print """
+"""+BOLD+"""*** Generic options ***
+-----------------------"""+NORMAL+"""
+"""+BOLD+"""* debug """+NORMAL+""": debug=1 (-g) or debug=full (-g3, slower) else use environment CXXFLAGS, or -O2 by default
+"""+BOLD+"""* prefix """+NORMAL+""": the installation path
+"""+BOLD+"""* extraincludes """+NORMAL+""": a list of paths separated by ':'
+ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
+"""+NORMAL
+
+ ## Global cache directory
+ ## Put all project files in it so a rm -rf cache will clean up the config
+ if not env.has_key('CACHEDIR'):
+ env['CACHEDIR'] = os.getcwd()+'/cache/'
+ if not os.path.isdir(env['CACHEDIR']):
+ os.mkdir(env['CACHEDIR'])
+
+ ## SCons cache directory
+ ## this avoids recompiling the same files over and over again: very handy when working with cvs
+ env.CacheDir(os.getcwd()+'/cache/objects')
+
+ ## Avoid spreading .sconsign files everywhere - keep this line
+ env.SConsignFile(env['CACHEDIR']+'/scons_signatures')
+
+ # Special trick for installing rpms ...
+ env['DESTDIR']=''
+ if 'install' in sys.argv and os.environ.has_key('DESTDIR'):
+ env['DESTDIR']=os.environ['DESTDIR']+'/'
+ print CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']
+
+ # load the options
+ from SCons.Options import Options, PathOption
+ cachefile=env['CACHEDIR']+'generic.cache.py'
+ opts = Options(cachefile)
+ opts.AddOptions(
+ ( 'KDECCFLAGS', 'C flags' ),
+ ( 'KDECXXFLAGS', 'debug level for the project : full or just anything' ),
+ ( 'KDELINKFLAGS', 'additional link flags' ),
+ ( 'PREFIX', 'prefix for installation' ),
+ ( 'EXTRAINCLUDES', 'extra include paths for the project' ),
+ ( 'ISCONFIGURED', 'is the project configured' ),
+ )
+ opts.Update(env)
+
+ # use this to avoid an error message 'how to make target configure ?'
+ env.Alias('configure', None)
+
+ import SCons.Util
+
+ if 'install' in sys.argv:
+ env['_INSTALL']=1
+ else:
+ env['_INSTALL']=0
+ if 'configure' in sys.argv:
+ env['_CONFIGURE']=1
+ else:
+ env['_CONFIGURE']=0
+
+ # configure the environment if needed
+ if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('ISCONFIGURED')):
+
+ import re
+ def makeHashTable(args):
+ table = { }
+ for arg in args:
+ if len(arg) > 1:
+ lst=arg.split('=')
+ if len(lst) < 2:
+ continue
+ key=lst[0]
+ value=lst[1]
+ if len(key) > 0 and len(value) >0:
+ table[key] = value
+ return table
+
+ env['ARGS']=makeHashTable(sys.argv)
+
+ # be paranoid, unset existing variables
+ if env.has_key('KDECXXFLAGS'):
+ env.__delitem__('KDECXXFLAGS')
+ if env.has_key('KDECCFLAGS'):
+ env.__delitem__('KDECCFLAGS')
+ if env.has_key('KDELINKFLAGS'):
+ env.__delitem__('KDELINKFLAGS')
+ if env.has_key('PREFIX'):
+ env.__delitem__('PREFIX')
+ if env.has_key('EXTRAINCLUDES'):
+ env.__delitem__('EXTRAINCLUDES')
+ if env.has_key('ISCONFIGURED'):
+ env.__delitem__('ISCONFIGURED')
+
+ if env['ARGS'].get('debug', None):
+ debuglevel = env['ARGS'].get('debug', None)
+ print CYAN+'** Enabling debug for the project **' + NORMAL
+ if (debuglevel == "full"):
+ env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
+ else:
+ env['KDECXXFLAGS'] = ['-DDEBUG', '-g']
+ else:
+ if os.environ.has_key('CXXFLAGS'):
+ # user-defined flags (gentooers will be elighted)
+ env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] )
+ env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] )
+ else:
+ env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG'])
+
+ if os.environ.has_key('CFLAGS'):
+ env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] )
+
+ ## FreeBSD settings (contributed by will at freebsd dot org)
+ if os.uname()[0] == "FreeBSD":
+ if os.environ.has_key('PTHREAD_LIBS'):
+ env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) )
+ else:
+ syspf = os.popen('/sbin/sysctl kern.osreldate')
+ osreldate = int(syspf.read().split()[1])
+ syspf.close()
+ if osreldate < 500016:
+ env.AppendUnique( KDELINKFLAGS = ['-pthread'])
+ env.AppendUnique( KDECXXFLAGS = ['-D_THREAD_SAFE'])
+ elif osreldate < 502102:
+ env.AppendUnique( KDELINKFLAGS = ['-lc_r'])
+ env.AppendUnique( KDECXXFLAGS = ['-D_THREAD_SAFE'])
+ else:
+ env.AppendUnique( KDELINKFLAGS = ['-pthread'])
+
+ # User-specified prefix
+ if env['ARGS'].get('prefix', None):
+ env['PREFIX'] = env['ARGS'].get('prefix', None)
+ print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL
+ elif env.has_key('PREFIX'):
+ env.__delitem__('PREFIX')
+
+ # User-specified include paths
+ env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
+ if env['ARGS'].get('extraincludes', None):
+ print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL
+ elif env.has_key('EXTRAINCLUDES'):
+ env.__delitem__('EXTRAINCLUDES')
+
+ env['ISCONFIGURED']=1
+
+ # And finally save the options in the cache
+ opts.Save(cachefile, env)
+
+ if env.has_key('KDECXXFLAGS'):
+ env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] )
+
+ if env.has_key('KDECCFLAGS'):
+ env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] )
+
+ if env.has_key('KDELINKFLAGS'):
+ env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] )
+
+ if env.has_key('EXTRAINCLUDES'):
+ incpaths = []
+ for dir in str(env['EXTRAINCLUDES']).split(':'):
+ incpaths.append( dir )
+ env.Append(CPPPATH = incpaths)
+
+ env.Export("env")
+
diff --git a/parts/appwizard/common/scons/admin/kde.py b/parts/appwizard/common/scons/admin/kde.py
new file mode 100644
index 00000000..bea63d4e
--- /dev/null
+++ b/parts/appwizard/common/scons/admin/kde.py
@@ -0,0 +1,856 @@
+# Made from scons qt.py and (heavily) modified into kde.py
+# Thomas Nagy, 2004, 2005 <tnagy2^8@yahoo.fr>
+
+"""
+Run scons -h to display the associated help, or look below ..
+"""
+
+BOLD ="\033[1m"
+RED ="\033[91m"
+GREEN ="\033[92m"
+YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds
+CYAN ="\033[96m"
+NORMAL ="\033[0m"
+
+import os, re, types
+
+# Returns the name of the shared object (i.e. libkdeui.so.4)
+# referenced by a libtool archive (like libkdeui.la)
+def getSOfromLA(lafile):
+ contents = open(lafile, 'r').read()
+ match = re.search("^dlname='([^']*)'$", contents, re.M)
+ if match:
+ return match.group(1)
+ return None
+
+def exists(env):
+ return True
+
+def detect_kde(env):
+ """ Detect the qt and kde environment using kde-config mostly """
+
+ prefix = env['ARGS'].get('prefix', None)
+ execprefix = env['ARGS'].get('execprefix', None)
+ datadir = env['ARGS'].get('datadir', None)
+ libdir = env['ARGS'].get('libdir', None)
+ libsuffix = env['ARGS'].get('libsuffix', '')
+ kdeincludes = env['ARGS'].get('kdeincludes', None)
+ kdelibs = env['ARGS'].get('kdelibs', None)
+ qtincludes = env['ARGS'].get('qtincludes', None)
+ qtlibs = env['ARGS'].get('qtlibs', None)
+
+ if libdir:
+ libdir = libdir+libsuffix
+
+ ## Detect the kde libraries
+ print "Checking for kde-config : ",
+ kde_config = os.popen("which kde-config 2>/dev/null").read().strip()
+ if len(kde_config):
+ print GREEN+"kde-config was found"+NORMAL
+ else:
+ print RED+"kde-config was NOT found in your PATH"+NORMAL
+ print "Make sure kde is installed properly"
+ print "(missing package kdebase-devel?)"
+ env.Exit(1)
+ env['KDEDIR'] = os.popen('kde-config -prefix').read().strip()
+
+ print "Checking for kde version : ",
+ kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
+ if int(kde_version[0]) != 3 or int(kde_version[2]) < 2:
+ print RED+kde_version
+ print RED+"Your kde version can be too old"+NORMAL
+ print RED+"Please make sure kde is at least 3.2"+NORMAL
+ else:
+ print GREEN+kde_version+NORMAL
+
+ ## Detect the qt library
+ print "Checking for the qt library : ",
+ qtdir = os.getenv("QTDIR")
+ if qtdir:
+ print GREEN+"qt is in "+qtdir+NORMAL
+ else:
+ libdir = os.popen('kde-config --expandvars --install lib').read().strip()
+ libkdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libkdeui.la')
+ m = re.search('(.*)/lib/libqt.*', os.popen('ldd ' + libkdeuiSO + ' | grep libqt').read().strip().split()[2])
+ if m:
+ qtdir = m.group(1)
+ print YELLOW+"qt was found as "+m.group(1)+NORMAL
+ else:
+ print RED+"qt was not found"+NORMAL
+ print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL
+ env.Exit(1)
+ env['QTDIR'] = qtdir.strip()
+
+ ## Find the necessary programs uic and moc
+ print "Checking for uic : ",
+ uic = qtdir + "/bin/uic"
+ if os.path.isfile(uic):
+ print GREEN+"uic was found as "+uic+NORMAL
+ else:
+ uic = os.popen("which uic 2>/dev/null").read().strip()
+ if len(uic):
+ print YELLOW+"uic was found as "+uic+NORMAL
+ else:
+ uic = os.popen("which uic 2>/dev/null").read().strip()
+ if len(uic):
+ print YELLOW+"uic was found as "+uic+NORMAL
+ else:
+ print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL
+ env.Exit(1)
+ env['QT_UIC'] = uic
+
+ print "Checking for moc : ",
+ moc = qtdir + "/bin/moc"
+ if os.path.isfile(moc):
+ print GREEN + "moc was found as " + moc + NORMAL
+ else:
+ moc = os.popen("which moc 2>/dev/null").read().strip()
+ if len(moc):
+ print YELLOW + "moc was found as " + moc + NORMAL
+ elif os.path.isfile("/usr/share/qt3/bin/moc"):
+ moc = "/usr/share/qt3/bin/moc"
+ print YELLOW + "moc was found as " + moc + NORMAL
+ else:
+ print RED + "moc was not found - set QTDIR or put it in your PATH ?" + NORMAL
+ env.Exit(1)
+ env['QT_MOC'] = moc
+
+ ## check for the qt and kde includes
+ print "Checking for the qt includes : ",
+ if qtincludes and os.path.isfile(qtincludes + "/qlayout.h"):
+ # The user told where to look for and it looks valid
+ print GREEN + "ok " + qtincludes + NORMAL
+ else:
+ if os.path.isfile(qtdir + "/include/qlayout.h"):
+ # Automatic detection
+ print GREEN + "ok " + qtdir + "/include/ " + NORMAL
+ qtincludes = qtdir + "/include/"
+ elif os.path.isfile("/usr/include/qt3/qlayout.h"):
+ # Debian probably
+ print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL
+ qtincludes = "/usr/include/qt3"
+ else:
+ print RED + "the qt headers were not found" + NORMAL
+ env.Exit(1)
+
+ print "Checking for the kde includes : ",
+ kdeprefix = os.popen("kde-config --prefix").read().strip()
+ if not kdeincludes:
+ kdeincludes = kdeprefix+"/include/"
+ if os.path.isfile(kdeincludes + "/klineedit.h"):
+ print GREEN + "ok " + kdeincludes + NORMAL
+ else:
+ if os.path.isfile(kdeprefix+"/include/kde/klineedit.h"):
+ # Debian, Fedora probably
+ print YELLOW + "the kde headers were found in " + kdeprefix + "/include/kde/" + NORMAL
+ kdeincludes = kdeprefix + "/include/kde/"
+ else:
+ print RED + "The kde includes were NOT found" + NORMAL
+ env.Exit(1)
+
+ if prefix:
+ ## use the user-specified prefix
+ if not execprefix:
+ execprefix = prefix
+ if not datadir:
+ datadir=prefix+"/share"
+ if not libdir:
+ libdir=execprefix+"/lib"+libsuffix
+
+ subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',datadir).replace('${libdir}', libdir)
+ debian_fix = lambda x: x.replace('/usr/share', '${datadir}')
+ env['KDEBIN'] = subst_vars(os.popen('kde-config --install exe').read().strip())
+ env['KDEAPPS'] = subst_vars(os.popen('kde-config --install apps').read().strip())
+ env['KDEDATA'] = subst_vars(os.popen('kde-config --install data').read().strip())
+ env['KDEMODULE']= subst_vars(os.popen('kde-config --install module').read().strip())
+ env['KDELOCALE']= subst_vars(os.popen('kde-config --install locale').read().strip())
+ env['KDEDOC'] = subst_vars( debian_fix(os.popen('kde-config --install html').read().strip()) )
+ env['KDEKCFG'] = subst_vars(os.popen('kde-config --install kcfg').read().strip())
+ env['KDEXDG'] = subst_vars(os.popen('kde-config --install xdgdata-apps').read().strip())
+ env['KDEXDGDIR']= subst_vars(os.popen('kde-config --install xdgdata-dirs').read().strip())
+ env['KDEMENU'] = subst_vars(os.popen('kde-config --install apps').read().strip())
+ env['KDEMIME'] = subst_vars(os.popen('kde-config --install mime').read().strip())
+ env['KDEICONS'] = subst_vars(os.popen('kde-config --install icon').read().strip())
+ env['KDESERV'] = subst_vars(os.popen('kde-config --install services').read().strip())
+ else:
+ # the user has given no prefix, install as a normal kde app
+ env['PREFIX'] = os.popen('kde-config --prefix').read().strip()
+ env['KDEBIN'] = os.popen('kde-config --expandvars --install exe').read().strip()
+ env['KDEAPPS'] = os.popen('kde-config --expandvars --install apps').read().strip()
+ env['KDEDATA'] = os.popen('kde-config --expandvars --install data').read().strip()
+ env['KDEMODULE']= os.popen('kde-config --expandvars --install module').read().strip()
+ env['KDELOCALE']= os.popen('kde-config --expandvars --install locale').read().strip()
+ env['KDEDOC'] = os.popen('kde-config --expandvars --install html').read().strip()
+ env['KDEKCFG'] = os.popen('kde-config --expandvars --install kcfg').read().strip()
+ env['KDEXDG'] = os.popen('kde-config --expandvars --install xdgdata-apps').read().strip()
+ env['KDEXDGDIR']= os.popen('kde-config --expandvars --install xdgdata-dirs').read().strip()
+ env['KDEMENU'] = os.popen('kde-config --expandvars --install apps').read().strip()
+ env['KDEMIME'] = os.popen('kde-config --expandvars --install mime').read().strip()
+ env['KDEICONS'] = os.popen('kde-config --expandvars --install icon').read().strip()
+ env['KDESERV'] = os.popen('kde-config --expandvars --install services').read().strip()
+
+ env['QTPLUGINS']=os.popen('kde-config --expandvars --install qtplugins').read().strip()
+
+ ## kde libs and includes
+ env['KDEINCLUDEPATH']=kdeincludes
+ if not kdelibs:
+ kdelibs=os.popen('kde-config --expandvars --install lib').read().strip()
+ env['KDELIBPATH']=kdelibs
+
+ ## qt libs and includes
+ env['QTINCLUDEPATH']=qtincludes
+ if not qtlibs:
+ qtlibs=qtdir+"/lib"
+ env['QTLIBPATH']=qtlibs
+
+def generate(env):
+ """"Set up the qt and kde environment and builders - the moc part is difficult to understand """
+ if env['HELP']:
+ print """
+"""+BOLD+"""*** KDE options ***
+-------------------"""+NORMAL+"""
+"""+BOLD+"""* prefix """+NORMAL+""": base install path, ie: /usr/local
+"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin
+"""+BOLD+"""* datadir """+NORMAL+""": install path for the data, ie: /usr/local/share
+"""+BOLD+"""* libdir """+NORMAL+""": install path for the libs, ie: /usr/lib
+"""+BOLD+"""* libsuffix """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32
+"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/kde on debian, ...)
+"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
+"""+BOLD+"""* kdelibs """+NORMAL+""": path to the kde libs, for linking the programs
+"""+BOLD+"""* qtlibs """+NORMAL+""": same punishment, for qt libraries
+ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
+"""+NORMAL
+
+ import SCons.Defaults
+ import SCons.Tool
+ import SCons.Util
+
+ ui_extensions = [".ui"]
+ header_extensions = [".h", ".hxx", ".hpp", ".hh"]
+ source_extensions = [".cpp", ".cxx", ".cc"]
+
+ def find_file(filename, paths, node_factory):
+ retval = None
+ for dir in paths:
+ node = node_factory(filename, dir)
+ if node.rexists():
+ return node
+ return None
+
+ class _Metasources:
+ """ Callable class, which works as an emitter for Programs, SharedLibraries
+ and StaticLibraries."""
+
+ def __init__(self, objBuilderName):
+ self.objBuilderName = objBuilderName
+
+ def __call__(self, target, source, env):
+ """ Smart autoscan function. Gets the list of objects for the Program
+ or Lib. Adds objects and builders for the special qt files. """
+ try:
+ if int(env.subst('$QT_AUTOSCAN')) == 0:
+ return target, source
+ except ValueError:
+ pass
+
+ try:
+ qtdebug = int(env.subst('$QT_DEBUG'))
+ except ValueError:
+ qtdebug = 0
+
+ # some shortcuts used in the scanner
+ FS = SCons.Node.FS.default_fs
+ splitext = SCons.Util.splitext
+ objBuilder = getattr(env, self.objBuilderName)
+
+ # some regular expressions:
+ # Q_OBJECT detection
+ q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]')
+
+ # The following is kind of hacky to get builders working properly (FIXME) ??
+ objBuilderEnv = objBuilder.env
+ objBuilder.env = env
+ mocBuilderEnv = env.Moc.env
+ env.Moc.env = env
+
+ # make a deep copy for the result; MocH objects will be appended
+ out_sources = source[:]
+
+ for obj in source:
+ if not obj.has_builder():
+ # binary obj file provided
+ if qtdebug:
+ print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj)
+ continue
+ cpp = obj.sources[0]
+ if not splitext(str(cpp))[1] in source_extensions:
+ if qtdebug:
+ print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
+ # c or fortran source
+ continue
+ #cpp_contents = comment.sub('', cpp.get_contents())
+ cpp_contents = cpp.get_contents()
+
+ h = None
+ ui = None
+
+ for ui_ext in ui_extensions:
+ # try to find the ui file in the corresponding source directory
+ uiname = splitext(cpp.name)[0] + ui_ext
+ ui = find_file(uiname, (cpp.get_dir(),), FS.File)
+ if ui:
+ if qtdebug:
+ print "scons: qt: found .ui file of header" #% (str(h), str(cpp))
+ #h_contents = comment.sub('', h.get_contents())
+ break
+
+ # if we have a .ui file, do not continue, it is automatically handled by Uic
+ if ui:
+ continue
+
+ for h_ext in header_extensions:
+ # try to find the header file in the corresponding source
+ # directory
+ hname = splitext(cpp.name)[0] + h_ext
+ h = find_file(hname, (cpp.get_dir(),), FS.File)
+ if h:
+ if qtdebug:
+ print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
+ #h_contents = comment.sub('', h.get_contents())
+ h_contents = h.get_contents()
+ break
+
+ if not h and qtdebug:
+ print "scons: qt: no header for '%s'." % (str(cpp))
+ if h and q_object_search.search(h_contents):
+ # h file with the Q_OBJECT macro found -> add .moc or _moc.cpp file
+ moc_cpp = None
+
+ if env.has_key('NOMOCSCAN'):
+ moc_cpp = env.Moc(h)
+ else:
+ reg = '\n\s*#include\s*("|<)'+splitext(cpp.name)[0]+'.moc("|>)'
+ meta_object_search = re.compile(reg)
+ if meta_object_search.search(cpp_contents):
+ moc_cpp = env.Moc(h)
+ else:
+ moc_cpp = env.Moccpp(h)
+ moc_o = objBuilder(moc_cpp)
+ out_sources.append(moc_o)
+ if qtdebug:
+ print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp[0]))
+
+ if cpp and q_object_search.search(cpp_contents):
+ print "error, bksys cannot handle cpp files with Q_OBJECT classes"
+ print "if you are sure this is a feature worth the effort, "
+ print "report this to the authors tnagyemail-mail yahoo.fr"
+
+ # restore the original env attributes (FIXME)
+ objBuilder.env = objBuilderEnv
+ env.Moc.env = mocBuilderEnv
+
+ return (target, out_sources)
+
+ MetasourcesShared = _Metasources('SharedObject')
+ MetasourcesStatic = _Metasources('StaticObject')
+
+ CLVar = SCons.Util.CLVar
+ splitext = SCons.Util.splitext
+ Builder = SCons.Builder.Builder
+
+ # Detect the environment - replaces ./configure implicitely and store the options into a cache
+ from SCons.Options import Options
+ cachefile=env['CACHEDIR']+'kde.cache.py'
+ opts = Options(cachefile)
+ opts.AddOptions(
+ ('PREFIX', 'root of the program installation'),
+
+ ('QTDIR', 'root of qt directory'),
+ ('QTLIBPATH', 'path to the qt libraries'),
+ ('QTINCLUDEPATH', 'path to the qt includes'),
+ ('QT_UIC', 'moc directory'),
+ ('QT_MOC', 'moc executable command'),
+ ('QTPLUGINS', 'uic executable command'),
+ ('KDEDIR', 'root of kde directory'),
+ ('KDELIBPATH', 'path to the kde libs'),
+ ('KDEINCLUDEPATH', 'path to the kde includes'),
+
+ ('KDEBIN', 'installation path of the kde binaries'),
+ ('KDEMODULE', 'installation path of the parts and libs'),
+ ('KDEAPPS', ''),
+ ('KDEDATA', 'installation path of the application data'),
+ ('KDELOCALE', ''),
+ ('KDEDOC', 'installation path of the application documentation'),
+ ('KDEKCFG', 'installation path of the .kcfg files'),
+ ('KDEXDG', 'installation path of the service types'),
+ ('KDEXDGDIR', 'installation path of the xdg service directories'),
+ ('KDEMENU', ''),
+ ('KDEMIME', 'installation path of to the mimetypes'),
+ ('KDEICONS', ''),
+ ('KDESERV', ''),
+ )
+ opts.Update(env)
+
+ # reconfigure when things are missing
+ if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR')):
+ detect_kde(env)
+
+ # finally save the configuration to the cache file
+ opts.Save(cachefile, env)
+
+ ## set default variables, one can override them in sconscript files
+ env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ])
+ env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
+
+ env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
+ env['QT_AUTOSCAN'] = 1
+ env['QT_DEBUG'] = 0
+ env['QT_UIC_HFLAGS'] = '-L $QTPLUGINS -nounload'
+ env['QT_UIC_CFLAGS'] = '$QT_UIC_HFLAGS -tr tr2i18n'
+ env['QT_LIBS'] = 'qt-mt'
+ env['QT_UICIMPLPREFIX'] = ''
+ env['QT_UICIMPLSUFFIX'] = '.cpp'
+
+ env['QT_MOCHPREFIX'] = ''
+ env['QT_MOCHSUFFIX'] = '.moc'
+ env['KDE_KCFG_IMPLPREFIX'] = ''
+ env['KDE_KCFG_IMPL_HSUFFIX'] = '.h'
+ env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp'
+ env['KDE_SKEL_IMPL_SUFFIX'] = '.skel'
+ env['MEINPROC'] = 'meinproc'
+ env['MSGFMT'] = 'msgfmt'
+
+ ## ui file processing
+ def uic_processing(target, source, env):
+ inc_kde = '#include <klocale.h>\n#include <kdialog.h>\n'
+ inc_moc = '#include "%s"\n' % target[2].name
+ comp_h = '$QT_UIC $QT_UIC_HFLAGS -o %s %s' % (target[0].path, source[0].path)
+ comp_c = '$QT_UIC $QT_UIC_CFLAGS -impl %s %s' % (target[0].path, source[0].path)
+ comp_moc = '$QT_MOC -o %s %s' % (target[2].path, target[0].path)
+
+ ret = env.Execute(comp_h)
+ if ret:
+ return ret
+
+ dest = open( target[1].path, "w" )
+ dest.write(inc_kde)
+ dest.close()
+
+ ret = env.Execute( comp_c+" >> "+target[1].path )
+ if ret:
+ return ret
+
+ dest = open( target[1].path, "a" )
+ dest.write(inc_moc)
+ dest.close()
+
+ ret = env.Execute( comp_moc )
+ return ret
+
+ def uicEmitter(target, source, env):
+ adjustixes = SCons.Util.adjustixes
+ bs = SCons.Util.splitext(str(source[0].name))[0]
+ bs = os.path.join(str(target[0].get_dir()),bs)
+ # first target is automatically added by builder (.h file)
+ if len(target) < 2:
+ # second target is .cpp file
+ target.append(adjustixes(bs,
+ env.subst('$QT_UICIMPLPREFIX'),
+ env.subst('$QT_UICIMPLSUFFIX')))
+ if len(target) < 3:
+ # third target is .moc file
+ target.append(adjustixes(bs,
+ env.subst('$QT_MOCHPREFIX'),
+ env.subst('$QT_MOCHSUFFIX')))
+ return target, source
+
+ UIC_BUILDER = Builder(
+ action = uic_processing,
+ emitter = uicEmitter,
+ suffix = '.h',
+ src_suffix = '.ui')
+
+ ## moc file processing
+ env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE')
+
+ MOC_BUILDER = Builder(
+ action = '$QT_MOCCOM',
+ suffix = '.moc',
+ src_suffix = '.h')
+
+ MOCCPP_BUILDER = Builder(
+ action = '$QT_MOCCOM',
+ suffix = '_moc.cpp',
+ src_suffix = '.h')
+
+ ## kcfg file processing
+ def kcfgGenerator(target, source, env, for_signature):
+ act=[]
+ act.append('kconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
+ return act
+
+ def kcfgEmitter(target, source, env):
+ adjustixes = SCons.Util.adjustixes
+ bs = SCons.Util.splitext(str(source[0].name))[0]
+ bs = os.path.join(str(target[0].get_dir()),bs)
+ # .h file is automatically added
+ if len(target) < 2:
+ # add .cpp file
+ target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX')))
+
+ if len(source) <2:
+ if not os.path.isfile(str(source[0])):
+ print RED+'kcfg file given'+str(source[0])+' does not exist !'+NORMAL
+ return target, source
+ kfcgfilename=""
+ kcfgFileDeclRx = re.compile("^[fF]ile\s*=\s*(.+)\s*$")
+ for line in file(str(source[0]), "r").readlines():
+ match = kcfgFileDeclRx.match(line.strip())
+ if match:
+ kcfgfilename = match.group(1)
+ break
+ source.append(str(source[0].get_dir())+'/'+kcfgfilename)
+ return target, source
+
+ KCFG_BUILDER = Builder(
+ generator = kcfgGenerator,
+ emitter = kcfgEmitter,
+ suffix = '.h',
+ src_suffix = '.kcfgc')
+
+ ## dcop processing
+ def dcopGenerator(target, source, env, for_signature):
+ act=[]
+ act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false)')
+ act.append('dcopidl2cpp --c++-suffix cpp --no-signals --no-stub '+target[1].path)
+ return act
+
+ def dcopEmitter(target, source, env):
+ bs = SCons.Util.splitext(str(source[0].name))[0]
+ bs = os.path.join(str(target[0].get_dir()),bs)
+ target.append(bs+'.kidl')
+ #target.append(bs+'_skel.cpp')
+ return target, source
+
+ DCOP_BUILDER = Builder(
+ generator = dcopGenerator,
+ emitter = dcopEmitter,
+ suffix = '_skel.cpp',
+ src_suffix = '.h')
+
+ ## documentation processing
+ MEINPROC_BUILDER = Builder(
+ action = '$MEINPROC --check --cache $TARGET $SOURCE',
+ suffix = '.cache.bz2')
+
+ ## translation files builder
+ TRANSFILES_BUILDER = Builder(
+ action = '$MSGFMT $SOURCE -o $TARGET',
+ suffix = '.gmo',
+ src_suffix = '.po')
+
+ ## libtool file builder
+ def la_file(target, source, env):
+ dest=open(target[0].path, 'w')
+ sname=source[0].name
+ dest.write("dlname='%s'\n" % sname)
+ dest.write("library_names='%s %s %s'\n" % (sname, sname, sname))
+ dest.write("old_library=''\n")
+ dest.write("dependency_libs=''\n")
+ dest.write("current=0\n")
+ dest.write("age=0\n")
+ dest.write("revision=0\n")
+ dest.write("installed=yes\n")
+ dest.write("shouldnotlink=no\n")
+ dest.write("dlopen=''\n")
+ dest.write("dlpreopen=''\n")
+ dest.write("libdir='%s'" % env['KDEMODULE'])
+ dest.close()
+ return 0
+
+ LA_BUILDER = Builder(
+ action = la_file,
+ suffix = '.la',
+ src_suffix = env['SHLIBSUFFIX'])
+
+ ## register the builders
+ env['BUILDERS']['Uic'] = UIC_BUILDER
+ env['BUILDERS']['Moc'] = MOC_BUILDER
+ env['BUILDERS']['Moccpp'] = MOCCPP_BUILDER
+ env['BUILDERS']['Dcop'] = DCOP_BUILDER
+ env['BUILDERS']['Kcfg'] = KCFG_BUILDER
+ env['BUILDERS']['LaFile'] = LA_BUILDER
+ env['BUILDERS']['Meinproc'] = MEINPROC_BUILDER
+ env['BUILDERS']['Transfiles']= TRANSFILES_BUILDER
+
+ static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+ static_obj.src_builder.append('Uic')
+ shared_obj.src_builder.append('Uic')
+ static_obj.src_builder.append('Kcfg')
+ shared_obj.src_builder.append('Kcfg')
+ static_obj.src_builder.append('LaFile')
+ shared_obj.src_builder.append('LaFile')
+ static_obj.src_builder.append('Meinproc')
+ shared_obj.src_builder.append('Meinproc')
+ static_obj.src_builder.append('Transfiles')
+ shared_obj.src_builder.append('Transfiles')
+
+ ## Find the files to moc, dcop, and link against kde and qt
+ env.AppendUnique(PROGEMITTER = [MetasourcesStatic], SHLIBEMITTER=[MetasourcesShared], LIBEMITTER =[MetasourcesStatic])
+
+ ## Handy helpers for building kde programs
+ ## You should not have to modify them ..
+
+ ## return a list of things
+ def make_list(e):
+ if type(e) is types.ListType:
+ return e
+ else:
+ return e.split()
+
+ #import SCons.Util
+ skel_ext = [".skel", ".SKEL"]
+ def KDEfiles(lenv, target, source):
+ """ Returns a list of files for scons (handles kde tricks like .skel)
+ It also makes custom checks against double includes like : ['file.ui', 'file.cpp']
+ (file.cpp is already included because of file.ui) """
+
+ src=[]
+ ui_files=[]
+ kcfg_files=[]
+ skel_files=[]
+ other_files=[]
+
+ source_=make_list(source)
+
+ # For each file, check wether it is a dcop file or not, and create the complete list of sources
+ for file in source_:
+ bs = SCons.Util.splitext(file)[0]
+ ext = SCons.Util.splitext(file)[1]
+ if ext in skel_ext:
+ lenv.Dcop(bs+'.h')
+ src.append(bs+'_skel.cpp')
+ elif ext == ".moch":
+ lenv.Moccpp(bs+'.h')
+ src.append(bs+'_moc.cpp')
+ else:
+ src.append(file)
+
+ if ext == '.ui':
+ ui_files.append(bs)
+ elif ext == '.kcfgc':
+ kcfg_files.append(bs)
+ elif ext == '.skel':
+ skel_files.append(bs)
+ else:
+ other_files.append(bs)
+
+ # Now check against typical newbie errors
+ for file in ui_files:
+ for ofile in other_files:
+ if ofile == file:
+ print RED+"WARNING: You have included "+file+".ui and another file of the same prefix"+NORMAL
+ print "Files generated by uic (file.h, file.cpp must not be included"
+ for file in kcfg_files:
+ for ofile in other_files:
+ if ofile == file:
+ print RED+"WARNING: You have included "+file+".kcfg and another file of the same prefix"+NORMAL
+ print "Files generated by kconfig_compiler (settings.h, settings.cpp) must not be included"
+ return src
+
+
+ """
+ In the future, these functions will contain the code that will dump the
+ configuration for re-use from an IDE
+ """
+ import glob
+ def KDEinstall(lenv, restype, subdir, files):
+ if not env['_INSTALL']:
+ return
+ basedir=env['DESTDIR']
+ if len(restype)>0:
+ if not lenv.has_key(restype):
+ print RED+"unknown resource type "+restype+NORMAL
+ else:
+ basedir += lenv[restype]+'/'
+ #print file # <- useful to trace stuff :)
+ install_list = env.Install(basedir+subdir+'/', files)
+ env.Alias('install', install_list)
+ return install_list
+
+ def KDEinstallas(lenv, restype, destfile, file):
+ if not env['_INSTALL']:
+ return
+ basedir=env['DESTDIR']
+ if len(restype)>0:
+ if not lenv.has_key(restype):
+ print RED+"unknown resource type "+restype+NORMAL
+ else:
+ basedir += lenv[restype]+'/'
+ install_list = env.InstallAs(basedir+destfile, file)
+ env.Alias('install', install_list)
+ return install_list
+
+ def KDEprogram(lenv, target, source):
+ """ Makes a kde program
+ The program is installed except if one sets env['NOAUTOINSTALL'] """
+ src = KDEfiles(lenv, target, source)
+ program_list = lenv.Program(target, src)
+ if not lenv.has_key('NOAUTOINSTALL'):
+ KDEinstall(lenv, 'KDEBIN', '', target)
+ return program_list
+
+ def KDEshlib(lenv, target, source, kdelib=0, libprefix='lib'):
+ """ Makes a shared library for kde (.la file for klibloader)
+ The library is installed except if one sets env['NOAUTOINSTALL'] """
+ src = KDEfiles(lenv, target, source)
+ lenv['LIBPREFIX']=libprefix
+ library_list = lenv.SharedLibrary(target, src)
+ lafile_list = lenv.LaFile(target, library_list)
+ if not lenv.has_key('NOAUTOINSTALL'):
+ install_dir = 'KDEMODULE'
+ if kdelib==1:
+ install_dir = 'KDELIBPATH'
+ KDEinstall(lenv, install_dir, '', library_list)
+ KDEinstall(lenv, install_dir, '', lafile_list)
+ return library_list
+
+ def KDEstaticlib(lenv, target, source):
+ """ Makes a static library for kde - in practice you should not use static libraries
+ 1. they take more memory than shared ones
+ 2. makefile.am needed it because of limitations
+ (cannot handle sources in separate folders - takes extra processing) """
+ src = KDEfiles(lenv, target, source)
+ return lenv.StaticLibrary(target, src)
+ # do not install static libraries by default
+
+ def KDEaddflags_cxx(lenv, fl):
+ """ Compilation flags for C++ programs """
+ lenv.AppendUnique(CXXFLAGS = make_list(fl))
+
+ def KDEaddflags_c(lenv, fl):
+ """ Compilation flags for C programs """
+ lenv.AppendUnique(CFLAGS = make_list(fl))
+
+ def KDEaddflags_link(lenv, fl):
+ """ Add link flags - Use this if KDEaddlibs below is not enough """
+ lenv.AppendUnique(LINKFLAGS = make_list(fl))
+
+ def KDEaddlibs(lenv, libs):
+ """ Helper function """
+ lenv.AppendUnique(LIBS = make_list(libs))
+
+ def KDEaddpaths_includes(lenv, paths):
+ """ Add new include paths """
+ lenv.AppendUnique(CPPPATH = make_list(paths))
+
+ def KDEaddpaths_libs(lenv, paths):
+ """ Add paths to libraries """
+ lenv.AppendUnique(LIBPATH = make_list(paths))
+
+ def KDElang(lenv, folder, appname):
+ """ Process translations (.po files) in a po/ dir """
+ transfiles = glob.glob(folder+'/*.po')
+ for lang in transfiles:
+ result = lenv.Transfiles(lang)
+ country = SCons.Util.splitext(result[0].name)[0]
+ KDEinstallas(lenv, 'KDELOCALE', country+'/LC_MESSAGES/'+appname+'.mo', result)
+
+ def subdirs(lenv, folderlist):
+ flist=make_list(folderlist)
+ for i in flist:
+ lenv.SConscript(i+"/SConscript")
+
+ def KDEicon(lenv, icname='*', path='./'):
+ """ Emulates the behaviour of Makefile.am to install icons
+ Contributed by: "Andrey Golovizin" <grooz@gorodok@net> """
+ type_dic = { 'action' : 'actions', 'app' : 'apps', 'device' :
+ 'devices', 'filesys' : 'filesystems', 'mime' : 'mimetypes' }
+ dir_dic = {
+ 'los' :'locolor/16x16',
+ 'lom' :'locolor/32x32',
+ 'him' :'hicolor/32x32',
+ 'hil' :'hicolor/48x48',
+ 'lo16' :'locolor/16x16',
+ 'lo22' :'locolor/22x22',
+ 'lo32' :'locolor/32x32',
+ 'hi16' :'hicolor/16x16',
+ 'hi22' :'hicolor/22x22',
+ 'hi32' :'hicolor/32x32',
+ 'hi48' :'hicolor/48x48',
+ 'hi64' :'hicolor/64x64',
+ 'hi128':'hicolor/128x128',
+ 'hisc' :'hicolor/scalable',
+ 'cr16' :'crystalsvg/16x16',
+ 'cr22' :'crystalsvg/22x22',
+ 'cr32' :'crystalsvg/32x32',
+ 'cr48' :'crystalsvg/48x48',
+ 'cr64' :'crystalsvg/64x64',
+ 'cr128':'crystalsvg/128x128',
+ 'crsc' :'crystalsvg/scalable'
+ }
+
+ iconfiles = []
+ for ext in "png xpm mng svg svgz".split():
+ files = glob.glob(path+'/'+'*-*-%s.%s' % (icname, ext))
+ iconfiles += files
+ for iconfile in iconfiles:
+ lst = iconfile.split('/')
+ filename = lst[ len(lst) - 1 ]
+ tmp = filename.split('-')
+ if len(tmp)!=3:
+ print RED+'WARNING: icon filename has unknown format: '+iconfile+NORMAL
+ continue
+ [icon_dir, icon_type, icon_filename]=tmp
+ try:
+ destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename)
+ except KeyError:
+ print RED+'WARNING: unknown icon type: '+iconfile+NORMAL
+ continue
+ ## Do not use KDEinstallas here, as parsing from an ide will be necessary
+ if env['_INSTALL']:
+ env.Alias('install', env.InstallAs( env['DESTDIR']+'/'+destfile, iconfile ) )
+
+ def KDEuse(lenv, flags):
+ _flags=make_list(flags)
+ if 'environ' in _flags:
+ ## The scons developers advise against using this but it is mostly innocuous :)
+ import os
+ lenv.AppendUnique( ENV = os.environ )
+ if not 'lang_qt' in _flags:
+ ## Use this define if you are using the kde translation scheme (.po files)
+ lenv.Append( CPPFLAGS = '-DQT_NO_TRANSLATION' )
+ if 'rpath' in _flags:
+ ## Use this to set rpath - this may cause trouble if folders are moved (chrpath)
+ lenv.Append( RPATH = [env['QTLIBPATH'], env['KDELIBPATH'], env['KDEMODULE']] )
+ if 'thread' in _flags:
+ ## Uncomment the following if you need threading support
+ lenv.KDEaddflags_cxx( ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
+ if not 'nohelp' in _flags:
+ if lenv['_CONFIGURE'] or lenv['HELP']:
+ env.Exit(0)
+
+ ## To use kdDebug(intvalue)<<"some trace"<<endl; you need to define -DDEBUG
+ ## it is done in admin/generic.py automatically when you do scons configure debug=1
+
+ # Attach the functions to the environment so that sconscripts can use them
+ from SCons.Script.SConscript import SConsEnvironment
+ SConsEnvironment.KDEprogram = KDEprogram
+ SConsEnvironment.KDEshlib = KDEshlib
+ SConsEnvironment.KDEstaticlib = KDEstaticlib
+ SConsEnvironment.KDEinstall = KDEinstall
+ SConsEnvironment.KDEinstallas = KDEinstallas
+ SConsEnvironment.KDElang = KDElang
+ SConsEnvironment.KDEicon = KDEicon
+
+ SConsEnvironment.KDEaddflags_cxx = KDEaddflags_cxx
+ SConsEnvironment.KDEaddflags_c = KDEaddflags_c
+ SConsEnvironment.KDEaddflags_link = KDEaddflags_link
+ SConsEnvironment.KDEaddlibs = KDEaddlibs
+ SConsEnvironment.KDEaddpaths_includes = KDEaddpaths_includes
+ SConsEnvironment.KDEaddpaths_libs = KDEaddpaths_libs
+
+ SConsEnvironment.subdirs = subdirs
+ SConsEnvironment.KDEuse = KDEuse
+
diff --git a/parts/appwizard/common/scons/admin/scons-mini.tar.bz2 b/parts/appwizard/common/scons/admin/scons-mini.tar.bz2
new file mode 100644
index 00000000..0c1ce52e
--- /dev/null
+++ b/parts/appwizard/common/scons/admin/scons-mini.tar.bz2
Binary files differ
diff --git a/parts/appwizard/common/scons/configure b/parts/appwizard/common/scons/configure
new file mode 100755
index 00000000..289a6843
--- /dev/null
+++ b/parts/appwizard/common/scons/configure
@@ -0,0 +1,87 @@
+#! /bin/sh
+# Fancy colors used to beautify the output a bit.
+#
+NORMAL="\033[0m"
+BOLD="\033[1m"
+RED="\033[91m"
+YELLOW="\033[93m"
+GREEN="\033[92m"
+
+# Checks for Python interpreter. Honours $PYTHON if set. Stores path to
+# interpreter in $PYTHON.
+#
+checkPython()
+{
+ if [ -z $PYTHON ]; then
+ PYTHON=`which python 2>/dev/null`
+ fi
+ echo -n "Checking for Python : "
+ if [ ! -x "$PYTHON" ]; then
+ echo -e $GREEN"not found!"$NORMAL
+ echo "Please make sure that the Python interpreter is available in your PATH"
+ echo "or invoke configure using the PYTHON flag, e.g."
+ echo "$ PYTHON=/usr/local/bin/python configure"
+ exit 1
+ fi
+ echo -e $GREEN"$PYTHON"$NORMAL
+}
+
+# Checks for SCons. Honours $SCONS if set. Stores path to 'scons' in $SCONS.
+# Requires that $PYTHON is set.
+#
+checkSCons()
+{
+ echo -n "Checking for SCons : "
+ if [ -z $SCONS ]; then
+ SCONS=`which scons 2>/dev/null`
+ fi
+ if [ ! -x "$SCONS" ]; then
+ echo -e $BOLD"not found, will use mini distribution."$NORMAL
+ tar xjf admin/scons-mini.tar.bz2
+ SCONS="./scons"
+ else
+ echo -e $GREEN"$SCONS"$NORMAL
+ fi
+ SCONS="$SCONS -Q"
+}
+
+# Generates a Makefile. Requires that $SCONS is set.
+#
+generateMakefile()
+{
+ cat > Makefile << EOF
+all:
+ @$SCONS
+
+# it is also possible to use
+# @$SCONS -j4
+
+install:
+ @$SCONS install
+
+clean:
+ @$SCONS -c
+
+uninstall:
+ @$SCONS -c install
+
+dist:
+ @$SCONS dist
+
+distclean:
+ @$SCONS -c
+ rm -rf cache/
+EOF
+}
+
+checkPython
+checkSCons
+
+if [[ "$1" == "--help" ]]; then
+ $SCONS --help
+ exit
+fi
+
+generateMakefile
+$SCONS configure $@
+
diff --git a/parts/appwizard/common/wx-Makefile.am b/parts/appwizard/common/wx-Makefile.am
new file mode 100644
index 00000000..af437a64
--- /dev/null
+++ b/parts/appwizard/common/wx-Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src
diff --git a/parts/appwizard/common/wx-Makefile.cvs b/parts/appwizard/common/wx-Makefile.cvs
new file mode 100644
index 00000000..4bbd3a59
--- /dev/null
+++ b/parts/appwizard/common/wx-Makefile.cvs
@@ -0,0 +1,5 @@
+default: all
+
+all:
+ srcdir=`pwd` sh macros/autogen.sh
+
diff --git a/parts/appwizard/common/wx-configure.in b/parts/appwizard/common/wx-configure.in
new file mode 100644
index 00000000..1b4ba73d
--- /dev/null
+++ b/parts/appwizard/common/wx-configure.in
@@ -0,0 +1,55 @@
+AC_INIT(src/%{APPNAMELC}.cpp)
+AM_INIT_AUTOMAKE(%{APPNAMELC}, %{VERSION})
+
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+
+CPPFLAGS="$CPPFLAGS -Wall -g -fexceptions"
+CXXFLAGS="$CXXFLAGS -Wall -g -fexceptions"
+
+WXCONFIG=wx-config
+AC_ARG_WITH(wx-config,
+[[ --with-wx-config=FILE Use the given path to wx-config when determining
+ wxWidgets configuration; defaults to "wx-config"]],
+[
+ if test "$withval" != "yes" -a "$withval" != ""; then
+ WXCONFIG=$withval
+ fi
+])
+
+wxversion=0
+
+AC_DEFUN([WXTEST],
+[
+ AC_REQUIRE([AC_PROG_AWK])
+ AC_MSG_CHECKING([wxWidgets version])
+ if wxversion=`$WXCONFIG --version`; then
+ AC_MSG_RESULT([$wxversion])
+ else
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
+ fi])
+
+# Call WXTEST func
+WXTEST
+
+# Verify minimus requires
+vers=`echo $wxversion | $AWK 'BEGIN { FS = "."; } { printf "% d", ($1 * 1000 + $2) * 1000 + $3;}'`
+if test -n "$vers" && test "$vers" -ge 2003003; then
+ WX_CPPFLAGS="`$WXCONFIG --cppflags`"
+ WX_CXXFLAGS="`$WXCONFIG --cxxflags | sed -e 's/-fno-exceptions//'`"
+ WX_LIBS="`$WXCONFIG --libs`"
+else
+ AC_MSG_ERROR([wxWidgets 2.3.3 or newer is required])
+fi
+
+
+CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
+CXXFLAGS="$CXXFLAGS $WX_CPPFLAGS"
+
+
+AC_SUBST(WX_LIBS)
+
+AC_OUTPUT(Makefile src/Makefile)
diff --git a/parts/appwizard/common/wx/macros/autogen.sh b/parts/appwizard/common/wx/macros/autogen.sh
new file mode 100755
index 00000000..97cce9df
--- /dev/null
+++ b/parts/appwizard/common/wx/macros/autogen.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+aclocal
+libtoolize --automake --force --copy
+automake -a -c
+autoconf
+
diff --git a/parts/appwizard/filepropspage.cpp b/parts/appwizard/filepropspage.cpp
new file mode 100644
index 00000000..8b60e369
--- /dev/null
+++ b/parts/appwizard/filepropspage.cpp
@@ -0,0 +1,88 @@
+#include "filepropspage.h"
+#include <qlistbox.h>
+#include <klineedit.h>
+#include <qtextview.h>
+#include <klocale.h>
+#include <qlabel.h>
+#include <qmultilineedit.h>
+
+/*
+ * Constructs a FilePropsPage which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+FilePropsPage::FilePropsPage( QWidget* parent, const char* name, WFlags fl )
+ : FilePropsPageBase( parent, name, fl ){
+ m_props = new QPtrList<ClassFileProp>;
+ m_current_class = 9999; // no current
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+FilePropsPage::~FilePropsPage()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * public slot
+ */
+void FilePropsPage::slotSelectionChanged()
+{
+ int item = classes_listbox->currentItem();
+ ClassFileProp* prop;
+ // save the old values
+ if (m_current_class != 9999){ // != no selected
+ prop = m_props->at(m_current_class);
+ prop->m_classname = classname_edit->text();
+ prop->m_headerfile = headerfile_edit->text();
+ if(m_different_header_impl){
+ prop->m_implfile = implfile_edit->text();
+ }
+ if(prop->m_change_baseclass){
+ prop->m_baseclass = baseclass_edit->text();
+ }
+ }
+ prop = m_props->at(item);
+ classname_edit->setText(prop->m_classname);
+ desc_textview->setText(prop->m_description);
+ headerfile_edit->setText(prop->m_headerfile);
+ if(m_different_header_impl){
+ implfile_edit->setText(prop->m_implfile);
+ }
+ baseclass_edit->setText(prop->m_baseclass);
+ if(prop->m_change_baseclass){
+ baseclass_edit->setEnabled(true);
+ }
+ else {
+ baseclass_edit->setEnabled(false);
+ }
+ m_current_class = item;
+}
+
+void FilePropsPage::setClassFileProps(QPtrList<ClassFileProp> props,bool different_header_impl){
+ *m_props = props;
+ m_different_header_impl = different_header_impl;
+ if (!m_different_header_impl){
+ implfile_edit->hide();
+ implfile_label->hide();
+ headerfile_label->setText(i18n("Header/Implementation file:"));
+
+ }
+ // fill the listbox
+ ClassFileProp* prop;
+ for ( prop=m_props->first(); prop != 0; prop=m_props->next() ){
+ classes_listbox->insertItem(prop->m_classname);
+ }
+ classes_listbox->setSelected(0,true);
+ slotSelectionChanged();
+}
+
+QPtrList<ClassFileProp> FilePropsPage::getClassFileProps(){
+ return *m_props;
+}
+void FilePropsPage::slotClassnameChanged(const QString& text){
+ classes_listbox->changeItem(text, classes_listbox->currentItem());
+}
+
+#include "filepropspage.moc"
diff --git a/parts/appwizard/filepropspage.h b/parts/appwizard/filepropspage.h
new file mode 100644
index 00000000..3435dfa2
--- /dev/null
+++ b/parts/appwizard/filepropspage.h
@@ -0,0 +1,42 @@
+#ifndef FILEPROPSPAGE_H
+#define FILEPROPSPAGE_H
+#include "filepropspagebase.h"
+#include <qstring.h>
+#include <qptrlist.h>
+
+
+class ClassFileProp {
+ public:
+ QString m_classname;
+ QString m_implfile;
+ QString m_headerfile;
+ QString m_baseclass;
+ QString m_description; // rich text
+ /** to idetify this object*/
+ QString m_key;
+ bool m_change_baseclass;
+};
+
+class FilePropsPage : public FilePropsPageBase
+{
+ Q_OBJECT
+
+public:
+ FilePropsPage( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~FilePropsPage();
+ void setClassFileProps(QPtrList<ClassFileProp> props,bool different_header_impl=true);
+ QPtrList<ClassFileProp> getClassFileProps();
+
+public slots:
+ void slotSelectionChanged();
+ virtual void slotClassnameChanged(const QString&);
+ protected:
+
+ QPtrList<ClassFileProp>* m_props;
+ bool m_different_header_impl;
+ uint m_current_class;
+
+};
+
+
+#endif // FILEPROPSPAGE_H
diff --git a/parts/appwizard/filepropspagebase.ui b/parts/appwizard/filepropspagebase.ui
new file mode 100644
index 00000000..2137d685
--- /dev/null
+++ b/parts/appwizard/filepropspagebase.ui
@@ -0,0 +1,168 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>FilePropsPageBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>410</width>
+ <height>366</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>GroupBox7</cstring>
+ </property>
+ <property name="title">
+ <string>Customize</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Class name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>classname_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Base class:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>baseclass_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>headerfile_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1">
+ <property name="name">
+ <cstring>implfile_label</cstring>
+ </property>
+ <property name="text">
+ <string>Implementation file:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>headerfile_label</cstring>
+ </property>
+ <property name="text">
+ <string>Header file:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>implfile_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Classes:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>TextLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Description:</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="1" column="0">
+ <property name="name">
+ <cstring>classes_listbox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QMultiLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>desc_textview</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="wordWrap">
+ <enum>WidgetWidth</enum>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>classname_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>Form1</receiver>
+ <slot>slotClassnameChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>classes_listbox</sender>
+ <signal>mouseButtonClicked(int,QListBoxItem*,const QPoint&amp;)</signal>
+ <receiver>Form1</receiver>
+ <slot>slotSelectionChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>classes_listbox</tabstop>
+ <tabstop>classname_edit</tabstop>
+ <tabstop>headerfile_edit</tabstop>
+ <tabstop>baseclass_edit</tabstop>
+ <tabstop>implfile_edit</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>slotSelectionChanged()</slot>
+ <slot>slotClassnameChanged(const QString&amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/appwizard/importdlg.cpp b/parts/appwizard/importdlg.cpp
new file mode 100644
index 00000000..b900181d
--- /dev/null
+++ b/parts/appwizard/importdlg.cpp
@@ -0,0 +1,582 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "importdlg.h"
+#include <stdlib.h>
+#include <qcombobox.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include <qtooltip.h>
+#include <qcheckbox.h>
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <kdialog.h>
+#include <kfiledialog.h>
+#include <kinstance.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+#include <kcursor.h>
+#include <kfile.h>
+#include <kurlrequester.h>
+#include <ktrader.h>
+#include <kparts/componentfactory.h>
+#include <kprocess.h>
+
+#include "kdevcore.h"
+#include "kdevversioncontrol.h"
+#include "kdevplugincontroller.h"
+
+#include "domutil.h"
+#include "settings.h"
+#include "profile.h"
+#include "profileengine.h"
+
+#include "appwizardfactory.h"
+#include "appwizardpart.h"
+#include "misc.h"
+
+
+ImportDialog::ImportDialog(AppWizardPart *part, QWidget *parent, const char *name)
+ : ImportDialogBase(parent, name, true), m_part(part)
+{
+ QString author, email;
+ AppWizardUtil::guessAuthorAndEmail(&author, &email);
+ author_edit->setText(author);
+ email_edit->setText(email);
+ QToolTip::add( urlinput_edit->button(), i18n("Choose directory to import") );
+ urlinput_edit->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly);
+
+ KStandardDirs *dirs = AppWizardFactory::instance()->dirs();
+ importNames = dirs->findAllResources("appimports", QString::null, false, true);
+ importNames.sort();
+
+ QStringList::ConstIterator it;
+ for (it = importNames.begin(); it != importNames.end(); ++it) {
+ KConfig config(KGlobal::dirs()->findResource("appimports", *it));
+ config.setGroup("General");
+ QString type = config.readEntry("Comment");
+ project_combo->insertItem(type);
+
+ if (config.hasGroup("Infrastructure"))
+ {
+ config.setGroup("Infrastructure");
+ m_infrastructure[type].isOn = true;
+ m_infrastructure[type].comment = config.readEntry("Comment");
+ m_infrastructure[type].command = config.readEntry("Command");
+ m_infrastructure[type].existingPattern = config.readEntry("ExistingProjectPattern");
+ }
+ else
+ m_infrastructure[type].isOn = false;
+ }
+
+ infrastructureBox->setEnabled(false);
+ setProjectType("c");
+ connect( name_edit, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotProjectNameChanged( const QString & ) ) );
+// scanAvailableVCS();
+ connect( fetchModuleButton, SIGNAL(clicked()),
+ this, SLOT(slotFetchModulesFromRepository()) );
+ connect(urlinput_edit, SIGNAL(urlSelected(const QString& )), this, SLOT(dirChanged()));
+ connect(urlinput_edit, SIGNAL(returnPressed(const QString& )), this, SLOT(dirChanged()));
+ slotProjectNameChanged( name_edit->text() );
+}
+
+
+ImportDialog::~ImportDialog()
+{}
+
+void ImportDialog::slotProjectNameChanged( const QString &_text )
+{
+ ok_button->setEnabled( !_text.isEmpty() && !urlinput_edit->url().contains( QRegExp("\\s") ) );
+}
+
+void ImportDialog::accept()
+{
+ QDir dir(urlinput_edit->url());
+ if (urlinput_edit->url().isEmpty() || !dir.exists()) {
+ KMessageBox::sorry(this, i18n("You have to choose a directory."));
+ return;
+ }
+
+ QString projectName = name_edit->text();
+ if (projectName.isEmpty()) {
+ KMessageBox::sorry(this, i18n("You have to choose a project name."));
+ return;
+ }
+
+ for (uint i=0; i < projectName.length(); ++i)
+ if (!projectName[i].isLetterOrNumber() && projectName[i] != '_') {
+ KMessageBox::sorry(this, i18n("Your application name should only contain letters and numbers."));
+ return;
+ }
+
+ if (infrastructureBox->isVisible() && infrastructureBox->isChecked())
+ createProjectInfrastructure();
+
+// QString author = author_edit->text();
+// QString email = email_edit->text();
+
+ QFileInfo finfo(importNames[project_combo->currentItem()]);
+ QDir importdir(finfo.dir());
+ importdir.cdUp();
+ QFile src(importdir.filePath("importfiles/" + finfo.fileName() + ".kdevelop"));
+ kdDebug(9010) << "Import template " << src.name() << endl;
+ if (!src.open(IO_ReadOnly)) {
+ KMessageBox::sorry(this, i18n("Cannot open project template."));
+ return;
+ }
+
+ // Read the DOM of the newly created project
+ QDomDocument projectDOM;
+
+ int errorLine, errorCol;
+ QString errorMsg;
+ bool success = projectDOM.setContent( &src, &errorMsg, &errorLine, &errorCol);
+ src.close();
+ if ( !success )
+ {
+ KMessageBox::sorry( 0, i18n("This is not a valid project file.\n"
+ "XML error in line %1, column %2:\n%3")
+ .arg(errorLine).arg(errorCol).arg(errorMsg));
+ return;
+ }
+
+ DomUtil::writeEntry( projectDOM, "/general/author", author_edit->text() );
+ DomUtil::writeEntry( projectDOM, "/general/email" , email_edit->text() );
+ DomUtil::writeEntry( projectDOM, "/general/projectname", name_edit->text() );
+ if ( !projectVersion.isNull()){
+ DomUtil::writeEntry( projectDOM, "/general/version", projectVersion );
+ } else {
+ DomUtil::writeEntry( projectDOM, "/general/version", "1" );
+ }
+
+ // figure out what plugins we should disable by default
+ QString profileName = DomUtil::readEntry( projectDOM, "general/profile" );
+ if ( profileName.isEmpty() )
+ {
+ QString language = DomUtil::readEntry( projectDOM, "general/primarylanguage" );
+ QStringList keywords = DomUtil::readListEntry( projectDOM, "general/keywords", "keyword" );
+
+ profileName = Settings::profileByAttributes( language, keywords );
+ }
+
+ ProfileEngine & engine = m_part->pluginController()->engine();
+ Profile * profile = engine.findProfile( profileName );
+
+ QStringList disableList;
+ Profile::EntryList disableEntryList = profile->list( Profile::ExplicitDisable );
+ for ( Profile::EntryList::const_iterator it = disableEntryList.constBegin(); it != disableEntryList.constEnd(); ++it )
+ {
+ disableList << (*it).name;
+ }
+
+ DomUtil::writeListEntry( projectDOM, "/general/ignoreparts", "part", disableList );
+
+
+ // write the dom back
+ QFile dest(dir.filePath(projectName + ".kdevelop"));
+ if (!dest.open(IO_WriteOnly)) {
+ KMessageBox::sorry(this, i18n("Cannot write the project file."));
+ return;
+ }
+ QTextStream ts( &dest );
+ ts.setEncoding(QTextStream::UnicodeUTF8);
+ ts << projectDOM.toString(2);
+ dest.close();
+
+
+// QTextStream srcstream(&src);
+// QTextStream deststream(&dest);
+//
+// while (!srcstream.atEnd()) {
+// QString line = srcstream.readLine();
+// line.replace(QRegExp("\\$APPNAMELC\\$"), projectName);
+// line.replace(QRegExp("\\$AUTHOR\\$"), author);
+// line.replace(QRegExp("\\$EMAIL\\$"), email);
+// deststream << line << endl;
+// }
+//
+// dest.close();
+// src.close();
+
+ m_part->core()->openProject(dir.filePath(projectName + ".kdevelop"));
+
+ kdDebug(9010) << "OPENING PROJECT: " << dir.filePath(projectName + ".kdevelop") << endl;
+
+ QDialog::accept();
+}
+
+
+// Checks if the directory dir and all of its subdirectories
+// (one level recursion) have files that follow patterns
+// patterns is comma-separated
+static bool dirHasFiles(QDir &dir, const QString &patterns)
+{
+ QStringList::ConstIterator pit, sit;
+
+ QStringList patternList = QStringList::split(",", patterns);
+ for (pit = patternList.begin(); pit != patternList.end(); ++pit) {
+ if (!dir.entryList(*pit, QDir::Files).isEmpty()) {
+ kdDebug(9010) << "Has files " << (*pit) << endl;
+ return true;
+ }
+ }
+
+ QStringList subdirList = dir.entryList("*", QDir::Dirs);
+ for (sit = subdirList.begin(); sit != subdirList.end(); ++sit) {
+ QDir subdir(dir);
+ subdir.cd(*sit);
+ for (pit = patternList.begin(); pit != patternList.end(); ++pit) {
+ if (!subdir.entryList(*pit, QDir::Files).isEmpty()) {
+ kdDebug(9010) << "Has files " << (*pit) << " in " << (*sit) << endl;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+
+void ImportDialog::dirChanged()
+{
+ kdDebug(9010) << "ImportDialog::dirChanged" << endl;
+ QString dirName = urlinput_edit->url();
+ QDir dir(dirName);
+ if (!dir.exists())
+ return;
+
+ if ( dirName.contains( QRegExp("\\s") ) )
+ {
+ ok_button->setEnabled( false );
+ return;
+ }else
+ {
+ ok_button->setEnabled( true );
+ }
+
+ // KDevelop legacy project?
+ QStringList files = dir.entryList("*.kdevprj");
+ if (!files.isEmpty()) {
+ scanLegacyKDevelopProject(dir.absFilePath(files.first()));
+ return;
+ }
+
+ // Studio legacy project?
+ files = dir.entryList("*.studio");
+ if (!files.isEmpty()) {
+ scanLegacyStudioProject(dir.absFilePath(files.first()));
+ return;
+ }
+
+ // Automake based?
+ if ( dir.exists("configure.in.in")|| dir.exists("configure.ac")|| dir.exists("configure.in")) {
+ scanAutomakeProject(dirName);
+ return;
+ }
+
+ // Remove any characters from the dirName that would be invalid in a project name
+ QString projectName(dir.dirName().replace(QRegExp("[^a-zA-Z0-9_]"), "_"));
+
+ // Set the project name
+ name_edit->setText(projectName);
+
+ // QMake based?
+ files = dir.entryList("*.pro");
+ if (!files.isEmpty()) {
+ setProjectType("qtqmake");
+ return;
+ }
+
+ // C++?
+ if (dirHasFiles(dir, "*.cpp,*.c++,*.cxx,*.C,*.cc,*.ocl")) {
+ setProjectType("cpp");
+ return;
+ }
+
+ // Fortran?
+ if (dirHasFiles(dir, "*.f77,*.f,*.for,*.ftn")) {
+ setProjectType("fortran");
+ return;
+ }
+
+ // Python?
+ if (dirHasFiles(dir, "*.py")) {
+ setProjectType("python");
+ return;
+ }
+
+ // Perl?
+ if (dirHasFiles(dir, "*.pl,*.pm")) {
+ setProjectType("perl");
+ return;
+ }
+}
+
+
+void ImportDialog::scanLegacyKDevelopProject(const QString &fileName)
+{
+ kdDebug(9010) << "Scanning legacy KDevelop project file " << fileName << endl;
+
+ KSimpleConfig config(fileName, true);
+ config.setGroup("General");
+ author_edit->setText(config.readEntry("author"));
+ email_edit->setText(config.readEntry("email"));
+ name_edit->setText(config.readEntry("project_name"));
+
+ QString legacyType = config.readEntry("project_type");
+ if (QStringList::split(",", "normal_kde,normal_kde2,kde2_normal,mdi_kde2").contains(legacyType))
+ setProjectType("kde");
+ else if (legacyType == "normal_gnome")
+ setProjectType("gnome");
+ else if (legacyType == "normal_empty")
+ setProjectType("cpp-auto");
+ else
+ setProjectType("cpp");
+}
+
+
+void ImportDialog::scanLegacyStudioProject(const QString &fileName)
+{
+ kdDebug(9010) << "Scanning legacy studio project file " << fileName << endl;
+
+ // Not much to do here...
+ KSimpleConfig config(fileName, true);
+ config.setGroup("kdestudio");
+ name_edit->setText(config.readEntry("Name"));
+}
+
+
+void ImportDialog::scanAutomakeProject(const QString &dirName)
+{
+ kdDebug(9010) << "Scanning automake project directory " << dirName << endl;
+
+ bool stop = false;
+ if (QFile::exists(dirName + "/admin/am_edit")) {
+ setProjectType("kde");
+ stop = true;
+ } else if (QFile::exists(dirName + "/macros/gnome.m4")) {
+ setProjectType("gnome");
+ stop = true;
+ } else {
+ setProjectType("c-auto");
+ }
+
+ // if we get an authors file, use it.
+ QFile af(dirName + "/AUTHORS");
+ if (af.open(IO_ReadOnly)){
+ QTextStream astream(&af);
+
+ QRegExp authorre("(.*)<(.*)>");
+ while (!astream.atEnd()) {
+ QString s = astream.readLine();
+ if (authorre.search(s) != -1) {
+ author_edit->setText(authorre.cap(1).stripWhiteSpace());
+ email_edit->setText(authorre.cap(2).stripWhiteSpace());
+ break;
+ }
+ }
+ af.close();
+ }
+
+ // we ignore old AC_INIT that had no version..
+ // only match the if there is a comma and at least two args..
+ // AC_INIT (package, version, [bug-report], [tarname])
+ QRegExp ac_init("^AC_INIT\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)");
+
+ // AM_INIT_AUTOMAKE([OPTIONS])
+ // example: AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2])
+ QRegExp am_autoSpace("^AM_INIT_AUTOMAKE\\s{0,}\\(\\s{0,}([\\[\\s]{0,}[^\\s]+)\\s+([^\\s\\)\\]]+)(.*)");
+
+ // AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+ QRegExp am_autoComma("^AM_INIT_AUTOMAKE\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)");
+
+ // look for version in a define.
+ // AC_DEFINE(VERSION, "5.6")
+ QRegExp ac_define("^AC_DEFINE\\s*\\(\\s*[^,]+,([^\\)]+)");
+ QRegExp version("(\\bversion\\b)");
+ version.setCaseSensitive(FALSE);
+
+ QTextStream cstream;
+ // try for configure.in.in, configure.in, then configure.ac
+ QFile configInIn(dirName + "/configure.in.in");
+ QFile configIn(dirName+"/configure.in");
+ QFile configAc(dirName+"/configure.ac");
+ if (configInIn.open(IO_ReadOnly)){
+ cstream.setDevice(&configInIn);
+ while (!cstream.atEnd()) {
+ QString line = cstream.readLine();
+ if ( ac_init.search(line) >= 0){
+ projectVersion=ac_init.cap(2).stripWhiteSpace();
+ }
+ else if ( am_autoComma.search(line) >= 0 ){
+ projectVersion=am_autoComma.cap(2).stripWhiteSpace();
+ }
+ else if ( am_autoSpace.search(line) >= 0 ){
+ projectVersion=am_autoSpace.cap(2).stripWhiteSpace();
+ }
+ else if ( ac_define.search(line) >=0 && version.search(line) >=0) {
+ projectVersion=ac_define.cap(2).stripWhiteSpace();
+ }
+ }
+ configInIn.close();
+ }
+
+ if (configIn.open(IO_ReadOnly)){
+ cstream.setDevice(&configIn);
+ }
+ else{
+ if (configAc.open(IO_ReadOnly)){
+ cstream.setDevice(&configAc);
+ }
+ else{
+ return;
+ }
+ }
+
+ QRegExp namere("\\s*AM_INIT_AUTOMAKE\\((.*),.*\\).*");
+ QRegExp cppre("\\s*AC_PROG_CXX");
+ QRegExp f77re("\\s*AC_PROG_F77");
+ while (!cstream.atEnd()) {
+ QString line = cstream.readLine();
+ if ( ac_init.search(line) >= 0){
+ projectVersion=ac_init.cap(2).stripWhiteSpace();
+ }
+ else if ( am_autoComma.search(line) >= 0 ){
+ projectVersion=am_autoComma.cap(2).stripWhiteSpace();
+ }
+ else if ( am_autoSpace.search(line) >= 0 ){
+ projectVersion=am_autoSpace.cap(2).stripWhiteSpace();
+ }
+ else if ( ac_define.search(line) >=0 && version.search(line) >=0) {
+ projectVersion=ac_define.cap(2).stripWhiteSpace();
+ }
+
+ if (namere.search(line) == 0)
+ name_edit->setText(namere.cap(1).stripWhiteSpace());
+ if (!stop)
+ continue;
+ else if (cppre.search(line) == 0)
+ setProjectType("cpp-auto");
+ else if (f77re.search(line) == 0)
+ setProjectType("fortran-auto");
+ }
+
+ if ( configIn.isOpen()) configIn.close();
+ if ( configAc.isOpen()) configAc.close();
+}
+
+
+void ImportDialog::setProjectType(const QString &type)
+{
+ kdDebug(9010) << "Setting project type " << type << endl;
+ QString suffix = "/" + type;
+ int suffixLength = suffix.length();
+
+ int i=0;
+ QStringList::ConstIterator it;
+ for (it = importNames.begin(); it != importNames.end(); ++it) {
+ if ((*it).right(suffixLength) == suffix) {
+ project_combo->setCurrentItem(i);
+ break;
+ }
+ ++i;
+ }
+}
+/*
+void ImportDialog::scanAvailableVCS()
+{
+// vcsCombo->insertStringList( m_part->registeredVersionControls() );
+ int i = 0;
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/VersionControl");
+ KTrader::OfferList::const_iterator it = offers.begin();
+ while( it != offers.end() )
+ {
+ vcsCombo->insertItem( (*it)->genericName(), i++ );
+ ++it;
+ }
+}
+*/
+/*
+void ImportDialog::slotFinishedCheckout( QString destinationDir )
+{
+ urlinput_edit->setURL( destinationDir );
+
+ setCursor( KCursor::arrowCursor() );
+// setEnabled( true );
+}
+*/
+/*
+void ImportDialog::slotFetchModulesFromRepository()
+{
+
+ KDevVersionControl *vcs = m_part->versionControlByName( vcsCombo->currentText() );
+ if (!vcs)
+ return;
+
+ setCursor( KCursor::waitCursor() );
+// setEnabled( false );
+
+ connect( vcs, SIGNAL(finishedFetching(QString)),
+ this, SLOT(slotFinishedCheckout(QString)) );
+
+ //restore cursor if we can't fetch repository
+ if ( !vcs->fetchFromRepository() )
+ setCursor( KCursor::arrowCursor() );
+
+}
+*/
+void ImportDialog::projectTypeChanged( const QString &type )
+{
+ if (m_infrastructure[type].isOn)
+ {
+ infrastructureBox->setEnabled(true);
+ infrastructureBox->setText(m_infrastructure[type].comment);
+ }
+ else
+ {
+ infrastructureBox->setEnabled(false);
+ infrastructureBox->setText(i18n("Generate build system infrastrucure"));
+ }
+}
+
+void ImportDialog::createProjectInfrastructure( )
+{
+ kdDebug(9010) << "ImportDialog::createProjectInfrastructure" << endl;
+ InfrastructureCmd cmd = m_infrastructure[project_combo->currentText()];
+ if (!cmd.isOn)
+ return;
+
+ QDir dir (urlinput_edit->url());
+ QStringList files = dir.entryList(cmd.existingPattern);
+ if (!files.isEmpty()) {
+ if (KMessageBox::questionYesNo(this, i18n("Project infrastrucure already exists in target directory.\nGenerate new project infrastructure and overwrite old?"), QString::null, i18n("Generate"), i18n("Do Not Generate")) == KMessageBox::No)
+ return;
+ }
+
+ QString command = "cd " + urlinput_edit->url() + " && " + cmd.command;
+ kdDebug(9010) << "executing " << command.ascii() << endl;
+ system(command.ascii());
+}
+
+void ImportDialog::projectTypeChanged( int type )
+{
+ projectTypeChanged(project_combo->text(type));
+}
+
+
+#include "importdlg.moc"
diff --git a/parts/appwizard/importdlg.h b/parts/appwizard/importdlg.h
new file mode 100644
index 00000000..daa136b6
--- /dev/null
+++ b/parts/appwizard/importdlg.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _IMPORTDLG_H_
+#define _IMPORTDLG_H_
+
+#include "importdlgbase.h"
+#include <qstringlist.h>
+
+
+class AppWizardPart;
+
+struct InfrastructureCmd{
+ bool isOn;
+ QString comment;
+ QString command;
+ QString existingPattern;
+};
+
+class ImportDialog : public ImportDialogBase
+{
+ Q_OBJECT
+
+public:
+ ImportDialog( AppWizardPart *part, QWidget *parent=0, const char *name=0 );
+ ~ImportDialog();
+
+protected:
+ virtual void accept();
+
+protected slots:
+ virtual void dirChanged();
+ virtual void projectTypeChanged(const QString &type);
+ virtual void projectTypeChanged(int type);
+
+private slots:
+// void slotFinishedCheckout( QString destinationDir );
+// void slotFetchModulesFromRepository();
+ void slotProjectNameChanged( const QString &_text );
+private:
+// void scanAvailableVCS();
+ void scanLegacyKDevelopProject(const QString &fileName);
+ void scanLegacyStudioProject(const QString &fileName);
+ void scanAutomakeProject(const QString &dirName);
+ void setProjectType(const QString &type);
+
+ void createProjectInfrastructure();
+
+ QStringList importNames;
+ AppWizardPart *m_part;
+ QString projectVersion;
+
+ QMap<QString, InfrastructureCmd> m_infrastructure;
+};
+
+#endif
diff --git a/parts/appwizard/importdlgbase.ui b/parts/appwizard/importdlgbase.ui
new file mode 100644
index 00000000..101c8c58
--- /dev/null
+++ b/parts/appwizard/importdlgbase.ui
@@ -0,0 +1,365 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ImportDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>import_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>437</width>
+ <height>293</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Import Existing Project</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>dir_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>urlinput_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>vcsCombo</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>fetchModuleButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Fetch &amp;Module</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Fetch from:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>vcsCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>name_label</cstring>
+ </property>
+ <property name="text">
+ <string>Project &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>name_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>name_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="10" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QComboBox" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>project_combo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>project_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Project type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>project_combo</cstring>
+ </property>
+ </widget>
+ <widget class="Line" row="9" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>urlinput_edit</cstring>
+ </property>
+ </widget>
+ <spacer row="8" column="2">
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="7" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Email:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>email_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="7" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>email_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>If there exists a file AUTHOR in the
+directory, and it has email addresses
+formated as XXXX &lt;.....&gt; the XXXX
+will be the author, everything between
+&lt;....&gt; is the email address.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>author_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>If there exists a file AUTHOR in the
+directory, and it has email addresses
+formated as XXXX &lt;.....&gt; the XXXX
+will be the author, everything between
+&lt;....&gt; is the email address.</string>
+ </property>
+ </widget>
+ <spacer row="5" column="2">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>author_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Author:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>author_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>infrastructureBox</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Generate build system infrastructure</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>import_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>import_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>project_combo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>import_dialog</receiver>
+ <slot>projectTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>project_combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>import_dialog</receiver>
+ <slot>projectTypeChanged(int)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>urlinput_edit</tabstop>
+ <tabstop>vcsCombo</tabstop>
+ <tabstop>fetchModuleButton</tabstop>
+ <tabstop>name_edit</tabstop>
+ <tabstop>project_combo</tabstop>
+ <tabstop>author_edit</tabstop>
+ <tabstop>email_edit</tabstop>
+ <tabstop>ok_button</tabstop>
+ <tabstop>cancel_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">dirButtonClicked()</slot>
+ <slot>dirChanged()</slot>
+ <slot access="protected">projectTypeChanged(const QString &amp;)</slot>
+ <slot access="protected">projectTypeChanged(int)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/appwizard/imports/.kdev_ignore b/parts/appwizard/imports/.kdev_ignore
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/parts/appwizard/imports/.kdev_ignore
diff --git a/parts/appwizard/imports/Makefile.am b/parts/appwizard/imports/Makefile.am
new file mode 100644
index 00000000..5047de18
--- /dev/null
+++ b/parts/appwizard/imports/Makefile.am
@@ -0,0 +1,7 @@
+appwizarddatadir = ${kde_datadir}/kdevappwizard
+importsdir = ${appwizarddatadir}/imports
+importfilesdir = ${appwizarddatadir}/importfiles
+
+imports_DATA = c-auto cpp-auto fortran-auto java-auto kde gnome c cpp fortran python php perl java java-ant qttmake qtqmake qt4qmake ruby pascal ada
+importfiles_DATA = c-auto.kdevelop cpp-auto.kdevelop fortran-auto.kdevelop java-auto.kdevelop kde.kdevelop gnome.kdevelop c.kdevelop cpp.kdevelop fortran.kdevelop python.kdevelop php.kdevelop perl.kdevelop java.kdevelop java-ant.kdevelop qttmake.kdevelop qtqmake.kdevelop qt4qmake.kdevelop ruby.kdevelop pascal.kdevelop ada.kdevelop
+
diff --git a/parts/appwizard/imports/ada b/parts/appwizard/imports/ada
new file mode 100644
index 00000000..246fd3fe
--- /dev/null
+++ b/parts/appwizard/imports/ada
@@ -0,0 +1,5 @@
+# KDE Config File
+[General]
+Comment=Ada Application
+Comment[fr]=Une application ADA
+
diff --git a/parts/appwizard/imports/ada.kdevelop b/parts/appwizard/imports/ada.kdevelop
new file mode 100644
index 00000000..779c8bbd
--- /dev/null
+++ b/parts/appwizard/imports/ada.kdevelop
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAdaProject</projectmanagement>
+ <primarylanguage>Ada</primarylanguage>
+ <keywords>
+ <keyword>Ada</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevadaproject>
+ <run>
+ <terminal>true</terminal>
+ </run>
+ </kdevadaproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="adb"/>
+ <type ext="ads"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/c b/parts/appwizard/imports/c
new file mode 100644
index 00000000..c87f05ef
--- /dev/null
+++ b/parts/appwizard/imports/c
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Generic C Application (Custom Buildsystem)
+Comment[fr]=Une application C gnrique (Makefiles personnaliss)
diff --git a/parts/appwizard/imports/c-auto b/parts/appwizard/imports/c-auto
new file mode 100644
index 00000000..223a5010
--- /dev/null
+++ b/parts/appwizard/imports/c-auto
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Comment=Generic C Application (Automake-based)
+Comment[fr]=Une application C g��ique (Makefiles bas� sur Automake)
+
+#[Infrastructure]
+#Comment=Attempt to generate Autotools project infrastructure
+#Command=autoscan && cp configure.scan configure.in
diff --git a/parts/appwizard/imports/c-auto.kdevelop b/parts/appwizard/imports/c-auto.kdevelop
new file mode 100644
index 00000000..fd5a3f2e
--- /dev/null
+++ b/parts/appwizard/imports/c-auto.kdevelop
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <run>
+ </run>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cflags>-O2 -g0</cflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cflags>-O0 -g3</cflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="c" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/c.kdevelop b/parts/appwizard/imports/c.kdevelop
new file mode 100644
index 00000000..24e1423d
--- /dev/null
+++ b/parts/appwizard/imports/c.kdevelop
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevcustomproject>
+ <run>
+ </run>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="c" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/cpp b/parts/appwizard/imports/cpp
new file mode 100644
index 00000000..425ac81c
--- /dev/null
+++ b/parts/appwizard/imports/cpp
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Generic C++ Application (Custom Buildsystem)
+Comment[fr]=Une application C++ gnrique (Makefiles personnaliss)
diff --git a/parts/appwizard/imports/cpp-auto b/parts/appwizard/imports/cpp-auto
new file mode 100644
index 00000000..f1555d2f
--- /dev/null
+++ b/parts/appwizard/imports/cpp-auto
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Comment=Generic C++ Application (Automake based)
+Comment[fr]=Une application C++ g��ique (Makefiles bas� sur Automake)
+
+#[Infrastructure]
+#Comment=Attempt to generate Autotools project infrastructure
+#Command=autoscan && cp configure.scan configure.in
diff --git a/parts/appwizard/imports/cpp-auto.kdevelop b/parts/appwizard/imports/cpp-auto.kdevelop
new file mode 100644
index 00000000..8ebabddf
--- /dev/null
+++ b/parts/appwizard/imports/cpp-auto.kdevelop
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O2 -g0</cxxflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cxxflags>-O0 -g3</cxxflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/cpp.kdevelop b/parts/appwizard/imports/cpp.kdevelop
new file mode 100644
index 00000000..4642acce
--- /dev/null
+++ b/parts/appwizard/imports/cpp.kdevelop
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevcustomproject>
+ <run>
+ </run>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <filetypes/>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/fortran b/parts/appwizard/imports/fortran
new file mode 100644
index 00000000..5294ff24
--- /dev/null
+++ b/parts/appwizard/imports/fortran
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Fortran Application (Custom Buildsystem)
+Comment[fr]=Une application FORTRAN (Makefiles personnaliss)
diff --git a/parts/appwizard/imports/fortran-auto b/parts/appwizard/imports/fortran-auto
new file mode 100644
index 00000000..b6193ae0
--- /dev/null
+++ b/parts/appwizard/imports/fortran-auto
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Comment=Fortran Application (Automake based)
+Comment[fr]=Une application FORTRAN (Makefiles bas� sur Automake)
+
+#[Infrastructure]
+#Comment=Attempt to generate Autotools project infrastructure
+#Command=autoscan && cp configure.scan configure.in
diff --git a/parts/appwizard/imports/fortran-auto.kdevelop b/parts/appwizard/imports/fortran-auto.kdevelop
new file mode 100644
index 00000000..8f7e0637
--- /dev/null
+++ b/parts/appwizard/imports/fortran-auto.kdevelop
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Fortran77</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="f"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/fortran.kdevelop b/parts/appwizard/imports/fortran.kdevelop
new file mode 100644
index 00000000..cc1b11b9
--- /dev/null
+++ b/parts/appwizard/imports/fortran.kdevelop
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>Fortran77</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ </general>
+ </kdevautoproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="f"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/gnome b/parts/appwizard/imports/gnome
new file mode 100644
index 00000000..03fdf349
--- /dev/null
+++ b/parts/appwizard/imports/gnome
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=GNOME C Application (Automake based)
+Comment[fr]=Une application C pour GNOME (Makefiles bass sur Automake)
diff --git a/parts/appwizard/imports/gnome.kdevelop b/parts/appwizard/imports/gnome.kdevelop
new file mode 100644
index 00000000..a02ad52f
--- /dev/null
+++ b/parts/appwizard/imports/gnome.kdevelop
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>C</primarylanguage>
+ <ignoreparts>
+ <part>KDevJavaDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevautoproject>
+ <general>
+ <useconfiguration>debug</useconfiguration>
+ </general>
+ <configurations>
+ <optimized>
+ <builddir>optimized</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cflags>-O2 -g0</cflags>
+ </optimized>
+ <debug>
+ <configargs>--enable-debug=full</configargs>
+ <builddir>debug</builddir>
+ <ccompiler>GccOptions</ccompiler>
+ <cxxcompiler>GppOptions</cxxcompiler>
+ <f77compiler>G77Options</f77compiler>
+ <cflags>-O0 -g3</cflags>
+ </debug>
+ </configurations>
+ </kdevautoproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.c;*.h" name="Sources" />
+ <group pattern="*.glade" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnustep</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="c"/>
+ <type ext="h"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/java b/parts/appwizard/imports/java
new file mode 100644
index 00000000..2fb51257
--- /dev/null
+++ b/parts/appwizard/imports/java
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Java Application (Automake based)
+Comment[fr]=Une application JAVA (Makefiles bass sur Automake)
diff --git a/parts/appwizard/imports/java-ant b/parts/appwizard/imports/java-ant
new file mode 100644
index 00000000..114d9bf7
--- /dev/null
+++ b/parts/appwizard/imports/java-ant
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Java Application (Ant based)
+Comment[fr]=Une application JAVA (Makefiles bass sur Ant)
diff --git a/parts/appwizard/imports/java-ant.kdevelop b/parts/appwizard/imports/java-ant.kdevelop
new file mode 100644
index 00000000..73595a85
--- /dev/null
+++ b/parts/appwizard/imports/java-ant.kdevelop
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAntProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevcustomproject>
+ <build>
+ <buildtool>ant</buildtool>
+ </build>
+ </kdevcustomproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="java"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/java-auto b/parts/appwizard/imports/java-auto
new file mode 100644
index 00000000..d821abc1
--- /dev/null
+++ b/parts/appwizard/imports/java-auto
@@ -0,0 +1,8 @@
+# KDE Config File
+[General]
+Comment=Java Application (Automake based)
+Comment[fr]=Une application JAVA (Makefiles bas� sur Automake)
+
+#[Infrastructure]
+#Comment=Attempt to generate Autotools project infrastructure
+#Command=autoscan && cp configure.scan configure.in
diff --git a/parts/appwizard/imports/java-auto.kdevelop b/parts/appwizard/imports/java-auto.kdevelop
new file mode 100644
index 00000000..a4ccfa24
--- /dev/null
+++ b/parts/appwizard/imports/java-auto.kdevelop
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="java"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/java.kdevelop b/parts/appwizard/imports/java.kdevelop
new file mode 100644
index 00000000..a4ccfa24
--- /dev/null
+++ b/parts/appwizard/imports/java.kdevelop
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevAutoProject</projectmanagement>
+ <primarylanguage>Java</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="java"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/kde b/parts/appwizard/imports/kde
new file mode 100644
index 00000000..13614802
--- /dev/null
+++ b/parts/appwizard/imports/kde
@@ -0,0 +1,5 @@
+# KDE Config File
+[General]
+Comment=KDE C++ Application (Automake based)
+Comment[fr]=Une application KDE (Makefiles bass sur Automake)
+
diff --git a/parts/appwizard/imports/kde.kdevelop b/parts/appwizard/imports/kde.kdevelop
new file mode 100644
index 00000000..dbd5d288
--- /dev/null
+++ b/parts/appwizard/imports/kde.kdevelop
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ <keyword>KDE</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>w3c-svg</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/pascal b/parts/appwizard/imports/pascal
new file mode 100644
index 00000000..f9310298
--- /dev/null
+++ b/parts/appwizard/imports/pascal
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Pascal Application
+Comment[fr]=Une application PASCAL \ No newline at end of file
diff --git a/parts/appwizard/imports/pascal.kdevelop b/parts/appwizard/imports/pascal.kdevelop
new file mode 100644
index 00000000..cc3c8bbd
--- /dev/null
+++ b/parts/appwizard/imports/pascal.kdevelop
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevPascalProject</projectmanagement>
+ <primarylanguage>Pascal</primarylanguage>
+ <keywords>
+ <keyword>Pascal</keyword>
+ <keyword>Code</keyword>
+ </keywords>
+ </general>
+ <kdevpascalproject>
+ <run>
+ <terminal>true</terminal>
+ </run>
+ </kdevpascalproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="pp"/>
+ <type ext="pas"/>
+ <type ext="dpr"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/perl b/parts/appwizard/imports/perl
new file mode 100644
index 00000000..d23d86ed
--- /dev/null
+++ b/parts/appwizard/imports/perl
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Perl Application
+Comment[fr]=Une application PERL
diff --git a/parts/appwizard/imports/perl.kdevelop b/parts/appwizard/imports/perl.kdevelop
new file mode 100644
index 00000000..6a22ce95
--- /dev/null
+++ b/parts/appwizard/imports/perl.kdevelop
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Perl</primarylanguage>
+ <ignoreparts>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <run>
+ </run>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="perl"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/php b/parts/appwizard/imports/php
new file mode 100644
index 00000000..a8aa5992
--- /dev/null
+++ b/parts/appwizard/imports/php
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=PHP Application
+Comment[fr]=Une application PHP \ No newline at end of file
diff --git a/parts/appwizard/imports/php.kdevelop b/parts/appwizard/imports/php.kdevelop
new file mode 100644
index 00000000..53704660
--- /dev/null
+++ b/parts/appwizard/imports/php.kdevelop
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>PHP</primarylanguage>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ </general>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>kde</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>perl</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+<kdevphpsupport>
+ <codeHelp>
+ <codeCompletion>true</codeCompletion>
+ <codeHinting>true</codeHinting>
+ <realtimeParsing>false</realtimeParsing>
+ </codeHelp>
+</kdevphpsupport>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>ada</toc>
+ <toc>ada_bugs_gcc</toc>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>sw</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="php"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/python b/parts/appwizard/imports/python
new file mode 100644
index 00000000..d824ebf5
--- /dev/null
+++ b/parts/appwizard/imports/python
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Python Application
+Comment[fr]=Une application PYTHON
diff --git a/parts/appwizard/imports/python.kdevelop b/parts/appwizard/imports/python.kdevelop
new file mode 100644
index 00000000..fd589a32
--- /dev/null
+++ b/parts/appwizard/imports/python.kdevelop
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Python</primarylanguage>
+ <ignoreparts>
+ <part>KDevDebugger</part>
+ <part>KDevJavaDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <run>
+ </run>
+ </kdevscriptproject>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="py"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/qt b/parts/appwizard/imports/qt
new file mode 100644
index 00000000..038a31a4
--- /dev/null
+++ b/parts/appwizard/imports/qt
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Generic C++ Application with Custom Buildsystem
+Comment[fr]=Une application C++ gnrique (Makefiles personnaliss)
diff --git a/parts/appwizard/imports/qt-auto b/parts/appwizard/imports/qt-auto
new file mode 100644
index 00000000..ed937063
--- /dev/null
+++ b/parts/appwizard/imports/qt-auto
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Qt C++ Application (Automake based)
+Comment[fr]=Une application C++ pour Qt (Makefiles bass sur Automake)
diff --git a/parts/appwizard/imports/qt-auto.kdevelop b/parts/appwizard/imports/qt-auto.kdevelop
new file mode 100644
index 00000000..47ffdd4d
--- /dev/null
+++ b/parts/appwizard/imports/qt-auto.kdevelop
@@ -0,0 +1,43 @@
+<!DOCTYPE kdevelop>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevKDEAutoProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>gtk</toc>
+ <toc>gnustep</toc>
+ <toc>python</toc>
+ <toc>php</toc>
+ <toc>perl</toc>
+ </ignoretocs>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell>libtool</dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/qt.kdevelop b/parts/appwizard/imports/qt.kdevelop
new file mode 100644
index 00000000..9ad4b9bc
--- /dev/null
+++ b/parts/appwizard/imports/qt.kdevelop
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevCustomProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*.po;*.ts" name="Translations" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevcustomproject>
+ <run>
+ </run>
+ </kdevcustomproject>
+ <kdevdebugger>
+ <general>
+ <dbgshell></dbgshell>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/qt4qmake b/parts/appwizard/imports/qt4qmake
new file mode 100644
index 00000000..3dc9fe5b
--- /dev/null
+++ b/parts/appwizard/imports/qt4qmake
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Qt4 C++ Application (QMake4 based)
+Comment[fr]=Une application C++ pour Qt4 (Makefiles bas� sur QMake4)
diff --git a/parts/appwizard/imports/qt4qmake.kdevelop b/parts/appwizard/imports/qt4qmake.kdevelop
new file mode 100644
index 00000000..dedc866b
--- /dev/null
+++ b/parts/appwizard/imports/qt4qmake.kdevelop
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevcppsupport>
+ <qt>
+ <version>4</version>
+ <used>true</used>
+ <includestyle>4</includestyle>
+ <designerintegration>ExternalDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ <type ext="qrc" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/qtqmake b/parts/appwizard/imports/qtqmake
new file mode 100644
index 00000000..24e9160e
--- /dev/null
+++ b/parts/appwizard/imports/qtqmake
@@ -0,0 +1,9 @@
+# KDE Config File
+[General]
+Comment=Qt C++ Application (QMake based)
+Comment[fr]=Une application C++ pour Qt (Makefiles bas� sur QMake)
+
+[Infrastructure]
+Comment=Attempt to generate QMake build system infrastructure
+Command=qmake -project
+ExistingProjectPattern=*.pro
diff --git a/parts/appwizard/imports/qtqmake.kdevelop b/parts/appwizard/imports/qtqmake.kdevelop
new file mode 100644
index 00000000..e3ef09b3
--- /dev/null
+++ b/parts/appwizard/imports/qtqmake.kdevelop
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTrollProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevcppsupport>
+ <qt>
+ <version>3</version>
+ <used>true</used>
+ <includestyle>3</includestyle>
+ <designerintegration>KDevEmbeddedDesigner</designerintegration>
+ </qt>
+ </kdevcppsupport>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/qttmake b/parts/appwizard/imports/qttmake
new file mode 100644
index 00000000..83743191
--- /dev/null
+++ b/parts/appwizard/imports/qttmake
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Qt C++ Application (TMake based)
+Comment[fr]=Une application C++ pour Qt (Makefiles bass sur TMake)
diff --git a/parts/appwizard/imports/qttmake.kdevelop b/parts/appwizard/imports/qttmake.kdevelop
new file mode 100644
index 00000000..b2607be6
--- /dev/null
+++ b/parts/appwizard/imports/qttmake.kdevelop
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevTMakeProject</projectmanagement>
+ <primarylanguage>C++</primarylanguage>
+ <keywords>
+ <keyword>Qt</keyword>
+ </keywords>
+ </general>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
+ <group pattern="*.ui" name="User Interface" />
+ <group pattern="*.png" name="Icons" />
+ <group pattern="*" name="Others" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>ruby</toc>
+ <toc>ruby_bugs</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevdebugger>
+ <general>
+ <dbgshell/>
+ </general>
+ </kdevdebugger>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ <type ext="cpp" />
+ <type ext="h" />
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/imports/ruby b/parts/appwizard/imports/ruby
new file mode 100644
index 00000000..de9a469e
--- /dev/null
+++ b/parts/appwizard/imports/ruby
@@ -0,0 +1,4 @@
+# KDE Config File
+[General]
+Comment=Ruby Application
+Comment[fr]=Une application RUBY
diff --git a/parts/appwizard/imports/ruby.kdevelop b/parts/appwizard/imports/ruby.kdevelop
new file mode 100644
index 00000000..c831d76a
--- /dev/null
+++ b/parts/appwizard/imports/ruby.kdevelop
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<kdevelop>
+ <general>
+ <author>%{AUTHOR}</author>
+ <email>%{EMAIL}</email>
+ <version>%{VERSION}</version>
+ <projectmanagement>KDevScriptProject</projectmanagement>
+ <primarylanguage>Ruby</primarylanguage>
+ <keywords>
+ <keyword>Ruby</keyword>
+ </keywords>
+ <ignoreparts>
+ <part>KDevDoxygen</part>
+ <part>KDevdistpart</part>
+ <part>KDevVisualBoyAdvance</part>
+ <part>KDevDebugger</part>
+ </ignoreparts>
+ </general>
+ <kdevscriptproject>
+ <general>
+ <activedir>src</activedir>
+ <includepatterns>*.rb</includepatterns>
+ <excludepatterns>*~</excludepatterns>
+ </general>
+ </kdevscriptproject>
+ <kdevfileview>
+ <groups>
+ <group pattern="*.rb" name="Scripts" />
+ </groups>
+ </kdevfileview>
+ <kdevdoctreeview>
+ <ignoretocs>
+ <toc>bash</toc>
+ <toc>bash_bugs</toc>
+ <toc>c++_bugs_gcc</toc>
+ <toc>clanlib</toc>
+ <toc>w3c-dom-level2-html</toc>
+ <toc>fortran_bugs_gcc</toc>
+ <toc>gnome1</toc>
+ <toc>gnustep</toc>
+ <toc>gtk</toc>
+ <toc>gtk_bugs</toc>
+ <toc>haskell</toc>
+ <toc>haskell_bugs_ghc</toc>
+ <toc>java_bugs_gcc</toc>
+ <toc>java_bugs_sun</toc>
+ <toc>kde2book</toc>
+ <toc>libc</toc>
+ <toc>libstdc++</toc>
+ <toc>opengl</toc>
+ <toc>pascal_bugs_fp</toc>
+ <toc>php</toc>
+ <toc>php_bugs</toc>
+ <toc>perl</toc>
+ <toc>perl_bugs</toc>
+ <toc>python</toc>
+ <toc>python_bugs</toc>
+ <toc>qt-kdev3</toc>
+ <toc>sdl</toc>
+ <toc>stl</toc>
+ <toc>w3c-svg</toc>
+ <toc>sw</toc>
+ <toc>w3c-uaag10</toc>
+ <toc>wxwidgets_bugs</toc>
+ </ignoretocs>
+ <ignoreqt_xml>
+ <toc>Guide to the Qt Translation Tools</toc>
+ <toc>Qt Assistant Manual</toc>
+ <toc>Qt Designer Manual</toc>
+ <toc>Qt Reference Documentation</toc>
+ <toc>qmake User Guide</toc>
+ </ignoreqt_xml>
+ <ignoredoxygen>
+ <toc>KDE Libraries (Doxygen)</toc>
+ </ignoredoxygen>
+ </kdevdoctreeview>
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="rb"/>
+ </useglobaltypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/appwizard/kdevappwizard.desktop b/parts/appwizard/kdevappwizard.desktop
new file mode 100644
index 00000000..64123324
--- /dev/null
+++ b/parts/appwizard/kdevappwizard.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Application Wizard
+Comment[br]=Skoazeller meziant
+Comment[ca]=Assistent d'aplicacions
+Comment[da]=Programguide
+Comment[de]=Anwendungs-Assistent für KDevelop
+Comment[el]=Μάγος εφαρμογής
+Comment[es]=Asistente de aplicaciones
+Comment[et]=Rakenduse nõustaja
+Comment[eu]=Aplikazio morroia
+Comment[fa]=جادوگر کاربرد
+Comment[fr]=Assistant de création d'applications
+Comment[ga]=Treoraí Feidhmchláir
+Comment[gl]=Asistente de aplicación
+Comment[hi]=अनुप्रयोग विज़ार्ड
+Comment[hu]=Alkalmazásvarázsló
+Comment[it]=Procedura guidata applicazione
+Comment[ja]=アプリケーションウィザード
+Comment[ms]=Wizard Aplikasi
+Comment[nds]=Programm-Hölper
+Comment[ne]=अनुप्रयोग विजार्ड
+Comment[nl]=Toepassingassistent
+Comment[pl]=Asystent tworzenia programu
+Comment[pt]=Assistente de Aplicações
+Comment[pt_BR]=Assistente de Aplicativo
+Comment[ru]=Мастер создания приложений
+Comment[sk]=Aplikačný sprievodca
+Comment[sl]=Čarovnik za programe
+Comment[sr]=Чаробњак за програме
+Comment[sr@Latn]=Čarobnjak za programe
+Comment[sv]=Programguide
+Comment[ta]=பயன்பாட்டு வழிகாட்டி
+Comment[tg]=Устои сохтани гузориш
+Comment[tr]=Uygulama Sihirbazı
+Comment[zh_CN]=应用程序向导
+Comment[zh_TW]=應用程式精靈
+Name=KDevAppWizard
+Name[da]=KDevelop Programguide
+Name[de]=Anwendungs-Assistent (KDevelop)
+Name[hi]=के-डेव-एप-विज़ार्ड
+Name[nds]=Programm-Hölper (KDevelop)
+Name[pl]=KDevAsystentApli
+Name[sk]=KDev aplikačný sprievodca
+Name[sv]=KDevelop programguide
+Name[zh_TW]=KDevelop 應用程式精靈
+GenericName=Application Wizard
+GenericName[br]=Skoazeller meziant
+GenericName[ca]=Assistent d'aplicacions
+GenericName[da]=Programguide
+GenericName[de]=Anwendungs-Assistent
+GenericName[el]=Μάγος εφαρμογής
+GenericName[es]=Asistente de aplicaciones
+GenericName[et]=Rakenduse nõustaja
+GenericName[eu]=Aplikazio morroia
+GenericName[fa]=جادوگر کاربرد
+GenericName[fr]=Assistant d'applications
+GenericName[ga]=Treoraí Feidhmchláir
+GenericName[gl]=Asistente de aplicación
+GenericName[hi]=अनुप्रयोग विज़ार्ड
+GenericName[hu]=Alkalmazásvarázsló
+GenericName[it]=Procedura guidata applicazione
+GenericName[ja]=アプリケーションウィザード
+GenericName[ms]=Wizard Aplikasi
+GenericName[nds]=Programm-Hölper
+GenericName[ne]=अनुप्रयोग विजार्ड
+GenericName[nl]=Toepassingassistent
+GenericName[pl]=Asystent tworzenia programu
+GenericName[pt]=Assistente de Aplicações
+GenericName[pt_BR]=Assistente de Aplicativo
+GenericName[ru]=Мастер создания приложений
+GenericName[sk]=Aplikačný sprievodca
+GenericName[sl]=Čarovnik za programe
+GenericName[sr]=Чаробњак за програме
+GenericName[sr@Latn]=Čarobnjak za programe
+GenericName[sv]=Programguide
+GenericName[ta]=பயன்பாடு வழிகாட்டி
+GenericName[tg]=Устои сохтани гузориш
+GenericName[tr]=Uygulama Sihirbazı
+GenericName[zh_CN]=应用程序向导
+GenericName[zh_TW]=應用程式精靈
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevappwizard
+X-KDevelop-Scope=Core
+X-KDevelop-Version=5
+X-KDevelop-Properties=ProjectCreation
diff --git a/parts/appwizard/kdevappwizard.rc b/parts/appwizard/kdevappwizard.rc
new file mode 100644
index 00000000..c86e0f44
--- /dev/null
+++ b/parts/appwizard/kdevappwizard.rc
@@ -0,0 +1,10 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevAppWizard" version="1">
+<MenuBar>
+ <Menu name="project" >
+ <Action name="project_new" group="project_new"/>
+ <Action name="project_import" group="project_import"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/appwizard/kdevfile.cpp b/parts/appwizard/kdevfile.cpp
new file mode 100644
index 00000000..1e57e1e6
--- /dev/null
+++ b/parts/appwizard/kdevfile.cpp
@@ -0,0 +1,59 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Sascha Cunz <mail@sacu.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevfile.h"
+
+static struct MimeTypeMapping
+{
+ const char* szMimeType;
+ KDevFile::CommentingStyle commentStyle;
+} mimeTypeMapping[] = {
+{ "text/x-c++hdr", KDevFile::CPPStyle },
+{ "text/x-c++src", KDevFile::CPPStyle },
+{ "text/x-chdr", KDevFile::CStyle },
+{ "text/x-csrc", KDevFile::CStyle },
+{ "text/adasrc", KDevFile::AdaStyle },
+{ "text/x-pascal", KDevFile::PascalStyle },
+{ "text/x-perl", KDevFile::BashStyle },
+{ "text/xml", KDevFile::XMLStyle },
+{ "text/x-xslt", KDevFile::XMLStyle },
+{ "text/x-xslfo", KDevFile::XMLStyle },
+{ "text/html", KDevFile::XMLStyle },
+{ "text/docbook", KDevFile::XMLStyle },
+{ "application/x-php", KDevFile::CPPStyle },
+{ "application/x-shellscript",KDevFile::BashStyle },
+{ NULL, KDevFile::NoCommenting }
+};
+
+KDevFile::CommentingStyle KDevFile::commentingStyleFromMimeType( const QString& mimeType )
+{
+ int idx = 0;
+ while( mimeTypeMapping[idx].szMimeType )
+ {
+ if( mimeType == mimeTypeMapping[idx].szMimeType )
+ return mimeTypeMapping[idx].commentStyle;
+ idx++;
+ }
+ return KDevFile::NoCommenting;
+}
+
+KDevFile::CommentingStyle KDevFile::commentingStyleFromMimeType( KMimeType::Ptr mimeType )
+{
+ return commentingStyleFromMimeType( mimeType->name() );
+}
+
diff --git a/parts/appwizard/kdevfile.h b/parts/appwizard/kdevfile.h
new file mode 100644
index 00000000..578c420e
--- /dev/null
+++ b/parts/appwizard/kdevfile.h
@@ -0,0 +1,57 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Sascha Cunz <sascha@sacu.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+/**
+@file kdevfile.h
+File abstraction layer.
+*/
+#ifndef KDEVFILE_H
+#define KDEVFILE_H
+
+#include <kmimetype.h>
+
+/**
+File abstraction.
+*/
+class KDevFile
+{
+public:
+ /**Styles of comment-formats a source file can have.*/
+ enum CommentingStyle
+ {
+ NoCommenting, //!< file seems to be unable to contain comments
+ CPPStyle, //!< C Style: <pre>/* comment */</pre>
+ CStyle, //!< C++ Style: <pre>// comment</pre>
+ AdaStyle, //!< Ada Style: <pre>-- comment --</pre>
+ PascalStyle, //!< Pascal Style: <pre>{ comment }</pre>
+ BashStyle, //!< Shell Style: <pre># comment</pre>
+ XMLStyle //!< XML Style: <pre><!-- comment --></pre>
+ };
+
+public:
+ /**@return A commenting style for a given mime type.
+ @param mimeType A string which defines a mime type (like "text/x-c+++src").*/
+ static CommentingStyle commentingStyleFromMimeType(const QString& mimeType);
+
+ /**@return A commenting style for a given mime type.
+ @param mimeType The mime type.*/
+ static CommentingStyle commentingStyleFromMimeType( KMimeType::Ptr mimeType );
+};
+
+#endif
diff --git a/parts/appwizard/kdevlicense.cpp b/parts/appwizard/kdevlicense.cpp
new file mode 100644
index 00000000..0af182a0
--- /dev/null
+++ b/parts/appwizard/kdevlicense.cpp
@@ -0,0 +1,116 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Sascha Cunz <sascha@sacu.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevlicense.h"
+
+#include <qfile.h>
+#include <qdatetime.h>
+#include <qregexp.h>
+
+KDevLicense::KDevLicense( const QString& name, const QString& fileName )
+ : m_name( name )
+{
+ readFile( fileName );
+}
+
+void KDevLicense::readFile( const QString& fileName )
+{
+ QFile f(fileName);
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream stream(&f);
+ QString str;
+ enum { readingText, readingFiles } mode = readingText;
+ for(;;)
+ {
+ str = stream.readLine();
+ if( str.isNull() )
+ break;
+ if( str == "[FILES]" )
+ mode = readingFiles;
+ else if( str == "[PREFIX]" )
+ mode = readingText;
+ else if( mode == readingFiles )
+ {
+ if( !str.isEmpty() )
+ {
+ m_copyFiles.append( str );
+ }
+ } else
+ m_rawLines.append( str );
+ }
+
+}
+
+QString KDevLicense::assemble( KDevFile::CommentingStyle commentingStyle, const QString& author, const QString& email, int leadingSpaces )
+{
+ // first, build a CPP Style license
+
+ QString strFill;
+ strFill.fill( ' ', leadingSpaces );
+
+ QString str =
+ strFill + "/***************************************************************************\n" +
+ strFill + " * Copyright (C) $YEAR$ by $AUTHOR$ *\n" +
+ strFill + " * $EMAIL$ *\n" +
+ strFill + " * *\n";
+
+// str = str.arg(QDate::currentDate().year()).arg(author.left(45),-45).arg(email.left(67),-67);
+
+ QStringList::Iterator it;
+ for( it = m_rawLines.begin(); it != m_rawLines.end(); ++it )
+ {
+ str += QString( "%1 * %2 *\n").arg( strFill ).arg( *it, -69 );
+ }
+
+ str += strFill + " ***************************************************************************/\n";
+
+ switch( commentingStyle )
+ {
+ case KDevFile::CPPStyle:
+ case KDevFile::CStyle:
+ return str;
+
+ case KDevFile::PascalStyle:
+ str.replace(QRegExp("/\\**\n \\*"), "{\n ");
+ str.replace(QRegExp("\\*\n \\*"), " \n ");
+ str.replace(QRegExp(" *\\**/\n"), "}\n");
+ return str;
+
+ case KDevFile::AdaStyle:
+ str.replace(QRegExp("/\\*"), "--");
+ str.replace(QRegExp(" \\*"), "--");
+ str.replace(QRegExp("\\*/"), "*");
+ return str;
+
+ case KDevFile::BashStyle:
+ str.replace(QRegExp("\\*|/"), "#");
+ str.replace(QRegExp("\n ##"), "\n##");
+ str.replace(QRegExp("\n #"), "\n# ");
+ return str;
+
+ case KDevFile::XMLStyle:
+ str.replace(QRegExp("/\\*"), "<!--");
+ str.replace(QRegExp("\n \\*"), "\n<!--");
+ str.replace(QRegExp("\\*/?\n"), "-->\n");
+ str.replace(QRegExp("\\*"), "_");
+ return str;
+ }
+
+ return "currently unknown/unsupported commenting style";
+}
diff --git a/parts/appwizard/kdevlicense.h b/parts/appwizard/kdevlicense.h
new file mode 100644
index 00000000..23fbc0c6
--- /dev/null
+++ b/parts/appwizard/kdevlicense.h
@@ -0,0 +1,75 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Sascha Cunz <sascha@sacu.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEVLICENSE_H
+#define KDEVLICENSE_H
+
+/**
+@file kdevfile.h
+The interface to installed licenses.
+*/
+
+#include <qstringlist.h>
+
+#include "kdevfile.h"
+
+/*The interface to installed licenses.*/
+class KDevLicense
+{
+public:
+ /**Constructs a KDevLicense and loads the given license template file.
+ @param name The name of this license.
+ @param fileName The file name where license template text is kept.*/
+ KDevLicense(const QString& name, const QString& fileName);
+
+public:
+ /**Assembles the license to a string suitable for replacement of a %{LICENSE} .*/
+ QString assemble(KDevFile::CommentingStyle commentingStyle, const QString& author, const QString& email, int leadingSpaces );
+
+ /**
+ * returns the name of this license.
+ */
+ QString name() const { return m_name; }
+
+ /**
+ * returns list of files tat must be present in the project's root directory
+ * if any source files uses this license.
+ */
+ QStringList copyFiles(){ return m_copyFiles; }
+
+private:
+ void readFile( const QString& fileName );
+
+private:
+ /**
+ * Name of this license
+ */
+ QString m_name;
+ /**
+ * Raw lines of the license. Should contain no spaces at
+ * the start or end of each line.
+ */
+ QStringList m_rawLines;
+ /**
+ * List of files that must be added to the project, if any
+ * file in the project uses this license.
+ */
+ QStringList m_copyFiles;
+};
+
+#endif
diff --git a/parts/appwizard/licenses/BSD b/parts/appwizard/licenses/BSD
new file mode 100644
index 00000000..88bb7cc8
--- /dev/null
+++ b/parts/appwizard/licenses/BSD
@@ -0,0 +1,22 @@
+[FILES]
+LICENSE.BSD
+
+[PREFIX]
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file
diff --git a/parts/appwizard/licenses/GPL b/parts/appwizard/licenses/GPL
new file mode 100644
index 00000000..58bc3bdb
--- /dev/null
+++ b/parts/appwizard/licenses/GPL
@@ -0,0 +1,18 @@
+[FILES]
+COPYING
+
+[PREFIX]
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the
+Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \ No newline at end of file
diff --git a/parts/appwizard/licenses/GPL+Qt-Exception b/parts/appwizard/licenses/GPL+Qt-Exception
new file mode 100644
index 00000000..f06a70b8
--- /dev/null
+++ b/parts/appwizard/licenses/GPL+Qt-Exception
@@ -0,0 +1,29 @@
+[FILES]
+COPYING
+
+[PREFIX]
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the
+Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+In addition, as a special exception, the copyright holders give
+permission to link the code of this program with any edition of
+the Qt library by Trolltech AS, Norway (or with modified versions
+of Qt that use the same license as Qt), and distribute linked
+combinations including the two. You must obey the GNU General
+Public License in all respects for all of the code used other than
+Qt. If you modify this file, you may extend this exception to
+your version of the file, but you are not obligated to do so. If
+you do not wish to do so, delete this exception statement from
+your version. \ No newline at end of file
diff --git a/parts/appwizard/licenses/LGPL b/parts/appwizard/licenses/LGPL
new file mode 100644
index 00000000..754c091a
--- /dev/null
+++ b/parts/appwizard/licenses/LGPL
@@ -0,0 +1,18 @@
+[FILES]
+COPYING.LIB
+
+[PREFIX]
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this program; if not, write to the
+Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \ No newline at end of file
diff --git a/parts/appwizard/licenses/MIT b/parts/appwizard/licenses/MIT
new file mode 100644
index 00000000..c180220e
--- /dev/null
+++ b/parts/appwizard/licenses/MIT
@@ -0,0 +1,21 @@
+[FILES]
+LICENSE.MIT
+
+[PREFIX]
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/parts/appwizard/licenses/Makefile.am b/parts/appwizard/licenses/Makefile.am
new file mode 100644
index 00000000..07a5868f
--- /dev/null
+++ b/parts/appwizard/licenses/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/sourceinfo $(all_includes)
+METASOURCES = AUTO
+
+kdevelopdatadir = ${kde_datadir}/kdevelop
+licensesdir = ${kdevelopdatadir}/licenses
+licenses_DATA = GPL LGPL BSD QPL GPL+Qt-Exception MIT NCSA
diff --git a/parts/appwizard/licenses/NCSA b/parts/appwizard/licenses/NCSA
new file mode 100644
index 00000000..f073df23
--- /dev/null
+++ b/parts/appwizard/licenses/NCSA
@@ -0,0 +1,24 @@
+[FILES]
+LICENSE.NCSA
+
+[PREFIX]
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal with the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
+ * Neither the names of <Name of Development Group, Name of Institution>, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. \ No newline at end of file
diff --git a/parts/appwizard/licenses/QPL b/parts/appwizard/licenses/QPL
new file mode 100644
index 00000000..67a2c9e9
--- /dev/null
+++ b/parts/appwizard/licenses/QPL
@@ -0,0 +1,11 @@
+[FILES]
+LICENSE.QPL
+
+[PREFIX]
+This program may be distributed under the terms of the Q Public
+License as defined by Trolltech AS of Norway and appearing in the
+file LICENSE.QPL included in the packaging of this file.
+
+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. \ No newline at end of file
diff --git a/parts/appwizard/misc.cpp b/parts/appwizard/misc.cpp
new file mode 100644
index 00000000..3590b589
--- /dev/null
+++ b/parts/appwizard/misc.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann and Harald Fernengel *
+ * bernd@kdevelop.org, harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "misc.h"
+
+#include <qstring.h>
+#include <kemailsettings.h>
+
+#include <pwd.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+
+void AppWizardUtil::guessAuthorAndEmail(QString *author, QString *email)
+{
+ KEMailSettings emailConfig;
+ emailConfig.setProfile( emailConfig.defaultProfileName() );
+ QString fromAddr = emailConfig.getSetting( KEMailSettings::EmailAddress );
+ QString name = emailConfig.getSetting( KEMailSettings::RealName );
+
+ if ( !fromAddr.isEmpty() && !name.isEmpty() ) {
+ *author = name;
+ *email = fromAddr;
+ return;
+ }
+
+ struct passwd *pw = ::getpwuid(getuid());
+ // pw==0 => the system must be really fucked up
+ if (!pw)
+ return;
+
+ char hostname[512];
+
+ // I guess we don't have to support users with longer host names ;-)
+ (void) ::gethostname(hostname, sizeof hostname);
+
+ if ( name.isEmpty() )
+ *author = QString::fromLocal8Bit( pw->pw_gecos );
+ else
+ *author = name;
+ if ( fromAddr.isEmpty() )
+ *email = QString(pw->pw_name) + "@" + hostname;
+ else
+ *email = fromAddr;
+}
+
diff --git a/parts/appwizard/misc.h b/parts/appwizard/misc.h
new file mode 100644
index 00000000..1378943b
--- /dev/null
+++ b/parts/appwizard/misc.h
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _MISC_H_
+#define _MISC_H_
+
+#include <qstring.h>
+
+class AppWizardUtil
+{
+public:
+ static void guessAuthorAndEmail(QString *author, QString *email);
+};
+
+#endif
diff --git a/parts/appwizard/profilesupport.cpp b/parts/appwizard/profilesupport.cpp
new file mode 100644
index 00000000..5445a228
--- /dev/null
+++ b/parts/appwizard/profilesupport.cpp
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "profilesupport.h"
+
+#include <qfileinfo.h>
+
+#include <kdebug.h>
+#include <kconfig.h>
+
+#include <kdevplugincontroller.h>
+
+ProfileSupport::ProfileSupport(KDevPlugin *parent)
+{
+ KURL::List resources = parent->pluginController()->profileResourcesRecursive("*.appwizard");
+
+ for (KURL::List::const_iterator it = resources.constBegin(); it != resources.constEnd(); ++it)
+ {
+ KConfig config((*it).path());
+ config.setGroup("General");
+ m_templateList += config.readListEntry("List");
+ }
+}
+
+bool ProfileSupport::isInTemplateList(const QString &templateUrl)
+{
+ return m_templateList.contains(QFileInfo(templateUrl).baseName());
+}
diff --git a/parts/appwizard/profilesupport.h b/parts/appwizard/profilesupport.h
new file mode 100644
index 00000000..befc3d21
--- /dev/null
+++ b/parts/appwizard/profilesupport.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROFILESUPPORT_H
+#define PROFILESUPPORT_H
+
+#include <kdevplugin.h>
+
+class ProfileSupport{
+public:
+ ProfileSupport(KDevPlugin *parent);
+ bool isInTemplateList(const QString &templateUrl);
+
+private:
+ QStringList m_templateList;
+};
+
+#endif
diff --git a/parts/appwizard/vcs_form.ui b/parts/appwizard/vcs_form.ui
new file mode 100644
index 00000000..27075a88
--- /dev/null
+++ b/parts/appwizard/vcs_form.ui
@@ -0,0 +1,84 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>VcsForm</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>VcsForm</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Vcs Form</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QWidgetStack" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>stack</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Version control system:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>combo</cstring>
+ </property>
+ </widget>
+ <spacer row="0" 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>110</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>combo</sender>
+ <signal>activated(int)</signal>
+ <receiver>stack</receiver>
+ <slot>raiseWidget(int)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in declaration">qwidgetstack.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/astyle/Makefile.am b/parts/astyle/Makefile.am
new file mode 100644
index 00000000..dc3712b2
--- /dev/null
+++ b/parts/astyle/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib/astyle -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevastyle.la
+libkdevastyle_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevastyle_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/astyle/libastyle.la
+
+libkdevastyle_la_SOURCES = astyle_part.cpp astyleconfig.ui astyle_widget.cpp astyle_adaptor.cpp
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevastyle.desktop
+
+rc_DATA = kdevpart_astyle.rc
+rcdir = $(kde_datadir)/kdevastyle
diff --git a/parts/astyle/README.dox b/parts/astyle/README.dox
new file mode 100644
index 00000000..4b7d4778
--- /dev/null
+++ b/parts/astyle/README.dox
@@ -0,0 +1,10 @@
+/** \class AStylePart
+A plugin for formatting of sourcecode according to a specified set of rules.
+
+\authors <a href="mailto: <mhk AT caldera.de>">Matthias Hlzer-Klpfel</a>
+
+\feature formats source code according to a specified set of rules
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=astyle&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">astyle component at Bugzilla database</a>
+
+*/
diff --git a/parts/astyle/astyle_adaptor.cpp b/parts/astyle/astyle_adaptor.cpp
new file mode 100644
index 00000000..124da96e
--- /dev/null
+++ b/parts/astyle/astyle_adaptor.cpp
@@ -0,0 +1,270 @@
+#include "astyle_adaptor.h"
+
+#include "astyle_widget.h"
+
+#include <string>
+
+#include <qradiobutton.h>
+#include <qspinbox.h>
+#include <qcheckbox.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+
+
+ASStringIterator::ASStringIterator(const QString &text)
+ : ASSourceIterator(), _content(text)
+{
+ _is = new QTextStream(&_content, IO_ReadOnly);
+}
+
+
+ASStringIterator::~ASStringIterator()
+{
+ delete _is;
+}
+
+
+bool ASStringIterator::hasMoreLines() const
+{
+ return !_is->eof();
+}
+
+
+string ASStringIterator::nextLine()
+{
+ return _is->readLine().utf8().data();
+}
+
+
+KDevFormatter::KDevFormatter(const QMap<QString, QVariant>& options)
+{
+// for ( QMap<QString, QVariant>::ConstIterator iter = options.begin();iter != options.end();iter++ )
+// {
+// kdDebug ( 9009 ) << "format: " << iter.key() << "=" << iter.data() << endl;
+// }
+
+ setCStyle();
+
+ // style
+ QString s = options["FStyle"].toString();
+ if ( predefinedStyle( s ) )
+ {
+ return;
+ }
+
+ // fill
+ int wsCount = options["FillCount"].toInt();
+ if (options["Fill"].toString() == "Tabs")
+ {
+ setTabIndentation(wsCount, options["FillForce"].toBool() );
+ m_indentString = "\t";
+ } else
+ {
+ setSpaceIndentation(wsCount);
+ m_indentString = "";
+ m_indentString.fill(' ', wsCount);
+ }
+
+ setTabSpaceConversionMode(options["FillForce"].toBool());
+ setEmptyLineFill(options["Fill_EmptyLines"].toBool());
+
+ // indent
+ setSwitchIndent(options["IndentSwitches"].toBool());
+ setClassIndent(options["IndentClasses"].toBool());
+ setCaseIndent(options["IndentCases"].toBool());
+ setBracketIndent(options["IndentBrackets"].toBool());
+ setNamespaceIndent(options["IndentNamespaces"].toBool());
+ setLabelIndent(options["IndentLabels"].toBool());
+ setBlockIndent(options["IndentBlocks"].toBool());
+ setPreprocessorIndent(options["IndentPreprocessors"].toBool());
+
+ // continuation
+ setMaxInStatementIndentLength(options["MaxStatement"].toInt());
+ if (options["MinConditional"].toInt() != -1)
+ setMinConditionalIndentLength(options["MinConditional"].toInt());
+
+ // brackets
+ s = options["Brackets"].toString();
+ if (s == "Break")
+ setBracketFormatMode(astyle::BREAK_MODE);
+ else if (s == "Attach")
+ setBracketFormatMode(astyle::ATTACH_MODE);
+ else if (s == "Linux")
+ setBracketFormatMode(astyle::BDAC_MODE);
+ else
+ setBracketFormatMode(astyle::NONE_MODE);
+
+ setBreakClosingHeaderBracketsMode(options["BracketsCloseHeaders"].toBool());
+ // blocks
+ setBreakBlocksMode(options["BlockBreak"].toBool());
+ if (options["BlockBreakAll"].toBool()){
+ setBreakBlocksMode(true);
+ setBreakClosingHeaderBlocksMode(true);
+ }
+ setBreakElseIfsMode(options["BlockIfElse"].toBool());
+
+ // padding
+ setOperatorPaddingMode(options["PadOperators"].toBool());
+ setParensInsidePaddingMode(options["PadParenthesesIn"].toBool());
+ setParensOutsidePaddingMode(options["PadParenthesesOut"].toBool());
+ setParensUnPaddingMode(options["PadParenthesesUn"].toBool());
+
+ // oneliner
+ setBreakOneLineBlocksMode(!options["KeepBlocks"].toBool());
+ setSingleStatementsMode(!options["KeepStatements"].toBool());
+}
+
+KDevFormatter::KDevFormatter( AStyleWidget * widget )
+{
+ setCStyle();
+
+ if ( widget->Style_ANSI->isChecked() )
+ {
+ predefinedStyle( "ANSI" );
+ return;
+ }
+ if ( widget->Style_GNU->isChecked() )
+ {
+ predefinedStyle( "GNU" );
+ return;
+ }
+ if ( widget->Style_JAVA->isChecked() )
+ {
+ predefinedStyle( "JAVA" );
+ return;
+ }
+ if ( widget->Style_KR->isChecked() )
+ {
+ predefinedStyle( "KR" );
+ return;
+ }
+ if ( widget->Style_Linux->isChecked() )
+ {
+ predefinedStyle( "Linux" );
+ return;
+ }
+
+ // fill
+ if ( widget->Fill_Tabs->isChecked() )
+ {
+ setTabIndentation(widget->Fill_TabCount->value(), widget->Fill_ForceTabs->isChecked());
+ m_indentString = "\t";
+ }
+ else
+ {
+ setSpaceIndentation( widget->Fill_SpaceCount->value() );
+ m_indentString = "";
+ m_indentString.fill(' ', widget->Fill_SpaceCount->value());
+ }
+
+ setTabSpaceConversionMode(widget->Fill_ConvertTabs->isChecked());
+ setEmptyLineFill(widget->Fill_EmptyLines->isChecked());
+
+ // indent
+ setSwitchIndent( widget->Indent_Switches->isChecked() );
+ setClassIndent( widget->Indent_Classes->isChecked() );
+ setCaseIndent( widget->Indent_Cases->isChecked() );
+ setBracketIndent( widget->Indent_Brackets->isChecked() );
+ setNamespaceIndent( widget->Indent_Namespaces->isChecked() );
+ setLabelIndent( widget->Indent_Labels->isChecked() );
+ setBlockIndent( widget->Indent_Blocks->isChecked());
+ setPreprocessorIndent(widget->Indent_Preprocessors->isChecked());
+
+ // continuation
+ setMaxInStatementIndentLength( widget->Continue_MaxStatement->value() );
+ setMinConditionalIndentLength( widget->Continue_MinConditional->value() );
+
+ // brackets
+ if ( widget->Brackets_Break->isChecked() )
+ {
+ setBracketFormatMode( astyle::BREAK_MODE );
+ }
+ else if ( widget->Brackets_Attach->isChecked() )
+ {
+ setBracketFormatMode( astyle::ATTACH_MODE );
+ }
+ else if ( widget->Brackets_Linux->isChecked())
+ {
+ setBracketFormatMode( astyle::BDAC_MODE );
+ }
+ else{
+ setBracketFormatMode( astyle::NONE_MODE );
+ }
+
+ setBreakClosingHeaderBracketsMode( widget->Brackets_CloseHeaders->isChecked());
+
+ // blocks
+ setBreakBlocksMode(widget->Block_Break->isChecked());
+ if (widget->Block_BreakAll->isChecked()){
+ setBreakBlocksMode(true);
+ setBreakClosingHeaderBlocksMode(true);
+ }
+ setBreakElseIfsMode(widget->Block_IfElse->isChecked());
+
+ // padding
+ setOperatorPaddingMode( widget->Pad_Operators->isChecked() );
+
+ setParensInsidePaddingMode( widget->Pad_ParenthesesIn->isChecked() );
+ setParensOutsidePaddingMode( widget->Pad_ParenthesesOut->isChecked() );
+ setParensUnPaddingMode( widget->Pad_ParenthesesUn->isChecked() );
+
+ // oneliner
+ setBreakOneLineBlocksMode( !widget->Keep_Blocks->isChecked() );
+ setSingleStatementsMode( !widget->Keep_Statements->isChecked() );
+}
+
+bool KDevFormatter::predefinedStyle( const QString & style )
+{
+ if (style == "ANSI")
+ {
+ setBracketIndent(false);
+ setSpaceIndentation(4);
+ setBracketFormatMode(astyle::BREAK_MODE);
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setNamespaceIndent(false);
+ return true;
+ }
+ if (style == "KR")
+ {
+ setBracketIndent(false);
+ setSpaceIndentation(4);
+ setBracketFormatMode(astyle::ATTACH_MODE);
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setNamespaceIndent(false);
+ return true;
+ }
+ if (style == "Linux")
+ {
+ setBracketIndent(false);
+ setSpaceIndentation(8);
+ setBracketFormatMode(astyle::BDAC_MODE);
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setNamespaceIndent(false);
+ return true;
+ }
+ if (style == "GNU")
+ {
+ setBlockIndent(true);
+ setSpaceIndentation(2);
+ setBracketFormatMode(astyle::BREAK_MODE);
+ setClassIndent(false);
+ setSwitchIndent(false);
+ setNamespaceIndent(false);
+ return true;
+ }
+ if (style == "JAVA")
+ {
+ setJavaStyle();
+ setBracketIndent(false);
+ setSpaceIndentation(4);
+ setBracketFormatMode(astyle::ATTACH_MODE);
+ setSwitchIndent(false);
+ return true;
+ }
+ return false;
+}
diff --git a/parts/astyle/astyle_adaptor.h b/parts/astyle/astyle_adaptor.h
new file mode 100644
index 00000000..2367c4d7
--- /dev/null
+++ b/parts/astyle/astyle_adaptor.h
@@ -0,0 +1,55 @@
+#ifndef __ASTYLE_ADAPTOR_H__
+#define __ASTYLE_ADAPTOR_H__
+
+
+#include <qstring.h>
+#include <qtextstream.h>
+#include <qmap.h>
+#include <qvariant.h>
+
+#include "astyle.h"
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+
+class ASStringIterator : public astyle::ASSourceIterator
+{
+public:
+
+ ASStringIterator(const QString &string);
+ virtual ~ASStringIterator();
+
+ virtual bool hasMoreLines() const;
+ virtual string nextLine();
+
+
+private:
+
+ QString _content;
+ QTextStream *_is;
+
+};
+
+class AStyleWidget;
+
+class KDevFormatter : public astyle::ASFormatter
+{
+public:
+
+ KDevFormatter(const QMap<QString, QVariant>& options);
+ KDevFormatter( AStyleWidget * widget );
+ QString indentString() const
+ {
+ return m_indentString;
+ }
+
+private:
+ bool predefinedStyle( const QString & style );
+
+private:
+ QString m_indentString;
+};
+
+
+#endif
diff --git a/parts/astyle/astyle_part.cpp b/parts/astyle/astyle_part.cpp
new file mode 100644
index 00000000..526af170
--- /dev/null
+++ b/parts/astyle/astyle_part.cpp
@@ -0,0 +1,541 @@
+#include "astyle_part.h"
+
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qtextstream.h>
+#include <qpopupmenu.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <kparts/partmanager.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/selectioninterface.h>
+#include <kprogress.h>
+#include <kdevcore.h>
+#include <kdevapi.h>
+#include <kdevpartcontroller.h>
+#include <kdevplugininfo.h>
+#include <configwidgetproxy.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <qlineedit.h>
+#include <qregexp.h>
+
+#include "astyle_widget.h"
+#include "astyle_adaptor.h"
+
+static const KDevPluginInfo data("kdevastyle");
+
+namespace {
+ const char* defaultFormatExtensions = "*.cpp *.h *.hpp,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff ,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm";
+}
+
+
+typedef KDevGenericFactory<AStylePart> AStyleFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevastyle, AStyleFactory( data ) )
+
+AStylePart::AStylePart(QObject *parent, const char *name, const QStringList &)
+ : KDevSourceFormatter(&data, parent, name ? name : "AStylePart")
+{
+ setInstance(AStyleFactory::instance());
+
+ setXMLFile("kdevpart_astyle.rc");
+
+ formatTextAction = new KAction(i18n("&Reformat Source"), 0, this, SLOT(beautifySource()), actionCollection(), "edit_astyle");
+ formatTextAction->setEnabled(false);
+ formatTextAction->setToolTip(i18n("Reformat source"));
+ formatTextAction->setWhatsThis(i18n("<b>Reformat source</b><p>Source reformatting functionality using <b>astyle</b> library. "
+ "Also available in <b>New Class</b> and <b>Subclassing</b> wizards."));
+
+ formatFileAction = new KAction(i18n("Format files"), 0, this, SLOT(formatFilesSelect()), actionCollection(), "tools_astyle");
+ formatFileAction->setEnabled(false);
+ formatFileAction->setToolTip(i18n("Format files"));
+ formatFileAction->setWhatsThis(i18n("<b>Fomat files</b><p>Formatting functionality using <b>astyle</b> library. "
+ "Also available in <b>New Class</b> and <b>Subclassing</b> wizards."));
+ formatFileAction->setEnabled ( true );
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("Formatting"), GLOBALDOC_OPTIONS, info()->icon());
+ m_configProxy->createProjectConfigPage(i18n("Formatting"), PROJECTDOC_OPTIONS, info()->icon());
+
+
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase* ,QWidget*,unsigned int)), this, SLOT(insertConfigWidget(const KDialogBase*,QWidget*,unsigned int)));
+
+ connect(partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(activePartChanged(KParts::Part*)));
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ loadGlobal();
+ //use the globals first, project level will override later..
+ m_project=m_global;
+ m_projectExtensions = m_globalExtensions;
+ setExtensions(m_globalExtensions.join("\n"),false);
+
+ // maybe there is a file open already
+ activePartChanged( partController()->activePart() );
+
+}
+
+void AStylePart::loadGlobal()
+{
+// kdDebug(9009) << "Load global"<<endl;
+ KConfig *config = kapp->config();
+ config->setGroup("AStyle");
+ QString options = config->readEntry("Options","BlockBreak=0,BlockBreakAll=0,BlockIfElse=0,Brackets=Break,BracketsCloseHeaders=0,FStyle=UserDefined,Fill=Tabs,FillCount=4,FillEmptyLines=0,FillForce=0,IndentBlocks=0,IndentBrackets=0,IndentCases=0,IndentClasses=1,IndentLabels=1,IndentNamespaces=1,IndentPreprocessors=0,IndentSwitches=1,KeepBlocks=1,KeepStatements=1,MaxStatement=40,MinConditional=-1,PadOperators=0,PadParenthesesIn=1,PadParenthesesOut=1,PadParenthesesUn=1,");
+ m_globalExtensions=QStringList::split(",",config->readEntry("Extensions",defaultFormatExtensions));
+
+ QStringList pairs = QStringList::split( ",", options);
+ QStringList::Iterator it;
+ for ( it = pairs.begin(); it != pairs.end(); ++it ) {
+ QStringList bits = QStringList::split( "=", (*it) );
+ m_global[bits[0]] = bits[1];
+ }
+
+
+// for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
+// {
+// kdDebug(9009) << "load: " <<iter.key() << "="<< iter.data() << endl;
+// }
+}
+
+void AStylePart::saveGlobal()
+{
+ QString options;
+ for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
+ {
+// kdDebug(9009) <<"saveGlobal" <<iter.key() << "="<< iter.data() << endl;
+ options += iter.key();
+ options += "=";
+ options += iter.data().toString();
+ options += ",";
+ }
+// for (QMap<QString, QVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++)
+// {
+// kdDebug(9009) << "project before: " <<iter.key() << "="<< iter.data() << endl;
+// }
+
+ KConfig *config = kapp->config();
+ config->setGroup("AStyle");
+ config->writeEntry("Options",options);
+ config->writeEntry("Extensions",m_globalExtensions.join(","));
+
+ config->sync();
+// for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
+// {
+// kdDebug(9009) << "global after: " <<iter.key() << "="<< iter.data() << endl;
+// }
+// for (QMap<QString, QVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++)
+// {
+// kdDebug(9009) << "project after: " <<iter.key() << "="<< iter.data() << endl;
+// }
+}
+
+AStylePart::~AStylePart()
+{
+ saveGlobal();
+ delete m_configProxy;
+}
+
+void AStylePart::beautifySource()
+{
+ KTextEditor::EditInterface *iface
+ = dynamic_cast<KTextEditor::EditInterface*>(partController()->activePart());
+ if (!iface)
+ return;
+
+ bool has_selection = false;
+
+ KTextEditor::SelectionInterface *sel_iface
+ = dynamic_cast<KTextEditor::SelectionInterface*>(partController()->activePart());
+ if (sel_iface && sel_iface->hasSelection())
+ has_selection = true;
+
+ //if there is a selection, we only format it.
+ ASStringIterator is(has_selection ? sel_iface->selection() : iface->text());
+ KDevFormatter formatter(m_project);
+
+ formatter.init(&is);
+
+ QString output;
+ QTextStream os(&output, IO_WriteOnly);
+
+ // put the selection back to the same indent level.
+ // taking note of the config options.
+ unsigned int indentCount=0;
+ QString indentWith("");
+ if ( has_selection){
+ QString original = sel_iface->selection();
+ for (;indentCount<original.length();indentCount++){
+ QChar ch = original[indentCount];
+ if ( ch.isSpace()){
+ if ( ch == QChar('\n') || ch == QChar('\r')){
+ indentWith="";
+ }
+ else{
+ indentWith+=original[indentCount];
+ }
+ }
+ else{
+ break;
+ }
+ }
+
+ int wsCount = m_project["FillCount"].toInt();
+ if (m_project["Fill"].toString() == "Tabs")
+ {
+ // tabs and wsCount spaces to be a tab
+ QString replace;
+ for (int i =0;i<wsCount;i++)
+ replace+=' ';
+
+ indentWith=indentWith.replace(replace, QChar('\t'));
+ indentWith=indentWith.remove(' ');
+ } else
+ {
+ if ( m_project["FillForce"].toBool()){
+ //convert tabs to spaces
+ QString replace;
+ for (int i =0;i<wsCount;i++)
+ replace+=' ';
+
+ indentWith=indentWith.replace(QChar('\t'),replace);
+ }
+ }
+ }
+
+ while (formatter.hasMoreLines()){
+ if ( has_selection ){
+ os << indentWith;
+ }
+ os << QString::fromUtf8(formatter.nextLine().c_str()) << endl;
+ }
+
+ uint col = 0;
+ uint line = 0;
+
+ if(has_selection) //there was a selection, so only change the part of the text related to it
+ {
+ //remove the final newline character, unless it should be there
+ if ( !sel_iface->selection().endsWith( "\n" ) )
+ output.setLength(output.length()-1);
+
+ sel_iface->removeSelectedText();
+ cursorPos( partController()->activePart(), &col, &line );
+ iface->insertText( col, line, output);
+
+ return;
+ }
+
+ cursorPos( partController()->activePart(), &col, &line );
+
+ iface->setText( output );
+
+ setCursorPos( partController()->activePart(), col, line );
+}
+
+void AStylePart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+ switch (pageNo)
+ {
+ case GLOBALDOC_OPTIONS:
+ {
+ AStyleWidget *w = new AStyleWidget(this, true, page, "astyle config widget");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ case PROJECTDOC_OPTIONS:
+ {
+ AStyleWidget *w = new AStyleWidget(this, false, page, "astyle config widget");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+QString AStylePart::getGlobalExtensions(){
+ QString values = m_globalExtensions.join("\n");
+ return values.stripWhiteSpace();
+}
+QString AStylePart::getProjectExtensions(){
+ QString values = m_projectExtensions.join("\n");
+ return values.stripWhiteSpace();
+}
+
+
+/**
+ * Extensions from the widget passed in.
+ * We preserve the order, so common extensions will
+ * end up at the top
+ * @param ext
+ */
+void AStylePart::setExtensions ( QString ext, bool global )
+{
+ kdDebug(9009) << "setExtensions " << ext<<endl;
+ if ( global){
+ m_globalExtensions.clear();
+ m_globalExtensions=QStringList::split ( QRegExp("\n"), ext );
+ }
+ else{
+ m_searchExtensions.clear();
+ m_projectExtensions.clear();
+ m_projectExtensions = QStringList::split ( QRegExp("\n"), ext );
+ QStringList bits = QStringList::split(QRegExp("\\s+"),ext);
+ for ( QStringList::Iterator iter = bits.begin(); iter != bits.end(); iter++ )
+ {
+ QString ending=*iter;
+ if ( ending.startsWith ( "*" ) )
+ {
+ if (ending.length() ==1 ){
+ // special case.. any file.
+ m_searchExtensions.insert(ending, ending);
+ }
+ else{
+ m_searchExtensions.insert( ending.mid( 1 ), ending);
+ }
+ }
+ else
+ {
+ m_searchExtensions.insert(ending, ending);
+ }
+ }
+ }
+}
+
+void AStylePart::activePartChanged ( KParts::Part *part )
+{
+ bool enabled = false;
+
+ KParts::ReadWritePart *rw_part = dynamic_cast<KParts::ReadWritePart*> ( part );
+
+ if ( rw_part )
+ {
+ KTextEditor::EditInterface *iface = dynamic_cast<KTextEditor::EditInterface*> ( rw_part );
+
+ if ( iface )
+ {
+ // check for the everything case..
+ if ( m_searchExtensions.find ( "*" ) == m_searchExtensions.end() )
+ {
+ QString extension = rw_part->url().path();
+ int pos = extension.findRev ( '.' );
+ if ( pos >= 0 )
+ {
+ extension = extension.mid ( pos );
+ enabled = ( m_searchExtensions.find ( extension ) != m_searchExtensions.end() );
+ }
+ }
+ else
+ {
+ enabled = true;
+ }
+ }
+ }
+
+ formatTextAction->setEnabled ( enabled );
+}
+
+QString AStylePart::formatSource( const QString text, AStyleWidget * widget, const QMap<QString, QVariant>& options )
+{
+ ASStringIterator is(text);
+ KDevFormatter * formatter = ( widget)? new KDevFormatter( widget ) : new KDevFormatter(options);
+
+ formatter->init(&is);
+
+ QString output;
+ QTextStream os(&output, IO_WriteOnly);
+
+ while ( formatter->hasMoreLines() )
+ os << QString::fromUtf8( formatter->nextLine().c_str() ) << endl;
+
+ delete formatter;
+
+ return output;
+}
+
+void AStylePart::cursorPos( KParts::Part *part, uint * line, uint * col )
+{
+ if (!part || !part->inherits("KTextEditor::Document")) return;
+
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (iface)
+ {
+ iface->cursorPositionReal( line, col );
+ }
+}
+
+void AStylePart::setCursorPos( KParts::Part *part, uint line, uint col )
+{
+ if (!part || !part->inherits("KTextEditor::Document")) return;
+
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (iface)
+ {
+ iface->setCursorPositionReal( line, col );
+ }
+}
+
+QString AStylePart::formatSource( const QString text )
+{
+ return formatSource(text, 0, m_project);
+}
+
+QString AStylePart::indentString( ) const
+{
+ KDevFormatter formatter(m_project);
+ return formatter.indentString();
+}
+
+void AStylePart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (context->hasType( Context::EditorContext ))
+ {
+ popup->insertSeparator();
+ int id = popup->insertItem( i18n("Format selection"), this, SLOT(beautifySource()) );
+ popup->setWhatsThis(id, i18n("<b>Format</b><p>Formats the current selection, if possible"));
+ }
+ else if ( context->hasType( Context::FileContext )){
+ const FileContext *ctx = static_cast<const FileContext*>(context);
+ m_urls = ctx->urls();
+
+ popup->insertSeparator();
+ int id = popup->insertItem( i18n("Format files"), this, SLOT(formatFiles()) );
+ popup->setWhatsThis(id, i18n("<b>Format files</b><p>Formats selected files if possible"));
+
+ }
+}
+
+void AStylePart::restorePartialProjectSession(const QDomElement * el)
+{
+ kdDebug(9009) << "Load project" << endl;
+ QDomElement style = el->namedItem("AStyle").toElement();
+
+ if (style.attribute("FStyle", "GLOBAL") == "GLOBAL")
+ {
+ m_project = m_global;
+ m_project["FStyle"] = "GLOBAL";
+ m_projectExtensions=m_globalExtensions;
+ }
+ else
+ {
+ for (QMap<QString, QVariant>::iterator iter = m_global.begin();iter != m_global.end();iter++)
+ {
+ m_project[iter.key()] = style.attribute(iter.key(),iter.data().toString());
+ }
+
+ QDomElement exten = el->namedItem("Extensions").toElement();
+ QString ext = exten.attribute("ext").simplifyWhiteSpace();
+ if ( ext.isEmpty()){
+ ext=defaultFormatExtensions;
+ }
+ setExtensions(ext.replace(QChar(','), QChar('\n')),false);
+ }
+}
+
+
+void AStylePart::savePartialProjectSession(QDomElement * el)
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull())
+ return;
+
+ QDomElement style = domDoc.createElement("AStyle");
+ style.setAttribute("FStyle", m_project["FStyle"].toString());
+ if (m_project["FStyle"] != "GLOBAL")
+ {
+ for (QMap<QString, QVariant>::iterator iter = m_project.begin();iter != m_project.end();iter++)
+ {
+ style.setAttribute(iter.key(),iter.data().toString());
+ }
+ QDomElement exten = domDoc.createElement ( "Extensions" );
+ exten.setAttribute ( "ext", m_projectExtensions.join(",").simplifyWhiteSpace() );
+ el->appendChild(exten);
+ }
+ el->appendChild(style);
+}
+
+void AStylePart::formatFilesSelect(){
+ m_urls.clear();
+ QStringList filenames = KFileDialog::getOpenFileNames ( QString::null, getProjectExtensions(),0,"Select files to format" );
+
+ for(QStringList::Iterator it = filenames.begin(); it != filenames.end();it++){
+ m_urls << *it;
+ }
+ formatFiles();
+}
+
+
+/**
+ * Format the selected files with the current style.
+ */
+void AStylePart::formatFiles()
+{
+ KURL::List::iterator it = m_urls.begin();
+ while ( it != m_urls.end() )
+ {
+ kdDebug ( 9009 ) << "Selected " << ( *it ).pathOrURL() << endl;
+ ++it;
+ }
+
+ uint processed = 0;
+ for ( uint fileCount = 0; fileCount < m_urls.size(); fileCount++ )
+ {
+ QString fileName = m_urls[fileCount].pathOrURL();
+
+ bool found = false;
+ for ( QMap<QString, QString>::Iterator it = m_searchExtensions.begin(); it != m_searchExtensions.end(); ++it )
+ {
+ QRegExp re ( it.data(), true, true );
+ if ( re.search ( fileName ) == 0 && ( uint ) re.matchedLength() == fileName.length() )
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if ( found )
+ {
+ QString backup = fileName + "#";
+ QFile fin ( fileName );
+ QFile fout ( backup );
+ if ( fin.open ( IO_ReadOnly ) )
+ {
+ if ( fout.open ( IO_WriteOnly ) )
+ {
+ QString fileContents ( fin.readAll() );
+ fin.close();
+ QTextStream outstream ( &fout );
+ outstream << formatSource ( fileContents );
+ fout.close();
+ QDir().rename ( backup, fileName );
+ processed++;
+ }
+ else
+ {
+ KMessageBox::sorry ( 0, i18n ( "Not able to write %1" ).arg ( backup ) );
+ }
+ }
+ else
+ {
+ KMessageBox::sorry ( 0, i18n ( "Not able to read %1" ).arg ( fileName ) );
+ }
+ }
+ }
+ if ( processed != 0 )
+ {
+ KMessageBox::information ( 0, i18n ( "Processed %1 files ending with extensions %2" ).arg ( processed ).arg(getProjectExtensions().stripWhiteSpace()) );
+ }
+ m_urls.clear();
+
+}
+
+
+#include "astyle_part.moc"
diff --git a/parts/astyle/astyle_part.h b/parts/astyle/astyle_part.h
new file mode 100644
index 00000000..bf572dcc
--- /dev/null
+++ b/parts/astyle/astyle_part.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2001 Matthias H�zer-Klpfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_ASTYLE_H__
+#define __KDEVPART_ASTYLE_H__
+
+class KDialogBase;
+#include <kdevsourceformatter.h>
+#include <kaction.h>
+#include <kparts/part.h>
+#include <kdevplugin.h>
+#include <kdebug.h>
+#include <qmap.h>
+#include <qvariant.h>
+
+class AStyleWidget;
+class QPopupMenu;
+class Context;
+class ConfigWidgetProxy;
+
+class AStylePart : public KDevSourceFormatter
+{
+ Q_OBJECT
+
+public:
+
+ AStylePart(QObject *parent, const char *name, const QStringList &);
+ ~AStylePart();
+
+ QString formatSource(const QString text, AStyleWidget * widget, const QMap<QString, QVariant>& options);
+ virtual QString formatSource(const QString text);
+ QString indentString() const;
+ void saveGlobal();
+ void setExtensions(QString ext, bool global);
+ QString getProjectExtensions();
+ QString getGlobalExtensions();
+ void restorePartialProjectSession(const QDomElement * el);
+ void savePartialProjectSession(QDomElement * el);
+
+ QMap<QString, QVariant>& getProjectOptions(){return m_project;}
+ QMap<QString, QVariant>& getGlobalOptions(){return m_global;}
+
+
+private slots:
+
+ void activePartChanged(KParts::Part *part);
+ void beautifySource();
+ void formatFiles();
+ void formatFilesSelect();
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+private:
+
+ void cursorPos( KParts::Part *part, uint * col, uint * line );
+ void setCursorPos( KParts::Part *part, uint col, uint line );
+
+ void loadGlobal();
+
+ ConfigWidgetProxy *m_configProxy;
+ KAction *formatTextAction;
+ KAction *formatFileAction;
+
+ // the configurable options.
+ QMap<QString, QVariant> m_project;
+ QMap<QString, QVariant> m_global;
+ QStringList m_projectExtensions;
+ QStringList m_globalExtensions;
+ QMap<QString, QString> m_searchExtensions;
+ KURL::List m_urls;
+};
+
+
+#endif
diff --git a/parts/astyle/astyle_widget.cpp b/parts/astyle/astyle_widget.cpp
new file mode 100644
index 00000000..0622b91b
--- /dev/null
+++ b/parts/astyle/astyle_widget.cpp
@@ -0,0 +1,346 @@
+#include "astyle_part.h"
+#include "astyle_widget.h"
+
+#include <qradiobutton.h>
+#include <qtabwidget.h>
+#include <qmultilineedit.h>
+#include <qbuttongroup.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kdevcore.h>
+
+
+AStyleWidget::AStyleWidget(AStylePart * part, bool global, QWidget *parent, const char *name)
+ : AStyleConfig(parent, name), m_part(part), isGlobalWidget(global)
+{
+ // which style changed - disable the other pages.
+ connect(StyleGroup, SIGNAL(clicked(int)), this, SLOT(styleChanged()));
+ connect(ConfigTabs, SIGNAL(currentChanged(QWidget*)), this, SLOT(styleChanged()) );
+
+ connect(FillingGroup, SIGNAL(clicked(int)), this, SLOT(styleChanged()));
+ connect(Fill_ForceTabs, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Fill_TabCount, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
+ connect(Fill_SpaceCount, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
+
+ connect(BracketGroup, SIGNAL(clicked(int)), this, SLOT(styleChanged()));
+ connect(Brackets_CloseHeaders, SIGNAL(clicked()), this, SLOT(styleChanged()));
+
+ connect(Indent_Switches, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Cases, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Classes, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Brackets, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Namespaces, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Labels, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Blocks, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Indent_Preprocessors, SIGNAL(clicked()), this, SLOT(styleChanged()));
+
+ connect(Continue_MaxStatement, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
+ connect(Continue_MinConditional, SIGNAL(valueChanged(int)), this, SLOT(styleChanged()));
+
+ connect(Block_Break, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Block_BreakAll, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Block_IfElse, SIGNAL(clicked()), this, SLOT(styleChanged()));
+
+ connect(Pad_ParenthesesIn, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Pad_ParenthesesOut, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Pad_ParenthesesUn, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Pad_Operators, SIGNAL(clicked()), this, SLOT(styleChanged()));
+
+ connect(Keep_Statements, SIGNAL(clicked()), this, SLOT(styleChanged()));
+ connect(Keep_Blocks, SIGNAL(clicked()), this, SLOT(styleChanged()));
+
+
+ QMap<QString, QVariant> option;
+ if ( isGlobalWidget){
+ Style_Global->hide();
+ option = m_part->getGlobalOptions();
+ }
+ else{
+ Style_Global->show();
+ option = m_part->getProjectOptions();
+ }
+
+ // style
+ QString s = option["FStyle"].toString();
+ // fake the id so we disable the other pages.
+ int id=0;
+ if (s == "ANSI") id=1;
+ if (s == "KR") id=2;
+ if (s == "Linux") id=3;
+ if (s == "GNU") id=4;
+ if (s == "JAVA") id=5;
+ if (s == "GLOBAL") id = 6;
+ StyleGroup->setButton(id);
+
+ if ( isGlobalWidget ){
+ GeneralExtension->setText(m_part->getGlobalExtensions());
+ GeneralExtension->setEnabled(true);
+ globalOptions=true;
+ }
+ else{
+ if ( id == 6){
+ GeneralExtension->setText(m_part->getGlobalExtensions());
+ GeneralExtension->setEnabled(false);
+ globalOptions=true;
+ }
+ else{
+ GeneralExtension->setText(m_part->getProjectExtensions());
+ GeneralExtension->setEnabled(true);
+ globalOptions=false;
+ }
+ }
+
+ m_lastExt=GeneralExtension->text();
+
+ if (s == "UserDefined" || s =="GLOBAL" )
+ {
+ int wsCount = option["FillCount"].toInt();
+ if (option["Fill"].toString() == "Tabs")
+ {
+ Fill_Tabs->setChecked(true);
+ Fill_TabCount->setValue(wsCount);
+ Fill_TabCount->setEnabled(true);
+ Fill_ForceTabs->setChecked(option["FillForce"].toBool());
+ Fill_ForceTabs->setEnabled(true);
+ }
+ else
+ {
+ Fill_Spaces->setChecked(true);
+ Fill_SpaceCount->setValue(wsCount);
+ Fill_SpaceCount->setEnabled(true);
+ Fill_ConvertTabs->setChecked(option["FillForce"].toBool());
+ Fill_ConvertTabs->setEnabled(true);
+ }
+
+ Fill_EmptyLines->setChecked(option["FillEmptyLines"].toBool());
+
+ // indent
+ Indent_Switches->setChecked(option["IndentSwitches"].toBool());
+ Indent_Cases->setChecked(option["IndentCases"].toBool());
+ Indent_Classes->setChecked(option["IndentClasses"].toBool());
+ Indent_Brackets->setChecked(option["IndentBrackets"].toBool());
+ Indent_Namespaces->setChecked(option["IndentNamespaces"].toBool());
+ Indent_Labels->setChecked(option["IndentLabels"].toBool());
+ Indent_Blocks->setChecked(option["IndentBlocks"].toBool());
+ Indent_Preprocessors->setChecked(option["IndentPreprocessors"].toBool());
+
+ // contiuation
+ Continue_MaxStatement->setValue(option["MaxStatement"].toInt());
+ Continue_MinConditional->setValue(option["MinConditional"].toInt());
+
+ // brackets
+ s = option["Brackets"].toString();
+ if (s == "Break")
+ Brackets_Break->setChecked(true);
+ else if (s == "Attach")
+ Brackets_Attach->setChecked(true);
+ else if (s == "Linux")
+ Brackets_Linux->setChecked(true);
+ else
+ Brackets_None->setChecked(true);
+
+ Brackets_CloseHeaders->setChecked(option["BracketsCloseHeaders"].toBool());
+
+ Block_Break->setChecked(option["BlockBreak"].toBool());
+ Block_BreakAll->setChecked(option["BlockBreakAll"].toBool());
+ Block_IfElse->setChecked(option["BlockIfElse"].toBool());
+
+ // padding
+ Pad_ParenthesesIn->setChecked(option["PadParenthesesIn"].toBool());
+ Pad_ParenthesesOut->setChecked(option["PadParenthesesOut"].toBool());
+ Pad_ParenthesesUn->setChecked(option["PadParenthesesUn"].toBool());
+
+ Pad_Operators->setChecked(option["PadOperators"].toBool());
+
+ // oneliner
+ Keep_Statements->setChecked(option["KeepStatements"].toBool());
+ Keep_Blocks->setChecked(option["KeepBlocks"].toBool());
+ }
+
+
+ styleChanged();
+}
+
+
+AStyleWidget::~AStyleWidget()
+{
+}
+
+
+void AStyleWidget::accept()
+{
+ QMap<QString, QVariant>* m_option;
+ if ( isGlobalWidget){
+ m_option = &(m_part->getGlobalOptions());
+ m_part->setExtensions(GeneralExtension->text(),true);
+ }
+ else{
+ m_option = &(m_part->getProjectOptions());
+ m_part->setExtensions(GeneralExtension->text(),false);
+ }
+
+
+ // style
+ if (Style_ANSI->isChecked())
+ (*m_option)["FStyle"] = "ANSI";
+ else if (Style_KR->isChecked())
+ (*m_option)["FStyle"] = "KR";
+ else if (Style_Linux->isChecked())
+ (*m_option)["FStyle"] = "Linux";
+ else if (Style_GNU->isChecked())
+ (*m_option)["FStyle"] = "GNU";
+ else if (Style_JAVA->isChecked())
+ (*m_option)["FStyle"] = "JAVA";
+ else if (Style_Global->isChecked()){
+ QMap<QString,QVariant>& global = m_part->getGlobalOptions();
+ QMap<QString,QVariant>& project = m_part->getProjectOptions();
+ project=global;
+ project["FStyle"]="GLOBAL";
+ }
+ else if (Style_UserDefined->isChecked())
+ {
+ (*m_option)["FStyle"] = "UserDefined";
+
+ // fill
+ if (Fill_Tabs->isChecked())
+ {
+ (*m_option)["Fill"] = "Tabs";
+ (*m_option)["FillCount"] = Fill_TabCount->value();
+ (*m_option)["FillForce"] = Fill_ForceTabs->isChecked();
+ }
+ else
+ {
+ (*m_option)["Fill"] = "Spaces";
+ (*m_option)["FillCount"] = Fill_SpaceCount->value();
+ (*m_option)["FillForce"] = Fill_ConvertTabs->isChecked();
+ }
+
+ (*m_option)["FillEmptyLines"] = Fill_EmptyLines->isChecked();
+
+ // indent
+ (*m_option)["IndentSwitches"] = Indent_Switches->isChecked();
+ (*m_option)["IndentCases"] = Indent_Cases->isChecked();
+ (*m_option)["IndentClasses"] = Indent_Classes->isChecked();
+ (*m_option)["IndentBrackets"] = Indent_Brackets->isChecked();
+ (*m_option)["IndentNamespaces"] = Indent_Namespaces->isChecked();
+ (*m_option)["IndentLabels"] = Indent_Labels->isChecked();
+ (*m_option)["IndentBlocks"] = Indent_Blocks->isChecked();
+ (*m_option)["IndentPreprocessors"] = Indent_Preprocessors->isChecked();
+
+ // continuation
+ (*m_option)["MaxStatement"] = Continue_MaxStatement->value();
+ (*m_option)["MinConditional"] = Continue_MinConditional->value();
+
+ // brackets
+ if ( Brackets_None->isChecked())
+ (*m_option)["Brackets"] = "None";
+ else if (Brackets_Break->isChecked())
+ (*m_option)["Brackets"] = "Break";
+ else if (Brackets_Attach->isChecked())
+ (*m_option)["Brackets"] = "Attach";
+ else if (Brackets_Linux->isChecked())
+ (*m_option)["Brackets"] = "Linux";
+
+ (*m_option)["BracketsCloseHeaders"] = Brackets_CloseHeaders->isChecked();
+
+ // blocks
+ (*m_option)["BlockBreak"] = Block_Break->isChecked();
+ (*m_option)["BlockBreakAll"] = Block_BreakAll->isChecked();
+ (*m_option)["BlockIfElse"] = Block_IfElse->isChecked();
+
+ // padding
+ (*m_option)["PadParenthesesIn"] = Pad_ParenthesesIn->isChecked();
+ (*m_option)["PadParenthesesOut"] = Pad_ParenthesesOut->isChecked();
+ (*m_option)["PadParenthesesUn"] = Pad_ParenthesesUn->isChecked();
+
+ (*m_option)["PadOperators"] = Pad_Operators->isChecked();
+
+ // oneliner
+ (*m_option)["KeepStatements"] = Keep_Statements->isChecked();
+ (*m_option)["KeepBlocks"] = Keep_Blocks->isChecked();
+ }
+
+ if ( isGlobalWidget){
+ QMap<QString, QVariant>& project = m_part->getProjectOptions();
+ if ( project["FStyle"] == "GLOBAL"){
+ project = m_part->getGlobalOptions();
+ project["FStyle"] = "GLOBAL";
+ }
+ m_part->saveGlobal();
+ }
+
+// for ( QMap<QString, QVariant>::ConstIterator iter = m_option->begin();iter != m_option->end();iter++ )
+// {
+// kdDebug ( 9009 ) << "widget: " << iter.key() << "=" << iter.data() << endl;
+// }
+
+}
+
+/**
+ * Change the sample formatting text depending on what tab is selected.
+ *
+ * @param id Tab selected
+ */
+void AStyleWidget::styleChanged( )
+{
+ // disable the tabs for predefined sample
+ // only user define id==0, enables the other tabs
+ ConfigTabs->setTabEnabled(tab_2, Style_UserDefined->isChecked());
+ ConfigTabs->setTabEnabled(tab_3, Style_UserDefined->isChecked());
+ ConfigTabs->setTabEnabled(tab_4, Style_UserDefined->isChecked());
+
+ int id = ConfigTabs->currentPageIndex();
+
+ StyleExample->clear();
+
+ QString bracketSample = "namespace foospace {\n\tint Foo(){\n\tif (isBar)\n{\nbar(); \n\treturn 1; } else \nreturn 0;}}\n\nvoid test(){\n\tif (isFoo){\n\tbar();\n} else\n{\n\tbar();\n}\n}\n";
+
+ QString indentSample = "#define foobar(A)\\\n{Foo();Bar();}\n#define anotherFoo(B)\\\nreturn Bar()\n\nnamespace Bar\n{\nclass Foo\n{public:\nFoo();\nvirtual ~Foo();\n};\nswitch (foo)\n{\ncase 1:\na+=1;\nbreak;\ncase 2:\n{\na += 2;\n break;\n}\n}\nif (isFoo)\n{\nbar();\n}\nelse\n{\nanotherBar();\n}\nint foo()\n\twhile(isFoo)\n\t\t{\n\t\t\t...\n\t\t\tgoto error;\n\t\t....\n\t\terror:\n\t\t\t...\n\t\t}\n\t}\nfooArray[]={ red,\n\tgreen,\n\tdarkblue};\nfooFunction(barArg1,\n\tbarArg2,\n\tbarArg3);\n";
+
+ QString formattingSample = "void func(){\n\tif(isFoo(a,b))\n\tbar(a,b);\nif(isFoo)\n\ta=bar((b-c)*a,*d--);\nif( isFoo( a,b ) )\n\tbar(a, b);\nif (isFoo) {isFoo=false;cat << isFoo <<endl;}\nif(isFoo)DoBar();if (isFoo){\n\tbar();\n}\n\telse if(isBar()){\n\tannotherBar();\n}\n}\n";
+
+ QString styleSample = "\t//Tabs & Brackets\nnamespace foo{\n" + bracketSample + "}\n\t// Indentation\n" + indentSample + "\t// Formatting\n" + formattingSample;
+
+ switch(id){
+ case 1:
+ StyleExample->setText( m_part->formatSource( bracketSample, this,m_part->getProjectOptions() ) );
+ break;
+ case 2:
+ StyleExample->setText( m_part->formatSource( indentSample, this,m_part->getProjectOptions() ) );
+ break;
+ case 3:
+ StyleExample->setText( m_part->formatSource( formattingSample, this,m_part->getProjectOptions() ) );
+ break;
+ default:
+ {
+ if ( Style_Global->isChecked() ){
+ StyleExample->setText( m_part->formatSource( styleSample, 0, m_part->getGlobalOptions()) );
+ }
+ else
+ {
+ StyleExample->setText( m_part->formatSource( styleSample, this, m_part->getProjectOptions() ) );
+ }
+ }
+ }
+
+ if ( Style_Global->isChecked()){
+ if ( !globalOptions){
+ m_lastExt = GeneralExtension->text();
+ GeneralExtension->setEnabled ( false );
+ GeneralExtension->setText ( m_part->getGlobalExtensions() );
+ globalOptions=!globalOptions;
+ }
+ }
+ else{
+ if ( globalOptions){
+ GeneralExtension->setEnabled ( true );
+ GeneralExtension->setText ( m_lastExt );
+ globalOptions=!globalOptions;
+ }
+ }
+}
+
+#include "astyle_widget.moc"
diff --git a/parts/astyle/astyle_widget.h b/parts/astyle/astyle_widget.h
new file mode 100644
index 00000000..ac779985
--- /dev/null
+++ b/parts/astyle/astyle_widget.h
@@ -0,0 +1,36 @@
+#ifndef __ASTYLE_WIDGET_H__
+#define __ASTYLE_WIDGET_H__
+
+#include "astyleconfig.h"
+
+class AStylePart;
+class KDevPart;
+
+
+class AStyleWidget : public AStyleConfig
+{
+ Q_OBJECT
+
+public:
+
+ AStyleWidget( AStylePart * part, bool global, QWidget *parent=0, const char *name=0 );
+ ~AStyleWidget();
+
+
+public slots:
+
+ void accept();
+
+
+private slots:
+ void styleChanged();
+
+private:
+ AStylePart * m_part;
+ bool isGlobalWidget;
+ QString m_lastExt;
+ bool globalOptions;
+};
+
+
+#endif
diff --git a/parts/astyle/astyleconfig.ui b/parts/astyle/astyleconfig.ui
new file mode 100644
index 00000000..38063bb6
--- /dev/null
+++ b/parts/astyle/astyleconfig.ui
@@ -0,0 +1,1332 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AStyleConfig</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AStyleConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>711</width>
+ <height>722</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Artistic Style Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>ConfigTabs</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </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="QButtonGroup">
+ <property name="name">
+ <cstring>StyleGroup</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>350</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>&amp;Style</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_UserDefined</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;User defined</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="buttonGroupId">
+ <number>0</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Select options from other tabs.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_ANSI</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;ANSI</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>ANSI style formatting/indenting.
+Brackets Break
+Use 4 spaces
+Indent Bracket=false
+Indent Class=false
+Indent Switch=false
+Indent NameSpace=false</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_KR</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Kernighan &amp;&amp; Ritchie</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>2</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Kernighan &amp; Ritchie style formatting/indenting.
+Brackets Attach
+Use 4 spaces
+Indent Class=false
+Indent Switch=false
+Indent Namespaces=false
+</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_Linux</cstring>
+ </property>
+ <property name="text">
+ <string>Linu&amp;x</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>3</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Linux mode (8 spaces per indent, break definition-block brackets but attach command-block brackets).
+Brackets Linux
+Use 8 spaces
+Indent Bracket=false
+Indent Class=false
+Indent Switch=false
+Indent NameSpace=false</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_GNU</cstring>
+ </property>
+ <property name="text">
+ <string>G&amp;NU</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>4</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>GNU style formatting/indenting.
+Brackets Break
+Use 2 spaces
+Indent Block=true
+Indent Bracket=false
+Indent Class=false
+Indent Switch=false
+Indent NameSpace=false</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_JAVA</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;JAVA</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>5</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Java mode, with standard java style formatting/indenting.
+Java Style
+Use 4 spaces
+Brackets Attach
+Indent Bracket=false
+Indent Switch=false</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Style_Global</cstring>
+ </property>
+ <property name="text">
+ <string>Use Global &amp;Options</string>
+ </property>
+ <property name="buttonGroupId">
+ <number>6</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the global defaults. See the menu:
+Settings/Configure Kdevelop/Formatting.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>FrameFilesFormat</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Files to format</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>GeneralExtension</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>*.c *.h
+*.cpp *.hpp
+*.C *.H
+*.cxx *.hxx
+*.cc *.hh
+*.c++ *.h++
+*.inl *.tlh
+*.moc *.xpm
+*.diff *.patch
+*.java</string>
+ </property>
+ <property name="wordWrap">
+ <enum>WidgetWidth</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set the extensions of files that the
+formatter will try to reformat. Use a
+space separated list, e.g. *.cpp *.hpp.
+Can use * on its own for any file.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the extensions of files that the
+formatter will try to reformat. Use a
+space separated list, e.g. *.cpp *.hpp.
+Can use * on its own for any file.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab &amp;&amp; Bra&amp;ckets</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>FillingGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>&amp;Filling</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="spacing">
+ <number>20</number>
+ </property>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>Fill_EmptyLines</cstring>
+ </property>
+ <property name="text">
+ <string>Fill empt&amp;y lines</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Fill empty lines with the white space of their previous lines.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>Fill_Tabs</cstring>
+ </property>
+ <property name="text">
+ <string>U&amp;se tabs</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="2">
+ <property name="name">
+ <cstring>Fill_SpaceCount</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>2</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Number of spaces to use per indent.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="4">
+ <property name="name">
+ <cstring>Fill_ConvertTabs</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Con&amp;vert tabs</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Convert tabs to spaces.</string>
+ </property>
+ </widget>
+ <spacer row="0" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>34</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>Fill_Spaces</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Use spaces:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="0" column="2">
+ <property name="name">
+ <cstring>Fill_TabCount</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>4</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Number of spaces that will be converted to a tab.
+The number of spaces per tab is controled by the editor.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="4">
+ <property name="name">
+ <cstring>Fill_ForceTabs</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>F&amp;orce tabs</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Force tabs to be used in areas Astyle would prefer to use spaces.</string>
+ </property>
+ </widget>
+ <spacer row="0" column="3" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>spacer13_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>BracketGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Brackets</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="spacing">
+ <number>20</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Brackets_None</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;No Change</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The brackets will not be changed.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Brackets_Break</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Break</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Break brackets from pre-block code (i.e. ANSI C/C++ style).</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Brackets_Attach</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Attach</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Attach brackets to pre-block code (i.e. Java/K&amp;R style).
+See also Formatting/Blocks/Break if-else</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>Brackets_Linux</cstring>
+ </property>
+ <property name="text">
+ <string>Linu&amp;x style</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Break brackets from class/function declarations,
+but attach brackets to pre-block command statements.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Brackets_CloseHeaders</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Brea&amp;k closing headers</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Break brackets before closing headers (e.g. 'else', 'catch', ...)
+from their immediately preceding closing brackets.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Indentation</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>ContinueationGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Contin&amp;uation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSpinBox" row="0" column="1">
+ <property name="name">
+ <cstring>Continue_MaxStatement</cstring>
+ </property>
+ <property name="value">
+ <number>40</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent a maximal # spaces in a continuous statement,
+relative to the previous line.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Maximum in statement:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent a maximal # spaces in a continuous statement,
+relative to the previous line.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Minimum in conditional:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent a minimal # spaces in a continuous conditional
+belonging to a conditional header.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>Continue_MinConditional</cstring>
+ </property>
+ <property name="specialValueText">
+ <string>Twice current</string>
+ </property>
+ <property name="minValue">
+ <number>-1</number>
+ </property>
+ <property name="value">
+ <number>-1</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent a minimal # spaces in a continuous conditional
+belonging to a conditional header.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>IndentGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Indented &amp;Entities</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Switches</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Switches</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent 'switch' blocks, so that the inner 'case XXX:'
+headers are indented in relation to the switch block.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Cases</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Case statements</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent case blocks from the 'case XXX:' headers.
+Case statements not enclosed in blocks are NOT indented.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Classes</cstring>
+ </property>
+ <property name="text">
+ <string>Cla&amp;sses</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent 'class' blocks, so that the inner 'public:',
+'protected:' and 'private: headers are indented in
+relation to the class block.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Brackets</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Brackets</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add extra indentation to '{' and '}' block brackets.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Namespaces</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Namespaces</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent the contents of namespace blocks.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Labels</cstring>
+ </property>
+ <property name="text">
+ <string>L&amp;abels</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent labels so that they appear one indent less than
+the current indentation level, rather than being
+flushed completely to the left (which is the default).</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Blocks</cstring>
+ </property>
+ <property name="text">
+ <string>Bloc&amp;ks</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add extra indentation entire blocks (including brackets).</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Indent_Preprocessors</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>#Prepr&amp;ocessors</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Indent multi-line #define statements.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>For&amp;matting</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>BlockGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Blocks</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>Block_Break</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Break blocks</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Insert empty lines around unrelated blocks, labels, classes,...
+Known problems:
+
+1. If a statement is NOT part of a block,
+the following statements are all double spaced.
+Statements enclosed in a block are formatted
+correctly.
+
+2. Comments are broken from the block.
+</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>Block_BreakAll</cstring>
+ </property>
+ <property name="text">
+ <string>Break bl&amp;ocks all</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Like --break-blocks, except also insert empty lines
+around closing headers (e.g. 'else', 'catch', ...).
+
+Known problems:
+
+1. If a statement is NOT part of a block,
+the following statements are all double spaced.
+Statements enclosed in a block are formatted
+correctly.
+
+2. Comments are broken from the block.
+</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>Block_IfElse</cstring>
+ </property>
+ <property name="text">
+ <string>Break i&amp;f-else</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Break 'else if()' statements into two different lines.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>PaddingGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Padding</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Pad_ParenthesesIn</cstring>
+ </property>
+ <property name="text">
+ <string>Add spa&amp;ces inside parentheses</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Insert space padding around parenthesis on the inside only.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Pad_ParenthesesOut</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;dd spaces outside parentheses</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Insert space padding around parenthesis on the outside only.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Pad_ParenthesesUn</cstring>
+ </property>
+ <property name="text">
+ <string>Remove &amp;unnecessary spaces around parentheses</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Remove unnecessary space padding around parenthesis.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Pad_Operators</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add spaces around operators</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Insert space padding around operators.
+Once padded, operators stay padded.
+There is no unpad operator option.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>OneLinersGroup</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>One Liners</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Keep_Statements</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Keep one-line statements</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Do not break lines containing multiple statements into
+multiple single-statement lines.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>Keep_Blocks</cstring>
+ </property>
+ <property name="text">
+ <string>Keep o&amp;ne-line blocks</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Do not break blocks residing completely on one line.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Example</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QMultiLineEdit" row="0" column="0">
+ <property name="name">
+ <cstring>StyleExample</cstring>
+ </property>
+ <property name="palette">
+ <palette>
+ <active>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>237</red>
+ <green>237</green>
+ <blue>237</blue>
+ </color>
+ <color>
+ <red>110</red>
+ <green>110</green>
+ <blue>110</blue>
+ </color>
+ <color>
+ <red>146</red>
+ <green>146</green>
+ <blue>146</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>217</red>
+ <green>220</green>
+ <blue>194</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>84</red>
+ <green>112</green>
+ <blue>152</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </active>
+ <disabled>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>253</red>
+ <green>253</green>
+ <blue>253</blue>
+ </color>
+ <color>
+ <red>110</red>
+ <green>110</green>
+ <blue>110</blue>
+ </color>
+ <color>
+ <red>146</red>
+ <green>146</green>
+ <blue>146</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>128</red>
+ <green>128</green>
+ <blue>128</blue>
+ </color>
+ <color>
+ <red>217</red>
+ <green>220</green>
+ <blue>194</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>84</red>
+ <green>112</green>
+ <blue>152</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </disabled>
+ <inactive>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>253</red>
+ <green>253</green>
+ <blue>253</blue>
+ </color>
+ <color>
+ <red>110</red>
+ <green>110</green>
+ <blue>110</blue>
+ </color>
+ <color>
+ <red>146</red>
+ <green>146</green>
+ <blue>146</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>217</red>
+ <green>220</green>
+ <blue>194</blue>
+ </color>
+ <color>
+ <red>220</red>
+ <green>220</green>
+ <blue>220</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>84</red>
+ <green>112</green>
+ <blue>152</blue>
+ </color>
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </inactive>
+ </palette>
+ </property>
+ <property name="font">
+ <font>
+ <family>misc-fixed</family>
+ </font>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="undoDepth">
+ <number>0</number>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>Fill_Tabs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Fill_TabCount</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Fill_Tabs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Fill_ForceTabs</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Fill_Spaces</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Fill_SpaceCount</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Fill_Spaces</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Fill_ConvertTabs</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Brackets_Attach</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Brackets_CloseHeaders</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>Brackets_Linux</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>Brackets_CloseHeaders</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>ConfigTabs</tabstop>
+ <tabstop>Style_UserDefined</tabstop>
+ <tabstop>Fill_Tabs</tabstop>
+ <tabstop>Fill_TabCount</tabstop>
+ <tabstop>Fill_ForceTabs</tabstop>
+ <tabstop>Fill_SpaceCount</tabstop>
+ <tabstop>Fill_ConvertTabs</tabstop>
+ <tabstop>Fill_EmptyLines</tabstop>
+ <tabstop>Brackets_None</tabstop>
+ <tabstop>Brackets_CloseHeaders</tabstop>
+ <tabstop>Indent_Switches</tabstop>
+ <tabstop>Indent_Cases</tabstop>
+ <tabstop>Indent_Classes</tabstop>
+ <tabstop>Indent_Brackets</tabstop>
+ <tabstop>Indent_Namespaces</tabstop>
+ <tabstop>Indent_Labels</tabstop>
+ <tabstop>Indent_Blocks</tabstop>
+ <tabstop>Indent_Preprocessors</tabstop>
+ <tabstop>Continue_MaxStatement</tabstop>
+ <tabstop>Continue_MinConditional</tabstop>
+ <tabstop>Block_Break</tabstop>
+ <tabstop>Block_BreakAll</tabstop>
+ <tabstop>Block_IfElse</tabstop>
+ <tabstop>Pad_ParenthesesIn</tabstop>
+ <tabstop>Pad_ParenthesesOut</tabstop>
+ <tabstop>Pad_ParenthesesUn</tabstop>
+ <tabstop>Pad_Operators</tabstop>
+ <tabstop>Keep_Statements</tabstop>
+ <tabstop>Keep_Blocks</tabstop>
+ <tabstop>StyleExample</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot>allFiles()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/astyle/kdevastyle.desktop b/parts/astyle/kdevastyle.desktop
new file mode 100644
index 00000000..261e2edf
--- /dev/null
+++ b/parts/astyle/kdevastyle.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=A plugin for formatting of sourcecode according to a specified set of rules. When loaded it is found in the Tools menu.
+Comment[ca]=Un connector per a donar format al codi font d'acord a una sèrie de regles especificades. Quan està carregat apareixerà en el menú Eines.
+Comment[da]=Et plugin til at formatere kildekode ifølge et angivet sæt regler. Når det er indlæst er det i værktøjsmenuen.
+Comment[de]=Ein Modul zur Formatierung der Quelltexte nach vorgegebenen Regeln. Ist das Modul geladen, kann es über das Menü "Werkzeuge" aufgerufen werden.
+Comment[el]=Ένα πρόσθετο για τη μορφοποίηση του πηγαίου κώδικα σύμφωνα με το ορισμένο σύνολο κανόνων. Όταν φορτωθεί μπορεί να βρεθεί στο μενού εργαλείων.
+Comment[es]=Un complemento para dar formato al código fuente de acuerdo una serie de reglas especificadas. Cuando está cargado, aparece en el menú Herramientas.
+Comment[et]=Plugin lähtekoodi vormindamiseks vastavalt konkreetsetele reeglitele. Kasutamisel leiab selle tööriistade menüüst.
+Comment[eu]=Iturburu kodea emandako arau sorten arabera formateatuko da. Kargatzean Tresnak menuan aurkituko duzu.
+Comment[fa]=وصله‌ای برای قالب‌بندی کد منبع طبق یک سری قوانین مشخص‌شده. در هنگام بارگذاری در گزینگان ابزار یافت می‌شود.
+Comment[fr]=Un module externe pour le formatage du code source selon un ensemble de règles spécifié. Lorsqu'il est chargé, ce module externe se trouve dans le menu « Outils ».
+Comment[gl]=Unha extensión para formatear código seguindo un conxunto de regras. Cando se carga atópase no menú Ferramentas.
+Comment[hu]=Bővítőmodul forráskód formázásához, megadott szabályok alapján. Az Eszközök menüből érhető el, ha be van töltve.
+Comment[it]=Un plugin per formattare il codice sorgente secondo uno specifico insieme di regole. Quando sarà caricato lo troverai nel menu Strumenti.
+Comment[ja]=指定された規則にソースコードを書式化するためのプラグイン。読み込まれるとツールメニューで見つかります。
+Comment[ms]=Plugin untuk memformat kod sumber mengikut set peraturan yang ditetapkan. Apabila dimuatkan ia berada di menu Alatan.
+Comment[nds]=En Moduul för't Borntextformateren na angeven Regeln. Wenn dat Moduul laadt is, lett sik dat binnen dat Warktüüchmenü finnen.
+Comment[ne]=नियमको निर्दिष्ट सेट अनुसार स्रोतसङ्केतको ढाँचाबद्धताका लागि प्लगइन । लोड भएपछि यो उपकरण मेनुमा फेला पार्न सकिन्छ ।
+Comment[nl]=Een plugin om broncode te formatteren volgens een speciale set regels. Te vinden onder het menu Gereedschap.
+Comment[pl]=Wtyczka do formatowania kodu źródłowego zgodnie z podanymi zasadami. Po wczytaniu pojawia się w menu Narzędzia.
+Comment[pt]=Um 'plugin' para a formatação do código-fonte de acordo com um conjunto específico de regras. Quando é carregado, encontrar-se-á no menu Ferramentas.
+Comment[pt_BR]=Um plug-in para formatação do código fonte de acordo com um conjunto específico de regras. Quando carregado é encontrado no menu Ferramentas.
+Comment[ru]=Модуль для форматирования кода по установленным правилам.
+Comment[sk]=Modul pre formátovanie zdrojového kódu podľa špecifických pravidiel.Po načítaní ho nájdete v menu Nástroje.
+Comment[sr]=Прикључак за форматирање изворног кôда према прецизираном скупу правила. Када је учитан, налази се у менију „Алати“.
+Comment[sr@Latn]=Priključak za formatiranje izvornog kôda prema preciziranom skupu pravila. Kada je učitan, nalazi se u meniju „Alati“.
+Comment[sv]=Ett insticksprogram för att formatera källkod enligt en given uppsättning regler. När det laddats finns det i verktygsmenyn.
+Comment[ta]=மூல குறிமுறை வடிவத்தை மாற்றும் சொருகிக்கு சில குறிப்பிட்ட விதிமுறைகள் உள்ளது. ஏற்றியபின் இதனை கருவிப்பட்டியில் காணலாம்.
+Comment[tg]=Модул барои қолабгузории код аз рӯи қонунҳои гузошта шуда.
+Comment[tr]=Belli kurallara göre kaynak kodu biçimlendirmeye yarayan bir eklenti. Yüklendiğinde Araçlar menüsünde bulunabilir.
+Comment[zh_CN]=一个按照指定规则格式化源代码的插件。启动后显示在工具菜单。
+Comment[zh_TW]=一個根據特定規則將程式源碼格式化的外掛程式。載入後可以在工具選單中找到。
+Name=KDevAStyle
+Name[da]=KDevelop en stil
+Name[de]=Artistic-Style-Unterstützung (KDevelop)
+Name[hi]=के-डेव-ए-स्टाइल
+Name[nds]=Kodestil-Ünnerstütten för KDevelop
+Name[pl]=KDevStylA
+Name[sk]=KDev štýl
+Name[sv]=KDevelop A-stil
+Name[zh_TW]=KDevelop AStyle
+GenericName=Source Code Formatter
+GenericName[ca]=Formatador de codi font
+GenericName[da]=Kildekode-formatering
+GenericName[de]=Quelltext-Formatierer
+GenericName[el]=Μορφοποιητής πηγαίου κώδικα
+GenericName[es]=Formateador de código fuente
+GenericName[et]=Lähtekoodi vormindaja
+GenericName[eu]=Iturburu kode formateatzailea
+GenericName[fa]=قالب‌دهندۀ کد منبع
+GenericName[fr]=Formatage de code source
+GenericName[gl]=Formateador de código
+GenericName[hi]=स्रोत कोड फ़ॉर्मेटर
+GenericName[hu]=Forráskód-formázó
+GenericName[it]=Formattatore del codice sorgente
+GenericName[ja]=ソースコードフォーマッタ
+GenericName[ms]=Pemformat Kod Sumber
+GenericName[nds]=Borntext-Formateren
+GenericName[ne]=स्रोत सङ्केत ढाँचाबद्धक
+GenericName[nl]=Broncode formatteren
+GenericName[pl]=Formatowanie kodu źródłowego
+GenericName[pt]=Formatador de Código Fonte
+GenericName[pt_BR]=Formatador de Código Fonte
+GenericName[ru]=Форматирование исходного кода
+GenericName[sk]=Formátovač zdrojového kódu
+GenericName[sl]=Oblikovalec izvorne kode
+GenericName[sr]=Форматер изворног кода
+GenericName[sr@Latn]=Formater izvornog koda
+GenericName[sv]=Källkodsformatering
+GenericName[ta]=மூல குறியை வடிவமைப்பவர்
+GenericName[tg]=Қолабгузори коди берунӣ
+GenericName[tr]=Kaynak Kodu Biçimlendirici
+GenericName[zh_CN]=源代码格式化
+GenericName[zh_TW]=程式源碼格式器
+Icon=kdevelop
+ServiceTypes=KDevelop/SourceFormatter
+X-KDE-Library=libkdevastyle
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=CDevelopment,CPPDevelopment,JavaDevelopment
diff --git a/parts/astyle/kdevpart_astyle.rc b/parts/astyle/kdevpart_astyle.rc
new file mode 100644
index 00000000..69037425
--- /dev/null
+++ b/parts/astyle/kdevpart_astyle.rc
@@ -0,0 +1,17 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevAStyle" version="6">
+<MenuBar>
+ <Menu name="edit">
+ <Action name="edit_astyle" group="edit_astyle"/>
+ </Menu>
+ <Menu name="tools" >
+ <Action name="tools_astyle" group="tools_astyle"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="astyleToolBar">
+ <text>Astyle Toolbar</text>
+ <Action name="tools_astyle" group="tools_astyle"/>
+ <Action name="edit_astyle" group="edit_astyle"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/parts/bookmarks/Makefile.am b/parts/bookmarks/Makefile.am
new file mode 100644
index 00000000..87589dfe
--- /dev/null
+++ b/parts/bookmarks/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevbookmarks.la
+libkdevbookmarks_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevbookmarks_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevbookmarks_la_SOURCES = bookmarks_part.cpp bookmarks_widget.cpp bookmarks_settings_base.ui bookmarks_settings.cpp bookmarks_config.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevbookmarks.desktop
+
+noinst_HEADERS = bookmarks_settings.h bookmarks_config.h
diff --git a/parts/bookmarks/README b/parts/bookmarks/README
new file mode 100644
index 00000000..335789a8
--- /dev/null
+++ b/parts/bookmarks/README
@@ -0,0 +1 @@
+Please read the README.dox file
diff --git a/parts/bookmarks/README.dox b/parts/bookmarks/README.dox
new file mode 100644
index 00000000..10d86bd3
--- /dev/null
+++ b/parts/bookmarks/README.dox
@@ -0,0 +1,20 @@
+/** \class BookmarksPart
+This plugin provides a navigation view for bookmarks and persistance to editor bookmarks
+so that it is possible to have bookmarks in files that are not open and that these
+bookmarks are saved with the project.
+
+\feature Provides a navigation view for bookmarks
+
+\feature Persists bookmarks between sessions
+
+\authors <a href="jens.dagerbo AT swipnet.se">Jens Dagerbo</a> aka teatime
+
+\maintainer <a href="jens.dagerbo AT swipnet.se">Jens Dagerbo</a> aka teatime
+
+\bug Pre KDE-3.2 / KDE-3.1.3, using source reformatting, or
+the ReplacePart will result in katepart messing up bookmarks
+(and breakpoints). There is no current workaround.
+
+\requirement KDE >= 3.1.3
+
+*/
diff --git a/parts/bookmarks/bookmarks_config.cpp b/parts/bookmarks/bookmarks_config.cpp
new file mode 100644
index 00000000..095c3f83
--- /dev/null
+++ b/parts/bookmarks/bookmarks_config.cpp
@@ -0,0 +1,138 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <kconfig.h>
+#include <kapplication.h>
+
+#include "bookmarks_config.h"
+
+BookmarksConfig::BookmarksConfig()
+{
+ _context = 5;
+ _codeline = Never; // 0 - Never, 1 - Only if Comment, 2 - Always
+ _tooltip = true;
+}
+
+
+BookmarksConfig::~BookmarksConfig()
+{
+}
+
+
+/*!
+ \fn BookmarksConfig::writeConfig()
+ */
+void BookmarksConfig::writeConfig()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Bookmarks");
+
+ config->writeEntry("Context", _context );
+ config->writeEntry("Codeline", _codeline );
+ config->writeEntry("ToolTip", _tooltip );
+ config->writeEntry("Token", _token );
+
+ config->sync();
+}
+
+
+/*!
+ \fn BookmarksConfig::readConfig()
+ */
+void BookmarksConfig::readConfig()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Bookmarks");
+
+ _context = config->readPropertyEntry( "Context", 5 ).toInt();
+ _tooltip = config->readBoolEntry( "ToolTip", true );
+ _token = config->readEntry( "Token", "//" );
+ unsigned int cl = config->readPropertyEntry( "Codeline", 0 ).toInt();
+
+ switch( cl )
+ {
+ case 1:
+ _codeline = Token;
+ break;
+ case 2:
+ _codeline = Always;
+ break;
+ default:
+ _codeline = Never;
+ }
+
+ if ( _context > 15 ) _context = 15;
+}
+
+
+/*!
+ \fn BookmarksConfig::toolTip
+ */
+bool BookmarksConfig::toolTip()
+{
+ return _tooltip;
+}
+
+
+/*!
+ \fn BookmarksConfig::codeline
+ */
+BookmarksConfig::CodeLineType BookmarksConfig::codeline()
+{
+ return _codeline;
+}
+
+
+/*!
+ \fn BookmarksConfig::context()
+ */
+unsigned int BookmarksConfig::context()
+{
+ return _context;
+}
+
+
+/*!
+ \fn BookmarksConfig::setCodeline( CodeLineType )
+ */
+void BookmarksConfig::setCodeline( CodeLineType codeline )
+{
+ _codeline = codeline;
+}
+
+/*!
+ \fn BookmarksConfig::setContext( unsigned int )
+ */
+void BookmarksConfig::setContext( unsigned int context )
+{
+ _context = context;
+}
+
+
+/*!
+ \fn BookmarksConfig::setToolTip( bool )
+ */
+void BookmarksConfig::setToolTip( bool tooltip )
+{
+ _tooltip = tooltip;
+}
+
+QString BookmarksConfig::token( )
+{
+ return _token;
+}
+
+void BookmarksConfig::setToken( QString const & token )
+{
+ _token = token;
+}
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_config.h b/parts/bookmarks/bookmarks_config.h
new file mode 100644
index 00000000..c372eb51
--- /dev/null
+++ b/parts/bookmarks/bookmarks_config.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 BOOKMARKS_CONFIG_H
+#define BOOKMARKS_CONFIG_H
+
+/**
+@author KDevelop Authors
+*/
+class BookmarksConfig
+{
+
+public:
+
+ enum CodeLineType { Never = 0, Token, Always };
+
+ BookmarksConfig();
+ ~BookmarksConfig();
+
+ bool toolTip();
+ void setToolTip( bool );
+
+ CodeLineType codeline();
+ void setCodeline( CodeLineType );
+
+ unsigned int context();
+ void setContext( unsigned int );
+
+ QString token();
+ void setToken( QString const & );
+
+ void readConfig();
+ void writeConfig();
+
+private:
+ bool _tooltip;
+ CodeLineType _codeline;
+ unsigned int _context;
+ QString _token;
+
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_part.cpp b/parts/bookmarks/bookmarks_part.cpp
new file mode 100644
index 00000000..f23863af
--- /dev/null
+++ b/parts/bookmarks/bookmarks_part.cpp
@@ -0,0 +1,568 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qwhatsthis.h>
+#include <qvbox.h>
+#include <qtimer.h>
+#include <qtextstream.h>
+#include <qfile.h>
+
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <ktexteditor/markinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/document.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include "domutil.h"
+
+#include "bookmarks_widget.h"
+#include "bookmarks_part.h"
+#include "bookmarks_settings.h"
+#include "bookmarks_config.h"
+
+#include <configwidgetproxy.h>
+#include <kdevplugininfo.h>
+
+#define BOOKMARKSETTINGSPAGE 1
+
+typedef KDevGenericFactory<BookmarksPart> BookmarksFactory;
+static const KDevPluginInfo data("kdevbookmarks");
+K_EXPORT_COMPONENT_FACTORY( libkdevbookmarks, BookmarksFactory( data ) )
+
+BookmarksPart::BookmarksPart(QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin(&data, parent, name ? name : "BookmarksPart" )
+{
+ setInstance(BookmarksFactory::instance());
+
+ _widget = new BookmarksWidget(this);
+
+ _widget->setCaption(i18n("Bookmarks"));
+ _widget->setIcon(SmallIcon( info()->icon() ));
+
+ _marksChangeTimer = new QTimer( this );
+
+ QWhatsThis::add(_widget, i18n("<b>Bookmarks</b><p>"
+ "The bookmark viewer shows all the source bookmarks in the project."));
+
+ mainWindow()->embedSelectView(_widget, i18n("Bookmarks"), i18n("Source bookmarks"));
+
+ _editorMap.setAutoDelete( true );
+ _settingMarks = false;
+
+ connect( partController(), SIGNAL( partAdded( KParts::Part * ) ), this, SLOT( partAdded( KParts::Part * ) ) );
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("Bookmarks"), BOOKMARKSETTINGSPAGE, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+ connect( _widget, SIGNAL( removeAllBookmarksForURL( const KURL & ) ),
+ this, SLOT( removeAllBookmarksForURL( const KURL & ) ) );
+ connect( _widget, SIGNAL( removeBookmarkForURL( const KURL &, int ) ),
+ this, SLOT( removeBookmarkForURL( const KURL &, int ) ) );
+
+ connect( _marksChangeTimer, SIGNAL( timeout() ), this, SLOT( marksChanged() ) );
+
+ _config = new BookmarksConfig;
+ _config->readConfig();
+
+ storeBookmarksForAllURLs();
+ updateContextStringForAll();
+ _widget->update( _editorMap );
+}
+
+BookmarksPart::~BookmarksPart()
+{
+ if( _widget ) {
+ mainWindow()->removeView( _widget );
+ delete _widget;
+ }
+ delete _config;
+ delete _configProxy;
+}
+
+void BookmarksPart::partAdded( KParts::Part * part )
+{
+ //kdDebug(0) << "BookmarksPart::partAdded()" << endl;
+
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( part ) )
+ {
+ if ( setBookmarksForURL( ro_part ) )
+ {
+ updateContextStringForURL( ro_part );
+ if ( EditorData * data = _editorMap.find( ro_part->url().path() ) )
+ {
+ _widget->updateURL( data );
+ }
+
+ // connect to this editor
+ KTextEditor::Document * doc = static_cast<KTextEditor::Document*>( ro_part );
+ connect( doc, SIGNAL( marksChanged() ), this, SLOT( marksEvent() ) );
+
+ // workaround for a katepart oddity where it drops all bookmarks on 'reload'
+ connect( doc, SIGNAL( completed() ), this, SLOT( reload() ) );
+ }
+ }
+}
+
+void BookmarksPart::reload()
+{
+ //kdDebug(0) << "BookmarksPart::reload()" << endl;
+
+ QObject * senderobj = const_cast<QObject*>( sender() );
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( senderobj ) )
+ {
+ if ( partIsSane( ro_part ) )
+ {
+ setBookmarksForURL( ro_part );
+ }
+ }
+}
+
+void BookmarksPart::marksEvent()
+{
+ //kdDebug(0) << "BookmarksPart::marksEvent()" << endl;
+
+ if ( ! _settingMarks )
+ {
+ QObject * senderobj = const_cast<QObject*>( sender() );
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( senderobj );
+
+ if ( partIsSane( ro_part ) && !_dirtyParts.contains( ro_part ) )
+ {
+ _dirtyParts.push_back( ro_part );
+ _marksChangeTimer->start( 1000, true );
+ }
+ }
+}
+
+void BookmarksPart::marksChanged()
+{
+ //kdDebug(0) << "BookmarksPart::marksChanged()" << endl;
+
+ QValueListIterator<KParts::ReadOnlyPart*> it = _dirtyParts.begin();
+ while ( it != _dirtyParts.end() )
+ {
+ KParts::ReadOnlyPart * ro_part = *it;
+ if ( partIsSane( ro_part ) )
+ {
+ if ( dynamic_cast<KTextEditor::MarkInterface*>( ro_part ) )
+ {
+ if ( EditorData * data = storeBookmarksForURL( ro_part ) )
+ {
+ updateContextStringForURL( ro_part );
+ _widget->updateURL( data );
+ }
+ else
+ {
+ _widget->removeURL( ro_part->url() );
+ }
+ }
+ }
+ ++it;
+ }
+ _dirtyParts.clear();
+}
+
+void BookmarksPart::restorePartialProjectSession( const QDomElement * el )
+{
+ //kdDebug(0) << "BookmarksPart::restorePartialProjectSession()" << endl;
+
+ if ( ! el ) return;
+
+ QDomElement bookmarksList = el->namedItem( "bookmarks" ).toElement();
+ if ( bookmarksList.isNull() ) return;
+
+ QDomElement bookmark = bookmarksList.firstChild().toElement();
+ while ( ! bookmark.isNull() )
+ {
+ QString path = bookmark.attribute( "url" );
+ if ( path != QString::null )
+ {
+ EditorData * data = new EditorData;
+ data->url.setPath( path );
+
+ QDomElement mark = bookmark.firstChild().toElement();
+ while ( ! mark.isNull() )
+ {
+ QString line = mark.attribute( "line" );
+ if ( line != QString::null )
+ {
+ data->marks.append( qMakePair( line.toInt(), QString() ) );
+ }
+ mark = mark.nextSibling().toElement();
+ }
+
+ if ( ! data->marks.isEmpty() )
+ {
+ _editorMap.insert( data->url.path(), data );
+ }
+ else
+ {
+ delete data;
+ }
+ }
+ bookmark = bookmark.nextSibling().toElement();
+ }
+ setBookmarksForAllURLs();
+ updateContextStringForAll();
+ _widget->update( _editorMap );
+}
+
+void BookmarksPart::savePartialProjectSession( QDomElement * el )
+{
+ //kdDebug(0) << "BookmarksPart::savePartialProjectSession()" << endl;
+
+ if ( ! el ) return;
+
+ QDomDocument domDoc = el->ownerDocument();
+ if ( domDoc.isNull() ) return;
+
+ QDomElement bookmarksList = domDoc.createElement( "bookmarks" );
+
+ QDictIterator<EditorData> it( _editorMap );
+ while ( it.current() )
+ {
+ QDomElement bookmark = domDoc.createElement( "bookmark" );
+ bookmark.setAttribute( "url", it.current()->url.path() );
+ bookmarksList.appendChild( bookmark );
+
+ QValueListIterator< QPair<int,QString> > it2 = it.current()->marks.begin();
+ while ( it2 != it.current()->marks.end() )
+ {
+ QDomElement line = domDoc.createElement( "mark" );
+ line.setAttribute( "line", (*it2).first );
+ bookmark.appendChild( line );
+ ++it2;
+ }
+ ++it;
+ }
+
+ if ( ! bookmarksList.isNull() )
+ {
+ el->appendChild( bookmarksList );
+ }
+}
+
+void BookmarksPart::removeAllBookmarksForURL( KURL const & url )
+{
+ //kdDebug(0) << "BookmarksPart::removeAllBookmarksForURL()" << endl;
+
+ _editorMap.remove( url.path() );
+
+ setBookmarksForURL( partForURL( url ) );
+ _widget->removeURL( url );
+}
+
+void BookmarksPart::removeBookmarkForURL( KURL const & url, int line )
+{
+ //kdDebug(0) << "BookmarksPart::removeBookmarkForURL()" << endl;
+
+ if ( EditorData * data = _editorMap.find( url.path() ) )
+ {
+ QValueListIterator< QPair<int,QString> > it = data->marks.begin();
+ while ( it != data->marks.end() )
+ {
+ if ( (*it).first == line )
+ {
+ data->marks.remove( it );
+ break;
+ }
+ ++it;
+ }
+
+ if ( data->marks.isEmpty() )
+ {
+ removeAllBookmarksForURL( url );
+ }
+ else
+ {
+ setBookmarksForURL( partForURL( url ) );
+ _widget->updateURL( data );
+ }
+ }
+}
+
+void BookmarksPart::updateContextStringForURL( KParts::ReadOnlyPart * ro_part )
+{
+ if ( ! ro_part ) return;
+
+ KTextEditor::EditInterface * ed =
+ dynamic_cast<KTextEditor::EditInterface *>( ro_part );
+
+ EditorData * data = _editorMap.find( ro_part->url().path() );
+
+ if ( ! ( data && ed ) ) return;
+
+ QValueListIterator< QPair<int,QString> > it = data->marks.begin();
+ while ( it != data->marks.end() )
+ {
+ (*it).second = ed->textLine( (*it).first );
+ ++it;
+ }
+}
+
+void BookmarksPart::updateContextStringForURL( KURL const & url )
+{
+ updateContextStringForURL( partForURL( url ) );
+}
+
+void BookmarksPart::updateContextStringForAll()
+{
+ QDictIterator<EditorData> it( _editorMap );
+ while ( it.current() )
+ {
+ if ( ! it.current()->marks.isEmpty() )
+ {
+ updateContextStringForURL( it.current()->url );
+ }
+ ++it;
+ }
+}
+
+bool BookmarksPart::setBookmarksForURL( KParts::ReadOnlyPart * ro_part )
+{
+ if ( KTextEditor::MarkInterface * mi = dynamic_cast<KTextEditor::MarkInterface *>(ro_part) )
+ {
+ clearBookmarksForURL( ro_part );
+
+ _settingMarks = true;
+
+ if ( EditorData * data = _editorMap.find( ro_part->url().path() ) )
+ {
+ // we've seen this one before, apply stored bookmarks
+
+ QValueListIterator< QPair<int,QString> > it = data->marks.begin();
+ while ( it != data->marks.end() )
+ {
+ mi->addMark( (*it).first, KTextEditor::MarkInterface::markType01 );
+ ++it;
+ }
+ }
+ _settingMarks = false;
+
+ // true == this is a MarkInterface
+ return true;
+ }
+ return false;
+}
+
+// Note: This method is only a convenience method to clear the bookmark marks,
+// the way a hypothetical KTextEditor::MarkInterface::clearMarks( uint markType )
+// would work.
+bool BookmarksPart::clearBookmarksForURL( KParts::ReadOnlyPart * ro_part )
+{
+ if ( KTextEditor::MarkInterface * mi = dynamic_cast<KTextEditor::MarkInterface *>(ro_part) )
+ {
+ _settingMarks = true;
+
+ QPtrList<KTextEditor::Mark> marks = mi->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while ( it.current() )
+ {
+ if ( it.current()->type & KTextEditor::MarkInterface::markType01 )
+ {
+ mi->removeMark( it.current()->line, KTextEditor::MarkInterface::markType01 );
+ }
+ ++it;
+ }
+
+ _settingMarks = false;
+
+ // true == this is a MarkInterface
+ return true;
+ }
+ return false;
+}
+
+EditorData * BookmarksPart::storeBookmarksForURL( KParts::ReadOnlyPart * ro_part )
+{
+ //kdDebug(0) << "BookmarksPart::storeBookmarksForURL()" << endl;
+
+ if ( KTextEditor::MarkInterface * mi = dynamic_cast<KTextEditor::MarkInterface *>( ro_part ) )
+ {
+ EditorData * data = new EditorData;
+ data->url = ro_part->url();
+
+ // removing previous data for this url, if any
+ _editorMap.remove( data->url.path() );
+
+ QPtrList<KTextEditor::Mark> marks = mi->marks();
+ QPtrListIterator<KTextEditor::Mark> it( marks );
+ while ( it.current() )
+ {
+ if ( it.current()->type & KTextEditor::MarkInterface::markType01 )
+ {
+ int line = it.current()->line;
+ data->marks.append( qMakePair( line, QString() ) );
+ }
+ ++it;
+ }
+
+ if ( ! data->marks.isEmpty() )
+ {
+ _editorMap.insert( data->url.path(), data );
+ }
+ else
+ {
+ delete data;
+ data = 0;
+ }
+ return data;
+ }
+ return 0;
+}
+
+void BookmarksPart::setBookmarksForAllURLs()
+{
+ if( const QPtrList<KParts::Part> * partlist = partController()->parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part* part = it.current() )
+ {
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( part ) )
+ {
+ setBookmarksForURL( ro_part );
+ }
+ ++it;
+ }
+ }
+}
+
+void BookmarksPart::storeBookmarksForAllURLs()
+{
+ if( const QPtrList<KParts::Part> * partlist = partController()->parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part* part = it.current() )
+ {
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart *>( part ) )
+ {
+ storeBookmarksForURL( ro_part );
+ }
+ ++it;
+ }
+ }
+}
+
+// reimplemented from PartController::partForURL to avoid linking
+KParts::ReadOnlyPart * BookmarksPart::partForURL( KURL const & url )
+{
+ QPtrListIterator<KParts::Part> it( *partController()->parts() );
+ while( it.current() )
+ {
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current());
+ if (ro_part && url == ro_part->url())
+ {
+ return ro_part;
+ }
+ ++it;
+ }
+ return 0;
+}
+
+bool BookmarksPart::partIsSane( KParts::ReadOnlyPart * ro_part )
+{
+ return ( ro_part != 0 ) &&
+ partController()->parts()->contains( ro_part) &&
+ !ro_part->url().path().isEmpty();
+}
+
+void BookmarksPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ kdDebug() << k_funcinfo << endl;
+
+ if ( pagenumber == BOOKMARKSETTINGSPAGE )
+ {
+ BookmarkSettings * w = new BookmarkSettings( this, page );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ }
+}
+
+////////////////////////////////////////////
+
+QStringList BookmarksPart::getContextFromStream( QTextStream & istream, unsigned int line, unsigned int context )
+{
+ kdDebug() << k_funcinfo << endl;
+
+ int startline = context > line ? 0 : line - context;
+ int endline = line + context;
+
+ int n = 0;
+ QStringList list;
+ while ( !istream.atEnd() )
+ {
+ QString templine = istream.readLine();
+ if ( (n >= startline) && ( n <= endline ) )
+ {
+ list << templine;
+ }
+ n++;
+ }
+
+ // maybe pad empty lines to the tail
+ while( n < endline )
+ {
+ list.append( " " );
+ n++;
+ }
+
+ // maybe pad empty lines to the head
+ while( list.count() < ( context * 2 + 1) )
+ {
+ list.prepend( " " );
+ }
+
+ return list;
+}
+
+QStringList BookmarksPart::getContext( KURL const & url, unsigned int line, unsigned int context )
+{
+ // if the file is open - get the line from the editor buffer
+ if ( KTextEditor::EditInterface * ei = dynamic_cast<KTextEditor::EditInterface*>( partForURL( url ) ) )
+ {
+ kdDebug() << "the file is open - get the line from the editor buffer" << endl;
+
+ QString ibuffer = ei->text();
+ QTextStream istream( &ibuffer, IO_ReadOnly );
+ return getContextFromStream( istream, line, context );
+ }
+ else if ( url.isLocalFile() ) // else the file is not open - get the line from the file on disk
+ {
+ kdDebug() << "the file is not open - get the line from the file on disk" << endl;
+
+ QFile file( url.path() );
+ QString buffer;
+
+ if ( file.open( IO_ReadOnly ) )
+ {
+ QTextStream istream( &file );
+ return getContextFromStream( istream, line, context );
+ }
+ }
+ return QStringList( i18n("Could not find file") );
+}
+
+BookmarksConfig * BookmarksPart::config( )
+{
+ return _config;
+}
+
+#include "bookmarks_part.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_part.h b/parts/bookmarks/bookmarks_part.h
new file mode 100644
index 00000000..32a105ad
--- /dev/null
+++ b/parts/bookmarks/bookmarks_part.h
@@ -0,0 +1,109 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __KDEVPART_BOOKMARKS_H__
+#define __KDEVPART_BOOKMARKS_H__
+
+
+#include <qguardedptr.h>
+#include <qvaluelist.h>
+#include <qdict.h>
+#include <qpair.h>
+
+#include <kparts/part.h>
+#include <kurl.h>
+
+#include <kdevplugin.h>
+
+class QTimer;
+class KDialogBase;
+class BookmarksConfig;
+class ConfigWidgetProxy;
+
+struct EditorData
+{
+ KURL url;
+ QValueList< QPair<int,QString> > marks;
+};
+
+class BookmarksWidget;
+class QDomElement;
+
+class BookmarksPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ BookmarksPart(QObject *parent, const char *name, const QStringList &);
+ ~BookmarksPart();
+
+ // reimplemented from KDevPlugin
+ void restorePartialProjectSession( const QDomElement * el );
+ void savePartialProjectSession( QDomElement * el );
+
+ BookmarksConfig * config();
+
+ QStringList getContext( KURL const & url, unsigned int line, unsigned int context );
+
+private slots:
+ // connected to partcontroller
+ void partAdded( KParts::Part * part );
+
+ // connected to KTextEditor::MarkInterface
+ void marksEvent();
+
+ // connected to _marksChangeTimer
+ void marksChanged();
+
+ // connected to KParts::ReadOnlyPart
+ void reload();
+
+ // connected to BookmarksWidget
+ void removeAllBookmarksForURL( const KURL & );
+ void removeBookmarkForURL( const KURL &, int );
+
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int );
+
+private:
+ bool setBookmarksForURL( KParts::ReadOnlyPart * );
+ bool clearBookmarksForURL( KParts::ReadOnlyPart * );
+ void setBookmarksForAllURLs();
+
+ EditorData * storeBookmarksForURL( KParts::ReadOnlyPart * );
+ void storeBookmarksForAllURLs();
+
+ void updateContextStringForURL( KParts::ReadOnlyPart * );
+ void updateContextStringForURL( KURL const & url );
+ void updateContextStringForAll();
+
+ QStringList getContextFromStream( QTextStream & istream, unsigned int line, unsigned int context );
+
+ KParts::ReadOnlyPart * partForURL( KURL const & url );
+ bool partIsSane( KParts::ReadOnlyPart * );
+
+ QGuardedPtr<BookmarksWidget> _widget;
+ QDict<EditorData> _editorMap;
+ bool _settingMarks; // are we currently in the process of setting bookmarks?
+
+ BookmarksConfig * _config;
+
+ ConfigWidgetProxy * _configProxy;
+
+ QTimer * _marksChangeTimer;
+ QValueList<KParts::ReadOnlyPart*> _dirtyParts;
+};
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_settings.cpp b/parts/bookmarks/bookmarks_settings.cpp
new file mode 100644
index 00000000..235ec261
--- /dev/null
+++ b/parts/bookmarks/bookmarks_settings.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qradiobutton.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <klineedit.h>
+
+#include "bookmarks_part.h"
+#include "bookmarks_config.h"
+#include "bookmarks_settings.h"
+
+
+BookmarkSettings::BookmarkSettings( BookmarksPart * part, QWidget* parent, const char* name, WFlags fl )
+: BookmarkSettingsBase( parent, name, fl ), m_part( part )
+{
+ m_part->config()->readConfig();
+
+ if ( m_part->config()->codeline() == BookmarksConfig::Never )
+ {
+ radioButton1->setChecked( true );
+ }
+ else if ( m_part->config()->codeline() == BookmarksConfig::Token )
+ {
+ radioButton2->setChecked( true );
+ }
+ else
+ {
+ radioButton3->setChecked( true );
+ }
+
+ checkBox1->setChecked( m_part->config()->toolTip() );
+ spinBox1->setValue( m_part->config()->context() );
+ lineEdit1->setText( m_part->config()->token() );
+}
+
+BookmarkSettings::~BookmarkSettings()
+{
+}
+
+void BookmarkSettings::slotAccept()
+{
+ BookmarksConfig::CodeLineType codeline = BookmarksConfig::Never;
+ codeline = radioButton1->isChecked() ? BookmarksConfig::Never : codeline;
+ codeline = radioButton2->isChecked() ? BookmarksConfig::Token : codeline;
+ codeline = radioButton3->isChecked() ? BookmarksConfig::Always : codeline;
+ m_part->config()->setCodeline( codeline );
+ m_part->config()->setToolTip( checkBox1->isChecked() );
+ m_part->config()->setContext( spinBox1->value() );
+ m_part->config()->setToken( lineEdit1->text() );
+
+ m_part->config()->writeConfig();
+}
+
+
+#include "bookmarks_settings.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_settings.h b/parts/bookmarks/bookmarks_settings.h
new file mode 100644
index 00000000..3fa6c5e9
--- /dev/null
+++ b/parts/bookmarks/bookmarks_settings.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 BOOKMARKS_SETTINGS_H
+#define BOOKMARKS_SETTINGS_H
+
+#include "bookmarks_settings_base.h"
+
+class BookmarksPart;
+
+class BookmarkSettings : public BookmarkSettingsBase
+{
+ Q_OBJECT
+
+public:
+ BookmarkSettings( BookmarksPart * part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~BookmarkSettings();
+
+public slots:
+ void slotAccept();
+
+protected:
+
+protected slots:
+
+private:
+
+ BookmarksPart * m_part;
+
+};
+
+#endif
+
diff --git a/parts/bookmarks/bookmarks_settings_base.ui b/parts/bookmarks/bookmarks_settings_base.ui
new file mode 100644
index 00000000..2d7ab1a2
--- /dev/null
+++ b/parts/bookmarks/bookmarks_settings_base.ui
@@ -0,0 +1,240 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>BookmarkSettingsBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BookmarkSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>622</width>
+ <height>490</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Code Tooltip</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If checked, a tooltip will be shown when the mouse is over the bookmark, containing the text in the area surrounding it. &lt;p&gt; How many surrounding lines to include is decided by the value in the context box.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkBox1</cstring>
+ </property>
+ <property name="text">
+ <string>Show code &amp;tooltip</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></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>&amp;Lines of context:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>spinBox1</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>spinBox1</cstring>
+ </property>
+ <property name="maxValue">
+ <number>15</number>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <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>121</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Show Bookmarked Codeline in Bookmark Panel</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This decides if the bookmark panel should show the content of the bookmarked line in addition to the line number.&lt;p&gt;This can be made optional depending on the start of the line, typically used for only showing lines containing a comment.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Never</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Only lines beginning with the following string:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>lineEdit1</cstring>
+ </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>71</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Always</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Always show the bookmarked line in addition to the line number</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <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>240</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>checkBox1</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>spinBox1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>checkBox1</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>radioButton2</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lineEdit1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/bookmarks/bookmarks_widget.cpp b/parts/bookmarks/bookmarks_widget.cpp
new file mode 100644
index 00000000..683c32e1
--- /dev/null
+++ b/parts/bookmarks/bookmarks_widget.cpp
@@ -0,0 +1,336 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qdict.h>
+#include <qheader.h>
+#include <qtooltip.h>
+#include <qpair.h>
+#include <qstylesheet.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kpopupmenu.h>
+#include <klocale.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevcore.h>
+
+
+#include "bookmarks_part.h"
+#include "bookmarks_widget.h"
+#include "bookmarks_config.h"
+
+namespace
+{
+
+// shamelessly lifted from kdelibs/kate/part/kateviewhelpers.cpp
+static const char* const bookmark_xpm[]={
+"12 12 4 1",
+"b c #808080",
+"a c #000080",
+"# c #0000ff",
+". c None",
+"........###.",
+".......#...a",
+"......#.##.a",
+".....#.#..aa",
+"....#.#...a.",
+"...#.#.a.a..",
+"..#.#.a.a...",
+".#.#.a.a....",
+"#.#.a.a.....",
+"#.#a.a......",
+"#...a.......",
+".aaa........"};
+
+}
+
+class BookmarkItem : public QListViewItem
+{
+public:
+ BookmarkItem( QListView * parent, KURL const & url )
+ : QListViewItem( parent, url.fileName() ),
+ _url( url ), _line( -1 ), _isBookmark( false )
+ {}
+
+ BookmarkItem( QListViewItem * parent, KURL const & url, QPair<int,QString> mark )
+ : QListViewItem( parent, QString::number( mark.first +1 ).rightJustify( 5 ) ),
+ _url( url ), _line( mark.first ), _isBookmark( true )
+ {
+ BookmarksWidget * lv = static_cast<BookmarksWidget*>( listView() );
+ BookmarksConfig::CodeLineType codeline = lv->config()->codeline();
+
+ if ( codeline == BookmarksConfig::Never )
+ {
+ return;
+ }
+
+ if ( codeline == BookmarksConfig::Token )
+ {
+ if ( mark.second.startsWith( lv->config()->token() ) )
+ {
+ setText( 0, text( 0 ) + " " + mark.second );
+ }
+ return;
+ }
+
+ setText( 0, text( 0 ) + " " + mark.second );
+ }
+
+ KURL url()
+ {
+ return _url;
+ }
+ int line()
+ {
+ return _line;
+ }
+
+ QString tipText()
+ {
+ if ( _isBookmark )
+ {
+ BookmarksWidget * w = static_cast<BookmarksWidget*> ( listView() );
+ QStringList list = w->getContext( _url, _line );
+
+ QString code = "<qt><table><tr><td><pre>";
+ for ( uint i = 0; i < list.count(); i++)
+ {
+ QString temp = QStyleSheet::escape( list[i] );
+
+ if ( i == (list.count() / 2) ) // count() is always odd
+ {
+ temp = "<b>" + temp + "</b>";
+ }
+ code += temp + "\n";
+ }
+ code += "</pre></td></tr></table></qt>";
+
+ return code;
+ }
+ else
+ {
+ return _url.prettyURL();
+ }
+ }
+
+ bool isBookmark()
+ {
+ return _isBookmark;
+ }
+
+private:
+ KURL _url;
+ int _line;
+ bool _isBookmark;
+ QString _code;
+
+};
+
+BookmarksWidget::BookmarksWidget(BookmarksPart *part)
+ : KListView(0, "bookmarks widget"), QToolTip( viewport() ),
+ _part( part )
+
+{
+ addColumn( QString::null );
+ header()->hide();
+ setRootIsDecorated( true );
+ setResizeMode( QListView::LastColumn );
+ setAllColumnsShowFocus( true );
+// setSortColumn( -1 );
+
+ connect( this, SIGNAL( executed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( returnPressed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ),
+ this, SLOT( popupMenu(QListViewItem *, const QPoint & , int ) ) );
+}
+
+
+BookmarksWidget::~BookmarksWidget()
+{}
+
+void BookmarksWidget::maybeTip(const QPoint &p)
+{
+// kdDebug(0) << "ToolTip::maybeTip()" << endl;
+
+ if ( ! _part->config()->toolTip() ) return;
+
+ BookmarkItem * item = dynamic_cast<BookmarkItem*>( itemAt( p ) );
+ QRect r = itemRect( item );
+
+ if ( item && r.isValid() )
+ {
+ tip( r, item->tipText() );
+ }
+}
+
+void BookmarksWidget::update( QDict<EditorData> const & map )
+{
+// kdDebug(0) << "BookmarksWidget::update()" << endl;
+
+ QListView::clear();
+
+ QDictIterator<EditorData> it( map );
+ while ( it.current() )
+ {
+ if ( ! it.current()->marks.isEmpty() )
+ {
+ createURL( it.current() );
+ }
+ ++it;
+ }
+}
+
+void BookmarksWidget::updateURL( EditorData * data )
+{
+// kdDebug(0) << "BookmarksWidget::updateURL()" << endl;
+
+ // remove the node that contains 'data'
+ removeURL( data->url );
+
+ // create it again with new data
+ createURL( data );
+}
+
+void BookmarksWidget::createURL( EditorData * data )
+{
+// kdDebug(0) << "BookmarksWidget::createURL()" << endl;
+
+ if ( data )
+ {
+ QListViewItem * file = new BookmarkItem( this, data->url );
+ file->setOpen( true );
+ file->setPixmap( 0, SmallIcon( "document" ) );
+
+ QValueListIterator< QPair<int,QString> > it = data->marks.begin();
+ while ( it != data->marks.end() )
+ {
+ QListViewItem * item = new BookmarkItem( file, data->url, *it );
+ item->setPixmap( 0, QPixmap((const char**)bookmark_xpm) );
+ ++it;
+ }
+ }
+}
+
+bool BookmarksWidget::removeURL( KURL const & url )
+{
+// kdDebug(0) << "BookmarksWidget::removeURL()" << endl;
+
+ QListViewItem * item = firstChild();
+ while ( item )
+ {
+ BookmarkItem * bm = static_cast<BookmarkItem*>(item);
+ if ( bm->url() == url )
+ {
+ delete item;
+ return true;
+ }
+ item = item->nextSibling();
+ }
+ return false;
+}
+
+void BookmarksWidget::doEmitRemoveBookMark()
+{
+// kdDebug(0) << "BookmarksWidget::doEmitRemoveBookMark()" << endl;
+
+ if ( _selectedItem->isBookmark() )
+ {
+ emit removeBookmarkForURL( _selectedItem->url(), _selectedItem->line() );
+ }
+ else
+ {
+ emit removeAllBookmarksForURL( _selectedItem->url() );
+ }
+}
+
+void BookmarksWidget::popupMenu( QListViewItem * item, const QPoint & p, int )
+{
+// kdDebug(0) << "BookmarksWidget::contextMenuRequested()" << endl;
+
+ if ( item )
+ {
+ _selectedItem = static_cast<BookmarkItem *>(item);
+
+ KPopupMenu popup;
+
+ if ( _selectedItem->isBookmark() )
+ {
+ popup.insertTitle( _selectedItem->url().fileName() + i18n(", line ")
+ + QString::number( _selectedItem->line() +1 ) );
+
+ popup.insertItem( i18n("Remove This Bookmark"), this, SLOT( doEmitRemoveBookMark() ) );
+ }
+ else
+ {
+ popup.insertTitle( _selectedItem->url().fileName() + i18n( ", All" ) );
+ popup.insertItem( i18n("Remove These Bookmarks"), this, SLOT( doEmitRemoveBookMark() ) );
+ }
+
+ popup.insertSeparator();
+
+ popup.insertItem( i18n( "Collapse All" ), this, SLOT(collapseAll()) );
+ popup.insertItem( i18n( "Expand All" ), this, SLOT(expandAll()) );
+
+ popup.exec(p);
+ }
+
+}
+
+void BookmarksWidget::itemClicked( QListViewItem * clickedItem )
+{
+// kdDebug(0) << "BookmarksWidget::itemClicked()" << endl;
+
+ if ( ! clickedItem )
+ return;
+
+ BookmarkItem * item = static_cast<BookmarkItem*>( clickedItem );
+ _part->partController()->editDocument( item->url(), item->line() );
+
+}
+
+BookmarksConfig * BookmarksWidget::config( )
+{
+ return _part->config();
+}
+
+QStringList BookmarksWidget::getContext( KURL const & url, unsigned int line )
+{
+ return _part->getContext( url, line, config()->context() );
+}
+
+void BookmarksWidget::collapseAll( )
+{
+ QListViewItem * it = firstChild();
+ while( it )
+ {
+ it->setOpen( false );
+ it = it->nextSibling();
+ }
+}
+
+void BookmarksWidget::expandAll( )
+{
+ QListViewItem * it = firstChild();
+ while( it )
+ {
+ it->setOpen( true );
+ it = it->nextSibling();
+ }
+}
+
+
+#include "bookmarks_widget.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/bookmarks_widget.h b/parts/bookmarks/bookmarks_widget.h
new file mode 100644
index 00000000..96bfe046
--- /dev/null
+++ b/parts/bookmarks/bookmarks_widget.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __BOOKMARKS_WIDGET_H__
+#define __BOOKMARKS_WIDGET_H__
+
+
+#include <qwidget.h>
+#include <qstring.h>
+//#include <qlistview.h>
+#include <qtooltip.h>
+
+#include <klistview.h>
+
+#include "bookmarks_part.h"
+
+class BookmarksPart;
+class BookmarkItem;
+class BookmarksConfig;
+
+class BookmarksWidget : public KListView, public QToolTip
+{
+ Q_OBJECT
+
+public:
+ BookmarksWidget( BookmarksPart * );
+ ~BookmarksWidget();
+
+ void update( QDict<EditorData> const & );
+ void updateURL( EditorData * );
+ bool removeURL( KURL const & );
+
+ BookmarksConfig * config();
+ QStringList getContext( KURL const &, unsigned int );
+
+signals:
+ void removeAllBookmarksForURL( const KURL & );
+ void removeBookmarkForURL( const KURL &, int );
+
+protected:
+ void maybeTip( QPoint const & );
+
+private slots:
+ void itemClicked( QListViewItem * );
+ void popupMenu( QListViewItem * , const QPoint & , int );
+ void collapseAll();
+ void expandAll();
+ void doEmitRemoveBookMark();
+
+private:
+ void createURL( EditorData * );
+
+ BookmarksPart * _part;
+ BookmarkItem * _selectedItem;
+
+// static CodeLineType _s_codeline;
+
+ friend class BookmarkItem;
+};
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/bookmarks/kdevbookmarks.desktop b/parts/bookmarks/kdevbookmarks.desktop
new file mode 100644
index 00000000..bd5151bd
--- /dev/null
+++ b/parts/bookmarks/kdevbookmarks.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Plugin that provides navigation and overview of active source bookmarks and persists them between sessions.
+Comment[ca]=Connector que proporciona navegació i visió de conjunt dels marcadors actius en el codi font i els manté entre sessions.
+Comment[da]=Plugin der sørger for navigation og overblik for aktive kilde-bogmærker og lader dem overleve mellem sessioner.
+Comment[de]=Ein Modul, das die Navigation in und die Übersicht über Quelltext-Lesezeichen ermöglicht und diese zwischen den Arbeitssitzungen speichert.
+Comment[el]=Πρόσθετο που προσφέρει πλοήγηση και περίληψη των ενεργών σελιδοδεικτών στον κώδικα καθώς και τη διατήρηση αυτών μεταξύ των συνεδριών.
+Comment[es]=Complemento que proporciona navegación de marcadores del código activos y los mantiene entre sesiones.
+Comment[et]=Plugin, mis võimaldab näha ja liikuda aktiivse koodi järjehoidjate vahel ning peab need seansside vahel meeles.
+Comment[eu]=Iturburu laster-marka aktiboen arakatze eta ikuspegi orokorra eskeintzen duen plugina da eta hauek sesioen artean mantentzen ditu.
+Comment[fa]=وصله‌ای که ناوش و خلاصۀ چوب الفهای فعال منبع را فراهم می‌کند و آنها را در بین نشستها می‌گذارد
+Comment[fr]=Module externe qui fournit une navigation et une vue d'ensemble des signets du source actif, et les maintient persistants entre les sessions.
+Comment[gl]=Extensión que proporciona navegación e vista xeral de marcadores activos no código e que se encarga de mantelos entre sesións.
+Comment[hu]=Bővítőmodul a forrásfájlok könyvjelzőinek áttekintéséhez, eltárolásához
+Comment[it]=Plugin che offre la navigazione e l'anteprima dei segnalibri nel codice attivo e rimane nelle varie sessioni.
+Comment[ja]=セッション間でアクティブなソースのブックマークや主張の外観やナビゲーションを提供するプラグイン。
+Comment[ms]=Plugin yang menyediakan pengemudian dan pandangan umum bagi tandalaman sumber aktif dan mengekalkan mereka antara sesi.
+Comment[nds]=En Moduul, wat dat Stüern twischen un de Översicht över Borntext-Leestekens praatstellt, un disse över Törns wohrt.
+Comment[ne]=प्लगइनले सक्रिय स्रोत पुस्तकचिनोको नेभिगेसन र समिक्षा प्रदान गर्दछ र सत्रहरू बिच तिनीहरूलाई राख्दछ ।
+Comment[nl]=Plugin die bladwijzers biedt die ook blijven bestaan tussen opeenvolgende sessies.
+Comment[pl]=Wtyczka umożliwiająca nawigację i uzyskiwanie informacji na temat aktywnych zakładek w kodzie oraz przenoszenie ich między sesjami.
+Comment[pt]=Um 'plugin' que oferece uma navegação e uma vista geral sobre os favoritos de código activos, mantendo-os persistentes entre sessões.
+Comment[pt_BR]=Plug-in que fornece navegação e uma visão geral dos marcadores de código ativos e persiste entre sessões.
+Comment[ru]=Модуль, который обеспечивает навигацию и просмотр активных закладок в коде, а также их сохранение в проекте.
+Comment[sk]=Modul proskytuje navigáciu a prehľad aktívnych zdrojových záložiek a ich pretrvanie medzi sedeniami.
+Comment[sr]=Прикључак који обезбеђује навигацију и преглед активних маркера изворног кôда и одржава их између сесија.
+Comment[sr@Latn]=Priključak koji obezbeđuje navigaciju i pregled aktivnih markera izvornog kôda i održava ih između sesija.
+Comment[sv]=Insticksprogram som tillhandahåller navigering och översikt över aktiva källkodsbokmärken och gör dem bestående mellan sessioner.
+Comment[ta]=நடப்பில் உள்ள புத்தக குறியீடு மூலத்திற்கு மேற்பார்வை மற்றும் வழிசெலுத்தும் வசதிகளை சொருகி உங்களுக்கு தரும் மற்றும் அமர்வுக்கு இடையே இதனை பரிசோதிக்கும்.
+Comment[tg]=Модуле, ки навигатсия ва намоиши поягузории фаъолро дар код таъмин месозад, ва боз барои нигоҳ доштан дар лоиҳа ҳам.
+Comment[tr]=Etkin kaynak yerimlerinin dolaşımını, gözden geçirilmesini ve oturumlar arasında devamlılığını sağlayan bir eklenti.
+Comment[zh_CN]=提供当前源文件书签的浏览、预览和保存的插件。
+Comment[zh_TW]=提供目前程式碼書籤的導覽與概觀,並保持在工作階段間。
+Name=KDevBookmarks
+Name[da]=KDevelop bogmærker
+Name[de]=Lesezeichen-Unterstützung (KDevelop)
+Name[hi]=के-डेव-बुकमार्क्स
+Name[nds]=Leestekens-Ünnerstütten (KDevelop)
+Name[pl]=KDevZakładki
+Name[sk]=KDev záložky
+Name[sv]=KDevelop bokmärken
+Name[zh_TW]=KDevelop 書籤
+GenericName=Bookmarks
+GenericName[br]=Sinedoù
+GenericName[ca]=Marcadors
+GenericName[cy]=Tudnodau
+GenericName[da]=Bogmærker
+GenericName[de]=Unterstützung für Lesezeichen
+GenericName[el]=Σελιδοδείκτες
+GenericName[es]=Marcadores
+GenericName[et]=Järjehoidjad
+GenericName[eu]=Laster-markak
+GenericName[fa]=چوب‌ الفها
+GenericName[fr]=Signets
+GenericName[ga]=Leabharmharcanna
+GenericName[gl]=Marcadores
+GenericName[hi]= पसंदीदा
+GenericName[hu]=Könyvjelzők
+GenericName[it]=Segnalibri
+GenericName[ja]=ブックマーク
+GenericName[ms]=Tandabuku
+GenericName[nds]=Leestekens-Ünnerstütten
+GenericName[ne]=पुस्तकचिनो
+GenericName[nl]=Bladwijzers
+GenericName[pl]=Zakładki
+GenericName[pt]=Favoritos
+GenericName[pt_BR]=Marcadores
+GenericName[ru]=Закладки
+GenericName[sk]=Záložky
+GenericName[sl]=Zaznamki
+GenericName[sr]=Маркери
+GenericName[sr@Latn]=Markeri
+GenericName[sv]=Bokmärken
+GenericName[ta]=புத்தகக்குறியின்
+GenericName[tg]=Поягузор
+GenericName[tr]=Yerimleri
+GenericName[zh_CN]=书签
+GenericName[zh_TW]=書籤
+Icon=bookmark
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Project
+X-KDE-Library=libkdevbookmarks
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeEditing
diff --git a/parts/classview/Makefile.am b/parts/classview/Makefile.am
new file mode 100644
index 00000000..de0de499
--- /dev/null
+++ b/parts/classview/Makefile.am
@@ -0,0 +1,27 @@
+# Here resides the class view part.
+
+INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions \
+ -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevclassview.la
+libkdevclassview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevclassview_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML) $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+
+libkdevclassview_la_SOURCES = classviewpart.cpp classviewwidget.cpp \
+ digraphview.cpp hierarchydlg.cpp navigator.cpp viewcombos.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevclassview.desktop
+
+rcdir = $(kde_datadir)/kdevclassview
+rc_DATA = kdevclassview.rc
+
+
+QTDIR = /home/bernd/kdesrc/qt-copy
+
+foo: digraphview.cpp digraphview.h
+ $(QTDIR)/bin/moc digraphview.h > digraphview.moc ; \
+ g++ digraphview.cpp -I$(QTDIR)/include -L$(QTDIR)/lib -L/usr/X11R6/lib -lqt -lX11 -lXext -o foo
+noinst_HEADERS = viewcombos.h navigator.h
diff --git a/parts/classview/README.dox b/parts/classview/README.dox
new file mode 100644
index 00000000..78049424
--- /dev/null
+++ b/parts/classview/README.dox
@@ -0,0 +1,53 @@
+/** \class ClassViewPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=classview&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">classview component at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/classview/classtooldlg.cpp b/parts/classview/classtooldlg.cpp
new file mode 100644
index 00000000..91ed28fc
--- /dev/null
+++ b/parts/classview/classtooldlg.cpp
@@ -0,0 +1,373 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "classtooldlg.h"
+
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qtooltip.h>
+#include <kdialog.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "kdevlanguagesupport.h"
+#include "classstore.h"
+#include "parsedclass.h"
+#include "classviewpart.h"
+
+
+ClassToolDialog::ClassToolDialog( ClassViewPart *part )
+ : QWidget(0, "class tool dialog")
+{
+ currentOperation = ViewNone;
+ comboAccess = (PIAccess)-1;
+ currentClass = 0;
+ m_part = part;
+
+ class_combo = new QComboBox(false, this);
+
+ QPushButton *close_button = new KPushButton(KStdGuiItem::close(), this);
+
+ parents_button = new QToolButton(this);
+ parents_button->setPixmap( UserIcon("CTparents", KIcon::DefaultState, ClassViewFactory::instance()) );
+ parents_button->setToggleButton(true);
+ parents_button->setFixedSize(parents_button->sizeHint());
+ QToolTip::add(parents_button, i18n("Show parents"));
+
+ children_button = new QToolButton(this);
+ children_button->setPixmap( UserIcon("CTchildren", KIcon::DefaultState, ClassViewFactory::instance()) );
+ children_button->setToggleButton(true);
+ children_button->setFixedSize(children_button->sizeHint());
+ QToolTip::add(children_button, i18n("Show children"));
+
+ clients_button = new QToolButton(this);
+ clients_button->setPixmap( UserIcon("CTclients", KIcon::DefaultState, ClassViewFactory::instance()) );
+ clients_button->setToggleButton(true);
+ clients_button->setFixedSize(clients_button->sizeHint());
+ QToolTip::add(clients_button, i18n("Show clients"));
+
+ suppliers_button = new QToolButton(this);
+ suppliers_button->setPixmap( UserIcon("CTsuppliers", KIcon::DefaultState, ClassViewFactory::instance()) );
+ suppliers_button->setToggleButton(true);
+ suppliers_button->setFixedSize(suppliers_button->sizeHint());
+ QToolTip::add(suppliers_button, i18n("Show suppliers"));
+
+ methods_button = new QToolButton(this);
+ methods_button->setPixmap( UserIcon("CVpublic_meth", KIcon::DefaultState, ClassViewFactory::instance()) );
+ methods_button->setToggleButton(true);
+ methods_button->setFixedSize(methods_button->sizeHint());
+ QToolTip::add(methods_button, i18n("Show methods"));
+
+ attributes_button = new QToolButton(this);
+ attributes_button->setPixmap( UserIcon("CVpublic_var", KIcon::DefaultState, ClassViewFactory::instance()) );
+ attributes_button->setToggleButton(true);
+ attributes_button->setFixedSize(attributes_button->sizeHint());
+ QToolTip::add(attributes_button, i18n("Show attributes"));
+
+ access_combo = new QComboBox(false, this, "access combo");
+ access_combo->setMinimumWidth(100);
+ access_combo->setSizeLimit(10);
+ access_combo->insertItem(i18n("member access","All"));
+ access_combo->insertItem(i18n("member access","Public"));
+ access_combo->insertItem(i18n("member access","Protected"));
+ access_combo->insertItem(i18n("member access","Private"));
+ access_combo->insertItem(i18n("member access","Package"));
+
+ class_tree = new ClassToolWidget(part, this);
+ // classTree->setMinimumSize( 500, 400 );
+
+ QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ QHBoxLayout *firstrowLayout = new QHBoxLayout();
+ QHBoxLayout *secondrowLayout = new QHBoxLayout();
+ layout->addLayout(firstrowLayout);
+ layout->addLayout(secondrowLayout);
+
+ firstrowLayout->addWidget(class_combo, 1);
+ firstrowLayout->addWidget(close_button, 0);
+
+ secondrowLayout->addWidget(parents_button);
+ secondrowLayout->addWidget(children_button);
+ secondrowLayout->addWidget(clients_button);
+ secondrowLayout->addWidget(suppliers_button);
+ secondrowLayout->addStretch();
+ secondrowLayout->addWidget(methods_button);
+ secondrowLayout->addWidget(attributes_button);
+ secondrowLayout->addWidget(access_combo);
+
+ layout->addWidget(class_tree, 10);
+
+ connect( class_combo, SIGNAL(activated(const QString&)),
+ this, SLOT(slotClassComboChoice(const QString&)) );
+ connect( close_button, SIGNAL(clicked()),
+ this, SLOT(slotClose()) );
+ connect( access_combo, SIGNAL(activated(const QString&)),
+ this, SLOT(slotAccessComboChoice(const QString&)) );
+ connect( parents_button, SIGNAL(clicked()), SLOT(viewParents()));
+ connect( children_button, SIGNAL(clicked()), SLOT(viewChildren()));
+ connect( clients_button, SIGNAL(clicked()), SLOT(viewClients()));
+ connect( suppliers_button, SIGNAL(clicked()), SLOT(viewSuppliers()));
+ connect( methods_button, SIGNAL(clicked()), SLOT(viewMethods()));
+ connect( attributes_button, SIGNAL(clicked()), SLOT(viewAttributes()));
+
+ connect( part, SIGNAL(setLanguageSupport(KDevLanguageSupport*)),
+ this, SLOT(setLanguageSupport(KDevLanguageSupport*)) );
+
+ m_part->registerClassToolDialog(this);
+}
+
+
+ClassToolDialog::~ClassToolDialog()
+{
+ m_part->unregisterClassToolDialog(this);
+}
+
+
+void ClassToolDialog::setLanguageSupport(KDevLanguageSupport *ls)
+{
+ if (ls) {
+ disconnect(ls, 0, this, 0);
+ connect(ls, SIGNAL(updatedSourceInfo()), this, SLOT(refresh()));
+ } else
+ refresh();
+
+ currentOperation = ViewNone;
+}
+
+
+void ClassToolDialog::setClassName(const QString &name)
+{
+ if ( class_combo->count() == 0 ) refresh();
+
+ QListBox *lb = class_combo->listBox();
+
+ for (int i=0; i < (int)lb->count(); ++i)
+ if (lb->text(i) == name) {
+ class_combo->setCurrentItem(i);
+ break;
+ }
+
+ if (!name.isEmpty())
+ currentClass = m_part->classStore()->getClassByName(name);
+ else
+ currentClass = 0;
+}
+
+
+void ClassToolDialog::viewNone()
+{
+ currentOperation = ViewNone;
+ refresh();
+}
+
+
+/** View the parents of the current class. */
+void ClassToolDialog::viewParents()
+{
+ currentOperation = ViewParents;
+ refresh();
+}
+
+
+/** View the children of the current class. */
+void ClassToolDialog::viewChildren()
+{
+ currentOperation = ViewChildren;
+ refresh();
+}
+
+
+/** View all classes that has this class as an attribute. */
+void ClassToolDialog::viewClients()
+{
+ currentOperation = ViewClients;
+ refresh();
+}
+
+
+/** View all classes that this class has as attributes. */
+void ClassToolDialog::viewSuppliers()
+{
+ currentOperation = ViewSuppliers;
+ refresh();
+}
+
+
+/** View methods in this class and parents. */
+void ClassToolDialog::viewMethods()
+{
+ currentOperation = ViewMethods;
+ refresh();
+}
+
+
+/** View attributes in this class and parents. */
+void ClassToolDialog::viewAttributes()
+{
+ currentOperation = ViewAttributes;
+ refresh();
+}
+
+
+void ClassToolDialog::slotAccessComboChoice(const QString &str)
+{
+ if( str == i18n("member access","All") )
+ comboAccess = (PIAccess)-1;
+ else if( str == i18n("member access","Public") )
+ comboAccess = PIE_PUBLIC;
+ else if( str == i18n("member access","Protected") )
+ comboAccess = PIE_PROTECTED;
+ else if( str == i18n("member access","Private") )
+ comboAccess = PIE_PRIVATE;
+ else if( str == i18n("member access","Package") )
+ comboAccess = PIE_PACKAGE;
+
+ // Update the view if the choice affected the data.
+ if (currentOperation == ViewMethods || currentOperation == ViewAttributes)
+ buildTree();
+}
+
+
+void ClassToolDialog::slotClose()
+{
+ delete this;
+ // QTimer::singleShot(0, this, SLOT(delayedClose()));
+}
+
+
+void ClassToolDialog::delayedClose()
+{
+ delete this;
+}
+
+
+void ClassToolDialog::slotClassComboChoice(const QString &str)
+{
+ setClassName(str);
+ refresh();
+}
+
+
+void ClassToolDialog::refresh()
+{
+ // Clear the combo box and fill it with the new items.
+ // Try to select the previously selected class
+
+ QString oldName = class_combo->currentText();
+
+ class_combo->clear();
+ QStringList list = m_part->classStore()->getSortedClassNameList();
+ class_combo->insertStringList(list);
+ setClassName(oldName);
+
+ // Rebuild the tree and caption/button state
+ buildTree();
+}
+
+
+/** Change the caption depending on the current operation. */
+void ClassToolDialog::updateCaptionAndButtons()
+{
+ QString caption;
+ QToolButton *button;
+
+ switch (currentOperation)
+ {
+ case ViewParents:
+ button = parents_button;
+ caption = i18n("Parents");
+ break;
+ case ViewChildren:
+ button = children_button;
+ caption = i18n("Children");
+ break;
+ case ViewClients:
+ button = clients_button;
+ caption = i18n("Clients");
+ break;
+ case ViewSuppliers:
+ button = suppliers_button;
+ caption = i18n("Suppliers");
+ break;
+ case ViewMethods:
+ button = methods_button;
+ caption = i18n("%1 Methods").arg(access_combo->currentText());
+ break;
+ case ViewAttributes:
+ button = attributes_button;
+ caption = i18n("%1 Attributes").arg(access_combo->currentText());
+ break;
+ default:
+ button = 0;
+ caption = i18n("Class Tool Dialog");
+ break;
+ }
+
+ parents_button->setOn(false);
+ children_button->setOn(false);
+ clients_button->setOn(false);
+ suppliers_button->setOn(false);
+ methods_button->setOn(false);
+ attributes_button->setOn(false);
+
+ if (button) {
+ button->setOn(true);
+ setCaption(i18n("%1 of Class %2").arg(caption).arg(currentClass->name()));
+ } else
+ setCaption(caption);
+}
+
+
+void ClassToolDialog::buildTree()
+{
+ if (!currentClass)
+ currentOperation = ViewNone;
+
+ updateCaptionAndButtons();
+
+ class_tree->clear();
+
+ switch (currentOperation)
+ {
+ case ViewParents:
+ class_tree->insertClassAndClasses(currentClass, currentClass->parents);
+ break;
+ case ViewChildren:
+ {
+ QValueList<ParsedClass*> list = m_part->classStore()->getClassesByParent(currentClass->name());
+ class_tree->insertClassAndClasses(currentClass, list);
+ }
+ break;
+ case ViewClients:
+ {
+ QValueList<ParsedClass*> list = m_part->classStore()->getClassClients(currentClass->name());
+ class_tree->insertClassAndClasses(currentClass, list);
+ }
+ break;
+ case ViewSuppliers:
+ {
+ QValueList<ParsedClass*> list = m_part->classStore()->getClassSuppliers(currentClass->name());
+ class_tree->insertClassAndClasses(currentClass, list);
+ }
+ break;
+ case ViewMethods:
+ class_tree->insertAllClassMethods(currentClass, comboAccess);
+ break;
+ case ViewAttributes:
+ class_tree->insertAllClassAttributes(currentClass, comboAccess);
+ break;
+ default:
+ break;
+ }
+}
+
+#include "classtooldlg.moc"
diff --git a/parts/classview/classtooldlg.h b/parts/classview/classtooldlg.h
new file mode 100644
index 00000000..1ab8b5c1
--- /dev/null
+++ b/parts/classview/classtooldlg.h
@@ -0,0 +1,98 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CLASSTOOLDLG_H_
+#define _CLASSTOOLDLG_H_
+
+#include <qdialog.h>
+#include <qlabel.h>
+#include <qtoolbutton.h>
+#include <qcombobox.h>
+#include <qlayout.h>
+#include "classtoolwidget.h"
+#include "parseditem.h"
+
+class ClassViewPart;
+class ClassStore;
+class ParsedClass;
+
+
+class ClassToolDialog : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum Operations { ViewParents, ViewChildren, ViewClients, ViewSuppliers,
+ ViewMethods, ViewAttributes, ViewNone };
+
+ ClassToolDialog( ClassViewPart *part );
+ ~ClassToolDialog();
+
+ void setClassName(const QString &name);
+
+public slots:
+
+ /** View nothing. */
+ void viewNone();
+ /** View the parents of the current class. */
+ void viewParents();
+ /** View the children of the current class. */
+ void viewChildren();
+ /** View all classes that has this class as an attribute. */
+ void viewClients();
+ /** View all classes that this class has as attributes. */
+ void viewSuppliers();
+ /** View methods in this class and parents. */
+ void viewMethods();
+ /** View attributes in this class and parents. */
+ void viewAttributes();
+
+private slots:
+ void setLanguageSupport(KDevLanguageSupport *ls);
+ void refresh();
+
+ void delayedClose();
+ void slotClose();
+ void slotAccessComboChoice(const QString &str);
+ void slotClassComboChoice(const QString &str);
+
+
+private:
+ void updateCaptionAndButtons();
+ void buildTree();
+
+ ClassToolWidget *class_tree;
+ QComboBox *class_combo;
+
+ QToolButton *parents_button;
+ QToolButton *children_button;
+ QToolButton *clients_button;
+ QToolButton *suppliers_button;
+ QToolButton *methods_button;
+ QToolButton *attributes_button;
+ QComboBox *access_combo;
+
+ /** Store that holds all classes in the system. */
+ ClassStore *m_store;
+ KDevLanguageSupport *m_ls;
+ ClassViewPart *m_part;
+
+ /** The class we are currently viewing. */
+ ParsedClass *currentClass;
+ /** The current exportstatus selected in the combo. */
+ PIAccess comboAccess;
+ /** Stores what operation the user selected last. */
+ Operations currentOperation;
+};
+
+#endif
diff --git a/parts/classview/classtoolwidget.cpp b/parts/classview/classtoolwidget.cpp
new file mode 100644
index 00000000..f800bd15
--- /dev/null
+++ b/parts/classview/classtoolwidget.cpp
@@ -0,0 +1,159 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "classtoolwidget.h"
+
+#include <kconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kpopupmenu.h>
+#include "classstore.h"
+
+
+ClassToolWidget::ClassToolWidget(ClassViewPart *part, QWidget *parent)
+ : ClassTreeBase(part, parent, "class tool widget")
+{}
+
+
+ClassToolWidget::~ClassToolWidget()
+{}
+
+
+KPopupMenu *ClassToolWidget::createPopup()
+{
+ KPopupMenu *popup = contextItem? contextItem->createPopup() : 0;
+ if (!popup) {
+ popup = new KPopupMenu(this);
+ popup->insertTitle(i18n("Class Tool"));
+ }
+
+ return popup;
+}
+
+
+void ClassToolWidget::insertClassAndClasses(ParsedClass *parsedClass, QValueList<ParsedClass*> classList)
+{
+ ClassTreeItem *root = new ClassTreeClassItem(this, 0, parsedClass);
+
+ ClassTreeItem *lastItem = 0;
+
+ QValueList<ParsedClass*>::ConstIterator it;
+ for (it = classList.begin(); it != classList.end(); ++it) {
+ lastItem = new ClassTreeClassItem(root, lastItem, *it);
+ lastItem->setExpandable(false);
+ }
+
+ if (!root->firstChild())
+ root->setExpandable(false);
+ else
+ root->setOpen(true);
+}
+
+
+void ClassToolWidget::insertClassAndClasses(ParsedClass *parsedClass, const QPtrList<ParsedParent> &parentList)
+{
+ ClassTreeItem *root = new ClassTreeClassItem(this, 0, parsedClass);
+
+ ClassTreeItem *lastItem = 0;
+
+ QPtrListIterator<ParsedParent> it(parentList);
+ for (; it.current(); ++it) {
+ ParsedClass *parentClass = m_part->classStore()->getClassByName((*it)->name());
+ lastItem = new ClassTreeClassItem(root, lastItem, parentClass);
+ lastItem->setExpandable(false);
+ }
+
+ if (!root->firstChild())
+ root->setExpandable(false);
+ else
+ root->setOpen(true);
+}
+
+
+void ClassToolWidget::addClassAndAttributes(ParsedClass *parsedClass, PIAccess filter, ClassTreeItem **lastItem)
+{
+ *lastItem = new ClassTreeClassItem(this, *lastItem, parsedClass);
+
+ ClassTreeItem *ilastItem = 0;
+
+ QValueList<ParsedAttribute*> attrList = parsedClass->getSortedAttributeList();
+ QValueList<ParsedAttribute*>::ConstIterator it;
+ for (it = attrList.begin(); it != attrList.end(); ++it) {
+ if (filter == (PIAccess)-1 || filter == (*it)->access())
+ ilastItem = new ClassTreeAttrItem(*lastItem, ilastItem, *it);
+ }
+
+ if (!(*lastItem)->firstChild())
+ (*lastItem)->setExpandable(false);
+ else
+ (*lastItem)->setOpen(true);
+}
+
+
+void ClassToolWidget::addClassAndMethods(ParsedClass *parsedClass, PIAccess filter, ClassTreeItem **lastItem)
+{
+ *lastItem = new ClassTreeClassItem(this, *lastItem, parsedClass);
+
+ ClassTreeItem *ilastItem = 0;
+
+ QValueList<ParsedMethod*> methodList = parsedClass->getSortedMethodList();
+ QValueList<ParsedMethod*>::ConstIterator it;
+ for (it = methodList.begin(); it != methodList.end(); ++it) {
+ if (filter == (PIAccess)-1 || filter == (*it)->access())
+ ilastItem = new ClassTreeMethodItem(*lastItem, ilastItem, *it);
+ }
+
+ if (!(*lastItem)->firstChild())
+ (*lastItem)->setExpandable(false);
+ else
+ (*lastItem)->setOpen(true);
+}
+
+
+void ClassToolWidget::insertAllClassMethods(ParsedClass *parsedClass, PIAccess filter)
+{
+ ClassTreeItem *lastItem = 0;
+
+ // First treat all parents.
+ for ( ParsedParent *pParent = parsedClass->parents.first();
+ pParent != 0;
+ pParent = parsedClass->parents.next() )
+ {
+ ParsedClass *parentClass = m_part->classStore()->getClassByName(pParent->name());
+ if (parentClass)
+ addClassAndMethods(parentClass, filter, &lastItem);
+ }
+
+ // Add the current class
+ addClassAndMethods(parsedClass, filter, &lastItem);
+}
+
+
+void ClassToolWidget::insertAllClassAttributes(ParsedClass *parsedClass, PIAccess filter)
+{
+ ClassTreeItem *lastItem = 0;
+ // First treat all parents.
+ for ( ParsedParent *pParent = parsedClass->parents.first();
+ pParent != 0;
+ pParent = parsedClass->parents.next() )
+ {
+ ParsedClass *parentClass = m_part->classStore()->getClassByName(pParent->name());
+ if (parentClass)
+ addClassAndAttributes(parentClass, filter, &lastItem);
+ }
+
+ // Add the current class
+ addClassAndAttributes(parsedClass, filter, &lastItem);
+}
+
+#include "classtoolwidget.moc"
diff --git a/parts/classview/classtoolwidget.h b/parts/classview/classtoolwidget.h
new file mode 100644
index 00000000..75119e8f
--- /dev/null
+++ b/parts/classview/classtoolwidget.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CLASSTOOLWIDGET_H_
+#define _CLASSTOOLWIDGET_H_
+
+#include "classtreebase.h"
+
+
+class ClassToolWidget : public ClassTreeBase
+{
+ Q_OBJECT
+
+public:
+ ClassToolWidget(ClassViewPart *part, QWidget *parent=0);
+ ~ClassToolWidget();
+
+ void insertClassAndClasses(ParsedClass *parsedClass, QValueList<ParsedClass*> classList);
+ void insertClassAndClasses(ParsedClass *parsedClass, const QPtrList<ParsedParent> &parentList);
+ void insertAllClassMethods(ParsedClass *parsedClass, PIAccess filter);
+ void insertAllClassAttributes(ParsedClass *parsedClass, PIAccess filter);
+
+protected:
+ virtual KPopupMenu *createPopup();
+
+private:
+ void addClassAndAttributes(ParsedClass *parsedClass, PIAccess filter, ClassTreeItem **lastItem);
+ void addClassAndMethods(ParsedClass *parsedClass, PIAccess filter, ClassTreeItem **lastItem);
+};
+
+#endif
diff --git a/parts/classview/classtreebase.cpp b/parts/classview/classtreebase.cpp
new file mode 100644
index 00000000..f5c0f4b9
--- /dev/null
+++ b/parts/classview/classtreebase.cpp
@@ -0,0 +1,637 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "classtreebase.h"
+
+#include <qtooltip.h>
+#include <qheader.h>
+#include <qregexp.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kpopupmenu.h>
+#include <klocale.h>
+#include <kiconloader.h>
+
+#include "kdevcore.h"
+#include "kdevlanguagesupport.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "classstore.h"
+
+#include "classviewpart.h"
+#include "classtooldlg.h"
+
+KPopupMenu *ClassTreeItem::createPopup()
+{
+ if (!m_item || m_item->itemType() == PIT_SCOPE)
+ return 0;
+
+ KDevLanguageSupport::Features features = classTree()->m_part->languageSupport()->features();
+
+ KPopupMenu *popup = new KPopupMenu();
+ if (features & KDevLanguageSupport::Declarations)
+ popup->insertItem( i18n("Go to Declaration"), classTree(), SLOT(slotGotoDeclaration()) );
+ if (m_item->itemType() == PIT_METHOD)
+ popup->insertItem( i18n("Go to Definition"), classTree(), SLOT(slotGotoImplementation()) );
+
+ QString title;
+ switch(m_item->itemType()) {
+ case PIT_CLASS:
+ {
+ title = i18n("Class");
+ bool hasAddMethod = features & KDevLanguageSupport::AddMethod;
+ bool hasAddAttribute = features & KDevLanguageSupport::AddAttribute;
+ if (hasAddMethod)
+ popup->insertItem( i18n("Add Method..."), classTree(), SLOT(slotAddMethod()));
+ if (hasAddAttribute)
+ popup->insertItem( i18n("Add Attribute..."), classTree(), SLOT(slotAddAttribute()));
+ popup->insertSeparator();
+ popup->insertItem( i18n("Parent Classes..."), classTree(), SLOT(slotClassBaseClasses()));
+ popup->insertItem( i18n("Child Classes..."), classTree(), SLOT(slotClassDerivedClasses()));
+ popup->insertItem( i18n("Class Tool..."), classTree(), SLOT(slotClassTool()));
+ }
+ break;
+ case PIT_STRUCT:
+ title = i18n("Struct");
+ break;
+ case PIT_ATTRIBUTE:
+ if (m_item->isGlobal())
+ title = i18n("Variable");
+ else
+ title = i18n("Attribute");
+ break;
+ case PIT_METHOD:
+ if (static_cast<ParsedMethod*>(m_item)->isSlot())
+ title = i18n("Slot");
+ else if (static_cast<ParsedMethod*>(m_item)->isSignal())
+ title = i18n("Signal");
+ else if (m_item->isGlobal())
+ title = i18n("Function");
+ else
+ title = i18n("Method");
+ break;
+ default:
+ ;
+ }
+ popup->insertSeparator();
+ popup->insertTitle(title, -1, 0);
+
+ return popup;
+}
+
+
+QString ClassTreeItem::scopedText() const
+{
+ if (m_item)
+ return m_item->path();
+
+ return QString::null;
+}
+
+
+void ClassTreeItem::getDeclaration(QString *toFile, int *toLine)
+{
+ if (m_item) {
+ *toFile = m_item->declaredInFile();
+ *toLine = m_item->declaredOnLine();
+ }
+}
+
+
+void ClassTreeItem::getImplementation(QString *toFile, int *toLine)
+{
+ if (m_item) {
+ *toFile = m_item->definedInFile();
+ *toLine = m_item->definedOnLine();
+ }
+}
+
+
+QString ClassTreeItem::text( int ) const
+{
+ if (m_item)
+ return m_item->asString();
+ return QString::null;
+}
+
+
+QString ClassTreeItem::tipText() const
+{
+ // Purposefully avoid virtual dispatch here
+ return ClassTreeItem::text(0);
+}
+
+
+void ClassTreeOrganizerItem::init()
+{
+ setExpandable(true);
+ setPixmap(0, SmallIcon("folder"));
+}
+
+
+void ClassTreeScopeItem::init()
+{
+ setExpandable(true);
+ setPixmap(0, UserIcon("CVnamespace", KIcon::DefaultState, ClassViewFactory::instance()));
+}
+
+
+QString ClassTreeScopeItem::text( int col ) const
+{
+ if (!m_item)
+ return QString::null;
+ if (m_item->name().isEmpty())
+ return i18n("Global");
+ return ClassTreeItem::text( col );
+}
+
+
+void ClassTreeScopeItem::setOpen(bool o)
+{
+ if ( !m_item)
+ return;
+
+ kdDebug(9003) << (o? "Open scope item" : "Close scope item") << endl;
+ if (o && childCount() == 0) {
+
+ ParsedScopeContainer *pScope = static_cast<ParsedScopeContainer*>(m_item);
+ ClassTreeItem *lastItem = 0;
+
+ // Ok, this is a hack...
+ KDevLanguageSupport::Features features = classTree()->m_part->languageSupport()->features();
+
+ // Add namespaces
+ QValueList<ParsedScopeContainer*> scopeList = pScope->getSortedScopeList();
+ QValueList<ParsedScopeContainer*>::ConstIterator it;
+ for (it = scopeList.begin(); it != scopeList.end(); ++it)
+ lastItem = new ClassTreeScopeItem(this, lastItem, *it);
+
+ if (features & KDevLanguageSupport::Classes) {
+ // Add classes
+ QValueList<ParsedClass*> classList = pScope->getSortedClassList();
+ QValueList<ParsedClass*>::ConstIterator it;
+ for (it = classList.begin(); it != classList.end(); ++it)
+ lastItem = new ClassTreeClassItem(this, lastItem, *it);
+ }
+
+ if (features & KDevLanguageSupport::Structs) {
+ // Add structs
+ QValueList<ParsedClass*> structList = pScope->getSortedStructList();
+ QValueList<ParsedClass*>::ConstIterator it;
+ for (it = structList.begin(); it != structList.end(); ++it)
+ lastItem = new ClassTreeClassItem(this, lastItem, *it, true);
+ }
+
+ if (features & KDevLanguageSupport::Functions) {
+ // Add functions
+ QValueList<ParsedMethod*> methodList = pScope->getSortedMethodList();
+ QValueList<ParsedMethod*>::ConstIterator it;
+ for (it = methodList.begin(); it != methodList.end(); ++it)
+ lastItem = new ClassTreeMethodItem(this, lastItem, *it);
+ }
+
+ if (features & KDevLanguageSupport::Variables) {
+ // Add attributes
+ QValueList<ParsedAttribute*> attrList = pScope->getSortedAttributeList();
+ QValueList<ParsedAttribute*>::ConstIterator it;
+ for (it = attrList.begin(); it != attrList.end(); ++it)
+ lastItem = new ClassTreeAttrItem(this, lastItem, *it);
+ }
+
+ }
+
+ ClassTreeItem::setOpen(o);
+}
+
+
+void ClassTreeClassItem::init()
+{
+ setExpandable(true);
+ setPixmap(0, UserIcon(m_isStruct ? "CVstruct" : "CVclass", KIcon::DefaultState, ClassViewFactory::instance()));
+}
+
+
+void ClassTreeClassItem::setOpen(bool o)
+{
+ if ( !m_item )
+ return;
+ kdDebug(9003) << (o? "Open class item" : "Close class item") << endl;
+ if (o && childCount() == 0) {
+
+ ParsedClass *pClass = static_cast<ParsedClass*>(m_item);
+ ClassTreeItem *lastItem = 0;
+
+ // Add nested classes
+ QValueList<ParsedClass*> classList = pClass->getSortedClassList();
+ QValueList<ParsedClass*>::ConstIterator classIt;
+ for (classIt = classList.begin(); classIt != classList.end(); ++classIt)
+ lastItem = new ClassTreeClassItem(this, lastItem, *classIt);
+
+ // Add nested structs
+ QValueList<ParsedClass*> structList = pClass->getSortedStructList();
+ QValueList<ParsedClass*>::ConstIterator structIt;
+ for (structIt = structList.begin(); structIt != structList.end(); ++structIt)
+ lastItem = new ClassTreeClassItem(this, lastItem, *structIt, true);
+
+ // Add methods
+ QValueList<ParsedMethod*> methodList = pClass->getSortedMethodList();
+ QValueList<ParsedMethod*>::ConstIterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt)
+ lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt);
+
+ // Add slots
+ QValueList<ParsedMethod*> slotList = pClass->getSortedSlotList();
+ QValueList<ParsedMethod*>::ConstIterator slotIt;
+ for (slotIt = slotList.begin(); slotIt != slotList.end(); ++slotIt)
+ lastItem = new ClassTreeMethodItem(this, lastItem, *slotIt);
+
+ // Add signals
+ QValueList<ParsedMethod*> signalList = pClass->getSortedSignalList();
+ QValueList<ParsedMethod*>::ConstIterator signalIt;
+ for (signalIt = signalList.begin(); signalIt != signalList.end(); ++signalIt)
+ lastItem = new ClassTreeMethodItem(this, lastItem, *signalIt);
+
+ // Add attributes
+ QValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
+ QValueList<ParsedAttribute*>::ConstIterator attrIt;
+ for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt)
+ lastItem = new ClassTreeAttrItem(this, lastItem, *attrIt);
+
+ }
+
+ ClassTreeItem::setOpen(o);
+}
+
+ClassTreeMethodItem::ClassTreeMethodItem(ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedMethod *parsedMethod)
+ : ClassTreeItem(parent, lastSibling, parsedMethod)
+{
+ QString icon;
+
+ if ( !parsedMethod )
+ return;
+
+ if (parsedMethod->isSignal())
+ icon = "CVpublic_signal";
+ else if (parsedMethod->isSlot()) {
+ if (parsedMethod->isPublic())
+ icon = "CVpublic_slot";
+ else if (parsedMethod->isProtected())
+ icon = "CVprotected_slot";
+ else
+ icon = "CVprivate_slot";
+ }
+ else if (parsedMethod->isPublic())
+ icon = "CVpublic_meth";
+ else if (parsedMethod->isProtected())
+ icon = "CVprotected_meth";
+ else if (parsedMethod->isPrivate())
+ icon = "CVprivate_meth";
+ else if (parsedMethod->isPackage())
+ icon = "CVpackage_meth";
+ else
+ icon = "CVglobal_meth";
+
+ setPixmap(0, UserIcon(icon, KIcon::DefaultState, ClassViewFactory::instance()));
+}
+
+QString ClassTreeMethodItem::text( int ) const
+{
+ QString str;
+
+ if ( !m_item )
+ return QString::null;
+
+ ParsedMethod* method = static_cast<ParsedMethod*>(m_item);
+
+ str = method->name();
+
+ if( method->arguments.count() > 0 ) {
+ str += "( ";
+ for ( ParsedArgument *arg = method->arguments.first(); arg != NULL; arg = method->arguments.next() ) {
+ if ( arg != method->arguments.getFirst() )
+ str += ", ";
+
+ str += arg->toString();
+ }
+ str += " )";
+ } else {
+ str += "()";
+ }
+
+ if( method->isConst() )
+ str += " const";
+
+ return str;
+}
+
+
+ClassTreeAttrItem::ClassTreeAttrItem(ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedAttribute *parsedAttr)
+ : ClassTreeItem(parent, lastSibling, parsedAttr)
+{
+ QString icon;
+
+ if ( !parsedAttr )
+ return;
+
+ if (parsedAttr->isPublic())
+ icon = "CVpublic_var";
+ else if (parsedAttr->isProtected())
+ icon = "CVprotected_var";
+ else if (parsedAttr->isPrivate())
+ icon = "CVprivate_var";
+ else if (parsedAttr->isPackage())
+ icon = "CVpackage_var";
+ else
+ icon = "CVglobal_var";
+
+ setPixmap(0, UserIcon(icon, KIcon::DefaultState, ClassViewFactory::instance()));
+}
+
+
+QString ClassTreeAttrItem::text( int ) const
+{
+ if ( !m_item )
+ return QString::null;
+ return m_item->name();
+}
+
+ClassTreeScriptItem::ClassTreeScriptItem(ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedScript *parsedScript)
+ : ClassTreeItem(parent, lastSibling, parsedScript)
+{
+ QString icon;
+
+ if ( !parsedScript )
+ return;
+
+ setExpandable(true);
+
+ //need a icon for scripts
+ icon = "CVpublic_var";
+ setPixmap(0, UserIcon(icon, KIcon::DefaultState, ClassViewFactory::instance()));
+}
+
+
+QString ClassTreeScriptItem::text( int ) const
+{
+ if ( !m_item )
+ return QString::null;
+ return m_item->name();
+}
+
+void ClassTreeScriptItem::setOpen(bool o)
+{
+ if ( !m_item )
+ return;
+ kdDebug(9003) << (o? "Open script item" : "Close script item") << endl;
+ if (o && childCount() == 0) {
+
+ ParsedScript *pClass = static_cast<ParsedScript*>(m_item);
+ ClassTreeItem *lastItem = 0;
+
+ // Add methods
+ QValueList<ParsedMethod*> methodList = pClass->getSortedMethodList();
+ QValueList<ParsedMethod*>::ConstIterator methodIt;
+ for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt)
+ lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt);
+
+ // Add attributes
+ QValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
+ QValueList<ParsedAttribute*>::ConstIterator attrIt;
+ for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt)
+ lastItem = new ClassTreeAttrItem(this, lastItem, *attrIt);
+
+ }
+
+ ClassTreeItem::setOpen(o);
+}
+
+
+class ClassToolTip : public QToolTip
+{
+public:
+ ClassToolTip( QWidget *parent )
+ : QToolTip(parent)
+ {}
+
+protected:
+ void maybeTip(const QPoint &p);
+};
+
+
+void ClassToolTip::maybeTip(const QPoint &p)
+{
+ ClassTreeBase *ctw = static_cast<ClassTreeBase*>(parentWidget());
+
+ QListViewItem *item = ctw->itemAt(p);
+ QRect r = ctw->itemRect(item);
+
+ if (item && r.isValid()) {
+ ClassTreeItem *ctitem = static_cast<ClassTreeItem*>(item);
+ QString str = ctitem->tipText();
+ if (!str.isEmpty())
+ tip(r, str);
+ }
+}
+
+
+ClassTreeBase::ClassTreeBase(ClassViewPart *part, QWidget *parent, const char *name)
+ : KListView(parent, name)
+{
+ setFocusPolicy(ClickFocus);
+ setRootIsDecorated(true);
+ setResizeMode(QListView::LastColumn);
+ setSorting(-1);
+ header()->hide();
+ addColumn(QString::null);
+
+ (void) new ClassToolTip(this);
+
+ connect( this, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)),
+ this, SLOT(slotItemPressed(int, QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed( QListViewItem*)),
+ SLOT( slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
+ this, SLOT(slotContextMenuRequested(QListViewItem*, const QPoint&)) );
+
+ m_part = part;
+}
+
+
+ClassTreeBase::~ClassTreeBase()
+{}
+
+
+ClassTreeBase::TreeState ClassTreeBase::treeState() const
+{
+ TreeState state;
+
+ ClassTreeBase *that = const_cast<ClassTreeBase*>(this);
+ QListViewItemIterator it(that);
+ for (; it.current(); ++it)
+ if (it.current()->isOpen()) {
+ QStringList path;
+ QListViewItem *item = it.current();
+ while (item) {
+ path.prepend(item->text(0));
+ item = item->parent();
+ }
+ state.append(path);
+ }
+
+ return state;
+}
+
+
+void ClassTreeBase::setTreeState(TreeState state)
+{
+ TreeStateIterator tsit;
+ for (tsit = state.begin(); tsit != state.end(); ++tsit) {
+ QListViewItemIterator it(this);
+ for (; it.current(); ++it) {
+ QStringList path;
+ QListViewItem *item = it.current();
+ while (item) {
+ path.prepend(item->text(0));
+ item = item->parent();
+ }
+ if (*tsit == path) {
+ it.current()->setOpen(true);
+ break;
+ }
+ }
+ }
+}
+
+
+
+
+void ClassTreeBase::slotItemExecuted( QListViewItem* item )
+{
+ if (!item)
+ return;
+
+ // toggle open state for parents
+ if (item->childCount() > 0)
+ setOpen(item, !isOpen(item));
+
+ // We assume here that ALL (!) items in the list view
+ // are ClassTreeItem's
+ ClassTreeItem *ctitem = static_cast<ClassTreeItem*>(item);
+ if (ctitem->isOrganizer())
+ return;
+
+ QString toFile;
+ int toLine = -1;
+ if (dynamic_cast<ClassTreeClassItem*>(item)) {
+ ctitem->getDeclaration(&toFile, &toLine);
+ }
+ else {
+ ctitem->getImplementation(&toFile, &toLine);
+ }
+ m_part->partController()->editDocument(toFile, toLine);
+ m_part->mainWindow()->lowerView(this);
+}
+
+
+void ClassTreeBase::slotItemPressed(int button, QListViewItem *item)
+{
+ if (!item)
+ return;
+
+ // We assume here that ALL (!) items in the list view
+ // are ClassTreeItem's
+ ClassTreeItem *ctitem = static_cast<ClassTreeItem*>(item);
+ if (ctitem->isOrganizer())
+ return;
+
+ if (button == MidButton) {
+ QString toFile;
+ int toLine = -1;
+ ctitem->getDeclaration(&toFile, &toLine);
+ m_part->partController()->editDocument(toFile, toLine);
+ m_part->mainWindow()->lowerView(this);
+ }
+}
+
+void ClassTreeBase::slotContextMenuRequested(QListViewItem *item, const QPoint &p)
+{
+ contextItem = static_cast<ClassTreeItem*>(item);
+
+ KPopupMenu *popup = createPopup();
+ popup->exec(p);
+ delete popup;
+}
+
+void ClassTreeBase::slotGotoDeclaration()
+{
+ QString toFile;
+ int toLine = -1;
+
+ contextItem->getDeclaration(&toFile, &toLine);
+ m_part->partController()->editDocument(toFile, toLine);
+}
+
+
+void ClassTreeBase::slotGotoImplementation()
+{
+ QString toFile;
+ int toLine = -1;
+
+ contextItem->getImplementation(&toFile, &toLine);
+ m_part->partController()->editDocument(toFile, toLine);
+}
+
+
+void ClassTreeBase::slotAddMethod()
+{
+ if (m_part->languageSupport())
+ m_part->languageSupport()->addMethod(contextItem->scopedText());
+}
+
+
+void ClassTreeBase::slotAddAttribute()
+{
+ if (m_part->languageSupport())
+ m_part->languageSupport()->addAttribute(contextItem->scopedText());
+}
+
+
+void ClassTreeBase::slotClassBaseClasses()
+{
+ ClassToolDialog *dlg = new ClassToolDialog(m_part);
+ dlg->setClassName(contextItem->scopedText());
+ dlg->viewParents();
+}
+
+
+void ClassTreeBase::slotClassDerivedClasses()
+{
+ ClassToolDialog *dlg = new ClassToolDialog(m_part);
+ dlg->setClassName(contextItem->scopedText());
+ dlg->viewChildren();
+}
+
+
+void ClassTreeBase::slotClassTool()
+{
+ ClassToolDialog *dlg = new ClassToolDialog(m_part);
+ dlg->setClassName(contextItem->scopedText());
+ dlg->viewNone();
+}
+
+#include "classtreebase.moc"
diff --git a/parts/classview/classtreebase.h b/parts/classview/classtreebase.h
new file mode 100644
index 00000000..e019bcc2
--- /dev/null
+++ b/parts/classview/classtreebase.h
@@ -0,0 +1,242 @@
+/***************************************************************************
+ * Copyright (C) 1999 by Jonas Nordin *
+ * jonas.nordin@syncom.se *
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CLASSTREEBASE_H_
+#define _CLASSTREEBASE_H_
+
+#include <klistview.h>
+#include "parseditem.h"
+#include "parsedscopecontainer.h"
+#include "parsedclass.h"
+#include "parsedmethod.h"
+#include "parsedattribute.h"
+#include "classviewpart.h"
+#include "parsedscript.h"
+
+class ClassTreeItem;
+class KPopupMenu;
+
+
+class ClassTreeBase : public KListView
+{
+ Q_OBJECT
+
+public:
+ ClassTreeBase( ClassViewPart *part, QWidget *parent=0, const char *name=0 );
+ ~ClassTreeBase();
+
+protected:
+ typedef QValueList<QStringList> TreeState;
+ typedef QValueList<QStringList>::Iterator TreeStateIterator;
+ TreeState treeState() const;
+ void setTreeState(TreeState state);
+
+ ClassTreeItem *contextItem;
+ virtual KPopupMenu *createPopup() = 0;
+
+private slots:
+ void slotItemExecuted(QListViewItem*);
+ void slotItemPressed(int button, QListViewItem *item);
+ void slotContextMenuRequested(QListViewItem *item, const QPoint &p);
+ void slotGotoDeclaration();
+ void slotGotoImplementation();
+ void slotAddMethod();
+ void slotAddAttribute();
+ void slotClassBaseClasses();
+ void slotClassDerivedClasses();
+ void slotClassTool();
+
+protected:
+ ClassViewPart *m_part;
+ friend class ClassTreeItem;
+ friend class ClassTreeScopeItem;
+};
+
+
+class ClassTreeItem : public QListViewItem, public NotifyClient
+{
+public:
+ ClassTreeItem( ClassTreeBase *parent, ClassTreeItem *lastSibling, ParsedItem *parsedItem )
+ : QListViewItem(parent, lastSibling), NotifyClient(), m_item(parsedItem)
+ {
+ init();
+ }
+ ClassTreeItem( ClassTreeItem *parent, ClassTreeItem *lastSibling, ParsedItem *parsedItem )
+ : QListViewItem(parent, lastSibling), NotifyClient(), m_item(parsedItem)
+ {
+ init();
+ }
+ ClassTreeItem( const ClassTreeItem& other )
+ : QListViewItem( other.parent(), other.nextSibling()), NotifyClient()
+ {
+ m_item = other.m_item;
+ init();
+ }
+ ClassTreeItem& operator=( const ClassTreeItem& other )
+ {
+ m_item = other.m_item;
+ init();
+ return *this;
+ }
+ ~ClassTreeItem()
+ {
+ if ( m_item )
+ m_item->unregisterNotifyClient( (NotifyClient*)this );
+ }
+
+ // m_item has been deleted.
+ void notify() { m_item = 0; }
+
+ KPopupMenu *createPopup();
+ bool isOrganizer() { return !m_item; }
+ void init()
+ {
+ if ( m_item )
+ m_item->registerNotifyClient( (NotifyClient*)this );
+ }
+
+ void getDeclaration(QString *toFile, int *toLine);
+ void getImplementation(QString *toFile, int *toLine);
+
+ virtual QString scopedText() const;
+ virtual QString text( int ) const;
+ virtual QString tipText() const;
+
+protected:
+ ClassTreeBase *classTree()
+ { return static_cast<ClassTreeBase*>(listView()); }
+ ParsedItem *m_item;
+};
+
+
+class ClassTreeOrganizerItem : public ClassTreeItem
+{
+public:
+ ClassTreeOrganizerItem( ClassTreeBase *parent, ClassTreeItem *lastSibling,
+ const QString &text )
+ : ClassTreeItem(parent, lastSibling, 0 )
+ , m_text( text )
+ { init(); }
+ ClassTreeOrganizerItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ const QString &text )
+ : ClassTreeItem(parent, lastSibling, 0 )
+ , m_text( text )
+ { init(); }
+ ~ClassTreeOrganizerItem()
+ {}
+
+ virtual QString text( int ) const { return m_text; }
+
+private:
+ QString m_text;
+
+ void init();
+};
+
+
+class ClassTreeScopeItem : public ClassTreeItem
+{
+public:
+ ClassTreeScopeItem( ClassTreeBase *parent, ClassTreeItem *lastSibling,
+ ParsedScopeContainer *parsedScope )
+ : ClassTreeItem(parent, lastSibling, parsedScope)
+ {
+ init();
+ }
+ ClassTreeScopeItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedScopeContainer *parsedScope )
+ : ClassTreeItem(parent, lastSibling, parsedScope)
+ {
+ init();
+ }
+ ~ClassTreeScopeItem()
+ {
+ }
+
+ virtual QString text( int ) const;
+ virtual void setOpen(bool o);
+
+private:
+ void init();
+};
+
+
+class ClassTreeClassItem : public ClassTreeItem
+{
+public:
+ ClassTreeClassItem( ClassTreeBase *parent, ClassTreeItem *lastSibling,
+ ParsedClass *parsedClass, bool isStruct=false )
+ : ClassTreeItem(parent, lastSibling, parsedClass), m_isStruct( isStruct )
+ {
+ init();
+ }
+ ClassTreeClassItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedClass *parsedClass, bool isStruct=false )
+ : ClassTreeItem(parent, lastSibling, parsedClass), m_isStruct( isStruct )
+ {
+ init();
+ }
+ ~ClassTreeClassItem()
+ {
+ }
+
+ virtual void setOpen(bool o);
+
+private:
+ void init();
+
+private:
+ bool m_isStruct;
+};
+
+
+class ClassTreeMethodItem : public ClassTreeItem
+{
+public:
+ ClassTreeMethodItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedMethod *parsedMethod );
+ ~ClassTreeMethodItem()
+ {
+ }
+
+ virtual QString text( int ) const;
+};
+
+
+class ClassTreeAttrItem : public ClassTreeItem
+{
+public:
+ ClassTreeAttrItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedAttribute *parsedAttr );
+ ~ClassTreeAttrItem()
+ {
+ }
+
+ virtual QString text( int ) const;
+};
+
+class ClassTreeScriptItem : public ClassTreeItem
+{
+public:
+ ClassTreeScriptItem( ClassTreeItem *parent, ClassTreeItem *lastSibling,
+ ParsedScript *parsedScript );
+ ~ClassTreeScriptItem()
+ {
+ }
+
+ virtual QString text( int ) const;
+ virtual void setOpen(bool o);
+};
+
+
+#endif
diff --git a/parts/classview/classviewpart.cpp b/parts/classview/classviewpart.cpp
new file mode 100644
index 00000000..b37ed50b
--- /dev/null
+++ b/parts/classview/classviewpart.cpp
@@ -0,0 +1,279 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ * Copyright (C) 2003 Alexander Dymo (cloudtemple@mksat.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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <qwhatsthis.h>
+#include <qlistview.h>
+#include <qfileinfo.h>
+#include <qlineedit.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kpopupmenu.h>
+#include <kdebug.h>
+#include <kmimetype.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevlanguagesupport.h>
+#include <kcomboview.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <urlutil.h>
+#include <kdevplugininfo.h>
+
+#include <codemodel.h>
+#include <codemodel_utils.h>
+
+#include "classviewwidget.h"
+#include "classviewpart.h"
+#include "hierarchydlg.h"
+#include "navigator.h"
+
+#include "klistviewaction.h"
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/clipboardinterface.h>
+
+
+class FunctionCompletion : public CustomCompleter {
+ public:
+ FunctionCompletion() {
+ setOrder( Insertion );
+ };
+ typedef QMap<QString, QString> FuncMap;
+ FuncMap nameMap; /// real -> short
+ FuncMap revNameMap; /// short -> real
+
+ static const QString processName( QString function ) {
+ QString args;
+ QString fScope;
+ int cutpos;
+
+ if((cutpos = function.find('(')) != -1) {
+ args = function.right( function.length() - cutpos );
+ function = function.left( cutpos );
+ } else {
+ return function;
+ }
+ if((cutpos = function.findRev(':')) != -1 || (cutpos = function.findRev('.')) != -1) {
+ fScope = function.left( cutpos + 1 );
+ function = function.right( function.length() - cutpos - 1);
+ }
+
+ return function;
+ }
+
+ virtual void addItem ( const QString &item ) {
+ QString newItemName = item;
+ KCompletion::addItem(newItemName);
+ QString tx = processName( item );
+ tx += " \"" + item + "\"";
+ nameMap[item] = tx;
+ revNameMap[tx] = item;
+ if(tx.length() == 0) {
+ kdDebug() << "function-name-extraction failed with \"" << item << "\"" << endl;
+ }else{
+ KCompletion::addItem( tx );
+ kdDebug() << "addding \"" << item << "\" as \"" << tx << "\"" << endl;
+ }
+ KCompletion::addItem( item );
+ }
+
+ virtual void removeItem ( const QString &item ) {
+ FuncMap::iterator it = nameMap.find( item );
+ if( it != nameMap.end() ) {
+ KCompletion::removeItem( *it );
+ revNameMap.remove( *it );
+ nameMap.remove( it );
+ }
+ }
+
+ virtual void clear() {
+ nameMap.clear();
+ revNameMap.clear();
+ KCompletion::clear();
+ }
+
+ virtual void postProcessMatch ( QString *match ) const {
+ FuncMap::const_iterator it = revNameMap.find( *match );
+ if( it != revNameMap.end() ) {
+ *match = *it;
+ }
+ };
+
+ virtual void postProcessMatches ( QStringList *matches ) const {
+ QStringList::iterator it = matches->begin();
+
+ while( it != matches->end() ) {
+ postProcessMatch( &(*it) );
+ ++it;
+ }
+ }
+
+ virtual void postProcessMatches ( KCompletionMatches *matches ) const {
+ }
+};
+
+
+typedef KDevGenericFactory<ClassViewPart> ClassViewFactory;
+static const KDevPluginInfo data("kdevclassview");
+K_EXPORT_COMPONENT_FACTORY( libkdevclassview, ClassViewFactory( data ) )
+
+ClassViewPart::ClassViewPart(QObject *parent, const char *name, const QStringList& )
+ :/// KDevPlugin( &data, parent, name ? name : "ClassViewPart" ),
+ KDevCodeBrowserFrontend( &data, parent, name ? name : "ClassViewPart" ),
+ m_activeDocument(0), m_activeView(0), m_activeSelection(0), m_activeEditor(0), m_activeViewCursor(0), m_hierarchyDlg(0)
+{
+ setInstance(ClassViewFactory::instance());
+ setXMLFile("kdevclassview.rc");
+
+ navigator = new Navigator(this);
+
+ setupActions();
+
+ m_widget = new ClassViewWidget(this);
+ m_widget->setIcon( SmallIcon("view_tree") );
+ m_widget->setCaption(i18n("Class Browser"));
+ mainWindow()->embedSelectView( m_widget, i18n("Classes"), i18n("Class browser") );
+ QWhatsThis::add(m_widget, i18n("<b>Class browser</b><p>"
+ "The class browser shows all namespaces, classes and namespace and class members in a project."));
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+ connect( core(), SIGNAL(languageChanged()), this, SLOT(slotProjectOpened()) );
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(activePartChanged(KParts::Part*)));
+}
+
+bool ClassViewPart::jumpedToItem( ItemDom item ) {
+ if(!m_widget) return false;
+ return m_widget->selectItem(item);
+}
+
+ClassViewPart::~ClassViewPart()
+{
+ mainWindow()->removeView( m_widget );
+ delete (ClassViewWidget*) m_widget;
+ delete m_hierarchyDlg;
+}
+
+void ClassViewPart::slotProjectOpened( )
+{
+ connect( languageSupport(), SIGNAL(updatedSourceInfo()), navigator, SLOT(refresh()) );
+ connect( languageSupport(), SIGNAL(addedSourceInfo(const QString& )), navigator, SLOT(addFile(const QString& )));
+ navigator->refresh();
+}
+
+void ClassViewPart::slotProjectClosed( )
+{
+// navigator->refresh();
+// disconnect( languageSupport(), SIGNAL(updatedSourceInfo()), navigator, SLOT(refresh()) );
+}
+
+void ClassViewPart::setupActions( )
+{
+ m_functionsnav = new KListViewAction( new KComboView(true, 150, 0, "m_functionsnav_combo", new FunctionCompletion() ), i18n("Functions Navigation"), 0, 0, 0, actionCollection(), "functionsnav_combo", true );
+ connect(m_functionsnav->view(), SIGNAL(activated(QListViewItem*)), navigator, SLOT(selectFunctionNav(QListViewItem*)));
+// m_functionsnav->view()->setEditable(false);
+ connect(m_functionsnav->view(), SIGNAL(focusGranted()), navigator, SLOT(functionNavFocused()));
+ connect(m_functionsnav->view(), SIGNAL(focusLost()), navigator, SLOT(functionNavUnFocused()));
+ m_functionsnav->setToolTip(i18n("Functions in file"));
+ m_functionsnav->setWhatsThis(i18n("<b>Function navigator</b><p>Navigates over functions contained in the file."));
+// m_functionsnav->view()->setCurrentText(NAV_NODEFINITION);
+ m_functionsnav->view()->setDefaultText(NAV_NODEFINITION);
+
+ new KAction( i18n("Focus Navigator"), 0, this, SLOT(slotFocusNavbar()), actionCollection(), "focus_navigator" );
+
+ if (langHasFeature(KDevLanguageSupport::Classes))
+ {
+ KAction *ac = new KAction(i18n("Class Inheritance Diagram"), "view_tree", 0, this, SLOT(graphicalClassView()), actionCollection(), "inheritance_dia");
+ ac->setToolTip(i18n("Class inheritance diagram"));
+ ac->setWhatsThis(i18n("<b>Class inheritance diagram</b><p>Displays inheritance relationship between classes in project. "
+ "Note, it does not display classes outside inheritance hierarchy."));
+ }
+}
+
+bool ClassViewPart::langHasFeature(KDevLanguageSupport::Features feature)
+{
+ bool result = false;
+ if (languageSupport())
+ result = (feature & languageSupport()->features());
+ return result;
+}
+
+void ClassViewPart::graphicalClassView( )
+{
+ if( !m_hierarchyDlg )
+ m_hierarchyDlg = new HierarchyDialog(this);
+ m_hierarchyDlg->refresh();
+ m_hierarchyDlg->show();
+}
+
+void ClassViewPart::refresh() {
+ if( navigator )
+ navigator->refresh();
+}
+
+void ClassViewPart::activePartChanged( KParts::Part * part)
+{
+ navigator->stopTimer();
+ if (m_activeView)
+ {
+ disconnect(m_activeView, SIGNAL(cursorPositionChanged()),
+ navigator, SLOT(slotCursorPositionChanged()));
+ }
+
+ kdDebug() << "ClassViewPart::activePartChanged()" << endl;
+
+ m_activeDocument = dynamic_cast<KTextEditor::Document*>( part );
+ m_activeView = part ? dynamic_cast<KTextEditor::View*>( part->widget() ) : 0;
+ m_activeEditor = dynamic_cast<KTextEditor::EditInterface*>( part );
+ m_activeSelection = dynamic_cast<KTextEditor::SelectionInterface*>( part );
+ m_activeViewCursor = part ? dynamic_cast<KTextEditor::ViewCursorInterface*>( m_activeView ) : 0;
+
+ m_activeFileName = QString::null;
+
+ if (m_activeDocument)
+ {
+ m_activeFileName = URLUtil::canonicalPath( m_activeDocument->url().path() );
+ navigator->refreshNavBars(m_activeFileName);
+ navigator->syncFunctionNavDelayed(200);
+/* if ( languageSupport()->mimeTypes().find(
+ KMimeType::findByPath(m_activeFileName)) != languageSupport()->mimeTypes().end() )
+ m_activeFileName = QString::null;*/
+ }
+ if( m_activeViewCursor )
+ {
+ connect(m_activeView, SIGNAL(cursorPositionChanged()),
+ navigator, SLOT(slotCursorPositionChanged()) );
+ }
+}
+void ClassViewPart::slotFocusNavbar()
+{
+ m_functionsnav->view()->setFocus();
+}
+
+#include "classviewpart.moc"
diff --git a/parts/classview/classviewpart.h b/parts/classview/classviewpart.h
new file mode 100644
index 00000000..d10553e4
--- /dev/null
+++ b/parts/classview/classviewpart.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __KDEVPART_CLASSVIEW_H__
+#define __KDEVPART_CLASSVIEW_H__
+
+#include "kdevlanguagesupport.h"
+#include "viewcombos.h"
+
+#include <qguardedptr.h>
+#include <qmap.h>
+
+#include <kdevplugin.h>
+
+#include <codemodel.h>
+#include <codebrowserfrontend.h>
+
+using namespace Extensions;
+
+namespace KParts { class Part; }
+namespace KTextEditor
+{
+ class Document;
+ class View;
+ class EditInterface;
+ class SelectionInterface;
+ class ViewCursorInterface;
+}
+
+
+class ClassViewWidget;
+class KListViewAction;
+class QListViewItem;
+class KToolBarPopupAction;
+class NamespaceItem;
+class Navigator;
+class HierarchyDialog;
+class ClassViewPart : public Extensions::KDevCodeBrowserFrontend
+{
+ Q_OBJECT
+public:
+ ClassViewPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~ClassViewPart();
+
+ bool langHasFeature(KDevLanguageSupport::Features feature);
+
+ KListViewAction *m_functionsnav;
+ Navigator *navigator;
+
+ inline ClassViewWidget* widget() {
+ return &( *m_widget );
+ }
+
+ virtual bool jumpedToItem( ItemDom item );
+
+private slots:
+ void slotProjectOpened();
+ void slotProjectClosed();
+ void graphicalClassView();
+ void refresh();
+ void slotFocusNavbar();
+
+ void activePartChanged(KParts::Part*);
+
+private:
+ void setupActions();
+
+ QGuardedPtr<ClassViewWidget> m_widget;
+
+ QString m_activeFileName;
+ KTextEditor::Document* m_activeDocument;
+ KTextEditor::View* m_activeView;
+ KTextEditor::SelectionInterface* m_activeSelection;
+ KTextEditor::EditInterface* m_activeEditor;
+ KTextEditor::ViewCursorInterface* m_activeViewCursor;
+
+ HierarchyDialog* m_hierarchyDlg;
+ friend class Navigator;
+};
+
+
+#endif
diff --git a/parts/classview/classviewwidget.cpp b/parts/classview/classviewwidget.cpp
new file mode 100644
index 00000000..f26f1b92
--- /dev/null
+++ b/parts/classview/classviewwidget.cpp
@@ -0,0 +1,1295 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Partially based on KDE Studio ClassListView http://www.thekompany.com/projects/kdestudio/
+ */
+
+#include "classviewpart.h"
+#include "classviewwidget.h"
+
+#include <kiconloader.h>
+#include <kinstance.h>
+#include <kurl.h>
+#include <kaction.h>
+#include <kactionclasses.h>
+#include <kpopupmenu.h>
+#include <kconfig.h>
+
+#include <urlutil.h>
+#include <kdevcore.h>
+#include <kdevlanguagesupport.h>
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+#include <codemodel.h>
+#include <codemodel_utils.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <qheader.h>
+#include <qdir.h>
+#include <qstylesheet.h>
+#include <qstringlist.h>
+
+// namespace ?!?
+
+ClassViewWidget::ClassViewWidget( ClassViewPart * part )
+ : KListView( 0, "ClassViewWidget" ), QToolTip( viewport() ), m_part( part ), m_projectDirectoryLength( 0 )
+{
+ addColumn( "" );
+ header()->hide();
+ setSorting( 0 );
+ setRootIsDecorated( true );
+ setAllColumnsShowFocus( true );
+
+ m_projectItem = 0;
+
+ connect( this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(slotExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotExecuted(QListViewItem*)) );
+ connect( m_part->core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( m_part->core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+ connect( m_part->core(), SIGNAL(languageChanged()), this, SLOT(slotProjectOpened()) );
+
+ QStringList lst;
+ lst << i18n( "Group by Directories" ) << i18n( "Plain List" ) << i18n( "Java Like Mode" );
+ m_actionViewMode = new KSelectAction( i18n("View Mode"), KShortcut(), m_part->actionCollection(), "classview_mode" );
+ m_actionViewMode->setItems( lst );
+ m_actionViewMode->setWhatsThis(i18n("<b>View mode</b><p>Class browser items can be grouped by directories, listed in a plain or java like view."));
+
+ m_actionNewClass = new KAction( i18n("New Class..."), KShortcut(), this, SLOT(slotNewClass()),
+ m_part->actionCollection(), "classview_new_class" );
+ m_actionNewClass->setWhatsThis(i18n("<b>New class</b><p>Calls the <b>New Class</b> wizard."));
+
+ m_actionCreateAccessMethods = new KAction( i18n("Create get/set Methods"), KShortcut(), this, SLOT(slotCreateAccessMethods()), m_part->actionCollection(), "classview_create_access_methods" );
+
+
+ m_actionAddMethod = new KAction( i18n("Add Method..."), KShortcut(), this, SLOT(slotAddMethod()),
+ m_part->actionCollection(), "classview_add_method" );
+ m_actionAddMethod->setWhatsThis(i18n("<b>Add method</b><p>Calls the <b>New Method</b> wizard."));
+ m_actionAddAttribute = new KAction( i18n("Add Attribute..."), KShortcut(), this, SLOT(slotAddAttribute()),
+ m_part->actionCollection(), "classview_add_attribute" );
+ m_actionAddAttribute->setWhatsThis(i18n("<b>Add attribute</b><p>Calls the <b>New Attribute</b> wizard."));
+
+ m_actionOpenDeclaration = new KAction( i18n("Open Declaration"), KShortcut(), this, SLOT(slotOpenDeclaration()),
+ m_part->actionCollection(), "classview_open_declaration" );
+ m_actionOpenDeclaration->setWhatsThis(i18n("<b>Open declaration</b><p>Opens a file where the selected item is declared and jumps to the declaration line."));
+ m_actionOpenImplementation = new KAction( i18n("Open Implementation"), KShortcut(), this, SLOT(slotOpenImplementation()),
+ m_part->actionCollection(), "classview_open_implementation" );
+ m_actionOpenImplementation->setWhatsThis(i18n("<b>Open implementation</b><p>Opens a file where the selected item is defined (implemented) and jumps to the definition line."));
+
+ m_actionFollowEditor = new KToggleAction( i18n("Follow Editor"), KShortcut(), this, SLOT(slotFollowEditor()), m_part->actionCollection(), "classview_follow_editor" );
+
+ KConfig* config = m_part->instance()->config();
+ config->setGroup( "General" );
+ setViewMode( config->readNumEntry( "ViewMode", KDevelop3ViewMode ) );
+ m_doFollowEditor = config->readBoolEntry( "FollowEditor", false );
+}
+
+ClassViewWidget::~ClassViewWidget( )
+{
+ KConfig* config = m_part->instance()->config();
+ config->setGroup( "General" );
+ config->writeEntry( "ViewMode", viewMode() );
+ config->writeEntry( "FollowEditor", m_doFollowEditor );
+ config->sync();
+}
+
+template <class ModelType, class ListItemType>
+ static bool selectItemG( ItemDom item, const QMap<KSharedPtr<ModelType>, ListItemType*>& map )
+{
+ ModelType* c = dynamic_cast<ModelType*>( &(*item) );
+
+ if( c ) {
+ KSharedPtr<ModelType> d( c );
+ typename QMap<KSharedPtr<ModelType>, ListItemType*>::ConstIterator it = map.find(d);
+ if( it != map.end() ) {
+ ( *it )->select();
+ return true;
+ }
+ }
+ return false;
+}
+
+
+void ClassViewWidget::slotExecuted( QListViewItem* item )
+{
+ if( ClassViewItem* cbitem = dynamic_cast<ClassViewItem*>( item ) ){
+ if( cbitem->hasImplementation() )
+ cbitem->openImplementation();
+ else
+ cbitem->openDeclaration();
+ }
+}
+
+void ClassViewWidget::clear( )
+{
+ KListView::clear();
+ removedText.clear();
+ m_projectItem = 0;
+}
+
+void restoreOpenNodes( QStringList & list, QListViewItem * item )
+{
+ if ( item && !list.isEmpty() )
+ {
+ if ( item->text( 0 ) == list.first() )
+ {
+ item->setOpen( true );
+ list.pop_front();
+ restoreOpenNodes( list, item->firstChild() );
+ }
+ else
+ {
+ restoreOpenNodes( list, item->nextSibling() );
+ }
+ }
+}
+
+void storeOpenNodes( QValueList<QStringList> & openNodes, QStringList const & list, QListViewItem * item )
+{
+ if ( item )
+ {
+ if ( item->isOpen() )
+ {
+ QStringList mylist( list );
+ mylist << item->text( 0 );
+ openNodes << mylist;
+ storeOpenNodes( openNodes, mylist, item->firstChild() );
+ }
+ storeOpenNodes( openNodes, list, item->nextSibling() );
+ }
+}
+
+void ClassViewWidget::refresh()
+{
+ if( !m_part->project() )
+ return;
+
+ QValueList<QStringList> openNodes;
+ storeOpenNodes( openNodes, QStringList(), firstChild() );
+ int scrollbarPos = verticalScrollBar()->value();
+
+ clear();
+ m_projectItem = new FolderBrowserItem( this, this, m_part->project()->projectName() );
+ m_projectItem->setOpen( true );
+ blockSignals( true );
+
+ FileList fileList = m_part->codeModel()->fileList();
+ FileList::Iterator it = fileList.begin();
+ while( it != fileList.end() ){
+ insertFile( (*it)->name() );
+ ++it;
+ }
+
+ QValueList<QStringList>::iterator itt = openNodes.begin();
+ while ( itt != openNodes.end() )
+ {
+ restoreOpenNodes ( *itt, firstChild() );
+ ++itt;
+ }
+ verticalScrollBar()->setValue( scrollbarPos );
+
+ blockSignals( false );
+}
+
+void ClassViewWidget::slotProjectOpened( )
+{
+ m_projectItem = new FolderBrowserItem( this, this, m_part->project()->projectName() );
+ m_projectItem->setOpen( true );
+
+ m_projectDirectory = URLUtil::canonicalPath( m_part->project()->projectDirectory() );
+ if( m_projectDirectory.isEmpty() )
+ m_projectDirectory = m_part->project()->projectDirectory();
+
+ m_projectDirectoryLength = m_projectDirectory.length() + 1;
+
+ connect( m_part->languageSupport(), SIGNAL(updatedSourceInfo()),
+ this, SLOT(refresh()) );
+ connect( m_part->languageSupport(), SIGNAL(aboutToRemoveSourceInfo(const QString&)),
+ this, SLOT(removeFile(const QString&)) );
+ connect( m_part->languageSupport(), SIGNAL(addedSourceInfo(const QString&)),
+ this, SLOT(insertFile(const QString&)) );
+}
+
+void ClassViewWidget::slotProjectClosed( )
+{
+}
+
+
+void ClassViewWidget::insertFile( const QString& fileName )
+{
+ QString fn = URLUtil::canonicalPath( fileName );
+ //kdDebug() << "======================== insertFile(" << fn << ")" << endl;
+
+ FileDom dom = m_part->codeModel()->fileByName( fn );
+ if( !dom )
+ return;
+
+ fn = URLUtil::relativePathToFile(m_part->project()->projectDirectory(), fn);
+ QStringList path;
+
+ switch( viewMode() )
+ {
+ case KDevelop3ViewMode:
+ {
+ path = QStringList::split( "/", fn );
+ path.pop_back();
+ }
+ break;
+
+ case KDevelop2ViewMode:
+ {
+ }
+ break;
+
+ case JavaLikeViewMode:
+ {
+ QStringList l = QStringList::split( "/", fn );
+ l.pop_back();
+
+ QString package = l.join(".");
+ if( !package.isEmpty() )
+ path.push_back( package );
+ }
+ break;
+ }
+
+ m_projectItem->processFile( dom, path );
+}
+
+void ClassViewWidget::removeFile( const QString& fileName )
+{
+ QString fn = URLUtil::canonicalPath( fileName );
+ //kdDebug() << "======================== removeFile(" << fn << ")" << endl;
+
+ FileDom dom = m_part->codeModel()->fileByName( fn );
+ if( !dom )
+ return;
+
+ fn = URLUtil::relativePathToFile(m_part->project()->projectDirectory(), fn);
+ QStringList path;
+
+ switch( viewMode() )
+ {
+ case KDevelop3ViewMode:
+ {
+ path = QStringList::split( "/", fn );
+ path.pop_back();
+ }
+ break;
+
+ case KDevelop2ViewMode:
+ {
+ }
+ break;
+
+ case JavaLikeViewMode:
+ {
+ QStringList l = QStringList::split( "/", fn );
+ l.pop_back();
+
+ QString package = l.join(".");
+ if( !package.isEmpty() )
+ path.push_back( package );
+ }
+ break;
+ }
+
+ m_projectItem->processFile( dom, path, true );
+}
+
+void ClassViewWidget::contentsContextMenuEvent( QContextMenuEvent * ev )
+{
+ KPopupMenu menu( this );
+
+ ClassViewItem* item = dynamic_cast<ClassViewItem*>( selectedItem() );
+
+ m_actionFollowEditor->plug( &menu );
+ m_actionFollowEditor->setChecked( m_doFollowEditor );
+ menu.insertSeparator();
+
+ m_actionOpenDeclaration->setEnabled( item && item->hasDeclaration() );
+ m_actionOpenImplementation->setEnabled( item && item->hasImplementation() );
+
+ m_actionOpenDeclaration->plug( &menu );
+ m_actionOpenImplementation->plug( &menu );
+ menu.insertSeparator();
+
+ bool sep = false;
+ if( item && item->isClass() ){
+ if( m_part->langHasFeature(KDevLanguageSupport::AddMethod) ) {
+ m_actionAddMethod->plug( &menu );
+ sep = true;
+ }
+
+ if( m_part->langHasFeature(KDevLanguageSupport::AddAttribute) ) {
+ m_actionAddAttribute->plug( &menu );
+ sep = true;
+ }
+ }
+
+ if (item && item->isVariable()){
+ if( m_part->langHasFeature(KDevLanguageSupport::CreateAccessMethods) )
+ m_actionCreateAccessMethods->plug( &menu );
+ }
+
+ if( item && item->model() ){
+ CodeModelItemContext context( item->model() );
+ m_part->core()->fillContextMenu( &menu, &context );
+// sep = true;
+ }
+ if (sep)
+ menu.insertSeparator();
+
+ int oldViewMode = viewMode();
+ m_actionViewMode->plug( &menu );
+
+ menu.exec( ev->globalPos() );
+
+ if( viewMode() != oldViewMode )
+ refresh();
+
+ ev->consume();
+}
+
+void ClassViewWidget::setViewMode( int mode ) {
+ m_actionViewMode->setCurrentItem( mode );
+}
+
+int ClassViewWidget::viewMode( ) const
+{
+ return m_actionViewMode->currentItem();
+}
+
+QString ClassViewItem::comment() {
+ return QString();
+}
+
+void ClassViewItem::select( ) {
+ setOpen(true);
+ listView()->setCurrentItem(this);
+ QListViewItem* c = firstChild();
+ int size = 0;
+ if(c != 0) {
+ while(c->nextSibling()) {
+ c = c->nextSibling();
+ size++;
+ }
+ listView()->ensureItemVisible(c);
+ }
+ listView()->ensureItemVisible(this);
+}
+
+
+bool ClassViewWidget::selectItem( ItemDom item ) {
+ if(!m_projectItem || !isVisible()) return false;
+ if(item->isFunctionDefinition() && dynamic_cast<FunctionDefinitionModel*>(&(*item)) != 0) {
+ FunctionList lst;
+ FileList fileList = m_part->codeModel()->fileList();
+ CodeModelUtils::findFunctionDeclarations( FindOp2(FunctionDefinitionDom( (FunctionDefinitionModel*)&(*item) )), fileList, lst );
+ if(lst.isEmpty()) return false;
+
+ item = *lst.begin();
+ }
+
+ return m_projectItem->selectItem( item );
+}
+
+
+QString NamespaceDomBrowserItem::comment() {
+ return m_dom->comment();
+}
+
+bool FolderBrowserItem::selectItem(ItemDom item)
+{
+ if(item->kind() == CodeModelItem::Class) {
+ if( selectItemG ( item, m_classes ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Function) {
+ if( selectItemG ( item, m_functions ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::TypeAlias) {
+ if( selectItemG ( item, m_typeAliases ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Variable) {
+ if( selectItemG ( item, m_variables ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Namespace) {
+ ///searching for namespaces is currently not supported and not useful
+ }
+
+ for( QMap<ClassDom, ClassDomBrowserItem*>::Iterator it = m_classes.begin(); it != m_classes.end(); ++it ) {
+ if( (*it)->selectItem(item) )
+ return true;
+ }
+
+ for( QMap<QString, NamespaceDomBrowserItem*>::Iterator it = m_namespaces.begin(); it != m_namespaces.end(); ++it ) {
+ if( (*it)->selectItem(item) )
+ return true;
+ }
+
+ for( QMap<QString, FolderBrowserItem*>::Iterator it = m_folders.begin(); it != m_folders.end(); ++it ) {
+ if( (*it)->selectItem(item) ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+void FolderBrowserItem::processFile( FileDom file, QStringList& path, bool remove )
+{
+ if( path.isEmpty() ){
+ NamespaceList namespaceList = file->namespaceList();
+ ClassList classList = file->classList();
+ TypeAliasList typeAliasList = file->typeAliasList();
+ FunctionList functionList = file->functionList();
+ VariableList variableList = file->variableList();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ processNamespace( *it, remove );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ processVariable( *it, remove );
+
+ return;
+ }
+
+ QString current = path.front();
+ path.pop_front();
+
+ FolderBrowserItem* item = m_folders.contains( current ) ? m_folders[ current ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new FolderBrowserItem( m_widget, this, current );
+ if( listView()->removedText.contains(current) )
+ item->setOpen( true );
+ m_folders.insert( current, item );
+ }
+
+ item->processFile( file, path, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_folders.remove( current );
+ if( item->isOpen() ){
+ listView()->removedText << current;
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::processNamespace( NamespaceDom ns, bool remove )
+{
+ NamespaceDomBrowserItem* item = m_namespaces.contains( ns->name() ) ? m_namespaces[ ns->name() ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new NamespaceDomBrowserItem( this, ns );
+ if( listView()->removedText.contains(ns->name()) )
+ item->setOpen( true );
+ m_namespaces.insert( ns->name(), item );
+ }
+
+ NamespaceList namespaceList = ns->namespaceList();
+ ClassList classList = ns->classList();
+ TypeAliasList typeAliasList = ns->typeAliasList();
+ FunctionList functionList = ns->functionList();
+ VariableList variableList = ns->variableList();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ item->processNamespace( *it, remove );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ item->processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ item->processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ item->processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ item->processVariable( *it, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_namespaces.remove( ns->name() );
+ if( item->isOpen() ){
+ listView()->removedText << ns->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::processClass( ClassDom klass, bool remove )
+{
+ ClassDomBrowserItem* item = m_classes.contains( klass ) ? m_classes[ klass ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new ClassDomBrowserItem( this, klass );
+ if( listView()->removedText.contains(klass->name()) )
+ item->setOpen( true );
+ m_classes.insert( klass, item );
+ }
+
+ ClassList classList = klass->classList();
+ TypeAliasList typeAliasList = klass->typeAliasList();
+ FunctionList functionList = klass->functionList();
+ VariableList variableList = klass->variableList();
+
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ item->processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ item->processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ item->processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ item->processVariable( *it, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_classes.remove( klass );
+ if( item->isOpen() ){
+ listView()->removedText << klass->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::processTypeAlias( TypeAliasDom typeAlias, bool remove )
+{
+ TypeAliasDomBrowserItem* item = m_typeAliases.contains( typeAlias ) ? m_typeAliases[ typeAlias ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new TypeAliasDomBrowserItem( this, typeAlias );
+ if( listView()->removedText.contains(typeAlias->name()) )
+ item->setOpen( true );
+ m_typeAliases.insert( typeAlias, item );
+ }
+
+ if( remove && item->childCount() == 0 ){
+ m_typeAliases.remove( typeAlias );
+ if( item->isOpen() ){
+ listView()->removedText << typeAlias->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::processFunction( FunctionDom fun, bool remove )
+{
+ FunctionDomBrowserItem* item = m_functions.contains( fun ) ? m_functions[ fun ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new FunctionDomBrowserItem( this, fun );
+ m_functions.insert( fun, item );
+ }
+
+ if( remove ){
+ m_functions.remove( fun );
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::processVariable( VariableDom var, bool remove )
+{
+ VariableDomBrowserItem* item = m_variables.contains( var ) ? m_variables[ var ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new VariableDomBrowserItem( this, var );
+ m_variables.insert( var, item );
+ }
+
+ if( remove ){
+ m_variables.remove( var );
+ delete( item );
+ item = 0;
+ }
+}
+
+// ------------------------------------------------------------------------
+bool NamespaceDomBrowserItem::selectItem( ItemDom item)
+{
+ if(item->kind() == CodeModelItem::Class) {
+ if( selectItemG ( item, m_classes ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Function) {
+ if( selectItemG ( item, m_functions ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::TypeAlias) {
+ if( selectItemG ( item, m_typeAliases ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Variable) {
+ if( selectItemG ( item, m_variables ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Namespace) {
+ ///currently not neccessary..
+ }
+
+ for(QMap<ClassDom, ClassDomBrowserItem*>::Iterator it = m_classes.begin(); it != m_classes.end(); ++it) {
+ if( (*it)->selectItem(item) )
+ return true;
+ }
+
+ for(QMap<QString, NamespaceDomBrowserItem*>::Iterator it = m_namespaces.begin(); it != m_namespaces.end(); ++it) {
+ if( (*it)->selectItem(item) )
+ return true;
+ }
+ return false;
+}
+
+
+void NamespaceDomBrowserItem::processNamespace( NamespaceDom ns, bool remove )
+{
+ NamespaceDomBrowserItem* item = m_namespaces.contains( ns->name() ) ? m_namespaces[ ns->name() ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new NamespaceDomBrowserItem( this, ns );
+ if( listView()->removedText.contains(ns->name()) )
+ item->setOpen( true );
+ m_namespaces.insert( ns->name(), item );
+ }
+
+ NamespaceList namespaceList = ns->namespaceList();
+ ClassList classList = ns->classList();
+ TypeAliasList typeAliasList = ns->typeAliasList();
+ FunctionList functionList = ns->functionList();
+ VariableList variableList = ns->variableList();
+
+ for( NamespaceList::Iterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ item->processNamespace( *it, remove );
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ item->processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ item->processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ item->processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ item->processVariable( *it, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_namespaces.remove( ns->name() );
+ if( item->isOpen() ){
+ listView()->removedText << ns->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void NamespaceDomBrowserItem::processClass( ClassDom klass, bool remove )
+{
+ ClassDomBrowserItem* item = m_classes.contains( klass ) ? m_classes[ klass ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new ClassDomBrowserItem( this, klass );
+ if( listView()->removedText.contains(klass->name()) )
+ item->setOpen( true );
+ m_classes.insert( klass, item );
+ }
+
+ ClassList classList = klass->classList();
+ TypeAliasList typeAliasList = klass->typeAliasList();
+ FunctionList functionList = klass->functionList();
+ VariableList variableList = klass->variableList();
+
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ item->processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ item->processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ item->processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ item->processVariable( *it, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_classes.remove( klass );
+ if( item->isOpen() ){
+ listView()->removedText << klass->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void NamespaceDomBrowserItem::processTypeAlias( TypeAliasDom typeAlias, bool remove )
+{
+ TypeAliasDomBrowserItem* item = m_typeAliases.contains( typeAlias ) ? m_typeAliases[ typeAlias ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new TypeAliasDomBrowserItem( this, typeAlias );
+ if( listView()->removedText.contains(typeAlias->name()) )
+ item->setOpen( true );
+ m_typeAliases.insert( typeAlias, item );
+ }
+
+ if( remove && item->childCount() == 0 ){
+ m_typeAliases.remove( typeAlias );
+ if( item->isOpen() ){
+ listView()->removedText << typeAlias->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void NamespaceDomBrowserItem::processFunction( FunctionDom fun, bool remove )
+{
+ FunctionDomBrowserItem* item = m_functions.contains( fun ) ? m_functions[ fun ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new FunctionDomBrowserItem( this, fun );
+ m_functions.insert( fun, item );
+ }
+
+ if( remove ){
+ m_functions.remove( fun );
+ delete( item );
+ item = 0;
+ }
+}
+
+void NamespaceDomBrowserItem::processVariable( VariableDom var, bool remove )
+{
+ VariableDomBrowserItem* item = m_variables.contains( var ) ? m_variables[ var ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new VariableDomBrowserItem( this, var );
+ m_variables.insert( var, item );
+ }
+
+ if( remove ){
+ m_variables.remove( var );
+ delete( item );
+ item = 0;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+
+bool ClassDomBrowserItem::selectItem(ItemDom item)
+{
+ if(item->kind() == CodeModelItem::Class) {
+ if( selectItemG ( item, m_classes ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Function) {
+ if( selectItemG ( item, m_functions ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::TypeAlias) {
+ if( selectItemG ( item, m_typeAliases ) ) return true;
+ }
+
+ if(item->kind() == CodeModelItem::Variable) {
+ if( selectItemG ( item, m_variables ) ) return true;
+ }
+
+ for(QMap<ClassDom, ClassDomBrowserItem*>::Iterator it = m_classes.begin(); it != m_classes.end(); ++it) {
+ if( (*it)->selectItem(item) )
+ return true;
+ }
+ return false;
+}
+
+
+void ClassDomBrowserItem::processClass( ClassDom klass, bool remove )
+{
+ ClassDomBrowserItem* item = m_classes.contains( klass ) ? m_classes[ klass ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new ClassDomBrowserItem( this, klass );
+ if( listView()->removedText.contains(klass->name()) )
+ item->setOpen( true );
+ m_classes.insert( klass, item );
+ }
+
+ ClassList classList = klass->classList();
+ TypeAliasList typeAliasList = klass->typeAliasList();
+ FunctionList functionList = klass->functionList();
+ VariableList variableList = klass->variableList();
+
+ for( ClassList::Iterator it=classList.begin(); it!=classList.end(); ++it )
+ item->processClass( *it, remove );
+ for( TypeAliasList::Iterator it=typeAliasList.begin(); it!=typeAliasList.end(); ++it )
+ item->processTypeAlias( *it, remove );
+ for( FunctionList::Iterator it=functionList.begin(); it!=functionList.end(); ++it )
+ item->processFunction( *it, remove );
+ for( VariableList::Iterator it=variableList.begin(); it!=variableList.end(); ++it )
+ item->processVariable( *it, remove );
+
+ if( remove && item->childCount() == 0 ){
+ m_classes.remove( klass );
+ if( item->isOpen() ){
+ listView()->removedText << klass->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void ClassDomBrowserItem::processTypeAlias( TypeAliasDom typeAlias, bool remove )
+{
+ TypeAliasDomBrowserItem* item = m_typeAliases.contains( typeAlias ) ? m_typeAliases[ typeAlias ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new TypeAliasDomBrowserItem( this, typeAlias );
+ if( listView()->removedText.contains(typeAlias->name()) )
+ item->setOpen( true );
+ m_typeAliases.insert( typeAlias, item );
+ }
+
+ if( remove && item->childCount() == 0 ){
+ m_typeAliases.remove( typeAlias );
+ if( item->isOpen() ){
+ listView()->removedText << typeAlias->name();
+ }
+ delete( item );
+ item = 0;
+ }
+}
+
+void ClassDomBrowserItem::processFunction( FunctionDom fun, bool remove )
+{
+ FunctionDomBrowserItem* item = m_functions.contains( fun ) ? m_functions[ fun ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new FunctionDomBrowserItem( this, fun );
+ m_functions.insert( fun, item );
+ }
+
+ if( remove ){
+ m_functions.remove( fun );
+ delete( item );
+ item = 0;
+ }
+}
+
+void ClassDomBrowserItem::processVariable( VariableDom var, bool remove )
+{
+ VariableDomBrowserItem* item = m_variables.contains( var ) ? m_variables[ var ] : 0;
+ if( !item ){
+ if( remove )
+ return;
+
+ item = new VariableDomBrowserItem( this, var );
+ m_variables.insert( var, item );
+ }
+
+ if( remove ){
+ m_variables.remove( var );
+ delete( item );
+ item = 0;
+ }
+}
+
+void FolderBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+ setPixmap( 0, SmallIcon("folder") );
+ setExpandable( true );
+}
+
+void NamespaceDomBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+ setPixmap( 0, UserIcon("CVnamespace", KIcon::DefaultState, listView()->m_part->instance()) );
+ setExpandable( true );
+
+ QString txt = listView()->m_part->languageSupport()->formatModelItem(m_dom.data(), true);
+ setText( 0, txt );
+}
+
+void ClassDomBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+ setPixmap( 0, UserIcon("CVclass", KIcon::DefaultState, listView()->m_part->instance()) );
+ setExpandable( true );
+
+ QString txt = listView()->m_part->languageSupport()->formatModelItem(m_dom.data(), true);
+ setText( 0, txt );
+}
+
+void TypeAliasDomBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+ setPixmap( 0, UserIcon("CVtypedef", KIcon::DefaultState, listView()->m_part->instance()) );
+ setExpandable( false );
+
+ QString txt = listView()->m_part->languageSupport()->formatModelItem(m_dom.data(), true);
+ setText( 0, txt );
+}
+
+void FunctionDomBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+
+ QString iconName;
+ QString methodType;
+
+ if ( m_dom->isSignal() )
+ methodType = "signal";
+ else if (m_dom->isSlot() )
+ methodType = "slot";
+ else
+ methodType = "meth";
+
+ if( m_dom->access() == CodeModelItem::Private )
+ iconName = "CVprivate_" + methodType;
+ else if( m_dom->access() == CodeModelItem::Protected )
+ iconName = "CVprotected_" + methodType;
+ else
+ iconName = "CVpublic_" + methodType;
+
+ setPixmap( 0, UserIcon(iconName, KIcon::DefaultState, listView()->m_part->instance()) );
+
+ QString txt = listView()->m_part->languageSupport()->formatModelItem(m_dom.data(), true);
+
+ item() = highlightFunctionName(txt, 1, m_styles);
+}
+
+void FunctionDomBrowserItem::openDeclaration()
+{
+ int startLine, startColumn;
+ m_dom->getStartPosition( &startLine, &startColumn );
+ listView()->m_part->partController()->editDocument( KURL(m_dom->fileName()), startLine );
+}
+
+void FunctionDomBrowserItem::openImplementation()
+{
+ FunctionDefinitionList lst;
+ FileList fileList = listView()->m_part->codeModel()->fileList();
+ CodeModelUtils::findFunctionDefinitions( FindOp(m_dom), fileList, lst );
+
+ if( lst.isEmpty() )
+ return;
+
+ FunctionDefinitionDom fun;
+ QFileInfo fileInfo( m_dom->fileName() );
+ QString path = fileInfo.dirPath( true );
+
+ for( FunctionDefinitionList::Iterator it=lst.begin(); it!=lst.end(); ++it )
+ {
+ QFileInfo defFileInfo( (*it)->fileName() );
+ QString defPath = defFileInfo.dirPath( true );
+
+ if( path != defPath )
+ continue;
+
+ if( defFileInfo.baseName() == fileInfo.baseName() ) {
+ fun = *it;
+ } else if( !fun ) {
+ fun = *it;
+ }
+ }
+
+ if( !fun ) {
+ fun = lst.front();
+ }
+
+ int startLine, startColumn;
+ fun->getStartPosition( &startLine, &startColumn );
+ listView()->m_part->partController()->editDocument( KURL(fun->fileName()), startLine );
+}
+
+void VariableDomBrowserItem::setup( )
+{
+ ClassViewItem::setup();
+ QString iconName;
+ if( m_dom->access() == CodeModelItem::Private )
+ iconName = "CVprivate_var";
+ else if( m_dom->access() == CodeModelItem::Protected )
+ iconName = "CVprotected_var";
+ else
+ iconName = "CVpublic_var";
+
+ setPixmap( 0, UserIcon(iconName, KIcon::DefaultState, listView()->m_part->instance()) );
+
+ QString txt = listView()->m_part->languageSupport()->formatModelItem(m_dom.data(), true);
+ setText( 0, txt );
+}
+
+void VariableDomBrowserItem::openDeclaration()
+{
+ int startLine, startColumn;
+ m_dom->getStartPosition( &startLine, &startColumn );
+
+ listView()->m_part->partController()->editDocument( KURL(m_dom->fileName()), startLine );
+}
+
+void VariableDomBrowserItem::openImplementation()
+{
+}
+
+QString FolderBrowserItem::key( int , bool ) const
+{
+ return "0 " + text( 0 );
+}
+
+QString NamespaceDomBrowserItem::key( int , bool ) const
+{
+ return "1 " + text( 0 );
+}
+
+QString ClassDomBrowserItem::key( int , bool ) const
+{
+ return "2 " + text( 0 );
+}
+
+QString TypeAliasDomBrowserItem::key( int , bool ) const
+{
+ return "3 " + text( 0 );
+}
+
+QString FunctionDomBrowserItem::key( int , bool ) const
+{
+ return "4 " + text( 0 );
+}
+
+QString VariableDomBrowserItem::key( int , bool ) const
+{
+ return "5 " + text( 0 );
+}
+
+void ClassViewWidget::slotNewClass( )
+{
+ if( m_part->languageSupport()->features() & KDevLanguageSupport::NewClass )
+ m_part->languageSupport()->addClass();
+}
+
+void ClassViewWidget::slotAddMethod( )
+{
+ if ( !selectedItem() ) return;
+
+ if( m_part->languageSupport()->features() & KDevLanguageSupport::AddMethod )
+ m_part->languageSupport()->addMethod( static_cast<ClassDomBrowserItem*>( selectedItem() )->dom() );
+}
+
+void ClassViewWidget::slotAddAttribute( )
+{
+ if ( !selectedItem() ) return;
+
+ if( m_part->languageSupport()->features() & KDevLanguageSupport::AddAttribute )
+ m_part->languageSupport()->addAttribute( static_cast<ClassDomBrowserItem*>( selectedItem() )->dom() );
+}
+
+void ClassViewWidget::slotOpenDeclaration( )
+{
+ if ( !selectedItem() ) return;
+
+ static_cast<ClassViewItem*>( selectedItem() )->openDeclaration();
+}
+
+void ClassViewWidget::slotOpenImplementation( )
+{
+ if ( !selectedItem() ) return;
+
+ static_cast<ClassViewItem*>( selectedItem() )->openImplementation();
+}
+
+void ClassDomBrowserItem::openDeclaration( )
+{
+ int startLine, startColumn;
+ m_dom->getStartPosition( &startLine, &startColumn );
+ listView()->m_part->partController()->editDocument( KURL(m_dom->fileName()), startLine );
+}
+
+void TypeAliasDomBrowserItem::openDeclaration( )
+{
+ int startLine, startColumn;
+ m_dom->getStartPosition( &startLine, &startColumn );
+ listView()->m_part->partController()->editDocument( KURL(m_dom->fileName()), startLine );
+}
+
+bool FunctionDomBrowserItem::hasImplementation() const
+{
+ FunctionDefinitionList lst;
+ FileList fileList = listView()->m_part->codeModel()->fileList();
+ CodeModelUtils::findFunctionDefinitions( FindOp(m_dom), fileList, lst );
+
+ return !lst.isEmpty();
+}
+
+void ClassViewWidget::maybeTip( QPoint const & p )
+{
+ ClassViewItem * item = dynamic_cast<ClassViewItem*>( itemAt( p ) );
+ if ( !item ) return;
+
+ QString tooltip;
+
+ if ( item->isNamespace() )
+ {
+ NamespaceDomBrowserItem * nitem = dynamic_cast<NamespaceDomBrowserItem*>( item );
+ if ( nitem )
+ {
+ tooltip = nitem->dom()->scope().join("::") + "::" + nitem->dom()->name();
+ }
+ }
+ else if ( item->isClass() )
+ {
+ ClassDomBrowserItem * citem = dynamic_cast<ClassDomBrowserItem*>( item );
+ if ( citem )
+ {
+ tooltip = citem->dom()->scope().join("::") + "::"
+ + citem->dom()->name() + " : "
+ + citem->dom()->baseClassList().join(", ");
+ }
+ }
+ else if ( item->isFunction() )
+ {
+ FunctionDomBrowserItem * fitem = dynamic_cast<FunctionDomBrowserItem*>( item );
+ if ( fitem )
+ {
+ QString access;
+ if ( fitem->dom()->access() == CodeModelItem::Private )
+ access = "[private] ";
+ else if ( fitem->dom()->access() == CodeModelItem::Protected )
+ access = "[protected] ";
+ else if ( fitem->dom()->access() == CodeModelItem::Public )
+ access = "[public] ";
+
+ QStringList arguments;
+ ArgumentList const & list = fitem->dom()->argumentList();
+ ArgumentList::ConstIterator it( list.begin() );
+ while ( it != list.end() )
+ {
+ arguments << ((*it)->type() + " " + (*it)->name());
+ ++it;
+ }
+
+ QString strstatic = fitem->dom()->isStatic() ? QString( "[static] " ) : QString::null;
+ QString strsignal = fitem->dom()->isSignal() ? QString( "[signal] " ) : QString::null;
+ QString strslot = fitem->dom()->isSlot() ? QString( "[slot] " ) : QString::null;
+ QString strresult = !fitem->dom()->resultType().isEmpty() ? fitem->dom()->resultType() + " " : QString::null;
+
+ QString strconstant = fitem->dom()->isConstant() ? QString( " [const]" ) : QString::null;
+ QString strabstract = fitem->dom()->isAbstract() ? QString( " [abstract]" ) : QString::null;
+
+ tooltip = access + strstatic + strsignal + strslot + strresult
+ + fitem->dom()->scope().join("::") + "::" + fitem->dom()->name()
+ + "(" + arguments.join(", ") + ")" + strconstant + strabstract;
+ }
+ }
+ else if ( item->isVariable() )
+ {
+ VariableDomBrowserItem * vitem = dynamic_cast<VariableDomBrowserItem*>( item );
+ if ( vitem )
+ {
+ QString access;
+ if ( vitem->dom()->access() == CodeModelItem::Private )
+ access = "[private] ";
+ else if ( vitem->dom()->access() == CodeModelItem::Protected )
+ access = "[protected] ";
+ else if ( vitem->dom()->access() == CodeModelItem::Public )
+ access = "[public] ";
+
+ QString strstatic = vitem->dom()->isStatic() ? QString( "[static] " ) : QString::null;
+ tooltip = access + strstatic + vitem->dom()->type() + " " + vitem->dom()->name();
+ }
+ }
+ else if ( item->isTypeAlias() )
+ {
+ if( TypeAliasDomBrowserItem * titem = dynamic_cast<TypeAliasDomBrowserItem*>( item ) )
+ {
+ tooltip = QString( "[Type] " ) + titem->dom()->type() + " " + titem->dom()->name();
+ }
+ }
+
+ const int maxCommentSize = 300;
+
+ if( !item->comment().isEmpty() ) {
+ tooltip += "\n";
+ tooltip += item->comment().length() > maxCommentSize ? item->comment().left( maxCommentSize ) + " [...]" : item->comment();
+ }
+
+ kdDebug(0) << tooltip << endl;
+
+ QRect r = itemRect( item );
+
+ if ( item && r.isValid() && !tooltip.isEmpty() )
+ {
+ tip( r, QString("<qt><pre>") + QStyleSheet::escape( tooltip ) + QString("</pre></qt>") );
+ }
+}
+
+void ClassViewWidget::slotCreateAccessMethods( )
+{
+ if ( !selectedItem() ) return;
+
+ if( m_part->languageSupport()->features() & KDevLanguageSupport::CreateAccessMethods )
+ {
+ VariableDomBrowserItem* item = dynamic_cast<VariableDomBrowserItem*>( selectedItem() );
+ if (item == 0)
+ return;
+
+ m_part->languageSupport()->createAccessMethods(static_cast<ClassModel*>(static_cast<ClassDomBrowserItem*>(item->parent())->dom()),static_cast<VariableModel*>(item->dom()));
+ }
+}
+
+void ClassViewWidget::slotFollowEditor()
+{
+ m_doFollowEditor = m_actionFollowEditor->isChecked();
+}
+
+bool ClassViewWidget::doFollowEditor()
+{
+ return m_doFollowEditor;
+}
+
+
+#include "classviewwidget.moc"
diff --git a/parts/classview/classviewwidget.h b/parts/classview/classviewwidget.h
new file mode 100644
index 00000000..0e9fa04b
--- /dev/null
+++ b/parts/classview/classviewwidget.h
@@ -0,0 +1,414 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Partially based on KDE Studio ClassListView http://www.thekompany.com/projects/kdestudio/
+ */
+
+#ifndef __CLASSVIEW_WIDGET_H__
+#define __CLASSVIEW_WIDGET_H__
+
+#include <klistview.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <qmap.h>
+#include <qtooltip.h>
+#include <codemodel.h>
+#include <fancylistviewitem.h>
+#include <navigator.h>
+
+class KDevProject;
+class ClassViewPart;
+class ClassViewItem;
+class FolderBrowserItem;
+class NamespaceDomBrowserItem;
+class ClassDomBrowserItem;
+class TypeAliasDomBrowserItem;
+class FunctionDomBrowserItem;
+class VariableDomBrowserItem;
+class KSelectAction;
+class KToggleAction;
+
+class ClassViewWidget : public KListView, public QToolTip
+{
+ Q_OBJECT
+public:
+ enum ViewMode
+ {
+ KDevelop3ViewMode = 0,
+ KDevelop2ViewMode,
+ JavaLikeViewMode
+ };
+
+public:
+ ClassViewWidget( ClassViewPart *part );
+ virtual ~ClassViewWidget();
+
+ int viewMode() const;
+ void setViewMode( int mode );
+
+ void clear();
+
+ bool selectItem(ItemDom item);
+ bool doFollowEditor();
+
+ inline TextPaintStyleStore& paintStyles() {
+ return m_paintStyles;
+ }
+
+private slots:
+ void slotNewClass();
+ void slotAddMethod();
+ void slotAddAttribute();
+ void slotOpenDeclaration();
+ void slotOpenImplementation();
+ void slotCreateAccessMethods();
+ void slotFollowEditor();
+
+protected:
+ void contentsContextMenuEvent( QContextMenuEvent* );
+ void maybeTip( QPoint const & );
+
+private slots:
+ void slotProjectOpened();
+ void slotProjectClosed();
+ void refresh();
+ void insertFile( const QString& fileName );
+ void removeFile( const QString& fileName );
+ void slotExecuted( QListViewItem* item );
+
+private:
+ ClassViewPart* m_part;
+ QStringList removedText;
+ QString m_projectDirectory;
+ int m_projectDirectoryLength;
+ FolderBrowserItem* m_projectItem;
+ KSelectAction* m_actionViewMode;
+ KAction* m_actionNewClass;
+ KAction* m_actionAddMethod;
+ KAction* m_actionAddAttribute;
+ KAction* m_actionOpenDeclaration;
+ KAction* m_actionOpenImplementation;
+ KAction* m_actionCreateAccessMethods;
+ KToggleAction * m_actionFollowEditor;
+ bool m_doFollowEditor;
+ friend class ClassViewItem;
+ friend class FolderBrowserItem;
+ friend class NamespaceDomBrowserItem;
+ friend class ClassDomBrowserItem;
+ friend class TypeAliasDomBrowserItem;
+ friend class FunctionDomBrowserItem;
+ friend class VariableDomBrowserItem;
+ TextPaintStyleStore m_paintStyles;
+};
+
+class ClassViewItem: public FancyListViewItem
+{
+ private:
+public:
+ ClassViewItem( QListView* parent, const QString& text=QString::null )
+ : FancyListViewItem( static_cast<ClassViewWidget*>( parent )->m_paintStyles, parent, text ) {}
+ ClassViewItem( QListViewItem* parent, const QString& text=QString::null )
+ : FancyListViewItem( static_cast<ClassViewWidget*>( parent->listView() )->m_paintStyles, parent, text ) {}
+
+ virtual const CodeModelItem* model() const { return 0; }
+
+ virtual bool isFolder() const { return false; }
+ virtual bool isFile() const { return false; }
+ virtual bool isNamespace() const { return false; }
+ virtual bool isClass() const { return false; }
+ virtual bool isFunction() const { return false; }
+ virtual bool isVariable() const { return false; }
+ virtual bool isTypeAlias() const { return false; }
+
+ virtual bool hasDeclaration() const { return false; }
+ virtual bool hasImplementation() const { return false; }
+
+ virtual void openDeclaration() {}
+ virtual void openImplementation() {}
+
+ void select();
+
+ virtual QString comment();
+
+ ClassViewWidget* listView() { return static_cast<ClassViewWidget*>( QListViewItem::listView() ); }
+ const ClassViewWidget* listView() const { return static_cast<ClassViewWidget*>( QListViewItem::listView() ); }
+};
+
+class FolderBrowserItem: public ClassViewItem
+{
+public:
+ FolderBrowserItem( ClassViewWidget* widget, QListView* parent, const QString& name=QString::null )
+ : ClassViewItem( parent, name ), m_widget(widget) {}
+ FolderBrowserItem( ClassViewWidget* widget, QListViewItem* parent, const QString& name=QString::null )
+ : ClassViewItem( parent, name ), m_widget(widget) {}
+
+ virtual bool isFolder() const { return true; }
+
+ void setup();
+ QString key( int, bool ) const;
+
+ void processFile( FileDom file, QStringList& path, bool remove=false );
+ void processNamespace( NamespaceDom ns, bool remove=false );
+ void processClass( ClassDom klass, bool remove=false );
+ void processTypeAlias( TypeAliasDom typeAlias, bool remove=false );
+ void processFunction( FunctionDom fun, bool remove=false );
+ void processVariable( VariableDom var, bool remove=false );
+ bool selectItem(ItemDom item);
+
+private:
+ QMap<QString, FolderBrowserItem*> m_folders;
+ QMap<QString, NamespaceDomBrowserItem*> m_namespaces;
+ QMap<ClassDom, ClassDomBrowserItem*> m_classes;
+ QMap<TypeAliasDom, TypeAliasDomBrowserItem*> m_typeAliases;
+ QMap<FunctionDom, FunctionDomBrowserItem*> m_functions;
+ QMap<VariableDom, VariableDomBrowserItem*> m_variables;
+
+ ClassViewWidget* m_widget;
+};
+
+class NamespaceDomBrowserItem: public ClassViewItem
+{
+public:
+ NamespaceDomBrowserItem( QListView* parent, NamespaceDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+ NamespaceDomBrowserItem( QListViewItem* parent, NamespaceDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+
+ const CodeModelItem* model() const { return m_dom; }
+
+ virtual bool isNamespace() const { return true; }
+
+ void setup();
+ QString key( int, bool ) const;
+
+ void processNamespace( NamespaceDom ns, bool remove=false );
+ void processClass( ClassDom klass, bool remove=false );
+ void processTypeAlias( TypeAliasDom typeAlias, bool remove=false );
+ void processFunction( FunctionDom fun, bool remove=false );
+ void processVariable( VariableDom var, bool remove=false );
+ bool selectItem( ItemDom item );
+ virtual QString comment();
+
+ NamespaceDom dom() { return m_dom; }
+
+private:
+ NamespaceDom m_dom;
+ QMap<QString, NamespaceDomBrowserItem*> m_namespaces;
+ QMap<ClassDom, ClassDomBrowserItem*> m_classes;
+ QMap<TypeAliasDom, TypeAliasDomBrowserItem*> m_typeAliases;
+ QMap<FunctionDom, FunctionDomBrowserItem*> m_functions;
+ QMap<VariableDom, VariableDomBrowserItem*> m_variables;
+};
+
+class ClassDomBrowserItem: public ClassViewItem
+{
+public:
+ ClassDomBrowserItem( QListView* parent, ClassDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+ ClassDomBrowserItem( QListViewItem* parent, ClassDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+
+ const CodeModelItem* model() const { return m_dom; }
+ virtual bool isClass() const { return true; }
+
+ virtual bool hasDeclaration() const { return true; }
+ virtual void openDeclaration();
+
+ void setup();
+ QString key( int, bool ) const;
+
+ void processClass( ClassDom klass, bool remove=false );
+ void processTypeAlias( TypeAliasDom typeAlias, bool remove=false );
+ void processFunction( FunctionDom fun, bool remove=false );
+ void processVariable( VariableDom var, bool remove=false );
+
+ virtual QString comment() {
+ if( !m_dom ) return "";
+ return m_dom->comment();
+ }
+
+ bool selectItem(ItemDom item);
+ ClassDom dom() { return m_dom; }
+
+private:
+ ClassDom m_dom;
+ QMap<ClassDom, ClassDomBrowserItem*> m_classes;
+ QMap<TypeAliasDom, TypeAliasDomBrowserItem*> m_typeAliases;
+ QMap<FunctionDom, FunctionDomBrowserItem*> m_functions;
+ QMap<VariableDom, VariableDomBrowserItem*> m_variables;
+};
+
+class TypeAliasDomBrowserItem: public ClassViewItem
+{
+public:
+ TypeAliasDomBrowserItem( QListView* parent, TypeAliasDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+ TypeAliasDomBrowserItem( QListViewItem* parent, TypeAliasDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+
+ const CodeModelItem* model() const { return m_dom; }
+ virtual bool isTypeAlias() const { return true; }
+
+ virtual bool hasDeclaration() const { return true; }
+ virtual void openDeclaration();
+
+ virtual QString comment() {
+ if( !m_dom ) return "";
+ return m_dom->comment();
+ }
+
+ void setup();
+ QString key( int, bool ) const;
+
+ TypeAliasDom dom() { return m_dom; }
+
+private:
+ TypeAliasDom m_dom;
+};
+
+class FunctionDomBrowserItem: public ClassViewItem
+{
+public:
+ FunctionDomBrowserItem( QListView* parent, FunctionDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+ FunctionDomBrowserItem( QListViewItem* parent, FunctionDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+
+ const CodeModelItem* model() const { return m_dom; }
+ virtual bool isFunction() const { return true; }
+
+ virtual bool hasDeclaration() const { return true; }
+ virtual bool hasImplementation() const;
+
+ virtual void openDeclaration();
+ virtual void openImplementation();
+
+ virtual QString comment() {
+ if( !m_dom ) return "";
+ return m_dom->comment();
+ }
+
+ void setup();
+ QString key( int, bool ) const;
+
+ FunctionDom dom() { return m_dom; }
+
+private:
+ FunctionDom m_dom;
+};
+
+class VariableDomBrowserItem: public ClassViewItem
+{
+public:
+ VariableDomBrowserItem( QListView* parent, VariableDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+ VariableDomBrowserItem( QListViewItem* parent, VariableDom dom )
+ : ClassViewItem( parent, dom->name() ), m_dom( dom ) {}
+
+ const CodeModelItem* model() const { return m_dom; }
+ virtual bool isVariable() const { return true; }
+
+ virtual bool hasDeclaration() const { return true; }
+ virtual bool hasImplementation() const { return false; }
+
+ virtual QString comment() {
+ if( !m_dom ) return "";
+ return m_dom->comment();
+ }
+
+ virtual void openDeclaration();
+ virtual void openImplementation();
+
+ void setup();
+ QString key( int, bool ) const;
+
+ VariableDom dom() { return m_dom; }
+
+private:
+ VariableDom m_dom;
+};
+
+struct FindOp2 ///a template would look nicer
+{
+ FindOp2( const FunctionDefinitionDom& dom ): m_dom( dom ) {}
+
+ bool operator() ( const FunctionDom& def ) const
+ {
+ if( m_dom->name() != def->name() )
+ return false;
+
+ if( m_dom->isConstant() != m_dom->isConstant() )
+ return false;
+
+ QString scope1 = QString("::") + m_dom->scope().join("::");
+ QString scope2 = QString("::") + def->scope().join("::");
+ if( !scope1.endsWith(scope2) )
+ return false;
+
+ const ArgumentList args = m_dom->argumentList();
+ const ArgumentList args2 = def->argumentList();
+ if( args.size() != args2.size() )
+ return false;
+
+ for( uint i=0; i<args.size(); ++i ){
+ if( args[i]->type() != args[i]->type() )
+ return false;
+ }
+
+ return true;
+ }
+
+ private:
+ const FunctionDefinitionDom& m_dom;
+};
+
+struct FindOp
+{
+ FindOp( const FunctionDom& dom ): m_dom( dom ) {}
+
+ bool operator() ( const FunctionDefinitionDom& def ) const
+ {
+ if( m_dom->name() != def->name() )
+ return false;
+
+ if( m_dom->isConstant() != m_dom->isConstant() )
+ return false;
+
+ QString scope1 = QString("::") + m_dom->scope().join("::");
+ QString scope2 = QString("::") + def->scope().join("::");
+ if( !scope1.endsWith(scope2) )
+ return false;
+
+ const ArgumentList args = m_dom->argumentList();
+ const ArgumentList args2 = def->argumentList();
+ if( args.size() != args2.size() )
+ return false;
+
+ for( uint i=0; i<args.size(); ++i ){
+ if( args[i]->type() != args2[i]->type() )
+ return false;
+ }
+
+ return true;
+ }
+
+private:
+ const FunctionDom& m_dom;
+};
+
+#endif
diff --git a/parts/classview/digraphview.cpp b/parts/classview/digraphview.cpp
new file mode 100644
index 00000000..b566757f
--- /dev/null
+++ b/parts/classview/digraphview.cpp
@@ -0,0 +1,414 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "digraphview.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <qapplication.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qtextstream.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <kglobalsettings.h>
+#include <ktempfile.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+
+struct DigraphNode
+{
+ int x;
+ int y;
+ int w;
+ int h;
+ QString name;
+};
+
+
+struct DigraphEdge
+{
+ QPointArray points;
+};
+
+
+DigraphView::DigraphView(QWidget *parent, const char *name)
+ : QScrollView(parent, name, WRepaintNoErase|WStaticContents|WResizeNoErase)
+{
+ viewport()->setBackgroundMode(PaletteBase);
+
+ QPaintDeviceMetrics m(this);
+ xscale = m.logicalDpiX();
+ yscale = m.logicalDpiY();
+
+ width = -1;
+ height = -1;
+
+ nodes.setAutoDelete(true);
+ edges.setAutoDelete(true);
+ selNode = 0;
+}
+
+
+DigraphView::~DigraphView()
+{
+}
+
+
+int DigraphView::toXPixel(double x)
+{
+ return (int) (x*xscale);
+}
+
+
+int DigraphView::toYPixel(double y)
+{
+ return height - (int) (y*yscale);
+}
+
+
+void DigraphView::setRenderedExtent(double w, double h)
+{
+ width = (int) (w*xscale);
+ height = (int) (h*yscale);
+ resizeContents(width+1, height+1);
+}
+
+
+void DigraphView::addRenderedNode(const QString &name,
+ double x, double y, double w, double h)
+{
+ DigraphNode *node = new DigraphNode;
+ node->x = toXPixel(x);
+ node->y = toYPixel(y);
+ node->w = (int) (w*xscale);
+ node->h = (int) (h*yscale);
+ node->name = name;
+ nodes.append(node);
+}
+
+
+void DigraphView::addRenderedEdge(const QString &/*name1*/, const QString &/*name2*/,
+ QMemArray<double> coords)
+{
+ if (coords.count() < 4)
+ return;
+
+ DigraphEdge *edge = new DigraphEdge;
+ edge->points.resize(coords.count()/2);
+
+ for (uint i = 0; i < edge->points.count(); ++i)
+ edge->points[i] = QPoint(toXPixel(coords[2*i]), toYPixel(coords[2*i+1]));
+
+ edges.append(edge);
+}
+
+
+void DigraphView::addEdge(const QString &name1, const QString &name2)
+{
+ QString line;
+ line = "\"";
+ line += name1;
+ line += "\" -> \"";
+ line += name2;
+ line += "\";";
+ inputs.append(line);
+}
+
+
+void DigraphView::clear()
+{
+ nodes.clear();
+ edges.clear();
+ selNode = 0;
+ width = -1;
+ height = -1;
+ inputs.clear();
+ viewport()->update();
+}
+
+
+void DigraphView::setSelected(const QString &name)
+{
+ QPtrListIterator<DigraphNode> it(nodes);
+ for (; it.current(); ++it) {
+ if (it.current()->name == name) {
+ updateContents(selNode->x-selNode->w/2, selNode->y-selNode->h/2,
+ selNode->w, selNode->h);
+ selNode = it.current();
+ updateContents(selNode->x-selNode->w/2, selNode->y-selNode->h/2,
+ selNode->w, selNode->h);
+ return;
+ }
+ }
+}
+
+
+void DigraphView::ensureVisible(const QString &name)
+{
+ QPtrListIterator<DigraphNode> it(nodes);
+ for (; it.current(); ++it) {
+ if (it.current()->name == name) {
+ QScrollView::ensureVisible((*it)->x, (*it)->y, (*it)->w, (*it)->h);
+ return;
+ }
+ }
+}
+
+
+QStringList DigraphView::splitLine(QString str)
+{
+ QStringList result;
+
+ while (!str.isEmpty()) {
+ if (str[0] == '"') {
+ int pos = str.find('"', 1);
+ if (pos == -1)
+ pos = str.length();
+ result << str.mid(1, pos-1);
+ str.remove(0, pos+1);
+ } else {
+ int pos = str.find(' ');
+ if (pos == -1)
+ pos = str.length();
+ result << str.left(pos);
+ str.remove(0, pos+1);
+ }
+ uint i = 0; while (i<str.length() && str[i] == ' ') ++i;
+ str.remove(0, i);
+ }
+
+ return result;
+}
+
+
+void DigraphView::parseDotResults(const QStringList &list)
+{
+ QStringList::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ QStringList tokens = splitLine(*it);
+ if (tokens.count() == 0)
+ continue;
+ if (tokens[0] == "graph") {
+ if (tokens.count() < 4)
+ continue;
+ setRenderedExtent(tokens[2].toDouble(), tokens[3].toDouble());
+ } else if (tokens[0] == "node") {
+ if (tokens.count() < 6)
+ continue;
+ addRenderedNode(tokens[1], tokens[2].toDouble(), tokens[3].toDouble(),
+ tokens[4].toDouble(), tokens[5].toDouble());
+ } else if (tokens[0] == "edge") {
+ if (tokens.count() < 8)
+ continue;
+ QMemArray<double> coords(tokens.count()-6);
+ for (uint i=0; i != tokens.count()-6; ++i)
+ coords[i] = tokens[i+4].toDouble();
+ addRenderedEdge(tokens[1], tokens[2], coords);
+ }
+ }
+}
+
+
+void DigraphView::process( const QString& file, const QString& ext )
+{
+ QString cmd = KGlobal::dirs()->findExe("dot");
+ if (cmd.isEmpty()) {
+ KMessageBox::sorry(0, i18n("You do not have 'dot' installed.\nIt can be downloaded from www.graphviz.org."));
+ return;
+ }
+
+ QStringList results;
+
+ KTempFile ifile, ofile;
+ QTextStream &is = *ifile.textStream();
+ is << "digraph G {" << endl;
+ is << "rankdir=LR;" << endl;
+ is << "node [shape=box,fontname=Helvetica,fontsize=12];" << endl;
+ QStringList::Iterator it;
+ for (it = inputs.begin(); it != inputs.end(); ++it)
+ is << (*it) << endl;
+ is << "}" << endl;
+ ifile.close();
+
+ KProcess proc;
+ if( !file.isEmpty() && !ext.isEmpty() )
+ {
+ proc << cmd << QString("-T")+ext << ifile.name() << "-o" << file;
+ kdDebug() << "Executing: " << cmd <<" "<<QString("-T")+ext <<" "<< ifile.name() << "-o"<<file << endl;
+ }else
+ {
+ proc << cmd << "-Tplain" << ifile.name() << "-o" << ofile.name();
+ }
+ proc.start(KProcess::Block);
+
+ if( !file.isEmpty() && !ext.isEmpty() )
+ {
+ return;
+ }
+
+ QTextStream &os = *ofile.textStream();
+ while (!os.atEnd())
+ results << os.readLine();
+ ofile.close();
+
+ parseDotResults(results);
+ inputs.clear();
+
+ if (nodes.first())
+ selNode = nodes.first();
+ viewport()->update();
+}
+
+void DigraphView::drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph)
+{
+ QRect clipRect(clipx, clipy, clipw, cliph);
+ p->eraseRect(clipRect);
+
+ p->setFont(KGlobalSettings::generalFont());
+ QPtrListIterator<DigraphNode> it1(nodes);
+ for (; it1.current(); ++it1) {
+ QRect r((*it1)->x-(*it1)->w/2, (*it1)->y-(*it1)->h/2, (*it1)->w, (*it1)->h);
+ if (r.intersects(clipRect)) {
+ if (it1.current() == selNode)
+ p->fillRect(r, QBrush(lightGray, SolidPattern));
+ else
+ p->drawRect(r);
+ p->drawText(r, AlignCenter, (*it1)->name);
+ }
+ }
+ p->setBrush(QBrush(black, SolidPattern));
+ QPtrListIterator<DigraphEdge> it2(edges);
+ for (; it2.current(); ++it2) {
+ int n = (*it2)->points.count();
+ for (int i=0; i+3 < n; i+=3)
+ {
+ QPointArray a(4);
+ QPointArray &b = (*it2)->points;
+ for (int j=0; j<4; ++j)
+ a.setPoint(j, b.point(i+j));
+ if (a.boundingRect().intersects(clipRect))
+ p->drawCubicBezier((*it2)->points, i);
+ }
+ QPoint p1 = (*it2)->points[n-2];
+ QPoint p2 = (*it2)->points[n-1];
+ QPoint d = p1-p2;
+ double l = sqrt(d.x()*d.x()+d.y()*d.y());
+ double d11 = (10.0)/l*d.x();
+ double d12 = (10.0)/l*d.y();
+ double d21 = -(3.0/l)*d.y();
+ double d22 = (3.0/l)*d.x();
+ QPointArray triangle(3);
+ triangle[0] = p2 + QPoint((int)(d11+d21),(int)(d12+d22));
+ triangle[1] = p2 + QPoint((int)(d11-d21),(int)(d12-d22));
+ triangle[2] = p2;
+ p->drawPolygon(triangle, true);
+ }
+}
+
+
+void DigraphView::contentsMousePressEvent(QMouseEvent *e)
+{
+ QPtrListIterator<DigraphNode> it1(nodes);
+ for (; it1.current(); ++it1) {
+ QRect r((*it1)->x-(*it1)->w/2, (*it1)->y-(*it1)->h/2, (*it1)->w, (*it1)->h);
+ if (r.contains(e->pos())) {
+ if (selNode) {
+ QRect oldr(selNode->x-selNode->w/2, selNode->y-selNode->h/2,
+ selNode->w, selNode->h);
+ updateContents(oldr);
+ }
+ selNode = it1.current();
+ emit selected(selNode->name);
+ updateContents(r);
+ }
+
+ }
+}
+
+
+QSize DigraphView::sizeHint() const
+{
+ if (width == -1)
+ return QSize(100, 100); // arbitrary
+
+ QSize dsize = KGlobalSettings::desktopGeometry(viewport()).size();
+ kdDebug(9003) << "sizehint for inheritance diagram" << dsize << " " << width << " " << height << endl;
+ return QSize(width, height).boundedTo(QSize(dsize.width()*2/3, dsize.height()*2/3));
+}
+
+
+#if 0
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ DigraphView *dw = new DigraphView(0, "dot widget");
+dw->addEdge( "5th Edition", "6th Edition");
+dw->addEdge( "5th Edition", "PWB 1.0");
+dw->addEdge( "6th Edition", "LSX");
+dw->addEdge( "6th Edition", "1 BSD");
+dw->addEdge( "6th Edition", "Mini Unix");
+dw->addEdge( "6th Edition", "Wollongong");
+dw->addEdge( "6th Edition", "Interdata");
+dw->addEdge( "Interdata", "Unix/TS 3.0");
+dw->addEdge( "Interdata", "PWB 2.0");
+dw->addEdge( "Interdata", "7th Edition");
+dw->addEdge( "7th Edition", "8th Edition");
+dw->addEdge( "7th Edition", "32V");
+dw->addEdge( "7th Edition", "V7M");
+dw->addEdge( "7th Edition", "Ultrix-11");
+dw->addEdge( "7th Edition", "Xenix");
+dw->addEdge( "7th Edition", "UniPlus+");
+dw->addEdge( "V7M", "Ultrix-11");
+dw->addEdge( "8th Edition", "9th Edition");
+dw->addEdge( "1 BSD", "2 BSD");
+dw->addEdge( "2 BSD", "2.8 BSD");
+dw->addEdge( "2.8 BSD", "Ultrix-11");
+dw->addEdge( "2.8 BSD", "2.9 BSD");
+dw->addEdge( "32V", "3 BSD");
+dw->addEdge( "3 BSD", "4 BSD");
+dw->addEdge( "4 BSD", "4.1 BSD");
+dw->addEdge( "4.1 BSD", "4.2 BSD");
+dw->addEdge( "4.1 BSD", "2.8 BSD");
+dw->addEdge( "4.1 BSD", "8th Edition");
+dw->addEdge( "4.2 BSD", "4.3 BSD");
+dw->addEdge( "4.2 BSD", "Ultrix-32");
+dw->addEdge( "PWB 1.0", "PWB 1.2");
+dw->addEdge( "PWB 1.0", "USG 1.0");
+dw->addEdge( "PWB 1.2", "PWB 2.0");
+dw->addEdge( "USG 1.0", "CB Unix 1");
+dw->addEdge( "USG 1.0", "USG 2.0");
+dw->addEdge( "CB Unix 1", "CB Unix 2");
+dw->addEdge( "CB Unix 2", "CB Unix 3");
+dw->addEdge( "CB Unix 3", "Unix/TS++");
+dw->addEdge( "CB Unix 3", "PDP-11 Sys V");
+dw->addEdge( "USG 2.0", "USG 3.0");
+dw->addEdge( "USG 3.0", "Unix/TS 3.0");
+dw->addEdge( "PWB 2.0", "Unix/TS 3.0");
+dw->addEdge( "Unix/TS 1.0", "Unix/TS 3.0");
+dw->addEdge( "Unix/TS 3.0", "TS 4.0");
+dw->addEdge( "Unix/TS++", "TS 4.0");
+dw->addEdge( "CB Unix 3", "TS 4.0");
+dw->addEdge( "TS 4.0", "System V.0");
+dw->addEdge( "System V.0", "System V.2");
+dw->addEdge( "System V.2", "System V.3");
+ dw->process();
+ dw->show();
+
+ return app.exec();
+}
+#endif
+
+#include "digraphview.moc"
diff --git a/parts/classview/digraphview.h b/parts/classview/digraphview.h
new file mode 100644
index 00000000..c5fb2a28
--- /dev/null
+++ b/parts/classview/digraphview.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DIGRAPHVIEW_H_
+#define _DIGRAPHVIEW_H_
+
+#include <qptrlist.h>
+#include <qscrollview.h>
+#include <qstringlist.h>
+#include <qimage.h>
+
+class DigraphNode;
+class DigraphEdge;
+
+
+class DigraphView : public QScrollView
+{
+ Q_OBJECT
+
+public:
+ DigraphView(QWidget *parent, const char *name);
+ ~DigraphView();
+
+ void addEdge(const QString &name1, const QString &name2);
+ void process(const QString& file = "", const QString& ext = "");
+ void clear();
+ void setSelected(const QString &name);
+ void ensureVisible(const QString &name);
+
+signals:
+ void selected(const QString &name);
+
+protected:
+ virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph);
+ virtual void contentsMousePressEvent(QMouseEvent *e);
+ virtual QSize sizeHint() const;
+
+private:
+ int toXPixel(double x);
+ int toYPixel(double x);
+
+ void setRenderedExtent(double w, double h);
+ void addRenderedNode(const QString &name,
+ double x, double y, double w, double h);
+ void addRenderedEdge(const QString &name1, const QString &name2,
+ QMemArray<double> coords);
+ static QStringList splitLine(QString str);
+ void parseDotResults(const QStringList &list);
+
+ double xscale, yscale;
+ int width, height;
+ QStringList inputs;
+ QPtrList<DigraphNode> nodes;
+ QPtrList<DigraphEdge> edges;
+ DigraphNode *selNode;
+};
+
+#endif
diff --git a/parts/classview/hierarchydlg.cpp b/parts/classview/hierarchydlg.cpp
new file mode 100644
index 00000000..21a54031
--- /dev/null
+++ b/parts/classview/hierarchydlg.cpp
@@ -0,0 +1,276 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "hierarchydlg.h"
+
+#include <kdialog.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
+#include <kfile.h>
+#include <kfiledialog.h>
+#include <kurlrequesterdlg.h>
+#include <kurlrequester.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+
+#include <qlayout.h>
+#include <qfileinfo.h>
+#include <qlistview.h>
+#include <qapplication.h>
+#include <qsplitter.h>
+
+#include "kdevlanguagesupport.h"
+#include "kcomboview.h"
+
+#include "classviewpart.h"
+//#include "classtoolwidget.h"
+#include "digraphview.h"
+#include "viewcombos.h"
+
+
+HierarchyDialog::HierarchyDialog( ClassViewPart *part )
+ : QDialog(0, "hierarchy dialog", false)
+{
+ class_combo = new KComboView(true, 150, this);
+ class_combo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
+// class_combo->setMinimumWidth(150);
+ namespace_combo = new KComboView(true, 150, this);
+ namespace_combo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
+// namespace_combo->setMinimumWidth(150);
+
+ QPushButton *close_button = new KPushButton(KStdGuiItem::close(), this);
+ QPushButton *save_button = new KPushButton(KStdGuiItem::save(), this);
+ QPushButton *refresh_button = new KPushButton(i18n("Refresh"), this);
+
+ QSplitter *splitter = new QSplitter(Vertical, this);
+ digraph = new DigraphView(splitter, "digraph view");
+// member_tree = new ClassToolWidget(part, splitter);
+
+ QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+ QBoxLayout *combo_layout = new QHBoxLayout();
+ layout->addLayout(combo_layout);
+ combo_layout->addWidget(namespace_combo);
+ combo_layout->addWidget(class_combo);
+ combo_layout->addSpacing(60);
+ combo_layout->addWidget(refresh_button);
+ combo_layout->addWidget(save_button);
+ combo_layout->addWidget(close_button);
+ layout->addWidget(splitter);
+
+ connect( namespace_combo, SIGNAL(activated(QListViewItem*)),
+ this, SLOT(slotNamespaceComboChoice(QListViewItem*)) );
+ connect( class_combo, SIGNAL(activated(QListViewItem*)),
+ this, SLOT(slotClassComboChoice(QListViewItem*)) );
+ connect( namespace_combo, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotNamespaceComboChoice(const QString&)) );
+ connect( class_combo, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotClassComboChoice(const QString&)) );
+ connect( close_button, SIGNAL(clicked()),
+ this, SLOT(hide()) );
+ connect( save_button, SIGNAL(clicked()),
+ this, SLOT(save()) );
+ connect( refresh_button, SIGNAL(clicked()),
+ this, SLOT(refresh()) );
+ connect( digraph, SIGNAL(selected(const QString&)),
+ this, SLOT(classSelected(const QString&)) );
+
+ m_part = part;
+// m_part->registerHierarchyDialog(this);
+ refresh();
+}
+
+
+HierarchyDialog::~HierarchyDialog()
+{
+// m_part->unregisterHierarchyDialog(this);
+}
+
+void HierarchyDialog::save()
+{
+ KURLRequesterDlg dlg(QString::null, this, "save_inheritance");
+ dlg.fileDialog()->setFilter("image/png image/jpeg image/bmp image/svg+xml");
+ dlg.fileDialog()->setOperationMode( KFileDialog::Saving );
+ dlg.fileDialog()->setMode( KFile::File | KFile::LocalOnly );
+ dlg.urlRequester()->setMode( KFile::File | KFile::LocalOnly );
+ if(dlg.exec() && dlg.selectedURL().isLocalFile())
+ {
+ QFileInfo fi(dlg.selectedURL().pathOrURL());
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ KDevLanguageSupport *ls = m_part->languageSupport();
+ for (QMap<QString, ClassDom>::const_iterator it = classes.begin(); it != classes.end(); ++it)
+ {
+ kdDebug(9003) << "Adding class to graph: " << it.key() << endl;
+ QString formattedName = ls->formatClassName(it.key());
+ QStringList baseClasses = it.data()->baseClassList();
+ for (QStringList::const_iterator bit = baseClasses.begin(); bit != baseClasses.end(); ++bit)
+ {
+ QMap<QString, QString>::const_iterator baseIt = uclasses.find(*bit);
+ if (baseIt != uclasses.end())
+ {
+ QString formattedParentName = ls->formatClassName(baseIt.data());
+ digraph->addEdge(formattedParentName, formattedName);
+ }
+ }
+ }
+ digraph->process(fi.absFilePath(), fi.extension());
+ QApplication::restoreOverrideCursor();
+ }
+}
+
+void HierarchyDialog::refresh()
+{
+ digraph->clear();
+ classes.clear();
+ uclasses.clear();
+ ViewCombosOp::refreshNamespaces(m_part, namespace_combo);
+ processNamespace("", m_part->codeModel()->globalNamespace());
+
+ KDevLanguageSupport *ls = m_part->languageSupport();
+
+ for (QMap<QString, ClassDom>::const_iterator it = classes.begin(); it != classes.end(); ++it)
+ {
+ kdDebug(9003) << "Adding class to graph: " << it.key() << endl;
+ QString formattedName = ls->formatClassName(it.key());
+ QStringList baseClasses = it.data()->baseClassList();
+ for (QStringList::const_iterator bit = baseClasses.begin(); bit != baseClasses.end(); ++bit)
+ {
+ QMap<QString, QString>::const_iterator baseIt = uclasses.find(*bit);
+ if (baseIt != uclasses.end())
+ {
+ QString formattedParentName = ls->formatClassName(baseIt.data());
+ digraph->addEdge(formattedParentName, formattedName);
+ }
+ }
+ }
+ digraph->process();
+}
+
+void HierarchyDialog::setLanguageSupport(KDevLanguageSupport *ls)
+{
+ if (ls)
+ connect(ls, SIGNAL(updatedSourceInfo()), this, SLOT(refresh()));
+ else
+ refresh();
+}
+
+
+void HierarchyDialog::slotClassComboChoice(QListViewItem * item)
+{
+ ClassItem *ci = dynamic_cast<ClassItem*>(item);
+ if (!ci)
+ return;
+
+ KDevLanguageSupport *ls = m_part->languageSupport();
+
+ QString className = ls->formatClassName(uclasses[item->text(0)]);
+ digraph->setSelected(className);
+ digraph->ensureVisible(className);
+ classSelected(className);
+}
+
+void HierarchyDialog::slotClassComboChoice( const QString& itemText )
+{
+ QListViewItem* item = class_combo->listView()->firstChild();
+ while( item )
+ {
+ if( item->text(0) == itemText )
+ {
+ ClassItem *ci = dynamic_cast<ClassItem*>(item);
+ if (!ci)
+ return;
+
+ KDevLanguageSupport *ls = m_part->languageSupport();
+
+ QString className = ls->formatClassName(uclasses[item->text(0)]);
+ digraph->setSelected(className);
+ digraph->ensureVisible(className);
+ classSelected(className);
+ return;
+ }
+ item = item->nextSibling();
+ }
+}
+
+void HierarchyDialog::classSelected(const QString &/*className*/)
+{
+/* ParsedClass *currentClass = m_part->classStore()->getClassByName(className);
+ member_tree->clear();
+ if (currentClass) {
+ KDevLanguageSupport::Features features = m_part->languageSupport()->features();
+ if (features & KDevLanguageSupport::Functions)
+ member_tree->insertAllClassMethods(currentClass, (PIAccess)-1);
+ if (features & KDevLanguageSupport::Variables)
+ member_tree->insertAllClassAttributes(currentClass, (PIAccess)-1);
+ }*/
+}
+
+void HierarchyDialog::slotNamespaceComboChoice( QListViewItem * item )
+{
+ NamespaceItem *ni = dynamic_cast<NamespaceItem*>(item);
+ if (!ni)
+ return;
+ ViewCombosOp::refreshClasses(m_part, class_combo, ni->dom()->name());
+}
+
+void HierarchyDialog::slotNamespaceComboChoice( const QString& itemText )
+{
+ QListViewItem* item = namespace_combo->listView()->firstChild();
+ while( item )
+ {
+ if( item->text(0) == itemText )
+ {
+ NamespaceItem *ni = dynamic_cast<NamespaceItem*>(item);
+ if (!ni)
+ return;
+ ViewCombosOp::refreshClasses(m_part, class_combo, ni->dom()->name());
+ return;
+ }
+ item = item->nextSibling();
+ }
+}
+
+void HierarchyDialog::processNamespace( QString prefix, NamespaceDom dom )
+{
+ qWarning("processNamespace: prefix %s", prefix.latin1());
+ QString prefixInc = prefix.isEmpty() ? "" : ".";
+// QString nsprefix = dom->name().isEmpty() ? QString("") : prefixInc + dom->name();
+
+ NamespaceList namespaceList = dom->namespaceList();
+ for (NamespaceList::const_iterator it = namespaceList.begin(); it != namespaceList.end(); ++it)
+ {
+ qWarning("about to processNamespace: prefix %s", (prefixInc + (*it)->name()).latin1());
+ processNamespace(prefixInc + (*it)->name(), *it);
+ }
+
+ ClassList classList = dom->classList();
+ for (ClassList::const_iterator it = classList.begin(); it != classList.end(); ++it)
+ {
+ processClass(prefix, *it);
+ }
+}
+
+void HierarchyDialog::processClass( QString prefix, ClassDom dom )
+{
+ qWarning("processClass: prefix %s class %s", prefix.latin1(), dom->name().latin1());
+
+ QString prefixInc = prefix.isEmpty() ? "" : ".";
+ classes[prefix + prefixInc + dom->name()] = dom;
+ uclasses[dom->name()] = prefix + prefixInc + dom->name();
+
+ ClassList classList = dom->classList();
+ for (ClassList::const_iterator it = classList.begin(); it != classList.end(); ++it)
+ {
+ processClass(prefix + prefixInc + dom->name(), *it);
+ }
+}
+
+#include "hierarchydlg.moc"
diff --git a/parts/classview/hierarchydlg.h b/parts/classview/hierarchydlg.h
new file mode 100644
index 00000000..82cf2d4a
--- /dev/null
+++ b/parts/classview/hierarchydlg.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _HIERARCHYDLG_H_
+#define _HIERARCHYDLG_H_
+
+#include <qdialog.h>
+
+#include "codemodel.h"
+
+class ClassViewPart;
+class KDevLanguageSupport;
+class DigraphView;
+class ClassToolWidget;
+class KComboView;
+class QListViewItem;
+
+class HierarchyDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ HierarchyDialog( ClassViewPart *part );
+ ~HierarchyDialog();
+public slots:
+ void refresh();
+
+private slots:
+ void setLanguageSupport(KDevLanguageSupport *ls);
+ void slotClassComboChoice(QListViewItem *item);
+ void slotNamespaceComboChoice(QListViewItem *item);
+ void slotClassComboChoice(const QString&);
+ void slotNamespaceComboChoice(const QString&);
+ void classSelected(const QString &className);
+ void save();
+
+private:
+ void processNamespace(QString prefix, NamespaceDom dom);
+ void processClass(QString prefix, ClassDom dom);
+
+ QMap<QString, ClassDom> classes;
+ //QMap<class name, fully qualified class name>
+ //like MyClass - MyNamespace.MyClass
+ QMap<QString, QString> uclasses;
+
+ KComboView *namespace_combo;
+ KComboView *class_combo;
+ DigraphView *digraph;
+// ClassToolWidget *member_tree;
+ ClassViewPart *m_part;
+};
+
+#endif
diff --git a/parts/classview/kdevclassview.desktop b/parts/classview/kdevclassview.desktop
new file mode 100644
index 00000000..08c0de1e
--- /dev/null
+++ b/parts/classview/kdevclassview.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin displays a graphical view of all the classes in the project, complete with methods and attributes, and provides a way of direct source navigation.
+Comment[ca]=Aquest connector mostra una vista gràfica de totes les classes del projecte, completant-lo amb mètodes i atributs, i proporciona una forma de navegar directament a través del codi font.
+Comment[da]=Dette plugin giver en grafisk visning af alle klasserne i projektet, fuldstændig med metoder og attributter og sørger for en måde at have direkte kildenavigation.
+Comment[de]=Dieses Modul zeigt eine grafische Ansicht aller Klassen im Projekt, einschließlich der Methoden und Attribute und ermöglicht die Navigation in den betreffenden Quelltexten.
+Comment[el]=Αυτό το πρόσθετο εμφανίζει μια γραφική προβολή όλων των κλάσεων του έργου, πλήρης με μεθόδους και χαρακτηριστικά, και προσφέρει μια μέθοδο απευθείας πλοήγησης στον κώδικα.
+Comment[es]=Este complemento muestra una vista gráfica de todas las clases del proyecto, completándolo con métodos y atributos, y proporciona una forma de navegar directamente por el código fuente.
+Comment[et]=See plugin näitab graafiliselt kõiki projekti klasse koos meetodite ja atribuutidega ning võimaldab nende vahel kiiresti liikuda.
+Comment[eu]=Plugin honek proiektuak dituen klase guztien ikuspegi grafiko bat bistaratzen du, metodo eta atributuekin osatuta, eta iturburuen arteko nabigazio zuzena eskeintzen du.
+Comment[fa]=این وصله یک نمای نگاره‌ای از همۀ رده‌ها در پروژه را نمایش می‌دهد، با روشها و ویژگیها کامل می‌کند و یک راه ناوش مستقیم منبع فراهم می‌کند.
+Comment[fr]=Ce module externe affiche une vue graphique de toutes les classes dans le projet, la complète avec des méthodes et des attributs, et offre un moyen de naviguer directement dans le source.
+Comment[gl]=Esta extensión mostra unha vista gráfica de tódalas clases do proxecto, cos métodos e os atributos, e proporciona unha maneira para navegar o código directamente.
+Comment[hu]=Bővítőmodul egy projekt osztályainak áttekintéséhez, a tagfüggvényekkel és az attribútumokkal együtt, navigálási lehetőséggel
+Comment[it]=Questo plugin offre una rappresentazione grafica di tutte le classi nel progetto, complete con metodi e attributi, e fornisce un modo per la navigazione diretta nei sorgenti.
+Comment[ja]=このプラグインは、プロジェクトの中のすべてのクラスを視覚的に表示します。また、メソッドや属性を補完し、直接的なソース操作を提供します。
+Comment[ms]=Plugin ini memaparkan paparan bergrafik bagi semua kelas dalam projek, lengkap dengan kaedah dan ciri, dan menyediakan kaedah kemudian sumber secara terus.
+Comment[nds]=Dit Moduul wiest en graafsch Ansicht vun all Klassen vun en Projekt, komplett mit Metoden un Attributen, un stellt dat Stüern binnen de Borntexten praat.
+Comment[ne]=यो प्लगइनले विधि र विशेषतासँग परियोजनामा सबै कक्षको ग्राफिकल दृश्य प्रर्दशन गर्दछ र प्रत्यक्ष स्रोत नेभिगेसनको उपाय प्रदान गर्दछ ।
+Comment[nl]=Deze plugin toont een grafische weergave van alle klassen in een project, compleet met methoden en attributen, en biedt directe navigatie hiertussen.
+Comment[pl]=Ta wtyczka pokazuje graficzny widok wszystkich klas w projekcie z metodami i atrybutami oraz umożliwia bezpośrednią nawigację w kodzie źródłowym..
+Comment[pt]=Este 'plugin' mostra uma vista gráfica de todas as classes no projecto, completas com os métodos e atributos, oferecendo uma forma de navegação directa sobre o código.
+Comment[pt_BR]=Este plug-in exibe uma visão gráfica de todas as classes no projeto, juntamente com métodos e atributos, e fornece uma maneira de navegar diretamente no código.
+Comment[ru]=Этот модуль показывает список классов в проекте, включая методы и атрибуты, а также предоставляет возможности навигации по коду.
+Comment[sk]=Modul zobrazí grafický pohľad na triedy v projekte, spolu s metódami a atribútmi, a umožní priamy prístup k zdrojovému kódu.
+Comment[sr]=Овај прикључак приказује графички изглед свих класа у пројекту, заједно са методама и атрибутима, и обезбеђује начин директне навигације кроз изворни кôд.
+Comment[sr@Latn]=Ovaj priključak prikazuje grafički izgled svih klasa u projektu, zajedno sa metodama i atributima, i obezbeđuje način direktne navigacije kroz izvorni kôd.
+Comment[sv]=Insticksprogrammet visar en grafisk bild av alla klasser i ett projekt, tillsammans med metoder och egenskaper, och ger möjlighet till direkt navigering i källkoden.
+Comment[ta]=இந்த சொருகி திட்டப்பணியில் உள்ள வகுப்புகளின், முறைகள் மற்றும் பண்புகளை உங்களுக்கு வரைகலை பார்வையில் அளிக்கும்,மற்றும் மூலத்தை வழி செலுத்த இது நேர்வழி அளிக்கும்.
+Comment[tg]=Ин модул рӯйхати синфҳоро дар лоиҳа намоиш медиҳад, ва боз методҳо ва атрибутҳо ва боз ҳам имкони кодро роҳ медиҳад.
+Comment[tr]=Bu eklenti projedeki sınıfların bütün yöntem ve öznitelikleri ile grafiksel bir görünümü gösterir ve doğrudan kaynak dolaşımını sağlar.
+Comment[zh_CN]=这个插件以图形显示工程中所有的类,包括完整的方法和属性,并提供浏览源文件的方法。
+Comment[zh_TW]=這個外掛程式顯示專案中所有類別、完整方法與屬性的圖形檢視,並提供源碼導覽。
+Name=KDevClassView
+Name[da]=KDevelop klassevisning
+Name[de]=Klassenansicht (KDevelop)
+Name[hi]=के-डेव-क्लॉस-व्यू
+Name[nds]=KlassKieker (KDevelop)
+Name[pl]=KDevWidokKlas
+Name[sk]=KDev pohľad na triedy
+Name[sv]=KDevelop klassvisning
+Name[tg]=Намоиши снфи KDev
+Name[zh_TW]=KDevelop 類別檢視
+GenericName=Class View
+GenericName[ca]=Visor de classes
+GenericName[da]=Klassevisning
+GenericName[de]=Klassenansicht
+GenericName[el]=Προβολή κλάσεων
+GenericName[es]=Visor de clases
+GenericName[et]=Klasside vaade
+GenericName[eu]=Klase ikuspegia
+GenericName[fa]=نمای رده
+GenericName[fr]=Vue des classes
+GenericName[gl]=Vista de clases
+GenericName[hi]=क्लॉस व्यू
+GenericName[hu]=Osztálynézegető
+GenericName[it]=Visualizza classe
+GenericName[ja]=クラスビュー
+GenericName[ms]=Paparan Kelas
+GenericName[nds]=Klasskieker
+GenericName[ne]=कक्ष दृश्य
+GenericName[nl]=Klassenweergave
+GenericName[pl]=Widok klas
+GenericName[pt]=Vista de Classe
+GenericName[pt_BR]=Visualizador de Classe
+GenericName[ru]=Просмотр классов
+GenericName[sk]=Pohľad na triedy
+GenericName[sl]=Prikaz razreda
+GenericName[sr]=Преглед класа
+GenericName[sr@Latn]=Pregled klasa
+GenericName[sv]=Klassvisning
+GenericName[ta]=வகுப்புக்காட்சி
+GenericName[tg]=Намоиши синфҳо
+GenericName[tr]=Sınıf Görünümü
+GenericName[zh_CN]=类查看器
+GenericName[zh_TW]=類別檢視
+ServiceTypes=KDevelop/CodeBrowserFrontend
+X-KDE-Library=libkdevclassview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=CodeNavigation
diff --git a/parts/classview/kdevclassview.rc b/parts/classview/kdevclassview.rc
new file mode 100644
index 00000000..b5f7a9fb
--- /dev/null
+++ b/parts/classview/kdevclassview.rc
@@ -0,0 +1,20 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevClassView" version="10">
+<MenuBar>
+ <Menu name="project" >
+ <Action name="inheritance_dia" group="project_classes" />
+ </Menu>
+</MenuBar>
+<Menu name="kdevhidden" >
+ <Action name="navigator_jump_to_next_function"/>
+ <Action name="navigator_jump_to_previous_function"/>
+</Menu>
+
+<ToolBar name="browserToolBar">
+ <text>Browser Toolbar</text>
+ <Separator/>
+ <Action name="classview_sync_with_editor" />
+ <Action name="functionsnav_combo" />
+</ToolBar>
+</kpartgui>
+
diff --git a/parts/classview/navigator.cpp b/parts/classview/navigator.cpp
new file mode 100644
index 00000000..f0e2ff19
--- /dev/null
+++ b/parts/classview/navigator.cpp
@@ -0,0 +1,539 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.net *
+ * Portions Copyright (C) 2002-2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "navigator.h"
+
+#include <qtimer.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+#include <kcomboview.h>
+#include <klistviewaction.h>
+#include <kdevpartcontroller.h>
+#include <kdevlanguagesupport.h>
+#include <kdevmainwindow.h>
+#include <codemodel_utils.h>
+#include "classviewpart.h"
+#include "classviewwidget.h"
+
+//using namespace Widgets;
+
+//#define BOLDFONTSMALLER
+
+
+namespace
+{
+ template<class T>
+ QValueList<T> QValueList_reversed ( const QValueList<T> & list )
+ {
+ QValueList<T> rList;
+ typename QValueList<T>::ConstIterator it = list.begin();
+ while ( it != list.end() )
+ {
+ rList.push_front ( *it );
+ ++it;
+ }
+ return rList;
+ }
+}
+
+struct NavOp
+{
+ NavOp(Navigator *navigator, const QString &fullName)
+ :m_navigator(navigator), m_fullName(fullName) {}
+
+ bool operator() ( const FunctionDefinitionDom& def ) const
+ {
+ return (m_navigator->fullFunctionDefinitionName(def) == m_fullName);
+ }
+ bool operator() ( const FunctionDom& def ) const
+ {
+ return (m_navigator->fullFunctionDeclarationName(def) == m_fullName);
+ }
+
+private:
+ Navigator *m_navigator;
+ QString m_fullName;
+};
+
+
+
+class FunctionNavItem: public FancyListViewItem {
+private:
+public:
+ enum Type { Declaration, Definition };
+
+ FunctionNavItem(TextPaintStyleStore& styles, ClassViewPart *part, QListView *parent, QString name, Type type)
+ :FancyListViewItem(styles, parent, name, ""), m_part(part), m_type(type) {}
+ FunctionNavItem(TextPaintStyleStore& styles, ClassViewPart *part, QListViewItem *parent, QString name, Type type)
+ :FancyListViewItem(styles, parent, name, ""), m_part(part), m_type(type) {}
+ ~FunctionNavItem() {}
+
+ virtual void setup()
+ {
+ FancyListViewItem::setup();
+ setPixmap( 0, UserIcon("CVpublic_meth", KIcon::DefaultState, m_part->instance()) );
+ }
+ Type type() { return m_type; }
+
+private:
+ ClassViewPart *m_part;
+ Type m_type;
+};
+
+
+Navigator::Navigator(ClassViewPart *parent, const char *name)
+ : QObject(parent, name), m_part(parent)
+{
+ m_state = GoToDefinitions;
+ m_navNoDefinition = true;
+
+ m_actionSyncWithEditor = new KAction( i18n("Sync ClassView"), "view_tree", KShortcut(), this,
+ SLOT(slotSyncWithEditor()), m_part->actionCollection(), "classview_sync_with_editor" );
+
+ KAction * action = new KAction( i18n("Jump to next function"), CTRL+ALT+Key_PageDown, this,
+ SLOT(slotJumpToNextFunction()), m_part->actionCollection(), "navigator_jump_to_next_function" );
+ action->plug( &m_dummyActionWidget );
+
+ action = new KAction( i18n("Jump to previous function"), CTRL+ALT+Key_PageUp, this,
+ SLOT(slotJumpToPreviousFunction()), m_part->actionCollection(), "navigator_jump_to_previous_function" );
+ action->plug( &m_dummyActionWidget );
+
+ m_syncTimer = new QTimer(this);
+ connect(m_syncTimer, SIGNAL(timeout()), this, SLOT(syncFunctionNav()));
+}
+
+Navigator::~Navigator()
+{
+}
+
+void Navigator::selectFunctionNav(QListViewItem *item)
+{
+ FunctionNavItem *nav = dynamic_cast<FunctionNavItem*>(item);
+ if (!nav)
+ return;
+
+ FileDom file = m_part->codeModel()->fileByName(m_part->m_activeFileName);
+ if (!file)
+ return;
+
+ switch (nav->type())
+ {
+ case FunctionNavItem::Definition: //jump to definition
+ {
+ FileList files = file->wholeGroup();
+ FunctionDefinitionList deflist;
+ CodeModelUtils::findFunctionDefinitions(NavOp(this, nav->text(0)), files, deflist);
+ if (deflist.count() < 1)
+ return;
+
+ FunctionDefinitionDom fun = deflist.first();
+ if (!fun)
+ return;
+ int startLine = 0, startColumn = 0;
+ fun->getStartPosition(&startLine, &startColumn);
+ m_part->partController()->editDocument(KURL(fun->fileName()), startLine);
+ break;
+ }
+ case FunctionNavItem::Declaration: //jump to declaration
+ {
+ FileList files = file->wholeGroup();
+ FunctionList declist;
+ CodeModelUtils::findFunctionDeclarations(NavOp(this, nav->text(0)), files, declist);
+ if (declist.count() < 1)
+ return;
+
+ FunctionDom fun = declist.first();
+ if (!fun)
+ return;
+ int startLine = 0, startColumn = 0;
+ fun->getStartPosition(&startLine, &startColumn);
+ m_part->partController()->editDocument(KURL(fun->fileName()), startLine);
+ break;
+ }
+ }
+}
+
+void Navigator::functionNavUnFocused()
+{
+ /*if (m_navNoDefinition)
+ m_part->m_functionsnav->view()->setCurrentText(NAV_NODEFINITION);
+ else*/
+ if (m_part->m_functionsnav->view()->currentItem())
+ m_part->m_functionsnav->view()->setCurrentText(m_part->m_functionsnav->view()->currentItem()->text(0));
+ else
+ m_part->m_functionsnav->view()->setCurrentText(NAV_NODEFINITION);
+}
+
+void Navigator::functionNavFocused()
+{
+ m_navNoDefinition = (m_part->m_functionsnav->view()->currentText() == NAV_NODEFINITION);
+ m_part->m_functionsnav->view()->setCurrentText("");
+}
+
+void Navigator::slotCursorPositionChanged()
+{
+ //FIXME: we assume that background parser delay is set globally in kdeveloprc file
+ //for all available language supports
+ //this is reasonable assumption because problem reporter should be the same for all languages
+ KConfig* config = kapp->config();
+ config->setGroup( "General Options" );
+ int m_delay = config->readNumEntry( "BgParserDelay", 500 );
+
+ m_syncTimer->changeInterval(500 >= m_delay+100 ? 500 : m_delay+100 );
+}
+
+void Navigator::stopTimer( )
+{
+ m_syncTimer->stop();
+}
+
+void Navigator::syncFunctionNavDelayed(int delay)
+{
+ m_syncTimer->changeInterval(delay);
+}
+
+void Navigator::syncFunctionNav()
+{
+ m_syncTimer->stop();
+
+ if (FunctionDom fun = currentFunction())
+ {
+ if ( m_part->widget()->doFollowEditor() )
+ {
+ ItemDom dom(fun);
+ m_part->jumpedToItem( dom );
+ }
+
+ if( !fun->isFunctionDefinition() ) {
+ if (m_functionNavDecls[fullFunctionDeclarationName(fun)])
+ {
+ m_part->m_functionsnav->view()->blockSignals(true);
+ m_part->m_functionsnav->view()->setCurrentActiveItem(m_functionNavDecls[fullFunctionDeclarationName(fun)]);
+ m_part->m_functionsnav->view()->blockSignals(false);
+ }
+ } else {
+ if (m_functionNavDefs[fullFunctionDeclarationName(fun)])
+ {
+ m_part->m_functionsnav->view()->blockSignals(true);
+ m_part->m_functionsnav->view()->setCurrentActiveItem(m_functionNavDefs[fullFunctionDeclarationName(fun)]);
+ m_part->m_functionsnav->view()->blockSignals(false);
+ }
+ }
+ }
+ else
+ m_part->m_functionsnav->view()->setCurrentText(NAV_NODEFINITION);
+}
+
+void Navigator::refreshNavBars(const QString &activeFileName, bool clear)
+{
+ kdDebug(9003) << k_funcinfo << endl;
+ if (clear)
+ {
+ m_part->m_functionsnav->view()->clear();
+ m_functionNavDefs.clear();
+ m_functionNavDecls.clear();
+ }
+
+ FileDom file = m_part->codeModel()->fileByName(activeFileName);
+ if (!file)
+ return;
+
+ QStringList toLeave;
+
+ FunctionList list1 = CodeModelUtils::allFunctionsExhaustive(file);
+ FunctionList::const_iterator flEnd = list1.end();
+ for (FunctionList::const_iterator it = list1.begin(); it != flEnd; ++it)
+ {
+ QString fullName = fullFunctionDeclarationName(*it);
+
+ if (clear || !m_functionNavDecls[fullName] && m_part->m_functionsnav->view()->listView())
+ {
+ FunctionNavItem *item = new FunctionNavItem(m_styles, m_part,
+ m_part->m_functionsnav->view()->listView(), fullName,
+ FunctionNavItem::Declaration);
+ m_functionNavDecls[fullName] = item;
+ item->setItem( 0, fullFunctionItem( *it ) );
+
+ m_part->m_functionsnav->view()->addItem(item);
+ }
+ toLeave << fullName;
+ }
+ kdDebug(9003) << k_funcinfo << "leave list: " << toLeave << endl;
+
+ //remove items not in toLeave list
+ QMap<QString, QListViewItem*>::iterator it = m_functionNavDecls.begin();
+ while ( it != m_functionNavDecls.end() )
+ {
+ QMap<QString, QListViewItem*>::iterator it2 = it;
+ ++it;
+ if ( !toLeave.contains( it2.key() ) )
+ {
+ if (it2.data())
+ {
+ m_part->m_functionsnav->view()->removeItem(it2.data());
+ }
+ m_functionNavDecls.remove(it2);
+ }
+ }
+
+ toLeave.clear();
+ FunctionDefinitionList list = CodeModelUtils::allFunctionDefinitionsExhaustive(file);
+ for (FunctionDefinitionList::const_iterator it = list.begin(); it != list.end(); ++it)
+ {
+ QString fullName = fullFunctionDefinitionName(*it);
+
+ if (clear || !m_functionNavDefs[fullName])
+ {
+ FunctionNavItem *item = new FunctionNavItem(m_styles, m_part,
+ m_part->m_functionsnav->view()->listView(), fullName, FunctionNavItem::Definition);
+ m_functionNavDefs[fullName] = item;
+ item->setItem( 0, fullFunctionItem( *it ) );
+ m_part->m_functionsnav->view()->addItem(item);
+ }
+
+ //remove unnecessary items with function declarations for which a definition item was created
+ if (m_functionNavDecls[fullName])
+ {
+ m_part->m_functionsnav->view()->removeItem(m_functionNavDecls[fullName]);
+ m_functionNavDecls.remove(fullName);
+ }
+
+ toLeave << fullName;
+ }
+
+ kdDebug(9003) << k_funcinfo << "leave list: " << toLeave << endl;
+ //remove items not in toLeave list
+ QMap<QString, QListViewItem*>::iterator itt = m_functionNavDefs.begin();
+ while ( itt != m_functionNavDefs.end() )
+ {
+ QMap<QString, QListViewItem*>::iterator it2 = itt;
+ ++itt;
+ if ( !toLeave.contains( it2.key() ) )
+ {
+ if (it2.data())
+ {
+ m_part->m_functionsnav->view()->removeItem(it2.data());
+ }
+ m_functionNavDefs.remove(it2);
+ }
+ }
+}
+
+void Navigator::refresh()
+{
+ refreshNavBars(m_part->m_activeFileName, true);
+}
+
+void Navigator::addFile(const QString & file)
+{
+ kdDebug(9003) << k_funcinfo << "file: " << file << endl;
+ if (file == m_part->m_activeFileName)
+ {
+ kdDebug(9003) << k_funcinfo << "processing active file" << endl;
+ refreshNavBars(m_part->m_activeFileName, false);
+ }
+}
+
+
+
+
+FunctionDom Navigator::currentFunction()
+{
+ if (!m_part->m_activeViewCursor)
+ return FunctionDom();
+
+ unsigned int line, column;
+ m_part->m_activeViewCursor->cursorPositionReal(&line, &column);
+ CodeModelUtils::CodeModelHelper hlp( m_part->codeModel(), m_part->codeModel()->fileByName( m_part->m_activeFileName) );
+ return hlp.functionAt( line, column );
+}
+
+
+///Some time this might be moved into the language-support-part, so each language
+///can highlight as it likes
+TextPaintItem highlightFunctionName(QString function, int type, TextPaintStyleStore& styles) {
+ TextPaintItem ret;
+
+ if( !styles.hasStyle( type ) ) {
+ QFont font = styles.getStyle( 0 ).font;
+
+ switch(type) {
+ case 1:
+ default:
+ font.setWeight( QFont::DemiBold );
+ ///since bold makes the font a little bigger, make it smaller again
+#ifdef BOLDFONTSMALLER
+ font.setPointSize( (font.pointSize() * 9) / 10 );
+#endif
+ }
+
+ styles.addStyle( type, font );
+ }
+
+ QString args;
+ QString fScope;
+ int cutpos;
+
+ if((cutpos = function.find('(')) != -1) {
+ args = function.right( function.length() - cutpos );
+ function = function.left( cutpos );
+ } else {
+ ret.addItem( function );
+ return ret;
+ }
+ if((cutpos = function.findRev(':')) != -1 || (cutpos = function.findRev('.')) != -1) {
+ fScope = function.left( cutpos + 1 );
+ function = function.right( function.length() - cutpos - 1);
+ }
+ if( !fScope.isEmpty() ) ret.addItem(fScope);
+ ret.addItem( function, type );
+ if( !args.isEmpty() ) ret.addItem(args);
+ return ret;
+}
+
+
+template <class DomType>
+TextPaintItem Navigator::fullFunctionItem(DomType fun)
+{
+
+ QStringList scope = fun->scope();
+ QString function = scope.join(".");
+ if (!function.isEmpty())
+ function += ".";
+ function += m_part->languageSupport()->formatModelItem(fun, true);
+ function = m_part->languageSupport()->formatClassName(function);
+
+ return highlightFunctionName(function, 1, m_styles);
+}
+
+QString Navigator::fullFunctionDefinitionName(FunctionDefinitionDom fun)
+{
+ QStringList scope = fun->scope();
+ QString funName = scope.join(".");
+ if (!funName.isEmpty())
+ funName += ".";
+ funName += m_part->languageSupport()->formatModelItem(fun, true);
+ funName = m_part->languageSupport()->formatClassName(funName);
+
+ return funName;
+}
+
+QString Navigator::fullFunctionDeclarationName(FunctionDom fun)
+{
+ QStringList scope = fun->scope();
+ QString funName = scope.join(".");
+ if (!funName.isEmpty())
+ funName += ".";
+ funName += m_part->languageSupport()->formatModelItem(fun, true);
+ funName = m_part->languageSupport()->formatClassName(funName);
+
+ return funName;
+}
+
+void Navigator::slotSyncWithEditor()
+{
+ kdDebug(9003) << k_funcinfo << endl;
+
+ if (FunctionDom fun = currentFunction())
+ {
+ m_part->mainWindow()->raiseView( m_part->widget() );
+
+ ItemDom dom(fun);
+ m_part->jumpedToItem( dom );
+ }
+}
+
+void Navigator::slotJumpToNextFunction()
+{
+ kdDebug ( 9003 ) << k_funcinfo << endl;
+
+ if ( !m_part->m_activeViewCursor ) return;
+ unsigned int currentLine, currentCol;
+ m_part->m_activeViewCursor->cursorPositionReal ( &currentLine, &currentCol );
+
+ QValueList<int> lines = functionStartLines();
+ if ( lines.isEmpty() ) return;
+
+ QValueList<int>::iterator it = lines.begin();
+ while ( it != lines.end() )
+ {
+ if ( *it > currentLine )
+ {
+ KURL url;
+ url.setPath ( m_part->m_activeFileName );
+ m_part->partController()->editDocument ( url, *it );
+ break;
+ }
+ ++it;
+ }
+}
+
+void Navigator::slotJumpToPreviousFunction()
+{
+ kdDebug ( 9003 ) << k_funcinfo << endl;
+
+ if ( !m_part->m_activeViewCursor ) return;
+ unsigned int currentLine, currentCol;
+ m_part->m_activeViewCursor->cursorPositionReal ( &currentLine, &currentCol );
+
+ QValueList<int> lines = QValueList_reversed<int> ( functionStartLines() );
+ if ( lines.isEmpty() ) return;
+
+ QValueList<int>::iterator it = lines.begin();
+ while ( it != lines.end() )
+ {
+ if ( *it < currentLine )
+ {
+ KURL url;
+ url.setPath ( m_part->m_activeFileName );
+ m_part->partController()->editDocument ( url, *it );
+ break;
+ }
+ ++it;
+ }
+}
+
+QValueList<int> Navigator::functionStartLines()
+{
+ FileDom file = m_part->codeModel()->fileByName ( m_part->m_activeFileName );
+ if ( !file ) return QValueList<int>();
+
+ QValueList<int> lines;
+ FunctionDefinitionList list = CodeModelUtils::allFunctionDefinitionsExhaustive ( file );
+ FunctionDefinitionList::const_iterator it = list.begin();
+ while ( it != list.end() )
+ {
+ int line, col;
+ ( *it )->getStartPosition ( &line, &col );
+ lines << line;
+ ++it;
+ }
+ qHeapSort ( lines );
+
+ return lines;
+}
+
+#include "navigator.moc"
diff --git a/parts/classview/navigator.h b/parts/classview/navigator.h
new file mode 100644
index 00000000..0168ccca
--- /dev/null
+++ b/parts/classview/navigator.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef NAVIGATOR_H
+#define NAVIGATOR_H
+
+#include <qobject.h>
+#include <codemodel.h>
+#include <qfont.h>
+#include <fancylistviewitem.h>
+
+class TextPaintStyleStore;
+class QTimer;
+class ClassViewPart;
+class QListViewItem;
+class KAction;
+
+#define NAV_NODEFINITION "(no function)"
+
+class TextPaintItem;
+TextPaintItem highlightFunctionName( QString function, int type, TextPaintStyleStore& styles );
+
+class Navigator : public QObject
+{
+Q_OBJECT
+public:
+ enum NavigationState { GoToDefinitions, GoToDeclarations };
+
+ Navigator(ClassViewPart *parent, const char *name = 0);
+ ~Navigator();
+
+ void stopTimer();
+ void refreshNavBars(const QString &activeFileName, bool clear = true);
+
+ QString fullFunctionDefinitionName(FunctionDefinitionDom fun);
+ QString fullFunctionDeclarationName(FunctionDom fun);
+
+ template <class DomType>
+ TextPaintItem fullFunctionItem(DomType fun);
+
+public slots:
+ void selectFunctionNav(QListViewItem *item);
+ void syncFunctionNav();
+ void syncFunctionNavDelayed(int delay);
+ void functionNavFocused();
+ void functionNavUnFocused();
+ void slotCursorPositionChanged();
+ void refresh();
+ void addFile(const QString &file);
+ void slotSyncWithEditor();
+ void slotJumpToNextFunction();
+ void slotJumpToPreviousFunction();
+
+protected:
+
+ FunctionDom currentFunction();
+ QValueList<int> functionStartLines();
+
+private:
+ ClassViewPart *m_part;
+ QTimer *m_syncTimer;
+ NavigationState m_state;
+
+ QWidget m_dummyActionWidget;
+ KAction* m_actionSyncWithEditor;
+
+ bool m_navNoDefinition;
+
+ QMap<QString, QListViewItem*> m_functionNavDefs;
+ QMap<QString, QListViewItem*> m_functionNavDecls;
+
+ TextPaintStyleStore m_styles;
+};
+
+#endif
diff --git a/parts/classview/viewcombos.cpp b/parts/classview/viewcombos.cpp
new file mode 100644
index 00000000..fc4d02fc
--- /dev/null
+++ b/parts/classview/viewcombos.cpp
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2003 Alexander Dymo (cloudtemple@mksat.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; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include "klistviewaction.h"
+#include "kcomboview.h"
+
+#include "viewcombos.h"
+#include "classviewpart.h"
+
+NamespaceItem::NamespaceItem(ClassViewPart *part, QListView *parent, QString name, NamespaceDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+NamespaceItem::NamespaceItem(ClassViewPart *part, QListViewItem *parent, QString name, NamespaceDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+NamespaceItem::~ NamespaceItem( )
+{
+}
+
+NamespaceDom NamespaceItem::dom() const
+{
+ return m_dom;
+}
+
+void NamespaceItem::setup()
+{
+ QListViewItem::setup();
+ setPixmap( 0, UserIcon("CVnamespace", KIcon::DefaultState, m_part->instance()) );
+}
+
+
+ClassItem::ClassItem(ClassViewPart *part, QListView *parent, QString name, ClassDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+ClassItem::ClassItem(ClassViewPart *part, QListViewItem *parent, QString name, ClassDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+ClassItem::~ ClassItem( )
+{
+}
+
+ClassDom ClassItem::dom() const
+{
+ return m_dom;
+}
+
+void ClassItem::setup()
+{
+ QListViewItem::setup();
+ setPixmap( 0, UserIcon("CVclass", KIcon::DefaultState, m_part->instance()) );
+}
+
+
+FunctionItem::FunctionItem(ClassViewPart *part, QListView *parent, QString name, FunctionDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+FunctionItem::FunctionItem(ClassViewPart *part, QListViewItem *parent, QString name, FunctionDom dom)
+ :QListViewItem(parent, name), m_dom(dom), m_part(part)
+{
+}
+
+FunctionItem::~ FunctionItem( )
+{
+}
+
+FunctionDom FunctionItem::dom() const
+{
+ return m_dom;
+}
+
+void FunctionItem::setup()
+{
+ QListViewItem::setup();
+ QString iconName;
+ if( m_dom->access() == CodeModelItem::Private )
+ iconName = "CVprivate_meth";
+ else if( m_dom->access() == CodeModelItem::Protected )
+ iconName = "CVprotected_meth";
+ else
+ iconName = "CVpublic_meth";
+ setPixmap( 0, UserIcon(iconName, KIcon::DefaultState, m_part->instance()) );
+}
+
+
+namespace ViewCombosOp{
+
+void refreshNamespaces(ClassViewPart *part, KComboView *view)
+{
+ view->clear();
+
+ NamespaceItem *global_item = new NamespaceItem( part, view->listView(), i18n("(Global Namespace)"), part->codeModel()->globalNamespace() );
+ view->addItem(global_item);
+ global_item->setPixmap( 0, UserIcon("CVnamespace", KIcon::DefaultState, part->instance()) );
+ NamespaceList namespaces = part->codeModel()->globalNamespace()->namespaceList();
+ for (NamespaceList::const_iterator it = namespaces.begin(); it != namespaces.end(); ++it)
+ {
+ NamespaceItem *item = new NamespaceItem(part, view->listView(), part->languageSupport()->formatModelItem(*it), *it);
+ view->addItem(item);
+ item->setOpen(true);
+ }
+ view->setCurrentActiveItem(global_item);
+}
+
+void refreshClasses(ClassViewPart *part, KComboView *view, const QString &dom)
+{
+ view->clear();
+
+ view->setCurrentText(EmptyClasses);
+ NamespaceDom nsdom;
+ if (dom == "::")
+ nsdom = part->codeModel()->globalNamespace();
+ else
+ {
+ nsdom = namespaceByName(part->codeModel()->globalNamespace(), dom);
+ if (!nsdom)
+ return;
+ }
+ ClassList classes = nsdom->classList();
+ for (ClassList::const_iterator it = classes.begin(); it != classes.end(); ++it)
+ {
+ ClassItem *item = new ClassItem(part, view->listView(), part->languageSupport()->formatModelItem(*it), *it);
+ view->addItem(item);
+ item->setOpen(true);
+ }
+}
+
+void refreshFunctions(ClassViewPart *part, KComboView *view, const ClassDom & dom)
+{
+ view->clear();
+
+ view->setCurrentText(EmptyFunctions);
+ FunctionList functions = dom->functionList();
+ for (FunctionList::const_iterator it = functions.begin(); it != functions.end(); ++it)
+ {
+ FunctionItem *item = new FunctionItem(part, view->listView(), part->languageSupport()->formatModelItem(*it, true), *it);
+ view->addItem(item);
+ item->setOpen(true);
+ }
+}
+
+void refreshFunctions(ClassViewPart *part, KComboView *view, const QString & dom)
+{
+ view->clear();
+
+ view->setCurrentText(EmptyFunctions);
+ NamespaceDom nsdom;
+ if (dom == "::")
+ nsdom = part->codeModel()->globalNamespace();
+ else
+ {
+ nsdom = namespaceByName(part->codeModel()->globalNamespace(), dom);
+ if (!nsdom)
+ return;
+ }
+ FunctionList functions = nsdom->functionList();
+ for (FunctionList::const_iterator it = functions.begin(); it != functions.end(); ++it)
+ {
+ FunctionItem *item = new FunctionItem(part, view->listView(), part->languageSupport()->formatModelItem(*it, true), *it);
+ view->addItem(item);
+ item->setOpen(true);
+ }
+}
+
+
+}
+
+NamespaceDom ViewCombosOp::namespaceByName( NamespaceDom dom, QString name )
+{
+ NamespaceDom result;
+
+ result = dom->namespaceByName(name);
+ if (!result)
+ {
+ NamespaceList nslist = dom->namespaceList();
+ for (NamespaceList::const_iterator it = nslist.begin(); it != nslist.end(); ++it)
+ {
+ result = namespaceByName(*it, name);
+ if (result)
+ break;
+ }
+ }
+ return result;
+}
+
diff --git a/parts/classview/viewcombos.h b/parts/classview/viewcombos.h
new file mode 100644
index 00000000..4734b856
--- /dev/null
+++ b/parts/classview/viewcombos.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2003 Alexander Dymo (cloudtemple@mksat.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; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+#ifndef VIEWCOMBOS_H
+#define VIEWCOMBOS_H
+
+#include <klocale.h>
+
+#include <qlistview.h>
+
+#include "codemodel.h"
+
+class ClassViewPart;
+class KComboView;
+
+const QString EmptyClasses = i18n("(Classes)");
+const QString EmptyFunctions = i18n("(Functions)");
+
+class NamespaceItem: public QListViewItem{
+public:
+ NamespaceItem(ClassViewPart *part, QListView *parent, QString name, NamespaceDom dom);
+ NamespaceItem(ClassViewPart *part, QListViewItem *parent, QString name, NamespaceDom dom);
+ ~NamespaceItem();
+ NamespaceDom dom() const;
+ virtual void setup();
+private:
+ NamespaceDom m_dom;
+ ClassViewPart *m_part;
+};
+
+class ClassItem: public QListViewItem{
+public:
+ ClassItem(ClassViewPart *part, QListView *parent, QString name, ClassDom dom);
+ ClassItem(ClassViewPart *part, QListViewItem *parent, QString name, ClassDom dom);
+ ~ClassItem();
+ ClassDom dom() const;
+ virtual void setup();
+private:
+ ClassDom m_dom;
+ ClassViewPart *m_part;
+};
+
+class FunctionItem: public QListViewItem{
+public:
+ FunctionItem(ClassViewPart *part, QListView *parent, QString name, FunctionDom dom);
+ FunctionItem(ClassViewPart *part, QListViewItem *parent, QString name, FunctionDom dom);
+ ~FunctionItem();
+ FunctionDom dom() const;
+ virtual void setup();
+private:
+ FunctionDom m_dom;
+ ClassViewPart *m_part;
+};
+
+namespace ViewCombosOp{
+
+enum ProcessType {Refresh, Reload};
+
+void refreshNamespaces(ClassViewPart *part, KComboView *view);
+void refreshClasses(ClassViewPart *part, KComboView *view, const QString &dom);
+void refreshFunctions(ClassViewPart *part, KComboView *view, const ClassDom & dom);
+void refreshFunctions(ClassViewPart *part, KComboView *view, const QString & dom);
+
+NamespaceDom namespaceByName(NamespaceDom dom, QString name);
+
+}
+
+#endif
diff --git a/parts/ctags2/Makefile.am b/parts/ctags2/Makefile.am
new file mode 100644
index 00000000..06b3cfea
--- /dev/null
+++ b/parts/ctags2/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevctags2.la
+libkdevctags2_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevctags2_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevctags2_la_SOURCES = ctags2_part.cpp readtags.c ctags2_widgetbase.ui \
+ ctags2_widget.cpp tags.cpp ctagskinds.cpp ctags2_settingswidgetbase.ui \
+ ctags2_settingswidget.cpp ctags2_selecttagfilebase.ui ctags2_selecttagfile.cpp \
+ ctags2_createtagfilebase.ui ctags2_createtagfile.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevctags2.desktop
+
+rc_DATA = kdevpart_ctags2.rc
+rcdir = $(kde_datadir)/kdevctags2
+
+noinst_HEADERS = ctags2_widget.h tags.h readtags.h ctagskinds.h \
+ ctags2_settingswidget.h
diff --git a/parts/ctags2/README.dox b/parts/ctags2/README.dox
new file mode 100644
index 00000000..e45d0bff
--- /dev/null
+++ b/parts/ctags2/README.dox
@@ -0,0 +1,16 @@
+/** \class ctags2
+This is a CTAGS frontend based on the 'readtags' library.
+
+\authors <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a>
+
+\maintainer <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a>
+
+\feature A very fast CTAGS lookup plugin
+\feature Through the use of regular expressions, it is clever enough to find matches even
+if the match-containing file is open and edited (and the editor contents do not match the file on disk).
+
+\requirement Needs "Exuberant CTAGS" to work. http://ctags.sourceforge.net/
+
+\todo Probably a lot, but mainly configurability.
+
+*/
diff --git a/parts/ctags2/ctags2_createtagfile.cpp b/parts/ctags2/ctags2_createtagfile.cpp
new file mode 100644
index 00000000..b1ced0dd
--- /dev/null
+++ b/parts/ctags2/ctags2_createtagfile.cpp
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <kurlrequester.h>
+#include <klineedit.h>
+
+#include "ctags2_createtagfile.h"
+#include "ctags2_part.h"
+
+
+CreateTagFile::CreateTagFile(QWidget* parent, const char* name, bool modal, WFlags fl)
+: CTags2CreateTagFileBase( parent, name, modal, fl )
+{
+ dirToTag->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly);
+ newTagFilePath->setMode( KFile::File | KFile::LocalOnly );
+ createTagFileButton->setEnabled( false );
+}
+
+CreateTagFile::~CreateTagFile()
+{
+}
+
+void CreateTagFile::validate()
+{
+ bool valid = ( !displayName->text().isEmpty() && !newTagFilePath->url().isEmpty() && !dirToTag->url().isEmpty() );
+
+ createTagFileButton->setEnabled( valid );
+}
+
+QString CreateTagFile::name( )
+{
+ return displayName->text();
+}
+
+QString CreateTagFile::tagsfilePath( )
+{
+ return newTagFilePath->url();
+}
+
+QString CreateTagFile::directory( )
+{
+ return dirToTag->url();
+}
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_createtagfile.h b/parts/ctags2/ctags2_createtagfile.h
new file mode 100644
index 00000000..93b530d4
--- /dev/null
+++ b/parts/ctags2/ctags2_createtagfile.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 CTAGS2_CREATETAGFILE_H
+#define CTAGS2_CREATETAGFILE_H
+
+#include "ctags2_part.h"
+#include "ctags2_createtagfilebase.h"
+
+
+class CreateTagFile : public CTags2CreateTagFileBase {
+
+Q_OBJECT
+
+public:
+ CreateTagFile(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~CreateTagFile();
+ QString name();
+ QString tagsfilePath();
+ QString directory();
+
+private:
+
+public slots:
+ virtual void validate();
+};
+
+#endif
diff --git a/parts/ctags2/ctags2_createtagfilebase.ui b/parts/ctags2/ctags2_createtagfilebase.ui
new file mode 100644
index 00000000..bf4469f3
--- /dev/null
+++ b/parts/ctags2/ctags2_createtagfilebase.ui
@@ -0,0 +1,151 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CTags2CreateTagFileBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CTags2CreateTagFileBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>373</width>
+ <height>198</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Create new tags file</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>displayName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Target tags file path:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>newTagFilePath</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Directory to tag:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>dirToTag</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>createTagFileButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;ancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2CreateTagFileBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>createTagFileButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2CreateTagFileBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>displayName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CTags2CreateTagFileBase</receiver>
+ <slot>validate()</slot>
+ </connection>
+ <connection>
+ <sender>newTagFilePath</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CTags2CreateTagFileBase</receiver>
+ <slot>validate()</slot>
+ </connection>
+ <connection>
+ <sender>dirToTag</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CTags2CreateTagFileBase</receiver>
+ <slot>validate()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>createTagFile()</slot>
+ <slot>validate()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/ctags2/ctags2_part.cpp b/parts/ctags2/ctags2_part.cpp
new file mode 100644
index 00000000..29b564e6
--- /dev/null
+++ b/parts/ctags2/ctags2_part.cpp
@@ -0,0 +1,371 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qwhatsthis.h>
+#include <qpopupmenu.h>
+#include <qtextstream.h>
+#include <qfile.h>
+#include <qregexp.h>
+
+#include <klineedit.h>
+#include <klistview.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <kprocess.h>
+#include <kdebug.h>
+#include <kstringhandler.h>
+#include <kdialogbase.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kaction.h>
+
+#include "kdevappfrontend.h"
+#include <kdevgenericfactory.h>
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+#include <kdevplugininfo.h>
+#include "configwidgetproxy.h"
+#include "domutil.h"
+#include "kdeveditorutil.h"
+
+#include "ctags2_settingswidget.h"
+#include "ctags2_widget.h"
+#include "ctags2_part.h"
+#include "tags.h"
+
+#define CTAGSSETTINGSPAGE 1
+
+namespace ctags
+{
+#include "readtags.h"
+}
+
+typedef KDevGenericFactory<CTags2Part> CTags2Factory;
+static const KDevPluginInfo data("kdevctags2");
+K_EXPORT_COMPONENT_FACTORY( libkdevctags2, CTags2Factory( data ) )
+
+CTags2Part::CTags2Part(QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin(&data, parent, name ? name : "ctags2Part" )
+{
+ setInstance(CTags2Factory::instance());
+ setXMLFile("kdevpart_ctags2.rc");
+
+ QDomDocument & dom = *projectDom();
+ QString customTagFile = DomUtil::readEntry( dom, "/ctagspart/customTagfilePath" );
+ if ( customTagFile.isEmpty() )
+ {
+ customTagFile = project()->projectDirectory() + "/tags";
+ }
+ QStringList tagFiles = DomUtil::readListEntry(dom, "/ctagspart/activeTagsFiles", "file");
+ tagFiles.push_front(customTagFile);
+
+ Tags::setTagFiles(tagFiles);
+
+ m_widget = new CTags2Widget(this);
+
+ QWhatsThis::add(m_widget, i18n("<b>CTags</b><p>Result view for a tag lookup. Click a line to go to the corresponding place in the code."));
+ m_widget->setCaption(i18n("CTags Lookup"));
+ mainWindow()->embedOutputView( m_widget, i18n( "CTags" ), i18n( "CTags lookup results" ) );
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("CTags"), CTAGSSETTINGSPAGE, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+ new KAction( i18n("Lookup Current Text"), 0, CTRL+Key_Underscore, this, SLOT(slotLookup()), actionCollection(), "ctags_lookup_shortcut");
+ new KAction( i18n("Lookup Current Text as Declaration"), 0, CTRL+Key_Semicolon, this, SLOT(slotLookupDeclaration()), actionCollection(), "ctags_declaration_shortcut");
+ new KAction( i18n("Lookup Current Text as Definition"), 0, CTRL+Key_Colon, this, SLOT(slotLookupDefinition()), actionCollection(), "ctags_definition_shortcut");
+ new KAction( i18n("Jump to Next Match"), 0, 0, this, SLOT(slotGoToNext()), actionCollection(), "ctags_jump_to_next");
+ new KAction( i18n("Open Lookup Dialog"), 0, 0, this, SLOT(slotOpenLookup()), actionCollection(), "ctags_input_shortcut");
+}
+
+
+CTags2Part::~CTags2Part()
+{
+ if ( m_widget )
+ {
+ mainWindow()->removeView( m_widget );
+ }
+ delete m_widget;
+ delete _configProxy;
+}
+
+void CTags2Part::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == CTAGSSETTINGSPAGE )
+ {
+ CTags2SettingsWidget * w = new CTags2SettingsWidget( this, page );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ connect( w, SIGNAL(newTagsfileName(const QString& )), this, SLOT(updateTagsfileName(const QString& )) );
+ }
+}
+
+void CTags2Part::updateTagsfileName( const QString & )
+{
+ m_widget->updateDBDateLabel();
+}
+
+// wrapper for creating a tag file for the current project
+bool CTags2Part::createTagsFile()
+{
+ // check if user specified a custom tag file name
+ QDomDocument & dom = *projectDom();
+ QString tagsFileCustom = DomUtil::readEntry( dom, "/ctagspart/customTagfilePath" ).stripWhiteSpace();
+
+ return createTagsFile(tagsFileCustom, project()->projectDirectory());
+}
+
+// creates a new tag file with the specified name for the specified source directory
+bool CTags2Part::createTagsFile(const QString& tagFile, const QString& dir)
+{
+/*
+ KProcess proc;
+ proc.setWorkingDirectory( project()->projectDirectory() );
+
+ proc << "ctags";
+ proc << "-R" << "--c++-types=+px" << "--excmd=pattern" << "--exclude=Makefile";
+
+ bool success = proc.start(KProcess::Block);
+
+ return success;
+*/
+
+ // get name of the ctags binary
+ KConfig * config = kapp->config();
+ config->setGroup( "CTAGS" );
+ QString ctagsBinary = config->readEntry( "ctags binary" ).stripWhiteSpace();
+ if ( ctagsBinary.isEmpty() )
+ {
+ ctagsBinary = "ctags";
+ }
+
+ // set a default argument list
+ QString argsDefault = "-R --c++-types=+px --excmd=pattern --exclude=Makefile --exclude=.";
+
+ QDomDocument & dom = *projectDom();
+ QString argsCustom = DomUtil::readEntry( dom, "/ctagspart/customArguments" ).stripWhiteSpace();
+ QString commandline = ctagsBinary + " " + ( argsCustom.isEmpty() ? argsDefault : argsCustom ) + ( tagFile.isEmpty() ? "" : " -f " + tagFile );
+ commandline += " ";
+ commandline += dir;
+
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(dir, commandline, false);
+
+ return true;
+}
+
+void CTags2Part::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::EditorContext ))
+ return;
+
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ QString ident = econtext->currentWord();
+ if (ident.isEmpty())
+ return;
+
+ KConfig * config = kapp->config();
+ config->setGroup( "CTAGS" );
+ bool showDeclaration = config->readBoolEntry( "ShowDeclaration", true );
+ bool showDefinition = config->readBoolEntry( "ShowDefinition", true );
+ bool showLookup = config->readBoolEntry( "ShowLookup", true );
+
+ if ( Tags::hasTag( ident ) && ( showDefinition || showDeclaration || showLookup ) )
+ {
+ m_contextString = ident;
+ QString squeezed = KStringHandler::csqueeze(ident, 30);
+
+ popup->insertSeparator();
+
+ if ( showDeclaration )
+ popup->insertItem( i18n("CTags - Go to Declaration: %1").arg(squeezed), this, SLOT(slotGotoDeclaration()) );
+
+ if ( showDefinition )
+ popup->insertItem( i18n("CTags - Go to Definition: %1").arg(squeezed), this, SLOT(slotGotoDefinition()) );
+
+ if ( showLookup )
+ popup->insertItem( i18n("CTags - Lookup: %1").arg(squeezed), this, SLOT(slotGotoTag()) );
+ }
+}
+
+void CTags2Part::showHits( Tags::TagList const & tags )
+{
+ m_widget->displayHitsAndClear( tags );
+
+ mainWindow()->raiseView( m_widget );
+ m_widget->output_view->setFocus();
+}
+
+void CTags2Part::slotGotoTag( )
+{
+ showHits( Tags::getExactMatches( m_contextString ) );
+}
+
+void CTags2Part::gotoTagForTypes( QStringList const & types )
+{
+ Tags::TagList list = Tags::getMatches( m_contextString, false, types );
+
+ if ( list.count() < 1 ) return;
+
+ KConfig * config = kapp->config();
+ config->setGroup("CTAGS");
+ bool jumpToFirst = config->readBoolEntry( "JumpToFirst", false );
+
+ if ( list.count() == 1 || jumpToFirst )
+ {
+ Tags::TagEntry tag = list.first();
+ KURL url;
+ QString fileWithTagInside;
+ // assume relative path to project directory if path does not start with slash
+ if (tag.file[0] != '/') {
+ fileWithTagInside = project()->projectDirectory() + "/" + tag.file;
+ }
+ else {
+ fileWithTagInside = tag.file;
+ }
+ url.setPath(fileWithTagInside);
+ partController()->editDocument( url, getFileLineFromPattern( url, tag.pattern ) );
+ m_widget->displayHitsAndClear( list );
+ }
+ else
+ {
+ showHits( list );
+ }
+}
+
+void CTags2Part::slotGotoDefinition( )
+{
+ QStringList types;
+ types << "S" << "d" << "f" << "t" << "v";
+ gotoTagForTypes( types );
+}
+
+void CTags2Part::slotGotoDeclaration( )
+{
+ QStringList types;
+ types << "L" << "c" << "e" << "g" << "m" << "n" << "p" << "s" << "u" << "x";
+ gotoTagForTypes( types );
+}
+
+
+int CTags2Part::getFileLineFromStream( QTextStream & istream, QString const & pattern )
+{
+ if ( pattern.isEmpty() ) return -1;
+
+ // ctags interestingly escapes "/", but apparently nothing else. lets revert that
+ QString unescaped = pattern;
+ unescaped.replace( "\\/", "/" );
+
+ // most of the time, the ctags pattern has the form /^foo$/
+ // but this isn't true for some macro definitions
+ // where the form is only /^foo/
+ // I have no idea if this is a ctags bug or not, but we have to deal with it
+
+ QString reduced, escaped, re_string;
+ if ( unescaped.endsWith( "$/" ) )
+ {
+ reduced = unescaped.mid( 2, unescaped.length() -4 );
+ escaped = QRegExp::escape( reduced );
+ re_string = QString( "^" + escaped + "$" );
+ }
+ else
+ {
+ reduced = unescaped.mid( 2, unescaped.length() -3 );
+ escaped = QRegExp::escape( reduced );
+ re_string = QString( "^" + escaped );
+ }
+
+ QRegExp re( re_string );
+
+ int n = 0;
+ while ( !istream.atEnd() )
+ {
+ if ( re.search( istream.readLine() ) > -1 )
+ {
+ return n;
+ }
+ n++;
+ }
+ return -1;
+}
+
+int CTags2Part::getFileLineFromPattern( KURL const & url, QString const & pattern )
+{
+ // if the file is open - get the line from the editor buffer
+ if ( KTextEditor::EditInterface * ei = dynamic_cast<KTextEditor::EditInterface*>( partController()->partForURL( url ) ) )
+ {
+ QString ibuffer = ei->text();
+ QTextStream istream( &ibuffer, IO_ReadOnly );
+ return getFileLineFromStream( istream, pattern );
+ }
+ else // else the file is not open - get the line from the file on disk
+ {
+ QFile file( url.path() );
+ QString buffer;
+
+ if ( file.open( IO_ReadOnly ) )
+ {
+ QTextStream istream( &file );
+ return getFileLineFromStream( istream, pattern );
+ }
+ }
+ return -1;
+}
+
+void CTags2Part::slotLookupDeclaration( )
+{
+ m_contextString = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ if ( !m_contextString.isEmpty() )
+ {
+ slotGotoDeclaration();
+ }
+}
+
+void CTags2Part::slotLookupDefinition( )
+{
+ m_contextString = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ if ( !m_contextString.isEmpty() )
+ {
+ slotGotoDefinition();
+ }
+}
+
+void CTags2Part::slotLookup( )
+{
+ m_contextString = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ if ( !m_contextString.isEmpty() )
+ {
+ slotGotoTag();
+ }
+}
+
+void CTags2Part::slotOpenLookup( )
+{
+ mainWindow()->raiseView( m_widget );
+ m_widget->input_edit->setFocus();
+}
+
+void CTags2Part::slotGoToNext( )
+{
+ m_widget->goToNext();
+}
+
+#include "ctags2_part.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_part.h b/parts/ctags2/ctags2_part.h
new file mode 100644
index 00000000..77725500
--- /dev/null
+++ b/parts/ctags2/ctags2_part.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __KDEVPART_CTAGS2_H__
+#define __KDEVPART_CTAGS2_H__
+
+#include <qguardedptr.h>
+#include <qstring.h>
+
+#include <kdevplugin.h>
+#include "tags.h"
+
+class QPopupMenu;
+class Context;
+class KURL;
+class QTextStream;
+class CTags2Widget;
+class ConfigWidgetProxy;
+class KDialogBase;
+
+class CTags2Part : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ CTags2Part(QObject *parent, const char *name, const QStringList &);
+ ~CTags2Part();
+
+ int getFileLineFromPattern( KURL const & url, QString const & pattern);
+ bool createTagsFile();
+ bool createTagsFile(const QString& tagFile, const QString& dir);
+
+private slots:
+ void slotLookupDeclaration();
+ void slotLookupDefinition();
+ void slotLookup();
+ void slotOpenLookup();
+ void slotGoToNext();
+ void slotGotoDefinition();
+ void slotGotoDeclaration();
+ void slotGotoTag();
+ void contextMenu(QPopupMenu *, const Context *);
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int );
+ void updateTagsfileName( const QString & name );
+
+private:
+ int getFileLineFromStream( QTextStream & stream, QString const & pattern);
+ void gotoTagForTypes( QStringList const & types );
+ void showHits( Tags::TagList const & tags );
+
+ QGuardedPtr<CTags2Widget> m_widget;
+ QString m_contextString ;
+
+ ConfigWidgetProxy * _configProxy;
+};
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_selecttagfile.cpp b/parts/ctags2/ctags2_selecttagfile.cpp
new file mode 100644
index 00000000..d9ae94be
--- /dev/null
+++ b/parts/ctags2/ctags2_selecttagfile.cpp
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <kurlrequester.h>
+#include <klineedit.h>
+
+#include "ctags2_selecttagfile.h"
+
+
+SelectTagFile::SelectTagFile( QWidget* parent, const char* name, bool modal, WFlags fl)
+: SelectTagFileBase( parent, name, modal, fl )
+{
+ tagFile->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ okButton->setEnabled( false );
+}
+
+SelectTagFile::~SelectTagFile()
+{
+}
+
+void SelectTagFile::validate()
+{
+ bool valid = ( !displayName->text().isEmpty() && !tagFile->url().isEmpty() );
+
+ okButton->setEnabled( valid );
+}
+
+QString SelectTagFile::name( )
+{
+ return displayName->text();
+}
+
+QString SelectTagFile::tagsfilePath( )
+{
+ return tagFile->url();
+}
+
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_selecttagfile.h b/parts/ctags2/ctags2_selecttagfile.h
new file mode 100644
index 00000000..103ba98c
--- /dev/null
+++ b/parts/ctags2/ctags2_selecttagfile.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 CTAGS2_SELECTTAGFILE_H
+#define CTAGS2_SELECTTAGFILE_H
+
+#include "ctags2_selecttagfilebase.h"
+
+class SelectTagFile : public SelectTagFileBase {
+ Q_OBJECT
+
+ public:
+ SelectTagFile( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~SelectTagFile();
+ QString name();
+ QString tagsfilePath();
+
+public slots:
+ virtual void validate();
+};
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_selecttagfilebase.ui b/parts/ctags2/ctags2_selecttagfilebase.ui
new file mode 100644
index 00000000..cddd5f26
--- /dev/null
+++ b/parts/ctags2/ctags2_selecttagfilebase.ui
@@ -0,0 +1,128 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SelectTagFileBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SelectTagFileBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>373</width>
+ <height>146</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add tags file</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Name:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>displayName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Tags file:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>tagFile</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>101</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;K</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectTagFileBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectTagFileBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>displayName</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>SelectTagFileBase</receiver>
+ <slot>validate()</slot>
+ </connection>
+ <connection>
+ <sender>tagFile</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>SelectTagFileBase</receiver>
+ <slot>validate()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>validate()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/ctags2/ctags2_settingswidget.cpp b/parts/ctags2/ctags2_settingswidget.cpp
new file mode 100644
index 00000000..4bcdb122
--- /dev/null
+++ b/parts/ctags2/ctags2_settingswidget.cpp
@@ -0,0 +1,173 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qheader.h>
+
+#include <klineedit.h>
+#include <klistview.h>
+#include <kdevproject.h>
+#include <kapplication.h>
+#include <kurlcompletion.h>
+#include <kurlrequester.h>
+#include <kconfig.h>
+#include <kurl.h>
+#include <kdevplugin.h>
+#include <domutil.h>
+
+#include "ctags2_settingswidget.h"
+#include "ctags2_part.h"
+#include "ctags2_selecttagfile.h"
+#include "ctags2_createtagfile.h"
+
+
+CTags2SettingsWidget::CTags2SettingsWidget( CTags2Part * part, QWidget* parent, const char* name, WFlags fl )
+ : CTags2SettingsWidgetBase( parent, name, fl ), m_part( part )
+{
+ binaryPath->completionObject()->setMode( KURLCompletion::FileCompletion );
+ binaryPath->setMode( KFile::File | KFile::LocalOnly );
+ binaryPath->setShowLocalProtocol( false );
+
+ tagfilePath->completionObject()->setMode( KURLCompletion::FileCompletion );
+ tagfilePath->setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly );
+ tagfilePath->setShowLocalProtocol( false );
+
+ otherTagFiles->setSorting( -1 );
+// otherTagFiles->addColumn( "" );
+// otherTagFiles->header()->hide();
+ otherTagFiles->setFullWidth( true );
+
+ loadSettings();
+}
+
+CTags2SettingsWidget::~CTags2SettingsWidget()
+{
+}
+
+void CTags2SettingsWidget::loadSettings()
+{
+ QDomDocument & dom = *m_part->projectDom();
+
+ QString customArgs = DomUtil::readEntry( dom, "/ctagspart/customArguments" );
+ if ( !customArgs.isEmpty() )
+ {
+ tagfileCustomBox->setChecked( true );
+ tagfileCustomEdit->setText( customArgs );
+ }
+
+ QString customTagfile = DomUtil::readEntry( dom, "/ctagspart/customTagfilePath" );
+ if (customTagfile.isEmpty())
+ {
+ customTagfile = m_part->project()->projectDirectory() + "/tags";
+ }
+ tagfilePath->setURL(customTagfile);
+
+ QStringList activeTagsFiles = DomUtil::readListEntry(dom, "/ctagspart/activeTagsFiles", "file");
+
+ KConfig * config = kapp->config();
+ config->setGroup( "CTAGS" );
+ showDeclarationBox->setChecked( config->readBoolEntry( "ShowDeclaration", true ) );
+ showDefinitionBox->setChecked( config->readBoolEntry( "ShowDefinition", true ) );
+ showLookupBox->setChecked( config->readBoolEntry( "ShowLookup", true ) );
+ jumpToFirstBox->setChecked( config->readBoolEntry( "JumpToFirst", false ) );
+ QString ctagsBinary = config->readEntry( "ctags binary" ).stripWhiteSpace();
+ if ( !ctagsBinary.isEmpty() )
+ {
+ binaryPath->setURL( ctagsBinary );
+ }
+
+ config->setGroup( "CTAGS-tagsfiles" );
+ QMap<QString,QString> entryMap = config->entryMap( "CTAGS-tagsfiles" );
+ QMap<QString,QString>::const_iterator it = entryMap.begin();
+ while ( it != entryMap.end() )
+ {
+ QString file = config->readPathEntry( it.key() );
+ new TagsItem( otherTagFiles, it.key(), file, activeTagsFiles.contains( file ) );
+ ++it;
+ }
+}
+
+void CTags2SettingsWidget::storeSettings()
+{
+ QDomDocument & dom = *m_part->projectDom();
+ DomUtil::writeEntry( dom, "/ctagspart/customArguments", tagfileCustomEdit->text() );
+ DomUtil::writeEntry( dom, "/ctagspart/customTagfilePath", tagfilePath->url() );
+
+ KConfig * config = kapp->config();
+ config->setGroup( "CTAGS" );
+ config->writeEntry( "ShowDeclaration", showDeclarationBox->isChecked() );
+ config->writeEntry( "ShowDefinition", showDefinitionBox->isChecked() );
+ config->writeEntry( "ShowLookup", showLookupBox->isChecked() );
+ config->writeEntry( "JumpToFirst", jumpToFirstBox->isChecked() );
+ config->writeEntry( "ctags binary", binaryPath->url() );
+
+ config->deleteGroup( "CTAGS-tagsfiles" );
+ config->setGroup( "CTAGS-tagsfiles" );
+
+ QStringList activeTagsFiles;
+ TagsItem * item = static_cast<TagsItem*>( otherTagFiles->firstChild() );
+ while ( item )
+ {
+ config->writePathEntry( item->name(), item->tagsfilePath() );
+ if ( item->isOn() )
+ {
+ activeTagsFiles.append( item->tagsfilePath() );
+ }
+ item = static_cast<TagsItem*>( item->nextSibling() );
+ }
+ DomUtil::writeListEntry( dom, "/ctagspart/activeTagsFiles", "file", activeTagsFiles );
+
+ activeTagsFiles.push_front( tagfilePath->url() );
+ Tags::setTagFiles( activeTagsFiles );
+
+ config->sync();
+
+ emit newTagsfileName( tagfilePath->url() );
+}
+
+void CTags2SettingsWidget::slotAccept( )
+{
+ storeSettings();
+}
+
+void CTags2SettingsWidget::createNewTagSlot()
+{
+ CreateTagFile* dlg = new CreateTagFile;
+ if ( dlg->exec() == QDialog::Accepted )
+ {
+ m_part->createTagsFile( dlg->tagsfilePath(), dlg->directory() );
+ new TagsItem( otherTagFiles, dlg->name(), dlg->tagsfilePath(), true );
+ }
+}
+
+void CTags2SettingsWidget::addNewTagFile()
+{
+ SelectTagFile* dlg = new SelectTagFile;
+
+ if ( dlg->exec() == QDialog::Accepted )
+ {
+ new TagsItem( otherTagFiles, dlg->name(), dlg->tagsfilePath(), true );
+ }
+}
+
+void CTags2SettingsWidget::removeTagFile()
+{
+ if (!otherTagFiles->selectedItem())
+ return;
+
+ delete otherTagFiles->selectedItem();
+}
+
+
+#include "ctags2_settingswidget.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_settingswidget.h b/parts/ctags2/ctags2_settingswidget.h
new file mode 100644
index 00000000..ac208ad4
--- /dev/null
+++ b/parts/ctags2/ctags2_settingswidget.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 CTAGS2_SETTINGSWIDGET_H
+#define CTAGS2_SETTINGSWIDGET_H
+
+#include <qlistview.h>
+
+#include "ctags2_settingswidgetbase.h"
+
+class CTags2Part;
+
+class TagsItem : public QCheckListItem
+{
+public:
+ TagsItem( QListView * parent, QString name, QString tagsfilePath, bool active )
+ : QCheckListItem( parent, name, QCheckListItem::CheckBox ), m_name( name ), m_tagsfilePath( tagsfilePath )
+ {
+ setOn( active );
+ setText( 1, tagsfilePath );
+ }
+ QString name() { return m_name; }
+ QString tagsfilePath() { return m_tagsfilePath; }
+
+private:
+ QString m_name;
+ QString m_tagsfilePath;
+};
+
+
+
+class CTags2SettingsWidget : public CTags2SettingsWidgetBase
+{
+ Q_OBJECT
+
+public:
+ CTags2SettingsWidget( CTags2Part * part, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~CTags2SettingsWidget();
+
+signals:
+ void newTagsfileName( const QString & name );
+
+public slots:
+ void slotAccept();
+ void createNewTagSlot();
+ void addNewTagFile();
+ void removeTagFile();
+
+protected:
+
+protected slots:
+
+private:
+ void loadSettings();
+ void storeSettings();
+
+ CTags2Part * m_part;
+};
+
+#endif
+
diff --git a/parts/ctags2/ctags2_settingswidgetbase.ui b/parts/ctags2/ctags2_settingswidgetbase.ui
new file mode 100644
index 00000000..27898206
--- /dev/null
+++ b/parts/ctags2/ctags2_settingswidgetbase.ui
@@ -0,0 +1,382 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CTags2SettingsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CTags2SettingsWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>460</width>
+ <height>456</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget8</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Ge&amp;neral</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Editor Context Menu</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showDeclarationBox</cstring>
+ </property>
+ <property name="text">
+ <string>Show "&amp;Go To Declaration"</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If checked, an option to go directly to the matching tag declaration will be shown. If more than one match, all matches will be shown in the main ctags result view.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showDefinitionBox</cstring>
+ </property>
+ <property name="text">
+ <string>Show "Go To &amp;Definition"</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If checked, an option to go directly to the matching tag definition will be shown. If more than one match, all matches will be shown in the main ctags result view.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>showLookupBox</cstring>
+ </property>
+ <property name="text">
+ <string>Show "CT&amp;ags Lookup"</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If checked, an option to do a full lookup of all macthing tags is shown in the context menu. The results will be shown in the main ctags results view.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>jumpToFirstBox</cstring>
+ </property>
+ <property name="text">
+ <string>When more than one hit, go directl&amp;y to the first</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If more than one hit was produced from an attempt to find an exact match, go to the first match in the list. Note: the &lt;i&gt;Go To Next Match&lt;/i&gt; shortcut can be used to step between the matches.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>tagfileCustomBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use custom tagfile generation arguments</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The default arguments should be fine, but if needed a custom generation arguments string can be used.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>tagfileCustomEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter custom arguments to ctags database creation here. Note: do not set a custom tags file filename here, do that below instead.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Paths</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the path to the exuberant ctags binary. If empty, &lt;i&gt;ctags&lt;/i&gt; will be executed via $PATH. Note that it is sometimes installed as &lt;i&gt;exuberant-ctags&lt;/i&gt;.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Path to ctags binary:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>binaryPath</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the path to the exuberant ctags binary. If empty, &lt;i&gt;ctags&lt;/i&gt; will be executed via $PATH. Note that it is sometimes installed as &lt;i&gt;exuberant-ctags&lt;/i&gt;.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <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>31</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Mana&amp;ge tag files</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout15</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Path to project tag file:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>tagfilePath</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter the full path of the project tagfile. If empty, the file will be called &lt;i&gt;tags&lt;/i&gt; and reside in the root of the project.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Other tag files:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="1">
+ <property name="name">
+ <cstring>layout21</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>createButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>removeButton</cstring>
+ </property>
+ <property name="text">
+ <string>Remo&amp;ve</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>61</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView" row="2" column="0" rowspan="2" colspan="1">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Tags file</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>otherTagFiles</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>addButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2SettingsWidgetBase</receiver>
+ <slot>addNewTagFile()</slot>
+ </connection>
+ <connection>
+ <sender>removeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2SettingsWidgetBase</receiver>
+ <slot>removeTagFile()</slot>
+ </connection>
+ <connection>
+ <sender>createButton</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2SettingsWidgetBase</receiver>
+ <slot>createNewTagSlot()</slot>
+ </connection>
+ <connection>
+ <sender>tagfileCustomBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>tagfileCustomEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>tagfileCustomBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>tagfileCustomEdit</receiver>
+ <slot>clear()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>createNewTagSlot()</slot>
+ <slot>addNewTagFile()</slot>
+ <slot>removeTagFile()</slot>
+ <slot>moveUpTagFile()</slot>
+ <slot>moveDownTagFile()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/ctags2/ctags2_widget.cpp b/parts/ctags2/ctags2_widget.cpp
new file mode 100644
index 00000000..7196ed1b
--- /dev/null
+++ b/parts/ctags2/ctags2_widget.cpp
@@ -0,0 +1,199 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qtimer.h>
+#include <qlabel.h>
+#include <qfileinfo.h>
+#include <qdatetime.h>
+#include <qfocusdata.h>
+
+#include <klineedit.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kurl.h>
+#include <kapplication.h>
+
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+
+#include "ctags2_widget.h"
+#include "tags.h"
+
+class TagItem : public QListViewItem
+{
+public:
+ TagItem(QListView * lv, QString const & tag, QString const & type, QString const & file, QString const & pattern );
+
+ QString tag;
+ QString type;
+ QString file;
+ QString pattern;
+};
+
+TagItem::TagItem( QListView * lv, QString const & tag, QString const & type, QString const & file, QString const & pattern )
+ : QListViewItem( lv, tag, type, file ), tag(tag), type(type), file(file), pattern(pattern)
+{
+}
+
+CTags2Widget::CTags2Widget( CTags2Part * part, const char* name, WFlags fl)
+: CTags2WidgetBase(0,name,fl), _part(part)
+{
+ output_view->setColumnWidthMode(0,QListView::Maximum);
+ output_view->setColumnWidthMode(1,QListView::Maximum);
+ output_view->setColumnWidthMode(2,QListView::Maximum);
+
+ _typeTimeout = new QTimer( this );
+ connect( _typeTimeout, SIGNAL(timeout()), this, SLOT(line_edit_changed()) );
+
+ connect( output_view, SIGNAL(executed(QListViewItem*)), this, SLOT(itemExecuted(QListViewItem*)) );
+ connect( output_view, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(itemExecuted(QListViewItem*)) );
+
+ updateDBDateLabel();
+}
+
+CTags2Widget::~CTags2Widget()
+{
+}
+
+void CTags2Widget::displayHits( Tags::TagList const & list )
+{
+ output_view->clear();
+ showHitCount( list.count() );
+
+ Tags::TagList::ConstIterator it = list.begin();
+ while( it != list.end() )
+ {
+ new TagItem( output_view, (*it).tag, (*it).type, (*it).file, (*it).pattern );
+ ++it;
+ }
+
+ output_view->adjustColumn(0);
+ output_view->adjustColumn(1);
+ output_view->adjustColumn(2);
+
+}
+
+void CTags2Widget::displayHitsAndClear( Tags::TagList const & list )
+{
+ input_edit->blockSignals( true );
+ input_edit->clear();
+ input_edit->blockSignals( false );
+
+ displayHits( list );
+}
+
+void CTags2Widget::line_edit_changed( )
+{
+ displayHits( Tags::getPartialMatches( input_edit->text() ) );
+}
+
+void CTags2Widget::line_edit_changed_delayed( )
+{
+ showHitCount( calculateHitCount() );
+ _typeTimeout->start( 500, true );
+}
+
+void CTags2Widget::showHitCount( int n )
+{
+ hitcount_label->setText( i18n("Hits: %1").arg( n ) );
+}
+
+int CTags2Widget::calculateHitCount( )
+{
+ return Tags::numberOfPartialMatches( input_edit->text() ) ;
+}
+
+void CTags2Widget::itemExecuted( QListViewItem * item )
+{
+ TagItem * tagItem = static_cast<TagItem*>( item );
+
+ KURL url;
+ QString fileWithTagInside;
+ // assume relative path to project directory if path does not start with slash
+ if (tagItem->file[0] != '/') {
+ fileWithTagInside = _part->project()->projectDirectory() + "/" + tagItem->file;
+ }
+ else {
+ fileWithTagInside = tagItem->file;
+ }
+
+ url.setPath(fileWithTagInside);
+
+ _part->partController()->editDocument( url, _part->getFileLineFromPattern( url, tagItem->pattern ) );
+}
+
+void CTags2Widget::regeneratebutton_clicked()
+{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ _part->createTagsFile();
+
+ QApplication::restoreOverrideCursor();
+
+ updateDBDateLabel();
+}
+
+void CTags2Widget::updateDBDateLabel( )
+{
+ QStringList tagFiles = Tags::getTagFiles();
+ QFileInfo tagsdb(tagFiles[0]);
+ if ( tagsdb.exists() )
+ {
+ datetime_label->setText( tagsdb.created().date().toString( Qt::ISODate ) );
+ }
+ else
+ {
+ datetime_label->setText( i18n("No CTags database found") );
+ }
+}
+
+void CTags2Widget::focusInEvent( QFocusEvent* )
+{
+ updateDBDateLabel();
+ input_edit->setFocus();
+}
+
+void CTags2Widget::goToNext( )
+{
+ QListViewItem * item = output_view->firstChild();
+ while( item )
+ {
+ if ( item->isSelected() )
+ {
+ // found the current, take the next
+ item->setSelected( false );
+ if ( (item = item->nextSibling()) != NULL )
+ {
+ item->setSelected( true );
+ output_view->repaint( true );
+ itemExecuted( item );
+ return;
+ }
+ else
+ {
+ break;
+ }
+ }
+ item = item->nextSibling();
+ }
+ // use the first
+ if ( (item = output_view->firstChild()) != NULL )
+ {
+ item->setSelected( true );
+ itemExecuted( item );
+ }
+}
+
+#include "ctags2_widget.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
+
diff --git a/parts/ctags2/ctags2_widget.h b/parts/ctags2/ctags2_widget.h
new file mode 100644
index 00000000..2a4423a4
--- /dev/null
+++ b/parts/ctags2/ctags2_widget.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 CTAGS2_WIDGET_H
+#define CTAGS2_WIDGET_H
+
+#include "ctags2_widgetbase.h"
+#include "ctags2_part.h"
+#include "tags.h"
+
+class QTimer;
+class QListViewItem;
+
+class CTags2Widget : public CTags2WidgetBase
+{
+ Q_OBJECT
+
+public:
+ CTags2Widget( CTags2Part * part, const char* name = 0, WFlags fl = 0 );
+ ~CTags2Widget();
+
+ void displayHits( Tags::TagList const & );
+ void displayHitsAndClear( Tags::TagList const & );
+
+ void updateDBDateLabel();
+ void goToNext();
+
+protected:
+ void focusInEvent( QFocusEvent *e );
+
+private slots:
+ virtual void line_edit_changed();
+ virtual void line_edit_changed_delayed();
+ virtual void regeneratebutton_clicked();
+ void itemExecuted( QListViewItem * );
+
+private:
+ void showHitCount( int );
+ int calculateHitCount();
+
+ CTags2Part * _part;
+ QTimer * _typeTimeout;
+
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/ctags2/ctags2_widgetbase.ui b/parts/ctags2/ctags2_widgetbase.ui
new file mode 100644
index 00000000..ef564767
--- /dev/null
+++ b/parts/ctags2/ctags2_widgetbase.ui
@@ -0,0 +1,181 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CTags2WidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CTags2WidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>780</width>
+ <height>397</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Tag</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>File</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>output_view</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Result view for a tag lookup. Click a line to go to the corresponding place in the code.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Lookup:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>input_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Type the identifier you want to lookup. &lt;p&gt; The identifier will populate and display a reducing list as you type.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>hitcount_label</cstring>
+ </property>
+ <property name="text">
+ <string>Hits:</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>80</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>datetime_label</cstring>
+ </property>
+ <property name="text">
+ <string>Date:</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>generate_button</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Regenerate</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Press to regenerate CTags database.&lt;p&gt;This will take some time on a large project.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>input_edit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>CTags2WidgetBase</receiver>
+ <slot>line_edit_changed()</slot>
+ </connection>
+ <connection>
+ <sender>input_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>CTags2WidgetBase</receiver>
+ <slot>line_edit_changed_delayed()</slot>
+ </connection>
+ <connection>
+ <sender>generate_button</sender>
+ <signal>clicked()</signal>
+ <receiver>CTags2WidgetBase</receiver>
+ <slot>regeneratebutton_clicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>input_edit</tabstop>
+ <tabstop>output_view</tabstop>
+</tabstops>
+<slots>
+ <slot access="private">line_edit_changed_delayed()</slot>
+ <slot access="private">line_edit_changed()</slot>
+ <slot access="private">regeneratebutton_clicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/ctags2/ctagskinds.cpp b/parts/ctags2/ctagskinds.cpp
new file mode 100644
index 00000000..c8d5ef93
--- /dev/null
+++ b/parts/ctags2/ctagskinds.cpp
@@ -0,0 +1,306 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "ctagskinds.h"
+
+#include <klocale.h>
+
+struct CTagsKindMapping {
+ char abbrev;
+ const char *verbose;
+};
+
+
+struct CTagsExtensionMapping {
+ const char *extension;
+ CTagsKindMapping *kinds;
+};
+
+
+static CTagsKindMapping kindMappingAsm[] = {
+ { 'd', I18N_NOOP("define") },
+ { 'l', I18N_NOOP("label") },
+ { 'm', I18N_NOOP("macro") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingAsp[] = {
+ { 'f', I18N_NOOP("function") },
+ { 's', I18N_NOOP("subroutine") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingAwk[] = {
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingBeta[] = {
+ { 'f', I18N_NOOP("fragment definition") },
+ { 'p', I18N_NOOP("any pattern") },
+ { 's', I18N_NOOP("slot") },
+ { 'v', I18N_NOOP("pattern") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingC[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'd', I18N_NOOP("macro") },
+ { 'e', I18N_NOOP("enumerator") },
+ { 'f', I18N_NOOP("function") },
+ { 'g', I18N_NOOP("enumeration") },
+ { 'l', I18N_NOOP("local variable") },
+ { 'm', I18N_NOOP("member") },
+ { 'n', I18N_NOOP("namespace") },
+ { 'p', I18N_NOOP("prototype") },
+ { 's', I18N_NOOP("struct") },
+ { 't', I18N_NOOP("typedef") },
+ { 'u', I18N_NOOP("union") },
+ { 'v', I18N_NOOP("variable") },
+ { 'x', I18N_NOOP("external variable") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingCobol[] = {
+ { 'p', I18N_NOOP("paragraph") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingEiffel[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'f', I18N_NOOP("feature") },
+ { 'l', I18N_NOOP("local entity") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingFortran[] = {
+ { 'b', I18N_NOOP("block") },
+ { 'c', I18N_NOOP("common") },
+ { 'e', I18N_NOOP("entry") },
+ { 'f', I18N_NOOP("function") },
+ { 'i', I18N_NOOP("interface") },
+ { 'k', I18N_NOOP("type component") },
+ { 'l', I18N_NOOP("label") },
+ { 'L', I18N_NOOP("local") },
+ { 'm', I18N_NOOP("module") },
+ { 'n', I18N_NOOP("namelist") },
+ { 'p', I18N_NOOP("program") },
+ { 's', I18N_NOOP("subroutine") },
+ { 't', I18N_NOOP("type") },
+ { 'v', I18N_NOOP("variable") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingJava[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'f', I18N_NOOP("field") },
+ { 'i', I18N_NOOP("interface") },
+ { 'm', I18N_NOOP("method") },
+ { 'p', I18N_NOOP("package") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingLisp[] = {
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingMake[] = {
+ { 'm', I18N_NOOP("macro") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingPascal[] = {
+ { 'f', I18N_NOOP("function") },
+ { 'p', I18N_NOOP("procedure") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingPerl[] = {
+ { 's', I18N_NOOP("subroutine") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingPHP[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingPython[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingRexx[] = {
+ { 's', I18N_NOOP("subroutine") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingRuby[] = {
+ { 'c', I18N_NOOP("class") },
+ { 'f', I18N_NOOP("function") },
+ { 'm', I18N_NOOP("mixin") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingScheme[] = {
+ { 'f', I18N_NOOP("function") },
+ { 's', I18N_NOOP("set") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingSh[] = {
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingSlang[] = {
+ { 'f', I18N_NOOP("function") },
+ { 'n', I18N_NOOP("namespace") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingTcl[] = {
+ { 'p', I18N_NOOP("procedure") },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping kindMappingVim[] = {
+ { 'f', I18N_NOOP("function") },
+ { 0 , 0 }
+};
+
+
+static CTagsExtensionMapping extensionMapping[] = {
+ { "asm", kindMappingAsm },
+ { "s", kindMappingAsm },
+ { "S", kindMappingAsm },
+ { "asp", kindMappingAsp },
+ { "asa", kindMappingAsp },
+ { "awk", kindMappingAwk },
+ { "c++", kindMappingC },
+ { "cc", kindMappingC },
+ { "cp" , kindMappingC },
+ { "cpp", kindMappingC },
+ { "cxx", kindMappingC },
+ { "h" , kindMappingC },
+ { "h++", kindMappingC },
+ { "hh" , kindMappingC },
+ { "hp" , kindMappingC },
+ { "hpp", kindMappingC },
+ { "hxx", kindMappingC },
+ { "beta", kindMappingBeta },
+ { "cob", kindMappingCobol },
+ { "COB", kindMappingCobol },
+ { "e", kindMappingEiffel },
+ { "f" , kindMappingFortran },
+ { "for" , kindMappingFortran },
+ { "ftn" , kindMappingFortran },
+ { "f77" , kindMappingFortran },
+ { "f90" , kindMappingFortran },
+ { "f95" , kindMappingFortran },
+ { "java", kindMappingJava },
+ { "cl", kindMappingLisp },
+ { "clisp", kindMappingLisp },
+ { "el", kindMappingLisp },
+ { "l", kindMappingLisp },
+ { "lisp", kindMappingLisp },
+ { "lsp", kindMappingLisp },
+ { "ml", kindMappingLisp },
+ { "mak", kindMappingMake },
+ { "p", kindMappingPascal },
+ { "pas", kindMappingPascal },
+ { "pl", kindMappingPerl },
+ { "pm", kindMappingPerl },
+ { "perl", kindMappingPerl },
+ { "php", kindMappingPHP },
+ { "php3", kindMappingPHP },
+ { "phtml", kindMappingPHP },
+ { "py", kindMappingPython },
+ { "python", kindMappingPython },
+ { "cmd", kindMappingRexx },
+ { "rexx", kindMappingRexx },
+ { "rx", kindMappingRexx },
+ { "rb", kindMappingRuby },
+ { "sch", kindMappingScheme },
+ { "scheme", kindMappingScheme },
+ { "scm", kindMappingScheme },
+ { "sm", kindMappingScheme },
+ { "SCM", kindMappingScheme },
+ { "SM", kindMappingScheme },
+ { "sh", kindMappingSh },
+ { "SH", kindMappingSh },
+ { "bsh", kindMappingSh },
+ { "bash", kindMappingSh },
+ { "ksh", kindMappingSh },
+ { "zsh", kindMappingSh },
+ { "sl", kindMappingSlang },
+ { "tcl", kindMappingTcl },
+ { "wish", kindMappingTcl },
+ { "vim", kindMappingVim },
+ { 0 , 0 }
+};
+
+
+static CTagsKindMapping *findKindMapping(const QString &extension)
+{
+ const char *pextension = extension.latin1();
+
+ CTagsExtensionMapping *pem = extensionMapping;
+ while (pem->extension != 0) {
+ if (strcmp(pem->extension, pextension) == 0)
+ return pem->kinds;
+ ++pem;
+ }
+
+ return 0;
+}
+
+
+QString CTagsKinds::findKind( const char * kindChar, const QString &extension )
+{
+ if ( kindChar == 0 ) return QString::null;
+
+ CTagsKindMapping *kindMapping = findKindMapping(extension);
+ if (kindMapping) {
+ CTagsKindMapping *pkm = kindMapping;
+ while (pkm->verbose != 0) {
+ if (pkm->abbrev == *kindChar)
+ return i18n(pkm->verbose);
+ ++pkm;
+ }
+ }
+
+ return QString::null;
+}
diff --git a/parts/ctags2/ctagskinds.h b/parts/ctags2/ctagskinds.h
new file mode 100644
index 00000000..de695319
--- /dev/null
+++ b/parts/ctags2/ctagskinds.h
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CTAGSKINDS_H_
+#define _CTAGSKINDS_H_
+
+#include <qstring.h>
+
+
+class CTagsKinds
+{
+public:
+ static QString findKind( const char * kindChar, const QString &extension);
+};
+
+#endif
diff --git a/parts/ctags2/kdevctags2.desktop b/parts/ctags2/kdevctags2.desktop
new file mode 100644
index 00000000..a63d45de
--- /dev/null
+++ b/parts/ctags2/kdevctags2.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Icon=kdevelop
+Comment=CTags is a source navigation tool with support for many languages. When loaded it provides a context menu for finding type declarations/definitions and also a query dialog. http://ctags.sourceforge.net/
+Comment[ca]=CTags és una eina de navegació de codi font amb suport per a diversos llenguatges. En carregar-se proporciona un menú de context per a localitzar les declaracions/definicions de tipus i també un diàleg de consultes. http://ctags.sourceforge.net/
+Comment[da]=CTags er et kildenavigationsværktøj med støtte for mange sprog. Når det er indlæst sørger det for en sammenhængsmenu til at finde type-deklarationer/definitioner og også en forespørgselsdialog. http://ctags.sourceforge.net/
+Comment[de]=CTags ist ein Navigationswerkzeug, das viele Sprachen unterstützt. Ist es geladen, bietet es ein Kontextmenü zum Suchen von Typ-Deklarationen und -Definitionen und einen Abfragedialog im Menü "Werkzeuge". http://ctags.sourceforge.net/
+Comment[el]=Το CTags είναι ένα εργαλείο πλοήγησης κώδικα με υποστήριξη πολλών γλωσσών. Όταν φορτωθεί προσφέρει ένα σχετικό μενού εύρεσης δηλώσεων/ορισμών τύπων και ένα διάλογο αναζήτησης. http://ctags.sourceforge.net/
+Comment[en_GB]=CTags is a source navigation tool with support for many languages. When loaded it provides a context menu for finding type declarations/definitions and also a query dialogue. http://ctags.sourceforge.net/
+Comment[es]=CTags es una herramienta de navegación del código fuente con soporte para varios lenguajes. Al cargarse, proporciona un menú contextual para localizar las declaraciones/definiciones de tipos y también un diálogo de consultas. http://ctags.sourceforge.net/
+Comment[et]=CTags on liikumisvahend paljude keelte toega. Laadimisel pakub see kontekstimenüüd deklaratsioonide/definitsioonide tüübi leidmiseks, samuti päringudialoogi tööriistade menüü vahendusel. Vaata internetis http://ctags.sourceforge.net/
+Comment[eu]=CTags hizkuntza askotako euskarria duen iturburu nabigazio tresna bat da. Kargatzean mota deklarazio/definizioak aurkitzeko testuinguru menu bat eskeintzen du eta baita kontsulta elkarrizketa-koadro bat ere Tresnak menuan.http://ctags.sourceforge.net/
+Comment[fa]=CTags یک ابزار ناوش منبع با پشتیبانی از زبانهای زیادی است. در هنگام بارگذاری، یک گزینگان متن برای یافتن تعاریف/اعلانهای نوع و همچنین یک محاورۀ پرس‌وجو فراهم می‌کند. http://ctags.sourceforge.net/
+Comment[fr]=CTags est un outil de navigation dans les sources comprenant une prise en charge pour de nombreux langages. Une fois chargé, il fournit un menu contextuel pour la recherche de déclarations / définitions de types, ainsi qu'une boîte de dialogue de requête. http://ctags.sourceforge.net/
+Comment[gl]=CTags é unha ferramenta para a navegación de código con soporte para moitas linguaxes. Cando se carga proporciona un menú contextual para atopar declaracións/definicións de tipos e tamén un diálogo de peticións. http://ctags.sourceforge.net/
+Comment[hu]=A CTags egy többféle nyelvet is támogató forrásnavigációs eszköz. Lehetővé teszi felbukkanó menüből típusdeklarációk és -megvalósítások keresését, lekérdezését. http://ctags.sourceforge.net/
+Comment[it]=CTags è uno strumento per la navigazione nel codice sorgente con supporto per molti linguaggi. Quando caricato offre un menu contestuale per ricercare i tipi di dichiarazioni/definizioni e anche una finestra per compiere interrogazioni. http://ctags.sourceforge.net/
+Comment[ja]=CTags は色々な言語をサポートしたソースナビゲーションツールです。読み込まれると、型の宣言や定義を見つけたり、ツールメニューの中で対話的な問い合わせを行うコンテキストメニューを提供します。http://ctags.sourceforge.net/
+Comment[ms]=CTags adalah alatan pengemudi sumber dengan sokongan untuk banyak bahasa. Apabila dimuatkan ia menyediakan menu konteks untuk mencari pengisytiharan/definisi dan juga dialog pertanyaan. http://ctags.sourceforge.net/
+Comment[nds]=CTags is en Navigatschoonwarktüüch, wat vele Spraken ünnerstütt. Wenn dat laadt is, stellt dat en Rechtsklickmenü för't Söken na Typ-Deklaratschonen un -Definitschonen praat, un ok noch en Affraagdialoog. http://ctags.sourceforge.net/
+Comment[ne]=CTags स्रोत नेभिगेसन उपकरण हो जसले धेरै भाषा समर्थन गर्दछ । लोड गरेपछि यसले टाइप घोषणा/परिभाषा र क्वेरी संवाद पनि फेला पार्नका लागि प्रसङ्ग मेनु प्रदान गर्दछ । http://ctags.sourceforge.net/
+Comment[nl]=CTags is een krachtige tool voor het navigeren in broncode met ondersteuning voor veel talen. Wanneer de plugin geladen is biedt deze een contextmenu voor het vinden van typedeclaraties, en ook een ondervragingsdialoog. Web: http://ctags.sourceforge.net/
+Comment[pl]=CTags to narzędzie do nawigacji w kodzie źródłowym obsługujące wiele języków. Po wczytaniu udostępnia menu kontekstowe pozwalające znajdować deklaracje/definicje oraz okno dialogowe w menu Narzędzia. http://ctags.sourceforge.net/
+Comment[pt]=O CTags é uma ferramenta de navegação no código com suporte para várias linguagens. Quando é carregado, oferece um menu de contexto para encontrar as declarações/definições de tipos, assim como uma janela de pesquisa. http://ctags.sourceforge.net/
+Comment[pt_BR]=CTags é uma ferramenta de navegação de código com suporte para muitas linguagens. Quando carregada ela oferece um menu de contexto para encontrar declarações/definições de tipo e também um diálogo de consulta no menu Ferramentas. http://ctags.sourceforge.net/
+Comment[ru]=CTags - это средство навигации по коду, поддерживающее многие языки. Будучи загружено, оно предоставляет контекстное меню для нахождения описания и определения типа выбранного символа, а также диалог запроса. http://ctags.sourceforge.net/
+Comment[sk]=CTags je navigačný nástroj pre zdrojový kód pre veľa jazykov.Po načítaní poskytuje kontextové menu pre hľadanie deklarácie/definície a tiež vyhľadávací dialóg. http://ctags.sourceforge.net/
+Comment[sr]=CTags је алат за навигацију кроз изворни кôд са подршком за многе језике. Када је учитан, обезбеђује контекстни мени за проналажење декларација/дефиниција типова, а такође и дијалог за упите. http://ctags.sourceforge.net/
+Comment[sr@Latn]=CTags je alat za navigaciju kroz izvorni kôd sa podrškom za mnoge jezike. Kada je učitan, obezbeđuje kontekstni meni za pronalaženje deklaracija/definicija tipova, a takođe i dijalog za upite. http://ctags.sourceforge.net/
+Comment[sv]=Ctags är ett verktyg för källkodsnavigering med stöd för många språk. När det laddats tillhandahåller det en sammanhangsberoende meny för att hitta typdeklarationer eller definitioner, och dessutom en frågedialogruta. http://ctags.sourceforge.net/
+Comment[ta]=Cதத்தல்கள் இது ஒரு மூல வழி செலுத்தும் கருவி இது நிறைய மொழிகளை ஆதரிக்கும். ஏற்றும் பொழுது எழுத்து உருவை காண உதவும் ஒரு பட்டியலும் மற்றும் கருவிப்பட்டியலில் கேள்வி உரையாடல்களும் இது அளிக்கும்.http://ctags.sourceforge.net/
+Comment[tg]=CTags-ин воситаи навигадсия дар код мебошад, ки бисёр забонҳоро дастрасӣ менамояд. Ҳангоми пурбор намудан, вай менюи қаринагинро пешниҳод менамояд, барои ёфтани тасвир ва муаян сохтани намуди нишонаҳои интихоб карда шуда ва боз гуфтугӯи дархостро мегузорад. http://ctags.sourceforge.net/
+Comment[tr]=CTags birçok dili destekleyen bir kaynak dolaşım aracıdır. Yüklendiğinde tip tanımlamalarını bulmayı sağlayan bir bağlam menüsü ve bir sorgu penceresi sunar.
+Comment[zh_CN]=CTags 是一个支持多种语言源文件浏览的工具。启动后在上下文菜单中提供查找类型的声明/定义,并在工具菜单中提供查询对话框。http://ctags.sourceforge.net/
+Comment[zh_TW]=CTags 是支援許多種語言的程式源碼導覽工具。它載入後會提供一個選單,尋找型態的宣告、定義,並提供一個查詢對話框。http://ctags.sourceforge.net/
+Name=KDevCTags2
+Name[da]=KDevelop CTags2
+Name[nds]=KDevelop-CTags2
+Name[sk]=KDev CTags2
+Name[sv]=KDevelop ctags-2
+Name[tg]=KDevCТегҳо2
+Name[zh_TW]=KDevelop CTags2
+GenericName=CTags Frontend
+GenericName[ca]=Entorn per a CTags
+GenericName[da]=CTags-grænseflade
+GenericName[de]=Unterstützung für CTags
+GenericName[el]=Πρόγραμμα CTags
+GenericName[es]=Entorno de CTags
+GenericName[et]=CTagsi kasutajaliides
+GenericName[eu]=CTags interfazea
+GenericName[fa]=پایانۀ CTags
+GenericName[fr]=Interface pour CTags
+GenericName[ga]=Comhéadan CTags
+GenericName[gl]=Frontal para CTags
+GenericName[hi]=सी-टैग्स-फ्रन्टएन्ड
+GenericName[hu]=CTags-kezelő
+GenericName[it]=Interfaccia a CTags
+GenericName[ja]=CTags フロントエンド
+GenericName[ms]=Antaradepan CTags
+GenericName[nds]=CTags-Böversiet
+GenericName[ne]=CTags फ्रेन्टइन्ड
+GenericName[nl]=Frontend voor CTags
+GenericName[pl]=Interfejs do CTags
+GenericName[pt]=Interface de CTags
+GenericName[pt_BR]=Interface do CTags
+GenericName[ru]=Интерфейс к CTags
+GenericName[sk]=CTags rozhranie
+GenericName[sl]=Vmesnik za CTags
+GenericName[sr]=Интерфејс CTags-а
+GenericName[sr@Latn]=Interfejs CTags-a
+GenericName[sv]=Ctags-gränssnitt
+GenericName[ta]=CTags முன்பகுதி
+GenericName[tg]=Интерфейс дар CTags
+GenericName[tr]=CTags Önucu
+GenericName[zh_CN]=CTags前端
+GenericName[zh_TW]=CTags 前端介面
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Project
+X-KDE-Library=libkdevctags2
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeNavigation
diff --git a/parts/ctags2/kdevpart_ctags2.rc b/parts/ctags2/kdevpart_ctags2.rc
new file mode 100644
index 00000000..e8745b3b
--- /dev/null
+++ b/parts/ctags2/kdevpart_ctags2.rc
@@ -0,0 +1,12 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="ctags" library="libkdevctags2" version="3">
+ <MenuBar>
+ </MenuBar>
+ <Menu name="hidden">
+ <Action name="ctags_lookup_shortcut"/>
+ <Action name="ctags_declaration_shortcut"/>
+ <Action name="ctags_definition_shortcut"/>
+ <Action name="ctags_jump_to_next"/>
+ <Action name="ctags_input_shortcut"/>
+ </Menu>
+</kpartplugin>
diff --git a/parts/ctags2/readtags.c b/parts/ctags2/readtags.c
new file mode 100644
index 00000000..38014d3f
--- /dev/null
+++ b/parts/ctags2/readtags.c
@@ -0,0 +1,960 @@
+/*
+*
+* Copyright (c) 1996-2003, Darren Hiebert
+*
+* This source code is released into the public domain.
+*
+* This module contains functions for reading tag files.
+*/
+
+/*
+* INCLUDE FILES
+*/
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h> /* to declare off_t */
+
+#include "readtags.h"
+
+/*
+* MACROS
+*/
+#define TAB '\t'
+
+
+/*
+* DATA DECLARATIONS
+*/
+typedef struct {
+ size_t size;
+ char *buffer;
+} vstring;
+
+/* Information about current tag file */
+struct sTagFile {
+ /* has the file been opened and this structure initialized? */
+ short initialized;
+ /* format of tag file */
+ short format;
+ /* how is the tag file sorted? */
+ sortType sortMethod;
+ /* pointer to file structure */
+ FILE* fp;
+ /* file position of first character of `line' */
+ off_t pos;
+ /* size of tag file in seekable positions */
+ off_t size;
+ /* last line read */
+ vstring line;
+ /* name of tag in last line read */
+ vstring name;
+ /* defines tag search state */
+ struct {
+ /* file position of last match for tag */
+ off_t pos;
+ /* name of tag last searched for */
+ const char *name;
+ /* length of name for partial matches */
+ size_t nameLength;
+ /* peforming partial match */
+ short partial;
+ /* ignoring case */
+ short ignorecase;
+ } search;
+ /* miscellaneous extension fields */
+ struct {
+ /* number of entries in `list' */
+ unsigned short max;
+ /* list of key value pairs */
+ tagExtensionField *list;
+ } fields;
+ /* buffers to be freed at close */
+ struct {
+ /* name of program author */
+ char *author;
+ /* name of program */
+ char *name;
+ /* URL of distribution */
+ char *url;
+ /* program version */
+ char *version;
+ } program;
+};
+
+/*
+* DATA DEFINITIONS
+*/
+const char *const EmptyString = "";
+const char *const PseudoTagPrefix = "!_";
+
+/*
+* FUNCTION DEFINITIONS
+*/
+
+/*
+ * Compare two strings, ignoring case.
+ * Return 0 for match, < 0 for smaller, > 0 for bigger
+ * Make sure case is folded to uppercase in comparison (like for 'sort -f')
+ * This makes a difference when one of the chars lies between upper and lower
+ * ie. one of the chars [ \ ] ^ _ ` for ascii. (The '_' in particular !)
+ */
+static int struppercmp (const char *s1, const char *s2)
+{
+ int result;
+ do
+ {
+ result = toupper ((int) *s1) - toupper ((int) *s2);
+ } while (result == 0 && *s1++ != '\0' && *s2++ != '\0');
+ return result;
+}
+
+static int strnuppercmp (const char *s1, const char *s2, size_t n)
+{
+ int result;
+ do
+ {
+ result = toupper ((int) *s1) - toupper ((int) *s2);
+ } while (result == 0 && --n > 0 && *s1++ != '\0' && *s2++ != '\0');
+ return result;
+}
+
+static int growString (vstring *s)
+{
+ int result = 0;
+ size_t newLength;
+ char *newLine;
+ if (s->size == 0)
+ {
+ newLength = 128;
+ newLine = (char*) malloc (newLength);
+ *newLine = '\0';
+ }
+ else
+ {
+ newLength = 2 * s->size;
+ newLine = (char*) realloc (s->buffer, newLength);
+ }
+ if (newLine == NULL)
+ perror ("string too large");
+ else
+ {
+ s->buffer = newLine;
+ s->size = newLength;
+ result = 1;
+ }
+ return result;
+}
+
+/* Copy name of tag out of tag line */
+static void copyName (tagFile *const file)
+{
+ size_t length;
+ const char *end = strchr (file->line.buffer, '\t');
+ if (end == NULL)
+ {
+ end = strchr (file->line.buffer, '\n');
+ if (end == NULL)
+ end = strchr (file->line.buffer, '\r');
+ }
+ if (end != NULL)
+ length = end - file->line.buffer;
+ else
+ length = strlen (file->line.buffer);
+ while (length >= file->name.size)
+ growString (&file->name);
+ strncpy (file->name.buffer, file->line.buffer, length);
+ file->name.buffer [length] = '\0';
+}
+
+static int readTagLineRaw (tagFile *const file)
+{
+ int result = 1;
+ int reReadLine;
+
+ /* If reading the line places any character other than a null or a
+ * newline at the last character position in the buffer (one less than
+ * the buffer size), then we must resize the buffer and reattempt to read
+ * the line.
+ */
+ do
+ {
+ char *const pLastChar = file->line.buffer + file->line.size - 2;
+ char *line;
+
+ file->pos = ftell (file->fp);
+ reReadLine = 0;
+ *pLastChar = '\0';
+ line = fgets (file->line.buffer, (int) file->line.size, file->fp);
+ if (line == NULL)
+ {
+ /* read error */
+ if (! feof (file->fp))
+ perror ("readTagLine");
+ result = 0;
+ }
+ else if (*pLastChar != '\0' &&
+ *pLastChar != '\n' && *pLastChar != '\r')
+ {
+ /* buffer overflow */
+ growString (&file->line);
+ fseek (file->fp, file->pos, SEEK_SET);
+ reReadLine = 1;
+ }
+ else
+ {
+ size_t i = strlen (file->line.buffer);
+ while (i > 0 &&
+ (file->line.buffer [i - 1] == '\n' || file->line.buffer [i - 1] == '\r'))
+ {
+ file->line.buffer [i - 1] = '\0';
+ --i;
+ }
+ }
+ } while (reReadLine && result);
+ if (result)
+ copyName (file);
+ return result;
+}
+
+static int readTagLine (tagFile *const file)
+{
+ int result;
+ do
+ {
+ result = readTagLineRaw (file);
+ } while (result && *file->name.buffer == '\0');
+ return result;
+}
+
+static tagResult growFields (tagFile *const file)
+{
+ tagResult result = TagFailure;
+ unsigned short newCount = 2 * file->fields.max;
+ tagExtensionField *newFields = (tagExtensionField*)
+ realloc (file->fields.list, newCount * sizeof (tagExtensionField));
+ if (newFields == NULL)
+ perror ("too many extension fields");
+ else
+ {
+ file->fields.list = newFields;
+ file->fields.max = newCount;
+ result = TagSuccess;
+ }
+ return result;
+}
+
+static void parseExtensionFields (tagFile *const file, tagEntry *const entry,
+ char *const string)
+{
+ char *p = string;
+ while (p != NULL && *p != '\0')
+ {
+ while (*p == TAB)
+ *p++ = '\0';
+ if (*p != '\0')
+ {
+ char *colon;
+ char *field = p;
+ p = strchr (p, TAB);
+ if (p != NULL)
+ *p++ = '\0';
+ colon = strchr (field, ':');
+ if (colon == NULL)
+ entry->kind = field;
+ else
+ {
+ const char *key = field;
+ const char *value = colon + 1;
+ *colon = '\0';
+ if (strcmp (key, "kind") == 0)
+ entry->kind = value;
+ else if (strcmp (key, "file") == 0)
+ entry->fileScope = 1;
+ else if (strcmp (key, "line") == 0)
+ entry->address.lineNumber = atol (value);
+ else
+ {
+ if (entry->fields.count == file->fields.max)
+ growFields (file);
+ file->fields.list [entry->fields.count].key = key;
+ file->fields.list [entry->fields.count].value = value;
+ ++entry->fields.count;
+ }
+ }
+ }
+ }
+}
+
+static void parseTagLine (tagFile *file, tagEntry *const entry)
+{
+ int i;
+ char *p = file->line.buffer;
+ char *tab = strchr (p, TAB);
+ int fieldsPresent = 0;
+
+ entry->fields.list = NULL;
+ entry->fields.count = 0;
+ entry->kind = NULL;
+ entry->fileScope = 0;
+
+ entry->name = p;
+ if (tab != NULL)
+ {
+ *tab = '\0';
+ p = tab + 1;
+ entry->file = p;
+ tab = strchr (p, TAB);
+ if (tab != NULL)
+ {
+ *tab = '\0';
+ p = tab + 1;
+ if (*p == '/' || *p == '?')
+ {
+ /* parse pattern */
+ int delimiter = *(unsigned char*) p;
+ entry->address.lineNumber = 0;
+ entry->address.pattern = p;
+ do
+ {
+ p = strchr (p + 1, delimiter);
+ } while (p != NULL && *(p - 1) == '\\');
+ if (p == NULL)
+ {
+ /* invalid pattern */
+ }
+ else
+ ++p;
+ }
+ else if (isdigit ((int) *(unsigned char*) p))
+ {
+ /* parse line number */
+ entry->address.pattern = p;
+ entry->address.lineNumber = atol (p);
+ while (isdigit ((int) *(unsigned char*) p))
+ ++p;
+ }
+ else
+ {
+ /* invalid pattern */
+ }
+ if ( p != NULL )
+ {
+ fieldsPresent = (strncmp (p, ";\"", 2) == 0);
+ *p = '\0';
+ if (fieldsPresent)
+ parseExtensionFields (file, entry, p + 2);
+ }
+ }
+ }
+ if (entry->fields.count > 0)
+ entry->fields.list = file->fields.list;
+ for (i = entry->fields.count ; i < file->fields.max ; ++i)
+ {
+ file->fields.list [i].key = NULL;
+ file->fields.list [i].value = NULL;
+ }
+}
+
+static char *duplicate (const char *str)
+{
+ char *result = NULL;
+ if (str != NULL)
+ {
+ result = (char*) malloc (strlen (str) + 1);
+ if (result == NULL)
+ perror (NULL);
+ else
+ strcpy (result, str);
+ }
+ return result;
+}
+
+static void readPseudoTags (tagFile *const file, tagFileInfo *const info)
+{
+ fpos_t startOfLine;
+ const size_t prefixLength = strlen (PseudoTagPrefix);
+ if (info != NULL)
+ {
+ info->file.format = 1;
+ info->file.sort = TAG_UNSORTED;
+ info->program.author = NULL;
+ info->program.name = NULL;
+ info->program.url = NULL;
+ info->program.version = NULL;
+ }
+ while (1)
+ {
+ fgetpos (file->fp, &startOfLine);
+ if (! readTagLine (file))
+ break;
+ if (strncmp (file->line.buffer, PseudoTagPrefix, prefixLength) != 0)
+ break;
+ else
+ {
+ tagEntry entry;
+ const char *key, *value;
+ parseTagLine (file, &entry);
+ key = entry.name + prefixLength;
+ value = entry.file;
+ if (strcmp (key, "TAG_FILE_SORTED") == 0)
+ file->sortMethod = (sortType) atoi (value);
+ else if (strcmp (key, "TAG_FILE_FORMAT") == 0)
+ file->format = atoi (value);
+ else if (strcmp (key, "TAG_PROGRAM_AUTHOR") == 0)
+ file->program.author = duplicate (value);
+ else if (strcmp (key, "TAG_PROGRAM_NAME") == 0)
+ file->program.name = duplicate (value);
+ else if (strcmp (key, "TAG_PROGRAM_URL") == 0)
+ file->program.url = duplicate (value);
+ else if (strcmp (key, "TAG_PROGRAM_VERSION") == 0)
+ file->program.version = duplicate (value);
+ if (info != NULL)
+ {
+ info->file.format = file->format;
+ info->file.sort = file->sortMethod;
+ info->program.author = file->program.author;
+ info->program.name = file->program.name;
+ info->program.url = file->program.url;
+ info->program.version = file->program.version;
+ }
+ }
+ }
+ fsetpos (file->fp, &startOfLine);
+}
+
+static void gotoFirstLogicalTag (tagFile *const file)
+{
+ fpos_t startOfLine;
+ const size_t prefixLength = strlen (PseudoTagPrefix);
+ rewind (file->fp);
+ while (1)
+ {
+ fgetpos (file->fp, &startOfLine);
+ if (! readTagLine (file))
+ break;
+ if (strncmp (file->line.buffer, PseudoTagPrefix, prefixLength) != 0)
+ break;
+ }
+ fsetpos (file->fp, &startOfLine);
+}
+
+static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
+{
+ tagFile *result = (tagFile*) malloc (sizeof (tagFile));
+ if (result != NULL)
+ {
+ memset (result, 0, sizeof (tagFile));
+ growString (&result->line);
+ growString (&result->name);
+ result->fields.max = 20;
+ result->fields.list = (tagExtensionField*) malloc (
+ result->fields.max * sizeof (tagExtensionField));
+ result->fp = fopen (filePath, "r");
+ if (result->fp == NULL)
+ {
+ free (result);
+ result = NULL;
+ info->status.error_number = errno;
+ }
+ else
+ {
+ fseek (result->fp, 0, SEEK_END);
+ result->size = ftell (result->fp);
+ rewind (result->fp);
+ readPseudoTags (result, info);
+ info->status.opened = 1;
+ result->initialized = 1;
+ }
+ }
+ return result;
+}
+
+static void terminate (tagFile *const file)
+{
+ fclose (file->fp);
+
+ free (file->line.buffer);
+ free (file->name.buffer);
+ free (file->fields.list);
+
+ if (file->program.author != NULL)
+ free (file->program.author);
+ if (file->program.name != NULL)
+ free (file->program.name);
+ if (file->program.url != NULL)
+ free (file->program.url);
+ if (file->program.version != NULL)
+ free (file->program.version);
+
+ memset (file, 0, sizeof (tagFile));
+
+ free (file);
+}
+
+static tagResult readNext (tagFile *const file, tagEntry *const entry)
+{
+ tagResult result = TagFailure;
+ if (file == NULL || ! file->initialized)
+ result = TagFailure;
+ else if (! readTagLine (file))
+ result = TagFailure;
+ else
+ {
+ if (entry != NULL)
+ parseTagLine (file, entry);
+ result = TagSuccess;
+ }
+ return result;
+}
+
+static const char *readFieldValue (
+ const tagEntry *const entry, const char *const key)
+{
+ const char *result = NULL;
+ int i;
+ if (strcmp (key, "kind") == 0)
+ result = entry->kind;
+ else if (strcmp (key, "file") == 0)
+ result = EmptyString;
+ else for (i = 0 ; i < entry->fields.count && result == NULL ; ++i)
+ if (strcmp (entry->fields.list [i].key, key) == 0)
+ result = entry->fields.list [i].value;
+ return result;
+}
+
+static int readTagLineSeek (tagFile *const file, const off_t pos)
+{
+ int result = 0;
+ if (fseek (file->fp, pos, SEEK_SET) == 0)
+ {
+ result = readTagLine (file); /* read probable partial line */
+ if (pos > 0 && result)
+ result = readTagLine (file); /* read complete line */
+ }
+ return result;
+}
+
+static int nameComparison (tagFile *const file)
+{
+ int result;
+ if (file->search.ignorecase)
+ {
+ if (file->search.partial)
+ result = strnuppercmp (file->search.name, file->name.buffer,
+ file->search.nameLength);
+ else
+ result = struppercmp (file->search.name, file->name.buffer);
+ }
+ else
+ {
+ if (file->search.partial)
+ result = strncmp (file->search.name, file->name.buffer,
+ file->search.nameLength);
+ else
+ result = strcmp (file->search.name, file->name.buffer);
+ }
+ return result;
+}
+
+static void findFirstNonMatchBefore (tagFile *const file)
+{
+#define JUMP_BACK 512
+ int more_lines;
+ int comp;
+ off_t start = file->pos;
+ off_t pos = start;
+ do
+ {
+ if (pos < (off_t) JUMP_BACK)
+ pos = 0;
+ else
+ pos = pos - JUMP_BACK;
+ more_lines = readTagLineSeek (file, pos);
+ comp = nameComparison (file);
+ } while (more_lines && comp == 0 && pos > 0 && pos < start);
+}
+
+static tagResult findFirstMatchBefore (tagFile *const file)
+{
+ tagResult result = TagFailure;
+ int more_lines;
+ off_t start = file->pos;
+ findFirstNonMatchBefore (file);
+ do
+ {
+ more_lines = readTagLine (file);
+ if (nameComparison (file) == 0)
+ result = TagSuccess;
+ } while (more_lines && result != TagSuccess && file->pos < start);
+ return result;
+}
+
+static tagResult findBinary (tagFile *const file)
+{
+ tagResult result = TagFailure;
+ off_t lower_limit = 0;
+ off_t upper_limit = file->size;
+ off_t last_pos = 0;
+ off_t pos = upper_limit / 2;
+ while (result != TagSuccess)
+ {
+ if (! readTagLineSeek (file, pos))
+ {
+ /* in case we fell off end of file */
+ result = findFirstMatchBefore (file);
+ break;
+ }
+ else if (pos == last_pos)
+ {
+ /* prevent infinite loop if we backed up to beginning of file */
+ break;
+ }
+ else
+ {
+ const int comp = nameComparison (file);
+ last_pos = pos;
+ if (comp < 0)
+ {
+ upper_limit = pos;
+ pos = lower_limit + ((upper_limit - lower_limit) / 2);
+ }
+ else if (comp > 0)
+ {
+ lower_limit = pos;
+ pos = lower_limit + ((upper_limit - lower_limit) / 2);
+ }
+ else if (pos == 0)
+ result = TagSuccess;
+ else
+ result = findFirstMatchBefore (file);
+ }
+ }
+ return result;
+}
+
+static tagResult findSequential (tagFile *const file)
+{
+ tagResult result = TagFailure;
+ if (file->initialized)
+ {
+ while (result == TagFailure && readTagLine (file))
+ {
+ if (nameComparison (file) == 0)
+ result = TagSuccess;
+ }
+ }
+ return result;
+}
+
+static tagResult find (tagFile *const file, tagEntry *const entry,
+ const char *const name, const int options)
+{
+ tagResult result = TagFailure;
+ file->search.name = name;
+ file->search.nameLength = strlen (name);
+ file->search.partial = (options & TAG_PARTIALMATCH) != 0;
+ file->search.ignorecase = (options & TAG_IGNORECASE) != 0;
+ fseek (file->fp, 0, SEEK_END);
+ file->size = ftell (file->fp);
+ rewind (file->fp);
+ if ((file->sortMethod == TAG_SORTED && !file->search.ignorecase) ||
+ (file->sortMethod == TAG_FOLDSORTED && file->search.ignorecase))
+ {
+#ifdef DEBUG
+ printf ("<performing binary search>\n");
+#endif
+ result = findBinary (file);
+ }
+ else
+ {
+#ifdef DEBUG
+ printf ("<performing sequential search>\n");
+#endif
+ result = findSequential (file);
+ }
+
+ if (result != TagSuccess)
+ file->search.pos = file->size;
+ else
+ {
+ file->search.pos = file->pos;
+ if (entry != NULL)
+ parseTagLine (file, entry);
+ }
+ return result;
+}
+
+static tagResult findNext (tagFile *const file, tagEntry *const entry)
+{
+ tagResult result = TagFailure;
+ if ((file->sortMethod == TAG_SORTED && !file->search.ignorecase) ||
+ (file->sortMethod == TAG_FOLDSORTED && file->search.ignorecase))
+ {
+ result = tagsNext (file, entry);
+ if (result == TagSuccess && nameComparison (file) != 0)
+ result = TagFailure;
+ }
+ else
+ {
+ result = findSequential (file);
+ if (result == TagSuccess && entry != NULL)
+ parseTagLine (file, entry);
+ }
+ return result;
+}
+
+/*
+* EXTERNAL INTERFACE
+*/
+
+extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info)
+{
+ return initialize (filePath, info);
+}
+
+extern tagResult tagsSetSortType (tagFile *const file, const sortType type)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ {
+ file->sortMethod = type;
+ result = TagSuccess;
+ }
+ return result;
+}
+
+extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ {
+ gotoFirstLogicalTag (file);
+ result = readNext (file, entry);
+ }
+ return result;
+}
+
+extern tagResult tagsNext (tagFile *const file, tagEntry *const entry)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ result = readNext (file, entry);
+ return result;
+}
+
+extern const char *tagsField (const tagEntry *const entry, const char *const key)
+{
+ const char *result = NULL;
+ if (entry != NULL)
+ result = readFieldValue (entry, key);
+ return result;
+}
+
+extern tagResult tagsFind (tagFile *const file, tagEntry *const entry,
+ const char *const name, const int options)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ result = find (file, entry, name, options);
+ return result;
+}
+
+extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ result = findNext (file, entry);
+ return result;
+}
+
+extern tagResult tagsClose (tagFile *const file)
+{
+ tagResult result = TagFailure;
+ if (file != NULL && file->initialized)
+ {
+ terminate (file);
+ result = TagSuccess;
+ }
+ return result;
+}
+
+/*
+* TEST FRAMEWORK
+*/
+
+#ifdef READTAGS_MAIN
+
+static const char *TagFileName = "tags";
+static const char *ProgramName;
+static int extensionFields;
+static int SortOverride;
+static sortType SortMethod;
+
+static void printTag (const tagEntry *entry)
+{
+ int i;
+ int first = 1;
+ const char* separator = ";\"";
+ const char* const empty = "";
+/* "sep" returns a value only the first time it is evaluated */
+#define sep (first ? (first = 0, separator) : empty)
+ printf ("%s\t%s\t%s",
+ entry->name, entry->file, entry->address.pattern);
+ if (extensionFields)
+ {
+ if (entry->kind != NULL && entry->kind [0] != '\0')
+ printf ("%s\tkind:%s", sep, entry->kind);
+ if (entry->fileScope)
+ printf ("%s\tfile:", sep);
+#if 0
+ if (entry->address.lineNumber > 0)
+ printf ("%s\tline:%lu", sep, entry->address.lineNumber);
+#endif
+ for (i = 0 ; i < entry->fields.count ; ++i)
+ printf ("%s\t%s:%s", sep, entry->fields.list [i].key,
+ entry->fields.list [i].value);
+ }
+ putchar ('\n');
+#undef sep
+}
+
+static void findTag (const char *const name, const int options)
+{
+ tagFileInfo info;
+ tagEntry entry;
+ tagFile *const file = tagsOpen (TagFileName, &info);
+ if (file == NULL)
+ {
+ fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
+ ProgramName, strerror (info.status.error_number), name);
+ exit (1);
+ }
+ else
+ {
+ if (SortOverride)
+ tagsSetSortType (file, SortMethod);
+ if (tagsFind (file, &entry, name, options) == TagSuccess)
+ {
+ do
+ {
+ printTag (&entry);
+ } while (tagsFindNext (file, &entry) == TagSuccess);
+ }
+ tagsClose (file);
+ }
+}
+
+static void listTags (void)
+{
+ tagFileInfo info;
+ tagEntry entry;
+ tagFile *const file = tagsOpen (TagFileName, &info);
+ if (file == NULL)
+ {
+ fprintf (stderr, "%s: cannot open tag file: %s: %s\n",
+ ProgramName, strerror (info.status.error_number), TagFileName);
+ exit (1);
+ }
+ else
+ {
+ while (tagsNext (file, &entry) == TagSuccess)
+ printTag (&entry);
+ tagsClose (file);
+ }
+}
+
+const char *const Usage =
+ "Find tag file entries matching specified names.\n\n"
+ "Usage: %s [-ilp] [-s[0|1]] [-t file] [name(s)]\n\n"
+ "Options:\n"
+ " -e Include extension fields in output.\n"
+ " -i Perform case-insensitive matching.\n"
+ " -l List all tags.\n"
+ " -p Perform partial matching.\n"
+ " -s[0|1|2] Override sort detection of tag file.\n"
+ " -t file Use specified tag file (default: \"tags\").\n"
+ "Note that options are acted upon as encountered, so order is significant.\n";
+
+extern int main (int argc, char **argv)
+{
+ int options = 0;
+ int actionSupplied = 0;
+ int i;
+ ProgramName = argv [0];
+ if (argc == 1)
+ {
+ fprintf (stderr, Usage, ProgramName);
+ exit (1);
+ }
+ for (i = 1 ; i < argc ; ++i)
+ {
+ const char *const arg = argv [i];
+ if (arg [0] != '-')
+ {
+ findTag (arg, options);
+ actionSupplied = 1;
+ }
+ else
+ {
+ size_t j;
+ for (j = 1 ; arg [j] != '\0' ; ++j)
+ {
+ switch (arg [j])
+ {
+ case 'e': extensionFields = 1; break;
+ case 'i': options |= TAG_IGNORECASE; break;
+ case 'p': options |= TAG_PARTIALMATCH; break;
+ case 'l': listTags (); actionSupplied = 1; break;
+
+ case 't':
+ if (arg [j+1] != '\0')
+ {
+ TagFileName = arg + j + 1;
+ j += strlen (TagFileName);
+ }
+ else if (i + 1 < argc)
+ TagFileName = argv [++i];
+ else
+ {
+ fprintf (stderr, Usage, ProgramName);
+ exit (1);
+ }
+ break;
+ case 's':
+ SortOverride = 1;
+ ++j;
+ if (arg [j] == '\0')
+ SortMethod = TAG_SORTED;
+ else if (strchr ("012", arg[j]) != NULL)
+ SortMethod = (sortType) (arg[j] - '0');
+ else
+ {
+ fprintf (stderr, Usage, ProgramName);
+ exit (1);
+ }
+ break;
+ default:
+ fprintf (stderr, "%s: unknown option: %c\n",
+ ProgramName, arg[j]);
+ exit (1);
+ break;
+ }
+ }
+ }
+ }
+ if (! actionSupplied)
+ {
+ fprintf (stderr,
+ "%s: no action specified: specify tag name(s) or -l option\n",
+ ProgramName);
+ exit (1);
+ }
+ return 0;
+}
+
+#endif
+
+/* vi:set tabstop=8 shiftwidth=4: */
diff --git a/parts/ctags2/readtags.h b/parts/ctags2/readtags.h
new file mode 100644
index 00000000..4d4228fc
--- /dev/null
+++ b/parts/ctags2/readtags.h
@@ -0,0 +1,251 @@
+/*
+*
+* Copyright (c) 1996-2003, Darren Hiebert
+*
+* This source code is released for the public domain.
+*
+* This file defines the public interface for looking up tag entries in tag
+* files.
+*
+* The functions defined in this interface are intended to provide tag file
+* support to a software tool. The tag lookups provided are sufficiently fast
+* enough to permit opening a sorted tag file, searching for a matching tag,
+* then closing the tag file each time a tag is looked up (search times are
+* on the order of hundreths of a second, even for huge tag files). This is
+* the recommended use of this library for most tool applications. Adhering
+* to this approach permits a user to regenerate a tag file at will without
+* the tool needing to detect and resynchronize with changes to the tag file.
+* Even for an unsorted 24MB tag file, tag searches take about one second.
+*/
+#ifndef READTAGS_H
+#define READTAGS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+* MACROS
+*/
+
+/* Options for tagsSetSortType() */
+typedef enum {
+ TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED
+} sortType ;
+
+/* Options for tagsFind() */
+#define TAG_FULLMATCH 0x0
+#define TAG_PARTIALMATCH 0x1
+
+#define TAG_OBSERVECASE 0x0
+#define TAG_IGNORECASE 0x2
+
+/*
+* DATA DECLARATIONS
+*/
+
+typedef enum { TagFailure = 0, TagSuccess = 1 } tagResult;
+
+struct sTagFile;
+
+typedef struct sTagFile tagFile;
+
+/* This structure contains information about the tag file. */
+typedef struct {
+
+ struct {
+ /* was the tag file successfully opened? */
+ int opened;
+
+ /* errno value when 'opened' is false */
+ int error_number;
+ } status;
+
+ /* information about the structure of the tag file */
+ struct {
+ /* format of tag file (1 = original, 2 = extended) */
+ short format;
+
+ /* how is the tag file sorted? */
+ sortType sort;
+ } file;
+
+
+ /* information about the program which created this tag file */
+ struct {
+ /* name of author of generating program (may be null) */
+ const char *author;
+
+ /* name of program (may be null) */
+ const char *name;
+
+ /* URL of distribution (may be null) */
+ const char *url;
+
+ /* program version (may be null) */
+ const char *version;
+ } program;
+
+} tagFileInfo;
+
+/* This structure contains information about an extension field for a tag.
+ * These exist at the end of the tag in the form "key:value").
+ */
+typedef struct {
+
+ /* the key of the extension field */
+ const char *key;
+
+ /* the value of the extension field (may be an empty string) */
+ const char *value;
+
+} tagExtensionField;
+
+/* This structure contains information about a specific tag. */
+typedef struct {
+
+ /* name of tag */
+ const char *name;
+
+ /* path of source file containing definition of tag */
+ const char *file;
+
+ /* address for locating tag in source file */
+ struct {
+ /* pattern for locating source line
+ * (may be NULL if not present) */
+ const char *pattern;
+
+ /* line number in source file of tag definition
+ * (may be zero if not known) */
+ unsigned long lineNumber;
+ } address;
+
+ /* kind of tag (may by name, character, or NULL if not known) */
+ const char *kind;
+
+ /* is tag of file-limited scope? */
+ short fileScope;
+
+ /* miscellaneous extension fields */
+ struct {
+ /* number of entries in `list' */
+ unsigned short count;
+
+ /* list of key value pairs */
+ tagExtensionField *list;
+ } fields;
+
+} tagEntry;
+
+
+/*
+* FUNCTION PROTOTYPES
+*/
+
+/*
+* This function must be called before calling other functions in this
+* library. It is passed the path to the tag file to read and a (possibly
+* null) pointer to a structure which, if not null, will be populated with
+* information about the tag file. If successful, the function will return a
+* handle which must be supplied to other calls to read information from the
+* tag file, and info.status.opened will be set to true. If unsuccessful,
+* info.status.opened will be set to false and info.status.error_number will
+* be set to the errno value representing the system error preventing the tag
+* file from being successfully opened.
+*/
+extern tagFile *tagsOpen (const char *const filePath, tagFileInfo *const info);
+
+/*
+* This function allows the client to override the normal automatic detection
+* of how a tag file is sorted. Permissible values for `type' are
+* TAG_UNSORTED, TAG_SORTED, TAG_FOLDSORTED. Tag files in the new extended
+* format contain a key indicating whether or not they are sorted. However,
+* tag files in the original format do not contain such a key even when
+* sorted, preventing this library from taking advantage of fast binary
+* lookups. If the client knows that such an unmarked tag file is indeed
+* sorted (or not), it can override the automatic detection. Note that
+* incorrect lookup results will result if a tag file is marked as sorted when
+* it actually is not. The function will return TagSuccess if called on an
+* open tag file or TagFailure if not.
+*/
+extern tagResult tagsSetSortType (tagFile *const file, const sortType type);
+
+/*
+* Reads the first tag in the file, if any. It is passed the handle to an
+* opened tag file and a (possibly null) pointer to a structure which, if not
+* null, will be populated with information about the first tag file entry.
+* The function will return TagSuccess another tag entry is found, or
+* TagFailure if not (i.e. it reached end of file).
+*/
+extern tagResult tagsFirst (tagFile *const file, tagEntry *const entry);
+
+/*
+* Step to the next tag in the file, if any. It is passed the handle to an
+* opened tag file and a (possibly null) pointer to a structure which, if not
+* null, will be populated with information about the next tag file entry. The
+* function will return TagSuccess another tag entry is found, or TagFailure
+* if not (i.e. it reached end of file). It will always read the first tag in
+* the file immediately after calling tagsOpen().
+*/
+extern tagResult tagsNext (tagFile *const file, tagEntry *const entry);
+
+/*
+* Retrieve the value associated with the extension field for a specified key.
+* It is passed a pointer to a structure already populated with values by a
+* previous call to tagsNext(), tagsFind(), or tagsFindNext(), and a string
+* containing the key of the desired extension field. If no such field of the
+* specified key exists, the function will return null.
+*/
+extern const char *tagsField (const tagEntry *const entry, const char *const key);
+
+/*
+* Find the first tag matching `name'. The structure pointed to by `entry'
+* will be populated with information about the tag file entry. If a tag file
+* is sorted using the C locale, a binary search algorithm is used to search
+* the tag file, resulting in very fast tag lookups, even in huge tag files.
+* Various options controlling the matches can be combined by bit-wise or-ing
+* certain values together. The available values are:
+*
+* TAG_PARTIALMATCH
+* Tags whose leading characters match `name' will qualify.
+*
+* TAG_FULLMATCH
+* Only tags whose full lengths match `name' will qualify.
+*
+* TAG_IGNORECASE
+* Matching will be performed in a case-insenstive manner. Note that
+* this disables binary searches of the tag file.
+*
+* TAG_OBSERVECASE
+* Matching will be performed in a case-senstive manner. Note that
+* this enables binary searches of the tag file.
+*
+* The function will return TagSuccess if a tag matching the name is found, or
+* TagFailure if not.
+*/
+extern tagResult tagsFind (tagFile *const file, tagEntry *const entry, const char *const name, const int options);
+
+/*
+* Find the next tag matching the name and options supplied to the most recent
+* call to tagsFind() for the same tag file. The structure pointed to by
+* `entry' will be populated with information about the tag file entry. The
+* function will return TagSuccess if another tag matching the name is found,
+* or TagFailure if not.
+*/
+extern tagResult tagsFindNext (tagFile *const file, tagEntry *const entry);
+
+/*
+* Call tagsTerminate() at completion of reading the tag file, which will
+* close the file and free any internal memory allocated. The function will
+* return TagFailure is no file is currently open, TagSuccess otherwise.
+*/
+extern tagResult tagsClose (tagFile *const file);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* vi:set tabstop=8 shiftwidth=4: */
diff --git a/parts/ctags2/tagitem.cpp b/parts/ctags2/tagitem.cpp
new file mode 100644
index 00000000..e2ddf158
--- /dev/null
+++ b/parts/ctags2/tagitem.cpp
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 "tagitem.h"
+
+TagItem::TagItem( QListView * lv, QString const & tag, QString const & type, QString const & file, QString const & pattern )
+ : QListViewItem( lv ), tag(tag), type(type), file(file), pattern(pattern)
+{}
+
+TagItem::~TagItem()
+{
+}
+
+
+
diff --git a/parts/ctags2/tagitem.h b/parts/ctags2/tagitem.h
new file mode 100644
index 00000000..fddb823d
--- /dev/null
+++ b/parts/ctags2/tagitem.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 TAGITEM_H
+#define TAGITEM_H
+
+#include <qlistview.h>
+
+class TagItem : public QListViewItem
+{
+public:
+ TagItem(QListView * lv, QString const & tag, QString const & type, QString const & file, QString const & pattern );
+ ~TagItem();
+
+ QString tag;
+ QString type;
+ QString file;
+ QString pattern;
+};
+
+#endif
diff --git a/parts/ctags2/tags.cpp b/parts/ctags2/tags.cpp
new file mode 100644
index 00000000..3ba98159
--- /dev/null
+++ b/parts/ctags2/tags.cpp
@@ -0,0 +1,171 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+namespace ctags
+{
+#include "readtags.h"
+}
+
+#include "ctagskinds.h"
+
+#include "tags.h"
+
+QStringList Tags::_tagFiles;
+
+Tags::TagEntry::TagEntry() {}
+
+Tags::TagEntry::TagEntry( const QString & tag, const QString & type, const QString & file, const QString & pattern )
+ : tag(tag), type(type), file(file), pattern(pattern)
+{}
+
+
+bool Tags::hasTag(const QString & tag )
+{
+ QStringList::iterator it;
+ for (it = _tagFiles.begin(); it != _tagFiles.end() ; it++) {
+ if (hasTag((*it).ascii(), tag))
+ return true;
+ }
+
+ return false;
+}
+
+bool Tags::hasTag(const char* tagFile, const QString & tag )
+{
+ ctags::tagFileInfo info;
+ ctags::tagFile * file = ctags::tagsOpen(tagFile, &info );
+ ctags::tagEntry entry;
+
+ bool found = ( ctags::tagsFind( file, &entry, tag.ascii(), TAG_FULLMATCH | TAG_OBSERVECASE ) == ctags::TagSuccess );
+
+ ctags::tagsClose( file );
+
+ return found;
+}
+
+unsigned int Tags::numberOfMatches( const QString & tagpart, bool partial )
+{
+ unsigned int n = 0;
+ QStringList::iterator it;
+ for (it = _tagFiles.begin(); it != _tagFiles.end(); it++)
+ {
+ n += numberOfMatches( (*it).ascii(), tagpart, partial );
+ }
+
+ return n;
+}
+
+unsigned int Tags::numberOfMatches(const char* tagFile, const QString & tagpart, bool partial )
+{
+ unsigned int n = 0;
+
+ if ( tagpart.isEmpty() ) return 0;
+
+ ctags::tagFileInfo info;
+ ctags::tagFile * file = ctags::tagsOpen( tagFile, &info );
+ ctags::tagEntry entry;
+
+ if ( ctags::tagsFind( file, &entry, tagpart.ascii(), TAG_OBSERVECASE | (partial ? TAG_PARTIALMATCH : TAG_FULLMATCH) ) == ctags::TagSuccess )
+ {
+ do
+ {
+ n++;
+ }
+ while ( ctags::tagsFindNext( file, &entry ) == ctags::TagSuccess );
+ }
+
+ ctags::tagsClose( file );
+
+ return n;
+}
+
+
+Tags::TagList Tags::getMatches( const QString & tagpart, bool partial, const QStringList & types )
+{
+ Tags::TagList list;
+
+ // build a compound tag list from all the configured tag files
+ QStringList::iterator it;
+ for ( it = _tagFiles.begin(); it != _tagFiles.end(); it++ )
+ {
+ list += getMatches((*it).ascii(), tagpart, partial, types);
+ }
+
+ return list;
+}
+
+Tags::TagList Tags::getMatches(const char* tagFile, const QString & tagpart, bool partial, const QStringList & types )
+{
+ Tags::TagList list;
+
+ if ( tagpart.isEmpty() ) return list;
+
+ ctags::tagFileInfo info;
+ ctags::tagFile * file = ctags::tagsOpen(tagFile, &info );
+ ctags::tagEntry entry;
+
+ if ( ctags::tagsFind( file, &entry, tagpart.ascii(), TAG_OBSERVECASE | (partial ? TAG_PARTIALMATCH : TAG_FULLMATCH) ) == ctags::TagSuccess )
+ {
+ do
+ {
+ QString type( CTagsKinds::findKind( entry.kind, QString( entry.file ).section( '.', -1 ) ) );
+ QString file( entry.file );
+
+ if ( type.isEmpty() && file.endsWith( "Makefile" ) )
+ {
+ type = "macro";
+ }
+ if ( types.isEmpty() || types.contains( entry.kind ) )
+ {
+ list << TagEntry( QString( entry.name ), type, file, QString( entry.address.pattern ) );
+ }
+ }
+ while ( ctags::tagsFindNext( file, &entry ) == ctags::TagSuccess );
+ }
+
+ ctags::tagsClose( file );
+
+ return list;
+}
+
+void Tags::setTagFiles(const QStringList& tagFiles )
+{
+ _tagFiles = tagFiles;
+}
+
+QStringList Tags::getTagFiles( )
+{
+ return _tagFiles;
+}
+
+unsigned int Tags::numberOfPartialMatches( const QString & tagpart )
+{
+ return numberOfMatches( tagpart, true );
+}
+
+unsigned int Tags::numberOfExactMatches( const QString & tagpart )
+{
+ return numberOfMatches( tagpart, false );
+}
+
+Tags::TagList Tags::getPartialMatches( const QString & tagpart )
+{
+ return getMatches( tagpart, true );
+}
+
+Tags::TagList Tags::getExactMatches( const QString & tag )
+{
+ return getMatches( tag, false );
+}
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
+
+
diff --git a/parts/ctags2/tags.h b/parts/ctags2/tags.h
new file mode 100644
index 00000000..1d7e3604
--- /dev/null
+++ b/parts/ctags2/tags.h
@@ -0,0 +1,74 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 TAGS_H
+#define TAGS_H
+
+#include <qvaluelist.h>
+#include <qcstring.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+class Tags
+{
+public:
+
+ struct TagEntry
+ {
+ TagEntry();
+ TagEntry( const QString & tag, const QString & type, const QString & file, const QString & pattern );
+
+ QString tag;
+ QString type;
+ QString file;
+ QString pattern;
+ };
+
+ typedef QValueList<TagEntry> TagList;
+
+ /**
+ * Method to set the tag database filename
+ * @param file the tag database filename
+ */
+ static void setTagFiles(const QStringList& tagFiles);
+
+ static QStringList getTagFiles();
+
+ /**
+ * Method to check if the tag database contains a specific tag
+ * @param tag Tag to look up
+ * @return returns true if tag database contains 'tag'
+ */
+ static bool hasTag( const QString & tag );
+
+ static unsigned int numberOfPartialMatches( const QString & tagpart );
+ static unsigned int numberOfExactMatches( const QString & tag );
+ static unsigned int numberOfMatches( const QString & tagpart, bool partial );
+
+ static TagList getPartialMatches( const QString & tagpart );
+ static TagList getExactMatches( const QString & tag );
+ static TagList getMatches( const QString & tagpart, bool partial, const QStringList & types = QStringList() );
+
+private:
+ static Tags::TagList getMatches(const char* tagFile,
+ const QString & tagpart,
+ bool partial,
+ const QStringList & types );
+ static unsigned int numberOfMatches(const char* tagFile,
+ const QString & tagpart,
+ bool partial );
+ static bool hasTag(const char* tagFile, const QString & tag );
+ static QStringList _tagFiles;
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/diff/Makefile.am b/parts/diff/Makefile.am
new file mode 100644
index 00000000..300e2deb
--- /dev/null
+++ b/parts/diff/Makefile.am
@@ -0,0 +1,18 @@
+# Here resides the valgrind part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdiff.la
+libkdevdiff_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevdiff_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevdiff_la_SOURCES = diffpart.cpp diffwidget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdiff.desktop
+
+rcdir = $(kde_datadir)/kdevdiff
+rc_DATA = kdevdiff.rc
diff --git a/parts/diff/README b/parts/diff/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/diff/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/diff/README.dox b/parts/diff/README.dox
new file mode 100644
index 00000000..6659ac71
--- /dev/null
+++ b/parts/diff/README.dox
@@ -0,0 +1,20 @@
+/** \class DiffPart
+This DiffPart is an outputview that shows "diffs" between files.
+
+If "kompare" from KDESDK is installed, it'll use
+its widget to display the diff, otherwise
+in a QTextEdit with simple highlighting
+Just right-click on a CVS or Perforce file
+and select "diff to repository" to see it in action.
+
+\authors <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a>
+
+\maintainer <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a>
+
+\feature Shows "diffs" between files
+\feature If "kompare" from KDESDK is installed, it'll use its widget to display the diff otherwise in a QTextEdit with simple highlighting
+\feature Works with all VCS systems supported by KDevelop
+
+\requirement If "kompare" from KDESDK is installed, it'll use its widget to display the diff.
+
+*/
diff --git a/parts/diff/diffdlg.cpp b/parts/diff/diffdlg.cpp
new file mode 100644
index 00000000..049a3d60
--- /dev/null
+++ b/parts/diff/diffdlg.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+
+#include <klocale.h>
+
+#include "diffdlg.h"
+#include "diffwidget.h"
+
+DiffDlg::DiffDlg( QWidget *parent, const char *name ):
+ KDialogBase( parent, name, true, i18n("Difference Viewer"), Ok )
+{
+ diffWidget = new DiffWidget( this, "Main Diff Widget" );
+ setMainWidget( diffWidget );
+
+ QVBoxLayout* layout = new QVBoxLayout( this, 0, spacingHint() );
+ layout->addWidget( diffWidget );
+}
+
+DiffDlg::~DiffDlg()
+{
+}
+
+void DiffDlg::slotClear()
+{
+ diffWidget->slotClear();
+}
+
+void DiffDlg::setDiff( const QString& diff )
+{
+ diffWidget->setDiff( diff );
+}
+
+void DiffDlg::openURL( const KURL& url )
+{
+ diffWidget->openURL( url );
+}
+
+#include "diffdlg.moc"
diff --git a/parts/diff/diffdlg.h b/parts/diff/diffdlg.h
new file mode 100644
index 00000000..6f47dcf2
--- /dev/null
+++ b/parts/diff/diffdlg.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DIFFDLG_H_
+#define _DIFFDLG_H_
+
+#include <kdialogbase.h>
+#include <kurl.h>
+
+class DiffWidget;
+
+class DiffDlg : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ DiffDlg( QWidget *parent = 0, const char *name = 0 );
+ virtual ~DiffDlg();
+
+public slots:
+ /** The URL has to point to a diff file */
+ void openURL( const KURL& url );
+ /** Pass a diff file in here */
+ void setDiff( const QString& diff );
+ /** clears the difference viewer */
+ void slotClear();
+
+private:
+ DiffWidget* diffWidget;
+
+};
+
+#endif
diff --git a/parts/diff/diffpart.cpp b/parts/diff/diffpart.cpp
new file mode 100644
index 00000000..8f04b060
--- /dev/null
+++ b/parts/diff/diffpart.cpp
@@ -0,0 +1,248 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "diffpart.h"
+
+#include <sys/stat.h>
+
+#include <qwhatsthis.h>
+#include <qpopupmenu.h>
+
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kfiledialog.h>
+#include <kprocess.h>
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugininfo.h"
+
+#include "diffdlg.h"
+#include "diffwidget.h"
+
+static const KDevPluginInfo data("kdevdiff");
+
+typedef KDevGenericFactory<DiffPart> DiffFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevdiff, DiffFactory( data ) )
+
+DiffPart::DiffPart(QObject *parent, const char *name, const QStringList &)
+ : KDevDiffFrontend(&data, parent, name ? name : "DiffPart"), proc(0)
+{
+ setInstance(DiffFactory::instance());
+ setXMLFile("kdevdiff.rc");
+
+ diffWidget = new DiffWidget(this, 0, "diffWidget");
+ diffWidget->setIcon( SmallIcon("editcopy") );
+ QString nm( i18n( "Diff" ) );
+ diffWidget->setCaption( i18n( "Diff Output" ) );
+ QWhatsThis::add(diffWidget, i18n("<b>Difference viewer</b><p>Shows output of the diff format. "
+ "Can utilize every installed component that is able to show diff output. "
+ "For example if you have Kompare installed, Difference Viewer can use its graphical diff view."));
+ mainWindow()->embedOutputView( diffWidget, nm, i18n("Output of the diff command") );
+ mainWindow()->setViewAvailable( diffWidget, false );
+
+ KAction *action = new KAction( i18n("Difference Viewer..."), 0,
+ this, SLOT(slotExecDiff()),
+ actionCollection(), "tools_diff" );
+ action->setToolTip(i18n("Difference viewer"));
+ action->setWhatsThis(i18n("<b>Difference viewer</b><p>Shows the contents of a patch file."));
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+}
+
+static bool urlIsEqual(const KURL &a, const KURL &b)
+{
+ if (a.isLocalFile() && b.isLocalFile())
+ {
+ struct stat aStat, bStat;
+
+ if ((::stat(QFile::encodeName(a.fileName()), &aStat) == 0)
+ && (::stat(QFile::encodeName(b.fileName()), &bStat) == 0))
+ {
+ return (aStat.st_dev == bStat.st_dev) && (aStat.st_ino == bStat.st_ino);
+ }
+ }
+
+ return a == b;
+}
+
+static KParts::ReadWritePart* partForURL(const KURL &url, KDevPartController* pc)
+{
+ if ( !pc )
+ return 0;
+ QPtrListIterator<KParts::Part> it(*(pc->parts()));
+ for ( ; it.current(); ++it)
+ {
+ KParts::ReadWritePart *rw_part = dynamic_cast<KParts::ReadWritePart*>(it.current());
+ if ( rw_part && dynamic_cast<KTextEditor::EditInterface*>(it.current()) && urlIsEqual(url, rw_part->url()) )
+ return rw_part;
+ }
+
+ return 0;
+}
+
+void DiffPart::contextMenu( QPopupMenu* popup, const Context* context )
+{
+ if ( context->hasType( Context::EditorContext ) )
+ {
+ const EditorContext *eContext = static_cast<const EditorContext*>(context);
+ popupFile = eContext->url();
+ }
+ else if ( context->hasType( Context::FileContext ) )
+ {
+ const FileContext * fContext = static_cast<const FileContext*>( context );
+ popupFile.setPath( fContext->urls().first().fileName() ); //@fixme - assuming absolute path. is this correct?
+ }
+ else
+ {
+ return;
+ }
+
+ KParts::ReadWritePart* rw_part = partForURL( popupFile, partController() );
+ if ( !rw_part ) return;
+
+ if ( partController()->documentState( rw_part->url() ) != Clean )
+ {
+ int id = popup->insertItem( i18n( "Difference to Disk File" ),
+ this, SLOT(localDiff()) );
+ popup->setWhatsThis(id, i18n("<b>Difference to disk file</b><p>Shows the difference between "
+ "the file contents in this editor and the file contents on disk."));
+ }
+}
+
+DiffPart::~DiffPart()
+{
+ if ( diffWidget )
+ mainWindow()->removeView( diffWidget );
+
+ delete proc;
+ delete (DiffWidget*) diffWidget;
+}
+
+void DiffPart::localDiff()
+{
+ KParts::ReadWritePart* rw_part = partForURL( popupFile, partController() );
+ if ( !rw_part )
+ return;
+
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>(rw_part);
+ if ( !editIface )
+ return;
+ buffer = editIface->text().local8Bit();
+ resultBuffer = resultErr = QString::null;
+
+ delete proc;
+ proc = new KProcess();
+
+ *proc << "diff";
+ *proc << "-u" << popupFile.path() << "-";
+ proc->setWorkingDirectory( popupFile.directory() );
+
+ connect( proc, SIGNAL(processExited( KProcess* )),
+ this, SLOT(processExited( KProcess* )) );
+ connect( proc, SIGNAL(receivedStdout( KProcess*, char*, int )),
+ this, SLOT(receivedStdout( KProcess*, char*, int )) );
+ connect( proc, SIGNAL(receivedStderr( KProcess*, char*, int )),
+ this, SLOT(receivedStderr( KProcess*, char*, int )) );
+ connect( proc, SIGNAL(wroteStdin( KProcess* )),
+ this, SLOT(wroteStdin( KProcess* )) );
+
+ if ( !proc->start( KProcess::NotifyOnExit, KProcess::All ) ) {
+ KMessageBox::error( 0, i18n( "Could not invoke the \"diff\" command." ) );
+ delete proc;
+ proc = 0;
+ return;
+ }
+ proc->writeStdin( buffer.data(), buffer.length() );
+}
+
+void DiffPart::processExited( KProcess* p )
+{
+ // diff has exit status 0 and 1 for success
+ if ( p->normalExit() && ( p->exitStatus() == 0 || p->exitStatus() == 1 ) ) {
+ if ( resultBuffer.isEmpty() )
+ KMessageBox::information( 0, i18n("DiffPart: No differences found.") );
+ else
+ showDiff( resultBuffer );
+ } else {
+ KMessageBox::error( 0, i18n("Diff command failed (%1):\n").arg( p->exitStatus() ) + resultErr );
+ }
+ resultBuffer = resultErr = QString::null;
+ delete proc;
+ proc = 0;
+}
+
+void DiffPart::receivedStdout( KProcess* /* p */, char* buf, int buflen )
+{
+ resultBuffer += QString::fromLocal8Bit( buf, buflen );
+}
+
+void DiffPart::receivedStderr( KProcess* /* p */, char* buf, int buflen )
+{
+ kdDebug(9033) << "received Stderr: " << QString::fromLocal8Bit( buf, buflen ) << endl;
+ resultErr += QString::fromLocal8Bit( buf, buflen );
+}
+
+void DiffPart::wroteStdin( KProcess* p )
+{
+ buffer = 0L;
+ p->closeStdin();
+}
+
+void DiffPart::openURL( const KURL& url )
+{
+ diffWidget->slotClear();
+ diffWidget->openURL( url );
+ mainWindow()->raiseView( diffWidget );
+/*
+ DiffDlg* diffDlg = new DiffDlg( 0, "diffDlg" );
+
+ diffDlg->openURL( url );
+ diffDlg->exec();
+ delete diffDlg;
+*/
+}
+
+void DiffPart::showDiff( const QString& diff )
+{
+ diffWidget->slotClear();
+ diffWidget->setDiff( diff );
+ mainWindow()->setViewAvailable( diffWidget, true );
+ mainWindow()->raiseView( diffWidget );
+/*
+ DiffDlg* diffDlg = new DiffDlg( 0, "diffDlg" );
+
+ diffDlg->setDiff( diff );
+ diffDlg->exec();
+ delete diffDlg;
+*/
+}
+
+void DiffPart::slotExecDiff()
+{
+ KURL url = KFileDialog::getOpenURL( QString::null, QString::null, 0, i18n("Please Select Patch File") );
+
+ if ( url.isEmpty() )
+ return;
+
+ openURL( url );
+}
+
+#include "diffpart.moc"
diff --git a/parts/diff/diffpart.h b/parts/diff/diffpart.h
new file mode 100644
index 00000000..f89d0d18
--- /dev/null
+++ b/parts/diff/diffpart.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DIFFPART_H_
+#define _DIFFPART_H_
+
+#include <qguardedptr.h>
+#include <qcstring.h>
+
+#include "kdevplugin.h"
+#include "kdevdifffrontend.h"
+
+class QPopupMenu;
+class Context;
+class KProcess;
+class DiffWidget;
+class QCString;
+
+class DiffPart : public KDevDiffFrontend
+{
+ Q_OBJECT
+
+public:
+ DiffPart( QObject *parent, const char *name, const QStringList & );
+ virtual ~DiffPart();
+
+ void openURL( const KURL& url );
+ void showDiff( const QString& diff );
+ void showDiff( const KURL &, const KURL & ) { /** @todo */ }
+
+public slots:
+ void slotExecDiff();
+
+private slots:
+ void contextMenu( QPopupMenu* popup, const Context* context );
+ void localDiff();
+ void processExited( KProcess* p );
+ void receivedStdout( KProcess* p, char* buf, int buflen );
+ void receivedStderr( KProcess* p, char* buf, int buflen );
+ void wroteStdin( KProcess* p );
+
+private:
+ QGuardedPtr<DiffWidget> diffWidget;
+ KURL popupFile;
+ KProcess* proc;
+ QCString buffer;
+ QString resultBuffer;
+ QString resultErr;
+};
+
+#endif
diff --git a/parts/diff/diffwidget.cpp b/parts/diff/diffwidget.cpp
new file mode 100644
index 00000000..0b3399ab
--- /dev/null
+++ b/parts/diff/diffwidget.cpp
@@ -0,0 +1,348 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qtextedit.h>
+#include <qpopupmenu.h>
+#include <qcursor.h>
+#include <qfile.h>
+
+#include <kconfig.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kservice.h>
+#include <ktempfile.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kfiledialog.h>
+#include <kmessagebox.h>
+
+#include <kparts/componentfactory.h>
+#include <kparts/part.h>
+
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+
+#include <kdevmainwindow.h>
+
+#include "diffpart.h"
+#include "diffwidget.h"
+
+// yup, magic value for the popupmenu-id
+static const int POPUP_BASE = 130977;
+
+QStringList KDiffTextEdit::extParts;
+QStringList KDiffTextEdit::extPartsTranslated;
+
+KDiffTextEdit::KDiffTextEdit( QWidget* parent, const char* name ): QTextEdit( parent, name )
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "Diff" );
+ _highlight = config->readBoolEntry( "Highlight", true );
+
+ searchExtParts();
+}
+
+KDiffTextEdit::~KDiffTextEdit()
+{
+ KConfig* config = kapp->config();
+
+ config->setGroup( "Diff" );
+ config->writeEntry( "Highlight", _highlight );
+}
+
+QPopupMenu* KDiffTextEdit::createPopupMenu()
+{
+ return createPopupMenu( QPoint() );
+}
+
+QPopupMenu* KDiffTextEdit::createPopupMenu( const QPoint& p )
+{
+ QPopupMenu* popup = QTextEdit::createPopupMenu( p );
+ if ( !popup )
+ popup = new QPopupMenu( this );
+
+ int i = 0;
+
+ for ( QStringList::Iterator it = extPartsTranslated.begin(); it != extPartsTranslated.end(); ++it ) {
+ popup->insertItem( i18n( "Show in %1" ).arg( *it ), i + POPUP_BASE, i );
+ i++;
+ }
+ if ( !extPartsTranslated.isEmpty() )
+ popup->insertSeparator( i );
+ connect( popup, SIGNAL(activated(int)), this, SLOT(popupActivated(int)) );
+
+ popup->insertItem( SmallIconSet( "filesaveas" ), i18n( "&Save As..." ), this, SLOT(saveAs()), CTRL + Key_S, POPUP_BASE - 2, 0 );
+ popup->setItemEnabled( POPUP_BASE - 2, length() > 0 );
+
+ popup->insertSeparator( 1 );
+
+ popup->insertItem( i18n( "Highlight Syntax" ), this, SLOT(toggleSyntaxHighlight()), 0, POPUP_BASE - 1, 2 );
+ popup->setItemChecked( POPUP_BASE - 1, _highlight );
+ popup->insertSeparator( 3 );
+
+ popup->insertSeparator();
+ popup->insertItem( i18n("Hide view"), parent(), SLOT(hideView()) );
+
+ return popup;
+}
+
+void KDiffTextEdit::saveAs()
+{
+ QString fName = KFileDialog::getSaveFileName();
+ if ( fName.isEmpty() )
+ return;
+
+ QFile f( fName );
+ if ( f.open( IO_WriteOnly ) ) {
+ QTextStream stream( &f );
+ int pCount = paragraphs();
+ for ( int i = 0; i < pCount; ++i )
+ stream << text( i ) << "\n";
+ f.close();
+ } else {
+ KMessageBox::sorry( 0, i18n("Unable to open file."), i18n("Diff Frontend") );
+ }
+}
+
+void KDiffTextEdit::toggleSyntaxHighlight()
+{
+ _highlight = !_highlight;
+ if ( _highlight )
+ applySyntaxHighlight();
+ else
+ clearSyntaxHighlight();
+}
+
+void KDiffTextEdit::applySyntaxHighlight()
+{
+ // the diff has been loaded so we apply a simple highlighting
+ static QColor cAdded( 190, 190, 237);
+ static QColor cRemoved( 190, 237, 190 );
+
+ if ( !_highlight )
+ return;
+
+ int paragCount = paragraphs();
+ for ( int i = 0; i < paragCount; ++i ) {
+ QString txt = text( i );
+ if ( txt.length() > 0 ) {
+ if ( txt.startsWith( "+" ) || txt.startsWith( ">" ) ) {
+ setParagraphBackgroundColor( i, cAdded );
+ } else if ( txt.startsWith( "-" ) || txt.startsWith( "<" ) ) {
+ setParagraphBackgroundColor( i, cRemoved );
+ }
+ }
+ }
+}
+
+void KDiffTextEdit::clearSyntaxHighlight()
+{
+ int paragCount = paragraphs();
+ for ( int i = 0; i < paragCount; ++i ) {
+ clearParagraphBackground( i );
+ }
+}
+
+void KDiffTextEdit::searchExtParts()
+{
+ // only execute once
+ static bool init = false;
+ if ( init )
+ return;
+ init = true;
+
+ // search all parts that can handle text/x-diff
+ KTrader::OfferList offers = KTrader::self()->query("text/x-diff", "('KParts/ReadOnlyPart' in ServiceTypes) and ('text/x-diff' in ServiceTypes) and (DesktopEntryName != 'katepart')");
+ KTrader::OfferList::const_iterator it;
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = (*it);
+ extPartsTranslated << ptr->name();
+ extParts << ptr->desktopEntryName();
+ }
+ return;
+}
+
+void KDiffTextEdit::popupActivated( int id )
+{
+ id -= POPUP_BASE;
+ if ( id < 0 || id > (int)extParts.count() )
+ return;
+
+ emit externalPartRequested( extParts[ id ] );
+}
+
+DiffWidget::DiffWidget( DiffPart * part, QWidget *parent, const char *name, WFlags f ):
+ QWidget( parent, name, f ), m_part( part ), tempFile( 0 )
+{
+ job = 0;
+ extPart = 0;
+
+ te = new KDiffTextEdit( this, "Main Diff Viewer" );
+ te->setReadOnly( true );
+ te->setTextFormat( QTextEdit::PlainText );
+// te->setMinimumSize( 300, 200 );
+ connect( te, SIGNAL(externalPartRequested(const QString&)), this, SLOT(loadExtPart(const QString&)) );
+
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ layout->addWidget( te );
+}
+
+DiffWidget::~DiffWidget()
+{
+ m_part = 0;
+ delete tempFile;
+}
+
+void DiffWidget::setExtPartVisible( bool visible )
+{
+ if ( !extPart || !extPart->widget() ) {
+ te->show();
+ return;
+ }
+ if ( visible ) {
+ te->hide();
+ extPart->widget()->show();
+ } else {
+ te->show();
+ extPart->widget()->hide();
+ }
+}
+
+void DiffWidget::loadExtPart( const QString& partName )
+{
+ if ( extPart ) {
+ setExtPartVisible( false );
+ delete extPart;
+ extPart = 0;
+ }
+
+ KService::Ptr extService = KService::serviceByDesktopName( partName );
+ if ( !extService )
+ return;
+
+ extPart = KParts::ComponentFactory::createPartInstanceFromService<KParts::ReadOnlyPart>( extService, this, 0, this, 0 );
+ if ( !extPart || !extPart->widget() )
+ return;
+
+ layout()->add( extPart->widget() );
+
+ setExtPartVisible( true );
+
+ if ( te->paragraphs() > 0 )
+ populateExtPart();
+}
+
+void DiffWidget::slotClear()
+{
+ rawDiff = QString();
+ te->clear();
+ if ( extPart )
+ extPart->closeURL();
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotAppend( const QString& str )
+{
+ te->append( str );
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotAppend( KIO::Job*, const QByteArray& ba )
+{
+ slotAppend( QString( ba ) );
+}
+
+void DiffWidget::populateExtPart()
+{
+ if ( !extPart )
+ return;
+
+ bool ok = false;
+ int paragCount = te->paragraphs();
+ if ( extPart->openStream( "text/plain", KURL() ) ) {
+ for ( int i = 0; i < paragCount; ++i )
+ extPart->writeStream( rawDiff.local8Bit() );
+ ok = extPart->closeStream();
+ } else {
+ // workaround for parts that cannot handle streams
+ delete tempFile;
+ tempFile = new KTempFile();
+ tempFile->setAutoDelete( true );
+ *(tempFile->textStream()) << rawDiff.local8Bit() << endl;
+ tempFile->close();
+ ok = extPart->openURL( KURL::fromPathOrURL( tempFile->name() ) );
+ }
+ if ( !ok )
+ setExtPartVisible( false );
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotFinished()
+{
+ te->applySyntaxHighlight();
+ populateExtPart();
+}
+
+void DiffWidget::setDiff( const QString& diff )
+{
+ slotClear();
+ rawDiff = diff;
+ slotAppend( diff );
+ slotFinished();
+}
+
+void DiffWidget::openURL( const KURL& url )
+{
+ if ( job )
+ job->kill();
+
+ KIO::TransferJob* job = KIO::get( url );
+ if ( !job )
+ return;
+
+ connect( job, SIGNAL(data( KIO::Job *, const QByteArray & )),
+ this, SLOT(slotAppend( KIO::Job*, const QByteArray& )) );
+ connect( job, SIGNAL(result( KIO::Job * )),
+ this, SLOT(slotFinished()) );
+}
+
+void DiffWidget::contextMenuEvent( QContextMenuEvent* /* e */ )
+{
+ QPopupMenu* popup = new QPopupMenu( this );
+
+ if ( !te->isVisible() )
+ {
+ popup->insertItem( i18n("Display &Raw Output"), this, SLOT(showTextEdit()) );
+ popup->insertSeparator();
+ popup->insertItem( i18n("Hide view"), this, SLOT(hideView()) );
+ }
+
+ popup->exec( QCursor::pos() );
+ delete popup;
+}
+
+void DiffWidget::showExtPart()
+{
+ setExtPartVisible( true );
+}
+
+void DiffWidget::showTextEdit()
+{
+ setExtPartVisible( false );
+}
+
+void DiffWidget::hideView()
+{
+ m_part->mainWindow()->setViewAvailable( this, false );
+}
+
+#include "diffwidget.moc"
diff --git a/parts/diff/diffwidget.h b/parts/diff/diffwidget.h
new file mode 100644
index 00000000..665b1110
--- /dev/null
+++ b/parts/diff/diffwidget.h
@@ -0,0 +1,107 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DIFFWIDGET_H_
+#define _DIFFWIDGET_H_
+
+#include <qwidget.h>
+#include <qtextedit.h>
+#include <qstringlist.h>
+
+#include <kurl.h>
+
+class KTempFile;
+class DiffPart;
+
+namespace KIO {
+ class Job;
+}
+
+namespace KParts {
+ class ReadOnlyPart;
+}
+
+// Helper class that displays a modified RMB popup menu
+class KDiffTextEdit: public QTextEdit
+{
+ Q_OBJECT
+public:
+ KDiffTextEdit( QWidget* parent = 0, const char* name = 0 );
+ virtual ~KDiffTextEdit();
+ void applySyntaxHighlight();
+ void clearSyntaxHighlight();
+
+signals:
+ void externalPartRequested( const QString& partName );
+
+protected:
+ virtual QPopupMenu* createPopupMenu( const QPoint& );
+ virtual QPopupMenu* createPopupMenu();
+
+private slots:
+ void popupActivated( int );
+ void toggleSyntaxHighlight();
+ void saveAs();
+
+private:
+ static void searchExtParts();
+ static QStringList extParts;
+ static QStringList extPartsTranslated;
+ bool _highlight;
+};
+
+class DiffWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DiffWidget( DiffPart * part, QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+ virtual ~DiffWidget();
+
+public slots:
+ /** The URL has to point to a diff file */
+ void openURL( const KURL& url );
+ /** Pass a diff file in here */
+ void setDiff( const QString& diff );
+ /** clears the difference viewer */
+ void slotClear();
+
+private slots:
+ /** appends a piece of "diff" */
+ void slotAppend( const QString& str );
+ /** overloaded for convenience */
+ void slotAppend( KIO::Job*, const QByteArray& ba );
+ /** call this when the whole "diff" has been sent.
+ * Don't call slotAppend afterwards!
+ */
+ void slotFinished();
+ void showExtPart();
+ void showTextEdit();
+ void loadExtPart( const QString& partName );
+ void hideView();
+
+protected:
+ void contextMenuEvent( QContextMenuEvent* e );
+
+private:
+ void setExtPartVisible( bool visible );
+ void populateExtPart();
+
+private:
+ DiffPart * m_part;
+ KDiffTextEdit* te;
+ KIO::Job* job;
+ KParts::ReadOnlyPart* extPart;
+ KTempFile* tempFile;
+ QString rawDiff;
+};
+
+#endif
diff --git a/parts/diff/kdevdiff.desktop b/parts/diff/kdevdiff.desktop
new file mode 100644
index 00000000..f9779903
--- /dev/null
+++ b/parts/diff/kdevdiff.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Difference Viewer
+Comment[ca]=Visor de diferències
+Comment[da]=Diff-fremviser
+Comment[de]=Betrachter für Abweichungen
+Comment[el]=Προβολέας διαφορών
+Comment[es]=Visor de diferencias
+Comment[et]=Erinevuste näitaja
+Comment[eu]=Desberdintasun ikustailea
+Comment[fa]=مشاهده‌گر تفاوت
+Comment[fr]=Afficheur de différences
+Comment[ga]=Amharcán Difríochtaí
+Comment[gl]=Visor de diferenzas
+Comment[hi]=भिन्नता प्रदर्शक
+Comment[hu]=Fájlok közötti eltérések megjelenítése
+Comment[it]=Visualizzatore di differenze
+Comment[ja]=差分ビューア
+Comment[ms]=Pelihat Perbezaan
+Comment[nds]=En Verscheelkieker
+Comment[ne]=फरक दृश्यकर्ता
+Comment[nl]=Weergave van verschillen
+Comment[pl]=Przeglądarka różnic
+Comment[pt]=Visualizador de Diferenças
+Comment[pt_BR]=Visualizador de Diferenças
+Comment[ru]=Просмотр различий
+Comment[sk]=Prezerač rozdielov
+Comment[sl]=Pregledovalnik razlik
+Comment[sr]=Програм за прегледање разлика
+Comment[sr@Latn]=Program za pregledanje razlika
+Comment[sv]=Visning av jämförelser
+Comment[ta]=பாகுபாடு காட்சியாளர்
+Comment[tg]=Намоишгари фарқкунанда
+Comment[tr]=Fark Görüntüleyicisi
+Comment[zh_CN]=差别查看器
+Comment[zh_TW]=比較檢視器
+Name=KDevDiff
+Name[da]=KDevelop diff-fremviser
+Name[de]=Abweichungsansicht (KDevelop)
+Name[hi]=के-डेव-डिफ़
+Name[nds]=KDevelop-Verscheelkieker
+Name[sk]=KDev rozdiel
+Name[sv]=KDevelop jämför
+Name[zh_TW]=KDevelop 比較
+GenericName=Difference Viewer
+GenericName[ca]=Visor de diferències
+GenericName[da]=Diff-fremviser
+GenericName[de]=Betrachter für Abweichungen
+GenericName[el]=Προβολέας διαφορών
+GenericName[es]=Visor de diferencias
+GenericName[et]=Erinevuste näitaja
+GenericName[eu]=Desberdintasun ikustailea
+GenericName[fa]=مشاهده‌گر تفاوت
+GenericName[fr]=Afficheur de différences
+GenericName[ga]=Amharcán Difríochtaí
+GenericName[gl]=Visor de diferenzas
+GenericName[hi]=भिन्नता प्रदर्शक
+GenericName[hu]=Diff-megjelenítő
+GenericName[it]=Visualizzatore delle differenze
+GenericName[ja]=差分ビューア
+GenericName[ms]=Pelihat Perbezaan
+GenericName[nds]=Verscheelkieker
+GenericName[ne]=फरक दृश्यकर्ता
+GenericName[nl]=Weergave van verschillen
+GenericName[pl]=Przeglądarka różnic
+GenericName[pt]=Visualizador de Diferenças
+GenericName[pt_BR]=Visualizador de Diferenças
+GenericName[ru]=Просмотр различий
+GenericName[sk]=Prezerač rozdielov
+GenericName[sl]=Pregledovalnik razlik
+GenericName[sr]=Програм за прегледање разлика
+GenericName[sr@Latn]=Program za pregledanje razlika
+GenericName[sv]=Visning av jämförelser
+GenericName[ta]=வெவ்வேறு பார்வையாளர்கள்
+GenericName[tg]=Намоишгари фарқкунанда
+GenericName[tr]=Fark Görüntüleyicisi
+GenericName[zh_CN]=差别查看器
+GenericName[zh_TW]=比較檢視器
+ServiceTypes=KDevelop/DiffFrontend
+X-KDE-Library=libkdevdiff
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeEditing
+X-KDevelop-Scope=Core
diff --git a/parts/diff/kdevdiff.rc b/parts/diff/kdevdiff.rc
new file mode 100644
index 00000000..37059573
--- /dev/null
+++ b/parts/diff/kdevdiff.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevDiff" version="1">
+<MenuBar>
+ <Menu name="tools" >
+ <Action name="tools_diff" group="tools_file_operations"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/distpart/Makefile.am b/parts/distpart/Makefile.am
new file mode 100644
index 00000000..0a1d949f
--- /dev/null
+++ b/parts/distpart/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdistpart.la
+libkdevdistpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevdistpart_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevdistpart_la_SOURCES = distpart_ui.ui distpart_part.cpp distpart_widget.cpp packagebase.cpp lsmsupport.cpp specsupport.cpp
+
+METASOURCES = AUTO
+KDEICON = AUTO
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdistpart.desktop
+
+rc_DATA = kdevpart_distpart.rc
+rcdir = $(kde_datadir)/kdevdistpart
diff --git a/parts/distpart/README b/parts/distpart/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/distpart/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/distpart/README.dox b/parts/distpart/README.dox
new file mode 100644
index 00000000..994b4f84
--- /dev/null
+++ b/parts/distpart/README.dox
@@ -0,0 +1,24 @@
+/** \class DistpartPart
+This part aims to provide some help to the developpers for packaging
+and publishing their projects by ftp protocol.
+
+Only RPM package format is supported for now. More to come.
+If you want to develop a new package support, please have a look at
+specsupport.h and specsupport.cpp. Help is always welcome :-)
+
+\authors <a href="mailto:geiseri AT yahoo.com">Ian Reinart Geiser</a>
+
+\maintainer <a href="mailto:Yann.Hodique AT lifl.fr">Yann Hodique</a>
+
+\feature provide some help to the developpers for packaging and publishing their projects by ftp protocol
+\feature support RPM package format
+
+\bug Development package, documentation package, application icon and local
+options (in publishing tab) are currently ignored.
+
+\bug The creation of the source archive is just a
+call to "dist" or "dist-bzip2" target of the Makefile. If those
+targets don't exist, nothing is done to solve the problem (for
+example when the project is QMake-based)
+
+*/
diff --git a/parts/distpart/distpart_part.cpp b/parts/distpart/distpart_part.cpp
new file mode 100644
index 00000000..b719533d
--- /dev/null
+++ b/parts/distpart/distpart_part.cpp
@@ -0,0 +1,84 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "distpart_part.h"
+
+#include <qwhatsthis.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+
+#include "kdevcore.h"
+#include <kdevplugininfo.h>
+
+#include "distpart_widget.h"
+
+#include <kdialogbase.h>
+
+typedef KDevGenericFactory<DistpartPart> DistpartFactory;
+static const KDevPluginInfo data("kdevdistpart");
+K_EXPORT_COMPONENT_FACTORY( libkdevdistpart, DistpartFactory( data ) )
+
+DistpartPart::DistpartPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "DistpartPart") {
+
+ kdDebug(9007) << "DistpartPart::DistpartPart()" << endl;
+ setInstance(DistpartFactory::instance());
+
+ setXMLFile("kdevpart_distpart.rc");
+
+ m_action = new KAction( i18n("Distribution && Publishing"), "package", 0,
+ this, SLOT(show()),
+ actionCollection(), "make_dist" );
+
+ m_action->setToolTip(i18n("Make source and binary distribution"));
+ m_action->setWhatsThis(i18n("<b>Project distribution & publishing</b><p>Helps users package and publish their software."));
+ //QWhatsThis::add(m_widget, i18n("This will help users package and publish their software."));
+
+ m_dlg = new KDialogBase( 0 , "dist_part", false, i18n("Distribution & Publishing"), KDialogBase::Ok|KDialogBase::Cancel);
+
+ m_dialog = new DistpartDialog(this, m_dlg );
+ m_dlg->setMainWidget(m_dialog);
+
+ connect( m_dlg, SIGNAL(okClicked()), m_dialog, SLOT(slotokayPushButtonPressed()));
+ connect( m_dlg, SIGNAL(cancelClicked()), m_dialog, SLOT(slotcancelPushButtonPressed()));
+ // Package types
+ //RpmPackage = new SpecSupport(this);
+ //LsmPackage = new LsmSupport(this);
+}
+
+
+DistpartPart::~DistpartPart() {
+ kdDebug(9007) << "DistpartPart::~DistpartPart()" << endl;
+ delete m_dialog;
+ //delete RpmPackage;
+ //delete LsmPackage;
+}
+
+void DistpartPart::show() {
+ m_dlg->exec();
+}
+
+void DistpartPart::hide() {
+ m_dlg->cancel();
+}
+
+#include "distpart_part.moc"
diff --git a/parts/distpart/distpart_part.h b/parts/distpart/distpart_part.h
new file mode 100644
index 00000000..c8caa0a3
--- /dev/null
+++ b/parts/distpart/distpart_part.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+
+#ifndef __KDEVPART_DISTPART_H__
+#define __KDEVPART_DISTPART_H__
+
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+#include <kaction.h>
+
+#include "packagebase.h"
+
+class DistpartDialog;
+class KDialogBase;
+
+class DistpartPart : public KDevPlugin {
+ Q_OBJECT
+
+public:
+
+ DistpartPart(QObject *parent, const char *name, const QStringList &);
+ ~DistpartPart();
+
+public slots:
+ void show();
+ void hide();
+
+private:
+ packageBase *RpmPackage, *LsmPackage;
+ QGuardedPtr<DistpartDialog> m_dialog;
+ KAction *m_action;
+ QGuardedPtr<KDialogBase> m_dlg;
+};
+
+
+#endif
diff --git a/parts/distpart/distpart_ui.ui b/parts/distpart/distpart_ui.ui
new file mode 100644
index 00000000..a987c009
--- /dev/null
+++ b/parts/distpart/distpart_ui.ui
@@ -0,0 +1,1243 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>distpart_ui</class>
+<author>Ian Reinhart Geiser &lt;geiseri@yahoo.com&gt;</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>packaging_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>606</width>
+ <height>649</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Prepare for Release</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout30</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>titleLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;H2&gt;Project Packaging &amp; Publishing&lt;/H2&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>KDevelopGraphic</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="pixmap">
+ <pixmap>"kdevelop"</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>actions_box</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="tabPosition">
+ <enum>Top</enum>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Source &amp;Distribution</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListBox" row="1" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>srcDistFileListBox</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>customProjectCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use custom options</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Default is: %n-%v.tar.gz</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout19</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>sourceOptionsGroupBox</cstring>
+ </property>
+ <property name="title">
+ <string>Source Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>bzipCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;bzip2 instead of gzip</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout34</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>archiveNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Archive name format: &lt;/b&gt;&lt;br&gt; %n - File name &lt;br&gt; %v - File version &lt;br&gt; %d - Date of archive</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>archNameFormatLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>archNameFormatLineEdit</cstring>
+ </property>
+ <property name="text">
+ <string>%n-%v</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter the filename using the format options. </string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer37</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addFile</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Add Files</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>createSrcArchPushButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Create Source Archive</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>resetSrcPushButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>R&amp;eset</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>fileListLabel</cstring>
+ </property>
+ <property name="text">
+ <string>File &amp;list:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>srcDistFileListBox</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Package &amp;Information</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="4" column="1">
+ <property name="name">
+ <cstring>licenseLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>vendorLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Ve&amp;ndor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>vendorLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>releaseLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>appNameLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Application name</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>vendorLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>appNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Application name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>appNameLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>summaryLabel</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;ummary:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>summaryLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>licenseLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;License:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>licenseLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>releaseLabel</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;elease:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>releaseLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>versionLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Version:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>versionLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="1">
+ <property name="name">
+ <cstring>summaryLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="7" column="1">
+ <property name="name">
+ <cstring>packagerLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>versionLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Version of the file package.
+Menu item: Project/Project Options/General/Version
+changes project compiled version number</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>groupLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Group:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>groupLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="7" column="0">
+ <property name="name">
+ <cstring>packagerLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Pac&amp;kager:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>packagerLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="6" column="1">
+ <property name="name">
+ <cstring>groupLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>2</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>advancedOptionsGroupBox</cstring>
+ </property>
+ <property name="title">
+ <string>Advanced Package Op&amp;tions</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>devPackageCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create development package</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>docsPackageCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Create documentation package</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>appIconCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Include application icon</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>archLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Architecture target:&lt;BR&gt;&lt;b&gt;(Note: You must have a compiler that supports this target)&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>i386</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>i586</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>i686</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>AMD K6</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>AMD K7</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PPC</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PPC G3</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PPC Altevec</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dec Alpha (AXP)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Sparc</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>archComboBox</cstring>
+ </property>
+ <property name="currentItem">
+ <number>0</number>
+ </property>
+ <property name="autoResize">
+ <bool>true</bool>
+ </property>
+ <property name="sizeLimit">
+ <number>10</number>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>srcPackagePushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Build Source
+Package</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buildAllPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Build Binar&amp;y
+Package</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>exportSPECPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xport
+Build Files</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>importSPECPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>I&amp;mport
+Build Files</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout16</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>projectDescriptionLabel</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;Description:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>projectDescriptionMultilineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>projectDescriptionMultilineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="resizePolicy">
+ <enum>Manual</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout15</cstring>
+ </property>
+ <vbox>
+ <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>C&amp;hangelog:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>projectChangelogMultilineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>projectChangelogMultilineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Pr&amp;oject Publishing</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>localOptionsGroupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Local Options</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout15</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>genHTMLCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Ge&amp;nerate HTML information page</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>useRPMInfoCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;User information generated by RPM</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer7</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>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout21</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>genHTMLPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Generate</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>resetHTMLPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>R&amp;eset</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>remoteOptionsGroupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Re&amp;mote Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListBox" row="1" column="1">
+ <property name="name">
+ <cstring>uploadFileListBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout23</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>fileSubmissionLabel</cstring>
+ </property>
+ <property name="text">
+ <string>File su&amp;bmission list:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>uploadFileListBox</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer24</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>uploadAddFileToolButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>+</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>uploadRemoveToolButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>-</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>Layout25</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>uploadCustomCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Upload to &amp;custom FTP site</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>uploadftpkdeorgCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Upload files to ftp.&amp;kde.org</string>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <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>0</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="7" column="0">
+ <property name="name">
+ <cstring>uploadSubmitPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Sub&amp;mit</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>uploadURLLineEdit</cstring>
+ </property>
+ <property name="text">
+ <string>ftp://username:password@ftp.server.com/path/</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>uploadResetPushButton</cstring>
+ </property>
+ <property name="text">
+ <string>Reset</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>uploadAppsKDEcomCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Upload to &amp;apps.kde.com</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buildAllPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotbuildAllPushButtonPressed()</slot>
+ </connection>
+ <connection>
+ <sender>exportSPECPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotexportSPECPushButtonPressed()</slot>
+ </connection>
+ <connection>
+ <sender>srcPackagePushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotsrcPackagePushButtonPressed()</slot>
+ </connection>
+ <connection>
+ <sender>importSPECPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotimportSPECPushButtonPressed()</slot>
+ </connection>
+ <connection>
+ <sender>addFile</sender>
+ <signal>clicked()</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotAddFileButtonPressed()</slot>
+ </connection>
+ <connection>
+ <sender>srcDistFileListBox</sender>
+ <signal>clicked(QListBoxItem*)</signal>
+ <receiver>packaging_dialog</receiver>
+ <slot>slotRemoveFile(QListBoxItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>actions_box</tabstop>
+ <tabstop>customProjectCheckBox</tabstop>
+ <tabstop>bzipCheckBox</tabstop>
+ <tabstop>archNameFormatLineEdit</tabstop>
+ <tabstop>createSrcArchPushButton</tabstop>
+ <tabstop>resetSrcPushButton</tabstop>
+ <tabstop>srcDistFileListBox</tabstop>
+ <tabstop>appNameLineEdit</tabstop>
+ <tabstop>versionLineEdit</tabstop>
+ <tabstop>releaseLineEdit</tabstop>
+ <tabstop>vendorLineEdit</tabstop>
+ <tabstop>licenseLineEdit</tabstop>
+ <tabstop>summaryLineEdit</tabstop>
+ <tabstop>groupLineEdit</tabstop>
+ <tabstop>packagerLineEdit</tabstop>
+ <tabstop>projectDescriptionMultilineEdit</tabstop>
+ <tabstop>projectChangelogMultilineEdit</tabstop>
+ <tabstop>devPackageCheckBox</tabstop>
+ <tabstop>docsPackageCheckBox</tabstop>
+ <tabstop>appIconCheckBox</tabstop>
+ <tabstop>archComboBox</tabstop>
+ <tabstop>genHTMLCheckBox</tabstop>
+ <tabstop>useRPMInfoCheckBox</tabstop>
+ <tabstop>genHTMLPushButton</tabstop>
+ <tabstop>resetHTMLPushButton</tabstop>
+ <tabstop>uploadftpkdeorgCheckBox</tabstop>
+ <tabstop>uploadAppsKDEcomCheckBox</tabstop>
+ <tabstop>uploadCustomCheckBox</tabstop>
+ <tabstop>uploadURLLineEdit</tabstop>
+ <tabstop>uploadSubmitPushButton</tabstop>
+ <tabstop>uploadResetPushButton</tabstop>
+ <tabstop>uploadAddFileToolButton</tabstop>
+ <tabstop>uploadRemoveToolButton</tabstop>
+ <tabstop>uploadFileListBox</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in implementation">kiconloader.h</include>
+ <include location="global" impldecl="in implementation">kpushbutton.h</include>
+ <include location="global" impldecl="in implementation">klistbox.h</include>
+ <include location="global" impldecl="in implementation">klineedit.h</include>
+ <include location="global" impldecl="in implementation">ktextedit.h</include>
+</includes>
+<slots>
+ <slot>slotbuildAllPushButtonPressed()</slot>
+ <slot>slotexportSPECPushButtonPressed()</slot>
+ <slot>slotimportSPECPushButtonPressed()</slot>
+ <slot>slotsrcPackagePushButtonPressed()</slot>
+ <slot>slotAddFileButtonPressed()</slot>
+ <slot>slotRemoveFile(QListBoxItem *item)</slot>
+</slots>
+<pixmapfunction>DesktopIcon</pixmapfunction>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>ktextedit.h</includehint>
+ <includehint>ktextedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/distpart/distpart_widget.cpp b/parts/distpart/distpart_widget.cpp
new file mode 100644
index 00000000..71c981e8
--- /dev/null
+++ b/parts/distpart/distpart_widget.cpp
@@ -0,0 +1,605 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "distpart_widget.h"
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kprocess.h>
+#include <kfiledialog.h>
+#include <kio/netaccess.h>
+#include <klocale.h>
+#include "kdevproject.h"
+#include "domutil.h"
+#include <ktar.h>
+#include <kmessagebox.h>
+
+#include <kdevcore.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qnetwork.h>
+#include <qurloperator.h>
+#include <qmessagebox.h>
+#include "distpart_part.h"
+#include <qdir.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qtabwidget.h>
+#include "kdevmakefrontend.h"
+#include <kprogress.h>
+
+#include <qerrormessage.h>
+#include "specsupport.h"
+#include "lsmsupport.h"
+
+DistpartDialog::DistpartDialog(DistpartPart *part, QWidget *parent)
+ :distpart_ui(parent, "dist_widget"), m_part(part) {
+ m_spec = new SpecSupport(m_part);
+
+ connect( customProjectCheckBox, SIGNAL(toggled(bool) ),
+ this, SLOT(slotcustomProjectCheckBoxChanged()));
+ connect( uploadCustomCheckBox, SIGNAL(toggled(bool)),
+ this, SLOT(slotuploadCustomCheckBoxChanged()));
+
+// connect( okayPushButton, SIGNAL(clicked()),
+// this, SLOT(slotokayPushButtonPressed()));
+// connect( cancelPushButton, SIGNAL(clicked()),
+// this, SLOT(slotcancelPushButtonPressed()));
+/* connect(help_PushButton, SIGNAL(clicked()),
+ this, SLOT(slothelp_PushButtonPressed()));*/
+ connect( createSrcArchPushButton, SIGNAL(clicked()),
+ this, SLOT(slotcreateSrcArchPushButtonPressed()));
+ connect( resetSrcPushButton, SIGNAL(clicked()),
+ this, SLOT(slotresetSrcPushButtonPressed()));
+
+ connect( genHTMLPushButton, SIGNAL(clicked()),
+ this, SLOT(slotgenHTMLPushButtonPressed()));
+ connect( resetHTMLPushButton, SIGNAL(clicked()),
+ this, SLOT(slotresetHTMLPushButtonPressed()));
+ connect( uploadSubmitPushButton, SIGNAL(clicked()),
+ this, SLOT(slotuploadSubmitPushButtonPressed()));
+ connect( uploadResetPushButton, SIGNAL(clicked()),
+ this, SLOT(slotuploadResetPushButtonPressed()));
+ connect( uploadAddFileToolButton, SIGNAL(clicked()),
+ this, SLOT(slotuploadAddFileToolButtonPressed()));
+ connect( uploadRemoveToolButton, SIGNAL(clicked()),
+ this, SLOT(slotuploadRemoveToolButtonPressed()));
+ connect ( srcDistFileListBox, SIGNAL(clicked(QListBoxItem *item)), this, SLOT(slotRemoveFile(QListBoxItem *item)));
+// connect( buildAllPushButton, SIGNAL( clicked() ), this, SLOT( slotbuildAllPushButtonPressed() ));
+// connect( exportSPECPushButton, SIGNAL( clicked() ), this, SLOT( slotexportSPECPushButtonPressed( ) ) );
+// connect( srcPackagePushButton, SIGNAL( clicked() ), this, SLOT( slotsrcPackagePushButtonPressed() ) );
+// connect( importSPECPushButton, SIGNAL( clicked() ), this, SLOT( slotimportSPECPushButtonPressed() ) );
+ loadSettings();
+
+
+ localOptionsGroupBox->setEnabled(false);
+ devPackageCheckBox->setEnabled(false);
+ docsPackageCheckBox->setEnabled(false);
+ appIconCheckBox->setEnabled(false);
+ uploadftpkdeorgCheckBox->setEnabled(false);
+ uploadAppsKDEcomCheckBox->setEnabled(false);
+}
+
+
+DistpartDialog::~DistpartDialog() {
+}
+
+// QPushButton* okayPushButton;
+
+void DistpartDialog::slotokayPushButtonPressed() {
+ storeSettings();
+// accept();
+}
+// QPushButton* cancelPushButton;
+
+void DistpartDialog::slotcancelPushButtonPressed() {
+// reject();
+}
+// QPushButton* help_PushButton;
+
+/*void DistpartDialog::slothelp_PushButtonPressed() {
+ QMessageBox::about(this,i18n("Distpart Help"),i18n("In order to build a RPM package :\n\t1) Create a source archive\n\t2) Generate a SPEC File\n\t3) Build the package"));
+}*/
+
+// QPushButton* createSrcArchPushButton;
+void DistpartDialog::slotcreateSrcArchPushButtonPressed() {
+ kdDebug() << "Starting archive..." << endl;
+ QString dist = (getcustomProjectCheckBoxState() && getbzipCheckBoxState()) ? "application/x-bzip2" : "application/x-gzip";
+
+ QString filename = m_part->project()->projectDirectory() + "/" + getSourceName();
+
+ KTar tar(filename, dist);
+ if ( tar.open(IO_WriteOnly) )
+ {
+ //QStringList files = m_part->project()->distFiles();
+ KProgressDialog *prog = new KProgressDialog( 0, "dialog", i18n("Building Package"), "", true );
+ prog->show();
+ for( uint idx = 0; idx < srcDistFileListBox->numRows(); ++idx)
+ {
+ QString file = srcDistFileListBox->text(idx);
+ if ( !tar.addLocalFile( m_part->project()->projectDirectory() + "/" + file, getappNameFormatLineEditText() + "/" + file) )
+ {
+ kdDebug() << "Failed to write file " << file << endl;
+ }
+ else
+ {
+ prog->setLabel(i18n("Adding file: %1").arg( file) );
+ prog->progressBar()->setValue( (idx*100)/srcDistFileListBox->numRows() );
+ }
+ }
+ tar.close( );
+ prog->hide();
+ delete prog;
+ KMessageBox::information( this, i18n("Archive made at: %1").arg( filename ), i18n("Archive Done") );
+
+ }
+ else
+ {
+ kdDebug() << "Failed to open archive..." << endl;
+ }
+
+}
+
+// QPushButton* resetSrcPushButton;
+void DistpartDialog::slotresetSrcPushButtonPressed() {
+ srcDistFileListBox->clear();
+ loadSettings();
+}
+
+
+
+// QPushButton* genHTMLPushButton;
+void DistpartDialog::slotgenHTMLPushButtonPressed() {}
+
+// QPushButton* resetHTMLPushButton;
+void DistpartDialog::slotresetHTMLPushButtonPressed() {}
+
+// QToolButton* uploadAddFileToolButton;
+void DistpartDialog::slotuploadAddFileToolButtonPressed() {
+ uploadFileListBox->insertStringList(KFileDialog::getOpenFileNames());
+}
+
+// QToolButton* uploadRemoveToolButton;
+void DistpartDialog::slotuploadRemoveToolButtonPressed() {
+ for(unsigned int i=0; i< uploadFileListBox->count(); i++)
+ if ( uploadFileListBox->isSelected(i)) uploadFileListBox->removeItem(i);
+}
+
+// QPushButton* uploadSubmitPushButton;
+void DistpartDialog::slotuploadSubmitPushButtonPressed() {
+
+ if(getuploadftpkdeorgCheckBoxState() || getuploadAppsKDEcomCheckBoxState())
+ kdDebug() << "Implement ftp.kde.org & apps.kde.com ftp transfer" << endl;
+ else {
+ for(unsigned int i=0; i< uploadFileListBox->count(); i++)
+ KIO::NetAccess::copy(KURL::fromPathOrURL( uploadFileListBox->text(i) ),
+ KURL::fromPathOrURL( getuploadURLLineEditText() + uploadFileListBox->text(i).replace(QRegExp("[^/]*/"),"") ));
+ }
+}
+
+// QPushButton* uploadResetPushButton;
+void DistpartDialog::slotuploadResetPushButtonPressed() {
+ uploadFileListBox->clear();
+}
+
+// Connect Slots to the following widgets and add
+// accessors and mutators
+
+
+// QCheckBox* customProjectCheckBox;
+void DistpartDialog::slotcustomProjectCheckBoxChanged() {
+ kdDebug () << "New State" << customProjectCheckBox->isChecked() << endl;
+ sourceOptionsGroupBox->setEnabled( customProjectCheckBox->isChecked());
+}
+
+bool DistpartDialog::getcustomProjectCheckBoxState() {
+ return customProjectCheckBox->isChecked();
+}
+
+void DistpartDialog::setcustomProjectCheckBoxState(bool state) {
+ customProjectCheckBox->setChecked(state);
+}
+
+// QCheckBox* uploadCustomCheckBox;
+void DistpartDialog::slotuploadCustomCheckBoxChanged() {
+ uploadURLLineEdit->setEnabled( uploadCustomCheckBox->isChecked());
+}
+
+bool DistpartDialog::getuploadCustomCheckBoxState() {
+ return uploadCustomCheckBox->isChecked();
+}
+
+void DistpartDialog::setuploadCustomCheckBoxState(bool state) {
+ uploadCustomCheckBox->setChecked(state);
+}
+
+// Add accessors and mutators for the following
+
+// QCheckBox* bzipCheckBox;
+bool DistpartDialog::getbzipCheckBoxState() {
+ return bzipCheckBox->isChecked();
+}
+
+void DistpartDialog::setbzipCheckBoxState(bool state) {
+ bzipCheckBox->setChecked(state);
+}
+
+// QCheckBox* appIconCheckBox;
+bool DistpartDialog::getappIconCheckBoxState() {
+ return appIconCheckBox->isChecked();
+}
+
+void DistpartDialog::setappIconCheckBoxState(bool state) {
+ appIconCheckBox->setChecked(state);
+}
+
+// QCheckBox* genHTMLCheckBox;
+bool DistpartDialog::getgenHTMLCheckBoxState() {
+ return genHTMLCheckBox->isChecked();
+}
+
+void DistpartDialog::setgenHTMLCheckBoxState(bool state) {
+ genHTMLCheckBox->setChecked(state);
+}
+
+// QCheckBox* useRPMInfoCheckBox;
+bool DistpartDialog::getuseRPMInfoCheckBoxState() {
+ return useRPMInfoCheckBox->isChecked();
+}
+
+void DistpartDialog::setuseRPMInfoCheckBoxState(bool state) {
+ useRPMInfoCheckBox->setChecked(state);
+}
+
+// QCheckBox* uploadAppsKDEcomCheckBox;
+bool DistpartDialog::getuploadAppsKDEcomCheckBoxState() {
+ return uploadAppsKDEcomCheckBox->isChecked();
+}
+
+void DistpartDialog::setuploadAppsKDEcomCheckBoxState(bool state) {
+ uploadAppsKDEcomCheckBox->setChecked(state);
+}
+
+// QCheckBox* uploadftpkdeorgCheckBox;
+bool DistpartDialog::getuploadftpkdeorgCheckBoxState() {
+ return uploadftpkdeorgCheckBox->isChecked();
+}
+
+void DistpartDialog::setuploadftpkdeorgCheckBoxState(bool state) {
+ uploadftpkdeorgCheckBox->setChecked(state);
+}
+
+// QCheckBox* devPackageCheckBox;
+bool DistpartDialog::getdevPackageCheckBoxState() {
+ return devPackageCheckBox->isChecked();
+}
+
+void DistpartDialog::setdevPackageCheckBoxState(bool state) {
+ devPackageCheckBox->setChecked(state);
+}
+
+// QCheckBox* docsPackageCheckBox;
+bool DistpartDialog::getdocsPackageCheckBoxState() {
+ return docsPackageCheckBox->isChecked();
+}
+
+void DistpartDialog::setdocsPackageCheckBoxState(bool state) {
+ docsPackageCheckBox->setChecked(state);
+}
+
+// QLineEdit* archNameFormatLineEdit;
+QString DistpartDialog::getarchNameFormatLineEditText() {
+ return archNameFormatLineEdit->text();
+}
+
+void DistpartDialog::setarchNameFormatLineEditText(QString text) {
+ archNameFormatLineEdit->setText(text);
+}
+
+// QLineEdit* appNameLineEdit;
+QString DistpartDialog::getappNameFormatLineEditText() {
+ return appNameLineEdit->text();
+}
+
+void DistpartDialog::setappNameFormatLineEditText(QString text) {
+ appNameLineEdit->setText(text);
+}
+
+// QLineEdit* summaryLineEdit;
+QString DistpartDialog::getsummaryLineEditText() {
+ return summaryLineEdit->text();
+}
+
+void DistpartDialog::setsummaryLineEditText(QString text) {
+ summaryLineEdit->setText(text);
+}
+
+// QLineEdit* groupLineEdit;
+QString DistpartDialog::getgroupLineEditText() {
+ return groupLineEdit->text();
+}
+
+void DistpartDialog::setgroupLineEditText(QString text) {
+ groupLineEdit->setText(text);
+}
+
+// QLineEdit* releaseLineEdit;
+QString DistpartDialog::getreleaseLineEditText() {
+ return releaseLineEdit->text();
+}
+
+void DistpartDialog::setreleaseLineEditText(QString text) {
+ releaseLineEdit->setText(text);
+}
+
+// QLineEdit* VersionLineEdit;
+QString DistpartDialog::getversionLineEditText() {
+ return versionLineEdit->text();
+}
+
+void DistpartDialog::setversionLineEditText(QString text) {
+ versionLineEdit->setText( text );
+}
+
+// QLineEdit* VendorLineEdit;
+QString DistpartDialog::getvendorLineEditText() {
+ return vendorLineEdit->text();
+}
+
+void DistpartDialog::setvendorLineEditText(QString text) {
+ vendorLineEdit->setText(text);
+}
+
+// QLineEdit* LicenseLineEdit;
+QString DistpartDialog::getlicenseLineEditText() {
+ return licenseLineEdit->text();
+}
+
+void DistpartDialog::setlicenseLineEditText(QString text) {
+ licenseLineEdit->setText(text);
+}
+
+// QLineEdit* uploadURLLineEdit;
+QString DistpartDialog::getuploadURLLineEditText() {
+ return uploadURLLineEdit->text();
+}
+
+void DistpartDialog::setuploadURLLineEditText(QString text) {
+ uploadURLLineEdit->setText(text);
+}
+
+// QLineEdit* PackagerLineEdit;
+QString DistpartDialog::getpackagerLineEditText() {
+ return packagerLineEdit->text();
+}
+
+void DistpartDialog::setpackagerLineEditText(QString text) {
+ packagerLineEdit->setText(text);
+}
+
+// QComboBox* archComboBox;
+QString DistpartDialog::getarchComboBoxText() {
+ return archComboBox->currentText();
+}
+
+int DistpartDialog::getarchComboBoxItem() {
+ return archComboBox->currentItem();
+}
+
+void DistpartDialog::setarchComboBoxItem(int item) {
+ archComboBox->setCurrentItem( item );
+}
+
+// QListBox* uploadFileListBox;
+QString DistpartDialog::getuploadFileListBoxText() {
+ return uploadFileListBox->currentText();
+}
+
+int DistpartDialog::getuploadFileListBoxItem() {
+ return uploadFileListBox->currentItem();
+}
+
+void DistpartDialog::setuploadFileListBoxItem(int item) {
+ uploadFileListBox->setCurrentItem( item);
+}
+
+// QListBox* srcDistFileListBox;
+QString DistpartDialog::getsrcDistFileListBoxText() {
+ return srcDistFileListBox->currentText ();
+}
+
+int DistpartDialog::getsrcDistFileListBoxItem() {
+ return srcDistFileListBox->currentItem ();
+}
+
+void DistpartDialog::setsrcDistFileListBoxItem(int item) {
+ srcDistFileListBox->setCurrentItem( item );
+}
+
+// QMultiLineEdit* projectDescriptionMultilineEdit;
+QString DistpartDialog::getprojectDescriptionMultilineEditText() {
+ return projectDescriptionMultilineEdit->text();
+}
+
+void DistpartDialog::setprojectDescriptionMultilineEditText(QString text) {
+ projectDescriptionMultilineEdit->setText(text);
+}
+
+QString DistpartDialog::getprojectChangelogMultilineEditText() {
+ return projectChangelogMultilineEdit->text();
+}
+
+void DistpartDialog::setprojectChangelogMultilineEditText(QString text) {
+ projectChangelogMultilineEdit->setText(text);
+}
+
+QString DistpartDialog::getSourceName() {
+ QString name = (getcustomProjectCheckBoxState()) ? getarchNameFormatLineEditText() : QString("%n-%v");
+ name += (getcustomProjectCheckBoxState() && getbzipCheckBoxState()) ? ".tar.bz2" : ".tar.gz";
+ return name.replace(QRegExp("%n"),getappNameFormatLineEditText())
+ .replace(QRegExp("%v"),getversionLineEditText())
+ .replace(QRegExp("%d"),QDate::currentDate().toString("yyyyMMdd"));
+}
+
+void DistpartDialog::loadSettings() {
+ QDomDocument &dom = *m_part->projectDom();
+
+ srcDistFileListBox->insertStringList( m_part->project()->distFiles() );
+
+ // First Tab
+ setcustomProjectCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/custom",false));
+ slotcustomProjectCheckBoxChanged();
+ setbzipCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/bzip",false));
+ setarchNameFormatLineEditText(DomUtil::readEntry(dom,"/dist/archname"));
+
+
+ // Second Tab
+ setappNameFormatLineEditText(DomUtil::readEntry(dom,"/dist/appname", m_part->project()->projectName() ));
+ setversionLineEditText(DomUtil::readEntry(dom,"/dist/version",DomUtil::readEntry(dom,"/general/version")));
+ setreleaseLineEditText(DomUtil::readEntry(dom,"/dist/release"));
+ setvendorLineEditText(DomUtil::readEntry(dom,"/dist/vendor"));
+ setlicenseLineEditText(DomUtil::readEntry(dom,"/dist/licence"));
+ setsummaryLineEditText(DomUtil::readEntry(dom,"/dist/summary"));
+ setgroupLineEditText(DomUtil::readEntry(dom,"/dist/group"));
+ setpackagerLineEditText(DomUtil::readEntry(dom,"/dist/packager"));
+ setprojectDescriptionMultilineEditText(DomUtil::readEntry(dom,"/dist/description",DomUtil::readEntry(dom,"/general/description")));
+ setprojectChangelogMultilineEditText(DomUtil::readEntry(dom,"/dist/changelog"));
+ setdevPackageCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/devpackage"));
+ setdocsPackageCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/docspackage"));
+ setappIconCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/appicon"));
+ setarchComboBoxItem(DomUtil::readIntEntry(dom,"/dist/arch"));
+
+ // Third Tab
+ setgenHTMLCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/genHTML"));
+ setuseRPMInfoCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/useRPM"));
+ setuploadftpkdeorgCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/ftpkde"));
+ setuploadAppsKDEcomCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/appskde"));
+ setuploadCustomCheckBoxState(DomUtil::readBoolEntry(dom,"/dist/custom"));
+ slotuploadCustomCheckBoxChanged();
+ setuploadURLLineEditText(DomUtil::readEntry(dom,"/dist/url"));
+}
+
+void DistpartDialog::storeSettings() {
+ QDomDocument &dom = *m_part->projectDom();
+
+ // First Tab
+ DomUtil::writeBoolEntry(dom,"/dist/custom",getcustomProjectCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/bzip",getbzipCheckBoxState());
+ DomUtil::writeEntry(dom,"/dist/archname",getarchNameFormatLineEditText());
+
+ // Second Tab
+ DomUtil::writeEntry(dom,"/dist/appname",getappNameFormatLineEditText());
+ DomUtil::writeEntry(dom,"/dist/version",getversionLineEditText());
+ DomUtil::writeEntry(dom,"/dist/release",getreleaseLineEditText());
+ DomUtil::writeEntry(dom,"/dist/vendor",getvendorLineEditText());
+ DomUtil::writeEntry(dom,"/dist/licence",getlicenseLineEditText());
+ DomUtil::writeEntry(dom,"/dist/summary",getsummaryLineEditText());
+ DomUtil::writeEntry(dom,"/dist/group",getgroupLineEditText());
+ DomUtil::writeEntry(dom,"/dist/packager",getpackagerLineEditText());
+ DomUtil::writeEntry(dom,"/dist/description",getprojectDescriptionMultilineEditText());
+ DomUtil::writeEntry(dom,"/dist/changelog",getprojectChangelogMultilineEditText());
+ DomUtil::writeBoolEntry(dom,"/dist/devpackage",getdevPackageCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/docspackage",getdocsPackageCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/appicon",getappIconCheckBoxState());
+ DomUtil::writeIntEntry(dom,"/dist/arch",getarchComboBoxItem());
+
+ // Third Tab
+ DomUtil::writeBoolEntry(dom,"/dist/genHTML",getgenHTMLCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/useRPM",getuseRPMInfoCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/ftpkde",getuploadftpkdeorgCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/appskde",getuploadAppsKDEcomCheckBoxState());
+ DomUtil::writeBoolEntry(dom,"/dist/custom",getuploadCustomCheckBoxState());
+ DomUtil::writeEntry(dom,"/dist/url",getuploadURLLineEditText());
+}
+// Populate Spec Data from UI;
+void DistpartDialog::setPackageData()
+{
+ m_spec->setAppRevision( releaseLineEdit->text());
+ m_spec->setAppName( appNameLineEdit->text());
+ m_spec->setAppVendor( vendorLineEdit->text());
+ m_spec->setAppLicense( licenseLineEdit->text());
+ m_spec->setAppSummary( summaryLineEdit->text());
+ m_spec->setAppPackager( packagerLineEdit->text());
+ m_spec->setAppVersion( versionLineEdit->text());
+ m_spec->setAppGroup( groupLineEdit->text());
+ m_spec->setAppDescription( projectDescriptionMultilineEdit->text());
+ m_spec->setAppChangelog( projectChangelogMultilineEdit->text());
+}
+// Populate UI from Spec data;
+void DistpartDialog::getPackageData()
+{
+ releaseLineEdit->setText(m_spec->getAppRevision());
+ appNameLineEdit->setText(m_spec->getAppName());
+ vendorLineEdit->setText(m_spec->getAppVendor());
+ licenseLineEdit->setText(m_spec->getAppLicense( ));
+ summaryLineEdit->setText(m_spec->getAppSummary( ));
+ packagerLineEdit->setText(m_spec->getAppPackager( ));
+ versionLineEdit->setText(m_spec->getAppVersion());
+ groupLineEdit->setText(m_spec->getAppGroup( ));
+ projectDescriptionMultilineEdit->setText(m_spec->getAppDescription( ));
+ projectChangelogMultilineEdit->setText(m_spec->getAppChangelog( ));
+}
+void DistpartDialog::slotbuildAllPushButtonPressed( )
+{
+ setPackageData();
+ m_spec->slotbuildAllPushButtonPressed();
+}
+
+void DistpartDialog::slotexportSPECPushButtonPressed( )
+{
+ setPackageData();
+ m_spec->slotexportSPECPushButtonPressed();
+}
+
+void DistpartDialog::slotimportSPECPushButtonPressed( )
+{
+ m_spec->slotimportSPECPushButtonPressed();
+ getPackageData();
+}
+
+void DistpartDialog::slotsrcPackagePushButtonPressed( )
+{
+ setPackageData();
+ m_spec->slotsrcPackagePushButtonPressed();
+}
+
+
+void DistpartDialog::slotAddFileButtonPressed(){
+ QStringList filenames = KFileDialog::getOpenFileNames();
+ for(uint count =0; count< filenames.size(); count++){
+ QString base = m_part->project()->projectDirectory() +"/";
+ srcDistFileListBox->insertItem(filenames[count].remove(base));
+ }
+}
+
+void DistpartDialog::slotRemoveFile(QListBoxItem *item){
+ if ( KMessageBox::Yes == KMessageBox::warningYesNo( this, i18n("Remove %1").arg( item->text() ), i18n("Remove File") )){
+ for(uint count =0; count< srcDistFileListBox->numRows(); count++){
+ if ( item == srcDistFileListBox->item(count)){
+ srcDistFileListBox->removeItem(count);
+ break;
+ }
+ }
+ }
+}
+
+#include "distpart_widget.moc"
diff --git a/parts/distpart/distpart_widget.h b/parts/distpart/distpart_widget.h
new file mode 100644
index 00000000..81d91700
--- /dev/null
+++ b/parts/distpart/distpart_widget.h
@@ -0,0 +1,210 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __DISTPART_WIDGET_H__
+#define __DISTPART_WIDGET_H__
+
+
+#include <qwidget.h>
+#include <qstring.h>
+#include "distpart_ui.h"
+#include <klistbox.h>
+#include <qcheckbox.h>
+#include <kpushbutton.h>
+#include <klineedit.h>
+#include <ktextedit.h>
+#include <qcombobox.h>
+#include <qprogressbar.h>
+
+class KDevProject;
+class DistpartPart;
+class QUrlOperator;
+class KProcess;
+class QTabWidget;
+class SpecSupport;
+
+namespace KParts {
+class ReadOnlyPart;
+}
+
+
+class DistpartDialog : public distpart_ui {
+ Q_OBJECT
+
+public:
+
+ DistpartDialog(DistpartPart *part, QWidget *parent);
+ ~DistpartDialog();
+
+signals:
+ void okay();
+ void cancel();
+ void help();
+ void createsrc();
+ void resetsrc();
+ void buildall();
+ void savespec();
+ void loadspec();
+ void srcrpm();
+ void genhtml();
+ void resethtml();
+ void upload();
+ void resetupload();
+
+ // Accessors and mutators to control GUI
+ // Connect Slots to the following widgets
+
+
+public slots:
+ // QPushButton* okayPushButton;
+
+
+ void slotokayPushButtonPressed();
+ // QPushButton* cancelPushButton;
+ void slotcancelPushButtonPressed();
+ // QPushButton* help_PushButton;
+// void slothelp_PushButtonPressed();
+ // QPushButton* createSrcArchPushButton;
+ void slotcreateSrcArchPushButtonPressed();
+ // QPushButton* resetSrcPushButton;
+ void slotresetSrcPushButtonPressed();
+
+ // QPushButton* genHTMLPushButton;
+ void slotgenHTMLPushButtonPressed();
+ // QPushButton* resetHTMLPushButton;
+ void slotresetHTMLPushButtonPressed();
+ // QToolButton* uploadAddFileToolButton;
+ void slotuploadAddFileToolButtonPressed();
+ // QToolButton* uploadRemoveToolButton;
+ void slotuploadRemoveToolButtonPressed();
+ // QPushButton* uploadSubmitPushButton;
+ void slotuploadSubmitPushButtonPressed();
+ // QPushButton* uploadResetPushButton;
+ void slotuploadResetPushButtonPressed();
+
+ // Connect Slots to the following widgets and add
+ // accessors and mutators
+ // QCheckBox* customProjectCheckBox;
+ void slotcustomProjectCheckBoxChanged();
+ // QCheckBox* uploadCustomCheckBox;
+ void slotuploadCustomCheckBoxChanged();
+
+ void slotbuildAllPushButtonPressed();
+ void slotexportSPECPushButtonPressed();
+ void slotimportSPECPushButtonPressed();
+ void slotsrcPackagePushButtonPressed();
+ void slotAddFileButtonPressed();
+ void slotRemoveFile(QListBoxItem *item);
+
+public:
+ bool getcustomProjectCheckBoxState();
+ void setcustomProjectCheckBoxState(bool state);
+ bool getuploadCustomCheckBoxState();
+ void setuploadCustomCheckBoxState(bool state);
+
+ // Add accessors and mutators for the following
+
+ // QCheckBox* bzipCheckBox;
+ bool getbzipCheckBoxState();
+ void setbzipCheckBoxState(bool state);
+ // QCheckBox* appIconCheckBox;
+ bool getappIconCheckBoxState();
+ void setappIconCheckBoxState(bool state);
+ // QCheckBox* genHTMLCheckBox;
+ bool getgenHTMLCheckBoxState();
+ void setgenHTMLCheckBoxState(bool state);
+ // QCheckBox* useRPMInfoCheckBox;
+ bool getuseRPMInfoCheckBoxState();
+ void setuseRPMInfoCheckBoxState(bool state);
+ // QCheckBox* uploadAppsKDEcomCheckBox;
+ bool getuploadAppsKDEcomCheckBoxState();
+ void setuploadAppsKDEcomCheckBoxState(bool state);
+ // QCheckBox* uploadftpkdeorgCheckBox;
+ bool getuploadftpkdeorgCheckBoxState();
+ void setuploadftpkdeorgCheckBoxState(bool state);
+ // QCheckBox* devPackageCheckBox;
+ bool getdevPackageCheckBoxState();
+ void setdevPackageCheckBoxState(bool state);
+ // QCheckBox* docsPackageCheckBox;
+ bool getdocsPackageCheckBoxState();
+ void setdocsPackageCheckBoxState(bool state);
+ // QLineEdit* archNameFormatLineEdit;
+ QString getarchNameFormatLineEditText();
+ void setarchNameFormatLineEditText(QString text);
+ // QLineEdit* appNameLineEdit;
+ QString getappNameFormatLineEditText();
+ void setappNameFormatLineEditText(QString text);
+ // QLineEdit* summaryLineEdit;
+ QString getsummaryLineEditText();
+ void setsummaryLineEditText(QString text);
+ // QLineEdit* groupLineEdit;
+ QString getgroupLineEditText();
+ void setgroupLineEditText(QString text);
+ // QLineEdit* releaseLineEdit;
+ QString getreleaseLineEditText();
+ void setreleaseLineEditText(QString text);
+ // QLineEdit* VersionLineEdit;
+ QString getversionLineEditText();
+ void setversionLineEditText(QString text);
+ // QLineEdit* VendorLineEdit;
+ QString getvendorLineEditText();
+ void setvendorLineEditText(QString text);
+ // QLineEdit* LicenseLineEdit;
+ QString getlicenseLineEditText();
+ void setlicenseLineEditText(QString text);
+ // QLineEdit* uploadURLLineEdit;
+ QString getuploadURLLineEditText();
+ void setuploadURLLineEditText(QString text);
+ // QLineEdit* PackagerLineEdit;
+ QString getpackagerLineEditText();
+ void setpackagerLineEditText(QString text);
+ // QComboBox* archComboBox;
+ QString getarchComboBoxText();
+ int getarchComboBoxItem();
+ void setarchComboBoxItem(int item);
+ // QListBox* uploadFileListBox;
+ QString getuploadFileListBoxText();
+ int getuploadFileListBoxItem();
+ void setuploadFileListBoxItem(int item);
+ // QListBox* srcDistFileListBox;
+ QString getsrcDistFileListBoxText();
+ int getsrcDistFileListBoxItem();
+ void setsrcDistFileListBoxItem(int item);
+ // QMultiLineEdit* projectDescriptionMultilineEdit;
+ QString getprojectDescriptionMultilineEditText();
+ void setprojectDescriptionMultilineEditText(QString text);
+
+ QString getprojectChangelogMultilineEditText();
+ void setprojectChangelogMultilineEditText(QString text);
+
+ QString getSourceName();
+
+private:
+ void loadSettings();
+ void storeSettings();
+ void setPackageData();
+ void getPackageData();
+
+ SpecSupport *m_spec;
+ DistpartPart *m_part;
+ QString dir;
+};
+
+
+#endif
diff --git a/parts/distpart/kdevdistpart.desktop b/parts/distpart/kdevdistpart.desktop
new file mode 100644
index 00000000..8eaf44ee
--- /dev/null
+++ b/parts/distpart/kdevdistpart.desktop
@@ -0,0 +1,70 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Aids in building and publishing the final project. Supports creation of RPM packages or source packages.
+Comment[ca]=Ajuda en la construcció i publicació del projecte final. Suporta la creació de paquets RPM o paquets font.
+Comment[da]=Hjælper til med at bygge og publicere det færdige projekt. Understøtter at oprette RPM-pakker og kildekodepakker.
+Comment[de]=Unterstützt beim Erstellen und Ausliefern des fertigen Projekts. Derzeit werden RPM- und Quell-Pakete unterstützt.
+Comment[el]=Βοηθά στην κατασκευή και δημοσίευση του τελικού έργου. Για την ώρα υποστηρίζεται μόνο η μορφή RPM.
+Comment[es]=Ayuda en la construcción y publicación del proyecto final. Contempla la creación de paquetes RPM y de código fuente.
+Comment[et]=Abi valmisprojekti ehitamisel ja avaldamisel. Toetatud on RPM-pakettide ja lähtekoodipakettide loomine.
+Comment[fr]=Outil d'aide à la construction et à la publication du projet final. Prend en charge la création de paquetages RPM ou de paquetages de sources.
+Comment[hu]=A projekt felépítésében és publikálásában segít. RPM és forráscsomagok készítését teszi lehetővé.
+Comment[it]=Aiuta nella compilazione e pubblicazione del progetto finale. Supporta la creazione di pacchetti RPM o di pacchetti sorgenti.
+Comment[ms]=Membantu dalam membina dan menerbitkan projek akhir. Menyokong penciptaan pakej RPM atau pakej sumber.
+Comment[nds]=Ünnerstütten för't Opstellen un Apenmaken vun't fardige Projekt. Ünnerstütt dat Opstellen vun RPMs un Bornpaketen.
+Comment[nl]=Helpt bij het bouwen en publiceren van het uiteindelijke project. Ondersteunt het aanmaken van RPM-pakketten of broncodepakketten.
+Comment[pl]=Pomoc w budowaniu i publikowaniu projektu. Obsługuje tworzenie pakietów RPM i paczek ze źródłami.
+Comment[pt]=Ajuda na construção e publicação do projecto final. Suporta a criação de pacotes RPM ou pacotes com código-fonte.
+Comment[pt_BR]=Auxilia na compilação e publicação do projeto final. Suporta a criação de pacotes RPM ou pacotes fontes.
+Comment[ru]=Помощник по сборке и распространению окончательных версий проекта. Поддерживает создание пакетов RPM или пакетов с исходным кодом.
+Comment[sk]=Pomáha pri vytváraní a publikovaní finálneho projektu. Podporované sú RPM a zdrojové balíčky.
+Comment[sr]=Помаже у грађењу и објављивању коначног пројекта. За сада је подржано стварање RPM и изворних пакета.
+Comment[sr@Latn]=Pomaže u građenju i objavljivanju konačnog projekta. Za sada je podržano stvaranje RPM i izvornih paketa.
+Comment[sv]=Hjälper till att bygga och publicera det färdiga projektet. Stöder att skapa RPM-paket och källkodspaket.
+Comment[zh_TW]=協助建立與發布最終專案版本。支援建立 RPM 套件與 RPM 源碼套件。
+Name=KDevdistpart
+Name[da]=KDevelop distpart
+Name[de]=Unterstützung für Paketerstellung (KDevelop)
+Name[hi]=के-डेव-डिस्टपार्ट
+Name[nds]=Paketopstell-Ünnerstütten för't KDevelop
+Name[sk]=KDev distribúcia
+Name[sv]=KDevelop distributionsdel
+Name[zh_TW]=KDevelop 發布元件
+GenericName=Final Packaging Support
+GenericName[ca]=Suport per a l'empaquetat final
+GenericName[da]=Endelig pakkestøtte
+GenericName[de]=Unterstützung für Paketerstellung
+GenericName[el]=Υποστήριξη τελικού πακέτου
+GenericName[es]=Soporte para empaquetado final
+GenericName[et]=Lõpp-pakendamise toetus
+GenericName[eu]=Azken paketatze euskarria
+GenericName[fa]=پشتیبانی بسته‌بندی نهایی
+GenericName[fr]=Gestion du conditionnement final
+GenericName[gl]=Soporte para empaquetado final
+GenericName[hu]=Csomagelőkészítő
+GenericName[it]=Supporto finale per la creazione di pacchetti
+GenericName[ja]=最終パッケージ化サポート
+GenericName[nds]=Ünnerstütten för't Paketopstellen
+GenericName[ne]=अन्तिम प्याकेजिङ समर्थन
+GenericName[nl]=Ondersteuning voor projectpublicatie
+GenericName[pl]=Obsługa ostatecznego pakowania
+GenericName[pt]=Suporte a Empacotamento Final
+GenericName[pt_BR]=Suporte ao Empacotamento Final
+GenericName[ru]=Сборка и распространение пакетов
+GenericName[sk]=Podpora finálneho balíčkovania
+GenericName[sl]=Podpora končnemu ustarjanju paketov
+GenericName[sr]=Подршка за коначно паковање
+GenericName[sr@Latn]=Podrška za konačno pakovanje
+GenericName[sv]=Stöd för slutpaketering
+GenericName[ta]=ஆதரவுள்ள கடைசி தொகுப்பு
+GenericName[tg]=Ҷамъкунӣ ва ҷорӣ намудани пакетҳо
+GenericName[tr]=Son Paketleme Desteği
+GenericName[zh_CN]=最终打包支持
+GenericName[zh_TW]=最終包裝支援
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevdistpart
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=ProjectPackaging
diff --git a/parts/distpart/kdevpart_distpart.rc b/parts/distpart/kdevpart_distpart.rc
new file mode 100644
index 00000000..8b142d04
--- /dev/null
+++ b/parts/distpart/kdevpart_distpart.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="distpart" library="libdistpartplugin" version="2">
+<MenuBar>
+ <Menu name="project"><Text>&amp;Project</Text>
+ <Action name="make_dist" group="tools_project_operations"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/distpart/lsmsupport.cpp b/parts/distpart/lsmsupport.cpp
new file mode 100644
index 00000000..84414f6a
--- /dev/null
+++ b/parts/distpart/lsmsupport.cpp
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "lsmsupport.h"
+
+LsmSupport::LsmSupport() : packageBase() {
+
+}
+
+LsmSupport::~LsmSupport() {
+}
+
+QString LsmSupport::generatePackage( )
+{
+ return "";
+}
diff --git a/parts/distpart/lsmsupport.h b/parts/distpart/lsmsupport.h
new file mode 100644
index 00000000..3f50c7ea
--- /dev/null
+++ b/parts/distpart/lsmsupport.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __LSMSUPPORT_H__
+#define __LSMSUPPORT_H__
+
+#include "packagebase.h"
+#include "distpart_part.h"
+
+class LsmSupport : public packageBase
+{
+
+public:
+ LsmSupport();
+ virtual ~LsmSupport();
+QString generatePackage( );
+};
+
+#endif
diff --git a/parts/distpart/packagebase.cpp b/parts/distpart/packagebase.cpp
new file mode 100644
index 00000000..797c2613
--- /dev/null
+++ b/parts/distpart/packagebase.cpp
@@ -0,0 +1,117 @@
+#include "packagebase.h"
+
+packageBase::packageBase() {
+
+}
+
+packageBase::~packageBase() {}
+
+QString packageBase::getAppName() {
+ return AppName;
+}
+
+QString packageBase::getAppVersion() {
+ return AppVersion;
+}
+
+QString packageBase::getAppRevision() {
+ return AppRevision;
+}
+
+QString packageBase::getAppGroup() {
+ return AppGroup;
+}
+
+QString packageBase::getAppPackager() {
+ return AppPackager;
+}
+
+QString packageBase::getAppURL() {
+ return AppURL;
+}
+
+QString packageBase::getAppSummary() {
+ return AppSummary;
+}
+
+QString packageBase::getAppVendor() {
+ return AppVendor;
+}
+
+QString packageBase::getAppLicense() {
+ return AppLicense;
+}
+
+QString packageBase::getAppArch() {
+ return AppArch;
+}
+
+QString packageBase::getAppDescription() {
+ return AppDescription;
+}
+
+QString packageBase::getAppChangelog() {
+ return AppChangelog;
+}
+
+QString packageBase::getAppSource() {
+ return AppSource;
+}
+
+QStringList packageBase::getAppFileList() {
+ return AppFileList;
+}
+
+void packageBase::setAppName(const QString& name) {
+ AppName = name;
+}
+
+void packageBase::setAppVersion(const QString& version){
+ AppVersion = version;
+}
+
+void packageBase::setAppRevision(const QString& revision){
+ AppRevision = revision;
+}
+
+void packageBase::setAppGroup(const QString& group){
+ AppGroup = group;
+}
+
+void packageBase::setAppPackager(const QString& packager){
+ AppPackager = packager;
+}
+
+void packageBase::setAppURL(const QString& url)
+{
+ AppURL = url;
+}
+
+void packageBase::setAppSummary(const QString& summary){
+ AppSummary = summary;
+}
+
+void packageBase::setAppVendor(const QString& vendor){
+ AppVendor = vendor;
+}
+
+void packageBase::setAppLicense(const QString& licence){
+ AppLicense = licence;
+}
+
+void packageBase::setAppArch(const QString& arch){
+ AppArch = arch;
+}
+
+void packageBase::setAppDescription(const QString& description){
+ AppDescription = description;
+}
+
+void packageBase::setAppChangelog(const QString& changelog){
+ AppChangelog = changelog;
+}
+
+void packageBase::setAppFileList( const QStringList & list )
+{
+ AppFileList = list;
+}
diff --git a/parts/distpart/packagebase.h b/parts/distpart/packagebase.h
new file mode 100644
index 00000000..17148982
--- /dev/null
+++ b/parts/distpart/packagebase.h
@@ -0,0 +1,84 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __PACKAGEBASE_H__
+#define __PACKAGEBASE_H__
+
+#include <kurl.h>
+#include <qstringlist.h>
+
+class packageBase
+{
+
+public:
+ packageBase();
+ virtual ~packageBase();
+
+// Generic accessors and mutators for child classes
+ virtual QString generatePackage( ) = 0 ;
+ //virtual bool loadFile(KURL theFile) = 0;
+ //virtual bool saveFile(KURL theFile) = 0;
+
+ virtual QString getAppName();
+ virtual QString getAppVersion();
+ virtual QString getAppRevision();
+ virtual QString getAppGroup();
+ virtual QString getAppPackager();
+ virtual QString getAppURL();
+ virtual QString getAppSummary();
+ virtual QString getAppVendor();
+ virtual QString getAppLicense();
+ virtual QString getAppArch();
+ virtual QString getAppDescription();
+ virtual QString getAppChangelog();
+ virtual QString getAppSource();
+ virtual QStringList getAppFileList();
+
+ virtual void setAppName(const QString&);
+ virtual void setAppVersion(const QString&);
+ virtual void setAppRevision(const QString&);
+ virtual void setAppGroup(const QString&);
+ virtual void setAppPackager(const QString&);
+ virtual void setAppURL(const QString&);
+ virtual void setAppSummary(const QString&);
+ virtual void setAppVendor(const QString&);
+ virtual void setAppLicense(const QString&);
+ virtual void setAppArch(const QString&);
+ virtual void setAppDescription(const QString&);
+ virtual void setAppChangelog(const QString&);
+ virtual void setAppFileList(const QStringList &list);
+
+ private:
+ QString AppName;
+ QString AppVersion;
+ QString AppRevision;
+ QString AppGroup;
+ QString AppPackager;
+ QString AppURL;
+ QString AppSummary;
+ QString AppVendor;
+ QString AppLicense;
+ QString AppArch;
+ QString AppDescription;
+ QString AppChangelog;
+ QString AppSource;
+ QStringList AppFileList;
+};
+
+#endif
diff --git a/parts/distpart/specsupport.cpp b/parts/distpart/specsupport.cpp
new file mode 100644
index 00000000..b9ba6e1e
--- /dev/null
+++ b/parts/distpart/specsupport.cpp
@@ -0,0 +1,315 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "specsupport.h"
+#include "kdevproject.h"
+#include "kdevmakefrontend.h"
+#include "distpart_widget.h"
+
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qerrormessage.h>
+#include <qregexp.h>
+#include <qpushbutton.h>
+//#include <qvbox.h>
+#include <qgroupbox.h>
+#include <qtabwidget.h>
+#include <qmessagebox.h>
+
+/// \FIXME This is at least the fifth place in the kdevelop code something like this exists
+QString QRegExp_escape(const QString& str )
+{
+#if QT_VERSION >= 0x030100
+ return QRegExp::escape(str);
+#else
+ // this block is copyrighted by Trolltech AS (GPL)
+ static const char meta[] = "$()*+.?[\\]^{|}";
+ QString quoted = str;
+ int i = 0;
+
+ while ( i < (int) quoted.length() ) {
+ if ( strchr(meta, quoted[i].latin1()) != 0 )
+ quoted.insert( i++, "\\" );
+ i++;
+ }
+ return quoted;
+#endif
+}
+
+SpecSupport::SpecSupport(DistpartPart *part) : packageBase(), m_part(part) {
+ dir = "";
+
+// srcPackagePushButton = new QPushButton(i18n("Src Package"),area());
+// buildAllPushButton = new QPushButton(i18n("Src/Binary Packages"),area());
+// exportSPECPushButton = new QPushButton(i18n("Export SPEC File"),area());
+// importSPECPushButton = new QPushButton(i18n("Import SPEC File"),area());
+//
+//
+//
+// connect(buildAllPushButton, SIGNAL(clicked()),
+// this, SLOT(slotbuildAllPushButtonPressed()));
+// connect(exportSPECPushButton, SIGNAL(clicked()),
+// this, SLOT(slotexportSPECPushButtonPressed()));
+// connect(importSPECPushButton, SIGNAL(clicked()),
+// this, SLOT(slotimportSPECPushButtonPressed()));
+// connect(srcPackagePushButton, SIGNAL(clicked()),
+// this, SLOT(slotsrcPackagePushButtonPressed()));
+
+ parseDotRpmmacros();
+}
+
+SpecSupport::~SpecSupport() {
+}
+
+// QPushButton* buildAllPushButton;
+void SpecSupport::slotbuildAllPushButtonPressed() {
+ QMap<QString,QString>::Iterator it;
+ QFile file1(dir + "/" + getAppSource());
+ QFile file2(*(map.find("_sourcedir")) + "/" + getAppSource());
+ if (!file2.exists()) {
+ if (!file1.exists()) {
+ QMessageBox::critical(0 ,i18n("Error"),i18n("You need to create a source archive first."));
+ return;
+ }
+ else
+ if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir,"cd " + KProcess::quote(dir) +
+ " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.find("_sourcedir"))));
+ }
+ if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.find("_specdir")) != map.end()) ? (*it) : dir)) +
+ " && rpmbuild -ba " + m_part->project()->projectName() + ".spec");
+}
+
+// QPushButton* exportSPECPushButton;
+void SpecSupport::slotexportSPECPushButtonPressed() {
+ QMap<QString,QString>::Iterator it;
+ QString specname = ((it = map.find("_specdir")) != map.end()) ? (*it) : (m_part->project()->projectDirectory());
+ specname += ("/" + m_part->project()->projectName() + ".spec");
+ QFile file(specname);
+
+ if(file.open(IO_WriteOnly)) {
+ QTextStream stream(&file);
+ stream << generatePackage();
+ file.close();
+ } else {
+ kdDebug() << "TODO : intercept write error in SpecSupport::slotexportSPECPushButtonPressed()";
+ }
+}
+
+QString SpecSupport::getInfo(QString s, QString motif) {
+ QRegExp re(motif + "[ \t]*([^ \t].*[^ \t])[ \t]*");
+ if (re.exactMatch(s))
+ return re.cap(1);
+ return QString::null;
+}
+
+// QPushButton* importSPECPushButton;
+void SpecSupport::slotimportSPECPushButtonPressed() {
+ QString fileName = KFileDialog::getOpenFileName(dir,"*.spec");
+ if( fileName.isEmpty())
+ return;
+ QFile file(fileName);
+
+ if(file.open(IO_ReadOnly)) {
+ QTextStream stream(&file);
+
+ while (!stream.atEnd()) {
+ QString s = stream.readLine();
+ QString info;
+ if (!(info = getInfo(s,"Name:")).isEmpty())
+ setAppName(info);
+ else if (!(info = getInfo(s,"Version:")).isEmpty())
+ setAppVersion(info);
+ else if (!(info = getInfo(s,"Release:")).isEmpty())
+ setAppRevision(info);
+ else if (!(info = getInfo(s,"Vendor:")).isEmpty())
+ setAppVendor(info);
+ else if (!(info = getInfo(s,"Copyright:")).isEmpty())
+ setAppLicense(info);
+ else if (!(info = getInfo(s,"Summary:")).isEmpty())
+ setAppSummary(info);
+ else if (!(info = getInfo(s,"Group:")).isEmpty())
+ setAppGroup(info);
+ else if (!(info = getInfo(s,"Packager:")).isEmpty())
+ setAppPackager(info);
+ else if (s.startsWith("%description")) {
+ QString desc;
+ while (!stream.atEnd()) {
+ QString str = stream.readLine();
+ if (str.startsWith("%")) break;
+ else desc += str + "\n";
+ }
+ setAppDescription(desc);
+ }
+ else if (s.startsWith("%changelog")) {
+ QString change;
+ while (!stream.atEnd()) {
+ QString str = stream.readLine();
+ if (str.startsWith("%")) break;
+ else change += str + "\n";
+ }
+ setAppChangelog(change);
+ }
+ }
+ }
+}
+
+void SpecSupport::slotAddFileButtonPressed(){
+QString filename = KFileDialog::getOpenFileName ();
+}
+
+// QPushButton* srcPackagePushButton;
+void SpecSupport::slotsrcPackagePushButtonPressed() {
+ QMap<QString,QString>::Iterator it;
+
+ QFile file1(dir + "/" + getAppSource());
+ QFile file2(*(map.find("_sourcedir")) + "/" + getAppSource());
+ if (!file2.exists()) {
+ if (!file1.exists()) {
+ QMessageBox::critical(0,i18n("Error"),i18n("You need to create a source archive first."));
+ return;
+ }
+ else
+ if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir,"cd " + KProcess::quote(dir) +
+ " && cp " + KProcess::quote(getAppSource()) + " " + KProcess::quote(*(map.find("_sourcedir"))));
+ }
+ if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir,"cd " + KProcess::quote((((it = map.find("_specdir")) != map.end()) ? (*it) : dir)) +
+ " && rpmbuild -bs " + m_part->project()->projectName() + ".spec");
+}
+
+void SpecSupport::parseDotRpmmacros() {
+ QFile dotfile(QDir::homeDirPath() + "/.rpmmacros");
+
+ if (!dotfile.open(IO_ReadOnly)) {
+// QErrorMessage * msg = new QErrorMessage(this);
+// msg->message("It seems you don't have a ~/.rpmmacros\nYou may experience problems building packages.\n");
+// msg->exec();
+ return;
+ }
+ QTextStream stream(&dotfile);
+
+ // Perhaps will it appear as a necessity to parse the global rpm config file?
+
+ // Pre defined macros :
+ map.insert("name",getAppName());
+
+ // .rpmmacros parsing :
+ while (!stream.atEnd()) {
+ QString s = stream.readLine();
+ QRegExp re("%([^ \t]*)[ \t][ \t]*([^\t]*)$");
+ if(re.exactMatch(s)) {
+ QRegExp subst("%\\{([^%]*)\\}");
+ QString value = re.cap(2).stripWhiteSpace();
+
+ while(subst.search(value) != -1) {
+ value.replace(QRegExp("%\\{"+ QRegExp_escape( subst.cap(1) ) +"\\}"),*map.find(subst.cap(1)));
+ }
+ map.insert(re.cap(1),value);
+ }
+ }
+ dotfile.close();
+
+ // create directories if necessary :
+ createRpmDirectoryFromMacro("_topdir");
+ createRpmDirectoryFromMacro("_tmppath");
+ createRpmDirectoryFromMacro("_builddir");
+ createRpmDirectoryFromMacro("_rpmdir");
+ createRpmDirectoryFromMacro("_sourcedir");
+ createRpmDirectoryFromMacro("_specdir");
+ createRpmDirectoryFromMacro("_srcrpmdir");
+}
+
+bool SpecSupport::createRpmDirectoryFromMacro(const QString & name) {
+ QMap<QString,QString>::Iterator it;
+ if((it = map.find(name)) != map.end()) {
+ QDir dir(*it);
+ if (!dir.exists()) return dir.mkdir(*it);
+ }
+ return false;
+}
+
+QString SpecSupport::generatePackage( )
+{
+ QString spec;
+ spec += "# This spec file was generated by KDevelop \n";
+ spec += "# Please report any problem to KDevelop Team <kdevelop-devel@kdevelop.org> \n";
+ spec += "# Thanks to Matthias Saou for his explanations on http://freshrpms.net/docs/fight.html\n\n";
+
+ spec += "Name: " + getAppName() + "\n";
+ spec += "Version: " + getAppVersion() + "\n";
+ spec += "Release: " + getAppRevision() + "\n";
+ spec += "Vendor: " + getAppVendor() + "\n";
+ spec += "Copyright: " + getAppLicense() + "\n";
+ spec += "Summary: " + getAppSummary() + "\n";
+ spec += "Group: " + getAppGroup() + "\n";
+ spec += "Packager: " + getAppPackager() + "\n";
+ spec += "BuildRoot: %{_tmppath}/%{name}-root \n";
+ spec += "Source: " + getAppSource() + "\n";
+
+ spec += "\n";
+ spec += "%description\n";
+ spec += getAppDescription()+ "\n";
+
+ spec += "\n";
+ spec += "%prep\n";
+ spec += "%setup\n";
+ spec += "CFLAGS=\"$RPM_OPT_FLAGS\" CXXFLAGS=\"$RPM_OPT_FLAGS\" ./configure \\ \n";
+ spec += "--target=" + getAppArch() + "\n";
+ spec += "--disable-debug --enable-debug=no \n";
+
+ spec += "\n";
+ spec += "%build\n";
+ spec += "%configure\n";
+ spec += "make\n";
+
+ spec += "\n";
+ spec += "%install\n";
+ spec += "rm -rf %{buildroot}\n";
+ spec += "%makeinstall\n";
+
+ spec += "\n";
+ spec += "%clean\n";
+ spec += "rm -rf %{buildroot}\n";
+
+ spec += "\n";
+ spec += "%post -p /sbin/ldconfig\n";
+
+ spec += "%postun -p /sbin/ldconfig\n";
+
+ spec += "%files\n";
+ spec += "%defattr(-, root, root)\n";
+ spec += "%doc AUTHORS COPYING ChangeLog NEWS README TODO\n";
+ spec += "%{_bindir}/*\n";
+ spec += "%{_libdir}/*.so.*\n";
+ spec += "%{_datadir}/%{name}\n";
+ spec += "%{_mandir}/man8/*\n";
+
+ spec += "%changelog\n";
+ spec += getAppChangelog() + "\n";
+
+ return spec;
+}
diff --git a/parts/distpart/specsupport.h b/parts/distpart/specsupport.h
new file mode 100644
index 00000000..d64642e9
--- /dev/null
+++ b/parts/distpart/specsupport.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by ian reinhart geiser *
+ * geiseri@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __SPECSUPPORT_H__
+#define __SPECSUPPORT_H__
+
+#include <qstring.h>
+#include <qmap.h>
+#include "packagebase.h"
+#include "distpart_part.h"
+#include "distpart_widget.h"
+
+class SpecSupport : public packageBase {
+
+public:
+ SpecSupport(DistpartPart *part);
+ ~SpecSupport();
+
+public:
+ QString generatePackage();
+ void slotbuildAllPushButtonPressed();
+ void slotexportSPECPushButtonPressed();
+ void slotimportSPECPushButtonPressed();
+ void slotsrcPackagePushButtonPressed();
+ void slotAddFileButtonPressed();
+
+private:
+ void parseDotRpmmacros();
+ bool createRpmDirectoryFromMacro(const QString & name);
+
+ QString getInfo(QString s, QString motif);
+
+ QString dir;
+ DistpartPart *m_part;
+ QMap<QString,QString> map;
+};
+
+#endif
diff --git a/parts/documentation/KDevDocumentationIface.cpp b/parts/documentation/KDevDocumentationIface.cpp
new file mode 100644
index 00000000..baac8b52
--- /dev/null
+++ b/parts/documentation/KDevDocumentationIface.cpp
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "KDevDocumentationIface.h"
+
+#include "documentation_part.h"
+
+KDevDocumentationIface::KDevDocumentationIface(DocumentationPart *part)
+ :QObject(part), DCOPObject("KDevDocumentation"), m_part(part)
+{
+}
+
+KDevDocumentationIface::~KDevDocumentationIface()
+{
+}
+
+void KDevDocumentationIface::lookupInIndex(QString term)
+{
+ m_part->lookInDocumentationIndex(term);
+}
+
+void KDevDocumentationIface::findInFinder(QString term)
+{
+ m_part->findInDocumentation(term);
+}
+
+void KDevDocumentationIface::searchInDocumentation(QString term)
+{
+ m_part->searchInDocumentation(term);
+}
+
+void KDevDocumentationIface::lookupInIndex()
+{
+ m_part->lookInDocumentationIndex();
+}
+
+void KDevDocumentationIface::searchInDocumentation()
+{
+ m_part->searchInDocumentation();
+}
+
+void KDevDocumentationIface::manPage(QString term)
+{
+ m_part->manPage(term);
+}
+
+void KDevDocumentationIface::infoPage(QString term)
+{
+ m_part->infoPage(term);
+}
+
+void KDevDocumentationIface::manPage()
+{
+ m_part->manPage();
+}
+
+void KDevDocumentationIface::infoPage()
+{
+ m_part->infoPage();
+}
+
+void KDevDocumentationIface::findInFinder( )
+{
+ m_part->findInDocumentation();
+}
+
+#include "KDevDocumentationIface.moc"
diff --git a/parts/documentation/KDevDocumentationIface.h b/parts/documentation/KDevDocumentationIface.h
new file mode 100644
index 00000000..e2fd402b
--- /dev/null
+++ b/parts/documentation/KDevDocumentationIface.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef KDEVDOCUMENTATIONIFACE_H
+#define KDEVDOCUMENTATIONIFACE_H
+
+#include <qobject.h>
+#include <dcopobject.h>
+
+class DocumentationPart;
+
+class KDevDocumentationIface : public QObject, public DCOPObject {
+ Q_OBJECT
+ K_DCOP
+public:
+ KDevDocumentationIface(DocumentationPart *part);
+ ~KDevDocumentationIface();
+
+k_dcop:
+ void lookupInIndex(QString term);
+ void findInFinder(QString term);
+ void searchInDocumentation(QString term);
+ void manPage(QString term);
+ void infoPage(QString term);
+
+ void lookupInIndex();
+ void findInFinder();
+ void searchInDocumentation();
+ void manPage();
+ void infoPage();
+
+private:
+ DocumentationPart *m_part;
+};
+
+#endif
diff --git a/parts/documentation/Makefile.am b/parts/documentation/Makefile.am
new file mode 100644
index 00000000..b8f4505d
--- /dev/null
+++ b/parts/documentation/Makefile.am
@@ -0,0 +1,32 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdocumentation.la
+libkdevdocumentation_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevdocumentation_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la $(LIB_KHTML)
+
+libkdevdocumentation_la_SOURCES = documentation_part.cpp \
+ documentation_widget.cpp contentsview.cpp indexview.cpp docglobalconfigwidgetbase.ui \
+ docglobalconfigwidget.cpp docconfiglistview.cpp editcatalogdlgbase.ui editcatalogdlg.cpp \
+ docutils.cpp searchview.cpp bookmarkview.cpp editbookmarkdlg.ui \
+ find_documentationbase.ui find_documentation.cpp find_documentation_optionsbase.ui \
+ find_documentation_options.cpp selecttopicbase.ui selecttopic.cpp docprojectconfigwidgetbase.ui \
+ docprojectconfigwidget.cpp KDevDocumentationIface.cpp KDevDocumentationIface.skel \
+ addcatalogdlgbase.ui addcatalogdlg.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdocumentation.desktop
+
+rcdir = $(kde_datadir)/kdevdocumentation
+rc_DATA = kdevpart_documentation.rc
+
+noinst_HEADERS = contentsview.h indexview.h docglobalconfigwidget.h \
+ docconfiglistview.h editcatalogdlg.h docutils.h searchview.h bookmarkview.h selecttopic.h \
+ docprojectconfigwidget.h KDevDocumentationIface.h addcatalogdlg.h
+SUBDIRS = interfaces plugins tools data protocols
+
+DOXYGEN_EMPTY = YES
+include ../../Doxyfile.am
diff --git a/parts/documentation/README.dox b/parts/documentation/README.dox
new file mode 100644
index 00000000..63658d49
--- /dev/null
+++ b/parts/documentation/README.dox
@@ -0,0 +1,21 @@
+/** \class Documentation
+Documentation plugin for KDevelop.
+
+\authors <a href="mailto:cloudtemple@mksat.net">Alexander Dymo</a>
+
+\maintainer <a href="mailto:cloudtemple@mksat.net">Alexander Dymo</a>
+
+\feature Qt API browsing
+\feature KDE API browsing
+\feature Devhelp books browsing (GTK/GNOME API)
+\feature KDevelopTOC browsing
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=documentation&
+bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">
+Documentation viewer at Bugzilla database</a>
+
+\requirement Ht://Dig requires htdig to be installed.
+
+\todo Add support for documentation profiles. Application wizard or an application template
+can select necessary profile to modify the list of enabled documentation catalogs.
+*/
diff --git a/parts/documentation/addcatalogdlg.cpp b/parts/documentation/addcatalogdlg.cpp
new file mode 100644
index 00000000..9c46d2d1
--- /dev/null
+++ b/parts/documentation/addcatalogdlg.cpp
@@ -0,0 +1,112 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "addcatalogdlg.h"
+
+#include <qlabel.h>
+#include <qcombobox.h>
+
+#include <klineedit.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <kdebug.h>
+
+#include "docutils.h"
+#include "kdevdocumentationplugin.h"
+
+AddCatalogDlg::AddCatalogDlg( QValueList<DocumentationPlugin*> const & plugins,
+ QWidget* parent, const char* name, bool modal, WFlags fl)
+ :AddCatalogDlgBase(parent,name, modal,fl), m_plugins( plugins )
+{
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_plugins.constBegin(); it != m_plugins.constEnd(); ++it)
+ {
+ docTypeCombo->insertItem( (*it)->pluginName() );
+ }
+
+ docTypeChanged( QString() );
+}
+
+AddCatalogDlg::~AddCatalogDlg()
+{
+}
+
+void AddCatalogDlg::locationURLChanged(const QString &text)
+{
+ DocumentationPlugin * plugin = this->plugin();
+ if ( !plugin ) return;
+
+ titleEdit->setText( plugin->catalogTitle(DocUtils::noEnvURL(text)) );
+}
+
+void AddCatalogDlg::accept()
+{
+ QDialog::accept();
+}
+
+QString AddCatalogDlg::title() const
+{
+ return titleEdit->text();
+}
+
+QString AddCatalogDlg::url() const
+{
+ return DocUtils::envURL(locationURL);
+}
+
+void AddCatalogDlg::setTitle(const QString &title)
+{
+ titleEdit->setText(title);
+}
+
+void AddCatalogDlg::setURL(const QString &url)
+{
+ locationURL->setURL(url);
+}
+
+DocumentationPlugin * AddCatalogDlg::plugin( )
+{
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_plugins.constBegin(); it != m_plugins.constEnd(); ++it)
+ {
+ if ( docTypeCombo->currentText() == (*it)->pluginName() )
+ {
+ return *it;
+ }
+ }
+ return 0;
+}
+
+void AddCatalogDlg::docTypeChanged( const QString & )
+{
+ kdDebug() << k_funcinfo << endl;
+
+ DocumentationPlugin * plugin = this->plugin();
+ if ( plugin )
+ {
+ titleLabel->setEnabled( plugin->hasCapability(DocumentationPlugin::CustomDocumentationTitles) );
+ titleEdit->setEnabled( plugin->hasCapability(DocumentationPlugin::CustomDocumentationTitles) );
+ locationURL->setMode( plugin->catalogLocatorProps().first );
+ locationURL->setFilter( plugin->catalogLocatorProps().second );
+ }
+
+}
+
+
+
+#include "addcatalogdlg.moc"
diff --git a/parts/documentation/addcatalogdlg.h b/parts/documentation/addcatalogdlg.h
new file mode 100644
index 00000000..a04d5edc
--- /dev/null
+++ b/parts/documentation/addcatalogdlg.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef ADDCATALOGDLG_H
+#define ADDCATALOGDLG_H
+
+#include <qvaluelist.h>
+#include "addcatalogdlgbase.h"
+
+class DocumentationPlugin;
+
+class AddCatalogDlg: public AddCatalogDlgBase
+{
+ Q_OBJECT
+ public:
+ AddCatalogDlg( QValueList<DocumentationPlugin*> const & plugins, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ ~AddCatalogDlg();
+
+ QString title() const;
+ void setTitle(const QString &title);
+ QString url() const;
+ void setURL(const QString &url);
+ DocumentationPlugin * plugin();
+
+ public slots:
+ virtual void locationURLChanged(const QString &text);
+ virtual void docTypeChanged( const QString & );
+
+ protected slots:
+ virtual void accept();
+
+ private:
+ QValueList<DocumentationPlugin*> const & m_plugins;
+};
+
+#endif
diff --git a/parts/documentation/addcatalogdlgbase.ui b/parts/documentation/addcatalogdlgbase.ui
new file mode 100644
index 00000000..5274d12b
--- /dev/null
+++ b/parts/documentation/addcatalogdlgbase.ui
@@ -0,0 +1,209 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AddCatalogDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AddCatalogDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>398</width>
+ <height>222</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Documentation Catalog Properties</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout20</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>titleEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Type:</string>
+ </property>
+ </widget>
+ <spacer row="6" column="0">
+ <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>18</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>locationURL</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Locatio&amp;n:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>locationURL</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>titleLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Title:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>titleEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="5" column="0">
+ <property name="name">
+ <cstring>docTypeCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>AddCatalogDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>AddCatalogDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>locationURL</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>AddCatalogDlgBase</receiver>
+ <slot>locationURLChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>docTypeCombo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>AddCatalogDlgBase</receiver>
+ <slot>docTypeChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>locationURL</sender>
+ <signal>urlSelected(const QString&amp;)</signal>
+ <receiver>AddCatalogDlgBase</receiver>
+ <slot>locationURLChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>locationURLChanged( const QString &amp; )</slot>
+ <slot>docTypeChanged( const QString &amp; )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/bookmarkview.cpp b/parts/documentation/bookmarkview.cpp
new file mode 100644
index 00000000..33f67da4
--- /dev/null
+++ b/parts/documentation/bookmarkview.cpp
@@ -0,0 +1,285 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "bookmarkview.h"
+
+#include <qlayout.h>
+#include <qheader.h>
+#include <qpoint.h>
+
+#include <klineedit.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kdialog.h>
+#include <kpushbutton.h>
+#include <kurlrequester.h>
+#include <kpopupmenu.h>
+#include <kparts/part.h>
+#include <khtml_part.h>
+#include <dom/html_document.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevdocumentationplugin.h>
+
+#include "documentation_part.h"
+#include "documentation_widget.h"
+#include "editbookmarkdlg.h"
+#include "docutils.h"
+
+DocBookmarkManager::DocBookmarkManager(DocumentationPart */*part*/)
+ :KBookmarkManager(locateLocal("data",
+ "kdevdocumentation/bookmarks/bookmarks.xml"), false)
+{
+ setEditorOptions(i18n("Documentation"), false);
+}
+
+DocBookmarkOwner::DocBookmarkOwner(DocumentationPart *part)
+ :KBookmarkOwner(), m_part(part)
+{
+}
+
+void DocBookmarkOwner::openBookmarkURL(const QString &_url)
+{
+ m_part->partController()->showDocument(KURL(_url));
+}
+
+QString DocBookmarkOwner::currentURL() const
+{
+ KParts::ReadOnlyPart *activePart = dynamic_cast<KParts::ReadOnlyPart*>(m_part->partController()->activePart());
+ if (activePart)
+ return activePart->url().url();
+ else
+ return QString::null;
+}
+
+QString DocBookmarkOwner::currentTitle() const
+{
+ KParts::ReadOnlyPart *activePart = dynamic_cast<KParts::ReadOnlyPart*>(m_part->partController()->activePart());
+ if (activePart)
+ {
+ KHTMLPart *htmlPart = dynamic_cast<KHTMLPart*>(activePart);
+ if (htmlPart)
+ return htmlPart->htmlDocument().title().string();
+ return activePart->url().prettyURL();
+ }
+ else
+ return QString::null;
+}
+
+class DocBookmarkItem: public DocumentationItem {
+public:
+ DocBookmarkItem(Type type, KListView *parent, const QString &name)
+ :DocumentationItem(type, parent, name)
+ {
+ }
+ DocBookmarkItem(Type type, KListView *parent, DocumentationItem *after, const QString &name)
+ :DocumentationItem(type, parent, after, name)
+ {
+ }
+ DocBookmarkItem(Type type, DocumentationItem *parent, const QString &name)
+ :DocumentationItem(type, parent, name)
+ {
+ }
+ void setBookmark(const KBookmark &bm) { m_bm = bm; }
+ KBookmark bookmark() const { return m_bm; }
+
+private:
+ KBookmark m_bm;
+};
+
+
+
+//class BookmarkView
+
+BookmarkView::BookmarkView(DocumentationWidget *parent, const char *name)
+ :QWidget(parent, name), m_widget(parent)
+{
+ m_bmManager = new DocBookmarkManager(m_widget->part());
+ m_bmOwner = new DocBookmarkOwner(m_widget->part());
+
+ QVBoxLayout *l = new QVBoxLayout(this, 0, KDialog::spacingHint());
+ m_view = new KListView(this);
+ m_view->addColumn(i18n("Title"));
+ m_view->setSorting(-1);
+ m_view->header()->hide();
+ m_view->setResizeMode(QListView::AllColumns);
+ m_view->setAllColumnsShowFocus( true );
+ l->addWidget(m_view);
+ QHBoxLayout *l2 = new QHBoxLayout(l, KDialog::spacingHint());
+ m_addButton = new KPushButton(i18n("Add"), this);
+ m_editButton = new KPushButton(i18n("Edit..."), this);
+ m_removeButton = new KPushButton(i18n("Remove"), this);
+ l2->addWidget(m_addButton);
+ l2->addWidget(m_editButton);
+ l2->addWidget(m_removeButton);
+ l2->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Fixed));
+ l->addSpacing(2);
+
+ showBookmarks();
+
+ connect(m_view, SIGNAL(executed(QListViewItem*, const QPoint&, int )),
+ this, SLOT(itemExecuted(QListViewItem*, const QPoint&, int )));
+ connect(m_addButton, SIGNAL(pressed()), this, SLOT(addBookmark()));
+ connect(m_editButton, SIGNAL(clicked()), this, SLOT(editBookmark()));
+ connect(m_removeButton, SIGNAL(clicked()), this, SLOT(removeBookmark()));
+
+ connect(m_widget->part(), SIGNAL(bookmarkLocation(const QString&, const KURL& )),
+ this, SLOT(addBookmark(const QString&, const KURL& )));
+ connect(m_view, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int )),
+ this, SLOT(itemMouseButtonPressed(int, QListViewItem*, const QPoint&, int )));
+}
+
+BookmarkView::~BookmarkView()
+{
+ delete m_bmManager;
+ delete m_bmOwner;
+}
+
+void BookmarkView::showBookmarks()
+{
+ const KBookmarkGroup &group = m_bmManager->root();
+ DocBookmarkItem *item = 0;
+ for (KBookmark bm = group.first(); !bm.isNull(); bm = group.next(bm))
+ {
+ if (item == 0)
+ item = new DocBookmarkItem(DocumentationItem::Document, m_view, bm.fullText());
+ else
+ item = new DocBookmarkItem(DocumentationItem::Document, m_view, item, bm.fullText());
+ item->setURL(bm.url());
+ item->setBookmark(bm);
+ }
+}
+
+void BookmarkView::itemExecuted(QListViewItem *item, const QPoint &// p
+ , int // col
+ )
+{
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+ m_widget->part()->partController()->showDocument(docItem->url());
+}
+
+void BookmarkView::removeBookmark()
+{
+ if (!m_view->currentItem())
+ return;
+ DocBookmarkItem *item = dynamic_cast<DocBookmarkItem*>(m_view->currentItem());
+ m_bmManager->root().deleteBookmark(item->bookmark());
+ m_bmManager->save();
+ delete item;
+}
+
+void BookmarkView::editBookmark()
+{
+ if (!m_view->currentItem())
+ return;
+ DocBookmarkItem *item = dynamic_cast<DocBookmarkItem*>(m_view->currentItem());
+ if (!item)
+ return;
+
+ EditBookmarkDlg dlg(this);
+ dlg.setCaption(i18n("Edit Bookmark"));
+ dlg.nameEdit->setText(item->bookmark().fullText());
+ dlg.locationEdit->setURL(item->bookmark().url().url());
+ dlg.nameEdit->setFocus();
+ if (dlg.exec())
+ {
+ item->bookmark().internalElement().namedItem("title").firstChild().toText().setData(dlg.nameEdit->text());
+ item->bookmark().internalElement().setAttribute("href", KURL(dlg.locationEdit->url()).url());
+ m_bmManager->save();
+
+ item->setText(0, item->bookmark().fullText());
+ item->setURL(item->bookmark().url());
+ }
+}
+
+void BookmarkView::addBookmark()
+{
+ QString title = m_bmOwner->currentTitle();
+ QString url = m_bmOwner->currentURL();
+
+ KPopupMenu menu;
+ bool useMenu = false;
+ if (!title.isEmpty() && !url.isEmpty())
+ {
+ menu.insertItem(i18n("Current Document"), 1);
+ menu.insertItem(i18n("Custom..."), 2);
+ useMenu = true;
+ }
+ int mode = 2;
+ if (useMenu)
+ {
+ m_addButton->setDown(true);
+ mode = menu.exec(mapToGlobal(QPoint(m_addButton->x(), m_addButton->y()+m_addButton->height())));
+ m_addButton->setDown(false);
+ }
+
+ switch (mode)
+ {
+ case 1:
+ addBookmark(title, url);
+ break;
+ case 2:
+ EditBookmarkDlg dlg(this);
+ dlg.setCaption(i18n("Add Bookmark"));
+/* dlg.nameEdit->setText(title);
+ dlg.locationEdit->setURL(url);*/
+ dlg.nameEdit->setFocus();
+ if (dlg.exec())
+ addBookmark(dlg.nameEdit->text(), KURL(dlg.locationEdit->url()));
+ m_addButton->setDown(false);
+ break;
+ }
+}
+
+void BookmarkView::addBookmark(const QString &title, const KURL &url)
+{
+ KBookmark bm = m_bmManager->root().addBookmark(m_bmManager, title, url);
+ m_bmManager->save();
+
+ DocBookmarkItem *item = 0;
+ if (m_view->lastItem())
+ item = dynamic_cast<DocBookmarkItem*>(m_view->lastItem());
+ if (item == 0)
+ item = new DocBookmarkItem(DocumentationItem::Document, m_view, bm.fullText());
+ else
+ item = new DocBookmarkItem(DocumentationItem::Document, m_view, item, bm.fullText());
+ item->setURL(bm.url());
+ item->setBookmark(bm);
+}
+
+void BookmarkView::itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int // c
+ )
+{
+ if ((button != Qt::RightButton) || (!item))
+ return;
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+
+ DocUtils::docItemPopup(m_widget->part(), docItem, pos, false, true);
+}
+
+void BookmarkView::focusInEvent(QFocusEvent */*e*/)
+{
+ m_view->setFocus();
+}
+
+#include "bookmarkview.moc"
diff --git a/parts/documentation/bookmarkview.h b/parts/documentation/bookmarkview.h
new file mode 100644
index 00000000..a46aa573
--- /dev/null
+++ b/parts/documentation/bookmarkview.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef BOOKMARKVIEW_H
+#define BOOKMARKVIEW_H
+
+#include <qwidget.h>
+
+#include <kbookmarkmanager.h>
+
+class KListView;
+class KPushButton;
+class DocumentationPart;
+class DocumentationWidget;
+class QListViewItem;
+
+class DocBookmarkManager: public KBookmarkManager {
+public:
+ DocBookmarkManager(DocumentationPart *part);
+};
+
+class DocBookmarkOwner: public KBookmarkOwner {
+public:
+ DocBookmarkOwner(DocumentationPart *part);
+
+ virtual void openBookmarkURL(const QString &_url);
+ virtual QString currentTitle() const;
+ virtual QString currentURL() const;
+
+private:
+ DocumentationPart *m_part;
+};
+
+class BookmarkView : public QWidget
+{
+ Q_OBJECT
+public:
+ BookmarkView(DocumentationWidget *parent = 0, const char *name = 0);
+ ~BookmarkView();
+
+public slots:
+ void addBookmark(const QString &title, const KURL &url);
+
+protected:
+ void showBookmarks();
+ virtual void focusInEvent(QFocusEvent *e);
+
+protected slots:
+ void itemExecuted(QListViewItem *item, const QPoint &p, int col);
+ void addBookmark();
+ void editBookmark();
+ void removeBookmark();
+ void itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int c);
+
+private:
+ DocumentationWidget *m_widget;
+ KListView *m_view;
+ KPushButton *m_addButton;
+ KPushButton *m_editButton;
+ KPushButton *m_removeButton;
+
+ DocBookmarkManager *m_bmManager;
+ DocBookmarkOwner *m_bmOwner;
+};
+
+#endif
diff --git a/parts/documentation/contentsview.cpp b/parts/documentation/contentsview.cpp
new file mode 100644
index 00000000..e69b048e
--- /dev/null
+++ b/parts/documentation/contentsview.cpp
@@ -0,0 +1,92 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "contentsview.h"
+
+#include <qheader.h>
+#include <qlayout.h>
+
+#include <kdebug.h>
+#include <klistview.h>
+#include <klocale.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevdocumentationplugin.h>
+
+#include "documentation_widget.h"
+#include "documentation_part.h"
+#include "docutils.h"
+
+ContentsView::ContentsView(DocumentationWidget *parent, const char *name)
+ :QWidget(parent, name), m_widget(parent)
+{
+ QVBoxLayout *cl = new QVBoxLayout(this, 0, 0);
+ m_view = new KListView(this);
+ cl->addWidget(m_view);
+
+ m_view->addColumn(i18n( "Contents" ));
+ m_view->header()->hide();
+ m_view->setResizeMode(QListView::AllColumns);
+ m_view->setRootIsDecorated(true);
+ m_view->setSorting(-1);
+ m_view->setAllColumnsShowFocus( true );
+
+ connect(m_view, SIGNAL(executed(QListViewItem*, const QPoint&, int )),
+ this, SLOT(itemExecuted(QListViewItem*, const QPoint&, int )));
+ connect(m_view, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int )),
+ this, SLOT(itemMouseButtonPressed(int, QListViewItem*, const QPoint&, int )));
+}
+
+ContentsView::~ContentsView()
+{
+ if (m_widget && m_widget->index())
+ m_widget->index()->clear();
+}
+
+void ContentsView::itemExecuted(QListViewItem *item, const QPoint &// p
+ , int // col
+ )
+{
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+ KURL url = DocUtils::noEnvURL(docItem->url());
+ if (url.isEmpty() || !url.isValid())
+ return;
+ m_widget->part()->partController()->showDocument(url);
+}
+
+void ContentsView::itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int // c
+ )
+{
+ if ((button != Qt::RightButton) || (!item))
+ return;
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+
+ DocUtils::docItemPopup(m_widget->part(), docItem, pos, true, true);
+}
+
+void ContentsView::focusInEvent(QFocusEvent */*e*/)
+{
+ m_view->setFocus();
+}
+
+#include "contentsview.moc"
diff --git a/parts/documentation/contentsview.h b/parts/documentation/contentsview.h
new file mode 100644
index 00000000..aaac6eee
--- /dev/null
+++ b/parts/documentation/contentsview.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef CONTENTSVIEW_H
+#define CONTENTSVIEW_H
+
+#include <qwidget.h>
+
+class FindDocumentation;
+class DocumentationWidget;
+class QListViewItem;
+class KListView;
+
+class ContentsView : public QWidget
+{
+ Q_OBJECT
+public:
+ ContentsView(DocumentationWidget *parent, const char *name = 0);
+ ~ContentsView();
+
+ KListView *view() const { return m_view; }
+
+protected slots:
+ void itemExecuted(QListViewItem *item, const QPoint &p, int col);
+ void itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int c);
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+private:
+ DocumentationWidget *m_widget;
+ KListView *m_view;
+
+friend class FindDocumentation;
+};
+
+#endif
diff --git a/parts/documentation/data/Makefile.am b/parts/documentation/data/Makefile.am
new file mode 100644
index 00000000..920c492a
--- /dev/null
+++ b/parts/documentation/data/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+METASOURCES = AUTO
+htmldir = $(kde_datadir)/kdevdocumentation/en
+picsdir = $(kde_datadir)/kdevdocumentation/pics
+html_DATA = long.html nomatch.html short.html syntax.html wrapper.html
+pics_DATA = checked.xpm htdig.png star.png star_blank.png unchecked.xpm
diff --git a/parts/documentation/data/checked.xpm b/parts/documentation/data/checked.xpm
new file mode 100644
index 00000000..1ed19024
--- /dev/null
+++ b/parts/documentation/data/checked.xpm
@@ -0,0 +1,23 @@
+/* XPM */
+static char*unchecked[]={
+"16 16 4 1",
+"# c #000000",
+"+ c #ffffff",
+"D c #000000",
+". c None",
+"................",
+"............++++",
+"..++++++++++DDD+",
+"..+########DDD+.",
+"..+#++++++DDD+..",
+"+DDD+...+DDD#+..",
+"++DDD+++DDD+#+..",
+"..+DDDDDDD++#+..",
+"..+#DDDDD+.+#+..",
+"..+#++DD+..+#+..",
+"..+#+++++..+#+..",
+"..+#++++++++#+..",
+"..+##########+..",
+"..++++++++++++..",
+"................",
+"................"};
diff --git a/parts/documentation/data/htdig.png b/parts/documentation/data/htdig.png
new file mode 100644
index 00000000..fe6e7c92
--- /dev/null
+++ b/parts/documentation/data/htdig.png
Binary files differ
diff --git a/parts/documentation/data/long.html b/parts/documentation/data/long.html
new file mode 100644
index 00000000..1d0fa4ce
--- /dev/null
+++ b/parts/documentation/data/long.html
@@ -0,0 +1,6 @@
+<dl><dt><strong><a href="$&(URL)">$&(TITLE)</a></strong>$(STARSLEFT)
+</dt><dd>$(EXCERPT)<br>
+<i><a href="$&(URL)">$&(URL)</a></i>
+<font size="-1">$(MODIFIED), $(SIZE) bytes</font>
+</dd></dl>
+
diff --git a/parts/documentation/data/nomatch.html b/parts/documentation/data/nomatch.html
new file mode 100644
index 00000000..8951a604
--- /dev/null
+++ b/parts/documentation/data/nomatch.html
@@ -0,0 +1,21 @@
+<html><head><title>No match for '$&(LOGICAL_WORDS)'</title></head>
+<body bgcolor="#ffffff" text="#000000" link="#aa0000">
+<h1><img src="$(PICDIR)kdevdocumentation/pics/htdig.png">
+Search results</h1>
+<hr noshade size="4">
+<h2>No matches were found for '$&(LOGICAL_WORDS)'</h2>
+<p>
+Check the spelling of the search word(s) you used.
+If the spelling is correct and you only used one word,
+try using one or more similar search words with "<b>Any</b>."
+</p><p>
+If the spelling is correct and you used more than one
+word with "<b>Any</b>," try using one or more similar search
+words with "<b>Any</b>."</p><p>
+If the spelling is correct and you used more than one
+word with "<b>All</b>," try using one or more of the same words
+with "<b>Any</b>."</p>
+<hr noshade size="4">
+<a href="http://www.htdig.org/">
+<img src="$(PICDIR)kdevdocumentation/pics/htdig.png" border="0">ht://Dig $(VERSION)</a>
+</body></html>
diff --git a/parts/documentation/data/short.html b/parts/documentation/data/short.html
new file mode 100644
index 00000000..e3e5e447
--- /dev/null
+++ b/parts/documentation/data/short.html
@@ -0,0 +1 @@
+$(STARSRIGHT) <strong><a href="$&(URL)">$&(TITLE)</a></strong><br>
diff --git a/parts/documentation/data/star.png b/parts/documentation/data/star.png
new file mode 100644
index 00000000..692cd35e
--- /dev/null
+++ b/parts/documentation/data/star.png
Binary files differ
diff --git a/parts/documentation/data/star_blank.png b/parts/documentation/data/star_blank.png
new file mode 100644
index 00000000..2689281a
--- /dev/null
+++ b/parts/documentation/data/star_blank.png
Binary files differ
diff --git a/parts/documentation/data/syntax.html b/parts/documentation/data/syntax.html
new file mode 100644
index 00000000..9701c37f
--- /dev/null
+++ b/parts/documentation/data/syntax.html
@@ -0,0 +1,19 @@
+<html><head><title>Error in Boolean search for '$&(WORDS)'</title></head>
+<body bgcolor="#ffffff" text="#000000" link="#aa0000">
+<h1><img src="$(PICDIR)kdevdocumentation/pics/htdig.png">
+Error in Boolean search for '$&(LOGICAL_WORDS)'</h1>
+<hr noshade size="4">
+Boolean expressions need to be 'correct' in order for the search
+system to use them.
+The expression you entered has errors in it.<p>
+Examples of correct expressions are: <b>cat and dog</b>, <b>cat
+not dog</b>, <b>cat or (dog not nose)</b>.<br>Note that
+the operator <b>not</b> has the meaning of 'without'.
+<blockquote><b>
+$(SYNTAXERROR)
+</b></blockquote>
+<hr noshade size="4">
+<a href="http://www.htdig.org/">
+<img src="$(PICDIR)kdevdocumentation/pics/htdig.png" border="0">ht://Dig $(VERSION)</a>
+</body></html>
+
diff --git a/parts/documentation/data/unchecked.xpm b/parts/documentation/data/unchecked.xpm
new file mode 100644
index 00000000..e447281a
--- /dev/null
+++ b/parts/documentation/data/unchecked.xpm
@@ -0,0 +1,22 @@
+/* XPM */
+static char*unchecked[]={
+"16 16 3 1",
+"# c #000000",
+"+ c #ffffff",
+". c None",
+"................",
+"................",
+"..++++++++++++..",
+"..+##########+..",
+"..+#++++++++#+..",
+"..+#+......+#+..",
+"..+#+......+#+..",
+"..+#+......+#+..",
+"..+#+......+#+..",
+"..+#+......+#+..",
+"..+#+......+#+..",
+"..+#++++++++#+..",
+"..+##########+..",
+"..++++++++++++..",
+"................",
+"................"};
diff --git a/parts/documentation/data/wrapper.html b/parts/documentation/data/wrapper.html
new file mode 100644
index 00000000..20c1bbf2
--- /dev/null
+++ b/parts/documentation/data/wrapper.html
@@ -0,0 +1,16 @@
+<html><head><title>Search results for '$&(WORDS)'</title></head>
+<body bgcolor="#ffffff" text="#000000" link="#aa0000">
+<h2><img src=$(PICDIR)kdevdocumentation/pics/htdig.png>
+Search results for '$&(LOGICAL_WORDS)'</h2>
+<hr noshade size="4">
+<b>
+More <img src=$(PICDIR)kdevdocumentation/pics/star.png alt="*">'s indicate a better match.
+</b>
+<hr noshade size="1">
+$(HTSEARCH_RESULTS)
+$(PAGEHEADER)
+$(PREVPAGE) $(PAGELIST) $(NEXTPAGE)
+<hr noshade size="4">
+<a href="http://www.htdig.org/">
+<img src=$(PICDIR)kdevdocumentation/pics/htdig.png border="0">ht://Dig $(VERSION)</a>
+</body></html>
diff --git a/parts/documentation/docconfiglistview.cpp b/parts/documentation/docconfiglistview.cpp
new file mode 100644
index 00000000..0865f105
--- /dev/null
+++ b/parts/documentation/docconfiglistview.cpp
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docconfiglistview.h"
+
+#include <klocale.h>
+
+#include "kdevdocumentationplugin.h"
+
+DocConfigListView::DocConfigListView(QWidget *parent, const char *name)
+ :KListView(parent, name)
+{
+// setSorting(-1);
+ addColumn(i18n("TOC"));
+ addColumn(i18n("Index"));
+ addColumn(i18n("Search"));
+ addColumn(i18n("Title"));
+// addColumn(i18n("URL"));
+ setColumnWidthMode(0, QListView::Maximum);
+ setColumnWidthMode(1, QListView::Maximum);
+ setColumnWidthMode(2, QListView::Maximum);
+ setColumnWidthMode(3, QListView::Maximum);
+// setColumnWidthMode(4, QListView::Maximum);
+ setAllColumnsShowFocus(true);
+ setResizeMode( QListView::LastColumn );
+
+ connect(this, SIGNAL(clicked(QListViewItem*, const QPoint&, int)),
+ this, SLOT(clickedItem(QListViewItem*, const QPoint&, int )));
+}
+
+DocConfigListView::~DocConfigListView()
+{
+}
+
+void DocConfigListView::clickedItem(QListViewItem *item, const QPoint &// pnt
+ , int c)
+{
+ if (!item)
+ return;
+ ConfigurationItem *cfg = dynamic_cast<ConfigurationItem*>(item);
+ if (!cfg)
+ return;
+ if (c == 0)
+ {
+ cfg->setContents(!cfg->contents());
+ if (!cfg->contents())
+ cfg->setIndex(false);
+ }
+ if ((c == 1) && (cfg->indexPossible()))
+ cfg->setIndex(!cfg->index());
+ else if ((c == 2) && (cfg->fullTextSearchPossible()))
+ cfg->setFullTextSearch(!cfg->fullTextSearch());
+ repaintItem(item);
+}
+
+#include "docconfiglistview.moc"
diff --git a/parts/documentation/docconfiglistview.h b/parts/documentation/docconfiglistview.h
new file mode 100644
index 00000000..089980cf
--- /dev/null
+++ b/parts/documentation/docconfiglistview.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCCONFIGLISTVIEW_H
+#define DOCCONFIGLISTVIEW_H
+
+#include <klistview.h>
+
+class DocConfigListView : public KListView
+{
+ Q_OBJECT
+public:
+ DocConfigListView(QWidget *parent = 0, const char *name = 0);
+ ~DocConfigListView();
+
+protected slots:
+ void clickedItem(QListViewItem *item, const QPoint &pnt, int c);
+};
+
+#endif
diff --git a/parts/documentation/docglobalconfigwidget.cpp b/parts/documentation/docglobalconfigwidget.cpp
new file mode 100644
index 00000000..cef510dc
--- /dev/null
+++ b/parts/documentation/docglobalconfigwidget.cpp
@@ -0,0 +1,259 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2002 by Sebastian Kratzert *
+ * skratzert@gmx.de *
+ * Copyright (C) 2003-2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docglobalconfigwidget.h"
+
+#include <qlayout.h>
+#include <qtoolbox.h>
+#include <qcheckbox.h>
+#include <qwidgetstack.h>
+
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <kapplication.h>
+#include <kurlrequester.h>
+#include <kfontcombo.h>
+#include <khtml_part.h>
+#include <khtml_settings.h>
+
+#include "kdevdocumentationplugin.h"
+#include "kdevpartcontroller.h"
+
+#include "docconfiglistview.h"
+#include "documentation_part.h"
+#include "documentation_widget.h"
+#include "editcatalogdlg.h"
+#include "addcatalogdlg.h"
+#include "contentsview.h"
+#include "indexview.h"
+#include "docutils.h"
+
+DocGlobalConfigWidget::DocGlobalConfigWidget(DocumentationPart *part,
+ DocumentationWidget *widget, QWidget *parent, const char *name, WFlags fl)
+ :DocGlobalConfigWidgetBase(parent, name, fl), m_part(part), m_widget(widget)
+{
+ m_View = new DocConfigListView( viewHolder );
+ viewHolder->addWidget( m_View );
+ viewHolder->raiseWidget( m_View );
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_part->m_plugins.constBegin();
+ it != m_part->m_plugins.constEnd(); ++it)
+ {
+ (*it)->loadCatalogConfiguration( m_View );
+ }
+
+ KConfig *config = m_part->config();
+ //read full text search settings
+ config->setGroup("htdig");
+ QString databaseDir = kapp->dirs()->saveLocation("data",
+ "kdevdocumentation/search");
+ databaseDirEdit->setURL(config->readPathEntry("databaseDir", databaseDir));
+ htdigbinEdit->setURL(config->readPathEntry("htdigbin", kapp->dirs()->findExe("htdig")));
+ htmergebinEdit->setURL(config->readPathEntry("htmergebin", kapp->dirs()->findExe("htmerge")));
+ htsearchbinEdit->setURL(config->readPathEntry("htsearchbin", kapp->dirs()->findExe("htsearch")));
+ if (config->readBoolEntry("IsSetup", false) == false)
+ {
+ QFileInfo fi(htsearchbinEdit->url());
+ if (!fi.exists())
+ {
+ //try to guess htsearch location on Debian
+ QFileInfo fi("/usr/lib/cgi-bin/htsearch");
+ if (!fi.exists())
+ {
+ //try to guess htsearch location on SuSE
+ QFileInfo fi("/srv/www/cgi-bin/htsearch");
+ if (fi.exists())
+ htsearchbinEdit->setURL("/srv/www/cgi-bin/htsearch");
+ }
+ else
+ htsearchbinEdit->setURL("/usr/lib/cgi-bin/htsearch");
+ }
+ }
+
+ find_box->setChecked(m_part->hasContextFeature(DocumentationPart::Finder));
+ index_box->setChecked(m_part->hasContextFeature(DocumentationPart::IndexLookup));
+ search_box->setChecked(m_part->hasContextFeature(DocumentationPart::FullTextSearch));
+ man_box->setChecked(m_part->hasContextFeature(DocumentationPart::GotoMan));
+ info_box->setChecked(m_part->hasContextFeature(DocumentationPart::GotoInfo));
+
+ useAssistant_box->setChecked(m_part->isAssistantUsed());
+
+ // Having app-specific settings isn't pretty, but this setting is nonsensical in kdevassistant
+ if ( kapp->instanceName().find("kdevassistant") != -1 )
+ useAssistant_box->hide();
+
+ //font sizes and zoom levels
+ KHTMLPart htmlpart;
+ KConfig *appConfig = KGlobal::config();
+ appConfig->setGroup("KHTMLPart");
+ standardFont_combo->setCurrentText(appConfig->readEntry("StandardFont",
+ htmlpart.settings()->stdFontName()));
+ fixedFont_combo->setCurrentText(appConfig->readEntry("FixedFont",
+ htmlpart.settings()->fixedFontName()));
+ zoom_combo->setCurrentText(appConfig->readEntry("Zoom", "100"));
+}
+
+DocGlobalConfigWidget::~DocGlobalConfigWidget()
+{
+}
+
+/*$SPECIALIZATION$*/
+void DocGlobalConfigWidget::collectionsBoxCurrentChanged(int // box
+ )
+{
+}
+
+void DocGlobalConfigWidget::removeCollectionButtonClicked()
+{
+ ConfigurationItem *item = dynamic_cast<ConfigurationItem*>(activeView()->currentItem());
+ if (!item)
+ return;
+ item->docPlugin()->deleteCatalogConfiguration(item);
+ delete activeView()->currentItem();
+}
+
+void DocGlobalConfigWidget::editCollectionButtonClicked()
+{
+ ConfigurationItem *item = dynamic_cast<ConfigurationItem*>(activeView()->currentItem());
+ if (!item)
+ return;
+ EditCatalogDlg dlg( item->docPlugin(), this, "edit collection dlg", true);
+ dlg.setURL(item->url());
+ dlg.setTitle(item->title());
+ if (dlg.exec())
+ {
+ item->docPlugin()->deleteCatalogConfiguration(item); // this removes the old entry by name
+ item->docPlugin()->editCatalogConfiguration(item, dlg.title(), dlg.url());
+ }
+}
+
+void DocGlobalConfigWidget::addCollectionButtonClicked()
+{
+ AddCatalogDlg dlg( m_part->m_plugins, this, "add collection dlg", true);
+ if (dlg.exec())
+ {
+ dlg.plugin()->addCatalogConfiguration(activeView(), dlg.title(), dlg.url());
+ }
+}
+
+KListView *DocGlobalConfigWidget::activeView()
+{
+ return m_View;
+}
+
+void DocGlobalConfigWidget::accept()
+{
+ //write catalog settings
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_part->m_plugins.constBegin();
+ it != m_part->m_plugins.constEnd(); ++it)
+ {
+ (*it)->saveCatalogConfiguration( m_View );
+ //@todo: take restrictions into account
+ (*it)->reinit(m_widget->contents(), m_widget->index(), QStringList());
+ }
+
+ KConfig *config = m_part->config();
+ //write full text search settings
+ config->setGroup("htdig");
+ config->writePathEntry("databaseDir", DocUtils::envURL(databaseDirEdit));
+ config->writePathEntry("htdigbin", DocUtils::envURL(htdigbinEdit));
+ config->writePathEntry("htmergebin", DocUtils::envURL(htmergebinEdit));
+ config->writePathEntry("htsearchbin", DocUtils::envURL(htsearchbinEdit));
+
+ //write full text search locations file
+ QString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt");
+ QFile f(ftsLocationsFile);
+ QStringList locs;
+ if (f.open(IO_ReadWrite | IO_Truncate))
+ {
+ QTextStream str(&f);
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_part->m_plugins.constBegin();
+ it != m_part->m_plugins.constEnd(); ++ it)
+ {
+ QStringList app = (*it)->fullTextSearchLocations();
+ for (QStringList::const_iterator it2 = app.constBegin();
+ it2 != app.constEnd(); ++it2)
+ {
+ if (!locs.contains(*it2))
+ locs.append(*it2);
+ }
+ }
+ str << locs.join("\n");
+
+ f.close();
+ }
+
+ //write editor context menu configuration
+ m_part->setContextFeature(DocumentationPart::Finder, find_box->isChecked());
+ m_part->setContextFeature(DocumentationPart::IndexLookup, index_box->isChecked());
+ m_part->setContextFeature(DocumentationPart::FullTextSearch, search_box->isChecked());
+ m_part->setContextFeature(DocumentationPart::GotoMan, man_box->isChecked());
+ m_part->setContextFeature(DocumentationPart::GotoInfo, info_box->isChecked());
+
+ m_part->setAssistantUsed(useAssistant_box->isChecked());
+
+ //font sizes and zoom levels
+ KConfig *appConfig = KGlobal::config();
+ appConfig->setGroup("KHTMLPart");
+ appConfig->writeEntry("StandardFont", standardFont_combo->currentText());
+ appConfig->writeEntry("FixedFont", fixedFont_combo->currentText());
+ appConfig->writeEntry("Zoom", zoom_combo->currentText());
+
+ appConfig->sync();
+ updateConfigForHTMLParts();
+ config->sync();
+
+ //refill the index
+ kdDebug() << "refill the index" << endl;
+ if (m_part->m_hasIndex)
+ {
+ kdDebug() << "m_part->m_hasIndex" << endl;
+ m_part->m_widget->index()->refill();
+ }
+}
+
+void DocGlobalConfigWidget::updateConfigForHTMLParts()
+{
+ KURL::List urls = m_part->partController()->openURLs();
+ for (KURL::List::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it)
+ {
+ KHTMLPart *htmlPart = dynamic_cast<KHTMLPart*>(m_part->partController()->partForURL(*it));
+ if (htmlPart)
+ {
+ KConfig *appConfig = KGlobal::config();
+ appConfig->setGroup("KHTMLPart");
+ htmlPart->setStandardFont(appConfig->readEntry("StandardFont"));
+ htmlPart->setFixedFont(appConfig->readEntry("FixedFont"));
+ //hack to force reloading the page
+ if (htmlPart->zoomFactor() == appConfig->readEntry("Zoom").toInt())
+ {
+ htmlPart->setZoomFactor(htmlPart->zoomFactor()-1);
+ htmlPart->setZoomFactor(htmlPart->zoomFactor()+1);
+ }
+ htmlPart->setZoomFactor(appConfig->readEntry("Zoom").toInt());
+ }
+ }
+}
+
+#include "docglobalconfigwidget.moc"
diff --git a/parts/documentation/docglobalconfigwidget.h b/parts/documentation/docglobalconfigwidget.h
new file mode 100644
index 00000000..95b518e5
--- /dev/null
+++ b/parts/documentation/docglobalconfigwidget.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCGLOBALCONFIGWIDGET_H
+#define DOCGLOBALCONFIGWIDGET_H
+
+#include "docglobalconfigwidgetbase.h"
+
+#include <qmap.h>
+
+class DocumentationPart;
+class DocumentationWidget;
+class DocumentationPlugin;
+class KListView;
+
+class DocGlobalConfigWidget : public DocGlobalConfigWidgetBase
+{
+ Q_OBJECT
+public:
+ DocGlobalConfigWidget(DocumentationPart *part, DocumentationWidget *widget,
+ QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
+ ~DocGlobalConfigWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void collectionsBoxCurrentChanged(int box);
+
+ virtual void removeCollectionButtonClicked();
+ virtual void editCollectionButtonClicked();
+ virtual void addCollectionButtonClicked();
+
+ virtual void accept();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ KListView *activeView();
+ void updateConfigForHTMLParts();
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+private:
+ DocumentationPart *m_part;
+ DocumentationWidget *m_widget;
+
+ KListView * m_View;
+};
+
+#endif
+
diff --git a/parts/documentation/docglobalconfigwidgetbase.ui b/parts/documentation/docglobalconfigwidgetbase.ui
new file mode 100644
index 00000000..1af1e011
--- /dev/null
+++ b/parts/documentation/docglobalconfigwidgetbase.ui
@@ -0,0 +1,572 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>DocGlobalConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DocGlobalConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>553</width>
+ <height>397</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>docTab</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Documentation Collections</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>viewHolder</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</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="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addCollectionButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>editCollectionButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>removeCollectionButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</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>
+ </hbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Full Text &amp;Search</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer20</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>190</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>htsearchbinLabel</cstring>
+ </property>
+ <property name="text">
+ <string>htse&amp;arch executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>htsearchbinEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="4" column="1">
+ <property name="name">
+ <cstring>htsearchbinEdit</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>databaseDirEdit</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="3" column="1">
+ <property name="name">
+ <cstring>htmergebinEdit</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>htdigbinLabel</cstring>
+ </property>
+ <property name="text">
+ <string>htdi&amp;g executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>htdigbinEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="2" column="1">
+ <property name="name">
+ <cstring>htdigbinEdit</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>databaseDirLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Database di&amp;rectory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>databaseDirEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>htmergebinLabel</cstring>
+ </property>
+ <property name="text">
+ <string>ht&amp;merge executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>htmergebinEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>O&amp;ther</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer4</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>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Editor Context Menu Items</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>find_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find in documentation</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>index_box</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Look in documentation index</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>search_box</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;earch in documentation</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>info_box</cstring>
+ </property>
+ <property name="text">
+ <string>Goto &amp;infopage</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>man_box</cstring>
+ </property>
+ <property name="text">
+ <string>Goto &amp;manpage</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>useAssistant_box</cstring>
+ </property>
+ <property name="text">
+ <string>Use KDevelop &amp;Assistant to browse documentation</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Fonts &amp;&amp; Sizes</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Sta&amp;ndard font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>standardFont_combo</cstring>
+ </property>
+ </widget>
+ <widget class="KFontCombo" row="0" column="1">
+ <property name="name">
+ <cstring>standardFont_combo</cstring>
+ </property>
+ </widget>
+ <widget class="KFontCombo" row="1" column="1">
+ <property name="name">
+ <cstring>fixedFont_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Fi&amp;xed font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fixedFont_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Zoom factor:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>zoom_combo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="1">
+ <item>
+ <property name="text">
+ <string>20</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>40</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>60</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>80</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>90</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>95</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>100</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>105</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>110</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>120</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>140</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>160</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>180</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>200</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>250</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>300</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>zoom_combo</cstring>
+ </property>
+ <property name="currentItem">
+ <number>6</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>addCollectionButton</sender>
+ <signal>clicked()</signal>
+ <receiver>DocGlobalConfigWidgetBase</receiver>
+ <slot>addCollectionButtonClicked()</slot>
+ </connection>
+ <connection>
+ <sender>editCollectionButton</sender>
+ <signal>clicked()</signal>
+ <receiver>DocGlobalConfigWidgetBase</receiver>
+ <slot>editCollectionButtonClicked()</slot>
+ </connection>
+ <connection>
+ <sender>removeCollectionButton</sender>
+ <signal>clicked()</signal>
+ <receiver>DocGlobalConfigWidgetBase</receiver>
+ <slot>removeCollectionButtonClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>docTab</tabstop>
+ <tabstop>addCollectionButton</tabstop>
+ <tabstop>editCollectionButton</tabstop>
+ <tabstop>removeCollectionButton</tabstop>
+ <tabstop>databaseDirEdit</tabstop>
+ <tabstop>htdigbinEdit</tabstop>
+ <tabstop>htmergebinEdit</tabstop>
+ <tabstop>htsearchbinEdit</tabstop>
+ <tabstop>useAssistant_box</tabstop>
+ <tabstop>find_box</tabstop>
+ <tabstop>index_box</tabstop>
+ <tabstop>search_box</tabstop>
+ <tabstop>info_box</tabstop>
+ <tabstop>man_box</tabstop>
+</tabstops>
+<slots>
+ <slot>addCollectionButtonClicked()</slot>
+ <slot>editCollectionButtonClicked()</slot>
+ <slot>removeCollectionButtonClicked()</slot>
+ <slot>collectionsBoxCurrentChanged( int )</slot>
+ <slot>updateConfig()</slot>
+ <slot>updateIndex()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kfontcombo.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kfontcombo.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/docprojectconfigwidget.cpp b/parts/documentation/docprojectconfigwidget.cpp
new file mode 100644
index 00000000..0fd97c95
--- /dev/null
+++ b/parts/documentation/docprojectconfigwidget.cpp
@@ -0,0 +1,146 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docprojectconfigwidget.h"
+
+#include <qdir.h>
+#include <qcombobox.h>
+
+#include <kdebug.h>
+#include <kurlrequester.h>
+
+#include "domutil.h"
+#include "urlutil.h"
+#include "kdevproject.h"
+#include "kdevdocumentationplugin.h"
+
+#include "documentation_part.h"
+#include "documentation_widget.h"
+
+DocProjectConfigWidget::DocProjectConfigWidget(DocumentationPart *part, QWidget *parent, const char *name)
+ :DocProjectConfigWidgetBase(parent, name), m_part(part)
+{
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_part->m_plugins.constBegin();
+ it != m_part->m_plugins.constEnd(); ++it)
+ {
+ if ((*it)->hasCapability(DocumentationPlugin::ProjectDocumentation))
+ {
+ docSystemCombo->insertItem((*it)->pluginName());
+ m_plugins[(*it)->pluginName()] = *it;
+ }
+ }
+ QString projectDocSystem = DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/docsystem");
+
+ bool hasProjectDoc = false;
+ for (int i = 0; i < docSystemCombo->count(); ++i)
+ {
+ if (docSystemCombo->text(i) == projectDocSystem)
+ {
+ docSystemCombo->setCurrentItem(i);
+ hasProjectDoc = true;
+ changeDocSystem(docSystemCombo->currentText());
+ break;
+ }
+ }
+ if (!hasProjectDoc && docSystemCombo->count() > 0)
+ {
+ docSystemCombo->setCurrentItem(0);
+ changeDocSystem(docSystemCombo->currentText());
+ }
+
+ manualURL->setURL(DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/usermanualurl"));
+}
+
+void DocProjectConfigWidget::changeDocSystem(const QString &text)
+{
+ if (text.isEmpty())
+ return;
+
+ DocumentationPlugin *plugin = m_plugins[text];
+ if (!plugin)
+ return;
+
+ catalogURL->setMode(plugin->catalogLocatorProps().first);
+ catalogURL->setFilter(plugin->catalogLocatorProps().second);
+
+ QString projectDocURL = DomUtil::readEntry(*(m_part->projectDom()), "/kdevdocumentation/projectdoc/docurl");
+ if (!projectDocURL.isEmpty())
+ projectDocURL = QDir::cleanDirPath(m_part->project()->projectDirectory() + "/" + projectDocURL);
+
+ catalogURL->setURL(projectDocURL);
+ catalogURL->setEnabled(true);
+}
+
+void DocProjectConfigWidget::accept()
+{
+ if (manualURL->url().isEmpty())
+ {
+ if (m_part->m_userManualPlugin)
+ {
+ delete m_part->m_userManualPlugin;
+ m_part->m_userManualPlugin = 0;
+ }
+ }
+ else
+ {
+ if (m_part->m_userManualPlugin)
+ {
+ delete m_part->m_userManualPlugin;
+ m_part->m_userManualPlugin = 0;
+ }
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_part->m_plugins.constBegin();
+ it != m_part->m_plugins.constEnd(); ++it)
+ {
+ if ((*it)->hasCapability(DocumentationPlugin::ProjectUserManual))
+ m_part->m_userManualPlugin = (*it)->projectDocumentationPlugin(DocumentationPlugin::UserManual);
+ }
+ if (m_part->m_userManualPlugin)
+ m_part->m_userManualPlugin->init(m_part->m_widget->contents(), m_part->m_widget->index(), manualURL->url());
+ }
+ m_part->saveProjectDocumentationInfo();
+
+ if (docSystemCombo->currentText().isEmpty())
+ return;
+ if (catalogURL->url().isEmpty())
+ {
+ if (m_part->m_projectDocumentationPlugin)
+ {
+ delete m_part->m_projectDocumentationPlugin;
+ m_part->m_projectDocumentationPlugin = 0;
+ }
+ m_part->saveProjectDocumentationInfo();
+ return;
+ }
+
+ DocumentationPlugin *plugin = m_plugins[docSystemCombo->currentText()];
+ if (!plugin)
+ return;
+
+ if (m_part->m_projectDocumentationPlugin)
+ {
+ delete m_part->m_projectDocumentationPlugin;
+ m_part->m_projectDocumentationPlugin = 0;
+ }
+ m_part->m_projectDocumentationPlugin = plugin->projectDocumentationPlugin(DocumentationPlugin::APIDocs);
+ m_part->m_projectDocumentationPlugin->init(m_part->m_widget->contents(), m_part->m_widget->index(), catalogURL->url());
+
+ m_part->saveProjectDocumentationInfo();
+}
+
+#include "docprojectconfigwidget.moc"
diff --git a/parts/documentation/docprojectconfigwidget.h b/parts/documentation/docprojectconfigwidget.h
new file mode 100644
index 00000000..5905f6eb
--- /dev/null
+++ b/parts/documentation/docprojectconfigwidget.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCPROJECTCONFIGWIDGET_H
+#define DOCPROJECTCONFIGWIDGET_H
+
+#include "docprojectconfigwidgetbase.h"
+
+class DocumentationPart;
+class DocumentationPlugin;
+
+class DocProjectConfigWidget: public DocProjectConfigWidgetBase {
+ Q_OBJECT
+public:
+ DocProjectConfigWidget(DocumentationPart *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ virtual void changeDocSystem(const QString &text);
+ virtual void accept();
+
+private:
+ DocumentationPart *m_part;
+ QMap<QString, DocumentationPlugin*> m_plugins;
+};
+#endif
diff --git a/parts/documentation/docprojectconfigwidgetbase.ui b/parts/documentation/docprojectconfigwidgetbase.ui
new file mode 100644
index 00000000..ccff4bfc
--- /dev/null
+++ b/parts/documentation/docprojectconfigwidgetbase.ui
@@ -0,0 +1,152 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>DocProjectConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DocProjectConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>484</width>
+ <height>292</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>60</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Project API Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>catalogURL</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Ca&amp;talog location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>catalogURL</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</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="text">
+ <string>C&amp;ollection type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>docSystemCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>docSystemCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Project User Manual</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>manualURL</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>manualURL</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>docSystemCombo</sender>
+ <signal>activated(const QString&amp;)</signal>
+ <receiver>DocProjectConfigWidgetBase</receiver>
+ <slot>changeDocSystem(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>catalogURL</tabstop>
+ <tabstop>docSystemCombo</tabstop>
+</tabstops>
+<slots>
+ <slot>changeDocSystem(const QString &amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/documentation_part.cpp b/parts/documentation/documentation_part.cpp
new file mode 100644
index 00000000..0402efd5
--- /dev/null
+++ b/parts/documentation/documentation_part.cpp
@@ -0,0 +1,766 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "documentation_part.h"
+
+#include <unistd.h>
+
+#include <qtimer.h>
+#include <qdir.h>
+#include <qwhatsthis.h>
+#include <qlayout.h>
+#include <qpopupmenu.h>
+#include <qtabwidget.h>
+#include <qapplication.h>
+
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <ktrader.h>
+#include <kdebug.h>
+#include <kparts/componentfactory.h>
+#include <kservice.h>
+#include <kdialogbase.h>
+#include <kaction.h>
+#include <kactionclasses.h>
+#include <kbookmark.h>
+#include <kbookmarkmenu.h>
+#include <kinputdialog.h>
+#include <kstringhandler.h>
+#include <kconfig.h>
+#include <kwin.h>
+#include <ktexteditor/document.h>
+
+#include "kdevplugininfo.h"
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevgenericfactory.h"
+#include "kdevdocumentationplugin.h"
+#include "configwidgetproxy.h"
+#include "kdevpartcontroller.h"
+#include "domutil.h"
+#include "urlutil.h"
+#include "kdeveditorutil.h"
+
+#include "documentation_widget.h"
+#include "docglobalconfigwidget.h"
+#include "docprojectconfigwidget.h"
+#include "contentsview.h"
+#include "find_documentation.h"
+
+#include "KDevDocumentationIface.h"
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+static const KDevPluginInfo data("kdevdocumentation");
+
+typedef KDevGenericFactory<DocumentationPart> DocumentationFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevdocumentation, DocumentationFactory( data ) )
+
+DocumentationPart::DocumentationPart(QObject *parent, const char *name, const QStringList& )
+ :KDevPlugin(&data, parent, name ? name : "DocumentationPart" ),
+ m_projectDocumentationPlugin(0), m_userManualPlugin(0), m_hasIndex(false)
+{
+ setInstance(DocumentationFactory::instance());
+ setXMLFile("kdevpart_documentation.rc");
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("Documentation"), GLOBALDOC_OPTIONS, info()->icon() );
+ m_configProxy->createProjectConfigPage(i18n("Project Documentation"), PROJECTDOC_OPTIONS, info()->icon() );
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )), this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+ connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()));
+
+ m_widget = new DocumentationWidget(this);
+ m_widget->setIcon(SmallIcon( info()->icon() ));
+ m_widget->setCaption(i18n("Documentation"));
+
+ QWhatsThis::add(m_widget, i18n("<b>Documentation browser</b><p>"
+ "The documentation browser gives access to various "
+ "documentation sources (Qt DCF, Doxygen, KDoc, KDevelopTOC and DevHelp "
+ "documentation) and the KDevelop manuals. It also provides documentation index "
+ "and full text search capabilities."));
+
+ mainWindow()->embedSelectViewRight(m_widget, i18n("Documentation"),
+ i18n("Documentation browser"));
+
+ setupActions();
+
+ QTimer::singleShot(0, this, SLOT(init()));
+
+ new KDevDocumentationIface(this);
+}
+
+DocumentationPart::~DocumentationPart()
+{
+ if ( m_widget )
+ {
+ mainWindow()->removeView( m_widget );
+ }
+ delete m_widget;
+ delete m_configProxy;
+}
+
+void DocumentationPart::loadDocumentationPlugins()
+{
+ KTrader::OfferList docPluginOffers =
+ KTrader::self()->query(QString::fromLatin1("KDevelop/DocumentationPlugins"),
+ QString("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION));
+
+ KTrader::OfferList::ConstIterator serviceIt = docPluginOffers.begin();
+ for ( ; serviceIt != docPluginOffers.end(); ++serviceIt )
+ {
+ KService::Ptr docPluginService;
+ docPluginService = *serviceIt;
+ kdDebug() << "DocumentationPart::loadDocumentationPlugins: creating plugin"
+ << docPluginService->name() << endl;
+
+ int error;
+ DocumentationPlugin *docPlugin = KParts::ComponentFactory
+ ::createInstanceFromService<DocumentationPlugin>(docPluginService, 0,
+ docPluginService->name().latin1(), QStringList(), &error);
+ if (!docPlugin)
+ kdDebug() << " failed to create doc plugin " << docPluginService->name() << endl;
+ else
+ {
+ kdDebug() << " success" << endl;
+ docPlugin->init(m_widget->contents());
+ connect(this, SIGNAL(indexSelected(IndexBox* )), docPlugin, SLOT(createIndex(IndexBox* )));
+ m_plugins.append(docPlugin);
+ }
+ }
+}
+
+void DocumentationPart::emitIndexSelected(IndexBox *indexBox)
+{
+ if (!m_hasIndex)
+ {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ emit indexSelected(indexBox);
+ indexBox->fill();
+ m_hasIndex = true;
+ QApplication::restoreOverrideCursor();
+ }
+}
+
+void DocumentationPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+ switch (pageNo)
+ {
+ case GLOBALDOC_OPTIONS:
+ {
+ DocGlobalConfigWidget *w1 = new DocGlobalConfigWidget(this, m_widget, page, "doc config widget");
+ connect(dlg, SIGNAL(okClicked()), w1, SLOT(accept()));
+ break;
+ }
+ case PROJECTDOC_OPTIONS:
+ {
+ DocProjectConfigWidget *w1 = new DocProjectConfigWidget(this, page, "doc project config");
+ connect(dlg, SIGNAL(okClicked()), w1, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+KConfig *DocumentationPart::config()
+{
+ return DocumentationFactory::instance()->config();
+}
+
+bool DocumentationPart::configure(int page)
+{
+ KDialogBase dlg(KDialogBase::Plain, i18n("Documentation Settings"),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, m_widget,
+ "docsettings dialog");
+
+ QVBoxLayout *l = new QVBoxLayout(dlg.plainPage(), 0, 0);
+ DocGlobalConfigWidget *w1 = new DocGlobalConfigWidget(this, m_widget, dlg.plainPage());
+ l->addWidget(w1);
+ w1->docTab->setCurrentPage(page);
+ connect(&dlg, SIGNAL(okClicked()), w1, SLOT(accept()));
+ return (dlg.exec() == QDialog::Accepted);
+}
+
+void DocumentationPart::setupActions()
+{
+/* KActionMenu *menu = new KActionMenu(i18n("&Bookmarks"), actionCollection(), "doc_bookmarks");
+ KBookmarkMenu *bm = new KBookmarkMenu(new DocBookmarkManager(this),
+ new DocBookmarkOwner(this), menu->popupMenu(), actionCollection(), true);*/
+ KAction *action;
+
+ action = new KAction(i18n("&Search in Documentation..."), CTRL+ALT+Key_S,
+ this, SLOT(searchInDocumentation()),
+ actionCollection(), "help_search_in_doc" );
+ action->setToolTip(i18n("Full text search in the documentation"));
+ action->setWhatsThis(i18n("<b>Search in documentation</b><p>"
+ "Opens the Search in documentation tab. It allows "
+ "a search term to be entered which will be searched for in "
+ "the documentation. For this to work, a "
+ "full text index must be created first, which can be done in the "
+ "configuration dialog of the documentation plugin."));
+
+ action = new KAction(i18n("&Look in Documentation Index..."), CTRL+ALT+Key_I,
+ this, SLOT(lookInDocumentationIndex()),
+ actionCollection(), "help_look_in_index" );
+ action->setToolTip(i18n("Look in the documentation index"));
+ action->setWhatsThis(i18n("<b>Look in documentation index</b><p>"
+ "Opens the documentation index tab. It allows "
+ "a term to be entered which will be looked for in "
+ "the documentation index."));
+
+ action = new KAction(i18n("Man Page..."), 0,
+ this, SLOT(manPage()),
+ actionCollection(), "help_manpage" );
+ action->setToolTip(i18n("Show a manpage"));
+ action->setWhatsThis(i18n("<b>Show a manpage</b><p>Opens a man page using embedded viewer."));
+
+ action = new KAction(i18n("Info Page..."), 0,
+ this, SLOT(infoPage()),
+ actionCollection(), "help_infopage");
+ action->setToolTip(i18n("Show an infopage"));
+ action->setWhatsThis(i18n("<b>Show an infopage</b><p>Opens an info page using embedded viewer."));
+
+ action = new KAction(i18n("Find Documentation..."), 0,
+ this, SLOT(findInDocumentation()),
+ actionCollection(), "help_find_documentation");
+ action->setToolTip(i18n("Find Documentation"));
+ action->setWhatsThis(i18n("<b>Find documentation</b><p>"
+ "Opens the documentation finder tab and searches "
+ "all possible sources of documentation like "
+ "table of contents, index, man and info databases, "
+ "Google, etc."));
+}
+
+void DocumentationPart::emitBookmarkLocation(const QString &title, const KURL &url)
+{
+ emit bookmarkLocation(title, url);
+}
+
+void DocumentationPart::searchInDocumentation()
+{
+ QString word = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+
+ if ( word.isEmpty() )
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "searchInDocumentation()" );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->searchInDocumentation();
+ }
+ }
+ else
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "searchInDocumentation(QString)", word );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->searchInDocumentation ( word );
+ }
+ }
+}
+
+void DocumentationPart::searchInDocumentation(const QString &term)
+{
+ mainWindow()->raiseView(m_widget);
+ m_widget->searchInDocumentation(term);
+}
+
+void DocumentationPart::contextSearchInDocumentation()
+{
+ if (isAssistantUsed())
+ callAssistant("KDevDocumentation", "searchInDocumentation(QString)", m_contextStr);
+ else
+ searchInDocumentation(m_contextStr);
+}
+
+void DocumentationPart::manPage()
+{
+ QString word = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+
+ if ( isAssistantUsed() )
+ {
+ if ( word.isEmpty() )
+ {
+ callAssistant ( "KDevDocumentation", "manPage()" );
+ }
+ else
+ {
+ callAssistant ( "KDevDocumentation", "manPage(QString)", word );
+ }
+ }
+ else
+ {
+ bool ok;
+ QString manpage = KInputDialog::getText ( i18n ( "Show Manual Page" ), i18n ( "Show manpage on:" ), word, &ok, 0 );
+ if ( ok && !manpage.isEmpty() )
+ manPage ( manpage );
+ }
+}
+
+void DocumentationPart::infoPage()
+{
+ QString word = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+
+ if ( isAssistantUsed() )
+ {
+ if ( word.isEmpty() )
+ {
+ callAssistant ( "KDevDocumentation", "infoPage()" );
+ }
+ else
+ {
+ callAssistant ( "KDevDocumentation", "infoPage(QString)", word );
+ }
+ }
+ else
+ {
+ bool ok;
+ QString infopage = KInputDialog::getText ( i18n ( "Show Info Page" ), i18n ( "Show infopage on:" ), word, &ok, 0 );
+ if ( ok && !infopage.isEmpty() )
+ infoPage ( infopage );
+ }
+}
+
+void DocumentationPart::manPage(const QString &term)
+{
+ QString url = QString::fromLatin1("man:/%1").arg(term);
+ partController()->showDocument(KURL(url));
+}
+
+void DocumentationPart::infoPage(const QString &term)
+{
+ QString url = QString::fromLatin1("info:/%1").arg(term);
+ partController()->showDocument(KURL(url));
+}
+
+void DocumentationPart::contextManPage()
+{
+ if (isAssistantUsed())
+ callAssistant("KDevDocumentation", "manPage(QString)", m_contextStr);
+ else
+ manPage(m_contextStr);
+}
+
+void DocumentationPart::contextInfoPage()
+{
+ if (isAssistantUsed())
+ callAssistant("KDevDocumentation", "infoPage(QString)", m_contextStr);
+ else
+ infoPage(m_contextStr);
+}
+
+void DocumentationPart::contextFindDocumentation()
+{
+ if (isAssistantUsed())
+ callAssistant("KDevDocumentation", "findInFinder(QString)", m_contextStr);
+ else
+ findInDocumentation(m_contextStr);
+}
+
+void DocumentationPart::findInDocumentation()
+{
+ QString word = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+
+ if ( word.isEmpty() )
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "findInFinder()" );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->findInDocumentation();
+ }
+ }
+ else
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "findInFinder(QString)", word );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->findInDocumentation ( word );
+ }
+ }
+}
+
+void DocumentationPart::findInDocumentation(const QString &term)
+{
+ mainWindow()->raiseView(m_widget);
+ m_widget->findInDocumentation(term);
+}
+
+void DocumentationPart::lookInDocumentationIndex()
+{
+ QString word = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+
+ if ( word.isEmpty() )
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "lookupInIndex()" );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->lookInDocumentationIndex();
+ }
+ }
+ else
+ {
+ if ( isAssistantUsed() )
+ callAssistant ( "KDevDocumentation", "lookupInIndex(QString)", word );
+ else
+ {
+ mainWindow()->raiseView ( m_widget );
+ m_widget->lookInDocumentationIndex ( word );
+ }
+ }
+}
+
+void DocumentationPart::lookInDocumentationIndex(const QString &term)
+{
+ mainWindow()->raiseView(m_widget);
+ m_widget->lookInDocumentationIndex(term);
+}
+
+void DocumentationPart::contextLookInDocumentationIndex()
+{
+ if (isAssistantUsed())
+ callAssistant("KDevDocumentation", "lookupInIndex(QString)", m_contextStr);
+ else
+ lookInDocumentationIndex(m_contextStr);
+}
+
+void DocumentationPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (context->hasType(Context::EditorContext))
+ {
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ QString ident = econtext->currentWord();
+ if (!ident.isEmpty())
+ {
+ m_contextStr = ident;
+ QString squeezed = KStringHandler::csqueeze(m_contextStr, 30);
+ int id = -1;
+ if (hasContextFeature(Finder)) {
+ id = popup->insertItem(i18n("Find Documentation: %1").arg(squeezed),
+ this, SLOT(contextFindDocumentation()));
+ popup->setWhatsThis(id, i18n("<b>Find documentation</b><p>"
+ "Opens the documentation finder tab and searches "
+ "all possible sources of documentation like "
+ "table of contents, index, man and info databases, "
+ "Google, etc."));
+ }
+ if (hasContextFeature(IndexLookup)) {
+ id = popup->insertItem(i18n("Look in Documentation Index: %1").arg(squeezed),
+ this, SLOT(contextLookInDocumentationIndex()));
+ popup->setWhatsThis(id, i18n("<b>Look in documentation index</b><p>"
+ "Opens the documentation index tab. It allows "
+ "a term to be entered which will be looked for in "
+ "the documentation index."));
+ }
+ if (hasContextFeature(FullTextSearch)) {
+ id = popup->insertItem(i18n("Search in Documentation: %1").arg(squeezed),
+ this, SLOT(contextSearchInDocumentation()));
+ popup->setWhatsThis(id, i18n("<b>Search in documentation</b><p>Searches "
+ "for a term under the cursor in "
+ "the documentation. For this to work, "
+ "a full text index must be created first, which can be done in the "
+ "configuration dialog of the documentation plugin."));
+ }
+ if (hasContextFeature(GotoMan)) {
+ id = popup->insertItem(i18n("Goto Manpage: %1").arg(squeezed),
+ this, SLOT(contextManPage()));
+ popup->setWhatsThis(id, i18n("<b>Goto manpage</b><p>Tries to open a man page for the term under the cursor."));
+ }
+ if (hasContextFeature(GotoInfo)) {
+ id = popup->insertItem( i18n("Goto Infopage: %1").arg(squeezed),
+ this, SLOT(contextInfoPage()) );
+ popup->setWhatsThis(id, i18n("<b>Goto infopage</b><p>Tries to open an info page for the term under the cursor."));
+ }
+ if (id != -1)
+ popup->insertSeparator();
+ }
+ }
+}
+
+bool DocumentationPart::hasContextFeature(ContextFeature feature)
+{
+ KConfig *config = DocumentationFactory::instance()->config();
+ QString group = config->group();
+ config->setGroup("Context Features");
+ switch (feature)
+ {
+ case Finder:
+ return config->readBoolEntry("Finder", true);
+ break;
+ case IndexLookup:
+ return config->readBoolEntry("IndexLookup", false);
+ break;
+ case FullTextSearch:
+ return config->readBoolEntry("FullTextSearch", true);
+ break;
+ case GotoMan:
+ return config->readBoolEntry("GotoMan", false);
+ break;
+ case GotoInfo:
+ return config->readBoolEntry("GotoInfo", false);
+ break;
+ }
+ config->setGroup(group);
+ return false;
+}
+
+void DocumentationPart::setContextFeature(ContextFeature feature, bool b)
+{
+ KConfig *config = DocumentationFactory::instance()->config();
+ QString group = config->group();
+ config->setGroup("Context Features");
+ QString key;
+ switch (feature)
+ {
+ case Finder:
+ key = "Finder";
+ break;
+ case IndexLookup:
+ key = "IndexLookup";
+ break;
+ case FullTextSearch:
+ key = "FullTextSearch";
+ break;
+ case GotoMan:
+ key = "GotoMan";
+ break;
+ case GotoInfo:
+ key = "GotoInfo";
+ break;
+ }
+ if (!key.isEmpty())
+ config->writeEntry(key, b);
+ config->setGroup(group);
+}
+
+void DocumentationPart::projectOpened()
+{
+ QString projectDocSystem = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem");
+ QString projectDocURL = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl");
+ if (!projectDocURL.isEmpty())
+ projectDocURL = QDir::cleanDirPath(project()->projectDirectory() + "/" + projectDocURL);
+ QString userManualURL = DomUtil::readEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl");
+
+ for (QValueList<DocumentationPlugin*>::const_iterator it = m_plugins.constBegin();
+ it != m_plugins.constEnd(); ++it)
+ {
+ if ((*it)->hasCapability(DocumentationPlugin::ProjectDocumentation) &&
+ ((*it)->pluginName() == projectDocSystem))
+ m_projectDocumentationPlugin = (*it)->projectDocumentationPlugin(DocumentationPlugin::APIDocs);
+ if ((*it)->hasCapability(DocumentationPlugin::ProjectUserManual))
+ {
+ kdDebug() << "creating user manual for type: " << DocumentationPlugin::UserManual << endl;
+ m_userManualPlugin = (*it)->projectDocumentationPlugin(DocumentationPlugin::UserManual);
+ }
+ }
+ if (m_projectDocumentationPlugin)
+ m_projectDocumentationPlugin->init(m_widget->contents(), m_widget->index(), projectDocURL);
+ if (m_userManualPlugin && !userManualURL.isEmpty())
+ m_userManualPlugin->init(m_widget->contents(), m_widget->index(), userManualURL);
+}
+
+void DocumentationPart::projectClosed()
+{
+// saveProjectDocumentationInfo();
+
+ delete m_projectDocumentationPlugin;
+ m_projectDocumentationPlugin = 0;
+ delete m_userManualPlugin;
+ m_userManualPlugin = 0;
+}
+
+void DocumentationPart::saveProjectDocumentationInfo()
+{
+ if (m_projectDocumentationPlugin)
+ {
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem", m_projectDocumentationPlugin->pluginName());
+
+ QString relPath = URLUtil::extractPathNameRelative(project()->projectDirectory(),
+ m_projectDocumentationPlugin->catalogURL());
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl", relPath);
+ }
+ else
+ {
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docsystem", "");
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/docurl", "");
+ }
+ if (m_userManualPlugin)
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl", m_userManualPlugin->catalogURL());
+ else
+ DomUtil::writeEntry(*(projectDom()), "/kdevdocumentation/projectdoc/usermanualurl", "");
+}
+
+QCString DocumentationPart::startAssistant()
+{
+ static QCString lastAssistant = "";
+
+ if (!lastAssistant.isEmpty() && KApplication::dcopClient()->isApplicationRegistered(lastAssistant))
+ return lastAssistant;
+
+ const char *function = 0;
+ QString app = "kdevassistant";
+ function = "start_service_by_desktop_name(QString,QStringList)";
+ QStringList URLs;
+
+ QByteArray data, replyData;
+ QCString replyType;
+ QDataStream arg(data, IO_WriteOnly);
+ arg << app << URLs;
+
+ if (!KApplication::dcopClient()->call("klauncher", "klauncher", function, data, replyType, replyData))
+ {
+ kdDebug() << "call failed" << endl;
+ lastAssistant = "";
+ }
+ else
+ {
+ QDataStream reply(replyData, IO_ReadOnly);
+
+ if ( replyType != "serviceResult" )
+ {
+ kdDebug() << "unexpected result: " << replyType.data() << endl;
+ lastAssistant = "";
+ }
+ int result;
+ QCString dcopName;
+ QString error;
+ reply >> result >> dcopName >> error;
+ if (result != 0)
+ {
+ kdDebug() << "Error: " << error << endl;
+ lastAssistant = "";
+ }
+ if (!dcopName.isEmpty())
+ {
+ lastAssistant = dcopName;
+ kdDebug() << dcopName.data() << endl;
+
+ //@fixme: is there another way to wait for the remote object to be loaded
+ while (!KApplication::dcopClient()->remoteObjects(dcopName).contains("KDevDocumentation"))
+ usleep(500);
+ }
+ }
+ return lastAssistant;
+}
+
+bool DocumentationPart::isAssistantUsed() const
+{
+ // hack to solve BR #90334 - don't call kdevassistant via DCOP if we ARE kdevassistant
+ if ( kapp->instanceName().find("kdevassistant") != -1 )
+ {
+ return false;
+ }
+
+ return m_assistantUsed;
+}
+
+void DocumentationPart::setAssistantUsed(bool b)
+{
+ m_assistantUsed = b;
+ //use global config to store different settings for kdevassistant and kdevelop
+ KConfig *config = kapp->config();
+ config->setGroup("Documentation");
+ config->writeEntry("UseAssistant", isAssistantUsed());
+}
+
+void DocumentationPart::activateAssistantWindow(const QCString &ref)
+{
+ kdDebug() << "DocumentationPart::activateAssistantWindow" << endl;
+ QByteArray data, replyData;
+ QCString replyType;
+ if (KApplication::dcopClient()->call(ref, "MainWindow", "getWinID()", data, replyType, replyData))
+ {
+ kdDebug() << " call successful " << endl;
+ QDataStream reply(replyData, IO_ReadOnly);
+
+ int winId;
+ reply >> winId;
+ kdDebug() << "Win ID: " << winId << endl;
+ KWin::forceActiveWindow(winId);
+
+ KApplication::dcopClient()->send(ref, "MainWindow", "show()", QByteArray());
+ }
+}
+
+void DocumentationPart::callAssistant(const QCString &interface, const QCString &method)
+{
+ QCString ref = startAssistant();
+ QByteArray data;
+ if (KApplication::dcopClient()->send(ref, interface, method, data))
+ activateAssistantWindow(ref);
+ else
+ kdDebug() << "problem communicating with: " << ref;
+}
+
+void DocumentationPart::callAssistant(const QCString &interface, const QCString &method, const QString &dataStr)
+{
+ QCString ref = startAssistant();
+ QByteArray data;
+ QDataStream arg(data, IO_WriteOnly);
+ arg << dataStr;
+ if (KApplication::dcopClient()->send(ref, interface, method, data))
+ activateAssistantWindow(ref);
+ else
+ kdDebug() << "problem communicating with: " << ref;
+}
+
+void DocumentationPart::loadSettings()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Documentation");
+ m_assistantUsed = config->readBoolEntry("UseAssistant", false);
+
+ if (QString(KGlobal::instance()->aboutData()->appName()) == "kdevassistant")
+ {
+ int page = config->readNumEntry("LastPage", 0);
+ switch (page)
+ {
+ case 1:
+ lookInDocumentationIndex();
+ break;
+ case 2:
+ findInDocumentation();
+ break;
+ case 3:
+ searchInDocumentation();
+ break;
+ }
+ }
+}
+
+void DocumentationPart::init( )
+{
+ loadDocumentationPlugins();
+ loadSettings();
+}
+
+#include "documentation_part.moc"
diff --git a/parts/documentation/documentation_part.h b/parts/documentation/documentation_part.h
new file mode 100644
index 00000000..cad19d7a
--- /dev/null
+++ b/parts/documentation/documentation_part.h
@@ -0,0 +1,121 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __KDEVPART_DOCUMENTATION_H__
+#define __KDEVPART_DOCUMENTATION_H__
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+
+
+class FindDocumentation;
+class DocumentationWidget;
+class IndexBox;
+class KConfig;
+class KDialogBase;
+class ConfigWidgetProxy;
+class DocumentationPlugin;
+class ProjectDocumentationPlugin;
+class KURL;
+class Context;
+class QPopupMenu;
+
+/*
+ Please read the README.dox file for more info about this part
+ */
+class DocumentationPart : public KDevPlugin
+{
+ Q_OBJECT
+public:
+ enum ContextFeature { Finder, IndexLookup, FullTextSearch, GotoMan, GotoInfo };
+
+ DocumentationPart(QObject *parent, const char *name, const QStringList &);
+ ~DocumentationPart();
+
+ void emitIndexSelected(IndexBox *indexBox);
+ void emitBookmarkLocation(const QString &title, const KURL &url);
+ bool configure(int page = 0);
+
+ bool hasContextFeature(ContextFeature feature);
+ void setContextFeature(ContextFeature feature, bool b);
+
+ bool isAssistantUsed() const;
+ void setAssistantUsed(bool b);
+
+public slots:
+ void lookInDocumentationIndex();
+ void lookInDocumentationIndex(const QString &term);
+ void contextLookInDocumentationIndex();
+ void contextFindDocumentation();
+ void findInDocumentation();
+ void findInDocumentation(const QString &term);
+ void searchInDocumentation();
+ void searchInDocumentation(const QString &term);
+ void contextSearchInDocumentation();
+ void manPage();
+ void manPage(const QString &term);
+ void contextManPage();
+ void infoPage();
+ void infoPage(const QString &term);
+ void contextInfoPage();
+ void projectOpened();
+ void projectClosed();
+
+signals:
+ void indexSelected(IndexBox *indexBox);
+ void bookmarkLocation(const QString &title, const KURL &url);
+
+protected:
+ void loadDocumentationPlugins();
+ KConfig *config();
+ void setupActions();
+ void loadSettings();
+ void saveProjectDocumentationInfo();
+
+ QCString startAssistant();
+ void activateAssistantWindow(const QCString &ref);
+ void callAssistant(const QCString &interface, const QCString &method);
+ void callAssistant(const QCString &interface, const QCString &method, const QString &dataStr);
+
+protected slots:
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+private slots:
+ void init();
+
+private:
+ QGuardedPtr<DocumentationWidget> m_widget;
+ ConfigWidgetProxy *m_configProxy;
+
+ QValueList<DocumentationPlugin*> m_plugins;
+ ProjectDocumentationPlugin *m_projectDocumentationPlugin;
+ ProjectDocumentationPlugin *m_userManualPlugin;
+
+ QString m_contextStr;
+ bool m_hasIndex;
+ bool m_assistantUsed;
+
+friend class DocGlobalConfigWidget;
+friend class DocProjectConfigWidget;
+friend class SearchView;
+friend class FindDocumentation;
+};
+
+#endif
diff --git a/parts/documentation/documentation_widget.cpp b/parts/documentation/documentation_widget.cpp
new file mode 100644
index 00000000..255a834e
--- /dev/null
+++ b/parts/documentation/documentation_widget.cpp
@@ -0,0 +1,142 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "documentation_widget.h"
+
+#include <qlayout.h>
+#include <qtoolbox.h>
+
+#include <klineedit.h>
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+#include <kdevcore.h>
+#include <kdevdocumentationplugin.h>
+
+#include "documentation_part.h"
+#include "contentsview.h"
+#include "indexview.h"
+#include "searchview.h"
+#include "bookmarkview.h"
+#include "find_documentation.h"
+
+DocumentationWidget::DocumentationWidget(DocumentationPart *part)
+ :QWidget(0, "documentation widget"), m_part(part)
+{
+ QVBoxLayout *l = new QVBoxLayout(this, 0, 0);
+
+ m_tab = new QToolBox(this);
+ l->addWidget(m_tab);
+
+ m_contents = new ContentsView(this);
+ m_tab->addItem(m_contents, i18n("Contents"));
+
+ m_index = new IndexView(this);
+ m_tab->addItem(m_index, i18n("Index"));
+
+ m_finder = new FindDocumentation(this);
+ m_tab->addItem(m_finder,i18n("Finder"));
+
+ m_search = new SearchView(m_part, this);
+ m_tab->addItem(m_search, i18n("Search"));
+
+ m_bookmarks = new BookmarkView(this);
+ m_tab->addItem(m_bookmarks, i18n("Bookmarks"));
+
+ connect(m_tab, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
+}
+
+DocumentationWidget::~DocumentationWidget()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Documentation");
+ config->writeEntry("LastPage", m_tab->currentIndex());
+}
+
+void DocumentationWidget::tabChanged(int t)
+{
+ if (!m_tab->item(t))
+ return;
+ m_tab->item(t)->setFocus();
+ if (m_tab->item(t) == m_index)
+ m_part->emitIndexSelected(m_index->indexBox());
+}
+
+IndexBox *DocumentationWidget::index() const
+{
+ return m_index->indexBox();
+}
+
+void DocumentationWidget::searchInDocumentation()
+{
+ m_tab->setCurrentItem(m_search);
+ m_search->askSearchTerm();
+}
+
+void DocumentationWidget::searchInDocumentation(const QString &term)
+{
+ m_tab->setCurrentItem(m_search);
+ m_search->setSearchTerm(term);
+ m_search->search();
+}
+
+void DocumentationWidget::lookInDocumentationIndex()
+{
+ m_tab->setCurrentItem(m_index);
+ m_index->askSearchTerm();
+}
+
+void DocumentationWidget::lookInDocumentationIndex(const QString &term)
+{
+ m_tab->setCurrentItem(m_index);
+ m_index->setSearchTerm(term);
+ //adymo: let's allow the user to press enter here ;)
+// m_index->searchInIndex();
+}
+
+void DocumentationWidget::findInDocumentation(const QString &term)
+{
+ m_tab->setCurrentItem(m_finder);
+ m_finder->setSearchTerm(term);
+ m_finder->startSearch();
+}
+
+void DocumentationWidget::findInDocumentation()
+{
+ m_tab->setCurrentItem(m_finder);
+ m_finder->search_term->setFocus();
+}
+
+void DocumentationWidget::focusInEvent(QFocusEvent */*e*/)
+{
+ if (m_tab->currentItem())
+ m_tab->currentItem()->setFocus();
+}
+
+KListView * DocumentationWidget::contents( ) const
+{
+ return m_contents->view();
+}
+
+#include "documentation_widget.moc"
diff --git a/parts/documentation/documentation_widget.h b/parts/documentation/documentation_widget.h
new file mode 100644
index 00000000..c3a43ce7
--- /dev/null
+++ b/parts/documentation/documentation_widget.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef __DOCUMENTATION_WIDGET_H__
+#define __DOCUMENTATION_WIDGET_H__
+
+#include <qwidget.h>
+
+class FindDocumentation;
+class KDevProject;
+class DocumentationPart;
+class ContentsView;
+class IndexView;
+class DocumentationCatalogItem;
+class QToolBox;
+class IndexBox;
+class SearchView;
+class BookmarkView;
+class KListView;
+
+class DocumentationWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ DocumentationWidget(DocumentationPart *part);
+ ~DocumentationWidget();
+
+ DocumentationPart *part() const { return m_part; }
+
+ KListView *contents() const;
+ IndexBox *index() const;
+
+public slots:
+ void lookInDocumentationIndex();
+ void lookInDocumentationIndex(const QString &term);
+ void searchInDocumentation();
+ void searchInDocumentation(const QString &term);
+ void findInDocumentation();
+ void findInDocumentation(const QString &term);
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+protected slots:
+ void tabChanged(int t);
+
+private:
+ DocumentationPart *m_part;
+ ContentsView *m_contents;
+ IndexView *m_index;
+ SearchView *m_search;
+ BookmarkView *m_bookmarks;
+ FindDocumentation *m_finder;
+ QToolBox *m_tab;
+
+friend class FindDocumentation;
+};
+
+#endif
diff --git a/parts/documentation/docutils.cpp b/parts/documentation/docutils.cpp
new file mode 100644
index 00000000..52b1964b
--- /dev/null
+++ b/parts/documentation/docutils.cpp
@@ -0,0 +1,100 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docutils.h"
+
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <klineedit.h>
+#include <kcombobox.h>
+#include <kpopupmenu.h>
+#include <klocale.h>
+#include <kstringhandler.h>
+
+#include <kdevpartcontroller.h>
+
+#include "kdevdocumentationplugin.h"
+#include "documentation_part.h"
+
+QString DocUtils::noEnvURL(const QString &url)
+{
+ return KURLCompletion::replacedPath(url, true, true);
+}
+
+KURL DocUtils::noEnvURL(const KURL &url)
+{
+ QString replaced = KURLCompletion::replacedPath(url.url(), true, true);
+ KURL kurl(replaced);
+ kurl.setQuery(url.query());
+ kurl.setRef(url.ref());
+ return kurl;
+}
+
+QString DocUtils::envURL(KURLRequester *req)
+{
+ if (req->lineEdit())
+ return req->lineEdit()->text();
+ else if (req->comboBox())
+ return req->comboBox()->currentText();
+ else
+ return req->url();
+}
+
+void DocUtils::docItemPopup(DocumentationPart *part, DocumentationItem *docItem,
+ const QPoint &pos, bool showBookmark, bool showSearch, int titleCol)
+{
+ docItemPopup(part, docItem->text(titleCol), docItem->url(), pos, showBookmark, showSearch);
+}
+
+void DocUtils::docItemPopup(DocumentationPart *part, IndexItem *docItem, const QPoint &pos,
+ bool showBookmark, bool showSearch)
+{
+ //FIXME: index item can have more than one url, what to do?
+ KURL url;
+ if (docItem->urls().count() > 0)
+ url = docItem->urls().first().second;
+ docItemPopup(part, docItem->text(), url, pos, showBookmark, showSearch);
+}
+
+void DocUtils::docItemPopup(DocumentationPart *part, const QString &title, const KURL &url,
+ const QPoint &pos, bool showBookmark, bool showSearch)
+{
+ KPopupMenu menu;
+ menu.insertTitle(i18n("Documentation"));
+ menu.insertItem(i18n("Open in Current Tab"), 1);
+ menu.insertItem(i18n("Open in New Tab"), 2);
+ if (showBookmark)
+ {
+ menu.insertSeparator();
+ menu.insertItem(i18n("Bookmark This Location"), 3);
+ }
+ if (showSearch)
+ {
+ menu.insertSeparator();
+ menu.insertItem(QString("%1: %2").arg(i18n("Search")).arg(KStringHandler::csqueeze(title,20)), 4);
+ }
+
+ switch (menu.exec(pos))
+ {
+ case 1: part->partController()->showDocument(url); break;
+ case 2: part->partController()->showDocument(url, true); break;
+ case 3: part->emitBookmarkLocation(title, url); break;
+ case 4: part->searchInDocumentation(title); break;
+ }
+}
diff --git a/parts/documentation/docutils.h b/parts/documentation/docutils.h
new file mode 100644
index 00000000..75b52324
--- /dev/null
+++ b/parts/documentation/docutils.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOC_UTILS_H
+#define DOC_UTILS_H
+
+#include <qstring.h>
+
+class KURLRequester;
+class KPopupMenu;
+class DocumentationItem;
+class DocumentationPart;
+class QPoint;
+class IndexItem;
+class KURL;
+
+namespace DocUtils{
+
+/**Returns an url selected in KURLRequester but does not
+resolve environment variables.*/
+QString envURL(KURLRequester *req);
+/**Resolves environment variables in url.*/
+QString noEnvURL(const QString &url);
+/**Resolves environment variables in url.*/
+KURL noEnvURL(const KURL &url);
+
+void docItemPopup(DocumentationPart *part, DocumentationItem *docItem, const QPoint &pos,
+ bool showBookmark = false, bool showSearch = false, int titleCol = 0);
+void docItemPopup(DocumentationPart *part, IndexItem *docItem, const QPoint &pos,
+ bool showBookmark = false, bool showSearch = false);
+void docItemPopup(DocumentationPart *part, const QString &title, const KURL &url,
+ const QPoint &pos, bool showBookmark = false, bool showSearch = false);
+}
+
+#endif
diff --git a/parts/documentation/editbookmarkdlg.ui b/parts/documentation/editbookmarkdlg.ui
new file mode 100644
index 00000000..fec2dc11
--- /dev/null
+++ b/parts/documentation/editbookmarkdlg.ui
@@ -0,0 +1,165 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>EditBookmarkDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditBookmarkDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>323</width>
+ <height>121</height>
+ </rect>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="1" column="1">
+ <property name="name">
+ <cstring>locationEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>locationEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="2" 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>0</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>EditBookmarkDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>EditBookmarkDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>nameEdit</tabstop>
+ <tabstop>locationEdit</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/editcatalogdlg.cpp b/parts/documentation/editcatalogdlg.cpp
new file mode 100644
index 00000000..11f4c4fc
--- /dev/null
+++ b/parts/documentation/editcatalogdlg.cpp
@@ -0,0 +1,79 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "editcatalogdlg.h"
+
+#include <qlabel.h>
+
+#include <klineedit.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+
+#include "docutils.h"
+#include "kdevdocumentationplugin.h"
+
+EditCatalogDlg::EditCatalogDlg(DocumentationPlugin *plugin, QWidget* parent,
+ const char* name, bool modal, WFlags fl)
+ :EditCatalogBase(parent,name, modal,fl), m_plugin(plugin)
+{
+ if (m_plugin->hasCapability(DocumentationPlugin::CustomDocumentationTitles))
+ {
+ titleLabel->setEnabled(true);
+ titleEdit->setEnabled(true);
+ }
+ locationURL->setMode(m_plugin->catalogLocatorProps().first);
+ locationURL->setFilter(m_plugin->catalogLocatorProps().second);
+}
+
+EditCatalogDlg::~EditCatalogDlg()
+{
+}
+
+/*$SPECIALIZATION$*/
+void EditCatalogDlg::locationURLChanged(const QString &text)
+{
+ titleEdit->setText(m_plugin->catalogTitle(DocUtils::noEnvURL(text)));
+}
+
+void EditCatalogDlg::accept()
+{
+ QDialog::accept();
+}
+
+QString EditCatalogDlg::title() const
+{
+ return titleEdit->text();
+}
+
+QString EditCatalogDlg::url() const
+{
+ return DocUtils::envURL(locationURL);
+}
+
+void EditCatalogDlg::setTitle(const QString &title)
+{
+ titleEdit->setText(title);
+}
+
+void EditCatalogDlg::setURL(const QString &url)
+{
+ locationURL->setURL(url);
+}
+
+#include "editcatalogdlg.moc"
diff --git a/parts/documentation/editcatalogdlg.h b/parts/documentation/editcatalogdlg.h
new file mode 100644
index 00000000..5628fa99
--- /dev/null
+++ b/parts/documentation/editcatalogdlg.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef EDITCATALOGDLG_H
+#define EDITCATALOGDLG_H
+
+#include "editcatalogdlgbase.h"
+
+class DocumentationPlugin;
+
+class EditCatalogDlg : public EditCatalogBase
+{
+ Q_OBJECT
+public:
+ EditCatalogDlg(DocumentationPlugin *plugin,
+ QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
+ ~EditCatalogDlg();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ QString title() const;
+ void setTitle(const QString &title);
+ QString url() const;
+ void setURL(const QString &url);
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void locationURLChanged(const QString &text);
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+ virtual void accept();
+
+private:
+ DocumentationPlugin *m_plugin;
+};
+
+#endif
diff --git a/parts/documentation/editcatalogdlgbase.ui b/parts/documentation/editcatalogdlgbase.ui
new file mode 100644
index 00000000..3fd4caf9
--- /dev/null
+++ b/parts/documentation/editcatalogdlgbase.ui
@@ -0,0 +1,196 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>EditCatalogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditCatalogBase</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>404</width>
+ <height>163</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Documentation Catalog Properties</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="4" column="0">
+ <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="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>locationURL</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>locationURL</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>titleLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Title:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>titleEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>titleEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>EditCatalogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>EditCatalogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>locationURL</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>EditCatalogBase</receiver>
+ <slot>locationURLChanged(const QString&amp;)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>locationURL</tabstop>
+ <tabstop>titleEdit</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot>locationURLChanged( const QString &amp; )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/find_documentation.cpp b/parts/documentation/find_documentation.cpp
new file mode 100644
index 00000000..6195536e
--- /dev/null
+++ b/parts/documentation/find_documentation.cpp
@@ -0,0 +1,347 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Tobias Glaesser *
+ * tobi.web@gmx.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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "find_documentation.h"
+
+#include <stdlib.h>
+#include <qcheckbox.h>
+#include <qheader.h>
+#include <qapplication.h>
+#include <qstringlist.h>
+
+#include <klineedit.h>
+#include <kprocess.h>
+#include <klistbox.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevdocumentationplugin.h>
+
+#include "documentation_widget.h"
+#include "documentation_part.h"
+#include "indexview.h"
+#include "find_documentation_options.h"
+#include "docutils.h"
+#include "contentsview.h"
+
+#include <klocale.h>
+
+FindDocumentation::FindDocumentation(DocumentationWidget* parent, const char* name)
+ :FindDocumentationBase(parent, name),
+ man_item(0), info_item(0), index_item(0), google_item(0), contents_item(0),
+ last_item(0), m_widget(parent)
+{
+ QWidget* tmp = QApplication::desktop();
+ setGeometry(tmp->width()/2 - width()/2, tmp->height()/2 - height()/2, width(), height());
+ proc_man = new KProcess( this );
+ proc_info = new KProcess( this );
+
+ connect( proc_man, SIGNAL(processExited( KProcess* )),
+ this, SLOT(procManExited( KProcess* )) );
+ connect( proc_man, SIGNAL(receivedStdout( KProcess*, char*, int)),
+ this, SLOT(procManReadStdout( KProcess*, char*, int)) );
+
+ connect( proc_info, SIGNAL(processExited( KProcess* )),
+ this, SLOT(procInfoExited( KProcess* )) );
+ connect( proc_info, SIGNAL(receivedStdout( KProcess*, char*, int)),
+ this, SLOT(procInfoReadStdout( KProcess*, char*, int)) );
+
+ result_list->header()->hide();
+ result_list->setSorting(-1);
+
+ m_options = new FindDocumentationOptions(this);
+}
+
+FindDocumentation::~FindDocumentation()
+{
+}
+
+/*$SPECIALIZATION$*/
+void FindDocumentation::buttonPressedOnItem( int button, QListViewItem * item, const QPoint & pos, int // c
+ )
+{
+ if ((button != Qt::RightButton) || (!item))
+ return;
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+
+ DocUtils::docItemPopup(m_widget->part(), docItem->text(0), docItem->url(), pos, true, false);
+}
+
+void FindDocumentation::clickOnItem( QListViewItem * item )
+{
+ if(!item)
+ return;
+
+ if(item == man_item || item == info_item || item == index_item || item == google_item)
+ return;
+
+ DocumentationItem* doc_item = dynamic_cast<DocumentationItem*>(item);
+
+ if(item->parent() == man_item ||
+ item->parent() == info_item ||
+ item->parent() == google_item ||
+ item->parent() == index_item ||
+ item->parent() == contents_item)
+ m_widget->part()->partController()->showDocument(doc_item->url());
+}
+
+void FindDocumentation::procInfoExited( KProcess* )
+{
+ if (proc_info->normalExit() && proc_info->exitStatus() == 0)
+ {
+ QStringList lines = QStringList::split("\n", proc_info_out);
+ for( QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it )
+ {
+ if( (*it) == "*")
+ break;
+
+ DocumentationItem* newitem = new DocumentationItem(DocumentationItem::Document, info_item, *it);
+ newitem->setURL(KURL("info:/" + search_term->text()));
+ }
+ }
+ proc_info_out = "";
+
+ if(info_item->firstChild() && m_options->goto_first_match->isOn())
+ {
+ m_widget->part()->partController()->showDocument(dynamic_cast<DocumentationItem*>(info_item->firstChild())->url());
+ first_match_found = true;
+ }
+}
+
+void FindDocumentation::procManExited( KProcess* )
+{
+ if (proc_man->normalExit() && proc_man->exitStatus() == 0)
+ {
+ QStringList lines = QStringList::split("\n", proc_man_out);
+ for( QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it )
+ {
+ DocumentationItem* newitem = new DocumentationItem(DocumentationItem::Document, man_item, search_term->text());
+ newitem->setURL(KURL("man://" + *it));
+ }
+ }
+ proc_man_out = "";
+
+ if(man_item->firstChild() && m_options->goto_first_match->isOn())
+ {
+ m_widget->part()->partController()->showDocument(dynamic_cast<DocumentationItem*>(man_item->firstChild())->url());
+ first_match_found = true;
+ }
+}
+
+void FindDocumentation::procInfoReadStdout( KProcess*, char* buf, int len)
+{
+ proc_info_out += QString::fromLatin1( buf, len );
+}
+
+void FindDocumentation::procManReadStdout( KProcess*, char* buf, int len)
+{
+ proc_man_out += QString::fromLatin1( buf, len );
+}
+
+void FindDocumentation::searchInInfo()
+{
+ info_item = new KListViewItem(result_list, last_item, "Info");
+ info_item->setOpen(true);
+ last_item = info_item;
+
+ proc_info->clearArguments();
+ //Search Info documents
+ *proc_info << "info";
+ *proc_info << "-w";
+ *proc_info << search_term->text();
+
+ if ( !proc_info->start( KProcess::NotifyOnExit, KProcess::Stdout ) )
+ {
+ // error handling
+ }
+}
+
+void FindDocumentation::searchInMan()
+{
+ man_item = new KListViewItem( result_list, last_item, i18n("Manual") );
+ man_item->setOpen(true);
+ last_item = man_item;
+
+ proc_man->clearArguments();
+ //Search Manpages
+ *proc_man << "man";
+ *proc_man << "-w";
+ *proc_man << search_term->text();
+
+ if ( !proc_man->start( KProcess::NotifyOnExit, KProcess::Stdout ) )
+ {
+ // error handling
+ }
+
+}
+
+void FindDocumentation::searchInGoogle()
+{
+ google_item = new KListViewItem(result_list, last_item, "Google");
+ google_item->setOpen(true);
+ last_item = google_item;
+
+ DocumentationItem* newitem = new DocumentationItem(DocumentationItem::Document,
+ google_item, "First result for: " + search_term->text());
+ newitem->setURL(KURL("http://www.google.com/search?q=" + search_term->text() + "&btnI"));
+ newitem = new DocumentationItem(DocumentationItem::Document, google_item, "All results for: " + search_term->text());
+ newitem->setURL(KURL("http://www.google.com/search?q=" + search_term->text()));
+
+ if (google_item->firstChild() && m_options->goto_first_match->isOn())
+ {
+ m_widget->part()->partController()->showDocument(dynamic_cast<DocumentationItem*>(google_item->firstChild())->url());
+ first_match_found = true;
+ }
+}
+
+void FindDocumentation::searchInContents()
+{
+ contents_item = new KListViewItem( result_list, last_item, i18n("Contents") );
+ contents_item->setOpen(true);
+ last_item = contents_item;
+
+ QListViewItemIterator it( m_widget->m_contents->m_view );
+ while ( it.current() )
+ {
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(it.current());
+
+ if (docItem->type() == DocumentationItem::Catalog)
+ {
+ DocumentationCatalogItem *catalogItem = dynamic_cast<DocumentationCatalogItem*>(it.current());
+ catalogItem->load();
+ catalogItem->plugin()->setCatalogURL(catalogItem);
+ }
+ if (it.current()->text(0).contains(search_term->text(),false))
+ {
+ DocumentationItem* newitem = new DocumentationItem(DocumentationItem::Document,
+ contents_item, it.current()->text(0) );
+ newitem->setURL(docItem->url());
+ }
+ ++it;
+ }
+
+ if (contents_item->firstChild() && m_options->goto_first_match->isOn())
+ {
+ m_widget->part()->partController()->showDocument(dynamic_cast<DocumentationItem*>(contents_item->firstChild())->url());
+ first_match_found = true;
+ }
+}
+
+void FindDocumentation::searchInIndex()
+{
+ index_item =new KListViewItem(result_list, last_item , "Index");
+ index_item->setOpen(true);
+ last_item = index_item;
+
+ m_widget->part()->emitIndexSelected(m_widget->m_index->indexBox());
+ m_widget->m_index->setSearchTerm(search_term->text());
+ m_widget->m_index->showIndex(search_term->text());
+
+ if(m_widget->m_index->m_index->selectedItem())
+ {
+ IndexItem* item = dynamic_cast<IndexItem*>(m_widget->m_index->m_index->selectedItem());
+ DocumentationItem* newitem = 0;
+ while(item)
+ {
+ if(!item->text().contains(search_term->text(),false))
+ break;
+
+ IndexItem::List urls = item->urls();
+ for (IndexItem::List::const_iterator it = urls.begin(); it != urls.end(); ++it)
+ {
+ QString text = item->text();
+ if (urls.count() > 1)
+ text = (*it).first;
+ if(newitem)
+ newitem = new DocumentationItem(DocumentationItem::Document, index_item,
+ newitem, text);
+ else
+ newitem = new DocumentationItem(DocumentationItem::Document,
+ index_item, text);
+
+ newitem->setURL((*it).second);
+ }
+
+ item = dynamic_cast<IndexItem*>(item->next());
+ }
+ }
+
+ if(index_item->firstChild() && m_options->goto_first_match->isOn())
+ {
+ m_widget->part()->partController()->showDocument(
+ dynamic_cast<DocumentationItem*>(index_item->firstChild())->url());
+ first_match_found = true;
+ }
+}
+
+void FindDocumentation::startSearch()
+{
+ //Clear the contents of the listview
+ result_list->clear();
+
+ last_item = NULL;
+ first_match_found = false;
+
+ QListViewItem* item = m_options->source_list->firstChild();
+
+ while ( item && ( !m_options->goto_first_match->isOn() || !first_match_found ))
+ {
+ if ( m_options->isMan(dynamic_cast<QCheckListItem*>(item)) )
+ searchInMan();
+ else if ( m_options->isInfo(dynamic_cast<QCheckListItem*>(item)) )
+ searchInInfo();
+ else if ( m_options->isIndex(dynamic_cast<QCheckListItem*>(item)) )
+ searchInIndex();
+ else if ( m_options->isGoogle(dynamic_cast<QCheckListItem*>(item)) )
+ searchInGoogle();
+ else if ( m_options->isContents(dynamic_cast<QCheckListItem*>(item)) )
+ searchInContents();
+
+ item = item->itemBelow();
+ }
+
+ //Set the focus to the listview and the first child to the
+ //current item of the list, so that you can brows the items with your keyboard
+ result_list->setFocus();
+ if(result_list->firstChild())
+ result_list->setCurrentItem(result_list->firstChild());
+
+}
+
+void FindDocumentation::setSearchTerm( const QString & term )
+{
+ search_term->setText(term);
+}
+
+void FindDocumentation::clickOptions()
+{
+ if( m_options->exec() == QDialog::Accepted )
+ m_options->writeOptions();
+ else
+ m_options->readOptions();
+}
+
+void FindDocumentation::focusInEvent( QFocusEvent * // e
+ )
+{
+ search_term->setFocus();
+}
+
+#include "find_documentation.moc"
diff --git a/parts/documentation/find_documentation.h b/parts/documentation/find_documentation.h
new file mode 100644
index 00000000..26afa5be
--- /dev/null
+++ b/parts/documentation/find_documentation.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Tobias Glaesser *
+ * tobi.web@gmx.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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef FINDDOCUMENTATION_H
+#define FINDDOCUMENTATION_H
+
+#include "find_documentationbase.h"
+
+class DocumentationWidget;
+class KListViewItem;
+class FindDocumentationOptions;
+class KProcess;
+
+class FindDocumentation : public FindDocumentationBase
+{
+Q_OBJECT
+public:
+ FindDocumentation(DocumentationWidget* parent, const char* name = 0);
+ ~FindDocumentation();
+ /*$PUBLIC_FUNCTIONS$*/
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void buttonPressedOnItem( int button, QListViewItem * item, const QPoint & pos, int c );
+ virtual void clickOnItem( QListViewItem * item );
+ virtual void procInfoExited( KProcess* );
+ virtual void procManExited( KProcess* );
+ virtual void procManReadStdout( KProcess*, char*, int );
+ virtual void procInfoReadStdout( KProcess*, char*, int );
+ virtual void searchInInfo();
+ virtual void searchInMan();
+ virtual void searchInGoogle();
+ virtual void searchInContents();
+ virtual void searchInIndex();
+ virtual void startSearch();
+ virtual void setSearchTerm( const QString & term );
+ virtual void clickOptions();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+ virtual void focusInEvent(QFocusEvent *e);
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+private:
+ KProcess* proc_man;
+ KProcess* proc_info;
+ QString proc_man_out;
+ QString proc_info_out;
+ KListViewItem* man_item;
+ KListViewItem* info_item;
+ KListViewItem* index_item;
+ KListViewItem* google_item;
+ KListViewItem* contents_item;
+ KListViewItem* last_item;
+ DocumentationWidget* m_widget;
+ FindDocumentationOptions* m_options;
+ bool first_match_found;
+
+};
+
+#endif
+
diff --git a/parts/documentation/find_documentation_options.cpp b/parts/documentation/find_documentation_options.cpp
new file mode 100644
index 00000000..ba3ab46f
--- /dev/null
+++ b/parts/documentation/find_documentation_options.cpp
@@ -0,0 +1,192 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Tobias Glaesser *
+ * tobi.web@gmx.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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "find_documentation_options.h"
+
+#include <qheader.h>
+#include <qcheckbox.h>
+
+#include <klistview.h>
+#include <klocale.h>
+
+#include <kconfig.h>
+#include <kapplication.h>
+
+FindDocumentationOptions::FindDocumentationOptions(QWidget* parent, const char* name, bool modal)
+ :FindDocumentationOptionsBase(parent,name, modal),
+ m_man_item(0), m_info_item(0), m_index_item(0), m_google_item(0), m_contents_item(0)
+{
+ readOptions();
+
+ source_list->header()->hide();
+ source_list->setSorting(-1);
+}
+
+FindDocumentationOptions::~FindDocumentationOptions()
+{
+}
+
+/*$SPECIALIZATION$*/
+bool FindDocumentationOptions::isContents( QCheckListItem * item )
+{
+ if ( item == m_contents_item && m_contents_item->isOn() )
+ return true;
+ else
+ return false;
+}
+
+bool FindDocumentationOptions::isGoogle( QCheckListItem * item )
+{
+ if ( item == m_google_item && m_google_item->isOn() )
+ return true;
+ else
+ return false;
+}
+
+bool FindDocumentationOptions::isIndex( QCheckListItem * item )
+{
+ if ( item == m_index_item && m_index_item->isOn() )
+ return true;
+ else
+ return false;
+}
+
+bool FindDocumentationOptions::isInfo( QCheckListItem * item )
+{
+ if ( item == m_info_item && m_info_item->isOn() )
+ return true;
+ else
+ return false;
+}
+
+bool FindDocumentationOptions::isMan( QCheckListItem * item )
+{
+ if ( item == m_man_item && m_man_item->isOn() )
+ return true;
+ else
+ return false;
+}
+
+void FindDocumentationOptions::sourceMoveDown()
+{
+ if (!source_list->currentItem())
+ return;
+ if (source_list->currentItem()->nextSibling() == 0)
+ return;
+
+ source_list->currentItem()->moveItem(source_list->currentItem()->nextSibling());
+}
+
+void FindDocumentationOptions::sourceMoveUp()
+{
+ if (!source_list->currentItem())
+ return;
+ if (source_list->currentItem() == source_list->firstChild())
+ return;
+
+ QListViewItem *item = source_list->firstChild();
+ while (item->nextSibling() != source_list->currentItem())
+ item = item->nextSibling();
+ item->moveItem( source_list->currentItem());
+}
+
+void FindDocumentationOptions::writeOptions()
+{
+ config = kapp->config();
+ config->setGroup("DocumentationFinder");
+
+ config->writeEntry("goto_first_match", goto_first_match->isChecked());
+
+ QListViewItemIterator it( source_list );
+ int i = 0;
+ while ( it.current() )
+ {
+ if ( it.current() == m_man_item )
+ {
+ config->writeEntry("Manpage",i);
+ config->writeEntry("ManpageEnabled",m_man_item->isOn());
+ }
+ else if ( it.current() == m_info_item )
+ {
+ config->writeEntry("Info",i);
+ config->writeEntry("InfoEnabled",m_info_item->isOn());
+ }
+ else if ( it.current() == m_index_item )
+ {
+ config->writeEntry("Index",i);
+ config->writeEntry("IndexEnabled",m_index_item->isOn());
+ }
+ else if ( it.current() == m_google_item )
+ {
+ config->writeEntry("Google",i);
+ config->writeEntry("GoogleEnabled",m_google_item->isOn());
+ }
+ else if ( it.current() == m_contents_item )
+ {
+ config->writeEntry("Contents",i);
+ config->writeEntry("ContentsEnabled",m_contents_item->isOn());
+ }
+ ++it;
+ ++i;
+ }
+
+ config->sync();
+}
+
+void FindDocumentationOptions::readOptions()
+{
+ config = kapp->config();
+ config->setGroup("DocumentationFinder");
+
+ source_list->clear();
+
+ for(int i = 4; i > -1; --i )
+ {
+ if( config->readPropertyEntry( "Manpage" , 0 ) == i)
+ {
+ m_man_item = new QCheckListItem( source_list, i18n("Manual"), QCheckListItem::CheckBox );
+ m_man_item->setOn(config->readBoolEntry( "ManpageEnabled" , true));
+ }
+ if( config->readPropertyEntry( "Info" , 1 ) == i)
+ {
+ m_info_item = new QCheckListItem( source_list, i18n("Info"), QCheckListItem::CheckBox );
+ m_info_item->setOn(config->readBoolEntry( "InfoEnabled" , true));
+ }
+ if( config->readPropertyEntry( "Index" , 2 ) == i)
+ {
+ m_index_item = new QCheckListItem( source_list, i18n("Index"), QCheckListItem::CheckBox );
+ m_index_item->setOn(config->readBoolEntry( "IndexEnabled" , true));
+ }
+ if( config->readPropertyEntry( "Google" , 3 ) == i)
+ {
+ m_google_item = new QCheckListItem( source_list, i18n("Google"), QCheckListItem::CheckBox );
+ m_google_item->setOn(config->readBoolEntry( "GoogleEnabled" , false));
+ }
+ if( config->readPropertyEntry( "Contents" , 4 ) == i)
+ {
+ m_contents_item = new QCheckListItem( source_list, i18n("Contents"), QCheckListItem::CheckBox );
+ m_contents_item->setOn(config->readBoolEntry( "ContentsEnabled" , false));
+ }
+ }
+
+ goto_first_match->setChecked(config->readBoolEntry( "goto_first_match" , false));
+}
+
+#include "find_documentation_options.moc"
+
diff --git a/parts/documentation/find_documentation_options.h b/parts/documentation/find_documentation_options.h
new file mode 100644
index 00000000..e2c24f9c
--- /dev/null
+++ b/parts/documentation/find_documentation_options.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Tobias Glaesser *
+ * tobi.web@gmx.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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef FIND_DOCUMENTATIONOPTIONS_H
+#define FIND_DOCUMENTATIONOPTIONS_H
+
+#include "find_documentation_optionsbase.h"
+
+class QCheckListItem;
+class KConfig;
+
+class FindDocumentationOptions : public FindDocumentationOptionsBase
+{
+Q_OBJECT
+public:
+ FindDocumentationOptions(QWidget* parent = 0, const char* name = 0, bool modal = FALSE);
+ ~FindDocumentationOptions();
+ /*$PUBLIC_FUNCTIONS$*/
+ virtual bool isContents( QCheckListItem * item );
+ virtual bool isGoogle( QCheckListItem * item );
+ virtual bool isIndex( QCheckListItem * item );
+ virtual bool isInfo( QCheckListItem * item );
+ virtual bool isMan( QCheckListItem * item );
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ virtual void sourceMoveDown();
+ virtual void sourceMoveUp();
+ virtual void writeOptions();
+ virtual void readOptions();
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+private:
+ QCheckListItem *m_man_item;
+ QCheckListItem *m_info_item;
+ QCheckListItem *m_index_item;
+ QCheckListItem *m_google_item;
+ QCheckListItem *m_contents_item;
+
+ KConfig* config;
+};
+
+#endif
+
diff --git a/parts/documentation/find_documentation_optionsbase.ui b/parts/documentation/find_documentation_optionsbase.ui
new file mode 100644
index 00000000..c2beadc9
--- /dev/null
+++ b/parts/documentation/find_documentation_optionsbase.ui
@@ -0,0 +1,218 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>FindDocumentationOptionsBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FindDocumentationOptionsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>349</width>
+ <height>310</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Find Documentation Options</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="1" column="0">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>source_list</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>Layout9_3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>moveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>movedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </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>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>goto_first_match</cstring>
+ </property>
+ <property name="text">
+ <string>Go to first match</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>You can enable and disable search
+sources and change their priority here.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationOptionsBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationOptionsBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>moveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationOptionsBase</receiver>
+ <slot>sourceMoveUp()</slot>
+ </connection>
+ <connection>
+ <sender>movedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationOptionsBase</receiver>
+ <slot>sourceMoveDown()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>sourceMoveUp()</slot>
+ <slot>sourceMoveDown()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/documentation/find_documentationbase.ui b/parts/documentation/find_documentationbase.ui
new file mode 100644
index 00000000..58e6aeb0
--- /dev/null
+++ b/parts/documentation/find_documentationbase.ui
@@ -0,0 +1,167 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>FindDocumentationBase</class>
+<author>Tobias Gläßer</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>FindDocumentationBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>222</width>
+ <height>504</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Find Documentation</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Search term:</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>button_search</cstring>
+ </property>
+ <property name="text">
+ <string>Search</string>
+ </property>
+ <property name="default">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>search_term</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="0">
+ <property name="name">
+ <cstring>butten_options</cstring>
+ </property>
+ <property name="text">
+ <string>Options</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1" rowspan="1" colspan="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>100</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView" row="2" column="0" rowspan="1" colspan="3">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>result_list</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>LastColumn</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>button_search</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>startSearch()</slot>
+ </connection>
+ <connection>
+ <sender>result_list</sender>
+ <signal>executed(QListViewItem*)</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>clickOnItem(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>butten_options</sender>
+ <signal>clicked()</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>clickOptions()</slot>
+ </connection>
+ <connection>
+ <sender>result_list</sender>
+ <signal>mouseButtonPressed(int,QListViewItem*,const QPoint&amp;,int)</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>buttonPressedOnItem(int,QListViewItem*,const QPoint&amp;,int)</slot>
+ </connection>
+ <connection>
+ <sender>search_term</sender>
+ <signal>returnPressed()</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>startSearch()</slot>
+ </connection>
+ <connection>
+ <sender>result_list</sender>
+ <signal>returnPressed(QListViewItem*)</signal>
+ <receiver>FindDocumentationBase</receiver>
+ <slot>clickOnItem(QListViewItem*)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>search_term</tabstop>
+ <tabstop>button_search</tabstop>
+ <tabstop>result_list</tabstop>
+ <tabstop>butten_options</tabstop>
+</tabstops>
+<slots>
+ <slot>clickOptions()</slot>
+ <slot>setSearchTerm( const QString &amp; term )</slot>
+ <slot>startSearch()</slot>
+ <slot>searchInIndex()</slot>
+ <slot>searchInContents()</slot>
+ <slot>searchInGoogle()</slot>
+ <slot>searchInMan()</slot>
+ <slot>searchInInfo()</slot>
+ <slot>procManReadFromStdout()</slot>
+ <slot>procInfoReadFromStdout()</slot>
+ <slot>clickOnItem( QListViewItem * item )</slot>
+ <slot>buttonPressedOnItem( int button, QListViewItem * item, const QPoint &amp; pos, int c )</slot>
+</slots>
+<layoutdefaults spacing="1" margin="1"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/documentation/indexview.cpp b/parts/documentation/indexview.cpp
new file mode 100644
index 00000000..3c245aee
--- /dev/null
+++ b/parts/documentation/indexview.cpp
@@ -0,0 +1,190 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "indexview.h"
+
+#include <qapplication.h>
+#include <qevent.h>
+#include <qlayout.h>
+#include <qlabel.h>
+
+#include <klineedit.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevdocumentationplugin.h>
+
+#include "docutils.h"
+#include "selecttopic.h"
+#include "documentation_part.h"
+#include "documentation_widget.h"
+
+IndexView::IndexView(DocumentationWidget *parent, const char *name)
+ :QWidget(parent, name), m_widget(parent)
+{
+ QVBoxLayout *l = new QVBoxLayout(this, 0, 0);
+
+ QHBoxLayout *hl = new QHBoxLayout(this, 0, 0);
+ m_edit = new KLineEdit(this);
+ hl->addWidget(new QLabel(m_edit, i18n("&Look for:"), this));
+ hl->addWidget(m_edit);
+ l->addLayout(hl);
+
+ m_index = new IndexBox(this);
+ l->addWidget(m_index);
+
+ connect(m_index, SIGNAL(executed(QListBoxItem* )), this, SLOT(searchInIndex(QListBoxItem* )));
+ connect(m_index, SIGNAL(mouseButtonPressed(int, QListBoxItem*, const QPoint& )),
+ this, SLOT(itemMouseButtonPressed(int, QListBoxItem*, const QPoint& )));
+ connect(m_edit, SIGNAL(returnPressed()), this, SLOT(searchInIndex()));
+ connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(showIndex(const QString&)));
+
+ m_edit->installEventFilter(this);
+}
+
+IndexView::~IndexView()
+{
+}
+
+void IndexView::searchInIndex()
+{
+ if (m_index->currentItem() != -1)
+ searchInIndex(m_index->item(m_index->currentItem()));
+}
+
+void IndexView::searchInIndex(QListBoxItem *item)
+{
+ kdDebug() << "IndexView::searchInIndex" << endl;
+ IndexItem *indexItem = dynamic_cast<IndexItem*>(item);
+ if (!indexItem)
+ return;
+
+ IndexItem::List urls = indexItem->urls();
+ if (urls.count() == 1)
+ m_widget->part()->partController()->showDocument(urls.first().second);
+ else if (urls.count() == 0) ;
+ else
+ {
+ SelectTopic *dia = new SelectTopic(urls);
+ dia->topicLabel->setText(dia->topicLabel->text().arg(item->text()));
+ if (dia->exec())
+ m_widget->part()->partController()->showDocument(dia->selectedURL());
+ delete dia;
+ }
+}
+
+void IndexView::showIndex(const QString &term)
+{
+ QListBoxItem *i = m_index->firstItem();
+ QString sl = term.lower();
+ while (i)
+ {
+ QString t = i->text();
+ if ((t.length() >= sl.length()) && (i->text().left(term.length()).lower() == sl))
+ {
+ m_index->setCurrentItem(i);
+ m_index->setTopItem(m_index->index(i));
+ break;
+ }
+ i = i->next();
+ }
+/*
+ for (uint i = 0; i < m_index->count(); ++ i)
+ {
+ if (m_index->text(i).startsWith(term))
+ {
+ m_index->setCurrentItem(i);
+ m_index->setTopItem(i);
+ }
+ }*/
+}
+
+bool IndexView::eventFilter(QObject *watched, QEvent *e)
+{
+ if (!watched || !e)
+ return true;
+
+ if ((watched == m_edit) && (e->type() == QEvent::KeyPress))
+ {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if (ke->key() == Key_Up)
+ {
+ int i = m_index->currentItem();
+ if (--i >= 0)
+ {
+ m_index->setCurrentItem(i);
+ m_edit->blockSignals(true);
+ m_edit->setText(m_index->currentText());
+ m_edit->blockSignals(false);
+ }
+ return true;
+ } else if (ke->key() == Key_Down)
+ {
+ int i = m_index->currentItem();
+ if ( ++i < int(m_index->count()) )
+ {
+ m_index->setCurrentItem(i);
+ m_edit->blockSignals(true);
+ m_edit->setText(m_index->currentText());
+ m_edit->blockSignals(false);
+ }
+ return true;
+ } else if ((ke->key() == Key_Next) || (ke->key() == Key_Prior))
+ {
+ QApplication::sendEvent(m_index, e);
+ m_edit->blockSignals(true);
+ m_edit->setText(m_index->currentText());
+ m_edit->blockSignals(false);
+ }
+ }
+
+ return QWidget::eventFilter(watched, e);
+}
+
+void IndexView::itemMouseButtonPressed(int button, QListBoxItem *item, const QPoint &pos)
+{
+ if ((button != Qt::RightButton) || (!item))
+ return;
+ IndexItem *docItem = dynamic_cast<IndexItem*>(item);
+ if (!docItem)
+ return;
+
+ DocUtils::docItemPopup(m_widget->part(), docItem, pos, false, true);
+}
+
+void IndexView::setSearchTerm(const QString &term)
+{
+ m_edit->setFocus();
+ m_edit->setText(term);
+}
+
+void IndexView::askSearchTerm( )
+{
+ m_edit->setFocus();
+}
+
+void IndexView::focusInEvent(QFocusEvent */*e*/)
+{
+ m_edit->setFocus();
+}
+
+#include "indexview.moc"
diff --git a/parts/documentation/indexview.h b/parts/documentation/indexview.h
new file mode 100644
index 00000000..50ffa704
--- /dev/null
+++ b/parts/documentation/indexview.h
@@ -0,0 +1,64 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef INDEXVIEW_H
+#define INDEXVIEW_H
+
+#include <qwidget.h>
+
+class IndexBox;
+class KLineEdit;
+class QListBoxItem;
+class DocumentationWidget;
+class FindDocumentation;
+
+class IndexView : public QWidget
+{
+ Q_OBJECT
+public:
+ IndexView(DocumentationWidget *parent = 0, const char *name = 0);
+ ~IndexView();
+
+ virtual bool eventFilter(QObject *watched, QEvent *e);
+ IndexBox *indexBox() const { return m_index; }
+
+public slots:
+ void searchInIndex();
+ void setSearchTerm(const QString &term);
+ void askSearchTerm();
+
+protected slots:
+ void searchInIndex(QListBoxItem *item);
+ void showIndex(const QString &term);
+
+ void itemMouseButtonPressed(int button, QListBoxItem *item, const QPoint &pos);
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+private:
+ DocumentationWidget *m_widget;
+
+ IndexBox *m_index;
+ KLineEdit *m_edit;
+
+friend class FindDocumentation;
+};
+
+#endif
diff --git a/parts/documentation/interfaces/Mainpage.dox b/parts/documentation/interfaces/Mainpage.dox
new file mode 100644
index 00000000..85126a6e
--- /dev/null
+++ b/parts/documentation/interfaces/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Documentation Part Interfaces Library
+
+This library contains interfaces to implement KDevelop documentation plugins.
+
+<b>Link with</b>: -ldocumentation_interfaces
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/parts/documentation
+*/
+
diff --git a/parts/documentation/interfaces/Makefile.am b/parts/documentation/interfaces/Makefile.am
new file mode 100644
index 00000000..206f62f9
--- /dev/null
+++ b/parts/documentation/interfaces/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+partincludedirdir = $(includedir)/kdevelop/parts/documentation
+lib_LTLIBRARIES = libdocumentation_interfaces.la
+libdocumentation_interfaces_la_LDFLAGS = $(all_libraries)
+libdocumentation_interfaces_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO)
+libdocumentation_interfaces_la_SOURCES = kdevdocumentationplugin.cpp
+partincludedir_HEADERS = kdevdocumentationplugin.h
+servicetypedir = $(kde_servicetypesdir)
+servicetype_DATA = kdevelopdocumentationplugins.desktop
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Documentation Part Interfaces Library
+DOXYGEN_DOCDIRPREFIX = kdevdoc
+include ../../../Doxyfile.am
diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.cpp b/parts/documentation/interfaces/kdevdocumentationplugin.cpp
new file mode 100644
index 00000000..8e336c83
--- /dev/null
+++ b/parts/documentation/interfaces/kdevdocumentationplugin.cpp
@@ -0,0 +1,721 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 by Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#include "kdevdocumentationplugin.h"
+
+#include <qfile.h>
+#include <qpainter.h>
+#include <qstyle.h>
+#include <qheader.h>
+#include <qtextstream.h>
+
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kdirwatch.h>
+#include <klocale.h>
+
+//class DocumentationItem
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *parent,
+ const QString &name)
+ :KListViewItem(parent, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem *parent,
+ const QString &name)
+ :KListViewItem(parent, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *parent,
+ KListViewItem *after, const QString &name)
+ :KListViewItem(parent, after, name), m_type(type)
+{
+ init();
+}
+
+DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem * parent,
+ KListViewItem * after, const QString & name )
+ :KListViewItem(parent, after, name), m_type(type)
+{
+ init();
+}
+
+
+void DocumentationItem::init( )
+{
+ QString icon;
+
+ switch (m_type)
+ {
+ case Collection:
+ case Catalog:
+ icon = "folder";
+ break;
+ case Book:
+ icon = "contents";
+ break;
+ default:
+ icon = "document";
+ }
+
+ setPixmap(0, SmallIcon(icon));
+}
+
+
+
+
+
+//class DocumentationCatalogItem
+
+
+DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
+ KListView *parent, const QString &name)
+ :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
+ isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
+{
+ setExpandable(true);
+ m_plugin->addCatalog(this);
+}
+
+DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin,
+ DocumentationItem *parent, const QString &name)
+ :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin),
+ isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false)
+{
+ setExpandable(true);
+ m_plugin->addCatalog(this);
+}
+
+DocumentationCatalogItem::~ DocumentationCatalogItem( )
+{
+ m_plugin->clearCatalog(this);
+}
+
+void DocumentationCatalogItem::setOpen(bool o)
+{
+ if (o)
+ {
+ load();
+ }
+ DocumentationItem::setOpen(o);
+}
+
+void DocumentationCatalogItem::load()
+{
+if(isLoaded)
+return;
+
+ plugin()->createTOC(this);
+ isLoaded = true;
+}
+
+void DocumentationCatalogItem::activate()
+{
+ if (!isActivated)
+ {
+ plugin()->setCatalogURL(this);
+ isActivated = true;
+ }
+ DocumentationItem::activate();
+}
+
+
+
+
+//class IndexItemProto
+
+IndexItemProto::IndexItemProto(DocumentationPlugin *plugin, DocumentationCatalogItem *catalog,
+ IndexBox *listbox, const QString &text, const QString &description)
+ : m_listbox(listbox), m_text(text), m_description(description)
+{
+ plugin->indexes[catalog].append(this);
+ m_listbox->addIndexItem(this);
+}
+
+IndexItemProto::~IndexItemProto()
+{
+ m_listbox->removeIndexItem(this);
+}
+
+
+//class IndexItem
+
+IndexItem::IndexItem(IndexBox *listbox, const QString &text)
+ :QListBoxText(listbox, text), m_listbox(listbox)
+{
+}
+
+IndexItem::List IndexItem::urls() const
+{
+ List urlList;
+ QValueList<IndexItemProto*> itemProtos = m_listbox->items[text()];
+ for (QValueList<IndexItemProto*>::const_iterator it = itemProtos.begin();
+ it != itemProtos.end(); ++it)
+ urlList.append(qMakePair((*it)->description(), (*it)->url()));
+ return urlList;
+}
+
+
+
+
+//class ConfigurationItem
+
+ConfigurationItem::ConfigurationItem(QListView *parent, DocumentationPlugin * plugin, const QString &title, const QString &url,
+ bool indexPossible, bool fullTextSearchPossible)
+ :QCheckListItem(parent, "", QCheckListItem::CheckBox), m_title(title), m_url(url),
+ m_origTitle(title), m_contents(true), m_index(false), m_fullTextSearch(false),
+ m_indexPossible(indexPossible), m_fullTextSearchPossible(fullTextSearchPossible),
+ m_docPlugin( plugin )
+{
+ setText(3, m_title);
+ setText(4, m_url);
+}
+
+void ConfigurationItem::paintCell(QPainter *p, const QColorGroup &cg, int column,
+ int width, int align)
+{
+ if ( (column == 0) || (column == 1) || (column == 2) )
+ {
+ if ( !p )
+ return;
+
+ QListView *lv = listView();
+ if ( !lv )
+ return;
+
+ const BackgroundMode bgmode = lv->viewport()->backgroundMode();
+ const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode );
+ p->fillRect(0, 0, width, height(), cg.brush(crole));
+
+ QFontMetrics fm(lv->fontMetrics());
+ int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv);
+ int marg = lv->itemMargin();
+ int styleflags = QStyle::Style_Default;
+
+ if (((column == 0) && m_contents) || ((column == 1) && m_index) || ((column == 2) && m_fullTextSearch))
+ styleflags |= QStyle::Style_On;
+ else
+ styleflags |= QStyle::Style_Off;
+ if ((column == 0) || ((column == 1) && m_indexPossible) || ((column == 2) && m_fullTextSearchPossible))
+ styleflags |= QStyle::Style_Enabled;
+
+ int x = 0;
+ int y = 0;
+ x += 3;
+ if (align & AlignVCenter)
+ y = ((height() - boxsize) / 2) + marg;
+ else
+ y = (fm.height() + 2 + marg - boxsize) / 2;
+
+ QStyleOption opt(this);
+ lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p,
+ QRect(x, y, boxsize, fm.height() + 2 + marg), cg, styleflags, opt);
+
+ return;
+ }
+ QListViewItem::paintCell(p, cg, column, width, align);
+}
+
+int ConfigurationItem::width(const QFontMetrics &fm, const QListView *lv, int c) const
+{
+ if ((c == 0) || (c == 1) || (c == 2))
+ return lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv) + 4;
+ return QListViewItem::width(fm, lv, c);
+}
+
+
+
+
+
+
+
+
+//class DocumentationPlugin
+
+DocumentationPlugin::DocumentationPlugin(KConfig *pluginConfig, QObject *parent, const char *name)
+ :QObject(parent, name), config(pluginConfig), m_indexCreated(false)
+{
+}
+
+DocumentationPlugin::~DocumentationPlugin()
+{
+}
+
+void DocumentationPlugin::autoSetup()
+{
+ config->setGroup("General");
+ if ( ! config->readBoolEntry("Autosetup", false) )
+ {
+ autoSetupPlugin();
+ config->setGroup("General");
+ config->writeEntry("Autosetup", true);
+ config->sync();
+ }
+}
+
+void DocumentationPlugin::reload()
+{
+ clear();
+ for (QValueList<DocumentationCatalogItem *>::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ createTOC(*it);
+ }
+}
+
+void DocumentationPlugin::clear()
+{
+ for (QValueList<DocumentationCatalogItem *>::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ clearCatalog(*it);
+ }
+}
+
+void DocumentationPlugin::clearCatalog(DocumentationCatalogItem *item)
+{
+ //clear named catalog map
+ for (QMap<QString, DocumentationCatalogItem*>::iterator it = namedCatalogs.begin();
+ it != namedCatalogs.end(); ++it)
+ {
+ if (it.data() == item)
+ {
+ namedCatalogs.remove(it);
+ break;
+ }
+ }
+ //clear indexes for catalog
+ QValueList<IndexItemProto *> idx = indexes[item];
+ for (QValueList<IndexItemProto *>::iterator it = idx.begin(); it != idx.end(); ++it)
+ {
+ delete *it;
+ }
+ indexes.remove(item);
+
+ //remove catalog
+ catalogs.remove(item);
+}
+
+void DocumentationPlugin::createIndex(IndexBox *index)
+{
+ if (m_indexCreated)
+ return;
+
+ for (QValueList<DocumentationCatalogItem *>::iterator it = catalogs.begin();
+ it != catalogs.end(); ++it)
+ {
+ loadIndex(index, *it);
+ }
+ m_indexCreated = true;
+}
+
+void DocumentationPlugin::cacheIndex(DocumentationCatalogItem *item)
+{
+ kdDebug() << "Creating index cache for " << item->text(0) << endl;
+
+ QString cacheName = locateLocal("data", QString("kdevdocumentation/index/cache_") + item->text(0));
+ QFile cacheFile(cacheName);
+ if (!cacheFile.open(IO_WriteOnly))
+ return;
+
+ QTextStream str(&cacheFile);
+ str.setEncoding(QTextStream::Unicode);
+ str << CACHE_VERSION << endl;
+
+ QValueList<IndexItemProto*> catalogIndexes = indexes[item];
+ for (QValueList<IndexItemProto*>::const_iterator it = catalogIndexes.constBegin();
+ it != catalogIndexes.constEnd(); ++it)
+ {
+ str << (*it)->text() << endl;
+ str << (*it)->description() << endl;
+ str << (*it)->url().url() << endl;
+ }
+
+ cacheFile.close();
+}
+
+bool DocumentationPlugin::loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item)
+{
+ QString cacheName = locateLocal("data", QString("kdevdocumentation/index/cache_") + item->cacheVersion() + item->text(0));
+ QFile cacheFile(cacheName);
+ if (!cacheFile.open(IO_ReadOnly))
+ return false;
+
+ kdDebug() << "Using cached index for item: " << item->text(0) << endl;
+
+ QTextStream str(&cacheFile);
+ str.setEncoding(QTextStream::Unicode);
+ QString cache = str.read();
+ QStringList cacheList = QStringList::split("\n", cache, true);
+ QString ver = cacheList.first();
+ if (ver != CACHE_VERSION)
+ {
+ kdDebug() << "Wrong cache version: " << ver << endl;
+ return false;
+ }
+ QStringList::const_iterator it = cacheList.begin();
+ it++;
+ QString s[3]; int c = 0;
+ for (; it != cacheList.end(); ++it)
+ {
+ s[c] = *it;
+ if (c == 2)
+ {
+ IndexItemProto *ii = new IndexItemProto(this, item, index, s[0], s[1]);
+ ii->addURL(KURL(s[2]));
+ c = 0;
+ }
+ else c++;
+ }
+ cacheFile.close();
+
+ return true;
+}
+
+void DocumentationPlugin::addCatalog(DocumentationCatalogItem *item)
+{
+ catalogs.append(item);
+ namedCatalogs[item->text(0)] = item;
+// indexes[item] = QValueList<IndexItem*>();
+}
+
+void DocumentationPlugin::addCatalogConfiguration(KListView *configurationView,
+ const QString &title, const QString &url)
+{
+ new ConfigurationItem(configurationView, this, title, url,
+ hasCapability(Index), hasCapability(FullTextSearch));
+}
+
+void DocumentationPlugin::editCatalogConfiguration(ConfigurationItem *configurationItem,
+ const QString &title, const QString &url)
+{
+ configurationItem->setTitle(title);
+ configurationItem->setURL(url);
+}
+
+void DocumentationPlugin::deleteCatalogConfiguration(const ConfigurationItem *const configurationItem)
+{
+ deletedConfigurationItems << configurationItem->title();
+}
+
+void DocumentationPlugin::clearCatalogIndex(DocumentationCatalogItem *item)
+{
+ //clear indexes for catalog
+ QValueList<IndexItemProto *> idx = indexes[item];
+ for (QValueList<IndexItemProto *>::iterator it = idx.begin(); it != idx.end(); ++it)
+ {
+ delete *it;
+ }
+ indexes.remove(item);
+}
+
+void DocumentationPlugin::loadIndex(IndexBox *index, DocumentationCatalogItem *item)
+{
+ if (!indexEnabled(item))
+ return;
+ if (!needRefreshIndex(item) && loadCachedIndex(index, item))
+ return;
+ createIndex(index, item);
+ cacheIndex(item);
+}
+
+void DocumentationPlugin::init(KListView *contents)
+{
+ config->setGroup("Locations");
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ if (catalogEnabled(it.key()))
+ createCatalog(contents, it.key(), config->readPathEntry(it.key()));
+ }
+}
+
+void DocumentationPlugin::reinit(KListView *contents, IndexBox *index, QStringList restrictions)
+{
+ config->setGroup("Locations");
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ //remove deleted in configuration catalogs
+ for (QStringList::const_iterator it = deletedConfigurationItems.constBegin();
+ it != deletedConfigurationItems.constEnd(); ++it)
+ {
+ if (namedCatalogs.contains(*it))
+ delete namedCatalogs[*it];
+ }
+ deletedConfigurationItems.clear();
+
+ //update configuration
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ config->setGroup("Locations");
+ if (restrictions.contains(it.key()) || (!catalogEnabled(it.key())))
+ {
+ if (namedCatalogs.contains(it.key()))
+ delete namedCatalogs[it.key()];
+ }
+ else
+ {
+ kdDebug() << "updating 1" << endl;
+ if (!namedCatalogs.contains(it.key())) //create catalog if it does not exist
+ {
+ DocumentationCatalogItem * item = createCatalog(contents, it.key(), config->readPathEntry(it.key()));
+ loadIndex(index, item);
+ index->setDirty(true);
+// index->refill(indexes[item]);
+ }
+ else if (!indexEnabled(namedCatalogs[it.key()])) //clear index if it is disabled in configuration
+ {
+ kdDebug() << " updating: clearCatalogIndex" << endl;
+ clearCatalogIndex(namedCatalogs[it.key()]);
+ }
+ else if ( (indexEnabled(namedCatalogs[it.key()])) //index is requested in configuration but does not yet exist
+ && (!indexes.contains(namedCatalogs[it.key()])) )
+ {
+ kdDebug() << " index requested " << endl;
+ loadIndex(index, namedCatalogs[it.key()]);
+ index->setDirty(true);
+ }
+ m_indexCreated = true;
+ }
+ }
+}
+
+void DocumentationPlugin::loadCatalogConfiguration(KListView *configurationView)
+{
+ config->setGroup("Locations");
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ if (namedCatalogs.contains(it.key())
+ && namedCatalogs[it.key()]->isProjectDocumentationItem())
+ continue;
+
+ config->setGroup("Locations");
+ ConfigurationItem *item = new ConfigurationItem(configurationView, this, it.key(),
+ config->readPathEntry(it.key()),
+ hasCapability(Index), hasCapability(FullTextSearch));
+ config->setGroup("TOC Settings");
+ item->setContents(config->readBoolEntry(item->title(), true));
+ config->setGroup("Index Settings");
+ item->setIndex(config->readBoolEntry(item->title(), false));
+ config->setGroup("Search Settings");
+ item->setFullTextSearch(config->readBoolEntry(item->title(), false));
+ }
+}
+
+void DocumentationPlugin::saveCatalogConfiguration(KListView *configurationView)
+{
+ config->setGroup("Locations");
+
+ for (QStringList::const_iterator it = deletedConfigurationItems.constBegin();
+ it != deletedConfigurationItems.constEnd(); ++it)
+ {
+ config->deleteEntry(*it);
+ }
+
+ QListViewItemIterator it(configurationView);
+ while (it.current())
+ {
+ ConfigurationItem *confItem = dynamic_cast<ConfigurationItem*>(it.current());
+ if ( confItem->docPlugin() != this )
+ {
+ ++it;
+ continue;
+ }
+
+ config->setGroup("Locations");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writePathEntry(confItem->title(), confItem->url());
+
+ config->setGroup("TOC Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->contents());
+
+ config->setGroup("Index Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->index());
+
+ config->setGroup("Search Settings");
+ if (confItem->isChanged())
+ config->deleteEntry(confItem->origTitle());
+ config->writeEntry(confItem->title(), confItem->fullTextSearch());
+
+ ++it;
+ }
+ config->sync();
+}
+
+void DocumentationPlugin::setIndexEnabled( DocumentationCatalogItem * item, bool e )
+{
+ QString group = config->group();
+ config->setGroup("Index Settings");
+ config->writeEntry(item->text(0), e);
+ config->setGroup(group);
+}
+
+bool DocumentationPlugin::indexEnabled( DocumentationCatalogItem * item ) const
+{
+ QString group = config->group();
+ config->setGroup("Index Settings");
+ bool b = config->readBoolEntry(item->text(0), false);
+ config->setGroup(group);
+ return b;
+}
+
+bool DocumentationPlugin::catalogEnabled(const QString &name) const
+{
+ QString group = config->group();
+ config->setGroup("TOC Settings");
+ bool b = config->readBoolEntry(name, true);
+ config->setGroup(group);
+ return b;
+}
+
+void DocumentationPlugin::setCatalogEnabled(const QString &name, bool e)
+{
+ QString group = config->group();
+ config->setGroup("TOC Settings");
+ config->writeEntry(name, e);
+ config->setGroup(group);
+}
+
+
+
+
+//class IndexBox
+
+IndexBox::IndexBox(QWidget *parent, const char *name)
+ :KListBox(parent, name), m_dirty(false)
+{
+}
+
+void IndexBox::addIndexItem(IndexItemProto *item)
+{
+ items[item->text()].append(item);
+}
+
+void IndexBox::removeIndexItem(IndexItemProto *item)
+{
+ QString text = item->text();
+ items[text].remove(item);
+ if (items[text].count() == 0)
+ {
+ items.remove(text);
+ QListBoxItem *item = findItem(text, Qt::CaseSensitive | Qt::ExactMatch);
+ if (item)
+ delete item;
+ }
+}
+
+void IndexBox::fill()
+{
+ for (QMap<QString, QValueList<IndexItemProto*> >::const_iterator it = items.begin();
+ it != items.end(); ++it)
+ {
+ new IndexItem(this, it.key());
+ }
+}
+
+void IndexBox::setDirty(bool dirty)
+{
+ m_dirty = dirty;
+}
+
+void IndexBox::refill()
+{
+ if (m_dirty)
+ {
+ clear();
+ fill();
+ setDirty(false);
+ }
+}
+
+
+ProjectDocumentationPlugin::ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type)
+ :QObject(0, 0), m_docPlugin(docPlugin), m_catalog(0), m_type(type), m_contents(0), m_index(0)
+{
+ kdDebug() << "ProjectDocumentationPlugin::ProjectDocumentationPlugin for type " << type << endl;
+
+ m_watch = new KDirWatch(this);
+ connect(m_watch, SIGNAL(dirty(const QString&)), this, SLOT(reinit()));
+ m_watch->startScan();
+}
+
+ProjectDocumentationPlugin::~ProjectDocumentationPlugin()
+{
+ deinit();
+}
+
+void ProjectDocumentationPlugin::init(KListView *contents, IndexBox *index, const QString &url)
+{
+ m_contents = contents;
+ m_index = index;
+ m_url = url;
+
+ if (m_catalog)
+ deinit();
+ m_catalog = m_docPlugin->createCatalog(contents,
+ m_type == DocumentationPlugin::APIDocs ? i18n("Project API Documentation")
+ : i18n("Project User Manual"), url);
+ if (m_catalog)
+ {
+ m_catalog->setProjectDocumentationItem(true);
+ m_watch->addFile(url);
+ }
+}
+
+void ProjectDocumentationPlugin::reinit()
+{
+ deinit();
+ if (m_contents != 0 && m_index != 0 && m_url != 0)
+ init(m_contents, m_index, m_url);
+}
+
+void ProjectDocumentationPlugin::deinit()
+{
+ m_watch->removeFile(m_url);
+ delete m_catalog;
+ m_catalog = 0;
+}
+
+QString ProjectDocumentationPlugin::pluginName() const
+{
+ return m_docPlugin->pluginName();
+}
+
+QString ProjectDocumentationPlugin::catalogURL() const
+{
+ return m_url;
+}
+
+#include "kdevdocumentationplugin.moc"
diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.h b/parts/documentation/interfaces/kdevdocumentationplugin.h
new file mode 100644
index 00000000..5d100ab5
--- /dev/null
+++ b/parts/documentation/interfaces/kdevdocumentationplugin.h
@@ -0,0 +1,421 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 by Alexander Dymo <cloudtemple@mksat.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef KDEV_DOC_PLUGIN_H
+#define KDEV_DOC_PLUGIN_H
+
+#include <qmap.h>
+#include <qvaluelist.h>
+#include <qpair.h>
+
+#include <klistbox.h>
+#include <klistview.h>
+#include <kurl.h>
+#include <kfile.h>
+
+#define CACHE_VERSION "3"
+
+/**Documentation list item.
+Stores the type of a documentation it represents and an URL.*/
+class DocumentationItem: public KListViewItem
+{
+public:
+ /**Type of documentation which is represented by this item.*/
+ enum Type {
+ Collection /**<Collection - a collection of catalogs, folder with catalogs.*/,
+ Catalog /**<Catalog - a term which defines a document or a group of documents.*/,
+ Book /**<Book - a document with nested documents.*/,
+ Document /**<Document.*/
+ };
+
+ DocumentationItem(Type type, KListView *parent, const QString &name);
+ DocumentationItem(Type type, KListView *parent, KListViewItem *after, const QString &name);
+ DocumentationItem(Type type, KListViewItem *parent, const QString &name);
+ DocumentationItem(Type type, KListViewItem *parent, KListViewItem *after, const QString &name);
+
+ virtual void setURL(const KURL &url) { m_url = url; }
+ virtual KURL url() const { return m_url; }
+
+ Type type() const { return m_type; }
+
+ void setType(Type t) {
+ if(t != m_type) {
+ m_type = t;
+ init();
+ }
+ }
+private:
+ void init();
+
+ KURL m_url;
+ Type m_type;
+};
+
+class DocumentationPlugin;
+
+/**Documentation catalog list item.*/
+class DocumentationCatalogItem: public DocumentationItem
+{
+public:
+ DocumentationCatalogItem(DocumentationPlugin* plugin, KListView *parent, const QString &name);
+ DocumentationCatalogItem(DocumentationPlugin* plugin, DocumentationItem *parent, const QString &name);
+ virtual ~DocumentationCatalogItem();
+
+ DocumentationPlugin* plugin() const { return m_plugin; }
+
+ virtual void setOpen(bool o);
+ void load();
+
+ virtual bool isProjectDocumentationItem() const { return m_isProjectDocumentationItem; }
+ virtual void setProjectDocumentationItem(bool b) { m_isProjectDocumentationItem = b; }
+
+ virtual QString cacheVersion() const { return ""; } /// should return a short string that identifies the version of the catalog
+
+protected:
+ virtual void activate();
+
+private:
+ DocumentationPlugin* m_plugin;
+ bool isLoaded;
+ bool isActivated;
+ bool m_isProjectDocumentationItem;
+};
+
+class IndexBox;
+
+/**Prototype of index item.
+Prototypes represent an index are used to build index items after index generation.*/
+class IndexItemProto
+{
+public:
+ IndexItemProto(DocumentationPlugin *plugin, DocumentationCatalogItem *catalog, IndexBox *listbox,
+ const QString &text, const QString &description);
+ ~IndexItemProto();
+
+ void addURL(const KURL &url) { m_url = url; }
+ KURL url() const { return m_url; }
+ QString text() const { return m_text; }
+ QString description() const { return m_description; }
+
+private:
+ KURL m_url;
+ IndexBox *m_listbox;
+ QString m_text;
+ QString m_description;
+};
+
+/**Documentation index item.*/
+class IndexItem: public QListBoxText {
+public:
+ typedef QPair<QString, KURL> URL;
+ typedef QValueList<URL> List;
+
+ IndexItem(IndexBox *listbox, const QString &text);
+
+ List urls() const;
+
+private:
+ IndexBox *m_listbox;
+};
+
+/**Documentation index view.*/
+class IndexBox: public KListBox{
+public:
+ IndexBox(QWidget *parent = 0, const char *name = 0);
+
+ virtual void addIndexItem(IndexItemProto *item);
+ virtual void removeIndexItem(IndexItemProto *item);
+ virtual void fill();
+ virtual void refill();
+ virtual void setDirty(bool dirty);
+// virtual void refill(QValueList<IndexItemProto*> &items);
+
+private:
+ QMap<QString, QValueList<IndexItemProto*> > items;
+ friend class IndexItem;
+
+ bool m_dirty;
+};
+
+class QPainter;
+class QColorGroup;
+class QFontMetrics;
+class DocumentationPlugin;
+
+/**Documentation configuration item.*/
+class ConfigurationItem: public QCheckListItem
+{
+public:
+ ConfigurationItem(QListView *parent, DocumentationPlugin * plugin, const QString &title, const QString &url,
+ bool indexPossible, bool fullTextSearchPossible);
+
+ virtual QString title() const { return m_title; }
+ virtual void setTitle(const QString title) { setText(3, m_title = title); }
+ virtual QString url() const { return m_url; }
+ virtual void setURL(const QString url) { setText(4, m_url = url); }
+
+ virtual bool isChanged() const { return m_title == m_origTitle; }
+ virtual QString origTitle() const {return m_origTitle; }
+
+ virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int align);
+ virtual int width(const QFontMetrics &fm, const QListView *lv, int c) const;
+
+ bool contents() const { return m_contents; }
+ void setContents(bool contents) { m_contents = contents; }
+ bool index() const { return m_index; }
+ void setIndex(bool index) { m_index = index; }
+ bool fullTextSearch() const { return m_fullTextSearch; }
+ void setFullTextSearch(bool fullTextSearch) { m_fullTextSearch = fullTextSearch; }
+
+ bool indexPossible() const { return m_indexPossible; }
+ bool fullTextSearchPossible() const { return m_fullTextSearchPossible; }
+
+ DocumentationPlugin * docPlugin() { return m_docPlugin; }
+
+private:
+ QString m_title;
+ QString m_url;
+ QString m_origTitle;
+
+ bool m_contents;
+ bool m_index;
+ bool m_fullTextSearch;
+
+ bool m_indexPossible;
+ bool m_fullTextSearchPossible;
+
+ DocumentationPlugin * m_docPlugin;
+};
+
+
+class ProjectDocumentationPlugin;
+
+/**
+@short Documentation Plugin Interface
+
+All KDevelop documentation plugins must implement this interface.
+Documentation plugin handles certain documentation type. It provides
+methods to load documentation catalogs and indexes for a documentation
+of that type. It also has methods to configure catalogs and provides
+a list of URL's for the full text search tool.
+*/
+class DocumentationPlugin: public QObject
+{
+ Q_OBJECT
+public:
+ /**Capability of documentation plugin.*/
+ enum Capability { Index=1 /**<index can be built for catalogs*/,
+ FullTextSearch=2 /**<full text search is possible in catalog locations*/,
+ CustomDocumentationTitles=4 /**<user can specify titles for documentation catalogs*/,
+ ProjectDocumentation=8 /**<plugin can handle project API documentation*/,
+ ProjectUserManual=16 /**<plugin can handle project user manual*/ };
+ /**Possible project documentation types.*/
+ enum ProjectDocType { APIDocs, UserManual };
+
+ /**Constructor. Should initialize capabilities of the plugin by using setCapabilities
+ protected method. For example,
+ @code
+ setCapabilities(Index | FullTextSearch);
+ @endcode
+ */
+ DocumentationPlugin(KConfig *pluginConfig, QObject *parent =0, const char *name =0);
+ virtual ~DocumentationPlugin();
+
+ /**Returns the i18n name of the plugin.*/
+ virtual QString pluginName() const = 0;
+
+ /**Creates documentation catalog with given title and url.*/
+ virtual DocumentationCatalogItem *createCatalog(KListView *contents, const QString &title, const QString &url) = 0;
+
+ /**Initialize a list of catalogs.
+ @param contents the listview to fill with catalogs
+ */
+ virtual void init(KListView *contents);
+ /**Reloads a list of catalogs. This method should add missing catalogs to the view,
+ update index for added catalogs and also delete restricted catalogs.
+ @param contents the listview to fill with catalogs
+ @param index the listbox with index to update
+ @param restrictions the list of catalogs names to remove
+ */
+ virtual void reinit(KListView *contents, IndexBox *index, QStringList restrictions);
+ /**Initializes plugin configuration. Documentation plugins should be able to
+ initialize the default configuration on startup without any user interaction.
+ Call this in the constructor of your plugin.*/
+ virtual void autoSetup();
+ /**Plugin specific automatic setup code. This method is called by @ref autoSetup.*/
+ virtual void autoSetupPlugin() = 0;
+
+ /**Indicates if a catalog with specified name is enabled. Documentation plugin
+ should check this and do not load catalogs disabled in configuration.
+ All catalogs are enabled by default.*/
+ virtual bool catalogEnabled(const QString &name) const;
+ /**Enables or disables documentation catalog.*/
+ virtual void setCatalogEnabled(const QString &name, bool e);
+
+ /**Indicates if an index of given catalog should be rebuilt. This method
+ is used by index caching algorythm to make a descision to rebuild index
+ or to load it from cache.*/
+ virtual bool needRefreshIndex(DocumentationCatalogItem *item) = 0;
+ /**Indicates if an index is enabled for given catalog. If documentation plugin
+ has Index capability, indices for it's catalogs can be enabled/disabled
+ in configuration dialog.*/
+ virtual bool indexEnabled(DocumentationCatalogItem *item) const;
+ /**Enables or disables index for documentation catalog.*/
+ virtual void setIndexEnabled(DocumentationCatalogItem *item, bool e);
+ /**Builds index for given catalog. This method should fill index with
+ IndexItem objects.
+ @param index the listbox which contains index items
+ @param item the catalog item that holds an index being built
+ */
+ virtual void createIndex(IndexBox *index, DocumentationCatalogItem *item) = 0;
+
+ /**Creates a table of contents for given catalog. Documentation part uses
+ lazy loading of toc's to reduce startup time. This means that createTOC
+ will be called on expand event of catalog item.*/
+ virtual void createTOC(DocumentationCatalogItem *item) = 0;
+ /**Sets the URL to the catalog. This method will be called each time user
+ clicks the documentation item. If it is too much overhead to determine the
+ documentation catalog url in @ref createCatalog method then you can set it here.*/
+ virtual void setCatalogURL(DocumentationCatalogItem *item) = 0;
+ virtual QStringList fullTextSearchLocations() = 0;
+
+ /**Loads catalog configuration and fills configurationView with ConfigurationItem objects.*/
+ virtual void loadCatalogConfiguration(KListView *configurationView);
+ /**Saves catalog configuration basing on configurationView and
+ deletedConfigurationItems contents. If you use KConfig to store configuration,
+ it is important that you call KConfig::sync() method after saving.*/
+ virtual void saveCatalogConfiguration(KListView *configurationView);
+ /**Adds new catalog to a configuration.*/
+ virtual void addCatalogConfiguration(KListView *configurationView,
+ const QString &title, const QString &url);
+ /**Edits catalog configuration.*/
+ virtual void editCatalogConfiguration(ConfigurationItem *configurationItem,
+ const QString &title, const QString &url);
+ /**Removes catalog from configuration. configurationItem should not be removed here.*/
+ virtual void deleteCatalogConfiguration(const ConfigurationItem *const configurationItem);
+
+ /**Returns a mode and a filter for catalog locator dialogs.*/
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps() = 0;
+ /**Returns a title of catalog defined by an url parameter.*/
+ virtual QString catalogTitle(const QString &url) = 0;
+
+ /**Reloads documentation catalogs and indices.*/
+ virtual void reload();
+ /**Clears documentation catalogs and indices.*/
+ virtual void clear();
+
+ /**Checks if documentation plugin has given capability.*/
+ bool hasCapability(Capability cap) const { return m_capabilities & cap; }
+
+ /**Sets dirty flag for all indices. Index caching algorythm will update
+ the cache next time @ref createIndex is called.*/
+ void setDirtyIndex(bool dirty) { m_indexCreated = dirty; }
+
+ /**Caches index for documentation catalog. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref loadCachedIndex
+ and @ref createIndex).*/
+ virtual void cacheIndex(DocumentationCatalogItem *item);
+ /**Loads index from the cache. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref cacheIndex
+ and @ref createIndex).*/
+ virtual bool loadCachedIndex(IndexBox *index, DocumentationCatalogItem *item);
+
+ /**Returns associated project documentation plugin. Default implementation returns zero.
+ Reimplement this if the documentation plugin can also handle project documentation.*/
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType /* type */) { return 0; }
+
+public slots:
+ /**Creates index and fills index listbox. Reimplement this only if custom
+ caching algorythm is used (do not forget to reimplement also @ref cacheIndex
+ and @ref loadCachedIndex).*/
+ virtual void createIndex(IndexBox *index);
+
+protected:
+ /**A list of loaded documentation catalogs.*/
+ QValueList<DocumentationCatalogItem*> catalogs;
+ /**A map of names of loaded documentation catalogs.*/
+ QMap<QString, DocumentationCatalogItem*> namedCatalogs;
+ /**A map of indices of loaded documentation catalogs.*/
+ QMap<DocumentationCatalogItem*, QValueList<IndexItemProto*> > indexes;
+
+ /**Sets capabilities of documentation plugin.*/
+ void setCapabilities(int caps) { m_capabilities = caps; }
+ /**Clears index of given catalog.*/
+ virtual void clearCatalogIndex(DocumentationCatalogItem *item);
+ /**Loads index from cache or creates and caches it if does not exist.*/
+ void loadIndex(IndexBox *index, DocumentationCatalogItem *item);
+
+ /**Stores items deleted from configuration. @ref saveCatalogConfiguration
+ uses this to remove entries from configuration file.*/
+ QStringList deletedConfigurationItems;
+
+ /**Configuration object used by a plugin.*/
+ KConfig *config;
+
+private:
+ /**Adds catalog item to catalogs, namedCatalogs and indexes lists and maps.*/
+ virtual void addCatalog(DocumentationCatalogItem *item);
+ /**Removes catalog item from catalogs, namedCatalogs and indexes lists and maps.*/
+ virtual void clearCatalog(DocumentationCatalogItem *item);
+
+ int m_capabilities;
+ bool m_indexCreated;
+
+
+friend class IndexItemProto;
+friend class DocumentationCatalogItem;
+};
+
+
+/**
+@short Project documentation plugin
+
+Represents functionality to display project documentation catalog and index in documentation browser.
+*/
+class ProjectDocumentationPlugin: public QObject {
+ Q_OBJECT
+public:
+ ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type);
+ virtual ~ProjectDocumentationPlugin();
+
+ /**Initializes project documentation plugin - creates documentation catalog.*/
+ virtual void init(KListView *contents, IndexBox *index, const QString &url);
+ /**Deinitializes project documentation plugin - removes documentation catalog.*/
+ virtual void deinit();
+
+ QString pluginName() const;
+ QString catalogURL() const;
+
+public slots:
+ /**Performs reinitialization if project documentation has changed (after building api documentation).*/
+ virtual void reinit();
+
+protected:
+ DocumentationPlugin *m_docPlugin;
+ DocumentationCatalogItem *m_catalog;
+
+private:
+ DocumentationPlugin::ProjectDocType m_type;
+
+ class KDirWatch *m_watch;
+ class KListView *m_contents;
+ class IndexBox *m_index;
+ QString m_url;
+};
+
+#endif
diff --git a/parts/documentation/interfaces/kdevelopdocumentationplugins.desktop b/parts/documentation/interfaces/kdevelopdocumentationplugins.desktop
new file mode 100644
index 00000000..08fed218
--- /dev/null
+++ b/parts/documentation/interfaces/kdevelopdocumentationplugins.desktop
@@ -0,0 +1,36 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=KDevelop/DocumentationPlugins
+X-KDE-Derived=KDevelop/Plugin
+Name=KDevelop Documentation Plugin Interface
+Name[ca]=Interfície de connectors de documentació de KDevelop
+Name[da]=KDevelop grænseflade for dokumentations-plugin
+Name[de]=Schnittstelle für Dokumentationsmodul (KDevelop)
+Name[el]=Διασύνδεση πρόσθετου τεκμηρίωσης KDevelop
+Name[es]=Interfaz de complemento de documentación de KDevelop
+Name[et]=KDevelopi dokumentatsiooniplugina liides
+Name[eu]=KDevelop-en dokumentazio plugin interfazea
+Name[fa]=واسط وصلۀ مستندات KDevelop
+Name[fr]=Interface du module externe de documentation de KDevelop
+Name[gl]=Interface da extensión de documentación de KDevelop
+Name[hu]=KDevelop dokumentációmodul-felület
+Name[it]=Interfaccia a plugin della documentazione di KDevelop
+Name[ja]=KDevelop ドキュメンテーションプラグイン インターフェース
+Name[ms]=Antaramuka Plugin Dokumentasi KDevelop
+Name[nds]=KDevelop-Koppelsteed för't Dokmentatschoon-Moduul
+Name[ne]=केडीई विकास मिसिलीकरण प्लगइन इन्टरफेस
+Name[nl]=KDevelop Documentatie Plugin Interface
+Name[pl]=Interfejs do wtyczki dokumentacji dla KDevelop
+Name[pt]=Interface de 'Plugin' de Documentação do KDevelop
+Name[pt_BR]=Interface de Plug-in de Documentação do KDevelop
+Name[ru]=Интерфейс для модулей документации KDevelop
+Name[sk]=KDevelop rozhranie pre dokumentačný modul
+Name[sl]=Vmesnik vstavka dokumentacije v KDevelopu
+Name[sr]=Интерфејс KDevelop-овог прикључка за документацију
+Name[sr@Latn]=Interfejs KDevelop-ovog priključka za dokumentaciju
+Name[sv]=KDevelop insticksgränssnitt för dokumentation
+Name[ta]=Kமுன்னேற்று தொகுப்பான் தேர்வுகள் உரை இடைமுகம் உள்ளீடு
+Name[tg]=Интерфейс барои модулҳои ҳуҷҷатноки KDevelop
+Name[tr]=KDevelop Belgelendirme Eklentisi Arayüzü
+Name[zh_CN]=KDevelop 文档插件接口
+Name[zh_TW]=KDevelop 文件外掛程式介面
diff --git a/parts/documentation/kdevdocumentation.desktop b/parts/documentation/kdevdocumentation.desktop
new file mode 100644
index 00000000..415d1e2e
--- /dev/null
+++ b/parts/documentation/kdevdocumentation.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=The Documentation plugin offers browsing and searching in local and online documentation with support for multiple documentation systems.
+Comment[ca]=El connector de documentació ofereix navegació i recerca en documentació local i en línia amb suport per a múltiples sistemes de documentació.
+Comment[da]=Dokumentations-plugin tilbyder visning og søgning i lokal og online dokumentation med understøttelse af flere dokumentations-systemer.
+Comment[de]=Die Dokumentations-Komponente bietet eine Browsefunktion und Unterstützung für die Suche in mehreren Hilfedokumenten und Dokumentationssystemen.
+Comment[el]=Το πρόσθετο τεκμηρίωσης προσφέρει περιήγηση και αναζήτηση σε τοπική και απομακρυσμένη τεκμηρίωση για πολλαπλά συστήματα τεκμηρίωσης.
+Comment[es]=El complemento de documentación proporciona navegación y búsqueda en la documentación, tanto local como en línea, y permite múltiples sistemas de documentación.
+Comment[et]=Dokumentatsiooniplugin võimaldab lehitseda ja otsida nii kohalikus kui võrgudokumentatsioonis paljusid dokumentatsioonisüsteeme kasutades.
+Comment[eu]=Dokumentazio-pluginak lokaleko eta urruneko dokumentazio arakatzeko eta bilatzeko aukera ematen dizu, eta dokumentazio-sistema anitz onartzen ditu.
+Comment[fa]=وصلۀ مستندسازی، مرور و جستجو در مستندات محلی و برخط را با پشتیبانی از سیستمهای مستندسازی چندگانه، ارائه می‌کند.
+Comment[fr]=Le module externe de documentation offre une navigation et une recherche dans la documentation locale et en ligne ainsi que la prise en charge de systèmes de documentation mutiples.
+Comment[gl]=A extensión de documentación ofrece navegación e búsqueda en documentación local e en liña con soporte para múltiples sistemas de documentación.
+Comment[hu]=Dokumentációmegjelenítő elem helyi és távoli dokumentáció böngészéséhez, keresési lehetőséggel. Többféle formátumot támogat.
+Comment[it]=Il plugin di documentazione offre navigazione e ricerca in locale e documentazione in linea con supporto per sistemi di documentazione multipla.
+Comment[ms]=Plugin dokumentasi menawarkan pelungsuran dan pencarian dalam dokumentasi tempatan dan dalam talian dengan sokongan untuk pelbagai sistem dokumentasi.
+Comment[nds]=Mit dat Dokmentatschoon-Moduul kannst Du lokale un Tokoppel-Dokmentatschoon dörkieken un -söken, mehr Dokmentatschoonsystemen warrt ünnerstütt.
+Comment[ne]=मिसिलीकरण प्लगइनले बहुविध मिसिलीकरण प्रणालीको समर्थनसँग अनलाइन मिसिलीकरण र स्थानीय रूपमा ब्राउज र खोजी गर्न दिन्छ ।
+Comment[nl]=De documentatieplugin welke het mogelijk maakt om door lokale documentatie en documentatie op afstand te bladeren en te zoeken. Met ondersteuning voor verschillende documentatiesystemen.
+Comment[pl]=Kontrola dokumentacji z obsługą przeglądania i wyszukiwania w różnych plikach pomocy i systemach dokumentacji.
+Comment[pt]=O 'plugin' de documentação oferece navegação e procura em documentação local e em rede com suporte para vários sistemas de documentação.
+Comment[pt_BR]=A documentação do plug-in oferece navegação e busca na documentação local e online com suporte para diversos sistemas de documentação.
+Comment[ru]=Модуль документации позволяет упростить работу с документацией.
+Comment[sk]=Dokumentačný modul proskytuje prehliadanie a vyhľadávanie v lokálnej a online dokumentácie s podporou viacerých dokumentačných systémov.
+Comment[sr]=Прикључак за документацију са подршком за прегледање и тражење у локалној и документацији на вези, за више документационих система.
+Comment[sr@Latn]=Priključak za dokumentaciju sa podrškom za pregledanje i traženje u lokalnoj i dokumentaciji na vezi, za više dokumentacionih sistema.
+Comment[sv]=Dokumentationsinsticksprogrammet erbjuder bläddring och sökning i lokal dokumentation och dokumentation på nätet, med stöd för flera dokumentationssystem.
+Comment[tr]=Belgelendirme eklentisi, çoklu belgelendirme sistemlerine destek ile, yerel ve çevrimiçi belgelere gözatma ve bu belgelerde arama yapılmasına izin verir.
+Comment[zh_CN]=文档插件提供了本地和在线文档中提供浏览和搜索功能,支持多种文档系统
+Comment[zh_TW]=文件外掛程式提供對本地與線上文件的瀏覽與搜尋功能,並支援多重文件系統。
+Name=KDevDocumentation
+Name[da]=KDevelop dokumentation
+Name[nds]=KDevelop-Dokmentatschoon
+Name[pt_BR]=KDevDocumentação
+Name[sk]=KDev dokumentácia
+Name[sv]=KDevelop dokumentation
+Name[ta]=KDev ஆவணமாக்கல்
+Name[tg]=Ҳуҷҷатҳои KDev
+Name[zh_TW]=KDevelop 文件
+GenericName=Documentation
+GenericName[br]=Teuliadur
+GenericName[ca]=Documentació
+GenericName[cy]=Dogfenniaeth
+GenericName[da]=Dokumentation
+GenericName[de]=Dokumentationsbaum
+GenericName[el]=Τεκμηρίωση
+GenericName[es]=Documentación
+GenericName[et]=Dokumentatsioon
+GenericName[eu]=Dokumentazioa
+GenericName[fa]=مستندات
+GenericName[ga]=Doiciméadú
+GenericName[gl]=Documentación
+GenericName[hi]=दस्तावेज़ीकरण
+GenericName[hu]=Dokumentáció
+GenericName[it]=Documentazione
+GenericName[ja]=ドキュメンテーション
+GenericName[ms]=Dokumentasi
+GenericName[nds]=Dokmentatschoon
+GenericName[ne]=मिसिलीकरण
+GenericName[nl]=Documentatie
+GenericName[pl]=Dokumentacja
+GenericName[pt]=Documentação
+GenericName[pt_BR]=Documentação
+GenericName[ru]=Просмотр документации
+GenericName[sk]=Dokumentácia
+GenericName[sl]=Dokumentacija
+GenericName[sr]=Документација
+GenericName[sr@Latn]=Dokumentacija
+GenericName[sv]=Dokumentation
+GenericName[ta]=ஆவணமாக்கல்
+GenericName[tg]=Намоиши ҳуҷҷатҳо
+GenericName[tr]=Belgelendirme
+GenericName[zh_CN]=文档
+GenericName[zh_TW]=文件
+Icon=khelpcenter
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevdocumentation
+X-KDevelop-Version=5
+X-KDevelop-Mode=AssistantMode
+X-KDevelop-Properties=Documentation
diff --git a/parts/documentation/kdevpart_documentation.rc b/parts/documentation/kdevpart_documentation.rc
new file mode 100644
index 00000000..f8dac85a
--- /dev/null
+++ b/parts/documentation/kdevpart_documentation.rc
@@ -0,0 +1,19 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="documentation" library="libdocumentationplugin" version="4">
+<MenuBar>
+<!-- <Action name="doc_bookmarks"/> -->
+<!-- <Menu name="tools"><Text>&amp;Tools</Text>
+ <Action name="plugin_action"/>
+ </Menu> -->
+ <Menu name="help">
+ <Action name="help_look_in_index"/>
+ <Action name="help_search_in_doc"/>
+ <Action name="help_manpage"/>
+ <Action name="help_infopage"/>
+ <Action name="help_find_documentation" />
+ </Menu>
+</MenuBar>
+<!--<ToolBar name="extraToolBar">
+ <Action name="plugin_action"/>
+</ToolBar> -->
+</kpartplugin>
diff --git a/parts/documentation/plugins/Makefile.am b/parts/documentation/plugins/Makefile.am
new file mode 100644
index 00000000..c2002f78
--- /dev/null
+++ b/parts/documentation/plugins/Makefile.am
@@ -0,0 +1,3 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+METASOURCES = AUTO
+SUBDIRS = qt doxygen devhelp kdevtoc chm custom
diff --git a/parts/documentation/plugins/chm/Makefile.am b/parts/documentation/plugins/chm/Makefile.am
new file mode 100644
index 00000000..6df1ba52
--- /dev/null
+++ b/parts/documentation/plugins/chm/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libdocchmplugin.la
+
+noinst_HEADERS = docchmplugin.h
+kde_services_DATA = docchmplugin.desktop
+
+libdocchmplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdocchmplugin_la_SOURCES = docchmplugin.cpp
+libdocchmplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/chm/docchmplugin.cpp b/parts/documentation/plugins/chm/docchmplugin.cpp
new file mode 100644
index 00000000..e2b2b556
--- /dev/null
+++ b/parts/documentation/plugins/chm/docchmplugin.cpp
@@ -0,0 +1,198 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docchmplugin.h"
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kio/netaccess.h>
+#include <iostream>
+#include <fstream>
+#include <qvaluevector.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <qregexp.h>
+
+#include "../../../../config.h"
+
+static const KDevPluginInfo data("docchmplugin");
+typedef KDevGenericFactory<DocCHMPlugin> DocCHMPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocchmplugin, DocCHMPluginFactory(data) )
+
+DocCHMPlugin::DocCHMPlugin(QObject* parent, const char* name, QStringList // args
+ )
+ :DocumentationPlugin(DocCHMPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(CustomDocumentationTitles); // | Index | FullTextSearch | ProjectDocumentation
+ autoSetup();
+}
+
+DocCHMPlugin::~DocCHMPlugin()
+{
+}
+
+
+DocumentationCatalogItem* DocCHMPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
+ item->setURL(KURL(url));
+
+ return item;
+}
+
+QPair<KFile::Mode, QString> DocCHMPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "*.chm");
+}
+
+QString DocCHMPlugin::catalogTitle(const QString& // url
+ )
+{
+ return QString::null;
+}
+
+QString DocCHMPlugin::pluginName() const
+{
+ return i18n("CHM Documentation Collection");
+}
+
+
+QString DocCHMPlugin::getSpecialData(const QString& name, KURL url) {
+ QString ret = "";
+ url.setProtocol("ms-its");
+
+ url.addPath("/:" + name);
+ QString tmpFile;
+ if( KIO::NetAccess::download( url, tmpFile, 0 ) )
+ {
+ std::filebuf fb;
+ fb.open (tmpFile.ascii(), std::ios::in);
+ std::istream is(&fb);
+ char buf[5000] = " ";
+ while(is.good()) {
+ is.getline(buf, 5000);
+ ret += buf; ret += "\n";
+ }
+ fb.close();
+ KIO::NetAccess::removeTempFile( tmpFile );
+ } else {
+ kdDebug(9002) << "DocCHMPlugin::getSpecialData could not download data from " << url.url() << endl;
+ }
+ return ret;
+}
+
+
+///this currently is useless, because htdig cannot use kioslaves
+QStringList DocCHMPlugin::fullTextSearchLocations()
+{
+ //return QStringList::split( '\n', getSpecialData("contents", m_url));
+ return QStringList();
+}
+
+bool DocCHMPlugin::needRefreshIndex(DocumentationCatalogItem* // item
+ )
+{
+ return false;
+}
+
+void DocCHMPlugin::autoSetupPlugin()
+{
+ return;
+}
+
+void DocCHMPlugin::createIndex(IndexBox* // index
+ , DocumentationCatalogItem* // item
+ )
+{
+ return;
+}
+
+
+static KListViewItem* chainEnd(KListViewItem *parent) {
+ if(parent == 0) return 0;
+ KListViewItem* ret = dynamic_cast<KListViewItem*>(parent->firstChild());
+ if(ret == 0) return 0;
+ while(ret->nextSibling() != 0) {
+ ret = dynamic_cast<KListViewItem*>(ret->nextSibling());
+ }
+ return ret;
+}
+
+static QString decodeHTML(const QString& s) {
+ QRegExp rx(QString::fromLatin1("&#(\\d+);|&nbsp;"));
+ QString out = s;
+ int pos = rx.search(out);
+ while(pos > -1) {
+ QString found = rx.cap(0);
+ if(found != "&nbsp;") {
+ out.replace(pos, found.length(), static_cast<char>(rx.cap(1).toInt()));
+ }else{
+ out.replace(pos, found.length(), " ");
+ }
+ pos = rx.search(out, pos+1);
+ }
+ return out;
+}
+
+
+void DocCHMPlugin::createTOC(DocumentationCatalogItem* item)
+{
+ QStringList lines = QStringList::split("\n", getSpecialData("catalog", item->url()) );
+ if(lines.count() % 4 != 0) { kdDebug(9002) << "DocCHMPlugin::createTOC: wrong count of strings"; return;}
+
+ QValueVector<DocumentationItem*> items;
+ items.push_back(item);
+ for(QStringList::Iterator it = lines.begin(); it != lines.end();) {
+ bool ok1 = true, ok2 = true;
+ int parent = (*it).toInt(&ok1);
+ ++it;
+ int current = (*it).toInt(&ok2);
+ ++it;
+ if(int(items.size()) != current || !ok1 || !ok2 || parent < 0 || parent >= int(items.size()) || current < 0 || current != int(items.size())) {
+ kdDebug(9002) << "DocCHMPlugin::createTOC error while parsing output of ioslave" << endl;
+ break;
+ }
+
+ QString& name(*it);
+ ++it;
+ KURL url(*it);
+ ++it;
+
+ items.push_back(new DocumentationItem(
+ DocumentationItem::Document, items[parent], chainEnd(items[parent]), decodeHTML(name)));
+ items[current]->setURL(url);
+ if(parent != 0) items[parent]->setType(DocumentationItem::Book);
+ }
+
+
+ return;
+}
+
+void DocCHMPlugin::setCatalogURL(DocumentationCatalogItem* item)
+{
+ KURL chmURL = item->url();
+ chmURL.setProtocol("ms-its");
+ chmURL.addPath("/");
+ item->setURL(chmURL);
+}
+
+#include "docchmplugin.moc"
diff --git a/parts/documentation/plugins/chm/docchmplugin.desktop b/parts/documentation/plugins/chm/docchmplugin.desktop
new file mode 100644
index 00000000..1e538ed7
--- /dev/null
+++ b/parts/documentation/plugins/chm/docchmplugin.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=DocCHMPlugin
+Name[da]=DocCHM-plugin
+Name[hu]=DocCHMPPlugin
+Name[sk]=Doc CHM modul
+Name[sv]=CHM-dokumentationsinsticksmodul
+Name[ta]=DocCHM சொருகு
+Name[zh_TW]=Doc CHM 外掛程式
+Exec=blubb
+Comment=Documentation plugin for CHM documentation
+Comment[ca]=Connector de documentació per a documentació CHM
+Comment[da]=Dokumentations-plugin for CHM-dokumentation
+Comment[de]=Dokumentations-Modul für CHM-Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση CHM
+Comment[es]=Complemento de documentación para CHM
+Comment[et]=CHM dokumentatsiooni plugin
+Comment[eu]=CHM dokumentazioarako dokumentazioa plugin-aDocumentation plugin for CHM documentation
+Comment[fa]=وصلۀ مستندسازی برای مستندات CHM
+Comment[fr]=Module externe de documentation pour la documentation CHM
+Comment[gl]=Extensión de documentación para documentación CHM
+Comment[hu]=Dokumentációmodul CHM formátumú dokumentációhoz
+Comment[it]=Plugin di documentazione per file CHM
+Comment[ja]=CHM ドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk dokumentasi CHM
+Comment[nds]=Dokmentatschoon-Moduul för CHM-Dokmentatschonen
+Comment[ne]=CHM मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor CHM documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie CHM
+Comment[pt]='Plugin' para documentação CHM
+Comment[pt_BR]=Plug-in de documentação para documento CHM
+Comment[ru]=Модуль для просмотра документации в файлах CHM
+Comment[sk]=Dokumentačný modul pre CHM dokumentáciu
+Comment[sr]=Документациони прикључак за CHM документацију
+Comment[sr@Latn]=Dokumentacioni priključak za CHM dokumentaciju
+Comment[sv]=Dokumentationsinsticksmodul för CHM-dokumentation
+Comment[ta]= CHM ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои намоиши файлҳои CHM-е, ки ҳуҷҷатҳо мавҷуд аст
+Comment[tr]=CHM belgelendirmesi için belgelendirme eklentisi
+Comment[zh_CN]=CHM 文档的文档插件
+Comment[zh_TW]=CHM 文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdocchmplugin
diff --git a/parts/documentation/plugins/chm/docchmplugin.h b/parts/documentation/plugins/chm/docchmplugin.h
new file mode 100644
index 00000000..69bc441b
--- /dev/null
+++ b/parts/documentation/plugins/chm/docchmplugin.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCCHMPLUGIN_H
+#define DOCCHMPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class DocCHMPlugin :public DocumentationPlugin
+{
+ Q_OBJECT
+public:
+ DocCHMPlugin(QObject* parent, const char* name, QStringList args = QStringList());
+ ~DocCHMPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+ virtual QString catalogTitle(const QString& url);
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+ virtual void createTOC(DocumentationCatalogItem* item);
+
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual void autoSetupPlugin();
+protected:
+ QString getSpecialData(const QString& name, KURL url);
+};
+
+#endif
diff --git a/parts/documentation/plugins/custom/Makefile.am b/parts/documentation/plugins/custom/Makefile.am
new file mode 100644
index 00000000..999dc853
--- /dev/null
+++ b/parts/documentation/plugins/custom/Makefile.am
@@ -0,0 +1,10 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdoccustomplugin.la
+libdoccustomplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdoccustomplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
+noinst_HEADERS = doccustomplugin.h
+libdoccustomplugin_la_SOURCES = doccustomplugin.cpp
+kde_services_DATA = doccustomplugin.desktop
diff --git a/parts/documentation/plugins/custom/doccustomplugin.cpp b/parts/documentation/plugins/custom/doccustomplugin.cpp
new file mode 100644
index 00000000..b3cc7685
--- /dev/null
+++ b/parts/documentation/plugins/custom/doccustomplugin.cpp
@@ -0,0 +1,106 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "doccustomplugin.h"
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+static const KDevPluginInfo data("doccustomplugin");
+typedef KDevGenericFactory<DocCustomPlugin> DocCustomPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdoccustomplugin, DocCustomPluginFactory(data) )
+
+DocCustomPlugin::DocCustomPlugin(QObject* parent, const char* name, const QStringList // args
+ )
+ :DocumentationPlugin(DocCustomPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(CustomDocumentationTitles | ProjectUserManual);
+ autoSetup();
+}
+
+DocCustomPlugin::~DocCustomPlugin()
+{
+}
+
+bool DocCustomPlugin::needRefreshIndex(DocumentationCatalogItem* // item
+ )
+{
+ return false;
+}
+
+QString DocCustomPlugin::pluginName() const
+{
+ return i18n("Custom Documentation Collection");
+}
+
+DocumentationCatalogItem* DocCustomPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
+ item->setURL(KURL(url));
+ return item;
+}
+
+QPair<KFile::Mode, QString> DocCustomPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "all/allfiles");
+}
+
+QString DocCustomPlugin::catalogTitle(const QString& /*url*/)
+{
+ return QString::null;
+}
+
+QStringList DocCustomPlugin::fullTextSearchLocations()
+{
+ return QStringList();
+}
+
+
+void DocCustomPlugin::autoSetupPlugin()
+{
+ return;
+}
+
+void DocCustomPlugin::createIndex(IndexBox* /*index*/, DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocCustomPlugin::createTOC(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocCustomPlugin::setCatalogURL(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+ProjectDocumentationPlugin *DocCustomPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == UserManual)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
diff --git a/parts/documentation/plugins/custom/doccustomplugin.desktop b/parts/documentation/plugins/custom/doccustomplugin.desktop
new file mode 100644
index 00000000..09b018e7
--- /dev/null
+++ b/parts/documentation/plugins/custom/doccustomplugin.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=DocCustomPlugin
+Name[da]=Brugerdefineret doc-plugin
+Name[sk]=Doc vlastný modul
+Name[sv]=Egen dokumentationsinsticksmodul
+Name[ta]=ஆவண தனிப்பயன் சொருகுப்பொருள்
+Name[zh_TW]=Doc 自訂外掛程式
+Exec=blubb
+Comment=Documentation plugin for all types of documentation
+Comment[ca]=Connector de documentació per a tot tipus de documentació
+Comment[da]=Dokumentations-plugin for alle typer dokumentation
+Comment[de]=Komponente für alle Arten von Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για όλους τους τύπους τεκμηρίωσης
+Comment[es]=Complemento de documentación para todos los tipos de documentación
+Comment[et]=Igat tüüpi dokumentatsiooni plugin
+Comment[eu]=Dokumentu mota guztientzako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای همۀ انواع مستندات
+Comment[fr]=Module externe de documentation pour tous les types de documentation
+Comment[gl]=Extensión de documentación para tódolos tipos de documentación
+Comment[hu]=Dokumentációmodul mindenféle dokumentációhoz
+Comment[it]=Plugin di documentazione per tutti i tipi di documentazione
+Comment[ja]=全種類のドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk semua jenis dokumentasi
+Comment[nds]=Dokmentatschoon-Moduul för all Oorden vun Dokmentatschoon
+Comment[ne]=सबै प्रकारको मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor alle typen documentatie
+Comment[pl]=Wtyczka dokumentacji dla wszystkich typów dokumentacji
+Comment[pt]='Plugin' para documentação de todos os tipos
+Comment[pt_BR]=Plug-in de documentação para todos os tipos de documentação
+Comment[ru]=Модуль для работы с документацией
+Comment[sk]=Dokumentačný modul pre všetky typy dokumentácie
+Comment[sl]=Dokumentacijski vstavek za vse vrste dokumentacije
+Comment[sr]=Документациони прикључак за све типове документације
+Comment[sr@Latn]=Dokumentacioni priključak za sve tipove dokumentacije
+Comment[sv]=Dokumentationsinsticksmodul för alla typer av dokumentation
+Comment[ta]=எல்லா வகை ஆவணமயமாக்கலுக்கான ஆவணமயமாக்கல் சொருகுப்பொருள்
+Comment[tg]=Модул барои кор кардан бо ҳуҷҷатҳо
+Comment[tr]=Her tür belgelendirme için belgelendirme eklentisi
+Comment[zh_CN]=全部类型文档的文档插件
+Comment[zh_TW]=所有型態的文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdoccustomplugin
diff --git a/parts/documentation/plugins/custom/doccustomplugin.h b/parts/documentation/plugins/custom/doccustomplugin.h
new file mode 100644
index 00000000..2888af81
--- /dev/null
+++ b/parts/documentation/plugins/custom/doccustomplugin.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCCUSTOMPLUGIN_H
+#define DOCCUSTOMPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class DocCustomPlugin : public DocumentationPlugin {
+public:
+ DocCustomPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocCustomPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString& url);
+
+ virtual void autoSetupPlugin();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+};
+
+#endif
diff --git a/parts/documentation/plugins/devhelp/Makefile.am b/parts/documentation/plugins/devhelp/Makefile.am
new file mode 100644
index 00000000..e0682833
--- /dev/null
+++ b/parts/documentation/plugins/devhelp/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libdocdevhelpplugin.la
+
+noinst_HEADERS = docdevhelpplugin.h
+kde_services_DATA = docdevhelpplugin.desktop
+
+libdocdevhelpplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdocdevhelpplugin_la_SOURCES = docdevhelpplugin.cpp
+libdocdevhelpplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp b/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp
new file mode 100644
index 00000000..dca19e51
--- /dev/null
+++ b/parts/documentation/plugins/devhelp/docdevhelpplugin.cpp
@@ -0,0 +1,386 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docdevhelpplugin.h"
+
+#include <unistd.h>
+
+#include <qdom.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdialog.h>
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "../../../../config.h"
+
+class DevHelpDocumentationCatalogItem: public DocumentationCatalogItem
+{
+public:
+ DevHelpDocumentationCatalogItem(const QString &devHelpFile, DocumentationPlugin* plugin,
+ KListView *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_devHelpFile(devHelpFile)
+ {
+ }
+ DevHelpDocumentationCatalogItem(const QString &devHelpFile, DocumentationPlugin* plugin,
+ DocumentationItem *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_devHelpFile(devHelpFile)
+ {
+ }
+ QString devHelpFile() const { return m_devHelpFile; }
+
+ virtual QString cacheVersion() const {
+ unsigned int checksum=0;
+ for(int a=0;a<m_devHelpFile.length(); a++) {
+ checksum += (a+1) * (int)m_devHelpFile[a];
+ }
+ QString str;
+ QTextOStream( &str ) << checksum;
+ return str;
+ }
+
+protected:
+
+private:
+ QString m_devHelpFile;
+};
+
+
+static const KDevPluginInfo data("docdevhelpplugin");
+typedef KDevGenericFactory<DocDevHelpPlugin> DocDevHelpPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocdevhelpplugin, DocDevHelpPluginFactory(data) )
+
+DocDevHelpPlugin::DocDevHelpPlugin(QObject* parent, const char* name,
+ const QStringList /*args*/)
+ :DocumentationPlugin(DocDevHelpPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(Index | FullTextSearch | ProjectDocumentation);
+ autoSetup();
+}
+
+DocDevHelpPlugin::~DocDevHelpPlugin()
+{
+}
+
+DocumentationCatalogItem* DocDevHelpPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ return new DevHelpDocumentationCatalogItem(url, this, contents, title);
+}
+
+QPair<KFile::Mode, QString> DocDevHelpPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "*.devhelp");
+}
+
+QString DocDevHelpPlugin::catalogTitle(const QString& url)
+{
+ QFileInfo fi(url);
+ if (!fi.exists())
+ return QString::null;
+
+ QFile f(url);
+ if (!f.open(IO_ReadOnly))
+ return QString::null;
+
+ QDomDocument doc;
+ if (!doc.setContent(&f))
+ return QString::null;
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+
+ return docEl.attribute("title", QString::null);
+}
+
+QString DocDevHelpPlugin::pluginName() const
+{
+ return i18n("Devhelp Documentation Collection");
+}
+
+QStringList DocDevHelpPlugin::fullTextSearchLocations()
+{
+ QStringList locs;
+
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ config->setGroup("Search Settings");
+ if (config->readBoolEntry(it.key(), false))
+ {
+ config->setGroup("Locations");
+ QFileInfo fi(config->readPathEntry(it.key()));
+ locs << fi.dirPath(true);
+ }
+ }
+
+ return locs;
+}
+
+bool DocDevHelpPlugin::needRefreshIndex(DocumentationCatalogItem* item)
+{
+ DevHelpDocumentationCatalogItem *dhItem = dynamic_cast<DevHelpDocumentationCatalogItem *>(item);
+ if (!dhItem)
+ return false;
+
+ QFileInfo fi(dhItem->devHelpFile());
+ config->setGroup("Index");
+ if (fi.lastModified() > config->readDateTimeEntry(dhItem->text(0), new QDateTime()))
+ {
+ kdDebug() << "need rebuild index for " << dhItem->text(0) << endl;
+ config->writeEntry(item->text(0), fi.lastModified());
+ return true;
+ }
+ else
+ return false;
+}
+
+void DocDevHelpPlugin::autoSetupPlugin()
+{
+ QValueStack<QString> scanStack;
+
+ pushToScanStack(scanStack, getenv("DEVHELP_SEARCH_PATH"));
+ pushToScanStack(scanStack, QString(getenv("HOME")) + "/.devhelp/books");
+
+ QString dhexepath = DocDevHelpPluginFactory::instance()->dirs()->findExe("devhelp");
+ if (!dhexepath.isEmpty())
+ {
+ QFileInfo fi(dhexepath);
+ QString path = KURL(fi.dirPath(true)).upURL().path(1);
+ pushToScanStack(scanStack, path + "share/devhelp/books");
+ pushToScanStack(scanStack, path + "share/gtk-doc/html");
+ }
+
+ pushToScanStack(scanStack, "/usr/share/gtk-doc/html");
+ pushToScanStack(scanStack, "/usr/share/devhelp/books/");
+ pushToScanStack(scanStack, "/usr/local/share/devhelp/books");
+ pushToScanStack(scanStack, "/usr/local/share/gtk-doc/html");
+ pushToScanStack(scanStack, "/opt/gnome/share/devhelp/books");
+ pushToScanStack(scanStack, "/opt/gnome/share/gtk-doc/html");
+ pushToScanStack(scanStack, "/opt/gnome2/share/devhelp/books");
+ pushToScanStack(scanStack, "/opt/gnome2/share/gtk-doc/html");
+
+ //fill the list of scan dirs (with subdirectories)
+ QStringList scanList;
+ QDir dir;
+ do
+ {
+ dir.setPath(scanStack.pop());
+ if (!dir.exists())
+ continue;
+ scanList << dir.path();
+
+ const QFileInfoList *dirEntries = dir.entryInfoList();
+ if ( !dirEntries ) continue;
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it)
+ {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == "..")
+ continue;
+ QString path = it.current()->absFilePath();
+ if (it.current()->isDir())
+ {
+ scanStack.push(path);
+ }
+ }
+ } while (!scanStack.isEmpty());
+
+ for (QStringList::const_iterator it = scanList.begin(); it != scanList.end(); ++it)
+ {
+ scanDevHelpDir(*it);
+ }
+}
+
+void DocDevHelpPlugin::scanDevHelpDir(const QString &path)
+{
+ QDir d(path);
+ if (! d.exists() || !d.isReadable())
+ return;
+
+ d.setFilter(QDir::Files);
+ //scan for *.devhelp files
+ const QFileInfoList *list = d.entryInfoList();
+ QFileInfoListIterator it( *list );
+ QFileInfo *fi;
+ while ( (fi = it.current()) != 0 )
+ {
+ if (fi->extension() == "devhelp")
+ {
+ config->setGroup("Locations");
+ config->writePathEntry(catalogTitle(fi->absFilePath()), fi->absFilePath());
+ }
+ ++it;
+ }
+}
+
+void DocDevHelpPlugin::pushToScanStack(QValueStack<QString> &stack, const QString &value)
+{
+ if ( (!value.isEmpty()) && (!stack.contains(value)) )
+ {
+ stack << value;
+ kdDebug() << "Devhelp scan stack: +: " << value << endl;
+ }
+}
+
+void DocDevHelpPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* item)
+{
+ DevHelpDocumentationCatalogItem *dhItem = dynamic_cast<DevHelpDocumentationCatalogItem *>(item);
+ if (!dhItem)
+ return;
+
+ QFileInfo fi(dhItem->devHelpFile());
+
+ QFile f(dhItem->devHelpFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << dhItem->devHelpFile() << endl;
+ return;
+ }
+
+ QDomDocument doc;
+ if (!doc.setContent(&f))
+ {
+ kdDebug() << "Not a valid devhelp file: " << dhItem->devHelpFile() << endl;
+ return;
+ }
+ f.close();
+
+ QString baseUrl = KURL(dhItem->devHelpFile()).directory();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement chaptersEl = docEl.namedItem("functions").toElement();
+ QDomElement childEl = chaptersEl.firstChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "function")
+ {
+ QString name = childEl.attribute("name");
+ QString url = childEl.attribute("link");
+
+ IndexItemProto *ii = new IndexItemProto(this, item, index, name, item->text(0));
+ ii->addURL(KURL(baseUrl+"/"+url));
+ }
+ childEl = childEl.nextSibling().toElement();
+ }
+}
+
+void DocDevHelpPlugin::createTOC(DocumentationCatalogItem* item)
+{
+ DevHelpDocumentationCatalogItem *dhItem = dynamic_cast<DevHelpDocumentationCatalogItem *>(item);
+ if (!dhItem)
+ return;
+
+ QFileInfo fi(dhItem->devHelpFile());
+
+ QFile f(dhItem->devHelpFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << dhItem->devHelpFile() << endl;
+ return;
+ }
+
+ QDomDocument doc;
+ if (!doc.setContent(&f))
+ {
+ kdDebug() << "Not a valid devhelp file: " << dhItem->devHelpFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement chaptersEl = docEl.namedItem("chapters").toElement();
+
+ QDomElement childEl = chaptersEl.lastChild().toElement();
+ QString baseUrl = KURL(dhItem->devHelpFile()).directory();
+ addTocSect(dhItem, childEl, baseUrl, true);
+}
+
+void DocDevHelpPlugin::addTocSect(DocumentationItem *parent, QDomElement childEl,
+ QString baseUrl, bool book)
+{
+ while (!childEl.isNull())
+ {
+ if ( (childEl.tagName() == "sub") || (childEl.tagName() == "chapter"))
+ {
+ QString name = childEl.attribute("name");
+ QString url = childEl.attribute("link");
+
+ if (name.isEmpty() && url.contains("ix"))
+ name = "Index";
+
+ DocumentationItem *item = new DocumentationItem(
+ book ? DocumentationItem::Book : DocumentationItem::Document, parent, name);
+ item->setURL(KURL(baseUrl+"/"+url));
+
+ QDomElement grandchildEl = childEl.lastChild().toElement();
+ addTocSect(item, grandchildEl, baseUrl);
+ }
+ childEl = childEl.previousSibling().toElement();
+ }
+}
+
+void DocDevHelpPlugin::setCatalogURL(DocumentationCatalogItem* item)
+{
+ DevHelpDocumentationCatalogItem *dhItem = dynamic_cast<DevHelpDocumentationCatalogItem *>(item);
+ if (!dhItem)
+ return;
+
+ QFileInfo fi(dhItem->devHelpFile());
+
+ QFile f(dhItem->devHelpFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << dhItem->devHelpFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f))
+ {
+ kdDebug(9002) << "Not a valid Devhelp file: " << dhItem->devHelpFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement titleEl = docEl.namedItem("book").toElement();
+
+ if (item->url().isEmpty())
+ {
+ KURL url(fi.dirPath(true) + "/" + docEl.attribute("link", QString::null));
+ item->setURL(url);
+ }
+}
+
+ProjectDocumentationPlugin *DocDevHelpPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == APIDocs)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
+
+#include "docdevhelpplugin.moc"
diff --git a/parts/documentation/plugins/devhelp/docdevhelpplugin.desktop b/parts/documentation/plugins/devhelp/docdevhelpplugin.desktop
new file mode 100644
index 00000000..14c3f700
--- /dev/null
+++ b/parts/documentation/plugins/devhelp/docdevhelpplugin.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=DevHelpPlugin
+Name[da]=DevHelp-plugin
+Name[sk]=DevHelp modul
+Name[sv]=DevHelp-insticksmodul
+Name[ta]=Devஉதவி சொருகு
+Name[zh_TW]=DevHelp 外掛程式
+Comment=Documentation plugin for DevHelp documentation
+Comment[ca]=Connector de documentació per a documentació DevHelp
+Comment[da]=Dokumentations-plugin for DevHelp-dokumentation
+Comment[de]=Komponente für DevHelp-Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση DevHelp
+Comment[es]=Complemento de documentación para documentación DevHelp
+Comment[et]=DevHelp dokumentatsiooni plugin
+Comment[eu]=DevHelp dokumentaziorako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای مستندات DevHelp
+Comment[fr]=Module externe de documentation pour la documentation DevHelp
+Comment[gl]=Extensión de documentación para documentación DevHelp
+Comment[hu]=Dokumentációmodul DevHelp-dokumentációhoz
+Comment[it]=Plugin di documentazione per file DevHelp
+Comment[ja]=DevHelp ドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk dokumentasi DevHelp
+Comment[nds]=Dokmentatschoon-Moduul för DevHelp-Dokmentatschoon
+Comment[ne]=DevHelp मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin fvoor DevHelp documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie DevHelp
+Comment[pt]='Plugin' para documentação DevHelp
+Comment[pt_BR]=Plug-in de documentação para documento DevHelp
+Comment[ru]=Модуль для просмотра документации DevHelp
+Comment[sk]=Dokumentačný modul pre DevHelp dokumentáciu
+Comment[sl]=Dokumentacijski vstavek za dokumentacijo DevHelp
+Comment[sr]=Документациони прикључак за DevHelp документацију
+Comment[sr@Latn]=Dokumentacioni priključak za DevHelp dokumentaciju
+Comment[sv]=Dokumentationsinsticksmodul för DevHelp-dokumentation
+Comment[ta]= DevHelp ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиш намудани DevHelp-и асоснок карда шуда
+Comment[tr]=DevHelp belgelendirmesi için belgelendirme eklentisi
+Comment[zh_CN]=DevHelp 文档的文档插件
+Comment[zh_TW]=DevHelp 文件外掛程式
+Exec=blubb
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdocdevhelpplugin
diff --git a/parts/documentation/plugins/devhelp/docdevhelpplugin.h b/parts/documentation/plugins/devhelp/docdevhelpplugin.h
new file mode 100644
index 00000000..ab0b0ece
--- /dev/null
+++ b/parts/documentation/plugins/devhelp/docdevhelpplugin.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCDEVHELPPLUGIN_H
+#define DOCDEVHELPPLUGIN_H
+
+#include <qvaluestack.h>
+#include <qdom.h>
+
+#include <kdevdocumentationplugin.h>
+
+class DocDevHelpPlugin: public DocumentationPlugin
+{
+ Q_OBJECT
+public:
+ DocDevHelpPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocDevHelpPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual QString catalogTitle(const QString& url);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+ virtual void autoSetupPlugin();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+
+protected:
+ void pushToScanStack(QValueStack<QString> &stack, const QString &value);
+ void scanDevHelpDir(const QString &path);
+ void addTocSect(DocumentationItem *parent, QDomElement childEl, QString baseUrl, bool book=false);
+};
+
+#endif
diff --git a/parts/documentation/plugins/djvu/Makefile.am b/parts/documentation/plugins/djvu/Makefile.am
new file mode 100644
index 00000000..716be5df
--- /dev/null
+++ b/parts/documentation/plugins/djvu/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdocdjvuplugin.la
+libdocdjvuplugin_la_LDFLAGS = $(all_libraries)
+libdocdjvuplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+noinst_HEADERS = docdjvuplugin.h
+libdocdjvuplugin_la_SOURCES = docdjvuplugin.cpp
+kde_services_DATA = docdjvuplugin.desktop
diff --git a/parts/documentation/plugins/djvu/docdjvuplugin.cpp b/parts/documentation/plugins/djvu/docdjvuplugin.cpp
new file mode 100644
index 00000000..0c53943e
--- /dev/null
+++ b/parts/documentation/plugins/djvu/docdjvuplugin.cpp
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docdjvuplugin.h"
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+
+#include <kdevgenericfactory.h>
+
+static const KAboutData data("docdjvuplugin", I18N_NOOP("Djvu documentation plugin"), "1.0");
+typedef KDevGenericFactory<DocDjvuPlugin> DocDjvuPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocdjvuplugin, DocDjvuPluginFactory(&data) )
+
+DocDjvuPlugin::DocDjvuPlugin(QObject* parent, const char* name, const QStringList args)
+ :DocumentationPlugin(DocDjvuPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(CustomDocumentationTitles | ProjectUserManual);
+ autoSetup();
+}
+
+DocDjvuPlugin::~DocDjvuPlugin()
+{
+}
+
+bool DocDjvuPlugin::needRefreshIndex(DocumentationCatalogItem* item)
+{
+ return false;
+}
+
+QString DocDjvuPlugin::pluginName() const
+{
+ return i18n("Djvu Documentation Collection");
+}
+
+DocumentationCatalogItem* DocDjvuPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
+ item->setURL(KURL(url));
+ return item;
+}
+
+QPair<KFile::Mode, QString> DocDjvuPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "all/allfiles");
+}
+
+QString DocDjvuPlugin::catalogTitle(const QString& /*url*/)
+{
+ return QString::null;
+}
+
+QStringList DocDjvuPlugin::fullTextSearchLocations()
+{
+ return QStringList();
+}
+
+
+void DocDjvuPlugin::autoSetupPlugin()
+{
+ return;
+}
+
+void DocDjvuPlugin::createIndex(IndexBox* /*index*/, DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocDjvuPlugin::createTOC(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocDjvuPlugin::setCatalogURL(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+ProjectDocumentationPlugin *DocDjvuPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == UserManual)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
diff --git a/parts/documentation/plugins/djvu/docdjvuplugin.desktop b/parts/documentation/plugins/djvu/docdjvuplugin.desktop
new file mode 100644
index 00000000..c88aa6a9
--- /dev/null
+++ b/parts/documentation/plugins/djvu/docdjvuplugin.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=DocDjvuPlugin
+Name[da]=DocDjvu-plugin
+Name[ms]=PluginDocDjvu
+Name[sk]=Doc Djvu modul
+Name[sv]=DocDjvu-insticksmodul
+Name[ta]=DocQt சொருகு
+Name[zh_TW]=Djvu 文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for djvu format
+Comment[ca]=Connector de documentació per al format djvu
+Comment[da]=Dokumentations-plugin for djvu-dokumentation
+Comment[de]=Komponente für das DjVu-Dokumentationsformat
+Comment[el]=Πρόσθετο τεκμηρίωσης για τη μορφή djvu
+Comment[es]=Complemento de documentación para el formato djvu
+Comment[et]=Djvu vormingus dokumentatsiooni plugin
+Comment[eu]=Djvu dokumentaziorako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای قالب djvu
+Comment[fr]=Module externe de documentation pour le format djvu
+Comment[gl]=Extensión de documentación para o formato djvu
+Comment[hu]=Dokumentációmodul djvu formátumú dokumentációhoz
+Comment[it]=Plugin documentazione per il formato djvu
+Comment[ja]=djvu フォーマットのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk format djvu
+Comment[nds]=Dokmentatschoon-Moduul för dat djvu-Dokmentatschoonformaat
+Comment[ne]=djvu ढाँचाका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor het djvu-formaat
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie djvu
+Comment[pt]='Plugin' para documentação no formato djvu
+Comment[pt_BR]=Plug-in de documentação para o formato djvu
+Comment[ru]=Модуль для просмотра документации в формате DJVU
+Comment[sk]=Dokumentačný modul pre Djvu dokumentáciu
+Comment[sr]=Документациони прикључак за djvu формат
+Comment[sr@Latn]=Dokumentacioni priključak za djvu format
+Comment[sv]=Dokumentationsinsticksmodul för djvu-format
+Comment[ta]= CHM ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиш намудани ҳуҷҷатҳо дар формати DJVU
+Comment[tr]=djvu biçimi için belgelendirme eklentisi
+Comment[zh_CN]=djvu 格式文档插件
+Comment[zh_TW]=Djvu 格式文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=1
+X-KDE-Library=libdocdjvuplugin
diff --git a/parts/documentation/plugins/djvu/docdjvuplugin.h b/parts/documentation/plugins/djvu/docdjvuplugin.h
new file mode 100644
index 00000000..79bbf0ab
--- /dev/null
+++ b/parts/documentation/plugins/djvu/docdjvuplugin.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCDJVUPLUGIN_H
+#define DOCDVJUPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class DocDjvuPlugin : public DocumentationPlugin {
+public:
+ DocDjvuPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocDjvuPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString& url);
+
+ virtual void autoSetupPlugin();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+};
+
+#endif
diff --git a/parts/documentation/plugins/doxygen/Makefile.am b/parts/documentation/plugins/doxygen/Makefile.am
new file mode 100644
index 00000000..eb6e2648
--- /dev/null
+++ b/parts/documentation/plugins/doxygen/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdocdoxygenplugin.la
+
+kde_services_DATA = docdoxygenplugin.desktop
+libdocdoxygenplugin_la_SOURCES = docdoxygenplugin.cpp
+noinst_HEADERS = docdoxygenplugin.h
+
+
+libdocdoxygenplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdocdoxygenplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp b/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp
new file mode 100644
index 00000000..ddea5219
--- /dev/null
+++ b/parts/documentation/plugins/doxygen/docdoxygenplugin.cpp
@@ -0,0 +1,529 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docdoxygenplugin.h"
+
+#include <unistd.h>
+
+#include <qdom.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdialog.h>
+#include <qregexp.h>
+#include <qvaluestack.h>
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+#include <urlutil.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "../../../../config.h"
+
+class DoxyDocumentationCatalogItem: public DocumentationCatalogItem
+{
+public:
+ DoxyDocumentationCatalogItem(const QString &origUrl, DocumentationPlugin* plugin,
+ KListView *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_origUrl(origUrl)
+ {
+ }
+ DoxyDocumentationCatalogItem(const QString &origUrl, DocumentationPlugin* plugin,
+ DocumentationItem *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_origUrl(origUrl)
+ {
+ }
+ QString origUrl() const { return m_origUrl; }
+
+private:
+ QString m_origUrl;
+};
+
+
+static const KDevPluginInfo data("docdoxygenplugin");
+typedef KDevGenericFactory<DocDoxygenPlugin> DocDoxygenPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocdoxygenplugin, DocDoxygenPluginFactory(data) )
+
+DocDoxygenPlugin::DocDoxygenPlugin(QObject* parent, const char* name, const QStringList)
+ :DocumentationPlugin(DocDoxygenPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(Index | FullTextSearch | ProjectDocumentation | CustomDocumentationTitles );
+ autoSetup();
+}
+
+DocDoxygenPlugin::~DocDoxygenPlugin()
+{
+}
+
+QPair<KFile::Mode, QString> DocDoxygenPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "index.html *.tag");
+}
+
+QString DocDoxygenPlugin::catalogTitle(const QString& url)
+{
+ QFileInfo fi(url);
+ if (!fi.exists())
+ return QString::null;
+
+ if (fi.extension(false) == "html")
+ {
+ QFile f(url);
+ if (!f.open(IO_ReadOnly))
+ return QString::null;
+
+ QTextStream ts(&f);
+ QString contents = ts.read();
+ QRegExp re(".*<title>(.*)</title>.*");
+ re.setCaseSensitive(false);
+ re.search(contents);
+ return re.cap(1);
+ }
+ else if (fi.extension(false) == "tag")
+ {
+ QFile *f = 0;
+ QFile f1(fi.dirPath(true) + "/html/index.html");
+ if (f1.open(IO_ReadOnly))
+ f = &f1;
+ QFile f2(fi.dirPath(true) + "/index.html");
+ if (f2.open(IO_ReadOnly))
+ f = &f2;
+ if (f != 0)
+ {
+ QTextStream ts(f);
+ QString contents = ts.read();
+ QRegExp re(".*<title>(.*)</title>.*");
+ re.setCaseSensitive(false);
+ re.search(contents);
+ return re.cap(1);
+ }
+ }
+ return QString::null;
+}
+
+QString DocDoxygenPlugin::pluginName() const
+{
+ return i18n("Doxygen Documentation Collection");
+}
+
+QStringList DocDoxygenPlugin::fullTextSearchLocations()
+{
+ QStringList locs;
+
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ config->setGroup("Search Settings");
+ if (config->readBoolEntry(it.key(), false))
+ {
+ config->setGroup("Locations");
+ QFileInfo fi(config->readPathEntry(it.key()));
+ locs << fi.dirPath(true);
+ }
+ }
+
+ return locs;
+}
+
+void DocDoxygenPlugin::setCatalogURL(DocumentationCatalogItem* item)
+{
+ if (item->url().url().endsWith("tag"))
+ {
+ QFileInfo fi(item->url().directory(false) + "html/index.html");
+ if (fi.exists())
+ {
+ item->setURL(KURL::fromPathOrURL(fi.absFilePath()));
+ return;
+ }
+ QFileInfo fi2(item->url().directory(false) + "index.html");
+ if (fi2.exists())
+ {
+ item->setURL(KURL::fromPathOrURL(fi2.absFilePath()));
+ return;
+ }
+ item->setURL(KURL());
+ }
+}
+
+bool DocDoxygenPlugin::needRefreshIndex(DocumentationCatalogItem* item)
+{
+ DoxyDocumentationCatalogItem *doxyItem = dynamic_cast<DoxyDocumentationCatalogItem*>(item);
+ if (!doxyItem)
+ return false;
+
+ QFileInfo fi(doxyItem->origUrl());
+ config->setGroup("Index");
+ if (fi.lastModified() > config->readDateTimeEntry(item->text(0), new QDateTime()))
+ {
+ kdDebug() << "need rebuild index for " << item->text(0) << endl;
+ config->writeEntry(item->text(0), fi.lastModified());
+ return true;
+ }
+ else
+ return false;
+}
+
+void DocDoxygenPlugin::autoSetupPlugin()
+{
+ autoSetupDocs(KDELIBS_DOXYDIR, "en/kdelibs-apidocs", "The KDE API Reference (The KDE API Reference)");
+ autoSetupDocs("", "en/kdevelop-apidocs", "The KDevelop Platform API Documentation (KDevelop)");
+
+}
+
+void DocDoxygenPlugin::autoSetupDocs(const QString &defaultDir, const QString &searchDir,
+ const QString &name)
+{
+ QString doxyDocDir(defaultDir);
+ doxyDocDir = URLUtil::envExpand(doxyDocDir);
+ if (doxyDocDir.isEmpty())
+ {
+ QStringList apiDirs = DocDoxygenPluginFactory::instance()->dirs()->findDirs("html", searchDir);
+ for (QStringList::const_iterator it = apiDirs.begin(); it != apiDirs.end(); ++it )
+ {
+ doxyDocDir = *it;
+ QString indexFile = doxyDocDir + "index.html";
+ if (QFile::exists(indexFile))
+ {
+ doxyDocDir = doxyDocDir + "/" + searchDir;
+ break;
+ }
+ doxyDocDir = "";
+ }
+ }
+ if (!doxyDocDir.isEmpty())
+ {
+ config->setGroup("Search Settings");
+ config->writeEntry(name, true);
+ config->setGroup("Index Settings");
+ config->writeEntry(name, true);
+ config->setGroup("Locations");
+ config->writePathEntry(name, doxyDocDir + QString("/index.html"));
+ }
+}
+
+void DocDoxygenPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* item)
+{
+ QFileInfo fi(item->url().path());
+ if (!fi.exists())
+ return;
+
+ DoxyDocumentationCatalogItem *doxyItem = dynamic_cast<DoxyDocumentationCatalogItem*>(item);
+ if (!doxyItem)
+ return;
+
+ //doxygen documentation mode (if catalog points to a .tag)
+ if (doxyItem->origUrl().endsWith("tag"))
+ {
+ QString htmlUrl;
+ QFileInfo fi2(item->url().directory(false) + "index.html");
+ if (fi2.exists())
+ htmlUrl = fi2.dirPath(true) + "/";
+ QFileInfo fi(item->url().directory(false) + "html/index.html");
+ if (fi.exists())
+ htmlUrl = fi.dirPath(true) + "/";
+
+ createBookIndex(doxyItem->origUrl(), index, item, htmlUrl);
+ }
+
+ //KDE doxygen documentation mode (if catalog points to a index.html)
+ QDir d;
+ QValueStack<QString> dirStack;
+ dirStack.push(fi.dirPath(true));
+ do {
+ d.setPath(dirStack.pop());
+ if (!d.exists())
+ continue;
+
+ const QFileInfoList *dirEntries = d.entryInfoList();
+ if (!dirEntries) continue;
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it)
+ {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == ".." || fileName == "common" || fileName == "html")
+ continue;
+ if (it.current()->isDir())
+ dirStack.push(it.current()->absFilePath());
+ }
+
+ if (QFile::exists(d.absPath() + "/html/index.html"))
+ createBookIndex(d.absPath() + "/" + d.dirName() + ".tag", index, item);
+ } while (!dirStack.isEmpty());
+}
+
+void DocDoxygenPlugin::createTOC(DocumentationCatalogItem* item)
+{
+ QFileInfo fi(item->url().path());
+ if (!fi.exists())
+ return;
+
+ DoxyDocumentationCatalogItem *doxyItem = dynamic_cast<DoxyDocumentationCatalogItem*>(item);
+ if (!doxyItem)
+ return;
+
+ //doxygen documentation mode (if catalog points to a .tag)
+ if (doxyItem->origUrl().endsWith("tag"))
+ {
+ QString htmlUrl;
+ QFileInfo fi2(item->url().directory(false) + "index.html");
+ if (fi2.exists())
+ htmlUrl = fi2.dirPath(true) + "/";
+ QFileInfo fi(item->url().directory(false) + "html/index.html");
+ if (fi.exists())
+ htmlUrl = fi.dirPath(true) + "/";
+ if (!htmlUrl.isEmpty())
+ createBookTOC(item, doxyItem->origUrl(), htmlUrl);
+ }
+
+ //KDE doxygen documentation mode (if catalog points to a index.html)
+ QDir d;
+ QValueStack<QString> dirStack;
+ dirStack.push(fi.dirPath(true));
+ do {
+ d.setPath(dirStack.pop());
+ if (!d.exists())
+ continue;
+
+ const QFileInfoList *dirEntries = d.entryInfoList();
+ if (!dirEntries) continue;
+ QPtrListIterator<QFileInfo> it(*dirEntries);
+ for (; it.current(); ++it)
+ {
+ QString fileName = it.current()->fileName();
+ if (fileName == "." || fileName == ".." || fileName == "common" || fileName == "html")
+ continue;
+ if (it.current()->isDir())
+ dirStack.push(it.current()->absFilePath());
+ }
+
+ if (QFile::exists(d.absPath() + "/html/index.html"))
+ {
+ DocumentationItem *docItem = new DocumentationItem(DocumentationItem::Book, item, d.dirName());
+ docItem->setURL(KURL(d.absPath() + "/html/index.html"));
+ docItem->setExpandable(true);
+ createBookTOC(docItem);
+ }
+ } while (!dirStack.isEmpty());
+}
+
+DocumentationCatalogItem *DocDoxygenPlugin::createCatalog(KListView *contents, const QString &title, const QString &url)
+{
+ kdDebug() << "DocDoxygenPlugin::createCatalog: url=" << url << endl;
+ DocumentationCatalogItem *item = new DoxyDocumentationCatalogItem(url, this, contents, title);
+ item->setURL(url);
+ return item;
+}
+
+void DocDoxygenPlugin::createBookTOC(DocumentationItem *item, const QString &tagUrl, const QString &baseHtmlUrl)
+{
+ QString tagName;
+ if (tagUrl.isEmpty())
+ tagName = item->url().upURL().directory(false) + item->text(0) + ".tag";
+ else
+ tagName = tagUrl;
+
+ QString baseUrl;
+ if (baseHtmlUrl.isEmpty())
+ baseUrl = item->url().directory(false);
+ else
+ baseUrl = baseHtmlUrl;
+
+ //@todo list html files in the directory if tag was not found
+ if (!QFile::exists(tagName))
+ return;
+
+ QStringList tagFileList;
+ if (tagName.endsWith(".tag"))
+ tagFileList = tagFiles(QFileInfo(tagName).dirPath() + "/");
+ else
+ tagFileList += tagName;
+
+ QStringList::ConstIterator end = tagFileList.constEnd();
+ for (QStringList::ConstIterator it = tagFileList.constBegin(); it != end; ++it)
+ {
+ QFile f(*it);
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not open tag file: " << f.name() << endl;
+ return;
+ }
+
+ QDomDocument dom;
+ if (!dom.setContent(&f) || dom.documentElement().nodeName() != "tagfile")
+ {
+ kdDebug(9002) << "No valid tag file" << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = dom.documentElement();
+
+ QDomElement childEl = docEl.lastChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "compound" && childEl.attribute("kind") == "class")
+ {
+ QString classname = childEl.namedItem("name").firstChild().toText().data();
+ QString filename = childEl.namedItem("filename").firstChild().toText().data();
+
+ if (QFile::exists(baseUrl + filename))
+ {
+ DocumentationItem *docItem = new DocumentationItem(DocumentationItem::Document,
+ item, classname);
+ docItem->setURL(KURL(baseUrl + filename));
+ }
+ }
+ childEl = childEl.previousSibling().toElement();
+ }
+ }
+}
+
+void DocDoxygenPlugin::createBookIndex(const QString &tagfile, IndexBox* index, DocumentationCatalogItem* item, const QString &baseHtmlUrl)
+{
+ QString tagName = tagfile;
+ kdDebug() << tagfile << endl;
+ if (!QFile::exists(tagName))
+ return;
+ QString prefix = baseHtmlUrl.isEmpty() ? KURL(tagfile).directory(false) + "html/" : baseHtmlUrl;
+
+ QStringList tagFileList = tagFiles(QFileInfo(tagName).dirPath() + "/");
+
+ QStringList::ConstIterator end = tagFileList.constEnd();
+ for (QStringList::ConstIterator it = tagFileList.constBegin(); it != end; ++it)
+ {
+ QFile f(*it);
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not open tag file: " << f.name() << endl;
+ return;
+ }
+
+ QDomDocument dom;
+ if (!dom.setContent(&f) || dom.documentElement().nodeName() != "tagfile")
+ {
+ kdDebug(9002) << "No valid tag file" << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = dom.documentElement();
+ createIndexFromTag(dom, index, item, docEl, prefix);
+ }
+}
+
+void DocDoxygenPlugin::createIndexFromTag(QDomDocument &dom, IndexBox *index,
+ DocumentationCatalogItem *item, QDomElement &parentEl, const QString &prefix)
+{
+ QDomElement docEl = parentEl;
+
+ QDomElement childEl = docEl.firstChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "compound" &&
+ ((childEl.attribute("kind") == "class")
+ || (childEl.attribute("kind") == "struct")
+ || (childEl.attribute("kind") == "namespace") ))
+ {
+ QString classname = childEl.namedItem("name").firstChild().toText().data();
+ QString filename = childEl.namedItem("filename").firstChild().toText().data();
+
+ IndexItemProto *indexItem = new IndexItemProto(this, item, index, classname,
+ i18n("%1 Class Reference").arg(classname));
+ indexItem->addURL(KURL(prefix + filename));
+
+ createIndexFromTag(dom, index, item, childEl, prefix + filename);
+ }
+ else if ((childEl.tagName() == "member") &&
+ ((childEl.attribute("kind") == "function")
+ || (childEl.attribute("kind") == "slot")
+ || (childEl.attribute("kind") == "signal") ))
+ {
+ QString classname = parentEl.namedItem("name").firstChild().toText().data();
+ QString membername = childEl.namedItem("name").firstChild().toText().data();
+ QString anchor = childEl.namedItem("anchor").firstChild().toText().data();
+ QString arglist = childEl.namedItem("arglist").firstChild().toText().data();
+
+ if (classname != membername)
+ {
+ IndexItemProto *indexItem = new IndexItemProto(this, item, index, membername,i18n("%1::%2%3 Member Reference").arg(classname).arg(membername).arg(arglist));
+ indexItem->addURL(KURL(prefix + "#" + anchor));
+ }
+ }
+ childEl = childEl.nextSibling().toElement();
+ }
+}
+
+ProjectDocumentationPlugin *DocDoxygenPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == APIDocs)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
+
+QStringList DocDoxygenPlugin::tagFiles(const QString& path, int level)
+{
+ QStringList r;
+ QDir dir(path);
+ if (level > 10) return r;
+ if (!dir.isReadable()) return r;
+ if (!dir.exists()) return r;
+
+ QStringList dirList;
+ QStringList fileList;
+ QStringList::Iterator it;
+
+ dir.setFilter ( QDir::Dirs);
+ dirList = dir.entryList();
+
+ dirList.remove(".");
+ dirList.remove("..");
+
+ dir.setFilter(QDir::Files | QDir::Hidden | QDir::System);
+ fileList = dir.entryList();
+ QStringList::Iterator end = dirList.end();
+ for ( it = dirList.begin(); it != end; ++it )
+ {
+ QString name = *it;
+ if (QFileInfo( dir, *it ).isSymLink())
+ continue;
+ r += tagFiles(path + name + "/", level + 1 );
+ }
+
+ QStringList::Iterator fend = fileList.end();
+ for ( it = fileList.begin(); it != fend; ++it )
+ {
+ QString name = *it;
+ QFileInfo fi( dir, *it );
+ if (fi.isSymLink() || !fi.isFile())
+ continue;
+
+ if (QDir::match(QString("*.tag"), name))
+ r += (path+name);
+ }
+
+ return r;
+}
+
+#include "docdoxygenplugin.moc"
diff --git a/parts/documentation/plugins/doxygen/docdoxygenplugin.desktop b/parts/documentation/plugins/doxygen/docdoxygenplugin.desktop
new file mode 100644
index 00000000..57bb4262
--- /dev/null
+++ b/parts/documentation/plugins/doxygen/docdoxygenplugin.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Service
+Name=DocDoxygenPlugin
+Name[da]=DocDoxygen-plugin
+Name[ms]=PluginDocDoxygen
+Name[sk]=Doc Doxygen modul
+Name[sv]=Doxygen-dokumentationsinsticksmodul
+Name[ta]=DocDoxygen சொருகு
+Name[zh_TW]=Doxygen 文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for Doxygen documentation
+Comment[ca]=Connector de documentació per a documentació Doxygen
+Comment[da]=Dokumentations-plugin for Doxygen-dokumentation
+Comment[de]=Komponente für Doxygen-Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση τύπου Doxygen
+Comment[es]=Complemento de documentación para Doxygen
+Comment[et]=Doxygeni dokumentatsiooni plugin
+Comment[eu]=Doxygen dokumentaziorako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای مستندات Doxygen
+Comment[fr]=Module externe de documentation pour la documentation Doxygen
+Comment[gl]=Extensión de documentación para documentación Doxygen
+Comment[hu]=Dokumentációmodul Doxygen-dokumentációhoz
+Comment[it]=Plugin di documentazione per file di Doxygen
+Comment[ja]=Doxygen ドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk dokumentasi Doxygen
+Comment[nds]=Dokmentatschoon-Moduul för Doxygen-Dokmentatschoon
+Comment[ne]=Doxygen मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor Doxygen documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie Doxygen
+Comment[pt]='Plugin' para documentação Doxygen
+Comment[pt_BR]=Plug-in de documentação para documento Doxygen
+Comment[ru]=Модуль для просмотра документации Doxygen
+Comment[sk]=Dokumentačný modul pre Doxygen dokumentáciu
+Comment[sl]=Dokumentacijski vstavek za dokumentacijo Doxygen
+Comment[sr]=Документациони прикључак за Doxygen документацију
+Comment[sr@Latn]=Dokumentacioni priključak za Doxygen dokumentaciju
+Comment[sv]=Dokumentationsinsticksmodul för Doxygen-dokumentation
+Comment[ta]= Doxygen ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиш намудани ҳуҷҷатҳо дар Doxygen
+Comment[tr]=Doxygen belgelendirmesi için belgelendirme eklentisi
+Comment[zh_CN]=Doxygen 文档的文档插件
+Comment[zh_TW]=Doxygen 文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdocdoxygenplugin
diff --git a/parts/documentation/plugins/doxygen/docdoxygenplugin.h b/parts/documentation/plugins/doxygen/docdoxygenplugin.h
new file mode 100644
index 00000000..fbd7e56f
--- /dev/null
+++ b/parts/documentation/plugins/doxygen/docdoxygenplugin.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCDOXYGENPLUGIN_H
+#define DOCDOXYGENPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class QDomDocument;
+class QDomElement;
+
+class DocDoxygenPlugin: public DocumentationPlugin
+{
+ Q_OBJECT
+public:
+ DocDoxygenPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocDoxygenPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem *createCatalog(KListView *contents, const QString &title, const QString &url);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString& url);
+
+ virtual void autoSetupPlugin();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+
+protected:
+ void createBookTOC(DocumentationItem* item, const QString &tagUrl = QString::null,
+ const QString &baseHtmlUrl = QString::null);
+ void createBookIndex(const QString &tagfile, IndexBox* index, DocumentationCatalogItem* item, const QString &baseHtmlUrl = QString::null);
+
+ void createIndexFromTag(QDomDocument &dom, IndexBox* index, DocumentationCatalogItem* item,
+ QDomElement &parentEl, const QString &prefix);
+
+ void autoSetupDocs(const QString &defaultDir, const QString &searchDir,
+ const QString &name);
+
+ /**
+ * Returns all the tag files from a directory and its subdirectories.
+ * @param startDir the directory to start with
+ * @param level the depth of the current search
+ * @return a list with the absolute path to the ".tag" files in startDir
+ */
+ QStringList tagFiles(const QString &startDir, int level = 0);
+};
+
+
+#endif
diff --git a/parts/documentation/plugins/kdevtoc/Makefile.am b/parts/documentation/plugins/kdevtoc/Makefile.am
new file mode 100644
index 00000000..a40dd995
--- /dev/null
+++ b/parts/documentation/plugins/kdevtoc/Makefile.am
@@ -0,0 +1,10 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdockdevtocplugin.la
+libdockdevtocplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+kde_services_DATA = dockdevtocplugin.desktop
+noinst_HEADERS = dockdevtocplugin.h
+libdockdevtocplugin_la_SOURCES = dockdevtocplugin.cpp
+libdockdevtocplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
new file mode 100644
index 00000000..65ebf35f
--- /dev/null
+++ b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
@@ -0,0 +1,277 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "dockdevtocplugin.h"
+
+#include <unistd.h>
+
+#include <qdom.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdialog.h>
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kstandarddirs.h>
+
+#include <urlutil.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "../../../../config.h"
+
+class TOCDocumentationCatalogItem: public DocumentationCatalogItem
+{
+public:
+ TOCDocumentationCatalogItem(const QString &tocFile, DocumentationPlugin* plugin,
+ KListView *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
+ {
+ }
+ TOCDocumentationCatalogItem(const QString &tocFile, DocumentationPlugin* plugin,
+ DocumentationItem *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
+ {
+ }
+ QString tocFile() const { return m_tocFile; }
+
+private:
+ QString m_tocFile;
+};
+
+
+static const KDevPluginInfo data("dockdevtocplugin");
+typedef KDevGenericFactory<DocKDevTOCPlugin> DocKDevTOCPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdockdevtocplugin, DocKDevTOCPluginFactory(data) )
+
+DocKDevTOCPlugin::DocKDevTOCPlugin(QObject* parent, const char* name,
+ const QStringList /*args*/)
+ :DocumentationPlugin(DocKDevTOCPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(Index);
+ autoSetup();
+}
+
+DocKDevTOCPlugin::~DocKDevTOCPlugin()
+{
+}
+
+QString DocKDevTOCPlugin::pluginName() const
+{
+ return i18n("KDevelopTOC Documentation Collection");
+}
+
+DocumentationCatalogItem* DocKDevTOCPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ return new TOCDocumentationCatalogItem(url, this, contents, title);
+}
+
+QPair<KFile::Mode, QString> DocKDevTOCPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "*.toc");
+}
+
+QString DocKDevTOCPlugin::catalogTitle(const QString& url)
+{
+ QFileInfo fi(url);
+ if (!fi.exists())
+ return QString::null;
+
+ QFile f(url);
+ if (!f.open(IO_ReadOnly))
+ return QString::null;
+
+ QDomDocument doc;
+ if (!doc.setContent(&f) || (doc.doctype().name() != "kdeveloptoc"))
+ return QString::null;
+ f.close();
+
+ QDomElement titleEl = doc.documentElement().namedItem("title").toElement();
+
+ return titleEl.firstChild().toText().data();
+}
+
+
+QStringList DocKDevTOCPlugin::fullTextSearchLocations()
+{
+ return QStringList();
+}
+
+bool DocKDevTOCPlugin::needRefreshIndex(DocumentationCatalogItem* /*item*/)
+{
+ return false;
+}
+
+void DocKDevTOCPlugin::autoSetupPlugin()
+{
+ QStringList tocsDir = DocKDevTOCPluginFactory::instance()->dirs()->findAllResources("data", "kdevdocumentation/tocs/*.toc");
+
+ for (QStringList::const_iterator it = tocsDir.begin(); it != tocsDir.end(); ++it)
+ {
+ config->setGroup("Locations");
+ config->writePathEntry(catalogTitle(*it), *it);
+ }
+}
+
+void DocKDevTOCPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* item)
+{
+ TOCDocumentationCatalogItem *tocItem = dynamic_cast<TOCDocumentationCatalogItem *>(item);
+ if (!tocItem)
+ return;
+
+ QFileInfo fi(tocItem->tocFile());
+
+ QFile f(tocItem->tocFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
+ {
+ kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement baseEl = docEl.namedItem("base").toElement();
+
+ QString base;
+ if (!baseEl.isNull())
+ base = baseEl.attribute("href", QString::null);
+
+ QDomElement indexEl = docEl.namedItem("index").toElement();
+ QDomElement childEl = indexEl.firstChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "entry")
+ {
+ QString name = childEl.attribute("name");
+ QString url = childEl.attribute("url");
+
+ IndexItemProto *ii = new IndexItemProto(this, item, index, name, item->text(0));
+ ii->addURL(KURL(constructURL(base, url)));
+ }
+ childEl = childEl.nextSibling().toElement();
+ }
+}
+
+void DocKDevTOCPlugin::createTOC(DocumentationCatalogItem* item)
+{
+ TOCDocumentationCatalogItem *tocItem = dynamic_cast<TOCDocumentationCatalogItem *>(item);
+ if (!tocItem)
+ return;
+
+ QFileInfo fi(tocItem->tocFile());
+
+ QFile f(tocItem->tocFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
+ {
+ kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement baseEl = docEl.namedItem("base").toElement();
+
+ QString base;
+ if (!baseEl.isNull())
+ base = baseEl.attribute("href", QString::null);
+
+ QDomElement childEl = docEl.lastChild().toElement();
+ addTocSect(tocItem, childEl, base, 1);
+}
+
+void DocKDevTOCPlugin::addTocSect(DocumentationItem *parent, QDomElement childEl, const QString &base, uint level)
+{
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == QString("tocsect%1").arg(level))
+ {
+ QString name = childEl.attribute("name");
+ QString url = childEl.attribute("url");
+
+ DocumentationItem *item = new DocumentationItem(level == 1 ? DocumentationItem::Book : DocumentationItem::Document, parent, name);
+ item->setURL(KURL(constructURL(base, url)));
+
+ QDomElement grandchildEl = childEl.lastChild().toElement();
+ addTocSect(item, grandchildEl, base, level+1);
+ }
+ childEl = childEl.previousSibling().toElement();
+ }
+}
+
+void DocKDevTOCPlugin::setCatalogURL(DocumentationCatalogItem* item)
+{
+ TOCDocumentationCatalogItem *tocItem = dynamic_cast<TOCDocumentationCatalogItem *>(item);
+ if (!tocItem)
+ return;
+
+ QFileInfo fi(tocItem->tocFile());
+
+ QFile f(tocItem->tocFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
+ {
+ kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement baseEl = docEl.namedItem("base").toElement();
+
+ if (item->url().isEmpty())
+ {
+ if (baseEl.isNull())
+ item->setURL(KURL());
+ else
+ item->setURL(KURL(constructURL(baseEl.attribute("href", QString::null),
+ baseEl.attribute("url", QString::null))));
+ }
+}
+
+QString DocKDevTOCPlugin::constructURL(const QString &base, const QString &url)
+{
+ if (base.isEmpty() && !url.isEmpty())
+ return url;
+ if (!url.isEmpty())
+ return base.endsWith("/") ? base + url : base + "/" + url;
+ else
+ return base;
+}
+
+#include "dockdevtocplugin.moc"
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop
new file mode 100644
index 00000000..d665e9af
--- /dev/null
+++ b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Type=Service
+Name=DocKDevTOCPlugin
+Name[da]=DocKDevTOC-plugin
+Name[sk]=Doc KDevTOC modul
+Name[sv]=KDevelop innehållsförteckning-dokumentationsinsticksmodul
+Name[ta]=DocKDevTOC சொருகு
+Name[zh_TW]=KDevelop 目錄文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for KDevelopTOC documentation
+Comment[ca]=Connector de documentació per a documentació KDevelopTOC
+Comment[da]=Dokumentations-plugin for KDevelopTOC-dokumentation
+Comment[de]=Komponente für KDevelopTOC-Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση τύπου KDevelopTOC
+Comment[es]=Complemento de documentación para KDevelopTOC
+Comment[et]=KDevelopTOC dokumentatsiooni plugin
+Comment[eu]=KDevelopTOC dokumentaziorako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای مستندات KDevelopTOC
+Comment[fr]=Module externe de documentation pour la documentation KDevelopTOC
+Comment[gl]=Extensión de documentación para documentación KDevelopTOC
+Comment[hu]=Dokumentációmodul KDevelopTOC-dokumentációhoz
+Comment[it]=Plugin di documentazione per file di KDevelopTOC
+Comment[ja]=KDevelopTOC ドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk dokumentasi KDevelopTOC
+Comment[nds]=Dokmentatschoon-Moduul för KDevelopTOC-Dokmentatschoon
+Comment[ne]=KDevelopTOC मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin for KDevelopTOC documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie KDevelopTOC
+Comment[pt]='Plugin' para documentação KDevelopTOC
+Comment[pt_BR]=Plug-in de documentação para document TOC do KDevelop
+Comment[ru]=Модуль для просмотра KDevelopTOC
+Comment[sk]=Dokumentačný modul pre KDevelopTOC dokumentáciu
+Comment[sr]=Документациони прикључак за KDevelopTOC документацију
+Comment[sr@Latn]=Dokumentacioni priključak za KDevelopTOC dokumentaciju
+Comment[sv]=Dokumentationsinsticksmodul för KDevelop innehållsförteckningsdokumentation
+Comment[ta]= KDevelopTOC ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиши KDevelopTOC
+Comment[tr]=KDevelopTOC belgelendirmesi için belgelendirme eklentisi
+Comment[zh_CN]=KDevelopTOC 文档的文档插件
+Comment[zh_TW]=KDevelop 目錄文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdockdevtocplugin
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h
new file mode 100644
index 00000000..4a958473
--- /dev/null
+++ b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCKDEVTOCPLUGIN_H
+#define DOCKDEVTOCPLUGIN_H
+
+#include <qdom.h>
+
+#include <kdevdocumentationplugin.h>
+
+class DocKDevTOCPlugin : public DocumentationPlugin
+{
+ Q_OBJECT
+public:
+ DocKDevTOCPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocKDevTOCPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual QString catalogTitle(const QString& url);
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString > catalogLocatorProps();
+ virtual void autoSetupPlugin();
+
+protected:
+ void addTocSect(DocumentationItem *parent, QDomElement childEl, const QString &base, uint level);
+ static QString constructURL(const QString &base, const QString &url) ;
+};
+
+#endif
diff --git a/parts/documentation/plugins/pdb/Makefile.am b/parts/documentation/plugins/pdb/Makefile.am
new file mode 100644
index 00000000..4d015e3c
--- /dev/null
+++ b/parts/documentation/plugins/pdb/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdocpdbplugin.la
+libdocpdbplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdocpdbplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+noinst_HEADERS = docpdbplugin.h
+libdocpdbplugin_la_SOURCES = docpdbplugin.cpp
+kde_services_DATA = docpdbplugin.desktop
diff --git a/parts/documentation/plugins/pdb/docpdbplugin.cpp b/parts/documentation/plugins/pdb/docpdbplugin.cpp
new file mode 100644
index 00000000..5c2f68c7
--- /dev/null
+++ b/parts/documentation/plugins/pdb/docpdbplugin.cpp
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docpdbplugin.h"
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+
+#include <kdevgenericfactory.h>
+
+static const KAboutData data("docpdbplugin", I18N_NOOP("PalmDoc documentation plugin"), "1.0");
+typedef KDevGenericFactory<DocPDBPlugin> DocPDBPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocpdbplugin, DocPDBPluginFactory(&data) )
+
+DocPDBPlugin::DocPDBPlugin(QObject* parent, const char* name, const QStringList args)
+ :DocumentationPlugin(DocPDBPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(CustomDocumentationTitles | ProjectUserManual);
+ autoSetup();
+}
+
+DocPDBPlugin::~DocPDBPlugin()
+{
+}
+
+bool DocPDBPlugin::needRefreshIndex(DocumentationCatalogItem* item)
+{
+ return false;
+}
+
+QString DocPDBPlugin::pluginName() const
+{
+ return i18n("PalmDoc Documentation Collection");
+}
+
+DocumentationCatalogItem* DocPDBPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
+ item->setURL(KURL(url));
+ return item;
+}
+
+QPair<KFile::Mode, QString> DocPDBPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "all/allfiles");
+}
+
+QString DocPDBPlugin::catalogTitle(const QString& /*url*/)
+{
+ return QString::null;
+}
+
+QStringList DocPDBPlugin::fullTextSearchLocations()
+{
+ return QStringList();
+}
+
+
+void DocPDBPlugin::autoSetupPlugin()
+{
+ return;
+}
+
+void DocPDBPlugin::createIndex(IndexBox* /*index*/, DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocPDBPlugin::createTOC(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocPDBPlugin::setCatalogURL(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+ProjectDocumentationPlugin *DocPDBPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == UserManual)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
diff --git a/parts/documentation/plugins/pdb/docpdbplugin.desktop b/parts/documentation/plugins/pdb/docpdbplugin.desktop
new file mode 100644
index 00000000..76630793
--- /dev/null
+++ b/parts/documentation/plugins/pdb/docpdbplugin.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Type=Service
+Name=DocPDBPlugin
+Name[da]=DocPDB-plugin
+Name[sk]=Doc PDB modul
+Name[sv]=DocPDB-insticksmodul
+Name[ta]=DocQt சொருகு
+Name[zh_TW]=PDB 文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for Palmdoc format
+Comment[ca]=Connector de documentació per al format Palmdoc
+Comment[da]=Dokumentations-plugin for Palmdoc-format
+Comment[de]=Komponente für das Palmdoc-Dokumentationsformat
+Comment[el]=Πρόσθετο τεκμηρίωσης για τη μορφή Palmdoc
+Comment[es]=Complemento de documentación para el formato Palmdoc
+Comment[et]=PalmDOC-vormingus dokumentatsiooni plugin
+Comment[eu]=Palmdoc formaturako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای قالب Palmdoc
+Comment[fr]=Module externe de documentation pour le format Palmdoc
+Comment[gl]=Extensión de documentación para o formato Palmdoc
+Comment[hu]=Dokumentációmodul Palmdoc formátumú dokumentációhoz
+Comment[it]=Plugin di documentazione per il formato Palmdoc
+Comment[ja]=Palmdoc フォーマットのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk format Palmdoc
+Comment[nds]=Komponente för dat Palmdoc-Dokmentatschoonformaat
+Comment[ne]=Palmdoc ढाँचाका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor Palmdoc documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie Palmdoc
+Comment[pt]='Plugin' para documentação no formato Palmdoc
+Comment[pt_BR]=Plug-in de documentação para o formato Palmdoc
+Comment[ru]=Модуль для просмотра документации в формате Palmdoc
+Comment[sk]=Dokumentačný modul pre Palmdoc formát
+Comment[sr]=Документациони прикључак за Palmdoc формат
+Comment[sr@Latn]=Dokumentacioni priključak za Palmdoc format
+Comment[sv]=Dokumentationsinsticksmodul för Palmdoc-format
+Comment[ta]= CHM ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиш намудани ҳуҷҷатҳо дар формати Palmdoc
+Comment[tr]=Palmdoc biçimi için belgelendirme eklentisi
+Comment[zh_CN]=Palmdoc 格式的文档插件
+Comment[zh_TW]=Palmdoc 格式文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=1
+X-KDE-Library=libdocpdbplugin
diff --git a/parts/documentation/plugins/pdb/docpdbplugin.h b/parts/documentation/plugins/pdb/docpdbplugin.h
new file mode 100644
index 00000000..cdb9e90f
--- /dev/null
+++ b/parts/documentation/plugins/pdb/docpdbplugin.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCPDBPLUGIN_H
+#define DOCPDBPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class DocPDBPlugin : public DocumentationPlugin {
+public:
+ DocPDBPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocPDBPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString& url);
+
+ virtual void autoSetupPlugin();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+};
+
+#endif
diff --git a/parts/documentation/plugins/pdf/Makefile.am b/parts/documentation/plugins/pdf/Makefile.am
new file mode 100644
index 00000000..8d9617d2
--- /dev/null
+++ b/parts/documentation/plugins/pdf/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libdocpdfplugin.la
+libdocpdfplugin_la_LDFLAGS = $(all_libraries)
+libdocpdfplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+noinst_HEADERS = docpdfplugin.h
+libdocpdfplugin_la_SOURCES = docpdfplugin.cpp
+kde_services_DATA = docpdfplugin.desktop
diff --git a/parts/documentation/plugins/pdf/docpdfplugin.cpp b/parts/documentation/plugins/pdf/docpdfplugin.cpp
new file mode 100644
index 00000000..02bac373
--- /dev/null
+++ b/parts/documentation/plugins/pdf/docpdfplugin.cpp
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docpdfplugin.h"
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+
+#include <kdevgenericfactory.h>
+
+static const KAboutData data("docpdfplugin", I18N_NOOP("PDF documentation plugin"), "1.0");
+typedef KDevGenericFactory<DocPDFPlugin> DocPDFPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocpdfplugin, DocPDFPluginFactory(&data) )
+
+DocPDFPlugin::DocPDFPlugin(QObject* parent, const char* name, const QStringList args)
+ :DocumentationPlugin(DocPDFPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(CustomDocumentationTitles | ProjectUserManual);
+ autoSetup();
+}
+
+DocPDFPlugin::~DocPDFPlugin()
+{
+}
+
+bool DocPDFPlugin::needRefreshIndex(DocumentationCatalogItem* item)
+{
+ return false;
+}
+
+QString DocPDFPlugin::pluginName() const
+{
+ return i18n("PDF Documentation Collection");
+}
+
+DocumentationCatalogItem* DocPDFPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+{
+ DocumentationCatalogItem *item = new DocumentationCatalogItem(this, contents, title);
+ item->setURL(KURL(url));
+ return item;
+}
+
+QPair<KFile::Mode, QString> DocPDFPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "*.pdf");
+}
+
+QString DocPDFPlugin::catalogTitle(const QString& /*url*/)
+{
+ return QString::null;
+}
+
+QStringList DocPDFPlugin::fullTextSearchLocations()
+{
+ return QStringList();
+}
+
+
+void DocPDFPlugin::autoSetupPlugin()
+{
+ return;
+}
+
+void DocPDFPlugin::createIndex(IndexBox* /*index*/, DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocPDFPlugin::createTOC(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+void DocPDFPlugin::setCatalogURL(DocumentationCatalogItem* /*item*/)
+{
+ return;
+}
+
+ProjectDocumentationPlugin *DocPDFPlugin::projectDocumentationPlugin(ProjectDocType type)
+{
+ if (type == UserManual)
+ return new ProjectDocumentationPlugin(this, type);
+ return DocumentationPlugin::projectDocumentationPlugin(type);
+}
diff --git a/parts/documentation/plugins/pdf/docpdfplugin.desktop b/parts/documentation/plugins/pdf/docpdfplugin.desktop
new file mode 100644
index 00000000..f42429ff
--- /dev/null
+++ b/parts/documentation/plugins/pdf/docpdfplugin.desktop
@@ -0,0 +1,43 @@
+[Desktop Entry]
+Type=Service
+Name=DocPDFPlugin
+Name[da]=DocPDF-plugin
+Name[sk]=Doc PDF modul
+Name[sv]=DocPDF-insticksmodul
+Name[ta]=DocQt சொருகுபொருள்
+Name[zh_TW]=PDF 文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for PDF format
+Comment[ca]=Connector de documentació per al format PDF
+Comment[da]=Dokumentations-plugin for PDF-format
+Comment[de]=Komponente für das PDF-Dokumentationsformat
+Comment[el]=Πρόσθετο τεκμηρίωσης για τη μορφή PDF
+Comment[es]=Complemento de documentación para el formato PDF
+Comment[et]=PDF-vormingus dokumentatsiooni plugin
+Comment[eu]=PDF formaturako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای قالب PDF
+Comment[fr]=Module externe de documentation pour le format PDF
+Comment[gl]=Extensión de documentación para o formato PDF
+Comment[hu]=Dokumentációmodul PDF formátumú dokumentációhoz
+Comment[it]=Plugin di documentazione per formato PDF
+Comment[ja]=PDF フォーマットのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk format PDF
+Comment[nds]=Komponente för dat PDF-Dokmentatschoonformaat
+Comment[ne]=PDF ढाँचाका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor PDF documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie PDF
+Comment[pt]='Plugin' para documentação no formato PDF
+Comment[pt_BR]=Plug-in de documentação para o formato PDF
+Comment[ru]=Модуль для просмотра PDF
+Comment[sk]=Dokumentačný modul pre PDF formát
+Comment[sr]=Документациони прикључак за PDF формат
+Comment[sr@Latn]=Dokumentacioni priključak za PDF format
+Comment[sv]=Dokumentationsinsticksmodul för PDF-format
+Comment[ta]= Qt DCF ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиши PDF
+Comment[tr]=PDF biçimi için belgelendirme eklentisi
+Comment[zh_CN]=PDF 格式的文档插件
+Comment[zh_TW]=PDF 格式文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=1
+X-KDE-Library=libdocpdfplugin
diff --git a/parts/documentation/plugins/pdf/docpdfplugin.h b/parts/documentation/plugins/pdf/docpdfplugin.h
new file mode 100644
index 00000000..4148454a
--- /dev/null
+++ b/parts/documentation/plugins/pdf/docpdfplugin.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Mathieu Chouinard *
+ * mathieu.chouinard@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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCPDFPLUGIN_H
+#define DOCPDFPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+
+class DocPDFPlugin : public DocumentationPlugin {
+public:
+ DocPDFPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocPDFPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem* createCatalog(KListView* contents, const QString& title, const QString& url);
+
+ virtual void createTOC(DocumentationCatalogItem* item);
+ virtual void setCatalogURL(DocumentationCatalogItem* item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem* item);
+ virtual void createIndex(IndexBox* index, DocumentationCatalogItem* item);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString& url);
+
+ virtual void autoSetupPlugin();
+
+ virtual ProjectDocumentationPlugin *projectDocumentationPlugin(ProjectDocType type);
+};
+
+#endif
diff --git a/parts/documentation/plugins/qt/Makefile.am b/parts/documentation/plugins/qt/Makefile.am
new file mode 100644
index 00000000..a25419e7
--- /dev/null
+++ b/parts/documentation/plugins/qt/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/parts/documentation/interfaces $(all_includes)
+
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libdocqtplugin.la
+
+noinst_HEADERS = docqtplugin.h
+kde_services_DATA = docqtplugin.desktop
+
+libdocqtplugin_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
+libdocqtplugin_la_SOURCES = docqtplugin.cpp
+libdocqtplugin_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/parts/documentation/interfaces/libdocumentation_interfaces.la
diff --git a/parts/documentation/plugins/qt/docqtplugin.cpp b/parts/documentation/plugins/qt/docqtplugin.cpp
new file mode 100644
index 00000000..ffbce63a
--- /dev/null
+++ b/parts/documentation/plugins/qt/docqtplugin.cpp
@@ -0,0 +1,339 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docqtplugin.h"
+
+#include <unistd.h>
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdialog.h>
+
+#include <kurl.h>
+#include <kaboutdata.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <klistview.h>
+
+#include <urlutil.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "../../../../config.h"
+
+class QtDocumentationCatalogItem: public DocumentationCatalogItem
+{
+public:
+ QtDocumentationCatalogItem(const QString &dcfFile, DocumentationPlugin* plugin,
+ KListView *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_dcfFile(dcfFile)
+ {
+ }
+ QtDocumentationCatalogItem(const QString &dcfFile, DocumentationPlugin* plugin,
+ DocumentationItem *parent, const QString &name)
+ :DocumentationCatalogItem(plugin, parent, name), m_dcfFile(dcfFile)
+ {
+ }
+ QString dcfFile() const { return m_dcfFile; }
+
+private:
+ QString m_dcfFile;
+};
+
+static const KDevPluginInfo data("docqtplugin");
+typedef KDevGenericFactory<DocQtPlugin> DocQtPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libdocqtplugin, DocQtPluginFactory(data) )
+
+DocQtPlugin::DocQtPlugin(QObject* parent, const char* name, const QStringList)
+ :DocumentationPlugin(DocQtPluginFactory::instance()->config(), parent, name)
+{
+ setCapabilities(Index | FullTextSearch | CustomDocumentationTitles);
+ autoSetup();
+}
+
+DocQtPlugin::~DocQtPlugin()
+{
+}
+
+void DocQtPlugin::createTOC(DocumentationCatalogItem *item)
+{
+ QtDocumentationCatalogItem *qtItem = dynamic_cast<QtDocumentationCatalogItem *>(item);
+ if (!qtItem)
+ return;
+
+ QFileInfo fi(qtItem->dcfFile());
+
+ QFile f(qtItem->dcfFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << qtItem->dcfFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "DCF")
+ {
+ kdDebug(9002) << "Not a valid DCF file: " << qtItem->dcfFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement titleEl = docEl.namedItem("DCF").toElement();
+
+ QDomElement childEl = docEl.lastChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "section")
+ {
+ QString ref = childEl.attribute("ref");
+ QString title = childEl.attribute("title");
+
+ DocumentationItem *sectionItem = new DocumentationItem(DocumentationItem::Book, item, title);
+ KURL sectionUrl(fi.dirPath(true) + "/" + ref);
+ sectionItem->setURL(sectionUrl);
+
+ QDomElement grandChild = childEl.lastChild().toElement();
+ while(!grandChild.isNull())
+ {
+ if (grandChild.tagName() == "keyword")
+ {
+ QString keyRef = grandChild.attribute("ref");
+ QString keyTitle = grandChild.text();
+
+ DocumentationItem *keyItem = new DocumentationItem(DocumentationItem::Document, sectionItem, keyTitle);
+ KURL keyUrl(fi.dirPath(true) + "/" + keyRef);
+ keyItem->setURL(keyUrl);
+ }
+ if (grandChild.tagName() == "section")
+ {
+ QString keyRef = grandChild.attribute("ref");
+ QString keyTitle = grandChild.attribute("title");
+ DocumentationItem *keyItem = new DocumentationItem(DocumentationItem::Book, sectionItem, keyTitle);
+ KURL keyUrl(fi.dirPath(true) + "/" + keyRef);
+ keyItem->setURL(keyUrl);
+ }
+ grandChild = grandChild.previousSibling().toElement();
+ }
+ }
+ childEl = childEl.previousSibling().toElement();
+ }
+}
+
+void DocQtPlugin::autoSetupPlugin()
+{
+ QString qtDocDir(QT_DOCDIR);
+ qtDocDir = URLUtil::envExpand(qtDocDir);
+ if (qtDocDir.isEmpty())
+ {
+ qtDocDir = getenv("QTDIR");
+ }
+ if (!qtDocDir.isEmpty())
+ {
+ config->setGroup("Search Settings");
+ config->writeEntry("Qt Reference Documentation", true);
+ config->setGroup("Index Settings");
+ config->writeEntry("Qt Reference Documentation", true);
+ config->setGroup("Locations");
+ config->writePathEntry("Qt Reference Documentation", qtDocDir + QString("/qt.dcf"));
+ config->writePathEntry("Qt Assistant Manual", qtDocDir + QString("/assistant.dcf"));
+ config->writePathEntry("Qt Designer Manual", qtDocDir + QString("/designer.dcf"));
+ config->writePathEntry("Guide to the Qt Translation Tools", qtDocDir + QString("/linguist.dcf"));
+ config->writePathEntry("qmake User Guide", qtDocDir + QString("/qmake.dcf"));
+ }
+}
+
+void DocQtPlugin::setCatalogURL(DocumentationCatalogItem *item)
+{
+ QtDocumentationCatalogItem *qtItem = dynamic_cast<QtDocumentationCatalogItem *>(item);
+ if (!qtItem)
+ return;
+
+ QFileInfo fi(qtItem->dcfFile());
+
+ QFile f(qtItem->dcfFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << qtItem->dcfFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "DCF")
+ {
+ kdDebug(9002) << "Not a valid DCF file: " << qtItem->dcfFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement titleEl = docEl.namedItem("DCF").toElement();
+
+ if (item->url().isEmpty())
+ {
+ KURL url(fi.dirPath(true) + "/" + docEl.attribute("ref", QString::null));
+ item->setURL(url);
+ }
+}
+
+QString DocQtPlugin::pluginName() const
+{
+ return i18n("Qt Documentation Collection");
+}
+
+bool DocQtPlugin::needRefreshIndex(DocumentationCatalogItem *item)
+{
+ QtDocumentationCatalogItem *qtItem = dynamic_cast<QtDocumentationCatalogItem *>(item);
+ if (!qtItem)
+ return false;
+
+ QFileInfo fi(qtItem->dcfFile());
+ config->setGroup("Index");
+ if (fi.lastModified() > config->readDateTimeEntry(qtItem->text(0), new QDateTime()))
+ {
+ kdDebug() << "need rebuild index for " << qtItem->text(0) << endl;
+ config->writeEntry(item->text(0), fi.lastModified());
+ return true;
+ }
+ else
+ return false;
+}
+
+void DocQtPlugin::createIndex(IndexBox *index, DocumentationCatalogItem *item)
+{
+ QtDocumentationCatalogItem *qtItem = dynamic_cast<QtDocumentationCatalogItem *>(item);
+ if (!qtItem)
+ return;
+
+ QFileInfo fi(qtItem->dcfFile());
+
+ QFile f(qtItem->dcfFile());
+ if (!f.open(IO_ReadOnly))
+ {
+ kdDebug(9002) << "Could not read" << qtItem->dcfFile() << endl;
+ return;
+ }
+ QDomDocument doc;
+ if (!doc.setContent(&f) || doc.doctype().name() != "DCF")
+ {
+ kdDebug(9002) << "Not a valid DCF file: " << qtItem->dcfFile() << endl;
+ return;
+ }
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+ QDomElement titleEl = docEl.namedItem("DCF").toElement();
+
+ QDomElement childEl = docEl.firstChild().toElement();
+ while (!childEl.isNull())
+ {
+ if (childEl.tagName() == "section")
+ {
+ createSectionIndex(fi, index, item, childEl);
+ }
+ childEl = childEl.nextSibling().toElement();
+ }
+}
+
+void DocQtPlugin::createSectionIndex(QFileInfo &fi, IndexBox *index, DocumentationCatalogItem *item,
+ QDomElement section)
+{
+ //adymo: do not load section to index for Qt reference documentation
+ QString title = section.attribute("title");
+ if (fi.fileName() != "qt.dcf")
+ {
+ QString ref = section.attribute("ref");
+
+ IndexItemProto *ii = new IndexItemProto(this, item, index, title, item->text(0));
+ ii->addURL(KURL(fi.dirPath(true) + "/" + ref));
+ }
+
+ QDomElement grandChild = section.firstChild().toElement();
+ while(!grandChild.isNull())
+ {
+ if (grandChild.tagName() == "keyword")
+ {
+ QString keyRef = grandChild.attribute("ref");
+ QString keyTitle = grandChild.text();
+
+ //adymo: a little hack to avoid unwanted elements
+ if (keyRef != "qdir-example.html")
+ {
+ IndexItemProto *ii = new IndexItemProto(this, item, index, keyTitle, title);
+ ii->addURL(KURL(fi.dirPath(true) + "/" + keyRef));
+ }
+ }
+ if (grandChild.tagName() == "section")
+ {
+ createSectionIndex(fi, index, item, grandChild);
+ }
+ grandChild = grandChild.nextSibling().toElement();
+ }
+}
+
+QStringList DocQtPlugin::fullTextSearchLocations()
+{
+ QStringList locs;
+
+ QMap<QString, QString> entryMap = config->entryMap("Locations");
+
+ for (QMap<QString, QString>::const_iterator it = entryMap.begin();
+ it != entryMap.end(); ++it)
+ {
+ config->setGroup("Search Settings");
+ if (config->readBoolEntry(it.key(), false))
+ {
+ config->setGroup("Locations");
+ QFileInfo fi(config->readPathEntry(it.key()));
+ locs << fi.dirPath(true);
+ }
+ }
+
+ return locs;
+}
+
+QPair<KFile::Mode, QString> DocQtPlugin::catalogLocatorProps()
+{
+ return QPair<KFile::Mode, QString>(KFile::File, "*.xml *.dcf");
+}
+
+QString DocQtPlugin::catalogTitle(const QString &url)
+{
+ QFileInfo fi(url);
+ if (!fi.exists())
+ return QString::null;
+
+ QFile f(url);
+ if (!f.open(IO_ReadOnly))
+ return QString::null;
+
+ QDomDocument doc;
+ if (!doc.setContent(&f) || (doc.doctype().name() != "DCF"))
+ return QString::null;
+ f.close();
+
+ QDomElement docEl = doc.documentElement();
+
+ return docEl.attribute("title", QString::null);
+}
+
+DocumentationCatalogItem *DocQtPlugin::createCatalog(KListView *contents, const QString &title, const QString &url)
+{
+ return new QtDocumentationCatalogItem(url, this, contents, title);
+}
+
+#include "docqtplugin.moc"
diff --git a/parts/documentation/plugins/qt/docqtplugin.desktop b/parts/documentation/plugins/qt/docqtplugin.desktop
new file mode 100644
index 00000000..1e96eacf
--- /dev/null
+++ b/parts/documentation/plugins/qt/docqtplugin.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=DocQtPlugin
+Name[da]=DocQt-plugin
+Name[sk]=Doc Qt modul
+Name[sv]=Qt-dokumentationsinsticksmodul
+Name[ta]=DocQt சொருகு
+Name[zh_TW]=Qt 文件外掛程式
+Exec=blubb
+Comment=Documentation plugin for Qt DCF documentation
+Comment[ca]=Connector de documentació per a documentació Qt DCF
+Comment[da]=Dokumentations-plugin for Qt DCF dokumentation
+Comment[de]=Komponente für Qt-DCF-Dokumentation
+Comment[el]=Πρόσθετο τεκμηρίωσης για τεκμηρίωση τύπου Qt DCF
+Comment[es]=Complemento de documentación para Qt DCF
+Comment[et]=Qt DCF dokumentatsiooni plugin
+Comment[eu]=Qt DCF dokumentaziorako dokumentazio plugin-a
+Comment[fa]=وصلۀ مستندسازی برای مستندات Qt DCF
+Comment[fr]=Module externe de documentation pour la documentation Qt DCF
+Comment[gl]=Extensión de documentación para documentación Qt DCF
+Comment[hu]=Dokumentációmodul Qt DCF-dokumentációhoz
+Comment[it]=Plugin di documentazione per file di Qt DCF
+Comment[ja]=Qt DCF ドキュメンテーションのためのドキュメンテーションプラグイン
+Comment[ms]=Plugin dokumentasi untuk dokumentasi Qt DCF
+Comment[nds]=Dokmentatschoon-Moduul för Qt-DCF-Dokmentatschoon
+Comment[ne]=Qt DCF मिसिलीकरणका लागि मिसिलीकरण प्लगइन
+Comment[nl]=Documentatie plugin voor Qt DCF documentatie
+Comment[pl]=Wtyczka dokumentacji dla dokumentacji w formacie Qt DCF
+Comment[pt]='Plugin' para documentação Qt DCF
+Comment[pt_BR]=Plug-in de documentação para documento DCF do Qt
+Comment[ru]=Модуль для просмотра Qt DCF
+Comment[sk]=Dokumentačný modul pre Qt DCF dokumentáciu
+Comment[sl]=Vstavek dokumentacije za Qt DCF
+Comment[sr]=Документациони прикључак за Qt DCF документацију
+Comment[sr@Latn]=Dokumentacioni priključak za Qt DCF dokumentaciju
+Comment[sv]=Dokumentationsinsticksmodul för Qt DCF-dokumentation
+Comment[ta]= Qt DCF ஆவணத்திற்கான ஆவணச் சொருகு
+Comment[tg]=Модул барои наоиши QT DCF
+Comment[tr]=Qt DCF Belgelendirmesi için belgelendirme eklentisi
+Comment[zh_CN]=Qt DCF 文档的文档插件
+Comment[zh_TW]=Qt DCF 文件外掛程式
+ServiceTypes=KDevelop/DocumentationPlugins
+X-KDevelop-Version=5
+X-KDE-Library=libdocqtplugin
diff --git a/parts/documentation/plugins/qt/docqtplugin.h b/parts/documentation/plugins/qt/docqtplugin.h
new file mode 100644
index 00000000..802dd98a
--- /dev/null
+++ b/parts/documentation/plugins/qt/docqtplugin.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DOCQTPLUGIN_H
+#define DOCQTPLUGIN_H
+
+#include <kdevdocumentationplugin.h>
+#include <qdom.h>
+
+class KConfig;
+
+class DocQtPlugin : public DocumentationPlugin
+{
+ Q_OBJECT
+public:
+ DocQtPlugin(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~DocQtPlugin();
+
+ virtual QString pluginName() const;
+
+ virtual DocumentationCatalogItem *createCatalog(KListView *contents, const QString &title, const QString &url);
+
+ virtual void createTOC(DocumentationCatalogItem *item);
+ virtual void setCatalogURL(DocumentationCatalogItem *item);
+
+ virtual bool needRefreshIndex(DocumentationCatalogItem *item);
+ virtual void createIndex(IndexBox *index, DocumentationCatalogItem *item);
+ virtual void createSectionIndex(QFileInfo &fi, IndexBox *index, DocumentationCatalogItem *item,
+ QDomElement section);
+
+ virtual QStringList fullTextSearchLocations();
+
+ virtual QPair<KFile::Mode, QString> catalogLocatorProps();
+ virtual QString catalogTitle(const QString &url);
+
+ virtual void autoSetupPlugin();
+
+};
+
+#endif
diff --git a/parts/documentation/protocols/Makefile.am b/parts/documentation/protocols/Makefile.am
new file mode 100644
index 00000000..ef837725
--- /dev/null
+++ b/parts/documentation/protocols/Makefile.am
@@ -0,0 +1,4 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+METASOURCES = AUTO
+
+SUBDIRS = chm
diff --git a/parts/documentation/protocols/chm/Makefile.am b/parts/documentation/protocols/chm/Makefile.am
new file mode 100644
index 00000000..59d02cfd
--- /dev/null
+++ b/parts/documentation/protocols/chm/Makefile.am
@@ -0,0 +1,21 @@
+## Makefile.am of kdebase/kioslave/chm
+
+INCLUDES = -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = kio_chm.la libkchmpart.la
+
+kio_chm_la_SOURCES = decompress.cpp chmfile.cpp chm.cpp
+kio_chm_la_LIBADD = $(LIB_KIO)
+kio_chm_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+
+libkchmpart_la_SOURCES = kchmpart.cpp
+libkchmpart_la_LIBADD = -lkhtml $(LIB_KPARTS) $(top_builddir)/lib/widgets/libkdevwidgets.la
+libkchmpart_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+
+noinst_HEADERS = chm.h chmfile.h decompress.h kchmpart.h
+
+kdelnk_DATA = chm.protocol kchmpart.desktop
+kdelnkdir = $(kde_servicesdir)
+
+METASOURCES = AUTO
+
diff --git a/parts/documentation/protocols/chm/chm.cpp b/parts/documentation/protocols/chm/chm.cpp
new file mode 100644
index 00000000..1383d2b6
--- /dev/null
+++ b/parts/documentation/protocols/chm/chm.cpp
@@ -0,0 +1,362 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qcstring.h>
+#include <qbitarray.h>
+#include <qfile.h>
+#include <qregexp.h>
+#include <stack>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kinstance.h>
+#include <kglobal.h>
+#include <kurl.h>
+#include <kmimemagic.h>
+#include <ktempfile.h>
+
+#include "chm.h"
+
+
+using namespace KIO;
+
+extern "C"
+{
+ int kdemain( int argc, char **argv )
+ {
+ KInstance instance( "kio_chm" );
+
+ kdDebug() << "*** Starting kio_chm " << endl;
+
+ if (argc != 4) {
+ kdDebug() << "Usage: kio_chm protocol domain-socket1 domain-socket2" << endl;
+ exit(-1);
+ }
+
+ ChmProtocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ kdDebug() << "*** kio_chm Done" << endl;
+ return 0;
+ }
+}
+
+ChmProtocol::ChmProtocol(const QCString &pool_socket, const QCString &app_socket)
+: SlaveBase("kio_chm", pool_socket, app_socket)
+{
+ kdDebug() << "ChmProtocol::ChmProtocol()" << endl;
+}
+/* ---------------------------------------------------------------------------------- */
+
+
+ChmProtocol::~ChmProtocol()
+{
+ kdDebug() << "ChmProtocol::~ChmProtocol()" << endl;
+}
+
+
+/* ---------------------------------------------------------------------------------- */
+void ChmProtocol::get( const KURL& url )
+{
+ /** When :catalog is appended to the end, a plain-text representation of the catalog
+ * is given out where each entry consists of four lines, an integer representing the parent
+ * of the node, an integer representing a node's ID, the Title of the Node, and it's hyperlink.
+ * When :contents is appended, all contained htm- and html-files will be printed, each in a line.
+ */
+ kdDebug() << "kio_chm::get(const KURL& url) " << url.path() << endl;
+
+ bool catalog = false;
+ bool contents = false;
+ QString bigpath = url.path();
+
+ if(bigpath.endsWith(":catalog")) {
+ catalog = true;
+ int len = QString(":catalog").length();
+ bigpath.remove(bigpath.length() - len, len); ///strip :catalog from the end
+ }
+
+ if(bigpath.endsWith(":contents")) {
+ contents = true;
+ int len = QString(":contents").length();
+ bigpath.remove(bigpath.length() - len, len); ///strip :catalog from the end
+ }
+
+ QString path;
+ if ( !checkNewFile( bigpath, path ) ) {
+ error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
+ return;
+ }
+
+
+ if (m_dirMap.find(path) == m_dirMap.end()) {
+ error( KIO::ERR_DOES_NOT_EXIST, url.prettyURL() );
+ return;
+ }
+
+ QByteArray theData;
+
+ //init..
+ //added by lucida lucida@users.sf.net
+ QString fname = QString();
+ QString chmpath = QString();
+ KTempFile f("",".html");
+ fname = f.name();
+ QTextStream *t = f.textStream();
+ QString firstPage = QString("");
+ QString m_strIndex = QString("");
+ QString tmpstr = QString("");
+ bool m_bIndex = 0;
+
+
+ if(contents) {
+ QString output;
+ KURL u = url;
+
+ ChmDirectoryMap::Iterator it;
+ for ( it = m_dirMap.begin(); it != m_dirMap.end(); ++it) {
+ u.setPath(bigpath);
+ u.addPath(it.key());
+ output += u.prettyURL() + "\n";
+ }
+
+ data(output.local8Bit());
+ processedSize(output.length());
+ finished();
+ return;
+ }
+
+
+ //try get some page to display, if the chm missing index
+ ChmDirectoryMap::Iterator it;
+ for ( it = m_dirMap.begin(); it != m_dirMap.end(); ++it) {
+ tmpstr.sprintf("%s", it.key().latin1());
+ if ((m_strIndex == "") &&
+ (tmpstr.endsWith(".htm") || tmpstr.endsWith(".html")))
+ m_strIndex = tmpstr;
+ if ((tmpstr == "/index.htm") || (tmpstr == "/index.html")) {
+ m_strIndex = tmpstr;
+ break;
+ }
+ }
+ m_strIndex.remove(0,1);
+
+
+ if (path == "/" || catalog) {
+ bool htmlOutput = !catalog;
+ int offset = m_dirMap["/@contents"].offset;
+ int length = m_dirMap["/@contents"].length;
+ theData.setRawData(&m_contents[offset], length);
+ QString s(theData);
+ QString output;
+
+ QRegExp object("<OBJECT type=\"text/sitemap\">(.*)</OBJECT>", false);
+ object.setMinimal(true);
+
+ QRegExp nameParam("<param name=\"Name\" value=\"(.*)\">", false);
+ nameParam.setMinimal(true);
+
+ QRegExp localParam("<param name=\"Local\" value=\"(.*)\">", false);
+ localParam.setMinimal(true);
+
+ QRegExp mergeParam("<param name=\"Merge\" value=\"(.*)\">", false);
+ mergeParam.setMinimal(true);
+
+ std::stack<int> parents;
+ int counter = 1;
+ int current = 0;
+ int old = 0, pos = 0;
+ parents.push(0);
+ while ((pos = s.find(object, pos)) != -1) {
+ if(htmlOutput) output += s.mid(old, pos - old);
+ if(catalog) {
+ QRegExp ex("<UL>|</UL>", false); ex.setMinimal(true);
+ QString ms = s.mid(old, pos - old);
+ int pos = 0;
+ while( (pos = ms.find(ex, pos)) != -1) {
+ if(ms.mid(pos, 4) == "<UL>") {
+ parents.push(current);
+ } else{
+ if(parents.empty()){
+ }else{
+ current = parents.top();
+ parents.pop();
+ }
+ }
+ pos++;
+ }
+ }
+ pos += object.matchedLength();
+ old = pos;
+ QString obj = object.cap(1);
+ QString name, local;
+ if (obj.find(nameParam) != -1) {
+ name = nameParam.cap(1);
+ if (obj.find(localParam) != -1) {
+ local = localParam.cap(1);
+ //output += "<a href=\"" + local + "\">" + name + "</a>";
+ //added by lucida lucida@users.sf.net
+ if (local != "" && local != "/") {
+ if(!catalog) {
+ output += "<a target=\"browse\" href=\"" + url.url() + local + "\">" + name + "</a>";
+ }else{
+ current = counter;
+ ++counter;
+ KURL u = url;
+ u.setPath(bigpath + local);
+ QString str;
+ output += str.sprintf("%i\n%i\n", parents.top(), current);
+ output += name + "\n" + u.prettyURL() + "\n";
+ }
+ m_bIndex = 1;
+ if (firstPage == "") firstPage = url.url()+QString::fromLocal8Bit(local.latin1());
+ }
+ else
+ if(htmlOutput) output += name;
+ } else {
+ if(htmlOutput) output += name;
+ }
+ }
+ if (obj.find(mergeParam) != -1 && htmlOutput) {
+ QString link = mergeParam.cap(1);
+ QString href = link.left(link.find("::"));
+ QString path = m_chmFile.left(m_chmFile.findRev("/") + 1);
+ //output += " (<a href=\"" + path + href + "\">link</a>)";
+ m_bIndex = 1;
+ output += " (<a target=\"browse\" href=\"" + url.url() + path + href + "\">link</a>)";
+ if (firstPage == "") firstPage = url.url()+QString::fromLocal8Bit(local.latin1());
+ }
+ }
+ if(htmlOutput) output += s.mid(old);
+
+ //set left pane
+ //added by lucida, lucida@users.sf.net
+ QString lframe = QString("</HEAD><FRAMESET COLS=\"25%,*\">\n");
+ lframe += "<FRAME NAME=\"index\" src=\"file:"+ fname+"\"" + " marginwidth=\"0\"></FRAME>\n";
+ if (!m_bIndex) {
+ lframe = "</HEAD><FRAMESET>";
+ firstPage = url.url() + QString::fromLocal8Bit(m_strIndex.latin1());
+ }
+ theData.resetRawData(&m_contents[offset], length);
+ //KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType( output, path );
+ //kdDebug() << "Emitting mimetype " << result->mimeType() << endl;
+ //mimeType( result->mimeType() );
+/* QCString output1 = (QCString)(output.latin1());
+ data(output1);
+ processedSize(output1.length());*/
+
+ //construct the frame
+ //added by lucida lucida@users.sf.net
+ QString framestr = QString("<HTML><HEAD>\n");
+ framestr += lframe;
+ framestr += "<FRAME NAME=\"browse\" src=\"" + firstPage + "\">\n";
+ framestr += "</FRAME>\n";
+ framestr += "</FRAMESET></HTML>";
+ //write index file
+ //added by lucida lucida@users.sf.net
+ *t << QString::fromLocal8Bit(output.latin1()) << endl;
+
+ if(catalog) {
+ data(output.local8Bit());
+ processedSize(output.length());
+ }else{
+ data(framestr.local8Bit());
+ processedSize(framestr.length());
+ }
+ } else {
+ int offset = m_dirMap[path].offset;
+ int length = m_dirMap[path].length;
+ totalSize(length);
+ theData.setRawData(&m_contents[offset], length);
+
+ KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType( theData, path );
+ kdDebug() << "Emitting mimetype " << result->mimeType() << endl;
+ mimeType( result->mimeType() );
+ data(theData);
+ theData.resetRawData(&m_contents[offset], length);
+ processedSize(length);
+ }
+
+ finished();
+}
+
+/* --------------------------------------------------------------------------- */
+bool ChmProtocol::checkNewFile( QString fullPath, QString& path )
+{
+ //kdDebug() << "ChmProtocol::checkNewFile " << fullPath << endl;
+
+ fullPath = fullPath.replace(QRegExp("::"), "");
+
+ // Are we already looking at that file ?
+ if ( !m_chmFile.isEmpty() && fullPath.startsWith(m_chmFile) )
+ {
+ path = fullPath.mid(m_chmFile.length()).lower();
+ return true;
+ }
+
+ kdDebug() << "Need to open a new file" << endl;
+
+ m_chmFile = "";
+
+ // Find where the chm file is in the full path
+ int pos = 0;
+ QString chmFile;
+ path = "";
+
+ int len = fullPath.length();
+ if ( len != 0 && fullPath[ len - 1 ] != '/' )
+ fullPath += '/';
+
+ //kdDebug() << "the full path is " << fullPath << endl;
+ while ( (pos=fullPath.find( '/', pos+1 )) != -1 )
+ {
+ QString tryPath = fullPath.left( pos );
+ //kdDebug() << fullPath << " trying " << tryPath << endl;
+ struct stat statbuf;
+ if ( ::stat( QFile::encodeName(tryPath), &statbuf ) == 0 && !S_ISDIR(statbuf.st_mode) )
+ {
+ chmFile = tryPath;
+ path = fullPath.mid( pos ).lower();
+ kdDebug() << "fullPath=" << fullPath << " path=" << path << endl;
+ len = path.length();
+ if ( len > 2 )
+ {
+ if ( path[ len - 1 ] == '/' )
+ path.truncate( len - 1 );
+ }
+ else
+ {
+ path = QString::fromLatin1("/");
+ }
+ kdDebug() << "Found. chmFile=" << chmFile << " path=" << path << endl;
+ break;
+ }
+ }
+ if ( chmFile.isEmpty() )
+ {
+ kdDebug() << "ChmProtocol::checkNewFile: not found" << endl;
+ return false;
+ }
+
+ m_chmFile = chmFile;
+
+ // Open new file
+ //kdDebug() << "Opening Chm file on " << chmFile << endl;
+ return m_chm.read(chmFile, m_dirMap, m_contents);
+}
diff --git a/parts/documentation/protocols/chm/chm.h b/parts/documentation/protocols/chm/chm.h
new file mode 100644
index 00000000..92044173
--- /dev/null
+++ b/parts/documentation/protocols/chm/chm.h
@@ -0,0 +1,47 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __chm_h__
+#define __chm_h__
+
+#include <qstring.h>
+#include <qcstring.h>
+#include <kurl.h>
+#include <kio/global.h>
+#include <kio/slavebase.h>
+#include "chmfile.h"
+
+class QCString;
+
+class ChmProtocol : public KIO::SlaveBase
+{
+public:
+ ChmProtocol( const QCString&, const QCString& );
+ ~ChmProtocol();
+
+ void get( const KURL& );
+
+private:
+ bool checkNewFile( QString, QString& );
+ ChmDirectoryMap m_dirMap;
+ QByteArray m_contents;
+ QString m_chmFile;
+ Chm m_chm;
+};
+
+
+#endif // __chm_h__
+
diff --git a/parts/documentation/protocols/chm/chm.protocol b/parts/documentation/protocols/chm/chm.protocol
new file mode 100644
index 00000000..90daa4c5
--- /dev/null
+++ b/parts/documentation/protocols/chm/chm.protocol
@@ -0,0 +1,36 @@
+[Protocol]
+exec=kio_chm
+protocol=ms-its
+input=none
+output=filesystem
+reading=true
+defaultMimetype=text/html
+Description=A kioslave for displaying WinHelp files
+Description[ca]=Un kioslave per a mostrar fitxers WinHelp
+Description[da]=En kioslave til visning af Windows hjælpefiler
+Description[de]=Ein Ein-/Ausgabemodul zur Anzeige von WinHelp-Dateien
+Description[el]=Ένας υπηρέτης kio για εμφάνιση αρχείων WinHelp
+Description[es]=Un kioslave para mostrar archivos WinHelp
+Description[et]=WinHelp-failide kuvamise IO-moodul
+Description[eu]=WinHelp fitxategiak bistaratzeko kioslave bat
+Description[fa]=یک kioslave برای نمایش پرونده‌های WinHelp
+Description[fr]=Un esclave d'E/S (kioslave) pour l'affichage des fichiers WinHelp
+Description[gl]=Un kioslave para mostrar ficheiros WinHelp
+Description[hu]=KDE-protokoll WinHelp-fájlok megjelenítéséhez
+Description[it]=Un kioslave per mostrare i file WinHelp
+Description[ja]=WinHelp を表示するための kioslave
+Description[nds]=En In-/Utgaavmoduul för't Wiesen vun "WinHelp"-Dateien
+Description[ne]=WinHelp फाइलहरूका लागि किवस्लेभ
+Description[nl]=Een kioslave voor het weergeven van WinHelp-bestanden
+Description[pl]=kioslave do pokazywania plików WinHelp
+Description[pt]=A 'kioslave' para mostrar ficheiros WinHelp
+Description[pt_BR]=Um kioslave para exibir arquivos WinHelp
+Description[ru]=Обработчик ввода-вывода для файлов WinHelp
+Description[sk]=kioslave pre zobrazenie WinHelp súborov
+Description[sr]=KIOSlave за приказ WinHelp фајлова
+Description[sr@Latn]=KIOSlave za prikaz WinHelp fajlova
+Description[sv]=En I/O-slav för att visa WinHelp-filer
+Description[tr]=WinHelp dosyalarını görüntülemek için bir kioslave
+Description[zh_CN]=显示 WinHelp 文件的 kioslave
+Description[zh_TW]=顯示 WinHelp 檔案的 kioslave
+Icon=help
diff --git a/parts/documentation/protocols/chm/chmfile.cpp b/parts/documentation/protocols/chm/chmfile.cpp
new file mode 100644
index 00000000..f69d354a
--- /dev/null
+++ b/parts/documentation/protocols/chm/chmfile.cpp
@@ -0,0 +1,197 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qfile.h>
+#include "chmfile.h"
+#include "decompress.h"
+
+uint Chm::getEncInt(QFile& f, uint &value) const
+{
+ int c;
+ uint result = 0;
+ ulong count = 0;
+
+ do
+ {
+ c = f.getch();
+ result <<= 7;
+ result |= (c & 0x7F);
+ count++;
+ } while (c & 0x80);
+
+ value = result;
+ return count;
+}
+
+uint Chm::getName(QFile& f, QString& name) const
+{
+ int len = f.getch();
+ char *buf = new char[len];
+ f.readBlock(buf, len);
+ name = QString::fromUtf8(buf, len);
+ if (name.startsWith("/"))
+ name = name.lower();
+ delete [] buf;
+ return len + 1;
+}
+
+uint Chm::getIntel32(QFile& f) const
+{
+ uint value = f.getch() | f.getch() << 8 | f.getch() << 16 | f.getch() << 24;
+ return value;
+}
+
+uint Chm::getIntel64(QFile& f) const
+{
+ uint value = getIntel32(f);
+ f.at(f.at() + 4);
+ return value;
+}
+
+bool Chm::getChunk(QFile& f, uint chunkSize, ChmDirectoryMap& directoryMap) const
+{
+ char tag[4];
+ if (f.readBlock(tag, 4) != 4) return false;
+
+ if (!qstrncmp(tag, "PMGL", 4))
+ {
+ uint quickref_length = getIntel32(f);
+ f.at(f.at() + 12);
+
+ uint pos = 20;
+ while (pos < chunkSize - quickref_length)
+ {
+ uint section, offset, length;
+ QString name;
+ pos += getName(f, name);
+ pos += getEncInt(f, section);
+ pos += getEncInt(f, offset);
+ pos += getEncInt(f, length);
+ directoryMap[name] = ChmDirTableEntry(section, offset, length);
+ if (name.endsWith(".hhc"))
+ directoryMap["/@contents"] = ChmDirTableEntry(section, offset, length);
+ }
+
+ return (f.at(f.at() + quickref_length));
+ }
+ else if (!qstrncmp(tag, "PMGI", 4))
+ {
+ // evaluation of the index chunk is not yet implemented => skip it
+ return f.at(f.at() + chunkSize - 4);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+bool Chm::read(const QString& fileSpec, ChmDirectoryMap& dirMap, QByteArray& contents) const
+{
+ QFile f(fileSpec);
+ if (!f.open(IO_ReadOnly)) return false;
+
+ // read CHM file header
+ char tag[4];
+ if (f.readBlock(tag, 4) != 4 || qstrncmp(tag, "ITSF", 4)) return false;
+ uint chm_version = getIntel32(f);
+ if (!f.at(f.at() + 0x30)) return false;
+
+ // read header section table
+ uint section_0_offset = getIntel64(f);
+ uint section_0_length = getIntel64(f);
+ uint section_1_offset = getIntel64(f);
+ uint section_1_length = getIntel64(f);
+
+ uint contentStart = 0;
+ if (chm_version >= 3) contentStart = getIntel32(f);
+
+ // read directory header
+ if (!f.at(section_1_offset)) return false;
+ if (f.readBlock(tag, 4) != 4 || qstrncmp(tag, "ITSP", 4)) return false;
+ if (!f.at(f.at() + 12)) return false;
+ uint directory_chunk_size = getIntel32(f);
+ if (!f.at(f.at() + 24)) return false;
+ uint num_directory_chunks = getIntel32(f);
+ if (!f.at(f.at() + 36)) return false;
+
+ // read directory table
+ for (uint i = 0; i < num_directory_chunks; i++)
+ if (!getChunk(f, directory_chunk_size, dirMap)) return false;
+
+ // current position is start of content area
+ if (chm_version < 3) contentStart = f.at();
+
+ // read reset table
+ if (!f.at(contentStart)) return false;
+ uint resetTableOffset =
+ dirMap["::DataSpace/Storage/MSCompressed/Transform/{7FC28940-9D31-11D0-9B27-00A0C91E9C7C}/InstanceData/ResetTable"].offset;
+ if (!f.at(f.at() + resetTableOffset + 4)) return false;
+ uint numResetTableEntries = getIntel32(f);
+ if (!f.at(f.at() + 8)) return false;
+ uint uncompressedLength = getIntel64(f);
+ uint compressedLength = getIntel64(f);
+ uint blockSize = getIntel64(f);
+ uint *resetTable = new uint[numResetTableEntries + 1];
+
+ for (uint i = 0; i < numResetTableEntries; i++)
+ resetTable[i] = getIntel64(f);
+
+ resetTable[numResetTableEntries] = compressedLength;
+
+ // read compressed contents
+ if (!f.at(contentStart)) return false;
+ uint contentsOffset = dirMap["::DataSpace/Storage/MSCompressed/Content"].offset;
+ if (!f.at(f.at() + contentsOffset)) return false;
+ char *compressedContents = new char[compressedLength];
+ if ((uint)f.readBlock(compressedContents, compressedLength) != compressedLength) return false;
+
+ f.close();
+
+ // allocate buffer for uncompressed contents
+ char *uncompressedContents = new char[uncompressedLength];
+
+ // get window size
+ uint window = 1;
+ uint tmp = blockSize;
+ while (tmp >>= 1) window++;
+
+ // decompress
+ uint outlen = uncompressedLength;
+ int res = 1;
+
+ for (uint i = 0; i < numResetTableEntries; i++)
+ {
+ if (!(i & 1)) LZXinit(window);
+
+ uint inlen = resetTable[i+1] - resetTable[i];
+ res = LZXdecompress((uchar*)&compressedContents[resetTable[i]],
+ inlen,
+ (uchar*)uncompressedContents + i * blockSize,
+ (outlen < blockSize) ? outlen : blockSize);
+ if (res) break;
+ outlen -= blockSize;
+ }
+
+ delete [] resetTable;
+ delete [] compressedContents;
+
+ if (res == 0)
+ contents.duplicate(uncompressedContents, uncompressedLength);
+
+ delete [] uncompressedContents;
+
+ return (res == 0);
+}
diff --git a/parts/documentation/protocols/chm/chmfile.h b/parts/documentation/protocols/chm/chmfile.h
new file mode 100644
index 00000000..0040c135
--- /dev/null
+++ b/parts/documentation/protocols/chm/chmfile.h
@@ -0,0 +1,53 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __chmfile_h__
+#define __chmfile_h__
+
+#include <cstdio>
+#include <qmap.h>
+#include <qstring.h>
+
+class QFile;
+
+struct ChmDirTableEntry
+{
+ ChmDirTableEntry() : section(0), offset(0), length(0) {}
+ ChmDirTableEntry( uint s, uint o, uint l )
+ : section(s), offset(o), length(l) {}
+
+ uint section;
+ uint offset;
+ uint length;
+};
+
+typedef QMap<QString, ChmDirTableEntry> ChmDirectoryMap;
+
+class Chm
+{
+public:
+ bool read( const QString&, ChmDirectoryMap&, QByteArray& ) const;
+
+private:
+ bool getChunk( QFile&, uint, ChmDirectoryMap& ) const;
+ uint getEncInt( QFile&, uint& ) const;
+ uint getName( QFile&, QString& ) const;
+ uint getIntel32( QFile& ) const;
+ uint getIntel64( QFile& ) const;
+};
+
+#endif // __chmfile_h__
+
diff --git a/parts/documentation/protocols/chm/decompress.cpp b/parts/documentation/protocols/chm/decompress.cpp
new file mode 100644
index 00000000..0356d86e
--- /dev/null
+++ b/parts/documentation/protocols/chm/decompress.cpp
@@ -0,0 +1,796 @@
+/* Most of this file is taken from:
+ cabextract 0.5 - a program to extract Microsoft Cabinet files
+ (C) 2000-2001 Stuart Caie <kyzer@4u.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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "decompress.h"
+
+int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table);
+int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, lzx_bits *lb);
+
+
+/*--------------------------------------------------------------------------*/
+/* our archiver information / state */
+
+/* LZX stuff */
+
+/* some constants defined by the LZX specification */
+#define LZX_MIN_MATCH (2)
+#define LZX_MAX_MATCH (257)
+#define LZX_NUM_CHARS (256)
+#define LZX_BLOCKTYPE_INVALID (0) /* also blocktypes 4-7 invalid */
+#define LZX_BLOCKTYPE_VERBATIM (1)
+#define LZX_BLOCKTYPE_ALIGNED (2)
+#define LZX_BLOCKTYPE_UNCOMPRESSED (3)
+#define LZX_PRETREE_NUM_ELEMENTS (20)
+#define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */
+#define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */
+#define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */
+
+/* LZX huffman defines: tweak tablebits as desired */
+#define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS)
+#define LZX_PRETREE_TABLEBITS (6)
+#define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 50*8)
+#define LZX_MAINTREE_TABLEBITS (12)
+#define LZX_LENGTH_MAXSYMBOLS (LZX_NUM_SECONDARY_LENGTHS+1)
+#define LZX_LENGTH_TABLEBITS (12)
+#define LZX_ALIGNED_MAXSYMBOLS (LZX_ALIGNED_NUM_ELEMENTS)
+#define LZX_ALIGNED_TABLEBITS (7)
+
+#define LZX_LENTABLE_SAFETY (64) /* we allow length table decoding overruns */
+
+#define LZX_DECLARE_TABLE(tbl) \
+ UWORD tbl##_table[(1<<LZX_##tbl##_TABLEBITS) + (LZX_##tbl##_MAXSYMBOLS<<1)];\
+ UBYTE tbl##_len [LZX_##tbl##_MAXSYMBOLS + LZX_LENTABLE_SAFETY]
+
+struct LZXstate
+{
+ UBYTE *window; /* the actual decoding window */
+ ULONG window_size; /* window size (32Kb through 2Mb) */
+ ULONG actual_size; /* window size when it was first allocated */
+ ULONG window_posn; /* current offset within the window */
+ ULONG R0, R1, R2; /* for the LRU offset system */
+ UWORD main_elements; /* number of main tree elements */
+ int header_read; /* have we started decoding at all yet? */
+ UWORD block_type; /* type of this block */
+ ULONG block_length; /* uncompressed length of this block */
+ ULONG block_remaining; /* uncompressed bytes still left to decode */
+ ULONG frames_read; /* the number of CFDATA blocks processed */
+ LONG intel_filesize; /* magic header value used for transform */
+ LONG intel_curpos; /* current offset in transform space */
+ int intel_started; /* have we seen any translatable data yet? */
+
+ LZX_DECLARE_TABLE(PRETREE);
+ LZX_DECLARE_TABLE(MAINTREE);
+ LZX_DECLARE_TABLE(LENGTH);
+ LZX_DECLARE_TABLE(ALIGNED);
+};
+
+
+/* generic stuff */
+#define CAB(x) (decomp_state.x)
+#define LZX(x) (decomp_state.lzx.x)
+#define DECR_OK (0)
+#define DECR_DATAFORMAT (1)
+#define DECR_ILLEGALDATA (2)
+#define DECR_NOMEMORY (3)
+#define DECR_CHECKSUM (4)
+#define DECR_INPUT (5)
+#define DECR_OUTPUT (6)
+
+struct
+{
+ struct LZXstate lzx;
+} decomp_state;
+
+
+/* LZX decruncher */
+
+/* Microsoft's LZX document and their implementation of the
+ * com.ms.util.cab Java package do not concur.
+ *
+ * In the LZX document, there is a table showing the correlation between
+ * window size and the number of position slots. It states that the 1MB
+ * window = 40 slots and the 2MB window = 42 slots. In the implementation,
+ * 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the
+ * first slot whose position base is equal to or more than the required
+ * window size'. This would explain why other tables in the document refer
+ * to 50 slots rather than 42.
+ *
+ * The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode
+ * is not defined in the specification.
+ *
+ * The LZX document does not state the uncompressed block has an
+ * uncompressed length field. Where does this length field come from, so
+ * we can know how large the block is? The implementation has it as the 24
+ * bits following after the 3 blocktype bits, before the alignment
+ * padding.
+ *
+ * The LZX document states that aligned offset blocks have their aligned
+ * offset huffman tree AFTER the main and length trees. The implementation
+ * suggests that the aligned offset tree is BEFORE the main and length
+ * trees.
+ *
+ * The LZX document decoding algorithm states that, in an aligned offset
+ * block, if an extra_bits value is 1, 2 or 3, then that number of bits
+ * should be read and the result added to the match offset. This is
+ * correct for 1 and 2, but not 3, where just a huffman symbol (using the
+ * aligned tree) should be read.
+ *
+ * Regarding the E8 preprocessing, the LZX document states 'No translation
+ * may be performed on the last 6 bytes of the input block'. This is
+ * correct. However, the pseudocode provided checks for the *E8 leader*
+ * up to the last 6 bytes. If the leader appears between -10 and -7 bytes
+ * from the end, this would cause the next four bytes to be modified, at
+ * least one of which would be in the last 6 bytes, which is not allowed
+ * according to the spec.
+ *
+ * The specification states that the huffman trees must always contain at
+ * least one element. However, many CAB files contain blocks where the
+ * length tree is completely empty (because there are no matches), and
+ * this is expected to succeed.
+ */
+
+
+/* LZX uses what it calls 'position slots' to represent match offsets.
+ * What this means is that a small 'position slot' number and a small
+ * offset from that slot are encoded instead of one large offset for
+ * every match.
+ * - position_base is an index to the position slot bases
+ * - extra_bits states how many bits of offset-from-base data is needed.
+ */
+static ULONG position_base[51];
+static UBYTE extra_bits[51];
+
+
+int LZXinit(int window) {
+ ULONG wndsize = 1 << window;
+ int i, j, posn_slots;
+
+ /* LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) */
+ /* if a previously allocated window is big enough, keep it */
+ if (window < 15 || window > 21) return DECR_DATAFORMAT;
+ if (LZX(actual_size) < wndsize)
+ {
+ if (LZX(window)) free(LZX(window));
+ LZX(window) = NULL;
+ }
+ if (!LZX(window))
+ {
+ if (!(LZX(window) = (UBYTE*)malloc(wndsize))) return DECR_NOMEMORY;
+ LZX(actual_size) = wndsize;
+ }
+ LZX(window_size) = wndsize;
+
+ /* initialise static tables */
+ for (i=0, j=0; i <= 49; i += 2)
+ {
+ extra_bits[i] = extra_bits[i+1] = j; /* 0,0,0,0,1,1,2,2,3,3... */
+ if ((i != 0) && (j < 17)) j++; /* 0,0,1,2,3,4...15,16,17,17,17,17... */
+ }
+ for (i=0, j=0; i <= 50; i++)
+ {
+ position_base[i] = j; /* 0,1,2,3,4,6,8,12,16,24,32,... */
+ j += 1 << extra_bits[i]; /* 1,1,1,1,2,2,4,4,8,8,16,16,32,32,... */
+ }
+
+ /* calculate required position slots */
+ if (window == 20) posn_slots = 42;
+ else if (window == 21) posn_slots = 50;
+ else posn_slots = window << 1;
+
+ /*posn_slots=i=0; while (i < wndsize) i += 1 << extra_bits[posn_slots++]; */
+
+
+ LZX(R0) = LZX(R1) = LZX(R2) = 1;
+ LZX(main_elements) = LZX_NUM_CHARS + (posn_slots << 3);
+ LZX(header_read) = 0;
+ LZX(frames_read) = 0;
+ LZX(block_remaining) = 0;
+ LZX(block_type) = LZX_BLOCKTYPE_INVALID;
+ LZX(intel_curpos) = 0;
+ LZX(intel_started) = 0;
+ LZX(window_posn) = 0;
+
+ /* initialise tables to 0 (because deltas will be applied to them) */
+ for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) LZX(MAINTREE_len)[i] = 0;
+ for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++) LZX(LENGTH_len)[i] = 0;
+
+ return DECR_OK;
+}
+
+
+/* Bitstream reading macros:
+ *
+ * INIT_BITSTREAM should be used first to set up the system
+ * READ_BITS(var,n) takes N bits from the buffer and puts them in var
+ *
+ * ENSURE_BITS(n) ensures there are at least N bits in the bit buffer
+ * PEEK_BITS(n) extracts (without removing) N bits from the bit buffer
+ * REMOVE_BITS(n) removes N bits from the bit buffer
+ *
+ * These bit access routines work by using the area beyond the MSB and the
+ * LSB as a free source of zeroes. This avoids having to mask any bits.
+ * So we have to know the bit width of the bitbuffer variable. This is
+ * sizeof(ULONG) * 8, also defined as ULONG_BITS
+ */
+
+/* number of bits in ULONG. Note: This must be at multiple of 16, and at
+ * least 32 for the bitbuffer code to work (ie, it must be able to ensure
+ * up to 17 bits - that's adding 16 bits when there's one bit left, or
+ * adding 32 bits when there are no bits left. The code should work fine
+ * for machines where ULONG >= 32 bits.
+ */
+#define ULONG_BITS (sizeof(ULONG)<<3)
+
+#define INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0)
+
+#define ENSURE_BITS(n) \
+ while (bitsleft < (n)) { \
+ bitbuf |= ((inpos[1]<<8)|inpos[0]) << (ULONG_BITS-16 - bitsleft); \
+ bitsleft += 16; inpos+=2; \
+ }
+
+#define PEEK_BITS(n) (bitbuf >> (ULONG_BITS - (n)))
+#define REMOVE_BITS(n) ((bitbuf <<= (n)), (bitsleft -= (n)))
+
+#define READ_BITS(v,n) do { \
+ ENSURE_BITS(n); \
+ (v) = PEEK_BITS(n); \
+ REMOVE_BITS(n); \
+} while (0)
+
+
+/* Huffman macros */
+
+#define TABLEBITS(tbl) (LZX_##tbl##_TABLEBITS)
+#define MAXSYMBOLS(tbl) (LZX_##tbl##_MAXSYMBOLS)
+#define SYMTABLE(tbl) (LZX(tbl##_table))
+#define LENTABLE(tbl) (LZX(tbl##_len))
+
+/* BUILD_TABLE(tablename) builds a huffman lookup table from code lengths.
+ * In reality, it just calls make_decode_table() with the appropriate
+ * values - they're all fixed by some #defines anyway, so there's no point
+ * writing each call out in full by hand.
+ */
+#define BUILD_TABLE(tbl) \
+ if (make_decode_table( \
+ MAXSYMBOLS(tbl), TABLEBITS(tbl), LENTABLE(tbl), SYMTABLE(tbl) \
+ )) { return DECR_ILLEGALDATA; }
+
+
+/* READ_HUFFSYM(tablename, var) decodes one huffman symbol from the
+ * bitstream using the stated table and puts it in var.
+ */
+#define READ_HUFFSYM(tbl,var) do { \
+ ENSURE_BITS(16); \
+ hufftbl = SYMTABLE(tbl); \
+ if ((i = hufftbl[PEEK_BITS(TABLEBITS(tbl))]) >= MAXSYMBOLS(tbl)) { \
+ j = 1 << (ULONG_BITS - TABLEBITS(tbl)); \
+ do { \
+ j >>= 1; i <<= 1; i |= (bitbuf & j) ? 1 : 0; \
+ if (!j) { return DECR_ILLEGALDATA; } \
+ } while ((i = hufftbl[i]) >= MAXSYMBOLS(tbl)); \
+ } \
+ j = LENTABLE(tbl)[(var) = i]; \
+ REMOVE_BITS(j); \
+} while (0)
+
+
+/* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols
+ * first to last in the given table. The code lengths are stored in their
+ * own special LZX way.
+ */
+#define READ_LENGTHS(tbl,first,last) do { \
+ lb.bb = bitbuf; lb.bl = bitsleft; lb.ip = inpos; \
+ if (lzx_read_lens(LENTABLE(tbl),(first),(last),&lb)) { \
+ return DECR_ILLEGALDATA; \
+ } \
+ bitbuf = lb.bb; bitsleft = lb.bl; inpos = lb.ip; \
+} while (0)
+
+
+/* make_decode_table(nsyms, nbits, length[], table[])
+ *
+ * This function was coded by David Tritscher. It builds a fast huffman
+ * decoding table out of just a canonical huffman code lengths table.
+ *
+ * nsyms = total number of symbols in this huffman tree.
+ * nbits = any symbols with a code length of nbits or less can be decoded
+ * in one lookup of the table.
+ * length = A table to get code lengths from [0 to syms-1]
+ * table = The table to fill up with decoded symbols and pointers.
+ *
+ * Returns 0 for OK or 1 for error
+ */
+
+int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) {
+ register UWORD sym;
+ register ULONG leaf;
+ register UBYTE bit_num = 1;
+ ULONG fill;
+ ULONG pos = 0; /* the current position in the decode table */
+ ULONG table_mask = 1 << nbits;
+ ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */
+ ULONG next_symbol = bit_mask; /* base of allocation for long codes */
+
+ /* fill entries for codes short enough for a direct mapping */
+ while (bit_num <= nbits)
+ {
+ for (sym = 0; sym < nsyms; sym++)
+ {
+ if (length[sym] == bit_num)
+ {
+ leaf = pos;
+
+ if ((pos += bit_mask) > table_mask) return 1; /* table overrun */
+
+ /* fill all possible lookups of this symbol with the symbol itself */
+ fill = bit_mask;
+ while (fill-- > 0) table[leaf++] = sym;
+ }
+ }
+ bit_mask >>= 1;
+ bit_num++;
+ }
+
+ /* if there are any codes longer than nbits */
+ if (pos != table_mask)
+ {
+ /* clear the remainder of the table */
+ for (sym = pos; sym < table_mask; sym++) table[sym] = 0;
+
+ /* give ourselves room for codes to grow by up to 16 more bits */
+ pos <<= 16;
+ table_mask <<= 16;
+ bit_mask = 1 << 15;
+
+ while (bit_num <= 16)
+ {
+ for (sym = 0; sym < nsyms; sym++)
+ {
+ if (length[sym] == bit_num)
+ {
+ leaf = pos >> 16;
+ for (fill = 0; fill < bit_num - nbits; fill++)
+ {
+ /* if this path hasn't been taken yet, 'allocate' two entries */
+ if (table[leaf] == 0)
+ {
+ table[(next_symbol << 1)] = 0;
+ table[(next_symbol << 1) + 1] = 0;
+ table[leaf] = next_symbol++;
+ }
+ /* follow the path and select either left or right for next bit */
+ leaf = table[leaf] << 1;
+ if ((pos >> (15-fill)) & 1) leaf++;
+ }
+ table[leaf] = sym;
+
+ if ((pos += bit_mask) > table_mask) return 1; /* table overflow */
+ }
+ }
+ bit_mask >>= 1;
+ bit_num++;
+ }
+ }
+
+ /* full table? */
+ if (pos == table_mask) return 0;
+
+ /* either erroneous table, or all elements are 0 - let's find out. */
+ for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1;
+ return 0;
+}
+
+int lzx_read_lens(UBYTE *lens, ULONG first, ULONG last, lzx_bits *lb) {
+ ULONG i,j, x,y;
+ int z;
+
+ register ULONG bitbuf = lb->bb;
+ register int bitsleft = lb->bl;
+ UBYTE *inpos = lb->ip;
+ UWORD *hufftbl;
+
+ for (x = 0; x < 20; x++)
+ {
+ READ_BITS(y, 4);
+ LENTABLE(PRETREE)[x] = y;
+ }
+ BUILD_TABLE(PRETREE);
+
+ for (x = first; x < last;)
+ {
+ READ_HUFFSYM(PRETREE, z);
+ if (z == 17)
+ {
+ READ_BITS(y, 4); y += 4;
+ while (y--) lens[x++] = 0;
+ }
+ else if (z == 18)
+ {
+ READ_BITS(y, 5); y += 20;
+ while (y--) lens[x++] = 0;
+ }
+ else if (z == 19)
+ {
+ READ_BITS(y, 1); y += 4;
+ READ_HUFFSYM(PRETREE, z);
+ z = lens[x] - z; if (z < 0) z += 17;
+ while (y--) lens[x++] = z;
+ }
+ else
+ {
+ z = lens[x] - z; if (z < 0) z += 17;
+ lens[x++] = z;
+ }
+ }
+
+ lb->bb = bitbuf;
+ lb->bl = bitsleft;
+ lb->ip = inpos;
+ return 0;
+}
+
+int LZXdecompress(UBYTE* inpos, int inlen, UBYTE* outpos, int outlen) {
+ UBYTE *endinp = inpos + inlen;
+ UBYTE *window = LZX(window);
+ UBYTE *runsrc, *rundest;
+ UWORD *hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */
+
+ ULONG window_posn = LZX(window_posn);
+ ULONG window_size = LZX(window_size);
+ ULONG R0 = LZX(R0);
+ ULONG R1 = LZX(R1);
+ ULONG R2 = LZX(R2);
+
+ register ULONG bitbuf;
+ register int bitsleft;
+ ULONG match_offset, i,j,k; /* ijk used in READ_HUFFSYM macro */
+ lzx_bits lb; /* used in READ_LENGTHS macro */
+
+ int togo = outlen, this_run, main_element, aligned_bits;
+ int match_length, length_footer, extra, verbatim_bits;
+
+ INIT_BITSTREAM;
+
+ /* read header if necessary */
+ if (!LZX(header_read))
+ {
+ i = j = 0;
+ READ_BITS(k, 1); if (k)
+ {
+ READ_BITS(i,16); READ_BITS(j,16);
+ }
+ LZX(intel_filesize) = (i << 16) | j; /* or 0 if not encoded */
+ LZX(header_read) = 1;
+ }
+
+ /* main decoding loop */
+ while (togo > 0)
+ {
+ /* last block finished, new block expected */
+ if (LZX(block_remaining) == 0)
+ {
+ if (LZX(block_type) == LZX_BLOCKTYPE_UNCOMPRESSED)
+ {
+ if (LZX(block_length) & 1) inpos++; /* realign bitstream to word */
+ INIT_BITSTREAM;
+ }
+
+ READ_BITS(LZX(block_type), 3);
+ READ_BITS(i, 16);
+ READ_BITS(j, 8);
+ LZX(block_remaining) = LZX(block_length) = (i << 8) | j;
+
+ switch (LZX(block_type))
+ {
+ case LZX_BLOCKTYPE_ALIGNED:
+ for (i = 0; i < 8; i++)
+ {
+ READ_BITS(j, 3); LENTABLE(ALIGNED)[i] = j;
+ }
+ BUILD_TABLE(ALIGNED);
+ /* rest of aligned header is same as verbatim */
+
+ case LZX_BLOCKTYPE_VERBATIM:
+ READ_LENGTHS(MAINTREE, 0, 256);
+ READ_LENGTHS(MAINTREE, 256, LZX(main_elements));
+ BUILD_TABLE(MAINTREE);
+ if (LENTABLE(MAINTREE)[0xE8] != 0) LZX(intel_started) = 1;
+
+ READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS);
+ BUILD_TABLE(LENGTH);
+ break;
+
+ case LZX_BLOCKTYPE_UNCOMPRESSED:
+ LZX(intel_started) = 1; /* because we can't assume otherwise */
+ ENSURE_BITS(16); /* get up to 16 pad bits into the buffer */
+ if (bitsleft > 16) inpos -= 2; /* and align the bitstream! */
+ R0 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
+ R1 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
+ R2 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;
+ break;
+
+ default:
+ return DECR_ILLEGALDATA;
+ }
+ }
+
+ /* buffer exhaustion check */
+ if (inpos > endinp)
+ {
+ /* it's possible to have a file where the next run is less than
+ * 16 bits in size. In this case, the READ_HUFFSYM() macro used
+ * in building the tables will exhaust the buffer, so we should
+ * allow for this, but not allow those accidentally read bits to
+ * be used (so we check that there are at least 16 bits
+ * remaining - in this boundary case they aren't really part of
+ * the compressed data)
+ */
+ if (inpos > (endinp+2) || bitsleft < 16) return DECR_ILLEGALDATA;
+ }
+
+ while ((this_run = LZX(block_remaining)) > 0 && togo > 0)
+ {
+ if (this_run > togo) this_run = togo;
+ togo -= this_run;
+ LZX(block_remaining) -= this_run;
+
+ /* apply 2^x-1 mask */
+ window_posn &= window_size - 1;
+ /* runs can't straddle the window wraparound */
+ if ((window_posn + this_run) > window_size)
+ return DECR_DATAFORMAT;
+
+ switch (LZX(block_type))
+ {
+
+ case LZX_BLOCKTYPE_VERBATIM:
+ while (this_run > 0)
+ {
+ READ_HUFFSYM(MAINTREE, main_element);
+
+ if (main_element < LZX_NUM_CHARS)
+ {
+ /* literal: 0 to LZX_NUM_CHARS-1 */
+ window[window_posn++] = main_element;
+ this_run--;
+ }
+ else
+ {
+ /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
+ main_element -= LZX_NUM_CHARS;
+
+ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
+ if (match_length == LZX_NUM_PRIMARY_LENGTHS)
+ {
+ READ_HUFFSYM(LENGTH, length_footer);
+ match_length += length_footer;
+ }
+ match_length += LZX_MIN_MATCH;
+
+ match_offset = main_element >> 3;
+
+ if (match_offset > 2)
+ {
+ /* not repeated offset */
+ if (match_offset != 3)
+ {
+ extra = extra_bits[match_offset];
+ READ_BITS(verbatim_bits, extra);
+ match_offset = position_base[match_offset] - 2 + verbatim_bits;
+ }
+ else
+ {
+ match_offset = 1;
+ }
+
+ /* update repeated offset LRU queue */
+ R2 = R1; R1 = R0; R0 = match_offset;
+ }
+ else if (match_offset == 0)
+ {
+ match_offset = R0;
+ }
+ else if (match_offset == 1)
+ {
+ match_offset = R1;
+ R1 = R0; R0 = match_offset;
+ }
+ else /* match_offset == 2 */
+ {
+ match_offset = R2;
+ R2 = R0; R0 = match_offset;
+ }
+
+ rundest = window + window_posn;
+ runsrc = rundest - match_offset;
+ window_posn += match_length;
+ this_run -= match_length;
+
+ /* copy any wrapped around source data */
+ while ((runsrc < window) && (match_length-- > 0))
+ {
+ *rundest++ = *(runsrc + window_size); runsrc++;
+ }
+ /* copy match data - no worries about destination wraps */
+ while (match_length-- > 0) *rundest++ = *runsrc++;
+
+ }
+ }
+ break;
+
+ case LZX_BLOCKTYPE_ALIGNED:
+ while (this_run > 0)
+ {
+ READ_HUFFSYM(MAINTREE, main_element);
+
+ if (main_element < LZX_NUM_CHARS)
+ {
+ /* literal: 0 to LZX_NUM_CHARS-1 */
+ window[window_posn++] = main_element;
+ this_run--;
+ }
+ else
+ {
+ /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */
+ main_element -= LZX_NUM_CHARS;
+
+ match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;
+ if (match_length == LZX_NUM_PRIMARY_LENGTHS)
+ {
+ READ_HUFFSYM(LENGTH, length_footer);
+ match_length += length_footer;
+ }
+ match_length += LZX_MIN_MATCH;
+
+ match_offset = main_element >> 3;
+
+ if (match_offset > 2)
+ {
+ /* not repeated offset */
+ extra = extra_bits[match_offset];
+ match_offset = position_base[match_offset] - 2;
+ if (extra > 3)
+ {
+ /* verbatim and aligned bits */
+ extra -= 3;
+ READ_BITS(verbatim_bits, extra);
+ match_offset += (verbatim_bits << 3);
+ READ_HUFFSYM(ALIGNED, aligned_bits);
+ match_offset += aligned_bits;
+ }
+ else if (extra == 3)
+ {
+ /* aligned bits only */
+ READ_HUFFSYM(ALIGNED, aligned_bits);
+ match_offset += aligned_bits;
+ }
+ else if (extra > 0)
+ { /* extra==1, extra==2 */
+ /* verbatim bits only */
+ READ_BITS(verbatim_bits, extra);
+ match_offset += verbatim_bits;
+ }
+ else /* extra == 0 */
+ {
+ /* ??? */
+ match_offset = 1;
+ }
+
+ /* update repeated offset LRU queue */
+ R2 = R1; R1 = R0; R0 = match_offset;
+ }
+ else if (match_offset == 0)
+ {
+ match_offset = R0;
+ }
+ else if (match_offset == 1)
+ {
+ match_offset = R1;
+ R1 = R0; R0 = match_offset;
+ }
+ else /* match_offset == 2 */
+ {
+ match_offset = R2;
+ R2 = R0; R0 = match_offset;
+ }
+
+ rundest = window + window_posn;
+ runsrc = rundest - match_offset;
+ window_posn += match_length;
+ this_run -= match_length;
+
+ /* copy any wrapped around source data */
+ while ((runsrc < window) && (match_length-- > 0))
+ {
+ *rundest++ = *(runsrc + window_size); runsrc++;
+ }
+ /* copy match data - no worries about destination wraps */
+ while (match_length-- > 0) *rundest++ = *runsrc++;
+
+ }
+ }
+ break;
+
+ case LZX_BLOCKTYPE_UNCOMPRESSED:
+ if ((inpos + this_run) > endinp) return DECR_ILLEGALDATA;
+ memcpy(window + window_posn, inpos, (size_t) this_run);
+ inpos += this_run; window_posn += this_run;
+ break;
+
+ default:
+ return DECR_ILLEGALDATA; /* might as well */
+ }
+
+ }
+ }
+
+ if (togo != 0) return DECR_ILLEGALDATA;
+ memcpy(outpos, window + ((!window_posn) ? window_size : window_posn) -
+ outlen, (size_t) outlen);
+
+ LZX(window_posn) = window_posn;
+ LZX(R0) = R0;
+ LZX(R1) = R1;
+ LZX(R2) = R2;
+
+ /* intel E8 decoding */
+ if ((LZX(frames_read)++ < 32768) && LZX(intel_filesize) != 0)
+ {
+ if (outlen <= 6 || !LZX(intel_started))
+ {
+ LZX(intel_curpos) += outlen;
+ }
+ else
+ {
+ UBYTE *data = outpos;
+ UBYTE *dataend = data + outlen - 10;
+ LONG curpos = LZX(intel_curpos);
+ LONG filesize = LZX(intel_filesize);
+ LONG abs_off, rel_off;
+
+ LZX(intel_curpos) = curpos + outlen;
+
+ while (data < dataend)
+ {
+ if (*data++ != 0xE8)
+ {
+ curpos++; continue;
+ }
+ abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24);
+ if ((abs_off >= -curpos) && (abs_off < filesize))
+ {
+ rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize;
+ data[0] = (UBYTE) rel_off;
+ data[1] = (UBYTE) (rel_off >> 8);
+ data[2] = (UBYTE) (rel_off >> 16);
+ data[3] = (UBYTE) (rel_off >> 24);
+ }
+ data += 4;
+ curpos += 5;
+ }
+ }
+ }
+ return DECR_OK;
+}
+
diff --git a/parts/documentation/protocols/chm/decompress.h b/parts/documentation/protocols/chm/decompress.h
new file mode 100644
index 00000000..4fa42615
--- /dev/null
+++ b/parts/documentation/protocols/chm/decompress.h
@@ -0,0 +1,43 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __decompress_h__
+#define __decompress_h__
+
+#ifdef __cplusplus__
+extern "C" {
+#endif
+
+typedef unsigned char UBYTE; /* 8 bits exactly */
+typedef unsigned short UWORD; /* 16 bits (or more) */
+typedef unsigned int ULONG; /* 32 bits (or more) */
+typedef signed int LONG; /* 32 bits (or more) */
+
+typedef struct lzx_bits
+{
+ ULONG bb;
+ int bl;
+ UBYTE *ip;
+} lzx_bits;
+
+int LZXinit( int window );
+int LZXdecompress( UBYTE *inpos, int inlen, UBYTE *outpos, int outlen );
+
+#ifdef __cplusplus__
+}
+#endif
+
+#endif // __decompress_h__
diff --git a/parts/documentation/protocols/chm/kchmpart.cpp b/parts/documentation/protocols/chm/kchmpart.cpp
new file mode 100644
index 00000000..b72602c3
--- /dev/null
+++ b/parts/documentation/protocols/chm/kchmpart.cpp
@@ -0,0 +1,123 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "kchmpart.h"
+#include <qstring.h>
+
+#include <kinstance.h>
+#include <kglobal.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kaboutdata.h>
+
+extern "C"
+{
+ void* init_libkchmpart()
+ {
+ return new KChmPartFactory;
+ }
+}
+
+KInstance* KChmPartFactory::s_instance = 0L;
+KAboutData* KChmPartFactory::s_about = 0L;
+
+KChmPartFactory::KChmPartFactory( QObject* parent, const char* name )
+ : KParts::Factory( parent, name )
+{
+}
+
+KChmPartFactory::~KChmPartFactory()
+{
+ delete s_instance;
+ s_instance = 0L;
+ delete s_about;
+}
+
+KParts::Part* KChmPartFactory::createPartObject( QWidget *parentWidget, const char *, QObject *,
+ const char *name, const char *, const QStringList & )
+{
+ KChmPart* part = new KChmPart( parentWidget, name );
+ return part;
+}
+
+KInstance* KChmPartFactory::instance()
+{
+ if( !s_instance )
+ {
+ s_about = new KAboutData( "kchmpart",
+ I18N_NOOP( "KChm" ), "1.0pre" );
+ s_instance = new KInstance( s_about );
+ }
+ return s_instance;
+}
+
+
+KChmPart::KChmPart( QWidget * parent, const char * name )
+ : KDevHTMLPart( ), m_job(0)
+{
+ KInstance * instance = new KInstance( "kchmpart" );
+ setInstance( instance );
+ m_extension=new KParts::BrowserExtension(this);
+ setOptions(-1);
+}
+
+bool KChmPart::openURL( const KURL &url )
+{
+ KURL chmURL = url;
+ chmURL.setProtocol("ms-its");
+ chmURL.addPath("/");
+ return KDevHTMLPart::openURL(chmURL);
+}
+
+void KChmPart::slotDuplicate()
+{
+}
+
+void KChmPart::slotOpenInNewWindow(const KURL &url)
+{
+}
+
+
+/*
+bool KChmPart::openFile()
+{
+ if (m_job!=0)
+ m_job->kill();
+
+ m_htmlData.truncate(0);
+
+ m_job = KIO::get( QString("chm:")+m_file+"/", true, false );
+ connect( m_job, SIGNAL( data( KIO::Job *, const QByteArray &) ), SLOT( readData( KIO::Job *, const QByteArray &) ) );
+ connect( m_job, SIGNAL( result( KIO::Job * ) ), SLOT( jobDone( KIO::Job * ) ) );
+ return true;
+}
+
+void KChmPart::readData(KIO::Job * , const QByteArray & data)
+{
+ m_htmlData += data;
+}
+
+void KChmPart::jobDone( KIO::Job *)
+{
+ m_job=0;
+ begin();
+ write(QString::fromLocal8Bit(m_htmlData));
+ end();
+}
+*/
+#include "kchmpart.moc"
+
diff --git a/parts/documentation/protocols/chm/kchmpart.desktop b/parts/documentation/protocols/chm/kchmpart.desktop
new file mode 100644
index 00000000..1ddefe13
--- /dev/null
+++ b/parts/documentation/protocols/chm/kchmpart.desktop
@@ -0,0 +1,46 @@
+[Desktop Entry]
+Type=Service
+Exec=foobar
+Comment=Embeddable HTMLHelp Viewer
+Comment[ca]=Visor encastat de l'ajuda HTML
+Comment[da]=Indlejrbar HTMLHjælp-fremviser
+Comment[de]=Eingebetteter Betrachter für HTMLHelp
+Comment[el]=Ενσωματωμένος προβολέας HTMLHelp
+Comment[es]=Visor de ayuda HTML empotrable
+Comment[et]=Põimitav HTML-abifailide näitaja
+Comment[eu]=HTMLHelp ikustaile kapsulagarria
+Comment[fa]=مشاهده‌گر کمک قابل نهفتۀ زنگام
+Comment[fr]=Afficheur HTMLHelp intégrable
+Comment[ga]=Comhpháirt inleabaithe amharctha HTML
+Comment[gl]=Visor de HTMLHelp incrustable
+Comment[hi]=अंतर्निर्मित योग्य एचटीएमएल मदद प्रदर्शक
+Comment[hu]=Beágyazható HTML-es dokumentációnézegető
+Comment[it]=Visualizzatore integrabile per la guida HTML
+Comment[ja]=埋め込み可能な HTMLHelp ビューア
+Comment[ms]=Pelihat HTMLHelp Terbinadalam
+Comment[nds]=Inbettbor Kieker för HTMLHelp
+Comment[ne]=सम्मिलित गर्न मिल्ने HTMLHelp दृश्यकर्ता
+Comment[nl]=Ingebedde HTML Helpweergave
+Comment[pl]=Wbudowywalna przeglądarka pomocy w formacie HTML
+Comment[pt]=Visualizador de HTMLHelp Incorporado
+Comment[pt_BR]=Visualizador de Ajuda HTML Embutido
+Comment[ru]=Встроенный просмотр HTMLHelp
+Comment[sk]=Vložiteľný HTMLHelp prezerač
+Comment[sr]=Уградиви приказивач HTMLHelp-а
+Comment[sr@Latn]=Ugradivi prikazivač HTMLHelp-a
+Comment[sv]=Inbäddningsbar HTML-hjälpvisning
+Comment[ta]=HTML உதவி பார்வையாளரை உட்பொதி
+Comment[tg]=Намоиши ҳамвори HTMLHelp
+Comment[tr]=Gömülebilir HTMLHelp Görüntüleyicisi
+Comment[zh_CN]=嵌入的 HTML 帮助查看器
+Comment[zh_TW]=可嵌入 HTMLHelp 檢視器
+MimeType=application/chm
+Name=KChmPart
+Name[de]=CHM-Betrachter (KDevelop)
+Name[hi]=के-सीएचएम-पार्ट
+Name[nds]=Chm-Kieker (KDevelop)
+Name[pl]=Program KChm
+Name[sv]=Kchm-del
+ServiceTypes=KParts/ReadOnlyPart,Browser/View
+X-KDE-Library=libkchmpart
+X-KDevelop-Version=5
diff --git a/parts/documentation/protocols/chm/kchmpart.h b/parts/documentation/protocols/chm/kchmpart.h
new file mode 100644
index 00000000..03a12738
--- /dev/null
+++ b/parts/documentation/protocols/chm/kchmpart.h
@@ -0,0 +1,82 @@
+/* This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef __kchmpart_h__
+#define __kchmpart_h__
+
+#include <kparts/factory.h>
+#include <kparts/part.h>
+#include <kparts/browserextension.h>
+#include <khtml_part.h>
+#include <kio/job.h>
+#include <kio/jobclasses.h>
+#include <kdevhtmlpart.h>
+
+#include <qcstring.h>
+
+class KInstance;
+class KAboutData;
+
+class KChmPartFactory: public KParts::Factory
+{
+ Q_OBJECT
+ public:
+ KChmPartFactory( QObject *parent = 0, const char *name = 0 );
+ virtual ~KChmPartFactory();
+
+ virtual KParts::Part* createPartObject(
+ QWidget *parentWidget, const char *widgetName,
+ QObject *parent, const char *name,
+ const char *classname, const QStringList &args );
+
+ static KInstance *instance();
+
+ private:
+ static KInstance *s_instance;
+ static KAboutData *s_about;
+
+};
+
+
+class KChmPart : public KDevHTMLPart
+{
+ Q_OBJECT
+ public:
+ KChmPart( QWidget *, const char * = 0 );
+ KParts::BrowserExtension * extension() { return m_extension; }
+
+ public slots:
+ virtual bool openURL( const KURL & );
+/*
+ protected slots:
+ void readData(KIO::Job * , const QByteArray & data);
+ void jobDone( KIO::Job *);
+*/
+ protected:
+ //virtual bool openFile();
+ KInstance *m_instance;
+ KParts::BrowserExtension *m_extension;
+ KIO::TransferJob *m_job;
+ QCString m_htmlData;
+
+ protected slots:
+ virtual void slotDuplicate();
+ virtual void slotOpenInNewWindow(const KURL &url);
+
+};
+
+#endif // __kchmpart_h__
+
diff --git a/parts/documentation/searchview.cpp b/parts/documentation/searchview.cpp
new file mode 100644
index 00000000..253e9f10
--- /dev/null
+++ b/parts/documentation/searchview.cpp
@@ -0,0 +1,330 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Matthias Hoelzer-Kluepfel *
+ * hoelzer@kde.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "searchview.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qdir.h>
+#include <qregexp.h>
+
+#include <kpushbutton.h>
+#include <klistview.h>
+#include <klineedit.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kdialog.h>
+#include <kprocess.h>
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+
+#include <kdevpartcontroller.h>
+#include <kdevdocumentationplugin.h>
+
+#include "documentation_part.h"
+#include "docutils.h"
+
+SearchView::SearchView(DocumentationPart *part, QWidget *parent, const char *name)
+ :QWidget(parent, name), m_part(part)
+{
+ QVBoxLayout *l = new QVBoxLayout(this, 0, KDialog::spacingHint());
+
+ QVBoxLayout *l2 = new QVBoxLayout(l, 0);
+ QLabel *editLabel = new QLabel(i18n("Wor&ds to search:"), this);
+ l2->addWidget(editLabel);
+ QHBoxLayout *l21 = new QHBoxLayout(l2, 0);
+ m_edit = new KLineEdit(this);
+ editLabel->setBuddy(m_edit);
+ m_goSearchButton = new KPushButton(i18n("Se&arch"), this);
+ l21->addWidget(m_edit);
+ l21->addWidget(m_goSearchButton);
+
+ QGridLayout *l3 = new QGridLayout(l, 2, 2, 0);
+ m_searchMethodBox = new KComboBox(this);
+ m_searchMethodBox->insertItem(i18n("and"));
+ m_searchMethodBox->insertItem(i18n("or"));
+ QLabel *smLabel = new QLabel(m_searchMethodBox, i18n("&Method:"), this);
+ m_sortMethodBox = new KComboBox(this);
+ m_sortMethodBox->insertItem(i18n("Score"));
+ m_sortMethodBox->insertItem(i18n("Title"));
+ m_sortMethodBox->insertItem(i18n("Date"));
+ QLabel *rmLabel = new QLabel(m_sortMethodBox, i18n("S&ort by:"), this);
+ l3->addWidget(smLabel, 0, 0);
+ l3->addWidget(m_searchMethodBox, 0, 1);
+ l3->addWidget(rmLabel, 1, 0);
+ l3->addWidget(m_sortMethodBox, 1, 1);
+
+ QVBoxLayout *l4 = new QVBoxLayout(l, 0);
+ m_view = new KListView(this);
+ QLabel *vLabel = new QLabel(m_view, i18n("Search &results:"), this);
+ l4->addWidget(vLabel);
+ l4->addWidget(m_view);
+
+ QHBoxLayout *l5 = new QHBoxLayout(l, KDialog::spacingHint());
+ m_configButton = new KPushButton(i18n("Update Config"), this);
+ m_indexButton = new KPushButton(i18n("Update Index"), this);
+ l5->addWidget(m_configButton);
+ l5->addWidget(m_indexButton);
+ l5->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Fixed));
+
+ l->addSpacing(2);
+
+ m_view->setSorting(-1);
+ m_view->addColumn(i18n("Relevance"));
+ m_view->addColumn(i18n("Title"));
+ m_view->setColumnWidthMode(0, QListView::Maximum);
+ m_view->setColumnWidthMode(1, QListView::Maximum);
+ m_view->setAllColumnsShowFocus(true);
+ m_view->setResizeMode( QListView::LastColumn );
+
+ connect(m_configButton, SIGNAL(clicked()), this, SLOT(updateConfig()));
+ connect(m_indexButton, SIGNAL(clicked()), this, SLOT(updateIndex()));
+ connect(m_edit, SIGNAL(returnPressed()), this, SLOT(search()));
+ connect(m_goSearchButton, SIGNAL(clicked()), this, SLOT(search()));
+ connect(m_view, SIGNAL(executed(QListViewItem*)), this, SLOT(executed(QListViewItem*)));
+ connect(m_view, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int )),
+ this, SLOT(itemMouseButtonPressed(int, QListViewItem*, const QPoint&, int )));
+}
+
+SearchView::~SearchView()
+{
+}
+
+void SearchView::updateConfig()
+{
+ runHtdig("-c");
+}
+
+void SearchView::updateIndex()
+{
+ runHtdig("-i");
+ KConfig *config = m_part->config();
+ config->setGroup("htdig");
+ config->writeEntry("IsSetup", true);
+ config->sync();
+}
+
+void SearchView::runHtdig(const QString &arg)
+{
+ KProcess proc;
+ proc << "kdevelop-htdig" << arg;
+ proc.start(KProcess::DontCare);
+}
+
+void qt_enter_modal(QWidget *widget);
+void qt_leave_modal(QWidget *widget);
+
+void SearchView::search()
+{
+ KConfig *config = m_part->config();
+ config->setGroup("htdig");
+ if (config->readBoolEntry("IsSetup", false) == false)
+ {
+ KMessageBox::information(this, i18n("Full text search has to be set up before usage."));
+ if (!m_part->configure(1))
+ return;
+ KMessageBox::information(this, i18n("Now the full text search database will be created.\nWait for database creation to finish and then repeat search."));
+ updateIndex();
+ return;
+ }
+ QString exe = config->readPathEntry("htsearchbin", kapp->dirs()->findExe("htsearch"));
+ if (exe.isEmpty())
+ {
+ KMessageBox::error(this, i18n("Cannot find the htsearch executable.\nIt is part of the ht://Dig package that is used by KDevelop to perform full text search. Please install ht://Dig and use Documentation page in Configure KDevelop dialog to set the htsearch location."));
+ kdDebug() << "Can not find htsearch" << endl;
+ return;
+ }
+
+ QString indexdir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search");
+ QDir d;
+ if (indexdir.isEmpty() || !QFile::exists(indexdir + "/htdig.conf"))
+ {
+ if (QFile::exists("/var/lib/kdevelop3/helpindex/htdig.conf"))
+ indexdir = "/var/lib/kdevelop3/helpindex";
+ else if (QFile::exists("/var/lib/kdevelop/helpindex/htdig.conf"))
+ indexdir = "/var/lib/kdevelop/helpindex";
+
+ if (!QFile::exists(indexdir + "/htdig.conf"))
+ {
+ KMessageBox::error(this, i18n("Cannot find the htdig configuration file."));
+ kdDebug() << "Cannot find the htdig configuration file" << endl;
+ return;
+ }
+ }
+
+ QString savedir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search");
+ if (!d.exists(savedir))
+ d.mkdir(savedir);
+
+ QString query = QString("words=%1;method=%2;matchesperpage=%3;format=%4;sort=%5")
+ .arg(m_edit->text())
+ .arg(m_searchMethodBox->currentItem()==1? "or" : "and")
+ .arg(50)
+ .arg("builtin-short")
+ .arg(m_sortMethodBox->currentItem()==2? "date" : m_sortMethodBox->currentItem()==1? "title" : "score");
+
+ kdDebug(9002) << "starting kprocess" << endl;
+ kdDebug(9002) << "htdig line:" << exe << " -c " << (indexdir + "/htdig.conf ") << query << endl;
+ KProcess *proc = new KProcess;
+ QString picdir = kapp->dirs()->findResourceDir("data", "kdevdocumentation/pics/htdig.png");
+ proc->setEnvironment("PICDIR", picdir);
+ *proc << exe << "-c" << (indexdir + "/htdig.conf") << query;
+
+ connect( proc, SIGNAL(receivedStdout(KProcess *,char*,int)),
+ this, SLOT(htsearchStdout(KProcess *,char*,int)) );
+ connect( proc, SIGNAL(processExited(KProcess *)),
+ this, SLOT(htsearchExited(KProcess *)) );
+
+ searchResult = "";
+
+ if (!proc->start(KProcess::NotifyOnExit, KProcess::Stdout))
+ {
+ KMessageBox::error(this, i18n("Cannot start the htsearch executable."));
+ kdDebug() << "process start failed" << endl;
+ delete proc;
+ return;
+ }
+
+ // While receiving data from the subprocess, we want
+ // to block the user interface, but still get repaint
+ // events. Hack taken from NetAccess...
+ kapp->setOverrideCursor(waitCursor);
+ QWidget blocker(0, 0, WType_Dialog | WShowModal);
+ qt_enter_modal(&blocker);
+ kapp->enter_loop();
+ qt_leave_modal(&blocker);
+ kapp->restoreOverrideCursor();
+
+ if (!proc->normalExit() || proc->exitStatus() != 0)
+ {
+ kdDebug() << "Error running htsearch... returning now" << endl;
+ delete proc;
+ return;
+ }
+
+ delete proc;
+
+ // modify the search result
+ searchResult = searchResult.replace(QRegExp("http://localhost/"), "file:/");
+ searchResult = searchResult.replace(QRegExp("Content-type: text/html"), "");
+
+ // dump the search result
+ QFile f(savedir + "/results.html");
+ if (f.open(IO_WriteOnly))
+ {
+ QTextStream ts(&f);
+ ts << searchResult << endl;
+ f.close();
+ }
+
+ //show results
+ analyseSearchResults();
+// m_part->partController()->showDocument(KURL("file://" + indexdir + "/results.html"));
+}
+
+void SearchView::htsearchStdout(KProcess *, char *buffer, int len)
+{
+ searchResult += QString::fromLocal8Bit(buffer, len);
+}
+
+void SearchView::htsearchExited(KProcess *)
+{
+ kapp->exit_loop();
+}
+
+void SearchView::analyseSearchResults()
+{
+ m_view->clear();
+ QTextStream str(searchResult, IO_ReadOnly);
+ DocumentationItem *former = 0;
+ while (!str.eof())
+ {
+ QString line = str.readLine();
+
+ QRegExp starsExp("alt=\"\\*\"");
+ starsExp.setMinimal(true);
+ int stars = line.contains(starsExp);
+
+ QRegExp urlExp("<strong><a href=\"(.*)\">(.*)</a></strong>");
+ if (urlExp.search(line)==-1)
+ continue;
+ QString url = urlExp.cap(1);
+ QString title = urlExp.cap(2);
+
+ QString starsStr;
+ for (int i = 0; i < stars; ++i)
+ starsStr += "*";
+
+ if (former)
+ former = new DocumentationItem(DocumentationItem::Document, m_view, former, starsStr);
+ else
+ former = new DocumentationItem(DocumentationItem::Document, m_view, starsStr);
+ former->setText(1, title);
+ former->setURL(KURL(url));
+ }
+
+ executed( m_view->firstChild() );
+}
+
+void SearchView::executed(QListViewItem *item)
+{
+ DocumentationItem *d = dynamic_cast<DocumentationItem*>(item);
+ if (!d)
+ return;
+
+ m_part->partController()->showDocument(d->url());
+}
+
+void SearchView::itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int // c
+ )
+{
+ if ((button != Qt::RightButton) || (!item))
+ return;
+ DocumentationItem *docItem = dynamic_cast<DocumentationItem*>(item);
+ if (!docItem)
+ return;
+
+ DocUtils::docItemPopup(m_part, docItem, pos, true, false, 1);
+}
+
+void SearchView::setSearchTerm(const QString &term)
+{
+ m_edit->setText(term);
+}
+
+void SearchView::askSearchTerm()
+{
+ m_edit->setFocus();
+}
+
+void SearchView::focusInEvent(QFocusEvent */*e*/)
+{
+ m_edit->setFocus();
+}
+
+#include "searchview.moc"
diff --git a/parts/documentation/searchview.h b/parts/documentation/searchview.h
new file mode 100644
index 00000000..3d37fdfe
--- /dev/null
+++ b/parts/documentation/searchview.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SEARCHVIEW_H
+#define SEARCHVIEW_H
+
+#include <qwidget.h>
+
+class DocumentationPart;
+class KLineEdit;
+class KComboBox;
+class KListView;
+class KPushButton;
+class KProcess;
+class QListViewItem;
+
+class SearchView: public QWidget
+{
+ Q_OBJECT
+public:
+ SearchView(DocumentationPart *part, QWidget *parent = 0, const char *name = 0);
+ ~SearchView();
+
+public slots:
+ void search();
+ void setSearchTerm(const QString &term);
+ void askSearchTerm();
+
+protected slots:
+ void updateConfig();
+ void updateIndex();
+
+ void htsearchStdout(KProcess *, char *buffer, int len);
+ void htsearchExited(KProcess *);
+ void executed(QListViewItem *item);
+
+ void itemMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int c);
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+ void runHtdig(const QString &arg);
+ void analyseSearchResults();
+
+private:
+ DocumentationPart *m_part;
+
+ KLineEdit *m_edit;
+ KComboBox *m_searchMethodBox;
+ KComboBox *m_sortMethodBox;
+ KListView *m_view;
+ KPushButton *m_configButton;
+ KPushButton *m_indexButton;
+ KPushButton *m_goSearchButton;
+
+ QString searchResult;
+};
+
+#endif
diff --git a/parts/documentation/selecttopic.cpp b/parts/documentation/selecttopic.cpp
new file mode 100644
index 00000000..b0e64f4c
--- /dev/null
+++ b/parts/documentation/selecttopic.cpp
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "selecttopic.h"
+
+SelectTopic::SelectTopic(IndexItem::List &urls, QWidget *parent, const char *name)
+ :SelectTopicBase(parent, name), m_urls(urls)
+{
+ for (IndexItem::List::const_iterator it = m_urls.begin(); it != m_urls.end(); ++it)
+ topicBox->insertItem((*it).first);
+ if (topicBox->item(0))
+ {
+ topicBox->setCurrentItem(0);
+ topicBox->setSelected(topicBox->item(0), true);
+ }
+}
+
+void SelectTopic::accept()
+{
+ if (topicBox->currentItem() == -1)
+ return;
+ else
+ return QDialog::accept();
+}
+
+KURL SelectTopic::selectedURL()
+{
+ if (topicBox->currentItem() != -1)
+ return m_urls[topicBox->currentItem()].second;
+ return KURL();
+}
+
+#include "selecttopic.moc"
diff --git a/parts/documentation/selecttopic.h b/parts/documentation/selecttopic.h
new file mode 100644
index 00000000..1321bf99
--- /dev/null
+++ b/parts/documentation/selecttopic.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@mksat.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 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., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SELECT_TOPIC_H
+#define SELECT_TOPIC_H
+
+#include "selecttopicbase.h"
+
+#include "kdevdocumentationplugin.h"
+
+class SelectTopic: public SelectTopicBase{
+Q_OBJECT
+public:
+ SelectTopic(IndexItem::List &urls, QWidget *parent = 0, const char *name = 0);
+ KURL selectedURL();
+
+public slots:
+ virtual void accept();
+
+private:
+ IndexItem::List m_urls;
+};
+
+#endif
diff --git a/parts/documentation/selecttopicbase.ui b/parts/documentation/selecttopicbase.ui
new file mode 100644
index 00000000..b363be2a
--- /dev/null
+++ b/parts/documentation/selecttopicbase.ui
@@ -0,0 +1,142 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SelectTopicBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SelectTopicBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>429</width>
+ <height>211</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose Topic</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>topicLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Choose a topic for &lt;b&gt;%1&lt;/b&gt;:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listBox1</cstring>
+ </property>
+ </widget>
+ <widget class="QListBox" row="1" column="0">
+ <property name="name">
+ <cstring>topicBox</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectTopicBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SelectTopicBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>topicBox</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>SelectTopicBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>topicBox</sender>
+ <signal>returnPressed(QListBoxItem*)</signal>
+ <receiver>SelectTopicBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>topicBox</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot>newSlot()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/documentation/tools/Makefile.am b/parts/documentation/tools/Makefile.am
new file mode 100644
index 00000000..c2344983
--- /dev/null
+++ b/parts/documentation/tools/Makefile.am
@@ -0,0 +1,3 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+METASOURCES = AUTO
+SUBDIRS = htdig
diff --git a/parts/documentation/tools/htdig/Makefile.am b/parts/documentation/tools/htdig/Makefile.am
new file mode 100644
index 00000000..8f38a799
--- /dev/null
+++ b/parts/documentation/tools/htdig/Makefile.am
@@ -0,0 +1,6 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+METASOURCES = AUTO
+bin_PROGRAMS = kdevelop-htdig
+kdevelop_htdig_LDFLAGS = $(all_libraries) $(LIB_KIO) $(LIB_KDEUI)
+kdevelop_htdig_SOURCES = htdigindex.cpp
+noinst_HEADERS = htdigindex.h
diff --git a/parts/documentation/tools/htdig/htdigindex.cpp b/parts/documentation/tools/htdig/htdigindex.cpp
new file mode 100644
index 00000000..80161301
--- /dev/null
+++ b/parts/documentation/tools/htdig/htdigindex.cpp
@@ -0,0 +1,491 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Matthias Hoelzer-Kluepfel *
+ * hoelzer@kde.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 "htdigindex.h"
+
+#include <iostream>
+
+#include <qapplication.h>
+#include <qdir.h>
+#include <qfile.h>
+#include <qlayout.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qlabel.h>
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kprogress.h>
+
+#define INDEXER
+
+ProgressDialog::ProgressDialog(bool index, QWidget *parent, const char *name)
+ :KDialogBase(KDialogBase::Plain, i18n("Generating Search Index"), Cancel | Ok, Close,
+ parent, name, false)
+{
+ proc = 0;
+
+ indexdir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search");
+ QDir d; d.mkdir(indexdir);
+
+ KConfig config("kdevdocumentation", true);
+ config.setGroup("htdig");
+ databaseDir = config.readPathEntry("databaseDir", indexdir);
+
+ if (!index)
+ return;
+
+ d.mkdir( databaseDir );
+
+ showButtonOK( false );
+ QGridLayout *grid = new QGridLayout(plainPage(), 5,3, spacingHint());
+
+ QLabel *l = new QLabel(i18n("Scanning for files"), plainPage());
+ grid->addMultiCellWidget(l, 0, 0, 1, 2);
+
+ filesLabel = new QLabel(plainPage());
+ grid->addWidget(filesLabel, 1, 2);
+ setFilesScanned(0);
+
+ check1 = new QLabel(plainPage());
+ grid->addWidget(check1, 0, 0);
+
+ l = new QLabel(i18n("Extracting search terms"), plainPage());
+ grid->addMultiCellWidget(l, 2,2, 1,2);
+
+ bar = new KProgress(plainPage());
+ grid->addWidget(bar, 3,2);
+
+ check2 = new QLabel(plainPage());
+ grid->addWidget(check2, 2,0);
+
+ l = new QLabel(i18n("Generating index..."), plainPage());
+ grid->addMultiCellWidget(l, 4,4, 1,2);
+
+ check3 = new QLabel(plainPage());
+ grid->addWidget(check3, 4,0);
+
+ setState(0);
+
+ setMinimumWidth(300);
+ connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelClicked()));
+ connect(this, SIGNAL(okClicked()), this, SLOT(okClicked()));
+ QTimer::singleShot(0, this, SLOT(slotDelayedStart()));
+}
+
+ProgressDialog::~ProgressDialog()
+{
+}
+
+void ProgressDialog::slotDelayedStart()
+{
+ procdone = false;
+ scanDirectories();
+ if (!createConfig())
+ {
+ done(1);
+ return;
+ }
+ generateIndex();
+}
+
+void ProgressDialog::done(int r)
+{
+ if (!r)
+ {
+ showButtonCancel( false );
+ showButtonOK( true );
+ }
+ else
+ KDialogBase::done(r);
+}
+
+void ProgressDialog::setFilesScanned(int n)
+{
+ filesLabel->setText(i18n("Files processed: %1").arg(n));
+}
+
+void ProgressDialog::setFilesToDig(int n)
+{
+ bar->setTotalSteps(n);
+}
+
+void ProgressDialog::setFilesDigged(int n)
+{
+ bar->setValue(n);
+}
+
+void ProgressDialog::setState(int n)
+{
+ QPixmap unchecked = QPixmap(locate("data", "kdevdocumentation/pics/unchecked.xpm"));
+ QPixmap checked = QPixmap(locate("data", "kdevdocumentation/pics/checked.xpm"));
+
+ check1->setPixmap( n > 0 ? checked : unchecked);
+ check2->setPixmap( n > 1 ? checked : unchecked);
+ check3->setPixmap( n > 2 ? checked : unchecked);
+}
+
+
+void ProgressDialog::addDir(const QString &dir)
+{
+ kdDebug(9002) << "Add dir : " << dir << endl;
+ QDir d(dir, "*.html", QDir::Name|QDir::IgnoreCase, QDir::Files | QDir::Readable);
+ QStringList list = d.entryList();
+
+ QStringList::ConstIterator it;
+ for ( it=list.begin(); it!=list.end(); ++it )
+ {
+ if( (*it).right( 12 ).lower( ) == "-source.html" )
+ continue;
+
+ files.append(dir + "/" + *it);
+ setFilesScanned(++filesScanned);
+ }
+
+ QDir d2(dir, QString::null, QDir::Name|QDir::IgnoreCase, QDir::Dirs);
+ QStringList dlist = d2.entryList();
+
+ for ( it=dlist.begin(); it != dlist.end(); ++it )
+ {
+ if (*it != "." && *it != "..")
+ {
+ addDir(dir + "/" + *it);
+ kapp->processEvents();
+ }
+ if (procdone)
+ {
+ return;
+ }
+ }
+ kapp->processEvents();
+}
+
+void ProgressDialog::scanDirectories()
+{
+ QString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt");
+
+ QFile f(ftsLocationsFile);
+ if (!f.open(IO_ReadOnly))
+ return;
+ QTextStream str(&f);
+
+ filesScanned = 0;
+
+ while (!str.eof())
+ {
+ QString loc = str.readLine();
+ if (loc.isEmpty())
+ continue;
+ QFileInfo fi(loc);
+ if (fi.isDir())
+ addDir(loc);
+ else if (fi.isFile())
+ {
+ files.append(loc);
+ setFilesScanned(++filesScanned);
+ }
+ }
+}
+
+bool ProgressDialog::createConfig()
+{
+ // locate the common dir
+ QString language = KGlobal::locale()->language();
+ if (language == "C")
+ language = "en";
+
+ QString wrapper = locate("data", QString("kdevdocumentation/%1/wrapper.html").arg(language));
+ if (wrapper.isEmpty())
+ wrapper = locate("data", QString("kdevdocumentation/en/wrapper.html"));
+ if (wrapper.isEmpty())
+ return false;
+ wrapper = wrapper.left(wrapper.length()-12);
+
+ // locate the image dir
+ QString images = locate("data", "kdevdocumentation/pics/star.png");
+ if (images.isEmpty())
+ return false;
+ images = images.left(images.length()-8);
+
+ QFile f(indexdir + "/htdig.conf");
+ if (f.open(IO_WriteOnly))
+ {
+ QTextStream ts(&f);
+
+ ts << "database_dir:\t\t" << databaseDir << endl;
+ ts << "start_url:\t\t`" << indexdir << "/files`" << endl;
+ ts << "local_urls:\t\thttp://localhost/=/" << endl;
+// ts << "local_urls:\t\tfile://=" << endl;
+ ts << "local_urls_only:\ttrue" << endl;
+ ts << "limit_urls_to:\t\tfile:// http://localhost/" << endl;
+ ts << "maximum_pages:\t\t1" << endl;
+ ts << "image_url_prefix:\t" << images << endl;
+ ts << "star_image:\t\t" << images << "star.png" << endl;
+ ts << "star_blank:\t\t" << images << "star_blank.png" << endl;
+ ts << "compression_level:\t6" << endl;
+ ts << "max_hop_count:\t\t0" << endl;
+
+ ts << "search_results_wrapper:\t" << wrapper << "wrapper.html" << endl;
+ ts << "nothing_found_file:\t" << wrapper << "nomatch.html" << endl;
+ ts << "syntax_error_file:\t" << wrapper << "syntax.html" << endl;
+ ts << "bad_word_list:\t\t" << wrapper << "bad_words" << endl;
+
+ f.close();
+ return true;
+ }
+
+ return false;
+}
+
+#define CHUNK_SIZE 100
+
+void ProgressDialog::startHtdigProcess(bool initial)
+{
+ kdDebug(9002) << "htdig started" << endl;
+ delete proc;
+ proc = new KProcess();
+ *proc << exe << "-c" << (indexdir + "/htdig.conf");
+ if (initial) {
+ *proc << "-i";
+ }
+ connect(proc, SIGNAL(processExited(KProcess *)),
+ this, SLOT(htdigExited(KProcess *)));
+
+ htdigRunning = true;
+
+ // write out file
+ QFile f(indexdir+"/files");
+ if (!f.open(IO_WriteOnly)) {
+ kdDebug(9002) << "Could not open `files` for writing" << endl;
+ done(1);
+ return;
+ }
+ QTextStream ts(&f);
+ for (int i=0; i<CHUNK_SIZE; ++i, ++count) {
+ if (count >= filesToDig) {
+ procdone = true;
+ break;
+ }
+ // ts << "file://localhost/" + files[count] << endl;
+ ts << "http://localhost/" + files[count] << endl;
+ }
+ f.close();
+
+ // execute htdig
+ proc->start(KProcess::NotifyOnExit, KProcess::Stdout);
+}
+
+bool ProgressDialog::generateIndex()
+{
+ setState(1);
+ procdone = false;
+ // run htdig
+ KConfig config("kdevdocumentation", true);
+ config.setGroup("htdig");
+ exe = config.readPathEntry("htdigbin", kapp->dirs()->findExe("htdig"));
+ if (exe.isEmpty())
+ {
+ done(1);
+ return true;
+ }
+ filesToDig = files.count();
+ count = 0;
+ setFilesToDig(filesToDig);
+ filesDigged = 0;
+
+ // QDir d; d.mkdir(indexdir);
+ startHtdigProcess(true);
+ return true;
+}
+
+void ProgressDialog::htdigStdout(KProcess *, char *buffer, int len)
+{
+ QString line = QString(buffer).left(len);
+
+ int cnt=0, index=-1;
+ while ( (index = line.find("http://", index+1)) > 0)
+ cnt++;
+ filesDigged += cnt;
+
+ cnt=0, index=-1;
+ while ( (index = line.find("not changed", index+1)) > 0)
+ cnt++;
+ filesDigged -= cnt;
+
+ setFilesDigged(filesDigged);
+}
+
+void ProgressDialog::htdigExited(KProcess *proc)
+{
+ kdDebug(9002) << "htdig terminated" << endl;
+ if (!proc->normalExit())
+ {
+ delete proc;
+ proc = 0L;
+ done(1);
+ return;
+ }
+ if (proc && proc->exitStatus() != 0)
+ {
+ KMessageBox::sorry(0, i18n("Running htdig failed"));
+ delete proc;
+ proc = 0L;
+ done(1);
+ return;
+ }
+ htdigRunning = false;
+ filesDigged += CHUNK_SIZE;
+ setFilesDigged(filesDigged);
+ if (!procdone)
+ {
+ startHtdigProcess(false);
+ }
+ else
+ {
+ setFilesDigged(filesToDig);
+ setState(2);
+
+ KConfig config("kdevdocumentation", true);
+ config.setGroup("htdig");
+ // run htmerge -----------------------------------------------------
+ exe = config.readPathEntry("htmergebin", kapp->dirs()->findExe("htmerge"));
+ if (exe.isEmpty())
+ {
+ done(1);
+ return;
+ }
+ startHtmergeProcess();
+ }
+}
+
+void ProgressDialog::startHtmergeProcess()
+{
+ kdDebug(9002) << "htmerge started" << endl;
+ delete proc;
+ proc = new KProcess();
+ *proc << exe << "-c" << (indexdir + "/htdig.conf");
+
+ kdDebug(9002) << "Running htmerge" << endl;
+
+ connect(proc, SIGNAL(processExited(KProcess *)),
+ this, SLOT(htmergeExited(KProcess *)));
+
+ htmergeRunning = true;
+
+ proc->start(KProcess::NotifyOnExit, KProcess::Stdout);
+}
+
+void ProgressDialog::htmergeExited(KProcess *proc)
+{
+ kdDebug(9002) << "htmerge terminated" << endl;
+ htmergeRunning = false;
+ if (!proc->normalExit())
+ {
+ delete proc;
+ proc = 0L;
+ done(1);
+ return;
+ }
+ if (proc && proc->exitStatus() != 0)
+ {
+ KMessageBox::sorry(0, i18n("Running htmerge failed"));
+ delete proc;
+ proc = 0L;
+ done(1);
+ return;
+ }
+ setState(3);
+ done(0);
+}
+
+void ProgressDialog::cancelClicked()
+{
+ if ((htdigRunning || htmergeRunning) && proc && proc->isRunning())
+ {
+ kdDebug(9002) << "Killing " << (htdigRunning ? "htdig" : "htmerge") << "daemon with Sig. 9" << endl;
+ proc->kill(9);
+ htdigRunning = htmergeRunning = false;
+ }
+ else
+ {
+ procdone = true;
+ done(2);
+ }
+}
+
+void ProgressDialog::okClicked()
+{
+ if (proc)
+ proc->kill();
+
+ KDialogBase::done(0);
+}
+
+int main(int argc, char *argv[])
+{
+ static const KCmdLineOptions options[] =
+ {
+ { "c", I18N_NOOP( "Update user's htdig configuration file only" ), 0 },
+ { "i", I18N_NOOP( "-c and generate index" ), 0 },
+ KCmdLineLastOption
+ };
+
+ KAboutData aboutData("kdevelop-htdig", I18N_NOOP("KDevelop ht://Dig Indexer"),
+ "0.2", I18N_NOOP("KDE Index generator for documentation files."));
+
+ KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KApplication app;
+
+ KGlobal::locale()->setMainCatalogue("kdevelop");
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if (args->isSet("c"))
+ {
+ ProgressDialog *search = new ProgressDialog( false, 0, "progress dialog");
+
+ if (search->createConfig())
+ KMessageBox::information(0, i18n("Configuration file updated."));
+ else
+ KMessageBox::error(0, i18n("Configuration file update failed."));
+ }
+ else
+ if (args->isSet("i"))
+ {
+ ProgressDialog *search = new ProgressDialog(true, 0, "progress dialog");
+ app.setMainWidget(search);
+ search->show();
+ app.exec();
+ }
+ else
+ {
+ std::cerr << "Internal error generating index - unknown argument\n" << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+#include "htdigindex.moc"
diff --git a/parts/documentation/tools/htdig/htdigindex.h b/parts/documentation/tools/htdig/htdigindex.h
new file mode 100644
index 00000000..eec8b595
--- /dev/null
+++ b/parts/documentation/tools/htdig/htdigindex.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Matthias Hoelzer-Kluepfel *
+ * hoelzer@kde.org *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2004 by Alexander Dymo *
+ * cloudtemple@mksat.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 _HTDIGINDEX_H_
+#define _HTDIGINDEX_H_
+
+#include <kdialogbase.h>
+
+class QTimer;
+class QLabel;
+class KProcess;
+class KProgress;
+
+class ProgressDialog : public KDialogBase
+{
+ Q_OBJECT
+public:
+ ProgressDialog(bool index, QWidget *parent=0, const char *name=0);
+ ~ProgressDialog();
+
+ void addDir(const QString &dir);
+ void scanDirectories();
+ bool createConfig();
+ bool generateIndex();
+
+private slots:
+ void htdigStdout(KProcess *proc, char *buffer, int buflen);
+ void htdigExited(KProcess *proc);
+ void htmergeExited(KProcess *proc);
+ void cancelClicked();
+ void okClicked();
+ void slotDelayedStart();
+
+private:
+ void setFilesScanned(int s);
+ void setFilesToDig(int d);
+ void setFilesDigged(int d);
+ void setState(int n);
+ void done(int r);
+ void startHtdigProcess(bool initial);
+ void startHtmergeProcess();
+
+ QLabel *filesLabel, *check1, *check2, *check3;
+ KProgress *bar;
+
+ int count;
+ bool procdone;
+ QString databaseDir;
+ QString indexdir;
+ QString exe;
+ QStringList files;
+ KProcess *proc;
+ volatile int filesToDig, filesDigged, filesScanned;
+ bool htdigRunning, htmergeRunning;
+};
+
+#endif
diff --git a/parts/doxygen/Makefile.am b/parts/doxygen/Makefile.am
new file mode 100644
index 00000000..8682a63d
--- /dev/null
+++ b/parts/doxygen/Makefile.am
@@ -0,0 +1,19 @@
+# Here resides the doxygen part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/src -DDOXYWIZARD \
+ $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevdoxygen.la
+libkdevdoxygen_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevdoxygen_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevdoxygen_la_SOURCES = doxygenpart.cpp doxygenconfigwidget.cpp input.cpp config.cpp version.cpp messages.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevdoxygen.desktop
+
+rcdir = $(kde_datadir)/kdevdoxygen
+rc_DATA = kdevdoxygen.rc
diff --git a/parts/doxygen/README b/parts/doxygen/README
new file mode 100644
index 00000000..335789a8
--- /dev/null
+++ b/parts/doxygen/README
@@ -0,0 +1 @@
+Please read the README.dox file
diff --git a/parts/doxygen/README.dox b/parts/doxygen/README.dox
new file mode 100644
index 00000000..df791085
--- /dev/null
+++ b/parts/doxygen/README.dox
@@ -0,0 +1,75 @@
+/**
+\class DoxygenPart
+Integrates Doxygen - http://www.doxygen.org into KDevelop.
+It allows you to call the Doxygen executable from a KDevelop menu.
+It integrates a GUI into the "KDevelop Project Configuration dialog" to
+configure Doxygen (it reads and writes Doxygen Compatible configuration files).
+
+<b>To update to a newer doxygen version:</b>
+
+ -# Merge over the config.h and config.cpp files from the addon/doxywizard/
+ directory in the doxygen sources.
+ You'll need:
+ - GNU bison v1.34 or better
+ - GNU flex v2.5.4 or better
+ - Kompare from KDEsdk or kdiff3
+ .
+ You'll have to issue:
+ <code>\verbatim$ ./configure --with-doxywizard && make\endverbatim</code>
+ to get the config.h and config.cpp files on this directory.
+ You should also copy config.l if you'd like to do some debugging.
+ <br>
+ -# To do the merge on config.cpp you should use:
+ <code>\verbatim$ kdiff3 doxygen-location/src/config.cpp kdevelop-location/parts/doxygen/config.cpp\endverbatim</code>
+ - Be careful because doxygen uses the deprecated QList class while KDevelop
+ uses the new QPtrList so you should not merge certain lines of code!!!
+ - Be careful because doxygen uses the deprecated QRegExp::match() method while
+ KDevelop uses the new QRegExp::search() and QRegExp::matchedLength() mehtods
+ instead so you should not merge certain lines of code!!!
+ - Be careful because KDevlop uses the QFile::encodeName() function and the
+ original doxygen code doesn't. So do NOT delete the QFile::encodeName() calls.
+ .
+ <br>
+ -# To do the merge on config.h you should use:
+ <code>\verbatim$ kdiff3 doxygen-location/src/config.h kdevelop-location/parts/doxygen/config.h\endverbatim</code>
+ - Again, be careful because doxygen uses the deprecated QList class while KDevelop
+ uses the new QPtrList so you should not merge certain lines of code!!!
+ .
+ <br>
+ .
+ -# Copy over the file <code>doxygen-location/src/lang_cfg.h</code> to the <code>kdevelop-location/parts/doxygen/</code> directory.
+ -# Add the new i18n strings to messages.cpp.
+ To do so, run KDevelop and go to Project-> Project Options... -> Doxygen.
+ Take a look at KDevelop' console output, it will warn you about the missing
+ messages. Add them to messages.cpp file.
+ -# Update version.cpp
+ -# Add anything else you needed to do, to get it to compile, to the parts/doxygen/README.dox file.
+
+Everything else we can customize for our look & feel.
+
+\authors <a href="mailto:dimitri AT stack.nl">Dimitri van Heesch</a>
+
+\maintainer <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+\maintainer <a href="mailto:a.lucas at tu-bs dot de">Amilcar Lucas</a>
+
+
+\feature Call Doxygen executable from a KDevelop menu.
+\feature Configure Doxygen inside KDevelop.
+\feature Create a configuration file with correct ProjectName, Author, Version and
+ location of source files whenever a new KDevelop project is created.
+\feature Automaticaly generate a Doxygen search database whenever the "search engine" option in Doxygen configuration is activated and you "Run Doxygen".
+
+
+\requirement You need to install the <a href="http://www.doxygen.org">Doxygen</a> binaries in your machine. This part supports
+all versions up to the version stated on the version.cpp file. As usual it is
+recomended to use the latest version or at least >= 1.3.4.
+\requirement It is recomended that you also install <a href="http://www.graphviz.org">dot</a> >= 1.8.7 (tool to generate graphical
+dependencies).
+
+
+\bug doesn't resize the configuration GUI properly.
+
+
+\faq <b>Do I need to install Doxygen?</b>
+ Yes
+*/
diff --git a/parts/doxygen/config.cpp b/parts/doxygen/config.cpp
new file mode 100644
index 00000000..a36cf682
--- /dev/null
+++ b/parts/doxygen/config.cpp
@@ -0,0 +1,5166 @@
+const char *portable_commandExtension()
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ return ".exe";
+#else
+ return "";
+#endif
+}
+
+bool portable_fileSystemIsCaseSensitive()
+{
+#if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__)
+ return false;
+#else
+ return true;
+#endif
+}
+
+#define yy_create_buffer configYY_create_buffer
+#define yy_delete_buffer configYY_delete_buffer
+#define yy_scan_buffer configYY_scan_buffer
+#define yy_scan_string configYY_scan_string
+#define yy_scan_bytes configYY_scan_bytes
+#define yy_flex_debug configYY_flex_debug
+#define yy_init_buffer configYY_init_buffer
+#define yy_flush_buffer configYY_flush_buffer
+#define yy_load_buffer_state configYY_load_buffer_state
+#define yy_switch_to_buffer configYY_switch_to_buffer
+#define yyin configYYin
+#define yyleng configYYleng
+#define yylex configYYlex
+#define yyout configYYout
+#define yyrestart configYYrestart
+#define yytext configYYtext
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = (int) (yy_cp - yy_bp); \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 24
+#define YY_END_OF_BUFFER 25
+static yyconst short int yy_accept[100] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 25, 22, 23, 22, 22, 2, 8, 22, 8, 19,
+ 22, 9, 13, 12, 2, 12, 12, 17, 18, 11,
+ 10, 18, 18, 16, 14, 14, 16, 16, 7, 22,
+ 7, 7, 0, 21, 0, 8, 0, 0, 0, 8,
+ 3, 0, 20, 12, 12, 17, 18, 11, 18, 15,
+ 7, 0, 7, 0, 0, 4, 12, 18, 7, 7,
+ 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
+ 6, 0, 0, 0, 0, 0, 0, 5, 0
+
+ } ;
+
+static yyconst int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
+ 1, 1, 7, 1, 1, 1, 1, 8, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
+ 10, 1, 1, 11, 12, 13, 14, 15, 16, 13,
+ 13, 17, 18, 13, 13, 19, 13, 20, 13, 21,
+ 13, 13, 13, 22, 23, 13, 13, 13, 13, 13,
+ 1, 24, 1, 1, 25, 1, 13, 13, 13, 26,
+
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 27,
+ 13, 13, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst int yy_meta[29] =
+ { 0,
+ 1, 2, 3, 4, 3, 5, 6, 7, 7, 6,
+ 1, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 1, 7, 8, 8, 1
+ } ;
+
+static yyconst short int yy_base[112] =
+ { 0,
+ 0, 1, 29, 0, 55, 56, 82, 108, 135, 162,
+ 190, 0, 217, 244, 58, 65, 66, 68, 271, 298,
+ 145, 408, 408, 3, 117, 408, 0, 125, 6, 408,
+ 7, 408, 408, 0, 0, 15, 115, 0, 0, 133,
+ 408, 18, 107, 408, 408, 408, 62, 106, 0, 0,
+ 70, 104, 73, 408, 122, 0, 109, 93, 118, 95,
+ 408, 105, 408, 0, 118, 0, 0, 123, 116, 408,
+ 0, 117, 113, 94, 105, 408, 92, 91, 408, 90,
+ 408, 82, 0, 0, 0, 75, 66, 62, 102, 13,
+ 408, 41, 48, 5, 9, 89, 113, 408, 408, 326,
+
+ 334, 342, 350, 358, 360, 367, 375, 4, 383, 391,
+ 399
+ } ;
+
+static yyconst short int yy_def[112] =
+ { 0,
+ 100, 100, 99, 3, 100, 100, 100, 100, 101, 101,
+ 99, 11, 102, 102, 103, 103, 100, 100, 104, 104,
+ 99, 99, 99, 99, 99, 99, 105, 99, 106, 99,
+ 99, 99, 99, 107, 107, 107, 107, 108, 109, 99,
+ 99, 109, 109, 99, 99, 99, 99, 99, 110, 111,
+ 110, 110, 99, 99, 99, 105, 99, 99, 99, 106,
+ 99, 99, 99, 107, 107, 108, 109, 99, 109, 99,
+ 110, 111, 110, 99, 99, 99, 107, 109, 99, 110,
+ 99, 99, 107, 109, 110, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 0, 99,
+
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99
+ } ;
+
+static yyconst short int yy_nxt[437] =
+ { 0,
+ 99, 99, 23, 23, 53, 54, 53, 58, 62, 63,
+ 62, 66, 59, 99, 90, 61, 53, 54, 53, 53,
+ 54, 53, 91, 24, 24, 96, 95, 25, 25, 22,
+ 22, 23, 22, 22, 26, 22, 27, 27, 22, 28,
+ 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+ 29, 29, 24, 29, 29, 29, 25, 30, 30, 94,
+ 45, 93, 46, 53, 54, 53, 70, 45, 23, 46,
+ 23, 53, 54, 53, 53, 54, 53, 89, 31, 31,
+ 88, 47, 25, 25, 32, 48, 33, 26, 47, 24,
+ 97, 24, 48, 25, 58, 25, 58, 87, 98, 59,
+
+ 86, 59, 61, 90, 61, 24, 62, 63, 62, 25,
+ 32, 91, 33, 26, 97, 85, 84, 83, 82, 81,
+ 80, 79, 98, 78, 68, 77, 92, 76, 75, 74,
+ 73, 24, 55, 69, 68, 25, 22, 32, 22, 33,
+ 35, 65, 57, 55, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 36, 99,
+ 99, 99, 37, 22, 32, 22, 33, 35, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 36, 99, 99, 99, 37,
+ 22, 22, 32, 22, 22, 26, 22, 22, 22, 22,
+
+ 22, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 38, 38, 38, 24, 22, 38, 38, 25, 40, 41,
+ 22, 33, 26, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 42, 99, 99, 99, 43, 40, 41, 22, 33, 26,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 42, 99, 99,
+ 99, 43, 22, 23, 22, 50, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 51, 99, 99, 99, 52, 22,
+
+ 23, 22, 50, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 51, 99, 99, 99, 52, 22, 22, 22, 22,
+ 22, 22, 22, 22, 34, 34, 34, 34, 34, 34,
+ 34, 34, 39, 39, 39, 39, 39, 39, 39, 39,
+ 44, 44, 44, 44, 44, 44, 44, 44, 49, 49,
+ 49, 49, 49, 49, 49, 49, 56, 56, 60, 99,
+ 99, 99, 60, 60, 60, 64, 99, 99, 99, 64,
+ 64, 64, 64, 67, 99, 99, 99, 99, 67, 67,
+ 67, 71, 99, 99, 99, 71, 71, 71, 71, 72,
+
+ 72, 99, 72, 72, 72, 72, 72, 21, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99
+ } ;
+
+static yyconst short int yy_chk[437] =
+ { 0,
+ 0, 0, 1, 2, 24, 24, 24, 29, 31, 31,
+ 31, 108, 29, 0, 90, 29, 36, 36, 36, 42,
+ 42, 42, 90, 1, 2, 95, 94, 1, 2, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 5, 6, 93,
+ 15, 92, 15, 47, 47, 47, 47, 16, 17, 16,
+ 18, 51, 51, 51, 53, 53, 53, 88, 5, 6,
+ 87, 15, 5, 6, 7, 15, 7, 7, 16, 17,
+ 96, 18, 16, 17, 58, 18, 60, 86, 96, 58,
+
+ 82, 60, 58, 89, 60, 7, 62, 62, 62, 7,
+ 8, 89, 8, 8, 97, 80, 78, 77, 75, 74,
+ 73, 72, 97, 69, 68, 65, 89, 59, 57, 55,
+ 52, 8, 48, 43, 40, 8, 9, 9, 9, 9,
+ 9, 37, 28, 25, 21, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
+ 0, 0, 9, 10, 10, 10, 10, 10, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 10, 0, 0, 0, 10,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 13, 13,
+ 13, 13, 13, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 13, 0, 0, 0, 13, 14, 14, 14, 14, 14,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
+ 0, 14, 19, 19, 19, 19, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 19, 0, 0, 0, 19, 20,
+
+ 20, 20, 20, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 20, 0, 0, 0, 20, 100, 100, 100, 100,
+ 100, 100, 100, 100, 101, 101, 101, 101, 101, 101,
+ 101, 101, 102, 102, 102, 102, 102, 102, 102, 102,
+ 103, 103, 103, 103, 103, 103, 103, 103, 104, 104,
+ 104, 104, 104, 104, 104, 104, 105, 105, 106, 0,
+ 0, 0, 106, 106, 106, 107, 0, 0, 0, 107,
+ 107, 107, 107, 109, 0, 0, 0, 0, 109, 109,
+ 109, 110, 0, 0, 0, 110, 110, 110, 110, 111,
+
+ 111, 0, 111, 111, 111, 111, 111, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
+ 99, 99, 99, 99, 99, 99
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "config.l"
+#define INITIAL 0
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2006 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ */
+#line 16 "config.l"
+
+/*
+ * includes
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
+#include <stdarg.h>
+
+#include <qfileinfo.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+#include <qptrstack.h>
+
+#include "config.h"
+#include "version.h"
+
+#include "lang_cfg.h"
+
+#undef Config_getString
+#undef Config_getInt
+#undef Config_getList
+#undef Config_getEnum
+#undef Config_getBool
+
+// use in-class definitions
+#define Config_getString(val) getString(__FILE__,__LINE__,val)
+#define Config_getInt(val) getInt(__FILE__,__LINE__,val)
+#define Config_getList(val) getList(__FILE__,__LINE__,val)
+#define Config_getEnum(val) getEnum(__FILE__,__LINE__,val)
+#define Config_getBool(val) getBool(__FILE__,__LINE__,val)
+
+void config_err(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+void config_warn(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
+#define MAX_INCLUDE_DEPTH 10
+#define YY_NEVER_INTERACTIVE 1
+
+/* -----------------------------------------------------------------
+ */
+
+QCString ConfigOption::convertToComment(const QCString &s)
+{
+ QCString result;
+ if (s.isEmpty()) return result;
+ else
+ {
+ result+="# ";
+ QCString tmp=s.stripWhiteSpace();
+ char *p=tmp.data();
+ char c;
+ while ((c=*p++))
+ {
+ if (c=='\n') result+="\n# ";
+ else result+=c;
+ }
+ result+='\n';
+ }
+ return result;
+}
+
+void ConfigOption::writeBoolValue(QTextStream &t,bool v)
+{
+ if (v) t << "YES"; else t << "NO";
+}
+
+void ConfigOption::writeIntValue(QTextStream &t,int i)
+{
+ t << i;
+}
+
+void ConfigOption::writeStringValue(QTextStream &t,QCString &s)
+{
+ const char *p=s.data();
+ char c;
+ bool needsEscaping=FALSE;
+ if (p)
+ {
+ while ((c=*p++)!=0 && !needsEscaping)
+ needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#');
+ if (needsEscaping)
+ {
+ t << "\"";
+ p=s.data();
+ while (*p)
+ {
+ if (*p=='"') t << "\\"; // escape quotes
+ t << *p++;
+ }
+ t << "\"";
+ }
+ else
+ {
+ t << s;
+ }
+ }
+}
+
+void ConfigOption::writeStringList(QTextStream &t,QStrList &l)
+{
+ const char *p = l.first();
+ bool first=TRUE;
+ while (p)
+ {
+ QCString s=p;
+ if (!first) t << " ";
+ first=FALSE;
+ writeStringValue(t,s);
+ p = l.next();
+ if (p) t << " \\" << endl;
+ }
+}
+
+/* -----------------------------------------------------------------
+ */
+
+Config *Config::m_instance = 0;
+
+void ConfigInt::convertStrToVal()
+{
+ if (!m_valueString.isEmpty())
+ {
+ bool ok;
+ int val = m_valueString.toInt(&ok);
+ if (!ok || val<m_minVal || val>m_maxVal)
+ {
+ config_warn("Warning: argument `%s' for option %s is not a valid number in the range [%d..%d]!\n"
+ "Using the default: %d!\n",m_valueString.data(),m_name.data(),m_minVal,m_maxVal,m_value);
+ }
+ m_value=val;
+ }
+}
+
+void ConfigBool::convertStrToVal()
+{
+ QCString val = m_valueString.stripWhiteSpace().lower();
+ if (!val.isEmpty())
+ {
+ if (val=="yes" || val=="true" || val=="1")
+ {
+ m_value=TRUE;
+ }
+ else if (val=="no" || val=="false" || val=="0")
+ {
+ m_value=FALSE;
+ }
+ else
+ {
+ config_warn("Warning: argument `%s' for option %s is not a valid boolean value\n"
+ "Using the default: %s!\n",m_valueString.data(),m_name.data(),m_value?"YES":"NO");
+ }
+ }
+}
+
+QCString &Config::getString(const char *fileName,int num,const char *name) const
+{
+ ConfigOption *opt = m_dict->find(name);
+ if (opt==0)
+ {
+ config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
+ exit(1);
+ }
+ else if (opt->kind()!=ConfigOption::O_String)
+ {
+ config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
+ exit(1);
+ }
+ return *((ConfigString *)opt)->valueRef();
+}
+
+QStrList &Config::getList(const char *fileName,int num,const char *name) const
+{
+ ConfigOption *opt = m_dict->find(name);
+ if (opt==0)
+ {
+ config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
+ exit(1);
+ }
+ else if (opt->kind()!=ConfigOption::O_List)
+ {
+ config_err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
+ exit(1);
+ }
+ return *((ConfigList *)opt)->valueRef();
+}
+
+QCString &Config::getEnum(const char *fileName,int num,const char *name) const
+{
+ ConfigOption *opt = m_dict->find(name);
+ if (opt==0)
+ {
+ config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
+ exit(1);
+ }
+ else if (opt->kind()!=ConfigOption::O_Enum)
+ {
+ config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
+ exit(1);
+ }
+ return *((ConfigEnum *)opt)->valueRef();
+}
+
+int &Config::getInt(const char *fileName,int num,const char *name) const
+{
+ ConfigOption *opt = m_dict->find(name);
+ if (opt==0)
+ {
+ config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
+ exit(1);
+ }
+ else if (opt->kind()!=ConfigOption::O_Int)
+ {
+ config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
+ exit(1);
+ }
+ return *((ConfigInt *)opt)->valueRef();
+}
+
+bool &Config::getBool(const char *fileName,int num,const char *name) const
+{
+ ConfigOption *opt = m_dict->find(name);
+ if (opt==0)
+ {
+ config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
+ exit(1);
+ }
+ else if (opt->kind()!=ConfigOption::O_Bool)
+ {
+ config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
+ exit(1);
+ }
+ return *((ConfigBool *)opt)->valueRef();
+}
+
+/* -----------------------------------------------------------------
+ *
+ * static variables
+ */
+
+struct ConfigFileState
+{
+ int lineNr;
+ FILE *filePtr;
+ YY_BUFFER_STATE oldState;
+ YY_BUFFER_STATE newState;
+ QCString fileName;
+};
+
+static const char *inputString;
+static int inputPosition;
+static int yyLineNr;
+static QCString yyFileName;
+static QCString tmpString;
+static QCString *s=0;
+static bool *b=0;
+static QStrList *l=0;
+static int lastState;
+static QCString elemStr;
+static QCString includeName;
+static QStrList includePathList;
+static QPtrStack<ConfigFileState> includeStack;
+static int includeDepth;
+
+static QCString tabSizeString;
+static QCString maxInitLinesString;
+static QCString colsInAlphaIndexString;
+static QCString enumValuesPerLineString;
+static QCString treeViewWidthString;
+static QCString maxDotGraphWidthString;
+static QCString maxDotGraphHeightString;
+
+static Config *config;
+
+/* -----------------------------------------------------------------
+ */
+#undef YY_INPUT
+#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
+
+static int yyread(char *buf,int max_size)
+{
+ // no file included
+ if (includeStack.isEmpty())
+ {
+ int c=0;
+ if (inputString==0) return c;
+ while( c < max_size && inputString[inputPosition] )
+ {
+ *buf = inputString[inputPosition++] ;
+ c++; buf++;
+ }
+ return c;
+ }
+ else
+ {
+ //assert(includeStack.current()->newState==YY_CURRENT_BUFFER);
+ return (int)fread(buf,1,max_size,includeStack.current()->filePtr);
+ }
+}
+
+
+static FILE *tryPath(const char *path,const char *fileName)
+{
+ QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
+ QFileInfo fi(absName);
+ if (fi.exists() && fi.isFile())
+ {
+ FILE *f=fopen(absName,"r");
+ if (!f) config_err("Error: could not open file %s for reading\n",absName.data());
+ return f;
+ }
+ return 0;
+}
+
+static void substEnvVarsInStrList(QStrList &sl);
+static void substEnvVarsInString(QCString &s);
+
+static bool isAbsolute(const char * fileName)
+{
+# ifdef _WIN32
+ if (isalpha (fileName [0]) && fileName[1] == ':')
+ fileName += 2;
+# endif
+ char const fst = fileName [0];
+ if (fst == '/') {
+ return true;
+ }
+# ifdef _WIN32
+ if (fst == '\\')
+ return true;
+# endif
+ return false;
+}
+
+static FILE *findFile(const char *fileName)
+{
+ if(isAbsolute(fileName))
+ return tryPath(NULL, fileName);
+ substEnvVarsInStrList(includePathList);
+ char *s=includePathList.first();
+ while (s) // try each of the include paths
+ {
+ FILE *f = tryPath(s,fileName);
+ if (f) return f;
+ s=includePathList.next();
+ }
+ // try cwd if includePathList fails
+ return tryPath(".",fileName);
+}
+
+static void readIncludeFile(const char *incName)
+{
+ if (includeDepth==MAX_INCLUDE_DEPTH) {
+ config_err("Error: maximum include depth (%d) reached, %s is not included. Aborting...\n",
+ MAX_INCLUDE_DEPTH,incName);
+ exit(1);
+ }
+
+ QCString inc = incName;
+ substEnvVarsInString(inc);
+ inc = inc.stripWhiteSpace();
+ uint incLen = inc.length();
+ if (inc.at(0)=='"' && inc.at(incLen-1)=='"') // strip quotes
+ {
+ inc=inc.mid(1,incLen-2);
+ }
+
+ FILE *f;
+
+ if ((f=findFile(inc))) // see if the include file can be found
+ {
+ // For debugging
+#if SHOW_INCLUDES
+ for (i=0;i<includeStack.count();i++) msg(" ");
+ msg("@INCLUDE = %s: parsing...\n",inc.data());
+#endif
+
+ // store the state of the old file
+ ConfigFileState *fs=new ConfigFileState;
+ fs->oldState=YY_CURRENT_BUFFER;
+ fs->lineNr=yyLineNr;
+ fs->fileName=yyFileName;
+ fs->filePtr=f;
+ // push the state on the stack
+ includeStack.push(fs);
+ // set the scanner to the include file
+ yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
+ fs->newState=YY_CURRENT_BUFFER;
+ yyFileName=inc;
+ includeDepth++;
+ }
+ else
+ {
+ config_err("Error: @INCLUDE = %s: not found!\n",inc.data());
+ exit(1);
+ }
+}
+
+
+#define YY_NO_UNPUT 1
+#define Start 1
+
+#define SkipComment 2
+
+#define SkipInvalid 3
+
+#define GetString 4
+
+#define GetBool 5
+
+#define GetStrList 6
+
+#define GetQuotedString 7
+
+#define GetEnvVar 8
+
+#define Include 9
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = '*', n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 425 "config.l"
+
+
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 100 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 408 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 427 "config.l"
+
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 428 "config.l"
+{ BEGIN(SkipComment); }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 429 "config.l"
+{ QCString cmd=yytext;
+ cmd=cmd.left(cmd.length()-1).stripWhiteSpace();
+ ConfigOption *option = config->get(cmd);
+ if (option==0) // oops not known
+ {
+ config_err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n",
+ yytext,yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ }
+ else // known tag
+ {
+ switch(option->kind())
+ {
+ case ConfigOption::O_Info:
+ // shouldn't get here!
+ BEGIN(SkipInvalid);
+ break;
+ case ConfigOption::O_List:
+ l = ((ConfigList *)option)->valueRef();
+ l->clear();
+ elemStr="";
+ BEGIN(GetStrList);
+ break;
+ case ConfigOption::O_Enum:
+ s = ((ConfigEnum *)option)->valueRef();
+ s->resize(0);
+ BEGIN(GetString);
+ break;
+ case ConfigOption::O_String:
+ s = ((ConfigString *)option)->valueRef();
+ s->resize(0);
+ BEGIN(GetString);
+ break;
+ case ConfigOption::O_Int:
+ s = ((ConfigInt *)option)->valueStringRef();
+ s->resize(0);
+ BEGIN(GetString);
+ break;
+ case ConfigOption::O_Bool:
+ s = ((ConfigBool *)option)->valueStringRef();
+ s->resize(0);
+ BEGIN(GetString);
+ break;
+ case ConfigOption::O_Obsolete:
+ config_err("Warning: Tag `%s' at line %d of file %s has become obsolete.\n"
+ "To avoid this warning please update your configuration "
+ "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ break;
+ }
+ }
+ }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 481 "config.l"
+{ QCString cmd=yytext;
+ cmd=cmd.left(cmd.length()-2).stripWhiteSpace();
+ ConfigOption *option = config->get(cmd);
+ if (option==0) // oops not known
+ {
+ config_err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n",
+ yytext,yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ }
+ else // known tag
+ {
+ switch(option->kind())
+ {
+ case ConfigOption::O_Info:
+ // shouldn't get here!
+ BEGIN(SkipInvalid);
+ break;
+ case ConfigOption::O_List:
+ l = ((ConfigList *)option)->valueRef();
+ elemStr="";
+ BEGIN(GetStrList);
+ break;
+ case ConfigOption::O_Enum:
+ case ConfigOption::O_String:
+ case ConfigOption::O_Int:
+ case ConfigOption::O_Bool:
+ config_err("Warning: operator += not supported for `%s'. Ignoring line at line %d, file %s\n",
+ yytext,yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ break;
+ case ConfigOption::O_Obsolete:
+ config_err("Warning: Tag `%s' at line %d of file %s has become obsolete.\n"
+ "To avoid this warning please update your configuration "
+ "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ break;
+ }
+ }
+ }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 520 "config.l"
+{ BEGIN(GetStrList); l=&includePathList; l->clear(); elemStr=""; }
+ YY_BREAK
+/* include a config file */
+case 6:
+YY_RULE_SETUP
+#line 522 "config.l"
+{ BEGIN(Include);}
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 523 "config.l"
+{
+ readIncludeFile(yytext);
+ BEGIN(Start);
+ }
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(Start):
+case YY_STATE_EOF(SkipComment):
+case YY_STATE_EOF(SkipInvalid):
+case YY_STATE_EOF(GetString):
+case YY_STATE_EOF(GetBool):
+case YY_STATE_EOF(GetStrList):
+case YY_STATE_EOF(GetQuotedString):
+case YY_STATE_EOF(GetEnvVar):
+case YY_STATE_EOF(Include):
+#line 527 "config.l"
+{
+ //printf("End of include file\n");
+ //printf("Include stack depth=%d\n",g_includeStack.count());
+ if (includeStack.isEmpty())
+ {
+ //printf("Terminating scanner!\n");
+ yyterminate();
+ }
+ else
+ {
+ ConfigFileState *fs=includeStack.pop();
+ fclose(fs->filePtr);
+ YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
+ yy_switch_to_buffer( fs->oldState );
+ yy_delete_buffer( oldBuf );
+ yyLineNr=fs->lineNr;
+ yyFileName=fs->fileName;
+ delete fs; fs=0;
+ includeDepth--;
+ }
+ }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 549 "config.l"
+{ config_err("Warning: ignoring unknown tag `%s' at line %d, file %s\n",yytext,yyLineNr,yyFileName.data()); }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 550 "config.l"
+{ yyLineNr++; BEGIN(Start); }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 551 "config.l"
+{
+ yyLineNr++;
+ if (!elemStr.isEmpty())
+ {
+ //printf("elemStr1=`%s'\n",elemStr.data());
+ l->append(elemStr);
+ }
+ BEGIN(Start);
+ }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 560 "config.l"
+{
+ if (!elemStr.isEmpty())
+ {
+ //printf("elemStr2=`%s'\n",elemStr.data());
+ l->append(elemStr);
+ }
+ elemStr.resize(0);
+ }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 568 "config.l"
+{ (*s)+=yytext; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 569 "config.l"
+{ lastState=YY_START;
+ BEGIN(GetQuotedString);
+ tmpString.resize(0);
+ }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 573 "config.l"
+{
+ //printf("Quoted String = `%s'\n",tmpString.data());
+ if (lastState==GetString)
+ (*s)+=tmpString;
+ else
+ elemStr+=tmpString;
+ if (*yytext=='\n')
+ {
+ config_err("Warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data());
+ yyLineNr++;
+ }
+ BEGIN(lastState);
+ }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 586 "config.l"
+{
+ tmpString+='"';
+ }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 589 "config.l"
+{ tmpString+=*yytext; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 590 "config.l"
+{
+ QCString bs=yytext;
+ bs=bs.upper();
+ if (bs=="YES" || bs=="1")
+ *b=TRUE;
+ else if (bs=="NO" || bs=="0")
+ *b=FALSE;
+ else
+ {
+ *b=FALSE;
+ config_warn("Warning: Invalid value `%s' for "
+ "boolean tag in line %d, file %s; use YES or NO\n",
+ bs.data(),yyLineNr,yyFileName.data());
+ }
+ }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 605 "config.l"
+{
+ elemStr+=yytext;
+ }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 608 "config.l"
+{ yyLineNr++; BEGIN(Start); }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 609 "config.l"
+{ yyLineNr++; BEGIN(Start); }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 610 "config.l"
+{ yyLineNr++; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 611 "config.l"
+
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 612 "config.l"
+{ yyLineNr++ ; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 614 "config.l"
+ECHO;
+ YY_BREAK
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = yy_start;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 28);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 100 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 28;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 100 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 99);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+#endif /* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yy_c_buf_p - yytext_ptr;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart( yyin );
+
+ /* fall through */
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ return EOF;
+
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+
+ return c;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+ {
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == yy_current_buffer )
+ yy_load_buffer_state();
+ }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer( b );
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_bytes( yy_str, len );
+ }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_flex_alloc( n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+ }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ yy_size_t new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
+#line 614 "config.l"
+
+
+/*@ ----------------------------------------------------------------------------
+ */
+
+#if 0
+static void writeBoolValue(QTextStream &t,bool v)
+{
+ if (v) t << "YES"; else t << "NO";
+}
+
+static void writeIntValue(QTextStream &t,int i)
+{
+ t << i;
+}
+
+static void writeStringValue(QTextStream &t,QCString &s)
+{
+ const char *p=s.data();
+ char c;
+ bool hasBlanks=FALSE;
+ if (p)
+ {
+ while ((c=*p++)!=0 && !hasBlanks) hasBlanks = (c==' ' || c=='\n' || c=='\t');
+ if (hasBlanks)
+ t << "\"" << s << "\"";
+ else
+ t << s;
+ }
+}
+
+static void writeStringList(QTextStream &t,QStrList &l)
+{
+ const char *p = l.first();
+ bool first=TRUE;
+ while (p)
+ {
+ char c;
+ const char *s=p;
+ bool hasBlanks=FALSE;
+ while ((c=*p++)!=0 && !hasBlanks) hasBlanks = (c==' ' || c=='\n' || c=='\t');
+ if (!first) t << " ";
+ first=FALSE;
+ if (hasBlanks) t << "\"" << s << "\""; else t << s;
+ p = l.next();
+ if (p) t << " \\" << endl;
+ }
+}
+#endif
+
+void Config::writeTemplate(QTextStream &t,bool sl,bool upd)
+{
+ t << "# Doxyfile " << versionString << endl << endl;
+ if (!sl)
+ {
+ t << "# This file describes the settings to be used by the documentation system\n";
+ t << "# doxygen (www.doxygen.org) for a project\n";
+ t << "#\n";
+ t << "# All text after a hash (#) is considered a comment and will be ignored\n";
+ t << "# The format is:\n";
+ t << "# TAG = value [value, ...]\n";
+ t << "# For lists items can also be appended using:\n";
+ t << "# TAG += value [value, ...]\n";
+ t << "# Values that contain spaces should be placed between quotes (\" \")\n";
+ }
+ ConfigOption *option = m_options->first();
+ while (option)
+ {
+ option->writeTemplate(t,sl,upd);
+ option = m_options->next();
+ }
+}
+
+void Config::convertStrToVal()
+{
+ ConfigOption *option = m_options->first();
+ while (option)
+ {
+ option->convertStrToVal();
+ option = m_options->next();
+ }
+}
+
+static void substEnvVarsInString(QCString &s)
+{
+ static QRegExp re("\\$\\([a-z_A-Z0-9]+\\)");
+ if (s.isEmpty()) return;
+ int p=0;
+ int i,l;
+ //printf("substEnvVarInString(%s) start\n",s.data());
+ while ((i=re.search(s,p))!=-1)
+ {
+ l = re.matchedLength();
+ //printf("Found environment var s.mid(%d,%d)=`%s'\n",i+2,l-3,s.mid(i+2,l-3).data());
+ QCString env=getenv(s.mid(i+2,l-3));
+ substEnvVarsInString(env); // recursively expand variables if needed.
+ s = s.left(i)+env+s.right(s.length()-i-l);
+ p=i+env.length(); // next time start at the end of the expanded string
+ }
+ s=s.stripWhiteSpace(); // to strip the bogus space that was added when an argument
+ // has quotes
+ //printf("substEnvVarInString(%s) end\n",s.data());
+}
+
+static void substEnvVarsInStrList(QStrList &sl)
+{
+ char *s = sl.first();
+ while (s)
+ {
+ QCString result(s);
+ // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE.
+ bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1);
+ // here we strip the quote again
+ substEnvVarsInString(result);
+
+ //printf("Result %s was quoted=%d\n",result.data(),wasQuoted);
+
+ if (!wasQuoted) /* as a result of the expansion, a single string
+ may have expanded into a list, which we'll
+ add to sl. If the orginal string already
+ contained multiple elements no further
+ splitting is done to allow quoted items with spaces! */
+ {
+ int l=result.length();
+ int i,p=0;
+ // skip spaces
+ // search for a "word"
+ for (i=0;i<l;i++)
+ {
+ char c=0;
+ // skip until start of new word
+ while (i<l && ((c=result.at(i))==' ' || c=='\t')) i++;
+ p=i; // p marks the start index of the word
+ // skip until end of a word
+ while (i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"')) i++;
+ if (i<l) // not at the end of the string
+ {
+ if (c=='"') // word within quotes
+ {
+ p=i+1;
+ for (i++;i<l;i++)
+ {
+ c=result.at(i);
+ if (c=='"') // end quote
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ p=i+1;
+ break;
+ }
+ else if (c=='\\') // skip escaped stuff
+ {
+ i++;
+ }
+ }
+ }
+ else if (c==' ' || c=='\t') // separator
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ p=i+1;
+ }
+ }
+ }
+ if (p!=l) // add the leftover as a string
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.right(l-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ }
+ }
+ else // just goto the next element in the list
+ {
+ sl.insert(sl.at(),result);
+ sl.next();
+ }
+ // remove the old unexpanded string from the list
+ int i=sl.at();
+ sl.remove(); // current item index changes if the last element is removed.
+ if (sl.at()==i) // not last item
+ s = sl.current();
+ else // just removed last item
+ s = 0;
+ }
+}
+
+void ConfigString::substEnvVars()
+{
+ substEnvVarsInString(m_value);
+}
+
+void ConfigList::substEnvVars()
+{
+ substEnvVarsInStrList(m_value);
+}
+
+void ConfigBool::substEnvVars()
+{
+ substEnvVarsInString(m_valueString);
+}
+
+void ConfigInt::substEnvVars()
+{
+ substEnvVarsInString(m_valueString);
+}
+
+void ConfigEnum::substEnvVars()
+{
+ substEnvVarsInString(m_value);
+}
+
+void Config::substituteEnvironmentVars()
+{
+ ConfigOption *option = m_options->first();
+ while (option)
+ {
+ option->substEnvVars();
+ option = m_options->next();
+ }
+}
+
+static void cleanUpPaths(QStrList &str)
+{
+ char *sfp = str.first();
+ while (sfp)
+ {
+ register char *p = sfp;
+ if (p)
+ {
+ char c;
+ while ((c=*p))
+ {
+ if (c=='\\') *p='/';
+ p++;
+ }
+ }
+ QCString path = sfp;
+ if ((path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) ||
+ path.at(path.length()-1)!='/'
+ )
+ {
+ QFileInfo fi(path);
+ if (fi.exists() && fi.isDir())
+ {
+ int i = str.at();
+ str.remove();
+ if (str.at()==i) // did not remove last item
+ str.insert(i,QFile::encodeName(fi.absFilePath()+"/"));
+ else
+ str.append(QFile::encodeName(fi.absFilePath()+"/"));
+ }
+ }
+ sfp = str.next();
+ }
+}
+
+void Config::check()
+{
+ //if (!projectName.isEmpty())
+ //{
+ // projectName[0]=toupper(projectName[0]);
+ //}
+
+ QCString &warnFormat = Config_getString("WARN_FORMAT");
+ if (warnFormat.stripWhiteSpace().isEmpty())
+ {
+ warnFormat="$file:$line $text";
+ }
+ else
+ {
+ if (warnFormat.find("$file")==-1)
+ {
+ config_err("Warning: warning format does not contain a $file tag!\n");
+ }
+ if (warnFormat.find("$line")==-1)
+ {
+ config_err("Warning: warning format does not contain a $line tag!\n");
+ }
+ if (warnFormat.find("$text")==-1)
+ {
+ config_err("Warning: warning format foes not contain a $text tag!\n");
+ }
+ }
+
+ QCString &manExtension = Config_getString("MAN_EXTENSION");
+
+ // set default man page extension if non is given by the user
+ if (manExtension.isEmpty())
+ {
+ manExtension=".3";
+ }
+
+ QCString &paperType = Config_getEnum("PAPER_TYPE");
+ paperType=paperType.lower().stripWhiteSpace();
+ if (paperType.isEmpty())
+ {
+ paperType = "a4wide";
+ }
+ if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" &&
+ paperType!="legal" && paperType!="executive")
+ {
+ config_err("Error: Unknown page type specified");
+ }
+
+ QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE");
+ outputLanguage=outputLanguage.stripWhiteSpace();
+ if (outputLanguage.isEmpty())
+ {
+ outputLanguage = "English";
+ }
+
+ QCString &htmlFileExtension=Config_getString("HTML_FILE_EXTENSION");
+ htmlFileExtension=htmlFileExtension.stripWhiteSpace();
+ if (htmlFileExtension.isEmpty())
+ {
+ htmlFileExtension = ".html";
+ }
+
+ // expand the relative stripFromPath values
+ QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH");
+ char *sfp = stripFromPath.first();
+ if (sfp==0) // by default use the current path
+ {
+ stripFromPath.append(QFile::encodeName(QDir::currentDirPath()+"/"));
+ }
+ else
+ {
+ cleanUpPaths(stripFromPath);
+ }
+
+ // expand the relative stripFromPath values
+ QStrList &stripFromIncPath = Config_getList("STRIP_FROM_INC_PATH");
+ cleanUpPaths(stripFromIncPath);
+
+ // Test to see if HTML header is valid
+ QCString &headerFile = Config_getString("HTML_HEADER");
+ if (!headerFile.isEmpty())
+ {
+ QFileInfo fi(headerFile);
+ if (!fi.exists())
+ {
+ config_err("Error: tag HTML_HEADER: header file `%s' "
+ "does not exist\n",headerFile.data());
+ exit(1);
+ }
+ }
+ // Test to see if HTML footer is valid
+ QCString &footerFile = Config_getString("HTML_FOOTER");
+ if (!footerFile.isEmpty())
+ {
+ QFileInfo fi(footerFile);
+ if (!fi.exists())
+ {
+ config_err("Error: tag HTML_FOOTER: footer file `%s' "
+ "does not exist\n",footerFile.data());
+ exit(1);
+ }
+ }
+ // Test to see if LaTeX header is valid
+ QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
+ if (!latexHeaderFile.isEmpty())
+ {
+ QFileInfo fi(latexHeaderFile);
+ if (!fi.exists())
+ {
+ config_err("Error: tag LATEX_HEADER: header file `%s' "
+ "does not exist\n",latexHeaderFile.data());
+ exit(1);
+ }
+ }
+ // check include path
+ QStrList &includePath = Config_getList("INCLUDE_PATH");
+ char *s=includePath.first();
+ while (s)
+ {
+ QFileInfo fi(s);
+ if (!fi.exists()) config_err("Warning: tag INCLUDE_PATH: include path `%s' "
+ "does not exist\n",s);
+ s=includePath.next();
+ }
+
+ // check aliases
+ QStrList &aliasList = Config_getList("ALIASES");
+ s=aliasList.first();
+ while (s)
+ {
+ QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument
+ QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]*}[ \t]*="); // alias with argument
+ QCString alias=s;
+ alias=alias.stripWhiteSpace();
+ if (alias.find(re1)!=0 && alias.find(re2)!=0)
+ {
+ config_err("Illegal alias format `%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
+ alias.data());
+ }
+ s=aliasList.next();
+ }
+
+ // check dot image format
+ QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT");
+ dotImageFormat=dotImageFormat.stripWhiteSpace();
+ if (dotImageFormat.isEmpty())
+ {
+ dotImageFormat = "png";
+ }
+ else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
+ {
+ config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
+ dotImageFormat = "png";
+ }
+
+
+ // check dot path
+ QCString &dotPath = Config_getString("DOT_PATH");
+ if (!dotPath.isEmpty())
+ {
+ QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
+ if (!dp.exists() || !dp.isFile())
+ {
+ config_err("Warning: the dot tool could not be found at %s\n",dotPath.data());
+ dotPath="";
+ }
+ else
+ {
+ dotPath=QFile::encodeName( dp.dirPath(TRUE)+"/" );
+#if defined(_WIN32) // convert slashes
+ uint i=0,l=dotPath.length();
+ for (i=0;i<l;i++) if (dotPath.at(i)=='/') dotPath.at(i)='\\';
+#endif
+ }
+ }
+ else // make sure the string is empty but not null!
+ {
+ dotPath="";
+ }
+
+ // check mscgen path
+ QCString &mscgenPath = Config_getString("MSCGEN_PATH");
+ if (!mscgenPath.isEmpty())
+ {
+ QFileInfo dp(mscgenPath+"/mscgen"+portable_commandExtension());
+ if (!dp.exists() || !dp.isFile())
+ {
+ config_err("Warning: the mscgen tool could not be found at %s\n",mscgenPath.data());
+ mscgenPath="";
+ }
+ else
+ {
+ mscgenPath=QFile::encodeName( dp.dirPath(TRUE)+"/" );
+#if defined(_WIN32) // convert slashes
+ uint i=0,l=mscgenPath.length();
+ for (i=0;i<l;i++) if (mscgenPath.at(i)=='/') mscgenPath.at(i)='\\';
+#endif
+ }
+ }
+ else // make sure the string is empty but not null!
+ {
+ mscgenPath="";
+ }
+
+
+ // check input
+ QStrList &inputSources=Config_getList("INPUT");
+ if (inputSources.count()==0)
+ {
+ // use current dir as the default
+ inputSources.append(QFile::encodeName( QDir::currentDirPath() ));
+ }
+ else
+ {
+ s=inputSources.first();
+ while (s)
+ {
+ QFileInfo fi(s);
+ if (!fi.exists())
+ {
+ config_err("Warning: tag INPUT: input source `%s' does not exist\n",s);
+ }
+ s=inputSources.next();
+ }
+ }
+
+ // add default pattern if needed
+ QStrList &filePatternList = Config_getList("FILE_PATTERNS");
+ if (filePatternList.isEmpty())
+ {
+ filePatternList.append("*.c");
+ filePatternList.append("*.cc");
+ filePatternList.append("*.cxx");
+ filePatternList.append("*.cpp");
+ filePatternList.append("*.c++");
+ filePatternList.append("*.d");
+ filePatternList.append("*.java");
+ filePatternList.append("*.ii");
+ filePatternList.append("*.ixx");
+ filePatternList.append("*.ipp");
+ filePatternList.append("*.i++");
+ filePatternList.append("*.inl");
+ filePatternList.append("*.h");
+ filePatternList.append("*.hh");
+ filePatternList.append("*.hxx");
+ filePatternList.append("*.hpp");
+ filePatternList.append("*.h++");
+ filePatternList.append("*.idl");
+ filePatternList.append("*.odl");
+ filePatternList.append("*.cs");
+ filePatternList.append("*.php");
+ filePatternList.append("*.php3");
+ filePatternList.append("*.inc");
+ filePatternList.append("*.m");
+ filePatternList.append("*.mm");
+ filePatternList.append("*.dox");
+ filePatternList.append("*.py");
+ filePatternList.append("*.f90");
+ filePatternList.append("*.f");
+ filePatternList.append("*.vhd");
+ filePatternList.append("*.vhdl");
+ if (portable_fileSystemIsCaseSensitive())
+ {
+ // unix => case sensitive match => also include useful uppercase versions
+ filePatternList.append("*.C");
+ filePatternList.append("*.CC");
+ filePatternList.append("*.C++");
+ filePatternList.append("*.II");
+ filePatternList.append("*.I++");
+ filePatternList.append("*.H");
+ filePatternList.append("*.HH");
+ filePatternList.append("*.H++");
+ filePatternList.append("*.CS");
+ filePatternList.append("*.PHP");
+ filePatternList.append("*.PHP3");
+ filePatternList.append("*.M");
+ filePatternList.append("*.MM");
+ filePatternList.append("*.PY");
+ filePatternList.append("*.F90");
+ filePatternList.append("*.F");
+ filePatternList.append("*.VHD");
+ filePatternList.append("*.VHDL");
+ }
+ }
+
+ // add default pattern if needed
+ QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
+ if (examplePatternList.isEmpty())
+ {
+ examplePatternList.append("*");
+ }
+
+ // if no output format is enabled, warn the user
+ if (!Config_getBool("GENERATE_HTML") &&
+ !Config_getBool("GENERATE_LATEX") &&
+ !Config_getBool("GENERATE_MAN") &&
+ !Config_getBool("GENERATE_RTF") &&
+ !Config_getBool("GENERATE_XML") &&
+ !Config_getBool("GENERATE_PERLMOD") &&
+ !Config_getBool("GENERATE_RTF") &&
+ !Config_getBool("GENERATE_AUTOGEN_DEF") &&
+ Config_getString("GENERATE_TAGFILE").isEmpty()
+ )
+ {
+ config_err("Warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
+ }
+
+ // check HTMLHELP creation requirements
+ if (!Config_getBool("GENERATE_HTML") &&
+ Config_getBool("GENERATE_HTMLHELP"))
+ {
+ config_err("Warning: GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
+ }
+
+#undef PUTENV
+#undef SEP
+#if defined(_WIN32) && (__BORLANDC__ < 0x0550)
+#define PUTENV _putenv
+#define SEP ";"
+#else
+#define PUTENV putenv
+#define SEP ":"
+#endif
+ // check QHP creation requirements
+ if (Config_getBool("GENERATE_QHP"))
+ {
+ bool quit = false;
+ if (!Config_getBool("GENERATE_HTML"))
+ {
+ config_err("Warning: GENERATE_QHP=YES requires GENERATE_HTML=YES.\n");
+ quit = true;
+ }
+
+ if (Config_getString("QHP_NAMESPACE").isEmpty())
+ {
+ config_err("Warning: GENERATE_QHP=YES requires QHP_NAMESPACE to be set.\n");
+ quit = true;
+ }
+
+ if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty())
+ {
+ config_err("Warning: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set.\n");
+ quit = true;
+ }
+
+ if (quit)
+ {
+ exit(1);
+ }
+ }
+
+ // check QCH creation requirements
+ if (!Config_getString("QHG_LOCATION").isEmpty() &&
+ !Config_getBool("GENERATE_QHP"))
+ {
+ config_err("Warning: Specifying QHG_LOCATION requires GENERATE_QHP=YES.\n");
+ }
+ if (!Config_getString("QCH_FILE").isEmpty() &&
+ Config_getString("QHG_LOCATION").isEmpty())
+ {
+ config_err("Warning: Specifying QCH_FILE requires QHG_LOCATION to be set.\n");
+ }
+
+ if (Config_getBool("HAVE_DOT"))
+ {
+ char *curFontPath = getenv("DOTFONTPATH");
+ int l=curFontPath ? strlen(curFontPath)+1 : 0;
+ static char *buf = 0;
+ buf = (char *)realloc(buf,strlen("DOTFONTPATH=.")+l+1);
+ strcpy(buf,"DOTFONTPATH=.");
+ if (l>0)
+ {
+ strcat(buf,SEP);
+ strcat(buf,curFontPath);
+ }
+ PUTENV(buf);
+ }
+
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
+ {
+ // don't show inline info for Java output, since Java has no inline
+ // concept.
+ Config_getBool("INLINE_INFO")=FALSE;
+ }
+
+ int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH");
+ if (depth==0)
+ {
+ depth=1000;
+ }
+
+
+ // add default words if needed
+ QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF");
+ if (annotationFromBrief.isEmpty())
+ {
+ annotationFromBrief.append("The $name class");
+ annotationFromBrief.append("The $name widget");
+ annotationFromBrief.append("The $name file");
+ annotationFromBrief.append("is");
+ annotationFromBrief.append("provides");
+ annotationFromBrief.append("specifies");
+ annotationFromBrief.append("contains");
+ annotationFromBrief.append("represents");
+ annotationFromBrief.append("a");
+ annotationFromBrief.append("an");
+ annotationFromBrief.append("the");
+ }
+
+ // some default settings for vhdl
+ if (Config_getBool("OPTIMIZE_OUTPUT_VHDL") &&
+ (Config_getBool("INLINE_INHERITED_MEMB") ||
+ Config_getBool("INHERIT_DOCS") ||
+ !Config_getBool("HIDE_SCOPE_NAMES") ||
+ !Config_getBool("EXTRACT_PRIVATE")
+ )
+ )
+ {
+ bool b1 = Config_getBool("INLINE_INHERITED_MEMB");
+ bool b2 = Config_getBool("INHERIT_DOCS");
+ bool b3 = Config_getBool("HIDE_SCOPE_NAMES");
+ bool b4 = Config_getBool("EXTRACT_PRIVATE");
+ const char *s1,*s2,*s3,*s4;
+ if (b1) s1=" INLINDE_INHERITED_MEMB = NO (was YES)\n"; else s1="";
+ if (b2) s2=" INHERIT_DOCS = NO (was YES)\n"; else s2="";
+ if (!b3) s3=" HIDE_SCOPE_NAMES = YES (was NO)\n"; else s3="";
+ if (!b4) s4=" EXTRACT_PRIVATE = YES (was NO)\n"; else s4="";
+
+ config_err("Warning: enabling OPTIMIZE_OUTPUT_VHDL assumes the following settings:\n"
+ "%s%s%s%s",s1,s2,s3,s4
+ );
+
+ Config_getBool("INLINE_INHERITED_MEMB") = FALSE;
+ Config_getBool("INHERIT_DOCS") = FALSE;
+ Config_getBool("HIDE_SCOPE_NAMES") = TRUE;
+ Config_getBool("EXTRACT_PRIVATE") = TRUE;
+ }
+
+}
+
+void Config::init()
+{
+ ConfigOption *option = m_options->first();
+ while (option)
+ {
+ option->init();
+ option = m_options->next();
+ }
+}
+
+void Config::create()
+{
+ if (m_initialized) return;
+ m_initialized = TRUE;
+
+ ConfigString *cs;
+ ConfigEnum *ce;
+ ConfigList *cl;
+ ConfigInt *ci;
+ ConfigBool *cb;
+
+ // option definitions
+ //-----------------------------------------------------------------------------------------------
+ addInfo("Project","Project related configuration options");
+ //-----------------------------------------------------------------------------------------------
+
+ cs = addString(
+ "DOXYFILE_ENCODING",
+ "This tag specifies the encoding used for all characters in the config file \n"
+ "that follow. The default is UTF-8 which is also the encoding used for all \n"
+ "text before the first occurrence of this tag. Doxygen uses libiconv (or the \n"
+ "iconv built into libc) for the transcoding. See \n"
+ "http://www.gnu.org/software/libiconv for the list of possible encodings.\n"
+ );
+ cs->setDefaultValue("UTF-8");
+ cs = addString(
+ "PROJECT_NAME",
+ "The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n"
+ "by quotes) that should identify the project. "
+ );
+ cs = addString(
+ "PROJECT_NUMBER",
+ "The PROJECT_NUMBER tag can be used to enter a project or revision number. \n"
+ "This could be handy for archiving the generated documentation or \n"
+ "if some version control system is used.\n"
+ );
+ cs = addString(
+ "OUTPUT_DIRECTORY",
+ "The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n"
+ "base path where the generated documentation will be put. \n"
+ "If a relative path is entered, it will be relative to the location \n"
+ "where doxygen was started. If left blank the current directory will be used.\n"
+ );
+ cs->setWidgetType(ConfigString::Dir);
+ cb = addBool(
+ "CREATE_SUBDIRS",
+ "If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n"
+ "4096 sub-directories (in 2 levels) under the output directory of each output \n"
+ "format and will distribute the generated files over these directories. \n"
+ "Enabling this option can be useful when feeding doxygen a huge amount of \n"
+ "source files, where putting all generated files in the same directory would \n"
+ "otherwise cause performance problems for the file system. \n",
+ FALSE
+ );
+ ce = addEnum(
+ "OUTPUT_LANGUAGE",
+ "The OUTPUT_LANGUAGE tag is used to specify the language in which all \n"
+ "documentation generated by doxygen is written. Doxygen will use this \n"
+ "information to generate all constant output in the proper language. \n"
+ "The default language is English, other supported languages are: \n"
+ "Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n"
+ "Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, \n"
+ "Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), \n"
+ "Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, \n"
+ "Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, \n"
+ "Spanish, Swedish, and Ukrainian.\n",
+ "English"
+ );
+#ifdef LANG_ZA
+ ce->addValue("Afrikaans");
+#endif
+#ifdef LANG_AR
+ ce->addValue("Arabic");
+#endif
+#ifdef LANG_BR
+ ce->addValue("Brazilian");
+#endif
+#ifdef LANG_CA
+ ce->addValue("Catalan");
+#endif
+#ifdef LANG_CN
+ ce->addValue("Chinese");
+#endif
+#ifdef LANG_TW
+ ce->addValue("Chinese-Traditional");
+#endif
+#ifdef LANG_HR
+ ce->addValue("Croatian");
+#endif
+#ifdef LANG_CZ
+ ce->addValue("Czech");
+#endif
+#ifdef LANG_DK
+ ce->addValue("Danish");
+#endif
+#ifdef LANG_NL
+ ce->addValue("Dutch");
+#endif
+ ce->addValue("English");
+#ifdef LANG_FI
+ ce->addValue("Finnish");
+#endif
+#ifdef LANG_FR
+ ce->addValue("French");
+#endif
+#ifdef LANG_DE
+ ce->addValue("German");
+#endif
+#ifdef LANG_GR
+ ce->addValue("Greek");
+#endif
+#ifdef LANG_HU
+ ce->addValue("Hungarian");
+#endif
+#ifdef LANG_IT
+ ce->addValue("Italian");
+#endif
+#ifdef LANG_JP
+ ce->addValue("Japanese");
+ ce->addValue("Japanese-en");
+#endif
+#ifdef LANG_KR
+ ce->addValue("Korean");
+ ce->addValue("Korean-en");
+#endif
+#ifdef LANG_LI
+ ce->addValue("Lithuanian");
+#endif
+#ifdef LANG_NO
+ ce->addValue("Norwegian");
+#endif
+#ifdef LANG_MK
+ ce->addValue("Macedonian");
+#endif
+#ifdef LANG_FA
+ ce->addValue("Farsi");
+ ce->addValue("Persian");
+#endif
+#ifdef LANG_PL
+ ce->addValue("Polish");
+#endif
+#ifdef LANG_PT
+ ce->addValue("Portuguese");
+#endif
+#ifdef LANG_RO
+ ce->addValue("Romanian");
+#endif
+#ifdef LANG_RU
+ ce->addValue("Russian");
+#endif
+#ifdef LANG_SR
+ ce->addValue("Serbian");
+#endif
+#ifdef LANG_SC
+ ce->addValue("Serbian-Cyrilic");
+#endif
+#ifdef LANG_SK
+ ce->addValue("Slovak");
+#endif
+#ifdef LANG_SI
+ ce->addValue("Slovene");
+#endif
+#ifdef LANG_ES
+ ce->addValue("Spanish");
+#endif
+#ifdef LANG_SE
+ ce->addValue("Swedish");
+#endif
+#ifdef LANG_UA
+ ce->addValue("Ukrainian");
+#endif
+
+#if 0
+ cb = addBool(
+ "USE_WINDOWS_ENCODING",
+ "This tag can be used to specify the encoding used in the generated output. \n"
+ "The encoding is not always determined by the language that is chosen, \n"
+ "but also whether or not the output is meant for Windows or non-Windows users. \n"
+ "In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES \n"
+ "forces the Windows encoding (this is the default for the Windows binary), \n"
+ "whereas setting the tag to NO uses a Unix-style encoding (the default for \n"
+ "all platforms other than Windows).\n",
+#if defined(_WIN32) || defined(__CYGWIN__)
+ TRUE
+#else
+ FALSE
+#endif
+ );
+#endif
+ addObsolete("USE_WINDOWS_ENCODING");
+
+ cb = addBool(
+ "BRIEF_MEMBER_DESC",
+ "If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n"
+ "include brief member descriptions after the members that are listed in \n"
+ "the file and class documentation (similar to JavaDoc). \n"
+ "Set to NO to disable this. \n",
+ TRUE
+ );
+ cb = addBool(
+ "REPEAT_BRIEF",
+ "If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n"
+ "the brief description of a member or function before the detailed description. \n"
+ "Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n"
+ "brief descriptions will be completely suppressed. \n",
+ TRUE
+ );
+ cl = addList(
+ "ABBREVIATE_BRIEF",
+ "This tag implements a quasi-intelligent brief description abbreviator \n"
+ "that is used to form the text in various listings. Each string \n"
+ "in this list, if found as the leading text of the brief description, will be \n"
+ "stripped from the text and the result after processing the whole list, is \n"
+ "used as the annotated text. Otherwise, the brief description is used as-is. \n"
+ "If left blank, the following values are used (\"$name\" is automatically \n"
+ "replaced with the name of the entity): \"The $name class\" \"The $name widget\" \n"
+ "\"The $name file\" \"is\" \"provides\" \"specifies\" \"contains\" \n"
+ "\"represents\" \"a\" \"an\" \"the\"\n"
+ );
+ cb = addBool(
+ "ALWAYS_DETAILED_SEC",
+ "If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then \n"
+ "Doxygen will generate a detailed section even if there is only a brief \n"
+ "description. \n",
+ FALSE
+ );
+ cb = addBool(
+ "INLINE_INHERITED_MEMB",
+ "If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all \n"
+ "inherited members of a class in the documentation of that class as if those \n"
+ "members were ordinary class members. Constructors, destructors and assignment \n"
+ "operators of the base classes will not be shown. \n",
+ FALSE
+ );
+ cb = addBool(
+ "FULL_PATH_NAMES",
+ "If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full \n"
+ "path before files name in the file list and in the header files. If set \n"
+ "to NO the shortest path that makes the file name unique will be used. \n",
+ TRUE
+ );
+ cl = addList(
+ "STRIP_FROM_PATH",
+ "If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag \n"
+ "can be used to strip a user-defined part of the path. Stripping is \n"
+ "only done if one of the specified strings matches the left-hand part of \n"
+ "the path. The tag can be used to show relative paths in the file list. \n"
+ "If left blank the directory from which doxygen is run is used as the \n"
+ "path to strip. \n"
+ );
+ cl->addDependency("FULL_PATH_NAMES");
+ cl = addList(
+ "STRIP_FROM_INC_PATH",
+ "The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of \n"
+ "the path mentioned in the documentation of a class, which tells \n"
+ "the reader which header file to include in order to use a class. \n"
+ "If left blank only the name of the header file containing the class \n"
+ "definition is used. Otherwise one should specify the include paths that \n"
+ "are normally passed to the compiler using the -I flag.\n"
+ );
+ cb = addBool(
+ "SHORT_NAMES",
+ "If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter \n"
+ "(but less readable) file names. This can be useful is your file systems \n"
+ "doesn't support long names like on DOS, Mac, or CD-ROM. \n",
+ FALSE
+ );
+ cb = addBool(
+ "JAVADOC_AUTOBRIEF",
+ "If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen \n"
+ "will interpret the first line (until the first dot) of a JavaDoc-style \n"
+ "comment as the brief description. If set to NO, the JavaDoc \n"
+ "comments will behave just like regular Qt-style comments \n"
+ "(thus requiring an explicit @brief command for a brief description.) \n",
+ FALSE
+ );
+ cb = addBool(
+ "QT_AUTOBRIEF",
+ "If the QT_AUTOBRIEF tag is set to YES then Doxygen will \n"
+ "interpret the first line (until the first dot) of a Qt-style \n"
+ "comment as the brief description. If set to NO, the comments \n"
+ "will behave just like regular Qt-style comments (thus requiring \n"
+ "an explicit \\brief command for a brief description.) \n",
+ FALSE
+ );
+ cb = addBool(
+ "MULTILINE_CPP_IS_BRIEF",
+ "The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen \n"
+ "treat a multi-line C++ special comment block (i.e. a block of //! or /// \n"
+ "comments) as a brief description. This used to be the default behaviour. \n"
+ "The new default is to treat a multi-line C++ comment block as a detailed \n"
+ "description. Set this tag to YES if you prefer the old behaviour instead. \n",
+ FALSE
+ );
+ //cb = addBool(
+ // "DETAILS_AT_TOP",
+ // "If the DETAILS_AT_TOP tag is set to YES then Doxygen \n"
+ // "will output the detailed description near the top, like JavaDoc.\n"
+ // "If set to NO, the detailed description appears after the member \n"
+ // "documentation. \n",
+ // FALSE
+ // );
+ cb = addBool(
+ "INHERIT_DOCS",
+ "If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n"
+ "member inherits the documentation from any documented member that it \n"
+ "re-implements. \n",
+ TRUE
+ );
+ cb = addBool(
+ "SEPARATE_MEMBER_PAGES",
+ "If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce \n"
+ "a new page for each member. If set to NO, the documentation of a member will \n"
+ "be part of the file/class/namespace that contains it.\n",
+ FALSE
+ );
+ ci = addInt(
+ "TAB_SIZE",
+ "The TAB_SIZE tag can be used to set the number of spaces in a tab. \n"
+ "Doxygen uses this value to replace tabs by spaces in code fragments. \n",
+ 1,16,8
+ );
+ cl = addList(
+ "ALIASES",
+ "This tag can be used to specify a number of aliases that acts \n"
+ "as commands in the documentation. An alias has the form \"name=value\". \n"
+ "For example adding \"sideeffect=\\par Side Effects:\\n\" will allow you to \n"
+ "put the command \\sideeffect (or @sideeffect) in the documentation, which \n"
+ "will result in a user-defined paragraph with heading \"Side Effects:\". \n"
+ "You can put \\n's in the value part of an alias to insert newlines. \n"
+ );
+ cb = addBool(
+ "OPTIMIZE_OUTPUT_FOR_C",
+ "Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C \n"
+ "sources only. Doxygen will then generate output that is more tailored for C. \n"
+ "For instance, some of the names that are used will be different. The list \n"
+ "of all members will be omitted, etc. \n",
+ FALSE
+ );
+ cb = addBool(
+ "OPTIMIZE_OUTPUT_JAVA",
+ "Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java \n"
+ "sources only. Doxygen will then generate output that is more tailored for \n"
+ "Java. For instance, namespaces will be presented as packages, qualified \n"
+ "scopes will look different, etc. \n",
+ FALSE
+ );
+ cb = addBool(
+ "OPTIMIZE_FOR_FORTRAN",
+ "Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran \n"
+ "sources only. Doxygen will then generate output that is more tailored for \n"
+ "Fortran. \n",
+ FALSE
+ );
+ cb = addBool(
+ "OPTIMIZE_OUTPUT_VHDL",
+ "Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL \n"
+ "sources. Doxygen will then generate output that is tailored for \n"
+ "VHDL. \n",
+ FALSE
+ );
+ cl = addList( "EXTENSION_MAPPING",
+ "Doxygen selects the parser to use depending on the extension of the files it parses. \n"
+ "With this tag you can assign which parser to use for a given extension. \n"
+ "Doxygen has a built-in mapping, but you can override or extend it using this tag. \n"
+ "The format is ext=language, where ext is a file extension, and language is one of \n"
+ "the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, \n"
+ "Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat \n"
+ ".inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), \n"
+ "use: inc=Fortran f=C\n"
+ );
+ cb = addBool(
+ "BUILTIN_STL_SUPPORT",
+ "If you use STL classes (i.e. std::string, std::vector, etc.) but do not want \n"
+ "to include (a tag file for) the STL sources as input, then you should \n"
+ "set this tag to YES in order to let doxygen match functions declarations and \n"
+ "definitions whose arguments contain STL classes (e.g. func(std::string); v.s. \n"
+ "func(std::string) {}). This also make the inheritance and collaboration \n"
+ "diagrams that involve STL classes more complete and accurate. \n",
+ FALSE
+ );
+ cb = addBool(
+ "CPP_CLI_SUPPORT",
+ "If you use Microsoft's C++/CLI language, you should set this option to YES to\n"
+ "enable parsing support.\n",
+ FALSE
+ );
+ cb = addBool(
+ "SIP_SUPPORT",
+ "Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. \n"
+ "Doxygen will parse them like normal C++ but will assume all classes use public \n"
+ "instead of private inheritance when no explicit protection keyword is present. \n",
+ FALSE
+ );
+ cb = addBool( "IDL_PROPERTY_SUPPORT",
+ "For Microsoft's IDL there are propget and propput attributes to indicate getter \n"
+ "and setter methods for a property. Setting this option to YES (the default) \n"
+ "will make doxygen to replace the get and set methods by a property in the \n"
+ "documentation. This will only work if the methods are indeed getting or \n"
+ "setting a simple type. If this is not the case, or you want to show the \n"
+ "methods anyway, you should set this option to NO. \n",
+ TRUE
+ );
+ cb = addBool(
+ "DISTRIBUTE_GROUP_DOC",
+ "If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC \n"
+ "tag is set to YES, then doxygen will reuse the documentation of the first \n"
+ "member in the group (if any) for the other members of the group. By default \n"
+ "all members of a group must be documented explicitly.\n",
+ FALSE
+ );
+ cb = addBool(
+ "SUBGROUPING",
+ "Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n"
+ "the same type (for instance a group of public functions) to be put as a \n"
+ "subgroup of that type (e.g. under the Public Functions section). Set it to \n"
+ "NO to prevent subgrouping. Alternatively, this can be done per class using \n"
+ "the \\nosubgrouping command. \n",
+ TRUE
+ );
+ cb = addBool( "TYPEDEF_HIDES_STRUCT",
+ "When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum \n"
+ "is documented as struct, union, or enum with the name of the typedef. So \n"
+ "typedef struct TypeS {} TypeT, will appear in the documentation as a struct \n"
+ "with name TypeT. When disabled the typedef will appear as a member of a file, \n"
+ "namespace, or class. And the struct will be named TypeS. This can typically \n"
+ "be useful for C code in case the coding convention dictates that all compound \n"
+ "types are typedef'ed and only the typedef is referenced, never the tag name.\n",
+ FALSE
+ );
+ ci = addInt(
+ "SYMBOL_CACHE_SIZE",
+ "The SYMBOL_CACHE_SIZE determines the size of the internal cache use to \n"
+ "determine which symbols to keep in memory and which to flush to disk.\n"
+ "When the cache is full, less often used symbols will be written to disk.\n"
+ "For small to medium size projects (<1000 input files) the default value is \n"
+ "probably good enough. For larger projects a too small cache size can cause \n"
+ "doxygen to be busy swapping symbols to and from disk most of the time \n"
+ "causing a significant performance penality. \n"
+ "If the system has enough physical memory increasing the cache will improve the \n"
+ "performance by keeping more symbols in memory. Note that the value works on \n"
+ "a logarithmic scale so increasing the size by one will rougly double the \n"
+ "memory usage. The cache size is given by this formula: \n"
+ "2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, \n"
+ "corresponding to a cache size of 2^16 = 65536 symbols\n",
+ 0,9,0
+ );
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo("Build","Build related configuration options");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "EXTRACT_ALL",
+ "If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in \n"
+ "documentation are documented, even if no documentation was available. \n"
+ "Private class members and static file members will be hidden unless \n"
+ "the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES \n",
+ FALSE
+ );
+ cb = addBool(
+ "EXTRACT_PRIVATE",
+ "If the EXTRACT_PRIVATE tag is set to YES all private members of a class \n"
+ "will be included in the documentation. \n",
+ FALSE
+ );
+ cb = addBool(
+ "EXTRACT_STATIC",
+ "If the EXTRACT_STATIC tag is set to YES all static members of a file \n"
+ "will be included in the documentation. \n",
+ FALSE
+ );
+ cb = addBool(
+ "EXTRACT_LOCAL_CLASSES",
+ "If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) \n"
+ "defined locally in source files will be included in the documentation. \n"
+ "If set to NO only classes defined in header files are included. \n",
+ TRUE
+ );
+ cb = addBool(
+ "EXTRACT_LOCAL_METHODS",
+ "This flag is only useful for Objective-C code. When set to YES local \n"
+ "methods, which are defined in the implementation section but not in \n"
+ "the interface are included in the documentation. \n"
+ "If set to NO (the default) only methods in the interface are included. \n",
+ FALSE
+ );
+ cb = addBool(
+ "EXTRACT_ANON_NSPACES",
+ "If this flag is set to YES, the members of anonymous namespaces will be \n"
+ "extracted and appear in the documentation as a namespace called \n"
+ "'anonymous_namespace{file}', where file will be replaced with the base \n"
+ "name of the file that contains the anonymous namespace. By default \n"
+ "anonymous namespace are hidden. \n",
+ FALSE
+ );
+ cb = addBool(
+ "HIDE_UNDOC_MEMBERS",
+ "If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all \n"
+ "undocumented members of documented classes, files or namespaces. \n"
+ "If set to NO (the default) these members will be included in the \n"
+ "various overviews, but no documentation section is generated. \n"
+ "This option has no effect if EXTRACT_ALL is enabled. \n",
+ FALSE
+ );
+ cb = addBool(
+ "HIDE_UNDOC_CLASSES",
+ "If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all \n"
+ "undocumented classes that are normally visible in the class hierarchy. \n"
+ "If set to NO (the default) these classes will be included in the various \n"
+ "overviews. This option has no effect if EXTRACT_ALL is enabled. \n",
+ FALSE
+ );
+ cb = addBool(
+ "HIDE_FRIEND_COMPOUNDS",
+ "If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all \n"
+ "friend (class|struct|union) declarations. \n"
+ "If set to NO (the default) these declarations will be included in the \n"
+ "documentation. \n",
+ FALSE
+ );
+ cb = addBool(
+ "HIDE_IN_BODY_DOCS",
+ "If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any \n"
+ "documentation blocks found inside the body of a function. \n"
+ "If set to NO (the default) these blocks will be appended to the \n"
+ "function's detailed documentation block. \n",
+ FALSE
+ );
+ cb = addBool(
+ "INTERNAL_DOCS",
+ "The INTERNAL_DOCS tag determines if documentation \n"
+ "that is typed after a \\internal command is included. If the tag is set \n"
+ "to NO (the default) then the documentation will be excluded. \n"
+ "Set it to YES to include the internal documentation. \n",
+ FALSE
+ );
+ cb = addBool(
+ "CASE_SENSE_NAMES",
+ "If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate \n"
+ "file names in lower-case letters. If set to YES upper-case letters are also \n"
+ "allowed. This is useful if you have classes or files whose names only differ \n"
+ "in case and if your file system supports case sensitive file names. Windows \n"
+ "and Mac users are advised to set this option to NO.\n",
+ portable_fileSystemIsCaseSensitive()
+ );
+ cb = addBool(
+ "HIDE_SCOPE_NAMES",
+ "If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen \n"
+ "will show members with their full class and namespace scopes in the \n"
+ "documentation. If set to YES the scope will be hidden. \n",
+ FALSE
+ );
+ cb = addBool(
+ "SHOW_INCLUDE_FILES",
+ "If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen \n"
+ "will put a list of the files that are included by a file in the documentation \n"
+ "of that file. \n",
+ TRUE
+ );
+ cb = addBool(
+ "INLINE_INFO",
+ "If the INLINE_INFO tag is set to YES (the default) then a tag [inline] \n"
+ "is inserted in the documentation for inline members. \n",
+ TRUE
+ );
+ cb = addBool(
+ "SORT_MEMBER_DOCS",
+ "If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen \n"
+ "will sort the (detailed) documentation of file and class members \n"
+ "alphabetically by member name. If set to NO the members will appear in \n"
+ "declaration order. \n",
+ TRUE
+ );
+ cb = addBool(
+ "SORT_BRIEF_DOCS",
+ "If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the \n"
+ "brief documentation of file, namespace and class members alphabetically \n"
+ "by member name. If set to NO (the default) the members will appear in \n"
+ "declaration order. \n",
+ FALSE
+ );
+ cb = addBool(
+ "SORT_GROUP_NAMES",
+ "If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the \n"
+ "hierarchy of group names into alphabetical order. If set to NO (the default) \n"
+ "the group names will appear in their defined order. \n",
+ FALSE
+ );
+ cb = addBool(
+ "SORT_BY_SCOPE_NAME",
+ "If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be \n"
+ "sorted by fully-qualified names, including namespaces. If set to \n"
+ "NO (the default), the class list will be sorted only by class name, \n"
+ "not including the namespace part. \n"
+ "Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n"
+ "Note: This option applies only to the class list, not to the \n"
+ "alphabetical list.\n",
+ FALSE
+ );
+
+ cb = addBool(
+ "GENERATE_TODOLIST",
+ "The GENERATE_TODOLIST tag can be used to enable (YES) or \n"
+ "disable (NO) the todo list. This list is created by putting \\todo \n"
+ "commands in the documentation.\n",
+ TRUE
+ );
+ cb = addBool(
+ "GENERATE_TESTLIST",
+ "The GENERATE_TESTLIST tag can be used to enable (YES) or \n"
+ "disable (NO) the test list. This list is created by putting \\test \n"
+ "commands in the documentation.\n",
+ TRUE
+ );
+ cb = addBool(
+ "GENERATE_BUGLIST",
+ "The GENERATE_BUGLIST tag can be used to enable (YES) or \n"
+ "disable (NO) the bug list. This list is created by putting \\bug \n"
+ "commands in the documentation.\n",
+ TRUE
+ );
+ cb = addBool(
+ "GENERATE_DEPRECATEDLIST",
+ "The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or \n"
+ "disable (NO) the deprecated list. This list is created by putting \n"
+ "\\deprecated commands in the documentation.\n",
+ TRUE
+ );
+ cl = addList(
+ "ENABLED_SECTIONS",
+ "The ENABLED_SECTIONS tag can be used to enable conditional \n"
+ "documentation sections, marked by \\if sectionname ... \\endif. \n"
+ );
+ ci = addInt(
+ "MAX_INITIALIZER_LINES",
+ "The MAX_INITIALIZER_LINES tag determines the maximum number of lines \n"
+ "the initial value of a variable or define consists of for it to appear in \n"
+ "the documentation. If the initializer consists of more lines than specified \n"
+ "here it will be hidden. Use a value of 0 to hide initializers completely. \n"
+ "The appearance of the initializer of individual variables and defines in the \n"
+ "documentation can be controlled using \\showinitializer or \\hideinitializer \n"
+ "command in the documentation regardless of this setting. \n",
+ 0,10000,30
+ );
+ cb = addBool(
+ "SHOW_USED_FILES",
+ "Set the SHOW_USED_FILES tag to NO to disable the list of files generated \n"
+ "at the bottom of the documentation of classes and structs. If set to YES the \n"
+ "list will mention the files that were used to generate the documentation. \n",
+ TRUE
+ );
+ cb = addBool(
+ "SHOW_DIRECTORIES",
+ "If the sources in your project are distributed over multiple directories \n"
+ "then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy \n"
+ "in the documentation. The default is NO.\n",
+ FALSE
+ );
+ cb = addBool(
+ "SHOW_FILES",
+ "Set the SHOW_FILES tag to NO to disable the generation of the Files page.\n"
+ "This will remove the Files entry from the Quick Index and from the \n"
+ "Folder Tree View (if specified). The default is YES.\n",
+ TRUE
+ );
+ cb = addBool(
+ "SHOW_NAMESPACES",
+ "Set the SHOW_NAMESPACES tag to NO to disable the generation of the \n"
+ "Namespaces page. This will remove the Namespaces entry from the Quick Index\n"
+ "and from the Folder Tree View (if specified). The default is YES.\n",
+ TRUE
+ );
+ cs = addString( "FILE_VERSION_FILTER",
+ "The FILE_VERSION_FILTER tag can be used to specify a program or script that \n"
+ "doxygen should invoke to get the current version for each file (typically from \n"
+ "the version control system). Doxygen will invoke the program by executing (via \n"
+ "popen()) the command <command> <input-file>, where <command> is the value of \n"
+ "the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file \n"
+ "provided by doxygen. Whatever the program writes to standard output \n"
+ "is used as the file version. See the manual for examples. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs = addString( "LAYOUT_FILE",
+ "The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by \n"
+ "doxygen. The layout file controls the global structure of the generated output files \n"
+ "in an output format independent way. The create the layout file that represents \n"
+ "doxygen's defaults, run doxygen with the -l option. You can optionally specify a \n"
+ "file name after the option, if omitted DoxygenLayout.xml will be used as the name \n"
+ "of the layout file.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ addObsolete("DETAILS_AT_TOP");
+
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Messages","configuration options related to warning and progress messages");
+ //-----------------------------------------------------------------------------------------------
+
+ cb = addBool(
+ "QUIET",
+ "The QUIET tag can be used to turn on/off the messages that are generated \n"
+ "by doxygen. Possible values are YES and NO. If left blank NO is used. \n",
+ FALSE
+ );
+ cb = addBool(
+ "WARNINGS",
+ "The WARNINGS tag can be used to turn on/off the warning messages that are \n"
+ "generated by doxygen. Possible values are YES and NO. If left blank \n"
+ "NO is used. \n",
+ TRUE
+ );
+ cb = addBool(
+ "WARN_IF_UNDOCUMENTED",
+ "If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings \n"
+ "for undocumented members. If EXTRACT_ALL is set to YES then this flag will \n"
+ "automatically be disabled. \n",
+ TRUE
+ );
+ cb = addBool(
+ "WARN_IF_DOC_ERROR",
+ "If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for \n"
+ "potential errors in the documentation, such as not documenting some \n"
+ "parameters in a documented function, or documenting parameters that \n"
+ "don't exist or using markup commands wrongly. \n",
+ TRUE
+ );
+ cb = addBool( "WARN_NO_PARAMDOC",
+ "This WARN_NO_PARAMDOC option can be abled to get warnings for \n"
+ "functions that are documented, but have no documentation for their parameters \n"
+ "or return value. If set to NO (the default) doxygen will only warn about \n"
+ "wrong or incomplete parameter documentation, but not about the absence of \n"
+ "documentation.\n",
+ FALSE
+ );
+ cs = addString(
+ "WARN_FORMAT",
+ "The WARN_FORMAT tag determines the format of the warning messages that \n"
+ "doxygen can produce. The string should contain the $file, $line, and $text \n"
+ "tags, which will be replaced by the file and line number from which the \n"
+ "warning originated and the warning text. Optionally the format may contain \n"
+ "$version, which will be replaced by the version of the file (if it could \n"
+ "be obtained via FILE_VERSION_FILTER)\n"
+ );
+ cs->setDefaultValue("$file:$line: $text");
+ cs = addString(
+ "WARN_LOGFILE",
+ "The WARN_LOGFILE tag can be used to specify a file to which warning \n"
+ "and error messages should be written. If left blank the output is written \n"
+ "to stderr. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Input","configuration options related to the input files");
+ //-----------------------------------------------------------------------------------------------
+ cl = addList(
+ "INPUT",
+ "The INPUT tag can be used to specify the files and/or directories that contain \n"
+ "documented source files. You may enter file names like \"myfile.cpp\" or \n"
+ "directories like \"/usr/src/myproject\". Separate the files or directories \n"
+ "with spaces. \n"
+ );
+ cl->setWidgetType(ConfigList::FileAndDir);
+ cs = addString( "INPUT_ENCODING",
+ "This tag can be used to specify the character encoding of the source files \n"
+ "that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is \n"
+ "also the default input encoding. Doxygen uses libiconv (or the iconv built \n"
+ "into libc) for the transcoding. See http://www.gnu.org/software/libiconv for \n"
+ "the list of possible encodings.\n"
+ );
+ cs->setDefaultValue("UTF-8");
+ cl = addList(
+ "FILE_PATTERNS",
+ "If the value of the INPUT tag contains directories, you can use the \n"
+ "FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n"
+ "and *.h) to filter out the source-files in the directories. If left \n"
+ "blank the following patterns are tested: \n"
+ "*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx \n"
+ "*.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90\n"
+ );
+ cb = addBool(
+ "RECURSIVE",
+ "The RECURSIVE tag can be used to turn specify whether or not subdirectories \n"
+ "should be searched for input files as well. Possible values are YES and NO. \n"
+ "If left blank NO is used. \n",
+ FALSE
+ );
+ cl = addList(
+ "EXCLUDE",
+ "The EXCLUDE tag can be used to specify files and/or directories that should \n"
+ "excluded from the INPUT source files. This way you can easily exclude a \n"
+ "subdirectory from a directory tree whose root is specified with the INPUT tag. \n"
+ );
+ cb = addBool(
+ "EXCLUDE_SYMLINKS",
+ "The EXCLUDE_SYMLINKS tag can be used select whether or not files or \n"
+ "directories that are symbolic links (a Unix filesystem feature) are excluded \n"
+ "from the input. \n",
+ FALSE
+ );
+ cl->setWidgetType(ConfigList::FileAndDir);
+ cl = addList(
+ "EXCLUDE_PATTERNS",
+ "If the value of the INPUT tag contains directories, you can use the \n"
+ "EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude \n"
+ "certain files from those directories. Note that the wildcards are matched \n"
+ "against the file with absolute path, so to exclude all test directories \n"
+ "for example use the pattern */test/* \n"
+ );
+ cl = addList(
+ "EXCLUDE_SYMBOLS",
+ "The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n"
+ "(namespaces, classes, functions, etc.) that should be excluded from the \n"
+ "output. The symbol name can be a fully qualified name, a word, or if the \n"
+ "wildcard * is used, a substring. Examples: ANamespace, AClass, \n"
+ "AClass::ANamespace, ANamespace::*Test \n"
+ );
+ cl = addList(
+ "EXAMPLE_PATH",
+ "The EXAMPLE_PATH tag can be used to specify one or more files or \n"
+ "directories that contain example code fragments that are included (see \n"
+ "the \\include command). \n"
+ );
+ cl->setWidgetType(ConfigList::Dir);
+ cl = addList(
+ "EXAMPLE_PATTERNS",
+ "If the value of the EXAMPLE_PATH tag contains directories, you can use the \n"
+ "EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp \n"
+ "and *.h) to filter out the source-files in the directories. If left \n"
+ "blank all files are included. \n"
+ );
+ cb = addBool(
+ "EXAMPLE_RECURSIVE",
+ "If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be \n"
+ "searched for input files to be used with the \\include or \\dontinclude \n"
+ "commands irrespective of the value of the RECURSIVE tag. \n"
+ "Possible values are YES and NO. If left blank NO is used. \n",
+ FALSE
+ );
+ cl = addList(
+ "IMAGE_PATH",
+ "The IMAGE_PATH tag can be used to specify one or more files or \n"
+ "directories that contain image that are included in the documentation (see \n"
+ "the \\image command). \n"
+ );
+ cl->setWidgetType(ConfigList::Dir);
+ cs = addString(
+ "INPUT_FILTER",
+ "The INPUT_FILTER tag can be used to specify a program that doxygen should \n"
+ "invoke to filter for each input file. Doxygen will invoke the filter program \n"
+ "by executing (via popen()) the command <filter> <input-file>, where <filter> \n"
+ "is the value of the INPUT_FILTER tag, and <input-file> is the name of an \n"
+ "input file. Doxygen will then use the output that the filter program writes \n"
+ "to standard output. If FILTER_PATTERNS is specified, this tag will be \n"
+ "ignored. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cl = addList(
+ "FILTER_PATTERNS",
+ "The FILTER_PATTERNS tag can be used to specify filters on a per file pattern \n"
+ "basis. Doxygen will compare the file name with each pattern and apply the \n"
+ "filter if there is a match. The filters are a list of the form: \n"
+ "pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further \n"
+ "info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER \n"
+ "is applied to all files. \n"
+ );
+ cl->setWidgetType(ConfigList::File);
+ cb = addBool(
+ "FILTER_SOURCE_FILES",
+ "If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using \n"
+ "INPUT_FILTER) will be used to filter the input files when producing source \n"
+ "files to browse (i.e. when SOURCE_BROWSER is set to YES). \n",
+ FALSE
+ );
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Source Browser","configuration options related to source browsing");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "SOURCE_BROWSER",
+ "If the SOURCE_BROWSER tag is set to YES then a list of source files will \n"
+ "be generated. Documented entities will be cross-referenced with these sources. \n"
+ "Note: To get rid of all source code in the generated output, make sure also \n"
+ "VERBATIM_HEADERS is set to NO. \n",
+ FALSE
+ );
+ cb = addBool(
+ "INLINE_SOURCES",
+ "Setting the INLINE_SOURCES tag to YES will include the body \n"
+ "of functions and classes directly in the documentation. \n",
+ FALSE
+ );
+ cb = addBool(
+ "STRIP_CODE_COMMENTS",
+ "Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct \n"
+ "doxygen to hide any special comment blocks from generated source code \n"
+ "fragments. Normal C and C++ comments will always remain visible. \n",
+ TRUE
+ );
+ cb = addBool( "REFERENCED_BY_RELATION",
+ "If the REFERENCED_BY_RELATION tag is set to YES \n"
+ "then for each documented function all documented \n"
+ "functions referencing it will be listed. \n",
+ FALSE
+ );
+ cb = addBool( "REFERENCES_RELATION",
+ "If the REFERENCES_RELATION tag is set to YES \n"
+ "then for each documented function all documented entities \n"
+ "called/used by that function will be listed. \n",
+ FALSE
+ );
+ cb = addBool( "REFERENCES_LINK_SOURCE",
+ "If the REFERENCES_LINK_SOURCE tag is set to YES (the default)\n"
+ "and SOURCE_BROWSER tag is set to YES, then the hyperlinks from\n"
+ "functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will\n"
+ "link to the source code. Otherwise they will link to the documentstion.\n",
+ TRUE
+ );
+ cb = addBool(
+ "USE_HTAGS",
+ "If the USE_HTAGS tag is set to YES then the references to source code \n"
+ "will point to the HTML generated by the htags(1) tool instead of doxygen \n"
+ "built-in source browser. The htags tool is part of GNU's global source \n"
+ "tagging system (see http://www.gnu.org/software/global/global.html). You \n"
+ "will need version 4.8.6 or higher. \n",
+ FALSE
+ );
+ cb->addDependency("SOURCE_BROWSER");
+ cb = addBool(
+ "VERBATIM_HEADERS",
+ "If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen \n"
+ "will generate a verbatim copy of the header file for each class for \n"
+ "which an include is specified. Set to NO to disable this. \n",
+ TRUE
+ );
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Index","configuration options related to the alphabetical class index");
+ //-----------------------------------------------------------------------------------------------
+
+ cb = addBool(
+ "ALPHABETICAL_INDEX",
+ "If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index \n"
+ "of all compounds will be generated. Enable this if the project \n"
+ "contains a lot of classes, structs, unions or interfaces. \n",
+ FALSE
+ );
+ ci = addInt(
+ "COLS_IN_ALPHA_INDEX",
+ "If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then \n"
+ "the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns \n"
+ "in which this list will be split (can be a number in the range [1..20]) \n",
+ 1,20,5
+ );
+ cl = addList(
+ "IGNORE_PREFIX",
+ "In case all classes in a project start with a common prefix, all \n"
+ "classes will be put under the same header in the alphabetical index. \n"
+ "The IGNORE_PREFIX tag can be used to specify one or more prefixes that \n"
+ "should be ignored while generating the index headers. \n"
+ );
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "HTML","configuration options related to the HTML output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_HTML",
+ "If the GENERATE_HTML tag is set to YES (the default) Doxygen will \n"
+ "generate HTML output. \n",
+ TRUE
+ );
+ cs = addString(
+ "HTML_OUTPUT",
+ "The HTML_OUTPUT tag is used to specify where the HTML docs will be put. \n"
+ "If a relative path is entered the value of OUTPUT_DIRECTORY will be \n"
+ "put in front of it. If left blank `html' will be used as the default path. \n"
+ );
+ cs->setDefaultValue("html");
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "HTML_FILE_EXTENSION",
+ "The HTML_FILE_EXTENSION tag can be used to specify the file extension for \n"
+ "each generated HTML page (for example: .htm,.php,.asp). If it is left blank \n"
+ "doxygen will generate files with .html extension.\n"
+ );
+ cs->setDefaultValue(".html");
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "HTML_HEADER",
+ "The HTML_HEADER tag can be used to specify a personal HTML header for \n"
+ "each generated HTML page. If it is left blank doxygen will generate a \n"
+ "standard header.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "HTML_FOOTER",
+ "The HTML_FOOTER tag can be used to specify a personal HTML footer for \n"
+ "each generated HTML page. If it is left blank doxygen will generate a \n"
+ "standard footer.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "HTML_STYLESHEET",
+ "The HTML_STYLESHEET tag can be used to specify a user-defined cascading \n"
+ "style sheet that is used by each HTML page. It can be used to \n"
+ "fine-tune the look of the HTML output. If the tag is left blank doxygen \n"
+ "will generate a default style sheet. Note that doxygen will try to copy \n"
+ "the style sheet file to the HTML output directory, so don't put your own \n"
+ "stylesheet in the HTML output directory as well, or it will be erased! \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cb = addBool(
+ "HTML_ALIGN_MEMBERS",
+ "If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, \n"
+ "files or namespaces will be aligned in HTML using tables. If set to \n"
+ "NO a bullet list will be used. \n",
+ TRUE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cb = addBool(
+ "HTML_DYNAMIC_SECTIONS",
+ "If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML \n"
+ "documentation will contain sections that can be hidden and shown after the \n"
+ "page has loaded. For this to work a browser that supports \n"
+ "JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox \n"
+ "Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+
+ /////////////////////////////////////////////////////////
+ // Docsets //////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ cb = addBool( "GENERATE_DOCSET",
+ "If the GENERATE_DOCSET tag is set to YES, additional index files \n"
+ "will be generated that can be used as input for Apple's Xcode 3 \n"
+ "integrated development environment, introduced with OSX 10.5 (Leopard). \n"
+ "To create a documentation set, doxygen will generate a Makefile in the \n"
+ "HTML output directory. Running make will produce the docset in that \n"
+ "directory and running \"make install\" will install the docset in \n"
+ "~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find \n"
+ "it at startup. \n"
+ "See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html "
+ "for more information. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cs = addString(
+ "DOCSET_FEEDNAME",
+ "When GENERATE_DOCSET tag is set to YES, this tag determines the name of the \n"
+ "feed. A documentation feed provides an umbrella under which multiple \n"
+ "documentation sets from a single provider (such as a company or product suite) \n"
+ "can be grouped. \n"
+ );
+ cs->setDefaultValue("Doxygen generated docs");
+ cs->addDependency("GENERATE_DOCSET");
+ cs = addString(
+ "DOCSET_BUNDLE_ID",
+ "When GENERATE_DOCSET tag is set to YES, this tag specifies a string that \n"
+ "should uniquely identify the documentation set bundle. This should be a \n"
+ "reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen \n"
+ "will append .docset to the name. \n"
+ );
+ cs->setDefaultValue("org.doxygen.Project");
+ cs->addDependency("GENERATE_DOCSET");
+
+ /////////////////////////////////////////////////////////
+ // HTMLHELP /////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ cb = addBool(
+ "GENERATE_HTMLHELP",
+ "If the GENERATE_HTMLHELP tag is set to YES, additional index files \n"
+ "will be generated that can be used as input for tools like the \n"
+ "Microsoft HTML help workshop to generate a compiled HTML help file (.chm) \n"
+ "of the generated HTML documentation. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cs = addString(
+ "CHM_FILE",
+ "If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can \n"
+ "be used to specify the file name of the resulting .chm file. You \n"
+ "can add a path in front of the file if the result should not be \n"
+ "written to the html output directory. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "HHC_LOCATION",
+ "If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can \n"
+ "be used to specify the location (absolute path including file name) of \n"
+ "the HTML help compiler (hhc.exe). If non-empty doxygen will try to run \n"
+ "the HTML help compiler on the generated index.hhp.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+#if 0
+ cs = addString(
+ "QTHELP_FILE",
+ "If the GENERATE_HTMLHELP tag is set to YES, the QTHELP_FILE tag can \n"
+ "be used to specify the file name of the resulting .(qch|qhp) file. \n"
+ "You can add a path in front of the file if the result should not be \n"
+ "written to the html output directory. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "QTHELP_CONFIG",
+ "If DOXYGEN2QTHELP_LOC is set, QTHELP_CONFIG must specify the file name \n"
+ "of a config file to pass to doxygen2qthelp. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+ cs = addString(
+ "DOXYGEN2QTHELP_LOC",
+ "If the GENERATE_HTMLHELP tag is set to YES, the DOXYGEN2QTHELP_LOC tag \n"
+ "can be used to specify the location (absolute path including file name) of \n"
+ "the doxygen2qthelp tool. If non-empty doxygen will try to run doxygen2qthelp \n"
+ "on the generated index.hhp.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_HTML");
+#endif
+ addObsolete("QTHELP_FILE");
+ addObsolete("QTHELP_CONFIG");
+ addObsolete("DOXYGEN2QTHELP_LOC");
+ cb = addBool(
+ "GENERATE_CHI",
+ "If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag \n"
+ "controls if a separate .chi index file is generated (YES) or that \n"
+ "it should be included in the master .chm file (NO).\n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cs = addString(
+ "CHM_INDEX_ENCODING",
+ "If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING\n"
+ "is used to encode HtmlHelp index (hhk), content (hhc) and project file\n"
+ "content.\n"
+ );
+ cs->addDependency("GENERATE_HTML");
+ cb = addBool(
+ "BINARY_TOC",
+ "If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag \n"
+ "controls whether a binary table of contents is generated (YES) or a \n"
+ "normal table of contents (NO) in the .chm file.\n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cb = addBool(
+ "TOC_EXPAND",
+ "The TOC_EXPAND flag can be set to YES to add extra items for group members \n"
+ "to the contents of the HTML help documentation and to the tree view. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+
+ /////////////////////////////////////////////////////////
+ // QT HELP //////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ cb = addBool(
+ "GENERATE_QHP",
+ "If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER \n"
+ "are set, an additional index file will be generated that can be used as input for \n"
+ "Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated \n"
+ "HTML documentation. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ cs = addString(
+ "QCH_FILE",
+ "If the QHG_LOCATION tag is specified, the QCH_FILE tag can \n"
+ "be used to specify the file name of the resulting .qch file. \n"
+ "The path specified is relative to the HTML output folder. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_QHP");
+ cs = addString(
+ "QHP_NAMESPACE",
+ "The QHP_NAMESPACE tag specifies the namespace to use when generating \n"
+ "Qt Help Project output. For more information please see \n"
+ "http://doc.trolltech.com/qthelpproject.html#namespace \n"
+ );
+ cs->addDependency("GENERATE_QHP");
+ cs = addString(
+ "QHP_VIRTUAL_FOLDER",
+ "The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating \n"
+ "Qt Help Project output. For more information please see \n"
+ "http://doc.trolltech.com/qthelpproject.html#virtual-folders \n"
+ );
+ cs->setDefaultValue("doc");
+ cs->addDependency("GENERATE_QHP");
+
+ cs = addString(
+ "QHP_CUSTOM_FILTER_NAME",
+ "If QHP_CUSTOM_FILTER_NAME is set, it specifies the name of a custom filter to add. \n"
+ "For more information please see \n"
+ "http://doc.trolltech.com/qthelpproject.html#custom-filters \n"
+ );
+ cs->addDependency("GENERATE_QHP");
+
+ cs = addString(
+ "QHP_CUST_FILTER_ATTRS",
+ "The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add."
+ "For more information please see \n"
+ "<a href=\"http://doc.trolltech.com/qthelpproject.html#custom-filters\">Qt Help Project / Custom Filters</a>. \n"
+ );
+ cs->addDependency("GENERATE_QHP");
+
+ cs = addString(
+ "QHP_SECT_FILTER_ATTRS",
+ "The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's \n"
+ "filter section matches. \n"
+ "<a href=\"http://doc.trolltech.com/qthelpproject.html#filter-attributes\">Qt Help Project / Filter Attributes</a>. \n"
+ );
+ cs->addDependency("GENERATE_QHP");
+
+ cs = addString(
+ "QHG_LOCATION",
+ "If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can \n"
+ "be used to specify the location of Qt's qhelpgenerator. \n"
+ "If non-empty doxygen will try to run qhelpgenerator on the generated \n"
+ ".qhp file .\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_QHP");
+
+ /////////////////////////////////////////////////////////
+ // MISC /////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ cb = addBool(
+ "DISABLE_INDEX",
+ "The DISABLE_INDEX tag can be used to turn on/off the condensed index at \n"
+ "top of each HTML page. The value NO (the default) enables the index and \n"
+ "the value YES disables it. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_HTML");
+ ci = addInt(
+ "ENUM_VALUES_PER_LINE",
+ "This tag can be used to set the number of enum values (range [1..20]) \n"
+ "that doxygen will group on one line in the generated HTML documentation. \n",
+ 1,20,4
+ );
+ ci->addDependency("GENERATE_HTML");
+ ce = addEnum(
+ "GENERATE_TREEVIEW",
+ "The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n"
+ "structure should be generated to display hierarchical information.\n"
+ "If the tag value is set to FRAME, a side panel will be generated\n"
+ "containing a tree-like index structure (just like the one that \n"
+ "is generated for HTML Help). For this to work a browser that supports \n"
+ "JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, \n"
+ "Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are \n"
+ "probably better off using the HTML help feature. Other possible values \n"
+ "for this tag are: HIERARCHIES, which will generate the Groups, Directories,\n"
+ "and Class Hierarchy pages using a tree view instead of an ordered list;\n"
+ "ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which\n"
+ "disables this behavior completely. For backwards compatibility with previous\n"
+ "releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE\n"
+ "respectively.\n",
+ "NONE"
+ );
+ ce->addValue("NONE");
+ ce->addValue("FRAME");
+ ce->addValue("HIERARCHIES");
+ ce->addValue("ALL");
+ cb->addDependency("GENERATE_HTML");
+ ci = addInt(
+ "TREEVIEW_WIDTH",
+ "If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be \n"
+ "used to set the initial width (in pixels) of the frame in which the tree \n"
+ "is shown. \n",
+ 0,1500,250
+ );
+ ci->addDependency("GENERATE_HTML");
+ ci = addInt(
+ "FORMULA_FONTSIZE",
+ "Use this tag to change the font size of Latex formulas included \n"
+ "as images in the HTML documentation. The default is 10. Note that \n"
+ "when you change the font size after a successful doxygen run you need \n"
+ "to manually remove any form_*.png images from the HTML output directory \n"
+ "to force them to be regenerated. \n",
+ 8,50,10
+ );
+ ci->addDependency("GENERATE_HTML");
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "LaTeX","configuration options related to the LaTeX output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_LATEX",
+ "If the GENERATE_LATEX tag is set to YES (the default) Doxygen will \n"
+ "generate Latex output. \n",
+ TRUE
+ );
+ cs = addString(
+ "LATEX_OUTPUT",
+ "The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. \n"
+ "If a relative path is entered the value of OUTPUT_DIRECTORY will be \n"
+ "put in front of it. If left blank `latex' will be used as the default path. \n"
+ );
+ cs->setDefaultValue("latex");
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("GENERATE_LATEX");
+#if 0
+ cs = addString( "LATEX_OUTPUT_ENCODING",
+ "The LATEX_OUTPUT_ENCODING specifies the character encoding of the LaTeX output.\n"
+ "produced by doxygen. If left blank ISO-8859-1 will be used. Doxygen uses \n"
+ "libiconv for the transcoding. See http://www.gnu.org/software/libiconv for \n"
+ "the list of possible encodings.\n"
+ );
+ cs->setDefaultValue("ISO-8859-1");
+ cs->addDependency("GENERATE_LATEX");
+#endif
+ cs = addString(
+ "LATEX_CMD_NAME",
+ "The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n"
+ "invoked. If left blank `latex' will be used as the default command name. \n"
+ );
+ cs->setDefaultValue("latex");
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_LATEX");
+ cs = addString(
+ "MAKEINDEX_CMD_NAME",
+ "The MAKEINDEX_CMD_NAME tag can be used to specify the command name to \n"
+ "generate index for LaTeX. If left blank `makeindex' will be used as the \n"
+ "default command name. \n"
+ );
+ cs->setDefaultValue("makeindex");
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_LATEX");
+ cb = addBool(
+ "COMPACT_LATEX",
+ "If the COMPACT_LATEX tag is set to YES Doxygen generates more compact \n"
+ "LaTeX documents. This may be useful for small projects and may help to \n"
+ "save some trees in general. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_LATEX");
+ ce = addEnum(
+ "PAPER_TYPE",
+ "The PAPER_TYPE tag can be used to set the paper type that is used \n"
+ "by the printer. Possible values are: a4, a4wide, letter, legal and \n"
+ "executive. If left blank a4wide will be used. \n",
+ "a4wide"
+ );
+ ce->addValue("a4");
+ ce->addValue("a4wide");
+ ce->addValue("letter");
+ ce->addValue("legal");
+ ce->addValue("executive");
+ ce->addDependency("GENERATE_LATEX");
+ cl = addList(
+ "EXTRA_PACKAGES",
+ "The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX \n"
+ "packages that should be included in the LaTeX output. \n"
+ );
+ cl->addDependency("GENERATE_LATEX");
+ cs = addString(
+ "LATEX_HEADER",
+ "The LATEX_HEADER tag can be used to specify a personal LaTeX header for \n"
+ "the generated latex document. The header should contain everything until \n"
+ "the first chapter. If it is left blank doxygen will generate a \n"
+ "standard header. Notice: only use this tag if you know what you are doing! \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_LATEX");
+ cb = addBool(
+ "PDF_HYPERLINKS",
+ "If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated \n"
+ "is prepared for conversion to pdf (using ps2pdf). The pdf file will \n"
+ "contain links (just like the HTML output) instead of page references \n"
+ "This makes the output suitable for online browsing using a pdf viewer. \n",
+ TRUE
+ );
+ cb->addDependency("GENERATE_LATEX");
+ cb = addBool(
+ "USE_PDFLATEX",
+ "If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of \n"
+ "plain latex in the generated Makefile. Set this option to YES to get a \n"
+ "higher quality PDF documentation. \n",
+ TRUE
+ );
+ cb->addDependency("GENERATE_LATEX");
+ cb = addBool(
+ "LATEX_BATCHMODE",
+ "If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\\\batchmode. \n"
+ "command to the generated LaTeX files. This will instruct LaTeX to keep \n"
+ "running if errors occur, instead of asking the user for help. \n"
+ "This option is also used when generating formulas in HTML. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_LATEX");
+ cb = addBool(
+ "LATEX_HIDE_INDICES",
+ "If LATEX_HIDE_INDICES is set to YES then doxygen will not \n"
+ "include the index chapters (such as File Index, Compound Index, etc.) \n"
+ "in the output. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_LATEX");
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "RTF","configuration options related to the RTF output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_RTF",
+ "If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output \n"
+ "The RTF output is optimized for Word 97 and may not look very pretty with \n"
+ "other RTF readers or editors.\n",
+ FALSE
+ );
+ cs = addString(
+ "RTF_OUTPUT",
+ "The RTF_OUTPUT tag is used to specify where the RTF docs will be put. \n"
+ "If a relative path is entered the value of OUTPUT_DIRECTORY will be \n"
+ "put in front of it. If left blank `rtf' will be used as the default path. \n"
+ );
+ cs->setDefaultValue("rtf");
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("GENERATE_RTF");
+#if 0
+ cs = addString( "RTF_OUTPUT_ENCODING",
+ "The RTF_OUTPUT_ENCODING specifies the character encoding of the RTF output.\n"
+ "produced by doxygen. If left blank ISO-8859-1 will be used. Doxygen uses \n"
+ "libiconv for the transcoding. See http://www.gnu.org/software/libiconv for \n"
+ "the list of possible encodings.\n"
+ );
+ cs->setDefaultValue("ISO-8859-1");
+ cs->addDependency("GENERATE_RTF");
+#endif
+ cb = addBool(
+ "COMPACT_RTF",
+ "If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n"
+ "RTF documents. This may be useful for small projects and may help to \n"
+ "save some trees in general. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_RTF");
+ cb = addBool(
+ "RTF_HYPERLINKS",
+ "If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated \n"
+ "will contain hyperlink fields. The RTF file will \n"
+ "contain links (just like the HTML output) instead of page references. \n"
+ "This makes the output suitable for online browsing using WORD or other \n"
+ "programs which support those fields. \n"
+ "Note: wordpad (write) and others do not support links. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_RTF");
+ cs = addString(
+ "RTF_STYLESHEET_FILE",
+ "Load stylesheet definitions from file. Syntax is similar to doxygen's \n"
+ "config file, i.e. a series of assignments. You only have to provide \n"
+ "replacements, missing definitions are set to their default value. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_RTF");
+ cs = addString(
+ "RTF_EXTENSIONS_FILE",
+ "Set optional variables used in the generation of an rtf document. \n"
+ "Syntax is similar to doxygen's config file.\n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cs->addDependency("GENERATE_RTF");
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Man","configuration options related to the man page output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_MAN",
+ "If the GENERATE_MAN tag is set to YES (the default) Doxygen will \n"
+ "generate man pages \n",
+ FALSE
+ );
+ cs = addString(
+ "MAN_OUTPUT",
+ "The MAN_OUTPUT tag is used to specify where the man pages will be put. \n"
+ "If a relative path is entered the value of OUTPUT_DIRECTORY will be \n"
+ "put in front of it. If left blank `man' will be used as the default path. \n"
+ );
+ cs->setDefaultValue("man");
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("GENERATE_MAN");
+ cs = addString(
+ "MAN_EXTENSION",
+ "The MAN_EXTENSION tag determines the extension that is added to \n"
+ "the generated man pages (default is the subroutine's section .3) \n"
+ );
+ cs->setDefaultValue(".3");
+ cs->addDependency("GENERATE_MAN");
+ cb = addBool(
+ "MAN_LINKS",
+ "If the MAN_LINKS tag is set to YES and Doxygen generates man output, \n"
+ "then it will generate one additional man file for each entity \n"
+ "documented in the real man page(s). These additional files \n"
+ "only source the real man page, but without them the man command \n"
+ "would be unable to find the correct page. The default is NO. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_MAN");
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "XML","configuration options related to the XML output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_XML",
+ "If the GENERATE_XML tag is set to YES Doxygen will \n"
+ "generate an XML file that captures the structure of \n"
+ "the code including all documentation. \n",
+ FALSE
+ );
+ cs = addString(
+ "XML_OUTPUT",
+ "The XML_OUTPUT tag is used to specify where the XML pages will be put. \n"
+ "If a relative path is entered the value of OUTPUT_DIRECTORY will be \n"
+ "put in front of it. If left blank `xml' will be used as the default path. \n"
+ );
+ cs->setDefaultValue("xml");
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("GENERATE_XML");
+ cs = addString(
+ "XML_SCHEMA",
+ "The XML_SCHEMA tag can be used to specify an XML schema, \n"
+ "which can be used by a validating XML parser to check the \n"
+ "syntax of the XML files. \n"
+ );
+ cs->addDependency("GENERATE_XML");
+ cs = addString(
+ "XML_DTD",
+ "The XML_DTD tag can be used to specify an XML DTD, \n"
+ "which can be used by a validating XML parser to check the \n"
+ "syntax of the XML files. \n"
+ );
+ cs->addDependency("GENERATE_XML");
+ cb = addBool(
+ "XML_PROGRAMLISTING",
+ "If the XML_PROGRAMLISTING tag is set to YES Doxygen will \n"
+ "dump the program listings (including syntax highlighting \n"
+ "and cross-referencing information) to the XML output. Note that \n"
+ "enabling this will significantly increase the size of the XML output. \n",
+ TRUE
+ );
+ cb->addDependency("GENERATE_XML");
+
+ //--------------------------------------------------------------------------
+ addInfo( "DEF","configuration options for the AutoGen Definitions output");
+ //--------------------------------------------------------------------------
+ cb = addBool("GENERATE_AUTOGEN_DEF",
+
+ "If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will \n"
+ "generate an AutoGen Definitions (see autogen.sf.net) file \n"
+ "that captures the structure of the code including all \n"
+ "documentation. Note that this feature is still experimental \n"
+ "and incomplete at the moment. \n",
+
+ FALSE );
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "PerlMod","configuration options related to the Perl module output");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "GENERATE_PERLMOD",
+ "If the GENERATE_PERLMOD tag is set to YES Doxygen will \n"
+ "generate a Perl module file that captures the structure of \n"
+ "the code including all documentation. Note that this \n"
+ "feature is still experimental and incomplete at the \n"
+ "moment. \n",
+ FALSE
+ );
+ cb = addBool(
+ "PERLMOD_LATEX",
+ "If the PERLMOD_LATEX tag is set to YES Doxygen will generate \n"
+ "the necessary Makefile rules, Perl scripts and LaTeX code to be able \n"
+ "to generate PDF and DVI output from the Perl module output. \n",
+ FALSE
+ );
+ cb->addDependency("GENERATE_PERLMOD");
+ cb = addBool(
+ "PERLMOD_PRETTY",
+ "If the PERLMOD_PRETTY tag is set to YES the Perl module output will be \n"
+ "nicely formatted so it can be parsed by a human reader. This is useful \n"
+ "if you want to understand what is going on. On the other hand, if this \n"
+ "tag is set to NO the size of the Perl module output will be much smaller \n"
+ "and Perl will parse it just the same. \n",
+ TRUE
+ );
+ cb->addDependency("GENERATE_PERLMOD");
+ cs = addString(
+ "PERLMOD_MAKEVAR_PREFIX",
+ "The names of the make variables in the generated doxyrules.make file \n"
+ "are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. \n"
+ "This is useful so different doxyrules.make files included by the same \n"
+ "Makefile don't overwrite each other's variables."
+ );
+ cs->addDependency("GENERATE_PERLMOD");
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Preprocessor","Configuration options related to the preprocessor ");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "ENABLE_PREPROCESSING",
+ "If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will \n"
+ "evaluate all C-preprocessor directives found in the sources and include \n"
+ "files. \n",
+ TRUE
+ );
+ cb = addBool(
+ "MACRO_EXPANSION",
+ "If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro \n"
+ "names in the source code. If set to NO (the default) only conditional \n"
+ "compilation will be performed. Macro expansion can be done in a controlled \n"
+ "way by setting EXPAND_ONLY_PREDEF to YES. \n",
+ FALSE
+ );
+ cb->addDependency("ENABLE_PREPROCESSING");
+ cb = addBool(
+ "EXPAND_ONLY_PREDEF",
+ "If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES \n"
+ "then the macro expansion is limited to the macros specified with the \n"
+ "PREDEFINED and EXPAND_AS_DEFINED tags. \n",
+ FALSE
+ );
+ cb->addDependency("ENABLE_PREPROCESSING");
+ cb = addBool(
+ "SEARCH_INCLUDES",
+ "If the SEARCH_INCLUDES tag is set to YES (the default) the includes files \n"
+ "in the INCLUDE_PATH (see below) will be search if a #include is found. \n",
+ TRUE
+ );
+ cb->addDependency("ENABLE_PREPROCESSING");
+ cl = addList(
+ "INCLUDE_PATH",
+ "The INCLUDE_PATH tag can be used to specify one or more directories that \n"
+ "contain include files that are not input files but should be processed by \n"
+ "the preprocessor.\n"
+ );
+ cl->setWidgetType(ConfigList::Dir);
+ cl->addDependency("ENABLE_PREPROCESSING");
+ cl = addList(
+ "INCLUDE_FILE_PATTERNS",
+ "You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard \n"
+ "patterns (like *.h and *.hpp) to filter out the header-files in the \n"
+ "directories. If left blank, the patterns specified with FILE_PATTERNS will \n"
+ "be used. \n"
+ );
+ cl->addDependency("ENABLE_PREPROCESSING");
+ cl = addList(
+ "PREDEFINED",
+ "The PREDEFINED tag can be used to specify one or more macro names that \n"
+ "are defined before the preprocessor is started (similar to the -D option of \n"
+ "gcc). The argument of the tag is a list of macros of the form: name \n"
+ "or name=definition (no spaces). If the definition and the = are \n"
+ "omitted =1 is assumed. To prevent a macro definition from being \n"
+ "undefined via #undef or recursively expanded use the := operator \n"
+ "instead of the = operator.\n"
+ );
+ cl->addDependency("ENABLE_PREPROCESSING");
+ cl = addList(
+ "EXPAND_AS_DEFINED",
+ "If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then \n"
+ "this tag can be used to specify a list of macro names that should be expanded. \n"
+ "The macro definition that is found in the sources will be used. \n"
+ "Use the PREDEFINED tag if you want to use a different macro definition. \n"
+ );
+ cl->addDependency("ENABLE_PREPROCESSING");
+ cb = addBool(
+ "SKIP_FUNCTION_MACROS",
+ "If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then \n"
+ "doxygen's preprocessor will remove all function-like macros that are alone \n"
+ "on a line, have an all uppercase name, and do not end with a semicolon. Such \n"
+ "function macros are typically used for boiler-plate code, and will confuse \n"
+ "the parser if not removed. \n",
+ TRUE
+ );
+ cb->addDependency("ENABLE_PREPROCESSING");
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "External","Configuration::additions related to external references ");
+ //-----------------------------------------------------------------------------------------------
+ cl = addList(
+ "TAGFILES",
+ "The TAGFILES option can be used to specify one or more tagfiles. \n"
+ "Optionally an initial location of the external documentation \n"
+ "can be added for each tagfile. The format of a tag file without \n"
+ "this location is as follows: \n"
+ " TAGFILES = file1 file2 ... \n"
+ "Adding location for the tag files is done as follows: \n"
+ " TAGFILES = file1=loc1 \"file2 = loc2\" ... \n"
+ "where \"loc1\" and \"loc2\" can be relative or absolute paths or \n"
+ "URLs. If a location is present for each tag, the installdox tool \n"
+ "does not have to be run to correct the links.\n"
+ "Note that each tag file must have a unique name\n"
+ "(where the name does NOT include the path)\n"
+ "If a tag file is not located in the directory in which doxygen \n"
+ "is run, you must also specify the path to the tagfile here. \n"
+ );
+ cl->setWidgetType(ConfigList::File);
+ cs = addString(
+ "GENERATE_TAGFILE",
+ "When a file name is specified after GENERATE_TAGFILE, doxygen will create \n"
+ "a tag file that is based on the input files it reads. \n"
+ );
+ cs->setWidgetType(ConfigString::File);
+ cb = addBool(
+ "ALLEXTERNALS",
+ "If the ALLEXTERNALS tag is set to YES all external classes will be listed \n"
+ "in the class index. If set to NO only the inherited external classes \n"
+ "will be listed. \n",
+ FALSE
+ );
+ cb = addBool(
+ "EXTERNAL_GROUPS",
+ "If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed \n"
+ "in the modules index. If set to NO, only the current project's groups will \n"
+ "be listed. \n",
+ TRUE
+ );
+ cs = addString(
+ "PERL_PATH",
+ "The PERL_PATH should be the absolute path and name of the perl script \n"
+ "interpreter (i.e. the result of `which perl'). \n"
+ );
+ cs->setDefaultValue("/usr/bin/perl");
+ cs->setWidgetType(ConfigString::Dir);
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Dot","Configuration options related to the dot tool ");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "CLASS_DIAGRAMS",
+ "If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will \n"
+ "generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base \n"
+ "or super classes. Setting the tag to NO turns the diagrams off. Note that \n"
+ "this option is superseded by the HAVE_DOT option below. This is only a \n"
+ "fallback. It is recommended to install and use dot, since it yields more \n"
+ "powerful graphs. \n",
+ TRUE
+ );
+ cs = addString( "MSCGEN_PATH",
+ "You can define message sequence charts within doxygen comments using the \\msc \n"
+ "command. Doxygen will then run the mscgen tool (see \n"
+ "http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the \n"
+ "documentation. The MSCGEN_PATH tag allows you to specify the directory where \n"
+ "the mscgen tool resides. If left empty the tool is assumed to be found in the \n"
+ "default search path. \n"
+ );
+ cb = addBool(
+ "HIDE_UNDOC_RELATIONS",
+ "If set to YES, the inheritance and collaboration graphs will hide \n"
+ "inheritance and usage relations if the target is undocumented \n"
+ "or is not a class. \n",
+ TRUE
+ );
+ cb = addBool(
+ "HAVE_DOT",
+ "If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is \n"
+ "available from the path. This tool is part of Graphviz, a graph visualization \n"
+ "toolkit from AT&T and Lucent Bell Labs. The other options in this section \n"
+ "have no effect if this option is set to NO (the default) \n",
+ FALSE
+ );
+ cs = addString( "DOT_FONTNAME",
+ "By default doxygen will write a font called FreeSans.ttf to the output \n"
+ "directory and reference it in all dot files that doxygen generates. This \n"
+ "font does not include all possible unicode characters however, so when you need \n"
+ "these (or just want a differently looking font) you can specify the font name \n"
+ "using DOT_FONTNAME. You need need to make sure dot is able to find the font, \n"
+ "which can be done by putting it in a standard location or by setting the \n"
+ "DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory \n"
+ "containing the font. \n"
+ );
+ cs->setDefaultValue("FreeSans");
+ cb->addDependency("HAVE_DOT");
+ ci = addInt( "DOT_FONTSIZE",
+ "The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. \n"
+ "The default size is 10pt. \n",
+ 4,24,10
+ );
+ ci->addDependency("HAVE_DOT");
+ cs = addString( "DOT_FONTPATH",
+ "By default doxygen will tell dot to use the output directory to look for the \n"
+ "FreeSans.ttf font (which doxygen will put there itself). If you specify a \n"
+ "different font using DOT_FONTNAME you can set the path where dot \n"
+ "can find it using this tag. \n"
+ );
+ cs->addDependency("HAVE_DOT");
+ cb = addBool(
+ "CLASS_GRAPH",
+ "If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen \n"
+ "will generate a graph for each documented class showing the direct and \n"
+ "indirect inheritance relations. Setting this tag to YES will force the \n"
+ "the CLASS_DIAGRAMS tag to NO.\n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "COLLABORATION_GRAPH",
+ "If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen \n"
+ "will generate a graph for each documented class showing the direct and \n"
+ "indirect implementation dependencies (inheritance, containment, and \n"
+ "class references variables) of the class with other documented classes. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "GROUP_GRAPHS",
+ "If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen \n"
+ "will generate a graph for groups, showing the direct groups dependencies\n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "UML_LOOK",
+ "If the UML_LOOK tag is set to YES doxygen will generate inheritance and \n"
+ "collaboration diagrams in a style similar to the OMG's Unified Modeling \n"
+ "Language. \n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "TEMPLATE_RELATIONS",
+ "If set to YES, the inheritance and collaboration graphs will show the \n"
+ "relations between templates and their instances. \n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "INCLUDE_GRAPH",
+ "If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT \n"
+ "tags are set to YES then doxygen will generate a graph for each documented \n"
+ "file showing the direct and indirect include dependencies of the file with \n"
+ "other documented files. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "INCLUDED_BY_GRAPH",
+ "If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and \n"
+ "HAVE_DOT tags are set to YES then doxygen will generate a graph for each \n"
+ "documented header file showing the documented files that directly or \n"
+ "indirectly include this file. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "CALL_GRAPH",
+ "If the CALL_GRAPH and HAVE_DOT options are set to YES then \n"
+ "doxygen will generate a call dependency graph for every global function \n"
+ "or class method. Note that enabling this option will significantly increase \n"
+ "the time of a run. So in most cases it will be better to enable call graphs \n"
+ "for selected functions only using the \\callgraph command.\n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "CALLER_GRAPH",
+ "If the CALLER_GRAPH and HAVE_DOT tags are set to YES then \n"
+ "doxygen will generate a caller dependency graph for every global function \n"
+ "or class method. Note that enabling this option will significantly increase \n"
+ "the time of a run. So in most cases it will be better to enable caller \n"
+ "graphs for selected functions only using the \\callergraph command.\n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "GRAPHICAL_HIERARCHY",
+ "If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n"
+ "will graphical hierarchy of all classes instead of a textual one. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "DIRECTORY_GRAPH",
+ "If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n"
+ "then doxygen will show the dependencies a directory has on other directories \n"
+ "in a graphical way. The dependency relations are determined by the #include\n"
+ "relations between the files in the directories.\n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ ce = addEnum(
+ "DOT_IMAGE_FORMAT",
+ "The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n"
+ "generated by dot. Possible values are png, jpg, or gif\n"
+ "If left blank png will be used. \n",
+ "png"
+ );
+ ce->addValue("png");
+ ce->addValue("jpg");
+ ce->addValue("gif");
+ ce->addDependency("HAVE_DOT");
+ cs = addString(
+ "DOT_PATH",
+ "The tag DOT_PATH can be used to specify the path where the dot tool can be \n"
+ "found. If left blank, it is assumed the dot tool can be found in the path. \n"
+ );
+ cs->setWidgetType(ConfigString::Dir);
+ cs->addDependency("HAVE_DOT");
+ cl = addList(
+ "DOTFILE_DIRS",
+ "The DOTFILE_DIRS tag can be used to specify one or more directories that \n"
+ "contain dot files that are included in the documentation (see the \n"
+ "\\dotfile command). \n"
+ );
+ cl->setWidgetType(ConfigList::Dir);
+ cl->addDependency("HAVE_DOT");
+ ci = addInt(
+ "DOT_GRAPH_MAX_NODES",
+ "The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n"
+ "nodes that will be shown in the graph. If the number of nodes in a graph \n"
+ "becomes larger than this value, doxygen will truncate the graph, which is \n"
+ "visualized by representing a node as a red box. Note that doxygen if the \n"
+ "number of direct children of the root node in a graph is already larger than \n"
+ "DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n"
+ "that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. \n",
+ 0,10000, 50
+ );
+ ci->addDependency("HAVE_DOT");
+ ci = addInt(
+ "MAX_DOT_GRAPH_DEPTH",
+ "The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n"
+ "graphs generated by dot. A depth value of 3 means that only nodes reachable \n"
+ "from the root by following a path via at most 3 edges will be shown. Nodes \n"
+ "that lay further from the root node will be omitted. Note that setting this \n"
+ "option to 1 or 2 may greatly reduce the computation time needed for large \n"
+ "code bases. Also note that the size of a graph can be further restricted by \n"
+ "DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n",
+ 0,1000,0
+ );
+ ci->addDependency("HAVE_DOT");
+ addObsolete("MAX_DOT_GRAPH_WIDTH");
+ addObsolete("MAX_DOT_GRAPH_HEIGHT");
+ cb = addBool(
+ "DOT_TRANSPARENT",
+ "Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n"
+ "background. This is disabled by default, because dot on Windows does not \n"
+ "seem to support this out of the box. Warning: Depending on the platform used, \n"
+ "enabling this option may lead to badly anti-aliased labels on the edges of \n"
+ "a graph (i.e. they become hard to read). \n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "DOT_MULTI_TARGETS",
+ "Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n"
+ "files in one run (i.e. multiple -o and -T options on the command line). This \n"
+ "makes dot run faster, but since only newer versions of dot (>1.8.10) \n"
+ "support this, this feature is disabled by default. \n",
+ FALSE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "GENERATE_LEGEND",
+ "If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n"
+ "generate a legend page explaining the meaning of the various boxes and \n"
+ "arrows in the dot generated graphs. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+ cb = addBool(
+ "DOT_CLEANUP",
+ "If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n"
+ "remove the intermediate dot files that are used to generate \n"
+ "the various graphs. \n",
+ TRUE
+ );
+ cb->addDependency("HAVE_DOT");
+
+ //-----------------------------------------------------------------------------------------------
+ addInfo( "Search","Configuration::additions related to the search engine ");
+ //-----------------------------------------------------------------------------------------------
+ cb = addBool(
+ "SEARCHENGINE",
+ "The SEARCHENGINE tag specifies whether or not a search engine should be \n"
+ "used. If set to NO the values of all tags below this one will be ignored. \n",
+ FALSE
+ );
+ addObsolete("CGI_NAME");
+ addObsolete("CGI_URL");
+ addObsolete("DOC_URL");
+ addObsolete("DOC_ABSPATH");
+ addObsolete("BIN_ABSPATH");
+ addObsolete("EXT_DOC_PATHS");
+
+ // The IMAGE_PATTERNS tag is now officially obsolete.
+}
+
+static QCString configFileToString(const char *name)
+{
+ if (name==0 || name[0]==0) return 0;
+ QFile f;
+
+ bool fileOpened=FALSE;
+ if (name[0]=='-' && name[1]==0) // read from stdin
+ {
+ fileOpened=f.open(IO_ReadOnly,stdin);
+ if (fileOpened)
+ {
+ const int bSize=4096;
+ QCString contents(bSize);
+ int totalSize=0;
+ int size;
+ while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize)
+ {
+ totalSize+=bSize;
+ contents.resize(totalSize+bSize);
+ }
+ totalSize+=size+2;
+ contents.resize(totalSize);
+ contents.at(totalSize-2)='\n'; // to help the scanner
+ contents.at(totalSize-1)='\0';
+ return contents;
+ }
+ }
+ else // read from file
+ {
+ QFileInfo fi(name);
+ if (!fi.exists() || !fi.isFile())
+ {
+ config_err("Error: file `%s' not found\n",name);
+ return "";
+ }
+ f.setName(name);
+ fileOpened=f.open(IO_ReadOnly);
+ if (fileOpened)
+ {
+ int fsize=f.size();
+ QCString contents(fsize+2);
+ f.readBlock(contents.data(),fsize);
+ f.close();
+ if (fsize==0 || contents[fsize-1]=='\n')
+ contents[fsize]='\0';
+ else
+ contents[fsize]='\n'; // to help the scanner
+ contents[fsize+1]='\0';
+ return contents;
+ }
+ }
+ if (!fileOpened)
+ {
+ config_err("Error: cannot open file `%s' for reading\n",name);
+ }
+ return "";
+}
+
+bool Config::parseString(const char *fn,const char *str)
+{
+ config = Config::instance();
+ inputString = str;
+ inputPosition = 0;
+ yyFileName = fn;
+ yyLineNr = 1;
+ includeStack.setAutoDelete(TRUE);
+ includeStack.clear();
+ includeDepth = 0;
+ configYYrestart( configYYin );
+ BEGIN( Start );
+ configYYlex();
+ inputString = 0;
+ return TRUE;
+}
+
+bool Config::parse(const char *fn)
+{
+ return parseString(fn,configFileToString(fn));
+}
+
+extern "C" { // some bogus code to keep the compiler happy
+ //int configYYwrap() { return 1 ; }
+}
+
diff --git a/parts/doxygen/config.h b/parts/doxygen/config.h
new file mode 100644
index 00000000..a72002c1
--- /dev/null
+++ b/parts/doxygen/config.h
@@ -0,0 +1,579 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include <qstrlist.h>
+#include <qfile.h>
+#include <qdict.h>
+#include <qptrlist.h>
+#include <qtextstream.h>
+
+/*! \brief Abstract base class for any configuration option.
+ *
+ */
+class ConfigOption
+{
+ friend class Config;
+
+ public:
+
+ /*! The type of option */
+ enum OptionType
+ {
+ O_Info, //<! A section header
+ O_List, //<! A list of items
+ O_Enum, //<! A fixed set of items
+ O_String, //<! A single item
+ O_Int, //<! An integer value
+ O_Bool, //<! A boolean value
+ O_Obsolete //<! An obsolete option
+ };
+ enum
+ {
+ /*! Maximum length of an option in the config file. Used for
+ * alignment purposes.
+ */
+ MAX_OPTION_LENGTH = 23
+ };
+ ConfigOption(OptionType t) : m_kind(t)
+ {
+ m_spaces.fill(' ',40);
+ }
+ virtual ~ConfigOption()
+ {
+ }
+
+ /*! returns the kind of option this is. */
+ OptionType kind() const { return m_kind; }
+ QCString name() const { return m_name; }
+ QCString docs() const { return m_doc; }
+
+ QCString dependsOn() const { return m_dependency; }
+ void addDependency(const char *dep) { m_dependency = dep; }
+ void setEncoding(const QCString &e) { m_encoding = e; }
+
+ protected:
+ virtual void writeTemplate(QTextStream &t,bool sl,bool upd) = 0;
+ virtual void convertStrToVal() {}
+ virtual void substEnvVars() = 0;
+ virtual void init() {}
+
+ QCString convertToComment(const QCString &s);
+ void writeBoolValue(QTextStream &t,bool v);
+ void writeIntValue(QTextStream &t,int i);
+ void writeStringValue(QTextStream &t,QCString &s);
+ void writeStringList(QTextStream &t,QStrList &l);
+
+ QCString m_spaces;
+ QCString m_name;
+ QCString m_doc;
+ QCString m_dependency;
+ QCString m_encoding;
+ OptionType m_kind;
+};
+
+/*! \brief Section marker for grouping the configuration options
+ *
+ */
+class ConfigInfo : public ConfigOption
+{
+ public:
+ ConfigInfo(const char *name,const char *doc)
+ : ConfigOption(O_Info)
+ {
+ m_name = name;
+ m_doc = doc;
+ }
+ void writeTemplate(QTextStream &t, bool sl,bool)
+ {
+ if (!sl)
+ {
+ t << "\n";
+ }
+ t << "#---------------------------------------------------------------------------\n";
+ t << "# " << m_doc << endl;
+ t << "#---------------------------------------------------------------------------\n";
+ }
+ void substEnvVars() {}
+};
+
+/*! \brief Option of the list type.
+ *
+ */
+class ConfigList : public ConfigOption
+{
+ public:
+ enum WidgetType { String, File, Dir, FileAndDir };
+ ConfigList(const char *name,const char *doc)
+ : ConfigOption(O_List)
+ {
+ m_name = name;
+ m_doc = doc;
+ m_widgetType = String;
+ }
+ void addValue(const char *v) { m_value.append(v); }
+ void setWidgetType(WidgetType w) { m_widgetType = w; }
+ WidgetType widgetType() const { return m_widgetType; }
+ QStrList *valueRef() { return &m_value; }
+ void writeTemplate(QTextStream &t,bool sl,bool)
+ {
+ if (!sl)
+ {
+ t << endl;
+ t << convertToComment(m_doc);
+ t << endl;
+ }
+ t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "= ";
+ writeStringList(t,m_value);
+ t << "\n";
+ }
+ void substEnvVars();
+ void init() { m_value.clear(); }
+ private:
+ QStrList m_value;
+ WidgetType m_widgetType;
+};
+
+/*! \brief Option of the enum type.
+ *
+ */
+class ConfigEnum : public ConfigOption
+{
+ public:
+ ConfigEnum(const char *name,const char *doc,const char *defVal)
+ : ConfigOption(O_Enum)
+ {
+ m_name = name;
+ m_doc = doc;
+ m_value = defVal;
+ m_defValue = defVal;
+ }
+ void addValue(const char *v) { m_valueRange.append(v); }
+ QStrListIterator iterator()
+ {
+ return QStrListIterator(m_valueRange);
+ }
+ QCString *valueRef() { return &m_value; }
+ void substEnvVars();
+ void writeTemplate(QTextStream &t,bool sl,bool)
+ {
+ if (!sl)
+ {
+ t << endl;
+ t << convertToComment(m_doc);
+ t << endl;
+ }
+ t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "= ";
+ writeStringValue(t,m_value);
+ t << "\n";
+ }
+ void init() { m_value = m_defValue.copy(); }
+
+ private:
+ QStrList m_valueRange;
+ QCString m_value;
+ QCString m_defValue;
+};
+
+/*! \brief Option of the string type.
+ *
+ */
+class ConfigString : public ConfigOption
+{
+ public:
+ enum WidgetType { String, File, Dir };
+ ConfigString(const char *name,const char *doc)
+ : ConfigOption(O_String)
+ {
+ m_name = name;
+ m_doc = doc;
+ m_widgetType = String;
+ }
+ ~ConfigString()
+ {
+ }
+ void setWidgetType(WidgetType w) { m_widgetType = w; }
+ WidgetType widgetType() const { return m_widgetType; }
+ void setDefaultValue(const char *v) { m_defValue = v; }
+ QCString *valueRef() { return &m_value; }
+ void writeTemplate(QTextStream &t,bool sl,bool)
+ {
+ if (!sl)
+ {
+ t << endl;
+ t << convertToComment(m_doc);
+ t << endl;
+ }
+ t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "= ";
+ writeStringValue(t,m_value);
+ t << "\n";
+ }
+ void substEnvVars();
+ void init() { m_value = m_defValue.copy(); }
+
+ private:
+ QCString m_value;
+ QCString m_defValue;
+ WidgetType m_widgetType;
+};
+
+/*! \brief Option of the integer type.
+ *
+ */
+class ConfigInt : public ConfigOption
+{
+ public:
+ ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal)
+ : ConfigOption(O_Int)
+ {
+ m_name = name;
+ m_doc = doc;
+ m_value = defVal;
+ m_defValue = defVal;
+ m_minVal = minVal;
+ m_maxVal = maxVal;
+ }
+ QCString *valueStringRef() { return &m_valueString; }
+ int *valueRef() { return &m_value; }
+ int minVal() const { return m_minVal; }
+ int maxVal() const { return m_maxVal; }
+ void convertStrToVal();
+ void substEnvVars();
+ void writeTemplate(QTextStream &t,bool sl,bool upd)
+ {
+ if (!sl)
+ {
+ t << endl;
+ t << convertToComment(m_doc);
+ t << endl;
+ }
+ t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "= ";
+ if (upd && !m_valueString.isEmpty())
+ {
+ writeStringValue(t,m_valueString);
+ }
+ else
+ {
+ writeIntValue(t,m_value);
+ }
+ t << "\n";
+ }
+ void init() { m_value = m_defValue; }
+ private:
+ int m_value;
+ int m_defValue;
+ int m_minVal;
+ int m_maxVal;
+ QCString m_valueString;
+};
+
+/*! \brief Option of the boolean type.
+ *
+ */
+class ConfigBool : public ConfigOption
+{
+ public:
+ ConfigBool(const char *name,const char *doc,bool defVal)
+ : ConfigOption(O_Bool)
+ {
+ m_name = name;
+ m_doc = doc;
+ m_value = defVal;
+ m_defValue = defVal;
+ }
+ QCString *valueStringRef() { return &m_valueString; }
+ bool *valueRef() { return &m_value; }
+ void convertStrToVal();
+ void substEnvVars();
+ void setValueString(const QCString &v) { m_valueString = v; }
+ void writeTemplate(QTextStream &t,bool sl,bool upd)
+ {
+ if (!sl)
+ {
+ t << endl;
+ t << convertToComment(m_doc);
+ t << endl;
+ }
+ t << m_name << m_spaces.left(MAX_OPTION_LENGTH-m_name.length()) << "= ";
+ if (upd && !m_valueString.isEmpty())
+ {
+ writeStringValue(t,m_valueString);
+ }
+ else
+ {
+ writeBoolValue(t,m_value);
+ }
+ t << "\n";
+ }
+ void init() { m_value = m_defValue; }
+ private:
+ bool m_value;
+ bool m_defValue;
+ QCString m_valueString;
+};
+
+/*! \brief Section marker for obsolete options
+ *
+ */
+class ConfigObsolete : public ConfigOption
+{
+ public:
+ ConfigObsolete(OptionType t) : ConfigOption(t) {}
+ void writeTemplate(QTextStream &,bool,bool) {}
+ void substEnvVars() {}
+};
+
+
+// some convenience macros
+#define Config_getString(val) Config::instance()->getString(__FILE__,__LINE__,val)
+#define Config_getInt(val) Config::instance()->getInt(__FILE__,__LINE__,val)
+#define Config_getList(val) Config::instance()->getList(__FILE__,__LINE__,val)
+#define Config_getEnum(val) Config::instance()->getEnum(__FILE__,__LINE__,val)
+#define Config_getBool(val) Config::instance()->getBool(__FILE__,__LINE__,val)
+
+/*! \brief Singleton for configuration variables.
+ *
+ * This object holds the global static variables
+ * read from a user-supplied configuration file.
+ * The static member instance() can be used to get
+ * a pointer to the one and only instance.
+ *
+ * Set all variables to their default values by
+ * calling Config::instance()->init()
+ *
+ */
+class Config
+{
+ public:
+ /////////////////////////////
+ // public API
+ /////////////////////////////
+
+ /*! Returns the one and only instance of this class */
+ static Config *instance()
+ {
+ if (m_instance==0) m_instance = new Config;
+ return m_instance;
+ }
+ /*! Delete the instance */
+ static void deleteInstance()
+ {
+ delete m_instance;
+ m_instance=0;
+ }
+
+ /*! Returns an iterator that can by used to iterate over the
+ * configuration options.
+ */
+ QPtrListIterator<ConfigOption> iterator()
+ {
+ return QPtrListIterator<ConfigOption>(*m_options);
+ }
+
+ /*!
+ * @name Getting configuration values.
+ * @{
+ */
+
+ /*! Returns the value of the string option with name \a fileName.
+ * The arguments \a num and \a name are for debugging purposes only.
+ * There is a convenience function Config_getString() for this.
+ */
+ QCString &getString(const char *fileName,int num,const char *name) const;
+
+ /*! Returns the value of the list option with name \a fileName.
+ * The arguments \a num and \a name are for debugging purposes only.
+ * There is a convenience function Config_getList() for this.
+ */
+ QStrList &getList(const char *fileName,int num,const char *name) const;
+
+ /*! Returns the value of the enum option with name \a fileName.
+ * The arguments \a num and \a name are for debugging purposes only.
+ * There is a convenience function Config_getEnum() for this.
+ */
+ QCString &getEnum(const char *fileName,int num,const char *name) const;
+
+ /*! Returns the value of the integer option with name \a fileName.
+ * The arguments \a num and \a name are for debugging purposes only.
+ * There is a convenience function Config_getInt() for this.
+ */
+ int &getInt(const char *fileName,int num,const char *name) const;
+
+ /*! Returns the value of the boolean option with name \a fileName.
+ * The arguments \a num and \a name are for debugging purposes only.
+ * There is a convenience function Config_getBool() for this.
+ */
+ bool &getBool(const char *fileName,int num,const char *name) const;
+
+ /*! Returns the ConfigOption corresponding with \a name or 0 if
+ * the option is not supported.
+ */
+ ConfigOption *get(const char *name) const
+ {
+ return m_dict->find(name);
+ }
+ /* @} */
+
+ /*!
+ * @name Adding configuration options.
+ * @{
+ */
+
+ /*! Starts a new configuration section with \a name and description \a doc.
+ * \returns An object representing the option.
+ */
+ ConfigInfo *addInfo(const char *name,const char *doc)
+ {
+ ConfigInfo *result = new ConfigInfo(name,doc);
+ m_options->append(result);
+ return result;
+ }
+
+ /*! Adds a new string option with \a name and documentation \a doc.
+ * \returns An object representing the option.
+ */
+ ConfigString *addString(const char *name,
+ const char *doc)
+ {
+ ConfigString *result = new ConfigString(name,doc);
+ m_options->append(result);
+ m_dict->insert(name,result);
+ return result;
+ }
+
+ /*! Adds a new enumeration option with \a name and documentation \a doc
+ * and initial value \a defVal.
+ * \returns An object representing the option.
+ */
+ ConfigEnum *addEnum(const char *name,
+ const char *doc,
+ const char *defVal)
+ {
+ ConfigEnum *result = new ConfigEnum(name,doc,defVal);
+ m_options->append(result);
+ m_dict->insert(name,result);
+ return result;
+ }
+
+ /*! Adds a new string option with \a name and documentation \a doc.
+ * \returns An object representing the option.
+ */
+ ConfigList *addList(const char *name,
+ const char *doc)
+ {
+ ConfigList *result = new ConfigList(name,doc);
+ m_options->append(result);
+ m_dict->insert(name,result);
+ return result;
+ }
+
+ /*! Adds a new integer option with \a name and documentation \a doc.
+ * The integer has a range between \a minVal and \a maxVal and a
+ * default value of \a defVal.
+ * \returns An object representing the option.
+ */
+ ConfigInt *addInt(const char *name,
+ const char *doc,
+ int minVal,int maxVal,int defVal)
+ {
+ ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
+ m_options->append(result);
+ m_dict->insert(name,result);
+ return result;
+ }
+
+ /*! Adds a new boolean option with \a name and documentation \a doc.
+ * The boolean has a default value of \a defVal.
+ * \returns An object representing the option.
+ */
+ ConfigBool *addBool(const char *name,
+ const char *doc,
+ bool defVal)
+ {
+ ConfigBool *result = new ConfigBool(name,doc,defVal);
+ m_options->append(result);
+ m_dict->insert(name,result);
+ return result;
+ }
+ /*! Adds an option that has become obsolete. */
+ ConfigOption *addObsolete(const char *name)
+ {
+ ConfigObsolete *option = new ConfigObsolete(ConfigOption::O_Obsolete);
+ m_dict->insert(name,option);
+ m_obsolete->append(option);
+ return option;
+ }
+ /*! @} */
+
+ /*! Writes a template configuration to stream \a t. If \a shortIndex
+ * is \c TRUE the description of each configuration option will
+ * be omitted.
+ */
+ void writeTemplate(QTextStream &t,bool shortIndex,bool updateOnly);
+
+ /////////////////////////////
+ // internal API
+ /////////////////////////////
+
+ /*! Converts the string values read from the configuration file
+ * to real values for non-string type options (like int, and bools)
+ */
+ void convertStrToVal();
+
+ /*! Replaces references to environment variable by the actual value
+ * of the environment variable.
+ */
+ void substituteEnvironmentVars();
+
+ /*! Checks if the values of the variable are correct, adjusts them
+ * if needed, and report any errors.
+ */
+ void check();
+
+ /*! Initialize config variables to their default value */
+ void init();
+
+ /*! Parse a configuration data in string \a str.
+ * \returns TRUE if successful, or FALSE if the string could not be
+ * parsed.
+ */
+ bool parseString(const char *fn,const char *str);
+
+ /*! Parse a configuration file with name \a fn.
+ * \returns TRUE if successful, FALSE if the file could not be
+ * opened or read.
+ */
+ bool parse(const char *fn);
+
+ /*! Called from the constructor, will add doxygen's default options
+ * to the configuration object
+ */
+ void create();
+
+ protected:
+
+ Config()
+ {
+ m_options = new QPtrList<ConfigOption>;
+ m_obsolete = new QPtrList<ConfigOption>;
+ m_dict = new QDict<ConfigOption>(257);
+ m_options->setAutoDelete(TRUE);
+ m_obsolete->setAutoDelete(TRUE);
+ m_initialized = FALSE;
+ create();
+ }
+ ~Config()
+ {
+ delete m_options;
+ delete m_obsolete;
+ delete m_dict;
+ }
+
+ private:
+ QPtrList<ConfigOption> *m_options;
+ QPtrList<ConfigOption> *m_obsolete;
+ QDict<ConfigOption> *m_dict;
+ static Config *m_instance;
+ bool m_initialized;
+};
+
+#endif
diff --git a/parts/doxygen/doxygenconfigwidget.cpp b/parts/doxygen/doxygenconfigwidget.cpp
new file mode 100644
index 00000000..27f39863
--- /dev/null
+++ b/parts/doxygen/doxygenconfigwidget.cpp
@@ -0,0 +1,275 @@
+/***************************************************************************
+ * Copyright (C) 2000 by Dimitri van Heesch *
+ * dimitri@stack.nl *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+***************************************************************************/
+
+#include "doxygenconfigwidget.h"
+
+#include <qscrollview.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <qtextstream.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+
+#include "config.h"
+#include "input.h"
+#include "messages.h"
+
+
+DoxygenConfigWidget::DoxygenConfigWidget(const QString &fileName, QWidget *parent, const char *name)
+ : QTabWidget(parent, name)
+{
+ m_hasChanged = false;
+ m_dependencies = new QDict< QPtrList<IInput> >(257);
+ m_dependencies->setAutoDelete(true);
+ m_inputWidgets = new QDict< IInput >;
+ m_switches = new QDict< QObject >;
+
+ QPtrListIterator<ConfigOption> options = Config::instance()->iterator();
+ QScrollView *page = 0;
+ QVBox *pagebox = 0;
+ ConfigOption *option = 0;
+ for (options.toFirst(); (option=options.current()); ++options) {
+ switch(option->kind())
+ {
+ case ConfigOption::O_Info:
+ page = new QScrollView(this, option->name());
+ page->viewport()->setBackgroundMode(PaletteBackground);
+ pagebox = new QVBox(0);
+ Q_ASSERT(pagebox!=0);
+ page->addChild(pagebox);
+ addTab(page, message(option->name()));
+ QWhatsThis::add(page, option->docs().simplifyWhiteSpace() );
+ break;
+ case ConfigOption::O_String:
+ {
+ Q_ASSERT(pagebox!=0);
+ InputString::StringMode sm = InputString::StringFree;
+ switch (((ConfigString *)option)->widgetType()) {
+ case ConfigString::String: sm = InputString::StringFree; break;
+ case ConfigString::File: sm = InputString::StringFile; break;
+ case ConfigString::Dir: sm = InputString::StringDir; break;
+ }
+ InputString *inputString = new InputString
+ ( message(option->name()), // name
+ pagebox, // widget
+ *((ConfigString *)option)->valueRef(), // variable
+ sm // type
+ );
+ QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace());
+ connect(inputString, SIGNAL(changed()), this, SLOT(changed()));
+ m_inputWidgets->insert(option->name(), inputString);
+ addDependency(m_switches, option->dependsOn(), option->name());
+ }
+ break;
+ case ConfigOption::O_Enum:
+ {
+ Q_ASSERT(pagebox!=0);
+ InputString *inputString = new InputString
+ ( message(option->name()), // name
+ pagebox, // widget
+ *((ConfigEnum *)option)->valueRef(), // variable
+ InputString::StringFixed // type
+ );
+ QStrListIterator sli=((ConfigEnum *)option)->iterator();
+ for (sli.toFirst(); sli.current(); ++sli)
+ inputString->addValue(sli.current());
+ QWhatsThis::add(inputString, option->docs().simplifyWhiteSpace());
+ connect(inputString, SIGNAL(changed()), this, SLOT(changed()));
+ m_inputWidgets->insert(option->name(),inputString);
+ addDependency(m_switches, option->dependsOn(), option->name());
+ }
+ break;
+ case ConfigOption::O_List:
+ {
+ Q_ASSERT(pagebox!=0);
+ InputStrList::ListMode lm = InputStrList::ListString;
+ switch(((ConfigList *)option)->widgetType())
+ {
+ case ConfigList::String: lm=InputStrList::ListString; break;
+ case ConfigList::File: lm=InputStrList::ListFile; break;
+ case ConfigList::Dir: lm=InputStrList::ListDir; break;
+ case ConfigList::FileAndDir: lm=InputStrList::ListFileDir; break;
+ }
+ InputStrList *inputStrList = new InputStrList
+ ( message(option->name()), // name
+ pagebox, // widget
+ *((ConfigList *)option)->valueRef(), // variable
+ lm // type
+ );
+ QWhatsThis::add(inputStrList, option->docs().simplifyWhiteSpace());
+ connect(inputStrList, SIGNAL(changed()), this, SLOT(changed()));
+ m_inputWidgets->insert(option->name(),inputStrList);
+ addDependency(m_switches, option->dependsOn(), option->name());
+ }
+ break;
+ case ConfigOption::O_Bool:
+ {
+ Q_ASSERT(pagebox!=0);
+ InputBool *inputBool = new InputBool
+ ( option->name(), // key
+ message(option->name()), // name
+ pagebox, // widget
+ *((ConfigBool *)option)->valueRef() // variable
+ );
+ QWhatsThis::add(inputBool, option->docs().simplifyWhiteSpace());
+ connect(inputBool, SIGNAL(changed()), this, SLOT(changed()));
+ m_inputWidgets->insert(option->name(), inputBool);
+ addDependency(m_switches, option->dependsOn(), option->name());
+ }
+ break;
+ case ConfigOption::O_Int:
+ {
+ Q_ASSERT(pagebox!=0);
+ InputInt *inputInt = new InputInt
+ ( message(option->name()), // name
+ pagebox, // widget
+ *((ConfigInt *)option)->valueRef(), // variable
+ ((ConfigInt *)option)->minVal(), // min value
+ ((ConfigInt *)option)->maxVal() // max value
+ );
+ QWhatsThis::add(inputInt, option->docs().simplifyWhiteSpace());
+ connect(inputInt, SIGNAL(changed()), this, SLOT(changed()));
+ m_inputWidgets->insert(option->name(), inputInt);
+ addDependency(m_switches, option->dependsOn(), option->name());
+ }
+ break;
+ case ConfigOption::O_Obsolete:
+ break;
+ }
+ }
+
+ QDictIterator<QObject> di(*m_switches);
+ for (; di.current(); ++di) {
+ QObject *obj = di.current();
+ connect(obj, SIGNAL(toggle(const QString&, bool)), this, SLOT(toggle(const QString&, bool)));
+ // UGLY HACK: assumes each item depends on a boolean without checking!
+ emit toggle(di.currentKey(), ((InputBool *)obj)->getState());
+ }
+
+ m_fileName = fileName;
+ loadFile();
+}
+
+
+DoxygenConfigWidget::~DoxygenConfigWidget()
+{
+ delete m_dependencies;
+ delete m_inputWidgets;
+ delete m_switches;
+}
+
+
+QSize DoxygenConfigWidget::sizeHint() const
+{
+ // without this the whole dialog becomes much too large
+ return QSize(QTabWidget::sizeHint().width(), 1);
+}
+
+
+void DoxygenConfigWidget::addDependency(QDict<QObject> *switches,
+ const QCString &dep, const QCString &name)
+{
+ if (dep.isEmpty())
+ return;
+
+ IInput *parent = m_inputWidgets->find(dep);
+ Q_ASSERT(parent!=0);
+ IInput *child = m_inputWidgets->find(name);
+ Q_ASSERT(child!=0);
+ if (!switches->find(dep))
+ switches->insert(dep, parent->qobject());
+ QPtrList<IInput> *list = m_dependencies->find(dep);
+ if (!list) {
+ list = new QPtrList<IInput>;
+ m_dependencies->insert(dep, list);
+ }
+ list->append(child);
+}
+
+
+void DoxygenConfigWidget::toggle(const QString &name, bool state)
+{
+ QPtrList<IInput> *inputs = m_dependencies->find(name);
+ Q_ASSERT(inputs!=0);
+ IInput *input = inputs->first();
+ while (input) {
+ input->setEnabled(state);
+ input = inputs->next();
+ }
+}
+
+
+void DoxygenConfigWidget::changed()
+{
+ m_hasChanged = true;
+}
+
+
+void DoxygenConfigWidget::init()
+{
+ QDictIterator<IInput> di(*m_inputWidgets);
+ for (; di.current(); ++di)
+ di.current()->init();
+
+ QDictIterator<QObject> dio(*m_switches);
+ for (; dio.current(); ++dio) {
+ QObject *obj = dio.current();
+ connect(obj, SIGNAL(toggle(const QString&, bool)), this, SLOT(toggle(const QString&, bool)));
+ // UGLY HACK: assumes each item depends on a boolean without checking!
+ emit toggle(dio.currentKey(), ((InputBool *)obj)->getState());
+ }
+}
+
+
+void DoxygenConfigWidget::loadFile()
+{
+ Config::instance()->init();
+
+ QFile f(m_fileName);
+ if (f.open(IO_ReadOnly)) {
+ QTextStream is(&f);
+
+ Config::instance()->parse(QFile::encodeName(m_fileName));
+ Config::instance()->convertStrToVal();
+
+ f.close();
+ }
+
+ init();
+}
+
+
+void DoxygenConfigWidget::saveFile()
+{
+ QFile f(m_fileName);
+ if (!f.open(IO_WriteOnly)) {
+ KMessageBox::information(0, i18n("Cannot write Doxyfile."));
+ } else {
+ QTextStream t(&f);
+
+ Config::instance()->writeTemplate(t, true, false);
+
+ f.close();
+ }
+}
+
+
+void DoxygenConfigWidget::accept()
+{
+ if (m_hasChanged)
+ saveFile();
+}
+
+#include "doxygenconfigwidget.moc"
diff --git a/parts/doxygen/doxygenconfigwidget.h b/parts/doxygen/doxygenconfigwidget.h
new file mode 100644
index 00000000..be75e203
--- /dev/null
+++ b/parts/doxygen/doxygenconfigwidget.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2000 by Dimitri van Heesch *
+ * dimitri@stack.nl *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DOXYGENCONFIGWIDGET_H_
+#define _DOXYGENCONFIGWIDGET_H_
+
+#include <qtabwidget.h>
+#include <qdict.h>
+#include <qptrlist.h>
+
+class IInput;
+
+
+class DoxygenConfigWidget : public QTabWidget
+{
+ Q_OBJECT
+
+public:
+ DoxygenConfigWidget( const QString &fileName, QWidget *parent=0, const char *name=0 );
+ ~DoxygenConfigWidget();
+
+public slots:
+ void accept();
+
+private slots:
+ void toggle(const QString&, bool);
+ void changed();
+
+private:
+ QSize sizeHint() const;
+ void loadFile();
+ void saveFile();
+ void init();
+ void addDependency(QDict<QObject> *switches,
+ const QCString &dep, const QCString &name);
+
+ QString m_fileName;
+ bool m_hasChanged;
+ QDict<IInput> *m_inputWidgets;
+ QDict< QPtrList<IInput> > *m_dependencies;
+ QDict<QObject> *m_switches;
+};
+
+#endif
diff --git a/parts/doxygen/doxygenpart.cpp b/parts/doxygen/doxygenpart.cpp
new file mode 100644
index 00000000..5582371b
--- /dev/null
+++ b/parts/doxygen/doxygenpart.cpp
@@ -0,0 +1,564 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2004 by Jonas Jacobi *
+ * jonas.jacobi@web.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 "doxygenpart.h"
+#include "doxygenconfigwidget.h"
+#include "configwidgetproxy.h"
+#include "config.h"
+#include "kdevappfrontend.h"
+
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+#include <kdevmakefrontend.h>
+#include <kdevcore.h>
+#include <codemodel.h>
+#include <codemodel_utils.h>
+#include <domutil.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kmessagebox.h>
+#include <kmainwindow.h>
+#include <kparts/part.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <partcontroller.h>
+#include <kdialogbase.h>
+#include <kdevplugininfo.h>
+
+#include <qvbox.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qpopupmenu.h>
+#include <qfileinfo.h>
+
+#define PROJECTOPTIONS 1
+
+typedef KDevGenericFactory<DoxygenPart> DoxygenFactory;
+static const KDevPluginInfo data("kdevdoxygen");
+K_EXPORT_COMPONENT_FACTORY( libkdevdoxygen, DoxygenFactory( data ) )
+
+DoxygenPart::DoxygenPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "DoxygenPart"), m_activeEditor(0), m_cursor(0)
+{
+ setInstance(DoxygenFactory::instance());
+ setXMLFile("kdevdoxygen.rc");
+
+ KAction *action;
+ action = new KAction( i18n("Build API Documentation"), 0,
+ this, SLOT(slotDoxygen()),
+ actionCollection(), "build_doxygen" );
+ action->setToolTip(i18n("Build API documentation"));
+ action->setWhatsThis(i18n("<b>Build API documentation</b><p>Runs doxygen on a project Doxyfile to generate API documentation. "
+ "If the search engine is enabled in Doxyfile, this also runs doxytag to create it."));
+
+ action = new KAction( i18n("Clean API Documentation"), 0,
+ this, SLOT(slotDoxClean()),
+ actionCollection(), "clean_doxygen" );
+ action->setToolTip(i18n("Clean API documentation"));
+ action->setWhatsThis(i18n("<b>Clean API documentation</b><p>Removes all generated by doxygen files."));
+
+// connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(projectConfigWidget(KDialogBase*)) );
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("Doxygen"), PROJECTOPTIONS, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+ m_actionDocumentFunction = new KAction(i18n("Document Current Function"), 0, CTRL+SHIFT+Key_S, this, SLOT(slotDocumentFunction()), actionCollection(), "edit_document_function");
+ m_actionDocumentFunction->setToolTip( i18n("Create a documentation template above a function"));
+ m_actionDocumentFunction->setWhatsThis(i18n("<b>Document Current Function</b><p>Creates a documentation template according to a function's signature above a function definition/declaration."));
+
+ m_tmpDir.setAutoDelete(true);
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part* )));
+ m_actionPreview = new KAction(i18n("Preview Doxygen Output"), 0, CTRL+ALT+Key_P, this, SLOT(slotRunPreview()), actionCollection(), "show_preview_doxygen_output");
+ m_actionPreview->setToolTip( i18n("Show a preview of the Doxygen output of this file") );
+ m_actionPreview->setWhatsThis( i18n("<b>Preview Doxygen output</b><p>Runs Doxygen over the current file and shows the created index.html.") );
+
+ //read Doxygen configuration, if none exists yet, create it with some defaults
+ adjustDoxyfile();
+ QString fileName = project()->projectDirectory() + "/Doxyfile";
+
+ QFile file(fileName);
+ if (file.open(IO_ReadOnly)) {
+ QTextStream is(&file);
+
+ Config::instance()->parse(QFile::encodeName(fileName));
+ Config::instance()->convertStrToVal();
+
+ file.close();
+ }
+}
+
+
+DoxygenPart::~DoxygenPart()
+{
+ delete _configProxy;
+}
+
+void DoxygenPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == PROJECTOPTIONS )
+ {
+ adjustDoxyfile();
+
+ DoxygenConfigWidget *w = new DoxygenConfigWidget(project()->projectDirectory() + "/Doxyfile", page );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ }
+}
+
+/** If a Doxygen configuration file doesn't exist, create one.
+ * And copy some of the project settings to it.
+ */
+void DoxygenPart::adjustDoxyfile()
+{
+ QString fileName = project()->projectDirectory() + "/Doxyfile";
+ if (QFile::exists(fileName))
+ return;
+
+ // Initialize configuration
+ Config::instance()->init();
+
+ // Do some checks and improve the configuration a bit
+ Config::instance()->check();
+
+ // set "General/PROJECT_NAME"
+ ConfigString *name = dynamic_cast<ConfigString*>(Config::instance()->get("PROJECT_NAME"));
+ if (name)
+ {
+ name->setDefaultValue(project()->projectName().latin1());
+ name->init();
+ }
+
+ // set "General/PROJECT_NUMBER"
+ ConfigString *version = dynamic_cast<ConfigString*>(Config::instance()->get("PROJECT_NUMBER"));
+ if (version)
+ {
+ version->setDefaultValue(DomUtil::readEntry(*projectDom(), "/general/version").latin1());
+ version->init();
+ }
+
+ // insert input files into "Input/INPUT"
+ ConfigList *input_files = dynamic_cast<ConfigList*>(Config::instance()->get("INPUT"));
+ if (input_files)
+ {
+ input_files->init();
+ input_files->addValue(QFile::encodeName(project()->projectDirectory()));
+ }
+
+ // insert file patterns into "Input/FILE_PATTERNS"
+ ConfigList *patterns = dynamic_cast<ConfigList*>(Config::instance()->get("FILE_PATTERNS"));
+ if (patterns)
+ {
+ // Remove Doxygen's default patterns
+// patterns->init();
+
+ // Add this ones:
+ patterns->addValue("*.C");
+ patterns->addValue("*.H");
+ patterns->addValue("*.tlh");
+ patterns->addValue("*.diff");
+ patterns->addValue("*.patch");
+ patterns->addValue("*.moc");
+ patterns->addValue("*.xpm");
+ patterns->addValue("*.dox");
+ }
+
+ // set "Input/RECURSIVE" to recurse into subdirectories
+ ConfigBool *recursive = dynamic_cast<ConfigBool*>(Config::instance()->get("RECURSIVE"));
+ if (recursive)
+ {
+ recursive->setValueString("yes");
+ }
+
+ // set "XML/GENERATE_XML" to generate XML information to be used with code hinting
+ ConfigBool *gen_xml = dynamic_cast<ConfigBool*>(Config::instance()->get("GENERATE_XML"));
+ if (gen_xml)
+ {
+ gen_xml->setValueString("yes");
+ }
+
+ // set "Enternal/GENERATE_TAGFILE" to generate tag file for documentation browser
+ ConfigString *gen_tag = dynamic_cast<ConfigString*>(Config::instance()->get("GENERATE_TAGFILE"));
+ if (gen_tag)
+ {
+ gen_tag->setDefaultValue(QString(project()->projectName()+".tag").latin1());
+ gen_tag->init();
+ }
+
+ // write doxy file
+ QFile f2(fileName);
+ if (!f2.open(IO_WriteOnly))
+ KMessageBox::information(mainWindow()->main(), i18n("Cannot write Doxyfile."));
+ else
+ {
+ QTextStream ts_file(&f2);
+
+ Config::instance()->writeTemplate(ts_file, true, true);
+
+ f2.close();
+ }
+}
+
+
+void DoxygenPart::slotDoxygen()
+{
+ if ( !partController()->saveAllFiles() ) return;
+
+ bool searchDatabase = false;
+ QString outputDirectory;
+ QString htmlDirectory;
+
+ adjustDoxyfile();
+
+ QString fileName = project()->projectDirectory() + "/Doxyfile";
+
+ Config::instance()->init();
+
+ QFile f(fileName);
+ if (f.open(IO_ReadOnly))
+ {
+ QTextStream is(&f);
+
+ Config::instance()->parse(QFile::encodeName(fileName));
+ Config::instance()->convertStrToVal();
+
+ f.close();
+ }
+
+ // search engine
+ ConfigBool *search = dynamic_cast<ConfigBool*>(Config::instance()->get("SEARCHENGINE"));
+ if (search)
+ {
+ searchDatabase = Config_getBool("SEARCHENGINE");
+
+ if (searchDatabase)
+ {
+ // get input files
+ outputDirectory = Config_getString("OUTPUT_DIRECTORY");
+ if ( outputDirectory.isEmpty() == false )
+ outputDirectory += "/";
+ htmlDirectory = Config_getString("HTML_OUTPUT");
+ if ( htmlDirectory.isEmpty() == true )
+ htmlDirectory = "html";
+ htmlDirectory.prepend(outputDirectory);
+ }
+ }
+
+ QString dir = project()->projectDirectory();
+ QString cmdline = "cd ";
+ cmdline += KShellProcess::quote( dir );
+ cmdline += " && doxygen Doxyfile";
+ if (searchDatabase)
+ {
+ // create search database in the same directory where the html docs are
+ if ( htmlDirectory.length() > 0 )
+ cmdline += " && cd " + KShellProcess::quote( htmlDirectory );
+ cmdline += " && doxytag -s search.idx ";
+ }
+
+ kdDebug(9026) << "Doxygen command line: " << cmdline << endl;
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, cmdline);
+}
+
+
+void DoxygenPart::slotDoxClean()
+{
+ bool could_be_dirty = false;
+
+ QString outputDirectory = Config_getString("OUTPUT_DIRECTORY");
+ if ( outputDirectory.isEmpty() )
+ outputDirectory = project()->projectDirectory();
+ if ( outputDirectory.right(1) != "/" )
+ outputDirectory += "/";
+ QString cmdline = "cd " + KShellProcess::quote( outputDirectory );
+
+ if ( Config_getBool("GENERATE_HTML") ) {
+ QString htmlDirectory = Config_getString("HTML_OUTPUT");
+ if ( htmlDirectory.isEmpty() )
+ htmlDirectory = "html";
+ if ( htmlDirectory.right(1) != "/" )
+ htmlDirectory += "/";
+ cmdline += " && rm -f " + KShellProcess::quote( htmlDirectory ) + "*";
+ could_be_dirty= true;
+ }
+
+ if ( Config_getBool("GENERATE_LATEX") ) {
+ QString latexDirectory = Config_getString("LATEX_OUTPUT");
+ if ( latexDirectory.isEmpty() )
+ latexDirectory = "latex";
+ if ( latexDirectory.right(1) != "/" )
+ latexDirectory += "/";
+ cmdline += " && rm -f " + KShellProcess::quote( latexDirectory ) + "*";
+ could_be_dirty= true;
+ }
+
+ if ( Config_getBool("GENERATE_RTF") ) {
+ QString rtfDirectory = Config_getString("RTF_OUTPUT");
+ if ( rtfDirectory.isEmpty() )
+ rtfDirectory = "rtf";
+ if ( rtfDirectory.right(1) != "/" )
+ rtfDirectory += "/";
+ cmdline += " && rm -f " + KShellProcess::quote( rtfDirectory ) + "*";
+ could_be_dirty= true;
+ }
+
+ if ( Config_getBool("GENERATE_MAN") ) {
+ QString manDirectory = Config_getString("MAN_OUTPUT");
+ if ( manDirectory.isEmpty() )
+ manDirectory = "man";
+ if ( manDirectory.right(1) != "/" )
+ manDirectory += "/";
+ cmdline += " && rm -f " + KShellProcess::quote( manDirectory ) + "*";
+ could_be_dirty= true;
+ }
+
+ if ( Config_getBool("GENERATE_XML") ) {
+ QString xmlDirectory = Config_getString("XML_OUTPUT");
+ if ( xmlDirectory.isEmpty() )
+ xmlDirectory = "xml";
+ if ( xmlDirectory.right(1) != "/" )
+ xmlDirectory += "/";
+ cmdline += " && rm -f " + KShellProcess::quote( xmlDirectory ) + "*";
+ could_be_dirty= true;
+ }
+
+ if (could_be_dirty) {
+ kdDebug(9026) << "Cleaning Doxygen generated API documentation using: " << cmdline << endl;
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(KShellProcess::quote(project()->projectDirectory()), cmdline);
+ }
+ else
+ kdDebug(9026) << "No Doxygen generated API documentation exists. There's nothing to clean!" << endl;
+
+}
+
+void DoxygenPart::slotPreviewProcessExited( )
+{
+ KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend");
+ if ( appFrontend != 0 )
+ disconnect(appFrontend, 0, this, 0);
+ partController()->showDocument(KURL(m_tmpDir.name()+"html/index.html"));
+}
+
+void DoxygenPart::slotRunPreview( )
+{
+ if (m_file.isNull())
+ return;
+
+ KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend");
+ if ( appFrontend == 0 )
+ return;
+
+ if ( appFrontend->isRunning() ) {
+ KMessageBox::information( mainWindow()->main(),
+ i18n("Another process is still running. Please wait until it's finished."));
+ return;
+ }
+
+ m_tmpDir.unlink();
+ m_tmpDir = KTempDir();
+ m_tmpDir.setAutoDelete(true);
+
+ Config* config = Config::instance();
+
+ ConfigString* poDir = dynamic_cast<ConfigString*>(config->get("OUTPUT_DIRECTORY"));
+ ConfigList* pInput = dynamic_cast<ConfigList*>(config->get("INPUT"));
+ ConfigString* pHeader = dynamic_cast<ConfigString*>(config->get("HTML_HEADER"));
+ ConfigString* pFooter = dynamic_cast<ConfigString*>(config->get("HTML_FOOTER"));
+ ConfigString* pStyle = dynamic_cast<ConfigString*>(config->get("HTML_STYLESHEET"));
+
+ //store config values to restore them later | override config values to get only the current file processed
+ QCString dirVal;
+ if (poDir != 0) {
+ dirVal = *poDir->valueRef();
+ *poDir->valueRef() = m_tmpDir.name().ascii();
+ }
+
+ QStrList inputVal;
+ if (pInput != 0) {
+ inputVal = *pInput->valueRef();
+ QStrList xl;
+ xl.append(m_file.ascii());
+ *pInput->valueRef() = xl;
+ } else {
+ config->addList("INPUT", "# The INPUT tag can be used to specify the files and/or directories that contain\n"
+ "# documented source files. You may enter file names like \"myfile.cpp\" or\n"
+ "# directories like \"/usr/src/myproject\". Separate the files or directories\n"
+ "# with spaces.");
+ pInput = dynamic_cast<ConfigList*>(config->get("INPUT")); //pinput now has to be != 0
+ QStrList xl;
+ xl.append(m_file.ascii());
+ *pInput->valueRef() = xl;
+ }
+
+ QCString header;
+ QCString footer;
+ QCString stylesheet;
+ //if header/footer/stylesheets are set, make sure they get found in the doxygen run
+ QString projectDir = project()->projectDirectory();
+ if (pHeader != 0 && !pHeader->valueRef()->isEmpty()){
+ header = *pHeader->valueRef();
+ QFileInfo info (header);
+ if (info.isRelative())
+ *pHeader->valueRef() = QString(projectDir + "/" + QString(header)).ascii();
+ else
+ header = 0;
+ }
+
+ if (pFooter != 0 && !pFooter->valueRef()->isEmpty()){
+ footer = *pFooter->valueRef();
+ QFileInfo info (footer);
+ if (info.isRelative())
+ *pFooter->valueRef() = QString(projectDir + "/" + QString(footer)).ascii();
+ else
+ footer = 0;
+ }
+
+ if (pStyle != 0 && !pStyle->valueRef()->isEmpty()){
+ stylesheet = *pStyle->valueRef();
+ QFileInfo info (stylesheet);
+ if (info.isRelative())
+ *pStyle->valueRef() = QString(projectDir +"/" + QString(stylesheet)).ascii();
+ else
+ stylesheet = 0;
+ }
+
+ QFile file(m_tmpDir.name() +"PreviewDoxyfile"); //file gets deleted automatically 'cause of tempdir
+ if (!file.open(IO_WriteOnly)){
+ //restore config values
+ if (pInput != 0)
+ *pInput->valueRef() = inputVal;
+
+ if (poDir != 0)
+ *poDir->valueRef() = dirVal;
+
+ KMessageBox::error(mainWindow()->main(), i18n("Cannot create temporary file '%1'").arg(file.name()));
+ return;
+ }
+
+ QTextStream ts_file(&file);
+
+ config->writeTemplate(ts_file, false, false);
+ file.close();
+
+ if (inputVal.count() == 0) //pInput is always != 0
+ *pInput->valueRef() = QStrList();
+ else
+ *pInput->valueRef() = inputVal;
+
+ if (poDir != 0)
+ *poDir->valueRef() = dirVal;
+
+ if (pHeader != 0 && !header.isNull())
+ *pHeader->valueRef() = header;
+
+ if (pFooter != 0 && !footer.isNull())
+ *pFooter->valueRef() = footer;
+
+ if (pStyle != 0 && !stylesheet.isNull())
+ *pStyle->valueRef() = stylesheet;
+
+ connect(appFrontend, SIGNAL(processExited()), this, SLOT(slotPreviewProcessExited()));
+ appFrontend->startAppCommand("", "doxygen \"" + file.name() + "\"", false);
+}
+
+void DoxygenPart::slotActivePartChanged( KParts::Part * part )
+{
+ // -> idea from cppsupportpart.cpp
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>(part);
+ if (doc != 0)
+ m_file = doc->url().path();
+ else
+ m_file = QString::null;
+ // <-
+ m_activeEditor = dynamic_cast<KTextEditor::EditInterface*>(part);
+ m_cursor = part ? dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget()) : 0;
+}
+
+void DoxygenPart::slotDocumentFunction(){
+ if (m_activeEditor != 0 && m_cursor != 0){
+ if ( codeModel()->hasFile( m_file ) ) {
+ unsigned int cursorLine, cursorCol;
+ m_cursor->cursorPosition(&cursorLine, &cursorCol);
+
+ FunctionDom function = 0;
+ FunctionDefinitionDom functionDef = 0;
+
+ FileDom file = codeModel()->fileByName( m_file );
+
+ FunctionList functionList = CodeModelUtils::allFunctions(file);
+ FunctionList::ConstIterator theend = functionList.end();
+ for( FunctionList::ConstIterator ci = functionList.begin(); ci!= theend; ++ci ){
+ int sline, scol;
+ int eline, ecol;
+ (*ci)->getStartPosition(&sline, &scol);
+ (*ci)->getEndPosition(&eline, &ecol);
+ if(cursorLine >= sline && cursorLine <= eline )
+ function = *ci;
+ }
+ if (function == 0){
+ FunctionDefinitionList functionDefList = CodeModelUtils::allFunctionDefinitionsDetailed(file).functionList;
+ FunctionDefinitionList::ConstIterator theend = functionDefList.end();
+ for( FunctionDefinitionList::ConstIterator ci = functionDefList.begin(); ci!= theend; ++ci ){
+ int sline, scol;
+ int eline, ecol;
+ (*ci)->getStartPosition(&sline, &scol);
+ (*ci)->getEndPosition(&eline, &ecol);
+ if(cursorLine >= sline && cursorLine <= eline)
+ functionDef = *ci;
+ }
+ }
+
+ int line, col;
+ if (function != 0)
+ function->getStartPosition(&line, &col);
+ else if (functionDef != 0)
+ functionDef->getStartPosition(&line, &col);
+ else
+ return;
+ QString funcLine = m_activeEditor->textLine(line);
+ unsigned int pos = 0;
+ unsigned int length = funcLine.length();
+ while (pos < length && funcLine.at(pos).isSpace())
+ ++pos;
+ //store chars used for indenting the line and put it in front of every created doc line
+ QString indentChars = funcLine.left(pos);
+ QString text = indentChars + "/**\n" + indentChars + " * \n";
+ ArgumentList args;
+ QString resultType;
+ if (function != 0) {
+ args = function->argumentList();
+ resultType = function->resultType();
+ } else {
+ args = functionDef->argumentList();
+ resultType = functionDef->resultType();
+ }
+ for( ArgumentList::ConstIterator ci = args.begin(); ci != args.end(); ++ci)
+ text += indentChars + " * @param " + (*ci)->name() +" \n";
+ if (resultType != "void" && !resultType.isEmpty())
+ text += indentChars + " * @return \n";
+ text += indentChars + " */\n";
+ m_activeEditor->insertText(line, 0, text);
+ m_cursor->setCursorPosition( line + 1, indentChars.length() + 3);
+ }
+ }
+}
+
+
+#include "doxygenpart.moc"
diff --git a/parts/doxygen/doxygenpart.h b/parts/doxygen/doxygenpart.h
new file mode 100644
index 00000000..49fb87e8
--- /dev/null
+++ b/parts/doxygen/doxygenpart.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2004 by Jonas Jacobi *
+ * jonas.jacobi@web.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 _DOXYGENPART_H_
+#define _DOXYGENPART_H_
+
+#include <qguardedptr.h>
+#include <kdialogbase.h>
+#include <kprocess.h>
+#include <ktempdir.h>
+#include <qstring.h>
+
+#include "kdevplugin.h"
+
+class DoxygenDialog;
+class QPopupMenu;
+class Context;
+class KAction;
+class KDialogBase;
+class ConfigWidgetProxy;
+
+namespace KParts{
+ class Part;
+}
+namespace KTextEditor{
+ class ViewCursorInterface;
+ class EditInterface;
+}
+
+class DoxygenPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ DoxygenPart( QObject *parent, const char *name, const QStringList & );
+ ~DoxygenPart();
+
+private slots:
+ /**
+ * Configuration dialog under "Project Options..." that alows
+ * to specify doxygen configuration options and store them to
+ * a configuration file. The file name is "Doxyfile" and it's stored
+ * in the project root.
+ */
+// void projectConfigWidget(KDialogBase *dlg);
+ void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
+
+ /** run doxygen to generate API documentation */
+ void slotDoxygen();
+
+ /** clean the html API docs (delete the generated html files) */
+ void slotDoxClean();
+
+ /**
+ * Gets called, when the Doxygen process for previewing is finished
+ * and shows its output then.
+ */
+ void slotPreviewProcessExited();
+
+ /**
+ * If the current part is KTextEditor::Document, run Doxygen over it.
+ * When the process exited slotPreviewProcessExited gets called.
+ */
+ void slotRunPreview();
+
+ /**
+ * Gets called when the currently active part changed.
+ * When the new part is a KTextEditor::Document the filepath gets
+ * internally stored and gets processed if slotRunPreview() is called.
+ * @see KTextEditor::Document
+ */
+ void slotActivePartChanged(KParts::Part*);
+
+ /**
+ * Inserts a documentation template above a function declaration/definition.
+ */
+ void slotDocumentFunction();
+
+
+private:
+
+ /**
+ * If a Doxygen configuration file doesn't exist, create one.
+ * And copy some of the project settings to it.
+ */
+ void adjustDoxyfile();
+
+ DoxygenDialog *m_dialog;
+ ConfigWidgetProxy * _configProxy;
+
+ //needed for doxygen preview
+ QString m_file;
+ KTempDir m_tmpDir;
+ KAction* m_action;
+
+ //needed for documentFunction
+ KAction* m_actionDocumentFunction;
+ KAction* m_actionPreview;
+ KTextEditor::EditInterface* m_activeEditor;
+ KTextEditor::ViewCursorInterface* m_cursor;
+};
+
+#endif
diff --git a/parts/doxygen/input.cpp b/parts/doxygen/input.cpp
new file mode 100644
index 00000000..d5745bad
--- /dev/null
+++ b/parts/doxygen/input.cpp
@@ -0,0 +1,499 @@
+/***************************************************************************
+ * Copyright (C) 1997-2000 by Dimitri van Heesch *
+ * dimitri@stack.nl *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qcombobox.h>
+#include <klineedit.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qtooltip.h>
+#include <klocale.h>
+#include <kfiledialog.h>
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include "input.h"
+
+
+static const char * const add_xpm_data[] =
+{
+ "16 16 5 1",
+ ". c None",
+ "* c #0328f9",
+ "# c #354396",
+ "a c #353740",
+ "c c #999999",
+ "................",
+ "......###.......",
+ "......#*ac......",
+ "......#*ac......",
+ "......#*ac......",
+ "......#*ac......",
+ ".######*a#####..",
+ ".#***********ac.",
+ ".#aaaaa*aaaaaac.",
+ "..cccc#*acccccc.",
+ "......#*ac......",
+ "......#*ac......",
+ "......#*ac......",
+ "......#aac......",
+ ".......ccc......",
+ "................"
+};
+const char **add_xpm = (const char **)add_xpm_data;
+
+static const char * const del_xpm_data[] =
+{
+ "16 16 5 1",
+ ". c None",
+ "* c #0328f9",
+ "# c #354396",
+ "a c #353740",
+ "c c #999999",
+ "................",
+ "................",
+ "................",
+ "................",
+ "................",
+ "................",
+ ".#############..",
+ ".#***********ac.",
+ ".aaaaaaaaaaaaac.",
+ "..ccccccccccccc.",
+ "................",
+ "................",
+ "................",
+ "................",
+ "................",
+ "................"
+};
+const char **del_xpm = (const char **)del_xpm_data;
+
+static const char* const update_xpm_data[] =
+{
+ "16 16 5 1",
+ /* colors */
+ ". c #0328f9",
+ "# c #354396",
+ "a c #353740",
+ "b c None",
+ "c c #999999",
+ /* pixels */
+ "bbbbbbbbbbbbbbbb",
+ "bbbbbbbb#####acb",
+ "bbbbbbbb#....abb",
+ "bbc##cbb#...acbb",
+ "bb#..abb#....abb",
+ "bc#..abb#.a..acb",
+ "b#..acbbaac#..ab",
+ "b#..abbbcbb#..ab",
+ "b#..abbbbbb#..ab",
+ "b#..acbbbbc#..ab",
+ "bc#..#cbbc#..acb",
+ "bb#...####...acb",
+ "bbca........acbb",
+ "bbbbaa....aaccbb",
+ "bbbbbcaaaaccbbbb",
+ "bbbbbbbbbbbbbbbb"
+};
+const char **update_xpm = (const char **)update_xpm_data;
+
+
+InputBool::InputBool(const QCString &k, const QString &text, QWidget * parent, bool &flag)
+ : QWidget(parent), state(flag), key(k)
+{
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ cb = new QCheckBox(text,this);
+
+ init();
+
+ layout->addWidget(cb);
+ layout->addStretch(1);
+
+ connect( cb, SIGNAL(toggled(bool)), this, SLOT(valueChanged(bool)));
+}
+
+
+InputBool::~InputBool()
+{}
+
+
+void InputBool::init()
+{
+ cb->setChecked(state);
+}
+
+
+void InputBool::valueChanged(bool s)
+{
+ if (s != state) {
+ emit changed();
+ emit toggle(key, s);
+ }
+ state = s;
+}
+
+
+void InputBool::setEnabled(bool b)
+{
+ cb->setEnabled(b);
+}
+
+
+InputInt::InputInt(const QString &label, QWidget *parent, int &val, int minVal, int maxVal)
+ : QWidget(parent), m_val(val), m_minVal(minVal), m_maxVal(maxVal)
+{
+ QHBoxLayout *layout = new QHBoxLayout(this, 5);
+
+ sp = new QSpinBox(minVal, maxVal, 1, this);
+ lab = new QLabel(sp, label+":", this);
+
+ init();
+
+ layout->addWidget(lab);
+ layout->addWidget(sp);
+ layout->addStretch(1);
+
+ connect(sp, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)));
+}
+
+
+InputInt::~InputInt()
+{}
+
+
+void InputInt::init()
+{
+ m_val = QMAX(m_minVal, m_val);
+ m_val = QMIN(m_maxVal, m_val);
+ sp->setValue(m_val);
+}
+
+
+void InputInt::valueChanged(int val)
+{
+ if (val != m_val)
+ emit changed();
+ m_val = val;
+}
+
+
+void InputInt::setEnabled(bool state)
+{
+ lab->setEnabled(state);
+ sp->setEnabled(state);
+}
+
+
+InputString::InputString(const QString & label,
+ QWidget *parent, QCString &s, StringMode m)
+ : QWidget(parent), str(s), sm(m), m_values(0), m_index(0)
+{
+ le = 0; br = 0; com = 0;
+
+ if (m == StringFixed) {
+ QHBoxLayout *layout = new QHBoxLayout(this, 5);
+ com = new QComboBox(this);
+ lab = new QLabel(com,label+":", this);
+ layout->addWidget(lab);
+ layout->addWidget(com);
+ layout->addStretch(1);
+ } else {
+ QGridLayout *layout = new QGridLayout(this, 1, m==StringFree? 1 : 3, 5);
+ le = new KLineEdit(this);
+ lab = new QLabel(le,label+":", this);
+ layout->addWidget(lab, 0, 0);
+ le->setText(s);
+ layout->addWidget(le, 0, 1);
+
+ if (m == StringFile || m == StringDir) {
+ br = new QPushButton(this);
+ br->setPixmap(SmallIcon(m==StringFile? "document" : "folder"));
+ QToolTip::add(br, m==StringFile? i18n("Browse to a file") : i18n("Browse to a folder"));
+ layout->addWidget(br, 0, 2);
+ }
+ }
+
+ if (le)
+ connect( le, SIGNAL(textChanged(const QString&)),
+ this, SLOT(textChanged(const QString&)) );
+ if (br)
+ connect( br, SIGNAL(clicked()), this, SLOT(browse()) );
+ if (com)
+ connect( com, SIGNAL(activated(const QString &)),
+ this, SLOT(textChanged(const QString &)) );
+}
+
+InputString::~InputString()
+{
+ if (m_values)
+ delete m_values;
+}
+
+
+void InputString::init()
+{
+ if (sm == StringFixed) {
+ int *itemIndex = m_values->find(str);
+ if (itemIndex)
+ com->setCurrentItem(*itemIndex);
+ else
+ com->setCurrentItem(0);
+ } else
+ le->setText(str);
+}
+
+
+void InputString::addValue(const char *s)
+{
+ if (sm == StringFixed) {
+ if (!m_values)
+ m_values = new QDict<int>;
+ m_values->setAutoDelete(true);
+ m_values->insert(s, new int(m_index++));
+ com->insertItem(s);
+ }
+}
+
+
+void InputString::clear()
+{
+ le->setText("");
+ if (!str.isEmpty()) {
+ emit changed();
+ str = "";
+ }
+}
+
+
+void InputString::textChanged(const QString &s)
+{
+ if (str!=s.latin1()) {
+ str = s.latin1();
+ emit changed();
+ }
+}
+
+void InputString::setEnabled(bool state)
+{
+ lab->setEnabled(state);
+ if (le)
+ le->setEnabled(state);
+ if (br)
+ br->setEnabled(state);
+ if (com)
+ com->setEnabled(state);
+}
+
+
+void InputString::browse()
+{
+ if (sm == StringFile) {
+ QString fileName = KFileDialog::getOpenFileName();
+
+ if (!fileName.isNull()) {
+ le->setText(fileName);
+ if (str != le->text().latin1()) {
+ str = le->text().latin1();
+ emit changed();
+ }
+ }
+ } else { // sm==StringDir
+ QString dirName = KFileDialog::getExistingDirectory();
+
+ if (!dirName.isNull()) {
+ le->setText( dirName );
+ if (str != le->text().latin1()) {
+ str = le->text().latin1();
+ emit changed();
+ }
+ }
+ }
+}
+
+
+InputStrList::InputStrList(const QString & label,
+ QWidget *parent, QStrList &sl, ListMode lm)
+ : QWidget(parent), strList(sl)
+{
+ QGridLayout *layout = new QGridLayout(this, 2, 2, 5);
+
+ QWidget *dw = new QWidget(this); /* dummy widget used for layouting */
+ QHBoxLayout *boxlayout = new QHBoxLayout(dw, 0, 5);
+ le = new KLineEdit(dw);
+ lab = new QLabel(le,label+":", this );
+ layout->addWidget(lab, 0, 0);
+ boxlayout->addWidget(le, 1);
+
+ add = new QPushButton(dw);
+ add->setPixmap(QPixmap( add_xpm ));
+ QToolTip::add(add, i18n("Add item"));
+ boxlayout->addWidget(add);
+
+ del = new QPushButton(dw);
+ del->setPixmap(QPixmap( del_xpm ));
+ QToolTip::add(del, i18n("Delete selected item"));
+ boxlayout->addWidget(del);
+
+ upd = new QPushButton(dw);
+ upd->setPixmap(QPixmap( update_xpm ));
+ QToolTip::add(upd, i18n("Update selected item"));
+ boxlayout->addWidget(upd);
+
+ lb = new QListBox(this);
+ lb->setMinimumSize(400, 100);
+ init();
+ lb->setVScrollBarMode(QScrollView::Auto);
+ lb->setHScrollBarMode(QScrollView::Auto);
+
+ brFile = 0;
+ brDir = 0;
+ if (lm != ListString) {
+ if (lm & ListFile) {
+ brFile = new QPushButton(dw);
+ brFile->setPixmap(SmallIcon("document"));
+ QToolTip::add(brFile, i18n("Browse to a file"));
+ boxlayout->addWidget(brFile);
+ }
+ if (lm & ListDir) {
+ brDir = new QPushButton(dw);
+ brDir->setPixmap(SmallIcon("folder"));
+ QToolTip::add(brDir, i18n("Browse to a folder"));
+ boxlayout->addWidget(brDir);
+ }
+ }
+ layout->addWidget(dw, 0, 1);
+ layout->addWidget(lb, 1, 1);
+
+ connect( le, SIGNAL(returnPressed()),
+ this, SLOT(addString()) );
+ connect( add, SIGNAL(clicked()),
+ this, SLOT(addString()) );
+ connect( del, SIGNAL(clicked()),
+ this, SLOT(delString()) );
+ connect( upd, SIGNAL(clicked()),
+ this, SLOT(updateString()) );
+ if (brFile)
+ connect( brFile, SIGNAL(clicked()),
+ this, SLOT(browseFiles()) );
+ if (brDir)
+ connect( brDir, SIGNAL(clicked()),
+ this, SLOT(browseDir()) );
+ connect( lb, SIGNAL(selected(const QString &)),
+ this, SLOT(selectText(const QString &)) );
+
+ strList = sl;
+}
+
+
+InputStrList::~InputStrList()
+{}
+
+
+void InputStrList::init()
+{
+ le->clear();
+ lb->clear();
+ char *s = strList.first();
+ while (s) {
+ lb->insertItem(s);
+ s = strList.next();
+ }
+}
+
+
+void InputStrList::addString()
+{
+ if (!le->text().isEmpty()) {
+ lb->insertItem(le->text());
+ strList.append(le->text().latin1());
+ emit changed();
+ le->clear();
+ }
+}
+
+
+void InputStrList::delString()
+{
+ if (lb->currentItem() != -1) {
+ int itemIndex = lb->currentItem();
+ lb->removeItem(itemIndex);
+ strList.remove(itemIndex);
+ emit changed();
+ }
+}
+
+
+void InputStrList::updateString()
+{
+ if (lb->currentItem() != -1 && !le->text().isEmpty()) {
+ lb->changeItem(le->text(),lb->currentItem());
+ strList.insert(lb->currentItem(),le->text().latin1());
+ strList.remove(lb->currentItem()+1);
+ emit changed();
+ }
+}
+
+
+void InputStrList::selectText(const QString &s)
+{
+ le->setText(s);
+}
+
+
+void InputStrList::setEnabled(bool state)
+{
+ lab->setEnabled(state);
+ le->setEnabled(state);
+ add->setEnabled(state);
+ del->setEnabled(state);
+ upd->setEnabled(state);
+ lb->setEnabled(state);
+ if (brFile)
+ brFile->setEnabled(state);
+ if (brDir)
+ brDir->setEnabled(state);
+}
+
+
+void InputStrList::browseFiles()
+{
+ QStringList fileNames = KFileDialog::getOpenFileNames();
+
+ if (!fileNames.isEmpty()) {
+ QStringList::Iterator it;
+ for (it = fileNames.begin(); it != fileNames.end(); ++it) {
+ lb->insertItem(*it);
+ strList.append(( *it ).latin1());
+ emit changed();
+ }
+ le->setText(*fileNames.begin());
+ }
+}
+
+
+void InputStrList::browseDir()
+{
+ QString dirName = KFileDialog::getExistingDirectory();
+
+ if (!dirName.isNull()) {
+ lb->insertItem(dirName);
+ strList.append(dirName.latin1());
+ emit changed();
+ le->setText(dirName);
+ }
+}
+
+
+#include "input.moc"
diff --git a/parts/doxygen/input.h b/parts/doxygen/input.h
new file mode 100644
index 00000000..15c3a263
--- /dev/null
+++ b/parts/doxygen/input.h
@@ -0,0 +1,173 @@
+/***************************************************************************
+ * Copyright (C) 1997-2000 by Dimitri van Heesch *
+ * dimitri@stack.nl *
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _INPUT_H
+#define _INPUT_H
+
+#include <qcheckbox.h>
+#include <qdict.h>
+
+class QComboBox;
+class QLabel;
+class KLineEdit;
+class QListBox;
+class QPushButton;
+class QSpinBox;
+
+class IInput
+{
+ public:
+ virtual void init() = 0;
+ virtual void setEnabled(bool) = 0;
+ virtual QObject *qobject() = 0;
+};
+
+
+class InputBool : public QWidget, public IInput
+{
+ Q_OBJECT
+
+public:
+ InputBool(const QCString &key, const QString &text, QWidget *parent, bool &flag);
+ ~InputBool();
+
+ void init();
+ virtual void setEnabled(bool b);
+ virtual QObject *qobject() { return this; }
+ virtual bool getState() const { return state; }
+
+signals:
+ void changed();
+ void toggle(const QString &, bool);
+
+private slots:
+ void valueChanged(bool);
+
+private:
+ bool &state;
+ QCString key;
+ QCheckBox *cb;
+};
+
+
+class InputInt : public QWidget, public IInput
+{
+ Q_OBJECT
+
+public:
+ InputInt(const QString &text, QWidget *parent,
+ int &val, int minVal, int maxVal);
+ ~InputInt();
+
+ void init();
+ virtual void setEnabled(bool);
+ QObject *qobject() { return this; }
+
+signals:
+ void changed();
+
+private slots:
+ void valueChanged(int val);
+
+private:
+ QLabel *lab;
+ QSpinBox *sp;
+ int &m_val;
+ int m_minVal;
+ int m_maxVal;
+};
+
+
+class InputString : public QWidget, public IInput
+{
+ Q_OBJECT
+
+public:
+ enum StringMode { StringFree=0,
+ StringFile=1,
+ StringDir=2,
+ StringFixed=3
+ };
+
+ InputString(const QString &text, QWidget *parent,
+ QCString &s, StringMode m=StringFree);
+ ~InputString();
+
+ void init();
+ void addValue(const char *s);
+ void setEnabled(bool);
+ QObject *qobject() { return this; }
+
+signals:
+ void changed();
+
+private slots:
+ void textChanged(const QString&);
+ void browse();
+ void clear();
+
+private:
+ QLabel *lab;
+ KLineEdit *le;
+ QPushButton *br;
+ QComboBox *com;
+ QCString &str;
+ StringMode sm;
+ QDict<int> *m_values;
+ int m_index;
+};
+
+
+class InputStrList : public QWidget, public IInput
+{
+ Q_OBJECT
+
+public:
+ enum ListMode { ListString=0,
+ ListFile=1,
+ ListDir=2,
+ ListFileDir=ListFile|ListDir
+ };
+
+ InputStrList(const QString &text, QWidget *parent,
+ QStrList &sl, ListMode v=ListString);
+ ~InputStrList();
+
+ void init();
+ void setEnabled(bool);
+ QObject *qobject() { return this; }
+
+signals:
+ void changed();
+
+private slots:
+ void addString();
+ void delString();
+ void updateString();
+ void selectText(const QString &s);
+ void browseFiles();
+ void browseDir();
+
+private:
+ QLabel *lab;
+ KLineEdit *le;
+ QPushButton *add;
+ QPushButton *del;
+ QPushButton *upd;
+ QPushButton *brFile;
+ QPushButton *brDir;
+ QListBox *lb;
+ QStrList &strList;
+};
+
+#endif
diff --git a/parts/doxygen/kdevdoxygen.desktop b/parts/doxygen/kdevdoxygen.desktop
new file mode 100644
index 00000000..d8c05362
--- /dev/null
+++ b/parts/doxygen/kdevdoxygen.desktop
@@ -0,0 +1,81 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=The doxygen plugin provides a way to specify and control generation of documentation for a project, based on source code content. You need to have doxygen installed to be able to use this. For more info goto http://www.doxygen.org
+Comment[ca]=El connector doxygen proporciona una forma d'especificar i controlar la generació de documentació d'un projecte, basant-se en el contingut del codi font. Necessitareu tenir instal·lat doxygen. Per a més informació visiteu http://www.doxygen.org
+Comment[da]=Doxygen-plugin sørger for en måde at angive og kontrollere generering af dokumentation for et projekt, baseret på kildekodens indhold. Du skal have doxygen installeret for at kunne bruge dette. For mere info gå til http://www.doxygen.org
+Comment[de]=Diese Komponente bietet Unterstützung bei der Erstellung von Projektdokumentation, die auf den Quelltexten basiert. Um diese Funktionalität zu nutzen, muss Doxygen installiert sein. Weitere Informationen finden sie auf http://www.doxygen.org.
+Comment[el]=Το πρόσθετο doxygen προσφέρει μια μέθοδο ορισμού και ελέγχου της δημιουργίας της τεκμηρίωσης για ένα έργο, βασισμένο στον πηγαίο κώδικα. Πρέπει να έχετε το doxygen εγκατεστημένο για να το χρησιμοποιήσετε. Για περισσότερες πληροφορίες πηγαίνετε στο http://www.doxygen.org
+Comment[es]=El complemento doxygen proporciona una forma de especificar y controlar la generación de documentación de un proyecto, basándose en el contenido del código fuente. Necesita tener instalado doxygen. Para más información visite http://www.doxygen.org
+Comment[et]=Doxygeni plugin võimaldab määrata ja kontrollida projekti dokumentatsiooni loomist vastavalt lähtekoodi sisule. Selleks peab olema paigaldatud ka programm 'doxygen'. Vaata täpsemalt http://www.doxygen.org
+Comment[eu]=Doxygen plugin-ak, iturburu kodean oinarrituta, proiektu baterako dokumentazio sorkuntza eta kontrola zehazteko aukera ematen dizu. Doxygen instalatuta eduki behar duzu hau erabiltzeko. Informazio gehiagorako joan hona:http://www.doxygen.org
+Comment[fa]=وصلۀ doxygen راهی برای مشخص کردن و کنترل تولید مستندات پروژه بر اساس متن کد منبع فراهم می‌کند. شما برای توانایی در استفاده از این، نیاز به نصب doxygen دارید. برای اطلاعات بیشتر به http://www.doxygen.org بروید
+Comment[fr]=Le module externe « doxygen » fournit un moyen de spécifier et de contrôler la génération de la documentation pour un projet, en se basant sur le contenu du code source. Pour pouvoir l'utiliser, vous devez avoir installé « doxygen ». Pour plus d'informations, allez sur le site http://www.doxygen.org
+Comment[gl]=A extensión doxigen proporciona unha maneira de especificar e controlar a xeración da documentación dun proxecto, basada nos contidos do código fonte. Necesitará ter doxigen instalado para poder usar isto. Para máis información visite http://www.doxygen.org
+Comment[hu]=A Doxygen bővítőmodullal a projekt teljes dokumentációjának készítése elvégezhető, közvetlenül a forráskódból. Használatához előbb telepíteni kell a Doxygen programcsomagot. Részletes információ itt található: http://www.doxygen.org
+Comment[it]=Il plugin doxygen offre un modo per specificare e controllare la generazione della documentazione di un progetto, basato sul contenuto del codice sorgente. Devi avere doxygen installato per utilizzarlo. Per maggiori informazioni vai su http://www.doxygen.org
+Comment[ja]=doxygen プラグインは、ソースコード内容に基づいて、プロジェクトのためのドキュメンテーションの生成を指定しコントロールする方法を提供します。これを使用するには doxygen をインストールする必要があります。より多くの情報は http://www.doxygen.org にあります。
+Comment[ms]=Plugin doxygen menyediakan cara untuk menyatakan dan mengawal penjanaan dokumentasi untuk projek, berdasarkan pada kandungan kod sumber. Anda perlu mempunyai doxygen dipasang untuk boleh menggunakannya. Untuk lebih maklumat lawat http://www.doxygen.org
+Comment[nds]=Dat Doxygen-Moduul stellt en op den Borntextinholt opbuut Ünnerstütten bi't Opstellen vun Projektdokmentatschonen praat. Dormit Du dat bruken kannst, mutt "doxygen" installeert wesen. Mehr Informatschonen laat sik op http://www.doxygen.org finnen.
+Comment[ne]=डक्सिजन प्लगइनले स्रोत सङ्केत प्रसङ्गमा आधारित, परियोजनाका लागि मिसिलीकरणको उत्पादन नियन्त्रण र निर्दिष्ट गर्ने तरिका प्रदान गर्दछ । यसलाई प्रयोग गर्न सक्षम हुनका लागि तपाईँले डक्सिजन स्थापना गर्नु पर्दछ । बढी जानकारीका लागि http://www.doxygen.org मा जानुहोस् ।
+Comment[nl]=De doxygen-plugin biedt hulp bij het vervaardigen van documentatie voor een project, gebaseerd op documentatie in de broncode. Om deze functie te kunnen gebruiken dient u doxygen te hebben geïnstalleerd. Meer info: http://www.doxygen.org/
+Comment[pl]=Wtyczka doxygena pozwala kontrolować generację dokumentacji projektu, bazując na zawartości kodu źródłowego. Aby użyć tej opcji trzeba mieć zainstalowany doxygen. Więcej informacji można uzyskać na http://www.doxygen.org
+Comment[pt]=O 'plugin' do doxygen oferece uma forma de especificar e controlar a geração de documentação de um projecto, baseada no conteúdo do código-fonte. Você necessita de ter o 'doxygen' instalado para poder usar isto. Para obter mais informações vá a http://www.doxygen.org
+Comment[pt_BR]=O plug-in do doxygen fornece uma maneira de especificar e controlar a geração de documentação para um projeto, baseado no conteúdo do código fonte. Você precisa ter o doxygen instalado para poder usar isto. Para mais informações vá em http://www.doxygen.org
+Comment[ru]=Модуль поддержки doxygen предоставляет возможности контроля генерации проектной документации на основе содержимого исходных файлов. Для использования необходим doxygen. Подробнее об этом смотрите на http://www.doxygen.org.
+Comment[sk]=Doxygen modul proskytuje spôsob ako špecifikovať a generovať projektovú dokumentáciu na základe obsahu zdrojového kódu. Potrebujete mať nainštalovaný doxygen. Pre viac informácií pozrite http://www.doxygen.org
+Comment[sr]=Doxygen прикључак обезбеђује начин да се прецизира и контролише документација за пројекат, на основу садржаја изворног кôда. Потребно је да имате инсталиран doxygen да бисте били у могућности да користите ово. За више информација идите на http://www.doxygen.org
+Comment[sr@Latn]=Doxygen priključak obezbeđuje način da se precizira i kontroliše dokumentacija za projekat, na osnovu sadržaja izvornog kôda. Potrebno je da imate instaliran doxygen da biste bili u mogućnosti da koristite ovo. Za više informacija idite na http://www.doxygen.org
+Comment[sv]=Doxygen-insticksprogrammet tillhandahåller ett sätt att ange och styra hur dokument skapas för ett projekt, baserat på källkodens innehåll. Du måste ha installerat Doxygen för att kunna använda det. För mer information besök http://www.doxygen.org.
+Comment[ta]=டிஆக்சிஜன் சொருகி உங்கள் திட்டப்பணிக்கு குறிப்பிட்ட வழி மற்றும் ஆவணத்தின் கட்டுபாட்டு உற்பத்திக்கு இது உதவும். இதை உபயோகிக்க முதலில் நீங்கள் டிஆக்சிஜன் நிறுவ வேண்டும். மேலும் விவரங்களுக்கு http://www.doxygen.org
+Comment[tg]=Модули тарафдорбудаи doxygen барои идора намудани генератсияи ҳуҷҷатҳо дар асоси файлҳои берунӣ буда имконият медиҳад.Барои истифодаи doxygen-и лозимӣ.Барои пурратар гирифтани маълумот ба http://www.doxygen.org назар намоед
+Comment[tr]=Doxygen eklentisi, kaynak kod içeriğine göre bir projenin belgelerinin yaratılmasının belirtilmesi ve kontrolü için bir yol sağlar. Bunu kullanabilmek için doxygen'ın kurulu olması lazımdır. Daha fazla bilgi için http://www.doxygen.org adresine gidin.
+Comment[zh_CN]=doxygen 是基于源文件产生文档的控制插件。必须安装 doxygen 才能使用。更多信息参考 http://www.doxygen.org
+Comment[zh_TW]=Doxygen 外掛程式提供依據程式源碼內容產生並控制專案文件的方式。您需要安裝 doxygen 才能使用。詳情請參考 http://www.doxygen.org
+Name=KDevDoxygen
+Name[da]=KDevelop Doxygen
+Name[de]=Unterstützung für Doxygen (KDevelop)
+Name[hi]=के-डेव-डॉक्सीज़ेन
+Name[nds]=Doxygen-Ünnerstütten för KDevelop
+Name[sk]=KDev Doxygen
+Name[sv]=KDevelop Doxygen
+Name[zh_TW]=KDevelop Doxygen
+GenericName=Doxygen Support
+GenericName[ca]=Suport per a doxygen
+GenericName[da]=Doxygen understøttelse
+GenericName[de]=Unterstützung für Doxygen
+GenericName[el]=Υποστήριξη Doxygen
+GenericName[es]=Soporte para Doxygen
+GenericName[et]=Doxygeni toetus
+GenericName[eu]=Doxygen euskarria
+GenericName[fa]=پشتیبانی Doxygen
+GenericName[fr]=Prise en charge de Doxygen
+GenericName[ga]=Tacaíocht Doxygen
+GenericName[gl]=Soporte para Doxygen
+GenericName[hu]=Doxygen-támogatás
+GenericName[it]=Supporto Doxygen
+GenericName[ja]=Doxygen サポート
+GenericName[ms]=Sokongan Doxygen
+GenericName[nds]=Ünnerstütten för Doxygen
+GenericName[ne]=डक्सिजन समर्थन
+GenericName[nl]=Doxygen ondersteuning
+GenericName[pl]=Obsług Doxygena
+GenericName[pt]=Suporte a Doxygen
+GenericName[pt_BR]=Suporte ao Doxygen
+GenericName[ru]=Поддержка Doxygen
+GenericName[sk]=Doxygen podpora
+GenericName[sl]=Podpora za Doxygen
+GenericName[sr]=Doxygen подршка
+GenericName[sr@Latn]=Doxygen podrška
+GenericName[sv]=Doxygen-stöd
+GenericName[ta]=Doxygen ஆதரவு
+GenericName[tg]=Тарафдори намудани Doxygen
+GenericName[tr]=Doxygen Desteği
+GenericName[zh_CN]=Doxygen 支持
+GenericName[zh_TW]=Doxygen 支援
+ServiceTypes=KDevelop/Plugin
+Icon=kdevelop
+X-KDE-Library=libkdevdoxygen
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=CProjectDocumentation,CPPProjectDocumentation,JavaProjectDocumentation,PHPProjectDocumentation
diff --git a/parts/doxygen/kdevdoxygen.rc b/parts/doxygen/kdevdoxygen.rc
new file mode 100644
index 00000000..9faa6cd5
--- /dev/null
+++ b/parts/doxygen/kdevdoxygen.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevDoxygen" version="4">
+<MenuBar>
+ <Menu name="build" >
+ <Action name="build_doxygen"/>
+ <Action name="clean_doxygen"/>
+ </Menu>
+ <Menu name="tools" >
+ <Action name="show_preview_doxygen_output"/>
+ <Action name="edit_document_function"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/doxygen/lang_cfg.h b/parts/doxygen/lang_cfg.h
new file mode 100644
index 00000000..8b6efc62
--- /dev/null
+++ b/parts/doxygen/lang_cfg.h
@@ -0,0 +1,34 @@
+#define LANG_NL
+#define LANG_SE
+#define LANG_CZ
+#define LANG_FR
+#define LANG_ID
+#define LANG_IT
+#define LANG_DE
+#define LANG_JP
+#define LANG_JE
+#define LANG_ES
+#define LANG_FI
+#define LANG_RU
+#define LANG_HR
+#define LANG_PL
+#define LANG_PT
+#define LANG_HU
+#define LANG_KR
+#define LANG_KE
+#define LANG_RO
+#define LANG_SI
+#define LANG_CN
+#define LANG_NO
+#define LANG_BR
+#define LANG_DK
+#define LANG_SK
+#define LANG_UA
+#define LANG_GR
+#define LANG_TW
+#define LANG_SR
+#define LANG_CA
+#define LANG_LT
+#define LANG_ZA
+#define LANG_AR
+#define LANG_FA
diff --git a/parts/doxygen/messages.cpp b/parts/doxygen/messages.cpp
new file mode 100644
index 00000000..050e1ba6
--- /dev/null
+++ b/parts/doxygen/messages.cpp
@@ -0,0 +1,301 @@
+#include <qmap.h>
+
+
+#include <kdebug.h>
+#include <klocale.h>
+
+
+static QMap<QCString,QString> sMessages;
+
+
+// Note: this function seems to be completely unnecessary, but messages.insert
+// is a template function, so doing the template expansion just once reduced
+// the compile time of this trivial file from >5m to <30s on my machine. mhk.
+static void addMessage(const QCString key, const QString &message)
+{
+ sMessages.insert(key, message);
+}
+
+
+QString message(const QCString &key)
+{
+ static bool initialized = false;
+
+ if (!initialized)
+ {
+ //---------------------------------------------------------------------------
+ // Project related configuration options
+ //---------------------------------------------------------------------------
+ addMessage("Project", i18n("Project"));
+ addMessage("PROJECT_NAME", i18n("Project name"));
+ addMessage("PROJECT_NUMBER", i18n("Project version"));
+ addMessage("OUTPUT_DIRECTORY", i18n("Output path"));
+ addMessage("CREATE_SUBDIRS", i18n("Distribute the generated docs in 10 subdirectories"));
+ addMessage("OUTPUT_LANGUAGE", i18n("Output language"));
+ addMessage("USE_WINDOWS_ENCODING", i18n("Use MS Windows(tm) font encoding"));
+ addMessage("BRIEF_MEMBER_DESC", i18n("Include brief member descriptions"));
+ addMessage("REPEAT_BRIEF", i18n("Repeat brief member descriptions"));
+ addMessage("ABBREVIATE_BRIEF", i18n("Strip words in brief description"));
+ addMessage("ALWAYS_DETAILED_SEC", i18n("Always include detailed section"));
+ addMessage("INLINE_INHERITED_MEMB", i18n("Inline inherited members"));
+ addMessage("FULL_PATH_NAMES", i18n("Always use full path names"));
+ addMessage("STRIP_FROM_PATH", i18n("Prefix to strip from path names"));
+ addMessage("STRIP_FROM_INC_PATH", i18n("Strip from include path"));
+ addMessage("SHORT_NAMES", i18n("Generate short file names"));
+ addMessage("JAVADOC_AUTOBRIEF", i18n("Use JavaDoc-style brief descriptions"));
+ addMessage("MULTILINE_CPP_IS_BRIEF", i18n("Multiline cpp is brief"));
+ addMessage("DETAILS_AT_TOP", i18n("Details at top"));
+ addMessage("INHERIT_DOCS", i18n("Inherit documentation"));
+ addMessage("SEPARATE_MEMBER_PAGES", i18n("Produce a new page for each member"));
+ addMessage("TAB_SIZE", i18n("Tab size"));
+ addMessage("ALIASES", i18n("Aliases"));
+ addMessage("OPTIMIZE_OUTPUT_FOR_C", i18n("Optimize output for C"));
+ addMessage("OPTIMIZE_OUTPUT_JAVA", i18n("Optimize output for Java"));
+ addMessage("BUILTIN_STL_SUPPORT", i18n("Use built-in STL classes support"));
+ addMessage("DISTRIBUTE_GROUP_DOC", i18n("Use group documentation on undocumented members"));
+ addMessage("SUBGROUPING", i18n("Class members type subgrouping"));
+
+ //---------------------------------------------------------------------------
+ // Build related configuration options
+ //---------------------------------------------------------------------------
+ addMessage("Build", i18n("Build"));
+ addMessage("EXTRACT_ALL", i18n("Extract undocumented entities"));
+ addMessage("EXTRACT_PRIVATE", i18n("Extract private entities"));
+ addMessage("EXTRACT_STATIC", i18n("Extract static entities"));
+ addMessage("EXTRACT_LOCAL_CLASSES", i18n("Extract local classes"));
+ addMessage("EXTRACT_LOCAL_METHODS", i18n("Extract local methods"));
+ addMessage("HIDE_UNDOC_MEMBERS", i18n("Hide undocumented members"));
+ addMessage("HIDE_UNDOC_CLASSES", i18n("Hide undocumented classes"));
+ addMessage("HIDE_FRIEND_COMPOUNDS", i18n("Hide friend compounds"));
+ addMessage("HIDE_IN_BODY_DOCS", i18n("Hide in body docs"));
+ addMessage("INTERNAL_DOCS", i18n("Document internal entities"));
+ addMessage("CASE_SENSE_NAMES", i18n("Use case-sensitive file names"));
+ addMessage("HIDE_SCOPE_NAMES", i18n("Hide name scopes"));
+ addMessage("SHOW_INCLUDE_FILES", i18n("Show included files"));
+ addMessage("INLINE_INFO", i18n("Make inline functions"));
+ addMessage("SORT_MEMBER_DOCS", i18n("Sort member documentation alphabetically"));
+ addMessage("SORT_BY_SCOPE_NAME", i18n("Sort the class list by fully-qualified names"));
+ addMessage("SORT_BRIEF_DOCS", i18n("Sort brief documentation alphabetically"));
+ addMessage("ENABLED_SECTIONS", i18n("Enable conditional sections"));
+ addMessage("GENERATE_TODOLIST", i18n("Generate TODO-list"));
+ addMessage("GENERATE_TESTLIST", i18n("Generate Test-list"));
+ addMessage("GENERATE_BUGLIST", i18n("Generate Bug-list"));
+ addMessage("GENERATE_DEPRECATEDLIST", i18n("Generate Deprecated-list"));
+ addMessage("MAX_INITIALIZER_LINES", i18n("Maximum lines shown for initializers"));
+ addMessage("SHOW_USED_FILES", i18n("Show used files"));
+ addMessage("SHOW_DIRECTORIES", i18n("Show the directory hierarchy"));
+ addMessage("FILE_VERSION_FILTER", i18n("Script to invoke to get the current version for each file"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to warning and progress messages
+ //---------------------------------------------------------------------------
+ addMessage("Messages", i18n("Messages"));
+ addMessage("QUIET", i18n("Suppress output"));
+ addMessage("WARNINGS", i18n("Show warnings"));
+ addMessage("WARN_IF_UNDOCUMENTED", i18n("Warn about undocumented entities"));
+ addMessage("WARN_IF_DOC_ERROR", i18n("Warn if error in documents"));
+ addMessage("WARN_NO_PARAMDOC", i18n("Warn if function parameters are not documented"));
+ addMessage("WARN_FORMAT", i18n("Warnings format"));
+ addMessage("WARN_LOGFILE", i18n("Write warnings to"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the input files
+ //---------------------------------------------------------------------------
+ addMessage("Input", i18n("Input"));
+ addMessage("INPUT", i18n("Input files and directories"));
+ addMessage("FILE_PATTERNS", i18n("Input patterns"));
+ addMessage("RECURSIVE", i18n("Recurse into subdirectories"));
+ addMessage("EXCLUDE", i18n("Exclude from input"));
+ addMessage("EXCLUDE_SYMLINKS", i18n("Exclude symlinks"));
+ addMessage("EXCLUDE_PATTERNS", i18n("Exclude patterns"));
+ addMessage("EXAMPLE_PATH", i18n("Path to examples"));
+ addMessage("EXAMPLE_PATTERNS", i18n("Example patterns"));
+ addMessage("EXAMPLE_RECURSIVE", i18n("Example recursive"));
+ addMessage("IMAGE_PATH", i18n("Path to images"));
+ addMessage("INPUT_FILTER", i18n("Input filter"));
+ addMessage("FILTER_SOURCE_FILES", i18n("Filter input files"));
+ addMessage("FILTER_PATTERNS", i18n("Apply filters on file patterns"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to source browsing
+ //---------------------------------------------------------------------------
+ addMessage("Source Browser", i18n("Source Browser"));
+ addMessage("SOURCE_BROWSER", i18n("Cross-reference with source files"));
+ addMessage("REFERENCES_LINK_SOURCE", i18n("References will link to source code"));
+ addMessage("USE_HTAGS", i18n("Use links to HTAGS"));
+ addMessage("INLINE_SOURCES", i18n("Inline sources"));
+ addMessage("STRIP_CODE_COMMENTS", i18n("Hide special comment blocks"));
+ addMessage("REFERENCED_BY_RELATION", i18n("Referenced by relation"));
+ addMessage("REFERENCES_RELATION", i18n("References relation"));
+ addMessage("VERBATIM_HEADERS", i18n("Include headers verbatim"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the alphabetical class index
+ //---------------------------------------------------------------------------
+ addMessage("Index", i18n("Index"));
+ addMessage("ALPHABETICAL_INDEX", i18n("Generate alphabetical index"));
+ addMessage("COLS_IN_ALPHA_INDEX", i18n("Columns in index"));
+ addMessage("IGNORE_PREFIX", i18n("Prefix to ignore"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the HTML output
+ //---------------------------------------------------------------------------
+ addMessage("HTML", i18n("HTML"));
+ addMessage("GENERATE_HTML", i18n("Generate HTML"));
+ addMessage("HTML_OUTPUT", i18n("HTML output directory"));
+ addMessage("HTML_FILE_EXTENSION", i18n("HTML file extension"));
+ addMessage("HTML_HEADER", i18n("Header file"));
+ addMessage("HTML_FOOTER", i18n("Footer file"));
+ addMessage("HTML_STYLESHEET", i18n("Stylesheet"));
+ addMessage("HTML_ALIGN_MEMBERS", i18n("Align members"));
+ addMessage("GENERATE_HTMLHELP", i18n("Generate HTML-help"));
+ addMessage("CHM_FILE", i18n("CHM file"));
+ addMessage("HHC_LOCATION", i18n("HHC location"));
+ addMessage("GENERATE_CHI", i18n("Generate .chi file"));
+ addMessage("BINARY_TOC", i18n("Generate binary TOC"));
+ addMessage("TOC_EXPAND", i18n("Expand TOC"));
+ addMessage("DISABLE_INDEX", i18n("Disable index"));
+ addMessage("ENUM_VALUES_PER_LINE", i18n("Number of enum values per line"));
+ addMessage("GENERATE_TREEVIEW", i18n("Generate treeview"));
+ addMessage("TREEVIEW_WIDTH", i18n("Treeview width"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the LaTeX output
+ //---------------------------------------------------------------------------
+ addMessage("LaTeX", i18n("LaTeX"));
+ addMessage("GENERATE_LATEX", i18n("Generate LaTeX"));
+ addMessage("LATEX_OUTPUT", i18n("LaTeX output directory"));
+ addMessage("LATEX_CMD_NAME", i18n("LaTeX command name"));
+ addMessage("MAKEINDEX_CMD_NAME", i18n("MakeIndex command name"));
+ addMessage("COMPACT_LATEX", i18n("Generate compact output"));
+ addMessage("PAPER_TYPE", i18n("Paper type"));
+ addMessage("EXTRA_PACKAGES", i18n("Include extra packages"));
+ addMessage("LATEX_HEADER", i18n("LaTeX Header file"));
+ addMessage("PDF_HYPERLINKS", i18n("Generate PDF hyperlinks"));
+ addMessage("USE_PDFLATEX", i18n("Use pdflatex"));
+ addMessage("LATEX_BATCHMODE", i18n("Use batch mode"));
+ addMessage("LATEX_HIDE_INDICES", i18n("Do not include index chapters"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the RTF output
+ //---------------------------------------------------------------------------
+ addMessage("RTF", i18n("RTF"));
+ addMessage("GENERATE_RTF", i18n("Generate RTF"));
+ addMessage("RTF_OUTPUT", i18n("RTF output directory"));
+ addMessage("COMPACT_RTF", i18n("Generate compact output"));
+ addMessage("RTF_HYPERLINKS", i18n("Generate hyperlinks"));
+ addMessage("RTF_STYLESHEET_FILE", i18n("Stylesheet"));
+ addMessage("RTF_EXTENSIONS_FILE", i18n("Extensions file"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the man page output
+ //---------------------------------------------------------------------------
+ addMessage("Man", i18n("Man"));
+ addMessage("GENERATE_MAN", i18n("Generate man pages"));
+ addMessage("MAN_OUTPUT", i18n("Man output directory"));
+ addMessage("MAN_EXTENSION", i18n("Man extension"));
+ addMessage("MAN_LINKS", i18n("Generate links"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the XML output
+ //---------------------------------------------------------------------------
+ addMessage("XML", i18n("XML"));
+ addMessage("GENERATE_XML", i18n("Generate XML"));
+ addMessage("XML_OUTPUT", i18n("XML output directory"));
+ addMessage("XML_SCHEMA", i18n("XML schema"));
+ addMessage("XML_DTD", i18n("XML DTD file"));
+ addMessage("XML_PROGRAMLISTING", i18n("Dump program listings to the XML output"));
+
+ //---------------------------------------------------------------------------
+ // configuration options for the AutoGen Definitions output
+ //---------------------------------------------------------------------------
+ addMessage("DEF", i18n("DEF"));
+ addMessage("GENERATE_AUTOGEN_DEF", i18n("Generate Autogen DEF"));
+
+ //---------------------------------------------------------------------------
+ // configuration options related to the Perl module output
+ //---------------------------------------------------------------------------
+ addMessage("PerlMod", i18n("Perl"));
+ addMessage("GENERATE_PERLMOD", i18n("Generate Perl module"));
+ addMessage("PERLMOD_LATEX", i18n("Generate PDF and DVI using LaTeX"));
+ addMessage("PERLMOD_PRETTY", i18n("Make the Perl module output human readable"));
+ addMessage("PERLMOD_MAKEVAR_PREFIX", i18n("Perl module variable prefix in the makefiles"));
+
+ //---------------------------------------------------------------------------
+ // Configuration options related to the preprocessor
+ //---------------------------------------------------------------------------
+ addMessage("Preprocessor", i18n("Preprocessor"));
+ addMessage("ENABLE_PREPROCESSING", i18n("Enable preprocessing"));
+ addMessage("MACRO_EXPANSION", i18n("Expand macros"));
+ addMessage("EXPAND_ONLY_PREDEF", i18n("Expand only predefined macros"));
+ addMessage("SEARCH_INCLUDES", i18n("Search for includes"));
+ addMessage("INCLUDE_PATH", i18n("Include path"));
+ addMessage("INCLUDE_FILE_PATTERNS", i18n("Include file patterns"));
+ addMessage("PREDEFINED", i18n("Predefined macros"));
+ addMessage("EXPAND_AS_DEFINED", i18n("Expand as defined"));
+ addMessage("SKIP_FUNCTION_MACROS", i18n("Skip function macros"));
+
+ //---------------------------------------------------------------------------
+ // Configuration::addtions related to external references
+ //---------------------------------------------------------------------------
+ addMessage("External", i18n("External"));
+ addMessage("TAGFILES", i18n("Tagfiles"));
+ addMessage("GENERATE_TAGFILE", i18n("Generate tagfile"));
+ addMessage("ALLEXTERNALS", i18n("List all externals"));
+ addMessage("EXTERNAL_GROUPS", i18n("External groups"));
+ addMessage("PERL_PATH", i18n("Path to Perl"));
+
+ //---------------------------------------------------------------------------
+ // Configuration options related to the dot tool
+ //---------------------------------------------------------------------------
+ addMessage("Dot", i18n("Dot"));
+ addMessage("CLASS_DIAGRAMS", i18n("Generate class diagrams"));
+ addMessage("HIDE_UNDOC_RELATIONS", i18n("Hide undocumented relations"));
+ addMessage("HAVE_DOT", i18n("Use dot"));
+ addMessage("CALLER_GRAPH", i18n("Generate a caller dependency graph"));
+ addMessage("CLASS_GRAPH", i18n("Generate class graphs"));
+ addMessage("COLLABORATION_GRAPH", i18n("Generate collaboration graphs"));
+ addMessage("GROUP_GRAPHS", i18n("Generate a graph showing the direct groups dependencies"));
+ addMessage("UML_LOOK", i18n("Generate UML looking inheritance and colloboration diagrams"));
+ addMessage("TEMPLATE_RELATIONS", i18n("Show relations between templates and their instances"));
+ addMessage("INCLUDE_GRAPH", i18n("Generate include graphs"));
+ addMessage("INCLUDED_BY_GRAPH", i18n("Generate included-by graphs"));
+ addMessage("CALL_GRAPH", i18n("Generate a call dependency graph for every global function or class method"));
+ addMessage("GRAPHICAL_HIERARCHY", i18n("Generate graphical hierarchy"));
+ addMessage("DIRECTORY_GRAPH", i18n("Show the dependencies a directory has on other directories"));
+ addMessage("DOT_IMAGE_FORMAT", i18n("Dot image format"));
+ addMessage("DOT_PATH", i18n("Path to dot"));
+ addMessage("DOTFILE_DIRS", i18n("Directories with extra dot files"));
+ addMessage("MAX_DOT_GRAPH_WIDTH", i18n("Maximum graph width"));
+ addMessage("MAX_DOT_GRAPH_HEIGHT", i18n("Maximum graph height"));
+ addMessage("MAX_DOT_GRAPH_DEPTH", i18n("Maximum graph depth"));
+ addMessage("DOT_TRANSPARENT", i18n("Generate images with a transparent background"));
+ addMessage("DOT_MULTI_TARGETS", i18n("Generate multiple output files in one run"));
+ addMessage("GENERATE_LEGEND", i18n("Generate legend"));
+ addMessage("DOT_CLEANUP", i18n("Remove intermediate files"));
+ addMessage("Search", i18n("Search"));
+
+ //---------------------------------------------------------------------------
+ // Configuration::addtions related to the search engine
+ //---------------------------------------------------------------------------
+ addMessage("SEARCHENGINE", i18n("Search engine"));
+ addMessage("CGI_NAME", i18n("CGI name"));
+ addMessage("CGI_URL", i18n("CGI URL"));
+ addMessage("DOC_URL", i18n("Documentation URL"));
+ addMessage("DOC_ABSPATH", i18n("Absolute path to documentation"));
+ addMessage("BIN_ABSPATH", i18n("Absolute path to doxysearch binary"));
+ addMessage("EXT_DOC_PATHS", i18n("Paths to external documentation"));
+
+ initialized = true;
+ }
+
+ if (!sMessages.contains(key))
+ {
+ kdDebug() << "Unhandled message: " << key << endl;
+
+ return key;
+ }
+
+ return sMessages[key];
+}
+
diff --git a/parts/doxygen/messages.h b/parts/doxygen/messages.h
new file mode 100644
index 00000000..38ad6b84
--- /dev/null
+++ b/parts/doxygen/messages.h
@@ -0,0 +1,11 @@
+#ifndef __DOXYGEN_MESSAGES_H__
+#define __DOXYGEN_MESSAGES_H__
+
+
+#include <qstring.h>
+
+
+QString message(const QCString &key);
+
+
+#endif
diff --git a/parts/doxygen/version.cpp b/parts/doxygen/version.cpp
new file mode 100644
index 00000000..f8371250
--- /dev/null
+++ b/parts/doxygen/version.cpp
@@ -0,0 +1 @@
+char versionString[]="1.5.7.1-KDevelop";
diff --git a/parts/doxygen/version.h b/parts/doxygen/version.h
new file mode 100644
index 00000000..e3369300
--- /dev/null
+++ b/parts/doxygen/version.h
@@ -0,0 +1,23 @@
+/******************************************************************************
+ *
+ *
+ *
+ * Copyright (C) 1997-2008 by Dimitri van Heesch.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
+ * for any purpose. It is provided "as is" without express or implied warranty.
+ * See the GNU General Public License for more details.
+ *
+ * Documents produced by Doxygen are derivative works derived from the
+ * input used in their production; they are not affected by this license.
+ *
+ */
+
+#ifndef VERSION_H
+#define VERSION_H
+
+extern char versionString[];
+
+#endif
diff --git a/parts/filecreate/Makefile.am b/parts/filecreate/Makefile.am
new file mode 100644
index 00000000..462a8543
--- /dev/null
+++ b/parts/filecreate/Makefile.am
@@ -0,0 +1,23 @@
+#
+
+SUBDIRS = file-templates
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfilecreate.la
+libkdevfilecreate_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfilecreate_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfilecreate_la_SOURCES = filecreate_part.cpp filecreate_listitem.cpp \
+ filecreate_filetype.cpp filecreate_filedialog.cpp fcconfigwidgetbase.ui fcconfigwidget.cpp \
+ fctypeeditbase.ui fctypeedit.cpp fctemplateeditbase.ui fctemplateedit.cpp \
+ filecreate_newfile.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfilecreate.desktop
+
+rcdir = $(kde_datadir)/kdevfilecreate
+rc_DATA = kdevpart_filecreate.rc template-info.xml
diff --git a/parts/filecreate/README b/parts/filecreate/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/filecreate/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/filecreate/README.dox b/parts/filecreate/README.dox
new file mode 100644
index 00000000..50e267e8
--- /dev/null
+++ b/parts/filecreate/README.dox
@@ -0,0 +1,76 @@
+/** \class FileCreatePart
+FileCreatePart is a template manager and wizard system to assist with creation of new files.
+
+Assists with creation of new files.
+
+For those who want to look beyond the GUI, the following illustrates the XML to configure the FileCreate part for a project. It simply consists of a list of filetypes that the user may wish to create for a particular project. At present, the "create" attribute is ignored.
+
+The file create part looks for a file template called \@ext (i.e. the value of the ext attribute) in the *project's* templates directory (see the PyQT appwizard template for an example).
+
+For subtypes, it looks for a template called \@ext-\@ref, so in the example below the following files would need to be present in the project's templates directory:
+
+<code>
+py
+ui
+ui-dialog
+ui-mainwin
+</code>
+
+Example XML:
+
+<code>
+\verbatim
+ <kdevfilecreate>
+ <filetypes>
+ <type ext="py" name="Python" create="template"/>
+ <type ext="ui" name="QT Designer" create="template">
+ <subtype ref="dialog" name="Dialog"/>
+ <subtype ref="mainwin" name="Main window"/>
+ </type>
+ </filetypes>
+ </kdevfilecreate>
+\endverbatim
+</code>
+
+You can also use global template definitions supplied with the FileCreate part:
+
+<code>
+\verbatim
+ <kdevfilecreate>
+ <useglobaltypes>
+ <type ext="ui" />
+ </useglobaltypes>
+ <filetypes>
+ <type ext="py" name="Python" create="template"/>
+ </filetypes>
+ </kdevfilecreate>
+\endverbatim
+</code>
+
+If a type has subtypes, and no subtypes are specified, then all subtypes are assumed to be required (as in the example above). Otherwise, specific subtypes should be specified:
+
+<code>
+\verbatim
+<useglobaltypes>
+ <type ext="ui">
+ <subtype ref="dialog"/>
+ </type>
+</useglobaltypes>
+\endverbatim
+</code>
+
+Usually, this XML forms part of the base .kdevelop file created by the appwizard.
+
+\authors <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
+\authors <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a>
+
+\maintainer <a href="mailto:kde AT jrockey.com">Julian Rockey</a>
+
+\feature friendly sidebar listing the types of new file that can be created for your project
+\feature configurable per-project file types and global file types
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=file+create&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">file create component at Bugzilla database</a>
+\bug Arrangement of text in sidebar is not always perfect
+
+
+*/
diff --git a/parts/filecreate/addglobaldlg.cpp b/parts/filecreate/addglobaldlg.cpp
new file mode 100644
index 00000000..0757d220
--- /dev/null
+++ b/parts/filecreate/addglobaldlg.cpp
@@ -0,0 +1,106 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './addglobaldlg.ui'
+**
+** Created: Сбт Лют 8 20:51:03 2003
+** by: The User Interface Compiler ($Id$)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#include "addglobaldlg.h"
+
+#include <qvariant.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+
+/*
+ * Constructs a AddGlobalDlg as a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+AddGlobalDlg::AddGlobalDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : QDialog( parent, name, modal, fl )
+
+{
+ if ( !name )
+ setName( "AddGlobalDlg" );
+ setSizeGripEnabled( TRUE );
+ AddGlobalDlgLayout = new QGridLayout( this, 1, 1, 11, 6, "AddGlobalDlgLayout");
+
+ Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
+
+ buttonHelp = new KPushButton( this, "buttonHelp" );
+ buttonHelp->setAutoDefault( TRUE );
+ Layout1->addWidget( buttonHelp );
+ QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ Layout1->addItem( spacer );
+
+ buttonOk = new KPushButton( this, "buttonOk" );
+ buttonOk->setAutoDefault( TRUE );
+ buttonOk->setDefault( TRUE );
+ Layout1->addWidget( buttonOk );
+
+ buttonCancel = new KPushButton( this, "buttonCancel" );
+ buttonCancel->setAutoDefault( TRUE );
+ Layout1->addWidget( buttonCancel );
+
+ AddGlobalDlgLayout->addLayout( Layout1, 1, 0 );
+
+ fcglobal_view = new QListView( this, "fcglobal_view" );
+ fcglobal_view->addColumn( i18n( "Type Extension" ) );
+ fcglobal_view->addColumn( i18n( "Type Name" ) );
+ fcglobal_view->addColumn( i18n( "Template Location" ) );
+ fcglobal_view->addColumn( i18n( "Icon" ) );
+ fcglobal_view->addColumn( i18n( "Description" ) );
+ fcglobal_view->setResizePolicy( QListView::AutoOne );
+ fcglobal_view->setAllColumnsShowFocus( TRUE );
+ fcglobal_view->setRootIsDecorated( TRUE );
+ fcglobal_view->setResizeMode( QListView::AllColumns );
+
+ AddGlobalDlgLayout->addWidget( fcglobal_view, 0, 0 );
+ languageChange();
+ resize( QSize(511, 282).expandedTo(minimumSizeHint()) );
+
+ // signals and slots connections
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+AddGlobalDlg::~AddGlobalDlg()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * Sets the strings of the subwidgets using the current
+ * language.
+ */
+void AddGlobalDlg::languageChange()
+{
+ setCaption( i18n( "Select Global File Types" ) );
+ buttonHelp->setGuiItem( KStdGuiItem::help() );
+ buttonHelp->setAccel( QKeySequence( tr2i18n( "F1" ) ) );
+ buttonOk->setGuiItem( KStdGuiItem::ok() );
+ buttonOk->setAccel( QKeySequence( QString::null ) );
+ buttonCancel->setGuiItem( KStdGuiItem::cancel() );
+ buttonCancel->setAccel( QKeySequence( QString::null ) );
+ fcglobal_view->header()->setLabel( 0, i18n( "Type extension:" ) );
+ fcglobal_view->header()->setLabel( 1, i18n( "Type name:" ) );
+ fcglobal_view->header()->setLabel( 2, i18n( "Template location:" ) );
+ fcglobal_view->header()->setLabel( 3, i18n( "Icon:" ) );
+ fcglobal_view->header()->setLabel( 4, i18n( "Description:" ) );
+}
+
+#include "addglobaldlg.moc"
diff --git a/parts/filecreate/addglobaldlg.h b/parts/filecreate/addglobaldlg.h
new file mode 100644
index 00000000..0ec8e588
--- /dev/null
+++ b/parts/filecreate/addglobaldlg.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+** Form interface generated from reading ui file './addglobaldlg.ui'
+**
+** Created: Сбт Лют 8 20:48:22 2003
+** by: The User Interface Compiler ($Id$)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#ifndef ADDGLOBALDLG_H
+#define ADDGLOBALDLG_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QListView;
+class QListViewItem;
+class QPushButton;
+
+class AddGlobalDlg : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AddGlobalDlg( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~AddGlobalDlg();
+
+ QPushButton* buttonHelp;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QListView* fcglobal_view;
+
+protected:
+ QGridLayout* AddGlobalDlgLayout;
+ QHBoxLayout* Layout1;
+
+protected slots:
+ virtual void languageChange();
+};
+
+#endif // ADDGLOBALDLG_H
diff --git a/parts/filecreate/fcconfigwidget.cpp b/parts/filecreate/fcconfigwidget.cpp
new file mode 100644
index 00000000..480d38e0
--- /dev/null
+++ b/parts/filecreate/fcconfigwidget.cpp
@@ -0,0 +1,709 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 <qlistview.h>
+#include <qpushbutton.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qtabwidget.h>
+#include <qdom.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <qlabel.h>
+
+#include <kstandarddirs.h>
+#include <kio/netaccess.h>
+#include <kurlrequester.h>
+#include <kicondialog.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kiconloader.h>
+#include <kdeversion.h>
+
+#include "fctypeedit.h"
+#include "fctemplateedit.h"
+#include "domutil.h"
+#include "fcconfigwidget.h"
+#include "filecreate_part.h"
+#include "filecreate_filetype.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+
+
+FCConfigWidget::FCConfigWidget(FileCreatePart * part, bool global, QWidget *parent, const char *name):
+ FCConfigWidgetBase(parent, name), m_part(part), m_global(global)
+{
+ fc_view->setSorting(-1, FALSE);
+ fcglobal_view->setSorting(-1, FALSE);
+
+ if (m_global)
+ {
+ loadGlobalConfig(fc_view);
+ fc_tabs->setTabLabel(tab1, i18n("Global Types") );
+ fc_tabs->setTabEnabled(tab2, false);
+ fc_tabs->setTabEnabled(tab3, false);
+ delete tab2;
+ delete tab3;
+ }
+ else
+ {
+ loadGlobalConfig(fcglobal_view, true);
+ loadProjectConfig(fc_view);
+ loadProjectTemplates(fctemplates_view);
+ templatesDir_label->setText(i18n("Project templates in ") + m_part->project()->projectDirectory() + "/templates");
+ }
+
+ m_globalfiletypes.setAutoDelete(true);
+ m_projectfiletypes.setAutoDelete(true);
+ m_projectfiletemplates.setAutoDelete(true);
+}
+
+FCConfigWidget::~FCConfigWidget()
+{
+}
+
+void FCConfigWidget::accept()
+{
+ if (m_global) {
+ saveGlobalConfig();
+ }
+ else
+ saveProjectConfig();
+
+ m_part->m_filetypes.clear();
+ m_part->slotProjectOpened();
+
+ for (QValueList<KURL>::iterator it = urlsToEdit.begin(); it != urlsToEdit.end(); ++it )
+ {
+ m_part->partController()->editDocument(*it);
+ }
+}
+
+void FCConfigWidget::loadGlobalConfig(QListView *view, bool checkmarks)
+{
+ QString globalXMLFile = ::locate("data", "kdevfilecreate/template-info.xml");
+ QDomDocument globalDom;
+ if (!globalXMLFile.isNull() &&
+ DomUtil::openDOMFile(globalDom,globalXMLFile)) {
+ m_part->readTypes(globalDom, m_globalfiletypes, false);
+ }
+
+
+ loadFileTypes(m_globalfiletypes, view, checkmarks);
+
+ if (checkmarks)
+ {
+ QDomElement useGlobalTypes =
+ DomUtil::elementByPath(*(m_part->projectDom()),"/kdevfilecreate/useglobaltypes");
+ for(QDomNode node = useGlobalTypes.firstChild(); !node.isNull();node=node.nextSibling())
+ {
+ if (node.isElement() && node.nodeName()=="type")
+ {
+ QDomElement element = node.toElement();
+ QString ext = element.attribute("ext");
+ QString subtyperef = element.attribute("subtyperef");
+ if (subtyperef.isNull())
+ {
+ QListViewItem *it = view->findItem(ext, 0);
+ if (it)
+ {
+ ((QCheckListItem*)it)->setOn(true);
+
+ QListViewItem *lastChild = it->firstChild();
+ while ( lastChild )
+ {
+ ((QCheckListItem*)lastChild)->setOn(true);
+ lastChild = lastChild->nextSibling();
+ }
+ }
+ }
+ else
+ {
+ QListViewItem *it = view->findItem(subtyperef, 0);
+ if (it)
+ ((QCheckListItem*)it)->setOn(true);
+ }
+ }
+ }
+ }
+}
+
+void FCConfigWidget::loadProjectConfig(QListView *view)
+{
+ m_part->readTypes( *(m_part->projectDom()), m_projectfiletypes, false );
+ loadFileTypes(m_projectfiletypes, view, false);
+}
+
+void FCConfigWidget::loadProjectTemplates(QListView *view)
+{
+ QDir templDir( m_part->project()->projectDirectory() + "/templates/" );
+ templDir.setFilter( QDir::Files );
+ const QFileInfoList * list = templDir.entryInfoList();
+ if( list ){
+ QFileInfoListIterator it( *list );
+ QFileInfo *fi;
+ while ( (fi = it.current()) != 0 ) {
+ FileType * filetype;
+ filetype = new FileType;
+ //name shall be "" for proper configuration
+ filetype->setName( "" );
+ filetype->setExt( fi->fileName() );
+ m_projectfiletemplates.append(filetype);
+ filetype->setEnabled(false);
+ ++it;
+ }
+ }
+ loadFileTypes(m_projectfiletemplates, view, false);
+}
+
+
+void FCConfigWidget::saveGlobalConfig()
+{
+ QDomDocument globalDom;
+ QDomElement element = globalDom.createElement("kdevelop" );
+ globalDom.appendChild(element);
+ QDomElement apPart = globalDom.createElement("kdevfilecreate");
+ element.appendChild(apPart);
+ QDomElement fileTypes = globalDom.createElement( "filetypes" );
+ apPart.appendChild( fileTypes );
+
+ saveConfiguration(globalDom, fileTypes, true);
+
+ QFile config( KGlobal::dirs()->saveLocation("data", "kdevfilecreate/", true) + "template-info.xml" );
+ config.open(IO_WriteOnly | IO_Truncate);
+ QTextStream stream(&config);
+ stream << "<?xml version = '1.0'?>";
+ stream << globalDom.toString();
+ config.close();
+}
+
+void FCConfigWidget::saveProjectConfig()
+{
+ QDomDocument dom = *m_part->projectDom( );
+ QDomElement element = dom.documentElement( );
+ QDomElement apPart = element.namedItem( "kdevfilecreate" ).toElement( );
+ if( apPart.isNull( ) )
+ {
+ apPart = dom.createElement( "kdevfilecreate" );
+ element.appendChild( apPart );
+ }
+
+
+ // project template configuration
+
+ QDomElement projectTypes = apPart.namedItem( "filetypes" ).toElement( );
+ apPart.removeChild(projectTypes);
+ projectTypes = dom.createElement( "filetypes" );
+ apPart.appendChild( projectTypes );
+
+ saveConfiguration(dom, projectTypes, false);
+
+
+ // global template usage
+
+ QDomElement globalTypes = apPart.namedItem( "useglobaltypes" ).toElement( );
+ apPart.removeChild(globalTypes);
+ globalTypes = dom.createElement( "useglobaltypes" );
+ apPart.appendChild( globalTypes );
+
+ QListViewItemIterator it( fcglobal_view );
+ for( ; it.current( ); ++it ){
+ if (!it.current()->parent())
+ {
+ QCheckListItem *chit = dynamic_cast<QCheckListItem*>(it.current());
+ if ( !chit ) continue;
+ if (chit->isOn())
+ {
+ QDomElement type = dom.createElement( "type" );
+ type.setAttribute( "ext", chit->text(0) );
+ globalTypes.appendChild( type );
+ }
+ else
+ {
+ QListViewItem *lastChild = chit->firstChild();
+ while ( lastChild )
+ {
+ QCheckListItem *chsit = dynamic_cast<QCheckListItem*>(lastChild);
+ if ( (chsit) && (chsit->isOn()))
+ {
+ QDomElement type = dom.createElement( "type" );
+ type.setAttribute( "ext", chit->text(0) );
+ type.setAttribute( "subtyperef", chsit->text(0) );
+ globalTypes.appendChild( type );
+ }
+
+ lastChild = lastChild->nextSibling();
+ }
+ }
+ }
+ }
+
+
+ // project template files
+
+ //check for new templates and those with location changed
+ QListViewItemIterator it2(fctemplates_view);
+ while (it2.current())
+ {
+ if (!it2.current()->text(1).isEmpty())
+ {
+ QString dest;
+ dest = m_part->project()->projectDirectory() + "/templates/";
+ if (it2.current()->text(1) == "create")
+ copyTemplate(QString::null, dest, it2.current()->text(0));
+ else
+ copyTemplate(it2.current()->text(1), dest, it2.current()->text(0));
+ }
+ ++it2;
+ }
+}
+
+void FCConfigWidget::saveConfiguration(QDomDocument &dom, QDomElement &element, bool global)
+{
+ QListViewItemIterator it( fc_view );
+ for( ; it.current( ); ++it ){
+ if (!it.current()->parent())
+ {
+ QDomElement type = dom.createElement( "type" );
+ type.setAttribute( "ext", it.current()->text(0) );
+ type.setAttribute( "name", it.current()->text(1) );
+ if (it.current()->childCount() > 0)
+ type.setAttribute( "create", "no");
+ else
+ type.setAttribute( "create", "template");
+ type.setAttribute( "icon", it.current()->text(2) );
+
+ QDomElement edescr = dom.createElement("descr");
+ type.appendChild(edescr);
+ QDomText descr = dom.createTextNode( it.current()->text(3) );
+ edescr.appendChild(descr);
+
+ if (!it.current()->text(4).isEmpty())
+ {
+ QString dest;
+ if (global)
+ dest = KGlobal::dirs()->saveLocation("data", "/kdevfilecreate/file-templates/", true);
+ else
+ dest = m_part->project()->projectDirectory() + "/templates/";
+ if (it.current()->text(4) == "create")
+ copyTemplate(QString::null, dest, it.current()->text(0));
+ else
+ copyTemplate(it.current()->text(4), dest, it.current()->text(0));
+ }
+
+
+ QListViewItem *lastChild = it.current()->firstChild();
+ while ( lastChild )
+ {
+ QDomElement subtype = dom.createElement( "subtype" );
+ subtype.setAttribute( "ref", lastChild->text(0) );
+ subtype.setAttribute( "name", lastChild->text(1) );
+ subtype.setAttribute( "icon", lastChild->text(2) );
+
+ QDomElement edescr = dom.createElement("descr");
+ subtype.appendChild(edescr);
+ QDomText descr = dom.createTextNode( lastChild->text(3) );
+ edescr.appendChild(descr);
+
+ if (!lastChild->text(4).isEmpty())
+ {
+ QString dest;
+ if (global)
+ dest = KGlobal::dirs()->saveLocation("data", "/kdevfilecreate/file-templates/", true);
+ else
+ dest = m_part->project()->projectDirectory() + "/templates/";
+ if (lastChild->text(4) == "create")
+ copyTemplate(QString::null, dest, it.current()->text(0) + "-" + lastChild->text(0));
+ else
+ copyTemplate(lastChild->text(4), dest, it.current()->text(0) + "-" + lastChild->text(0));
+ }
+
+ type.appendChild( subtype );
+ lastChild = lastChild->nextSibling();
+ }
+
+ element.appendChild( type );
+ }
+ }
+}
+
+void FCConfigWidget::copyTemplate(QString templateUrl, QString dest, QString destName)
+{
+ if (templateUrl.isEmpty())
+ {
+ QDir d(dest);
+ if (!d.exists())
+ d.mkdir(dest);
+
+ QFile f(dest + destName);
+ f.open(IO_WriteOnly);
+ f.close();
+ }
+ else
+ {
+ KURL destDir;
+ destDir.setPath(dest);
+ if (!KIO::NetAccess::exists(destDir, false, 0 ))
+ KIO::NetAccess::mkdir(destDir);
+
+ KURL destination;
+ destination.setPath(dest + destName);
+
+ KIO::NetAccess::upload(templateUrl, destination);
+ }
+}
+
+void FCConfigWidget::loadFileTypes(QPtrList<FileCreate::FileType> list, QListView *view, bool checkmarks)
+{
+ FileType *ft;
+
+ for( ft = list.last(); ft; ft = list.prev())
+ for( int i = list.count() - 1; i >= 0; --i)
+ {
+ if ( (ft = list.at(i)) )
+ {
+ QListViewItem *it;
+ if (!checkmarks)
+ it = new QListViewItem(view);
+ else
+ it = new QCheckListItem(view, "", QCheckListItem::CheckBox);
+
+ it->setText(0, ft->ext());
+ it->setText(1, ft->name());
+ it->setText(2, ft->icon());
+ it->setText(3, ft->descr());
+ it->setText(4, "");
+
+ FileType *sft;
+ for( int j = ft->subtypes().count() - 1; j >= 0; --j)
+ {
+ if ( (sft = ft->subtypes().at(j)) )
+ {
+ QListViewItem *sit;
+ if (!checkmarks)
+ sit = new QListViewItem(it);
+ else
+ sit = new QCheckListItem(it, "", QCheckListItem::CheckBox);
+
+ sit->setText(0, sft->subtypeRef());
+ sit->setText(1, sft->name());
+ sit->setText(2, sft->icon());
+ sit->setText(3, sft->descr());
+ sit->setText(4, "");
+ }
+ }
+ }
+ }
+}
+
+void FCConfigWidget::removetemplate_button_clicked( )
+{
+ if (fctemplates_view->currentItem())
+ {
+ KURL removedTemplate;
+ removedTemplate.setPath(m_part->project()->projectDirectory() + "/templates/" + fctemplates_view->currentItem()->text(0));
+ KIO::NetAccess::del(removedTemplate);
+ QListViewItem *it = fctemplates_view->currentItem();
+ if (it->itemBelow())
+ {
+ fc_view->setSelected(it->itemBelow(), true);
+ fc_view->setCurrentItem(it->itemBelow());
+ }
+ else if (it->itemAbove())
+ {
+ fc_view->setSelected(it->itemAbove(), true);
+ fc_view->setCurrentItem(it->itemAbove());
+ }
+ delete it;
+ }
+}
+
+void FCConfigWidget::copyToProject_button_clicked()
+{
+ QListViewItem *it = fcglobal_view->currentItem();
+ if (it)
+ {
+ QListViewItem *it_copy_parent = 0;
+ QString destParent;
+ if (it->parent())
+ {
+ it_copy_parent = new QListViewItem(fc_view, it->parent()->text(0),
+ it->parent()->text(1),
+ it->parent()->text(2),
+ it->parent()->text(3),
+ locate("data", "kdevfilecreate/file-templates/"+ it->parent()->text(0)));
+ destParent += it->parent()->text(0) + "-";
+ QCheckListItem *chk = dynamic_cast<QCheckListItem*>(it->parent());
+ if (chk)
+ chk->setOn(false);
+ }
+ QListViewItem *it_copy = 0;
+ if (it_copy_parent)
+ it_copy = new QListViewItem(it_copy_parent, it->text(0),
+ it->text(1),
+ it->text(2),
+ it->text(3),
+ locate("data", "kdevfilecreate/file-templates/"+destParent + it->text(0)));
+ else
+ it_copy = new QListViewItem(fc_view, it->text(0),
+ it->text(1),
+ it->text(2),
+ it->text(3),
+ locate("data", "kdevfilecreate/file-templates/" +destParent+ it->text(0)));
+ QCheckListItem *chk = dynamic_cast<QCheckListItem*>(it);
+ if (chk)
+ chk->setOn(false);
+ fc_view->setSelected(it_copy, true);
+ fc_view->setCurrentItem(it_copy);
+ QListViewItem * it_child = it->firstChild();
+ while( it_child ) {
+ new QListViewItem(it_copy, it_child->text(0),
+ it_child->text(1),
+ it_child->text(2),
+ it_child->text(3),
+ locate("data", "kdevfilecreate/file-templates/"+ it_copy->text(0) + "-" + it_child->text(0)));
+ QCheckListItem *chk_child = dynamic_cast<QCheckListItem*>(it_child);
+ if (chk_child)
+ chk_child->setOn(false);
+ it_child = it_child->nextSibling();
+ }
+ }
+}
+
+void FCConfigWidget::newtype_button_clicked()
+{
+ FCTypeEdit *te = new FCTypeEdit();
+ if (te->exec() == QDialog::Accepted )
+ {
+ QListViewItem *it = new QListViewItem(fc_view, te->typeext_edit->text(),
+ te->typename_edit->text(),
+ te->icon_url->icon(),
+ te->typedescr_edit->text(),
+ te->template_url->url().isEmpty() ? QString("create") : te->template_url->url());
+ fc_view->setSelected(it, true);
+ fc_view->setCurrentItem(it);
+ }
+ delete te;
+}
+
+void FCConfigWidget::newsubtype_button_clicked()
+{
+ if (fc_view->currentItem() && (!fc_view->currentItem()->parent()))
+ {
+ FCTypeEdit *te = new FCTypeEdit(this);
+ if (te->exec() == QDialog::Accepted )
+ {
+ /*QListViewItem *it =*/(void) new QListViewItem(fc_view->currentItem(),
+ te->typeext_edit->text(),
+ te->typename_edit->text(),
+ te->icon_url->icon(),
+ te->typedescr_edit->text(),
+ te->template_url->url().isEmpty() ? QString("create") : te->template_url->url());
+ fc_view->currentItem()->setOpen(true);
+ }
+ delete te;
+ }
+}
+
+void FCConfigWidget::remove_button_clicked()
+{
+ if (fc_view->currentItem())
+ {
+ QListViewItem *it = fc_view->currentItem();
+ if (it->itemBelow())
+ {
+ fc_view->setSelected(it->itemBelow(), true);
+ fc_view->setCurrentItem(it->itemBelow());
+ }
+ else if (it->itemAbove())
+ {
+ fc_view->setSelected(it->itemAbove(), true);
+ fc_view->setCurrentItem(it->itemAbove());
+ }
+ delete it;
+ }
+}
+
+
+void FCConfigWidget::moveup_button_clicked()
+{
+ QListViewItem *i = fc_view->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ --it;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ --it;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ other->moveItem( i );
+}
+
+
+void FCConfigWidget::movedown_button_clicked()
+{
+ QListViewItem *i = fc_view->currentItem();
+ if ( !i )
+ return;
+
+ QListViewItemIterator it( i );
+ QListViewItem *parent = i->parent();
+ it++;
+ while ( it.current() ) {
+ if ( it.current()->parent() == parent )
+ break;
+ it++;
+ }
+
+ if ( !it.current() )
+ return;
+ QListViewItem *other = it.current();
+
+ i->moveItem( other );
+}
+
+
+void FCConfigWidget::edittype_button_clicked()
+{
+ QListViewItem *it = fc_view->currentItem();
+ if ( it )
+ {
+ FCTypeEdit *te = new FCTypeEdit(this);
+
+ te->typeext_edit->setText(it->text(0));
+ te->typename_edit->setText(it->text(1));
+ te->icon_url->setIcon(it->text(2));
+ te->typedescr_edit->setText(it->text(3));
+ if (it->text(4) != "create")
+ te->template_url->setURL(it->text(4));
+
+ if (te->exec() == QDialog::Accepted )
+ {
+ it->setText(0, te->typeext_edit->text());
+ it->setText(1, te->typename_edit->text());
+ it->setText(2, te->icon_url->icon());
+ it->setText(3, te->typedescr_edit->text());
+ if ((te->template_url->url() == "") && ((it->text(4) == "create")))
+ it->setText(4, "create");
+ else
+ it->setText(4, te->template_url->url());
+ }
+ }
+}
+
+
+void FCConfigWidget::newtemplate_button_clicked()
+{
+ FCTemplateEdit *te = new FCTemplateEdit;
+ if (te->exec() == QDialog::Accepted)
+ {
+ /*QListViewItem *it =*/(void) new QListViewItem(fctemplates_view, te->templatename_edit->text(),
+ te->template_url->url().isEmpty() ? QString("create") : te->template_url->url());
+ }
+}
+
+
+void FCConfigWidget::edittemplate_button_clicked()
+{
+ QListViewItem *it;
+ if ( (it = fctemplates_view->currentItem()) )
+ {
+ FCTemplateEdit *te = new FCTemplateEdit;
+ te->templatename_edit->setText(it->text(0));
+ te->templatename_edit->setEnabled(false);
+ if (te->exec() == QDialog::Accepted)
+ {
+ if ((te->template_url->url() == "") && ((it->text(1) == "create")))
+ it->setText(1, "create");
+ else
+ it->setText(1, te->template_url->url());
+ }
+ }
+}
+
+void FCConfigWidget::edit_template_content_button_clicked( )
+{
+ if (fctemplates_view->currentItem())
+ {
+ QFileInfo fi(m_part->project()->projectDirectory() + "/templates/" + fctemplates_view->currentItem()->text(0));
+ KURL content;
+ content.setPath(m_part->project()->projectDirectory() + "/templates/" + fctemplates_view->currentItem()->text(0));
+ if (fi.exists())
+ m_part->partController()->editDocument(content);
+ else
+ {
+ KMessageBox::information(this, i18n("Requested template does not exist yet.\nIt will be opened immediately after accepting the configuration dialog."), QString::null, "Edit template content warning");
+ fctemplates_view->currentItem()->setPixmap(0, SmallIcon("edit"));
+ urlsToEdit.append(content);
+ }
+ }
+}
+
+void FCConfigWidget::edit_type_content_button_clicked( )
+{
+ if (!fc_view->currentItem())
+ return;
+ QListViewItem *it = fc_view->currentItem();
+ QString type_name = it->text(0);
+ if (it->parent())
+ type_name.prepend(it->parent()->text(0) + "-");
+ if (!m_global)
+ {
+ QString typePath = m_part->project()->projectDirectory() + "/templates/" + type_name;
+ KURL content;
+ content.setPath(typePath);
+ if (it->text(4).isEmpty())
+ m_part->partController()->editDocument(content);
+ else
+ {
+ if (it->text(4) == "create")
+ KMessageBox::information(this, i18n("Template for the selected file type does not exist yet.\nIt will be opened immediately after accepting the configuration dialog."), QString::null, "Edit type template content warning");
+ else
+ KMessageBox::information(this, i18n("Template for the selected file type has been changed.\nIt will be opened immediately after accepting the configuration dialog."), QString::null, "Edit type template content warning");
+ fc_view->currentItem()->setPixmap(0, SmallIcon("edit"));
+ urlsToEdit.append(content);
+ }
+ }
+ else
+ {
+ QString dest = KGlobal::dirs()->saveLocation("data", "/kdevfilecreate/file-templates/", true);
+ QString typePath = dest + type_name;
+ KURL content;
+ content.setPath(typePath);
+ if (it->text(4).isEmpty())
+ {
+ QFileInfo fi(dest+type_name);
+ if (!fi.exists())
+ copyTemplate(locate("data", "kdevfilecreate/file-templates/" + type_name), dest, type_name);
+ m_part->partController()->editDocument(content);
+ }
+ else
+ {
+ if (it->text(4) == "create")
+ KMessageBox::information(this, i18n("Template for the selected file type does not exist yet.\nIt will be opened immediately after accepting the configuration dialog."), QString::null, "Edit global type template content warning");
+ else
+ KMessageBox::information(this, i18n("Template for the selected file type has been changed.\nIt will be opened immediately after accepting the configuration dialog."), QString::null, "Edit global type template content warning");
+ fc_view->currentItem()->setPixmap(0, SmallIcon("edit"));
+ urlsToEdit.append(content);
+ }
+ }
+}
+
+#include "fcconfigwidget.moc"
diff --git a/parts/filecreate/fcconfigwidget.h b/parts/filecreate/fcconfigwidget.h
new file mode 100644
index 00000000..52acd29c
--- /dev/null
+++ b/parts/filecreate/fcconfigwidget.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 FCCONFIGWIDGET_H
+#define FCCONFIGWIDGET_H
+
+#include <qwidget.h>
+#include <qvaluelist.h>
+#include <kurl.h>
+
+#include "fcconfigwidgetbase.h"
+
+class FileCreatePart;
+class QListView;
+class QDomDocument;
+class QDomElement;
+
+namespace FileCreate{
+class FileType;
+}
+
+class FCConfigWidget : public FCConfigWidgetBase
+{
+Q_OBJECT
+public:
+ FCConfigWidget(FileCreatePart * part, bool global, QWidget *parent, const char *name);
+
+ ~FCConfigWidget();
+
+public slots:
+ void accept();
+ void removetemplate_button_clicked();
+ void copyToProject_button_clicked();
+ void newtype_button_clicked();
+ void newsubtype_button_clicked();
+ void remove_button_clicked();
+ void moveup_button_clicked();
+ void movedown_button_clicked();
+ void edittype_button_clicked();
+ void newtemplate_button_clicked();
+ void edittemplate_button_clicked();
+ void edit_template_content_button_clicked();
+ void edit_type_content_button_clicked();
+
+protected:
+ void loadGlobalConfig(QListView *view, bool checkmarks = false);
+ void loadProjectConfig(QListView *view);
+ void loadProjectTemplates(QListView *view);
+ void saveGlobalConfig();
+ void saveProjectConfig();
+ void loadFileTypes(QPtrList<FileCreate::FileType> list, QListView *view, bool checkmarks = false);
+ void copyTemplate(QString templateUrl, QString dest, QString destName);
+ void saveConfiguration(QDomDocument &dom, QDomElement &element, bool global);
+
+private:
+ FileCreatePart * m_part;
+ QPtrList<FileCreate::FileType> m_globalfiletypes;
+ QPtrList<FileCreate::FileType> m_projectfiletypes;
+ QPtrList<FileCreate::FileType> m_projectfiletemplates;
+ bool m_global;
+
+ QValueList<KURL> urlsToEdit;
+};
+
+#endif
diff --git a/parts/filecreate/fcconfigwidgetbase.ui b/parts/filecreate/fcconfigwidgetbase.ui
new file mode 100644
index 00000000..72f62260
--- /dev/null
+++ b/parts/filecreate/fcconfigwidgetbase.ui
@@ -0,0 +1,540 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>FCConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>FCConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>505</width>
+ <height>388</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New File Wizard Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>fc_tabs</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab1</cstring>
+ </property>
+ <attribute name="title">
+ <string>Pro&amp;ject Types</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>remove_button</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;move Type</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>edittype_button</cstring>
+ </property>
+ <property name="text">
+ <string>Edit T&amp;ype...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>newsubtype_button</cstring>
+ </property>
+ <property name="text">
+ <string>New &amp;Subtype...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>newtype_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Type...</string>
+ </property>
+ </widget>
+ <widget class="QListView" row="0" column="0" rowspan="11" colspan="1">
+ <column>
+ <property name="text">
+ <string>Type Extension</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Icon</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>fc_view</cstring>
+ </property>
+ <property name="resizePolicy">
+ <enum>Manual</enum>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <spacer row="9" 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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>moveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="8" column="1">
+ <property name="name">
+ <cstring>movedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </widget>
+ <spacer row="6" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>spacer1_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>edit_type_content_button</cstring>
+ </property>
+ <property name="text">
+ <string>Ed&amp;it Template</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab2</cstring>
+ </property>
+ <attribute name="title">
+ <string>Used &amp;Global Types</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="2">
+ <column>
+ <property name="text">
+ <string>Type Extension</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Type Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Icon</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>fcglobal_view</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>330</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>copyToProject_button</cstring>
+ </property>
+ <property name="text">
+ <string>Copy to Pro&amp;ject Types</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab3</cstring>
+ </property>
+ <attribute name="title">
+ <string>Proje&amp;ct Templates</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="1" column="0" rowspan="6" colspan="1">
+ <column>
+ <property name="text">
+ <string>Template Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>fctemplates_view</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>edittemplate_button</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;hange Content...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>newtemplate_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New Template...</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>templatesDir_label</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>removetemplate_button</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;move Template</string>
+ </property>
+ </widget>
+ <spacer row="6" column="1">
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>edit_template_content_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Template</string>
+ </property>
+ </widget>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>newtype_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>newtype_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>newsubtype_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>newsubtype_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>remove_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>remove_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>moveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>moveup_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>movedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>movedown_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>edittype_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>edittype_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>newtemplate_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>newtemplate_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>edittemplate_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>edittemplate_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>removetemplate_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>removetemplate_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>copyToProject_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>copyToProject_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>edit_template_content_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>edit_template_content_button_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>edit_type_content_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCConfigWidgetBase</receiver>
+ <slot>edit_type_content_button_clicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>fc_view</tabstop>
+ <tabstop>newtype_button</tabstop>
+ <tabstop>newsubtype_button</tabstop>
+ <tabstop>edittype_button</tabstop>
+ <tabstop>remove_button</tabstop>
+ <tabstop>edit_type_content_button</tabstop>
+ <tabstop>moveup_button</tabstop>
+ <tabstop>movedown_button</tabstop>
+ <tabstop>fc_tabs</tabstop>
+ <tabstop>fcglobal_view</tabstop>
+ <tabstop>copyToProject_button</tabstop>
+ <tabstop>fctemplates_view</tabstop>
+ <tabstop>newtemplate_button</tabstop>
+ <tabstop>edittemplate_button</tabstop>
+ <tabstop>removetemplate_button</tabstop>
+ <tabstop>edit_template_content_button</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">addglobaldlg.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<forwards>
+ <forward>class AddGlobalDlg;</forward>
+</forwards>
+<variables>
+ <variable>AddGlobalDlg *global_dlg;</variable>
+</variables>
+<slots>
+ <slot>removetemplate_button_clicked()</slot>
+ <slot>copyToProject_button_clicked()</slot>
+ <slot>newtype_button_clicked()</slot>
+ <slot>newsubtype_button_clicked()</slot>
+ <slot>remove_button_clicked()</slot>
+ <slot>moveup_button_clicked()</slot>
+ <slot>movedown_button_clicked()</slot>
+ <slot>edittype_button_clicked()</slot>
+ <slot>newtemplate_button_clicked()</slot>
+ <slot>edittemplate_button_clicked()</slot>
+ <slot>edit_template_contents_button_clicked()</slot>
+ <slot>edit_template_content_button_clicked()</slot>
+ <slot>edit_type_content_button_clicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/filecreate/fctemplateedit.cpp b/parts/filecreate/fctemplateedit.cpp
new file mode 100644
index 00000000..fc495fd5
--- /dev/null
+++ b/parts/filecreate/fctemplateedit.cpp
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 <klineedit.h>
+#include "fctemplateedit.h"
+#include <qpushbutton.h>
+
+FCTemplateEdit::FCTemplateEdit(QWidget *parent, const char *name):
+ FCTemplateEditBase(parent, name)
+{
+ connect( templatename_edit, SIGNAL(textChanged ( const QString & )),
+ this, SLOT( slotTemplateNameChanged( )));
+ slotTemplateNameChanged();
+}
+
+FCTemplateEdit::~FCTemplateEdit()
+{
+}
+
+void FCTemplateEdit::slotTemplateNameChanged( )
+{
+ ok_button->setEnabled( !templatename_edit->text().isEmpty() );
+}
+
+void FCTemplateEdit::accept()
+{
+ if ( !templatename_edit->text().isEmpty() )
+ FCTemplateEditBase::accept();
+}
+#include "fctemplateedit.moc"
diff --git a/parts/filecreate/fctemplateedit.h b/parts/filecreate/fctemplateedit.h
new file mode 100644
index 00000000..0209c3b0
--- /dev/null
+++ b/parts/filecreate/fctemplateedit.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 FCTEMPLATEEDIT_H
+#define FCTEMPLATEEDIT_H
+
+#include <qwidget.h>
+#include "fctemplateeditbase.h"
+
+class FCTemplateEdit : public FCTemplateEditBase
+{
+Q_OBJECT
+public:
+ FCTemplateEdit(QWidget *parent=0, const char *name=0);
+
+ ~FCTemplateEdit();
+
+protected slots:
+ virtual void accept();
+ void slotTemplateNameChanged( );
+};
+
+#endif
diff --git a/parts/filecreate/fctemplateeditbase.ui b/parts/filecreate/fctemplateeditbase.ui
new file mode 100644
index 00000000..976bff33
--- /dev/null
+++ b/parts/filecreate/fctemplateeditbase.ui
@@ -0,0 +1,193 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>FCTemplateEditBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FCTemplateEditBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>467</width>
+ <height>149</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>File Template</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>Template &amp;name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>templatename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>templatename_edit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Set template content from &amp;file:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>template_url</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>template_url</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>26</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCTemplateEditBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCTemplateEditBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>templatename_edit</tabstop>
+ <tabstop>template_url</tabstop>
+ <tabstop>ok_button</tabstop>
+ <tabstop>cancel_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">fctemplateeditbase.ui.h</include>
+</includes>
+<slots>
+ <slot>init()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/filecreate/fctemplateeditbase.ui.h b/parts/filecreate/fctemplateeditbase.ui.h
new file mode 100644
index 00000000..6f2b9223
--- /dev/null
+++ b/parts/filecreate/fctemplateeditbase.ui.h
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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. *
+ ***************************************************************************/
+
+/****************************************************************************
+** 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.
+*****************************************************************************/
+
+#include <qvalidator.h>
+#include <qregexp.h>
+
+void FCTemplateEditBase::init()
+{
+ templatename_edit->setValidator(new QRegExpValidator(QRegExp("^\\S*$"), this));
+}
diff --git a/parts/filecreate/fctypeedit.cpp b/parts/filecreate/fctypeedit.cpp
new file mode 100644
index 00000000..310453ea
--- /dev/null
+++ b/parts/filecreate/fctypeedit.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 <klineedit.h>
+#include <qpushbutton.h>
+#include "fctypeedit.h"
+
+
+FCTypeEdit::FCTypeEdit(QWidget *parent, char *name)
+ : FCTypeEditBase(parent, name)
+{
+ connect( typeext_edit, SIGNAL( textChanged ( const QString & )),this, SLOT( slotTypeEditTextChanged()));
+ connect( typename_edit, SIGNAL( textChanged ( const QString & )),this, SLOT( slotTypeEditTextChanged( )));
+ slotTypeEditTextChanged( );
+}
+
+FCTypeEdit::~FCTypeEdit()
+{
+}
+
+void FCTypeEdit::slotTypeEditTextChanged( )
+{
+ ok_button->setEnabled( !typeext_edit->text().isEmpty() &&
+ !typename_edit->text().isEmpty());
+}
+
+void FCTypeEdit::accept()
+{
+ if ( !typeext_edit->text().isEmpty() &&
+ !typename_edit->text().isEmpty() )
+ FCTypeEditBase::accept();
+}
+#include "fctypeedit.moc"
diff --git a/parts/filecreate/fctypeedit.h b/parts/filecreate/fctypeedit.h
new file mode 100644
index 00000000..92c34e3f
--- /dev/null
+++ b/parts/filecreate/fctypeedit.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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 FCTYPEEDIT_H
+#define FCTYPEEDIT_H
+
+
+#include "fctypeeditbase.h"
+
+class FCTypeEdit : public FCTypeEditBase
+{
+Q_OBJECT
+public:
+ FCTypeEdit(QWidget *parent = 0, char *name = 0);
+
+ ~FCTypeEdit();
+
+protected slots:
+ virtual void accept();
+ void slotTypeEditTextChanged( );
+};
+
+#endif
diff --git a/parts/filecreate/fctypeeditbase.ui b/parts/filecreate/fctypeeditbase.ui
new file mode 100644
index 00000000..8bc06f87
--- /dev/null
+++ b/parts/filecreate/fctypeeditbase.ui
@@ -0,0 +1,282 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>FCTypeEditBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FCTypeEditBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>476</width>
+ <height>194</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>File Type</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>Type &amp;extension:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typename_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>typeext_edit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Type &amp;name:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typedescr_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>typename_edit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout3_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Type &amp;description:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typedescr_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>typedescr_edit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="KIconButton" row="0" column="2" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>icon_url</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>80</width>
+ <height>80</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Set template content from &amp;file:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignBottom</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>template_url</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>template_url</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>26</height>
+ </size>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCTypeEditBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>FCTypeEditBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>typeext_edit</tabstop>
+ <tabstop>typename_edit</tabstop>
+ <tabstop>typedescr_edit</tabstop>
+ <tabstop>icon_url</tabstop>
+ <tabstop>template_url</tabstop>
+ <tabstop>ok_button</tabstop>
+ <tabstop>cancel_button</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">kicondialog.h</include>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">fctypeeditbase.ui.h</include>
+</includes>
+<slots>
+ <slot>init()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kicondialog.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/filecreate/fctypeeditbase.ui.h b/parts/filecreate/fctypeeditbase.ui.h
new file mode 100644
index 00000000..e65a2ba7
--- /dev/null
+++ b/parts/filecreate/fctypeeditbase.ui.h
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Alexander Dymo *
+ * cloudtemple@mksat.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. *
+ ***************************************************************************/
+
+/****************************************************************************
+** 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.
+*****************************************************************************/
+
+#include <qvalidator.h>
+#include <qregexp.h>
+
+void FCTypeEditBase::init()
+{
+ typeext_edit->setValidator(new QRegExpValidator(QRegExp("^\\S*$"), this));
+}
diff --git a/parts/filecreate/file-templates/Makefile.am b/parts/filecreate/file-templates/Makefile.am
new file mode 100644
index 00000000..672a1cfa
--- /dev/null
+++ b/parts/filecreate/file-templates/Makefile.am
@@ -0,0 +1,2 @@
+rcdir = $(kde_datadir)/kdevfilecreate/file-templates
+rc_DATA = ui ui-dialog ui-mainwin ui-confdialog ui-dialogb ui-widget ui-dialogr ui-tabdialog ui-wizard dox ts ui-mainwin-qt4 ui-widget-qt4 ui-dialogb-qt4 ui-dialogr-qt4 ui-dialog-qt4 qrc
diff --git a/parts/filecreate/file-templates/dox b/parts/filecreate/file-templates/dox
new file mode 100644
index 00000000..fda0e141
--- /dev/null
+++ b/parts/filecreate/file-templates/dox
@@ -0,0 +1,22 @@
+/** \file $MODULE$.dox
+ * \brief put an explanation here
+ */
+
+/** \page $MODULE$ put the page title here
+
+\section put_sectionLabelName_here put section name here
+
+Here comes the text <code>this is code</code>, the text is continued.
+
+ - This is a item list
+ - This is the second item!
+ .
+
+Here comes the text <code>this is code</code>, the text is continued.
+
+\subsection put_subSectionLabelName_here put subsection name here
+
+Subsection text.
+
+*/
+
diff --git a/parts/filecreate/file-templates/qrc b/parts/filecreate/file-templates/qrc
new file mode 100644
index 00000000..4a4d7e46
--- /dev/null
+++ b/parts/filecreate/file-templates/qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/" >
+ <file></file>
+ </qresource>
+</RCC>
diff --git a/parts/filecreate/file-templates/ts b/parts/filecreate/file-templates/ts
new file mode 100644
index 00000000..4eb9e187
--- /dev/null
+++ b/parts/filecreate/file-templates/ts
@@ -0,0 +1,2 @@
+<!DOCTYPE TS><TS>
+</TS>
diff --git a/parts/filecreate/file-templates/ui b/parts/filecreate/file-templates/ui
new file mode 100644
index 00000000..858b4678
--- /dev/null
+++ b/parts/filecreate/file-templates/ui
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-confdialog b/parts/filecreate/file-templates/ui-confdialog
new file mode 100644
index 00000000..975ba4d4
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-confdialog
@@ -0,0 +1,165 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>MyDialog1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>MyDialog1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>597</width>
+ <height>364</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog1</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QListBox" row="0" column="0">
+ <item>
+ <property name="text">
+ <string>New Item</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>listBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QTabWidget" row="0" column="1">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget2</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget3</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-dialog b/parts/filecreate/file-templates/ui-dialog
new file mode 100644
index 00000000..fc2aefce
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialog
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-dialog-qt4 b/parts/filecreate/file-templates/ui-dialog-qt4
new file mode 100644
index 00000000..d35cb285
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialog-qt4
@@ -0,0 +1,22 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/parts/filecreate/file-templates/ui-dialogb b/parts/filecreate/file-templates/ui-dialogb
new file mode 100644
index 00000000..7ccbfb94
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialogb
@@ -0,0 +1,123 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>MyDialog1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>MyDialog1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog1</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>240</y>
+ <width>476</width>
+ <height>33</height>
+ </rect>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-dialogb-qt4 b/parts/filecreate/file-templates/ui-dialogb-qt4
new file mode 100644
index 00000000..2413393e
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialogb-qt4
@@ -0,0 +1,100 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>250</y>
+ <width>351</width>
+ <height>33</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>131</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>278</x>
+ <y>253</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>96</x>
+ <y>254</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>369</x>
+ <y>253</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>179</x>
+ <y>282</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/parts/filecreate/file-templates/ui-dialogr b/parts/filecreate/file-templates/ui-dialogr
new file mode 100644
index 00000000..8cf208ec
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialogr
@@ -0,0 +1,123 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>MyDialog1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>MyDialog1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>592</width>
+ <height>470</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog1</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>500</x>
+ <y>30</y>
+ <width>82</width>
+ <height>410</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer1</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>
+ </vbox>
+ </widget>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-dialogr-qt4 b/parts/filecreate/file-templates/ui-dialogr-qt4
new file mode 100644
index 00000000..57d81913
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-dialogr-qt4
@@ -0,0 +1,100 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>300</x>
+ <y>20</y>
+ <width>77</width>
+ <height>106</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>Dialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>351</x>
+ <y>38</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>233</x>
+ <y>29</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>Dialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>330</x>
+ <y>66</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>197</x>
+ <y>125</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/parts/filecreate/file-templates/ui-mainwin b/parts/filecreate/file-templates/ui-mainwin
new file mode 100644
index 00000000..854da009
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-mainwin
@@ -0,0 +1,436 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QMainWindow">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&amp;File" name="fileMenu">
+ <action name="fileNewAction"/>
+ <action name="fileOpenAction"/>
+ <action name="fileSaveAction"/>
+ <action name="fileSaveAsAction"/>
+ <separator/>
+ <action name="filePrintAction"/>
+ <separator/>
+ <action name="fileExitAction"/>
+ </item>
+ <item text="&amp;Edit" name="editMenu">
+ <action name="editUndoAction"/>
+ <action name="editRedoAction"/>
+ <separator/>
+ <action name="editCutAction"/>
+ <action name="editCopyAction"/>
+ <action name="editPasteAction"/>
+ <separator/>
+ <action name="editFindAction"/>
+ </item>
+ <item text="&amp;Help" name="helpMenu">
+ <action name="helpContentsAction"/>
+ <action name="helpIndexAction"/>
+ <separator/>
+ <action name="helpAboutAction"/>
+ </item>
+</menubar>
+<toolbars>
+</toolbars>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>fileNewAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image0</iconset>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileOpenAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image1</iconset>
+ </property>
+ <property name="text">
+ <string>Open</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Open...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+O</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image2</iconset>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Save</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+S</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileSaveAsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Save As</string>
+ </property>
+ <property name="menuText">
+ <string>Save &amp;As...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>filePrintAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image3</iconset>
+ </property>
+ <property name="text">
+ <string>Print</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Print...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+P</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>fileExitAction</cstring>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="menuText">
+ <string>E&amp;xit</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editUndoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image4</iconset>
+ </property>
+ <property name="text">
+ <string>Undo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Undo</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Z</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editRedoAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image5</iconset>
+ </property>
+ <property name="text">
+ <string>Redo</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Redo</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+Y</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCutAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image6</iconset>
+ </property>
+ <property name="text">
+ <string>Cut</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Cut</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+X</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editCopyAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image7</iconset>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ <property name="menuText">
+ <string>C&amp;opy</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+C</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editPasteAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image8</iconset>
+ </property>
+ <property name="text">
+ <string>Paste</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Paste</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+V</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>editFindAction</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image9</iconset>
+ </property>
+ <property name="text">
+ <string>Find</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Find...</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+F</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpContentsAction</cstring>
+ </property>
+ <property name="text">
+ <string>Contents</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Contents...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpIndexAction</cstring>
+ </property>
+ <property name="text">
+ <string>Index</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;Index...</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>helpAboutAction</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="menuText">
+ <string>&amp;About</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </action>
+</actions>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="721">789cedd2b10ac2301405d03d5ff148b62056035241fc04c5511087f425a2432b681d44fc777ba329d6b47fe07d19dee50cc9904cd376b3229d896b6deb13131fed85b4bb95e57db75f3e8434869a93d3548e841c13d3fa5c79ecaad9d52404b540351e83caa833c6a03ad4798e41f5a86c30a816f510126ee94d14d52611fb8e2ad49070a4445ca4447ca4446ca444da07fecac7ffd2956ebe64f81ff4c873215e0583a9b0</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d915b11a140ae211149782b898448b2e5a41eb42c4bb9b9fa6a67644045f0299978f37134896c27ab5803413979aeaa3067da033a4bb6b59de36dbf95d245282d953182703910c41c3f254ed6d8da6c69193b5dada7c924b6fc9dac2c85b156c51b83eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31134fa13797a8</data>
+ </image>
+ <image name="image2">
+ <data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b13082709340dc644310047193c1dcc424d314883958015846190b80ca24262a2721012087349964a030ba69c9c9303d403e9132087b68279388ecff4414193440948c32aa71d86470bb80863258a21b9a0eb0a7905a6b2e006d59a436</data>
+ </image>
+ <image name="image3">
+ <data format="XPM.GZ" length="2509">789c7d944973db461085effa152cf54d956a932089a55239c896572d96bcc4b253390033186ea2488aa416a7f2dfd3db0cbd44e6d340f8f8def43406209e1c742ecf4f3b074ff6d69b7a33711d37ae6f3a077e3b9f3ffcf5f71fffeced675987fecab293edffb6b77fb1e9b8ced9e2ba65c08c00baf2117e2f5c86d02d99e196b9d7ed963df53f2ab3c47789258fa7c26564688d4bf30f23673de113e6ac1719ae9459e27f4d5c893f17ae126f8d2be3ebc87d9dff4e3904f317ccfd5ef23f28b3c45f26963c7e510ec1fc9570157dd81857967f883c90cd8635f3208b8c0b6596f863e17a500fd597fe8744c35afc1be33aef8bff5ad9b5e637cc7993f7f346fca571637c1fb9d0f99f9543b07ab2df453ff9723d0551a1f3d791cb8170573904f3a5bf725034e66f133be96fa44c1246799e4a573495e461a29cfcbbc8e64f8d9df96564f5519e876a1019668975fda05c593d5c25d67a6f945d6ef3bdb08b3ed491eba1e467c6561fcf229bff4ad9b5c6c7ccf530fa8089bdf8136596703fb1f800c23ee5ff548e3e7a636f3c8ddc68bd8ab91926066596b05c5fe359c285b2cf8de5f7ed7296f050b825d6f74763dc1a0f227bcdbf60f679e29789353f5666093f4facfe857208e63f156e93df8bdc16c223e358ff28b2f939735b240eca2ce1678983f0a57208e6bf150ec96f8d83f127e650b084cf85e5a32fdf9d10b0c6c6e44835c9631dfd9ff235b618925ad1e89779278af5750df7681ea40316d8111eef876a79ad977ae773d8257ec8efead629fdeb3ca4ba9ae6e11fcdbbef6aa72b7934ef695702eddf4e631a13d2f4c73cd599e115f533a639bbc173e6788d0b5cf23a314fe915dee01a37df698bb77887f7f8805ff190e64c342fb59fe2333ca2e373d30b7c89aff035bec1634a9e904ef1417faf78866ff1fc275de03b7c4fa3a1553e50fd8f78a2ef0bfcf43fe973bcc4cff805bb74d6a3de0e31b37c9f561fe090c6583a19612e9d1dd179417db1575237191eeafb172b9cd22a7d409a7bcc8f0c4e68f01900ef44090db8547f4ee9a966456732445083078f779a8756dfdf52f19b1cd59c699254e31c46d0703f30b6fa5239a5d27faabc22b78409de838316bdd51fd1377730a531a12bd363c949aa3d936f1a6821e8fda566aef8fe011d612eba860569495a9196721ebe7d7ed0c30dac491b58d2bd21c116b634bf25ddd2fd9dd9f3f6efef7bff0111915e41</data>
+ </image>
+ <image name="image4">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b13103711c4b530b1308270f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020011bc73cc</data>
+ </image>
+ <image name="image5">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b13105719c4b530b1308270f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700f7fd8672</data>
+ </image>
+ <image name="image6">
+ <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53002abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fbd07ccb</data>
+ </image>
+ <image name="image7">
+ <data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da8214c44f505c0ae26226b1e8a20a5a1722febb9924a5af58c19b40e77238a1842431ecb66b881371afb03a2b5027bc41ac1f65f9dc1f562f11a52998bd80793411d114146cae9723cfd2cc7266c395ea9aa75c15d74c65aad05c35d79c727215b91636f6d860c689f40910b4e92147d840b3be39d8416d877c860eb9af478d23919c4b8a7a0ed68eb628e4a04521c7fd46c07138e47448dbf1f32fc767e8d43735741af287d3ced83b782fc5075b18a5a5</data>
+ </image>
+ <image name="image8">
+ <data format="XPM.GZ" length="736">789c7d92d10a82301486eff714c3dd49649984103d42d165105dcce3465d58507611d1bbb773d674aed93f85fd7efb183ab394ef771b9e66ecdecaf60c1c4ef2c6d3fad134cfc371fd62499e7373957c9e4c5832e5c0b7d78bc2b9307331a36055ae960556c05a16656e69e5aaa5355658c202965825566d62176b57b5a64da3f188c084841e0a29a5e831910ef8885e4854501922e8a6b923586a176a8e40051ec1e63b7d0267387c6738424775091d653f98565a858e26c110447107d1886350d4a1c41c3dea7864e87c37f3ce47fc3aee7cd5207ffe90f78a7d0007c6c175</data>
+ </image>
+ <image name="image9">
+ <data format="XPM.GZ" length="2798">789cb5d5594f1b491007f0773e8545bda1d53ff81a7bb4da07830103b603b92059edc34cf78c0ff0812f3051befb5677554f56c24428d2aa78e0a7aeaeea6be0dd41e9f6aa573a78b7b75c25ab91299961b2281dd8f564b2fdfb9fbfbeefed572a25fe291f46a5cafe1f7bfbd7ab9229f567d3cc81fa0caa945d785f78c72ebc2f9dabb10bef9e73ade2c21913e77ae2c28f2fc48d6a947ab7c4b169d6bc8f9ca3aa0b3fbfaf4e35ff4c5cccdf8813db34de1def34e4c3881b3cc38fb7d5a918f78525ff46dcaca9576a23a627715cd3f53e8a131b7b63edecba69fd8d3af41b1496fa6d7153f78f86b8a86f0bcbfe9ec5493d16cfc5695dfad34c6d651ca9f7cffdbd173743fd441cd64f0f85a5fe489c6a3fd4d5613c0d4eeade43b189747c1b2ce3683abbeebadf5a702ae343716c743d53313f1febc7bfa843bf1371581f9d06ebf8581df257e2b01eba57675a5fea19177e7c109cfa712271aceba58938b13a6ec4a13fba62ee27f53fa9b51fe5c1ba7f7f1f71cd85f7545cdcf73ad8f8ef137762de9fd4ef898b7e51b0d63f52877e65b10de3c785657eacced4fe7b77b763236fab36fa3e1ec5a9d5f341b0e4d3526c42bd4ab0eee7505cf4fb28ce1aea6fc146fa7f76e6d3e115fafa5d7112cebf254eeb328e6a70967b9f8b437fba13db4ceb2fc5453f7f5ffcfac2795f046bbd0fe2a2df486c42bd2bb18dd46375e89f89b99fccf7ef2dadbbf0eea8add6bf16db4cbd1067b9de8fafc7b7a1ef13cf6213e50defadd846b9acff569c3574fe833ad7fa5fc57943cfdb9f9f894cd8cf93982748fdb9386f64dee4df97c978ff52ef4c9d69ff9938cff53cfdf7ec5627f5ae576f8fdfcf0721410ac391c222fb753e720c30c408638e3bdcf31c7a3d9fb3279862c631c70316586285f5ae1e727fd8e091f3e678c216cf68e108c768e3e4957ccb2b39e5fc337470ce71814b74d143ffe59ae4ff01ae7825d7f8c0753fe213d7ff8c2ffcfb0deccefc016ef115df380e51460555d4504784069aafe48f798f87885126a04a4409a564c8be92bfc115655cb94c395a34409d8634a231afe7c58ee5ef35d7bae3dc2eddd384a634a339c7032d90efcce7bba225ad38525aa3461b7ae478da75037a5f2758d196525ec93359aedde23882a563ae95edc8cf90529b4ee894c6bcf2844f66e2ce1239cf9afc7755c5fbc9b8479fdabcc71b3aa38ee4d039d7b9a04b1ecb5ebe677ea1964712ead2f9cf8aac1ecfd10a6f79ffdc7b4d7dee92bcfd7be1bd5ff29ccedbbf2f90dbfbfffefdfef873ef5fce01d04a</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>fileNewAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileNew()</slot>
+ </connection>
+ <connection>
+ <sender>fileOpenAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileOpen()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileSave()</slot>
+ </connection>
+ <connection>
+ <sender>fileSaveAsAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileSaveAs()</slot>
+ </connection>
+ <connection>
+ <sender>filePrintAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>filePrint()</slot>
+ </connection>
+ <connection>
+ <sender>fileExitAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>fileExit()</slot>
+ </connection>
+ <connection>
+ <sender>editUndoAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editUndo()</slot>
+ </connection>
+ <connection>
+ <sender>editRedoAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editRedo()</slot>
+ </connection>
+ <connection>
+ <sender>editCutAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editCut()</slot>
+ </connection>
+ <connection>
+ <sender>editCopyAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editCopy()</slot>
+ </connection>
+ <connection>
+ <sender>editPasteAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editPaste()</slot>
+ </connection>
+ <connection>
+ <sender>editFindAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>editFind()</slot>
+ </connection>
+ <connection>
+ <sender>helpIndexAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpIndex()</slot>
+ </connection>
+ <connection>
+ <sender>helpContentsAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpContents()</slot>
+ </connection>
+ <connection>
+ <sender>helpAboutAction</sender>
+ <signal>activated()</signal>
+ <receiver>Form1</receiver>
+ <slot>helpAbout()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot>fileNew()</slot>
+ <slot>fileOpen()</slot>
+ <slot>fileSave()</slot>
+ <slot>fileSaveAs()</slot>
+ <slot>filePrint()</slot>
+ <slot>fileExit()</slot>
+ <slot>editUndo()</slot>
+ <slot>editRedo()</slot>
+ <slot>editCut()</slot>
+ <slot>editCopy()</slot>
+ <slot>editPaste()</slot>
+ <slot>editFind()</slot>
+ <slot>helpIndex()</slot>
+ <slot>helpContents()</slot>
+ <slot>helpAbout()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-mainwin-qt4 b/parts/filecreate/file-templates/ui-mainwin-qt4
new file mode 100644
index 00000000..814096cc
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-mainwin-qt4
@@ -0,0 +1,34 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget" />
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>33</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QStatusBar" name="statusbar" />
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/parts/filecreate/file-templates/ui-tabdialog b/parts/filecreate/file-templates/ui-tabdialog
new file mode 100644
index 00000000..a28ae7c7
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-tabdialog
@@ -0,0 +1,147 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>MyDialog1</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>MyDialog1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>528</width>
+ <height>368</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>MyDialog1</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget8</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>Widget9</cstring>
+ </property>
+ <attribute name="title">
+ <string>Tab</string>
+ </attribute>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>MyDialog1</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-widget b/parts/filecreate/file-templates/ui-widget
new file mode 100644
index 00000000..858b4678
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-widget
@@ -0,0 +1,20 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/file-templates/ui-widget-qt4 b/parts/filecreate/file-templates/ui-widget-qt4
new file mode 100644
index 00000000..2aecd3c9
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-widget-qt4
@@ -0,0 +1,22 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>Form</class>
+ <widget class="QWidget" name="Form" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/parts/filecreate/file-templates/ui-wizard b/parts/filecreate/file-templates/ui-wizard
new file mode 100644
index 00000000..7c68689b
--- /dev/null
+++ b/parts/filecreate/file-templates/ui-wizard
@@ -0,0 +1,28 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>Form1</class>
+<widget class="QWizard">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>page</cstring>
+ </property>
+ <attribute name="title">
+ <string>Page</string>
+ </attribute>
+ </widget>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filecreate/filecreate_filedialog.cpp b/parts/filecreate/filecreate_filedialog.cpp
new file mode 100644
index 00000000..81d711cf
--- /dev/null
+++ b/parts/filecreate/filecreate_filedialog.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 "filecreate_filedialog.h"
+
+#include <qfileinfo.h>
+#include <kdeversion.h>
+#include <kurlcombobox.h>
+#include <kdebug.h>
+
+#include "filecreate_part.h"
+#include "filecreate_filetype.h"
+
+namespace FileCreate {
+
+ FileDialog::FileDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name,
+ bool modal, QWidget * extraWidget) :
+ KFileDialog(startDir, filter, parent, name, modal, extraWidget) {
+
+ setOperationMode(Saving);
+
+ m_extraWidget = extraWidget;
+ m_typeChooser = dynamic_cast<TypeChooser*>(extraWidget);
+
+ connect(this, SIGNAL(filterChanged(const QString &)), this, SLOT(slotActionFilterChanged(const QString &)) );
+ connect(locationEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotActionTextChanged(const QString &)) );
+
+ }
+
+ FileDialog::~FileDialog() { }
+
+
+ void FileDialog::initGUI()
+ {
+ KFileDialog::initGUI();
+ }
+
+ void FileDialog::slotActionFilterChanged(const QString & /*filter*/) {
+ }
+
+ void FileDialog::slotActionTextChanged(const QString & text) {
+ kdDebug(9034) << "slotActionTextChanged - " << text << endl;
+ if (!m_typeChooser) return;
+ QString ext = QFileInfo(text).extension();
+ kdDebug(9034) << "Extension is: " << ext << endl;
+ FileType * filetype = m_typeChooser->part()->getType(ext);
+ if (!filetype) return;
+ kdDebug(9034) << "found matching extension: " << ext << endl;
+ kdDebug(9034) << "Description: " << filetype->descr() << endl;
+ m_typeChooser->setCurrent(filetype);
+ }
+
+
+
+}
+
+#include "filecreate_filedialog.moc"
diff --git a/parts/filecreate/filecreate_filedialog.h b/parts/filecreate/filecreate_filedialog.h
new file mode 100644
index 00000000..04e40111
--- /dev/null
+++ b/parts/filecreate/filecreate_filedialog.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 __KDEVPART_FILECREATE_FILEDIALOG_H__
+#define __KDEVPART_FILECREATE_FILEDIALOG_H__
+
+#include <kfiledialog.h>
+
+#include "filecreate_typechooser.h"
+
+namespace FileCreate {
+
+ class FileDialog : public KFileDialog {
+ Q_OBJECT
+
+ public:
+ FileDialog(const QString& startDir, const QString& filter,
+ QWidget *parent, const char *name,
+ bool modal, QWidget * extraWidget);
+ virtual ~FileDialog();
+
+ virtual void initGUI();
+
+ protected:
+ QWidget * m_extraWidget;
+ TypeChooser * m_typeChooser;
+
+ protected slots:
+ void slotActionFilterChanged(const QString & filter);
+ void slotActionTextChanged(const QString & text);
+
+
+ };
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_filetype.cpp b/parts/filecreate/filecreate_filetype.cpp
new file mode 100644
index 00000000..ca786565
--- /dev/null
+++ b/parts/filecreate/filecreate_filetype.cpp
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 "filecreate_filetype.h"
+
+namespace FileCreate {
+
+void FileType::setSubtypesEnabled(bool enabled) {
+ for(FileType * subtype = m_subtypes.first();
+ subtype;subtype=m_subtypes.next())
+ subtype->setEnabled(enabled);
+}
+
+}
diff --git a/parts/filecreate/filecreate_filetype.h b/parts/filecreate/filecreate_filetype.h
new file mode 100644
index 00000000..9b8e039c
--- /dev/null
+++ b/parts/filecreate/filecreate_filetype.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 __FILECREATE_FILETYPE_H__
+#define __FILECREATE_FILETYPE_H__
+
+#include <qstring.h>
+#include <qptrlist.h>
+
+namespace FileCreate {
+
+class FileType {
+
+public:
+
+ FileType() : m_enabled(false) {
+ m_subtypes.setAutoDelete(true);
+ }
+
+ void setName(const QString & name) { m_name = name; }
+ QString name() const { return m_name; }
+ void setExt(const QString & ext) { m_ext = ext; }
+ QString ext() const { return m_ext; }
+ void setCreateMethod(const QString & createMethod) { m_createMethod = createMethod; }
+ QString createMethod() const { return m_createMethod; }
+ void setSubtypeRef(const QString & subtypeRef) { m_subtypeRef = subtypeRef; }
+ QString subtypeRef() const { return m_subtypeRef; }
+ void setIcon(const QString & iconName) { m_iconName = iconName; }
+ QString icon() const { return m_iconName; }
+ void setDescr(const QString & descr) { m_descr = descr; }
+ QString descr() const { return m_descr; }
+ void setEnabled(bool on) { m_enabled = on; }
+ bool enabled() const { return m_enabled; }
+
+ void setSubtypesEnabled(bool enabled = true);
+
+ void addSubtype(const FileType * subtype) { m_subtypes.append(subtype); }
+ QPtrList<FileType> subtypes() const { return m_subtypes; }
+
+private:
+ QString m_name;
+ QString m_ext;
+ QString m_createMethod;
+ QString m_subtypeRef;
+ QString m_iconName;
+ QString m_descr;
+
+ bool m_enabled;
+
+ QPtrList<FileType> m_subtypes;
+
+};
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_listitem.cpp b/parts/filecreate/filecreate_listitem.cpp
new file mode 100644
index 00000000..4b33514f
--- /dev/null
+++ b/parts/filecreate/filecreate_listitem.cpp
@@ -0,0 +1,101 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * thanks: Roberto Raggi for QSimpleRichText stuff *
+ * *
+ * 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 "filecreate_listitem.h"
+
+#include <kglobal.h>
+#include <kiconloader.h>
+
+#include <qsimplerichtext.h>
+#include <qpixmap.h>
+
+namespace FileCreate {
+
+ ListItem::ListItem(QListView * listview, const FileType * filetype) :
+ KListViewItem(listview), m_filetype(filetype),
+ m_filetypeRenderer(NULL)
+ {
+ init();
+ }
+
+
+ ListItem::ListItem(ListItem * listitem, const FileType * filetype) :
+ KListViewItem(listitem), m_filetype(filetype),
+ m_filetypeRenderer(NULL)
+ {
+ init();
+ }
+
+ ListItem::~ListItem()
+ {
+ if (m_filetypeRenderer) delete m_filetypeRenderer;
+ }
+
+ void ListItem::setup()
+ {
+ if (m_filetypeRenderer) delete m_filetypeRenderer;
+ m_filetypeRenderer = new QSimpleRichText( text(1), listView()->font() );
+ m_filetypeRenderer->setWidth(listView()->columnWidth(1));
+ setHeight(m_filetypeRenderer->height());
+ KListViewItem::setup();
+ }
+
+ void ListItem::setHeight( int height )
+ {
+ KListViewItem::setHeight( QMAX(QMAX(height,m_iconHeight), m_filetypeRenderer->height() ) );
+ }
+
+ void ListItem::prepareResize() {
+ if (m_filetypeRenderer) {
+ m_filetypeRenderer->setWidth(listView()->columnWidth(1));
+ setHeight(m_filetypeRenderer->height());
+ }
+ }
+
+ void ListItem::paintCell( QPainter* p, const QColorGroup& cg, int column, int width, int align )
+ {
+
+ QBrush brush( isSelected() ? cg.highlight() : backgroundColor() );
+
+ if( column == 1 ){
+// m_filetypeRenderer->setWidth(width);
+// setHeight(m_filetypeRenderer->height());
+ m_filetypeRenderer->draw( p, 0, 0, QRect(0, 0, width, height()), cg, &brush );
+ return;
+ }
+
+ KListViewItem::paintCell( p, cg, column, width, align );
+ }
+
+ void ListItem::init()
+ {
+ m_iconHeight = 0;
+ setText(0, m_filetype->ext()!="" ? QString("." + m_filetype->ext()) : QString("") );
+ setText(1, "<qt><b>"+m_filetype->name()+"</b>. " + m_filetype->descr() );
+
+ KIconLoader * loader = KGlobal::iconLoader();
+ QPixmap iconPix = loader->loadIcon(m_filetype->icon(), KIcon::Desktop,
+ KIcon::SizeMedium,
+ KIcon::DefaultState, NULL,
+ true);
+ if (!iconPix.isNull()) {
+ setPixmap(0, iconPix);
+ m_iconHeight = iconPix.height();
+ }
+
+ }
+
+
+
+}
+
+
diff --git a/parts/filecreate/filecreate_listitem.h b/parts/filecreate/filecreate_listitem.h
new file mode 100644
index 00000000..3b2702d3
--- /dev/null
+++ b/parts/filecreate/filecreate_listitem.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * thanks: Roberto Raggi for QSimpleRichText stuff *
+ * *
+ * 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 __FILECREATE_LISTITEM_H__
+#define __FILECREATE_LISTITEM_H__
+
+#include <klistview.h>
+#include <qobject.h>
+
+#include "filecreate_filetype.h"
+
+class QSimpleRichText;
+
+namespace FileCreate {
+
+class ListItem : public KListViewItem {
+
+public:
+ ListItem(QListView *listview, const FileType *filetype);
+ ListItem(ListItem *listitem, const FileType *filetype);
+ virtual ~ListItem();
+
+ const FileType *filetype() const { return m_filetype; }
+
+ virtual void setup();
+ virtual void setHeight( int height );
+ virtual void paintCell( QPainter* p, const QColorGroup& gc, int column, int width, int align );
+ virtual void prepareResize();
+
+private:
+ const FileType *m_filetype;
+ int m_iconHeight;
+ void init();
+ QSimpleRichText *m_filetypeRenderer;
+
+};
+
+}
+
+#endif
+
diff --git a/parts/filecreate/filecreate_newfile.cpp b/parts/filecreate/filecreate_newfile.cpp
new file mode 100644
index 00000000..2077556c
--- /dev/null
+++ b/parts/filecreate/filecreate_newfile.cpp
@@ -0,0 +1,162 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 "filecreate_newfile.h"
+
+#include "filecreate_newfile.moc"
+
+#include <qvbox.h>
+#include <qgrid.h>
+
+#include <qhbox.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qlabel.h>
+#include <klineedit.h>
+#include <kurlrequester.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+
+
+namespace FileCreate {
+
+ NewFileChooser::NewFileChooser(QWidget * parent) :
+ KDialogBase(KDialogBase::Plain, i18n("New file dialog (title)", "New File"), KDialogBase::Ok|KDialogBase::Cancel,
+ KDialogBase::Ok, parent, "New file", true)
+ {
+ QVBoxLayout* lay = new QVBoxLayout( plainPage(), 5, 5 );
+
+ lay->addWidget( new QLabel( i18n("<b>New File Creation</b>"), plainPage() ) );
+
+ QGridLayout* grid = new QGridLayout(lay, 2, 2, 5 );
+ QLabel * l = new QLabel(i18n("&Directory:"), plainPage() );
+ grid->addWidget(l, 0, 0);
+ m_urlreq = new KURLRequester( plainPage(), "url request" );
+ grid->addWidget(m_urlreq, 0, 1);
+ l->setBuddy(m_urlreq);
+ l = new QLabel(i18n("&File name:"), plainPage() );
+ grid->addWidget(l, 1, 0);
+ m_filename = new KLineEdit( plainPage() );
+ grid->addWidget(m_filename, 1, 1);
+ l->setBuddy(m_filename);
+// lay->addWidget( grid );
+
+ QHBoxLayout* hbox = new QHBoxLayout( lay, 5 );
+ m_filetypes = new KComboBox( plainPage(), "combo" );
+ hbox->addWidget(m_filetypes);
+ m_addToProject = new QCheckBox( i18n("Add to project (on checkbox)", "&Add to project"), plainPage(), "addproject" );
+ hbox->addWidget(m_addToProject);
+
+ lay->addStretch(20);
+
+ m_filename->setFocus();
+ m_addToProject->setChecked( true );
+
+ m_urlreq->setMode((int) KFile::Directory);
+ connect( m_filename, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotFileNameChanged(const QString & ) ) );
+ slotFileNameChanged( m_filename->text() );
+ }
+
+ NewFileChooser::~NewFileChooser() {
+ }
+
+ void NewFileChooser::slotFileNameChanged(const QString & _text)
+ {
+ enableButtonOK( !_text.isEmpty() );
+ }
+
+ void NewFileChooser::setFileTypes(QPtrList<FileType> filetypes) {
+ for(FileType * filetype = filetypes.first();
+ filetype;
+ filetype=filetypes.next()) {
+
+ if (filetype->enabled()) {
+
+ if (filetype->subtypes().count()==0)
+ addType(filetype);
+
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ for(FileType * subtype = subtypes.first();
+ subtype;
+ subtype=subtypes.next()) {
+ if (subtype->enabled())
+ addType(subtype);
+
+ }
+
+ }
+
+ }
+
+ }
+
+ KURL NewFileChooser::url() const {
+
+ KURL result ( m_urlreq->url() );
+ result.cd( m_filename->text() );
+ return result;
+ }
+
+ bool NewFileChooser::addToProject() const {
+ return m_addToProject->isChecked();
+ }
+
+ const FileType *NewFileChooser::selectedType() const {
+ if (!m_filetypes->count()) return NULL;
+ return m_typeInCombo[m_filetypes->currentItem()];
+ }
+
+ void NewFileChooser::addType(const FileType * filetype) {
+ m_typeInCombo[m_filetypes->count()]=filetype;
+ m_filetypes->insertItem( filetype->name() +
+ (filetype->ext()!="" ? QString(" (." + filetype->ext() + ")") : QString("") ) );
+ }
+
+ void NewFileChooser::setCurrent(const FileType *filetype) {
+ int changeToRow = -1;
+ QMap<int,const FileType*>::Iterator it;
+ for ( it = m_typeInCombo.begin(); it != m_typeInCombo.end() && changeToRow==-1; ++it ) {
+ if (it.data()==filetype)
+ changeToRow=it.key();
+ }
+ if (changeToRow>-1) m_filetypes->setCurrentItem(changeToRow);
+ }
+
+ void NewFileChooser::setDirectory(const QString & url) {
+ m_urlreq->setURL(url);
+ }
+
+ void NewFileChooser::setName(const QString & name) {
+ m_filename->setText(name);
+ }
+
+ void NewFileChooser::setInProjectMode( bool m )
+ {
+ m_addToProject->setEnabled(m);
+ m_addToProject->setChecked(m);
+ }
+
+ void NewFileChooser::accept()
+ {
+ QString fullPath = url().path();
+ if ( !selectedType()->ext().isEmpty() && !fullPath.endsWith("." + selectedType()->ext())) fullPath+="." + selectedType()->ext();
+ QFileInfo file( fullPath );
+ if ( file.exists() )
+ {
+ KMessageBox::sorry( this, i18n("A file with this name already exists"), i18n("File Exists") );
+ return;
+ }
+ KDialogBase::accept();
+ }
+
+}
+
diff --git a/parts/filecreate/filecreate_newfile.h b/parts/filecreate/filecreate_newfile.h
new file mode 100644
index 00000000..5123c7d9
--- /dev/null
+++ b/parts/filecreate/filecreate_newfile.h
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 FILECREATE_NEWFILE_H
+#define FILECREATE_NEWFILE_H
+
+#include <qptrlist.h>
+#include <qmap.h>
+#include <kurl.h>
+#include <kdialogbase.h>
+
+#include "filecreate_filetype.h"
+
+class KURLRequester;
+class QGridLayout;
+class KComboBox;
+class QCheckBox;
+class KLineEdit;
+
+namespace FileCreate {
+ class NewFileChooser : public KDialogBase {
+ Q_OBJECT
+ public:
+ NewFileChooser(QWidget *parent=0);
+ virtual ~NewFileChooser();
+ void setFileTypes(QPtrList<FileType> typelist);
+ KURL url() const;
+ bool addToProject() const;
+ const FileType *selectedType() const;
+ void setCurrent(const FileType *filetype);
+ void setDirectory(const QString & url);
+ void setName(const QString & name);
+
+ void setInProjectMode(bool m);
+ private slots:
+ void slotFileNameChanged(const QString &);
+ protected:
+ void addType(const FileType * filetype);
+ void accept();
+
+ QGridLayout *m_grid;
+ KURLRequester *m_urlreq;
+ KComboBox *m_filetypes;
+ QCheckBox *m_addToProject;
+ KLineEdit *m_filename;
+
+ QMap<int,const FileType*> m_typeInCombo;
+
+ };
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_part.cpp b/parts/filecreate/filecreate_part.cpp
new file mode 100644
index 00000000..3733753a
--- /dev/null
+++ b/parts/filecreate/filecreate_part.cpp
@@ -0,0 +1,562 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 "filecreate_part.h"
+
+#include <qwhatsthis.h>
+#include <qdom.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qvbox.h>
+#include <qtimer.h>
+
+#include <kdeversion.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kfiledialog.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kstdaction.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kactionclasses.h>
+#include <kpopupmenu.h>
+#include <kmessagebox.h>
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "configwidgetproxy.h"
+
+#include "filetemplate.h"
+#include "domutil.h"
+#include "urlutil.h"
+
+#include "filecreate_widget2.h"
+#include "filecreate_widget3.h"
+#include "filecreate_filetype.h"
+#include "filecreate_filedialog.h"
+#include "filecreate_newfile.h"
+#include "fcconfigwidget.h"
+
+#define PROJECTSETTINGSPAGE 1
+#define GLOBALSETTINGSPAGE 2
+
+#include "kdevplugininfo.h"
+
+#include "config.h"
+
+static const KDevPluginInfo data("kdevfilecreate");
+
+typedef KDevGenericFactory<FileCreatePart> FileCreateFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevfilecreate, FileCreateFactory( data ) )
+
+using namespace FileCreate;
+
+FileCreatePart::FileCreatePart(QObject *parent, const char *name, const QStringList & )
+// : KDevCreateFile(&data, parent, name ? name : "FileCreatePart"), m_selectedWidget(-1), m_useSideTab(true), m_subPopups(0)
+ : KDevCreateFile(&data, parent, name ? name : "FileCreatePart"), m_subPopups(0)
+{
+ setInstance(FileCreateFactory::instance());
+ setXMLFile("kdevpart_filecreate.rc");
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("File Templates"), PROJECTSETTINGSPAGE, info()->icon() );
+ _configProxy->createGlobalConfigPage( i18n("File Templates"), GLOBALSETTINGSPAGE, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+
+ KToolBarPopupAction * newAction = new KToolBarPopupAction( i18n("&New"), "filenew", CTRL+Qt::Key_N, this, SLOT(slotNewFile()), actionCollection(), "file_new");
+ newAction->setWhatsThis( i18n("<b>New file</b><p>Creates a new file. Also adds it the project if the <b>Add to project</b> checkbox is turned on.") );
+ newAction->setToolTip( i18n("Create a new file") );
+ m_newPopupMenu = newAction->popupMenu();
+ connect(m_newPopupMenu, SIGNAL(aboutToShow()), this, SLOT(slotAboutToShowNewPopupMenu()));
+
+ QTimer::singleShot( 0, this, SLOT(slotGlobalInitialize()) );
+}
+
+
+FileCreatePart::~FileCreatePart()
+{
+ delete _configProxy;
+
+ m_newPopupMenu->clear();
+ delete m_subPopups;
+}
+
+void FileCreatePart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ kdDebug() << k_funcinfo << endl;
+
+ switch( pagenumber )
+ {
+ case PROJECTSETTINGSPAGE:
+ {
+ FCConfigWidget* w = new FCConfigWidget( this, false, page, "filecreate config widget" );
+ connect( dlg, SIGNAL( okClicked( ) ), w, SLOT( accept( ) ) );
+ }
+ break;
+
+ case GLOBALSETTINGSPAGE:
+ {
+ FCConfigWidget *w = new FCConfigWidget( this, true, page, "filecreate config widget" );
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ }
+ break;
+ }
+}
+
+void FileCreatePart::slotAboutToShowNewPopupMenu()
+{
+ KIconLoader * m_iconLoader = KGlobal::iconLoader();
+ m_newPopupMenu->clear();
+ delete m_subPopups;
+ m_subPopups = NULL;
+ int id = 0;
+ FileType * filetype = m_filetypes.first();
+ for(; filetype; filetype=m_filetypes.next())
+ {
+ if (filetype->enabled())
+ {
+ if (filetype->subtypes().count()==0)
+ {
+ QPixmap iconPix = m_iconLoader->loadIcon(
+ filetype->icon(), KIcon::Desktop, KIcon::SizeSmall,
+ KIcon::DefaultState, NULL, true);
+ m_newPopupMenu->insertItem(iconPix, filetype->name(), this,
+ SLOT(slotNewFilePopup(int)), 0, ++id );
+ m_newPopupMenu->setItemParameter( id, (long)filetype );
+ } else
+ {
+ KPopupMenu* subMenu = NULL;
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ for(FileType * subtype = subtypes.first(); subtype; subtype=subtypes.next())
+ {
+ if (subtype->enabled()){
+ if( !subMenu )
+ subMenu = new KPopupMenu(0,0);
+ QPixmap iconPix = m_iconLoader->loadIcon(
+ subtype->icon(), KIcon::Desktop, KIcon::SizeSmall,
+ KIcon::DefaultState, NULL, true);
+ subMenu->insertItem(iconPix, subtype->name(), this,
+ SLOT(slotNewFilePopup(int)), 0, ++id );
+ subMenu->setItemParameter( id, (long)subtype );
+ }
+ }
+ if( subMenu )
+ {
+ if( !m_subPopups )
+ {
+ m_subPopups = new QPtrList<KPopupMenu>;
+ m_subPopups->setAutoDelete(true);
+ }
+ m_subPopups->append( subMenu );
+ m_newPopupMenu->insertItem( filetype->name(), subMenu );
+ }
+ }
+
+ }
+
+ }
+}
+
+void FileCreatePart::slotNewFilePopup( int pFileType )
+{
+ const FileType* filetype = (const FileType*) pFileType;
+ slotFiletypeSelected( filetype );
+}
+
+void FileCreatePart::slotNewFile() {
+ KDevCreateFile::CreatedFile createdFile = createNewFile();
+ if (createdFile.status == KDevCreateFile::CreatedFile::STATUS_NOTCREATED)
+ KMessageBox::error(0, i18n("Cannot create file. Check whether the directory and filename are valid."));
+ else if (createdFile.status != KDevCreateFile::CreatedFile::STATUS_CANCELED)
+ openCreatedFile(createdFile);
+}
+
+void FileCreatePart::slotProjectOpened() {
+ QTimer::singleShot( 0, this, SLOT(slotInitialize()) );
+}
+
+void FileCreatePart::addFileType(const QString & filename) {
+ FileType * filetype = getType(filename);
+ if (!filetype) {
+ filetype = new FileType;
+ filetype->setName( filename + " files" );
+ filetype->setExt( filename );
+ filetype->setCreateMethod("template");
+ m_filetypes.append(filetype);
+ }
+ filetype->setEnabled(true);
+}
+
+void FileCreatePart::slotProjectClosed() {
+ m_filetypes.clear();
+ QTimer::singleShot( 0, this, SLOT(slotGlobalInitialize()) );
+}
+
+void FileCreatePart::slotFiletypeSelected(const FileType * filetype) {
+
+ KDevCreateFile::CreatedFile createdFile = createNewFile(filetype->ext(),
+ QString::null,
+ QString::null,
+ filetype->subtypeRef());
+
+ openCreatedFile(createdFile);
+}
+
+void FileCreatePart::openCreatedFile(const KDevCreateFile::CreatedFile & createdFile)
+{
+ if ( createdFile.status == KDevCreateFile::CreatedFile::STATUS_OK )
+ {
+ KURL uu( createdFile.dir + "/" + createdFile.filename );
+ partController()->editDocument ( uu );
+ }
+}
+
+int FileCreatePart::readTypes(const QDomDocument & dom, QPtrList<FileType> &m_filetypes, bool enable) {
+ int numRead = 0;
+ QDomElement fileTypes = DomUtil::elementByPath(dom,"/kdevfilecreate/filetypes");
+ if (!fileTypes.isNull()) {
+ for(QDomNode node = fileTypes.firstChild();!node.isNull();node=node.nextSibling()) {
+
+ if (node.isElement() && node.nodeName()=="type") {
+ QDomElement element = node.toElement();
+ FileType * filetype = new FileType;
+ filetype->setName( element.attribute("name") );
+ filetype->setExt( element.attribute("ext") );
+ filetype->setCreateMethod( element.attribute("create") );
+
+ filetype->setIcon( element.attribute("icon") );
+ filetype->setDescr( (DomUtil::namedChildElement(element, "descr")).text() );
+ filetype->setEnabled(enable || (filetype->ext()==""));
+ m_filetypes.append(filetype);
+ numRead++;
+
+ kdDebug(9034) << "node: " << filetype->name().latin1() << endl;
+
+ if (node.hasChildNodes()) {
+ for(QDomNode subnode = node.firstChild();!subnode.isNull();subnode=subnode.nextSibling()) {
+ kdDebug(9034) << "subnode: " << subnode.nodeName().latin1() << endl;
+ if (subnode.isElement() && subnode.nodeName()=="subtype") {
+ QDomElement subelement = subnode.toElement();
+ FileType * subtype = new FileType;
+ subtype->setExt( filetype->ext() );
+ subtype->setCreateMethod( filetype->createMethod() );
+ subtype->setSubtypeRef( subelement.attribute("ref") );
+ subtype->setIcon( subelement.attribute("icon") );
+ subtype->setName( subelement.attribute("name") );
+ subtype->setDescr( (DomUtil::namedChildElement(subelement, "descr")).text() );
+ subtype->setEnabled(enable);
+ filetype->addSubtype(subtype);
+ }
+ }
+ }
+ }
+ }
+ }
+ return numRead;
+}
+
+FileType * FileCreatePart::getType(const QString & ex, const QString subtRef) {
+
+ QString subtypeRef = subtRef;
+ QString ext = ex;
+ int dashPos = ext.find('-');
+ if (dashPos>-1 && subtRef.isNull()) {
+ ext = ex.left(dashPos);
+ subtypeRef = ex.mid(dashPos+1);
+ }
+
+ QPtrList<FileType> filetypes = getFileTypes();
+ for(FileType * filetype = filetypes.first();
+ filetype;
+ filetype=filetypes.next()) {
+ if (filetype->ext()==ext) {
+ if (subtypeRef.isNull()) return filetype;
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ for(FileType * subtype = subtypes.first();
+ subtype;
+ subtype=subtypes.next()) {
+ if (subtypeRef==subtype->subtypeRef()) return subtype;
+ }
+ }
+ }
+ return NULL;
+}
+
+FileType * FileCreatePart::getEnabledType(const QString & ex, const QString subtRef) {
+
+ QString subtypeRef = subtRef;
+ QString ext = ex;
+ int dashPos = ext.find('-');
+ if (dashPos>-1 && subtRef.isNull()) {
+ ext = ex.left(dashPos);
+ subtypeRef = ex.mid(dashPos+1);
+ }
+
+ QPtrList<FileType> filetypes = getFileTypes();
+ for(FileType * filetype = filetypes.first();
+ filetype;
+ filetype=filetypes.next()) {
+ if (filetype->ext()==ext) {
+ if ( (subtypeRef.isNull()) && (filetype->enabled()) ) return filetype;
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ for(FileType * subtype = subtypes.first();
+ subtype;
+ subtype=subtypes.next()) {
+ if ( (subtypeRef==subtype->subtypeRef()) && (filetype->enabled()) ) return subtype;
+ }
+ }
+ }
+ return NULL;
+}
+
+// KDevFileCreate interface
+
+KDevCreateFile::CreatedFile FileCreatePart::createNewFile(QString ext, QString dir, QString name, QString subtype)
+{
+ KDevCreateFile::CreatedFile result;
+
+ KURL projectURL;
+ if ( !project() )
+ {
+ //result.status = KDevCreateFile::CreatedFile::STATUS_NOTCREATED;
+ //return result;
+ }
+ else
+ {
+ projectURL = project()->projectDirectory();
+ }
+
+ KURL selectedURL;
+
+ NewFileChooser dialog;
+ dialog.setFileTypes(m_filetypes);
+ const FileType *filetype = getEnabledType(ext,subtype);
+ kdDebug(9034) << "Looking for filetype pointer for " << ext << "/" << subtype << endl;
+ if (filetype) {
+ kdDebug(9034) << "found filetype" << endl;
+ } else {
+ kdDebug(9034) << "could not find filetype" << endl;
+ }
+ if (!project())
+ dialog.setInProjectMode(false);
+
+ if (!dir.isNull())
+ dialog.setDirectory(dir);
+ else if (!project())
+ dialog.setDirectory(QDir::currentDirPath());
+ else
+ {
+ QString activeDir = project()->activeDirectory();
+ dialog.setDirectory( project()->projectDirectory() +
+ ( activeDir[0] == '/' ? "" : "/" )
+ + activeDir );
+ }
+ if (!name.isNull()) dialog.setName(name);
+ if (filetype) dialog.setCurrent(filetype);
+
+ dialog.setInitialSize(QSize(500, 200));
+ int dialogResult = dialog.exec();
+
+ if (dialogResult == KDialogBase::Rejected) {
+ result.status = KDevCreateFile::CreatedFile::STATUS_CANCELED;
+ return result;
+ }
+
+ // OK was pressed
+
+ result.addToProject = dialog.addToProject();
+ selectedURL = dialog.url();
+ const FileType *selectedFileType = dialog.selectedType();
+
+ if (dialog.addToProject() && !projectURL.isParentOf(selectedURL) && !(project()->options() & KDevProject::UsesQMakeBuildSystem) ) {
+ result.status = KDevCreateFile::CreatedFile::STATUS_NOTWITHINPROJECT;
+ return result;
+ }
+
+ if (selectedFileType) {
+ ext = selectedFileType->ext();
+ subtype = selectedFileType->subtypeRef();
+ }
+
+ QString fullPath = selectedURL.path();
+ // add appropriate extension, if not already there
+ if ( !ext.isEmpty() && !fullPath.endsWith("." + ext)) fullPath+="." + ext;
+
+ QString filename = URLUtil::filename(fullPath);
+ kdDebug(9034) << "full path = " << fullPath << endl;
+
+ // add in subtype, if specified
+ if (!subtype.isEmpty())
+ ext += "-" + subtype;
+
+ // create file from template
+ bool created = false;
+ if (FileTemplate::exists(this, ext))
+ created = FileTemplate::copy(this, ext, fullPath);
+ else {
+ // no template, create a blank file instead
+ QFile f(fullPath);
+ created = f.open( IO_WriteOnly );
+ f.close();
+ }
+ if (!created)
+ {
+ result.status = KDevCreateFile::CreatedFile::STATUS_NOTCREATED;
+ return result;
+ }
+
+ if (dialog.addToProject())
+ {
+ // work out the path relative to the project directory
+// QString relToProj = URLUtil::relativePath(projectURL, selectedURL, URLUtil::SLASH_PREFIX );
+ QString relToProj;
+ if( project()->options() & KDevProject::UsesQMakeBuildSystem )
+ {
+ relToProj = URLUtil::relativePathToFile( project()->projectDirectory(), fullPath );
+ project()->addFile(relToProj);
+ }else
+ {
+ relToProj = URLUtil::relativePath(projectURL.path(), fullPath, URLUtil::SLASH_PREFIX );
+ project()->addFile(relToProj.mid(1));
+ }
+ }
+
+ KURL url;
+ url.setPath(fullPath);
+ partController()->editDocument(url);
+
+ QString fileName = URLUtil::filename(fullPath);
+ kdDebug(9034) << "file name = " << filename << endl;
+
+ result.filename = fileName;
+ result.dir = URLUtil::directory(fullPath);
+ result.status = KDevCreateFile::CreatedFile::STATUS_OK;
+
+ return result;
+}
+
+void FileCreatePart::slotNoteFiletype(const FileType * filetype) {
+ kdDebug(9034) << "Noting file type: " << (filetype ? filetype->ext() : QString::fromLatin1("Null") ) << endl;
+ m_filedialogFiletype = filetype;
+}
+
+void FileCreatePart::slotInitialize( )
+{
+ m_filetypes.clear();
+
+ //read global configuration
+ slotGlobalInitialize();
+
+ // read in which global templates are to be used for this project
+ QDomElement useGlobalTypes =
+ DomUtil::elementByPath(*projectDom(),"/kdevfilecreate/useglobaltypes");
+ for(QDomNode node = useGlobalTypes.firstChild();
+ !node.isNull();node=node.nextSibling()) {
+
+ if (node.isElement() && node.nodeName()=="type") {
+ QDomElement element = node.toElement();
+ QString ext = element.attribute("ext");
+ QString subtyperef = element.attribute("subtyperef");
+ // if an extension has been specified as enabled, ensure it
+ // and all its subtypes are enabled
+ if (subtyperef.isNull()) {
+ FileType * filetype = getType(ext);
+ if (filetype) {
+ filetype->setEnabled(true);
+ if (filetype->subtypes().count())
+ filetype->setSubtypesEnabled(true);
+ }
+ } else {
+ // if an extension + subtype have been specified, enable
+ // the subtype and the extension (the 'parent')
+ FileType * filetype = getType(ext);
+ FileType * subtype = getType(ext,subtyperef);
+ if (filetype && subtype) {
+ filetype->setEnabled(true);
+ subtype->setEnabled(true);
+ }
+ }
+ }
+ }
+
+ // read in the list of file types for this project
+ if ( project() && readTypes( *projectDom(), m_filetypes, true )==0 ) {
+ // default by scanning the templates directory if no template info
+ // found in project file
+ QDir templDir( project()->projectDirectory() + "/templates/" );
+ if (templDir.exists()) {
+ templDir.setFilter( QDir::Files );
+ const QFileInfoList * list = templDir.entryInfoList();
+ if( list ){
+ QFileInfoListIterator it( *list );
+ QFileInfo *fi;
+ while ( (fi = it.current()) != 0 ) {
+ addFileType(fi->fileName());
+ ++it;
+ }
+ }
+ }
+/* else { // it was probably an imported project
+ // KLUDGE: we need a better way to determine file types
+ // the current method looks a bit too restrictive
+ addFileType( "cpp" );
+ addFileType( "h" );
+ }*/
+ }
+}
+
+QString FileCreatePart::findGlobalXMLFile() const
+{
+ int version = 0;
+ QString filename;
+ QStringList filenames = KGlobal::instance()->dirs()->findAllResources("data", "kdevfilecreate/template-info.xml");
+ for( QStringList::const_iterator it = filenames.begin(); it != filenames.end(); ++it )
+ {
+ QDomDocument globalDom;
+ DomUtil::openDOMFile(globalDom,*it);
+ QDomElement e = globalDom.documentElement();
+ if( !e.hasAttribute( "version" ) && e.attribute( "version" ).toInt() < version )
+ {
+ continue;
+ }else
+ {
+ version = e.attribute( "version" ).toInt();
+ filename = *it;
+ }
+ }
+ return filename;
+}
+
+void FileCreatePart::slotGlobalInitialize( )
+{
+ // read in global template information
+ QString globalXMLFile = findGlobalXMLFile();
+ kdDebug(9034) << "Found global template info info " << globalXMLFile << endl;
+ QDomDocument globalDom;
+ if (!globalXMLFile.isNull() && DomUtil::openDOMFile(globalDom,globalXMLFile))
+ {
+ kdDebug(9034) << "Reading global template info..." << endl;
+
+ readTypes(globalDom, m_filetypes, false);
+
+ }
+}
+
+#include "filecreate_part.moc"
+
+// kate: indent-width 2; replace-tabs on; tab-width 4; space-indent on;
diff --git a/parts/filecreate/filecreate_part.h b/parts/filecreate/filecreate_part.h
new file mode 100644
index 00000000..3cbc9909
--- /dev/null
+++ b/parts/filecreate/filecreate_part.h
@@ -0,0 +1,144 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 __KDEVPART_FILECREATE_H__
+#define __KDEVPART_FILECREATE_H__
+
+
+#include <qguardedptr.h>
+#include <qptrlist.h>
+
+#include <qwidget.h>
+#include <kdevplugin.h>
+#include <kdevcreatefile.h>
+
+#include "filecreate_typechooser.h"
+
+class KPopupMenu;
+
+namespace FileCreate {
+ class Widget;
+ class FileType;
+}
+
+class KDialogBase;
+class FCConfigWidget;
+class ConfigWidgetProxy;
+
+using namespace FileCreate;
+
+class FileCreatePart : public KDevCreateFile
+{
+ Q_OBJECT
+
+ friend class FCConfigWidget;
+public:
+ FileCreatePart(QObject *parent, const char *name, const QStringList &);
+ virtual ~FileCreatePart();
+
+ /**
+ * Returns the list of available file types.
+ */
+ QPtrList<FileType> getFileTypes() const { return m_filetypes; }
+
+ /**
+ * Call this method to create a new file, within or without the project. Supply as
+ * much information as you know. Leave what you don't know as QString::null.
+ * The user will be prompted as necessary for the missing information, and the
+ * file created, and added to the project as necessary.
+ */
+ virtual KDevCreateFile::CreatedFile createNewFile(QString ext = QString::null,
+ QString dir = QString::null,
+ QString name = QString::null,
+ QString subtype = QString::null);
+
+ /**
+ * Finds the file type object for a given extension and optionally subtype.
+ * You can omit the subtype and specify the extension as ext-subtype if you wish.
+ */
+ FileType * getType(const QString & ext, const QString subtype = QString::null);
+ /**
+ * Finds the file type object for a given extension and optionally subtype.
+ * You can omit the subtype and specify the extension as ext-subtype if you wish.
+ * Returns only enabled type (i.e. used in the project).
+ */
+ FileType * getEnabledType(const QString & ext, const QString subtype = QString::null);
+
+public slots:
+
+ void slotProjectOpened();
+ void slotProjectClosed();
+ void slotInitialize();
+ void slotGlobalInitialize();
+
+ /**
+ * Called when a file type is selected from the docked widget.
+ */
+ void slotFiletypeSelected(const FileType *);
+
+ /**
+ * Called when a new file is required - for example, from the "New.." menu action.
+ */
+ void slotNewFile();
+
+ /**
+ * Called from KToolBarPopupMenu to request a new file action
+ * @param pFileType is acutally a pointer to FileType
+ */
+ void slotNewFilePopup(int pFileType);
+
+protected slots:
+ void slotNoteFiletype(const FileType * filetype);
+ void slotAboutToShowNewPopupMenu();
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int );
+
+private:
+ /**
+ * If a file has been successfully created, open it
+ */
+ void openCreatedFile(const KDevCreateFile::CreatedFile & createdFile);
+
+ /**
+ * Reads in file type definitions from a config DOM and adds them
+ * to the file type list. If enable is true, sets them all to
+ * enabled=true by default.
+ */
+ int readTypes(const QDomDocument & dom, QPtrList<FileType> &m_filetypes, bool enable);
+
+ /**
+ * Add a file type
+ */
+ void addFileType(const QString & filename);
+
+ /**
+ * Finds the global XML file that has the same version as KDevelop
+ */
+ QString findGlobalXMLFile() const;
+
+ /**
+ * List of file types from which the user can choose
+ */
+ QPtrList<FileType> m_filetypes;
+
+ /**
+ * The file type selected by the new file dialog, if appropriate.
+ */
+ const FileType * m_filedialogFiletype;
+
+ ConfigWidgetProxy * _configProxy;
+
+ KPopupMenu* m_newPopupMenu;
+ QPtrList<KPopupMenu>* m_subPopups;
+};
+
+
+#endif
diff --git a/parts/filecreate/filecreate_typechooser.h b/parts/filecreate/filecreate_typechooser.h
new file mode 100644
index 00000000..8e1e37e8
--- /dev/null
+++ b/parts/filecreate/filecreate_typechooser.h
@@ -0,0 +1,47 @@
+#ifndef __FILECREATE_TYPECHOOSER_H__
+#define __FILECREATE_TYPECHOOSER_H__
+
+#include "filecreate_typechoosersig.h"
+
+#include <kdebug.h>
+
+class FileCreatePart;
+
+namespace FileCreate {
+
+class FileType;
+
+class TypeChooser {
+
+public:
+
+ TypeChooser(FileCreatePart * part) : m_part(part), m_current(NULL) {
+ m_signaller = new Signaller;
+ }
+ virtual ~TypeChooser() { delete m_signaller; }
+
+ virtual void setPart(FileCreatePart * part) { m_part = part; }
+ virtual FileCreatePart * part() const { return m_part; }
+ virtual void refresh() = 0;
+ virtual void setCurrent(const FileType * current) = 0;
+ virtual const FileType * current() const { return m_current; }
+
+ virtual void filetypeSelected(const FileType * filetype) {
+ m_current = filetype;
+ kdDebug(9034) << "type selected: about to signal" << endl;
+ if (filetype) m_signaller->signal(filetype);
+ kdDebug(9034) << "type selected: done signal" << endl;
+ }
+
+ const Signaller * signaller() const { return m_signaller; }
+
+protected:
+ FileCreatePart * m_part;
+ Signaller * m_signaller;
+ const FileType * m_current;
+
+};
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_typechoosersig.h b/parts/filecreate/filecreate_typechoosersig.h
new file mode 100644
index 00000000..7f16208a
--- /dev/null
+++ b/parts/filecreate/filecreate_typechoosersig.h
@@ -0,0 +1,28 @@
+#ifndef __FILECREATE_TYPECHOOSERSIG_H__
+#define __FILECREATE_TYPECHOOSERSIG_H__
+
+#include <qobject.h>
+
+namespace FileCreate {
+
+class FileType;
+
+class Signaller : public QObject {
+ Q_OBJECT
+
+public:
+ Signaller() : QObject() { }
+ virtual ~Signaller() { }
+
+ virtual void signal(const FileType * filetype ) {
+ emit filetypeSelected(filetype);
+ }
+
+
+signals:
+ void filetypeSelected(const FileType * filetype);
+};
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_widget2.cpp b/parts/filecreate/filecreate_widget2.cpp
new file mode 100644
index 00000000..c8e6d051
--- /dev/null
+++ b/parts/filecreate/filecreate_widget2.cpp
@@ -0,0 +1,228 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 <qptrlist.h>
+#include <qtimer.h>
+#include <qwhatsthis.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include <kdevcore.h>
+
+#include "kdevproject.h"
+#include "filecreate_part.h"
+#include "filecreate_widget2.h"
+#include "filecreate_filetype.h"
+#include "filecreate_listitem.h"
+
+namespace FileCreate {
+
+ FriendlyWidget::FriendlyWidget(FileCreatePart *part)
+ : QTable(0,4,0), TypeChooser(part), m_selected(NULL)
+ {
+
+ setReadOnly(true);
+ setShowGrid(false);
+ horizontalHeader()->hide();
+ setTopMargin(0);
+ verticalHeader()->hide();
+ setLeftMargin(0);
+ setSelectionMode(SingleRow);
+ setFocusStyle(FollowStyle);
+ setColumnStretchable(3, true);
+
+ m_iconLoader = KGlobal::iconLoader();
+
+ QWhatsThis::add(this, i18n("Use this to create new files within your project."));
+
+ setDefaultColumnWidths();
+
+ }
+
+
+ FriendlyWidget::~FriendlyWidget()
+ {
+ }
+
+ void FriendlyWidget::setCurrent(const FileType * current) {
+ int changeToRow = -1;
+ QMap<int,FileType*>::Iterator it;
+ kdDebug(9034) << "Checking " << current->descr() << " for matches in row..." << endl;
+ for ( it = typeForRow.begin(); it != typeForRow.end() && changeToRow==-1; ++it ) {
+ kdDebug(9034) << "Checking: " << it.data()->descr() << endl;
+ if (it.data()==current)
+ changeToRow=it.key();
+ else kdDebug(9034) << "No match!" << endl;
+ }
+
+ // If an exact match is not found (e.g. current points to a 'parent' type) then
+ // look instead for an extension match
+ if (changeToRow==-1) {
+ for(it = typeForRow.begin(); it!= typeForRow.end() && changeToRow==-1; ++it) {
+ if (it.data()->ext() == current->ext() )
+ changeToRow = it.key();
+ }
+ }
+
+ if (changeToRow!=-1) {
+ m_current = current;
+ kdDebug(9034) << "Found row, setting current to row " << changeToRow << endl;
+ slotCellSelected(changeToRow,0);
+ clearSelection();
+ selectRow(changeToRow);
+ }
+
+ }
+
+ void FriendlyWidget::refresh() {
+
+ disconnect( this, SIGNAL(currentChanged(int,int)), this, SLOT(slotCellSelected(int,int)) );
+
+ empty();
+
+ int row = 0;
+ QPtrList<FileType> filetypes = m_part->getFileTypes();
+ for(FileType * filetype = filetypes.first();
+ filetype;
+ filetype=filetypes.next()) {
+
+ if (filetype->enabled()) {
+
+ if (filetype->subtypes().count()==0)
+ setRow(row++, filetype);
+
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ for(FileType * subtype = subtypes.first();
+ subtype;
+ subtype=subtypes.next()) {
+ if (subtype->enabled())
+ setRow(row++, subtype);
+ }
+
+ }
+
+ }
+ resizeCells();
+ if (currentSelection()>-1) removeSelection(currentSelection());
+
+ connect( this, SIGNAL(currentChanged(int,int)), this, SLOT(slotCellSelected(int,int)) );
+
+
+ }
+
+ void FriendlyWidget::setRow(int row, FileType * filetype) {
+ if (row+1>numRows()) setNumRows(row+1);
+ setText(row, 1, filetype->name() );
+ setText(row, 2, filetype->ext() );
+ setText(row, 3, filetype->descr() );
+ item(row,1)->setWordWrap(true);
+ item(row,3)->setWordWrap(true);
+ //setRowStretchable(row,true);
+ QPixmap iconPix = m_iconLoader->loadIcon(filetype->icon(), KIcon::Desktop, KIcon::SizeMedium,
+ KIcon::DefaultState, NULL,
+ true);
+ if (!iconPix.isNull()) {
+ setPixmap(row, 0, iconPix);
+ setRowHeight(row, iconPix.height()+4 );
+ if (iconPix.width()+4>columnWidth(0))
+ setColumnWidth(0, iconPix.width()+4 );
+ }
+
+ typeForRow[row]=filetype;
+
+ }
+
+ void FriendlyWidget::empty() {
+ typeForRow.clear();
+ while(numRows()) removeRow(0);
+ }
+
+ void FriendlyWidget::setDefaultColumnWidths() {
+ // set some defaults - resizeCells will later ensure that column widths
+ // and row heights are set big enough for the cell contents
+ setColumnWidth(0,1);
+ setColumnWidth(1,60);
+ setColumnWidth(2,30);
+ setColumnWidth(3,150);
+ }
+
+ void FriendlyWidget::slotCellSelected(int row, int col) {
+ if (col!=0) {
+ setCurrentCell(row, 0);
+ return;
+ }
+
+ m_selected = typeForRow.contains(row) ? typeForRow[row] : NULL;
+ QTimer::singleShot(0, this, SLOT(slotDoSelection()) );
+
+ }
+
+ void FriendlyWidget::slotDoSelection() {
+ kdDebug(9034) << "widget2: slotDoSelection" << endl;
+ if (m_selected) filetypeSelected(m_selected);
+ kdDebug(9034) << "widget2: slotDoSelection middle" << endl;
+ if (currentSelection()>-1) removeSelection(currentSelection());
+ kdDebug(9034) << "widget2: slotDoSelection ending" << endl;
+ }
+
+ void FriendlyWidget::resizeCells() {
+ for(int r=0;r<numRows();r++) resizeRow(r);
+ for(int c=0;c<numCols();c++) resizeColumn(c);
+ }
+
+ void FriendlyWidget::resizeRow(int row) {
+ if (row>=numRows() || row<0) return;
+ int maxHeight = 0;
+
+ for(int c=0;c<numCols();c++) {
+ QTableItem* i = item( row, c );
+ if( !i )
+ continue;
+
+ QSize size = i->sizeHint();
+ maxHeight = size.height()>maxHeight ? size.height() : maxHeight;
+ }
+ setRowHeight(row,maxHeight+2); // bit of extra room
+ }
+
+ void FriendlyWidget::resizeColumn(int col) {
+ if (col>=numCols() || col<0) return;
+ int maxWidth = 0;
+ for(int r=0;r<numRows();r++) {
+
+ QTableItem* i = item( r, col );
+ if( !i )
+ continue;
+
+ QSize size = item(r,col)->sizeHint();
+ maxWidth = size.width()>maxWidth ? size.width() : maxWidth;
+ }
+ setColumnWidth(col,maxWidth+2); // bit of extra room
+ }
+
+#if QT_VERSION < 0x030100
+ void FriendlyWidget::selectRow(int row) {
+ if (numCols()>0 && row<numRows()) {
+ QTableSelection sel;
+ sel.init(row,0);
+ sel.expandTo(row,numCols());
+ addSelection(sel);
+ }
+ }
+#endif
+
+}
+
+#include "filecreate_widget2.moc"
diff --git a/parts/filecreate/filecreate_widget2.h b/parts/filecreate/filecreate_widget2.h
new file mode 100644
index 00000000..8b3d14e8
--- /dev/null
+++ b/parts/filecreate/filecreate_widget2.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 __FILECREATE_WIDGET2_H__
+#define __FILECREATE_WIDGET2_H__
+
+#include <kdeversion.h>
+#include <qtable.h>
+#include <qstring.h>
+#include <qmap.h>
+
+//#include <klistview.h>
+
+#include "filecreate_typechooser.h"
+
+class KIconLoader;
+class KDevProject;
+class FileCreatePart;
+
+namespace FileCreate {
+
+ class FileType;
+
+ class FriendlyWidget : public QTable, public TypeChooser
+ {
+ Q_OBJECT
+
+ public:
+
+ FriendlyWidget(FileCreatePart *part);
+ virtual ~FriendlyWidget();
+
+ /**
+ * Refreshes the widget with the part's file type list.
+ */
+ virtual void refresh();
+ /**
+ * Sets the currently highlighted file type.
+ */
+ virtual void setCurrent(const FileType * current);
+
+#if QT_VERSION < 0x030100
+ void selectRow(int row);
+#endif
+
+ protected:
+ /**
+ * Sets row <i>row</i> to filetype <i>filetype</i>.
+ */
+ virtual void setRow(int row, FileType * filetype);
+ /**
+ * Clears the table.
+ */
+ virtual void empty();
+ /**
+ * Sets some default column widths.
+ */
+ virtual void setDefaultColumnWidths();
+ /**
+ * Scans the cells in the table and adjusts their size based
+ * on their contents.
+ */
+ virtual void resizeCells();
+ /**
+ * Sets the height of a row to the highest
+ * cell in the row.
+ */
+ virtual void resizeRow(int row);
+ /**
+ * Sets the width of a column to the widest
+ * cell in the column.
+ */
+ virtual void resizeColumn(int col);
+
+ /**
+ * The default icon loader, here for convenience.
+ */
+ KIconLoader * m_iconLoader;
+ /**
+ * A mapping of each row number to a file type.
+ */
+ QMap<int,FileType*> typeForRow;
+ /**
+ * The currently selected file type, or null if none.
+ */
+ FileType * m_selected;
+
+ protected slots:
+ /**
+ * When a cell is selected by the user.
+ */
+ virtual void slotCellSelected(int row, int col);
+ /**
+ * Invoked as a single shot after slotCellSelected, with m_selected
+ * set to the selected file type, so that
+ * the GUI will be updated before the selection event
+ * takes place.
+ */
+ virtual void slotDoSelection();
+
+
+ };
+
+}
+
+#endif
diff --git a/parts/filecreate/filecreate_widget3.cpp b/parts/filecreate/filecreate_widget3.cpp
new file mode 100644
index 00000000..f766cbcf
--- /dev/null
+++ b/parts/filecreate/filecreate_widget3.cpp
@@ -0,0 +1,119 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * thanks: Roberto Raggi for QSimpleRichText stuff *
+ * *
+ * 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 <qptrlist.h>
+#include <qwhatsthis.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdevcore.h>
+
+#include "filecreate_widget3.h"
+
+#include "kdevproject.h"
+#include "filecreate_part.h"
+#include "filecreate_filetype.h"
+#include "filecreate_listitem.h"
+
+namespace FileCreate {
+
+ ListWidget::ListWidget(FileCreatePart *part)
+ : KListView(0, "KDevFileCreate"), TypeChooser(part)
+ {
+ setIcon( SmallIcon("filenew2") );
+ setCaption(i18n("File Create"));
+ setResizeMode( AllColumns );
+ setAllColumnsShowFocus(true);
+ setRootIsDecorated(true);
+
+ addColumn("");
+ addColumn("");
+
+ QWhatsThis::add(this, i18n("<b>New file</b><p>This part makes the creation of new files easier. Select a type in the list to create a file. "
+ "The list of project file types can be configured in project settings dialog, <b>New File Wizard</b> tab. "
+ "Globally available file types are listed and can be configured in KDevelop settings dialog, <b>New File Wizard</b> tab."));
+
+
+ connect( this, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotTypeSelected(QListViewItem*)) );
+ }
+
+
+ ListWidget::~ListWidget()
+ {
+ }
+
+ void ListWidget::setCurrent(const FileType * current) {
+
+ bool found = false;
+ QListViewItem * lvi = firstChild();
+ while(lvi && !found) {
+ ListItem * li = dynamic_cast<ListItem*>(lvi);
+ if (li) {
+ if (li->filetype()==current) {
+ found=true;
+ setSelected(li,true);
+ }
+ }
+ if (lvi->nextSibling())
+ lvi = lvi->nextSibling();
+ else {
+ while (lvi && !lvi->nextSibling())
+ lvi = lvi->parent();
+ }
+ }
+
+ }
+
+ void ListWidget::resizeEvent(QResizeEvent *event) {
+ ListItem *li = dynamic_cast<ListItem*>(firstChild());
+ while(li) {
+ li->prepareResize();
+ li = dynamic_cast<ListItem*>(li->nextSibling());
+ }
+ KListView::resizeEvent(event);
+ }
+
+ void ListWidget::refresh() {
+ clear();
+ QPtrList<FileType> filetypes = m_part->getFileTypes();
+ for(FileType * filetype = filetypes.first();
+ filetype!=NULL;
+ filetype=filetypes.next()) {
+ if (filetype->enabled()) {
+ QPtrList<FileType> subtypes = filetype->subtypes();
+ if (subtypes.count()==0)
+ new ListItem( this, filetype );
+ for(FileType * subtype = subtypes.first();
+ subtype!=NULL;
+ subtype=subtypes.next()) {
+ if (subtype->enabled())
+ new ListItem( this, subtype );
+ }
+ }
+ }
+ }
+
+ void ListWidget::slotTypeSelected(QListViewItem * item) {
+ ListItem * fileitem = dynamic_cast<ListItem*>(item);
+ if (!fileitem) return;
+
+ const FileType * filetype = fileitem->filetype();
+
+ TypeChooser::filetypeSelected(filetype);
+ }
+
+
+}
+#include "filecreate_widget3.moc"
diff --git a/parts/filecreate/filecreate_widget3.h b/parts/filecreate/filecreate_widget3.h
new file mode 100644
index 00000000..58fc5129
--- /dev/null
+++ b/parts/filecreate/filecreate_widget3.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Julian Rockey *
+ * linux@jrockey.com *
+ * *
+ * 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 __FILECREATE_WIDGET3_H__
+#define __FILECREATE_WIDGET3_H__
+
+
+#include <qwidget.h>
+#include <qstring.h>
+
+#include <klistview.h>
+
+#include "filecreate_typechooser.h"
+
+class KDevProject;
+class FileCreatePart;
+class QResizeEvent;
+
+namespace FileCreate {
+
+ class FileType;
+
+ class ListWidget : public KListView, public TypeChooser
+ {
+ Q_OBJECT
+
+ public:
+
+ ListWidget(FileCreatePart *part);
+ virtual ~ListWidget();
+
+ virtual void refresh();
+ virtual void setCurrent(const FileType * current);
+ virtual void resizeEvent(QResizeEvent *event);
+
+ public slots:
+ void slotTypeSelected(QListViewItem * item);
+
+ };
+
+}
+
+#endif
diff --git a/parts/filecreate/kdevfilecreate.desktop b/parts/filecreate/kdevfilecreate.desktop
new file mode 100644
index 00000000..82adbb30
--- /dev/null
+++ b/parts/filecreate/kdevfilecreate.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=FileCreate
+Comment[ca]=Creació de fitxers
+Comment[da]=Filoprettelse
+Comment[de]=Eine Komponente, die Unterstützung bei der Erstellung von Dateien bietet
+Comment[el]=ΔημιουργίαΑρχείου
+Comment[es]=Creación de archivos
+Comment[eu]=Fitxategi sorkuntza
+Comment[fa]=ایجاد پرونده
+Comment[fr]=Création de fichiers
+Comment[hi]=फ़ाइल-क्रिएट
+Comment[hu]=Fájl létrehozása
+Comment[it]=Crea file
+Comment[ja]=ファイル作成
+Comment[ms]=CiptaFail
+Comment[nds]=Dateiopstellen
+Comment[ne]=फाइल सिर्जना
+Comment[nl]=Bestand aanmaken
+Comment[pl]=Tworzenie pliku
+Comment[pt]=Criação de Ficheiros
+Comment[ru]=Мастер создания файлов
+Comment[sk]=Vytvoriť súbor
+Comment[sl]=Ustvarjanje datotek
+Comment[sr]=Направи фајл
+Comment[sr@Latn]=Napravi fajl
+Comment[sv]=Skapa filer
+Comment[ta]= கோப்பு உருவாக்கப்பட்டது
+Comment[tg]=Устои бунёд кардани файлҳо
+Comment[zh_CN]=文件创建
+Comment[zh_TW]=檔案建立
+Name=KDevFileCreate
+Name[da]=KDevelop filoprettelse
+Name[de]=Dateierstellungs-Komponente (KDevelop)
+Name[hi]=के-डेव-फ़ाइल-क्रिएट
+Name[nds]=KDevelop-Dateiopstellen
+Name[pl]=KDevTworzeniePliku
+Name[sk]=KDev vytvoriť súbor
+Name[sv]=KDevelop skapa filer
+Name[ta]=KDev உருவாக்கப்பட்ட கோப்பு
+Name[tg]=Сохткунандаи KDev
+Name[zh_TW]=KDevelop 檔案建立
+GenericName=FileCreate
+GenericName[ca]=Creació de fitxers
+GenericName[da]=Filoprettelse
+GenericName[de]=Dateierstellungs-Komponente
+GenericName[el]=ΔημιουργίαΑρχείου
+GenericName[es]=Creación de archivos
+GenericName[eu]=Fitxategi sorkuntza
+GenericName[fa]=ایجاد پرونده
+GenericName[hi]=फ़ाइल-क्रिएट
+GenericName[hu]=Fájl létrehozása
+GenericName[it]=Crea file
+GenericName[ja]=ファイル作成
+GenericName[ms]=CiptaFail
+GenericName[nds]=Dateiopstellen
+GenericName[ne]=फाइल सिर्जना
+GenericName[nl]=Bestand aanmaken
+GenericName[pl]=Tworzenie pliku
+GenericName[pt]=Criação de Ficheiros
+GenericName[ru]=Мастер создания файлов
+GenericName[sk]=Vytvoriť súbor
+GenericName[sl]=Ustvarjanje datotek
+GenericName[sr]=Направи фајл
+GenericName[sr@Latn]=Napravi fajl
+GenericName[sv]=Skapa filer
+GenericName[ta]=கோப்பு உருவாக்கம்
+GenericName[tg]=Устои бунёд кардани файлҳо
+GenericName[zh_CN]=文件创建
+GenericName[zh_TW]=檔案建立
+Icon=wizard
+ServiceTypes=KDevelop/CreateFile
+X-KDE-Library=libkdevfilecreate
+X-KDevelop-Version=5
+X-KDevelop-Properties=FileCreation
+X-KDevelop-Scope=Core
diff --git a/parts/filecreate/kdevpart_filecreate.rc b/parts/filecreate/kdevpart_filecreate.rc
new file mode 100644
index 00000000..401a1378
--- /dev/null
+++ b/parts/filecreate/kdevpart_filecreate.rc
@@ -0,0 +1,11 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="KDevFileCreate" library="libfilecreateplugin" version="3">
+<MenuBar>
+ <Menu name="file">
+ <Action name="file_new" group="new_merge" />
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="file_new" group="file_operations" />
+</ToolBar>
+</kpartplugin>
diff --git a/parts/filecreate/template-info.xml b/parts/filecreate/template-info.xml
new file mode 100644
index 00000000..bddd5d65
--- /dev/null
+++ b/parts/filecreate/template-info.xml
@@ -0,0 +1,181 @@
+<?xml version = '1.0'?>
+<kdevelop version="1">
+ <kdevfilecreate>
+ <sidetab active="no">
+ </sidetab>
+ <filetypes>
+ <type ext="" name="Blank File" create="template">
+ <descr>A new blank file.</descr>
+ </type>
+ <type ext="py" name="Python" create="template" icon="source_py">
+ <descr>A new empty Python source file.</descr>
+ </type>
+ <type ext="rb" name="Ruby" create="template" icon="template_source">
+ <descr>A new empty Ruby source file.</descr>
+ </type>
+ <type ext="rhtml" name="RHTML Source" create="template" icon="template_source">
+ <descr>A new empty rhtml source file.</descr>
+ </type>
+ <type ext="html.erb" name="HTML/ERB Source" create="template" icon="template_source">
+ <descr>A new empty html.erb source file.</descr>
+ </type>
+ <type ext="rxml" name="RXML Builder Template" create="template" icon="template_source">
+ <descr>A new empty rxml builder template source file.</descr>
+ </type>
+ <type ext="xml.builder" name="XML/Builder Template" create="template" icon="template_source">
+ <descr>A new empty rxml builder template source file.</descr>
+ </type>
+ <type ext="rjs" name="Ruby JavaScript" create="template" icon="template_source">
+ <descr>A new empty Ruby JavaScript template source file.</descr>
+ </type>
+ <type ext="js.rjs" name="Ruby/JavaScript" create="template" icon="template_source">
+ <descr>A new empty Ruby JavaScript template source file.</descr>
+ </type>
+ <type ext="css" name="Cascading Style Sheet" create="template" icon="template_source">
+ <descr>A new empty cascading style sheet source file.</descr>
+ </type>
+ <type ext="js" name="JavaScript" create="template" icon="template_source">
+ <descr>A new empty JavaScript source file.</descr>
+ </type>
+ <type ext="ui" name="Qt Designer" create="no" icon="widget_doc">
+ <descr>
+ </descr>
+ <subtype ref="widget" name="Qt3 Widget" icon="widget_doc">
+ <descr>A new widget.</descr>
+ </subtype>
+ <subtype ref="dialog" name="Qt3 Dialog" icon="widget_doc">
+ <descr>A new empty Dialog box.</descr>
+ </subtype>
+ <subtype ref="tabdialog" name="Qt3 Tab Dialog" icon="widget_doc">
+ <descr>A new empty Tab Dialog box.</descr>
+ </subtype>
+ <subtype ref="dialogr" name="Qt3 Dialog with Buttons (right)" icon="widget_doc">
+ <descr>A new Dialog box with buttons on the right.</descr>
+ </subtype>
+ <subtype ref="dialogb" name="Qt3 Dialog with Buttons (bottom)" icon="widget_doc">
+ <descr>A new Dialog box with buttons on the bottom.</descr>
+ </subtype>
+ <subtype ref="confdialog" name="Qt3 Configuration Dialog" icon="widget_doc">
+ <descr>A new Configuration Dialog box.</descr>
+ </subtype>
+ <subtype ref="wizard" name="Qt3 Wizard" icon="widget_doc">
+ <descr>A new empty Wizard dialog.</descr>
+ </subtype>
+ <subtype ref="mainwin" name="Qt3 Main Window" icon="widget_doc">
+ <descr>A new empty main window.</descr>
+ </subtype>
+ <subtype ref="widget-qt4" name="Qt4 Widget" icon="widget_doc">
+ <descr>A new Qt4 widget.</descr>
+ </subtype>
+ <subtype ref="dialog-qt4" name="Qt4 Dialog" icon="widget_doc">
+ <descr>A new empty Qt4 Dialog box.</descr>
+ </subtype>
+ <subtype ref="mainwin-qt4" name="Qt4 Main Window" icon="widget_doc">
+ <descr>A new empty Qt4 main window.</descr>
+ </subtype>
+ <subtype ref="dialogr-qt4" name="Qt4 Dialog with Buttons (right)" icon="widget_doc">
+ <descr>A new Qt4 Dialog box with buttons on the right.</descr>
+ </subtype>
+ <subtype ref="dialogb-qt4" name="Qt4 Dialog with Buttons (bottom)" icon="widget_doc">
+ <descr>A new Qt4 Dialog box with buttons on the bottom.</descr>
+ </subtype>
+ </type>
+ <type ext="qrc" name="Qt4 Resource" create="template" icon="template_source">
+ <descr>A new Qt4 Resource file.</descr>
+ </type>
+ <type ext="cpp" name="C++ Source" create="template" icon="source_cpp">
+ <descr>A new empty C++ file.</descr>
+ </type>
+ <type ext="c" name="C Source" create="template" icon="source_c">
+ <descr>A new empty C file.</descr>
+ </type>
+ <type ext="h" name="C/C++ Header" create="template" icon="source_h">
+ <descr>A new empty header file for C or C++.</descr>
+ </type>
+ <type ext="php" name="PHP" create="template" icon="php">
+ <descr>A new empty PHP source file.</descr>
+ </type>
+ <type ext="java" name="Java Source" create="template" icon="source_java">
+ <descr>A new empty Java source file.</descr>
+ </type>
+ <type ext="ads" name="Ada Spec" create="template" icon="source_ads">
+ <descr>A new empty Ada spec file.</descr>
+ </type>
+ <type ext="adb" name="Ada Body" create="template" icon="source_adb">
+ <descr>A new empty Ada body file.</descr>
+ </type>
+ <type ext="F" name="Fortran Source" create="template" icon="source_f">
+ <descr>A new empty Fortran source file.</descr>
+ </type>
+ <type ext="f" name="Preprocessed Fortran" create="template" icon="source_f">
+ <descr>A new empty preprocessed Fortran file.</descr>
+ </type>
+ <type ext="f77" name="Fortran77 Source" create="template" icon="source_f">
+ <descr>A new empty Fortran77 source file.</descr>
+ </type>
+ <type ext="f90" name="Fortran90 Source" create="template" icon="source_f">
+ <descr>A new empty Fortran90 source file.</descr>
+ </type>
+ <type ext="f95" name="Fortran95 Source" create="template" icon="source_f">
+ <descr>A new empty Fortran95 source file.</descr>
+ </type>
+ <type ext="for" name="Preprocessed Fortran" create="template" icon="source_f">
+ <descr>A new empty preprocessed Fortran file.</descr>
+ </type>
+ <type ext="ftn" name="Fortran77 Source" create="template" icon="source_f">
+ <descr>A new empty Fortran77 source file.</descr>
+ </type>
+ <type ext="fpp" name="Fortran Source" create="template" icon="source_f">
+ <descr>A new empty Fortran source file.</descr>
+ </type>
+ <type ext="pl" name="Perl Script" create="template" icon="template_source">
+ <descr>A new Perl script.</descr>
+ </type>
+ <type ext="pm" name="Perl Module" create="template" icon="template_source">
+ <descr>A new perl module.</descr>
+ </type>
+ <type ext="pp" name="Pascal Source" create="no" icon="source_p">
+ <descr/>
+ <subtype ref="program" name="Pascal Program" icon="source_p">
+ <descr>A new pascal program.</descr>
+ </subtype>
+ <subtype ref="unit" name="Pascal Unit" icon="source_p">
+ <descr>A new pascal unit.</descr>
+ </subtype>
+ </type>
+ <type ext="pas" name="Pascal Source" create="no" icon="source_p">
+ <descr/>
+ <subtype ref="program" name="Pascal Program" icon="source_p">
+ <descr>A new pascal program.</descr>
+ </subtype>
+ <subtype ref="unit" name="Pascal Unit" icon="source_p">
+ <descr>A new pascal unit.</descr>
+ </subtype>
+ </type>
+ <type ext="dpr" name="Delphi Project" create="template" icon="source_p">
+ <descr>A new Delphi project.</descr>
+ </type>
+ <type ext="l" name="flex C Source" create="template" icon="source_l">
+ <descr>A new empty flex C source source file.</descr>
+ </type>
+ <type ext="ll" name="flex C++ Source" create="template" icon="source_l">
+ <descr>A new empty flex C++ source source file.</descr>
+ </type>
+ <type ext="y" name="bison C Source" create="template" icon="source_y">
+ <descr>A new empty bison C source source file.</descr>
+ </type>
+ <type ext="yy" name="bison C++ Source" create="template" icon="source_y">
+ <descr>A new empty bison C++ source source file.</descr>
+ </type>
+ <type ext="dox" name="Doxygen Documentation Page" create="template" icon="document">
+ <descr>A new empty Doxygen documentation page.</descr>
+ </type>
+ <type ext="hs" name="Haskell Source" create="template" icon="source_hs">
+ <descr>A new empty Haskell source file.</descr>
+ </type>
+ <type ext="ts" name="Qt Linguist Translation" create="template" icon="template_source">
+ <descr>A new empty Qt Linguist translation source file.</descr>
+ </type>
+ </filetypes>
+ </kdevfilecreate>
+</kdevelop>
diff --git a/parts/filelist/Makefile.am b/parts/filelist/Makefile.am
new file mode 100644
index 00000000..0d75e942
--- /dev/null
+++ b/parts/filelist/Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfilelist.la
+libkdevfilelist_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfilelist_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfilelist_la_SOURCES = filelist_widget.cpp filelist_item.cpp \
+ projectviewprojectconfigbase.ui projectviewprojectconfig.cpp projectviewpart.cpp toolbarguibuilder.cpp \
+ projectviewconfigbase.ui projectviewconfig.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfilelist.desktop
+
+rcdir = $(kde_datadir)/kdevfilelist
+
+noinst_HEADERS = filelist_item.h filelist_widget.h projectviewprojectconfig.h \
+ projectviewpart.h toolbarguibuilder.h projectviewconfig.h fileinfo.h
+rc_DATA = kdevfilelist.rc
diff --git a/parts/filelist/README.dox b/parts/filelist/README.dox
new file mode 100644
index 00000000..cc2090a0
--- /dev/null
+++ b/parts/filelist/README.dox
@@ -0,0 +1,13 @@
+/** \class filelist
+This plugin provides a filelist selectview of the currently open files. This is quite handy
+when the tabbar isn't wide enough to show all open files.
+
+\feature Provides filestate feedback
+\feature Provides context menu for file operations
+
+\authors <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a>
+
+\maintainer <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a>
+
+
+*/
diff --git a/parts/filelist/fileinfo.h b/parts/filelist/fileinfo.h
new file mode 100644
index 00000000..0d4cb89f
--- /dev/null
+++ b/parts/filelist/fileinfo.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <kurl.h>
+
+struct FileInfo
+{
+ FileInfo() {url = KURL(); line = -1; col = -1; encoding = "";};
+ FileInfo(const KURL & _url, int _line = -1, int _col = -1, QString _encoding = "")
+ {url = _url; line = _line; col = _col; encoding = _encoding;};
+
+ bool operator==(const FileInfo & f) const {return (f.url == url) /*&& (f.line == line) && (f.col ==col)*/;};
+
+ KURL url;
+ int line;
+ int col;
+ QString encoding;
+};
+
+typedef QValueList<FileInfo> FileInfoList;
diff --git a/parts/filelist/filelist_item.cpp b/parts/filelist/filelist_item.cpp
new file mode 100644
index 00000000..d528cc2c
--- /dev/null
+++ b/parts/filelist/filelist_item.cpp
@@ -0,0 +1,104 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <kiconloader.h>
+#include <qfontmetrics.h>
+#include <qfileinfo.h>
+
+#include "filelist_item.h"
+
+#include <kiconloader.h>
+#include <kfileitem.h>
+
+FileListItem * FileListItem::s_activeItem = 0;
+
+FileListItem::FileListItem( QListView * parent, KURL const & url, DocumentState state )
+ : QListViewItem( parent, url.fileName() ),
+ _url( url )
+
+{
+ KFileItem fileItem( KFileItem::Unknown, KFileItem::Unknown, _url );
+ _icon = fileItem.pixmap(KIcon::SizeSmall);
+ setState( state );
+}
+
+KURL FileListItem::url()
+{
+ return _url;
+}
+
+DocumentState FileListItem::state( )
+{
+ return _state;
+}
+
+void FileListItem::setState( DocumentState state )
+{
+ _state = state;
+
+ switch( state )
+ {
+ case Clean:
+ setPixmap( 0, _icon);
+// setPixmap( 0, 0L );
+ break;
+ case Modified:
+ setPixmap( 0, SmallIcon("filesave") );
+ break;
+ case Dirty:
+ setPixmap( 0, SmallIcon("revert") );
+ break;
+ case DirtyAndModified:
+ setPixmap( 0, SmallIcon("stop") );
+ break;
+ }
+}
+
+void FileListItem::setHeight( int )
+{
+ QListViewItem::setHeight( KIcon::SizeSmall > listView()->fontMetrics().height() ? KIcon::SizeSmall : listView()->fontMetrics().height() );
+}
+
+void FileListItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+{
+ QColorGroup mcg = cg;
+
+ if ( isActive() )
+ {
+ mcg.setColor( QColorGroup::Base, Qt::yellow );
+ }
+
+ QListViewItem::paintCell( p, mcg, column, width, align );
+}
+
+bool FileListItem::isActive( )
+{
+ return ( s_activeItem == this );
+}
+
+//static
+void FileListItem::setActive( FileListItem * item )
+{
+ s_activeItem = item;
+}
+
+int FileListItem::compare( QListViewItem * i, int col, bool ascending ) const
+{
+ QFileInfo info1( key( col, ascending ) ); //this
+ QFileInfo info2( i->key( col, ascending ) ); //that
+ int fileComp = info1.fileName().compare( info2.fileName() );
+ if ( fileComp != 0 )
+ return fileComp;
+ else
+ return info1.extension().compare( info2.extension() );
+}
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/filelist/filelist_item.h b/parts/filelist/filelist_item.h
new file mode 100644
index 00000000..2b4019b8
--- /dev/null
+++ b/parts/filelist/filelist_item.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __FILELIST_ITEM_H__
+#define __FILELIST_ITEM_H__
+
+
+#include <qlistview.h>
+#include <qpixmap.h>
+
+#include <kurl.h>
+
+#include <kdevpartcontroller.h>
+
+class FileListItem : public QListViewItem
+{
+public:
+ FileListItem( QListView * parent, KURL const & url, DocumentState = Clean );
+
+ KURL url();
+
+ DocumentState state();
+ void setState( DocumentState );
+
+ bool isActive();
+ static void setActive( FileListItem * item );
+
+ virtual int compare( QListViewItem * i, int col, bool ascending ) const;
+private:
+ virtual void setHeight( int ); // override of QListViewItem::setHeight()
+ virtual void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ); // override of QListViewItem::paintCell()
+
+ KURL _url;
+ DocumentState _state;
+ QPixmap _icon;
+
+ static FileListItem * s_activeItem;
+
+};
+
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/filelist/filelist_widget.cpp b/parts/filelist/filelist_widget.cpp
new file mode 100644
index 00000000..2ef03968
--- /dev/null
+++ b/parts/filelist/filelist_widget.cpp
@@ -0,0 +1,300 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qheader.h>
+#include <qpixmap.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+
+#include <kdevcore.h>
+#include <kdevpartcontroller.h>
+
+#include "projectviewpart.h"
+#include "filelist_widget.h"
+#include "filelist_item.h"
+
+
+/**
+ *
+ * @param part
+ * @return
+ */
+FileListWidget::FileListWidget(ProjectviewPart *part, QWidget *parent)
+ : KListView(parent), QToolTip( viewport() ), _part( part )
+{
+ addColumn( "" );
+ header()->hide();
+ setRootIsDecorated( false );
+ setResizeMode( QListView::LastColumn );
+ setAllColumnsShowFocus( true );
+
+ setSelectionMode( QListView::Extended );
+
+// connect( _part->partController(), SIGNAL( partAdded(KParts::Part*) ), this, SLOT(partAdded(KParts::Part*)) );
+// connect( _part->partController(), SIGNAL( partRemoved(KParts::Part*) ), this, SLOT(partRemoved()) );
+ connect( _part->partController(), SIGNAL( partAdded(KParts::Part*) ), this, SLOT(startRefreshTimer()) );
+ connect( _part->partController(), SIGNAL( partRemoved(KParts::Part*) ), this, SLOT(startRefreshTimer()) );
+ connect( _part->partController(), SIGNAL( activePartChanged(KParts::Part*) ), this, SLOT( activePartChanged(KParts::Part* )) );
+
+ connect( this, SIGNAL( executed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( returnPressed( QListViewItem * ) ), this, SLOT( itemClicked( QListViewItem * ) ) );
+
+ connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ),
+ this, SLOT( popupMenu(QListViewItem *, const QPoint & , int ) ) );
+
+ connect( _part->partController(), SIGNAL(documentChangedState(const KURL &, DocumentState)),
+ this, SLOT(documentChangedState(const KURL&, DocumentState )) );
+
+ connect( _part->partController(), SIGNAL(partURLChanged(KParts::ReadOnlyPart * )), this, SLOT(refreshFileList()) );
+
+ setItemMargin(10);
+
+ connect( &m_refreshTimer, SIGNAL(timeout()), this, SLOT(refreshFileList()) );
+
+ startRefreshTimer();
+}
+
+
+FileListWidget::~FileListWidget()
+{}
+
+void FileListWidget::startRefreshTimer( )
+{
+ m_refreshTimer.start( 100, true );
+}
+
+void FileListWidget::maybeTip( QPoint const & p )
+{
+ FileListItem * item = static_cast<FileListItem*>( itemAt( p ) );
+ QRect r = itemRect( item );
+
+ if ( item && r.isValid() )
+ {
+ const QPixmap * pixmap = item->pixmap(0);
+ if ( pixmap && ( p.x() <= pixmap->width() ) )
+ {
+ QString message;
+ switch( item->state() )
+ {
+ case Modified:
+ message = i18n("This file has unsaved changes.");
+ break;
+ case Dirty:
+ message = i18n("This file has changed on disk since it was last saved.");
+ break;
+ case DirtyAndModified:
+ message = i18n("Conflict: this file has changed on disk and has unsaved changes.");
+ break;
+ default:
+ message = item->url().prettyURL();
+ }
+
+ tip( r, message );
+ }
+ else
+ {
+ tip( r, item->url().prettyURL() );
+ }
+ }
+}
+
+FileListItem * FileListWidget::itemForURL( KURL const & url )
+{
+ FileListItem * item = static_cast<FileListItem*>( firstChild() );
+ while ( item )
+ {
+ if ( item->url() == url )
+ {
+ return item;
+ }
+ item = static_cast<FileListItem*>( item->nextSibling() );
+ }
+ return 0L;
+}
+
+void FileListWidget::refreshFileList( )
+{
+ QStringList selections = storeSelections();
+ int scrollbarPos = verticalScrollBar()->value();
+
+ KListView::clear();
+
+ KURL::List list = _part->partController()->openURLs();
+ QValueListIterator<KURL> it = list.begin();
+ while ( it != list.end() )
+ {
+ FileListItem * item = new FileListItem( this, *it );
+ item->setState( _part->partController()->documentState( *it ) );
+ ++it;
+ }
+
+ restoreSelections( selections );
+
+ if ( selections.isEmpty() && firstChild() )
+ {
+ firstChild()->setSelected( true );
+ }
+
+ verticalScrollBar()->setValue( scrollbarPos );
+
+ activePartChanged( _part->partController()->activePart() );
+}
+
+/*
+void FileListWidget::partAdded( KParts::Part * part )
+{
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part );
+ if ( ro_part )
+ {
+ new FileListItem( this, ro_part->url() );
+ }
+
+ activePartChanged( _part->partController()->activePart() );
+}
+
+void FileListWidget::partRemoved()
+{
+ FileListItem * item = static_cast<FileListItem*>( firstChild() );
+ while ( item )
+ {
+ if ( ! _part->partController()->partForURL( item->url() ) )
+ {
+ delete item;
+ break;
+ }
+ item = static_cast<FileListItem*>( item->nextSibling() );
+ }
+
+ activePartChanged( _part->partController()->activePart() );
+}
+*/
+
+void FileListWidget::itemClicked( QListViewItem * item )
+{
+ if ( !item ) return;
+
+ FileListItem * listItem = static_cast<FileListItem*>( item );
+ _part->partController()->editDocument( listItem->url() );
+}
+
+void FileListWidget::activePartChanged( KParts::Part * part )
+{
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part );
+ if ( ro_part )
+ {
+ FileListItem * item = static_cast<FileListItem*>( firstChild() );
+ while ( item )
+ {
+ if ( item->url() == ro_part->url() )
+ {
+ FileListItem::setActive( item );
+ break;
+ }
+ item = static_cast<FileListItem*>( item->nextSibling() );
+ }
+ }
+ repaintContents();
+}
+
+void FileListWidget::documentChangedState( const KURL & url, DocumentState state )
+{
+ FileListItem * item = itemForURL( url );
+ if ( item )
+ {
+ item->setState( state );
+ }
+}
+
+void FileListWidget::popupMenu( QListViewItem * item, const QPoint & p, int )
+{
+ if ( item )
+ {
+ KPopupMenu popup;
+ popup.insertTitle( i18n("File List") );
+ popup.insertItem( i18n("Close Selected"), this, SLOT(closeSelectedFiles()) );
+ popup.insertItem( i18n("Save Selected"), this, SLOT(saveSelectedFiles()) );
+ popup.insertItem( i18n("Reload Selected"), this, SLOT(reloadSelectedFiles()) );
+
+ FileContext context( getSelectedURLs() );
+ _part->core()->fillContextMenu( &popup, &context );
+
+ popup.exec(p);
+ }
+}
+
+KURL::List FileListWidget::getSelectedURLs( )
+{
+ KURL::List list;
+ FileListItem * item = static_cast<FileListItem*>( firstChild() );
+ while ( item )
+ {
+ if ( item->isSelected() )
+ {
+ list << item->url();
+ }
+ item = static_cast<FileListItem*>( item->nextSibling() );
+ }
+ return list;
+}
+
+void FileListWidget::closeSelectedFiles( )
+{
+ _part->partController()->closeFiles( getSelectedURLs() );
+}
+
+void FileListWidget::saveSelectedFiles( )
+{
+ _part->partController()->saveFiles( getSelectedURLs() );
+}
+
+void FileListWidget::reloadSelectedFiles( )
+{
+ _part->partController()->revertFiles( getSelectedURLs() );
+}
+
+QStringList FileListWidget::storeSelections()
+{
+ QStringList list;
+ QListViewItem * item = firstChild();
+ while ( item )
+ {
+ if ( item->isSelected() )
+ {
+ list << item->text(0);
+ }
+ item = item->nextSibling();
+ }
+ return list;
+}
+
+void FileListWidget::restoreSelections(const QStringList & list)
+{
+ QListViewItem * item = firstChild();
+ while ( item )
+ {
+ if ( list.contains( item->text(0) ) )
+ {
+ item->setSelected( true );
+ }
+ item = item->nextSibling();
+ }
+}
+
+#include "filelist_widget.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/filelist/filelist_widget.h b/parts/filelist/filelist_widget.h
new file mode 100644
index 00000000..5895103b
--- /dev/null
+++ b/parts/filelist/filelist_widget.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __FILELIST_WIDGET_H__
+#define __FILELIST_WIDGET_H__
+
+
+#include <klistview.h>
+#include <kurl.h>
+#include <kdevpartcontroller.h> // for DocumentState
+
+#include <qstring.h>
+#include <qtooltip.h>
+#include <qtimer.h>
+
+#include "projectviewpart.h"
+
+class KDevProject;
+class FileListItem;
+
+namespace KParts { class Part; }
+
+class FileListWidget : public KListView, public QToolTip
+{
+ Q_OBJECT
+
+public:
+
+ FileListWidget(ProjectviewPart *part, QWidget *parent=0);
+ ~FileListWidget();
+
+protected:
+ void maybeTip( QPoint const & );
+
+private slots:
+// void partAdded(KParts::Part*);
+// void partRemoved();
+ void activePartChanged(KParts::Part*);
+ void itemClicked( QListViewItem * );
+ void popupMenu( QListViewItem * , const QPoint & , int );
+ void closeSelectedFiles();
+ void saveSelectedFiles();
+ void reloadSelectedFiles();
+ void documentChangedState( const KURL &, DocumentState );
+ void refreshFileList();
+ void startRefreshTimer();
+ QStringList storeSelections();
+ void restoreSelections( const QStringList & list );
+
+private:
+ KURL::List getSelectedURLs();
+ FileListItem * itemForURL( KURL const & url );
+
+ QTimer m_refreshTimer;
+ ProjectviewPart * _part;
+
+};
+
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/parts/filelist/kdevfilelist.desktop b/parts/filelist/kdevfilelist.desktop
new file mode 100644
index 00000000..c3d097e4
--- /dev/null
+++ b/parts/filelist/kdevfilelist.desktop
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a list of all currently open files. (Handy when the tab bar is not quite wide enough.)
+Comment[ca]=Proporciona una llista de tots els fitxers oberts actualment. (Útil quan la barra de pestanyes no és suficientment ample)
+Comment[da]=Sørger for en liste over alle filer der er åbne. (Praktisk når tab-linjen ikke er helt bred nok.)
+Comment[de]=Stellt eine Liste aller offenen Dateien bereit.
+Comment[el]=Προσφέρει μια λίστα των τρέχων ανοιγμένων αρχείων. (Χρήσιμο όταν η γραμμή καρτελών δεν είναι αρκετά πλατιά.)
+Comment[es]=Proporciona una lista de los archivos abiertos actualmente (útil cuando la barra de pestañas no es lo suficientemente ancha).
+Comment[et]=Näitab kõiki parajasti avatud faile (mugav, kui kaardiriba ei ole piisavalt lai).
+Comment[eu]=Uneko irekitako fitxategien zerrenda eskeintzen du. (Erabilgarria fitxa-barra behar den bezain zabala ez bada)
+Comment[fa]=فهرستی از همۀ پرونده‌های باز جاری را فراهم می‌کند. )دستی هنگامی که میله ابزار پهنای کافی نداشته باشد.(
+Comment[fr]=Fournit une liste de tous les fichiers actuellement ouverts. (Pratique lorsque la barre d'onglets n'est plus assez large.)
+Comment[gl]=Proporciona unha lista de tódolos ficheiros abertos actualmente. (Útil cando a barra de pestañas non é suficientemente ancha.)
+Comment[hu]=Kilistázza a nyitott fájlokat. (Jól jöhet, ha a lapozósáv nem elég széles.)
+Comment[it]=Fornisce una lista di tutti i file aperti correntemente. (Utile quando la barra delle schede non è sufficientemente larga.)
+Comment[ja]=現在開かれているファイルのリストを提供します。(タブバーが十分広くない場合に便利です)
+Comment[ms]=Menyediakan senarai semua fail yang sedang dibuka. (Berguna apabila bar tab tidak cukup lebar.)
+Comment[nds]=Stellt en List vun all apen Dateien praat. (Goot, wenn de Paneelbalken nich wiet noog is.)
+Comment[ne]=हालै खुला फाइलको सूची प्रदान गर्दछ (ट्याब बार पर्याप्त चौडा नहुदा सजिलो हुन्छ)
+Comment[nl]=Geeft een lijst van alle open bestanden. (Handig als de tabbalk niet breed genoeg is.)
+Comment[pl]=Pokazuje listę obecnie otwartych plików (przydaje się, gdy pasek kart nie mieści wszystkich)
+Comment[pt]=Fornece uma lista de todos os ficheiros actualmente aberto. (Útil quando a barra de página não é suficientemente larga.)
+Comment[pt_BR]=Fornece uma lista de todos os arquivos atualmente abertos (acessível quando a barra de abas não for larga o suficiente).
+Comment[ru]=Список открытых в данных момент файлов (полезно, когда они не помещаются на панели вкладок).
+Comment[sk]=Poskytne zoznam všetkých aktuálne otvorených súborov. (Užitočné keď panel kariet nie je dostatočne široký.)
+Comment[sr]=Даје листу свих отворених фајлова. (Згодно кад трака са језичцима није довољно дугачка.)
+Comment[sr@Latn]=Daje listu svih otvorenih fajlova. (Zgodno kad traka sa jezičcima nije dovoljno dugačka.)
+Comment[sv]=Tillhandahåller en lista av alla för närvarande öppna filer. (Praktiskt när flikraden inte är riktigt bred nog.)
+Comment[ta]=தற்போது திறக்கப்பட்ட கோப்புகளின் பட்டியலை வழங்குகிறது. (தத்தல் போதுமான வசதியை வழங்க இயலாத பொழுது)
+Comment[tg]=Рӯйхати кушодашудагиҳои ҳозир будаи файлҳо (вақте ки онҳо дар панелмонӣ омехта намешаванд, фоидаовар аст.)
+Comment[tr]=Bütün açık dosyaların bir listesini sunar. (Sekme çubuğu yeteri kadar geniş olmadığında işe yarar)
+Comment[zh_CN]=提供目前已打开全部文件的列表。(当标签栏不够宽时非常实用。)
+Comment[zh_TW]=提供目前開啟檔案的列表。
+Name=KDevfilelist
+Name[da]=KDevelop filliste
+Name[nds]=KDevelop-Dateilist
+Name[pt_BR]=Lista de arq. do KDev
+Name[sk]=KDev zoznam súborov
+Name[sv]=KDevelop fillista
+Name[ta]=KDev கோப்புக்காட்சி
+Name[tg]=Рӯйхати файли KDev
+Name[zh_TW]=KDevelop 檔案列表
+GenericName=FileList
+GenericName[br]=Roll restr
+GenericName[da]=Filliste
+GenericName[de]=Dateiliste
+GenericName[el]=ΛίσταΑρχείων
+GenericName[eu]=Fitxategi zerrenda
+GenericName[fa]=فهرست پرونده
+GenericName[hu]=Fájllista
+GenericName[it]=ListaFile
+GenericName[ja]=ファイルリスト
+GenericName[ms]=SenaraiFail
+GenericName[nds]=Dateilist
+GenericName[ne]=फाइल सूची
+GenericName[nl]=Bestandenlijst
+GenericName[pl]=Lista plików
+GenericName[pt]=Lista de Ficheiros
+GenericName[pt_BR]=Lista de Arquivos
+GenericName[ru]=Список файлов
+GenericName[sk]=Zoznam súborov
+GenericName[sl]=Seznam datotek
+GenericName[sr]=Листа фајлова
+GenericName[sr@Latn]=Lista fajlova
+GenericName[sv]=Fillista
+GenericName[ta]=கோப்புப் பட்டியல்
+GenericName[tg]=Рӯйхати файлҳо
+GenericName[zh_CN]=文件列表
+GenericName[zh_TW]=檔案列表
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevfilelist
+X-KDevelop-Version=5
+X-KDevelop-Properties=OpenFileNavigation
diff --git a/parts/filelist/kdevfilelist.rc b/parts/filelist/kdevfilelist.rc
new file mode 100644
index 00000000..5ab5de7c
--- /dev/null
+++ b/parts/filelist/kdevfilelist.rc
@@ -0,0 +1,24 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="filelist" version="3">
+<MenuBar>
+ <Menu name="view" >
+ <text>View</text>
+ <Separator/>
+ <Menu name="viewsession" >
+ <text>View Sessions</text>
+ <Action name="viewsession_new" />
+ <Action name="viewsession_open" />
+ <Action name="viewsession_save" />
+ <Action name="viewsession_delete" />
+ </Menu>
+ <Separator/>
+ </Menu>
+</MenuBar>
+<ToolBar name="viewsession_toolbar" >
+ <text>View Sessions Toolbar</text>
+ <Action name="viewsession_new" />
+ <Action name="viewsession_open" />
+ <Action name="viewsession_save" />
+ <Action name="viewsession_deletecurrent" />
+</ToolBar>
+</kpartplugin>
diff --git a/parts/filelist/projectviewconfig.cpp b/parts/filelist/projectviewconfig.cpp
new file mode 100644
index 00000000..fba2c6ca
--- /dev/null
+++ b/parts/filelist/projectviewconfig.cpp
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens.herden@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "projectviewconfig.h"
+
+#include <qcheckbox.h>
+
+#include <kconfig.h>
+#include <kapplication.h>
+
+
+ProjectviewConfig::ProjectviewConfig(QWidget *parent, const char *name)
+ : ProjectviewConfigBase(parent, name)
+{
+ KConfig * config = kapp->config();
+ config->setGroup("File List Plugin");
+ inToolview->setChecked(config->readBoolEntry("ToolbarInToolview", true));
+ onlyProject->setChecked(config->readBoolEntry("OnlyProjectFiles", false));
+ closeOpenFiles->setChecked(config->readBoolEntry("CloseOpenFiles", true));
+}
+
+void ProjectviewConfig::accept()
+{
+ KConfig * config = kapp->config();
+ config->setGroup("File List Plugin");
+ config->writeEntry("ToolbarInToolview", inToolview->isChecked());
+ config->writeEntry("OnlyProjectFiles", onlyProject->isChecked());
+ config->writeEntry("CloseOpenFiles", closeOpenFiles->isChecked());
+}
+
+#include "projectviewconfig.moc"
diff --git a/parts/filelist/projectviewconfig.h b/parts/filelist/projectviewconfig.h
new file mode 100644
index 00000000..64cffd10
--- /dev/null
+++ b/parts/filelist/projectviewconfig.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens.herden@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef PROJECTVIEW_CONFIG_H
+#define PROJECTVIEW_CONFIG_H
+
+#include "projectviewconfigbase.h"
+
+
+class ProjectviewConfig: public ProjectviewConfigBase
+{
+ Q_OBJECT
+public:
+ ProjectviewConfig(QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+};
+
+#endif
diff --git a/parts/filelist/projectviewconfigbase.ui b/parts/filelist/projectviewconfigbase.ui
new file mode 100644
index 00000000..7a0241db
--- /dev/null
+++ b/parts/filelist/projectviewconfigbase.ui
@@ -0,0 +1,93 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ProjectviewConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ProjectviewConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>File List</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>inToolview</cstring>
+ </property>
+ <property name="text">
+ <string>Display toolbar in toolview (note: change needs a restart)</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Uncheck this if you want the toolbar together with all other toolbars. You can disable it then</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Uncheck this if you want the toolbar together with all other toolbars. You can disable it then</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>onlyProject</cstring>
+ </property>
+ <property name="text">
+ <string>Only save project files in a session</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check this if you want to ignore files that are not part of the project</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want to ignore files that are not part of the project</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>closeOpenFiles</cstring>
+ </property>
+ <property name="text">
+ <string>Close all open files before opening a session</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check this if you want the currently open files closed before opening a session</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want the currently open files closed before opening a session</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>61</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/filelist/projectviewpart.cpp b/parts/filelist/projectviewpart.cpp
new file mode 100644
index 00000000..56fc02c3
--- /dev/null
+++ b/parts/filelist/projectviewpart.cpp
@@ -0,0 +1,585 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "projectviewprojectconfig.h"
+#include "projectviewconfig.h"
+#include "projectviewpart.h"
+#include "filelist_widget.h"
+#include "toolbarguibuilder.h"
+
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+#include <qvaluelist.h>
+#include <qmap.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qvbox.h>
+#include <qhbox.h>
+#include <qpoint.h>
+#include <qlayout.h>
+
+#include <kmainwindow.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/encodinginterface.h>
+#include <kparts/part.h>
+#include <kxmlguibuilder.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kapplication.h>
+
+#include <kdevplugininfo.h>
+#include <kdevgenericfactory.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <configwidgetproxy.h>
+
+
+
+typedef KDevGenericFactory<ProjectviewPart> projectviewFactory;
+KDevPluginInfo data("kdevfilelist");
+K_EXPORT_COMPONENT_FACTORY(libkdevfilelist, projectviewFactory(data))
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+ProjectviewPart::ProjectviewPart(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevPlugin(&data, parent, name ? name : "FileListPart")
+{
+ setInstance(projectviewFactory::instance());
+ setXMLFile("kdevfilelist.rc");
+ setupActions();
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("File List"), GLOBALDOC_OPTIONS, info()->icon());
+ m_configProxy->createProjectConfigPage(i18n("File List"), PROJECTDOC_OPTIONS, info()->icon());
+
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+
+ connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+ connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()));
+
+ KConfig * config = kapp->config();
+ config->setGroup("File List Plugin");
+ if (config->readBoolEntry("ToolbarInToolview", true))
+ {
+ m_toolbarWidget = new QVBox(0, "toolbarContainer");
+ m_toolbarWidget->setHidden(true);
+ m_guibuilder = new ToolbarGUIBuilder(m_toolbarWidget, mainWindow()->main());
+ setClientBuilder(m_guibuilder);
+ }
+ m_restored = false;
+ QTimer::singleShot(0, this, SLOT(init()));
+}
+
+ProjectviewPart::~ProjectviewPart()
+{
+ delete m_configProxy;
+ delete m_guibuilder;
+ if ( m_widget ) {
+ mainWindow()->removeView( m_widget );
+ delete m_widget; // deletes the children as well
+ }
+}
+
+void ProjectviewPart::restorePartialProjectSession(const QDomElement * el)
+{
+ m_projectViews.clear(); // remove the global views
+ m_restored = true;
+ if (!el)
+ {
+ return;
+ }
+ // get the base of the project
+ QString urlStr = project()->projectDirectory();
+ if (KURL::isRelativeURL(urlStr))
+ {
+ m_projectBase.setProtocol("file");
+ m_projectBase.setPath(urlStr);
+ } else
+ {
+ m_projectBase = KURL::fromPathOrURL(urlStr);
+ }
+ m_projectBase.adjustPath(+1); // just in case
+
+ // read all the views
+ QDomNodeList domList = el->elementsByTagName("projectview");
+
+ uint len = domList.length();
+ for (uint i = 0; i < len; ++i)
+ {
+ const QDomElement viewEl = domList.item(i).toElement();
+ if (viewEl.isNull())
+ {
+ continue;
+ }
+ FileInfoList urlList;
+ QDomNodeList fileList = viewEl.elementsByTagName("file");
+
+ uint len2 = fileList.length();
+ for (uint i2 = 0; i2 < len2; ++i2)
+ {
+ const QDomElement fileEl = fileList.item(i2).toElement();
+ if (!fileEl.isNull())
+ {
+ bool ok;
+ int line = -1;
+ QString attr = fileEl.attribute("line");
+ if (! attr.isNull())
+ {
+ line = attr.toInt(&ok);
+ if (!ok)
+ line = -1;
+ }
+ int col = -1;
+ attr = fileEl.attribute("col");
+ if (! attr.isNull())
+ {
+ col = attr.toInt(&ok);
+ if (!ok)
+ col = -1;
+ }
+ QString encoding = "";
+ attr = fileEl.attribute("encoding");
+ if (! attr.isNull())
+ {
+ encoding = attr;
+ }
+ QString urlStr = fileEl.attribute("url");
+ if (KURL::isRelativeURL(urlStr))
+ {
+ KURL url = m_projectBase;
+ url.addPath(urlStr);
+ urlList.append(FileInfo(url, line, col, encoding));
+ } else
+ urlList.append(FileInfo(KURL::fromPathOrURL(urlStr), line, col, encoding));
+ }
+ }
+ m_projectViews.insert(viewEl.attribute("name"), urlList);
+ }
+ // read default view
+ domList = el->elementsByTagName("defaultview");
+ if (domList.length() > 0)
+ {
+ m_defaultProjectView = domList.item(0).toElement().attribute("name");
+ if (!m_defaultProjectView.isEmpty())
+ {
+ slotOpenProjectView(m_defaultProjectView);
+ }
+ } else
+ {
+ m_defaultProjectView = "";
+ }
+}
+
+void ProjectviewPart::savePartialProjectSession(QDomElement * el)
+{
+ if (!el || m_projectViews.empty())
+ {
+ return;
+ }
+ QDomDocument domDoc = el->ownerDocument();
+ if (domDoc.isNull())
+ {
+ return;
+ }
+ // write all views
+ ViewMap::ConstIterator it;
+ for (it = m_projectViews.constBegin(); it != m_projectViews.constEnd(); ++it)
+ {
+ // we create the view even if there is no file inside, might be wanted by the user
+ QDomElement viewEl = domDoc.createElement("projectview");
+ viewEl.setAttribute("name", it.key());
+ el->appendChild(viewEl);
+ for (FileInfoList::ConstIterator it2 = it.data().constBegin(); it2 != it.data().constEnd(); ++it2)
+ {
+ QDomElement urlEl = domDoc.createElement("file");
+
+ if (m_projectBase.isParentOf((*it2).url))
+ urlEl.setAttribute("url", KURL::relativeURL(m_projectBase, (*it2).url));
+ else
+ urlEl.setAttribute("url", (*it2).url.url());
+ urlEl.setAttribute("line", (*it2).line);
+ urlEl.setAttribute("col", (*it2).col);
+ urlEl.setAttribute("encoding", (*it2).encoding);
+ viewEl.appendChild(urlEl);
+ }
+ }
+ // write the default view
+ QDomElement defaultEl = domDoc.createElement("defaultview");
+ defaultEl.setAttribute("name", m_defaultProjectView);
+ el->appendChild(defaultEl);
+}
+
+
+void ProjectviewPart::init()
+{
+ // delayed initialization stuff goes here
+
+ // create the toolview
+ m_widget = new QWidget(0, "filelist widget");
+ m_widget->setIcon( SmallIcon(info()->icon()) );
+ m_widget->setCaption(i18n("File List"));
+
+ QBoxLayout * l = new QVBoxLayout(m_widget);
+
+ // create the toolbar if needed
+ if (m_guibuilder)
+ {
+ m_toolbarWidget->reparent(m_widget, QPoint(0, 0), true);
+ l->addWidget(m_toolbarWidget);
+ QWhatsThis::add(m_toolbarWidget, i18n("<b>View Session Toolbar</b><p>This allows to create and work with view sessions. A view session is a set of open documents.</p>"));
+ }
+
+ // create the listview
+ QWidget * fileListWidget = new FileListWidget(this, m_widget);
+ fileListWidget->setCaption(i18n("File List"));
+ QWhatsThis::add(fileListWidget, i18n("<b>File List</b><p>This is the list of opened files.</p>"));
+ l->addWidget(fileListWidget);
+ m_widget->setFocusProxy(fileListWidget);
+
+ mainWindow()->embedSelectView(m_widget, i18n("File List"), i18n("Open files"));
+
+ if (!project())
+ readConfig();
+}
+
+void ProjectviewPart::setupActions()
+{
+ m_openPrjViewAction = new KSelectAction(i18n("Open Session..."), 0, actionCollection(), "viewsession_open");
+
+ connect(m_openPrjViewAction, SIGNAL(activated(const QString &)), this, SLOT(slotOpenProjectView(const QString &)));
+
+ m_openPrjViewAction->setToolTip(i18n("Open Session"));
+
+ m_savePrjViewAction = new KAction(i18n("Save Session"), "filesave", 0, this, SLOT(slotSaveProjectView()), actionCollection(), "viewsession_save");
+
+ m_newPrjViewAction = new KAction(i18n("New Session..."), "filenew", 0, this, SLOT(slotSaveAsProjectView()), actionCollection(), "viewsession_new");
+
+ m_deletePrjViewAction = new KSelectAction(i18n("Delete Session"), "editdelete", 0, actionCollection(), "viewsession_delete");
+
+ connect(m_deletePrjViewAction, SIGNAL(activated(const QString &)), this, SLOT(slotDeleteProjectView(const QString &)));
+
+ m_deletePrjViewAction->setToolTip(i18n("Delete Session"));
+
+ m_deleteCurrentPrjViewAction = new KAction(i18n("Delete Session"), "editdelete", 0, this, SLOT(slotDeleteProjectViewCurent()), actionCollection(), "viewsession_deletecurrent");
+
+ m_deleteCurrentPrjViewAction->setToolTip(i18n("Delete Session"));
+
+ adjustViewActions();
+}
+
+void ProjectviewPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+// create configuraton dialogs here
+ switch (pageNo)
+ {
+ case PROJECTDOC_OPTIONS:
+ {
+ ProjectviewProjectConfig *w = new ProjectviewProjectConfig(this, page, "project config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ case GLOBALDOC_OPTIONS:
+ {
+ ProjectviewConfig *w = new ProjectviewConfig(page, "global config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+void ProjectviewPart::contextMenu(QPopupMenu */*popup*/, const Context */*context*/)
+{
+// put actions into the context menu here
+// if (context->hasType(Context::EditorContext))
+// {
+// // editor context menu
+// const EditorContext *econtext = static_cast<const EditorContext*>(context);
+//
+// // use context and plug actions here
+// // action->plug(popup);
+//
+// // or create menu items on the fly
+// // int id = -1;
+// // id = popup->insertItem(i18n("Do Something Here"),
+// // this, SLOT(doSomething()));
+// // popup->setWhatsThis(id, i18n("<b>Do something here</b><p>Describe here what does this action do."
+// }
+// else if (context->hasType(Context::FileContext))
+// {
+// // file context menu
+// const FileContext *fcontext = static_cast<const FileContext*>(context);
+//
+// //use context and plug actions here
+// }
+// else if (context->hasType(Context::ProjectModelItemContext))
+// {
+// // project tree context menu
+// const ProjectModelItemContext *pcontext = static_cast<const ProjectModelItemContext*>(context);
+//
+// // use context and plug actions here
+// }
+// else if (context->hasType(Context::CodeModelItemContext))
+// {
+// // class tree context menu
+// const CodeModelItemContext *mcontext = static_cast<const CodeModelItemContext*>(context);
+//
+// // use context and plug actions here
+// }
+// else if (context->hasType(Context::DocumentationContext))
+// {
+// // documentation viewer context menu
+// const DocumentationContext *dcontext = static_cast<const DocumentationContext*>(context);
+//
+// // use context and plug actions here
+// }
+}
+
+void ProjectviewPart::projectOpened()
+{
+ if ( !m_restored )
+ m_projectViews.clear(); // remove the global views
+ adjustViewActions();
+ m_restored = false;
+}
+
+void ProjectviewPart::projectClosed()
+{
+ m_projectBase = KURL();
+ m_defaultProjectView = "";
+ readConfig(); // read the global project views
+}
+
+void ProjectviewPart::slotOpenProjectView(const QString &view)
+{
+ KConfig * config = kapp->config();
+ config->setGroup("File List Plugin");
+ bool onlyProject = config->readBoolEntry("OnlyProjectFiles", false);
+ bool closeOpenFiles = config->readBoolEntry("CloseOpenFiles", true);
+
+ m_currentProjectView = view;
+
+ if (m_projectViews.contains(view) > 0)
+ {
+ FileInfoList viewUrls = m_projectViews[view];
+
+ if (closeOpenFiles)
+ {
+ // we close everything that is not part of the project view
+ KURL::List urlsToClose = partController()->openURLs();
+ for (KURL::List::Iterator it = urlsToClose.begin(); it != urlsToClose.end(); ++it)
+ {
+ // it is in the list of wanted files and do we want it at all
+ if ((viewUrls.contains(*it) > 0) && (!onlyProject || !project() || project()->isProjectFile((*it).path()) ))
+ {
+ viewUrls.remove(*it); // don't open if it is open already
+ it = urlsToClose.remove(it);
+ --it; // do not skip one
+ }
+ }
+ if (!urlsToClose.empty())
+ {
+ partController()->closeFiles(urlsToClose);
+ }
+ }
+ // we open what still needs to get opened
+ FileInfoList::const_iterator viewIt;
+ for (viewIt = viewUrls.begin(); viewIt != viewUrls.end(); ++viewIt)
+ {
+ if (!onlyProject || !project() || project()->isProjectFile((*viewIt).url.path()))
+ {
+ partController()->setEncoding( (*viewIt).encoding );
+ partController()->editDocument((*viewIt).url, (*viewIt).line, (*viewIt).col);
+ }
+ }
+ }
+ adjustViewActions();
+}
+
+
+void ProjectviewPart::slotSaveProjectView()
+{
+ slotSaveAsProjectView(m_currentProjectView.isEmpty());
+}
+
+
+void ProjectviewPart::adjustViewActions()
+{
+ QStringList viewList = getViewList();
+
+ m_openPrjViewAction->clear();
+ m_openPrjViewAction->setItems(viewList);
+ int i = viewList.findIndex(m_currentProjectView);
+ if (i > -1)
+ {
+ m_openPrjViewAction->setCurrentItem(i);
+ }
+ m_deletePrjViewAction->clear();
+ m_deletePrjViewAction->setItems(viewList);
+ m_currentProjectView = m_openPrjViewAction->currentText();
+ if (m_currentProjectView.isEmpty() && !viewList.empty())
+ {
+ m_currentProjectView = viewList.front();
+ }
+ bool haveView = !m_currentProjectView.isEmpty();
+ m_savePrjViewAction->setEnabled(haveView);
+ m_deleteCurrentPrjViewAction->setEnabled(haveView);
+}
+
+
+void ProjectviewPart::slotDeleteProjectViewCurent()
+{
+ slotDeleteProjectView(m_currentProjectView);
+}
+
+void ProjectviewPart::slotDeleteProjectView(const QString& view)
+{
+ m_projectViews.remove(view);
+
+ if (m_currentProjectView == view)
+ m_currentProjectView = "";
+
+ if (m_defaultProjectView == view)
+ m_defaultProjectView = "";
+
+ if (! project())
+ writeConfig();
+
+ adjustViewActions();
+}
+
+
+void ProjectviewPart::slotSaveAsProjectView(bool askForName)
+{
+ if (askForName)
+ {
+ bool ok;
+ QString newProjectView = KInputDialog::getText(i18n("Save View Session As"), i18n("Enter the name of the session:"), "", &ok, mainWindow()->main());
+ if (!ok)
+ {
+ return;
+ }
+ newProjectView = newProjectView.remove("="); // we use this string in config files and = would confuse it
+ if (m_projectViews.contains(newProjectView) > 0 &&
+ KMessageBox::warningContinueCancel(mainWindow()->main(), i18n("<qt>A view session named <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>").arg(newProjectView), QString::null, i18n("Overwrite")) != KMessageBox::Continue)
+ {
+ return;
+ }
+ m_currentProjectView = newProjectView;
+ }
+
+ FileInfoList viewUrls;
+ KURL::List openURLs = partController()->openURLs();
+
+ for (KURL::List::Iterator it = openURLs.begin(); it != openURLs.end(); ++it)
+ {
+ // test if we have an editor
+ // FIXME this can fail if there are two parts with the same URL
+ KParts::ReadOnlyPart *ro_part = partController()->partForURL(*it);
+ KTextEditor::ViewCursorInterface* cursorIf = dynamic_cast<KTextEditor::ViewCursorInterface*>(ro_part->widget());
+ if (cursorIf)
+ {
+ QString encoding;
+ if ( KTextEditor::EncodingInterface * ei = dynamic_cast<KTextEditor::EncodingInterface*>( ro_part ) )
+ {
+ QString temp = ei->encoding();
+ if ( !temp.isNull() )
+ {
+ encoding = temp;
+ }
+ }
+
+ unsigned int line, col;
+ cursorIf->cursorPositionReal(&line, &col);
+ viewUrls.append(FileInfo(*it, line, col, encoding));
+ }
+ }
+ // add or overwrite the values
+ m_projectViews.insert(m_currentProjectView, viewUrls, true);
+ if (! project())
+ writeConfig();
+
+ adjustViewActions();
+}
+
+
+void ProjectviewPart::writeConfig()
+{
+ KConfig * config = kapp->config();
+ config->deleteGroup("ProjectViews", true);
+ config->setGroup("ProjectViews");
+
+ // write all views
+ ViewMap::ConstIterator it;
+ for (it = m_projectViews.constBegin(); it != m_projectViews.constEnd(); ++it)
+ {
+ // we create the view even if there is no file inside, might be wanted by the user
+ QStringList urls;
+ for (FileInfoList::ConstIterator it2 = it.data().constBegin(); it2 != it.data().constEnd(); ++it2)
+ {
+ if ((*it2).encoding.isEmpty())
+ urls.append((*it2).url.url());
+ else
+ urls.append((*it2).url.url() + ";" + (*it2).encoding);
+ }
+ config->writeEntry(it.key(), urls);
+ }
+}
+
+
+void ProjectviewPart::readConfig()
+{
+ KConfig * config = kapp->config();
+ QMap<QString, QString> entries = config->entryMap("ProjectViews");
+
+ m_projectViews.clear();
+ QMap<QString, QString>::ConstIterator it;
+ for (it = entries.constBegin(); it != entries.constEnd(); ++it)
+ {
+ FileInfoList urlList;
+ QStringList urls = QStringList::split(",", it.data());
+ for (QStringList::Iterator it2 = urls.begin(); it2 != urls.end(); ++it2 )
+ {
+ // search the encoding. The entry can be like: fileURL;encoding
+ QStringList file = QStringList::split(";", *it2);
+ if (file.count() == 1)
+ urlList.append(FileInfo(KURL::fromPathOrURL(*it2)));
+ else
+ urlList.append(FileInfo(KURL::fromPathOrURL(file.first()), -1, -1, file.last()));
+ }
+ m_projectViews.insert(it.key(), urlList);
+ }
+ adjustViewActions();
+}
+
+#include "projectviewpart.moc"
diff --git a/parts/filelist/projectviewpart.h b/parts/filelist/projectviewpart.h
new file mode 100644
index 00000000..50cd5391
--- /dev/null
+++ b/parts/filelist/projectviewpart.h
@@ -0,0 +1,169 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef KDEVPROJECTVIEW_H
+#define KDEVPROJECTVIEW_H
+
+#include "fileinfo.h"
+
+#include <qvaluelist.h>
+#include <qmap.h>
+#include <qguardedptr.h>
+
+#include <kdevplugin.h>
+#include <kurl.h>
+
+
+class QPopupMenu;
+class KAction;
+class KSelectAction;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+class FileListWidget;
+class KToolBar;
+class QVBox;
+class ToolbarGUIBuilder;
+
+
+
+/**
+Please read the README.dox file for more info about this part
+
+this is a reimplementation of the project views in Quanta
+
+@TODO find a way to control the toolbar again
+@TODO save html parts too
+FIXME at project open I get the default view and the open files at last close
+*/
+class ProjectviewPart: public KDevPlugin
+{
+ Q_OBJECT
+public:
+
+ typedef QMap<QString, FileInfoList> ViewMap;
+// typedef QMap<KURL, FileInfo> FileInfoMap;
+
+
+ ProjectviewPart(QObject *parent, const char *name, const QStringList &args);
+ ~ProjectviewPart();
+
+ // reimplemented from KDevPlugin
+ void restorePartialProjectSession(const QDomElement * el);
+ void savePartialProjectSession(QDomElement * el);
+
+ /**
+ *
+ * @return the current defaut view
+ */
+ inline QString getDefaultView() const {return m_defaultProjectView;};
+
+ /**
+ *
+ * @param view new default view
+ */
+ inline void setDefaultView(const QString& view) {m_defaultProjectView = view;};
+
+ /**
+ * get all current views
+ * @return QStringList of defined views
+ */
+ inline QStringList getViewList() const {return m_projectViews.keys();};
+
+private slots:
+ void init();
+
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void projectOpened();
+ void projectClosed();
+
+ /** Deletes a project view
+ *
+ * @param view name of the project view
+ */
+ void slotDeleteProjectView(const QString &view);
+
+ /**
+ * Deletes the current project view
+ */
+ void slotDeleteProjectViewCurent();
+
+ /**
+ * Saves a project view
+ *
+ * @param askForName true = show a dialog for the name
+ */
+ void slotSaveAsProjectView(bool askForName = true);
+
+ /** Saves the current project view
+ */
+ void slotSaveProjectView();
+
+ /** Opens a project view
+ *
+ * @param view name of the project view
+ */
+ void slotOpenProjectView(const QString &view);
+
+private:
+ /**
+ * create and initialize the actions
+ */
+ void setupActions();
+
+ /**
+ * Change the actions according to the current available views
+ */
+ void adjustViewActions();
+
+ /**
+ * write the views to the plugin config file
+ */
+ void writeConfig();
+
+ /**
+ * read the views from the plugin config file
+ */
+ void readConfig();
+
+ ViewMap m_projectViews; //container for the views
+
+ KAction *m_savePrjViewAction;
+ KAction *m_newPrjViewAction;
+ KAction *m_deleteCurrentPrjViewAction;
+ KSelectAction *m_openPrjViewAction;
+ KSelectAction *m_deletePrjViewAction;
+
+ QString m_currentProjectView;
+ QString m_defaultProjectView; // load this after project loaded
+
+ KURL m_projectBase; // project base folder
+ ConfigWidgetProxy *m_configProxy;
+
+ QGuardedPtr<QWidget> m_widget;
+ QGuardedPtr<ToolbarGUIBuilder> m_guibuilder;
+ QWidget * m_toolbarWidget;
+
+ bool m_restored;
+};
+
+
+#endif
diff --git a/parts/filelist/projectviewprojectconfig.cpp b/parts/filelist/projectviewprojectconfig.cpp
new file mode 100644
index 00000000..eb2d1b49
--- /dev/null
+++ b/parts/filelist/projectviewprojectconfig.cpp
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens.herden@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <kcombobox.h>
+
+#include "projectviewprojectconfig.h"
+
+#include "projectviewpart.h"
+
+ProjectviewProjectConfig::ProjectviewProjectConfig(ProjectviewPart *part, QWidget *parent, const char *name)
+ : ProjectviewProjectConfigBase(parent, name), m_part(part)
+{
+ kComboDefault->clear();
+ kComboDefault->insertItem("");
+ kComboDefault->insertStringList( m_part->getViewList() );
+ kComboDefault->setCurrentItem( m_part->getDefaultView() );
+}
+
+void ProjectviewProjectConfig::accept()
+{
+ m_part->setDefaultView( kComboDefault->currentText() );
+}
+
+#include "projectviewprojectconfig.moc"
diff --git a/parts/filelist/projectviewprojectconfig.h b/parts/filelist/projectviewprojectconfig.h
new file mode 100644
index 00000000..03928642
--- /dev/null
+++ b/parts/filelist/projectviewprojectconfig.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens.herden@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef PROJECTVIEW_PROJECT_CONFIG_H
+#define PROJECTVIEW_PROJECT_CONFIG_H
+
+#include "projectviewprojectconfigbase.h"
+
+class ProjectviewPart;
+
+class ProjectviewProjectConfig: public ProjectviewProjectConfigBase
+{
+ Q_OBJECT
+public:
+ ProjectviewProjectConfig(ProjectviewPart *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ ProjectviewPart *m_part;
+};
+
+#endif
diff --git a/parts/filelist/projectviewprojectconfigbase.ui b/parts/filelist/projectviewprojectconfigbase.ui
new file mode 100644
index 00000000..7ff9a0b0
--- /dev/null
+++ b/parts/filelist/projectviewprojectconfigbase.ui
@@ -0,0 +1,94 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ProjectviewProjectConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ProjectviewProjectConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Projectviews</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <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>Open this session after project load:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="0" column="1">
+ <property name="name">
+ <cstring>kComboDefault</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>select a session</string>
+ </property>
+ </widget>
+ <spacer row="0" 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>265</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer4</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>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/filelist/toolbarguibuilder.cpp b/parts/filelist/toolbarguibuilder.cpp
new file mode 100644
index 00000000..2e82691b
--- /dev/null
+++ b/parts/filelist/toolbarguibuilder.cpp
@@ -0,0 +1,59 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "toolbarguibuilder.h"
+
+#include <ktoolbar.h>
+
+ToolbarGUIBuilder::ToolbarGUIBuilder(QWidget *parent, QWidget *widget)
+ : KXMLGUIBuilder(widget), KToolBar(parent, "ToolbarGUIbuilder"), m_parent(parent)
+{
+// setHidden(true);
+ setFrameStyle(0);
+}
+
+
+ToolbarGUIBuilder::~ToolbarGUIBuilder()
+{
+}
+
+QWidget * ToolbarGUIBuilder::createContainer(QWidget *parent, int index, const QDomElement &element, int &id)
+{
+ if (element.tagName().lower() == "toolbar")
+ {
+ reparent(m_parent, QPoint(0, 0), true);
+ return this;
+ } else
+ {
+ return KXMLGUIBuilder::createContainer(parent, index, element, id);
+ }
+}
+
+void ToolbarGUIBuilder::removeContainer(QWidget *container, QWidget *parent, QDomElement &element, int id)
+{
+ if (container == this)
+ {
+ // i need to reparent to prevent a crash
+ reparent(0, QPoint(0, 0));
+ }
+ else
+ KXMLGUIBuilder::removeContainer(container, parent, element, id);
+}
+
diff --git a/parts/filelist/toolbarguibuilder.h b/parts/filelist/toolbarguibuilder.h
new file mode 100644
index 00000000..1f92b922
--- /dev/null
+++ b/parts/filelist/toolbarguibuilder.h
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Herden *
+ * jens@kdewebdev.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef TOOLBARGUIBUILDER_H
+#define TOOLBARGUIBUILDER_H
+
+#include <kxmlguibuilder.h>
+#include <kdebug.h>
+#include <ktoolbar.h>
+
+
+/**
+* Reimplemented the KXMLGUIBuilder in order use our toolbar in the
+* toolview
+* @author Jens Herden
+*/
+class ToolbarGUIBuilder : public KXMLGUIBuilder, public KToolBar
+{
+public:
+ ToolbarGUIBuilder(QWidget *parent, QWidget *widget);
+
+ virtual ~ToolbarGUIBuilder();
+
+ /**
+ * Called when a new XML gui client is added to the gui factory.
+ */
+ virtual QWidget *createContainer(QWidget *parent, int index, const QDomElement &element, int &id);
+
+ /**
+ * Called when a XML gui client is removed the gui factory.
+ * Reimplemented from KXMLGUIBuilder in order to remove our custom toolbar.
+ */
+ virtual void removeContainer(QWidget *container, QWidget *parent, QDomElement &element, int id);
+
+private:
+ QWidget * m_parent;
+};
+
+
+
+#endif
diff --git a/parts/fileselector/Makefile.am b/parts/fileselector/Makefile.am
new file mode 100644
index 00000000..f459fa79
--- /dev/null
+++ b/parts/fileselector/Makefile.am
@@ -0,0 +1,18 @@
+# Here resides the file selector part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/sourceinfo $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfileselector.la
+libkdevfileselector_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfileselector_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfileselector_la_SOURCES = fileselector_part.cpp fileselector_widget.cpp kactionselector.cpp kbookmarkhandler.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfileselector.desktop
+
+# not used currently
+#rcdir = $(kde_datadir)/kdevfileselector
+#rc_DATA = kdevfileselector.rc
diff --git a/parts/fileselector/README.dox b/parts/fileselector/README.dox
new file mode 100644
index 00000000..61a0047a
--- /dev/null
+++ b/parts/fileselector/README.dox
@@ -0,0 +1,13 @@
+/** \class FileSelectorPart
+Powerful network transparent file browser utility
+
+\authors <a href="mailto:anders.lund AT lund.tdcadsl.dk">Anders Lund</a> Copyright (C) 2001
+
+\maintainer <a href="mailto:jowenn AT kde.org">Joseph Wenninger</a> Copyright (C) 2001
+\maintainer <a href="mailto:cullmann AT kde.org">Christoph Cullmann</a> Copyright (C) 2001
+\maintainer <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a> Copyright (C) 2003
+\maintainer <a href="mailto:cloudtemple AT mksat.net">Alexander Dymo</a> Copyright (C) 2003
+
+\feature Powerful network transparent file browser utility
+
+*/
diff --git a/parts/fileselector/fileselector_part.cpp b/parts/fileselector/fileselector_part.cpp
new file mode 100644
index 00000000..20a3d27a
--- /dev/null
+++ b/parts/fileselector/fileselector_part.cpp
@@ -0,0 +1,108 @@
+#include "fileselector_part.h"
+
+#include <qwhatsthis.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qslider.h>
+#include <qvbox.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <ktextbrowser.h>
+#include <kconfig.h>
+#include <kfileitem.h>
+#include <kdevgenericfactory.h>
+#include <kdiroperator.h>
+#include <kdialogbase.h>
+#include <kmessagebox.h>
+
+#include <kdevapi.h>
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+#include <kdevplugininfo.h>
+#include <kdevcreatefile.h>
+
+#include <ktip.h>
+
+#include "fileselector_widget.h"
+
+typedef KDevGenericFactory<FileSelectorPart> FileSelectorFactory;
+static const KDevPluginInfo data("kdevfileselector");
+K_EXPORT_COMPONENT_FACTORY( libkdevfileselector, FileSelectorFactory( data ) )
+
+FileSelectorPart::FileSelectorPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "FileSelectorPart")
+{
+ setInstance(FileSelectorFactory::instance());
+
+ m_filetree = new KDevFileSelector( this, mainWindow(), partController(), 0, "fileselectorwidget" );
+
+ connect( m_filetree->dirOperator(), SIGNAL(fileSelected(const KFileItem*)),
+ this, SLOT(fileSelected(const KFileItem*)));
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+
+ connect( core(), SIGNAL(configWidget(KDialogBase*)), this, SLOT(slotConfigWidget(KDialogBase*)) );
+
+ m_filetree->setCaption( i18n("File Selector") );
+ m_filetree->setIcon( SmallIcon( info()->icon() ) );
+ mainWindow()->embedSelectView( m_filetree, i18n("File Selector"), i18n("File selector") );
+ QWhatsThis::add(m_filetree, i18n("<b>File selector</b><p>This file selector lists directory contents and provides some file management functions."));
+
+ m_filetree->readConfig( instance()->config(), "fileselector" );
+
+ m_newFileAction = new KAction(i18n("New File..."), CTRL+ALT+SHIFT+Key_N, this, SLOT(newFile()), this);
+}
+
+FileSelectorPart::~FileSelectorPart()
+{
+ if (m_filetree){
+ mainWindow()->removeView( m_filetree );
+ }
+
+ delete (KDevFileSelector*) m_filetree;
+}
+
+void FileSelectorPart::fileSelected( const KFileItem * file )
+{
+ KURL u(file->url());
+
+ partController()->editDocument( u );
+}
+
+void FileSelectorPart::slotProjectOpened()
+{
+ KURL u;
+ u.setPath( project()->projectDirectory() );
+ m_filetree->setDir( u );
+}
+
+void FileSelectorPart::slotConfigWidget( KDialogBase * dlg )
+{
+ QVBox* vbox = dlg->addVBoxPage( i18n("File Selector"), i18n("File Selector"), BarIcon( info()->icon(), KIcon::SizeMedium) );
+ KFSConfigPage* page = new KFSConfigPage( vbox, 0, m_filetree );
+ connect( dlg, SIGNAL( okClicked( ) ), page, SLOT( apply( ) ) );
+ // ### implement reload
+}
+
+void FileSelectorPart::newFile()
+{
+ KDevCreateFile *creator = extension<KDevCreateFile>("KDevelop/CreateFile");
+ if (creator)
+ {
+ KDevCreateFile::CreatedFile file = creator->createNewFile("",
+ m_filetree->dirOperator()->url().path());
+ if (file.status == KDevCreateFile::CreatedFile::STATUS_NOTCREATED)
+ KMessageBox::error(0, i18n("Cannot create file. Check whether the directory and filename are valid."));
+ else if (file.status != KDevCreateFile::CreatedFile::STATUS_CANCELED)
+ {
+ partController()->editDocument(KURL::fromPathOrURL(
+ file.dir + "/" + file.filename));
+ }
+ }
+}
+
+#include "fileselector_part.moc"
diff --git a/parts/fileselector/fileselector_part.h b/parts/fileselector/fileselector_part.h
new file mode 100644
index 00000000..d12befb2
--- /dev/null
+++ b/parts/fileselector/fileselector_part.h
@@ -0,0 +1,40 @@
+#ifndef __KDEVPART_FILESELECTOR_H__
+#define __KDEVPART_FILESELECTOR_H__
+
+#include <kdevplugin.h>
+
+#include <kdialogbase.h>
+#include <kfileitem.h>
+
+#include <qguardedptr.h>
+
+class KDevFileSelector;
+class KDialogBase;
+
+class FileSelectorPart : public KDevPlugin
+{
+ Q_OBJECT
+public:
+ FileSelectorPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~FileSelectorPart();
+
+ KAction *newFileAction() const { return m_newFileAction; }
+
+public slots:
+// void showTip();
+// void showOnStart();
+// void refresh();
+ void newFile();
+ void fileSelected(const KFileItem *file);
+
+private slots:
+ void slotProjectOpened();
+ void slotConfigWidget( KDialogBase * );
+
+private:
+ QGuardedPtr<KDevFileSelector> m_filetree;
+ KAction *m_newFileAction;
+};
+
+
+#endif
diff --git a/parts/fileselector/fileselector_widget.cpp b/parts/fileselector/fileselector_widget.cpp
new file mode 100644
index 00000000..41fab166
--- /dev/null
+++ b/parts/fileselector/fileselector_widget.cpp
@@ -0,0 +1,821 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ 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>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+//BEGIN Includes
+#include "fileselector_part.h"
+#include "fileselector_widget.h"
+#include "kactionselector.h"
+#include "kbookmarkhandler.h"
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <qhbox.h>
+#include <qvbox.h>
+#include <qlabel.h>
+#include <qstrlist.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qapplication.h>
+#include <qlistbox.h>
+#include <qscrollbar.h>
+#include <qspinbox.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qregexp.h>
+#include <qdockarea.h>
+#include <qtimer.h>
+
+#include <ktexteditor/document.h>
+
+#include <kmainwindow.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <kurlcombobox.h>
+#include <kurlcompletion.h>
+#include <kprotocolinfo.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kcombobox.h>
+#include <kaction.h>
+#include <kmessagebox.h>
+#include <ktoolbarbutton.h>
+#include <qtoolbar.h>
+#include <kpopupmenu.h>
+#include <kdialog.h>
+#include <kio/netaccess.h>
+
+#include <kdebug.h>
+//END Includes
+
+
+// from kfiledialog.cpp - avoid qt warning in STDERR (~/.xsessionerrors)
+static void silenceQToolBar(QtMsgType, const char *)
+{}
+
+
+KDevFileSelectorToolBar::KDevFileSelectorToolBar(QWidget *parent)
+ : KToolBar( parent, "KDev FileSelector Toolbar", true )
+{
+ setMinimumWidth(10);
+}
+
+KDevFileSelectorToolBar::~KDevFileSelectorToolBar()
+{}
+
+void KDevFileSelectorToolBar::setMovingEnabled( bool)
+{
+ KToolBar::setMovingEnabled(false);
+}
+
+
+KDevFileSelectorToolBarParent::KDevFileSelectorToolBarParent(QWidget *parent)
+ :QFrame(parent),m_tb(0)
+{}
+KDevFileSelectorToolBarParent::~KDevFileSelectorToolBarParent()
+{}
+void KDevFileSelectorToolBarParent::setToolBar(KDevFileSelectorToolBar *tb)
+{
+ m_tb=tb;
+}
+
+void KDevFileSelectorToolBarParent::resizeEvent ( QResizeEvent * )
+{
+ if (m_tb)
+ {
+ setMinimumHeight(m_tb->sizeHint().height());
+ m_tb->resize(width(),height());
+ }
+}
+
+
+//BEGIN Constructor/destructor
+
+KDevFileSelector::KDevFileSelector( FileSelectorPart *part, KDevMainWindow *mainWindow,
+ KDevPartController *partController,
+ QWidget * parent, const char * name )
+ : QWidget(parent, name),
+ m_part(part),
+ mainwin(mainWindow),
+ partController(partController)
+{
+ mActionCollection = new KActionCollection( this );
+
+ QVBoxLayout* lo = new QVBoxLayout(this);
+
+ QtMsgHandler oldHandler = qInstallMsgHandler( silenceQToolBar );
+
+ KDevFileSelectorToolBarParent *tbp=new KDevFileSelectorToolBarParent(this);
+ toolbar = new KDevFileSelectorToolBar(tbp);
+ tbp->setToolBar(toolbar);
+ lo->addWidget(tbp);
+ toolbar->setMovingEnabled(false);
+ toolbar->setFlat(true);
+ qInstallMsgHandler( oldHandler );
+
+ cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" );
+ cmbPath->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ KURLCompletion* cmpl = new KURLCompletion(KURLCompletion::DirCompletion);
+ cmbPath->setCompletionObject( cmpl );
+ lo->addWidget(cmbPath);
+ cmbPath->listBox()->installEventFilter( this );
+
+ dir = new KDevDirOperator(m_part, KURL(), this, "operator");
+ dir->setView(KFile::/*Simple*/Detail);
+
+ KActionCollection *coll = dir->actionCollection();
+ // some shortcuts of diroperator that clashes with KDev
+ 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 ) );
+
+ lo->addWidget(dir);
+ lo->setStretchFactor(dir, 2);
+
+ // bookmarks action!
+ KActionMenu *acmBookmarks = new KActionMenu( i18n("Bookmarks"), "bookmark",
+ mActionCollection, "bookmarks" );
+ acmBookmarks->setDelayed( false );
+
+ bookmarkHandler = new KBookmarkHandler( this, acmBookmarks->popupMenu() );
+
+ QHBox* filterBox = new QHBox(this);
+
+ btnFilter = new QToolButton( filterBox );
+ btnFilter->setIconSet( SmallIconSet("filter" ) );
+ btnFilter->setToggleButton( true );
+ filter = new KHistoryCombo( true, filterBox, "filter");
+ filter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ filterBox->setStretchFactor(filter, 2);
+ connect( btnFilter, SIGNAL( clicked() ), this, SLOT( btnFilterClick() ) );
+ lo->addWidget(filterBox);
+
+ connect( filter, SIGNAL( activated(const QString&) ),
+ SLOT( slotFilterChange(const QString&) ) );
+
+ connect( filter, SIGNAL( textChanged(const QString&) ),
+ SLOT( slotFilterChange(const QString&) ) );
+ connect( filter, SIGNAL( returnPressed(const QString&) ),
+ filter, SLOT( addToHistory(const QString&) ) );
+
+ // kaction for the dir sync method
+ acSyncDir = new KAction( i18n("Current Document Directory"), "dirsynch", 0,
+ this, SLOT( setActiveDocumentDir() ), mActionCollection, "sync_dir" );
+ toolbar->setIconText( KToolBar::IconOnly );
+ toolbar->setIconSize( 16 );
+ toolbar->setEnableContextMenu( false );
+
+ 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&)) );
+
+ connect(dir, SIGNAL(finishedLoading()),
+ this, SLOT(dirFinishedLoading()) );
+
+ // enable dir sync button if current doc has a valid URL
+ connect ( partController, SIGNAL(activePartChanged(KParts::Part*) ),
+ this, SLOT(viewChanged() ) );
+
+ // Connect the bookmark handler
+ connect( bookmarkHandler, SIGNAL( openURL( const QString& )),
+ this, SLOT( setDir( const QString& ) ) );
+
+ waitingUrl = QString::null;
+
+ // whatsthis help
+ QWhatsThis::add
+ ( cmbPath,
+ i18n("<p>Here you can enter a path for a directory to display."
+ "<p>To go to a directory previously entered, press the arrow on "
+ "the right and choose one. <p>The entry has directory "
+ "completion. Right-click to choose how completion should behave.") );
+ QWhatsThis::add
+ ( filter,
+ i18n("<p>Here you can enter a name filter to limit which files are displayed."
+ "<p>To clear the filter, toggle off the filter button to the left."
+ "<p>To reapply the last filter used, toggle on the filter button." ) );
+ QWhatsThis::add
+ ( btnFilter,
+ i18n("<p>This button clears the name filter when toggled off, or "
+ "reapplies the last filter used when toggled on.") );
+}
+
+KDevFileSelector::~KDevFileSelector()
+{
+ writeConfig( m_part->instance()->config(), "fileselector" );
+}
+//END Constroctor/Destrctor
+
+//BEGIN Public Methods
+
+void KDevFileSelector::readConfig(KConfig *config, const QString & name)
+{
+ dir->readConfig(config, name + ":dir");
+ dir->setView( KFile::Default );
+
+ config->setGroup( name );
+
+ // set up the toolbar
+ setupToolbar( config );
+
+ cmbPath->setMaxItems( config->readNumEntry( "pathcombo history len", 9 ) );
+ cmbPath->setURLs( config->readPathListEntry("dir history") );
+ // if we restore history
+ if ( config->readBoolEntry( "restore location", true ) || kapp->isRestored() )
+ {
+ QString loc( config->readPathEntry( "location" ) );
+ if ( ! loc.isEmpty() )
+ {
+ waitingDir = loc;
+ QTimer::singleShot(0, this, SLOT(initialDirChangeHack()));
+ }
+ }
+
+ // else is automatic, as cmpPath->setURL is called when a location is entered.
+
+ filter->setMaxCount( config->readNumEntry( "filter history len", 9 ) );
+ filter->setHistoryItems( config->readListEntry("filter history"), true );
+ lastFilter = config->readEntry( "last filter" );
+ QString flt("");
+ if ( config->readBoolEntry( "restore last filter", true ) || kapp->isRestored() )
+ flt = config->readEntry("current filter");
+ filter->lineEdit()->setText( flt );
+ slotFilterChange( flt );
+
+ autoSyncEvents = config->readNumEntry( "AutoSyncEvents", 0 );
+ // connect events as needed
+ /// @todo - solve startup problem: no need to set location for each doc opened!
+ if ( autoSyncEvents & DocumentChanged )
+ connect( partController, SIGNAL( viewChanged() ), this, SLOT( autoSync() ) );
+
+ if ( autoSyncEvents & DocumentOpened )
+ connect( partController, SIGNAL( partAdded(KParts::Part*) ),
+ this, SLOT( autoSync(KParts::Part*) ) );
+
+}
+
+void KDevFileSelector::initialDirChangeHack()
+{
+ setDir( waitingDir );
+}
+
+void KDevFileSelector::setupToolbar( KConfig *config )
+{
+ toolbar->clear();
+ QStringList tbactions = config->readListEntry( "toolbar actions", ',' );
+ if ( tbactions.isEmpty() )
+ {
+ // resonable collection for default toolbar
+ tbactions << "up" << "back" << "forward" << "home" <<
+ "short view" << "detailed view" <<
+ "bookmarks" << "sync_dir";
+ }
+ KAction *ac;
+ for ( QStringList::Iterator it=tbactions.begin(); it != tbactions.end(); ++it )
+ {
+ if ( *it == "bookmarks" || *it == "sync_dir" )
+ ac = mActionCollection->action( (*it).latin1() );
+ else
+ ac = dir->actionCollection()->action( (*it).latin1() );
+ if ( ac )
+ ac->plug( toolbar );
+ }
+}
+
+void KDevFileSelector::writeConfig(KConfig *config, const QString & name)
+{
+ dir->writeConfig(config,name + ":dir");
+
+ config->setGroup( name );
+ config->writeEntry( "pathcombo history len", cmbPath->maxItems() );
+ QStringList l;
+ for (int i = 0; i < cmbPath->count(); i++)
+ {
+ l.append( cmbPath->text( i ) );
+ }
+ config->writePathEntry( "dir history", l );
+ config->writePathEntry( "location", cmbPath->currentText() );
+
+ config->writeEntry( "filter history len", filter->maxCount() );
+ config->writeEntry( "filter history", filter->historyItems() );
+ config->writeEntry( "current filter", filter->currentText() );
+ config->writeEntry( "last filter", lastFilter );
+ config->writeEntry( "AutoSyncEvents", autoSyncEvents );
+}
+
+void KDevFileSelector::setView(KFile::FileView view)
+{
+ dir->setView(view);
+}
+
+//END Public Methods
+
+//BEGIN Public Slots
+
+void KDevFileSelector::slotFilterChange( const QString & nf )
+{
+ QToolTip::remove( btnFilter );
+ QString f = nf.stripWhiteSpace();
+ bool empty = f.isEmpty() || f == "*";
+ if ( empty )
+ {
+ dir->clearFilter();
+ filter->lineEdit()->setText( QString::null );
+ QToolTip::add
+ ( btnFilter,
+ QString( i18n("Apply last filter (\"%1\")") ).arg( lastFilter ) );
+ }
+ else
+ {
+ if ( !f.startsWith( "*" ) )
+ f.prepend( '*' );
+ if ( !f.endsWith( "*" ) )
+ f.append( '*' );
+ dir->setNameFilter( f );
+ lastFilter = f;
+ QToolTip::add
+ ( btnFilter, i18n("Clear filter") );
+ }
+ btnFilter->setOn( !empty );
+ dir->updateDir();
+ // this will be never true after the filter has been used;)
+ btnFilter->setEnabled( !( empty && lastFilter.isEmpty() ) );
+
+}
+void KDevFileSelector::setDir( KURL u )
+{
+ dir->setURL(u, true);
+}
+
+//END Public Slots
+
+//BEGIN Private Slots
+
+void KDevFileSelector::cmbPathActivated( const KURL& u )
+{
+ cmbPathReturnPressed( u.url() );
+}
+
+void KDevFileSelector::cmbPathReturnPressed( const QString& u )
+{
+ QStringList urls = cmbPath->urls();
+ urls.remove( u );
+ urls.prepend( u );
+ cmbPath->setURLs( urls, KURLComboBox::RemoveBottom );
+ dir->setFocus();
+ dir->setURL( KURL(u), true );
+}
+
+void KDevFileSelector::dirUrlEntered( const KURL& u )
+{
+ cmbPath->setURL( u );
+}
+
+void KDevFileSelector::dirFinishedLoading()
+{}
+
+
+/*
+ When the button in the filter box toggles:
+ If off:
+ If the name filer is anything but "" or "*", reset it.
+ If on:
+ Set last filter.
+*/
+void KDevFileSelector::btnFilterClick()
+{
+ if ( !btnFilter->isOn() )
+ {
+ slotFilterChange( QString::null );
+ }
+ else
+ {
+ filter->lineEdit()->setText( lastFilter );
+ slotFilterChange( lastFilter );
+ }
+}
+
+
+void KDevFileSelector::autoSync()
+{
+ kdDebug()<<"KDevFileSelector::autoSync()"<<endl;
+ // if visible, sync
+ if ( isVisible() )
+ {
+ setActiveDocumentDir();
+ waitingUrl = QString::null;
+ }
+ // else set waiting url
+ else
+ {
+ KURL u = activeDocumentUrl();
+ if (!u.isEmpty())
+ waitingUrl = u.directory();
+ }
+}
+
+void KDevFileSelector::autoSync( KParts::Part *part )
+{
+ KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
+ if( !doc )
+ return;
+
+ // as above, but using document url.
+ kdDebug()<<"KDevFileSelector::autoSync( KTextEditor::Document )"<<endl;
+ KURL u ( doc->url() );
+ if ( u.isEmpty() )
+ {
+ waitingUrl = QString::null;
+ return;
+ }
+ if ( isVisible() )
+ {
+ setDir( u.directory() );
+ waitingUrl = QString::null;
+ }
+ else
+ {
+ waitingUrl = u.directory();
+ }
+}
+/// \FIXME crash on shutdown
+void KDevFileSelector::setActiveDocumentDir()
+{
+ //kdDebug()<<"KDevFileSelector::setActiveDocumentDir()"<<endl;
+ KURL u = activeDocumentUrl();
+ if (!u.isEmpty())
+ setDir( u.upURL() );
+}
+
+void KDevFileSelector::viewChanged()
+{
+ /// @todo make sure the button is disabled if the directory is unreadable, eg
+ /// the document URL has protocol http
+ acSyncDir->setEnabled( ! activeDocumentUrl().directory().isEmpty() );
+}
+
+//END Private Slots
+
+//BEGIN Protected
+
+void KDevFileSelector::focusInEvent( QFocusEvent * )
+{
+ dir->setFocus();
+}
+
+void KDevFileSelector::showEvent( QShowEvent * )
+{
+ // sync if we should
+ if ( autoSyncEvents & GotVisible )
+ {
+ kdDebug()<<"syncing fs on show"<<endl;
+ setActiveDocumentDir();
+ waitingUrl = QString::null;
+ }
+ // else, if we have a waiting URL set it
+ else if ( ! waitingUrl.isEmpty() )
+ {
+ setDir( waitingUrl );
+ waitingUrl = QString::null;
+ }
+}
+
+bool KDevFileSelector::eventFilter( QObject* o, QEvent *e )
+{
+ /*
+ This is rather unfortunate, but:
+ QComboBox does not support setting the size of the listbox to something
+ resonable. Even using listbox->setVariableWidth() does not yeld a
+ satisfying result, something is wrong with the handling of the sizehint.
+ And the popup is rather useless, if the paths are only partly visible.
+ */
+ QListBox *lb = cmbPath->listBox();
+ if ( o == lb && e->type() == QEvent::Show )
+ {
+ int add
+ = lb->height() < lb->contentsHeight() ? lb->verticalScrollBar()->width() : 0;
+ int w = QMIN( mainwin->main()->width(), lb->contentsWidth() + add );
+ lb->resize( w, lb->height() );
+ /// @todo - move the listbox to a suitable place if nessecary
+ /// @todo - decide if it is worth caching the size while untill the contents
+ /// are changed.
+ }
+ /// @todo - same thing for the completion popup?
+ return QWidget::eventFilter( o, e );
+}
+
+//END Protected
+
+//BEGIN ACtionLBItem
+/*
+ QListboxItem that can store and return a string,
+ used for the toolbar action selector.
+*/
+class ActionLBItem : public QListBoxPixmap
+{
+public:
+ ActionLBItem( QListBox *lb=0,
+ const QPixmap &pm = QPixmap(),
+ const QString &text=QString::null,
+ const QString &str=QString::null ) :
+ QListBoxPixmap( lb, pm, text ),
+ _str(str)
+ {}
+ ;
+ QString idstring()
+ {
+ return _str;
+ };
+private:
+ QString _str;
+};
+
+KURL KDevFileSelector::activeDocumentUrl( )
+{
+ KParts::ReadOnlyPart * part = dynamic_cast<KParts::ReadOnlyPart*>( partController->activePart() );
+ if ( part )
+ {
+ return part->url();
+ }
+
+ return KURL();
+}
+//END ActionLBItem
+
+//BEGIN KFSConfigPage
+////////////////////////////////////////////////////////////////////////////////
+// KFSConfigPage implementation
+////////////////////////////////////////////////////////////////////////////////
+KFSConfigPage::KFSConfigPage( QWidget *parent, const char *name, KDevFileSelector *kfs )
+ : QWidget( parent, name ),
+ fileSelector( kfs ),
+ bDirty( false )
+{
+ QVBoxLayout *lo = new QVBoxLayout( this );
+ int spacing = KDialog::spacingHint();
+ lo->setSpacing( spacing );
+
+ // Toolbar - a lot for a little...
+ QGroupBox *gbToolbar = new QGroupBox( 1, Qt::Vertical, i18n("Toolbar"), this );
+ acSel = new KActionSelector( gbToolbar );
+ acSel->setAvailableLabel( i18n("A&vailable actions:") );
+ acSel->setSelectedLabel( i18n("S&elected actions:") );
+ lo->addWidget( gbToolbar );
+ connect( acSel, SIGNAL( added( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
+ connect( acSel, SIGNAL( removed( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
+ connect( acSel, SIGNAL( movedUp( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
+ connect( acSel, SIGNAL( movedDown( QListBoxItem * ) ), this, SLOT( slotChanged() ) );
+
+ // Sync
+ QGroupBox *gbSync = new QGroupBox( 1, Qt::Horizontal, i18n("Auto Synchronization"), this );
+ cbSyncActive = new QCheckBox( i18n("When a docu&ment becomes active"), gbSync );
+ cbSyncOpen = new QCheckBox( i18n("When a document is o&pened"), gbSync );
+ cbSyncShow = new QCheckBox( i18n("When the file selector becomes visible"), gbSync );
+ lo->addWidget( gbSync );
+ connect( cbSyncActive, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+ connect( cbSyncOpen, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+ connect( cbSyncShow, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+
+ // Histories
+ QHBox *hbPathHist = new QHBox ( this );
+ QLabel *lbPathHist = new QLabel( i18n("Remember &locations:"), hbPathHist );
+ sbPathHistLength = new QSpinBox( hbPathHist );
+ lbPathHist->setBuddy( sbPathHistLength );
+ lo->addWidget( hbPathHist );
+ connect( sbPathHistLength, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
+
+ QHBox *hbFilterHist = new QHBox ( this );
+ QLabel *lbFilterHist = new QLabel( i18n("Remember &filters:"), hbFilterHist );
+ sbFilterHistLength = new QSpinBox( hbFilterHist );
+ lbFilterHist->setBuddy( sbFilterHistLength );
+ lo->addWidget( hbFilterHist );
+ connect( sbFilterHistLength, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
+
+ // Session
+ QGroupBox *gbSession = new QGroupBox( 1, Qt::Horizontal, i18n("Session"), this );
+ cbSesLocation = new QCheckBox( i18n("Restore loca&tion"), gbSession );
+ cbSesFilter = new QCheckBox( i18n("Restore last f&ilter"), gbSession );
+ lo->addWidget( gbSession );
+ connect( cbSesLocation, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+ connect( cbSesFilter, SIGNAL( toggled( bool ) ), this, SLOT( slotChanged() ) );
+
+ // make it look nice
+ lo->addStretch( 1 );
+
+ // be helpfull
+ /*
+ QWhatsThis::add( lbAvailableActions, i18n(
+ "<p>Available actions for the toolbar. To add an action, select it here "
+ "and press the add (<strong>-&gt;</strong>) button" ) );
+ QWhatsThis::add( lbUsedActions, i18n(
+ "<p>Actions used in the toolbar. To remove an action, select it and "
+ "press the remove (<strong>&lt;-</strong>) button."
+ "<p>To change the order of the actions, use the Up and Down buttons to "
+ "move the selected action.") );
+ */
+ QString lhwt( i18n(
+ "<p>Decides how many locations to keep in the history of the location "
+ "combo box") );
+ QWhatsThis::add
+ ( lbPathHist, lhwt );
+ QWhatsThis::add
+ ( sbPathHistLength, lhwt );
+ QString fhwt( i18n(
+ "<p>Decides how many filters to keep in the history of the filter "
+ "combo box") );
+ QWhatsThis::add
+ ( lbFilterHist, fhwt );
+ QWhatsThis::add
+ ( sbFilterHistLength, fhwt );
+ QString synwt( i18n(
+ "<p>These options allow you to have the File Selector automatically "
+ "change location to the directory of the active document on certain "
+ "events."
+ "<p>Auto synchronization is <em>lazy</em>, meaning it will not take "
+ "effect until the file selector is visible."
+ "<p>None of these are enabled by default, but you can always sync the "
+ "location by pressing the sync button in the toolbar.") );
+ QWhatsThis::add
+ ( gbSync, synwt );
+ QWhatsThis::add
+ ( cbSesLocation, i18n(
+ "<p>If this option is enabled (default), the location will be restored "
+ "when you start KDev.<p><strong>Note</strong> that if the session is "
+ "handled by the KDE session manager, the location is always restored.") );
+ QWhatsThis::add
+ ( cbSesFilter, i18n(
+ "<p>If this option is enabled (default), the current filter will be "
+ "restored when you start KDev.<p><strong>Note</strong> that if the "
+ "session is handled by the KDE session manager, the filter is always "
+ "restored."
+ "<p><strong>Note</strong> that some of the autosync settings may "
+ "override the restored location if on.") );
+
+ init();
+
+}
+
+void KFSConfigPage::apply()
+{
+ KConfig *config = fileSelector->m_part->instance()->config();
+ config->setGroup( "fileselector" );
+ // toolbar
+ QStringList l;
+ QListBoxItem *item = acSel->selectedListBox()->firstItem();
+ ActionLBItem *aItem;
+ while ( item )
+ {
+ aItem = (ActionLBItem*)item;
+ if ( aItem )
+ {
+ l << aItem->idstring();
+ }
+ item = item->next();
+ }
+ config->writeEntry( "toolbar actions", l );
+ fileSelector->setupToolbar( config );
+ // sync
+ int s = 0;
+ if ( cbSyncActive->isChecked() )
+ s |= KDevFileSelector::DocumentChanged;
+ if ( cbSyncOpen->isChecked() )
+ s |= KDevFileSelector::DocumentOpened;
+ if ( cbSyncShow->isChecked() )
+ s |= KDevFileSelector::GotVisible;
+ fileSelector->autoSyncEvents = s;
+ // reset connections
+ disconnect( fileSelector->partController, 0, fileSelector, SLOT( autoSync() ) );
+ disconnect( fileSelector->partController, 0,
+ fileSelector, SLOT( autoSync( KParts::Part *) ) );
+ if ( s & KDevFileSelector::DocumentChanged )
+ connect( fileSelector->partController, SIGNAL( viewChanged() ),
+ fileSelector, SLOT( autoSync() ) );
+ if ( s & KDevFileSelector::DocumentOpened )
+ connect( fileSelector->partController,
+ SIGNAL( partAdded(KParts::Part *) ),
+ fileSelector, SLOT( autoSync(KParts::Part *) ) );
+
+ // histories
+ fileSelector->cmbPath->setMaxItems( sbPathHistLength->value() );
+ fileSelector->filter->setMaxCount( sbFilterHistLength->value() );
+ // session - theese are read/written directly to the app config,
+ // as they are not needed during operation.
+ config->writeEntry( "restore location", cbSesLocation->isChecked() );
+ config->writeEntry( "restore last filter", cbSesFilter->isChecked() );
+}
+
+void KFSConfigPage::reload()
+{
+ // hmm, what is this supposed to do, actually??
+ init();
+}
+
+void KFSConfigPage::init()
+{
+ KConfig *config = fileSelector->m_part->instance()->config();
+ config->setGroup( "fileselector" );
+ // toolbar
+ QStringList l = config->readListEntry( "toolbar actions", ',' );
+ if ( l.isEmpty() ) // default toolbar
+ l << "up" << "back" << "forward" << "home" <<
+ "short view" << "detailed view" <<
+ "bookmarks" << "sync_dir";
+
+ // actions from diroperator + two of our own
+ QStringList allActions;
+ allActions << "up" << "back" << "forward" << "home" <<
+ "reload" << "mkdir" << "delete" <<
+ "short view" << "detailed view" /*<< "view menu" <<
+ "show hidden" << "properties"*/ <<
+ "bookmarks" << "sync_dir";
+ QRegExp re("&(?=[^&])");
+ KAction *ac;
+ QListBox *lb;
+ for ( QStringList::Iterator it=allActions.begin(); it != allActions.end(); ++it )
+ {
+ lb = l.contains( *it ) ? acSel->selectedListBox() : acSel->availableListBox();
+ if ( *it == "bookmarks" || *it == "sync_dir" )
+ ac = fileSelector->actionCollection()->action( (*it).latin1() );
+ else
+ ac = fileSelector->dirOperator()->actionCollection()->action( (*it).latin1() );
+ if ( ac )
+ new ActionLBItem( lb, SmallIcon( ac->icon() ), ac->text().replace( re, "" ), *it );
+ }
+
+ // sync
+ int s = fileSelector->autoSyncEvents;
+ cbSyncActive->setChecked( s & KDevFileSelector::DocumentChanged );
+ cbSyncOpen->setChecked( s & KDevFileSelector::DocumentOpened );
+ cbSyncShow->setChecked( s & KDevFileSelector::GotVisible );
+ // histories
+ sbPathHistLength->setValue( fileSelector->cmbPath->maxItems() );
+ sbFilterHistLength->setValue( fileSelector->filter->maxCount() );
+ // session
+ cbSesLocation->setChecked( config->readBoolEntry( "restore location", true ) );
+ cbSesFilter->setChecked( config->readBoolEntry( "restore last filter", true ) );
+}
+
+void KFSConfigPage::slotChanged()
+{
+}
+
+//END KFSConfigPage
+
+
+//BEGIN KDevDirOperator
+
+void KDevDirOperator::activatedMenu( const KFileItem *fi, const QPoint & pos )
+{
+ setupMenu();
+ updateSelectionDependentActions();
+
+ KActionMenu * am = dynamic_cast<KActionMenu*>(actionCollection()->action("popupMenu"));
+ if (!am)
+ return;
+ KPopupMenu *popup = am->popupMenu();
+
+ popup->insertSeparator();
+ m_part->newFileAction()->plug(popup);
+
+ if (fi)
+ {
+ FileContext context( KURL::List(fi->url()));
+ if ( (m_part) && (m_part->core()))
+ m_part->core()->fillContextMenu(popup, &context);
+ }
+
+ popup->popup(pos);
+}
+
+//END KDevDirOperator
+
+#include "fileselector_widget.moc"
diff --git a/parts/fileselector/fileselector_widget.h b/parts/fileselector/fileselector_widget.h
new file mode 100644
index 00000000..cb194760
--- /dev/null
+++ b/parts/fileselector/fileselector_widget.h
@@ -0,0 +1,203 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Roberto Raggi <roberto@kdevelop.org>
+ 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>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef FILESELECTOR_WIDGET_H
+#define FILESELECTOR_WIDGET_H
+
+#include <qwidget.h>
+#include <kfile.h>
+#include <kurl.h>
+#include <ktoolbar.h>
+#include <qframe.h>
+#include <kdiroperator.h>
+
+class KDevMainWindow;
+class KDevPartController;
+class FileSelectorPart;
+class KActionCollection;
+class KActionSelector;
+class KDirOperator;
+class KURLComboBox;
+class KHistoryCombo;
+
+namespace KParts
+{
+ class Part;
+}
+
+namespace KTextEditor
+{
+ class Document;
+}
+
+/*
+ The KDev file selector presents a directory view, in which the default action is
+ to open the activated file.
+ Additinally, a toolbar for managing the kdiroperator widget + sync that to
+ the directory of the current file is available, as well as a filter widget
+ allowing to filter the displayed files using a name filter.
+*/
+
+/* I think this fix for not moving toolbars is better */
+class KDevFileSelectorToolBar: public KToolBar
+{
+ Q_OBJECT
+public:
+ KDevFileSelectorToolBar(QWidget *parent);
+ virtual ~KDevFileSelectorToolBar();
+
+ virtual void setMovingEnabled( bool b );
+};
+
+class KDevFileSelectorToolBarParent: public QFrame
+{
+ Q_OBJECT
+public:
+ KDevFileSelectorToolBarParent(QWidget *parent);
+ ~KDevFileSelectorToolBarParent();
+ void setToolBar(KDevFileSelectorToolBar *tb);
+
+private:
+ KDevFileSelectorToolBar *m_tb;
+
+protected:
+ virtual void resizeEvent ( QResizeEvent * );
+};
+
+class KDevDirOperator: public KDirOperator
+{
+ Q_OBJECT
+public:
+ KDevDirOperator(FileSelectorPart *part, const KURL &urlName=KURL(), QWidget *parent=0, const char *name=0)
+ :KDirOperator(urlName, parent, name), m_part(part)
+ {
+ }
+
+protected slots:
+ virtual void activatedMenu (const KFileItem *fi, const QPoint &pos);
+
+private:
+ FileSelectorPart *m_part;
+};
+
+class KDevFileSelector : public QWidget
+{
+ Q_OBJECT
+
+ friend class KFSConfigPage;
+
+public:
+ /* When to sync to current document directory */
+ enum AutoSyncEvent { DocumentChanged=1, DocumentOpened=2, GotVisible=4 };
+
+ KDevFileSelector( FileSelectorPart *part, KDevMainWindow *mainWindow=0, KDevPartController *partController=0,
+ QWidget * parent = 0, const char * name = 0 );
+ ~KDevFileSelector();
+
+ void readConfig( KConfig *, const QString & );
+ void writeConfig( KConfig *, const QString & );
+ void setupToolbar( KConfig * );
+ void setView( KFile::FileView );
+ KDevDirOperator *dirOperator(){ return dir; }
+ KActionCollection *actionCollection() { return mActionCollection; };
+
+public slots:
+ void slotFilterChange(const QString&);
+ void setDir(KURL);
+ void setDir( const QString& url ) { setDir( KURL( url ) ); };
+
+private slots:
+ void cmbPathActivated( const KURL& u );
+ void cmbPathReturnPressed( const QString& u );
+ void dirUrlEntered( const KURL& u );
+ void dirFinishedLoading();
+ void setActiveDocumentDir();
+ void viewChanged();
+ void btnFilterClick();
+ void autoSync();
+ void autoSync( KParts::Part * );
+ void initialDirChangeHack();
+protected:
+ void focusInEvent( QFocusEvent * );
+ void showEvent( QShowEvent * );
+ bool eventFilter( QObject *, QEvent * );
+ KURL activeDocumentUrl();
+
+private:
+ class KDevFileSelectorToolBar *toolbar;
+ KActionCollection *mActionCollection;
+ class KBookmarkHandler *bookmarkHandler;
+ KURLComboBox *cmbPath;
+ KDevDirOperator * dir;
+ class KAction *acSyncDir;
+ KHistoryCombo * filter;
+ class QToolButton *btnFilter;
+
+ FileSelectorPart *m_part;
+ KDevMainWindow *mainwin;
+ KDevPartController *partController;
+
+ QString lastFilter;
+ int autoSyncEvents; // enabled autosync events
+ QString waitingUrl; // maybe display when we gets visible
+ QString waitingDir;
+};
+
+/* @todo anders
+ KFSFilterHelper
+ A popup widget presenting a listbox with checkable items
+ representing the mime types available in the current directory, and
+ providing a name filter based on those.
+*/
+
+/*
+ Config page for file selector.
+ Allows for configuring the toolbar, the history length
+ of the path and file filter combos, and how to handle
+ user closed session.
+*/
+class KFSConfigPage : public QWidget
+{
+ Q_OBJECT
+public:
+ KFSConfigPage( QWidget* parent=0, const char *name=0, KDevFileSelector *kfs=0);
+ virtual ~KFSConfigPage() {};
+
+public slots:
+ virtual void apply();
+ virtual void reload();
+ virtual void slotChanged();
+
+private:
+ void init();
+
+ KDevFileSelector *fileSelector;
+ bool bDirty;
+ //class QListBox *lbAvailableActions, *lbUsedActions;
+ KActionSelector *acSel;
+ class QSpinBox *sbPathHistLength, *sbFilterHistLength;
+ class QCheckBox *cbSyncOpen, *cbSyncActive, *cbSyncShow;
+ class QCheckBox *cbSesLocation, *cbSesFilter;
+};
+
+
+#endif
+
diff --git a/parts/fileselector/kactionselector.cpp b/parts/fileselector/kactionselector.cpp
new file mode 100644
index 00000000..5bf234a8
--- /dev/null
+++ b/parts/fileselector/kactionselector.cpp
@@ -0,0 +1,537 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+
+#include "kactionselector.h"
+
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kdialog.h> // for spacingHint()
+#include <kdebug.h>
+#include <qapplication.h>
+
+#include <qlistbox.h>
+#include <qtoolbutton.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qevent.h>
+#include <qwhatsthis.h>
+
+class KActionSelectorPrivate {
+ public:
+ QListBox *availableListBox, *selectedListBox;
+ QToolButton *btnAdd, *btnRemove, *btnUp, *btnDown;
+ QLabel *lAvailable, *lSelected;
+ bool moveOnDoubleClick, keyboardEnabled;
+ KActionSelector::ButtonIconSize iconSize;
+ QString addIcon, removeIcon, upIcon, downIcon;
+ KActionSelector::InsertionPolicy availableInsertionPolicy, selectedInsertionPolicy;
+ bool showUpDownButtons;
+};
+
+//BEGIN Constructor/destructor
+
+KActionSelector::KActionSelector( QWidget *parent, const char *name )
+ : QWidget( parent, name )
+{
+ d = new KActionSelectorPrivate();
+ d->moveOnDoubleClick = true;
+ d->keyboardEnabled = true;
+ d->iconSize = SmallIcon;
+ d->addIcon = QApplication::reverseLayout() ? "back" : "forward";
+ d->removeIcon = QApplication::reverseLayout() ? "forward" : "back";
+ d->upIcon = "up";
+ d->downIcon = "down";
+ d->availableInsertionPolicy = Sorted;
+ d->selectedInsertionPolicy = BelowCurrent;
+ d->showUpDownButtons = true;
+
+ //int isz = IconSize( KIcon::Small );
+
+ QHBoxLayout *lo = new QHBoxLayout( this );
+ lo->setSpacing( KDialog::spacingHint() );
+
+ QVBoxLayout *loAv = new QVBoxLayout( lo );
+ d->lAvailable = new QLabel( i18n("&Available:"), this );
+ loAv->addWidget( d->lAvailable );
+ d->availableListBox = new QListBox( this );
+ loAv->addWidget( d->availableListBox );
+ d->lAvailable->setBuddy( d->availableListBox );
+
+ QVBoxLayout *loHBtns = new QVBoxLayout( lo );
+ loHBtns->addStretch( 1 );
+ d->btnAdd = new QToolButton( this );
+ loHBtns->addWidget( d->btnAdd );
+ d->btnRemove = new QToolButton( this );
+ loHBtns->addWidget( d->btnRemove );
+ loHBtns->addStretch( 1 );
+
+ QVBoxLayout *loS = new QVBoxLayout( lo );
+ d->lSelected = new QLabel( i18n("&Selected:"), this );
+ loS->addWidget( d->lSelected );
+ d->selectedListBox = new QListBox( this );
+ loS->addWidget( d->selectedListBox );
+ d->lSelected->setBuddy( d->selectedListBox );
+
+ QVBoxLayout *loVBtns = new QVBoxLayout( lo );
+ loVBtns->addStretch( 1 );
+ d->btnUp = new QToolButton( this );
+ loVBtns->addWidget( d->btnUp );
+ d->btnDown = new QToolButton( this );
+ loVBtns->addWidget( d->btnDown );
+ loVBtns->addStretch( 1 );
+
+ loadIcons();
+
+ connect( d->btnAdd, SIGNAL(clicked()), this, SLOT(buttonAddClicked()) );
+ connect( d->btnRemove, SIGNAL(clicked()), this, SLOT(buttonRemoveClicked()) );
+ connect( d->btnUp, SIGNAL(clicked()), this, SLOT(buttonUpClicked()) );
+ connect( d->btnDown, SIGNAL(clicked()), this, SLOT(buttonDownClicked()) );
+ connect( d->availableListBox, SIGNAL(doubleClicked(QListBoxItem*)),
+ this, SLOT(itemDoubleClicked(QListBoxItem*)) );
+ connect( d->selectedListBox, SIGNAL(doubleClicked(QListBoxItem*)),
+ this, SLOT(itemDoubleClicked(QListBoxItem*)) );
+ connect( d->availableListBox, SIGNAL(currentChanged(QListBoxItem*)),
+ this, SLOT(slotCurrentChanged(QListBoxItem *)) );
+ connect( d->selectedListBox, SIGNAL(currentChanged(QListBoxItem*)),
+ this, SLOT(slotCurrentChanged(QListBoxItem *)) );
+
+ d->availableListBox->installEventFilter( this );
+ d->selectedListBox->installEventFilter( this );
+}
+
+KActionSelector::~KActionSelector()
+{
+ delete d;
+}
+
+//END Constructor/destroctor
+
+//BEGIN Public Methods
+
+QListBox *KActionSelector::availableListBox()
+{
+ return d->availableListBox;
+}
+
+QListBox *KActionSelector::selectedListBox()
+{
+ return d->selectedListBox;
+}
+
+void KActionSelector::setButtonIcon( const QString &icon, MoveButton button )
+{
+ switch ( button )
+ {
+ case ButtonAdd:
+ d->addIcon = icon;
+ d->btnAdd->setIconSet( SmallIconSet( icon, d->iconSize ) );
+ break;
+ case ButtonRemove:
+ d->removeIcon = icon;
+ d->btnRemove->setIconSet( SmallIconSet( icon, d->iconSize ) );
+ break;
+ case ButtonUp:
+ d->upIcon = icon;
+ d->btnUp->setIconSet( SmallIconSet( icon, d->iconSize ) );
+ break;
+ case ButtonDown:
+ d->downIcon = icon;
+ d->btnDown->setIconSet( SmallIconSet( icon, d->iconSize ) );
+ break;
+ default:
+ kdDebug()<<"KActionSelector::setButtonIcon: DAINBREAD!"<<endl;
+ }
+}
+
+void KActionSelector::setButtonIconSet( const QIconSet &iconset, MoveButton button )
+{
+ switch ( button )
+ {
+ case ButtonAdd:
+ d->btnAdd->setIconSet( iconset );
+ break;
+ case ButtonRemove:
+ d->btnRemove->setIconSet( iconset );
+ break;
+ case ButtonUp:
+ d->btnUp->setIconSet( iconset );
+ break;
+ case ButtonDown:
+ d->btnDown->setIconSet( iconset );
+ break;
+ default:
+ kdDebug()<<"KActionSelector::setButtonIconSet: DAINBREAD!"<<endl;
+ }
+}
+
+void KActionSelector::setButtonTooltip( const QString &tip, MoveButton button )
+{
+ switch ( button )
+ {
+ case ButtonAdd:
+ d->btnAdd->setTextLabel( tip );
+ break;
+ case ButtonRemove:
+ d->btnRemove->setTextLabel( tip );
+ break;
+ case ButtonUp:
+ d->btnUp->setTextLabel( tip );
+ break;
+ case ButtonDown:
+ d->btnDown->setTextLabel( tip );
+ break;
+ default:
+ kdDebug()<<"KActionSelector::setButtonToolTip: DAINBREAD!"<<endl;
+ }
+}
+
+void KActionSelector::setButtonWhatsThis( const QString &text, MoveButton button )
+{
+ switch ( button )
+ {
+ case ButtonAdd:
+ QWhatsThis::add( d->btnAdd, text );
+ break;
+ case ButtonRemove:
+ QWhatsThis::add( d->btnRemove, text );
+ break;
+ case ButtonUp:
+ QWhatsThis::add( d->btnUp, text );
+ break;
+ case ButtonDown:
+ QWhatsThis::add( d->btnDown, text );
+ break;
+ default:
+ kdDebug()<<"KActionSelector::setButtonWhatsThis: DAINBREAD!"<<endl;
+ }
+}
+
+void KActionSelector::setButtonsEnabled()
+{
+ d->btnAdd->setEnabled( d->availableListBox->currentItem() > -1 );
+ d->btnRemove->setEnabled( d->selectedListBox->currentItem() > -1 );
+ d->btnUp->setEnabled( d->selectedListBox->currentItem() > 0 );
+ d->btnDown->setEnabled( d->selectedListBox->currentItem() > -1 &&
+ d->selectedListBox->currentItem() < (int)d->selectedListBox->count() - 1 );
+}
+
+//END Public Methods
+
+//BEGIN Properties
+
+bool KActionSelector::moveOnDoubleClick() const
+{
+ return d->moveOnDoubleClick;
+}
+
+void KActionSelector::setMoveOnDoubleClick( bool b )
+{
+ d->moveOnDoubleClick = b;
+}
+
+bool KActionSelector::keyboardEnabled() const
+{
+ return d->keyboardEnabled;
+}
+
+void KActionSelector::setKeyboardEnabled( bool b )
+{
+ d->keyboardEnabled = b;
+}
+
+QString KActionSelector::availableLabel() const
+{
+ return d->lAvailable->text();
+}
+
+void KActionSelector::setAvailableLabel( const QString &text )
+{
+ d->lAvailable->setText( text );
+}
+
+QString KActionSelector::selectedLabel() const
+{
+ return d->lSelected->text();
+}
+
+void KActionSelector::setSelectedLabel( const QString &text )
+{
+ d->lSelected->setText( text );
+}
+
+KActionSelector::ButtonIconSize KActionSelector::buttonIconSize() const
+{
+ return d->iconSize;
+}
+
+void KActionSelector::setButtonIconSize( ButtonIconSize size )
+{
+ d->iconSize = size;
+ // reload icons
+ loadIcons();
+}
+
+KActionSelector::InsertionPolicy KActionSelector::availableInsertionPolicy() const
+{
+ return d->availableInsertionPolicy;
+}
+
+void KActionSelector::setAvailableInsertionPolicy( InsertionPolicy p )
+{
+ d->availableInsertionPolicy = p;
+}
+
+KActionSelector::InsertionPolicy KActionSelector::selectedInsertionPolicy() const
+{
+ return d->selectedInsertionPolicy;
+}
+
+void KActionSelector::setSelectedInsertionPolicy( InsertionPolicy p )
+{
+ d->selectedInsertionPolicy = p;
+}
+
+bool KActionSelector::showUpDownButtons() const
+{
+ return d->showUpDownButtons;
+}
+
+void KActionSelector::setShowUpDownButtons( bool show )
+{
+ d->showUpDownButtons = show;
+ if ( show )
+ {
+ d->btnUp->show();
+ d->btnDown->show();
+ }
+ else
+ {
+ d->btnUp->hide();
+ d->btnDown->hide();
+ }
+}
+
+//END Properties
+
+//BEGIN Public Slots
+
+void KActionSelector::polish()
+{
+ setButtonsEnabled();
+}
+
+//END Public Slots
+
+//BEGIN Protected
+void KActionSelector::keyPressEvent( QKeyEvent *e )
+{
+ if ( ! d->keyboardEnabled ) return;
+ if ( (e->state() & Qt::ControlButton) )
+ {
+ switch ( e->key() )
+ {
+ case Key_Right:
+ buttonAddClicked();
+ break;
+ case Key_Left:
+ buttonRemoveClicked();
+ break;
+ case Key_Up:
+ buttonUpClicked();
+ break;
+ case Key_Down:
+ buttonDownClicked();
+ break;
+ default:
+ e->ignore();
+ return;
+ }
+ }
+}
+
+bool KActionSelector::eventFilter( QObject *o, QEvent *e )
+{
+ if ( d->keyboardEnabled && e->type() == QEvent::KeyPress )
+ {
+ if ( (((QKeyEvent*)e)->state() & Qt::ControlButton) )
+ {
+ switch ( ((QKeyEvent*)e)->key() )
+ {
+ case Key_Right:
+ buttonAddClicked();
+ break;
+ case Key_Left:
+ buttonRemoveClicked();
+ break;
+ case Key_Up:
+ buttonUpClicked();
+ break;
+ case Key_Down:
+ buttonDownClicked();
+ break;
+ default:
+ return QWidget::eventFilter( o, e );
+ break;
+ }
+ return true;
+ }
+ else if ( o->inherits( "QListBox" ) )
+ {
+ switch ( ((QKeyEvent*)e)->key() )
+ {
+ case Key_Return:
+ case Key_Enter:
+ QListBox *lb = (QListBox*)o;
+ int index = lb->currentItem();
+ if ( index < 0 ) break;
+ moveItem( lb->item( index ) );
+ return true;
+ }
+ }
+ }
+ return QWidget::eventFilter( o, e );
+}
+
+//END Protected
+
+//BEGIN Private Slots
+
+void KActionSelector::buttonAddClicked()
+{
+ // move all selected items from available to selected listbox
+ QListBoxItem *item = d->availableListBox->firstItem();
+ while ( item ) {
+ if ( item->isSelected() ) {
+ d->availableListBox->takeItem( item );
+ d->selectedListBox->insertItem( item, insertionIndex( d->selectedListBox, d->selectedInsertionPolicy ) );
+ d->selectedListBox->setCurrentItem( item );
+ emit added( item );
+ }
+ item = item->next();
+ }
+ if ( d->selectedInsertionPolicy == Sorted )
+ d->selectedListBox->sort();
+ d->selectedListBox->setFocus();
+}
+
+void KActionSelector::buttonRemoveClicked()
+{
+ // move all selected items from selected to available listbox
+ QListBoxItem *item = d->selectedListBox->firstItem();
+ while ( item ) {
+ if ( item->isSelected() ) {
+ d->selectedListBox->takeItem( item );
+ d->availableListBox->insertItem( item, insertionIndex( d->availableListBox, d->availableInsertionPolicy ) );
+ d->availableListBox->setCurrentItem( item );
+ emit removed( item );
+ }
+ item = item->next();
+ }
+ if ( d->availableInsertionPolicy == Sorted )
+ d->availableListBox->sort();
+ d->availableListBox->setFocus();
+}
+
+void KActionSelector::buttonUpClicked()
+{
+ int c = d->selectedListBox->currentItem();
+ if ( c < 0 ) return;
+ QListBoxItem *item = d->selectedListBox->item( c );
+ d->selectedListBox->takeItem( item );
+ d->selectedListBox->insertItem( item, c-1 );
+ d->selectedListBox->setCurrentItem( item );
+ emit movedUp( item );
+}
+
+void KActionSelector::buttonDownClicked()
+{
+ int c = d->selectedListBox->currentItem();
+ if ( c < 0 ) return;
+ QListBoxItem *item = d->selectedListBox->item( c );
+ d->selectedListBox->takeItem( item );
+ d->selectedListBox->insertItem( item, c+1 );
+ d->selectedListBox->setCurrentItem( item );
+ emit movedDown( item );
+}
+
+void KActionSelector::itemDoubleClicked( QListBoxItem *item )
+{
+ if ( d->moveOnDoubleClick )
+ moveItem( item );
+}
+
+//END Private Slots
+
+//BEGIN Private Methods
+
+void KActionSelector::loadIcons()
+{
+ d->btnAdd->setIconSet( SmallIconSet( d->addIcon, d->iconSize ) );
+ d->btnRemove->setIconSet( SmallIconSet( d->removeIcon, d->iconSize ) );
+ d->btnUp->setIconSet( SmallIconSet( d->upIcon, d->iconSize ) );
+ d->btnDown->setIconSet( SmallIconSet( d->downIcon, d->iconSize ) );
+}
+
+void KActionSelector::moveItem( QListBoxItem *item )
+{
+ QListBox *lbFrom = item->listBox();
+ QListBox *lbTo;
+ if ( lbFrom == d->availableListBox )
+ lbTo = d->selectedListBox;
+ else if ( lbFrom == d->selectedListBox )
+ lbTo = d->availableListBox;
+ else //?! somewhat unlikely...
+ return;
+
+ InsertionPolicy p = ( lbTo == d->availableListBox ) ?
+ d->availableInsertionPolicy : d->selectedInsertionPolicy;
+
+ lbFrom->takeItem( item );
+ lbTo->insertItem( item, insertionIndex( lbTo, p ) );
+ lbTo->setFocus();
+ lbTo->setCurrentItem( item );
+
+ if ( p == Sorted )
+ lbTo->sort();
+ if ( lbTo == d->selectedListBox )
+ emit added( item );
+ else
+ emit removed( item );
+}
+
+int KActionSelector::insertionIndex( QListBox *lb, InsertionPolicy policy )
+{
+ int index;
+ switch ( policy )
+ {
+ case BelowCurrent:
+ index = lb->currentItem();
+ if ( index > -1 ) index += 1;
+ break;
+ case AtTop:
+ index = 0;
+ break;
+ default:
+ index = -1;
+ }
+ return index;
+}
+
+//END Private Methods
+#include "kactionselector.moc"
diff --git a/parts/fileselector/kactionselector.h b/parts/fileselector/kactionselector.h
new file mode 100644
index 00000000..bc82e21b
--- /dev/null
+++ b/parts/fileselector/kactionselector.h
@@ -0,0 +1,399 @@
+/* This file is part of the KDE project
+ Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _KACTION_SELECTOR_H_
+#define _KACTION_SELECTOR_H_
+
+#include <qwidget.h>
+
+class QListBox;
+class QListBoxItem;
+class QKeyEvent;
+class QEvent;
+class QIconSet;
+
+class KActionSelectorPrivate;
+
+/**
+ @short A widget for selecting and arranging actions/objects
+ This widget allows the user to select from a set of objects and arrange
+ the order of the selected ones using two list boxes labeled "Available"
+ and "Used" with horizontal arrows in between to move selected objects between
+ the two, and vertical arrows on the right to arrange the order of the selected
+ objects.
+
+ The widget moves objects to the other listbox when doubleclicked if
+ the property moveOnDoubleClick is set to true (default). See moveOnDoubleClick()
+ and setMoveOnDoubleClick().
+
+ The user control the widget using the keyboard if enabled (default),
+ see keyboardEnabled.
+
+ Note that this may conflist with keyboard selection in the selected list box,
+ if you set that to anything else than QListBox::Single (which is the default).
+
+ To use it, simply construct an instance and then add items to the two listboxes,
+ available through lbAvailable() and lbSelected(). Whenever you want, you can retrieve
+ the selected options using QListBox methods on lbSelected().
+
+ This way, you can use your own QListBoxItem class, allowing you to easily
+ store object data in those.
+
+ When an item is moved to a listbox, it is placed below the current item
+ of that listbox.
+
+ Standard arrow icons are used, but you can use icons of your own choice if desired,
+ see setButtonIcon(). It is also possible to set tooltips and whatsthis help
+ for the buttons. See setButtonTooltip() and setButtonWhatsThis().
+
+ To set whatsthis or tooltips for the listboxes, access them through
+ availableListbox() and selectedListBox().
+
+ All the moving buttons are automatically set enabled as expected.
+
+ Signals are sent each time an item is moved, allowing you to follow the
+ users actions if you need to. See addedToSelection(), removedFromSelection(),
+ movedUp() and movedDown()
+
+ @author Anders Lund <anders@alweb.dk>
+*/
+
+class KActionSelector : public QWidget {
+ Q_OBJECT
+ Q_ENUMS( ButtonIconSize InsertionPolicy )
+ Q_PROPERTY( bool moveOnDoubleClick READ moveOnDoubleClick WRITE setMoveOnDoubleClick )
+ Q_PROPERTY( bool keyboardEnabled READ keyboardEnabled WRITE setKeyboardEnabled )
+ Q_PROPERTY( QString availableLabel READ availableLabel WRITE setAvailableLabel )
+ Q_PROPERTY( QString selectedLabel READ selectedLabel WRITE setSelectedLabel )
+ Q_PROPERTY( ButtonIconSize buttonIconSize READ buttonIconSize WRITE setButtonIconSize )
+ Q_PROPERTY( InsertionPolicy availableInsertionPolicy READ availableInsertionPolicy WRITE setAvailableInsertionPolicy )
+ Q_PROPERTY( InsertionPolicy selectedInsertionPolicy READ selectedInsertionPolicy WRITE setSelectedInsertionPolicy )
+ Q_PROPERTY( bool showUpDownButtons READ showUpDownButtons WRITE setShowUpDownButtons )
+
+public:
+ KActionSelector( QWidget *parent=0, const char *name=0 );
+ ~KActionSelector();
+
+ /**
+ @return The QListBox holding the available actions
+ */
+ QListBox *availableListBox();
+
+ /**
+ @return The QListBox holding the selected actions
+ */
+ QListBox *selectedListBox();
+
+ /**
+ This enum indentifies the moving buttons
+ */
+ enum MoveButton {
+ ButtonAdd,
+ ButtonRemove,
+ ButtonUp,
+ ButtonDown
+ };
+
+ /**
+ This enum identifies the icon sizes, used for the move buttons.
+ The values correspond to the following pixel sizes:
+ @li SmallIcon - the return value of IconSize( KIcon::Small ), the user defined size
+ of a small icon in KDE. This is the default setting.
+ @li Small - 16px
+ @li Medium - 22px
+ @li Large - 32px
+ @li XLarge - 48px
+ */
+ enum ButtonIconSize {
+ SmallIcon,
+ Small,
+ Medium,
+ Large,
+ XLarge
+ };
+
+ /**
+ This enum defines policies for where to insert moved items in a listbox.
+ The following policies are currently defined:
+ @li BelowCurrent - The item is inserted below the listbox'
+ currentItem() or at the end if there is no curent item.
+ @li Sorted - The listbox is sort()ed after one or more items are inserted.
+ @li AtTop - The item is inserted at index 0 in the listbox.
+ @li AtBottom - The item is inserted at the end of the listbox.
+
+ @sa availableInsertionPolicy(), setAvailableInsertionPolicy(),
+ selectedInsertionPolicy(), setSelectedInsertionPolicy().
+ */
+ enum InsertionPolicy {
+ BelowCurrent,
+ Sorted,
+ AtTop,
+ AtBottom
+ };
+
+ /**
+ @return Wheather moveOnDoubleClcik is enabled.
+
+ If enabled, an item in any listbox will be moved to the other one whenever
+ doubleclicked.
+ @sa setMoveOnDoubleClick()
+ */
+ bool moveOnDoubleClick() const;
+
+ /**
+ Sets moveOnDoubleClick to @p enable
+ @sa moveOnDoubleClick()
+ */
+ void setMoveOnDoubleClick( bool enable );
+
+ /**
+ @return Weather keyboard control is enabled.
+
+ When Keyboard control is enabled, the widget will react to
+ the following keyboard actions:
+ @li CTRL + Right - simulate clicking the add button
+ @li CTRL + Left - simulate clicking the remove button
+ @li CTRL + Up - simulate clicking the up button
+ @li CTRL + Down - simulate clicking the down button
+
+ Additionally, pressing RETURN or ENTER on one of the list boxes
+ will cause the current item of that listbox to be moved to the other
+ listbox.
+
+ The keyboard actions are enabled by default.
+
+ @sa setKeyboardEnabled()
+ */
+ bool keyboardEnabled() const;
+
+ /**
+ Sets the keyboard enabled depending on @p enable.
+ @sa keyboardEnabled()
+ */
+ void setKeyboardEnabled( bool enable );
+
+ /**
+ @return The text of the label for the available items listbox.
+ */
+ QString availableLabel() const;
+
+ /**
+ Sets the label for the available items listbox to @p text.
+ Note that this label has the listbox as its @e buddy, so that
+ if you have a single ampersand in the text, the following character
+ will become the accellerator to focus te listbox.
+ */
+ void setAvailableLabel( const QString & text );
+
+ /**
+ @return the label of the selected items listbox.
+ */
+ QString selectedLabel() const;
+
+ /**
+ Sets the label for the selected items listbox to @p text.
+ Note that this label has the listbox as its @e buddy, so that
+ if you have a single ampersand in the text, the following character
+ will become the accellerator to focus te listbox.
+ */
+ void setSelectedLabel( const QString & text );
+
+ /**
+ @return the current ButtonIconSize.
+ */
+ ButtonIconSize buttonIconSize() const;
+
+ /**
+ Sets the button icon size.
+ See ButtonIconSize for the possible values and their pixel meaning.
+ */
+ void setButtonIconSize( ButtonIconSize size );
+
+ /**
+ @return The current insertion policy for the available listbox.
+ The default policy for the available listbox is Sorted.
+ See also InsertionPolicy, setAvailableInsertionPolicy().
+ */
+ InsertionPolicy availableInsertionPolicy() const;
+
+ /**
+ Sets the insertion policy for the available listbox.
+ See also InsertionPolicy, availableInsertionPolicy().
+ */
+ void setAvailableInsertionPolicy( InsertionPolicy policy );
+
+ /**
+ @return The current insertion policy for the selected listbox.
+ The default policy for the selected listbox is BelowCurrent.
+ See also InsertionPolicy, setSelectedInsertionPolicy().
+ */
+ InsertionPolicy selectedInsertionPolicy() const;
+
+ /**
+ Sets the insertion policy for the selected listbox.
+ See also InsertionPolicy, selectedInsertionPolicy().
+ */
+ void setSelectedInsertionPolicy( InsertionPolicy policy );
+
+ /**
+ @return wheather the Up and Down buttons should be displayed.
+ */
+ bool showUpDownButtons() const;
+
+ /**
+ Sets wheather the Up and Down buttons should be displayed
+ according to @p show
+ */
+ void setShowUpDownButtons( bool show );
+
+ /**
+ Sets the pixmap of the button @p button to @p icon.
+ It calls SmallIconSet(pm) to generate the icon set.
+ */
+ void setButtonIcon( const QString &icon, MoveButton button );
+
+ /**
+ Sets the iconset for button @p button to @p iconset.
+ You can use this method to et a costum icon set. Either
+ created by @ref QIconSet, or use the application instance of
+ @ref KIconLoader (recommended).
+ */
+ void setButtonIconSet( const QIconSet &iconset, MoveButton button );
+
+ /**
+ Sets the tooltip for the button @p button to @p tip.
+ */
+ void setButtonTooltip( const QString &tip, MoveButton button );
+
+ /**
+ Sets the whatsthis help for button @p button to @p text.
+ */
+ void setButtonWhatsThis( const QString &text, MoveButton button );
+
+ /**
+ Sets the enabled state of all moving buttons to reflect the current
+ options.
+
+ Be sure to call this if you add or removes items to either listbox after the
+ widget is show()n
+ */
+ void setButtonsEnabled();
+
+signals:
+ /**
+ Emitted when an item is moved to the "selected" listbox.
+ */
+ void added( QListBoxItem *item );
+
+ /**
+ Emitted when an item is moved out of the "selected" listbox.
+ */
+ void removed( QListBoxItem *item );
+
+ /**
+ Emitted when an item is moved upwards in the "selected" listbox.
+ */
+ void movedUp( QListBoxItem *item );
+
+ /**
+ Emitted when an item is moved downwards in the "selected" listbox.
+ */
+ void movedDown( QListBoxItem *item );
+
+ /**
+ Emitted when an item is moved to the "selected" listbox.
+ */
+// void addedToSelection( QListBoxItem *item );
+
+public slots:
+ /**
+ Reimplemented for internal reasons.
+ (calls setButtonsEnabled())
+ */
+ void polish();
+
+protected:
+ /**
+ Reimplamented for internal reasons.
+ */
+ void keyPressEvent( QKeyEvent * );
+
+ /**
+ Reimplemented for internal reasons.
+ */
+ bool eventFilter( QObject *, QEvent * );
+
+private slots:
+ /**
+ Move selected item from available box to the selected box
+ */
+ void buttonAddClicked();
+
+ /**
+ Move selected item from selected box to available box
+ */
+ void buttonRemoveClicked();
+
+ /**
+ Move selected item in selected box upwards
+ */
+ void buttonUpClicked();
+
+ /**
+ Move seleted item in selected box downwards
+ */
+ void buttonDownClicked();
+
+ /**
+ Moves the item @p item to the other listbox if moveOnDoubleClick is enabled.
+ */
+ void itemDoubleClicked( QListBoxItem *item );
+
+ /**
+ connected to both list boxes to set the buttons enabled
+ */
+ void slotCurrentChanged( QListBoxItem * ) { setButtonsEnabled(); };
+
+private:
+
+ /**
+ Move item @p item to the other listbox
+ */
+ void moveItem( QListBoxItem *item );
+
+ /**
+ loads the icons for the move buttons.
+ */
+ void loadIcons();
+
+ /**
+ @return the index to insert an item into listbox @p lb,
+ given InsertionPolicy @p policy.
+
+ Note that if policy is Sorted, this will return -1.
+ Sort the listbox after inserting the item in that case.
+ */
+ int insertionIndex( QListBox *lb, InsertionPolicy policy );
+
+ /**
+ Private data storage
+ */
+ KActionSelectorPrivate *d;
+};
+
+#endif // _KACTION_SELECTOR_H_
diff --git a/parts/fileselector/kbookmarkhandler.cpp b/parts/fileselector/kbookmarkhandler.cpp
new file mode 100644
index 00000000..b1854f1a
--- /dev/null
+++ b/parts/fileselector/kbookmarkhandler.cpp
@@ -0,0 +1,99 @@
+/* This file is part of the KDE project
+ Copyright (C) xxxx KFile Authors
+ Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <qtextstream.h>
+
+#include <kxmlguiclient.h>
+#include <kbookmarkimporter.h>
+#include <kpopupmenu.h>
+#include <ksavefile.h>
+#include <kstandarddirs.h>
+#include <kdiroperator.h>
+#include <kaction.h>
+
+#include "kbookmarkhandler.h"
+#include "kbookmarkhandler.moc"
+
+
+KBookmarkHandler::KBookmarkHandler( KDevFileSelector *parent, KPopupMenu* kpopupmenu )
+ : QObject( parent, "KBookmarkHandler" ),
+ KBookmarkOwner(),
+ mParent( parent ),
+ m_menu( kpopupmenu ),
+ m_importStream( 0L )
+{
+ if (!m_menu)
+ m_menu = new KPopupMenu( parent, "bookmark menu" );
+
+ QString file = locate( "data", "kdevfileselector/fsbookmarks.xml" );
+ if ( file.isEmpty() )
+ file = locateLocal( "data", "kdevfileselector/fsbookmarks.xml" );
+
+ KBookmarkManager *manager = KBookmarkManager::managerForFile( file, false);
+ manager->setUpdate( true );
+ manager->setShowNSBookmarks( false );
+
+ m_bookmarkMenu = new KBookmarkMenu( manager, this, m_menu, 0, true );
+}
+
+KBookmarkHandler::~KBookmarkHandler()
+{
+ // delete m_bookmarkMenu; ###
+}
+
+QString KBookmarkHandler::currentURL() const
+{
+ return mParent->dirOperator()->url().url();
+}
+
+
+void KBookmarkHandler::slotNewBookmark( const QString& text,
+ const QCString& url,
+ const QString& additionalInfo )
+{
+ Q_UNUSED( text );
+ *m_importStream << "<bookmark icon=\"" << KMimeType::iconForURL( KURL( url ) );
+ *m_importStream << "\" href=\"" << QString::fromUtf8(url) << "\">\n";
+ *m_importStream << "<title>" << (additionalInfo.isEmpty() ? QString::fromUtf8(url) : additionalInfo) << "</title>\n</bookmark>\n";
+}
+
+void KBookmarkHandler::slotNewFolder( const QString& text, bool /*open*/,
+ const QString& /*additionalInfo*/ )
+{
+ *m_importStream << "<folder icon=\"bookmark_folder\">\n<title=\"";
+ *m_importStream << text << "\">\n";
+}
+
+void KBookmarkHandler::newSeparator()
+{
+ *m_importStream << "<separator/>\n";
+}
+
+void KBookmarkHandler::endFolder()
+{
+ *m_importStream << "</folder>\n";
+}
+
+void KBookmarkHandler::virtual_hook( int id, void* data )
+{ KBookmarkOwner::virtual_hook( id, data ); }
+
diff --git a/parts/fileselector/kbookmarkhandler.h b/parts/fileselector/kbookmarkhandler.h
new file mode 100644
index 00000000..9849443d
--- /dev/null
+++ b/parts/fileselector/kbookmarkhandler.h
@@ -0,0 +1,70 @@
+/* This file is part of the KDE project
+ Copyright (C) xxxx KFile Authors
+ Copyright (C) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
+
+ 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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _KBOOKMARKHANDLER_H_
+#define _KBOOKMARKHANDLER_H_
+
+#include <kbookmarkmanager.h>
+#include <kbookmarkmenu.h>
+#include "fileselector_widget.h"
+
+class QTextStream;
+class KPopupMenu;
+class KActionMenu;
+
+class KBookmarkHandler : public QObject, public KBookmarkOwner
+{
+ Q_OBJECT
+
+public:
+ KBookmarkHandler( KDevFileSelector *parent, KPopupMenu *kpopupmenu=0 );
+ ~KBookmarkHandler();
+
+ // KBookmarkOwner interface:
+ virtual void openBookmarkURL( const QString& url ) { emit openURL( url ); }
+ virtual QString currentURL() const;
+
+ KPopupMenu *menu() const { return m_menu; }
+
+signals:
+ void openURL( const QString& url );
+
+private slots:
+ void slotNewBookmark( const QString& text, const QCString& url,
+ const QString& additionalInfo );
+ void slotNewFolder( const QString& text, bool open,
+ const QString& additionalInfo );
+ void newSeparator();
+ void endFolder();
+
+protected:
+ virtual void virtual_hook( int id, void* data );
+
+private:
+ KDevFileSelector *mParent;
+ KPopupMenu *m_menu;
+ KBookmarkMenu *m_bookmarkMenu;
+
+ QTextStream *m_importStream;
+
+ //class KBookmarkHandlerPrivate *d;
+};
+
+
+#endif // _KBOOKMARKHANDLER_H_
diff --git a/parts/fileselector/kdevfileselector.desktop b/parts/fileselector/kdevfileselector.desktop
new file mode 100644
index 00000000..611da8d0
--- /dev/null
+++ b/parts/fileselector/kdevfileselector.desktop
@@ -0,0 +1,89 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Powerful network transparent file browser utility.
+Comment[ca]=Potent utilitat per a la navegació entre fitxers, transparent a la xarxa.
+Comment[da]=Stærkt netværkstransparent filsøgerredskab.
+Comment[de]=Ein mächtiges, netzwerktransparentes Dateiverwaltungswerkzeug.
+Comment[el]=Ισχυρό εργαλείο περιηγητή αρχείων με δικτυακή υποστήριξη.
+Comment[es]=Potente utilidad de navegación de archivos transparente a la red.
+Comment[et]=Võimas failide lehitsemise rakendus.
+Comment[eu]=Fitxategiak arakatzeko sare gardeneko tresna ahaltsua.
+Comment[fa]=برنامۀ سودمند مرورگر پروندۀ شفاف شبکۀ قوی
+Comment[fr]=Puissant utilitaire de navigateur de fichiers transparent vis-à-vis du réseau.
+Comment[gl]=Potente utilidade de navegación de ficheiros con soporte para navegación da rede de forma transparente.
+Comment[hi]=शक्तिशाली नेटवर्क ट्रांसपेरेन्ट फ़ाइल ब्राउज़र यूटिलिटी
+Comment[hu]=Fájlböngésző program (hálózatkezeléssel)
+Comment[it]=Utilità per la navigazione trasparente dei file in rete.
+Comment[ja]=強力なネットワーク透過ファイルブラウザユーティリティ
+Comment[ms]=Utiliti pelayar fail telus rangkaian yang berkuasa
+Comment[nds]=En mächtig, nettwarktransparent Dateigrieper.
+Comment[ne]=शक्तिशाली सञ्जाल पारदर्शी फाइल ब्राउजर युटिलिटी
+Comment[nl]=Krachtige, netwerktransparante bestandsbrowser.
+Comment[pl]=Potężne narzędzie do przeglądania plików z obsługą sieci.
+Comment[pt]=Utilitário de navegação de ficheiros poderoso.
+Comment[pt_BR]=Poderoso utilitário de navegação de arquivos transparente à rede.
+Comment[ru]=Средство просмотра списка файлов с поддержкой работы по сети.
+Comment[sk]=Výkonný sieťovo-transparentný nástroj na prezeranie súborov.
+Comment[sr]=Моћан програмчић за претраживање фајлова који је независтан од мреже.
+Comment[sr@Latn]=Moćan programčić za pretraživanje fajlova koji je nezavistan od mreže.
+Comment[sv]=Kraftfullt nätverkstransparent filbläddringsverktyg
+Comment[ta]=வலிமையுள்ள வலை பின்னல் ஊடக கோப்பினை தேடும் வசதி.
+Comment[tg]=Воситаи намоиши файлҳо бо тарафдории корҳо бо шабака.
+Comment[tr]=Güçlü, ağdan saydam, dosya gözatma yardımcı programı
+Comment[zh_CN]=强有力的网络文件浏览工具。
+Comment[zh_TW]=強大的網路檔案瀏覽工具。
+Name=KDevFileSelector
+Name[da]=KDevelop filvælger
+Name[de]=Datei-Selektor (KDevelop)
+Name[hi]=के-डेव-फ़ाइल-चयनक
+Name[nds]=KDevelop-Dateigrieper
+Name[pl]=KDevWybórPliku
+Name[sk]=KDev voľba súboru
+Name[sv]=KDevelop filväljare
+Name[ta]=KDev கோப்பு தேர்வாளன்
+Name[tg]=Ҷудосози файли KDev
+Name[zh_TW]=KDevelop 檔案選擇器
+GenericName=File Selector
+GenericName[br]=Dibaber ar restr
+GenericName[ca]=Selector de fitxers
+GenericName[cy]=Dewisydd Ffeiliau
+GenericName[da]=Filvælger
+GenericName[de]=Datei-Selektor
+GenericName[el]=Επιλογέας αρχείων
+GenericName[es]=Selector de archivos
+GenericName[et]=Failide valija
+GenericName[eu]=Fitxategi hautatzailea
+GenericName[fa]=گزینندۀ پرونده
+GenericName[fr]=Sélecteur de fichiers
+GenericName[ga]=Roghnóir na gComhad
+GenericName[gl]=Selector de ficheiros
+GenericName[hi]=फ़ाइल चयनक
+GenericName[hu]=Fájlválasztó
+GenericName[it]=Selettore file
+GenericName[ja]=ファイル選択
+GenericName[ms]=Pemilih Fail
+GenericName[nds]=Dateigrieper
+GenericName[ne]=फाइल चयनकर्ता
+GenericName[nl]=Bestandsselector
+GenericName[pl]=Wybór plików
+GenericName[pt]=Selector de Ficheiros
+GenericName[pt_BR]=Seletor de Arquivo
+GenericName[ru]=Выбор файлов
+GenericName[sk]=Voľba súboru
+GenericName[sl]=Izbirnik datotek
+GenericName[sr]=Бирач фајлова
+GenericName[sr@Latn]=Birač fajlova
+GenericName[sv]=Filväljare
+GenericName[ta]=கோப்பு தேர்வாளர்
+GenericName[tg]=Селектори файлҳо
+GenericName[tr]=Dosya Seçici
+GenericName[zh_CN]=文件选择器
+GenericName[zh_TW]=檔案選擇器
+Icon=fileopen
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevfileselector
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Mode=AssistantMode
+X-KDevelop-Properties=GlobalFileManagement
diff --git a/parts/fileselector/kdevpart_fileselector.rc b/parts/fileselector/kdevpart_fileselector.rc
new file mode 100644
index 00000000..940e2ab2
--- /dev/null
+++ b/parts/fileselector/kdevpart_fileselector.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="fileselector" library="libfileselectorplugin" version="1">
+<MenuBar>
+ <Menu name="help"><Text>&amp;Help</Text>
+ <Action name="help_fileselector"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/fileview/Makefile.am b/parts/fileview/Makefile.am
new file mode 100644
index 00000000..7cc33aa6
--- /dev/null
+++ b/parts/fileview/Makefile.am
@@ -0,0 +1,26 @@
+# Here resides the file view part.
+
+INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfileview.la libkdevfilegroups.la
+
+libkdevfileview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfileview_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfilegroups_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfilegroups_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfileview_la_SOURCES = fileviewpart.cpp filetreewidget.cpp partwidget.cpp vcscolorsconfigwidgetbase.ui vcscolorsconfigwidget.cpp stdfiletreewidgetimpl.cpp filetreeviewwidgetimpl.cpp vcsfiletreewidgetimpl.cpp fileitemfactory.cpp
+
+libkdevfilegroups_la_SOURCES = filegroupswidget.cpp addfilegroupdlg.cpp filegroupsconfigwidget.cpp filegroupsconfigwidgetbase.ui filegroupspart.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfileview.desktop kdevfilegroups.desktop
+
+# not used currently
+#rcdir = $(kde_datadir)/kdevfileview
+#rc_DATA = kdevfileview.rc
+noinst_HEADERS = vcscolorsconfigwidget.h stdfiletreewidgetimpl.h filetreeviewwidgetimpl.h vcsfiletreewidgetimpl.h fileitemfactory.h
diff --git a/parts/fileview/README.dox b/parts/fileview/README.dox
new file mode 100644
index 00000000..d8143dd1
--- /dev/null
+++ b/parts/fileview/README.dox
@@ -0,0 +1,53 @@
+/** \class FileViewPart
+The file tree list view for displaying files within project dir.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\feature Provides a way of navigating and interacting with the source files of the current project.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=file+tree&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">file tree component at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
+
+/** \class FileGroupsPart
+Allows grouping of project files according to filename patterns.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\feature Provides a way of navigating and interacting with the source files (grouped by extension type) of the current project.
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=File+Groups&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">file groups component at Bugzilla database</a>
+
+*/
diff --git a/parts/fileview/addfilegroupdlg.cpp b/parts/fileview/addfilegroupdlg.cpp
new file mode 100644
index 00000000..ef194da1
--- /dev/null
+++ b/parts/fileview/addfilegroupdlg.cpp
@@ -0,0 +1,73 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <kbuttonbox.h>
+#include <klocale.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "addfilegroupdlg.h"
+
+
+AddFileGroupDialog::AddFileGroupDialog(const QString& old_title, const QString& old_pattern, QWidget *parent, const char *name)
+ : QDialog(parent, name, true)
+{
+ QLabel *title_label = new QLabel(i18n("&Title:"), this);
+ title_edit = new KLineEdit(old_title, this);
+ title_edit->setFocus();
+ title_label->setBuddy(title_edit);
+ connect( title_edit, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotTextChanged() ) );
+
+ QLabel *pattern_label = new QLabel(i18n("&Pattern:"), this);
+ pattern_edit = new KLineEdit(old_pattern, this);
+ pattern_label->setBuddy(pattern_edit);
+ QFontMetrics fm(pattern_edit->fontMetrics());
+ pattern_edit->setMinimumWidth(fm.width('X')*35);
+ connect( pattern_edit, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotTextChanged() ) );
+ QVBoxLayout *layout = new QVBoxLayout(this, 10);
+
+ QGridLayout *grid = new QGridLayout(2, 2);
+ layout->addLayout(grid);
+ grid->addWidget(title_label, 0, 0);
+ grid->addWidget(title_edit, 0, 1);
+ grid->addWidget(pattern_label, 1, 0);
+ grid->addWidget(pattern_edit, 1, 1);
+
+ QFrame *frame = new QFrame(this);
+ frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ layout->addWidget(frame, 0);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ m_pOk = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+
+ m_pOk->setDefault(true);
+ connect( m_pOk, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( cancel, SIGNAL(clicked()), this, SLOT(reject()) );
+ buttonbox->layout();
+ layout->addWidget(buttonbox, 0);
+ slotTextChanged();
+}
+
+
+AddFileGroupDialog::~AddFileGroupDialog()
+{}
+
+void AddFileGroupDialog::slotTextChanged()
+{
+ m_pOk->setEnabled( !title_edit->text().isEmpty() && !pattern_edit->text().isEmpty() );
+}
+
+#include "addfilegroupdlg.moc"
diff --git a/parts/fileview/addfilegroupdlg.h b/parts/fileview/addfilegroupdlg.h
new file mode 100644
index 00000000..f72a2007
--- /dev/null
+++ b/parts/fileview/addfilegroupdlg.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _ADDFILEGROUPDLG_H_
+#define _ADDFILEGROUPDLG_H_
+
+#include <qdialog.h>
+#include <klineedit.h>
+class QPushButton;
+
+class AddFileGroupDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AddFileGroupDialog( const QString& old_title="", const QString& old_pattern="", QWidget *parent=0, const char *name=0 );
+ ~AddFileGroupDialog();
+
+ QString title() const
+ { return title_edit->text(); }
+ QString pattern() const
+ { return pattern_edit->text(); }
+ private slots:
+ void slotTextChanged();
+private:
+ KLineEdit *title_edit;
+ KLineEdit *pattern_edit;
+ QPushButton *m_pOk;
+};
+
+#endif
diff --git a/parts/fileview/filegroupsconfigwidget.cpp b/parts/fileview/filegroupsconfigwidget.cpp
new file mode 100644
index 00000000..28a0441b
--- /dev/null
+++ b/parts/fileview/filegroupsconfigwidget.cpp
@@ -0,0 +1,133 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filegroupsconfigwidget.h"
+
+#include <qlistview.h>
+#include <knotifyclient.h>
+#include <klocale.h>
+
+#include "domutil.h"
+#include "addfilegroupdlg.h"
+#include "filegroupspart.h"
+
+
+FileGroupsConfigWidget::FileGroupsConfigWidget(FileGroupsPart *part,
+ QWidget *parent, const char *name)
+ : FileGroupsConfigWidgetBase(parent, name)
+{
+ m_part = part;
+
+ listview->setSorting(-1);
+
+ readConfig();
+}
+
+
+FileGroupsConfigWidget::~FileGroupsConfigWidget()
+{}
+
+
+void FileGroupsConfigWidget::readConfig()
+{
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::PairList list = DomUtil::readPairListEntry(dom, "/kdevfileview/groups",
+ "group", "name", "pattern");
+
+ QListViewItem *lastItem = 0;
+
+ DomUtil::PairList::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ QListViewItem *newItem = new QListViewItem(listview, (*it).first, (*it).second);
+ if (lastItem)
+ newItem->moveItem(lastItem);
+ lastItem = newItem;
+ }
+}
+
+
+void FileGroupsConfigWidget::storeConfig()
+{
+ DomUtil::PairList list;
+
+ QListViewItem *item = listview->firstChild();
+ while (item) {
+ list << DomUtil::Pair(item->text(0), item->text(1));
+ item = item->nextSibling();
+ }
+
+ DomUtil::writePairListEntry(*m_part->projectDom(), "/kdevfileview/groups",
+ "group", "name", "pattern", list);
+}
+
+
+void FileGroupsConfigWidget::addGroup()
+{
+ AddFileGroupDialog dlg;
+ dlg.setCaption(i18n("Add File Group"));
+ if (!dlg.exec())
+ return;
+
+ (void) new QListViewItem(listview, dlg.title(), dlg.pattern());
+}
+
+
+void FileGroupsConfigWidget::editGroup()
+{
+ if (listview->childCount()==0 || listview->currentItem()==0)
+ return;
+ AddFileGroupDialog dlg(listview->currentItem()->text(0),listview->currentItem()->text(1));
+ dlg.setCaption(i18n("Edit File Group"));
+ if (!dlg.exec() || dlg.title().isEmpty() || dlg.pattern().isEmpty())
+ return;
+ listview->currentItem()->setText(0,dlg.title());
+ listview->currentItem()->setText(1,dlg.pattern());
+}
+
+
+void FileGroupsConfigWidget::removeGroup()
+{
+ delete listview->currentItem();
+}
+
+
+void FileGroupsConfigWidget::moveUp()
+{
+ if (listview->currentItem() == listview->firstChild()) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ QListViewItem *item = listview->firstChild();
+ while (item->nextSibling() != listview->currentItem())
+ item = item->nextSibling();
+ item->moveItem(listview->currentItem());
+}
+
+
+void FileGroupsConfigWidget::moveDown()
+{
+ if (listview->currentItem()->nextSibling() == 0) {
+ KNotifyClient::beep();
+ return;
+ }
+
+ listview->currentItem()->moveItem(listview->currentItem()->nextSibling());
+}
+
+
+void FileGroupsConfigWidget::accept()
+{
+ storeConfig();
+ m_part->refresh();
+}
+
+#include "filegroupsconfigwidget.moc"
diff --git a/parts/fileview/filegroupsconfigwidget.h b/parts/fileview/filegroupsconfigwidget.h
new file mode 100644
index 00000000..b9b5c574
--- /dev/null
+++ b/parts/fileview/filegroupsconfigwidget.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILEGROUPSCONFIGWIDGET_H_
+#define _FILEGROUPSCONFIGWIDGET_H_
+
+#include "filegroupsconfigwidgetbase.h"
+
+class FileGroupsPart;
+
+
+class FileGroupsConfigWidget : public FileGroupsConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ FileGroupsConfigWidget( FileGroupsPart *widget, QWidget *parent, const char *name=0 );
+ ~FileGroupsConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ virtual void addGroup();
+ virtual void editGroup();
+ virtual void removeGroup();
+ virtual void moveUp();
+ virtual void moveDown();
+
+ void readConfig();
+ void storeConfig();
+
+ FileGroupsPart *m_part;
+};
+
+#endif
diff --git a/parts/fileview/filegroupsconfigwidgetbase.ui b/parts/fileview/filegroupsconfigwidgetbase.ui
new file mode 100644
index 00000000..3b548458
--- /dev/null
+++ b/parts/fileview/filegroupsconfigwidgetbase.ui
@@ -0,0 +1,229 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>FileGroupsConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>filegroups_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>599</width>
+ <height>496</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>File Group View</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>title_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Groups in the file view and their corresponding patterns:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>listview</cstring>
+ </property>
+ </widget>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Group</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Pattern</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listview</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addgroup_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add Group...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>editgroup_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit Group...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>deletegroup_button</cstring>
+ </property>
+ <property name="text">
+ <string>De&amp;lete Group</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>moveup_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Up</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>movedown_button</cstring>
+ </property>
+ <property name="text">
+ <string>Move &amp;Down</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</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>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<connections>
+ <connection>
+ <sender>moveup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>filegroups_config_widget</receiver>
+ <slot>moveUp()</slot>
+ </connection>
+ <connection>
+ <sender>deletegroup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>filegroups_config_widget</receiver>
+ <slot>removeGroup()</slot>
+ </connection>
+ <connection>
+ <sender>addgroup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>filegroups_config_widget</receiver>
+ <slot>addGroup()</slot>
+ </connection>
+ <connection>
+ <sender>editgroup_button</sender>
+ <signal>clicked()</signal>
+ <receiver>filegroups_config_widget</receiver>
+ <slot>editGroup()</slot>
+ </connection>
+ <connection>
+ <sender>movedown_button</sender>
+ <signal>clicked()</signal>
+ <receiver>filegroups_config_widget</receiver>
+ <slot>moveDown()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">addGroup()</slot>
+ <slot access="protected">editGroup()</slot>
+ <slot access="protected">removeGroup()</slot>
+ <slot access="protected">moveUp()</slot>
+ <slot access="protected">moveDown()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/fileview/filegroupspart.cpp b/parts/fileview/filegroupspart.cpp
new file mode 100644
index 00000000..1c6a5abf
--- /dev/null
+++ b/parts/fileview/filegroupspart.cpp
@@ -0,0 +1,97 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filegroupspart.h"
+#include "filegroupspart.moc"
+
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qtimer.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdialogbase.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevplugininfo.h"
+
+#include "filegroupswidget.h"
+#include "filegroupsconfigwidget.h"
+
+#define FILEGROUPS_OPTIONS 1
+
+typedef KDevGenericFactory<FileGroupsPart> FileGroupsFactory;
+static const KDevPluginInfo data("kdevfilegroups");
+K_EXPORT_COMPONENT_FACTORY( libkdevfilegroups, FileGroupsFactory( data ) )
+
+FileGroupsPart::FileGroupsPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "FileGroupsPart")
+{
+ deleteRequested = false;
+ setInstance(FileGroupsFactory::instance());
+
+ m_filegroups = new FileGroupsWidget(this);
+ m_filegroups->setCaption(i18n("File Group View"));
+ m_filegroups->setIcon(SmallIcon( info()->icon() ) );
+ QWhatsThis::add(m_filegroups, i18n("<b>File group view</b><p>"
+ "The file group viewer shows all files of the project, "
+ "in groups which can be configured in project settings dialog, <b>File Groups</b> tab."));
+ mainWindow()->embedSelectView(m_filegroups, i18n("File Groups"), i18n("File groups in the project directory"));
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("File Groups"), FILEGROUPS_OPTIONS, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+
+ // File groups
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList&)),
+ m_filegroups, SLOT(addFiles(const QStringList&)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList&)),
+ m_filegroups, SLOT(removeFiles(const QStringList&)) );
+/* connect( project(), SIGNAL(addedFileToProject(const QString&)),
+ m_filegroups, SLOT(addFile(const QString&)) );
+ connect( project(), SIGNAL(removedFileFromProject(const QString&)),
+ m_filegroups, SLOT(removeFile(const QString&)) );*/
+ m_filegroups->refresh();
+}
+
+FileGroupsPart::~FileGroupsPart()
+{
+ deleteRequested = true;
+ if (m_filegroups)
+ mainWindow()->removeView(m_filegroups);
+ delete m_filegroups;
+ delete _configProxy;
+}
+
+void FileGroupsPart::refresh()
+{
+ if (deleteRequested)
+ return;
+ // This method may be called from m_filetree's slot,
+ // so we make sure not to modify the list view during
+ // the execution of the slot
+ QTimer::singleShot(0, m_filegroups, SLOT(refresh()));
+}
+
+void FileGroupsPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == FILEGROUPS_OPTIONS )
+ {
+ FileGroupsConfigWidget *w = new FileGroupsConfigWidget(this, page, "file groups config widget");
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ }
+}
diff --git a/parts/fileview/filegroupspart.h b/parts/fileview/filegroupspart.h
new file mode 100644
index 00000000..8e712b4b
--- /dev/null
+++ b/parts/fileview/filegroupspart.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILEGROUPSPART_H_
+#define _FILEGROUPSPART_H_
+
+#include <qguardedptr.h>
+//#include <kdialogbase.h>
+#include <configwidgetproxy.h>
+#include "kdevplugin.h"
+
+class FileGroupsWidget;
+class KDialogBase;
+
+class FileGroupsPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ FileGroupsPart( QObject *parent, const char *name, const QStringList & );
+ ~FileGroupsPart();
+
+public slots:
+ void refresh();
+
+private slots:
+ void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
+
+private:
+ QGuardedPtr<FileGroupsWidget> m_filegroups;
+ bool deleteRequested;
+ ConfigWidgetProxy * _configProxy;
+};
+
+#endif
diff --git a/parts/fileview/filegroupswidget.cpp b/parts/fileview/filegroupswidget.cpp
new file mode 100644
index 00000000..9f32460d
--- /dev/null
+++ b/parts/fileview/filegroupswidget.cpp
@@ -0,0 +1,442 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filegroupswidget.h"
+
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qheader.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <qregexp.h>
+
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kdeversion.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "domutil.h"
+
+#include "filegroupspart.h"
+#include "filegroupsconfigwidget.h"
+
+
+// Translations for strings in the project file
+static const char *translations[] = {
+ I18N_NOOP("Sources"),
+ I18N_NOOP("Translations"),
+ I18N_NOOP("User Interface"),
+ I18N_NOOP("Others")
+};
+
+class FileComparator {
+public:
+ virtual ~FileComparator(){
+ };
+ virtual bool matches(const QString& name) const = 0;
+};
+
+class RegExpComparator : public FileComparator {
+public:
+ RegExpComparator(const QString& pattern) : m_exp(pattern, true, true){
+ }
+ bool matches(const QString& name) const{
+ return m_exp.exactMatch(name);
+ }
+private:
+ const QRegExp m_exp;
+};
+
+class EndingComparator : public FileComparator {
+public:
+ EndingComparator(const QString& pattern) : m_pattern ( pattern){
+ }
+ bool matches(const QString& name) const{
+ return name.endsWith(m_pattern);
+ }
+private:
+ const QString m_pattern;
+};
+
+class FileViewFolderItem : public QListViewItem
+{
+public:
+ FileViewFolderItem(QListView *parent, const QString &name, const QString &pattern);
+ bool matches(const QString &fileName);
+
+private:
+ QPtrList<FileComparator> m_patterns;
+};
+
+
+FileViewFolderItem::FileViewFolderItem(QListView *parent, const QString &name, const QString &pattern)
+ : QListViewItem(parent, name)
+{
+ setPixmap(0, SmallIcon("folder"));
+ m_patterns.setAutoDelete(true);
+ QStringList patternstring = QStringList::split(';', pattern);
+ QStringList::ConstIterator theend = patternstring.end();
+ for (QStringList::ConstIterator ci = patternstring.begin(); ci != theend; ++ci)
+ {
+ QString pattern = *ci;
+ QString tail = pattern.right( pattern.length() - 1 );
+
+ if ( (tail).contains('*') || pattern.contains('?') || pattern.contains('[') || pattern.contains(']') )
+ {
+ m_patterns.append( new RegExpComparator( pattern ) );
+ }
+ else
+ {
+ if ( pattern.startsWith("*") )
+ {
+ m_patterns.append( new EndingComparator( tail ) );
+ }
+ else
+ {
+ m_patterns.append( new EndingComparator( pattern ) );
+ }
+ }
+ }
+}
+
+
+bool FileViewFolderItem::matches(const QString &fileName)
+{
+ // Test with the file path, so that "*ClientServer/*.h" patterns work
+ QString fName = QFileInfo(fileName).filePath();
+
+ QPtrList<FileComparator>::ConstIterator theend = m_patterns.end();
+ for (QPtrList<FileComparator>::ConstIterator ci = m_patterns.begin(); ci != theend; ++ci)
+ if ((*ci)->matches(fName))
+ return true;
+
+ return false;
+}
+
+
+class FileGroupsFileItem : public QListViewItem
+{
+public:
+ FileGroupsFileItem(QListViewItem *parent, const QString &fileName);
+ QString fileName() const
+ { return fullname; }
+
+private:
+ QString fullname;
+};
+
+
+FileGroupsFileItem::FileGroupsFileItem(QListViewItem *parent, const QString &fileName)
+ : QListViewItem(parent), fullname(fileName)
+{
+ setPixmap(0, SmallIcon("document"));
+ QFileInfo fi(fileName);
+ setText(0, fi.fileName());
+ setText(1, "./" + fi.dirPath());
+}
+
+FileGroupsWidget::FileGroupsWidget(FileGroupsPart *part)
+ : KListView(0, "file view widget"),
+ m_actionToggleShowNonProjectFiles( 0 ), m_actionToggleDisplayLocation( 0 )
+{
+ /*
+ Setting Location ID to -1 so I can check if it has been loaded later.
+ If I dont, it will remove the name column and this is not too good :-)
+ Is there any better way to do this?
+ */
+ LocationID=-1;
+
+ setFocusPolicy(ClickFocus);
+ setRootIsDecorated(true);
+ setResizeMode(QListView::LastColumn);
+ setSorting(-1);
+ addColumn(i18n("Name"));
+ setAllColumnsShowFocus( true );
+
+// addColumn(i18n("Location"));
+
+ connect( this, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );
+
+ m_actionToggleShowNonProjectFiles = new KToggleAction( i18n("Show Non Project Files"), KShortcut(),
+ this, SLOT(slotToggleShowNonProjectFiles()), this, "actiontoggleshowshownonprojectfiles" );
+ m_actionToggleShowNonProjectFiles->setCheckedState(i18n("Hide Non Project Files"));
+ m_actionToggleShowNonProjectFiles->setWhatsThis(i18n("<b>Show non project files</b><p>Shows files that do not belong to a project in a file tree."));
+
+ m_actionToggleDisplayLocation = new KToggleAction( i18n("Display Location Column"), KShortcut(),
+ this, SLOT(slotToggleDisplayLocation()), this, "actiontoggleshowlocation" );
+ m_actionToggleDisplayLocation->setWhatsThis(i18n("<b>Display the Location Column</b><p>Displays a column with the location of the files."));
+
+ m_part = part;
+ (void) translations; // supress compiler warning
+
+ QDomDocument &dom = *m_part->projectDom();
+ m_actionToggleShowNonProjectFiles->setChecked( !DomUtil::readBoolEntry(dom, "/kdevfileview/groups/hidenonprojectfiles") );
+ m_actionToggleDisplayLocation->setChecked( !DomUtil::readBoolEntry(dom, "/kdevfileview/groups/hidenonlocation") );
+}
+
+
+FileGroupsWidget::~FileGroupsWidget()
+{
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::writeBoolEntry( dom, "/kdevfileview/groups/hidenonprojectfiles", !m_actionToggleShowNonProjectFiles->isChecked() );
+ DomUtil::writeBoolEntry( dom, "/kdevfileview/groups/hidenonlocation", !m_actionToggleDisplayLocation->isChecked() );
+}
+
+
+void FileGroupsWidget::slotItemExecuted(QListViewItem *item)
+{
+ if (!item)
+ return;
+
+ // toggle open state for parents
+ if (item->childCount() > 0)
+ setOpen(item, !isOpen(item));
+
+ // Is it a group item?
+ if (!item->parent())
+ return;
+
+ FileGroupsFileItem *fgfitem = static_cast<FileGroupsFileItem*>(item);
+ m_part->partController()->editDocument(KURL::fromPathOrURL( m_part->project()->projectDirectory() + "/" + fgfitem->fileName() ));
+}
+
+
+void FileGroupsWidget::slotContextMenu(KListView *, QListViewItem *item, const QPoint &p)
+{
+ KPopupMenu popup(i18n("File Groups"), this);
+ /// @todo Add, remove groups
+ int customizeId = popup.insertItem(i18n("Customize..."));
+ popup.setWhatsThis(customizeId, i18n("<b>Customize</b><p>Opens <b>Customize File Groups</b> dialog where the groups can be managed."));
+ if (item) {
+ if (item->parent()) {
+ // Not for group items
+ FileGroupsFileItem *fvfitem = static_cast<FileGroupsFileItem*>(item);
+ QString pathName = m_part->project()->projectDirectory() + QDir::separator() + fvfitem->fileName();
+ KURL::List urls;
+ urls.append(pathName);
+ FileContext context(urls);
+ m_part->core()->fillContextMenu(&popup, &context);
+ }
+ else{
+ QStringList file_list;
+ QListViewItem* i = item->firstChild();
+ while(i){
+ FileGroupsFileItem *fvgitem = static_cast<FileGroupsFileItem*>(i);
+ file_list << fvgitem->fileName();
+ i = i->nextSibling();
+ }
+ FileContext context(file_list);
+ m_part->core()->fillContextMenu(&popup, &context);
+ }
+ }
+ m_actionToggleShowNonProjectFiles->plug( &popup );
+ m_actionToggleDisplayLocation->plug( &popup );
+
+ int res = popup.exec(p);
+ if (res == customizeId) {
+ KDialogBase dlg(KDialogBase::TreeList, i18n("Customize File Groups"),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, this,
+ "customization dialog");
+ QVBox *vbox = dlg.addVBoxPage(i18n("File Groups"));
+ FileGroupsConfigWidget *w = new FileGroupsConfigWidget(m_part, vbox, "file groups config widget");
+ connect(&dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ dlg.exec();
+ }
+}
+
+QStringList FileGroupsWidget::allFilesRecursively( QString const & dir )
+{
+ QStringList filelist;
+ QString reldir = dir.mid( m_part->project()->projectDirectory().length() +1 );
+
+ // recursively fetch all files in subdirectories
+ QStringList subdirs = QDir( dir ).entryList( QDir::Dirs );
+ QValueListIterator<QString> it = subdirs.begin();
+ while ( it != subdirs.end() )
+ {
+ if ( *it != "." && *it != ".." )
+ {
+ filelist += allFilesRecursively( dir + "/"+ *it );
+ }
+ ++it;
+ }
+
+ // append the project relative directory path to all files in the current directory
+ QStringList dirlist = QDir( dir ).entryList( QDir::Files );
+ QValueListIterator<QString> itt = dirlist.begin();
+ while ( itt != dirlist.end() )
+ {
+ if ( reldir.isEmpty() )
+ {
+ filelist << *itt;
+ }
+ else
+ {
+ filelist << reldir + "/" + *itt;
+ }
+ ++itt;
+ }
+
+ return filelist;
+}
+
+void FileGroupsWidget::refresh()
+{
+ while (firstChild())
+ delete firstChild();
+
+ if (m_actionToggleDisplayLocation->isChecked()) {
+ // Display the Location column
+ LocationID=addColumn(i18n("Location"));
+ }
+ else {
+ // Remove the Location column
+ //Need to check if the ID exists, if not do nothing!!
+ if (LocationID!=-1)
+ removeColumn(LocationID);
+ }
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::PairList list =
+ DomUtil::readPairListEntry(dom, "/kdevfileview/groups", "group", "name", "pattern");
+
+ FileViewFolderItem *lastGroup = 0;
+
+ DomUtil::PairList::ConstIterator git;
+ for (git = list.begin(); git != list.end(); ++git) {
+ FileViewFolderItem *newItem = new FileViewFolderItem(this, (*git).first, (*git).second);
+ if (lastGroup)
+ newItem->moveItem(lastGroup);
+ lastGroup = newItem;
+ }
+
+ QStringList allFiles;
+ if (m_actionToggleShowNonProjectFiles->isChecked()) {
+ // get all files in the project directory
+ allFiles = allFilesRecursively( m_part->project()->projectDirectory() );
+ }
+ else {
+ // get all project files
+ allFiles = m_part->project()->allFiles();
+ }
+ QStringList::ConstIterator fit;
+ for (fit = allFiles.begin(); fit != allFiles.end(); ++fit) {
+ QListViewItem *item = firstChild();
+ while (item) {
+ FileViewFolderItem *fvgitem = static_cast<FileViewFolderItem*>(item);
+ if (fvgitem->matches(*fit)) {
+ (void) new FileGroupsFileItem(fvgitem, *fit);
+ break;
+ }
+ item = item->nextSibling();
+ }
+ }
+
+ QListViewItem *item = firstChild();
+ while (item) {
+ item->sortChildItems(0, true);
+ item = item->nextSibling();
+ }
+}
+
+
+void FileGroupsWidget::addFile(const QString &fileName)
+{
+ kdDebug(9017) << "FileView add " << fileName << endl;
+
+ QListViewItem *item = firstChild();
+ while (item) {
+ FileViewFolderItem *fvgitem = static_cast<FileViewFolderItem*>(item);
+ if (fvgitem->matches(fileName))
+ {
+ QString f = fileName;
+ if (fileName.contains(m_part->project()->projectDirectory()))
+ f = fileName.mid(m_part->project()->projectDirectory().length()+1);
+ (void) new FileGroupsFileItem(fvgitem, f);
+// fvgitem->sortChildItems(0, true);
+ break;
+ }
+ item = item->nextSibling();
+ }
+}
+
+void FileGroupsWidget::addFiles ( const QStringList& fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ this->addFile ( *it );
+ }
+ sort();
+}
+
+void FileGroupsWidget::removeFile(const QString &fileName)
+{
+ kdDebug(9017) << "FileView remove " << fileName << endl;
+
+ QListViewItem *item = firstChild();
+ while (item)
+ {
+ FileViewFolderItem *fvgitem = static_cast<FileViewFolderItem*>(item);
+ QListViewItem *childItem = fvgitem->firstChild();
+ while (childItem)
+ {
+ FileGroupsFileItem *fgfitem = static_cast<FileGroupsFileItem*>(childItem);
+ kdDebug ( 9017 ) << "fvfitem->fileName() is " << fgfitem->fileName() << endl;
+ if (fgfitem->fileName() == fileName )
+ {
+ kdDebug ( 9017 ) << "Deleting: " << fgfitem->fileName() << endl;
+
+ delete fgfitem;
+ return;
+ }
+ childItem = childItem->nextSibling();
+ }
+ item = item->nextSibling();
+ }
+}
+
+void FileGroupsWidget::removeFiles ( const QStringList& fileList )
+{
+ QStringList::ConstIterator it;
+
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ removeFile ( *it );
+ }
+}
+
+void FileGroupsWidget::slotToggleShowNonProjectFiles()
+{
+ refresh();
+}
+
+void FileGroupsWidget::slotToggleDisplayLocation()
+{
+ refresh();
+}
+
+
+#include "filegroupswidget.moc"
+
diff --git a/parts/fileview/filegroupswidget.h b/parts/fileview/filegroupswidget.h
new file mode 100644
index 00000000..7bdbf78b
--- /dev/null
+++ b/parts/fileview/filegroupswidget.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILEGROUPSWIDGET_H_
+#define _FILEGROUPSWIDGET_H_
+
+#include <klistview.h>
+
+class FileGroupsPart;
+class KDevProject;
+
+
+class FileGroupsWidget : public KListView
+{
+ Q_OBJECT
+
+public:
+ FileGroupsWidget(FileGroupsPart *part);
+ ~FileGroupsWidget();
+
+public slots:
+ void refresh();
+ void addFiles ( const QStringList& fileList );
+ void removeFiles ( const QStringList& fileList );
+
+private slots:
+ void slotItemExecuted(QListViewItem *item);
+ void slotContextMenu(KListView *, QListViewItem *item, const QPoint &p);
+ void slotToggleShowNonProjectFiles();
+ void slotToggleDisplayLocation();
+
+protected:
+ void addFile(const QString &fileName);
+ void removeFile(const QString &fileName);
+
+private:
+ QStringList allFilesRecursively( QString const & );
+ FileGroupsPart *m_part;
+
+ class KToggleAction *m_actionToggleShowNonProjectFiles;
+ class KToggleAction *m_actionToggleDisplayLocation;
+ int LocationID;
+};
+
+#endif
+
diff --git a/parts/fileview/fileitemfactory.cpp b/parts/fileview/fileitemfactory.cpp
new file mode 100644
index 00000000..614f535c
--- /dev/null
+++ b/parts/fileview/fileitemfactory.cpp
@@ -0,0 +1,145 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qpainter.h>
+#include <kdebug.h>
+
+#include "filetreewidget.h"
+#include "fileitemfactory.h"
+
+using namespace filetreeview;
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileTreeViewItem
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeWidget* FileTreeViewItem::listView() const
+{
+ return static_cast<FileTreeWidget*>( QListViewItem::listView() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeViewItem::hideOrShow()
+{
+ kdDebug( 9017 ) << "MyFileTreeViewItem::hideOrShow(): " + path() << endl;
+ setVisible( listView()->shouldBeShown( this ) );
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>( firstChild() );
+ while (item)
+ {
+ //kdDebug( 9017 ) << "MyFileTreeViewItem::hideOrShow(): " + item->path() << endl;
+ item->hideOrShow();
+ item = static_cast<FileTreeViewItem*>( item->nextSibling() );
+ }
+}
+
+bool FileTreeViewItem::changeActiveDir( const QString& olddir, const QString& newdir, bool foundolddir, bool foundnewdir )
+{
+ kdDebug( 9017 ) << "FileTreeViewItem::changeActiveDir(): " + olddir << " new: " << newdir << " for: " << path() << endl;
+
+ if ( this->path() == olddir && isDir() && m_isActiveDir )
+ {
+ m_isActiveDir = false;
+ setVisible( listView()->shouldBeShown( this ) );
+ foundolddir = true;
+ repaint();
+ }
+
+ if ( this->path() == newdir && isDir() && !m_isActiveDir )
+ {
+ m_isActiveDir = true;
+ setVisible( listView()->shouldBeShown( this ) );
+ foundnewdir = true;
+ repaint();
+ }
+
+ if( foundnewdir && foundolddir )
+ return true;
+
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>( firstChild() );
+ while( item )
+ {
+ if ( item->changeActiveDir( olddir, newdir, foundnewdir, foundolddir ) )
+ return true;
+ else
+ item = static_cast<FileTreeViewItem*>(item->nextSibling());
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FileTreeViewItem::setProjectFile( QString const & path, bool pf )
+{
+
+ if ( this->path() == path && isProjectFile() != pf )
+ {
+ kdDebug( 9017 ) << "FileTreeViewItem::setProjectFile(): " + path << " projectfile: " << pf << endl;
+ m_isProjectFile = pf;
+ setVisible( listView()->shouldBeShown( this ) );
+ repaint();
+ return true;
+ }
+
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>( firstChild() );
+ while( item )
+ {
+ if ( item->setProjectFile( path, pf ) )
+ return true;
+ else
+ item = static_cast<FileTreeViewItem*>(item->nextSibling());
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeViewItem::paintCell(QPainter *p, const QColorGroup &cg,
+ int column, int width, int alignment)
+{
+ if ( listView()->showNonProjectFiles() && isProjectFile() )
+ {
+ QFont font( p->font() );
+ font.setBold( true );
+ p->setFont( font );
+ }
+
+ if( isActiveDir() )
+ {
+ QFont font( p->font() );
+ font.setItalic( true );
+ p->setFont( font );
+ }
+
+ QListViewItem::paintCell( p, cg, column, width, alignment );
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+
+int FileTreeViewItem::compare( QListViewItem *i, int col, bool ascending ) const
+{
+ KFileTreeViewItem* rhs = dynamic_cast<KFileTreeViewItem*>( i );
+ if (rhs)
+ {
+ if (rhs->isDir() && !isDir())
+ return (ascending) ? 1 : -1;
+ else
+ if (!rhs->isDir() && isDir())
+ return (ascending) ? -1 : 1;
+ }
+
+ return QListViewItem::compare( i, col, ascending );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class BranchItemFactory
+///////////////////////////////////////////////////////////////////////////////
diff --git a/parts/fileview/fileitemfactory.h b/parts/fileview/fileitemfactory.h
new file mode 100644
index 00000000..f87ae39a
--- /dev/null
+++ b/parts/fileview/fileitemfactory.h
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILEITEMFACTORY_H
+#define FILEITEMFACTORY_H
+
+#include <kfiletreeview.h>
+
+class FileTreeWidget;
+
+/**
+@author KDevelop Authors
+*/
+namespace filetreeview
+{
+ /**
+ @author KDevelop Authors
+ */
+ class FileTreeViewItem : public KFileTreeViewItem
+ {
+ friend class FileTreeBranchItem;
+ protected:
+ FileTreeViewItem( KFileTreeViewItem* parent, KFileItem* item, KFileTreeBranch* branch, bool pf )
+ : KFileTreeViewItem( parent, item, branch ), m_isProjectFile( pf ), m_isActiveDir( false )
+ {
+ hideOrShow();
+ }
+ FileTreeViewItem( KFileTreeView* parent, KFileItem* item, KFileTreeBranch* branch )
+ : KFileTreeViewItem( parent, item, branch ), m_isProjectFile( false )
+ {
+ hideOrShow();
+ }
+ virtual ~FileTreeViewItem() {}
+
+ public:
+ virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment );
+ FileTreeWidget* listView() const;
+ void hideOrShow();
+ bool isProjectFile() const { return m_isProjectFile; }
+ bool setProjectFile( QString const &path, bool pf );
+ bool isActiveDir() const { return m_isActiveDir; }
+ bool changeActiveDir( const QString &, const QString&, bool foundolddir = false, bool foundnewdir = false );
+
+ protected:
+ virtual int compare( QListViewItem *i, int col, bool ascending ) const;
+
+ private:
+ bool m_isProjectFile;
+ bool m_isActiveDir;
+ };
+
+ /**
+ @author KDevelop Authors
+ */
+ class FileTreeBranchItem : public KFileTreeBranch
+ {
+ protected:
+ FileTreeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix )
+ : KFileTreeBranch( view, url, name, pix, false,
+ new FileTreeViewItem( view, new KFileItem( url, "inode/directory", S_IFDIR ), this ) )
+ {
+ }
+ virtual ~FileTreeBranchItem()
+ {
+// if (root())
+// delete root()->fileItem();
+ }
+
+ };
+
+ /**
+ @author KDevelop Authors
+ */
+ class BranchItemFactory
+ {
+ public:
+ virtual FileTreeBranchItem *makeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix ) = 0;
+ };
+}
+
+#endif
diff --git a/parts/fileview/filetreeviewwidgetimpl.cpp b/parts/fileview/filetreeviewwidgetimpl.cpp
new file mode 100644
index 00000000..9e40a3bb
--- /dev/null
+++ b/parts/fileview/filetreeviewwidgetimpl.cpp
@@ -0,0 +1,169 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qpopupmenu.h>
+#include <kxmlguiclient.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kdeversion.h>
+
+#include <kdevproject.h>
+
+#include "fileviewpart.h"
+#include "filetreewidget.h"
+#include "fileitemfactory.h"
+
+#include "filetreeviewwidgetimpl.h"
+
+using namespace filetreeview;
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileTreeViewWidgetImpl
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeViewWidgetImpl::FileTreeViewWidgetImpl( FileTreeWidget *parent, const char *name )
+ : QObject( parent, name ), m_branchItemFactory( 0 ),
+ m_part( parent->part() ), m_isReloadingTree( false )
+{
+ kdDebug(9017) << "FileTreeViewWidgetImpl::FileTreeViewWidgetImpl()" << endl;
+
+ // Actions
+ m_actionToggleShowNonProjectFiles = new KToggleAction( i18n("Show Non Project Files"), KShortcut(),
+ this, SLOT(slotToggleShowNonProjectFiles()), this, "actiontoggleshowshownonprojectfiles" );
+ m_actionToggleShowNonProjectFiles->setCheckedState(i18n("Hide Non Project Files"));
+ m_actionToggleShowNonProjectFiles->setWhatsThis(i18n("<b>Show non project files</b><p>Shows files that do not belong to a project in a file tree."));
+
+ // Reload good ol' settings
+ QDomDocument &dom = *m_part->projectDom();
+ m_actionToggleShowNonProjectFiles->setChecked( !DomUtil::readBoolEntry(dom, "/kdevfileview/tree/hidenonprojectfiles") );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeViewWidgetImpl::~FileTreeViewWidgetImpl()
+{
+ kdDebug(9017) << "FileTreeViewWidgetImpl::~FileTreeViewWidgetImpl()" << endl;
+
+ delete m_branchItemFactory;
+
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::writeBoolEntry( dom, "/kdevfileview/tree/hidenonprojectfiles", !showNonProjectFiles() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeWidget *FileTreeViewWidgetImpl::fileTree() const
+{
+ return static_cast<FileTreeWidget *>( parent() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QDomDocument &FileTreeViewWidgetImpl::projectDom() const
+{
+ return *part()->projectDom();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString FileTreeViewWidgetImpl::projectDirectory() const
+{
+ return part()->project()->projectDirectory();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FileTreeViewWidgetImpl::showNonProjectFiles() const
+{
+ return m_actionToggleShowNonProjectFiles->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeViewWidgetImpl::fillPopupMenu( QPopupMenu *popupMenu, QListViewItem *item ) const
+{
+ // Show the "reload tree" menu-item only if it is requested for the root object
+ // and we don't have a sync-with-repository operation pending (which otherwise will
+ // kill the call-back's from working)
+ if (item == fileTree()->firstChild() && canReloadTree())
+ {
+ int id = popupMenu->insertItem( i18n( "Reload Tree"), this, SLOT( slotReloadTree() ) );
+ popupMenu->setWhatsThis( id, i18n("<b>Reload tree</b><p>Reloads the project files tree.") );
+ }
+
+ m_actionToggleShowNonProjectFiles->plug( popupMenu );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KURL::List FileTreeViewWidgetImpl::selectedPathUrls()
+{
+ kdDebug(9017) << "FileTreeViewWidgetImpl::selectedPathUrls()" << endl;
+
+ KURL::List urlList;
+
+ QValueList<QListViewItem*> list = allSelectedItems( fileTree()->firstChild() );
+ QValueList<QListViewItem*>::Iterator it = list.begin();
+ while( it != list.end() )
+ {
+ FileTreeViewItem * item = static_cast<FileTreeViewItem*>( *it );
+ if ( fileTree()->shouldBeShown( item ) )
+ {
+ KURL url;
+ url.setPath( item->path() );
+ urlList << url;
+ }
+ ++it;
+ }
+
+ return urlList;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QValueList<QListViewItem*> FileTreeViewWidgetImpl::allSelectedItems( QListViewItem * item ) const
+{
+ QValueList<QListViewItem*> list;
+
+ if ( item )
+ {
+ if ( item->isSelected() )
+ {
+ list << item;
+ }
+
+ QListViewItem * it = item->firstChild();
+ while( it )
+ {
+ list += allSelectedItems( it );
+ it = it->nextSibling();
+ }
+ }
+
+ return list;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeViewWidgetImpl::slotReloadTree()
+{
+ fileTree()->openDirectory( projectDirectory() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeViewWidgetImpl::slotToggleShowNonProjectFiles()
+{
+ fileTree()->hideOrShow();
+}
+
+#include "filetreeviewwidgetimpl.moc"
diff --git a/parts/fileview/filetreeviewwidgetimpl.h b/parts/fileview/filetreeviewwidgetimpl.h
new file mode 100644
index 00000000..fae4b248
--- /dev/null
+++ b/parts/fileview/filetreeviewwidgetimpl.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef FILETREEVIEWWIDGETIMPL_H
+#define FILETREEVIEWWIDGETIMPL_H
+
+#include <qobject.h>
+#include <qvaluelist.h>
+#include <kfiletreeview.h>
+#include <qdom.h>
+
+#include "fileitemfactory.h"
+
+class FileTreeWidget;
+namespace filetreeview
+{
+ class FileTreeViewItem;
+ class FileTreeBranchItem;
+ class BranchItemFactory;
+}
+class FileViewPart;
+class QHeader;
+class KToggleAction;
+class QPopupMenu;
+
+/**
+* @author Mario Scalas
+* A base class for providing additional features to the standard KFileTreeViewItem-based widget we
+* use for listing files in project directory.
+*/
+class FileTreeViewWidgetImpl : public QObject
+{
+ Q_OBJECT
+public:
+ FileTreeViewWidgetImpl( FileTreeWidget *parent, const char *name );
+ virtual ~FileTreeViewWidgetImpl();
+
+ //! return a list containing the filenames of the currently selected items.
+ KURL::List selectedPathUrls();
+ // shortcuts
+ FileTreeWidget *fileTree() const;
+ QDomDocument &projectDom() const;
+ QHeader *header() const { return fileTree()->header(); }
+ void setColumnWidth( int column, int w ) { fileTree()->setColumnWidth( column, w ); }
+ int contentsWidth() const { return fileTree()->contentsWidth(); }
+ void triggerUpdate() { fileTree()->triggerUpdate(); }
+ FileViewPart *part() const { return m_part; }
+ filetreeview::FileTreeViewItem *currentItem() const { return static_cast<filetreeview::FileTreeViewItem*>( fileTree()->currentItem() ); }
+ /**
+ * @return a reference to a new filetreeview::BranchItemFactory object which can be used for filling
+ * the tree view.
+ */
+ filetreeview::BranchItemFactory *branchItemFactory() const { return m_branchItemFactory; }
+ /**
+ * Costraints that must be satisfied to start a reload of the the tree.
+ * @return
+ */
+ virtual bool canReloadTree() const = 0;
+ /**
+ * Here the popup menu is filled: by standard only the "reload tree" (only if the above function
+ * returns true) and "show project files" options are added
+ * @param popupMenu the menu to fill
+ * @param item the QListViewItem which this menu has been requested upon
+ */
+ virtual void fillPopupMenu( QPopupMenu *popupMenu, QListViewItem *item ) const;
+ /**
+ * @return true if non project files are to be shown, false otherwise
+ */
+ bool showNonProjectFiles() const;
+
+signals:
+ /**
+ * Emitted when the current implementation "recognizes" it cannot work anymore: for example the VCS impl.
+ * can ask to be relieved from work when the VCS plug-in it uses has been unloaded!
+ */
+ void implementationInvalidated();
+
+private slots:
+ void slotReloadTree();
+ void slotToggleShowNonProjectFiles();
+
+protected:
+ void setBranchItemFactory( filetreeview::BranchItemFactory *aFactory ) { m_branchItemFactory = aFactory; }
+ QString projectDirectory() const;
+
+private:
+ QValueList<QListViewItem*> allSelectedItems( QListViewItem * item ) const;
+ filetreeview::BranchItemFactory *m_branchItemFactory;
+
+ FileViewPart *m_part;
+
+ bool m_isReloadingTree;
+
+ KToggleAction *m_actionToggleShowNonProjectFiles;
+};
+
+#endif
diff --git a/parts/fileview/filetreewidget.cpp b/parts/fileview/filetreewidget.cpp
new file mode 100644
index 00000000..e0d7538b
--- /dev/null
+++ b/parts/fileview/filetreewidget.cpp
@@ -0,0 +1,387 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas (VCS Support) *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filetreewidget.h"
+
+#include <qheader.h>
+#include <qpainter.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qcolor.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpopupmenu.h>
+#include <kfileitem.h>
+#include <kurl.h>
+#include <kaction.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "kdevversioncontrol.h"
+#include "domutil.h"
+#include "urlutil.h"
+
+#include "fileviewpart.h"
+#include "fileitemfactory.h"
+#include "vcsfiletreewidgetimpl.h"
+#include "stdfiletreewidgetimpl.h"
+
+using namespace filetreeview;
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileTreeViewItem
+///////////////////////////////////////////////////////////////////////////////
+
+#include <kdeversion.h>
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileTreeWidget
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeWidget::FileTreeWidget( FileViewPart *part, QWidget *parent, KDevVCSFileInfoProvider *infoProvider )
+ : KFileTreeView( parent, "filetreewidget" ), m_part( part ), m_rootBranch( 0 )
+{
+ kdDebug(9017) << "Requested FileTree for: " << projectDirectory() << endl;
+ if (versionControl() && infoProvider)
+ kdDebug(9017) << "Valid VCS directory: " << versionControl()->isValidDirectory( projectDirectory() ) << endl;
+
+ if (infoProvider && versionControl() && versionControl()->isValidDirectory( projectDirectory() ))
+ m_impl = new VCSFileTreeWidgetImpl( this, infoProvider );
+ else
+ m_impl = new StdFileTreeWidgetImpl( this );
+
+ //setResizeMode( QListView::LastColumn );
+ setSorting( 0 );
+ setAllColumnsShowFocus( true );
+ setSelectionMode( QListView::Extended ); // Enable multiple items selection by use of Ctrl/Shift
+ setDragEnabled( false );
+
+ // Slot connections
+ connect( this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*)) );
+ connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );
+ // Intercepts KDevelop core signals and VCS notifications (if available)
+ connect( m_part->project(), SIGNAL( activeDirectoryChanged( const QString&, const QString& ) ),
+ this, SLOT( changeActiveDirectory( const QString&, const QString& ) ) );
+ connect( m_part->project(), SIGNAL( addedFilesToProject( const QStringList & ) ),
+ this, SLOT( addProjectFiles( const QStringList & ) ) );
+ connect( m_part->project(), SIGNAL( removedFilesFromProject( const QStringList & ) ),
+ this, SLOT( removeProjectFiles( const QStringList & ) ) );
+ // Safeguard against VCS plug-in unloading at run-time
+ connect( m_impl, SIGNAL(implementationInvalidated()), this, SLOT(slotImplementationInvalidated()) );
+
+ // Hide pattern for files
+ QDomDocument &dom = *m_part->projectDom();
+ QString defaultHidePattern = "*.o,*.lo,CVS";
+ QString hidePattern = DomUtil::readEntry( dom, "/kdevfileview/tree/hidepatterns", defaultHidePattern );
+ m_hidePatterns = QStringList::split( ",", hidePattern );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+FileTreeWidget::~FileTreeWidget()
+{
+ kdDebug(9017) << "FileTreeWidget::~FileTreeWidget()" << endl;
+
+ QDomDocument &dom = *m_part->projectDom();
+ DomUtil::writeEntry( dom, "/kdevfileview/tree/hidepatterns", hidePatterns() );
+
+// delete m_impl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::openDirectory( const QString& dirName )
+{
+ kdDebug(9017) << "FileTreeWidget::openDirectory(): " + dirName << endl;
+
+ // if we're reloading
+ if (m_rootBranch)
+ {
+ disconnect( m_rootBranch, SIGNAL(populateFinished(KFileTreeViewItem*)), this, SLOT(finishPopulate(KFileTreeViewItem*)) );
+ removeBranch( m_rootBranch );
+ m_projectFiles.clear();
+ }
+
+ addProjectFiles( m_part->project()->allFiles(), true );
+
+ KURL url = KURL::fromPathOrURL( dirName );
+ const QPixmap& pix = KMimeType::mimeType("inode/directory")->pixmap( KIcon::Small );
+
+ // this is a bit odd, but the order of these calls seems to be important
+ //FileTreeBranch *b = new FileTreeBranch( this, url, url.prettyURL(), pix );
+ FileTreeBranchItem *b = m_impl->branchItemFactory()->makeBranchItem( this, url, url.prettyURL(), pix );
+ b->setChildRecurse( false );
+ m_rootBranch = addBranch( b );
+ m_rootBranch->setOpen( true );
+ connect( m_rootBranch, SIGNAL(populateFinished(KFileTreeViewItem*)), this, SLOT(finishPopulate(KFileTreeViewItem*)) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FileTreeWidget::shouldBeShown( KFileTreeViewItem* item )
+{
+ FileTreeViewItem * i = static_cast<FileTreeViewItem *>( item );
+ return ( i->isDir() || ( (m_impl->showNonProjectFiles() || i->isProjectFile() )
+ && !matchesHidePattern( i->url().fileName() ) ) ) ;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FileTreeWidget::matchesHidePattern(const QString &fileName)
+{
+ QStringList::ConstIterator it;
+ for (it = m_hidePatterns.begin(); it != m_hidePatterns.end(); ++it) {
+ QRegExp re(*it, true, true);
+ if (re.search(fileName) == 0 && (uint)re.matchedLength() == fileName.length())
+ return true;
+ }
+
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::hideOrShow()
+{
+ // This is called the first time the tree branch is expanded
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>(firstChild());
+ if( !item )
+ return;
+
+ // Need to skip the root item (which is the sub-directory)
+ // i.e. "/home/devmario/src/kdevelop/parts/cvsservice"
+ item = static_cast<FileTreeViewItem*>( item->firstChild() );
+ // Now fill the sub-tree
+ while (item)
+ {
+ item->hideOrShow();
+ item = static_cast<FileTreeViewItem*>(item->nextSibling());
+ }
+}
+
+void FileTreeWidget::finishPopulate(KFileTreeViewItem* item)
+{
+ if( item == firstChild() )
+ {
+ changeActiveDirectory( "", m_part->project()->activeDirectory() );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::slotItemExecuted( QListViewItem* item )
+{
+ if (!item)
+ return;
+
+ KFileTreeViewItem* ftitem = static_cast<KFileTreeViewItem*>(item);
+
+ if (ftitem->isDir())
+ return;
+
+ m_part->partController()->editDocument( ftitem->url() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::slotContextMenu( KListView *, QListViewItem* item, const QPoint &p )
+{
+ kdDebug(9017) << "FileTreeWidget::slotContextMenu(...)" << endl;
+
+ KPopupMenu popup( i18n("File Tree"), this );
+
+ // If an item is selected, fill the file context with selected files' list
+ if (item)
+ {
+ m_impl->fillPopupMenu( &popup, item );
+ FileContext context( m_impl->selectedPathUrls() );
+ m_part->core()->fillContextMenu( &popup, &context );
+ }
+
+
+ popup.exec( p );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString FileTreeWidget::projectDirectory()
+{
+ return m_part->project()->projectDirectory();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @brief Test whether given file (or a directory) is part of this project.
+ *
+ * @param fileName or directory to test for presence.
+ */
+bool FileTreeWidget::isInProject(const QString &fileName) const
+{
+ return m_projectFiles.contains(fileName);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @brief Add a bunch of files to this project.
+ *
+ * Whenever we load a project or user chooses to add a bunch of files using UI,
+ * we end in this method.
+ * We merge the list of files already in the project (if any) with the incoming set.
+ *
+ * @param fileList
+ * @param constructing
+ *
+ * @see m_projectFiles
+ */
+void FileTreeWidget::addProjectFiles( QStringList const & fileList, bool constructing )
+{
+ kdDebug(9017) << "files added to project: " << fileList << endl;
+
+ QStringList::ConstIterator it;
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ if( (*it).isEmpty() )
+ continue;
+ kdDebug(9017) << "adding file: " << *it << endl;
+ const QString file = projectDirectory() + "/" + ( *it );
+ if ( !m_projectFiles.contains( file ) )
+ {
+ // We got a new file to add to this project.
+ // Ensure all the parent directories are part of the project set, too.
+ QStringList paths = QStringList::split( "/", *it);
+ paths.pop_back();
+ while( !paths.isEmpty() )
+ {
+ // We are adding the directories from longest (the one containing our file),
+ // to the shortest, measured from root directory of our project.
+ // Whenever we find out that a directory is already recorded as part of our project,
+ // we may stop adding, because its parent directories were already added -
+ // in some previous addition.
+ QString joinedPaths = paths.join("/");
+ if( m_projectFiles.contains( joinedPaths ) )
+ break;
+ m_projectFiles.insert( projectDirectory() + "/" + joinedPaths, true );
+ paths.pop_back();
+ }
+ m_projectFiles.insert( file, false );
+// kdDebug(9017) << "file added: " << file << endl;
+ }
+
+ if ( !constructing )
+ {
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>(firstChild());
+ if( item )
+ {
+ item->setProjectFile( file, true );
+ }
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::removeProjectFiles( QStringList const & fileList )
+{
+ kdDebug(9017) << "files removed from project: " << fileList.count() << endl;
+
+ QStringList::ConstIterator it;
+ for ( it = fileList.begin(); it != fileList.end(); ++it )
+ {
+ QString file = m_part->project()->projectDirectory() + "/" + ( *it );
+ m_projectFiles.remove( file );
+ kdDebug(9017) << "file removed: " << file << endl;
+
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>(firstChild());
+ if( item )
+ {
+ item->setProjectFile( file, false );
+ }
+ }
+}
+
+void FileTreeWidget::changeActiveDirectory( const QString& olddir, const QString& newdir )
+{
+ FileTreeViewItem* item = static_cast<FileTreeViewItem*>(firstChild());
+ if( item )
+ {
+ item->changeActiveDir( projectDirectory() + "/" + olddir, projectDirectory() + "/" + newdir );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::applyHidePatterns( const QString &hidePatterns )
+{
+ m_hidePatterns = QStringList::split( ",", hidePatterns );
+ hideOrShow();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString FileTreeWidget::hidePatterns() const
+{
+ return m_hidePatterns.join( "," );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevVersionControl *FileTreeWidget::versionControl() const
+{
+ if (part() && part()->versionControl())
+ return part()->versionControl();
+ else
+ return 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool FileTreeWidget::showNonProjectFiles() const
+{
+ return m_impl->showNonProjectFiles();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileTreeWidget::slotImplementationInvalidated()
+{
+ kdDebug(9017) << "FileTreeWidget::slotImplementationInvalidated()" << endl;
+
+ // Destroy old implementation, create the simpler default impl. and
+ // reload list view
+ // remove old branch
+ removeBranch( m_rootBranch );
+ m_rootBranch = 0; // avoid openDirectory() trying to release the branch
+
+ // Restore a clean situation for an eventual new & different implementation
+ /** \FIXME this for-loop should really go in ~FileTreeViewWidgetImpl() but
+ * it crashes there: here it works :-/
+ */
+ for (int i=columns()-1; i>=0; --i)
+ {
+ kdDebug(9017) << "Removing column: " << i << endl;
+ removeColumn( i );
+ }
+
+ delete m_impl;
+ m_impl = new StdFileTreeWidgetImpl( this );
+ openDirectory( projectDirectory() );
+}
+
+#include "filetreewidget.moc"
diff --git a/parts/fileview/filetreewidget.h b/parts/fileview/filetreewidget.h
new file mode 100644
index 00000000..53dc77d3
--- /dev/null
+++ b/parts/fileview/filetreewidget.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas (VCS Support) *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILETREEWIDGET_H_
+#define _FILETREEWIDGET_H_
+
+#include <qguardedptr.h>
+#include <kfiletreeview.h>
+
+#include <kdevversioncontrol.h>
+
+class FileViewPart;
+class FileTreeViewWidgetImpl;
+class KDevVersionControl;
+
+/**
+* This is FileTree widget for listing files belonging to the project. It does feature:
+* - dynamic updates reflecting the state of the project dir and subdirs
+* - VCS support for showing VCS fields like state, working and repository revisions
+* - bolding the filenames belonging to project to distinguish them from the others
+* - dynamic filtering so the user has not to care about temporary files eating screen space ;-)
+*
+* Design notes
+* The class uses two different implementations (referred by m_impl data member):
+* - @see VCSFileTreeWidgetImpl for VCS support
+* VCS support is detencted by the constructor looking for the @see KDevPlugin::versionControl() member:
+* if the current VCS plug-in does offer a @see KDevVCSFileInfoProvider object than this will be used for
+* querying about files' data. If neither VCS plugin nor valid info provider is found then the filetreeview
+* will fallback to the standard implementation
+* - @see StdFileTreeWidgetImpl for standard visualization, just like the KFileTreeView
+*
+* Each implementation must provide a branch item factory which the file filetree will delegate the creation
+* of specific KFileTreeViewItem-derived objects: currently they are both defined in the same .h/.cpp files
+* of the implementations listed above.
+*
+*/
+class FileTreeWidget : public KFileTreeView
+{
+ Q_OBJECT
+public:
+ FileTreeWidget( FileViewPart *part, QWidget *parent, KDevVCSFileInfoProvider *infoProvider );
+ virtual ~FileTreeWidget();
+
+ void openDirectory(const QString &dirName);
+ bool shouldBeShown( KFileTreeViewItem* item );
+
+ QString projectDirectory();
+ bool isInProject(const QString &fileName) const;
+
+ FileViewPart *part() const { return m_part; }
+
+ //KDevVCSFileInfoProvider *vcsFileInfoProvider() const;
+ void applyHidePatterns( const QString &hidePatterns );
+ QString hidePatterns() const;
+
+ bool showNonProjectFiles() const;
+
+public slots:
+ void hideOrShow();
+
+
+private slots:
+ void slotItemExecuted(QListViewItem *item);
+ void slotContextMenu(KListView *, QListViewItem *item, const QPoint &p);
+
+ void changeActiveDirectory( const QString&, const QString& );
+ void finishPopulate(KFileTreeViewItem* item);
+
+ void addProjectFiles( QStringList const & fileList, bool constructing = false );
+ void removeProjectFiles( QStringList const & fileList );
+ //! We must guard against unloading the used VCS plug-in when using it: we
+ //! fall back to the implementation (a file view without VCS fields, only filenames)
+ void slotImplementationInvalidated();
+
+private:
+ bool matchesHidePattern(const QString &fileName);
+ KDevVersionControl *versionControl() const;
+
+ QStringList m_hidePatterns;
+ /**
+ * @brief Set of all the files in this project.
+ *
+ * In addition to all the project files,
+ * we also keep a list of all directories containing any project files -
+ * effectively holding the whole project tree.
+ *
+ * @bug
+ * Well, it is not just a plain set,
+ * but rather a map with next-to-useless element value,
+ * keyed by names of files.
+ * QT3 does not seem to have a set datatype,
+ * thus we use the QMap type instead.
+ */
+ QMap<QString, bool> m_projectFiles;
+
+ FileViewPart *m_part;
+ KFileTreeBranch *m_rootBranch;
+ QGuardedPtr<FileTreeViewWidgetImpl> m_impl;
+};
+
+#endif
diff --git a/parts/fileview/fileviewpart.cpp b/parts/fileview/fileviewpart.cpp
new file mode 100644
index 00000000..d6d6691d
--- /dev/null
+++ b/parts/fileview/fileviewpart.cpp
@@ -0,0 +1,161 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "fileviewpart.h"
+
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qtoolbutton.h>
+#include <qdom.h>
+#include <kcombobox.h>
+#include <qtimer.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdialogbase.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+
+#include "partwidget.h"
+#include "domutil.h"
+#include "filetreewidget.h"
+#include "vcscolorsconfigwidget.h"
+#include "kdevversioncontrol.h"
+#include "kdevplugininfo.h"
+
+#define FILETREE_OPTIONS 1
+
+///////////////////////////////////////////////////////////////////////////////
+// static members
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColors FileViewPart::vcsColors;
+
+///////////////////////////////////////////////////////////////////////////////
+// class factory
+///////////////////////////////////////////////////////////////////////////////
+
+typedef KDevGenericFactory<FileViewPart> FileViewFactory;
+static const KDevPluginInfo data("kdevfileview");
+K_EXPORT_COMPONENT_FACTORY( libkdevfileview, FileViewFactory( data ) )
+
+///////////////////////////////////////////////////////////////////////////////
+// class FileTreeWidget
+///////////////////////////////////////////////////////////////////////////////
+
+FileViewPart::FileViewPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "FileViewPart"),
+ m_widget( 0 )
+{
+ setInstance( FileViewFactory::instance() );
+ // setXMLFile("kdevfileview.rc");
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createProjectConfigPage( i18n("File Tree"), FILETREE_OPTIONS, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+ QTimer::singleShot( 1000, this, SLOT(init()) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileViewPart::init( )
+{
+ m_widget = new PartWidget( this );
+ m_widget->setIcon( SmallIcon( info()->icon() ) );
+ mainWindow()->embedSelectView( m_widget, i18n("File Tree"), i18n("File tree view in the project directory") );
+
+ loadSettings();
+
+ m_widget->showProjectFiles();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+FileViewPart::~FileViewPart()
+{
+ if (m_widget)
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+
+ storeSettings();
+
+ delete _configProxy;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileViewPart::loadSettings()
+{
+ const QColor added = QColor( "#CCFF99" ),
+ updated = QColor( "#FFFFCC" ),
+ modified = QColor( "#CCCCFF" ),
+ conflict = QColor( "#FF6666" ),
+ sticky = QColor( "#FFCCCC" ),
+ needsPatch = QColor( "#FFCCFF" ),
+ needsCheckout = QColor( "#FFCCFF" ),
+ unknown = QColor( white ),
+ defaultColor = QColor( white );
+
+ KConfig *cfg = instance()->config();
+
+ KConfigGroupSaver gs( cfg, "VCS Colors" );
+ vcsColors.added = cfg->readColorEntry( "FileAddedColor", &added );
+ vcsColors.updated = cfg->readColorEntry( "FileUpdatedColor", &updated );
+ vcsColors.sticky = cfg->readColorEntry( "FileStickyColor", &sticky );
+ vcsColors.modified = cfg->readColorEntry( "FileModifiedColor", &modified );
+ vcsColors.conflict = cfg->readColorEntry( "FileConflictColor", &conflict );
+ vcsColors.needsPatch = cfg->readColorEntry( "FileNeedsPatchColor", &needsPatch );
+ vcsColors.needsCheckout = cfg->readColorEntry( "FileNeedsCheckoutColor", &needsCheckout );
+ vcsColors.unknown = cfg->readColorEntry( "FileUnknownColor", &unknown );
+ vcsColors.defaultColor = cfg->readColorEntry( "DefaultColor", &defaultColor );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void FileViewPart::storeSettings()
+{
+ KConfig *cfg = instance()->config();
+ // VCS colors
+ KConfigGroupSaver gs( cfg, "VCS Colors" );
+ cfg->writeEntry( "FileAddedColor", vcsColors.added );
+ cfg->writeEntry( "FileUpdatedColor", vcsColors.updated );
+ cfg->writeEntry( "FileStickyColor", vcsColors.sticky );
+ cfg->writeEntry( "FileModifiedColor", vcsColors.modified );
+ cfg->writeEntry( "FileConflictColor", vcsColors.conflict );
+ cfg->writeEntry( "FileNeedsPatchColor", vcsColors.needsPatch );
+ cfg->writeEntry( "FileNeedsCheckoutColor", vcsColors.needsCheckout );
+ cfg->writeEntry( "FileUnknownColor", vcsColors.unknown );
+ cfg->writeEntry( "DefaultColor", vcsColors.defaultColor );
+}
+
+void FileViewPart::insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == FILETREE_OPTIONS )
+ {
+ VCSColorsConfigWidget *w = new VCSColorsConfigWidget( this, vcsColors, page, "vcscolorsconfigwidget" );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ }
+}
+
+KDevVersionControl *FileViewPart::versionControl()
+{
+ return extension<KDevVersionControl>("KDevelop/VersionControl");
+}
+
+#include "fileviewpart.moc"
diff --git a/parts/fileview/fileviewpart.h b/parts/fileview/fileviewpart.h
new file mode 100644
index 00000000..9c9a03da
--- /dev/null
+++ b/parts/fileview/fileviewpart.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2001-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILEVIEWPART_H_
+#define _FILEVIEWPART_H_
+
+#include <qguardedptr.h>
+#include <configwidgetproxy.h>
+#include "kdevplugin.h"
+#include "vcscolorsconfigwidget.h"
+
+class PartWidget;
+class KDialogBase;
+class KDevVersionControl;
+
+class FileViewPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ FileViewPart( QObject *parent, const char *name, const QStringList & );
+ virtual ~FileViewPart();
+
+ //! Colors to use for VCS visual feed-back
+ static VCSColors vcsColors;
+
+ KDevVersionControl *versionControl();
+
+private slots:
+ void insertConfigWidget( const KDialogBase* dlg, QWidget * page, unsigned int );
+ void init();
+
+private:
+ void loadSettings();
+ void storeSettings();
+
+ QGuardedPtr<PartWidget> m_widget;
+ ConfigWidgetProxy * _configProxy;
+};
+
+#endif
diff --git a/parts/fileview/kdevfilegroups.desktop b/parts/fileview/kdevfilegroups.desktop
new file mode 100644
index 00000000..41b63d2a
--- /dev/null
+++ b/parts/fileview/kdevfilegroups.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Allows for grouping of project files according to filename patterns.
+Comment[ca]=Permet l'agrupació de fitxers del projecte d'acord als patrons dels noms de fitxer.
+Comment[da]=Tillader gruppering af projektfiler efter filnavnemønstre.
+Comment[de]=Erlaubt die Gruppierung von Projektdateien nach Dateimustern.
+Comment[el]=Επιτρέπει την ομαδοποίηση των αρχείων του έργου σύμφωνα με διάφορα μοτίβα.
+Comment[es]=Permite la agrupación de archivos del proyecto de acuerdo a patrones en sus nombres.
+Comment[et]=Võimaldab rühmitada projekti faile vastavalt failinimede mustritele.
+Comment[eu]=Proiektu fitxategiak fitxategi-izen ereduen arabera taldekatzeko aukera ematen du.
+Comment[fa]=اجازۀ گروه کردن پرونده‌های پروژه را طبق الگوهای نام پرونده می‌دهد.
+Comment[fr]=Permet de grouper des fichiers projet en fonction des motifs de noms de fichier.
+Comment[gl]=Permite o agrupamento dos arquivos do proxecto seguindo patróns nos seus nomes.
+Comment[hi]=फ़ाइल-नाम पैटर्न के आधार पर परियोजना फ़ाइलों का समूह बनाना स्वीकारता है.
+Comment[hu]=Lehetővé teszi projektfájlok csoportosítását fájlnévminta alapján
+Comment[it]=Permette il raggruppamento dei file di progetto per schemi del nome file.
+Comment[ja]=ファイル名のパターンによりプロジェクトファイルのグルーピングを可能にします。
+Comment[ms]=Membenarkan pengumpulan bagi fail projek mengikut corak namafail.
+Comment[nds]=Maakt dat Sorteren vun Projektdateien na Dateinaam-Mustern mööglich.
+Comment[ne]=फाइल नाम बाँन्की अनुसार परियोजना फाइलहरू समूहबद्ध गर्न अनुमति दिन्छ ।
+Comment[nl]=Groepeert projectbestanden op grond van patronen in bestandsnamen.
+Comment[pl]=Umożliwia grupowanie plików projektu zgodnie z wzorcami nazw plików.
+Comment[pt]=Permite o agrupamento de ficheiros de projecto, de acordo com padrões de nomes de ficheiros.
+Comment[pt_BR]=Permite agrupar arquivos de projetos de acordo com padrões de nome de arquivo.
+Comment[ru]=Позволяет группировать файлы в проекте согласно шаблонам имён.
+Comment[sk]=Umožní zoskupenie projektových súborov podľa vzoru mien súborov.
+Comment[sr]=Дозвољава груписање пројектних фајлова према облицима имена фајлова.
+Comment[sr@Latn]=Dozvoljava grupisanje projektnih fajlova prema oblicima imena fajlova.
+Comment[sv]=Tillåter att projektfiler grupperas enligt filnamnsmönster.
+Comment[ta]=திட்ட பணிகோப்புகளை கோப்பின் பெயர் அடிப்படையில் அதனை குழுவாக பிரிக்கும்.
+Comment[tg]=Барои файлҳои дар номҳои қолиб имкон медиҳад.
+Comment[tr]=Dosya adı desenlerine göre proje dosyalarının gruplanmasını sağlar.
+Comment[zh_CN]=允许你根据文件名模式规类工程文件。
+Comment[zh_TW]=允許專案檔案根據檔名樣式來分群組。
+Name=KDevFileGroups
+Name[da]=KDevelop filgrupper
+Name[de]=Dateigruppen-Komponente (KDevelop)
+Name[hi]=के-डेव-फ़ाइल-ग्रुप्स
+Name[nds]=KDevelop-Dateikoppeln
+Name[pl]=KDevGrupyPlików
+Name[sk]=KDev zoskupenie súborov
+Name[sv]=KDevelop filgrupper
+Name[ta]=KDev கோப்பு குழுக்கள்
+Name[tg]=Гурӯҳҳои файли KDev
+Name[zh_TW]=KDevelop 檔案群組
+GenericName=File Groups
+GenericName[br]=Strolladoù a restroù
+GenericName[ca]=Grups de fitxers
+GenericName[da]=Filgrupper
+GenericName[de]=Dateigruppen
+GenericName[el]=Ομάδες αρχείων
+GenericName[es]=Grupos de archivos
+GenericName[et]=Failigrupid
+GenericName[eu]=Fitxategi taldeak
+GenericName[fa]=گروههای پرونده
+GenericName[fr]=Groupes de fichiers
+GenericName[gl]=Grupos de arquivos
+GenericName[hi]=फ़ाइल समूह
+GenericName[hu]=Fájlcsoportok
+GenericName[it]=Gruppi file
+GenericName[ja]=ファイルグループ
+GenericName[ms]=Kumpulan Fail
+GenericName[nds]=Dateikoppeln
+GenericName[ne]=फाइल समूह
+GenericName[nl]=Bestandsgroepen
+GenericName[pl]=Grupy plików
+GenericName[pt]=Grupos de Ficheiros
+GenericName[pt_BR]=Grupos de Arquivo
+GenericName[ru]=Группы файлов
+GenericName[sk]=Zoskupenie súborov
+GenericName[sl]=Skupine datotek
+GenericName[sr]=Групе фајлова
+GenericName[sr@Latn]=Grupe fajlova
+GenericName[sv]=Filgrupper
+GenericName[ta]=கோப்புக்குழுக்கள்
+GenericName[tg]=Гурӯҳи файлҳо
+GenericName[tr]=Dosya Grupları
+GenericName[zh_CN]=文件分组
+GenericName[zh_TW]=檔案群組
+ServiceTypes=KDevelop/Plugin
+Icon=attach
+X-KDE-Library=libkdevfilegroups
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=ProjectFileGroupsManagement
diff --git a/parts/fileview/kdevfileview.desktop b/parts/fileview/kdevfileview.desktop
new file mode 100644
index 00000000..cbdd269c
--- /dev/null
+++ b/parts/fileview/kdevfileview.desktop
@@ -0,0 +1,85 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a way of navigating and interacting with the source files of the current project.
+Comment[ca]=Proporciona un mètode de navegació i interacció amb els fitxers de codi font del projecte actual.
+Comment[da]=Sørger for en måde at navigere og interagere med kildefiler for dette projekt.
+Comment[de]=Bietet Funktionalität zur Navigation und zum Umgang mit den Quelltexten des aktuellen Projektes.
+Comment[el]=Προσφέρει μια μέθοδο πλοήγησης και αλληλεπίδρασης με τα αρχεία πηγαίου κώδικα του τρέχοντος έργου.
+Comment[es]=Proporciona un método de navegación e interacción con los archivos de código fuente del proyecto actual.
+Comment[et]=Võimaldab aktiivse projekti lähtekoodifailide vahel liikuda ja neis üht-teist ette võtta.
+Comment[eu]=Uneko proiektuko itruburu fitxategiekin lan egiteko eta hauen artean nabigatzeko aukera ematen du.
+Comment[fa]=راهی برای ناوش و تعامل با پرونده‌های منبع پروژۀ جاری را فراهم می‌کند.
+Comment[fr]=Fournit un moyen de naviguer et d'interagir avec les fichiers source du projet actuel.
+Comment[gl]=Proporciona unha maneira de navegar e interactuar cos ficheiros fonte do proxecto actual.
+Comment[hu]=Lehetővé teszi az aktuális projekthez tartozó forrásfájlok áttekintését, kezelését
+Comment[it]=Offre un modo per navigare e interagire con il file sorgente del progetto attuale.
+Comment[ja]=現在のプロジェクトのソースファイルでナビゲーションおよび対話する方法を提供します。
+Comment[ms]=Menyediakan cara untuk pandu arah dan berinteraksi dengan fail sumber bagi projek semasa.
+Comment[nds]=Stellt Ünnerstütten bi't Stüern binnen un för't Hanteren vun de Borndateien vun't aktuelle Projekt praat.
+Comment[ne]=हालको परियोजनाको स्रोत फाइलसँग नेभिगेटिङ र अन्तरक्रिया गर्ने तरिका प्रदान गर्दछ ।
+Comment[nl]=Handig bladeren en zoeken in de broncode-bestanden van het huidige project.
+Comment[pl]=Umożliwia metodę nawigacji i interacji z plikami źródłowymi bieżącego projektu.
+Comment[pt]=Oferece uma forma de navegar e de interagir com os ficheiros de código do projecto actual.
+Comment[pt_BR]=Fornece uma maneira de navegar e interagir com arquivos fonte do projeto atual.
+Comment[ru]=Предоставляет способ навигации и взаимодействия с исходными файлами в каталоге текущего проекта.
+Comment[sk]=Umožní navigáciu a interakciu so zdrojovými súbormi v aktálnom projekte.
+Comment[sr]=Обезбеђује начин навигације и рада са фајловима изворног кôда текућег пројекта.
+Comment[sr@Latn]=Obezbeđuje način navigacije i rada sa fajlovima izvornog kôda tekućeg projekta.
+Comment[sv]=Erbjuder ett sätt att navigera och arbeta med källkodsfilerna i det aktuella projektet.
+Comment[ta]=நடப்பு திட்ட பணியில் உள்ள மூல கோப்பிற்கு வழி செலுத்த மற்றும் உறையாட இது வழி செலுத்தும்.
+Comment[tg]=Тариқи навигатсияро ва ҳангоми ҳамкорӣ намудан бо файлҳои берунии дар каталоги лоиҳаи ҷорӣ имкон медиҳад.
+Comment[tr]=Geçerli projenin kaynak dosyalarında gezinme ve onlarla etkileşime geçme yolu sunar.
+Comment[zh_CN]=提供当前工程源文件的浏览和相互关系。
+Comment[zh_TW]=提供目前專案的程式源碼檔的導覽與互動。
+Name=KDevFileView
+Name[da]=KDevelop filvisning
+Name[de]=Dateibaum (KDevelop)
+Name[hi]=के-डेव-फ़ाइल-व्यू
+Name[nds]=KDevelop-Dateiboom
+Name[pl]=KDevWidokPliku
+Name[sk]=KDev pohľad na súbor
+Name[sv]=KDevelop filvisning
+Name[ta]=KDev கோப்பு காட்சி
+Name[tg]=Намоиши файл KDev
+Name[zh_TW]=KDevelop 檔案檢視
+GenericName=File Tree
+GenericName[br]=Gwezenn restr
+GenericName[ca]=Arbre de fitxers
+GenericName[da]=Filtræ
+GenericName[de]=Dateibaum
+GenericName[el]=Δέντρο αρχείων
+GenericName[es]=Árbol de archivos
+GenericName[et]=Failipuu
+GenericName[eu]=Fitxategi zuhaitza
+GenericName[fa]=درخت پرونده
+GenericName[fr]=Arborescence de fichiers
+GenericName[gl]=Árbore de arquivos
+GenericName[hi]=फ़ाइल ट्री
+GenericName[hu]=Fájl-fa
+GenericName[it]=Albero file
+GenericName[ja]=ファイルツリー
+GenericName[ms]=Pepohon Fail
+GenericName[nds]=Dateiboom
+GenericName[ne]=फाइल ट्रि
+GenericName[nl]=Bestandsboomstructuur
+GenericName[pl]=Drzewo plików
+GenericName[pt]=Árvore de Ficheiros
+GenericName[pt_BR]=Árvore de Arquivo
+GenericName[ru]=Дерево файлов
+GenericName[sk]=Strom súborov
+GenericName[sl]=Datotečno drevo
+GenericName[sr]=Дрво фајлова
+GenericName[sr@Latn]=Drvo fajlova
+GenericName[sv]=Filträd
+GenericName[ta]=கோப்பு மரம்
+GenericName[tg]=Дарахти файлҳо
+GenericName[tr]=Dosya Ağacı
+GenericName[zh_CN]=文件树
+GenericName[zh_TW]=檔案樹
+ServiceTypes=KDevelop/Plugin
+Icon=folder
+X-KDE-Library=libkdevfileview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Project
+X-KDevelop-Properties=ProjectFileManagement
diff --git a/parts/fileview/partwidget.cpp b/parts/fileview/partwidget.cpp
new file mode 100644
index 00000000..b3f9baf0
--- /dev/null
+++ b/parts/fileview/partwidget.cpp
@@ -0,0 +1,144 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "partwidget.h"
+
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <qdom.h>
+#include <kxmlguiclient.h>
+#include <kcombobox.h>
+#include <kaction.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "kdevversioncontrol.h"
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+
+#include "fileviewpart.h"
+#include "filetreewidget.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class PartWidget
+///////////////////////////////////////////////////////////////////////////////
+
+PartWidget::PartWidget( FileViewPart *part, QWidget *parent )
+ : QVBox( parent, "fileviewpartwidget" ), m_filetree( 0 ),
+ m_filter( 0 ), m_btnFilter( 0 ), m_part( part )
+{
+ Q_ASSERT( part && parent );
+
+ KDevVCSFileInfoProvider *infoProvider = 0;
+ if (part && part->versionControl() && part->versionControl()->fileInfoProvider())
+ infoProvider = part->versionControl()->fileInfoProvider();
+
+ m_filetree = new FileTreeWidget( m_part, this, infoProvider );
+ setCaption(i18n("File Tree"));
+ m_filetree->setCaption(i18n("File Tree"));
+ m_filetree->setIcon(SmallIcon("folder"));
+ QWhatsThis::add(m_filetree, i18n("<b>File tree</b><p>"
+ "The file viewer shows all files of the project "
+ "in a tree layout."));
+
+ QHBox* filterBox = new QHBox( this );
+ m_btnFilter = new QToolButton( filterBox );
+ m_btnFilter->setIconSet( SmallIconSet("filter" ) );
+ m_btnFilter->setToggleButton( true );
+ m_filter = new KHistoryCombo( true, filterBox, "filter");
+ m_filter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ));
+ filterBox->setStretchFactor(m_filter, 2);
+
+ connect( m_btnFilter, SIGNAL( clicked() ), this, SLOT( slotBtnFilterClick() ) );
+ connect( m_filter, SIGNAL( activated(const QString&) ), this, SLOT( slotFilterChange(const QString&) ) );
+ connect( m_filter, SIGNAL( returnPressed(const QString&) ),
+ m_filter, SLOT( addToHistory(const QString&) ) );
+
+ QWhatsThis::add
+ ( m_filter,
+ i18n("<p>Here you can enter a name filter to limit which files are <b>not displayed</b>."
+ "<p>To clear the filter, toggle off the filter button to the left."
+ "<p>To reapply the last filter used, toggle on the filter button." ) );
+ QWhatsThis::add
+ ( m_btnFilter,
+ i18n("<p>This button clears the name filter when toggled off, or "
+ "reapplies the last filter used when toggled on.") );
+
+ m_filter->insertItem( m_filetree->hidePatterns() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+PartWidget::~PartWidget()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void PartWidget::showProjectFiles()
+{
+ m_filetree->openDirectory( m_part->project()->projectDirectory() );
+ m_filetree->applyHidePatterns( m_filetree->hidePatterns() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void PartWidget::slotFilterChange( const QString & nf )
+{
+ QString f = nf.stripWhiteSpace();
+ bool empty = f.isEmpty() || f == "*";
+ if ( empty )
+ {
+ m_filter->lineEdit()->setText( QString::null );
+ QToolTip::add( m_btnFilter, i18n("Apply last filter (\"%1\")").arg( m_lastFilter ) );
+ }
+ else
+ {
+ m_lastFilter = f;
+ QToolTip::add( m_btnFilter, i18n("Clear filter") );
+ }
+ m_btnFilter->setOn( !empty );
+ // this will be never true after the m_filter has been used;)
+ m_btnFilter->setEnabled( !( empty && m_lastFilter.isEmpty() ) );
+
+ m_filetree->applyHidePatterns( f );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/*
+ When the button in the filter box toggles:
+ If off:
+ If the name filer is anything but "" or "*", reset it.
+ If on:
+ Set last filter.
+*/
+void PartWidget::slotBtnFilterClick()
+{
+ if ( !m_btnFilter->isOn() )
+ {
+ slotFilterChange( QString::null );
+ }
+ else
+ {
+ m_filter->lineEdit()->setText( m_lastFilter );
+ slotFilterChange( m_lastFilter );
+ }
+}
+
+void PartWidget::focusInEvent( QFocusEvent * )
+{
+ m_filetree->setFocus();
+}
+
+#include "partwidget.moc"
diff --git a/parts/fileview/partwidget.h b/parts/fileview/partwidget.h
new file mode 100644
index 00000000..e9d62665
--- /dev/null
+++ b/parts/fileview/partwidget.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILEVIEWPARTWIDGET_H_
+#define _FILEVIEWPARTWIDGET_H_
+
+#include <qvbox.h>
+
+class FileViewPart;
+
+class PartWidget : public QVBox
+{
+ Q_OBJECT
+public:
+ PartWidget( FileViewPart *part, QWidget *parent = 0 );
+ virtual ~PartWidget();
+
+ class FileTreeWidget *m_filetree;
+ // Support for filters
+ class KHistoryCombo *m_filter;
+ class QToolButton *m_btnFilter;
+
+ void showProjectFiles();
+
+protected:
+ virtual void focusInEvent( QFocusEvent * );
+
+private slots:
+ void slotFilterChange( const QString & nf );
+ void slotBtnFilterClick();
+
+private:
+ FileViewPart *m_part;
+ QString m_lastFilter;
+};
+
+#endif
diff --git a/parts/fileview/stdfiletreewidgetimpl.cpp b/parts/fileview/stdfiletreewidgetimpl.cpp
new file mode 100644
index 00000000..b680f2a8
--- /dev/null
+++ b/parts/fileview/stdfiletreewidgetimpl.cpp
@@ -0,0 +1,95 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+ #include <qheader.h>
+ #include <kdebug.h>
+
+#include "fileitemfactory.h"
+#include "filetreewidget.h"
+#include "stdfiletreewidgetimpl.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class StdFileTreeViewItem
+///////////////////////////////////////////////////////////////////////////////
+
+class StdFileTreeViewItem : public filetreeview::FileTreeViewItem
+{
+public:
+ StdFileTreeViewItem( KFileTreeViewItem* parent, KFileItem* item, KFileTreeBranch* branch, bool pf )
+ : FileTreeViewItem( parent, item, branch, pf ) {}
+ StdFileTreeViewItem( KFileTreeView* parent, KFileItem* item, KFileTreeBranch* branch )
+ : FileTreeViewItem( parent, item, branch ) {}
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class StdFileTreeBranchItem
+///////////////////////////////////////////////////////////////////////////////
+
+class StdFileTreeBranchItem : public filetreeview::FileTreeBranchItem
+{
+public:
+ StdFileTreeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix )
+ : FileTreeBranchItem( view, url, name, pix ) {}
+ virtual ~StdFileTreeBranchItem() {}
+ virtual KFileTreeViewItem* createTreeViewItem( KFileTreeViewItem* parent, KFileItem* fileItem );
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+KFileTreeViewItem* StdFileTreeBranchItem::createTreeViewItem( KFileTreeViewItem* parent, KFileItem* fileItem )
+{
+ if (!parent || !fileItem)
+ return 0;
+
+ FileTreeWidget *lv = static_cast<StdFileTreeViewItem*>( parent )->listView();
+ const KURL fileURL = fileItem->url();
+
+ const bool isDirectory = lv->isInProject( fileURL.path() );
+
+ return new StdFileTreeViewItem( parent, fileItem, this, isDirectory );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class StdFileItemFactory
+///////////////////////////////////////////////////////////////////////////////
+
+class StdBranchItemFactory : public filetreeview::BranchItemFactory
+{
+public:
+ virtual filetreeview::FileTreeBranchItem *makeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix )
+ {
+ return new StdFileTreeBranchItem( view, url, name, pix );
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class StdFileTreeWidgetImpl
+///////////////////////////////////////////////////////////////////////////////
+
+StdFileTreeWidgetImpl::StdFileTreeWidgetImpl( FileTreeWidget *parent )
+ : FileTreeViewWidgetImpl( parent, "stdfiletreewidgetimpl" )
+{
+ kdDebug(9017) << "StdFileTreeWidgetImpl::StdFileTreeWidgetImpl()" << endl;
+
+ setBranchItemFactory( new StdBranchItemFactory );
+
+ parent->addColumn( QString::null );
+ header()->hide();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+StdFileTreeWidgetImpl::~StdFileTreeWidgetImpl()
+{
+ kdDebug(9017) << "StdFileTreeWidgetImpl::~StdFileTreeWidgetImpl()" << endl;
+}
+
+#include "stdfiletreewidgetimpl.moc"
diff --git a/parts/fileview/stdfiletreewidgetimpl.h b/parts/fileview/stdfiletreewidgetimpl.h
new file mode 100644
index 00000000..a9ba7159
--- /dev/null
+++ b/parts/fileview/stdfiletreewidgetimpl.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef STDFILETREEWIDGETIMPL_H
+#define STDFILETREEWIDGETIMPL_H
+
+#include "filetreeviewwidgetimpl.h"
+
+/**
+* @author Mario Scalas
+* Provides the usual feedback of a KFileTreeView-widget (yeah, it does nothing other
+* than providing almost standard KFileTreeViewItems). Adds 1 (one) column to the
+* tree view and hides the header.
+*/
+class StdFileTreeWidgetImpl : public FileTreeViewWidgetImpl
+{
+ Q_OBJECT
+public:
+ StdFileTreeWidgetImpl( FileTreeWidget *parent );
+ virtual ~StdFileTreeWidgetImpl();
+
+ /*
+ * We have no reason not to allow it here
+ */
+ virtual bool canReloadTree() const { return true; }
+};
+
+#endif
diff --git a/parts/fileview/vcscolorsconfigwidget.cpp b/parts/fileview/vcscolorsconfigwidget.cpp
new file mode 100644
index 00000000..29de36fe
--- /dev/null
+++ b/parts/fileview/vcscolorsconfigwidget.cpp
@@ -0,0 +1,109 @@
+//
+// C++ Implementation:
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include <kcolorcombo.h>
+
+#include "vcscolorsconfigwidget.h"
+#include "fileviewpart.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// struct VCSColors
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColors::VCSColors()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColors::VCSColors( const VCSColors &others )
+{
+ *this = others;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColors &VCSColors::operator=( const VCSColors &others )
+{
+ added = others.added;
+ conflict = others.conflict;
+ modified = others.modified;
+ sticky = others.sticky;
+ needsPatch = others.needsPatch;
+ needsCheckout = others.needsCheckout;
+ unknown = others.unknown;
+ updated = others.updated;
+ defaultColor = others.defaultColor;
+ return *this;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class VCSColorsConfigWidget
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColorsConfigWidget::VCSColorsConfigWidget(FileViewPart *part, const VCSColors &vcsColors,
+ QWidget* parent, const char* name, WFlags fl)
+ : VCSColorsConfigWidgetBase( parent, name, fl ), m_part( part )
+{
+ setColors( vcsColors );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSColorsConfigWidget::~VCSColorsConfigWidget()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSColorsConfigWidget::getColors( VCSColors &vcsColors ) const
+{
+ vcsColors.added = fileAddedColorCombo->color();
+ vcsColors.conflict = fileConflictColorCombo->color();
+ vcsColors.modified = fileModifiedColorCombo->color();
+ vcsColors.sticky = fileStickyColorCombo->color();
+ vcsColors.needsPatch = fileNeedsPatchColorCombo->color();
+ vcsColors.needsCheckout = fileNeedsCheckoutColorCombo->color();
+ vcsColors.unknown = fileUnknownColorCombo->color();
+ vcsColors.updated = fileUpdatedColorCombo->color();
+ vcsColors.defaultColor = defaultColorCombo->color();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSColorsConfigWidget::setColors( const VCSColors &vcsColors )
+{
+ fileAddedColorCombo->setColor( vcsColors.added );
+ fileConflictColorCombo->setColor( vcsColors.conflict );
+ fileModifiedColorCombo->setColor( vcsColors.modified );
+ fileStickyColorCombo->setColor( vcsColors.sticky );
+ fileNeedsPatchColorCombo->setColor( vcsColors.needsPatch );
+ fileNeedsCheckoutColorCombo->setColor( vcsColors.needsCheckout );
+ fileUnknownColorCombo->setColor( vcsColors.unknown );
+ fileUpdatedColorCombo->setColor( vcsColors.updated );
+ defaultColorCombo->setColor( vcsColors.defaultColor );
+}
+
+/*$SPECIALIZATION$*/
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSColorsConfigWidget::slotAccept()
+{
+ VCSColors selectedColors;
+ getColors( selectedColors );
+
+ m_part->vcsColors = selectedColors;
+}
+
+#include "vcscolorsconfigwidget.moc"
+
diff --git a/parts/fileview/vcscolorsconfigwidget.h b/parts/fileview/vcscolorsconfigwidget.h
new file mode 100644
index 00000000..60cd4f52
--- /dev/null
+++ b/parts/fileview/vcscolorsconfigwidget.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef VCSCOLORSCONFIGWIDGET_H
+#define VCSCOLORSCONFIGWIDGET_H
+
+#include <qcolor.h>
+#include "vcscolorsconfigwidgetbase.h"
+
+class FileViewPart;
+
+struct VCSColors
+{
+ VCSColors();
+ VCSColors( const VCSColors &others );
+ VCSColors &operator=( const VCSColors &others );
+
+ QColor modified;
+ QColor added;
+ QColor updated;
+ QColor sticky;
+ QColor conflict;
+ QColor needsPatch;
+ QColor needsCheckout;
+ QColor unknown;
+ QColor defaultColor;
+};
+
+class VCSColorsConfigWidget : public VCSColorsConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ VCSColorsConfigWidget( FileViewPart *part, const VCSColors &vcsColors,
+ QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ virtual ~VCSColorsConfigWidget();
+ /*$PUBLIC_FUNCTIONS$*/
+
+ void getColors( VCSColors &vcsColors ) const;
+ void setColors( const VCSColors &colors );
+
+public slots:
+ /*$PUBLIC_SLOTS$*/
+ // Store settings if the user gives the ok
+ void slotAccept();
+
+
+protected:
+ /*$PROTECTED_FUNCTIONS$*/
+
+protected slots:
+ /*$PROTECTED_SLOTS$*/
+
+
+private:
+ FileViewPart *m_part;
+};
+
+#endif
+
diff --git a/parts/fileview/vcscolorsconfigwidgetbase.ui b/parts/fileview/vcscolorsconfigwidgetbase.ui
new file mode 100644
index 00000000..7e7998ce
--- /dev/null
+++ b/parts/fileview/vcscolorsconfigwidgetbase.ui
@@ -0,0 +1,267 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>VCSColorsConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>VCSColorsConfigWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>410</width>
+ <height>324</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Colors for VCS Visual Feedback</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Colors to Use for Version Control Feedback</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Updated:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileUpdatedColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Modified:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileModifiedColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Co&amp;nflict:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileConflictColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Added:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileAddedColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Sticky:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileStickyColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>textLabel5_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Needs checkout:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileStickyColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>textLabel5_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Needs patch:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileStickyColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="7" column="0">
+ <property name="name">
+ <cstring>textLabel6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Un&amp;known:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>fileUnknownColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="8" column="0">
+ <property name="name">
+ <cstring>textLabel6_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Default:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>defaultColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="2" column="1">
+ <property name="name">
+ <cstring>fileModifiedColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="3" column="1">
+ <property name="name">
+ <cstring>fileConflictColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="7" column="1">
+ <property name="name">
+ <cstring>fileUnknownColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="6" column="1">
+ <property name="name">
+ <cstring>fileNeedsCheckoutColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="8" column="1">
+ <property name="name">
+ <cstring>defaultColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="4" column="1">
+ <property name="name">
+ <cstring>fileStickyColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="5" column="1">
+ <property name="name">
+ <cstring>fileNeedsPatchColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="0" column="1">
+ <property name="name">
+ <cstring>fileAddedColorCombo</cstring>
+ </property>
+ </widget>
+ <widget class="KColorCombo" row="1" column="1">
+ <property name="name">
+ <cstring>fileUpdatedColorCombo</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+ <includehint>kcolorcombo.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/fileview/vcsfiletreewidgetimpl.cpp b/parts/fileview/vcsfiletreewidgetimpl.cpp
new file mode 100644
index 00000000..1db873ed
--- /dev/null
+++ b/parts/fileview/vcsfiletreewidgetimpl.cpp
@@ -0,0 +1,353 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qpainter.h>
+#include <qheader.h>
+#include <qpopupmenu.h>
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kdeversion.h>
+
+//#include <kdevproject.h>
+#include <urlutil.h>
+#include <domutil.h>
+
+#include "fileviewpart.h"
+#include "filetreewidget.h"
+#include "fileitemfactory.h"
+#include "vcsfiletreewidgetimpl.h"
+#include "vcscolorsconfigwidget.h"
+
+using namespace filetreeview;
+
+///////////////////////////////////////////////////////////////////////////////
+// class VCSFileTreeViewItem
+///////////////////////////////////////////////////////////////////////////////
+
+#define FILENAME_COLUMN 0
+#define STATUS_COLUMN 1
+#define WORKREVISION_COLUMN 2
+#define REPOREVISION_COLUMN 3
+
+class VCSFileTreeViewItem : public filetreeview::FileTreeViewItem
+{
+public:
+ VCSFileTreeViewItem( KFileTreeViewItem* parent, KFileItem* item, KFileTreeBranch* branch, bool pf )
+ : FileTreeViewItem( parent, item, branch, pf ), m_statusColor( &FileViewPart::vcsColors.unknown ) {}
+ VCSFileTreeViewItem( KFileTreeView* parent, KFileItem* item, KFileTreeBranch* branch )
+ : FileTreeViewItem( parent, item, branch ), m_statusColor( &FileViewPart::vcsColors.unknown ) {}
+ virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment )
+ {
+ // paint cell in a different color depending on VCS state
+ QColorGroup mycg( cg );
+ mycg.setColor( QColorGroup::Base, *m_statusColor );
+ FileTreeViewItem::paintCell( p, mycg, column, width, alignment );
+ }
+ void setVCSInfo( const VCSFileInfo &info );
+
+ QString fileName() const { return text( FILENAME_COLUMN ); }
+ QString workingRev() const { return text( WORKREVISION_COLUMN ); }
+ QString repositoryRev() const { return text( REPOREVISION_COLUMN ); }
+ QString status() const { return text( STATUS_COLUMN ); }
+ void setFileName( const QString &p ) { setText( FILENAME_COLUMN, p ); }
+ void setWorkingRev( const QString &p ) { setText( WORKREVISION_COLUMN, p ); }
+ void setRepositoryRev( const QString &p ) { setText( REPOREVISION_COLUMN, p ); }
+ void setStatus( const VCSFileInfo::FileState status );
+
+private:
+ QColor *m_statusColor; // cached
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeViewItem::setVCSInfo( const VCSFileInfo &info )
+{
+ //setFileName( info.fileName );
+ setRepositoryRev( info.repoRevision );
+ setWorkingRev( info.workRevision );
+ setStatus( info.state );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeViewItem::setStatus( const VCSFileInfo::FileState status )
+{
+ setText( STATUS_COLUMN, VCSFileInfo::state2String( status ) );
+ // Update color too
+ switch (status)
+ {
+ case VCSFileInfo::Added:
+ m_statusColor = &FileViewPart::vcsColors.added;
+ break;
+ case VCSFileInfo::Uptodate:
+ m_statusColor = &FileViewPart::vcsColors.updated;
+ break;
+ case VCSFileInfo::Modified:
+ m_statusColor = &FileViewPart::vcsColors.modified;
+ break;
+ case VCSFileInfo::Conflict:
+ m_statusColor = &FileViewPart::vcsColors.conflict;
+ break;
+ case VCSFileInfo::Sticky:
+ m_statusColor = &FileViewPart::vcsColors.sticky;
+ break;
+ case VCSFileInfo::NeedsCheckout:
+ m_statusColor = &FileViewPart::vcsColors.needsCheckout;
+ break;
+ case VCSFileInfo::NeedsPatch:
+ m_statusColor = &FileViewPart::vcsColors.needsPatch;
+ break;
+ case VCSFileInfo::Unknown:
+ m_statusColor = &FileViewPart::vcsColors.unknown;
+ break;
+ case VCSFileInfo::Directory:
+ default:
+ // No color change
+ m_statusColor = &FileViewPart::vcsColors.defaultColor;
+ //kdDebug() << "MyFileTreeViewItem::paintCell(): Unknown color!" << endl;
+ break;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class VCSFileTreeBranchItem
+///////////////////////////////////////////////////////////////////////////////
+
+class VCSFileTreeBranchItem : public filetreeview::FileTreeBranchItem
+{
+public:
+ VCSFileTreeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix,
+ KDevVCSFileInfoProvider *vcsInfoProvider )
+ : FileTreeBranchItem( view, url, name, pix ), m_vcsInfoProvider( vcsInfoProvider ) {}
+// virtual ~VCSFileTreeBranchItem() {}
+ virtual KFileTreeViewItem* createTreeViewItem( KFileTreeViewItem* parent, KFileItem* fileItem );
+
+private:
+ KDevVCSFileInfoProvider *m_vcsInfoProvider;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+
+KFileTreeViewItem* VCSFileTreeBranchItem::createTreeViewItem( KFileTreeViewItem* parent, KFileItem* fileItem )
+{
+// kdDebug(9017) << "MyFileTreeBranch::createTreeViewItem(): " + fileItem->url().path() << endl;
+ if (!parent || !fileItem)
+ return 0;
+
+ FileTreeWidget *lv = static_cast<filetreeview::FileTreeViewItem*>( parent )->listView();
+ const KURL fileURL = fileItem->url();
+ const bool isDirectory = lv->isInProject( fileURL.path() );
+
+ VCSFileTreeViewItem *newItem = new VCSFileTreeViewItem( parent, fileItem, this, isDirectory );
+
+// QString fileName = fileURL.fileName();
+// QString dirName = URLUtil::extractPathNameRelative( lv->projectDirectory(), fileURL.directory() );
+
+// const VCSFileInfoMap &vcsFiles = *m_vcsInfoProvider->status( dirName );
+// kdDebug(9017) << "Dir has " << vcsFiles.count() << " registered files!" << endl;
+// if (vcsFiles.contains( fileName ))
+// newItem->setVCSInfo( vcsFiles[ fileName ] );
+// else
+// kdDebug(9017) << "!!!No VCS info for this file!!!" << endl;
+ return newItem;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class VCSFileItemFactory
+///////////////////////////////////////////////////////////////////////////////
+
+class VCSBranchItemFactory : public filetreeview::BranchItemFactory
+{
+public:
+ VCSBranchItemFactory( KDevVCSFileInfoProvider *vcsInfoProvider ) : m_vcsInfoProvider( vcsInfoProvider ) {}
+ virtual filetreeview::FileTreeBranchItem *makeBranchItem( KFileTreeView* view, const KURL& url, const QString& name, const QPixmap& pix )
+ {
+ return new VCSFileTreeBranchItem( view, url, name, pix, m_vcsInfoProvider );
+ }
+private:
+ KDevVCSFileInfoProvider *m_vcsInfoProvider;
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class VCSFileTreeWidgetImpl
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileTreeWidgetImpl::VCSFileTreeWidgetImpl( FileTreeWidget *parent, KDevVCSFileInfoProvider *infoProvider )
+ : FileTreeViewWidgetImpl( parent, "vcsfiletreewidgetimpl" ),
+ m_actionToggleShowVCSFields( 0 ), m_actionSyncWithRepository( 0 ), m_vcsInfoProvider( infoProvider ),
+ m_isSyncingWithRepository( false ), m_vcsStatusRequestedItem( 0 )
+{
+ kdDebug(9017) << "VCSFileTreeWidgetImpl::VCSFileTreeWidgetImpl()" << endl;
+
+ Q_ASSERT( m_vcsInfoProvider );
+ setBranchItemFactory( new VCSBranchItemFactory( m_vcsInfoProvider ) );
+
+ // Update the #define order on top if you change this order!
+ parent->addColumn( "Filename" );
+ parent->addColumn( "Status" );
+ parent->addColumn( "Work" );
+ parent->addColumn( "Repo" );
+
+ connect( m_vcsInfoProvider, SIGNAL(statusReady(const VCSFileInfoMap&, void *)),
+ this, SLOT(vcsDirStatusReady(const VCSFileInfoMap&, void*)) );
+ // Harakiri itself if the infoProvider object is destroyed since we cannot work anymore :-(
+ connect( m_vcsInfoProvider, SIGNAL(destroyed()), SIGNAL(implementationInvalidated()) );
+
+ m_actionToggleShowVCSFields = new KToggleAction( i18n("Show VCS Fields"), KShortcut(),
+ this, "actiontoggleshowvcsfieldstoggleaction" );
+ m_actionToggleShowVCSFields->setCheckedState(i18n("Hide VCS Fields"));
+ QString aboutAction = i18n("<b>Show VCS fields</b><p>Shows <b>Revision</b> and <b>Timestamp</b> for each file contained in VCS repository.");
+ m_actionToggleShowVCSFields->setWhatsThis( aboutAction );
+ connect( m_actionToggleShowVCSFields, SIGNAL(toggled(bool)), this, SLOT(slotToggleShowVCSFields(bool)) );
+
+ m_actionSyncWithRepository = new KAction( i18n( "Sync with Repository"), KShortcut(),
+ this, SLOT(slotSyncWithRepository()), this, "actionsyncwithrepository" );
+ aboutAction = i18n("<b>Sync with repository</b><p>Synchronize file status with remote repository.");
+ m_actionSyncWithRepository->setWhatsThis( aboutAction );
+
+ QDomDocument &dom = projectDom();
+ m_actionToggleShowVCSFields->setChecked( DomUtil::readBoolEntry(dom, "/kdevfileview/tree/showvcsfields") );
+ slotToggleShowVCSFields( showVCSFields() ); // show or hide fields depending on read settings
+ connect( parent, SIGNAL(expanded(QListViewItem*)), this, SLOT(slotDirectoryExpanded(QListViewItem*)));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileTreeWidgetImpl::~VCSFileTreeWidgetImpl()
+{
+ kdDebug(9017) << "VCSFileTreeWidgetImpl::~VCSFileTreeWidgetImpl()" << endl;
+
+ QDomDocument &dom = projectDom();
+ DomUtil::writeBoolEntry( dom, "/kdevfileview/tree/showvcsfields", showVCSFields() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool VCSFileTreeWidgetImpl::canReloadTree() const
+{
+ return !m_isSyncingWithRepository;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeWidgetImpl::fillPopupMenu( QPopupMenu *popupMenu, QListViewItem *item ) const
+{
+ FileTreeViewWidgetImpl::fillPopupMenu( popupMenu, item );
+
+ // Submenu for visualization options
+ m_actionToggleShowVCSFields->plug( popupMenu );
+ // Give a change for syncing status with remote repository: a file info provider must
+ // be available and the item must be a project directory
+ FileTreeViewItem *fileItem = static_cast<FileTreeViewItem *>( item );
+ if (fileItem->isDir())
+ {
+ m_vcsStatusRequestedItem = fileItem;
+ popupMenu->insertSeparator();
+ m_actionSyncWithRepository->plug( popupMenu );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeWidgetImpl::slotToggleShowVCSFields( bool checked )
+{
+ kdDebug(9017) << "VCSFileTreeWidgetImpl::slotToggleShowVCSFields()" << endl;
+
+ if (checked)
+ {
+ setColumnWidth( 0, contentsWidth() / 2 ); // "Filename"
+ setColumnWidth( 1, contentsWidth() / 4 ); // "status"
+ setColumnWidth( 2, contentsWidth() / 5 ); // "work revision"
+ setColumnWidth( 3, contentsWidth() / 5 ); // "repository revision"
+ header()->show();
+ }
+ else
+ {
+ setColumnWidth( 3 ,0 ); // Hide columns
+ setColumnWidth( 2 ,0 );
+ setColumnWidth( 1, 0 );
+ setColumnWidth( 0, contentsWidth() ); // Make the "Filename" column to occupy all the row
+ header()->hide();
+ }
+
+ triggerUpdate();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool VCSFileTreeWidgetImpl::showVCSFields() const
+{
+ return m_actionToggleShowVCSFields->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeWidgetImpl::vcsDirStatusReady( const VCSFileInfoMap &modifiedFiles, void *callerData )
+{
+ kdDebug(9017) << "VCSFileTreeWidgetImpl::vcsDirStatusReady(const VCSFileInfoMap &, void*)" << endl;
+
+ VCSFileTreeViewItem *item = static_cast<VCSFileTreeViewItem*>( callerData );
+// Q_ASSERT( item ); // this must _not_ fail!
+ if( !item ){
+ kdDebug(9017) << "static_cast<VCSFileTreeViewItem*>( callerData ) failed" << endl;
+ return;
+ }
+ // Update vcs file info for all childs in this tree folder ...
+ item = static_cast<VCSFileTreeViewItem*>( item->firstChild() );
+ while (item)
+ {
+ const QString fileName = item->fileName();
+ kdDebug(9017) << "Widget item filename is: " << fileName << endl;
+ if (modifiedFiles.contains( fileName ))
+ {
+ const VCSFileInfo &vcsInfo = modifiedFiles[ fileName ];
+ kdDebug(9017) << "Nice! Found info for this file: " << vcsInfo.toString() << endl;
+ item->setVCSInfo( modifiedFiles[ fileName ] );
+ }
+ else
+ kdDebug(9017) << "Map does not contain anything useful about this file ;-( " << fileName << endl;
+ item = static_cast<VCSFileTreeViewItem*>( item->nextSibling() );
+ }
+ triggerUpdate();
+
+ m_isSyncingWithRepository = false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeWidgetImpl::slotSyncWithRepository()
+{
+ kdDebug(9017) << "VCSFileTreeWidgetImpl::slotSyncWithRepository()" << endl;
+ const VCSFileTreeViewItem *myFileItem = static_cast<VCSFileTreeViewItem *>( m_vcsStatusRequestedItem );
+ const QString relDirPath = URLUtil::extractPathNameRelative( projectDirectory(), myFileItem->fileItem()->url().path() );
+ kdDebug(9017) << "VCS Info requested for: " << relDirPath << endl;
+ m_vcsInfoProvider->requestStatus( relDirPath, m_vcsStatusRequestedItem );
+ m_isSyncingWithRepository = true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void VCSFileTreeWidgetImpl::slotDirectoryExpanded( QListViewItem* aItem )
+{
+ VCSFileTreeViewItem *item = static_cast<VCSFileTreeViewItem *>( aItem );
+ if( !item ) return;
+
+ const QString relDirPath = URLUtil::extractPathNameRelative( projectDirectory(), item->fileItem()->url().path() );
+ kdDebug(9017) << "ASync VCS Info requested for: " << relDirPath << endl;
+ m_vcsInfoProvider->requestStatus( relDirPath, item, false, false );
+
+// m_isSyncingWithRepository = true;
+
+}
+
+#include "vcsfiletreewidgetimpl.moc"
diff --git a/parts/fileview/vcsfiletreewidgetimpl.h b/parts/fileview/vcsfiletreewidgetimpl.h
new file mode 100644
index 00000000..de4dc8c1
--- /dev/null
+++ b/parts/fileview/vcsfiletreewidgetimpl.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef VCSFILETREEWIDGETIMPL_H
+#define VCSFILETREEWIDGETIMPL_H
+
+#include "filetreeviewwidgetimpl.h"
+
+class KDevVCSFileInfoProvider;
+class KAction;
+class KToggleAction;
+
+/**
+* @author Mario Scalas
+* Provides VCS feedback to the standard features.
+*/
+class VCSFileTreeWidgetImpl : public FileTreeViewWidgetImpl
+{
+ Q_OBJECT
+public:
+ VCSFileTreeWidgetImpl( FileTreeWidget *parent, KDevVCSFileInfoProvider *infoProvider );
+ virtual ~VCSFileTreeWidgetImpl();
+
+ /*
+ * We must avoid a reload operation while we syncing with the repository since this
+ * will break our job.
+ */
+ virtual bool canReloadTree() const;
+ /*
+ * Add "sync with repository" and "show VCS fields" options to the context menu.
+ */
+ virtual void fillPopupMenu( QPopupMenu *popupMenu, QListViewItem *item ) const;
+
+private slots:
+ //! show/hide the header and the additional fields (status and versions)
+ void slotToggleShowVCSFields( bool checked );
+ //! start a sync operation with the remote repository: this may take a while so we use
+ //! the async interface provided by the KDevVCSFileInfoProvider interface
+ void slotSyncWithRepository();
+ //! when the requested info are ready the infoProvider object will be so kind the
+ //! to give them to us in a ready-to-use format: we'll use that info to update all
+ //! the items which are childs of the @see filetreeview::FileTreeViewItem stored in
+ //! @p callerData.
+ void vcsDirStatusReady( const VCSFileInfoMap &modifiedFiles, void *callerData );
+ void slotDirectoryExpanded( QListViewItem* );
+
+private:
+ bool showVCSFields() const;
+
+ KToggleAction *m_actionToggleShowVCSFields;
+ KAction *m_actionSyncWithRepository;
+ KDevVCSFileInfoProvider *m_vcsInfoProvider;
+ //! We use this guard to avoid enabling the "reload tree" action when performing
+ //! syncing with remote repositories.
+ bool m_isSyncingWithRepository;
+ mutable KFileTreeViewItem *m_vcsStatusRequestedItem;
+};
+
+#endif
diff --git a/parts/filter/Makefile.am b/parts/filter/Makefile.am
new file mode 100644
index 00000000..5a447405
--- /dev/null
+++ b/parts/filter/Makefile.am
@@ -0,0 +1,17 @@
+# Here resides the filter part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfilter.la
+libkdevfilter_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfilter_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfilter_la_SOURCES = filterpart.cpp shellfilterdlg.cpp shellinsertdlg.cpp kdevfilterIface.cpp kdevfilterIface.skel
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfilter.desktop
+
+rcdir = $(kde_datadir)/kdevfilter
+rc_DATA = kdevfilter.rc
diff --git a/parts/filter/README.dox b/parts/filter/README.dox
new file mode 100644
index 00000000..452db8ca
--- /dev/null
+++ b/parts/filter/README.dox
@@ -0,0 +1,52 @@
+/** \class FilterPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/filter/filterpart.cpp b/parts/filter/filterpart.cpp
new file mode 100644
index 00000000..8804e701
--- /dev/null
+++ b/parts/filter/filterpart.cpp
@@ -0,0 +1,160 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "filterpart.h"
+
+#include <kaction.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+#include "kdevcore.h"
+#include "kdevpartcontroller.h"
+#include "kdevplugininfo.h"
+#include "shellfilterdlg.h"
+#include "shellinsertdlg.h"
+#include "kdevfilterIface.h"
+
+static const KDevPluginInfo data("kdevfilter");
+K_EXPORT_COMPONENT_FACTORY( libkdevfilter, FilterFactory( data ) )
+
+FilterPart::FilterPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "FilterPart")
+{
+ setInstance(FilterFactory::instance());
+ setXMLFile("kdevfilter.rc");
+
+ KAction *action;
+
+ action = new KAction( i18n("Execute Command..."), 0,
+ this, SLOT(slotShellInsert()),
+ actionCollection(), "tools_insertshell" );
+ action->setToolTip(i18n("Execute shell command"));
+ action->setWhatsThis(i18n("<b>Execute shell command</b><p>Executes a shell command and outputs its result into the current document."));
+
+ action = new KAction( i18n("Filter Selection Through Command..."), 0,
+ this, SLOT(slotShellFilter()),
+ actionCollection(), "tools_filtershell" );
+ action->setToolTip(i18n("Filter selection through a shell command"));
+ action->setWhatsThis(i18n("<b>Filter selection through shell command</b><p>Filters selection through a shell command and outputs its result into the current document."));
+
+ m_insertDialog = 0;
+ m_filterDialog = 0;
+
+ new KDevFilterIface( this );
+ // (void) dcopClient();
+}
+
+
+FilterPart::~FilterPart()
+{
+ delete m_insertDialog;
+ delete m_filterDialog;
+}
+
+
+void FilterPart::slotShellInsert()
+{
+ /// @todo Disable menu item if no active part
+
+ KParts::ReadWritePart *part
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ QWidget *view = partController()->activeWidget();
+ if (!part || !view) {
+ kdDebug(9029) << "no rw part" << endl;
+ return;
+ }
+
+ KTextEditor::EditInterface *editiface
+ = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!editiface) {
+ kdDebug(9029) << "no edit" << endl;
+ return;
+ }
+
+ KTextEditor::ViewCursorInterface *cursoriface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(view);
+ if (!cursoriface) {
+ kdDebug(9029) << "no viewcursor" << endl;
+ return;
+ }
+
+ if (!m_insertDialog)
+ {
+ m_insertDialog = new ShellInsertDialog();
+ m_insertDialog->setCaption(i18n("Execute Command"));
+ }
+ if (m_insertDialog->exec()) {
+ uint line, col;
+ cursoriface->cursorPositionReal(&line, &col);
+ editiface->insertText(line, col, m_insertDialog->text());
+ }
+}
+
+
+void FilterPart::slotShellFilter()
+{
+ /// @todo Disable menu item if no active part
+
+ KParts::ReadWritePart *part
+ = dynamic_cast<KParts::ReadWritePart*>(partController()->activePart());
+ QWidget *view = partController()->activeWidget();
+ if (!part || !view) {
+ kdDebug(9029) << "no rw part" << endl;
+ return;
+ }
+
+ KTextEditor::EditInterface *editiface
+ = dynamic_cast<KTextEditor::EditInterface*>(part);
+ if (!editiface) {
+ kdDebug(9029) << "no edit" << endl;
+ return;
+ }
+
+ KTextEditor::ViewCursorInterface *cursoriface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(view);
+ if (!cursoriface) {
+ kdDebug(9029) << "no viewcursor" << endl;
+ return;
+ }
+
+ KTextEditor::SelectionInterface *selectioniface
+ = dynamic_cast<KTextEditor::SelectionInterface*>(part);
+ if (!selectioniface) {
+ kdDebug(9029) << "no selection" << endl;
+ return;
+ }
+
+ if (!m_filterDialog)
+ {
+ m_filterDialog = new ShellFilterDialog();
+ m_filterDialog->setCaption(i18n("Filter Selection Through Command"));
+ }
+
+ kdDebug(9029) << "Old text: " << selectioniface->selection()<< endl;
+
+ m_filterDialog->setText(selectioniface->selection());
+
+ if (m_filterDialog->exec()) {
+ uint line, col;
+ // OUCH: KTextEditor doesn't allow to find out
+ // where the selection is
+ selectioniface->removeSelectedText();
+ cursoriface->cursorPositionReal(&line, &col);
+ kdDebug(9029) << "New text: " << m_filterDialog->text() << endl;
+ editiface->insertText(line, col, m_filterDialog->text());
+ }
+}
+
+#include "filterpart.moc"
diff --git a/parts/filter/filterpart.h b/parts/filter/filterpart.h
new file mode 100644
index 00000000..ec731f12
--- /dev/null
+++ b/parts/filter/filterpart.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _FILTERPART_H_
+#define _FILTERPART_H_
+
+#include <kdevgenericfactory.h>
+#include "kdevplugin.h"
+
+class ShellInsertDialog;
+class ShellFilterDialog;
+
+
+class FilterPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ FilterPart( QObject *parent, const char *name, const QStringList & );
+ ~FilterPart();
+
+public slots:
+ void slotShellInsert();
+ void slotShellFilter();
+
+private:
+ ShellInsertDialog *m_insertDialog;
+ ShellFilterDialog *m_filterDialog;
+};
+
+typedef KDevGenericFactory<FilterPart> FilterFactory;
+
+#endif
diff --git a/parts/filter/kdevfilter.desktop b/parts/filter/kdevfilter.desktop
new file mode 100644
index 00000000..294ae55e
--- /dev/null
+++ b/parts/filter/kdevfilter.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a way of manipulating editor text using commandline tools. Appears in the Tools menu.
+Comment[ca]=Proporciona un mètode per a manipular text a l'editor emprant eines de la línia de comandaments. Apareix al menú Eines.
+Comment[da]=Sørger for en måde at manipulere editortekst ved brug af kommandolinje værktøjer. Viser sig i værktøjsmenuen.
+Comment[de]=Ermöglicht die Bearbeitung von Editorinhalten mit Konsolenanwendungen. Erscheint im Menü Werkzeuge.
+Comment[el]=Προσφέρει μια μέθοδο διαχείρισης κειμένου επεξεργαστή χρησιμοποιώντας εργαλεία γραμμής εντολών. Εμφανίζεται στο μενού εργαλείων.
+Comment[es]=Proporciona un método para manipular texto del editor utilizando herramientas de la línea de órdenes. Aparece en el menú Herramientas.
+Comment[et]=Võimaldab käsureavahendite abil käsitleda redaktoris olevat teksti. Kättesaadav tööriistade menüüst.
+Comment[eu]=Komando-lerro tresnak erabiliz editore testua manipulatzeko aukera ematen dizu. Tresnak menuan dago.
+Comment[fa]=راهی برای دستکاری متن ویرایشگر، با استفاده از ابزار خط فرمان فراهم می‌کند. در گزینگان ابزار ظاهر می‌شود.
+Comment[fr]=Fournit un moyen de manipuler le texte de l'éditeur à l'aide d'outils en ligne de commande. Cette fonction apparaît dans le menu « Outils ».
+Comment[gl]=Proporciona unha maneira para manipular o texto do editor usando ferramentas da liña de comandos. Aparece no menú Ferramentas.
+Comment[hu]=Lehetővé teszi a szerkesztett szövegek kezelését parancssoros programokból (az Eszközök menüből érhető el)
+Comment[it]=Offre un modo per manipolare il testo utilizzando strumenti a riga di comando. Appare nel menu degli strumenti.
+Comment[ja]=コマンドラインツールを使用して、エディタテキストを操作する方法を提供します。ツールメニューに現れます。
+Comment[ms]=Menyediakan cara untuk memanipulasi teks penyunting menggunakan alatan arahan baris. Muncul didalam menu Alatan.
+Comment[nds]=Stellt dat Ännern vun Editorinholden mit Befehlsreeg-Warktüüch praat. Dukt in't Menü "Warktüüch" op.
+Comment[ne]=आदेशरेखा उपकरण प्रयोग गरेर सम्पादक चलाउने तरिका प्रदान गर्दछ ।
+Comment[nl]=Maakt het mogelijk de tekstinhoud van de editor met externe commandoregeltools te bewerken. Verschijnt in het menu Gereedschap.
+Comment[pl]=Umożliwia manipulowanie tekstem w edytorze za pomocą narzędzi linii komend. Pojawia się w menu Narzędzia.
+Comment[pt]=Oferece uma forma de manipular o texto do edito com as ferramentas da linha de comandos. Aparece no menu de Ferramentas.
+Comment[pt_BR]=Fornece uma maneira de manipular o editor de texto usando ferramentas de linha de comando. Aparece no menu Ferramentas.
+Comment[ru]=Предоставляет функции работы с текстом в редакторе с использованием утилит командной строки.
+Comment[sk]=Umožní manipuláciu s textom editora s použitím nástrojov príkazového riadku. Objaví sa v menu Nástroje.
+Comment[sr]=Обезбеђује начин манипулисања текстом уређивача коришћењем алата командне линије. Појављује се у менију „Алати“.
+Comment[sr@Latn]=Obezbeđuje način manipulisanja tekstom uređivača korišćenjem alata komandne linije. Pojavljuje se u meniju „Alati“.
+Comment[sv]=Erbjuder ett sätt att behandla editortext med kommandoradsverktyg. Finns i verktygsmenyn.
+Comment[ta]=கட்டளை கருவி உபயோகித்து தொகுப்பான் உறைகளை கையாள இது வழி அளிக்கும். கருவிப்பட்டியலில் இது தோன்றும்
+Comment[tg]=Вазифаи корҳо бо матнҳои дар муҳаррир буда бо истифодаи фармони сатр гузориш менамояд.
+Comment[tr]=Komut satırı araçlarını kullanarak düzenleyici metni işlemek için bir yol sunar. Araçlar menüsünde durur.
+Comment[zh_CN]=使用命令行工具操作编辑器文字。显示在工具菜单中。
+Comment[zh_TW]=提供使用命令列工具操作編輯器文字的方法。會出現在工具選單中。
+Name=KDevFilter
+Name[da]=KDevelop filter
+Name[de]=Filter (KDevelop)
+Name[hi]=के-डेव-फ़िल्टर
+Name[nds]=KDevelop-Filter
+Name[pl]=KDevFiltr
+Name[sk]=KDev filter
+Name[sv]=KDevelop filter
+Name[ta]=KDev வடிகட்டல்
+Name[tg]=Филтри KDev
+Name[zh_TW]=KDevelop 過濾器
+GenericName=Shell Filtering and Insertion
+GenericName[ca]=Inserció i filtrat de la línia de comandaments
+GenericName[da]=Skal-filtrering og indsætning
+GenericName[de]=Filtern und Einfügen über Shell-Befehle
+GenericName[el]=Εισαγωγή και φιλτράρισμα κελύφους
+GenericName[es]=Inserción y filtrado en línea de órdenes
+GenericName[et]=Shellifiltrid ja lisamine
+GenericName[eu]=Shell iragazte eta txertatzea
+GenericName[fa]=پالایش و درج پوسته
+GenericName[fr]=Filtrage et insertion dans le shell
+GenericName[gl]=Inserción e filtrado shell
+GenericName[hi]=शेल फ़िल्टरिंग तथा प्रविष्टि
+GenericName[hu]=Szűrés és beszúrás
+GenericName[it]=Inserimento e filtraggio da shell
+GenericName[ja]=シェルフィルタリングと挿入
+GenericName[nds]=Filtern un Infögen mit Konsool-Befehlen
+GenericName[ne]=शेल फिल्टरिङ र घुसाइ
+GenericName[nl]=Filteren en invoegen met shellcommando's
+GenericName[pl]=Filtrowanie i wstawianie za pomocą powłoki
+GenericName[pt]=Filtragem e Inserção por 'Shell'
+GenericName[pt_BR]=Shell de Filtro e Inserção
+GenericName[ru]=Фильтрация и вставка с помощью команд оболочки
+GenericName[sk]=Shell filtrovanie a vkladanie
+GenericName[sl]=Filtriranje lupine in vstavljanje
+GenericName[sr]=Филтрирање и убацивање шкољке
+GenericName[sr@Latn]=Filtriranje i ubacivanje školjke
+GenericName[sv]=Skalfiltrering och infogning
+GenericName[ta]=உறையகத்தை வடிகட்ட மற்றும் சேர்க்க
+GenericName[tg]=Бо пӯсти фармон филтр ва мондан
+GenericName[tr]=Kabuk filtreleme ve Ekleme
+GenericName[zh_CN]=Shell 过滤和插入
+GenericName[zh_TW]=Shell 過濾與插入
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevfilter
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=OptionalCodeEditing
diff --git a/parts/filter/kdevfilter.rc b/parts/filter/kdevfilter.rc
new file mode 100644
index 00000000..6f7f9053
--- /dev/null
+++ b/parts/filter/kdevfilter.rc
@@ -0,0 +1,10 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevFilter" version="1">
+<MenuBar>
+ <Menu name="tools" >
+ <Action name="tools_insertshell" group="tools_file_operations"/>
+ <Action name="tools_filtershell" group="tools_file_operations"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/filter/kdevfilterIface.cpp b/parts/filter/kdevfilterIface.cpp
new file mode 100644
index 00000000..55a0421a
--- /dev/null
+++ b/parts/filter/kdevfilterIface.cpp
@@ -0,0 +1,35 @@
+//
+//
+// C++ Implementation: cpp
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kdevfilterIface.h"
+#include "filterpart.h"
+
+KDevFilterIface::KDevFilterIface( FilterPart* part )
+ : QObject( part ), DCOPObject( "KDevFilter" ), m_part( part )
+{
+}
+
+KDevFilterIface::~KDevFilterIface()
+{
+}
+
+void KDevFilterIface::shellInsert()
+{
+ m_part->slotShellInsert();
+}
+
+void KDevFilterIface::shellFilter()
+{
+ m_part->slotShellFilter();
+}
+
+#include "kdevfilterIface.moc"
diff --git a/parts/filter/kdevfilterIface.h b/parts/filter/kdevfilterIface.h
new file mode 100644
index 00000000..46a14277
--- /dev/null
+++ b/parts/filter/kdevfilterIface.h
@@ -0,0 +1,26 @@
+
+#ifndef KDEVFILTERIFACE_H
+#define KDEVFILTERIFACE_H
+
+#include <qobject.h>
+#include <dcopobject.h>
+
+class FilterPart;
+
+class KDevFilterIface : public QObject, public DCOPObject
+{
+ Q_OBJECT
+ K_DCOP
+public:
+ KDevFilterIface( FilterPart* part );
+ ~KDevFilterIface();
+
+k_dcop:
+ void shellInsert();
+ void shellFilter();
+
+private:
+ FilterPart* m_part;
+};
+
+#endif
diff --git a/parts/filter/shellfilterdlg.cpp b/parts/filter/shellfilterdlg.cpp
new file mode 100644
index 00000000..7e967cda
--- /dev/null
+++ b/parts/filter/shellfilterdlg.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "shellfilterdlg.h"
+
+#include <qcombobox.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <kbuttonbox.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "kdevplugin.h"
+#include "domutil.h"
+#include "filterpart.h"
+
+
+ShellFilterDialog::ShellFilterDialog()
+ : QDialog(0, "shell filter dialog", true)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this, 10, 4);
+
+ combo = new QComboBox(true, this);
+ combo->setDuplicatesEnabled(false);
+ layout->addWidget(combo);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ start_button = buttonbox->addButton(i18n("&Start"));
+ start_button->setDefault(true);
+ cancel_button = buttonbox->addButton(KStdGuiItem::cancel());
+ buttonbox->layout();
+ layout->addWidget(buttonbox);
+
+ connect( start_button, SIGNAL(clicked()),
+ this, SLOT(slotStartClicked()) );
+ connect( cancel_button, SIGNAL(clicked()),
+ this, SLOT(reject()) );
+
+ m_proc = 0;
+
+ KConfig *config = FilterFactory::instance()->config();
+ config->setGroup("General");
+ combo->insertStringList(config->readListEntry("filteritems"));
+}
+
+
+ShellFilterDialog::~ShellFilterDialog()
+{
+ kdDebug(9029) << "~ShellFilterDialog" << endl;
+ delete m_proc;
+
+ // QComboBox API is a bit incomplete :-(
+ QStringList list;
+ for (int i=0; i < combo->count(); ++i)
+ list << combo->text(i);
+
+ KConfig *config = FilterFactory::instance()->config();
+ config->setGroup("General");
+ config->writeEntry("filteritems", list);
+}
+
+
+void ShellFilterDialog::slotStartClicked()
+{
+ start_button->setEnabled(false);
+ m_outstr = QCString();
+
+ delete m_proc;
+ m_proc = new KShellProcess("/bin/sh");
+ (*m_proc) << combo->currentText();
+ connect( m_proc, SIGNAL(receivedStdout(KProcess*, char *, int)),
+ this, SLOT(slotReceivedStdout(KProcess*, char *, int)) );
+ connect( m_proc, SIGNAL(wroteStdin(KProcess*)),
+ this, SLOT(slotWroteStdin(KProcess*)) );
+ connect( m_proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*)) );
+ m_proc->start(KProcess::NotifyOnExit, KProcess::All);
+ m_proc->writeStdin(m_instr, m_instr.length());
+}
+
+
+int ShellFilterDialog::exec()
+{
+ start_button->setEnabled(true);
+ return QDialog::exec();
+}
+
+
+void ShellFilterDialog::slotReceivedStdout(KProcess *, char *text, int len)
+{
+ m_outstr += QString::fromLocal8Bit(text, len+1);
+ kdDebug(9029) << "outstr " << m_outstr << endl;
+}
+
+
+void ShellFilterDialog::slotWroteStdin(KProcess *)
+{
+ m_proc->closeStdin();
+ kdDebug(9029) << "close stdin " << m_outstr << endl;
+}
+
+
+void ShellFilterDialog::slotProcessExited(KProcess *)
+{
+ kdDebug(9029) << "process exit " << m_proc->normalExit() << endl;
+ if (m_proc->normalExit()) {
+ accept();
+ } else {
+ KMessageBox::error(this, i18n("Process exited with status %1")
+ .arg(m_proc->exitStatus()));
+ reject();
+ }
+}
+
+#include "shellfilterdlg.moc"
diff --git a/parts/filter/shellfilterdlg.h b/parts/filter/shellfilterdlg.h
new file mode 100644
index 00000000..3307c060
--- /dev/null
+++ b/parts/filter/shellfilterdlg.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SHELLFILTERDLG_H_
+#define _SHELLFILTERDLG_H_
+
+#include <qdialog.h>
+
+class QComboBox;
+class QPushButton;
+class KDevPlugin;
+class KProcess;
+
+
+class ShellFilterDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ ShellFilterDialog();
+ ~ShellFilterDialog();
+
+ virtual int exec();
+
+ void setText(const QString &str)
+ { m_instr = str.local8Bit(); }
+ QString text() const
+ { return m_outstr; }
+
+private slots:
+ void slotStartClicked();
+ void slotReceivedStdout(KProcess *, char *text, int len);
+ void slotWroteStdin(KProcess *);
+ void slotProcessExited(KProcess *);
+
+private:
+ QPushButton *start_button, *cancel_button;
+ QComboBox *combo;
+ KProcess *m_proc;
+ QCString m_instr;
+ QString m_outstr;
+};
+
+#endif
diff --git a/parts/filter/shellinsertdlg.cpp b/parts/filter/shellinsertdlg.cpp
new file mode 100644
index 00000000..a1474ed2
--- /dev/null
+++ b/parts/filter/shellinsertdlg.cpp
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "shellinsertdlg.h"
+
+#include <qcombobox.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <kconfig.h>
+#include <kbuttonbox.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <klineedit.h>
+#include <kstdguiitem.h>
+#include <kdeversion.h>
+
+#include "kdevplugin.h"
+#include "domutil.h"
+#include "filterpart.h"
+
+
+ShellInsertDialog::ShellInsertDialog()
+ : QDialog(0, "shell filter dialog", true)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this, 10, 4);
+
+ combo = new QComboBox(true, this);
+ combo->setDuplicatesEnabled(false);
+ layout->addWidget(combo);
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ start_button = buttonbox->addButton(i18n("&Start"));
+ start_button->setDefault(true);
+ cancel_button = buttonbox->addButton(KStdGuiItem::cancel());
+ buttonbox->layout();
+ layout->addWidget(buttonbox);
+
+ connect( start_button, SIGNAL(clicked()),
+ this, SLOT(slotStartClicked()) );
+ connect( cancel_button, SIGNAL(clicked()),
+ this, SLOT(reject()) );
+ connect( combo->lineEdit(), SIGNAL(textChanged( const QString &)), this, SLOT(executeTextChanged( const QString &)));
+ m_proc = 0;
+
+ KConfig *config = FilterFactory::instance()->config();
+ config->setGroup("General");
+ QStringList items = config->readListEntry("InsertItems");
+ combo->insertStringList(items);
+ executeTextChanged( combo->lineEdit()->text());
+
+}
+
+
+ShellInsertDialog::~ShellInsertDialog()
+{
+ kdDebug(9029) << "~ShellInsertDialog" << endl;
+ delete m_proc;
+
+ // QComboBox API is a bit incomplete :-(
+ QStringList list;
+ for (int i=0; i < combo->count(); ++i)
+ list << combo->text(i);
+
+ KConfig *config = FilterFactory::instance()->config();
+ config->setGroup("General");
+ config->writeEntry("InsertItems", list);
+}
+
+
+void ShellInsertDialog::executeTextChanged( const QString &text)
+{
+ start_button->setEnabled(!text.isEmpty());
+}
+
+int ShellInsertDialog::exec()
+{
+ start_button->setEnabled(true);
+ return QDialog::exec();
+}
+
+
+void ShellInsertDialog::slotStartClicked()
+{
+ start_button->setEnabled(false);
+ m_str = QCString();
+
+ delete m_proc;
+ m_proc = new KShellProcess("/bin/sh");
+ (*m_proc) << combo->currentText();
+ connect( m_proc, SIGNAL(receivedStdout(KProcess*, char *, int)),
+ this, SLOT(slotReceivedStdout(KProcess*, char *, int)) );
+ connect( m_proc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*)) );
+ m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput);
+}
+
+
+void ShellInsertDialog::slotReceivedStdout(KProcess *, char *text, int len)
+{
+ m_str += QCString(text, len+1);
+}
+
+
+void ShellInsertDialog::slotProcessExited(KProcess *)
+{
+ if (m_proc->normalExit()) {
+ accept();
+ } else {
+ KMessageBox::error(this, i18n("Process exited with status %1")
+ .arg(m_proc->exitStatus()));
+ reject();
+ }
+}
+
+#include "shellinsertdlg.moc"
diff --git a/parts/filter/shellinsertdlg.h b/parts/filter/shellinsertdlg.h
new file mode 100644
index 00000000..c6f0696b
--- /dev/null
+++ b/parts/filter/shellinsertdlg.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _SHELLINSERTDLG_H_
+#define _SHELLINSERTDLG_H_
+
+#include <qdialog.h>
+
+class QComboBox;
+class QPushButton;
+class KDevPlugin;
+class KProcess;
+
+
+class ShellInsertDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ ShellInsertDialog();
+ ~ShellInsertDialog();
+
+ virtual int exec();
+
+ QString text() const
+ { return QString::fromLocal8Bit(m_str); }
+
+private slots:
+ void slotStartClicked();
+ void slotReceivedStdout(KProcess *, char *text, int len);
+ void slotProcessExited(KProcess *);
+ void executeTextChanged( const QString &text);
+
+private:
+ QPushButton *start_button, *cancel_button;
+ QComboBox *combo;
+ KProcess *m_proc;
+ QCString m_str;
+};
+
+#endif
diff --git a/parts/fullscreen/Makefile.am b/parts/fullscreen/Makefile.am
new file mode 100644
index 00000000..3fecf8e5
--- /dev/null
+++ b/parts/fullscreen/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevfullscreen.la
+libkdevfullscreen_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevfullscreen_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevfullscreen_la_SOURCES = fullscreen_part.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevfullscreen.desktop
+
+rcdir = $(kde_datadir)/kdevfullscreen
+rc_DATA = kdevpart_fullscreen.rc
diff --git a/parts/fullscreen/README.dox b/parts/fullscreen/README.dox
new file mode 100644
index 00000000..10f74509
--- /dev/null
+++ b/parts/fullscreen/README.dox
@@ -0,0 +1,10 @@
+/** \class FullScreenPart
+Displays KDevelop in full screen
+
+\authors <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+
+\maintainer <a href="mailto:roberto AT kdevelop.org">Roberto Raggi</a>
+
+\feature Displays KDevelop in full screen
+
+*/
diff --git a/parts/fullscreen/fullscreen_part.cpp b/parts/fullscreen/fullscreen_part.cpp
new file mode 100644
index 00000000..20e046f1
--- /dev/null
+++ b/parts/fullscreen/fullscreen_part.cpp
@@ -0,0 +1,72 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kstdaction.h>
+#include <kmainwindow.h>
+#include <kmenubar.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevplugininfo.h>
+
+#include "fullscreen_part.h"
+
+static const KDevPluginInfo data("kdevfullscreen");
+
+typedef KDevGenericFactory<FullScreenPart> FullScreenFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevfullscreen, FullScreenFactory( data ) )
+
+FullScreenPart::FullScreenPart(QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin(&data, parent, name ? name : "FullScreenPart" )
+{
+ setInstance(FullScreenFactory::instance());
+// const KAboutData &abdata1 = *(info());
+// kdDebug() << abdata1.appName() << endl;
+ const KDevPluginInfo &_info = *info();
+ const KAboutData *abdata = _info;
+ kdDebug() << abdata->appName() << endl;
+ setXMLFile("kdevpart_fullscreen.rc");
+
+ m_bFullScreen = false;
+
+ m_pFullScreen = KStdAction::fullScreen(this, SLOT(slotToggleFullScreen()), actionCollection(), mainWindow()->main());
+}
+
+FullScreenPart::~FullScreenPart()
+{
+}
+
+void FullScreenPart::slotToggleFullScreen( )
+{
+ m_bFullScreen = !m_bFullScreen;
+ if( m_bFullScreen ){
+ //mw->menuBar()->hide();
+ mainWindow()->main()->showFullScreen();
+
+ /*m_pFullScreen->setText( i18n( "Exit Full-Screen Mode" ) );
+ m_pFullScreen->setToolTip( i18n( "Exit full-screen mode" ) );
+ m_pFullScreen->setIcon( "window_nofullscreen" );*/
+ } else {
+ //mw->menuBar()->show();
+
+ mainWindow()->main()->showNormal();
+
+ /*m_pFullScreen->setText( i18n( "&Full-Screen Mode" ) );
+ m_pFullScreen->setToolTip(i18n("Full-screen mode"));
+ m_pFullScreen->setIcon( "window_fullscreen" );*/
+ }
+}
+
+
+#include "fullscreen_part.moc"
diff --git a/parts/fullscreen/fullscreen_part.h b/parts/fullscreen/fullscreen_part.h
new file mode 100644
index 00000000..a7ce3c0a
--- /dev/null
+++ b/parts/fullscreen/fullscreen_part.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Roberto Raggi *
+ * roberto@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __KDEVPART_FULLSCREEN_H__
+#define __KDEVPART_FULLSCREEN_H__
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+
+class KAction;
+
+class FullScreenPart : public KDevPlugin
+{
+ Q_OBJECT
+public:
+ FullScreenPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~FullScreenPart();
+
+public slots:
+ void slotToggleFullScreen();
+
+private:
+ KToggleFullScreenAction* m_pFullScreen;
+ bool m_bFullScreen;
+};
+
+
+#endif
diff --git a/parts/fullscreen/kdevfullscreen.desktop b/parts/fullscreen/kdevfullscreen.desktop
new file mode 100644
index 00000000..e9cf55f0
--- /dev/null
+++ b/parts/fullscreen/kdevfullscreen.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=FullScreen
+Comment[br]=Skramm leun
+Comment[ca]=Pantalla completa
+Comment[da]=Fuldskærm
+Comment[de]=Vollbild
+Comment[el]=ΠλήρηςΟθόνη
+Comment[es]=Pantalla completa
+Comment[eu]=Pantaila osoa
+Comment[fa]=تمام ‌صفحه
+Comment[fr]=Plein écran
+Comment[ga]=Lánscáileán
+Comment[hi]=फुल-स्क्रीन
+Comment[hu]=Teljes képernyő
+Comment[it]=Schermo pieno
+Comment[ja]=フルスクリーン
+Comment[ms]=SkrinPenuh
+Comment[nds]=Heel Schirm
+Comment[ne]=पूरा पर्दा
+Comment[nl]=Volledig scherm
+Comment[pl]=Pełny ekran
+Comment[pt]=Todo o Ecrã
+Comment[pt_BR]=Tela Cheia
+Comment[ru]=Полноэкранный режим
+Comment[sk]=Celá obrazovka
+Comment[sl]=Celozaslonski način
+Comment[sr]=Преко целог екрана
+Comment[sr@Latn]=Preko celog ekrana
+Comment[sv]=Fullskärm
+Comment[ta]=முழுத்திரை
+Comment[tg]=Тартиботи экрани пурра
+Comment[tr]=Tam Ekran
+Comment[zh_CN]=全屏
+Comment[zh_TW]=全螢幕
+Name=KDevFullScreen
+Name[da]=KDevelop fuldskærm
+Name[de]=Vollbild (KDevelop)
+Name[hi]=के-डेव-फुलस्क्रीन
+Name[nds]=KDevelop-Heelschirm
+Name[pl]=KDevPełnyEkran
+Name[sk]=KDev celá obrazovka
+Name[sv]=KDevelop fullskärm
+Name[ta]=KDev முழுத்திரை
+Name[tg]=Васеъкуниии KDev
+Name[zh_TW]=KDevelop 全螢幕
+GenericName=FullScreen
+GenericName[br]=Skramm leun
+GenericName[ca]=Pantalla completa
+GenericName[da]=Fuldskærm
+GenericName[de]=Vollbild
+GenericName[el]=ΠλήρηςΟθόνη
+GenericName[es]=Pantalla completa
+GenericName[et]=Täisekraan
+GenericName[eu]=Pantaila osoa
+GenericName[fa]=تمام‌ صفحه
+GenericName[fr]=Plein écran
+GenericName[ga]=Lánscáileán
+GenericName[hi]=फुल-स्क्रीन
+GenericName[hu]=Teljes képernyő
+GenericName[it]=Schermo pieno
+GenericName[ja]=フルスクリーン
+GenericName[nds]=Heel Schirm
+GenericName[ne]=पूरा पर्दा
+GenericName[nl]=Volledig scherm
+GenericName[pl]=Pełny ekran
+GenericName[pt]=Todo o Ecrã
+GenericName[pt_BR]=Tela Cheia
+GenericName[ru]=Полноэкранный режим
+GenericName[sk]=Celá obrazovka
+GenericName[sl]=Celozaslonski način
+GenericName[sr]=Преко целог екрана
+GenericName[sr@Latn]=Preko celog ekrana
+GenericName[sv]=Fullskärm
+GenericName[ta]=முழுத்திரை
+GenericName[tg]=Тартиботи экрани пурра
+GenericName[tr]=Tam Ekran
+GenericName[zh_CN]=全屏
+GenericName[zh_TW]=全螢幕
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Core
+X-KDE-Library=libkdevfullscreen
+X-KDevelop-Version=5
+X-KDevelop-Properties=ViewManagement
diff --git a/parts/fullscreen/kdevpart_fullscreen.rc b/parts/fullscreen/kdevpart_fullscreen.rc
new file mode 100644
index 00000000..3bd67c9d
--- /dev/null
+++ b/parts/fullscreen/kdevpart_fullscreen.rc
@@ -0,0 +1,12 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="fullscreen" library="libfullscreenplugin" version="3">
+<MenuBar>
+ <Menu name="settings">
+ <Text>&amp;Settings</Text>
+ <Action name="fullscreen" group="show_merge"/>
+ </Menu>
+</MenuBar>
+<ToolBar name="mainToolBar">
+ <Action name="fullscreen" group="screenmode_operations"/>
+</ToolBar>
+</kpartplugin>
diff --git a/parts/grepview/Makefile.am b/parts/grepview/Makefile.am
new file mode 100644
index 00000000..49f3c202
--- /dev/null
+++ b/parts/grepview/Makefile.am
@@ -0,0 +1,19 @@
+# Here resides the grep view part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevgrepview.la
+libkdevgrepview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevgrepview_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML)
+
+libkdevgrepview_la_SOURCES = grepviewpart.cpp grepviewwidget.cpp grepdlg.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevgrepview.desktop
+
+rcdir = $(kde_datadir)/kdevgrepview
+rc_DATA = kdevgrepview.rc
diff --git a/parts/grepview/README.dox b/parts/grepview/README.dox
new file mode 100644
index 00000000..d5e9130a
--- /dev/null
+++ b/parts/grepview/README.dox
@@ -0,0 +1,12 @@
+/** \class GrepViewPart
+Integrates "find|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a> aka teatime
+
+\feature grep works on editor context menu
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=grep%20frontend&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">Grep Frontend component at Bugzilla database</a>
+
+*/
diff --git a/parts/grepview/grepdlg.cpp b/parts/grepview/grepdlg.cpp
new file mode 100644
index 00000000..9c62510e
--- /dev/null
+++ b/parts/grepview/grepdlg.cpp
@@ -0,0 +1,381 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "grepdlg.h"
+
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qhbox.h>
+#include <qwhatsthis.h>
+#include <qtooltip.h>
+#include <qstringlist.h>
+#include <kfiledialog.h>
+#include <kbuttonbox.h>
+#include <kpushbutton.h>
+#include <kapplication.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kconfig.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kdeversion.h>
+#include <qlabel.h>
+#include <kcombobox.h>
+#include <kurlcompletion.h>
+#include <kurlrequester.h>
+#include <kstdguiitem.h>
+#include <kparts/part.h>
+#include <kdevpartcontroller.h>
+#include <klineedit.h>
+
+#include "grepviewpart.h"
+
+
+const char *template_desc[] = {
+ "verbatim",
+ "assignment",
+ "->MEMBER(",
+ "class::MEMBER(",
+ "OBJECT->member(",
+ 0
+};
+
+const char *template_str[] = {
+ "%s",
+ "\\<%s\\>[\\t ]*=[^=]",
+ "\\->[\\t ]*\\<%s\\>[\\t ]*\\(",
+ "[a-z0-9_$]+[\\t ]*::[\\t ]*\\<%s\\>[\\t ]*\\(",
+ "\\<%s\\>[\\t ]*\\->[\\t ]*[a-z0-9_$]+[\\t ]*\\(",
+ 0
+};
+
+const char *filepatterns[] = {
+ "*.h,*.hxx,*.hpp,*.hh,*.h++,*.H,*.tlh,*.cpp,*.cc,*.C,*.c++,*.cxx,*.ocl,*.inl,*.idl,*.c,*.m,*.mm,*.M",
+ "*.cpp,*.cc,*.C,*.c++,*.cxx,*.ocl,*.inl,*.c,*.m,*.mm,*.M",
+ "*.h,*.hxx,*.hpp,*.hh,*.h++,*.H,*.tlh,*.idl",
+ "*.adb",
+ "*.cs",
+ "*.f",
+ "*.html,*.htm",
+ "*.hs",
+ "*.java",
+ "*.js",
+ "*.php,*.php3,*.php4",
+ "*.pl",
+ "*.pp,*.pas",
+ "*.py",
+ "*.js,*.css,*.yml,*.rb,*.rhtml,*.html.erb,*.rjs,*.js.rjs,*.rxml,*.xml.builder",
+ "CMakeLists.txt,*.cmake",
+ "*",
+ 0
+};
+
+
+GrepDialog::GrepDialog( GrepViewPart * part, QWidget *parent, const char *name )
+ : QDialog(parent, name, false), m_part( part )
+{
+ setCaption(i18n("Find in Files"));
+
+ config = GrepViewFactory::instance()->config();
+ config->setGroup("GrepDialog");
+
+ QGridLayout *layout = new QGridLayout(this, 9, 2, 10, 4);
+ layout->setColStretch(0, 0);
+ layout->setColStretch(1, 20);
+
+ QLabel *pattern_label = new QLabel(i18n("&Pattern:"), this);
+ layout->addWidget(pattern_label, 0, 0, AlignRight | AlignVCenter);
+
+ pattern_combo = new KHistoryCombo(true, this);
+ pattern_label->setBuddy(pattern_combo);
+ pattern_combo->setFocus();
+ pattern_combo->setHistoryItems(config->readListEntry("LastSearchItems"), true);
+ pattern_combo->setInsertionPolicy(QComboBox::NoInsertion);
+ layout->addWidget(pattern_combo, 0, 1);
+
+ QLabel *template_label = new QLabel(i18n("&Template:"), this);
+ layout->addWidget(template_label, 1, 0, AlignRight | AlignVCenter);
+
+ QBoxLayout *template_layout = new QHBoxLayout(4);
+ layout->addLayout(template_layout, 1, 1);
+
+ template_edit = new KLineEdit(this);
+ template_label->setBuddy(template_edit);
+ template_edit->setText(template_str[0]);
+ template_layout->addWidget(template_edit, 1);
+
+ KComboBox *template_combo = new KComboBox(false, this);
+ template_combo->insertStrList(template_desc);
+ template_layout->addWidget(template_combo, 0);
+
+ QBoxLayout *search_opts_layout = new QHBoxLayout(15);
+ layout->addLayout(search_opts_layout, 2, 1);
+
+ regexp_box = new QCheckBox(i18n("&Regular Expression"), this);
+ regexp_box->setChecked(config->readBoolEntry("regexp", false ));
+ search_opts_layout->addWidget(regexp_box);
+
+ case_sens_box = new QCheckBox(i18n("C&ase sensitive"), this);
+ case_sens_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ case_sens_box->setChecked(config->readBoolEntry("case_sens", true));
+ search_opts_layout->addWidget(case_sens_box);
+
+ QLabel *dir_label = new QLabel(i18n("&Directory:"), this);
+ layout->addWidget(dir_label, 3, 0, AlignRight | AlignVCenter);
+
+ QBoxLayout *dir_layout = new QHBoxLayout(4);
+ layout->addLayout(dir_layout, 3, 1);
+
+ dir_combo = new KComboBox( true, this );
+ dir_combo->insertStringList(config->readPathListEntry("LastSearchPaths"));
+ dir_combo->setInsertionPolicy(QComboBox::NoInsertion);
+ dir_combo->setEditText(QDir::homeDirPath());
+
+ url_requester = new KURLRequester( dir_combo, this );
+ url_requester->completionObject()->setMode(KURLCompletion::DirCompletion);
+ url_requester->setMode( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+
+ dir_label->setBuddy( url_requester );
+ dir_combo->setMinimumWidth(dir_combo->fontMetrics().maxWidth()*25);
+ dir_layout->addWidget( url_requester, 10 );
+
+ synch_button = new KPushButton( this );
+ QIconSet set = SmallIconSet( "dirsynch" );
+ QPixmap pix = set.pixmap( QIconSet::Small, QIconSet::Normal );
+ synch_button->setFixedSize( pix.width()+8, pix.height()+8 );
+ synch_button->setIconSet( set );
+ synch_button->setAccel( QKeySequence( "Alt+y") );
+ QToolTip::add( synch_button, i18n("Set directory to that of the current file (Alt+Y)") );
+ dir_layout->addWidget( synch_button );
+
+ QBoxLayout *dir_opts_layout = new QHBoxLayout(15);
+ layout->addLayout(dir_opts_layout, 4, 1);
+
+ recursive_box = new QCheckBox(i18n("Rec&ursive"), this);
+ recursive_box->setChecked(config->readBoolEntry("recursive", true));
+ dir_opts_layout->addWidget(recursive_box);
+
+ use_project_box = new QCheckBox(i18n("Limit search to &project files"), this);
+ use_project_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ use_project_box->setChecked(config->readBoolEntry("search_project_files", true));
+ dir_opts_layout->addWidget(use_project_box);
+
+ QLabel *files_label = new QLabel(i18n("&Files:"), this);
+ layout->addWidget(files_label, 5, 0, AlignRight | AlignVCenter);
+
+ files_combo = new KComboBox(true, this);
+ files_label->setBuddy(files_combo->focusProxy());
+ files_combo->insertStrList(filepatterns);
+ layout->addWidget(files_combo, 5, 1);
+
+ QLabel *exclude_label = new QLabel(i18n("&Exclude:"), this);
+ layout->addWidget(exclude_label, 6, 0, AlignRight | AlignVCenter);
+
+ QStringList exclude_list = config->readListEntry("exclude_patterns");
+ exclude_combo = new KComboBox(true, this);
+ exclude_label->setBuddy(files_combo->focusProxy());
+ if (exclude_list.count()) {
+ exclude_combo->insertStringList(exclude_list);
+ }
+ else
+ {
+ exclude_combo->insertItem("/CVS/,/SCCS/,/\\.svn/,/_darcs/");
+ exclude_combo->insertItem("");
+ }
+ layout->addWidget(exclude_combo, 6, 1);
+
+ QBoxLayout *other_opts_layout = new QHBoxLayout(15);
+ layout->addLayout(other_opts_layout, 7, 1);
+
+ keep_output_box = new QCheckBox(i18n("New view"), this);
+ keep_output_box->setChecked(config->readBoolEntry("new_view", true));
+ other_opts_layout->addWidget(keep_output_box);
+
+ no_find_err_box = new QCheckBox(i18n("&Suppress find errors"), this);
+ no_find_err_box->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ no_find_err_box->setChecked(config->readBoolEntry("no_find_errs", true));
+ other_opts_layout->addWidget(no_find_err_box);
+
+ QBoxLayout *button_layout = new QHBoxLayout(4);
+ layout->addLayout(button_layout, 8, 1);
+ search_button = new KPushButton(KGuiItem(i18n("Sea&rch"),"grep"), this);
+ search_button->setDefault(true);
+ KPushButton *done_button = new KPushButton(KStdGuiItem::cancel(), this);
+ button_layout->addStretch();
+ button_layout->addWidget(search_button);
+ button_layout->addWidget(done_button);
+
+ resize(sizeHint());
+
+ QWhatsThis::add(pattern_combo,
+ i18n("<qt>Enter the regular expression you want to search for here.<p>"
+ "Possible meta characters are:"
+ "<ul>"
+ "<li><b>.</b> - Matches any character"
+ "<li><b>^</b> - Matches the beginning of a line"
+ "<li><b>$</b> - Matches the end of a line"
+ "<li><b>\\&lt;</b> - Matches the beginning of a word"
+ "<li><b>\\&gt;</b> - Matches the end of a word"
+ "</ul>"
+ "The following repetition operators exist:"
+ "<ul>"
+ "<li><b>?</b> - The preceding item is matched at most once"
+ "<li><b>*</b> - The preceding item is matched zero or more times"
+ "<li><b>+</b> - The preceding item is matched one or more times"
+ "<li><b>{<i>n</i>}</b> - The preceding item is matched exactly <i>n</i> times"
+ "<li><b>{<i>n</i>,}</b> - The preceding item is matched <i>n</i> or more times"
+ "<li><b>{,<i>n</i>}</b> - The preceding item is matched at most <i>n</i> times"
+ "<li><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."
+ "</ul>"
+ "Furthermore, backreferences to bracketed subexpressions are "
+ "available via the notation \\<i>n</i>.</qt>"
+ ));
+ QWhatsThis::add(files_combo,
+ i18n("Enter the file name pattern of the files to search here. "
+ "You may give several patterns separated by commas"));
+ QWhatsThis::add(template_edit,
+ i18n("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."));
+
+ connect( template_combo, SIGNAL(activated(int)),
+ SLOT(templateActivated(int)) );
+ connect( search_button, SIGNAL(clicked()),
+ SLOT(slotSearchClicked()) );
+ connect( done_button, SIGNAL(clicked()),
+ SLOT(hide()) );
+ connect( pattern_combo->lineEdit(), SIGNAL( textChanged ( const QString & ) ),
+ SLOT( slotPatternChanged( const QString & ) ) );
+ connect( synch_button, SIGNAL(clicked()), this, SLOT(slotSynchDirectory()) );
+ slotPatternChanged( pattern_combo->currentText() );
+}
+
+// Returns the contents of a QComboBox as a QStringList
+static QStringList qCombo2StringList( QComboBox* combo )
+{
+ QStringList list;
+ if (!combo)
+ return list;
+ for (int i = 0; i < combo->count(); ++i ) {
+ list << combo->text(i);
+ }
+ return list;
+}
+
+GrepDialog::~GrepDialog()
+{
+ config->setGroup("GrepDialog");
+ // memorize the last patterns and paths
+ config->writeEntry("LastSearchItems", qCombo2StringList(pattern_combo));
+ config->writePathEntry("LastSearchPaths", qCombo2StringList(dir_combo));
+ config->writeEntry("regexp", regexp_box->isChecked());
+ config->writeEntry("recursive", recursive_box->isChecked());
+ config->writeEntry("search_project_files", use_project_box->isChecked());
+ config->writeEntry("case_sens", case_sens_box->isChecked());
+ config->writeEntry("new_view", keep_output_box->isChecked());
+ config->writeEntry("no_find_errs", no_find_err_box->isChecked());
+ config->writeEntry("exclude_patterns", qCombo2StringList(exclude_combo));
+}
+
+void GrepDialog::slotPatternChanged( const QString & _text )
+{
+ search_button->setEnabled( !_text.isEmpty() );
+}
+
+void GrepDialog::templateActivated(int index)
+{
+ template_edit->setText(template_str[index]);
+}
+
+// Find out whether the string s is already contained in combo
+static bool qComboContains( const QString& s, QComboBox* combo )
+{
+ if (!combo)
+ return false;
+ for (int i = 0; i < combo->count(); ++i ) {
+ if (combo->text(i) == s) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void GrepDialog::slotSearchClicked()
+{
+ if (pattern_combo->currentText().isEmpty()) {
+ KMessageBox::sorry(this, i18n("Please enter a search pattern"));
+ pattern_combo->setFocus();
+ return;
+ }
+ // add the last patterns and paths to the combo
+ if (!qComboContains(pattern_combo->currentText(), pattern_combo)) {
+ pattern_combo->addToHistory(pattern_combo->currentText());
+ }
+ if (pattern_combo->count() > 15) {
+ pattern_combo->removeFromHistory(pattern_combo->text(15));
+ }
+ if (!qComboContains(exclude_combo->currentText(), exclude_combo)) {
+ exclude_combo->insertItem(exclude_combo->currentText(), 0);
+ }
+ if (exclude_combo->count() > 15) {
+ exclude_combo->removeItem(15);
+ }
+ if (!qComboContains(dir_combo->currentText(), dir_combo)) {
+ dir_combo->insertItem(dir_combo->currentText(), 0);
+ }
+ if (dir_combo->count() > 15) {
+ dir_combo->removeItem(15);
+ }
+
+ emit searchClicked();
+ hide();
+}
+
+void GrepDialog::show()
+{
+ // not beautiful, but works with all window
+ // managers and Qt versions
+ if (isVisible())
+ hide();
+// QDialog::hide();
+ QDialog::show();
+ pattern_combo->setFocus();
+}
+
+void GrepDialog::hide()
+{
+ pattern_combo->setFocus();
+ QDialog::hide();
+}
+
+void GrepDialog::slotSynchDirectory( )
+{
+ KParts::ReadOnlyPart * part = dynamic_cast<KParts::ReadOnlyPart*>( m_part->partController()->activePart() );
+ if ( part )
+ {
+ KURL url = part->url();
+ if ( url.isLocalFile() )
+ {
+ dir_combo->setEditText( url.upURL().path( +1 ) );
+ }
+ }
+}
+
+void GrepDialog::setEnableProjectBox(bool enable)
+{
+ use_project_box->setEnabled(enable);
+ if (!enable) use_project_box->setChecked(false);
+}
+
+#include "grepdlg.moc"
diff --git a/parts/grepview/grepdlg.h b/parts/grepview/grepdlg.h
new file mode 100644
index 00000000..c24332bd
--- /dev/null
+++ b/parts/grepview/grepdlg.h
@@ -0,0 +1,104 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GREPDLG_H_
+#define _GREPDLG_H_
+
+#include <qdialog.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+#include <kcombobox.h>
+#include <klineedit.h>
+
+
+class KConfig;
+class KURLRequester;
+class QPushButton;
+class GrepViewPart;
+class KLineEdit;
+
+class GrepDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ GrepDialog( GrepViewPart * part, QWidget *parent=0, const char *name=0 );
+ ~GrepDialog();
+
+ void setPattern(const QString &pattern)
+ { pattern_combo->setEditText(pattern); }
+ void setDirectory(const QString &dir)
+ { dir_combo->setEditText(dir); }
+ void setEnableProjectBox(bool enable);
+
+ QString patternString() const
+ { return pattern_combo->currentText(); }
+ QString templateString() const
+ { return template_edit->text(); }
+ QString filesString() const
+ { return files_combo->currentText(); }
+ QString excludeString() const
+ { return exclude_combo->currentText(); }
+ QString directoryString() const
+ { return dir_combo->currentText(); }
+
+ bool useProjectFilesFlag() const
+ { return use_project_box->isChecked(); }
+ bool regexpFlag() const
+ { return regexp_box->isChecked(); }
+ bool recursiveFlag() const
+ { return recursive_box->isChecked(); }
+ bool noFindErrorsFlag() const
+ { return no_find_err_box->isChecked(); }
+ bool caseSensitiveFlag() const
+ { return case_sens_box->isChecked(); }
+ bool keepOutputFlag() const
+ { return keep_output_box->isChecked(); }
+
+ void show();
+ void hide();
+
+signals:
+ void searchClicked();
+
+private slots:
+ void templateActivated(int index);
+ void slotSearchClicked();
+ void slotPatternChanged( const QString &);
+ void slotSynchDirectory();
+
+private:
+ KLineEdit *template_edit;
+ KHistoryCombo *pattern_combo;
+ KComboBox *files_combo;
+ KComboBox *exclude_combo;
+ KComboBox * dir_combo;
+ KURLRequester * url_requester;
+
+ QCheckBox *regexp_box;
+ QCheckBox *recursive_box;
+ QCheckBox *use_project_box;
+ QCheckBox *no_find_err_box;
+ QCheckBox *case_sens_box;
+ QCheckBox *keep_output_box;
+ KConfig* config;
+ QPushButton *search_button;
+ QPushButton *synch_button;
+ GrepViewPart * m_part;
+};
+
+
+#endif
+
+
+
+
+
diff --git a/parts/grepview/grepviewpart.cpp b/parts/grepview/grepviewpart.cpp
new file mode 100644
index 00000000..7b1f75d9
--- /dev/null
+++ b/parts/grepview/grepviewpart.cpp
@@ -0,0 +1,150 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "grepviewpart.h"
+
+#include <qpopupmenu.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kprocess.h>
+#include <kstringhandler.h>
+#include <ktexteditor/document.h>
+
+#include "kdevcore.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "kdevplugininfo.h"
+#include "kdeveditorutil.h"
+#include "grepviewwidget.h"
+
+static const KDevPluginInfo data("kdevgrepview");
+
+K_EXPORT_COMPONENT_FACTORY(libkdevgrepview, GrepViewFactory(data))
+
+GrepViewPart::GrepViewPart( QObject *parent, const char *name, const QStringList & )
+ : KDevPlugin( &data, parent, name ? name : "GrepViewPart" )
+{
+ setInstance(GrepViewFactory::instance());
+
+ setXMLFile("kdevgrepview.rc");
+
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(stopButtonClicked(KDevPlugin*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ m_widget = new GrepViewWidget(this);
+ m_widget->setIcon(SmallIcon("grep"));
+ m_widget->setCaption(i18n("Grep Output"));
+ QWhatsThis::add(m_widget, i18n("<b>Find in files</b><p>"
+ "This window contains the output of a grep "
+ "command. Clicking on an item in the list "
+ "will automatically open the corresponding "
+ "source file and set the cursor to the line "
+ "with the match."));
+
+ mainWindow()->embedOutputView(m_widget, i18n("Find in Files"), i18n("Output of the grep command"));
+
+ KAction *action;
+
+ action = new KAction(i18n("Find in Fi&les..."), "grep", CTRL+ALT+Key_F,
+ this, SLOT(slotGrep()),
+ actionCollection(), "edit_grep");
+ action->setToolTip( i18n("Search for expressions over several files") );
+ action->setWhatsThis( i18n("<b>Find in files</b><p>"
+ "Opens the 'Find in files' dialog. There you "
+ "can enter a regular expression which is then "
+ "searched for within all files in the directories "
+ "you specify. Matches will be displayed, you "
+ "can switch to a match directly.") );
+}
+
+
+GrepViewPart::~GrepViewPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+}
+
+
+void GrepViewPart::stopButtonClicked(KDevPlugin* which)
+{
+ if ( which != 0 && which != this )
+ return;
+ kdDebug(9001) << "GrepViewPart::stopButtonClicked()" << endl;
+ m_widget->killJob( SIGHUP );
+}
+
+
+void GrepViewPart::projectOpened()
+{
+ kdDebug(9001) << "GrepViewPart::projectOpened()" << endl;
+ m_widget->projectChanged(project());
+}
+
+
+void GrepViewPart::projectClosed()
+{
+ m_widget->projectChanged(0);
+}
+
+
+void GrepViewPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ kdDebug(9001) << "context in grepview" << endl;
+ if (!context->hasType( Context::EditorContext ))
+ return;
+
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ QString ident = econtext->currentWord();
+ if (!ident.isEmpty()) {
+ m_popupstr = ident;
+ QString squeezed = KStringHandler::csqueeze(ident, 30);
+ int id = popup->insertItem( i18n("Grep: %1").arg(squeezed),
+ this, SLOT(slotContextGrep()) );
+ popup->setWhatsThis(id, i18n("<b>Grep</b><p>Opens the find in files dialog "
+ "and sets the pattern to the text under the cursor."));
+ popup->insertSeparator();
+ }
+}
+
+
+void GrepViewPart::slotGrep()
+{
+ if ( !m_widget->isRunning() )
+ {
+ QString contextString = KDevEditorUtil::currentSelection( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ if ( contextString.isEmpty() )
+ {
+ contextString = KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) );
+ }
+ m_widget->showDialogWithPattern( contextString );
+ }
+}
+
+
+void GrepViewPart::slotContextGrep()
+{
+ if ( !m_widget->isRunning() )
+ {
+ m_widget->showDialogWithPattern(m_popupstr);
+ }
+}
+
+#include "grepviewpart.moc"
diff --git a/parts/grepview/grepviewpart.h b/parts/grepview/grepviewpart.h
new file mode 100644
index 00000000..c6031a3b
--- /dev/null
+++ b/parts/grepview/grepviewpart.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GREPVIEWPART_H_
+#define _GREPVIEWPART_H_
+
+#include <qguardedptr.h>
+#include <kdevgenericfactory.h>
+#include "kdevplugin.h"
+
+class KDialogBase;
+class QPopupMenu;
+class Context;
+class GrepViewWidget;
+
+
+class GrepViewPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ GrepViewPart( QObject *parent, const char *name, const QStringList & );
+ ~GrepViewPart();
+
+private slots:
+ void stopButtonClicked(KDevPlugin *which);
+ void projectOpened();
+ void projectClosed();
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+ void slotGrep();
+ void slotContextGrep();
+
+private:
+ QGuardedPtr<GrepViewWidget> m_widget;
+ QString m_popupstr;
+ friend class GrepViewWidget;
+};
+
+typedef KDevGenericFactory<GrepViewPart> GrepViewFactory;
+
+#endif
diff --git a/parts/grepview/grepviewwidget.cpp b/parts/grepview/grepviewwidget.cpp
new file mode 100644
index 00000000..326e2897
--- /dev/null
+++ b/parts/grepview/grepviewwidget.cpp
@@ -0,0 +1,535 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdir.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qpainter.h>
+#include <qtoolbutton.h>
+#include <kdialogbase.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kparts/part.h>
+#include <ktexteditor/selectioninterface.h>
+#include <kaction.h>
+#include <kpopupmenu.h>
+#include <ktabwidget.h>
+#include <kpushbutton.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+using namespace KTextEditor;
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+
+#include "grepdlg.h"
+#include "grepviewpart.h"
+#include "grepviewwidget.h"
+
+
+class GrepListBoxItem : public ProcessListBoxItem
+{
+public:
+ GrepListBoxItem(const QString &fileName, const QString &lineNumber, const QString &text, bool showFilename);
+ QString filename()
+ { return fileName; }
+ int linenumber()
+ { return lineNumber.toInt(); }
+ virtual bool isCustomItem();
+
+private:
+ virtual void paint(QPainter *p);
+ QString fileName, lineNumber, text;
+ bool show;
+};
+
+
+GrepListBoxItem::GrepListBoxItem(const QString &fileName, const QString &lineNumber, const QString &text, bool showFilename)
+ : ProcessListBoxItem( QString::null, Normal),
+ fileName(fileName), lineNumber(lineNumber), text(text.stripWhiteSpace()),
+ show(showFilename)
+{
+ this->text.replace( QChar('\t'), QString(" ") );
+}
+
+
+bool GrepListBoxItem::isCustomItem()
+{
+ return true;
+}
+
+
+void GrepListBoxItem::paint(QPainter *p)
+{
+ QColor base, dim, result, bkground;
+ if (listBox()) {
+ const QColorGroup& group = listBox()->palette().active();
+ if (isSelected()) {
+ bkground = group.button();
+ base = group.buttonText();
+ }
+ else
+ {
+ bkground = group.base();
+ base = group.text();
+ }
+ dim = blend(base, bkground);
+ result = group.link();
+ }
+ else
+ {
+ base = Qt::black;
+ dim = Qt::darkGreen;
+ result = Qt::blue;
+ if (isSelected())
+ bkground = Qt::lightGray;
+ else
+ bkground = Qt::white;
+ }
+ QFontMetrics fm = p->fontMetrics();
+ QString stx = lineNumber + ": ";
+ int y = fm.ascent()+fm.leading()/2;
+ int x = 3;
+ p->fillRect(p->window(), QBrush(bkground));
+ if (show)
+ {
+ p->setPen(dim);
+ p->drawText(x, y, fileName);
+ x += fm.width(fileName);
+ }
+ else
+ {
+ p->setPen(base);
+ QFont font1(p->font());
+ QFont font2(font1);
+ font2.setBold(true);
+ p->setFont(font2);
+ p->drawText(x, y, stx);
+ p->setFont(font1);
+ x += fm.width(stx);
+
+ p->setPen(result);
+ p->drawText(x, y, text);
+ }
+}
+
+
+GrepViewWidget::GrepViewWidget(GrepViewPart *part) : QWidget(0, "grepview widget")
+{
+ m_layout = new QHBoxLayout(this, 0, -1, "greplayout");
+
+ m_tabWidget = new KTabWidget(this);
+
+ m_layout->add(m_tabWidget);
+
+ m_curOutput = new GrepViewProcessWidget(m_tabWidget);
+
+ m_tabWidget->addTab(m_curOutput, i18n("Search Results"));
+
+ grepdlg = new GrepDialog( part, this, "grep widget");
+ connect( grepdlg, SIGNAL(searchClicked()), this, SLOT(searchActivated()) );
+ connect( m_curOutput, SIGNAL(processExited(KProcess* )), this, SLOT(slotSearchProcessExited()) );
+
+ connect( m_tabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotOutputTabChanged()) );
+
+ connect( m_curOutput, SIGNAL(clicked(QListBoxItem*)),
+ this, SLOT(slotExecuted(QListBoxItem*)) );
+ connect( m_curOutput, SIGNAL(returnPressed(QListBoxItem*)),
+ this, SLOT(slotExecuted(QListBoxItem*)) );
+
+
+ connect( m_curOutput, SIGNAL(contextMenuRequested( QListBoxItem*, const QPoint&)), this, SLOT(popupMenu(QListBoxItem*, const QPoint&)));
+ m_part = part;
+
+ m_closeButton = new QToolButton(m_tabWidget);//@todo change text/icon
+ m_closeButton->setIconSet(SmallIconSet("tab_remove"));
+ m_closeButton->setEnabled(false);
+
+ connect (m_closeButton, SIGNAL(clicked()), this, SLOT(slotCloseCurrentOutput()));
+ m_tabWidget->setCornerWidget(m_closeButton);
+}
+
+
+GrepViewWidget::~GrepViewWidget()
+{}
+
+
+void GrepViewWidget::showDialog()
+{
+ // Get the selected text if there is any
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(m_part->partController()->activePart());
+ if (ro_part)
+ {
+ SelectionInterface *selectIface = dynamic_cast<SelectionInterface*>(ro_part);
+ if(selectIface && selectIface->hasSelection())
+ {
+ QString selText = selectIface->selection();
+ if(!selText.contains('\n'))
+ {
+ grepdlg->setPattern(selText);
+ }
+ }
+ }
+ // Determine if we have a list of project files
+ KDevProject *openProject = m_part->project();
+ if (openProject)
+ {
+ grepdlg->setEnableProjectBox(!openProject->allFiles().isEmpty());
+ }
+ else
+ {
+ grepdlg->setEnableProjectBox(false);
+ }
+ grepdlg->show();
+}
+
+// @todo - put this somewhere common - or just use Qt if possible
+static QString escape(const QString &str)
+{
+ QString escaped("[]{}()\\^$?.+-*|");
+ QString res;
+
+ for (uint i=0; i < str.length(); ++i)
+ {
+ if (escaped.find(str[i]) != -1)
+ res += "\\";
+ res += str[i];
+ }
+
+ return res;
+}
+
+
+void GrepViewWidget::showDialogWithPattern(QString pattern)
+{
+ // Before anything, this removes line feeds from the
+ // beginning and the end.
+ int len = pattern.length();
+ if (len > 0 && pattern[0] == '\n')
+ {
+ pattern.remove(0, 1);
+ len--;
+ }
+ if (len > 0 && pattern[len-1] == '\n')
+ pattern.truncate(len-1);
+ grepdlg->setPattern( pattern );
+
+ // Determine if we have a list of project files
+ KDevProject *openProject = m_part->project();
+ if (openProject)
+ {
+ grepdlg->setEnableProjectBox(!openProject->allFiles().isEmpty());
+ }
+ else
+ {
+ grepdlg->setEnableProjectBox(false);
+ }
+ grepdlg->show();
+}
+
+
+void GrepViewWidget::searchActivated()
+{
+ if ( grepdlg->keepOutputFlag() )
+ slotKeepOutput();
+
+ m_tabWidget->showPage( m_curOutput );
+
+ m_curOutput->setLastFileName("");
+ m_curOutput->setMatchCount( 0 );
+
+ QString command, files;
+
+ // waba: code below breaks on filenames containing a ',' !!!
+ QStringList filelist = QStringList::split(",", grepdlg->filesString());
+
+ if (grepdlg->useProjectFilesFlag())
+ {
+ KDevProject *openProject = m_part->project();
+ if (openProject)
+ {
+ QString tmpFilePath;
+ QStringList projectFiles = openProject->allFiles();
+ if (!projectFiles.isEmpty())
+ {
+ tmpFilePath = openProject->projectDirectory() + QChar(QDir::separator()) + ".grep.tmp";
+ QString dir = grepdlg->directoryString(), file;
+ QValueList<QRegExp> regExpList;
+
+ if (dir.endsWith(QChar(QDir::separator())))
+ dir.truncate(dir.length() - 1);
+
+ if (!filelist.isEmpty())
+ {
+ for (QStringList::Iterator it = filelist.begin(); it != filelist.end(); ++it)
+ regExpList.append(QRegExp(*it, true, true));
+ }
+
+ m_tempFile.setName(tmpFilePath);
+ if (m_tempFile.open(IO_WriteOnly))
+ {
+ QTextStream out(&m_tempFile);
+ for (QStringList::Iterator it = projectFiles.begin(); it != projectFiles.end(); ++it)
+ {
+ file = QDir::cleanDirPath(openProject->projectDirectory() + QChar(QDir::separator()) + *it);
+
+ QFileInfo info(file);
+ if (grepdlg->recursiveFlag() && !info.dirPath(true).startsWith(dir)) continue;
+ if (!grepdlg->recursiveFlag() && info.dirPath(true) != dir) continue;
+
+ bool matchOne = regExpList.count() == 0;
+ for (QValueList<QRegExp>::Iterator it2 = regExpList.begin(); it2 != regExpList.end() && !matchOne; ++it2)
+ matchOne = (*it2).exactMatch(file);
+
+ if (matchOne)
+ out << KShellProcess::quote(file) + "\n";
+ }
+
+ m_tempFile.close();
+ }
+ else
+ {
+ KMessageBox::error(this, i18n("Unable to create a temporary file for search."));
+ return;
+ }
+ }
+
+ command = "cat ";
+ command += tmpFilePath.replace(' ', "\\ ");
+ }
+ }
+ else
+ {
+ if (!filelist.isEmpty())
+ {
+ QStringList::Iterator it(filelist.begin());
+ files = KShellProcess::quote(*it);
+ ++it;
+ for (; it != filelist.end(); ++it)
+ files += " -o -name " + KShellProcess::quote(*it);
+ }
+
+ QString filepattern = "find ";
+ filepattern += KShellProcess::quote(grepdlg->directoryString());
+ if (!grepdlg->recursiveFlag())
+ filepattern += " -maxdepth 1";
+ filepattern += " \\( -name ";
+ filepattern += files;
+ filepattern += " \\) -print -follow";
+ if (grepdlg->noFindErrorsFlag())
+ filepattern += " 2>/dev/null";
+
+ command = filepattern + " " ;
+ }
+
+ QStringList excludelist = QStringList::split(",", grepdlg->excludeString());
+ if (!excludelist.isEmpty())
+ {
+ QStringList::Iterator it(excludelist.begin());
+ command += "| grep -v ";
+ for (; it != excludelist.end(); ++it)
+ command += "-e " + KShellProcess::quote(*it) + " ";
+ }
+
+ if (!grepdlg->useProjectFilesFlag())
+ {
+ // quote spaces in filenames going to xargs
+ command += "| sed \"s/ /\\\\\\ /g\" ";
+ }
+
+ command += "| xargs " ;
+
+#ifndef USE_SOLARIS
+ command += "egrep -H -n -s ";
+#else
+ // -H reported as not being available on Solaris,
+ // but we're buggy without it on Linux.
+ command += "egrep -n ";
+#endif
+
+ if (!grepdlg->caseSensitiveFlag())
+ {
+ command += "-i ";
+ }
+ command += "-e ";
+
+ m_lastPattern = grepdlg->patternString();
+ QString pattern = grepdlg->templateString();
+ if (grepdlg->regexpFlag())
+ pattern.replace(QRegExp("%s"), grepdlg->patternString());
+ else
+ pattern.replace(QRegExp("%s"), escape( grepdlg->patternString() ) );
+ command += KShellProcess::quote(pattern);
+ m_curOutput->startJob("", command);
+
+ m_part->mainWindow()->raiseView(this);
+ m_part->core()->running(m_part, true);
+}
+
+
+void GrepViewWidget::slotExecuted(QListBoxItem* item)
+{
+ ProcessListBoxItem *i = static_cast<ProcessListBoxItem*>(item);
+ if (!i || !i->isCustomItem())
+ return;
+
+ GrepListBoxItem *gi = static_cast<GrepListBoxItem*>(i);
+ m_part->partController()->editDocument( KURL( gi->filename() ), gi->linenumber()-1 );
+}
+
+
+void GrepViewProcessWidget::insertStdoutLine(const QCString &line)
+{
+ int pos;
+ QString filename, linenumber, rest;
+
+ QString str;
+ if( !grepbuf.isEmpty() )
+ {
+ str = QString::fromLocal8Bit( grepbuf+line );
+ grepbuf.truncate( 0 );
+ }else
+ {
+ str = QString::fromLocal8Bit( line );
+ }
+ if ( (pos = str.find(':')) != -1)
+ {
+ filename = str.left(pos);
+ str.remove( 0, pos+1 );
+ if ( ( pos = str.find(':') ) != -1)
+ {
+ linenumber = str.left(pos);
+ str.remove( 0, pos+1 );
+ // filename will be displayed only once
+ // selecting filename will display line 1 of file,
+ // otherwise, line of requested search
+ if ( _lastfilename != filename )
+ {
+ _lastfilename = filename;
+ insertItem(new GrepListBoxItem(filename, "0", str, true));
+ insertItem(new GrepListBoxItem(filename, linenumber, str, false));
+ }
+ else
+ {
+ insertItem(new GrepListBoxItem(filename, linenumber, str, false));
+ }
+ maybeScrollToBottom();
+ }
+ m_matchCount++;
+ }
+}
+
+
+void GrepViewWidget::projectChanged(KDevProject *project)
+{
+ QString dir = project? project->projectDirectory() : QDir::homeDirPath();
+ grepdlg->setDirectory(dir);
+}
+
+void GrepViewWidget::popupMenu(QListBoxItem*, const QPoint& p)
+{
+ if(m_curOutput->isRunning()) return;
+
+ KPopupMenu rmbMenu;
+
+ if(KAction *findAction = m_part->actionCollection()->action("edit_grep"))
+ {
+ rmbMenu.insertTitle(i18n("Find in Files"));
+ findAction->plug(&rmbMenu);
+ rmbMenu.exec(p);
+ }
+}
+
+void GrepViewWidget::slotKeepOutput( )
+{
+ if ( m_lastPattern == QString::null ) return;
+
+ m_tabWidget->changeTab(m_curOutput, m_lastPattern);
+
+ m_curOutput = new GrepViewProcessWidget(m_tabWidget);
+ m_tabWidget->insertTab(m_curOutput, i18n("Search Results"), 0);
+
+ connect( m_curOutput, SIGNAL(clicked(QListBoxItem*)), this, SLOT(slotExecuted(QListBoxItem*)) );
+ connect( m_curOutput, SIGNAL(returnPressed(QListBoxItem*)), this, SLOT(slotExecuted(QListBoxItem*)) );
+ connect( m_curOutput, SIGNAL(processExited(KProcess* )), this, SLOT(slotSearchProcessExited()) );
+ connect( m_curOutput, SIGNAL(contextMenuRequested( QListBoxItem*, const QPoint&)), this, SLOT(popupMenu(QListBoxItem*, const QPoint&)));
+}
+
+void GrepViewWidget::slotCloseCurrentOutput( )
+{
+ ProcessWidget* pw = static_cast<ProcessWidget*>(m_tabWidget->currentPage());
+ if (pw == m_curOutput)
+ return;
+
+ m_tabWidget->removePage(pw);
+ delete pw;
+
+ if (m_tabWidget->count() == 1)
+ m_closeButton->setEnabled( false );
+}
+
+void GrepViewWidget::killJob( int signo )
+{
+ m_curOutput->killJob( signo );
+
+ if (!m_tempFile.name().isEmpty() && m_tempFile.exists())
+ m_tempFile.remove();
+}
+
+bool GrepViewWidget::isRunning( ) const
+{
+ return m_curOutput->isRunning();
+}
+
+void GrepViewWidget::slotOutputTabChanged( )
+{
+ ProcessWidget* pw = static_cast<ProcessWidget*>(m_tabWidget->currentPage());
+ if (pw == m_curOutput)
+ m_closeButton->setEnabled( false );
+ else
+ m_closeButton->setEnabled( true );
+}
+
+void GrepViewWidget::slotSearchProcessExited( )
+{
+ m_part->core()->running(m_part, false);
+
+ if (!m_tempFile.name().isEmpty() && m_tempFile.exists())
+ m_tempFile.remove();
+}
+
+void GrepViewProcessWidget::childFinished( bool normal, int status )
+{
+ // When xargs executes grep several times (because the command line
+ // generated would be too large for a single grep) and one of those
+ // sets of files passed to grep does not contain a match, then an
+ // error status of 123 is set by xargs, even if there is a match in
+ // another set of files.
+ // Reset this false status here.
+
+ if (status == 123 && numRows() > 1)
+ status = 0;
+
+ insertItem(new ProcessListBoxItem(i18n("*** %n match found. ***", "*** %n matches found. ***", m_matchCount), ProcessListBoxItem::Diagnostic));
+ maybeScrollToBottom();
+
+ ProcessWidget::childFinished(normal, status);
+}
+
+void GrepViewProcessWidget::addPartialStdoutLine(const QCString & line)
+{
+ grepbuf += line;
+}
+
+
+#include "grepviewwidget.moc"
diff --git a/parts/grepview/grepviewwidget.h b/parts/grepview/grepviewwidget.h
new file mode 100644
index 00000000..bf3fca4b
--- /dev/null
+++ b/parts/grepview/grepviewwidget.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _GREPVIEWWIDGET_H_
+#define _GREPVIEWWIDGET_H_
+
+#include "processwidget.h"
+#include <qwidget.h>
+#include <qfile.h>
+
+class GrepDialog;
+class GrepViewPart;
+class KDevProject;
+class KTabWidget;
+class QHBoxLayout;
+class QToolButton;
+class GrepViewProcessWidget : public ProcessWidget
+{
+ Q_OBJECT
+public:
+ GrepViewProcessWidget(QWidget* parent) : ProcessWidget(parent) {};
+ ~GrepViewProcessWidget(){};
+ void setMatchCount(int newCount)
+ {
+ m_matchCount = newCount;
+ }
+
+ void incrementMatchCount(uint amount = 1)
+ {
+ m_matchCount += amount;
+ }
+
+ void setLastFileName(const QString& lastFileName)
+ {
+ _lastfilename = lastFileName;
+ }
+
+public slots:
+ virtual void insertStdoutLine(const QCString &line);
+ virtual void addPartialStdoutLine( const QCString &line );
+
+protected:
+ virtual void childFinished(bool normal, int status);
+
+private:
+ int m_matchCount;
+ QString _lastfilename;
+ QCString grepbuf;
+};
+
+class GrepViewWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ GrepViewWidget(GrepViewPart *part);
+ ~GrepViewWidget();
+
+ void projectChanged(KDevProject *project);
+ void killJob( int signo = SIGTERM );
+ bool isRunning() const;
+
+public slots:
+ void showDialog();
+ void showDialogWithPattern(QString pattern);
+
+private slots:
+ void searchActivated();
+ /**
+ * If item is a valid result of a search run, it opens the file at the position, where the stuff was found.
+ * @param item item containing filename and linenumber of the file to open.
+ */
+ void slotExecuted(QListBoxItem *item);
+ void popupMenu(QListBoxItem*, const QPoint& p);
+ /**
+ * Creates a new tab containing the current output in the main tab and clears the main tab.
+ */
+ void slotKeepOutput();
+ /**
+ * Closes the currently active tab, if it is not the main output.
+ */
+ void slotCloseCurrentOutput();
+ /**
+ * Slot reacting on changes of the active tab, to activate/deactivate the close button,
+ * as the main output tab must not be closed.
+ */
+ void slotOutputTabChanged();
+
+ void slotSearchProcessExited();
+
+private:
+
+ QHBoxLayout* m_layout;
+ KTabWidget* m_tabWidget;
+ GrepViewProcessWidget* m_curOutput;
+ GrepDialog *grepdlg;
+ GrepViewPart *m_part;
+ QToolButton* m_closeButton;
+ QString m_lastPattern;
+ QFile m_tempFile;
+};
+
+#endif
diff --git a/parts/grepview/kdevgrepview.desktop b/parts/grepview/kdevgrepview.desktop
new file mode 100644
index 00000000..41661c73
--- /dev/null
+++ b/parts/grepview/kdevgrepview.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Integrates "find|grep" in KDevelop - allows fast searching of multiple files using patterns or regular expressions.
+Comment[ca]=Integra "find|grep" en el KDevelop, permetent la recerca ràpida de diversos fitxers emprant patrons o expressions regulars.
+Comment[da]=Integrerer "find|grep" i KDevelop - tillader hurtig søgning i flere filer ved brug af mønstre eller regulære udtryk.
+Comment[de]=Integration von "find|grep" in KDevelop. - Ermöglicht das schnelle Durchsuchen mehrere Dateien mit Hilfe von Suchmustern und regulären Ausdrücken.
+Comment[el]=Ενσωματώνει τα "find|grep" στο KDevelop - επιτρέπει τη γρήγορη αναζήτηση σε πολλά αρχεία χρησιμοποιώντας μοτίβα ή κανονικές εκφράσεις.
+Comment[es]=Integra «find|grep» en KDevelop, permitiendo la búsqueda rápida de varios archivos utilizando patrones o expresiones regulares.
+Comment[et]=Integreerib KDevelopi programmi "Find|grep", mis lubab mustreid või regulaaravaldisi kasutades kiiresti paljudes failides teksti otsida.
+Comment[eu]="find|grep" KDevelop-en txertatzen du - fitxategi anitzetan eredu edo espresio erregularrak erabiliz bilaketa azkarrak egiteko aukera ematen du.
+Comment[fa]=«find|grep» را در KDevelop مجتمع‌سازی می‌کند. اجازۀ جستجوی سریع پرونده‌های چندگانه را با استفاده از الگوها یا عبارتهای منظم می‌دهد.
+Comment[fr]=Intègre « find|grep » dans KDevelop - permet d'effectuer une recherche rapide dans des fichiers multiples en utilisant des motifs ou des expressions rationnelles.
+Comment[gl]=Integra "find|grep" en KDevelop - permite a procura rápida de varios ficheiros usando patróns ou expresións regulares.
+Comment[hu]=A "find|grep" programok integrálása a KDevelopba - lehetővé teszi szövegek fájlokban való gyors keresését minták és reguláris kifejezések felhasználásával
+Comment[it]=Integra "find|grep" in KDevelop - permette la ricerca rapida di file multipli utilizzando motivi o espressioni regolari.
+Comment[ja]="find|grep" を KDevelop 内に統合し、正規表現やパターンを用いて素早く複数のファイルを検索することを可能にします。
+Comment[ms]=Menggabungkan "find|grep" dalam KDevelop - membenarkan carian pantas beberapa fail menggunakan corak atau regular expression.
+Comment[nds]=Buut "find|grep" na KDevelop in. - Stellt gau Dörsöken vun mehr Dateien mit Söökmustern oder reguleer Utdrück praat.
+Comment[ne]=केडीई विकासमा "find|grep" एकीकरण गर्दछ - जसले नियमित अभिव्यक्ति वा बाँन्की प्रयोग गरेर बहुविध फाइलको छिटो खोजी गर्न अनुमति दिन्छ ।
+Comment[nl]=Integreert "find|grep" in KDevelop - snel zoeken door verschillende bestanden naar patronen of reguliere expressies.
+Comment[pl]=Integracja "find|grep" z KDevelop - pozwala na szybie wyszukiwanie wielu plików przy użyciu wzorców i wyrażeń regularnych.
+Comment[pt]=Integra o "find|grep" no KDevelop - permite a procura rápida em vários ficheiros usando padrões ou expressões regulares.
+Comment[pt_BR]=Integra o "find/grep" no KDevelop - permite busca rápida de múltiplos arquivos usando padrões e expressões regulares.
+Comment[ru]=Интегрирует "find|grep" в KDevelop - позволяет производить быстрый поиск по нескольким файлам с использованием шаблонов или регулярных выражений.
+Comment[sk]=Integruje "find|grep" do Kdevelop - umožní rýchle vyhľadávanie rôznych súborov pomocou vzorov alebo regulárnych výrazov.
+Comment[sr]=Интегрише „find|grep“ у KDevelop — омогућава брзо претраживање више фајлова коришћењем облика имена или регуларних израза.
+Comment[sr@Latn]=Integriše „find|grep“ u KDevelop — omogućava brzo pretraživanje više fajlova korišćenjem oblika imena ili regularnih izraza.
+Comment[sv]=Integrerar "find | grep" med KDevelop - tillåter snabb sökning i flera filer med mönster eller reguljära uttryck.
+Comment[ta]=KDevelopபில் "find|grep" ஒருங்கினை-வடிவங்கள் அல்லது வழக்கமான தொடர்களை பயன்படுத்தி பல்வகை கோப்பினை மிக வேகமாய் தேடலாம்.
+Comment[tg]=Интегралёбии "find|grep" дар KDevelop - бо истифодаи қолиб ё инки баёни ботартиб имкон медиҳад бо якчанд файлҳо ковтуковро барпо намоед.
+Comment[tr]=KDevelop'a "find|grep"i yerleştirir - desen veya düzenli ifadeler kullanılara çoklu dosyalarda hızlı arama sağlar.
+Comment[zh_CN]=在 KDevelop 中集成“查找|grep” - 可以使用模式或正则表达式在多个文件中快速查找。
+Comment[zh_TW]=在 KDevelop 中整合 "find|grep" - 允許使用特定樣式或正規表式示來快速搜尋多個檔案內容。
+Name=KDevGrepView
+Name[da]=KDevelop Grep-visning
+Name[de]=Grep-Ansicht (KDevelop)
+Name[hi]=के-डेव-ग्रेप-व्यू
+Name[nds]=KDevelop-Grepkieker
+Name[pl]=KDevWidokGrep
+Name[sk]=KDev pohľad na grep
+Name[sv]=KDevelop grep-visning
+Name[ta]=KDevGrep காட்சி
+Name[tg]=Намоиши KDevGrep
+Name[tr]=KDevGrepView
+Name[zh_TW]=KDevelop Grep 檢視
+GenericName=Grep Frontend
+GenericName[ca]=Entorn per a grep
+GenericName[da]=Grep-grænseflade
+GenericName[de]=Grep-Ansicht
+GenericName[el]=Πρόγραμμα Grep
+GenericName[es]=Entorno para grep
+GenericName[et]=Programmi grep kasutajaliides
+GenericName[eu]=Grep interfazea
+GenericName[fa]=پایانۀ Grep
+GenericName[fr]=Interface pour Grep
+GenericName[ga]=Comhéadan Grep
+GenericName[gl]=Frontal para Grep
+GenericName[hi]=ग्रेप फ्रन्टएण्ड
+GenericName[hu]=Grafikus felület a Grep-hez
+GenericName[it]=Interfaccia a "grep"
+GenericName[ja]=Grep フロントエンド
+GenericName[ms]=Frontend Grep
+GenericName[nds]=Grep-Böversiet
+GenericName[ne]=ग्रिप फ्रन्टइन्ड
+GenericName[nl]=Grep-frontend
+GenericName[pl]=Interfejs do grepa
+GenericName[pt]=Interface do Grep
+GenericName[pt_BR]=Frontend do Grep
+GenericName[ru]=Интеграция Grep
+GenericName[sk]=Grep rozhranie
+GenericName[sl]=Vmesnik za Grep
+GenericName[sr]=Кориснички интерфејс за grep
+GenericName[sr@Latn]=Korisnički interfejs za grep
+GenericName[sv]=Gränssnitt till grep
+GenericName[ta]=Grep முன் பகுதி
+GenericName[tg]=Интегратсияи Grep
+GenericName[tr]=Grep Önucu
+GenericName[zh_CN]=Grep 前端
+GenericName[zh_TW]=Grep 前端介面
+Icon=find
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevgrepview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=FileSearch
diff --git a/parts/grepview/kdevgrepview.rc b/parts/grepview/kdevgrepview.rc
new file mode 100644
index 00000000..80b20389
--- /dev/null
+++ b/parts/grepview/kdevgrepview.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevGrepView" version="1">
+<MenuBar>
+ <Menu name="edit">
+ <Action name="edit_grep" group="kdev_edit_find_merge"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/konsole/Makefile.am b/parts/konsole/Makefile.am
new file mode 100644
index 00000000..b0faabf9
--- /dev/null
+++ b/parts/konsole/Makefile.am
@@ -0,0 +1,16 @@
+# Here resides the konsole view part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevkonsoleview.la
+libkdevkonsoleview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevkonsoleview_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/util/libkdevutil.la
+
+libkdevkonsoleview_la_SOURCES = konsoleviewpart.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevkonsoleview.desktop
+
diff --git a/parts/konsole/README.dox b/parts/konsole/README.dox
new file mode 100644
index 00000000..67641ebb
--- /dev/null
+++ b/parts/konsole/README.dox
@@ -0,0 +1,49 @@
+/** \class KonsoleViewPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/konsole/kdevkonsoleview.desktop b/parts/konsole/kdevkonsoleview.desktop
new file mode 100644
index 00000000..789f76a6
--- /dev/null
+++ b/parts/konsole/kdevkonsoleview.desktop
@@ -0,0 +1,86 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin gives KDevelop an embedded konsole for quick and easy command line access.
+Comment[ca]=Aquest connector ofereix a KDevelop una konsola encastada per a facilitar l'accés a la línia de comandaments.
+Comment[da]=Dette plugin giver KDevelop en indlejret terminal for hurtig og nem kommandolinjeadgang.
+Comment[de]=Dieses Modul stellt eine eingebettete Konsole für den schnellen und einfachen Zugriff auf die Kommandozeile zur Verfügung.
+Comment[el]=Αυτό το πρόσθετο προσφέρει στο KDevelop μια ενσωματωμένη konsole για γρήγορη και εύκολη πρόσβαση σε γραμμή εντολών.
+Comment[es]=Este complemento proporciona a KDevelop una consola empotrada para facilitar el acceso a la línea de órdenes.
+Comment[et]=See plugin lisab KDevelopile võimaluse põimitult kasutada konsooli käsurea võimaluste kiireks ja hõlpsaks pruukimiseks.
+Comment[eu]=Plugin honek KDevelop-i komando-lerroak azkar eta erraz sartzeko kapsultatutako kontsola bat eskeintzen dio.
+Comment[fa]=این وصله برای دستیابی سریع و آسان به خط فرمان، به KDevelop یک konsole نهفته می‌دهد.
+Comment[fr]=Ce module externe offre à KDevelop une Konsole intégrée permettant un accès à la ligne de commande rapide et facile.
+Comment[gl]=Esta extensión engade a KDevelop unha konsole incrustada para un rápido e sinxelo acceso a liña de comandos.
+Comment[hu]=Ez a bővítőmodul egy könnyen elérhető, beágyazott parancssort hoz létre a KDevelopon belül.
+Comment[it]=Questo plugin offre una console integrata per KDevelop per l'accesso rapido e semplice alla linea di comando.
+Comment[ja]=このプラグインは、KDevelop に迅速で容易なコマンドラインアクセス用の埋め込まれた konsole を与えます。
+Comment[ms]=Plugin ini memberikan KDevelop konsol embedded untuk akses arahan baris yang cepat dan mudah.
+Comment[nds]=Dit Moduul stellt för't gaue un eenfache Togriepen op de Befehlsreeg en inbett Konsole för KDevelop praat.
+Comment[ne]=यो प्लगइनले छिटो र सजिलो आदेशरेखा पहुँचका लागि केडीई विकासमा सम्मिलित कन्सोल प्रदान गर्दछ ।
+Comment[nl]=Deze plugin geeft KDevelop een ingebedde Konsole voor snelle toegang tot de commandoregel.
+Comment[pl]=Ta wtyczka dodaje do KDevelopa wbudowaną konsolę umożliwiając szybki i łatwy dostęp do linii komend.
+Comment[pt]=Este 'plugin' dá ao KDevelop um Konsole incorporado para um acesso rápido e simples à linha de comandos.
+Comment[pt_BR]=Este plug-in fornece ao KDevelop um konsole embutido para acesso rápido e fácil à linha de comando.
+Comment[ru]=Предоставляет встроенную консоль для быстрого вызова командной строки.
+Comment[sk]=Modul vložiteľnej konzoly do Kdevelop pre rýchly a jednoduchý prístup k príkazovému riadku.
+Comment[sr]=Овај прикључак даје KDevelop-у уграђену конзолу за брз и лак приступ командној линији.
+Comment[sr@Latn]=Ovaj priključak daje KDevelop-u ugrađenu konzolu za brz i lak pristup komandnoj liniji.
+Comment[sv]=Insticksprogrammet ger KDevelop en inbyggd terminal för snabb och enkel åtkomst av kommandoraden.
+Comment[ta]=இந்த சொருகி உங்களுக்கு Kஉருவாக்கத்திற்கு கன்சோல் உட்பொதியின் மூலம் விரைவு மற்றும் எளிய கட்டளை வரி அனுமதி தரும்.
+Comment[tg]=Барои тез фарёд намудани фармони сатр рафаки бино карда шударо имкон медиҳад.
+Comment[tr]=Bu eklenti, KDevelop'a hızlı komut satırı erişimi için gömülü bir terminal verir.
+Comment[zh_CN]=这个插件为 KDevelop 提供KDE终端来快速和方便使用命令行。
+Comment[zh_TW]=此外掛程式提供 KDevelop 嵌入式的主控台,可以快速使用命令列。
+Name=KDevKonsoleView
+Name[da]=KDevelop Konsole-visning
+Name[de]=Unterstützung für Konsole (KDevelop)
+Name[hi]=के-डेव-कंसोल-व्यू
+Name[nds]=KDevelop-Konsoleünnerstütten
+Name[pl]=KDevWidokKonsoli
+Name[sk]=KDev pohľad na konzolu
+Name[sv]=KDevelop terminalvy
+Name[ta]=KDevKonsole காட்சி
+Name[tg]=Намоиши KDevKonsole
+Name[zh_TW]=KDevelop 主控台檢視
+GenericName=Embedded Konsole
+GenericName[br]=Konsole enframmet
+GenericName[ca]=Konsola encastada
+GenericName[da]=Indlejret konsole
+GenericName[de]=Eingebettete Konsole
+GenericName[el]=Ενσωματωμένη Konsole
+GenericName[es]=Consola empotrada
+GenericName[et]=Põimitud Konsool
+GenericName[eu]=Konsole kapsulatua
+GenericName[fa]=Konsole نهفته
+GenericName[fr]=Konsole intégrée
+GenericName[ga]=Konsole Leabaithe
+GenericName[gl]=Konsole incrustada
+GenericName[hi]=अंतर्निर्मित कंसोल
+GenericName[hu]=Beágyazott Konsole
+GenericName[it]=Konsole integrata
+GenericName[ja]=埋め込まれた Konsole
+GenericName[ms]=Konsol Embedded
+GenericName[nds]=Inbett Konsole
+GenericName[ne]=सम्मिलित कन्सोल
+GenericName[nl]=Ingebedde Konsole
+GenericName[pl]=Wbudowana konsola
+GenericName[pt]=Konsole Embebida
+GenericName[pt_BR]=Konsole Embutido
+GenericName[ru]=Встроенная консоль
+GenericName[sk]=Vložiteľná konzola
+GenericName[sl]=Vključena Konzola
+GenericName[sr]=Уграђена конзола
+GenericName[sr@Latn]=Ugrađena konzola
+GenericName[sv]=Inbäddad terminal
+GenericName[ta]=கன்சோல் உட்பொதி
+GenericName[tg]=Бино намудани Embedded
+GenericName[tr]=Gömülü Terminal
+GenericName[zh_CN]=嵌入的 Konsole
+GenericName[zh_TW]=嵌入式主控台
+Icon=konsole
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevkonsoleview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=Console
diff --git a/parts/konsole/konsoleviewpart.cpp b/parts/konsole/konsoleviewpart.cpp
new file mode 100644
index 00000000..8d7892a5
--- /dev/null
+++ b/parts/konsole/konsoleviewpart.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "konsoleviewpart.h"
+
+#include <qwhatsthis.h>
+
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevplugininfo.h"
+#include "kdevshellwidget.h"
+
+
+typedef KDevGenericFactory<KonsoleViewPart> KonsoleViewFactory;
+static const KDevPluginInfo data("kdevkonsoleview");
+K_EXPORT_COMPONENT_FACTORY(libkdevkonsoleview, KonsoleViewFactory(data))
+
+KonsoleViewPart::KonsoleViewPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "KonsoleViewPart")
+{
+ setInstance( KonsoleViewFactory::instance() );
+
+ m_widget = new KDevShellWidget( 0, "konsole widget" );
+
+ QWhatsThis::add(m_widget, i18n("<b>Konsole</b><p>"
+ "This window contains an embedded konsole window. It will try to follow you when "
+ "you navigate in the source directories")
+ );
+
+ m_widget->setIcon( SmallIcon("konsole") );
+ m_widget->setCaption(i18n("Konsole"));
+
+ m_widget->activate();
+ m_widget->setAutoReactivateOnClose( true );
+
+ mainWindow()->embedOutputView(m_widget, i18n("Konsole"), i18n("Embedded console window"));
+
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+}
+
+
+KonsoleViewPart::~KonsoleViewPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+}
+
+void KonsoleViewPart::projectOpened()
+{
+ QString cd_projectdir = QString("cd ") + project()->projectDirectory() + "\n";
+ m_widget->sendInput( cd_projectdir );
+}
+
+
+#include "konsoleviewpart.moc"
diff --git a/parts/konsole/konsoleviewpart.h b/parts/konsole/konsoleviewpart.h
new file mode 100644
index 00000000..b7cea9d8
--- /dev/null
+++ b/parts/konsole/konsoleviewpart.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __KONSOLEVIEWPART_H__
+#define __KONSOLEVIEWPART_H__
+
+
+#include <qguardedptr.h>
+#include "kdevplugin.h"
+
+
+class KDevShellWidget;
+
+class KonsoleViewPart : public KDevPlugin
+{
+ Q_OBJECT
+public:
+ KonsoleViewPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~KonsoleViewPart();
+
+private slots:
+ void projectOpened();
+
+private:
+ QGuardedPtr<KDevShellWidget> m_widget;
+};
+
+#endif
diff --git a/parts/konsole/konsoleviewwidget.cpp b/parts/konsole/konsoleviewwidget.cpp
new file mode 100644
index 00000000..e7a84d94
--- /dev/null
+++ b/parts/konsole/konsoleviewwidget.cpp
@@ -0,0 +1,124 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qframe.h>
+#include <qdir.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "konsoleviewpart.h"
+#include "kdevpartcontroller.h"
+
+#include "konsoleviewwidget.h"
+
+KonsoleViewWidget::KonsoleViewWidget(KonsoleViewPart *part)
+ : QWidget(0, "konsole widget"), part(0), owner( part )
+{
+ connect(part->partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(activePartChanged(KParts::Part*)));
+ vbox = new QVBoxLayout(this);
+}
+
+KonsoleViewWidget::~KonsoleViewWidget()
+{
+}
+
+void KonsoleViewWidget::show()
+{
+ activate();
+ QWidget::show();
+}
+
+void KonsoleViewWidget::activate()
+{
+ kdDebug(9035) << k_funcinfo << endl;
+ if (part)
+ return;
+
+ KLibFactory *factory = KLibLoader::self()->factory("libkonsolepart");
+ if (!factory)
+ return;
+
+ part = (KParts::ReadOnlyPart *) factory->create(this);
+ if (!part)
+ return;
+
+ part->widget()->setFocusPolicy(QWidget::WheelFocus);
+ setFocusProxy(part->widget());
+ part->widget()->setFocus();
+
+ if (part->widget()->inherits("QFrame"))
+ ((QFrame*)part->widget())->setFrameStyle(QFrame::Panel|QFrame::Sunken);
+
+ vbox->addWidget(part->widget());
+
+// this->activePartChanged( owner->partController()->activePart() );
+ part->widget()->show();
+
+ connect(part, SIGNAL(destroyed()), this, SLOT(partDestroyed()));
+}
+
+
+void KonsoleViewWidget::activePartChanged(KParts::Part *activatedPart)
+{
+ kdDebug(9035) << k_funcinfo << endl;
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(activatedPart);
+
+ if (ro_part && !ro_part->url().isLocalFile())
+ {
+ kdDebug(9035) << k_funcinfo << "part is null or not local" << endl;
+ return;
+ }
+ QString dir;
+ if (ro_part)
+ dir = ro_part->url().directory();
+ else if (owner->project())
+ dir = owner->project()->projectDirectory();
+
+ kdDebug(9035) << k_funcinfo "Changing dir to " << dir << endl;
+ if (dir.isEmpty())
+ return;
+ setDirectory( KURL(dir) );
+}
+
+void KonsoleViewWidget::setDirectory(const KURL &dirUrl)
+{
+ kdDebug(9035) << k_funcinfo << "part is " << (long)part << endl;
+
+ if (part && dirUrl != part->url())
+ {
+ kdDebug(9035) << k_funcinfo << "Changing dirUrl.path() == " << dirUrl.path() << endl;
+ kdDebug(9035) << k_funcinfo << "Changing part->url.path() == " << part->url().path() << endl;
+ KConfig* config = kapp->config();
+
+ kdDebug(9035) << k_funcinfo << "SyncTerminalEmulator: " << config->readBoolEntry("SyncTerminalEmulator") << endl;
+
+ if (config->readBoolEntry("SyncTerminalEmulator")) {
+ part->openURL( dirUrl );
+ }
+ }
+}
+
+void KonsoleViewWidget::partDestroyed()
+{
+ part = 0;
+ activate();
+}
+
+
+#include "konsoleviewwidget.moc"
diff --git a/parts/konsole/konsoleviewwidget.h b/parts/konsole/konsoleviewwidget.h
new file mode 100644
index 00000000..0236dee4
--- /dev/null
+++ b/parts/konsole/konsoleviewwidget.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __KONSOLEVIEWWIDGET_H__
+#define __KONSOLEVIEWWIDGET_H__
+
+
+#include <qwidget.h>
+#include <qstring.h>
+
+
+class KDevProject;
+class KonsoleWidgetPrivate;
+class KonsoleViewPart;
+namespace KParts {
+ class ReadOnlyPart;
+ class Part;
+}
+class QVBoxLayout;
+
+
+class KonsoleViewWidget : public QWidget
+{
+ Q_OBJECT
+public:
+ KonsoleViewWidget(KonsoleViewPart *part);
+ virtual ~KonsoleViewWidget();
+
+ virtual void show();
+
+public slots:
+ void setDirectory(const KURL &dirUrl);
+
+private slots:
+ void activePartChanged(KParts::Part *activatedPart);
+ void partDestroyed();
+
+private:
+ void activate();
+
+ KParts::ReadOnlyPart *part;
+ QVBoxLayout *vbox;
+ KonsoleViewPart *owner;
+};
+
+
+#endif
diff --git a/parts/openwith/Makefile.am b/parts/openwith/Makefile.am
new file mode 100644
index 00000000..59bf6185
--- /dev/null
+++ b/parts/openwith/Makefile.am
@@ -0,0 +1,15 @@
+# Here resides the openwith part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevopenwith.la
+libkdevopenwith_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevopenwith_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevopenwith_la_SOURCES = openwithpart.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevopenwith.desktop
+
diff --git a/parts/openwith/README.dox b/parts/openwith/README.dox
new file mode 100644
index 00000000..c729ad92
--- /dev/null
+++ b/parts/openwith/README.dox
@@ -0,0 +1,52 @@
+/** \class OpenWithPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/openwith/kdevopenwith.desktop b/parts/openwith/kdevopenwith.desktop
new file mode 100644
index 00000000..fcc7134c
--- /dev/null
+++ b/parts/openwith/kdevopenwith.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin provides additional "open" alternatives for various context menus in KDevelop.
+Comment[ca]=Aquest connector proporciona alternatives "open" addicionals per a diversos menús de context a KDevelop.
+Comment[da]=Dette plugin sørger for yderligere "åbne" alternativer for forskellige sammenhængsmenuer i KDevelop.
+Comment[de]=Dieses Modul stellt in vielen Kontextmenüs Alternativen für den Menüpunkt "Öffnen" zur Verfügung.
+Comment[el]=Αυτό το πρόσθετο προσφέρει εναλλακτικές επιλογές "ανοίγματος" για διάφορα σχετικά μενού στο KDevelop.
+Comment[es]=Este complemento proporciona alternativas de «abrir» adicionales en varios menús contextuales de KDevelop.
+Comment[et]=See plugin lisab KDevelopi erinevatele kontekstimenüüdele täiendavaid faili avamise võimalusi.
+Comment[eu]=Plugin honek KDevelop-eko testuinguru menu hainbatentzat beste "ireki" aukera eskeintzen dizkie.
+Comment[fa]=این وصله، انتخابهای »باز کردن« اضافی را برای گزینگان متن مختلف در KDevelop فراهم می‌کند.
+Comment[fr]=Ce module externe fournit des alternatives « ouvertes » supplémentaires pour divers menus contextuels dans KDevelop.
+Comment[gl]=Esta extensión proporciona alternativas "abrir" adicionais a varios menús de contexto de KDevelop.
+Comment[hu]=Ez a bővítőmodul további megnyitási lehetőségeket hoz létre a KDevelop felbukkanó menüiben.
+Comment[it]=Questo plugin offre alternative aggiuntive per "Apri" per i vari menu contestuali di KDevelop.
+Comment[ja]=このプラグインは、KDevelop の中のさまざまなコンテキストメニューに追加の「開く」選択肢を供給します。
+Comment[ms]=Plugin ini menyediakan alternatif "buka" tambahan untuk pelbagai menu konteks dalam KDevelop.
+Comment[nds]=Dit Moduul stellt för en Reeg Rechtsklickmenüs in KDevelop mehr Mööglichkeiten för "Opmaken" praat.
+Comment[ne]=यो प्लगइनले केडीई विकासमा विविध प्रसङ्ग मेनुका लागि अतिरिक्त "खोल्नुहोस्" विकल्प प्रदान गर्दछ ।
+Comment[nl]=Deze plugin biedt extra "open"-alternatieven in verschillende contextmenus in KDevelop.
+Comment[pl]=Ta wtyczka umożliwia dodanie dodatkowych możliwości otwierania plików w menu kontekstowych KDevelopa.
+Comment[pt]=Este 'plugin' oferece várias alternativas adicionais e "abertas" para vários menus de contexto no KDevelop.
+Comment[pt_BR]=Este plug-in fornece alternativas adicionais de "abrir" para vários menus de contetxo do KDevelop.
+Comment[ru]=Этот модуль предоставляет различные возможности открытия файлов, используя контекстные меню KDevelop.
+Comment[sk]=Modul poskytuje dodatočné "Otvoriť pomocou" alternatívy pre rôzne kontextové menu v KDevelop.
+Comment[sr]=Овај прикључак обезбеђује додатне алтернативе за „отвори“ за различите контекстне меније у kdevelop-у.
+Comment[sr@Latn]=Ovaj priključak obezbeđuje dodatne alternative za „otvori“ za različite kontekstne menije u kdevelop-u.
+Comment[sv]=Insticksprogrammet tillhandahåller ytterligare "öppna" alternativ i diverse sammanhangsberoende menyer i KDevelop.
+Comment[ta]=இந்த சொருகி Kஉருவாக்கியில் உள்ள வெவ்வேறு சூழுல் பட்டியலிற்கு பதில் "open" என்ற கூடுதல் வசதி தரும்.
+Comment[tg]=Ин модул як чанд хел кушодани файлҳоро имкон медиҳад, ҳангоми истифода намудани KDevelop.
+Comment[tr]=Bu eklenti, KDevelop'taki bir çok bağlam menüleri için fazladan "aç" alternatifleri sunar.
+Comment[zh_CN]=这个插件在 KDevelop 多个上下文菜单中提供“打开”菜单项。
+Comment[zh_TW]=此外掛程式提供 KDevelop 額外的「開啟方式」選單。
+Name=KDevOpenWith
+Name[da]=KDevelop Åbn med
+Name[de]="Öffnen mit"-Menüerweiterung (KDevelop)
+Name[hi]=के-डेव-ओपन-विथ
+Name[nds]=KDevelop-"Opmaken mit"-Menüverwiedern
+Name[pl]=KDevOtwórzW
+Name[sk]=KDev otvoriť pomocou
+Name[sv]=KDevelop öppna med
+Name[ta]=KDev வைத்து திற
+Name[tg]=Кушодани аз рӯи KDev
+Name[zh_TW]=KDevelop 開啟方式
+GenericName="Open with" Menu Addon
+GenericName[ca]=Afegit de menú "Obre amb"
+GenericName[da]="Åbn med" menu-tilføjelse
+GenericName[de]=Menüerweiterung "Öffnen mit"
+GenericName[el]=Πρόσθετο μενού "Άνοιγμα με"
+GenericName[es]=Extensión de menú «Abrir con»
+GenericName[et]=Menüü "Ava kasutades" lisamine
+GenericName[eu]="Ireki honekin" menu gehigarria
+GenericName[fa]=»باز کردن با« افزودن گزینگان
+GenericName[fr]=Extension de menu « Ouvrir avec... »
+GenericName[gl]=Engadido "Abrir con" para menús
+GenericName[hu]="Megnyitás ezzel" menübővítés
+GenericName[it]=Aggiunta al menu della voce "Apri con"
+GenericName[ja]=「アプリケーションで開く」メニューアドオン
+GenericName[nds]=Menüverwiedern "Opmaken mit"
+GenericName[ne]="यससँग खोल्नुहोस्" मेनु एडअन
+GenericName[nl]="Openen met" menutoevoeging
+GenericName[pl]=Dodatek do menu "Otwórz za pomocą"
+GenericName[pt]=Extra do Menu "Abrir com"
+GenericName[pt_BR]=Addon de Menu "Abrir com"
+GenericName[ru]=Дополнение меню "Открыть с помощью"
+GenericName[sk]="Otvoriť pomocou" prídavok k menu
+GenericName[sl]=Menijski dodatek »Odpri z«
+GenericName[sr]=Додатак за мени „Отвори помоћу“
+GenericName[sr@Latn]=Dodatak za meni „Otvori pomoću“
+GenericName[sv]=Menytillägg till "Öppna med"
+GenericName[ta]="Open with" பட்டியல் அடான்
+GenericName[tg]=Менюи иловагӣ "Кушодан бо фармони Ёрӣ"
+GenericName[tr]="Birlikte Aç" Menü Eki
+GenericName[zh_CN]=“打开方式”菜单项
+GenericName[zh_TW]="開啟方式"選單
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevopenwith
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=GlobalFileManagement,FileOpenWith
diff --git a/parts/openwith/openwithpart.cpp b/parts/openwith/openwithpart.cpp
new file mode 100644
index 00000000..4ff33ffb
--- /dev/null
+++ b/parts/openwith/openwithpart.cpp
@@ -0,0 +1,138 @@
+#include "openwithpart.h"
+
+#include <qfile.h>
+
+#include <kpopupmenu.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kmimetype.h>
+#include <ktrader.h>
+#include <krun.h>
+#include <kaction.h>
+#include <kcharsets.h>
+
+#include "kdevpartcontroller.h"
+#include "kdevcore.h"
+#include "kdevplugininfo.h"
+#include "urlutil.h"
+
+typedef KDevGenericFactory<OpenWithPart> OpenWithFactory;
+
+static const KDevPluginInfo data("kdevopenwith");
+K_EXPORT_COMPONENT_FACTORY(libkdevopenwith, OpenWithFactory(data))
+
+OpenWithPart::OpenWithPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "OpenWithPart")
+{
+ setInstance( OpenWithFactory::instance() );
+
+ connect(core(), SIGNAL(contextMenu(QPopupMenu*,const Context *)),
+ this, SLOT(fillContextMenu(QPopupMenu*,const Context *)));
+}
+
+
+OpenWithPart::~OpenWithPart()
+{
+}
+
+
+void OpenWithPart::fillContextMenu(QPopupMenu *popup, const Context *context)
+{
+ if ( !context->hasType( Context::FileContext ) ) return;
+
+ const FileContext *ctx = static_cast<const FileContext*>(context);
+ m_urls = ctx->urls();
+
+ popup->insertSeparator();
+
+ popup->insertItem( i18n("Open as UTF-8"), this, SLOT(openAsUtf8()) );
+
+ KPopupMenu * openAsPopup = new KPopupMenu( popup );
+
+ int id = popup->insertItem( i18n("Open As"), openAsPopup );
+ popup->setWhatsThis(id, i18n("<b>Open As</b><p>Lists all encodings that can be used to open the selected file."));
+
+ QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames();
+
+ int i = 0;
+ QStringList::const_iterator it = encodings.constBegin();
+ while ( it != encodings.constEnd() )
+ {
+ openAsPopup->insertItem( *it, this, SLOT(openAsEncoding(int)), 0, i );
+ ++it;
+ i++;
+ }
+
+ KPopupMenu * openWithPopup = new KPopupMenu( popup );
+
+ // hmmm.. what to do here? open every different mimetype seperately? Just go with the first for now..
+ QString mimeType = KMimeType::findByURL(m_urls.first(), 0, true, true)->name();
+ KTrader::OfferList offers = KTrader::self()->query(mimeType, "Type == 'Application'");
+ if (offers.count() > 0)
+ {
+ KTrader::OfferList::Iterator it;
+ for (it = offers.begin(); it != offers.end(); ++it)
+ {
+ KAction *action = new KAction((*it)->name(), (*it)->icon(), 0, 0, QFile::encodeName( (*it)->desktopEntryPath() ).data());
+ connect(action, SIGNAL(activated()), this, SLOT(openWithService()));
+ action->plug( openWithPopup );
+ }
+ }
+
+ id = popup->insertItem( i18n("Open With"), openWithPopup );
+ popup->setWhatsThis(id, i18n("<b>Open With</b><p>Lists all applications that can be used to open the selected file."));
+
+ openWithPopup->insertSeparator();
+
+ // make sure the generic "Open with ..." entry gets appended to the submenu
+ id = openWithPopup->insertItem(i18n("Open With..."), this, SLOT(openWithDialog()));
+ openWithPopup->setWhatsThis(id, i18n("<b>Open With...</b><p>Provides a dialog to choose the application to open the selected file."));
+}
+
+
+void OpenWithPart::openWithService()
+{
+ KService::Ptr ptr = KService::serviceByDesktopPath(sender()->name());
+ if (ptr)
+ {
+ KRun::run(*ptr, m_urls);
+ }
+}
+
+
+void OpenWithPart::openWithDialog()
+{
+ KRun::displayOpenWithDialog( m_urls );
+}
+
+
+void OpenWithPart::openAsEncoding( int id )
+{
+ QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames();
+ QString encoding;
+ if ( id <= encodings.count() && id >= 0 )
+ {
+ encoding = KGlobal::charsets()->encodingForName( encodings[ id ] );
+ }
+
+ KURL::List::iterator it = m_urls.begin();
+ while ( it != m_urls.end() )
+ {
+ partController()->setEncoding( encoding );
+ partController()->editDocument( *it );
+ ++it;
+ }
+}
+
+void OpenWithPart::openAsUtf8( )
+{
+ KURL::List::iterator it = m_urls.begin();
+ while ( it != m_urls.end() )
+ {
+ partController()->setEncoding( "utf8" );
+ partController()->editDocument( *it );
+ ++it;
+ }
+}
+
+#include "openwithpart.moc"
diff --git a/parts/openwith/openwithpart.h b/parts/openwith/openwithpart.h
new file mode 100644
index 00000000..c79ad164
--- /dev/null
+++ b/parts/openwith/openwithpart.h
@@ -0,0 +1,36 @@
+#ifndef __OPENWITHPART_H__
+#define __OPENWITHPART_H__
+
+#include <kurl.h>
+
+#include "kdevplugin.h"
+
+class QPopupMenu;
+class Context;
+
+
+class OpenWithPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ OpenWithPart(QObject *parent, const char *name, const QStringList &);
+ ~OpenWithPart();
+
+
+private slots:
+
+ void fillContextMenu(QPopupMenu *popup, const Context *context);
+
+ void openWithService();
+ void openWithDialog();
+ void openAsEncoding(int id);
+ void openAsUtf8();
+
+private:
+
+ KURL::List m_urls;
+};
+
+#endif
diff --git a/parts/outputviews/Makefile.am b/parts/outputviews/Makefile.am
new file mode 100644
index 00000000..81b7ca4e
--- /dev/null
+++ b/parts/outputviews/Makefile.am
@@ -0,0 +1,35 @@
+# Here reside the output view and make view parts.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extensions/dcop -I$(top_srcdir)/lib/util \
+ -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevmakeview.la libkdevappview.la
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevappoutputview.desktop kdevmakeview.desktop
+
+rc1dir = $(kde_datadir)/kdevappoutputview
+rc1_DATA = kdevmakeview.rc
+
+rc2dir = $(kde_datadir)/kdevmakeview
+rc2_DATA = kdevmakeview.rc
+
+noinst_HEADERS = filterdlg.h
+
+libkdevmakeview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevmakeview_la_LIBADD = $(top_builddir)/lib/widgets/libkdevwidgets.la \
+ $(top_builddir)/lib/interfaces/extensions/dcop/libkdevdcopextensions.la $(top_builddir)/lib/libkdevelop.la \
+ $(LIB_KHTML) $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+libkdevmakeview_la_SOURCES = makeviewpart.cpp makewidget.cpp \
+ directorystatusmessagefilter.cpp outputfilter.cpp compileerrorfilter.cpp commandcontinuationfilter.cpp \
+ makeitem.cpp makeactionfilter.cpp otherfilter.cpp
+
+libkdevappview_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevappview_la_LIBADD = $(top_builddir)/lib/widgets/libkdevwidgets.la \
+ $(top_builddir)/lib/interfaces/extensions/dcop/libkdevdcopextensions.la $(top_builddir)/lib/libkdevelop.la \
+ $(LIB_KHTML) $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+libkdevappview_la_SOURCES = appoutputviewpart.cpp appoutputwidget.cpp \
+ filterdlg.ui
diff --git a/parts/outputviews/README.dox b/parts/outputviews/README.dox
new file mode 100644
index 00000000..6e17bea3
--- /dev/null
+++ b/parts/outputviews/README.dox
@@ -0,0 +1,16 @@
+/** \class MakeViewPart
+Two output views: one displays compiler output, the other displays the application output.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\feature Auto scroll down
+\feature Auto hide when it's not needed
+\feature Jump to error when clicked
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=outputviews&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">outputviews component at Bugzilla database</a>
+
+\todo Make the contents of the application output copyable.
+
+\faq <b>How does the auto-hide feature work?</b> If there are no compilation errors the output view hides itself (if it was hidden before compilation start) or switches to the previously selected view.
+
+*/
diff --git a/parts/outputviews/appoutputviewpart.cpp b/parts/outputviews/appoutputviewpart.cpp
new file mode 100644
index 00000000..79a62471
--- /dev/null
+++ b/parts/outputviews/appoutputviewpart.cpp
@@ -0,0 +1,178 @@
+/***************************************************************************
+ * Copyright (C) 1999-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "appoutputviewpart.h"
+
+#include <qwhatsthis.h>
+#include <qdir.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kiconloader.h>
+#include <kparts/part.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <kapplication.h>
+
+#include "kdevproject.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "appoutputwidget.h"
+#include "kdevpartcontroller.h"
+#include "settings.h"
+
+static const KDevPluginInfo data("kdevappoutputview");
+typedef KDevGenericFactory< AppOutputViewPart > AppViewFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevappview, AppViewFactory( data ) )
+
+AppOutputViewPart::AppOutputViewPart(QObject *parent, const char *name, const QStringList &)
+ : KDevAppFrontend(&data, parent, name ? name : "AppOutputViewPart")
+{
+ setInstance(AppViewFactory::instance());
+
+ m_dcop = new KDevAppFrontendIface(this);
+
+ m_widget = new AppOutputWidget(this);
+ m_widget->setIcon( SmallIcon("openterm") );
+ m_widget->setCaption(i18n("Application Output"));
+ QWhatsThis::add(m_widget, i18n("<b>Application output</b><p>"
+ "The stdout/stderr output window is a replacement for "
+ "terminal-based application communication. Running terminal "
+ "applications use this instead of a terminal window."));
+
+ mainWindow()->embedOutputView(m_widget, i18n("Application"), i18n("Output of the executed user program"));
+ hideView();
+
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
+ connect(m_widget, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcessExited()));
+ connect(m_widget, SIGNAL(processExited(KProcess*)), SIGNAL(processExited()));
+}
+
+
+AppOutputViewPart::~AppOutputViewPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+ delete m_dcop;
+}
+
+void AppOutputViewPart::slotStopButtonClicked( KDevPlugin* which )
+{
+ if ( which != 0 && which != this )
+ return;
+ stopApplication();
+}
+
+void AppOutputViewPart::stopApplication()
+{
+ m_widget->killJob();
+
+ core()->running( this, false );
+}
+
+void AppOutputViewPart::slotProcessExited()
+{
+ core()->running( this, false );
+ if ( partController()->activePart() && partController()->activePart()->widget() )
+ partController()->activePart()->widget()->setFocus();
+}
+
+/**
+ * If directory is empty it will use the user's home directory.
+ * If inTerminal is true, the program is started in an external
+ * konsole.
+ */
+void AppOutputViewPart::startAppCommand(const QString &directory, const QString &program, bool inTerminal)
+{
+ QString cmd;
+
+ if (inTerminal) {
+ cmd = Settings::terminalEmulatorName( *kapp->config() );
+ if ( cmd == "konsole" && !directory.isNull() ) { // isn't setting the working directory below enough?
+ // If a directory was specified, use it
+ cmd += QString(" --workdir '%1'").arg(directory);
+ }
+ cmd += " -e /bin/sh -c '";
+ cmd += program;
+ cmd += "; echo \"";
+ cmd += i18n("Press Enter to continue!");
+ cmd += "\";read dummy'";
+ } else
+ cmd = program;
+
+ m_widget->clearViewAndContents();
+
+ if ( directory.isNull() )
+ // use the user's home directory
+ m_widget->startJob(QDir::homeDirPath(), cmd);
+ else
+ // use the supplied directory
+ m_widget->startJob(directory, cmd);
+
+ core()->running( this, true );
+
+ showView();
+ mainWindow()->raiseView(m_widget);
+}
+
+
+bool AppOutputViewPart::isRunning()
+{
+ return m_widget->isRunning();
+}
+
+
+void AppOutputViewPart::insertStdoutLine(const QCString &line)
+{
+ m_widget->insertStdoutLine(line);
+}
+
+
+void AppOutputViewPart::insertStderrLine(const QCString &line)
+{
+ m_widget->insertStderrLine(line);
+}
+
+void AppOutputViewPart::clearView()
+{
+ m_widget->clearViewAndContents();
+}
+
+void AppOutputViewPart::hideView()
+{
+ m_viewIsVisible = false;
+ mainWindow()->setViewAvailable( m_widget, m_viewIsVisible );
+}
+
+void AppOutputViewPart::showView()
+{
+ m_viewIsVisible = true;
+ mainWindow()->setViewAvailable( m_widget, m_viewIsVisible );
+}
+
+bool AppOutputViewPart::isViewVisible()
+{
+ return m_viewIsVisible;
+}
+
+void AppOutputViewPart::addPartialStderrLine(const QCString & line)
+{
+ m_widget->addPartialStderrLine(line);
+}
+
+void AppOutputViewPart::addPartialStdoutLine(const QCString & line)
+{
+ m_widget->addPartialStdoutLine(line);
+}
+
+#include "appoutputviewpart.moc"
diff --git a/parts/outputviews/appoutputviewpart.h b/parts/outputviews/appoutputviewpart.h
new file mode 100644
index 00000000..76d708f9
--- /dev/null
+++ b/parts/outputviews/appoutputviewpart.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 1999-2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _APPOUTPUTVIEWSPART_H_
+#define _APPOUTPUTVIEWSPART_H_
+
+#include <qguardedptr.h>
+
+#include "kdevappfrontend.h"
+#include "KDevAppFrontendIface.h"
+
+
+class AppOutputWidget;
+
+class AppOutputViewPart : public KDevAppFrontend
+{
+ Q_OBJECT
+
+public:
+ AppOutputViewPart( QObject *parent, const char *name, const QStringList & );
+ ~AppOutputViewPart();
+
+ virtual void startAppCommand(const QString &directory, const QString &command, bool inTerminal);
+ virtual void stopApplication();
+ virtual bool isRunning();
+ virtual void insertStdoutLine(const QCString &line);
+ virtual void insertStderrLine(const QCString &line);
+ virtual void addPartialStdoutLine(const QCString &line);
+ virtual void addPartialStderrLine(const QCString &line);
+ virtual void clearView();
+ void hideView();
+ void showView();
+ bool isViewVisible();
+
+signals:
+ void processExited();
+
+private slots:
+ void slotStopButtonClicked(KDevPlugin*);
+ void slotProcessExited();
+
+private:
+ QGuardedPtr<AppOutputWidget> m_widget;
+ KDevAppFrontendIface *m_dcop;
+ bool m_viewIsVisible;
+};
+
+#endif
diff --git a/parts/outputviews/appoutputwidget.cpp b/parts/outputviews/appoutputwidget.cpp
new file mode 100644
index 00000000..e3c3810a
--- /dev/null
+++ b/parts/outputviews/appoutputwidget.cpp
@@ -0,0 +1,355 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * Copyright (C) 2003 by Hamish Rodda *
+ * meddie@yoyo.its.monash.edu.au *
+ * *
+ * 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 "appoutputwidget.h"
+
+#include <qregexp.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qclipboard.h>
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kstatusbar.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kpopupmenu.h>
+#include <klineedit.h>
+#include <kfiledialog.h>
+
+#include "appoutputviewpart.h"
+#include "filterdlg.h"
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+
+AppOutputWidget::AppOutputWidget(AppOutputViewPart* part)
+ : ProcessWidget(0, "app output widget"), m_part(part)
+{
+ connect(this, SIGNAL(executed(QListBoxItem*)), SLOT(slotRowSelected(QListBoxItem*)));
+ connect(this, SIGNAL(rightButtonClicked( QListBoxItem *, const QPoint & )),
+ SLOT(slotContextMenu( QListBoxItem *, const QPoint & )));
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+ setFont(config->readFontEntry("OutputViewFont"));
+ setSelectionMode(QListBox::Extended);
+}
+
+void AppOutputWidget::clearViewAndContents()
+{
+ m_contentList.clear();
+ clear();
+}
+
+AppOutputWidget::~AppOutputWidget()
+{}
+
+
+void AppOutputWidget::childFinished(bool normal, int status)
+{
+ if( !stdoutbuf.isEmpty() )
+ insertStdoutLine("");
+ if( !stderrbuf.isEmpty() )
+ insertStderrLine("");
+
+ ProcessWidget::childFinished(normal, status);
+}
+
+
+void AppOutputWidget::slotRowSelected(QListBoxItem* row)
+{
+ static QRegExp assertMatch("ASSERT: \\\"([^\\\"]+)\\\" in ([^\\( ]+) \\(([\\d]+)\\)");
+ static QRegExp lineInfoMatch("\\[([^:]+):([\\d]+)\\]");
+ static QRegExp rubyErrorMatch("([^:\\s]+\\.rb):([\\d]+):?.*$");
+
+ if (row) {
+ if (assertMatch.exactMatch(row->text())) {
+ m_part->partController()->editDocument(KURL( assertMatch.cap(2) ), assertMatch.cap(3).toInt() - 1);
+ m_part->mainWindow()->statusBar()->message(i18n("Assertion failed: %1").arg(assertMatch.cap(1)), 10000);
+ m_part->mainWindow()->lowerView(this);
+
+ } else if (lineInfoMatch.search(row->text()) != -1) {
+ m_part->partController()->editDocument(KURL( lineInfoMatch.cap(1) ), lineInfoMatch.cap(2).toInt() - 1);
+ m_part->mainWindow()->statusBar()->message(row->text(), 10000);
+ m_part->mainWindow()->lowerView(this);
+ } else if (rubyErrorMatch.search(row->text()) != -1) {
+ QString file;
+ if (rubyErrorMatch.cap(1).startsWith("/")) {
+ file = rubyErrorMatch.cap(1);
+ } else {
+ file = m_part->project()->projectDirectory() + "/" + rubyErrorMatch.cap(1);
+ }
+ m_part->partController()->editDocument(KURL(rubyErrorMatch.cap(1)), rubyErrorMatch.cap(2).toInt() - 1);
+ m_part->mainWindow()->statusBar()->message(row->text(), 10000);
+ m_part->mainWindow()->lowerView(this);
+ }
+ }
+}
+
+
+void AppOutputWidget::insertStdoutLine(const QCString &line)
+{
+// kdDebug(9004) << k_funcinfo << line << endl;
+
+ if ( !m_part->isViewVisible() )
+ {
+ m_part->showView();
+ }
+
+ QString sline;
+ if( !stdoutbuf.isEmpty() )
+ {
+ sline = QString::fromLocal8Bit( stdoutbuf+line );
+ stdoutbuf.truncate( 0 );
+ }else
+ {
+ sline = QString::fromLocal8Bit( line );
+ }
+
+ m_contentList.append(QString("o-")+sline);
+ if ( filterSingleLine( sline ) )
+ {
+ ProcessWidget::insertStdoutLine( sline.local8Bit() );
+ }
+}
+
+
+void AppOutputWidget::insertStderrLine(const QCString &line)
+{
+// kdDebug(9004) << k_funcinfo << line << endl;
+
+ if ( !m_part->isViewVisible() )
+ {
+ m_part->showView();
+ }
+
+
+ QString sline;
+ if( !stderrbuf.isEmpty() )
+ {
+ sline = QString::fromLocal8Bit( stderrbuf+line );
+ stderrbuf.truncate( 0 );
+ }else
+ {
+ sline = QString::fromLocal8Bit( line );
+ }
+
+ m_contentList.append(QString("e-")+sline);
+ if ( filterSingleLine( sline ) )
+ {
+ ProcessWidget::insertStderrLine( sline.local8Bit() );
+ }
+}
+
+void AppOutputWidget::editFilter()
+{
+ FilterDlg dlg( this );
+ dlg.caseSensitive->setChecked( m_filter.m_caseSensitive );
+ dlg.regularExpression->setChecked( m_filter.m_isRegExp );
+ dlg.filterString->setText( m_filter.m_filterString );
+
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ m_filter.m_caseSensitive = dlg.caseSensitive->isChecked();
+ m_filter.m_isRegExp = dlg.regularExpression->isChecked();
+ m_filter.m_filterString = dlg.filterString->text();
+
+ m_filter.m_isActive = !m_filter.m_filterString.isEmpty();
+
+ reinsertAndFilter();
+ }
+
+}
+bool AppOutputWidget::filterSingleLine(const QString & line)
+{
+ if ( !m_filter.m_isActive ) return true;
+
+ if ( m_filter.m_isRegExp )
+ {
+ return ( line.find( QRegExp( m_filter.m_filterString, m_filter.m_caseSensitive, false ) ) != -1 );
+ }
+ else
+ {
+ return ( line.find( m_filter.m_filterString, 0, m_filter.m_caseSensitive ) != -1 );
+ }
+}
+
+void AppOutputWidget::reinsertAndFilter()
+{
+ //copy the first item from the listbox
+ //if a programm was started, this contains the issued command
+ QString issuedCommand;
+ if ( count() > 0 )
+ {
+ setTopItem(0);
+ issuedCommand = item(topItem())->text();
+ }
+
+ clear();
+
+ //write back the issued command
+ if ( !issuedCommand.isEmpty() )
+ {
+ insertItem( new ProcessListBoxItem( issuedCommand, ProcessListBoxItem::Diagnostic ) );
+ }
+
+ //grep through the list for items matching the filter...
+ QStringList strListFound;
+ if ( m_filter.m_isActive )
+ {
+ if ( m_filter.m_isRegExp )
+ {
+ strListFound = m_contentList.grep( QRegExp(m_filter.m_filterString, m_filter.m_caseSensitive, false ) );
+ }
+ else
+ {
+ strListFound = m_contentList.grep( m_filter.m_filterString, m_filter.m_caseSensitive );
+ }
+ }
+ else
+ {
+ strListFound = m_contentList;
+ }
+
+ //... and reinsert the found items into the listbox
+ for ( QStringList::Iterator it = strListFound.begin(); it != strListFound.end(); ++it )
+ {
+ if ((*it).startsWith("o-"))
+ {
+ (*it).remove(0,2);
+ insertItem(new ProcessListBoxItem(*it, ProcessListBoxItem::Normal));
+ }
+ else if ((*it).startsWith("e-"))
+ {
+ (*it).remove(0,2);
+ insertItem(new ProcessListBoxItem(*it, ProcessListBoxItem::Error));
+ }
+ }
+}
+
+void AppOutputWidget::clearFilter()
+{
+ m_filter.m_isActive = false;
+ reinsertAndFilter();
+}
+
+void AppOutputWidget::slotContextMenu( QListBoxItem *, const QPoint &p )
+{
+ KPopupMenu popup(this, "filter output");
+
+ int id = popup.insertItem( i18n("Clear output"), this, SLOT(clearViewAndContents()) );
+ popup.setItemEnabled( id, m_contentList.size() > 0 );
+
+ popup.insertItem( i18n("Copy selected lines"), this, SLOT(copySelected()) );
+ popup.insertSeparator();
+
+ popup.insertItem( i18n("Save unfiltered"), this, SLOT(saveAll()) );
+ id = popup.insertItem( i18n("Save filtered output"), this, SLOT(saveFiltered()) );
+ popup.setItemEnabled( id, m_filter.m_isActive );
+ popup.insertSeparator();
+
+ id = popup.insertItem( i18n("Clear filter"), this, SLOT(clearFilter()) );
+ popup.setItemEnabled( id, m_filter.m_isActive );
+
+ popup.insertItem( i18n("Edit filter"), this, SLOT(editFilter() ) );
+
+ popup.insertSeparator();
+ popup.insertItem( i18n("Hide view"), this, SLOT(hideView()) );
+
+ popup.exec(p);
+}
+
+void AppOutputWidget::hideView()
+{
+ m_part->hideView();
+}
+
+void AppOutputWidget::saveAll()
+{
+ saveOutputToFile( false );
+}
+
+void AppOutputWidget::saveFiltered()
+{
+ saveOutputToFile( true );
+}
+
+void AppOutputWidget::saveOutputToFile(bool useFilter)
+{
+ QString filename = KFileDialog::getSaveFileName();
+
+ if ( filename.isEmpty() ) return;
+
+ QStringList contents;
+ if ( useFilter && m_filter.m_isActive )
+ {
+ if ( m_filter.m_isRegExp )
+ {
+ contents = m_contentList.grep( QRegExp(m_filter.m_filterString, m_filter.m_caseSensitive, false ) );
+ }
+ else
+ {
+ contents = m_contentList.grep( m_filter.m_filterString, m_filter.m_caseSensitive );
+ }
+ }
+ else
+ {
+ contents = m_contentList;
+ }
+
+ QFile file( filename );
+ if ( file.open( IO_WriteOnly ) )
+ {
+ QTextStream ostream( &file );
+ QStringList::ConstIterator it = contents.begin();
+ while( it != contents.end() )
+ {
+ QString line = *it;
+ if ( line.startsWith("o-") || line.startsWith("e-") )
+ {
+ line.remove( 0, 2 );
+ }
+ ostream << line << endl;
+ ++it;
+ }
+ file.close();
+ }
+}
+
+void AppOutputWidget::copySelected()
+{
+ uint n = count();
+ QString buffer;
+ for (uint i = 0; i < n; i++)
+ {
+ if (isSelected(i))
+ buffer += item(i)->text() + "\n";
+ }
+ kapp->clipboard()->setText(buffer, QClipboard::Clipboard);
+}
+
+void AppOutputWidget::addPartialStderrLine(const QCString & line)
+{
+ stderrbuf += line;
+}
+
+void AppOutputWidget::addPartialStdoutLine(const QCString & line)
+{
+ stdoutbuf += line;
+}
+
+#include "appoutputwidget.moc"
diff --git a/parts/outputviews/appoutputwidget.h b/parts/outputviews/appoutputwidget.h
new file mode 100644
index 00000000..9a0d1e71
--- /dev/null
+++ b/parts/outputviews/appoutputwidget.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _APPOUTPUTWIDGET_H_
+#define _APPOUTPUTWIDGET_H_
+
+#include <qstringlist.h>
+#include <kregexp.h>
+
+#include "processwidget.h"
+
+class AppOutputViewPart;
+
+class AppOutputWidget : public ProcessWidget
+{
+ Q_OBJECT
+friend class AppOutputViewPart;
+public:
+ AppOutputWidget(AppOutputViewPart* part);
+ ~AppOutputWidget();
+ // clears our own store and the one of our base ProcessWidget
+
+public slots:
+ void slotRowSelected(QListBoxItem* row);
+ void insertStdoutLine(const QCString &line);
+ void insertStderrLine(const QCString &line);
+ void addPartialStdoutLine(const QCString &line);
+ void addPartialStderrLine(const QCString &line);
+ void slotContextMenu(QListBoxItem *, const QPoint &);
+ void hideView();
+ void clearViewAndContents();
+ void clearFilter();
+ void editFilter();
+ void saveAll();
+ void saveFiltered();
+ void copySelected();
+
+private:
+ virtual void childFinished(bool normal, int status);
+ void saveOutputToFile( bool useFilter );
+ void reinsertAndFilter();
+ bool filterSingleLine( const QString & line );
+
+ QStringList m_contentList;
+
+ struct OutputFilter
+ {
+ OutputFilter() : m_isActive(false), m_isRegExp(false), m_caseSensitive(false) {}
+ bool m_isActive;
+ bool m_isRegExp;
+ bool m_caseSensitive;
+ QString m_filterString;
+ };
+
+ AppOutputViewPart* m_part;
+ OutputFilter m_filter;
+ QCString stdoutbuf;
+ QCString stderrbuf;
+};
+
+#endif
diff --git a/parts/outputviews/commandcontinuationfilter.cpp b/parts/outputviews/commandcontinuationfilter.cpp
new file mode 100644
index 00000000..474cec15
--- /dev/null
+++ b/parts/outputviews/commandcontinuationfilter.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "commandcontinuationfilter.h"
+#include <qregexp.h>
+#include <kdebug.h>
+
+CommandContinuationFilter::CommandContinuationFilter( OutputFilter& next )
+ : OutputFilter( next )
+{
+}
+
+void CommandContinuationFilter::processLine( const QString& line )
+{
+ int index=line.length()-1;
+ while (index>=0)
+ {
+ if (line[index]=='\\')
+ {
+ m_text += line.left(index);
+ return;
+ }
+
+ if (!line[index].isSpace())
+ break;
+ index--;
+ }
+
+ m_text+=line;
+ OutputFilter::processLine( m_text );
+ m_text = "";
+}
diff --git a/parts/outputviews/commandcontinuationfilter.h b/parts/outputviews/commandcontinuationfilter.h
new file mode 100644
index 00000000..d0239caf
--- /dev/null
+++ b/parts/outputviews/commandcontinuationfilter.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CommandContinuationFilter_h
+#define CommandContinuationFilter_h
+
+#include "outputfilter.h"
+#include <qstring.h>
+
+class CommandContinuationFilter : public OutputFilter
+{
+public:
+ CommandContinuationFilter( OutputFilter& );
+
+ void processLine( const QString& line );
+
+private:
+ QString m_text;
+};
+
+#endif
diff --git a/parts/outputviews/compileerrorfilter.cpp b/parts/outputviews/compileerrorfilter.cpp
new file mode 100644
index 00000000..f8246346
--- /dev/null
+++ b/parts/outputviews/compileerrorfilter.cpp
@@ -0,0 +1,128 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "compileerrorfilter.h"
+#include "compileerrorfilter.moc"
+#include "makeitem.h"
+
+#include <kdebug.h>
+
+CompileErrorFilter::ErrorFormat::ErrorFormat( const char * regExp, int file, int line, int text )
+ : expression( regExp )
+ , fileGroup( file )
+ , lineGroup( line )
+ , textGroup( text )
+{
+}
+
+CompileErrorFilter::ErrorFormat::ErrorFormat( const char * regExp, int file, int line, int text, QString comp )
+ : expression( regExp )
+ , fileGroup( file )
+ , lineGroup( line )
+ , textGroup( text )
+ , compiler( comp )
+{
+}
+
+
+CompileErrorFilter::CompileErrorFilter( OutputFilter& next )
+ : OutputFilter( next )
+{
+}
+
+CompileErrorFilter::ErrorFormat* CompileErrorFilter::errorFormats()
+{
+ /// @todo could get these from emacs compile.el
+ static ErrorFormat formats[] = {
+ // GCC - another case, eg. for #include "pixmap.xpm" which does not exists
+ ErrorFormat( "^([^:\t]{1,1024}):([0-9]{1,10}):(?:[0-9]+):([^0-9]+)", 1, 2, 3 ),
+ // GCC
+ ErrorFormat( "^([^:\t]{1,1024}):([0-9]{1,10}):([^0-9]+)", 1, 2, 3 ),
+ // ICC
+ ErrorFormat( "^([^:\\t]{1,1024})\\(([0-9]{1,10})\\):([^0-9]+)", 1, 2, 3, "intel" ),
+ //libtool link
+ ErrorFormat( "(libtool):( link):( warning): ", 0, 0, 0 ),
+ // ld
+ ErrorFormat( "undefined reference", 0, 0, 0 ),
+ ErrorFormat( "undefined symbol", 0, 0, 0 ),
+ ErrorFormat( "ld: cannot find", 0, 0, 0 ),
+ ErrorFormat( "No such file", 0, 0, 0 ),
+ // make
+ ErrorFormat( "No rule to make target", 0, 0, 0 ),
+ // Fortran
+ ErrorFormat( "\"(.*)\", line ([0-9]+):(.*)", 1, 2, 3 ),
+ // Jade
+ ErrorFormat( "[a-zA-Z]+:([^: \t]+):([0-9]+):[0-9]+:[a-zA-Z]:(.*)", 1, 2, 3 ),
+ // ifort
+ ErrorFormat( "fortcom: Error: (.*), line ([0-9]+):(.*)", 1, 2, 3, "intel" ),
+ // PGI
+ ErrorFormat( "PGF9(.*)-(.*)-(.*)-(.*) \\((.*): ([0-9]+)\\)", 5, 6, 4, "pgi" ),
+ // PGI (2)
+ ErrorFormat( "PGF9(.*)-(.*)-(.*)-Symbol, (.*) \\((.*)\\)", 5, 5, 4, "pgi" ),
+
+ ErrorFormat( 0, 0, 0, 0 ) // this one last
+ };
+
+ return formats;
+
+}
+
+void CompileErrorFilter::processLine( const QString& line )
+{
+ bool hasmatch = false;
+ QString file;
+ int lineNum = 0;
+ QString text;
+ QString compiler;
+ int i = 0;
+ bool isWarning = false;
+ bool isInstantiationInfo = false;
+ ErrorFormat* const errFormats = errorFormats();
+ ErrorFormat* format = &errFormats[i];
+ while( !format->expression.isEmpty() )
+ {
+ QRegExp& regExp = format->expression;
+
+ if ( regExp.search( line ) != -1 ) {
+ hasmatch = true;
+ file = regExp.cap( format->fileGroup );
+ lineNum = regExp.cap( format->lineGroup ).toInt() - 1;
+ text = regExp.cap( format->textGroup );
+ compiler = format->compiler;
+ QString cap = regExp.cap(3);
+ if (cap.contains("warning:", false) || cap.contains("Warnung:", false))
+ isWarning = true;
+ if (regExp.cap(3).contains("instantiated from", false)) {
+ isInstantiationInfo = true;
+ }
+ break;
+ }
+
+ format = &errFormats[++i];
+ }
+
+ if( hasmatch )
+ {
+ // Add hacks for error strings you want excluded here
+ if( text.find( QString::fromLatin1("(Each undeclared identifier is reported only once") ) >= 0
+ || text.find( QString::fromLatin1("for each function it appears in.)") ) >= 0 )
+ hasmatch = false;
+ }
+
+ if ( hasmatch )
+ {
+ emit item( new ErrorItem( file, lineNum, text, line, isWarning, isInstantiationInfo, compiler ) );
+ }
+ else
+ {
+ OutputFilter::processLine( line );
+ }
+}
diff --git a/parts/outputviews/compileerrorfilter.h b/parts/outputviews/compileerrorfilter.h
new file mode 100644
index 00000000..d07495cf
--- /dev/null
+++ b/parts/outputviews/compileerrorfilter.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CompileErrorFilter_h
+#define CompileErrorFilter_h
+
+#include <qobject.h>
+#include <qregexp.h>
+#include <qvaluelist.h>
+#include "outputfilter.h"
+
+class MakeItem;
+
+class CompileErrorFilter : public QObject, public OutputFilter
+{
+Q_OBJECT
+
+public:
+ CompileErrorFilter( OutputFilter& );
+
+ struct ErrorFormat
+ {
+ ErrorFormat() {}
+ ErrorFormat( const char *, int, int, int );
+ ErrorFormat( const char *, int, int, int, QString );
+ QRegExp expression;
+ int fileGroup;
+ int lineGroup;
+ int textGroup;
+ QString compiler;
+ };
+ static ErrorFormat* errorFormats();
+
+ void processLine( const QString& line );
+
+signals:
+ void item( MakeItem* );
+};
+
+#endif
diff --git a/parts/outputviews/directorystatusmessagefilter.cpp b/parts/outputviews/directorystatusmessagefilter.cpp
new file mode 100644
index 00000000..5738f41d
--- /dev/null
+++ b/parts/outputviews/directorystatusmessagefilter.cpp
@@ -0,0 +1,187 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "directorystatusmessagefilter.h"
+#include "directorystatusmessagefilter.moc"
+#include "makeitem.h"
+
+#include <qregexp.h>
+#include <kdebug.h>
+
+DirectoryStatusMessageFilter::DirectoryStatusMessageFilter( OutputFilter& next )
+ : OutputFilter( next )
+{
+}
+
+void DirectoryStatusMessageFilter::processLine( const QString& line )
+{
+ QString dir;
+ if ( matchEnterDir( line, dir ) )
+ {
+ emit item( new EnteringDirectoryItem( dir, line ) );
+ }
+ else if ( matchLeaveDir( line, dir ) )
+ {
+ emit item( new ExitingDirectoryItem( dir, line ) );
+ }
+ else
+ {
+ OutputFilter::processLine( line );
+ }
+}
+
+// simple helper function - checks whether we entered a new directory
+// (locale and Utf8 aware)
+bool DirectoryStatusMessageFilter::matchEnterDir( const QString& line, QString& dir )
+{
+ // make outputs localised strings in Utf8 for entering/leaving directories...
+ static const unsigned short fr_enter[] =
+ {'E','n','t','r','e',' ','d','a','n','s',' ','l','e',' ','r',0xe9,'p','e','r','t','o','i','r','e'
+ };
+ static const unsigned short pl_enter[] =
+ {'W','c','h','o','d','z',0x119,' ','k','a','t','a','l','o','g'
+ };
+ static const unsigned short ja_enter[] =
+ {
+ 0x5165,0x308a,0x307e,0x3059,0x20,0x30c7,0x30a3,0x30ec,0x30af,0x30c8,0x30ea
+ };
+ static const unsigned short ko_enter[] =
+ {
+ 0xb4e4,0xc5b4,0xac10
+ };
+ static const unsigned short ko_behind[] =
+ {
+ 0x20,0xb514,0xb809,0xd1a0,0xb9ac
+ };
+ static const unsigned short pt_br_enter[] =
+ {
+ 0x45,0x6e,0x74,0x72,0x61,0x6e,0x64,0x6f,0x20,0x6e,0x6f,0x20,0x64,0x69,0x72,0x65,0x74,0xf3,0x72,0x69,0x6f
+ };
+ static const unsigned short ru_enter[] =
+ {
+ 0x412,0x445,0x43e,0x434,0x20,0x432,0x20,0x43a,0x430,0x442,0x430,0x43b,0x43e,0x433
+ };
+
+ static const QString fr_e( (const QChar*)fr_enter, sizeof(fr_enter) / 2 );
+ static const QString pl_e( (const QChar*)pl_enter, sizeof(pl_enter) / 2 );
+ static const QString ja_e( (const QChar*)ja_enter, sizeof(ja_enter) / 2 );
+ static const QString ko_e( (const QChar*)ko_enter, sizeof(ko_enter) / 2 );
+ static const QString ko_b( (const QChar*)ko_behind, sizeof(ko_behind) / 2 );
+ static const QString pt_br_e( (const QChar*)pt_br_enter, sizeof(pt_br_enter) / 2 );
+ static const QString ru_e( (const QChar*)ru_enter, sizeof(ru_enter) / 2 );
+ static const QString en_e("Entering directory");
+ static const QString de_e1("Wechsel in das Verzeichnis Verzeichnis");
+ static const QString de_e2("Wechsel in das Verzeichnis");
+ static const QString es_e("Cambiando a directorio");
+ static const QString nl_e("Binnengaan van directory");
+ //@todo: other translations!
+
+ // we need a QRegExp because KRegExp is not Utf8 aware.
+ // 0x00AB is LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ // 0X00BB is RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ static QRegExp dirChange(QString::fromLatin1(".*: (.+) (`|") + QChar(0x00BB) + QString::fromLatin1(")(.*)('|") + QChar(0x00AB) + QString::fromLatin1(")(.*)"));
+ static QRegExp enEnter(QString::fromLatin1(".*: Entering directory"));
+ kdDebug(9004) << "Directory filter line " << line << endl;
+
+ // avoid QRegExp if possible. This regex performs VERY badly with large inputs,
+ // and the input required is very short if these strings match.
+ if(line.find(en_e) > -1 ||
+ line.find(fr_e) > -1 ||
+ line.find(pl_e) > -1 ||
+ line.find(ja_e) > -1 ||
+ line.find(ko_e) > -1 ||
+ line.find(ko_b) > -1 ||
+ line.find(pt_br_e) > -1 ||
+ line.find(ru_e) > -1 ||
+ line.find(de_e1) > -1 ||
+ line.find(de_e2) > -1 ||
+ line.find(es_e) > -1 ||
+ line.find(nl_e) > -1)
+ {
+ // grab the directory name
+ if(dirChange.search(line) > -1)
+ {
+ dir = dirChange.cap(3);
+ return true;
+ }
+ }
+ return false;
+}
+
+// simple helper function - checks whether we left a directory
+// (locale and Utf8 aware).
+bool DirectoryStatusMessageFilter::matchLeaveDir( const QString& line, QString& dir )
+{
+ static const unsigned short fr_leave[] =
+ { 'Q','u','i','t','t','e',' ','l','e',' ','r',0xe9,'p','e','r','t','o','i','r','e'
+ };
+ static const unsigned short ja_leave[] =
+ {
+ 0x51fa,0x307e,0x3059,0x20,0x30c7,0x30a3,0x30ec,0x30af,0x30c8,0x30ea
+ };
+ static const unsigned short pt_br_leave[] =
+ {'S','a','i','n','d','o',' ','d','o',' ','d','i','r','e','t',0xf3,'r','i','o'
+ };
+ static const unsigned short ru_leave[] =
+ {
+ 0x412,0x44b,0x445,0x43e,0x434,0x20,0x438,0x437,0x20,0x43a,0x430,0x442,0x430,0x43b,0x43e,0x433
+ };
+ static const unsigned short ko_leave[] =
+ {
+ 0xb098,0xac10
+ };
+ static const unsigned short ko_behind[] =
+ {
+ 0x20,0xb514,0xb809,0xd1a0,0xb9ac
+ };
+
+ static const QString fr_l( (const QChar*)fr_leave, sizeof(fr_leave) / 2 );
+ static const QString ja_l( (const QChar*)ja_leave, sizeof(ja_leave) / 2 );
+ static const QString ko_l( (const QChar*)ko_leave, sizeof(ko_leave) / 2 );
+ static const QString ko_b( (const QChar*)ko_behind, sizeof(ko_behind) / 2 );
+ static const QString pt_br_l( (const QChar*)pt_br_leave, sizeof(pt_br_leave) / 2 );
+ static const QString ru_l( (const QChar*)ru_leave, sizeof(ru_leave) / 2 );
+ static const QString en_l("Leaving directory");
+ static const QString de_l1("Verlassen des Verzeichnisses Verzeichnis");
+ static const QString de_l2("Verlassen des Verzeichnisses");
+ static const QString es_l("Saliendo directorio");
+ static const QString nl_l("Verdwijnen uit directory");
+ static const QString po_l("Opuszczam katalog");
+
+ // we need a QRegExp because KRegExp is not Utf8 aware.
+ // 0x00AB is LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ // 0X00BB is RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+
+ static QRegExp dirChange(QString::fromLatin1(".*: (.+) (`|") + QChar(0x00BB) + QString::fromLatin1(")(.*)('|") + QChar(0x00AB) + QString::fromLatin1(")(.*)"));
+
+ // avoid QRegExp if possible. This regex performs VERY badly with large inputs,
+ // and the input required is very short if these strings match.
+ if(line.find(en_l) > -1 ||
+ line.find(fr_l) > -1 ||
+ line.find(ja_l) > -1 ||
+ (line.find(ko_l) > -1 && line.find(ko_b) > -1) ||
+ line.find(pt_br_l) > -1 ||
+ line.find(ru_l) > -1 ||
+ line.find(de_l1) > -1 ||
+ line.find(de_l2) > -1 ||
+ line.find(es_l) > -1 ||
+ line.find(nl_l) > -1 ||
+ line.find(po_l) > -1)
+ {
+ // grab the directory name
+ if(dirChange.search(line) > -1 )
+ {
+ dir = dirChange.cap(3);
+ return true;
+ }
+ }
+ return false;
+}
diff --git a/parts/outputviews/directorystatusmessagefilter.h b/parts/outputviews/directorystatusmessagefilter.h
new file mode 100644
index 00000000..18972487
--- /dev/null
+++ b/parts/outputviews/directorystatusmessagefilter.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef DirectoryStatusMessageFilter_h
+#define DirectoryStatusMessageFilter_h
+
+#include <qobject.h>
+#include "outputfilter.h"
+
+class EnteringDirectoryItem;
+class ExitingDirectoryItem;
+
+class DirectoryStatusMessageFilter : public QObject, public OutputFilter
+{
+Q_OBJECT
+
+public:
+ DirectoryStatusMessageFilter( OutputFilter& );
+
+ void processLine( const QString& line );
+
+signals:
+ void item( EnteringDirectoryItem* );
+ void item( ExitingDirectoryItem* );
+
+private:
+ bool matchEnterDir( const QString& line, QString& dir );
+ bool matchLeaveDir( const QString& line, QString& dir );
+};
+
+#endif
diff --git a/parts/outputviews/filterdlg.ui b/parts/outputviews/filterdlg.ui
new file mode 100644
index 00000000..729af672
--- /dev/null
+++ b/parts/outputviews/filterdlg.ui
@@ -0,0 +1,164 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>FilterDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FilterDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>326</width>
+ <height>200</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Output Filter Settings</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>filtergroup</cstring>
+ </property>
+ <property name="title">
+ <string>Filter</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="selectedId" stdset="0">
+ <number>-1</number>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Only show lines matching:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>filterString</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>caseSensitive</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;ase sensitive</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>regularExpression</cstring>
+ </property>
+ <property name="text">
+ <string>Re&amp;gular expression</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>FilterDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>FilterDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>filterString</tabstop>
+ <tabstop>caseSensitive</tabstop>
+ <tabstop>regularExpression</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/parts/outputviews/kdevappoutputview.desktop b/parts/outputviews/kdevappoutputview.desktop
new file mode 100644
index 00000000..2460ad6d
--- /dev/null
+++ b/parts/outputviews/kdevappoutputview.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Application Output View
+Comment[ca]=Visor de l'eixida de les aplicacions
+Comment[da]=Program-uddata fremvisning
+Comment[de]=Anwendungsausgabe für KDevelop
+Comment[el]=Προβολή εξόδου εφαρμογής
+Comment[es]=Visor de la salida de las aplicaciones
+Comment[et]=Rakenduse väljundi vaade
+Comment[eu]=Aplikazioen irteera ikustailua
+Comment[fa]=نمای خروجی کاربرد
+Comment[fr]=Fenêtre de sortie d'une application
+Comment[gl]=Vista da saída da aplicación
+Comment[hi]=अनुप्रयोग आउटपुट व्यू
+Comment[hu]=Alkalmazáskimenet-megjelenítő
+Comment[it]=Vista dell'output dell'applicazione
+Comment[ja]=アプリケーション出力ビュー
+Comment[ms]=Lihat Keluaran Aplikasi
+Comment[nds]=Programmutgaav-Kieker
+Comment[ne]=अनुप्रयोग निर्गत दृश्य
+Comment[nl]=Weergave van toepassingsuitvoer
+Comment[pl]=Widok wyjścia programu
+Comment[pt]=Vista do Resultado da Aplicação
+Comment[pt_BR]=Visão da Saída do Aplicativo
+Comment[ru]=Окно вывода приложения
+Comment[sk]=Pohľad na výstup aplikácie
+Comment[sl]=Prikaz programskega izhoda
+Comment[sr]=Приказ излаза апликације
+Comment[sr@Latn]=Prikaz izlaza aplikacije
+Comment[sv]=Programutmatningsvy
+Comment[ta]=பயன்பாட்டு வெளியீட்டுக் காட்சி
+Comment[tg]=Тирезаи хориҷ кардани гузориш
+Comment[tr]=Uygulama Çıktı Görünümü
+Comment[zh_CN]=应用程序输出查看器
+Comment[zh_TW]=應用程式輸出檢視
+Name=KDevAppOutputView
+Name[da]=KDevelop Program-uddata fremvisning
+Name[de]=Anwendungsausgabe (KDevelop)
+Name[hi]=के-डेव-एप्प-आउटपुट-व्यू
+Name[nds]=Programmutgaav-Kieker (KDevelop)
+Name[pl]=KDevAppWidokWyjścia
+Name[sk]=KDev pohľad na výstup aplikácie
+Name[sv]=KDevelop programutmatningsvy
+Name[ta]=KDevApp வெளியீட்டுக் காட்சி
+Name[zh_TW]=KDevelop 應用程式輸出檢視
+GenericName=Application Output View
+GenericName[ca]=Visor de l'eixida de les aplicacions
+GenericName[da]=Program-uddata fremvisning
+GenericName[de]=Anwendungsausgabe
+GenericName[el]=Προβολή εξόδου εφαρμογής
+GenericName[es]=Visor de la salida de las aplicaciones
+GenericName[et]=Rakenduse väljundi vaade
+GenericName[eu]=Aplikazioen irteera ikustailua
+GenericName[fa]=نمای خروجی کاربرد
+GenericName[fr]=Fenêtre de sortie d'une application
+GenericName[gl]=Vista da saída da aplicación
+GenericName[hi]=अनुप्रयोग आउटपुट व्यू
+GenericName[hu]=Alkalmazáskimenet-megjelenítő
+GenericName[it]=Visualizza l'output dell'applicazione
+GenericName[ja]=アプリケーション出力ビュー
+GenericName[nds]=Programmutgaav-Kieker
+GenericName[ne]=अनुप्रयोग निर्गत दृश्य
+GenericName[nl]=Weergave van toepassingsuitvoer
+GenericName[pl]=Widok wyjścia programu
+GenericName[pt]=Vista do Resultado da Aplicação
+GenericName[pt_BR]=Visão da Saída do Aplicativo
+GenericName[ru]=Окно вывода приложения
+GenericName[sk]=Pohľad na výstup aplikácie
+GenericName[sl]=Prikaz programskega izhoda
+GenericName[sr]=Приказ излаза апликације
+GenericName[sr@Latn]=Prikaz izlaza aplikacije
+GenericName[sv]=Programutmatningsvy
+GenericName[ta]=பயன்பாட்டு வெளியீட்டுக் காட்சி
+GenericName[tg]=Тирезаи хориҷ кардани гузориш
+GenericName[tr]=Uygulama Çıktı Görünümü
+GenericName[zh_CN]=应用程序输出查看器
+GenericName[zh_TW]=應用程式輸出檢視
+Icon=exec
+ServiceTypes=KDevelop/AppFrontend
+X-KDE-Library=libkdevappview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Core
+X-KDevelop-Properties=OutputTool
diff --git a/parts/outputviews/kdevmakeview.desktop b/parts/outputviews/kdevmakeview.desktop
new file mode 100644
index 00000000..e4498d0a
--- /dev/null
+++ b/parts/outputviews/kdevmakeview.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Compiler Frontend
+Comment[ca]=Entorn per al compilador
+Comment[da]=Grænseflade til oversætter
+Comment[de]=Make-Ausgabe für KDevelop
+Comment[el]=Πρόγραμμα μεταγλωττιστή
+Comment[es]=Entorno para el compilador
+Comment[et]=Kompilaatori kasutajaliides
+Comment[eu]=Konpiladore interfazea
+Comment[fa]=پایانۀ مترجم
+Comment[fr]=Interface pour le compilateur
+Comment[ga]=Comhéadan Tiomsaitheora
+Comment[gl]=Frontal para o compilador
+Comment[hi]=कम्पायलर फ्रन्टएण्ड
+Comment[hu]=Grafikus felület fordítóprogramokhoz
+Comment[it]=Interfaccia al compilatore
+Comment[ja]=コンパイラフロントエンド
+Comment[ms]=Frontend Penghimpun
+Comment[nds]=Kompilerer-Böversiet
+Comment[ne]=कम्पाइलर फ्रन्टइन्ड
+Comment[nl]=Compiler-frontend
+Comment[pl]=Interfejs do kompilatora
+Comment[pt]=Interface de Compilador
+Comment[pt_BR]=Frontend do Compilador
+Comment[ru]=Интерфейс к компилятору
+Comment[sk]=Rozhranie kompilátora
+Comment[sl]=Vmesnik prevajalnika
+Comment[sr]=Кориснички интерфејс за преводилац
+Comment[sr@Latn]=Korisnički interfejs za prevodilac
+Comment[sv]=Kompilatorgränssnitt
+Comment[ta]=முன்பகுதி தொகுப்பான்
+Comment[tg]=Интерфейс ба талфифгар
+Comment[tr]=Derleyici Önucu
+Comment[zh_CN]=编译器前端
+Comment[zh_TW]=編譯器前端介面
+Name=KDevMakeView
+Name[da]=KDevelop Make-visning
+Name[de]=Make-Ausgabe (KDevelop)
+Name[hi]=के-डेव-मेक-व्यू
+Name[nds]=Make-Kieker (KDevelop)
+Name[pl]=KDevWIdokMake
+Name[sk]=KDev pohľad na make
+Name[sv]=KDevelop byggvy
+Name[ta]=KDev காட்சியாக்கு
+Name[zh_TW]=KDevelop Make 檢視
+GenericName=Compiler Frontend
+GenericName[ca]=Entorn per al compilador
+GenericName[da]=Grænseflade til oversætter
+GenericName[de]=Make-Ausgabe
+GenericName[el]=Πρόγραμμα μεταγλωττιστή
+GenericName[es]=Entorno para el compilador
+GenericName[et]=Kompilaatori kasutajaliides
+GenericName[eu]=Konpiladore interfazea
+GenericName[fa]=پایانۀ مترجم
+GenericName[fr]=Interface pour le compilateur
+GenericName[ga]=Comhéadan Tiomsaitheora
+GenericName[gl]=Frontal para o compilador
+GenericName[hi]=कम्पायलर फ्रन्टएण्ड
+GenericName[hu]=Grafikus felület fordítóprogramokhoz
+GenericName[it]=Interfaccia al compilatore
+GenericName[ja]=コンパイラフロントエンド
+GenericName[ms]=Frontend Penghimpun
+GenericName[nds]=Kompilerer-Böversiet
+GenericName[ne]=कम्पाइलर फ्रन्टइन्ड
+GenericName[nl]=Compiler-frontend
+GenericName[pl]=Interfejs do kompilatora
+GenericName[pt]=Interface de Compilador
+GenericName[pt_BR]=Frontend do Compilador
+GenericName[ru]=Интерфейс к компилятору
+GenericName[sk]=Rozhranie kompilátor
+GenericName[sl]=Vmesnik prevajalnika
+GenericName[sr]=Кориснички интерфејс преводиоца
+GenericName[sr@Latn]=Korisnički interfejs prevodioca
+GenericName[sv]=Kompilatorgränssnitt
+GenericName[ta]=முன் பகுதி தொகுப்பான்
+GenericName[tg]=Интерфейс ба талфифгар
+GenericName[tr]=Derleyici Önucu
+GenericName[zh_CN]=编译器前端
+GenericName[zh_TW]=編譯器前端介面
+Icon=konsole
+ServiceTypes=KDevelop/MakeFrontend
+X-KDE-Library=libkdevmakeview
+X-KDevelop-Version=5
+X-KDevelop-Scope=Core
+X-KDevelop-Properties=OutputTool
diff --git a/parts/outputviews/kdevmakeview.rc b/parts/outputviews/kdevmakeview.rc
new file mode 100644
index 00000000..fc8c82f6
--- /dev/null
+++ b/parts/outputviews/kdevmakeview.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevMakeView" version="1">
+<MenuBar>
+ <Menu name="view">
+ <Action name="view_next_error" group="error_operations"/>
+ <Action name="view_previous_error" group="error_operations"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/parts/outputviews/makeactionfilter.cpp b/parts/outputviews/makeactionfilter.cpp
new file mode 100644
index 00000000..bbcc61fb
--- /dev/null
+++ b/parts/outputviews/makeactionfilter.cpp
@@ -0,0 +1,319 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdatetime.h>
+#include <kdebug.h>
+
+#include "makeactionfilter.h"
+#include "makeactionfilter.moc"
+#include "makeitem.h"
+
+#include <klocale.h>
+
+//#define DEBUG
+
+MakeActionFilter::ActionFormat::ActionFormat( const QString& _action, const QString& _tool, const char * regExp, int file )
+ : m_action( _action )
+ , m_expression( regExp )
+ , m_tool( _tool )
+ , m_toolGroup(-1)
+ , m_fileGroup( file )
+{
+}
+
+MakeActionFilter::ActionFormat::ActionFormat( const QString& _action, int tool, int file, const char * regExp)
+ : m_action( _action )
+ , m_expression( regExp )
+ , m_tool()
+ , m_toolGroup(tool)
+ , m_fileGroup( file )
+{
+}
+
+QString MakeActionFilter::ActionFormat::tool()
+{
+ if (m_toolGroup==-1)
+ return m_tool;
+ return m_expression.cap(m_toolGroup);
+}
+
+QString MakeActionFilter::ActionFormat::file()
+{
+ return m_expression.cap(m_fileGroup);
+}
+
+bool MakeActionFilter::ActionFormat::matches(const QString& line)
+{
+ return ( m_expression.search( line ) != -1 );
+}
+
+
+MakeActionFilter::MakeActionFilter( OutputFilter& next )
+ : OutputFilter( next )
+{
+
+#ifdef DEBUG
+ test();
+#endif
+}
+
+//NOTE: whenever you discover a case that is not correctly recognized by the filter, please add it as a test
+//item and be sure that your modifications don't break the already existing test cases.
+
+// returns an array of ActionFormat
+MakeActionFilter::ActionFormat* MakeActionFilter::actionFormats()
+{
+ static ActionFormat formats[] = {
+ ActionFormat( i18n("compiling"), 1, 2, "(?:^|[^=])\\b(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\s+.*-c.*[/ '\\\\]+(\\w+\\.(?:cpp|CPP|c|C|cxx|CXX|cs|java|hpf|f|F|f90|F90|f95|F95))"),
+ ActionFormat( i18n("compiling"), 1, 1, "^compiling (.*)" ), //unsermake
+ ActionFormat( i18n("compiling"), 1, 1, "\\[.+%\\] Building .* object (.*)" ), //cmake
+
+ ActionFormat( i18n("built"), 1, 1, "\\[.+%\\] Built target (.*)" ), //cmake
+ ActionFormat( i18n("generating"), 1, 1, "\\[.+%\\] Generating (.*)" ), //cmake
+
+ //moc and uic
+ ActionFormat( i18n("generating"), 1, 2, "/(moc|uic)\\b.*\\s-o\\s([^\\s;]+)"),
+ ActionFormat( i18n("generating"), 1, 2, "^generating (.*)" ), //unsermake
+
+ ActionFormat( i18n("linking"), "libtool", "/bin/sh\\s.*libtool.*--mode=link\\s.*\\s-o\\s([^\\s;]+)", 1 ),
+ //can distcc link too ?
+ ActionFormat( i18n("linking"), 1, 2, "(gcc|CC|cc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-o ([^\\s;]+)"),
+ ActionFormat( i18n("linking"), 1, 2, "^linking (.*)" ), //unsermaker
+ ActionFormat( i18n("linking"), 1, 1, "^Linking .* module (.*)" ), //cmake
+ ActionFormat( i18n("linking"), 1, 1, "^Linking (.*)" ), //cmake
+
+ ActionFormat( i18n("creating"), "", "/(?:bin/sh\\s.*mkinstalldirs).*\\s([^\\s;]+)", 1 ),
+ ActionFormat( i18n("installing"), "", "/(?:usr/bin/install|bin/sh\\s.*mkinstalldirs|bin/sh\\s.*libtool.*--mode=install).*\\s([^\\s;]+)", 1 ),
+ ActionFormat( i18n("generating"), "dcopidl", "dcopidl .* > ([^\\s;]+)", 1 ),
+ ActionFormat( i18n("compiling"), "dcopidl2cpp", "dcopidl2cpp (?:\\S* )*([^\\s;]+)", 1 ),
+ ActionFormat( i18n("installing"), 1, 1, "-- Installing (.*)" ), //cmake
+
+ ActionFormat( QString::null, QString::null, 0, 0 )
+ };
+
+ return formats;
+}
+
+void MakeActionFilter::processLine( const QString& line )
+{
+ ActionItem* actionItem = matchLine( line );
+ if ( actionItem != NULL )
+ {
+ emit item( actionItem );
+ }
+ else
+ {
+ OutputFilter::processLine( line );
+ }
+}
+
+ActionItem* MakeActionFilter::matchLine( const QString& line )
+{
+#ifdef DEBUG
+ QTime t;
+ t.start();
+#endif
+ /// \FIXME This is very slow, possibly due to the regexr matching. It can take
+ //900-1000ms to execute on an Athlon XP 2000+, while the UI is completely blocked.
+ int i = 0;
+ ActionFormat* aFormats = actionFormats();
+ ActionFormat* format = &aFormats[i];
+
+ while ( !format->action().isNull() )
+ {
+// kdDebug(9004) << "Testing filter: " << format->action << ": " << format->tool << endl;
+ if ( format->matches( line ) )
+ {
+ ActionItem *actionItem = new ActionItem( format->action(), format->file(), format->tool(), line );
+ kdDebug( 9004 ) << "Found: " << actionItem->m_action << " " << actionItem->m_file << "(" << actionItem->m_tool << ")" << endl;
+ return actionItem;
+ }
+#ifdef DEBUG
+ if ( t.elapsed() > 100 )
+ kdDebug(9004) << "MakeActionFilter::processLine: SLOW regexp matching: " << t.elapsed() << " ms \n";
+#endif
+ format = &aFormats[++i];
+ }
+ return 0;
+}
+
+struct TestItem
+{
+ TestItem() {}
+ TestItem( const QString& _line, const QString& _action, const QString& _tool, const QString& _file )
+ : line( _line )
+ , action( _action )
+ , tool( _tool )
+ , file( _file )
+ {}
+ QString line;
+ QString action;
+ QString tool;
+ QString file;
+};
+
+#ifdef DEBUG
+
+void MakeActionFilter::test()
+{
+ static QValueList<TestItem> testItems = QValueList<TestItem>()
+
+ << TestItem( // simple qmake compile
+ "g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/home/john/src/kde/qt-copy/mkspecs/default -I. "
+ "-I/home/john/src/kde/qt-copy/include -o test.o test.cpp",
+ "compiling", "g++", "test.cpp" )
+ << TestItem( // simple qmake compile different option order
+ "g++ -c -o test.o -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/home/john/src/kde/qt-copy/mkspecs/default -I. "
+ "-I/home/john/src/kde/qt-copy/include test.cpp",
+ "compiling", "g++", "test.cpp" )
+ << TestItem( // simple qmake link
+ "g++ -o ../bin/test test.o -Wl,-rpath,/home/john/src/kde/qt-copy/lib -L/home/john/src/kde/qt-copy/lib "
+ "-L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm",
+ "linking", "g++", "../bin/test" )
+ << TestItem( // automake 1.7, srcdir != builddir
+ "if /bin/sh ../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. "
+ "-I/home/john/src/kde/kdevelop/lib/interfaces -I../.. -I/usr/local/kde/include -I/home/john/src/kde/qt-copy/include "
+ "-I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W "
+ "-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion "
+ "-Wchar-subscripts -fno-builtin -g3 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new "
+ "-fno-common -MT kdevcore.lo -MD -MP -MF \".deps/kdevcore.Tpo\" -c -o kdevcore.lo `test -f "
+ "'/home/john/src/kde/kdevelop/lib/interfaces/kdevcore.cpp' || echo "
+ "'/home/john/src/kde/kdevelop/lib/interfaces/'`/home/john/src/kde/kdevelop/lib/interfaces/kdevcore.cpp; then mv "
+ "\".deps/kdevcore.Tpo\" \".deps/kdevcore.Plo\"; else rm -f \".deps/kdevcore.Tpo\"; exit 1; fi",
+ "compiling", "g++", "kdevcore.cpp" )
+ << TestItem( // automake 1.7, srcdir != builddir
+ "if g++ -DHAVE_CONFIG_H -I. -I/home/john/src/kde/kdevelop/src -I.. -I/home/john/src/kde/kdevelop/lib/interfaces "
+ "-I/home/john/src/kde/kdevelop/lib/sourceinfo -I/home/john/src/kde/kdevelop/lib/util -I/home/john/src/kde/kdevelop/lib "
+ "-I/home/john/src/kde/kdevelop/lib/qextmdi/include -I/home/john/src/kde/kdevelop/lib/structure -I/usr/local/kde/include "
+ "-I/home/john/src/kde/qt-copy/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor "
+ "-Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi "
+ "-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -fno-builtin -g3 -Wformat-security "
+ "-Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -MT mainwindowideal.o -MD -MP -MF "
+ "\".deps/mainwindowideal.Tpo\" -c -o mainwindowideal.o `test -f '/home/john/src/kde/kdevelop/src/mainwindowideal.cpp' "
+ "|| echo '/home/john/src/kde/kdevelop/src/'`/home/john/src/kde/kdevelop/src/mainwindowideal.cpp; then mv "
+ "\".deps/mainwindowideal.Tpo\" \".deps/mainwindowideal.Po\"; else rm -f \".deps/mainwindowideal.Tpo\"; exit 1; fi",
+ "compiling", "g++", "mainwindowideal.cpp" )
+ << TestItem( // automake and libtool compiling *.c files
+ "if /bin/sh ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../lib/interfaces"
+ "-I../../lib/util -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT "
+ "-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings "
+ "-D_XOPEN_SOURCE=500 -D_BSD_SOURCE -g3 -fno-inline -Wformat-security -Wmissing-format-attribute -MT readtags.lo "
+ "-MD -MP -MF \".deps/readtags.Tpo\" -c -o readtags.lo readtags.c; then mv -f \".deps/readtags.Tpo\" "
+ "\".deps/readtags.Plo\"; else rm -f \".deps/readtags.Tpo\"; exit 1; fi",
+ i18n("compiling"), "gcc", "readtags.c" )
+ << TestItem(
+ "source='makewidget.cpp' object='makewidget.lo' libtool=yes depfile='.deps/makewidget.Plo' "
+ "tmpdepfile='.deps/makewidget.TPlo' depmode=gcc3 /bin/sh ../../admin/depcomp /bin/sh ../../libtool --mode=compile "
+ "--tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../../lib/interfaces -I../../lib/util -I/opt/kde3/include "
+ "-I/usr/lib/qt3/include -I/usr/X11R6/include -DQT_THREAD_SUPPORT -D_REENTRANT -Wnon-virtual-dtor -Wno-long-long -Wundef "
+ "-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE "
+ "-Wcast-align -Wconversion -fno-builtin -g -O2 -g3 -O0 -fno-exceptions -fno-check-new -c -o makewidget.lo `test -f "
+ "'makewidget.cpp' || echo './'`makewidget.cpp",
+ "compiling", "g++", "makewidget.cpp" )
+ << TestItem( // automake 1.7, srcdir != builddir
+ "/bin/sh ../../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic "
+ "-W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align "
+ "-Wconversion -Wchar-subscripts -fno-builtin -g3 -Wformat-security -Wmissing-format-attribute -fno-exceptions "
+ "-fno-check-new -fno-common -o libkdevoutputviews.la.closure libkdevoutputviews_la_closure.lo -L/usr/X11R6/lib "
+ "-L/home/john/src/kde/qt-copy/lib -L/usr/local/kde/lib -avoid-version -module -no-undefined -R /usr/local/kde/lib "
+ "-R /home/john/src/kde/qt-copy/lib -R /usr/X11R6/lib outputviewsfactory.lo makeviewpart.lo makewidget.lo "
+ "appoutputviewpart.lo appoutputwidget.lo directorystatusmessagefilter.lo outputfilter.lo compileerrorfilter.lo "
+ "commandcontinuationfilter.lo makeitem.lo makeactionfilter.lo otherfilter.lo ../../lib/libkdevelop.la",
+ "linking", "libtool", "libkdevoutputviews.la.closure" )
+ << TestItem( //libtool, linking 2
+ "/bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic "
+ "-W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts "
+ "-fno-builtin -g3 -fno-exceptions -fno-check-new -fno-common -o libkfilereplacepart.la.closure libkfilereplacepart_la_closure.lo "
+ "-module -no-undefined -L/usr/X11R6/lib -L/usr/lib/qt3/lib -L/opt/kde3/lib -version-info 1:0:0 kfilereplacepart.lo kfilereplacedoc.lo "
+ "kfilereplaceview.lo kaboutkfilereplace.lo kaddstringdlg.lo kconfirmdlg.lo kernel.lo kexpression.lo kfilereplacepref.lo "
+ "klistviewstring.lo knewprojectdlg.lo koptionsdlg.lo kresultview.lo filelib.lo knewprojectdlgs.lo -lkio -lkparts -lkhtml",
+ "linking", "libtool", "libkfilereplacepart.la.closure")
+ << TestItem( //libtool, linking 3
+ "/bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic "
+ "-W -Wpointer-arith -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts "
+ "-fno-builtin -g3 -fno-exceptions -fno-check-new -fno-common -o libkfilereplacepart.la -rpath /opt/kde3/lib/kde3 "
+ "-module -no-undefined -L/usr/X11R6/lib -L/usr/lib/qt3/lib -L/opt/kde3/lib -version-info 1:0:0 kfilereplacepart.lo "
+ "kfilereplacedoc.lo kfilereplaceview.lo kaboutkfilereplace.lo kaddstringdlg.lo kconfirmdlg.lo kernel.lo kexpression.lo "
+ "kfilereplacepref.lo klistviewstring.lo knewprojectdlg.lo koptionsdlg.lo kresultview.lo filelib.lo knewprojectdlgs.lo -lkio -lkparts -lkhtml",
+ "linking", "libtool", "libkfilereplacepart.la")
+ << TestItem( //automake, builddir!=srcdir, libtool=no, compiling
+ " g++ -DHAVE_CONFIG_H -I. -I/home/andris/cvs-developement/head/quanta/quanta/project "
+ "-I../.. -I/home/andris/cvs-developement/head/quanta/quanta/dialogs -I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include "
+ "-I../../quanta/dialogs -DQT_THREAD_SUPPORT -D_REENTRANT -DKOMMANDER -DDESIGNER -DQT_NO_SQL -DHAVE_KDE -Wnon-virtual-dtor "
+ "-Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE "
+ "-Wcast-align -Wconversion -Wchar-subscripts -fno-builtin -g3 -DKDE_NO_COMPAT -fno-exceptions -fno-check-new -fno-common -c -o project.o "
+ "`test -f '/home/andris/cvs-developement/head/quanta/quanta/project/project.cpp' || "
+ "echo '/home/andris/cvs-developement/head/quanta/quanta/project/'`/home/andris/cvs-developement/head/quanta/quanta/project/project.cpp ",
+ "compiling", "g++", "project.cpp")
+ << TestItem(
+ "/usr/local/kde/bin/dcopidl /home/john/src/kde/kdevelop/lib/interfaces/KDevAppFrontendIface.h > KDevAppFrontendIface.kidl "
+ "|| ( rm -f KDevAppFrontendIface.kidl ; /bin/false )",
+ "generating", "dcopidl", "KDevAppFrontendIface.kidl" )
+ << TestItem(
+ "/usr/local/kde/bin/dcopidl2cpp --c++-suffix cpp --no-signals --no-stub KDevAppFrontendIface.kidl",
+ "compiling", "dcopidl2cpp", "KDevAppFrontendIface.kidl" )
+ << TestItem( //install
+ "/usr/bin/install -c -p -m 644 /home/andris/development/quanta/quanta/kommander/editor/kmdr-editor.desktop "
+ "/opt/kde3/share/applnk/Editors/kmdr-editor.desktop", "installing", "", "/opt/kde3/share/applnk/Editors/kmdr-editor.desktop")
+ << TestItem( //libtool install
+ "/bin/sh ../../libtool --silent --mode=install /usr/bin/install -c -p libkommanderwidgets.la "
+ "/opt/kde3/lib/libkommanderwidgets.la", "installing", "", "/opt/kde3/lib/libkommanderwidgets.la")
+ << TestItem( //libtool, automake 1.8
+ "if g++ -DHAVE_CONFIG_H -I. -I/home/andris/ "
+ "-DBUILD_KAFKAPART -MT quanta_init.o -MD -MP -MF \".deps/quanta_init.Tpo\" -c -o quanta_init.o "
+ "quanta_init.cpp; "
+ "then mv -f \".deps/quanta_init.Tpo\" \".deps/quanta_init.Po\"; else rm -f \".deps/quanta_init.Tpo\"; "
+ "exit 1; fi",
+ "compiling", "g++", "quanta_init.cpp")
+ << TestItem( //libtool, automake 1.8, file with full path
+ "if g++ -DHAVE_CONFIG_H -I. -I/home/andris/ "
+ "-DBUILD_KAFKAPART -MT quanta_init.o -MD -MP -MF \".deps/quanta_init.Tpo\" -c -o quanta_init.o "
+ "/home/andris/quanta_init.cpp; "
+ "then mv -f \".deps/quanta_init.Tpo\" \".deps/quanta_init.Po\"; else rm -f \".deps/quanta_init.Tpo\"; "
+ "exit 1; fi",
+ "compiling", "g++", "quanta_init.cpp")
+ ;
+
+ QValueList<TestItem>::const_iterator it = testItems.begin();
+ for( ; it != testItems.end(); ++it )
+ {
+ ActionItem* actionItem = matchLine( (*it).line );
+ if ( actionItem == NULL )
+ {
+ kdError( 9004 ) << "MakeActionFilter::test(): match failed (no match):" << endl;
+ kdError( 9004 ) << (*it).line << endl;
+ }
+ else if ( actionItem->m_action != (*it).action )
+ {
+ kdError( 9004 ) << "MakeActionFilter::test(): match failed (expected action "
+ << (*it).action << ", got " << actionItem->m_action << endl;
+ kdError( 9004 ) << (*it).line << endl;
+ }
+ else if ( actionItem->m_tool != (*it).tool )
+ {
+ kdError( 9004 ) << "MakeActionFilter::test(): match failed (expected tool "
+ << (*it).tool << ", got " << actionItem->m_tool << endl;
+ kdError( 9004 ) << (*it).line << endl;
+ }
+ else if ( actionItem->m_file != (*it).file )
+ {
+ kdError( 9004 ) << "MakeActionFilter::test(): match failed (expected file "
+ << (*it).file << ", got " << actionItem->m_file << endl;
+ kdError( 9004 ) << (*it).line << endl;
+ } else
+ kdDebug( 9004 ) << "Test passed, " << actionItem->m_action << " " << actionItem->m_file << " (" << actionItem->m_tool << ") found." << endl;
+ if ( actionItem != NULL )
+ delete actionItem;
+ }
+
+}
+
+#endif
diff --git a/parts/outputviews/makeactionfilter.h b/parts/outputviews/makeactionfilter.h
new file mode 100644
index 00000000..66de7a3b
--- /dev/null
+++ b/parts/outputviews/makeactionfilter.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MakeActionFilter_h
+#define MakeActionFilter_h
+
+#include <qobject.h>
+#include <qregexp.h>
+#include <qvaluelist.h>
+#include "outputfilter.h"
+
+class MakeItem;
+class ActionItem;
+
+class MakeActionFilter : public QObject, public OutputFilter
+{
+Q_OBJECT
+
+public:
+#ifdef DEBUG
+ static void test();
+#endif
+
+ MakeActionFilter( OutputFilter& );
+
+ class ActionFormat
+ {
+ public:
+ ActionFormat():m_toolGroup(-1) {}
+ ActionFormat( const QString&, const QString&, const char * regExp, int file);
+ ActionFormat( const QString&, int tool, int file, const char * regExp);
+ QString tool();
+ QString file();
+ const QString& action() const {return m_action;}
+ bool matches(const QString& line);
+ private:
+ QString m_action;
+ QRegExp m_expression;
+ QString m_tool;
+ int m_toolGroup;
+ int m_fileGroup;
+ };
+ static ActionFormat* actionFormats();
+
+ void processLine( const QString& line );
+
+signals:
+ void item( MakeItem* );
+
+private:
+ static ActionItem* matchLine( const QString& line );
+};
+
+#endif
diff --git a/parts/outputviews/makeitem.cpp b/parts/outputviews/makeitem.cpp
new file mode 100644
index 00000000..c4d5a04c
--- /dev/null
+++ b/parts/outputviews/makeitem.cpp
@@ -0,0 +1,166 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "makeitem.h"
+
+#include <qstylesheet.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+
+#include "ktexteditor/cursorinterface.h"
+
+MakeItem::MakeItem()
+{
+}
+
+MakeItem::MakeItem( const QString& text )
+ : m_text( text )
+{
+}
+
+MakeItem::~MakeItem()
+{
+}
+
+QString MakeItem::color( bool bright_bg )
+{
+ switch ( type() )
+ {
+ case Error:
+ return bright_bg ? "maroon" : "red";
+ case Warning:
+ return bright_bg ? "#666" : "#999";
+ case Diagnostic:
+ return bright_bg ? "black" : "white";
+ default:
+ return bright_bg ? "navy" : "blue";
+ }
+}
+
+QString MakeItem::icon()
+{
+ switch ( type() )
+ {
+ case Error:
+ case Warning:
+ return "<img src=\"error\"></img><nobr> </nobr>";
+ case Diagnostic:
+ return "<img src=\"warning\"></img><nobr> </nobr>";
+ default:
+ return "<img src=\"message\"></img><nobr> </nobr>";
+ }
+}
+
+QString MakeItem::text( EOutputLevel )
+{
+ return QStyleSheet::escape( m_text );
+}
+
+QString MakeItem::formattedText( EOutputLevel level, bool bright_bg )
+{
+ QString txt = text(level);
+ if (txt.isEmpty())
+ return "<br>";
+ if ( level == eFull )
+ {
+ return txt;
+ }
+ else
+ {
+ return QString("<code>")
+ .append( icon() ).append("<font color=\"").append( color( bright_bg) ).append("\">")
+ .append( txt ).append("</font></code>").append( br() );
+ }
+}
+
+QString MakeItem::br()
+{
+ // Qt >= 3.1 doesn't need a <br>.
+#if QT_VERSION < 0x040000
+ static const QString br = QString::fromLatin1( qVersion() ).section( ".", 1, 1 ).toInt() > 0 ? "" : "<br>";
+#else
+ static const QString br;
+#endif
+ return br;
+}
+
+ErrorItem::ErrorItem( const QString& fn, int ln, const QString& tx, const QString& line, bool isWarning, bool isInstatiationInfo, const QString& compiler )
+ : MakeItem( line )
+ , fileName(fn)
+ , lineNum(ln)
+ , m_error(tx)
+ , m_isWarning(isWarning | isInstatiationInfo)
+ , m_isInstatiationInfo( isInstatiationInfo )
+ , m_compiler(compiler)
+{}
+
+ErrorItem::~ErrorItem()
+{
+}
+
+bool ErrorItem::append( const QString& text )
+{
+ if ( !text.startsWith(" ") )
+ return false;
+ if ( text.startsWith(" ") && (m_compiler == "intel") )
+ return false;
+ m_text += text;
+ m_error += text;
+ m_error = m_error.simplifyWhiteSpace();
+ m_text = m_text.simplifyWhiteSpace();
+ return true;
+}
+
+ExitStatusItem::ExitStatusItem( bool normalExit, int exitStatus )
+ : m_normalExit( normalExit )
+ , m_exitStatus( exitStatus )
+{
+// kdDebug() << "ExitStatusItem: normalExit=" << normalExit << "; exitStatus=" << exitStatus << endl;
+ m_text = i18n("*** Compilation aborted ***");
+ if ( m_normalExit )
+ if (m_exitStatus )
+ m_text = i18n("*** Exited with status: %1 ***").arg( m_exitStatus );
+ else
+ m_text = i18n("*** Success ***");
+}
+
+QString ExitStatusItem::text( EOutputLevel )
+{
+ return m_text;
+}
+
+bool DirectoryItem::m_showDirectoryMessages = true;
+
+QString EnteringDirectoryItem::text( EOutputLevel outputLevel )
+{
+ if ( outputLevel < eFull )
+ return i18n("Entering directory %1").arg( directory );
+ return m_text;
+}
+
+QString ExitingDirectoryItem::text( EOutputLevel outputLevel )
+{
+ if ( outputLevel < eFull )
+ return i18n("Leaving directory %1").arg( directory );
+ return m_text;
+}
+
+QString ActionItem::text( EOutputLevel outputLevel )
+{
+ if ( outputLevel < eFull )
+ {
+ if ( m_tool.isEmpty() )
+ return QString(m_action).append(" <b>").append(m_file).append("</b>");
+ return QString(m_action).append(" <b>").append(m_file).append("</b>").append(" (").append(m_tool).append(")");
+ }
+ return MakeItem::text( outputLevel );
+}
diff --git a/parts/outputviews/makeitem.h b/parts/outputviews/makeitem.h
new file mode 100644
index 00000000..e95dd4df
--- /dev/null
+++ b/parts/outputviews/makeitem.h
@@ -0,0 +1,164 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MakeItem_h
+#define MakeItem_h
+
+#include <qstring.h>
+
+enum EOutputLevel
+{
+ // appropriate to the ID's in the button group of settingswidget.ui
+ eVeryShort = 0
+ ,eShort
+ ,eFull
+};
+
+class MakeItem
+{
+public:
+ enum Type { Normal, Error, Warning, Diagnostic };
+ MakeItem();
+ MakeItem( const QString& text );
+ virtual ~MakeItem();
+
+ enum DisplayModes
+ {
+ DelayedDisplay = 0, // item can be displayed later
+ ImmDisplay = 1, // item has to be displayed ASAP
+ Append = 2 // item's text can be appended (append has been overloaded)
+ };
+ virtual int displayMode() const { return ImmDisplay; }
+ virtual bool append( const QString& ) { return false; }
+ virtual Type type() { return Diagnostic; }
+ virtual bool visible( EOutputLevel level ) { return level > eVeryShort; }
+ virtual QString text( EOutputLevel );
+ virtual QString formattedText( EOutputLevel, bool bright_bg );
+ QString icon();
+ QString color( bool bright_bg );
+
+ static QString br();
+
+ QString m_text;
+};
+
+class CommandItem : public MakeItem
+{
+public:
+ CommandItem(const QString command)
+ : MakeItem( command )
+ {}
+
+ Type type() { return Diagnostic; }
+ virtual bool visible( EOutputLevel ) { return true; }
+};
+
+class ExitStatusItem : public MakeItem
+{
+public:
+ ExitStatusItem( bool normalExit, int exitStatus );
+
+ Type type() { return m_normalExit && m_exitStatus == 0 ? Diagnostic : Error; }
+ virtual bool visible( EOutputLevel ) { return true; }
+ QString text( EOutputLevel level );
+
+private:
+ bool m_normalExit;
+ int m_exitStatus;
+};
+
+class DirectoryItem : public MakeItem
+{
+public:
+ DirectoryItem( const QString& dir, const QString& text )
+ : MakeItem( text )
+ , directory( dir )
+ {}
+
+ Type type() { return Diagnostic; }
+
+ static void setShowDirectoryMessages( bool show ) { m_showDirectoryMessages = show; }
+ static bool getShowDirectoryMessages() { return m_showDirectoryMessages; }
+
+ QString directory;
+
+protected:
+ static bool m_showDirectoryMessages;
+};
+
+class EnteringDirectoryItem : public DirectoryItem
+{
+public:
+ EnteringDirectoryItem( const QString& dir, const QString& text )
+ : DirectoryItem( dir, text )
+ {}
+ bool visible( EOutputLevel )
+ {
+ return m_showDirectoryMessages;
+ }
+
+ virtual QString text( EOutputLevel );
+};
+
+class ExitingDirectoryItem : public DirectoryItem
+{
+public:
+ ExitingDirectoryItem( const QString& dir, const QString& text )
+ : DirectoryItem( dir, text )
+ {}
+ bool visible( EOutputLevel level )
+ {
+ return m_showDirectoryMessages && level > eVeryShort;
+ }
+
+ virtual QString text( EOutputLevel );
+};
+
+namespace KTextEditor { class Cursor; class Document; }
+
+class ErrorItem : public MakeItem
+{
+public:
+ ErrorItem( const QString& fn, int ln, const QString& tx, const QString& line, bool isWarning, bool isInstatiationInfo, const QString& compiler );
+ virtual ~ErrorItem();
+
+ virtual bool append( const QString& text );
+ virtual int displayMode() const { return DelayedDisplay | Append; }
+ Type type() { return m_isInstatiationInfo ? Diagnostic : (m_isWarning ? Warning : Error); }
+ virtual bool visible( EOutputLevel ) { return true; }
+
+ QString fileName;
+ int lineNum;
+ QString m_error;
+ bool m_isWarning;
+ bool m_isInstatiationInfo; ///this also implies isWarning
+ QString m_compiler;
+};
+
+class ActionItem : public MakeItem
+{
+public:
+ ActionItem( const QString& action, const QString& file, const QString& tool, const QString& line )
+ : MakeItem( line )
+ , m_action( action )
+ , m_file( file )
+ , m_tool( tool )
+ {}
+
+ virtual bool visible( EOutputLevel ) { return true; }
+ virtual QString text( EOutputLevel level );
+
+ QString m_action;
+ QString m_file;
+ QString m_tool;
+};
+
+#endif
diff --git a/parts/outputviews/makeviewpart.cpp b/parts/outputviews/makeviewpart.cpp
new file mode 100644
index 00000000..3f2ebbd8
--- /dev/null
+++ b/parts/outputviews/makeviewpart.cpp
@@ -0,0 +1,105 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "makeviewpart.h"
+
+#include <qwhatsthis.h>
+#include <qdir.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kiconloader.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "kdevproject.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+
+#include "makewidget.h"
+
+static const KDevPluginInfo data("kdevmakeview");
+typedef KDevGenericFactory< MakeViewPart > MakeViewFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevmakeview, MakeViewFactory( data ) )
+
+MakeViewPart::MakeViewPart(QObject *parent, const char *name, const QStringList &)
+ : KDevMakeFrontend(&data, parent, name)
+{
+ setInstance(MakeViewFactory::instance());
+
+ setXMLFile("kdevmakeview.rc");
+
+ m_dcop = new KDevMakeFrontendIface(this);
+
+ m_widget = new MakeWidget(this);
+ m_widget->setIcon( SmallIcon("exec") );
+ m_widget->setCaption(i18n("Messages Output"));
+ QWhatsThis::add(m_widget, i18n("<b>Messages output</b><p>"
+ "The messages window shows the output of the compiler and "
+ "used build tools like make, ant, uic, dcopidl etc. "
+ "For compiler error messages, click on the error message. "
+ "This will automatically open the source file and set the "
+ "cursor to the line that caused the compiler error/warning."));
+
+ mainWindow()->embedOutputView(m_widget, i18n("Messages"), i18n("Compiler output messages"));
+
+ KAction *action;
+ action = new KAction( i18n("&Next Error"), Key_F4, m_widget, SLOT(nextError()),
+ actionCollection(), "view_next_error");
+ action->setToolTip( i18n("Go to the next error") );
+ action->setWhatsThis(i18n("<b>Next error</b><p>Switches to the file and line where the next error was reported from."));
+ action = new KAction( i18n("&Previous Error"), SHIFT+Key_F4, m_widget, SLOT(prevError()),
+ actionCollection(), "view_previous_error");
+ action->setToolTip( i18n("Go to the previous error") );
+ action->setWhatsThis(i18n("<b>Previous error</b><p>Switches to the file and line where the previous error was reported from."));
+
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
+}
+
+
+MakeViewPart::~MakeViewPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+ delete m_dcop;
+}
+
+void MakeViewPart::slotStopButtonClicked(KDevPlugin* which)
+{
+ if ( which != 0 && which != this )
+ return;
+ m_widget->killJob();
+}
+
+void MakeViewPart::queueCommand(const QString &dir, const QString &command)
+{
+ m_widget->queueJob(dir, command);
+}
+
+
+bool MakeViewPart::isRunning()
+{
+ return m_widget->isRunning();
+}
+
+QWidget* MakeViewPart::widget()
+{
+ return m_widget.operator->();
+}
+
+void MakeViewPart::updateSettingsFromConfig()
+{
+ m_widget->updateSettingsFromConfig();
+}
+
+#include "makeviewpart.moc"
diff --git a/parts/outputviews/makeviewpart.h b/parts/outputviews/makeviewpart.h
new file mode 100644
index 00000000..78f969ff
--- /dev/null
+++ b/parts/outputviews/makeviewpart.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _MAKEVIEWPART_H_
+#define _MAKEVIEWPART_H_
+
+#include <qguardedptr.h>
+
+#include "kdevmakefrontend.h"
+#include "KDevMakeFrontendIface.h"
+
+
+class MakeWidget;
+
+class MakeViewPart : public KDevMakeFrontend
+{
+ Q_OBJECT
+
+public:
+ MakeViewPart( QObject *parent, const char *name, const QStringList & );
+ ~MakeViewPart();
+ virtual QWidget* widget();
+ virtual void updateSettingsFromConfig();
+
+private slots:
+ void slotStopButtonClicked(KDevPlugin*);
+
+protected:
+ virtual void queueCommand(const QString &dir, const QString &command);
+ virtual bool isRunning();
+
+private:
+ QGuardedPtr<MakeWidget> m_widget;
+ KDevMakeFrontendIface *m_dcop;
+ friend class MakeWidget;
+};
+
+#endif
diff --git a/parts/outputviews/makewidget.cpp b/parts/outputviews/makewidget.cpp
new file mode 100644
index 00000000..554713c4
--- /dev/null
+++ b/parts/outputviews/makewidget.cpp
@@ -0,0 +1,847 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "makewidget.h"
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "processlinemaker.h"
+#include "makeviewpart.h"
+#include "makeitem.h"
+#include "ktexteditor/document.h"
+#include "ktexteditor/cursorinterface.h"
+#include "ktexteditor/editinterface.h"
+#include "urlutil.h"
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <knotifyclient.h>
+#include <kprocess.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kinstance.h>
+#include <kstatusbar.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+#include <qmessagebox.h>
+#include <qapplication.h>
+#include <qdir.h>
+#include <qimage.h>
+#include <qstylesheet.h>
+#include <qtimer.h>
+#include <qfileinfo.h>
+#include <qclipboard.h>
+#include <qpopupmenu.h>
+#include <private/qrichtext_p.h>
+
+#include <stdlib.h>
+#include <limits.h>
+
+static const char *const error_xpm[] =
+ {
+ "11 11 5 1",
+ ". c None",
+ "# c #313062",
+ "a c #6261cd",
+ "b c #c50000",
+ "c c #ff8583",
+ "...........",
+ "...####....",
+ ".a#bbbb#a..",
+ ".#ccbbbb#..",
+ "#bccbbbbb#.",
+ "#bbbbbbbb#.",
+ "#bbbbbbcb#.",
+ "#bbbbbccb#.",
+ ".#bbbccb#..",
+ ".a#bbbb#a..",
+ "...####...."
+ };
+
+
+static const char *const warning_xpm[] =
+ {
+ "11 11 5 1",
+ ". c None",
+ "# c #313062",
+ "a c #6261cd",
+ "b c #c5c600",
+ "c c #ffff41",
+ "...........",
+ "...####....",
+ ".a#bbbb#a..",
+ ".#ccbbbb#..",
+ "#bccbbbbb#.",
+ "#bbbbbbbb#.",
+ "#bbbbbbcb#.",
+ "#bbbbbccb#.",
+ ".#bbbccb#..",
+ ".a#bbbb#a..",
+ "...####...."
+ };
+
+
+static const char *const message_xpm[] =
+ {
+ "11 11 5 1",
+ ". c None",
+ "b c #3100c5",
+ "# c #313062",
+ "c c #3189ff",
+ "a c #6265cd",
+ "...........",
+ "...####....",
+ ".a#bbbb#a..",
+ ".#ccbbbb#..",
+ "#bccbbbbb#.",
+ "#bbbbbbbb#.",
+ "#bbbbbbcb#.",
+ "#bbbbbccb#.",
+ ".#bbbccb#..",
+ ".a#bbbb#a..",
+ "...####...."
+ };
+
+
+class SelectionPreserver
+{
+public:
+ SelectionPreserver( QTextEdit& textEdit, bool stayAtEnd )
+ : m_textEdit( textEdit )
+ , m_atEnd( false )
+ {
+ int para, index;
+ m_textEdit.getCursorPosition( &para, &index );
+
+ m_atEnd = stayAtEnd
+ && para == m_textEdit.paragraphs() - 1
+ && index == m_textEdit.paragraphLength( para );
+
+ m_textEdit.getSelection(&paraFrom, &indexFrom, &paraTo, &indexTo, 0);
+ }
+
+ ~SelectionPreserver()
+ {
+ m_textEdit.setSelection(paraFrom, indexFrom, paraTo, indexTo, 0);
+
+ if ( m_atEnd )
+ {
+ m_textEdit.moveCursor(QTextEdit::MoveEnd, false);
+ m_textEdit.moveCursor(QTextEdit::MoveLineStart, false);//if linewrap is off we must avoid the jumping of the vertical scrollbar
+ }
+ }
+
+ QTextEdit& m_textEdit;
+ bool m_atEnd;
+ int paraFrom, indexFrom, paraTo, indexTo;
+};
+
+MakeWidget::MakeWidget(MakeViewPart *part)
+ : QTextEdit(0, "make widget")
+ , m_directoryStatusFilter( m_errorFilter )
+ , m_errorFilter( m_continuationFilter )
+ , m_continuationFilter( m_actionFilter )
+ , m_actionFilter( m_otherFilter )
+ , m_pendingItem(0)
+ , m_paragraphs(0)
+ , m_lastErrorSelected(-1)
+ , m_part(part)
+ , m_vertScrolling(false)
+ , m_horizScrolling(false)
+ , m_bCompiling(false)
+{
+ updateSettingsFromConfig();
+
+ setTextFormat( Qt::RichText );
+
+ if ( m_bLineWrapping )
+ setWordWrap(WidgetWidth);
+ else
+ setWordWrap(NoWrap);
+
+ setWrapPolicy(Anywhere);
+ setReadOnly(true);
+ setMimeSourceFactory(new QMimeSourceFactory);
+ mimeSourceFactory()->setImage("error", QImage((const char**)error_xpm));
+ mimeSourceFactory()->setImage("warning", QImage((const char**)warning_xpm));
+ mimeSourceFactory()->setImage("message", QImage((const char**)message_xpm));
+
+ dirstack.setAutoDelete(true);
+
+ childproc = new KProcess(this);
+ procLineMaker = new ProcessLineMaker( childproc );
+
+ connect( procLineMaker, SIGNAL(receivedStdoutLine(const QCString&)),
+ this, SLOT(insertStdoutLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedStderrLine(const QCString&)),
+ this, SLOT(insertStderrLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedPartialStdoutLine(const QCString&)),
+ this, SLOT(storePartialStdoutLine(const QCString&) ));
+ connect( procLineMaker, SIGNAL(receivedPartialStderrLine(const QCString&)),
+ this, SLOT(storePartialStderrLine(const QCString&) ));
+
+ connect( childproc, SIGNAL(processExited(KProcess*)),
+ this, SLOT(slotProcessExited(KProcess*) )) ;
+
+ connect( &m_directoryStatusFilter, SIGNAL(item(EnteringDirectoryItem*)),
+ this, SLOT(slotEnteredDirectory(EnteringDirectoryItem*)) );
+ connect( &m_directoryStatusFilter, SIGNAL(item(ExitingDirectoryItem*)),
+ this, SLOT(slotExitedDirectory(ExitingDirectoryItem*)) );
+ connect( &m_errorFilter, SIGNAL(item(MakeItem*)),
+ this, SLOT(insertItem(MakeItem*)) );
+ connect( &m_actionFilter, SIGNAL(item(MakeItem*)),
+ this, SLOT(insertItem(MakeItem*)) );
+ connect( &m_otherFilter, SIGNAL(item(MakeItem*)),
+ this, SLOT(insertItem(MakeItem*)) );
+
+ connect( verticalScrollBar(), SIGNAL(sliderPressed()),
+ this, SLOT(verticScrollingOn()) );
+ connect( verticalScrollBar(), SIGNAL(sliderReleased()),
+ this, SLOT(verticScrollingOff()) );
+ connect( horizontalScrollBar(), SIGNAL(sliderPressed()),
+ this, SLOT(horizScrollingOn()) );
+ connect( horizontalScrollBar(), SIGNAL(sliderReleased()),
+ this, SLOT(horizScrollingOff()) );
+
+// this slot doesn't exist anymore
+// connect( m_part->partController(), SIGNAL(loadedFile(const KURL&)),
+// this, SLOT(slotDocumentOpened(const KURL&)) );
+}
+
+MakeWidget::~MakeWidget()
+{
+ delete mimeSourceFactory();
+ delete childproc;
+ delete procLineMaker;
+}
+
+void MakeWidget::queueJob(const QString &dir, const QString &command)
+{
+ commandList.append(command);
+ dirList.append(dir);
+ if (!isRunning())
+ {
+ // Store the current output view so that it
+ // can be restored after a successful compilation
+// m_part->mainWindow()->storeOutputViewTab();
+ startNextJob();
+ }
+}
+
+void MakeWidget::startNextJob()
+{
+ QStringList::Iterator it = commandList.begin();
+ if ( it == commandList.end() )
+ return;
+
+ currentCommand = *it;
+ commandList.remove(it);
+
+ int i = currentCommand.findRev(" gmake");
+ if ( i == -1 )
+ i = currentCommand.findRev(" make");
+ if ( i == -1 )
+ m_bCompiling = false;
+ else
+ {
+ QString s = currentCommand.right(currentCommand.length() - i);
+ if ( s.contains("configure ") ||
+ s.contains(" Makefile.cvs") ||
+ s.contains(" clean") ||
+ s.contains(" distclean") ||
+ s.contains(" package-messages") ||
+ s.contains(" install") )
+ {
+ m_bCompiling = false;
+ }
+ else {
+ m_bCompiling = true;
+ }
+ }
+
+ it = dirList.begin();
+ QString dir = *it;
+ m_lastBuildDir = dir;
+ dirList.remove(it);
+
+ clear(); // clear the widget
+ for ( QValueVector<MakeItem*>::iterator it = m_items.begin(); it != m_items.end(); ++it )
+ delete *it;
+ m_items.clear();
+ m_paragraphToItem.clear();
+ m_paragraphs = 0;
+ m_lastErrorSelected = -1;
+
+ insertItem( new CommandItem( currentCommand ) );
+
+ childproc->clearArguments();
+ *childproc << currentCommand;
+ childproc->setUseShell(true);
+ childproc->start(KProcess::OwnGroup, KProcess::AllOutput);
+
+ dirstack.clear();
+ dirstack.push(new QString(dir));
+
+ m_part->mainWindow()->raiseView(this);
+ m_part->core()->running(m_part, true);
+}
+
+void MakeWidget::killJob()
+{
+ if (!childproc->kill(SIGINT))
+ childproc->kill();
+}
+
+bool MakeWidget::isRunning()
+{
+ return childproc->isRunning();
+}
+
+void MakeWidget::copy()
+{
+ int parafrom=0, indexfrom=0, parato=0, indexto=0;
+ getSelection(&parafrom, &indexfrom, &parato, &indexto);
+ if( parafrom < 0 || indexfrom < 0 || parato < 0 || indexto < 0
+ || ((parafrom == parato) && (indexfrom == indexto)) )
+ {
+ return;
+ }
+
+ QString selection;
+ for(int i = parafrom; i<=parato; i++)
+ selection += text(i) + "\n";
+
+
+ if(m_compilerOutputLevel == eShort ||
+ m_compilerOutputLevel == eVeryShort )
+ {
+ QRegExp regexp("<.*>");
+ regexp.setMinimal(true);
+ selection.remove(regexp);
+ }
+ else
+ { //FIXME: Selections should be precise in the eShort and eVeryShort modes, too.
+ selection.remove(0, indexfrom);
+ int removeend = text(parato).length() - indexto;
+
+ selection.remove((selection.length()-1) - removeend, removeend);
+ }
+
+ selection.replace("&lt;","<");
+ selection.replace("&gt;",">");
+ selection.replace("&quot;","\"");
+ selection.replace("&amp;","&");
+
+ kapp->clipboard()->setText(selection, QClipboard::Clipboard);
+}
+
+void MakeWidget::nextError()
+{
+ int parag;
+ if (m_lastErrorSelected != -1)
+ parag = m_lastErrorSelected;
+ else
+ parag = 0;
+
+ //if there are no errors after m_lastErrorSelected try again from the beginning
+ if (!scanErrorForward(parag))
+ if (m_lastErrorSelected != -1)
+ {
+ m_lastErrorSelected = -1;
+ if (!scanErrorForward(0))
+ KNotifyClient::beep();
+ }
+ else
+ KNotifyClient::beep();
+}
+
+void MakeWidget::prevError()
+{
+ int parag;
+ if (m_lastErrorSelected != -1)
+ parag = m_lastErrorSelected;
+ else
+ parag = 0;
+
+ //if there are no errors before m_lastErrorSelected try again from the end
+ if (!scanErrorBackward(parag))
+ if (m_lastErrorSelected != -1)
+ {
+ m_lastErrorSelected = -1;
+#if QT_VERSION >= 0x030100
+ parag = (int)m_items.count();
+#else
+ parag = m_items.size();
+#endif
+ if (!scanErrorBackward(parag))
+ KNotifyClient::beep();
+ }
+ else
+ KNotifyClient::beep();
+}
+
+void MakeWidget::contentsMouseReleaseEvent( QMouseEvent* e )
+{
+ QTextEdit::contentsMouseReleaseEvent(e);
+ if ( e->button() != LeftButton )
+ return;
+ searchItem(paragraphAt(e->pos()));
+}
+
+void MakeWidget::keyPressEvent(QKeyEvent *e)
+{
+ if (e->key() == Key_Return || e->key() == Key_Enter)
+ {
+ int parag, index;
+ getCursorPosition(&parag, &index);
+ searchItem(parag);
+ }
+ else
+ QTextEdit::keyPressEvent(e);
+}
+
+// returns the current directory for parag
+QString MakeWidget::directory(int parag) const
+{
+ QValueVector<MakeItem*>::const_iterator it = qFind( m_items.begin(), m_items.end(), m_paragraphToItem[parag] );
+ if ( it == m_items.end() )
+ return QString::null;
+ // run backwards over directories and figure out where we are
+ while ( it != m_items.begin() ) {
+ --it;
+ EnteringDirectoryItem* edi = dynamic_cast<EnteringDirectoryItem*>( *it );
+ if ( edi )
+ return edi->directory + "/";
+ }
+ return QString::null;
+}
+
+// hackish function that will return true and put string "file" in "fName" if the file
+// exists
+static bool checkFileExists( const QString& file, QString& fName )
+{
+ if ( QFile::exists( file ) ) {
+ fName = file;
+ return true;
+ }
+ return false;
+}
+
+void MakeWidget::specialCheck( const QString& file, QString& fName ) const
+{
+ QString firstLine = text(0);
+ QRegExp rx("cd \\'(.*)\\'.*");
+ if (rx.search(firstLine) != -1)
+ {
+ KURL url(rx.cap(1)+"/", file);
+ if (url.isValid())
+ {
+ kdDebug(9004) << "MakeWidget::specialCheck thinks that url is: " << url.url()
+ << " origin: " << file << endl;
+ fName = url.url();
+ return;
+ }
+ }
+ // Ok the "worst case", lets see if we can find a file in the project that has the same name
+ // obviously this will pick always the wrong file when you've got the same filename multiple times.
+ QStringList files = m_part->project()->allFiles();
+ for( QStringList::iterator it = files.begin() ; it != files.end(); ++it)
+ {
+ if( (*it).contains( file ) )
+ {
+ fName = URLUtil::canonicalPath( m_part->project()->projectDirectory() + "/" + *it );
+ }
+ }
+}
+
+QString MakeWidget::guessFileName( const QString& fName, int parag ) const
+{
+ // pathological case
+ if ( ! m_part->project() ) return fName;
+
+ QString name;
+ QString dir = directory( parag );
+
+ if ( fName.startsWith( "/" ) )
+ {
+ // absolute path given
+ name = fName;
+ }
+ else if ( !dir.isEmpty() )
+ {
+ name = dir + fName;
+ }
+ else
+ {
+ // now it gets tricky - no directory navigation messages,
+ // no absolute path - let's guess.
+ name = fName;
+ if ( !checkFileExists( m_lastBuildDir + "/" + fName, name) &&
+ !checkFileExists( m_part->project()->projectDirectory() + "/" + fName, name ) &&
+ !checkFileExists( m_part->project()->projectDirectory() + "/" + m_part->project()->activeDirectory() + "/" + fName, name ) &&
+ !checkFileExists( m_part->project()->buildDirectory() + "/" + fName, name ) )
+ specialCheck(fName, name);
+ }
+
+ kdDebug(9004) << "Opening file: " << name << endl;
+
+ // GNU make resolves symlinks. if "name" is a real path to a file the
+ // project know by symlink path, we need to return the symlink path
+// QStringList projectFiles = m_part->project()->allFiles();
+ QStringList projectFiles = m_part->project()->symlinkProjectFiles();
+ QStringList::iterator it = projectFiles.begin();
+ while ( it != projectFiles.end() )
+ {
+ QString file = m_part->project()->projectDirectory() + "/" + *it;
+ if ( name == URLUtil::canonicalPath( file ) )
+ {
+ kdDebug(9004) << "Found file in project - " << file << " == " << name << endl;
+ return file;
+ }
+ ++it;
+ }
+
+ // this should only happen if the file is not in the project
+ return name;
+}
+
+void MakeWidget::searchItem(int parag)
+{
+ ErrorItem* item = dynamic_cast<ErrorItem*>( m_paragraphToItem[parag] );
+ if ( item )
+ {
+ // open the file
+ kdDebug(9004) << "Opening file: " << guessFileName(item->fileName, parag) << endl;
+ m_part->partController()->editDocument(KURL( guessFileName(item->fileName, parag) ), item->lineNum);
+ m_part->mainWindow()->statusBar()->message( item->m_error, 10000 );
+ m_lastErrorSelected = parag;
+ }
+}
+
+void MakeWidget::insertStdoutLine( const QCString& line )
+{
+ QString sline;
+ bool forceCLocale = KConfigGroup( kapp->config(), "MakeOutputWidget" ).readBoolEntry( "ForceCLocale", true );
+
+ if( forceCLocale )
+ sline = QString::fromAscii( stdoutbuf+line );
+ else
+ sline = QString::fromLocal8Bit( stdoutbuf+line );
+
+ if ( !appendToLastLine( sline ) )
+ m_directoryStatusFilter.processLine( sline );
+ stdoutbuf.truncate(0);
+}
+
+void MakeWidget::insertStderrLine( const QCString& line )
+{
+ QString sline;
+ bool forceCLocale = KConfigGroup( kapp->config(), "MakeOutputWidget" ).readBoolEntry( "ForceCLocale", true );
+
+ if( forceCLocale ) {
+ sline = QString( stderrbuf+line );
+ }
+ else
+ sline = QString::fromLocal8Bit( stderrbuf+line );
+
+ if ( !appendToLastLine( sline ) )
+ m_errorFilter.processLine( sline );
+ stderrbuf.truncate(0);
+}
+
+void MakeWidget::slotProcessExited(KProcess *)
+{
+ procLineMaker->flush();
+ if( !stderrbuf.isEmpty() )
+ insertStderrLine("");
+ if( !stdoutbuf.isEmpty() )
+ insertStdoutLine("");
+ if (childproc->normalExit())
+ {
+ if (childproc->exitStatus())
+ {
+ KNotifyClient::event( topLevelWidget()->winId(), "ProcessError", i18n("The process has finished with errors"));
+ emit m_part->commandFailed(currentCommand);
+ }
+ else
+ {
+ KNotifyClient::event( topLevelWidget()->winId(), "ProcessSuccess", i18n("The process has finished successfully"));
+ emit m_part->commandFinished(currentCommand);
+ }
+ }
+
+ MakeItem* item = new ExitStatusItem( childproc->normalExit(), childproc->exitStatus() );
+ insertItem( item );
+ displayPendingItem();
+
+ m_part->mainWindow()->statusBar()->message( QString("%1: %2").arg(currentCommand).arg(item->m_text), 3000);
+ m_part->core()->running(m_part, false);
+
+ // Defensive programming: We emit this with a single shot timer so that we go once again
+ // through the event loop. After that, we can be sure that the process is really finished
+ // and its KProcess object can be reused.
+ if (childproc->normalExit() && !childproc->exitStatus())
+ {
+ QTimer::singleShot(0, this, SLOT(startNextJob()));
+// if (commandList.isEmpty())
+ // The last command on the list was successful so restore the
+ // output view to what it had before the compilation process started
+// m_part->mainWindow()->restoreOutputViewTab();
+ }
+ else
+ {
+ commandList.clear();
+ dirList.clear();
+ }
+}
+
+void MakeWidget::slotEnteredDirectory( EnteringDirectoryItem* item )
+{
+// kdDebug(9004) << "Entering dir: " << item->directory << endl;
+ QString* dir = new QString( item->directory );
+ dirstack.push( dir );
+ insertItem( item );
+}
+
+void MakeWidget::slotExitedDirectory( ExitingDirectoryItem* item )
+{
+ QString eDir = item->directory;
+// kdDebug(9004) << "Leaving dir: " << eDir << endl;
+ QString *dir = dirstack.pop();
+ if (!dir)
+ {
+ kdWarning(9004) << "Left more directories than entered: " << eDir;
+ }
+ else if (dir->compare(eDir) != 0)
+ {
+ kdWarning(9004) << "Expected directory: \"" << *dir << "\" but got \"" << eDir << "\"" << endl;
+ }
+ insertItem( item );
+ if (dirstack.top())
+ insertItem( new EnteringDirectoryItem( *dirstack.top(), "" ) );
+ delete dir;
+}
+
+void MakeWidget::displayPendingItem()
+{
+ if (!m_pendingItem) return;
+ // this handles the case of ImmDisplay|Append
+ // We call displayPendingItem once in insertItem
+ // and the appends are handled directly in
+ // appendToLastLine
+ if (!m_items.empty()
+ && m_items.last() == m_pendingItem) return;
+
+ m_items.push_back(m_pendingItem);
+
+ if ( m_bCompiling && !m_pendingItem->visible( m_compilerOutputLevel ) )
+ return;
+
+ SelectionPreserver preserveSelection( *this, !m_vertScrolling && !m_horizScrolling );
+ m_paragraphToItem.insert( m_paragraphs++, m_pendingItem );
+ append( m_pendingItem->formattedText( m_compilerOutputLevel, brightBg() ) );
+}
+
+bool MakeWidget::appendToLastLine( const QString& text )
+{
+ if ( !m_pendingItem ) return false;
+ if ( !m_pendingItem->append( text ) )
+ {
+ displayPendingItem();
+ m_pendingItem = 0;
+ return false;
+ }
+
+ int mode = m_pendingItem -> displayMode();
+ if ((mode & MakeItem::Append) && (mode & MakeItem::ImmDisplay))
+ {
+ removeParagraph(paragraphs() - 1);
+ SelectionPreserver preserveSelection( *this, !m_vertScrolling && !m_horizScrolling );
+ append( m_pendingItem->formattedText( m_compilerOutputLevel, brightBg() ) );
+ }
+
+ return true;
+}
+
+void MakeWidget::insertItem( MakeItem* new_item )
+{
+ displayPendingItem();
+ m_pendingItem = new_item;
+
+ if (!new_item) return;
+
+ int mode = new_item -> displayMode();
+ if (mode & MakeItem::ImmDisplay)
+ {
+ displayPendingItem();
+ if (!(mode & MakeItem::Append))
+ m_pendingItem = 0;
+ }
+}
+
+bool MakeWidget::brightBg()
+{
+ int h,s,v;
+ paletteBackgroundColor().hsv( &h, &s, &v );
+ return (v > 127);
+}
+
+QPopupMenu* MakeWidget::createPopupMenu( const QPoint& pos )
+{
+ QPopupMenu* pMenu = QTextEdit::createPopupMenu(pos);
+ pMenu->setCheckable(true);
+
+ pMenu->insertSeparator();
+ int id = pMenu->insertItem(i18n("Line Wrapping"), this, SLOT(toggleLineWrapping()) );
+ pMenu->setItemChecked(id, m_bLineWrapping);
+ pMenu->setWhatsThis(id, i18n("<b>Line wrapping</b><p>Enables or disables wrapping of command lines displayed."));
+
+ pMenu->insertSeparator();
+ id = pMenu->insertItem(i18n("Very Short Compiler Output"), this, SLOT(slotVeryShortCompilerOutput()) );
+ pMenu->setWhatsThis(id, i18n("<b>Very short compiler output</b><p>Displays only warnings, errors and the file names which are compiled."));
+ pMenu->setItemChecked(id, m_compilerOutputLevel == eVeryShort);
+ id = pMenu->insertItem(i18n("Short Compiler Output"), this, SLOT(slotShortCompilerOutput()) );
+ pMenu->setWhatsThis(id, i18n("<b>Short compiler output</b><p>Suppresses all the compiler flags and formats to something readable."));
+ pMenu->setItemChecked(id, m_compilerOutputLevel == eShort);
+ id = pMenu->insertItem(i18n("Full Compiler Output"), this, SLOT(slotFullCompilerOutput()) );
+ pMenu->setWhatsThis(id, i18n("<b>Full compiler output</b><p>Displays unmodified compiler output."));
+ pMenu->setItemChecked(id, m_compilerOutputLevel == eFull);
+
+ pMenu->insertSeparator();
+ id = pMenu->insertItem(i18n("Show Directory Navigation Messages"), this, SLOT(toggleShowDirNavigMessages()));
+ pMenu->setWhatsThis(id, i18n("<b>Show directory navigation messages</b><p>Shows <b>cd</b> commands that are executed while building."));
+ pMenu->setItemChecked(id, DirectoryItem::getShowDirectoryMessages());
+
+ return pMenu;
+}
+
+void MakeWidget::toggleLineWrapping()
+{
+ m_bLineWrapping = !m_bLineWrapping;
+ KConfig *pConfig = kapp->config();
+ pConfig->setGroup("MakeOutputView");
+ pConfig->writeEntry("LineWrapping", m_bLineWrapping);
+ pConfig->sync();
+ if (m_bLineWrapping) {
+ setWordWrap(WidgetWidth);
+ }
+ else
+ {
+ setWordWrap(NoWrap);
+ }
+}
+
+void MakeWidget::refill()
+{
+ clear();
+ m_paragraphToItem.clear();
+ m_paragraphs = 0;
+ for( uint i = 0; i < m_items.size(); i++ )
+ {
+ if ( m_bCompiling && !m_items[i]->visible( m_compilerOutputLevel ) )
+ continue;
+ m_paragraphToItem.insert( m_paragraphs++, m_items[i] );
+ append( m_items[i]->formattedText( m_compilerOutputLevel, brightBg() ) );
+ }
+
+}
+
+void MakeWidget::slotVeryShortCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eVeryShort); }
+void MakeWidget::slotShortCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eShort); }
+void MakeWidget::slotFullCompilerOutput() { setTextFormat( Qt::RichText ); setCompilerOutputLevel(eFull); }
+
+void MakeWidget::setCompilerOutputLevel(EOutputLevel level)
+{
+ m_compilerOutputLevel = level;
+ KConfig *pConfig = kapp->config();
+ pConfig->setGroup("MakeOutputView");
+ pConfig->writeEntry("CompilerOutputLevel", (int) level);
+ pConfig->sync();
+ refill();
+}
+
+void MakeWidget::toggleShowDirNavigMessages()
+{
+ DirectoryItem::setShowDirectoryMessages( !DirectoryItem::getShowDirectoryMessages() );
+ KConfig *pConfig = kapp->config();
+ pConfig->setGroup("MakeOutputView");
+ pConfig->writeEntry("ShowDirNavigMsg", DirectoryItem::getShowDirectoryMessages());
+ pConfig->sync();
+ refill();
+}
+
+void MakeWidget::updateSettingsFromConfig()
+{
+ KConfig *pConfig = kapp->config();
+ pConfig->setGroup("General Options");
+ QFont outputFont = pConfig->readFontEntry("OutputViewFont");
+ setFont(outputFont);
+ pConfig->setGroup("MakeOutputView");
+ m_bLineWrapping = pConfig->readBoolEntry("LineWrapping", true);
+ m_compilerOutputLevel = (EOutputLevel) pConfig->readNumEntry("CompilerOutputLevel", (int) eShort);
+ DirectoryItem::setShowDirectoryMessages( pConfig->readBoolEntry("ShowDirNavigMsg", false) );
+}
+
+bool MakeWidget::scanErrorForward( int parag )
+{
+ for ( int it = parag + 1;
+ it < (int)m_items.count();
+ ++it )
+ {
+ ErrorItem* item = dynamic_cast<ErrorItem*>( m_paragraphToItem[it] );
+ if ( !item )
+ continue;
+ if( item->m_isWarning )
+ continue;
+ parag = it;
+ document()->removeSelection(0);
+ setSelection(parag, 0, parag+1, 0, 0);
+ setCursorPosition(parag, 0);
+ ensureCursorVisible();
+ searchItem( it );
+ return true;
+ }
+ return false;
+}
+
+bool MakeWidget::scanErrorBackward( int parag )
+{
+ for ( int it = parag - 1; it >= 0; --it)
+ {
+ ErrorItem* item = dynamic_cast<ErrorItem*>( m_paragraphToItem[it] );
+ if ( !item )
+ continue;
+ if( item->m_isWarning )
+ continue;
+ parag = it;
+ document()->removeSelection(0);
+ setSelection(parag, 0, parag+1, 0, 0);
+ setCursorPosition(parag, 0);
+ ensureCursorVisible();
+ searchItem( it );
+ return true;
+ }
+ return false;
+}
+
+void MakeWidget::storePartialStderrLine(const QCString & line)
+{
+ stderrbuf += line;
+}
+
+void MakeWidget::storePartialStdoutLine(const QCString & line)
+{
+ stdoutbuf += line;
+}
+
+#include "makewidget.moc"
diff --git a/parts/outputviews/makewidget.h b/parts/outputviews/makewidget.h
new file mode 100644
index 00000000..ff65eb5e
--- /dev/null
+++ b/parts/outputviews/makewidget.h
@@ -0,0 +1,129 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _MAKEWIDGET_H_
+#define _MAKEWIDGET_H_
+
+#include <qptrstack.h>
+#include <qregexp.h>
+#include <qtextedit.h>
+#include <qvaluevector.h>
+#include <qintdict.h>
+
+#include "outputfilter.h"
+#include "directorystatusmessagefilter.h"
+#include "compileerrorfilter.h"
+#include "commandcontinuationfilter.h"
+#include "makeactionfilter.h"
+#include "otherfilter.h"
+#include "makeitem.h"
+
+class MakeViewPart;
+class MakeItem;
+class KProcess;
+class ProcessLineMaker;
+class KURL;
+
+namespace KTextEditor { class Document; }
+
+class MakeWidget : public QTextEdit
+{
+ Q_OBJECT
+
+public:
+ MakeWidget(MakeViewPart *part);
+ ~MakeWidget();
+
+ void queueJob(const QString &dir, const QString &command);
+ bool isRunning();
+ void updateSettingsFromConfig();
+ void processLine( const QString& line );
+
+public slots:
+ void startNextJob();
+ void killJob();
+ void nextError();
+ void prevError();
+ void copy();
+
+protected:
+ virtual QPopupMenu *createPopupMenu( const QPoint& pos );
+ virtual void contentsMouseReleaseEvent( QMouseEvent* e );
+
+private slots:
+ void insertStdoutLine(const QCString& line);
+ void insertStderrLine(const QCString& line);
+ void storePartialStdoutLine(const QCString& line);
+ void storePartialStderrLine(const QCString& line);
+ void slotProcessExited(KProcess *);
+ void verticScrollingOn() { m_vertScrolling = true; }
+ void verticScrollingOff() { m_vertScrolling = false; }
+ void horizScrollingOn() { m_horizScrolling = true; }
+ void horizScrollingOff() { m_horizScrolling = false; }
+ void toggleLineWrapping();
+ void slotVeryShortCompilerOutput();
+ void slotShortCompilerOutput();
+ void slotFullCompilerOutput();
+ void toggleShowDirNavigMessages();
+ void slotEnteredDirectory( EnteringDirectoryItem* );
+ void slotExitedDirectory( ExitingDirectoryItem* );
+ void insertItem( MakeItem* );
+
+private:
+ void specialCheck( const QString& file, QString& fName ) const;
+ virtual void keyPressEvent(QKeyEvent *e);
+ void searchItem(int parag);
+ QString guessFileName( const QString& fName, int parag ) const;
+ QString directory(int parag) const;
+ bool brightBg();
+ void refill();
+ void createCursor(ErrorItem* e, KTextEditor::Document* doc);
+
+ bool scanErrorForward(int parag);
+ bool scanErrorBackward(int parag);
+
+ DirectoryStatusMessageFilter m_directoryStatusFilter;
+ CompileErrorFilter m_errorFilter;
+ CommandContinuationFilter m_continuationFilter;
+ MakeActionFilter m_actionFilter;
+ OtherFilter m_otherFilter;
+
+ void setPendingItem(MakeItem* new_item);
+ void displayPendingItem();
+ bool appendToLastLine( const QString& text );
+ void setCompilerOutputLevel(EOutputLevel level);
+
+ QStringList commandList;
+ QStringList dirList;
+ QString m_lastBuildDir; //stores directory of last build, for the case we don't have proper path information
+ QString currentCommand;
+ KProcess *childproc;
+ ProcessLineMaker* procLineMaker;
+ QPtrStack<QString> dirstack;
+ MakeItem* m_pendingItem;
+ QValueVector<MakeItem*> m_items;
+ QIntDict<MakeItem> m_paragraphToItem;
+ long m_paragraphs;
+ int m_lastErrorSelected;
+
+ MakeViewPart *m_part;
+
+ bool m_vertScrolling, m_horizScrolling;
+ bool m_bCompiling;
+
+ QCString stderrbuf;
+ QCString stdoutbuf;
+
+ bool m_bLineWrapping;
+ EOutputLevel m_compilerOutputLevel;
+};
+
+#endif
diff --git a/parts/outputviews/otherfilter.cpp b/parts/outputviews/otherfilter.cpp
new file mode 100644
index 00000000..5f14937c
--- /dev/null
+++ b/parts/outputviews/otherfilter.cpp
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "otherfilter.h"
+#include "otherfilter.moc"
+#include "makeitem.h"
+
+#include <kdebug.h>
+
+OtherFilter::OtherFilter()
+ : OutputFilter( *this )
+{
+}
+
+void OtherFilter::processLine( const QString& line )
+{
+ emit item( new MakeItem( line ) );
+}
diff --git a/parts/outputviews/otherfilter.h b/parts/outputviews/otherfilter.h
new file mode 100644
index 00000000..9a2c6c17
--- /dev/null
+++ b/parts/outputviews/otherfilter.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef OtherFilter_h
+#define OtherFilter_h
+
+#include "outputfilter.h"
+
+#include <qobject.h>
+
+class MakeItem;
+
+class OtherFilter : public QObject, public OutputFilter
+{
+Q_OBJECT
+
+public:
+ OtherFilter();
+
+ virtual void processLine( const QString& line );
+
+signals:
+ void item( MakeItem* );
+};
+
+#endif
diff --git a/parts/outputviews/outputfilter.cpp b/parts/outputviews/outputfilter.cpp
new file mode 100644
index 00000000..5692efce
--- /dev/null
+++ b/parts/outputviews/outputfilter.cpp
@@ -0,0 +1,24 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann and the KDevelop Team *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "outputfilter.h"
+
+#include <kdebug.h>
+
+OutputFilter::OutputFilter( OutputFilter& next )
+ : m_next( next )
+{
+}
+
+void OutputFilter::processLine( const QString& line )
+{
+ m_next.processLine( line );
+}
diff --git a/parts/outputviews/outputfilter.h b/parts/outputviews/outputfilter.h
new file mode 100644
index 00000000..dd84f7d7
--- /dev/null
+++ b/parts/outputviews/outputfilter.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef OutputFilter_h
+#define OutputFilter_h
+
+#include <qstring.h>
+
+class OutputFilter
+{
+public:
+ OutputFilter( OutputFilter& );
+ virtual ~OutputFilter() {}
+
+ virtual void processLine( const QString& line );
+
+private:
+ OutputFilter& m_next;
+};
+
+#endif
diff --git a/parts/outputviews/outputviewsfactory.cpp b/parts/outputviews/outputviewsfactory.cpp
new file mode 100644
index 00000000..55e5bf55
--- /dev/null
+++ b/parts/outputviews/outputviewsfactory.cpp
@@ -0,0 +1,21 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "outputviewsfactory.h"
+
+static const KDevPluginInfo data("kdevoutputviews", I18N_NOOP("Messages Output"), "1.0");
+
+K_EXPORT_COMPONENT_FACTORY( libkdevoutputviews, OutputViewsFactory( &data ) )
+
+const KDevPluginInfo *outputViewsInfo()
+{
+ return data;
+}
diff --git a/parts/outputviews/outputviewsfactory.h b/parts/outputviews/outputviewsfactory.h
new file mode 100644
index 00000000..4bcba666
--- /dev/null
+++ b/parts/outputviews/outputviewsfactory.h
@@ -0,0 +1,27 @@
+/***************************************************************************
+ * Copyright (C) 2000-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _OUTPUTVIEWSFACTORY_H_
+#define _OUTPUTVIEWSFACTORY_H_
+
+#include <kdevgenericfactory.h>
+
+#include "appoutputviewpart.h"
+#include "makeviewpart.h"
+
+class KDevPluginInfo;
+
+typedef K_TYPELIST_2( AppOutputViewPart, MakeViewPart ) OutputViews;
+typedef KDevGenericFactory< OutputViews > OutputViewsFactory;
+
+const KDevPluginInfo *outputViewsInfo();
+
+#endif
diff --git a/parts/partexplorer/Makefile.am b/parts/partexplorer/Makefile.am
new file mode 100644
index 00000000..459c6778
--- /dev/null
+++ b/parts/partexplorer/Makefile.am
@@ -0,0 +1,17 @@
+# Here resides the PartExplorer plugin
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevpartexplorer.la
+libkdevpartexplorer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevpartexplorer_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevpartexplorer_la_SOURCES = partexplorerformbase.ui partexplorerform.cpp partexplorer_plugin.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevpartexplorer.desktop
+
+rcdir = $(kde_datadir)/kdevpartexplorer
+rc_DATA = kdevpartexplorer.rc
diff --git a/parts/partexplorer/README b/parts/partexplorer/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/partexplorer/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/partexplorer/README.dox b/parts/partexplorer/README.dox
new file mode 100644
index 00000000..08afdd92
--- /dev/null
+++ b/parts/partexplorer/README.dox
@@ -0,0 +1,24 @@
+/** \class PartExplorerPlugin
+A Graphical tool for performing KTrader-like queries about registered services
+
+PartExplorer is a frontend to KTrader class (http://developer.kde.org/documentation/library/3.1-api/kio/html/classKTrader.html)
+and uses its syntax, no more no less: so before saying "it really sucks", give a look at
+http://developer.kde.org/documentation/library/kdeqt/tradersyntax.html.
+
+The real job is done by the @see PartExplorerForm class which handles user input, query system
+configuration and (eventually) fills the property list.
+
+It has helped figuring out several problems when querying KParts (ok, mostly mispelled names ;-), and I
+hope that some other people will find it useful.
+
+Last updated on 28.07.2003 by Mario Scalas
+
+\authors <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\maintainer <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\feature Performs KTrader-like queries about registered services
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=partexplorer&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">partexplorer component at Bugzilla database</a>
+
+*/
diff --git a/parts/partexplorer/kdevpartexplorer.desktop b/parts/partexplorer/kdevpartexplorer.desktop
new file mode 100644
index 00000000..8b031c49
--- /dev/null
+++ b/parts/partexplorer/kdevpartexplorer.desktop
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=A Graphical tool for performing KTrader-like queries about registered services
+Comment[ca]=Una eina gràfica per a realitzar consultes del tipus KTrader sobre els serveis registrats
+Comment[da]=Et grafisk værktøj til at udføre KTrader-lignende forespørgsler om registrerede tjenester
+Comment[de]=Ein grafisches Werkzeug, mit dem Abfragen nach im System verfügbaren Komponten durchgeführt werden können
+Comment[el]=Ένα γραφικό εργαλείο για την εκτέλεση ερωτήσεων όπως το KTrader σχετικά με καταχωρημένες υπηρεσίες
+Comment[es]=Una herramienta gráfica para realizar consultas del tipo KTrader sobre los servicios registrados
+Comment[et]=Graafiline vahend KTraderi-laadsete päringute sooritamiseks registreeritud teenuste kohta
+Comment[eu]=Erregistratutako zerbitzuei buruzko kontsultak egiteko, KTrader-en antzeko tresna grafikoa
+Comment[fa]=یک ابزار نگاره‌ای برای انجام KTrader- مثل پرس‌وجوهایی در مورد خدمات ثبت‌شده
+Comment[fr]=Un outil graphique pour effectuer des requêtes de type KTrader sur les services enregistrés
+Comment[gl]=Unha ferramente gráfica para realizar peticións tipo KTrader dos servizos rexistrados
+Comment[hu]=Grafikus felületű program a regisztrált szolgáltatások KTrader-szerű lekérdezéséhez
+Comment[it]=Uno strumento grafico per eseguire interrogazioni tipo KTrader sui servizi registrati
+Comment[ja]=登録されたサービスに関する KTrader のような質問を実行するための視覚化されたツール
+Comment[ms]=Alatan bergrafik untuk melaksanakan pertanyaan seperti-KTrader mengenai servis berdaftar
+Comment[nds]=En graafsch Warktüüch för KTrader-liek Anfragen över indragen Deensten.
+Comment[ne]=दर्ता गरेको सेवाका बारेमा क्वेरीहरू जस्तै-KTrader कार्यसम्पादन गर्नका लागि एउटा ग्राफिकल उपकरण
+Comment[nl]=Een grafische tool om naar geregistreerde diensten te zoeken
+Comment[pl]=Narzędzie graficzne do wykonywania zapytań na temat zarejestrowanych usług (jak KTrader)
+Comment[pt]=Uma ferramenta gráfica para efectuar pesquisas do tipo KTrader sobre os serviços registados
+Comment[pt_BR]=Uma ferramenta Gráfica para realizar consultas como KTrader sobre serviços registrados
+Comment[ru]=Графическое средство для выполнения запросов KTrader о зарегистрированных сервисах.
+Comment[sk]=Grafický nástroj pre vyhľadávanie KTraderregistrovaných služieb
+Comment[sr]=Графички алат за обављање упита налик KTrader-овим о регистрованим сервисима
+Comment[sr@Latn]=Grafički alat za obavljanje upita nalik KTrader-ovim o registrovanim servisima
+Comment[sv]=Ett grafiskt verktyg för att utföra KTrader-liknande förfrågningar om registrerade tjänster.
+Comment[ta]=வரைகலை கருவி மூலம் பதிப்பு சேவையில் இருந்து Kட்ரேடர் கேள்விகளை செயலாக்கலாம்.
+Comment[tg]=Воситаи графикӣ барои иҷро намудани дархостҳои KTrader дар бораи қайдкунии муҳаррирҳо
+Comment[tr]=Kayıtlı servisler için KTrader-benzeri sorgular yapmayı sağlayan bir grafiksel araç
+Comment[zh_CN]=调用KTrader的图形工具-就像查询已经注册的服务。
+Comment[zh_TW]=執行類似 KTrader 查詢註冊服務的圖形化工具
+Name=KDevPartExplorer
+Name[da]=KDevelop Part-søger
+Name[nds]=KDevelop-Komponentkieker
+Name[sk]=KDev Part prieskumník
+Name[sv]=KDevelop delutforskare
+Name[zh_TW]=KDevelop 元件探索
+GenericName=Part Explorer Tool
+GenericName[ca]=Eina Part per a explorar
+GenericName[da]=Partsøger værktøj
+GenericName[de]=Komponenten-Explorer
+GenericName[el]=Εργαλείο περιηγητή τμημάτων
+GenericName[es]=Herramienta de exploración de partes
+GenericName[et]=Komponentide näitaja
+GenericName[eu]=Parteen arakatzaile tresna
+GenericName[fa]=ابزار کاوشگر جزء
+GenericName[fr]=Outil d'exploration des composants
+GenericName[hu]=Objektumböngésző
+GenericName[it]=Strumento per l'esplorazione di componenti
+GenericName[ja]=部分調査ツール
+GenericName[ms]=Alat Penjelajah Bahagian
+GenericName[nds]=Kiekwarktüüch för Komponenten
+GenericName[ne]=भाग एक्सप्लोरर उपकरण
+GenericName[nl]=Part Explorer gereedschap
+GenericName[pl]=Przeglądarka elementów KPart
+GenericName[pt]=Ferramenta de Exploração de Partes
+GenericName[pt_BR]=Ferramenta de Explorador de Parte
+GenericName[ru]=Средство опроса компонентов
+GenericName[sk]=Part prieskumník
+GenericName[sl]=Orodje Part Explorer
+GenericName[sr]=Алат за истраживање делова
+GenericName[sr@Latn]=Alat za istraživanje delova
+GenericName[sv]=Delutforskningsverktyg
+GenericName[ta]=முழுவதும் தேடும் கருவியில் ஒரு பகுதி
+GenericName[tg]=Восиати дархости қисматҳо
+GenericName[tr]=Bileşen Gezinti Aracı
+GenericName[zh_CN]=模块浏览器工具
+GenericName[zh_TW]=元件探索工具
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevpartexplorer
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=KDEDevelopment
diff --git a/parts/partexplorer/kdevpartexplorer.rc b/parts/partexplorer/kdevpartexplorer.rc
new file mode 100644
index 00000000..9632115b
--- /dev/null
+++ b/parts/partexplorer/kdevpartexplorer.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevPartExplorer" version="4">
+<MenuBar>
+ <Menu name="tools" >
+ <Action name="show_partexplorerform"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/parts/partexplorer/partexplorer_plugin.cpp b/parts/partexplorer/partexplorer_plugin.cpp
new file mode 100644
index 00000000..92aaf696
--- /dev/null
+++ b/parts/partexplorer/partexplorer_plugin.cpp
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "partexplorer_plugin.h"
+
+#include <kinstance.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+#include <kaction.h>
+#include <kmainwindow.h>
+
+#include <kdevplugininfo.h>
+#include <kdevmainwindow.h>
+
+#include "partexplorerform.h"
+
+static const KDevPluginInfo data("kdevpartexplorer");
+
+typedef KDevGenericFactory<PartExplorerPlugin> PartExplorerPluginFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( data ) )
+
+PartExplorerPlugin::PartExplorerPlugin( QObject *parent, const char *name, const QStringList & )
+ : KDevPlugin( &data, parent, name ? name : "PartExplorerPlugin" )
+{
+ // we need an instance
+ setInstance( PartExplorerPluginFactory::instance() );
+
+ setXMLFile( "kdevpartexplorer.rc" );
+
+ // this should be your custom internal widget
+ m_widget = new PartExplorerForm( mainWindow()->main() );
+// mainWindow()->embedSelectView( m_widget, i18n("PartExplorer"), i18n("Query system services"));
+
+ KAction *action = new KAction( i18n("&Part Explorer"), 0, this, SLOT(slotShowForm()),
+ actionCollection(), "show_partexplorerform" );
+ action->setToolTip(i18n("KTrader query execution"));
+ action->setWhatsThis(i18n("<b>Part explorer</b><p>Shows a dialog for KTrader query execution. Search your KDE documentation for more information about KDE services and KTrader."));
+}
+
+PartExplorerPlugin::~PartExplorerPlugin()
+{
+/*
+ if (m_widget)
+ {
+ mainWindow()->removeView( m_widget );
+ }
+*/
+ //delete m_widget;
+}
+
+void PartExplorerPlugin::slotShowForm()
+{
+ m_widget->show();
+}
+
+#include "partexplorer_plugin.moc"
diff --git a/parts/partexplorer/partexplorer_plugin.h b/parts/partexplorer/partexplorer_plugin.h
new file mode 100644
index 00000000..28f3cd95
--- /dev/null
+++ b/parts/partexplorer/partexplorer_plugin.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PARTEXPLORERPLUGIN_H_
+#define _PARTEXPLORERPLUGIN_H_
+
+#include <qguardedptr.h>
+
+#include "kdevplugin.h"
+
+class QWidget;
+class QPainter;
+class KURL;
+class PartExplorerForm;
+
+class PartExplorerPlugin : public KDevPlugin
+{
+ Q_OBJECT
+public:
+ /**
+ * Default constructor
+ */
+ PartExplorerPlugin( QObject *parent, const char *name, const QStringList & );
+
+ /**
+ * Destructor
+ */
+ virtual ~PartExplorerPlugin();
+
+private slots:
+ void slotShowForm();
+
+private:
+ /**
+ * The dialog for user interaction, so the plugin is usable too ;)
+ */
+ QGuardedPtr<PartExplorerForm> m_widget;
+};
+
+#endif // _PARTEXPLORERPLUGIN_H_
diff --git a/parts/partexplorer/partexplorerform.cpp b/parts/partexplorer/partexplorerform.cpp
new file mode 100644
index 00000000..f3a1caad
--- /dev/null
+++ b/parts/partexplorer/partexplorerform.cpp
@@ -0,0 +1,231 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlineedit.h>
+#include <qtextedit.h>
+#include <qpushbutton.h>
+#include <qtooltip.h>
+#include <qlayout.h>
+#include <qwhatsthis.h>
+#include <qlabel.h>
+
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kcombobox.h>
+#include <kservicetype.h>
+
+#include "partexplorerformbase.h"
+#include "partexplorerform.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class PropertyItem
+///////////////////////////////////////////////////////////////////////////////
+namespace PartExplorer{
+
+class PropertyItem : public KListViewItem
+{
+public:
+ PropertyItem( KListViewItem *parent, const QString &propertyName,
+ const QString &propertyType, const QString &propertyValue )
+ : KListViewItem( parent )
+ {
+ setText( 0, propertyName );
+ setText( 1, propertyType );
+ setText( 2, propertyValue );
+ }
+
+ QString tipText() const
+ {
+ QString tip = i18n("Name: %1 | Type: %2 | Value: %3");
+ return tip.arg( text(0) ).arg( text(1) ).arg( text(2) );
+ }
+};
+
+}
+///////////////////////////////////////////////////////////////////////////////
+// class ResultsList
+///////////////////////////////////////////////////////////////////////////////
+
+class ResultList;
+
+class ResultsToolTip: public QToolTip
+{
+public:
+ ResultsToolTip( ResultsList* parent );
+ virtual void maybeTip( const QPoint& p );
+
+private:
+ ResultsList* m_resultsList;
+};
+
+class ResultsList : public KListView
+{
+public:
+ ResultsList( QWidget *parent )
+ : KListView( parent, "resultslist" )
+ {
+ this->setShowToolTips( false );
+ new ResultsToolTip( this );
+ }
+
+ virtual ~ResultsList() {}
+
+ void clear()
+ {
+ KListView::clear();
+ }
+};
+
+ResultsToolTip::ResultsToolTip( ResultsList* parent )
+ : QToolTip( parent->viewport() ), m_resultsList( parent )
+{
+}
+
+void ResultsToolTip::maybeTip( const QPoint& p )
+{
+ PartExplorer::PropertyItem *item = dynamic_cast<PartExplorer::PropertyItem*>( m_resultsList->itemAt( p ) );
+ if ( item )
+ {
+ QRect r = m_resultsList->itemRect( item );
+ if ( r.isValid() )
+ tip( r, item->tipText() );
+ }
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// class PartExplorerForm
+///////////////////////////////////////////////////////////////////////////////
+
+PartExplorerForm::PartExplorerForm( QWidget *parent )
+ : KDialogBase( parent, "parteplorerform", false,
+ i18n("Part Explorer - A Services Lister"), User1 | Close, User1, true )
+{
+ m_base = new PartExplorerFormBase( this, "partexplorerformbase", 0 );
+ m_resultsList = new ResultsList( m_base );
+ m_resultsList->addColumn( i18n( "Property" ) );
+ m_resultsList->addColumn( i18n( "Type" ) );
+ m_resultsList->addColumn( i18n( "Value" ) );
+ m_resultsList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3,
+ (QSizePolicy::SizeType)3, 0, 0,
+ m_resultsList->sizePolicy().hasHeightForWidth() ) );
+ QWhatsThis::add( m_resultsList, i18n("<b>Matching services</b><p>Results (if any) are shown grouped by matching service name.") );
+ m_base->resultsLabel->setBuddy(m_resultsList);
+ m_base->layout()->add( m_resultsList );
+ setMainWidget( m_base );
+ m_base->typeCombo->lineEdit()->setFocus();
+
+ // User1 button text
+ setButtonText( User1, i18n("&Search") );
+
+ // Resize dialog
+ resize( 480, 512 );
+
+// connect( m_base->typeCombo->lineEdit(), SIGNAL(returnPressed()), this, SLOT(slotSearchRequested()) );
+// connect( m_base->constraintsText, SIGNAL(returnPressed()), this, SLOT(slotSearchRequested()) );
+
+ connect( actionButton(User1), SIGNAL(clicked()), this, SLOT(slotSearchRequested()) );
+// connect( m_base->typeCombo->lineEdit(), SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotServicetypeChanged( const QString& ) ) );
+// slotServicetypeChanged( m_base->typeCombo->lineEdit()->text() );
+
+ // populating with all known servicetypes
+ KServiceType::List serviceList = KServiceType::allServiceTypes();
+ QStringList list;
+ KServiceType::List::Iterator it = serviceList.begin();
+ while( it != serviceList.end() )
+ {
+ list << (*it)->name();
+ ++it;
+ }
+ list.sort();
+ m_base->typeCombo->insertStringList( list );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+PartExplorerForm::~PartExplorerForm()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void PartExplorerForm::slotSearchRequested()
+{
+ QString serviceType = m_base->typeCombo->lineEdit()->text();
+ QString constraints = m_base->constraintsText->text();
+
+ kdDebug(9000) << "===> PartExplorerForm::slotSearchRequested(): " <<
+ " serviceType = " << serviceType << ", constraints = " << constraints << endl;
+
+ // Query for requested services
+ KTrader::OfferList foundServices = KTrader::self()->query( serviceType, constraints );
+ fillServiceList( foundServices );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void PartExplorerForm::slotDisplayError( QString errorMessage )
+{
+ if (errorMessage.isEmpty())
+ {
+ errorMessage = i18n("Unknown error.");
+ }
+ KMessageBox::error( this, errorMessage );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void PartExplorerForm::fillServiceList( const KTrader::OfferList &services )
+{
+ this->m_resultsList->clear();
+
+ if ( services.isEmpty())
+ {
+ slotDisplayError( i18n("No service found matching the criteria.") );
+ return;
+ }
+
+ this->m_resultsList->setRootIsDecorated( true );
+
+ KListViewItem *rootItem = 0;
+
+ KTrader::OfferList::ConstIterator it = services.begin();
+ for ( ; it != services.end(); ++it )
+ {
+ KService::Ptr service = (*it);
+ KListViewItem *serviceItem = new KListViewItem( this->m_resultsList, rootItem, service->name() );
+
+ QStringList propertyNames = service->propertyNames();
+ for ( QStringList::const_iterator it = propertyNames.begin(); it != propertyNames.end(); ++it )
+ {
+ QString propertyName = (*it);
+ QVariant property = service->property( propertyName );
+ QString propertyType = property.typeName();
+ QString propertyValue;
+ if (propertyType == "QStringList") {
+ propertyValue = property.toStringList().join(", ");
+ }
+ else {
+ propertyValue = property.toString();
+ }
+
+ QString dProperty = " *** Found property < %1, %2, %3 >";
+ dProperty = dProperty.arg( propertyName ).arg( propertyType ).arg( propertyValue );
+ kdDebug( 9000 ) << dProperty << endl;
+
+ new PartExplorer::PropertyItem( serviceItem, propertyName, propertyType, propertyValue );
+ }
+ }
+}
+
+#include "partexplorerform.moc"
diff --git a/parts/partexplorer/partexplorerform.h b/parts/partexplorer/partexplorerform.h
new file mode 100644
index 00000000..21fe2fba
--- /dev/null
+++ b/parts/partexplorer/partexplorerform.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef PARTEXPLORERFORM_H
+#define PARTEXPLORERFORM_H
+
+#include <ktrader.h>
+#include <kdialogbase.h>
+
+class ResultsList;
+class PartExplorerFormBase;
+
+/**
+* The GUI for the PartExplorer.
+*
+* @author Mario Scalas
+*/
+class PartExplorerForm : public KDialogBase
+{
+ Q_OBJECT
+public:
+ PartExplorerForm( QWidget *parent = 0 );
+ virtual ~PartExplorerForm();
+
+ /**
+ * Fills the widget with data gathered for system's query.
+ */
+ void fillServiceList( const KTrader::OfferList &services );
+
+public slots:
+ void slotDisplayError( QString );
+
+protected slots:
+ void slotSearchRequested();
+
+private:
+ ResultsList *m_resultsList;
+ PartExplorerFormBase *m_base;
+};
+
+#endif
diff --git a/parts/partexplorer/partexplorerformbase.ui b/parts/partexplorer/partexplorerformbase.ui
new file mode 100644
index 00000000..dd9beeb3
--- /dev/null
+++ b/parts/partexplorer/partexplorerformbase.ui
@@ -0,0 +1,139 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>PartExplorerFormBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PartExplorerFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>335</width>
+ <height>241</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>PartExplorer</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>This is a front-end to KDE's KTrader: search your KDE documentation for more information about KDE services and KTrader</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>KDE service &amp;type:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>typeCombo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>typeCombo</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Additional constraints:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>constraintsText</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>constraintsText</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Constraints&lt;/b&gt;Refine your query by writing additional constraints such as &lt;i&gt;([X-KDevelop-Scope]='Global')&lt;/i&gt;).</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>resultsLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Results</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>constraintsText</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/quickopen/Makefile.am b/parts/quickopen/Makefile.am
new file mode 100644
index 00000000..be12b32f
--- /dev/null
+++ b/parts/quickopen/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/interfaces/extensions \
+ -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevquickopen.la
+libkdevquickopen_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevquickopen_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML)
+
+libkdevquickopen_la_SOURCES = quickopen_part.cpp quickopendialog.cpp quickopenclassdialog.cpp quickopenbase.ui quickopenfiledialog.cpp quickopenfunctiondialog.cpp quickopenfunctionchooseformbase.ui quickopenfunctionchooseform.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevquickopen.desktop
+
+rcdir = $(kde_datadir)/kdevquickopen
+rc_DATA = kdevpart_quickopen.rc
+noinst_HEADERS = quickopendialog.h quickopenclassdialog.h quickopenfiledialog.h quickopenfunctiondialog.h quickopenfunctionchooseform.h
diff --git a/parts/quickopen/README.dox b/parts/quickopen/README.dox
new file mode 100644
index 00000000..a4463178
--- /dev/null
+++ b/parts/quickopen/README.dox
@@ -0,0 +1,52 @@
+/** \class QuickOpenPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/quickopen/kdevpart_quickopen.rc b/parts/quickopen/kdevpart_quickopen.rc
new file mode 100644
index 00000000..6a50fc22
--- /dev/null
+++ b/parts/quickopen/kdevpart_quickopen.rc
@@ -0,0 +1,15 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="quickopen" library="libquickopenplugin" version="4">
+<MenuBar>
+ <Menu name="file">
+ <Action name="quick_open" group="open_merge"/>
+ </Menu>
+ <Menu name="view">
+ <Action name="file_switchto"/>
+ </Menu>
+ <Menu name="tools">
+ <Action name="quick_open_class"/>
+ <Action name="quick_open_function"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/quickopen/kdevquickopen.desktop b/parts/quickopen/kdevquickopen.desktop
new file mode 100644
index 00000000..1f497292
--- /dev/null
+++ b/parts/quickopen/kdevquickopen.desktop
@@ -0,0 +1,80 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides an efficient way of finding/opening files, classes and methods in a large project. Appears in the File and Tools menus when loaded.
+Comment[ca]=Proporciona un mètode eficient per a cercar i obrir fitxers, classes i mètodes en un projecte gran. Quan està carregat apareix en el menú Fitxer i Eines.
+Comment[da]=Giver en effektiv måde at finde/åbne, filer, klasser og metoder i et stort projekt. Viser sig i Fil- og værktøjsmenuerne når den er indlæst.
+Comment[de]=Stellt eine effektive Möglichkeit zum Suchen und Öffnen von Dateien in einem großen Projekt zur Verfügung. Erscheint im Menü "Datei", wenn es geladen ist.
+Comment[el]=Προσφέρει μια εύχρηστη μέθοδο αναζήτησης/ανοίγματος αρχείων, κλάσεων και μεθόδων σε ένα μεγάλο έργο. Εμφανίζεται στα μενού αρχείων και εργαλείων όταν φορτωθεί.
+Comment[es]=Proporciona un método para para buscar/abrir archivos, clases y métodos de un proyecto grande. Aparece en los menús Archivo y Herramientas cuando está cargado.
+Comment[et]=Võimaldab hõlpsasti leida/avada faile, klasse ja meetodeid suures projektis. Laadimisel kättesaadav faili- ja tööriistade menüüs.
+Comment[eu]=Proiektu handi batean fitxategiak, klaseak eta metodoak aurkitzeko/irekitzeko aukera eskeintzen du. Fitxategia eta Tresnak menutan agertzen da kargatzean.
+Comment[fa]=راه مؤثری برای یافتن/باز کردن پرونده‌ها، رده‌ها و روشها در پروژه‌های بزرگ فراهم می‌کند. در هنگام بارگذاری در گزینگان ابزار و پرونده ظاهر می‌شود.
+Comment[fr]=Fournit une manière efficace pour chercher / ouvrir des fichiers, classes et méthodes dans des grands projets. Apparaît dans les menus « Fichier » et « Outils » lorsque chargé.
+Comment[gl]=Proporciona un método eficiente para atopar/abrir ficheiros, clases e métodos nun proxecto grande. Aparece nos menús Ficheiro e Ferramentas cando se carga.
+Comment[hu]=Segítséget nyújt nagy projekteknél fájlok, osztályok és tagfüggvények kereséséhez, megnyitásához. Betöltéskor a Fájl és Eszközök menübe kerül.
+Comment[it]=Offre un modo efficiente per trovare/aprire file, classi e metodi in un progetto di ampia dimensione. Appare nel menu File e Strumenti quando caricato.
+Comment[ja]=大規模なプロジェクトでのファイルやクラス、メソッドを検索したり開く効率的な方法を提供します。読み込まれると、ファイルとツールのメニューに現れます。
+Comment[ms]=Menyediakan cara efisien untuk mencari/membuka fail, kelas dan kaedah dalam projek besar. Muncul sebagai menu Fail dan Alatan apabila dimuatkan.
+Comment[nds]=Stellt en effektiv Metood för't Söken un Opmaken vun Dateien, Klassen un Metoden in grötter Projekten praat. Dukt in't Menü "Datei" un "Warktüüch" op, wenn laadt.
+Comment[ne]=ठूलो परियोजनामा फाइल फेला पार्ने/खोल्ने, कक्षहरू र विधिको उपयुक्त तरिका प्रदान गर्दछ । लोड भएको बेलामा फाइल र उपकरणमा देखा पर्दछ ।
+Comment[nl]=Biedt een snelle manier om bestanden te vinden/openen in een groot project. Verschijnt in menu Bestand en Gereedschap als het geladen is.
+Comment[pl]=Umożliwia wyszukiwanie/otwieranie plików, klas i metod w dużym projekcie. Po wczytaniu pojawia się w menu Plik i Narzędzia.
+Comment[pt]=Oferece uma forma eficiente de procurar/abrir ficheiros, classes e métodos num projecto grande. Aparece nos menus Ficheiro e Ferramentas quando é carregado.
+Comment[pt_BR]=Fornece uma maneira eficiente de procurar/abrir arquivos, classes e métodos em um grande projeto. Aparece nos menus Arquivo e Ferramentas quando carregado.
+Comment[ru]=Предоставляет эффективное средство нахождения и открытия файлов и классов в больших проектах.
+Comment[sk]=Poskytuje efektívny spôsob hľadania/otvárania súborov, tried a metód vo veľkom projekte. Po načítaní sa objaví v menu Súbor a Nástroje.
+Comment[sr]=Обезбеђује ефикасан начин проналажења/отварања фајлова, класа и метода у великом пројекту. Појављује се у менијима „Фајл“ и „Алати“ када је учитан.
+Comment[sr@Latn]=Obezbeđuje efikasan način pronalaženja/otvaranja fajlova, klasa i metoda u velikom projektu. Pojavljuje se u menijima „Fajl“ i „Alati“ kada je učitan.
+Comment[sv]=Erbjuder ett effektivt sätt att hitta och öppna filer, klasser och metoder i ett stort projekt. Finns i menyn Arkiv och Verktyg när det laddats.
+Comment[ta]=பெரிய திட்ட பணிகளில் உள்ள கோப்பினை திறக்க/தேட இது ஒரு நல்ல வழியை தரும். ஏற்றியபின் கோப்பு பட்டியலில் இது தோன்றும்.
+Comment[tg]=Воситаи зуд ёфтан, кушодани файлҳо ва синфҳо дар лоиҳаҳоро имкон медиҳад.
+Comment[tr]=Büyük bir projede dosyaları, sınıfları ve yöntemleri bulmak ve açmak için verimli bir yol sunar. Yüklendiğinde Dosya ve Araçlar menüsünde durur.
+Comment[zh_CN]=提供在大工程中查找/打开文件、类和方法的有效方法。启动后显示在文件菜单中。
+Comment[zh_TW]=在大型專案中有效率地尋找/開啟檔案、類別與方法。載入後可以在檔案與工具選單中找到。
+Name=KDevQuickOpen
+Name[da]=KDevelop hurtigåbner
+Name[de]=Schnellöffner-Komponente (KDevelop)
+Name[hi]=के-डेव-क्विक-ओपन
+Name[nds]=KDevelop-Fixopmaker
+Name[pl]=KDevSzybkieOtwarcie
+Name[sk]=KDev rýchle otvorenie
+Name[sv]=KDevelop snabböppna
+Name[ta]=KDev சீக்கிரம் திற
+Name[zh_TW]=KDevelop 快速開啟
+GenericName=QuickOpen
+GenericName[ca]=Obertura ràpida
+GenericName[da]=Hurtigåbner
+GenericName[de]=Schnellöffner
+GenericName[el]=ΓρήγοροΆνοιγμα
+GenericName[es]=Apertura rápida
+GenericName[et]=Kiiresti avamine
+GenericName[fa]=باز کردن سریع
+GenericName[fr]=Ouverture rapide
+GenericName[gl]=Apertura rápida
+GenericName[hi]=क्विक-ओपन
+GenericName[hu]=Gyors fájlmegnyitó
+GenericName[it]=Apertura rapida
+GenericName[ja]=簡易読み込み
+GenericName[nds]=Gau opmaken
+GenericName[ne]=शीघ्र खुला
+GenericName[nl]=Snel openen
+GenericName[pl]=Szybkie otwarcie
+GenericName[pt]=Abertura Rápida
+GenericName[ru]=Быстрое открытие
+GenericName[sk]=Rýchle otvorenie
+GenericName[sl]=Hitro odprtje
+GenericName[sr]=Брзо отварање
+GenericName[sr@Latn]=Brzo otvaranje
+GenericName[sv]=Snabböppna
+GenericName[ta]=சீக்கிரம் திற
+GenericName[tg]=Ба зуди кушодан
+GenericName[tr]=HızlıAç
+GenericName[zh_CN]=快速打开
+GenericName[zh_TW]=快速開啟
+Icon=kdevelop
+ServiceTypes=KDevelop/QuickOpen
+X-KDevelop-Scope=Project
+X-KDE-Library=libkdevquickopen
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeNavigation
diff --git a/parts/quickopen/quickopen_part.cpp b/parts/quickopen/quickopen_part.cpp
new file mode 100644
index 00000000..dbfab9e6
--- /dev/null
+++ b/parts/quickopen/quickopen_part.cpp
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "quickopen_part.h"
+#include "quickopenclassdialog.h"
+#include "quickopenfunctiondialog.h"
+#include "quickopenfiledialog.h"
+
+#include <kaction.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <klineedit.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include <kmainwindow.h>
+
+#include <kparts/part.h>
+#include <ktexteditor/document.h>
+
+#include <kdevmainwindow.h>
+#include <kdevcore.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <codebrowserfrontend.h>
+
+#include "kdeveditorutil.h"
+
+typedef KDevGenericFactory<QuickOpenPart> QuickOpenFactory;
+static const KDevPluginInfo data("kdevquickopen");
+K_EXPORT_COMPONENT_FACTORY( libkdevquickopen, QuickOpenFactory( data ) )
+
+using namespace KTextEditor;
+
+QuickOpenPart::QuickOpenPart(QObject *parent, const char *name, const QStringList& )
+ : KDevQuickOpen(&data, parent, name ? name : "QuickOpenPart" )
+{
+ setInstance(QuickOpenFactory::instance());
+ setXMLFile("kdevpart_quickopen.rc");
+
+ m_actionQuickOpen = new KAction( i18n("Quick Open File..."), CTRL + ALT + Key_O,
+ this, SLOT(slotQuickFileOpen()),
+ actionCollection(), "quick_open" );
+ m_actionQuickOpen->setToolTip(i18n("Quick open file in project"));
+ m_actionQuickOpen->setWhatsThis(i18n("<b>Quick open</b><p>Provides a file name input form with completion listbox to quickly open file in a project."));
+
+ m_actionQuickOpenClass = new KAction( i18n("Quick Open Class..."), CTRL + ALT + Key_C,
+ this, SLOT(slotQuickOpenClass()),
+ actionCollection(), "quick_open_class" );
+ m_actionQuickOpenClass->setToolTip(i18n("Find class in project"));
+ m_actionQuickOpenClass->setWhatsThis(i18n("<b>Find class</b><p>Provides a class name input form with completion listbox to quickly open a file where the class is defined."));
+
+ m_actionFunctionOpen = new KAction( i18n("Quick Open Method..."), CTRL + ALT + Key_M, this, SLOT(slotQuickOpenFunction()), actionCollection(), "quick_open_function" );
+ m_actionFunctionOpen->setToolTip(i18n("Quick open function in project"));
+
+ m_switchToAction = new KAction(i18n("Switch To..."), KShortcut("CTRL+/"), this, SLOT(slotSwitchTo()), actionCollection(), "file_switchto");
+ m_switchToAction->setToolTip(i18n("Switch to"));
+ m_switchToAction->setWhatsThis(i18n("<b>Switch to</b><p>Prompts to enter the name of previously opened file to switch to."));
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+}
+
+
+QuickOpenPart::~QuickOpenPart()
+{
+}
+
+void QuickOpenPart::slotProjectOpened( )
+{
+}
+
+void QuickOpenPart::slotProjectClosed( )
+{
+}
+
+void QuickOpenPart::slotQuickFileOpen( )
+{
+ QuickOpenFileDialog dlg( this, mainWindow()->main() );
+ dlg.exec();
+}
+
+void QuickOpenPart::slotQuickOpenClass( )
+{
+ QuickOpenClassDialog dlg( this, mainWindow()->main() );
+ dlg.nameEdit->setText( KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) ) );
+ dlg.exec();
+}
+
+void QuickOpenPart::slotQuickOpenFunction()
+{
+ QuickOpenFunctionDialog dlg( this, mainWindow()->main() );
+ dlg.nameEdit->setText( KDevEditorUtil::currentWord( dynamic_cast<KTextEditor::Document*>( partController()->activePart() ) ) );
+ dlg.exec();
+}
+
+void QuickOpenPart::slotSwitchTo()
+{
+ QuickOpenFileDialog dlg( this, partController()->openURLs(), mainWindow()->main() );
+ dlg.exec();
+}
+
+void QuickOpenPart::selectItem( ItemDom item )
+{
+ Extensions::KDevCodeBrowserFrontend* f = extension< Extensions::KDevCodeBrowserFrontend > ( "KDevelop/CodeBrowserFrontend" );
+
+ if(f != 0) {
+ ItemDom itemDom( &(*item) );
+ f->jumpedToItem( itemDom );
+ } else {
+ kdDebug() << "could not find the proper extension\n";
+ }
+}
+
+void QuickOpenPart::quickOpenFile(const KURL::List urls)
+{
+ QuickOpenFileDialog dlg( this, urls, mainWindow()->main() );
+ dlg.exec();
+}
+
+
+#include "quickopen_part.moc"
diff --git a/parts/quickopen/quickopen_part.h b/parts/quickopen/quickopen_part.h
new file mode 100644
index 00000000..78ab3e45
--- /dev/null
+++ b/parts/quickopen/quickopen_part.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __KDEVPART_QUICKOPEN_H__
+#define __KDEVPART_QUICKOPEN_H__
+
+#include <qguardedptr.h>
+#include <kdevquickopen.h>
+#include <codemodel.h>
+
+class KAction;
+
+class QuickOpenPart : public KDevQuickOpen
+{
+ Q_OBJECT
+public:
+ QuickOpenPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~QuickOpenPart();
+
+ void selectItem( ItemDom item );
+
+ virtual void quickOpenFile(const KURL::List urls);
+
+private slots:
+ void slotProjectOpened();
+ void slotProjectClosed();
+ void slotQuickFileOpen();
+ void slotQuickOpenClass();
+ void slotQuickOpenFunction();
+ void slotSwitchTo();
+
+private:
+ KAction* m_actionQuickOpen;
+ KAction* m_actionQuickOpenClass;
+ KAction* m_actionFunctionOpen;
+ KAction* m_switchToAction;
+};
+
+
+#endif
diff --git a/parts/quickopen/quickopenbase.ui b/parts/quickopen/quickopenbase.ui
new file mode 100644
index 00000000..38e0fcab
--- /dev/null
+++ b/parts/quickopen/quickopenbase.ui
@@ -0,0 +1,178 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>QuickOpenDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>QuickOpenDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>369</width>
+ <height>331</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Quick Open</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>nameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[NAME]</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>itemListLabel</cstring>
+ </property>
+ <property name="text">
+ <string>[ITEM LIST]</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>itemList</cstring>
+ </property>
+ </widget>
+ <widget class="KListBox" row="3" column="0">
+ <property name="name">
+ <cstring>itemList</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>slotReturnPressed()</slot>
+ </connection>
+ <connection>
+ <sender>itemList</sender>
+ <signal>doubleClicked(QListBoxItem*)</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>slotExecuted(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>nameEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>slotReturnPressed()</slot>
+ </connection>
+ <connection>
+ <sender>nameEdit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>slotTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>itemList</sender>
+ <signal>returnPressed(QListBoxItem*)</signal>
+ <receiver>QuickOpenDialogBase</receiver>
+ <slot>slotReturnPressed()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>nameEdit</tabstop>
+ <tabstop>itemList</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot>slotTextChanged( const QString &amp; )</slot>
+ <slot>executed( QListBoxItem * )</slot>
+ <slot>slotExecuted( QListBoxItem * )</slot>
+ <slot>slotReturnPressed()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/quickopen/quickopenclassdialog.cpp b/parts/quickopen/quickopenclassdialog.cpp
new file mode 100644
index 00000000..9eec73a5
--- /dev/null
+++ b/parts/quickopen/quickopenclassdialog.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+#include <kdevlanguagesupport.h>
+
+#include <klistbox.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kcompletion.h>
+#include <klineedit.h>
+
+#include <qregexp.h>
+#include <qlabel.h>
+
+#include "quickopenclassdialog.h"
+#include "quickopen_part.h"
+#include "quickopenfunctionchooseform.h"
+
+QuickOpenClassDialog::QuickOpenClassDialog(QuickOpenPart* part, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : QuickOpenDialog( part, parent, name, modal, fl )
+{
+ nameLabel->setText( i18n("Class &name:") );
+ itemListLabel->setText( i18n("Class &list:") );
+
+ findAllClasses( m_items );
+ QStringList_unique( m_items );
+
+ nameEdit->setFocus();
+
+ itemList->insertStringList( m_items );
+ itemList->setCurrentItem(0);
+}
+
+QuickOpenClassDialog::~QuickOpenClassDialog()
+{
+}
+
+void QuickOpenClassDialog::slotExecuted( QListBoxItem* /*item*/ )
+{
+ accept();
+}
+
+void QuickOpenClassDialog::accept()
+{
+ if( QListBoxItem* item = itemList->selectedItem() )
+ {
+ ClassList klasses = findClass( item->text() );
+ if( klasses.count() == 1 )
+ {
+ ClassDom klass = klasses.first();
+ int startLine, startColumn;
+ klass->getStartPosition( &startLine, &startColumn );
+ m_part->partController()->editDocument( KURL( klass->fileName() ), startLine );
+ selectClassViewItem( ItemDom(&(*klass)) );
+ }
+ else if (klasses.count() > 1 )
+ {
+ //several classes with the same name found
+ QString fileStr;
+
+ QuickOpenFunctionChooseForm fdlg( this, "" );
+ fdlg.setCaption(i18n("Select The Location of Class %1").arg(klasses.first()->name()));
+ fdlg.textLabel2->setText(i18n("Class name:"));
+
+ for( ClassList::const_iterator it = klasses.constBegin(); it != klasses.constEnd() ; ++it )
+ {
+ ClassDom klass = *it;
+ //assemble class name to display (maybe with scope info and specialization)
+ QString classStr = m_part->languageSupport()->formatModelItem(klass);
+ if(klass->hasSpecializationDeclaration())
+ classStr += klass->getSpecializationDeclaration();
+ if(!klass->scope().isEmpty())
+ classStr += " (in " + klass->scope().join("::") + ")";
+ fdlg.argBox->insertItem(classStr);
+
+ fileStr = KURL( klass->fileName() ).fileName();
+ KURL full_url( klass->fileName() );
+ KURL base_url( m_part->project()->projectDirectory()+"/" );
+ fdlg.fileBox->insertItem(fileStr);
+ fdlg.setRelativePath(fdlg.fileBox->count()-1,
+ KURL::relativeURL( base_url, full_url ));
+ }
+ if( fdlg.exec() ){
+ int id = fdlg.argBox->currentItem();
+ if( id>-1 && id < (int) klasses.count() ){
+ ClassDom model = klasses[id];
+ int line, col;
+ model->getStartPosition( &line, &col );
+ selectClassViewItem( ItemDom(&(*model)) );
+ QString fileNameStr = model->fileName();
+ m_part->partController()->editDocument( KURL(fileNameStr), line );
+ }
+ }
+ }
+ }
+
+ QDialog::accept();
+}
+
+void QuickOpenClassDialog::slotReturnPressed( )
+{
+ maybeUpdateSelection();
+ accept();
+}
+
+void QuickOpenClassDialog::findAllClasses( QStringList& lst )
+{
+ findAllClasses( lst, m_part->codeModel()->globalNamespace() );
+}
+
+void QuickOpenClassDialog::findAllClasses( QStringList& lst, const ClassDom klass )
+{
+ QStringList fullName = klass->scope();
+ fullName << klass->name();
+ lst << fullName.join( "::" );
+
+ const ClassList classList = klass->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ findAllClasses( lst, *it );
+}
+
+void QuickOpenClassDialog::findAllClasses( QStringList& lst, const NamespaceDom ns )
+{
+ const NamespaceList namespaceList = ns->namespaceList();
+ for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
+ findAllClasses( lst, *it );
+
+ const ClassList classList = ns->classList();
+ for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
+ findAllClasses( lst, *it );
+}
+
+ClassList QuickOpenClassDialog::findClass( const QString& name )
+{
+ QStringList path = QStringList::split( "::", name );
+ return findClass( path, m_part->codeModel()->globalNamespace() );
+}
+
+ClassList QuickOpenClassDialog::findClass( QStringList& path, const NamespaceDom ns )
+{
+ ClassList list;
+ if( path.isEmpty() )
+ return list;
+
+ QString current = path.front();
+ if( ns->hasNamespace(current) )
+ {
+ path.pop_front();
+ list += findClass( path, ns->namespaceByName(current) );
+ path.push_front( current );
+ }
+
+ if( ns->hasClass(current) )
+ {
+ path.pop_front();
+ list += findClass( path, ns->classByName(current) );
+ }
+
+ return list;
+}
+
+ClassList QuickOpenClassDialog::findClass( QStringList& path, const ClassList klasses )
+{
+ ClassList list;
+ if( path.isEmpty() )
+ {
+ list += klasses;
+ return list;
+ }
+
+ for (ClassList::const_iterator it = klasses.constBegin(); it != klasses.constEnd(); ++it)
+ {
+ list += findClass(path, *it);
+ }
+
+ return list;
+}
+
+ClassList QuickOpenClassDialog::findClass( QStringList &path, const ClassDom klass )
+{
+ ClassList list;
+ if( path.isEmpty() )
+ {
+ list << klass;
+ return list;
+ }
+
+ QString current = path.front();
+ if( klass->hasClass(current) )
+ {
+ path.pop_front();
+ list += findClass( path, klass->classByName(current) );
+ path.push_front(current);
+ }
+
+ return list;
+}
+
+#include "quickopenclassdialog.moc"
+
diff --git a/parts/quickopen/quickopenclassdialog.h b/parts/quickopen/quickopenclassdialog.h
new file mode 100644
index 00000000..afed19c8
--- /dev/null
+++ b/parts/quickopen/quickopenclassdialog.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef QUICKOPENCLASSDIALOG_H
+#define QUICKOPENCLASSDIALOG_H
+
+#include "quickopendialog.h"
+#include <codemodel.h>
+#include <qstringlist.h>
+
+class QuickOpenPart;
+
+class QuickOpenClassDialog : public QuickOpenDialog
+{
+ Q_OBJECT
+public:
+ QuickOpenClassDialog(QuickOpenPart* part, QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
+ virtual ~QuickOpenClassDialog();
+
+public slots:
+ virtual void slotExecuted( QListBoxItem* );
+ virtual void slotReturnPressed();
+
+protected:
+ void findAllClasses( QStringList& classList );
+ void findAllClasses( QStringList& classList, const ClassDom klass );
+ void findAllClasses( QStringList& classList, const NamespaceDom ns );
+
+ ClassList findClass( const QString& name );
+ ClassList findClass( QStringList& path, const NamespaceDom ns );
+ ClassList findClass( QStringList& path, const ClassList klasses );
+ ClassList findClass( QStringList& path, const ClassDom klass );
+
+protected slots:
+ virtual void accept();
+};
+
+#endif
+
diff --git a/parts/quickopen/quickopendialog.cpp b/parts/quickopen/quickopendialog.cpp
new file mode 100644
index 00000000..d12c6f44
--- /dev/null
+++ b/parts/quickopen/quickopendialog.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2004
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <qapplication.h>
+#include <qregexp.h>
+
+#include <klistbox.h>
+#include <klineedit.h>
+#include <kdebug.h>
+
+#include "quickopendialog.h"
+#include "quickopen_part.h"
+
+QuickOpenDialog::QuickOpenDialog(QuickOpenPart* part, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : QuickOpenDialogBase( parent, name, modal, fl ), m_part( part )
+{
+ nameEdit->installEventFilter(this);
+ connect( &m_typeTimeout, SIGNAL(timeout()), this, SLOT(slotTextChangedDelayed()) );
+}
+
+QuickOpenDialog::~QuickOpenDialog()
+{
+}
+
+void QuickOpenDialog::slotTextChanged(const QString &)
+{
+ m_typeTimeout.start( 100, true );
+}
+
+void QuickOpenDialog::maybeUpdateSelection() {
+ if( m_typeTimeout.isActive() )
+ {
+ m_typeTimeout.stop();
+ slotTextChangedDelayed();
+ }
+}
+
+void QuickOpenDialog::setFirstItemSelected()
+{
+ // Make sure the list has a current item or our event will not be handled properly.
+ itemList->setCurrentItem(0);
+ // We are doing this indirectly because the event handler does things for multiple
+ // selections we cannot do through the public interface.
+ QKeyEvent e(QEvent::KeyPress, Qt::Key_Home, 0, 0);
+ QApplication::sendEvent(itemList, &e);
+}
+
+void QuickOpenDialog::slotTextChangedDelayed()
+{
+ itemList->clear();
+ itemList->insertStringList( wildCardCompletion( nameEdit->text() ) );
+ setFirstItemSelected();
+}
+
+bool QuickOpenDialog::eventFilter( QObject * watched, QEvent * e )
+{
+ if (!watched || !e)
+ return true;
+
+ if ((watched == nameEdit) && (e->type() == QEvent::KeyPress))
+ {
+ QKeyEvent *ke = (QKeyEvent*)e;
+ if (ke->key() == Key_Up)
+ {
+ QApplication::sendEvent(itemList, e);
+ nameEdit->blockSignals(true);
+ itemSelectionChanged();
+ nameEdit->blockSignals(false);
+ return true;
+ } else if (ke->key() == Key_Down)
+ {
+ QApplication::sendEvent(itemList, e);
+ nameEdit->blockSignals(true);
+ itemSelectionChanged();
+ nameEdit->blockSignals(false);
+ return true;
+ } else if ((ke->key() == Key_Next) || (ke->key() == Key_Prior))
+ {
+ QApplication::sendEvent(itemList, e);
+ nameEdit->blockSignals(true);
+ itemSelectionChanged();
+ nameEdit->blockSignals(false);
+ }
+ }
+
+ return QWidget::eventFilter(watched, e);
+}
+
+void QuickOpenDialog::selectClassViewItem(ItemDom item)
+{
+ m_part->selectItem( item );
+}
+
+QStringList QuickOpenDialog::wildCardCompletion(const QString & text)
+{
+ if ( text.isEmpty() ) return m_items;
+
+ QRegExp re( text, false, true );
+ QStringList matches;
+ QStringList::const_iterator it = m_items.begin();
+ while( it != m_items.end() )
+ {
+ if ( (*it).find( re ) != -1 )
+ {
+ matches << *it;
+ }
+ ++it;
+ }
+
+ return matches;
+}
+
+void QuickOpenDialog::QStringList_unique( QStringList & list )
+{
+ if ( list.size() < 2 ) return;
+
+ list.sort();
+
+ QStringList::iterator it = list.begin();
+ QStringList::iterator it2 = it;
+ while ( it2 != list.end() )
+ {
+ ++it2;
+ while ( it2 != list.end() && *it2 == *it )
+ {
+ it2 = list.remove( it2 );
+ }
+ it = it2;
+ }
+}
+
+void QuickOpenDialog::itemSelectionChanged() {
+ nameEdit->setText(itemList->currentText());
+}
+
+#include "quickopendialog.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; show-tabs on;
diff --git a/parts/quickopen/quickopendialog.h b/parts/quickopen/quickopendialog.h
new file mode 100644
index 00000000..7eb989c6
--- /dev/null
+++ b/parts/quickopen/quickopendialog.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2004
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef QUICKOPENDIALOG_H
+#define QUICKOPENDIALOG_H
+
+#include <qstringlist.h>
+#include <qtimer.h>
+
+#include <codemodel.h>
+
+#include "quickopenbase.h"
+
+class QuickOpenPart;
+class KCompletion;
+
+class QuickOpenDialog : public QuickOpenDialogBase
+{
+ Q_OBJECT
+
+public:
+ QuickOpenDialog(QuickOpenPart* part, QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
+ virtual ~QuickOpenDialog();
+
+ virtual bool eventFilter(QObject *watched, QEvent *e);
+
+ void selectClassViewItem(ItemDom item);
+
+public slots:
+ virtual void slotTextChanged(const QString&);
+ virtual void slotTextChangedDelayed();
+
+protected:
+ void maybeUpdateSelection();
+ void setFirstItemSelected();
+ virtual void itemSelectionChanged();
+ void QStringList_unique( QStringList & list );
+ QStringList wildCardCompletion( const QString & text );
+ QStringList m_items;
+ QuickOpenPart* m_part;
+ QTimer m_typeTimeout;
+
+};
+
+#endif
+
diff --git a/parts/quickopen/quickopenfiledialog.cpp b/parts/quickopen/quickopenfiledialog.cpp
new file mode 100644
index 00000000..96474367
--- /dev/null
+++ b/parts/quickopen/quickopenfiledialog.cpp
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+
+
+#include <klistbox.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kcompletion.h>
+#include <klineedit.h>
+
+
+#include <qregexp.h>
+#include <qlabel.h>
+
+#include "quickopenfiledialog.h"
+#include "quickopen_part.h"
+
+QuickOpenFileDialog::QuickOpenFileDialog(QuickOpenPart* part, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : QuickOpenDialog( part, parent, name, modal, fl ), m_hasFullPaths( false )
+{
+ nameLabel->setText( i18n("File &name:") );
+ itemListLabel->setText( i18n("File &list:") );
+
+ m_items = m_part->project()->allFiles();
+
+ nameEdit->setFocus();
+
+ itemList->setSelectionMode( QListBox::Extended );
+ itemList->insertStringList( m_items );
+ setFirstItemSelected();
+}
+
+QuickOpenFileDialog::QuickOpenFileDialog(QuickOpenPart* part, const KURL::List & urls, QWidget* parent, const char* name, bool modal, WFlags fl)
+ : QuickOpenDialog( part, parent, name, modal, fl ), m_hasFullPaths( true )
+{
+ nameLabel->setText( i18n("File &name:") );
+ itemListLabel->setText( i18n("File &list:") );
+
+ m_items = urls.toStringList();
+ QStringList_unique( m_items );
+
+ if (m_part->project())
+ {
+ for (unsigned int i = 0; i < m_items.count(); ++i)
+ {
+ QString url = m_items[i];
+ QString projectUrl = "file://" + m_part->project()->projectDirectory();
+ if (url.startsWith(projectUrl))
+ m_items[i] = url.mid(projectUrl.length() + 1);
+ }
+ }
+
+ nameEdit->setFocus();
+
+ itemList->setSelectionMode( QListBox::Extended );
+ itemList->insertStringList( m_items );
+ setFirstItemSelected();
+}
+
+QuickOpenFileDialog::~QuickOpenFileDialog()
+{
+}
+
+void QuickOpenFileDialog::slotExecuted( QListBoxItem* item )
+{
+ if ( !item ) return;
+
+ if ( m_hasFullPaths )
+ {
+ m_part->partController()->editDocument( KURL::fromPathOrURL( item->text() ) );
+ }
+ else
+ {
+ m_part->partController()->editDocument( KURL::fromPathOrURL( m_part->project()->projectDirectory() + "/" + item->text() ) );
+ }
+ accept();
+}
+
+void QuickOpenFileDialog::slotReturnPressed( )
+{
+ maybeUpdateSelection();
+
+ for (int i = 0; i < itemList->count(); ++i)
+ {
+ if (itemList->isSelected(i))
+ {
+ if (m_hasFullPaths)
+ {
+ m_part->partController()->editDocument(KURL::fromPathOrURL(itemList->item(i)->text()));
+ }
+ else
+ {
+ m_part->partController()->editDocument(KURL::fromPathOrURL(m_part->project()->projectDirectory() + "/" + itemList->item(i)->text()));
+ }
+ }
+ }
+ accept();
+}
+
+#include "quickopenfiledialog.moc"
+
diff --git a/parts/quickopen/quickopenfiledialog.h b/parts/quickopen/quickopenfiledialog.h
new file mode 100644
index 00000000..0f36f1f8
--- /dev/null
+++ b/parts/quickopen/quickopenfiledialog.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2003 Roberto Raggi (roberto@kdevelop.org)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef QUICKOPENFILEDIALOG_H
+#define QUICKOPENFILEDIALOG_H
+
+#include "quickopendialog.h"
+#include <qstringlist.h>
+
+#include <kurl.h>
+
+class QuickOpenPart;
+class KCompletion;
+
+class QuickOpenFileDialog : public QuickOpenDialog
+{
+ Q_OBJECT
+public:
+ QuickOpenFileDialog(QuickOpenPart* part, QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
+ QuickOpenFileDialog(QuickOpenPart* part, const KURL::List &, QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
+ virtual ~QuickOpenFileDialog();
+
+public slots:
+ virtual void slotExecuted( QListBoxItem* );
+ virtual void slotReturnPressed();
+
+private:
+ bool m_hasFullPaths;
+};
+
+#endif
+
diff --git a/parts/quickopen/quickopenfunctionchooseform.cpp b/parts/quickopen/quickopenfunctionchooseform.cpp
new file mode 100644
index 00000000..c83a8765
--- /dev/null
+++ b/parts/quickopen/quickopenfunctionchooseform.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <klistbox.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <ksqueezedtextlabel.h>
+
+#include <codemodel.h>
+
+#include "quickopenfunctionchooseform.h"
+
+QuickOpenFunctionChooseForm::QuickOpenFunctionChooseForm(QWidget* parent, const char* name, bool modal, WFlags fl)
+: QuickOpenFunctionChooseFormBase(parent,name, modal,fl)
+{
+ setCaption( i18n("Select One Argument or File of Function %1").arg( name ) );
+ slotArgsChange( 0 );
+ slotFileChange( 0 );
+}
+
+QuickOpenFunctionChooseForm::~QuickOpenFunctionChooseForm()
+{
+}
+
+void QuickOpenFunctionChooseForm::slotArgsChange( int id )
+{
+ argBox->setCurrentItem( id );
+}
+
+void QuickOpenFunctionChooseForm::slotFileChange( int id )
+{
+ fileBox->setCurrentItem( id );
+ filepathlabel->setText( m_relPaths[id] );
+}
+
+
+#include "quickopenfunctionchooseform.moc"
+
diff --git a/parts/quickopen/quickopenfunctionchooseform.h b/parts/quickopen/quickopenfunctionchooseform.h
new file mode 100644
index 00000000..2529ed46
--- /dev/null
+++ b/parts/quickopen/quickopenfunctionchooseform.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef QUICKOPENFUNCTIONCHOOSEFORM_H
+#define QUICKOPENFUNCTIONCHOOSEFORM_H
+
+#include "quickopenfunctionchooseformbase.h"
+
+#include <qmap.h>
+
+class QuickOpenFunctionChooseForm : public QuickOpenFunctionChooseFormBase
+{
+ Q_OBJECT
+
+public:
+ QuickOpenFunctionChooseForm(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~QuickOpenFunctionChooseForm();
+
+ void setRelativePath(int id, const QString &path) { m_relPaths[id] = path; }
+
+public slots:
+ virtual void slotArgsChange( int id );
+ virtual void slotFileChange( int id );
+
+private:
+ QMap<int, QString> m_relPaths;
+
+};
+
+#endif
+
diff --git a/parts/quickopen/quickopenfunctionchooseformbase.ui b/parts/quickopen/quickopenfunctionchooseformbase.ui
new file mode 100644
index 00000000..09c872d9
--- /dev/null
+++ b/parts/quickopen/quickopenfunctionchooseformbase.ui
@@ -0,0 +1,231 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>QuickOpenFunctionChooseFormBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>QuickOpenFunctionChooseFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>642</width>
+ <height>373</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KSqueezedTextLabel" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>filepathlabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="3">
+ <property name="name">
+ <cstring>cancelBtn</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>okBtn</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>File name:</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>fileBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="2" column="0" rowspan="1" colspan="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>261</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Function arguments list:</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>argBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentItem">
+ <number>-1</number>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>argBox</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>slotFileChange(int)</slot>
+ </connection>
+ <connection>
+ <sender>fileBox</sender>
+ <signal>highlighted(int)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>slotArgsChange(int)</slot>
+ </connection>
+ <connection>
+ <sender>argBox</sender>
+ <signal>returnPressed(QListBoxItem*)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>argBox</sender>
+ <signal>clicked(QListBoxItem*)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>fileBox</sender>
+ <signal>returnPressed(QListBoxItem*)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>fileBox</sender>
+ <signal>clicked(QListBoxItem*)</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>QuickOpenFunctionChooseFormBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>fileBox</tabstop>
+ <tabstop>argBox</tabstop>
+ <tabstop>okBtn</tabstop>
+ <tabstop>cancelBtn</tabstop>
+</tabstops>
+<slots>
+ <slot specifier="pure virtual">slotFileChange( int id )</slot>
+ <slot specifier="pure virtual">slotArgsChange( int id )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>ksqueezedtextlabel.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>klistbox.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/quickopen/quickopenfunctiondialog.cpp b/parts/quickopen/quickopenfunctiondialog.cpp
new file mode 100644
index 00000000..ede3450b
--- /dev/null
+++ b/parts/quickopen/quickopenfunctiondialog.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <klocale.h>
+#include <qlabel.h>
+#include <qvaluelist.h>
+
+#include <kcompletion.h>
+#include <kdebug.h>
+#include <klistbox.h>
+#include <kmessagebox.h>
+#include <klineedit.h>
+
+#include <kdevplugin.h>
+#include <codemodel_utils.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <kdevlanguagesupport.h>
+#include <qregexp.h>
+
+
+#include "quickopenfunctionchooseform.h"
+#include "quickopenfunctiondialog.h"
+
+QuickOpenFunctionDialog::QuickOpenFunctionDialog( QuickOpenPart *part, QWidget* parent, const char* name, bool modal, WFlags fl)
+: QuickOpenDialog(part, parent, name, modal, fl)
+{
+ nameLabel->setText( i18n("Function &name:") );
+ itemListLabel->setText( i18n("Function &list:") );
+
+ fillItemList();
+
+ itemList->insertStringList( wildCardCompletion( "" ) );
+
+ nameEdit->setFocus();
+
+ itemList->setCurrentItem( 0 );
+}
+
+void QuickOpenFunctionDialog::fillItemList() {
+ m_items.clear();
+ m_functionDefList.clear();
+ FileList fileList = m_part->codeModel()->fileList();
+
+ // for each one file, get all functions
+ FileDom fileDom;
+ for( FileList::Iterator it = fileList.begin() ; it!=fileList.end() ; ++it ){
+ fileDom = *it;
+ FunctionDefinitionList defs = CodeModelUtils::allFunctionDefinitionsDetailed( fileDom ).functionList;
+ if( defs.isEmpty() ) {
+ m_functionDefList += CodeModelUtils::allFunctionsDetailed( fileDom ).functionList;
+ } else {
+ for( FunctionDefinitionList::iterator it = defs.begin(); it != defs.end(); ++it )
+ (m_functionDefList).append( (*it).data() );
+ }
+ }
+
+ for( FunctionList::const_iterator it = m_functionDefList.begin(); it != m_functionDefList.end(); ++it )
+ m_items << (*it)->name();
+ QStringList_unique( m_items );
+}
+
+QuickOpenFunctionDialog::~QuickOpenFunctionDialog()
+{
+}
+
+void QuickOpenFunctionDialog::gotoFile( QString name )
+{
+ FunctionModel *fmodel;
+ FunctionList funcList;
+ FunctionDom fdom;
+
+ for( FunctionList::ConstIterator it = m_functionDefList.begin() ; it!=m_functionDefList.end() ; ++it ){
+ fdom = *it;
+ fmodel = fdom.data();
+ if( fmodel->name() == name ){
+ funcList.append( fdom );
+ }
+ }
+ if( funcList.count() == 1 ){
+ fdom = funcList.first();
+ fmodel = fdom.data();
+ QString fileNameStr = fmodel->fileName();
+ int startline, startcol;
+ fmodel->getStartPosition( &startline, &startcol );
+ m_part->partController()->editDocument( KURL( fileNameStr), startline, startcol );
+ selectClassViewItem( ItemDom(&(*fmodel)) );
+
+ }else if( funcList.count() > 1 ){
+ QString fileStr;
+
+ QuickOpenFunctionChooseForm fdlg( this, name.ascii() );
+
+ for( FunctionList::Iterator it = funcList.begin() ; it!=funcList.end() ; ++it ){
+ fmodel = (*it).data();
+
+ fdlg.argBox->insertItem( m_part->languageSupport()->formatModelItem(fmodel) +
+ (fmodel->scope().isEmpty() ? "" : " (in " + fmodel->scope().join("::") + ")"));
+ fileStr = KURL( fmodel->fileName() ).fileName();
+ KURL full_url( fmodel->fileName() );
+ KURL base_url( part()->project()->projectDirectory()+"/" );
+ fdlg.setRelativePath(fdlg.fileBox->count(),
+ KURL::relativeURL( base_url, full_url ));
+ fdlg.fileBox->insertItem(fileStr);
+ }
+ if( fdlg.exec() ){
+ int id = fdlg.argBox->currentItem();
+ if( id>-1 && id < (int) funcList.count() ){
+ FunctionModel *model = funcList[id].data();
+ int line, col;
+ model->getStartPosition( &line, &col );
+ selectClassViewItem( ItemDom(&(*model)) );
+ QString fileNameStr = model->fileName();
+ m_part->partController()->editDocument( KURL(fileNameStr), line );
+ }
+ }
+ }
+ else{
+ KMessageBox::error( this, i18n("Error: cannot find matching name function.") );
+ }
+
+ accept();
+}
+
+void QuickOpenFunctionDialog::slotExecuted(QListBoxItem* item)
+{
+ if( item ){
+ gotoFile( item->text() );
+ }
+}
+
+void QuickOpenFunctionDialog::executed(QListBoxItem*)
+{
+}
+
+void QuickOpenFunctionDialog::itemSelectionChanged() {
+ QString text = nameEdit->text();
+ QString txt = text;
+ QStringList parts = QStringList::split("::", text);
+ if( !text.endsWith( "::" ) && !parts.isEmpty() )
+ parts.pop_back();
+ parts << itemList->currentText();
+ nameEdit->setText(parts.join("::"));
+}
+
+void QuickOpenFunctionDialog::slotTextChangedDelayed() {
+ QString text = nameEdit->text();
+ QString txt = text;
+ QStringList parts = QStringList::split("::", text);
+ if(text.endsWith("::") || parts.isEmpty()) {
+ txt = "";
+ }else{
+ txt = parts.back();
+ parts.pop_back();
+ }
+ QValueList<QRegExp> regExpParts;
+ for( QStringList::const_iterator it = parts.begin(); it != parts.end(); ++it ) {
+ regExpParts << QRegExp( *it, false, true );
+ }
+
+ QString scope = parts.join("::");
+
+ if( m_scope != scope ) {
+ if( !scope.startsWith(m_scope) ) { ///Not a specialization, so reload all function-definitions
+ fillItemList();
+ }
+
+ if(!parts.isEmpty()) {
+ FunctionList accepted;
+ QStringList acceptedItems;
+ FunctionList::iterator it = m_functionDefList.begin();
+ while(it != m_functionDefList.end()) {
+ QStringList scope = (*it)->scope();
+ QValueList<QRegExp>::iterator mit = regExpParts.begin();
+ QStringList::iterator sit = scope.begin();
+ bool fail = false;
+ while(mit != regExpParts.end()) {
+ while(sit != scope.end() && !(*mit).exactMatch( *sit ) ) ++sit;
+ if(sit == scope.end()) {
+ fail = true;
+ break;
+ }
+ ++mit;
+ }
+ if(!fail) {
+ accepted.append(*it);
+ acceptedItems << (*it)->name();
+ }
+ ++it;
+ }
+ m_functionDefList = accepted;
+ m_items = acceptedItems;
+ QStringList_unique( m_items );
+ }
+
+ m_scope = scope;
+ }
+
+ itemList->clear();
+ itemList->insertStringList( wildCardCompletion( txt ) );
+ itemList->setCurrentItem(0);
+}
+
+void QuickOpenFunctionDialog::slotReturnPressed()
+{
+ maybeUpdateSelection();
+ QListBoxItem *listboxItem = itemList->selectedItem();
+ slotExecuted( listboxItem );
+}
+
+#include "quickopenfunctiondialog.moc"
+
diff --git a/parts/quickopen/quickopenfunctiondialog.h b/parts/quickopen/quickopenfunctiondialog.h
new file mode 100644
index 00000000..14432b48
--- /dev/null
+++ b/parts/quickopen/quickopenfunctiondialog.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2004 Ahn, Duk J.(adjj22@kornet.net) (adjj1@hanmail.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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef QUICKOPENFUNCTIONDLG_H
+#define QUICKOPENFUNCTIONDLG_H
+
+#include <codemodel.h>
+
+#include "quickopendialog.h"
+#include "quickopen_part.h"
+
+class KCompletion;
+class QuickOpenPart;
+
+class QuickOpenFunctionDialog : public QuickOpenDialog
+{
+ Q_OBJECT
+
+public:
+ QuickOpenFunctionDialog( QuickOpenPart* part, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~QuickOpenFunctionDialog();
+
+ void gotoFile( QString name );
+
+ QuickOpenPart* part(){ return m_part; };
+
+public slots:
+ virtual void slotExecuted(QListBoxItem*);//itemList executed, returnPressed
+ virtual void executed(QListBoxItem*); //
+ virtual void slotReturnPressed(); //buttonOk clicked, nameEdit returnPressed
+ virtual void slotTextChangedDelayed();
+ virtual void itemSelectionChanged();
+
+protected:
+ void fillItemList();
+ QString m_scope;
+ FunctionList m_functionDefList;
+ QStringList m_functionStrList;
+
+};
+
+#endif
+
diff --git a/parts/regexptest/Makefile.am b/parts/regexptest/Makefile.am
new file mode 100644
index 00000000..43edb690
--- /dev/null
+++ b/parts/regexptest/Makefile.am
@@ -0,0 +1,17 @@
+# Here resides the regexptest part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevregexptest.la
+libkdevregexptest_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevregexptest_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevregexptest_la_SOURCES = regexptestpart.cpp regexptestdlg.cpp regexptestdlgbase.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevregexptest.desktop
+
+rcdir = $(kde_datadir)/kdevregexptest
+rc_DATA = kdevregexptest.rc
diff --git a/parts/regexptest/README.dox b/parts/regexptest/README.dox
new file mode 100644
index 00000000..d145ae76
--- /dev/null
+++ b/parts/regexptest/README.dox
@@ -0,0 +1,49 @@
+/** \class RegexpTestPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/regexptest/kdevregexptest.desktop b/parts/regexptest/kdevregexptest.desktop
new file mode 100644
index 00000000..85370fbf
--- /dev/null
+++ b/parts/regexptest/kdevregexptest.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Tool to design and test regular expressions against common regexp syntaxes.
+Comment[ca]=Eina per a dissenyar i provar expressions regulars amb sintaxis d'expressions regulars comuns.
+Comment[da]=Værktøj til at designe og teste regulære udtryk imod almindelige regexp syntakser.
+Comment[de]=Ein Werkzeug zum Erstellen und Testen regulärer Ausdrücke.
+Comment[el]=Εργαλείο για το σχεδιασμό και τη δοκιμή κανονικών εκφράσεων με κοινή σύνταξη κανονικών εκφράσεων.
+Comment[es]=Herramienta para diseñar y probar expresiones regulares con sintaxis comunes.
+Comment[et]=Vahend regulaaravaldiste loomiseks ja korrektsuse testimiseks.
+Comment[eu]=Ohizko regexp sintaxiaren arabera espresio erregularra diseinatu eta egiaztatzeko tresna.
+Comment[fa]=ابزاری برای طراحی و آزمودن عبارتهای منظم در برابر نحوهای مشترک عبارت منظم
+Comment[fr]=Outil pour créer et tester des expressions rationnelles par rapport aux syntaxes des expressions rationnnelles communes.
+Comment[gl]=Ferramenta para deseñar e probar expresións regulares con sintaxes típicas para expresións regulares
+Comment[hu]=Tervezőprogram reguláris kifejezések tervezéséhez és teszteléséhez, többféle szintaxis szerint
+Comment[it]=Strumento per progettare e verificare espressioni regolari con le sintassi comuni di regexp.
+Comment[ja]=共通の regexp 構文に対する正規表現を設計したりテストするツール
+Comment[ms]=Alatan untuk mereka dan menguji regular expressions berbanding sintaks biasa regexp.
+Comment[nds]=En Warktüüch för't Opstellen un Utproberen vun reguleer Utdrück in en Reeg "regexp"-Schriefwiesen.
+Comment[ne]=साझा रेगेक्प वाक्य संरचनाको बिरूद्ध नियमित अभिव्यक्ति डिजाइन र परीक्षण गर्ने उपकरण ।
+Comment[nl]=Gereedschap voor het ontwerpen en testen van reguliere expressies.
+Comment[pl]=Narzędzie do tworzenia i testowania wyrażeń regularnych.
+Comment[pt]=Uma ferramenta para desenhar e testar expressões regulares sobre várias sintaxes comuns de expressões.
+Comment[pt_BR]=Ferramenta para desenvolver e testar expressões regulares com base na sintaxe comum das regexp.
+Comment[ru]=Средство для определения и проверки регулярных выражений на предмет соответствия их наиболее распространённым вариантам синтаксиса.
+Comment[sk]=Nástroj pre dizajn a testovanie regulárnych výrazov.
+Comment[sr]=Алат за дизајн и тестирање регуларних израза насупрот уобичајеним рег.из. синтаксама.
+Comment[sr@Latn]=Alat za dizajn i testiranje regularnih izraza nasuprot uobičajenim reg.iz. sintaksama.
+Comment[sv]=Verktyg för att skapa och testa reguljära uttryck mot vanlig syntax för reguljära uttryck.
+Comment[ta]=ரேக்ஸ்ப் தொடரமைப்பதற்கு எதிராக கருவி உபயோகித்து வரைதல் மற்றும் வாடிக்கையான தொடர்களை பரிசோதிக்க.
+Comment[tg]=Восита барои муаян намудан ва тафтиш намудани баёни ботартиб дар асоси ҷорӣ шудаи вариантҳои синтаксисӣ менамояд.
+Comment[tr]=Genel regexp söz dizimlerine karşı düzenli ifadeleri düzenlemeye ve test etmeye yarayan araç.
+Comment[zh_CN]=依据通用正则表达式语法进行正则表达式设计和测试的工具。
+Comment[zh_TW]=設計、測試正規表示式語法的工具。
+Name=KDevRegexpTest
+Name[da]=KDevelop test af regulære udtryk
+Name[de]=RegExp-Überprüfung (KDevelop)
+Name[hi]=के-डेव-रेगएक्सपी-टेक्स्ट
+Name[nds]=RegExp-Prööv (KDevelop)
+Name[pl]=KDevTestWyrReg
+Name[sk]=KDev Regexp test
+Name[sv]=KDevelop test av reguljära uttryck
+Name[ta]=Kடேவ்ரெக்ஸ்ப் சோதனை
+Name[zh_TW]=KDevelop 正規表示式測試
+GenericName=Regular Expression Tester
+GenericName[ca]=Comprovador d'expressions regulars
+GenericName[da]=Test af regulære udtryk
+GenericName[de]=RegExp-Überprüfung
+GenericName[el]=Δοκιμαστής κανονικών εκφράσεων
+GenericName[es]=Comprobador de expresiones regulares
+GenericName[et]=Regulaaravaldiste testija
+GenericName[eu]=Espresio erregular egiaztatzailea
+GenericName[fa]=آزمایندۀ عبارت منظم
+GenericName[fr]=Testeur d'expressions rationnelles
+GenericName[gl]=Comprobador de expresións regulares
+GenericName[hi]=रेगुलर एक्सप्रेशन टेस्टर
+GenericName[hu]=Tesztprogram reguláris kifejezésekhez
+GenericName[it]=Verificatore per espressioni regolari
+GenericName[ja]=正規表現テスタ
+GenericName[ms]=Penguji Regular Expression
+GenericName[nds]=RegExp-Prööv
+GenericName[ne]=नियमित अभिव्यक्ति परीक्षक
+GenericName[nl]=Reguliere expressie-tester
+GenericName[pl]=Tester wyrażeń regularnych
+GenericName[pt]=Ferramenta de Teste de Expressões Regulares
+GenericName[pt_BR]=Testador de Expressão Regular
+GenericName[ru]=Проверка регулярных выражений
+GenericName[sk]=Tester pre regulárne výrazy
+GenericName[sl]=Preverjalnik regularnih izrazov
+GenericName[sr]=Тестер регуларних израза
+GenericName[sr@Latn]=Tester regularnih izraza
+GenericName[sv]=Test av reguljära uttryck
+GenericName[ta]=வாடிக்கையான தொடர்களை பரிசோதிப்பவர்.
+GenericName[tg]=Тафтиши баёни ботартиб
+GenericName[tr]=Düzenli İfade Test Edicisi
+GenericName[zh_CN]=正则表达式测试
+GenericName[zh_TW]=正規表示式測試器
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevregexptest
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=ScriptDevelopment,CDevelopment,CPPDevelopment
diff --git a/parts/regexptest/kdevregexptest.rc b/parts/regexptest/kdevregexptest.rc
new file mode 100644
index 00000000..99893d7f
--- /dev/null
+++ b/parts/regexptest/kdevregexptest.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevRegExpTest" version="1">
+<MenuBar>
+ <Menu name="tools" >
+ <Action name="tools_regexptest" group="tools_file_operations"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/parts/regexptest/regexptestdlg.cpp b/parts/regexptest/regexptestdlg.cpp
new file mode 100644
index 00000000..a211a797
--- /dev/null
+++ b/parts/regexptest/regexptestdlg.cpp
@@ -0,0 +1,263 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "regexptestdlg.h"
+
+#include <sys/types.h>
+#include <string.h>
+#include <stdlib.h>
+#include <regex.h>
+#include <qlabel.h>
+#include <qlistview.h>
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <klineedit.h>
+#include <kdeversion.h>
+#include <kregexp.h>
+#include <kdebug.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <kparts/componentfactory.h>
+#include <kregexpeditorinterface.h>
+
+#include "kdevplugin.h"
+#include "kdevpartcontroller.h"
+
+
+RegexpTestDialog::RegexpTestDialog(KDevPlugin *part)
+ : RegexpTestDialogBase(0, "regexp test dialog", false), _regexp_dialog(0)
+{
+ pattern_edit->setFocus();
+ pattern_edit->setFont(KGlobalSettings::fixedFont());
+ teststring_edit->setFont(KGlobalSettings::fixedFont());
+ subgroups_listview->setSorting(0);
+
+ m_part = part;
+}
+
+
+RegexpTestDialog::~RegexpTestDialog()
+{}
+
+
+void RegexpTestDialog::showEvent(QShowEvent *)
+{
+ KParts::ReadWritePart *rwpart = dynamic_cast<KParts::ReadWritePart*>
+ (m_part->partController()->activePart());
+ insertbutton->setEnabled(rwpart);
+}
+
+
+void RegexpTestDialog::somethingChanged()
+{
+ success_label->clear();
+ subgroups_listview->clear();
+
+ if ( qregexp_button->isChecked() || qregexp_min_button->isChecked() )
+ checkQRegExp();
+ else if ( kregexp_button->isChecked() )
+ checkKRegExp();
+ else
+ checkPOSIX();
+}
+
+void RegexpTestDialog::checkQRegExp()
+{
+ QRegExp rx( pattern_edit->text() );
+ rx.setMinimal( qregexp_min_button->isChecked() );
+ if ( !rx.isValid() ) {
+#if QT_VERSION >= 0x030100
+ success_label->setText( rx.errorString() );
+#else
+ success_label->setText( i18n("Error compiling the regular expression.") );
+#endif
+ return;
+ }
+ if ( rx.search( teststring_edit->text() ) < 0 ) {
+ success_label->setText( i18n( "No match" ) );
+ return;
+ }
+ success_label->setText( i18n("Successfully matched") );
+#if QT_VERSION >= 0x030100
+ int numCaptures = rx.numCaptures() + 1;
+#else
+ int numCaptures = 10;
+#endif
+ for ( int i = 0; i < numCaptures; ++i ) {
+ new QListViewItem( subgroups_listview, QString::number( i ), rx.cap( i ) );
+ }
+}
+
+void RegexpTestDialog::checkKRegExp()
+{
+ KRegExp rx;
+ if ( !rx.compile( pattern_edit->text().latin1() ) ) {
+ success_label->setText( i18n( "Compile error, your regexp is invalid" ) );
+ return;
+ }
+ if ( !rx.match( teststring_edit->text().latin1() ) ) {
+ success_label->setText( i18n( "No match" ) );
+ return;
+ }
+ success_label->setText( i18n("Successfully matched") );
+ for ( int i = 0; i <= 9; ++i ) {
+ const char* grp = rx.group( i );
+ if ( grp )
+ new QListViewItem( subgroups_listview, QString::number( i ), QString( grp ) );
+ }
+}
+
+void RegexpTestDialog::checkPOSIX()
+{
+ regex_t compiledPattern;
+ regmatch_t matches[20];
+ int cflags = extendedposix_button->isChecked()? REG_EXTENDED : 0;
+ QCString regexp = pattern_edit->text().local8Bit();
+ int res = regcomp(&compiledPattern, regexp, cflags);
+ if (res != 0) {
+ QString regcompMessage;
+ switch (res)
+ {
+ case REG_BADRPT:
+ regcompMessage = i18n("Repetition operators must not appear as first character");
+ break;
+ case REG_BADBR:
+ regcompMessage = i18n("Invalid use of back reference operator");
+ break;
+ case REG_EBRACE:
+ regcompMessage = i18n("Unmatched brace interval operators");
+ break;
+ case REG_EBRACK:
+ regcompMessage = i18n("Unmatched bracket list operators");
+ break;
+ case REG_ERANGE:
+ regcompMessage = i18n("Invalid use of range operator");
+ break;
+ case REG_ECTYPE:
+ regcompMessage = i18n("Unknown character class");
+ break;
+ case REG_ECOLLATE:
+ regcompMessage = i18n("Invalid collating element");
+ break;
+ case REG_EPAREN:
+ regcompMessage = i18n("Unmatched parenthesis group operators");
+ break;
+ case REG_ESUBREG:
+ regcompMessage = i18n("Invalid back reference to subexpression");
+ break;
+ case REG_EESCAPE:
+ regcompMessage = i18n("Trailing backslash");
+ break;
+ case REG_BADPAT:
+ regcompMessage = i18n("Invalid use of pattern operators");
+ break;
+#ifdef REG_ESIZE
+ case REG_ESIZE:
+ regcompMessage = i18n("Regular expression too large");
+ break;
+#endif
+ default:
+ regcompMessage = i18n("Unknown error");
+ break;
+ }
+ success_label->setText(regcompMessage);
+ return;
+ }
+
+ for (int i = 0; i < 20; ++i) {
+ matches[i].rm_so = -1;
+ matches[i].rm_eo = -1;
+ }
+
+ QCString testString = teststring_edit->text().local8Bit();
+ res = regexec(&compiledPattern, testString, 20, matches, 0);
+ if (res != 0) {
+ success_label->setText(i18n("No match"));
+ return;
+ }
+
+ success_label->setText(i18n("Successfully matched"));
+ int len = testString.length();
+ for (int i = 0; i < 20; ++i) {
+ if (matches[i].rm_so >= 0 && matches[i].rm_so <= len &&
+ matches[i].rm_eo >= 0 && matches[i].rm_eo <= len &&
+ matches[i].rm_so <= matches[i].rm_eo) {
+ QCString subGroup = testString.mid(matches[i].rm_so, matches[i].rm_eo - matches[i].rm_so);
+ new QListViewItem(subgroups_listview, QString::number(i), subGroup);
+ }
+ }
+ regfree(&compiledPattern);
+}
+
+
+void RegexpTestDialog::insertQuoted()
+{
+ QString rawstr = pattern_edit->text();
+
+ QString str;
+
+ int len = rawstr.length();
+ for (int i=0; i < len; ++i) {
+ QChar ch = rawstr[i];
+ if (ch == '"')
+ str += "\\\"";
+ else if (ch == '\\')
+ str += "\\\\";
+ else
+ str += ch;
+ }
+
+ KParts::ReadWritePart *rwpart
+ = dynamic_cast<KParts::ReadWritePart*>(m_part->partController()->activePart());
+ QWidget *view = m_part->partController()->activeWidget();
+
+ KTextEditor::EditInterface *editiface
+ = dynamic_cast<KTextEditor::EditInterface*>(rwpart);
+ if (!editiface) {
+ kdDebug() << "no edit" << endl;
+ return;
+ }
+ KTextEditor::ViewCursorInterface *cursoriface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(view);
+ if (!cursoriface) {
+ kdDebug() << "no viewcursor" << endl;
+ return;
+ }
+
+ uint line, col;
+ cursoriface->cursorPositionReal(&line, &col);
+ editiface->insertText(line, col, str);
+ reject();
+}
+
+void RegexpTestDialog::showRegExpEditor( )
+{
+ _regexp_dialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
+
+ if ( _regexp_dialog )
+ {
+ KRegExpEditorInterface *editor =
+ static_cast<KRegExpEditorInterface *>( _regexp_dialog->qt_cast( "KRegExpEditorInterface" ) );
+
+ editor->setRegExp( pattern_edit->text() );
+
+ if ( _regexp_dialog->exec() == QDialog::Accepted )
+ {
+ pattern_edit->setText( editor->regExp() );
+ }
+ }
+}
+
+#include "regexptestdlg.moc"
diff --git a/parts/regexptest/regexptestdlg.h b/parts/regexptest/regexptestdlg.h
new file mode 100644
index 00000000..e1c1a4e3
--- /dev/null
+++ b/parts/regexptest/regexptestdlg.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _REGEXPTESTDLG_H_
+#define _REGEXPTESTDLG_H_
+
+#include "regexptestdlgbase.h"
+
+class KDevPlugin;
+
+
+class RegexpTestDialog : public RegexpTestDialogBase
+{
+ Q_OBJECT
+
+public:
+ RegexpTestDialog( KDevPlugin *part );
+ ~RegexpTestDialog();
+
+protected:
+ virtual void showEvent(QShowEvent *e);
+
+protected slots:
+ void showRegExpEditor();
+
+private:
+ virtual void somethingChanged();
+ virtual void checkPOSIX();
+ virtual void checkQRegExp();
+ virtual void checkKRegExp();
+ virtual void insertQuoted();
+
+ KDevPlugin *m_part;
+
+ QDialog * _regexp_dialog;
+};
+
+#endif
diff --git a/parts/regexptest/regexptestdlgbase.ui b/parts/regexptest/regexptestdlgbase.ui
new file mode 100644
index 00000000..7b52620a
--- /dev/null
+++ b/parts/regexptest/regexptestdlgbase.ui
@@ -0,0 +1,352 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>RegexpTestDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>regexp_test_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>541</width>
+ <height>367</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Test Regular Expression</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>pattern_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Regular expression:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>pattern_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>teststring_label</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Test string:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>teststring_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>teststring_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enter a string which will be matched against the regular expression</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>success_label</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>insertbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert Quoted</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Inserts the regular expression into the currently opened source code file. Escapes any special characters like backslash.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelbutton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Close</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Closes the dialog</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>pattern_edit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>enter a regular expression, for example &lt;tt&gt;KD.*&lt;/tt&gt;, which matches all strings beginning with "KD"</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>flavor_group</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>4</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Regular Expression T&amp;ype</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>basicposix_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Basic POSIX syntax (used by grep)</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A description of this syntax can be found in the grep manpage</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>extendedposix_button</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xtended POSIX syntax (used by egrep)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A description of this syntax can be found in the grep manpage</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>qregexp_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;QRegExp syntax</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A description of this syntax can be found in the documentation of the QRegExp class</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>qregexp_min_button</cstring>
+ </property>
+ <property name="text">
+ <string>QRegExp syntax (&amp;minimal)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Matches a QRegExp non-greedy. Please read the QRegExp::setMinimal documentation for more details.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>kregexp_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;KRegExp syntax</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A description of this syntax can be found in the KDE API documentation.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>rxedit_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>subgroups_label</cstring>
+ </property>
+ <property name="text">
+ <string>Matched subgroups:</string>
+ </property>
+ </widget>
+ <widget class="QListView">
+ <column>
+ <property name="text">
+ <string>Group</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>subgroups_listview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Shows which groups were matched. See the corresponding documentation for how groups are matched.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>flavor_group</sender>
+ <signal>clicked(int)</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+ <connection>
+ <sender>pattern_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+ <connection>
+ <sender>teststring_edit</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>somethingChanged()</slot>
+ </connection>
+ <connection>
+ <sender>insertbutton</sender>
+ <signal>clicked()</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>insertQuoted()</slot>
+ </connection>
+ <connection>
+ <sender>rxedit_button</sender>
+ <signal>clicked()</signal>
+ <receiver>regexp_test_dialog</receiver>
+ <slot>showRegExpEditor()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>pattern_edit</tabstop>
+ <tabstop>rxedit_button</tabstop>
+ <tabstop>basicposix_button</tabstop>
+ <tabstop>teststring_edit</tabstop>
+ <tabstop>subgroups_listview</tabstop>
+ <tabstop>insertbutton</tabstop>
+ <tabstop>cancelbutton</tabstop>
+ <tabstop>extendedposix_button</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">insertQuoted()</slot>
+ <slot>somethingChanged()</slot>
+ <slot access="protected">showRegExpEditor()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/regexptest/regexptestpart.cpp b/parts/regexptest/regexptestpart.cpp
new file mode 100644
index 00000000..7b6b5193
--- /dev/null
+++ b/parts/regexptest/regexptestpart.cpp
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "regexptestpart.h"
+
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <kaction.h>
+
+#include "kdevcore.h"
+#include "regexptestdlg.h"
+
+static const KDevPluginInfo data("kdevregexptest");
+
+typedef KDevGenericFactory<RegexpTestPart> RegexpTestFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevregexptest, RegexpTestFactory( data ) )
+
+RegexpTestPart::RegexpTestPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "RegexpTestPart")
+{
+ setInstance(RegexpTestFactory::instance());
+ setXMLFile("kdevregexptest.rc");
+
+ KAction *action;
+
+ action = new KAction( i18n("Debug Regular Expression..."), 0,
+ this, SLOT(slotRegexpTest()),
+ actionCollection(), "tools_regexptest" );
+ action->setToolTip(i18n("Debug regular expression"));
+ action->setWhatsThis(i18n("<b>Debug regular expression</b><p>Allows to enter a regular expression "
+ "and validate it. It is possible to check syntax of basic POSIX, extended POSIX "
+ "regular expressions and also syntax allowed by QRegExp and KRegExp classes."));
+
+ m_dialog = 0;
+}
+
+
+RegexpTestPart::~RegexpTestPart()
+{
+ delete m_dialog;
+}
+
+
+void RegexpTestPart::slotRegexpTest()
+{
+ if (!m_dialog) {
+ m_dialog = new RegexpTestDialog(this);
+ }
+
+ m_dialog->show();
+}
+
+
+#include "regexptestpart.moc"
diff --git a/parts/regexptest/regexptestpart.h b/parts/regexptest/regexptestpart.h
new file mode 100644
index 00000000..7eabeffc
--- /dev/null
+++ b/parts/regexptest/regexptestpart.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _REGEXPTESTPART_H_
+#define _REGEXPTESTPART_H_
+
+#include <qguardedptr.h>
+#include <kdialogbase.h>
+#include "kdevplugin.h"
+
+class RegexpTestDialog;
+
+
+class RegexpTestPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ RegexpTestPart( QObject *parent, const char *name, const QStringList & );
+ ~RegexpTestPart();
+
+private slots:
+ void slotRegexpTest();
+
+private:
+ RegexpTestDialog *m_dialog;
+};
+
+#endif
diff --git a/parts/replace/Makefile.am b/parts/replace/Makefile.am
new file mode 100644
index 00000000..78a7ab4b
--- /dev/null
+++ b/parts/replace/Makefile.am
@@ -0,0 +1,16 @@
+# Here resides the replace part (search and replace in the entire project)
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevreplace.la
+libkdevreplace_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevreplace_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+libkdevreplace_la_SOURCES = replace_part.cpp replace_widget.cpp replacedlg.ui replaceitem.cpp replaceview.cpp replacedlgimpl.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevreplace.desktop
+
+rcdir = $(kde_datadir)/kdevreplace
+rc_DATA = kdevpart_replace.rc
diff --git a/parts/replace/README b/parts/replace/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/replace/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/replace/README.dox b/parts/replace/README.dox
new file mode 100644
index 00000000..c5953c8a
--- /dev/null
+++ b/parts/replace/README.dox
@@ -0,0 +1,24 @@
+/** \class ReplacePart
+This plugin replaces a search pattern with a specified string, after letting the
+user preview and choose which replacements should take place.
+
+The operation is only carried out on files that are part of the current project.
+
+\authors <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a> aka teatime
+
+\maintainer <a href="mailto:jens.dagerbo AT swipnet.se">Jens Dagerbo</a> aka teatime
+
+\feature Replaces a search pattern with a specified string, after letting the
+user preview and choose which replacements should take place.
+
+\todo Better user feedback
+\todo Better commenting (doxygen style comments).
+
+
+\warning The operation is only carried out on files that are part of the current project.
+
+\warning Search/Replace will work on all matches on a line.
+There is no (nor will there likely be) a way to limit matching to only some matches on the same line.
+In practice this is not a very big problem.
+
+*/
diff --git a/parts/replace/kdevpart_replace.rc b/parts/replace/kdevpart_replace.rc
new file mode 100644
index 00000000..e3818308
--- /dev/null
+++ b/parts/replace/kdevpart_replace.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="replace" library="libreplaceplugin" version="1">
+<MenuBar>
+ <Menu name="edit">
+ <Action name="edit_replace_across" group="kdev_edit_find_merge"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/replace/kdevreplace.desktop b/parts/replace/kdevreplace.desktop
new file mode 100644
index 00000000..13caf5b6
--- /dev/null
+++ b/parts/replace/kdevreplace.desktop
@@ -0,0 +1,80 @@
+[Desktop Entry]
+Type=Service
+Exec=
+Comment=This plugin is an interactive projectwide "Search and Replace" tool. Search using string or regexp matching, and select the replacements to be made from a preview before the action is finalized. When loaded it appears in the Edit menu.
+Comment[ca]=Aquest connector és una eina interactiva de "Recerca i substitució" a tot el projecte. Pot cercar mitjançant patrons o expressions regulars, i seleccionar les substitucions en una vista prèvia, abans de que finalitzi l'acció. Quan està carregat apareix en el menú Edita.
+Comment[da]=Dette plugin er et interaktivt projektomfattende "Søg og erstat" værktøj. Søg ved brug af streng eller regexp tilpasning, og vælg erstatninger lavet fra en forhåndsvisning før handlingen blive helt udført. Når det er indlæst er det i redigeringsmenuen.
+Comment[de]=Diese Komponente ist ein interaktives Werkzeug zum projektweiten "Suchen und Ersetzen" von Begriffen oder regulären Ausdrücken. Die zu ersetzenden Zeichenketten können in einer Vorschau ausgewählt werden. Erscheint im Menü "Bearbeiten", wenn es geladen ist.
+Comment[el]=Αυτό το πρόσθετο είναι ένα εργαλείο αλληλεπίδρασης "Αναζήτησης και αντικατάστασης" για όλο το έργο. Αναζητά χρησιμοποιώντας συμβολοσειρές ή κανονικές εκφράσεις, και επιλέγει τις αντικαταστάσεις από μια προεπισκόπηση πριν να εκτελεστεί η ενέργεια. Όταν φορτωθεί είναι διαθέσιμο από το μενού επεξεργασίας.
+Comment[en_GB]=This plugin is an interactive projectwide "Search and Replace" tool. Search using string or regexp matching, and select the replacements to be made from a preview before the action is finalised. When loaded it appears in the Edit menu.
+Comment[es]=Este complemento es una herramienta interactiva de «Búsqueda y sustitución» para todo el proyecto. Puede buscar mediante patrones o expresiones regulares, y seleccionar las sustituciones en una previsualización, antes de que finalice la acción. Cuando está cargado aparece en el menú Editar.
+Comment[et]=See plugin on kogu projekti hõlmav interaktiivne "otsi ja asenda" vahend. Otsida saab stringe või regulaaravaldiste sobivusi, asendusi saab valida eelvaatluse abil, enne kui need päriselt teoks teha. Kasutamisel kättesaadav redigeerimismenüüst.
+Comment[eu]=Plugin hau proiektu mailako "Bilatu eta ordeztu" tresna interaktiboa da. Bila ezazu kate edo regexp bat-egitea erabiliz, eta hautatu egin beharreko ordezkapenak aurrebista batetik ekintza amaitu aurretik. Kargatzean Editatu menuan agertzen da.
+Comment[fa]=این وصله یک ابزار گسترۀ پروژۀ تعاملی »جستجو و جایگزینی« می‌باشد. با استفاده از تطبیق رشته یا عبارت منظم جستجو می‌کند، و جایگزینهایی را گزینش می‌کند تا قبل از اتمام کنش، از یک پیش‌نمایش ایجاد شود. در هنگام بارگذاری در گزینگان ویرایش ظاهر می‌شود.
+Comment[fr]=Ce module externe est un outil de « Recherche et remplacement » à l'échelle du projet. Faites une recherche à l'aide de la correspondance de chaînes ou d'expressions rationnelles, et sélectionnez les remplacements à effectuer à partir d'un aperçu avant que l'action ne soit finalisée. Lorsqu'il est chargé, ce module externe apparaît dans le menu « Édition ».
+Comment[gl]=Esta extensión é unha ferramenta interactiva "Procurar e reemprazar" dispoñíbel en todo o proxecto. Busca usando coincidencias con strings ou expresións regulares, e selecciona os reemprazamentos a facer nunha previsualización antes de que as accións finalicen. Cando se carga aparece no menú Editar.
+Comment[hu]=Ezzel a bővítőmodullal az egész projektre kiterjedő keresést és cserét lehet végezni. Lehet sztringre és reg. kifejezésre keresni, az elvégzendő műveleteket egy előnézeti ablakban lehet kiválasztani. A modul betöltés után a Szerkesztés menübe kerül.
+Comment[it]=Questo plugin è uno strumento interattivo per "Cerca e sostituisci" sui progetti. Cerca tramite stringhe e confronto regexp e seleziona le sostituzioni da compiere da un'anteprima prima che le azioni siano finalizzate. Quando caricato apparirà nel menu Modifica.
+Comment[ja]=このプラグインは、プロジェクト規模で検索や置換を行う対話型のツールです。検索は文字列や正規表現の合致を使い、アクションが終了する前にプレビューで作られている置換を選択します。読み込まれると編集メニューに表示されます。
+Comment[ms]=Plugin ini adalah alatan "Cari dan Ganti" serata projek interaktif. Cari menggunakan padanan rentetan atau regexp, dan pilih gantian yang akan dibuat daripada pralihat sebelum tindakan diselesaikan. Apabila dimuatkan ia kelihatan didalam menu Sunting.
+Comment[nds]=Dit Moduul is en interaktiv projektwiet "Söken un Utwesseln"-Warktüüch. Du kannst na Tekenkeden oder mit reguleer Utdrück söken un de Ännern in en Vöransicht utsöken, ehr de Akschoon utföhrt warrt. Dukt in't Menü "Bewerken" op, wenn laadt.
+Comment[ne]=यो प्लगइन अन्तरक्रियात्मक परियोजनामा "खोजी गरेर प्रतिस्थापन गर्नुहोस्" उपकरण हो । स्ट्रिङ वा regexp मिल्दो प्रयोग गरेर खोजी गर्नुहोस् र कार्य समाप्त गर्नु पूर्व पूर्वावलोकनबाट प्रतिस्थापन गर्नेलाई चयन गर्नुहोस् । लोड भएपछि सम्पादन मेनुमा देखा पर्दछ ।
+Comment[nl]=Deze plugin biedt een interactieve, projectbrede "zoek en vervang"-tool. U kunt zoeken naar tekens of reguliere expressies en de vervanging kan in een dialoog worden bekeken voordat deze wordt uitgevoerd. Verschijnt in het menu Bewerken.
+Comment[pl]=Wtyczka działającego w całym projekcie narzędzia "Znajdź i zamień". Wyszukiwanie odbywa się za pomocą porównywania ciągów lub wyrażen regularnych, a wybór zamienników może być dokonywany przy włączonym podglądzie. Po wczytaniu pojawia się w menu Edycja.
+Comment[pt]=Este 'plugin' é uma ferramenta interactiva ao nível do projecto de "Procurar e Substituir". Pode procurar por texto ou por uma expressão regular e seleccionar as substituições a serem feitas, a partir de uma antevisão, antes de a acção terminar. Quando é carregado, aparece no menu Editar.
+Comment[pt_BR]=Este plug-in é uma ferramenta interativa de "Procurar e Substituir" por todo o projeto. Procura usando um string ou regexp correspondente, e seleciona as substituições a serem feitas de uma previsão antes da ação ser finalizada. Quando carregado ele aparece no menu Editar.
+Comment[ru]=Этот модуль предоставляет интерактивные возможности поиска и замены по файлам в проекте. Сначала проводится поиск по строке или регулярному выражению, далее выбор с предпросмотром и применение замен из списка доступных вариантов.
+Comment[sk]=Modul poskytuje interaktívny nástroj pre "Nájsť a Zameniť" v celom projekte.Vyhľadávanie pomocou regexp výrazov a výber nového reťazca z náhľadu pred samotnou zámenou. Po načítaní sa objaví v menu Edit.
+Comment[sr]=Овај прикључак је интерактивни „пронађи и замени“ алат широм пројекта. Тражите користећи знаковни низ или рег.из. поклапање, и из прегледа одаберите измене које ће бити извршене пре него што се акција заврши. Када је учитан појављује се у менију „Измени“.
+Comment[sr@Latn]=Ovaj priključak je interaktivni „pronađi i zameni“ alat širom projekta. Tražite koristeći znakovni niz ili reg.iz. poklapanje, i iz pregleda odaberite izmene koje će biti izvršene pre nego što se akcija završi. Kada je učitan pojavljuje se u meniju „Izmeni“.
+Comment[sv]=Insticksprogrammet är ett interaktivt verktyg för att "söka och ersätta" i hela projektet. Sök med en sträng eller reguljärt uttryck, och välj ersättningen som ska göras från en förhandsgranskning innan åtgärden slutförs. När det laddats visas det i redigeringsmenyn.
+Comment[ta]=இந்த சொருகி "Search and Replace" ஒரு சிறந்த திட்ட பணி கருவி. சரத்தை உபயோகித்து தேடுதல் அல்லது ரெக்ஸ்ப் பொருத்துதல், மற்றும் செயல்கள் தீர்மானிப்பதற்கு முன் முன்தோற்றத்தைப் பார்த்து மாற்ற வேண்டியதை தேர்வு செய்.
+Comment[tg]=Ин модул барои ковтукови интерактивӣ ва ҷой иваз намудан дар лоиҳаро имкон медиҳад.Аввал ковтуков дар сатр оғоз меёбад ва ё дар баёноти ботартиб, баъд аз он интихоби пеш аз намоиш ва истифода барии ҷой ивазкунӣ аз рӯйхати вариантҳои имконпазир гузаронида мешавад.
+Comment[tr]=Bu eklenti projenin tamamında "Ara ve Değiştir" aracıdır. Dizgi veya regexp eşleşmesi ara ve işlem sona ermeden bir önizlemeden yapılacak değişiklikleri seç. Yüklendiğinde Düzenle menüsünde durur.
+Comment[zh_CN]=这个插件是面向真个工程的“查找和替换”工具。 使用字符串或正则表达式匹配,并在操作完成前提供选择替换预览。启动后显示在编辑菜单中。
+Comment[zh_TW]=這個外掛程式是一個專案的「搜尋與取代」互動工具。使用字串或正規表示式來搜尋,並選擇是否要取代。載入後可以在「編輯」選單中找到。
+Name=KDevReplace
+Name[da]=KDevelop Erstat
+Name[nds]=KDevelop-Utwesseln
+Name[sk]=KDev zameniť
+Name[sv]=KDevelop ersätt
+Name[zh_TW]=KDevelop 取代
+GenericName=Replace Part
+GenericName[ca]=Part per a la substitució
+GenericName[da]=Erstatningspart
+GenericName[de]=Ersetzen-Komponente
+GenericName[el]=Τμήμα αντικατάστασης
+GenericName[es]=Servicio de sustitución
+GenericName[et]=Asendamise komponent
+GenericName[eu]=Ordeztu partea
+GenericName[fa]=جزء جایگزینی
+GenericName[fr]=Outil de remplacement
+GenericName[gl]='Part' reemprazar
+GenericName[hi]=रीप्लेस पार्ट
+GenericName[hu]=Cserélés
+GenericName[it]=Componente per sostituire
+GenericName[ja]=置換
+GenericName[ms]=Ganti Bahagian
+GenericName[nds]=Utwessel-Komponent
+GenericName[ne]=प्रतिस्थापन भाग
+GenericName[nl]=Zoeken en vervangen
+GenericName[pl]=Program do zastępowania
+GenericName[pt]=Parte de Substituição
+GenericName[pt_BR]=Parte Substituir
+GenericName[ru]=Замена по проекту
+GenericName[sk]=Part zameniť
+GenericName[sl]=Del za zamenjave
+GenericName[sr]=Део за замену
+GenericName[sr@Latn]=Deo za zamenu
+GenericName[sv]=Ersättning
+GenericName[ta]=மாற்றுப் பகுதி
+GenericName[tg]=Ҷой иваз намудан бо лоиҳа
+GenericName[tr]=Değiştirme Bileşeni
+GenericName[zh_CN]=替换模块
+GenericName[zh_TW]=取代元件
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevreplace
+X-KDevelop-Version=5
+X-KDevelop-Properties=FileReplace
diff --git a/parts/replace/replace_part.cpp b/parts/replace/replace_part.cpp
new file mode 100644
index 00000000..6e1312ed
--- /dev/null
+++ b/parts/replace/replace_part.cpp
@@ -0,0 +1,110 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 "replace_part.h"
+
+#include <qwhatsthis.h>
+
+#include <kaction.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <kdebug.h>
+#include <kstringhandler.h>
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+
+#include "replace_widget.h"
+
+static const KDevPluginInfo data("kdevreplace");
+
+typedef KDevGenericFactory<ReplacePart> ReplaceFactory;
+K_EXPORT_COMPONENT_FACTORY(libkdevreplace, ReplaceFactory(data))
+
+ReplacePart::ReplacePart(QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin( &data, parent, name ? name : "ReplacePart" )
+{
+ setInstance(ReplaceFactory::instance());
+ setXMLFile("kdevpart_replace.rc");
+
+ m_widget = new ReplaceWidget(this);
+ m_widget->setIcon( SmallIcon("filefind") );
+ m_widget->setCaption(i18n("Replace"));
+
+ QWhatsThis::add
+ (m_widget, i18n("<b>Replace</b><p>"
+ "This window shows a preview of a string replace "
+ "operation. Uncheck a line to exclude that replacement. "
+ "Uncheck a file to exclude the whole file from the "
+ "operation. "
+ "Clicking on a line in the list will automatically "
+ "open the corresponding source file and set the "
+ "cursor to the line with the match." ));
+
+ mainWindow()->embedOutputView( m_widget, i18n("Replace"), i18n("Project wide string replacement") );
+ mainWindow()->setViewAvailable( m_widget, false );
+
+ action = new KAction(i18n("Find-Select-Replace..."), 0,
+ CTRL+SHIFT+Key_R, this, SLOT(slotReplace()), actionCollection(), "edit_replace_across");
+ action->setToolTip( i18n("Project wide string replacement") );
+ action->setWhatsThis( i18n("<b>Find-Select-Replace</b><p>"
+ "Opens the project wide string replacement dialog. There you "
+ "can enter a string or a regular expression which is then "
+ "searched for within all files in the locations "
+ "you specify. Matches will be displayed in the <b>Replace</b> window, you "
+ "can replace them with the specified string, exclude them from replace operation or cancel the whole replace.") );
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(enableAction()));
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(disableAction()));
+}
+
+void ReplacePart::enableAction()
+{
+ action->setEnabled(true);
+}
+
+void ReplacePart::disableAction()
+{
+ action->setEnabled(false);
+}
+
+ReplacePart::~ReplacePart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+}
+
+void ReplacePart::slotReplace()
+{
+ m_widget->showDialog();
+}
+
+void ReplacePart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::EditorContext ))
+ return;
+
+ const EditorContext *econtext = static_cast<const EditorContext*>(context);
+ QString ident = econtext->currentWord();
+ if (!ident.isEmpty()) {
+ m_popupstr = ident;
+ QString squeezed = KStringHandler::csqueeze(ident, 30);
+ int id = popup->insertItem( i18n("Replace Project Wide: %1").arg(squeezed),
+ this, SLOT(slotReplace()) );
+ popup->setWhatsThis(id, i18n("<b>Replace Project Wide</b><p>Opens the find in files dialog "
+ "and sets the pattern to the text under the cursor."));
+ popup->insertSeparator();
+ }
+}
+
+#include "replace_part.moc"
diff --git a/parts/replace/replace_part.h b/parts/replace/replace_part.h
new file mode 100644
index 00000000..35a293ab
--- /dev/null
+++ b/parts/replace/replace_part.h
@@ -0,0 +1,46 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __KDEVPART_REPLACE_H__
+#define __KDEVPART_REPLACE_H__
+
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+#include <qpopupmenu.h>
+
+
+class ReplaceWidget;
+class KAction;
+class Context;
+
+class ReplacePart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ ReplacePart(QObject *parent, const char *name, const QStringList &);
+ ~ReplacePart();
+
+public slots:
+ void slotReplace();
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void enableAction();
+ void disableAction();
+private:
+ QGuardedPtr<ReplaceWidget> m_widget;
+ QString m_popupstr;
+ KAction* action;
+
+};
+
+
+#endif
diff --git a/parts/replace/replace_widget.cpp b/parts/replace/replace_widget.cpp
new file mode 100644
index 00000000..24078943
--- /dev/null
+++ b/parts/replace/replace_widget.cpp
@@ -0,0 +1,486 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+//BEGIN Includes
+
+#include <dcopclient.h>
+#include <kapplication.h>
+#include <kparts/part.h>
+#include <kparts/componentfactory.h>
+#include <klibloader.h>
+#include <ktrader.h>
+#include <kurl.h>
+#include <kurlrequester.h>
+#include <klineedit.h>
+#include <kdebug.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/editor.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/selectioninterface.h>
+#include <kdevpartcontroller.h>
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kstdguiitem.h>
+
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qregexp.h>
+#include <qdialog.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qtextstream.h>
+#include <qdatastream.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "replace_part.h"
+#include "replace_widget.h"
+#include "replacedlgimpl.h"
+#include "replaceitem.h"
+#include "replaceview.h"
+
+//END Includes
+
+ReplaceWidget::ReplaceWidget(ReplacePart *part)
+ : QWidget(0, "replace widget"), m_part( part ),
+ m_dialog( new ReplaceDlgImpl( this, "replace widget" ) ),
+ _terminateOperation( false )
+{
+ // setup outputview
+ QVBoxLayout * layout = new QVBoxLayout( this );
+ QHBoxLayout * buttonlayout = new QHBoxLayout( layout );
+
+ _cancel = new KPushButton( KStdGuiItem::cancel(), this );
+ _replace = new KPushButton( KGuiItem(i18n("Replace"),"filefind"), this );
+
+ _cancel->setEnabled( false );
+ _replace->setEnabled( false );
+
+ buttonlayout->addWidget( _replace );
+ buttonlayout->addWidget( _cancel );
+
+ _listview = new ReplaceView( this );
+ layout->addWidget( _listview );
+
+ // setup signals
+ connect( m_dialog->find_button, SIGNAL( clicked() ), SLOT( find() ) );
+
+ connect( _replace, SIGNAL( clicked() ), SLOT( replace() ) );
+ connect( _cancel, SIGNAL( clicked() ), SLOT( clear() ) );
+ connect( _listview, SIGNAL( editDocument( const QString &, int ) ), SLOT( editDocument( const QString &, int ) ) );
+
+ connect( m_part->core(), SIGNAL( stopButtonClicked( KDevPlugin * ) ), SLOT( stopButtonClicked( KDevPlugin * ) ) );
+}
+
+//BEGIN Slots
+
+void ReplaceWidget::showDialog()
+{
+ if ( ! m_part->project() )
+ return; /// @todo feedback?
+
+ QString currentWord;
+ KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*> ( m_part->partController()->activePart() );
+ if ( part )
+ {
+ if ( part->url().isLocalFile() )
+ {
+ calledUrl = part->url().path();
+ cursorPos ( part, &calledCol, &calledLine );
+
+ KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController()->activePart() );
+ QString str = editIface->textLine ( calledCol );
+
+ int i;
+ uint start, end;
+ for (i =calledLine; i< str.length();i++){
+ if ( ! (str[i].isLetter() || str[i].isNumber() || str[i] == '_' ) ){
+ break;
+ }
+ }
+ end=i;
+ for ( i = calledLine; i >= 0; --i ){
+ if ( ! ( str[i].isLetter() ||str[i].isNumber()|| str[i] == '_' ) ){
+ i+=1;
+ break;
+ }
+ }
+ start = i < 0 ? 0 : i;
+ currentWord = str.mid ( start, end-start );
+ }
+ }
+ m_dialog->show ( m_part->project()->projectDirectory() + "/" + m_part->project()->activeDirectory() + "/" );
+
+ KTextEditor::SelectionInterface *sel_iface
+ = dynamic_cast<KTextEditor::SelectionInterface*> ( m_part->partController()->activePart() );
+ if ( sel_iface && sel_iface->hasSelection() )
+ {
+ m_dialog->find_combo->setCurrentText ( sel_iface->selection() );
+ }
+ else
+ {
+ m_dialog->find_combo->setCurrentText ( currentWord );
+ }
+}
+
+
+void ReplaceWidget::find()
+{
+ _listview->clear();
+ m_part->mainWindow()->raiseView( this );
+ m_part->mainWindow()->setViewAvailable( this, true );
+
+ _listview->setReplacementData( m_dialog->expressionPattern(), m_dialog->replacementString() );
+
+ if ( showReplacements() )
+ {
+ _cancel->setEnabled( true );
+ _replace->setEnabled( true );
+ }
+ else
+ {
+ clear();
+ m_part->mainWindow()->setViewAvailable( this, false );
+ }
+}
+
+void ReplaceWidget::replace()
+{
+ makeReplacements();
+ clear();
+ m_part->mainWindow()->setViewAvailable( this, false );
+}
+
+void ReplaceWidget::clear()
+{
+ _listview->clear();
+
+ _cancel->setEnabled( false );
+ _replace->setEnabled( false );
+
+ m_part->mainWindow()->setViewAvailable( this, false );
+}
+
+void ReplaceWidget::editDocument( QString const & file, int line )
+{
+ m_part->partController()->editDocument( KURL( file ), line );
+}
+
+void ReplaceWidget::stopButtonClicked( KDevPlugin * which )
+{
+ if ( which != 0 && which != m_part )
+ return;
+
+ _terminateOperation = true;
+}
+
+//END Slots
+
+bool ReplaceWidget::showReplacements()
+{
+ ReplaceItem::s_listview_done = false;
+
+ m_part->core()->running( m_part, true );
+
+ bool completed = true;
+ _terminateOperation = false;
+
+ QStringList files = workFiles();
+ QStringList openfiles = openProjectFiles();
+
+ QStringList::ConstIterator it = files.begin();
+ while ( it != files.end() )
+ {
+ if ( shouldTerminate() )
+ {
+ completed = false;
+ break;
+ }
+
+ if ( openfiles.contains( *it ) )
+ {
+ if ( KTextEditor::EditInterface * ei = getEditInterfaceForFile( *it ) )
+ {
+ QString buffer = ei->text();
+ QTextIStream stream( &buffer );
+ _listview->showReplacementsForFile( stream, *it );
+ }
+ }
+ else
+ {
+ QFile file( *it );
+ if ( file.open ( IO_ReadOnly ) )
+ {
+ QTextStream stream( &file );
+ _listview->showReplacementsForFile( stream, *it );
+ }
+ }
+ ++it;
+
+ kapp->processEvents( 100 );
+ }
+
+ m_part->core()->running( m_part, false );
+
+ ReplaceItem::s_listview_done = true;
+
+ return completed;
+}
+
+
+void ReplaceWidget::cursorPos( KParts::Part *part, uint * line, uint * col )
+{
+ if (!part || !part->inherits("KTextEditor::Document")) return;
+
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (iface)
+ {
+ iface->cursorPositionReal( line, col );
+ }
+}
+
+void ReplaceWidget::setCursorPos( KParts::Part *part, uint line, uint col )
+{
+ if (!part || !part->inherits("KTextEditor::Document")) return;
+
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget());
+ if (iface)
+ {
+ iface->setCursorPositionReal( line, col );
+ }
+}
+
+
+bool ReplaceWidget::makeReplacements()
+{
+ uint col=0;
+ uint line=0;
+ cursorPos( m_part->partController()->activePart(), &col, &line );
+
+ m_part->core()->running( m_part, true );
+
+ bool completed = true;
+ _terminateOperation = false;
+
+ QStringList openfiles = openProjectFiles();
+ QStringList changedFiles;
+
+ ReplaceItem const * fileitem = _listview->firstChild();
+ while ( fileitem )
+ {
+ if ( fileitem->isOn() )
+ {
+ QString currentfile = fileitem->file();
+
+ if ( openfiles.contains( currentfile ) )
+ {
+ if ( KTextEditor::EditInterface * ei = getEditInterfaceForFile( currentfile ) )
+ {
+ QString ibuffer = ei->text();
+ QString obuffer;
+ QTextStream istream( &ibuffer, IO_ReadOnly );
+ QTextStream ostream( &obuffer, IO_WriteOnly );
+
+ _listview->makeReplacementsForFile( istream, ostream, fileitem );
+
+ ei->setText( obuffer );
+ }
+ }
+ else
+ {
+ QFile file( currentfile );
+ QString buffer;
+
+ if ( file.open( IO_ReadOnly ) )
+ {
+ QTextStream istream( &file );
+ QTextStream buffer_stream( &buffer, IO_WriteOnly );
+
+ _listview->makeReplacementsForFile( istream, buffer_stream, fileitem );
+
+ file.close();
+
+ if ( file.open( IO_WriteOnly ) )
+ {
+ QTextStream ostream( &file );
+ ostream << buffer;
+ file.close();
+ }
+ }
+ }
+ changedFiles << relativeProjectPath( ( currentfile ) );
+ }
+ fileitem = fileitem->nextSibling();
+
+ kapp->processEvents( 100 );
+ }
+
+ // Telling the project about the edited files
+ if ( ! changedFiles.isEmpty() )
+ {
+ m_part->project()->changedFiles( changedFiles );
+ }
+
+ m_part->partController()->saveAllFiles();
+
+ m_part->core()->running( m_part, false );
+
+ if ( calledUrl != QString::null )
+ {
+ m_part->partController()->editDocument( calledUrl, calledLine );
+ setCursorPos( m_part->partController()->activePart(), calledCol, calledLine );
+ }
+ else{
+ setCursorPos( m_part->partController()->activePart(), col, line );
+ }
+
+ return completed;
+}
+
+//BEGIN Helpers
+
+QStringList ReplaceWidget::workFiles()
+{
+ if ( m_dialog->files_all_radio->isChecked() )
+ {
+ return allProjectFiles();
+ }
+ else if ( m_dialog->files_open_radio->isChecked() )
+ {
+ return openProjectFiles();
+ }
+ return subProjectFiles( m_dialog->path_urlreq->lineEdit()->text() );
+}
+
+QString ReplaceWidget::relativeProjectPath( QString path )
+{
+ QString project = m_part->project()->projectDirectory() + "/";
+ if ( path.left( project.length() ) == project )
+ {
+ path = path.mid( project.length() );
+ }
+ return path;
+}
+
+QString ReplaceWidget::fullProjectPath( QString path )
+{
+ QString project = m_part->project()->projectDirectory() + "/";
+ if ( path.left( project.length() ) != project )
+ {
+ path = project + path;
+ }
+ return path;
+}
+
+
+QStringList ReplaceWidget::allProjectFiles()
+{
+ QStringList allfiles = m_part->project()->allFiles();
+
+ QStringList::iterator it = allfiles.begin();
+ while ( it != allfiles.end() )
+ {
+ *it = fullProjectPath( *it );
+ ++it;
+ }
+ return allfiles;
+}
+
+QStringList ReplaceWidget::subProjectFiles( QString const & subpath )
+{
+ QStringList projectfiles = allProjectFiles();
+
+ QStringList::Iterator it = projectfiles.begin();
+ while ( it != projectfiles.end() )
+ {
+ if ( (*it).left( subpath.length() ) != subpath)
+ {
+ it = projectfiles.remove( it );
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ return projectfiles;
+}
+
+QStringList ReplaceWidget::openProjectFiles()
+{
+ QStringList projectfiles = allProjectFiles();
+ QStringList openfiles;
+
+ if( const QPtrList<KParts::Part> * partlist = m_part->
+ partController()->parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part* part = it.current() )
+ {
+ if ( KTextEditor::Editor * ed = dynamic_cast<KTextEditor::Editor *>( part ) )
+ {
+ QString editorpath = ed->url().path();
+ if ( projectfiles.contains( editorpath ) )
+ {
+ openfiles.append( editorpath );
+ }
+ }
+ ++it;
+ }
+ }
+ return openfiles;
+}
+
+KTextEditor::EditInterface * ReplaceWidget::getEditInterfaceForFile( QString const & file )
+{
+ if( const QPtrList<KParts::Part> * partlist = m_part->
+ partController()->parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part* part = it.current() )
+ {
+ if ( KTextEditor::Editor * ed = dynamic_cast<KTextEditor::Editor *>( part ) )
+ {
+ if ( file == ed->url().path() )
+ {
+ return dynamic_cast<KTextEditor::EditInterface *>( part );
+ }
+ }
+ ++it;
+ }
+ }
+ return 0;
+}
+
+bool ReplaceWidget::shouldTerminate()
+{
+ bool b = _terminateOperation;
+ _terminateOperation = false;
+ return b;
+}
+
+void ReplaceWidget::focusInEvent( QFocusEvent * /* e*/ )
+{
+ _listview->setFocus();
+}
+
+//END Helpers
+
+#include "replace_widget.moc"
diff --git a/parts/replace/replace_widget.h b/parts/replace/replace_widget.h
new file mode 100644
index 00000000..fa5809d5
--- /dev/null
+++ b/parts/replace/replace_widget.h
@@ -0,0 +1,81 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __REPLACE_WIDGET_H__
+#define __REPLACE_WIDGET_H__
+
+#include <ktexteditor/editinterface.h>
+
+#include <qwidget.h>
+#include <qstring.h>
+
+class QPushButton;
+class QListViewItem;
+class QDialog;
+
+class ReplacePart;
+class ReplaceDlgImpl;
+class ReplaceItem;
+class ReplaceView;
+
+class ReplaceWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ReplaceWidget(ReplacePart *part);
+
+public slots:
+ void showDialog();
+ void stopButtonClicked( KDevPlugin * );
+
+protected:
+ virtual void focusInEvent(QFocusEvent *e);
+
+private slots:
+ void find();
+ void replace();
+ void clear();
+ void editDocument( const QString & ,int );
+ void setCursorPos( KParts::Part *part, uint line, uint col );
+ void cursorPos( KParts::Part *part, uint * line, uint * col );
+
+private:
+ bool showReplacements();
+ bool makeReplacements();
+ bool shouldTerminate();
+
+ QString relativeProjectPath( QString );
+ QString fullProjectPath( QString );
+
+ QStringList workFiles();
+ QStringList allProjectFiles();
+ QStringList subProjectFiles( QString const & );
+ QStringList openProjectFiles();
+
+ KTextEditor::EditInterface * getEditInterfaceForFile( QString const & file );
+
+ ReplacePart * m_part;
+ ReplaceDlgImpl * m_dialog;
+
+ ReplaceView * _listview;
+ QPushButton * _cancel;
+ QPushButton * _replace;
+
+ uint calledCol;
+ uint calledLine;
+ QString calledUrl;
+
+ bool _terminateOperation;
+};
+
+
+#endif
diff --git a/parts/replace/replacedlg.ui b/parts/replace/replacedlg.ui
new file mode 100644
index 00000000..b1c7db92
--- /dev/null
+++ b/parts/replace/replacedlg.ui
@@ -0,0 +1,385 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ReplaceDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ReplaceDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>428</width>
+ <height>487</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Project Wide String Replacement</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>case_box</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;ase sensitive</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>strings_all_radio</cstring>
+ </property>
+ <property name="text">
+ <string>All s&amp;ubstrings</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>strings_wholewords_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Whole words onl&amp;y</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>strings_regexp_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Regular e&amp;xpression:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use regexp to specify target</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>regexp_button</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>E&amp;dit</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Opens the regexp editor. Only enabled if installed.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="KHistoryCombo">
+ <property name="name">
+ <cstring>regexp_combo</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter the regexp here</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Target Files in Project</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>files_all_radio</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;ll files</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>All files in the project will be considered.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>files_open_radio</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Open files only</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Only open project files will be considered.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>files_path_radio</cstring>
+ </property>
+ <property name="text">
+ <string>Files under &amp;path:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Only project files in this dir and its subdirs will be considered.</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>path_urlreq</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>expression_varning_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Expression is invalid.</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>find_button</cstring>
+ </property>
+ <property name="text">
+ <string>Fi&amp;nd</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start looking for possible replacement targets.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Strings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Text to find:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>find_combo</cstring>
+ </property>
+ </widget>
+ <widget class="KHistoryCombo" row="1" column="0">
+ <property name="name">
+ <cstring>find_combo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Target string</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Replacement text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>replacement_combo</cstring>
+ </property>
+ </widget>
+ <widget class="KHistoryCombo" row="3" column="0">
+ <property name="name">
+ <cstring>replacement_combo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The replacement string</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>find_button</sender>
+ <signal>clicked()</signal>
+ <receiver>ReplaceDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>strings_regexp_radio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>regexp_button</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>files_path_radio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>path_urlreq</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>strings_regexp_radio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>find_combo</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>strings_regexp_radio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>regexp_combo</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>find_combo</tabstop>
+ <tabstop>replacement_combo</tabstop>
+ <tabstop>case_box</tabstop>
+ <tabstop>strings_all_radio</tabstop>
+ <tabstop>strings_regexp_radio</tabstop>
+ <tabstop>regexp_button</tabstop>
+ <tabstop>regexp_combo</tabstop>
+ <tabstop>files_all_radio</tabstop>
+ <tabstop>path_urlreq</tabstop>
+ <tabstop>find_button</tabstop>
+ <tabstop>cancel_button</tabstop>
+ <tabstop>strings_wholewords_radio</tabstop>
+ <tabstop>files_path_radio</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/replace/replacedlgimpl.cpp b/parts/replace/replacedlgimpl.cpp
new file mode 100644
index 00000000..59eee128
--- /dev/null
+++ b/parts/replace/replacedlgimpl.cpp
@@ -0,0 +1,188 @@
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qstring.h>
+#include <qregexp.h>
+#include <qlabel.h>
+
+#include <ktrader.h>
+#include <kparts/componentfactory.h>
+#include <kregexpeditorinterface.h>
+#include <kurlrequester.h>
+#include <kurlcompletion.h>
+#include <klineedit.h>
+#include <kcombobox.h>
+#include <kdebug.h>
+
+#include "replacedlgimpl.h"
+
+namespace
+{
+/// @todo This is the same function as in ../grepview/grepviewwidget.cpp and
+/// should probably be placed in a common place. For now it seemed like too
+/// little code to bother with.
+QString escape(const QString &str)
+{
+ QString escaped("[]{}()\\^$?.+-*");
+ QString res;
+
+ for (uint i=0; i < str.length(); ++i)
+ {
+ if (escaped.find(str[i]) != -1)
+ res += "\\";
+ res += str[i];
+ }
+
+ return res;
+}
+}
+
+
+ReplaceDlgImpl::ReplaceDlgImpl(QWidget* parent, const char* name, bool modal, WFlags fl)
+ : ReplaceDlg(parent,name, modal,fl), _regexp_dialog( 0 )
+
+{
+ connect( find_button, SIGNAL( clicked() ), SLOT( saveComboHistories() ) );
+ connect( regexp_button, SIGNAL( clicked() ), SLOT( showRegExpEditor() ) );
+ connect( find_combo, SIGNAL( textChanged( const QString & ) ),
+ SLOT( validateFind( const QString & ) ) );
+ connect( regexp_combo, SIGNAL( textChanged ( const QString & ) ),
+ SLOT( validateExpression( const QString & ) ) );
+ connect( strings_regexp_radio, SIGNAL( toggled( bool ) ), SLOT( toggleExpression( bool ) ) );
+
+ // disable the editor button if the regexp editor isn't installed
+ if ( KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty() )
+ {
+ strings_regexp_radio->disconnect( regexp_button );
+ }
+
+ path_urlreq->completionObject()->setMode(KURLCompletion::DirCompletion);
+ path_urlreq->setMode( KFile::Directory | KFile::LocalOnly );
+
+ expression_varning_label->hide();
+}
+
+ReplaceDlgImpl::~ReplaceDlgImpl()
+{}
+
+void ReplaceDlgImpl::show( QString const & path )
+{
+ path_urlreq->lineEdit()->setText( path );
+
+ find_combo->setCurrentText( "" );
+ replacement_combo->setCurrentText( "" );
+ regexp_combo->setCurrentText( "" );
+
+ strings_all_radio->setChecked( true );
+ find_combo->setFocus();
+
+ find_button->setEnabled( false );
+
+ QDialog::show();
+}
+
+
+void ReplaceDlgImpl::showRegExpEditor()
+{
+ _regexp_dialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
+
+ if ( _regexp_dialog )
+ {
+ KRegExpEditorInterface *editor =
+ static_cast<KRegExpEditorInterface *>( _regexp_dialog->qt_cast( "KRegExpEditorInterface" ) );
+
+ editor->setRegExp( regexp_combo->currentText() );
+
+ if ( _regexp_dialog->exec() == QDialog::Accepted )
+ {
+ regexp_combo->setCurrentText( editor->regExp() );
+ }
+ }
+}
+
+void ReplaceDlgImpl::validateFind( const QString & )
+{
+ //kdDebug(0) << "ReplaceWidget::validateFind()" << endl;
+
+ bool x = find_combo->currentText().isEmpty() && ! strings_regexp_radio->isOn();
+ find_button->setEnabled( !x );
+}
+
+void ReplaceDlgImpl::validateExpression( const QString & )
+{
+ //kdDebug(0) << "ReplaceWidget::validateExpression()" << endl;
+
+ QString pattern = regexp_combo->currentText();
+ QRegExp re( pattern );
+
+ if ( pattern.isEmpty() || !re.isValid() )
+ {
+ expression_varning_label->show();
+ find_button->setEnabled( false );
+ }
+ else
+ {
+ expression_varning_label->hide();
+ find_button->setEnabled( true );
+ }
+}
+
+void ReplaceDlgImpl::toggleExpression( bool on )
+{
+ if ( on )
+ {
+ validateExpression( QString() );
+ }
+ else
+ {
+ expression_varning_label->hide();
+ find_button->setEnabled( true );
+ }
+}
+
+void ReplaceDlgImpl::saveComboHistories()
+{
+ if ( find_combo->isEnabled() && ! find_combo->currentText().isEmpty() )
+ {
+ find_combo->addToHistory( find_combo->currentText() );
+ }
+
+ if ( ! replacement_combo->currentText().isEmpty() )
+ {
+ replacement_combo->addToHistory( replacement_combo->currentText() );
+ }
+
+ if ( regexp_combo->isEnabled() && ! regexp_combo->currentText().isEmpty() )
+ {
+ regexp_combo->addToHistory( regexp_combo->currentText() );
+ }
+}
+
+QRegExp ReplaceDlgImpl::expressionPattern()
+{
+ QString pattern = escape( find_combo->currentText() );
+
+ QRegExp re;
+ re.setCaseSensitive( case_box->isChecked() );
+ re.setMinimal( true );
+
+ if ( strings_wholewords_radio->isChecked() )
+ {
+ pattern = "\\b" + pattern + "\\b";
+ }
+ else if ( strings_regexp_radio->isChecked() )
+ {
+ pattern = regexp_combo->currentText();
+ }
+
+ re.setPattern( pattern );
+
+ return re;
+}
+
+QString ReplaceDlgImpl::replacementString()
+{
+ return replacement_combo->currentText();
+}
+
+#include "replacedlgimpl.moc"
+
diff --git a/parts/replace/replacedlgimpl.h b/parts/replace/replacedlgimpl.h
new file mode 100644
index 00000000..38938bed
--- /dev/null
+++ b/parts/replace/replacedlgimpl.h
@@ -0,0 +1,38 @@
+
+#ifndef REPLACEDLGIMPL_H
+#define REPLACEDLGIMPL_H
+
+#include "replacedlg.h"
+
+class QDialog;
+
+class ReplaceDlgImpl : public ReplaceDlg
+{
+ Q_OBJECT
+
+public:
+ ReplaceDlgImpl(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ReplaceDlgImpl();
+
+ QRegExp expressionPattern();
+ QString replacementString();
+
+public slots:
+ void show( QString const & path );
+
+protected:
+
+protected slots:
+ void showRegExpEditor();
+ void validateExpression( const QString & );
+ void validateFind( const QString & );
+ void toggleExpression( bool );
+ void saveComboHistories();
+
+private:
+ QDialog * _regexp_dialog;
+
+};
+
+#endif
+
diff --git a/parts/replace/replaceitem.cpp b/parts/replace/replaceitem.cpp
new file mode 100644
index 00000000..bc33211f
--- /dev/null
+++ b/parts/replace/replaceitem.cpp
@@ -0,0 +1,147 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qpainter.h>
+#include <qstyle.h>
+#include <qpalette.h>
+#include <qcheckbox.h>
+
+#include "replaceitem.h"
+
+bool ReplaceItem::s_listview_done = false;
+
+
+bool ReplaceItem::hasCheckedChildren() const
+{
+ ReplaceItem const * item = firstChild();
+ while ( item )
+ {
+ if ( item->isOn() )
+ {
+ return true;
+ }
+ item = item->nextSibling();
+ }
+ return false;
+}
+
+void ReplaceItem::stateChange( bool state )
+{
+ if ( s_listview_done && justClicked() )
+ {
+ setChecked( state );
+ }
+}
+
+void ReplaceItem::setChecked( bool checked )
+{
+ if ( !isFile() ) // this is a child item
+ {
+ if ( checked || !(parent()->hasCheckedChildren()))
+ {
+ if ( parent()->isOn() != checked )
+ {
+ parent()->_clicked = false;
+ parent()->setOn( checked );
+ }
+ }
+ return;
+ }
+
+ // this is a parent item, set self and children
+ ReplaceItem * item = firstChild();
+ while ( item )
+ {
+ if ( item->isOn() != checked )
+ {
+ item->_clicked = false;
+ item->setOn( checked );
+ }
+ item = item->nextSibling();
+ }
+}
+
+// code mostly lifted from QCheckListItem::paintCell()
+void ReplaceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+{
+ if ( !p )
+ return;
+
+ QListView *lvv = listView();
+ if ( !lvv )
+ return;
+
+ ReplaceView * lv = static_cast<ReplaceView*>(lvv);
+
+ const BackgroundMode bgmode = lv->viewport()->backgroundMode();
+ const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode );
+
+ if ( cg.brush( crole ) != lv->colorGroup().brush( crole ) )
+ p->fillRect( 0, 0, width, height(), cg.brush( crole ) );
+ else
+ lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) );
+
+ QFontMetrics fm( lv->fontMetrics() );
+ int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv);
+ int marg = lv->itemMargin();
+ int r = marg;
+
+ // Draw controller / checkbox / radiobutton ---------------------
+ int styleflags = QStyle::Style_Default;
+ if ( isOn() )
+ styleflags |= QStyle::Style_On;
+ else
+ styleflags |= QStyle::Style_Off;
+ if ( isSelected() )
+ styleflags |= QStyle::Style_Selected;
+ if ( isEnabled() && lv->isEnabled() )
+ styleflags |= QStyle::Style_Enabled;
+
+ int x = 0;
+ int y = 0;
+
+ x += 3;
+
+ if ( align & AlignVCenter )
+ y = ( ( height() - boxsize ) / 2 ) + marg;
+
+ else
+ y = (fm.height() + 2 + marg - boxsize) / 2;
+
+ lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p,
+ QRect(x, y, boxsize,
+ fm.height() + 2 + marg),
+ cg, styleflags, QStyleOption(this));
+
+ r += boxsize + 4;
+
+ // Draw text ----------------------------------------------------
+ p->translate( r, 0 );
+ p->setPen( QPen( cg.text() ) );
+
+ QColorGroup mcg = cg;
+ mcg.setColor( QColorGroup::Text, ( isFile() ? Qt::darkGreen : Qt::blue ) );
+ mcg.setColor( QColorGroup::HighlightedText, ( isFile() ? Qt::darkGreen : Qt::blue ) );
+
+ QListViewItem::paintCell( p, mcg, column, width - r, align );
+}
+
+void ReplaceItem::activate( int, QPoint const & localPos )
+{
+ QListView * lv = listView();
+ QCheckBox cb(0);
+ int boxsize = cb.sizeHint().width();
+//that's KDE-3.1 only int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv);
+ int rightside = lv->itemMargin() + boxsize + ( isFile() ? 0 : lv->treeStepSize() );
+
+ // _lineclicked indicates if the click was on the line or in the checkbox
+ _lineclicked = rightside < localPos.x();
+}
diff --git a/parts/replace/replaceitem.h b/parts/replace/replaceitem.h
new file mode 100644
index 00000000..a6bc8ffb
--- /dev/null
+++ b/parts/replace/replaceitem.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __REPLACEITEM_H__
+#define __REPLACEITEM_H__
+
+
+#include <kdeversion.h>
+#include <kdebug.h>
+
+#include "replaceview.h"
+
+class ReplaceItem : public QCheckListItem
+{
+public:
+ // the file item
+ ReplaceItem( ReplaceView * parent, ReplaceItem * after, QString file ) :
+ QCheckListItem( parent,
+ after,
+ file, QCheckListItem::CheckBox ),
+ _file( file ), _string( file ), _line( 0 ), _isfile( true ),
+ _lineclicked( false ), _clicked( true )
+ {
+ setOpen( true );
+ setOn( true );
+ }
+
+ // the line item
+ ReplaceItem( ReplaceItem * parent, ReplaceItem * after, QString file, QString string, int line ) :
+ QCheckListItem( parent,
+ after,
+ QString::number( line + 1 ) + ": " + string, QCheckListItem::CheckBox ),
+ _file( file ), _string( string ), _line( line ), _isfile( false ),
+ _lineclicked( false ), _clicked( true )
+ {
+ setOn( true );
+ }
+
+ QString const & file() const
+ {
+ return _file;
+ }
+
+ int line() const
+ {
+ return _line;
+ }
+
+ QString const & string() const
+ {
+ return _string;
+ }
+
+ bool isFile() const
+ {
+ return _isfile;
+ }
+
+ bool justClicked()
+ {
+ bool t = _clicked;
+ _clicked = true;
+ return t;
+ }
+
+ bool lineClicked()
+ {
+ return _lineclicked;
+ }
+
+ ReplaceItem * parent() const
+ {
+ return static_cast<ReplaceItem*>( QListViewItem::parent() );
+ }
+
+ ReplaceItem * firstChild() const
+ {
+ return static_cast<ReplaceItem*>( QListViewItem::firstChild() );
+ }
+
+ ReplaceItem * nextSibling() const
+ {
+ return static_cast<ReplaceItem*>( QListViewItem::nextSibling() );
+ }
+
+ void activate( int column, QPoint const & localPos );
+ bool hasCheckedChildren() const;
+ virtual void stateChange( bool state );
+
+ static bool s_listview_done;
+
+private:
+ void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align );
+ void setChecked( bool checked );
+
+ QString _file;
+ QString _string;
+ int _line;
+ bool const _isfile;
+ bool _lineclicked;
+ bool _clicked;
+};
+
+#endif
+
diff --git a/parts/replace/replaceview.cpp b/parts/replace/replaceview.cpp
new file mode 100644
index 00000000..7a7505d7
--- /dev/null
+++ b/parts/replace/replaceview.cpp
@@ -0,0 +1,141 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qheader.h>
+#include <qtextstream.h>
+#include <qdir.h>
+#include <qstringlist.h>
+#include <qregexp.h>
+#include <qpalette.h>
+
+#include "replaceitem.h"
+#include "replaceview.h"
+
+
+
+ReplaceItem * ReplaceView::firstChild() const
+{
+ return static_cast<ReplaceItem*>( QListView::firstChild() );
+}
+
+
+ReplaceView::ReplaceView( QWidget * parent ) : KListView( parent ), _latestfile( 0 )
+{
+ setSorting( -1 );
+ addColumn( "" );
+ header()->hide();
+ setFullWidth(true);
+
+ QPalette pal = palette();
+ QColorGroup cg = pal.active();
+ cg.setColor( QColorGroup::Highlight, Qt::lightGray );
+ pal.setActive( cg );
+ setPalette( pal );
+
+ connect( this, SIGNAL( clicked( QListViewItem * ) ), SLOT( slotClicked( QListViewItem * ) ) );
+ connect( this, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint &, int) ),
+ SLOT( slotMousePressed(int, QListViewItem *, const QPoint &, int) ) );
+}
+
+void ReplaceView::makeReplacementsForFile( QTextStream & istream, QTextStream & ostream, ReplaceItem const * fileitem )
+{
+ int line = 0;
+
+ ReplaceItem const * lineitem = fileitem->firstChild();
+ while ( lineitem )
+ {
+ if ( lineitem->isOn() )
+ {
+ while ( line < lineitem->line() )
+ {
+ ostream << istream.readLine() << "\n";
+ line++;
+ }
+ // this is the hit
+ ostream << istream.readLine().replace( _regexp, _replacement ) << "\n";
+ line++;
+ }
+
+ lineitem = lineitem->nextSibling();
+ }
+
+ while ( !istream.atEnd() )
+ {
+ ostream << istream.readLine() << "\n";
+ }
+}
+
+void ReplaceView::showReplacementsForFile( QTextStream & stream, QString const & file )
+{
+ ReplaceItem * latestitem = 0;
+
+ int line = 0;
+ bool firstline = true;
+
+ while ( !stream.atEnd() )
+ {
+ QString s = stream.readLine();
+
+ if ( s.contains( _regexp ) > 0 )
+ {
+ s.replace( _regexp, _replacement );
+
+ if ( firstline )
+ {
+ _latestfile = new ReplaceItem( this, _latestfile, file );
+ firstline = false;
+ }
+ latestitem = new ReplaceItem( _latestfile, latestitem, file, s.stripWhiteSpace(), line );
+ _latestfile->insertItem( latestitem );
+ }
+ line++;
+ }
+}
+
+void ReplaceView::setReplacementData( QRegExp const & re, QString const & replacement )
+{
+ _regexp = re;
+ _replacement = replacement;
+}
+
+void ReplaceView::slotMousePressed(int btn, QListViewItem* i, const QPoint& pos, int col)
+{
+ kdDebug(0) << "ReplaceView::slotMousePressed()" << endl;
+
+ if ( ReplaceItem * item = dynamic_cast<ReplaceItem*>( i ) )
+ {
+ if ( btn == Qt::RightButton )
+ {
+ // popup menu?
+ }
+ else if ( btn == Qt::LeftButton )
+ {
+ // map pos to item/column and call ReplacetItem::activate(pos)
+ item->activate( col, viewport()->mapFromGlobal( pos ) - QPoint( 0, itemRect(item).top() ) );
+ }
+ }
+}
+
+void ReplaceView::slotClicked( QListViewItem * item )
+{
+ kdDebug(0) << "ReplaceView::slotClicked()" << endl;
+
+ if ( ReplaceItem * ri = dynamic_cast<ReplaceItem*>( item ) )
+ {
+ if ( ri->lineClicked() )
+ {
+ kdDebug(0) << "emitting editDocument" << endl;
+ emit editDocument( ri->file(), ri->line() );
+ }
+ }
+}
+
+#include "replaceview.moc"
diff --git a/parts/replace/replaceview.h b/parts/replace/replaceview.h
new file mode 100644
index 00000000..02ba60c9
--- /dev/null
+++ b/parts/replace/replaceview.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 __REPLACEVIEW_H__
+#define __REPLACEVIEW_H__
+
+#include <klistview.h>
+
+#include <qstring.h>
+#include <qregexp.h>
+
+class QTextStream;
+class QWidget;
+class ReplaceItem;
+
+class ReplaceView : public KListView
+{
+ Q_OBJECT
+
+signals:
+ void editDocument( const QString &, int );
+
+public:
+ ReplaceView( QWidget *);
+ ReplaceItem * firstChild() const;
+ void setReplacementData( QRegExp const &, QString const & );
+ void showReplacementsForFile( QTextStream &, QString const & );
+ void makeReplacementsForFile( QTextStream & istream, QTextStream & ostream, ReplaceItem const * fileitem );
+
+private slots:
+ void slotMousePressed(int, QListViewItem *, const QPoint &, int);
+ void slotClicked( QListViewItem * );
+
+private:
+ QRegExp _regexp;
+ QString _replacement;
+ ReplaceItem * _latestfile;
+
+friend class ReplaceItem;
+
+};
+
+
+
+
+#endif
diff --git a/parts/scripting/Makefile.am b/parts/scripting/Makefile.am
new file mode 100644
index 00000000..3613afd2
--- /dev/null
+++ b/parts/scripting/Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevscripting.la
+libkdevscripting_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevscripting_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevscripting_la_SOURCES = scriptingpart.cpp scriptingglobalconfigbase.ui \
+ scriptingglobalconfig.cpp
+
+METASOURCES = AUTO
+
+appsharedir = $(kde_datadir)/kdevscripting
+appshare_DATA =
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevscripting.desktop
+
+rcdir = $(kde_datadir)/kdevscripting
+rc_DATA = kdevscripting.rc
+noinst_HEADERS = scriptingglobalconfig.h scriptingpart.h
diff --git a/parts/scripting/README b/parts/scripting/README
new file mode 100644
index 00000000..566feaa9
--- /dev/null
+++ b/parts/scripting/README
@@ -0,0 +1,18 @@
+KScript In KDevelop
+
+KScriptInterface allows us to have a generic way to add scripting languages to KDE applications. KScriptInterface is not really a scripting language per say, but an interface so that applications can embed scripting languages without explicitly linking to them. This allows all runtime linkage to the different interpreters. Currently the most effective way for scripts to communicate with applications is via DCOP. KScriptInterface script engines provide some convinences methods to access the dcop interfaces of the embedding application.
+
+In KDevelop we have the ability to use scripts written for Kate, since the KateText interface is fully exported to DCOP. By default KDevelop will import Kate scripts. Users can also add other search paths for loading scripts.
+
+To add a new script to KDevelop you need two parts. The first part is a simple desktop file that has the meta-information for the script. The basic format is like this:
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+Name=Import Weather
+Comment=Import current weather icon graphic into an album.
+Type=ShellScript/bash
+X-KDE-ScriptName=importweather.sh
+
+The "Name" is the part that will appear in the KDevelop "Scripts" menu, and the "X-KDE-ScriptName" is the name of the script you wish to attach to that menu action. The last part the "Type" is the type of the script runner you wish to execute the script with.
+
+The second part is the actual script that has a script runner. Currently shell and KJSEmbed are supported, but Kommander support is rumored to be happening. There are also perl and python script runners in kdenonbeta.
diff --git a/parts/scripting/kdevscripting.desktop b/parts/scripting/kdevscripting.desktop
new file mode 100644
index 00000000..f2ba27ed
--- /dev/null
+++ b/parts/scripting/kdevscripting.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Name=KDevscripting
+Name[da]=KDevelop scriptning
+Name[nds]=KDevelop-Skriptschrieven
+Name[sk]=KDev skriptovanie
+Name[sv]=KDevelop-skriptanvändning
+Name[zh_TW]=KDevelop 文稿
+GenericName=Scripting
+GenericName[ca]=Scripts
+GenericName[da]=Scriptning
+GenericName[de]=Skriptunterstützung
+GenericName[el]=Γραφή σεναρίων
+GenericName[es]=Guiones
+GenericName[et]=Skriptikeele plugin
+GenericName[eu]=Script-a
+GenericName[fa]=دست‌نوشته
+GenericName[fr]=Scriptage
+GenericName[ga]=Scriptiú
+GenericName[hu]=Szkriptszerkesztő
+GenericName[it]=Script
+GenericName[nds]=Skriptünnerstütten
+GenericName[ne]=स्क्रिप्टिङ
+GenericName[pl]=Skrypty
+GenericName[pt]='Scripting'
+GenericName[ru]=Сценарии
+GenericName[sk]=Skriptovanie
+GenericName[sl]=Skriptiranje
+GenericName[sr]=Скриптовање
+GenericName[sr@Latn]=Skriptovanje
+GenericName[sv]=Skriptanvändning
+GenericName[tr]=Betik Yazma
+GenericName[zh_CN]=脚本
+GenericName[zh_TW]=文稿
+Comment=The Scripting plugin offers KScript based scripting of the KDevelop application
+Comment[ca]=El connector per als scripts ofereix scripts basats en KScript de l'aplicació KDevelop
+Comment[da]=Scriptning-plugin stiller KScript-baseret scriptning til rådighed for KDevelop
+Comment[de]=Das "Skript"-Modul bietet KScript-basierte Automatisierung für KDevelop
+Comment[el]=Το πρόσθετο γραφής σεναρίων προσφέρει σενάρια της μορφής KScript της εφαρμογής KDevelop
+Comment[es]=El complemento de guiones ofrece guiones basados en KScript de la aplicación KDevelop
+Comment[et]=Skriptikeele plugin võimaldab KDevelopis kasutada skriptikeelt KScripti alusel
+Comment[eu]=Script-a pluginak KScript-en oinarritutako KDevelop aplikazioaren script zerbitzuak eskeintzen ditu
+Comment[fa]=وصلۀ دست‌نوشته، دست‌نوشتۀ کاربرد KDevelop بر مبنای KScript را ارائه می‌دهد.
+Comment[fr]=Le module externe Scriptage fournit le scriptage basé sur KScript de l'application KDevelop
+Comment[gl]=A extensión Scripting ofrece scripting baseado en KScript para a aplicación de KDevelop
+Comment[hu]=A Szkriptszerkesztő KScript-alapú szkriptkészítést tesz lehetővé a KDevelophoz
+Comment[it]=Il plugin di script offre lo script basato su KScript dell'applicazione KDevelop
+Comment[ms]=Plugin Scripting memberikan scripting berasaskan KScript pada aplikasi KDevelop
+Comment[nds]=Dat Skript-Moduul stellt en op KSkript opbuut Skriptbewerken för KDevelop praat.
+Comment[ne]=यो स्क्रिप्टिङ प्लगइनले केडीई विकास अनुप्रयोगको स्क्रिप्टिङमा आधारित केडीई स्क्रिप्टिङ प्रस्ताव गर्दछ
+Comment[nl]=De scripting-plugin maakt KScript gebaseerde scripting van de KDevelop-toepassing mogelijk.
+Comment[pl]=Wtyczka skrypty pozwala ja skrypty oparte o KScript w programie KDevelop
+Comment[pt]=O 'plugin' de 'scripting' oferece funcionalidade de 'scripting' da aplicação KDevelop baseados no KScript
+Comment[pt_BR]=O plug-in de scripting oferece scripts baseados no KScript do aplicativo KDevelop
+Comment[ru]=Модуль сценариев позволяет автоматизировать работу с помощью KScript
+Comment[sk]=Modul poskytuje KScript skriptovanie KDevelop aplikácie
+Comment[sr]=Прикључак за скриптовање нуди скриптовање помоћу KScript-а за KDevelop
+Comment[sr@Latn]=Priključak za skriptovanje nudi skriptovanje pomoću KScript-a za KDevelop
+Comment[sv]=Skriptinsticksprogrammet erbjuder KScript-baserad styrning av programmet KDevelop.
+Comment[tr]=Betik Yazma eklentisi KDevelop uygulamasına KScript tabanlı betik yazmayı sunar.
+Comment[zh_CN]=脚本插件可为 KDevelop 应用程序提供基于 KScript 的脚本。
+Comment[zh_TW]=文稿外掛程式提供 KDevelop 應用程式一個 KScript 基礎的文稿機制。
+Icon=shellscript
+ServiceTypes=KDevelop/Plugin
+
+X-KDevelop-Plugin-Version=1
+X-KDevelop-Plugin-Homepage=http://www.sourcextreme.com/projects/kdevelop
+X-KDevelop-Plugin-BugsEmailAddress=geiseri@sourcextreme.com
+X-KDevelop-Plugin-Copyright=(C) by ian reinhart geiser
+
+X-KDevelop-Args=
+
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevscripting
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeEditing
diff --git a/parts/scripting/kdevscripting.rc b/parts/scripting/kdevscripting.rc
new file mode 100644
index 00000000..217bece1
--- /dev/null
+++ b/parts/scripting/kdevscripting.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartplugin name="scripting" library="libscriptingplugin" version="1.0">
+<MenuBar>
+ <Menu name="scripts"><Text>S&amp;cripts</Text>
+ <ActionList name="script_actions"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/scripting/scriptingglobalconfig.cpp b/parts/scripting/scriptingglobalconfig.cpp
new file mode 100644
index 00000000..80d7a57f
--- /dev/null
+++ b/parts/scripting/scriptingglobalconfig.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2005 by ian reinhart geiser *
+ * ian@geiseri.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "scriptingglobalconfig.h"
+
+#include "scriptingpart.h"
+#include <keditlistbox.h>
+#include <kapplication.h>
+#include <kconfig.h>
+scriptingGlobalConfig::scriptingGlobalConfig(scriptingPart *part, QWidget *parent, const char *name)
+ : scriptingGlobalConfigBase(parent, name), m_part(part)
+{
+ // read kconfig and post list to the m_dirs
+ KConfig *cfg = kapp->config();
+ QStringList searchDirs = cfg->readListEntry("SearchDirs");
+ m_dirs->clear();
+ m_dirs->insertStringList(searchDirs);
+}
+
+void scriptingGlobalConfig::accept()
+{
+ // read mdirs and save to kconfig
+ KConfig *cfg = kapp->config();
+ if( !m_dirs->isEnabled() )
+ cfg->writeEntry("SearchDirs", QStringList() );
+ else
+ cfg->writeEntry("SearchDirs", m_dirs->items() );
+ m_part->setupActions();
+}
+
+#include "scriptingglobalconfig.moc"
diff --git a/parts/scripting/scriptingglobalconfig.h b/parts/scripting/scriptingglobalconfig.h
new file mode 100644
index 00000000..3dd89938
--- /dev/null
+++ b/parts/scripting/scriptingglobalconfig.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2005 by ian reinhart geiser *
+ * ian@geiseri.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef SCRIPTING_GLOBAL_CONFIG_H
+#define SCRIPTING_GLOBAL_CONFIG_H
+
+#include "scriptingglobalconfigbase.h"
+
+class scriptingPart;
+
+class scriptingGlobalConfig: public scriptingGlobalConfigBase
+{
+ Q_OBJECT
+public:
+ scriptingGlobalConfig(scriptingPart *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ scriptingPart *m_part;
+};
+
+#endif
diff --git a/parts/scripting/scriptingglobalconfigbase.ui b/parts/scripting/scriptingglobalconfigbase.ui
new file mode 100644
index 00000000..19647501
--- /dev/null
+++ b/parts/scripting/scriptingglobalconfigbase.ui
@@ -0,0 +1,51 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>scriptingGlobalConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>scriptingGlobalConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Scripting</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KEditListBox">
+ <property name="name">
+ <cstring>m_dirs</cstring>
+ </property>
+ <property name="title">
+ <string>Search Custom Directories for Scripts</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;NOTE&lt;/b&gt; These are directories to search in that are found in your KDE resource directories. So if you add the string "kate/scripts" to the list then KScript will look in "$KDEDIRS/data/kate/scripts" for scripts. This will allow you to get scripts in your home directory as well as system wide ones.</string>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/scripting/scriptingpart.cpp b/parts/scripting/scriptingpart.cpp
new file mode 100644
index 00000000..803f2644
--- /dev/null
+++ b/parts/scripting/scriptingpart.cpp
@@ -0,0 +1,108 @@
+/***************************************************************************
+ * Copyright (C) 2005 by ian reinhart geiser *
+ * ian@geiseri.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "scriptingpart.h"
+
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kdevplugininfo.h>
+#include <kdevgenericfactory.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <configwidgetproxy.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include "scriptingglobalconfig.h"
+#include "kscriptactionmanager.h"
+
+typedef KDevGenericFactory<scriptingPart> scriptingFactory;
+KDevPluginInfo data("kdevscripting");
+K_EXPORT_COMPONENT_FACTORY( libkdevscripting, scriptingFactory( data ) )
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+scriptingPart::scriptingPart(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevPlugin(&data, parent, name ? name : "scriptingPart"), m_scripts(0L)
+{
+ setInstance(scriptingFactory::instance());
+ setXMLFile("kdevscripting.rc");
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createGlobalConfigPage(i18n("Scripting"), GLOBALDOC_OPTIONS, info()->icon());
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+
+
+
+ QTimer::singleShot(0, this, SLOT(init()));
+}
+
+scriptingPart::~scriptingPart()
+{
+ delete m_configProxy;
+ delete m_scripts;
+}
+
+void scriptingPart::init()
+{
+// delayed initialization stuff goes here
+ m_scripts = new KScriptActionManager(this,actionCollection());
+ setupActions();
+}
+
+void scriptingPart::setupActions()
+{
+ kdDebug() << "Load plugins" << endl;
+ // Read KConfig and get the list of custom directories.
+ QStringList searchDirs;
+ searchDirs += "kate/scripts";
+
+ KConfig *cfg = kapp->config();
+ searchDirs += cfg->readListEntry("SearchDirs");
+
+ unplugActionList(QString::fromLatin1( "script_actions" ));
+ plugActionList( QString::fromLatin1( "script_actions" ), m_scripts->scripts(core(),searchDirs));
+}
+
+void scriptingPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+// create configuraton dialogs here
+ switch (pageNo)
+ {
+ case GLOBALDOC_OPTIONS:
+ {
+ scriptingGlobalConfig *w = new scriptingGlobalConfig(this, page, "global config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+
+#include "scriptingpart.moc"
diff --git a/parts/scripting/scriptingpart.h b/parts/scripting/scriptingpart.h
new file mode 100644
index 00000000..7ebd08b7
--- /dev/null
+++ b/parts/scripting/scriptingpart.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * Copyright (C) 2005 by ian reinhart geiser *
+ * ian@geiseri.com *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef KDEVSCRIPTING_H
+#define KDEVSCRIPTING_H
+
+#include <kdevplugin.h>
+
+#include <qguardedptr.h>
+
+class QPopupMenu;
+class KAction;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+class KScriptActionManager;
+/**
+Please read the README.dox file for more info about this part
+*/
+class scriptingPart: public KDevPlugin
+{
+ Q_OBJECT
+public:
+ scriptingPart(QObject *parent, const char *name, const QStringList &args);
+ ~scriptingPart();
+
+ public slots:
+ void setupActions();
+private slots:
+ void init();
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+
+
+
+private:
+ ConfigWidgetProxy *m_configProxy;
+ KScriptActionManager *m_scripts;
+};
+
+#endif
diff --git a/parts/snippet/COPYING b/parts/snippet/COPYING
new file mode 100644
index 00000000..5b6e7c66
--- /dev/null
+++ b/parts/snippet/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/parts/snippet/Makefile.am b/parts/snippet/Makefile.am
new file mode 100644
index 00000000..10ad8b0d
--- /dev/null
+++ b/parts/snippet/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevsnippet.la
+libkdevsnippet_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevsnippet_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevsnippet_la_SOURCES = snippet_part.cpp snippet_widget.cpp snippetdlg.ui snippetitem.cpp snippetsettingsbase.ui snippetsettings.cpp snippetconfig.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevsnippet.desktop
+
+rc_DATA = kdevpart_snippet.rc
+rcdir = $(kde_datadir)/kdevsnippet
+
+noinst_HEADERS = snippetdlg.h snippetitem.h snippetsettingsbase.h snippetsettings.h snippetconfig.h
diff --git a/parts/snippet/README b/parts/snippet/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/parts/snippet/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/parts/snippet/README.dox b/parts/snippet/README.dox
new file mode 100644
index 00000000..4d5d80de
--- /dev/null
+++ b/parts/snippet/README.dox
@@ -0,0 +1,16 @@
+/** \class SnippetPart
+This plugin provides a tool view for CodeSnippets which can be easily inserted into any KDevelop sourcecode file.
+
+\authors <a href="mailto:rgruber@users.sourceforge.net">Robert Gruber</a>
+
+\maintainer <a href="mailto:rgruber@users.sourceforge.net">Robert Gruber</a>
+
+\feature Provides a tooltree view for easy access to your CodeSnippets
+\feature You can use variables in Snippets
+\feature Tooltips show the content of the snippets
+\feature Snippets are saved based on the user who created them
+
+\requirement KDE >= 3.1.3
+
+\todo Add features
+*/
diff --git a/parts/snippet/kdevpart_snippet.rc b/parts/snippet/kdevpart_snippet.rc
new file mode 100644
index 00000000..4f34ec50
--- /dev/null
+++ b/parts/snippet/kdevpart_snippet.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="snippet" library="libkdevsnippet" version="3">
+ <MenuBar>
+ </MenuBar>
+ <Menu name="hidden">
+ <Action name="snippet_showview"/>
+ </Menu>
+</kpartplugin>
diff --git a/parts/snippet/kdevsnippet.desktop b/parts/snippet/kdevsnippet.desktop
new file mode 100644
index 00000000..481f4559
--- /dev/null
+++ b/parts/snippet/kdevsnippet.desktop
@@ -0,0 +1,102 @@
+[Desktop Entry]
+Type=Service
+Exec=
+Comment=This plugin allows you to store code snippets and add them to your code
+Comment[ca]=Aquest connector permet guardar trossos de codi i afegir-los més tard al vostre codi
+Comment[da]=Dette plugin tillader dig at opbevare kodestumper og tilføje dem til din kode
+Comment[de]=Dieses Modul erlaubt das Abspeichern und Wiederverwenden von Quelltext-Schnipseln
+Comment[el]=Αυτό το πρόσθετο σας επιτρέπει να αποθηκεύσετε δείγματα κώδικα και να τα προσθέσετε στον κώδικά σας
+Comment[es]=Este complemento permite almacenar trozos de código y añadirlos a su código fuente
+Comment[et]=See plugin võimaldab salvestada koodijuppe ja neid koodi lisada
+Comment[eu]=Plugin honek kode zatiak gordetzeo eta zure kodeari gehitzeko aukera eskeintzen dizu
+Comment[fa]=این وصله، اجازۀ ذخیرۀ تکه‌های کد و افزودن آنها را به کدتان می‌دهد
+Comment[fr]=Ce module externe permet de stocker des fragments de code et de les ajouter à votre code
+Comment[gl]=Esta extensión permite almacenar fragmentos de código e engadilos ao seu código
+Comment[hu]=Ez a modul kódrészletek eltárolását és programkódba való beillesztését teszi lehetővé
+Comment[it]=Questo plugin consente di memorizzare frammenti di codice e di aggiungerli al tuo codice
+Comment[ja]=このプラグインはコード断片を格納し、あなたのコードにそれらを加えることを可能にします。
+Comment[ms]=Plugin ini membenarkan anda untuk menyimpan petikan kod dan menambahkannya ke dalam kod anda
+Comment[nds]=Dit Moduul stellt dat Sekern un Tofögen vun Kode-Snippels praat.
+Comment[ne]=यो प्लगइनले तपाईँलाई सङ्केत स्निपेट्स भण्डारण गर्न र तपाईँको सङ्केतमा तिनीहरूलाई थप्न अनुमति दिन्छ
+Comment[nl]=Deze plugin staat u toe om tekstblokken op te slaan en deze toe te voegen aan uw code
+Comment[pl]=Wtyczka umożliwiająca zapisanie fragmentów kodu i wstawianie ich później do kodu
+Comment[pt]=Este 'plugin' permite-lhe guardar pedaços de códigos e adicioná-los ao seu código
+Comment[pt_BR]=Este plug-in permite a você armazenar os pedaços de código e adicioná-los em seu código
+Comment[ru]=Модуль сохранения часто используемых частей кода в одно место для быстрого доступа к ним
+Comment[sk]=Modul umožní uložiť si výňatky kódu a ich vkladať
+Comment[sr]=Овај прикључак вам омогућава да чувате исечке кôда и додајете их у сопствени кôд
+Comment[sr@Latn]=Ovaj priključak vam omogućava da čuvate isečke kôda i dodajete ih u sopstveni kôd
+Comment[sv]=Det här insticksprogrammet gör det möjligt att lagra kodsnuttar och lägga till dem i din kod
+Comment[ta]=இந்த உள்ளீடுகள் ஸ்னிப்பட் குறியீடுகளை சேமிக்கவும் மற்றும் அக்குறியீட்டை சேர்க்கவும் வழிவகுக்கிறது
+Comment[tg]=Нигоҳ дории модул баъзан истифодашавии як қисми код дар як ҷой барои зуд роҳ гирифтан ба он ҷо
+Comment[tr]=Bu eklenti kod parçalarını saklamanızı ve onları kodunuza eklemenizi sağlar
+Comment[zh_CN]=这个插件允许您保存代码片段并将这些片段插入到您的代码中
+Comment[zh_TW]=此外掛程式讓您儲存程式碼片段,並可以加入您的程式碼中
+Name=Code Snippets
+Name[ca]=Trossos de codi
+Name[da]=Kodestumper
+Name[de]=Quelltext-Schnipsel
+Name[el]=Δείγματα κώδικα
+Name[es]=Trozos de código
+Name[et]=Koodijupid
+Name[eu]=Kode zatiak
+Name[fa]=تکه‌های کد
+Name[fr]=Fragments de code
+Name[ga]=Blúirí Cóid
+Name[hu]=Kódrészletek
+Name[it]=Frammenti di codice
+Name[ja]=コード Snippet
+Name[ms]=Petikan Kod
+Name[nds]=Kode-Snippels
+Name[ne]=सङ्केत स्निपेट्स
+Name[pl]=Fragmenty kodu
+Name[pt]=Pedaços de Código
+Name[pt_BR]=Pedaços de Código
+Name[ru]=Заготовки кода
+Name[sk]=Výňatky kódu
+Name[sl]=Odseki kode
+Name[sv]=Kodsnuttar
+Name[ta]=ஸ்னிப்பட் குறியீடுகள்
+Name[tg]=Тайёр намудани код
+Name[tr]=Kod Parçacıkları
+Name[zh_CN]=代码片段
+Name[zh_TW]=程式碼片段
+GenericName=Code Snippets
+GenericName[ca]=Trossos de codi
+GenericName[da]=Kodestumper
+GenericName[de]=Quelltext-Schnipsel
+GenericName[el]=Δείγματα κώδικα
+GenericName[es]=Trozos de código
+GenericName[et]=Koodijupid
+GenericName[eu]=Kode zatiak
+GenericName[fa]=تکه‌های کد
+GenericName[fr]=Fragments de code
+GenericName[ga]=Blúirí Cóid
+GenericName[gl]=Fragmentos de código
+GenericName[hu]=Kódrészletek
+GenericName[it]=Frammenti di codice
+GenericName[ja]=コード Snippet
+GenericName[ms]=Petikan Kod
+GenericName[nds]=Kode-Snippels
+GenericName[ne]=सङ्केत स्निपेट्स
+GenericName[nl]=Tekstblokken
+GenericName[pl]=Fragmenty kodu
+GenericName[pt]=Pedaços de Código
+GenericName[pt_BR]=Pedaços de código
+GenericName[ru]=Заготовки кода
+GenericName[sk]=Výňatky kódu
+GenericName[sl]=Odseki kode
+GenericName[sr]=Исечци кôда
+GenericName[sr@Latn]=Isečci kôda
+GenericName[sv]=Kodsnuttar
+GenericName[ta]=ஸ்ப்பட் குறியீடு
+GenericName[tg]=Тайёр намудани кодҳо
+GenericName[tr]=Kod Parçacıkları
+GenericName[zh_CN]=代码片段
+GenericName[zh_TW]=程式碼片段
+Icon=editcut
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevsnippet
+X-KDevelop-Version=5
+X-KDevelop-Properties=CodeEditing
diff --git a/parts/snippet/snippet_part.cpp b/parts/snippet/snippet_part.cpp
new file mode 100644
index 00000000..f7564109
--- /dev/null
+++ b/parts/snippet/snippet_part.cpp
@@ -0,0 +1,155 @@
+/*
+ * File : snippet_part.cpp
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+#include "snippet_part.h"
+
+#include <qwhatsthis.h>
+
+#include <kaction.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kaboutdata.h>
+#include <qvbox.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <ktrader.h>
+
+#include "kdevcore.h"
+#include <kdevproject.h>
+#include "kdevmainwindow.h"
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include <kdebug.h>
+
+#include "snippet_widget.h"
+#include "snippetitem.h"
+#include "snippetsettings.h"
+#include "snippetconfig.h"
+
+static const KDevPluginInfo data("kdevsnippet");
+typedef KDevGenericFactory<SnippetPart> snippetFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevsnippet, snippetFactory( data ) )
+
+SnippetPart::SnippetPart(QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin(&data, parent, name ? name : "SnippetPart" )
+{
+ setInstance(snippetFactory::instance());
+ setXMLFile("kdevpart_snippet.rc");
+
+ m_widget = new SnippetWidget(this);
+ m_widget->setCaption(i18n("Code Snippets"));
+ m_widget->setIcon(SmallIcon( info()->icon() ));
+
+ QWhatsThis::add(m_widget, i18n("<b>Code Snippet</b><p>This is a list of available snippets."));
+
+ mainWindow()->embedSelectViewRight( m_widget, i18n("Code Snippets"), i18n("Insert a code snippet") );
+
+ connect( core(), SIGNAL( configWidget( KDialogBase * ) ), this, SLOT( slotConfigWidget( KDialogBase * ) ) );
+
+ /*The next two connects are used to check if certain SnippetGroups need to be opened
+ according to the languages supported by this project*/
+ connect( core(), SIGNAL( projectOpened() ), m_widget, SLOT( languageChanged() ) );
+ connect( core(), SIGNAL( languageChanged() ), m_widget, SLOT( languageChanged() ) );
+
+ setupActions();
+}
+
+SnippetPart::~SnippetPart()
+{
+ if ( m_widget )
+ {
+ mainWindow()->removeView( m_widget );
+ }
+
+ delete m_widget;
+}
+
+void SnippetPart::setupActions()
+{
+ new KAction( i18n("Show Snippet Tree"), CTRL+ALT+SHIFT+Key_S, this, SLOT(slotShowView()), actionCollection(), "snippet_showview");
+}
+
+/*!
+ \fn SnippetPart::aboutData()
+ */
+KAboutData* SnippetPart::aboutData()
+{
+ KAboutData *data = new KAboutData ("snippetpart", I18N_NOOP("SnippetPart"), "1.1",
+ I18N_NOOP( "SnippetPart for KDevelop" ),
+ KAboutData::License_LGPL_V2,
+ I18N_NOOP( "(c) 2003" ), 0, "http://www.kdevelop.org");
+ data->addAuthor ("Robert Gruber", I18N_NOOP("Author"), "rgruber@users.sourceforge.net", "http://kmp3indexer.sf.net");
+
+
+ return data;
+}
+
+
+/*!
+ \fn SnippetPart::slotConfigWidget( KDialogBase *dlg )
+ */
+void SnippetPart::slotConfigWidget( KDialogBase *dlg )
+{
+ QVBox *vbox = dlg->addVBoxPage( i18n("Code Snippets"), i18n("Code Snippets"), BarIcon( info()->icon(), KIcon::SizeMedium ) );
+
+ SnippetSettings * w = new SnippetSettings( m_widget, vbox );
+
+ w->btnGroup->setButton(m_widget->getSnippetConfig()->getInputMethod());
+ w->leDelimiter->setText(m_widget->getSnippetConfig()->getDelimiter());
+ w->cbToolTip->setChecked(m_widget->getSnippetConfig()->useToolTips());
+ w->btnGroupAutoOpen->setButton(m_widget->getSnippetConfig()->getAutoOpenGroups());
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(slotOKClicked()) );
+}
+
+
+QStringList SnippetPart::getAllLanguages()
+{
+ KTrader::OfferList languageSupportOffers =
+ KTrader::self()->query(QString::fromLatin1("KDevelop/LanguageSupport"),
+ QString::fromLatin1("[X-KDevelop-Version] == %1"
+ ).arg( KDEVELOP_PLUGIN_VERSION ));
+
+ QStringList languages;
+
+ for (KTrader::OfferList::ConstIterator it = languageSupportOffers.begin(); it != languageSupportOffers.end(); ++it)
+ {
+ QString language = (*it)->property("X-KDevelop-Language").toString();
+ languages.append(language);
+
+ kdDebug(9035) << "Found language: " << (*it)->property("X-KDevelop-Language").toString() << endl <<
+ "genericName(): " <<(*it)->genericName() << endl <<
+ "comment(): " <<(*it)->comment() << endl << endl;
+ }
+
+ return languages;
+}
+
+
+QStringList SnippetPart::getProjectLanguages()
+{
+ QStringList languages;
+ if (!projectDom())
+ return languages;
+
+ QDomDocument m_projectDom = *projectDom();
+
+ if (m_widget->getSnippetConfig()->getAutoOpenGroups() == 1)
+ languages = DomUtil::readListEntry(m_projectDom, "/general/secondaryLanguages", "language");
+ languages.prepend( DomUtil::readEntry(m_projectDom, "/general/primarylanguage") );
+ return languages;
+}
+
+void SnippetPart::slotShowView()
+{
+ mainWindow()->raiseView( m_widget );
+}
+
+
+#include "snippet_part.moc"
diff --git a/parts/snippet/snippet_part.h b/parts/snippet/snippet_part.h
new file mode 100644
index 00000000..98c3b252
--- /dev/null
+++ b/parts/snippet/snippet_part.h
@@ -0,0 +1,50 @@
+/*
+ * File : snippet_part.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+
+#ifndef __KDEVPART_SNIPPET_H__
+#define __KDEVPART_SNIPPET_H__
+
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+
+
+class SnippetWidget;
+class KAboutData;
+class KDialogBase;
+
+/*
+This is the KDevPlugin for the CodeSnippet feature
+For more info read the README.dox file
+@author Robert Gruber
+*/
+class SnippetPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ SnippetPart(QObject *parent, const char *name, const QStringList &);
+ ~SnippetPart();
+ KAboutData * aboutData();
+ QStringList getAllLanguages();
+ QStringList getProjectLanguages();
+
+private:
+ void setupActions();
+
+ QGuardedPtr<SnippetWidget> m_widget;
+
+public slots:
+ void slotConfigWidget( KDialogBase *dlg );
+ void slotShowView();
+};
+
+
+#endif
diff --git a/parts/snippet/snippet_widget.cpp b/parts/snippet/snippet_widget.cpp
new file mode 100644
index 00000000..98d61505
--- /dev/null
+++ b/parts/snippet/snippet_widget.cpp
@@ -0,0 +1,970 @@
+/*
+ * File : snippet_widget.cpp
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <qlayout.h>
+#include <kpushbutton.h>
+#include <klistview.h>
+#include <qheader.h>
+#include <klineedit.h>
+#include <ktextedit.h>
+#include <kmessagebox.h>
+#include <qsplitter.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/editor.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/document.h>
+#include <kconfig.h>
+#include <qtooltip.h>
+#include <kpopupmenu.h>
+#include <qregexp.h>
+#include <qinputdialog.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qwhatsthis.h>
+#include <qdragobject.h>
+#include <qtimer.h>
+#include <kcombobox.h>
+#include <kdeversion.h>
+
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include <kdevpartcontroller.h>
+
+#include "snippetdlg.h"
+#include "snippetitem.h"
+
+#include "snippet_part.h"
+#include "snippet_widget.h"
+
+SnippetWidget::SnippetWidget(SnippetPart *part)
+ : KListView(0, "snippet widget"), QToolTip( viewport() ),
+ m_part( part )
+{
+ // init the QPtrList
+ _list.setAutoDelete(TRUE);
+
+ // init the KListView
+ setSorting( -1 );
+ addColumn( "" );
+ setFullWidth(true);
+ header()->hide();
+ setAcceptDrops(true);
+ setDragEnabled(false);
+ setDropVisualizer(false);
+ setRootIsDecorated(true);
+
+ //connect the signals
+ connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ),
+ this, SLOT( showPopupMenu(QListViewItem *, const QPoint & , int ) ) );
+
+ connect( this, SIGNAL( executed (QListViewItem *) ),
+ this, SLOT( slotExecuted( QListViewItem *) ) );
+ connect( this, SIGNAL( returnPressed (QListViewItem *) ),
+ this, SLOT( slotExecuted( QListViewItem *) ) );
+
+ connect( this, SIGNAL( dropped(QDropEvent *, QListViewItem *) ),
+ this, SLOT( slotDropped(QDropEvent *, QListViewItem *) ) );
+
+ _cfg = 0;
+
+ QTimer::singleShot(0, this, SLOT(initConfig()));
+}
+
+SnippetWidget::~SnippetWidget()
+{
+ writeConfig();
+ delete _cfg;
+
+ /* We need to delete the child items before the parent items
+ otherwise KDevelop would crash on exiting */
+ SnippetItem * item;
+ while (_list.count() > 0) {
+ for (item=_list.first(); item; item=_list.next()) {
+ if (item->childCount() == 0)
+ _list.remove(item);
+ }
+ }
+}
+
+
+/*!
+ \fn SnippetWidget::slotAdd()
+ Opens the didalog to add a snippet
+ */
+void SnippetWidget::slotAdd()
+{
+ kdDebug(9035) << "Ender slotAdd()" << endl;
+ SnippetDlg dlg(this, "SnippetDlg", true);
+
+ /*check if the user clicked a SnippetGroup
+ If not, we set the group variable to the SnippetGroup
+ which the selected item is a child of*/
+ SnippetGroup * group = dynamic_cast<SnippetGroup*>(selectedItem());
+ if (!group)
+ group = dynamic_cast<SnippetGroup*>(selectedItem()->parent());
+
+ /*fill the combobox with the names of all SnippetGroup entries*/
+ for (SnippetItem *it=_list.first(); it; it=_list.next()) {
+ if (dynamic_cast<SnippetGroup*>(it)) {
+ dlg.cbGroup->insertItem(it->getName());
+ }
+ }
+ dlg.cbGroup->setCurrentText(group->getName());
+
+ if (dlg.exec() == QDialog::Accepted) {
+ group = dynamic_cast<SnippetGroup*>(SnippetItem::findItemByName(dlg.cbGroup->currentText(), _list));
+ _list.append( new SnippetItem(group, dlg.snippetName->text(), dlg.snippetText->text()) );
+ }
+}
+
+
+/*!
+ \fn SnippetWidget::slotAddGroup()
+ Opens the didalog to add a snippet
+ */
+void SnippetWidget::slotAddGroup()
+{
+ kdDebug(9035) << "Ender slotAddGroup()" << endl;
+ SnippetDlg dlg(this, "SnippetDlg", true);
+ dlg.snippetText->setEnabled(false);
+ dlg.snippetText->setText("GROUP");
+ dlg.setCaption(i18n("Add Group"));
+ dlg.cbGroup->insertItem(i18n("All"));
+ dlg.cbGroup->insertStringList(m_part->getAllLanguages());
+ dlg.cbGroup->setCurrentText(i18n("All"));
+ dlg.textLabelGroup->setText(i18n("Language:"));
+
+ if (dlg.exec() == QDialog::Accepted) {
+ _list.append( new SnippetGroup(this, dlg.snippetName->text(), SnippetGroup::getMaxId(), dlg.cbGroup->currentText()) );
+ }
+}
+
+
+/*!
+ \fn SnippetWidget::slotRemove()
+ Removes the selected snippet
+ */
+void SnippetWidget::slotRemove()
+{
+ //get current data
+ QListViewItem * item = currentItem();
+ SnippetItem *snip = dynamic_cast<SnippetItem*>( item );
+ SnippetGroup *group = dynamic_cast<SnippetGroup*>( item );
+ if (!snip)
+ return;
+
+ if (group) {
+ if (group->childCount() > 0 &&
+ KMessageBox::warningContinueCancel(this, i18n("Do you really want to remove this group and all its snippets?"),QString::null,KStdGuiItem::del())
+ == KMessageBox::Cancel)
+ return;
+
+ for (SnippetItem *it=_list.first(); it; it=_list.next()) {
+ if (it->getParent() == group->getId()) {
+ kdDebug(9035) << "remove " << it->getName() << endl;
+ _list.remove(it);
+ }
+ }
+ }
+
+ kdDebug(9035) << "remove " << snip->getName() << endl;
+ _list.remove(snip);
+}
+
+
+
+/*!
+ \fn SnippetWidget::slotEdit()
+ Opens the dialog of editing the selected snippet
+ */
+void SnippetWidget::slotEdit()
+{
+ //get current data
+ QListViewItem * item = currentItem();
+
+ SnippetGroup *pGroup = dynamic_cast<SnippetGroup*>(item);
+ SnippetItem *pSnippet = dynamic_cast<SnippetItem*>( item );
+ if (!pSnippet || pGroup) /*selected item must be a SnippetItem but MUST not be a SnippetGroup*/
+ return;
+
+ //init the dialog
+ SnippetDlg dlg(this, "SnippetDlg", true);
+ dlg.snippetName->setText(pSnippet->getName());
+ dlg.snippetText->setText(pSnippet->getText());
+ dlg.btnAdd->setText(i18n("&Apply"));
+
+ dlg.setCaption(i18n("Edit Snippet"));
+ /*fill the combobox with the names of all SnippetGroup entries*/
+ for (SnippetItem *it=_list.first(); it; it=_list.next()) {
+ if (dynamic_cast<SnippetGroup*>(it)) {
+ dlg.cbGroup->insertItem(it->getName());
+ }
+ }
+ dlg.cbGroup->setCurrentText(SnippetItem::findGroupById(pSnippet->getParent(), _list)->getName());
+
+ if (dlg.exec() == QDialog::Accepted) {
+ //update the KListView and the SnippetItem
+ item->setText( 0, dlg.snippetName->text() );
+ pSnippet->setName( dlg.snippetName->text() );
+ pSnippet->setText( dlg.snippetText->text() );
+
+ /* if the user changed the parent we need to move the snippet */
+ if ( SnippetItem::findGroupById(pSnippet->getParent(), _list)->getName() != dlg.cbGroup->currentText() ) {
+ SnippetGroup * newGroup = dynamic_cast<SnippetGroup*>(SnippetItem::findItemByName(dlg.cbGroup->currentText(), _list));
+ pSnippet->parent()->takeItem(pSnippet);
+ newGroup->insertItem(pSnippet);
+ pSnippet->resetParent();
+ }
+
+ setSelected(item, TRUE);
+ }
+}
+
+/*!
+ \fn SnippetWidget::slotEditGroup()
+ Opens the dialog of editing the selected snippet-group
+ */
+void SnippetWidget::slotEditGroup()
+{
+ //get current data
+ QListViewItem * item = currentItem();
+
+ SnippetGroup *pGroup = dynamic_cast<SnippetGroup*>( item );
+ if (!pGroup) /*selected item MUST be a SnippetGroup*/
+ return;
+
+ //init the dialog
+ SnippetDlg dlg(this, "SnippetDlg", true);
+ dlg.snippetName->setText(pGroup->getName());
+ dlg.snippetText->setText(pGroup->getText());
+ dlg.btnAdd->setText(i18n("&Apply"));
+ dlg.snippetText->setEnabled(FALSE);
+ dlg.setCaption(i18n("Edit Group"));
+ dlg.cbGroup->insertItem(i18n("All"));
+ dlg.cbGroup->insertStringList(m_part->getAllLanguages());
+ dlg.cbGroup->setCurrentText(pGroup->getLanguage());
+ dlg.textLabelGroup->setText(i18n("Language:"));
+
+ if (dlg.exec() == QDialog::Accepted) {
+ //update the KListView and the SnippetGroup
+ item->setText( 0, dlg.snippetName->text() );
+ pGroup->setName( dlg.snippetName->text() );
+ pGroup->setLanguage(dlg.cbGroup->currentText());
+
+ setSelected(item, TRUE);
+ }
+}
+
+void SnippetWidget::slotExecuted(QListViewItem * item)
+{
+ SnippetItem *pSnippet = dynamic_cast<SnippetItem*>( item );
+ if (!pSnippet || dynamic_cast<SnippetGroup*>(item))
+ return;
+
+ //process variables if any, then insert into the active view
+ insertIntoActiveView( parseText(pSnippet->getText(), _SnippetConfig.getDelimiter()) );
+}
+
+
+/*!
+ \fn SnippetWidget::insertIntoActiveView(QString text)
+ Inserts the parameter text into the activ view
+ */
+void SnippetWidget::insertIntoActiveView(QString text)
+{
+ //get the interfaces for the KTexteditor parts
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(m_part->partController()->activeWidget());
+
+ if (!cursorIface)
+ return;
+
+ KTextEditor::EditInterface* editIface
+ = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController()->activePart() );
+
+ if (!editIface)
+ return;
+
+ uint line, col;
+ cursorIface->cursorPositionReal(&line, &col);
+
+ editIface->insertText( line, col , text );
+}
+
+
+/*!
+ \fn SnippetWidget::writeConfig()
+ Write the cofig file
+ */
+void SnippetWidget::writeConfig()
+{
+ if( !_cfg )
+ return;
+ _cfg->deleteGroup("SnippetPart"); //this is neccessary otherwise delete entries will stay in list until
+ //they get overwritten by a more recent entry
+ _cfg->setGroup("SnippetPart");
+
+ SnippetItem *item;
+ QString strKeyName="";
+ QString strKeyText="";
+ QString strKeyId="";
+
+ int iSnipCount = 0;
+ int iGroupCount = 0;
+
+ for ( item = _list.first(); item; item = _list.next() ) { //write the snippet-list
+ kdDebug(9035) << "SnippetWidget::writeConfig() " << item->getName() << endl;
+ SnippetGroup * group = dynamic_cast<SnippetGroup*>(item);
+ if (group) {
+ kdDebug(9035) << "-->GROUP " << item->getName() << group->getId() << " " << iGroupCount<< endl;
+ strKeyName=QString("snippetGroupName_%1").arg(iGroupCount);
+ strKeyId=QString("snippetGroupId_%1").arg(iGroupCount);
+ strKeyText=QString("snippetGroupLang_%1").arg(iGroupCount);
+
+ _cfg->writeEntry(strKeyName, group->getName());
+ _cfg->writeEntry(strKeyId, group->getId());
+ _cfg->writeEntry(strKeyText, group->getLanguage());
+ iGroupCount++;
+ } else if (dynamic_cast<SnippetItem*>(item)) {
+ kdDebug(9035) << "-->ITEM " << item->getName() << item->getParent() << " " << iSnipCount << endl;
+ strKeyName=QString("snippetName_%1").arg(iSnipCount);
+ strKeyText=QString("snippetText_%1").arg(iSnipCount);
+ strKeyId=QString("snippetParent_%1").arg(iSnipCount);
+
+ _cfg->writeEntry(strKeyName, item->getName());
+ _cfg->writeEntry(strKeyText, item->getText());
+ _cfg->writeEntry(strKeyId, item->getParent());
+ iSnipCount++;
+ } else {
+ kdDebug(9035) << "-->ERROR " << item->getName() << endl;
+ }
+ }
+ _cfg->writeEntry("snippetCount", iSnipCount);
+ _cfg->writeEntry("snippetGroupCount", iGroupCount);
+
+ int iCount = 1;
+ QMap<QString, QString>::Iterator it;
+ for ( it = _mapSaved.begin(); it != _mapSaved.end(); ++it ) { //write the saved variable values
+ if (it.data().length()<=0) continue; //is the saved value has no length -> no need to save it
+
+ strKeyName=QString("snippetSavedName_%1").arg(iCount);
+ strKeyText=QString("snippetSavedVal_%1").arg(iCount);
+
+ _cfg->writeEntry(strKeyName, it.key());
+ _cfg->writeEntry(strKeyText, it.data());
+
+ iCount++;
+ }
+ _cfg->writeEntry("snippetSavedCount", iCount-1);
+
+
+ _cfg->writeEntry( "snippetDelimiter", _SnippetConfig.getDelimiter() );
+ _cfg->writeEntry( "snippetVarInput", _SnippetConfig.getInputMethod() );
+ _cfg->writeEntry( "snippetToolTips", _SnippetConfig.useToolTips() );
+ _cfg->writeEntry( "snippetGroupAutoOpen", _SnippetConfig.getAutoOpenGroups() );
+
+ _cfg->writeEntry("snippetSingleRect", _SnippetConfig.getSingleRect() );
+ _cfg->writeEntry("snippetMultiRect", _SnippetConfig.getMultiRect() );
+
+ _cfg->sync();
+}
+
+
+/*!
+ This function was introduced together with the grouping-feature.
+ As far as some guys might have some snippets stored in the "old" way
+ we need to create a "DEFAULT" group into which we can import all snippets
+ */
+void SnippetWidget::initConfigOldVersion(KConfig *cfg)
+{
+ SnippetGroup * group = new SnippetGroup(this, "DEFAULT", 1);
+ _list.append(group);
+
+ int iCount = cfg->readNumEntry("snippetCount", 0);
+ QString strKeyName="";
+ QString strKeyText="";
+ for ( int i=0; i<iCount; i++) { //read the snippet-list
+ strKeyName=QString("snippetName_%1").arg(i);
+ strKeyText=QString("snippetText_%1").arg(i);
+
+ QString strNameVal="";
+ QString strTextVal="";
+
+ strNameVal = cfg->readEntry(strKeyName, "");
+ strTextVal = cfg->readEntry(strKeyText, "");
+
+ if (strNameVal != "" && strTextVal != "") {
+ SnippetItem * item = new SnippetItem(group, strNameVal, strTextVal);
+ _list.append(item);
+ }
+ }
+}
+
+
+/*!
+ \fn SnippetWidget::initConfig()
+ Initial read the cofig file
+ */
+void SnippetWidget::initConfig()
+{
+ if (_cfg == NULL)
+ _cfg = new KConfig("kdevsnippetrc", false, false);
+
+ _cfg->setGroup("SnippetPart");
+
+ QString strKeyName="";
+ QString strKeyText="";
+ QString strKeyId="";
+ SnippetItem *item;
+ SnippetGroup *group;
+
+ kdDebug(9035) << "SnippetWidget::initConfig() " << endl;
+
+ //if entry doesn't get found, this will return -1 which we will need a bit later
+ int iCount = _cfg->readNumEntry("snippetGroupCount", -1);
+
+ for ( int i=0; i<iCount; i++) { //read the group-list
+ strKeyName=QString("snippetGroupName_%1").arg(i);
+ strKeyId=QString("snippetGroupId_%1").arg(i);
+ strKeyText=QString("snippetGroupLang_%1").arg(i);
+
+ QString strNameVal="";
+ int iIdVal=-1;
+ QString strLangVal="";
+
+ strNameVal = _cfg->readEntry(strKeyName, "");
+ iIdVal = _cfg->readNumEntry(strKeyId, -1);
+ strLangVal = _cfg->readEntry(strKeyText, i18n("All"));
+ kdDebug(9035) << "Read group " << strNameVal << " " << iIdVal << endl;
+
+ if (strNameVal != "" && iIdVal != -1 && strLangVal != "") {
+ group = new SnippetGroup(this, strNameVal, iIdVal, strLangVal);
+ kdDebug(9035) << "Created group " << group->getName() << " " << group->getId() << endl;
+ _list.append(group);
+ if (group->getLanguage() == i18n("All"))
+ group->setOpen(TRUE);
+ else
+ group->setOpen(FALSE); //groups assigned to certain languages get handled later
+ }
+ }
+
+ /* Check if the snippetGroupCount property has been found
+ if iCount is -1 this means, that the user has his snippets
+ stored without groups. Therefore we will call the
+ initConfigOldVersion() function below */
+ if (iCount != -1) {
+ iCount = _cfg->readNumEntry("snippetCount", 0);
+ for ( int i=0; i<iCount; i++) { //read the snippet-list
+ strKeyName=QString("snippetName_%1").arg(i);
+ strKeyText=QString("snippetText_%1").arg(i);
+ strKeyId=QString("snippetParent_%1").arg(i);
+
+ QString strNameVal="";
+ QString strTextVal="";
+ int iParentVal = -1;
+
+ strNameVal = _cfg->readEntry(strKeyName, "");
+ strTextVal = _cfg->readEntry(strKeyText, "");
+ iParentVal = _cfg->readNumEntry(strKeyId, -1);
+ kdDebug(9035) << "Read item " << strNameVal << " " << iParentVal << endl;
+
+ if (strNameVal != "" && strTextVal != "" && iParentVal != -1) {
+ item = new SnippetItem(SnippetItem::findGroupById(iParentVal, _list), strNameVal, strTextVal);
+ kdDebug(9035) << "Created item " << item->getName() << " " << item->getParent() << endl;
+ _list.append(item);
+ }
+ }
+ } else {
+ kdDebug(9035) << "found old version of snippet-configfile" << endl;
+ initConfigOldVersion(_cfg);
+ }
+
+ iCount = _cfg->readNumEntry("snippetSavedCount", 0);
+
+ for ( int i=1; i<=iCount; i++) { //read the saved-values and store in QMap
+ strKeyName=QString("snippetSavedName_%1").arg(i);
+ strKeyText=QString("snippetSavedVal_%1").arg(i);
+
+ QString strNameVal="";
+ QString strTextVal="";
+
+ strNameVal = _cfg->readEntry(strKeyName, "");
+ strTextVal = _cfg->readEntry(strKeyText, "");
+
+ if (strNameVal != "" && strTextVal != "") {
+ _mapSaved[strNameVal] = strTextVal;
+ }
+ }
+
+
+ _SnippetConfig.setDelimiter( _cfg->readEntry("snippetDelimiter", "$") );
+ _SnippetConfig.setInputMethod( _cfg->readNumEntry("snippetVarInput", 0) );
+ _SnippetConfig.setToolTips( _cfg->readBoolEntry("snippetToolTips", true) );
+ _SnippetConfig.setAutoOpenGroups( _cfg->readNumEntry("snippetGroupAutoOpen", 1) );
+
+ _SnippetConfig.setSingleRect( _cfg->readRectEntry("snippetSingleRect", 0L) );
+ _SnippetConfig.setMultiRect( _cfg->readRectEntry("snippetMultiRect", 0L) );
+}
+
+/*!
+ \fn SnippetWidget::maybeTip( const QPoint & p )
+ Shows the Snippet-Text as ToolTip
+ */
+void SnippetWidget::maybeTip( const QPoint & p )
+{
+ SnippetItem * item = dynamic_cast<SnippetItem*>( itemAt( p ) );
+ if (!item)
+ return;
+
+ QRect r = itemRect( item );
+
+ if (r.isValid() &&
+ _SnippetConfig.useToolTips() )
+ {
+ if (dynamic_cast<SnippetGroup*>(item)) {
+ tip( r, i18n("Language:")+((SnippetGroup*)item)->getLanguage() ); //show the group's language
+ } else {
+ tip( r, item->getText() ); //show the snippet's text
+ }
+ }
+}
+
+/*!
+ \fn SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
+ Shows the Popup-Menu depending item is a valid pointer
+*/
+void SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
+{
+ KPopupMenu popup;
+
+ SnippetItem * selectedItem = static_cast<SnippetItem *>(item);
+ if ( item ) {
+ popup.insertTitle( selectedItem->getName() );
+
+ popup.insertItem( i18n("Add Item..."), this, SLOT( slotAdd() ) );
+ popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
+ if (dynamic_cast<SnippetGroup*>(item)) {
+ popup.insertItem( i18n("Edit..."), this, SLOT( slotEditGroup() ) );
+ } else {
+ popup.insertItem( i18n("Edit..."), this, SLOT( slotEdit() ) );
+ }
+ popup.insertItem( i18n("Remove"), this, SLOT( slotRemove() ) );
+
+ } else {
+ popup.insertTitle(i18n("Code Snippets"));
+
+ popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
+ }
+
+ popup.exec(p);
+}
+
+
+// fn SnippetWidget::parseText(QString text, QString del)
+/*!
+ This function is used to parse the given QString for variables. If found the user will be prompted
+ for a replacement value. It returns the string text with all replacements made
+ */
+QString SnippetWidget::parseText(QString text, QString del)
+{
+ QString str = text;
+ QString strName = "";
+ QString strNew = "";
+ QString strMsg="";
+ int iFound = -1;
+ int iEnd = -1;
+ QMap<QString, QString> mapVar;
+ int iInMeth = _SnippetConfig.getInputMethod();
+ QRect rSingle = _SnippetConfig.getSingleRect();
+ QRect rMulti = _SnippetConfig.getMultiRect();
+
+ do {
+ iFound = text.find(QRegExp("\\"+del+"[A-Za-z-_0-9\\s]*\\"+del), iEnd+1); //find the next variable by this QRegExp
+ if (iFound >= 0) {
+ iEnd = text.find(del, iFound+1)+1;
+ strName = text.mid(iFound, iEnd-iFound);
+
+ if ( strName != del+del ) { //if not doubel-delimiter
+ if (iInMeth == 0) { //if input-method "single" is selected
+ if ( mapVar[strName].length() <= 0 ) { // and not already in map
+ strMsg=i18n("Please enter the value for <b>%1</b>:").arg(strName);
+ strNew = showSingleVarDialog( strName, &_mapSaved, rSingle );
+ if (strNew=="")
+ return ""; //user clicked Cancle
+ } else {
+ continue; //we have already handled this variable
+ }
+ } else {
+ strNew = ""; //for inputmode "multi" just reset new valaue
+ }
+ } else {
+ strNew = del; //if double-delimiter -> replace by single character
+ }
+
+ if (iInMeth == 0) { //if input-method "single" is selected
+ str.replace(strName, strNew);
+ }
+
+ mapVar[strName] = strNew;
+ }
+ } while (iFound != -1);
+
+ if (iInMeth == 1) { //check config, if input-method "multi" is selected
+ int w, bh, oh;
+ w = rMulti.width();
+ bh = rMulti.height();
+ oh = rMulti.top();
+ if (showMultiVarDialog( &mapVar, &_mapSaved, w, bh, oh )) { //generate and show the dialog
+ QMap<QString, QString>::Iterator it;
+ for ( it = mapVar.begin(); it != mapVar.end(); ++it ) { //walk through the map and do the replacement
+ str.replace(it.key(), it.data());
+ }
+ } else {
+ return "";
+ }
+
+ rMulti.setWidth(w); //this is a hack to save the dialog's dimensions in only one QRect
+ rMulti.setHeight(bh);
+ rMulti.setTop(oh);
+ rMulti.setLeft(0);
+ _SnippetConfig.setMultiRect(rMulti);
+ }
+
+ _SnippetConfig.setSingleRect(rSingle);
+
+ return str;
+}
+
+
+// fn SnippetWidget::showMultiVarDialog()
+/*!
+ This function constructs a dialog which contains a label and a linedit for every
+ variable that is stored in the given map except the double-delimiter entry
+ It return true if everything was ok and false if the user hit cancel
+ */
+bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QString, QString> * mapSave,
+ int & iWidth, int & iBasicHeight, int & iOneHeight)
+{
+ //if no var -> no need to show
+ if (map->count() == 0)
+ return true;
+
+ //if only var is the double-delimiter -> no need to show
+ QMap<QString, QString>::Iterator it = map->begin();
+ if ( map->count() == 1 && it.data()==_SnippetConfig.getDelimiter()+_SnippetConfig.getDelimiter() )
+ return true;
+
+ QMap<QString, KTextEdit *> mapVar2Te; //this map will help keeping track which TEXTEDIT goes with which variable
+ QMap<QString, QCheckBox *> mapVar2Cb; //this map will help keeping track which CHECKBOX goes with which variable
+
+ // --BEGIN-- building a dynamic dialog
+ QDialog dlg(this);
+ dlg.setCaption(i18n("Enter Values for Variables"));
+
+ QGridLayout * layout = new QGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ QGridLayout * layoutTop = new QGridLayout( 0, 1, 1, 0, 6, "layoutTop");
+ QGridLayout * layoutVar = new QGridLayout( 0, 1, 1, 0, 6, "layoutVar");
+ QGridLayout * layoutBtn = new QGridLayout( 0, 1, 1, 0, 6, "layoutBtn");
+
+ KTextEdit *te = NULL;
+ QLabel * labTop = NULL;
+ QCheckBox * cb = NULL;
+
+ labTop = new QLabel( &dlg, "label" );
+ labTop->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ labTop->sizePolicy().hasHeightForWidth() ) );
+ labTop->setText(i18n("Enter the replacement values for these variables:"));
+ layoutTop->addWidget(labTop, 0, 0);
+ layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
+
+
+ int i = 0; //walk through the variable map and add
+ for ( it = map->begin(); it != map->end(); ++it ) { //a checkbox, a lable and a lineedit to the main layout
+ if (it.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter())
+ continue;
+
+ cb = new QCheckBox( &dlg, "cbVar" );
+ cb->setChecked( FALSE );
+ cb->setText(it.key());
+ layoutVar->addWidget( cb, i ,0, Qt::AlignTop );
+
+ te = new KTextEdit( &dlg, "teVar" );
+ layoutVar->addWidget( te, i, 1, Qt::AlignTop );
+
+ if ((*mapSave)[it.key()].length() > 0) {
+ cb->setChecked( TRUE );
+ te->setText((*mapSave)[it.key()]);
+ }
+
+ mapVar2Te[it.key()] = te;
+ mapVar2Cb[it.key()] = cb;
+
+ QToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
+ QWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
+ "If you use the same variable later, even in another snippet, the value entered to the right "
+ "will be the default value for that variable.") );
+
+ i++;
+ }
+ layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
+
+ KPushButton * btn1 = new KPushButton( &dlg, "pushButton1" );
+ btn1->setText(i18n("&Cancel"));
+ btn1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ btn1->sizePolicy().hasHeightForWidth() ) );
+ layoutBtn->addWidget( btn1, 0, 0 );
+
+ KPushButton * btn2 = new KPushButton( &dlg, "pushButton2" );
+ btn2->setText(i18n("&Apply"));
+ btn2->setDefault( TRUE );
+ btn2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ btn2->sizePolicy().hasHeightForWidth() ) );
+ layoutBtn->addWidget( btn2, 0, 1 );
+
+ layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ // --END-- building a dynamic dialog
+
+ //connect the buttons to the QDialog default slots
+ connect(btn1, SIGNAL(clicked()), &dlg, SLOT(reject()) );
+ connect(btn2, SIGNAL(clicked()), &dlg, SLOT(accept()) );
+
+ //prepare to execute the dialog
+ bool bReturn = false;
+ //resize the textedits
+ if (iWidth > 1) {
+ QRect r = dlg.geometry();
+ r.setHeight(iBasicHeight + iOneHeight*mapVar2Te.count());
+ r.setWidth(iWidth);
+ dlg.setGeometry(r);
+ }
+ if ( i > 0 && // only if there are any variables
+ dlg.exec() == QDialog::Accepted ) {
+
+ QMap<QString, KTextEdit *>::Iterator it2;
+ for ( it2 = mapVar2Te.begin(); it2 != mapVar2Te.end(); ++it2 ) {
+ if (it2.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter())
+ continue;
+ (*map)[it2.key()] = it2.data()->text(); //copy the entered values back to the given map
+
+ if (mapVar2Cb[it2.key()]->isChecked()) //if the checkbox is on; save the values for later
+ (*mapSave)[it2.key()] = it2.data()->text();
+ else
+ (*mapSave).erase(it2.key());
+ }
+ bReturn = true;
+
+ iBasicHeight = dlg.geometry().height() - layoutVar->geometry().height();
+ iOneHeight = layoutVar->geometry().height() / mapVar2Te.count();
+ iWidth = dlg.geometry().width();
+ }
+
+ //do some cleanup
+ QMap<QString, KTextEdit *>::Iterator it1;
+ for (it1 = mapVar2Te.begin(); it1 != mapVar2Te.end(); ++it1)
+ delete it1.data();
+ mapVar2Te.clear();
+ QMap<QString, QCheckBox *>::Iterator it2;
+ for (it2 = mapVar2Cb.begin(); it2 != mapVar2Cb.end(); ++it2)
+ delete it2.data();
+ mapVar2Cb.clear();
+ delete layoutTop;
+ delete layoutVar;
+ delete layoutBtn;
+ delete layout;
+
+ if (i==0) //if nothing happened this means, that there are no variables to translate
+ return true; //.. so just return OK
+
+ return bReturn;
+}
+
+
+// fn SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> * mapSave)
+/*!
+ This function constructs a dialog which contains a label and a linedit for the given variable
+ It return either the entered value or an empty string if the user hit cancel
+ */
+QString SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> * mapSave, QRect & dlgSize)
+{
+ // --BEGIN-- building a dynamic dialog
+ QDialog dlg(this);
+ dlg.setCaption(i18n("Enter Values for Variables"));
+
+ QGridLayout * layout = new QGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ QGridLayout * layoutTop = new QGridLayout( 0, 1, 1, 0, 6, "layoutTop");
+ QGridLayout * layoutVar = new QGridLayout( 0, 1, 1, 0, 6, "layoutVar");
+ QGridLayout * layoutBtn = new QGridLayout( 0, 2, 1, 0, 6, "layoutBtn");
+
+ KTextEdit *te = NULL;
+ QLabel * labTop = NULL;
+ QCheckBox * cb = NULL;
+
+ labTop = new QLabel( &dlg, "label" );
+ layoutTop->addWidget(labTop, 0, 0);
+ labTop->setText(i18n("Enter the replacement values for %1:").arg( var ));
+ layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
+
+
+ cb = new QCheckBox( &dlg, "cbVar" );
+ cb->setChecked( FALSE );
+ cb->setText(i18n( "Make value &default" ));
+
+ te = new KTextEdit( &dlg, "teVar" );
+ layoutVar->addWidget( te, 0, 1, Qt::AlignTop);
+ layoutVar->addWidget( cb, 1, 1, Qt::AlignTop);
+ if ((*mapSave)[var].length() > 0) {
+ cb->setChecked( TRUE );
+ te->setText((*mapSave)[var]);
+ }
+
+ QToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
+ QWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
+ "If you use the same variable later, even in another snippet, the value entered to the right "
+ "will be the default value for that variable.") );
+
+ layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 );
+
+ KPushButton * btn1 = new KPushButton( &dlg, "pushButton1" );
+ btn1->setText(i18n("&Cancel"));
+ layoutBtn->addWidget( btn1, 0, 0 );
+
+ KPushButton * btn2 = new KPushButton( &dlg, "pushButton2" );
+ btn2->setText(i18n("&Apply"));
+ btn2->setDefault( TRUE );
+ layoutBtn->addWidget( btn2, 0, 1 );
+
+ layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
+ te->setFocus();
+ // --END-- building a dynamic dialog
+
+ //connect the buttons to the QDialog default slots
+ connect(btn1, SIGNAL(clicked()), &dlg, SLOT(reject()) );
+ connect(btn2, SIGNAL(clicked()), &dlg, SLOT(accept()) );
+
+ //execute the dialog
+ QString strReturn = "";
+ if (dlgSize.isValid())
+ dlg.setGeometry(dlgSize);
+ if ( dlg.exec() == QDialog::Accepted ) {
+ if (cb->isChecked()) //if the checkbox is on; save the values for later
+ (*mapSave)[var] = te->text();
+ else
+ (*mapSave).erase(var);
+
+ strReturn = te->text(); //copy the entered values back the the given map
+
+ dlgSize = dlg.geometry();
+ }
+
+ //do some cleanup
+ delete cb;
+ delete te;
+ delete labTop;
+ delete btn1;
+ delete btn2;
+ delete layoutTop;
+ delete layoutVar;
+ delete layoutBtn;
+ delete layout;
+
+ return strReturn;
+}
+
+// fn SnippetWidget::acceptDrag (QDropEvent *event) const
+/*!
+ Reimplementation from KListView.
+ Check here if the data the user is about to drop fits our restrictions.
+ We only accept dropps of plaintext, because from the dropped text
+ we will create a snippet.
+ */
+bool SnippetWidget::acceptDrag (QDropEvent *event) const
+{
+ kdDebug(9035) << "Format: " << event->format() << "" << event->pos() << endl;
+
+ QListViewItem * item = itemAt(event->pos());
+
+ if (item &&
+ QString(event->format()).startsWith("text/plain") &&
+ static_cast<SnippetWidget *>(event->source()) != this) {
+ kdDebug(9035) << "returning TRUE " << endl;
+ return TRUE;
+ } else {
+ kdDebug(9035) << "returning FALSE" << endl;
+ event->acceptAction(FALSE);
+ return FALSE;
+ }
+}
+
+// fn SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *after)
+/*!
+ This slot is connected to the dropped signal.
+ If it is emitted, we need to construct a new snippet entry with
+ the data given
+ */
+void SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *)
+{
+ QListViewItem * item2 = itemAt(e->pos());
+
+ SnippetGroup *group = dynamic_cast<SnippetGroup *>(item2);
+ if (!group)
+ group = dynamic_cast<SnippetGroup *>(item2->parent());
+
+ QCString dropped;
+ QByteArray data = e->encodedData("text/plain");
+ if ( e->provides("text/plain") && data.size()>0 ) {
+ //get the data from the event...
+ QString encData(data.data());
+ kdDebug(9035) << "encData: " << encData << endl;
+
+ //... then fill the dialog with the given data
+ SnippetDlg dlg(this, "SnippetDlg", true);
+ dlg.snippetName->clear();
+ dlg.snippetText->setText(encData);
+
+ /*fill the combobox with the names of all SnippetGroup entries*/
+ for (SnippetItem *it=_list.first(); it; it=_list.next()) {
+ if (dynamic_cast<SnippetGroup*>(it)) {
+ dlg.cbGroup->insertItem(it->getName());
+ }
+ }
+ dlg.cbGroup->setCurrentText(group->getName());
+
+ if (dlg.exec() == QDialog::Accepted) {
+ /* get the group that the user selected with the combobox */
+ group = dynamic_cast<SnippetGroup*>(SnippetItem::findItemByName(dlg.cbGroup->currentText(), _list));
+ _list.append( new SnippetItem(group, dlg.snippetName->text(), dlg.snippetText->text()) );
+ }
+ }
+}
+
+
+/*!
+ \fn SnippetWidget::languageChanged()
+ */
+void SnippetWidget::languageChanged()
+{
+ QStringList langs = m_part->getProjectLanguages();
+
+ for (SnippetItem *it=_list.first(); it; it=_list.next()) {
+ SnippetGroup * group = dynamic_cast<SnippetGroup*>(it);
+ if (group) {
+ if (group->getLanguage() == i18n("All") || langs.contains(group->getLanguage())) {
+ group->setOpen(TRUE);
+ } else {
+ group->setOpen(FALSE);
+ }
+ }
+ }
+}
+
+#include "snippet_widget.moc"
diff --git a/parts/snippet/snippet_widget.h b/parts/snippet/snippet_widget.h
new file mode 100644
index 00000000..84df7a6f
--- /dev/null
+++ b/parts/snippet/snippet_widget.h
@@ -0,0 +1,90 @@
+/*
+ * File : snippet_widget.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#ifndef __SNIPPET_WIDGET_H__
+#define __SNIPPET_WIDGET_H__
+
+#include <qwidget.h>
+#include <qstring.h>
+#include <klistview.h>
+#include <qtooltip.h>
+#include <qrect.h>
+
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/view.h>
+#include "snippetconfig.h"
+
+class KDevProject;
+class SnippetPart;
+class QPushButton;
+class KListView;
+class QListViewItem;
+class QPoint;
+class SnippetDlg;
+class SnippetItem;
+class KTextEdit;
+class KConfig;
+
+
+/**
+This is the widget which gets added to the right TreeToolView.
+It inherits KListView and QToolTip which is needed for showing the
+tooltips which contains the text of the snippet
+@author Robert Gruber
+*/
+class SnippetWidget : public KListView, public QToolTip
+{
+ Q_OBJECT
+
+ friend class SnippetSettings; //to allow SnippetSettings to call languageChanged()
+
+public:
+ SnippetWidget(SnippetPart *part);
+ ~SnippetWidget();
+ QPtrList<SnippetItem> * getList() { return (&_list); }
+ void writeConfig();
+ void initConfigOldVersion(KConfig *cfg);
+ SnippetConfig * getSnippetConfig() { return (&_SnippetConfig); }
+
+
+private slots:
+ void initConfig();
+ void languageChanged();
+
+protected:
+ SnippetPart * m_part;
+ void maybeTip( const QPoint & );
+ bool acceptDrag (QDropEvent *event) const;
+
+private:
+ void insertIntoActiveView(QString text);
+ QString parseText(QString text, QString del="$");
+ bool showMultiVarDialog(QMap<QString, QString> * map, QMap<QString, QString> * mapSave,
+ int & iWidth, int & iBasicHeight, int & iOneHeight);
+ QString showSingleVarDialog(QString var, QMap<QString, QString> * mapSave, QRect & dlgSize);
+
+ QPtrList<SnippetItem> _list;
+ QMap<QString, QString> _mapSaved;
+ KConfig * _cfg;
+ SnippetConfig _SnippetConfig;
+
+public slots:
+ void slotRemove();
+ void slotEdit();
+ void slotEditGroup();
+ void slotAdd();
+ void slotAddGroup();
+
+protected slots:
+ void showPopupMenu( QListViewItem * item, const QPoint & p, int );
+ void slotExecuted(QListViewItem * item);
+ void slotDropped(QDropEvent *e, QListViewItem *after);
+};
+
+
+#endif
diff --git a/parts/snippet/snippetconfig.cpp b/parts/snippet/snippetconfig.cpp
new file mode 100644
index 00000000..23186d05
--- /dev/null
+++ b/parts/snippet/snippetconfig.cpp
@@ -0,0 +1,20 @@
+/*
+ * File : snippetconfig.cpp
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#include "snippetconfig.h"
+
+SnippetConfig::SnippetConfig()
+{
+}
+
+
+SnippetConfig::~SnippetConfig()
+{
+}
+
+
diff --git a/parts/snippet/snippetconfig.h b/parts/snippet/snippetconfig.h
new file mode 100644
index 00000000..89fe00e0
--- /dev/null
+++ b/parts/snippet/snippetconfig.h
@@ -0,0 +1,56 @@
+/*
+ * File : snippetconfig.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#ifndef SNIPPETCONFIG_H
+#define SNIPPETCONFIG_H
+
+#include <qstring.h>
+#include <qrect.h>
+
+
+/**
+This class stores the values that can be configured via the
+KDevelop settings dialog
+@author Robert Gruber
+*/
+class SnippetConfig{
+public:
+ SnippetConfig();
+
+ ~SnippetConfig();
+
+ bool useToolTips() { return (bToolTip); };
+ int getInputMethod() { return (iInputMethod); };
+ QString getDelimiter() { return (strDelimiter); };
+ QRect getSingleRect() { return (rSingle); };
+ QRect getMultiRect() { return (rMulti); };
+ int getAutoOpenGroups() { return iAutoOpenGroups; }
+
+ void setToolTips(bool b) { bToolTip=b; };
+ void setInputMethod(int i) { iInputMethod=i; };
+ void setDelimiter(QString s) { strDelimiter=s; };
+ void setSingleRect(QRect r) {
+ rSingle = (r.isValid())?r:QRect();
+ }
+ void setMultiRect(QRect r) {
+ rMulti = (r.isValid())?r:QRect();
+ }
+ void setAutoOpenGroups(int autoopen) { iAutoOpenGroups = autoopen; }
+
+protected:
+ bool bToolTip;
+ int iInputMethod;
+ QString strDelimiter;
+ QRect rSingle;
+ QRect rMulti;
+ int iMultiBasicHeight;
+ int iMultiCount;
+ int iAutoOpenGroups;
+};
+
+#endif
diff --git a/parts/snippet/snippetdlg.ui b/parts/snippet/snippetdlg.ui
new file mode 100644
index 00000000..a7d4530b
--- /dev/null
+++ b/parts/snippet/snippetdlg.ui
@@ -0,0 +1,214 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SnippetDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SnippetDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>344</width>
+ <height>289</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Snippet</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>btnAdd</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>btnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>snippetName</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <family>Courier</family>
+ <pointsize>11</pointsize>
+ </font>
+ </property>
+ </widget>
+ <spacer row="4" column="0">
+ <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>80</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>snippetName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Snippet:</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>snippetText</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabelGroup</cstring>
+ </property>
+ <property name="text">
+ <string>Group:</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="3" column="0">
+ <property name="name">
+ <cstring>toolBtnHelp</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="iconSet">
+ <iconset>image0</iconset>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Click here to get to know how to use variables in a snippet</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>cbGroup</cstring>
+ </property>
+ </widget>
+ <widget class="KTextEdit" row="2" column="1" rowspan="3" colspan="1">
+ <property name="name">
+ <cstring>snippetText</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <family>Courier</family>
+ <pointsize>11</pointsize>
+ </font>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="720">789c85d0c94ec3301006e07b9ec24a6e15729bb5b12a1e01c4110971182f6dbaa43b07847877f27bec1424a43a87f8fb331edb994ec4ebcb93984c93cb95ae6b234c476731b11f7dfff9f6fef895a47923f25614b9c8d3872495c288e7c3de61ae877936f3032466d9d60466918de79e59cd98cbc879096e022ba663d6b35683a7c05a55a01d69c02e50310d58a8363735781969c15d60cd5c83a56a15b307ab5c85e243a4f5adb6605d28c55c810d1159ff378ee0bc24e71af00cb6da14ce7f95c3c8088fd67a98878c8c1d6c9d46cad972d541b4767873b6d96a3f68e7c62c33f82ef5b2bfd56972e827f7875b9d0e4b8f273d661cd2d9ef1433e9ab388ae7c311fd9e38f42dcb2e9dfe738fd812d19d4c1271f4bb9fbff3fdb5fff68b914cbf17c90f9b96abef</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>btnAdd</sender>
+ <signal>clicked()</signal>
+ <receiver>SnippetDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>btnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>SnippetDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>toolBtnHelp</sender>
+ <signal>clicked()</signal>
+ <receiver>SnippetDlg</receiver>
+ <slot>slotHelp()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>snippetName</tabstop>
+ <tabstop>cbGroup</tabstop>
+ <tabstop>snippetText</tabstop>
+ <tabstop>btnAdd</tabstop>
+ <tabstop>btnCancel</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">snippetdlg.ui.h</include>
+</includes>
+<slots>
+ <slot>slotHelp()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>ktextedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/snippet/snippetdlg.ui.h b/parts/snippet/snippetdlg.ui.h
new file mode 100644
index 00000000..41ad9d8c
--- /dev/null
+++ b/parts/snippet/snippetdlg.ui.h
@@ -0,0 +1,21 @@
+/*
+ * File : snippetdlg.ui.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+/****************************************************************************
+** 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.
+*****************************************************************************/
+#include <kmessagebox.h>
+
+void SnippetDlg::slotHelp()
+{
+ KMessageBox::information(this, i18n("To use variables in a snippet, you just have to enclose the variablename with $-characters. When you use the snippet, you will then be asked for a value for this variable. \nExample snippet: This is a $VAR$\nWhen you use this snippet you will be prompted for a value for the variable $VAR$. Any occurrences of $VAR$ will then be replaced with whatever you have entered.\nIf you need a single $-character in a snippet, which is not used to enclose a variable, type $$ (two dollar characters) instead. They will automatically be replaced with a single $-character when you use the snippet.\nIf you want to change the default delimiter to anything different, please use the settings dialog to do so."), i18n("Snippet help"));
+}
diff --git a/parts/snippet/snippetitem.cpp b/parts/snippet/snippetitem.cpp
new file mode 100644
index 00000000..7548ad16
--- /dev/null
+++ b/parts/snippet/snippetitem.cpp
@@ -0,0 +1,127 @@
+/*
+ * File : snippetitem.cpp
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#include <qstring.h>
+
+
+#include "snippetitem.h"
+
+SnippetItem::SnippetItem(QListView * parent, QString name, QString text )
+ : QListViewItem( parent, name )
+{
+ strName = name;
+ strText = text;
+ iParent = -1;
+}
+
+SnippetItem::SnippetItem(QListViewItem * parent, QString name, QString text)
+ : QListViewItem( parent, name )
+{
+ strName = name;
+ strText = text;
+ iParent = ((SnippetGroup *)parent)->getId();
+}
+
+SnippetItem::~SnippetItem()
+{
+}
+
+
+/*!
+ \fn SnippetItem::getName()
+ */
+QString SnippetItem::getName()
+{
+ return strName;
+}
+
+
+/*!
+ \fn SnippetItem::getText
+ */
+QString SnippetItem::getText()
+{
+ return strText;
+}
+
+
+/*!
+ \fn SnippetItem::setText(QString text)
+ */
+void SnippetItem::setText(QString text)
+{
+ strText = text;
+}
+
+
+/*!
+ \fn SnippetItem::setName(QString name)
+ */
+void SnippetItem::setName(QString name)
+{
+ strName = name;
+}
+
+void SnippetItem::resetParent()
+{
+ SnippetGroup * group = dynamic_cast<SnippetGroup*>(parent());
+ if (group)
+ iParent = group->getId();
+}
+
+SnippetItem * SnippetItem::findItemByName(QString name, QPtrList<SnippetItem> &list)
+{
+ for ( SnippetItem * item = list.first(); item; item = list.next() ) { //write the snippet-list
+ if (item->getName() == name)
+ return item;
+ }
+ return NULL;
+}
+
+SnippetGroup * SnippetItem::findGroupById(int id, QPtrList<SnippetItem> &list)
+{
+ for ( SnippetItem * item = list.first(); item; item = list.next() ) { //write the snippet-list
+ SnippetGroup * group = dynamic_cast<SnippetGroup*>(item);
+ if (group && group->getId() == id)
+ return group;
+ }
+ return NULL;
+}
+
+
+/* * * * * * * * * * * * * * * * * * * *
+Deklaration for class SnippetGroup
+* * * * * * * * * * * * * * * * * * * */
+
+int SnippetGroup::iMaxId = 1;
+
+SnippetGroup::SnippetGroup(QListView * parent, QString name, int id, QString lang)
+ : SnippetItem(parent, name, "GROUP")
+{
+ if (id > 0) {
+ iId = id;
+ if (id >= iMaxId)
+ iMaxId = id+1;
+ } else {
+ iId = iMaxId;
+ iMaxId++;
+ }
+
+ strLanguage = lang;
+}
+
+SnippetGroup::~SnippetGroup()
+{
+}
+
+void SnippetGroup::setId(int id)
+{
+ iId = id;
+ if (iId >= iMaxId)
+ iMaxId = iId+1;
+}
diff --git a/parts/snippet/snippetitem.h b/parts/snippet/snippetitem.h
new file mode 100644
index 00000000..ac6fb416
--- /dev/null
+++ b/parts/snippet/snippetitem.h
@@ -0,0 +1,70 @@
+/*
+ * File : snippetitem.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#ifndef SNIPPETITEM_H
+#define SNIPPETITEM_H
+
+#include <klistview.h>
+#include <klocale.h>
+
+class QString;
+
+class SnippetGroup;
+
+/**
+This class represents one CodeSnippet-Item in the listview.
+It also holds the needed data for one snippet.
+@author Robert Gruber
+*/
+class SnippetItem : public QListViewItem {
+friend class SnippetGroup;
+public:
+ SnippetItem(QListViewItem * parent, QString name, QString text);
+
+ ~SnippetItem();
+ QString getName();
+ QString getText();
+ int getParent() { return iParent; }
+ void resetParent();
+ void setText(QString text);
+ void setName(QString name);
+ static SnippetItem * findItemByName(QString name, QPtrList<SnippetItem> &list);
+ static SnippetGroup * findGroupById(int id, QPtrList<SnippetItem> &list);
+
+private:
+ SnippetItem(QListView * parent, QString name, QString text);
+ QString strName;
+ QString strText;
+ int iParent;
+};
+
+/**
+This class represents one group in the listview.
+It is derived from SnippetItem in order to allow storing
+it in the main QPtrList<SnippetItem>.
+@author Robert Gruber
+*/
+class SnippetGroup : public SnippetItem {
+public:
+ SnippetGroup(QListView * parent, QString name, int id, QString lang=i18n("All"));
+ ~SnippetGroup();
+
+ int getId() { return iId; }
+ static int getMaxId() { return iMaxId; }
+ QString getLanguage() { return strLanguage; }
+
+ void setId(int id);
+ void setLanguage(QString lang) { strLanguage = lang; }
+
+private:
+ static int iMaxId;
+ int iId;
+ QString strLanguage;
+};
+
+#endif
diff --git a/parts/snippet/snippetsettings.cpp b/parts/snippet/snippetsettings.cpp
new file mode 100644
index 00000000..f0f9348b
--- /dev/null
+++ b/parts/snippet/snippetsettings.cpp
@@ -0,0 +1,52 @@
+/*
+ * File : snippetsettings.cpp
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#include <qstring.h>
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+
+#include "snippetsettings.h"
+#include "snippet_widget.h"
+
+
+SnippetSettings::SnippetSettings(QWidget *parent, const char *name)
+ : SnippetSettingsBase(parent, name)
+{
+ _widget = NULL;
+}
+
+SnippetSettings::SnippetSettings(SnippetWidget * w, QWidget *parent, const char *name)
+ : SnippetSettingsBase(parent, name)
+{
+ _cfg = w->getSnippetConfig();
+ _widget = w;
+}
+
+
+SnippetSettings::~SnippetSettings()
+{
+}
+
+
+/*!
+ \fn SnippetSettings::slotOKClicked()
+ */
+void SnippetSettings::slotOKClicked()
+{
+ _cfg->setToolTips(cbToolTip->isChecked());
+ _cfg->setDelimiter(leDelimiter->text());
+ _cfg->setInputMethod(btnGroup->selectedId());
+ _cfg->setAutoOpenGroups(btnGroupAutoOpen->selectedId());
+
+ if (_widget)
+ _widget->languageChanged();
+}
+
+
+#include "snippetsettings.moc"
diff --git a/parts/snippet/snippetsettings.h b/parts/snippet/snippetsettings.h
new file mode 100644
index 00000000..ef4a019a
--- /dev/null
+++ b/parts/snippet/snippetsettings.h
@@ -0,0 +1,41 @@
+/*
+ * File : snippetsettings.h
+ *
+ * Author: Robert Gruber <rgruber@users.sourceforge.net>
+ *
+ * Copyright: See COPYING file that comes with this distribution
+ */
+
+#ifndef SNIPPETSETTINGS_H
+#define SNIPPETSETTINGS_H
+
+#include "snippetsettingsbase.h"
+
+class SnippetWidget;
+class SnippetConfig;
+
+/**
+This class is the widget that is showen in the
+KDevelop settings dialog. It inherits the
+class SnippetSettingsBase which is created by the
+same named .ui file
+@author Robert Gruber
+*/
+class SnippetSettings : public SnippetSettingsBase
+{
+Q_OBJECT
+public:
+ SnippetSettings(QWidget *parent = 0, const char *name = 0);
+ SnippetSettings(SnippetWidget * w, QWidget *parent = 0, const char *name = 0);
+
+ ~SnippetSettings();
+
+public slots:
+ void slotOKClicked();
+
+private:
+ SnippetConfig * _cfg;
+ SnippetWidget * _widget;
+};
+
+#endif
diff --git a/parts/snippet/snippetsettingsbase.ui b/parts/snippet/snippetsettingsbase.ui
new file mode 100644
index 00000000..54b8c325
--- /dev/null
+++ b/parts/snippet/snippetsettingsbase.ui
@@ -0,0 +1,228 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>SnippetSettingsBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SnippetSettingsBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>574</width>
+ <height>398</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Snippet Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Tooltips</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>cbToolTip</cstring>
+ </property>
+ <property name="text">
+ <string>Show snippet's text in &amp;tooltip</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Decides if a tooltip should be shown containing text from the bookmarked line</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="3" column="0">
+ <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>70</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>btnGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Input Method for Variables</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>rbSingle</cstring>
+ </property>
+ <property name="text">
+ <string>Single dialog for each variable within a snippet</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>An input dialog will be displayed for every variable within a snippet</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>rbAll</cstring>
+ </property>
+ <property name="text">
+ <string>One dialog for all variables within a snippet</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>A single dialog will be displayed where you can enter the values for all variables within a snippet</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Delimiter:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>kLineEdit1</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>leDelimiter</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>40</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="maxLength">
+ <number>1</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>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0">
+ <property name="name">
+ <cstring>btnGroupAutoOpen</cstring>
+ </property>
+ <property name="title">
+ <string>Automatically Open Groups</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>rbOpenOnActiv</cstring>
+ </property>
+ <property name="text">
+ <string>The group's language is the project's primary language</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>&lt;qt&gt;If the group's language is the same as the project's primary language, the group will be automatically opened.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>rbOpenOnSupported</cstring>
+ </property>
+ <property name="text">
+ <string>The group's language is supported by the project</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>&lt;qt&gt;Groups having a language which is supported by the current project will be opened automatically. &lt;br&gt;Even if the group's language is not the same as the project's primary language.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/texttools/Makefile.am b/parts/texttools/Makefile.am
new file mode 100644
index 00000000..8ebbc6b5
--- /dev/null
+++ b/parts/texttools/Makefile.am
@@ -0,0 +1,18 @@
+# Here resides the text tools part.
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/sourceinfo -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevtexttools.la
+libkdevtexttools_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevtexttools_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevtexttools_la_SOURCES = texttoolspart.cpp texttoolswidget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevtexttools.desktop
+
+# not used currently
+#rcdir = $(kde_datadir)/kdevtexttools
+#rc_DATA = kdevtexttools.rc
diff --git a/parts/texttools/README.dox b/parts/texttools/README.dox
new file mode 100644
index 00000000..3fd5180b
--- /dev/null
+++ b/parts/texttools/README.dox
@@ -0,0 +1,49 @@
+/** \class TextToolsPart
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/texttools/kdevtexttools.desktop b/parts/texttools/kdevtexttools.desktop
new file mode 100644
index 00000000..4af1638a
--- /dev/null
+++ b/parts/texttools/kdevtexttools.desktop
@@ -0,0 +1,84 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a structure overview and navigation for HTML and TEX files
+Comment[ca]=Proporciona una vista de conjunt i navegació per a fitxers HTML i TEX
+Comment[da]=Giver et strukturoverblik og navigering for HTML- og TeX-filer
+Comment[de]=Stellt eine Strukturansicht für HTML- und TeX-Dateien zur Verfügung
+Comment[el]=Προσφέρει μια περίληψη δομής και πλοήγηση για αρχεία HTML και TEX
+Comment[es]=Proporciona una vista general y navegación para archivos HTML y TEX
+Comment[et]=Näitab HTML- ja TEX-failide struktuuri ning võimaldab neis liikuda
+Comment[eu]=HTML eta TEX fitxategien egituren laburpen eta nabigazioa eskeintzen du.
+Comment[fa]=خلاصۀ ساختار و ناوش را برای پرونده‌های زنگام و متن فراهم می‌کند
+Comment[fr]=Fournit une vue d'ensemble et une navigation pour les fichiers HTML et TEX
+Comment[gl]=Proporciona unha vista xeral e navegación da estructura de ficheiros HTML e TEX
+Comment[hu]=Lehetővé teszi a struktúra áttekintését, navigálását HTML és TEX fájloknál
+Comment[it]=Offre un'anteprima di struttura e navigazione per file HTML e TEX
+Comment[ja]=HTML や TeX ファイルの構造の概要やナビゲーションを提供します。
+Comment[ms]=Menyediakan struktur menyeluruh dan navigasi untuk HTML dan fail TEX
+Comment[nds]=Stellt en Struktuuröversicht un dat Stüern för HTML- un TeX-Dateien praat.
+Comment[ne]=HTML र TEX फाइलका लागि नेभिगेसन र बनावट समिक्षा प्रदान गर्दछ
+Comment[nl]=Biedt een overzicht van de structuur van HTML- en TeX-bestanden
+Comment[pl]=Widok struktury tekstu i nawigacja dla plików HTML i TEX
+Comment[pt]=Oferece uma vista geral estruturada e a navegação sobre os ficheiros de HTML e TEX
+Comment[pt_BR]=Fornece uma visão de estrutura e navegação para arquivos HTML e TEX
+Comment[ru]=Показывает структуру документов в формате HTML и TEX, а также предоставляет возможности навигации по ним.
+Comment[sk]=Poskytuje štruktúrovaný náhľad a navigáciu pre HTML a TEX súbory
+Comment[sr]=Обезбеђује преглед структуре и навигацију за HTML и TEX фајлове
+Comment[sr@Latn]=Obezbeđuje pregled strukture i navigaciju za HTML i TEX fajlove
+Comment[sv]=Tillhandahåller en strukturöversikt och navigering för HTML- och Tex-filer
+Comment[ta]=HTML மற்றும் TEX கோப்புகளின் அமைப்பை மேற்பார்வையிட மற்றும் வழி செலுத்த இது உதவும்.
+Comment[tg]=Ҳуҷҷатҳои структуриро дар формати HTML ва TEX тасвир менамояд ва боз ҳам имкони навигатсия намуданро иҷозат медиҳад
+Comment[tr]=HTML ve TEX dosyaları için yapı gözden geçirimi ve dolaşımı sağlar.
+Comment[zh_CN]=提供HTML和TEX文件的结构预览
+Comment[zh_TW]=提供 HTML 與 TEX 檔的結構化的概觀與導覽
+Name=KDevTextTools
+Name[da]=KDevelop tekstværktøjer
+Name[de]=Textstrukturansicht (KDevelop)
+Name[hi]=के-डेव-टेक्स्ट-टूल्स
+Name[nds]=KDevelop-TextWarktüüch
+Name[pl]=KDevNarzędziaTekstowe
+Name[sk]=KDev textové nástroje
+Name[sv]=KDevelop textverktyg
+Name[ta]=KDev உரைக்கருவி
+Name[tg]=Асбобҳои матни KDev
+Name[zh_TW]=KDevelop 文字工具
+GenericName=Text Structure
+GenericName[br]=Skeledenn ar skrid
+GenericName[ca]=Estructura del text
+GenericName[da]=Tekststruktur
+GenericName[de]=Textstruktur-Ansicht
+GenericName[el]=Δομή κειμένου
+GenericName[es]=Estructura de texto
+GenericName[et]=Tekstistruktuur
+GenericName[eu]=Testuaren egitura
+GenericName[fa]=ساختار متن
+GenericName[fr]=Structure du texte
+GenericName[gl]=Estructura do texto
+GenericName[hi]=टेक्स्ट स्ट्रक्चर
+GenericName[hu]=Szövegstruktúra
+GenericName[it]=Struttura testo
+GenericName[ja]=テキスト構造
+GenericName[ms]=Struktur Teks
+GenericName[nds]=Textstruktuur
+GenericName[ne]=पाठ बनावट
+GenericName[nl]=Tekststructuur
+GenericName[pl]=Struktura tekstu
+GenericName[pt]=Estrutura de Texto
+GenericName[pt_BR]=Estrutura de Texto
+GenericName[ru]=Показ структуры текста
+GenericName[sk]=Textové štruktúry
+GenericName[sl]=Besedilna struktura
+GenericName[sr]=Структура текста
+GenericName[sr@Latn]=Struktura teksta
+GenericName[sv]=Textstruktur
+GenericName[ta]=உரை வடிவம்
+GenericName[tg]=Тасвири матни структурӣ
+GenericName[tr]=Metin Yapısı
+GenericName[zh_CN]=文件结构
+GenericName[zh_TW]=文字結構
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevtexttools
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=CodeNavigation
diff --git a/parts/texttools/texttoolspart.cpp b/parts/texttools/texttoolspart.cpp
new file mode 100644
index 00000000..7eb439da
--- /dev/null
+++ b/parts/texttools/texttoolspart.cpp
@@ -0,0 +1,99 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "texttoolspart.h"
+
+#include <qwhatsthis.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <ktexteditor/editinterface.h>
+
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+
+#include "texttoolswidget.h"
+
+
+typedef KDevGenericFactory<TextToolsPart> TextToolsFactory;
+static const KDevPluginInfo data("kdevtexttools");
+K_EXPORT_COMPONENT_FACTORY( libkdevtexttools, TextToolsFactory( data ) )
+
+TextToolsPart::TextToolsPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "TextToolsPart")
+{
+ setInstance(TextToolsFactory::instance());
+ // setXMLFile("kdevfileview.rc");
+
+ m_widget = 0;
+
+ connect( partController(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(activePartChanged(KParts::Part*)) );
+}
+
+
+TextToolsPart::~TextToolsPart()
+{
+ if (m_widget)
+ mainWindow()->removeView(m_widget);
+ delete m_widget;
+}
+
+
+void TextToolsPart::createWidget()
+{
+ if (m_widget)
+ {
+// mainWindow()->embedSelectView(m_widget, i18n("Text Structure"), i18n("Text structure"));
+ return;
+ }
+
+ m_widget = new TextToolsWidget(this);
+ m_widget->setCaption(i18n("Text Structure"));
+ QWhatsThis::add(m_widget, i18n("<b>Text Structure</b><p>"
+ "This browser shows the structure of the text."));
+ mainWindow()->embedSelectView(m_widget, i18n("Text Structure"), i18n("Text structure"));
+}
+
+
+void TextToolsPart::activePartChanged(KParts::Part *part)
+{
+ if (m_widget)
+ m_widget->stop();
+
+ if (!part)
+ return;
+ KParts::ReadWritePart *rwpart = dynamic_cast<KParts::ReadWritePart*>(part);
+ if (!rwpart)
+ return;
+ QString url = rwpart->url().url();
+
+ if (url.endsWith(".html")) {
+ kdDebug(9030) << "set mode html" << endl;
+ createWidget();
+ m_widget->setMode(TextToolsWidget::HTML, rwpart);
+ } else if (url.endsWith(".docbook")) {
+ kdDebug(9030) << "set mode Docbook" << endl;
+ createWidget();
+ m_widget->setMode(TextToolsWidget::Docbook, rwpart);
+ } else if (url.endsWith(".tex")) {
+ kdDebug(9030) << "set mode LaTeX" << endl;
+ createWidget();
+ m_widget->setMode(TextToolsWidget::LaTeX, rwpart);
+ } else if (m_widget) {
+// kdDebug(9030) << "hide output view" << endl;
+// mainWindow()->removeView(m_widget);
+ m_widget->clear();
+ }
+}
+
+#include "texttoolspart.moc"
diff --git a/parts/texttools/texttoolspart.h b/parts/texttools/texttoolspart.h
new file mode 100644
index 00000000..7e7bf9c5
--- /dev/null
+++ b/parts/texttools/texttoolspart.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _TEXTTOOLSPART_H_
+#define _TEXTTOOLSPART_H_
+
+#include <qguardedptr.h>
+#include <kparts/part.h>
+#include "kdevplugin.h"
+
+class TextToolsWidget;
+
+
+class TextToolsPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ TextToolsPart( QObject *parent, const char *name, const QStringList & );
+ ~TextToolsPart();
+
+private slots:
+ void activePartChanged(KParts::Part *part);
+
+private:
+ void createWidget();
+
+ QGuardedPtr<TextToolsWidget> m_widget;
+};
+
+#endif
diff --git a/parts/texttools/texttoolswidget.cpp b/parts/texttools/texttoolswidget.cpp
new file mode 100644
index 00000000..ff85d0f0
--- /dev/null
+++ b/parts/texttools/texttoolswidget.cpp
@@ -0,0 +1,400 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "texttoolswidget.h"
+
+#include <qheader.h>
+#include <qregexp.h>
+#include <qtimer.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <kpopupmenu.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/editinterface.h>
+
+#include "kdevmainwindow.h"
+#include "kdevpartcontroller.h"
+#include "texttoolspart.h"
+
+
+class TextStructItem : public QListViewItem
+{
+public:
+ TextStructItem(QListView *parent)
+ : QListViewItem(parent)
+ {}
+ TextStructItem(QListViewItem *parent)
+ : QListViewItem(parent)
+ {
+ QListViewItem *item = this;
+ while (item->nextSibling())
+ item = item->nextSibling();
+ if (item != this)
+ moveItem(item);
+ }
+
+ QString text(int) const
+ {
+ return extra.isNull()? tag : QString("%1: %2").arg(tag).arg(extra);
+ }
+ TextStructItem *parentStructItem()
+ { return static_cast<TextStructItem*>(parent()); }
+
+ QString tag;
+ QString extra;
+ int pos;
+ int endpos;
+};
+
+
+TextToolsWidget::TextToolsWidget(TextToolsPart *part, QWidget *parent, const char *name)
+ : KListView(parent, name)
+{
+ setResizeMode(QListView::LastColumn);
+ setSorting(-1);
+ header()->hide();
+ addColumn(QString::null);
+
+ m_part = part;
+
+ m_timer = new QTimer(this);
+ connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)),
+ this, SLOT(slotItemPressed(int,QListViewItem*)) );
+ // connect( this, SIGNAL(doubleClicked(QListViewItem*)),
+ // this, SLOT(slotItemPressed(int,QListViewItem*)) );
+ connect( this, SIGNAL(returnPressed(QListViewItem*)),
+ this, SLOT(slotReturnPressed(QListViewItem*)) );
+ connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );
+}
+
+
+TextToolsWidget::~TextToolsWidget()
+{}
+
+
+void TextToolsWidget::slotItemPressed(int button, QListViewItem *item)
+{
+ if (!item)
+ return;
+
+ TextStructItem *tsitem = static_cast<TextStructItem*>(item);
+ int searchedPos = tsitem->pos;
+ int searchedEndpos = tsitem->endpos;
+ kdDebug(9030) << "Searched pos " << searchedPos << ", " << searchedEndpos << endl;
+
+ int endline = 0;
+ int endcol = 0;
+ int line = 0;
+ int col = 0;
+
+ int len = m_cachedText.length();
+ int pos = 0;
+ while (pos < len) {
+ if (pos == searchedPos) {
+ line = endline;
+ col = endcol;
+ }
+ if (pos == searchedEndpos)
+ break;
+ QChar ch = m_cachedText[pos];
+ if (ch == '\n') {
+ ++endline;
+ endcol = 0;
+ } else {
+ ++endcol;
+ }
+ ++pos;
+ }
+
+ KParts::Part *rwpart
+ = dynamic_cast<KParts::Part*>(m_part->partController()->activePart());
+ QWidget *view = m_part->partController()->activeWidget();
+
+ KTextEditor::ViewCursorInterface *cursorIface
+ = dynamic_cast<KTextEditor::ViewCursorInterface*>(view);
+ if (cursorIface) {
+ kdDebug(9030) << "set cursor " << line << ", " << col << endl;
+ cursorIface->setCursorPosition(line, col);
+ }
+
+ if (button == MidButton) {
+ KTextEditor::SelectionInterface *selectionIface
+ = dynamic_cast<KTextEditor::SelectionInterface*>(rwpart);
+ if (selectionIface) {
+ kdDebug(9030) << "set selection " << line << ", " << col
+ << ", " << endline << ", " << endcol << endl;
+ selectionIface->setSelection((int)line, (int)col, (int)endline, (int)endcol+1);
+ }
+ }
+
+ m_part->mainWindow()->lowerView(this);
+}
+
+
+void TextToolsWidget::slotReturnPressed(QListViewItem *item)
+{
+ slotItemPressed(LeftButton, item);
+}
+
+
+void TextToolsWidget::slotContextMenu(KListView *, QListViewItem *item, const QPoint &)
+{
+ if (!item)
+ return;
+
+#if 0
+ KPopupMenu popup(i18n("Text Structure"), this);
+ popup.exec(p);
+#endif
+}
+
+
+void TextToolsWidget::stop()
+{
+ disconnect( m_timer );
+ m_relevantTags.clear();
+ m_emptyTags.clear();
+ m_cachedText = QString::null;
+}
+
+
+void TextToolsWidget::setMode(Mode mode, KParts::Part *part)
+{
+ connect( part, SIGNAL(textChanged()),
+ this, SLOT(startTimer()) );
+ m_editIface = dynamic_cast<KTextEditor::EditInterface*>(part);
+
+ switch (mode) {
+ case HTML:
+ m_relevantTags << "h1" << "h2" << "h3" << "h4"
+ << "table" << "tr";
+ m_emptyTags << "br" << "hr" << "img" << "input" << "p" << "meta";
+
+ connect( m_timer, SIGNAL(timeout()),
+ this, SLOT(parseXML()) );
+ break;
+ case Docbook:
+ m_relevantTags << "chapter" << "sect1" << "sect2"
+ << "para" << "formalpara";
+ connect( m_timer, SIGNAL(timeout()),
+ this, SLOT(parseXML()) );
+ break;
+ case LaTeX:
+ connect( m_timer, SIGNAL(timeout()),
+ this, SLOT(parseLaTeX()) );
+ break;
+ default: ;
+ }
+
+ m_timer->start(0, true);
+}
+
+
+void TextToolsWidget::startTimer()
+{
+ kdDebug(9030) << "Starting parse timer" << endl;
+ m_timer->start(1000, true);
+}
+
+
+void TextToolsWidget::parseXML()
+{
+ kdDebug(9030) << "Starting to parse XML" << endl;
+ clear();
+ QString text = m_editIface->text();
+ m_cachedText = text;
+
+ TextStructItem *currentItem = new TextStructItem(this);
+ currentItem->tag = "Root";
+ currentItem->pos = -1;
+ currentItem->endpos = -1;
+
+ int len = text.length();
+ for (int pos=0; pos+1 < len; ++pos) {
+ QChar ch1 = text[pos];
+ QChar ch2 = text[pos+1];
+
+ if (ch1 == '<' && ch2 == '?') {
+
+ // PHP and other similar stuff
+ QString tag;
+ int endpos = pos+2;
+ bool foundspace = false;
+ while (endpos+1 < len) {
+ QChar ch3 = text[endpos];
+ QChar ch4 = text[endpos+1];
+ if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) {
+ tag = text.mid(pos+2, endpos-pos-2).lower();
+ foundspace = true;
+ } else if (ch3 == '?' && ch4 == '>') {
+ if (!foundspace)
+ tag = text.mid(pos+2, endpos-pos-2).lower();
+ break;
+ }
+ ++endpos;
+ }
+
+ TextStructItem *item = new TextStructItem(currentItem);
+ item->tag = "<?" + tag + "?>";
+ item->pos = pos;
+ item->endpos = endpos+1;
+
+ pos = endpos+1;
+
+ } else if (ch1 == '<' && ch2 == '!') {
+
+ // Processing instructions like !DOCTYPE
+ QString tag;
+ int endpos = pos+2;
+ bool foundspace = false;
+ while (endpos+1 < len) {
+ QChar ch3 = text[endpos];
+ if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) {
+ tag = text.mid(pos+2, endpos-pos-2).lower();
+ foundspace = true;
+ } else if (ch3 == '>') {
+ if (!foundspace)
+ tag = text.mid(pos+2, endpos-pos-2).lower();
+ break;
+ }
+ ++endpos;
+ }
+
+ TextStructItem *item = new TextStructItem(currentItem);
+ item->tag = "<!" + tag + ">";
+ item->pos = pos;
+ item->endpos = endpos+1;
+
+ pos = endpos+1;
+
+ } else if (ch1 == '<' && ch2 == '/') {
+
+ QString tag;
+ int endpos = pos+2;
+ while (endpos < len) {
+ QChar ch3 = text[endpos];
+ if (ch3 == '>') {
+ tag = text.mid(pos+2, endpos-pos-2).lower();
+ break;
+ }
+ ++endpos;
+ }
+
+ if (!m_relevantTags.contains(tag)) {
+ pos = endpos;
+ continue;
+ }
+
+ TextStructItem *closingItem = currentItem;
+ while (closingItem->parent() && closingItem->tag != tag)
+ closingItem = closingItem->parentStructItem();
+ if (closingItem->parent()) {
+ closingItem->endpos = endpos;
+ currentItem = closingItem->parentStructItem();
+ } else {
+ kdDebug(9030) << "found no opening tag " << tag << "." << endl;
+ }
+
+ pos = endpos;
+
+ } else if (ch1 == '<') {
+
+ QString tag;
+ int endpos = pos+1;
+ bool foundspace = false;
+ while (endpos < len) {
+ QChar ch3 = text[endpos];
+ if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) {
+ tag = text.mid(pos+1, endpos-pos-1).lower();
+ foundspace = true;
+ } else if (ch3 == '>') {
+ if (!foundspace) {
+ tag = text.mid(pos+1, endpos-pos-1).lower();
+ }
+ break;
+ }
+ ++endpos;
+ }
+
+ if (!m_relevantTags.contains(tag)) {
+ pos = endpos;
+ continue;
+ }
+
+ TextStructItem *item = new TextStructItem(currentItem);
+ item->tag = tag;
+ item->pos = pos;
+ item->endpos = -1;
+
+ if (m_emptyTags.contains(tag))
+ item->endpos = endpos;
+ else
+ currentItem = item;
+ pos = endpos;
+
+ }
+ }
+
+ // firstChild()->setOpen(true);
+ QListViewItemIterator it(this);
+ for (; it.current(); ++it)
+ it.current()->setOpen(true);
+}
+
+
+void TextToolsWidget::parseLaTeX()
+{
+ kdDebug(9030) << "Starting to parse LaTeX" << endl;
+ clear();
+ QString text = m_editIface->text();
+ m_cachedText = text;
+
+ TextStructItem *currentItem = new TextStructItem(this);
+ currentItem->tag = "Root";
+ currentItem->pos = -1;
+ currentItem->endpos = -1;
+
+ QString hierarchyLevels = "Root,chapter,section,subsection,subsubsection";
+ QRegExp re("\n[ \t]*s*\\\\(chapter|section|subsection|subsubsection)\\{([^}]*)\\}");
+
+ int pos=0;
+ for (;;) {
+ pos = re.search(text, pos);
+ if (pos == -1)
+ break;
+ QString tag = re.cap(1);
+ QString title = re.cap(2);
+ kdDebug(9030) << "Match with " << tag << " and title " << title << endl;
+ int level = hierarchyLevels.find(tag);
+ while (currentItem->parent() && level <= hierarchyLevels.find(currentItem->tag))
+ currentItem = currentItem->parentStructItem();
+
+ TextStructItem *item = new TextStructItem(currentItem);
+ item->tag = tag;
+ item->extra = title;
+ item->pos = pos+1;
+ item->endpos = pos+re.matchedLength()-1; // lie
+
+ if (level > hierarchyLevels.find(currentItem->tag))
+ currentItem = item;
+
+ pos = pos+re.matchedLength();
+ }
+
+ QListViewItemIterator it(this);
+ for (; it.current(); ++it)
+ it.current()->setOpen(true);
+}
+
+#include "texttoolswidget.moc"
diff --git a/parts/texttools/texttoolswidget.h b/parts/texttools/texttoolswidget.h
new file mode 100644
index 00000000..680adb34
--- /dev/null
+++ b/parts/texttools/texttoolswidget.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _TEXTTOOLSWIDGET_H_
+#define _TEXTTOOLSWIDGET_H_
+
+#include <klistview.h>
+#include <qstringlist.h>
+
+class TextToolsPart;
+class QTimer;
+namespace KParts { class Part; }
+namespace KTextEditor { class EditInterface; }
+
+
+class TextToolsWidget : public KListView
+{
+ Q_OBJECT
+
+public:
+ enum Mode { HTML, Docbook, LaTeX };
+
+ TextToolsWidget( TextToolsPart *part, QWidget *parent=0, const char *name=0 );
+ ~TextToolsWidget();
+
+ void setMode(Mode mode, KParts::Part *part);
+ void stop();
+
+private slots:
+ void slotItemPressed(int button, QListViewItem *item);
+ void slotReturnPressed(QListViewItem *item);
+ void slotContextMenu(KListView *, QListViewItem *item, const QPoint &p);
+
+ void startTimer();
+ void parseXML();
+ void parseLaTeX();
+
+private:
+ TextToolsPart *m_part;
+ QTimer *m_timer;
+ QString m_cachedText;
+ KTextEditor::EditInterface *m_editIface;
+ QStringList m_relevantTags, m_emptyTags;
+};
+
+#endif
diff --git a/parts/tipofday/Makefile.am b/parts/tipofday/Makefile.am
new file mode 100644
index 00000000..14e3a349
--- /dev/null
+++ b/parts/tipofday/Makefile.am
@@ -0,0 +1,24 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevtipofday.la
+libkdevtipofday_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevtipofday_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevtipofday_la_SOURCES = tipofday_part.cpp
+
+METASOURCES = AUTO
+KDE_ICON = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevtipofday.desktop
+
+tip_DATA = tips
+tipdir = $(kde_datadir)/kdevtipofday
+
+rc_DATA = kdevpart_tipofday.rc
+rcdir = $(kde_datadir)/kdevtipofday
+
+messages: rc.cpp
+ $(PREPARETIPS) > tips.cc
+ $(XGETTEXT) *.cpp *.h tips.cc -o $(podir)/kdevtipofday.pot
+ rm -f tips.cc
diff --git a/parts/tipofday/README.dox b/parts/tipofday/README.dox
new file mode 100644
index 00000000..f953e258
--- /dev/null
+++ b/parts/tipofday/README.dox
@@ -0,0 +1,8 @@
+/** \class TipOfDayPart
+Shows a random "tip of the day" at KDevelop startup.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\feature Shows a random "tip of the day" at KDevelop startup
+
+*/
diff --git a/parts/tipofday/hi16-action-ktip.png b/parts/tipofday/hi16-action-ktip.png
new file mode 100644
index 00000000..1358de47
--- /dev/null
+++ b/parts/tipofday/hi16-action-ktip.png
Binary files differ
diff --git a/parts/tipofday/hi32-action-ktip.png b/parts/tipofday/hi32-action-ktip.png
new file mode 100644
index 00000000..4b38d5d6
--- /dev/null
+++ b/parts/tipofday/hi32-action-ktip.png
Binary files differ
diff --git a/parts/tipofday/hi48-action-ktip.png b/parts/tipofday/hi48-action-ktip.png
new file mode 100644
index 00000000..534eda5c
--- /dev/null
+++ b/parts/tipofday/hi48-action-ktip.png
Binary files differ
diff --git a/parts/tipofday/kdevpart_tipofday.rc b/parts/tipofday/kdevpart_tipofday.rc
new file mode 100644
index 00000000..43f7d1dc
--- /dev/null
+++ b/parts/tipofday/kdevpart_tipofday.rc
@@ -0,0 +1,8 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="tipofday" library="libtipofdayplugin" version="1">
+<MenuBar>
+ <Menu name="help"><Text>&amp;Help</Text>
+ <Action name="help_tipofday"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/tipofday/kdevtipofday.desktop b/parts/tipofday/kdevtipofday.desktop
new file mode 100644
index 00000000..4c4f9ba2
--- /dev/null
+++ b/parts/tipofday/kdevtipofday.desktop
@@ -0,0 +1,94 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Tip of the Day
+Comment[br]=Lagadenn an deiz
+Comment[ca]=Consell del dia
+Comment[cy]=Awgrymiad y Dydd
+Comment[da]=Dagens vink
+Comment[de]=Tipp des Tages
+Comment[el]=Συμβουλή της ημέρας
+Comment[es]=Consejo del día
+Comment[et]=Päeva nõuanne
+Comment[eu]=Eguneko aholkua
+Comment[fa]=نکتۀ روز
+Comment[fr]=Astuce du jour
+Comment[ga]=Leid an Lae
+Comment[gl]=Consello do día
+Comment[hi]=टिप ऑफ द डे
+Comment[hu]=A nap tippje
+Comment[it]=Suggerimento del giorno
+Comment[ja]=今日の一言
+Comment[ms]=Tip Hari Ini
+Comment[nds]=Tipp för Vundaag
+Comment[ne]=आजको टिप
+Comment[nl]=Tip van de dag
+Comment[pa]=ਅੱਜ ਦਾ ਇਸ਼ਾਰਾ
+Comment[pl]=Podpowiedź dnia
+Comment[pt]=Dica do Dia
+Comment[pt_BR]=Dica do Dia
+Comment[ru]=Полезный совет
+Comment[sk]=Tip dňa
+Comment[sl]=Namig dneva
+Comment[sr]=Савет дана
+Comment[sr@Latn]=Savet dana
+Comment[sv]=Dagens tips
+Comment[ta]=இந்த நாளுக்கான யோசனை
+Comment[tg]=Маслиҳати фоиданок
+Comment[tr]=Günün İpucu
+Comment[zh_CN]=日积月累
+Comment[zh_TW]=本日小提示
+Name=KDevTipOfDay
+Name[da]=KDevelop Dagens vink
+Name[de]="Tipp des Tages"-Modul (KDevelop)
+Name[hi]=के-डेव-टिप-ऑफ-डे
+Name[nds]=KDevelop-"Tipp för Vundaag"
+Name[pl]=KDevPodpowiedźDnia
+Name[sk]=KDev tip dňa
+Name[sv]=KDevelop dagens tips
+Name[ta]=KDevஇந்த நாளுக்கான யோசனை
+Name[tg]=KDevЛуқмаи рӯз
+Name[zh_TW]=KDevelop 本日小提示
+GenericName=Tip of the Day
+GenericName[br]=Lagadenn an deiz
+GenericName[ca]=Consell del dia
+GenericName[cy]=Awgrymiad y Dydd
+GenericName[da]=Dagens vink
+GenericName[de]=Tipp des Tages
+GenericName[el]=Συμβουλή της ημέρας
+GenericName[es]=Consejo del día
+GenericName[et]=Päeva nõuanne
+GenericName[eu]=Eguneko aholkua
+GenericName[fa]=نکتۀ روز
+GenericName[fr]=Astuce du jour
+GenericName[ga]=Leid an Lae
+GenericName[gl]=Consello do día
+GenericName[hi]=टिप ऑफ द डे
+GenericName[hu]=A nap tippje
+GenericName[it]=Suggerimento del giorno
+GenericName[ja]=今日の一言
+GenericName[ms]=Tip Hari Ini
+GenericName[nds]=Tipp för Vundaag
+GenericName[ne]=आजको टिप
+GenericName[nl]=Tip van de dag
+GenericName[pa]=ਅੱਜ ਦਾ ਇਸ਼ਾਰਾ
+GenericName[pl]=Podpowiedź dnia
+GenericName[pt]=Dica do Dia
+GenericName[pt_BR]=Dica do Dia
+GenericName[ru]=Полезный совет
+GenericName[sk]=Tip dňa
+GenericName[sl]=Namig dneva
+GenericName[sr]=Савет дана
+GenericName[sr@Latn]=Savet dana
+GenericName[sv]=Dagens tips
+GenericName[ta]=இந்த நாளுக்கான யோசனை
+GenericName[tg]=Маслиҳати фоиданок
+GenericName[tr]=Günün İpucu
+GenericName[zh_CN]=日积月累
+GenericName[zh_TW]=本日小提示
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevtipofday
+X-KDevelop-Version=5
+X-KDevelop-Scope=Core
+X-KDevelop-Properties=Documentation
diff --git a/parts/tipofday/lo16-action-kdevelop_tip.png b/parts/tipofday/lo16-action-kdevelop_tip.png
new file mode 100644
index 00000000..66c5766c
--- /dev/null
+++ b/parts/tipofday/lo16-action-kdevelop_tip.png
Binary files differ
diff --git a/parts/tipofday/lo32-action-kdevelop_tip.png b/parts/tipofday/lo32-action-kdevelop_tip.png
new file mode 100644
index 00000000..ea4a755a
--- /dev/null
+++ b/parts/tipofday/lo32-action-kdevelop_tip.png
Binary files differ
diff --git a/parts/tipofday/tipofday_part.cpp b/parts/tipofday/tipofday_part.cpp
new file mode 100644
index 00000000..fefdcd39
--- /dev/null
+++ b/parts/tipofday/tipofday_part.cpp
@@ -0,0 +1,67 @@
+#include "tipofday_part.h"
+
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qwhatsthis.h>
+
+#include <kaboutdata.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <ktextbrowser.h>
+#include <ktip.h>
+
+#include "kdevapi.h"
+#include "kdevcore.h"
+
+static const KDevPluginInfo data("kdevtipofday");
+
+typedef KDevGenericFactory<TipOfDayPart> TipOfDayFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevtipofday, TipOfDayFactory( data ) )
+
+TipOfDayPart::TipOfDayPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "TipOfDayPart")
+{
+ setInstance(TipOfDayFactory::instance());
+
+ setXMLFile("kdevpart_tipofday.rc");
+
+ KAction *action;
+
+ action = new KAction(i18n("&Tip of the Day"), "idea", 0,
+ this, SLOT(showTip()), actionCollection(), "help_tipofday");
+ action->setToolTip(i18n("A tip how to use KDevelop"));
+ action->setWhatsThis(i18n("<b>Tip of the day</b><p>"
+ "Will display another good tip \n"
+ "contributed by KDevelop users."));
+
+ connect(core(), SIGNAL(coreInitialized()), this, SLOT(showOnStart()));
+}
+
+
+QString TipOfDayPart::getFilename()
+{
+ KConfig * config = KApplication::kApplication()->config();
+ config->setGroup("Tip of day plugin");
+ return config->readEntry("TipsFile", "kdevtipofday/tips");
+}
+
+void TipOfDayPart::showTip()
+{
+ KTipDialog::showTip(getFilename(), true);
+}
+
+
+void TipOfDayPart::showOnStart()
+{
+ KTipDialog::showTip(getFilename());
+}
+
+
+
+#include "tipofday_part.moc"
diff --git a/parts/tipofday/tipofday_part.h b/parts/tipofday/tipofday_part.h
new file mode 100644
index 00000000..50eedadd
--- /dev/null
+++ b/parts/tipofday/tipofday_part.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2001 Matthias H�zer-Klpfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_TIPOFDAY_H__
+#define __KDEVPART_TIPOFDAY_H__
+
+
+#include <kdevplugin.h>
+
+
+class TipOfDayPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+
+ TipOfDayPart(QObject *parent, const char *name, const QStringList &);
+
+
+public slots:
+
+ void showTip();
+ void showOnStart();
+
+private:
+ QString getFilename();
+
+};
+
+
+#endif
diff --git a/parts/tipofday/tips b/parts/tipofday/tips
new file mode 100644
index 00000000..ae79ae33
--- /dev/null
+++ b/parts/tipofday/tips
@@ -0,0 +1,203 @@
+<tip category="KDevelop|General">
+<html>
+<p>If you want to specify additional command-line options to your make program, you can set them in the <b>Project Options</b> dialog, <b>Make Options</b> tab.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you use functions of other libraries than the target is currently linked with, you can specify them in the <b>Target Options</b> dialog.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you want to change your application's version number, you can change it in the <b>Project Options</b> dialog, <b>General</b> tab, automatically updating your project.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you want to create a new project, choose "Project"->"New Project" from the menu.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you changed your applications' classes, you should update your API documentation by selecting "Build API Documentation" from the Build menu.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>You can save time if you select "Compile File" from the Build menu or the toolbar, to only compile your current implementation file.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you're searching for information on classes or classmembers, select "Search for Help on..." from the Help menu or use "Index" tab of the documentation tree.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you want to have info about something in the KDevelop window, select the "What's this?" button in the toolbar and click on the item you don't know about.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>Hint: You can search the documentation for a keyword by marking the word and select "Search in Documentation" in the right button popup menu.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>The KDevelop Team wishes you a nice day !
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you have found a bug in KDevelop, please let us know. Use KDE Bugzilla at http://bugs.kde.org/ or select "Help"->"Report Bug" from the menu.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you want to add your own documentation to the documentation tree use <b>Documentation Tree</b> tab in the <b>Configure KDevelop</b> dialog.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can create a new class with "New Class" from the "Project" menu?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>To open a project, select "Open Project" from the "Project" menu.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>If you compile your project and get an error, you can click on the error message to switch to the file and line where the error occurred.
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can debug your programs within KDevelop by selecting "Debug"->"Start" in the menu?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can switch between classes or namespaces by selecting the class or namespace combo in the toolbar?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can preview images and icons by selecting them in the file viewer's trees?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can set the compiler options in the <b>Project Options</b> dialog, <b>Configure Options</b> tab?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can copy text from the documentation browser to the clipboard and insert it into your sources?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you should keep your library documentation up to date after installing new libraries?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can configure the syntax-highlighting of the editor?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can access more internal debug functions selecting "Debug"->"Viewers"?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can move the cursor by words with Ctrl and left or right arrow?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that your source bookmarks are stored in the project?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that your documentation bookmarks are stored globally in KDevelop configuration?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can start grep search from inside editor with context menu?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can set the installation path in "Project"->"Project Options" "Configure Options" with just adding "--prefix=/install/path/" to the "Configure arguments"-list?
+</html>
+</tip>
+
+
+<tip category="KDevelop|General">
+<html>
+<p>...that you can compilie your project in "debug-mode" and "optimized-mode"?
+</html>
+</tip>
+
+
diff --git a/parts/tools/Makefile.am b/parts/tools/Makefile.am
new file mode 100644
index 00000000..887ccdd5
--- /dev/null
+++ b/parts/tools/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevtools.la
+libkdevtools_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevtools_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevtools_la_SOURCES = tools_part.cpp toolsconfig.cpp toolsconfigwidgetbase.ui toolsconfigwidget.cpp kapplicationtree.cpp addtooldlg.ui
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevtools.desktop
+
+rc_DATA = kdevpart_tools.rc
+rcdir = $(kde_datadir)/kdevtools
diff --git a/parts/tools/README.dox b/parts/tools/README.dox
new file mode 100644
index 00000000..00eab3bf
--- /dev/null
+++ b/parts/tools/README.dox
@@ -0,0 +1,12 @@
+/** \class ToolsPart
+This plugin provides an easy way to add external applications to the Tools menu and toolbar.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a>
+
+\unmaintained This part is currently un-maintained.
+
+\feature Provides an easy way to add external applications to the Tools menu and toolbar.
+\feature Tool menu and the file and directory context menus can now be populated with any shell command.
+\feature Output can be sent to the app output part. %S, %D, %T and %W magic works.
+
+*/
diff --git a/parts/tools/addtooldlg.ui b/parts/tools/addtooldlg.ui
new file mode 100644
index 00000000..2ec5e8b4
--- /dev/null
+++ b/parts/tools/addtooldlg.ui
@@ -0,0 +1,245 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AddToolDialog</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>add_tool_dialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>314</width>
+ <height>514</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Tool</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>cmdlineLabel_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Parameters:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paramEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>capturedBox</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;apture output</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked, the output of the application will be shown in the application output view; otherwise, all output will be ignored.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>cmdlineLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>execEdit</cstring>
+ </property>
+ </widget>
+ <widget class="Line" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>menutextLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Menu text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>menutextEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>paramEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;p&gt;The following placeholders can be used:&lt;/p&gt;
+&lt;p&gt;
+&lt;b&gt;%D&lt;/b&gt; - The project directory&lt;br&gt;
+&lt;b&gt;%S&lt;/b&gt; - The current filename&lt;br&gt;
+&lt;b&gt;%T&lt;/b&gt; - The current selection&lt;br&gt;
+&lt;b&gt;%W&lt;/b&gt; - The current word under the cursor&lt;br&gt;
+&lt;/p&gt;
+&lt;p&gt;If any of the used placeholders cannot be evaluated (for example
+if you use %T but there is no current selection), the tool will not be
+executed.&lt;/p&gt;</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>menutextEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The text that appears in the Tools-Menu</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>okButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KURLRequester" row="2" column="1">
+ <property name="name">
+ <cstring>execEdit</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The path and name of the application to execute</string>
+ </property>
+ </widget>
+ <widget class="KDevApplicationTree" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>tree</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>KDevApplicationTree</class>
+ <header location="local">kapplicationtree.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4350">789c6dd7594f23471007f0f7fd14d6d6db2aaaf58c3db647511eb831b7317794879ac30760cc61c010e5bba7dcf5af5688167664fdb66bbaababbb67cccf1f8dab93c3c68f9fdf5e16b298968d7222cf8d1fd5eb6cf6f1e75f7ffcfded7b9a3656ff9aad46fafdb76fdf078b46d9389a3fd42bf04841699e964933b830b79a7019dd0b96955b895b5a703bcd572e08eea576ff6570ae0eedd477b792103f854b8b2fc6d1163f77237e646e37113f89b6f8307e3bf1785a8b0eedbc696eb7ad9db7e01ee6476ee4ffe0c6fd158c7c69182cde4eec6e87fea50dfbf8176e6ba7d07f96669999cfa325ccaf862bcc97a36dbccf60f178cee11cde706761f16917ae30fe6b7488a7851bf14d7327417f676eb4f756eea41e2f57e6d83e83919f6cba117f04235fd9765b3b0fa36dfc398cf973edc67a6fb951ffe768ab6765ee26b8dff213ef5f4630e2b9e7463ea7ee8ee5ff60ee2618af8eb6fe3238437eb91bf1299cdbfacad3cadd5617f5a11738c7fe4adcb8ffd68d7aeec15e8fc3683b9f62ee2518ef33dafa3f75e3bc957086f86eb4d56f3db8e8e6dd56f01a5cc1bbe65e629673d8ebd18d0efdc9058cf9f2c08df9e630ce037db8719ec37c7a9a7fb708f10267b65e7cef46fb3e9ca3fd23dad6ef0cf67abe99f304f95ec3a8871cbb71be52d8d777e8b6fee412f6f958be3adf5ea817b561afe7d86ded7c67ce13c46fc37ede2766c17a17059cd9f38e466e8c3f8eb6fd700f0b9ef7095c37cd3d37de178f2be76dcf876fa343bd790267f012f67a77cc319f69b4ed872e2ca8e732daeabfe3c6fa9cc235f21f9b8bd4f2a5cd687bfedbfd659ee7ede017b842becf6eb44fa3cbd0df8559b0ffe808ceb0ff37e01afba3652e52cc87a26dbe276ecca7097790ff73b4cdef0616ac4fdf6df1c2d1d67ee8c6f80318eb4bd1180ff529513f0ecf7b694b62f5a002ceccb2662e523c2fb7605f9f0fd8fbbf75e3bc2dcd3e9ebcb9f17ce8c05e8f83685bcf701e44eb2db65e4fd1b65eebe62245be53b8c6f3ffdd8dfd3933fbf884761f5f0edcd88f951bf118bf44bde926dae24fe01ae7af76e3f9169e2f45bb143c0f5fdcf6fea23b18f773eac6f3e63ddac6db75e37df5e8c6fbae65aebcde6d37beaf84f528aa52f03c9dc3359ea79939c627d136deab1befaf75b883ef23e76e3ccfaea36d7dc2f795322b05ebfb0ad738af7db7ad371f99fd7e59b8b13f276e9cdf1318f5e54337e6d78cb67cf761ec170efba1acaa1afd9db92d3f3a36d729ea77efc6f33cbccf2beddfe6478fe6d85e45dbfd851bf1577007f5d877e3bc86f5a9ea3a2d6cffdfc1debe116df5db73a39e37b0e777191dda257c7fa83b6e8a2eaae00eeceb13d6b7d69f325b79b058fd32b170c1a55ebffaac2ccae2b9e6118f79c253bd6ef9ee3fd7587fef79c60f7acf3cc617fcc84ffcac6d8ffcc20b7ee5377ee7257ff027aff1bac66ff0269716cf5b1ab7cd3bbcabb17ddee37d3ee0433ee2633ee1019ff290cff89c2ff89229c48b66f1ac3d5df135df7093134eb9c56dcef4b3c35dee71ce393111dbfa8c784a4205955451cd1d1ad1982634a55bbad3f80eddd38c1ef882e66cf52ab5ff2b8d7ea4277aa6175ad06bb866f446efb4d4df0ffad4fed762ffb7b44e1b9cd2266dd142c75e5ddb3cd0bb3e347a477bd9d5f83ee245e3f7689f0ee830f67d44c77412ee186946033aa5e197fecfe85c7bf7be2fe892aee89a6ea84989f6bfa434f4eff9df52c509b5d0779b32ea684d13ea528f728d1e882ebfce37f6cf077422b4ea5b440ad14af1a15452ab473aee52c65ff39789b64fe955f44eb9937b5d858c5b32d377c0c32a7fee7ecd5fe61aff284ff22c2fb290577993775db1443fb53ef2219f5ff2bf93356d5b970dd9d41eb77820dbb223bbab155ed55ffab2f725ffb1eccb81aed6931cca116ab490633909d10339fd5ffdef795d869ae7923bc27226e772415d5986b51d683663b9d4fcfbb1ff190fe54aaec35aeaa577ee20f24673e94b531249a585fc2b69ebfe3ed7dae91f75ba964b5c03e9d344ba1add93bce0826c3f87f3b2a9fb6f18aeba10ba2f563f25eb1b563771a5d17531e2513c5fba538b3111cd690dd73c7ef6a95f4c8aa99de12fe77da4951de9ffffea730be7fd9fdfbffd0b690edc6c</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>okButton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_tool_dialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>add_tool_dialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>tree</tabstop>
+ <tabstop>menutextEdit</tabstop>
+ <tabstop>execEdit</tabstop>
+ <tabstop>paramEdit</tabstop>
+ <tabstop>capturedBox</tabstop>
+ <tabstop>okButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="local" impldecl="in implementation">addtooldlg.ui.h</include>
+</includes>
+<forwards>
+ <forward>class QListViewItem;</forward>
+</forwards>
+<slots>
+ <slot>init()</slot>
+ <slot returnType="QString">getApp()</slot>
+ <slot access="private">treeSelectionChanged( QListViewItem * lvi )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/tools/addtooldlg.ui.h b/parts/tools/addtooldlg.ui.h
new file mode 100644
index 00000000..d01c4da7
--- /dev/null
+++ b/parts/tools/addtooldlg.ui.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename slots use Qt Designer which will
+** update this file, preserving your code. Create an init() slot in place of
+** a constructor, and a destroy() slot in place of a destructor.
+*****************************************************************************/
+
+#include <qheader.h>
+#include <kurlrequester.h>
+#include "kapplicationtree.h"
+
+void AddToolDialog::init()
+{
+ connect( tree, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(treeSelectionChanged(QListViewItem*)) );
+ tree->header()->hide();
+}
+
+QString AddToolDialog::getApp()
+{
+ return execEdit->url() + " " + paramEdit->text();
+}
+
+void AddToolDialog::treeSelectionChanged( QListViewItem * lvi )
+{
+ KDevAppTreeListItem* item = dynamic_cast<KDevAppTreeListItem*> ( lvi );
+ if ( !item || item->isDirectory() )
+ return;
+ execEdit->setURL( item->executable() );
+ menutextEdit->setText( item->text( 0 ) );
+}
diff --git a/parts/tools/kapplicationtree.cpp b/parts/tools/kapplicationtree.cpp
new file mode 100644
index 00000000..dd33e851
--- /dev/null
+++ b/parts/tools/kapplicationtree.cpp
@@ -0,0 +1,258 @@
+/* This file is part of the KDE libraries
+ Nicked from KDElibs since KDevApplicationTree is not a public class..
+
+ Copyright (C) 1997 Torben Weis <weis@stud.uni-frankfurt.de>
+ Copyright (C) 1999 Dirk A. Mueller <dmuell@gmx.net>
+ Portions copyright (C) 1999 Preston Brown <pbrown@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qdialog.h>
+#include <qpixmap.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qtooltip.h>
+#include <qstyle.h>
+
+#include <kapplication.h>
+#include <kbuttonbox.h>
+#include <kcombobox.h>
+#include <kdesktopfile.h>
+#include <kdialog.h>
+#include <kglobal.h>
+#include <klineedit.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kmimemagic.h>
+#include <krun.h>
+#include <kstandarddirs.h>
+#include <kstringhandler.h>
+#include <kuserprofile.h>
+#include <kurlcompletion.h>
+#include <kurlrequester.h>
+#include <dcopclient.h>
+#include <kmimetype.h>
+#include <kservicegroup.h>
+#include <klistview.h>
+#include <ksycoca.h>
+#include <kdebug.h>
+
+#include "kapplicationtree.h"
+
+template class QPtrList<QString>;
+
+#define SORT_SPEC (QDir::DirsFirst | QDir::Name | QDir::IgnoreCase)
+
+
+// ----------------------------------------------------------------------
+
+KDevAppTreeListItem::KDevAppTreeListItem( KListView* parent, const QString & name,
+ const QPixmap& pixmap, bool parse, bool dir, const QString& p, const QString& c, const QString& dE )
+ : QListViewItem( parent, name )
+{
+ init(pixmap, parse, dir, p, c, dE);
+}
+
+
+// ----------------------------------------------------------------------
+
+KDevAppTreeListItem::KDevAppTreeListItem( QListViewItem* parent, const QString & name,
+ const QPixmap& pixmap, bool parse, bool dir, const QString& p, const QString& c, const QString& dE )
+ : QListViewItem( parent, name )
+{
+ init(pixmap, parse, dir, p, c, dE);
+}
+
+
+// ----------------------------------------------------------------------
+
+void KDevAppTreeListItem::init(const QPixmap& pixmap, bool parse, bool dir, const QString& _path, const QString& _exec, const QString& _dEntry)
+{
+ setPixmap(0, pixmap);
+ parsed = parse;
+ directory = dir;
+ path = _path; // relative path
+ exec = _exec;
+ dEntry = _dEntry;
+ exec.simplifyWhiteSpace();
+ exec.truncate(exec.find(' '));
+}
+
+
+// ----------------------------------------------------------------------
+// Ensure that dirs are sorted in front of files and case is ignored
+
+QString KDevAppTreeListItem::key(int column, bool /*ascending*/) const
+{
+ if (directory)
+ return QString::fromLatin1(" ") + text(column).upper();
+ else
+ return text(column).upper();
+}
+
+void KDevAppTreeListItem::activate()
+{
+ if ( directory )
+ setOpen(!isOpen());
+}
+
+void KDevAppTreeListItem::setOpen( bool o )
+{
+ if( o && !parsed ) { // fill the children before opening
+ ((KDevApplicationTree *) parent())->addDesktopGroup( path, this );
+ parsed = true;
+ }
+ QListViewItem::setOpen( o );
+}
+
+bool KDevAppTreeListItem::isDirectory()
+{
+ return directory;
+}
+
+// ----------------------------------------------------------------------
+
+KDevApplicationTree::KDevApplicationTree( QWidget *parent, const char* name )
+ : KListView( parent, name ), currentitem(0)
+{
+ addColumn( i18n("Known Applications") );
+ setRootIsDecorated( true );
+
+ addDesktopGroup( QString::null );
+
+ connect( this, SIGNAL( currentChanged(QListViewItem*) ), SLOT( slotItemHighlighted(QListViewItem*) ) );
+ connect( this, SIGNAL( selectionChanged(QListViewItem*) ), SLOT( slotSelectionChanged(QListViewItem*) ) );
+}
+
+// ----------------------------------------------------------------------
+
+bool KDevApplicationTree::isDirSel()
+{
+ if (!currentitem) return false; // if currentitem isn't set
+ return currentitem->isDirectory();
+}
+
+// ----------------------------------------------------------------------
+
+void KDevApplicationTree::addDesktopGroup( QString relPath, KDevAppTreeListItem *item)
+{
+ KServiceGroup::Ptr root = KServiceGroup::group(relPath);
+ KServiceGroup::List list = root->entries();
+
+ KDevAppTreeListItem * newItem;
+ for( KServiceGroup::List::ConstIterator it = list.begin();
+ it != list.end(); it++)
+ {
+ QString icon;
+ QString text;
+ QString relPath;
+ QString exec;
+ QString dEntry;
+ bool isDir = false;
+ KSycocaEntry *p = (*it);
+ if (p->isType(KST_KService))
+ {
+ KService *service = static_cast<KService *>(p);
+ icon = service->icon();
+ text = service->name();
+ exec = service->exec();
+ dEntry = service->desktopEntryPath();
+ }
+ else if (p->isType(KST_KServiceGroup))
+ {
+ KServiceGroup *serviceGroup = static_cast<KServiceGroup *>(p);
+ icon = serviceGroup->icon();
+ text = serviceGroup->caption();
+ relPath = serviceGroup->relPath();
+ isDir = true;
+ if ( text[0] == '.' ) // skip ".hidden" like kicker does
+ continue;
+ // avoid adding empty groups
+ KServiceGroup::Ptr subMenuRoot = KServiceGroup::group(relPath);
+ if (subMenuRoot->childCount() == 0)
+ continue;
+ }
+ else
+ {
+ kdWarning(250) << "KServiceGroup: Unexpected object in list!" << endl;
+ continue;
+ }
+
+ QPixmap pixmap = SmallIcon( icon );
+
+ if (item)
+ newItem = new KDevAppTreeListItem( item, text, pixmap, false, isDir,
+ relPath, exec, dEntry );
+ else
+ newItem = new KDevAppTreeListItem( this, text, pixmap, false, isDir,
+ relPath, exec, dEntry );
+ if (isDir)
+ newItem->setExpandable( true );
+ }
+}
+
+
+// ----------------------------------------------------------------------
+
+void KDevApplicationTree::slotItemHighlighted(QListViewItem* i)
+{
+ // i may be 0 (see documentation)
+ if(!i)
+ return;
+
+ KDevAppTreeListItem *item = (KDevAppTreeListItem *) i;
+
+ currentitem = item;
+
+ if( (!item->directory ) && (!item->exec.isEmpty()) )
+ emit highlighted( item->text(0), item->exec );
+}
+
+
+// ----------------------------------------------------------------------
+
+void KDevApplicationTree::slotSelectionChanged(QListViewItem* i)
+{
+ // i may be 0 (see documentation)
+ if(!i)
+ return;
+
+ KDevAppTreeListItem *item = (KDevAppTreeListItem *) i;
+
+ currentitem = item;
+
+ if( ( !item->directory ) && (!item->exec.isEmpty() ) )
+ emit selected( item->text(0), item->exec );
+}
+
+// ----------------------------------------------------------------------
+
+void KDevApplicationTree::resizeEvent( QResizeEvent * e)
+{
+ setColumnWidth(0, width()-QApplication::style().pixelMetric(QStyle::PM_ScrollBarExtent));
+ KListView::resizeEvent(e);
+}
+
+
+
+#include "kapplicationtree.moc"
+
diff --git a/parts/tools/kapplicationtree.h b/parts/tools/kapplicationtree.h
new file mode 100644
index 00000000..7c11870a
--- /dev/null
+++ b/parts/tools/kapplicationtree.h
@@ -0,0 +1,102 @@
+/* This file is part of the KDE libraries
+ Copyright (C) 2000 David Faure <faure@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+#ifndef __KDevApplicationTree_h__
+#define __KDevApplicationTree_h__
+
+#include <kurl.h>
+#include <klistview.h>
+
+class KURLRequester;
+
+class QWidget;
+class QCheckBox;
+class QPushButton;
+class QLabel;
+class QStringList;
+
+
+/* ------------------------------------------------------------------------- */
+
+/**
+ * @internal
+ */
+class KDevAppTreeListItem : public QListViewItem
+{
+ bool parsed;
+ bool directory;
+ QString path;
+ QString exec;
+ QString dEntry;
+
+protected:
+ QString key(int column, bool ascending) const;
+
+ void init(const QPixmap& pixmap, bool parse, bool dir, const QString& _path, const QString& _exec, const QString& _dEntry);
+
+public:
+ KDevAppTreeListItem( KListView* parent, const QString & name, const QPixmap& pixmap,
+ bool parse, bool dir, const QString& p, const QString& c, const QString& dE );
+ KDevAppTreeListItem( QListViewItem* parent, const QString & name, const QPixmap& pixmap,
+ bool parse, bool dir, const QString& p, const QString& c, const QString& dE );
+ bool isDirectory();
+
+ QString desktopEntryPath() const { return dEntry; }
+ QString executable() const { return exec; }
+
+protected:
+ virtual void activate();
+ virtual void setOpen( bool o );
+
+ friend class KDevApplicationTree;
+};
+
+/* ------------------------------------------------------------------------- */
+
+/**
+ * @internal
+ */
+class KDevApplicationTree : public KListView
+{
+ Q_OBJECT
+public:
+ KDevApplicationTree( QWidget *parent, const char* name = 0 );
+
+ /**
+ * Add a group of .desktop/.kdelnk entries
+ */
+ void addDesktopGroup( QString relPath, KDevAppTreeListItem *item = 0 );
+
+ bool isDirSel();
+
+protected:
+ void resizeEvent( QResizeEvent *_ev );
+ KDevAppTreeListItem* currentitem;
+
+public slots:
+ void slotItemHighlighted(QListViewItem* i);
+ void slotSelectionChanged(QListViewItem* i);
+
+signals:
+ void selected( const QString& _name, const QString& _exec );
+ void highlighted( const QString& _name, const QString& _exec );
+};
+
+/* ------------------------------------------------------------------------- */
+
+#endif
diff --git a/parts/tools/kdevpart_tools.rc b/parts/tools/kdevpart_tools.rc
new file mode 100644
index 00000000..ab8a6a98
--- /dev/null
+++ b/parts/tools/kdevpart_tools.rc
@@ -0,0 +1,14 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="tools" library="libtoolsplugin" version="1">
+<MenuBar>
+ <Menu name="tools">
+ <text>&amp;Tools</text>
+ <ActionList name="tools_list"/>
+ <ActionList name="tools2_list"/>
+ </Menu>
+</MenuBar>
+<ToolBar position="Top" iconText="IconOnly" noMerge="1" name="extraToolBar" fullWidth="false" hidden="true" >
+ <text>Tools Toolbar</text>
+ <ActionList name="tools_list"/>
+</ToolBar>
+</kpartplugin>
diff --git a/parts/tools/kdevtools.desktop b/parts/tools/kdevtools.desktop
new file mode 100644
index 00000000..5e245562
--- /dev/null
+++ b/parts/tools/kdevtools.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=This plugin provides an easy way to add external applications to the Tools menu and toolbar.
+Comment[ca]=Aquest connector proporciona un mètode fàcil per afegir aplicacions externes en el menú Eines i a la barra d'eines.
+Comment[da]=Dette plugin sørger for en nem måde at tilføje eksterne programmer til værktøjsmenuen og værktøjslinjen.
+Comment[de]=Dieses Modul erleichtert das Hinzufügen externer Anwendungen zum Menü "Werkzeuge" und in die Werkzeugleiste.
+Comment[el]=Αυτό το πρόσθετο προσφέρει μια εύκολη μέθοδο για τη προσθήκη εξωτερικών εφαρμογών στο μενού εργαλείων και τη γραμμή εργαλείων.
+Comment[es]=Este complemento proporciona un método sencillo para añadir aplicaciones externas en el menú de Herramientas y en la barra de herramientas.
+Comment[et]=See plugin võimaldab hõlpsasti lisada väliseid rakendusi tööriistade menüüsse ja tööriistaribale.
+Comment[eu]=Plugin honek kanpoko aplikazioak Tresnak menu eta tresna-barran erraz gehitzeko aukera eskeintzen du.
+Comment[fa]=این وصله، راه آسانی را برای افزودن کاربردهای خارجی به گزینگان ابزار و میله ابزار فراهم می‌کند.
+Comment[fr]=Ce module externe fournit un moyen facile d'ajouter des applications externes au menu « Outils » et à la barre d'outils.
+Comment[gl]=Esta extensión proporciona un método sinxelo para engadir aplicacións externas ao menú Ferramentas e á barra de ferramentas.
+Comment[hu]=Ez a bővítőmodul lehetővé teszi az Eszközök menü és az eszköztár egyszerű kibővítését
+Comment[it]=Questo plugin offre un modo per aggiungere applicazioni esterne al menu o alla barra degli strumenti.
+Comment[ja]=このプラグインはツールメニューやツールバーに外部のアプリケーションを追加する簡単な方法を提供します。
+Comment[ms]=Plugin ini menyediakan cara mudah untuk menambah aplikasi luaran ke menu Alatan dan bar alatan.
+Comment[nds]=Mit dit Moduul laat sik extern Programmen eenfach na dat "Warktüüch"-Menü un den Warktüüchbalken tofögen.
+Comment[ne]=यो प्लगइनले उपकरण मेनु र उपकरणपट्टीमा बाह्य अनुप्रयोग थप्न सजिलो तरिका प्रदान गर्दछ ।
+Comment[nl]=Met deze plugin kunt u op eenvoudige wijze externe toepassingen aan het menu Gereedschap en de werkbalk toevoegen.
+Comment[pl]=Ta wtyczka umożliwia łatwe dodawanie zewnętrznych programów do menu Narzędzia i do paska narzędzi.
+Comment[pt]=Este 'plugin' oferece uma forma simples de adicionar as aplicações externas ao menu Ferramentas e à barra de ferramentas.
+Comment[pt_BR]=Este plug-in fornece uma maneira fácil de adicionar aplicativos externos ao menu Ferramentas e barra de ferramentas.
+Comment[ru]=Предоставляет возможности добавления в меню пунктов вызова внешних приложений.
+Comment[sk]=Modul poskytuje jednoduchý spôsob ako pridať externú aplikáciu do menu Nástroje a do panelu nástrojov.
+Comment[sl]=Ta vstavek omogoča preprost način dodajanja zunanjih programov v meni Orodja in v orodjarno.
+Comment[sr]=Овај прикључак обезбеђује лак начин за додавање спољних програма у мени „Алати“ и у траку са алатом.
+Comment[sr@Latn]=Ovaj priključak obezbeđuje lak način za dodavanje spoljnih programa u meni „Alati“ i u traku sa alatom.
+Comment[sv]=Insticksprogrammet tillhandahåller ett enkelt sätt att lägga till yttre program i verktygsmenyn och verktygsraden.
+Comment[ta]=இந்த சொருகி கருவிப்பட்டியல் மற்றும் கருவிப்பட்டையில் வெளிபுற பயன்பாடு எளிய முறையில் சேர்க்கலாம்.
+Comment[tg]=Барои илова намудан дар меню нуқтаҳои ҷеғ задани гузоришҳои берунро имкон медиҳад.
+Comment[zh_CN]=这个插件提供向工具菜单和工具栏添加外部程序的方法。
+Comment[zh_TW]=此外掛程式提供一個簡單的方式,將外部應用程式新增到工具選單與工具列中。
+Name=KDevTools
+Name[da]=KDevelop Værktøjer
+Name[de]="Werkzeug"-Menüerweiterung (KDevelop)
+Name[hi]=के-डेव-टूल्स
+Name[nds]=Warktüüch-Menüverwiedern (KDevelop)
+Name[pl]=KDevNarzędzia
+Name[sk]=KDev nástroje
+Name[sv]=KDevelop verktyg
+Name[ta]=KDev கருவிகள்
+Name[tg]=Асбобҳои KDev
+Name[zh_TW]=KDevelop 工具
+GenericName=Tools Menu Addition
+GenericName[ca]=Afegiment al menú Eines
+GenericName[da]=Værktøjsmenu tilføjelse
+GenericName[de]="Werkzeuge"-Menüerweiterung
+GenericName[el]=Προσθήκη μενού εργαλείων
+GenericName[es]=Añadir al menú Herramientas
+GenericName[et]=Tööriistade menüü lisamine
+GenericName[eu]=Tresnak menuan gehitu
+GenericName[fa]=افزودن گزینگان ابزار
+GenericName[fr]=Ajout au menu « Outils »
+GenericName[gl]=Engadidos ao menú Ferramentas
+GenericName[hu]=Bővítés az Eszközök menühöz
+GenericName[it]=Aggiunte al menu Strumenti
+GenericName[ja]=ツールメニュー追加
+GenericName[nds]=Warktüüch-Menüverwiedern
+GenericName[ne]=उपकरण मेनु अतिरिक्त
+GenericName[nl]=Gereedschapsmenu-toevoeging
+GenericName[pl]=Dodatek do menu Narzędzia
+GenericName[pt]=Adicionar ao Menu de Ferramentas
+GenericName[pt_BR]=Adição ao Menu Ferramentas
+GenericName[ru]=Дополнение меню инструментов
+GenericName[sk]=Prídavky menu Nástroje
+GenericName[sl]=Dodatek menija orodij
+GenericName[sr]=Додаци менију „Алати“
+GenericName[sr@Latn]=Dodaci meniju „Alati“
+GenericName[sv]=Tillägg i verktygsmenyn
+GenericName[ta]=கருவிப்பட்டியல் சேர்ப்பு
+GenericName[tg]=Асбобҳои иловагии меню
+GenericName[tr]=Araçlar Menü Eklemesi
+GenericName[zh_CN]=工具菜单附加
+GenericName[zh_TW]=新增工具選單
+Icon=configure
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevtools
+X-KDevelop-Version=5
+X-KDevelop-Scope=Global
+X-KDevelop-Properties=AdditionalTools
diff --git a/parts/tools/tools_part.cpp b/parts/tools/tools_part.cpp
new file mode 100644
index 00000000..f4285546
--- /dev/null
+++ b/parts/tools/tools_part.cpp
@@ -0,0 +1,272 @@
+#include "tools_part.h"
+
+#include <qfile.h>
+#include <qpopupmenu.h>
+#include <qregexp.h>
+#include <qtimer.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+
+#include <kaction.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kdesktopfile.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <kprocess.h>
+#include <ktexteditor/document.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevpartcontroller.h"
+#include "kdevappfrontend.h"
+#include "kdevplugininfo.h"
+#include "urlutil.h"
+#include "configwidgetproxy.h"
+#include "kdeveditorutil.h"
+
+#include "toolsconfig.h"
+#include "toolsconfigwidget.h"
+
+#define TOOLSSETTINGS 1
+#define EXTRATOOLSSETTINGS 2
+
+static const KDevPluginInfo data("kdevtools");
+K_EXPORT_COMPONENT_FACTORY( libkdevtools, ToolsFactory( data ) )
+
+QMap<int, QString> externalToolMenuEntries;
+
+ToolsPart::ToolsPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin( &data, parent, name ? name : "ToolsPart")
+{
+ setInstance(ToolsFactory::instance());
+
+ setXMLFile("kdevpart_tools.rc");
+
+ m_configProxy = new ConfigWidgetProxy( core() );
+ m_configProxy->createGlobalConfigPage( i18n("Tools Menu"), TOOLSSETTINGS, info()->icon() );
+ m_configProxy->createGlobalConfigPage( i18n("External Tools"), EXTRATOOLSSETTINGS, info()->icon() );
+ connect( m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+
+ connect(core(), SIGNAL(coreInitialized()), this, SLOT(updateMenu()));
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+
+ // Apparently action lists can only be plugged after the
+ // xmlgui client has been registered
+ QTimer::singleShot(0, this, SLOT(updateToolsMenu()));
+}
+
+
+ToolsPart::~ToolsPart()
+{
+ delete m_configProxy;
+}
+
+void ToolsPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ if ( pagenumber == TOOLSSETTINGS )
+ {
+ ToolsConfig *w = new ToolsConfig( page, "tools config widget" );
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ connect(dlg, SIGNAL(destroyed()), this, SLOT(updateMenu()));
+ }
+ else if ( pagenumber == EXTRATOOLSSETTINGS )
+ {
+ ToolsConfigWidget *w2 = new ToolsConfigWidget( page, "tools config widget" );
+ connect(dlg, SIGNAL(okClicked()), w2, SLOT(accept()));
+ connect(dlg, SIGNAL(destroyed()), this, SLOT(updateToolsMenu()));
+ }
+}
+
+void ToolsPart::updateMenu()
+{
+ QPtrList<KAction> actions;
+
+ unplugActionList("tools_list");
+
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Tools");
+
+ QStringList list = config->readListEntry("Tools");
+ for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+ {
+ QString name = *it;
+
+ KDesktopFile df(name, true);
+ if (df.readName().isNull())
+ continue;
+
+ KAction *action = new KAction(df.readName(), df.readIcon(), 0,
+ this, SLOT(slotToolActivated()), (QObject*)0, name.latin1());
+ actions.append(action);
+ }
+
+ plugActionList("tools_list", actions);
+}
+
+
+void ToolsPart::slotToolActivated()
+{
+ QString df = sender()->name();
+ kapp->startServiceByDesktopPath(df);
+}
+
+void ToolsPart::startCommand(QString cmdline, bool captured, QString fileName)
+{
+ KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( partController()->activePart() );
+
+ if ( fileName.isNull() && doc )
+ fileName = doc->url().path();
+
+ QString projectDirectory;
+ if (project())
+ projectDirectory = project()->projectDirectory();
+
+ QString selection = KDevEditorUtil::currentSelection( doc );
+ if ( !selection.isEmpty() )
+ selection = KShellProcess::quote( selection );
+
+ QString word = KDevEditorUtil::currentWord( doc );
+
+ // This should really be checked before inserting into the popup
+ if (cmdline.contains("%D") && projectDirectory.isNull())
+ return;
+ cmdline.replace(QRegExp("%D"), projectDirectory);
+
+ if (cmdline.contains("%S") && fileName.isNull())
+ return;
+ cmdline.replace(QRegExp("%S"), fileName);
+
+ if (cmdline.contains("%T") && selection.isNull())
+ return;
+ cmdline.replace(QRegExp("%T"), selection);
+
+ if (cmdline.contains("%W") && word.isNull())
+ return;
+ cmdline.replace(QRegExp("%W"), word);
+
+ if (captured)
+ {
+ if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
+ appFrontend->startAppCommand(QString::QString(), cmdline, false);
+ }
+ else
+ {
+ KShellProcess proc;
+ proc << cmdline;
+ proc.start(KProcess::DontCare, KProcess::NoCommunication);
+ }
+}
+
+
+void ToolsPart::updateToolsMenu()
+{
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("External Tools");
+ QStringList l = config->readListEntry("Tool Menu");
+
+
+ QPtrList<KAction> actions;
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it) {
+ QString menutext = *it;
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Tool Menu " + menutext);
+ bool isdesktopfile = config->readBoolEntry("DesktopFile");
+ KAction *action = new KAction(*it, 0,
+ this, SLOT(toolsMenuActivated()),
+ (QObject*) 0, menutext.utf8());
+ if (isdesktopfile) {
+ KDesktopFile df(config->readPathEntry("CommandLine"));
+ action->setIcon(df.readIcon());
+ }
+ actions.append(action);
+ }
+
+ unplugActionList("tools2_list");
+ plugActionList("tools2_list", actions);
+}
+
+
+void ToolsPart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (!context->hasType( Context::FileContext ))
+ return;
+
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+ m_contextPopup = popup;
+ m_contextFileName = fcontext->urls().first().path();
+ externalToolMenuEntries.clear();
+
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("External Tools");
+ QStringList filecontextList = config->readListEntry("File Context");
+
+ if (URLUtil::isDirectory(m_contextFileName)) {
+ QStringList l = config->readListEntry("Dir Context");
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it)
+ externalToolMenuEntries.insert( popup->insertItem( (*it), this, SLOT(dirContextActivated(int)) ), (*it) );
+ } else {
+ QStringList l = config->readListEntry("File Context");
+ QStringList::ConstIterator it;
+ for (it = l.begin(); it != l.end(); ++it)
+ externalToolMenuEntries.insert( popup->insertItem( (*it), this, SLOT(fileContextActivated(int)) ), (*it) );
+ }
+}
+
+
+void ToolsPart::toolsMenuActivated()
+{
+ QString menutext = sender()->name();
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Tool Menu " + menutext);
+ QString cmdline = config->readPathEntry("CommandLine");
+ bool isdesktopfile = config->readBoolEntry("DesktopFile");
+ bool captured = config->readBoolEntry("Captured");
+ kdDebug() << "tools:" << "activating " << menutext
+ << "with cmdline " << cmdline
+ << "and desktopfile " << isdesktopfile << endl;
+ if (isdesktopfile)
+ kapp->startServiceByDesktopPath(cmdline);
+ else
+ startCommand(cmdline, captured, QString::null);
+}
+
+
+void ToolsPart::fileContextActivated(int id)
+{
+ QString menutext = externalToolMenuEntries[ id ];
+
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("File Context " + menutext);
+ QString cmdline = config->readPathEntry("CommandLine");
+ bool captured = config->readBoolEntry("Captured");
+ kdDebug() << "filecontext:" << "activating " << menutext
+ << " with cmdline " << cmdline
+ << " on file " << m_contextFileName << endl;
+ startCommand(cmdline, captured, m_contextFileName);
+}
+
+
+void ToolsPart::dirContextActivated(int id)
+{
+ QString menutext = externalToolMenuEntries[ id ];
+
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Dir Context " + menutext);
+ QString cmdline = config->readPathEntry("CommandLine");
+ bool captured = config->readBoolEntry("Captured");
+ kdDebug() << "dircontext:" << "activating " << menutext
+ << "with cmdline " << cmdline
+ << " on directory " << m_contextFileName << endl;
+ startCommand(cmdline, captured, m_contextFileName);
+}
+
+#include "tools_part.moc"
diff --git a/parts/tools/tools_part.h b/parts/tools/tools_part.h
new file mode 100644
index 00000000..b0d82c99
--- /dev/null
+++ b/parts/tools/tools_part.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2001 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_TOOLS_H__
+#define __KDEVPART_TOOLS_H__
+
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+#include <kdevgenericfactory.h>
+
+
+class QPopupMenu;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+
+class ToolsWidget;
+
+
+class ToolsPart : public KDevPlugin
+ {
+ Q_OBJECT
+
+public:
+
+ ToolsPart( QObject *parent, const char *name, const QStringList & );
+ ~ToolsPart();
+
+
+private slots:
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber );
+ void updateMenu();
+
+ void slotToolActivated();
+
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void updateToolsMenu();
+ void toolsMenuActivated();
+ void fileContextActivated(int id);
+ void dirContextActivated(int id);
+
+private:
+ void startCommand(QString cmdline, bool captured, QString fileName);
+
+ QPopupMenu *m_contextPopup;
+ QString m_contextFileName;
+ ConfigWidgetProxy * m_configProxy;
+ };
+
+typedef KDevGenericFactory<ToolsPart> ToolsFactory;
+
+#endif
diff --git a/parts/tools/toolsconfig.cpp b/parts/tools/toolsconfig.cpp
new file mode 100644
index 00000000..523fe388
--- /dev/null
+++ b/parts/tools/toolsconfig.cpp
@@ -0,0 +1,169 @@
+#include "toolsconfig.h"
+
+#include <qapplication.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+#include <qheader.h>
+
+#include <kapplication.h>
+#include <kdesktopfile.h>
+#include <kdialog.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "tools_part.h"
+#include "kapplicationtree.h"
+
+
+ToolsConfig::ToolsConfig(QWidget *parent, const char *name)
+ : QWidget(parent, name), _tree(0)
+{
+ _entries.setAutoDelete(true);
+}
+
+
+void ToolsConfig::showEvent(QShowEvent *e)
+{
+ QWidget::showEvent(e);
+
+ if (!_tree)
+ {
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ QHBoxLayout *hbox = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
+
+ QVBoxLayout *vbox = new QVBoxLayout(hbox);
+ _tree = new KDevApplicationTree(this);
+ _tree->header()->hide();
+ QLabel *l = new QLabel(_tree, i18n("&Applications:"), this);
+ l->show();
+ _tree->show();
+
+ vbox->addWidget(l);
+ vbox->addWidget(_tree);
+
+ vbox = new QVBoxLayout(hbox);
+
+ _toList = new QPushButton(QApplication::reverseLayout() ? "<<" : ">>", this);
+ _toList->show();
+ vbox->addWidget(_toList);
+
+ connect(_toList, SIGNAL(clicked()), this, SLOT(toList()));
+
+ _toTree = new QPushButton(QApplication::reverseLayout() ? ">>" : "<<", this);
+ _toTree->show();
+ vbox->addWidget(_toTree);
+
+ connect(_toTree, SIGNAL(clicked()), this, SLOT(toTree()));
+
+ vbox = new QVBoxLayout(hbox);
+ _list = new QListBox(this);
+ l = new QLabel(_list, i18n("&Tools menu:"), this);
+ l->show();
+ _list->show();
+ vbox->addWidget(l);
+ vbox->addWidget(_list);
+
+ QApplication::restoreOverrideCursor();
+ }
+
+ fill();
+ checkButtons();
+
+ connect(_tree, SIGNAL(selectionChanged()), this, SLOT(checkButtons()));
+ connect(_list, SIGNAL(selectionChanged()), this, SLOT(checkButtons()));
+}
+
+
+void ToolsConfig::checkButtons()
+{
+ _toList->setEnabled(_tree->selectedItem() && !_tree->selectedItem()->firstChild());
+ _toTree->setEnabled(_list->currentItem() >= 0 && _list->currentItem() < (int)_list->count());
+}
+
+
+void ToolsConfig::fill()
+{
+ _entries.clear();
+
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Tools");
+
+ QStringList list = config->readListEntry("Tools");
+
+ for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+ add(*it);
+}
+
+
+void ToolsConfig::add(const QString &desktopFile)
+{
+ KDesktopFile df(desktopFile, true);
+ if (df.readName().isEmpty())
+ return;
+
+ Entry *entry = new Entry;
+
+ if (!df.readIcon().isEmpty())
+ entry->icon = BarIcon(df.readIcon());
+ entry->name = df.readName();
+ entry->desktopFile = desktopFile;
+
+ _entries.append(entry);
+
+ updateList();
+
+ checkButtons();
+}
+
+
+void ToolsConfig::toList()
+{
+ KDevAppTreeListItem *item = dynamic_cast<KDevAppTreeListItem*>(_tree->selectedItem());
+ if (item && !item->desktopEntryPath().isEmpty())
+ add(item->desktopEntryPath());
+ checkButtons();
+}
+
+
+void ToolsConfig::toTree()
+{
+ _entries.remove(_list->currentItem());
+ updateList();
+ checkButtons();
+}
+
+
+void ToolsConfig::accept()
+{
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("Tools");
+
+ QStringList l;
+ QPtrListIterator<Entry> it(_entries);
+ for ( ; it.current(); ++it)
+ l.append(it.current()->desktopFile);
+
+ config->writeEntry("Tools", l);
+ config->sync();
+}
+
+
+void ToolsConfig::updateList()
+{
+ _list->setUpdatesEnabled(false);
+
+ _list->clear();
+
+ QPtrListIterator<Entry> it(_entries);
+ for ( ; it.current(); ++it)
+ _list->insertItem(it.current()->icon, it.current()->name);
+
+ _list->setUpdatesEnabled(true);
+ _list->repaint();
+}
+
+
+#include "toolsconfig.moc"
diff --git a/parts/tools/toolsconfig.h b/parts/tools/toolsconfig.h
new file mode 100644
index 00000000..5dc87d70
--- /dev/null
+++ b/parts/tools/toolsconfig.h
@@ -0,0 +1,71 @@
+#ifndef __TOOLS_CONFIG_H__
+#define __TOOLS_CONFIG_H__
+
+
+#include <qwidget.h>
+#include <qptrlist.h>
+#include <qpixmap.h>
+
+
+class QListBox;
+class QPushButton;
+class KDevApplicationTree;
+
+class Entry
+{
+public:
+
+ Entry() {};
+
+ QString name;
+ QString desktopFile;
+ QPixmap icon;
+
+};
+
+
+class ToolsConfig : public QWidget
+ {
+ Q_OBJECT
+
+public:
+
+ ToolsConfig(QWidget *parent = 0, const char *name = 0);
+
+
+public slots:
+
+ void accept();
+
+
+protected:
+
+ void showEvent(QShowEvent *);
+
+ void fill();
+ void add(const QString &desktopFile);
+ void remove(const QString &desktopFile);
+
+
+private slots:
+
+ void checkButtons();
+
+ void toList();
+ void toTree();
+
+ void updateList();
+
+
+private:
+
+ KDevApplicationTree *_tree;
+ QListBox *_list;
+ QPushButton *_toList, *_toTree;
+
+ QPtrList<Entry> _entries;
+
+ };
+
+
+#endif
diff --git a/parts/tools/toolsconfigwidget.cpp b/parts/tools/toolsconfigwidget.cpp
new file mode 100644
index 00000000..72b102be
--- /dev/null
+++ b/parts/tools/toolsconfigwidget.cpp
@@ -0,0 +1,284 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "toolsconfigwidget.h"
+
+#include <qcheckbox.h>
+#include <qlistbox.h>
+#include <qtimer.h>
+
+#include <klineedit.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <kdesktopfile.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kurl.h>
+#include <kurldrag.h>
+
+#include "addtooldlg.h"
+#include "kapplicationtree.h"
+
+
+struct ToolsConfigEntry
+{
+ QString menutext;
+ QString cmdline;
+ bool isdesktopfile;
+ bool captured;
+ bool isEmpty() const {
+ return ( menutext.isEmpty() && cmdline.isEmpty() );
+ }
+};
+
+
+ToolsConfigWidget::ToolsConfigWidget(QWidget *parent, const char *name)
+ : ToolsConfigWidgetBase(parent, name)
+{
+ m_toolsmenuEntries.setAutoDelete(true);
+ m_filecontextEntries.setAutoDelete(true);
+ m_dircontextEntries.setAutoDelete(true);
+
+ toolsmenuBox->setAcceptDrops(true);
+ toolsmenuBox->installEventFilter(this);
+ toolsmenuBox->viewport()->setAcceptDrops(true);
+ toolsmenuBox->viewport()->installEventFilter(this);
+
+ readConfig();
+}
+
+
+ToolsConfigWidget::~ToolsConfigWidget()
+{}
+
+
+void ToolsConfigWidget::readGroup(const QString &group, QDict<ToolsConfigEntry> *entryDict)
+{
+ KConfig *config = ToolsFactory::instance()->config();
+ config->setGroup("External Tools");
+ QStringList list = config->readListEntry(group);
+
+ QStringList::ConstIterator it;
+ for (it = list.begin(); it != list.end(); ++it) {
+ config->setGroup(group + " " + (*it));
+ QString cmdline = config->readPathEntry("CommandLine");
+ bool isdesktopfile = config->readBoolEntry("DesktopFile");
+ bool captured = config->readBoolEntry("Captured");
+ ToolsConfigEntry *entry = new ToolsConfigEntry;
+ entry->menutext = (*it);
+ entry->cmdline = cmdline;
+ entry->isdesktopfile = isdesktopfile;
+ entry->captured = captured;
+ entryDict->insert(*it, entry);
+ }
+}
+
+
+void ToolsConfigWidget::storeGroup(const QString &group, const QDict<ToolsConfigEntry> &entryDict)
+{
+ KConfig *config = ToolsFactory::instance()->config();
+
+ QStringList list;
+
+ QDictIterator<ToolsConfigEntry> it(entryDict);
+ for (; it.current(); ++it) {
+ ToolsConfigEntry *entry = it.current();
+ list << entry->menutext;
+ config->setGroup(group + " " + entry->menutext);
+ config->writePathEntry("CommandLine", entry->cmdline);
+ config->writeEntry("DesktopFile", entry->isdesktopfile);
+ config->writeEntry("Captured", entry->captured);
+ }
+
+ config->setGroup("External Tools");
+ config->writeEntry(group, list);
+}
+
+
+
+void ToolsConfigWidget::fillListBox(QListBox *lb, const QDict<ToolsConfigEntry> &entryDict)
+{
+ lb->clear();
+
+ QDictIterator<ToolsConfigEntry> it(entryDict);
+ for (; it.current(); ++it) {
+ ToolsConfigEntry *entry = it.current();
+ if (entry->isdesktopfile) {
+ KDesktopFile df(entry->cmdline);
+ lb->insertItem(SmallIcon(df.readIcon()), entry->menutext);
+ } else {
+ lb->insertItem(entry->menutext);
+ }
+ }
+}
+
+
+bool ToolsConfigWidget::addEntry(ToolsConfigEntry *entry, QDict<ToolsConfigEntry> *entryDict)
+{
+ QString menutext = entry->menutext;
+ if (entryDict->find(menutext)) {
+ delete entry;
+ KMessageBox::sorry(this, i18n("An entry with this title exists already."));
+ return false;
+ }
+
+ entryDict->insert(menutext, entry);
+
+ updateListBoxes();
+ return true;
+}
+
+
+void ToolsConfigWidget::readConfig()
+{
+ readGroup("Tool Menu", &m_toolsmenuEntries);
+ readGroup("File Context", &m_filecontextEntries);
+ readGroup("Dir Context", &m_dircontextEntries);
+
+ updateListBoxes();
+}
+
+
+void ToolsConfigWidget::storeConfig()
+{
+ storeGroup("Tool Menu", m_toolsmenuEntries);
+ storeGroup("File Context", m_filecontextEntries);
+ storeGroup("Dir Context", m_dircontextEntries);
+}
+
+
+void ToolsConfigWidget::updateListBoxes()
+{
+ fillListBox(toolsmenuBox, m_toolsmenuEntries);
+ fillListBox(filecontextBox, m_filecontextEntries);
+ fillListBox(dircontextBox, m_dircontextEntries);
+}
+
+
+void ToolsConfigWidget::toolsmenuaddClicked()
+{
+ AddToolDialog dlg(this);
+ dlg.setCaption(i18n("Add to Tools Menu"));
+ dlg.tree->setFocus();
+ while (dlg.exec()) {
+ ToolsConfigEntry *entry = new ToolsConfigEntry;
+ entry->menutext = dlg.menutextEdit->text();
+ entry->cmdline = dlg.getApp().stripWhiteSpace();
+ entry->isdesktopfile = false;
+ entry->captured = dlg.capturedBox->isChecked();
+ if ( entry->isEmpty() )
+ delete entry;
+ else if (addEntry(entry, &m_toolsmenuEntries))
+ return;
+ }
+}
+
+
+void ToolsConfigWidget::toolsmenuremoveClicked()
+{
+ QString menutext = toolsmenuBox->currentText();
+ m_toolsmenuEntries.remove(menutext);
+ updateListBoxes();
+}
+
+
+void ToolsConfigWidget::filecontextaddClicked()
+{
+ AddToolDialog dlg(this);
+ dlg.setCaption(i18n("Add to File Context Menus"));
+ dlg.tree->setFocus();
+ while (dlg.exec()) {
+ ToolsConfigEntry *entry = new ToolsConfigEntry;
+ entry->menutext = dlg.menutextEdit->text();
+ entry->cmdline = dlg.getApp().stripWhiteSpace();
+ entry->isdesktopfile = false;
+ entry->captured = dlg.capturedBox->isChecked();
+ if ( entry->isEmpty() )
+ delete entry;
+
+ else if (addEntry(entry, &m_filecontextEntries))
+ return;
+ }
+}
+
+
+void ToolsConfigWidget::filecontextremoveClicked()
+{
+ QString menutext = filecontextBox->currentText();
+ m_filecontextEntries.remove(menutext);
+ updateListBoxes();
+}
+
+
+void ToolsConfigWidget::dircontextaddClicked()
+{
+ AddToolDialog dlg(this);
+ dlg.setCaption(i18n("Add to Directory Context Menus"));
+ dlg.tree->setFocus();
+ if (dlg.exec()) {
+ ToolsConfigEntry *entry = new ToolsConfigEntry;
+ entry->menutext = dlg.menutextEdit->text();
+ entry->cmdline = dlg.getApp().stripWhiteSpace();
+ entry->isdesktopfile = false;
+ entry->captured = dlg.capturedBox->isChecked();
+ if ( entry->isEmpty() )
+ delete entry;
+ else if (addEntry(entry, &m_dircontextEntries))
+ return;
+ }
+}
+
+
+void ToolsConfigWidget::dircontextremoveClicked()
+{
+ QString menutext = dircontextBox->currentText();
+ m_dircontextEntries.remove(menutext);
+ updateListBoxes();
+}
+
+
+bool ToolsConfigWidget::eventFilter(QObject *o, QEvent *e)
+{
+ if (e->type() == QEvent::DragEnter || e->type() == QEvent::DragMove) {
+ QDragMoveEvent *dme = static_cast<QDragMoveEvent*>(e);
+ if (KURLDrag::canDecode(dme))
+ dme->accept();
+ return true;
+ } else if (e->type() == QEvent::Drop) {
+ QDropEvent *de = static_cast<QDropEvent*>(e);
+ KURL::List fileList;
+ if (KURLDrag::decode(de, fileList)) {
+ KURL::List::ConstIterator it;
+ for (it = fileList.begin(); it != fileList.end(); ++it) {
+ if ((*it).isLocalFile() && KDesktopFile::isDesktopFile((*it).path())) {
+ KDesktopFile df((*it).path());
+ ToolsConfigEntry *entry = new ToolsConfigEntry;
+ entry->menutext = df.readName();
+ entry->cmdline = (*it).path();
+ entry->isdesktopfile = true;
+ entry->captured = false;
+ addEntry(entry, &m_toolsmenuEntries);
+ }
+ }
+ }
+ return true;
+ }
+
+ return ToolsConfigWidgetBase::eventFilter(o, e);
+}
+
+
+void ToolsConfigWidget::accept()
+{
+ storeConfig();
+}
+#include "toolsconfigwidget.moc"
diff --git a/parts/tools/toolsconfigwidget.h b/parts/tools/toolsconfigwidget.h
new file mode 100644
index 00000000..51e1b005
--- /dev/null
+++ b/parts/tools/toolsconfigwidget.h
@@ -0,0 +1,60 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _TOOLSCONFIGWIDGET_H_
+#define _TOOLSCONFIGWIDGET_H_
+
+#include "toolsconfigwidgetbase.h"
+#include "tools_part.h"
+#include <qdict.h>
+
+
+struct ToolsConfigEntry;
+
+
+class ToolsConfigWidget : public ToolsConfigWidgetBase
+{
+ Q_OBJECT
+
+public:
+ ToolsConfigWidget(QWidget *parent=0, const char *name=0);
+ ~ToolsConfigWidget();
+
+public slots:
+ void accept();
+
+private:
+ virtual void toolsmenuaddClicked();
+ virtual void toolsmenuremoveClicked();
+ virtual void filecontextaddClicked();
+ virtual void filecontextremoveClicked();
+ virtual void dircontextaddClicked();
+ virtual void dircontextremoveClicked();
+
+ virtual bool eventFilter(QObject *o, QEvent *e);
+
+ void readGroup(const QString &group, QDict<ToolsConfigEntry> *entryDict);
+ void storeGroup(const QString &group, const QDict<ToolsConfigEntry> &entryDict);
+ void fillListBox(QListBox *lb, const QDict<ToolsConfigEntry> &entryDict);
+ bool addEntry(ToolsConfigEntry *entry, QDict<ToolsConfigEntry> *entryDict);
+
+ void readConfig();
+ void storeConfig();
+ void updateListBoxes();
+
+ QDict<ToolsConfigEntry> m_toolsmenuEntries;
+ QDict<ToolsConfigEntry> m_filecontextEntries;
+ QDict<ToolsConfigEntry> m_dircontextEntries;
+
+ ToolsPart *m_part;
+};
+
+#endif
diff --git a/parts/tools/toolsconfigwidgetbase.ui b/parts/tools/toolsconfigwidgetbase.ui
new file mode 100644
index 00000000..5b8baab0
--- /dev/null
+++ b/parts/tools/toolsconfigwidgetbase.ui
@@ -0,0 +1,410 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ToolsConfigWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>tools_config_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>541</width>
+ <height>376</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>External Tools</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabwidget</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>toolmenuTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Tools Menu</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListBox" row="0" column="0">
+ <property name="name">
+ <cstring>toolsmenuBox</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout4_3</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer9_3</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>toolsmenuaddButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>toolsmenuremoveButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer10_3</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>
+ </vbox>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer11_3</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>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>filecontextTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;File Context Menu</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListBox" row="0" column="0">
+ <property name="name">
+ <cstring>filecontextBox</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout4_2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer9_2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>filecontextaddButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>filecontextremoveButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer10_2</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>
+ </vbox>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer11_2</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>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>dircontextTab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Directory Context Menu</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListBox" row="0" column="0">
+ <property name="name">
+ <cstring>dircontextBox</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer9</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>dircontextaddButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>dircontextremoveButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer10</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>
+ </vbox>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>Spacer11</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>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>filecontextaddButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>filecontextaddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>dircontextaddButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>dircontextaddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>dircontextremoveButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>dircontextremoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>filecontextremoveButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>filecontextremoveClicked()</slot>
+ </connection>
+ <connection>
+ <sender>toolsmenuaddButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>toolsmenuaddClicked()</slot>
+ </connection>
+ <connection>
+ <sender>toolsmenuremoveButton</sender>
+ <signal>clicked()</signal>
+ <receiver>tools_config_widget</receiver>
+ <slot>toolsmenuremoveClicked()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>toolsmenuBox</tabstop>
+ <tabstop>toolsmenuaddButton</tabstop>
+ <tabstop>toolsmenuremoveButton</tabstop>
+ <tabstop>tabwidget</tabstop>
+ <tabstop>filecontextBox</tabstop>
+ <tabstop>filecontextaddButton</tabstop>
+ <tabstop>filecontextremoveButton</tabstop>
+ <tabstop>dircontextBox</tabstop>
+ <tabstop>dircontextaddButton</tabstop>
+ <tabstop>dircontextremoveButton</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">dircontextaddClicked()</slot>
+ <slot access="protected">filecontextaddClicked()</slot>
+ <slot access="protected">filecontextremoveClicked()</slot>
+ <slot access="protected">dircontextremoveClicked()</slot>
+ <slot access="protected">toolsmenuaddClicked()</slot>
+ <slot access="protected">toolsmenuremoveClicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/uimode/Makefile.am b/parts/uimode/Makefile.am
new file mode 100644
index 00000000..50fe5f5a
--- /dev/null
+++ b/parts/uimode/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevuichooser.la
+libkdevuichooser_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevuichooser_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevuichooser_la_SOURCES = uichooser_part.cpp uichooser.ui uichooser_widget.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevuichooser.desktop
+
diff --git a/parts/uimode/README.dox b/parts/uimode/README.dox
new file mode 100644
index 00000000..5836e21f
--- /dev/null
+++ b/parts/uimode/README.dox
@@ -0,0 +1,8 @@
+/** \class UIChooserPart
+Allows you to choose the KDevelop UImode (Graphical User Interface mode)
+
+\authors <a href="mailto:hoelzer AT physik.uni-wuerzburg.de">Matthias Hoelzer</a>
+
+\feature Allows you to choose the KDevelop UImode (Graphical User Interface mode)
+
+*/
diff --git a/parts/uimode/kdevuichooser.desktop b/parts/uimode/kdevuichooser.desktop
new file mode 100644
index 00000000..20f8510d
--- /dev/null
+++ b/parts/uimode/kdevuichooser.desktop
@@ -0,0 +1,87 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Provides a dialog for UI-mode selection.
+Comment[ca]=Proporciona un diàleg per a la selecció del mode de la interfície d'usuari.
+Comment[da]=Sørger for en dialog for valg af brugergrænsefladetilstand.
+Comment[de]=Stellt einen Dialog für die Auswahl des Fenstermodus zur Verfügung.
+Comment[el]=Προσφέρει ένα διάλογο για την επιλογή της λειτουργίας του περιβάλλοντος χρήστη.
+Comment[en_GB]=Provides a dialogue for UI-mode selection.
+Comment[es]=Proporciona un diálogo para la selección del modo de la interfaz de usuario.
+Comment[et]=Pakub dialoogi kasutajaliidese režiimi valikuks.
+Comment[eu]=UI-modu hautapenerako elkarrizketa-koadroa eskeintzen du.
+Comment[fa]=محاوره‌ای برای گزینش حالت UI فراهم‌ می‌کند.
+Comment[fr]=Fournit une boîte de dialogue pour la sélection du mode d'interface graphique.
+Comment[gl]=Proporciona un diálogo para a selección do modo da interface de usuario
+Comment[hi]=यूआई-मोड चयन के लिए एक संवाद प्रदान करता है.
+Comment[hu]=Párbeszédablak a grafikus felület kiválasztásához
+Comment[it]=Fornisce una maschera per scegliere la modalità UI.
+Comment[ja]=UI モード選択のためのダイアログを提供します。
+Comment[ms]=Menyediakan dialok untuk pemilihan mod-UI.
+Comment[nds]=Stellt en Dialoog för de Böversiedenutwahl praat.
+Comment[ne]=UI-मोड चयनका लागि संवाद प्रदान गर्दछ
+Comment[nl]=Biedt een dialoog voor het selecteren van een UI-modus.
+Comment[pl]=Udostępnienie okna dialogowego do wyboru trybu interfejsu.
+Comment[pt]=Oferece uma janela para a selecção do modo de UI.
+Comment[pt_BR]=Fornece um diálogo para seleção modo-UI.
+Comment[ru]=Предоставляет диалог выбора режима интерфейса пользователя.
+Comment[sk]=Poskytuje dialóg pre voľbu UI módu.
+Comment[sl]=Prikazuje okno za izbiro načina uporabniškega vmesnika.
+Comment[sr]=Обезбеђује прозор за избор UI режима.
+Comment[sr@Latn]=Obezbeđuje prozor za izbor UI režima.
+Comment[sv]=Tillhandahåller en dialogruta för att välja läge för det grafiska gränssnittet.
+Comment[ta]=UI-பாங்கு தேர்வுக்காக உரையாடல் பெட்டி வரும்.
+Comment[tg]=Барои интихоб намудани тартиботи истифодабарандаи интерфейс имкон медиҳад.
+Comment[tr]=Arayüz-modu seçim için bir pencere sunar.
+Comment[zh_CN]=提供用户界面模式选择对话框
+Comment[zh_TW]=提供使用者介面模式選擇對話框
+Name=KDevUIChooser
+Name[da]=KDevelop brugergrænsefladevælger
+Name[de]=Fenstermodusauswahl (KDevelop)
+Name[hi]=के-डेव-यूआई-चूज़र
+Name[nds]=KDevelop-Böversietutwahl
+Name[pl]=KDevWybórInterfUżytk
+Name[sk]=KDev voľba UI
+Name[sv]=KDevelop gränssnittsväljare
+Name[ta]=KDevUI தேர்வாளர்
+Name[tg]=KDevUIИнтихобкунанда
+Name[zh_TW]=KDevelop 使用者介面選擇器
+GenericName=User-Interface Selection
+GenericName[ca]=Selecció de la interfície d'usuari
+GenericName[da]=Valg af brugergrænseflade
+GenericName[de]=Fenstermodusauswahl
+GenericName[el]=Επιλογή περιβάλλοντος χρήστη
+GenericName[es]=Selección de la interfaz de usuario
+GenericName[et]=Kasutajaliidese valimine
+GenericName[eu]=Erabiltzaile-interfaze hautapena
+GenericName[fa]=گزینش واسط کاربر
+GenericName[fr]=Sélection de l'interface utilisateur
+GenericName[gl]=Selección da interface de usuario
+GenericName[hi]=उपयोक्ता-इंटरफ़ेस चयन
+GenericName[hu]=A felhasználói felület kiválasztása
+GenericName[it]=Selezione dell'interfaccia utente
+GenericName[ja]=ユーザインターフェース選択
+GenericName[nds]=Bruker-Koppelsteedutwahl
+GenericName[ne]=प्रयोगकर्ता-इन्टरफेस चयन
+GenericName[nl]=Gebruikersinterface selectie
+GenericName[pl]=Wybór interfejsu użytkownika
+GenericName[pt]=Selecção da Interface de Utilizador
+GenericName[pt_BR]=Seleção de Interface-Usuário
+GenericName[ru]=Выбор интерфейса пользователя
+GenericName[sk]=Voľba užívateľského rozhrania
+GenericName[sl]=Izbira uporabniškega vmesnika
+GenericName[sr]=Избор корисничког интерфејса
+GenericName[sr@Latn]=Izbor korisničkog interfejsa
+GenericName[sv]=Användargränssnittsval
+GenericName[ta]=பயனரின்-இடைமுக தேர்வு
+GenericName[tg]=Интихоби интерфейси истифодабаранда
+GenericName[tr]=Kullanıcı Arayüzü Seçimi
+GenericName[zh_CN]=用户界面选择
+GenericName[zh_TW]=使用者介面選擇器
+Icon=view_choose
+ServiceTypes=KDevelop/Plugin
+X-KDE-Library=libkdevuichooser
+X-KDevelop-Version=5
+X-KDevelop-Scope=Core
+X-KDevelop-Mode=AssistantMode
+X-KDevelop-Properties=UISwitching
diff --git a/parts/uimode/uichooser.ui b/parts/uimode/uichooser.ui
new file mode 100644
index 00000000..149a1db1
--- /dev/null
+++ b/parts/uimode/uichooser.ui
@@ -0,0 +1,250 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>UIChooser</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>UIChooser</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>540</width>
+ <height>529</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>UIChooser</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>TabModeGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Use Tabs</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Some prefer not to have a tab bar and switch between documents using other means. Kate is one example of this.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlwaysShowTabs</cstring>
+ </property>
+ <property name="text">
+ <string>Al&amp;ways</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>NeverShowTabs</cstring>
+ </property>
+ <property name="text">
+ <string>Ne&amp;ver</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>HoverCloseGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Use Close on Hover</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The document tab can optionally be used to close the document, by clicking on the tab icon.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>DoNotCloseOnHover</cstring>
+ </property>
+ <property name="text">
+ <string>No</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>DoCloseOnHover</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Yes</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>IDEAlButtonGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Toolview Tab Layout</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Three different modes for the IDEAl toolview tabs. "Text and icons" is the most informative, but takes a lot of space. Those with a smaller screen will typically want "Icons".</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>IconsOnly</cstring>
+ </property>
+ <property name="text">
+ <string>Icons</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>TextOnly</cstring>
+ </property>
+ <property name="text">
+ <string>Te&amp;xt</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>TextAndIcons</cstring>
+ </property>
+ <property name="text">
+ <string>Text and icons</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>TabbedBrowsingGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Tabbed Browsing</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Some extra options for the document tabbar.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>OpenNewTabAfterCurrent</cstring>
+ </property>
+ <property name="text">
+ <string>Open &amp;new tab after current tab</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>ShowTabIcons</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Show icons on document tabs</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>ShowCloseTabsButton</cstring>
+ </property>
+ <property name="text">
+ <string>Show close &amp;button in tab bar</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Note: Changes will take effect after KDevelop is restarted</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignCenter</set>
+ </property>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>AlwaysShowTabs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>UIChooser</receiver>
+ <slot>maybeEnableCloseOnHover(bool)</slot>
+ </connection>
+ <connection>
+ <sender>NeverShowTabs</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>UIChooser</receiver>
+ <slot>maybeEnableCloseOnHover(bool)</slot>
+ </connection>
+ <connection>
+ <sender>ShowTabIcons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>UIChooser</receiver>
+ <slot>maybeEnableCloseOnHover(bool)</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="protected">maybeEnableCloseOnHover(bool)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/parts/uimode/uichooser_part.cpp b/parts/uimode/uichooser_part.cpp
new file mode 100644
index 00000000..914c03ba
--- /dev/null
+++ b/parts/uimode/uichooser_part.cpp
@@ -0,0 +1,52 @@
+#include "uichooser_part.h"
+
+#include <qvbox.h>
+
+#include <kdialogbase.h>
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevcore.h>
+#include <configwidgetproxy.h>
+#include <kdevplugininfo.h>
+
+#include "uichooser_widget.h"
+
+#define UICHOOSERSETTINGSPAGE 1
+
+typedef KDevGenericFactory<UIChooserPart> UIChooserFactory;
+static const KDevPluginInfo data("kdevuichooser");
+K_EXPORT_COMPONENT_FACTORY( libkdevuichooser, UIChooserFactory( data ) )
+
+UIChooserPart::UIChooserPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin( &data, parent, name ? name : "UIChooserPart")
+{
+ setInstance(UIChooserFactory::instance());
+
+ _configProxy = new ConfigWidgetProxy( core() );
+ _configProxy->createGlobalConfigPage( i18n("User Interface"), UICHOOSERSETTINGSPAGE, info()->icon() );
+ connect( _configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) );
+}
+
+
+UIChooserPart::~UIChooserPart()
+{
+ delete _configProxy;
+}
+
+void UIChooserPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber )
+{
+ kdDebug() << k_funcinfo << endl;
+
+ if ( pagenumber == UICHOOSERSETTINGSPAGE )
+ {
+ UIChooserWidget * w = new UIChooserWidget( this, page, "UIChooser widget" );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ }
+}
+
+
+
+
+#include "uichooser_part.moc"
diff --git a/parts/uimode/uichooser_part.h b/parts/uimode/uichooser_part.h
new file mode 100644
index 00000000..e4633441
--- /dev/null
+++ b/parts/uimode/uichooser_part.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2001 Matthias Hoelzer-Kluepfel <mhk@caldera.de>
+ */
+
+
+#ifndef __KDEVPART_UICHOOSER_H__
+#define __KDEVPART_UICHOOSER_H__
+
+
+class KDialogBase;
+class ConfigWidgetProxy;
+
+#include <kdevplugin.h>
+
+class UIChooserPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ UIChooserPart(QObject *parent, const char *name, const QStringList &);
+ ~UIChooserPart();
+
+private slots:
+ void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int );
+
+private:
+ ConfigWidgetProxy * _configProxy;
+
+};
+
+
+#endif
diff --git a/parts/uimode/uichooser_widget.cpp b/parts/uimode/uichooser_widget.cpp
new file mode 100644
index 00000000..5e6ffbf7
--- /dev/null
+++ b/parts/uimode/uichooser_widget.cpp
@@ -0,0 +1,153 @@
+/***************************************************************************
+ uichooser_widget.cpp - ?
+ -------------------
+ begin : ?
+ copyright : (C) 2003 by the KDevelop team
+ email : team@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qradiobutton.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kdeversion.h>
+
+#include "uichooser_part.h"
+#include "kdevmainwindow.h"
+#include "uichooser_widget.h"
+
+UIChooserWidget::UIChooserWidget( UIChooserPart * part, QWidget *parent, const char *name)
+ : UIChooser(parent, name)
+ ,m_part(part), _lastMode(0L)
+{
+ load();
+}
+
+void UIChooserWidget::load()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+
+ int mdistyle = config->readNumEntry( "MDIStyle", 1 );
+ switch( mdistyle )
+ {
+ case 0:
+ IconsOnly->setChecked( true );
+ break;
+ case 1:
+ TextOnly->setChecked( true );
+ break;
+ case 3:
+ TextAndIcons->setChecked( true );
+ break;
+ default:
+ TextOnly->setChecked( true );
+ }
+
+ int tabVisibility = config->readNumEntry( "TabWidgetVisibility", _AlwaysShowTabs );
+ switch( tabVisibility )
+ {
+ case _AlwaysShowTabs:
+ AlwaysShowTabs->setChecked( true );
+ break;
+ case _NeverShowTabs:
+ NeverShowTabs->setChecked( true );
+ break;
+ }
+
+ bool CloseOnHover = config->readBoolEntry( "CloseOnHover", false );
+
+ if ( CloseOnHover )
+ {
+ DoCloseOnHover->setChecked( true );
+ }
+ else
+ {
+ DoNotCloseOnHover->setChecked( true );
+ }
+ OpenNewTabAfterCurrent->setChecked(config->readBoolEntry( "OpenNewTabAfterCurrent", false ));
+ ShowTabIcons->setChecked(config->readBoolEntry( "ShowTabIcons", true ));
+ ShowCloseTabsButton->setChecked(config->readBoolEntry( "ShowCloseTabsButton", true ));
+
+ maybeEnableCloseOnHover(false);
+}
+
+
+void UIChooserWidget::save()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+
+ if ( AlwaysShowTabs->isChecked() )
+ {
+ config->writeEntry( "TabWidgetVisibility", _AlwaysShowTabs );
+ }
+ else if ( NeverShowTabs->isChecked() )
+ {
+ config->writeEntry( "TabWidgetVisibility", _NeverShowTabs );
+ }
+
+ if ( DoNotCloseOnHover->isChecked() )
+ {
+ config->writeEntry( "CloseOnHover", false );
+ }
+ else if ( DoCloseOnHover->isChecked() )
+ {
+ config->writeEntry( "CloseOnHover", true );
+ }
+
+ // using magic numbers for now.. where are these values defined??
+ if ( IconsOnly->isChecked() )
+ {
+ config->writeEntry( "MDIStyle", 0 );
+ }
+ else if ( TextAndIcons->isChecked() )
+ {
+ config->writeEntry( "MDIStyle", 3 );
+ }
+ else // TextOnly
+ {
+ config->writeEntry( "MDIStyle", 1 );
+ }
+ config->writeEntry("OpenNewTabAfterCurrent", OpenNewTabAfterCurrent->isChecked());
+ config->writeEntry("ShowTabIcons", ShowTabIcons->isChecked());
+ config->writeEntry("ShowCloseTabsButton", ShowCloseTabsButton->isChecked());
+
+ config->sync();
+}
+
+
+void UIChooserWidget::accept()
+{
+ save();
+}
+
+void UIChooserWidget::maybeEnableCloseOnHover( bool )
+{
+ if ( !NeverShowTabs->isChecked() && !ShowTabIcons->isChecked())
+ {
+ HoverCloseGroup->setEnabled(false);
+ } else if ( NeverShowTabs->isChecked() )
+ {
+ HoverCloseGroup->setEnabled( false );
+ TabbedBrowsingGroup->setEnabled( false );
+ } else
+ {
+ HoverCloseGroup->setEnabled( true );
+ TabbedBrowsingGroup->setEnabled( true );
+ }
+}
+
+
+#include "uichooser_widget.moc"
diff --git a/parts/uimode/uichooser_widget.h b/parts/uimode/uichooser_widget.h
new file mode 100644
index 00000000..5faba3af
--- /dev/null
+++ b/parts/uimode/uichooser_widget.h
@@ -0,0 +1,42 @@
+#ifndef __UICHOOSER_WIDGET_H__
+#define __UICHOOSER_WIDGET_H__
+
+
+#include <qwidget.h>
+
+
+#include "uichooser.h"
+
+class UIChooserPart;
+
+class UIChooserWidget : public UIChooser
+{
+ Q_OBJECT
+
+public:
+
+ enum TabWidgetVisibility {
+ _AlwaysShowTabs = 0,
+ _NeverShowTabs = 2
+ };
+
+ UIChooserWidget( UIChooserPart * part, QWidget *parent=0, const char *name=0 );
+
+public slots:
+ void accept();
+
+protected slots:
+ void maybeEnableCloseOnHover( bool );
+
+private slots:
+
+ void load();
+ void save();
+
+private:
+ UIChooserPart* m_part;
+ QWidget * _lastMode;
+};
+
+
+#endif
diff --git a/parts/valgrind/Makefile.am b/parts/valgrind/Makefile.am
new file mode 100644
index 00000000..07550df6
--- /dev/null
+++ b/parts/valgrind/Makefile.am
@@ -0,0 +1,15 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevvalgrind.la
+libkdevvalgrind_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevvalgrind_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevvalgrind_la_SOURCES = dialog_widget.ui valgrind_part.cpp valgrind_widget.cpp valgrind_dialog.cpp valgrinditem.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevvalgrind.desktop
+
+rcdir = $(kde_datadir)/kdevvalgrind
+rc_DATA = kdevpart_valgrind.rc
diff --git a/parts/valgrind/README.dox b/parts/valgrind/README.dox
new file mode 100644
index 00000000..d5e79fd4
--- /dev/null
+++ b/parts/valgrind/README.dox
@@ -0,0 +1,45 @@
+/** \class ValgrindPart
+Valgrind is a tool that helps you find memory management problems in programs. http://developer.kde.org/~sewardj/
+
+\authors <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:$EMAIL$">$AUTHOR$</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Integrates Valgrind into KDevelop
+
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/valgrind/dialog_widget.ui b/parts/valgrind/dialog_widget.ui
new file mode 100644
index 00000000..35ded9c1
--- /dev/null
+++ b/parts/valgrind/dialog_widget.ui
@@ -0,0 +1,360 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DialogWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>DialogWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>322</width>
+ <height>306</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Application</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>executableEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Parameters:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>paramEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Executable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>executableEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>paramEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidgetStack" row="1" column="0">
+ <property name="name">
+ <cstring>stack</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Valgrind</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>memleakBox</cstring>
+ </property>
+ <property name="text">
+ <string>Memory &amp;leak check</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <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="QCheckBox">
+ <property name="name">
+ <cstring>reachableBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Show still reachable blocks</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>childrenBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Trace children</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>Additional p&amp;arameters:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>valParamEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>valParamEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>valExecutableEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xecutable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>valExecutableEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>1</number>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Valgrind</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout3_2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel5_2</cstring>
+ </property>
+ <property name="text">
+ <string>Additional p&amp;arameters:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>valParamEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>ctParamEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>ctExecutableEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xecutable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>valExecutableEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>ctChildrenBox</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Trace children</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>KCachegrind</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>kcExecutableEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel4_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Exe&amp;cutable:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>valExecutableEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>memleakBox</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>DialogWidget</receiver>
+ <slot>checkBoxToggled()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>executableEdit</tabstop>
+ <tabstop>paramEdit</tabstop>
+ <tabstop>memleakBox</tabstop>
+ <tabstop>reachableBox</tabstop>
+ <tabstop>childrenBox</tabstop>
+ <tabstop>valExecutableEdit</tabstop>
+ <tabstop>valParamEdit</tabstop>
+ <tabstop>ctChildrenBox</tabstop>
+ <tabstop>ctExecutableEdit</tabstop>
+ <tabstop>ctParamEdit</tabstop>
+ <tabstop>kcExecutableEdit</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<slots>
+ <slot access="private" specifier="non virtual">checkBoxToggled()</slot>
+ <slot>init()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/parts/valgrind/dialog_widget.ui.h b/parts/valgrind/dialog_widget.ui.h
new file mode 100644
index 00000000..9a2570ae
--- /dev/null
+++ b/parts/valgrind/dialog_widget.ui.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+** 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 DialogWidget::checkBoxToggled()
+{
+ reachableBox->setEnabled( memleakBox->isChecked() );
+}
+
+
+void DialogWidget::init()
+{
+ valParamEdit->setMinimumWidth( valParamEdit->fontMetrics().width( "0" ) * 30 );
+ checkBoxToggled();
+}
diff --git a/parts/valgrind/kdevpart_valgrind.rc b/parts/valgrind/kdevpart_valgrind.rc
new file mode 100644
index 00000000..440b62c2
--- /dev/null
+++ b/parts/valgrind/kdevpart_valgrind.rc
@@ -0,0 +1,9 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="valgrind" library="libvalgrindplugin" version="3">
+<MenuBar>
+ <Menu name="debug"><Text>&amp;Debug</Text>
+ <Action name="tools_valgrind" group="profile"/>
+ <Action name="tools_calltree" group="profile"/>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/parts/valgrind/kdevvalgrind.desktop b/parts/valgrind/kdevvalgrind.desktop
new file mode 100644
index 00000000..23b5cf4f
--- /dev/null
+++ b/parts/valgrind/kdevvalgrind.desktop
@@ -0,0 +1,74 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Valgrind is a tool that helps you find memory management problems in programs. http://valgrind.org/
+Comment[ca]=Valgrind és una eina que us ajuda a trobar problemes en la gestió de la memòria en els programes. http://valgrind.org/
+Comment[da]=Valgrind er et værktøj der hjælper dig med at finde hukommelseshåndteringsproblemer i programmer. http://valgrind.org/
+Comment[de]=Valgrind ist ein Werkzeug zum Auffinden von Speicherverwaltungsproblemen in Anwendungen. http://valgrind.org/
+Comment[el]=Το Valgrind είναι ένα εργαλείο που βοηθά στην εύρεση προβλημάτων διαχείρισης μνήμης στα προγράμματα. http://valgrind.org/
+Comment[es]=Valgrind es una herramienta que le ayuda a encontrar problemas de gestión de memoria en los programas. http://valgrind.org/
+Comment[et]=Valgrind aitab leida programmides mälulekkeid ja muid mäluga seotud asju. http://valgrind.org/
+Comment[fr]=Valgrind est un outil qui vous aide à trouver les problèmes de gestion de la mémoire dans les programmes. http://valgrind.org/
+Comment[hu]=A Valgrind memóriakezelési hibák keresésére alkalmas program - http://valgrind.org
+Comment[it]=Valgrind è uno strumento che ti aiuta a trovare problemi di gestione della memoria nei programmi. http://valgrind.org/
+Comment[ja]=Valgrind は、プログラム内のメモリ管理問題を発見することを手助けするツールです。http://valgrind.org/
+Comment[ms]=Valgrind adalah alatan yang membantu anda mencari masalah pengurusan memori dalam program. http://valgrind.org/
+Comment[nds]=Valgrind is en Warktüüch för't Finnen vun t Spiekerpleegproblemen in Programmen. http://valgrind.org/
+Comment[nl]=Valgrind is een hulpprogramma dat u helpt bij het opsporen van geheugenproblemen in programma's. http://valgrind.org/
+Comment[pl]=Valgrind jest narzędziem pomagającym znaleźć w programach problemy z zarządzaniem pamięcią. http://valgrind.org/
+Comment[pt]=O Valgrind é uma ferramenta que o ajuda a descobrir os problemas de gestão de memória nos programas. http://www.valgrind.org/
+Comment[pt_BR]=Valgrind é uma ferramenta ajuda você a encontrar problemas de gerenciamento de memória nos programas. http://www.valgrind.org/
+Comment[ru]=Valgrind - средство нахождения проблем управления памятью в программах. http://valgrind.org/
+Comment[sk]=Valgrind je nástroj, ktorý pomáha nájsť problémy so správou pamäte v programoch. http://valgrind.org/
+Comment[sr]=Valgrind је алат који вам помаже да нађете проблеме са употребом меморије у програмима. http://valgrind.org/
+Comment[sr@Latn]=Valgrind je alat koji vam pomaže da nađete probleme sa upotrebom memorije u programima. http://valgrind.org/
+Comment[sv]=Valgrind är ett verktyg som hjälper dig hitta minneshanteringsproblem i program. Se http://valgrind.org/.
+Comment[zh_TW]=Valgrind 能協助您找到程式中記憶體管理上的問題。http://valgrind.org/
+Name=KDevvalgrind
+Name[da]=KDevelop Valgrind
+Name[de]=Unterstützung für Valgrind (KDevelop)
+Name[hi]=के-डेववेलग्रिंड
+Name[nds]=Ünnerstütten för Valgrind (KDevelop)
+Name[sk]=KDev valgrind
+Name[sv]=KDevelop valgrind
+Name[zh_TW]=KDevelop Valgrind
+GenericName=Valgrind Frontend
+GenericName[ca]=Entorn per a Valgrind
+GenericName[da]=Valgrind-grænseflade
+GenericName[de]=Oberfläche für Valgrind
+GenericName[el]=Πρόγραμμα Valgrind
+GenericName[es]=Interfaz para Valgrind
+GenericName[et]=Valgrindi kasutajaliides
+GenericName[eu]=Valgrind interfazea
+GenericName[fa]=پایانۀ Valgrind
+GenericName[fr]=Interface de Valgrind
+GenericName[ga]=Comhéadan Valgrind
+GenericName[gl]=Frontal para Valgrind
+GenericName[hi]=वेलग्रिन्ड फ्रन्टएण्ड
+GenericName[hu]=Valgrind-kezelő
+GenericName[it]=Interfaccia a Valgrind
+GenericName[ja]=Valgrind フロントエンド
+GenericName[ms]=Frontend Valgrind
+GenericName[nds]=Valgrind-Böversiet
+GenericName[ne]=भलग्रिन्ड फ्रन्टइन्ड
+GenericName[nl]=Valgrind-frontend
+GenericName[pl]=Interfejs do Valgrinda
+GenericName[pt]=Interface para o Valgrind
+GenericName[pt_BR]=Frontend do Valgrind
+GenericName[ru]=Интерфейс к Valgrind
+GenericName[sk]=Valgrind rozhranie
+GenericName[sl]=VMesnik za Valgrind
+GenericName[sr]=Кориснички интерфејс за Valgrind
+GenericName[sr@Latn]=Korisnički interfejs za Valgrind
+GenericName[sv]=Valgrind-gränssnitt
+GenericName[ta]=Valgrind முன் பகுதி
+GenericName[tg]=Интерфейс дар Valgrind
+GenericName[tr]=Valgrind Önucu
+GenericName[zh_CN]=Valgrind 前端
+GenericName[zh_TW]=Valgrind 前端介面
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+X-KDevelop-Scope=Global
+X-KDE-Library=libkdevvalgrind
+X-KDevelop-Version=5
+X-KDevelop-Properties=CompiledDevelopment
diff --git a/parts/valgrind/valgrind_dialog.cpp b/parts/valgrind/valgrind_dialog.cpp
new file mode 100644
index 00000000..405d78dd
--- /dev/null
+++ b/parts/valgrind/valgrind_dialog.cpp
@@ -0,0 +1,206 @@
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qregexp.h>
+#include <qwidgetstack.h>
+
+#include <kprocess.h>
+#include <klocale.h>
+#include <kurlrequester.h>
+#include <klineedit.h>
+#include <kstandarddirs.h>
+#include <kmessagebox.h>
+
+#include "dialog_widget.h"
+#include "valgrind_dialog.h"
+
+#include "valgrind_dialog.moc"
+
+
+ValgrindDialog::ValgrindDialog( Type type, QWidget* parent )
+ : KDialogBase( parent, "valgrind dialog", true, i18n("Valgrind Memory Check"), Ok|Cancel ),
+ m_type(type)
+{
+ w = new DialogWidget( this );
+ w->valExecutableEdit->setURL( "valgrind" );
+ w->executableEdit->setFocus();
+ w->stack->raiseWidget(m_type);
+ setMainWidget( w );
+ connect( w->executableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
+ connect( w->valExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
+ connect( w->ctExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
+ connect( w->kcExecutableEdit->lineEdit(), SIGNAL( textChanged( const QString &)), this, SLOT( valgrindTextChanged()));
+ enableButtonOK( false );
+}
+
+
+ValgrindDialog::~ValgrindDialog()
+{
+}
+
+void ValgrindDialog::valgrindTextChanged()
+{
+ if (m_type == Memcheck)
+ enableButtonOK( !w->valExecutableEdit->lineEdit()->text().isEmpty() && !w->executableEdit->lineEdit()->text().isEmpty() );
+ else if (m_type == Calltree)
+ enableButtonOK( !w->executableEdit->lineEdit()->text().isEmpty() && !w->ctExecutableEdit->lineEdit()->text().isEmpty() && !w->kcExecutableEdit->lineEdit()->text().isEmpty() );
+}
+
+QString ValgrindDialog::executableName() const
+{
+ return w->executableEdit->url();
+}
+
+void ValgrindDialog::setExecutable( const QString& url )
+{
+ w->executableEdit->setURL( url );
+}
+
+QString ValgrindDialog::valExecutable() const
+{
+ return w->valExecutableEdit->url();
+}
+
+QString ValgrindDialog::parameters() const
+{
+ return w->paramEdit->text();
+}
+
+void ValgrindDialog::setParameters( const QString& params )
+{
+ w->paramEdit->setText( params );
+}
+
+void ValgrindDialog::setValExecutable( const QString& ve )
+{
+ QString vUrl = ve;
+ if ( vUrl.isEmpty() ) {
+ vUrl = KStandardDirs::findExe( "valgrind" );
+ }
+ if ( vUrl.isEmpty() ) {
+ KMessageBox::sorry( this, i18n( "Could not find valgrind in your $PATH. Please make "
+ "sure it is installed properly." ),
+ i18n( "Valgrind Not Found" ) );
+ w->valExecutableEdit->setURL( "valgrind" );
+ } else {
+ w->valExecutableEdit->setURL( vUrl );
+ }
+}
+
+static const QString memCheckParam( "--tool=memcheck" );
+static const QString leakCheckParam( "--leak-check=yes" );
+static const QString reachableParam( "--show-reachable=yes" );
+static const QString childrenParam( "--trace-children=yes" );
+
+QString ValgrindDialog::valParams() const
+{
+ QString params = w->valParamEdit->text();
+ if (isNewValgrindVersion())
+ params += " " + memCheckParam;
+ if ( w->memleakBox->isChecked() )
+ params += " " + leakCheckParam;
+ if ( w->reachableBox->isChecked() )
+ params += " " + reachableParam;
+ if ( w->childrenBox->isChecked() )
+ params += " " + childrenParam;
+
+ return params;
+}
+
+void ValgrindDialog::setValParams( const QString& params )
+{
+ QString myParams = params;
+ if ( myParams.contains( leakCheckParam ) )
+ w->memleakBox->setChecked( true );
+ if ( myParams.contains( reachableParam ) )
+ w->reachableBox->setChecked( true );
+ if ( myParams.contains( childrenParam ) )
+ w->childrenBox->setChecked( true );
+ w->init();
+
+ myParams = myParams.replace( QRegExp( memCheckParam ), "" );
+ myParams = myParams.replace( QRegExp( leakCheckParam ), "" );
+ myParams = myParams.replace( QRegExp( reachableParam ), "" );
+ myParams = myParams.replace( QRegExp( childrenParam ), "" );
+ myParams = myParams.stripWhiteSpace();
+ w->valParamEdit->setText( myParams );
+}
+
+QString ValgrindDialog::ctExecutable() const
+{
+ return w->ctExecutableEdit->url();
+}
+
+void ValgrindDialog::setCtExecutable( const QString& ce )
+{
+ QString vUrl = ce;
+ if ( vUrl.isEmpty() ) {
+ vUrl = KStandardDirs::findExe( "valgrind" );
+ }
+ if ( vUrl.isEmpty() ) {
+ KMessageBox::sorry( this, i18n( "Could not find valgrind in your $PATH. Please make "
+ "sure it is installed properly." ),
+ i18n( "Valgrind Not Found" ) );
+ w->ctExecutableEdit->setURL( "valgrind" );
+ } else {
+ w->ctExecutableEdit->setURL( vUrl );
+ }
+}
+
+QString ValgrindDialog::ctParams() const
+{
+ QString params = w->ctParamEdit->text();
+ if ( w->ctChildrenBox->isChecked() )
+ params += " " + childrenParam;
+
+ return params;
+}
+
+void ValgrindDialog::setCtParams( const QString& params )
+{
+ QString myParams = params;
+ //force --tool=callgrind if no params are given
+ if (myParams.isEmpty())
+ myParams = "--tool=callgrind";
+ if ( myParams.contains( childrenParam ) )
+ w->ctChildrenBox->setChecked( true );
+ w->init();
+
+ myParams = myParams.replace( QRegExp( childrenParam ), "" );
+ myParams = myParams.stripWhiteSpace();
+ w->ctParamEdit->setText( myParams );
+}
+
+QString ValgrindDialog::kcExecutable( ) const
+{
+ return w->kcExecutableEdit->url();
+}
+
+void ValgrindDialog::setKcExecutable( const QString& ke )
+{
+ QString vUrl = ke;
+ if ( vUrl.isEmpty() ) {
+ vUrl = KStandardDirs::findExe( "kcachegrind" );
+ }
+ if ( vUrl.isEmpty() ) {
+ KMessageBox::sorry( this, i18n( "Could not find kcachegrind in your $PATH. Please make "
+ "sure it is installed properly." ),
+ i18n( "KCachegrind Not Found" ) );
+ w->kcExecutableEdit->setURL( "kcachegrind" );
+ } else {
+ w->kcExecutableEdit->setURL( vUrl );
+ }
+}
+
+bool ValgrindDialog::isNewValgrindVersion( ) const
+{
+ KProcess *proc = new KProcess;
+ proc->setUseShell(true);
+ *proc << "test \"valgrind-20\" == `valgrind --version | awk -F \\. '{print $1$2}'`";
+ proc->start(KProcess::Block);
+ if (proc->normalExit())
+ return proc->exitStatus();
+ return true;
+}
+
+// kate: space-indent on; indent-width 2; tab-width 2; show-tabs on;
+
diff --git a/parts/valgrind/valgrind_dialog.h b/parts/valgrind/valgrind_dialog.h
new file mode 100644
index 00000000..41c25afc
--- /dev/null
+++ b/parts/valgrind/valgrind_dialog.h
@@ -0,0 +1,62 @@
+
+#ifndef _VALGRIND_DIALOG_H_
+#define _VALGRIND_DIALOG_H_
+
+#include <kdialogbase.h>
+
+class KURLRequester;
+class DialogWidget;
+
+/**
+ *
+ * Harald Fernengel
+ **/
+class ValgrindDialog : public KDialogBase
+{
+ Q_OBJECT
+public:
+ enum Type { Memcheck = 0, Calltree = 1 };
+
+ ValgrindDialog( Type type, QWidget* parent = 0 );
+ ~ValgrindDialog();
+
+ // the app to check
+ QString executableName() const;
+ void setExecutable( const QString& url );
+
+ // command line parameters for the app
+ QString parameters() const;
+ void setParameters( const QString& params );
+
+ // name and/or path to the valgrind executable
+ QString valExecutable() const;
+ void setValExecutable( const QString& ve );
+
+ // command line parameters for valgrind
+ QString valParams() const;
+ void setValParams( const QString& params );
+
+ // name and/or path to the calltree executable
+ QString ctExecutable() const;
+ void setCtExecutable( const QString& ce );
+
+ // command line parameters for calltree
+ QString ctParams() const;
+ void setCtParams( const QString& params );
+
+ // name and/or path to the kcachegrind executable
+ QString kcExecutable() const;
+ void setKcExecutable( const QString& ke );
+
+protected:
+ bool isNewValgrindVersion() const;
+
+private:
+ DialogWidget *w;
+ Type m_type;
+ private slots:
+ void valgrindTextChanged();
+
+};
+
+#endif
diff --git a/parts/valgrind/valgrind_part.cpp b/parts/valgrind/valgrind_part.cpp
new file mode 100644
index 00000000..868faf28
--- /dev/null
+++ b/parts/valgrind/valgrind_part.cpp
@@ -0,0 +1,366 @@
+#include "valgrind_part.h"
+
+#include <qwhatsthis.h>
+#include <qregexp.h>
+#include <qfile.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kprocess.h>
+#include <kmessagebox.h>
+#include <kfiledialog.h>
+#include <kdebug.h>
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+#include "kdevplugininfo.h"
+
+#include "valgrind_widget.h"
+#include "valgrind_dialog.h"
+#include "valgrinditem.h"
+
+typedef KDevGenericFactory<ValgrindPart> ValgrindFactory;
+static const KDevPluginInfo data("kdevvalgrind");
+K_EXPORT_COMPONENT_FACTORY( libkdevvalgrind, ValgrindFactory( data ) )
+
+ValgrindPart::ValgrindPart( QObject *parent, const char *name, const QStringList& )
+ : KDevPlugin( &data, parent, name ? name : "ValgrindPart" )
+{
+ setInstance( ValgrindFactory::instance() );
+ setXMLFile( "kdevpart_valgrind.rc" );
+
+ proc = new KShellProcess();
+ connect( proc, SIGNAL(receivedStdout( KProcess*, char*, int )),
+ this, SLOT(receivedStdout( KProcess*, char*, int )) );
+ connect( proc, SIGNAL(receivedStderr( KProcess*, char*, int )),
+ this, SLOT(receivedStderr( KProcess*, char*, int )) );
+ connect( proc, SIGNAL(processExited( KProcess* )),
+ this, SLOT(processExited( KProcess* )) );
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
+ connect( core(), SIGNAL(projectOpened()),
+ this, SLOT(projectOpened()) );
+
+ m_widget = new ValgrindWidget( this );
+ m_widget->setIcon( SmallIcon("fork") );
+ m_widget->setCaption(i18n("Valgrind Output"));
+
+ QWhatsThis::add( m_widget, i18n( "<b>Valgrind</b><p>Shows the output of the valgrind. Valgrind detects<br>"
+ "use of uninitialized memory<br>"
+ "reading/writing memory after it has been free'd<br>"
+ "reading/writing off the end of malloc'd blocks<br>"
+ "reading/writing inappropriate areas on the stack<br>"
+ "memory leaks -- where pointers to malloc'd blocks are lost forever<br>"
+ "passing of uninitialised and/or unaddressable memory to system calls<br>"
+ "mismatched use of malloc/new/new [] vs free/delete/delete []<br>"
+ "some abuses of the POSIX pthread API." ) );
+
+ KAction* action = new KAction( i18n("&Valgrind Memory Leak Check"), 0, this,
+ SLOT(slotExecValgrind()), actionCollection(), "tools_valgrind" );
+ action->setToolTip(i18n("Valgrind memory leak check"));
+ action->setWhatsThis(i18n("<b>Valgrind memory leak check</b><p>Runs Valgrind - a tool to help you find memory-management problems in your programs."));
+
+ action = new KAction( i18n("P&rofile with KCachegrind"), 0, this,
+ SLOT(slotExecCalltree()), actionCollection(), "tools_calltree" );
+ action->setToolTip(i18n("Profile with KCachegrind"));
+ action->setWhatsThis(i18n("<b>Profile with KCachegrind</b><p>Runs your program in calltree and then displays profiler information in KCachegrind."));
+
+ mainWindow()->embedOutputView( m_widget, "Valgrind", i18n("Valgrind memory leak check") );
+}
+
+
+ValgrindPart::~ValgrindPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+ delete proc;
+}
+
+void ValgrindPart::projectOpened()
+{
+ _lastExec.truncate( 0 );
+}
+
+void ValgrindPart::loadOutput()
+{
+ QString fName = KFileDialog::getOpenFileName(QString::null, "*", 0, i18n("Open Valgrind Output"));
+ if ( fName.isEmpty() )
+ return;
+
+ QFile f( fName );
+ if ( !f.open( IO_ReadOnly ) ) {
+ KMessageBox::sorry( 0, i18n("Could not open valgrind output: %1").arg(fName) );
+ return;
+ }
+
+ clear();
+ getActiveFiles();
+
+ QTextStream stream( &f );
+ while ( !stream.atEnd() ) {
+ receivedString( stream.readLine() + "\n" );
+ }
+ f.close();
+}
+
+void ValgrindPart::getActiveFiles()
+{
+ activeFiles.clear();
+ if ( project() ) {
+ QStringList projectFiles = project()->allFiles();
+ QString projectDirectory = project()->projectDirectory();
+ KURL url;
+ for ( QStringList::Iterator it = projectFiles.begin(); it != projectFiles.end(); ++it ) {
+ KURL url( projectDirectory + "/" + (*it) );
+ url.cleanPath( true );
+ activeFiles += url.path();
+ kdDebug() << "set project file: " << url.path().latin1() << endl;
+ }
+ }
+}
+
+static void guessActiveItem( ValgrindItem& item, const QStringList activeFiles )
+{
+ if ( activeFiles.isEmpty() && item.backtrace().isEmpty() )
+ return;
+ for ( ValgrindItem::BacktraceList::Iterator it = item.backtrace().begin(); it != item.backtrace().end(); ++it ) {
+ // active: first line of backtrace that lies in project source file
+ for ( QStringList::ConstIterator it2 = activeFiles.begin(); it2 != activeFiles.end(); ++it2 ) {
+ if ( (*it).url() == (*it2) ) {
+ (*it).setHighlighted( true );
+ return;
+ }
+ }
+ }
+}
+
+void ValgrindPart::appendMessage( const QString& message )
+{
+ if ( message.isEmpty() )
+ return;
+
+ ValgrindItem item( message );
+ guessActiveItem( item, activeFiles );
+ m_widget->addMessage( item );
+}
+
+void ValgrindPart::slotExecValgrind()
+{
+ ValgrindDialog* dlg = new ValgrindDialog(ValgrindDialog::Memcheck);
+ if ( project() && _lastExec.isEmpty() ) {
+ dlg->setExecutable( project()->mainProgram() );
+ } else {
+ dlg->setExecutable( _lastExec );
+ }
+ dlg->setParameters( _lastParams );
+ dlg->setValExecutable( _lastValExec );
+ dlg->setValParams( _lastValParams );
+ kcInfo.runKc = false;
+ _lastValExec = dlg->valExecutable();
+ _lastValParams = dlg->valParams();
+ if ( dlg->exec() == QDialog::Accepted ) {
+ runValgrind( dlg->executableName(), dlg->parameters(), dlg->valExecutable(), dlg->valParams() );
+ }
+}
+
+void ValgrindPart::slotExecCalltree()
+{
+ ValgrindDialog* dlg = new ValgrindDialog(ValgrindDialog::Calltree);
+ if ( project() && _lastExec.isEmpty() ) {
+ dlg->setExecutable( project()->mainProgram() );
+ } else {
+ dlg->setExecutable( _lastExec );
+ }
+ dlg->setParameters( _lastParams );
+ dlg->setCtExecutable( _lastCtExec );
+ dlg->setKcExecutable( _lastKcExec );
+ dlg->setCtParams( _lastCtParams );
+ kcInfo.runKc = true;
+ kcInfo.kcPath = dlg->kcExecutable();
+// kcInfo.kcWorkDir = KURL(dlg->executableName()).directory();
+ if ( dlg->exec() == QDialog::Accepted ) {
+ runValgrind( dlg->executableName(), dlg->parameters(), dlg->ctExecutable(), dlg->ctParams() );
+ }
+ _lastKcExec = dlg->kcExecutable();
+ _lastCtExec = dlg->ctExecutable();
+ _lastCtParams = dlg->ctParams();
+}
+
+void ValgrindPart::slotKillValgrind()
+{
+ if ( proc )
+ proc->kill();
+}
+
+void ValgrindPart::slotStopButtonClicked( KDevPlugin* which )
+{
+ if ( which != 0 && which != this )
+ return;
+ slotKillValgrind();
+}
+
+void ValgrindPart::clear()
+{
+ m_widget->clear();
+ currentMessage = QString::null;
+ currentPid = -1;
+ lastPiece = QString::null;
+}
+
+void ValgrindPart::runValgrind( const QString& exec, const QString& params, const QString& valExec, const QString& valParams )
+{
+ if ( proc->isRunning() ) {
+ KMessageBox::sorry( 0, i18n( "There is already an instance of valgrind running." ) );
+ return;
+ /// @todo - ask for forced kill
+ }
+
+ clear();
+
+ getActiveFiles();
+
+// proc->setWorkingDirectory(KURL(exec).directory());
+ proc->clearArguments();
+
+ DomUtil::PairList run_envvars;
+ if (project())
+ run_envvars = project()->runEnvironmentVars();
+
+ QStringList envVarList;
+ DomUtil::PairList::ConstIterator it;
+ for (it = run_envvars.begin(); it != run_envvars.end(); ++it)
+ {
+ envVarList << QString("%1=\"%2\" ").arg((*it).first).arg((*it).second);
+ }
+
+ *proc << envVarList.join("") << valExec << valParams << exec << params;
+ proc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
+ mainWindow()->raiseView( m_widget );
+ core()->running( this, true );
+
+ _lastExec = exec;
+ _lastParams = params;
+}
+
+void ValgrindPart::receivedStdout( KProcess*, char* /* msg */, int /* len */ )
+{
+ //kdDebug() << "got StdOut: " <<QString::fromLocal8Bit( msg, len ) << endl;
+}
+
+void ValgrindPart::receivedStderr( KProcess*, char* msg, int len )
+{
+ receivedString( QString::fromLocal8Bit( msg, len ) );
+}
+
+void ValgrindPart::receivedString( const QString& str )
+{
+ QString rmsg = lastPiece + str;
+ QStringList lines = QStringList::split( "\n", rmsg );
+
+// kdDebug() << "got: " << QString::fromLocal8Bit( msg, len ) << endl;
+
+ if ( !rmsg.endsWith( "\n" ) ) {
+ // the last message is trucated, we'll receive
+ // the rest in the next call
+ lastPiece = lines.back();
+ lines.pop_back();
+ } else {
+ lastPiece = QString::null;
+ }
+ appendMessages( lines );
+}
+
+void ValgrindPart::appendMessages( const QStringList& lines )
+{
+ QRegExp valRe( "==(\\d+)== (.*)" );
+
+ for ( QStringList::ConstIterator it = lines.begin(); it != lines.end(); ++it ) {
+ if ( valRe.search( *it ) < 0 )
+ continue;
+
+ int cPid = valRe.cap( 1 ).toInt();
+
+ if ( valRe.cap( 2 ).isEmpty() ) {
+ appendMessage( currentMessage );
+ currentMessage = QString::null;
+ } else if ( cPid != currentPid ) {
+ appendMessage( currentMessage );
+ currentMessage = *it;
+ currentPid = cPid;
+ } else {
+ if ( !currentMessage.isEmpty() )
+ currentMessage += "\n";
+ currentMessage += *it;
+ }
+ }
+}
+
+void ValgrindPart::processExited( KProcess* p )
+{
+ if ( p == proc ) {
+ appendMessage( currentMessage + lastPiece );
+ currentMessage = QString::null;
+ lastPiece = QString::null;
+ core()->running( this, false );
+
+ if (kcInfo.runKc)
+ {
+ KProcess *kcProc = new KProcess;
+// kcProc->setWorkingDirectory(kcInfo.kcWorkDir);
+ *kcProc << kcInfo.kcPath;
+ *kcProc << QString("callgrind.out.%1").arg(p->pid());
+ kcProc->start(KProcess::DontCare);
+ }
+ }
+}
+
+void ValgrindPart::restorePartialProjectSession( const QDomElement* el )
+{
+ QDomElement execElem = el->namedItem( "executable" ).toElement();
+ _lastExec = execElem.attribute( "path", "" );
+ _lastParams = execElem.attribute( "params", "" );
+
+ QDomElement valElem = el->namedItem( "valgrind" ).toElement();
+ _lastValExec = valElem.attribute( "path", "" );
+ _lastValParams = valElem.attribute( "params", "" );
+
+ QDomElement ctElem = el->namedItem( "calltree" ).toElement();
+ _lastCtExec = ctElem.attribute( "path", "" );
+ _lastCtParams = ctElem.attribute( "params", "" );
+
+ QDomElement kcElem = el->namedItem( "kcachegrind" ).toElement();
+ _lastKcExec = kcElem.attribute( "path", "" );
+}
+
+void ValgrindPart::savePartialProjectSession( QDomElement* el )
+{
+ QDomDocument domDoc = el->ownerDocument();
+ if ( domDoc.isNull() )
+ return;
+
+ QDomElement execElem = domDoc.createElement( "executable" );
+ execElem.setAttribute( "path", _lastExec );
+ execElem.setAttribute( "params", _lastParams );
+
+ QDomElement valElem = domDoc.createElement( "valgrind" );
+ valElem.setAttribute( "path", _lastValExec );
+ valElem.setAttribute( "params", _lastValParams );
+
+ QDomElement ctElem = domDoc.createElement( "calltree" );
+ ctElem.setAttribute( "path", _lastCtExec );
+ ctElem.setAttribute( "params", _lastCtParams );
+
+ QDomElement kcElem = domDoc.createElement( "kcachegrind" );
+ kcElem.setAttribute( "path", _lastKcExec );
+
+ el->appendChild( execElem );
+ el->appendChild( valElem );
+ el->appendChild( ctElem );
+ el->appendChild( kcElem );
+}
+
+#include "valgrind_part.moc"
diff --git a/parts/valgrind/valgrind_part.h b/parts/valgrind/valgrind_part.h
new file mode 100644
index 00000000..097eb8f8
--- /dev/null
+++ b/parts/valgrind/valgrind_part.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2002 Harald Fernengel <harry@kdevelop.org>
+ */
+
+#ifndef __KDEVPART_VALGRIND_H__
+#define __KDEVPART_VALGRIND_H__
+
+#include <qguardedptr.h>
+#include <qstring.h>
+#include <qstringlist.h>
+#include <kdevplugin.h>
+
+class ValgrindWidget;
+class KProcess;
+
+class ValgrindPart : public KDevPlugin
+{
+ Q_OBJECT
+
+public:
+ ValgrindPart( QObject *parent, const char *name, const QStringList & );
+ ~ValgrindPart();
+
+ void runValgrind( const QString& exec, const QString& parameters, const QString& valExec, const QString& valParameters );
+
+ void savePartialProjectSession( QDomElement* el );
+ void restorePartialProjectSession( const QDomElement* el );
+
+private slots:
+ void slotExecValgrind();
+ void slotExecCalltree();
+ void slotKillValgrind();
+ void slotStopButtonClicked( KDevPlugin* which );
+ void receivedStdout( KProcess*, char*, int );
+ void receivedStderr( KProcess*, char*, int );
+ void processExited( KProcess* );
+ void loadOutput();
+ void projectOpened();
+
+private:
+ void getActiveFiles();
+ void appendMessage( const QString& message );
+ void appendMessages( const QStringList& lines );
+ void receivedString( const QString& str );
+ void clear();
+ QString _lastExec, _lastParams, _lastValExec, _lastValParams,
+ _lastCtExec, _lastCtParams, _lastKcExec;
+ KProcess* proc;
+ QString currentMessage;
+ QString lastPiece;
+ QStringList activeFiles;
+ int currentPid;
+ QGuardedPtr<ValgrindWidget> m_widget;
+ struct {
+ bool runKc;
+ QString kcPath;
+// QString kcWorkDir;
+ } kcInfo;
+};
+
+
+#endif
diff --git a/parts/valgrind/valgrind_widget.cpp b/parts/valgrind/valgrind_widget.cpp
new file mode 100644
index 00000000..356d97bf
--- /dev/null
+++ b/parts/valgrind/valgrind_widget.cpp
@@ -0,0 +1,205 @@
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpopupmenu.h>
+
+#include <kparts/part.h>
+#include <klibloader.h>
+#include <kurl.h>
+#include <kdebug.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+
+#include <kdevcore.h>
+#include <kdevpartcontroller.h>
+#include <kdevmainwindow.h>
+#include <kdevproject.h>
+
+#include "valgrind_part.h"
+#include "valgrind_widget.h"
+
+#define VALLISTVIEWITEMRTTI 130977
+
+// helper class to sort the ListView by item number instead of the string representation of the item number
+class ValListViewItem: public QListViewItem
+{
+public:
+ ValListViewItem( QListView* parent, int key, int pid, const QString& message ):
+ QListViewItem( parent, QString::number( key ), QString::number( pid ), message ),
+ _key( key ), _pid ( pid ), backtrace( false ), _line( -1 ), _active( false ) {}
+
+ ValListViewItem( ValListViewItem* parent, int key, int pid, const QString& message, const QString& filename, int line, bool active ):
+ QListViewItem( parent, QString::number( key ), QString::null, message ),
+ _key( key ), _pid( pid ), backtrace( true ), _filename( filename ), _line( line ), _active( active )
+ {
+ if ( parent->_pid != _pid && _pid > 0 )
+ setText( 1, QString::number( _pid ) );
+ }
+
+ virtual ~ValListViewItem();
+
+ static int intCompare( int i1, int i2 )
+ {
+ if ( i1 > i2 )
+ return 1;
+ else if ( i1 < i2 )
+ return -1;
+ else
+ return 0;
+ }
+
+ int compare( QListViewItem* i, int col, bool ascending ) const
+ {
+ if ( !i || i->rtti() != VALLISTVIEWITEMRTTI )
+ return QListViewItem::compare( i, col, ascending );
+ switch ( col ) {
+ case 0 : return intCompare( ((ValListViewItem*)i)->_key, _key );
+ case 1 : return intCompare( ((ValListViewItem*)i)->_pid, _pid );
+ default: return QListViewItem::compare( i, col, ascending );
+ }
+ }
+
+ void paintCell( QPainter* p, const QColorGroup& cg, int column, int width, int align )
+ {
+ if ( _active ) {
+ QFont fnt = p->font();
+ fnt.setBold( true );
+ p->setFont( fnt );
+ }
+ QListViewItem::paintCell( p, cg, column, width, align );
+ }
+
+ int rtti() const { return VALLISTVIEWITEMRTTI; }
+
+ QString fileName() const { return _filename; }
+ int line() const { return _line; }
+ QString message() const { return text( 2 ); }
+ bool isHighlighted() const { return _active; }
+
+private:
+ int _key;
+ int _pid;
+ bool backtrace;
+ QString _filename;
+ int _line;
+ bool _active;
+};
+
+ValListViewItem::~ValListViewItem() {}
+
+ValgrindWidget::ValgrindWidget( ValgrindPart *part )
+ : QWidget(0, "valgrind widget"), _part( part )
+{
+ QVBoxLayout* vbl = new QVBoxLayout( this );
+ lv = new KListView( this );
+ lv->addColumn( i18n( "No." ) );
+ lv->addColumn( i18n( "Thread" ) );
+ lv->addColumn( i18n( "Message" ) );
+ lv->setSorting( 0, false );
+ lv->setRootIsDecorated( true );
+ lv->setAllColumnsShowFocus( true );
+ vbl->addWidget( lv );
+
+ popup = new QPopupMenu( lv, "valPopup" );
+ popup->insertItem( i18n( "&Open Valgrind Output..." ), _part, SLOT(loadOutput()), 0, 0 );
+ popup->insertSeparator();
+ popup->insertItem( i18n( "Expand All Items" ), this, SLOT(expandAll()), 0, 2 );
+ popup->insertItem( i18n( "Collapse All Items" ), this, SLOT(collapseAll()), 0, 3 );
+
+ connect( popup, SIGNAL(aboutToShow()),
+ this, SLOT(aboutToShowPopup()) );
+ connect( lv, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(executed(QListViewItem*)) );
+ connect( lv, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
+ this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );
+}
+
+
+ValgrindWidget::~ValgrindWidget()
+{
+}
+
+void ValgrindWidget::clear()
+{
+ lv->clear();
+ msgNumber = 1;
+}
+
+void ValgrindWidget::addMessage( const ValgrindItem& vi )
+{
+ QStringList projectFiles;
+ QString projectDirectory;
+
+ ValListViewItem* lvi = new ValListViewItem( lv, msgNumber++, vi.pid(), vi.message() );
+ lvi->setMultiLinesEnabled( true );
+ const ValgrindItem::BacktraceList backtrace = vi.backtrace();
+ if ( !backtrace.isEmpty() )
+ lvi->setExpandable( true );
+
+ int i = 0;
+ for ( ValgrindItem::BacktraceList::ConstIterator it = backtrace.begin(); it != backtrace.end(); ++it ) {
+ new ValListViewItem( lvi, ++i, (*it).pid(), (*it).message(), (*it).url(), (*it).line(), (*it).isHighlighted() );
+ }
+}
+
+void ValgrindWidget::executed( QListViewItem* lvi )
+{
+ Q_ASSERT( _part );
+ Q_ASSERT( _part->partController() );
+ Q_ASSERT( _part->mainWindow() );
+
+ if ( !lvi || lvi->rtti() != VALLISTVIEWITEMRTTI )
+ return;
+ ValListViewItem* vli = 0;
+ if ( !((ValListViewItem*)lvi)->fileName().isEmpty() ) {
+ vli = (ValListViewItem*)lvi;
+ } else if ( lvi->isExpandable() ) {
+ // find the memleak position
+ QListViewItemIterator it( lv );
+ while ( vli == 0 && it.current() ) {
+ if ( it.current()->rtti() == VALLISTVIEWITEMRTTI && ((ValListViewItem*)it.current())->isHighlighted() )
+ vli = (ValListViewItem*)it.current();
+ ++it;
+ }
+ }
+ if ( vli ) {
+ // display the file
+ _part->partController()->editDocument( KURL( vli->fileName() ), vli->line() - 1 );
+ _part->mainWindow()->statusBar()->message( vli->message(), 10000 );
+ }
+}
+
+void ValgrindWidget::expandAll()
+{
+ QListViewItem* child = lv->firstChild();
+ while ( child ) {
+ child->setOpen( true );
+ child = child->nextSibling();
+ }
+}
+
+void ValgrindWidget::collapseAll()
+{
+ QListViewItem* child = lv->firstChild();
+ while ( child ) {
+ child->setOpen( false );
+ child = child->nextSibling();
+ }
+}
+
+void ValgrindWidget::aboutToShowPopup()
+{
+ bool en = (lv->firstChild() != 0);
+ popup->setItemEnabled( 2, en );
+ popup->setItemEnabled( 3, en );
+}
+
+void ValgrindWidget::slotContextMenu( KListView* l, QListViewItem* /*i*/, const QPoint& p )
+{
+ if ( l != lv )
+ return;
+
+ popup->exec( p );
+}
+
+#include "valgrind_widget.moc"
diff --git a/parts/valgrind/valgrind_widget.h b/parts/valgrind/valgrind_widget.h
new file mode 100644
index 00000000..1777e183
--- /dev/null
+++ b/parts/valgrind/valgrind_widget.h
@@ -0,0 +1,44 @@
+#ifndef __VALGRIND_WIDGET_H__
+#define __VALGRIND_WIDGET_H__
+
+#include <qwidget.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include "valgrinditem.h"
+
+class ValgrindPart;
+class KListView;
+class QListViewItem;
+class QPopupMenu;
+
+class ValgrindWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ValgrindWidget( ValgrindPart *part );
+ ~ValgrindWidget();
+
+ void addMessage( const ValgrindItem& vi );
+ void clear();
+
+signals:
+ void jumpToFile( const QString& url, int line );
+
+private slots:
+ void executed( QListViewItem* item );
+ void slotContextMenu( KListView* l, QListViewItem* i, const QPoint& p );
+ void expandAll();
+ void collapseAll();
+ void aboutToShowPopup();
+
+private:
+ KListView* lv;
+ int msgNumber;
+ ValgrindPart* _part;
+ QPopupMenu* popup;
+};
+
+
+#endif
diff --git a/parts/valgrind/valgrinditem.cpp b/parts/valgrind/valgrinditem.cpp
new file mode 100644
index 00000000..318254d3
--- /dev/null
+++ b/parts/valgrind/valgrinditem.cpp
@@ -0,0 +1,71 @@
+#include "valgrinditem.h"
+
+#include <qregexp.h>
+#include <qstringlist.h>
+
+#include <kdebug.h>
+
+ValgrindBacktraceItem::ValgrindBacktraceItem( const QString& rawOutput ): _rawOutput( rawOutput ), _highlight( false )
+{
+ QRegExp re1( "^==(\\d+)==\\s+(by|at) (0x[\\dABCDEF]+): (.*) \\((.*):(\\d+)\\)$" );
+ QRegExp re2( "^==(\\d+)==\\s+(by|at) (0x[\\dABCDEF]+): (.*) \\(in (.*)\\)$" );
+ QRegExp valRe( "==(\\d+)== (.*)" );
+ if ( valRe.search( _rawOutput ) >= 0 )
+ _message = valRe.cap( 2 );
+ if ( re1.search( _rawOutput ) >= 0 ) {
+ _type = SourceCode;
+ _pid = re1.cap( 1 ).toInt();
+ _address = re1.cap( 3 );
+ _function = re1.cap( 4 );
+ _url = re1.cap( 5 );
+ _line = re1.cap( 6 ).toInt();
+ } else if ( re2.search( _rawOutput ) >= 0 ) {
+ _type = Library;
+ _pid = re2.cap( 1 ).toInt();
+ _address = re2.cap( 3 );
+ _function = re2.cap( 4 );
+ _url = re2.cap( 5 );
+ _line = -1;
+ } else {
+ _type = Unknown;
+ _line = -1;
+ _pid = -1;
+ }
+}
+
+ValgrindBacktraceItem::~ValgrindBacktraceItem()
+{
+}
+
+
+ValgrindItem::ValgrindItem( const QString& message ): _pid(-1)
+{
+ QRegExp valRe( "==(\\d+)== (.*)" );
+ QStringList lines = QStringList::split( "\n", message );
+ QString curMsg;
+
+ for ( QStringList::ConstIterator it = lines.begin(); it != lines.end(); ++it ) {
+ if ( valRe.search( *it ) < 0 ) {
+ kdDebug() << "ValgrindItem: got unrecognizable line '" << *it << "'" << endl;
+ continue; // not of interest
+ }
+ if ( _pid == -1 )
+ _pid = valRe.cap( 1 ).toInt();
+ curMsg = valRe.cap( 2 );
+
+ if ( curMsg.startsWith( " " ) ) {
+ _backtrace.append( ValgrindBacktraceItem( *it ) );
+ } else {
+ if ( !_message.isEmpty() )
+ _message += "\n";
+ _message += curMsg;
+ }
+ }
+// static int i = 0;
+// kdDebug() << "got: " << ++i << ": " << _message << endl << message << endl;
+}
+
+
+ValgrindItem::~ValgrindItem()
+{
+}
diff --git a/parts/valgrind/valgrinditem.h b/parts/valgrind/valgrinditem.h
new file mode 100644
index 00000000..12784c42
--- /dev/null
+++ b/parts/valgrind/valgrinditem.h
@@ -0,0 +1,50 @@
+#ifndef _VALGRINDITEM_H_
+#define _VALGRINDITEM_H_
+
+#include <qvaluelist.h>
+#include <qstring.h>
+
+class ValgrindBacktraceItem
+{
+public:
+ enum Type { Unknown, SourceCode, Library };
+ ValgrindBacktraceItem( const QString& rawOutput = QString::null );
+ ~ValgrindBacktraceItem();
+
+ QString message() const { return _message; }
+ QString address() const { return _address; }
+ QString url() const { return _url; }
+ QString function() const { return _function; }
+ int line() const { return _line; }
+ int pid() const { return _pid; }
+ Type type() const { return _type; }
+ bool isHighlighted() const { return _highlight; }
+ void setHighlighted( bool h ) { _highlight = h; }
+
+private:
+ QString _rawOutput, _address, _url, _function, _message;
+ int _line;
+ int _pid;
+ Type _type;
+ bool _highlight;
+};
+
+class ValgrindItem
+{
+public:
+ ValgrindItem( const QString& message );
+ ~ValgrindItem();
+
+ typedef QValueList<ValgrindBacktraceItem> BacktraceList;
+ BacktraceList& backtrace() { return _backtrace; }
+ const BacktraceList& backtrace() const { return _backtrace; }
+ QString message() const { return _message; }
+ int pid() const { return _pid; }
+
+private:
+ BacktraceList _backtrace;
+ QString _message;
+ int _pid;
+};
+
+#endif
diff --git a/parts/vcsmanager/Makefile.am b/parts/vcsmanager/Makefile.am
new file mode 100644
index 00000000..c3d19403
--- /dev/null
+++ b/parts/vcsmanager/Makefile.am
@@ -0,0 +1,19 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevvcsmanager.la
+libkdevvcsmanager_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevvcsmanager_la_LIBADD = $(top_builddir)/lib/libkdevelop.la
+
+libkdevvcsmanager_la_SOURCES = vcsmanagerpart.cpp \
+ vcsmanagerprojectconfigbase.ui vcsmanagerprojectconfig.cpp
+
+METASOURCES = AUTO
+
+appsharedir = $(kde_datadir)/kdevvcsmanager
+appshare_DATA =
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevvcsmanager.desktop
+
+rcdir = $(kde_datadir)/kdevvcsmanager
+
diff --git a/parts/vcsmanager/README.dox b/parts/vcsmanager/README.dox
new file mode 100644
index 00000000..1e6c6327
--- /dev/null
+++ b/parts/vcsmanager/README.dox
@@ -0,0 +1,55 @@
+/** \class VCSManager
+Put a brief description here, the brief description ends at the first dot.
+Put a more detailed description of your part in these lines. It can span
+over several lines. You can even use some html commands in these lines like:
+<code>This is code</code>, html links <a href="http://somelocation">link text</a>,
+and images.
+
+\authors <a href="mailto:jens.dagerbo@swipnet.se">Jens Dagerbo</a>
+\authors <a href="mailto:2nd author AT provider.com">2nd author full name</a>
+...
+\authors <a href="mailto:nth author AT provider.com">nth author full name</a>
+
+\maintainer <a href="mailto:jens.dagerbo@swipnet.se">Jens Dagerbo</a>
+\maintainer <a href="mailto:2nd maintainer AT provider.com">2nd maintainer full name</a>
+...
+\maintainer <a href="mailto:nth maintainer AT provider.com">nth maintainer full name</a>
+
+\feature Describe the first feature
+\feature Describe the second feature
+...
+\feature Describe the last feature
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=YOUR_COMPONENT_NAME&
+bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">
+YOUR_COMPONENT_NAME at Bugzilla database</a>
+\bug Describe a the 1st bug that you know of, but probably hasn't been reported yet.
+..
+\bug Describe a the nth bug that you know of, but probably hasn't been reported yet.
+
+\requirement Describe a the 1st requirement of your part.
+\requirement Describe a the 2nd requirement of your part.
+...
+\requirement Describe a the nth requirement of your part.
+
+\todo Describe a the 1st TODO of your part.
+\todo Describe a the 2nd TODO of your part.
+...
+\todo Describe a the nth TODO of your part.
+
+\faq <b>First frequenly asked question about your part ?</b> Answer.
+\faq <b>Second frequenly asked question about your part ?</b> Answer.
+...
+\faq <b>Last frequenly asked question about your part ?</b> Answer.
+
+\note First note text.
+\note Second note text.
+...
+\note Last note text.
+
+\warning First warning text.
+\warning Second warning text.
+...
+\warning Last warning text.
+
+*/
diff --git a/parts/vcsmanager/kdevvcsmanager.desktop b/parts/vcsmanager/kdevvcsmanager.desktop
new file mode 100644
index 00000000..ca647ba3
--- /dev/null
+++ b/parts/vcsmanager/kdevvcsmanager.desktop
@@ -0,0 +1,65 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Name=KDevVCSManager
+Name[da]=KDevelop VCS-håndtering
+Name[nds]=KDevelop-VKS-Pleger
+Name[sk]=KDev VCS manažér
+Name[sv]=KDevelop VCS-hantering
+Name[tg]=РоҳбариKDevVCS
+Name[zh_TW]=KDevelop VCS 管理器
+GenericName=VCSManager
+GenericName[da]=VCS-håndtering
+GenericName[fa]=مدیر VCS
+GenericName[nds]=VKS-Pleger
+GenericName[ru]=Управление системами контроля версий
+GenericName[sk]=VCS manažér
+GenericName[sl]=Upravitelj VCS
+GenericName[sr]=VCS менаџер
+GenericName[sr@Latn]=VCS menadžer
+GenericName[sv]=VCS-hantering
+GenericName[tg]=РоҳбариVCS
+GenericName[zh_TW]=VCS 管理員
+Comment=Version Control System Manager
+Comment[ca]=Gestor per al sistema de control de versions
+Comment[da]=Versionskontrolsystem-håndtering
+Comment[de]=Verwaltung für VCS
+Comment[el]=Διαχειριστής συστήματος ελέγχου εκδόσεων
+Comment[es]=Administrador de sistemas de control de versiones
+Comment[et]=Versioonikontrollisüsteemi haldur
+Comment[eu]=Version Control System (VCS) kudeatzailea
+Comment[fa]=مدیر سیستم کنترل نسخه
+Comment[fr]=Gestionnaire du système de contrôle de versions
+Comment[gl]=Xestor do Sistema de control de versións
+Comment[hu]=Kezelőfelület verziókövető rendszerekhez
+Comment[it]=Gestore Sistema Controllo Versione
+Comment[ms]=Pengurus Sistem Kawalan Versi
+Comment[nds]=VKS-Pleger
+Comment[ne]=संस्करण नियन्त्रण प्रणाली प्रबन्धक
+Comment[nl]=Versie Controle Systeem-beheerder
+Comment[pl]=Menedżer Systemu kontroli wersji
+Comment[pt]=Gestor de Sistema de Controlo de Versão
+Comment[pt_BR]=Gerenciador do Sistema de Controle de Versão
+Comment[ru]=Управление системами контроля версий
+Comment[sk]=Manažér systému riadenia verzií
+Comment[sl]=Upravitelj sistema za nadzor različic
+Comment[sr]=Менаџер система контроле верзија
+Comment[sr@Latn]=Menadžer sistema kontrole verzija
+Comment[sv]=Hantering av versionskontrollsystem
+Comment[tr]=Sürüm Kontrol Sistemi Yöneticisi
+Comment[zh_CN]=版本控制系统管理器
+Comment[zh_TW]=版本控制系統管理員
+Icon=kdevelop
+ServiceTypes=KDevelop/Plugin
+
+X-KDevelop-Plugin-Version=1
+X-KDevelop-Plugin-Homepage=
+X-KDevelop-Plugin-BugsEmailAddress=jens.dagerbo@swipnet.se
+X-KDevelop-Plugin-Copyright=(C) by Jens Dagerbo
+
+X-KDevelop-Args=
+
+X-KDevelop-Scope=Core
+X-KDE-Library=libkdevvcsmanager
+X-KDevelop-Version=5
+X-KDevelop-Properties=VCS
diff --git a/parts/vcsmanager/vcsmanagerpart.cpp b/parts/vcsmanager/vcsmanagerpart.cpp
new file mode 100644
index 00000000..1cafb8eb
--- /dev/null
+++ b/parts/vcsmanager/vcsmanagerpart.cpp
@@ -0,0 +1,115 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "vcsmanagerpart.h"
+
+#include <qtimer.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+
+#include <klocale.h>
+#include <kaction.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kdevplugininfo.h>
+#include <kdevgenericfactory.h>
+#include <kdebug.h>
+
+#include <kdevcore.h>
+#include <kdevmainwindow.h>
+#include <configwidgetproxy.h>
+#include <kdevplugincontroller.h>
+#include "domutil.h"
+
+#include "vcsmanagerprojectconfig.h"
+
+typedef KDevGenericFactory<VCSManagerPart> VCSManagerFactory;
+KDevPluginInfo data("kdevvcsmanager");
+K_EXPORT_COMPONENT_FACTORY( libkdevvcsmanager, VCSManagerFactory( data ) )
+
+#define GLOBALDOC_OPTIONS 1
+#define PROJECTDOC_OPTIONS 2
+
+VCSManagerPart::VCSManagerPart(QObject *parent, const char *name, const QStringList &/*args*/)
+ : KDevPlugin(&data, parent, name ? name : "VCSManagerPart")
+{
+ kdDebug() << " ********** VCSManagerPart::VCSManagerPart() ************** " << endl;
+
+ setInstance(VCSManagerFactory::instance());
+// setXMLFile("kdevvcsmanager.rc");
+
+ m_configProxy = new ConfigWidgetProxy(core());
+ m_configProxy->createProjectConfigPage(i18n("Version Control"), PROJECTDOC_OPTIONS, info()->icon());
+ connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )),
+ this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)));
+
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+}
+
+VCSManagerPart::~VCSManagerPart()
+{
+ delete m_configProxy;
+}
+
+void VCSManagerPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo)
+{
+ switch (pageNo)
+ {
+ case PROJECTDOC_OPTIONS:
+ {
+ VCSManagerProjectConfig *w = new VCSManagerProjectConfig(this, page, "project config");
+ connect(dlg, SIGNAL(okClicked()), w, SLOT(accept()));
+ break;
+ }
+ }
+}
+
+void VCSManagerPart::projectOpened()
+{
+ loadVCSPlugin();
+}
+
+void VCSManagerPart::loadVCSPlugin()
+{
+ unloadVCSPlugin();
+
+ QDomDocument & dom = *projectDom();
+ m_vcsPluginName = DomUtil::readEntry( dom, "/general/versioncontrol" ).stripWhiteSpace();
+ if ( m_vcsPluginName.isEmpty() ) return;
+
+ QString constraint = QString( "DesktopEntryName=='%1'" ).arg( m_vcsPluginName );
+ pluginController()->loadPlugin( "KDevelop/VersionControl", constraint );
+}
+
+void VCSManagerPart::unloadVCSPlugin()
+{
+ if ( !m_vcsPluginName.isEmpty() )
+ {
+ pluginController()->unloadPlugin( m_vcsPluginName );
+ }
+}
+
+QString VCSManagerPart::vcsPlugin()
+{
+ return m_vcsPluginName;
+}
+
+#include "vcsmanagerpart.moc"
diff --git a/parts/vcsmanager/vcsmanagerpart.h b/parts/vcsmanager/vcsmanagerpart.h
new file mode 100644
index 00000000..631373da
--- /dev/null
+++ b/parts/vcsmanager/vcsmanagerpart.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+* Copyright (C) 2005 by Jens Dagerbo *
+* jens.dagerbo@swipnet.se *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+
+#ifndef KDEVVCSMANAGER_H
+#define KDEVVCSMANAGER_H
+
+#include <kdevplugin.h>
+
+#include <qguardedptr.h>
+
+class QPopupMenu;
+class KAction;
+class KDialogBase;
+class Context;
+class ConfigWidgetProxy;
+class VCSManagerWidget;
+
+/**
+Please read the README.dox file for more info about this part
+*/
+class VCSManagerPart: public KDevPlugin
+{
+ Q_OBJECT
+public:
+ VCSManagerPart(QObject *parent, const char *name, const QStringList &args);
+ ~VCSManagerPart();
+ QString vcsPlugin();
+ void loadVCSPlugin();
+ void unloadVCSPlugin();
+
+private slots:
+ void insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo);
+ void projectOpened();
+
+private:
+ QString m_vcsPluginName;
+ ConfigWidgetProxy *m_configProxy;
+};
+
+#endif
diff --git a/parts/vcsmanager/vcsmanagerprojectconfig.cpp b/parts/vcsmanager/vcsmanagerprojectconfig.cpp
new file mode 100644
index 00000000..07986a88
--- /dev/null
+++ b/parts/vcsmanager/vcsmanagerprojectconfig.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <qcombobox.h>
+#include <qstring.h>
+
+#include <ktrader.h>
+#include <klocale.h>
+
+#include "domutil.h"
+
+#include "vcsmanagerprojectconfig.h"
+#include "vcsmanagerpart.h"
+
+VCSManagerProjectConfig::VCSManagerProjectConfig( VCSManagerPart *part, QWidget *parent, const char *name )
+ : VCSManagerProjectConfigBase( parent, name ), m_part( part )
+{
+ setup();
+}
+
+void VCSManagerProjectConfig::accept()
+{
+ QString vcsPluginName = *m_vcsPluginNames.at( vcsCombo->currentItem() );
+
+ QDomDocument & dom = *m_part->projectDom();
+ DomUtil::writeEntry( dom, "/general/versioncontrol", vcsPluginName );
+
+ m_part->loadVCSPlugin();
+}
+
+void VCSManagerProjectConfig::setup( )
+{
+ vcsCombo->insertItem( i18n("No Version Control System", "None"), 0 );
+ m_vcsPluginNames << "";
+
+ int current = 0;
+
+ QString constraint = QString("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/VersionControl", constraint );
+ KTrader::OfferList::const_iterator it = offers.begin();
+ for ( int i = 1; it != offers.end(); ++it, ++i )
+ {
+ vcsCombo->insertItem( (*it)->genericName(), i );
+ m_vcsPluginNames << (*it)->desktopEntryName();
+ if ( (*it)->desktopEntryName() == m_part->vcsPlugin() )
+ {
+ current = i;
+ }
+ }
+ vcsCombo->setCurrentItem( current );
+}
+
+#include "vcsmanagerprojectconfig.moc"
diff --git a/parts/vcsmanager/vcsmanagerprojectconfig.h b/parts/vcsmanager/vcsmanagerprojectconfig.h
new file mode 100644
index 00000000..b1558008
--- /dev/null
+++ b/parts/vcsmanager/vcsmanagerprojectconfig.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+* Copyright (C) 2005 by Jens Dagerbo *
+* jens.dagerbo@swipnet.se *
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU General Public License for more details. *
+* *
+* You should have received a copy of the GNU General Public License *
+* along with this program; if not, write to the *
+* Free Software Foundation, Inc., *
+* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+***************************************************************************/
+
+#ifndef VCSMANAGER_PROJECT_CONFIG_H
+#define VCSMANAGER_PROJECT_CONFIG_H
+
+#include <ktrader.h>
+#include "vcsmanagerprojectconfigbase.h"
+
+class VCSManagerPart;
+
+class VCSManagerProjectConfig: public VCSManagerProjectConfigBase
+{
+ Q_OBJECT
+public:
+ VCSManagerProjectConfig( VCSManagerPart *part, QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ void accept();
+
+private:
+ void setup();
+
+ VCSManagerPart * m_part;
+ QStringList m_vcsPluginNames;
+};
+
+#endif
diff --git a/parts/vcsmanager/vcsmanagerprojectconfigbase.ui b/parts/vcsmanager/vcsmanagerprojectconfigbase.ui
new file mode 100644
index 00000000..735a018f
--- /dev/null
+++ b/parts/vcsmanager/vcsmanagerprojectconfigbase.ui
@@ -0,0 +1,58 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>VCSManagerProjectConfigBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>VCSManagerProjectConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Version control system to use for this project:</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>vcsCombo</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>31</width>
+ <height>131</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/pics/Makefile.am b/pics/Makefile.am
new file mode 100644
index 00000000..e2012f04
--- /dev/null
+++ b/pics/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = mini toolbar misc
+KDE_ICON = AUTO
diff --git a/pics/hi16-app-kdevassistant.png b/pics/hi16-app-kdevassistant.png
new file mode 100644
index 00000000..52080a46
--- /dev/null
+++ b/pics/hi16-app-kdevassistant.png
Binary files differ
diff --git a/pics/hi16-app-kdevdesigner.png b/pics/hi16-app-kdevdesigner.png
new file mode 100644
index 00000000..8286c826
--- /dev/null
+++ b/pics/hi16-app-kdevdesigner.png
Binary files differ
diff --git a/pics/hi16-app-kdevelop.png b/pics/hi16-app-kdevelop.png
new file mode 100644
index 00000000..344b3408
--- /dev/null
+++ b/pics/hi16-app-kdevelop.png
Binary files differ
diff --git a/pics/hi32-app-kdevassistant.png b/pics/hi32-app-kdevassistant.png
new file mode 100644
index 00000000..ea042cf3
--- /dev/null
+++ b/pics/hi32-app-kdevassistant.png
Binary files differ
diff --git a/pics/hi32-app-kdevdesigner.png b/pics/hi32-app-kdevdesigner.png
new file mode 100644
index 00000000..2de4d679
--- /dev/null
+++ b/pics/hi32-app-kdevdesigner.png
Binary files differ
diff --git a/pics/hi32-app-kdevelop.png b/pics/hi32-app-kdevelop.png
new file mode 100644
index 00000000..ae385aaf
--- /dev/null
+++ b/pics/hi32-app-kdevelop.png
Binary files differ
diff --git a/pics/hi48-app-kdevassistant.png b/pics/hi48-app-kdevassistant.png
new file mode 100644
index 00000000..29d27dd7
--- /dev/null
+++ b/pics/hi48-app-kdevassistant.png
Binary files differ
diff --git a/pics/hi48-app-kdevdesigner.png b/pics/hi48-app-kdevdesigner.png
new file mode 100644
index 00000000..df634b85
--- /dev/null
+++ b/pics/hi48-app-kdevdesigner.png
Binary files differ
diff --git a/pics/hi48-app-kdevelop.png b/pics/hi48-app-kdevelop.png
new file mode 100644
index 00000000..4550c661
--- /dev/null
+++ b/pics/hi48-app-kdevelop.png
Binary files differ
diff --git a/pics/mini/CTchildren.png b/pics/mini/CTchildren.png
new file mode 100644
index 00000000..0e7b7b42
--- /dev/null
+++ b/pics/mini/CTchildren.png
Binary files differ
diff --git a/pics/mini/CTclients.png b/pics/mini/CTclients.png
new file mode 100644
index 00000000..eabd0dfc
--- /dev/null
+++ b/pics/mini/CTclients.png
Binary files differ
diff --git a/pics/mini/CTparents.png b/pics/mini/CTparents.png
new file mode 100644
index 00000000..2c7e7d21
--- /dev/null
+++ b/pics/mini/CTparents.png
Binary files differ
diff --git a/pics/mini/CTsuppliers.png b/pics/mini/CTsuppliers.png
new file mode 100644
index 00000000..3f0e6fd7
--- /dev/null
+++ b/pics/mini/CTsuppliers.png
Binary files differ
diff --git a/pics/mini/CTvirtuals.png b/pics/mini/CTvirtuals.png
new file mode 100644
index 00000000..1ebc2fe4
--- /dev/null
+++ b/pics/mini/CTvirtuals.png
Binary files differ
diff --git a/pics/mini/CVclass.png b/pics/mini/CVclass.png
new file mode 100644
index 00000000..6bd89933
--- /dev/null
+++ b/pics/mini/CVclass.png
Binary files differ
diff --git a/pics/mini/CVglobal_meth.png b/pics/mini/CVglobal_meth.png
new file mode 100644
index 00000000..a7bb6659
--- /dev/null
+++ b/pics/mini/CVglobal_meth.png
Binary files differ
diff --git a/pics/mini/CVglobal_var.png b/pics/mini/CVglobal_var.png
new file mode 100644
index 00000000..f7f85455
--- /dev/null
+++ b/pics/mini/CVglobal_var.png
Binary files differ
diff --git a/pics/mini/CVnamespace.png b/pics/mini/CVnamespace.png
new file mode 100644
index 00000000..37a9ae28
--- /dev/null
+++ b/pics/mini/CVnamespace.png
Binary files differ
diff --git a/pics/mini/CVpackage_meth.png b/pics/mini/CVpackage_meth.png
new file mode 100644
index 00000000..4b26f25b
--- /dev/null
+++ b/pics/mini/CVpackage_meth.png
Binary files differ
diff --git a/pics/mini/CVpackage_var.png b/pics/mini/CVpackage_var.png
new file mode 100644
index 00000000..66b9f38e
--- /dev/null
+++ b/pics/mini/CVpackage_var.png
Binary files differ
diff --git a/pics/mini/CVprivate_meth.png b/pics/mini/CVprivate_meth.png
new file mode 100644
index 00000000..45c7b3e1
--- /dev/null
+++ b/pics/mini/CVprivate_meth.png
Binary files differ
diff --git a/pics/mini/CVprivate_signal.png b/pics/mini/CVprivate_signal.png
new file mode 100644
index 00000000..114a7148
--- /dev/null
+++ b/pics/mini/CVprivate_signal.png
Binary files differ
diff --git a/pics/mini/CVprivate_slot.png b/pics/mini/CVprivate_slot.png
new file mode 100644
index 00000000..e9b8ecd6
--- /dev/null
+++ b/pics/mini/CVprivate_slot.png
Binary files differ
diff --git a/pics/mini/CVprivate_var.png b/pics/mini/CVprivate_var.png
new file mode 100644
index 00000000..4bf6180c
--- /dev/null
+++ b/pics/mini/CVprivate_var.png
Binary files differ
diff --git a/pics/mini/CVprotected_meth.png b/pics/mini/CVprotected_meth.png
new file mode 100644
index 00000000..fe96d4db
--- /dev/null
+++ b/pics/mini/CVprotected_meth.png
Binary files differ
diff --git a/pics/mini/CVprotected_signal.png b/pics/mini/CVprotected_signal.png
new file mode 100644
index 00000000..07aef0b3
--- /dev/null
+++ b/pics/mini/CVprotected_signal.png
Binary files differ
diff --git a/pics/mini/CVprotected_slot.png b/pics/mini/CVprotected_slot.png
new file mode 100644
index 00000000..db084899
--- /dev/null
+++ b/pics/mini/CVprotected_slot.png
Binary files differ
diff --git a/pics/mini/CVprotected_var.png b/pics/mini/CVprotected_var.png
new file mode 100644
index 00000000..f97903f0
--- /dev/null
+++ b/pics/mini/CVprotected_var.png
Binary files differ
diff --git a/pics/mini/CVpublic_meth.png b/pics/mini/CVpublic_meth.png
new file mode 100644
index 00000000..56063b02
--- /dev/null
+++ b/pics/mini/CVpublic_meth.png
Binary files differ
diff --git a/pics/mini/CVpublic_signal.png b/pics/mini/CVpublic_signal.png
new file mode 100644
index 00000000..5a101850
--- /dev/null
+++ b/pics/mini/CVpublic_signal.png
Binary files differ
diff --git a/pics/mini/CVpublic_slot.png b/pics/mini/CVpublic_slot.png
new file mode 100644
index 00000000..b04b49de
--- /dev/null
+++ b/pics/mini/CVpublic_slot.png
Binary files differ
diff --git a/pics/mini/CVpublic_var.png b/pics/mini/CVpublic_var.png
new file mode 100644
index 00000000..d17730e7
--- /dev/null
+++ b/pics/mini/CVpublic_var.png
Binary files differ
diff --git a/pics/mini/CVstruct.png b/pics/mini/CVstruct.png
new file mode 100644
index 00000000..ec953add
--- /dev/null
+++ b/pics/mini/CVstruct.png
Binary files differ
diff --git a/pics/mini/CVtypedef.png b/pics/mini/CVtypedef.png
new file mode 100644
index 00000000..4867dfa3
--- /dev/null
+++ b/pics/mini/CVtypedef.png
Binary files differ
diff --git a/pics/mini/Makefile.am b/pics/mini/Makefile.am
new file mode 100644
index 00000000..94e74ffb
--- /dev/null
+++ b/pics/mini/Makefile.am
@@ -0,0 +1,8 @@
+minipicsdir = $(kde_datadir)/kdevclassview/pics
+minipics_DATA = CTchildren.png CTclients.png CTparents.png CTsuppliers.png \
+ CTvirtuals.png CVclass.png CVglobal_meth.png CVglobal_var.png CVnamespace.png \
+ CVprivate_meth.png CVprivate_signal.png CVprivate_slot.png CVprivate_var.png \
+ CVprotected_meth.png CVprotected_signal.png CVprotected_slot.png CVprotected_var.png \
+ CVpublic_meth.png CVpublic_signal.png CVpublic_slot.png CVpublic_var.png CVstruct.png \
+ CVpackage_meth.png CVpackage_var.png CVtypedef.png
+
diff --git a/pics/mini/indicator_connect.png b/pics/mini/indicator_connect.png
new file mode 100644
index 00000000..bb73c26f
--- /dev/null
+++ b/pics/mini/indicator_connect.png
Binary files differ
diff --git a/pics/mini/indicator_noconnect.png b/pics/mini/indicator_noconnect.png
new file mode 100644
index 00000000..356770ea
--- /dev/null
+++ b/pics/mini/indicator_noconnect.png
Binary files differ
diff --git a/pics/misc/Makefile.am b/pics/misc/Makefile.am
new file mode 100644
index 00000000..b12d716e
--- /dev/null
+++ b/pics/misc/Makefile.am
@@ -0,0 +1,3 @@
+picsdir = $(kde_datadir)/kdevelop/pics
+pics_DATA = kdevelop-splash.png kdevassistant-splash.png \
+ kdevdesigner-splash.png
diff --git a/pics/misc/kdevassistant-splash.png b/pics/misc/kdevassistant-splash.png
new file mode 100644
index 00000000..22b345f9
--- /dev/null
+++ b/pics/misc/kdevassistant-splash.png
Binary files differ
diff --git a/pics/misc/kdevdesigner-splash.png b/pics/misc/kdevdesigner-splash.png
new file mode 100644
index 00000000..90dfe36e
--- /dev/null
+++ b/pics/misc/kdevdesigner-splash.png
Binary files differ
diff --git a/pics/misc/kdevelop-splash.png b/pics/misc/kdevelop-splash.png
new file mode 100644
index 00000000..3f3251e9
--- /dev/null
+++ b/pics/misc/kdevelop-splash.png
Binary files differ
diff --git a/pics/toolbar/Makefile.am b/pics/toolbar/Makefile.am
new file mode 100644
index 00000000..518b19ad
--- /dev/null
+++ b/pics/toolbar/Makefile.am
@@ -0,0 +1,14 @@
+kdevelopdir = $(kde_datadir)/kdevelop/icons
+kdevelop_ICON = AUTO
+
+kdevdebuggerdir = $(kde_datadir)/kdevdebugger/icons
+kdevdebugger_ICON = dbgnext dbgwatchvar dbgrun dbgstepout dbgmemview dbgparam dbgrunto dbgstep dbgnextinst dbgrestart dbgstepinst dbgvar debugger dbgjumpto
+
+cppsupportdir = $(kde_datadir)/kdevcppsupport/icons
+cppsupport_ICON = classnew classwiz
+
+kdevrbdebuggerdir = $(kde_datadir)/kdevrbdebugger/icons
+kdevrbdebugger_ICON = dbgnext dbgrun dbgstepout dbgrunto dbgstep dbgrestart debugger
+
+grepdir = $(kde_datadir)/kdevgrepview/icons
+grep_ICON = grep
diff --git a/pics/toolbar/hi16-action-classnew.png b/pics/toolbar/hi16-action-classnew.png
new file mode 100644
index 00000000..fcc234f6
--- /dev/null
+++ b/pics/toolbar/hi16-action-classnew.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-dbgwatchvar.png b/pics/toolbar/hi16-action-dbgwatchvar.png
new file mode 100644
index 00000000..0e5d0288
--- /dev/null
+++ b/pics/toolbar/hi16-action-dbgwatchvar.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-dirsynch.png b/pics/toolbar/hi16-action-dirsynch.png
new file mode 100644
index 00000000..48115916
--- /dev/null
+++ b/pics/toolbar/hi16-action-dirsynch.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-make_kdevelop.png b/pics/toolbar/hi16-action-make_kdevelop.png
new file mode 100644
index 00000000..824c7580
--- /dev/null
+++ b/pics/toolbar/hi16-action-make_kdevelop.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-methodnew.png b/pics/toolbar/hi16-action-methodnew.png
new file mode 100644
index 00000000..b02f1e0a
--- /dev/null
+++ b/pics/toolbar/hi16-action-methodnew.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-newwidget.png b/pics/toolbar/hi16-action-newwidget.png
new file mode 100644
index 00000000..16a439d6
--- /dev/null
+++ b/pics/toolbar/hi16-action-newwidget.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-project_open.png b/pics/toolbar/hi16-action-project_open.png
new file mode 100644
index 00000000..f218a927
--- /dev/null
+++ b/pics/toolbar/hi16-action-project_open.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_app.png b/pics/toolbar/hi16-action-qmake_app.png
new file mode 100644
index 00000000..c7a36f3d
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_app.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_app_disabled.png b/pics/toolbar/hi16-action-qmake_app_disabled.png
new file mode 100644
index 00000000..c57f0a0c
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_app_disabled.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_func_scope.png b/pics/toolbar/hi16-action-qmake_func_scope.png
new file mode 100644
index 00000000..f03a0535
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_func_scope.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_inc_scope.png b/pics/toolbar/hi16-action-qmake_inc_scope.png
new file mode 100644
index 00000000..326669c3
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_inc_scope.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_lib.png b/pics/toolbar/hi16-action-qmake_lib.png
new file mode 100644
index 00000000..f6977490
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_lib.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_lib_disabled.png b/pics/toolbar/hi16-action-qmake_lib_disabled.png
new file mode 100644
index 00000000..5fd955f1
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_lib_disabled.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_scope.png b/pics/toolbar/hi16-action-qmake_scope.png
new file mode 100644
index 00000000..37a9ae28
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_scope.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_scopenew.png b/pics/toolbar/hi16-action-qmake_scopenew.png
new file mode 100644
index 00000000..8f521d35
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_scopenew.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_sub.png b/pics/toolbar/hi16-action-qmake_sub.png
new file mode 100644
index 00000000..15ff5490
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_sub.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_sub_disabled.png b/pics/toolbar/hi16-action-qmake_sub_disabled.png
new file mode 100644
index 00000000..513b9b02
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_sub_disabled.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_subclass.png b/pics/toolbar/hi16-action-qmake_subclass.png
new file mode 100644
index 00000000..d0b876b4
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_subclass.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmake_ui_h.png b/pics/toolbar/hi16-action-qmake_ui_h.png
new file mode 100644
index 00000000..7ff98600
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmake_ui_h.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qmakerun.png b/pics/toolbar/hi16-action-qmakerun.png
new file mode 100644
index 00000000..7d64197d
--- /dev/null
+++ b/pics/toolbar/hi16-action-qmakerun.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-qtdesigner.png b/pics/toolbar/hi16-action-qtdesigner.png
new file mode 100644
index 00000000..5a5ec1a0
--- /dev/null
+++ b/pics/toolbar/hi16-action-qtdesigner.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-rebuild.png b/pics/toolbar/hi16-action-rebuild.png
new file mode 100644
index 00000000..9a00f533
--- /dev/null
+++ b/pics/toolbar/hi16-action-rebuild.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-reload_page.png b/pics/toolbar/hi16-action-reload_page.png
new file mode 100644
index 00000000..51c928ba
--- /dev/null
+++ b/pics/toolbar/hi16-action-reload_page.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-remove_subdir.png b/pics/toolbar/hi16-action-remove_subdir.png
new file mode 100644
index 00000000..85891c9e
--- /dev/null
+++ b/pics/toolbar/hi16-action-remove_subdir.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-servicenew_kdevelop.png b/pics/toolbar/hi16-action-servicenew_kdevelop.png
new file mode 100644
index 00000000..da5f5766
--- /dev/null
+++ b/pics/toolbar/hi16-action-servicenew_kdevelop.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-target_kdevelop.png b/pics/toolbar/hi16-action-target_kdevelop.png
new file mode 100644
index 00000000..1c4046f7
--- /dev/null
+++ b/pics/toolbar/hi16-action-target_kdevelop.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-targetnew_kdevelop.png b/pics/toolbar/hi16-action-targetnew_kdevelop.png
new file mode 100644
index 00000000..ea108866
--- /dev/null
+++ b/pics/toolbar/hi16-action-targetnew_kdevelop.png
Binary files differ
diff --git a/pics/toolbar/hi16-action-variablenew.png b/pics/toolbar/hi16-action-variablenew.png
new file mode 100644
index 00000000..c5cda992
--- /dev/null
+++ b/pics/toolbar/hi16-action-variablenew.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-classnew.png b/pics/toolbar/hi22-action-classnew.png
new file mode 100644
index 00000000..0d145d86
--- /dev/null
+++ b/pics/toolbar/hi22-action-classnew.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-classwiz.png b/pics/toolbar/hi22-action-classwiz.png
new file mode 100644
index 00000000..3b0cc074
--- /dev/null
+++ b/pics/toolbar/hi22-action-classwiz.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-configure_file.png b/pics/toolbar/hi22-action-configure_file.png
new file mode 100644
index 00000000..c1aaad6e
--- /dev/null
+++ b/pics/toolbar/hi22-action-configure_file.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgjumpto.png b/pics/toolbar/hi22-action-dbgjumpto.png
new file mode 100644
index 00000000..0a9f48a2
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgjumpto.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgmemview.png b/pics/toolbar/hi22-action-dbgmemview.png
new file mode 100644
index 00000000..e2a2738f
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgmemview.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgnext.png b/pics/toolbar/hi22-action-dbgnext.png
new file mode 100644
index 00000000..ee94f585
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgnext.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgnextinst.png b/pics/toolbar/hi22-action-dbgnextinst.png
new file mode 100644
index 00000000..dd65a348
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgnextinst.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgparam.png b/pics/toolbar/hi22-action-dbgparam.png
new file mode 100644
index 00000000..ed11c6d5
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgparam.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgrestart.png b/pics/toolbar/hi22-action-dbgrestart.png
new file mode 100644
index 00000000..b29789a1
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgrestart.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgrun.png b/pics/toolbar/hi22-action-dbgrun.png
new file mode 100644
index 00000000..32f4badc
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgrun.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgrunto.png b/pics/toolbar/hi22-action-dbgrunto.png
new file mode 100644
index 00000000..861c549a
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgrunto.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgstep.png b/pics/toolbar/hi22-action-dbgstep.png
new file mode 100644
index 00000000..c4a76043
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgstep.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgstepinst.png b/pics/toolbar/hi22-action-dbgstepinst.png
new file mode 100644
index 00000000..ae84a9f4
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgstepinst.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgstepout.png b/pics/toolbar/hi22-action-dbgstepout.png
new file mode 100644
index 00000000..caaf806c
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgstepout.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-dbgvar.png b/pics/toolbar/hi22-action-dbgvar.png
new file mode 100644
index 00000000..496acfa9
--- /dev/null
+++ b/pics/toolbar/hi22-action-dbgvar.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-debugger.png b/pics/toolbar/hi22-action-debugger.png
new file mode 100644
index 00000000..3277f34e
--- /dev/null
+++ b/pics/toolbar/hi22-action-debugger.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-grep.png b/pics/toolbar/hi22-action-grep.png
new file mode 100644
index 00000000..97a4df27
--- /dev/null
+++ b/pics/toolbar/hi22-action-grep.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-make_kdevelop.png b/pics/toolbar/hi22-action-make_kdevelop.png
new file mode 100644
index 00000000..f9abb779
--- /dev/null
+++ b/pics/toolbar/hi22-action-make_kdevelop.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-newwidget.png b/pics/toolbar/hi22-action-newwidget.png
new file mode 100644
index 00000000..16b30640
--- /dev/null
+++ b/pics/toolbar/hi22-action-newwidget.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-output_win.png b/pics/toolbar/hi22-action-output_win.png
new file mode 100644
index 00000000..bb2909f8
--- /dev/null
+++ b/pics/toolbar/hi22-action-output_win.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-project_open.png b/pics/toolbar/hi22-action-project_open.png
new file mode 100644
index 00000000..3e022b38
--- /dev/null
+++ b/pics/toolbar/hi22-action-project_open.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-qmake_scopenew.png b/pics/toolbar/hi22-action-qmake_scopenew.png
new file mode 100644
index 00000000..f63d6809
--- /dev/null
+++ b/pics/toolbar/hi22-action-qmake_scopenew.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-qmakerun.png b/pics/toolbar/hi22-action-qmakerun.png
new file mode 100644
index 00000000..2e761c61
--- /dev/null
+++ b/pics/toolbar/hi22-action-qmakerun.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-rebuild.png b/pics/toolbar/hi22-action-rebuild.png
new file mode 100644
index 00000000..147d0bcd
--- /dev/null
+++ b/pics/toolbar/hi22-action-rebuild.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-reload_page.png b/pics/toolbar/hi22-action-reload_page.png
new file mode 100644
index 00000000..f2466590
--- /dev/null
+++ b/pics/toolbar/hi22-action-reload_page.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-save_all.png b/pics/toolbar/hi22-action-save_all.png
new file mode 100644
index 00000000..d12cdc5d
--- /dev/null
+++ b/pics/toolbar/hi22-action-save_all.png
Binary files differ
diff --git a/pics/toolbar/hi22-action-tree_win.png b/pics/toolbar/hi22-action-tree_win.png
new file mode 100644
index 00000000..08e4aced
--- /dev/null
+++ b/pics/toolbar/hi22-action-tree_win.png
Binary files differ
diff --git a/pics/toolbar/hi32-action-classnew.png b/pics/toolbar/hi32-action-classnew.png
new file mode 100644
index 00000000..23876c1c
--- /dev/null
+++ b/pics/toolbar/hi32-action-classnew.png
Binary files differ
diff --git a/pics/toolbar/hi32-mime-kdevelop_project.png b/pics/toolbar/hi32-mime-kdevelop_project.png
new file mode 100644
index 00000000..364c20d3
--- /dev/null
+++ b/pics/toolbar/hi32-mime-kdevelop_project.png
Binary files differ
diff --git a/src/Mainpage.dox b/src/Mainpage.dox
new file mode 100644
index 00000000..77210259
--- /dev/null
+++ b/src/Mainpage.dox
@@ -0,0 +1,118 @@
+/**
+@mainpage The KDevelop Generic Shell
+
+This library contains the Shell - a profile-based implementation of KDevelop plugin architecture.
+
+<b>Link with</b>: -lkdevshell
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/shell
+
+\section creatingapp Creating an application using generic shell
+KDevelop platform applications can use generic shell as a ready to use implementation
+of KDevelop plugin architecture.
+
+This is done by creating application %main.cpp file and @ref ShellExtension subclass.
+Example:
+- %main.cpp for "myapp" application:
+ @code
+ #include <config.h>
+
+ #include <kaboutdata.h>
+ #include <kapplication.h>
+ #include <kcmdlineargs.h>
+ #include <klocale.h>
+ #include <dcopclient.h>
+
+ #include <splashscreen.h>
+ #include <toplevel.h>
+ #include <plugincontroller.h>
+ #include <partcontroller.h>
+ #include <core.h>
+ #include <projectmanager.h>
+ #include <newmainwindow.h>
+
+ #include "myappextension.h"
+
+ static KCmdLineOptions options[] =
+ {
+ { "profile <profile>", I18N_NOOP("Profile to load"), 0 },
+ { 0,0,0 }
+ };
+
+ int main(int argc, char *argv[])
+ {
+ static const char description[] = I18N_NOOP("My Application");
+ KAboutData aboutData("myapp", I18N_NOOP("My Application"),
+ VERSION, description, KAboutData::License_GPL,
+ I18N_NOOP("(c) 1999-2004, MyApp developers"),
+ "", "http://www.myapp.org");
+ aboutData.addAuthor("Me", I18N_NOOP("Creator"), "me@myapp.org");
+
+ KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::addCmdLineOptions( options );
+
+ KApplication app;
+
+ MyAppExtension::init();
+
+ QPixmap pm;
+ pm.load(locate("data", "myapp/pics/myapp-splash.png"));
+ SplashScreen * splash = new SplashScreen( pm );
+ splash->show();
+
+ app.processEvents();
+
+ QObject::connect(PluginController::getInstance(), SIGNAL(loadingPlugin(const QString &)),
+ splash, SLOT(showMessage(const QString &)));
+
+ splash->message( i18n( "Loading Settings" ) );
+ TopLevel::getInstance()->loadSettings();
+
+ PluginController::getInstance()->loadInitialPlugins();
+
+ splash->message( i18n( "Starting GUI" ) );
+ NewMainWindow *mw = dynamic_cast<NewMainWindow*>(TopLevel::getInstance()->main());
+ if (mw)
+ mw->enableShow();
+ TopLevel::getInstance()->main()->show();
+
+ Core::getInstance()->doEmitCoreInitialized();
+
+ delete splash;
+
+ kapp->dcopClient()->registerAs("myapp");
+
+ return app.exec();
+ }
+ @endcode
+
+- Shell extension for "myapp" application:
+ @code
+ class MyAppExtension: public ShellExtension {
+ public:
+ static void init()
+ {
+ s_instance = new MyAppExtension();
+ }
+
+ virtual void createGlobalSettingsPage(KDialogBase */*dlg*/) {};
+ virtual void acceptGlobalSettingsPage(KDialogBase */*dlg*/) {};
+
+ virtual QString xmlFile()
+ {
+ return "myappui.rc";
+ }
+
+ virtual QString defaultProfile()
+ {
+ return "MyApp";
+ }
+
+ protected:
+ KDevAssistantExtension();
+
+ };
+ @endcode
+
+*/
+
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 00000000..88e7326d
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,57 @@
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \
+ -I$(top_srcdir)/src/newui -I$(top_srcdir)/src/profileengine/lib \
+ $(all_includes)
+
+KDE_OPTIONS=nofinal
+
+lib_LTLIBRARIES = libkdevshell.la
+libkdevshell_la_LDFLAGS = $(all_libraries)
+libkdevshell_la_LIBADD = \
+ $(top_builddir)/src/profileengine/lib/libprofileengine.la $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(top_builddir)/lib/interfaces/extras/libkdevextras.la \
+ $(top_builddir)/src/newui/libd.la $(LIB_KHTML) -lktexteditor
+libkdevshell_la_SOURCES = api.cpp core.cpp documentationpart.cpp \
+ editorproxy.cpp generalinfowidget.cpp generalinfowidgetbase.ui languageselectwidget.cpp \
+ mainwindowshare.cpp mimewarningdialog.ui multibuffer.cpp partcontroller.cpp \
+ plugincontroller.cpp pluginselectdialog.cpp pluginselectdialog.h pluginselectdialogbase.ui \
+ projectmanager.cpp projectsession.cpp shellextension.cpp simplemainwindow.cpp \
+ splashscreen.cpp statusbar.cpp toplevel.cpp
+
+bin_PROGRAMS = kdevelop kdevassistant
+
+kdevelop_SOURCES = main.cpp kdevideextension.cpp settingswidget.ui
+
+kdevelop_METASOURCES = AUTO
+kdevelop_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kdevelop_LDADD = libkdevshell.la
+
+rcdir = $(kde_datadir)/kdevelop
+rc_DATA = kdevelopui.rc eventsrc
+
+# default KDevelop configuration
+kdevelopdatadir = $(kde_confdir)
+kdevelopdata_DATA = kdeveloprc kdevassistantrc
+
+SUBDIRS = profiles profileengine newui kconf_update
+kdevassistant_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kdevassistant_SOURCES = main_assistant.cpp kdevassistantextension.cpp
+kdevassistant_LDADD = libkdevshell.la
+
+rc_assistantdir = $(kde_datadir)/kdevassistant
+rc_assistant_DATA = kdevassistantui.rc
+shellincludedir = $(includedir)/kdevelop/shell
+shellinclude_HEADERS = api.h core.h documentationpart.h editorproxy.h \
+ generalinfowidget.h languageselectwidget.h mainwindowshare.h partcontroller.h \
+ plugincontroller.h projectmanager.h projectsession.h shellextension.h splashscreen.h \
+ statusbar.h toplevel.h generalinfowidgetbase.h mimewarningdialog.h settingswidget.h \
+ simplemainwindow.h multibuffer.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces kdevextensions
+DOXYGEN_PROJECTNAME = KDevelop Generic Shell
+DOXYGEN_DOCDIRPREFIX = kdevshell
+include ../Doxyfile.am
+profilesdatadir = $(kde_datadir)/kdevelop/profiles
+profilesdata_DATA = projectprofiles
+
diff --git a/src/api.cpp b/src/api.cpp
new file mode 100644
index 00000000..8e56da3d
--- /dev/null
+++ b/src/api.cpp
@@ -0,0 +1,60 @@
+#include "core.h"
+#include "codemodel.h"
+#include "partcontroller.h"
+#include "plugincontroller.h"
+#include "toplevel.h"
+#include "api.h"
+
+
+API *API::s_instance = 0;
+
+
+KDevMainWindow *API::mainWindow() const
+{
+ return TopLevel::getInstance();
+}
+
+KDevPartController *API::partController() const
+{
+ return PartController::getInstance();
+}
+
+
+KDevCore *API::core() const
+{
+ return Core::getInstance();
+}
+
+
+CodeModel *API::codeModel() const
+{
+ return m_classStore;
+}
+
+
+API *API::getInstance()
+{
+ if (!s_instance)
+ s_instance = new API;
+ return s_instance;
+}
+
+
+API::API()
+ : KDevApi()
+{
+ m_classStore = new CodeModel();
+}
+
+
+API::~API()
+{
+ delete( m_classStore );
+ m_classStore = 0;
+}
+
+KDevPluginController * API::pluginController() const
+{
+ return PluginController::getInstance();
+}
+
diff --git a/src/api.h b/src/api.h
new file mode 100644
index 00000000..fb20447a
--- /dev/null
+++ b/src/api.h
@@ -0,0 +1,41 @@
+#ifndef _API_H_
+#define _API_H_
+
+
+#include "kdevapi.h"
+
+
+class CodeModel;
+
+/**
+API implementation.
+*/
+class API : public KDevApi
+{
+public:
+
+ virtual KDevMainWindow *mainWindow() const;
+ virtual KDevPartController *partController() const;
+ virtual KDevPluginController *pluginController() const;
+ virtual KDevCore *core() const;
+ virtual CodeModel *codeModel() const;
+
+ static API *getInstance();
+
+ ~API();
+
+protected:
+
+ API();
+
+private:
+
+ static API *s_instance;
+
+ CodeModel *m_classStore;
+
+
+};
+
+
+#endif
diff --git a/src/core.cpp b/src/core.cpp
new file mode 100644
index 00000000..d7b6b285
--- /dev/null
+++ b/src/core.cpp
@@ -0,0 +1,118 @@
+#include <qtimer.h>
+
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kstatusbar.h>
+#include <kmainwindow.h>
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <kactioncollection.h>
+
+#include "toplevel.h"
+#include "partcontroller.h"
+#include "api.h"
+#include "projectmanager.h"
+
+#include "core.h"
+
+
+Core *Core::s_instance = 0;
+
+
+Core *Core::getInstance()
+{
+ if (!s_instance)
+ s_instance = new Core;
+ return s_instance;
+}
+
+void Core::setupShourtcutTips(KXMLGUIClient * client)
+{
+ QPtrList<KXMLGUIClient> clients;
+ if (client != 0)
+ clients.append(client);
+ else
+ clients = TopLevel::getInstance()->main()->guiFactory()->clients();
+
+ for( QPtrListIterator<KXMLGUIClient> it(clients); it.current(); ++it ) {
+ KActionCollection *actionCollection = (*it)->actionCollection();
+ for (int i = 0; i < actionCollection->count(); i++) {
+ KAction *action = actionCollection->action(i);
+
+ QString tooltip = action->toolTip();
+ if (tooltip.isEmpty())
+ tooltip = action->text().remove('&');
+ else {
+ int i = tooltip.findRev('(');
+ if (i > 0) tooltip = tooltip.left(i).stripWhiteSpace();
+ }
+
+ QString shortcut = action->shortcutText();
+ if (!shortcut.isEmpty())
+ tooltip += " (" + shortcut + ")";
+ action->setToolTip(tooltip);
+ }
+ }
+}
+
+Core::Core()
+ : KDevCore()
+{
+}
+
+
+Core::~Core()
+{
+}
+
+bool Core::queryClose()
+{
+ // save the the project to open it automaticly on startup if needed
+ KConfig* config = kapp->config();
+ config->setGroup("General Options");
+ config->writePathEntry("Last Project",ProjectManager::getInstance()->projectFile().url());
+
+ if ( !PartController::getInstance()->querySaveFiles() )
+ return false;
+
+ if ( !ProjectManager::getInstance()->closeProject( true ) )
+ return false;
+
+ if ( !PartController::getInstance()->readyToClose() )
+ return false;
+
+ return true;
+}
+
+
+void Core::running(KDevPlugin * which, bool runs)
+{
+ emit activeProcessChanged( which, runs );
+}
+
+
+void Core::fillContextMenu(QPopupMenu *popup, const Context *context)
+{
+ emit contextMenu(popup, context);
+}
+
+
+void Core::openProject(const QString& projectFileName)
+{
+ ProjectManager::getInstance()->loadProject(KURL( projectFileName ));
+}
+
+namespace MainWindowUtils{
+QString beautifyToolTip(const QString& text)
+{
+ QString temp = text;
+ temp.replace(QRegExp("&"), "");
+ temp.replace(QRegExp("\\.\\.\\."), "");
+ return temp;
+}
+}
+
+#include "core.moc"
diff --git a/src/core.h b/src/core.h
new file mode 100644
index 00000000..e48eecda
--- /dev/null
+++ b/src/core.h
@@ -0,0 +1,71 @@
+#ifndef _CORE_H_
+#define _CORE_H_
+
+#include <qregexp.h>
+#include <kxmlguiclient.h>
+
+#include <kparts/partmanager.h>
+
+
+#include "kdevcore.h"
+
+namespace MainWindowUtils{
+
+QString beautifyToolTip(const QString& text);
+}
+
+/**
+Core implementation.
+*/
+class Core : public KDevCore
+{
+ Q_OBJECT
+
+public:
+
+ static Core *getInstance();
+
+ /**
+ * Setup shourtcut tips. For every KAction with a shortcut,
+ * appends the shortcut string, in parenthesis, to the
+ * actions's tooltip. If tooltip already has any text in
+ * parens, it's removed and shortcut is added instead.
+ *
+ * @param client
+ * Pointer to KXMLGUIClient object, which contain an collection
+ * of actions (KActionCollection). If the parameter is null,
+ * function is applied to the all available KXMLGUIClient objects.
+ */
+ static void setupShourtcutTips(KXMLGUIClient * client = 0);
+
+ ~Core();
+
+ virtual void running(KDevPlugin *which, bool runs);
+ virtual void fillContextMenu(QPopupMenu *popup, const Context *context);
+ virtual void openProject(const QString& projectFileName);
+
+ void doEmitProjectOpened() { emit projectOpened(); }
+ void doEmitProjectClosed() { emit projectClosed(); }
+ void doEmitLanguageChanged() { emit languageChanged(); }
+ void doEmitCoreInitialized() { emit coreInitialized(); }
+ void doEmitProjectConfigWidget(KDialogBase *base) { emit projectConfigWidget(base); }
+ void doEmitConfigWidget(KDialogBase *base) { emit configWidget(base); }
+ void doEmitStopButtonPressed(KDevPlugin* which = 0) { emit stopButtonClicked( which ); }
+
+ bool queryClose();
+
+signals:
+
+ void activeProcessChanged(KDevPlugin* which, bool runs);
+
+protected:
+
+ Core();
+
+private:
+ static Core *s_instance;
+
+};
+
+
+#endif
diff --git a/src/documentationpart.cpp b/src/documentationpart.cpp
new file mode 100644
index 00000000..b9ad78d0
--- /dev/null
+++ b/src/documentationpart.cpp
@@ -0,0 +1,21 @@
+#include "partcontroller.h"
+
+#include "documentationpart.h"
+
+HTMLDocumentationPart::HTMLDocumentationPart()
+ : KDevHTMLPart()
+{
+ setOptions(CanDuplicate | CanOpenInNewWindow);
+}
+
+void HTMLDocumentationPart::slotDuplicate( )
+{
+ PartController::getInstance()->showDocument(url(), true);
+}
+
+void HTMLDocumentationPart::slotOpenInNewWindow( const KURL & url )
+{
+ PartController::getInstance()->showDocument(url, true);
+}
+
+#include "documentationpart.moc"
diff --git a/src/documentationpart.h b/src/documentationpart.h
new file mode 100644
index 00000000..b992bbf0
--- /dev/null
+++ b/src/documentationpart.h
@@ -0,0 +1,25 @@
+#ifndef __DOCUMENTATIONPART_H__
+#define __DOCUMENTATIONPART_H__
+
+#include <kdevhtmlpart.h>
+
+/**
+HTML documentation part.
+
+Implements shell-dependent "duplicate" and "open in new window" actions of KDevHTMLPart.
+*/
+class HTMLDocumentationPart : public KDevHTMLPart
+{
+ Q_OBJECT
+
+public:
+
+ HTMLDocumentationPart();
+
+protected slots:
+
+ virtual void slotDuplicate();
+ virtual void slotOpenInNewWindow(const KURL &url);
+};
+
+#endif
diff --git a/src/editorproxy.cpp b/src/editorproxy.cpp
new file mode 100644
index 00000000..b256491d
--- /dev/null
+++ b/src/editorproxy.cpp
@@ -0,0 +1,297 @@
+#include <qwidget.h>
+#include <qpopupmenu.h>
+#include <qtimer.h>
+
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kapplication.h>
+
+#include <kparts/part.h>
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/popupmenuinterface.h>
+#include <ktexteditor/editinterface.h>
+#include <ktexteditor/selectioninterface.h>
+#include <ktexteditor/view.h>
+#include <kxmlguiclient.h>
+#include <kxmlguifactory.h>
+#include <kmainwindow.h>
+#include <kactioncollection.h>
+#include <klocale.h>
+#include <kstdaccel.h>
+
+#include "toplevel.h"
+#include "partcontroller.h"
+#include "core.h"
+#include "multibuffer.h"
+#include "kdeveditorutil.h"
+
+#include "editorproxy.h"
+
+using namespace KTextEditor;
+
+EditorProxy *EditorProxy::s_instance = 0;
+
+
+EditorProxy::EditorProxy()
+ : QObject()
+{
+ m_delayedLineTimer = new QTimer( this );
+ connect( m_delayedLineTimer, SIGNAL( timeout() ), this, SLOT(setLineNumberDelayed()) );
+ KConfig *config = kapp->config();
+
+ m_delayedViewCreationCompatibleUI = true;
+
+ KAction *ac = new KAction( i18n("Show Context Menu"), 0, this,
+ SLOT(showPopup()), TopLevel::getInstance()->main()->actionCollection(), "show_popup" );
+ KShortcut cut ;/*= KStdAccel::shortcut(KStdAccel::PopupMenuContext);*/
+ cut.append(KKey(CTRL+Key_Return));
+ ac->setShortcut(cut);
+}
+
+
+EditorProxy *EditorProxy::getInstance()
+{
+ if (!s_instance)
+ s_instance = new EditorProxy;
+
+ return s_instance;
+}
+
+void EditorProxy::setLineNumberDelayed()
+{
+ if( !this ) return; ///This should fix a strange crash I use to encounter, where setLineNumberDelayed is called with this == NULL
+ setLineNumber(m_delayedPart, m_delayedLine, m_delayedCol);
+}
+
+
+void EditorProxy::setLineNumber(KParts::Part *part, int lineNum, int col)
+{
+ if (!part || !part->inherits("KTextEditor::Document"))
+ return;
+
+ if ( lineNum < 0 )
+ return;
+
+ KURL url = dynamic_cast<KParts::ReadOnlyPart*>( part )->url();
+ ViewCursorInterface *iface = dynamic_cast<ViewCursorInterface*>(part->widget());
+ if (iface)
+ {
+#if KDE_IS_VERSION(3,5,5)
+#else
+ if (!part->widget()->hasFocus()) //workaround for QXIMInputContext crashes. Keep for KDE <=3.5.4!
+ {
+ m_delayedPart = part;
+ m_delayedLine = lineNum;
+ m_delayedCol = col;
+ m_delayedLineTimer->start( 1, true );
+ } else
+#endif
+ iface->setCursorPositionReal(lineNum, col == -1 ? 0 : col);
+ }
+ else {
+ // Save the position for a rainy day (or when the view gets activated and wants its position)
+ for (QValueList<MultiBuffer*>::ConstIterator it = m_editorParts.begin(); it != m_editorParts.end(); ++it)
+ if ((*it)->hasURL( url )) {
+ (*it)->registerDelayedActivation( part, lineNum, col );
+ return;
+ }
+
+ // Shouldn't hit this?
+ Q_ASSERT(false);
+ }
+}
+
+void EditorProxy::installPopup( KParts::Part * part )
+{
+
+ if ( part->inherits("KTextEditor::Document") && part->widget())
+ {
+ PopupMenuInterface *iface = dynamic_cast<PopupMenuInterface*>(part->widget());
+ if (iface)
+ {
+ KTextEditor::View * view = static_cast<KTextEditor::View*>( part->widget() );
+
+ QPopupMenu * popup = static_cast<QPopupMenu*>( part->factory()->container("ktexteditor_popup", view ) );
+
+ if (!popup)
+ {
+ kdWarning() << k_funcinfo << "Popup not found!" << endl;
+ return;
+ }
+
+ KAction * action = NULL;
+ //If there is a tab for this file, we don't need to plug the closing menu entries here
+ KConfig *config = KGlobal::config();
+ config->setGroup("UI");
+ bool m_tabBarShown = ! config->readNumEntry("TabWidgetVisibility", 0);
+ if (!m_tabBarShown)
+ {
+ action = TopLevel::getInstance()->main()->actionCollection()->action( "file_close" );
+ if ( action && !action->isPlugged( popup ) )
+ {
+ popup->insertSeparator( 0 );
+ action->plug( popup, 0 );
+ }
+ action = TopLevel::getInstance()->main()->actionCollection()->action( "file_closeother" );
+ if ( action && !action->isPlugged( popup ) )
+ action->plug( popup, 1 );
+ }
+
+ iface->installPopup( popup );
+
+ connect(popup, SIGNAL(aboutToShow()), this, SLOT(popupAboutToShow()));
+
+ // ugly hack: mark the "original" items
+ m_popupIds.resize(popup->count());
+ for (uint index=0; index < popup->count(); ++index)
+ m_popupIds[index] = popup->idAt(index);
+ }
+ }
+}
+
+void EditorProxy::popupAboutToShow()
+{
+ QPopupMenu *popup = (QPopupMenu*)sender();
+ if (!popup)
+ return;
+
+ // ugly hack: remove all but the "original" items
+ for (int index=popup->count()-1; index >= 0; --index)
+ {
+ int id = popup->idAt(index);
+ if (m_popupIds.contains(id) == 0)
+ {
+ QMenuItem *item = popup->findItem(id);
+ if ( item && item->popup() )
+ delete item->popup();
+ else
+ popup->removeItemAt(index);
+ }
+ }
+
+ KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( PartController::getInstance()->activePart() );
+ if (!doc ) return;
+
+ unsigned int line;
+ unsigned int col;
+ if ( !KDevEditorUtil::currentPositionReal( &line, &col, doc ) ) return;
+
+ QString wordstr;
+ QString selection = KDevEditorUtil::currentSelection( doc );
+ if ( !selection.isEmpty() && selection.contains('\n') != 0 )
+ {
+ wordstr = selection;
+ }
+ else
+ {
+ wordstr = KDevEditorUtil::currentWord( doc );
+ }
+
+ QString linestr = KDevEditorUtil::currentLine( doc );
+
+ EditorContext context( doc->url(), line, col, linestr, wordstr );
+ Core::getInstance()->fillContextMenu( popup, &context );
+
+ // Remove redundant separators (any that are first, last, or doubled)
+ bool lastWasSeparator = true;
+ for( uint i = 0; i < popup->count(); )
+ {
+ int id = popup->idAt( i );
+ if( lastWasSeparator && popup->findItem( id )->isSeparator() )
+ {
+ popup->removeItem( id );
+ // Since we removed an item, don't increment i
+ } else
+ {
+ lastWasSeparator = false;
+ i++;
+ }
+ }
+ if( lastWasSeparator && popup->count() > 0 )
+ popup->removeItem( popup->idAt( popup->count() - 1 ) );
+}
+
+void EditorProxy::showPopup( )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( KParts::Part * part = PartController::getInstance()->activePart() )
+ {
+ ViewCursorInterface *iface = dynamic_cast<ViewCursorInterface*>( part->widget() );
+ if ( iface )
+ {
+ KTextEditor::View * view = static_cast<KTextEditor::View*>( part->widget() );
+ QPopupMenu * popup = static_cast<QPopupMenu*>( view->factory()->container("ktexteditor_popup", view ) );
+
+ if ( popup )
+ {
+ popup->exec( view->mapToGlobal( iface->cursorCoordinates() ) );
+ }
+ }
+ }
+}
+
+void EditorProxy::registerEditor(MultiBuffer* wrapper)
+{
+ m_editorParts.append(wrapper);
+}
+
+void EditorProxy::deregisterEditor(MultiBuffer* wrapper)
+{
+ m_editorParts.remove(wrapper);
+}
+
+QWidget * EditorProxy::widgetForPart( KParts::Part * part )
+{
+ if ( !part ) return 0;
+
+ if (part->widget())
+ return part->widget();
+
+ KURL url = dynamic_cast<KParts::ReadOnlyPart*>( part )->url();
+
+ for (QValueList<MultiBuffer*>::ConstIterator it = m_editorParts.begin(); it != m_editorParts.end(); ++it)
+ if ((*it)->hasURL( url ))
+ return *it;
+
+ return 0L;
+}
+
+QWidget * EditorProxy::topWidgetForPart( KParts::Part * part )
+{
+ if ( !part ) return 0;
+
+ KURL url = dynamic_cast<KParts::ReadOnlyPart*>( part )->url();
+
+ for (QValueList<MultiBuffer*>::ConstIterator it = m_editorParts.begin(); it != m_editorParts.end(); ++it)
+ if ((*it)->hasURL( url ))
+ return *it;
+
+ if (part->widget())
+ return part->widget();
+
+ return 0L;
+}
+
+bool EditorProxy::isDelayedViewCapable( )
+{
+ return m_delayedViewCreationCompatibleUI;
+}
+
+QWidget *EditorProxy::findPartWidget(KParts::Part *part)
+{
+ for (QValueList<MultiBuffer*>::ConstIterator it = m_editorParts.begin(); it != m_editorParts.end(); ++it)
+ if ((*it)->hasPart(part))
+ return *it;
+
+ if (part->widget())
+ return part->widget();
+
+ return 0L;
+}
+
+#include "editorproxy.moc"
diff --git a/src/editorproxy.h b/src/editorproxy.h
new file mode 100644
index 00000000..51564dd1
--- /dev/null
+++ b/src/editorproxy.h
@@ -0,0 +1,67 @@
+#ifndef __EDITORPROXY_H__
+#define __EDITORPROXY_H__
+
+
+#include <qobject.h>
+#include <qmemarray.h>
+#include <qguardedptr.h>
+
+class QPopupMenu;
+class MultiBuffer;
+class QTimer;
+
+#include <kparts/part.h>
+#include <ktexteditor/markinterface.h>
+#include <kdeversion.h>
+# include <ktexteditor/markinterfaceextension.h>
+
+class EditorProxy : public QObject
+{
+ Q_OBJECT
+
+public:
+
+ static EditorProxy *getInstance();
+
+ void setLineNumber(KParts::Part *part, int lineNum, int col);
+
+ void installPopup(KParts::Part *part);
+
+ void registerEditor(MultiBuffer* wrapper);
+ void deregisterEditor(MultiBuffer* wrapper);
+
+ QWidget * widgetForPart( KParts::Part * part );
+ QWidget * topWidgetForPart( KParts::Part * part );
+
+ bool isDelayedViewCapable();
+
+ QWidget * findPartWidget( KParts::Part * part );
+
+public slots:
+ void setLineNumberDelayed();
+
+private slots:
+
+ void popupAboutToShow();
+ void showPopup();
+
+private:
+
+ EditorProxy();
+
+ static EditorProxy *s_instance;
+
+ QMemArray<int> m_popupIds;
+
+ // This list is used to save line/col information for not yet activated editor views.
+ QValueList< MultiBuffer* > m_editorParts;
+
+ QTimer* m_delayedLineTimer;
+ bool m_delayedViewCreationCompatibleUI;
+ KParts::Part *m_delayedPart;
+ int m_delayedLine;
+ int m_delayedCol;
+};
+
+
+#endif
diff --git a/src/eventsrc b/src/eventsrc
new file mode 100644
index 00000000..37425f90
--- /dev/null
+++ b/src/eventsrc
@@ -0,0 +1,147 @@
+[!Global!]
+IconName=kdevelop
+Comment=KDevelop
+Comment[hi]=के-डेवलप
+
+[ProcessSuccess]
+Name=Process successful
+Name[ca]=Procés correcte
+Name[da]=Processen lykkedes
+Name[de]=Prozess erfolgreich
+Name[el]=Η διεργασία επιτυχής
+Name[es]=Proceso correcto
+Name[et]=Protsess oli edukas
+Name[eu]=Prozesu zuzena
+Name[fa]=موفقیت فرآیند
+Name[fr]=Processus réussi
+Name[ga]=D'éirigh leis an bpróiseas
+Name[gl]=Proceso con éxito
+Name[hi]=प्रक्रिया सफल
+Name[hu]=Sikeres folyamat
+Name[it]=Processo riuscito
+Name[ja]=プロセス成功
+Name[lt]=Procesas pavyko
+Name[ms]=Proses berjaya
+Name[nds]=Perzess funkscheneer
+Name[ne]=प्रक्रिया सफल
+Name[nl]=Proces succesvol
+Name[pl]=Proces zakończony pomyślnie
+Name[pt]=Processo com sucesso
+Name[pt_BR]=Processamento com sucesso
+Name[ru]=Процесс завершён успешно
+Name[sk]=Úspešný proces
+Name[sl]=Proces uspešen
+Name[sr]=Процес је успео
+Name[sr@Latn]=Proces je uspeo
+Name[sv]=Processen lyckades
+Name[ta]=செயல்முறை வெற்றி
+Name[tg]=Амал бо мувафақият ба анҷом расид
+Name[tr]=İşlem Başarılı
+Name[zh_CN]=处理成功
+Name[zh_TW]=行程成功
+Comment=Process finished successfully
+Comment[ca]=Procés finalitzat amb èxit
+Comment[da]=Processen afsluttede med succes
+Comment[de]=Prozess erfolgreich beendet
+Comment[el]=Η διεργασία τερμάτισε με επιτυχία
+Comment[es]=Proceso finalizado con éxito
+Comment[et]=Protsess edukalt lõpetatud
+Comment[eu]=Prozesua ongi amaitu da
+Comment[fa]=فرآیند با موفقیت پایان یافت
+Comment[fr]=Le processus s'est terminé avec succès
+Comment[gl]=O proceso finalizou exitosamente
+Comment[hi]=प्रक्रिया सफलतापूर्वक सम्पन्न
+Comment[hu]=A folyamat sikeresen befejeződött
+Comment[it]=Processo terminato correttamente
+Comment[ja]=プロセスは成功しました。
+Comment[ms]=Proses selesai dengan jaya
+Comment[nds]=Perzess mit Spood beendt
+Comment[ne]=प्रक्रिया सफलतापूर्वक समाप्त भयो
+Comment[nl]=Het proces werd succesvol voltooid
+Comment[pl]=Proces zakończony pomyślnie
+Comment[pt]=O processo terminou com sucesso
+Comment[pt_BR]=Processamento terminado com sucesso
+Comment[ru]=Процесс завершён успешно
+Comment[sk]=Proces skončil úspešne
+Comment[sl]=Proces je uspešno končal
+Comment[sr]=Процес је успешно завршен
+Comment[sr@Latn]=Proces je uspešno završen
+Comment[sv]=Processen avslutades med lyckat resultat
+Comment[ta]=வெற்றிகரமாக முடிவடைந்த செயலாக்கம்
+Comment[tg]=Амал бо мувафақият ба анҷом расид
+Comment[tr]=İşlem başarıyla bitti.
+Comment[zh_CN]=处理成功完成
+Comment[zh_TW]=行程成功完成
+default_presentation=0
+
+[ProcessError]
+Name=Process error
+Name[ca]=Procés fallit
+Name[da]=Procesfejl
+Name[de]=Prozessfehler
+Name[el]=Σφάλμα διεργασίας
+Name[es]=Proceso fallido
+Name[et]=Protsessi viga
+Name[eu]=Prozesu errorea
+Name[fa]=خطای پردازه
+Name[fr]=Erreur du processus
+Name[gl]=Error no proceso
+Name[hi]=प्रक्रिया त्रुटि
+Name[hu]=Hibás folyamat
+Name[it]=Errore di processo
+Name[ja]=プロセスエラー
+Name[lt]=Proceso klaida
+Name[ms]=Ralat proses
+Name[nds]=Perzessfehler
+Name[ne]=प्रक्रिया त्रुटि
+Name[nl]=Procesfout
+Name[pa]=ਕਾਰਜ ਗਲਤੀ
+Name[pl]=Błąd w procesie
+Name[pt]=Erro no processo
+Name[pt_BR]=Processamento com erro
+Name[ru]=Ошибка при выполнении процесса
+Name[sk]=Chyba procesu
+Name[sl]=Napaka procesa
+Name[sr]=Грешка у процесу
+Name[sr@Latn]=Greška u procesu
+Name[sv]=Processfel
+Name[ta]=செயல்முறை பிழை
+Name[tg]=Ҳангоми иҷро намудани амал хатогие дида мешавад
+Name[tr]=İşlem Hatası
+Name[zh_CN]=处理失败
+Name[zh_TW]=行程錯誤
+Comment=Process finished with errors
+Comment[ca]=Procés finalitzat amb errors
+Comment[da]=Processen afsluttede med fejl
+Comment[de]=Prozess mit Fehlerstatus beendet
+Comment[el]=Η διεργασία τερμάτισε με σφάλματα
+Comment[es]=Proceso finalizado con errores
+Comment[et]=Protsess lõppes vigadega
+Comment[eu]=Prozesua erroreekin amaitu da
+Comment[fa]=پردازه با خطا پایان یافت
+Comment[fr]=Le processus s'est terminé avec des erreurs
+Comment[gl]=O proceso finalizou con erros
+Comment[hi]=प्रक्रिया त्रुटियों के साथ सम्पन्न
+Comment[hu]=A folyamat hibajelzéssel fejeződött be
+Comment[it]=Processo terminato con errori
+Comment[ja]=プロセスはエラーを起こし、終了しました。
+Comment[lt]=Procesas baigtas su klaidomis
+Comment[ms]=Proses selesai dengan ralat
+Comment[nds]=Perzess mit Fehlers beendt
+Comment[ne]=प्रक्रिया त्रुटि आएर समाप्त भयो
+Comment[nl]=Het proces eindigde met fouten
+Comment[pl]=Proces zakończony z błędami
+Comment[pt]=O processo terminou com erros
+Comment[pt_BR]=Processamento terminado com erros
+Comment[ru]=Ошибка при выполнении процесса
+Comment[sk]=Proces skončil s chybami
+Comment[sl]=Proces je končal brez napak
+Comment[sr]=Процес је завршен са грешкама
+Comment[sr@Latn]=Proces je završen sa greškama
+Comment[sv]=Processen avslutades med fel
+Comment[ta]=பிழையுடன் முடிவடைந்த செயலாக்கம்
+Comment[tg]=Ҳангоми иҷро намудани амал хатогие дида мешавад
+Comment[tr]=İşlem hatalarla bitti
+Comment[zh_CN]=处理失败
+Comment[zh_TW]=行程完成但有錯誤
+default_presentation=0
diff --git a/src/generalinfowidget.cpp b/src/generalinfowidget.cpp
new file mode 100644
index 00000000..e57dc41a
--- /dev/null
+++ b/src/generalinfowidget.cpp
@@ -0,0 +1,292 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Yann Hodique *
+ * Yann.Hodique@lifl.fr *
+ * *
+ * 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 <klineedit.h>
+#include <qtextedit.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+
+#include <kurl.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kcharsets.h>
+#include <qregexp.h>
+#include <kmessagebox.h>
+
+#include "generalinfowidget.h"
+#include "generalinfowidget.moc"
+#include "domutil.h"
+#include "projectmanager.h"
+
+QString makeRelativePath(const QString& fromPath, const QString& toPath);
+
+GeneralInfoWidget::GeneralInfoWidget(QDomDocument &projectDom, QWidget *parent, const char *name)
+ : GeneralInfoWidgetBase(parent, name), m_projectDom(projectDom) {
+
+ connect(project_directory_edit, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotProjectDirectoryChanged(const QString&)));
+ connect(project_directory_combo, SIGNAL(activated(int)),
+ this, SLOT(slotProjectDirectoryComboChanged()));
+ readConfig();
+}
+
+
+
+GeneralInfoWidget::~GeneralInfoWidget() {}
+
+void GeneralInfoWidget::readConfig() {
+ if(DomUtil::readBoolEntry(m_projectDom,"/general/absoluteprojectpath",false))
+ this->project_directory_combo->setCurrentItem(0);
+ else
+ this->project_directory_combo->setCurrentItem(1);
+ this->project_directory_edit->setText(DomUtil::readEntry(m_projectDom,"/general/projectdirectory","."));
+ this->author_edit->setText(DomUtil::readEntry(m_projectDom,"/general/author"));
+ this->email_edit->setText(DomUtil::readEntry(m_projectDom,"/general/email"));
+ this->version_edit->setText(DomUtil::readEntry(m_projectDom,"/general/version"));
+ this->description_edit->setText(DomUtil::readEntry(m_projectDom,"/general/description"));
+
+ QStringList encodings;
+ encodings << i18n("Use global editor settings");
+ encodings += KGlobal::charsets()->descriptiveEncodingNames();
+ QStringList::const_iterator it = encodings.constBegin();
+ while ( it != encodings.constEnd() )
+ {
+ encoding_combo->insertItem( *it );
+ ++it;
+ }
+ encoding_combo->setCurrentItem( 0 );
+
+// const QString DefaultEncoding = KGlobal::charsets()->encodingForName( DomUtil::readEntry( m_projectDom, "/general/defaultencoding", QString::null ) );
+ const QString DefaultEncoding = DomUtil::readEntry( m_projectDom, "/general/defaultencoding", QString::null );
+ for ( int i = 0; i < encoding_combo->count(); i++ )
+ {
+ if ( KGlobal::charsets()->encodingForName( encoding_combo->text( i ) ) == DefaultEncoding )
+ {
+ encoding_combo->setCurrentItem( i );
+ break;
+ }
+ }
+
+}
+/**
+ * Update the configure.in, configure.in or configure.ac file with the version value from project options.
+ * Very basic updating - uses regex to update the field in
+ * AC_INIT, AM_INIT_AUTOMAKE, and AC_DEFINE macros.
+ * On next make, the build system re-runs configure to update config.h
+ * version info.
+ *
+ * @param configureinpath Full path to configure.in file
+ * @param newVersion The new version number or string
+*/
+void GeneralInfoWidget::configureinUpdateVersion( QString configureinpath, QString newVersion )
+{
+ QFile configurein(configureinpath);
+
+ if ( !configurein.open( IO_ReadOnly ) ){
+ KMessageBox::error(this, i18n("Could not open %1 for reading.").arg(configureinpath));
+ return;
+ }
+
+ QTextStream stream( &configurein);
+ QStringList list;
+
+ // Options for version:
+
+ // we ignore old AC_INIT that had no version..
+ // only match the if there is a comma and at least two args..
+ // AC_INIT (package, version, [bug-report], [tarname])
+ QRegExp ac_init("^AC_INIT\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)");
+
+ // AM_INIT_AUTOMAKE([OPTIONS])
+ // example: AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2])
+ QRegExp am_autoSpace("^AM_INIT_AUTOMAKE\\s{0,}\\(\\s{0,}([\\[\\s]{0,}[^\\s]+)\\s+([^\\s\\)\\]]+)(.*)");
+
+ // AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+ QRegExp am_autoComma("^AM_INIT_AUTOMAKE\\s*\\(\\s*([^,]+),([^,\\)]+)(.*)");
+
+ // look for version in a define.
+ // AC_DEFINE(VERSION, "5.6")
+ QRegExp ac_define("^AC_DEFINE\\s*\\(");
+ QRegExp version("(\\bversion\\b)");
+ version.setCaseSensitive(FALSE);
+
+ while ( !stream.eof() ) {
+ QString line = stream.readLine();
+ if ( ac_init.search(line) >= 0){
+ line = "AC_INIT(" + ac_init.cap(1).stripWhiteSpace();
+ line += ", ";
+ line += newVersion;
+ line += ac_init.cap(3).stripWhiteSpace();
+ }
+ else if ( am_autoComma.search(line) >= 0 ){
+ line="AM_INIT_AUTOMAKE(";
+ line += am_autoComma.cap(1).stripWhiteSpace();
+ line += ", ";
+ line += newVersion;
+ line += am_autoComma.cap(3).stripWhiteSpace();
+ }
+ else if ( am_autoSpace.search(line) >= 0 ){
+ line = "AM_INIT_AUTOMAKE(" + am_autoSpace.cap(1).stripWhiteSpace();
+ line += " ";
+ line += newVersion;
+ line += " ";
+ line += am_autoSpace.cap(3).stripWhiteSpace();
+ }
+ else if ( ac_define.search(line) >=0 && version.search(line) >=0) {
+ // replace version in: AC_DEFINE(VERSION,"0.1")
+ line="AC_DEFINE(" + version.cap(1).stripWhiteSpace()+", \"" + newVersion +"\")";
+ }
+ list.push_back(line);
+ }
+ configurein.close();
+
+ // write our changes..
+ QFile configureout(configureinpath);
+ if ( !configureout.open( IO_WriteOnly ) ){
+ KMessageBox::error(this, i18n("Could not open %1 for writing.").arg(configureinpath));
+ return ;
+ }
+ QTextStream output( &configureout);
+ for(QStringList::iterator iter = list.begin();iter!=list.end();iter++){
+ output << (*iter) <<"\n";
+ }
+ configureout.close();
+}
+
+void GeneralInfoWidget::writeConfig() {
+ DomUtil::writeEntry(m_projectDom,"/general/projectdirectory",project_directory_edit->text());
+ DomUtil::writeBoolEntry(m_projectDom,"/general/absoluteprojectpath",isProjectDirectoryAbsolute());
+ DomUtil::writeEntry(m_projectDom,"/general/email",email_edit->text());
+ DomUtil::writeEntry(m_projectDom,"/general/author",author_edit->text());
+ DomUtil::writeEntry(m_projectDom,"/general/email",email_edit->text());
+ if ( DomUtil::readEntry(m_projectDom,"/general/version") != version_edit->text() && !DomUtil::elementByPath( m_projectDom, "/kdevautoproject").isNull() ){
+ // update the configure.in.in, configure.in or configure.ac file.
+ QFile inInFile(projectDirectory() + "/configure.in.in");
+ QFile inFile(projectDirectory() + "/configure.in");
+ QFile acFile(projectDirectory() + "/configure.ac");
+ if ( inInFile.exists()){
+ configureinUpdateVersion( inInFile.name(), version_edit->text() );
+ }
+ if ( inFile.exists()){
+ configureinUpdateVersion( inFile.name(), version_edit->text() );
+ }
+ if (acFile.exists()){
+ configureinUpdateVersion( acFile.name(), version_edit->text() );
+ }
+ if (! inInFile.exists()&& !inFile.exists() && !acFile.exists()) {
+ KMessageBox::error(this, i18n("Could not find configure.in.in, configure.in or configure.ac to update the project version."));
+ }
+ }
+ DomUtil::writeEntry(m_projectDom,"/general/version",version_edit->text());
+ DomUtil::writeEntry(m_projectDom,"/general/description",description_edit->text());
+
+ QString DefaultEncoding = QString::null;
+ if ( encoding_combo->currentItem() > 0 )
+ {
+ DefaultEncoding = KGlobal::charsets()->encodingForName( encoding_combo->currentText() );
+ }
+ DomUtil::writeEntry( m_projectDom, "/general/defaultencoding", DefaultEncoding );
+}
+
+void GeneralInfoWidget::accept() {
+ writeConfig();
+}
+
+bool GeneralInfoWidget::isProjectDirectoryAbsolute() {
+ return project_directory_combo->currentItem() == 0;
+}
+
+QString GeneralInfoWidget::projectDirectory() {
+ return ProjectManager::projectDirectory( project_directory_edit->text(), isProjectDirectoryAbsolute() );
+}
+
+void GeneralInfoWidget::slotProjectDirectoryChanged( const QString& text ) {
+ if(text.isEmpty())
+ {
+ setProjectDirectoryError(i18n("Please enter a path."));
+ }
+ else if(isProjectDirectoryAbsolute() && text[0] != '/')
+ {
+ setProjectDirectoryError(
+ i18n("'%1' is not an absolute path.").arg(
+ project_directory_edit->text()));
+ }
+ else if(!isProjectDirectoryAbsolute() && text[0] == '/')
+ {
+ setProjectDirectoryError(
+ i18n("'%1' is not a relative path.").arg(
+ project_directory_edit->text()));
+ }
+ else
+ {
+ QFileInfo info(projectDirectory());
+ if(!info.exists())
+ setProjectDirectoryError(
+ i18n("'%1' does not exist.").arg(
+ project_directory_edit->text()));
+ else if(!info.isDir())
+ setProjectDirectoryError(
+ i18n("'%1' is not a directory.").arg(
+ project_directory_edit->text()));
+ else
+ setProjectDirectorySuccess();
+ }
+}
+
+void GeneralInfoWidget::slotProjectDirectoryComboChanged() {
+ QString text = project_directory_edit->text();
+ if(isProjectDirectoryAbsolute() && text[0] != '/' )
+ project_directory_edit->setText(ProjectManager::projectDirectory(text,false));
+ else if(!isProjectDirectoryAbsolute() && text[0] == '/')
+ {
+ project_directory_edit->setText(KURL(ProjectManager::getInstance()->projectFile(), text).url());
+ }
+}
+
+void GeneralInfoWidget::setProjectDirectoryError( const QString& error ) {
+ project_directory_diagnostic_icon->setPixmap(SmallIcon("no"));
+ project_directory_diagnostic_label->setText( error );
+}
+
+void GeneralInfoWidget::setProjectDirectorySuccess() {
+ project_directory_diagnostic_icon->setPixmap(SmallIcon("ok"));
+ if(isProjectDirectoryAbsolute())
+ project_directory_diagnostic_label->setText(
+ i18n("'%1' is a valid project directory.").arg(projectDirectory()));
+ else
+ project_directory_diagnostic_label->setText(
+ i18n("'%1' is a valid project directory.").arg(projectDirectory()));
+}
+
+QString makeRelativePath(const QString& fromPath, const QString& toPath)
+{
+ if ( fromPath == toPath )
+ return ".";
+
+ QStringList fromDirs = QStringList::split( '/', fromPath );
+ QStringList toDirs = QStringList::split( '/', toPath );
+ QStringList::iterator fromIt = fromDirs.begin();
+ QStringList::iterator toIt = toDirs.begin();
+
+ QString relative;
+
+ for ( ; (*fromIt) == (*toIt); ++fromIt, ++toIt )
+ ;
+
+ for ( ; fromIt != fromDirs.end(); ++fromIt )
+ relative += "../";
+
+ for ( ; toIt != toDirs.end(); ++toIt )
+ relative += *toIt + "/";
+
+ return relative;
+}
diff --git a/src/generalinfowidget.h b/src/generalinfowidget.h
new file mode 100644
index 00000000..b6e3a85f
--- /dev/null
+++ b/src/generalinfowidget.h
@@ -0,0 +1,53 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Yann Hodique *
+ * Yann.Hodique@lifl.fr *
+ * *
+ * 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 _GENERALINFOWIDGET_H_
+#define _GENERALINFOWIDGET_H_
+
+#include <qwidget.h>
+#include <qdom.h>
+
+#include "generalinfowidgetbase.h"
+
+class QDomDocument;
+
+/**
+General project information widget.
+*/
+class GeneralInfoWidget : public GeneralInfoWidgetBase {
+ Q_OBJECT
+
+public:
+
+ GeneralInfoWidget(QDomDocument &projectDom, QWidget *parent=0, const char *name=0);
+ ~GeneralInfoWidget();
+
+public slots:
+ void accept();
+
+private slots:
+ void slotProjectDirectoryChanged( const QString& text );
+ void slotProjectDirectoryComboChanged();
+
+private:
+
+ QDomDocument m_projectDom;
+
+ void readConfig();
+ void writeConfig();
+
+ bool isProjectDirectoryAbsolute();
+ QString projectDirectory();
+ void setProjectDirectoryError( const QString& error );
+ void setProjectDirectorySuccess();
+ void configureinUpdateVersion( QString configureinpath, QString newVersion );
+};
+
+#endif
diff --git a/src/generalinfowidgetbase.ui b/src/generalinfowidgetbase.ui
new file mode 100644
index 00000000..370c42e4
--- /dev/null
+++ b/src/generalinfowidgetbase.ui
@@ -0,0 +1,245 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>GeneralInfoWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>general_info_widget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>518</width>
+ <height>375</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>General Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="0" column="4">
+ <item>
+ <property name="text">
+ <string>Absolute Path</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Relative to Project File</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>project_directory_combo</cstring>
+ </property>
+ </widget>
+ <spacer row="4" column="3" rowspan="1" colspan="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>408</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="5" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>description_label</cstring>
+ </property>
+ <property name="text">
+ <string>Description:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>project_directory_label</cstring>
+ </property>
+ <property name="text">
+ <string>Project directory:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>author_label</cstring>
+ </property>
+ <property name="text">
+ <string>Author:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>email_label</cstring>
+ </property>
+ <property name="text">
+ <string>Email:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>version_label</cstring>
+ </property>
+ <property name="text">
+ <string>Version:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>version_edit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Project Version
+You may need to run automake &amp; friends to update
+the version in all files after changing this.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>email_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Used in templates as $EMAIL$
+Placed in the AUTHORS file</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>author_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Used in templates as $AUTHOR$
+Placed in the AUTHORS file</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="1">
+ <property name="name">
+ <cstring>project_directory_diagnostic_icon</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>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>10</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>project_directory_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Where the project starts.</string>
+ </property>
+ </widget>
+ <widget class="KSqueezedTextLabel" row="1" column="2" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>project_directory_diagnostic_label</cstring>
+ </property>
+ <property name="font">
+ <font>
+ </font>
+ </property>
+ <property name="text">
+ <string>Please select a project directory</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="7" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Default encoding:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="7" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>encoding_combo</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Default encoding used when opening text files</string>
+ </property>
+ </widget>
+ <widget class="QTextEdit" row="6" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>description_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Text that stays in the project file.</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="PNG" length="532">89504e470d0a1a0a0000000d49484452000000100000001008060000001ff3ff61000001db49444154388da593316853511486bf276f78810a195fc0218a83e91688c3bb9b42974c925570509cc4cd3116445dd4ba889b0a82e8225dac6b07b1b74ba18b1887428796e64183efa2c1dc21f03bdc247d4dede48103971ffefffce7dc73226b2dff13f13c907dfa2c1612889363f8c8392e3c7dccea171b95f168ea20cb32f1e419341a90542099088c3df811148ef50fef591914749faf442705dc4f31f4503870c591b731e05c1002bebb82fb7b39f796bb11c01980acd3117b39f47af0a307692d90060ef677a15a0d2dedf7591c7a6ee67d3ac66826c0b95aa8fa6d1beae7e1c675586ac34e0fe20adcbd03b76fc1c8c3619fc541410330c628181d14b0b50987057c5d0f7358ba0a833eb44c1079f112f23e3847e1f2a3295a6b519a4a17ebd242225d6a84f7db779224fdfa235deb48691a32461b31ba0202145af03ef43cf46106de4366e0f708ce56e07213f23ce4183cc99c8318294924905a4de9e020546e35a5070f8393d7afa41809b49624330731c0680c95c937e10ad8d985e52e6c6d874c6b302c8e2d962f3b48411f09ea8259a57fe5469ca833a90e086b2dd65aaaa0b55348a7924151f998dac6e8510cf5b93b986ee49bb167b504596ba368fe1adbc6a879928e0736e7c850ba857298c99a9e165332c05fc9532863e03dd50a0000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>project_directory_edit</tabstop>
+ <tabstop>project_directory_combo</tabstop>
+ <tabstop>author_edit</tabstop>
+ <tabstop>email_edit</tabstop>
+ <tabstop>version_edit</tabstop>
+ <tabstop>description_edit</tabstop>
+ <tabstop>encoding_combo</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+ <include location="global" impldecl="in declaration">ksqueezedtextlabel.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>ksqueezedtextlabel.h</includehint>
+</includehints>
+</UI>
diff --git a/src/kconf_update/Makefile.am b/src/kconf_update/Makefile.am
new file mode 100644
index 00000000..b31e578c
--- /dev/null
+++ b/src/kconf_update/Makefile.am
@@ -0,0 +1,18 @@
+AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT $(all_includes)
+
+update_DATA = kdev-gen-settings.upd
+updatedir = $(kde_datadir)/kconf_update
+
+# The Qt app cannot go into kde_datadir, that is not portable.
+# install to kde_bindir/kconf_update_bin instead.
+# KDE 3.2 will allow kconf_update scripts to run directly from there,
+# but for us that's too late. Use the .sh script as a workaround.
+kconf_PROGRAMS = kdev-gen-settings-kconf_update
+kconfdir = $(libdir)/kconf_update_bin
+
+kdev_gen_settings_kconf_update_SOURCES = kdev-gen-settings-kconf_update.cpp
+kdev_gen_settings_kconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kdev_gen_settings_kconf_update_LDADD = $(LIB_QT)
+
+# vim: set noet:
+
diff --git a/src/kconf_update/kdev-gen-settings-kconf_update.cpp b/src/kconf_update/kdev-gen-settings-kconf_update.cpp
new file mode 100644
index 00000000..1f3c9740
--- /dev/null
+++ b/src/kconf_update/kdev-gen-settings-kconf_update.cpp
@@ -0,0 +1,113 @@
+/*
+ kconf_update app for migrating kdevelop's ui settings to the new
+ code that will be in 3.3.
+
+ Copyright (c) 2005 by Matt Rogers <mattr@kde.org>
+ Based on code Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include <qmap.h>
+#include <qtextstream.h>
+#include <qregexp.h>
+
+static QTextStream qcin ( stdin, IO_ReadOnly );
+static QTextStream qcout( stdout, IO_WriteOnly );
+static QTextStream qcerr( stderr, IO_WriteOnly );
+
+// Group cache. Yes, I know global vars are ugly :)
+bool needFlush = false;
+QString newKeyValue;
+int newDataValue;
+
+void parseKey( const QString &group, const QString &key,
+ const QString &value, const QString &rawLine )
+{
+
+ //qcerr << "*** group='" << group << "'" << endl;
+ if ( group == "General Options" && key == "Embed KDevDesigner")
+ {
+ newKeyValue = "Designer App";
+ if ( value.lower() == "true" )
+ newDataValue = 0;
+ else
+ newDataValue = 2;
+ qcout << newKeyValue << "=" << newDataValue << endl;
+ qcout << "# DELETE [" << key << "]" << endl;
+
+ }
+ else if ( group == "General Options" && key == "Application Font" )
+ {
+ newKeyValue = "OutputViewFont";
+ qcout << newKeyValue << "=" << value << endl;
+ qcout << "# DELETE [" << key << "]" << endl;
+ }
+ else if ( group == "MakeOutputView" && key == "Messages Font" )
+ {
+ qcout << "# DELETE [" << key << "]" << endl;
+ }
+ else if ( group == "TerminalEmulator" && key == "UseKDESetting" )
+ {
+ newKeyValue = "UseKDESetting";
+ if ( value.lower() == "true" )
+ newDataValue = 0;
+ else
+ newDataValue = 1;
+ qcout << newKeyValue << "=" << newDataValue << endl;
+ }
+ else
+ {
+ // keys we don't convert. output the raw line instead.
+ qcout << rawLine << endl;
+ }
+}
+
+int main()
+{
+ qcin.setEncoding( QTextStream::UnicodeUTF8 );
+ qcout.setEncoding( QTextStream::UnicodeUTF8 );
+
+ QString curGroup;
+
+ QRegExp groupRegExp( "^\\[(.*)\\]" );
+ QRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" );
+ QRegExp commentRegExp( "^(#.*)?$" );
+
+ while ( !qcin.atEnd() )
+ {
+ QString line = qcin.readLine();
+
+ if ( commentRegExp.exactMatch( line ) )
+ {
+ // We found a comment, leave unchanged
+ qcout << line << endl;
+ }
+ else if ( groupRegExp.exactMatch( line ) )
+ {
+ curGroup = groupRegExp.capturedTexts()[ 1 ];
+ qcout << line << endl;
+ }
+ else if ( keyRegExp.exactMatch( line ) )
+ {
+ // We found the a key line
+ parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line );
+ }
+ else
+ {
+ qcout << line << endl;
+ }
+ }
+
+ return 0;
+}
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/src/kconf_update/kdev-gen-settings.upd b/src/kconf_update/kdev-gen-settings.upd
new file mode 100644
index 00000000..3592126f
--- /dev/null
+++ b/src/kconf_update/kdev-gen-settings.upd
@@ -0,0 +1,8 @@
+#Update the KDevelop General Settings page to work with the
+#new UI file created on 20050406
+Id=kdev-gen-settings-update/5
+File=kdeveloprc
+Script=kdev-gen-settings-kconf_update
+Options=overwrite
+AllKeys
+
diff --git a/src/kdevassistantextension.cpp b/src/kdevassistantextension.cpp
new file mode 100644
index 00000000..acb1e92b
--- /dev/null
+++ b/src/kdevassistantextension.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "kdevassistantextension.h"
+
+KDevAssistantExtension::KDevAssistantExtension()
+ : ShellExtension()
+{
+}
+
+void KDevAssistantExtension::init()
+{
+ s_instance = new KDevAssistantExtension();
+}
+
+QString KDevAssistantExtension::xmlFile()
+{
+ return "kdevassistantui.rc";
+}
+
+QString KDevAssistantExtension::defaultProfile()
+{
+ return "KDevAssistant";
+}
diff --git a/src/kdevassistantextension.h b/src/kdevassistantextension.h
new file mode 100644
index 00000000..d00b02ca
--- /dev/null
+++ b/src/kdevassistantextension.h
@@ -0,0 +1,41 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef KDEVASSISTANTEXTENSION_H
+#define KDEVASSISTANTEXTENSION_H
+
+#include "shellextension.h"
+
+class KDevAssistantExtension : public ShellExtension {
+public:
+ static void init();
+
+ virtual void createGlobalSettingsPage(KDialogBase */*dlg*/) {};
+ virtual void acceptGlobalSettingsPage(KDialogBase */*dlg*/) {};
+
+ virtual QString xmlFile();
+
+ virtual QString defaultProfile();
+
+protected:
+ KDevAssistantExtension();
+
+};
+
+#endif
diff --git a/src/kdevassistantrc b/src/kdevassistantrc
new file mode 100644
index 00000000..eaab6fc6
--- /dev/null
+++ b/src/kdevassistantrc
@@ -0,0 +1,14 @@
+[RightToolWindow]
+LastWidget=Documentation
+Width=254
+
+[UI]
+CloseOnHover=false
+CloseOnHoverDelay=false
+MDIMode=4
+MDIStyle=1
+OpenNewTabAfterCurrent=true
+ShowCloseTabsButton=true
+ShowTabIcons=true
+TabWidgetVisibility=0
+UseSimpleMainWindow=true
diff --git a/src/kdevassistantui.rc b/src/kdevassistantui.rc
new file mode 100644
index 00000000..a5b202ce
--- /dev/null
+++ b/src/kdevassistantui.rc
@@ -0,0 +1,168 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui version="9" name="kdevassistant" >
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <DefineGroup name="new_merge"/>
+ <Separator/>
+ <Action name="file_open"/>
+<!-- <Action name="file_open_recent"/> -->
+ <DefineGroup name="open_merge"/>
+ <Separator/>
+ <DefineGroup name="save_merge"/>
+<!-- <Action name="file_save_all"/> -->
+ <Separator/>
+ <DefineGroup name="revert_merge"/>
+<!-- <Action name="file_revert_all"/> -->
+ <Separator/>
+ <DefineGroup name="print_merge"/>
+ <Merge/>
+ <Separator/>
+ <Action name="file_close"/>
+ <DefineGroup name="close_merge"/>
+ <Action name="file_close_all"/>
+ <Action name="file_closeother"/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+<!-- <Menu name="edit"><text>&amp;Edit</text>
+ <DefineGroup name="edit_undo_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_paste_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_select_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_find_merge"/>
+ <DefineGroup name="kdev_edit_find_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_astyle"/>
+ <Separator/>
+ <Merge/>
+ </Menu> -->
+ <Merge/>
+ <Menu name="view">
+ <text>&amp;View</text>
+ <DefineGroup name="history_operations"/>
+ <Action name="file_switchto"/>
+ <Action name="raise_editor"/>
+ <Separator/>
+ <DefineGroup name="error_operations"/>
+ <Separator/>
+ <Merge/>
+ <Separator/>
+ <DefineGroup name="view_operations"/>
+ </Menu>
+<!-- <Menu name="project">
+ <text>&amp;Project</text>
+ <DefineGroup name="project_new"/>
+ <Action name="project_open"/>
+ <Action name="project_open_recent"/>
+ <Action name="project_active_language"/>
+ <DefineGroup name="project_import"/>
+ <Separator/>
+ <Merge/>
+ <Action name="project_options"/>
+ <Separator/>
+ <Action name="project_close"/>
+ </Menu>
+ <Menu name="build">
+ <text>Bu&amp;ild</text>
+ <Merge/>
+ <Separator/>
+ <Action name="stop_processes"/>
+ </Menu> -->
+<!-- <Menu name="tools">
+ <text>&amp;Tools</text>
+ <DefineGroup name="tools_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_file_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_language_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_project_operations"/>
+ <Separator/>
+ <Merge/>
+ </Menu> -->
+ <Menu name="settings" noMerge="1">
+ <text>&amp;Settings</text>
+ <Action name="settings_show_menubar" />
+ <Merge name="StandardToolBarMenuHandler" />
+ <Action name="settings_main_toolbar"/>
+<!-- <Action name="settings_build_toolbar"/> -->
+ <Action name="settings_view_toolbar"/>
+ <Action name="settings_browser_toolbar"/>
+ <DefineGroup name="show_toolbar_merge" />
+ <Action name="settings_viewbar"/>
+ <Action name="settings_statusbar"/>
+ <DefineGroup name="show_merge" />
+ <Separator />
+ <Action name="settings_configure_shortcuts" />
+ <Action name="settings_configure_toolbars" />
+ <Action name="settings_configure_notifications" />
+ <Action name="settings_configure_editors" />
+ <Action name="settings_configure" />
+ <DefineGroup name="configure_merge" />
+ </Menu>
+ <Menu append="settings_merge" name="window">
+ <text>&amp;Window</text>
+ <Action name="view_next_window"/>
+ <Action name="view_previous_window"/>
+ <Separator/>
+ <Action name="split_h"/>
+ <Action name="split_v"/>
+ <Separator/>
+ <Action name="switch_left_dock"/>
+ <Action name="switch_right_dock"/>
+ <Action name="switch_bottom_dock"/>
+ <Separator/>
+ <DefineGroup name="window_operations"/>
+ <Merge/>
+ </Menu>
+ <Menu name="help" append="about_merge">
+ <text>&amp;Help</text>
+ <Merge/>
+ </Menu>
+</MenuBar>
+
+<ToolBar name="mainToolBar" position="Top" noMerge="1" fullWidth="true" newline="true" >
+ <text>Main Toolbar</text>
+<!-- <Action name="project_open" /> -->
+ <DefineGroup name="project_operations"/>
+ <DefineGroup name="file_operations"/>
+ <DefineGroup name="print_merge"/>
+ <DefineGroup name="edit_operations"/>
+ <DefineGroup name="find_operations"/>
+<!-- <Action name="tree_view"/>
+ <Action name="output_view"/> -->
+ <DefineGroup name="view_operations"/>
+ <DefineGroup name="zoom_operations"/>
+ <Merge/>
+ <Action name="help_whats_this"/>
+</ToolBar>
+
+<!--<ToolBar name="buildToolBar" position="Top" noMerge="1">
+ <text>Build Toolbar</text>
+ <DefineGroup name="build_operations"/>
+ <DefineGroup name="debug_operations"/>
+ <Action name="stop_processes"/>
+</ToolBar>-->
+
+<ToolBar name="browserToolBar" position="Top" noMerge="1">
+ <text>Browser Toolbar</text>
+ <DefineGroup name="class_operations" />
+ <DefineGroup name="browser_operations" />
+ <Action name="browser_back" />
+ <Action name="browser_forward" />
+ <Merge/>
+</ToolBar>
+
+<ToolBar name="extraToolBar" position="Top" noMerge="1" hidden="true">
+ <text>Extra Toolbar</text>
+</ToolBar>
+
+<Menu name="rb_popup">
+ <Separator/>
+ <Action name="file_close"/>
+ <Action name="file_closeother"/>
+</Menu>
+
+</kpartgui>
diff --git a/src/kdeveloprc b/src/kdeveloprc
new file mode 100644
index 00000000..fe62909f
--- /dev/null
+++ b/src/kdeveloprc
@@ -0,0 +1,70 @@
+[AStyle]
+Brackets=Break
+Fill=Spaces
+FillSpaces=2
+IndentBrackets=false
+IndentCases=false
+IndentClasses=false
+IndentLabels=true
+IndentNamespaces=true
+IndentSwitches=false
+KeepBlocks=false
+KeepStatements=false
+MaxStatement=40
+MinConditional=-1
+PadOperators=false
+PadParentheses=false
+Style=UserDefined
+
+[Editor]
+EmbeddedKTextEditor=Embedded KDE Advanced Text Editor Component
+
+[General Options]
+Read Last Project On Startup=true
+
+[Mainwindow]
+Height 768=548
+Width 1024=735
+
+[Mainwindow Toolbar mainToolBar]
+Hidden=false
+IconSize=22
+IconText=IconOnly
+Index=0
+NewLine=false
+Offset=-1
+Position=Top
+
+[Mainwindow Toolbar QextMdiTaskBar]
+Hidden=true
+IconSize=22
+IconText=IconOnly
+Index=1
+NewLine=false
+Offset=-1
+Position=Bottom
+
+[Mainwindow Toolbar browserToolBar]
+Hidden=false
+IconSize=22
+IconText=IconOnly
+Index=2
+NewLine=true
+Offset=-1
+Position=Top
+
+[Plugins]
+KDevScripting=false
+
+[UI]
+MDIStyle=3
+MDIMode=4
+TabVisibility=0
+CloseOnHover=false
+CloseOnHoverDelay=false
+OpenNewTabAfterCurrent=true
+ShowCloseTabsButton=true
+ShowTabIcons=false
+
+[Kate View Defaults]
+Icon Bar=true
diff --git a/src/kdevelopui.rc b/src/kdevelopui.rc
new file mode 100644
index 00000000..f1939592
--- /dev/null
+++ b/src/kdevelopui.rc
@@ -0,0 +1,191 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui version="33" name="kdevelop" >
+<MenuBar>
+ <Menu name="file" noMerge="1"><text>&amp;File</text>
+ <DefineGroup name="new_merge"/>
+ <Separator/>
+ <Action name="file_open"/>
+ <Action name="file_open_recent"/>
+ <DefineGroup name="open_merge"/>
+ <Separator/>
+ <DefineGroup name="save_merge"/>
+ <Action name="file_save_all"/>
+ <Separator/>
+ <DefineGroup name="revert_merge"/>
+ <Action name="file_revert_all"/>
+ <Separator/>
+ <DefineGroup name="print_merge"/>
+ <Merge/>
+ <Separator/>
+ <Action name="file_close"/>
+ <DefineGroup name="close_merge"/>
+ <Action name="file_close_all"/>
+ <Action name="file_closeother"/>
+ <Separator/>
+ <Action name="file_quit"/>
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <DefineGroup name="edit_undo_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_paste_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_select_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_find_merge"/>
+ <DefineGroup name="kdev_edit_find_merge"/>
+ <Separator/>
+ <DefineGroup name="edit_astyle"/>
+ <Separator/>
+ <Merge/>
+ </Menu>
+ <Menu name="view">
+ <text>&amp;View</text>
+ <DefineGroup name="history_operations"/>
+ <Action name="history_back"/>
+ <Action name="history_forward"/>
+ <Action name="goto_last_edit_pos"/>
+ <Separator/>
+ <Action name="file_switchto"/>
+ <Action name="raise_editor"/>
+ <Separator/>
+ <DefineGroup name="error_operations"/>
+ <Separator/>
+ <Merge/>
+ <Separator/>
+ <DefineGroup name="view_operations"/>
+ </Menu>
+ <Menu name="project">
+ <text>&amp;Project</text>
+ <DefineGroup name="project_new"/>
+ <Action name="project_open"/>
+ <Action name="project_open_recent"/>
+<!-- <Action name="project_active_language"/> -->
+ <DefineGroup name="project_import"/>
+ <Separator/>
+ <DefineGroup name="project_classes"/>
+ <Merge/>
+ <DefineGroup name="designer_project"/>
+ <Action name="project_options"/>
+ <Separator/>
+ <Action name="project_close"/>
+ </Menu>
+ <Menu name="build">
+ <text>Bu&amp;ild</text>
+ <Merge/>
+ <Separator/>
+ <Action name="stop_processes"/>
+ </Menu>
+ <Menu name="debug">
+ <text>&amp;Debug</text>
+ <DefineGroup name="debug"/>
+ <DefineGroup name="profile"/>
+ </Menu>
+ <Merge/>
+ <Menu name="tools">
+ <text>&amp;Tools</text>
+ <DefineGroup name="tools_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_file_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_language_operations"/>
+ <Separator/>
+ <DefineGroup name="tools_project_operations"/>
+ <Separator/>
+ <Merge/>
+ </Menu>
+ <Menu name="settings" noMerge="1">
+ <text>&amp;Settings</text>
+ <Action name="settings_show_menubar" />
+ <Merge name="StandardToolBarMenuHandler" />
+ <Action name="settings_main_toolbar"/>
+ <Action name="settings_build_toolbar"/>
+ <Action name="settings_view_toolbar"/>
+ <Action name="settings_browser_toolbar"/>
+ <DefineGroup name="show_toolbar_merge" />
+ <Action name="settings_viewbar"/>
+ <Action name="settings_statusbar"/>
+ <DefineGroup name="show_merge" />
+ <Separator />
+ <Action name="settings_configure_shortcuts" />
+ <Action name="set_configure_toolbars" />
+ <Action name="settings_configure_notifications" />
+ <Action name="settings_configure_plugins" />
+ <Action name="settings_configure_editors" />
+ <Action name="settings_configure" />
+ <DefineGroup name="configure_merge" />
+ </Menu>
+ <Menu append="settings_merge" name="window">
+ <text>&amp;Window</text>
+ <Action name="view_next_window"/>
+ <Action name="view_previous_window"/>
+ <Separator/>
+ <Action name="split_h"/>
+ <Action name="split_v"/>
+ <Separator/>
+ <Action name="switch_left_dock"/>
+ <Action name="switch_right_dock"/>
+ <Action name="switch_bottom_dock"/>
+ <Separator/>
+ <DefineGroup name="window_operations"/>
+ <Merge/>
+ </Menu>
+ <Menu name="help" append="about_merge">
+ <text>&amp;Help</text>
+ <Merge/>
+ </Menu>
+</MenuBar>
+
+<ToolBar name="mainToolBar" position="Top" noMerge="1" fullWidth="true" newline="true" >
+ <text>Main Toolbar</text>
+ <Action name="project_open" />
+ <DefineGroup name="project_operations"/>
+ <Action name="goto_last_edit_pos"/>
+ <Action name="history_back"/>
+ <Action name="history_forward"/>
+ <DefineGroup name="file_operations"/>
+ <DefineGroup name="print_merge"/>
+ <DefineGroup name="edit_operations"/>
+ <DefineGroup name="find_operations"/>
+ <DefineGroup name="view_operations"/>
+ <DefineGroup name="screenmode_operations"/>
+ <DefineGroup name="zoom_operations"/>
+ <Merge/>
+ <Action name="help_whats_this"/>
+</ToolBar>
+
+<ToolBar name="buildToolBar" position="Top" noMerge="1">
+ <text>Build Toolbar</text>
+ <Merge/>
+<!-- <DefineGroup name="build_operations"/>
+ <DefineGroup name="debug_operations"/>-->
+ <Action name="stop_processes"/>
+</ToolBar>
+
+<ToolBar name="browserToolBar" position="Top" noMerge="1">
+ <text>Browser Toolbar</text>
+<!-- <DefineGroup name="class_operations" />
+ <DefineGroup name="browser_operations" />-->
+ <Merge/>
+</ToolBar>
+
+<ToolBar name="extraToolBar" position="Top" noMerge="1" hidden="true">
+ <text>Extra Toolbar</text>
+</ToolBar>
+
+<Menu name="rb_popup">
+ <Separator/>
+ <Action name="file_close"/>
+ <Action name="file_closeother"/>
+</Menu>
+
+<ToolBar name="debugToolBar">
+ <text>Debugger Toolbar</text>
+ <Merge/>
+</ToolBar>
+
+<ToolBar name="viewsession_toolbar" >
+ <text>View Sessions Toolbar</text>
+ <Merge/>
+</ToolBar>
+
+</kpartgui>
diff --git a/src/kdevideextension.cpp b/src/kdevideextension.cpp
new file mode 100644
index 00000000..b6dc4e0d
--- /dev/null
+++ b/src/kdevideextension.cpp
@@ -0,0 +1,129 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "kdevideextension.h"
+
+#include <qvbox.h>
+#include <qcheckbox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <klineedit.h>
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+#include <kurlrequester.h>
+#include <kapplication.h>
+#include <kfontrequester.h>
+
+#include <kdevplugin.h>
+#include <kdevmakefrontend.h>
+#include <kdevplugincontroller.h>
+
+#include "api.h"
+#include "settingswidget.h"
+
+KDevIDEExtension::KDevIDEExtension()
+ : ShellExtension()
+{
+}
+
+void KDevIDEExtension::init()
+{
+ s_instance = new KDevIDEExtension();
+}
+
+void KDevIDEExtension::createGlobalSettingsPage(KDialogBase *dlg)
+{
+ KConfig* config = kapp->config();
+ QVBox *vbox = dlg->addVBoxPage(i18n("General"), i18n("General"), BarIcon("kdevelop", KIcon::SizeMedium) );
+ gsw = new SettingsWidget(vbox, "general settings widget");
+
+ gsw->projectsURL->setMode((int)KFile::Directory);
+
+ config->setGroup("General Options");
+ gsw->lastProjectCheckbox->setChecked(config->readBoolEntry("Read Last Project On Startup",true));
+ gsw->outputFont->setFont( config->readFontEntry( "OutputViewFont" ) );
+ config->setGroup("MakeOutputView");
+ gsw->lineWrappingCheckBox->setChecked(config->readBoolEntry("LineWrapping",true));
+ gsw->dirNavigMsgCheckBox->setChecked(config->readBoolEntry("ShowDirNavigMsg",false));
+ gsw->compileOutputCombo->setCurrentItem(config->readNumEntry("CompilerOutputLevel",2));
+ gsw->forceCLocaleRadio->setChecked( config->readBoolEntry( "ForceCLocale", true ) );
+ gsw->userLocaleRadio->setChecked( !config->readBoolEntry( "ForceCLocale", true ) );
+
+ config->setGroup("General Options");
+ gsw->projectsURL->setURL(config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/"));
+ gsw->designerButtonGroup->setButton( config->readNumEntry( "DesignerApp", 0 ) );
+
+ QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
+ gsw->qtDesignerRadioButton->setChecked( DesignerSetting == "ExternalDesigner" );
+ gsw->seperateAppRadioButton->setChecked( DesignerSetting == "ExternalKDevDesigner" );
+ gsw->embeddedDesignerRadioButton->setChecked( DesignerSetting == "EmbeddedKDevDesigner" );
+
+ config->setGroup("TerminalEmulator");
+ gsw->terminalEdit->setText( config->readEntry( "TerminalApplication", QString::fromLatin1("konsole") ) );
+ bool useKDESetting = config->readBoolEntry( "UseKDESetting", true );
+ gsw->useKDETerminal->setChecked( useKDESetting );
+ gsw->useOtherTerminal->setChecked( !useKDESetting );
+}
+
+void KDevIDEExtension::acceptGlobalSettingsPage(KDialogBase *dlg)
+{
+ KConfig* config = kapp->config();
+
+ config->setGroup("General Options");
+ config->writeEntry("DesignerApp", gsw->designerButtonGroup->selectedId());
+ config->writeEntry("Read Last Project On Startup",gsw->lastProjectCheckbox->isChecked());
+ config->writePathEntry("DefaultProjectsDir", gsw->projectsURL->url());
+ config->writeEntry("OutputViewFont", gsw->outputFont->font());
+
+ QString DesignerSetting;
+ if ( gsw->qtDesignerRadioButton->isChecked() ) DesignerSetting = "ExternalDesigner";
+ if ( gsw->seperateAppRadioButton->isChecked() ) DesignerSetting = "ExternalKDevDesigner";
+ if ( gsw->embeddedDesignerRadioButton->isChecked() ) DesignerSetting = "EmbeddedKDevDesigner";
+ config->writeEntry( "DesignerSetting", DesignerSetting );
+
+ config->setGroup("MakeOutputView");
+ config->writeEntry("LineWrapping",gsw->lineWrappingCheckBox->isChecked());
+ config->writeEntry("ShowDirNavigMsg",gsw->dirNavigMsgCheckBox->isChecked());
+ config->writeEntry( "ForceCLocale", gsw->forceCLocaleRadio->isChecked() );
+ //current item id must be in sync with the enum!
+ config->writeEntry("CompilerOutputLevel",gsw->compileOutputCombo->currentItem());
+ config->sync();
+ if( KDevPlugin *makeExt = API::getInstance()->pluginController()->extension("KDevelop/MakeFrontend"))
+ {
+ static_cast<KDevMakeFrontend*>(makeExt)->updateSettingsFromConfig();
+ }
+
+ config->setGroup("TerminalEmulator");
+ config->writeEntry("UseKDESetting", gsw->useKDETerminal->isChecked() );
+ config->writeEntry("TerminalApplication", gsw->terminalEdit->text().stripWhiteSpace() );
+}
+
+QString KDevIDEExtension::xmlFile()
+{
+ return "kdevelopui.rc";
+}
+
+QString KDevIDEExtension::defaultProfile()
+{
+ return "IDE";
+}
diff --git a/src/kdevideextension.h b/src/kdevideextension.h
new file mode 100644
index 00000000..af93d8cb
--- /dev/null
+++ b/src/kdevideextension.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef KDEVIDEEXTENSION_H
+#define KDEVIDEEXTENSION_H
+
+#include <shellextension.h>
+
+class SettingsWidget;
+
+class KDevIDEExtension : public ShellExtension {
+public:
+ static void init();
+
+ virtual void createGlobalSettingsPage(KDialogBase *dlg);
+ virtual void acceptGlobalSettingsPage(KDialogBase *dlg);
+
+ virtual QString xmlFile();
+
+ virtual QString defaultProfile();
+
+protected:
+ KDevIDEExtension();
+
+private:
+ SettingsWidget *gsw;
+};
+
+#endif
diff --git a/src/kdevpluginprofilerc b/src/kdevpluginprofilerc
new file mode 100644
index 00000000..1c2abb92
--- /dev/null
+++ b/src/kdevpluginprofilerc
@@ -0,0 +1,52 @@
+[Plugin Profiles]
+profiles=Profile_BASE,Profile_COMPILED,Profile_CPP,Profile_SCRIPT,Profile_WEB
+default=Profile_BASE
+
+[Category]
+Ada=
+C=
+C/GNOME=
+C/GBA=
+C/PalmOS=
+C++=Profile_CPP
+C++/Embedded=Profile_CPP
+C++/KDE=Profile_CPP
+C++/wxWidgets=
+C++/KDevelop
+C++/Generic
+C++/GTK+
+C++/QMake=
+PHP=
+Database=
+Shell=
+Java=
+Java/KDE=
+Java/Ant=
+Perl=
+Ruby=
+Python=
+Fortran=
+Haskell=
+Pascal/Free Pascal=
+
+[Profile_BASE]
+plugins=KDevFileView,KDevClassView,KDevBookmarks,KDevQuickOpen
+
+[Profile_COMPILED]
+inherits=Profile_BASE
+plugins=
+
+[Profile_CPP]
+inherits=Profile_COMPILED
+plugins=KDevDebugger
+
+[Profile_SCRIPT]
+inherits=Profile_BASE
+plugins=
+
+[Profile_WEB]
+inherits=Profile_SCRIPT
+plugins=KDevcopyto
+
+
+
diff --git a/src/languageselectwidget.cpp b/src/languageselectwidget.cpp
new file mode 100644
index 00000000..45922c2d
--- /dev/null
+++ b/src/languageselectwidget.cpp
@@ -0,0 +1,165 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qstring.h>
+#include <qvariant.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistview.h>
+#include <qgroupbox.h>
+#include <qhbox.h>
+#include <qregexp.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kservice.h>
+#include <ktrader.h>
+#include <kapplication.h>
+#include <kdevplugin.h>
+#include "domutil.h"
+
+#include "languageselectwidget.h"
+#include "plugincontroller.h"
+
+class LangPluginItem : public QCheckListItem
+{
+public:
+ // name - "Name", label - "GenericName", info - "Comment"
+ LangPluginItem( QListView * parent, QString const & name, QString const & label,
+ QString const & info )
+ : QCheckListItem( parent, label, QCheckListItem::CheckBox),
+ _name( name ), _info( info )
+ {}
+
+ QString info() { return _info; }
+ QString name() { return _name; }
+
+private:
+ QString _name;
+ QString _info;
+};
+
+
+LanguageSelectWidget::LanguageSelectWidget(QDomDocument &projectDom,
+ QWidget *parent, const char *name)
+ : QWidget(parent, name), m_projectDom(projectDom)
+{
+ init();
+}
+
+void LanguageSelectWidget::init()
+{
+ QVBoxLayout *layout = new QVBoxLayout(this);
+
+ QGroupBox * groupBox1 = new QGroupBox( i18n("Additional Language Support"), this );
+ groupBox1->setColumnLayout(0, Qt::Vertical );
+ groupBox1->layout()->setSpacing( 6 );
+ groupBox1->layout()->setMargin( 11 );
+ QVBoxLayout * groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
+ groupBox1Layout->setAlignment( Qt::AlignTop );
+
+ _currentLanguage = new QLabel( "", groupBox1 );
+
+ _pluginList = new QListView( groupBox1 );
+ _pluginList->setResizeMode( QListView::LastColumn );
+ _pluginList->addColumn("");
+ _pluginList->header()->hide();
+
+ groupBox1Layout->addWidget(_currentLanguage);
+ groupBox1Layout->addWidget( _pluginList );
+ layout->addWidget( groupBox1 );
+
+ QGroupBox * groupBox2 = new QGroupBox( i18n("Description"), this );
+ groupBox2->setColumnLayout(0, Qt::Vertical );
+ groupBox2->layout()->setSpacing( 6 );
+ groupBox2->layout()->setMargin( 11 );
+ QVBoxLayout * groupBox2Layout = new QVBoxLayout( groupBox2->layout() );
+ groupBox2Layout->setAlignment( Qt::AlignTop );
+
+ _pluginDescription = new QLabel( groupBox2 );
+ _pluginDescription->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
+
+ groupBox2Layout->addWidget( _pluginDescription );
+
+ layout->addWidget( groupBox2 );
+
+ connect( _pluginList, SIGNAL( selectionChanged( QListViewItem * ) ), this, SLOT( itemSelected( QListViewItem * ) ) );
+
+ readProjectConfig();
+}
+
+
+LanguageSelectWidget::~LanguageSelectWidget()
+{}
+
+void LanguageSelectWidget::readProjectConfig()
+{
+ KTrader::OfferList languageSupportOffers =
+ KTrader::self()->query(QString::fromLatin1("KDevelop/LanguageSupport"),
+ QString::fromLatin1("[X-KDevelop-Version] == %1"
+ ).arg( KDEVELOP_PLUGIN_VERSION ));
+
+ QStringList languages = DomUtil::readListEntry(m_projectDom, "/general/secondaryLanguages", "language");
+ QString language = DomUtil::readEntry(m_projectDom, "/general/primarylanguage");
+ _currentLanguage->setText(i18n("Primary language is '%1'. Please select additional languages the project might contain.").arg(language));
+
+ for (KTrader::OfferList::ConstIterator it = languageSupportOffers.begin(); it != languageSupportOffers.end(); ++it)
+ {
+ QString la = (*it)->property("X-KDevelop-Language").toString();
+ if (la == language)
+ continue;
+ LangPluginItem *item = new LangPluginItem( _pluginList, (*it)->property("X-KDevelop-Language").toString(), (*it)->genericName(), (*it)->comment() );
+ item->setOn(languages.contains(la));
+ }
+
+ QListViewItem * first = _pluginList->firstChild();
+ if ( first ) {
+ _pluginList->setSelected( first, true );
+ }
+}
+
+void LanguageSelectWidget::itemSelected( QListViewItem * item )
+{
+ if ( !item ) return;
+
+ LangPluginItem * pitem = static_cast<LangPluginItem*>( item );
+ _pluginDescription->setText( pitem->info() );
+}
+
+void LanguageSelectWidget::saveProjectConfig()
+{
+ QStringList languages;
+
+ QListViewItemIterator it( _pluginList );
+ while ( it.current() )
+ {
+ LangPluginItem * item = static_cast<LangPluginItem*>( it.current() );
+ if (item->isOn())
+ {
+ languages.append( item->name() );
+ }
+ ++it;
+ }
+
+ DomUtil::writeListEntry(m_projectDom, "/general/secondaryLanguages", "language", languages);
+}
+
+
+void LanguageSelectWidget::accept()
+{
+ saveProjectConfig();
+ emit accepted();
+}
+
+#include "languageselectwidget.moc"
diff --git a/src/languageselectwidget.h b/src/languageselectwidget.h
new file mode 100644
index 00000000..dcd063f0
--- /dev/null
+++ b/src/languageselectwidget.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _LANGUAGESELECTWIDGET_H_
+#define _LANGUAGESELECTWIDGET_H_
+
+#include <qdialog.h>
+#include <qdom.h>
+#include <qstringlist.h>
+
+class QListView;
+
+class LanguageSelectWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ /* for selection of project parts */
+ LanguageSelectWidget( QDomDocument &projectDom, QWidget *parent=0, const char *name=0 );
+ ~LanguageSelectWidget();
+
+public slots:
+ void accept();
+
+signals:
+ void accepted();
+
+private slots:
+ void itemSelected( QListViewItem * );
+
+private:
+ void init();
+ void readProjectConfig();
+ void saveProjectConfig();
+
+ QDomDocument m_projectDom;
+ QListView * _pluginList;
+ QLabel * _pluginDescription;
+ QLabel * _currentLanguage;
+
+};
+
+#endif
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 00000000..54d64b4c
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,153 @@
+#include <config.h>
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <dcopclient.h>
+
+#include <qfileinfo.h>
+
+#include "splashscreen.h"
+#include "toplevel.h"
+#include "plugincontroller.h"
+#include "partcontroller.h"
+#include "core.h"
+#include "projectmanager.h"
+
+#include "kdevideextension.h"
+
+static KCmdLineOptions options[] =
+{
+ { "profile <profile>", I18N_NOOP("Profile to load"), 0 },
+ { "+file(s)", I18N_NOOP("Files to load"), 0 },
+ { 0,0,0 }
+};
+
+int main(int argc, char *argv[])
+{
+ static const char description[] = I18N_NOOP("The KDevelop Integrated Development Environment");
+ KAboutData aboutData("kdevelop", I18N_NOOP("KDevelop"),
+ VERSION, description, KAboutData::License_GPL,
+ I18N_NOOP("(c) 1999-2007, The KDevelop developers"), "", "http://www.kdevelop.org");
+ aboutData.addAuthor("Alexander Dymo", I18N_NOOP("Release coordinator, Overall improvements, Pascal support, C++ support, New File and Documentation parts"), "adymo@kdevelop.org");
+ aboutData.addAuthor("Amilcar do Carmo Lucas", I18N_NOOP("Release coordinator, API documentation, Doxygen and autoproject patches"), "amilcar@ida.ing.tu-bs.de");
+ aboutData.addAuthor("David Nolden", I18N_NOOP("Advanced C++ code completion, C++ support, overall improvements"), "david.nolden.kdevelop@art-master.de");
+ aboutData.addAuthor("Bernd Gehrmann", I18N_NOOP("Initial idea, basic architecture, much initial source code"), "bernd@kdevelop.org");
+ aboutData.addAuthor("Caleb Tennis", I18N_NOOP("KTabBar, bugfixes"), "caleb@aei-tech.com");
+ aboutData.addAuthor("Richard Dale", I18N_NOOP("Java & Objective C support"), "Richard_Dale@tipitina.demon.co.uk");
+ aboutData.addAuthor("John Birch", I18N_NOOP("Debugger frontend"), "jbb@kdevelop.org");
+ aboutData.addAuthor("Vladimir Prus", I18N_NOOP("Debugger frontend"), "ghost@cs.msu.su");
+ aboutData.addAuthor("Sandy Meier", I18N_NOOP("PHP support, context menu stuff"), "smeier@kdevelop.org");
+ aboutData.addAuthor("Kurt Granroth", I18N_NOOP("KDE application templates"), "kurth@granroth.org");
+ aboutData.addAuthor("Ian Reinhart Geiser", I18N_NOOP("Dist part, bash support, application templates"), "geiseri@yahoo.com");
+ aboutData.addAuthor("Matthias Hoelzer-Kluepfel", I18N_NOOP("Several components, htdig indexing"), "hoelzer@kde.org");
+ aboutData.addAuthor("Victor Roeder", I18N_NOOP("Help with Automake manager and persistent class store"), "victor_roeder@gmx.de");
+ aboutData.addAuthor("Megan Webb", I18N_NOOP("Automake manager patches, Astyle plugin update, plugin patches and improvements"),"kdeveloper.megan@gmail.com");
+ aboutData.addAuthor("Harald Fernengel", I18N_NOOP("Ported to Qt 3, patches, valgrind, diff and perforce support"), "harry@kdevelop.org");
+ aboutData.addAuthor("Roberto Raggi", I18N_NOOP("QEditor component, code completion, Abbrev component, C++ support, Java support"), "roberto@kdevelop.org");
+ aboutData.addAuthor("Simon Hausmann", I18N_NOOP("Help with KParts infrastructure"), "hausmann@kde.org");
+ aboutData.addAuthor("Oliver Kellogg", I18N_NOOP("Ada support"), "okellogg@users.sourceforge.net");
+ aboutData.addAuthor("Andreas Pakulat", I18N_NOOP("QMake projectmanager, Qt4 Support"), "apaku@gmx.de");
+ aboutData.addAuthor("Jakob Simon-Gaarde", I18N_NOOP("QMake projectmanager"), "jsgaarde@tdcspace.dk");
+ aboutData.addAuthor("F@lk Brettschneider", I18N_NOOP("MDI modes, QEditor, bugfixes"), "falkbr@kdevelop.org");
+ aboutData.addAuthor("Mario Scalas", I18N_NOOP("PartExplorer, redesign of CvsPart, patches, bugs(fixes)"), "mario.scalas@libero.it");
+ aboutData.addAuthor("Jens Dagerbo", I18N_NOOP("Replace, Bookmarks, FileList and CTags2 plugins. Overall improvements and patches"), "jens.dagerbo@swipnet.se");
+ aboutData.addAuthor("Julian Rockey", I18N_NOOP("Filecreate part and other bits and patches"), "linux@jrockey.com");
+ aboutData.addCredit("Ajay Guleria", I18N_NOOP("ClearCase support"), "ajay_guleria@yahoo.com");
+ aboutData.addCredit("Marek Janukowicz", I18N_NOOP("Ruby support"), "child@t17.ds.pwr.wroc.pl");
+
+ aboutData.addCredit("The KWrite authors", I18N_NOOP("Kate editor component"), "kwrite-devel@kde.org");
+ aboutData.addCredit("The KHTML authors", I18N_NOOP("HTML documentation component"), "kwrite-devel@kde.org");
+ aboutData.addCredit("Robert Moniot", I18N_NOOP("Fortran documentation"), "moniot@fordham.edu");
+ aboutData.addCredit("Ka-Ping Yee", I18N_NOOP("Python documentation utility"), "ping@lfw.org");
+ aboutData.addCredit("Dimitri van Heesch", I18N_NOOP("Doxygen wizard"), "dimitri@stack.nl");
+ aboutData.addCredit("Hugo Varotto", I18N_NOOP("Fileselector component"), "hugo@varotto-usa.com");
+ aboutData.addCredit("Matt Newell", I18N_NOOP("Fileselector component"), "newellm@proaxis.com");
+ aboutData.addCredit("Trolltech AS", I18N_NOOP("Designer code"), "info@trolltech.com");
+ aboutData.addCredit("Daniel Engelschalt", I18N_NOOP("C++ code completion, persistent class store"), "daniel.engelschalt@gmx.net");
+ aboutData.addCredit("Stephane ANCELOT", I18N_NOOP("Patches"), "sancelot@free.fr");
+ aboutData.addCredit("Jens Zurheide", I18N_NOOP("Patches"), "jens.zurheide@gmx.de");
+ aboutData.addCredit("Luc Willems", I18N_NOOP("Help with Perl support"), "Willems.luc@pandora.be");
+ aboutData.addCredit("Marcel Turino", I18N_NOOP("Documentation index view"), "M.Turino@gmx.de");
+ aboutData.addCredit("Yann Hodique", I18N_NOOP("Patches"), "Yann.Hodique@lifl.fr");
+ aboutData.addCredit("Tobias Gl\303\244\303\237er" , I18N_NOOP("Documentation Finder, qmake projectmanager patches, usability improvements, bugfixes ... "), "tobi.web@gmx.de");
+ aboutData.addCredit("Andreas Koepfle" , I18N_NOOP("QMake project manager patches"), "koepfle@ti.uni-mannheim.de");
+ aboutData.addCredit("Sascha Cunz" , I18N_NOOP("Cleanup and bugfixes for qEditor, AutoMake and much other stuff"), "sascha@kdevelop.org");
+ aboutData.addCredit("Robert Gruber" , I18N_NOOP("SnippetPart, debugger and usability patches"), "rgruber@users.sourceforge.net");
+ aboutData.addCredit("Zoran Karavla", I18N_NOOP("Artwork for the Ruby language"), "webmaster@the-error.net", "http://the-error.net");
+
+ KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::addCmdLineOptions( options );
+ KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+
+ KApplication app;
+
+ KDevIDEExtension::init();
+
+ KDevSplashScreen *splash = 0;
+ QString splashFile = locate("appdata", "pics/kdevelop-splash.png");
+ if (!splashFile.isEmpty())
+ {
+ QPixmap pm;
+ pm.load(splashFile);
+ splash = new KDevSplashScreen( pm );
+ }
+
+ app.processEvents();
+
+ if (splash) splash->message( i18n( "Loading Settings" ) );
+ TopLevel::getInstance()->loadSettings();
+
+ QObject::connect(PluginController::getInstance(), SIGNAL(loadingPlugin(const QString &)),
+ splash, SLOT(message(const QString &)));
+ if (splash) splash->show();
+
+ PluginController::getInstance()->loadInitialPlugins();
+
+ Core::getInstance()->doEmitCoreInitialized();
+
+ if (splash) splash->message( i18n( "Starting GUI" ) );
+ TopLevel::getInstance()->main()->show();
+
+ if (splash) delete splash;
+
+ for( int i=0; i<args->count(); ++i ){
+ kdDebug(9000) << "------> arg " << args->arg(i) << endl;
+ }
+
+ bool openProject = false;
+ if( args->count() == 0 ){
+ ProjectManager::getInstance()->loadDefaultProject();
+ openProject = true;
+ } else if( args->count() > 0 ){
+ KURL url = args->url( 0 );
+ QString ext = QFileInfo( url.fileName() ).extension();
+ if( ext == "kdevelop" ){
+ ProjectManager::getInstance()->loadProject( url );
+ openProject = true;
+ }
+ }
+
+ if( !openProject ){
+ for( int a=0; a<args->count(); ++a ){
+ PartController::getInstance()->editDocument( KURL(args->url(a)) );
+ }
+ }
+
+ kapp->dcopClient()->registerAs("kdevelop");
+
+ int ret = app.exec();
+
+ ProjectManager::getInstance()->closeProject( true ); // exiting
+ delete ProjectManager::getInstance();
+
+ delete PluginController::getInstance();
+ if (TopLevel::mainWindowValid())
+ delete TopLevel::getInstance();
+
+ return ret;
+}
diff --git a/src/main_assistant.cpp b/src/main_assistant.cpp
new file mode 100644
index 00000000..0eb80192
--- /dev/null
+++ b/src/main_assistant.cpp
@@ -0,0 +1,115 @@
+#include <config.h>
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kstandarddirs.h>
+#include <kdebug.h>
+#include <dcopclient.h>
+
+#include <qfileinfo.h>
+
+#include "splashscreen.h"
+#include "toplevel.h"
+#include "plugincontroller.h"
+#include "partcontroller.h"
+#include "core.h"
+#include "projectmanager.h"
+
+#include "kdevassistantextension.h"
+
+static KCmdLineOptions options[] =
+{
+ { "profile <profile>", I18N_NOOP("Profile to load"), 0 },
+/* { "+file(s)", I18N_NOOP("Files to load"), 0 },*/
+ { 0,0,0 }
+};
+
+int main(int argc, char *argv[])
+{
+ static const char description[] = I18N_NOOP("The KDevelop Integrated Development Environment:\nassistant and documentation viewer");
+ KAboutData aboutData("kdevassistant", I18N_NOOP("KDevelop Assistant"),
+ VERSION, description, KAboutData::License_GPL,
+ I18N_NOOP("(c) 1999-2007, The KDevelop developers"), "", "http://www.kdevelop.org");
+ aboutData.addAuthor("Alexander Dymo", I18N_NOOP("Release coordinator, Overall improvements, Pascal support, C++ support, New File and Documentation parts"), "adymo@kdevelop.org");
+ aboutData.addAuthor("Amilcar do Carmo Lucas", I18N_NOOP("Release coordinator, API documentation, Doxygen and autoproject patches"), "amilcar@ida.ing.tu-bs.de");
+ aboutData.addAuthor("Bernd Gehrmann", I18N_NOOP("Initial idea, basic architecture, much initial source code"), "bernd@kdevelop.org");
+ aboutData.addAuthor("Caleb Tennis", I18N_NOOP("KTabBar, bugfixes"), "caleb@aei-tech.com");
+ aboutData.addAuthor("Richard Dale", I18N_NOOP("Java & Objective C support"), "Richard_Dale@tipitina.demon.co.uk");
+ aboutData.addAuthor("John Birch", I18N_NOOP("Debugger frontend"), "jbb@kdevelop.org");
+ aboutData.addAuthor("Sandy Meier", I18N_NOOP("PHP support, context menu stuff"), "smeier@kdevelop.org");
+ aboutData.addAuthor("Kurt Granroth", I18N_NOOP("KDE application templates"), "kurth@granroth.org");
+ aboutData.addAuthor("Ian Reinhart Geiser", I18N_NOOP("Dist part, bash support, application templates"), "geiseri@yahoo.com");
+ aboutData.addAuthor("Matthias Hoelzer-Kluepfel", I18N_NOOP("Several components, htdig indexing"), "hoelzer@kde.org");
+ aboutData.addAuthor("Victor Roeder", I18N_NOOP("Help with Automake manager and persistent class store"), "victor_roeder@gmx.de");
+ aboutData.addAuthor("Harald Fernengel", I18N_NOOP("Ported to Qt 3, patches, valgrind, diff and perforce support"), "harry@kdevelop.org");
+ aboutData.addAuthor("Roberto Raggi", I18N_NOOP("QEditor component, code completion, Abbrev component, C++ support, Java support"), "roberto@kdevelop.org");
+ aboutData.addAuthor("Simon Hausmann", I18N_NOOP("Help with KParts infrastructure"), "hausmann@kde.org");
+ aboutData.addAuthor("Oliver Kellogg", I18N_NOOP("Ada support"), "okellogg@users.sourceforge.net");
+ aboutData.addAuthor("Jakob Simon-Gaarde", I18N_NOOP("QMake projectmanager"), "jsgaarde@tdcspace.dk");
+ aboutData.addAuthor("F@lk Brettschneider", I18N_NOOP("MDI modes, QEditor, bugfixes"), "falkbr@kdevelop.org");
+ aboutData.addAuthor("Mario Scalas", I18N_NOOP("PartExplorer, redesign of CvsPart, patches, bugs(fixes)"), "mario.scalas@libero.it");
+ aboutData.addAuthor("Jens Dagerbo", I18N_NOOP("Replace, Bookmarks, FileList and CTags2 plugins. Overall improvements and patches"), "jens.dagerbo@swipnet.se");
+ aboutData.addAuthor("Julian Rockey", I18N_NOOP("Filecreate part and other bits and patches"), "linux@jrockey.com");
+ aboutData.addCredit("Ajay Guleria", I18N_NOOP("ClearCase support"), "ajay_guleria@yahoo.com");
+ aboutData.addCredit("Marek Janukowicz", I18N_NOOP("Ruby support"), "child@t17.ds.pwr.wroc.pl");
+
+ aboutData.addCredit("The KWrite authors", I18N_NOOP("Kate editor component"), "kwrite-devel@kde.org");
+ aboutData.addCredit("The KHTML authors", I18N_NOOP("HTML documentation component"), "kfm-devel@kde.org");
+ aboutData.addCredit("Robert Moniot", I18N_NOOP("Fortran documentation"), "moniot@fordham.edu");
+ aboutData.addCredit("Ka-Ping Yee", I18N_NOOP("Python documentation utility"), "ping@lfw.org");
+ aboutData.addCredit("Dimitri van Heesch", I18N_NOOP("Doxygen wizard"), "dimitri@stack.nl");
+ aboutData.addCredit("Hugo Varotto", I18N_NOOP("Fileselector component"), "hugo@varotto-usa.com");
+ aboutData.addCredit("Matt Newell", I18N_NOOP("Fileselector component"), "newellm@proaxis.com");
+ aboutData.addCredit("Trolltech AS", I18N_NOOP("Designer code"), "info@trolltech.com");
+ aboutData.addCredit("Daniel Engelschalt", I18N_NOOP("C++ code completion, persistent class store"), "daniel.engelschalt@gmx.net");
+ aboutData.addCredit("Stephane ANCELOT", I18N_NOOP("Patches"), "sancelot@free.fr");
+ aboutData.addCredit("Jens Zurheide", I18N_NOOP("Patches"), "jens.zurheide@gmx.de");
+ aboutData.addCredit("Luc Willems", I18N_NOOP("Help with Perl support"), "Willems.luc@pandora.be");
+ aboutData.addCredit("Marcel Turino", I18N_NOOP("Documentation index view"), "M.Turino@gmx.de");
+ aboutData.addCredit("Yann Hodique", I18N_NOOP("Patches"), "Yann.Hodique@lifl.fr");
+ aboutData.addCredit("Tobias Gl\303\244\303\237er" , I18N_NOOP("Documentation Finder, qmake projectmanager patches, usability improvements, bugfixes ... "), "tobi.web@gmx.de");
+ aboutData.addCredit("Andreas Koepfle" , I18N_NOOP("QMake project manager patches"), "koepfle@ti.uni-mannheim.de");
+ aboutData.addCredit("Sascha Cunz" , I18N_NOOP("Cleanup and bugfixes for qEditor, AutoMake and much other stuff"), "mail@sacu.de");
+
+ KCmdLineArgs::init(argc, argv, &aboutData);
+ KCmdLineArgs::addCmdLineOptions( options );
+// KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+
+ KApplication app;
+
+ KDevAssistantExtension::init();
+
+ KDevSplashScreen *splash = 0;
+ QString splashFile = locate("data", "kdevelop/pics/kdevassistant-splash.png");
+ if (!splashFile.isEmpty())
+ {
+ QPixmap pm;
+ pm.load(splashFile);
+ splash = new KDevSplashScreen( pm );
+ }
+ if (splash) splash->show();
+
+ app.processEvents();
+
+ QObject::connect(PluginController::getInstance(), SIGNAL(loadingPlugin(const QString &)),
+ splash, SLOT(showMessage(const QString &)));
+
+ if (splash) splash->message( i18n( "Loading Settings" ) );
+ TopLevel::getInstance()->loadSettings();
+
+ PluginController::getInstance()->loadInitialPlugins();
+
+ if (splash) splash->message( i18n( "Starting GUI" ) );
+ TopLevel::getInstance()->main()->show();
+
+ Core::getInstance()->doEmitCoreInitialized();
+
+ if (splash) delete splash;
+
+ kapp->dcopClient()->registerAs("kdevassistant");
+
+ return app.exec();
+}
diff --git a/src/mainwindowshare.cpp b/src/mainwindowshare.cpp
new file mode 100644
index 00000000..4dcb17c9
--- /dev/null
+++ b/src/mainwindowshare.cpp
@@ -0,0 +1,451 @@
+/***************************************************************************
+ mainwindowshare.cpp - shared stuff of the main widgets
+ -------------------
+ begin : 19 Dec 2002
+ copyright : (C) 2002 by Falk Brettschneider
+ email : falk@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qcheckbox.h>
+#include <qvbox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+#include <qdir.h>
+#include <qregexp.h>
+
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kaboutdata.h>
+#include <kstdaction.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kstatusbar.h>
+#include <kparts/mainwindow.h>
+#include <kdialogbase.h>
+#include <kconfig.h>
+#include <kkeydialog.h>
+#include <kmenubar.h>
+#include <kedittoolbar.h>
+#include <kbugreport.h>
+#include <kurlrequester.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+
+#include <ktexteditor/document.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/configinterface.h>
+#include <kparts/partmanager.h>
+#include <kdeversion.h>
+#include <kdebug.h>
+#include <knotifydialog.h>
+
+
+#include <config.h>
+
+#include "partcontroller.h"
+#include "projectmanager.h"
+#include "core.h"
+#include "api.h"
+#include "kdevmakefrontend.h"
+#include "toplevel.h"
+#include "plugincontroller.h"
+
+#include "kdevplugininfo.h"
+
+#include "mainwindowshare.h"
+
+#include "shellextension.h"
+
+using namespace MainWindowUtils;
+
+MainWindowShare::MainWindowShare(QObject* pParent, const char* name)
+ :QObject(pParent, name)
+ ,m_toggleMainToolbar(0L)
+ ,m_toggleBuildToolbar(0L)
+ ,m_toggleViewToolbar(0L)
+ ,m_toggleBrowserToolbar(0L)
+ ,m_toggleStatusbar(0L)
+ ,m_stopProcesses(0L)
+{
+ m_pMainWnd = (KParts::MainWindow*)pParent;
+}
+
+void MainWindowShare::init()
+{
+ connect(Core::getInstance(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+
+ connect( m_pMainWnd->actionCollection(), SIGNAL( actionStatusText( const QString & ) ),
+ this, SLOT( slotActionStatusText( const QString & ) ) );
+}
+
+void MainWindowShare::slotActionStatusText( const QString &text )
+{
+// kdDebug(9000) << "MainWindowShare::slotActionStatusText() - " << text << endl;
+
+ if ( ! m_pMainWnd ) return;
+
+ KStatusBar * statusBar = m_pMainWnd->statusBar();
+
+ if ( ! statusBar ) return;
+
+ statusBar->message( text );
+}
+
+void MainWindowShare::createActions()
+{
+ ProjectManager::getInstance()->createActions( m_pMainWnd->actionCollection() );
+
+ KStdAction::quit(this->parent(), SLOT(close()), m_pMainWnd->actionCollection());
+
+ KAction* action;
+
+ m_stopProcesses = new KToolBarPopupAction( i18n( "&Stop" ), "stop",
+ Key_Escape, this, SLOT(slotStopButtonPressed()),
+ m_pMainWnd->actionCollection(), "stop_processes" );
+ m_stopProcesses->setToolTip(i18n("Stop"));
+ m_stopProcesses->setWhatsThis(i18n("<b>Stop</b><p>Stops all running processes (like building process, grep command, etc.). When placed onto a toolbar provides a popup menu to choose a process to stop."));
+ m_stopProcesses->setEnabled( false );
+ connect(m_stopProcesses->popupMenu(), SIGNAL(aboutToShow()),
+ this, SLOT(slotStopMenuAboutToShow()));
+ connect(m_stopProcesses->popupMenu(), SIGNAL(activated(int)),
+ this, SLOT(slotStopPopupActivated(int)));
+
+ connect( Core::getInstance(), SIGNAL(activeProcessChanged(KDevPlugin*, bool)),
+ this, SLOT(slotActiveProcessChanged(KDevPlugin*, bool)) );
+
+ action = KStdAction::showMenubar(
+ this, SLOT(slotShowMenuBar()),
+ m_pMainWnd->actionCollection(), "settings_show_menubar" );
+ action->setToolTip(beautifyToolTip(action->text()));
+ action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you switch the menubar on/off.")));
+
+ action = KStdAction::keyBindings(
+ this, SLOT(slotKeyBindings()),
+ m_pMainWnd->actionCollection(), "settings_configure_shortcuts" );
+ action->setToolTip(beautifyToolTip(action->text()));
+ action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure shortcut keys.")));
+
+ action = KStdAction::configureToolbars(
+ this, SLOT(slotConfigureToolbars()),
+ m_pMainWnd->actionCollection(), "settings_configure_toolbars" );
+ action->setToolTip(beautifyToolTip(action->text()));
+ action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure toolbars.")));
+
+ action = KStdAction::configureNotifications(
+ this, SLOT(slotConfigureNotifications()),
+ m_pMainWnd->actionCollection(), "settings_configure_notifications" );
+ action->setToolTip(beautifyToolTip(action->text()));
+ action->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(action->text())).arg(i18n("Lets you configure system notifications.")));
+
+ action = KStdAction::preferences(this, SLOT(slotSettings()),
+ m_pMainWnd->actionCollection(), "settings_configure" );
+ action->setToolTip( i18n( "Configure KDevelop" ) );
+ action->setWhatsThis(QString("<b>%1</b><p>%2").arg(i18n( "Configure KDevelop" )).arg(i18n("Lets you customize KDevelop.")));
+
+ m_toggleStatusbar = KStdAction::showToolbar(this, SLOT(slotToggleStatusbar()),m_pMainWnd->actionCollection(), "settings_statusbar");
+ m_toggleStatusbar->setText(i18n("Show &Statusbar"));
+ m_toggleStatusbar->setToolTip( i18n("Show statusbar") );
+ m_toggleStatusbar->setWhatsThis(i18n("<b>Show statusbar</b><p>Hides or shows the statusbar."));
+
+ action = new KAction( i18n("&Next Window"), ALT+Key_Right, this, SIGNAL(gotoNextWindow()),m_pMainWnd->actionCollection(), "view_next_window");
+ action->setToolTip( i18n("Next window") );
+ action->setWhatsThis(i18n("<b>Next window</b><p>Switches to the next window."));
+
+ action = new KAction( i18n("&Previous Window"), ALT+Key_Left, this, SIGNAL(gotoPreviousWindow()),m_pMainWnd->actionCollection(), "view_previous_window");
+ action->setToolTip( i18n("Previous window") );
+ action->setWhatsThis(i18n("<b>Previous window</b><p>Switches to the previous window."));
+
+ action = new KAction( i18n("&Last Accessed Window"), ALT+Key_Up, this, SIGNAL(gotoLastWindow()), m_pMainWnd->actionCollection(), "view_last_window");
+ action->setToolTip( i18n("Last accessed window") );
+ action->setWhatsThis(i18n("<b>Last accessed window</b><p>Switches to the last viewed window (Hold the Alt key pressed and walk on by repeating the Up key)."));
+
+ action = new KAction( i18n("&First Accessed Window"), ALT+Key_Down, this, SIGNAL(gotoFirstWindow()), m_pMainWnd->actionCollection(), "view_first_window");
+ action->setToolTip( i18n("First accessed window") );
+ action->setWhatsThis(i18n("<b>First accessed window</b><p>Switches to the first accessed window (Hold the Alt key pressed and walk on by repeating the Down key)."));
+
+ action = new KAction( i18n("Configure Plugins..."), SmallIconSet("configure"), 0, PluginController::getInstance(), SLOT(selectPlugins()), m_pMainWnd->actionCollection(), "settings_configure_plugins" );
+
+ m_configureEditorAction = new KAction( i18n("Configure &Editor..."), SmallIconSet("configure"), 0, this, SLOT( slotConfigureEditors() ), m_pMainWnd->actionCollection(), "settings_configure_editors");
+ m_configureEditorAction->setToolTip( i18n("Configure editor settings") );
+ m_configureEditorAction->setWhatsThis(i18n("<b>Configure editor</b><p>Opens editor configuration dialog."));
+ m_configureEditorAction->setEnabled( false );
+
+ KDevPartController * partController = API::getInstance()->partController();
+ connect( partController, SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part* )) );
+}
+
+void MainWindowShare::slotReportBug()
+{
+ KBugReport a(m_pMainWnd, true, KGlobal::instance()->aboutData() );
+ a.exec();
+}
+
+void MainWindowShare::slotToggleMainToolbar()
+{
+ if (m_toggleMainToolbar->isChecked())
+ m_pMainWnd->toolBar("mainToolBar")->show();
+ else
+ m_pMainWnd->toolBar("mainToolBar")->hide();
+}
+
+void MainWindowShare::slotToggleBuildToolbar()
+{
+ if (m_toggleBuildToolbar->isChecked())
+ m_pMainWnd->toolBar("buildToolBar")->show();
+ else
+ m_pMainWnd->toolBar("buildToolBar")->hide();
+}
+
+void MainWindowShare::slotToggleViewToolbar()
+{
+ if (m_toggleViewToolbar->isChecked())
+ m_pMainWnd->toolBar("viewToolBar")->show();
+ else
+ m_pMainWnd->toolBar("viewToolBar")->hide();
+}
+
+void MainWindowShare::slotToggleBrowserToolbar()
+{
+ if (m_toggleBrowserToolbar->isChecked())
+ m_pMainWnd->toolBar("browserToolBar")->show();
+ else
+ m_pMainWnd->toolBar("browserToolBar")->hide();
+}
+
+void MainWindowShare::slotToggleStatusbar()
+{
+ KStatusBar* sb = (KStatusBar*) m_pMainWnd->statusBar();
+ if (m_toggleStatusbar->isChecked())
+ sb->show();
+ else
+ sb->hide();
+}
+
+void MainWindowShare::slotStopButtonPressed()
+{
+ Core::getInstance()->doEmitStopButtonPressed();
+}
+
+void MainWindowShare::slotActiveProcessChanged( KDevPlugin* plugin, bool active )
+{
+ if ( !plugin )
+ return;
+
+ if ( active ) {
+ activeProcesses.append( plugin );
+ } else {
+ activeProcesses.removeRef( plugin );
+ }
+ m_stopProcesses->setEnabled( !activeProcesses.isEmpty() );
+}
+
+void MainWindowShare::slotStopPopupActivated( int id )
+{
+ KDevPlugin* plugin = activeProcesses.at( id );
+ if ( plugin && plugin->info()->genericName() == m_stopProcesses->popupMenu()->text( id ) ) {
+ Core::getInstance()->doEmitStopButtonPressed( plugin );
+ return;
+ } else {
+ // oops... list has changed in the meantime
+ QString str = m_stopProcesses->popupMenu()->text( id );
+ for ( plugin = activeProcesses.first(); plugin; plugin = activeProcesses.next() ) {
+ if ( plugin->info()->genericName() == str ) {
+ Core::getInstance()->doEmitStopButtonPressed( plugin );
+ return;
+ }
+ }
+ }
+}
+
+void MainWindowShare::slotStopMenuAboutToShow()
+{
+ QPopupMenu* popup = m_stopProcesses->popupMenu();
+ popup->clear();
+
+ int i = 0;
+ for ( KDevPlugin* plugin = activeProcesses.first(); plugin; plugin = activeProcesses.next() ) {
+ popup->insertItem( plugin->info()->genericName(), i++ );
+ }
+}
+
+void MainWindowShare::slotShowMenuBar()
+{
+ if (m_pMainWnd->menuBar()->isVisible()) {
+ m_pMainWnd->menuBar()->hide();
+ } else {
+ m_pMainWnd->menuBar()->show();
+ }
+ m_pMainWnd->saveMainWindowSettings( KGlobal::config(), "Mainwindow" );
+}
+
+void MainWindowShare::slotConfigureNotifications()
+{
+ KNotifyDialog::configure(m_pMainWnd, "Notification Configuration Dialog");
+}
+
+void MainWindowShare::slotSettings()
+{
+ KDialogBase dlg(KDialogBase::IconList, i18n("Configure KDevelop"),
+ KDialogBase::Help|KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, m_pMainWnd,
+ "customization dialog");
+ dlg.setHelp("setup");
+
+ ShellExtension::getInstance()->createGlobalSettingsPage(&dlg);
+
+ KConfig* config = kapp->config();
+
+ config->setGroup("Global Settings Dialog");
+ int height = config->readNumEntry( "Height", 600 );
+ int width = config->readNumEntry( "Width", 800 );
+
+ dlg.resize( width, height );
+
+ Core::getInstance()->doEmitConfigWidget(&dlg);
+ dlg.exec();
+
+ config->setGroup("Global Settings Dialog");
+ config->writeEntry( "Height", dlg.size().height() );
+ config->writeEntry( "Width", dlg.size().width() );
+
+ if ( dlg.result() != QDialog::Rejected )
+ ShellExtension::getInstance()->acceptGlobalSettingsPage(&dlg);
+}
+
+void MainWindowShare::slotConfigureEditors()
+{
+ kdDebug(9000) << " *** MainWindowShare::slotConfigureEditors()" << endl;
+
+ KDevPartController * partController = API::getInstance()->partController();
+ KParts::Part * part = partController->activePart();
+
+ KTextEditor::ConfigInterface * conf = dynamic_cast<KTextEditor::ConfigInterface*>( part );
+ if ( ! conf )
+ {
+ kdDebug(9000) << "*** No KTextEditor::ConfigInterface for part!" << endl;
+ return;
+ }
+
+ // show the modal config dialog for this part if it has a ConfigInterface
+ conf->configDialog();
+ conf->writeConfig();
+
+}
+
+void MainWindowShare::slotGUICreated( KParts::Part * part )
+{
+// kdDebug(9000) << "MainWindowShare::slotGUICreated()" << endl;
+
+ if ( ! part ) return;
+
+ // disable configuration entry if created part is not an editor
+ if ( ! dynamic_cast<KTextEditor::ConfigInterface *>( part ) )
+ {
+ m_configureEditorAction->setEnabled( false );
+ return;
+ }
+
+ m_configureEditorAction->setEnabled( true );
+
+ // remove the part's merged menu entry
+ KAction * action = part->action("set_confdlg"); // name from katepartui.rc
+ if ( action )
+ {
+ kdDebug(9000) << " *** found \"set_confdlg\" action - unplugging" << endl;
+ action->unplugAll();
+ }
+
+ if ( KAction * action = part->action("file_save") )
+ {
+ kdDebug(9000) << " *** found \"file_save\" action - disconnecting" << endl;
+ disconnect( action, SIGNAL(activated()), 0, 0 );
+ connect( action, SIGNAL(activated()), PartController::getInstance(), SLOT(slotSave()) );
+ }
+
+ if ( KAction * action = part->action("file_reload") )
+ {
+ kdDebug(9000) << " *** found \"file_reload\" action - disconnecting" << endl;
+ disconnect( action, SIGNAL(activated()), 0, 0 );
+ connect( action, SIGNAL(activated()), PartController::getInstance(), SLOT(slotReload()) );
+ }
+}
+
+// called when OK ar Apply is clicked in the EditToolbar Dialog
+void MainWindowShare::slotNewToolbarConfig()
+{
+ // replug actionlists here...
+
+ m_pMainWnd->applyMainWindowSettings( KGlobal::config(), "Mainwindow" );
+
+// PartController::getInstance()->reinstallPopups();
+}
+
+void MainWindowShare::slotKeyBindings()
+{
+ KKeyDialog dlg( false, m_pMainWnd );
+ QPtrList<KXMLGUIClient> clients = m_pMainWnd->guiFactory()->clients();
+ for( QPtrListIterator<KXMLGUIClient> it( clients );
+ it.current(); ++it ) {
+ dlg.insert( (*it)->actionCollection() );
+ }
+ if ( dlg.configure() == KKeyDialog::Accepted )
+ {
+ // this is needed for when we have multiple embedded kateparts and change one of them.
+ // it also needs to be done to their views, as they too have actioncollections to update
+ if( const QPtrList<KParts::Part> * partlist = PartController::getInstance()->parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part* part = it.current() )
+ {
+ if ( KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( part ) )
+ {
+ doc->reloadXML();
+
+ QPtrList<KTextEditor::View> const & list = doc->views();
+ QPtrListIterator<KTextEditor::View> itt( list );
+ while( KTextEditor::View * view = itt.current() )
+ {
+ view->reloadXML();
+ ++itt;
+ }
+ }
+ ++it;
+ }
+ }
+ Core::setupShourtcutTips();
+ }
+}
+
+void MainWindowShare::slotConfigureToolbars()
+{
+ m_pMainWnd->saveMainWindowSettings( KGlobal::config(), "Mainwindow" );
+ KEditToolbar dlg( m_pMainWnd->factory() );
+ connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig()));
+ dlg.exec();
+}
+
+void MainWindowShare::contextMenu(QPopupMenu* popup, const Context *)
+{
+ if ( m_pMainWnd->menuBar()->isVisible() )
+ return;
+
+ int id = popup->insertItem( i18n("Show &Menubar"), m_pMainWnd->menuBar(), SLOT(show()) );
+ popup->setWhatsThis(id, i18n("<b>Show menubar</b><p>Lets you switch the menubar on/off."));
+}
+
+void MainWindowShare::slotActivePartChanged( KParts::Part * part )
+{
+ m_configureEditorAction->setEnabled( part && dynamic_cast<KTextEditor::Document*>(part) );
+}
+
+#include "mainwindowshare.moc"
+//kate: space-indent on; indent-width 4;
diff --git a/src/mainwindowshare.h b/src/mainwindowshare.h
new file mode 100644
index 00000000..6fba07a3
--- /dev/null
+++ b/src/mainwindowshare.h
@@ -0,0 +1,88 @@
+/***************************************************************************
+ mainwindowshare.h - shared stuff of the main widgets
+ -------------------
+ begin : 19 Dec 2002
+ copyright : (C) 2002 by Falk Brettschneider
+ email : falk@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef __MAINWINDOWSHARE_H__
+#define __MAINWINDOWSHARE_H__
+
+#include <qobject.h>
+
+class KAction;
+class KToggleAction;
+namespace KParts {
+ class MainWindow;
+}
+/**
+Shared main window functionality.
+*/
+class MainWindowShare : public QObject
+{
+ Q_OBJECT
+public:
+ MainWindowShare(QObject* pParent = 0L, const char* name = 0L);
+ ~MainWindowShare() {}
+
+ void createActions();
+ void init();
+
+public slots:
+ void slotGUICreated( KParts::Part * );
+
+signals:
+ void gotoNextWindow();
+ void gotoPreviousWindow();
+ void gotoFirstWindow();
+ void gotoLastWindow();
+
+private slots:
+ void slotReportBug();
+ void slotKeyBindings();
+ void slotConfigureToolbars();
+ void slotConfigureNotifications();
+ void slotConfigureEditors();
+ void slotSettings();
+ void slotActiveProcessChanged( KDevPlugin*, bool );
+ void slotActivePartChanged( KParts::Part* part );
+ void slotStopPopupActivated(int);
+ void slotStopMenuAboutToShow();
+ void slotStopButtonPressed();
+ void slotNewToolbarConfig();
+ void slotShowMenuBar();
+ void slotActionStatusText( const QString &text );
+
+ void slotToggleMainToolbar();
+ void slotToggleBuildToolbar();
+ void slotToggleViewToolbar();
+ void slotToggleBrowserToolbar();
+ void slotToggleStatusbar();
+
+ void contextMenu(QPopupMenu *, const Context *);
+
+private:
+ KToggleAction* m_toggleMainToolbar;
+ KToggleAction* m_toggleBuildToolbar;
+ KToggleAction* m_toggleViewToolbar;
+ KToggleAction* m_toggleBrowserToolbar;
+ KToggleAction* m_toggleStatusbar;
+
+ KAction * m_configureEditorAction;
+
+ KToolBarPopupAction* m_stopProcesses; //!< Stops all running processes
+
+ KParts::MainWindow* m_pMainWnd;
+ QPtrList<KDevPlugin> activeProcesses;
+};
+
+#endif // __MAINWINDOWSHARE_H__
diff --git a/src/mimewarningdialog.ui b/src/mimewarningdialog.ui
new file mode 100644
index 00000000..21fdbee4
--- /dev/null
+++ b/src/mimewarningdialog.ui
@@ -0,0 +1,254 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MimeWarningDialog</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>MimeWarningDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>404</width>
+ <height>248</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Could Not Open File</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>text1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>KDevelop could not open</string>
+ </property>
+ </widget>
+ <widget class="KSqueezedTextLabel">
+ <property name="name">
+ <cstring>text2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Some URL</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>text3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;No suitable viewer was found for the &lt;b&gt;%1&lt;/b&gt; mimetype.&lt;/qt&gt;</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="title">
+ <string>What Do You Want to Do?</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>open_with_kde</cstring>
+ </property>
+ <property name="text">
+ <string>Let KDE find a suitable program</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>open_as_text</cstring>
+ </property>
+ <property name="text">
+ <string>Open it in KDevelop as plain text</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>24</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>always_open_as_text</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Always open this mimetype as text</string>
+ </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>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>101</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>open_with_kde</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>always_open_as_text</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>open_as_text</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>always_open_as_text</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>pushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>MimeWarningDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>MimeWarningDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/multibuffer.cpp b/src/multibuffer.cpp
new file mode 100644
index 00000000..cdbffe85
--- /dev/null
+++ b/src/multibuffer.cpp
@@ -0,0 +1,303 @@
+/*
+ * KDevelop Multiple Buffer Support
+ *
+ * Copyright (c) 2005 Adam Treat <treat@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+// Ewww... need this to access KParts::Part::setWidget(), so that kdevelop
+// doesn't need to be rearchitected for multiple views before the lazy view
+// creation can go in
+#define protected public
+#include <kparts/part.h>
+#undef protected
+
+#include "multibuffer.h"
+
+#include "api.h"
+#include "toplevel.h"
+#include "editorproxy.h"
+#include "partcontroller.h"
+#include "kdevlanguagesupport.h"
+
+#include <kdebug.h>
+#include <kmimetype.h>
+#include <kmainwindow.h>
+#include <kapplication.h>
+
+#include <kparts/factory.h>
+
+#include <ktexteditor/view.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+
+MultiBuffer::MultiBuffer( QWidget *parent )
+ : QSplitter( parent, "MultiBuffer" ),
+ m_editorFactory( 0 ),
+ m_delayActivate( false ),
+ m_activated( false ),
+ m_activeBuffer( 0 )
+{
+ EditorProxy::getInstance() ->registerEditor( this );
+ if ( KDevLanguageSupport *lang =
+ API::getInstance() ->languageSupport() )
+ {
+ setOrientation( lang->splitOrientation() );
+ connect( lang, SIGNAL( splitOrientationChanged( Qt::Orientation ) ),
+ this, SLOT( setOrientation( Qt::Orientation ) ) );
+ }
+ else
+ {
+ setOrientation( Qt::Vertical );
+ }
+}
+
+MultiBuffer::~MultiBuffer()
+{
+ EditorProxy::getInstance() ->deregisterEditor( this );
+}
+
+KParts::Part *MultiBuffer::activeBuffer( ) const
+{
+ if ( m_activeBuffer )
+ return m_activeBuffer;
+ // The active buffer might just been deleted...
+ else if ( m_buffers.begin().data() )
+ return ( m_buffers.begin().data() );
+ else
+ return 0;
+}
+
+bool MultiBuffer::hasURL( const KURL &url ) const
+{
+ return m_buffers.contains( url );
+}
+
+int MultiBuffer::numberOfBuffers() const
+{
+ return m_buffers.count();
+}
+
+bool MultiBuffer::isActivated() const
+{
+ if ( m_delayActivate )
+ return m_activated;
+ else
+ return true;
+}
+
+void MultiBuffer::setDelayedActivation( bool delayed )
+{
+ m_delayActivate = delayed;
+ if ( delayed )
+ m_activated = false;
+}
+
+KParts::Part* MultiBuffer::openURL( const KURL &url )
+{
+ KParts::ReadOnlyPart * part =
+ dynamic_cast<KParts::ReadOnlyPart*>( createPart( url ) );
+
+ if ( !part )
+ return 0;
+
+ if ( !part->openURL( url ) )
+ return 0;
+
+ m_buffers.insert( url, part );
+ return part;
+}
+
+bool MultiBuffer::closeURL( const KURL &url )
+{
+ if ( !m_buffers.contains( url ) )
+ return false;
+
+ bool result = false;
+ KParts::ReadOnlyPart * part =
+ dynamic_cast<KParts::ReadOnlyPart *>( m_buffers[ url ] );
+ if ( part )
+ if (part->closeURL())
+ {
+ m_buffers.remove( url );
+ return true;
+ }
+ return false;
+}
+
+void MultiBuffer::registerURL( const KURL &url, KParts::Part *part )
+{
+ m_buffers.insert( url, part );
+}
+
+void MultiBuffer::registerDelayedActivation( KParts::Part *part,
+ int line, int col )
+{
+ m_delayedActivation[ part ] = qMakePair( line, col );
+}
+
+KParts::Part* MultiBuffer::createPart( const QString &mimeType,
+ const QString &partType,
+ const QString &className,
+ const QString &preferredName )
+{
+ m_editorFactory = PartController::getInstance() ->findPartFactory(
+ mimeType, partType, preferredName );
+
+ if ( !className.isEmpty() && m_editorFactory )
+ {
+ return m_editorFactory->createPart(
+ this, 0, 0, 0, className.latin1() );
+ }
+
+ return 0;
+}
+
+KParts::Part* MultiBuffer::createPart( const KURL &url )
+{
+ if ( !url.isValid() )
+ return 0;
+
+ KMimeType::Ptr mimeType = KMimeType::findByURL( url );
+
+ QString className;
+ QString services[] = { "KParts/ReadWritePart", "KParts/ReadOnlyPart" };
+ QString classnames[] = { "KParts::ReadWritePart", "KParts::ReadOnlyPart" };
+ for ( uint i = 0; i < 2; ++i )
+ {
+ m_editorFactory = PartController::getInstance() ->findPartFactory(
+ mimeType->name(), services[ i ] );
+ if ( m_editorFactory )
+ {
+ className = classnames[ i ];
+ break;
+ }
+ }
+
+ if ( !className.isEmpty() && m_editorFactory )
+ {
+ return m_editorFactory->createPart(
+ this, 0, 0, 0, className.latin1() );
+ }
+
+ return 0;
+}
+
+void MultiBuffer::show()
+{
+ if ( !m_delayedActivation.count() || m_activated )
+ {
+ QSplitter::show();
+ return ;
+ }
+
+ ActivationMap::Iterator it = m_delayedActivation.begin();
+ for ( ; it != m_delayedActivation.end(); ++it )
+ {
+ KTextEditor::Document *document =
+ dynamic_cast<KTextEditor::Document*>( it.key() );
+
+ if ( !document )
+ continue;
+
+ int line = it.data().first;
+ int column = it.data().second;
+ KTextEditor::View *view = document->createView( this );
+ document->setWidget( view );
+
+ // We're managing the view deletion by being its parent,
+ // don't let the part self-destruct
+ disconnect( view, SIGNAL( destroyed() ),
+ document, SLOT( slotWidgetDestroyed() ) );
+
+ document->insertChildClient( view );
+ PartController::getInstance() ->integrateTextEditorPart( document );
+
+ KTextEditor::ViewCursorInterface *iface =
+ dynamic_cast<KTextEditor::ViewCursorInterface*>(
+ static_cast<KTextEditor::View*>( view ) );
+ if ( iface )
+ {
+ iface->setCursorPositionReal( line,
+ column == -1 ? 0 : column );
+ }
+ else
+ {
+ // Shouldn't get here
+ Q_ASSERT( false );
+ }
+ view->show();
+ kdDebug( 9000 ) << "Delayed activation of "
+ << document->url().fileName() << " is now complete." << endl;
+ }
+
+ m_activated = true;
+ QSplitter::show();
+}
+
+void MultiBuffer::setOrientation( Qt::Orientation orientation )
+{
+ QSplitter::setOrientation( orientation );
+}
+
+void MultiBuffer::activePartChanged( const KURL &url )
+{
+ if ( !m_buffers.contains( url ) )
+ return ;
+
+ m_activeBuffer = m_buffers[ url ];
+ TopLevel::getInstance() ->setCurrentDocumentCaption( url.fileName() );
+}
+
+void MultiBuffer::focusInEvent( QFocusEvent *ev )
+{
+ KParts::Part *active = activeBuffer();
+ if (active && active->widget())
+ active->widget()->setFocus();
+ QSplitter::focusInEvent(ev);
+}
+
+bool MultiBuffer::hasPart( KParts::Part *part )
+{
+ for (BufferMap::iterator it = m_buffers.begin(); it != m_buffers.end(); ++it)
+ {
+ if (it.data() == part)
+ return true;
+ }
+ return false;
+}
+
+void MultiBuffer::updateUrlForPart(KParts::Part *part, KURL url)
+{
+ if (!url.isValid())
+ return;
+ KURL formerURL;
+ for (BufferMap::iterator it = m_buffers.begin(); it != m_buffers.end(); ++it)
+ {
+ if (it.data() == part)
+ {
+ formerURL = it.key();
+ break;
+ }
+ }
+ m_buffers.remove(formerURL);
+ m_buffers.insert(url, part);
+}
+
+#include "multibuffer.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/src/multibuffer.h b/src/multibuffer.h
new file mode 100644
index 00000000..3d04f256
--- /dev/null
+++ b/src/multibuffer.h
@@ -0,0 +1,89 @@
+/*
+ * KDevelop Multiple Buffer Support
+ *
+ * Copyright (c) 2005 Adam Treat <treat@kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#ifndef MULTIBUFFER_H
+#define MULTIBUFFER_H
+
+#include <qpair.h>
+#include <qsplitter.h>
+#include <qguardedptr.h>
+
+namespace KParts
+{
+class Part;
+class Factory;
+class ReadOnlyPart;
+}
+
+class KURL;
+
+typedef QMap< KURL, KParts::Part* > BufferMap;
+typedef QMap< KParts::Part*, QPair<int, int> > ActivationMap;
+
+class MultiBuffer : public QSplitter
+{
+ Q_OBJECT
+public:
+ MultiBuffer( QWidget * parent = 0 );
+ virtual ~MultiBuffer();
+
+ KParts::Part *activeBuffer() const;
+ bool hasURL( const KURL &url ) const;
+ bool hasPart( KParts::Part *part );
+ int numberOfBuffers() const;
+ bool isActivated() const;
+ void setDelayedActivation( bool delayed );
+
+ KParts::Part* createPart( const QString &mimeType,
+ const QString &partType,
+ const QString &className,
+ const QString &preferredName = QString::null );
+
+ KParts::Part* openURL( const KURL &url );
+ bool closeURL( const KURL &url );
+
+ void registerURL( const KURL &url, KParts::Part *part );
+ void registerDelayedActivation( KParts::Part *part, int line, int col );
+
+ void updateUrlForPart( KParts::Part *part, KURL url );
+
+public slots:
+ virtual void show();
+ virtual void setOrientation( Qt::Orientation );
+ void activePartChanged( const KURL &url );
+
+protected:
+ virtual void focusInEvent( QFocusEvent *ev );
+
+private:
+ KParts::Part* createPart( const KURL &url );
+
+private:
+ BufferMap m_buffers;
+ QGuardedPtr<KParts::Factory> m_editorFactory;
+ ActivationMap m_delayedActivation;
+ bool m_delayActivate;
+ bool m_activated;
+ QGuardedPtr<KParts::Part> m_activeBuffer;
+};
+
+#endif
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/src/newui/Makefile.am b/src/newui/Makefile.am
new file mode 100644
index 00000000..b99b17e4
--- /dev/null
+++ b/src/newui/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external \
+ -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \
+ -I$(top_srcdir)/src/profileengine/lib $(all_includes)
+METASOURCES = AUTO
+
+
+lib_LTLIBRARIES = libd.la
+libd_la_LDFLAGS = $(all_libraries)
+
+noinst_HEADERS = dmainwindow.h ddockwindow.h buttonbar.h button.h comdefs.h docksplitter.h dtabwidget.h
+libd_la_SOURCES = dmainwindow.cpp buttonbar.cpp \
+ button.cpp ddockwindow.cpp docksplitter.cpp dtabwidget.cpp
+libd_la_LIBADD = $(LIB_KPARTS) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
diff --git a/src/newui/button.cpp b/src/newui/button.cpp
new file mode 100644
index 00000000..d2403422
--- /dev/null
+++ b/src/newui/button.cpp
@@ -0,0 +1,350 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "button.h"
+
+#include <qpainter.h>
+#include <qtooltip.h>
+#include <qstyle.h>
+#include <qapplication.h>
+#include <qregexp.h>
+
+#include <kdebug.h>
+#include <kiconloader.h>
+#include <kxmlguiclient.h>
+#include <kaction.h>
+#include <kpopupmenu.h>
+#include <kinputdialog.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+#include "buttonbar.h"
+
+namespace Ideal {
+
+Button::Button(ButtonBar *parent, const QString text, const QIconSet &icon,
+ const QString &description)
+ :QPushButton(icon, text, parent), m_buttonBar(parent), m_description(description),
+ m_place(parent->place()), m_realText(text), m_realIconSet(icon)
+{
+ hide();
+ setFlat(true);
+ setToggleButton(true);
+ setFocusPolicy(NoFocus);
+ setDescription(m_description);
+ setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ resize(sizeHint());
+ fixDimensions(Ideal::Bottom);
+
+ QToolTip::add(this, m_realText);
+
+ m_assignAccelAction = new KAction(i18n("Assign Accelerator..."), 0,
+ this, SLOT(assignAccel()), this);
+ m_clearAccelAction = new KAction(i18n("Clear Accelerator"), 0,
+ this, SLOT(clearAccel()), this);
+
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+ QString accel = config->readEntry(QString("button_%1").arg(text), "");
+ if (!accel.isEmpty())
+ setRealText(QString("&%1 %2").arg(accel).arg(m_realText));
+}
+
+Button::~Button()
+{
+// m_buttonBar->removeButton(this);
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+
+ QRegExp r("^&([0-9])\\s.*");
+ QRegExp r2("^&[0-9]\\s");
+ if (r.search(m_realText) > -1)
+ {
+ QString text = m_realText;
+ if (text.contains(r2))
+ text.remove(r2);
+ config->writeEntry(QString("button_%1").arg(text), r.cap(1));
+ }
+ else
+ {
+ config->writeEntry(QString("button_%1").arg(m_realText), "");
+ }
+}
+
+void Button::setDescription(const QString &description)
+{
+ m_description = description;
+ QToolTip::remove(this);
+ QToolTip::add(this, m_description);
+}
+
+QString Button::description() const
+{
+ return m_description;
+}
+
+void Button::drawButton(QPainter *p)
+{
+ QRect r = rect();
+ QSize sh = r.size();
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ sh.setHeight(r.width());
+ sh.setWidth(r.height());
+ break;
+ }
+
+ QStyle::SFlags flags = QStyle::Style_Default;
+ if (isEnabled())
+ flags |= QStyle::Style_Enabled;
+ if (hasFocus())
+ flags |= QStyle::Style_HasFocus;
+ if (isDown())
+ flags |= QStyle::Style_Down;
+ if (isOn())
+ flags |= QStyle::Style_On;
+ if (! isFlat() && ! isDown())
+ flags |= QStyle::Style_Raised;
+ if (isDefault())
+ flags |= QStyle::Style_ButtonDefault;
+
+ QPixmap pm(sh.width(), sh.height());
+ pm.fill(eraseColor());
+ QPainter p2(&pm);
+
+ style().drawControl(QStyle::CE_PushButton,&p2,this, QRect(0,0,pm.width(),pm.height()), colorGroup(),flags);
+
+ style().drawControl(QStyle::CE_PushButtonLabel, &p2, this,
+ QRect(0,0,pm.width(),pm.height()),
+ colorGroup(), flags, QStyleOption());
+
+ switch (m_place)
+ {
+ case Ideal::Left:
+ p->rotate(-90);
+ p->drawPixmap(1-pm.width(), 0, pm);
+ break;
+ case Ideal::Right:
+ p->rotate(90);
+ p->drawPixmap(0, 1-pm.height(), pm);
+ break;
+ default:
+ p->drawPixmap(0, 0, pm);
+ break;
+ }
+}
+
+void Button::drawButtonLabel(QPainter */*p*/)
+{
+}
+
+ButtonMode Button::mode()
+{
+ return m_buttonBar->mode();
+}
+
+void Button::setPlace(Ideal::Place place)
+{
+ Place oldPlace = m_place;
+ m_place = place;
+ fixDimensions(oldPlace);
+}
+
+void Button::fixDimensions(Place oldPlace)
+{
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ if ((oldPlace == Ideal::Bottom) || (oldPlace == Ideal::Top))
+ {
+ setFixedWidth(height());
+ setMinimumHeight(sizeHint().width());
+ setMaximumHeight(32767);
+ }
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ if ((oldPlace == Ideal::Left) || (oldPlace == Ideal::Right))
+ {
+ setFixedHeight(width());
+ setMinimumWidth(sizeHint().height());
+ setMaximumWidth(32767);
+ }
+ break;
+ }
+}
+
+QSize Button::sizeHint() const
+{
+ return sizeHint(text());
+}
+
+QSize Button::sizeHint(const QString &text) const
+{
+ constPolish();
+ int w = 0, h = 0;
+
+ if ( iconSet() && !iconSet()->isNull() && (m_buttonBar->mode() != Text) ) {
+ 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 );
+ }
+ if ( isMenuButton() )
+ w += style().pixelMetric(QStyle::PM_MenuButtonIndicator, this);
+ if ( pixmap() ) {
+ QPixmap *pm = (QPixmap *)pixmap();
+ w += pm->width();
+ h += pm->height();
+ } else if (m_buttonBar->mode() != Icons) {
+ 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()));
+}
+
+void Button::updateSize()
+{
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ setMinimumHeight(sizeHint().width());
+ resize(sizeHint().height(), sizeHint().width());
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ resize(sizeHint().width(), sizeHint().height());
+ break;
+ }
+}
+
+QString Button::realText() const
+{
+ return m_realText;
+}
+
+void Button::setMode(Ideal::ButtonMode mode)
+{
+ switch (mode)
+ {
+ case Text:
+ disableIconSet();
+ enableText();
+ break;
+ case IconsAndText:
+ enableIconSet();
+ enableText();
+ break;
+ case Icons:
+ disableText();
+ enableIconSet();
+ break;
+ }
+}
+
+void Button::enableIconSet()
+{
+ if (!iconSet())
+ {
+ if (m_realIconSet.isNull())
+ m_realIconSet = SmallIcon("file_new");
+ setIconSet(m_realIconSet);
+ }
+}
+
+void Button::disableIconSet()
+{
+ setIconSet(QIconSet());
+}
+
+void Button::disableText()
+{
+ if (text().length() > 0)
+ setText("");
+}
+
+void Button::enableText()
+{
+ setText(m_realText);
+}
+
+void Button::contextMenuEvent(QContextMenuEvent *e)
+{
+ QPopupMenu menu;
+
+ m_assignAccelAction->plug(&menu);
+ if (m_realText.contains(QRegExp("^&[0-9]\\s")))
+ m_clearAccelAction->plug(&menu);
+
+ emit contextMenu( &menu );
+
+ menu.exec(e->globalPos());
+}
+
+void Button::assignAccel()
+{
+ bool ok;
+ int num = KInputDialog::getInteger(i18n("Change Button Number"), i18n("New accelerator number:"), 1, 0, 10, 1, &ok, this);
+ if (ok)
+ {
+ QString text = realTextWithoutAccel();
+ text = QString("&%1 %2").arg(num).arg(text);
+ setRealText(text);
+ }
+}
+
+void Button::setRealText(const QString &text)
+{
+ m_realText = text;
+ setText(text);
+ updateSize();
+}
+
+void Button::clearAccel()
+{
+ setRealText(realTextWithoutAccel());
+}
+
+QString Button::realTextWithoutAccel() const
+{
+ QString text = m_realText;
+ QRegExp r("^&[0-9]\\s");
+ if (text.contains(r))
+ text.remove(r);
+ return text;
+}
+
+}
+
+#include "button.moc"
diff --git a/src/newui/button.h b/src/newui/button.h
new file mode 100644
index 00000000..a7afbcfe
--- /dev/null
+++ b/src/newui/button.h
@@ -0,0 +1,108 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef IDEALBUTTON_H
+#define IDEALBUTTON_H
+
+#include <qpushbutton.h>
+#include <qiconset.h>
+
+#include "comdefs.h"
+
+class KAction;
+
+namespace Ideal {
+
+class ButtonBar;
+
+/**
+@short A button to place onto the ButtonBar
+
+A QPushButton derivative with a size of a QToolBar. Button can be rotated
+(placed onto different places in ideal mode).
+*/
+class Button : public QPushButton {
+ Q_OBJECT
+public:
+ Button(ButtonBar *parent, const QString text, const QIconSet &icon = QIconSet(),
+ const QString &description = QString::null);
+
+ /**Sets the description used as a tooltip.*/
+ void setDescription(const QString &description);
+ /**Returns the description.*/
+ QString description() const;
+
+ /**Sets the place of a button.*/
+ void setPlace(Ideal::Place place);
+ /**Sets the mode of a button.*/
+ void setMode(Ideal::ButtonMode mode);
+
+ QSize sizeHint() const;
+ QSize sizeHint(const QString &text) const;
+
+ /**Updates size of a widget. Used after squeezing button's text.*/
+ void updateSize();
+
+ /**Returns the real (i.e. not squeezed) text of a button.*/
+ QString realText() const;
+ QString realTextWithoutAccel() const;
+ void setRealText(const QString &text);
+
+protected:
+ ButtonMode mode();
+
+ virtual void drawButton(QPainter *p);
+ virtual void drawButtonLabel(QPainter *p);
+
+ virtual void contextMenuEvent(QContextMenuEvent *e);
+
+protected slots:
+ void assignAccel();
+ void clearAccel();
+
+signals:
+ void contextMenu(QPopupMenu*);
+
+private:
+ virtual ~Button();
+
+ void fixDimensions(Place oldPlace);
+
+ void enableIconSet();
+ void disableIconSet();
+ void enableText();
+ void disableText();
+
+ ButtonBar *m_buttonBar;
+
+ QString m_description;
+ Place m_place;
+
+ QString m_realText;
+ QIconSet m_realIconSet;
+
+ KAction *m_assignAccelAction;
+ KAction *m_clearAccelAction;
+
+friend class ButtonBar;
+};
+
+}
+
+#endif
diff --git a/src/newui/buttonbar.cpp b/src/newui/buttonbar.cpp
new file mode 100644
index 00000000..8f60dabf
--- /dev/null
+++ b/src/newui/buttonbar.cpp
@@ -0,0 +1,346 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "buttonbar.h"
+
+#include <qlayout.h>
+
+#include <kdebug.h>
+#include <kconfig.h>
+#include <kstringhandler.h>
+#include <klocale.h>
+
+#include "button.h"
+
+namespace Ideal {
+
+//ButtonLayout class
+
+ButtonLayout::ButtonLayout(ButtonBar *parent, Direction d, int margin, int spacing, const char *name)
+ :QBoxLayout(parent, d, margin, spacing, name), m_buttonBar(parent)
+{
+}
+
+QSize ButtonLayout::minimumSize() const
+{
+ QSize size = QBoxLayout::minimumSize();
+
+ if (!m_buttonBar->autoResize())
+ return size;
+
+ switch (m_buttonBar->place())
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ return QSize(size.width(),0);
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ return QSize(0,size.height());
+ }
+ return QBoxLayout::minimumSize();
+}
+
+
+
+//ButtonBar class
+
+
+ButtonBar::ButtonBar(Place place, ButtonMode mode, QWidget *parent, const char *name)
+ :QWidget(parent, name), m_place(place), l(0), m_shrinked(false), m_autoResize(true)
+{
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ l = new ButtonLayout(this, QBoxLayout::TopToBottom, 0, 0);
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ l = new ButtonLayout(this, QBoxLayout::LeftToRight, 0, 0);
+ break;
+ }
+
+ l->setResizeMode(QLayout::Minimum);
+ setMode(mode);
+
+ l->insertStretch(-1);
+}
+
+ButtonBar::~ButtonBar()
+{
+}
+
+void ButtonBar::addButton(Button *button)
+{
+ int buttonCount = m_buttons.count();
+
+ button->setMode(m_mode);
+ m_buttons.append(button);
+ l->insertWidget(buttonCount, button);
+ button->show();
+ fixDimensions();
+}
+
+void ButtonBar::removeButton(Button *button)
+{
+ m_buttons.remove(button);
+ l->remove(button);
+ delete button;
+}
+
+void ButtonBar::setMode(ButtonMode mode)
+{
+ m_mode = mode;
+ for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
+ (*it)->setMode(mode);
+}
+
+ButtonMode ButtonBar::mode() const
+{
+ return m_mode;
+}
+
+Place ButtonBar::place() const
+{
+ return m_place;
+}
+
+void ButtonBar::fixDimensions()
+{
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ setFixedWidth(sizeHint().width());
+ setMinimumHeight(sizeHint().height());
+ setMaximumHeight(32767);
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ setFixedHeight(sizeHint().height());
+ setMinimumWidth(sizeHint().width());
+ setMaximumWidth(32767);
+ break;
+ }
+}
+
+void ButtonBar::setButtonsPlace(Ideal::Place place)
+{
+ for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
+ (*it)->setPlace(place);
+}
+
+void ButtonBar::resizeEvent(QResizeEvent *ev)
+{
+ int preferredDimension = 0;
+ int actualDimension = 0;
+ int oldDimension = 0;
+ switch (m_place)
+ {
+ case Ideal::Left:
+ case Ideal::Right:
+ preferredDimension = l->QBoxLayout::minimumSize().height();
+ actualDimension = size().height();
+ oldDimension = ev->oldSize().height();
+ break;
+ case Ideal::Top:
+ case Ideal::Bottom:
+ preferredDimension = l->QBoxLayout::minimumSize().width();
+ actualDimension = size().width();
+ oldDimension = ev->oldSize().width();
+ break;
+ }
+
+ if (preferredDimension > actualDimension)
+ shrink(preferredDimension, actualDimension);
+ else if (m_shrinked && (originalDimension() < actualDimension))
+ unshrink();
+ else if (m_shrinked && actualDimension > oldDimension)
+ deshrink(preferredDimension, actualDimension);
+
+ QWidget::resizeEvent(ev);
+}
+
+void ButtonBar::shrink(int preferredDimension, int actualDimension)
+{
+ if (!preferredDimension)
+ return;
+
+ m_shrinked = true;
+
+ uint textLength = 0;
+ QValueList<uint> texts;
+ uint maxLength = 0;
+ for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
+ {
+ uint length = (*it)->text().length();
+ maxLength = length > maxLength ? length : maxLength ;
+ texts.append(length);
+ textLength += length;
+ }
+
+ uint newPreferredLength = actualDimension * textLength / preferredDimension;
+
+ uint newMaxLength = maxLength;
+ uint newTextLength;
+ do {
+ newMaxLength -= 1;
+ newTextLength = 0;
+ for (QValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it)
+ {
+ if (*it > newMaxLength)
+ *it = newMaxLength;
+ newTextLength += *it;
+ }
+ } while (newTextLength > newPreferredLength);
+
+ int i = 0;
+ for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
+ {
+ (*it)->setText(KStringHandler::rsqueeze((*it)->realText(), texts[i++]));
+ (*it)->updateSize();
+ }
+}
+
+void ButtonBar::deshrink(int preferredDimension, int actualDimension)
+{
+ if (!preferredDimension)
+ return;
+
+ m_shrinked = true;
+
+ uint textLength = 0;
+ QValueList<uint> texts;
+ uint maxLength = 0;
+ for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
+ {
+ uint length = (*it)->text().length();
+ maxLength = length > maxLength ? length : maxLength ;
+ texts.append(length);
+ textLength += length;
+ }
+
+ uint newPreferredLength = actualDimension * textLength / preferredDimension;
+
+ if (newPreferredLength <= textLength)
+ return;
+
+ uint newTextLength;
+ uint prevTextLength = 0;
+ do {
+ newTextLength = 0;
+ int i = 0;
+ for (QValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it, i++)
+ {
+ if (m_buttons[i]->text().contains("..."))
+ (*it)++;
+ newTextLength += *it;
+ }
+ if (newTextLength == prevTextLength)
+ break;
+ prevTextLength = newTextLength;
+ } while (newTextLength < newPreferredLength);
+
+ int i = 0;
+ for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
+ {
+ if (texts[i] >= (*it)->realText().length())
+ (*it)->setText((*it)->realText());
+ else
+ (*it)->setText(KStringHandler::rsqueeze((*it)->realText(), texts[i]));
+ (*it)->updateSize();
+ ++i;
+ }
+}
+
+void ButtonBar::unshrink()
+{
+ for (ButtonList::iterator it = m_buttons.begin(); it != m_buttons.end(); ++it)
+ {
+ (*it)->setText((*it)->realText());
+ (*it)->updateSize();
+ }
+ m_shrinked = false;
+}
+
+int ButtonBar::originalDimension()
+{
+ int size = 0;
+ for (ButtonList::const_iterator it = m_buttons.constBegin(); it != m_buttons.constEnd(); ++it)
+ {
+ size += (*it)->sizeHint((*it)->realText()).width();
+ }
+ return size;
+}
+
+bool ButtonBar::autoResize() const
+{
+ return m_autoResize;
+}
+
+void ButtonBar::setAutoResize(bool b)
+{
+ m_autoResize = b;
+}
+
+Button *ButtonBar::firstButton()
+{
+ if (!m_buttons.isEmpty())
+ return m_buttons.first();
+ return 0;
+}
+
+Button *ButtonBar::nextTo(Button *button)
+{
+ ButtonList::iterator it = m_buttons.find(button);
+ Button *next = 0;
+ if ((*it) == m_buttons.last())
+ next = m_buttons.first();
+ else
+ {
+ it++;
+ next = *it;
+ }
+ if (next->isVisible())
+ return next;
+ else
+ return nextTo(next);
+}
+
+Button *ButtonBar::prevTo(Button *button)
+{
+ ButtonList::iterator it = m_buttons.find(button);
+ Button *prev = 0;
+ if (it == m_buttons.begin())
+ prev = m_buttons.last();
+ else
+ {
+ it--;
+ prev = *it;
+ }
+ if (prev->isVisible())
+ return prev;
+ else
+ return prevTo(prev);
+}
+
+}
+
+#include "buttonbar.moc"
diff --git a/src/newui/buttonbar.h b/src/newui/buttonbar.h
new file mode 100644
index 00000000..5f5a7e36
--- /dev/null
+++ b/src/newui/buttonbar.h
@@ -0,0 +1,112 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef IDEALBUTTONBAR_H
+#define IDEALBUTTONBAR_H
+
+#include <qwidget.h>
+#include <qvaluelist.h>
+
+#include "comdefs.h"
+
+#include <qlayout.h>
+
+namespace Ideal {
+
+class Button;
+class ButtonBar;
+
+/**@short A layout for a ButtonBar class.
+
+Overrides minimumSize method to allow shrinking button bar buttons.*/
+class ButtonLayout: public QBoxLayout{
+public:
+ ButtonLayout(ButtonBar *parent, Direction d, int margin = 0, int spacing = -1, const char * name = 0);
+
+ virtual QSize minimumSize() const;
+
+private:
+ ButtonBar *m_buttonBar;
+};
+
+/**
+@short A bar with tool buttons.
+
+Looks like a toolbar but has another behaviour. It is suitable for
+placing on the left(right, bottom, top) corners of a window as a bar with slider.
+*/
+class ButtonBar : public QWidget {
+ Q_OBJECT
+public:
+ ButtonBar(Place place, ButtonMode mode = IconsAndText,
+ QWidget *parent = 0, const char *name = 0);
+ virtual ~ButtonBar();
+
+ /**Adds a button to the bar.*/
+ virtual void addButton(Button *button);
+ /**Removes a button from the bar and deletes the button.*/
+ virtual void removeButton(Button *button);
+
+ /**Sets the mode.*/
+ void setMode(ButtonMode mode);
+ /**@returns the mode.*/
+ ButtonMode mode() const;
+
+ /**@returns the place.*/
+ Place place() const;
+
+ bool autoResize() const;
+ void setAutoResize(bool b);
+
+ /**Shrinks the button bar so all buttons are visible. Shrinking is done by
+ reducing the amount of text shown on buttons. Button icon size is a minimum size
+ of a button. If a button does not have an icon, it displays "...".*/
+ virtual void shrink(int preferredDimension, int actualDimension);
+ virtual void deshrink(int preferredDimension, int actualDimension);
+ /**Restores the size of button bar buttons.*/
+ virtual void unshrink();
+
+ Button *firstButton();
+ Button *nextTo(Button *button);
+ Button *prevTo(Button *button);
+
+protected:
+ virtual void resizeEvent ( QResizeEvent *ev );
+
+ int originalDimension();
+
+private:
+ void fixDimensions();
+ void setButtonsPlace(Ideal::Place place);
+
+ typedef QValueList<Button*> ButtonList;
+ ButtonList m_buttons;
+
+ ButtonMode m_mode;
+ Place m_place;
+
+ ButtonLayout *l;
+
+ bool m_shrinked;
+ bool m_autoResize;
+};
+
+}
+
+#endif
diff --git a/src/newui/comdefs.h b/src/newui/comdefs.h
new file mode 100644
index 00000000..8233f12c
--- /dev/null
+++ b/src/newui/comdefs.h
@@ -0,0 +1,30 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef COMDEFS_H
+#define COMDEFS_H
+
+namespace Ideal {
+
+ enum Place { Left=1, Right=2, Top=4, Bottom=8 };
+ enum ButtonMode { Text, IconsAndText, Icons };
+
+}
+
+#endif
diff --git a/src/newui/ddockwindow.cpp b/src/newui/ddockwindow.cpp
new file mode 100644
index 00000000..bb249abc
--- /dev/null
+++ b/src/newui/ddockwindow.cpp
@@ -0,0 +1,413 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "ddockwindow.h"
+
+#include <qtoolbutton.h>
+#include <qlayout.h>
+#include <qstyle.h>
+#include <qwidgetstack.h>
+#include <qimage.h>
+#include <qapplication.h>
+#include <qpopupmenu.h>
+
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kconfig.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+
+#include "buttonbar.h"
+#include "button.h"
+#include "dmainwindow.h"
+
+DDockWindow::DDockWindow(DMainWindow *parent, Position position)
+ :QDockWindow(QDockWindow::InDock, parent), m_position(position), m_visible(false),
+ m_mainWindow(parent), m_doNotCloseActiveWidget(false), m_toggledButton(0), m_lastContextMenuButton(0)
+{
+ setMovingEnabled(false);
+ setResizeEnabled(true);
+
+ Ideal::Place place = Ideal::Left;
+ switch (position) {
+ case DDockWindow::Bottom:
+ m_name = "BottomToolWindow";
+ place = Ideal::Bottom;
+ m_internalLayout = new QVBoxLayout(boxLayout(), 0);
+ m_internalLayout->setDirection(QBoxLayout::BottomToTop);
+ break;
+ case DDockWindow::Left:
+ m_name = "LeftToolWindow";
+ place = Ideal::Left;
+ m_internalLayout = new QHBoxLayout(boxLayout(), 0);
+ m_internalLayout->setDirection(QBoxLayout::LeftToRight);
+ break;
+ case DDockWindow::Right:
+ m_name = "RightToolWindow";
+ place = Ideal::Right;
+ m_internalLayout = new QHBoxLayout(boxLayout(), 0);
+ m_internalLayout->setDirection(QBoxLayout::RightToLeft);
+ break;
+ }
+
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+ int mode = config->readNumEntry("MDIStyle", 3);
+ Ideal::ButtonMode buttonMode = Ideal::Text;
+ if (mode == 0)
+ buttonMode = Ideal::Icons;
+ else if (mode == 1)
+ buttonMode = Ideal::Text;
+ else if (mode == 3)
+ buttonMode = Ideal::IconsAndText;
+
+ m_bar = new Ideal::ButtonBar(place, buttonMode, this);
+ m_internalLayout->addWidget(m_bar);
+
+ m_widgetStack = new QWidgetStack(this);
+ m_internalLayout->addWidget(m_widgetStack);
+
+ m_moveToDockLeft = new KAction( i18n("Move to left dock"), 0, this, SLOT(moveToDockLeft()), this );
+ m_moveToDockRight = new KAction( i18n("Move to right dock"), 0, this, SLOT(moveToDockRight()), this );
+ m_moveToDockBottom = new KAction( i18n("Move to bottom dock"), 0, this, SLOT(moveToDockBottom()), this );
+
+ setVisible(m_visible);
+
+ loadSettings();
+}
+
+DDockWindow::~DDockWindow()
+{
+//done in DMainWindow now
+// saveSettings();
+}
+
+void DDockWindow::setVisible(bool v)
+{
+ //write dock width to the config file
+ KConfig *config = kapp->config();
+ QString group = QString("%1").arg(m_name);
+ config->setGroup(group);
+
+ if (m_visible)
+ config->writeEntry("ViewWidth", m_position == DDockWindow::Bottom ? height() : width() );
+ setResizeEnabled(v);
+ setVerticallyStretchable(true);
+ setHorizontallyStretchable(true);
+ v ? m_widgetStack->show() : m_widgetStack->hide();
+ m_visible = v;
+
+ m_internalLayout->invalidate();
+ if (!m_visible)
+ {
+ if (m_position == DDockWindow::Bottom)
+ setFixedExtentHeight(m_internalLayout->sizeHint().height());
+ else
+ setFixedExtentWidth(m_internalLayout->sizeHint().width());
+ emit hidden();
+ }
+ else
+ {
+ //restore widget size from the config
+ int size = 0;
+ if (m_position == DDockWindow::Bottom)
+ {
+ size = config->readNumEntry("ViewWidth", m_internalLayout->sizeHint().height());
+ setFixedExtentHeight(size);
+ }
+ else
+ {
+ size = config->readNumEntry("ViewWidth", m_internalLayout->sizeHint().width());
+ setFixedExtentWidth(size);
+ }
+ }
+}
+
+void DDockWindow::loadSettings()
+{
+}
+
+void DDockWindow::saveSettings()
+{
+ KConfig *config = kapp->config();
+ QString group = QString("%1").arg(m_name);
+ int invisibleWidth = 0;
+ config->setGroup(group);
+ if (config->hasKey("ViewWidth"))
+ invisibleWidth = config->readNumEntry("ViewWidth");
+ config->deleteEntry("ViewWidth");
+ config->deleteEntry("ViewLastWidget");
+ if (m_toggledButton && m_visible)
+ {
+ config->writeEntry("ViewWidth", m_position == DDockWindow::Bottom ? height() : width());
+ config->writeEntry("ViewLastWidget", m_toggledButton->realTextWithoutAccel());
+ }
+ else if (invisibleWidth != 0)
+ config->writeEntry("ViewWidth", invisibleWidth);
+}
+
+QWidget *DDockWindow::currentWidget() const
+{
+ return m_widgetStack->visibleWidget();
+}
+
+void DDockWindow::addWidget(const QString &title, QWidget *widget, bool skipActivation)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+ QPixmap *pm = const_cast<QPixmap*>(widget->icon());
+ Ideal::Button *button;
+ if (pm != 0)
+ {
+ //force 16pt for now
+ if (pm->height() > 16)
+ {
+ QImage img = pm->convertToImage();
+ img = img.smoothScale(16, 16);
+ pm->convertFromImage(img);
+ }
+ button = new Ideal::Button(m_bar, title, *pm);
+ }
+ else
+ button = new Ideal::Button(m_bar, title);
+ m_widgets[button] = widget;
+ m_buttons[widget] = button;
+ m_bar->addButton(button);
+
+ m_widgetStack->addWidget(widget);
+ connect(button, SIGNAL(clicked()), this, SLOT(selectWidget()));
+ connect(button, SIGNAL(contextMenu(QPopupMenu*)), this, SLOT(contextMenu(QPopupMenu*)) );
+
+ if (!skipActivation)
+ {
+ //if the widget was selected last time the dock is deleted
+ //we need to show it
+ KConfig *config = kapp->config();
+ QString group = QString("%1").arg(m_name);
+ config->setGroup(group);
+ if (config->readEntry("ViewLastWidget") == title)
+ {
+ kdDebug(9000) << k_funcinfo << " : activating last widget " << title << endl;
+ button->setOn(true);
+ selectWidget(button);
+ }
+ }
+}
+
+void DDockWindow::raiseWidget(QWidget *widget)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( !widget ) return;
+
+ Ideal::Button *button = m_buttons[widget];
+ if ((button != 0) && (!button->isOn()))
+ {
+ button->setOn(true);
+ selectWidget(button);
+ }
+}
+
+void DDockWindow::lowerWidget(QWidget * widget)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( !widget ) return;
+
+ Ideal::Button *button = m_buttons[widget];
+ if ((button != 0) && (button->isOn()))
+ {
+ button->setOn(false);
+ selectWidget(button);
+ }
+}
+
+void DDockWindow::removeWidget(QWidget *widget)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+ if (m_widgetStack->id(widget) == -1)
+ return; //not in dock
+
+ bool changeVisibility = false;
+ if (m_widgetStack->visibleWidget() == widget)
+ changeVisibility = true;
+
+ Ideal::Button *button = m_buttons[widget];
+ if (button)
+ m_bar->removeButton(button);
+ m_widgets.remove(button);
+ m_buttons.remove(widget);
+ m_widgetStack->removeWidget(widget);
+
+ if (changeVisibility)
+ {
+ m_toggledButton = 0;
+ setVisible(false);
+ }
+}
+
+void DDockWindow::selectWidget(Ideal::Button *button)
+{
+ bool special = m_doNotCloseActiveWidget;
+ m_doNotCloseActiveWidget = false;
+ kdDebug(9000) << k_funcinfo << endl;
+ if (m_toggledButton == button)
+ {
+ if (special && m_visible && (!isActive()))
+ {
+ //special processing for keyboard navigation events
+ m_toggledButton->setOn(true);
+ m_widgets[button]->setFocus();
+ }
+ else
+ {
+ m_widgets[button]->setFocus();
+ setVisible(!m_visible);
+ }
+ return;
+ }
+
+ if (m_toggledButton)
+ m_toggledButton->setOn(false);
+ m_toggledButton = button;
+ setVisible(true);
+ m_widgetStack->raiseWidget(m_widgets[button]);
+ m_widgets[button]->setFocus();
+}
+
+void DDockWindow::selectWidget()
+{
+ selectWidget((Ideal::Button*)sender());
+}
+
+void DDockWindow::hideWidget(QWidget *widget)
+{
+ Ideal::Button *button = m_buttons[widget];
+ if (button != 0)
+ {
+ button->setOn(false);
+ button->hide();
+ }
+ widget->hide();
+ if (button == m_toggledButton)
+ setVisible(false);
+}
+
+void DDockWindow::showWidget(QWidget *widget)
+{
+ Ideal::Button *button = m_buttons[widget];
+ if (button != 0)
+ button->show();
+// widget->show();
+}
+
+void DDockWindow::setMovingEnabled(bool)
+{
+ //some operations on KMainWindow cause moving to be enabled
+ //but we always don't want DDockWindow instances to be movable
+ QDockWindow::setMovingEnabled(false);
+}
+
+void DDockWindow::selectLastWidget()
+{
+ m_doNotCloseActiveWidget = true;
+ if (m_toggledButton)
+ m_toggledButton->animateClick();
+ else if (Ideal::Button *button = m_bar->firstButton())
+ button->animateClick();
+}
+
+bool DDockWindow::isActive()
+{
+ if (m_toggledButton)
+ {
+ QWidget *w = qApp->focusWidget();
+ if (!w)
+ return false;
+ QWidget *toolWidget = m_widgets[m_toggledButton];
+ if (toolWidget == w)
+ return true;
+ else
+ {
+ do {
+ w = (QWidget*)w->parent();
+ if (w && (w == toolWidget)) return true;
+ } while (w);
+ }
+ }
+ return false;
+}
+
+void DDockWindow::selectNextWidget()
+{
+ if (!m_toggledButton)
+ return;
+ Ideal::Button *b = m_bar->nextTo(m_toggledButton);
+ if (b)
+ b->animateClick();
+}
+
+void DDockWindow::selectPrevWidget()
+{
+ if (!m_toggledButton)
+ return;
+ Ideal::Button *b = m_bar->prevTo(m_toggledButton);
+ if (b)
+ b->animateClick();
+}
+
+void DDockWindow::contextMenu(QPopupMenu * menu)
+{
+ m_lastContextMenuButton = static_cast<Ideal::Button*>( const_cast<QObject*>( sender() ) );
+
+ menu->insertSeparator();
+
+ if ( position() != DDockWindow::Left )
+ m_moveToDockLeft->plug( menu );
+ if ( position()!= DDockWindow::Right )
+ m_moveToDockRight->plug( menu );
+ if ( position() != DDockWindow::Bottom )
+ m_moveToDockBottom->plug( menu );
+}
+
+void DDockWindow::moveToDockLeft()
+{
+ moveToDock( DDockWindow::Left );
+}
+
+void DDockWindow::moveToDockRight()
+{
+ moveToDock( DDockWindow::Right );
+}
+
+void DDockWindow::moveToDockBottom()
+{
+ moveToDock( DDockWindow::Bottom );
+}
+
+void DDockWindow::moveToDock(DDockWindow::Position position )
+{
+ if ( m_widgets.contains( m_lastContextMenuButton ) )
+ {
+ mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() );
+ }
+}
+
+#include "ddockwindow.moc"
diff --git a/src/newui/ddockwindow.h b/src/newui/ddockwindow.h
new file mode 100644
index 00000000..ece0db8c
--- /dev/null
+++ b/src/newui/ddockwindow.h
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DDOCKWINDOW_H
+#define DDOCKWINDOW_H
+
+#include <qdockwindow.h>
+#include <qvaluelist.h>
+
+class QBoxLayout;
+class QToolButton;
+class QWidgetStack;
+class QPopupMenu;
+
+class KComboBox;
+class KAction;
+
+class DMainWindow;
+
+namespace Ideal {
+ class Button;
+ class ButtonBar;
+}
+
+class DDockWindow : public QDockWindow {
+ Q_OBJECT
+public:
+ enum Position { Bottom, Left, Right };
+
+ DDockWindow(DMainWindow *parent, Position position);
+ virtual ~DDockWindow();
+
+ virtual void setVisible(bool v);
+ bool visible() const { return m_visible; }
+ Position position() const { return m_position; }
+
+ virtual void addWidget(const QString &title, QWidget *widget, bool skipActivation = false);
+ virtual void raiseWidget(QWidget *widget);
+ virtual void lowerWidget(QWidget *widget);
+ /**Removes the widget from dock. Does not delete it.*/
+ virtual void removeWidget(QWidget *widget);
+
+ virtual void hideWidget(QWidget *widget);
+ virtual void showWidget(QWidget *widget);
+
+ virtual QWidget *currentWidget() const;
+
+ virtual void setMovingEnabled(bool b);
+
+ virtual void saveSettings();
+
+ DMainWindow *mainWindow() const { return m_mainWindow; }
+
+ virtual void selectLastWidget();
+ virtual void selectNextWidget();
+ virtual void selectPrevWidget();
+
+ bool isActive();
+
+signals:
+ void hidden();
+
+private slots:
+ void selectWidget();
+ void selectWidget(Ideal::Button *button);
+ void contextMenu(QPopupMenu*);
+ void moveToDockLeft();
+ void moveToDockRight();
+ void moveToDockBottom();
+ void moveToDock(DDockWindow::Position);
+
+protected:
+ virtual void loadSettings();
+
+ Ideal::ButtonBar *m_bar;
+ QWidgetStack *m_widgetStack;
+
+ QMap<Ideal::Button*, QWidget*> m_widgets;
+ QMap<QWidget*, Ideal::Button*> m_buttons;
+
+private:
+ Position m_position;
+ bool m_visible;
+ QString m_name;
+ DMainWindow *m_mainWindow;
+ bool m_doNotCloseActiveWidget;
+
+ Ideal::Button *m_toggledButton;
+ Ideal::Button *m_lastContextMenuButton;
+ QBoxLayout *m_internalLayout;
+
+
+ KAction * m_moveToDockLeft;
+ KAction * m_moveToDockRight;
+ KAction * m_moveToDockBottom;
+};
+
+#endif
diff --git a/src/newui/dmainwindow.cpp b/src/newui/dmainwindow.cpp
new file mode 100644
index 00000000..27ffcf73
--- /dev/null
+++ b/src/newui/dmainwindow.cpp
@@ -0,0 +1,309 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "dmainwindow.h"
+
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kconfig.h>
+#include <kiconloader.h>
+
+#include <qtoolbutton.h>
+
+#include "dtabwidget.h"
+#include "docksplitter.h"
+
+DMainWindow::DMainWindow(QWidget *parent, const char *name)
+ :KParts::MainWindow(parent, name), m_firstRemoved(false), m_currentWidget(0)
+{
+ loadSettings();
+ createToolWindows();
+ m_central = new Ideal::DockSplitter(Qt::Horizontal, this);
+ m_activeTabWidget = createTab();
+ m_central->addDock(0, 0, m_activeTabWidget);
+ setCentralWidget(m_central);
+}
+
+void DMainWindow::loadSettings()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+ m_openTabAfterCurrent = config->readBoolEntry("OpenNewTabAfterCurrent", true);
+ m_showIconsOnTabs = config->readBoolEntry("ShowTabIcons", false);
+}
+
+void DMainWindow::saveSettings()
+{
+ m_leftDock->saveSettings();
+ m_rightDock->saveSettings();
+ m_bottomDock->saveSettings();
+}
+
+DMainWindow::~DMainWindow()
+{
+/* for (QValueList<QWidget*>::iterator it = m_widgets.begin(); it != m_widgets.end(); ++it)
+ removeWidget(*it);*/
+}
+
+DDockWindow *DMainWindow::toolWindow(DDockWindow::Position position) const
+{
+ switch (position) {
+ case DDockWindow::Bottom: return m_bottomDock;
+ case DDockWindow::Left: return m_leftDock;
+ case DDockWindow::Right: return m_rightDock;
+ }
+ return 0;
+}
+
+void DMainWindow::createToolWindows()
+{
+ m_bottomDock = new DDockWindow(this, DDockWindow::Bottom);
+ moveDockWindow(m_bottomDock, Qt::DockBottom);
+ m_leftDock = new DDockWindow(this, DDockWindow::Left);
+ moveDockWindow(m_leftDock, Qt::DockLeft);
+ m_rightDock = new DDockWindow(this, DDockWindow::Right);
+ moveDockWindow(m_rightDock, Qt::DockRight);
+}
+
+void DMainWindow::addWidget(QWidget *widget, const QString &title)
+{
+// invalidateActiveTabWidget();
+ if (m_firstRemoved && m_activeTabWidget == m_tabs.first())
+ {
+ m_central->addDock(0, 0, m_activeTabWidget);
+ m_firstRemoved = false;
+ }
+
+ addWidget(m_activeTabWidget, widget, title);
+}
+
+void DMainWindow::addWidget(DTabWidget *tab, QWidget *widget, const QString &title)
+{
+ static QPixmap emptyPixmap;
+
+ int idx = -1;
+ if (m_openTabAfterCurrent && (tab->count() > 0))
+ idx = tab->currentPageIndex() + 1;
+ if (m_showIconsOnTabs)
+ {
+ const QPixmap *pixmap = widget->icon();
+ const QIconSet &icons = (pixmap && (pixmap->size().height() <= 16)) ? *(pixmap) : SmallIcon("kdevelop");
+ tab->insertTab(widget, icons, title, idx);
+ }
+ else
+ tab->insertTab(widget, emptyPixmap, title, idx);
+ m_widgets.append(widget);
+ m_widgetTabs[widget] = tab;
+ widget->installEventFilter(this);
+ tab->showPage(widget);
+}
+
+void DMainWindow::removeWidget(QWidget *widget)
+{
+ if (!m_widgets.contains(widget))
+ return; //not a widget in main window
+
+ if (m_widgetTabs.contains(widget))
+ {
+ DTabWidget *tab = m_widgetTabs[widget];
+ if (tab->indexOf(widget) >= 0)
+ {
+ tab->removePage(widget);
+ widget->reparent(0,QPoint(0,0),false);
+ if (tab->count() == 0)
+ {
+ if (tab->closeButton())
+ tab->closeButton()->hide();
+ //remove and delete tabwidget if it is not the first one
+ if (tab != m_tabs.first())
+ {
+ QPair<uint, uint> idx = m_central->indexOf(tab);
+ m_tabs.remove(tab);
+ m_activeTabWidget = m_tabs.first();
+ m_central->removeDock(idx.first, idx.second, true);
+ }
+ //only temporarily remove the first tabwidget
+ else
+ {
+ m_central->removeDock(0, 0, false);
+ m_firstRemoved = true;
+ }
+ //focus smth in m_activeTabWidget
+ if (m_activeTabWidget)
+ {
+ if (m_activeTabWidget->currentPage())
+ {
+ m_activeTabWidget->currentPage()->setFocus();
+ }
+ }
+ }
+ }
+ }
+
+ m_widgets.remove(widget);
+ m_widgetTabs.remove(widget);
+ if (m_activeTabWidget && m_activeTabWidget->currentPage())
+ {
+ //a hack to please multibuffer and actually switch the active part
+ QFocusEvent ev(QEvent::FocusIn);
+ QApplication::sendEvent(m_activeTabWidget->currentPage(), &ev);
+ }
+}
+
+DTabWidget *DMainWindow::splitHorizontal()
+{
+ m_activeTabWidget = createTab();
+ m_central->addDock(m_central->numRows(), 0, m_activeTabWidget);
+ return m_activeTabWidget;
+}
+
+DTabWidget *DMainWindow::splitVertical()
+{
+// invalidateActiveTabWidget();
+ int row = m_central->indexOf(m_activeTabWidget).first;
+ m_activeTabWidget = createTab();
+ m_central->addDock(row, m_central->numCols(row), m_activeTabWidget);
+ return m_activeTabWidget;
+}
+
+void DMainWindow::invalidateActiveTabWidget()
+{
+/* QWidget *focused = m_central->focusWidget();
+ kdDebug(9000) << "invalidate: " << focused << endl;
+ if (focused == 0)
+ return;
+ if (!m_widgets.contains(focused))
+ {
+ kdDebug(9000) << " focused is not in m_widgets" << endl;
+ return;
+ }
+ if (m_widgetTabs.contains(focused))
+ {
+ kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl;
+ DTabWidget *tab = m_widgetTabs[focused];
+ if (tab->indexOf(focused) >= 0)
+ m_activeTabWidget = tab;
+ kdDebug(9000) << " tab: " << tab << endl;
+ }*/
+}
+
+DTabWidget *DMainWindow::createTab()
+{
+ DTabWidget *tab = new DTabWidget(m_central);
+ m_tabs.append(tab);
+ if (tab->closeButton())
+ connect(tab->closeButton(), SIGNAL(clicked()), this, SLOT(closeTab()));
+ connect(tab, SIGNAL(closeRequest(QWidget*)), this, SLOT(closeTab(QWidget*)));
+ connect(tab, SIGNAL(contextMenu(QWidget*,const QPoint &)),
+ this, SLOT(tabContext(QWidget*,const QPoint &)));
+ return tab;
+}
+
+bool DMainWindow::eventFilter(QObject *obj, QEvent *ev)
+{
+ QWidget *w = (QWidget*)obj;
+ if (!m_widgets.contains(w))
+ return KParts::MainWindow::eventFilter(obj, ev);
+
+ if ((m_currentWidget != w) && (ev->type() == QEvent::FocusIn))
+ {
+ m_currentWidget = w;
+ emit widgetChanged(w);
+ }
+ else if (ev->type() == QEvent::IconChange)
+ {
+ if (m_widgetTabs.contains(w))
+ {
+ DTabWidget *tab = m_widgetTabs[w];
+ tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : QPixmap());
+ }
+ }
+ else if (ev->type() == QEvent::CaptionChange)
+ {
+ kdDebug(9000) << "caption change" << endl;
+ DTabWidget *tab = m_widgetTabs[w];
+ tab->changeTab(w, w->caption());
+ }
+
+ return KParts::MainWindow::eventFilter(obj, ev);
+}
+
+void DMainWindow::closeTab()
+{
+ //nothing to do here, should be reimplemented
+}
+
+void DMainWindow::tabContext(QWidget *, const QPoint &)
+{
+ //nothing to do here, should be reimplemented
+}
+
+void DMainWindow::closeTab(QWidget *)
+{
+ //nothing to do here, should be reimplemented
+}
+
+void DMainWindow::moveWidget(DDockWindow::Position position, QWidget * view, const QString & title)
+{
+ if (m_docks.contains(view))
+ {
+ toolWindow(m_docks[view])->removeWidget(view);
+
+ toolWindow(position)->addWidget( title, view, true );
+ m_docks[view] = position;
+ }
+}
+
+void DMainWindow::addDockWidget(DDockWindow::Position position, QWidget *view, const QString &title)
+{
+ toolWindow(position)->addWidget(title, view);
+ m_docks[view] = position;
+ connect(view, SIGNAL(destroyed()), this, SLOT(widgetDestroyed()));
+}
+
+void DMainWindow::removeDockWidget(QWidget *view)
+{
+ toolWindow(m_docks[view])->removeWidget(view);
+ m_docks.remove(view);
+}
+
+bool DMainWindow::hasDockWidget(QWidget *view)
+{
+ return m_docks.contains(view);
+}
+
+DDockWindow::Position DMainWindow::dockWidgetPosition(QWidget *view)
+{
+ return m_docks[view];
+}
+
+void DMainWindow::widgetDestroyed()
+{
+ QWidget *w = static_cast<QWidget*>(const_cast<QObject*>(sender()));
+
+ if (m_docks.contains(w))
+ {
+ kdError() << "Widget destroyed before being removed from UI!" << endl;
+ m_docks.remove(w);
+ }
+}
+
+#include "dmainwindow.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/src/newui/dmainwindow.h b/src/newui/dmainwindow.h
new file mode 100644
index 00000000..326d0c02
--- /dev/null
+++ b/src/newui/dmainwindow.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DMAINWINDOW_H
+#define DMAINWINDOW_H
+
+#include <kxmlguiclient.h>
+#include <kparts/mainwindow.h>
+
+#include "ddockwindow.h"
+
+class DTabWidget;
+namespace Ideal {
+ class DockSplitter;
+}
+
+/**Main window which provides simplified IDEA mode.*/
+class DMainWindow: public KParts::MainWindow {
+ Q_OBJECT
+public:
+ DMainWindow(QWidget *parent = 0, const char *name = 0);
+ virtual ~DMainWindow();
+
+ /**@return The tool window in given @p position.*/
+ DDockWindow *toolWindow(DDockWindow::Position position) const;
+
+ /**Adds a tabbed widget into the active (focused) tab widget.
+ If @p widget is null then only tab is created.*/
+ virtual void addWidget(QWidget *widget, const QString &title);
+ virtual void addWidget(DTabWidget *tab, QWidget *widget, const QString &title);
+ /**Removes widget. Does not delete it.*/
+ virtual void removeWidget(QWidget *widget);
+ /**Moves a widget from an existing dockposition to a new position**/
+ virtual void moveWidget(DDockWindow::Position newPosition, QWidget *widget, const QString & title);
+
+ /**Adds a dock widget into given position.*/
+ virtual void addDockWidget(DDockWindow::Position position, QWidget *view, const QString &title);
+ /**Removes a dock widget.*/
+ virtual void removeDockWidget(QWidget *view);
+
+ virtual void saveSettings();
+
+ bool hasDockWidget(QWidget *view);
+ DDockWindow::Position dockWidgetPosition(QWidget *view);
+
+public slots:
+ DTabWidget *splitHorizontal();
+ DTabWidget *splitVertical();
+
+protected slots:
+ /**This does nothing. Reimplement in subclass to close the tab
+ when corner close button is pressed.*/
+ virtual void closeTab();
+ /**This does nothing. Reimplement in subclass to close the tab
+ when hover close button is pressed.*/
+ virtual void closeTab(QWidget*);
+ /**This does nothing. Reimplement in subclass to show tab context menu.*/
+ virtual void tabContext(QWidget*,const QPoint &);
+
+ void widgetDestroyed();
+
+signals:
+ void widgetChanged(QWidget *);
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *ev);
+
+ virtual void loadSettings();
+
+ virtual void createToolWindows();
+ virtual DTabWidget *createTab();
+
+ DDockWindow *m_leftDock;
+ DDockWindow *m_rightDock;
+ DDockWindow *m_bottomDock;
+
+ QMap<QWidget*, DDockWindow::Position> m_docks;
+
+ Ideal::DockSplitter *m_central;
+ DTabWidget *m_activeTabWidget;
+
+ QValueList<DTabWidget*> m_tabs;
+
+ bool m_openTabAfterCurrent;
+ bool m_showIconsOnTabs;
+ bool m_firstRemoved;
+
+ QValueList<QWidget*> m_widgets;
+ QMap<QWidget*, DTabWidget*> m_widgetTabs;
+ QWidget *m_currentWidget;
+
+private slots:
+ void invalidateActiveTabWidget();
+
+};
+
+#endif
diff --git a/src/newui/docksplitter.cpp b/src/newui/docksplitter.cpp
new file mode 100644
index 00000000..46212f6c
--- /dev/null
+++ b/src/newui/docksplitter.cpp
@@ -0,0 +1,175 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "docksplitter.h"
+
+#include <kdebug.h>
+
+namespace Ideal {
+
+DockSplitter::DockSplitter(Orientation orientation, QWidget *parent, const char *name)
+ :QSplitter(parent, name), m_orientation(orientation)
+{
+ switch (m_orientation)
+ {
+ case Horizontal:
+ setOrientation(Vertical);
+ break;
+ case Vertical:
+ setOrientation(Horizontal);
+ break;
+ }
+ setOpaqueResize(true);
+ appendSplitter();
+}
+
+DockSplitter::~DockSplitter()
+{
+}
+
+void DockSplitter::addDock(uint row, uint col, QWidget *dock)
+{
+ if (m_docks.count() <= row)
+ for (uint i = m_docks.count(); i <= row ; ++i)
+ m_docks.append(QValueList<QWidget*>());
+
+ if (m_docks[row].count() <= col)
+ {
+ for (uint i = m_docks[row].count(); i <= col ; ++i)
+ m_docks[row].append(0);
+ m_docks[row][col] = dock;
+ }
+ else if (m_docks[row][col] == 0)
+ m_docks[row][col] = dock;
+ else
+ m_docks[row].insert(m_docks[row].at(col), dock);
+
+ if (m_splitters.count() <= row)
+ createSplitters(row);
+ QSplitter *splitter = m_splitters[row];
+
+ dock->reparent(splitter, QPoint(0,0), true);
+ if (col < m_docks[row].count()-1)
+ shiftWidgets(splitter, row, col+1);
+}
+
+void DockSplitter::appendSplitter()
+{
+ switch (m_orientation)
+ {
+ case Horizontal:
+ m_splitters.append(new QSplitter(Horizontal, this));
+ break;
+ case Vertical:
+ m_splitters.append(new QSplitter(Vertical, this));
+ break;
+ }
+ m_splitters[m_splitters.size()-1]->setOpaqueResize(true);
+ m_splitters[m_splitters.size()-1]->show();
+}
+
+void DockSplitter::createSplitters(uint index)
+{
+ kdDebug(9000) << "DockSplitter::createSplitters index = " << index << " count = " << m_splitters.count() << endl;
+ for (uint i = m_splitters.count(); i <= index; ++i)
+ {
+ kdDebug(9000) << " appendSplitter..." << endl;
+ appendSplitter();
+ }
+}
+
+void DockSplitter::removeDock(uint row, uint col, bool alsoDelete)
+{
+ if ((row >= m_docks.count()) || (col >= m_docks[row].count()))
+ return;
+
+ QWidget *w = m_docks[row][col];
+ m_docks[row].remove(m_docks[row].at(col));
+
+ if (alsoDelete)
+ {
+ delete w;
+ w = 0;
+ }
+ else
+ {
+ w->reparent(0, QPoint(0,0), false);
+ w->hide();
+ }
+
+ m_splitters[row]->setMinimumSize(m_splitters[row]->minimumSizeHint());
+
+ if (isRowEmpty(row))
+ {
+ m_docks.remove(m_docks.at(row));
+ delete m_splitters[row];
+ m_splitters[row] = 0;
+ m_splitters.remove(m_splitters.at(row));
+ }
+}
+
+bool DockSplitter::isRowEmpty(int row)
+{
+ if (m_docks[row].count() == 0)
+ return true;
+ for (uint i = 0; i < m_docks[row].count(); ++i)
+ if (m_docks[row][i] != 0)
+ return false;
+ return true;
+}
+
+void DockSplitter::shiftWidgets(QSplitter *splitter, uint row, uint fromCol)
+{
+ kdDebug(9000) << "shiftWidgets: row=" << row << " from col=" << fromCol << endl;
+ kdDebug(9000) << "row size is: " << m_docks[row].count() << endl;
+
+ for (uint i = fromCol; i < m_docks[row].count(); ++i)
+ {
+ kdDebug(9000) << "move from " << i << " to last" << endl;
+ if (m_docks[row][i])
+ splitter->moveToLast(m_docks[row][i]);
+ else
+ kdDebug(9000) << "m_docks[" << row << "][" << i << "] is 0" << endl;
+ }
+}
+
+int DockSplitter::numRows() const
+{
+ return m_docks.count();
+}
+
+int DockSplitter::numCols(int row) const
+{
+ if (row < numRows())
+ return m_docks[row].count();
+ return 0;
+}
+
+QPair<uint, uint> DockSplitter::indexOf(QWidget *dock)
+{
+ for (uint i = 0; i < m_docks.count(); ++i)
+ for (uint j = 0; j < m_docks[i].count(); ++j)
+ if (dock == m_docks[i][j])
+ return qMakePair(i, j);
+ return qMakePair(0u, 0u);
+}
+
+}
+
+#include "docksplitter.moc"
diff --git a/src/newui/docksplitter.h b/src/newui/docksplitter.h
new file mode 100644
index 00000000..214ad529
--- /dev/null
+++ b/src/newui/docksplitter.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef IDEALDOCKSPLITTER_H
+#define IDEALDOCKSPLITTER_H
+
+#include <qsplitter.h>
+#include <qvaluelist.h>
+
+namespace Ideal {
+
+class DockWidget;
+
+/**
+@short Splitter for docks
+*/
+class DockSplitter: public QSplitter {
+ Q_OBJECT
+public:
+ DockSplitter(Orientation orientation, QWidget *parent = 0, const char *name = 0);
+ ~DockSplitter();
+
+ void addDock(uint row, uint col, QWidget *dock);
+ void removeDock(uint row, uint col, bool alsoDelete = false);
+
+ QPair<uint, uint> indexOf(QWidget *dock);
+
+ int numRows() const;
+ int numCols(int row) const;
+
+protected:
+ void appendSplitter();
+ void createSplitters(uint index);
+ void shiftWidgets(QSplitter *splitter, uint row, uint fromCol);
+
+ bool isRowEmpty(int row);
+
+private:
+ Orientation m_orientation;
+ QValueList<QSplitter*> m_splitters;
+ QValueList<QValueList<QWidget*> > m_docks;
+};
+
+}
+
+#endif
diff --git a/src/newui/dtabwidget.cpp b/src/newui/dtabwidget.cpp
new file mode 100644
index 00000000..34ac9a5a
--- /dev/null
+++ b/src/newui/dtabwidget.cpp
@@ -0,0 +1,106 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "dtabwidget.h"
+
+#include <qtoolbutton.h>
+#include <qtabbar.h>
+
+#include <kconfig.h>
+#include <kiconloader.h>
+#include <kapplication.h>
+
+DTabWidget::DTabWidget(QWidget *parent, const char *name)
+ :KTabWidget(parent, name), m_closeButton(0)
+{
+ setFocusPolicy(NoFocus);
+ setMargin(0);
+
+ loadSettings();
+
+ if (!m_tabBarShown)
+ tabBar()->hide();
+ else {
+ m_closeButton = new QToolButton(this);
+ m_closeButton->setIconSet(SmallIcon("tab_remove"));
+ m_closeButton->adjustSize();
+ m_closeButton->hide();
+ setCornerWidget(m_closeButton, TopRight);
+
+ if (m_closeOnHover)
+ setHoverCloseButton(true);
+
+ setTabReorderingEnabled(true);
+ }
+
+ connect(this, SIGNAL(currentChanged(QWidget*)), this, SLOT(setFocus(QWidget*)));
+// connect(this, SIGNAL(currentChanged(QWidget*)), this, SLOT(updateHistory(QWidget*)));
+}
+
+void DTabWidget::loadSettings()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("UI");
+// m_tabBarShown = config->readBoolEntry("TabBarShown", true);
+ m_tabBarShown = ! config->readNumEntry("TabWidgetVisibility", 0);
+ m_closeOnHover = config->readBoolEntry("CloseOnHover", false);
+ m_closeButtonShown = config->readBoolEntry("ShowCloseTabsButton", true);
+ //we do not delay hover close buttons - that looks and feels ugly
+ setHoverCloseButtonDelayed(false);
+}
+
+void DTabWidget::saveSettings()
+{
+}
+
+QToolButton *DTabWidget::closeButton() const
+{
+ return m_closeButton;
+}
+
+void DTabWidget::setFocus(QWidget *w)
+{
+ if (w)
+ w->setFocus();
+}
+
+void DTabWidget::insertTab(QWidget *child, const QString &label, int index)
+{
+ if (m_closeButton && m_closeButtonShown)
+ m_closeButton->show();
+ KTabWidget::insertTab(child, label, index);
+ if (index != -1) tabBar()->repaint();
+}
+
+void DTabWidget::insertTab(QWidget *child, const QIconSet &iconset,
+ const QString &label, int index)
+{
+ if (m_closeButton && m_closeButtonShown)
+ m_closeButton->show();
+ KTabWidget::insertTab(child, iconset, label, index);
+ if (index != -1) tabBar()->repaint();
+}
+
+/*void DTabWidget::updateHistory(QWidget *w)
+{
+ if (m_history.top() != w)
+ m_history.push(w);
+}*/
+
+#include "dtabwidget.moc"
diff --git a/src/newui/dtabwidget.h b/src/newui/dtabwidget.h
new file mode 100644
index 00000000..4f51e47b
--- /dev/null
+++ b/src/newui/dtabwidget.h
@@ -0,0 +1,58 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef DTABWIDGET_H
+#define DTABWIDGET_H
+
+#include <ktabwidget.h>
+
+class QToolButton;
+
+class DTabWidget: public KTabWidget {
+ Q_OBJECT
+public:
+ DTabWidget(QWidget *parent=0, const char *name=0);
+
+ /**@return The close button at the top right corner.
+ May be 0 if the configuration do not allow close buttons or the tabbar.*/
+ QToolButton *closeButton() const;
+
+ virtual void insertTab(QWidget *child, const QString &label, int index = -1 );
+ virtual void insertTab(QWidget *child, const QIconSet &iconset,
+ const QString &label, int index = -1);
+
+protected:
+ virtual void loadSettings();
+ virtual void saveSettings();
+
+private slots:
+ void setFocus(QWidget *w);
+// void updateHistory(QWidget *w);
+
+private:
+ bool m_tabBarShown;
+ bool m_closeOnHover;
+ bool m_closeButtonShown;
+
+ QToolButton *m_closeButton;
+// QValueStack<QWidget*> *m_history;
+
+};
+
+#endif
diff --git a/src/partcontroller.cpp b/src/partcontroller.cpp
new file mode 100644
index 00000000..1fb15445
--- /dev/null
+++ b/src/partcontroller.cpp
@@ -0,0 +1,1867 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <qpopupmenu.h>
+#include <qfile.h>
+#include <qlayout.h>
+#include <qmap.h>
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qcheckbox.h>
+#include <qdom.h>
+
+#include <kmimetype.h>
+#include <kservice.h>
+#include <ktrader.h>
+#include <kapplication.h>
+#include <krun.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kparts/part.h>
+#include <kparts/factory.h>
+#include <kparts/partmanager.h>
+#include <kparts/browserextension.h>
+#include <kfiledialog.h>
+#include <kmainwindow.h>
+#include <kaction.h>
+#include <kmessagebox.h>
+#include <kstatusbar.h>
+#include <khtml_part.h>
+#include <kpopupmenu.h>
+#include <kio/netaccess.h>
+#include <kdialogbase.h>
+#include <klineedit.h>
+#include <kshortcut.h>
+#include <kcompletion.h>
+#include <kdirwatch.h>
+#include <kdeversion.h>
+#include <kiconloader.h>
+#include <kuserprofile.h>
+#include <kencodingfiledialog.h>
+#include <ksqueezedtextlabel.h>
+
+#include <ktexteditor/view.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/encodinginterface.h>
+
+#include "toplevel.h"
+#include "api.h"
+#include "core.h"
+#include "editorproxy.h"
+#include "documentationpart.h"
+#include "ksavealldialog.h"
+
+#include "kdevproject.h"
+#include "urlutil.h"
+#include "mimewarningdialog.h"
+#include "domutil.h"
+#include "kdevjobtimer.h"
+
+#include "designer.h"
+#include "kdevlanguagesupport.h"
+
+#include "multibuffer.h"
+#include "partcontroller.h"
+
+
+class QDomDocument;
+
+PartController *PartController::s_instance = 0;
+
+using namespace MainWindowUtils;
+
+struct HistoryEntry
+{
+ KURL url;
+ QString context;
+
+ HistoryEntry( const KURL& u, const QString& c ): url( u ), context( c ) {}
+};
+
+struct ModificationData
+{
+ KTextEditor::Document * doc;
+ bool isModified;
+ unsigned char reason;
+};
+
+
+PartController::PartController(QWidget *parent)
+ : KDevPartController(parent), _editorFactory(0L), m_currentActivePart(0), m_removingActivePart(false)
+{
+ connect(this, SIGNAL(partRemoved(KParts::Part*)), this, SLOT(slotPartRemoved(KParts::Part* )) );
+ connect(this, SIGNAL(partAdded(KParts::Part*)), this, SLOT(slotPartAdded(KParts::Part* )) );
+ connect(this, SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part*)));
+
+ setupActions();
+
+ m_isJumping = false;
+
+ m_openNextAsText = false;
+}
+
+
+PartController::~PartController()
+{
+}
+
+
+void PartController::createInstance(QWidget *parent)
+{
+ if (!s_instance)
+ s_instance = new PartController(parent);
+}
+
+
+PartController *PartController::getInstance()
+{
+ return s_instance;
+}
+
+
+void PartController::setupActions()
+{
+ KActionCollection *ac = TopLevel::getInstance()->main()->actionCollection();
+
+ KAction* newAction = KStdAction::open(this, SLOT(slotOpenFile()), ac, "file_open");
+ newAction->setToolTip( i18n("Open file") );
+ newAction->setWhatsThis( i18n("<b>Open file</b><p>Opens an existing file without adding it to the project.</p>") );
+
+ m_openRecentAction = KStdAction::openRecent( this, SLOT(slotOpenRecent(const KURL&) ), ac, "file_open_recent" );
+ m_openRecentAction->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(m_openRecentAction->text())).arg(i18n("Opens recently opened file.")));
+ m_openRecentAction->loadEntries( kapp->config(), "RecentFiles" );
+
+ m_saveAllFilesAction = new KAction(i18n("Save Al&l"), 0, this, SLOT(slotSaveAllFiles()), ac, "file_save_all");
+ m_saveAllFilesAction->setToolTip( i18n("Save all modified files") );
+ m_saveAllFilesAction->setWhatsThis(i18n("<b>Save all</b><p>Saves all modified files."));
+ m_saveAllFilesAction->setEnabled(false);
+
+ m_revertAllFilesAction = new KAction(i18n("Rever&t All"), 0, this, SLOT(slotRevertAllFiles()), ac, "file_revert_all");
+ m_revertAllFilesAction->setToolTip(i18n("Revert all changes"));
+ m_revertAllFilesAction->setWhatsThis(i18n("<b>Revert all</b><p>Reverts all changes in opened files. Prompts to save changes so the reversion can be canceled for each modified file."));
+ m_revertAllFilesAction->setEnabled(false);
+
+ m_closeWindowAction = KStdAction::close(this, SLOT(slotCloseWindow()), ac, "file_close");
+ m_closeWindowAction->setToolTip( i18n("Close current file") );
+ m_closeWindowAction->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(m_closeWindowAction->text())).arg(i18n("Closes current file.")));
+ m_closeWindowAction->setEnabled(false);
+
+ m_closeAllWindowsAction = new KAction(i18n("Close All"), 0, this, SLOT(slotCloseAllWindows()), ac, "file_close_all");
+ m_closeAllWindowsAction->setToolTip( i18n("Close all files") );
+ m_closeAllWindowsAction->setWhatsThis(i18n("<b>Close all</b><p>Close all opened files."));
+ m_closeAllWindowsAction->setEnabled(false);
+
+ m_closeOtherWindowsAction = new KAction(i18n("Close All Others"), 0, this, SLOT(slotCloseOtherWindows()), ac, "file_closeother");
+ m_closeOtherWindowsAction->setToolTip( i18n("Close other files") );
+ m_closeOtherWindowsAction->setWhatsThis(i18n("<b>Close all others</b><p>Close all opened files except current."));
+ m_closeOtherWindowsAction->setEnabled(false);
+
+ new KActionSeparator(ac, "dummy_separator");
+
+ m_backAction = new KToolBarPopupAction(i18n("Back"), "back", 0, this, SLOT(slotBack()), ac, "history_back");
+ m_backAction->setEnabled( false );
+ m_backAction->setToolTip(i18n("Back"));
+ m_backAction->setWhatsThis(i18n("<b>Back</b><p>Moves backwards one step in the navigation history."));
+ connect(m_backAction->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(slotBackAboutToShow()));
+ connect(m_backAction->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotBackPopupActivated(int)));
+
+ m_forwardAction = new KToolBarPopupAction(i18n("Forward"), "forward", 0, this, SLOT(slotForward()), ac, "history_forward");
+ m_forwardAction->setEnabled( false );
+ m_forwardAction->setToolTip(i18n("Forward"));
+ m_forwardAction->setWhatsThis(i18n("<b>Forward</b><p>Moves forward one step in the navigation history."));
+ connect(m_forwardAction->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(slotForwardAboutToShow()));
+ connect(m_forwardAction->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotForwardPopupActivated(int)));
+
+ m_gotoLastEditPosAction = new KAction( i18n("Goto Last Edit Position"), "bottom", 0, this, SLOT(gotoLastEditPos()), ac, "goto_last_edit_pos" );
+ m_gotoLastEditPosAction->setEnabled( false );
+ m_gotoLastEditPosAction->setToolTip( i18n("Goto Last Edit Position") );
+ m_gotoLastEditPosAction->setWhatsThis( i18n("<b>Goto Last Edit Position</b><p>Open the last edited file and position cursor at the point of edit") );
+}
+
+void PartController::setEncoding(const QString &encoding)
+{
+ m_presetEncoding = encoding;
+}
+
+KParts::Part* PartController::findOpenDocument(const KURL& url)
+{
+ // if we find it this way, all is well
+ KParts::Part * part = partForURL( url );
+ if ( part )
+ {
+ return part;
+ }
+
+ // ok, let's see if we can try harder
+ if ( API::getInstance()->project() )
+ {
+ KURL partURL = findURLInProject( url );
+ partURL.cleanPath();
+ return partForURL( partURL );
+ }
+
+ return 0L;
+}
+
+KURL PartController::findURLInProject(const KURL& url)
+{
+ QStringList fileList = API::getInstance()->project()->allFiles();
+
+ bool filenameOnly = (url.url().find('/') == -1);
+ QString filename = filenameOnly ? "/" : "";
+ filename += url.url();
+
+ for (QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it) {
+ if ((*it).endsWith(filename)) {
+ // Match! The first one is as good as any one, I guess...
+ return KURL( API::getInstance()->project()->projectDirectory() + "/" + *it );
+ }
+ }
+
+ return url;
+}
+
+void PartController::editDocument(const KURL &inputUrl, int lineNum, int col)
+{
+ editDocumentInternal(inputUrl, lineNum, col);
+}
+
+void PartController::splitCurrentDocument(const KURL &inputUrl,
+ int lineNum, int col)
+{
+ editDocumentInternal(inputUrl, lineNum, col, true, true);
+}
+
+void PartController::scrollToLineColumn(const KURL &inputUrl,
+ int lineNum, int col, bool storeHistory )
+{
+ if ( KParts::ReadOnlyPart *existingPart = partForURL( inputUrl ) )
+ {
+ if( storeHistory ) addHistoryEntry( existingPart );
+ EditorProxy::getInstance()->setLineNumber( existingPart, lineNum, col );
+ return;
+ }
+}
+
+void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum,
+ int col, bool activate,
+ bool addToCurrentBuffer )
+{
+ kdDebug(9000) << k_funcinfo << "\n " << inputUrl.prettyURL()
+ << " linenum " << lineNum << " activate? " << activate
+ << " addToCurrentBuffer? " << addToCurrentBuffer << endl;
+
+ KURL url = inputUrl;
+
+ // is it already open?
+ // (Try this once before verifying the URL, we could be dealing with a file that no longer exists on disc)
+ if ( KParts::Part *existingPart = partForURL( url ) )
+ {
+ // if we've been asked to OpenAs an open file with a specific encoding, assume the user wants to change encoding
+ if ( !m_presetEncoding.isNull() )
+ {
+ if ( KTextEditor::EncodingInterface * ei = dynamic_cast<KTextEditor::EncodingInterface*>( existingPart ) )
+ {
+ ei->setEncoding( m_presetEncoding );
+ }
+ m_presetEncoding = QString::null;
+ }
+
+ addHistoryEntry();
+ activatePart( existingPart );
+ EditorProxy::getInstance()->setLineNumber( existingPart, lineNum, col );
+ return;
+ }
+
+ // Make sure the URL exists
+ if ( !url.isValid() || !KIO::NetAccess::exists(url, false, 0) )
+ {
+ bool done = false;
+
+ // Try to find this file in the current project's list instead
+ if ( API::getInstance()->project() )
+ {
+ if (url.isRelativeURL(url.url())) {
+ KURL relURL(API::getInstance()->project()->projectDirectory());
+ relURL.addPath( url.url() );
+
+ kdDebug() << k_funcinfo << "Looking for file in project dir: " << API::getInstance()->project()->projectDirectory() << " url " << url.url() << " transformed to " << relURL.url() << ": " << done << endl;
+ if (relURL.isValid() && KIO::NetAccess::exists(relURL, false, 0)) {
+ url = relURL;
+ done = true;
+ }
+ else {
+ KURL relURL(API::getInstance()->project()->buildDirectory());
+ relURL.addPath( url.url() );
+ kdDebug() << k_funcinfo << "Looking for file in build dir: " << API::getInstance()->project()->buildDirectory() << " url " << url.url() << " transformed to " << relURL.url() << ": " << done << endl;
+ if (relURL.isValid() && KIO::NetAccess::exists(relURL, false, 0)) {
+ url = relURL;
+ done = true;
+ }
+ }
+ }
+
+ if (!done) {
+ url = findURLInProject(url);
+
+ if ( !url.isValid() || !KIO::NetAccess::exists(url, false, 0) )
+ // See if this url is relative to the current project's directory
+ url = API::getInstance()->project()->projectDirectory() + "/" + url.path();
+
+ else
+ done = true;
+ }
+ }
+
+ if ( !done && ( !url.isValid() || !KIO::NetAccess::exists(url, false, 0) ))
+ {
+ // Not found - prompt the user to find it?
+ kdDebug(9000) << "cannot find URL: " << url.url() << endl;
+ return;
+ }
+ }
+
+ // We now have a url that exists ;)
+
+ // clean it and resolve possible symlink
+ url.cleanPath(true);
+ if (url.isLocalFile())
+ {
+ QString path = url.path();
+ path = URLUtil::canonicalPath(path);
+ if ( !path.isEmpty() )
+ url.setPath(path);
+ }
+
+ // is it already open?
+ KParts::Part *existingPart = partForURL(url);
+ if (existingPart)
+ {
+ addHistoryEntry();
+ activatePart(existingPart);
+ EditorProxy::getInstance()->setLineNumber(existingPart, lineNum, col);
+ return;
+ }
+
+ if ( !addToCurrentBuffer )
+ {
+ if ( KDevLanguageSupport *lang =
+ API::getInstance()->languageSupport() )
+ {
+ // Let the language part override the addToCurrentBuffer flag
+ // if it decides to...
+ addToCurrentBuffer = lang->shouldSplitDocument( inputUrl );
+
+ if ( addToCurrentBuffer )
+ {
+ kdDebug(9000) <<
+ "languagePart() insists addToCurrentBuffer = true" << endl;
+ // Set activate = true, otherwise we have hard to fix
+ // multi-buffer delayed activation.
+ // I'll re-look at this later...
+ activate = true;
+ }
+ }
+ }
+
+ KMimeType::Ptr MimeType = KMimeType::findByURL( url );
+
+ kdDebug(9000) << "mimeType = " << MimeType->name() << endl;
+
+ // is the URL pointing to a directory?
+ if ( MimeType->is( "inode/directory" ) )
+ {
+ return;
+ }
+
+ if ( !m_presetEncoding.isNull() )
+ {
+ m_openNextAsText = true;
+ }
+
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+
+ // we don't trust KDE with designer files, let's handle it ourselves
+ if ( !m_openNextAsText && MimeType->is( "application/x-designer" ) )
+ {
+ QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" );
+ QString designerExec = "designer";
+ QStringList designerPluginPaths;
+ QDomDocument* dom = API::getInstance()->projectDom();
+ if ( dom != 0 )
+ {
+ // The global option specifies a fallback if the project
+ // has no setting or no project is open. However for Qt4
+ // projects we want to use ExternalDesigner in any case.
+ if ( DomUtil::readIntEntry( *dom, "/kdevcppsupport/qt/version", 3 ) == 4 )
+ {
+ designerPluginPaths = DomUtil::readListEntry(*dom, "/kdevcppsupport/qt/designerpluginpaths", "path" );
+ DesignerSetting = "ExternalDesigner";
+ }
+
+ DesignerSetting = DomUtil::readEntry(*dom, "/kdevcppsupport/qt/designerintegration", DesignerSetting );
+ designerExec = DomUtil::readEntry(*dom, "/kdevcppsupport/qt/designer", designerExec );
+ }
+ if ( DesignerSetting == "ExternalKDevDesigner" )
+ {
+ designerExec = "kdevdesigner";
+ }
+ else if ( DesignerSetting == "EmbeddedKDevDesigner" )
+ {
+ if ( KParts::ReadOnlyPart *designerPart = qtDesignerPart() )
+ {
+ addHistoryEntry();
+ activatePart(designerPart);
+ designerPart->openURL(url);
+ return;
+ }
+ else if ( KParts::Factory * KDevDesignerFactory = static_cast<KParts::Factory*>( KLibLoader::self()->factory( QFile::encodeName( "libkdevdesignerpart" ) ) ) )
+ {
+ KParts::ReadWritePart * kdevpart = static_cast<KParts::ReadWritePart*>( KDevDesignerFactory->createPart( TopLevel::getInstance()->main(), 0, 0, 0, "KParts::ReadWritePart" ) );
+ kdevpart->openURL( url );
+ addHistoryEntry();
+ integratePart( kdevpart, url );
+ m_openRecentAction->addURL( url );
+ m_openRecentAction->saveEntries( kapp->config(), "RecentFiles" );
+ return;
+ }
+ }
+
+ if( designerPluginPaths.isEmpty() )
+ KRun::runCommand( designerExec+" "+url.pathOrURL() );
+ else
+ KRun::runCommand( "QT_PLUGIN_PATH=\""+designerPluginPaths.join(":")+"\" "+designerExec+" "+url.pathOrURL() );
+
+ return;
+ }
+
+ config->setGroup("General");
+
+ QStringList texttypeslist = config->readListEntry( "TextTypes" );
+ if ( texttypeslist.contains( MimeType->name() ) )
+ {
+ m_openNextAsText = true;
+ }
+
+ bool isText = false;
+ QVariant v = MimeType->property("X-KDE-text");
+ if (v.isValid())
+ isText = v.toBool();
+ // is this regular text - open in editor
+ if ( m_openNextAsText || isText || MimeType->is( "application/x-zerosize" ) )
+ {
+ KTextEditor::Editor *editorpart =
+ createEditorPart( activate, addToCurrentBuffer, url );
+ if ( editorpart )
+ {
+ if ( m_presetEncoding.isNull() && API::getInstance()->projectDom() )
+ {
+ QDomDocument * projectDom = API::getInstance()->projectDom();
+ m_presetEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", QString::null );
+ }
+
+ if ( !m_presetEncoding.isNull() )
+ {
+ if ( KTextEditor::EncodingInterface * ei = dynamic_cast<KTextEditor::EncodingInterface*>( editorpart ) )
+ {
+ ei->setEncoding( m_presetEncoding );
+ }
+ m_presetEncoding = QString::null;
+ }
+
+ addHistoryEntry();
+
+ QWidget * widget = EditorProxy::getInstance()->topWidgetForPart( editorpart );
+
+ integratePart(editorpart, url, widget, true, activate, addToCurrentBuffer);
+ EditorProxy::getInstance()->setLineNumber(editorpart, lineNum, col);
+
+ m_openNextAsText = false;
+
+ m_openRecentAction->addURL( url );
+ m_openRecentAction->saveEntries( kapp->config(), "RecentFiles" );
+
+ return;
+ }
+ }
+
+ // OK, it's not text and it's not a designer file.. let's see what else we can come up with..
+
+ KParts::Factory *factory = 0;
+ QString className;
+
+ QString services[] = { "KParts/ReadWritePart", "KParts/ReadOnlyPart" };
+ QString classnames[] = { "KParts::ReadWritePart", "KParts::ReadOnlyPart" };
+ for (uint i=0; i<2; ++i)
+ {
+ factory = findPartFactory( MimeType->name(), services[i] );
+ if (factory)
+ {
+ className = classnames[i];
+ break;
+ }
+ }
+
+ kdDebug(9000) << "factory = " << factory << endl;
+
+ if (factory)
+ {
+ // create the object of the desired class
+ KParts::ReadOnlyPart *part = static_cast<KParts::ReadOnlyPart*>( factory->createPart( TopLevel::getInstance()->main(), 0, 0, 0, className.latin1() ) );
+ if ( part )
+ {
+ part->openURL( url );
+ addHistoryEntry();
+
+ if ( dynamic_cast<KTextEditor::Editor*>( part ) ) // we can have ended up with a texteditor, in which case need to treat it as such
+ {
+ integratePart(part, url, part->widget(), true, activate);
+ EditorProxy::getInstance()->setLineNumber(part, lineNum, col);
+ }
+ else
+ {
+ integratePart( part, url );
+ }
+
+ m_openRecentAction->addURL( url );
+ m_openRecentAction->saveEntries( kapp->config(), "RecentFiles" );
+ }
+ }
+ else
+ {
+ MimeWarningDialog dlg;
+ dlg.text2->setText( QString( "<qt><b>%1</b></qt>" ).arg(url.path()));
+ dlg.text3->setText( dlg.text3->text().arg(MimeType->name()) );
+
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ if ( dlg.open_with_kde->isChecked() )
+ {
+ KRun::runURL(url, MimeType->name() );
+ }
+ else
+ {
+ if ( dlg.always_open_as_text->isChecked() )
+ {
+ KConfig *config = kapp->config();
+ config->setGroup("General");
+ QStringList texttypeslist = config->readListEntry( "TextTypes" );
+ texttypeslist << MimeType->name();
+ config->writeEntry( "TextTypes", texttypeslist );
+ }
+ m_openNextAsText = true;
+ editDocument( url, lineNum, col );
+ }
+ }
+ }
+}
+
+
+void PartController::showDocument(const KURL &url, bool newWin)
+{
+ QString fixedPath = HTMLDocumentationPart::resolveEnvVarsInURL(url.url()); // possibly could env vars
+ KURL docUrl(fixedPath);
+ kdDebug(9000) << "SHOW: " << docUrl.url() << endl;
+
+ if ( docUrl.isLocalFile() && KMimeType::findByURL(docUrl)->name() != "text/html" ) {
+ // a link in a html-file pointed to a local text file - display
+ // it in the editor instead of a html-view to avoid uglyness
+ editDocument( docUrl );
+ return;
+ }
+
+ addHistoryEntry();
+
+ HTMLDocumentationPart *part = dynamic_cast<HTMLDocumentationPart*>(activePart());
+ if (!part || newWin)
+ {
+ part = new HTMLDocumentationPart;
+ integratePart(part,docUrl);
+ connect(part, SIGNAL(fileNameChanged(KParts::ReadOnlyPart* )),
+ this, SIGNAL(partURLChanged(KParts::ReadOnlyPart* )));
+ }
+ else
+ {
+ activatePart(part);
+ }
+ part->openURL(docUrl);
+}
+
+KParts::Factory *PartController::findPartFactory(const QString &mimeType, const QString &partType, const QString &preferredName)
+{
+ KTrader::OfferList offers = KTrader::self()->query(mimeType, QString("'%1' in ServiceTypes").arg(partType));
+
+ if (offers.count() > 0)
+ {
+ KService::Ptr ptr = 0;
+ // if there is a preferred plugin we'll take it
+ if ( !preferredName.isEmpty() ) {
+ KTrader::OfferList::Iterator it;
+ for (it = offers.begin(); it != offers.end(); ++it) {
+ if ((*it)->desktopEntryName() == preferredName) {
+ ptr = (*it);
+ }
+ }
+ }
+ // else we just take the first in the list
+ if ( !ptr ) {
+ ptr = offers.first();
+ }
+ return static_cast<KParts::Factory*>(KLibLoader::self()->factory(QFile::encodeName(ptr->library())));
+ }
+
+ return 0;
+}
+
+KTextEditor::Editor * PartController::createEditorPart( bool activate,
+ bool addToCurrentBuffer,
+ const KURL &url )
+{
+ MultiBuffer *multiBuffer = 0;
+ if ( addToCurrentBuffer )
+ {
+ multiBuffer =
+ dynamic_cast<MultiBuffer*>(
+ EditorProxy::getInstance()->topWidgetForPart( activePart() )
+ );
+ }
+ if ( !multiBuffer )
+ {
+ kdDebug(9000) << "Creating a new MultiBuffer for "
+ << url.fileName() << endl;
+ multiBuffer = new MultiBuffer( TopLevel::getInstance()->main() );
+ }
+
+ static bool alwaysActivate = true;
+
+ kapp->config()->setGroup("Editor");
+ QString preferred = kapp->config()->readPathEntry("EmbeddedKTextEditor");
+ // If we are not using kyzis...
+ // Don't create non-wrapped views for now,
+ // avoid two paths (== two chances for bad bugs)
+ if ( preferred != "kyzispart" )
+ alwaysActivate = false;
+
+ KTextEditor::Editor *editorpart =
+ dynamic_cast<KTextEditor::Editor*>(multiBuffer->createPart( "text/plain",
+ "KTextEditor/Document",
+ alwaysActivate | activate ?
+ "KTextEditor::Editor" : "KTextEditor::Document",
+ preferred
+ ));
+
+ if ( url.isValid() )
+ editorpart->openURL( url );
+
+ multiBuffer->registerURL( url, editorpart );
+ multiBuffer->setDelayedActivation( !activate );
+ return editorpart;
+}
+
+void PartController::integratePart(KParts::Part *part, const KURL &url,
+ QWidget* widget, bool isTextEditor,
+ bool activate, bool addToCurrentBuffer )
+{
+ if (!widget) widget = part->widget();
+
+ if (!widget) {
+ /// @todo error handling
+ kdDebug(9000) << "no widget for this part!!" << endl;
+ return; // to avoid later crash
+ }
+
+ if ( !addToCurrentBuffer )
+ TopLevel::getInstance()->embedPartView(widget, url.fileName(), url.url());
+
+ addPart(part, activate);
+
+ // tell the parts we loaded a document
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(part);
+ if ( !ro_part ) return;
+
+ emit loadedFile( ro_part->url() );
+
+ connect( part, SIGNAL(modifiedOnDisc(Kate::Document*, bool, unsigned char)), this, SLOT(slotDocumentDirty(Kate::Document*, bool, unsigned char)) );
+
+ // let's get notified when a document has been changed
+ connect(part, SIGNAL(completed()), this, SLOT(slotUploadFinished()));
+
+ // yes, we're cheating again. this signal exists for katepart's
+ // Document object and our HTMLDocumentationPart
+// connect(part, SIGNAL(fileNameChanged()), this, SLOT(slotFileNameChanged()));
+
+ // Connect to the document's views newStatus() signal in order to keep track of the
+ // modified-status of the document.
+
+ if (isTextEditor)
+ integrateTextEditorPart(static_cast<KTextEditor::Document*>(part));
+
+ KInterfaceDesigner::Designer *designerPart = dynamic_cast<KInterfaceDesigner::Designer *>(part);
+ if (designerPart && API::getInstance()->languageSupport())
+ {
+ kdDebug() << "integrating designer part with language support" << endl;
+ connect(designerPart, SIGNAL(addedFunction(DesignerType, const QString&, Function )),
+ API::getInstance()->languageSupport(),
+ SLOT(addFunction(DesignerType, const QString&, Function )));
+ connect(designerPart, SIGNAL(editedFunction(DesignerType, const QString&, Function, Function )), API::getInstance()->languageSupport(),
+ SLOT(editFunction(DesignerType, const QString&, Function, Function )));
+ connect(designerPart, SIGNAL(removedFunction(DesignerType, const QString&, Function )),
+ API::getInstance()->languageSupport(),
+ SLOT(removeFunction(DesignerType, const QString&, Function )));
+ connect(designerPart, SIGNAL(editFunction(DesignerType, const QString&, const QString& )),
+ API::getInstance()->languageSupport(),
+ SLOT(openFunction(DesignerType, const QString&, const QString& )));
+ connect(designerPart, SIGNAL(editSource(DesignerType, const QString& )),
+ API::getInstance()->languageSupport(),
+ SLOT(openSource(DesignerType, const QString& )));
+ connect(designerPart, SIGNAL(newStatus(const QString &, int)),
+ this, SLOT(slotNewDesignerStatus(const QString &, int)));
+ }
+}
+
+void PartController::integrateTextEditorPart(KTextEditor::Document* doc)
+{
+ // There's shortcut conflict between Kate and the debugger, resolve
+ // it here. Ideally, the should be some standard mechanism, configurable
+ // by config files.
+ // However, it does not exists and situation here some rare commands
+ // like "Dynamic word wrap" or "Show line numbers" from Kate take
+ // all possible shortcuts, leaving us with IDE that has no shortcuts for
+ // debugger, is very bad.
+ //
+ // We could try to handle this in debugger, but that would require
+ // the debugger to intercept all new KTextEditor::View creations, which is
+ // not possible.
+
+
+ if ( !doc ) return;
+
+ connect( doc, SIGNAL(textChanged()), this, SLOT(textChanged()) );
+ connect( doc, SIGNAL(fileNameChanged()),
+ this, SLOT(slotDocumentUrlChanged()));
+
+ if( doc->widget() )
+ {
+ connect( doc->widget(), SIGNAL(dropEventPass(QDropEvent *)),
+ TopLevel::getInstance()->main(), SLOT(slotDropEvent(QDropEvent *)) );
+ }
+
+ if ( KTextEditor::View * view = dynamic_cast<KTextEditor::View*>( doc->widget() ) )
+ {
+ KActionCollection* c = view->actionCollection();
+ // Be extra carefull, in case the part either don't provide those
+ // action, or uses different shortcuts.
+
+ if (KAction* a = c->action("view_folding_markers"))
+ {
+ if (a->shortcut() == KShortcut(Key_F9))
+ a->setShortcut(KShortcut());
+ }
+
+ if (KAction* a = c->action("view_dynamic_word_wrap"))
+ {
+ if (a->shortcut() == KShortcut(Key_F10))
+ a->setShortcut(KShortcut());
+ }
+
+ if (KAction* a = c->action("view_line_numbers"))
+ {
+ if (a->shortcut() == KShortcut(Key_F11))
+ a->setShortcut(KShortcut());
+ }
+ }
+
+ //EditorProxy::getInstance()->installPopup(doc, contextPopupMenu());
+
+ // What's potentially problematic is that this signal isn't officially part of the
+ // KTextEditor::View interface. It is nevertheless there, and used in kate and kwrite.
+ // There doesn't seem to be any othere way of making this work with katepart, and since
+ // signals are dynamic, if we try to connect to an editorpart that lacks this signal,
+ // all we get is a runtime warning. At this point in time we are only really supported
+ // by katepart anyway so IMHO this hack is justified. //teatime
+ QPtrList<KTextEditor::View> list = doc->views();
+ QPtrListIterator<KTextEditor::View> it( list );
+ while ( it.current() )
+ {
+ connect( it, SIGNAL( newStatus() ), this, SLOT( slotNewStatus() ) );
+ ++it;
+ }
+}
+
+void PartController::slotPartAdded( KParts::Part * part )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part ) )
+ {
+ updatePartURL( ro_part );
+ }
+
+ updateMenuItems();
+}
+
+void PartController::slotPartRemoved( KParts::Part * part )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ _partURLMap.remove( static_cast<KParts::ReadOnlyPart*>(part) );
+
+ if ( part == m_currentActivePart )
+ {
+ m_removingActivePart = true;
+ }
+
+ updateMenuItems();
+}
+
+void PartController::updatePartURL( KParts::ReadOnlyPart * ro_part )
+{
+ if ( ro_part->url().isEmpty() )
+ {
+ kdDebug(9000) << "updatePartURL() called with empty URL for part: " << ro_part << endl;
+ return;
+ }
+ _partURLMap[ ro_part ] = ro_part->url();
+}
+
+bool PartController::partURLHasChanged( KParts::ReadOnlyPart * ro_part )
+{
+ if ( _partURLMap.contains( ro_part ) && !ro_part->url().isEmpty() )
+ {
+ if ( _partURLMap[ ro_part ] != ro_part->url() )
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+KURL PartController::storedURLForPart( KParts::ReadOnlyPart * ro_part )
+{
+ if ( _partURLMap.contains( ro_part ) )
+ {
+ return _partURLMap[ ro_part ];
+ }
+ return KURL();
+}
+
+
+void PartController::slotUploadFinished()
+{
+ KParts::ReadOnlyPart *ro_part = const_cast<KParts::ReadOnlyPart*>( dynamic_cast<const KParts::ReadOnlyPart*>(sender()) );
+ if ( !ro_part ) return;
+
+ if ( partURLHasChanged( ro_part ) )
+ {
+ emit partURLChanged( ro_part );
+ updatePartURL( ro_part );
+ }
+}
+
+KParts::ReadOnlyPart *PartController::partForURL(const KURL &url)
+{
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current());
+ if (ro_part && url.path() == ro_part->url().path())
+ return ro_part;
+ }
+ return 0;
+}
+
+KParts::Part * PartController::partForWidget( const QWidget * widget )
+{
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ if ( it.current()->widget() == widget )
+ {
+ return *it;
+ }
+ }
+ return 0;
+}
+
+
+void PartController::activatePart(KParts::Part *part)
+{
+ if ( !part ) return;
+
+ QWidget * widget = EditorProxy::getInstance()->widgetForPart( part );
+ if (widget)
+ {
+ TopLevel::getInstance()->raiseView( widget );
+ widget->show();
+ widget->setFocus();
+ }
+
+ setActivePart(part);
+
+ QWidget* w2 = EditorProxy::getInstance()->widgetForPart( part );
+ if (w2 != widget)
+ w2->setFocus();
+}
+
+bool PartController::closePart(KParts::Part *part)
+{
+ KParts::ReadOnlyPart * ro_part =
+ dynamic_cast<KParts::ReadOnlyPart*>( part );
+
+ if ( !ro_part ) return true;
+
+ KURL url = ro_part->url();
+
+ if (QWidget* w = EditorProxy::getInstance()->topWidgetForPart( part ) )
+ {
+ if ( MultiBuffer *multiBuffer = dynamic_cast<MultiBuffer*>( w ) )
+ {
+ kdDebug(9000) << "About to delete MultiBuffered document..."
+ << " numberOfBuffers: " << multiBuffer->numberOfBuffers()
+ << " isActivated: " << multiBuffer->isActivated()
+ << endl;
+ if ( !multiBuffer->closeURL( url ) )
+ return false;
+
+ if ( multiBuffer->numberOfBuffers() == 0
+ || !multiBuffer->isActivated() )
+ {
+ TopLevel::getInstance()->removeView( w );
+ _dirtyDocuments.remove( static_cast<KParts::ReadWritePart*>( ro_part ) );
+ emit closedFile( url );
+/* kdDebug(9000) << "Deleting MultiBuffer Part" << endl;*/
+ TopLevel::getInstance()->main()->guiFactory()->removeClient( part );
+ delete part;
+/* kdDebug(9000) << "DeleteLater Actual MultiBuffer" << endl;*/
+ multiBuffer->deleteLater();
+ return true;
+ }
+ else
+ {
+/* kdDebug(9000) << "Deleting MultiBuffer Part" << endl;*/
+ _dirtyDocuments.remove( static_cast<KParts::ReadWritePart*>( ro_part ) );
+ TopLevel::getInstance()->main()->guiFactory()->removeClient( part );
+ emit closedFile( url );
+ delete part;
+ // Switch to a remaining buffer
+ setActivePart( multiBuffer->activeBuffer() );
+ return true;
+ }
+ }
+ else if ( !ro_part->closeURL() )
+ return false;
+ TopLevel::getInstance()->removeView( w );
+ }
+ else if ( !ro_part->closeURL() )
+ return false;
+ TopLevel::getInstance()->main()->guiFactory()->removeClient( part );
+
+ _dirtyDocuments.remove( static_cast<KParts::ReadWritePart*>( ro_part ) );
+ emit closedFile( url );
+
+/* kdDebug(9000) << "Deleting Regular Part" << endl;*/
+ delete part;
+ return true;
+}
+
+
+void PartController::updateMenuItems()
+{
+ bool hasWriteParts = false;
+ bool hasReadOnlyParts = false;
+
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ if (it.current()->inherits("KParts::ReadWritePart"))
+ hasWriteParts = true;
+ if (it.current()->inherits("KParts::ReadOnlyPart"))
+ hasReadOnlyParts = true;
+ }
+
+ m_saveAllFilesAction->setEnabled(hasWriteParts);
+ m_revertAllFilesAction->setEnabled(hasWriteParts);
+ m_closeWindowAction->setEnabled(hasReadOnlyParts);
+ m_closeAllWindowsAction->setEnabled(hasReadOnlyParts);
+ m_closeOtherWindowsAction->setEnabled(hasReadOnlyParts);
+
+ m_backAction->setEnabled( !m_backHistory.isEmpty() );
+}
+
+void PartController::slotRevertAllFiles()
+{
+ revertAllFiles();
+}
+
+void PartController::reloadFile( const KURL & url )
+{
+ KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( partForURL( url ) );
+ if ( part )
+ {
+ if ( part->isModified() )
+ {
+ if ( KMessageBox::warningYesNo( TopLevel::getInstance()->main(),
+ i18n( "The file \"%1\" is modified in memory. Are you sure you want to reload it? (Local changes will be lost.)" ).arg( url.path() ),
+ i18n( "File is Modified" ), i18n("Reload"), i18n("Do Not Reload") ) == KMessageBox::Yes )
+ {
+ part->setModified( false );
+ }
+ else
+ {
+ return;
+ }
+ }
+
+ unsigned int line = 0; unsigned int col = 0;
+ KTextEditor::ViewCursorInterface * iface = dynamic_cast<KTextEditor::ViewCursorInterface*>( part->widget() );
+ if (iface)
+ {
+ iface->cursorPositionReal( &line, &col );
+ }
+
+ part->openURL( url );
+
+ _dirtyDocuments.remove( part );
+ emit documentChangedState( url, Clean );
+
+ if ( iface )
+ {
+ iface->setCursorPositionReal( line, col );
+ }
+ }
+}
+
+void PartController::revertFiles( const KURL::List & list )
+{
+ KURL::List::ConstIterator it = list.begin();
+ while ( it != list.end() )
+ {
+ reloadFile( *it );
+ ++it;
+ }
+}
+
+void PartController::revertAllFiles()
+{
+ revertFiles( openURLs() );
+}
+
+void PartController::slotCloseWindow()
+{
+ closePart( activePart() );
+}
+
+KURL::List PartController::modifiedDocuments()
+{
+ KURL::List modFiles;
+
+ QPtrListIterator<KParts::Part> it( *parts() );
+ while( it.current() )
+ {
+ KParts::ReadWritePart *rw_part = dynamic_cast<KParts::ReadWritePart*>(it.current());
+ if ( rw_part && rw_part->isModified() )
+ {
+ modFiles << rw_part->url();
+ }
+ ++it;
+ }
+ return modFiles;
+}
+
+void PartController::slotSave()
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( activePart() ) )
+ {
+ saveFile( part->url() );
+ }
+}
+
+void PartController::slotReload()
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ if ( KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( activePart() ) )
+ {
+ reloadFile( part->url() );
+ }
+}
+
+void PartController::slotSaveAllFiles()
+{
+ saveAllFiles();
+}
+
+bool PartController::saveFile( const KURL & url, bool force )
+{
+ KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( partForURL( url ) );
+ if ( !part ) return true;
+
+ switch( documentState( url ) )
+ {
+ case Clean:
+ if ( !force )
+ {
+ return true;
+ }
+ kdDebug(9000) << "Forced save" << endl;
+ break;
+
+ case Modified:
+ kdDebug(9000) << "Normal save" << endl;
+ break;
+
+ case Dirty:
+ case DirtyAndModified:
+ {
+ int code = KMessageBox::warningYesNoCancel( TopLevel::getInstance()->main(),
+ i18n("The file \"%1\" is modified on disk.\n\nAre you sure you want to overwrite it? (External changes will be lost.)").arg( url.path() ),
+ i18n("File Externally Modified"), i18n("Overwrite"), i18n("Do Not Overwrite") );
+ if ( code == KMessageBox::Yes )
+ {
+ kdDebug(9000) << "Dirty save!!" << endl;
+ }
+ else if ( code == KMessageBox::No )
+ {
+ return true;
+ }
+ else
+ {
+ return false; // a 'false' return means to interrupt the process that caused the save
+ }
+ }
+ break;
+
+ default:
+ ;
+ }
+
+ if ( part->save() )
+ {
+ _dirtyDocuments.remove( part );
+ emit documentChangedState( url, Clean );
+ emit savedFile( url );
+ }
+
+ return true;
+}
+
+bool PartController::saveAllFiles()
+{
+ return saveFiles( openURLs() );
+}
+
+bool PartController::saveFiles( KURL::List const & filelist )
+{
+ KURL::List::ConstIterator it = filelist.begin();
+ while ( it != filelist.end() )
+ {
+ if (saveFile( *it )==false)
+ return false; //user cancelled
+ ++it;
+ }
+ return true;
+}
+
+bool PartController::querySaveFiles()
+{
+ return saveFilesDialog( KURL::List() );
+}
+
+void PartController::clearModified( KURL::List const & filelist )
+{
+ KURL::List::ConstIterator it = filelist.begin();
+ while ( it != filelist.end() )
+ {
+ KParts::ReadWritePart * rw_part = dynamic_cast<KParts::ReadWritePart*>( partForURL( *it ) );
+ if ( rw_part )
+ {
+ rw_part->setModified( false );
+ }
+ ++it;
+ }
+}
+
+bool PartController::saveFilesDialog( KURL::List const & ignoreList )
+{
+ KURL::List modList = modifiedDocuments();
+
+ if ( modList.count() > 0 && modList != ignoreList )
+ {
+ KSaveSelectDialog dlg( modList, ignoreList, TopLevel::getInstance()->main() );
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ saveFiles( dlg.filesToSave() );
+ clearModified( dlg.filesNotToSave() );
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool PartController::closeFilesDialog( KURL::List const & ignoreList )
+{
+ if ( !saveFilesDialog( ignoreList ) ) return false;
+
+ QPtrList<KParts::Part> partList( *parts() );
+ QPtrListIterator<KParts::Part> it( partList );
+ while ( KParts::Part* part = it.current() )
+ {
+ KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part );
+ if ( ro_part && !ignoreList.contains( ro_part->url() ) || !ro_part )
+ {
+ closePart( part );
+ }
+ ++it;
+ }
+ return true;
+}
+
+bool PartController::closeFiles( const KURL::List & list )
+{
+ KURL::List::ConstIterator it = list.begin();
+ while ( it != list.end() )
+ {
+ if ( !closePart( partForURL( *it ) ) )
+ {
+ return false;
+ }
+ ++it;
+ }
+ return true;
+}
+
+bool PartController::closeFile( const KURL & url )
+{
+ return closePart( partForURL( url ) );
+}
+
+bool PartController::closeAllFiles()
+{
+ return closeFilesDialog( KURL::List() );
+}
+
+void PartController::slotCloseAllWindows()
+{
+ closeAllFiles();
+}
+
+bool PartController::closeAllOthers( const KURL & url )
+{
+ KURL::List ignoreList;
+ ignoreList.append( url );
+
+ return closeFilesDialog( ignoreList );
+}
+
+
+void PartController::slotCloseOtherWindows()
+{
+ if ( KParts::ReadOnlyPart * active = dynamic_cast<KParts::ReadOnlyPart*>( activePart() ) )
+ {
+ closeAllOthers( active->url() );
+ }
+}
+
+void PartController::slotOpenFile()
+{
+ QString DefaultEncoding;
+ if ( QDomDocument * projectDom = API::getInstance()->projectDom() )
+ {
+ DefaultEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", QString::null );
+ }
+
+ if ( DefaultEncoding.isEmpty() )
+ {
+ // have a peek at katepart's settings:
+ KConfig * config = kapp->config();
+ config->setGroup("Kate Document Defaults");
+ DefaultEncoding = config->readEntry("Encoding", QString::null );
+ }
+
+ KEncodingFileDialog::Result result = KEncodingFileDialog::getOpenURLsAndEncoding( DefaultEncoding, QString::null,
+ QString::null, TopLevel::getInstance()->main(), QString::null );
+
+ for ( KURL::List::Iterator it = result.URLs.begin(); it != result.URLs.end(); ++it )
+ {
+ m_presetEncoding = result.encoding;
+ editDocument( *it );
+ }
+}
+
+void PartController::slotOpenRecent( const KURL& url )
+{
+ editDocument( url );
+ // stupid bugfix - don't allow an active item in the list
+ m_openRecentAction->setCurrentItem( -1 );
+}
+
+bool PartController::readyToClose()
+{
+ blockSignals( true );
+
+ closeAllFiles(); // this should never return false, as the files are already saved
+
+ return true;
+}
+
+void PartController::slotActivePartChanged( KParts::Part *part )
+{
+ kdDebug(9000) << k_funcinfo << part << endl;
+
+ if ( !m_isJumping && !m_removingActivePart )
+ {
+ if ( KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>(m_currentActivePart) )
+ {
+ addHistoryEntry( ro_part );
+ }
+ }
+
+ m_currentActivePart = part;
+ m_removingActivePart = false;
+
+ if (part) {
+ KXMLGUIClient* client = dynamic_cast<KXMLGUIClient*>(part->widget());
+ if (client) Core::setupShourtcutTips(client);
+ }
+
+ updateMenuItems();
+ QTimer::singleShot( 100, this, SLOT(slotWaitForFactoryHack()) );
+}
+
+void PartController::showPart( KParts::Part* part, const QString& name, const QString& shortDescription )
+{
+ if (!part->widget()) {
+ /// @todo error handling
+ return; // to avoid later crash
+ }
+
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ if( it.current() == part ){
+ // part already embedded
+ activatePart( it.current() );
+ return;
+ }
+ }
+
+ // embed the part
+ TopLevel::getInstance()->embedPartView( part->widget(), name, shortDescription );
+ addPart( part );
+}
+
+void PartController::slotDocumentDirty( Kate::Document * d, bool isModified, unsigned char reason )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ // KTextEditor::Document * doc = reinterpret_cast<KTextEditor::Document*>( d ); // theoretically unsafe in MI scenario
+ KTextEditor::Document * doc = 0;
+
+ QPtrListIterator<KParts::Part> it( *parts() );
+ while( it.current() )
+ {
+ if ( (void*)it.current() == (void*)d )
+ {
+ doc = dynamic_cast<KTextEditor::Document*>( it.current() );
+ break;
+ }
+ ++it;
+ }
+
+ // this is a bit strange, but in order to avoid weird crashes
+ // down in KDirWatcher, we want to step off the call chain before
+ // opening any messageboxes
+ if ( doc )
+ {
+ ModificationData * p = new ModificationData;
+ p->doc = doc;
+ p->isModified = isModified;
+ p->reason = reason;
+ KDevJobTimer::singleShot( 0, this, SLOT(slotDocumentDirtyStepTwo(void*)), p );
+ }
+}
+
+void PartController::slotDocumentDirtyStepTwo( void * payload )
+{
+ if ( !payload ) return;
+
+ ModificationData * p = reinterpret_cast<ModificationData*>( payload );
+ KTextEditor::Document * doc = p->doc;
+
+ // let's make sure the document is still loaded
+ bool haveDocument = false;
+ if( const QPtrList<KParts::Part> * partlist = parts() )
+ {
+ QPtrListIterator<KParts::Part> it( *partlist );
+ while ( KParts::Part * part = it.current() )
+ {
+ if ( p->doc == dynamic_cast<KTextEditor::Document*>( part ) )
+ {
+ haveDocument = true;
+ break;
+ }
+ ++it;
+ }
+ }
+ if ( !haveDocument ) return;
+
+ bool isModified = p->isModified;
+ unsigned char reason = p->reason;
+ delete p;
+
+ KURL url = storedURLForPart( doc );
+ if ( url.isEmpty() )
+ {
+ kdDebug(9000) << "Warning!! the stored url is empty. Bailing out!" << endl;
+ }
+
+ if ( reason > 0 )
+ {
+ if ( !_dirtyDocuments.contains( doc ) )
+ {
+ _dirtyDocuments.append( doc );
+ }
+
+ if ( reactToDirty( url, reason ) )
+ {
+ // file has been reloaded
+ emit documentChangedState( url, Clean );
+ _dirtyDocuments.remove( doc );
+ }
+ else
+ {
+ doEmitState( url );
+ }
+ }
+ else
+ {
+ _dirtyDocuments.remove( doc );
+ emit documentChangedState( url, Clean );
+ }
+
+ kdDebug(9000) << doc->url().url() << endl;
+ kdDebug(9000) << isModified << endl;
+ kdDebug(9000) << reason << endl;
+}
+
+bool PartController::isDirty( KURL const & url )
+{
+ return _dirtyDocuments.contains( static_cast<KTextEditor::Document*>( partForURL( url ) ) );
+}
+
+bool PartController::reactToDirty( KURL const & url, unsigned char reason )
+{
+ KConfig *config = kapp->config();
+ config->setGroup("Editor");
+ QString dirtyAction = config->readEntry( "DirtyAction" );
+
+ if ( dirtyAction == "nothing" ) return false;
+
+ bool isModified = true;
+ if( KParts::ReadWritePart * part = dynamic_cast<KParts::ReadWritePart*>( partForURL( url ) ) )
+ {
+ isModified = part->isModified();
+ }
+ else
+ {
+ kdDebug(9000) << k_funcinfo << " Warning. Not a ReadWritePart." << endl;
+ return false;
+ }
+
+ if ( isModified )
+ {
+ KMessageBox::sorry( TopLevel::getInstance()->main(),
+ i18n("Conflict: The file \"%1\" has changed on disk while being modified in memory.\n\n"
+ "You should investigate before saving to make sure you are not losing data.").arg( url.path() ),
+ i18n("Conflict") );
+ return false;
+ }
+
+ if ( reason == 3 ) // means the file was deleted
+ {
+ KMessageBox::sorry( TopLevel::getInstance()->main(),
+ i18n("Warning: The file \"%1\" has been deleted on disk.\n\n"
+ "If this was not your intention, make sure to save this file now.").arg( url.path() ),
+ i18n("File Deleted") );
+ return false;
+ }
+
+ if ( dirtyAction == "alert" )
+ {
+ if ( KMessageBox::warningYesNo( TopLevel::getInstance()->main(),
+ i18n("The file \"%1\" has changed on disk.\n\nDo you want to reload it?").arg( url.path() ),
+ i18n("File Changed"), i18n("Reload"), i18n("Do Not Reload") ) == KMessageBox::No )
+ {
+ return false;
+ }
+ }
+
+ // here we either answered yes above or are in autoreload mode
+ reloadFile( url );
+
+ return true;
+}
+
+void PartController::slotNewDesignerStatus(const QString &formName, int status)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+ kdDebug(9000) << " formName: " << formName << ", status: " << status << endl;
+ emit documentChangedState( KURL::fromPathOrURL(formName), DocumentState(status) );
+}
+
+void PartController::slotNewStatus( )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ QObject * senderobj = const_cast<QObject*>( sender() );
+ KTextEditor::View * view = dynamic_cast<KTextEditor::View*>( senderobj );
+ if ( view )
+ {
+ doEmitState( view->document()->url() );
+ }
+}
+
+DocumentState PartController::documentState( KURL const & url )
+{
+ KParts::ReadWritePart * rw_part = dynamic_cast<KParts::ReadWritePart*>( partForURL( url ) );
+ if ( !rw_part ) return Clean;
+
+ DocumentState state = Clean;
+ if ( rw_part->isModified() )
+ {
+ state = Modified;
+ }
+
+ if ( isDirty( url ) )
+ {
+ if ( state == Modified )
+ {
+ state = DirtyAndModified;
+ }
+ else
+ {
+ state = Dirty;
+ }
+ }
+
+ return state;
+}
+
+void PartController::doEmitState( KURL const & url )
+{
+ emit documentChangedState( url, documentState( url ) );
+}
+
+KURL::List PartController::openURLs( )
+{
+ KURL::List list;
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ if ( KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current()) )
+ {
+ list << ro_part->url();
+ }
+ }
+ return list;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+//BEGIN History methods
+
+PartController::HistoryEntry::HistoryEntry( const KURL & u, int l, int c)
+ : url(u), line(l), col(c)
+{
+ id = abs( QTime::currentTime().msecsTo( QTime() ) ); // should provide a reasonably unique number
+}
+
+void PartController::slotBack()
+{
+ HistoryEntry thatEntry = m_backHistory.front();
+ m_backHistory.pop_front();
+ m_backAction->setEnabled( !m_backHistory.isEmpty() );
+
+ HistoryEntry thisEntry = createHistoryEntry();
+ if ( !thisEntry.url.isEmpty() )
+ {
+ m_forwardHistory.push_front( thisEntry );
+ m_forwardAction->setEnabled( true );
+ }
+
+ jumpTo( thatEntry );
+}
+
+void PartController::slotForward()
+{
+ HistoryEntry thatEntry = m_forwardHistory.front();
+ m_forwardHistory.pop_front();
+ m_forwardAction->setEnabled( !m_forwardHistory.isEmpty() );
+
+ HistoryEntry thisEntry = createHistoryEntry();
+ if ( !thisEntry.url.isEmpty() )
+ {
+ m_backHistory.push_front( thisEntry );
+ m_backAction->setEnabled( true );
+ }
+
+ jumpTo( thatEntry );
+}
+
+void PartController::slotBackAboutToShow()
+{
+ KPopupMenu *popup = m_backAction->popupMenu();
+ popup->clear();
+
+ if ( m_backHistory.isEmpty()) return;
+
+ int i = 0;
+ QValueList<HistoryEntry>::ConstIterator it = m_backHistory.begin();
+ while( i < 10 && it != m_backHistory.end() )
+ {
+ popup->insertItem( (*it).url.fileName() + QString(" (%1)").arg( (*it).line +1), (*it).id );
+ ++i;
+ ++it;
+ }
+}
+
+void PartController::slotForwardAboutToShow( )
+{
+ KPopupMenu * popup = m_forwardAction->popupMenu();
+ popup->clear();
+
+ if ( m_forwardHistory.isEmpty() ) return;
+
+ int i = 0;
+ QValueList<HistoryEntry>::ConstIterator it = m_forwardHistory.begin();
+ while( i < 10 && it != m_forwardHistory.end() )
+ {
+ popup->insertItem( (*it).url.fileName() + QString(" (%1)").arg( (*it).line +1), (*it).id );
+ ++i;
+ ++it;
+ }
+}
+
+void PartController::slotBackPopupActivated( int id )
+{
+ QValueList<HistoryEntry>::Iterator it = m_backHistory.begin();
+ while( it != m_backHistory.end() )
+ {
+ if ( (*it).id == id )
+ {
+ HistoryEntry entry = *it;
+ m_backHistory.erase( m_backHistory.begin(), ++it );
+ m_backAction->setEnabled( !m_backHistory.isEmpty() );
+
+ HistoryEntry thisEntry = createHistoryEntry();
+ if ( !thisEntry.url.isEmpty() )
+ {
+ m_forwardHistory.push_front( thisEntry );
+ m_forwardAction->setEnabled( true );
+ }
+
+ jumpTo( entry );
+ return;
+ }
+ ++it;
+ }
+}
+
+void PartController::slotForwardPopupActivated( int id )
+{
+ QValueList<HistoryEntry>::Iterator it = m_forwardHistory.begin();
+ while( it != m_forwardHistory.end() )
+ {
+ if ( (*it).id == id )
+ {
+ HistoryEntry entry = *it;
+ m_forwardHistory.erase( m_forwardHistory.begin(), ++it );
+ m_forwardAction->setEnabled( !m_forwardHistory.isEmpty() );
+
+ HistoryEntry thisEntry = createHistoryEntry();
+ if ( !thisEntry.url.isEmpty() )
+ {
+ m_backHistory.push_front( thisEntry );
+ m_backAction->setEnabled( true );
+ }
+
+ jumpTo( entry );
+ return;
+ }
+ ++it;
+ }
+}
+
+void PartController::jumpTo( const HistoryEntry & entry )
+{
+ m_isJumping = true;
+ editDocument( entry.url, entry.line, entry.col );
+ m_isJumping = false;
+}
+
+
+PartController::HistoryEntry PartController::createHistoryEntry( KParts::ReadOnlyPart * ro_part ) {
+ if( ro_part == 0 )
+ ro_part = dynamic_cast<KParts::ReadOnlyPart*>( activePart() );
+
+ if ( !ro_part ) return HistoryEntry();
+ KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( ro_part->widget() );
+ if ( !cursorIface ) return HistoryEntry();
+
+ uint line = 0;
+ uint col = 0;
+ cursorIface->cursorPositionReal( &line, &col );
+
+ return HistoryEntry( ro_part->url(), line, col );
+}
+
+
+// this should be called _before_ a jump is made
+void PartController::addHistoryEntry( KParts::ReadOnlyPart * part )
+{
+ if ( m_isJumping ) return;
+
+ HistoryEntry thisEntry = createHistoryEntry( part );
+ if ( !thisEntry.url.isEmpty() )
+ {
+ HistoryEntry lastEntry = m_backHistory.front();
+ if ( (lastEntry.url.path() != thisEntry.url.path()) || (lastEntry.line != thisEntry.line) )
+ {
+ m_backHistory.push_front( thisEntry );
+ m_backAction->setEnabled( true );
+
+ m_forwardHistory.clear();
+ m_forwardAction->setEnabled( false );
+ }
+ else
+ {
+ kdDebug(9000) << "** avoiding to create duplicate history entry **" << endl;
+ }
+ }
+}
+
+//END History methods
+
+void PartController::slotWaitForFactoryHack( )
+{
+ //kdDebug(9000) << k_funcinfo << endl;
+
+ if ( !activePart() ) return;
+
+ if ( dynamic_cast<KTextEditor::View*>( activePart()->widget() ) )
+ {
+ if ( !activePart()->factory() )
+ {
+ QTimer::singleShot( 100, this, SLOT(slotWaitForFactoryHack()) );
+ return;
+ }
+ else
+ {
+ EditorProxy::getInstance()->installPopup( activePart() );
+ }
+ }
+
+ if ( MultiBuffer *multiBuffer =
+ dynamic_cast<MultiBuffer*>(
+ EditorProxy::getInstance()->topWidgetForPart( activePart() ) )
+ )
+ {
+ KURL url = dynamic_cast<KParts::ReadOnlyPart*>( activePart() )->url();
+ multiBuffer->activePartChanged( url );
+ // Really unfortunate, but the mainWindow relies upon this
+ // to set the tab's icon
+ emit documentChangedState( url, documentState( url ) );
+ }
+}
+
+KParts::ReadOnlyPart *PartController::qtDesignerPart()
+{
+ QPtrListIterator<KParts::Part> it(*parts());
+ for ( ; it.current(); ++it)
+ {
+ KInterfaceDesigner::Designer *des = dynamic_cast<KInterfaceDesigner::Designer*>(it.current());
+ if (des && des->designerType() == KInterfaceDesigner::QtDesigner)
+ return des;
+ }
+ return 0;
+}
+
+KTextEditor::Editor *PartController::openTextDocument( bool activate )
+{
+ KTextEditor::Editor *editorpart =
+ createEditorPart( activate, false, KURL( i18n("unnamed") ) );
+
+ if ( editorpart )
+ {
+ if ( !m_presetEncoding.isNull() )
+ {
+ KParts::BrowserExtension * extension =
+ KParts::BrowserExtension::childObject( editorpart );
+ if ( extension )
+ {
+ KParts::URLArgs args;
+ args.serviceType = QString( "text/plain;" ) + m_presetEncoding;
+ extension->setURLArgs(args);
+ }
+ m_presetEncoding = QString::null;
+ }
+
+ QWidget * widget =
+ EditorProxy::getInstance()->topWidgetForPart( editorpart );
+
+ addHistoryEntry();
+ integratePart(editorpart, KURL(i18n("unnamed")), widget, true, true);
+
+ EditorProxy::getInstance()->setLineNumber(editorpart, 0, 0);
+ }
+
+ return editorpart;
+}
+
+void PartController::textChanged()
+{
+ if ( KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( activePart() ) )
+ {
+ if ( KTextEditor::ViewCursorInterface * vci = dynamic_cast<KTextEditor::ViewCursorInterface*>( doc->widget() ) )
+ {
+ m_gotoLastEditPosAction->setEnabled( true );
+
+ m_lastEditPos.url = doc->url();
+ vci->cursorPosition( &m_lastEditPos.pos.first, &m_lastEditPos.pos.second );
+ }
+ }
+}
+
+void PartController::gotoLastEditPos()
+{
+ editDocument( m_lastEditPos.url, m_lastEditPos.pos.first, m_lastEditPos.pos.second );
+}
+
+void PartController::slotDocumentUrlChanged()
+{
+ QObject *obj = const_cast<QObject*>(sender());
+ KTextEditor::Document *doc = dynamic_cast<KTextEditor::Document*>( obj );
+ if (!doc)
+ return;
+
+ MultiBuffer *multiBuffer = dynamic_cast<MultiBuffer*>(
+ EditorProxy::getInstance()->findPartWidget( doc ));
+ if (!multiBuffer)
+ return;
+
+ multiBuffer->updateUrlForPart(doc, doc->url());
+ updatePartURL(doc);
+ emit partURLChanged(doc);
+}
+
+#include "partcontroller.moc"
+
diff --git a/src/partcontroller.h b/src/partcontroller.h
new file mode 100644
index 00000000..9aa4e226
--- /dev/null
+++ b/src/partcontroller.h
@@ -0,0 +1,232 @@
+#ifndef __PARTCONTROLLER_H__
+#define __PARTCONTROLLER_H__
+
+#include "kdevpartcontroller.h"
+
+#include <qwidget.h>
+#include <qdatetime.h>
+#include <qptrlist.h>
+#include <kurl.h>
+#include <qmap.h>
+#include <qguardedptr.h>
+#include <qpair.h>
+
+namespace KParts
+{
+ class Part;
+ class Factory;
+ class PartManager;
+ class ReadOnlyPart;
+ class ReadWritePart;
+}
+
+namespace KTextEditor
+{
+ class Document;
+ class Editor;
+}
+
+namespace Kate { class Document; }
+
+class QTabWidget;
+class QPopupMenu;
+class KAction;
+class KToolBarPopupAction;
+class KRecentFilesAction;
+class HTMLDocumentationPart;
+class HistoryEntry;
+class KDirWatch;
+
+/**
+Part controler implementation.
+*/
+class PartController : public KDevPartController
+{
+ Q_OBJECT
+
+public:
+
+ PartController(QWidget *toplevel);
+ static void createInstance(QWidget *parent);
+ static PartController *getInstance();
+
+ ///// KDevPartController interface
+
+ void setEncoding(const QString &encoding);
+ void editDocument(const KURL &inputUrl, int lineNum=-1, int col=-1);
+ void splitCurrentDocument(const KURL &inputUrl, int lineNum=-1, int col=-1);
+ void scrollToLineColumn(const KURL &url, int lineNum=-1, int col=-1, bool storeHistory = false );
+ void editDocumentInternal(const KURL &inputUrl, int lineNum=-1, int col=-1,
+ bool activate = true, bool addToCurrentBuffer = false );
+ void integrateTextEditorPart(KTextEditor::Document* doc);
+
+ void showDocument(const KURL &url, bool newWin = false);
+ void showPart( KParts::Part* part, const QString& name, const QString& shortDescription );
+
+ KParts::ReadOnlyPart *partForURL(const KURL &url);
+ KParts::ReadOnlyPart *qtDesignerPart();
+ KParts::Part * partForWidget( const QWidget * widget );
+
+ void activatePart( KParts::Part * part );
+ bool closePart( KParts::Part * part );
+
+ KURL::List openURLs();
+
+ bool querySaveFiles();
+
+ bool saveAllFiles();
+ bool saveFiles( const KURL::List & list);
+ bool saveFile( const KURL & url, bool force = false );
+
+ void revertAllFiles();
+ void revertFiles( const KURL::List & list );
+
+ bool closeAllFiles();
+ bool closeFiles( const KURL::List & list );
+
+ DocumentState documentState( KURL const & );
+
+ ////////////////////////////////////////
+
+ bool readyToClose();
+
+ bool closeFile( const KURL & );
+ bool closeAllOthers( const KURL & );
+ void reloadFile( const KURL & url );
+
+ KTextEditor::Editor *openTextDocument( bool activate = true );
+ KParts::Factory *findPartFactory(const QString &mimeType,
+ const QString &partType,
+ const QString &preferredName = QString::null );
+
+public slots:
+
+ void slotActivePartChanged( KParts::Part* part );
+ void slotCloseWindow();
+ void slotCloseOtherWindows();
+ void slotCloseAllWindows();
+
+ void slotSave();
+ void slotReload();
+
+protected:
+
+ ~PartController();
+
+private slots:
+
+ void slotWaitForFactoryHack();
+
+ void slotDocumentUrlChanged();
+ void slotSaveAllFiles();
+ void slotRevertAllFiles();
+
+ void slotOpenFile();
+ void slotOpenRecent(const KURL&);
+
+ void slotBack();
+ void slotForward();
+ void slotBackAboutToShow();
+ void slotForwardAboutToShow();
+ void slotBackPopupActivated( int id );
+ void slotForwardPopupActivated( int id );
+
+ void slotPartAdded( KParts::Part* );
+ void slotPartRemoved( KParts::Part* );
+
+ void slotUploadFinished();
+
+ void updateMenuItems();
+
+ void slotDocumentDirty( Kate::Document * doc, bool isModified, unsigned char reason );
+ void slotDocumentDirtyStepTwo( void * );
+ void slotNewStatus();
+ void slotNewDesignerStatus(const QString &formName, int status);
+ void textChanged();
+ void gotoLastEditPos();
+
+private:
+ KURL findURLInProject(const KURL& url);
+ KParts::Part* findOpenDocument(const KURL& url);
+
+ void setupActions();
+
+ bool closeFilesDialog( KURL::List const & ignoreList );
+ bool saveFilesDialog( KURL::List const & ignoreList );
+
+ void doEmitState( KURL const & );
+
+ KTextEditor::Editor * createEditorPart( bool activate,
+ bool addToCurrentBuffer = false,
+ const KURL &url = KURL() );
+
+ void integratePart(KParts::Part *part, const KURL &url, QWidget* widget = 0,
+ bool isTextEditor=false, bool activate=true,
+ bool addToCurrentBuffer = false );
+
+ // returns a list of modified documents
+ KURL::List modifiedDocuments();
+ void clearModified( KURL::List const & filelist );
+
+ bool isDirty( KURL const & url );
+ bool reactToDirty( KURL const & url, unsigned char reason );
+
+ KURL storedURLForPart( KParts::ReadOnlyPart * );
+ void updatePartURL( KParts::ReadOnlyPart * );
+ bool partURLHasChanged( KParts::ReadOnlyPart * );
+
+ static PartController *s_instance;
+
+ KAction *m_closeWindowAction, *m_saveAllFilesAction, *m_revertAllFilesAction;
+ KAction *m_closeAllWindowsAction, *m_closeOtherWindowsAction;
+ KRecentFilesAction *m_openRecentAction;
+ QString m_presetEncoding;
+
+ KToolBarPopupAction* m_backAction;
+ KToolBarPopupAction* m_forwardAction;
+ KAction * m_gotoLastEditPosAction;
+
+ bool m_openNextAsText;
+
+ QValueList<KParts::ReadWritePart*> _dirtyDocuments;
+
+ QMap< KParts::ReadOnlyPart*, KURL > _partURLMap; // used to note when a URL changes (a file changes name)
+
+ QGuardedPtr<KParts::Factory> _editorFactory;
+
+ struct HistoryEntry
+ {
+ HistoryEntry() {}
+ HistoryEntry( const KURL & url, int line, int col );
+
+ KURL url;
+ int line;
+ int col;
+ int id;
+ };
+
+ void addHistoryEntry( KParts::ReadOnlyPart * part = 0 );
+ HistoryEntry createHistoryEntry( KParts::ReadOnlyPart * part = 0 );
+ void jumpTo( const HistoryEntry & );
+
+ QValueList<HistoryEntry> m_backHistory;
+ QValueList<HistoryEntry> m_forwardHistory;
+ bool m_isJumping;
+
+ struct LastEditPos
+ {
+ KURL url;
+ QPair<unsigned int,unsigned int> pos;
+
+ LastEditPos() : pos( -1, -1) {}
+ };
+
+ LastEditPos m_lastEditPos;
+
+ KParts::Part * m_currentActivePart;
+ bool m_removingActivePart;
+};
+
+
+
+#endif
diff --git a/src/plugincontroller.cpp b/src/plugincontroller.cpp
new file mode 100644
index 00000000..2dc01654
--- /dev/null
+++ b/src/plugincontroller.cpp
@@ -0,0 +1,391 @@
+#include <qfile.h>
+#include <qvbox.h>
+
+#include <kcmdlineargs.h>
+#include <kapplication.h>
+#include <klibloader.h>
+#include <kservice.h>
+#include <ktrader.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kmainwindow.h>
+#include <kparts/componentfactory.h>
+#include <assert.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kcmdlineargs.h>
+#include <kstandarddirs.h>
+#include <kstatusbar.h>
+#include <kiconloader.h>
+
+#include <kdevapi.h>
+#include <kdevplugin.h>
+#include <kdevmakefrontend.h>
+#include <kdevappfrontend.h>
+#include <kdevdifffrontend.h>
+#include <kdevsourceformatter.h>
+#include <kdevcreatefile.h>
+#include <kdevplugininfo.h>
+#include <kaction.h>
+
+#include <profileengine.h>
+
+#include "core.h"
+#include "api.h"
+#include "toplevel.h"
+#include "projectmanager.h"
+//#include "partselectwidget.h"
+#include "domutil.h"
+#include "plugincontroller.h"
+#include "pluginselectdialog.h"
+
+#include "shellextension.h"
+
+// a separate method in this anonymous namespace to avoid having it all
+// inline in plugincontroller.h
+namespace
+{
+ template <class ComponentType>
+ ComponentType *loadDefaultPart( const QString &serviceType )
+ {
+ KTrader::OfferList offers = KTrader::self()->query(serviceType, QString("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION));
+ KTrader::OfferList::ConstIterator serviceIt = offers.begin();
+ for ( ; serviceIt != offers.end(); ++serviceIt ) {
+ KService::Ptr service = *serviceIt;
+
+ ComponentType *part = KParts::ComponentFactory
+ ::createInstanceFromService< ComponentType >( service, API::getInstance(), 0,
+ PluginController::argumentsFromService( service ) );
+
+ if ( part )
+ return part;
+ }
+ return 0;
+ }
+}
+
+PluginController *PluginController::s_instance = 0;
+
+
+PluginController *PluginController::getInstance()
+{
+ if (!s_instance)
+ s_instance = new PluginController();
+ return s_instance;
+}
+
+
+PluginController::PluginController()
+ : KDevPluginController()
+{
+/* m_defaultProfile = QString::fromLatin1( "FullIDE" );
+ m_defaultProfilePath = kapp->dirs()->localkdedir() + "/" +
+ KStandardDirs::kde_default( "data" ) +
+ QString::fromLatin1("/kdevelop/profiles/FullIDE");*/
+
+ KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
+ if( args->isSet("profile") ){
+ m_profile = QString::fromLocal8Bit( args->getOption("profile") );
+ } else {
+ m_profile = ShellExtension::getInstance()->defaultProfile();
+ }
+
+}
+
+
+void PluginController::loadInitialPlugins()
+{
+ loadCorePlugins();
+
+ QStringList disableList;
+ Profile * profile = engine().findProfile( currentProfile() );
+ if( profile )
+ {
+ Profile::EntryList disableEntryList = profile->list( Profile::ExplicitDisable );
+ for ( Profile::EntryList::const_iterator it = disableEntryList.constBegin(); it != disableEntryList.constEnd(); ++it )
+ {
+ disableList << (*it).name;
+ }
+ }
+ loadGlobalPlugins( disableList );
+}
+
+
+PluginController::~PluginController()
+{
+ unloadPlugins();
+}
+
+void PluginController::loadCorePlugins()
+{
+ KTrader::OfferList coreOffers = m_engine.offers(m_profile, ProfileEngine::Core);
+ loadPlugins( coreOffers );
+}
+
+void PluginController::loadGlobalPlugins( const QStringList & ignorePlugins )
+{
+ KTrader::OfferList globalOffers = m_engine.offers(m_profile, ProfileEngine::Global);
+ loadPlugins( globalOffers, ignorePlugins );
+}
+
+void PluginController::loadProjectPlugins( const QStringList & ignorePlugins )
+{
+ KTrader::OfferList projectOffers = m_engine.offers(m_profile, ProfileEngine::Project);
+ loadPlugins( projectOffers, ignorePlugins );
+}
+
+void PluginController::loadPlugins( KTrader::OfferList offers, const QStringList & ignorePlugins )
+{
+
+ TopLevel::getInstance()->main()->setFocus();
+ for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it)
+ {
+ QString name = (*it)->desktopEntryName();
+
+ // Check if it is already loaded or shouldn't be
+ if( m_parts[ name ] != 0 || ignorePlugins.contains( name ) )
+ continue;
+
+ emit loadingPlugin(i18n("Loading: %1").arg((*it)->genericName()));
+
+ KDevPlugin *plugin = loadPlugin( *it );
+ if ( plugin )
+ {
+ m_parts.insert( name, plugin );
+ integratePart( plugin );
+ }
+ }
+}
+
+void PluginController::unloadPlugins()
+{
+ for( QDictIterator<KDevPlugin> it( m_parts ); !it.isEmpty(); )
+ {
+ KDevPlugin* part = it.current();
+ removePart( part );
+ m_parts.remove( it.currentKey() );
+ delete part;
+ }
+}
+
+void PluginController::unloadProjectPlugins( )
+{
+ // this is nasty, but we need to unload the version control plugin too, and the
+ // right moment to do this is here
+ KTrader::OfferList offers = KTrader::self()->query("KDevelop/VersionControl", "");
+
+ offers += m_engine.offers(m_profile, ProfileEngine::Project);
+ for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it)
+ {
+ QString name = (*it)->desktopEntryName();
+
+ if ( KDevPlugin * plugin = m_parts[ name ] )
+ {
+ kdDebug(9000) << " *** Removing: " << name << endl;
+ removeAndForgetPart( name, plugin );
+ delete plugin;
+ }
+ }
+}
+
+void PluginController::unloadPlugins( QStringList const & unloadParts )
+{
+ QStringList::ConstIterator it = unloadParts.begin();
+ while ( it != unloadParts.end() )
+ {
+ KDevPlugin* part = m_parts[ *it ];
+ if( part )
+ {
+ kdDebug(9000) << " *** Removing: " << *it << endl;
+ removePart( part );
+ m_parts.remove( *it );
+ delete part;
+ }
+ ++it;
+ }
+}
+
+KDevPlugin *PluginController::loadPlugin( const KService::Ptr &service )
+{
+ int err = 0;
+ KDevPlugin * pl = KParts::ComponentFactory
+ ::createInstanceFromService<KDevPlugin>( service, API::getInstance(), 0,
+ argumentsFromService( service ), &err );
+ if (!pl)
+ {
+ KMessageBox::error(
+ 0,
+ i18n("<b>Could not load plugin</b><br>"
+ "Plugin %1 could not be loaded<br>"
+ "Library loader error: %2").arg(service->name()).
+ arg(KLibLoader::self()->lastErrorMessage()),
+ i18n("Could not load plugin"));
+ }
+// kdDebug() << "ERR: " << err << endl;
+ return pl;
+}
+
+QStringList PluginController::argumentsFromService( const KService::Ptr &service )
+{
+ QStringList args;
+ if ( !service )
+ // service is a reference to a pointer, so a check whether it is 0 is still required
+ return args;
+ QVariant prop = service->property( "X-KDevelop-Args" );
+ if ( prop.isValid() )
+ args = QStringList::split( " ", prop.toString() );
+ return args;
+}
+
+void PluginController::integratePart(KXMLGUIClient *part)
+{
+ if ( ! part ) return;
+ Core::setupShourtcutTips(part);
+
+ TopLevel::getInstance()->main()->guiFactory()->addClient(part);
+ connect( part->actionCollection(), SIGNAL( actionStatusText( const QString & ) ),
+ TopLevel::getInstance()->main()->actionCollection(), SIGNAL( actionStatusText( const QString & ) ) );
+}
+
+void PluginController::integrateAndRememberPart(const QString &name, KDevPlugin *part)
+{
+ m_parts.insert(name, part);
+ integratePart(part);
+}
+
+void PluginController::removePart(KXMLGUIClient *part)
+{
+ if (TopLevel::mainWindowValid()) // is 0 when window was already closed
+ TopLevel::getInstance()->main()->guiFactory()->removeClient(part);
+}
+
+void PluginController::removeAndForgetPart(const QString &name, KDevPlugin *part)
+{
+ kdDebug() << "removing: " << name << endl;
+ m_parts.remove(name);
+ removePart(part);
+}
+
+const QValueList<KDevPlugin*> PluginController::loadedPlugins()
+{
+ QValueList<KDevPlugin*> plugins;
+ QDictIterator<KDevPlugin> itt(m_parts);
+ while( itt.current() )
+ {
+ plugins.append( itt.current() );
+ ++itt;
+ }
+ return plugins;
+}
+
+KDevPlugin * PluginController::extension( const QString & serviceType, const QString & constraint )
+{
+ KTrader::OfferList offers = KDevPluginController::query(serviceType, constraint);
+ for (KTrader::OfferList::const_iterator it = offers.constBegin(); it != offers.end(); ++it)
+ {
+ KDevPlugin *ext = m_parts[(*it)->desktopEntryName()];
+ if (ext) return ext;
+ }
+ return 0;
+}
+
+KDevPlugin * PluginController::loadPlugin( const QString & serviceType, const QString & constraint )
+{
+ KTrader::OfferList offers = KDevPluginController::query( serviceType, constraint );
+ if ( !offers.size() == 1 ) return 0;
+
+ KTrader::OfferList::const_iterator it = offers.constBegin();
+ QString name = (*it)->desktopEntryName();
+
+ KDevPlugin * plugin = 0;
+ if ( plugin = m_parts[ name ] )
+ {
+ return plugin;
+ }
+
+ if ( plugin = loadPlugin( *it ) )
+ {
+ m_parts.insert( name, plugin );
+ integratePart( plugin );
+ }
+
+ return plugin;
+}
+
+void PluginController::unloadPlugin( const QString & plugin )
+{
+ QStringList pluginList;
+ pluginList << plugin;
+ unloadPlugins( pluginList );
+}
+
+KURL::List PluginController::profileResources(const QString &nameFilter)
+{
+ return m_engine.resources(currentProfile(), nameFilter);
+}
+
+KURL::List PluginController::profileResourcesRecursive(const QString &nameFilter)
+{
+ return m_engine.resourcesRecursive(currentProfile(), nameFilter);
+}
+
+QString PluginController::changeProfile(const QString &newProfile)
+{
+ kdDebug() << "CHANGING PROFILE: from " << currentProfile() << " to " << newProfile << endl;
+ QStringList unload;
+ KTrader::OfferList coreLoad;
+ KTrader::OfferList globalLoad;
+ m_engine.diffProfiles(ProfileEngine::Core, currentProfile(), newProfile, unload, coreLoad);
+ m_engine.diffProfiles(ProfileEngine::Global, currentProfile(), newProfile, unload, globalLoad);
+
+ QString oldProfile = m_profile;
+ m_profile = newProfile;
+
+ unloadPlugins(unload);
+ loadPlugins( coreLoad );
+ loadPlugins( globalLoad );
+
+ return oldProfile;
+}
+
+void PluginController::selectPlugins( )
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ PluginSelectDialog dlg;
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ QStringList unselectedPlugins = dlg.unselectedPluginNames();
+
+ kdDebug(9000) << unselectedPlugins << endl;
+
+ unloadPlugins( unselectedPlugins );
+ loadGlobalPlugins( unselectedPlugins );
+
+ if ( ProjectManager::getInstance()->projectLoaded() )
+ {
+ loadProjectPlugins( unselectedPlugins );
+ DomUtil::writeListEntry( *API::getInstance()->projectDom(), "/general/ignoreparts", "part", unselectedPlugins );
+ }
+ }
+}
+
+/*
+KDevPlugin * PluginController::getPlugin( const KService::Ptr & service )
+{
+ KDevPlugin * plugin = m_parts[ (*it)->name() ];
+ if ( !plugin )
+ {
+ KDevPlugin * plugin = loadPlugin( *it );
+ if ( plugin )
+ {
+ integratePart( plugin );
+ m_parts.insert( (*it)->name(), plugin );
+ }
+ }
+ return plugin;
+}
+*/
+#include "plugincontroller.moc"
+
diff --git a/src/plugincontroller.h b/src/plugincontroller.h
new file mode 100644
index 00000000..9b526e3e
--- /dev/null
+++ b/src/plugincontroller.h
@@ -0,0 +1,96 @@
+#ifndef __PLUGINCONTROLLER_H__
+#define __PLUGINCONTROLLER_H__
+
+#include <qdict.h>
+#include <qvaluelist.h>
+
+#include <kservice.h>
+
+#include <kdevplugincontroller.h>
+
+#include <profileengine.h>
+
+class KXMLGUIClient;
+class KService;
+class KDevPlugin;
+class KDialogBase;
+class ProjectInfo;
+
+/**
+Plugin controller implementation.
+Loads and unloads plugins.
+*/
+class PluginController : public KDevPluginController
+{
+ Q_OBJECT
+
+public:
+
+ ~PluginController();
+
+ static PluginController *getInstance();
+ static QStringList argumentsFromService( const KService::Ptr &service );
+
+
+ virtual KDevPlugin * loadPlugin( const QString & serviceType, const QString & constraint );
+ virtual void unloadPlugin( const QString & plugin );
+
+ QString currentProfile() const { return m_profile; }
+
+ void loadInitialPlugins();
+
+ void loadProjectPlugins( const QStringList & ignorePlugins );
+ void unloadProjectPlugins();
+
+ void loadGlobalPlugins( const QStringList & ignorePlugins = QStringList() );
+
+ // KDevPlugin * getPlugin( const KService::Ptr &service );
+
+ virtual KDevPlugin *extension(const QString &serviceType, const QString &constraint = "");
+
+ void unloadPlugins( QStringList const & );
+
+ void integratePart(KXMLGUIClient *part);
+ void integrateAndRememberPart(const QString &name, KDevPlugin *part);
+ void removePart(KXMLGUIClient* part);
+ void removeAndForgetPart(const QString &name, KDevPlugin* part);
+
+ const QValueList<KDevPlugin*> loadedPlugins();
+
+ ProfileEngine &engine() { return m_engine; }
+
+ virtual KURL::List profileResources(const QString &nameFilter);
+ virtual KURL::List profileResourcesRecursive(const QString &nameFilter);
+
+ //returns the name of an old profile that was unloaded
+ QString changeProfile(const QString &newProfile);
+
+public slots:
+ void selectPlugins();
+
+signals:
+ void loadingPlugin(const QString &plugin);
+
+protected:
+ PluginController();
+
+private slots:
+// void slotConfigWidget( KDialogBase* );
+ void loadCorePlugins();
+ void loadPlugins( KTrader::OfferList offers, const QStringList & ignorePlugins = QStringList() );
+ void unloadPlugins();
+
+private:
+ static KDevPlugin *loadPlugin( const KService::Ptr &service );
+
+
+ QDict<KDevPlugin> m_parts;
+ QString m_profile;
+
+ static PluginController *s_instance;
+
+ ProfileEngine m_engine;
+
+};
+
+#endif
diff --git a/src/pluginselectdialog.cpp b/src/pluginselectdialog.cpp
new file mode 100644
index 00000000..de4a9e1e
--- /dev/null
+++ b/src/pluginselectdialog.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 <qlistview.h>
+#include <qheader.h>
+#include <qlabel.h>
+#include <qregexp.h>
+
+#include <kdebug.h>
+#include <kapplication.h>
+#include <kurllabel.h>
+
+#include "kdevplugin.h"
+#include "projectmanager.h"
+#include "plugincontroller.h"
+#include "pluginselectdialog.h"
+
+class PluginItem : public QCheckListItem
+{
+public:
+ // name - "Name", label - "GenericName", info - "Comment"
+ PluginItem( QListView * parent, QString const & name, QString const & label,
+ QString const & info, QString const url = QString::null )
+ : QCheckListItem( parent, label, QCheckListItem::CheckBox),
+ _name( name ), _info( info ), _url( url )
+ {}
+
+ QString info() { return _info; }
+ QString name() { return _name; }
+ QString url() { return _url; }
+
+private:
+ QString _name;
+ QString _info;
+ QString _url;
+};
+
+
+PluginSelectDialog::PluginSelectDialog(QWidget* parent, const char* name, bool modal, WFlags fl )
+ : PluginSelectDialogBase( parent,name, modal,fl )
+{
+ plugin_list->setResizeMode( QListView::LastColumn );
+ plugin_list->addColumn("");
+ plugin_list->header()->hide();
+
+ connect( plugin_list, SIGNAL( selectionChanged( QListViewItem * ) ), this, SLOT( itemSelected( QListViewItem * ) ) );
+ connect( urllabel, SIGNAL( leftClickedURL( const QString & ) ), this, SLOT( openURL( const QString & ) ) );
+
+ init();
+}
+
+PluginSelectDialog::~PluginSelectDialog()
+{
+}
+
+void PluginSelectDialog::saveAsDefault()
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ ProfileEngine & engine = PluginController::getInstance()->engine();
+ Profile * profile = engine.findProfile( PluginController::getInstance()->currentProfile() );
+
+ profile->clearList( Profile::ExplicitDisable );
+
+ QListViewItemIterator it( plugin_list );
+ while ( it.current() )
+ {
+ PluginItem * item = static_cast<PluginItem*>( it.current() );
+ if ( !item->isOn() )
+ {
+ profile->addEntry( Profile::ExplicitDisable, item->name() );
+ }
+ ++it;
+ }
+
+ profile->save();
+}
+
+void PluginSelectDialog::openURL( const QString & url )
+{
+ kapp->invokeBrowser( url );
+}
+
+void PluginSelectDialog::itemSelected( QListViewItem * item )
+{
+ if ( ! item ) return;
+
+ PluginItem * pitem = static_cast<PluginItem*>( item );
+ plugin_description_label->setText( pitem->info() );
+
+ if ( pitem->url().isEmpty() )
+ {
+ urllabel->clear();
+ }
+ else
+ {
+ urllabel->setURL( pitem->url() );
+ urllabel->setText( pitem->url() );
+ }
+}
+
+void PluginSelectDialog::init( )
+{
+ const QValueList<KDevPlugin*> loadedPlugins = PluginController::getInstance()->loadedPlugins();
+ QStringList loadedPluginDesktopNames;
+ QValueList<KDevPlugin*>::ConstIterator it = loadedPlugins.begin();
+ while( it != loadedPlugins.end() )
+ {
+ loadedPluginDesktopNames << (*it)->instance()->instanceName();
+ ++it;
+ }
+
+ kdDebug(9000) << " *** loadedPluginDesktopNames: " << loadedPluginDesktopNames << endl;
+
+ KTrader::OfferList localOffers;
+ if ( ProjectManager::getInstance()->projectLoaded() )
+ {
+ localOffers = PluginController::getInstance()->engine().offers(
+ PluginController::getInstance()->currentProfile(), ProfileEngine::Project );
+ }
+
+ KTrader::OfferList globalOffers = PluginController::getInstance()->engine().offers(
+ PluginController::getInstance()->currentProfile(), ProfileEngine::Global);
+
+ KTrader::OfferList offers = localOffers + globalOffers;
+ for (KTrader::OfferList::ConstIterator it = offers.begin(); it != offers.end(); ++it)
+ {
+ // parse out any existing url to make it clickable
+ QString Comment = (*it)->comment();
+ QRegExp re("\\bhttp://[\\S]*");
+ re.search( Comment );
+ Comment.replace( re, "" );
+
+ QString url;
+ if ( re.pos() > -1 )
+ {
+ url = re.cap();
+ }
+
+ PluginItem *item = new PluginItem( plugin_list, (*it)->desktopEntryName(), (*it)->genericName(), Comment, url );
+ item->setOn( loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) );
+
+ kdDebug(9000) << (*it)->desktopEntryName() << " : " << (loadedPluginDesktopNames.contains( (*it)->desktopEntryName() ) ? "YES" : "NO" ) << endl;
+ }
+
+ QListViewItem * first = plugin_list->firstChild();
+ if ( first )
+ {
+ plugin_list->setSelected( first, true );
+ }
+}
+
+QStringList PluginSelectDialog::unselectedPluginNames( )
+{
+ QStringList unselectedPlugins;
+ QListViewItem * item = plugin_list->firstChild();
+ while ( item )
+ {
+ PluginItem * pluginItem = static_cast<PluginItem*>( item );
+ if ( !pluginItem->isOn() )
+ {
+ unselectedPlugins << pluginItem->name();
+ }
+ item = item->nextSibling();
+ }
+ return unselectedPlugins;
+}
+
+
+
+#include "pluginselectdialog.moc"
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/src/pluginselectdialog.h b/src/pluginselectdialog.h
new file mode 100644
index 00000000..5925ad7a
--- /dev/null
+++ b/src/pluginselectdialog.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2006 by Jens Dagerbo *
+ * jens.dagerbo@swipnet.se *
+ * *
+ * 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 PLUGINSELECTDIALOG_H
+#define PLUGINSELECTDIALOG_H
+
+#include "pluginselectdialogbase.h"
+
+class PluginController;
+
+class PluginSelectDialog : public PluginSelectDialogBase
+{
+ Q_OBJECT
+
+public:
+ PluginSelectDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~PluginSelectDialog();
+
+ QStringList unselectedPluginNames();
+
+private:
+ void init();
+
+protected slots:
+ virtual void saveAsDefault();
+ void itemSelected( QListViewItem * );
+ void openURL( const QString & );
+
+};
+
+#endif
+
+// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off;
diff --git a/src/pluginselectdialogbase.ui b/src/pluginselectdialogbase.ui
new file mode 100644
index 00000000..e976899a
--- /dev/null
+++ b/src/pluginselectdialogbase.ui
@@ -0,0 +1,179 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>PluginSelectDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PluginSelectDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>587</width>
+ <height>644</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Plugin Selection</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Plugins:</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView">
+ <property name="name">
+ <cstring>plugin_list</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Make this the default for this profile:</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>saveAsDefault_button</cstring>
+ </property>
+ <property name="text">
+ <string>Save &amp;as Default</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Description:</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>plugin_description_label</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>40</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="KURLLabel">
+ <property name="name">
+ <cstring>urllabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>191</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok_button</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;K</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel_button</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>cancel_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PluginSelectDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>ok_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PluginSelectDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>saveAsDefault_button</sender>
+ <signal>clicked()</signal>
+ <receiver>PluginSelectDialogBase</receiver>
+ <slot>saveAsDefault()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot access="protected">saveAsDefault()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurllabel.h</includehint>
+</includehints>
+</UI>
diff --git a/src/profileengine/Makefile.am b/src/profileengine/Makefile.am
new file mode 100644
index 00000000..3803a6dd
--- /dev/null
+++ b/src/profileengine/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = lib editor
+DOXYGEN_EMPTY = YES
+include ../../Doxyfile.am
diff --git a/src/profileengine/editor/Makefile.am b/src/profileengine/editor/Makefile.am
new file mode 100644
index 00000000..c83169cd
--- /dev/null
+++ b/src/profileengine/editor/Makefile.am
@@ -0,0 +1,22 @@
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/external_interfaces \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \
+ -I$(top_srcdir)/src/profileengine/lib -I$(top_srcdir)/lib/structure $(all_includes)
+METASOURCES = AUTO
+
+libprofileeditor_la_LDFLAGS = $(all_libraries)
+libprofileeditor_la_LIBADD = $(top_builddir)/src/profileengine/lib/libprofileengine.la
+noinst_LTLIBRARIES = libprofileeditor.la
+libprofileeditor_COMPILE_FIRST = profileeditorbase.h
+libprofileeditor_la_SOURCES = profileeditorbase.ui profileeditor.cpp \
+ addprofilewidget.ui
+noinst_HEADERS = profileeditor.h
+
+
+bin_PROGRAMS = kdevprofileeditor
+kdevprofileeditor_LDFLAGS = $(all_libraries)
+kdevprofileeditor_LDADD = \
+ $(top_builddir)/src/profileengine/lib/libprofileengine.la libprofileeditor.la \
+ $(LIB_KDEUI) $(LIB_KIO)
+kdevprofileeditor_SOURCES = main.cpp
+
+
diff --git a/src/profileengine/editor/addprofilewidget.ui b/src/profileengine/editor/addprofilewidget.ui
new file mode 100644
index 00000000..56a46f1d
--- /dev/null
+++ b/src/profileengine/editor/addprofilewidget.ui
@@ -0,0 +1,121 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>AddProfileWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AddProfileWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>312</width>
+ <height>192</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Add Profile</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>nameEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Generic name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>genericNameEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>genericNameEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Description:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>descriptionEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>descriptionEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/profileengine/editor/main.cpp b/src/profileengine/editor/main.cpp
new file mode 100644
index 00000000..52e8d0f1
--- /dev/null
+++ b/src/profileengine/editor/main.cpp
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kcmdlineargs.h>
+
+#include "profileeditor.h"
+
+static KCmdLineOptions options[] =
+{
+ KCmdLineLastOption
+};
+
+int main(int argc, char **argv)
+{
+ KAboutData about("kdevprofileeditor", I18N_NOOP("KDevelop Profile Editor"), "1", "",
+ KAboutData::License_GPL, I18N_NOOP("(c) 2004, The KDevelop Developers"), 0, 0, "");
+ about.addAuthor("Alexander Dymo", 0, "adymo@kdevelop.org");
+ KCmdLineArgs::init(argc, argv, &about);
+ KCmdLineArgs::addCmdLineOptions(options);
+
+ KApplication app(argc, argv);
+ ProfileEditor editor;
+ editor.show();
+ app.setMainWidget(&editor);
+
+ return app.exec();
+}
diff --git a/src/profileengine/editor/profileeditor.cpp b/src/profileengine/editor/profileeditor.cpp
new file mode 100644
index 00000000..0303793f
--- /dev/null
+++ b/src/profileengine/editor/profileeditor.cpp
@@ -0,0 +1,400 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "profileeditor.h"
+
+#include <qlayout.h>
+#include <klineedit.h>
+#include <qtextedit.h>
+#include <qpalette.h>
+
+#include <kdebug.h>
+#include <kpushbutton.h>
+#include <klistbox.h>
+#include <klistview.h>
+#include <kcombobox.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdialogbase.h>
+#include <kglobalsettings.h>
+#include <kdeversion.h>
+
+#include <profile.h>
+
+#include "addprofilewidget.h"
+
+class ProfileItem: public KListViewItem {
+public:
+ ProfileItem(KListView *parent, Profile *profile)
+ :KListViewItem(parent), m_profile(profile)
+ {
+ setText(0, profile->genericName());
+ setText(1, profile->description());
+ }
+
+ ProfileItem(KListViewItem *parent, Profile *profile)
+ : KListViewItem(parent), m_profile(profile)
+ {
+ setText(0, profile->genericName());
+ setText(1, profile->description());
+ }
+
+ Profile *profile() const { return m_profile; }
+
+private:
+ Profile *m_profile;
+};
+
+class EDListItem: public KListViewItem{
+public:
+ EDListItem(KListView *parent, const QString &text, bool derived)
+ : KListViewItem(parent, text), m_derived(derived)
+ {
+ }
+
+ bool isDerived() const { return m_derived; }
+
+ virtual void paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
+ {
+ QColorGroup cgNew = cg;
+ if (m_derived)
+ cgNew.setColor(QColorGroup::Text, KGlobalSettings::inactiveTextColor());
+ KListViewItem::paintCell(p, cgNew, column, width, alignment);
+ }
+
+private:
+ bool m_derived;
+};
+
+
+class ProfileListBuilding {
+public:
+ ProfileItem * operator() (ProfileItem *parent, Profile *profile)
+ {
+ parent->setOpen(true);
+ return new ProfileItem(parent, profile);
+ }
+};
+
+
+ProfileEditor::ProfileEditor(QWidget *parent, const char *name)
+ :ProfileEditorBase(parent, name)
+{
+ refresh();
+}
+
+void ProfileEditor::refresh()
+{
+ profilesList->clear();
+
+ ProfileItem *item = new ProfileItem(profilesList, engine.rootProfile());
+ ProfileListBuilding op;
+ engine.walkProfiles<ProfileListBuilding, ProfileItem>(op, item, engine.rootProfile());
+
+ profilesList->setSelected(item, true);
+ profilesList->setCurrentItem(item);
+
+ refreshAvailableList();
+ refreshPropertyCombo();
+}
+
+void ProfileEditor::refreshPropertyCombo()
+{
+ KTrader::OfferList list = KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"));
+ QStringList props;
+ for (KTrader::OfferList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it)
+ {
+ QStringList currProps = (*it)->property("X-KDevelop-Properties").toStringList();
+ for (QStringList::const_iterator p = currProps.constBegin();
+ p != currProps.constEnd(); ++p)
+ if (!props.contains(*p))
+ props.append(*p);
+ }
+ props.sort();
+ propertyCombo->insertStringList(props);
+ propertyCombo->setCurrentText("");
+}
+
+void ProfileEditor::refreshAvailableList()
+{
+ //filling a list of available plugins
+ allList->clear();
+ allCore = new KListViewItem(allList, i18n("Core"));
+ allCore->setOpen(true);
+ allGlobal = new KListViewItem(allList, i18n("Global"));
+ allGlobal->setOpen(true);
+ allProject = new KListViewItem(allList, i18n("Project"));
+ allProject->setOpen(true);
+
+ KTrader::OfferList olist = engine.allOffers(ProfileEngine::Core);
+ for (KTrader::OfferList::iterator it = olist.begin(); it != olist.end(); ++it)
+ new KListViewItem(allCore, (*it)->desktopEntryName(), (*it)->genericName());
+ olist = engine.allOffers(ProfileEngine::Global);
+ for (KTrader::OfferList::iterator it = olist.begin(); it != olist.end(); ++it)
+ new KListViewItem(allGlobal, (*it)->desktopEntryName(), (*it)->genericName());
+ olist = engine.allOffers(ProfileEngine::Project);
+ for (KTrader::OfferList::iterator it = olist.begin(); it != olist.end(); ++it)
+ new KListViewItem(allProject, (*it)->desktopEntryName(), (*it)->genericName());
+}
+
+void ProfileEditor::profileExecuted(QListViewItem *item)
+{
+ if (!item || item->text(0) == "KDevelop")
+ removeProfileButton->setEnabled(false);
+ else
+ removeProfileButton->setEnabled(true);
+
+ fillPropertyList(currentProfile());
+ fillEDLists(currentProfile());
+ fillPluginsList(currentProfile());
+}
+
+void ProfileEditor::fillPropertyList(Profile *profile)
+{
+ derivedPropertiesBox->clear();
+ ownPropertiesBox->clear();
+
+ Profile::EntryList list = profile->list(Profile::Properties);
+ for (Profile::EntryList::const_iterator it = list.begin(); it != list.end(); ++it)
+ {
+ if ((*it).derived)
+ derivedPropertiesBox->insertItem((*it).name);
+ else
+ ownPropertiesBox->insertItem((*it).name);
+ }
+}
+
+void ProfileEditor::fillEDLists(Profile *profile)
+{
+ //filling a list of enabled plugins
+ enabledList->clear();
+ Profile::EntryList list = profile->list(Profile::ExplicitEnable);
+ for (Profile::EntryList::const_iterator it = list.begin(); it != list.end(); ++it)
+ new EDListItem(enabledList, (*it).name, (*it).derived);
+
+ //filling a list of disabled plugins
+ disabledList->clear();
+ list = profile->list(Profile::ExplicitDisable);
+ for (Profile::EntryList::const_iterator it = list.begin(); it != list.end(); ++it)
+ new EDListItem(disabledList, (*it).name, (*it).derived);
+}
+
+void ProfileEditor::fillPluginsList(Profile *profile)
+{
+ pluginsView->clear();
+
+ KListViewItem *core = new KListViewItem(pluginsView, i18n("Core Plugins"));
+ core->setOpen(true);
+ KListViewItem *global = new KListViewItem(pluginsView, i18n("Global Plugins"));
+ global->setOpen(true);
+ KListViewItem *project = new KListViewItem(pluginsView, i18n("Project Plugins"));
+ project->setOpen(true);
+
+ KTrader::OfferList coreOffers = engine.offers(profile->name(), ProfileEngine::Core);
+ for (KTrader::OfferList::const_iterator it = coreOffers.constBegin();
+ it != coreOffers.constEnd(); ++it)
+ new KListViewItem(core, (*it)->desktopEntryName(), (*it)->genericName(),
+ (*it)->property("X-KDevelop-Properties").toStringList().join(", "));
+
+ KTrader::OfferList globalOffers = engine.offers(profile->name(), ProfileEngine::Global);
+ for (KTrader::OfferList::const_iterator it = globalOffers.constBegin();
+ it != globalOffers.constEnd(); ++it)
+ new KListViewItem(global, (*it)->desktopEntryName(), (*it)->genericName(),
+ (*it)->property("X-KDevelop-Properties").toStringList().join(", "));
+
+ KTrader::OfferList projectOffers = engine.offers(profile->name(), ProfileEngine::Project);
+ for (KTrader::OfferList::const_iterator it = projectOffers.constBegin();
+ it != projectOffers.constEnd(); ++it)
+ new KListViewItem(project, (*it)->desktopEntryName(), (*it)->genericName(),
+ (*it)->property("X-KDevelop-Properties").toStringList().join(", "));
+}
+
+void ProfileEditor::propertyExecuted(QListBoxItem *item)
+{
+ removePropertyButton->setEnabled(item != 0);
+}
+
+void ProfileEditor::addProfile()
+{
+ if (!profilesList->currentItem())
+ return;
+
+ KDialogBase dlg(KDialogBase::Plain, i18n("Add Profile"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok);
+ dlg.plainPage()->setMargin(0);
+ (new QVBoxLayout(dlg.plainPage(), 0, 0))->setAutoAdd(true);
+ AddProfileWidget *prof = new AddProfileWidget(dlg.plainPage());
+ prof->nameEdit->setFocus();
+ if (dlg.exec() == QDialog::Accepted)
+ {
+ Profile *profile = new Profile(currentProfile(), prof->nameEdit->text(),
+ prof->genericNameEdit->text(),
+ prof->descriptionEdit->text());
+ profilesList->currentItem()->setOpen(true);
+ new ProfileItem(static_cast<KListViewItem*>(profilesList->currentItem()), profile);
+ }
+}
+
+void ProfileEditor::removeProfile()
+{
+ if (KMessageBox::warningContinueCancel(this, i18n("Remove selected profile and all its subprofiles?"),
+ i18n("Remove Profile"),KStdGuiItem::del()) == KMessageBox::Continue)
+ {
+ Profile *profile = currentProfile();
+ if (profile->remove())
+ {
+ QListViewItem *item = profilesList->currentItem();
+ profilesList->setCurrentItem(item->parent());
+ profile->detachFromParent();
+ delete profile;
+ delete item;
+ }
+ else
+ KMessageBox::error(this, i18n("Cannot remove this profile because it is not a local (user-created) profile."), i18n("Remove Profile"));
+ }
+}
+
+void ProfileEditor::addProperty()
+{
+ if ( (!propertyCombo->currentText().isEmpty()) &&
+ (ownPropertiesBox->findItem(propertyCombo->currentText()) == 0) &&
+ (derivedPropertiesBox->findItem(propertyCombo->currentText()) == 0) )
+ {
+ ownPropertiesBox->insertItem(propertyCombo->currentText());
+
+ currentProfile()->addEntry(Profile::Properties, propertyCombo->currentText());
+ currentProfile()->save();
+ }
+
+ fillPluginsList(currentProfile());
+}
+
+void ProfileEditor::removeProperty()
+{
+ currentProfile()->removeEntry(Profile::Properties, ownPropertiesBox->currentText());
+ currentProfile()->save();
+
+ ownPropertiesBox->removeItem(ownPropertiesBox->currentItem());
+
+ fillPluginsList(currentProfile());
+}
+
+Profile *ProfileEditor::currentProfile()
+{
+ ProfileItem *item = dynamic_cast<ProfileItem*>(profilesList->currentItem());
+ if (!item)
+ return 0;
+ return item->profile();
+}
+
+void ProfileEditor::accept()
+{
+}
+
+void ProfileEditor::addEnabled()
+{
+ if (!allList->currentItem() && allEdit->text().isEmpty())
+ return;
+ QString text;
+ if (!allEdit->text().isEmpty())
+ {
+ text = allEdit->text();
+ allEdit->clear();
+ }
+ else
+ {
+ if ((allList->currentItem() == allGlobal) || (allList->currentItem() == allProject))
+ return;
+ text = allList->currentItem()->text(0);
+ }
+
+ if (enabledList->findItem(text, 0) != 0)
+ return;
+ if (disabledList->findItem(text, 0) != 0)
+ {
+ KMessageBox::error(this, i18n("This plugin is already contained in the list of disabled plugins."),
+ i18n("Enable Plugin"));
+ return;
+ }
+ currentProfile()->addEntry(Profile::ExplicitEnable, text);
+ currentProfile()->save();
+ fillPluginsList(currentProfile());
+ new EDListItem(enabledList, text, false);
+}
+
+void ProfileEditor::delEnabled()
+{
+ if (!enabledList->currentItem())
+ return;
+
+ EDListItem *item = dynamic_cast<EDListItem*>(enabledList->currentItem());
+ if (item && !item->isDerived())
+ {
+ currentProfile()->removeEntry(Profile::ExplicitEnable, enabledList->currentItem()->text(0));
+ currentProfile()->save();
+ fillPluginsList(currentProfile());
+ delete enabledList->currentItem();
+ }
+}
+
+void ProfileEditor::addDisabled()
+{
+ if (!allList->currentItem() && allEdit->text().isEmpty())
+ return;
+ QString text;
+ if (!allEdit->text().isEmpty())
+ {
+ text = allEdit->text();
+ allEdit->clear();
+ }
+ else
+ {
+ if ((allList->currentItem() == allGlobal) || (allList->currentItem() == allProject))
+ return;
+ text = allList->currentItem()->text(0);
+ }
+
+ if (disabledList->findItem(text, 0) != 0)
+ return;
+ if (enabledList->findItem(text, 0) != 0)
+ {
+ KMessageBox::error(this, i18n("This plugin is already contained in the list of enabled plugins."),
+ i18n("Disable Plugin"));
+ return;
+ }
+ currentProfile()->addEntry(Profile::ExplicitDisable, text);
+ currentProfile()->save();
+ fillPluginsList(currentProfile());
+ new EDListItem(disabledList, text, false);
+}
+
+void ProfileEditor::delDisabled()
+{
+ if (!disabledList->currentItem())
+ return;
+
+ EDListItem *item = dynamic_cast<EDListItem*>(disabledList->currentItem());
+ if (item && !item->isDerived())
+ {
+ currentProfile()->removeEntry(Profile::ExplicitDisable, disabledList->currentItem()->text(0));
+ delete disabledList->currentItem();
+ currentProfile()->save();
+ fillPluginsList(currentProfile());
+ }
+}
+
+#include "profileeditor.moc"
diff --git a/src/profileengine/editor/profileeditor.h b/src/profileengine/editor/profileeditor.h
new file mode 100644
index 00000000..1ec6e91a
--- /dev/null
+++ b/src/profileengine/editor/profileeditor.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROFILEEDITOR_H
+#define PROFILEEDITOR_H
+
+#include <profileengine.h>
+
+#include "profileeditorbase.h"
+
+class QListBoxItem;
+class QListViewItem;
+class KListViewItem;
+
+class ProfileEditor : public ProfileEditorBase {
+ Q_OBJECT
+public:
+ ProfileEditor(QWidget *parent = 0, const char *name = 0);
+
+public slots:
+ virtual void removeProperty();
+ virtual void addProperty();
+ virtual void removeProfile();
+ virtual void addProfile();
+ virtual void propertyExecuted(QListBoxItem *item);
+ virtual void profileExecuted(QListViewItem *item);
+
+ virtual void delDisabled();
+ virtual void addDisabled();
+ virtual void delEnabled();
+ virtual void addEnabled();
+
+ virtual void accept();
+
+protected:
+ void refresh();
+ void refreshPropertyCombo();
+ void refreshAvailableList();
+
+ void fillPropertyList(Profile *profile);
+ void fillEDLists(Profile *profile);
+ void fillPluginsList(Profile *profile);
+
+ Profile *currentProfile();
+
+private:
+ ProfileEngine engine;
+
+ KListViewItem *allCore;
+ KListViewItem *allGlobal;
+ KListViewItem *allProject;
+};
+
+#endif
diff --git a/src/profileengine/editor/profileeditorbase.ui b/src/profileengine/editor/profileeditorbase.ui
new file mode 100644
index 00000000..e91fd13d
--- /dev/null
+++ b/src/profileengine/editor/profileeditorbase.ui
@@ -0,0 +1,680 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>ProfileEditorBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ProfileEditorBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>637</width>
+ <height>476</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Profile Editor for The KDevelop Platform</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter" row="0" column="0">
+ <property name="name">
+ <cstring>splitter2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <widget class="QWidgetStack">
+ <property name="name">
+ <cstring>widgetStack1</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>WStackPage</cstring>
+ </property>
+ <attribute name="id">
+ <number>0</number>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>addProfileButton</cstring>
+ </property>
+ <property name="text">
+ <string>Add Profile</string>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>142</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KListView" row="0" column="0" rowspan="3" colspan="1">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Description</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>profilesList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>NoColumn</enum>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>removeProfileButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Remove Profile</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Properties</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>addPropertyButton</cstring>
+ </property>
+ <property name="text">
+ <string>Add</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>propertyCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="autoCompletion">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>removePropertyButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Remove</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Derived properties:</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>derivedPropertiesBox</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Own properties:</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>ownPropertiesBox</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Lists of Explicitly Enabled &amp;&amp; Disabled Plugins</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="2" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Enabled:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Plugin Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>enabledList</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="2" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Disabled:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Plugin Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>disabledList</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="KPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>delEnabledButton</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;-</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer2_2</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>
+ <spacer row="4" column="1">
+ <property name="name">
+ <cstring>spacer2_3</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="KPushButton" row="6" column="1">
+ <property name="name">
+ <cstring>delDisabledButton</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;-</string>
+ </property>
+ </widget>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>spacer2_4</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="QLayoutWidget" row="0" column="0" rowspan="8" colspan="1">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2_3</cstring>
+ </property>
+ <property name="text">
+ <string>Available plugins:</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Generic Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>allList</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>allEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="0" 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>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>addEnabledButton</cstring>
+ </property>
+ <property name="text">
+ <string>-&gt;</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>addDisabledButton</cstring>
+ </property>
+ <property name="text">
+ <string>-&gt;</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>List of Plugins to Be Loaded</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Generic Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Properties</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>pluginsView</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>profilesList</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>profileExecuted(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>ownPropertiesBox</sender>
+ <signal>currentChanged(QListBoxItem*)</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>propertyExecuted(QListBoxItem*)</slot>
+ </connection>
+ <connection>
+ <sender>addProfileButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>addProfile()</slot>
+ </connection>
+ <connection>
+ <sender>removeProfileButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>removeProfile()</slot>
+ </connection>
+ <connection>
+ <sender>addPropertyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>addProperty()</slot>
+ </connection>
+ <connection>
+ <sender>removePropertyButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>removeProperty()</slot>
+ </connection>
+ <connection>
+ <sender>profilesList</sender>
+ <signal>executed(QListViewItem*)</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>profileExecuted(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>profilesList</sender>
+ <signal>selectionChanged(QListViewItem*)</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>profileExecuted(QListViewItem*)</slot>
+ </connection>
+ <connection>
+ <sender>addEnabledButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>addEnabled()</slot>
+ </connection>
+ <connection>
+ <sender>delEnabledButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>delEnabled()</slot>
+ </connection>
+ <connection>
+ <sender>addDisabledButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>addDisabled()</slot>
+ </connection>
+ <connection>
+ <sender>delDisabledButton</sender>
+ <signal>clicked()</signal>
+ <receiver>ProfileEditorBase</receiver>
+ <slot>delDisabled()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>profilesList</tabstop>
+ <tabstop>addProfileButton</tabstop>
+ <tabstop>removeProfileButton</tabstop>
+ <tabstop>tabWidget2</tabstop>
+ <tabstop>derivedPropertiesBox</tabstop>
+ <tabstop>ownPropertiesBox</tabstop>
+ <tabstop>propertyCombo</tabstop>
+ <tabstop>addPropertyButton</tabstop>
+ <tabstop>removePropertyButton</tabstop>
+ <tabstop>enabledList</tabstop>
+ <tabstop>disabledList</tabstop>
+ <tabstop>pluginsView</tabstop>
+</tabstops>
+<slots>
+ <slot>profileExecuted(QListViewItem *item)</slot>
+ <slot>propertyExecuted(QListBoxItem *item)</slot>
+ <slot>addProfile()</slot>
+ <slot>removeProfile()</slot>
+ <slot>addProperty()</slot>
+ <slot>removeProperty()</slot>
+ <slot>addEnabled()</slot>
+ <slot>delEnabled()</slot>
+ <slot>addDisabled()</slot>
+ <slot>delDisabled()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>klistbox.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/src/profileengine/lib/Mainpage.dox b/src/profileengine/lib/Mainpage.dox
new file mode 100644
index 00000000..72d14aa5
--- /dev/null
+++ b/src/profileengine/lib/Mainpage.dox
@@ -0,0 +1,10 @@
+/**
+@mainpage The KDevelop Shell Profiles Library
+
+This library contains plugin profiles engine for KDevelop shell.
+
+<b>Link with</b>: -lprofileengine
+
+<b>Include path</b>: -I\$(kde_includes)/kdevelop/shell/profileengine
+*/
+
diff --git a/src/profileengine/lib/Makefile.am b/src/profileengine/lib/Makefile.am
new file mode 100644
index 00000000..50d17ed5
--- /dev/null
+++ b/src/profileengine/lib/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/lib/external_interfaces \
+ -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets \
+ -I$(top_srcdir)/lib/structure $(all_includes)
+METASOURCES = AUTO
+lib_LTLIBRARIES = libprofileengine.la
+libprofileengine_la_LDFLAGS = $(all_libraries)
+libprofileengine_la_LIBADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KIO)
+libprofileengine_la_SOURCES = profileengine.cpp profile.cpp
+
+profileincludedir = $(includedir)/kdevelop/shell/profileengine
+profileinclude_HEADERS = profileengine.h profile.h
+
+DOXYGEN_REFERENCES = dcop interfaces kdecore kdefx kdeui khtml kmdi kio kjs kparts kutils kdevutil kdevinterfaces
+DOXYGEN_PROJECTNAME = KDevelop Shell Profiles Library
+DOXYGEN_DOCDIRPREFIX = kdevprofiles
+include ../../../Doxyfile.am
diff --git a/src/profileengine/lib/profile.cpp b/src/profileengine/lib/profile.cpp
new file mode 100644
index 00000000..e13b623e
--- /dev/null
+++ b/src/profileengine/lib/profile.cpp
@@ -0,0 +1,205 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "profile.h"
+
+#include <qdir.h>
+#include <qfileinfo.h>
+
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kconfig.h>
+#include <kio/netaccess.h>
+
+Profile::Profile(Profile *parent, const QString &name)
+ :m_parent(parent), m_name(name)
+{
+ if (m_parent)
+ m_parent->addChildProfile(this);
+
+ QString profileConfig = locate("data", "kdevelop/profiles" + dirName() + "/profile.config");
+ KConfig config(profileConfig);
+
+ config.setGroup("Information");
+ m_genericName = config.readEntry("GenericName");
+ m_description = config.readEntry("Description");
+
+ config.setGroup("Properties");
+ m_properties = config.readListEntry("List");
+
+ config.setGroup("Enable");
+ m_explicitEnable = config.readListEntry("List");
+
+ config.setGroup("Disable");
+ m_explicitDisable = config.readListEntry("List");
+}
+
+Profile::Profile(Profile *parent, const QString &name, const QString &genericName, const QString &description)
+ :m_parent(parent), m_name(name), m_genericName(genericName), m_description(description)
+{
+ if (m_parent)
+ m_parent->addChildProfile(this);
+ save();
+}
+
+Profile::~Profile()
+{
+ for (QValueList<Profile*>::iterator it = m_children.begin(); it != m_children.end(); ++it)
+ delete *it;
+}
+
+void Profile::addChildProfile(Profile *profile)
+{
+ m_children.append(profile);
+}
+
+void Profile::removeChildProfile(Profile *profile)
+{
+ m_children.remove(profile);
+}
+
+QString Profile::dirName() const
+{
+ if (m_parent)
+ return m_parent->dirName() + "/" + m_name;
+ else
+ return "/"/* + m_name*/;
+}
+
+void Profile::save()
+{
+ QString profileConfig = locateLocal("data", "kdevelop/profiles" + dirName() + "/profile.config");
+ KConfig config(profileConfig);
+
+ config.setGroup("Information");
+ config.writeEntry("GenericName", m_genericName);
+ config.writeEntry("Description", m_description);
+
+ config.setGroup("Properties");
+ config.writeEntry("List", m_properties);
+
+ config.setGroup("Enable");
+ config.writeEntry("List", m_explicitEnable);
+
+ config.setGroup("Disable");
+ config.writeEntry("List", m_explicitDisable);
+
+ config.sync();
+}
+
+Profile::EntryList Profile::list(List type)
+{
+ EntryList parentList;
+ if (m_parent)
+ parentList = m_parent->list(type);
+ EntryList list = parentList;
+ for (EntryList::iterator it = list.begin(); it != list.end(); ++it)
+ (*it).derived = true;
+ QStringList &personalList = listByType(type);
+ for (QStringList::const_iterator it = personalList.begin(); it != personalList.end(); ++it)
+ list.append(Entry(*it, false));
+ return list;
+}
+
+void Profile::addEntry(List type, const QString &value)
+{
+ QStringList &list = listByType(type);
+ if (!list.contains(value))
+ list.append(value);
+}
+
+void Profile::removeEntry(List type, const QString &value)
+{
+ QStringList &list = listByType(type);
+ list.remove(value);
+}
+
+void Profile::clearList( List type )
+{
+ switch (type)
+ {
+ case Properties:
+ m_properties.clear();
+ case ExplicitEnable:
+ m_explicitEnable.clear();
+ case ExplicitDisable:
+ m_explicitDisable.clear();
+ }
+}
+
+QStringList &Profile::listByType(List type)
+{
+ switch (type) {
+ case Properties:
+ return m_properties;
+ case ExplicitEnable:
+ return m_explicitEnable;
+ case ExplicitDisable:
+ default:
+ return m_explicitDisable;
+ }
+}
+
+bool Profile::hasInEntryList(EntryList &list, QString value)
+{
+ for (EntryList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it)
+ if ((*it).name == value)
+ return true;
+ return false;
+}
+
+bool Profile::remove()
+{
+ QStringList dirs = KGlobal::dirs()->findDirs("data", "kdevelop/profiles" + dirName());
+ if ((dirs.count() == 1) && dirs[0].startsWith(QDir::homeDirPath()))
+ return KIO::NetAccess::del(KURL::fromPathOrURL(dirs[0]), 0);
+ return false;
+}
+
+void Profile::detachFromParent()
+{
+ if (m_parent)
+ m_parent->removeChildProfile(this);
+}
+
+KURL::List Profile::resources(const QString &nameFilter)
+{
+ QStringList resources;
+ QStringList resourceDirs = KGlobal::dirs()->resourceDirs("data");
+ for (QStringList::const_iterator it = resourceDirs.begin(); it != resourceDirs.end(); ++it)
+ {
+ QString dir = *it;
+ dir = dir + "kdevelop/profiles" + dirName();
+
+ QDir d(dir);
+ const QFileInfoList *infoList = d.entryInfoList(nameFilter, QDir::Files);
+ if (!infoList)
+ continue;
+ for (QFileInfoList::const_iterator infoIt = infoList->constBegin();
+ infoIt != infoList->constEnd(); ++ infoIt)
+ resources.append((*infoIt)->absFilePath());
+ }
+
+ return KURL::List(resources);
+}
+
+void Profile::addResource(const KURL &url)
+{
+ QString saveLocation = KGlobal::dirs()->saveLocation("data", "kdevelop/profiles"+dirName(), true);
+ KIO::NetAccess::file_copy(url, KURL::fromPathOrURL(saveLocation), -1, true);
+}
diff --git a/src/profileengine/lib/profile.h b/src/profileengine/lib/profile.h
new file mode 100644
index 00000000..3f6d495a
--- /dev/null
+++ b/src/profileengine/lib/profile.h
@@ -0,0 +1,96 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROFILE_H
+#define PROFILE_H
+
+#include <kurl.h>
+#include <qstringlist.h>
+
+/**
+@short KDevelop profile
+
+A class which represents a profile for KDevelop platform stored on disk.
+*/
+class Profile {
+public:
+ /**An entry in the lists that store profile information*/
+ struct Entry {
+ Entry() {}
+ Entry(const QString &_name, bool _derived): name(_name), derived(_derived) {}
+ QString name;
+ bool derived;
+ };
+ typedef QValueList<Entry> EntryList;
+
+ /**Lists which are held by a profile.*/
+ enum List {
+ Properties /**<X-KDevelop-Properties defined for this profile.*/,
+ ExplicitEnable /**<A list of explicitly enabled plugins (names).*/,
+ ExplicitDisable /**<A list of explicitly disabled plugins (names).*/
+ };
+
+ Profile(Profile *parent, const QString &name);
+ Profile(Profile *parent, const QString &name, const QString &genericName, const QString &description);
+ ~Profile();
+
+ QValueList<Profile*> children() const { return m_children; }
+ Profile *parent() const { return m_parent; }
+
+ void save();
+ bool remove();
+
+ QString name() const { return m_name; }
+ QString genericName() const { return m_genericName; }
+ QString description() const { return m_description; }
+
+ EntryList list(List type);
+
+ void addEntry(List type, const QString &value);
+ void removeEntry(List type, const QString &value);
+ void clearList(List type);
+
+ bool hasInEntryList(EntryList &list, QString value);
+
+ KURL::List resources(const QString &nameFilter);
+ void addResource(const KURL &url);
+
+ void detachFromParent();
+
+protected:
+ void addChildProfile(Profile *profile);
+ void removeChildProfile(Profile *profile);
+ QString dirName() const;
+
+ QStringList &listByType(List type);
+
+private:
+ Profile *m_parent;
+ QValueList<Profile*> m_children;
+
+ QString m_name;
+
+ QString m_genericName;
+ QString m_description;
+
+ QStringList m_properties;
+ QStringList m_explicitEnable;
+ QStringList m_explicitDisable;
+};
+
+#endif
diff --git a/src/profileengine/lib/profileengine.cpp b/src/profileengine/lib/profileengine.cpp
new file mode 100644
index 00000000..a46fa766
--- /dev/null
+++ b/src/profileengine/lib/profileengine.cpp
@@ -0,0 +1,264 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "profileengine.h"
+
+#include <qdir.h>
+
+#include <kurl.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+
+#include <kdevplugin.h>
+
+ProfileEngine::ProfileEngine()
+{
+ QStringList dirs = KGlobal::dirs()->findDirs("data", "kdevelop/profiles");
+
+ m_rootProfile = new Profile(0, "KDevelop");
+
+ QString currPath = "/";
+ QMap<QString, Profile*> passedPaths;
+
+ for (QStringList::const_iterator it = dirs.constBegin(); it != dirs.constEnd(); ++it)
+ processDir(*it, currPath, passedPaths, m_rootProfile);
+}
+
+ProfileEngine::~ProfileEngine()
+{
+ delete m_rootProfile;
+}
+
+void ProfileEngine::processDir(const QString &dir, const QString &currPath, QMap<QString, Profile*> &passedPaths, Profile *root)
+{
+// kdDebug() << "processDir: " << dir << " " << currPath << endl;
+
+ QDir qDir(dir);
+ QStringList entryList = qDir.entryList(QDir::Dirs);
+ for (QStringList::const_iterator eit = entryList.constBegin(); eit != entryList.constEnd(); ++eit)
+ {
+ if ((*eit != "..") && (*eit != "."))
+ {
+ QString dirName = *eit;
+ Profile *profile = 0;
+ if (passedPaths.contains(currPath + dirName))
+ profile = passedPaths[currPath + dirName];
+ else
+ {
+ profile = new Profile(root, dirName);
+ passedPaths[currPath + dirName] = profile;
+ }
+ processDir(dir + *eit + "/", currPath + dirName, passedPaths, profile);
+ }
+ }
+}
+
+KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType offerType)
+{
+ ProfileListing listing;
+ Profile *profile = 0;
+ getProfileWithListing(listing, &profile, profileName);
+
+ if (!profile)
+ return KTrader::OfferList();
+
+ QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ switch (offerType) {
+ case Global:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'");
+ break;
+ case Project:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'");
+ break;
+ case Core:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'");
+ break;
+ }
+ QString constraint_add = "";
+ Profile::EntryList properties = profile->list(Profile::Properties);
+ int i = 0;
+ for (Profile::EntryList::const_iterator it = properties.begin(); it != properties.end(); ++it)
+ constraint_add += QString::fromLatin1(" %1 '%2' in [X-KDevelop-Properties]").
+ arg((i++)==0?"":"or").arg((*it).name);
+ if (!constraint_add.isEmpty())
+ constraint += " and ( " + constraint_add + " ) ";
+
+//BEGIN debug
+/* kdDebug(9000) << "=============" << endl
+ << " =============" << endl
+ << " ============= Query for Profile:" << endl
+ << " " << constraint << endl << endl << endl;*/
+//END debug
+
+ KTrader::OfferList list = KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint);
+ QStringList names;
+
+/* Wrong, this is not what we want to do.
+ Profile::EntryList disableList = profile->list(Profile::ExplicitDisable);
+ KTrader::OfferList::iterator it = list.begin();
+ while (it != list.end())
+ {
+ QString name = (*it)->desktopEntryName();
+ names.append(name);
+ if (profile->hasInEntryList(disableList, name))
+ {
+ it = list.remove(it);
+ continue;
+ }
+ ++it;
+ }
+*/
+ Profile::EntryList enableList = profile->list(Profile::ExplicitEnable);
+ for (Profile::EntryList::const_iterator it = enableList.begin(); it != enableList.end(); ++it)
+ {
+ if (names.contains((*it).name))
+ continue;
+ QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ constraint += QString::fromLatin1("and [Name] == '%1'").arg((*it).name);
+ KTrader::OfferList enable = KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint);
+ list += enable;
+ }
+
+/*//BEGIN debug
+ kdDebug() << "=============" << endl
+ << " =============" << endl
+ << " ============= Plugins for Profile:" << endl;
+ for (KTrader::OfferList::const_iterator it = list.begin(); it != list.end(); ++it)
+ kdDebug() << " " << (*it)->name() << endl;
+ kdDebug() << endl << endl;
+//END debug*/
+
+ return list;
+}
+
+KTrader::OfferList ProfileEngine::allOffers(OfferType offerType)
+{
+ QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ switch (offerType) {
+ case Global:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'");
+ break;
+ case Project:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'");
+ break;
+ case Core:
+ constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'");
+ break;
+ }
+ return KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint);
+}
+
+void ProfileEngine::getProfileWithListing(ProfileListing &listing, Profile **profile,
+ const QString &profileName)
+{
+ if (profileName == "KDevelop")
+ *profile = m_rootProfile;
+ else
+ {
+ walkProfiles<ProfileListing>(listing, m_rootProfile);
+ *profile = listing.profiles[profileName];
+ }
+}
+
+KURL::List ProfileEngine::resources(const QString &profileName, const QString &nameFilter)
+{
+ ProfileListing listing;
+ Profile *profile = 0;
+ getProfileWithListing(listing, &profile, profileName);
+
+ if (!profile)
+ return KURL::List();
+
+ return resources(profile, nameFilter);
+}
+
+KURL::List ProfileEngine::resources(Profile *profile, const QString &nameFilter)
+{
+ return profile->resources(nameFilter);
+}
+
+KURL::List ProfileEngine::resourcesRecursive(const QString &profileName, const QString &nameFilter)
+{
+ ProfileListing listing;
+ Profile *profile = 0;
+ getProfileWithListing(listing, &profile, profileName);
+ KURL::List resources = profile->resources(nameFilter);
+
+ ProfileListingEx listingEx(nameFilter);
+ walkProfiles<ProfileListingEx>(listingEx, profile);
+
+ resources += listingEx.resourceList;
+ return resources;
+}
+
+void ProfileEngine::diffProfiles(OfferType offerType, const QString &profile1,
+ const QString &profile2, QStringList &unload, KTrader::OfferList &load)
+{
+ KTrader::OfferList offers1 = offers(profile1, offerType);
+ KTrader::OfferList offers2 = offers(profile2, offerType);
+
+ QStringList offers1List;
+ for (KTrader::OfferList::const_iterator it = offers1.constBegin();
+ it != offers1.constEnd(); ++it)
+ offers1List.append((*it)->desktopEntryName());
+ QMap<QString, KService::Ptr> offers2List;
+ for (KTrader::OfferList::const_iterator it = offers2.constBegin();
+ it != offers2.constEnd(); ++it)
+ offers2List[(*it)->desktopEntryName()] = *it;
+
+// kdDebug() << "OLD PROFILE: " << offers1List << endl;
+// kdDebug() << "NEW PROFILE: " << offers2List << endl;
+
+ for (QStringList::const_iterator it = offers1List.constBegin();
+ it != offers1List.constEnd(); ++it)
+ {
+// kdDebug() << "checking: " << *it << endl;
+ if (offers2List.contains(*it))
+ {
+// kdDebug() << " keep" << endl;
+ offers2.remove(offers2List[*it]);
+ }
+ else
+ {
+// kdDebug() << " unload" << endl;
+ unload.append(*it);
+ }
+ }
+ load = offers2;
+}
+
+Profile *ProfileEngine::findProfile(const QString & profileName)
+{
+ Profile *profile;
+ ProfileListing listing;
+ getProfileWithListing(listing, &profile, profileName);
+ return profile;
+}
+
+void ProfileEngine::addResource(const QString &profileName, const KURL &url)
+{
+ ProfileListing listing;
+ Profile *profile = 0;
+ getProfileWithListing(listing, &profile, profileName);
+
+ if (!profile)
+ return;
+
+ profile->addResource(url);
+}
diff --git a/src/profileengine/lib/profileengine.h b/src/profileengine/lib/profileengine.h
new file mode 100644
index 00000000..7a9a9abf
--- /dev/null
+++ b/src/profileengine/lib/profileengine.h
@@ -0,0 +1,272 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo <adymo@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PROFILEENGINE_H
+#define PROFILEENGINE_H
+
+#include <qmap.h>
+
+#include <ktrader.h>
+
+#include "profile.h"
+
+/**
+Profile listing operation.
+Used to get a plain list of profiles
+and store it in the QMap<QString, Profile*>.
+*/
+class ProfileListing{
+public:
+ void operator() (Profile *profile)
+ {
+ profiles[profile->name()] = profile;
+ }
+
+ QMap<QString, Profile*> profiles;
+};
+
+/**Profile resource listing operation.
+Used to get a list of urls to the profile resources.
+
+Resource urls can be filtered by an @p filter parameter
+passed to the constructor. Filter can have values
+as described in @ref QDir::setNameFilter function documentation.*/
+class ProfileListingEx {
+public:
+ ProfileListingEx(const QString &filter): m_filter(filter) {}
+ void operator() (Profile *profile)
+ {
+ resourceList += profile->resources(m_filter);
+ }
+
+ KURL::List resourceList;
+ QString m_filter;
+};
+
+/**
+Profile engine.
+
+- Uses KDevelop profiles to form lists of plugin offers;
+- Provides means of managing profiles;
+- Provides means to access the resources provided by a profile.
+
+KDevelop profiles form a tree with a root profile named "KDevelop".
+For example, such profiles tree can look as:
+@code
+KDevelop
+- IDE
+ - CompiledLanguageIDE
+ - AdaIDE
+ - CandCppIDE
+ - CIDE
+ - CppIDE
+ - KDECppIDE
+ - FortranIDE
+ ...
+ - DatabaseIDE
+ - ScriptingLanguageIDE
+ ..
+- KDevAssistant
+@endcode
+To manage a tree of profiles, use @ref ProfileEngine::walkProfiles methods.
+*/
+class ProfileEngine {
+public:
+ ProfileEngine();
+ ~ProfileEngine();
+
+ /**Type of the plugin offer. Engine will usually find profiles and return offers
+ of selected type.
+ @sa KDevPlugin class documentation for more information of plugin types.*/
+ enum OfferType {
+ Global /**<Global plugins.*/,
+ Project /**<Project plugins.*/,
+ Core /**<Core plugins.*/
+ };
+
+ /**@return The list of plugin offers for given profile and type.*/
+ KTrader::OfferList offers(const QString &profileName, OfferType offerType);
+ /**@return The list of all plugin offers for given type.*/
+ KTrader::OfferList allOffers(OfferType offerType);
+
+ /**@return The list of URLs to the resources (files) with given @p extension.
+ @param profileName A name of a profile to find resources in.
+ @param nameFilter Name filter for files. @see QDir::setNameFilter documentation
+ for name filters syntax.*/
+ KURL::List resources(const QString &profileName, const QString &nameFilter);
+
+ /**@return The list of URLs to the resources (files) with given @p extension.
+ This list is obtained by a recursive search that process given profile
+ and all it's subprofiles.
+ @param profileName A name of a profile to find resources in.
+ @param nameFilter Name filter for files. @see QDir::setNameFilter documentation
+ for name filters syntax.*/
+ KURL::List resourcesRecursive(const QString &profileName, const QString &nameFilter);
+
+ /**Adds a resource for the profile. Resource will be copied to the user profile directory
+ (like $HOME/.kde/share/apps/kdevelop/profiles/...).
+ @param profileName A name of the profile.
+ @param url The url to a file to copy as a profile resource.*/
+ void addResource(const QString &profileName, const KURL &url);
+
+ /**Gets the difference between @p profile1 and @p profile2.
+ Difference is calculated as two lists of plugins to be unloaded and loaded
+ in order to switch from @p profile1 to @p profile2.
+ @param offerType A type of plugin offers to list.
+ @param profile1 A name of the first profile.
+ @param profile2 A name of the second profile.
+ @param unload Will be filled with a list of plugins to unload.
+ @param load Will be filled with a list of plugins to load.
+ @note Resulting lists are not cleared. Pass only clean lists in the
+ common case.*/
+ void diffProfiles(OfferType offerType, const QString &profile1, const QString &profile2,
+ QStringList &unload, KTrader::OfferList &load);
+
+ /**@return The root profile. Root profile is always named "KDevelop" and it
+ defines an empty list of plugins. Applications built on KDevelop platform
+ will define nested profiles.*/
+ Profile *rootProfile() const { return m_rootProfile; }
+ /**Finds a profile with given name.
+ @return The profile found or 0 if it does not exist.*/
+ Profile *findProfile(const QString &profileName);
+
+ /**Walks profiles tree and applies operation @p op to each profile found
+ in the tree below @p root (@p root profile itself is not processed).
+
+ Operation is a class that have operator(Profile *).
+ Example of operation class which is used to build a plain list of profiles:
+ @code
+ class ProfileListing{
+ public:
+ void operator() (Profile *profile)
+ {
+ profiles[profile->name()] = profile;
+ }
+
+ QMap<QString, Profile*> profiles;
+ };
+ @endcode
+ Use case for such operation - building a list of all profiles:
+ @code
+ ProfileEngine engine;
+ ProfileListing listing;
+ engine.walkProfiles<ProfileListing>(listing, engine.rootProfile());
+ @endcode
+
+ @note @ref ProfileListing and @ref ProfileListingEx operations are already defined in
+ profileengine.h header file.
+
+ @param op An operation to apply.
+ @param root A profile to start walking from. Complete subtree of the @p root is traversed.
+ */
+ template<class Operation>
+ void walkProfiles(Operation &op, Profile *root)
+ {
+ QValueList<Profile*> children = root->children();
+ for (QValueList<Profile*>::iterator it = children.begin(); it != children.end(); ++it)
+ {
+ op(*it);
+ walkProfiles<Operation>(op, *it);
+ }
+ }
+ /**Walks profiles tree and applies operation @p op to each profile
+ found in the tree below @p root (@p root profile itself is not processed)
+ but the operation in this case returns a result of type defined by
+ "Result" template parameter.
+
+ When iterating the tree, the result of operation applied to the parent profile
+ is passed as @p result parameter to the recursive call for child profiles.
+
+ For example, this function can be used to build another hierarcy of profiles
+ or other objects connected to profiles.
+ Example of operation class which is used to build a listview with items
+ where each item represents a profile:
+ @code
+ class ProfileListBuilding {
+ public:
+ ProfileItem * operator() (ProfileItem *parent, Profile *profile)
+ {
+ parent->setOpen(true);
+ return new ProfileItem(parent, profile);
+ }
+ };
+
+ class ProfileItem: public KListViewItem {
+ public:
+ ProfileItem(KListView *parent, Profile *profile)
+ :KListViewItem(parent), m_profile(profile)
+ {
+ setText(0, profile->genericName());
+ setText(1, profile->description());
+ }
+
+ ProfileItem(KListViewItem *parent, Profile *profile)
+ : KListViewItem(parent), m_profile(profile)
+ {
+ setText(0, profile->genericName());
+ setText(1, profile->description());
+ }
+
+ Profile *profile() const { return m_profile; }
+
+ private:
+ Profile *m_profile;
+ };
+
+ @endcode
+ Use case for such operation - building a listview:
+ @code
+ ProfileEngine engine;
+ ProfileItem *item = new ProfileItem(profilesList, engine.rootProfile());
+ ProfileListBuilding op;
+ engine.walkProfiles<ProfileListBuilding, ProfileItem>(op, item, engine.rootProfile());
+ @endcode
+
+ @param op An operation to apply.
+ @param result A result of the operation as it would have been applied to the @p root.
+ @param root A profile to start walking from. Complete subtree of the @p root is traversed.
+ */
+ template<class Operation, class Result>
+ void walkProfiles(Operation &op, Result *result, Profile *root)
+ {
+ QValueList<Profile*> children = root->children();
+ for (QValueList<Profile*>::iterator it = children.begin(); it != children.end(); ++it)
+ {
+ Result *newResult = op(result, *it);
+ walkProfiles<Operation>(op, newResult, *it);
+ }
+ }
+
+protected:
+ void processDir(const QString &dir, const QString &currPath, QMap<QString, Profile*> &passedPaths, Profile *root);
+
+ KURL::List resources(Profile *profile, const QString &nameFilter);
+
+ /**Gets a complete listing of available profiles and looks for a profile.
+ @param listing Profiles listing will be saved here.
+ @param profile Will be a pointer to a profile with the name @p profileName or 0
+ if no profile with that name is found.
+ @param profileName The name of a profile to find.*/
+ void getProfileWithListing(ProfileListing &listing, Profile **profile,
+ const QString &profileName);
+
+private:
+ Profile *m_rootProfile;
+};
+
+#endif
diff --git a/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/Makefile.am
new file mode 100644
index 00000000..43f3c4a3
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/AdaIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/profile.config
new file mode 100644
index 00000000..27e52f63
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/AdaIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Ada IDE profile
+GenericName=Ada IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/Makefile.am
new file mode 100644
index 00000000..2c4bd865
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/profile.config
new file mode 100644
index 00000000..9b0ea064
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=C IDE profile
+GenericName=C IDE
+
+[Properties]
+List=CDevelopment,CProjectDocumentation
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/Makefile.am
new file mode 100644
index 00000000..661d148f
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/profile.config
new file mode 100644
index 00000000..b5b45c4c
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/KDECppIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=C++ IDE for KDE profile
+GenericName=C++ IDE for KDE
+
+[Properties]
+List=KDEDevelopment
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/Makefile.am
new file mode 100644
index 00000000..b094d414
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE
+profiles_DATA = profile.config
+SUBDIRS = KDECppIDE
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/profile.config
new file mode 100644
index 00000000..8167928c
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/CppIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=C++ IDE profile
+GenericName=C++ IDE
+
+[Properties]
+List=CPPDevelopment,CPPProjectDocumentation
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/Makefile.am
new file mode 100644
index 00000000..7ce0bb6b
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS = CIDE CppIDE
+
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/CandCppIDE
+profiles_DATA = profile.config
diff --git a/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/profile.config
new file mode 100644
index 00000000..a25f28e7
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/CandCppIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=C and C++ IDE profile
+GenericName=C and C++ IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/Makefile.am
new file mode 100644
index 00000000..a179dc49
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/FortranIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/profile.config
new file mode 100644
index 00000000..73fdd80c
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/FortranIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Fortran IDE profile
+GenericName=Fortran IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/Makefile.am
new file mode 100644
index 00000000..d131025e
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/HaskellIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/profile.config
new file mode 100644
index 00000000..b015764f
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/HaskellIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Haskell IDE profile
+GenericName=Haskell IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/Makefile.am
new file mode 100644
index 00000000..2bb472df
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/JavaIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/profile.config
new file mode 100644
index 00000000..f91cb5c7
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/JavaIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=kdevdebugger
+
+[Enable]
+List=
+
+[Information]
+Description=Java IDE profile
+GenericName=Java IDE
+
+[Properties]
+List=JavaDevelopment,JavaProjectDocumentation
diff --git a/src/profiles/IDE/CompiledLanguageIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/Makefile.am
new file mode 100644
index 00000000..17e848a0
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/Makefile.am
@@ -0,0 +1,4 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE
+profiles_DATA = profile.config
+
+SUBDIRS = CandCppIDE JavaIDE AdaIDE FortranIDE HaskellIDE PascalIDE
diff --git a/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/Makefile.am b/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/Makefile.am
new file mode 100644
index 00000000..1a3a3132
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/CompiledLanguageIDE/PascalIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/profile.config
new file mode 100644
index 00000000..3098037f
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/PascalIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Pascal IDE profile
+GenericName=Pascal IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/CompiledLanguageIDE/profile.config b/src/profiles/IDE/CompiledLanguageIDE/profile.config
new file mode 100644
index 00000000..5f553b49
--- /dev/null
+++ b/src/profiles/IDE/CompiledLanguageIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Compiled Language IDE profile
+GenericName=Compiled Language IDE
+
+[Properties]
+List=CompiledDevelopment
diff --git a/src/profiles/IDE/DatabaseIDE/Makefile.am b/src/profiles/IDE/DatabaseIDE/Makefile.am
new file mode 100644
index 00000000..e6cc84a8
--- /dev/null
+++ b/src/profiles/IDE/DatabaseIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/DatabaseIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/DatabaseIDE/profile.config b/src/profiles/IDE/DatabaseIDE/profile.config
new file mode 100644
index 00000000..fabcc679
--- /dev/null
+++ b/src/profiles/IDE/DatabaseIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=SQL IDE profile
+GenericName=SQL IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/Makefile.am b/src/profiles/IDE/Makefile.am
new file mode 100644
index 00000000..aebf65da
--- /dev/null
+++ b/src/profiles/IDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE
+profiles_DATA = profile.config
+SUBDIRS = CompiledLanguageIDE ScriptingLanguageIDE DatabaseIDE
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/Makefile.am
new file mode 100644
index 00000000..28f2afbc
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/Makefile.am
@@ -0,0 +1,4 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE
+profiles_DATA = profile.config
+
+SUBDIRS = RubyIDE PerlIDE PHPIDE PythonIDE ShellIDE
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/Makefile.am
new file mode 100644
index 00000000..0dfc6f41
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PHPIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/profile.config
new file mode 100644
index 00000000..f43dba40
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PHPIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=PHP IDE profile
+GenericName=PHP IDE
+
+[Properties]
+List=PHPProjectDocumentation
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/Makefile.am
new file mode 100644
index 00000000..06f94ac1
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PerlIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/profile.config
new file mode 100644
index 00000000..fd33b65c
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PerlIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Perl IDE profile
+GenericName=Perl IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/Makefile.am
new file mode 100644
index 00000000..04a98540
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PythonIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/profile.config
new file mode 100644
index 00000000..db605e85
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/PythonIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Python IDE profile
+GenericName=Python IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/Makefile.am
new file mode 100644
index 00000000..8728ed31
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/RubyIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/profile.config
new file mode 100644
index 00000000..5e58c161
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/RubyIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=kdevfilelist,kdevsnippet,kdevvalgrind,kdevastyle,kdevctags2,kdevsecurity,kdevregexptest
+
+[Enable]
+List=
+
+[Information]
+Description=Ruby IDE profile
+GenericName=Ruby IDE
+
+[Properties]
+List=RubyDebugger
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/Makefile.am b/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/Makefile.am
new file mode 100644
index 00000000..a62bce23
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/ShellIDE
+profiles_DATA = profile.config
+
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/profile.config
new file mode 100644
index 00000000..910f9eb5
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/ShellIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Shell scripting IDE profile
+GenericName=Shell scripting IDE
+
+[Properties]
+List=
diff --git a/src/profiles/IDE/ScriptingLanguageIDE/profile.config b/src/profiles/IDE/ScriptingLanguageIDE/profile.config
new file mode 100644
index 00000000..6b39de13
--- /dev/null
+++ b/src/profiles/IDE/ScriptingLanguageIDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Scripting Language IDE profile
+GenericName=Scripting Language IDE
+
+[Properties]
+List=ScriptDevelopment
diff --git a/src/profiles/IDE/profile.config b/src/profiles/IDE/profile.config
new file mode 100644
index 00000000..0bb6b317
--- /dev/null
+++ b/src/profiles/IDE/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=Generic KDevelop IDE profile
+GenericName=KDevelop IDE
+
+[Properties]
+List=AdditionalTools,CodeEditing,CodeNavigation,Console,Documentation,EditorChooser,FileCreation,FileReplace,FileSearch,GlobalFileManagement,OpenFileNavigation,OptionalCodeEditing,OutputTool,ProjectCreation,ProjectFileGroupsManagement,ProjectFileManagement,UISwitching,ViewManagement,CVSService,ClearcaseVCS,PerforceVCS,SubversionVCS,ProjectPackaging,VCS
diff --git a/src/profiles/KDevAssistant/Makefile.am b/src/profiles/KDevAssistant/Makefile.am
new file mode 100644
index 00000000..f8a5f334
--- /dev/null
+++ b/src/profiles/KDevAssistant/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles/KDevAssistant
+profiles_DATA = profile.config
+
diff --git a/src/profiles/KDevAssistant/profile.config b/src/profiles/KDevAssistant/profile.config
new file mode 100644
index 00000000..dc1435a9
--- /dev/null
+++ b/src/profiles/KDevAssistant/profile.config
@@ -0,0 +1,12 @@
+[Disable]
+List=
+
+[Enable]
+List=
+
+[Information]
+Description=KDevelop Assistant profile
+GenericName=KDevelop Assistant
+
+[Properties]
+List=GlobalFileManagement,Documentation,UISwitching,ViewManagement
diff --git a/src/profiles/Makefile.am b/src/profiles/Makefile.am
new file mode 100644
index 00000000..7d10138d
--- /dev/null
+++ b/src/profiles/Makefile.am
@@ -0,0 +1,3 @@
+profilesdir = $(kde_datadir)/kdevelop/profiles
+profiles_DATA = profile.config
+SUBDIRS = IDE KDevAssistant
diff --git a/src/profiles/profile.config b/src/profiles/profile.config
new file mode 100644
index 00000000..9d884533
--- /dev/null
+++ b/src/profiles/profile.config
@@ -0,0 +1,3 @@
+[Information]
+GenericName=KDevelop
+Description=Default KDevelop profile
diff --git a/src/projectmanager.cpp b/src/projectmanager.cpp
new file mode 100644
index 00000000..3b06340f
--- /dev/null
+++ b/src/projectmanager.cpp
@@ -0,0 +1,668 @@
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qdom.h>
+#include <qstringlist.h>
+#include <qptrlist.h>
+#include <qvbox.h>
+#include <qsize.h>
+#include <qtimer.h>
+
+class QDomDocument;
+
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kservice.h>
+#include <ktrader.h>
+#include <kfiledialog.h>
+#include <kmainwindow.h>
+#include <kparts/componentfactory.h>
+#include <kaction.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kprocess.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kio/netaccess.h>
+#include <ktempfile.h>
+#include <kmenubar.h>
+#include <kstatusbar.h>
+#include <kiconloader.h>
+
+#include "kdevproject.h"
+#include "kdevlanguagesupport.h"
+#include "kdevplugin.h"
+#include "kdevcreatefile.h"
+#include "kdevversioncontrol.h"
+
+
+#include "toplevel.h"
+#include "core.h"
+#include "api.h"
+#include "plugincontroller.h"
+#include "partcontroller.h"
+#include "codemodel.h"
+// #include "partselectwidget.h"
+#include "languageselectwidget.h"
+#include "generalinfowidget.h"
+#include "projectsession.h"
+#include "domutil.h"
+#include "settings.h"
+
+#include "projectmanager.h"
+
+QString ProjectInfo::sessionFile() const
+{
+ QString sf = m_projectURL.path(-1);
+ sf.truncate(sf.length() - 8); // without ".kdevelop"
+ sf += "kdevses"; // suffix for a KDevelop session file
+ return sf;
+}
+
+QString ProjectManager::projectDirectory( const QString& path, bool absolute ) {
+ if(absolute)
+ return path;
+ KURL url(ProjectManager::getInstance()->projectFile(), path);
+ url.cleanPath();
+ return url.path(-1);
+}
+
+ProjectManager *ProjectManager::s_instance = 0;
+
+ProjectManager::ProjectManager()
+: m_info(0L)
+ ,m_pProjectSession(new ProjectSession)
+{
+}
+
+ProjectManager::~ProjectManager()
+{
+ delete m_pProjectSession;
+ delete m_info;
+}
+
+ProjectManager *ProjectManager::getInstance()
+{
+ if (!s_instance)
+ s_instance = new ProjectManager;
+ return s_instance;
+}
+
+void ProjectManager::createActions( KActionCollection* ac )
+{
+ KAction *action;
+
+ action = new KAction(i18n("&Open Project..."), "project_open", 0,
+ this, SLOT(slotOpenProject()),
+ ac, "project_open");
+ action->setToolTip( i18n("Open project"));
+ action->setWhatsThis(i18n("<b>Open project</b><p>Opens a KDevelop3 or KDevelop2 project."));
+
+ m_openRecentProjectAction =
+ new KRecentFilesAction(i18n("Open &Recent Project"), 0,
+ this, SLOT(loadProject(const KURL &)),
+ ac, "project_open_recent");
+ m_openRecentProjectAction->setToolTip(i18n("Open recent project"));
+ m_openRecentProjectAction->setWhatsThis(i18n("<b>Open recent project</b><p>Opens recently opened project."));
+ m_openRecentProjectAction->loadEntries(kapp->config(), "RecentProjects");
+
+ m_closeProjectAction =
+ new KAction(i18n("C&lose Project"), "fileclose",0,
+ this, SLOT(closeProject()),
+ ac, "project_close");
+ m_closeProjectAction->setEnabled(false);
+ m_closeProjectAction->setToolTip(i18n("Close project"));
+ m_closeProjectAction->setWhatsThis(i18n("<b>Close project</b><p>Closes the current project."));
+
+ m_projectOptionsAction = new KAction(i18n("Project &Options"), "configure", 0,
+ this, SLOT(slotProjectOptions()),
+ ac, "project_options" );
+ m_projectOptionsAction->setToolTip(i18n("Project options"));
+ m_projectOptionsAction->setWhatsThis(i18n("<b>Project options</b><p>Lets you customize project options."));
+ m_projectOptionsAction->setEnabled(false);
+}
+
+void ProjectManager::slotOpenProject()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+ QString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/");
+
+ KURL url = KFileDialog::getOpenURL(defaultProjectsDir,
+ i18n("*.kdevelop|KDevelop 3 Project Files\n"
+ "*.kdevprj|KDevelop 2 Project Files"),
+ TopLevel::getInstance()->main(), i18n("Open Project") );
+
+ if( url.isEmpty() )
+ return;
+
+ if (url.path().endsWith("kdevprj"))
+ loadKDevelop2Project( url );
+ else
+ loadProject( url );
+}
+
+void ProjectManager::slotProjectOptions()
+{
+ KDialogBase dlg(KDialogBase::IconList, i18n("Project Options"),
+ KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, TopLevel::getInstance()->main(),
+ "project options dialog");
+
+ QVBox *box = dlg.addVBoxPage( i18n("General"), i18n("General"), BarIcon( "kdevelop", KIcon::SizeMedium ) );
+ GeneralInfoWidget *g = new GeneralInfoWidget(*API::getInstance()->projectDom(), box, "general informations widget");
+ connect (&dlg, SIGNAL(okClicked()), g, SLOT(accept()));
+
+ KConfig *config = kapp->config();
+ config->setGroup("Project Settings Dialog");
+ int height = config->readNumEntry( "Height", 600 );
+ int width = config->readNumEntry( "Width", 800 );
+
+ dlg.resize( width, height );
+
+ Core::getInstance()->doEmitProjectConfigWidget(&dlg);
+ dlg.exec();
+
+ saveProjectFile();
+
+ config->setGroup("Project Settings Dialog");
+ config->writeEntry( "Height", dlg.size().height() );
+ config->writeEntry( "Width", dlg.size().width() );
+}
+
+void ProjectManager::loadSettings()
+{
+}
+
+void ProjectManager::saveSettings()
+{
+ KConfig *config = kapp->config();
+
+ if (projectLoaded())
+ {
+ config->setGroup("General Options");
+ config->writePathEntry("Last Project", ProjectManager::getInstance()->projectFile().url());
+ }
+
+ m_openRecentProjectAction->saveEntries(config, "RecentProjects");
+}
+
+void ProjectManager::loadDefaultProject()
+{
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+ QString project = config->readPathEntry("Last Project");
+ bool readProject = config->readBoolEntry("Read Last Project On Startup", true);
+ if (!project.isEmpty() && readProject)
+ {
+ loadProject(KURL(project));
+ }
+}
+
+bool ProjectManager::loadProject(const KURL &projectURL)
+{
+ KURL url = projectURL;
+
+ if (!url.isValid())
+ return false;
+
+ if (url.isLocalFile())
+ {
+ QDir dir(url.path());
+ QString can_path = dir.canonicalPath();
+ //if the directory doesn't exist, the returned string is null which confuses the user later on. so better short-cut here
+ if(can_path.isNull())
+ return false;
+ else
+ url.setPath(can_path);
+ }
+
+ // reopen the already opened project?
+ if( projectLoaded() && url.path() == projectFile().path() )
+ {
+ if (KMessageBox::questionYesNo(TopLevel::getInstance()->main(),
+ i18n("Are you sure you want to reopen the current project?"), QString::null, i18n("Reopen"), i18n("Do Not Reopen")) == KMessageBox::No)
+ return false;
+ }
+
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( false );
+ kapp->setOverrideCursor( waitCursor );
+
+ if( projectLoaded() && !closeProject() )
+ {
+ m_openRecentProjectAction->setCurrentItem( -1 );
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( true );
+ kapp->restoreOverrideCursor();
+ return false;
+ }
+
+ m_info = new ProjectInfo;
+ m_info->m_projectURL = url;
+
+ QTimer::singleShot( 0, this, SLOT(slotLoadProject()) );
+
+ // no one cares about this value
+ return true;
+}
+
+void ProjectManager::slotLoadProject( )
+{
+ if( !loadProjectFile() )
+ {
+ m_openRecentProjectAction->removeURL(m_info->m_projectURL);
+ delete m_info; m_info = 0;
+ saveSettings();
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( true );
+ kapp->restoreOverrideCursor();
+ return;
+ }
+
+ getGeneralInfo();
+
+ if( !loadLanguageSupport(m_info->m_language) ) {
+ delete m_info; m_info = 0;
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( true );
+ kapp->restoreOverrideCursor();
+ return;
+ }
+
+ if( !loadProjectPart() ) {
+ unloadLanguageSupport();
+ delete m_info; m_info = 0;
+ API::getInstance()->setProjectDom( 0 );
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( true );
+ kapp->restoreOverrideCursor();
+ return;
+ }
+
+ TopLevel::getInstance()->statusBar()->message( i18n("Changing plugin profile...") );
+ m_oldProfileName = PluginController::getInstance()->changeProfile(m_info->m_profileName);
+
+ TopLevel::getInstance()->statusBar()->message( i18n("Loading project plugins...") );
+ loadLocalParts();
+
+ // shall we try to load a session file from network?? Probably not.
+ if (m_info->m_projectURL.isLocalFile())
+ {
+ // first restore the project session stored in a .kdevses file
+ if (!m_pProjectSession->restoreFromFile(m_info->sessionFile(), PluginController::getInstance()->loadedPlugins() ))
+ {
+ kdWarning() << i18n("error during restoring of the KDevelop session !") << endl;
+ }
+ }
+#if KDE_IS_VERSION(3,5,0)
+ m_openRecentProjectAction->addURL(projectFile(), projectName()); // KDE >= 3.5.x
+#else
+ m_openRecentProjectAction->addURL(projectFile()); // KDE 3.4.x
+#endif
+ m_closeProjectAction->setEnabled(true);
+ m_projectOptionsAction->setEnabled(true);
+
+ Core::getInstance()->doEmitProjectOpened();
+
+ TopLevel::getInstance()->main()->menuBar()->setEnabled( true );
+ kapp->restoreOverrideCursor();
+
+ TopLevel::getInstance()->statusBar()->message( i18n("Project loaded."), 3000 );
+
+ return;
+}
+
+
+bool ProjectManager::closeProject( bool exiting )
+{
+ if( !projectLoaded() )
+ return true;
+
+ // save the session if it is a local file
+ if (m_info->m_projectURL.isLocalFile())
+ {
+ m_pProjectSession->saveToFile(m_info->sessionFile(), PluginController::getInstance()->loadedPlugins() );
+ }
+
+ if ( !PartController::getInstance()->querySaveFiles() )
+ return false;
+
+ Core::getInstance()->doEmitProjectClosed();
+
+ PluginController::getInstance()->unloadProjectPlugins();
+ PluginController::getInstance()->changeProfile(m_oldProfileName);
+ unloadLanguageSupport();
+ unloadProjectPart();
+
+ /// @todo if this fails, user is screwed
+ saveProjectFile();
+
+ API::getInstance()->setProjectDom(0);
+ API::getInstance()->codeModel()->wipeout();
+
+ delete m_info;
+ m_info = 0;
+
+ m_closeProjectAction->setEnabled(false);
+ m_projectOptionsAction->setEnabled(false);
+
+ if ( !exiting )
+ {
+ PartController::getInstance()->slotCloseAllWindows();
+ }
+
+ return true;
+}
+
+bool ProjectManager::loadProjectFile()
+{
+ QString path;
+ if (!KIO::NetAccess::download(m_info->m_projectURL, path, 0)) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("Could not read project file: %1").arg(m_info->m_projectURL.prettyURL()));
+ return false;
+ }
+
+ QFile fin(path);
+ if (!fin.open(IO_ReadOnly))
+ {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("Could not read project file: %1").arg(m_info->m_projectURL.prettyURL()));
+ return false;
+ }
+
+ int errorLine, errorCol;
+ QString errorMsg;
+ if (!m_info->m_document.setContent(&fin, &errorMsg, &errorLine, &errorCol))
+ {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("This is not a valid project file.\n"
+ "XML error in line %1, column %2:\n%3")
+ .arg(errorLine).arg(errorCol).arg(errorMsg));
+ fin.close();
+ KIO::NetAccess::removeTempFile(path);
+ return false;
+ }
+ if (m_info->m_document.documentElement().nodeName() != "kdevelop")
+ {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("This is not a valid project file."));
+ fin.close();
+ KIO::NetAccess::removeTempFile(path);
+ return false;
+ }
+
+ fin.close();
+ KIO::NetAccess::removeTempFile(path);
+
+ API::getInstance()->setProjectDom(&m_info->m_document);
+
+ return true;
+}
+
+bool ProjectManager::saveProjectFile()
+{
+ Q_ASSERT( API::getInstance()->projectDom() );
+
+ if (m_info->m_projectURL.isLocalFile()) {
+ QFile fout(m_info->m_projectURL.path());
+ if( !fout.open(IO_WriteOnly) ) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(), i18n("Could not write the project file."));
+ return false;
+ }
+
+ QTextStream stream(&fout);
+ API::getInstance()->projectDom()->save(stream, 2);
+ fout.close();
+ } else {
+ KTempFile fout(QString::fromLatin1("kdevelop3"));
+ fout.setAutoDelete(true);
+ if (fout.status() != 0) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(), i18n("Could not write the project file."));
+ return false;
+ }
+ API::getInstance()->projectDom()->save(*(fout.textStream()), 2);
+ fout.close();
+ KIO::NetAccess::upload(fout.name(), m_info->m_projectURL, 0);
+ }
+
+ return true;
+}
+
+static QString getAttribute(QDomElement elem, QString attr)
+{
+ QDomElement el = elem.namedItem(attr).toElement();
+ return el.firstChild().toText().data();
+}
+
+static void getAttributeList(QDomElement elem, QString attr, QString tag, QStringList &list)
+{
+ list.clear();
+
+ QDomElement el = elem.namedItem(attr).toElement();
+ QDomElement item = el.firstChild().toElement();
+ while (!item.isNull())
+ {
+ if (item.tagName() == tag)
+ list << item.firstChild().toText().data();
+ item = item.nextSibling().toElement();
+ }
+}
+
+void ProjectManager::getGeneralInfo()
+{
+ QDomElement docEl = m_info->m_document.documentElement();
+ QDomElement generalEl = docEl.namedItem("general").toElement();
+
+ m_info->m_projectPlugin = getAttribute(generalEl, "projectmanagement");
+ m_info->m_vcsPlugin = getAttribute(generalEl, "versioncontrol");
+ m_info->m_language = getAttribute(generalEl, "primarylanguage");
+ m_info->m_projectName = getAttribute(generalEl, "projectname");
+ if( m_info->m_projectName.isEmpty() )
+ {
+ m_info->m_projectName = m_info->m_projectURL.filename();
+ m_info->m_projectName = m_info->m_projectName.left(m_info->m_projectName.length()-QString(".kdevelop").length());
+ QDomElement prjname = m_info->m_document.createElement("projectname");
+ prjname.appendChild( m_info->m_document.createTextNode( m_info->m_projectName) );
+ generalEl.appendChild( prjname );
+ }
+
+ getAttributeList(generalEl, "ignoreparts", "part", m_info->m_ignoreParts);
+ getAttributeList(generalEl, "keywords", "keyword", m_info->m_keywords);
+
+ //FIXME: adymo: workaround for those project templates without "profile" element
+// m_info->m_profileName = getAttribute(generalEl, "profile");
+ QDomElement el = generalEl.namedItem("profile").toElement();
+ if (el.isNull())
+// m_info->m_profileName = profileByAttributes(m_info->m_language, m_info->m_keywords);
+ m_info->m_profileName = Settings::profileByAttributes(m_info->m_language, m_info->m_keywords);
+ else
+ m_info->m_profileName = el.firstChild().toText().data();
+}
+
+bool ProjectManager::loadProjectPart()
+{
+ KService::Ptr projectService = KService::serviceByDesktopName(m_info->m_projectPlugin);
+ if (!projectService) {
+ // this is for backwards compatibility with pre-alpha6 projects
+ projectService = KService::serviceByDesktopName(m_info->m_projectPlugin.lower());
+ }
+ if (!projectService) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("No project management plugin %1 found.")
+ .arg(m_info->m_projectPlugin));
+ return false;
+ }
+
+ KDevProject *projectPart = KParts::ComponentFactory
+ ::createInstanceFromService< KDevProject >( projectService, API::getInstance(), 0,
+ PluginController::argumentsFromService( projectService ) );
+ if ( !projectPart ) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("Could not create project management plugin %1.")
+ .arg(m_info->m_projectPlugin));
+ return false;
+ }
+
+ API::getInstance()->setProject( projectPart );
+
+ QDomDocument& dom = *API::getInstance()->projectDom();
+ QString path = DomUtil::readEntry(dom,"/general/projectdirectory", ".");
+ bool absolute = DomUtil::readBoolEntry(dom,"/general/absoluteprojectpath",false);
+ QString projectDir = projectDirectory( path, absolute );
+ kdDebug(9000) << "projectDir: " << projectDir << " projectName: " << m_info->m_projectName << endl;
+
+ projectPart->openProject(projectDir, m_info->m_projectName);
+
+ PluginController::getInstance()->integratePart( projectPart );
+
+ return true;
+}
+
+void ProjectManager::unloadProjectPart()
+{
+ KDevProject *projectPart = API::getInstance()->project();
+ if( !projectPart ) return;
+ PluginController::getInstance()->removePart( projectPart );
+ projectPart->closeProject();
+ delete projectPart;
+ API::getInstance()->setProject(0);
+}
+
+bool ProjectManager::loadLanguageSupport(const QString& lang)
+{
+ kdDebug(9000) << "Looking for language support for " << lang << endl;
+
+ if (lang == m_info->m_activeLanguage)
+ {
+ kdDebug(9000) << "Language support already loaded" << endl;
+ return true;
+ }
+
+ KTrader::OfferList languageSupportOffers =
+ KTrader::self()->query(QString::fromLatin1("KDevelop/LanguageSupport"),
+ QString::fromLatin1("[X-KDevelop-Language] == '%1' and [X-KDevelop-Version] == %2").arg(lang).arg(KDEVELOP_PLUGIN_VERSION));
+
+ if (languageSupportOffers.isEmpty()) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("No language plugin for %1 found.")
+ .arg(lang));
+ return false;
+ }
+
+ KService::Ptr languageSupportService = *languageSupportOffers.begin();
+ KDevLanguageSupport *langSupport = KParts::ComponentFactory
+ ::createInstanceFromService<KDevLanguageSupport>( languageSupportService,
+ API::getInstance(),
+ 0,
+ PluginController::argumentsFromService( languageSupportService ) );
+
+ if ( !langSupport ) {
+ KMessageBox::sorry(TopLevel::getInstance()->main(),
+ i18n("Could not create language plugin for %1.")
+ .arg(lang));
+ return false;
+ }
+
+ API::getInstance()->setLanguageSupport( langSupport );
+ PluginController::getInstance()->integratePart( langSupport );
+ m_info->m_activeLanguage = lang;
+ kdDebug(9000) << "Language support for " << lang << " successfully loaded." << endl;
+ return true;
+}
+
+void ProjectManager::unloadLanguageSupport()
+{
+ KDevLanguageSupport *langSupport = API::getInstance()->languageSupport();
+ if( !langSupport ) return;
+ kdDebug(9000) << "Language support for " << langSupport->name() << " unloading..." << endl;
+ PluginController::getInstance()->removePart( langSupport );
+ delete langSupport;
+ API::getInstance()->setLanguageSupport(0);
+}
+
+void ProjectManager::loadLocalParts()
+{
+ // Make sure to refresh load/ignore lists
+ getGeneralInfo();
+
+ PluginController::getInstance()->unloadPlugins( m_info->m_ignoreParts );
+ PluginController::getInstance()->loadProjectPlugins( m_info->m_ignoreParts );
+ PluginController::getInstance()->loadGlobalPlugins( m_info->m_ignoreParts );
+}
+
+KURL ProjectManager::projectFile() const
+{
+ if (!m_info)
+ return KURL();
+ return m_info->m_projectURL;
+}
+
+QString ProjectManager::projectName() const
+{
+ if (!m_info) return QString();
+
+ return m_info->m_projectName;
+}
+
+bool ProjectManager::projectLoaded() const
+{
+ return m_info != 0;
+}
+
+ProjectSession* ProjectManager::projectSession() const
+{
+ return m_pProjectSession;
+}
+
+bool ProjectManager::loadKDevelop2Project( const KURL & url )
+{
+ if( !url.isValid() || !url.isLocalFile() ){
+ KMessageBox::sorry(0, i18n("Invalid URL."));
+ return false;
+ }
+
+ QString cmd = KGlobal::dirs()->findExe( "kdevprj2kdevelop" );
+ if (cmd.isEmpty()) {
+ KMessageBox::sorry(0, i18n("You do not have 'kdevprj2kdevelop' installed."));
+ return false;
+ }
+
+ QFileInfo fileInfo( url.path() );
+
+ KShellProcess proc( "/bin/sh" );
+ proc.setWorkingDirectory( fileInfo.dirPath(true) );
+ proc << "perl" << cmd << KShellProcess::quote( url.path() );
+ proc.start( KProcess::Block );
+
+ QString projectFile = fileInfo.dirPath( true ) + "/" + fileInfo.baseName() + ".kdevelop";
+ return loadProject( KURL(projectFile) );
+}
+
+// QString ProjectManager::profileByAttributes(const QString &language, const QStringList &keywords)
+// {
+// KConfig config(locate("data", "kdevelop/profiles/projectprofiles"));
+// config.setGroup(language);
+//
+// QStringList profileKeywords = QStringList::split("/", "Empty");
+// if (config.hasKey("Keywords"))
+// profileKeywords = config.readListEntry("Keywords");
+//
+// int idx = 0;
+// for (QStringList::const_iterator it = profileKeywords.constBegin();
+// it != profileKeywords.constEnd(); ++it)
+// {
+// if (keywords.contains(*it))
+// {
+// idx = profileKeywords.findIndex(*it);
+// break;
+// }
+// }
+//
+// QStringList profiles;
+// if (config.hasKey("Profiles"))
+// {
+// profiles = config.readListEntry("Profiles");
+// kdDebug() << "IDX: " << idx << " PROFILE: " << profiles[idx] << endl;
+// return profiles[idx];
+// }
+// return "KDevelop";
+// }
+
+#include "projectmanager.moc"
diff --git a/src/projectmanager.h b/src/projectmanager.h
new file mode 100644
index 00000000..1cfb07d6
--- /dev/null
+++ b/src/projectmanager.h
@@ -0,0 +1,111 @@
+#ifndef __PROJECTMANAGER_H__
+#define __PROJECTMANAGER_H__
+
+
+#include <qstring.h>
+#include <qobject.h>
+#include <qdict.h>
+
+
+#include <kxmlguiclient.h>
+#include <kservice.h>
+#include <kurl.h>
+
+class KAction;
+class KSelectAction;
+class KService;
+class ProjectInfo;
+class ProjectSession;
+class KRecentFilesAction;
+class KDevPlugin;
+
+
+class ProjectInfo
+{
+public:
+ KURL m_projectURL;
+ QDomDocument m_document;
+ QString m_profileName;
+ QString m_projectName;
+ QString m_projectPlugin, m_language, m_activeLanguage, m_vcsPlugin;
+ QStringList m_ignoreParts, m_keywords;
+
+ QString sessionFile() const;
+};
+
+/**
+Project manager.
+Loads and unloads projects.
+*/
+class ProjectManager : public QObject, public KXMLGUIClient
+{
+ Q_OBJECT
+
+public:
+
+ ~ProjectManager();
+
+ static QString projectDirectory( const QString& path, bool absolute );
+
+ static ProjectManager *getInstance();
+
+ void loadSettings();
+ void saveSettings();
+ void loadDefaultProject();
+
+ bool projectLoaded() const;
+
+ KURL projectFile() const;
+ QString projectName() const;
+
+ void createActions( KActionCollection* ac );
+
+ ProjectSession* projectSession() const;
+
+public slots:
+ bool loadProject( const KURL& url);
+ bool loadKDevelop2Project( const KURL& url);
+ bool closeProject( bool exiting = false );
+
+private slots:
+ void slotOpenProject();
+ void slotProjectOptions();
+
+ void slotLoadProject();
+
+ void loadLocalParts();
+
+private:
+ ProjectManager();
+
+ void setupActions();
+ void getGeneralInfo();
+
+ bool loadProjectFile();
+ bool saveProjectFile();
+
+ bool loadProjectPart();
+ void unloadProjectPart();
+
+ bool loadLanguageSupport(const QString& lang);
+ void unloadLanguageSupport();
+
+// QString profileByAttributes(const QString &language, const QStringList &keywords);
+
+ ProjectInfo *m_info;
+
+ KAction *m_closeProjectAction, *m_projectOptionsAction;
+ KRecentFilesAction *m_openRecentProjectAction;
+
+ static ProjectManager *s_instance;
+
+ ProjectSession* m_pProjectSession;
+
+ KDevPlugin *m_vcsPlugin;
+ QString m_vcsName;
+
+ QString m_oldProfileName;
+};
+
+
+#endif
diff --git a/src/projectprofiles b/src/projectprofiles
new file mode 100644
index 00000000..d2224272
--- /dev/null
+++ b/src/projectprofiles
@@ -0,0 +1,39 @@
+[Ada]
+Profiles=AdaIDE
+
+[Bash]
+Profiles=ShellIDE
+
+[C]
+Profiles=CIDE
+
+[C++]
+Keywords=Empty,KDE
+Profiles=CppIDE,KDECppIDE
+
+[Fortran77]
+Profiles=FortranIDE
+
+[Haskell]
+Profiles=HaskellIDE
+
+[Java]
+Profiles=JavaIDE
+
+[Pascal]
+Profiles=PascalIDE
+
+[Perl]
+Profiles=PerlIDE
+
+[PHP]
+Profiles=PHPIDE
+
+[Python]
+Profiles=PythonIDE
+
+[Ruby]
+Profiles=RubyIDE
+
+[SQL]
+Profiles=DatabaseIDE
diff --git a/src/projectsession.cpp b/src/projectsession.cpp
new file mode 100644
index 00000000..be3ec4a1
--- /dev/null
+++ b/src/projectsession.cpp
@@ -0,0 +1,450 @@
+/***************************************************************************
+ projectsession.cpp - description
+ -------------------
+ begin : 30 Nov 2002
+ copyright : (C) 2002 by Falk Brettschneider
+ email : falk@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdom.h>
+#include <qptrlist.h>
+#include <qfile.h>
+#include <qtimer.h>
+
+#include <kparts/part.h>
+#include <kurl.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kinstance.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <ktexteditor/document.h>
+#include <ktexteditor/encodinginterface.h>
+
+#include "api.h"
+#include "partcontroller.h"
+#include "domutil.h"
+#include "documentationpart.h"
+#include "toplevel.h"
+#include "kdevplugin.h"
+
+#include "projectsession.h"
+#include "projectsession.moc"
+//---------------------------------------------------------------------------
+ProjectSession::ProjectSession()
+{
+ initXMLTree();
+}
+
+//---------------------------------------------------------------------------
+ProjectSession::~ProjectSession()
+{
+}
+
+//---------------------------------------------------------------------------
+void ProjectSession::initXMLTree()
+{
+ // initializes the XML tree on startup of kdevelop and when a project
+ // has been closed to ensure that the XML tree exists already including
+ // doctype when a project gets opened that doesn't have a kdevses file
+ // or a new project gets generated (which doesn't have a kdevses file
+ // either as the project has never been closed before opening it).
+ domdoc.clear();
+ QDomDocument doc("KDevPrjSession");
+ domdoc=doc;
+ domdoc.appendChild( domdoc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );
+ // KDevPrjSession is the root element of the XML file
+ QDomElement session = domdoc.documentElement();
+ session = domdoc.createElement("KDevPrjSession");
+ domdoc.appendChild( session);
+}
+
+//---------------------------------------------------------------------------
+bool ProjectSession::restoreFromFile( const QString & sessionFileName, const QValueList< KDevPlugin * > plugins )
+{
+ bool bFileOpenOK = true;
+
+ QFile f(sessionFileName);
+ if ( f.open(IO_ReadOnly) ) { // file opened successfully
+ bool ok = domdoc.setContent( &f);
+ f.close();
+ if (!ok) {
+ KMessageBox::sorry(0L,
+ i18n("The file %1 does not contain valid XML.\n"
+ "The loading of the session failed.").arg(sessionFileName));
+ initXMLTree(); // because it was now broken after failed setContent()
+ return false;
+ }
+ }
+ else {
+ bFileOpenOK = false;
+ }
+
+ // Check for proper document type.
+ if (domdoc.doctype().name() != "KDevPrjSession") {
+ KMessageBox::sorry(0L,
+ i18n("The file %1 does not contain a valid KDevelop project session ('KDevPrjSession').\n").arg(sessionFileName)
+ + i18n("The document type seems to be: '%1'.").arg(domdoc.doctype().name()));
+ return false;
+ }
+
+ QDomElement session = domdoc.documentElement();
+
+ // read the information about the mainframe widget
+ if (bFileOpenOK) {
+ recreateDocs(session);
+ }
+
+ // now also let the plugins load their session stuff
+ QDomElement pluginListEl = session.namedItem("pluginList").toElement();
+ QValueList<KDevPlugin*>::ConstIterator it = plugins.begin();
+ while( it != plugins.end() )
+ {
+ KDevPlugin* pPlugin = (*it);
+ QString pluginName = pPlugin->instance()->instanceName();
+ QDomElement pluginEl = pluginListEl.namedItem(pluginName).toElement();
+ if (!pluginEl.isNull()) {
+ // now plugin, load what you find!
+ pPlugin->restorePartialProjectSession(&pluginEl);
+ }
+ ++it;
+ }
+
+ QTimer::singleShot( 0, this, SLOT(loadDocument()) );
+
+ return true;
+}
+
+//---------------------------------------------------------------------------
+void ProjectSession::recreateDocs(QDomElement& el)
+{
+//// QDomElement mainframeEl = el.namedItem("Mainframe").toElement();
+//// bool bMaxMode =initXMLTree() (bool) mainframeEl.attribute("MaximizeMode", "0").toInt();
+//// QextMdiMainFrm* pMainWidget = (QextMdiMainFrm*) qApp->mainWidget();
+//// pMainWidget->setEnableMaximizedChildFrmMode(bMaxMode);
+//// bool bTaskBarWasOn = pMainWidget->isViewTaskBarOn();
+//// pMainWidget->hideViewTaskBar();
+
+ // read the information about the documents
+ QDomElement docsAndViewsEl = el.namedItem("DocsAndViews").toElement();
+ int nNrOfDocs = docsAndViewsEl.attribute("NumberOfDocuments", "0").toInt();
+ // loop over all docs
+ int nDoc = 0;
+ QDomElement docEl;
+ for (docEl = docsAndViewsEl.firstChild().toElement(), nDoc = 0;
+ nDoc < nNrOfDocs;
+ nDoc++, docEl = docEl.nextSibling().toElement())
+ {
+ // read the document name and type
+ QString docName = docEl.attribute( "URL", "");
+ if (!docName.isEmpty() /* && URL::exists(docName)*/) {
+ KURL url(docName);
+ // create the views of this document, the first view creation will also create the document
+ kdDebug() << k_funcinfo << "Doc to be activated? " << (nDoc == nNrOfDocs - 1) << endl;
+ recreateViews(url, docEl, (nDoc == nNrOfDocs - 1));
+ }
+ }
+
+ //FIXME: God, I hate KMDI. What the hell is this?
+/* if (nNrOfDocs > 0) {
+ API::getInstance()->mainWindow()->callCommand("qextmdi-UI: do hack on session loading finished");
+ }*/
+//// if (bTaskBarWasOn) {
+//// pMainWidget->showViewTaskBar();
+//// }
+}
+
+//---------------------------------------------------------------------------
+void ProjectSession::recreateViews(KURL& url, QDomElement docEl, bool activate)
+{
+ // read information about the views
+ int nNrOfViews = docEl.attribute( "NumberOfViews", "0").toInt();
+
+ // we should restore every view, but right now we only support a single view per document
+ // so use this simple method for now
+
+ if ( nNrOfViews > 0 )
+ {
+ QDomElement viewEl = docEl.firstChild().toElement();
+ DocumentData dd;
+ dd.type = viewEl.attribute("Type");
+ dd.line = viewEl.attribute("line", "0").toInt();
+ dd.url = url;
+ dd.activate = activate;
+ dd.encoding = viewEl.attribute( "Encoding" );
+
+ _docDataList << dd;
+ }
+
+/*
+ // loop over all views of this document
+ int nView = 0;
+
+ QDomElement viewEl;
+ QString viewType;
+ QString context;
+ if (docEl.hasAttribute("context")) {
+ context = docEl.attribute("context");
+ }
+
+ for (viewEl = docEl.firstChild().toElement(), nView = 0; nView < nNrOfViews; nView++, viewEl = viewEl.nextSibling().toElement()) {
+
+//// // is it the focused view? (XXX well, this only refers to the module instance)
+//// if (viewEl.attribute( "Focus", "0").toInt()) {
+//// // yes, memorize for later use
+//// pFocusedView = pView;
+//// }
+
+ if (context.isEmpty()) {
+ int line = 0;
+ if (viewEl.hasAttribute("line")) {
+ line = viewEl.attribute("line", "0").toInt();
+ }
+ PartController::getInstance()->editDocument(url, line);
+ }
+ else {
+ PartController::getInstance()->showDocument(url);
+ }
+ QDomElement viewPropertiesEl = viewEl.namedItem("AdditionalSettings").toElement();
+ if (!viewPropertiesEl.isNull()) {
+ emit sig_restoreAdditionalViewProperties(url.url(), &viewPropertiesEl);
+ }
+
+ }
+//// // restore focus
+//// if (pFocusedView != 0L) {
+//// if (pFocusedView->parentWidget()->inherits("QextMdiChildView")) {
+//// ((QextMdiChildView*)pFocusedView->parentWidget())->activate();
+//// }
+//// pFocusedView->setFocus();
+//// }
+*/
+}
+
+//---------------------------------------------------------------------------
+bool ProjectSession::saveToFile( const QString & sessionFileName, const QValueList< KDevPlugin * > plugins )
+{
+ QString section, keyword;
+ QDomElement session = domdoc.documentElement();
+
+ int nDocs = 0;
+ QString docIdStr;
+
+//// // read the information about the mainframe widget
+//// QDomElement mainframeEl = session.namedItem("Mainframe").toElement();
+//// if(mainframeEl.isNull()){
+//// mainframeEl=domdoc.createElement("Mainframe");
+//// session.appendChild( mainframeEl);
+//// }
+//// bool bMaxMode = ((QextMdiMainFrm*)m_pDocViewMan->parent())->isInMaximizedChildFrmMode();
+//// mainframeEl.setAttribute("MaximizeMode", bMaxMode);
+
+
+ // read the information about the documents
+ QDomElement docsAndViewsEl = session.namedItem("DocsAndViews").toElement();
+ if (docsAndViewsEl.isNull()) {
+ docsAndViewsEl = domdoc.createElement("DocsAndViews");
+ session.appendChild( docsAndViewsEl);
+ }
+ else {
+ // we need to remove the old ones before memorizing the current ones (to avoid merging)
+ QDomNode n = docsAndViewsEl.firstChild();
+ while ( !n.isNull() ) {
+ QDomNode toBeRemoved = n;
+ n = n.nextSibling();
+ docsAndViewsEl.removeChild(toBeRemoved);
+ }
+ }
+
+ QPtrListIterator<KParts::Part> it( *PartController::getInstance()->parts() );
+ for ( ; it.current(); ++it )
+ {
+
+ KParts::ReadOnlyPart* pReadOnlyPart = dynamic_cast<KParts::ReadOnlyPart*>(it.current());
+ if (!pReadOnlyPart)
+ continue;
+
+ QString url = pReadOnlyPart->url().url();
+
+ docIdStr.setNum(nDocs);
+ QDomElement docEl = domdoc.createElement("Doc" + docIdStr);
+ docEl.setAttribute( "URL", url);
+ docsAndViewsEl.appendChild( docEl);
+ nDocs++;
+ docEl.setAttribute( "NumberOfViews", 1);
+
+ QDomElement viewEl = domdoc.createElement( "View0");
+ docEl.appendChild( viewEl);
+
+ if ( dynamic_cast<HTMLDocumentationPart*>(pReadOnlyPart) )
+ {
+ viewEl.setAttribute("Type", "Documentation");
+ }
+ else if ( pReadOnlyPart->inherits("KTextEditor::Document") )
+ {
+ viewEl.setAttribute("Type", "Source");
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(pReadOnlyPart->widget());
+ if (iface) {
+ unsigned int line, col;
+ iface->cursorPosition(&line, &col);
+ viewEl.setAttribute( "line", line );
+ }
+ if ( KTextEditor::EncodingInterface * ei = dynamic_cast<KTextEditor::EncodingInterface*>( pReadOnlyPart ) )
+ {
+ QString encoding = ei->encoding();
+ if ( !encoding.isNull() )
+ {
+ viewEl.setAttribute( "Encoding", encoding );
+ }
+ }
+ }
+ else
+ {
+ viewEl.setAttribute("Type", "Other");
+ }
+ }
+
+/*
+ QPtrListIterator<KParts::Part> it( *PartController::getInstance()->parts() );
+ for ( ; it.current(); ++it ) {
+//// QString partName = it.current()->name();
+//// QMessageBox::information(0L,"",partName);
+
+ KParts::ReadOnlyPart* pReadOnlyPart = dynamic_cast<KParts::ReadOnlyPart*>(it.current());
+ if (!pReadOnlyPart)
+ continue; // note: read-write parts are also a read-only part, they inherit from it
+
+ HTMLDocumentationPart* pDocuPart = dynamic_cast<HTMLDocumentationPart*>(pReadOnlyPart);
+
+ /// @todo Save relative path for project sharing?
+ QString url = pReadOnlyPart->url().url();
+
+ docIdStr.setNum(nDocs);
+ QDomElement docEl = domdoc.createElement("Doc" + docIdStr);
+ docEl.setAttribute( "URL", url);
+ docsAndViewsEl.appendChild( docEl);
+ nDocs++;
+//// docEl.setAttribute( "Type", "???");
+//// // get the view list
+//// QPtrList<KWpEditorPartriteView> viewList = pDoc->viewList();
+//// // write the number of views
+//// docEl.setAttribute( "NumberOfViews", viewList.count());
+ docEl.setAttribute( "NumberOfViews", 1);
+ // loop over all views of this document
+ int nView = 0;
+//// KWriteView* pView = 0L;
+ QString viewIdStr;
+//// for (viewList.first(), nView = 0; viewList.current() != 0; viewList.next(), nView++) {
+//// pView = viewList.current();
+//// if (pView != 0L) {
+ viewIdStr.setNum( nView);
+ QDomElement viewEl = domdoc.createElement( "View"+viewIdStr);
+ docEl.appendChild( viewEl);
+ // focus?
+//// viewEl.setAttribute("Focus", (((CEditWidget*)pView->parentWidget()) == m_pDocViewMan->currentEditView()));
+ viewEl.setAttribute("Type", "???");
+
+ QDomElement viewPropertiesEl = domdoc.createElement("AdditionalSettings");
+ viewEl.appendChild(viewPropertiesEl);
+ emit sig_saveAdditionalViewProperties(url, &viewPropertiesEl);
+
+ if (pReadOnlyPart->inherits("KTextEditor::Document")) {
+ KTextEditor::ViewCursorInterface *iface = dynamic_cast<KTextEditor::ViewCursorInterface*>(pReadOnlyPart->widget());
+ if (iface) {
+ unsigned int line, col;
+ iface->cursorPosition(&line, &col);
+ viewEl.setAttribute( "line", line );
+ }
+ }
+
+ if (pDocuPart) {
+ docEl.setAttribute( "context", pDocuPart->context() );
+ }
+ }
+*/
+ docsAndViewsEl.setAttribute("NumberOfDocuments", nDocs);
+
+
+ // now also let the project-related plugins save their session stuff
+ // read the information about the documents
+ QDomElement pluginListEl = session.namedItem("pluginList").toElement();
+ if (pluginListEl.isNull()) {
+ pluginListEl = domdoc.createElement("pluginList");
+ session.appendChild( pluginListEl);
+ }
+ else {
+ // we need to remove the old ones before memorizing the current ones (to avoid merging)
+ QDomNode n = pluginListEl.firstChild();
+ while ( !n.isNull() ) {
+ QDomNode toBeRemoved = n;
+ n = n.nextSibling();
+ pluginListEl.removeChild(toBeRemoved);
+ }
+ }
+
+ QValueList<KDevPlugin*>::ConstIterator itt = plugins.begin();
+ while( itt != plugins.end() )
+ {
+ KDevPlugin* pPlugin = (*itt);
+ QString pluginName = pPlugin->instance()->instanceName();
+ QDomElement pluginEl = domdoc.createElement(pluginName);
+
+ // now plugin, save what you have!
+ pPlugin->savePartialProjectSession(&pluginEl);
+
+ // if the plugin wrote anything, accept itt for the session, otherwise forget itt
+ if (pluginEl.hasChildNodes() || pluginEl.hasAttributes())
+ {
+ pluginListEl.appendChild(pluginEl);
+ }
+ ++itt;
+ }
+
+ // Write it out to the session file on disc
+ QFile f(sessionFileName);
+ if ( f.open(IO_WriteOnly) ) { // file opened successfully
+ QTextStream t( &f ); // use a text stream
+ t << domdoc.toCString();
+ f.close();
+ }
+ initXMLTree(); // clear and initialize the tree again
+
+ return true;
+}
+
+
+void ProjectSession::loadDocument( )
+{
+ while ( !_docDataList.isEmpty() )
+ {
+ DocumentData & dd = _docDataList.first();
+ if ( dd.type == "Source" )
+ {
+ PartController::getInstance()->setEncoding( dd.encoding );
+ PartController::getInstance()->editDocumentInternal( dd.url, dd.line, -1, dd.activate );
+ }
+ else if ( dd.type == "Documentation" )
+ {
+ // FIXME needs to be deferred if !activate ?
+ PartController::getInstance()->showDocument( dd.url, true );
+ }
+ else
+ {
+ // FIXME needs to be deferred if !activate ?
+ PartController::getInstance()->editDocument( dd.url );
+ }
+ _docDataList.pop_front();
+
+ loadDocument();
+ //QTimer::singleShot( 0, this, SLOT(loadDocument()) );
+ }
+}
+
diff --git a/src/projectsession.h b/src/projectsession.h
new file mode 100644
index 00000000..60c0b732
--- /dev/null
+++ b/src/projectsession.h
@@ -0,0 +1,89 @@
+/***************************************************************************
+ projectsession.h - description
+ -------------------
+ begin : 30 Nov 2002
+ copyright : (C) 2002 by Falk Brettschneider
+ email : falk@kdevelop.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef _PROJECTSESSION_H_
+#define _PROJECTSESSION_H_
+
+#include <qobject.h>
+#include <qdom.h>
+#include <qdict.h>
+#include <qvaluelist.h>
+
+class QWidget;
+class KURL;
+class KDevPlugin;
+
+/**
+ * This class stores and restores the last situation before the certain project
+ * was closed.
+ * Session stuff that is not related to a certain project doesn't belong to here;
+ * it must be saved in a program session which likely is "kdeveloprc".
+ **/
+class ProjectSession : public QObject
+{
+ Q_OBJECT
+// methods
+public:
+ ProjectSession();
+ virtual ~ProjectSession();
+
+ /** Opens the .kdevses file and saves the project session in XML format to it. */
+ bool saveToFile(const QString& fileName, const QValueList<KDevPlugin*> plugins );
+
+ /** Opens the .kdevses file and loads the project session from it. */
+ bool restoreFromFile(const QString& fileName, const QValueList<KDevPlugin*> plugins );
+
+signals:
+ void sig_restoreMainWindowProperties(const QDomElement* el);
+ void sig_saveMainWindowProperties(QDomElement* el);
+
+ void sig_restoreAdditionalViewProperties(const QString& viewName, const QDomElement* el);
+ void sig_saveAdditionalViewProperties(const QString& viewName, QDomElement* el);
+
+private slots:
+ /**
+ * This slot loads one document from _docDataList and sets a timer to load the next
+ */
+ void loadDocument();
+
+private:
+ /** Restores the part of the project session that concerns to the documents (files). */
+ void recreateDocs(QDomElement& el);
+ /** recreates views and their properties of a certain document. */
+ void recreateViews(KURL& url, QDomElement docEl, bool activate);
+ /** setup a valid XML file. */
+ void initXMLTree();
+
+// attributes
+private:
+ /** the XML document object controlling the XML tree. */
+ QDomDocument domdoc;
+
+ struct DocumentData
+ {
+ DocumentData() : line(0) {}
+ KURL url;
+ int line;
+ QString type;
+ bool activate;
+ QString encoding;
+ };
+
+ QValueList<DocumentData> _docDataList;
+
+};
+
+#endif // _PROJECTSESSION_H_
diff --git a/src/settingswidget.ui b/src/settingswidget.ui
new file mode 100644
index 00000000..eedcd231
--- /dev/null
+++ b/src/settingswidget.ui
@@ -0,0 +1,528 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SettingsWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form2</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>456</width>
+ <height>593</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form2</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox" row="1" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>lastProjectCheckbox</cstring>
+ </property>
+ <property name="text">
+ <string>Lo&amp;ad last project on startup</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check this if you want KDevelop to load the last opened project on startup</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Mark this checkbox if you want to continue to work with the last project you worked on. This will cause KDevelop to automatically load this project on start-up. It will usually be shown in the state you left work so you can readily proceed.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;&lt;h3&gt;Project Settings&lt;/h3&gt;&lt;/qt&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="6" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>lineWrappingCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Line wrappin&amp;g</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>By default, KDevelop will wrap long lines around in the Messages Output View window</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>By default, KDevelop will wrap long lines around in the Messages Output View window so that valuable information will not be easily overlooked. In some cases this will clutter long message lists. Remove the checkbox mark if you do not want the lines wrap around.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>compilerLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Compiler output:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>compileOutputCombo</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Very Short</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Short</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Long</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>compileOutputCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Choose what sort of output you want from the build process</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>KDevelop preprocesses the messages the Messages Output View window receives during the build processes in order to filter superfluous information. You can control the level of detail KDevelop will display using the dropdown box in this field.
+&lt;b&gt;Very Short&lt;/b&gt; Displays only warnings, errors, and the filenames which are compiled.
+&lt;b&gt;Short&lt;/b&gt; Suppresses all compiler flags and formats the output to be more readable.
+&lt;b&gt;Full&lt;/b&gt; Displays all output messages unmodified.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;&lt;h3&gt;Output View Settings&lt;/h3&gt;&lt;/qt&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>AutoText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignBottom|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Default pro&amp;jects directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>projectsURL</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>projectsURL</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>WheelFocus</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set the directory where you want your projects in.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>By default, KDevelop uses a common parent directory for all new projects. Enter the absolute path of this common directory in the box or select it from your directory structure. KDevelop will place the any new project here as a subdirectory.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="1" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="4" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>buttonLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Window &amp;font:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>outputFont</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KFontRequester">
+ <property name="name">
+ <cstring>outputFont</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="10" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer13_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>60</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QButtonGroup" row="12" column="3">
+ <property name="name">
+ <cstring>terminalButtonGroup</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>useKDETerminal</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;KDE setting</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use the terminal as set in KControl</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If checked, KDevelop will use the default terminal as set in KControl in KDE components, Component Chooser.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>useOtherTerminal</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Other:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Set a different terminal than the KDE default one</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Choose some other terminal different from the default one.</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>terminalEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="11" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel5_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;&lt;h3&gt;Terminal Emulation&lt;/h3&gt;&lt;/qt&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ </widget>
+ <spacer row="12" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>spacer13_2_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="13" column="3">
+ <property name="name">
+ <cstring>spacer23</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="9" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;qt&gt;&lt;h3&gt;UI Designer Integration&lt;/h3&gt;This will only be used when no project is opened. For the project specific setting see Project Options/C++ Specific and open the Qt tab.&lt;/qt&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="10" column="3">
+ <property name="name">
+ <cstring>designerButtonGroup</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>embeddedDesignerRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use KDevelop's embedded designer</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start KDevelop own designer embedded within KDevelop</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to integrate the UI designer into KDevelop.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>seperateAppRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>Run KDevelop's &amp;designer as a separate application</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start KDevelop own designer externally</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>KDevelop comes with its own UI designer that can either be embedded or be run as a separate program. Check this button if you wish to run KDevelop's UI designer as a separate program.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0">
+ <property name="name">
+ <cstring>qtDesignerRadioButton</cstring>
+ </property>
+ <property name="text">
+ <string>Run &amp;Qt Designer</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use Qt Designer externally</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this button if you wish to use Qt Designer rather than KDevelop's integrated designer.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox" row="7" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>dirNavigMsgCheckBox</cstring>
+ </property>
+ <property name="text">
+ <string>Directory &amp;navigation messages</string>
+ </property>
+ <property name="accel">
+ <string>Alt+N</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check this if you want to know what directory make is in</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The make tool usually will display messages like “Entering directory”, or “Leaving directory” when it switches the directories it currently works in. As this clutters the messages list in the Messages Output View window, KDevelop suppresses those messages by default. Mark the checkbox if you want to protocol which directories make worked in.</string>
+ </property>
+ </widget>
+ <spacer row="4" column="0" rowspan="5" colspan="1">
+ <property name="name">
+ <cstring>spacer13_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QButtonGroup" row="8" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="alignment">
+ <set>AlignAuto</set>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>forceCLocaleRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Force English compiler output</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>userLocaleRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Use kde language and disable "jump-to-source" functionality</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>useOtherTerminal</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>terminalEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kfontrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/src/shellextension.cpp b/src/shellextension.cpp
new file mode 100644
index 00000000..8b9c4dbb
--- /dev/null
+++ b/src/shellextension.cpp
@@ -0,0 +1,26 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "shellextension.h"
+
+ShellExtension *ShellExtension::s_instance = 0;
+
+ShellExtension::ShellExtension()
+{
+}
diff --git a/src/shellextension.h b/src/shellextension.h
new file mode 100644
index 00000000..b0d91069
--- /dev/null
+++ b/src/shellextension.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SHELLEXTENSION_H
+#define SHELLEXTENSION_H
+
+#include <qstring.h>
+
+class KDialogBase;
+
+/**
+Shell extension.
+Provides application-dependent and shell-independent functionality.
+Shell uses extensions to perform application dependent actions.
+*/
+class ShellExtension {
+public:
+ /**Returns an instance of a shell. Subclasses must create an instance of a shell
+ by themselves. For example they could provide static init() method like:
+ @code
+ static void init()
+ {
+ s_instance = new MyExtension();
+ }
+ @endcode*/
+ static ShellExtension *getInstance() { return s_instance; }
+
+ /**Reimplement to create global settings page in the dialog @p dlg.*/
+ virtual void createGlobalSettingsPage(KDialogBase *dlg) = 0;
+ /**Reimplement to perform actions when the global settings page in the
+ dialog @p dlg is accepted (user clicked "Ok").*/
+ virtual void acceptGlobalSettingsPage(KDialogBase *dlg) = 0;
+
+ /**Reimplement to return the name of KXMLGUI resource file for an application.*/
+ virtual QString xmlFile() = 0;
+
+ /**Reimplement to set a default profile for the shell. Default profile
+ will be used by a shell if no --profile argument is specified.*/
+ virtual QString defaultProfile() = 0;
+
+protected:
+ ShellExtension();
+ static ShellExtension *s_instance;
+};
+
+#endif
diff --git a/src/simplemainwindow.cpp b/src/simplemainwindow.cpp
new file mode 100644
index 00000000..5b5e0345
--- /dev/null
+++ b/src/simplemainwindow.cpp
@@ -0,0 +1,1011 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "simplemainwindow.h"
+
+#include <qtextedit.h>
+
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kparts/part.h>
+#include <kpopupmenu.h>
+#include <kmenubar.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kiconloader.h>
+#include <kedittoolbar.h>
+#include <ktexteditor/view.h>
+#include <ktexteditor/document.h>
+#include <kapplication.h>
+#include <kurldrag.h>
+#include <kconfig.h>
+
+#include <ddockwindow.h>
+#include <dtabwidget.h>
+#include <profile.h>
+#include <profileengine.h>
+#include <designer.h>
+#include <kdevproject.h>
+#include <urlutil.h>
+
+#include "api.h"
+#include "core.h"
+#include "plugincontroller.h"
+#include "mainwindowshare.h"
+#include "shellextension.h"
+#include "partcontroller.h"
+#include "statusbar.h"
+#include "documentationpart.h"
+#include "toplevel.h"
+#include "projectmanager.h"
+#include "editorproxy.h"
+#include "multibuffer.h"
+
+SimpleMainWindow::SimpleMainWindow(QWidget* parent, const char *name)
+ :DMainWindow(parent, name)
+{
+ resize(800, 600); // starts kdevelop at 800x600 the first time
+ m_mainWindowShare = new MainWindowShare(this);
+
+ connect(m_bottomDock, SIGNAL(hidden()), this, SLOT(raiseEditor()));
+ connect(m_leftDock, SIGNAL(hidden()), this, SLOT(raiseEditor()));
+ connect(m_rightDock, SIGNAL(hidden()), this, SLOT(raiseEditor()));
+}
+
+SimpleMainWindow::~ SimpleMainWindow( )
+{
+ TopLevel::invalidateInstance( this );
+}
+
+void SimpleMainWindow::init()
+{
+ actionCollection()->setHighlightingEnabled( true );
+ setStandardToolBarMenuEnabled( true );
+ setXMLFile(ShellExtension::getInstance()->xmlFile());
+
+ createFramework();
+ createActions();
+ new KDevStatusBar(this);
+
+ setAcceptDrops(true);
+
+ createGUI(0);
+
+ m_mainWindowShare->init();
+ setupWindowMenu();
+ menuBar()->setEnabled( false );
+
+ //FIXME: this checks only for global offers which is not quite correct because
+ //a profile can offer core plugins and no global plugins.
+ if ( PluginController::getInstance()->engine().allOffers(ProfileEngine::Global).isEmpty() )
+ {
+ KMessageBox::sorry( this, i18n("Unable to find plugins, KDevelop will not work"
+ " properly.\nPlease make sure "
+ "that KDevelop is installed in your KDE directory; otherwise, you have "
+ "to add KDevelop's installation "
+ "path to the environment variable KDEDIRS and run kbuildsycoca. Restart "
+ "KDevelop afterwards.\n"
+ "Example for BASH users:\nexport KDEDIRS=/path/to/kdevelop:$KDEDIRS && kbuildsycoca"),
+ i18n("Could Not Find Plugins") );
+ }
+
+ connect(Core::getInstance(), SIGNAL(coreInitialized()), this, SLOT(slotCoreInitialized()));
+ connect(Core::getInstance(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+ connect(Core::getInstance(), SIGNAL(projectClosed()), this, SLOT(projectClosed()));
+ connect(Core::getInstance(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)));
+ connect(PartController::getInstance(), SIGNAL(partURLChanged(KParts::ReadOnlyPart *)),
+ this, SLOT(slotPartURLChanged(KParts::ReadOnlyPart * )));
+ connect(PartController::getInstance(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(activePartChanged(KParts::Part*)));
+
+ connect(PartController::getInstance(),
+ SIGNAL(documentChangedState(const KURL &, DocumentState)),
+ this, SLOT(documentChangedState(const KURL&, DocumentState)));
+
+ loadSettings();
+}
+
+void SimpleMainWindow::dragEnterEvent( QDragEnterEvent *event )
+{
+ event->accept(KURLDrag::canDecode(event));
+}
+
+void SimpleMainWindow::dropEvent( QDropEvent *event )
+{
+ slotDropEvent(event);
+}
+
+void SimpleMainWindow::slotDropEvent( QDropEvent *event )
+{
+ KURL::List list;
+ if ( !KURLDrag::decode( event, list ) ) return;
+
+ KURL::List::Iterator it = list.begin();
+ while( it != list.end() )
+ {
+ kdDebug(9000) << "drop url:" << *it << endl;
+ PartController::getInstance()->editDocument( *it );
+ ++it;
+ }
+}
+
+void SimpleMainWindow::contextMenu(QPopupMenu *popupMenu, const Context *context)
+{
+ int cont = context->type();
+ m_splitURLs.clear();
+ if (cont == Context::EditorContext)
+ {
+ KURL url = static_cast<const EditorContext*>(context)->url();
+ QWidget *w = widgetForURL(url);
+ if (w && m_widgetTabs[w] && m_widgetTabs[w]->count() > 1)
+ {
+ m_splitURLs.append(url);
+ m_splitHor1->plug(popupMenu);
+ m_splitVer1->plug(popupMenu);
+ popupMenu->insertSeparator();
+ }
+ }
+ else if (cont == Context::FileContext)
+ {
+ if (PartController::getInstance()->openURLs().count() > 0)
+ {
+ KURL::List urls = static_cast<const FileContext*>(context)->urls();
+ KURL::List::ConstIterator it = urls.begin();
+ while ( it != urls.end() )
+ {
+ if ( !URLUtil::isDirectory( *it ) )
+ {
+ m_splitURLs.append( *it );
+ }
+ ++it;
+ }
+
+ if ( m_splitURLs.isEmpty() ) return;
+
+ bool isOpen = true;
+ for (KURL::List::const_iterator it = m_splitURLs.begin(); it != m_splitURLs.end(); ++it)
+ {
+ if (!PartController::getInstance()->openURLs().contains(*it) && (*it).isValid())
+ {
+ isOpen = false;
+ break;
+ }
+ }
+
+ if ( (isOpen && PartController::getInstance()->openURLs().count() == 1) ||
+ (m_splitURLs.count() == 1 && !(*m_splitURLs.begin()).isValid() ) )
+ {
+ return;
+ }
+
+ popupMenu->insertSeparator();
+ if (isOpen)
+ {
+ m_splitHor1->plug(popupMenu);
+ m_splitVer1->plug(popupMenu);
+ }
+ else
+ {
+ m_splitHor2->plug(popupMenu);
+ m_splitVer2->plug(popupMenu);
+ }
+ }
+ }
+}
+
+void SimpleMainWindow::embedPartView(QWidget *view, const QString &title, const QString &/*toolTip*/)
+{
+ kdDebug() << "SimpleMainWindow::embedPartView: " << view << endl;
+ if (!view )
+ return;
+
+ QString shortName = title;
+ shortName = shortName.right( shortName.length() - (shortName.findRev('/') +1));
+
+ addWidget(view, title);
+ view->show();
+}
+
+void SimpleMainWindow::embedSelectView(QWidget *view, const QString &title, const QString &/*toolTip*/)
+{
+ embedView( DDockWindow::Left, view, title );
+}
+
+void SimpleMainWindow::embedOutputView(QWidget *view, const QString &title, const QString &/*toolTip*/)
+{
+ embedView( DDockWindow::Bottom, view, title );
+}
+
+void SimpleMainWindow::embedSelectViewRight(QWidget *view, const QString &title, const QString &/*toolTip*/)
+{
+ embedView( DDockWindow::Right, view, title );
+}
+
+void SimpleMainWindow::embedView( DDockWindow::Position pos, QWidget * view, const QString & title )
+{
+ if ( !hasDockWidget( view ) )
+ {
+ DDockWindow::Position position = recallToolViewPosition( view->name(), pos );
+ addDockWidget(position, view, title);
+ }
+}
+
+DDockWindow::Position SimpleMainWindow::recallToolViewPosition( const QString & name, DDockWindow::Position defaultPos )
+{
+ KConfig * config = kapp->config();
+ config->setGroup( "DToolDockPosition" );
+
+ QString position = config->readEntry( name );
+
+ if ( name == "unknown" )
+ {
+ kdDebug() << name << endl;
+ }
+
+ if ( position == "DockLeft" ) return DDockWindow::Left;
+ if ( position == "DockRight" ) return DDockWindow::Right;
+ if ( position == "DockBottom" ) return DDockWindow::Bottom;
+
+ return defaultPos;
+}
+
+void SimpleMainWindow::rememberToolViewPosition( const QString & name, DDockWindow::Position pos )
+{
+ KConfig * config = kapp->config();
+ config->setGroup( "DToolDockPosition" );
+
+ QString position = "unknown";
+
+ switch( pos )
+ {
+ case DDockWindow::Left:
+ position = "DockLeft";
+ break;
+ case DDockWindow::Right:
+ position = "DockRight";
+ break;
+ case DDockWindow::Bottom:
+ position = "DockBottom";
+ break;
+ default: ;
+ }
+
+ config->writeEntry( name, position );
+}
+
+
+void SimpleMainWindow::removeView(QWidget *view)
+{
+ if (!view)
+ return;
+
+ //try to remove it from all parts of main window
+ //@fixme This method needs to be divided in two - one for docks and one for part views
+ if (hasDockWidget(view))
+ {
+ rememberToolViewPosition( view->name(), dockWidgetPosition(view) );
+ removeDockWidget(view);
+ }
+ else
+ removeWidget(view);
+}
+
+void SimpleMainWindow::setViewAvailable(QWidget *pView, bool bEnabled)
+{
+ DDockWindow *dock;
+ if (hasDockWidget(pView))
+ dock = toolWindow(dockWidgetPosition(pView));
+ else
+ return;
+
+ bEnabled ? dock->showWidget(pView) : dock->hideWidget(pView);
+}
+
+void SimpleMainWindow::raiseView(QWidget *view)
+{
+ //adymo: a workaround to make editor wrappers work:
+ //editor view is passed to this function but the ui library knows only
+ //of its parent which is an editor wrapper, simply replacing the view
+ //by its wrapper helps here
+ if (view->parent())
+ kdDebug() << view->parent()->className() << endl;
+ if (view->parent() && (view->parent()->isA("EditorWrapper") || view->parent()->isA("MultiBuffer")))
+ {
+// kdDebug() << "parent is editor wrapper: " <<
+// static_cast<EditorWrapper*>(view->parent()) << endl;
+ view = (QWidget*)view->parent();
+ }
+
+ if (hasDockWidget(view))
+ {
+ DDockWindow *dock = toolWindow(dockWidgetPosition(view));
+ dock->raiseWidget(view);
+ }
+ else if (m_widgets.contains(view) && m_widgetTabs.contains(view))
+ m_widgetTabs[view]->showPage(view);
+}
+
+void SimpleMainWindow::lowerView(QWidget * view)
+{
+ if (!hasDockWidget(view))
+ return;
+
+ DDockWindow *dock = toolWindow(dockWidgetPosition(view));
+ dock->lowerWidget(view);
+}
+
+void SimpleMainWindow::loadSettings()
+{
+ KConfig *config = kapp->config();
+
+ ProjectManager::getInstance()->loadSettings();
+ applyMainWindowSettings(config, "SimpleMainWindow");
+
+ Core::setupShourtcutTips();
+}
+
+void SimpleMainWindow::saveSettings( )
+{
+ KConfig *config = kapp->config();
+
+ ProjectManager::getInstance()->saveSettings();
+ saveMainWindowSettings(config, "SimpleMainWindow");
+
+ QMap<QWidget*, DDockWindow::Position>::iterator it = m_docks.begin();
+ while ( it != m_docks.end() )
+ {
+ if ( !strcmp(it.key()->name(), "unnamed") )
+ {
+ kdError() << "Toolviews must have a name : " << it.key() << endl;
+ }
+
+ rememberToolViewPosition( it.key()->name(), it.data() );
+ ++it;
+ }
+
+ DMainWindow::saveSettings();
+}
+
+void SimpleMainWindow::setCurrentDocumentCaption( const QString &caption )
+{
+ if( !PartController::getInstance()->activePart() ) return;
+
+ if (QWidget *widget = EditorProxy::getInstance()->topWidgetForPart(PartController::getInstance()->activePart()))
+ {
+ widget->setCaption(caption);
+ }
+}
+
+KMainWindow *SimpleMainWindow::main()
+{
+ return this;
+}
+
+void SimpleMainWindow::createFramework()
+{
+ PartController::createInstance( this );
+
+ connect(PartController::getInstance(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(createGUI(KParts::Part*)));
+}
+
+void SimpleMainWindow::createActions()
+{
+ m_raiseEditor = new KAction(i18n("Raise &Editor"), ALT+Key_C,
+ this, SLOT(raiseEditor()), actionCollection(), "raise_editor");
+ m_raiseEditor->setToolTip(i18n("Raise editor"));
+ m_raiseEditor->setWhatsThis(i18n("<b>Raise editor</b><p>Focuses the editor."));
+
+ m_lowerAllDocks = new KAction(i18n("Lower All Docks"), CTRL+SHIFT+Key_C,
+ this, SLOT(lowerAllDocks()), actionCollection(), "lower_all_docks");
+
+ new KAction(i18n("Switch to next TabWidget"), 0, this,
+ SLOT(switchToNextTabWidget()), actionCollection(), "switch_to_next_tabwidget" );
+
+ m_splitHor = new KAction(i18n("Split &Horizontal"), CTRL+SHIFT+Key_T,
+ this, SLOT(slotSplitHorizontalBase()), actionCollection(), "split_h");
+ m_splitHor->setIcon("view_top_bottom");
+
+ m_splitVer = new KAction(i18n("Split &Vertical"), CTRL+SHIFT+Key_L,
+ this, SLOT(slotSplitVerticalBase()), actionCollection(), "split_v");
+ m_splitVer->setIcon("view_left_right");
+
+ m_splitHor1 = new KAction(i18n("Split &Horizontal"), 0,
+ this, SLOT(slotSplitHorizontal()), actionCollection(), "split_h1");
+ m_splitHor1->setIcon("view_top_bottom");
+
+ m_splitVer1 = new KAction(i18n("Split &Vertical"), 0,
+ this, SLOT(slotSplitVertical()), actionCollection(), "split_v1");
+ m_splitVer1->setIcon("view_left_right");
+
+ m_splitHor2 = new KAction(i18n("Split &Horizontal and Open"), 0,
+ this, SLOT(slotSplitHorizontal()), actionCollection(), "split_h2");
+ m_splitHor2->setIcon("view_top_bottom");
+
+ m_splitVer2 = new KAction(i18n("Split &Vertical and Open"), 0,
+ this, SLOT(slotSplitVertical()), actionCollection(), "split_v2");
+ m_splitVer2->setIcon("view_left_right");
+
+ m_raiseLeftDock = new KAction(i18n("Switch Left Dock"), CTRL+SHIFT+ALT+Key_L,
+ this, SLOT(raiseLeftDock()), actionCollection(), "switch_left_dock");
+
+ m_raiseRightDock = new KAction(i18n("Switch Right Dock"), CTRL+SHIFT+ALT+Key_R,
+ this, SLOT(raiseRightDock()), actionCollection(), "switch_right_dock");
+
+ m_raiseBottomDock = new KAction(i18n("Switch Bottom Dock"), CTRL+SHIFT+ALT+Key_B,
+ this, SLOT(raiseBottomDock()), actionCollection(), "switch_bottom_dock");
+
+ KStdAction::configureToolbars(this, SLOT(configureToolbars()),
+ actionCollection(), "set_configure_toolbars");
+
+ m_mainWindowShare->createActions();
+
+ connect(m_mainWindowShare, SIGNAL(gotoNextWindow()), this, SLOT(gotoNextWindow()));
+ connect(m_mainWindowShare, SIGNAL(gotoPreviousWindow()), this, SLOT(gotoPreviousWindow()));
+ connect(m_mainWindowShare, SIGNAL(gotoFirstWindow()), this, SLOT(gotoFirstWindow()));
+ connect(m_mainWindowShare, SIGNAL(gotoLastWindow()), this, SLOT(gotoLastWindow()));
+}
+
+void SimpleMainWindow::raiseEditor()
+{
+ kdDebug() << "SimpleMainWindow::raiseEditor" << endl;
+ KDevPartController *partcontroller = API::getInstance()->partController();
+ if (partcontroller->activePart() && partcontroller->activePart()->widget())
+ partcontroller->activePart()->widget()->setFocus();
+}
+
+void SimpleMainWindow::gotoNextWindow()
+{
+ if (m_bottomDock->isActive())
+ m_bottomDock->selectNextWidget();
+ else if (m_rightDock->isActive())
+ m_rightDock->selectNextWidget();
+ else if (m_leftDock->isActive())
+ m_leftDock->selectNextWidget();
+ else
+ {
+ if ((m_activeTabWidget->currentPageIndex() + 1) < m_activeTabWidget->count())
+ m_activeTabWidget->setCurrentPage(m_activeTabWidget->currentPageIndex() + 1);
+ else
+ m_activeTabWidget->setCurrentPage(0);
+ }
+}
+
+void SimpleMainWindow::gotoPreviousWindow()
+{
+ if (m_bottomDock->isActive())
+ m_bottomDock->selectPrevWidget();
+ else if (m_rightDock->isActive())
+ m_rightDock->selectPrevWidget();
+ else if (m_leftDock->isActive())
+ m_leftDock->selectPrevWidget();
+ else
+ {
+ if ((m_activeTabWidget->currentPageIndex() - 1) >= 0)
+ m_activeTabWidget->setCurrentPage(m_activeTabWidget->currentPageIndex() - 1);
+ else
+ m_activeTabWidget->setCurrentPage(m_activeTabWidget->count() - 1);
+ }
+}
+
+void SimpleMainWindow::gotoFirstWindow()
+{
+ //@TODO: Implement me
+}
+
+void SimpleMainWindow::gotoLastWindow()
+{
+ //@TODO: implement me
+}
+
+void SimpleMainWindow::slotCoreInitialized()
+{
+ menuBar()->setEnabled(true);
+}
+
+void SimpleMainWindow::projectOpened()
+{
+ setCaption(QString::null);
+}
+
+void SimpleMainWindow::slotPartURLChanged(KParts::ReadOnlyPart *part)
+{
+ if (QWidget *widget = EditorProxy::getInstance()->topWidgetForPart(part))
+ {
+ kdDebug() << "new caption for widget: " << part->url().fileName() << endl;
+ widget->setCaption(part->url().fileName());
+ }
+ //do smth with caption: ro_part->url().fileName()
+}
+
+void SimpleMainWindow::documentChangedState(const KURL &url, DocumentState state)
+{
+ QWidget * widget = EditorProxy::getInstance()->topWidgetForPart(
+ PartController::getInstance()->partForURL(url));
+ kdDebug() << "SimpleMainWindow::documentChangedState: " << widget << endl;
+ if (widget)
+ {
+ //calculate the icon size if showTabIcons is false
+ //this is necessary to avoid tab resizing by setIcon() call
+ int isize = 16;
+ if (m_activeTabWidget && !m_showIconsOnTabs)
+ {
+ isize = m_activeTabWidget->fontMetrics().height() - 1;
+ isize = isize > 16 ? 16 : isize;
+ }
+ switch (state)
+ {
+ // we should probably restore the original icon instead of just using "kdevelop",
+ // but I have never seen any other icon in use so this should do for now
+ case Clean:
+ if (m_showIconsOnTabs)
+ widget->setIcon(SmallIcon("kdevelop", isize));
+ else
+ widget->setIcon(QPixmap());
+ break;
+ case Modified:
+ widget->setIcon(SmallIcon("filesave", isize));
+ break;
+ case Dirty:
+ widget->setIcon(SmallIcon("revert", isize));
+ break;
+ case DirtyAndModified:
+ widget->setIcon(SmallIcon("stop", isize));
+ break;
+ }
+ }
+ setCaption(url.url());
+}
+
+void SimpleMainWindow::closeTab()
+{
+// actionCollection()->action("file_close")->activate();
+ if (sender()->isA("QToolButton") && sender()->parent()->isA("DTabWidget"))
+ {
+ DTabWidget *tab = (DTabWidget*)sender()->parent();
+ if (tab && tab->currentPage())
+ closeTab(tab->currentPage());
+ }
+}
+
+void SimpleMainWindow::tabContext(QWidget *w, const QPoint &p)
+{
+ DTabWidget *tabWidget = static_cast<DTabWidget*>(const_cast<QObject*>(sender()));
+ if (!tabWidget)
+ return;
+
+ KPopupMenu tabMenu;
+ tabMenu.insertTitle(tabWidget->tabLabel(w));
+
+ //Find the document on whose tab the user clicked
+ m_currentTabURL = QString::null;
+ QPtrListIterator<KParts::Part> it(*PartController::getInstance()->parts());
+ while (KParts::Part* part = it.current())
+ {
+ QWidget *top_widget = EditorProxy::getInstance()->topWidgetForPart(part);
+ if (top_widget == w)
+ {
+ if (KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(part))
+ {
+ m_currentTabURL = ro_part->url();
+ tabMenu.insertItem(i18n("Close"), 0);
+
+ if (PartController::getInstance()->parts()->count() > 1)
+ tabMenu.insertItem(i18n("Close All Others"), 4);
+
+ if( KParts::ReadWritePart * rw_part = dynamic_cast<KParts::ReadWritePart*>( ro_part ) )
+ {
+ if( rw_part->isModified() ) tabMenu.insertItem( i18n("Save"),1);
+ tabMenu.insertItem( i18n("Reload"),2);
+ }
+
+ if (dynamic_cast<HTMLDocumentationPart*>(ro_part))
+ {
+ tabMenu.insertItem(i18n("Duplicate"), 3);
+ break;
+ }
+
+ //Create the file context
+ KURL::List list;
+ list << m_currentTabURL;
+ FileContext context( list );
+ Core::getInstance()->fillContextMenu(&tabMenu, &context);
+ }
+ break;
+ }
+ ++it;
+ }
+
+ connect(&tabMenu, SIGNAL(activated(int)), this, SLOT(tabContextActivated(int)));
+ tabMenu.exec(p);
+}
+
+void SimpleMainWindow::tabContextActivated(int id)
+{
+ if(m_currentTabURL.isEmpty())
+ return;
+
+ switch(id)
+ {
+ case 0:
+ PartController::getInstance()->closeFile(m_currentTabURL);
+ break;
+ case 1:
+ PartController::getInstance()->saveFile(m_currentTabURL);
+ break;
+ case 2:
+ PartController::getInstance()->reloadFile(m_currentTabURL);
+ break;
+ case 3:
+ PartController::getInstance()->showDocument(m_currentTabURL, true);
+ break;
+ case 4:
+ PartController::getInstance()->closeAllOthers(m_currentTabURL);
+ break;
+ default:
+ break;
+ }
+}
+
+void SimpleMainWindow::configureToolbars()
+{
+ saveMainWindowSettings(KGlobal::config(), "SimpleMainWindow");
+ KEditToolbar dlg(factory());
+ connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig()));
+ dlg.exec();
+}
+
+void SimpleMainWindow::slotNewToolbarConfig()
+{
+// setupWindowMenu();
+ m_mainWindowShare->slotGUICreated(PartController::getInstance()->activePart());
+ applyMainWindowSettings(KGlobal::config(), "SimpleMainWindow");
+}
+
+bool SimpleMainWindow::queryClose()
+{
+ saveSettings();
+ return Core::getInstance()->queryClose();
+}
+
+bool SimpleMainWindow::queryExit()
+{
+ return true;
+}
+
+void SimpleMainWindow::setupWindowMenu()
+{
+ // get the xmlgui created one instead
+ m_windowMenu = static_cast<QPopupMenu*>(main()->child("window", "KPopupMenu"));
+
+ if (!m_windowMenu)
+ {
+ kdDebug(9000) << "Couldn't find the XMLGUI window menu. Creating new." << endl;
+
+ m_windowMenu = new QPopupMenu(main(), "window");
+ menuBar()->insertItem(i18n("&Window"), m_windowMenu);
+ }
+
+ actionCollection()->action("file_close")->plug(m_windowMenu);
+ actionCollection()->action("file_close_all")->plug(m_windowMenu);
+ actionCollection()->action("file_closeother")->plug(m_windowMenu);
+
+ QObject::connect(m_windowMenu, SIGNAL(activated(int)), this, SLOT(openURL(int)));
+ QObject::connect(m_windowMenu, SIGNAL(aboutToShow()), this, SLOT(fillWindowMenu()));
+}
+
+void SimpleMainWindow::openURL(int w)
+{
+ QValueList<QPair<int, KURL> >::ConstIterator it = m_windowList.begin();
+ while (it != m_windowList.end())
+ {
+ if ((*it).first == w)
+ {
+ KURL url((*it).second);
+ if (!url.isEmpty())
+ {
+ PartController::getInstance()->editDocument(url);
+ return;
+ }
+ }
+ ++it;
+ }
+}
+
+void SimpleMainWindow::fillWindowMenu()
+{
+ // clear menu
+ QValueList< QPair< int, KURL > >::ConstIterator it = m_windowList.begin();
+ while (it != m_windowList.end())
+ {
+ m_windowMenu->removeItem( (*it).first );
+ ++it;
+ }
+
+ int temp = 0;
+
+ QMap<QString, KURL> map;
+ QStringList string_list;
+ KURL::List list = PartController::getInstance()->openURLs();
+ KURL::List::Iterator itt = list.begin();
+ while (itt != list.end())
+ {
+ map[(*itt).fileName()] = *itt;
+ string_list.append((*itt).fileName());
+ ++itt;
+ }
+ string_list.sort();
+
+ list.clear();
+ for(uint i = 0; i != string_list.size(); ++i)
+ list.append(map[string_list[i]]);
+
+ itt = list.begin();
+ int i = 0;
+
+ if (list.count() > 0)
+ m_windowList << qMakePair(m_windowMenu->insertSeparator(), KURL());
+
+ while (itt != list.end())
+ {
+ temp = m_windowMenu->insertItem( i < 10 ? QString("&%1 %2").arg(i).arg((*itt).fileName()) : (*itt).fileName() );
+ m_windowList << qMakePair(temp, *itt);
+ ++i;
+ ++itt;
+ }
+}
+
+void SimpleMainWindow::slotSplitVertical()
+{
+ DTabWidget *tab = splitVertical();
+ openDocumentsAfterSplit(tab);
+}
+
+void SimpleMainWindow::slotSplitHorizontal()
+{
+ DTabWidget *tab = splitHorizontal();
+ openDocumentsAfterSplit(tab);
+}
+
+void SimpleMainWindow::slotSplitVerticalBase()
+{
+ if (KParts::ReadOnlyPart *ro_part = activePartForSplitting())
+ {
+ m_splitURLs << ro_part->url();
+ slotSplitVertical();
+ }
+}
+
+KParts::ReadOnlyPart *SimpleMainWindow::activePartForSplitting()
+{
+ if (PartController::getInstance()->openURLs().count() < 2)
+ return 0;
+ m_splitURLs.clear();
+ KParts::ReadOnlyPart *ro_part =
+ dynamic_cast<KParts::ReadOnlyPart*>(PartController::getInstance()->activePart());
+ return ro_part;
+}
+
+void SimpleMainWindow::slotSplitHorizontalBase()
+{
+ if (KParts::ReadOnlyPart *ro_part = activePartForSplitting())
+ {
+ m_splitURLs << ro_part->url();
+ slotSplitHorizontal();
+ }
+}
+
+void SimpleMainWindow::openDocumentsAfterSplit(DTabWidget *tab)
+{
+ if (m_splitURLs.count() > 0)
+ {
+ for (KURL::List::const_iterator it = m_splitURLs.begin(); it != m_splitURLs.end(); ++it)
+ {
+ KParts::ReadOnlyPart *part = PartController::getInstance()->partForURL(*it);
+ if (!part)
+ PartController::getInstance()->editDocument(*it);
+ else
+ {
+ PartController::getInstance()->activatePart( part );
+ QWidget *inTab = widgetForURL(*it);
+ if (inTab)
+ {
+ DTabWidget *oldTab = m_widgetTabs[inTab];
+ QString title = oldTab->tabLabel(inTab);
+ removeWidget(inTab);
+ addWidget(tab, inTab, title);
+ }
+ }
+ }
+ m_splitURLs.clear();
+ }
+}
+
+QWidget *SimpleMainWindow::widgetForURL(KURL url)
+{
+ KParts::ReadOnlyPart *part = PartController::getInstance()->partForURL(url);
+ return widgetInTab( part ? part->widget() : 0 );
+}
+
+QWidget *SimpleMainWindow::widgetInTab(QWidget *w)
+{
+ QWidget *inTab = 0;
+ if (w && w->parent() && w->parent()->isA("EditorProxy"))
+ inTab = (QWidget*)w->parent();
+ else if (w && w->parent() && w->parent()->isA("MultiBuffer")
+ && w->parent()->parent() && w->parent()->parent()->isA("EditorProxy"))
+ inTab = (QWidget*)w->parent()->parent();
+ else if (w && w->parent() && w->parent()->isA("MultiBuffer"))
+ inTab = (QWidget*)w->parent();
+ else
+ inTab = w;
+ return inTab;
+}
+
+void SimpleMainWindow::closeTab(QWidget *w)
+{
+ const QPtrList<KParts::Part> *partlist = PartController::getInstance()->parts();
+ QPtrListIterator<KParts::Part> it(*partlist);
+ while (KParts::Part* part = it.current())
+ {
+ QWidget *widget = EditorProxy::getInstance()->topWidgetForPart(part);
+ if (widget && widget == w)
+ {
+ // weirdness beyond weirdness.. sometimes the active view is an embedded splitter with two files
+ // so we check if the widget is a multibuffer, in which case we let it decide what part to close
+ if (MultiBuffer * mb = dynamic_cast<MultiBuffer*>( widget ) )
+ {
+ PartController::getInstance()->closePart( mb->activeBuffer() );
+ }
+ else
+ {
+ PartController::getInstance()->closePart(part);
+ }
+ return;
+ }
+ ++it;
+ }
+}
+
+void SimpleMainWindow::activePartChanged(KParts::Part *part)
+{
+ if (!part)
+ return;
+ QWidget *w = part->widget();
+ kdDebug() << "active part widget is : " << w << endl;
+ QWidget *inTab = widgetInTab(w);
+ if (m_widgetTabs[inTab] != 0)
+ {
+ kdDebug() << " setting m_activeTabWidget " << endl;
+ m_activeTabWidget = m_widgetTabs[inTab];
+ }
+}
+
+void SimpleMainWindow::createGUI(KParts::Part *part) {
+ if ( !part )
+ setCaption( QString::null );
+ DMainWindow::createGUI(part);
+
+ m_mainWindowShare->slotGUICreated( part );
+}
+
+void SimpleMainWindow::raiseBottomDock()
+{
+ raiseDock(m_bottomDock);
+}
+
+void SimpleMainWindow::raiseLeftDock()
+{
+ raiseDock(m_leftDock);
+}
+
+void SimpleMainWindow::raiseRightDock()
+{
+ raiseDock(m_rightDock);
+}
+
+void SimpleMainWindow::raiseDock(DDockWindow *dock)
+{
+ dock->selectLastWidget();
+}
+
+void SimpleMainWindow::lowerAllDocks()
+{
+ m_bottomDock->lowerWidget( m_bottomDock->currentWidget() );
+ m_leftDock->lowerWidget( m_leftDock->currentWidget() );
+ m_rightDock->lowerWidget( m_rightDock->currentWidget() );
+}
+
+void SimpleMainWindow::switchToNextTabWidget()
+{
+ QValueList<DTabWidget*> tabWidgets = m_widgetTabs.values();
+
+ if ( tabWidgets.count() < 2 ) return;
+
+ QValueList<DTabWidget*> reduced;
+ QValueList<DTabWidget*>::iterator it = tabWidgets.begin();
+ while ( it != tabWidgets.end() )
+ {
+ if ( !reduced.contains( *it ) )
+ {
+ reduced << *it;
+ }
+ ++it;
+ }
+
+ it = reduced.begin();
+ while ( it != reduced.end() )
+ {
+ if ( *it == m_activeTabWidget )
+ {
+ if ( ++it != reduced.end() )
+ {
+ if ( (*it)->currentPage() )
+ (*it)->currentPage()->setFocus();
+ }
+ else
+ {
+ if ( (*reduced.begin())->currentPage() )
+ (*reduced.begin())->currentPage()->setFocus();
+ }
+ return;
+ }
+ ++it;
+ }
+}
+
+void SimpleMainWindow::setCaption(const QString &caption)
+{
+ kdDebug(9000) << k_funcinfo << endl;
+
+ bool modified = false;
+ if ( !caption.isEmpty() )
+ {
+ KURL url( caption );
+ DocumentState const state = PartController::getInstance()->documentState( url );
+ modified = ( state == Modified || state == DirtyAndModified );
+ }
+
+ KDevProject *project = API::getInstance()->project();
+ if (project)
+ {
+ QString projectname = project->projectName();
+
+ QString suffix(".kdevelop");
+ if (projectname.endsWith(suffix))
+ projectname.truncate(projectname.length() - suffix.length());
+
+ if (!caption.isEmpty())
+ DMainWindow::setCaption(projectname + " - " + caption, modified);
+ else
+ DMainWindow::setCaption(projectname, modified);
+ }
+ else
+ DMainWindow::setCaption(caption, modified);
+}
+
+void SimpleMainWindow::projectClosed()
+{
+ DMainWindow::setCaption(QString::null);
+}
+
+#include "simplemainwindow.moc"
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
diff --git a/src/simplemainwindow.h b/src/simplemainwindow.h
new file mode 100644
index 00000000..f7df3e1a
--- /dev/null
+++ b/src/simplemainwindow.h
@@ -0,0 +1,140 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SIMPLEMAINWINDOW_H
+#define SIMPLEMAINWINDOW_H
+
+#include <dmainwindow.h>
+#include <kdevplugin.h>
+#include <kdevmainwindow.h>
+#include <kdevpartcontroller.h>
+
+class KAction;
+class QPopupMenu;
+class MainWindowShare;
+class Context;
+
+namespace KParts {
+ class ReadOnlyPart;
+}
+
+class SimpleMainWindow: public DMainWindow, public KDevMainWindow {
+ Q_OBJECT
+public:
+ SimpleMainWindow(QWidget* parent = 0, const char *name = 0);
+ virtual ~SimpleMainWindow();
+
+ virtual void embedPartView(QWidget *view, const QString &title, const QString& toolTip = QString::null);
+ virtual void embedSelectView(QWidget *view, const QString &title, const QString &toolTip);
+ virtual void embedOutputView(QWidget *view, const QString &title, const QString &toolTip);
+ virtual void embedSelectViewRight(QWidget* view, const QString& title, const QString &toolTip);
+
+ virtual void removeView(QWidget *view);
+ virtual void setViewAvailable(QWidget *pView, bool bEnabled);
+ virtual void raiseView(QWidget *view);
+ virtual void lowerView(QWidget *view);
+
+ virtual void loadSettings();
+ virtual void saveSettings();
+ virtual void setCurrentDocumentCaption( const QString &caption );
+
+ virtual KMainWindow *main();
+
+ void init();
+
+public slots:
+ void slotDropEvent( QDropEvent *event );
+ void setCaption(const QString &);
+
+protected:
+ virtual bool queryClose();
+ virtual bool queryExit();
+
+protected slots:
+ virtual void closeTab();
+ virtual void closeTab(QWidget *w);
+ virtual void tabContext(QWidget *w, const QPoint &p);
+ void contextMenu(QPopupMenu *popupMenu, const Context *context);
+
+private slots:
+ void gotoNextWindow();
+ void gotoPreviousWindow();
+ void gotoFirstWindow();
+ void gotoLastWindow();
+ void switchToNextTabWidget();
+ void slotCoreInitialized();
+ void projectOpened();
+ void projectClosed();
+ void slotPartURLChanged(KParts::ReadOnlyPart *part);
+ void activePartChanged(KParts::Part *part);
+ void documentChangedState(const KURL &url, DocumentState state);
+ void tabContextActivated(int);
+ void configureToolbars();
+ void slotNewToolbarConfig();
+ void raiseEditor();
+ void openURL(int w);
+ void fillWindowMenu();
+ void slotSplitVertical();
+ void slotSplitHorizontal();
+ void slotSplitVerticalBase();
+ void slotSplitHorizontalBase();
+ void createGUI(KParts::Part *part);
+ void raiseBottomDock();
+ void raiseLeftDock();
+ void raiseRightDock();
+ void raiseDock(DDockWindow *dock);
+ void lowerAllDocks();
+
+private:
+ void createFramework();
+ void createActions();
+ void setupWindowMenu();
+ void dragEnterEvent( QDragEnterEvent *event );
+ void dropEvent( QDropEvent *event );
+ void openDocumentsAfterSplit(DTabWidget *tab);
+ QWidget *widgetForURL(KURL url);
+ QWidget *widgetInTab(QWidget *w);
+ KParts::ReadOnlyPart *activePartForSplitting();
+ void embedView( DDockWindow::Position position, QWidget *view, const QString & title );
+ DDockWindow::Position recallToolViewPosition( const QString & name, DDockWindow::Position defaultPos );
+ void rememberToolViewPosition( const QString & name, DDockWindow::Position pos );
+
+ MainWindowShare *m_mainWindowShare;
+
+ KURL m_currentTabURL;
+ KAction *m_raiseEditor;
+ KAction *m_lowerAllDocks;
+ KAction *m_splitHor;
+ KAction *m_splitVer;
+ KAction *m_splitHor1;
+ KAction *m_splitVer1;
+ KAction *m_splitHor2;
+ KAction *m_splitVer2;
+ KAction *m_raiseBottomDock;
+ KAction *m_raiseLeftDock;
+ KAction *m_raiseRightDock;
+ QPopupMenu *m_windowMenu;
+ QValueList<QPair<int, KURL> > m_windowList;
+
+ KURL::List m_splitURLs;
+};
+
+// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+
+#endif
diff --git a/src/splashscreen.cpp b/src/splashscreen.cpp
new file mode 100644
index 00000000..0c7ac7f2
--- /dev/null
+++ b/src/splashscreen.cpp
@@ -0,0 +1,85 @@
+
+#include "splashscreen.h"
+#include "splashscreen.moc"
+
+#include <config.h>
+
+#include <qtimer.h>
+#include <qfont.h>
+
+#include <klocale.h>
+#include <kglobalsettings.h>
+
+KDevSplashScreen::KDevSplashScreen(const QPixmap& pixmap, WFlags f) : QSplashScreen(pixmap, f)
+{
+ QTimer *timer = new QTimer( this );
+ QObject::connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
+ timer->start(150);
+
+ state = 0;
+ progress_bar_size = 3;
+}
+
+
+KDevSplashScreen::~KDevSplashScreen()
+{
+}
+
+
+void KDevSplashScreen::animate()
+{
+ state = ((state + 1) % (2*progress_bar_size-1));
+ repaint();
+}
+
+
+void KDevSplashScreen::message( const QString &str, int flags, const QColor &color)
+{
+ QSplashScreen::message(str,flags,color);
+ animate();
+ m_string = str;
+}
+
+
+void KDevSplashScreen::drawContents (QPainter* painter)
+{
+ int position;
+ QColor base_color (201,229,165); // Base green color
+
+ // Draw background circles
+ painter->setPen(NoPen);
+ painter->setBrush(QColor(215,234,181));
+ painter->drawEllipse(51,7,9,9);
+ painter->drawEllipse(62,7,9,9);
+ painter->drawEllipse(73,7,9,9);
+
+ // Draw animated circles, increments are chosen
+ // to get close to background's color
+ // (didn't work well with QColor::light function)
+ for (int i=0; i < progress_bar_size; i++)
+ {
+ position = (state+i)%(2*progress_bar_size-1);
+ painter->setBrush(QColor(base_color.red()-18*i,
+ base_color.green()-10*i,
+ base_color.blue()-28*i));
+
+ if (position < 3) painter->drawEllipse(51+position*11,7,9,9);
+ }
+
+ painter->setPen(QColor(74,112,18));
+ QFont fnt(KGlobalSettings::generalFont());
+ fnt.setPointSize(8);
+ painter->setFont(fnt);
+
+ // Draw version number
+ QRect r = rect();
+ r.setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
+ painter->drawText(r, Qt::AlignRight, i18n("Version %1").arg( VERSION ));
+
+ // Draw message at given position, limited to 43 chars
+ // If message is too long, string is truncated
+ if (m_string.length() > 40) {m_string.truncate(39); m_string += "...";}
+ painter->drawText (90, 16, m_string, 42);
+
+}
+
diff --git a/src/splashscreen.h b/src/splashscreen.h
new file mode 100644
index 00000000..15114f3f
--- /dev/null
+++ b/src/splashscreen.h
@@ -0,0 +1,38 @@
+
+#ifndef _SPLASHSCREEN_H_
+#define _SPLASHSCREEN_H_
+
+#include <qsplashscreen.h>
+#include <qpainter.h>
+#include <qlabel.h>
+
+class QPixmap;
+
+/**
+Splash screen.
+*/
+class KDevSplashScreen : public QSplashScreen
+{
+Q_OBJECT
+
+public:
+ KDevSplashScreen(const QPixmap& pixmap, WFlags f = 0);
+ virtual ~KDevSplashScreen();
+
+protected:
+ void drawContents (QPainter * painter);
+
+public slots:
+ void animate();
+ void message( const QString &str, int flags = AlignLeft,
+ const QColor &color = black );
+
+private:
+ int state;
+ int progress_bar_size;
+ QString m_string;
+
+};
+
+#endif
+
diff --git a/src/statusbar.cpp b/src/statusbar.cpp
new file mode 100644
index 00000000..cff28b3e
--- /dev/null
+++ b/src/statusbar.cpp
@@ -0,0 +1,112 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qpainter.h>
+#include <qtimer.h>
+#include <qfontmetrics.h>
+
+#include <kdebug.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kparts/part.h>
+#include <ktexteditor/viewcursorinterface.h>
+#include <kdeversion.h>
+
+#include <ktexteditor/viewstatusmsginterface.h>
+
+#include "statusbar.h"
+#include "partcontroller.h"
+
+KDevStatusBar::KDevStatusBar(QWidget *parent, const char *name)
+ : KStatusBar(parent, name), _cursorIface(0), _activePart(0)
+{
+ QWidget * w = new QWidget( this );
+ addWidget( w, 1, true );
+ w->hide();
+
+ _status = new QLabel( this );
+ _status->setMinimumWidth(_status->fontMetrics().width("Line: XXXXX Col: XXX OVR NORM * "));
+ _status->setAlignment(QWidget::AlignCenter);
+ addWidget(_status, 0, true);
+
+ connect(PartController::getInstance(), SIGNAL(activePartChanged(KParts::Part*)),
+ this, SLOT(activePartChanged(KParts::Part*)));
+}
+
+
+KDevStatusBar::~KDevStatusBar()
+{}
+
+void KDevStatusBar::activePartChanged(KParts::Part *part)
+{
+ if ( _activePart && _activePart->widget() )
+ disconnect( _activePart->widget(), 0, this, 0 );
+
+ _activePart = part;
+ _cursorIface = 0;
+ _viewmsgIface = 0;
+
+ if (part && part->widget())
+ {
+ if ((_viewmsgIface = dynamic_cast<KTextEditor::ViewStatusMsgInterface*>(part->widget())))
+ {
+ connect( part->widget(), SIGNAL( viewStatusMsg( const QString & ) ),
+ this, SLOT( setStatus( const QString & ) ) );
+
+ _status->show();
+ }
+ else if ((_cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>(part->widget())))
+ {
+ connect(part->widget(), SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
+
+ _status->show();
+ cursorPositionChanged();
+ }
+ else
+ {
+ // we can't produce any status data, hide the status box
+ _status->hide();
+ }
+ }
+}
+
+void KDevStatusBar::cursorPositionChanged()
+{
+ if (_cursorIface)
+ {
+ uint line, col;
+ _cursorIface->cursorPosition(&line, &col);
+ setCursorPosition(line, col);
+ }
+}
+
+void KDevStatusBar::setStatus(const QString &str)
+{
+ _status->setText(str);
+}
+
+
+void KDevStatusBar::setCursorPosition(int line, int col)
+{
+ _status->setText(i18n(" Line: %1 Col: %2 ").arg(line+1).arg(col));
+}
+
+void KDevStatusBar::addWidget ( QWidget *widget, int stretch, bool permanent)
+{
+ KStatusBar::addWidget(widget,stretch,permanent);
+
+ if(widget->sizeHint().height() + 4 > height())
+ setFixedHeight(widget->sizeHint().height() + 4);
+}
+
+#include "statusbar.moc"
diff --git a/src/statusbar.h b/src/statusbar.h
new file mode 100644
index 00000000..30b80724
--- /dev/null
+++ b/src/statusbar.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _STATUSBAR_H_
+#define _STATUSBAR_H_
+
+#include <kstatusbar.h>
+#include <qmap.h>
+
+class QLabel;
+
+namespace KTextEditor { class ViewStatusMsgInterface; }
+namespace KTextEditor { class ViewCursorInterface; }
+namespace KParts { class Part; }
+
+/**
+Status bar.
+*/
+class KDevStatusBar : public KStatusBar
+{
+ Q_OBJECT
+
+public:
+ KDevStatusBar( QWidget *parent=0, const char *name=0 );
+ ~KDevStatusBar();
+ void addWidget ( QWidget *widget, int stretch = 0, bool permanent = FALSE );
+
+private slots:
+ void cursorPositionChanged();
+ void activePartChanged(KParts::Part *part);
+ void setStatus(const QString &str);
+ void setCursorPosition(int line, int col);
+
+private:
+ QLabel *_status;
+
+ KTextEditor::ViewCursorInterface * _cursorIface;
+ KTextEditor::ViewStatusMsgInterface * _viewmsgIface;
+ KParts::Part *_activePart;
+
+};
+
+#endif
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
new file mode 100644
index 00000000..048b325c
--- /dev/null
+++ b/src/toplevel.cpp
@@ -0,0 +1,35 @@
+#include <kxmlguiclient.h>
+#include <kapplication.h>
+#include <kconfig.h>
+
+
+#include "toplevel.h"
+#include "core.h"
+
+#include "simplemainwindow.h"
+
+KDevMainWindow *TopLevel::s_instance = 0;
+
+bool TopLevel::mainWindowValid()
+{
+ return s_instance != 0;
+}
+
+KDevMainWindow *TopLevel::getInstance()
+{
+ if (!s_instance)
+ {
+ SimpleMainWindow *mainWindow = new SimpleMainWindow(0, "SimpleMainWindow");
+ s_instance = mainWindow;
+ mainWindow->init();
+ kapp->setMainWidget(mainWindow);
+ }
+
+ return s_instance;
+}
+
+void TopLevel::invalidateInstance(KDevMainWindow *instance)
+{
+ if ( s_instance == instance )
+ s_instance = 0;
+}
diff --git a/src/toplevel.h b/src/toplevel.h
new file mode 100644
index 00000000..8eb0243a
--- /dev/null
+++ b/src/toplevel.h
@@ -0,0 +1,27 @@
+#ifndef __TOPLEVEL_H__
+#define __TOPLEVEL_H__
+
+
+#include "kdevmainwindow.h"
+
+
+/**\brief This class handles the single object of type KDevMainWindow.
+
+It is completely static (all methods and attributes).
+*/
+
+class TopLevel
+{
+public:
+
+ static KDevMainWindow *getInstance(); //!< Get a pointer to the single KDevTopLevel object
+ static bool mainWindowValid();
+ static void invalidateInstance(KDevMainWindow *instance); //!< Signal that the object has been (or is about to be) destroyed
+
+private:
+
+ static KDevMainWindow *s_instance; //!< Pointer to the single KDevTopLevel object or 0L
+
+};
+
+#endif
diff --git a/vcs/Makefile.am b/vcs/Makefile.am
new file mode 100644
index 00000000..d1fcb5b0
--- /dev/null
+++ b/vcs/Makefile.am
@@ -0,0 +1,39 @@
+##
+## Do NOT remove the comments that start with "kdevelop:"
+## They are actually directives to the kdevelop plugin system
+##
+## The include_xxxx variables are controlled by configure.in.in
+##
+
+#kdevelop: CERVISIA_SUBDIR = cervisia
+#if include_cervisia
+#CERVISIA_SUBDIR = cervisia
+#endif
+
+#kdevelop: CLEARCASE_SUBDIR = clearcase
+if include_clearcase
+CLEARCASE_SUBDIR = clearcase
+endif
+
+#kdevelop: CVSCLIENT_SUBDIR = cvsclient
+#if include_cvsclient
+#CVSCLIENT_SUBDIR = cvsclient
+#endif
+
+#kdevelop: CVSSERVICE_SUBDIR = cvsservice
+if include_cvsservice
+CVSSERVICE_SUBDIR = cvsservice
+endif
+
+#kdevelop: PERFORCE_SUBDIR = perforce
+if include_perforce
+PERFORCE_SUBDIR = perforce
+endif
+
+#kdevelop: SUBVERSION_SUBDIR = subversion
+if include_subversion
+SUBVERSION_SUBDIR = subversion
+endif
+
+#SUBDIRS = $(CERVISIA_SUBDIR) $(CLEARCASE_SUBDIR) $(CVSSERVICE_SUBDIR) $(PERFORCE_SUBDIR) $(SUBVERSION_SUBDIR)
+SUBDIRS = $(CLEARCASE_SUBDIR) $(CVSSERVICE_SUBDIR) $(PERFORCE_SUBDIR) $(SUBVERSION_SUBDIR)
diff --git a/vcs/clearcase/Makefile.am b/vcs/clearcase/Makefile.am
new file mode 100644
index 00000000..64b70392
--- /dev/null
+++ b/vcs/clearcase/Makefile.am
@@ -0,0 +1,18 @@
+# Here resides the clearcase part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevclearcase.la
+libkdevclearcase_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevclearcase_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+
+libkdevclearcase_la_SOURCES = clearcasepart.cpp commentdlg.cpp \
+ clearcasefileinfoprovider.cpp clearcasemanipulator.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevclearcase.desktop
+
+SUBDIRS = integrator
diff --git a/vcs/clearcase/README b/vcs/clearcase/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/vcs/clearcase/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/vcs/clearcase/README.dox b/vcs/clearcase/README.dox
new file mode 100644
index 00000000..74f2678b
--- /dev/null
+++ b/vcs/clearcase/README.dox
@@ -0,0 +1,42 @@
+/** \class ClearcasePart
+Integrates Clearcase configuration management system into KDevelop.
+Based on Perforce (PerforcePart) implementation by Harald Fernengel <harry AT kdevelop.org>
+
+To use clearcase functions, you need to:
+ -# Create a view in which you will keep your project files
+ -# Start the view and open project as a view extended directory.<br>
+ <b>IMPORTANT:</b> If you have a view test_vu and your project is located
+ under /vobs/source/project1 you should open the project
+ from /view/test_vu/vobs/source/project1 rather than
+ inside the view from /vobs/source/project1. File open
+ dialog does not show any files if you do otherwise. Who
+ knows, maybe it will work for you. If so, let me know.
+ -# Clearcase functions appear in the popup menu for an open file just
+ like cvs or perforce.
+ -# Functions supported so far are: checkout, checkin, uncheckout, diff,
+ mkelem, rmname (not rmelem), lshistory, and lsco (list checkouts).
+ -# For mkelem or rmname, you need to make sure that current directory
+ is checked out or the operation will fail.
+ -# For lshistory, the history is printed to the Messages window.
+ -# For lsco, the checkouts are listed recursively from the directory
+ containing the selected file.
+ -# Snapshot views should work.
+ -# To checkout a directory, select directory in file selector part and use
+ popup-menu.
+ -# The Clearcase popup-menu will appear for any file, even if it is not in
+ a VOB. Attempts to perform Clearcase operations on these files will not
+ succeed, and the output can be viewed in the Messages window.
+
+\authors <a href="mailto:ajay_guleria AT yahoo dot com">Ajay Guleria</a>
+\authors <a href="mailto:pnoffke AT bigpond dot com">Patrick Noffke</a>
+\authors <a href="mailto:phil AT hetroy dot org">Philippe Htroy</a>
+
+\feature Integrates Clearcase configuration management system into KDevelop and displays VCS file information
+\feature Detects the clearcase environment and activates menus
+\feature Provided a dialog for checkout and checkin comments.
+
+
+\todo Update the tree view when a VCS action is done (checkout, checkin...)
+\todo Add a clearcase logging window
+
+*/
diff --git a/vcs/clearcase/clearcasefileinfoprovider.cpp b/vcs/clearcase/clearcasefileinfoprovider.cpp
new file mode 100644
index 00000000..66dec0c8
--- /dev/null
+++ b/vcs/clearcase/clearcasefileinfoprovider.cpp
@@ -0,0 +1,66 @@
+//
+// C++ Implementation: clearcasefileinfoprovider
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "clearcasefileinfoprovider.h"
+#include "clearcasepart.h"
+#include "kdevversioncontrol.h"
+
+#include <kprocess.h>
+#include <qapplication.h>
+
+ClearcaseFileinfoProvider::ClearcaseFileinfoProvider(ClearcasePart *parent)
+ : KDevVCSFileInfoProvider( (KDevVersionControl*) parent, "clearcasefileinfoprovider")
+{
+ vcsInfo_ = NULL;
+
+ connect(parent, SIGNAL(statusReady(const VCSFileInfoMap&, void*)), SIGNAL(triggerUpdate(const VCSFileInfoMap&, void*)));
+
+ kdevVCS_ = parent;
+}
+
+
+ClearcaseFileinfoProvider::~ClearcaseFileinfoProvider()
+{
+}
+
+
+const VCSFileInfoMap* ClearcaseFileinfoProvider::status( const QString &dirPath ) {
+
+ if (curDirPath_ == dirPath) return vcsInfo_;
+
+ curDirPath_ = dirPath;
+
+ if (vcsInfo_ != NULL) delete vcsInfo_;
+
+ vcsInfo_ = ccManipulator_.retreiveFilesInfos(dirPath);
+
+ return vcsInfo_;
+}
+
+bool ClearcaseFileinfoProvider::requestStatus( const QString &dirPath, void *callerData, bool recursive, bool checkRepos ) {
+
+ VCSFileInfoMap* vcsDirInfos = ccManipulator_.retreiveFilesInfos(dirPath);
+
+ // update the file tree view
+ emit statusReady(*vcsDirInfos, callerData);
+
+ delete vcsDirInfos;
+ return true;
+}
+
+
+
+QStringList ClearcaseFileinfoProvider::registeredEntryList() const
+{
+ QStringList l;
+ return l;
+}
+
diff --git a/vcs/clearcase/clearcasefileinfoprovider.h b/vcs/clearcase/clearcasefileinfoprovider.h
new file mode 100644
index 00000000..b716d01b
--- /dev/null
+++ b/vcs/clearcase/clearcasefileinfoprovider.h
@@ -0,0 +1,50 @@
+//
+// C++ Interface: clearcasefileinfoprovider
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CLEARCASEFILEINFOPROVIDER_H
+#define CLEARCASEFILEINFOPROVIDER_H
+
+#include "clearcasepart.h"
+#include "clearcasemanipulator.h"
+
+
+/**
+@author KDevelop Authors
+*/
+class ClearcaseFileinfoProvider : public KDevVCSFileInfoProvider
+{
+ Q_OBJECT
+public:
+ ClearcaseFileinfoProvider(ClearcasePart *parent);
+
+ virtual ~ClearcaseFileinfoProvider();
+
+ // -- Sync interface
+ const VCSFileInfoMap *status( const QString &dirPath ) ;
+
+ // -- Async interface for requesting data
+ bool requestStatus( const QString &dirPath, void *callerData, bool recursive = true, bool checkRepos = true );
+
+
+private:
+
+ QStringList registeredEntryList() const;
+
+
+private:
+ ClearcaseManipulator ccManipulator_;
+ QString curDirPath_;
+ VCSFileInfoMap* vcsInfo_;
+ ClearcasePart* kdevVCS_;
+
+};
+
+#endif
diff --git a/vcs/clearcase/clearcasemanipulator.cpp b/vcs/clearcase/clearcasemanipulator.cpp
new file mode 100644
index 00000000..c51436ba
--- /dev/null
+++ b/vcs/clearcase/clearcasemanipulator.cpp
@@ -0,0 +1,133 @@
+//
+// C++ Implementation: ClearcaseManipulator
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "clearcasemanipulator.h"
+
+#include <kprocess.h>
+
+#include <qregexp.h>
+#include <qstring.h>
+
+#include <stdlib.h>
+#include <libgen.h>
+#include <errno.h>
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
+
+#if defined(Q_OS_MACX) || defined(MACOSX) || defined(Q_OS_SOLARIS) || defined(Q_OS_FREEBSD) || (defined(__NetBSD__) && (__NetBSD_Version__ < 599001500)) || defined(__DragonFly__)
+//this function is taken from GNU libc
+//it does not exist on macos
+int getline(char **lineptr, size_t *n, FILE *stream)
+{
+ static char line[256];
+ char *ptr;
+ unsigned int len;
+
+ if (lineptr == NULL || n == NULL)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (ferror (stream))
+ return -1;
+
+ if (feof(stream))
+ return -1;
+
+ fgets(line,256,stream);
+
+ ptr = strchr(line,'\n');
+ if (ptr)
+ *ptr = '\0';
+
+ len = strlen(line);
+
+ if ((len+1) < 256)
+ {
+ ptr = (char*)realloc(*lineptr, 256);
+ if (ptr == NULL)
+ return(-1);
+ *lineptr = ptr;
+ *n = 256;
+ }
+
+ strcpy(*lineptr,line);
+ return(len);
+}
+#endif
+
+const char ClearcaseManipulator::CT_DESC_SEPARATOR = ';';
+
+
+ClearcaseManipulator::ClearcaseManipulator()
+{
+}
+
+
+ClearcaseManipulator::~ClearcaseManipulator()
+{}
+
+
+bool ClearcaseManipulator::isCCRepository( const QString & directory ) {
+ QString cmd;
+ cmd = "cd " + directory + " && cleartool pwv -root";
+ if ( system(cmd.ascii()) == 0 ) return true;
+
+ return false;
+}
+
+VCSFileInfoMap* ClearcaseManipulator::retreiveFilesInfos(const QString& directory) {
+
+
+ VCSFileInfoMap* fileInfoMap = new VCSFileInfoMap();
+
+ char CCcommand[1024];
+ sprintf(CCcommand, "cleartool desc -fmt \"%%m;%%En;%%Rf;%%Sn;%%PVn\\n\" %s/*", directory.ascii());
+ FILE* outputFile = popen(CCcommand, "r");
+
+ char* line = NULL;
+ size_t numRead;
+ while (!feof(outputFile)) {
+ getline(&line,&numRead,outputFile);
+
+ if (numRead > 0) {
+ int pos = 0;
+ int lastPos = -1;
+
+ QStringList outputList;
+ outputList = outputList.split(CT_DESC_SEPARATOR, QString(line), true );
+ outputList[Name] = QString(basename((char*)outputList[Name].ascii()));
+
+ VCSFileInfo::FileState state;
+ if (outputList[ClearcaseManipulator::State] == "unreserved" || outputList[ClearcaseManipulator::State] == "reserved") {
+ state = VCSFileInfo::Modified;
+ }
+ else if (outputList[ClearcaseManipulator::State] == "") {
+ state = VCSFileInfo::Uptodate;
+ }
+ else {
+ state = VCSFileInfo::Unknown;
+ }
+
+
+ (*fileInfoMap)[outputList[ClearcaseManipulator::Name]] = VCSFileInfo(outputList[ClearcaseManipulator::Name], outputList[ClearcaseManipulator::Version], outputList[ClearcaseManipulator::RepositoryVersion], state);
+ }
+ }
+
+ pclose(outputFile);
+
+ return fileInfoMap;
+}
+
+
+
diff --git a/vcs/clearcase/clearcasemanipulator.h b/vcs/clearcase/clearcasemanipulator.h
new file mode 100644
index 00000000..baa7c17f
--- /dev/null
+++ b/vcs/clearcase/clearcasemanipulator.h
@@ -0,0 +1,49 @@
+//
+// C++ Interface: ClearcaseManipulator
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2005
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CLEARCASEMANIPULATOR_H
+#define CLEARCASEMANIPULATOR_H
+
+#include "kdevversioncontrol.h"
+
+#include <kprocess.h>
+
+#include <qregexp.h>
+
+#include <string>
+
+/**
+ @author KDevelop Authors
+ */
+class ClearcaseManipulator {
+ public:
+ ClearcaseManipulator();
+
+ ~ClearcaseManipulator();
+
+ static bool isCCRepository(const QString& directory);
+
+ VCSFileInfoMap* retreiveFilesInfos(const QString& directory);
+
+ private:
+ enum FileInfosFields {
+ Type = 0,
+ Name,
+ State,
+ Version,
+ RepositoryVersion
+ };
+
+ static const char CT_DESC_SEPARATOR;
+
+};
+
+#endif
diff --git a/vcs/clearcase/clearcasepart.cpp b/vcs/clearcase/clearcasepart.cpp
new file mode 100644
index 00000000..6c11a4a6
--- /dev/null
+++ b/vcs/clearcase/clearcasepart.cpp
@@ -0,0 +1,363 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Ajay Guleria *
+ * ajay_guleria at yahoo dot com *
+ * *
+ * 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 "clearcasepart.h"
+#include "commentdlg.h"
+
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+
+#include <kpopupmenu.h>
+#include <kdebug.h>
+#include <kdevgenericfactory.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+
+#include "kdevcore.h"
+#include "kdevmakefrontend.h"
+#include "kdevdifffrontend.h"
+#include "kdevappfrontend.h"
+#include "execcommand.h"
+#include "domutil.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+#include "kdevplugininfo.h"
+
+#include "clearcasefileinfoprovider.h"
+#include "clearcasemanipulator.h"
+
+
+static const KDevPluginInfo data("kdevclearcase");
+
+typedef KDevGenericFactory<ClearcasePart> ClearcaseFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevclearcase, ClearcaseFactory( data ) )
+
+ClearcasePart::ClearcasePart( QObject *parent, const char *name, const QStringList & )
+ : KDevVersionControl( &data, parent, name ? name : "ClearcasePart" ),
+ default_checkin(""),
+ default_checkout(""),
+ default_uncheckout("-rm"),
+ default_create("-ci"),
+ default_remove("-f"),
+ default_lshistory(""),
+ default_diff("-pred -diff"),
+ default_lscheckout("-recurse")
+{
+
+ // check if project directory is valid and cache it
+ isValidCCDirectory_ = ClearcaseManipulator::isCCRepository( project()->projectDirectory() );
+
+ fileInfoProvider_ = new ClearcaseFileinfoProvider(this);
+
+ setInstance(ClearcaseFactory::instance());
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+}
+
+ClearcasePart::~ClearcasePart()
+{}
+
+
+
+bool ClearcasePart::isValidDirectory(const QString &dirPath) const {
+ return isValidCCDirectory_;
+}
+
+
+void ClearcasePart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+
+ if (context->hasType( Context::FileContext )) {
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+ popupfile_ = fcontext->urls().first().path();
+
+ QFileInfo fi(popupfile_);
+ popup->insertSeparator();
+
+ KPopupMenu *sub = new KPopupMenu(popup);
+ QString name = fi.fileName();
+ sub->insertTitle( i18n("Actions for %1").arg(name) );
+ sub->insertItem( i18n("Checkin"),
+ this, SLOT(slotCheckin()) );
+ sub->insertItem( i18n("Checkout"),
+ this, SLOT(slotCheckout()) );
+ sub->insertItem( i18n("Uncheckout"),
+ this, SLOT(slotUncheckout()) );
+ sub->insertSeparator();
+ sub->insertItem( i18n("Create Element"),
+ this, SLOT(slotCreate()) );
+ sub->insertItem( i18n("Remove Element"),
+ this, SLOT(slotRemove()) );
+ sub->insertSeparator();
+ sub->insertItem( i18n("History"),
+ this, SLOT(slotListHistory()) );
+ sub->insertSeparator();
+ sub->insertItem( i18n("Diff"),
+ this, SLOT(slotDiff()) );
+
+ sub->insertSeparator();
+ sub->insertItem( i18n("List Checkouts"),
+ this, SLOT(slotListCheckouts()) );
+
+ popup->insertItem(i18n("Clearcase"), sub);
+
+ if (!project() || !isValidDirectory( project()->projectDirectory() )) {
+ sub->setEnabled( false );
+ }
+ }
+}
+
+
+void ClearcasePart::slotCheckin()
+{
+ QString dir, name;
+ QFileInfo fi(popupfile_);
+ dir = fi.dirPath();
+ name = fi.fileName();
+
+ CcaseCommentDlg dlg(FALSE);
+ if (dlg.exec() == QDialog::Rejected)
+ return;
+
+ QDomDocument &dom = *this->projectDom();
+ QString message = DomUtil::readEntry(dom,"/kdevclearcase/checkin_options",default_checkin);
+ if(dlg.logMessage().isEmpty())
+ message += "-nc ";
+ else
+ message += "-c \"" + dlg.logMessage() + "\"";
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ command += " && ";
+ command += " cleartool checkin ";
+ command += message; // Already quoted, see above
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+}
+
+
+void ClearcasePart::slotCheckout()
+{
+ QString dir, name;
+ QFileInfo fi(popupfile_);
+ dir = fi.dirPath();
+ name = fi.fileName();
+
+ CcaseCommentDlg dlg(TRUE);
+ if (dlg.exec() == QDialog::Rejected)
+ return;
+
+ QDomDocument &dom = *this->projectDom();
+ QString message = DomUtil::readEntry(dom,"/kdevclearcase/checkout_options",default_checkout);
+ if(!dlg.isReserved())
+ message += "-unres ";
+ if(dlg.logMessage().isEmpty())
+ message += "-nc ";
+ else
+ message += "-c \"" + dlg.logMessage() + "\"";
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ command += " && cleartool checkout ";
+ command += message;
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+
+ emit finishedFetching(dir);
+}
+
+
+void ClearcasePart::slotUncheckout()
+{
+ QString dir, name;
+ QFileInfo fi(popupfile_);
+ dir = fi.dirPath();
+ name = fi.fileName();
+
+ QDomDocument &dom = *this->projectDom();
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ command += " && cleartool uncheckout ";
+ command += DomUtil::readEntry(dom,"/kdevclearcase/uncheckout_options",default_uncheckout);
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+
+ emit finishedFetching(dir);
+}
+
+void ClearcasePart::slotCreate()
+{
+ QFileInfo fi(popupfile_);
+ QString dir = fi.dirPath();
+ QString name = fi.fileName();
+
+ QDomDocument &dom = *this->projectDom();
+
+ // Checking whether current directory is checked out or not is cumbersome so skip it for now
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ QFileInfo di(dir);
+ if(!di.isWritable()) { // Work-around to check if directory is checked out
+ command += " && cleartool co -unres -nc ";
+ command += KShellProcess::quote(dir);
+ }
+ command += " && cleartool mkelem ";
+ if(fi.isDir())
+ command += " -elt directory ";
+ command += DomUtil::readEntry(dom,"/kdevclearcase/create_options",default_create);
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+
+ emit finishedFetching(dir);
+}
+
+
+void ClearcasePart::slotRemove()
+{
+ QFileInfo fi(popupfile_);
+ QString dir = fi.dirPath();
+ QString name = fi.fileName();
+
+ QDomDocument &dom = *this->projectDom();
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ QFileInfo di(dir);
+ if(!di.isWritable()) { // Work-around to check if directory is checked out
+ command += " && cleartool co -unres -nc ";
+ command += KShellProcess::quote(dir);
+ }
+ command += " && cleartool rmname "; // Don't use rm command
+ command += DomUtil::readEntry(dom,"/kdevclearcase/remove_options",default_remove);
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+
+ emit finishedFetching(dir);
+}
+
+void ClearcasePart::slotListHistory()
+{
+ QFileInfo fi(popupfile_);
+ QString dir = fi.dirPath();
+ QString name = fi.fileName();
+ QStringList args;
+ QStringList env;
+ QString str;
+
+ QDomDocument &dom = *this->projectDom();
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ command += " && cleartool lshistory ";
+ command += DomUtil::readEntry(dom, "/kdevclearcase/lshistory_options", default_lshistory);
+ command += " ";
+ command += KShellProcess::quote(name);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+}
+
+void ClearcasePart::slotDiff()
+{
+ QFileInfo fi(popupfile_);
+ QString dir = fi.dirPath();
+ QString name = fi.fileName();
+ QStringList args;
+ QStringList env;
+ QString str;
+
+ QDomDocument &dom = *this->projectDom();
+
+ args << "diff";
+ str = DomUtil::readEntry(dom,"/kdevclearcase/diff_options",default_diff);
+ if (str.length()) {
+ QStringList list = QStringList::split(' ',str);
+ for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) args << *it;
+ }
+
+ args << name;
+
+ ExecCommand* cmv = new ExecCommand( "cleartool", args, dir, env, this );
+ connect( cmv, SIGNAL(finished( const QString&, const QString& )),
+ this, SLOT(slotDiffFinished( const QString&, const QString& )) );
+}
+
+
+void ClearcasePart::slotDiffFinished( const QString& diff, const QString& err )
+{
+ if ( diff.isNull() && err.isNull() ) {
+ kdDebug(9000) << "clearcase diff canceled" << endl;
+ return; // user pressed cancel or an error occured
+ }
+
+ if ( diff.isEmpty() && !err.isEmpty() ) {
+ KMessageBox::detailedError( 0, i18n("Clearcase output errors during diff."), err, i18n("Errors During Diff") );
+ return;
+ }
+
+ if ( !err.isEmpty() ) {
+ int s = KMessageBox::warningContinueCancelList( 0, i18n("Clearcase outputted errors during diff. Do you still want to continue?"),
+ QStringList::split( "\n", err, false ), i18n("Errors During Diff") );
+ if ( s != KMessageBox::Continue )
+ return;
+ }
+
+ if ( diff.isEmpty() ) {
+ KMessageBox::information( 0, i18n("There is no difference to the repository."), i18n("No Difference Found") );
+ return;
+ }
+
+ if (KDevDiffFrontend *diffFrontend = extension<KDevDiffFrontend>("KDevelop/DiffFrontend"))
+ diffFrontend->showDiff( diff );
+}
+
+void ClearcasePart::slotListCheckouts()
+{
+ QString dir;
+ QFileInfo fi(popupfile_);
+ if (fi.isDir()) {
+ dir = fi.absFilePath();
+ } else {
+ dir = fi.dirPath();
+ }
+
+ QDomDocument &dom = *this->projectDom();
+
+ QString command("cd ");
+ command += KShellProcess::quote(dir);
+ command += " && cleartool lsco ";
+ command += DomUtil::readEntry(dom, "/kdevclearcase/lscheckout_options", default_lscheckout);
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+
+}
+
+
+#include "clearcasepart.moc"
diff --git a/vcs/clearcase/clearcasepart.h b/vcs/clearcase/clearcasepart.h
new file mode 100644
index 00000000..2f82b61d
--- /dev/null
+++ b/vcs/clearcase/clearcasepart.h
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Ajay Guleria *
+ * ajay_guleria at yahoo dot com *
+ * *
+ * 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 _CLEARCASEPART_H_
+#define _CLEARCASEPART_H_
+
+#include <kdevversioncontrol.h>
+
+class Context;
+class QPopupMenu;
+
+class ClearcasePart : public KDevVersionControl {
+ Q_OBJECT
+
+public:
+ ClearcasePart( QObject *parent, const char *name, const QStringList & );
+ ~ClearcasePart();
+
+ const QString default_checkin;
+ const QString default_checkout;
+ const QString default_uncheckout;
+ const QString default_create;
+ const QString default_remove;
+ const QString default_lshistory;
+ const QString default_lscheckout;
+ const QString default_diff;
+
+ virtual void createNewProject(const QString& dir) {}
+ virtual bool fetchFromRepository() { return true; }
+ virtual KDevVCSFileInfoProvider *fileInfoProvider() const { return fileInfoProvider_; }
+ virtual bool isValidDirectory(const QString &dirPath) const;
+
+private slots:
+ void contextMenu(QPopupMenu *popup, const Context *context);
+
+ void slotCheckin();
+ void slotCheckout();
+ void slotUncheckout();
+
+ void slotCreate();
+ void slotRemove();
+ void slotDiff();
+ void slotDiffFinished( const QString& diff, const QString& err );
+ void slotListHistory();
+ void slotListCheckouts();
+
+
+private:
+
+ bool isValidCCDirectory_;
+ QString popupfile_;
+ QString viewname;
+
+ KDevVCSFileInfoProvider *fileInfoProvider_;
+};
+
+#endif
diff --git a/vcs/clearcase/commentdlg.cpp b/vcs/clearcase/commentdlg.cpp
new file mode 100644
index 00000000..36b3bc6f
--- /dev/null
+++ b/vcs/clearcase/commentdlg.cpp
@@ -0,0 +1,61 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Ajay Guleria *
+ * ajay_guleria at yahoo dot com *
+ * *
+ * 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 "commentdlg.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <kapplication.h>
+#include <kbuttonbox.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstdguiitem.h>
+
+CcaseCommentDlg::CcaseCommentDlg(bool bCheckin)
+ : QDialog(0, "", true)
+{
+ setCaption( i18n("Clearcase Comment") );
+
+ QBoxLayout *layout = new QVBoxLayout(this, 10);
+
+ QLabel *messagelabel = new QLabel(i18n("Enter log message:"), this);
+ messagelabel->setMinimumSize(messagelabel->sizeHint());
+ layout->addWidget(messagelabel, 0);
+
+ _edit = new QMultiLineEdit(this);
+ QFontMetrics fm(_edit->fontMetrics());
+ _edit->setMinimumSize(fm.width("0")*40, fm.lineSpacing()*3);
+ layout->addWidget(_edit, 10);
+
+ QBoxLayout *layout2 = new QHBoxLayout(layout);
+ if(bCheckin) {
+ _check = new QCheckBox(i18n("Reserve"), this);
+ layout2->addWidget(_check);
+ }
+
+ KButtonBox *buttonbox = new KButtonBox(this);
+ buttonbox->addStretch();
+ QPushButton *ok = buttonbox->addButton(KStdGuiItem::ok());
+ QPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
+ connect(ok, SIGNAL(clicked()), SLOT(accept()) );
+ connect(cancel, SIGNAL(clicked()), SLOT(reject()) );
+ ok->setDefault(true);
+ buttonbox->layout();
+ layout2->addWidget(buttonbox, 0);
+
+ layout->activate();
+ adjustSize();
+}
+
+
+
+#include "commentdlg.moc"
diff --git a/vcs/clearcase/commentdlg.h b/vcs/clearcase/commentdlg.h
new file mode 100644
index 00000000..8ac50a38
--- /dev/null
+++ b/vcs/clearcase/commentdlg.h
@@ -0,0 +1,32 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Ajay Guleria *
+ * ajay_guleria at yahoo dot com *
+ * *
+ * 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 _CLEARCASECOMMENTDLG_H_
+#define _CLEARCASECOMMENTDLG_H_
+
+#include <qcheckbox.h>
+#include <qdialog.h>
+#include <qmultilineedit.h>
+
+class CcaseCommentDlg : public QDialog
+{
+Q_OBJECT
+public:
+ CcaseCommentDlg(bool = FALSE);
+ QString logMessage() { return _edit->text(); };
+ bool isReserved() { return (_check) ? _check->isChecked() : FALSE; };
+
+private:
+ QMultiLineEdit *_edit;
+ QCheckBox* _check;
+};
+
+#endif
diff --git a/vcs/clearcase/integrator/Makefile.am b/vcs/clearcase/integrator/Makefile.am
new file mode 100644
index 00000000..cd998856
--- /dev/null
+++ b/vcs/clearcase/integrator/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libclearcaseintegrator.la
+libclearcaseintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries)
+libclearcaseintegrator_la_LIBADD =\
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la\
+ $(top_builddir)/lib/libkdevelop.la
+kde_services_DATA = kdevclearcaseintegrator.desktop
+noinst_HEADERS = clearcaseintegrator.h ccintegratordlg.h
+libclearcaseintegrator_la_SOURCES = clearcaseintegrator.cpp \
+ ccintegratordlgbase.ui ccintegratordlg.cpp
diff --git a/vcs/clearcase/integrator/ccintegratordlg.cpp b/vcs/clearcase/integrator/ccintegratordlg.cpp
new file mode 100644
index 00000000..3e58aada
--- /dev/null
+++ b/vcs/clearcase/integrator/ccintegratordlg.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "ccintegratordlg.h"
+
+CCIntegratorDlg::CCIntegratorDlg(QWidget *parent, const char *name)
+ :CCIntegratorDlgBase(parent, name)
+{
+}
+
+void CCIntegratorDlg::accept()
+{
+}
+
+void CCIntegratorDlg::init(const QString &/*projectName*/, const QString &/*projectLocation*/)
+{
+}
+
+QWidget *CCIntegratorDlg::self()
+{
+ return const_cast<CCIntegratorDlg*>(this);
+}
+
+#include "ccintegratordlg.moc"
diff --git a/vcs/clearcase/integrator/ccintegratordlg.h b/vcs/clearcase/integrator/ccintegratordlg.h
new file mode 100644
index 00000000..0b197437
--- /dev/null
+++ b/vcs/clearcase/integrator/ccintegratordlg.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef CCINTEGRATORDLG_H
+#define CCINTEGRATORDLG_H
+
+#include "ccintegratordlgbase.h"
+#include <kdevvcsintegrator.h>
+
+class CCIntegratorDlg: public CCIntegratorDlgBase, public VCSDialog {
+Q_OBJECT
+public:
+ CCIntegratorDlg(QWidget *parent = 0, const char *name = 0);
+
+ virtual void accept();
+ virtual void init(const QString &projectName, const QString &projectLocation);
+ virtual QWidget *self();
+};
+
+#endif
diff --git a/vcs/clearcase/integrator/ccintegratordlgbase.ui b/vcs/clearcase/integrator/ccintegratordlgbase.ui
new file mode 100644
index 00000000..ae961a9f
--- /dev/null
+++ b/vcs/clearcase/integrator/ccintegratordlgbase.ui
@@ -0,0 +1,47 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>CCIntegratorDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CCIntegratorDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>No options available for this VCS.</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>437</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/clearcase/integrator/clearcaseintegrator.cpp b/vcs/clearcase/integrator/clearcaseintegrator.cpp
new file mode 100644
index 00000000..3ea4295f
--- /dev/null
+++ b/vcs/clearcase/integrator/clearcaseintegrator.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "clearcaseintegrator.h"
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "ccintegratordlg.h"
+
+static const KDevPluginInfo data("kdevclearcaseintegrator");
+typedef KDevGenericFactory<ClearcaseIntegrator> ClearcaseIntegratorFactory;
+K_EXPORT_COMPONENT_FACTORY( libclearcaseintegrator, ClearcaseIntegratorFactory(data) )
+
+ClearcaseIntegrator::ClearcaseIntegrator(QObject* parent, const char* name,
+ const QStringList // args
+ )
+ :KDevVCSIntegrator(parent, name)
+{
+}
+
+ClearcaseIntegrator::~ClearcaseIntegrator()
+{
+}
+
+VCSDialog* ClearcaseIntegrator::fetcher(QWidget* // parent
+ )
+{
+ return 0;
+}
+
+VCSDialog* ClearcaseIntegrator::integrator(QWidget* parent)
+{
+ CCIntegratorDlg *dlg = new CCIntegratorDlg(parent);
+ return dlg;
+}
+
+#include "clearcaseintegrator.moc"
diff --git a/vcs/clearcase/integrator/clearcaseintegrator.h b/vcs/clearcase/integrator/clearcaseintegrator.h
new file mode 100644
index 00000000..a6aaf396
--- /dev/null
+++ b/vcs/clearcase/integrator/clearcaseintegrator.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef CLEARCASEINTEGRATOR_H
+#define CLEARCASEINTEGRATOR_H
+
+#include <kdevvcsintegrator.h>
+
+#include <qstringlist.h>
+
+class ClearcaseIntegrator : public KDevVCSIntegrator
+{
+Q_OBJECT
+public:
+ ClearcaseIntegrator(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~ClearcaseIntegrator();
+
+ virtual VCSDialog* fetcher(QWidget* parent);
+ virtual VCSDialog* integrator(QWidget* parent);
+
+};
+
+#endif
diff --git a/vcs/clearcase/integrator/kdevclearcaseintegrator.desktop b/vcs/clearcase/integrator/kdevclearcaseintegrator.desktop
new file mode 100644
index 00000000..b9957370
--- /dev/null
+++ b/vcs/clearcase/integrator/kdevclearcaseintegrator.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=KDevClearcaseIntegrator
+Name[da]=KDevelop Clearcase-integration
+Name[nds]=KDevelop-Clearcase-Integreren
+Name[sk]=KDev ClearCase integrácia
+Name[sv]=KDevelop Clearcase-integration
+Name[zh_TW]=KDevelop Clearcase 整合器
+Comment=Clearcase Project Integration Facility
+Comment[ca]=Faciliat per a la integració amb projectes Clearcase
+Comment[da]=Clearcase projektintegration
+Comment[de]=Clearcase-Integration
+Comment[el]=Λειτουργία ενσωμάτωσης Clearcase στο έργο
+Comment[es]=Facilidad para integración con proyectos Clearcase
+Comment[et]=Clearcase projekti põimimisvahend
+Comment[eu]=Clearcase proiektu-integraziorako tresna
+Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ Clearcase
+Comment[fr]=Fonction d'intégration pour un projet utilisant Clearcase
+Comment[gl]=Utilidade para a integración de proxectos ClearCase
+Comment[hu]=Integrálás Clearcase-projektekkel
+Comment[it]=Funzione di integrazione del progetto ClearCase
+Comment[ja]=Clearcase プロジェクト統合ツール
+Comment[ms]=Kemudahan Integrasi Projek Clearcase
+Comment[nds]=Projektintegreren för Clearcase
+Comment[ne]=क्लेयरकेस परियोजना एकिकरण सुविधा
+Comment[nl]=Clearcase-projectintegratie
+Comment[pl]=Integracja z Clearcase
+Comment[pt]=Integração com Projectos Clearcase
+Comment[pt_BR]=Facilidade de Integração ao Projeto de Clearcase
+Comment[ru]=Интеграция Clearcase
+Comment[sk]=Integrácia ClearCase projektu
+Comment[sr]=Интеграција Clearcase-а у пројекат
+Comment[sr@Latn]=Integracija Clearcase-a u projekat
+Comment[sv]=Funktion för integrering av Clearcase i projekt
+Comment[tr]=Clearcase Proje Bütünleştirilmesi Aracı
+Comment[zh_CN]=Clearcase 工程集成功能
+Comment[zh_TW]=Clearcase 專案整合工具
+Exec=blubb
+ServiceTypes=KDevelop/VCSIntegrator
+X-KDE-Library=libclearcaseintegrator
+X-KDevelop-Default=false
+X-KDevelop-VCS=ClearCase
+X-KDevelop-VCSPlugin=kdevclearcase
+X-KDevelop-Version=5
diff --git a/vcs/clearcase/kdevclearcase.desktop b/vcs/clearcase/kdevclearcase.desktop
new file mode 100644
index 00000000..5a691980
--- /dev/null
+++ b/vcs/clearcase/kdevclearcase.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=A plugin that provides support for Rational ClearCase, a large version control and build management system. http://www.rational.com/products/clearcase/index.jsp
+Comment[ca]=Un connector que proporciona suport per a ClearCase de Rational, un potent sistema de control de versions i gestió de compilacions. http://www.rational.com/products/clearcase/index.jsp
+Comment[da]=Et plugin der sørger for støtte for Rational ClearCase, et stort versionskontrol og byggehåndteringssystem. http://www.rational.com/products/clearcase/index.jsp
+Comment[de]=Eine Komponente, die eine Schnittstelle zu Rational ClearCase zur Verfügung stellt, einem umfangreichen Werkzeug zur Verwaltung von Versionen und Erstellungsvorgängen. http://www.rational.com/products/clearcase/index.jsp
+Comment[el]=Ένα πρόσθετο που προσφέρει υποστήριξη για το Rational ClearCase, ένα μεγάλο σύστημα διαχείρισης ελέγχου εκδόσεων και κατασκευής. http://www.rational.com/products/clearcase/index.jsp
+Comment[es]=Un complemento que proporciona soporte para Rational ClearCase, un potente sistema de control de versiones y administración de compilaciones (http://www.rational.com/products/clearcase/index.jsp)
+Comment[et]=See plugin pakub suure versioonikontrolli ja ehitamise haldamise süsteemi Rational ClearCase toetust. http://www.rational.com/products/clearcase/index.jsp
+Comment[eu]=Rational ClearCase euskarri plugin bat. ClearCase bertsio kontrol eta eraikuntza kudeaketa sistema handi bat da. http://www.rational.com/products/clearcase/index.jsp
+Comment[fa]=وصله‌ای که پشتیبانی برای Rational ClearCase، یک کنترل نسخۀ بزرگ و سیستم مدیریت ساختن فراهم ‌می‌کند. http://www.rational.com/products/clearcase/index.jsp
+Comment[fr]=Un module externe qui offre une prise en charge pour Rational ClearCase, un puissant système de contrôle de versions et de gestion de compilation. http://www.rational.com/products/clearcase/index.jsp
+Comment[gl]=Extensión que proporciona soporte para Rational ClearCase, un gran sistema de control de versións e xestión da compilación. http://www.rational.com/products/clearcase/index.jsp
+Comment[hu]=Bővítőmodul a Rational ClearCase komplex verziókövető rendszerhez. http://www.rational.com/products/clearcase/index.jsp
+Comment[it]=Un plugin che offre il supporto per Rational ClearCase, un sistema molto vasto per il controllo di versione e la compilazione. http://www.rational.com/products/clearcase/index.jsp
+Comment[ja]=大規模なバージョンコントロールやビルド管理システムの合理的な ClearCase の支援を提供するプラグイン。http://www.rational.com/products/clearcase/index.jsp
+Comment[ms]=Plugin yang menyediakan sokongan untuk Rational ClearCase, sistem kawalan versi dan pengurus pembinaan yang besar. http://www.rational.com/products/clearcase/index.jsp
+Comment[nds]=En Moduul, dat Ünnerstütten för "Rational ClearCase" praatstellt, en groot Verschoonkuntrull- un Opstellen-Pleegsysteem. http://www.rational.com/products/clearcase/index.jsp
+Comment[ne]=एउटा प्लगइन जसले र्यासनल क्लेयरकेस, एउटा ठूलो संस्करण नियन्त्रण र निर्माण व्यवस्थापन प्रणालीका लागि समर्थन प्रदान गर्दछ । http://www.rational.com/products/clearcase/index.jsp
+Comment[nl]=Een plugin die ondersteuning biedt voor Rational ClearCase, een omvangrijk versiebeheer en buildmanagement-systeem. Zie http://www.rational.com/products/clearcase/index.jsp
+Comment[pl]=Wtyczka udostępniająca obsługę Rational ClearCase, dużego systemu kontroli wersji i zarządzania budowaniem. http://www.rational.com/products/clearcase/index.jsp
+Comment[pt]=Um 'plugin' que oferece o suporte para o ClearCase da Rational, um sistema grande de controlo de versões e de gestão de compilações. http://www.rational.com/products/clearcase/index.jsp
+Comment[pt_BR]=Um plug-in que fornece suporte para o Rational ClearCase, um grande sistema de controle de versão e gerenciamento de compilação. http://www.rational.com/products/clearcase/index.jsp
+Comment[ru]=Модуль поддержки Rational ClearCase, мощной системы контроля версий и управления проектом. http://www.rational.com/products/clearcase/index.jsp
+Comment[sk]=Modul poskytuje podporu pre Rational ClearCase, riadenie verzií a projektový manažment.
+Comment[sl]=Vstavek, ki omogoča podporo za Rational ClearCase, velik sistem za upravljanje z različicami in grajenjem. http://www.rational.com/products/clearcase/index.jsp
+Comment[sr]=Прикључак који обезбеђује подршку за Rational-ов ClearCase, велики систем за контролу верзија и управљање градњом. http://www.rational.com/products/clearcase/index.jsp
+Comment[sr@Latn]=Priključak koji obezbeđuje podršku za Rational-ov ClearCase, veliki sistem za kontrolu verzija i upravljanje gradnjom. http://www.rational.com/products/clearcase/index.jsp
+Comment[sv]=Ett insticksprogram som stöder Rational ClearCase, ett omfattande versions- och bygghanteringssystem. http://www.rational.com/products/clearcase/index.jsp
+Comment[ta]=சொருகி ரெஷியனல் தெளிவான எழுத்தை ஆதரிக்கும்,கடைசி பதிப்பை இயக்க மற்றும் மேலாளர் அமைப்பை கட்ட.http://www.rational.com/products/clearcase/index.jsp
+Comment[tg]=Модули тарафдори Rational ClearCase, барномаи назораткунандаи калони тафсир ва идоракунии лоиҳаҳо мебошад.http://www.rational.com/products/clearcase/index.jsp
+Comment[tr]=Mantıksal ClearCase, büyük bir kontrol ve yapım yönetim sistemi, için destek sağlayan bir eklenti. http://www.rational.com/products/clearcase/index.jsp
+Comment[zh_CN]=提供 Rational ClearCase 支持,一个大型的版本控制和编译管理系统。http://www.rational.com/products/clearcase/index.jsp
+Comment[zh_TW]=提供支援 Rational ClearCase,大型的版本控制與建立管理系統的外掛程式。http://www.rational.com/products/clearcase/index.jsp
+Name=KDevClearCase
+Name[da]=KDevelop ClearCase
+Name[de]=Unterstützung für ClearCase (KDevelop)
+Name[hi]=के-डेव-क्लीयर-केस
+Name[nds]=ClearCase-Ünnerstütten för KDevelop
+Name[sk]=KDev ClearCase
+Name[sv]=KDevelop ClearCase
+Name[ta]=KDevதெளிவானஎழுத்து
+Name[zh_TW]=KDevelop ClearCase
+GenericName=ClearCase Integration
+GenericName[ca]=Integració amb ClearClase
+GenericName[da]=ClearCase integration
+GenericName[de]=ClearCase-Integration
+GenericName[el]=Ενσωμάτωση ClearCase
+GenericName[es]=Integración con ClearClase
+GenericName[et]=ClearCase'i integratsioon
+GenericName[eu]=ClearCase integrazioa
+GenericName[fa]=مجتمع‌سازی ClearCase
+GenericName[fr]=Intégration de « ClearCase »
+GenericName[ga]=Comhtháthú ClearCase
+GenericName[gl]=Integración de ClearCase
+GenericName[hi]=क्लीयर-केस इंटीग्रेशन
+GenericName[hu]=ClearCase-integráció
+GenericName[it]=Integrazione di ClearCase
+GenericName[ja]=ClearCase 統合
+GenericName[ms]=Intergrasi ClearCase
+GenericName[nds]=ClearCase-Integreren
+GenericName[ne]=क्लेयरकेस एकिकरण
+GenericName[nl]=ClearCase-integratie
+GenericName[pl]=Integracja z ClearCase
+GenericName[pt]=Integração com o ClearCase
+GenericName[pt_BR]=Integração com o ClearCase
+GenericName[ru]=Интеграция ClearCase
+GenericName[sk]=Integrácia ClearCase
+GenericName[sl]=Integracija ClearCase
+GenericName[sr]=Интеграција ClearCase-а
+GenericName[sr@Latn]=Integracija ClearCase-a
+GenericName[sv]=Integrering av ClearCase
+GenericName[ta]=தெளிவான எழுத்து ஒருங்கிணைப்பு
+GenericName[tg]=Интегратсияи ClearCase
+GenericName[tr]=ClearCase Bütünleştirmesi
+GenericName[zh_CN]=ClearCase集成
+GenericName[zh_TW]=ClearCase 整合
+ServiceTypes=KDevelop/VersionControl
+X-KDE-Library=libkdevclearcase
+X-KDevelop-Version=5
+X-KDevelop-Properties=VCS,ClearcaseVCS
diff --git a/vcs/cvsservice/Makefile.am b/vcs/cvsservice/Makefile.am
new file mode 100644
index 00000000..04802374
--- /dev/null
+++ b/vcs/cvsservice/Makefile.am
@@ -0,0 +1,40 @@
+# Here resides the cvs part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/widgets $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevcvsservice.la
+libkdevcvsservice_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevcvsservice_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
+ $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML) -lcvsservice $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+
+libkdevcvsservice_la_SOURCES = cvspart.cpp cvspartimpl.cpp cvsformbase.ui \
+ cvsform.cpp commitdialogbase.ui commitdlg.cpp cvsoptionswidgetbase.ui \
+ cvsoptionswidget.cpp cvsprocesswidget.cpp cvsentry.cpp cvsdir.cpp changelog.cpp \
+ cvsoptions.cpp checkoutdialogbase.ui checkoutdialog.cpp tagdialog.cpp tagdialogbase.ui \
+ diffdialogbase.ui diffdialog.cpp releaseinputdialogbase.ui releaseinputdialog.cpp \
+ cvslogdialog.cpp cvslogpage.cpp cvsdiffpage.cpp diffwidget.cpp jobscheduler.cpp \
+ bufferedstringreader.cpp cvsfileinfoprovider.cpp cvsservicedcopIface.skel editorsdialogbase.ui \
+ editorsdialog.cpp annotatedialog.cpp annotatepage.cpp annotateview.cpp
+
+noinst_HEADERS = changelog.h checkoutdialog.h checkoutdialogbase.h commitdlg.h \
+ cvsentry.h cvsform.h cvsformbase.h cvsoptions.h cvsoptionswidget.h \
+ cvsoptionswidgetbase.h cvspart.h cvspartimpl.h cvsprocesswidget.h tagdialog.h tagdialogbase.h \
+ diffdialog.h cvsdir.h cvslogpage.h cvslogdialog.h jobscheduler.h diffwidget.h \
+ cvsfileinfoprovider.h cvsservicedcopIface.h bufferedstringreader.h editorsdialog.h \
+ editorsdialogbase.h annotatedialog.h annotatepage.h annotateview.h
+
+METASOURCES = AUTO
+
+ICONS = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevcvsservice.desktop
+
+servicepicsdir = $(kde_datadir)/kdevcvsservice/pics
+servicepics_DATA = kdev_cvs.png
+
+rcdir = $(kde_datadir)/kdevcvsservice
+rc_DATA = buildcvs.sh
+
+SUBDIRS = integrator
diff --git a/vcs/cvsservice/README b/vcs/cvsservice/README
new file mode 100644
index 00000000..0146b60f
--- /dev/null
+++ b/vcs/cvsservice/README
@@ -0,0 +1 @@
+Please read the README.dox file. \ No newline at end of file
diff --git a/vcs/cvsservice/README.dox b/vcs/cvsservice/README.dox
new file mode 100644
index 00000000..c89e9422
--- /dev/null
+++ b/vcs/cvsservice/README.dox
@@ -0,0 +1,82 @@
+/** \class CvsServicePart
+This plugin integrates Cervisia (version >= 2.1) cvsservice DCOP service into kdevelop (read FAQ at the bottom
+of this document): so, this part _does_ require cvsservice installed on your system: the configure script
+in the main source directory should automagically detect the presence of Cervisia and build this plugin.
+If Cervisia wasn't installed in $KDEDIR than you need to specify paths for lib and include
+files, for example:
+<code>
+ --with-extra-libs=$HOME/kde/lib --with-extra-includes=$HOME/kde/include
+</code>
+(where $HOME/kde is where I install my own kde stuff so I don't mess with working kde installation)
+
+<b>WARNING:</b> So, if you have already compiled kdevelop *without* cvsservice and have now
+installed cervisia to try this nice piece of software, you need to re-run configure so it
+can detect cervisia installation and enable compilation for vcs/cvsservice.
+
+<b>WARNING:</b> This plugin will quite surely change when the upcoming modifications in Cervisia's own
+architecture (separation of core and front-ends and user applications' library) are done (probably
+starting from kde >= 3.3). If you want to partecipate please join discussions on the cervisia@kde.org
+mailing list. Contributions are always welcome :-)
+
+<b>WARNING2:</b> If it doesn't compile try to update your cervisia installation.
+
+Implementation of this component is done by:
+ - class CvsServicePart, which does provide integration within kdevelop, set-up GUI
+ integration, forward cvs commands to the implementation (m_impl). It does also
+ intercepts signals like "new files added to project" and "... removed from ...".
+ - class CvsServicePartImpl implements the actual feature: more general speaking
+ functions (like checking for whether files are in repository, provide checks
+ on file lists, ...).
+ - class CvsProcessWidget provides output wrapping for commands (ok, it is useful
+ for debugging too ;-). It simply starts a DCOP job and awaits notification for
+ its termination.
+ - class CvsOptions* provide info about the user preferences when executing commands:
+ settings are stored in myprj.kdevses file, loaded when project is opened and
+ saved when project is closed.
+ - There is a bunch of dialog classes for collecting useful data about the operations
+ one wants to perform: exception to this are the cvslog* classes which do start
+ cvs jobs independently archiving parallelism with the CvsProcesssWidget.
+ - CVSDir and CVSEntry provide abstraction for accessing to local CVS information
+ - CVSFileInfoProvider is an implementation of KDevVCSFileInfoProvider interface
+ and collects data about files stats: for CVS, both synch (fetch data from local sandbox)
+ and asynch (fetch from repository server) are working with some minor bugs in the parsing
+ of 'cvs status' output for the latter. (Sync means that information are collected
+ from local CVS dirs which do not provide much information; async mean that a
+ "cvs status <dir-name>" request is launched, output parsed and information returned
+ to the client in _different_ times). Obviously this stuff requires the client
+ (actually only the FileTree viewer) to be aware of this feature (see parts/fileview for
+ additional info).
+
+\todo
+ - Fix the "cvs update" function which behave strangely for sub-directories of the main
+ project dir.
+ - (> 3.0) Replace the menu entries text with shorter ones
+ - Fix bugs on bugs.kde.org ;-)
+
+
+\authors <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\maintainer <a href="mailto:mario.scalas AT libero.it">Mario Scalas</a>
+
+\feature All that provided by parts/cvs
+\feature it is possible to 'add as binary' files to repository
+\feature checkout from remote repository ability added to the appwizard/importdlg
+\feature should handle :ext: repositories thanks to cvsservice
+\feature can tag / un-tag files
+\feature can revert and diff between specific releases
+\feature can do multiple diff from a common cvs log output text
+
+\bug bugs in <a href="http://bugs.kde.org/buglist.cgi?product=kdevelop&component=cvs%20part&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&order=Bug+Number">cvs part component at Bugzilla database</a>
+
+\requirement <a href="http://www.cvshome.org">CVS</a> >= 1.10.6
+\requirement Cervisia >= 2.1 (from kdesdk package included in <a href="http://www.kde.org">KDE</a> >= 3.2)
+
+\todo Test with SSH repositories!
+\todo Share a common outputview between VCS: CvsProcessWidget should be reworked :-/
+\todo Additional slots for more complex stuff as status, revert, patch creation, ...
+
+\faq <b>Does cvsservicepart support login with :pserver: or :ext: ?</b>
+ Well, I dunno ;-) I have no ssh repositories to test so feel free to provide feedback on the subject :-)
+ Update: Ok, it seems at least one user has tried :ext: reporting it to work (with ssh-agent avoiding some
+ typing headache ;-))
+*/
diff --git a/vcs/cvsservice/annotatedialog.cpp b/vcs/cvsservice/annotatedialog.cpp
new file mode 100644
index 00000000..08d0f24f
--- /dev/null
+++ b/vcs/cvsservice/annotatedialog.cpp
@@ -0,0 +1,68 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#include <qvbox.h>
+#include <qdir.h>
+#include <qstringlist.h>
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "annotatedialog.h"
+#include "annotatepage.h"
+
+AnnotateDialog::AnnotateDialog( CvsService_stub *cvsService, QWidget *parent, const char *name, int )
+ : KDialogBase( Tabbed, i18n("CVS Annotate Dialog"), Close, Close,
+ parent, name? name : "annotateformdialog", false /*modal*/, true /*separator*/ ),
+ m_cvsService( cvsService )
+{
+ setWFlags( getWFlags() | WDestructiveClose );
+
+ QVBox *vbox = addVBoxPage( i18n("Annotate") );
+ m_cvsAnnotatePage = new AnnotatePage( m_cvsService, vbox );
+
+ connect( m_cvsAnnotatePage, SIGNAL(requestAnnotate(const QString)),
+ this, SLOT(slotAnnotate(const QString)) );
+}
+
+AnnotateDialog::~AnnotateDialog()
+{
+ kdDebug(9006) << "AnnotateDialog::~AnnotateDialog()" << endl;
+}
+
+void AnnotateDialog::startFirstAnnotate( const QString pathName, const QString revision )
+{
+ kdDebug(9006) << "AnnotateDialog::startFirstAnnotate() pathName = " << pathName <<
+ "revision = " << revision << endl;
+
+ //save the filename for any later use
+ m_pathName = pathName;
+
+ m_cvsAnnotatePage->startAnnotate( pathName, revision );
+}
+
+void AnnotateDialog::slotAnnotate(const QString rev)
+{
+ kdDebug(9006) << "AnnotateDialog::slotAnnotate(QString) revision = " << rev << endl;
+
+ QVBox *vbox = addVBoxPage( i18n("Annotate")+" "+rev );
+ AnnotatePage * page = new AnnotatePage( m_cvsService, vbox );
+ page->startAnnotate(m_pathName, rev);
+
+ connect( page, SIGNAL(requestAnnotate(const QString)),
+ this, SLOT(slotAnnotate(const QString)) );
+}
+
+#include "annotatedialog.moc"
diff --git a/vcs/cvsservice/annotatedialog.h b/vcs/cvsservice/annotatedialog.h
new file mode 100644
index 00000000..7fea14f1
--- /dev/null
+++ b/vcs/cvsservice/annotatedialog.h
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#ifndef ANNOTATEDIALOG_H
+#define ANNOTATEDIALOG_H
+
+#include <kdialogbase.h>
+
+class CvsJob_stub;
+class CvsService_stub;
+class AnnotatePage;
+
+/**
+ * Implementation for the dialog displaying 'cvs annotate' output.
+ *
+ * This dialog hold a tab for each revision. The user just needs to
+ * click a line in the AnnotateView to get the annotate output for
+ * the selected revision.
+ *
+ * @author Robert Gruber <rgruber@users.sourceforge.net>
+ */
+class AnnotateDialog : public KDialogBase
+{
+ Q_OBJECT
+public:
+ AnnotateDialog( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~AnnotateDialog();
+
+ /**
+ * Entrypoint from outside.
+ * By calling this method, an annotate job is execuded for the given
+ * file and the specifed a revision.
+ * The output gets showen in the page which has already been created by the constructor.
+ *
+ * You need to call this function in order to set the file which you want to annotate.
+ * Any further operation will be execucted on the file specified by @param pathName
+ *
+ * @param pathName The file for which to run cvs annotate
+ */
+ void startFirstAnnotate( const QString pathName, const QString revision = "" );
+
+private slots:
+ /**
+ * This slot runs cvs annotate for the given revision.
+ * The output gets shown in a new page.
+ * @param rev The revision which will be annotated
+ */
+ void slotAnnotate(const QString rev);
+
+private:
+ QString m_pathName;
+
+ AnnotatePage *m_cvsAnnotatePage;
+ CvsService_stub *m_cvsService;
+};
+
+#endif
diff --git a/vcs/cvsservice/annotatepage.cpp b/vcs/cvsservice/annotatepage.cpp
new file mode 100644
index 00000000..fea16ece
--- /dev/null
+++ b/vcs/cvsservice/annotatepage.cpp
@@ -0,0 +1,257 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qstringlist.h>
+#include <qdatetime.h>
+#include <qlabel.h>
+
+#include <kmessagebox.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <krfcdate.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <kdialogbase.h>
+#include <kmessagebox.h>
+
+#include <dcopref.h>
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "annotatepage.h"
+#include "annotateview.h"
+
+AnnotatePage::AnnotatePage( CvsService_stub *cvsService, QWidget *parent, const char *name, int )
+ : DCOPObject( "CvsAnnotatePageDCOPIface" ),
+ QWidget( parent, name? name : "annotateformpage" ),
+ m_cvsService( cvsService ), m_cvsAnnotateJob( 0 )
+{
+ kdDebug(9006) << "AnnotatePage::AnnotatePage()" << endl;
+
+ QLayout *dialogLayout = new QVBoxLayout( this );
+
+ //First create the top-line where user can choose a revision
+ QWidget * LayoutWidget = new QWidget( this );
+ QHBoxLayout * AnnotateLayout = new QHBoxLayout( LayoutWidget );
+
+ QLabel * lblRevision = new QLabel( LayoutWidget );
+ AnnotateLayout->addWidget( lblRevision );
+ lblRevision->setText( tr( "Revision:" ) );
+
+ m_leRevision = new KLineEdit( LayoutWidget );
+ AnnotateLayout->addWidget( m_leRevision );
+
+ m_btnAnnotate = new KPushButton( LayoutWidget );
+ AnnotateLayout->addWidget( m_btnAnnotate );
+ m_btnAnnotate->setText( tr( "&Annotate" ) );
+ m_btnAnnotate->setAccel( QKeySequence( tr( "Alt+A" ) ) );
+
+ dialogLayout->add( LayoutWidget );
+
+ connect( m_btnAnnotate, SIGNAL(clicked()),
+ this, SLOT(slotNewAnnotate()) );
+ connect( m_leRevision, SIGNAL( returnPressed() ),
+ m_btnAnnotate, SLOT( setFocus() ) );
+
+ //Nest create the AnnotateView; it will do the actual displaying
+ m_annotateView = new AnnotateView(this, "annotateview");
+ dialogLayout->add( m_annotateView );
+}
+
+AnnotatePage::~AnnotatePage()
+{
+ kdDebug(9006) << "AnnotatePage::~Annotate()" << endl;
+ cancel();
+ delete m_cvsAnnotateJob;
+}
+
+void AnnotatePage::startAnnotate( const QString pathName, const QString revision )
+{
+ kdDebug(9006) << "AnnotatePage::startAnnotate() pathName = " << pathName <<
+ "revision = " << revision << endl;
+
+ m_leRevision->setText(revision);
+
+ m_pathName = pathName;
+
+ DCOPRef job = m_cvsService->annotate( pathName, revision );
+ m_cvsAnnotateJob = new CvsJob_stub( job.app(), job.obj() );
+
+ // establish connections to the signals of the cvs m_job
+ connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+
+ //clear both the outputbuffer and the AnnotateView
+ m_output = "";
+ ((KListView*)m_annotateView)->clear();
+
+ kdDebug(9006) << "Running: " << m_cvsAnnotateJob->cvsCommand() << endl;
+ m_cvsAnnotateJob->execute();
+}
+
+void AnnotatePage::slotJobExited( bool normalExit, int exitStatus )
+{
+ kdDebug(9006) << "AnnotatePage::slotJobExited(bool, int)" << endl;
+
+ if (!normalExit)
+ {
+ KMessageBox::sorry( this, i18n("Annotate failed with exitStatus == %1").arg( exitStatus), i18n("Annotate Failed") );
+ return;
+ }
+
+ //split the collected output and pass the lines to the parser function
+ QStringList lines = QStringList::split("\n", m_output);
+ parseAnnotateOutput(lines);
+}
+
+void AnnotatePage::slotReceivedOutput( QString someOutput )
+{
+ kdDebug(9006) << "AnnotatePage::slotReceivedOutput(QString)" << endl;
+ m_output += someOutput;
+}
+
+void AnnotatePage::slotReceivedErrors( QString )
+{
+ kdDebug(9006) << "AnnotatePage::slotReceivedErrors(QString)" << endl;
+}
+
+void AnnotatePage::cancel()
+{
+ if (m_cvsAnnotateJob && m_cvsAnnotateJob->isRunning())
+ m_cvsAnnotateJob->cancel();
+}
+
+void AnnotatePage::parseAnnotateOutput(QStringList& lines)
+{
+ kdDebug(9006) << "AnnotatePage::parseAnnotateOutput(QStringList)" << endl;
+
+ /**
+ * First we need to parse the output of "cvs log" which the dcop-interface delivers
+ * everytime annotate is requested.
+ * The QMap m_comments stores the revisions together with the matching comments.
+ * The comments will be passed to the AnnotateView in order to display them as QToolTip
+ */
+ QString line, comment, rev;
+
+ enum { Begin, Tags, Admin, Revision,
+ Author, Branches, Comment, Finished } state;
+
+ QStringList::Iterator it = lines.begin();
+ state = Begin;
+ do
+ {
+ line = *it;
+
+ switch( state )
+ {
+ case Begin:
+ if( line == "symbolic names:" )
+ state = Tags;
+ break;
+ case Tags:
+ if( line[0] != '\t' )
+ state = Admin;
+ break;
+ case Admin:
+ if( line == "----------------------------" )
+ state = Revision;
+ break;
+ case Revision:
+ rev = line.section(' ', 1, 1);
+ state = Author;
+ break;
+ case Author:
+ state = Branches;
+ break;
+ case Branches:
+ if( !line.startsWith("branches:") )
+ {
+ state = Comment;
+ comment = line;
+ }
+ break;
+ case Comment:
+ if( line == "----------------------------" )
+ state = Revision;
+ else if( line == "=============================================================================" )
+ state = Finished;
+ if( state == Comment )
+ comment += QString("\n") + line;
+ else
+ m_comments[rev] = comment;
+ break;
+ case Finished:
+ ;
+ }
+
+ if (state == Finished)
+ break;
+ } while( ++it != lines.end());
+
+ // move forward until we get to the actual output of "cvs annotate"
+ bool notEof = true;
+ while( notEof && !(*it).startsWith("*****") ) {
+ notEof = (++it != lines.end());
+ }
+
+ //if the upper loop hit the ent of the list, this can only mean, that
+ //the selected revision is unknown to CVS
+ if (!notEof) {
+ KMessageBox::error(this, i18n("The selected revision does not exist."));
+ ((KListView*)m_annotateView)->clear();
+ return;
+ }
+ ++it;
+
+ QString author, content;
+ QString oldRevision = ""; //we always store the last revision to recognice...
+ bool changeColor = false; //...when the AnnotateView needs to change the coloring
+ QDateTime logDate;
+
+ do
+ {
+ line = *it;
+
+ //the log date should be printed according to the user's global setting
+ //so we pass it as QDateTime to the AnnotateView below
+ QString dateString = line.mid(23, 9);
+ if( !dateString.isEmpty() )
+ logDate.setTime_t(KRFCDate::parseDate(dateString), Qt::UTC);
+
+ rev = line.left(13).stripWhiteSpace();
+ author = line.mid(14, 8).stripWhiteSpace();
+ content = line.mid(35, line.length()-35);
+
+ comment = m_comments[rev];
+ if( comment.isNull() )
+ comment = "";
+
+ if( rev != oldRevision )
+ {
+ oldRevision = rev;
+ changeColor = !changeColor;
+ }
+
+ //finished parsing the annotate line
+ //We pass the needed data to the AnnotateView
+ m_annotateView->addLine(rev, author, logDate, content, m_comments[rev], changeColor);
+ } while (++it != lines.end());
+}
+
+void AnnotatePage::slotNewAnnotate()
+{
+ startAnnotate(m_pathName, m_leRevision->text());
+}
+
+#include "annotatepage.moc"
diff --git a/vcs/cvsservice/annotatepage.h b/vcs/cvsservice/annotatepage.h
new file mode 100644
index 00000000..2a062804
--- /dev/null
+++ b/vcs/cvsservice/annotatepage.h
@@ -0,0 +1,125 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#ifndef ANNOTATEPAGE_H
+#define ANNOTATEPAGE_H
+
+#include "cvsservicedcopIface.h"
+#include <qwidget.h>
+#include <qmap.h>
+#include <qlistview.h>
+
+class CvsJob_stub;
+class CvsService_stub;
+class QTextBrowser;
+class AnnotateView;
+class QStringList;
+class KLineEdit;
+class KPushButton;
+
+/**
+ * Implementation for the page displaying 'cvs annotate' output.
+ * To the top of the page the user can enter a revision and request
+ * a annotate run for it.
+ * The main widget of a page is the AnnotateView. It holds the output
+ * of the cvs annotate job. See there for further detail.
+ *
+ * @author Robert Gruber <rgruber@users.sourceforge.net>
+ */
+class AnnotatePage : public QWidget, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+
+ friend class AnnotateDialog;
+ friend class AnnotateView;
+
+public:
+ AnnotatePage( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~AnnotatePage();
+
+ /**
+ * Call cvs annotate for the given file and revistion.
+ * @param pathName The filename to annotate
+ * @param revision The CVS revision number
+ */
+ void startAnnotate( const QString pathName, const QString revision="" );
+
+ /**
+ * Cancels the current operation if any
+ */
+ void cancel();
+
+signals:
+ /**
+ * This signal is ment to be emitted by the nested AnnotateView.
+ * The dialog that holds this page catches it in order to create
+ * a new page with the annotate output for the given revision.
+ * @param rev The revision for which a new annotate run is requested
+ */
+ void requestAnnotate(const QString rev);
+
+private slots:
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+ /**
+ * This slot is connected to the button next to m_leRevision.
+ * It clears the AnnotateView and reruns cvs annotate with the
+ * revision the user entered into m_leRevision
+ */
+ void slotNewAnnotate();
+
+private:
+ /**
+ * This method is executed after the cvs annotate job finished.
+ * It parses the output and passes it to the AnnotateView
+ */
+ void parseAnnotateOutput(QStringList& lines);
+
+
+ /**
+ * This is the output buffer for the cvs annotate job.
+ * Everytime slotReceivedOutput() is called by dcop
+ * we append the gained data to this buffer.
+ */
+ QString m_output;
+ /**
+ * This is the AnnotateView. It gets nested into this page.
+ */
+ AnnotateView *m_annotateView;
+ /**
+ * The file for which this page holds the annotate output.
+ */
+ QString m_pathName;
+ /**
+ * Maps the checkin comments to revision numbers
+ */
+ QMap<QString, QString> m_comments;
+
+ /**
+ * With this KLineEdit and the KPushButton next to it
+ * the user can rerun cvs annotate for any revision he
+ * enters into this KLineEdit.
+ */
+ KLineEdit *m_leRevision;
+ /**
+ * With this KPushButton the user can rerun cvs annotate
+ * for the revision he entered into m_leRevision
+ */
+ KPushButton *m_btnAnnotate;
+
+ CvsService_stub *m_cvsService;
+ CvsJob_stub *m_cvsAnnotateJob;
+};
+
+#endif
diff --git a/vcs/cvsservice/annotateview.cpp b/vcs/cvsservice/annotateview.cpp
new file mode 100644
index 00000000..93a2a46d
--- /dev/null
+++ b/vcs/cvsservice/annotateview.cpp
@@ -0,0 +1,221 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@users.sourceforge.net *
+ * *
+ * This file has been taken from cervisia an adapted to fit my needs: *
+ * Copyright (C) 1999-2002 Bernd Gehrmann <bernd@mail.berlios.de> *
+ * Copyright (c) 2003-2005 André Wöbbeking <Woebbeking@web.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 "annotateview.h"
+
+#include <qheader.h>
+#include <qdatetime.h>
+#include <qpainter.h>
+#include <kglobalsettings.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include "annotatepage.h"
+
+class AnnotateViewItem : public QListViewItem
+{
+ friend class AnnotateView;
+
+public:
+ enum { LineNumberColumn, AuthorColumn, DateColumn,ContentColumn };
+
+ AnnotateViewItem(AnnotateView *parent, QString rev, QString author,
+ QDateTime date, QString content, QString comment,
+ bool odd, int linenumber);
+
+ virtual int compare(QListViewItem *item, int col, bool ascending) const;
+ virtual int width(const QFontMetrics &, const QListView *, int col) const;
+ virtual QString text(int col) const;
+ virtual void paintCell(QPainter *, const QColorGroup &, int, int, int);
+
+private:
+ QString m_revision;
+ QString m_author;
+ QString m_content;
+ QString m_comment;
+ QDateTime m_logDate;
+ bool m_odd;
+ int m_lineNumber;
+
+ static const int BORDER;
+};
+
+
+const int AnnotateViewItem::BORDER = 4;
+
+
+AnnotateViewItem::AnnotateViewItem(AnnotateView *parent, QString rev,
+ QString author, QDateTime date, QString content, QString comment,
+ bool odd, int linenumber)
+ : QListViewItem(parent)
+ , m_revision(rev)
+ , m_author(author)
+ , m_content(content)
+ , m_comment(comment)
+ , m_logDate(date)
+ , m_odd(odd)
+ , m_lineNumber(linenumber)
+{}
+
+
+int AnnotateViewItem::compare(QListViewItem *item, int, bool) const
+{
+ int linenum1 = m_lineNumber;
+ int linenum2 = static_cast<AnnotateViewItem*>(item)->m_lineNumber;
+
+ return (linenum2 > linenum1)? -1 : (linenum2 < linenum1)? 1 : 0;
+}
+
+
+QString AnnotateViewItem::text(int col) const
+{
+ switch (col)
+ {
+ case LineNumberColumn:
+ return QString::number(m_lineNumber);
+ case AuthorColumn:
+ return (m_revision + QChar(' ') + m_author);
+ case DateColumn:
+ return KGlobal::locale()->formatDate(m_logDate.date(), true);
+ case ContentColumn:
+ return m_content;
+ default:
+ ;
+ };
+
+ return QString::null;
+}
+
+
+void AnnotateViewItem::paintCell(QPainter *p, const QColorGroup &, int col, int width, int align)
+{
+ QColor backgroundColor;
+
+ switch (col)
+ {
+ case LineNumberColumn:
+ backgroundColor = KGlobalSettings::highlightColor();
+ p->setPen(KGlobalSettings::highlightedTextColor());
+ break;
+ default:
+ backgroundColor = m_odd ? KGlobalSettings::baseColor()
+ : KGlobalSettings::alternateBackgroundColor();
+ p->setPen(KGlobalSettings::textColor());
+ break;
+ };
+
+ p->fillRect(0, 0, width, height(), backgroundColor);
+
+ QString str = text(col);
+ if (str.isEmpty())
+ return;
+
+ if (align & (AlignTop || AlignBottom) == 0)
+ align |= AlignVCenter;
+
+ p->drawText(BORDER, 0, width - 2*BORDER, height(), align, str);
+}
+
+
+int AnnotateViewItem::width(const QFontMetrics &fm, const QListView *, int col) const
+{
+ return fm.width(text(col)) + 2*BORDER;
+}
+
+
+/******************************************************************************/
+/*****************Definition of class AnnotateView ****************************/
+/******************************************************************************/
+
+AnnotateView::AnnotateView(AnnotatePage *parent, const char *name)
+ : KListView(parent, name), QToolTip( viewport() ),
+ m_page(parent)
+{
+ setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ setAllColumnsShowFocus(true);
+ setShowToolTips(false);
+ header()->hide();
+
+ addColumn(QString::null);
+ addColumn(QString::null);
+ addColumn(QString::null);
+ addColumn(QString::null);
+
+ setSorting(AnnotateViewItem::LineNumberColumn);
+ setColumnAlignment(AnnotateViewItem::LineNumberColumn, Qt::AlignRight);
+
+ connect( this, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(itemClicked(QListViewItem*)) );
+}
+
+
+void AnnotateView::addLine(QString rev, QString author, QDateTime date,
+ QString content, QString comment, bool odd)
+{
+ new AnnotateViewItem(this, rev, author, date, content, comment,
+ odd, childCount()+1);
+}
+
+
+QSize AnnotateView::sizeHint() const
+{
+ QFontMetrics fm(fontMetrics());
+ return QSize(100 * fm.width("0"), 20 * fm.lineSpacing());
+}
+
+
+void AnnotateView::maybeTip( const QPoint & p )
+{
+ AnnotateViewItem * item = dynamic_cast<AnnotateViewItem*>( itemAt( p ) );
+ if (!item)
+ return;
+
+ const int column(header()->sectionAt(p.x()));
+ if (column != AnnotateViewItem::AuthorColumn &&
+ column != AnnotateViewItem::DateColumn) {
+ return;
+ }
+
+ QRect r = itemRect( item );
+ //get the dimension of the author + the date column
+ QRect headerRect = header()->sectionRect(AnnotateViewItem::AuthorColumn);
+ headerRect = headerRect.unite(header()->sectionRect(AnnotateViewItem::DateColumn));
+
+ r.setLeft(headerRect.left());
+ r.setWidth(headerRect.width());
+
+ if (r.isValid())
+ {
+ tip( r, "<nobr><b>"+item->text(AnnotateViewItem::AuthorColumn)+"</b></nobr><br>"
+ "<nobr>"+item->text(AnnotateViewItem::DateColumn)+"</nobr>"
+ "<pre>"+item->m_comment+"</pre>");
+ }
+}
+
+void AnnotateView::itemClicked(QListViewItem *item)
+{
+ kdDebug(9006) << "itemClicked()" << endl;
+
+ AnnotateViewItem * line = dynamic_cast<AnnotateViewItem*>(item);
+ if (line) {
+ kdDebug(9006) << "requesting annotate for revision " << line->m_revision << endl;
+ emit m_page->requestAnnotate(line->m_revision);
+ } else {
+ kdDebug(9006) << "This is not an AnnotateViewItem" << endl;
+ }
+}
+
+#include "annotateview.moc"
diff --git a/vcs/cvsservice/annotateview.h b/vcs/cvsservice/annotateview.h
new file mode 100644
index 00000000..6c9cded9
--- /dev/null
+++ b/vcs/cvsservice/annotateview.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2005 by Robert Gruber *
+ * rgruber@users.sourceforge.net *
+ * *
+ * This file has been taken from cervisia an adapted to fit my needs: *
+ * Copyright (C) 1999-2002 Bernd Gehrmann <bernd@mail.berlios.de> *
+ * Copyright (c) 2003-2005 André Wöbbeking <Woebbeking@web.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 ANNOTATEVIEW_H
+#define ANNOTATEVIEW_H
+
+
+#include <klistview.h>
+#include <qtooltip.h>
+
+class QDateTime;
+class AnnotatePage;
+
+/**
+ * This is the main widget of each page.
+ * It shows the user the output of cvs annotate.
+ * The user can click any line of this view in order
+ * to get a new page which shows the annotate output
+ * of the clicked revision.
+ */
+class AnnotateView : public KListView, public QToolTip
+{
+ Q_OBJECT
+
+public:
+
+ explicit AnnotateView(AnnotatePage *parent, const char *name=0 );
+
+ void addLine(QString rev, QString author, QDateTime date, QString content,
+ QString comment, bool odd);
+
+ virtual QSize sizeHint() const;
+ void maybeTip( const QPoint & p );
+
+private:
+ AnnotatePage * m_page;
+
+public slots:
+ void itemClicked(QListViewItem *item);
+};
+
+
+#endif
diff --git a/vcs/cvsservice/bufferedstringreader.cpp b/vcs/cvsservice/bufferedstringreader.cpp
new file mode 100644
index 00000000..5c2151fc
--- /dev/null
+++ b/vcs/cvsservice/bufferedstringreader.cpp
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "bufferedstringreader.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsOptions
+///////////////////////////////////////////////////////////////////////////////
+
+BufferedStringReader::BufferedStringReader()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+BufferedStringReader::~BufferedStringReader()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList BufferedStringReader::process( const QString &otherChars )
+{
+ // Add to previous buffered chars
+ m_stringBuffer += otherChars;
+ QStringList strings;
+ // Now find all the basic strings in the buffer
+ int pos;
+ while ( (pos = m_stringBuffer.find('\n')) != -1)
+ {
+ QString line = m_stringBuffer.left( pos );
+ if (!line.isEmpty())
+ {
+ strings.append( line );
+ }
+ m_stringBuffer = m_stringBuffer.right( m_stringBuffer.length() - pos - 1 );
+ }
+ return strings;
+}
diff --git a/vcs/cvsservice/bufferedstringreader.h b/vcs/cvsservice/bufferedstringreader.h
new file mode 100644
index 00000000..1f96c0d1
--- /dev/null
+++ b/vcs/cvsservice/bufferedstringreader.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef BUFFEREDSTRINGREADER_H
+#define BUFFEREDSTRINGREADER_H
+
+#include <qstringlist.h>
+
+class CvsServicePart;
+class KConfig;
+class KDevProject;
+
+/* This class helps when we have to collect a string list from a text
+ * stream, just as many cvs commands do. The problem is that the these commands
+ * does not provide strings as we need: often a sent string is received
+ * broken in two pieces and so we need a way to rebuild it. This class provide an
+ * abstraction for avoiding this.
+ * @author Mario Scalas <mario.scalas@libero.it>
+*/
+class BufferedStringReader
+{
+public:
+ BufferedStringReader();
+ virtual ~BufferedStringReader();
+
+ /**
+ * Add the specified characters to current buffered ones and grab
+ * as many '\n'-terminated strings as found.
+ * @param otherChars additional chars to be added to the buffer
+ */
+ QStringList process( const QString &otherChars );
+private:
+ QString m_stringBuffer;
+};
+
+#endif // BUFFEREDSTRINGREADER_H
diff --git a/vcs/cvsservice/buildcvs.sh b/vcs/cvsservice/buildcvs.sh
new file mode 100644
index 00000000..9c7c95c4
--- /dev/null
+++ b/vcs/cvsservice/buildcvs.sh
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# 3 arguments :
+# - relative path to the local directory (e.g. ".")
+# - module name (e.g. "plop")
+# - root repository (e.g. ":ext:me@host:/path/to/cvsroot")
+
+mkcvs() {
+ rm -rf $1/CVS
+ mkdir -p $1/CVS
+
+ echo $2 > $1/CVS/Repository
+ echo $3 > $1/CVS/Root
+
+ for i in $1/*; do
+ if [ -d $i -a $i != $1/CVS ]; then
+ echo "D/"`basename $i`"////" >> $1/CVS/Entries
+ mkcvs "$i" "$2/"`basename $i` $3
+ elif [ -f $i ]; then
+ echo "/"`basename $i`"/1.1.1.1/"`date +"%a %b %d %T %Y//"` >> $1/CVS/Entries
+ fi
+ done
+}
+
+mkcvs $1 $2 $3
diff --git a/vcs/cvsservice/changelog.cpp b/vcs/cvsservice/changelog.cpp
new file mode 100644
index 00000000..a63a2b92
--- /dev/null
+++ b/vcs/cvsservice/changelog.cpp
@@ -0,0 +1,114 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qdatetime.h>
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include <kemailsettings.h>
+
+#include "changelog.h"
+
+ChangeLogEntry::ChangeLogEntry()
+{
+ KEMailSettings emailConfig;
+ emailConfig.setProfile( emailConfig.defaultProfileName() );
+ authorEmail = emailConfig.getSetting( KEMailSettings::EmailAddress );
+ authorName = emailConfig.getSetting( KEMailSettings::RealName );
+
+ QDate currDate = QDate::currentDate();
+ date = currDate.toString( "yyyy-MM-dd" );
+}
+
+ChangeLogEntry::~ChangeLogEntry()
+{
+}
+
+void ChangeLogEntry::addLine( const QString &aLine )
+{
+ lines << aLine;
+}
+
+void ChangeLogEntry::addLines( const QStringList &someLines )
+{
+ lines += someLines;
+}
+
+void streamCopy( QTextStream &is, QTextStream &os )
+{
+ while (!is.eof())
+ os << is.readLine() << "\n"; // readLine() eats '\n' !!
+}
+
+void ChangeLogEntry::addToLog( const QString &logFilePath, const bool prepend, const QString &startLineString )
+{
+ if (prepend) // add on head
+ {
+ QString fakeLogFilePath = logFilePath + ".fake";
+
+ QFile fakeFile( fakeLogFilePath );
+ QFile changeLogFile( logFilePath );
+ {
+ if (!fakeFile.open( IO_WriteOnly | IO_Append))
+ return;
+
+ if (changeLogFile.open( IO_ReadOnly )) // A Changelog already exist
+ {
+ QTextStream is( &changeLogFile );
+ QTextStream os( &fakeFile );
+
+ // Put current entry
+ os << toString( startLineString );
+ // Write the rest of the change log file
+ streamCopy( is, os );
+ }
+ else // ChangeLog doesn't exist: just write our entry
+ {
+ QTextStream t( &fakeFile );
+ t << toString( startLineString );
+ }
+ fakeFile.close();
+ changeLogFile.close();
+ }
+ // Ok, now we have the change log we need in fakeLogFilePath: we should ask for a
+ // 'mv fakeLogFilePath logFilePath'-like command ... :-/
+ if (!fakeFile.open( IO_ReadOnly ))
+ return;
+
+ if (changeLogFile.open( IO_WriteOnly ))
+ {
+ QTextStream os( &changeLogFile );
+ QTextStream is( &fakeFile );
+
+ // Write the rest of the change log file
+ streamCopy( is, os );
+ }
+ fakeFile.close();
+ fakeFile.remove(); // fake changelog is no more needed!
+ changeLogFile.close();
+ }
+ else // add on tail
+ {
+ QFile f( logFilePath );
+ if (!f.open( IO_WriteOnly | IO_Append))
+ return;
+
+ QTextStream t( &f );
+ t << toString( startLineString );
+ }
+}
+
+QString ChangeLogEntry::toString( const QString &startLineString ) const
+{
+ QString header = date + " " + authorName + " <" + authorEmail + ">\n";
+
+ return header + startLineString + lines.join( "\n" + startLineString ) + "\n\n";
+}
diff --git a/vcs/cvsservice/changelog.h b/vcs/cvsservice/changelog.h
new file mode 100644
index 00000000..3d512f95
--- /dev/null
+++ b/vcs/cvsservice/changelog.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CHANGELOG_H
+#define CHANGELOG_H
+
+#include <qstringlist.h>
+
+/**
+A class which abstracts the building of an entry in the ChangeLog file (it formats name, e-mail and text).
+
+@author Mario Scalas
+*/
+struct ChangeLogEntry
+{
+public:
+ ChangeLogEntry();
+ ~ChangeLogEntry();
+
+ //! Add a single line to the lines for this entry
+ void addLine( const QString &aLine );
+ //! Add a bunch of lines for this entry
+ void addLines( const QStringList &someLines );
+ //! Pretty format for this entry: you may insert a line tag (such as tab ("\t") or 4 spaces (" ")
+ //! or whatever you want (such as "\t * ")
+ QString toString( const QString &startLineString = QString::null ) const;
+ //! Once the entry is completed one would like to write on a file! (You may add on start of file
+ //! prepend == true, or append on tail (prepend == false)
+ void addToLog( const QString &logFilePath, const bool prepend = true, const QString &startLineString = "\t" );
+
+ QString authorName,
+ authorEmail,
+ date;
+ QStringList lines;
+};
+
+#endif
diff --git a/vcs/cvsservice/checkoutdialog.cpp b/vcs/cvsservice/checkoutdialog.cpp
new file mode 100644
index 00000000..7fb9455c
--- /dev/null
+++ b/vcs/cvsservice/checkoutdialog.cpp
@@ -0,0 +1,276 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qcheckbox.h>
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include <klistview.h>
+#include <kurlrequester.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kfiledialog.h>
+#include <kcursor.h>
+#include <kdebug.h>
+#include <kapplication.h>
+#include <klineedit.h>
+
+#include <dcopref.h>
+#include <cvsjob_stub.h>
+#include <repository_stub.h>
+#include <cvsservice_stub.h>
+
+#include "checkoutdialogbase.h"
+
+#include "checkoutdialog.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// Constants
+///////////////////////////////////////////////////////////////////////////////
+
+const QString SSS( ":" ); // Server String Separator :)
+
+///////////////////////////////////////////////////////////////////////////////
+// class ModuleListViewItem
+///////////////////////////////////////////////////////////////////////////////
+
+class ModuleListViewItem : public KListViewItem
+{
+public:
+ ModuleListViewItem( KListView *listview,
+ const QString &moduleAlias, const QString &moduleRealPath )
+ : KListViewItem( listview )
+ {
+ setAlias( moduleAlias );
+ setRealPath( moduleRealPath );
+ }
+
+ void setAlias( const QString &aName ) { setText( 0, aName); }
+ QString alias() const { return text(0); }
+ void setRealPath( const QString &aRealPath ) { setText(1, aRealPath); }
+ QString realPath() const { return text(1); }
+
+// virtual QString text() const { return name(); }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// class CheckoutDialog
+///////////////////////////////////////////////////////////////////////////////
+
+CheckoutDialog::CheckoutDialog( CvsService_stub *cvsService,
+ QWidget *parent, const char *name, WFlags ) :
+ DCOPObject( "CheckoutDialogDCOPIface" ),
+ KDialogBase( parent, name? name : "checkoutdialog", true, i18n("CVS Checkout"),
+ Ok | Cancel, Ok, true ),
+ m_service( cvsService ), m_job( 0 )
+{
+ m_base = new CheckoutDialogBase( this, "checkoutdialogbase" );
+ setMainWidget( m_base );
+
+ connect( m_base->fetchModulesButton, SIGNAL(clicked()),
+ this, SLOT(slotFetchModulesList()) );
+ connect( m_base->modulesListView, SIGNAL(executed(QListViewItem*)),
+ this, SLOT(slotModuleSelected(QListViewItem*)) );
+
+ // Avoid displaying 'file:/' when displaying the file
+ m_base->workURLRequester->setShowLocalProtocol( false );
+ m_base->workURLRequester->setMode( KFile::Directory );
+
+ // Grab the entries from $HOME/.cvspass
+ fetchUserCvsRepositories();
+ // And suggest to use the default projects dir set in KDevelop's preferences
+ KConfig *config = kapp->config();
+ config->setGroup("General Options");
+ QString defaultProjectsDir = config->readPathEntry("DefaultProjectsDir", QDir::homeDirPath()+"/");
+ setWorkDir( defaultProjectsDir );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CheckoutDialog::~CheckoutDialog()
+{
+ delete m_job;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CheckoutDialog::serverPath() const
+{
+ return m_base->serverPaths->currentText();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::fillServerPaths( const QStringList &serverPaths )
+{
+ m_base->serverPaths->insertStringList( serverPaths );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CheckoutDialog::workDir() const
+{
+ return m_base->workURLRequester->url();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::setWorkDir( const QString &aDir )
+{
+ m_base->workURLRequester->setURL( aDir );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CheckoutDialog::pruneDirs() const
+{
+ return m_base->pruneDirsCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CheckoutDialog::tag() const
+{
+ return m_base->tagEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CheckoutDialog::module() const
+{
+ return m_base->moduleEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::slotFetchModulesList()
+{
+ setCursor( KCursor::waitCursor() );
+
+ if (serverPath().isEmpty() || workDir().isEmpty())
+ return;
+
+ DCOPRef job = m_service->moduleList( serverPath() );
+ if (!m_service->ok())
+ return;
+
+ m_job = new CvsJob_stub( job.app(), job.obj() );
+ // We only need to know when it finishes and then will grab the output
+ // by using m_job->output() :-)
+ connectDCOPSignal( job.app(), job.obj(), "jobFinished(bool,int)", "slotJobExited(bool,int)", true );
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "receivedOutput(QString)", true );
+
+ kdDebug() << "Running: " << m_job->cvsCommand() << endl;
+ m_job->execute();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::slotJobExited( bool /*normalExit*/, int /*exitStatus*/ )
+{
+ kdDebug(9006) << "CheckoutDialog::slotModulesListFetched() here!" << endl;
+
+ kdDebug(9006) << "Received: " << m_job->output().join( "\n" ) << endl;
+
+// m_base->modulesListView->insertStringList( m_job->output() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::slotReceivedOutput( QString someOutput )
+{
+ kdDebug( 9006 ) << " Received output: " << someOutput << endl;
+
+ setCursor( KCursor::arrowCursor() );
+
+ // Fill the modules KListView if the list obtained is not empty
+ // QStringList modules = m_job->output();
+ QStringList modules = QStringList::split( "\n", someOutput );
+ if (modules.count() <= 0)
+ return;
+
+ QStringList::iterator it = modules.begin();
+ for ( ; it != modules.end(); ++it )
+ {
+ QStringList l = QStringList::split( " ", (*it) );
+ // Now, l[0] is the module name, l[1] is ... another string ;-)
+ new ModuleListViewItem( m_base->modulesListView, l[0], l[1] );
+ }
+}
+
+void CheckoutDialog::slotReceivedErrors( QString someErrors )
+{
+ kdDebug( 9006 ) << " Received errors: " << someErrors << endl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::slotModuleSelected( QListViewItem * )
+{
+ ModuleListViewItem *aModuleItem = static_cast<ModuleListViewItem*>(
+ m_base->modulesListView->selectedItem()
+ );
+ if (!aModuleItem)
+ return;
+
+ m_base->moduleEdit->setText( aModuleItem->alias() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::fetchUserCvsRepositories()
+{
+ QStringList repositories;
+
+ QFile cvspass( QDir::homeDirPath() + QDir::separator() + ".cvspass" );
+ if (!cvspass.open( IO_ReadOnly ))
+ return;
+ QByteArray data = cvspass.readAll();
+ cvspass.close();
+
+ QTextIStream istream( data );
+ // Entries are like:
+ // /1 :pserver:marios@cvs.kde.org:2401/home/kde Ahz:UIK?=d ?
+ // /1 :pserver:mario@xamel:2401/home/cvsroot aJT_d'K?=d ?
+ while (!istream.eof()) {
+ QString line = istream.readLine();
+ QStringList lineElements = QStringList::split( " ", line );
+ if (lineElements.count() > 1) {
+ repositories << lineElements[ 1 ];
+ }
+ }
+
+ fillServerPaths( repositories );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CheckoutDialog::slotOk()
+{
+ QString errorMessage = QString::null;
+
+ if (!(workDir().length() > 0) && QFile::exists( workDir() ))
+ errorMessage = i18n( "Please, choose a valid working directory" );
+ else if (!(serverPath().length() > 0))
+ errorMessage = i18n( "Please, choose a CVS server." );
+ else if (!(module().length() > 0))
+ errorMessage = i18n( "Please, fill the CVS module field." );
+
+ if (errorMessage.isNull())
+ KDialogBase::slotOk();
+ else
+ KMessageBox::error( this, errorMessage );
+}
+
+
+#include "checkoutdialog.moc"
diff --git a/vcs/cvsservice/checkoutdialog.h b/vcs/cvsservice/checkoutdialog.h
new file mode 100644
index 00000000..597a806a
--- /dev/null
+++ b/vcs/cvsservice/checkoutdialog.h
@@ -0,0 +1,90 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CHECKOUTDIALOG_H
+#define CHECKOUTDIALOG_H
+
+#include <kdialogbase.h>
+#include "cvsservicedcopIface.h"
+
+class CvsService_stub;
+class CvsJob_stub;
+class CheckoutDialogBase;
+class QListViewItem;
+//class QStringList;
+
+/**
+* This dialog widget will collect all useful informazion about the module the
+* user want to to check-out from a remote repository.
+*
+* @author Mario Scalas
+*/
+class CheckoutDialog : public KDialogBase, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+public:
+ CheckoutDialog( CvsService_stub *cvsService, QWidget *parent = 0,
+ const char *name = 0, WFlags f = 0 );
+ virtual ~CheckoutDialog();
+
+ virtual void slotOk();
+
+ /**
+ * @return a server path string (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ */
+ QString serverPath() const;
+ /**
+ * @param serverPaths a list of server location to use when filling the widget
+ */
+ void fillServerPaths( const QStringList &serverPaths );
+ /**
+ * @return the directory which the user has fetched the module in
+ */
+ QString workDir() const;
+ /**
+ * @param aDir directory which fetched modules will be put in (ending with '/')
+ */
+ void setWorkDir( const QString &aDir );
+ /**
+ * @return the module the user has chosen to check-out from repository
+ */
+ QString module() const;
+ /**
+ * @return
+ */
+ bool pruneDirs() const;
+ /**
+ * @return
+ */
+ QString tag() const;
+
+private slots:
+ void slotModuleSelected( QListViewItem *item );
+ void slotFetchModulesList();
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+private:
+ /**
+ * Retrives the known servers from $HOME/.cvspass file
+ * @return a list of server locations (:pserver:user@server.somewhere:/cvsroot)
+ */
+ void fetchUserCvsRepositories();
+
+ CvsService_stub *m_service;
+ CvsJob_stub *m_job;
+
+ CheckoutDialogBase *m_base;
+};
+
+#endif
diff --git a/vcs/cvsservice/checkoutdialogbase.ui b/vcs/cvsservice/checkoutdialogbase.ui
new file mode 100644
index 00000000..f0ebdf8d
--- /dev/null
+++ b/vcs/cvsservice/checkoutdialogbase.ui
@@ -0,0 +1,312 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CheckoutDialogBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CheckoutDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>671</width>
+ <height>538</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>CVS Server Configuration</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Configuration</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>&amp;Local destination directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>workURLRequester</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>workURLRequester</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>serverPaths</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Server path (e.g. :pserver:marios@cvs.kde.org:/home/kde):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>serverPaths</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Select Module</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="1" column="1">
+ <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>156</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Module:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>moduleEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="2">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Tag/branch:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>tagEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="2">
+ <property name="name">
+ <cstring>tagEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>moduleEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>pruneDirsCheck</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Prune directories</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Creates subdirs if needed</string>
+ </property>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>Module</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Real Path</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>modulesListView</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>421</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>fetchModulesButton</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Fetch Modules List</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Fetch modules list from server</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Click to fetch modules list from server you specified</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>workURLRequester</tabstop>
+ <tabstop>serverPaths</tabstop>
+ <tabstop>moduleEdit</tabstop>
+ <tabstop>tagEdit</tabstop>
+ <tabstop>modulesListView</tabstop>
+ <tabstop>pruneDirsCheck</tabstop>
+ <tabstop>fetchModulesButton</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/cvsservice/commitdialogbase.ui b/vcs/cvsservice/commitdialogbase.ui
new file mode 100644
index 00000000..90e8f7b4
--- /dev/null
+++ b/vcs/cvsservice/commitdialogbase.ui
@@ -0,0 +1,161 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>CommitDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CommitDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>531</width>
+ <height>385</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Commit to Repository</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Message</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextEdit">
+ <property name="name">
+ <cstring>textEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>checkAddToChangelog</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Add to changelog:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>changeLogNameEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Change log filename path (relative to project directory)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Changelog filename path&lt;/b&gt;&lt;br/&gt;Insert here the Changelog filename you wish to use so that the message is appended</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>350</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>CommitDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>checkAddToChangelog</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>changeLogNameEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/commitdlg.cpp b/vcs/cvsservice/commitdlg.cpp
new file mode 100644
index 00000000..4c7eac97
--- /dev/null
+++ b/vcs/cvsservice/commitdlg.cpp
@@ -0,0 +1,92 @@
+/***************************************************************************
+ * Copyright (C) 1999, 2000 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+#include <qtextedit.h>
+#include <qpushbutton.h>
+
+#include <kapplication.h>
+#include <kbuttonbox.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <klineedit.h>
+
+#include "commitdlg.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CommitDialog
+///////////////////////////////////////////////////////////////////////////////
+
+
+CommitDialog::CommitDialog( const QString &changeLogfileNamePath, QWidget *parent )
+ : CommitDialogBase( parent, "commitdialog", true )
+{
+ connect( buttonOk, SIGNAL(clicked()), SLOT(accept()) );
+ connect( buttonCancel, SIGNAL(clicked()), SLOT(reject()) );
+
+ setChangeLogFileName( changeLogfileNamePath );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList CommitDialog::logMessage() const
+{
+ QStringList textLines;
+ for (int i=0; i<textEdit->paragraphs(); ++i)
+ {
+ textLines << textEdit->text( i );
+ }
+ return textLines;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CommitDialog::mustAddToChangeLog() const
+{
+ return checkAddToChangelog->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CommitDialog::accept()
+{
+ if (textEdit->text().isNull() || textEdit->text().isEmpty()) {
+ int s = KMessageBox::warningContinueCancel( this,
+ i18n("You are committing your changes without any comment. This is not a good practice. Continue anyway?"),
+ i18n("CVS Commit Warning"),
+ KStdGuiItem::cont(),
+ i18n("askWhenCommittingEmptyLogs") );
+ if ( s != KMessageBox::Continue ) {
+ return;
+ }
+ }
+ QDialog::accept();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CommitDialog::setChangeLogFileName( const QString &fileName )
+{
+ changeLogNameEdit->setText( fileName );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CommitDialog::changeLogFileName() const
+{
+ return changeLogNameEdit->text();
+}
+
+#include "commitdlg.moc"
diff --git a/vcs/cvsservice/commitdlg.h b/vcs/cvsservice/commitdlg.h
new file mode 100644
index 00000000..3e98b269
--- /dev/null
+++ b/vcs/cvsservice/commitdlg.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 1999, 2000 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _COMMITDIALOG_H_
+#define _COMMITDIALOG_H_
+
+//#include <qdialog.h>
+#include <qstringlist.h>
+#include "commitdialogbase.h"
+
+class QTextEdit;
+class QCheckBox;
+
+class CommitDialog : public CommitDialogBase
+{
+ Q_OBJECT
+public:
+ CommitDialog( const QString &changeLogfileNamePath, QWidget *parent = 0 );
+
+ //! Returns the text of the log
+ QStringList logMessage() const;
+ //! Returns true if the user requests the log message to be added to the general
+ //! Changelog file
+ bool mustAddToChangeLog() const;
+
+ //! We need to set it when showing the dialog and then when saving the file
+ void setChangeLogFileName( const QString &fileName );
+ QString changeLogFileName() const;
+
+protected slots:
+ //! Override: must check for message not being void.
+ virtual void accept();
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsdiffpage.cpp b/vcs/cvsservice/cvsdiffpage.cpp
new file mode 100644
index 00000000..12947b36
--- /dev/null
+++ b/vcs/cvsservice/cvsdiffpage.cpp
@@ -0,0 +1,134 @@
+/***************************************************************************
+ * Copyright (C) 200?-2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qtextedit.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qdir.h>
+#include <qstringlist.h>
+
+#include <kmessagebox.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "cvsoptions.h"
+#include "cvsdiffpage.h"
+
+#include "diffwidget.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSDiffPage
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDiffPage::CVSDiffPage( CvsService_stub *cvsService,
+ QWidget *parent, const char *name, int )
+ // Leaving it anonymous let us to have multiple objects at the same time!
+ : DCOPObject(), // "CVSDiffPageDCOPIface"
+ QWidget( parent, name? name : "logformdialog" ),
+ m_diffText( 0 ), m_cvsService( cvsService ), m_cvsDiffJob( 0 )
+{
+ QLayout *thisLayout = new QVBoxLayout( this );
+ // This should be replaced by the diff part
+// m_diffText = new QTextEdit( this, "difftextedit" );
+// m_diffText->setReadOnly( true );
+ m_diffText = new DiffWidget( this, "difftextedit" );
+
+ thisLayout->add( m_diffText );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDiffPage::~CVSDiffPage()
+{
+ kdDebug(9006) << "CVSDiffPage::~CVSDiffPage()" << endl;
+ cancel();
+ delete m_cvsDiffJob;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDiffPage::startDiff( const QString &fileName, const QString &v1, const QString &v2 )
+{
+ kdDebug(9006) << "CVSDiffPage::startDiff()" << endl;
+
+ if ( v1.isEmpty() || v2.isEmpty() )
+ {
+ KMessageBox::error( this, i18n("Error: passed revisions are empty!"), i18n( "Error During Diff") );
+ return;
+ }
+
+ CvsOptions *options = CvsOptions::instance();
+ DCOPRef job = m_cvsService->diff( fileName, v1, v2, options->diffOptions(), options->contextLines() );
+ m_cvsDiffJob = new CvsJob_stub( job.app(), job.obj() );
+
+ kdDebug(9006) << "Running command : " << m_cvsDiffJob->cvsCommand() << endl;
+ connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+ bool success = m_cvsDiffJob->execute();
+ if (!success)
+ {
+ kdDebug(9006) << "Argh ... cannot start the diff job!" << endl;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDiffPage::slotJobExited( bool normalExit, int /*exitStatus*/ )
+{
+ kdDebug(9006) << "CVSDiffPage::slotJobExited(bool, int)" << endl;
+
+ if (normalExit)
+ {
+ QString diffText = m_cvsDiffJob->output().join( "\n" );
+ kdDebug(9006) << "*** Received: " << diffText << endl;
+// m_diffText->setText( diffText );
+ m_diffText->setDiff( m_diffString );
+ }
+ else
+ {
+ KMessageBox::error( this, i18n("An error occurred during diffing."), i18n( "Error During Diff"));
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDiffPage::slotReceivedOutput( QString someOutput )
+{
+ kdDebug(9006) << "CVSDiffPage::slotReceivedOutput(QString)" << endl;
+ kdDebug(9006) << "OUTPUT: " << someOutput << endl;
+
+ QStringList strings = m_outputBuffer.process(someOutput);
+ m_diffString += strings.join("\n");
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDiffPage::slotReceivedErrors( QString someErrors )
+{
+ kdDebug(9006) << "CVSDiffPage::slotReceivedErrors(QString)" << endl;
+ kdDebug(9006) << "ERRORS: " << someErrors << endl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDiffPage::cancel()
+{
+ if (m_cvsDiffJob && m_cvsDiffJob->isRunning())
+ m_cvsDiffJob->cancel();
+}
+
+#include "cvsdiffpage.moc"
+
+
diff --git a/vcs/cvsservice/cvsdiffpage.h b/vcs/cvsservice/cvsdiffpage.h
new file mode 100644
index 00000000..16a6fec6
--- /dev/null
+++ b/vcs/cvsservice/cvsdiffpage.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSDIFFPAGE_H
+#define CVSDIFFPAGE_H
+
+#include "cvsservicedcopIface.h"
+#include <qwidget.h>
+#include "bufferedstringreader.h"
+
+class CvsJob_stub;
+class CvsService_stub;
+class QTextEdit;
+class DiffWidget;
+
+/**
+Implementation for the form displaying 'cvs diff' output.
+
+@author KDevelop Authors
+*/
+class CVSDiffPage : public QWidget, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+public:
+ CVSDiffPage( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~CVSDiffPage();
+
+ void startDiff( const QString &fileName, const QString &v1, const QString &v2 );
+ void cancel();
+
+//private slots:
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+private:
+ //QTextEdit *m_diffText;
+ DiffWidget *m_diffText;
+ BufferedStringReader m_outputBuffer;
+ QString m_diffString;
+
+ CvsService_stub *m_cvsService;
+ CvsJob_stub *m_cvsDiffJob;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsdir.cpp b/vcs/cvsservice/cvsdir.cpp
new file mode 100644
index 00000000..2b7602e6
--- /dev/null
+++ b/vcs/cvsservice/cvsdir.cpp
@@ -0,0 +1,321 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include "cvsdir.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSDir
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDir::CVSDir() : QDir()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDir::CVSDir( const QDir &dir )
+ : QDir( dir )
+{
+ // We deal with absolute paths only
+ convertToAbs();
+
+ m_cvsDir = absPath() + QDir::separator() + "CVS";
+
+ if (isValid())
+ refreshEntriesCache();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDir::CVSDir( const CVSDir &aCvsDir )
+ : QDir( aCvsDir )
+{
+ *this = aCvsDir;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDir &CVSDir::operator=( const CVSDir &aCvsDir )
+{
+ m_cvsDir = aCvsDir.m_cvsDir;
+ m_cachedEntries = aCvsDir.m_cachedEntries;
+ QDir::operator=( aCvsDir );
+
+ return *this;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSDir::~CVSDir()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CVSDir::isValid() const
+{
+ return exists() &&
+ QFile::exists( entriesFileName() ) &&
+ QFile::exists( rootFileName() ) &&
+ QFile::exists( repoFileName() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::entriesFileName() const
+{
+ return m_cvsDir + QDir::separator() + "Entries";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::rootFileName() const
+{
+ return m_cvsDir + QDir::separator() + "Root";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::repoFileName() const
+{
+ return m_cvsDir + QDir::separator() + "Repository";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::cvsIgnoreFileName() const
+{
+ return absPath() + QDir::separator() + ".cvsignore";
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::repository() const
+{
+ // The content of CVS/Repository is a single line with the path into the
+ // repository of the modules checked out in this directory (just like
+ // "kdevelop/parts/cvsservice"): so we can read a single line of the file
+ // and we are done!
+ QString content;
+
+ if (!isValid())
+ return QString::null;
+
+ QByteArray bytes = cacheFile( repoFileName() );
+ QTextStream t( bytes, IO_ReadOnly );
+ content += t.readLine();
+
+ return content;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSDir::root() const
+{
+ // Same as CVSDir::repository() but CVS/Root contains the path of the
+ // CVS server as used in "cvs -d <server-path>" (in example:
+ // ":pserver:marios@cvs.kde.org:/home/kde")
+ QString content;
+
+ if (!isValid())
+ return QString::null;
+
+ QByteArray bytes = cacheFile( repoFileName() );
+ QTextStream t( bytes, IO_ReadOnly );
+ content += t.readLine();
+
+ return content;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QByteArray CVSDir::cacheFile( const QString &fileName )
+{
+ QFile f( fileName );
+ if (!f.open( IO_ReadOnly ))
+ return QByteArray();
+ return f.readAll();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList CVSDir::registeredEntryList() const
+{
+ QStringList l;
+ if (!isValid())
+ return l;
+
+ QByteArray bytes = cacheFile( entriesFileName() );
+ QTextStream t( bytes, IO_ReadOnly );
+ CVSEntry entry;
+ while (!t.eof())
+ {
+ QString line = t.readLine();
+ entry.parse( line, *this );
+ if (entry.isValid())
+ l.append( entry.fileName() );
+ }
+ return l;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CVSDir::isRegistered( const QString fileName ) const
+{
+ CVSEntry entry = fileStatus( fileName );
+ return entry.isValid() && entry.fileName() == fileName;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDir::refreshEntriesCache() const
+{
+ m_cachedEntries.clear();
+
+ QByteArray bytes = cacheFile( entriesFileName() );
+ QTextStream t( bytes, IO_ReadOnly );
+ CVSEntry entry;
+ while (!t.eof())
+ {
+ QString line = t.readLine();
+ entry.parse( line, *this );
+ if (entry.isValid())
+ m_cachedEntries[ entry.fileName() ] = entry;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSEntry CVSDir::fileStatus( const QString &fileName, bool refreshCache ) const
+{
+ if (refreshCache)
+ refreshEntriesCache();
+
+ if (m_cachedEntries.contains( fileName ))
+ {
+ return m_cachedEntries[ fileName ];
+ }
+ else
+ return CVSEntry( fileName, *this ); // Just the file name
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDir::ignoreFile( const QString &fileName )
+{
+ if (!isValid())
+ return;
+
+ QFile f( cvsIgnoreFileName() );
+ if (!f.open( IO_ReadOnly))
+ return;
+
+ QByteArray cachedFile = f.readAll();
+ QTextStream t( cachedFile, IO_ReadOnly | IO_WriteOnly );
+
+ QString readFileName;
+ bool found = false;
+
+ while (!t.eof() && !found)
+ {
+ readFileName = t.readLine();
+ found = (fileName == readFileName);
+ }
+
+ f.close();
+ if (!found)
+ {
+ f.open( IO_WriteOnly );
+
+ t << fileName << "\n";
+
+ f.writeBlock( cachedFile );
+ f.close();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSDir::doNotIgnoreFile( const QString &fileName )
+{
+ if (!isValid())
+ return;
+
+ // 1. Read all .ignore file in memory
+ QFile f( cvsIgnoreFileName() );
+ if (!f.open( IO_ReadOnly ))
+ return; // No .cvsignore file? Nothing to do then!
+
+ QByteArray cachedFile = f.readAll();
+ QTextIStream is( cachedFile );
+
+ QByteArray cachedOutputFile;
+ QTextOStream os( cachedOutputFile );
+
+ bool removed = false;
+ while (!is.eof())
+ {
+ QString readLine = is.readLine();
+ if (readLine != fileName)
+ os << readLine << "\n"; // QTextStream::readLine() eats the "\n" ...
+ else
+ removed = true;
+ }
+
+ f.close();
+ if (removed)
+ {
+ f.open( IO_WriteOnly );
+ f.writeBlock( cachedOutputFile );
+ f.close();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileInfoMap CVSDir::dirStatus() const
+{
+ VCSFileInfoMap vcsInfo;
+ /// Convert to VCSFileInfoMap: \FIXME : any speed improvement here?
+ QStringList entries = registeredEntryList();
+ QStringList::const_iterator it = entries.begin(), end = entries.end();
+ for ( ; it != end; ++it)
+ {
+ const QString &fileName = (*it);
+ const CVSEntry entry = fileStatus( fileName );
+
+ vcsInfo.insert( fileName, entry.toVCSFileInfo() );
+ }
+
+ return vcsInfo;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileInfoMap *CVSDir::cacheableDirStatus() const
+{
+ VCSFileInfoMap *vcsInfo = new VCSFileInfoMap;
+ /// Convert to VCSFileInfoMap: \FIXME : any speed improvement here?
+ QStringList entries = registeredEntryList();
+ QStringList::const_iterator it = entries.begin(), end = entries.end();
+ for ( ; it != end; ++it)
+ {
+ const QString &fileName = (*it);
+ const CVSEntry entry = fileStatus( fileName );
+
+ vcsInfo->insert( fileName, entry.toVCSFileInfo() );
+ }
+
+ return vcsInfo;
+}
diff --git a/vcs/cvsservice/cvsdir.h b/vcs/cvsservice/cvsdir.h
new file mode 100644
index 00000000..606f7507
--- /dev/null
+++ b/vcs/cvsservice/cvsdir.h
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSDIR_H
+#define CVSDIR_H
+
+#include <qdir.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+#include "cvsentry.h"
+
+/**
+Helper classes for handling CVS dirs
+
+@author Mario Scalas
+*/
+class CVSDir : public QDir
+{
+public:
+ CVSDir();
+ CVSDir( const QDir &dir );
+ explicit CVSDir( const CVSDir & );
+ CVSDir &operator=( const CVSDir & );
+ virtual ~CVSDir();
+
+ /**
+ * A client can use this method to validate the directory state.
+ * @return true if the directory is a valid CVS dir, false otherwise
+ */
+ bool isValid() const;
+ /**
+ * Returns a list of all the files registered into repository
+ */
+ QStringList registeredEntryList() const;
+ /**
+ * @param fileName is the file name (with no path info, just the file name!)
+ * @param refreshCache update internal cache re-parsing "<dirPath>/CVS/Entries"
+ * @return an empty CVSEntry if the file is not present
+ */
+ CVSEntry fileStatus( const QString &fileName, bool refreshCache = false ) const;
+ /**
+ */
+ VCSFileInfoMap dirStatus() const;
+ VCSFileInfoMap *cacheableDirStatus() const;
+ /**
+ * @return true if the file is registered into repository, false otherwise
+ */
+ bool isRegistered( const QString fileName ) const;
+ /**
+ * Check if the specified @p fileName is in "<CVSDIR>/.cvsignore" and, if not,
+ * append it.
+ */
+ void ignoreFile( const QString &fileName );
+ /**
+ * Check if the specified @p fileName is in "<CVSDIR>/.cvsignore" and, if yes,
+ * remove it.
+ */
+ void doNotIgnoreFile( const QString &fileName );
+ /**
+ * @return the content of "<CVSDIR>/CVS/Repository"
+ */
+ QString repository() const;
+ /**
+ * @return the content of "<CVSDIR>/CVS/Root"
+ */
+ QString root() const;
+ /**
+ * @return full path of "<this-dir>/CVS/Entries"
+ */
+ QString entriesFileName() const;
+ /**
+ * @return full path of "<this-dir>/CVS/Root"
+ */
+ QString rootFileName() const;
+ /**
+ * @return full path of "<this-dir>/CVS/Repository"
+ */
+ QString repoFileName() const;
+ /**
+ * @return full path of "<this-dir>/.cvsignore"
+ */
+ QString cvsIgnoreFileName() const;
+
+private:
+ void refreshEntriesCache() const;
+ static QByteArray cacheFile( const QString &fileName );
+
+ QString m_cvsDir;
+
+ typedef QMap<QString,CVSEntry> CVSEntriesCacheMap;
+ mutable CVSEntriesCacheMap m_cachedEntries;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsentry.cpp b/vcs/cvsservice/cvsentry.cpp
new file mode 100644
index 00000000..ab8b2cc0
--- /dev/null
+++ b/vcs/cvsservice/cvsentry.cpp
@@ -0,0 +1,187 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include "cvsentry.h"
+#include "cvsdir.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// Static
+///////////////////////////////////////////////////////////////////////////////
+
+const QString CVSEntry::invalidMarker = "<Invalid entry>";
+const QString CVSEntry::directoryMarker = "D";
+const QString CVSEntry::fileMarker = "";
+const QString CVSEntry::entrySeparator = "/";
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSEntry
+///////////////////////////////////////////////////////////////////////////////
+
+CVSEntry::CVSEntry()
+{
+ clean();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSEntry::CVSEntry( const QString &aLine, const CVSDir& dir )
+{
+ parse( aLine, dir );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSEntry::clean()
+{
+ m_type = invalidEntry;
+ m_state = Unknown;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSEntry::EntryType CVSEntry::type() const
+{
+ return m_type;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSEntry::parse( const QString &aLine, const CVSDir& dir )
+{
+ clean();
+
+ m_fields = QStringList::split( "/", aLine );
+
+ if (aLine.startsWith( entrySeparator )) // Is a file?
+ {
+ m_type = fileEntry; // Is a file
+ }
+ else if (aLine.startsWith( directoryMarker )) // Must be a directory then
+ {
+ m_type = directoryEntry; // Is a directory
+ m_fields.pop_front(); // QStringList::split() fills and empty item in head
+ return;
+ }
+ else // What the hell is this? >:-)
+ {
+ m_type = invalidEntry;
+ return;
+ }
+
+ //if we're a file, keep going
+ QDateTime entryFileDate(QDateTime::fromString(timeStamp()));
+ QDateTime realFileDate;
+ QFileInfo info(dir, m_fields[0]);
+ realFileDate = info.lastModified();
+
+ m_state = UpToDate;
+
+ if ( revision() == "0" )
+ m_state = Added;
+ else if ( revision().length() > 3 && revision()[0] == '-' )
+ m_state = Removed;
+ else if ( timeStamp().find('+') >= 0 )
+ m_state = Conflict;
+ else
+ {
+ QDateTime date( QDateTime::fromString( timeStamp() ) );
+ QDateTime fileDateUTC;
+ fileDateUTC.setTime_t( QFileInfo(dir, fileName()).lastModified().toTime_t(), Qt::UTC );
+ if ( date != fileDateUTC )
+ m_state = Modified;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSEntry::fileName() const
+{
+ if (type() != invalidEntry && m_fields.count() >= 1)
+ return m_fields[0];
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSEntry::revision() const
+{
+ if (type() != invalidEntry && m_fields.count() >= 2)
+ return m_fields[1];
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSEntry::timeStamp() const
+{
+ if (type() != invalidEntry && m_fields.count() >= 3)
+ return m_fields[2];
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSEntry::options() const
+{
+ if (type() != invalidEntry && m_fields.count() >= 4)
+ return m_fields[3];
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSEntry::tag() const
+{
+ if (type() != invalidEntry && m_fields.count() >= 5)
+ return m_fields[4];
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileInfo CVSEntry::toVCSFileInfo() const
+{
+ VCSFileInfo::FileState fileState = VCSFileInfo::Unknown;
+ if (isDirectory())
+ fileState = VCSFileInfo::Directory;
+
+ switch (m_state)
+ {
+ case Added:
+ fileState = VCSFileInfo::Added;
+ break;
+ case Conflict:
+ fileState = VCSFileInfo::Conflict;
+ break;
+ case Modified:
+ case Removed:
+ fileState = VCSFileInfo::Modified;
+ break;
+ case UpToDate:
+ fileState = VCSFileInfo::Uptodate;
+ break;
+ default:
+ fileState = VCSFileInfo::Unknown;
+ break;
+ }
+
+ return VCSFileInfo( fileName(), revision(), revision(), fileState );
+}
+
+//kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/vcs/cvsservice/cvsentry.h b/vcs/cvsservice/cvsentry.h
new file mode 100644
index 00000000..1c3db926
--- /dev/null
+++ b/vcs/cvsservice/cvsentry.h
@@ -0,0 +1,56 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * Copyright (C) 2005 by Matt Rogers <mattr@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSENTRY_H
+#define CVSENTRY_H
+
+#include <qstring.h>
+#include <qstringlist.h>
+#include <kdevversioncontrol.h>
+
+class CVSDir;
+
+class CVSEntry
+{
+public:
+ enum EntryType { invalidEntry, fileEntry, directoryEntry };
+ enum FileState { UpToDate, Modified, Added, Conflict, Removed, Unknown };
+
+ static const QString invalidMarker;
+ static const QString directoryMarker;
+ static const QString fileMarker;
+ static const QString entrySeparator;
+
+ CVSEntry();
+ CVSEntry( const QString &aLine, const CVSDir& dir );
+
+ void clean();
+ void parse( const QString &aLine, const CVSDir& dir );
+ VCSFileInfo toVCSFileInfo() const;
+ bool isValid() const { return type() != invalidEntry; }
+ bool isDirectory() const { return type() == directoryEntry; }
+
+ EntryType type() const;
+ FileState state() const;
+ QString fileName() const;
+ QString revision() const;
+ QString timeStamp() const;
+ QString options() const;
+ QString tag() const;
+
+private:
+ EntryType m_type;
+ FileState m_state;
+ QStringList m_fields;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsfileinfoprovider.cpp b/vcs/cvsservice/cvsfileinfoprovider.cpp
new file mode 100644
index 00000000..1ac5bd76
--- /dev/null
+++ b/vcs/cvsservice/cvsfileinfoprovider.cpp
@@ -0,0 +1,314 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qregexp.h>
+#include <qtimer.h>
+#include <kurl.h>
+#include <kdebug.h>
+
+#include <urlutil.h>
+#include <kdevproject.h>
+
+#include <dcopref.h>
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "cvspart.h"
+#include "cvsdir.h"
+#include "cvsentry.h"
+#include "cvsfileinfoprovider.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSFileInfoProvider
+///////////////////////////////////////////////////////////////////////////////
+
+CVSFileInfoProvider::CVSFileInfoProvider( CvsServicePart *parent, CvsService_stub *cvsService )
+ : KDevVCSFileInfoProvider( parent, "cvsfileinfoprovider" ),
+ m_requestStatusJob( 0 ), m_cvsService( cvsService ), m_cachedDirEntries( 0 )
+{
+ connect( this, SIGNAL(needStatusUpdate(const CVSDir&)), this, SLOT(updateStatusFor(const CVSDir&)));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSFileInfoProvider::~CVSFileInfoProvider()
+{
+ if (m_requestStatusJob && m_requestStatusJob->isRunning())
+ m_requestStatusJob->cancel();
+ delete m_requestStatusJob;
+ delete m_cachedDirEntries;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+const VCSFileInfoMap *CVSFileInfoProvider::status( const QString &dirPath )
+{
+ // Same dir: we can do with cache ...
+ if (dirPath != m_previousDirPath)
+ {
+ // ... different dir: flush old cache and cache new dir
+ delete m_cachedDirEntries;
+ CVSDir cvsdir( projectDirectory() + QDir::separator() + dirPath );
+ m_previousDirPath = dirPath;
+ m_cachedDirEntries = cvsdir.cacheableDirStatus();
+ }
+ return m_cachedDirEntries;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CVSFileInfoProvider::requestStatus( const QString &dirPath, void *callerData, bool recursive, bool checkRepos )
+{
+ m_savedCallerData = callerData;
+ if (m_requestStatusJob)
+ {
+ delete m_requestStatusJob;
+ m_requestStatusJob = 0;
+ }
+ // Flush old cache
+ if (m_cachedDirEntries)
+ {
+ delete m_cachedDirEntries;
+ m_cachedDirEntries = 0;
+ m_previousDirPath = dirPath;
+ }
+
+
+ if (!checkRepos) {
+ kdDebug(9006) << "No repo check reqested; Just read CVS/Entries from: " << dirPath << endl;
+ QDir qd(projectDirectory()+QDir::separator()+dirPath);
+ CVSDir cdir(qd);
+ if (cdir.isValid())
+ {
+ emit needStatusUpdate(cdir);
+ return true;
+ }
+ kdDebug(9006) << dirPath << " is not a valid cvs directory" << endl;
+ return false;
+ }
+
+ // Fix a possible bug in cvs client:
+ // When "cvs status" get's called nonrecursiv for a directory, it will
+ // not print anything if the path ends with a slash. So we need to ensure
+ // this here.
+ QString newPath = dirPath;
+ if (newPath.endsWith("/"))
+ newPath.truncate( newPath.length()-1 );
+
+
+ // path, recursive, tagInfo: hmmm ... we may use tagInfo for collecting file tags ...
+ DCOPRef job = m_cvsService->status( newPath, recursive, false );
+ m_requestStatusJob = new CvsJob_stub( job.app(), job.obj() );
+
+ kdDebug(9006) << "Running command : " << m_requestStatusJob->cvsCommand() << endl;
+ connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+ return m_requestStatusJob->execute();
+ /*
+ kdDebug(9006) << k_funcinfo << "Attempting to parse " << dirPath << " using CVS/Entries" << endl;
+ QDir qd(dirPath);
+ CVSDir cdir(qd);
+ if (cdir.isValid())
+ {
+ emit needStatusUpdate(cdir);
+ return true;
+ }*/
+}
+
+void CVSFileInfoProvider::propagateUpdate()
+{
+ emit statusReady( *m_cachedDirEntries, m_savedCallerData );
+}
+
+void CVSFileInfoProvider::updateStatusFor(const CVSDir& dir)
+{
+ m_cachedDirEntries = dir.cacheableDirStatus();
+ printOutFileInfoMap( *m_cachedDirEntries );
+
+ /* FileTree will call requestStatus() everytime the user expands a directory
+ * Unfortunatly requestStatus() will be called before the
+ * VCSFileTreeViewItem of the directory will be filled with the files
+ * it contains. Meaning, m_savedCallerData contains no childs at that
+ * time. When a dcop call is made to run "cvs status" this is no problem.
+ * The dcop call takes quit long, and so FileTree has enough time the fill
+ * in the childs before we report the status back.
+ * As far as the reading of the CVS/Entries file is very fast,
+ * it will happen that we emit statusReady() here before the directory
+ * item conains any childs. Therefor we need to give FileTree some time
+ * to update the directory item before we give the status infos.
+ */
+ QTimer::singleShot( 1000, this, SLOT(propagateUpdate()) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSFileInfoProvider::slotJobExited( bool normalExit, int /*exitStatus*/ )
+{
+ kdDebug(9006) << "CVSFileInfoProvider::slotJobExited(bool,int)" << endl;
+ if (!normalExit)
+ return;
+
+// m_cachedDirEntries = parse( m_requestStatusJob->output() );
+ m_cachedDirEntries = parse( m_statusLines );
+ // Remove me when not debugging
+ printOutFileInfoMap( *m_cachedDirEntries );
+
+ emit statusReady( *m_cachedDirEntries, m_savedCallerData );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSFileInfoProvider::slotReceivedOutput( QString someOutput )
+{
+ QStringList strings = m_bufferedReader.process( someOutput );
+ if (strings.count() > 0)
+ {
+ m_statusLines += strings;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSFileInfoProvider::slotReceivedErrors( QString /*someErrors*/ )
+{
+ /* Nothing to do */
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CVSFileInfoProvider::projectDirectory() const
+{
+ return owner()->project()->projectDirectory();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileInfoMap *CVSFileInfoProvider::parse( QStringList stringStream )
+{
+ QRegExp rx_recordStart( "^=+$" );
+ QRegExp rx_fileName( "^File: (\\.|\\-|\\w)+" );
+ QRegExp rx_fileStatus( "Status: (\\.|-|\\s|\\w)+" );
+ QRegExp rx_fileWorkRev( "\\bWorking revision:" );
+ QRegExp rx_fileRepoRev( "\\bRepository revision:" );
+ //QRegExp rx_stickyTag( "\\s+(Sticky Tag:\\W+(w+|\\(none\\)))" );
+ //QRegExp rx_stickyDate( "" ); // @todo but are they useful?? :-/
+ //QRegExp rx_stickyOptions( "" ); //@todo
+
+ QString fileName,
+ fileStatus,
+ workingRevision,
+ repositoryRevision,
+ stickyTag,
+ stickyDate,
+ stickyOptions;
+
+ VCSFileInfoMap *vcsStates = new VCSFileInfoMap;
+
+ int state = 0;
+ const int lastAcceptableState = 4;
+ // This is where the dirty parsing is done: from a string stream representing the
+ // 'cvs log' output we build a map with more useful strunctured data ;-)
+ for (QStringList::const_iterator it=stringStream.begin(); it != stringStream.end(); ++it)
+ {
+ QString s = (*it).stripWhiteSpace();
+ kdDebug(9006) << ">> Parsing: " << s << endl;
+
+ if (rx_recordStart.exactMatch( s ))
+ state = 1;
+ else if (state == 1 && rx_fileName.search( s ) >= 0 && rx_fileStatus.search( s ) >= 0) // FileName
+ {
+ fileName = rx_fileName.cap().replace( "File:", "" ).stripWhiteSpace();
+ fileStatus = rx_fileStatus.cap().replace( "Status:", "" ).stripWhiteSpace();
+ ++state; // Next state
+ kdDebug(9006) << ">> " << fileName << ", " << fileStatus << endl;
+ }
+ else if (state == 2 && rx_fileWorkRev.search( s ) >= 0)
+ {
+ workingRevision = s.replace( "Working revision:", "" ).stripWhiteSpace();
+
+ QRegExp rx_revision( "\\b(((\\d)+\\.?)*|New file!)" );
+ if (rx_revision.search( workingRevision ) >= 0)
+ {
+ workingRevision = rx_revision.cap();
+ kdDebug(9006) << ">> WorkRev: " << workingRevision << endl;
+ ++state;
+ }
+ }
+ else if (state == 3 && rx_fileRepoRev.search( s ) >= 0)
+ {
+ repositoryRevision = s.replace( "Repository revision:", "" ).stripWhiteSpace();
+
+ QRegExp rx_revision( "\\b(((\\d)+\\.?)*|No revision control file)" );
+ if (rx_revision.search( s ) >= 0)
+ {
+ repositoryRevision = rx_revision.cap();
+ kdDebug(9006) << ">> RepoRev: " << repositoryRevision << endl;
+ ++state;
+ }
+ }
+/*
+ else if (state == 4 && rx_stickyTag.search( s ) >= 0)
+ {
+ stickyTag = rx_stickyTag.cap();
+ ++state;
+ }
+*/
+ else if (state >= lastAcceptableState) // OK, parsed all useful info?
+ {
+ // Package stuff, put into map and get ready for a new record
+ VCSFileInfo vcsInfo( fileName, workingRevision, repositoryRevision,
+ String2EnumState( fileStatus ) );
+ kdDebug(9006) << "== Inserting: " << vcsInfo.toString() << endl;
+ vcsStates->insert( fileName, vcsInfo );
+ }
+ }
+ return vcsStates;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+VCSFileInfo::FileState CVSFileInfoProvider::String2EnumState( QString stateAsString )
+{
+ // @todo add more status as "Conflict" and "Sticky" (but I dunno how CVS writes it so I'm going
+ // to await until I have a conflict or somebody else fix it ;-)
+ // @todo use QRegExp for better matching since it seems strings have changed between CVS releases :-(
+ // @todo a new state for 'Needs patch'
+ if (stateAsString == "Up-to-date")
+ return VCSFileInfo::Uptodate;
+ else if (stateAsString == "Locally Modified")
+ return VCSFileInfo::Modified;
+ else if (stateAsString == "Locally Added")
+ return VCSFileInfo::Added;
+ else if (stateAsString == "Unresolved Conflict")
+ return VCSFileInfo::Conflict;
+ else if (stateAsString == "Needs Patch")
+ return VCSFileInfo::NeedsPatch;
+ else if (stateAsString == "Needs Checkout")
+ return VCSFileInfo::NeedsCheckout;
+ else
+ return VCSFileInfo::Unknown; /// \FIXME exhaust all the previous cases first ;-)
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSFileInfoProvider::printOutFileInfoMap( const VCSFileInfoMap &map )
+{
+ kdDebug(9006) << "Files parsed:" << endl;
+ for (VCSFileInfoMap::const_iterator it = map.begin(); it != map.end(); ++it)
+ {
+ const VCSFileInfo &vcsInfo = *it;
+ kdDebug(9006) << vcsInfo.toString() << endl;
+ }
+}
+
+#include "cvsfileinfoprovider.moc"
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/vcs/cvsservice/cvsfileinfoprovider.h b/vcs/cvsservice/cvsfileinfoprovider.h
new file mode 100644
index 00000000..2c0b5cf1
--- /dev/null
+++ b/vcs/cvsservice/cvsfileinfoprovider.h
@@ -0,0 +1,79 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSFILEINFOPROVIDER_H
+#define CVSFILEINFOPROVIDER_H
+
+#include <qmap.h>
+
+#include <kdevversioncontrol.h>
+#include "cvsservicedcopIface.h"
+#include "cvsdir.h"
+#include "bufferedstringreader.h"
+
+class CvsServicePart;
+class CvsService_stub;
+class CvsJob_stub;
+
+/**
+Provider for CVS file information
+
+@author Mario Scalas
+*/
+class CVSFileInfoProvider : public KDevVCSFileInfoProvider, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+public:
+ CVSFileInfoProvider( CvsServicePart *parent, CvsService_stub *cvsService );
+ virtual ~CVSFileInfoProvider();
+
+// -- Sync interface
+ virtual const VCSFileInfoMap *status( const QString &dirPath ) ;
+
+// -- Async interface for requesting data
+ virtual bool requestStatus( const QString &dirPath, void *callerData, bool recursive = true, bool checkRepos = true );
+
+public slots:
+ void updateStatusFor( const CVSDir& );
+private slots:
+ void propagateUpdate();
+
+signals:
+ void needStatusUpdate(const CVSDir&);
+
+private:
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+ QString projectDirectory() const;
+
+ static VCSFileInfoMap *parse( QStringList stringStream );
+
+ static VCSFileInfo::FileState String2EnumState( QString stateAsString );
+
+ static void printOutFileInfoMap( const VCSFileInfoMap &map );
+
+ BufferedStringReader m_bufferedReader;
+ QStringList m_statusLines;
+
+ mutable void *m_savedCallerData;
+ mutable CvsJob_stub *m_requestStatusJob;
+ CvsService_stub *m_cvsService;
+
+ //! Caching
+ mutable QString m_previousDirPath;
+ mutable VCSFileInfoMap *m_cachedDirEntries;
+};
+
+#endif
+//kate: space-indent on; indent-width 4;
diff --git a/vcs/cvsservice/cvsform.cpp b/vcs/cvsservice/cvsform.cpp
new file mode 100644
index 00000000..a23a1df2
--- /dev/null
+++ b/vcs/cvsservice/cvsform.cpp
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <klineedit.h>
+#include <qcombobox.h>
+#include <qcheckbox.h>
+
+#include "cvsform.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsForm
+///////////////////////////////////////////////////////////////////////////////
+
+CvsForm::CvsForm( QWidget *parent, const char *name, WFlags f )
+ : CvsFormBase( parent, name, f )
+{
+ setWFlags( getWFlags() | WDestructiveClose );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsForm::~CvsForm()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::module() const
+{
+ return module_edit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::vendor() const
+{
+ return vendor_edit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::message() const
+{
+ return message_edit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::release() const
+{
+ return release_edit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::location() const
+{
+ return serverPathEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsForm::cvsRsh() const
+{
+ return cvsRshComboBox->currentText();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsForm::mustInitRoot() const
+{
+ return init_check->isChecked();
+}
+
+#include "cvsform.moc"
diff --git a/vcs/cvsservice/cvsform.h b/vcs/cvsservice/cvsform.h
new file mode 100644
index 00000000..471e10d6
--- /dev/null
+++ b/vcs/cvsservice/cvsform.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSFORM_H
+#define CVSFORM_H
+
+#include "cvsformbase.h"
+
+/**
+An instance of this class is used by the AppWizard to collect
+information about setting up the cvs repository.
+*/
+class CvsForm : public CvsFormBase
+{
+ Q_OBJECT
+public:
+ CvsForm( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+ virtual ~CvsForm();
+
+ QString module() const;
+ QString vendor() const;
+ QString message() const;
+ QString release() const;
+ QString location() const;
+ QString cvsRsh() const;
+ bool mustInitRoot() const;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsformbase.ui b/vcs/cvsservice/cvsformbase.ui
new file mode 100644
index 00000000..2a7b5c42
--- /dev/null
+++ b/vcs/cvsservice/cvsformbase.ui
@@ -0,0 +1,223 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>CvsFormBase</class>
+<author>Yann Hodique</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>CvsFormBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>603</width>
+ <height>625</height>
+ </rect>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This form allows you to create a CVS repository for your new project</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>Release &amp;tag:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>release_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>module_edit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter the name of the repository</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>CVS Repository name goes here.
+Most of the thime you'll just reuse the project name</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>vendor_edit</cstring>
+ </property>
+ <property name="text">
+ <string>vendor</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter the vendor name</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Message:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>message_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Module:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>module_edit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Vendor tag:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>vendor_edit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>message_edit</cstring>
+ </property>
+ <property name="text">
+ <string>new project</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Repository creation message</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>release_edit</cstring>
+ </property>
+ <property name="text">
+ <string>start</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Tag that will be associated with initial state</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Server path:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>serverPathEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>serverPathEdit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enter your CVS Root location</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>CVS Root location goes here, for example:&lt;ul&gt;
+&lt;li&gt;/home/cvsroot or&lt;/li&gt;&lt;li&gt;:pserver:me@localhost:/home/cvs&lt;/li&gt;&lt;/ul&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>CVS_&amp;RSH:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cvsRshComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string></string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ssh</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cvsRshComboBox</cstring>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="3">
+ <property name="name">
+ <cstring>init_check</cstring>
+ </property>
+ <property name="text">
+ <string>Init &amp;root</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check if you defined a new CVS Root</string>
+ </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>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>51</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>serverPathEdit</tabstop>
+ <tabstop>cvsRshComboBox</tabstop>
+ <tabstop>init_check</tabstop>
+ <tabstop>module_edit</tabstop>
+ <tabstop>vendor_edit</tabstop>
+ <tabstop>message_edit</tabstop>
+ <tabstop>release_edit</tabstop>
+</tabstops>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/vcs/cvsservice/cvslogdialog.cpp b/vcs/cvsservice/cvslogdialog.cpp
new file mode 100644
index 00000000..ac6fd97c
--- /dev/null
+++ b/vcs/cvsservice/cvslogdialog.cpp
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * Copyright (C) 200?-2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qvbox.h>
+#include <qregexp.h>
+#include <qdir.h>
+#include <qstringlist.h>
+
+#include <kmessagebox.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "cvsoptions.h"
+#include "cvslogpage.h"
+#include "cvsdiffpage.h"
+
+#include "cvslogdialog.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSLogDialog
+///////////////////////////////////////////////////////////////////////////////
+
+CVSLogDialog::CVSLogDialog( CvsService_stub *cvsService, QWidget *parent, const char *name, int )
+ : KDialogBase( Tabbed, i18n("CVS Log & Diff Dialog"), Close, Close,
+ parent, name? name : "logformdialog", false /*modal*/, true /*separator*/ ),
+ m_cvsLogPage( 0 ), m_cvsService( cvsService )
+{
+ setWFlags( getWFlags() | WDestructiveClose );
+
+ QVBox *vbox = addVBoxPage( i18n("Log From CVS") );
+ m_cvsLogPage = new CVSLogPage( m_cvsService, vbox );
+
+ connect( m_cvsLogPage, SIGNAL(diffRequested(const QString&, const QString&, const QString&)),
+ this, SLOT(slotDiffRequested(const QString&, const QString&, const QString&)) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSLogDialog::~CVSLogDialog()
+{
+ kdDebug(9006) << "CVSLogDialog::~CVSLogDialog()" << endl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogDialog::startLog( const QString &workDir, const QString &pathName )
+{
+ kdDebug(9006) << "CVSLogDialog::start() here! workDir = " << workDir <<
+ ", pathName = " << pathName << endl;
+
+// displayActionFeedback( true );
+/*
+ QVBox *vbox = addVBoxPage( i18n("Log From CVS: ") + pathName );
+ m_cvsLogPage = new CVSLogPage( m_cvsService, vbox );
+ this->resize( m_cvsLogPage->size() );
+
+ connect( m_cvsLogPage, SIGNAL(linkClicked(const QString&, const QString&)),
+ this, SLOT(slotDiffRequested(const QString&, const QString&)) );
+*/
+ m_cvsLogPage->startLog( workDir, pathName );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogDialog::slotDiffRequested( const QString &pathName, const QString &revA, const QString &revB )
+{
+ kdDebug(9006) << "CVSLogDialog::slotDiffRequested()" << endl;
+
+ // Create a new CVSDiffPage and start diffing process
+ QString diffTitle = i18n("Diff between %1 and %2").arg( revA ).arg( revB );
+ QVBox *vbox = addVBoxPage( diffTitle );
+ CVSDiffPage *diffPage = new CVSDiffPage( m_cvsService, vbox );
+ diffPage->startDiff( pathName, revA, revB );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogDialog::slotCancel()
+{
+ // Hmmm ...
+
+ KDialogBase::slotCancel();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogDialog::displayActionFeedback( bool working )
+{
+ if (working)
+ {
+ setCursor( KCursor::waitCursor() );
+ }
+ else
+ {
+ setCursor( KCursor::arrowCursor() );
+ }
+}
+
+#include "cvslogdialog.moc"
+
+
diff --git a/vcs/cvsservice/cvslogdialog.h b/vcs/cvsservice/cvslogdialog.h
new file mode 100644
index 00000000..12a7a2eb
--- /dev/null
+++ b/vcs/cvsservice/cvslogdialog.h
@@ -0,0 +1,50 @@
+//
+// C++ Interface: cvslogdialog
+//
+// Description:
+//
+//
+// Author: KDevelop Authors <kdevelop-devel@kdevelop.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef CVSLOGDIALOG_H
+#define CVSLOGDIALOG_H
+
+#include <kdialogbase.h>
+
+class CvsJob_stub;
+class CvsService_stub;
+class CVSLogPage;
+
+/**
+Implementation for the form displaying 'cvs log' output.
+
+@author KDevelop Authors
+*/
+class CVSLogDialog : public KDialogBase
+{
+ Q_OBJECT
+public:
+ CVSLogDialog( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~CVSLogDialog();
+
+ void startLog( const QString &workDir, const QString &pathName );
+
+private slots:
+ void slotDiffRequested( const QString &pathName, const QString &revA, const QString &revB );
+ virtual void slotCancel();
+
+private:
+// void parseLogContent( const QString& text );
+ void displayActionFeedback( bool working );
+
+private:
+ QString m_pathName;
+
+ CVSLogPage *m_cvsLogPage;
+ CvsService_stub *m_cvsService;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvslogpage.cpp b/vcs/cvsservice/cvslogpage.cpp
new file mode 100644
index 00000000..cf8645e9
--- /dev/null
+++ b/vcs/cvsservice/cvslogpage.cpp
@@ -0,0 +1,212 @@
+/***************************************************************************
+ * Copyright (C) 200?-2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qtextbrowser.h>
+#include <qlayout.h>
+#include <qregexp.h>
+#include <qdir.h>
+#include <qstringlist.h>
+
+#include <kmessagebox.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <dcopref.h>
+
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+#include "cvsoptions.h"
+#include "cvslogpage.h"
+#include "cvsdiffpage.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class CVSLogPage
+///////////////////////////////////////////////////////////////////////////////
+
+CVSLogPage::CVSLogPage( CvsService_stub *cvsService, QWidget *parent, const char *name, int )
+ : DCOPObject( "CvsLogPageDCOPIface" ),
+ QWidget( parent, name? name : "logformpage" ),
+ m_cvsService( cvsService ), m_cvsLogJob( 0 )
+{
+ QLayout *thisLayout = new QVBoxLayout( this );
+
+ m_textBrowser = new QTextBrowser( this, "logbrowser" );
+ thisLayout->add( m_textBrowser );
+
+ /// \FIXME a better way?
+ m_textBrowser->setMinimumWidth(fontMetrics().width('X')*50);
+ m_textBrowser->setMinimumHeight(fontMetrics().width('X')*43);
+
+ connect( m_textBrowser, SIGNAL(linkClicked( const QString& )), this, SLOT(slotLinkClicked( const QString& )) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CVSLogPage::~CVSLogPage()
+{
+ kdDebug(9006) << "CVSLogPage::~CVSLogPage()" << endl;
+ cancel();
+ delete m_cvsLogJob;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::startLog( const QString &workDir, const QString &pathName )
+{
+ kdDebug(9006) << "CVSLogPage::start() here! workDir = " << workDir <<
+ ", pathName = " << pathName << endl;
+
+// CvsOptions *options = CvsOptions::instance();
+ // "cvs log" needs to be done on relative-path basis
+ m_pathName = pathName;
+ m_diffStrings.clear();
+
+ DCOPRef job = m_cvsService->log( pathName );
+ m_cvsLogJob = new CvsJob_stub( job.app(), job.obj() );
+
+ // establish connections to the signals of the cvs m_job
+ connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ // We'll read the ouput directly from the job ...
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+// connectDCOPSignal( job.app(), job.obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)", true );
+
+ kdDebug(9006) << "Running: " << m_cvsLogJob->cvsCommand() << endl;
+ m_cvsLogJob->execute();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/*
+void CVSLogPage::parseLogContent( const QString& text )
+{
+ kdDebug(9006) << "CVSLogPage::parseLogContent()" << endl;
+
+ m_base->contents->clear();
+
+ QStringList l = QStringList::split( "----------------------------", text );
+ QString header = l.front();
+ l.pop_front();
+
+ for( QStringList::Iterator it=l.begin(); it!=l.end(); ++it )
+ {
+ const QString &s = *it;
+ if (s)
+ {
+ m_base->contents->append( s );
+ m_base->contents->append( "<hr>" );
+ }
+ }
+}
+*/
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::slotJobExited( bool normalExit, int exitStatus )
+{
+// m_part->core()->running( m_part, false );
+ if (!normalExit)
+ {
+ KMessageBox::sorry( this, i18n("Log failed with exitStatus == %1").arg( exitStatus), i18n("Log Failed") );
+ return;
+ }
+
+ static QRegExp rx_sep( "\\-+" );
+ static QRegExp rx_sep2( "=+" );
+ static QRegExp rx_date( "date: .* author: .* state: .* lines: .*" );
+ // "revision" followed by one or more decimals followed by a optional dot
+ static QRegExp rx_rev( "revision ((\\d+\\.?)+)" );
+ m_textBrowser->setTextFormat( QTextBrowser::PlainText );
+
+ for (size_t i=0; i<m_diffStrings.count(); ++i) {
+ QString s = m_diffStrings[i];
+ kdDebug(9006) << "Examining line: " << s << endl;
+ if ( rx_rev.exactMatch(s) )
+ {
+ QString ver = rx_rev.cap( 1 );
+ QString dstr = "<b>" + s + "</b> ";
+ int lastVer = ver.section( '.', -1 ).toInt() - 1;
+ if ( lastVer > 0 ) {
+ QString lv = ver.left( ver.findRev( "." ) + 1 ) + QString::number( lastVer );
+ dstr += " [<a href=\"diff:/" + m_pathName + "/" + lv + "_" + ver + "\">diff to " + lv + "</a>]";
+ }
+ m_textBrowser->setTextFormat( QTextBrowser::RichText );
+ m_textBrowser->append( dstr );
+ m_textBrowser->setTextFormat( QTextBrowser::PlainText );
+ }
+ else if ( rx_date.exactMatch(s) )
+ {
+ m_textBrowser->setTextFormat( QTextBrowser::RichText );
+ m_textBrowser->append( "<i>" + s + "</i>" );
+ m_textBrowser->setTextFormat( QTextBrowser::PlainText );
+ }
+ else if ( rx_sep.exactMatch(s) || rx_sep2.exactMatch(s) )
+ {
+ m_textBrowser->append( "\n" );
+ m_textBrowser->setTextFormat( QTextBrowser::RichText );
+ m_textBrowser->append( "<hr>" );
+ m_textBrowser->setTextFormat( QTextBrowser::PlainText );
+ } else
+ {
+ m_textBrowser->append( s );
+ }
+ }
+ m_logTextBackup = m_textBrowser->source();
+
+// emit jobFinished( normalExit, exitStatus );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::slotLinkClicked( const QString &link )
+{
+ kdDebug(9006) << "CVSLogPage::slotLinkClicked()" << endl;
+
+ // The text browser clears the page so we go back to our old one
+ /// \FIXME in this way I lose the source
+ m_textBrowser->setSource( m_logTextBackup );
+
+ QString ver = link.mid( link.findRev( "/" ) + 1 );
+ QString v1 = ver.section( '_', 0, 0 );
+ QString v2 = ver.section( '_', 1, 1 );
+ if ( v1.isEmpty() || v2.isEmpty() )
+ {
+ m_textBrowser->append( i18n( "invalid link clicked" ) );
+ return;
+ }
+
+ emit diffRequested( m_pathName, v1, v2 );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::slotReceivedOutput( QString someOutput )
+{
+ kdDebug(9006) << "CVSLogPage::slotReceivedOutput(QString)" << endl;
+
+ kdDebug(9006) << "OUTPUT: " << someOutput << endl;
+ m_diffStrings += m_outputBuffer.process(someOutput);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::slotReceivedErrors( QString someErrors )
+{
+ kdDebug(9006) << "ERRORS: " << someErrors << endl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CVSLogPage::cancel()
+{
+ if (m_cvsLogJob && m_cvsLogJob->isRunning())
+ m_cvsLogJob->cancel();
+}
+
+#include "cvslogpage.moc"
diff --git a/vcs/cvsservice/cvslogpage.h b/vcs/cvsservice/cvslogpage.h
new file mode 100644
index 00000000..a3480e91
--- /dev/null
+++ b/vcs/cvsservice/cvslogpage.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+ * Copyright (C) 200?-2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSLOGPAGE_H
+#define CVSLOGPAGE_H
+
+#include "cvsservicedcopIface.h"
+#include <qwidget.h>
+#include "bufferedstringreader.h"
+
+class CvsJob_stub;
+class CvsService_stub;
+class QTextBrowser;
+
+/**
+Implementation for the form displaying 'cvs log' output.
+
+@author KDevelop Authors
+*/
+class CVSLogPage : public QWidget, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+public:
+ CVSLogPage( CvsService_stub *cvsService, QWidget *parent=0, const char *name=0, int flags=0 );
+ virtual ~CVSLogPage();
+
+ void startLog( const QString &workDir, const QString &pathName );
+ void cancel();
+
+signals:
+ // Emitted when the user click upon a link
+ void diffRequested( const QString &pathName, const QString &revA, const QString &revB );
+
+private slots:
+ void slotLinkClicked( const QString &link );
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+//private:
+// void parseLogContent( const QString& text );
+
+private:
+ QString m_pathName;
+ QTextBrowser *m_textBrowser;
+ QString m_logTextBackup;
+ BufferedStringReader m_outputBuffer;
+ QStringList m_diffStrings;
+
+ CvsService_stub *m_cvsService;
+ CvsJob_stub *m_cvsLogJob;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsoptions.cpp b/vcs/cvsservice/cvsoptions.cpp
new file mode 100644
index 00000000..448f4761
--- /dev/null
+++ b/vcs/cvsservice/cvsoptions.cpp
@@ -0,0 +1,288 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+#include <kdebug.h>
+#include <kconfig.h>
+#include <klocale.h>
+
+#include "domutil.h"
+#include "kdevproject.h"
+#include "cvsoptions.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// Macros
+///////////////////////////////////////////////////////////////////////////////
+
+#define default_revert QString::fromLatin1("-C")
+#define default_diff QString::fromLatin1("-p")
+#define default_rsh QString::fromLatin1("")
+#define default_contextLines 3
+#define default_compression 0
+
+///////////////////////////////////////////////////////////////////////////////
+// static members
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptions *CvsOptions::m_instance = 0;
+QString CvsOptions::invalidLocation( "ERROR-LOCATION-IS-NOT-SET-IN-PROJECT" );
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsOptions
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptions::CvsOptions()
+ : m_recursiveWhenCommitRemove( true ),
+ m_pruneEmptyDirsWhenUpdate( true ),
+ m_recursiveWhenUpdate( true ),
+ m_createDirsWhenUpdate( true ),
+ m_revertOptions( default_revert ),
+ m_diffOptions( default_diff ),
+ m_cvsRshEnvVar( default_rsh ),
+ m_compressionLevel( default_compression ),
+ m_contextLines( default_contextLines )
+{
+ kdDebug( 9006 ) << " **** CvsOptions instance CREATED!" << endl;
+ // We share some configuration data with cvsservice
+ m_serviceConfig = new KConfig( "cvsservicerc" );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptions::~CvsOptions()
+{
+ kdDebug( 9006 ) << " **** CvsOptions instance DESTROYED!" << endl;
+ delete m_serviceConfig;
+
+ m_instance = 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptions* CvsOptions::instance()
+{
+ if (!m_instance)
+ {
+ m_instance = new CvsOptions();
+ }
+ return m_instance;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::save( KDevProject *project )
+{
+ kdDebug( 9006 ) << " **** CvsOptions::save( KDevProject* ) here" << endl;
+ Q_ASSERT( project );
+
+ QDomDocument &dom = *project->projectDom();
+
+ DomUtil::writeBoolEntry( dom, "/kdevcvsservice/recursivewhenupdate", recursiveWhenUpdate() );
+ DomUtil::writeBoolEntry( dom, "/kdevcvsservice/prunedirswhenupdate", pruneEmptyDirsWhenUpdate() );
+ DomUtil::writeBoolEntry( dom, "/kdevcvsservice/createdirswhenupdate", createDirsWhenUpdate() );
+ DomUtil::writeBoolEntry( dom, "/kdevcvsservice/recursivewhencommitremove", recursiveWhenCommitRemove() );
+ DomUtil::writeEntry( dom, "/kdevcvsservice/revertoptions", revertOptions() );
+// DomUtil::writeEntry( dom, "/kdevcvsservice/location", location() );
+
+ // [Repository-:ext:anonymous@cvs.ogre.sourceforge.net:/cvsroot/ogrenew]
+ QString groupName = "Repository-" + guessLocation( project->projectDirectory() );
+ m_serviceConfig->setGroup( groupName );
+
+ m_serviceConfig->writeEntry( "ContextLines", contextLines() );
+ m_serviceConfig->writeEntry( "DiffOptions", diffOptions() );
+ m_serviceConfig->writeEntry( "rsh", cvsRshEnvVar() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::load( KDevProject *project )
+{
+ kdDebug( 9006 ) << " **** CvsOptions::load( KDevProject* ) here" << endl;
+ Q_ASSERT( project );
+ QDomDocument &dom = *project->projectDom();
+
+ m_recursiveWhenUpdate = DomUtil::readBoolEntry( dom, "/kdevcvsservice/recursivewhenupdate", true );
+ m_pruneEmptyDirsWhenUpdate = DomUtil::readBoolEntry( dom, "/kdevcvsservice/prunedirswhenupdate", true );
+ m_createDirsWhenUpdate = DomUtil::readBoolEntry( dom, "/kdevcvsservice/createdirswhenupdate", true );
+ m_recursiveWhenCommitRemove = DomUtil::readBoolEntry( dom, "/kdevcvsservice/recursivewhencommitremove", true );
+ m_revertOptions = DomUtil::readEntry( dom, "/kdevcvsservice/revertoptions", default_revert );
+// m_location = DomUtil::readEntry( dom, "/kdevcvsservice/location", guessLocation( project->projectDirectory() ) );
+
+ QString groupName = "Repository-" + guessLocation( project->projectDirectory() );
+ m_serviceConfig->setGroup( groupName );
+
+ m_contextLines = m_serviceConfig->readUnsignedNumEntry( "ContextLines", default_contextLines );
+ m_diffOptions = m_serviceConfig->readEntry( "DiffOptions", default_diff );
+ m_cvsRshEnvVar = m_serviceConfig->readEntry( "rsh", default_rsh );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setRecursiveWhenCommitRemove( bool b )
+{
+ this->m_recursiveWhenCommitRemove = b;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptions::recursiveWhenCommitRemove() const
+{
+ return this->m_recursiveWhenCommitRemove;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setPruneEmptyDirsWhenUpdate( bool b )
+{
+ this->m_pruneEmptyDirsWhenUpdate = b;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptions::pruneEmptyDirsWhenUpdate() const
+{
+ return this->m_pruneEmptyDirsWhenUpdate;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setRecursiveWhenUpdate( bool b )
+{
+ this->m_recursiveWhenUpdate = b;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptions::recursiveWhenUpdate() const
+{
+ return this->m_recursiveWhenUpdate;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setCreateDirsWhenUpdate( bool b )
+{
+ this->m_createDirsWhenUpdate = b;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptions::createDirsWhenUpdate() const
+{
+ return this->m_createDirsWhenUpdate;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setRevertOptions( const QString &p )
+{
+ this->m_revertOptions = p;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptions::revertOptions()
+{
+ return this->m_revertOptions;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setDiffOptions( const QString &p )
+{
+ this->m_diffOptions = p;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptions::diffOptions()
+{
+ return this->m_diffOptions;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setCvsRshEnvVar( const QString &p )
+{
+ this->m_cvsRshEnvVar = p;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptions::cvsRshEnvVar()
+{
+ return this->m_cvsRshEnvVar;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptions::location()
+{
+ return m_location;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setLocation( const QString &p )
+{
+ m_location = p;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setContextLines( unsigned int contextLines )
+{
+ m_contextLines = contextLines;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+unsigned int CvsOptions::contextLines() const
+{
+ return m_contextLines;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptions::setCompressionLevel( unsigned int compressionLevel )
+{
+ m_compressionLevel = compressionLevel;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+unsigned int CvsOptions::compressionLevel() const
+{
+ return m_compressionLevel;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptions::guessLocation( const QString &projectDir ) const
+{
+ QString rootFileName( projectDir + "/CVS/Root" );
+
+ QFile f( rootFileName );
+ if (f.open( IO_ReadOnly ))
+ {
+ QTextStream t( &f );
+ QString serverLocation = t.readLine();
+ kdDebug(9000) << "===> Server location guessed: " << serverLocation << endl;
+ return serverLocation;
+ }
+ else
+ {
+ kdDebug(9000) << "===> Error: could not open CVS/Entries!! " << endl;
+ return i18n( "Error while guessing repository location." );
+ }
+}
diff --git a/vcs/cvsservice/cvsoptions.h b/vcs/cvsservice/cvsoptions.h
new file mode 100644
index 00000000..222a34c7
--- /dev/null
+++ b/vcs/cvsservice/cvsoptions.h
@@ -0,0 +1,102 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSOPTIONS_H
+#define CVSOPTIONS_H
+
+#include <qstring.h>
+#include <qdom.h>
+
+class CvsServicePart;
+class KConfig;
+class KDevProject;
+
+/* This class represents the command line options for the used cvs commands.
+ * It uses the singleton pattern.
+ * @author Mario Scalas <mario.scalas@libero.it>
+*/
+class CvsOptions
+{
+public:
+ static CvsOptions *instance();
+
+ static QString invalidLocation;
+
+ virtual ~CvsOptions();
+
+ void save( KDevProject *project );
+ /// \FIXME parameter should be const!!
+ void load( KDevProject *project );
+
+ void setRecursiveWhenCommitRemove( bool b );
+ bool recursiveWhenCommitRemove() const;
+
+ void setPruneEmptyDirsWhenUpdate( bool b );
+ bool pruneEmptyDirsWhenUpdate() const;
+
+ void setRecursiveWhenUpdate( bool b );
+ bool recursiveWhenUpdate() const;
+
+ void setCreateDirsWhenUpdate( bool b );
+ bool createDirsWhenUpdate() const;
+
+ void setDiffOptions( const QString &p );
+ QString diffOptions();
+
+ void setRevertOptions( const QString &p );
+ QString revertOptions();
+
+ void setCvsRshEnvVar( const QString &p );
+ QString cvsRshEnvVar();
+
+ /**
+ * Will try to determine location by using CVS/Root file
+ */
+ QString guessLocation( const QString &projectDir ) const;
+
+ /**
+ * Set server path string (this should be called by the part when a new project
+ * is created or imported)
+ * @param p (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ */
+ void setLocation( const QString &p );
+ /**
+ * @result remote path (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ */
+ QString location();
+
+ void setContextLines( unsigned int contextLines );
+ unsigned int contextLines() const;
+
+ void setCompressionLevel( unsigned int compressionLevel = 0 );
+ unsigned int compressionLevel() const;
+
+private:
+ // Cache
+ bool m_recursiveWhenCommitRemove;
+ bool m_pruneEmptyDirsWhenUpdate;
+ bool m_recursiveWhenUpdate;
+ bool m_createDirsWhenUpdate;
+ QString m_revertOptions;
+ QString m_diffOptions;
+ QString m_cvsRshEnvVar;
+ QString m_location;
+ unsigned int m_compressionLevel;
+ unsigned int m_contextLines;
+ //! So we can access cvssservice configuration (repositories first of all)
+ KConfig *m_serviceConfig;
+
+ static CvsOptions *m_instance;
+ CvsOptions();
+};
+
+#endif // CVSOPTIONS_H
+
diff --git a/vcs/cvsservice/cvsoptionswidget.cpp b/vcs/cvsservice/cvsoptionswidget.cpp
new file mode 100644
index 00000000..aa7a98c1
--- /dev/null
+++ b/vcs/cvsservice/cvsoptionswidget.cpp
@@ -0,0 +1,190 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qcheckbox.h>
+#include <klineedit.h>
+#include <knuminput.h>
+#include <kdialog.h>
+
+#include "domutil.h"
+#include "cvsoptions.h"
+#include "cvsoptionswidget.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class DiffDialog
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptionsWidget::CvsOptionsWidget( QWidget *parent, const char *name )
+ : CvsOptionsWidgetBase( parent, name )
+{
+ readConfig();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsOptionsWidget::~CvsOptionsWidget()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::readConfig()
+{
+ CvsOptions *options = CvsOptions::instance();
+
+ this->setCvsRshEnvVar( options->cvsRshEnvVar() );
+ this->setServerLocation( options->location() );
+ this->setPruneEmptyDirWhenUpdating( options->pruneEmptyDirsWhenUpdate() );
+ this->setCreateNewDirWhenUpdating( options->createDirsWhenUpdate() );
+ this->setRecursiveWhenUpdating( options->recursiveWhenUpdate() );
+ this->setRecursiveWhenCommittingRemoving( options->recursiveWhenCommitRemove() );
+ this->setDiffOptions( options->diffOptions() );
+ this->setContextLines( options->contextLines() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::storeConfig()
+{
+ CvsOptions *options = CvsOptions::instance();
+
+ options->setCvsRshEnvVar( this->cvsRshEnvVar().stripWhiteSpace() );
+ options->setLocation( this->serverLocation().stripWhiteSpace() );
+ options->setPruneEmptyDirsWhenUpdate( this->pruneEmptyDirWhenUpdating() );
+ options->setCreateDirsWhenUpdate( this->createNewDirWhenUpdating() );
+ options->setRecursiveWhenUpdate( this->recursiveWhenUpdating() );
+ options->setRecursiveWhenCommitRemove( this->recursiveWhenCommittingRemoving() );
+ options->setDiffOptions( this->diffOptions().stripWhiteSpace() );
+ options->setContextLines( this->contextLines() );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::accept() {
+ storeConfig();
+// emit configChange();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setPruneEmptyDirWhenUpdating( bool b )
+{
+ this->pruneEmptyDirWhenUpdateCheck->setChecked( b );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setCreateNewDirWhenUpdating( bool b )
+{
+ this->createNewDirWhenUpdateCheck->setChecked( b );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setRecursiveWhenUpdating( bool b )
+{
+ this->recursiveWhenUpdateCheck->setChecked( b );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setRecursiveWhenCommittingRemoving( bool b )
+{
+ this->recursiveWhenCommitRemoveCheck->setChecked( b );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setContextLines( unsigned int p )
+{
+ this->contextLinesInput->setValue( p );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setDiffOptions( const QString &p )
+{
+ this->diffOptionsEdit->setText( p );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptionsWidget::diffOptions() const
+{
+ return this->diffOptionsEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setCvsRshEnvVar( const QString &p )
+{
+ this->cvsRshEnvVarEdit->setText( p );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsOptionsWidget::setServerLocation( const QString &p )
+{
+ this->serverLocationEdit->setText( p );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptionsWidget::pruneEmptyDirWhenUpdating() const
+{
+ return pruneEmptyDirWhenUpdateCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptionsWidget::createNewDirWhenUpdating() const
+{
+ return createNewDirWhenUpdateCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptionsWidget::recursiveWhenUpdating() const
+{
+ return recursiveWhenUpdateCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsOptionsWidget::recursiveWhenCommittingRemoving() const
+{
+ return recursiveWhenCommitRemoveCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+unsigned int CvsOptionsWidget::contextLines() const
+{
+ return contextLinesInput->value();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptionsWidget::cvsRshEnvVar() const
+{
+ return cvsRshEnvVarEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsOptionsWidget::serverLocation() const
+{
+ return serverLocationEdit->text();
+}
+
+#include "cvsoptionswidget.moc"
diff --git a/vcs/cvsservice/cvsoptionswidget.h b/vcs/cvsservice/cvsoptionswidget.h
new file mode 100644
index 00000000..5df98d76
--- /dev/null
+++ b/vcs/cvsservice/cvsoptionswidget.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CVSOPTIONSWIDGET_H_
+#define _CVSOPTIONSWIDGET_H_
+
+#include <qwidget.h>
+#include "cvsoptionswidgetbase.h"
+
+class QLabel;
+class QVBoxLayout;
+
+class CvsOptionsWidget : public CvsOptionsWidgetBase
+{
+ Q_OBJECT
+public:
+ CvsOptionsWidget( QWidget *parent, const char *name=0 );
+ virtual ~CvsOptionsWidget();
+
+ bool pruneEmptyDirWhenUpdating() const;
+ void setPruneEmptyDirWhenUpdating( bool b );
+
+ bool createNewDirWhenUpdating() const;
+ void setCreateNewDirWhenUpdating( bool b );
+
+ bool recursiveWhenUpdating() const;
+ void setRecursiveWhenUpdating( bool b );
+
+ bool recursiveWhenCommittingRemoving() const;
+ void setRecursiveWhenCommittingRemoving( bool b );
+
+ unsigned int contextLines() const;
+ void setContextLines( unsigned int p );
+
+ QString diffOptions() const;
+ void setDiffOptions( const QString &p );
+
+ QString cvsRshEnvVar() const;
+ void setCvsRshEnvVar( const QString &p );
+
+ QString serverLocation() const;
+ void setServerLocation( const QString &p );
+
+public slots:
+ void accept();
+
+private:
+ void readConfig();
+ void storeConfig();
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsoptionswidgetbase.ui b/vcs/cvsservice/cvsoptionswidgetbase.ui
new file mode 100644
index 00000000..4938ea4a
--- /dev/null
+++ b/vcs/cvsservice/cvsoptionswidgetbase.ui
@@ -0,0 +1,230 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>CvsOptionsWidgetBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>cvsOptionsWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>500</width>
+ <height>507</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>CVS Options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Common Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_rshLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Remote shell (CVS_RSH environment variable):</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>cvsRshEnvVarEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>cvsRshEnvVarEdit</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>sets the CVS_RSH variable</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set this option to "ssh" to use ssh as remote shell for CVS. Note that you need password-less login (see the ssh documentation for how to generate a public/private key pair) otherwise CVS will just hang forever.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>CVS server &amp;location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>serverLocationEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>serverLocationEdit</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>When Updating</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>createNewDirWhenUpdateCheck</cstring>
+ </property>
+ <property name="text">
+ <string>Create &amp;new directories (if any)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>pruneEmptyDirWhenUpdateCheck</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Prune empty directories</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>recursiveWhenUpdateCheck</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Update subdirectories too</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>When Committing/Removing</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>recursiveWhenCommitRemoveCheck</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Be recursive</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>When Creating Diffs</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>diffOptionsEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</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_diffLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Use these e&amp;xtra options:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>diffOptionsEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="1" column="1">
+ <property name="name">
+ <cstring>contextLinesInput</cstring>
+ </property>
+ <property name="value">
+ <number>3</number>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Con&amp;text lines:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>contextLinesInput</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<includes>
+ <include location="global" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="6" margin="11"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/cvsservice/cvspart.cpp b/vcs/cvsservice/cvspart.cpp
new file mode 100644
index 00000000..9d885056
--- /dev/null
+++ b/vcs/cvsservice/cvspart.cpp
@@ -0,0 +1,780 @@
+/**************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#include "cvspart.h"
+
+#include <qdir.h>
+#include <qpopupmenu.h>
+#include <qwhatsthis.h>
+#include <qtimer.h>
+
+#include <kpopupmenu.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdialogbase.h>
+#include <kstandarddirs.h>
+#include <kaction.h>
+#include <kurl.h>
+#include <kapplication.h>
+#include <kmainwindow.h>
+// Because of KShellProcess::quote()
+#include <kprocess.h>
+#include <kiconloader.h>
+
+#include <dcopref.h>
+#include <repository_stub.h>
+#include <cvsservice_stub.h>
+#include <cvsjob_stub.h>
+
+#include <kparts/part.h>
+#include <kdevpartcontroller.h>
+#include <kdevgenericfactory.h>
+
+#include "kdevcore.h"
+#include "kdevmakefrontend.h"
+#include "kdevdifffrontend.h"
+#include "kdevappfrontend.h"
+#include "kdevplugininfo.h"
+#include "domutil.h"
+#include "kdevmainwindow.h"
+#include "kdevproject.h"
+#include "urlutil.h"
+
+#include "cvsform.h"
+#include "commitdlg.h"
+#include "checkoutdialog.h"
+#include "tagdialog.h"
+#include "cvsprocesswidget.h"
+#include "cvsoptions.h"
+#include "cvsoptionswidget.h"
+#include "cvspartimpl.h"
+#include "cvsdir.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Global vars
+///////////////////////////////////////////////////////////////////////////////
+
+// See createNewProject( const QString &) and slotProjectOpened()
+bool g_projectWasJustCreated = false;
+
+///////////////////////////////////////////////////////////////////////////////
+// Plugin factory
+///////////////////////////////////////////////////////////////////////////////
+
+static const KDevPluginInfo data("kdevcvsservice");
+typedef KDevGenericFactory<CvsServicePart> CvsFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevcvsservice, CvsFactory( data ) )
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsServicePart
+///////////////////////////////////////////////////////////////////////////////
+
+CvsServicePart::CvsServicePart( QObject *parent, const char *name, const QStringList & )
+ : KDevVersionControl( &data, parent,
+ name ? name : "CvsService" ),
+ actionCommit( 0 ), actionDiff( 0 ), actionLog( 0 ), actionAnnotate(0), actionAdd( 0 ),
+ actionAddBinary( 0 ), actionRemove( 0 ), actionUpdate( 0 ),
+ actionRemoveSticky( 0 ), actionEdit( 0 ), actionEditors(0), actionUnEdit(0),
+ actionAddToIgnoreList( 0 ), actionRemoveFromIgnoreList( 0 ),
+ actionTag( 0 ), actionUnTag( 0 ),
+ actionLogin( 0), actionLogout( 0 ),
+ m_impl( 0 )
+{
+ setInstance( CvsFactory::instance() );
+
+ m_impl = new CvsServicePartImpl( this );
+
+ // Load / store project configuration every time project is opened/closed
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+
+ QTimer::singleShot(0, this, SLOT(init()));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsServicePart::~CvsServicePart()
+{
+ delete m_cvsConfigurationForm;
+ delete m_impl;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::init()
+{
+ if ( !m_impl->m_widget ) return;
+
+ setupActions();
+
+ // Re-route our implementation signal for when check-out finishes to the standard signal
+ connect( m_impl, SIGNAL(checkoutFinished(QString)), SIGNAL(finishedFetching(QString)) );
+
+ // Context menu
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
+ this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
+
+ m_impl->m_widget->setIcon( UserIcon( "kdev_cvs", KIcon::DefaultState, CvsFactory::instance()) );
+ QWhatsThis::add( m_impl->processWidget(), i18n("<b>CVS</b><p>Concurrent Versions System operations window. Shows output of Cervisia CVS Service.") );
+ m_impl->processWidget()->setCaption(i18n("CvsService Output"));
+ mainWindow()->embedOutputView( m_impl->processWidget(), i18n("CvsService"), i18n("cvs output") );
+
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::setupActions()
+{
+ // This actions are used in the menubar: for context menu we build the
+ // context at runtime. See CvsServicePart::contextMenu().
+
+ actionCommit = new KAction( i18n("&Commit to Repository"), 0, this,
+ SLOT(slotActionCommit()), actionCollection(), "cvsservice_commit" );
+ actionCommit->setToolTip( i18n("Commit file(s)") );
+ actionCommit->setWhatsThis( i18n("<b>Commit file(s)</b><p>Commits file to repository if modified.") );
+
+ actionDiff = new KAction( i18n("&Difference Between Revisions"), 0, this, SLOT(slotActionDiff()),
+ actionCollection(), "cvsservice_diff" );
+ actionDiff->setToolTip( i18n("Build difference") );
+ actionDiff->setWhatsThis( i18n("<b>Build difference</b><p>Builds difference between releases.") );
+
+ actionLog = new KAction( i18n("Generate &Log"), 0, this, SLOT(slotActionLog()),
+ actionCollection(), "cvsservice_log" );
+ actionLog->setToolTip( i18n("Generate log") );
+ actionLog->setWhatsThis( i18n("<b>Generate log</b><p>Produces log for this file.") );
+
+ actionAnnotate = new KAction( i18n("&Annotate"), 0, this, SLOT(slotActionAnnotate()),
+ actionCollection(), "cvsservice_annotate" );
+ actionAnnotate->setToolTip( i18n("Generate annotations") );
+ actionAnnotate->setWhatsThis( i18n("<b>Annotate</b><p>Produces annotations for this file.") );
+
+ actionAdd = new KAction( i18n("&Add to Repository"), 0, this, SLOT(slotActionAdd()),
+ actionCollection(), "cvsservice_add" );
+ actionAdd->setToolTip( i18n("Add file to repository") );
+ actionAdd->setWhatsThis( i18n("<b>Add to repository</b><p>Adds file to repository.") );
+
+ actionEdit = new KAction( i18n("&Edit Files"), 0, this, SLOT(slotActionEdit()),
+ actionCollection(), "cvsservice_edit" );
+ actionEdit->setToolTip( i18n("Mark as being edited") );
+ actionEdit->setWhatsThis( i18n("<b>Mark as being edited</b><p>Mark the files as being edited.") );
+
+ actionUnEdit = new KAction( i18n("&Unedit Files"), 0, this, SLOT(slotActionUnEdit()),
+ actionCollection(), "cvsservice_unedit" );
+ actionUnEdit->setToolTip( i18n("Remove editing mark from files") );
+ actionUnEdit->setWhatsThis( i18n("<b>Remove editing mark</b><p>Remove the editing mark from the files.") );
+
+ actionEditors = new KAction( i18n("&Show Editors"), 0, this, SLOT(slotActionEditors()),
+ actionCollection(), "cvsservice_editors" );
+ actionEditors->setToolTip( i18n("Show editors") );
+ actionEditors->setWhatsThis( i18n("<b>Show editors</b><p>Shows the list of users who are editing files.") );
+
+ actionAddBinary = new KAction( i18n("Add to Repository as &Binary"), 0, this,
+ SLOT(slotActionAddBinary()), actionCollection(), "cvsservice_add_bin" );
+ actionAddBinary->setToolTip( i18n("Add file to repository as binary") );
+ actionAddBinary->setWhatsThis( i18n("<b>Add to repository as binary</b><p>Adds file to repository as binary (-kb option).") );
+
+ actionRemove = new KAction( i18n("&Remove From Repository"), 0, this,
+ SLOT(slotActionRemove()), actionCollection(), "cvsservice_remove" );
+ actionRemove->setToolTip( i18n("Remove from repository") );
+ actionRemove->setWhatsThis( i18n("<b>Remove from repository</b><p>Removes file(s) from repository.") );
+
+ actionUpdate = new KAction( i18n("&Update/Revert to Another Release"), 0, this,
+ SLOT(slotActionUpdate()), actionCollection(), "cvsservice_update" );
+ actionUpdate->setToolTip( i18n("Update/revert") );
+ actionUpdate->setWhatsThis( i18n("<b>Update/revert to another release</b><p>Updates/reverts file(s) to another release.") );
+
+ actionRemoveSticky = new KAction( i18n("R&emove Sticky Flag"), 0,
+ this, SLOT(slotActionRemoveSticky()), actionCollection(), "cvsservice_removesticky" );
+ actionRemoveSticky->setToolTip( i18n("Remove sticky flag") );
+ actionRemoveSticky->setWhatsThis( i18n("<b>Remove sticky flag</b><p>Removes sticky flag from file(s).") );
+
+ actionTag = new KAction( i18n("Make &Tag/Branch"), 0,
+ this, SLOT(slotActionTag()), actionCollection(), "cvsservice_tag" );
+ actionTag->setToolTip( i18n("Make tag/branch") );
+ actionTag->setWhatsThis( i18n("<b>Make tag/branch</b><p>Tags/branches selected file(s).") );
+
+ actionUnTag = new KAction( i18n("&Delete Tag"), 0,
+ this, SLOT(slotActionUnTag()), actionCollection(), "cvsservice_untag" );
+ actionUnTag->setToolTip( i18n("Delete tag") );
+ actionUnTag->setWhatsThis( i18n("<b>Delete tag</b><p>Delete tag from selected file(s).") );
+
+ actionAddToIgnoreList = new KAction( i18n("&Ignore in CVS Operations"), 0,
+ this, SLOT(slotActionAddToIgnoreList()), actionCollection(), "cvsservice_ignore" );
+ actionAddToIgnoreList->setToolTip( i18n("Ignore in CVS operations") );
+ actionAddToIgnoreList->setWhatsThis( i18n("<b>Ignore in CVS operations</b><p>Ignore file(s) by adding it to .cvsignore file.") );
+
+ actionRemoveFromIgnoreList = new KAction( i18n("Do &Not Ignore in CVS Operations"), 0,
+ this, SLOT(slotActionRemoveFromIgnoreList()), actionCollection(), "cvsservice_donot_ignore" );
+ actionRemoveFromIgnoreList->setToolTip( i18n("Do not ignore in CVS operations") );
+ actionRemoveFromIgnoreList->setWhatsThis( i18n("<b>Do not ignore in CVS operations</b><p>Do not ignore file(s) by removing\nit from .cvsignore file.") );
+
+ actionLogin = new KAction( i18n("&Log to Server"), 0, this,
+ SLOT(slotActionLogin()), actionCollection(), "cvsservice_login" );
+ actionLogin->setToolTip( i18n("Login to server") );
+ actionLogin->setWhatsThis( i18n("<b>Login to server</b><p>Logs in to the CVS server.") );
+
+ actionLogout = new KAction( i18n("L&ogout From Server"), 0, this,
+ SLOT(slotActionLogout()), actionCollection(), "cvsservice_logout" );
+ actionLogout->setToolTip( i18n("Logout from server") );
+ actionLogout->setWhatsThis( i18n("<b>Logout from server</b><p>Logs out from the CVS server.") );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePart::fetchFromRepository()
+{
+ return m_impl->checkout();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevVCSFileInfoProvider *CvsServicePart::fileInfoProvider() const
+{
+ return m_impl->fileInfoProvider();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::createNewProject( const QString &dirName )
+{
+ kdDebug( 9006 ) << "====> CvsServicePart::createNewProject( const QString& )" << endl;
+
+ if (!m_cvsConfigurationForm)
+ return;
+
+ /// \FIXME actually there is no way to inform that a _new_ ("just created")
+ // project has been opened because projectOpened() is emitted after the project
+ // has been created :-/ So the only way to inform that slotProjectOpened() to not
+ // load default settings (overriding the CvsOptions instance is to set this flag
+ // here ...
+ g_projectWasJustCreated = true;
+
+ m_impl->createNewProject( dirName,
+ m_cvsConfigurationForm->cvsRsh(), m_cvsConfigurationForm->location(),
+ m_cvsConfigurationForm->message(), m_cvsConfigurationForm->module(),
+ m_cvsConfigurationForm->vendor(), m_cvsConfigurationForm->release(),
+ m_cvsConfigurationForm->mustInitRoot()
+ );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::projectConfigWidget( KDialogBase *dlg )
+{
+ QVBox *vbox = dlg->addVBoxPage( i18n("CvsService"), i18n("CvsService"), BarIcon( info()->icon(), KIcon::SizeMedium) );
+ CvsOptionsWidget *w = new CvsOptionsWidget( (QWidget *)vbox, "cvs config widget" );
+ connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QWidget* CvsServicePart::newProjectWidget( QWidget *parent )
+{
+ m_cvsConfigurationForm = new CvsForm( parent, "cvsform" );
+ return m_cvsConfigurationForm;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::contextMenu( QPopupMenu *popup, const Context *context )
+{
+ kdDebug(9006) << "contextMenu()" << endl;
+ if (context->hasType( Context::FileContext ) ||
+ context->hasType( Context::EditorContext ))
+ {
+
+ if (context->hasType( Context::FileContext ))
+ {
+ kdDebug(9006) << "Requested for a FileContext" << endl;
+ const FileContext *fcontext = static_cast<const FileContext*>( context );
+ m_urls = fcontext->urls();
+ }
+ else
+ {
+ kdDebug(9006) << "Requested for an EditorContext" << endl;
+ const EditorContext *editorContext = static_cast<const EditorContext*>( context );
+// m_urls << editorContext->url(); // this can't be right?
+ m_urls = editorContext->url();
+ }
+ // THis stuff should end up into prepareOperation()
+ URLUtil::dump( m_urls );
+ if (m_urls.count() <= 0)
+ return;
+
+ KPopupMenu *subMenu = new KPopupMenu( popup );
+ if (context->hasType( Context::FileContext ))
+ popup->insertSeparator();
+
+ int id = subMenu->insertItem( actionCommit->text(), this, SLOT(slotCommit()) );
+ subMenu->setWhatsThis(id, i18n("<b>Commit file(s)</b><p>Commits file to repository if modified."));
+ // CvsService let to do log and diff operations only on one file (or directory) at time
+ if (m_urls.count() == 1)
+ {
+ id = subMenu->insertItem( actionDiff->text(), this, SLOT(slotDiff()) );
+ subMenu->setWhatsThis(id, i18n("<b>Build difference</b><p>Builds difference between releases."));
+ id = subMenu->insertItem( actionLog->text(), this, SLOT(slotLog()) );
+ subMenu->setWhatsThis(id, i18n("<b>Generate log</b><p>Produces log for this file."));
+ id = subMenu->insertItem( actionAnnotate->text(), this, SLOT(slotAnnotate()) );
+ subMenu->setWhatsThis(id, i18n("<b>Generate Annotate</b><p>Produces annotation output for this file."));
+ }
+ id = subMenu->insertItem( actionEditors->text(), this, SLOT(slotEditors()) );
+ subMenu->setWhatsThis(id, i18n("<b>Show editors</b><p>Shows the list of users who are editing files."));
+ id = subMenu->insertItem( actionEdit->text(), this, SLOT(slotEdit()) );
+ subMenu->setWhatsThis(id, i18n("<b>Mark as beeing edited</b><p>Mark the files as beeing edited."));
+ id = subMenu->insertItem( actionUnEdit->text(), this, SLOT(slotUnEdit()) );
+ subMenu->setWhatsThis(id, i18n("<b>Remove editing mark</b><p>Remove the editing mark from the files."));
+ id = subMenu->insertItem( actionAdd->text(), this, SLOT(slotAdd()) );
+ subMenu->setWhatsThis(id, i18n("<b>Add to repository</b><p>Adds file to repository."));
+ id = subMenu->insertItem( actionAddBinary->text(), this, SLOT(slotAddBinary()) );
+ subMenu->setWhatsThis(id, i18n("<b>Add to repository as binary</b><p>Adds file to repository as binary (-kb option)."));
+ id = subMenu->insertItem( actionRemove->text(), this, SLOT(slotRemove()) );
+ subMenu->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Removes file(s) from repository."));
+
+ subMenu->insertSeparator();
+ id = subMenu->insertItem( actionTag->text(), this, SLOT(slotTag()) );
+ subMenu->setWhatsThis(id, i18n("<b>Make tag/branch</b><p>Tags/branches selected file(s)."));
+ id = subMenu->insertItem( actionUnTag->text(), this, SLOT(slotUnTag()) );
+ subMenu->setWhatsThis(id, i18n("<b>Delete tag</b><p>Delete tag from selected file(s)."));
+ id = subMenu->insertItem( actionUpdate->text(), this, SLOT(slotUpdate()) );
+ subMenu->setWhatsThis(id, i18n("<b>Update/revert to another release</b><p>Updates/reverts file(s) to another release."));
+ id = subMenu->insertItem( actionRemoveSticky->text(), this, SLOT(slotRemoveSticky()) );
+ subMenu->setWhatsThis(id, i18n("<b>Remove sticky flag</b><p>Removes sticky flag from file(s)."));
+
+ subMenu->insertSeparator();
+ id = subMenu->insertItem( actionAddToIgnoreList->text(), this, SLOT(slotAddToIgnoreList()) );
+ subMenu->setWhatsThis(id, i18n("<b>Ignore in CVS operations</b><p>Ignore file(s) by adding it to .cvsignore file."));
+ id = subMenu->insertItem( actionRemoveFromIgnoreList->text(), this, SLOT(slotRemoveFromIgnoreList()) );
+ subMenu->setWhatsThis(id, i18n("<b>Do not ignore in CVS operations</b><p>Do not ignore file(s) by removing\nit from .cvsignore file."));
+
+ // Now insert in parent menu
+ popup->insertItem( i18n("CvsService"), subMenu );
+
+ // If the current project doesn't support CVS, we don't
+ // want to confuse the user with a CVS popup menu.
+ if( !project() || !isValidDirectory( project()->projectDirectory() ) )
+ {
+ subMenu->setEnabled( false );
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePart::urlFocusedDocument( KURL &url )
+{
+ kdDebug(9006) << "CvsServicePartImpl::retrieveUrlFocusedDocument() here!" << endl;
+ KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*>( partController()->activePart() );
+ if ( part )
+ {
+ if (part->url().isLocalFile() )
+ {
+ url = part->url();
+ return true;
+ }
+ else
+ {
+ kdDebug(9006) << "Cannot handle non-local files!" << endl;
+ }
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePart::isValidDirectory( const QString &dirPath ) const
+{
+ return m_impl->isValidDirectory( dirPath );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionLogin()
+{
+ m_impl->login();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionLogout()
+{
+ m_impl->logout();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionCommit()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->commit( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionUpdate()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->update( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionAdd()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->add( currDocument, false );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionAnnotate()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->annotate( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionEdit()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->edit( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionEditors()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->editors( currDocument );
+ }
+}
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionUnEdit()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->unedit( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionAddBinary()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->add( currDocument, true );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionRemove()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->remove( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionRemoveSticky()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->removeStickyFlag( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionLog()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->log( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionDiff()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->diff( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionTag()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->tag( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionUnTag()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->unTag( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionAddToIgnoreList()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->addToIgnoreList( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotActionRemoveFromIgnoreList()
+{
+ KURL currDocument;
+ if (urlFocusedDocument( currDocument ))
+ {
+ m_impl->removeFromIgnoreList( currDocument );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotCommit()
+{
+ m_impl->commit( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotUpdate()
+{
+ m_impl->update( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotAdd()
+{
+ m_impl->add( m_urls, false );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotAnnotate()
+{
+ m_impl->annotate( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotEdit()
+{
+ m_impl->edit( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotUnEdit()
+{
+ m_impl->unedit( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotEditors()
+{
+ m_impl->editors( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotAddBinary()
+{
+ m_impl->add( m_urls, true );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotRemove()
+{
+ m_impl->remove( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotRemoveSticky()
+{
+ m_impl->removeStickyFlag( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotLog()
+{
+ m_impl->log( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotDiff()
+{
+ m_impl->diff( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotTag()
+{
+ m_impl->tag( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotUnTag()
+{
+ m_impl->unTag( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotAddToIgnoreList()
+{
+ m_impl->addToIgnoreList( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotRemoveFromIgnoreList()
+{
+ m_impl->removeFromIgnoreList( m_urls );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotStopButtonClicked( KDevPlugin* which )
+{
+ if ( which != 0 && which != this )
+ return;
+
+ m_impl->flushJobs();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotAddFilesToProject( const QStringList &filesToAdd )
+{
+ m_impl->addFilesToProject( filesToAdd );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotRemovedFilesFromProject(const QStringList &fileToRemove)
+{
+ m_impl->removedFilesFromProject( fileToRemove );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotProjectOpened()
+{
+ kdDebug(9006) << "CvsServicePart::slotProjectOpened() here!" << endl;
+
+ // Avoid bothering the user if this project has no support for CVS
+ if (!isValidDirectory( project()->projectDirectory() ))
+ {
+ kdDebug(9006) << "Project has no CVS Support: too bad!! :-(" << endl;
+ return;
+ }
+
+ CvsOptions *options = CvsOptions::instance();
+
+ // If createNewProject() has set this var then we have to get it.
+ if (g_projectWasJustCreated)
+ {
+ options->save( project() );
+ g_projectWasJustCreated = false;
+ }
+ options->load( project() );
+
+ // When files are added to project they may be added to/removed from repository too
+ connect( project(), SIGNAL(addedFilesToProject(const QStringList&)), this, SLOT(slotAddFilesToProject(const QStringList &)) );
+ connect( project(), SIGNAL(removedFilesFromProject(const QStringList&)), this, SLOT(slotRemovedFilesFromProject(const QStringList &)) );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePart::slotProjectClosed()
+{
+ kdDebug(9006) << "CvsServicePart::slotProjectClosed() here!" << endl;
+
+ // Avoid bothering the user if this project has no support for CVS
+ if (!isValidDirectory( project()->projectDirectory() ))
+ {
+ kdDebug(9006) << "Project had no CVS Support: too bad!! :-(" << endl;
+ return;
+ }
+
+ CvsOptions *options = CvsOptions::instance();
+ options->save( project() );
+ delete options;
+
+ // We don't have a project anymore ...
+ disconnect( project(), SIGNAL(addedFilesToProject(const QStringList&)), this, SLOT(slotAddFilesToProject(const QStringList &)) );
+ disconnect( project(), SIGNAL(removedFilesFromProject(const QStringList&)), this, SLOT(slotRemovedFilesFromProject(const QStringList &)) );
+}
+
+#include "cvspart.moc"
+
diff --git a/vcs/cvsservice/cvspart.h b/vcs/cvsservice/cvspart.h
new file mode 100644
index 00000000..e3513a98
--- /dev/null
+++ b/vcs/cvsservice/cvspart.h
@@ -0,0 +1,173 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CVSPART_H_
+#define _CVSPART_H_
+
+#include <qguardedptr.h>
+#include <qcstring.h>
+#include <kurl.h>
+#include "kdevversioncontrol.h"
+
+class Context;
+class QPopupMenu;
+class QDir;
+class KDialogBase;
+class KURL;
+class KURL::List;
+class KAction;
+
+class CvsProcessWidget;
+class CvsForm;
+class CheckoutDialog;
+
+class CvsService_stub;
+class Repository_stub;
+class CvsServicePartImpl;
+
+class CvsServicePart : public KDevVersionControl
+{
+ Q_OBJECT
+
+ friend class CvsServicePartImpl;
+
+public:
+ //! Standard constructor.
+ CvsServicePart( QObject *parent, const char *name, const QStringList & );
+ //! Destructor.
+ virtual ~CvsServicePart();
+
+ /**
+ * Returns the configuration widget (for properly configuring the project to
+ * use CVS), child of @p parent.
+ */
+ virtual QWidget *newProjectWidget( QWidget *parent );
+ /**
+ * Setup a directory tree for use with CVS.
+ */
+ virtual void createNewProject( const QString& dir );
+ /**
+ * Fetch a module from remote repository, so it can be used for importing
+ */
+ virtual bool fetchFromRepository();
+ /**
+ * @return the info provider for VCS sandboxes
+ */
+ virtual KDevVCSFileInfoProvider *fileInfoProvider() const;
+ /**
+ * @param dirPath absolute path of the directory
+ * @return true if the the directory is a valid CVS sandbox
+ */
+ virtual bool isValidDirectory( const QString &dirPath ) const;
+
+private slots:
+ /** Add menu items binded to cvs operations' slots to @p popup, using
+ * data in @p context.
+ * Not that @p context _must_ be FileContext-type, otherwise will do
+ * nothing.
+ */
+ void contextMenu( QPopupMenu *popup, const Context *context );
+
+ // Cvs operations (menubar)
+ void slotActionLogin();
+ void slotActionLogout();
+
+ void slotActionCommit();
+ void slotActionUpdate();
+ void slotActionEditors();
+ void slotActionEdit();
+ void slotActionUnEdit();
+ void slotActionAdd();
+ void slotActionAnnotate();
+ void slotActionAddBinary();
+ void slotActionRemove();
+ void slotActionRemoveSticky();
+ void slotActionLog();
+ void slotActionDiff();
+ void slotActionTag();
+ void slotActionUnTag();
+ void slotActionAddToIgnoreList();
+ void slotActionRemoveFromIgnoreList();
+
+ // Cvs operations (context menu)
+ void slotCommit();
+ void slotUpdate();
+ void slotEditors();
+ void slotEdit();
+ void slotUnEdit();
+ void slotAdd();
+ void slotAnnotate();
+ void slotAddBinary();
+ void slotRemove();
+ void slotRemoveSticky();
+ void slotLog();
+ void slotDiff();
+ void slotTag();
+ void slotUnTag();
+ void slotAddToIgnoreList();
+ void slotRemoveFromIgnoreList();
+
+ void slotProjectOpened();
+ void slotProjectClosed();
+
+ void slotAddFilesToProject(const QStringList &);
+ void slotRemovedFilesFromProject(const QStringList &);
+
+ /** Adds a configuration widget (for properly configuring CVS command-line options)
+ * and adds it to @p dlg.
+ */
+ void projectConfigWidget( KDialogBase *dlg );
+
+ //! Called when the user wishes to stop an operation.
+ void slotStopButtonClicked( KDevPlugin* );
+
+private slots:
+ void init();
+
+private:
+ void setupActions();
+ //! Returns the KURL for the currently focused document, if there is any
+ bool urlFocusedDocument( KURL &url );
+
+ //! A list of KURLs of the files to be "operated" on (to be committed, added, removed, ...)
+ KURL::List m_urls;
+
+ /** This is a pointer to the d->form used for collecting data about CVS project creation (used
+ * by the ApplicationWizard in example)
+ */
+ QGuardedPtr<CvsForm> m_cvsConfigurationForm;
+
+ // Actions
+ KAction *actionCommit,
+ *actionDiff,
+ *actionLog,
+ *actionAnnotate,
+ *actionAdd,
+ *actionAddBinary,
+ *actionRemove,
+ *actionUpdate,
+ *actionRemoveSticky,
+ *actionEdit,
+ *actionEditors,
+ *actionUnEdit,
+ *actionAddToIgnoreList,
+ *actionRemoveFromIgnoreList,
+ *actionTag,
+ *actionUnTag,
+ *actionLogin,
+ *actionLogout;
+
+ CvsServicePartImpl *m_impl;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvspartimpl.cpp b/vcs/cvsservice/cvspartimpl.cpp
new file mode 100644
index 00000000..e6177739
--- /dev/null
+++ b/vcs/cvsservice/cvspartimpl.cpp
@@ -0,0 +1,1012 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qfile.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include<qcheckbox.h>
+
+#include <kapplication.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <kdeversion.h>
+#include <klocale.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <kmainwindow.h>
+#include <dcopref.h>
+// CvsService stuff
+#include <repository_stub.h>
+#include <cvsservice_stub.h>
+#include <cvsjob_stub.h>
+// KDevelop SDK stuff
+#include <urlutil.h>
+#include <kdevproject.h>
+#include <kdevmainwindow.h>
+#include <kdevcore.h>
+#include <kdevdifffrontend.h>
+#include <kdevmakefrontend.h>
+#include <kdevpartcontroller.h>
+// Part's widgets
+#include "cvsprocesswidget.h"
+#include "checkoutdialog.h"
+#include "commitdlg.h"
+#include "tagdialog.h"
+#include "diffdialog.h"
+#include "releaseinputdialog.h"
+#include "cvslogdialog.h"
+#include "editorsdialog.h"
+#include "annotatedialog.h"
+
+#include "changelog.h"
+#include "cvsoptions.h"
+#include "cvsdir.h"
+#include "cvsentry.h"
+#include "jobscheduler.h"
+#include "cvsfileinfoprovider.h"
+
+#include "cvspart.h"
+#include "cvspartimpl.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class Constants
+///////////////////////////////////////////////////////////////////////////////
+
+// Nice name (relative to projectDirectory()) ;-)
+const QString CvsServicePartImpl::changeLogFileName( "ChangeLog" );
+// Four spaces for every log line (except the first, which includes the
+// developers name)
+const QString CvsServicePartImpl::changeLogPrependString( " " );
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsServicePartImpl
+///////////////////////////////////////////////////////////////////////////////
+
+CvsServicePartImpl::CvsServicePartImpl( CvsServicePart *part, const char *name )
+ : QObject( this, name? name : "cvspartimpl" ),
+ m_scheduler( 0 ), m_part( part ), m_widget( 0 )
+{
+ if (requestCvsService())
+ {
+ m_widget = new CvsProcessWidget( m_cvsService, part, 0, "cvsprocesswidget" );
+ m_scheduler = new DirectScheduler( m_widget );
+ m_fileInfoProvider = new CVSFileInfoProvider( part, m_cvsService );
+
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ }
+ else
+ {
+ kdDebug(9006) << "CvsServicePartImpl::CvsServicePartImpl(): somebody kills me because"
+ "I could not request a valid CvsService!!!! :-((( " << endl;
+ }
+
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsServicePartImpl::~CvsServicePartImpl()
+{
+ if (processWidget())
+ {
+ // Inform toplevel, that the output view is gone
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+ }
+ delete m_scheduler;
+ //delete m_fileInfoProvider;
+ releaseCvsService();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePartImpl::prepareOperation( const KURL::List &someUrls, CvsOperation op )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ bool correctlySetup = (m_cvsService != 0) && (m_repository != 0);
+ if (!correctlySetup)
+ {
+ kdDebug(9006) << "DCOP CvsService is not available!!!" << endl;
+ return false;
+ }
+
+ KURL::List urls = someUrls;
+ URLUtil::dump( urls, "Requested CVS operation for: " );
+
+ if (!m_part->project())
+ {
+ kdDebug(9006) << k_funcinfo << "No project???" << endl;
+ KMessageBox::sorry( 0, i18n("Open a project first.\nOperation will be aborted.") );
+ return false;
+ }
+
+ if (m_widget->isAlreadyWorking())
+ {
+ if (KMessageBox::warningYesNo( 0,
+ i18n("Another CVS operation is executing: do you want to cancel it \n"
+ "and start this new one?"),
+ i18n("CVS: Operation Already Pending ")) == KMessageBox::Yes)
+ {
+ m_widget->cancelJob();
+ }
+ else // Operation canceled
+ {
+ kdDebug(9006) << k_funcinfo << "Operation canceled by user request" << endl;
+ return false;
+ }
+ }
+
+ validateURLs( projectDirectory(), urls, op );
+ if (urls.count() <= 0) // who knows? ;)
+ {
+ kdDebug(9006) << "CvsServicePartImpl::prepareOperation(): No valid document URL selected!!!" << endl;
+ KMessageBox::sorry( 0, i18n("None of the file(s) you selected seem to be valid for repository.") );
+ return false;
+ }
+
+ URLUtil::dump( urls );
+ // Save for later use
+ m_urlList = urls;
+ m_lastOperation = op;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::doneOperation( const KURL::List &/*someUrls*/, CvsOperation /*op*/ )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ // @ todo notify clients (filetree) about changed status?)
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+const KURL::List &CvsServicePartImpl::urlList() const
+{
+ return m_urlList;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList CvsServicePartImpl::fileList( bool relativeToProjectDir ) const
+{
+ if (relativeToProjectDir)
+ return URLUtil::toRelativePaths( projectDirectory(), urlList() );
+ else
+ return urlList().toStringList();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePartImpl::isRegisteredInRepository( const QString &projectDirectory, const KURL &url )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ // KURL::directory() is a bit tricky when used on file or _dir_ paths ;-)
+ KURL projectURL = KURL::fromPathOrURL( projectDirectory );
+ kdDebug(9006) << k_funcinfo << "projectURL = " << projectURL.url() << endl;
+ kdDebug(9006) << k_funcinfo << "url = " << url.url() << endl;
+
+ if ( projectURL == url)
+ {
+ CVSDir cvsdir = CVSDir( projectDirectory );
+ return cvsdir.isValid();
+ }
+ else
+ {
+ CVSDir cvsdir = CVSDir( url.directory() );
+
+ if (!cvsdir.isValid())
+ {
+ kdDebug(9006) << k_funcinfo << " Error: " << cvsdir.path() << " is not a valid CVS directory " << endl;
+ return false;
+ }
+ CVSEntry entry = cvsdir.fileStatus( url.fileName() );
+ return entry.isValid();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::validateURLs( const QString &projectDirectory, KURL::List &urls, CvsOperation op )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ // If files are to be added, we can avoid to check them to see if they are registered in the
+ // repository ;)
+ if (op == opAdd)
+ {
+ kdDebug(9006) << "This is a Cvs Add operation and will not be checked against repository ;-)" << endl;
+ return;
+ }
+ QValueList<KURL>::iterator it = urls.begin();
+ while (it != urls.end())
+ {
+ if (!CvsServicePartImpl::isRegisteredInRepository( projectDirectory, (*it) ))
+ {
+ kdDebug(9006) << "Warning: file " << (*it).path() << " does NOT belong to repository and will not be used" << endl;
+
+ it = urls.erase( it );
+ }
+ else
+ {
+ kdDebug(9006) << "Warning: file " << (*it).path() << " is in repository and will be accepted" << endl;
+
+ ++it;
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::addToIgnoreList( const QString &projectDirectory, const KURL &url )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if ( url.path() == projectDirectory )
+ {
+ kdDebug(9006) << "Can't add to ignore list current project directory " << endl;
+ return;
+ }
+
+ CVSDir cvsdir( url.directory() );
+ cvsdir.ignoreFile( url.fileName() );
+}
+
+void CvsServicePartImpl::addToIgnoreList( const QString &projectDirectory, const KURL::List &urls )
+{
+ for (size_t i=0; i<urls.count(); ++i)
+ {
+ addToIgnoreList( projectDirectory, urls[i] );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::removeFromIgnoreList( const QString &/*projectDirectory*/, const KURL &url )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ QStringList ignoreLines;
+
+ CVSDir cvsdir( url.directory() );
+ cvsdir.doNotIgnoreFile( url.fileName() );
+}
+
+void CvsServicePartImpl::removeFromIgnoreList( const QString &projectDirectory, const KURL::List &urls )
+{
+ for (size_t i=0; i<urls.count(); ++i)
+ {
+ removeFromIgnoreList( projectDirectory, urls[i] );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePartImpl::isValidDirectory( const QDir &dir ) const
+{
+ CVSDir cvsdir( dir );
+
+ return cvsdir.isValid();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsProcessWidget *CvsServicePartImpl::processWidget() const
+{
+ return m_widget;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevMainWindow *CvsServicePartImpl::mainWindow() const
+{
+ return m_part->mainWindow();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString CvsServicePartImpl::projectDirectory() const
+{
+ return m_part->project() ? m_part->project()->projectDirectory() : QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevCore *CvsServicePartImpl::core() const
+{
+ return m_part->core();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevDiffFrontend *CvsServicePartImpl::diffFrontend() const
+{
+ return m_part->extension<KDevDiffFrontend>("KDevelop/DiffFrontend");
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::login()
+{
+ DCOPRef job = m_cvsService->login( this->projectDirectory() );
+
+ m_scheduler->schedule( job );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::logout()
+{
+ DCOPRef job = m_cvsService->logout( this->projectDirectory() );
+
+ m_scheduler->schedule( job );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePartImpl::checkout()
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ CheckoutDialog dlg( m_cvsService, mainWindow()->main()->centralWidget() );
+
+ if ( dlg.exec() == QDialog::Accepted )
+ {
+ DCOPRef job = m_cvsService->checkout( dlg.workDir(), dlg.serverPath(),
+ dlg.module(), dlg.tag(), dlg.pruneDirs(), "", false
+ );
+ if (!m_cvsService->ok()) {
+ KMessageBox::sorry( mainWindow()->main(), i18n( "Unable to checkout" ) );
+ } else {
+ // Save the path for later retrieval since slotCheckoutFinished(bool,int)
+ // will use it for return the info to the caller.
+ modulePath = dlg.workDir() + dlg.module();
+
+ m_scheduler->schedule( job );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotCheckoutFinished(bool,int)) );
+ return true;
+ }
+ }
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::commit( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+ kdDebug(9006) << "Commit requested for " << urlList.count() << " file(s)." << endl;
+
+ if (!prepareOperation( urlList, opCommit ))
+ return;
+
+ CommitDialog dlg( projectDirectory() + "/ChangeLog" );
+ if (dlg.exec() == QDialog::Rejected)
+ return;
+
+ CvsOptions *options = CvsOptions::instance();
+ QString logString = dlg.logMessage().join( "\n" );
+
+ DCOPRef cvsJob = m_cvsService->commit( fileList(), logString, options->recursiveWhenCommitRemove() );
+ if (!m_cvsService->ok())
+ {
+ kdDebug( 9006 ) << "Commit of " << fileList().join( ", " ) << " failed!!!" << endl;
+ return;
+ }
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotJobFinished(bool,int)) );
+
+ // 2. if requested to do so, add an entry to the Changelog too
+ if (dlg.mustAddToChangeLog())
+ {
+ // 2.1 Modify the Changelog
+ ChangeLogEntry entry;
+ entry.addLines( dlg.logMessage() );
+ entry.addToLog( dlg.changeLogFileName() );
+
+ kdDebug( 9006 ) << " *** ChangeLog entry : " <<
+ entry.toString( changeLogPrependString ) << endl;
+ }
+
+ doneOperation( KURL::List( fileList() ), opCommit );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::update( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opCommit ))
+ return;
+
+ CvsOptions *options = CvsOptions::instance();
+ ReleaseInputDialog dlg( mainWindow()->main()->centralWidget() );
+ if (dlg.exec() == QDialog::Rejected)
+ return;
+
+ QString additionalOptions = dlg.release();
+ if (dlg.isRevert())
+ additionalOptions = additionalOptions + " " + options->revertOptions();
+
+ DCOPRef cvsJob = m_cvsService->update( fileList(),
+ options->recursiveWhenUpdate(),
+ options->createDirsWhenUpdate(),
+ options->pruneEmptyDirsWhenUpdate(),
+ additionalOptions );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::add( const KURL::List& urlList, bool binary )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opAdd ))
+ return;
+
+ DCOPRef cvsJob = m_cvsService->add( fileList(), binary );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::annotate( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opAnnotate ))
+ return;
+
+ //get the directory of the file we want to annotate
+ QString tagFilename = URLUtil::directory(projectDirectory()+"/"+fileList()[0]);
+ //CVS stores tag information in the ./CVS/Tag file
+ tagFilename += "/CVS/Tag";
+
+
+ //Check if such a Tag file exists, and try to read the tag/branch from it
+ QFile fileTag(tagFilename);
+ QString strRev = ""; //default revision is empty ...
+ if (fileTag.exists()) { //... but if there is a Tag file, we get the revision from there
+ if ( fileTag.open( IO_ReadOnly ) ) {
+ QTextStream stream( &fileTag );
+ QString line;
+ line = stream.readLine();
+ if (line.startsWith("T")) { //the line always starts with a "T"...
+ strRev = line.right(line.length()-1); //...and after this there is the tag name
+ kdDebug(9006) << "The found revision is: >>" << strRev << "<<" <<endl;
+ }
+ fileTag.close();
+ }
+ }
+
+ AnnotateDialog * f = new AnnotateDialog( m_cvsService );
+ f->show();
+ //the dialog will do all the work, just give him the file and the revision to start with
+ f->startFirstAnnotate( fileList()[0], strRev );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::unedit( const KURL::List& urlList)
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ int s = KMessageBox::questionYesNo( 0,
+ i18n("Do you really want to unedit the selected files?"),
+ i18n("CVS - Unedit Files"),
+ i18n("Unedit"),
+ i18n("Do Not Unedit"),
+ "askUneditingFiles" );
+ if (s == KMessageBox::No) {
+ return;
+ }
+
+ if (!prepareOperation( urlList, opUnEdit ))
+ return;
+
+ DCOPRef cvsJob = m_cvsService->unedit( fileList() );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::edit( const KURL::List& urlList)
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opEdit ))
+ return;
+
+ DCOPRef cvsJob = m_cvsService->edit( fileList() );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::editors( const KURL::List& urlList)
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opEditors ))
+ return;
+
+ EditorsDialog * f = new EditorsDialog( m_cvsService );
+ f->show();
+ //the dialog will do all the work
+ f->startjob( fileList()[0] );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::remove( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opRemove ))
+ return;
+
+ DCOPRef cvsJob = m_cvsService->remove( fileList(), true );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)),
+ this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::removeStickyFlag( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opUpdate ))
+ return;
+
+ CvsOptions *options = CvsOptions::instance();
+
+ DCOPRef cvsJob = m_cvsService->update( fileList(),
+ options->recursiveWhenUpdate(),
+ options->createDirsWhenUpdate(),
+ options->pruneEmptyDirsWhenUpdate(),
+ "-A" );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)),
+ this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::log( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opLog ))
+ return;
+
+ CVSLogDialog* f = new CVSLogDialog( m_cvsService );
+ f->show();
+ // Form will do all the work
+ f->startLog( projectDirectory(), fileList()[0] );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::diff( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opDiff ))
+ return;
+
+ CVSDir cvsdir = CVSDir( urlList[0].directory() );
+ CVSEntry entry = cvsdir.fileStatus( urlList[0].fileName() );
+
+ DiffDialog dlg(entry);
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ CvsOptions *options = CvsOptions::instance();
+ DCOPRef cvsJob = m_cvsService->diff( fileList()[0], dlg.revA(),
+ dlg.revB(), options->diffOptions(), options->contextLines() );
+ if (!m_cvsService->ok())
+ {
+ KMessageBox::sorry( 0, i18n("Sorry, cannot diff."),
+ i18n("Error During Diff") );
+ return;
+ }
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)),
+ this, SLOT(slotDiffFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::tag( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opTag ))
+ return;
+
+ TagDialog dlg( i18n("Creating Tag/Branch for files ..."),
+ mainWindow()->main()->centralWidget() );
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ DCOPRef cvsJob = m_cvsService->createTag( fileList(), dlg.tagName(),
+ dlg.isBranch(), dlg.force() );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)),
+ this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::unTag( const KURL::List& urlList )
+{
+ kdDebug(9006) << k_funcinfo << endl;
+
+ if (!prepareOperation( urlList, opUnTag ))
+ return;
+
+ TagDialog dlg( i18n("Removing Tag from files ..."),
+ mainWindow()->main()->centralWidget() );
+ dlg.tagAsBranchCheck->hide();
+ if (dlg.exec() != QDialog::Accepted)
+ return;
+
+ DCOPRef cvsJob = m_cvsService->deleteTag( fileList(), dlg.tagName(),
+ dlg.isBranch(), dlg.force() );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)),
+ this, SLOT(slotJobFinished(bool,int)) );
+
+ doneOperation();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::addToIgnoreList( const KURL::List& urlList )
+{
+ addToIgnoreList( projectDirectory(), urlList );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::removeFromIgnoreList( const KURL::List& urlList )
+{
+ removeFromIgnoreList( projectDirectory(), urlList );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+/**
+* \FIXME Current implementation doesn't use CvsService :-( I just ported the
+* old code which relies on buildcvs.sh script. [marios]
+*/
+void CvsServicePartImpl::createNewProject( const QString &dirName,
+ const QString &cvsRsh, const QString &location,
+ const QString &message, const QString &module, const QString &vendor,
+ const QString &release, bool mustInitRoot )
+{
+ kdDebug( 9006 ) << "====> CvsServicePartImpl::createNewProject( const QString& )" << endl;
+
+ CvsOptions *options = CvsOptions::instance();
+ options->setCvsRshEnvVar( cvsRsh );
+ options->setLocation( location );
+/*
+ //virtual DCOPRef import( const QString& workingDir, const QString& repository, const QString& module, const QString& ignoreList, const QString& comment, const
+ QString filesToIgnore;
+ DCOPRef cvsJob = m_cvsService->import( dirName, location, module, filesToIgnore, message, vendor, release, false );
+
+ m_scheduler->schedule( cvsJob );
+ connect( processWidget(), SIGNAL(jobFinished(bool,int)), this, SLOT(slotCheckoutFinished(bool,int)) );
+*/
+ QString rsh_preamble;
+ if ( !options->cvsRshEnvVar().isEmpty() )
+ rsh_preamble = "CVS_RSH=" + KShellProcess::quote( options->cvsRshEnvVar() );
+
+ QString init;
+ if (mustInitRoot)
+ {
+ init = rsh_preamble + " cvs -d " + KShellProcess::quote( options->location() ) + " init && ";
+ }
+ QString cmdLine = init + "cd " + KShellProcess::quote(dirName) +
+ " && " + rsh_preamble +
+ " cvs -d " + KShellProcess::quote(options->location()) +
+ " import -m " + KShellProcess::quote(message) + " " +
+ KShellProcess::quote(module) + " " +
+ KShellProcess::quote(vendor) + " " +
+ KShellProcess::quote(release) +
+ // CVS build-up magic here ...
+ " && sh " +
+ locate("data","kdevcvsservice/buildcvs.sh") + " . " +
+ KShellProcess::quote(module) + " " +
+ KShellProcess::quote(location);
+
+ kdDebug( 9006 ) << " ** Will run the following command: " << endl << cmdLine << endl;
+ kdDebug( 9006 ) << " ** on directory: " << dirName << endl;
+
+ if (KDevMakeFrontend *makeFrontend = m_part->extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand( dirName, cmdLine );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsServicePartImpl::requestCvsService()
+{
+ QCString appId;
+ QString error;
+
+ if (KApplication::startServiceByDesktopName( "cvsservice",
+ QStringList(), &error, &appId ))
+ {
+ QString msg = i18n( "Unable to find the Cervisia KPart. \n"
+ "Cervisia Integration will not be available. Please check your\n"
+ "Cervisia installation and re-try. Reason was:\n" ) + error;
+ KMessageBox::error( processWidget(), msg, "DCOP Error" );
+
+ return false;
+ }
+ else
+ {
+ m_cvsService = new CvsService_stub( appId, "CvsService" );
+ m_repository = new Repository_stub( appId, "CvsRepository" );
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::releaseCvsService()
+{
+ if (m_cvsService)
+ m_cvsService->quit();
+ delete m_cvsService;
+ m_cvsService = 0;
+ delete m_repository;
+ m_repository = 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::flushJobs()
+{
+ processWidget()->cancelJob();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::addFilesToProject( const QStringList &filesToAdd )
+{
+ kdDebug( 9006 ) << k_funcinfo << " " << filesToAdd << endl;
+
+ QStringList filesInCVS = checkFileListAgainstCVS( filesToAdd );
+ if (filesInCVS.isEmpty())
+ return;
+
+ kdDebug( 9006 ) << k_funcinfo << " " << filesInCVS << endl;
+
+ int s = KMessageBox::questionYesNo( 0,
+ i18n("Do you want the files to be added to CVS repository too?"),
+ i18n("CVS - New Files Added to Project"),
+ KStdGuiItem::add(),
+ i18n("Do Not Add"),
+ i18n("askWhenAddingNewFiles") );
+ if (s == KMessageBox::Yes)
+ {
+ kdDebug( 9006 ) << "Adding these files: " << filesInCVS.join( ", " ) << endl;
+
+ const KURL::List urls = KURL::List( filesInCVS );
+ URLUtil::dump( urls );
+ add( urls );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::removedFilesFromProject(const QStringList &filesToRemove)
+{
+ kdDebug( 9006 ) << k_funcinfo << endl;
+
+ QStringList filesInCVS = checkFileListAgainstCVS( filesToRemove );
+ if (filesInCVS.isEmpty())
+ return;
+
+ int s = KMessageBox::warningContinueCancel( 0,
+ i18n("Do you want them to be removed from CVS repository too?\nWarning: They will be removed from disk too."),
+ i18n("CVS - Files Removed From Project"),
+ KStdGuiItem::del(),
+ i18n("askWhenRemovingFiles") );
+
+ if (s == KMessageBox::Continue)
+ {
+ kdDebug( 9006 ) << "Removing these files: " << filesInCVS.join( ", " ) << endl;
+ const KURL::List urls = KURL::List( filesInCVS );
+ URLUtil::dump( urls );
+ remove( urls );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QStringList CvsServicePartImpl::checkFileListAgainstCVS( const QStringList &filesToCheck ) const
+{
+ QStringList filesInCVS;
+ for (QStringList::const_iterator it = filesToCheck.begin(); it != filesToCheck.end(); ++it )
+ {
+ const QString &fn = (*it);
+ QFileInfo fi( fn );
+ if (fi.isRelative())
+ fi = projectDirectory() + QDir::separator() + fn;
+ if (isValidDirectory( fi.dirPath( true ) ))
+ filesInCVS += ( fi.filePath() );
+ }
+
+ return filesInCVS;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::emitFileStateModified( const KURL::List &/*urls*/, VCSFileInfo::FileState &/*commonState*/ )
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+KDevVCSFileInfoProvider *CvsServicePartImpl::fileInfoProvider() const
+{
+ return m_fileInfoProvider;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// SLOTS here!
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::slotDiffFinished( bool normalExit, int exitStatus )
+{
+ core()->running( m_part, false );
+
+ QString diff = processWidget()->output().join("\n"),
+ err = processWidget()->errors().join("\n");
+
+ kdDebug( 9006 ) << "diff = " << diff << endl;
+ kdDebug( 9006 ) << "err = " << err << endl;
+
+ if (normalExit)
+ kdDebug( 9006 ) << " *** Process died nicely with exit status = " <<
+ exitStatus << endl;
+ else
+ kdDebug( 9999 ) << " *** Process was killed with exit status = " <<
+ exitStatus << endl;
+
+ // Now show a message about operation ending status
+ if (diff.isEmpty() && (exitStatus != 0))
+ {
+ KMessageBox::information( 0, i18n("Operation aborted (process killed)."),
+ i18n("CVS Diff") );
+ return;
+ }
+ if ( diff.isEmpty() && !err.isEmpty() )
+ {
+ KMessageBox::detailedError( 0, i18n("CVS outputted errors during diff."),
+ err, i18n("Errors During Diff") );
+ return;
+ }
+
+ if ( !err.isEmpty() )
+ {
+ int s = KMessageBox::warningContinueCancelList( 0,
+ i18n("CVS output errors during diff. Do you still want to continue?"),
+ QStringList::split( "\n", err, false ), i18n("Errors During Diff")
+ );
+ if ( s != KMessageBox::Continue )
+ return;
+ }
+
+ if ( diff.isEmpty() )
+ {
+ KMessageBox::information( 0, i18n("There is no difference to the repository."),
+ i18n("No Difference Found") );
+ return;
+ }
+
+ Q_ASSERT( diffFrontend() );
+ diffFrontend()->showDiff( diff );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::slotCheckoutFinished( bool exitStatus, int )
+{
+ kdDebug(9006) << "CvsServicePartImpl::slotCheckoutFinished(): job ended with status == "
+ << exitStatus << endl;
+ // Return a null string if the operation was not succesfull
+ if (!exitStatus)
+ modulePath = QString::null;
+
+ kdDebug(9006) << " I'll emit modulePath == " << modulePath << endl;
+
+ emit checkoutFinished( modulePath );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::slotJobFinished( bool /*exitStatus*/, int exitCode )
+{
+ // Return a null string if the operation was not succesfull
+ kdDebug(9006) << "CvsServicePartImpl::slotJobFinished(): job ended with code == "
+ << exitCode << endl;
+/*
+ // Operation has been successfull
+ if (!exitStatus)
+ return;
+
+ // 1. Assemble the CVSFileInfoList
+ // 2. notify all clients
+*/
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsServicePartImpl::slotProjectOpened()
+{
+ kdDebug(9006) << "CvsServicePartImpl::slotProjectOpened(): setting work directory to "
+ << projectDirectory() << endl;
+
+ if ( m_repository )
+ {
+ m_repository->setWorkingCopy( projectDirectory() );
+ }
+}
+
+
+#include "cvspartimpl.moc"
diff --git a/vcs/cvsservice/cvspartimpl.h b/vcs/cvsservice/cvspartimpl.h
new file mode 100644
index 00000000..e5087f68
--- /dev/null
+++ b/vcs/cvsservice/cvspartimpl.h
@@ -0,0 +1,354 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSPARTIMPL_H
+#define CVSPARTIMPL_H
+
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qguardedptr.h>
+#include <kurl.h>
+
+#include <kdevversioncontrol.h>
+
+class CvsServicePart;
+class KDialogBase;
+class KURL;
+class KURL::List;
+class CvsProcessWidget;
+class KDevMainWindow;
+class KDevCore;
+class KDevDiffFrontend;
+class QDir;
+class JobScheduler;
+class KDevVCSFileInfoProvider;
+class CVSFileInfoProvider;
+
+/**
+* @short This is the base class for implementation of the core service.
+*
+* This is an attempt to separate the container part (CvsServicePart) and its implementation
+* for reducing code complexity for module (cvspart.{h,cpp} was becoming too
+* cumbersome). So a CvsServicePart can have several implementations, one directly wrapping
+* 'cvs' command and another using cervisia's cvsservice.
+*
+* @author Mario Scalas
+*/
+class CvsServicePartImpl : public QObject
+{
+ friend class CvsServicePart;
+
+ Q_OBJECT
+public:
+ //! Available Cvs operations
+ enum CvsOperation
+ {
+ opFakeStub, opAdd, opCommit, opUpdate, opRevert, opRemove, opLog, opDiff, opTag, opUnTag, opEdit, opUnEdit, opEditors, opAnnotate
+ };
+
+ /**
+ * Costructor
+ * @param part the CvsServicePart component
+ * @param name
+ */
+ CvsServicePartImpl( CvsServicePart *part, const char *name=0 );
+ /**
+ * Destructor
+ */
+ virtual ~CvsServicePartImpl();
+
+ /**
+ * Do login into repository. The component will show a dialog requesting the
+ * needed data to the user.
+ */
+ virtual void login();
+ /**
+ * Do logout. Of course one must be logged into repository first ;-)
+ */
+ virtual void logout();
+ /**
+ * Do checkout of module from some remote directory. Requested data will be
+ * collected here.
+ * @return true if the operation was successful
+ */
+ virtual bool checkout();
+ /**
+ * Commit the specified files (as KURL) to repository.
+ * @param urlList
+ */
+ virtual void commit( const KURL::List& urlList );
+ /**
+ * Update the specified files (as KURL): files will be
+ * updated if not locally modified.
+ * @param urlList
+ */
+ virtual void update( const KURL::List& urlList );
+ /**
+ * Add the specified files (as KURL) to repository.
+ * @param urlList
+ * @param binary is the file binary or plain text
+ */
+ virtual void add( const KURL::List& urlList, bool binary = false );
+ /**
+ * Annotate the specified file (as KURL).
+ * @param urlList
+ */
+ virtual void annotate( const KURL::List& urlList);
+ /**
+ * Mark the specified files (as KURL) for beeing edited
+ * @param urlList
+ */
+ virtual void edit( const KURL::List& urlList );
+ /**
+ * Remove editing mark from the specified files (as KURL)
+ * @param urlList
+ */
+ virtual void unedit( const KURL::List& urlList );
+ /**
+ * Show list of editors for the specified files (as KURL)
+ * @param urlList
+ */
+ virtual void editors( const KURL::List& urlList );
+ /**
+ * Remove the specified files (as KURL) from repository.
+ * @param urlList
+ */
+ virtual void remove( const KURL::List& urlList );
+ /**
+ * Produce a log of changes about the specified files.
+ * @param urlList
+ */
+ virtual void log( const KURL::List& urlList );
+ /**
+ * Produce a diff of the the specified files (as KURL). The diff could
+ * be displayed in the diff frontend or in an ad-hoc container.
+ * @param urlList
+ */
+ virtual void diff( const KURL::List& urlList );
+ /**
+ * Tag the specified files (as KURL) with a release or branch tag.
+ * @param urlList
+ */
+ virtual void tag( const KURL::List& urlList );
+ /**
+ * Remove tag from the specified files (as KURL) in repository.
+ * @param urlList
+ */
+ virtual void unTag( const KURL::List& urlList );
+ /**
+ * Remove tag from the specified files (as KURL) in repository.
+ * @param urlList
+ */
+ virtual void removeStickyFlag( const KURL::List& urlList );
+ /**
+ * Add the specified files (as KURL) to the .cvsignore file.
+ * @param urlList
+ */
+ virtual void addToIgnoreList( const KURL::List& urlList );
+ /**
+ * Commit the specified files (as KURL) to repository.
+ * @param urlList
+ */
+ virtual void removeFromIgnoreList( const KURL::List& urlList );
+ /**
+ * Creates a new project with cvs support, that is will import the
+ * generated sources in the repository.
+ * @param dirName path to project directory on local system
+ * @param cvsRsh value for the CVS_RSH env var (for accessing :ext:
+ * repositories)
+ * @param location cvs server path (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ * @param message an initial creation message for the project
+ * @param module the module into repository where to put this source tree
+ * @param vendor vendor string
+ * @param release release tag
+ * @param mustInitRoot if true will attempt to initialize $CVSROOT if not already prepared
+ */
+ virtual void createNewProject( const QString &dirName,
+ const QString &cvsRsh, const QString &location,
+ const QString &message, const QString &module, const QString &vendor,
+ const QString &release, bool mustInitRoot );
+
+ /**
+ * @return true if the directory is valid as CVS directory (has the /CVS/ dir inside) (FORWARDER)
+ */
+ virtual bool isValidDirectory( const QDir &dir ) const;
+ /**
+ * @return a reference to the custom FileInforProvider object (FORWARDER)
+ */
+ KDevVCSFileInfoProvider *fileInfoProvider() const;
+
+
+// Helpers
+public:
+ /**
+ * Stops the CVS job, both currently executing and queued.
+ * @todo queuing is not yet implemented
+ */
+ void flushJobs();
+ /**
+ * @return a reference to the process widget: many worker methods
+ * display their output in it and the CvsServicePart will embed it in the
+ * bottom embedded view.
+ */
+ CvsProcessWidget *processWidget() const;
+
+signals:
+ void warning( const QString &msg );
+ /**
+ * Emitted when the component has terminated checkout operation
+ * @param checkedDir directory where the module has been checked out
+ * (will be empty if the operation failed)
+ */
+ void checkoutFinished( QString checkedDir );
+
+private slots:
+ void slotJobFinished( bool normalExit, int exitStatus );
+ void slotDiffFinished( bool normalExit, int exitStatus );
+ void slotCheckoutFinished( bool normalExit, int exitStatus );
+ void slotProjectOpened();
+
+private:
+ /**
+ * Call this every time a slot for cvs operations starts!! (It will setup the
+ * state (file/dir URL, ...).
+ * It will also display proper error messages so the caller must only exit if
+ * it fails (return false); if return true than basic requisites for cvs operation
+ * are satisfied.
+ * @return true and the valid URLs paths in m_fileList if the operation can be performed,
+ * false otherwise.
+ */
+ bool prepareOperation( const KURL::List &someUrls, CvsOperation op );
+ /**
+ * Call this every time a slot for cvs operations ends!! (It will restore the state for a new
+ * operation) and notify clients about changes.
+ */
+ void doneOperation( const KURL::List &someUrls = KURL::List(), CvsOperation op = opFakeStub );
+
+ void emitFileStateModified( const KURL::List &urls, VCSFileInfo::FileState &commonState );
+
+ /**
+ * @return true if the @p url is present in CVS/Entry file
+ */
+ static bool isRegisteredInRepository( const QString &projectDirectory, const KURL &url );
+ /**
+ * Ideally this function will take a bunch of URLs and validate them (they are valid files,
+ * are files registered in CVS, are on a supported filesystem, ...). Currently checks
+ * only for files belonging to the repository ;)
+ * @param projectDirectory
+ * @param urls list of KURL to check (the list can be modified during the operation)
+ * @param op type of cvs operation, as pecified in @see CvsOperation enum
+ */
+ static void validateURLs( const QString &projectDirectory, KURL::List &urls, CvsOperation op );
+
+ /**
+ * Add file to it's respective ignore list. This means that, for example, if you
+ * add '/home/mario/src/myprj/mylib/module1/bad.cpp' then the string 'bad.cpp' will be
+ * appended to file '/home/mario/src/myprj/mylib/module1/.cvsignore'.
+ * @param projectDirectory
+ * @param url url to be added to the check list.
+ */
+ static void addToIgnoreList( const QString &projectDirectory, const KURL &url );
+
+ /**
+ * Add files to their respective ignore list. This means that, for example, if you
+ * add '/home/mario/src/myprj/mylib/module1/bad.cpp' then the string 'bad.cpp' will be
+ * appended to file '/home/mario/src/myprj/mylib/module1/.cvsignore'.
+ * @param projectDirectory
+ * @param urls list of urls to be added to the check list.
+ */
+ static void addToIgnoreList( const QString &projectDirectory, const KURL::List &urls );
+
+ /**
+ * Remove file from it's respective .ignore files. As specified for @see addToIgnoreList
+ * function, this means that, for example, if you remove '/home/mario/src/myprj/mylib/module1/bad.cpp'
+ * then a search for the string 'bad.cpp' will be performed on file
+ * '/home/mario/src/myprj/mylib/module1/.cvsignore': if found, it will be removed, otherwise
+ * nothing will be removed.
+ * @param projectDirectory
+ * @param url url to be removed from the check list.
+ */
+ static void removeFromIgnoreList( const QString &projectDirectory, const KURL &url );
+
+ /**
+ * Remove files from their respective .ignore files. As specified for @see addToIgnoreList
+ * function, this means that, for example, if you remove '/home/mario/src/myprj/mylib/module1/bad.cpp'
+ * then a search for the string 'bad.cpp' will be performed on file
+ * '/home/mario/src/myprj/mylib/module1/.cvsignore': if found, it will be removed, otherwise
+ * nothing will be removed.
+ * @param projectDirectory
+ * @param urls list of urls to be removed from the check list.
+ */
+ static void removeFromIgnoreList( const QString &projectDirectory, const KURL::List &urls );
+ /**
+ * Implementation for requesting user input when files are added to project
+ */
+ void addFilesToProject( const QStringList &filesToAdd );
+ /**
+ * Implementation for requesting user input when files are removed from project
+ */
+ void removedFilesFromProject(const QStringList &filesToRemove);
+ /**
+ * Check each file in the list against CVS and returns a new list with the files
+ * currently registered in the repository: if none is registered the returned list
+ * is (quite rightly) empty.
+ */
+ QStringList checkFileListAgainstCVS( const QStringList &filesToCheck ) const;
+
+ //! Changelog filename (currently "CHANGELOG" )
+ static const QString changeLogFileName;
+ //! Four spaces for every log line (except the first which includes the
+ //! developers name)
+ static const QString changeLogPrependString;
+
+ // Internal short-cuts
+ KDevMainWindow *mainWindow() const;
+ KDevCore *core() const;
+ QString projectDirectory() const;
+ KDevDiffFrontend *diffFrontend() const;
+
+ /** Locate and setup DCOP CvsService */
+ bool requestCvsService();
+ /** De-initialize and release CvsService */
+ void releaseCvsService();
+
+ CvsService_stub *m_cvsService;
+ Repository_stub *m_repository;
+
+ /** Used for storing module path between start and ending of check-out */
+ QString modulePath;
+
+ CVSFileInfoProvider *m_fileInfoProvider;
+ JobScheduler *m_scheduler;
+ /** Reference to owner part */
+ CvsServicePart *m_part;
+
+ //! Reference to widget integrated in the "bottom tabbar" (IDEAL)
+ //! (_Must_ be initialized by derived class)
+ QGuardedPtr<CvsProcessWidget> m_widget;
+
+ //! Urls which to work upon
+ const KURL::List &urlList() const;
+ /**
+ * @param relativeToProjectDir if true paths will be provided as relative to project directory,
+ * as absolute paths otherwise
+ * @return These are the file path contained in the urls provided for convenience
+ * has been requested for.
+ */
+ QStringList fileList( bool relativeToProjectDir = true ) const;
+ /** Last operation type: we save it so we can retrieve and use in slot*Exited() */
+ CvsOperation lastOperation() const;
+
+ // Both this data members are set by prepareOperation() method
+ KURL::List m_urlList;
+ CvsOperation m_lastOperation;
+};
+
+#endif
diff --git a/vcs/cvsservice/cvsprocesswidget.cpp b/vcs/cvsservice/cvsprocesswidget.cpp
new file mode 100644
index 00000000..2d41a356
--- /dev/null
+++ b/vcs/cvsservice/cvsprocesswidget.cpp
@@ -0,0 +1,288 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qpainter.h>
+#include <qregexp.h>
+
+#include <dcopref.h>
+#include <kstatusbar.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "kdevpartcontroller.h"
+#include "kdevmainwindow.h"
+#include "kdevcore.h"
+
+#include "cvspart.h"
+#include "cvsprocesswidget.h"
+#include "processwidget.h"
+
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+// Undef
+//#define MYDCOPDEBUG
+
+///////////////////////////////////////////////////////////////////////////////
+// class CvsProcessWidget
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef MYDCOPDEBUG
+int g_dcopExitCounter = 0;
+int g_dcopOutCounter = 0;
+int g_dcopErrCounter = 0;
+#endif
+
+
+CvsProcessWidget::CvsProcessWidget( CvsService_stub *service, CvsServicePart *part, QWidget *parent, const char *name )
+ : DCOPObject( "CvsProcessWidgetDCOPIface" ),
+ QTextEdit( parent, name ),
+ m_part( part ), m_service( service ), m_job( 0 )
+{
+ setReadOnly( true );
+ setTextFormat( Qt::LogText );
+
+ QStyleSheetItem *style = 0;
+ style = new QStyleSheetItem( styleSheet(), "goodtag" );
+ style->setColor( "black" );
+
+ style = new QStyleSheetItem( styleSheet(), "errortag" );
+ style->setColor( "red" );
+ style->setFontWeight( QFont::Bold );
+
+ style = new QStyleSheetItem( styleSheet(), "infotag" );
+ style->setColor( "blue" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_conflict" );
+ style->setColor( "red" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_added" );
+ style->setColor( "green" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_removed" );
+ style->setColor( "yellow" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_updated" );
+ style->setColor( "lightblue" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_modified" );
+ style->setColor( "darkgreen" );
+
+ style = new QStyleSheetItem( styleSheet(), "cvs_unknown" );
+ style->setColor( "gray" );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+CvsProcessWidget::~CvsProcessWidget()
+{
+ if (m_job)
+ {
+ delete m_job;
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsProcessWidget::isAlreadyWorking() const
+{
+ if (m_job)
+ return m_job->isRunning();
+ else
+ return false;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::clear()
+{
+ QTextEdit::clear();
+ this->m_errors = QString::null;
+ this->m_output = QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool CvsProcessWidget::startJob( const DCOPRef &aJob )
+{
+ kdDebug(9006) << "CvsProcessWidget::startJob(const DCOPRef &) here!" << endl;
+
+ clear();
+ m_part->mainWindow()->raiseView( this );
+ m_part->core()->running( m_part, true );
+
+ // create a DCOP stub for the non-concurrent cvs job
+ if (m_job)
+ {
+ delete m_job;
+ m_job = 0;
+ }
+ m_job = new CvsJob_stub( aJob.app(), aJob.obj() );
+
+ // establish connections to the signals of the cvs m_job
+ connectDCOPSignal( m_job->app(), m_job->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ connectDCOPSignal( m_job->app(), m_job->obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+ connectDCOPSignal( m_job->app(), m_job->obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)", true );
+
+ // get command line and add it to output buffer
+ QString cmdLine = m_job->cvsCommand();
+ m_part->mainWindow()->statusBar()->message( cmdLine );
+
+ kdDebug(9006) << "Running: " << cmdLine << endl;
+
+ // disconnect 3rd party slots from our signals
+ disconnect( SIGNAL(jobFinished(bool, int)) );
+
+ showInfo( i18n("Started job: %1").arg( cmdLine ) );
+
+#ifdef MYDCOPDEBUG
+ g_dcopExitCounter = 0;
+ g_dcopOutCounter = 0;
+ g_dcopErrCounter = 0;
+#endif
+
+ return m_job->execute();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::cancelJob()
+{
+ kdDebug(9006) << "CvsProcessWidget::cancelJob() here!" << endl;
+
+ if (!m_job || !m_job->isRunning())
+ return;
+ m_job->cancel();
+ delete m_job; m_job = 0;
+
+ showInfo( i18n("*** Job canceled by user request ***") );
+
+ m_part->core()->running( m_part, false );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::slotJobExited( bool normalExit, int exitStatus )
+{
+ kdDebug(9006) << "CvsProcessWidget::slotJobExited(bool, int) here!" << endl;
+#ifdef MYDCOPDEBUG
+ g_dcopExitCounter++;
+ kdDebug(9006) << "MYDCOPDEBUG: dcopExitCounter == " << g_dcopExitCounter << endl;
+#endif
+ if (m_job)
+ {
+ disconnectDCOPSignal( m_job->app(), m_job->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)" );
+ disconnectDCOPSignal( m_job->app(), m_job->obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)" );
+ disconnectDCOPSignal( m_job->app(), m_job->obj(), "receivedStderr(QString)", "slotReceivedErrors(QString)" );
+ delete m_job;
+ m_job = 0;
+ }
+ QString exitMsg = i18n("Job finished with exitCode == %1");
+ showInfo( exitMsg.arg( exitStatus) );
+
+ m_part->core()->running( m_part, false );
+ m_part->mainWindow()->statusBar()->message( i18n("Done CVS command ..."), 2000 );
+
+ emit jobFinished( normalExit, exitStatus );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::slotReceivedOutput( QString someOutput )
+{
+ kdDebug(9006) << "CvsProcessWidget::slotReceivedOutput(QString) here!" << endl;
+#ifdef MYDCOPDEBUG
+ g_dcopOutCounter++;
+ kdDebug(9006) << "MYDCOPDEBUG: dcopOutCounter == " << g_dcopOutCounter << endl;
+#endif
+
+ QStringList strings = m_outputBuffer.process( someOutput );
+ if (strings.count() > 0)
+ {
+ m_output += strings;
+ showOutput( strings );
+ scrollToBottom();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::slotReceivedErrors( QString someErrors )
+{
+ kdDebug(9006) << "CvsProcessWidget::slotReceivedErrors(QString) here!" << endl;
+#ifdef MYDCOPDEBUG
+ g_dcopErrCounter++;
+ kdDebug(9006) << "MYDCOPDEBUG: dcopErrCounter == " << g_dcopErrCounter << endl;
+#endif
+
+ QStringList strings = m_errorBuffer.process( someErrors );
+ if (strings.count() > 0)
+ {
+ m_errors += strings;
+ showError( strings );
+ scrollToBottom();
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::showInfo( const QStringList &msg )
+{
+ for (QStringList::const_iterator it = msg.begin(); it != msg.end(); ++it)
+ append( "<infotag>" + (*it) + "</infotag>" );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::showError( const QStringList &msg )
+{
+ for (QStringList::const_iterator it = msg.begin(); it != msg.end(); ++it)
+ append( "<errortag>" + (*it) + "</errortag>" );
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void CvsProcessWidget::showOutput( const QStringList &msg )
+{
+ for (QStringList::const_iterator it = msg.begin(); it != msg.end(); ++it)
+ {
+ // @todo here we can interpret lines as [C], [M], ...
+ const QString &line = (*it);
+
+ //If the line already contains tags we need to replace the
+ //delimiters with the corresponding HTML code so that they are no longer
+ //recognized as tags.
+ //This will prevent QTextEdit from crashing on trying to parse the tags.
+ //This should fix BUG:99590
+ QString lineNew(line);
+ lineNew.replace("<", "&lt;");
+ lineNew.replace(">", "&gt;");
+ lineNew.replace("&", "&amp;");
+
+ if (line.startsWith( "C " ))
+ append( "<cvs_conflict>" + lineNew + "</cvs_conflict>" );
+ else if (line.startsWith( "M " ))
+ append( "<cvs_modified>" + lineNew + "</cvs_modified>" );
+ else if (line.startsWith( "A " ))
+ append( "<cvs_added>" + lineNew + "</cvs_added>" );
+ else if (line.startsWith( "R " ))
+ append( "<cvs_removed>" + lineNew + "</cvs_removed>" );
+ else if (line.startsWith( "U " ))
+ append( "<cvs_updated>" + lineNew + "</cvs_updated>" );
+ else if (line.startsWith( "? " ))
+ append( "<cvs_unknown>" + lineNew + "</cvs_unknown>" );
+ else // default
+ append( "<goodtag>" + lineNew + "</goodtag>" );
+ }
+}
+
+#include "cvsprocesswidget.moc"
diff --git a/vcs/cvsservice/cvsprocesswidget.h b/vcs/cvsservice/cvsprocesswidget.h
new file mode 100644
index 00000000..cb55205c
--- /dev/null
+++ b/vcs/cvsservice/cvsprocesswidget.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _CVSPROCESSWIDGET_H_
+#define _CVSPROCESSWIDGET_H_
+
+#include <qtextedit.h>
+#include <qstringlist.h>
+
+#include "cvsservicedcopIface.h"
+#include "bufferedstringreader.h"
+
+class CvsServicePart;
+class DCOPRef;
+class CvsJob_stub;
+class CvsService_stub;
+class QStyleSheetItem;
+
+class CvsProcessWidget : public QTextEdit, virtual public CVSServiceDCOPIface
+{
+ Q_OBJECT
+public:
+ CvsProcessWidget( CvsService_stub *service, CvsServicePart *part,
+ QWidget *parent, const char *name );
+ virtual ~CvsProcessWidget();
+
+ bool startJob( const DCOPRef &aJob );
+
+ /**
+ * @return true if there is already a job pending, false otherwise
+ * (another job can be requested)
+ */
+ bool isAlreadyWorking() const;
+ void cancelJob();
+
+ virtual void clear();
+
+ QStringList output() const { return m_output; }
+ QStringList errors() const { return m_errors; }
+
+//private slots:
+ //! DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+signals:
+ void jobFinished( bool normalExit, int exitStatus );
+
+private:
+ void showInfo( const QStringList &msg );
+ void showError( const QStringList &msg );
+ void showOutput( const QStringList &msg );
+
+ CvsServicePart *m_part;
+ CvsService_stub *m_service;
+ CvsJob_stub *m_job;
+
+ //! Buffered reader for safely reading stdout and stderr from cvs
+ //! commands' output
+ BufferedStringReader m_outputBuffer,
+ m_errorBuffer;
+
+ QStringList m_output,
+ m_errors;
+};
+
+#endif
+
diff --git a/vcs/cvsservice/cvsservicedcopIface.h b/vcs/cvsservice/cvsservicedcopIface.h
new file mode 100644
index 00000000..14cd8629
--- /dev/null
+++ b/vcs/cvsservice/cvsservicedcopIface.h
@@ -0,0 +1,29 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * www.kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qstring.h>
+#include <dcopobject.h>
+
+#ifndef __CVSSERVICEDCOPIFACE_H_
+#define __CVSSERVICEDCOPIFACE_H_
+/**
+* DCOP Iface for classes which use CvsService services.
+*/
+class CVSServiceDCOPIface : virtual public DCOPObject
+{
+ K_DCOP
+k_dcop:
+ virtual void slotJobExited( bool normalExit, int exitStatus ) = 0;
+ virtual void slotReceivedOutput( QString someOutput ) = 0;
+ virtual void slotReceivedErrors( QString someErrors ) = 0;
+};
+
+#endif
diff --git a/vcs/cvsservice/diffdialog.cpp b/vcs/cvsservice/diffdialog.cpp
new file mode 100644
index 00000000..37ba79fc
--- /dev/null
+++ b/vcs/cvsservice/diffdialog.cpp
@@ -0,0 +1,89 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <klineedit.h>
+#include <qradiobutton.h>
+
+#include "diffdialog.h"
+#include <klocale.h>
+#include <qbuttongroup.h>
+
+///////////////////////////////////////////////////////////////////////////////
+// class DiffDialog
+///////////////////////////////////////////////////////////////////////////////
+
+DiffDialog::DiffDialog( const CVSEntry &entry, QWidget *parent, const char *name, WFlags f )
+ : DiffDialogBase( parent, name, true, f)
+{
+ m_entry = entry;
+ QString currentRevision = entry.revision();
+ revaEdit->setText(currentRevision);
+ revbEdit->setText(currentRevision);
+ revOtherEdit->setText(currentRevision);
+ languageChange();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+DiffDialog::~DiffDialog()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+DiffDialog::DiffType DiffDialog::requestedDiff() const
+{
+ if (diffArbitraryRevRadio->isChecked())
+ return diffArbitrary;
+ else if (diffLocalOtherRadio->isChecked())
+ return diffLocalOther;
+ else if (diffLocalBaseRadio->isChecked())
+ return diffLocalBASE;
+ else
+ return diffLocalHEAD;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString DiffDialog::revA() const
+{
+ if (requestedDiff() == diffArbitrary)
+ return revaEdit->text();
+ else if (requestedDiff() == diffLocalOther)
+ return revOtherEdit->text();
+ else if (requestedDiff() == diffLocalHEAD)
+ return "HEAD";
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString DiffDialog::revB() const
+{
+ if (requestedDiff())
+ return this->revbEdit->text();
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void DiffDialog::languageChange() {
+ DiffDialogBase::languageChange();
+ //buttonGroup1->setTitle( tr2i18n( "Build Difference Between" ) );
+
+ //FIXME: We need a function in CVSEntry to return the latest revision there is in cvs
+// if(!m_entry.revision().isNull())
+// diffLocalHeadRadio->setText( tr2i18n( "Local copy and &HEAD (%1)" ).arg( m_entry.revision()) );
+}
+
+#include "diffdialog.moc"
diff --git a/vcs/cvsservice/diffdialog.h b/vcs/cvsservice/diffdialog.h
new file mode 100644
index 00000000..12bfc88a
--- /dev/null
+++ b/vcs/cvsservice/diffdialog.h
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef __DIFFDIALOG_H
+#define __DIFFDIALOG_H
+
+#include "diffdialogbase.h"
+#include "cvsentry.h"
+
+/**
+* Implementation for a dialog which collects data for diff operation
+*
+* @author Mario Scalas
+*/
+class DiffDialog : public DiffDialogBase
+{
+ Q_OBJECT
+public:
+ DiffDialog(const CVSEntry &entry, QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+ virtual ~DiffDialog();
+
+ QString revA() const;
+ QString revB() const;
+
+private:
+ enum DiffType { diffLocalBASE, diffLocalHEAD, diffLocalOther, diffArbitrary };
+
+ DiffType requestedDiff() const;
+ CVSEntry m_entry;
+protected slots:
+ virtual void languageChange();
+};
+
+#endif // __DIFFDIALOG_H
diff --git a/vcs/cvsservice/diffdialogbase.ui b/vcs/cvsservice/diffdialogbase.ui
new file mode 100644
index 00000000..0290c530
--- /dev/null
+++ b/vcs/cvsservice/diffdialogbase.ui
@@ -0,0 +1,275 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>DiffDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>DiffDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>519</width>
+ <height>246</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose Revisions to Diff</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Build Difference Between</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>diffLocalOtherRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Local copy and an arbitrary &amp;revision:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>revOtherEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>diffArbitraryRevRadio</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Two arbitrary revisions/tags:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Revision A:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>revbEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Second revision to compare (leave empty to diff against HEAD)</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>revaEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>First revision to compare</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="1">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Revision B:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>diffLocalHeadRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Local cop&amp;y and HEAD</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>diffLocalBaseRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Local copy a&amp;nd BASE</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>130</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>DiffDialog</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>DiffDialog</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>diffArbitraryRevRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>revaEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>diffArbitraryRevRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>revbEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>diffLocalOtherRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>revOtherEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>diffLocalBaseRadio</tabstop>
+ <tabstop>diffLocalHeadRadio</tabstop>
+ <tabstop>diffLocalOtherRadio</tabstop>
+ <tabstop>revOtherEdit</tabstop>
+ <tabstop>revaEdit</tabstop>
+ <tabstop>revbEdit</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/diffwidget.cpp b/vcs/cvsservice/diffwidget.cpp
new file mode 100644
index 00000000..c51c16b0
--- /dev/null
+++ b/vcs/cvsservice/diffwidget.cpp
@@ -0,0 +1,331 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qtextedit.h>
+#include <qpopupmenu.h>
+#include <qcursor.h>
+#include <qfile.h>
+
+#include <kconfig.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kservice.h>
+#include <ktempfile.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kfiledialog.h>
+#include <kmessagebox.h>
+
+#include <kparts/componentfactory.h>
+#include <kparts/part.h>
+
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+
+#include "diffwidget.h"
+
+// yup, magic value for the popupmenu-id
+static const int POPUP_BASE = 130977;
+
+QStringList KDiffTextEdit::extParts;
+QStringList KDiffTextEdit::extPartsTranslated;
+
+KDiffTextEdit::KDiffTextEdit( QWidget* parent, const char* name ): QTextEdit( parent, name )
+{
+ KConfig* config = kapp->config();
+ config->setGroup( "Diff" );
+ _highlight = config->readBoolEntry( "Highlight", true );
+
+ searchExtParts();
+}
+
+KDiffTextEdit::~KDiffTextEdit()
+{
+ KConfig* config = kapp->config();
+
+ config->setGroup( "Diff" );
+ config->writeEntry( "Highlight", _highlight );
+}
+
+QPopupMenu* KDiffTextEdit::createPopupMenu()
+{
+ return createPopupMenu( QPoint() );
+}
+
+QPopupMenu* KDiffTextEdit::createPopupMenu( const QPoint& p )
+{
+ QPopupMenu* popup = QTextEdit::createPopupMenu( p );
+ if ( !popup )
+ popup = new QPopupMenu( this );
+
+ int i = 0;
+
+ for ( QStringList::Iterator it = extPartsTranslated.begin(); it != extPartsTranslated.end(); ++it ) {
+ popup->insertItem( i18n( "Show in %1" ).arg( *it ), i + POPUP_BASE, i );
+ i++;
+ }
+ if ( !extPartsTranslated.isEmpty() )
+ popup->insertSeparator( i );
+ connect( popup, SIGNAL(activated(int)), this, SLOT(popupActivated(int)) );
+
+ popup->insertItem( SmallIconSet( "filesaveas" ), i18n( "&Save As..." ), this, SLOT(saveAs()), CTRL + Key_S, POPUP_BASE - 2, 0 );
+ popup->setItemEnabled( POPUP_BASE - 2, length() > 0 );
+
+ popup->insertSeparator( 1 );
+
+ popup->insertItem( i18n( "Highlight Syntax" ), this, SLOT(toggleSyntaxHighlight()), 0, POPUP_BASE - 1, 2 );
+ popup->setItemChecked( POPUP_BASE - 1, _highlight );
+ popup->insertSeparator( 3 );
+
+ return popup;
+}
+
+void KDiffTextEdit::saveAs()
+{
+ QString fName = KFileDialog::getSaveFileName();
+ if ( fName.isEmpty() )
+ return;
+
+ QFile f( fName );
+ if ( f.open( IO_WriteOnly ) ) {
+ QTextStream stream( &f );
+ int pCount = paragraphs();
+ for ( int i = 0; i < pCount; ++i )
+ stream << text( i ) << "\n";
+ f.close();
+ } else {
+ KMessageBox::sorry( this, i18n("Unable to open file."), i18n("Diff Frontend") );
+ }
+}
+
+void KDiffTextEdit::toggleSyntaxHighlight()
+{
+ _highlight = !_highlight;
+ if ( _highlight )
+ applySyntaxHighlight();
+ else
+ clearSyntaxHighlight();
+}
+
+void KDiffTextEdit::applySyntaxHighlight()
+{
+ // the diff has been loaded so we apply a simple highlighting
+ static QColor cAdded( 190, 190, 237);
+ static QColor cRemoved( 190, 237, 190 );
+
+ if ( !_highlight )
+ return;
+
+ int paragCount = paragraphs();
+ for ( int i = 0; i < paragCount; ++i ) {
+ QString txt = text( i );
+ if ( txt.length() > 0 ) {
+ if ( txt.startsWith( "+" ) || txt.startsWith( ">" ) ) {
+ setParagraphBackgroundColor( i, cAdded );
+ } else if ( txt.startsWith( "-" ) || txt.startsWith( "<" ) ) {
+ setParagraphBackgroundColor( i, cRemoved );
+ }
+ }
+ }
+}
+
+void KDiffTextEdit::clearSyntaxHighlight()
+{
+ int paragCount = paragraphs();
+ for ( int i = 0; i < paragCount; ++i ) {
+ clearParagraphBackground( i );
+ }
+}
+
+void KDiffTextEdit::searchExtParts()
+{
+ // only execute once
+ static bool init = false;
+ if ( init )
+ return;
+ init = true;
+
+ // search all parts that can handle text/x-diff
+ KTrader::OfferList offers = KTrader::self()->query("text/x-diff", "('KParts/ReadOnlyPart' in ServiceTypes) and ('text/x-diff' in ServiceTypes)");
+ KTrader::OfferList::const_iterator it;
+ for ( it = offers.begin(); it != offers.end(); ++it ) {
+ KService::Ptr ptr = (*it);
+ extPartsTranslated << ptr->name();
+ extParts << ptr->desktopEntryName();
+ }
+ return;
+}
+
+void KDiffTextEdit::popupActivated( int id )
+{
+ id -= POPUP_BASE;
+ if ( id < 0 || id > (int)extParts.count() )
+ return;
+
+ emit externalPartRequested( extParts[ id ] );
+}
+
+DiffWidget::DiffWidget( QWidget *parent, const char *name, WFlags f ):
+ QWidget( parent, name, f ), tempFile( 0 )
+{
+ job = 0;
+ extPart = 0;
+
+ te = new KDiffTextEdit( this, "Main Diff Viewer" );
+ te->setReadOnly( true );
+ te->setTextFormat( QTextEdit::PlainText );
+// te->setMinimumSize( 300, 200 );
+ connect( te, SIGNAL(externalPartRequested(const QString&)), this, SLOT(loadExtPart(const QString&)) );
+
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ layout->addWidget( te );
+}
+
+DiffWidget::~DiffWidget()
+{
+ delete tempFile;
+}
+
+void DiffWidget::setExtPartVisible( bool visible )
+{
+ if ( !extPart || !extPart->widget() ) {
+ te->show();
+ return;
+ }
+ if ( visible ) {
+ te->hide();
+ extPart->widget()->show();
+ } else {
+ te->show();
+ extPart->widget()->hide();
+ }
+}
+
+void DiffWidget::loadExtPart( const QString& partName )
+{
+ if ( extPart ) {
+ setExtPartVisible( false );
+ delete extPart;
+ extPart = 0;
+ }
+
+ KService::Ptr extService = KService::serviceByDesktopName( partName );
+ if ( !extService )
+ return;
+
+ extPart = KParts::ComponentFactory::createPartInstanceFromService<KParts::ReadOnlyPart>( extService, this, 0, this, 0 );
+ if ( !extPart || !extPart->widget() )
+ return;
+
+ layout()->add( extPart->widget() );
+
+ setExtPartVisible( true );
+
+ if ( te->paragraphs() > 0 )
+ populateExtPart();
+}
+
+void DiffWidget::slotClear()
+{
+ te->clear();
+ if ( extPart )
+ extPart->closeURL();
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotAppend( const QString& str )
+{
+ te->append( str );
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotAppend( KIO::Job*, const QByteArray& ba )
+{
+ slotAppend( QString( ba ) );
+}
+
+void DiffWidget::populateExtPart()
+{
+ if ( !extPart )
+ return;
+
+ bool ok = false;
+ int paragCount = te->paragraphs();
+ if ( extPart->openStream( "text/plain", KURL() ) ) {
+ for ( int i = 0; i < paragCount; ++i )
+ extPart->writeStream( te->text( i ).local8Bit() );
+ ok = extPart->closeStream();
+ } else {
+ // workaround for parts that cannot handle streams
+ delete tempFile;
+ tempFile = new KTempFile();
+ tempFile->setAutoDelete( true );
+ for ( int i = 0; i < paragCount; ++i )
+ *(tempFile->textStream()) << te->text( i ) << endl;
+ tempFile->close();
+ ok = extPart->openURL( KURL( tempFile->name() ) );
+ }
+ if ( !ok )
+ setExtPartVisible( false );
+}
+
+// internally for the TextEdit only!
+void DiffWidget::slotFinished()
+{
+ te->applySyntaxHighlight();
+ populateExtPart();
+}
+
+void DiffWidget::setDiff( const QString& diff )
+{
+ slotClear();
+ slotAppend( diff );
+ slotFinished();
+}
+
+void DiffWidget::openURL( const KURL& url )
+{
+ if ( job )
+ job->kill();
+
+ KIO::TransferJob* job = KIO::get( url );
+ if ( !job )
+ return;
+
+ connect( job, SIGNAL(data( KIO::Job *, const QByteArray & )),
+ this, SLOT(slotAppend( KIO::Job*, const QByteArray& )) );
+ connect( job, SIGNAL(result( KIO::Job * )),
+ this, SLOT(slotFinished()) );
+}
+
+void DiffWidget::contextMenuEvent( QContextMenuEvent* /* e */ )
+{
+ QPopupMenu* popup = new QPopupMenu( this );
+
+ if ( !te->isVisible() )
+ popup->insertItem( i18n("Display &Raw Output"), this, SLOT(showTextEdit()) );
+
+ popup->exec( QCursor::pos() );
+ delete popup;
+}
+
+void DiffWidget::showExtPart()
+{
+ setExtPartVisible( true );
+}
+
+void DiffWidget::showTextEdit()
+{
+ setExtPartVisible( false );
+}
+
+#include "diffwidget.moc"
diff --git a/vcs/cvsservice/diffwidget.h b/vcs/cvsservice/diffwidget.h
new file mode 100644
index 00000000..d7aaf48c
--- /dev/null
+++ b/vcs/cvsservice/diffwidget.h
@@ -0,0 +1,103 @@
+/***************************************************************************
+ * Copyright (C) 2001 by Harald Fernengel *
+ * harry@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _DIFFWIDGET_H_
+#define _DIFFWIDGET_H_
+
+#include <qwidget.h>
+#include <qtextedit.h>
+#include <qstringlist.h>
+
+#include <kurl.h>
+
+class KTempFile;
+
+namespace KIO {
+ class Job;
+}
+
+namespace KParts {
+ class ReadOnlyPart;
+}
+
+// Helper class that displays a modified RMB popup menu
+class KDiffTextEdit: public QTextEdit
+{
+ Q_OBJECT
+public:
+ KDiffTextEdit( QWidget* parent = 0, const char* name = 0 );
+ virtual ~KDiffTextEdit();
+ void applySyntaxHighlight();
+ void clearSyntaxHighlight();
+
+signals:
+ void externalPartRequested( const QString& partName );
+
+protected:
+ virtual QPopupMenu* createPopupMenu( const QPoint& );
+ virtual QPopupMenu* createPopupMenu();
+
+private slots:
+ void popupActivated( int );
+ void toggleSyntaxHighlight();
+ void saveAs();
+
+private:
+ static void searchExtParts();
+ static QStringList extParts;
+ static QStringList extPartsTranslated;
+ bool _highlight;
+};
+
+class DiffWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DiffWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
+ virtual ~DiffWidget();
+
+public slots:
+ /** The URL has to point to a diff file */
+ void openURL( const KURL& url );
+ /** Pass a diff file in here */
+ void setDiff( const QString& diff );
+ /** clears the difference viewer */
+ void slotClear();
+
+private slots:
+ /** appends a piece of "diff" */
+ void slotAppend( const QString& str );
+ /** overloaded for convenience */
+ void slotAppend( KIO::Job*, const QByteArray& ba );
+ /** call this when the whole "diff" has been sent.
+ * Don't call slotAppend afterwards!
+ */
+ void slotFinished();
+ void showExtPart();
+ void showTextEdit();
+ void loadExtPart( const QString& partName );
+
+protected:
+ void contextMenuEvent( QContextMenuEvent* e );
+
+private:
+ void setExtPartVisible( bool visible );
+ void populateExtPart();
+
+private:
+ KDiffTextEdit* te;
+ KIO::Job* job;
+ KParts::ReadOnlyPart* extPart;
+ KTempFile* tempFile;
+};
+
+#endif
diff --git a/vcs/cvsservice/editorsdialog.cpp b/vcs/cvsservice/editorsdialog.cpp
new file mode 100644
index 00000000..12319102
--- /dev/null
+++ b/vcs/cvsservice/editorsdialog.cpp
@@ -0,0 +1,134 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#include <kmessagebox.h>
+#include <kcursor.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <dcopref.h>
+
+#include <qtextbrowser.h>
+#include <qregexp.h>
+
+#include "editorsdialog.h"
+
+//dcop connection to cervisia
+#include <cvsjob_stub.h>
+#include <cvsservice_stub.h>
+
+EditorsDialog::EditorsDialog(CvsService_stub *cvsService, QWidget *parent, const char *name)
+ : DCOPObject( "CvsEditorsDCOPIface"), EditorsDialogBase(parent, name, TRUE, Qt::WDestructiveClose),
+ m_cvsService(cvsService), m_cvsJob(0)
+{
+}
+
+EditorsDialog::~EditorsDialog()
+{
+ kdDebug(9006) << "EditorsDialog::~EditorsDialog"<< endl;
+
+ if (m_cvsJob && m_cvsJob->isRunning()) {
+ m_cvsJob->cancel();
+ }
+ if (m_cvsJob)
+ delete m_cvsJob;
+}
+
+void EditorsDialog::startjob(QString strDir)
+{
+ kdDebug(9006) << "EditorsDialog::start() workDir = " << strDir << endl;
+
+ DCOPRef job = m_cvsService->editors( strDir );
+ m_cvsJob = new CvsJob_stub( job.app(), job.obj() );
+
+ // establish connections to the signals of the cvs m_job
+ connectDCOPSignal( job.app(), job.obj(), "jobExited(bool, int)", "slotJobExited(bool, int)", true );
+ // We'll read the ouput directly from the job ...
+ connectDCOPSignal( job.app(), job.obj(), "receivedStdout(QString)", "slotReceivedOutput(QString)", true );
+
+ kdDebug(9006) << "Running: " << m_cvsJob->cvsCommand() << endl;
+ m_cvsJob->execute();
+}
+
+void EditorsDialog::slotJobExited( bool normalExit, int exitStatus )
+{
+ if (!normalExit)
+ {
+ KMessageBox::sorry( this, i18n("Log failed with exitStatus == %1").arg( exitStatus), i18n("Log Failed") );
+ return;
+ }
+
+ static QRegExp re("([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s"
+ "([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s(.*)");
+ static QRegExp subre("([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s"
+ "([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s([^\\s]+)\\s(.*)");
+ QString lastfilename;
+
+ QStringList lines = QStringList::split( "\n", m_output );
+ int found = 0;
+ for (size_t i=0; i<lines.count(); ++i) {
+ QString s = lines[i].simplifyWhiteSpace();
+ kdDebug(9006) << "editors:---" << s << "---" << endl;
+ kdDebug(9006) << " : lastfile was " << lastfilename << endl;
+
+ if (re.exactMatch(s)) {
+ QString file = re.cap( 1 );
+ QString locker = re.cap( 2 );
+ QString date = re.cap(5)+" "+re.cap(4)+" "+re.cap(7)+" "+re.cap(6);
+
+ m_textBrowser->append( "<b>"+i18n("File")+": <code>"+file+"</code></b>" );
+ m_textBrowser->append( "<b>"+i18n("User")+":</b> "+locker );
+ m_textBrowser->append( "<b>"+i18n("Date")+":</b> "+date );
+ m_textBrowser->append( "<hr>" );
+ found++;
+
+ lastfilename = file;
+ } else {
+ if (subre.exactMatch(s)) {
+ QString file = lastfilename;
+ QString locker = subre.cap( 1 );
+ QString date = subre.cap(4)+" "+subre.cap(3)+" "+subre.cap(6)+" "+subre.cap(5);
+
+ m_textBrowser->append( "<b>"+i18n("File")+": <code>"+file+"</code></b>" );
+ m_textBrowser->append( "<b>"+i18n("User")+":</b> "+locker );
+ m_textBrowser->append( "<b>"+i18n("Date")+":</b> "+date );
+ m_textBrowser->append( "<hr>" );
+ found++;
+ }
+ }
+ }
+
+ if (!found)
+ m_textBrowser->append(i18n("No files from your query are marked as being edited."));
+
+ m_textBrowser->source();
+
+ if (m_cvsJob) {
+ disconnectDCOPSignal( m_cvsJob->app(), m_cvsJob->obj(), "jobExited(bool, int)", "slotJobExited(bool, int)" );
+ delete m_cvsJob;
+ m_cvsJob=NULL;
+ }
+}
+
+void EditorsDialog::slotReceivedOutput( QString someOutput )
+{
+ kdDebug(9006) << "OUTPUT: " << someOutput << endl;
+
+ m_output += someOutput; //append the whole output into one large QStrin
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void EditorsDialog::slotReceivedErrors( QString someErrors )
+{
+ kdDebug(9006) << "ERRORS: " << someErrors << endl;
+}
+
+#include "editorsdialog.moc"
diff --git a/vcs/cvsservice/editorsdialog.h b/vcs/cvsservice/editorsdialog.h
new file mode 100644
index 00000000..1aedbc64
--- /dev/null
+++ b/vcs/cvsservice/editorsdialog.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Robert Gruber *
+ * rgruber@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. *
+ * *
+ ***************************************************************************/
+
+#ifndef EDITORSDIALOG_H
+#define EDITORSDIALOG_H
+
+#include "editorsdialogbase.h"
+#include "cvsservicedcopIface.h"
+
+class CvsJob_stub;
+class CvsService_stub;
+class QStringList;
+
+class EditorsDialog: public EditorsDialogBase, virtual public CVSServiceDCOPIface
+{
+Q_OBJECT
+public:
+ EditorsDialog(CvsService_stub *cvsService, QWidget *parent = 0, const char *name = 0);
+ virtual ~EditorsDialog();
+
+ void startjob(QString strDir);
+
+private slots:
+ // DCOP Iface
+ virtual void slotJobExited( bool normalExit, int exitStatus );
+ virtual void slotReceivedOutput( QString someOutput );
+ virtual void slotReceivedErrors( QString someErrors );
+
+private:
+ CvsService_stub *m_cvsService;
+ CvsJob_stub *m_cvsJob;
+ QString m_output;
+};
+
+#endif
diff --git a/vcs/cvsservice/editorsdialogbase.ui b/vcs/cvsservice/editorsdialogbase.ui
new file mode 100644
index 00000000..b0cb925a
--- /dev/null
+++ b/vcs/cvsservice/editorsdialogbase.ui
@@ -0,0 +1,88 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>EditorsDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>EditorsDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Editors</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTextBrowser" row="0" column="0">
+ <property name="name">
+ <cstring>m_textBrowser</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>EditorsDialogBase</receiver>
+ <slot>close()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/integrator/Makefile.am b/vcs/cvsservice/integrator/Makefile.am
new file mode 100644
index 00000000..7768aad5
--- /dev/null
+++ b/vcs/cvsservice/integrator/Makefile.am
@@ -0,0 +1,12 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libcvsserviceintegrator.la
+libcvsserviceintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries)
+libcvsserviceintegrator_la_LIBADD = \
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la $(top_builddir)/lib/libkdevelop.la -lcvsservice
+noinst_HEADERS = cvsserviceintegrator.h integratordlg.h
+libcvsserviceintegrator_la_SOURCES = cvsserviceintegrator.cpp \
+ integratordlgbase.ui fetcherdlgbase.ui integratordlg.cpp initdlg.ui
+kde_services_DATA = kdevcvsserviceintegrator.desktop
diff --git a/vcs/cvsservice/integrator/cvsserviceintegrator.cpp b/vcs/cvsservice/integrator/cvsserviceintegrator.cpp
new file mode 100644
index 00000000..f23e3831
--- /dev/null
+++ b/vcs/cvsservice/integrator/cvsserviceintegrator.cpp
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "cvsserviceintegrator.h"
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "integratordlg.h"
+
+static const KDevPluginInfo data("kdevcvsserviceintegrator");
+typedef KDevGenericFactory<CVSServiceIntegrator> CVSIntegratorFactory;
+K_EXPORT_COMPONENT_FACTORY( libcvsserviceintegrator, CVSIntegratorFactory(data) )
+
+CVSServiceIntegrator::CVSServiceIntegrator(QObject* parent, const char* name,
+ const QStringList args)
+ :KDevVCSIntegrator(parent, name)
+{
+}
+
+CVSServiceIntegrator::~CVSServiceIntegrator( )
+{
+}
+
+VCSDialog* CVSServiceIntegrator::fetcher(QWidget* parent)
+{
+ return 0;
+}
+
+VCSDialog* CVSServiceIntegrator::integrator(QWidget* parent)
+{
+ IntegratorDlg *dlg = new IntegratorDlg(this, parent);
+ return dlg;
+}
+
+#include "cvsserviceintegrator.moc"
diff --git a/vcs/cvsservice/integrator/cvsserviceintegrator.h b/vcs/cvsservice/integrator/cvsserviceintegrator.h
new file mode 100644
index 00000000..46d3bdeb
--- /dev/null
+++ b/vcs/cvsservice/integrator/cvsserviceintegrator.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef CVSSERVICEINTEGRATOR_H
+#define CVSSERVICEINTEGRATOR_H
+
+#include <kdevvcsintegrator.h>
+
+#include <qstringlist.h>
+
+class CVSServiceIntegrator: public KDevVCSIntegrator {
+Q_OBJECT
+public:
+ CVSServiceIntegrator(QObject* parent, const char* name, const QStringList args = QStringList());
+ virtual ~CVSServiceIntegrator();
+
+ virtual VCSDialog* fetcher(QWidget* parent);
+ virtual VCSDialog* integrator(QWidget* parent);
+
+};
+
+#endif
diff --git a/vcs/cvsservice/integrator/fetcherdlgbase.ui b/vcs/cvsservice/integrator/fetcherdlgbase.ui
new file mode 100644
index 00000000..be0556c2
--- /dev/null
+++ b/vcs/cvsservice/integrator/fetcherdlgbase.ui
@@ -0,0 +1,153 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>FetcherDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>FetcherDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>458</width>
+ <height>110</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>module</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Branch tag:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboBox5</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Repository:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>repository</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>repository</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Fetch &amp;List</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Module:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>module</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>comboBox5</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>spacer4</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>
+<tabstops>
+ <tabstop>repository</tabstop>
+ <tabstop>module</tabstop>
+ <tabstop>pushButton2</tabstop>
+ <tabstop>comboBox5</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/integrator/initdlg.ui b/vcs/cvsservice/integrator/initdlg.ui
new file mode 100644
index 00000000..1b36ecfb
--- /dev/null
+++ b/vcs/cvsservice/integrator/initdlg.ui
@@ -0,0 +1,71 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>InitDlg</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>InitDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>346</width>
+ <height>63</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose Repository Location</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_2_2_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Repository location:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>location</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="0" column="1">
+ <property name="name">
+ <cstring>location</cstring>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer7</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="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/cvsservice/integrator/integratordlg.cpp b/vcs/cvsservice/integrator/integratordlg.cpp
new file mode 100644
index 00000000..8f3fc2b5
--- /dev/null
+++ b/vcs/cvsservice/integrator/integratordlg.cpp
@@ -0,0 +1,191 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "integratordlg.h"
+
+#include <qfile.h>
+#include <qdir.h>
+#include <qlayout.h>
+#include <qcombobox.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include <qcheckbox.h>
+
+#include <kapplication.h>
+#include <kdialogbase.h>
+#include <kurlrequester.h>
+#include <kprocess.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <klineedit.h>
+
+#include <cvsservice_stub.h>
+
+#include "initdlg.h"
+
+IntegratorDlg::IntegratorDlg(CVSServiceIntegrator *integrator, QWidget *parent, const char *name)
+ :IntegratorDlgBase(parent, name), m_integrator(integrator)
+{
+ QFile cvspass(QDir::homeDirPath() + "/.cvspass");
+ if (cvspass.open(IO_ReadOnly))
+ {
+ QTextStream stream(&cvspass);
+ while (!stream.atEnd())
+ {
+ QString line = stream.readLine();
+ QStringList recs = QStringList::split(" ", line, false);
+ repository->insertItem(recs[1]);
+ }
+ cvspass.close();
+ }
+}
+
+void IntegratorDlg::init_clicked()
+{
+ KDialogBase dlg(KDialogBase::Plain, i18n("Init CVS Repository"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok);
+ dlg.plainPage()->setMargin(0);
+ (new QVBoxLayout(dlg.plainPage(), 0, 0))->setAutoAdd(true);
+ InitDlg *initDlg = new InitDlg(dlg.plainPage());
+ initDlg->show();
+
+ initDlg->location->setFocus();
+ initDlg->location->setMode(KFile::Directory);
+ QRegExp localrep(":local:(.*)");
+ if (localrep.search(repository->currentText()) != -1)
+ initDlg->location->setURL(localrep.cap(1));
+
+ if (dlg.exec() == QDialog::Accepted)
+ {
+ QString url = initDlg->location->url();
+ KProcess *proc = new KProcess();
+ *proc << "cvs";
+ *proc << "-d" << url << "init";
+ proc->start(KProcess::Block);
+ if (!proc->normalExit())
+ KMessageBox::error(this, i18n("cvs init did not exit normally. Please check if cvs is installed and works correctly."), i18n("Init CVS Repository"));
+ else if (proc->exitStatus() != 0)
+ KMessageBox::error(this, i18n("cvs init exited with status %1. Please check if the cvs location is correct.").arg(proc->exitStatus()), i18n("Init CVS Repository"));
+ else
+ {
+ repository->insertItem(QString(":local:%1").arg(url));
+ repository->setCurrentText(QString(":local:%1").arg(url));
+ }
+ }
+}
+
+void IntegratorDlg::login_clicked()
+{
+ QCString appId;
+ QString error;
+
+ if (KApplication::startServiceByDesktopName("cvsservice",
+ QStringList(), &error, &appId))
+ {
+ QString msg = i18n("Unable to find the Cervisia KPart. \n"
+ "Cervisia Integration will not be available. Please check your\n"
+ "Cervisia installation and re-try. Reason was:\n") + error;
+ KMessageBox::error(this, msg, "DCOP Error");
+ }
+ else
+ {
+ CvsService_stub *cvsService = new CvsService_stub(appId, "CvsService");
+ cvsService->login(repository->currentText());
+ }
+}
+
+void IntegratorDlg::accept()
+{
+ if (m_projectLocation.isEmpty())
+ return;
+
+ if (!createModule->isChecked())
+ return;
+
+ KProcess *proc = new KProcess();
+ proc->setWorkingDirectory(m_projectLocation);
+ *proc << "cvs";
+ *proc << "-d" << repository->currentText() << "import"
+ << "-m" << QString("\"%1\"").arg(comment->text()) << module->text()
+ << vendorTag->text() << releaseTag->text();
+ proc->start(KProcess::Block);
+ if (!proc->normalExit())
+ KMessageBox::error(this, i18n("cvs import did not exit normally. Please check if cvs is installed and works correctly."), i18n("Init CVS Repository"));
+ else if (proc->exitStatus() != 0)
+ KMessageBox::error(this, i18n("cvs import exited with status %1. Please check if the cvs location is correct.").arg(proc->exitStatus()), i18n("Init CVS Repository"));
+ else
+ {
+ kdDebug() << "Project is in: " << m_projectLocation << endl;
+
+ KURL url = KURL::fromPathOrURL(m_projectLocation);
+ QString up = url.upURL().path();
+ kdDebug() << "Up is: " << up << endl;
+
+ //delete sources in project dir
+ KProcess *rmproc = new KProcess();
+ *rmproc << "rm";
+ *rmproc << "-f" << "-r" << m_projectLocation;
+ rmproc->start(KProcess::Block);
+
+ //checkout sources from cvs
+ KProcess *coproc = new KProcess();
+ coproc->setWorkingDirectory(up);
+ *coproc << "cvs";
+ *coproc << "-d" << repository->currentText() << "checkout" << "-d" << m_projectName << module->text();
+ coproc->start(KProcess::Block);
+ }
+
+/* QCString appId;
+ QString error;
+
+ if (KApplication::startServiceByDesktopName("cvsservice",
+ QStringList(), &error, &appId))
+ {
+ QString msg = i18n("Unable to find the Cervisia KPart. \n"
+ "Cervisia Integration will not be available. Please check your\n"
+ "Cervisia installation and re-try. Reason was:\n") + error;
+ KMessageBox::error(this, msg, "DCOP Error");
+ }
+ else
+ {
+ kdDebug() << "!!!!! IMPORT" << endl;
+ CvsService_stub *cvsService = new CvsService_stub(appId, "CvsService");
+ cvsService->import(m_projectLocation, repository->currentText(), module->text(),
+ "", comment->text(), vendorTag->text(), releaseTag->text(), false);
+ }*/
+}
+
+void IntegratorDlg::createModule_clicked()
+{
+}
+
+QWidget *IntegratorDlg::self()
+{
+ return const_cast<IntegratorDlg*>(this);
+}
+
+void IntegratorDlg::init(const QString &projectName, const QString &projectLocation)
+{
+ if( m_projectName != projectName )
+ module->setText(projectName);
+ m_projectName = projectName;
+ m_projectLocation = projectLocation;
+}
+
+#include "integratordlg.moc"
diff --git a/vcs/cvsservice/integrator/integratordlg.h b/vcs/cvsservice/integrator/integratordlg.h
new file mode 100644
index 00000000..5d0ad950
--- /dev/null
+++ b/vcs/cvsservice/integrator/integratordlg.h
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef INTEGRATORDLG_H
+#define INTEGRATORDLG_H
+
+#include "integratordlgbase.h"
+#include "cvsserviceintegrator.h"
+
+class QDomDocument;
+
+class IntegratorDlg: public IntegratorDlgBase, public VCSDialog {
+Q_OBJECT
+public:
+ IntegratorDlg(CVSServiceIntegrator *integrator, QWidget *parent = 0, const char *name = 0);
+
+ virtual QWidget *self();
+ virtual void init(const QString &projectName, const QString &projectLocation);
+
+public slots:
+ virtual void login_clicked();
+ virtual void init_clicked();
+ virtual void accept();
+ virtual void createModule_clicked();
+
+private:
+ CVSServiceIntegrator *m_integrator;
+ QString m_projectLocation;
+ QString m_projectName;
+};
+
+#endif
diff --git a/vcs/cvsservice/integrator/integratordlgbase.ui b/vcs/cvsservice/integrator/integratordlgbase.ui
new file mode 100644
index 00000000..e17f44e1
--- /dev/null
+++ b/vcs/cvsservice/integrator/integratordlgbase.ui
@@ -0,0 +1,398 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>IntegratorDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>IntegratorDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>540</width>
+ <height>212</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>createModule</cstring>
+ </property>
+ <property name="text">
+ <string>Create module in the repository</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>vendorTag</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>vendor</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="4">
+ <property name="name">
+ <cstring>init</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Init Local Repository...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>repository</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>login</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Login to &amp;Repository...</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>spacer8</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>
+ <spacer row="6" column="2">
+ <property name="name">
+ <cstring>spacer4</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="KLineEdit" row="2" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>module</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>moduleLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Mo&amp;dule:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>module</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>vendorLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Vendor tag:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>vendorTag</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>releaseLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Re&amp;lease tag:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>releaseTag</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>commentLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Co&amp;mment:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comment</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>repositoryLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>4</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Repository:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>repository</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="5" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>comment</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>First Import</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="4" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>releaseTag</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>start</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer3</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>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>init</sender>
+ <signal>clicked()</signal>
+ <receiver>IntegratorDlgBase</receiver>
+ <slot>init_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>login</sender>
+ <signal>clicked()</signal>
+ <receiver>IntegratorDlgBase</receiver>
+ <slot>login_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>clicked()</signal>
+ <receiver>IntegratorDlgBase</receiver>
+ <slot>createModule_clicked()</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repositoryLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repository</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>login</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>init</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>moduleLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>module</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>vendorLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>vendorTag</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>releaseLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>releaseTag</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>commentLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createModule</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comment</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>repository</tabstop>
+ <tabstop>module</tabstop>
+ <tabstop>vendorTag</tabstop>
+ <tabstop>releaseTag</tabstop>
+ <tabstop>comment</tabstop>
+ <tabstop>login</tabstop>
+ <tabstop>init</tabstop>
+</tabstops>
+<slots>
+ <slot>init_clicked()</slot>
+ <slot>login_clicked()</slot>
+ <slot>createModule_clicked()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/integrator/kdevcvsserviceintegrator.desktop b/vcs/cvsservice/integrator/kdevcvsserviceintegrator.desktop
new file mode 100644
index 00000000..f8c8a5f3
--- /dev/null
+++ b/vcs/cvsservice/integrator/kdevcvsserviceintegrator.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Service
+Name=KDevCVSIntegrator
+Name[da]=KDevelop CVS-integration
+Name[nds]=KDevelop-CVS-Integreren
+Name[sk]=KDev CVS integrácia
+Name[sv]=KDevelop CVS-integration
+Name[zh_TW]=KDevelop CVS 整合器
+Comment=CVS Service Project Integration Facility
+Comment[ca]=Facilitat d'integració amb projectes que usin CVS
+Comment[da]=CVS service projektintegration
+Comment[de]=CVS-Dienst-Projektintegration
+Comment[el]=Λειτουργία ενσωμάτωσης υπηρεσίας CVS στο έργο
+Comment[es]=Facilidad de integración con proyectos que utilicen CVS
+Comment[et]=CVS-teenuse projekti põimimisvahend
+Comment[eu]=CVS zerbitzuen proiektuen integrazio-tresna
+Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ خدمت CVS
+Comment[fr]=Fonction d'intégration pour un projet utilisant le service CVS
+Comment[gl]=Utilidade para a integración de proxectos do servizo CVS
+Comment[hu]=Integrálás a Cvsservice-szel
+Comment[it]=Funzione di integrazione del progetto CVS Service
+Comment[ja]=CVS サービス プロジェクト統合ツール
+Comment[ms]=Kemudahan Integrasi Projek Servis CVS
+Comment[nds]=Projektintegreren för den CVS-Deenst
+Comment[ne]=CVS सेवा परियोजना एकिकरण सुविधा
+Comment[nl]=CVS project-integratie
+Comment[pl]=Integracja z usługą CVS
+Comment[pt]=Integração com Projectos de Serviço CVS
+Comment[pt_BR]=Facilidade de Integração ao Projeto do Serviço CVS
+Comment[ru]=Интеграция CVS
+Comment[sk]=Integrácia CVS projektu
+Comment[sr]=Интеграција Cervisia-је у пројекат
+Comment[sr@Latn]=Integracija Cervisia-je u projekat
+Comment[sv]=Funktion för integrering av CVS-tjänst i projekt
+Comment[tr]=CVS Servis Projesi Bütünleştirme Aracı
+Comment[zh_CN]=CVS 服务工程集成功能
+Comment[zh_TW]=CVS 服務專案整合工具
+Icon=cervisia
+Exec=blubb
+ServiceTypes=KDevelop/VCSIntegrator
+X-KDE-Library=libcvsserviceintegrator
+X-KDevelop-Default=true
+X-KDevelop-VCS=CVS
+X-KDevelop-VCSPlugin=kdevcvsservice
+X-KDevelop-Version=5
diff --git a/vcs/cvsservice/jobscheduler.cpp b/vcs/cvsservice/jobscheduler.cpp
new file mode 100644
index 00000000..0c9a55ea
--- /dev/null
+++ b/vcs/cvsservice/jobscheduler.cpp
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "jobscheduler.h"
+
+#include "cvsprocesswidget.h"
+
+#include "kdebug.h"
+#include "dcopref.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class JobScheduler
+///////////////////////////////////////////////////////////////////////////////
+
+JobScheduler::JobScheduler( CvsProcessWidget *aProcessWidget )
+ : m_processWidget( aProcessWidget )
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+JobScheduler::~JobScheduler()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// class DirectScheduler
+///////////////////////////////////////////////////////////////////////////////
+
+DirectScheduler::DirectScheduler( CvsProcessWidget *aProcessWidget )
+ : JobScheduler( aProcessWidget )
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool DirectScheduler::schedule( DCOPRef &job )
+{
+ if (job.isNull())
+ {
+ kdDebug(9006) << "DirectScheduler::schedule(DCOPRef &): Job is null and will be rejected!" << endl;
+ return false;
+ }
+ processWidget()->startJob( job );
+
+ return true;
+}
diff --git a/vcs/cvsservice/jobscheduler.h b/vcs/cvsservice/jobscheduler.h
new file mode 100644
index 00000000..3bf7397a
--- /dev/null
+++ b/vcs/cvsservice/jobscheduler.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef JOBSCHEDULER_H
+#define JOBSCHEDULER_H
+
+class CvsProcessWidget;
+class CvsJob_stub;
+class DCOPRef;
+
+/**
+ * A simple interface for CVS jobs scheduling
+ *
+ * @author Mario Scalas
+*/
+class JobScheduler
+{
+public:
+ JobScheduler( CvsProcessWidget *aProcessWidget );
+ virtual ~JobScheduler();
+
+ virtual bool schedule( DCOPRef &job ) = 0;
+
+ CvsProcessWidget *processWidget() const { return m_processWidget; }
+
+private:
+ CvsProcessWidget *m_processWidget;
+};
+
+
+/**
+ * An implementation which simply run the job, without any buffering
+ *
+*/
+class DirectScheduler : public JobScheduler
+{
+public:
+ DirectScheduler( CvsProcessWidget *aProcessWidget );
+
+ virtual bool schedule( DCOPRef &job );
+};
+
+#endif
diff --git a/vcs/cvsservice/kdev_cvs.png b/vcs/cvsservice/kdev_cvs.png
new file mode 100644
index 00000000..921b0674
--- /dev/null
+++ b/vcs/cvsservice/kdev_cvs.png
Binary files differ
diff --git a/vcs/cvsservice/kdev_cvs.xcf b/vcs/cvsservice/kdev_cvs.xcf
new file mode 100644
index 00000000..aafee609
--- /dev/null
+++ b/vcs/cvsservice/kdev_cvs.xcf
Binary files differ
diff --git a/vcs/cvsservice/kdevcvsservice.desktop b/vcs/cvsservice/kdevcvsservice.desktop
new file mode 100644
index 00000000..4aa7226c
--- /dev/null
+++ b/vcs/cvsservice/kdevcvsservice.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=CVS Integration using Cervisia's cvsservice. http://www.kde.org/apps/cervisia/
+Comment[ca]=Integració amb el CVS emprant el cvsservice de Cervisia. http://www.kde.org/apps/cervisia/
+Comment[da]=CVS Integration ved brug af Cervisias cvsservice. http://www.kde.org/apps/cervisia/
+Comment[de]=CVS-Integration mit Hilfe von Cervisias cvsservice. http://www.kde.org/apps/cervisia/
+Comment[el]=Ενσωμάτωση CVS χρησιμοποιώντας τη cvsservice του Cervisia. http://www.kde.org/apps/cervisia/
+Comment[es]=Integración con CVS utilizando el cvsservice. http://www.kde.org/apps/cervisia/
+Comment[et]=CVS põimimine Cervisia cvsservice'i abil. http://www.kde.org/apps/cervisia/
+Comment[eu]=CVS integrazioa Cervisia-ren cvsservice erabiliz. http://www.kde.org/apps/cervisia/
+Comment[fa]=مجتمع‌سازی CVS، با استفاده از خدمت cvs متعلق به Cervisia. http://www.kde.org/apps/cervisia/
+Comment[fr]=Intégration de CVS à l'aide du processus « cvsservice » de Cervisia. http://www.kde.org/apps/cervisia/
+Comment[ga]=Comhtháthú CVS le cvsservice Cervisia. http://www.kde.org/apps/cervisia/
+Comment[gl]=Integración CVS usando o servizo cvsservice de Cervisia. http://www.kde.org/apps/cervisia/
+Comment[hu]=CVS-integráció a Cervisia cvsservice segítségével. http://www.kde.org/apps/cervisia/
+Comment[it]=Integrazione del CVS utilizzando il cvsservice di Cervisia. http://www.kde.org/apps/cervisia/
+Comment[ja]=CVS 統合は、Cervisia の CVS サービスを利用します。http://www.kde.org/apps/cervisia/
+Comment[ms]=Integrasi CVS menggunakan cvsservice Cervisia. http://www.kde.org/apps/cervisia/
+Comment[nds]=CVS-Integreren över den CVS-Service vun Cervisia. http://www.kde.org/apps/cervisia/
+Comment[ne]= Cervisia's cvsservice प्रयोग गरेर CVS एकिकरण । http://www.kde.org/apps/cervisia/
+Comment[nl]=CVS-integratie via Cervisia's cvsservice. Zie http://www.kde.org/apps/cervisia/
+Comment[pl]=Integracja z CVS-em za pomocą usługi CVS Cervisii http://www.kde.org/apps/cervisia/
+Comment[pt]=Integração do CVS usando o cvsservice do Cervisia. http://www.kde.org/apps/cervisia/
+Comment[pt_BR]=Integração com o CVS usando o cvsservice do Cervisia. http://www.kde.org/apps/cervisia/
+Comment[ru]=Интеграция CVS с использованием Cervisia cvsservice. http://www.kde.org/apps/cervisia/
+Comment[sk]=Integrácia CVS pomocou Cervisia Cvs služby. http://www.kde.org/apps/cervisia/
+Comment[sl]=Integracija CVS z uporabo Cervisijeve cvsservice. http://www.kde.org/apps/cervisia/
+Comment[sr]=Интеграција CVS-а помоћу Cervisia-jиног cvsservice. http://www.kde.org/apps/cervisia/
+Comment[sr@Latn]=Integracija CVS-a pomoću Cervisia-jinog cvsservice. http://www.kde.org/apps/cervisia/
+Comment[sv]=Integrering av CVS med användning av Cervisias CVS-tjänst. http://www.kde.org/apps/cervisia/
+Comment[tr]=Cervisia'nın cvsservice'i kullanılarak CVS bütünleştirilmesi http://www.kde.org/apps/cervisia/
+Comment[zh_CN]=使用 Cervisia 的 cvsservice 的 CVS 集成。http://www.kde.org/apps/cervisia/
+Comment[zh_TW]=使用 Cervisia 服務做 CVS 整合。http://www.kde.org/apps/cervisia/
+Name=KDevCvsService
+Name[da]=KDevelop CVS-service
+Name[nds]=KDevelop-CVS-Deenst
+Name[sk]=KDev Cvs služba
+Name[sv]=KDevelop CVS-tjänst
+Name[zh_TW]=KDevelop CVS 服務
+GenericName=CVS Integration (Cervisia)
+GenericName[ca]=Integració amb CVS (Cervisia)
+GenericName[de]=Unterstützung für CVS (Cervisia)
+GenericName[el]=Ενσωμάτωση CVS (Cervisia)
+GenericName[es]=Integración con CVS (Cervisia)
+GenericName[et]=CVS põimimine (Cervisia)
+GenericName[eu]=CVS integrazioa (Cervisia)
+GenericName[fa]=مجتمع‌سازی CVS (Cervisia)
+GenericName[fr]=Intégration de CVS (Cervisia)
+GenericName[ga]=Comhtháthú CVS (Cervisia)
+GenericName[gl]=Integración CVS (Cervisia)
+GenericName[hu]=CVS-integráció (Cervisia)
+GenericName[it]=Integrazione CVS (Cervisia)
+GenericName[ja]=CVS 統合 (Cervisia)
+GenericName[ms]=Integrasi CVS (Cervisia)
+GenericName[nds]=Ünnerstütten för CVS (Cervisia)
+GenericName[ne]=CVS एकिकरण (Cervisia)
+GenericName[nl]=CVS-integratie (Cervisia)
+GenericName[pl]=Integracja z CVS-em (Cervisia)
+GenericName[pt]=Integração com CVS (Cervisia)
+GenericName[pt_BR]=Integração com o CVS (Cervisia)
+GenericName[ru]=Интеграция CVS (Cervisia)
+GenericName[sk]=CVS integrácia (Cervisia)
+GenericName[sl]=Integracija CVS (Cervisia)
+GenericName[sr]=Интеграција CVS-а (Cervisia)
+GenericName[sr@Latn]=Integracija CVS-a (Cervisia)
+GenericName[sv]=Integrering av CVS (Cervisia)
+GenericName[ta]=CVS ஒருங்கிணை (செர்விசியா)
+GenericName[tg]=Интегратсияи CVS (Cervisia)
+GenericName[tr]=CVS Bütünleştirmesi (Cervisia)
+GenericName[zh_CN]=CVS 集成(Cervisia)
+GenericName[zh_TW]=CVS 整合(Cervisia)
+Icon=cervisia
+ServiceTypes=KDevelop/VersionControl
+X-KDE-Library=libkdevcvsservice
+X-KDevelop-Version=5
+X-KDevelop-Properties=VCS,CVSService
diff --git a/vcs/cvsservice/kdevcvsservicepart.rc b/vcs/cvsservice/kdevcvsservicepart.rc
new file mode 100644
index 00000000..a1bce434
--- /dev/null
+++ b/vcs/cvsservice/kdevcvsservicepart.rc
@@ -0,0 +1,36 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevCvsServicePart" version="2">
+<MenuBar>
+ <Menu name="tools">
+ <Menu name="version_control">
+ <Text>&amp;Version Control</Text>
+ <Merge />
+ <Menu name="version_control_tools_cvsservice" group="tools_project_operations">
+ <Text>&amp;CVS Service</Text>
+ <Action name="cvsservice_commit" />
+ <Action name="cvsservice_diff" />
+ <Action name="cvsservice_log" />
+ <Action name="cvsservice_annotate" />
+ <Action name="cvsservice_editors" />
+ <Action name="cvsservice_edit" />
+ <Action name="cvsservice_unedit" />
+ <Action name="cvsservice_add" />
+ <Action name="cvsservice_add_bin" />
+ <Action name="cvsservice_remove" />
+ <Separator />
+ <Action name="cvsservice_tag" />
+ <Action name="cvsservice_untag" />
+ <Action name="cvsservice_update" />
+ <Action name="cvsservice_removesticky" />
+ <Separator />
+ <Action name="cvsservice_ignore" />
+ <Action name="cvsservice_donot_ignore" />
+ <Separator />
+ <Action name="cvsservice_login" />
+ <Action name="cvsservice_logout" />
+ </Menu>
+ </Menu>
+ </Menu>
+</MenuBar>
+</kpartgui>
+
diff --git a/vcs/cvsservice/releaseinputdialog.cpp b/vcs/cvsservice/releaseinputdialog.cpp
new file mode 100644
index 00000000..31907769
--- /dev/null
+++ b/vcs/cvsservice/releaseinputdialog.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qlabel.h>
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+
+#include "releaseinputdialog.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class ReleaseInputDialog
+///////////////////////////////////////////////////////////////////////////////
+
+ReleaseInputDialog::ReleaseInputDialog( QWidget* parent)
+ : ReleaseInputDialogBase( parent, "releaseinputdialog", true, 0 )
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+ReleaseInputDialog::~ReleaseInputDialog()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool ReleaseInputDialog::isRevert() const
+{
+ return revertCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString ReleaseInputDialog::release() const
+{
+ if (type() == byRevision)
+ return " -r " + revisionEdit->text();
+ else if (type() == byDate)
+ return " -D " + dateEdit->text();
+ else
+ return QString::null;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+ReleaseInputDialog::ReleaseType ReleaseInputDialog::type() const
+{
+ if (revisionRadio->isChecked())
+ return byRevision;
+ else if (dateRadio->isChecked())
+ return byDate;
+ else
+ return byHead;
+}
+
+#include "releaseinputdialog.moc"
+
diff --git a/vcs/cvsservice/releaseinputdialog.h b/vcs/cvsservice/releaseinputdialog.h
new file mode 100644
index 00000000..5de2c3e6
--- /dev/null
+++ b/vcs/cvsservice/releaseinputdialog.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef RELEASEINPUTDIALOG_H
+#define RELEASEINPUTDIALOG_H
+
+#include "releaseinputdialogbase.h"
+
+/**
+* Every time an operation needs to prompt the user about a release name,
+* it can use this class: just customize the message to display
+*/
+class ReleaseInputDialog : public ReleaseInputDialogBase
+{
+ Q_OBJECT
+
+public:
+ /**
+ * C-tor
+ * @param parent
+ */
+ ReleaseInputDialog( QWidget* parent = 0 );
+ /**
+ * Destructor
+ */
+ virtual ~ReleaseInputDialog();
+
+ /**
+ * @return a QString formatted as "-r <RELEASE-TAG> " or "-D <RELEASE-DATE> "
+ * so it can be embedded in the command line.
+ */
+ QString release() const;
+
+ /**
+ * @return true if the user has checked "rever": enforce operation then even
+ * if the files have been locally modified.
+ */
+ bool isRevert() const;
+
+private:
+ enum ReleaseType { byHead, byDate, byRevision };
+
+ ReleaseType type() const;
+};
+
+#endif
+
diff --git a/vcs/cvsservice/releaseinputdialogbase.ui b/vcs/cvsservice/releaseinputdialogbase.ui
new file mode 100644
index 00000000..be5bf136
--- /dev/null
+++ b/vcs/cvsservice/releaseinputdialogbase.ui
@@ -0,0 +1,246 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ReleaseInputDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>ReleaseInputDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>626</width>
+ <height>239</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Update/Revert to Release/Branch/Date</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Revision</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>headRadio</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Most recent from current branch</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>revisionRadio</cstring>
+ </property>
+ <property name="text">
+ <string>An arbitrary &amp;revision/tag/branch:</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>revisionEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Type your release name here (leave empty for HEAD)</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Fill the field with the release or branch name (e.g. &lt;i&gt;make_it_cool, kdevelop_alpha5, ...&lt;/i&gt;)</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>dateRadio</cstring>
+ </property>
+ <property name="text">
+ <string>An arbitrary &amp;date:</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>dateEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>FIll the field with a date (e.g. &lt;i&gt;20030204&lt;/i&gt;)</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Additional Options</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>revertCheck</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enforce even if the file has been locally modified (revert)</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>140</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>ReleaseInputDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>ReleaseInputDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>dateRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>dateEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>revisionRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>revisionEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/cvsservice/tagdialog.cpp b/vcs/cvsservice/tagdialog.cpp
new file mode 100644
index 00000000..846cfce9
--- /dev/null
+++ b/vcs/cvsservice/tagdialog.cpp
@@ -0,0 +1,74 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <klineedit.h>
+#include <qcheckbox.h>
+
+#include "tagdialog.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// class TagDialog
+///////////////////////////////////////////////////////////////////////////////
+
+TagDialog::TagDialog( const QString &caption, QWidget *parent, const char *name )
+ : TagDialogBase( parent, name ? name : "tagdialog", true )
+{
+ if (!caption.isEmpty())
+ {
+ setCaption( caption );
+ }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+TagDialog::~TagDialog()
+{
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+void TagDialog::accept()
+{
+ if (tagBranchEdit->text().isEmpty())
+ return;
+
+ TagDialogBase::accept();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString TagDialog::tagName() const
+{
+ return tagBranchEdit->text();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+QString TagDialog::branchName() const
+{
+ return tagName();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool TagDialog::isBranch() const
+{
+ return tagAsBranchCheck->isChecked();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+bool TagDialog::force() const
+{
+ return forceCheck->isChecked();
+}
+
+#include "tagdialog.moc"
diff --git a/vcs/cvsservice/tagdialog.h b/vcs/cvsservice/tagdialog.h
new file mode 100644
index 00000000..86b63010
--- /dev/null
+++ b/vcs/cvsservice/tagdialog.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef TAGDIALOG_H
+#define TAGDIALOG_H
+
+#include "tagdialogbase.h"
+
+/**
+* Implementation for a dialog collecting data for tagging / branching
+* CVS repositories.
+*
+* @author Mario Scalas
+*/
+class TagDialog : public TagDialogBase
+{
+ Q_OBJECT
+public:
+ TagDialog( const QString &caption, QWidget *parent = 0, const char *name = 0 );
+ virtual ~TagDialog();
+
+ /**
+ * @return the tag name selected by the user
+ */
+ QString tagName() const;
+ /**
+ * @return the branch name selected by the user
+ */
+ QString branchName() const;
+ /**
+ * @return true if the user want to branch the selected files
+ */
+ bool isBranch() const;
+ /**
+ * @return true if operation must be enforced
+ */
+ bool force() const;
+
+protected slots:
+ virtual void accept();
+};
+
+#endif
diff --git a/vcs/cvsservice/tagdialogbase.ui b/vcs/cvsservice/tagdialogbase.ui
new file mode 100644
index 00000000..ce816c2d
--- /dev/null
+++ b/vcs/cvsservice/tagdialogbase.ui
@@ -0,0 +1,159 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>TagDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>TagDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>410</width>
+ <height>175</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tag Files on CVS Repository</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Tag/Branch &amp;name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>tagBranchEdit</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>tagBranchEdit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>tagAsBranchCheck</cstring>
+ </property>
+ <property name="text">
+ <string>Tag as &amp;branch</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>forceCheck</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Force</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="Line">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>TagDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>TagDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/perforce/Makefile.am b/vcs/perforce/Makefile.am
new file mode 100644
index 00000000..e684e2f0
--- /dev/null
+++ b/vcs/perforce/Makefile.am
@@ -0,0 +1,19 @@
+# Here resides the cvs part
+
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/util $(all_includes)
+
+kde_module_LTLIBRARIES = libkdevperforce.la
+libkdevperforce_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+libkdevperforce_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+
+libkdevperforce_la_SOURCES = perforcepart.cpp commitdlg.cpp
+
+METASOURCES = AUTO
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevperforce.desktop
+
+rcdir = $(kde_datadir)/kdevperforce
+
+SUBDIRS = integrator
diff --git a/vcs/perforce/README b/vcs/perforce/README
new file mode 100644
index 00000000..731741e1
--- /dev/null
+++ b/vcs/perforce/README
@@ -0,0 +1,3 @@
+Please read the on-line, automaticaly updated KDevelop API documentation at:
+http://www.kdevelop.org
+or read the README.dox file.
diff --git a/vcs/perforce/README.dox b/vcs/perforce/README.dox
new file mode 100644
index 00000000..6a0ae647
--- /dev/null
+++ b/vcs/perforce/README.dox
@@ -0,0 +1,15 @@
+/** \class PerforcePart
+Integrates the perforce version managment system into KDevelop.
+
+\authors <a href="mailto:bernd AT kdevelop.org">Bernd Gehrmann</a> Copyright (C) 1999-2001
+\authors <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a> Copyright (C) 2002-2003
+
+\maintainer <a href="mailto:harry AT kdevelop.org">Harald Fernengel</a>
+
+\feature edit, revert and submit
+\feature use the diff frontend (also removes the crappy perforce diff headers)
+\feature Uses KAction, so you can assign your favourite shortcuts to the commands.
+
+\requirement Perforce 2003.1 http://www.perforce.com/perforce/products.html
+
+*/
diff --git a/vcs/perforce/commitdlg.cpp b/vcs/perforce/commitdlg.cpp
new file mode 100644
index 00000000..8a9be561
--- /dev/null
+++ b/vcs/perforce/commitdlg.cpp
@@ -0,0 +1,161 @@
+/***************************************************************************
+ * Copyright (C) 1999, 2000 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Modified for perforce 2002 by Harald Fernengel <harry@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "commitdlg.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qtextedit.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <kprocess.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <klineedit.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+
+#include <stdlib.h>
+
+#include "execcommand.h"
+
+CommitDialog::CommitDialog( QWidget *parent, const char *name )
+ : KDialogBase( parent, name, true, i18n("Perforce Submit"), Ok|Cancel|Details )
+{
+ QWidget *w = new QWidget( this, "main widget" );
+ setMainWidget( w );
+
+ edit = new QTextEdit( w );
+ QFontMetrics fm(edit->fontMetrics());
+ edit->setMinimumSize(fm.width("0")*40, fm.lineSpacing()*3);
+
+ QVBoxLayout *layout = new QVBoxLayout( w, 0, spacingHint() );
+ QLabel *editLabel = new QLabel(i18n("&Enter description:"), w);
+ editLabel->setBuddy(edit);
+ layout->addWidget(editLabel);
+ layout->addWidget(edit);
+
+ w = new QWidget( this, "details widget" );
+
+ clientEdit = new KLineEdit( w );
+ userEdit = new KLineEdit( w );
+ filesBox = new KListBox( w );
+
+ layout = new QVBoxLayout( w, 0, spacingHint() );
+ QLabel *clientLabel = new QLabel(i18n("C&lient:"), w);
+ clientLabel->setBuddy(clientEdit);
+ layout->addWidget(clientLabel);
+ layout->addWidget( clientEdit );
+ QLabel *userLabel = new QLabel(i18n("&User:"), w);
+ userLabel->setBuddy(userEdit);
+ layout->addWidget( userLabel );
+ layout->addWidget( userEdit );
+ QLabel *filesLabel = new QLabel(i18n("&File(s):"), w);
+ filesLabel->setBuddy(filesBox);
+ layout->addWidget( filesLabel );
+ layout->addWidget( filesBox );
+
+ setDetailsWidget( w );
+ autoGuess();
+ edit->setFocus();
+}
+
+CommitDialog::~CommitDialog()
+{
+}
+
+void CommitDialog::autoGuess()
+{
+ char *cenv;
+
+ cenv = getenv( "P4USER" );
+ if ( cenv ) {
+ setUser( QString::fromLocal8Bit( cenv ) );
+ }
+
+ cenv = getenv( "P4CLIENT" );
+ if ( cenv ) {
+ setClient( QString::fromLocal8Bit( cenv ) );
+ }
+}
+
+void CommitDialog::setFiles( const QStringList& lst )
+{
+ filesBox->clear();
+ setDepotFiles( lst );
+}
+
+void CommitDialog::setDepotFiles( const QStringList& lst )
+{
+ QStringList args;
+
+ args << "files";
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ args << (*it);
+ }
+
+ ExecCommand* cmd = new ExecCommand( "p4", args, QString::null, QStringList(), this );
+ connect( cmd, SIGNAL(finished( const QString&, const QString& )),
+ this, SLOT(getFilesFinished( const QString&, const QString& )) );
+}
+
+void CommitDialog::getFilesFinished( const QString& out, const QString& /* err */ )
+{
+ QStringList lst = QStringList::split( QChar('\n'), out );
+ for ( QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it ) {
+ int pos = (*it).find( QChar('#') );
+ if ( pos > 1 && (*it).startsWith( "//" ) ) {
+ filesBox->insertItem( (*it).left( pos ) );
+ }
+ }
+}
+
+QString CommitDialog::changeList() const
+{
+ QString lst;
+
+ lst += "Change: new\n"
+ "Client: " + client() + "\n"
+ "User: " + user() + "\n"
+ "Status: new\n"
+ "Description:\n ";
+
+ lst += logMessage().replace(QRegExp("\n"), "\n ") + "\n\n";
+
+ lst += "Files:\n";
+
+ for ( uint i = 0; i < filesBox->count(); ++i ) {
+ lst += " " + filesBox->text( i ) + "\n";
+ }
+
+ return lst;
+}
+
+void CommitDialog::accept()
+{
+ if ( client().isEmpty() ) {
+ setDetails( true );
+ KMessageBox::error( this, i18n("Please enter the P4 client name.") );
+ clientEdit->setFocus();
+ } else if ( user().isEmpty() ) {
+ setDetails( true );
+ KMessageBox::error( this, i18n("Please enter the P4 user.") );
+ userEdit->setFocus();
+ } else if ( filesBox->count() == 0 ) {
+ setDetails( true );
+ KMessageBox::error( this, i18n("The changelist does not contain any files.") );
+ } else {
+ KDialogBase::accept();
+ }
+}
+
+#include "commitdlg.moc"
diff --git a/vcs/perforce/commitdlg.h b/vcs/perforce/commitdlg.h
new file mode 100644
index 00000000..390681fd
--- /dev/null
+++ b/vcs/perforce/commitdlg.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ * Copyright (C) 1999, 2000 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Modified for perforce 2002 by Harald Fernengel <harry@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _COMMITDIALOG_H_
+#define _COMMITDIALOG_H_
+
+#include <qstringlist.h>
+#include <qtextedit.h>
+#include <klineedit.h>
+#include <klistbox.h>
+#include <kdialogbase.h>
+
+class KProcess;
+
+class CommitDialog : public KDialogBase
+{
+ Q_OBJECT
+public:
+ CommitDialog( QWidget *parent = 0, const char *name = 0 );
+ ~CommitDialog();
+
+ QString logMessage() const { return edit->text(); }
+ QString user() const { return userEdit->text(); }
+ QString client() const { return clientEdit->text(); }
+ QString changeList() const;
+
+ void setUser( const QString& usr ) { userEdit->setText( usr ); }
+ void setClient( const QString& clnt ) { clientEdit->setText( clnt ); }
+ void setFiles( const QStringList& lst );
+
+ /** tries to fill out user and client */
+ void autoGuess();
+
+protected slots:
+ void accept();
+
+private slots:
+ void getFilesFinished( const QString& out, const QString& err );
+
+private:
+ void setDepotFiles( const QStringList& lst );
+ QTextEdit *edit;
+ KLineEdit *clientEdit, *userEdit;
+ KListBox *filesBox;
+};
+
+#endif
+
diff --git a/vcs/perforce/integrator/Makefile.am b/vcs/perforce/integrator/Makefile.am
new file mode 100644
index 00000000..0df84d8e
--- /dev/null
+++ b/vcs/perforce/integrator/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+kde_module_LTLIBRARIES = libperforceintegrator.la
+libperforceintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries)
+libperforceintegrator_la_LIBADD =\
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la\
+ $(top_builddir)/lib/libkdevelop.la
+kde_services_DATA = kdevperforceintegrator.desktop
+noinst_HEADERS = perforceintegrator.h pfintegratordlg.h
+libperforceintegrator_la_SOURCES = perforceintegrator.cpp \
+ pfintegratordlgbase.ui pfintegratordlg.cpp
diff --git a/vcs/perforce/integrator/kdevperforceintegrator.desktop b/vcs/perforce/integrator/kdevperforceintegrator.desktop
new file mode 100644
index 00000000..d70c7f67
--- /dev/null
+++ b/vcs/perforce/integrator/kdevperforceintegrator.desktop
@@ -0,0 +1,44 @@
+[Desktop Entry]
+Type=Service
+Name=KDevPerforceIntegrator
+Name[da]=KDevelop Perforce-integration
+Name[nds]=KDevelop-Perforce-Integreren
+Name[sk]=KDev Perforce integrácia
+Name[sv]=KDevelop Perforce-integration
+Name[zh_TW]=KDevelop Perforce 整合器
+Comment=Perforce Project Integration Facility
+Comment[ca]=Facilitat per a la integració amb projectes Perforce
+Comment[da]=Perforce projektintegration
+Comment[de]=Perforce-Projektintegration
+Comment[el]=Λειτουργία ενσωμάτωσης Perforce στο έργο
+Comment[es]=Entorno para integración con proyectos Perforce
+Comment[et]=Perforce projekti põimimisvahend
+Comment[eu]=Perforce proiektuen integrazio-tresna
+Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ Perforce
+Comment[fr]=Fonction d'intégration pour un projet utilisant Perforce
+Comment[gl]=Utilidade para a integración de proxectos Perforce
+Comment[hu]=Integrálás a Perforce-szal
+Comment[it]=Funzione di integrazione del progetto Perforce
+Comment[ja]=Perforce プロジェクト統合ツール
+Comment[ms]=Kemudahan Integrasi Projek Perforce
+Comment[nds]=Perforce-Projektintegreren
+Comment[ne]=परफोर्स परियोजना एकिकरण सुविधा
+Comment[nl]=Perforce project-integratie
+Comment[pl]=Integracja z Perforce
+Comment[pt]=Integração com Projectos Perforce
+Comment[pt_BR]=Facilidade de Integração ao Projeto de Perforce
+Comment[ru]=Интеграция Perforce
+Comment[sk]=Perforce projektová integrácia
+Comment[sr]=Интеграција Perforce-а у пројекат
+Comment[sr@Latn]=Integracija Perforce-a u projekat
+Comment[sv]=Funktion för integrering av Perforce i projekt
+Comment[tr]=Perforce Proje Bütünleştirme Aracı
+Comment[zh_CN]=Perforce 工程集成功能
+Comment[zh_TW]=Perforce 專案整合工具
+Exec=blubb
+ServiceTypes=KDevelop/VCSIntegrator
+X-KDE-Library=libperforceintegrator
+X-KDevelop-Default=false
+X-KDevelop-VCS=Perforce
+X-KDevelop-VCSPlugin=kdevperforce
+X-KDevelop-Version=5
diff --git a/vcs/perforce/integrator/perforceintegrator.cpp b/vcs/perforce/integrator/perforceintegrator.cpp
new file mode 100644
index 00000000..a5e40a36
--- /dev/null
+++ b/vcs/perforce/integrator/perforceintegrator.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "perforceintegrator.h"
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "pfintegratordlg.h"
+
+static const KDevPluginInfo data("kdevperforceintegrator");
+typedef KDevGenericFactory<PerforceIntegrator> PerforceIntegratorFactory;
+K_EXPORT_COMPONENT_FACTORY( libperforceintegrator, PerforceIntegratorFactory(data) )
+
+PerforceIntegrator::PerforceIntegrator(QObject* parent, const char* name,
+ const QStringList // args
+ )
+ :KDevVCSIntegrator(parent, name)
+{
+}
+
+PerforceIntegrator::~PerforceIntegrator()
+{
+}
+
+VCSDialog* PerforceIntegrator::fetcher(QWidget* // parent
+ )
+{
+ return 0;
+}
+
+VCSDialog* PerforceIntegrator::integrator(QWidget* parent)
+{
+ PFIntegratorDlg *dlg = new PFIntegratorDlg(parent);
+ return dlg;
+}
+
+#include "perforceintegrator.moc"
diff --git a/vcs/perforce/integrator/perforceintegrator.h b/vcs/perforce/integrator/perforceintegrator.h
new file mode 100644
index 00000000..3bb82a2d
--- /dev/null
+++ b/vcs/perforce/integrator/perforceintegrator.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PERFORCEINTEGRATOR_H
+#define PERFORCEINTEGRATOR_H
+
+#include <kdevvcsintegrator.h>
+
+#include <qstringlist.h>
+
+class PerforceIntegrator : public KDevVCSIntegrator
+{
+Q_OBJECT
+public:
+ PerforceIntegrator(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~PerforceIntegrator();
+
+ virtual VCSDialog* fetcher(QWidget* parent);
+ virtual VCSDialog* integrator(QWidget* parent);
+
+};
+
+#endif
diff --git a/vcs/perforce/integrator/pfintegratordlg.cpp b/vcs/perforce/integrator/pfintegratordlg.cpp
new file mode 100644
index 00000000..917f2a20
--- /dev/null
+++ b/vcs/perforce/integrator/pfintegratordlg.cpp
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "pfintegratordlg.h"
+
+PFIntegratorDlg::PFIntegratorDlg(QWidget *parent, const char *name)
+ :PFIntegratorDlgBase(parent, name)
+{
+}
+
+void PFIntegratorDlg::accept()
+{
+}
+
+void PFIntegratorDlg::init(const QString &/*projectName*/, const QString &/*projectLocation*/)
+{
+}
+
+QWidget *PFIntegratorDlg::self()
+{
+ return const_cast<PFIntegratorDlg*>(this);
+}
+
+#include "pfintegratordlg.moc"
diff --git a/vcs/perforce/integrator/pfintegratordlg.h b/vcs/perforce/integrator/pfintegratordlg.h
new file mode 100644
index 00000000..a74b6749
--- /dev/null
+++ b/vcs/perforce/integrator/pfintegratordlg.h
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef PFINTEGRATORDLG_H
+#define PFINTEGRATORDLG_H
+
+#include "pfintegratordlgbase.h"
+#include <kdevvcsintegrator.h>
+
+class PFIntegratorDlg: public PFIntegratorDlgBase, public VCSDialog {
+Q_OBJECT
+public:
+ PFIntegratorDlg(QWidget *parent = 0, const char *name = 0);
+
+ virtual void accept();
+ virtual void init(const QString &projectName, const QString &projectLocation);
+ virtual QWidget *self();
+};
+
+#endif
diff --git a/vcs/perforce/integrator/pfintegratordlgbase.ui b/vcs/perforce/integrator/pfintegratordlgbase.ui
new file mode 100644
index 00000000..5b12a70f
--- /dev/null
+++ b/vcs/perforce/integrator/pfintegratordlgbase.ui
@@ -0,0 +1,47 @@
+<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>PFIntegratorDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>PFIntegratorDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>480</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>No options available for this VCS.</string>
+ </property>
+ </widget>
+ <spacer>
+ <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>435</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/perforce/kdevperforce.desktop b/vcs/perforce/kdevperforce.desktop
new file mode 100644
index 00000000..678eab7e
--- /dev/null
+++ b/vcs/perforce/kdevperforce.desktop
@@ -0,0 +1,82 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Integrates Perforce, a software configuration management system. http://www.perforce.com/
+Comment[ca]=Integra Perforce, un sistema de gestió de la configuració del programari. http://www.perforce.com/
+Comment[da]=Integrerer Perforce, et software-indstilling håndteringssystem. http://www.perforce.com/
+Comment[de]=Integration von Perforce, einem System zur Verwaltung von Software-Konfigurationen. http://www.perforce.com/
+Comment[el]=Ενσωματώνει το Perforce, ένα σύστημα διαχείρισης και ρύθμισης λογισμικού.http://www.perforce.com/
+Comment[es]=Integra Perforce, un sistema de adminsitración de la configuración del software. http://www.perforce.com/
+Comment[et]=Integreerib tarkvaraseadistuste haldamise süsteemi Perforce. http://www.perforce.com/
+Comment[eu]=Perforce integratzen du, software konfiguazio kudeaketa sistema bat. http://www.perforce.com/
+Comment[fa]=Perforce را مجتمع‌سازی می‌کند. یک سیستم مدیریت پیکربندی نرم‌افزار. http://www.perforce.com/
+Comment[fr]=Intègre « PerForce », un système de gestion de configuration de logiciels. http:/www.perforce.com/
+Comment[gl]=Integra Perforce, un sistema de xestións de configuracións. http://www.perforce.com/
+Comment[hi]=परफ़ोर्स को इंटीग्रेट करता है, जो कि सॉफ्टवेयर कॉन्फ़िगरेशन प्रबंधन तंत्र है. http://www.perforce.com/
+Comment[hu]=Integrációt biztosít a Perforce szoftverkonfigurációs rendszerrel - http://www.perforce.com/
+Comment[it]=Integra Perforce, un sistema per la configurazione software. http://www.perforce.com/
+Comment[ja]=ソフトウェア設定管理システム Perforce を統合します。
+Comment[ms]=Menggabungkan Perforce, sebuah sistem pengurusan tetapan perisian. http://www.perforce.com/
+Comment[nds]=Integreren vun Perforce, en Systeem för't Plegen vun Programminstellen. http://www.perforce.com/
+Comment[ne]=परफोर्स एकिकरण गर्दछ, सफ्टवेयर कन्फिगरेसन व्यवस्थापन प्रणाली http://www.perforce.com/
+Comment[nl]=Integreert Perforce, een systeem voor softwareconfiguratie. Zie http://www.perforce.com/
+Comment[pl]=Integracja z Perforce, systemem zarządzania konfiguracją oprogramowania. http://www.perforce.com/
+Comment[pt]=Integra o Perforce, um sistema de gestão de configurações de 'software'. http://www.perforce.com/
+Comment[pt_BR]=Integra o Perforce, um software de configuração e gerenciamento do sistema. http://www.perforce.com/
+Comment[ru]=Интегрирует Perforce, систему управления конфигурациями программного обеспечения. http://www.perforce.com/
+Comment[sk]=Integrácia Perforce, konfiguračný projektový manažment. http://www.perforce.com/
+Comment[sl]=Integrira Perforce, upravljalni sistem programja. http://www.perforce.com/
+Comment[sr]=Интегрише Perforce, систем за управљање подешавањем софтвера. http://www.perforce.com/
+Comment[sr@Latn]=Integriše Perforce, sistem za upravljanje podešavanjem softvera. http://www.perforce.com/
+Comment[sv]=Integrerar Perforce, ett konfigurationshanteringsverktyg för programvara. http://www.perforce.com/
+Comment[ta]=ஒருங்கிணைக்கும் Perforce, ஒரு மென்பொருள் மேலாளர் அமைப்பு. http://www.perforce.com/
+Comment[tg]=Интеграл намудани Perforce, барномаи идоракунандаро шарҳи барномаҳои таъмин нигоҳ медорад.http://www.perforce.com/
+Comment[tr]=Bir yazılım ayar yönetimi sistemi olan Perforce'u bütünleştirir. http://www.perforce.com/
+Comment[zh_CN]=集成 Perforce,系统配置管理软件 http://www.perforce.com/
+Comment[zh_TW]=整合 Perforce,一套軟體設定管理系統。http://www.perforce.com/
+Name=KDevPerforce
+Name[da]=KDevelop Perforce
+Name[de]=Unterstützung für Perforce (KDevelop)
+Name[hi]=के-डेव-परफ़ोर्स
+Name[nds]=Perforce-Ünnerstütten för KDevelop
+Name[sk]=KDev Perforce
+Name[sv]=KDevelop Perforce
+Name[ta]=Kdev Perforce
+Name[zh_TW]=KDevelop Perforce
+GenericName=Perforce Integration
+GenericName[ca]=Integració amb Perforce
+GenericName[da]=Perforce integration
+GenericName[de]=Perforce-Integration
+GenericName[el]=Ενσωμάτωση Perforce
+GenericName[es]=Integración de Perforce
+GenericName[et]=Perforce'i põimimine
+GenericName[eu]=Perforce integrazioa
+GenericName[fa]=مجتمع‌سازی Perforce
+GenericName[fr]=Intégration de « Perforce »
+GenericName[ga]=Comhtháthú Perforce
+GenericName[gl]=Integración de Perforce
+GenericName[hi]=परफ़ोर्स इंटीग्रेशन
+GenericName[hu]=Perforce-integráció
+GenericName[it]=Integrazione di Perforce
+GenericName[ms]=Intergrasi Perforce
+GenericName[nds]=Perforce-Integreren
+GenericName[ne]=परफोर्स इन्टिग्रेसन
+GenericName[nl]=Perforce-integratie
+GenericName[pl]=Integracja z Perforce
+GenericName[pt]=Integração com o Perforce
+GenericName[pt_BR]=Integração com o Perforce
+GenericName[ru]=Интеграция Perforce
+GenericName[sk]=Perforce integrácia
+GenericName[sl]=Integracija Perforce
+GenericName[sr]=Интеграција perforce-а
+GenericName[sr@Latn]=Integracija perforce-a
+GenericName[sv]=Integrering av Perforce
+GenericName[ta]=Perforce ஒருங்கிணைப்பு
+GenericName[tg]=Интегратсия Perforce
+GenericName[tr]=Perforce Bütünleştirmesi
+GenericName[zh_CN]=Perforce 集成
+GenericName[zh_TW]=Perforce 整合
+ServiceTypes=KDevelop/VersionControl
+X-KDE-Library=libkdevperforce
+X-KDevelop-Version=5
+X-KDevelop-Properties=VCS,PerforceVCS
diff --git a/vcs/perforce/kdevperforcepart.rc b/vcs/perforce/kdevperforcepart.rc
new file mode 100644
index 00000000..27b5fe08
--- /dev/null
+++ b/vcs/perforce/kdevperforcepart.rc
@@ -0,0 +1,23 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="KDevPerforcePart" version="1">
+<MenuBar>
+ <Menu name="tools">
+ <Menu name="version_control" group="tools_project_operations">
+ <Text>&amp;Version Control</Text>
+ <Merge />
+ <Menu name="version_control_tools_perforce">
+ <Text>&amp;Perforce</Text>
+ <Action name="perforce_submit" />
+ <Action name="perforce_diff" />
+ <Action name="perforce_edit" />
+ <Action name="perforce_revert" />
+ <Action name="perforce_sync" />
+ <Action name="perforce_add" />
+ <Action name="perforce_remove" />
+ </Menu>
+ </Menu>
+ </Menu>
+</MenuBar>
+
+</kpartgui>
+
diff --git a/vcs/perforce/perforcepart.cpp b/vcs/perforce/perforcepart.cpp
new file mode 100644
index 00000000..9aeadc6f
--- /dev/null
+++ b/vcs/perforce/perforcepart.cpp
@@ -0,0 +1,364 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Extended 2002 by Harald Fernengel <harry@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "perforcepart.h"
+
+#include <qfileinfo.h>
+#include <qpopupmenu.h>
+#include <qregexp.h>
+#include <kpopupmenu.h>
+#include <kdebug.h>
+#include <kdevgenericfactory.h>
+#include <kprocess.h>
+#include <kmessagebox.h>
+#include <kapplication.h>
+#include <kaction.h>
+#include <kurl.h>
+#include <kparts/part.h>
+
+#include "kdevpartcontroller.h"
+#include "kdevcore.h"
+#include "kdevmakefrontend.h"
+#include "kdevdifffrontend.h"
+#include "kdevplugininfo.h"
+#include "commitdlg.h"
+#include "execcommand.h"
+
+static const KDevPluginInfo data("kdevperforce");
+
+typedef KDevGenericFactory<PerforcePart> PerforceFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevperforce, PerforceFactory( data ) )
+
+PerforcePart::PerforcePart( QObject *parent, const char *name, const QStringList & )
+ : KDevVersionControl( &data, parent, name ? name : "PerforcePart" )
+{
+ setInstance(PerforceFactory::instance());
+ setupActions();
+
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
+ this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+}
+
+
+PerforcePart::~PerforcePart()
+{}
+
+void PerforcePart::setupActions()
+{
+ actionEdit = new KAction( i18n("Edit"), 0, this, SLOT(slotActionEdit()),
+ actionCollection(), "perforce_edit" );
+ actionEdit->setToolTip(i18n("Edit"));
+ actionEdit->setWhatsThis(i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
+ actionRevert = new KAction( i18n("Revert"), 0, this, SLOT(slotActionRevert()),
+ actionCollection(), "perforce_revert" );
+ actionRevert->setToolTip(i18n("Revert"));
+ actionRevert->setWhatsThis(i18n("<b>Revert</b><p>Discards changes made to open files."));
+ actionSubmit = new KAction( i18n("Submit"), 0, this, SLOT(slotActionCommit()),
+ actionCollection(), "perforce_submit" );
+ actionSubmit->setToolTip(i18n("Submit"));
+ actionSubmit->setWhatsThis(i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
+ actionSync = new KAction( i18n("Sync"), 0, this, SLOT(slotActionUpdate()),
+ actionCollection(), "perforce_sync" );
+ actionSync->setToolTip(i18n("Sync"));
+ actionSync->setWhatsThis(i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
+ actionDiff = new KAction( i18n("Diff Against Repository"), 0, this, SLOT(slotActionDiff()),
+ actionCollection(), "perforce_diff" );
+ actionDiff->setToolTip(i18n("Diff against repository"));
+ actionDiff->setWhatsThis(i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
+ actionAdd = new KAction( i18n("Add to Repository"), 0, this, SLOT(slotActionAdd()),
+ actionCollection(), "perforce_add" );
+ actionAdd->setToolTip(i18n("Add to repository"));
+ actionAdd->setWhatsThis(i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
+ actionRemove = new KAction( i18n("Remove From Repository"), 0, this, SLOT(slotActionRemove()),
+ actionCollection(), "perforce_remove" );
+ actionRemove->setToolTip(i18n("Remove from repository"));
+ actionRemove->setWhatsThis(i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
+}
+
+void PerforcePart::contextMenu(QPopupMenu *popup, const Context *context)
+{
+ if (context->hasType( Context::FileContext )) {
+ const FileContext *fcontext = static_cast<const FileContext*>(context);
+ popupfile = fcontext->urls().first().path();
+ QFileInfo fi( popupfile );
+ popup->insertSeparator();
+
+ KPopupMenu *sub = new KPopupMenu(popup);
+ QString name = fi.fileName();
+ sub->insertTitle( i18n("Actions for %1").arg(name) );
+
+ int id = sub->insertItem( i18n("Edit"),
+ this, SLOT(slotEdit()) );
+ sub->setWhatsThis(id, i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
+ id = sub->insertItem( i18n("Revert"),
+ this, SLOT(slotRevert()) );
+ sub->setWhatsThis(id, i18n("<b>Revert</b><p>Discards changes made to open files."));
+ id = sub->insertItem( i18n("Submit"),
+ this, SLOT(slotCommit()) );
+ sub->setWhatsThis(id, i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
+ id = sub->insertItem( i18n("Sync"),
+ this, SLOT(slotUpdate()) );
+ sub->setWhatsThis(id, i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
+ sub->insertSeparator();
+ id = sub->insertItem( i18n("Diff Against Repository"),
+ this, SLOT(slotDiff()) );
+ sub->setWhatsThis(id, i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
+ id = sub->insertItem( i18n("Add to Repository"),
+ this, SLOT(slotAdd()) );
+ sub->setWhatsThis(id, i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
+ id = sub->insertItem( i18n("Remove From Repository"),
+ this, SLOT(slotRemove()) );
+ sub->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
+ id = popup->insertItem(i18n("Perforce"), sub);
+ }
+}
+
+void PerforcePart::execCommand( const QString& cmd, const QString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+
+ QFileInfo fi( filename );
+ if (fi.isDir()) {
+ KMessageBox::error( 0, i18n("Cannot handle directories, please select single files") );
+ return;
+ }
+ QString dir = fi.dirPath();
+ QString name = fi.fileName();
+
+ QString command("cd ");
+ command += KProcess::quote(dir);
+ command += " && p4 " + cmd + " ";
+ command += name;
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+}
+
+void PerforcePart::edit( const QString& filename )
+{
+ execCommand( "edit", filename );
+}
+
+void PerforcePart::revert( const QString& filename )
+{
+ if ( KMessageBox::questionYesNo( 0,
+ i18n("Do you really want to revert "
+ "the file %1 and lose all your changes?").arg( filename ), QString::null, i18n("Revert"), i18n("Do Not Revert") ) == KMessageBox::Yes ) {
+ execCommand( "revert", filename );
+ }
+}
+
+void PerforcePart::commit( const QString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+
+ QFileInfo fi( filename );
+ if ( fi.isDir() ) {
+ KMessageBox::error( 0, i18n("Submitting of subdirectories is not supported") );
+ return;
+ }
+
+ CommitDialog d;
+ QStringList lst;
+ lst << filename;
+ d.setFiles( lst );
+ if (d.exec() == QDialog::Rejected)
+ return;
+
+ QString message = d.changeList();
+ if (!message.isEmpty())
+ message = KShellProcess::quote(message);
+
+ QString command("echo " + message);
+ command += " | p4 submit -i";
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand("", command);
+}
+
+
+void PerforcePart::update( const QString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+
+ QString dir, name;
+ QFileInfo fi( filename );
+ if (fi.isDir()) {
+ dir = fi.absFilePath();
+ name = "..."; // three dots means "recoursive"
+ } else {
+ dir = fi.dirPath();
+ name = fi.fileName();
+ }
+
+ QString command("cd ");
+ command += KProcess::quote(dir);
+ command += " && p4 sync ";
+ command += name;
+
+ if (KDevMakeFrontend *makeFrontend = extension<KDevMakeFrontend>("KDevelop/MakeFrontend"))
+ makeFrontend->queueCommand(dir, command);
+}
+
+
+void PerforcePart::add( const QString& filename )
+{
+ execCommand( "add", filename );
+}
+
+
+void PerforcePart::remove( const QString& filename )
+{
+ execCommand( "delete", filename );
+}
+
+void PerforcePart::diff( const QString& filename )
+{
+ if ( filename.isEmpty() )
+ return;
+
+ QString name;
+ QFileInfo fi( filename );
+
+ if ( fi.isDir() ) {
+ name = fi.absFilePath() + "...";
+ } else {
+ name = filename;
+ }
+ QStringList args;
+
+ args << "diff";
+ args << "-du";
+ args << name;
+ ExecCommand* cmv = new ExecCommand( "p4", args, QString::null, QStringList(), this );
+ connect( cmv, SIGNAL(finished( const QString&, const QString& )),
+ this, SLOT(slotDiffFinished( const QString&, const QString& )) );
+}
+
+void PerforcePart::slotDiffFinished( const QString& diff, const QString& err )
+{
+ if ( diff.isNull() && err.isNull() ) {
+ kdDebug(9000) << "p4 diff cancelled" << endl;
+ return; // user pressed cancel or an error occured
+ }
+
+ if ( diff.isEmpty() && !err.isEmpty() ) {
+ KMessageBox::detailedError( 0, i18n("P4 output errors during diff."), err, i18n("Errors During Diff") );
+ return;
+ }
+
+ if ( !err.isEmpty() ) {
+ int s = KMessageBox::warningContinueCancelList( 0, i18n("P4 output errors during diff. Do you still want to continue?"),
+ QStringList::split( "\n", err, false ), i18n("Errors During Diff") );
+ if ( s != KMessageBox::Continue )
+ return;
+ }
+
+ if ( diff.isEmpty() ) {
+ KMessageBox::information( 0, i18n("There is no difference to the repository."), i18n("No Differences Found") );
+ return;
+ }
+
+ // strip the ==== headers
+ static QRegExp rx( "(^|\\n)==== ([^ ]+) -.*====\\n" );
+ rx.setMinimal( true );
+ QString strippedDiff = diff;
+ strippedDiff.replace( rx, "--- \\2\n+++ \\2\n" );
+
+ if (KDevDiffFrontend *diffFrontend = extension<KDevDiffFrontend>("KDevelop/DiffFrontend"))
+ diffFrontend->showDiff( strippedDiff );
+}
+
+QString PerforcePart::currentFile()
+{
+ KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*>( partController()->activePart() );
+ if ( part ) {
+ KURL url = part->url();
+ if ( url.isLocalFile() )
+ return url.path();
+ }
+ return QString::null;
+}
+
+void PerforcePart::slotActionCommit()
+{
+ commit( currentFile() );
+}
+
+void PerforcePart::slotActionUpdate()
+{
+ update( currentFile() );
+}
+void PerforcePart::slotActionAdd()
+{
+ add( currentFile() );
+}
+
+void PerforcePart::slotActionRemove()
+{
+ remove( currentFile() );
+}
+
+void PerforcePart::slotActionEdit()
+{
+ edit( currentFile() );
+}
+
+void PerforcePart::slotActionRevert()
+{
+ revert( currentFile() );
+}
+
+void PerforcePart::slotActionDiff()
+{
+ diff( currentFile() );
+}
+
+void PerforcePart::slotCommit()
+{
+ commit( popupfile );
+}
+
+void PerforcePart::slotUpdate()
+{
+ update( popupfile );
+}
+
+void PerforcePart::slotAdd()
+{
+ add( popupfile );
+}
+
+void PerforcePart::slotRemove()
+{
+ remove( popupfile );
+}
+
+void PerforcePart::slotEdit()
+{
+ edit( popupfile );
+}
+
+void PerforcePart::slotRevert()
+{
+ revert( popupfile );
+}
+
+void PerforcePart::slotDiff()
+{
+ diff( popupfile );
+}
+
+#include "perforcepart.moc"
diff --git a/vcs/perforce/perforcepart.h b/vcs/perforce/perforcepart.h
new file mode 100644
index 00000000..5a50871c
--- /dev/null
+++ b/vcs/perforce/perforcepart.h
@@ -0,0 +1,79 @@
+/***************************************************************************
+ * Copyright (C) 1999-2001 by Bernd Gehrmann *
+ * bernd@kdevelop.org *
+ * Extended to use perforce 2002 by Harald Fernengel <harry@kdevelop.org>*
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _PERFORCEPART_H_
+#define _PERFORCEPART_H_
+
+#include <kdevversioncontrol.h>
+#include <klocale.h>
+
+class Context;
+class QPopupMenu;
+class KAction;
+
+class PerforcePart : public KDevVersionControl
+{
+ Q_OBJECT
+
+public:
+ PerforcePart( QObject *parent, const char *name, const QStringList & );
+ ~PerforcePart();
+
+ virtual QString shortDescription() const
+ { return i18n( "Perforce is a version control system" ); }
+
+ virtual void createNewProject(const QString& /* dir */) {}
+ virtual bool fetchFromRepository() { return true; }
+ virtual KDevVCSFileInfoProvider *fileInfoProvider() const { return 0; }
+ virtual bool isValidDirectory(const QString& /* dirPath*/) const
+ { return true; }
+
+private slots:
+ void contextMenu(QPopupMenu *popup, const Context *context);
+ void slotCommit();
+ void slotUpdate();
+ void slotAdd();
+ void slotRemove();
+ void slotEdit();
+ void slotRevert();
+ void slotDiff();
+
+ void slotActionCommit();
+ void slotActionUpdate();
+ void slotActionAdd();
+ void slotActionRemove();
+ void slotActionEdit();
+ void slotActionRevert();
+ void slotActionDiff();
+
+ void slotDiffFinished( const QString&, const QString& );
+
+private:
+ void commit( const QString& filename );
+ void update( const QString& filename );
+ void add( const QString& filename );
+ void remove( const QString& filename );
+ void edit( const QString& filename );
+ void revert( const QString& filename );
+ void diff( const QString& filename );
+ QString currentFile();
+
+ /** calls p4 with the command cmd and appends the filename */
+ void execCommand( const QString& cmd, const QString& filename );
+ void setupActions();
+ QString popupfile;
+ KAction *actionEdit, *actionRevert,
+ *actionSubmit, *actionSync,
+ *actionDiff, *actionAdd, *actionRemove;
+};
+
+#endif
diff --git a/vcs/subversion/Makefile.am b/vcs/subversion/Makefile.am
new file mode 100644
index 00000000..449d3889
--- /dev/null
+++ b/vcs/subversion/Makefile.am
@@ -0,0 +1,38 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces -I$(top_srcdir)/lib/util -I$(top_srcdir)/lib/interfaces/extensions $(SVN_INCLUDE) $(all_includes)
+
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libkdevsubversion.la kio_kdevsvn.la kded_kdevsvnd.la
+
+libkdevsubversion_la_SOURCES = subversion_core.cpp subversion_fileinfo.cpp \
+ subversion_fileinfo.skel subversion_part.cpp subversion_widget.cpp subversiondiff.ui \
+ subversionprojectwidget.ui svn_blamewidget.cpp svn_co.ui svn_commitdlgbase.ui svn_copydlgwidget.ui \
+ svn_copywidget.cpp svn_fileselectdlg_commit.cpp svn_logviewoptiondlgbase.ui \
+ svn_logviewwidget.cpp svn_mergeoptiondlgbase.ui svn_mergewidget.cpp svn_switchdlgbase.ui \
+ svn_switchwidget.cpp
+libkdevsubversion_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/interfaces/extensions/libkdevextensions.la
+libkdevsubversion_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
+
+
+kio_kdevsvn_la_SOURCES = svn_kio.cpp
+kio_kdevsvn_la_LIBADD = $(LIB_KIO)
+kio_kdevsvn_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN) $(SVN_LIB)
+
+kded_kdevsvnd_la_SOURCES = commitdlg.cpp commitdlgbase.ui kdevsvnd.cpp \
+ kdevsvnd.skel kdevsvnd_widgets.cpp svnssltrustpromptbase.ui
+kded_kdevsvnd_la_LIBADD = $(LIB_KIO) -lkdeinit_kded
+kded_kdevsvnd_la_LDFLAGS = -module $(all_libraries) $(KDE_PLUGIN)
+
+kdeddir = $(kde_servicesdir)/kded
+kded_DATA = kdevsvnd.desktop
+
+servicedir = $(kde_servicesdir)
+service_DATA = kdevsubversion.desktop
+
+protocoldir = $(kde_servicesdir)
+protocol_DATA = kdevsvn+file.protocol kdevsvn+http.protocol kdevsvn+https.protocol kdevsvn+ssh.protocol kdevsvn+svn.protocol
+
+
+SUBDIRS = integrator
+noinst_HEADERS = commitdlg.h kdevsvnd.h svn_blamewidget.h svn_copywidget.h \
+ svn_fileselectdlg_commit.h svn_logviewwidget.h svn_mergewidget.h svn_switchwidget.h
diff --git a/vcs/subversion/README.dox b/vcs/subversion/README.dox
new file mode 100644
index 00000000..df3badcc
--- /dev/null
+++ b/vcs/subversion/README.dox
@@ -0,0 +1,13 @@
+/** \class subversionPart
+Integrates the SVN (Subversion) version management system into KDevelop.
+
+\authors <a href="mailto:marchand AT kde.org">Mickael Marchand</a>
+
+\maintainer <a href="mailto:marchand AT kde.org">Mickael Marchand</a>
+
+\feature Integrates the SVN (Subversion) version management system into KDevelop.
+
+\requirement You need to compile and install kdesdk/kioslave/svn
+
+*/
+
diff --git a/vcs/subversion/commitdlg.cpp b/vcs/subversion/commitdlg.cpp
new file mode 100644
index 00000000..e227dd67
--- /dev/null
+++ b/vcs/subversion/commitdlg.cpp
@@ -0,0 +1,47 @@
+/***************************************************************************
+ * This file is part of KDevelop *
+ * Copyright (C) 2007 The KDevelop Authors <kdevelop-devel@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "commitdlg.h"
+#include <qevent.h>
+#include <ktextedit.h>
+
+CommitDlg::CommitDlg( QWidget* parent )
+ : CommitDlgBase( parent )
+{
+ textMessage->installEventFilter(this);
+}
+
+bool CommitDlg::eventFilter( QObject* obj, QEvent* ev )
+{
+ if( ev->type() == QEvent::KeyPress )
+ {
+ QKeyEvent* k = static_cast<QKeyEvent*>(ev);
+ if( ( k->key() == Qt::Key_Return || k->key() == Qt::Key_Enter ) && k->state() == Qt::ControlButton )
+ {
+ accept();
+ return true;
+ }
+ }
+ return false;
+}
+
+#include "commitdlg.moc"
+
+//kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;
diff --git a/vcs/subversion/commitdlg.h b/vcs/subversion/commitdlg.h
new file mode 100644
index 00000000..4ac54054
--- /dev/null
+++ b/vcs/subversion/commitdlg.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ * This file is part of KDevelop *
+ * Copyright (C) 2007 The KDevelop Authors <kdevelop-devel@kdevelop.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Library General Public License as *
+ * published by the Free Software Foundation; either version 2 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Library General Public *
+ * License along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#ifndef COMMITDLG_H
+#define COMMITDLG_H
+
+#include "commitdlgbase.h"
+
+class CommitDlg : public CommitDlgBase
+{
+ Q_OBJECT
+public:
+ CommitDlg( QWidget* = 0 );
+protected:
+ bool eventFilter( QObject* o, QEvent* e );
+};
+
+#endif
+
+//kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;
diff --git a/vcs/subversion/commitdlgbase.ui b/vcs/subversion/commitdlgbase.ui
new file mode 100644
index 00000000..76499a60
--- /dev/null
+++ b/vcs/subversion/commitdlgbase.ui
@@ -0,0 +1,111 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>CommitDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>CommitDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>451</width>
+ <height>337</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Log Message</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>textMessage</cstring>
+ </property>
+ </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>listMessage</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <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>220</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>Ca&amp;ncel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>pushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>CommitDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>CommitDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>ktextedit.h</includehint>
+ <includehint>ktextedit.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/configure.in.bot b/vcs/subversion/configure.in.bot
new file mode 100644
index 00000000..ccab94db
--- /dev/null
+++ b/vcs/subversion/configure.in.bot
@@ -0,0 +1,9 @@
+if test "x$with_subversion" = xcheck && test -z "$SVN_SUBDIR"; then
+ echo ""
+ echo "You're missing Subversion libraries (1.x)"
+ echo "KDE will not be able to browse Subversion repositories without it,"
+ echo "consider installing it."
+ echo "Look at kioslave/svn/README for more information"
+ echo ""
+ all_tests=bad
+fi
diff --git a/vcs/subversion/configure.in.in b/vcs/subversion/configure.in.in
new file mode 100644
index 00000000..9bccba66
--- /dev/null
+++ b/vcs/subversion/configure.in.in
@@ -0,0 +1,134 @@
+SVN_SUBDIR=""
+
+AC_ARG_ENABLE(subversion, AC_HELP_STRING([--disable-subversion], [disable vcs support for subversion]), [with_subversion=${enableval}], [with_subversion=check])
+
+
+
+if test "x$with_subversion" != xno; then
+
+ APR_CONFIGS="/usr/bin/apr-config /usr/bin/apr-1-config /usr/local/bin/apr-config /usr/local/apr/bin/apr-config"
+ SVN_SUBDIR="svn"
+ AC_ARG_WITH(apr-config,
+ [[ --with-apr-config=FILE Use the given path to apr-config when determining
+ APR configuration; defaults to "apr-config"]],
+ [
+ if test "$withval" != "yes" -a "$withval" != ""; then
+ APR_CONFIGS=$withval
+ fi
+ ])
+ AC_MSG_CHECKING([for APR])
+ APR_CONFIG=""
+ for VALUE in $APR_CONFIGS ; do
+ if test -x "$VALUE"; then
+ if $VALUE --cflags > /dev/null; then
+ APR_CONFIG="$VALUE"
+ break
+ fi
+ fi
+ done
+ if test -n "$APR_CONFIG" ; then
+ AC_MSG_RESULT([$APR_CONFIG])
+ APR_CPPFLAGS="`$APR_CONFIG --cppflags`"
+ APR_INCLUDE="`$APR_CONFIG --includes`"
+ APR_LIBS="`$APR_CONFIG --link-ld --libs`"
+ else
+ AC_MSG_RESULT([not found])
+ SVN_SUBDIR=
+ fi
+
+ dnl
+ dnl APR util
+ dnl
+
+ APU_CONFIGS="/usr/bin/apu-config /usr/bin/apu-1-config /usr/local/bin/apu-config /usr/local/apu/bin/apu-config"
+ AC_ARG_WITH(apu-config,
+ [[ --with-apu-config=FILE Use the given path to apu-config when determining
+ APR util configuration; defaults to "apu-config"]],
+ [
+ if test "$withval" != "yes" -a "$withval" != ""; then
+ APU_CONFIGS=$withval
+ fi
+ ])
+ AC_MSG_CHECKING([for APR util])
+ APU_CONFIG=""
+ for VALUE in $APU_CONFIGS ; do
+ if test -x $VALUE
+ then
+ if $VALUE --includes > /dev/null; then
+ APU_CONFIG=$VALUE
+ break
+ fi
+ fi
+ done
+ if test -n "$APU_CONFIG"; then
+ AC_MSG_RESULT([found])
+ APR_INCLUDE="$APR_INCLUDE `$APU_CONFIG --includes`"
+ APR_LIBS="$APR_LIBS `$APU_CONFIG --link-ld --libs`"
+ else
+ AC_MSG_RESULT([not found])
+ SVN_SUBDIR=
+ fi
+
+ dnl Search for subversion libraries
+ dnl svn-config was removed at current subversion release.
+
+
+ SVN_INCLUDES="/usr/local/include /usr/include /usr/include/subversion-1 /usr/local/include/subversion-1"
+ AC_ARG_WITH(svn-include,
+ [[ --with-svn-include=DIR Use the given path to the subversion headers.]],
+ [
+ if test "$withval" != "yes" -a "$withval" != ""; then
+ SVN_INCLUDES=$withval
+ fi
+ ])
+ AC_MSG_CHECKING([for Subversion headers])
+ SVN_INCLUDE=""
+ for VALUE in $SVN_INCLUDES ; do
+ if test -f $VALUE/svn_types.h ; then
+ SVN_INCLUDE="-I$VALUE"
+ break
+ fi
+ done
+ if test $SVN_INCLUDE ; then
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_RESULT([not found])
+ SVN_SUBDIR=
+ fi
+ SVN_LIBS="/usr/local/lib /usr/lib /usr/lib64"
+ AC_ARG_WITH(svn-lib,
+ [[ --with-svn-lib=DIR Use the given path to the subversion libraries.]],
+ [
+ if test "$withval" != "yes" -a "$withval" != ""; then
+ SVN_LIBS=$withval
+ fi
+ ])
+ AC_MSG_CHECKING([for Subversion libraries])
+ SVN_LIB=""
+ for VALUE in $SVN_LIBS ; do
+ if ls $VALUE/libsvn_client-1.* 1>/dev/null 2>&1; then
+ SVN_LIB="-L$VALUE"
+ break
+ fi
+ done
+ if test $SVN_LIB ; then
+ AC_MSG_RESULT([found])
+ else
+ AC_MSG_RESULT([not found])
+ SVN_SUBDIR=
+ fi
+ SVN_LIB="$SVN_LIB $APR_LIBS -lsvn_client-1 -lsvn_subr-1 -lsvn_ra-1"
+ SVN_INCLUDE="$SVN_INCLUDE $APR_INCLUDE"
+ SVN_CPPFLAGS="$APR_CPPFLAGS $SVN_CPPFLAGS"
+
+ if test "x$with_subversion" != xcheck && test -z "$SVN_SUBDIR"; then
+ AC_MSG_ERROR([--enable-subversion was given, but test for subversion failed. Please install subversion headers and libraries and its dependencies (APR and APU utils)])
+ fi
+fi
+
+AM_CONDITIONAL(include_subversion, test -n "$SVN_SUBDIR")
+
+AC_SUBST(SVN_INCLUDE)
+AC_SUBST(SVN_LIB)
+AC_SUBST(SVN_CPPFLAGS)
+AM_CONDITIONAL(include_kioslave_svn, test -n "$SVN_SUBDIR")
diff --git a/vcs/subversion/integrator/Makefile.am b/vcs/subversion/integrator/Makefile.am
new file mode 100644
index 00000000..a0fe82cd
--- /dev/null
+++ b/vcs/subversion/integrator/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib/interfaces \
+ -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/extras -I$(top_srcdir)/lib/util \
+ $(all_includes)
+METASOURCES = AUTO
+
+kde_module_LTLIBRARIES = libsubversionintegrator.la
+libsubversionintegrator_la_LDFLAGS = -avoid-version -no-undefined $(all_libraries)
+libsubversionintegrator_la_LIBADD =\
+ $(top_builddir)/lib/interfaces/extras/libkdevextras.la\
+ $(top_builddir)/lib/libkdevelop.la
+kde_services_DATA = kdevsubversionintegrator.desktop
+noinst_HEADERS = subversionintegrator.h svnintegratordlg.h
+libsubversionintegrator_la_SOURCES = subversionintegrator.cpp \
+ svnintegratordlgbase.ui svnintegratordlg.cpp
diff --git a/vcs/subversion/integrator/kdevsubversionintegrator.desktop b/vcs/subversion/integrator/kdevsubversionintegrator.desktop
new file mode 100644
index 00000000..4b3a1c1c
--- /dev/null
+++ b/vcs/subversion/integrator/kdevsubversionintegrator.desktop
@@ -0,0 +1,45 @@
+[Desktop Entry]
+Type=Service
+Name=KDevSubversionIntegrator
+Name[da]=KDevelop Subversion-integration
+Name[nds]=KDevelop-Subversion-Integreren
+Name[sk]=KDev Subversion integrácia
+Name[sv]=KDevelop Subversion-integration
+Name[zh_TW]=KDevelop Subversion 整合器
+Comment=Subversion Project Integration Facility
+Comment[ca]=Facilitat per a la integració amb Subversion
+Comment[da]=Subversion projektintegration
+Comment[de]=Subversion-Projektintegration
+Comment[el]=Λειτουργία ενσωμάτωσης Subversion στο έργο
+Comment[es]=Facilidad para integración con proyectos que utilicen Subversion
+Comment[et]=Subversion projekti põimimisvahend
+Comment[eu]=Subversion proiektuen integrazio-tesna
+Comment[fa]=تسهیلات مجتمع‌سازی پروژۀ زیرنسخه
+Comment[fr]=Fonction d'intégration pour un projet utilisant Subversion
+Comment[gl]=Utilidade para a integración de proxectos Subversión
+Comment[hu]=Projektintegrálást tesz lehetővé a Subversion-nel
+Comment[it]=Funzione di integrazione del progetto Subversion
+Comment[ja]=Subversion プロジェクト統合ツール
+Comment[ms]=Kemudahan Integrasi Projek Subversion
+Comment[nds]=Subversion-Projektintegreren
+Comment[ne]=सबभर्सन परियोजना एकिकरण सुविधा
+Comment[nl]=Subversion project-integratie
+Comment[pl]=Integracja z Subversion
+Comment[pt]=Integração com Projectos Subversion
+Comment[pt_BR]=Facilidade de Integração ao Projeto de Subversão
+Comment[ru]=Интеграция Subversion
+Comment[sk]=Subversion projektová integrácia
+Comment[sr]=Интеграција Subversion-а у пројекат
+Comment[sr@Latn]=Integracija Subversion-a u projekat
+Comment[sv]=Funktion för integrering av Subversion i projekt
+Comment[tr]=Subversion Proje Bütünleştirme Aracı
+Comment[zh_CN]=Subversion 工程集成功能
+Comment[zh_TW]=Subversion 專案整合工具
+Icon=misc
+Exec=blubb
+ServiceTypes=KDevelop/VCSIntegrator
+X-KDE-Library=libsubversionintegrator
+X-KDevelop-Default=false
+X-KDevelop-VCS=Subversion
+X-KDevelop-VCSPlugin=kdevsubversion
+X-KDevelop-Version=5
diff --git a/vcs/subversion/integrator/subversionintegrator.cpp b/vcs/subversion/integrator/subversionintegrator.cpp
new file mode 100644
index 00000000..65bf1a78
--- /dev/null
+++ b/vcs/subversion/integrator/subversionintegrator.cpp
@@ -0,0 +1,54 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "subversionintegrator.h"
+
+#include <kdevgenericfactory.h>
+#include <kdevplugininfo.h>
+
+#include "svnintegratordlg.h"
+
+static const KDevPluginInfo data("kdevsubversionintegrator");
+typedef KDevGenericFactory<SubversionIntegrator> SubversionIntegratorFactory;
+K_EXPORT_COMPONENT_FACTORY( libsubversionintegrator, SubversionIntegratorFactory(data) )
+
+SubversionIntegrator::SubversionIntegrator(QObject* parent, const char* name,
+ const QStringList // args
+ )
+ :KDevVCSIntegrator(parent, name)
+{
+}
+
+SubversionIntegrator::~SubversionIntegrator()
+{
+}
+
+VCSDialog* SubversionIntegrator::fetcher(QWidget* // parent
+ )
+{
+ return 0;
+}
+
+VCSDialog* SubversionIntegrator::integrator(QWidget* parent)
+{
+ SvnIntegratorDlg *dlg = new SvnIntegratorDlg(parent);
+ return dlg;
+}
+
+#include "subversionintegrator.moc"
diff --git a/vcs/subversion/integrator/subversionintegrator.h b/vcs/subversion/integrator/subversionintegrator.h
new file mode 100644
index 00000000..e58c7786
--- /dev/null
+++ b/vcs/subversion/integrator/subversionintegrator.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SUBVERSIONINTEGRATOR_H
+#define SUBVERSIONINTEGRATOR_H
+
+#include <kdevvcsintegrator.h>
+
+#include <qstringlist.h>
+
+class SubversionIntegrator : public KDevVCSIntegrator
+{
+Q_OBJECT
+public:
+ SubversionIntegrator(QObject* parent, const char* name, const QStringList args = QStringList());
+ ~SubversionIntegrator();
+
+ virtual VCSDialog* fetcher(QWidget* parent);
+ virtual VCSDialog* integrator(QWidget* parent);
+
+};
+
+#endif
diff --git a/vcs/subversion/integrator/svnintegratordlg.cpp b/vcs/subversion/integrator/svnintegratordlg.cpp
new file mode 100644
index 00000000..9d271a90
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlg.cpp
@@ -0,0 +1,122 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * Copyright (C) 2004 *
+ * Mickael Marchand <marchand@kde.org> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#include "svnintegratordlg.h"
+#include "blockingkprocess.h"
+#include <kurl.h>
+#include <kio/jobclasses.h>
+#include <kio/job.h>
+#include <kurlrequester.h>
+#include <kdebug.h>
+#include <qradiobutton.h>
+#include <kio/scheduler.h>
+#include <kprocess.h>
+#include <kdeversion.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+#include <kio/netaccess.h>
+
+using namespace KIO;
+
+SvnIntegratorDlg::SvnIntegratorDlg( QWidget *parent, const char *name )
+ : SvnIntegratorDlgBase( parent, name )
+{
+ repos1->setMode( KFile::Directory );
+}
+
+void SvnIntegratorDlg::accept()
+{
+ // to let ioslave know which protocol it should start.
+ KURL protocolUrl = KURL("kdevsvn+svn://blah/");
+ KURL servURL( repos1->url() );
+ if ( servURL.isEmpty() ) return;
+
+ kdDebug( 9036 ) << "servURL : " << servURL.prettyURL() << endl;
+ if ( createProject->isChecked() )
+ {
+ KURL::List list;
+ list << servURL; // project root directory
+ KURL miscURL = servURL.url();
+ miscURL.setPath( servURL.path() + "/tags/" );
+ list << miscURL;
+ miscURL.setPath( servURL.path() + "/branches/" );
+ list << miscURL;
+ miscURL.setPath( servURL.path() + "/trunk/" );
+ list << miscURL;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 10; // MKDIR(list)
+ s << cmd << list;
+ KIO::SimpleJob* job = KIO::special( protocolUrl, parms, true );
+ if( !NetAccess::synchronousRun( job, 0 ) ){
+ KMessageBox::error( this, i18n("Unable to create project directories on repository") );
+ return;
+ }
+
+ QByteArray parms2;
+ QDataStream s2( parms2, IO_WriteOnly );
+ cmd = 5; //IMPORT
+ servURL.setPath( servURL.path() + "/trunk/" );
+ s2 << cmd << servURL << KURL::fromPathOrURL( m_projectLocation );
+ KIO::SimpleJob* importJob = KIO::special( protocolUrl, parms2, true );
+ if( !NetAccess::synchronousRun( importJob, 0 ) ){
+ KMessageBox::error( this, i18n("Unable to import into repository.") );
+ return;
+ }
+ }
+ //delete the template directory and checkout a fresh one from the server
+ BlockingKProcess *rmproc = new BlockingKProcess();
+ *rmproc << "rm";
+ *rmproc << "-f" << "-r" << m_projectLocation;
+ rmproc->start();
+
+ delete rmproc;
+ rmproc = NULL;
+
+ QByteArray parms3;
+ QDataStream s3( parms3, IO_WriteOnly );
+ int cmd2 = 1; //CHECKOUT
+ int rev = -1;
+
+ s3 << cmd2 << servURL << KURL::fromPathOrURL( m_projectLocation ) << rev << QString( "HEAD" );
+ SimpleJob *job2 = KIO::special( protocolUrl, parms3, true );
+ if( ! NetAccess::synchronousRun( job2, 0 ) ){
+ // Checkout failed
+ KMessageBox::error(this, i18n("Unable to checkout from repository.") );
+ return;
+ }
+}
+
+void SvnIntegratorDlg::init( const QString &projectName, const QString &projectLocation )
+{
+ m_name = projectName;
+ m_projectLocation = projectLocation;
+}
+
+QWidget *SvnIntegratorDlg::self()
+{
+ return const_cast<SvnIntegratorDlg*>( this );
+}
+
+#include "svnintegratordlg.moc"
diff --git a/vcs/subversion/integrator/svnintegratordlg.h b/vcs/subversion/integrator/svnintegratordlg.h
new file mode 100644
index 00000000..c68ee256
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlg.h
@@ -0,0 +1,39 @@
+/***************************************************************************
+ * Copyright (C) 2004 by Alexander Dymo *
+ * adymo@kdevelop.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+#ifndef SVNINTEGRATORDLG_H
+#define SVNINTEGRATORDLG_H
+
+#include "svnintegratordlgbase.h"
+#include <kdevvcsintegrator.h>
+
+class SvnIntegratorDlg: public SvnIntegratorDlgBase, public VCSDialog {
+Q_OBJECT
+public:
+ SvnIntegratorDlg(QWidget *parent = 0, const char *name = 0);
+
+ virtual void accept();
+ virtual void init(const QString &projectName, const QString &projectLocation);
+ virtual QWidget *self();
+private:
+ QString m_name;
+ QString m_projectLocation;
+};
+
+#endif
diff --git a/vcs/subversion/integrator/svnintegratordlgbase.ui b/vcs/subversion/integrator/svnintegratordlgbase.ui
new file mode 100644
index 00000000..a2ec9982
--- /dev/null
+++ b/vcs/subversion/integrator/svnintegratordlgbase.ui
@@ -0,0 +1,190 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnIntegratorDlgBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>SvnIntegratorDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>648</width>
+ <height>429</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>doNothing</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Do not do anything</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Adds subversion menus to project.
+
+NOTE: Unless you import the project
+out of kdevelop, you will not be able
+to perform any subversion operations.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Adds subversion menus to project.
+
+NOTE: Unless you import the project
+out of kdevelop, you will not be able
+to perform any subversion operations.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>createProject</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Create a project tree and import new project into trunk, then checkout from the repository</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Creates project, imports it into the subversion
+repository and checks it out as a working copy.
+
+NOTE: The repository has to exist.
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Creates project, imports it into the subversion
+repository and checks it out as a working copy.
+
+NOTE: The repository has to exist.
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Example for the url (if /home/user/subversion is the subversion repository):
+file:///home/user/subversion/mynewproject</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>repositoryLabel1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Repository:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>repos1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Subversion repository location.
+The repository has to exist -
+e.g. has been created with 'svnadmin'</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Subversion repository location. This should include the subdirectory for the project in the repository. The project subdirectory and further subdirectories will be created.
+
+So for example if you give http://localhost/svn/projectname the following directories will be created and the project imported into the trunk subdirectory:
+http://localhost/svn/projectname
+http://localhost/svn/projectname/tags
+http://localhost/svn/projectname/branches
+http://localhost/svn/projectname/trunk</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>21</width>
+ <height>131</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>createProject</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repositoryLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>createProject</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>repos1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/kdevpart_subversion.rc b/vcs/subversion/kdevpart_subversion.rc
new file mode 100644
index 00000000..ad957e99
--- /dev/null
+++ b/vcs/subversion/kdevpart_subversion.rc
@@ -0,0 +1,31 @@
+<!DOCTYPE kpartgui>
+<kpartplugin name="subversion" library="libsubversionplugin" version="2">
+<MenuBar>
+ <Menu name="tools"><Text>&amp;Tools</Text>
+ <Menu name="version_control"><Text>&amp;Version Control</Text>
+ <Merge/>
+ <Menu name="version_control_tools_subversion" group="tools_project_operations">
+ <Text>&amp;Subversion</Text>
+ <Action name="subversion_commit" />
+ <Action name="subversion_diff" />
+ <Action name="subversion_log" />
+ <Action name="subversion_add" />
+ <Action name="subversion_add_bin" />
+ <Action name="subversion_remove" />
+ <Separator />
+ <Action name="subversion_tag" />
+ <Action name="subversion_untag" />
+ <Action name="subversion_update" />
+ <Action name="subversion_removesticky" />
+ <Action name="subversion_revert" />
+ <Separator />
+ <Action name="subversion_ignore" />
+ <Action name="subversion_donot_ignore" />
+<!-- <Separator />
+ <Action name="subversion_login" />
+ <Action name="subversion_logout" /> -->
+ </Menu>
+ </Menu>
+ </Menu>
+</MenuBar>
+</kpartplugin>
diff --git a/vcs/subversion/kdevsubversion.desktop b/vcs/subversion/kdevsubversion.desktop
new file mode 100644
index 00000000..500b5fb0
--- /dev/null
+++ b/vcs/subversion/kdevsubversion.desktop
@@ -0,0 +1,34 @@
+[Desktop Entry]
+Type=Service
+Exec=blubb
+Comment=Subversion
+Comment[fa]=زیرنسخه
+Comment[hi]=सबवर्सन
+Comment[ne]=सबभर्सन
+Comment[pt_BR]=Subversão
+Comment[ru]=Интеграция Subversion
+Comment[ta]=உப பதிப்பு
+Comment[tg]=Интегратсия Subversion
+Name=KDevsubversion
+Name[da]=KDevelop Subversion
+Name[de]=Unterstützung für Subversion (KDevelop)
+Name[hi]=के-डेव-सबवर्सन
+Name[nds]=Subversion-Ünnerstütten för KDevelop
+Name[sk]=KDev Subversion
+Name[sv]=KDevelop Subversion
+Name[ta]=kdev உப பதிப்பு
+Name[tg]=KDevзер-ривоят
+Name[zh_TW]=KDevelop Subversion
+GenericName=Subversion
+GenericName[fa]=زیرنسخه
+GenericName[hi]=सबवर्सन
+GenericName[ne]=सबभर्सन
+GenericName[pt_BR]=Subversão
+GenericName[ru]=Интеграция Subversion
+GenericName[ta]=துணை பதிப்பு
+GenericName[tg]=Зер-ривоят
+Icon=misc
+ServiceTypes=KDevelop/VersionControl
+X-KDE-Library=libkdevsubversion
+X-KDevelop-Version=5
+X-KDevelop-Properties=VCS,SubversionVCS
diff --git a/vcs/subversion/kdevsvn+file.protocol b/vcs/subversion/kdevsvn+file.protocol
new file mode 100644
index 00000000..decc1cc4
--- /dev/null
+++ b/vcs/subversion/kdevsvn+file.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_kdevsvn
+protocol=kdevsvn+file
+input=none
+output=filesystem
+reading=true
+writing=true
+deleting=true
+makedir=true
+linking=false
+moving=true
+deleteRecursive=true
+listing=Name,Size,Date,Owner
+defaultMimetype=application/octet-stream
+Icon=remote
+Description=Subversion ioslave for KDevelop
+Description[ca]=L'esclau io (ioslave) Subversion per a KDevelop
+Description[de]=Ein-/Ausgabemodul für Subversion (KDevelop)
+Description[el]=Subversion ioslave για το KDevelop
+Description[es]=El ioslave de Subversion para KDevelop
+Description[et]=KDevelopi Subversioni IO-moodul
+Description[fr]=Esclave d'E/S (ioslave) Subversion pour KDevelop
+Description[hu]=Subversion KDE-protokoll a KDevelophoz
+Description[it]=ioslave di subversion per KDevelop
+Description[ja]=KDevelop のための Subversion ioslave
+Description[ms]=IOslave Subversion untuk KDevelop
+Description[nds]=KDevelop-In-/Utgaavmoduul för Subversion
+Description[nl]=Subversion-ioslave voor KDevelop
+Description[pl]=Wtyczka protokołu Subversion dla KDevelopa
+Description[pt]='Ioslave' do Subversion para o KDevelop
+Description[pt_BR]='Ioslave' do Subversion para o KDevelop
+Description[ru]=Поддержка протокола Subversion для KDevelop
+Description[sk]=Subversion ioslave pre KDevelop
+Description[sr]=KIOSlave Subversion-а за KDevelop
+Description[sr@Latn]=KIOSlave Subversion-a za KDevelop
+Description[sv]=Subversion I/O-slav för KDevelop
+Description[zh_TW]=KDevelop 的 Subversion ioslave
+maxInstances=5
+class=:internet
diff --git a/vcs/subversion/kdevsvn+http.protocol b/vcs/subversion/kdevsvn+http.protocol
new file mode 100644
index 00000000..5e836c02
--- /dev/null
+++ b/vcs/subversion/kdevsvn+http.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_kdevsvn
+protocol=kdevsvn+http
+input=none
+output=filesystem
+reading=true
+writing=true
+deleting=true
+makedir=true
+linking=false
+moving=true
+deleteRecursive=true
+listing=Name,Size,Date,Owner
+defaultMimetype=application/octet-stream
+Icon=remote
+Description=Subversion ioslave for KDevelop
+Description[ca]=L'esclau io (ioslave) Subversion per a KDevelop
+Description[de]=Ein-/Ausgabemodul für Subversion (KDevelop)
+Description[el]=Subversion ioslave για το KDevelop
+Description[es]=El ioslave de Subversion para KDevelop
+Description[et]=KDevelopi Subversioni IO-moodul
+Description[fr]=Esclave d'E/S (ioslave) Subversion pour KDevelop
+Description[hu]=Subversion KDE-protokoll a KDevelophoz
+Description[it]=ioslave di subversion per KDevelop
+Description[ja]=KDevelop のための Subversion ioslave
+Description[ms]=IOslave Subversion untuk KDevelop
+Description[nds]=KDevelop-In-/Utgaavmoduul för Subversion
+Description[nl]=Subversion-ioslave voor KDevelop
+Description[pl]=Wtyczka protokołu Subversion dla KDevelopa
+Description[pt]='Ioslave' do Subversion para o KDevelop
+Description[pt_BR]='Ioslave' do Subversion para o KDevelop
+Description[ru]=Поддержка протокола Subversion для KDevelop
+Description[sk]=Subversion ioslave pre KDevelop
+Description[sr]=KIOSlave Subversion-а за KDevelop
+Description[sr@Latn]=KIOSlave Subversion-a za KDevelop
+Description[sv]=Subversion I/O-slav för KDevelop
+Description[zh_TW]=KDevelop 的 Subversion ioslave
+maxInstances=5
+class=:internet
diff --git a/vcs/subversion/kdevsvn+https.protocol b/vcs/subversion/kdevsvn+https.protocol
new file mode 100644
index 00000000..af9301af
--- /dev/null
+++ b/vcs/subversion/kdevsvn+https.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_kdevsvn
+protocol=kdevsvn+https
+input=none
+output=filesystem
+reading=true
+writing=true
+deleting=true
+makedir=true
+linking=false
+moving=true
+deleteRecursive=true
+listing=Name,Size,Date,Owner
+defaultMimetype=application/octet-stream
+Icon=remote
+Description=Subversion ioslave for KDevelop
+Description[ca]=L'esclau io (ioslave) Subversion per a KDevelop
+Description[de]=Ein-/Ausgabemodul für Subversion (KDevelop)
+Description[el]=Subversion ioslave για το KDevelop
+Description[es]=El ioslave de Subversion para KDevelop
+Description[et]=KDevelopi Subversioni IO-moodul
+Description[fr]=Esclave d'E/S (ioslave) Subversion pour KDevelop
+Description[hu]=Subversion KDE-protokoll a KDevelophoz
+Description[it]=ioslave di subversion per KDevelop
+Description[ja]=KDevelop のための Subversion ioslave
+Description[ms]=IOslave Subversion untuk KDevelop
+Description[nds]=KDevelop-In-/Utgaavmoduul för Subversion
+Description[nl]=Subversion-ioslave voor KDevelop
+Description[pl]=Wtyczka protokołu Subversion dla KDevelopa
+Description[pt]='Ioslave' do Subversion para o KDevelop
+Description[pt_BR]='Ioslave' do Subversion para o KDevelop
+Description[ru]=Поддержка протокола Subversion для KDevelop
+Description[sk]=Subversion ioslave pre KDevelop
+Description[sr]=KIOSlave Subversion-а за KDevelop
+Description[sr@Latn]=KIOSlave Subversion-a za KDevelop
+Description[sv]=Subversion I/O-slav för KDevelop
+Description[zh_TW]=KDevelop 的 Subversion ioslave
+maxInstances=5
+class=:internet
diff --git a/vcs/subversion/kdevsvn+ssh.protocol b/vcs/subversion/kdevsvn+ssh.protocol
new file mode 100644
index 00000000..33a644f0
--- /dev/null
+++ b/vcs/subversion/kdevsvn+ssh.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_kdevsvn
+protocol=kdevsvn+ssh
+input=none
+output=filesystem
+reading=true
+writing=true
+deleting=true
+makedir=true
+linking=false
+moving=true
+deleteRecursive=true
+listing=Name,Size,Date,Owner
+defaultMimetype=application/octet-stream
+Icon=remote
+Description=Subversion ioslave for KDevelop
+Description[ca]=L'esclau io (ioslave) Subversion per a KDevelop
+Description[de]=Ein-/Ausgabemodul für Subversion (KDevelop)
+Description[el]=Subversion ioslave για το KDevelop
+Description[es]=El ioslave de Subversion para KDevelop
+Description[et]=KDevelopi Subversioni IO-moodul
+Description[fr]=Esclave d'E/S (ioslave) Subversion pour KDevelop
+Description[hu]=Subversion KDE-protokoll a KDevelophoz
+Description[it]=ioslave di subversion per KDevelop
+Description[ja]=KDevelop のための Subversion ioslave
+Description[ms]=IOslave Subversion untuk KDevelop
+Description[nds]=KDevelop-In-/Utgaavmoduul för Subversion
+Description[nl]=Subversion-ioslave voor KDevelop
+Description[pl]=Wtyczka protokołu Subversion dla KDevelopa
+Description[pt]='Ioslave' do Subversion para o KDevelop
+Description[pt_BR]='Ioslave' do Subversion para o KDevelop
+Description[ru]=Поддержка протокола Subversion для KDevelop
+Description[sk]=Subversion ioslave pre KDevelop
+Description[sr]=KIOSlave Subversion-а за KDevelop
+Description[sr@Latn]=KIOSlave Subversion-a za KDevelop
+Description[sv]=Subversion I/O-slav för KDevelop
+Description[zh_TW]=KDevelop 的 Subversion ioslave
+maxInstances=5
+class=:internet
diff --git a/vcs/subversion/kdevsvn+svn.protocol b/vcs/subversion/kdevsvn+svn.protocol
new file mode 100644
index 00000000..0f9ab069
--- /dev/null
+++ b/vcs/subversion/kdevsvn+svn.protocol
@@ -0,0 +1,39 @@
+[Protocol]
+exec=kio_kdevsvn
+protocol=kdevsvn+svn
+input=none
+output=filesystem
+reading=true
+writing=true
+deleting=true
+makedir=true
+linking=false
+moving=true
+deleteRecursive=true
+listing=Name,Size,Date,Owner
+defaultMimetype=application/octet-stream
+Icon=remote
+Description=Subversion ioslave for KDevelop
+Description[ca]=L'esclau io (ioslave) Subversion per a KDevelop
+Description[de]=Ein-/Ausgabemodul für Subversion (KDevelop)
+Description[el]=Subversion ioslave για το KDevelop
+Description[es]=El ioslave de Subversion para KDevelop
+Description[et]=KDevelopi Subversioni IO-moodul
+Description[fr]=Esclave d'E/S (ioslave) Subversion pour KDevelop
+Description[hu]=Subversion KDE-protokoll a KDevelophoz
+Description[it]=ioslave di subversion per KDevelop
+Description[ja]=KDevelop のための Subversion ioslave
+Description[ms]=IOslave Subversion untuk KDevelop
+Description[nds]=KDevelop-In-/Utgaavmoduul för Subversion
+Description[nl]=Subversion-ioslave voor KDevelop
+Description[pl]=Wtyczka protokołu Subversion dla KDevelopa
+Description[pt]='Ioslave' do Subversion para o KDevelop
+Description[pt_BR]='Ioslave' do Subversion para o KDevelop
+Description[ru]=Поддержка протокола Subversion для KDevelop
+Description[sk]=Subversion ioslave pre KDevelop
+Description[sr]=KIOSlave Subversion-а за KDevelop
+Description[sr@Latn]=KIOSlave Subversion-a za KDevelop
+Description[sv]=Subversion I/O-slav för KDevelop
+Description[zh_TW]=KDevelop 的 Subversion ioslave
+maxInstances=5
+class=:internet
diff --git a/vcs/subversion/kdevsvnd.cpp b/vcs/subversion/kdevsvnd.cpp
new file mode 100644
index 00000000..9963cddd
--- /dev/null
+++ b/vcs/subversion/kdevsvnd.cpp
@@ -0,0 +1,394 @@
+/*
+ This file is part of the KDE Project
+
+ Copyright (C) 2003, 2004 Mickael Marchand <marchand@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <kapplication.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kfiledialog.h>
+#include <ktextedit.h>
+#include <kpassdlg.h>
+#include <qdir.h>
+#include <qfile.h>
+
+#include "config.h"
+
+#include "kdevsvnd.h"
+
+#include "kdevsvnd_widgets.h"
+#include "commitdlg.h"
+
+extern "C" {
+ KDE_EXPORT KDEDModule *create_kdevsvnd(const QCString &name) {
+ return new KDevSvnd(name);
+ }
+}
+
+KDevSvnd::KDevSvnd(const QCString &name)
+ : KDEDModule(name) {
+}
+KDevSvnd::~KDevSvnd()
+{}
+
+QString KDevSvnd::commitDialog(QString modifiedFiles) {
+ CommitDlg commitDlg;
+ commitDlg.setCaption(i18n("Enter Commit Log Message:"));
+ commitDlg.listMessage->setText( modifiedFiles );
+ int result = commitDlg.exec();
+ if ( result == QDialog::Accepted ) {
+ return commitDlg.textMessage->text();
+ } else
+ return QString::null;
+}
+int KDevSvnd::sslServerTrustPrompt( QString errmsg, QString hostname, QString fingerPrint, QString validfrom, QString validuntil, QString issuerName, QString ascii_cert )
+{
+ SvnSSLTrustPrompt dlg;
+ dlg.setupCertInfo( hostname, fingerPrint, validfrom, validuntil, issuerName, ascii_cert );
+ dlg.setupFailedReasonMsg( errmsg );
+ int result = dlg.exec();
+ if ( result == QDialog::Accepted ){
+ return dlg.code();
+ } else{
+ return -1;
+ }
+}
+QString KDevSvnd::sslCertFile()
+{
+ QString fileName = KFileDialog::getOpenFileName(QString::null,QString::null,0, i18n("Open SSL certificate file"));
+ return fileName;
+}
+QCString KDevSvnd::sslPasswdDlg(QString promptMsg)
+{
+ QCString passwd;
+ int ret = KPasswordDialog::getPassword( passwd,promptMsg );
+ if( ret == KPasswordDialog::Accepted ){
+ QCString retstr;
+ retstr.setNum(1);
+ return retstr + passwd;
+ } else{
+ QCString nullstr;
+ nullstr.setNum(-1);
+ return nullstr;
+ }
+}
+
+
+// void KDevSvnd::registerMe(const QCString &app)
+// {
+// insert(app, "test", new TestObject(app));
+// // When 'app' unregisters with DCOP, the TestObject will get deleted.
+// }
+
+// bool KSvnd::AreAnyFilesInSvn( const KURL::List& wclist ) {
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// kdDebug( 9036 ) << "Checking file " << ( *it ) << endl;
+// QDir bdir ( ( *it ).path() );
+// if ( bdir.exists() && QFile::exists( ( *it ).path() + "/.svn/entries" ) ) {
+// return true;
+// } else if ( !bdir.exists() ) {
+// if ( isFileInSvnEntries( ( *it ).fileName(), ( *it ).directory() + "/.svn/entries" ) || isFileInExternals ( ( *it ).fileName(), ( *it ).directory()+"/.svn/dir-props" ) )
+// return true;
+// }
+// }
+// return false;
+// }
+//
+// bool KSvnd::AreAnyFilesNotInSvn( const KURL::List& wclist ) {
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// kdDebug( 9036 ) << "Checking file " << ( *it ) << endl;
+// QDir bdir ( ( *it ).path() );
+// if ( bdir.exists() && !QFile::exists( ( *it ).path() + "/.svn/entries" ) ) {
+// return true;
+// } else if ( !bdir.exists() ) {
+// if ( !isFileInSvnEntries( ( *it ).fileName(),( *it ).directory() + "/.svn/entries" ) && !isFileInExternals ( ( *it ).fileName(), ( *it ).directory()+"/.svn/dir-props" ) )
+// return true;
+// }
+// }
+// return false;
+// }
+//
+// bool KSvnd::AreAllFilesInSvn( const KURL::List& wclist ) {
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// kdDebug( 9036 ) << "Checking file " << ( *it ) << endl;
+// QDir bdir ( ( *it ).path() );
+// if ( bdir.exists() && !QFile::exists( ( *it ).path() + "/.svn/entries" ) ) {
+// return false;
+// } else if ( !bdir.exists() ) {
+// if ( !isFileInSvnEntries( ( *it ).fileName(),( *it ).directory() + "/.svn/entries" ) && !isFileInExternals ( ( *it ).fileName(), ( *it ).directory()+"/.svn/dir-props" ) )
+// return false;
+// }
+// }
+// return true;
+// }
+//
+// bool KSvnd::AreAllFilesNotInSvn( const KURL::List& wclist ) {
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// kdDebug( 9036 ) << "Checking file " << ( *it ) << endl;
+// QDir bdir ( ( *it ).path() );
+// if ( bdir.exists() && QFile::exists( ( *it ).path() + "/.svn/entries" ) ) {
+// return false;
+// } else if ( !bdir.exists() ) {
+// if ( isFileInSvnEntries( ( *it ).fileName(),( *it ).directory() + "/.svn/entries" ) || isFileInExternals ( ( *it ).fileName(), ( *it ).directory()+"/.svn/dir-props" ) )
+// return false;
+// }
+// }
+// return true;
+// }
+//
+// bool KSvnd::isFileInSvnEntries ( const QString filename, const QString entfile ) {
+// QFile file( entfile );
+// if ( file.open( IO_ReadOnly ) ) {
+// QTextStream stream( &file );
+// QString line;
+// while ( !stream.atEnd() ) {
+// line = stream.readLine().simplifyWhiteSpace();
+// if ( line == "name=\""+ filename + "\"" ) {
+// file.close();
+// return true;
+// }
+// }
+// file.close();
+// }
+// return false;
+// }
+//
+// bool KSvnd::isFileInExternals ( const QString filename, const QString propfile ) {
+// QFile file( propfile );
+// if ( file.open( IO_ReadOnly ) ) {
+// QTextStream stream( &file );
+// QStringList line;
+// while ( !stream.atEnd() )
+// line << stream.readLine().simplifyWhiteSpace();
+// for ( uint i = 0 ; i < line.count(); i++ ) {
+// if ( line[ i ] == "K 13" && line[ i+1 ] == "svn:externals" ) { //Key 13 : svn:externals
+// //next line should be "V xx"
+// if ( line [ i+2 ].startsWith( "V " ) ) {
+// //ok browse the values now
+// i+=2;
+// while ( i < line.count() ) {
+// if ( line[ i ].startsWith( filename+" " ) ) { //found it !
+// file.close( );
+// return true;
+// } else if ( line[ i ].isEmpty() ) {
+// file.close( );
+// return false; //we are out of svn:externals now...
+// }
+// i++;
+// }
+// }
+// }
+// }
+// file.close();
+// }
+// return false;
+// }
+//
+// bool KSvnd::anyNotValidWorkingCopy( const KURL::List& wclist ) {
+// bool result = true; //one negative match is enough
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// //exception for .svn dirs
+// if ( ( *it ).path(-1).endsWith( "/.svn" ) )
+// return true;
+// //if is a directory check whether it contains a .svn/entries file
+// QDir dir( ( *it ).path() );
+// if ( dir.exists() ) { //it's a dir
+// if ( !QFile::exists( ( *it ).path() + "/.svn/entries" ) )
+// result = false;
+// }
+//
+// //else check if ./.svn/entries exists
+// if ( !QFile::exists( ( *it ).directory() + "/.svn/entries" ) )
+// result = false;
+// }
+// return result;
+// }
+//
+// bool KSvnd::anyValidWorkingCopy( const KURL::List& wclist ) {
+// for ( QValueListConstIterator<KURL> it = wclist.begin(); it != wclist.end() ; ++it ) {
+// //skip .svn dirs
+// if ( ( *it ).path(-1).endsWith( "/.svn" ) )
+// continue;
+// //if is a directory check whether it contains a .svn/entries file
+// QDir dir( ( *it ).path() );
+// if ( dir.exists() ) { //it's a dir
+// if ( QFile::exists( ( *it ).path() + "/.svn/entries" ) )
+// return true;
+// }
+//
+// //else check if ./.svn/entries exists
+// if ( QFile::exists( ( *it ).directory() + "/.svn/entries" ) )
+// return true;
+// }
+// return false;
+// }
+//
+// int KSvnd::getStatus( const KURL::List& list ) {
+// int result = 0;
+// uint files = 0, folders = 0, parentsentries = 0, parentshavesvn = 0, subdirhavesvn = 0, external = 0;
+// for ( QValueListConstIterator<KURL> it = list.begin(); it != list.end() ; ++it ) {
+// if ( isFolder ( ( *it ) ) ) {
+// folders++;
+// } else {
+// files++;
+// }
+// if ( isFileInSvnEntries ( (*it).filename(),( *it ).directory() + "/.svn/entries" ) ) { // normal subdir known in the working copy
+// parentsentries++;
+// } else if ( isFolder( *it ) ) { // other subfolders (either another module checkouted or an external, or something not known at all)
+// if ( QFile::exists( ( *it ).path() + "/.svn/entries" ) )
+// subdirhavesvn++;
+// if ( isFileInExternals( (*it).filename(), ( *it ).directory() + "/.svn/dir-props" ) ) {
+// external++;
+// }
+// }
+// if ( ( isFolder( ( *it ) ) && QFile::exists( ( *it ).directory() + "../.svn/entries" ) ) || QFile::exists( ( *it ).directory() + "/.svn/entries" ) ) //parent has a .svn ?
+// parentshavesvn++;
+// }
+// if ( files > 0 )
+// result |= SomeAreFiles;
+// if ( folders == list.count() ) {
+// result |= AllAreFolders;
+// result |= SomeAreFolders;
+// }
+// if ( folders > 0 )
+// result |= SomeAreFolders;
+// if ( parentsentries == list.count() ) {
+// result |= AllAreInParentsEntries;
+// result |= SomeAreInParentsEntries;
+// } else if ( parentsentries != 0 )
+// result |= SomeAreInParentsEntries;
+// if ( parentshavesvn == list.count() ) {
+// result |= AllParentsHaveSvn;
+// result |= SomeParentsHaveSvn;
+// } else if ( parentshavesvn > 0 )
+// result |= SomeParentsHaveSvn;
+// if ( subdirhavesvn == list.count() ) {
+// result |= AllHaveSvn;
+// result |= SomeHaveSvn;
+// } else if ( subdirhavesvn > 0 )
+// result |= SomeHaveSvn;
+// if ( external == list.count() ) {
+// result |= AllAreExternalToParent;
+// result |= SomeAreExternalToParent;
+// } else if ( external > 0 )
+// result |= SomeAreExternalToParent;
+//
+// return result;
+// }
+//
+// bool KSvnd::isFolder( const KURL& url ) {
+// QDir d( url.path() );
+// return d.exists();
+// }
+//
+// QStringList KSvnd::getActionMenu ( const KURL::List &list ) {
+// QStringList result;
+// int listStatus = getStatus( list );
+//
+// if ( !(listStatus & SomeAreInParentsEntries) &&
+// !(listStatus & SomeAreExternalToParent) &&
+// !(listStatus & SomeHaveSvn)) {
+// if( list.size() == 1 && listStatus & SomeAreFolders) {
+// result << "Checkout";
+// result << "Export";
+// // result << "CreateRepository";
+// result << "Import";
+// }
+// } else if ( (listStatus & AllAreInParentsEntries) ) {
+// result << "Diff";
+// //In SVN
+// // result << "ShowLog";
+// // result << "CheckForModifications";
+// // result << "RevisionGraph";
+// // result << "_SEPARATOR_";
+// // result << "Update to revision..."
+// result << "Rename";
+// result << "Delete";
+// if( listStatus & SomeAreFolders && !(listStatus & SomeAreFiles)) {
+// result << "Revert";
+// // result << "Cleanup";
+// }
+// result << "_SEPARATOR_";
+// // result << "BranchTag";
+// result << "Switch";
+// result << "Merge";
+// if( listStatus & SomeAreFolders && !(listStatus & SomeAreFiles)) {
+// // result << "Export";
+// // result << "Relocate";
+// result << "_SEPARATOR_";
+// result << "Add";
+// }
+// result << "_SEPARATOR_";
+// if( listStatus & SomeAreFiles && !(listStatus & SomeAreFolders)) {
+// result << "Blame";
+// }
+// result << "CreatePatch";
+//
+// if( list.size() == 1 && listStatus & SomeAreFolders) {
+// // result << "ApplyPatchToFolder";
+// }
+// }
+// return result;
+// }
+//
+// QStringList KSvnd::getTopLevelActionMenu ( const KURL::List &list ) {
+// QStringList result;
+// int listStatus = getStatus( list );
+//
+//
+// if ( ( listStatus & AllParentsHaveSvn &&
+// ( ( listStatus & SomeAreExternalToParent ) || ( listStatus & SomeAreInParentsEntries ) )
+// || ( listStatus & SomeHaveSvn ) )
+// ) {
+// result << "Update";
+// result << "Commit";
+// }
+//
+// return result;
+// }
+//
+// #if 0
+// void KSvnd::notify(const QString& path, int action, int kind, const QString& mime_type, int content_state, int prop_state, long int revision, const QString& userstring) {
+// kdDebug(9036) << "KDED/Subversion : notify " << path << " action : " << action << " mime_type : " << mime_type << " content_state : " << content_state << " prop_state : " << prop_state << " revision : " << revision << " userstring : " << userstring << endl;
+// QByteArray params;
+//
+// QDataStream stream(params, IO_WriteOnly);
+// stream << path << action << kind << mime_type << content_state << prop_state << revision << userstring;
+//
+// emitDCOPSignal( "subversionNotify(QString,int,int,QString,int,int,long int,QString)", params );
+// }
+//
+// void KSvnd::status(const QString& path, int text_status, int prop_status, int repos_text_status, int repos_prop_status, long int rev ) {
+// kdDebug(9036) << "KDED/Subversion : status " << path << " " << text_status << " " << prop_status << " "
+// << repos_text_status << " " << repos_prop_status << " " << rev << endl;
+// QByteArray params;
+//
+// QDataStream stream(params, IO_WriteOnly);
+// stream << path << text_status << prop_status << repos_text_status << repos_prop_status << rev;
+//
+// emitDCOPSignal( "subversionStatus(QString,int,int,int,int,long int)", params );
+// }
+//
+// void KSvnd::popupMessage( const QString& message ) {
+// kdDebug(9036) << "KDED/Subversion : popupMessage" << message << endl;
+// KMessageBox::information(0, message, i18n( "Subversion" ) );
+// }
+// #endif
+
+#include "kdevsvnd.moc"
diff --git a/vcs/subversion/kdevsvnd.desktop b/vcs/subversion/kdevsvnd.desktop
new file mode 100644
index 00000000..139350f5
--- /dev/null
+++ b/vcs/subversion/kdevsvnd.desktop
@@ -0,0 +1,31 @@
+[Desktop Entry]
+Type=Service
+Name=KDevelop subversion module
+Name[ca]=Mòdul de Subversion per a KDevelop
+Name[da]=KDevelop Subversion-modul
+Name[de]=Subversion-Komponente (KDevelop)
+Name[el]=Άρθρωμα subversion του KDevelop
+Name[es]=Módulo de Subversion de KDevelop
+Name[et]=KDevelopi Subversioni moodul
+Name[fr]=Module Subversion pour KDevelop
+Name[hu]=KDevelop-modul a Subversion kezeléséhez
+Name[it]=Modulo subversion di KDevelop
+Name[ja]=KDevelop Subversion モジュール
+Name[ms]=Modul Subversion KDevelop
+Name[nds]=KDevelop-Moduul för Subversion
+Name[nl]=KDevelop subversion-module
+Name[pl]=Modul Subversion dla KDevelopa
+Name[pt]=Módulo de Subversion do KDevelop
+Name[pt_BR]=Módulo de Subversion do KDevelop
+Name[ru]=Модуль Subversion для KDevelop
+Name[sk]=KDevelop subversion modul
+Name[sr]=KDevelop-ов модул за Subversion
+Name[sr@Latn]=KDevelop-ov modul za Subversion
+Name[sv]=KDevelop Subversion-modul
+Name[zh_TW]=KDevelop Subversion 模組
+ServiceTypes=KDEDModule
+X-KDE-ModuleType=Library
+X-KDE-Library=kdevsvnd
+X-KDE-FactoryName=kdevsvnd
+X-KDE-Kded-autoload=true
+X-KDE-Kded-load-on-demand=true
diff --git a/vcs/subversion/kdevsvnd.h b/vcs/subversion/kdevsvnd.h
new file mode 100644
index 00000000..ad718f0c
--- /dev/null
+++ b/vcs/subversion/kdevsvnd.h
@@ -0,0 +1,50 @@
+/*
+ This file is part of the KDE Project
+
+ Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef KSVND_H
+#define KSVND_H
+
+#include <dcopclient.h>
+#include <kdedmodule.h>
+#include <kurl.h>
+#include <qstringlist.h>
+
+class KDevSvnd : public KDEDModule
+{
+Q_OBJECT
+
+K_DCOP
+
+ //note: InSVN means parent is added. InRepos means itself is added
+ enum { SomeAreFiles = 1, SomeAreFolders = 2, SomeAreInParentsEntries = 4, SomeParentsHaveSvn = 8, SomeHaveSvn = 16, SomeAreExternalToParent = 32, AllAreInParentsEntries = 64, AllParentsHaveSvn = 128, AllHaveSvn = 256, AllAreExternalToParent = 512, AllAreFolders = 1024 };
+public:
+ KDevSvnd(const QCString &);
+ ~KDevSvnd();
+
+k_dcop:
+// void addAuthInfo(KIO::AuthInfo, long);
+ QString commitDialog(QString);
+ int sslServerTrustPrompt(QString certFailMsg, QString hostname, QString fingerPrint, QString validfrom, QString validuntil, QString issuerName, QString ascii_cert );
+ QString sslCertFile();
+ QCString sslPasswdDlg(QString promptMsg);
+
+};
+
+#endif
diff --git a/vcs/subversion/kdevsvnd_widgets.cpp b/vcs/subversion/kdevsvnd_widgets.cpp
new file mode 100644
index 00000000..16e35ce3
--- /dev/null
+++ b/vcs/subversion/kdevsvnd_widgets.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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.
+ */
+
+#include "kdevsvnd_widgets.h"
+#include <qpushbutton.h>
+#include <qlistview.h>
+#include <qlabel.h>
+#include <klocale.h>
+
+SvnSSLTrustPrompt::SvnSSLTrustPrompt( QWidget* parent, const char* name, bool modal, WFlags f )
+ :SvnSSLTrustPromptBase( parent, name, modal, f )
+ , m_code(-1)
+{
+ listView1->setColumnText( 0, "Items" );
+ listView1->setColumnText( 1, "Values" );
+ btnPermanent->setText(i18n("Accept Permanently"));
+ btnTemporary->setText(i18n("Accept Temporarily"));
+ btnReject->setText(i18n("Reject"));
+ connect( btnPermanent, SIGNAL(clicked()), this, SLOT(setPermanent()) );
+ connect( btnTemporary, SIGNAL(clicked()), this, SLOT(setTemporary()) );
+ connect( btnReject, SIGNAL(clicked()), this, SLOT(setRejected ()) );
+}
+SvnSSLTrustPrompt::~SvnSSLTrustPrompt()
+{}
+
+void SvnSSLTrustPrompt::setupCertInfo( QString hostname, QString fingerPrint, QString validfrom, QString validuntil, QString issuerName, QString ascii_cert )
+{
+ // setup texts
+ QListViewItem *host= new QListViewItem(listView1, i18n("Hostname"), hostname );
+ QListViewItem *finger = new QListViewItem(listView1, i18n("FingerPrint"), fingerPrint );
+ QListViewItem *validFrom = new QListViewItem(listView1, i18n("Valid From"), validfrom );
+ QListViewItem *validUntil = new QListViewItem(listView1, i18n("Valid Until"), validuntil );
+ QListViewItem *issName = new QListViewItem(listView1, i18n("Issuer"), issuerName );
+ QListViewItem *cert = new QListViewItem(listView1, i18n("Cert"), ascii_cert );
+}
+void SvnSSLTrustPrompt::setupFailedReasonMsg( QString msg )
+{
+ errMsgLabel->setText( msg );
+}
+int SvnSSLTrustPrompt::code()
+{
+ return m_code;
+}
+
+void SvnSSLTrustPrompt::setPermanent()
+{
+ m_code = 1;
+}
+
+void SvnSSLTrustPrompt::setTemporary()
+{
+ m_code = 0;
+}
+
+void SvnSSLTrustPrompt::setRejected()
+{
+ m_code = -1;
+}
+#include "kdevsvnd_widgets.moc"
diff --git a/vcs/subversion/kdevsvnd_widgets.h b/vcs/subversion/kdevsvnd_widgets.h
new file mode 100644
index 00000000..c69fdb14
--- /dev/null
+++ b/vcs/subversion/kdevsvnd_widgets.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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.
+ */
+
+#ifndef KDEVSVND_WIDGETS_H
+#define KDEVSVND_WIDGETS_H
+
+#include "svnssltrustpromptbase.h"
+
+class SvnSSLTrustPrompt : public SvnSSLTrustPromptBase{
+Q_OBJECT
+public:
+ SvnSSLTrustPrompt( QWidget* parent=0, const char* name=0, bool modal=true, WFlags f=0 );
+ ~SvnSSLTrustPrompt();
+ void setupCertInfo( QString hostname, QString fingerPrint, QString validfrom, QString validuntil, QString issuerName, QString ascii_cert );
+ void setupFailedReasonMsg( QString msg );
+ int code();
+
+public slots:
+ void setPermanent();
+ void setTemporary();
+ void setRejected();
+
+protected:
+ // -1 for reject
+ // 0 for accept temporarily
+ // 1 for accept permanently
+ int m_code;
+};
+
+#endif
diff --git a/vcs/subversion/subversion_core.cpp b/vcs/subversion/subversion_core.cpp
new file mode 100644
index 00000000..0a91d349
--- /dev/null
+++ b/vcs/subversion/subversion_core.cpp
@@ -0,0 +1,738 @@
+/**
+ Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#include <kparts/part.h>
+#include <kdevcore.h>
+#include <kdevproject.h>
+#include "subversion_part.h"
+#include "subversion_core.h"
+#include "subversion_widget.h"
+#include "svn_blamewidget.h"
+#include "svn_logviewwidget.h"
+#include "subversiondiff.h"
+#include <kdevmainwindow.h>
+#include "svn_co.h"
+#include <kurlrequester.h>
+#include <klineedit.h>
+#include <kio/job.h>
+#include <kio/jobclasses.h>
+#include <kio/netaccess.h>
+#include <kdebug.h>
+#include <kmainwindow.h>
+#include <kapplication.h>
+#include <dcopclient.h>
+#include <ktempfile.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
+#include <qtextcodec.h>
+#include <qtextstream.h>
+#include <qtextbrowser.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <qregexp.h>
+
+#include <kapplication.h>
+#include <kinstance.h>
+#include <kaboutdata.h>
+
+using namespace KIO;
+using namespace SvnGlobal;
+
+subversionCore::subversionCore(subversionPart *part)
+// : QObject(NULL, "subversion core"), DCOPObject("subversion") {
+ : QObject(NULL, "subversion core") {
+ m_part = part;
+ m_widget = new subversionWidget(part, 0 , "subversionprocesswidget");
+// m_logViewWidget = new SvnLogViewWidget( part, 0 );
+// m_part->mainWindow()->embedOutputView( m_logViewWidget, i18n( "Subversion Log" ), i18n( "Subversion Log" ) );
+// if ( ! connectDCOPSignal("kded", "ksvnd", "subversionNotify(QString,int,int,QString,int,int,long int,QString)", "notification(QString,int,int,QString,int,int,long int,QString)", false ) )
+// kdWarning() << "Failed to connect to kded dcop signal ! Notifications won't work..." << endl;
+
+ m_fileInfoProvider = new SVNFileInfoProvider( part );
+ diffTmpDir = new KTempDir();
+ diffTmpDir->setAutoDelete(true);
+}
+
+subversionCore::~subversionCore() {
+ if ( processWidget() ) {
+ m_part->mainWindow()->removeView( processWidget() );
+ delete processWidget();
+ }
+// if( m_logViewWidget ){
+// m_part->mainWindow()->removeView( m_logViewWidget );
+// delete m_logViewWidget;
+// }
+ delete diffTmpDir;
+ //FIXME delete m_fileInfoProvider here?
+}
+
+KDevVCSFileInfoProvider *subversionCore::fileInfoProvider() const {
+ return m_fileInfoProvider;
+}
+
+//not used anymore
+// void subversionCore::notification( const QString& path, int action, int kind, const QString& mime_type, int content_state ,int prop_state ,long int revision, const QString& userstring ) {
+// kdDebug(9036) << "Subversion Notification : "
+// << "path : " << path
+// << "action: " << action
+// << "kind : " << kind
+// << "mime_type : " << mime_type
+// << "content_state : " << content_state
+// << "prop_state : " << prop_state
+// << "revision : " << revision
+// << "userstring : " << userstring
+// << endl;
+// if ( !userstring.isEmpty() ) {
+// m_part->mainWindow()->raiseView(processWidget());
+// processWidget()->append( userstring );
+// }
+// }
+
+subversionWidget *subversionCore::processWidget() const {
+// SvnLogViewWidget* subversionCore::processWidget() const {
+// return processWidget();
+// return m_logViewWidget;
+ return m_widget;
+}
+
+void subversionCore::resolve( const KURL::List& list ) {
+ KURL servURL = m_part->baseURL();
+ if ( servURL.isEmpty() ) servURL="kdevsvn+svn://blah/";
+ if ( ! servURL.protocol().startsWith( "kdevsvn+" ) ) {
+ servURL.setProtocol( "kdevsvn+" + servURL.protocol() ); //make sure it starts with "svn"
+ }
+ kdDebug(9036) << "servURL : " << servURL.prettyURL() << endl;
+ for ( QValueListConstIterator<KURL> it = list.begin(); it != list.end() ; ++it ) {
+ kdDebug(9036) << "resolving: " << (*it).prettyURL() << endl;
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 11;
+ bool recurse = true;
+ s << cmd << *it << recurse;
+ SimpleJob * job = KIO::special(servURL, parms, true);
+ job->setWindow( m_part->mainWindow()->main() );
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ }
+}
+
+void subversionCore::update( const KURL::List& list ) {
+ KURL servURL = "kdevsvn+svn://blah/";
+ kdDebug(9036) << "Updating. servURL : " << servURL.prettyURL() << endl;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 2;
+ int rev = -1;
+ s << cmd << list << rev << QString( "HEAD" );
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, i18n("Subversion Update") , i18n("Subversion Update") );
+}
+
+void subversionCore::diff( const KURL::List& list, const QString& where){
+ kdDebug(9036) << "diff " << list << endl;
+ KURL servURL = "kdevsvn+svn://this_is_a_fake_URL_and_this_is_normal/";
+ for ( QValueListConstIterator<KURL> it = list.begin(); it != list.end() ; ++it ) {
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 13;
+ kdDebug(9036) << "diffing : " << (*it).prettyURL() << endl;
+ int rev1=-1;
+ int rev2=-1;
+ QString revkind1 = where;
+ QString revkind2 = "WORKING";
+ s << cmd << *it << *it << rev1 << revkind1 << rev2 << revkind2 << true ;
+ KIO::SimpleJob * job = KIO::special(servURL, parms, true);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ KIO::NetAccess::synchronousRun( job, 0 );
+ if ( diffresult.count() > 0 ) {
+ //check kompare is available
+ if ( !KStandardDirs::findExe( "kompare" ).isNull() ) {
+ if (!KStandardDirs::findExe("patch").isNull()){
+ // we have patch - so can merge
+ KTempDir tmpDir = KTempDir(diffTmpDir->name());
+ KTempFile tmpPatch = KTempFile(tmpDir.name());
+
+ // write the patch
+ QTextStream *stream = tmpPatch.textStream();
+ stream->setCodec( QTextCodec::codecForName( "utf8" ) );
+ for ( QStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) {
+ ( *stream ) << ( *it2 ) << "\n";
+ }
+ tmpPatch.close();
+
+ QString ourCopy = tmpDir.name()+(*it).fileName();
+
+ KProcess copy;
+ copy << "cp" << (*it).prettyURL(0,KURL::StripFileProtocol) << tmpDir.name();
+ copy.start(KProcess::Block);
+
+ KProcess patch;
+ patch.setWorkingDirectory(tmpDir.name());
+ patch << "patch" << "-R" << ourCopy << tmpPatch.name();
+ patch.start(KProcess::Block, KProcess::All);
+
+ KProcess *p = new KProcess;
+ *p << "kompare" << ourCopy << (*it).prettyURL();
+ p->start();
+ }
+ else{
+ // only diff
+ KTempFile *tmp = new KTempFile;
+ tmp->setAutoDelete(true);
+ QTextStream *stream = tmp->textStream();
+ stream->setCodec( QTextCodec::codecForName( "utf8" ) );
+ for ( QStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) {
+ ( *stream ) << ( *it2 ) << "\n";
+ }
+ tmp->close();
+ KProcess *p = new KProcess;
+ *p << "kompare" << "-n" << "-o" << tmp->name();
+ p->start();
+ }
+ } else { //else do it with message box
+ Subversion_Diff df;
+ for ( QStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) {
+ df.text->append( *it2 );
+ }
+ QFont f = df.font();
+ f.setFixedPitch( true );
+ df.text->setFont( f );
+ df.exec();
+ }
+ }
+ else{
+ QString diffTo = i18n("the local disk checked out copy.");
+ if ( where=="HEAD"){
+ diffTo=i18n("the current svn HEAD version.");
+ }
+ KMessageBox::information( 0, i18n("No differences between the file and %1").arg(diffTo), i18n("No difference") );
+ }
+ diffresult.clear();
+ }
+}
+
+void subversionCore::diffAsync( const KURL &pathOrUrl1, const KURL &pathOrUrl2,
+ int rev1, QString revKind1, int rev2, QString revKind2,
+ bool recurse, bool pegdiff )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 13;
+ kdDebug(9036) << "diffing async : " << pathOrUrl1 << " and " << pathOrUrl2 << endl;
+ s << cmd << pathOrUrl1 << pathOrUrl2 << rev1 << revKind1 << rev2 << revKind2 << recurse;
+ s << pegdiff;
+ KIO::SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotDiffResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, pathOrUrl1.prettyURL(), pathOrUrl2.prettyURL() );
+}
+
+void subversionCore::commit( const KURL::List& list, bool recurse, bool keeplocks ) {
+ KURL servURL = m_part->baseURL();
+ if ( servURL.isEmpty() ) servURL="kdevsvn+svn://blah/";
+ if ( ! servURL.protocol().startsWith( "kdevsvn+" ) ) {
+ servURL.setProtocol( "kdevsvn+" + servURL.protocol() ); //make sure it starts with "svn"
+ }
+ kdDebug(9036) << "servURL : " << servURL.prettyURL() << endl;
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 103;
+ s << cmd << recurse << keeplocks;
+ for ( QValueListConstIterator<KURL> it = list.begin(); it != list.end() ; ++it ) {
+ kdDebug(9036) << "adding to list: " << (*it).prettyURL() << endl;
+ s << *it;
+ }
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ if( list.count() == 1 )
+ initProcessDlg( (KIO::Job*)job, (*(list.begin())).prettyURL() , i18n("Commit to remote repository") );
+ else if( list.count() > 1 )
+ initProcessDlg( (KIO::Job*)job, i18n("From working copy") , i18n("Commit to remote repository") );
+}
+// Right now, only one item for each action.
+void subversionCore::svnLog( const KURL::List& list,
+ int revstart, QString revKindStart, int revend, QString revKindEnd,
+ bool discorverChangedPath, bool strictNodeHistory )
+{
+ // ensure that part has repository information. This info is used to retrieve root repository URL
+ if( m_part->m_prjInfoMap.count() < 1 )
+ clientInfo( KURL(m_part->project()->projectDirectory()), false, m_part->m_prjInfoMap );
+ KURL servURL = m_part->baseURL();
+ if ( servURL.isEmpty() ) servURL="kdevsvn+svn://blah/";
+ if ( ! servURL.protocol().startsWith( "kdevsvn+" ) ) {
+ servURL.setProtocol( "kdevsvn+" + servURL.protocol() ); //make sure it starts with "svn"
+ }
+ kdDebug(9036) << "servURL : " << servURL.prettyURL() << endl;
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 4;
+// int revstart = -1, revend = 0;
+// QString revKindStart = "HEAD", revKindEnd = "";
+// bool repositLog = true, discorverChangedPath = true, strictNodeHistory = true;
+ s << cmd << revstart << revKindStart << revend << revKindEnd;
+ s << discorverChangedPath << strictNodeHistory;
+ for ( QValueListConstIterator<KURL> it = list.begin(); it != list.end() ; ++it ) {
+ kdDebug(9036) << "svnCore: adding to list: " << (*it).prettyURL() << endl;
+ s << *it;
+ }
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotLogResult( KIO::Job * ) ) );
+ // progress info. LogView is allowed and meaninful only for one url in KDev3.4
+ initProcessDlg( (KIO::Job*)job, (*(list.begin())).prettyURL() , i18n("Subversion Log View") );
+}
+
+void subversionCore::blame( const KURL &url, UrlMode mode, int revstart, QString revKindStart, int revend, QString revKindEnd )
+{
+ KURL servURL = m_part->baseURL();
+ if ( servURL.isEmpty() ) servURL="kdevsvn+svn://blah/";
+ if ( ! servURL.protocol().startsWith( "kdevsvn+" ) ) {
+ servURL.setProtocol( "kdevsvn+" + servURL.protocol() ); //make sure it starts with "svn"
+ }
+ kdDebug(9036) << "servURL : " << servURL.prettyURL() << endl;
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 14;
+ s << cmd << url << (int)mode ;
+ s << revstart << revKindStart << revend << revKindEnd ;
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotBlameResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, url.prettyURL() , i18n("Subversion Blame") );
+}
+
+void subversionCore::add( const KURL::List& list ) {
+
+ KURL servURL = "kdevsvn+svn://blah/";
+ kdDebug(9036) << "Deleting servURL : " << servURL.prettyURL() << endl;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 6;
+ s << cmd << list;
+ // add/delete/revert works on local copy. Don't need to show progress dialog
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ job->setWindow( m_part->mainWindow()->main() );
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+}
+
+void subversionCore::del( const KURL::List& list ) {
+ KURL servURL = "kdevsvn+svn://blah/";
+ kdDebug(9036) << "Deleting servURL : " << servURL.prettyURL() << endl;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 7;
+ s << cmd << list;
+ // add/delete/revert works on local copy. Don't need to show progress dialog
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ job->setWindow( m_part->mainWindow()->main() );
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+}
+
+void subversionCore::revert( const KURL::List& list ) {
+ KURL servURL = "kdevsvn+svn://blah/";
+ kdDebug(9036) << "Reverting servURL : " << servURL.prettyURL() << endl;
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 8;
+ s << cmd << list;
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ job->setWindow( m_part->mainWindow()->main() );
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+}
+
+void subversionCore::checkout() {
+ svn_co checkoutDlg;
+
+ if ( checkoutDlg.exec() == QDialog::Accepted ) {
+ //checkout :)
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ KURL servURL ( checkoutDlg.serverURL->url() );
+ wcPath = checkoutDlg.localDir->url() + "/" + checkoutDlg.newDir->text();
+ int cmd = 1;
+ int rev = -1;
+ s << cmd << servURL << KURL( wcPath ) << rev << QString( "HEAD" );
+ servURL.setProtocol( "kdevsvn+" + servURL.protocol() ); //make sure it starts with "svn"
+ SimpleJob * job = KIO::special(servURL,parms, true);
+ job->setWindow( m_part->mainWindow()->main() );
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotEndCheckout( KIO::Job * ) ) );
+ }
+}
+
+void subversionCore::switchTree( const KURL &path, const KURL &repositUrl,
+ int revNum, const QString &revKind, bool recurse )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 12;
+ s << cmd << path << repositUrl ;
+ s << recurse << revNum << revKind;
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, repositUrl.prettyURL() , path.prettyURL() );
+}
+
+void subversionCore::switchRelocate( const KURL &path,
+ const KURL &currentUrl, const KURL &newUrl, bool recurse )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 16;
+ s << cmd << path << currentUrl << newUrl << recurse;
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ // this doesn't contact repository
+}
+
+void subversionCore::svnCopy( const KURL &src, int srcRev, const QString &srcRevKind,
+ const KURL &dest )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 17;
+ s << cmd << src << srcRev << srcRevKind << dest;
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, src.prettyURL(), dest.prettyURL() );
+}
+
+void subversionCore::merge( const KURL &src1, int rev1, QString revKind1,
+ const KURL &src2, int rev2, QString revKind2, const KURL &wc_path,
+ bool recurse, bool ignore_ancestry, bool force, bool dry_run )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ // prepare arguments
+ int cmd = 18;
+ s << cmd << src1 << rev1 << revKind1 << src2 << rev2 << revKind2 << wc_path;
+ s << recurse << ignore_ancestry << force << dry_run;
+
+ SimpleJob * job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ initProcessDlg( (KIO::Job*)job, src1.prettyURL() + "\n" + src2.prettyURL() ,
+ wc_path.prettyURL() );
+}
+
+bool subversionCore::clientInfo( KURL path_or_url, bool recurse, QMap< KURL, SvnInfoHolder> &holderMap )
+{
+ KURL servURL = "kdevsvn+svn://blah/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 15;
+ s << cmd << path_or_url << -1 << QString("UNSPECIFIED") << -1 << QString("UNSPECIFIED") << recurse;
+ SimpleJob *job = KIO::special( servURL, parms, false );
+
+ QMap<QString,QString> ma;
+ KIO::NetAccess::synchronousRun(job, 0, 0, 0, &ma ); // synchronize
+
+ QValueList<QString> keys = ma.keys();
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+ int curIdx, lastIdx;
+ QRegExp rx( "([0-9]*)(.*)" );
+
+ for ( it = begin; it != end; /*++it*/) {
+ kdDebug(9036) << "METADATA key: " << *it << " value: " << ma[ *it ] << endl;
+ if ( rx.search( *it ) == -1 ) return false; // something is wrong ! :)
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ SvnInfoHolder holder;
+
+ while ( curIdx == lastIdx ) {
+ if ( rx.cap( 2 ) == "PATH" )
+ holder.path = KURL( ma[ *it ] );
+ else if ( rx.cap( 2 ) == "URL" )
+ holder.url = KURL( ma[*it] );
+ else if ( rx.cap( 2 ) == "REV" )
+ holder.rev= ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "KIND" )
+ holder.kind = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "REPOS_ROOT_URL" )
+ holder.reposRootUrl = KURL( ma[*it] );
+ else if ( rx.cap( 2 ) == "REPOS_UUID" )
+ holder.reposUuid = ma[ *it ];
+
+ ++it;
+ if ( it == end )
+ break;
+ if ( rx.search( *it ) == -1 ) return false; // something is wrong ! :)
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ holderMap.insert( holder.path, holder );
+ }
+ return true;;
+}
+
+void subversionCore::slotEndCheckout( KIO::Job * job ) {
+ if ( job->error() ) {
+ job->showErrorDialog( m_part->mainWindow()->main() );
+ emit checkoutFinished( QString::null );
+ } else
+ emit checkoutFinished(wcPath);
+}
+
+void subversionCore::slotResult( KIO::Job * job ) {
+ if ( job->error() ){
+ job->showErrorDialog( m_part->mainWindow()->main() );
+ if( job->error() == ERR_CANNOT_LAUNCH_PROCESS )
+ KMessageBox::error( m_part->mainWindow()->main(),
+ i18n("If you have just have installed a new version of KDevelop,"
+ " and the error message was 'unknown protocol kdevsvn+*',"
+ " try restarting KDE."
+ ) );
+ return;
+ }
+ KIO::MetaData ma = job->metaData();
+ QValueList<QString> keys = ma.keys();
+ qHeapSort( keys );
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+
+ for ( it = begin; it != end; ++it ) {
+// kdDebug(9036) << "METADATA : " << *it << ":" << ma[ *it ] << endl;
+ if ( ( *it ).endsWith( "string" ) ) {
+ m_part->mainWindow()->raiseView(processWidget());
+ processWidget()->append( ma[ *it ] );
+ }
+ //extra check to retrieve the diff output in case with run a diff command
+ if ( ( *it ).endsWith( "diffresult" ) ) {
+ diffresult << ma[ *it ];
+ }
+ }
+}
+void subversionCore::slotLogResult( KIO::Job * job )
+{
+ if ( job->error() ){
+ job->showErrorDialog( m_part->mainWindow()->main() );
+ if( job->error() == ERR_CANNOT_LAUNCH_PROCESS )
+ KMessageBox::error( m_part->mainWindow()->main(),
+ i18n("If you have just have installed a new version of KDevelop,"
+ " and the error message was 'unknown protocol kdevsvn+*',"
+ " try restarting KDE."
+ ) );
+ return;
+ }
+
+ QValueList<SvnLogHolder> holderList;
+
+ KIO::MetaData ma = job->metaData();
+ QValueList<QString> keys = ma.keys();
+ QRegExp rx( "([0-9]*)(.*)" );
+ int curIdx, lastIdx;
+ QString requestedUrl;
+
+ for (QValueList<QString>::Iterator it = keys.begin(); it != keys.end(); /*++it*/ ){
+ if ( rx.search( *it ) == -1 ){
+ kdDebug(9036) << " Exiting loop at line " << __LINE__ <<endl;
+ return; // something is wrong ! :)
+ }
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ SvnLogHolder logHolder;
+ while ( curIdx == lastIdx ) {
+ kdDebug(9036) << "svn log MetaData: " << *it << ":" << ma[ *it ] << endl;
+
+ if ( rx.cap( 2 ) == "author" )
+ logHolder.author = ma[*it];
+ else if ( rx.cap( 2 ) == "date" )
+ logHolder.date = ma[*it];
+ else if ( rx.cap( 2 ) == "logmsg" )
+ logHolder.logMsg = ma[*it];
+ else if ( rx.cap( 2 ) == "pathlist" )
+ logHolder.pathList = ma[*it];
+ else if ( rx.cap( 2 ) == "rev" )
+ logHolder.rev = ma[*it];
+ else if ( rx.cap( 2 ) == "requrl" )
+ requestedUrl = ma[*it];
+
+ ++it;
+ if ( it == keys.end() )
+ break;
+ if ( rx.search( *it ) == -1 ){
+ kdDebug(9036) << " Exiting loop at line " << __LINE__ <<endl;
+ break; // something is wrong ! :)
+ }
+ curIdx = rx.cap( 1 ).toInt();
+ }//end of while
+ holderList.append( logHolder );
+ }
+ processWidget()->showLogResult( &holderList, requestedUrl );
+ m_part->mainWindow()->raiseView(processWidget());
+
+}
+
+void subversionCore::slotBlameResult( KIO::Job * job )
+{
+ if ( job->error() ){
+ job->showErrorDialog( m_part->mainWindow()->main() );
+ if( job->error() == ERR_CANNOT_LAUNCH_PROCESS )
+ KMessageBox::error( m_part->mainWindow()->main(),
+ i18n("If you have just have installed a new version of KDevelop,"
+ " and the error message was 'unknown protocol kdevsvn+*',"
+ " try restarting KDE."
+ ) );
+ return;
+ }
+ QValueList<SvnBlameHolder> blameList;
+
+ KIO::MetaData ma = job->metaData();
+ QValueList<QString> keys = ma.keys();
+ QRegExp rx( "([0-9]*)(.*)" );
+ int curIdx, lastIdx;
+
+ for (QValueList<QString>::Iterator it = keys.begin(); it != keys.end(); /*++it*/ ){
+ if ( rx.search( *it ) == -1 ){
+ kdDebug(9036) << " Exiting loop at line " << __LINE__ <<endl;
+ return; // something is wrong ! :)
+ }
+
+ // if metadata has action key, that means a notification for svn_wc_notify_blame_completed
+ // Thus, consume this notification
+ if ( rx.cap( 2 ) == "action" ){
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ){
+ ++it;
+ if ( it == keys.end() ) break;
+ if ( rx.search( *it ) == -1 ) continue; // something is wrong
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ continue;
+ }
+ // get actual blame data
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ SvnBlameHolder blameHolder;
+ while ( curIdx == lastIdx ) {
+ kdDebug(9036) << "svn blame MetaData: " << *it << ":" << ma[ *it ] << endl;
+
+ if ( rx.cap( 2 ) == "LINE" )
+ blameHolder.line= (ma[*it]).toInt();
+ else if ( rx.cap( 2 ) == "REV" )
+ blameHolder.rev = (ma[*it]).toLongLong();
+ else if ( rx.cap( 2 ) == "AUTHOR" )
+ blameHolder.author= ma[*it];
+ else if ( rx.cap( 2 ) == "DATE" )
+ blameHolder.date= ma[*it];
+ else if ( rx.cap( 2 ) == "CONTENT" )
+ blameHolder.content = ma[*it];
+
+ ++it;
+ if ( it == keys.end() )
+ break;
+ if ( rx.search( *it ) == -1 ){
+ kdDebug(9036) << " Exiting loop at line " << __LINE__ <<endl;
+ break; // something is wrong ! :)
+ }
+ curIdx = rx.cap( 1 ).toInt();
+ }//end of while
+ blameList.append( blameHolder );
+// blameList.insert( blameHolder.line, blameHolder );
+ }
+ processWidget()->showBlameResult( &blameList );
+ m_part->mainWindow()->raiseView(processWidget());
+}
+
+void subversionCore::slotDiffResult( KIO::Job * job )
+{
+ if ( job->error() ){
+ job->showErrorDialog( m_part->mainWindow()->main() );
+ if( job->error() == ERR_CANNOT_LAUNCH_PROCESS )
+ KMessageBox::error( m_part->mainWindow()->main(),
+ i18n("If you have just have installed a new version of KDevelop,"
+ " and the error message was 'unknown protocol kdevsvn+*',"
+ " try restarting KDE."
+ ) );
+ return;
+ }
+ KIO::MetaData ma = job->metaData();
+ QValueList<QString> keys = ma.keys();
+ qHeapSort( keys );
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+ QStringList diffList;
+
+ for ( it = begin; it != end; ++it ) {
+// kdDebug(9036) << "METADATA : " << *it << ":" << ma[ *it ] << endl;
+ if ( ( *it ).endsWith( "diffresult" ) ) {
+ diffList << ma[ *it ];
+ }
+ }
+
+ if ( diffList.count() > 0 ) {
+ //check kompare is available
+ if ( !KStandardDirs::findExe( "kompare" ).isNull() ) {
+ KTempFile *tmp = new KTempFile;
+ tmp->setAutoDelete(true);
+ QTextStream *stream = tmp->textStream();
+ stream->setCodec( QTextCodec::codecForName( "utf8" ) );
+ for ( QStringList::Iterator it2 = diffList.begin();it2 != diffList.end() ; ++it2 ) {
+ ( *stream ) << ( *it2 ) << "\n";
+ }
+ tmp->close();
+ KProcess *p = new KProcess;
+ *p << "kompare" << "-n" << "-o" << tmp->name();
+ p->start();
+
+ } else { //else do it with message box
+ KMessageBox::information( NULL, i18n("You do not have kompare installed. We recommend you install kompare to view differences graphically.") + "\nhttp://www.caffeinated.me.uk/kompare/" , QString::null , "userDoesNotWantKompare" );
+ Subversion_Diff df;
+ for ( QStringList::Iterator it2 = diffList.begin();it2 != diffList.end() ; ++it2 ) {
+ df.text->append( *it2 );
+ }
+ QFont f = df.font();
+ f.setFixedPitch( true );
+ df.text->setFont( f );
+ df.exec();
+ }
+ }
+ else{
+ KMessageBox::information( 0, i18n("No subversion differences") );
+ }
+}
+
+void subversionCore::initProcessDlg( KIO::Job *job, const QString &src, const QString &dest )
+{
+ SvnProgressDlg *progress = new SvnProgressDlg( true );
+ progress->setSourceUrl( src );
+ progress->setDestUrl( dest );
+ progress->setJob( job );
+ connect( job, SIGNAL( totalSize(KIO::Job*, KIO::filesize_t) ),
+ progress, SLOT( slotTotalSize (KIO::Job*, KIO::filesize_t) ) );
+ connect( job, SIGNAL( processedSize(KIO::Job*, KIO::filesize_t) ),
+ progress, SLOT( slotProcessedSize(KIO::Job*, KIO::filesize_t) ) );
+}
+
+void subversionCore::createNewProject( const QString& // dirName
+ , const KURL& // importURL
+ , bool // init
+ ) {
+
+}
+
+#include "subversion_core.moc"
diff --git a/vcs/subversion/subversion_core.h b/vcs/subversion/subversion_core.h
new file mode 100644
index 00000000..c879fce6
--- /dev/null
+++ b/vcs/subversion/subversion_core.h
@@ -0,0 +1,105 @@
+/**
+
+ Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SUBVERSION_CORE_H__
+#define __SUBVERSION_CORE_H__
+
+#include <qobject.h>
+#include <qwidget.h>
+#include <kio/job.h>
+#include <kurl.h>
+#include <ktempdir.h>
+#include "subversion_fileinfo.h"
+#include "subversion_global.h"
+
+class KDevProject;
+class subversionPart;
+class subversionWidget;
+class KApplication;
+class SvnBlameHolder;
+class SvnLogHolder;
+class SvnLogViewWidget;
+
+// class subversionCore : public QObject, public DCOPObject
+class subversionCore : public QObject {
+ Q_OBJECT
+// K_DCOP
+
+public:
+
+ subversionCore(subversionPart *part);
+ ~subversionCore();
+ subversionWidget *processWidget() const;
+// SvnLogViewWidget *processWidget() const;
+ void update( const KURL::List&);
+ void commit( const KURL::List&, bool recurse, bool keeplocks );
+ void svnLog( const KURL::List& list,
+ int revstart, QString revKindStart, int revend, QString revKindEnd,
+ bool discorverChangedPath, bool strictNodeHistory );
+ void blame( const KURL &url, SvnGlobal::UrlMode mode, int revstart, QString revKindStart, int revend, QString revKindEnd );
+ void add( const KURL::List&);
+ void del( const KURL::List&);
+ void diff( const KURL::List&, const QString& where);
+ void diffAsync( const KURL &pathOrUrl1, const KURL &pathOrUrl2,
+ int rev1, QString revKind1, int rev2, QString revKind2,
+ bool recurse, bool pegdiff = false );
+ void revert( const KURL::List&);
+ void resolve( const KURL::List&);
+ void checkout();
+ void switchTree( const KURL &path, const KURL &repositUrl,
+ int revNum, const QString &revKind, bool recurse );
+ void switchRelocate( const KURL &path, const KURL &currentUrl, const KURL &newUrl, bool recurse );
+ void svnCopy( const KURL &src, int srcRev, const QString &srcRevKind, const KURL &dest );
+ void merge( const KURL &src1, int rev1, QString revKind1, const KURL &src2, int rev2, QString revKind2, const KURL &wc_path,
+ bool recurse, bool ignore_ancestry, bool force, bool dry_run );
+ // This is blocking function. But the GUI is not blocked.
+ // Information will be pulled solely from the working copy.Thus no network connections will be made.
+ // Parameter holderMap is the map to be filled out by this method. Callers should preallocate this object.
+ // Return true on success. Otherwise return false.
+ bool clientInfo( KURL path_or_url, bool recurse, QMap< KURL, SvnGlobal::SvnInfoHolder> &holderMap );
+ void createNewProject( const QString& dirName, const KURL& importURL, bool init );
+ KDevVCSFileInfoProvider *fileInfoProvider() const;
+
+ void initProcessDlg( KIO::Job *job, const QString &src, const QString &dest );
+// k_dcop:
+// void notification( const QString&, int,int, const QString&, int,int ,long int, const QString& );
+
+private slots:
+ void slotEndCheckout( KIO::Job * job );
+ void slotResult( KIO::Job * job );
+ void slotLogResult( KIO::Job * job );
+ void slotBlameResult( KIO::Job * job );
+ void slotDiffResult( KIO::Job * job );
+
+signals:
+ void checkoutFinished( QString dir );
+
+private:
+ QGuardedPtr<subversionWidget> m_widget;
+ subversionPart *m_part;
+ QString wcPath;
+ SVNFileInfoProvider *m_fileInfoProvider;
+ QStringList diffresult; //for diff commands ;)
+ // be nice about tmp diff files: delete all of them when exiting.
+ KTempDir* diffTmpDir;
+
+};
+
+#endif
diff --git a/vcs/subversion/subversion_fileinfo.cpp b/vcs/subversion/subversion_fileinfo.cpp
new file mode 100644
index 00000000..c9fb9ee6
--- /dev/null
+++ b/vcs/subversion/subversion_fileinfo.cpp
@@ -0,0 +1,507 @@
+/**
+ Copyright (C) 2004-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#include "subversion_fileinfo.h"
+#include "subversion_core.h"
+#include <kdebug.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <kdevproject.h>
+#include <unistd.h>
+#include <kapplication.h>
+#include <kdevmainwindow.h>
+#include <kmainwindow.h>
+#include <qregexp.h>
+
+#include <kio/netaccess.h>
+#include <klocale.h>
+
+SVNFileInfoProvider::SVNFileInfoProvider(subversionPart *parent, const char *name)
+ : KDevVCSFileInfoProvider( parent, "svnfileinfoprovider" ),
+ m_cachedDirEntries( 0 ), m_recursiveDirEntries(0) {
+ Q_UNUSED(name);
+ m_part = parent;
+}
+
+SVNFileInfoProvider::~SVNFileInfoProvider() {
+ delete m_cachedDirEntries;
+ m_cachedDirEntries = 0;
+ delete m_recursiveDirEntries;
+ m_recursiveDirEntries = 0;
+}
+
+//synchronous
+const VCSFileInfoMap *SVNFileInfoProvider::status( const QString &dirPath ) {
+ if ( !m_cachedDirEntries )
+ m_cachedDirEntries = new VCSFileInfoMap;
+// return m_cachedDirEntries;
+
+ kdDebug(9036) << "svn provider : status " << dirPath << endl;
+
+ if ( dirPath != m_previousDirPath ) {
+ m_previousDirPath = dirPath;
+ KURL servURL = "kdevsvn+http://fakeserver_this_is_normal_behavior/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 9;
+ QString rPath = projectDirectory( );
+ rPath += QDir::separator() + dirPath;
+ kdDebug(9036) << "DIR : " << rPath << " " << KURL( QFileInfo( rPath ).absFilePath() ) << endl;
+
+// s << cmd << KURL( QFileInfo( rPath ).absFilePath() ) << true << true; //original line
+
+ // Dukju Ahn: if checkRepos is set, status() accesses remote repository,
+ // which causes significant delaym_owner especially when network speed is not fast enough.
+ // Of course, the user cannot get information about the out-of-dateness of his local copy.
+ s << cmd << KURL( QFileInfo( rPath ).absFilePath() ) << false/*checkRepos*/ << false /*fullRecurse*/;
+
+ KIO::SimpleJob *job2 = KIO::special(servURL, parms, false);
+ job2->setWindow( m_part->mainWindow()->main() );
+
+
+ QMap<QString,QString> ma;
+
+ KIO::NetAccess::synchronousRun(job2, m_part->mainWindow()->main(), 0, 0, &ma );
+
+ QValueList<QString> keys = ma.keys();
+ qHeapSort( keys );
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+
+ QString path;
+ int text_status = 0, prop_status = 0, repos_text_status = 0, repos_prop_status = 0;
+ long int rev = 0;
+ int curIdx, lastIdx;
+
+ QRegExp rx( "([0-9]*)(.*)" );
+ for ( it = begin; it != end; ) {
+ kdDebug(9036) << "METADATA : " << *it << ":" << ma[ *it ] << endl;
+ if ( rx.search( *it ) == -1 ) return m_cachedDirEntries; // something is wrong ! :)
+ /* if some notification comes here, consume these notification metadatas */
+ if ( rx.cap( 2 ) == "action" ){
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ){
+ ++it;
+ if ( it == end ) break;
+ if ( rx.search( *it ) == -1 ) continue; // something is wrong
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ continue;
+ }
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ) {
+ if ( rx.cap( 2 ) == "path" )
+ path = ma[ *it ];
+ else if ( rx.cap( 2 ) == "text" )
+ text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "prop" )
+ prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "reptxt" )
+ repos_text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "repprop" )
+ repos_prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "rev" )
+ rev = ma[ *it ].toLong();
+ ++it;
+ if ( it == end )
+ break;
+ if ( rx.search( *it ) == -1 ) break; // something is wrong ! :)
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ slotStatus(path, text_status, prop_status, repos_text_status, repos_prop_status, rev);
+ }
+ }
+ kdDebug(9036) << " Returning VcsFileInfoMap. provider::status() finished " << endl;
+ return m_cachedDirEntries;
+}
+
+bool SVNFileInfoProvider::requestStatus( const QString &dirPath, void *callerData, bool recursive, bool checkRepos ) {
+ kdDebug(9036) << "##################################################################################### svn provider : request status" << endl;
+ m_savedCallerData = callerData;
+ // Flush old cache
+ if (m_cachedDirEntries)
+ {
+ delete m_cachedDirEntries;
+ m_cachedDirEntries = 0;
+ m_previousDirPath = dirPath;
+ }
+
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 9;
+ QString rPath = projectDirectory( );
+ rPath += QDir::separator() + dirPath;
+
+ if( ! m_part->isValidDirectory( rPath ) ){
+ return false;
+ }
+
+ kdDebug(9036) << "DIR : " << rPath << " " << QFileInfo( rPath ).absFilePath() << endl;
+ s << cmd << KURL( QFileInfo( rPath ).absFilePath() ) << checkRepos << recursive;
+ KURL servURL = "kdevsvn+http://fakeserver_this_is_normal_behavior/";
+ job = KIO::special(servURL, parms, false);
+ connect( job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
+ if( checkRepos )
+ m_part->svncore()->initProcessDlg( job, dirPath, i18n("Subversion File/Directory Status") );
+ return true;
+}
+
+void SVNFileInfoProvider::slotResult( KIO::Job *j ) {
+ if ( j->error() )
+ j->showErrorDialog( m_part->mainWindow()->main() );
+
+ KIO::MetaData ma = j->metaData();
+ QValueList<QString> keys = ma.keys();
+ qHeapSort( keys );
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+
+ QString path;
+ int text_status = 0, prop_status = 0, repos_text_status = 0, repos_prop_status = 0;
+ long int rev = 0;
+ int curIdx, lastIdx;
+
+ QRegExp rx( "([0-9]*)(.*)" );
+ for ( it = begin; it != end; ) {
+ kdDebug(9036) << "METADATA : " << *it << ":" << ma[ *it ] << endl;
+ if ( rx.search( *it ) == -1 ) return; // something is wrong ! :)
+ /* if some notification comes here, consume these notification metadatas */
+ if ( rx.cap( 2 ) == "action" ){
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ){
+ ++it;
+ if ( it == end ) break;
+ if ( rx.search( *it ) == -1 ) continue; // something is wrong
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ continue;
+ }
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ) {
+ if ( rx.cap( 2 ) == "path" )
+ path = ma[ *it ];
+ else if ( rx.cap( 2 ) == "text" )
+ text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "prop" )
+ prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "reptxt" )
+ repos_text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "repprop" )
+ repos_prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "rev" )
+ rev = ma[ *it ].toLong();
+ ++it;
+ if ( it == end )
+ break;
+ if ( rx.search( *it ) == -1 ) break; // something is wrong ! :)
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ slotStatus(path, text_status, prop_status, repos_text_status, repos_prop_status, rev);
+ }
+
+ if ( m_cachedDirEntries )
+ emit statusReady(*m_cachedDirEntries, m_savedCallerData);
+}
+
+void SVNFileInfoProvider::slotStatus( const QString& path,int text_status, int prop_status,int repos_text_status, int repos_prop_status, long int rev) {
+// kdDebug(9036) << "##################################################################################### svn provider : slotstatus"
+// << " path " << path << " text_status " << text_status << " prop_status " << prop_status << " repos_text_status " << repos_text_status
+// << " repos_prop_status " << repos_prop_status << " rev " << rev
+// << endl;
+
+ if ( !m_cachedDirEntries )
+ m_cachedDirEntries = new VCSFileInfoMap;
+
+ QString wRev = QString::number( rev ); //work rev
+ QString rRev = QString::number( rev );// repo rev
+ VCSFileInfo::FileState state = VCSFileInfo::Unknown;
+
+ switch ( text_status ) {
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ state = VCSFileInfo::Uptodate;
+ break;
+ case 4:
+ state = VCSFileInfo::Added;
+ break;
+ case 5:
+ break;
+ case 6: //deleted
+ state = VCSFileInfo::Deleted;
+ break;
+ case 7: //replaced
+ state = VCSFileInfo::Replaced;
+ break;
+ case 8: //modified
+ state = VCSFileInfo::Modified;
+ break;
+ case 9: //merged
+ break;
+ case 10: //conflicted
+ state = VCSFileInfo::Conflict;
+ break;
+ case 11: //ignored
+ break;
+ case 12: //obstructed
+ break;
+ case 13: //external
+ break;
+ case 14: //incomplete
+ break;
+ }
+ switch( prop_status ) {
+ case 8:
+ state = VCSFileInfo::Modified;
+ break;
+ }
+ switch ( repos_text_status ) {
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ case 4:
+ break;
+ case 5:
+ break;
+ case 6: //deleted
+ break;
+ case 7: //replaced
+ break;
+ case 8: //modified
+ state = VCSFileInfo::NeedsPatch;
+ break;
+ case 9: //merged
+ break;
+ case 10: //conflicted
+ break;
+ case 11: //ignored
+ break;
+ case 12: //obstructed
+ break;
+ case 13: //external
+ break;
+ case 14: //incomplete
+ break;
+ }
+
+ VCSFileInfo info(QFileInfo( path ).fileName(),wRev,rRev,state);
+ kdDebug(9036) << "Inserting " << info.toString() << endl;
+ m_cachedDirEntries->insert( QFileInfo( path ).fileName(), info);
+}
+
+QString SVNFileInfoProvider::projectDirectory() const {
+ return owner()->project()->projectDirectory();
+}
+
+const VCSFileInfoMap *SVNFileInfoProvider::statusExt( const QString &dirPath,
+ bool checkRepos, bool fullRecurse, bool getAll, bool noIgnore )
+{
+ if ( !m_recursiveDirEntries )
+ m_recursiveDirEntries = new VCSFileInfoMap;
+
+// if ( dirPath != m_recursivePreviousDirPath ) {
+ m_recursiveDirEntries->clear();
+ m_recursivePreviousDirPath = dirPath;
+ KURL servURL = "kdevsvn+http://fakeserver_this_is_normal_behavior/";
+ QByteArray parms;
+ QDataStream s( parms, IO_WriteOnly );
+ int cmd = 109;
+ QString rPath = projectDirectory( );
+ rPath += QDir::separator() + dirPath;
+ kdDebug(9036) << "DIR : " << rPath << " " << KURL( QFileInfo( rPath ).absFilePath() ) << endl;
+ s << cmd << checkRepos << fullRecurse << getAll << noIgnore << -1 << "WORKING" << KURL( QFileInfo( rPath ).absFilePath() );
+ KIO::SimpleJob *job2 = KIO::special(servURL, parms, false);
+ job2->setWindow( m_part->mainWindow()->main() );
+
+
+ QMap<QString,QString> ma;
+ KIO::NetAccess::synchronousRun(job2, m_part->mainWindow()->main(), 0, 0, &ma );
+
+ QValueList<QString> keys = ma.keys();
+ qHeapSort( keys );
+ QValueList<QString>::Iterator begin = keys.begin(), end = keys.end(), it;
+
+ QString path;
+ int text_status = 0, prop_status = 0, repos_text_status = 0, repos_prop_status = 0;
+ long int rev = 0;
+ int curIdx, lastIdx;
+
+ QRegExp rx( "([0-9]*)(.*)" );
+ for ( it = begin; it != end; ) {
+ kdDebug(9036) << "METADATA : " << *it << ":" << ma[ *it ] << endl;
+ if ( rx.search( *it ) == -1 ) return m_recursiveDirEntries; // something is wrong ! :)
+ /* if some notification comes here, consume these notification metadatas */
+ if ( rx.cap( 2 ) == "action" ){
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ){
+ ++it;
+ if ( it == end ) break;
+ if ( rx.search( *it ) == -1 ) continue; // something is wrong
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ continue;
+ }
+ /* get properties */
+ curIdx = lastIdx = rx.cap( 1 ).toInt();
+ while ( curIdx == lastIdx ) {
+ if ( rx.cap( 2 ) == "path" )
+ path = ma[ *it ];
+ else if ( rx.cap( 2 ) == "text" )
+ text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "prop" )
+ prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "reptxt" )
+ repos_text_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "repprop" )
+ repos_prop_status = ma[ *it ].toInt();
+ else if ( rx.cap( 2 ) == "rev" )
+ rev = ma[ *it ].toLong();
+ ++it;
+ if ( it == end )
+ break;
+ if ( rx.search( *it ) == -1 ) break; // something is wrong ! :)
+ curIdx = rx.cap( 1 ).toInt();
+ }
+ slotStatusExt(dirPath, path, text_status, prop_status, repos_text_status, repos_prop_status, rev);
+ }
+// }
+
+ return m_recursiveDirEntries;
+}
+
+void SVNFileInfoProvider::slotStatusExt(
+ const QString& reqPath, const QString& path,int text_status, int prop_status,int repos_text_status, int repos_prop_status, long int rev)
+{
+
+ if ( !m_recursiveDirEntries )
+ m_recursiveDirEntries = new VCSFileInfoMap;
+
+ QString wRev = QString::number( rev ); //work rev
+ QString rRev = QString::number( rev );// repo rev
+ VCSFileInfo::FileState state = VCSFileInfo::Unknown;
+
+ switch ( text_status ) {
+ case 1: // does not exist
+ break;
+ case 2: // unversioned
+ break;
+ case 3:
+ state = VCSFileInfo::Uptodate;
+ break;
+ case 4:
+ state = VCSFileInfo::Added;
+ break;
+ case 5: // missing
+ break;
+ case 6: //deleted
+ state = VCSFileInfo::Deleted;
+ break;
+ case 7: //replaced
+ state = VCSFileInfo::Replaced;
+ break;
+ case 8: //modified
+ state = VCSFileInfo::Modified;
+ break;
+ case 9: //merged
+ break;
+ case 10: //conflicted
+ state = VCSFileInfo::Conflict;
+ break;
+ case 11: //ignored
+ break;
+ case 12: //obstructed
+ break;
+ case 13: //external
+ break;
+ case 14: //incomplete
+ break;
+ }
+ switch( prop_status ) {
+ case 8:
+ state = VCSFileInfo::Modified;
+ break;
+ }
+ switch ( repos_text_status ) {
+ case 1:
+ break;
+ case 2:
+ break;
+ case 3:
+ break;
+ case 4:
+ break;
+ case 5:
+ break;
+ case 6: //deleted
+ break;
+ case 7: //replaced
+ break;
+ case 8: //modified
+ state = VCSFileInfo::NeedsPatch;
+ break;
+ case 9: //merged
+ break;
+ case 10: //conflicted
+ break;
+ case 11: //ignored
+ break;
+ case 12: //obstructed
+ break;
+ case 13: //external
+ break;
+ case 14: //incomplete
+ break;
+ }
+
+ QString relativeReqPath;
+ if (reqPath == "./"){
+ // case of project top directory
+ QString reqAbsPath = projectDirectory();
+
+ if( path == reqAbsPath ){
+ //key of VCSInfo is project directory itself. So it is set to .
+ relativeReqPath = ".";
+ }
+ else{
+ relativeReqPath = path.right( path.length() - reqAbsPath.length() - 1 );
+ }
+ }
+ else {
+ QString reqAbsPath = projectDirectory() + QDir::separator() + reqPath;
+ relativeReqPath = path.right( path.length() - reqAbsPath.length() - 1 );
+
+ if (relativeReqPath == reqAbsPath){
+ // case of requested directory itself.
+ relativeReqPath = ".";
+ }
+ }
+
+ VCSFileInfo info(relativeReqPath, wRev, rRev, state);
+ m_recursiveDirEntries->insert( relativeReqPath, info );
+
+// VCSFileInfo info(QFileInfo( path ).fileName(),wRev,rRev,state);
+ kdDebug(9036) << "Inserting " << info.toString() << endl;
+// m_recursiveDirEntries->insert( QFileInfo( path ).fileName(), info);
+}
+
+#include "subversion_fileinfo.moc"
+
diff --git a/vcs/subversion/subversion_fileinfo.h b/vcs/subversion/subversion_fileinfo.h
new file mode 100644
index 00000000..e2ab1b70
--- /dev/null
+++ b/vcs/subversion/subversion_fileinfo.h
@@ -0,0 +1,73 @@
+/**
+
+ Copyright (C) 2004-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SVNFILEINFOPROVIDER_H
+#define SVNFILEINFOPROVIDER_H
+
+#include <qmap.h>
+
+#include <kdevversioncontrol.h>
+#include <kio/job.h>
+#include <dcopclient.h>
+#include <dcopobject.h>
+#include <subversion_part.h>
+
+/**
+Provider for SVN file information
+
+@author Mickael Marchand
+*/
+class SVNFileInfoProvider : public KDevVCSFileInfoProvider, public DCOPObject/*, virtual public DCOPClient*/
+{
+ Q_OBJECT
+ K_DCOP
+
+public:
+ SVNFileInfoProvider( subversionPart *parent, const char *name = 0);
+ virtual ~SVNFileInfoProvider();
+
+// -- Sync interface
+ virtual const VCSFileInfoMap *status( const QString &dirPath );
+// -- These two are used for subversionPart and subversionCore. Of couruse, others can use it.
+ const VCSFileInfoMap* statusExt( const QString &dirPath, bool checkRepos, bool fullRecurse, bool getAll, bool noIgnore );
+ void slotStatusExt( const QString&, const QString& , int, int, int, int, long int ) ;
+
+// -- Async interface for requesting data
+ virtual bool requestStatus( const QString &dirPath, void *callerData, bool recursive = true, bool checkRepos = true );
+
+ QString projectDirectory() const;
+
+k_dcop:
+ void slotStatus( const QString& , int, int, int, int, long int ) ;
+
+public slots:
+ void slotResult( KIO::Job * );
+
+private:
+ mutable void *m_savedCallerData;
+ mutable QString m_previousDirPath;
+ mutable QString m_recursivePreviousDirPath;
+ mutable VCSFileInfoMap *m_cachedDirEntries;
+ mutable VCSFileInfoMap *m_recursiveDirEntries;
+ KIO::SimpleJob *job;
+ subversionPart *m_part;
+};
+
+#endif
diff --git a/vcs/subversion/subversion_global.h b/vcs/subversion/subversion_global.h
new file mode 100644
index 00000000..062d7fe9
--- /dev/null
+++ b/vcs/subversion/subversion_global.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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.
+ */
+
+#ifndef SUBVERSION_GLOBAL_H
+#define SUBVERSION_GLOBAL_H
+
+#include <kurl.h>
+#include <qdatetime.h>
+
+namespace SvnGlobal
+{
+
+typedef enum {
+ path_to_reposit = 0,
+ path_to_path = 1,
+ dont_touch = 2
+} UrlMode;
+
+/// A structure which describes various system-generated metadata about
+/// a working-copy path or URL.
+class SvnInfoHolder {
+public:
+ // the requested path
+ KURL path;
+ /* Where the item lives in the repository. */
+ KURL url;
+ // The revision of the object. If path_or_url is a working-copy
+ // path, then this is its current working revnum. If path_or_url
+ // is a URL, then this is the repos revision that path_or_url lives in. */
+ int rev;
+ int kind;
+ /* The root URL of the repository. */
+ KURL reposRootUrl;
+ QString reposUuid;
+};
+
+class SvnRevision{
+public:
+ int revNum;
+ QString revKind;
+ QDateTime revDate;
+};
+
+} // end of namespace SvnGlobal
+#endif
diff --git a/vcs/subversion/subversion_part.cpp b/vcs/subversion/subversion_part.cpp
new file mode 100644
index 00000000..f918ea44
--- /dev/null
+++ b/vcs/subversion/subversion_part.cpp
@@ -0,0 +1,569 @@
+/**
+ Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+#include "subversion_part.h"
+
+#include <qwhatsthis.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kdevgenericfactory.h>
+#include <kaction.h>
+#include <kpopupmenu.h>
+
+#include "kdevcore.h"
+#include "kdevmainwindow.h"
+#include "subversion_core.h"
+#include "subversion_widget.h"
+#include "subversionprojectwidget.h"
+#include "subversion_fileinfo.h"
+#include "subversion_global.h"
+#include "kdevversioncontrol.h"
+#include "svn_fileselectdlg_commit.h"
+#include "svn_logviewwidget.h"
+#include "svn_switchwidget.h"
+#include "svn_copywidget.h"
+#include "svn_mergewidget.h"
+
+#include "urlutil.h"
+#include <qvbox.h>
+#include <kdialogbase.h>
+#include <kparts/part.h>
+#include <kdevpartcontroller.h>
+#include <kdevproject.h>
+#include <domutil.h>
+#include <kurlrequester.h>
+#include <qradiobutton.h>
+#include <kdebug.h>
+#include <qwidget.h>
+#include <kdevplugininfo.h>
+
+#include <kmessagebox.h>
+
+using namespace SvnGlobal;
+
+static const KDevPluginInfo data("kdevsubversion");
+
+typedef KDevGenericFactory<subversionPart> subversionFactory;
+K_EXPORT_COMPONENT_FACTORY( libkdevsubversion, subversionFactory( data ) )
+
+//bool g_projectWasJustCreated = false;
+
+subversionPart::subversionPart(QObject *parent, const char *name, const QStringList& )
+ : KDevVersionControl(&data, parent, name ? name : "Subversion" ) {
+ setInstance(subversionFactory::instance());
+ m_projWidget = 0;
+
+ m_impl = new subversionCore( this );
+
+ //m_impl->processWidget()->setIcon( SmallIcon("db") );
+
+ setupActions();
+
+ connect( m_impl, SIGNAL(checkoutFinished(QString)), SIGNAL(finishedFetching(QString)) );
+
+ // Context menu
+ connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
+ connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)), this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
+ connect( core(), SIGNAL(projectOpened()), this, SLOT(slotProjectOpened()) );
+ connect( core(), SIGNAL(projectClosed()), this, SLOT(slotProjectClosed()) );
+
+ m_impl->processWidget()->setCaption(i18n( "Subversion Output" ));
+ mainWindow()->embedOutputView( (QWidget*)m_impl->processWidget(), i18n( "Subversion" ), i18n( "Subversion messages" ) );
+ QWhatsThis::add((QWidget*)m_impl->processWidget(), i18n("<b>Subversion</b><p>Subversion operations window."));
+
+}
+
+subversionPart::~subversionPart() {
+ if ( m_projWidget ){
+ delete (subversionProjectWidget*) m_projWidget;
+ m_projWidget = 0;
+ }
+ delete m_impl;
+}
+
+void subversionPart::setupActions() {
+ actionCommit = new KAction( i18n("&Commit to Repository..."), 0, this, SLOT(slotActionCommit()), actionCollection(), "subversion_commit" );
+ actionCommit->setToolTip( i18n("Commit file(s)") );
+ actionCommit->setWhatsThis( i18n("<b>Commit file(s)</b><p>Commits file to repository if modified.") );
+
+ /* actionDiff = new KAction( i18n("&Difference Between Revisions"), 0, this, SLOT(slotActionDiff()),
+ actionCollection(), "subversion_diff" );
+ actionDiff->setToolTip( i18n("Build difference") );
+ actionDiff->setWhatsThis( i18n("<b>Build difference</b><p>Builds difference between releases.") );
+ */
+ actionAdd = new KAction( i18n("&Add to Repository"), 0, this, SLOT(slotActionAdd()), actionCollection(), "subversion_add" );
+ actionAdd->setToolTip( i18n("Add file to repository") );
+ actionAdd->setWhatsThis( i18n("<b>Add file to repository</b><p>Adds file to repository.") );
+
+ actionLog = new KAction( i18n("Show logs..."), 0, this, SLOT(slotLog()), actionCollection(), "subversion_log" );
+ actionBlame = new KAction( i18n("Blame..."), 0, this, SLOT(slotBlame()), actionCollection(), "subversion_blame");
+
+ actionRemove = new KAction( i18n("&Remove From Repository"), 0, this, SLOT(slotActionDel()), actionCollection(), "subversion_remove" );
+ actionRemove->setToolTip( i18n("Remove from repository") );
+ actionRemove->setWhatsThis( i18n("<b>Remove from repository</b><p>Removes file(s) from repository.") );
+
+ actionUpdate = new KAction( i18n("&Update"), 0, this, SLOT(slotActionUpdate()), actionCollection(), "subversion_update" );
+ actionUpdate->setToolTip( i18n("Update") );
+ actionUpdate->setWhatsThis( i18n("<b>Update</b><p>Updates file(s) from repository.") );
+
+ actionDiffLocal = new KAction( i18n("&Diff to BASE"), 0, this, SLOT(slotActionDiffLocal()), actionCollection(), "subversion_diff_local" );
+ actionDiffLocal->setToolTip( i18n("Diff to BASE") );
+ actionDiffLocal->setWhatsThis( i18n("<b>Diff to disk</b><p>Diff current file to the BASE checked out copy.") );
+
+ actionDiffHead = new KAction( i18n("&Diff to HEAD"), 0, this, SLOT(slotActionDiffLocal()), actionCollection(), "subversion_diff_head" );
+ actionDiffHead->setToolTip( i18n("Diff to HEAD") );
+ actionDiffHead->setWhatsThis( i18n("<b>Diff HEAD</b><p>Diff the current file to HEAD in svn.") );
+
+
+ actionRevert = new KAction( i18n("&Revert"), 0, this, SLOT(slotActionRevert()), actionCollection(), "subversion_revert" );
+ actionRevert->setToolTip( i18n("Revert") );
+ actionRevert->setWhatsThis( i18n("<b>Revert</b><p>Undo local changes.") );
+
+ /*
+ actionAddToIgnoreList = new KAction( i18n("&Ignore in Subversion Operations"), 0,
+ this, SLOT(slotActionAddToIgnoreList()), actionCollection(), "subversion_ignore" );
+ actionAddToIgnoreList->setToolTip( i18n("Ignore in Subversion operations") );
+ actionAddToIgnoreList->setWhatsThis( i18n("<b>Ignore in Subversion operations</b><p>Ignores file(s).") );
+
+ actionRemoveFromIgnoreList = new KAction( i18n("Do &Not Ignore in Subversion Operations"), 0,
+ this, SLOT(slotActionRemoveFromIgnoreList()), actionCollection(), "subversion_donot_ignore" );
+ actionRemoveFromIgnoreList->setToolTip( i18n("Do not ignore in Subversion operations") );
+ actionRemoveFromIgnoreList->setWhatsThis( i18n("<b>Do not ignore in Subversion operations</b><p>Do not ignore file(s).") );
+ */
+ actionResolve = new KAction( i18n("Re&solve Conflicting State"), 0,
+ this, SLOT(slotActionResolve()), actionCollection(), "subversion_resolve" );
+ actionResolve->setToolTip( i18n("Resolve the conflicting state of a file after a merge") );
+ actionResolve->setWhatsThis( i18n("<b>Resolve the conflicting state</b><p>Remove the conflict state that can be set on a file after a merge failed.") );
+ actionSwitch = new KAction( i18n("Switch this working copy to URL.."), 0,
+ this, SLOT(slotSwitch()), actionCollection(), "subversion_switch" );
+ // warn slogCopy(), slotMerge only works on context menu. There is no main-menu action
+ actionCopy = new KAction( i18n("Copy this working copy to URL.."), 0,
+ this, SLOT(slotCopy()), actionCollection(), "subversion_copy" );
+ actionMerge = new KAction( i18n("Merge difference to working copy"), 0,
+ this, SLOT(slotMerge()), actionCollection(), "subversion_merge" );
+}
+
+QWidget* subversionPart::newProjectWidget( QWidget* parent ) {
+ if ( !m_projWidget )
+ m_projWidget = new subversionProjectWidget(parent,"projectwidget");
+ return m_projWidget;
+}
+
+void subversionPart::createNewProject( const QString& dirname ) {
+ if ( !m_projWidget ) return;
+
+ m_impl->createNewProject( dirname, KURL( m_projWidget->importURL->url() ), m_projWidget->yes->isChecked() );
+
+}
+
+bool subversionPart::fetchFromRepository() {
+ m_impl->checkout();
+ return true;
+}
+
+KDevVCSFileInfoProvider * subversionPart::fileInfoProvider() const {
+ return m_impl->fileInfoProvider();
+}
+
+void subversionPart::contextMenu( QPopupMenu *popup, const Context *context ) {
+ //no project, no subversion. Don't test on projectDirectory() here. If the user wants this project to have subversion support
+ //give it to him. e.g. for out of root subprojects like with qmake
+if(!project())
+ return;
+
+ kdDebug(9036) << "contextMenu()" << endl;
+ if (context->hasType( Context::FileContext ) ||
+ context->hasType( Context::EditorContext ))
+ {
+
+ if (context->hasType( Context::FileContext ))
+ {
+ kdDebug(9036) << "Requested for a FileContext" << endl;
+ const FileContext *fcontext = static_cast<const FileContext*>( context );
+ m_urls = fcontext->urls();
+ }
+ else
+ {
+ kdDebug(9036) << "Requested for an EditorContext" << endl;
+ const EditorContext *editorContext = static_cast<const EditorContext*>( context );
+ m_urls = editorContext->url();
+ }
+ // THis stuff should end up into prepareOperation()
+ URLUtil::dump( m_urls );
+ if (m_urls.count() <= 0)
+ return;
+
+ KPopupMenu *subMenu = new KPopupMenu( popup );
+ if (context->hasType( Context::FileContext ))
+ popup->insertSeparator();
+
+ int id = subMenu->insertItem( actionCommit->text(), this, SLOT(slotCommit()) );
+ // CvsService let to do log and diff operations only on one file (or directory) at time
+ /* if (m_urls.count() == 1)
+ {
+ subMenu->insertItem( actionDiff->text(), this, SLOT(slotDiff()) );
+ subMenu->insertItem( actionLog->text(), this, SLOT(slotLog()) );
+ }*/
+ subMenu->setWhatsThis(id, i18n("<b>Commit file(s)</b><p>Commits file to repository if modified."));
+ id = subMenu->insertItem( actionAdd->text(), this, SLOT(slotAdd()) );
+ subMenu->setWhatsThis(id, i18n("<b>Add file to repository</b><p>Adds file to repository."));
+ id = subMenu->insertItem( actionRemove->text(), this, SLOT(slotDel()) );
+ subMenu->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Removes file(s) from repository."));
+ id = subMenu->insertItem( actionLog->text(), this, SLOT(slotLog()) );
+ subMenu->setWhatsThis(id, i18n("<b>Show logs..</b><p>View Logs"));
+ id = subMenu->insertItem( actionBlame->text(), this, SLOT(slotBlame()) );
+ subMenu->setWhatsThis(id, i18n("<b>Blame 0:HEAD </b><p>Show Annotate"));
+
+ subMenu->insertSeparator();
+ id = subMenu->insertItem( actionDiffLocal->text(), this, SLOT(slotDiffLocal()) );
+ subMenu->setWhatsThis(id, i18n("<b>Diff</b><p>Diff file to local disk."));
+
+ id = subMenu->insertItem( actionDiffHead->text(), this, SLOT(slotDiffHead()) );
+ subMenu->setWhatsThis(id, i18n("<b>Diff</b><p>Diff file to repository."));
+
+ id = subMenu->insertItem( actionUpdate->text(), this, SLOT(slotUpdate()) );
+ subMenu->setWhatsThis(id, i18n("<b>Update</b><p>Updates file(s) from repository."));
+ id = subMenu->insertItem( actionRevert->text(), this, SLOT(slotRevert()) );
+ subMenu->setWhatsThis(id, i18n("<b>Revert</b><p>Undo local changes.") );
+ id = subMenu->insertItem( actionResolve->text(), this, SLOT(slotResolve()) );
+ subMenu->setWhatsThis(id, i18n("<b>Resolve</b><p>Resolve conflicting state.") );
+ id = subMenu->insertItem( actionSwitch->text(), this, SLOT(slotSwitch()) );
+ subMenu->setWhatsThis(id, i18n("<b>Switch</b><p>Switch working tree.") );
+ id = subMenu->insertItem( actionCopy->text(), this, SLOT(slotCopy()) );
+ subMenu->setWhatsThis(id, i18n("<b>Copy</b><p>Copy from/between path/URLs") );
+ id = subMenu->insertItem( actionMerge->text(), this, SLOT(slotMerge()) );
+ subMenu->setWhatsThis(id, i18n("<b>Merge</b><p>Merge difference to working copy") );
+
+ /*
+ subMenu->insertSeparator();
+ id = subMenu->insertItem( actionAddToIgnoreList->text(), this, SLOT(slotAddToIgnoreList()) );
+ subMenu->setWhatsThis(id, i18n("<b>Ignore in Subversion operations</b><p>Ignores file(s)."));
+ id = subMenu->insertItem( actionRemoveFromIgnoreList->text(), this, SLOT(slotRemoveFromIgnoreList()) );
+ subMenu->setWhatsThis(id, i18n("<b>Do not ignore in Subversion operations</b><p>Do not ignore file(s)."));
+*/
+ // Now insert in parent menu
+ popup->insertItem( i18n("Subversion"), subMenu );
+ }
+}
+
+bool subversionPart::urlFocusedDocument( KURL &url ) {
+ KParts::ReadOnlyPart *part = dynamic_cast<KParts::ReadOnlyPart*>( partController()->activePart() );
+ if ( part ) {
+ if (part->url().isLocalFile() ) {
+ url = part->url();
+ return true;
+ }
+ }
+ return false;
+}
+
+void subversionPart::slotActionUpdate() {
+ kdDebug(9036) << "subversion: slotActionUpdate()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->update( doc );
+ }
+}
+
+void subversionPart::slotUpdate() {
+ m_impl->update (m_urls);
+}
+
+void subversionPart::slotActionResolve() {
+ kdDebug(9036) << "subversion: slotActionResolve()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->resolve( doc );
+ }
+}
+
+void subversionPart::slotResolve() {
+ m_impl->resolve (m_urls);
+}
+
+void subversionPart::slotSwitch()
+{
+ if( m_urls.count() > 1 ){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Please select only one item for subversion switch") );
+ return;
+ }
+ if( m_urls.count() < 1 ) return;
+
+ // retrieve repository info from local-copy metadata which will be displayed in dialog box
+ KURL wcPath = m_urls.first();
+ QMap< KURL, SvnGlobal::SvnInfoHolder> holderMap;
+ SvnGlobal::SvnInfoHolder holder;
+
+ m_impl->clientInfo( wcPath, false, holderMap );
+ QValueList< SvnGlobal::SvnInfoHolder > holderList = holderMap.values();
+ holder = holderList.first();
+ // invoke dialog box
+ SvnSwitchDlg dlg( &holder, wcPath.path(), (QWidget*)project()->mainWindow()->main() );
+
+ if( dlg.exec() != QDialog::Accepted ){
+ return;
+ }
+ // check target url's validity
+ KURL repositUrl = KURL( dlg.destUrl() );
+ if( !repositUrl.isValid() ){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("The destination URL is invalid") );
+ return;
+ }
+ // call core
+ if( dlg.switchOnly() )
+ m_impl->switchTree( wcPath, repositUrl, -1, "HEAD", dlg.recursive() );
+ else if( dlg.relocation() )
+ m_impl->switchRelocate( wcPath, dlg.currentUrl(), repositUrl, dlg.recursive() );
+ else
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Fail to conduct subversion switch. No action was selected") );
+}
+
+void subversionPart::slotCopy()
+{
+ // error check
+ if( m_urls.count() > 1 ){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Please select only one item for subversion switch") );
+ return;
+ }
+ if( m_urls.count() < 1 ) return;
+
+ // retrieve repository info from local-copy metadata which will be displayed in dialog box
+ KURL wcPath = m_urls.first();
+ QMap< KURL, SvnGlobal::SvnInfoHolder> holderMap;
+ SvnGlobal::SvnInfoHolder holder;
+ m_impl->clientInfo( wcPath, false, holderMap );
+ QValueList< SvnGlobal::SvnInfoHolder > holderList = holderMap.values();
+ holder = holderList.first();
+ // start input dialog
+ SvnCopyDialog dlg( wcPath.prettyURL(),
+ &holder,
+ (QWidget*)project()->mainWindow()->main());
+
+ if( dlg.exec() != QDialog::Accepted )
+ return;
+ // retrieve user input
+ KURL srcUrl = dlg.sourceUrl();
+ int rev = dlg.revision();
+ QString revKind = dlg.revKind();
+ KURL dest = dlg.destUrl();
+
+ kdDebug(9036) << " SRC: " << srcUrl << " DEST: " << dest << " Revnum: " << rev << " RevKind: " << revKind << endl;
+
+ m_impl->svnCopy( srcUrl, rev, revKind, dest );
+}
+
+void subversionPart::slotMerge()
+{
+ // error check
+ if( m_urls.count() > 1 ){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Please select only one item for subversion merge") );
+ return;
+ }
+ if( m_urls.count() < 1 ) return;
+
+ KURL wcTarget= m_urls.first();
+ SvnMergeDialog dlg( wcTarget, (QWidget*)project()->mainWindow()->main() );
+ if( dlg.exec() != QDialog::Accepted ) return;
+
+ KURL src1 = dlg.source1();
+ SvnRevision rev1 = dlg.rev1();
+ KURL src2 = dlg.source2();
+ SvnRevision rev2 = dlg.rev2();
+
+ m_impl->merge( src1, rev1.revNum, rev1.revKind, src2, rev2.revNum, rev2.revKind, wcTarget,
+ dlg.recurse(), dlg.ignoreAncestry(), dlg.force(), dlg.dryRun() );
+}
+
+void subversionPart::slotActionCommit() {
+ kdDebug(9036) << "subversion: slotActionCommit()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->commit( doc, true, true );
+ }
+}
+
+void subversionPart::slotActionAdd() {
+ kdDebug(9036) << "subversion: slotActionAdd()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->add( doc );
+ }
+}
+
+void subversionPart::slotActionDel() {
+ kdDebug(9036) << "subversion: slotActionDel()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->del( doc );
+ }
+}
+
+void subversionPart::slotActionRevert() {
+ kdDebug(9036) << "subversion: slotActionRevert()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->revert( doc );
+ }
+}
+
+void subversionPart::slotActionDiffLocal() {
+ kdDebug(9036) << "subversion: slotActionDiffLocal()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->diff( doc, "BASE" );
+ }
+}
+void subversionPart::slotActionDiffHead() {
+ kdDebug(9036) << "subversion: slotActionDiffHead()" << endl;
+ KURL doc;
+ if (urlFocusedDocument( doc )) {
+ m_impl->diff( doc, "HEAD" );
+ }
+}
+void subversionPart::slotCommit()
+{
+ SVNFileSelectDlgCommit dialog( m_urls, this, 0 );
+ if( dialog.exec() == QDialog::Accepted ){
+ KURL::List tobeCommittedUrls = dialog.checkedUrls();
+ bool recursive = dialog.recursive();
+ bool keepLocks = dialog.keepLocks();
+ m_impl->commit(tobeCommittedUrls, recursive, keepLocks );
+ }
+}
+void subversionPart::slotAdd() {
+ m_impl->add( m_urls );
+}
+
+void subversionPart::slotLog()
+{
+ if (m_urls.count() > 1){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Please select only one item for subversion log") );
+ return;
+ }
+ SvnLogViewOptionDlg dlg;
+ if( dlg.exec() ){
+ int revstart = dlg.revstart();
+ QString revkindstart = dlg.revKindStart();
+ int revend = dlg.revend();
+ QString revkindend = dlg.revKindEnd();
+ bool strictNode = dlg.strictNode();
+ m_impl->svnLog (m_urls, revstart, revkindstart, revend, revkindend, true/*changedPath*/, strictNode);
+ } else{
+ return;
+ }
+}
+void subversionPart::slotBlame()
+{
+ if (m_urls.count() > 1){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Please select only one item to see annotate") );
+ return;
+ }
+ if (m_urls.count() < 1){
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Select file to see blame") );
+ return;
+ }
+ KURL url = m_urls.first();
+ m_impl->blame(url, SvnGlobal::path_to_reposit, 0, "", -1, "BASE");
+}
+
+void subversionPart::slotDel() {
+ m_impl->del (m_urls);
+}
+
+// note: currently diffAsync does not support merging. But svncore::diff()
+// cannot be invoked on directory, while diffAsync can.
+void subversionPart::slotDiffLocal() {
+// m_impl->diff (m_urls, "BASE");
+ if( m_urls.count() < 1 ){
+ // Impossible to reach here but..
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Select file or directory to see diff") );
+ return;
+ }
+ m_impl->diffAsync( *(m_urls.begin()), *(m_urls.begin()), -1, "BASE", -1, "WORKING", true );
+}
+void subversionPart::slotDiffHead() {
+// m_impl->diff (m_urls, "HEAD");
+ if( m_urls.count() < 1 ){
+ // Impossible to reach here but..
+ KMessageBox::error( (QWidget*)project()->mainWindow()->main(),
+ i18n("Select file or directory to see diff") );
+ return;
+ }
+ m_impl->diffAsync( *(m_urls.begin()), *(m_urls.begin()), -1, "WORKING", -1, "HEAD", true );
+}
+
+void subversionPart::slotRevert() {
+ m_impl->revert (m_urls);
+}
+
+void subversionPart::slotProjectOpened() {
+ kdDebug(9036) << "subversion :projectOpened" << endl;
+/* if ( g_projectWasJustCreated ) {
+ //saveOptions();
+ g_projectWasJustCreated = false;
+ } */
+ //loadOptions();
+ /// \FIXME slots
+ //connect( project(), SIGNAL(addedFilesToProject(const QStringList&)), this, SLOT(slotAddFilesToProject(const QStringList &)) );
+ //connect( project(), SIGNAL(removedFilesFromProject(const QStringList&)), this, SLOT(slotRemovedFilesFromProject(const QStringList &)) );
+}
+
+void subversionPart::slotProjectClosed() {
+ kdDebug(9036) << "subversion :projectClosed" << endl;
+ //saveOptions();
+ /// \FIXME slots
+ //disconnect( project(), SIGNAL(addedFilesToProject(const QStringList&)), this, SLOT(slotAddFilesToProject(const QStringList &)) );
+ //disconnect( project(), SIGNAL(removedFilesFromProject(const QStringList&)), this, SLOT(slotRemovedFilesFromProject(const QStringList &)) );
+}
+
+void subversionPart::savePartialProjectSession(QDomElement* dom) {
+ kdDebug(9036) << "subversion : savePartialProjectSession" << endl;
+ QDomDocument doc = dom->ownerDocument();
+ QDomElement svn = doc.createElement( "subversion" );
+ svn.setAttribute( "base", base.url() );
+ dom->appendChild( svn );
+}
+
+void subversionPart::restorePartialProjectSession(const QDomElement* dom) {
+ kdDebug(9036) << "subversion : restorePartialProjectSession" << endl;
+ QDomElement svn = dom->namedItem("subversion").toElement();
+ base = svn.attribute( "base", "" );
+}
+
+bool subversionPart::isValidDirectory( const QString &dirPath) const {
+ QString svn = "/.svn/";
+ QDir svndir( dirPath + svn );
+ QString entriesFileName = dirPath + svn + "entries";
+
+ kdDebug(9036) << "dirpath " << dirPath+"/.svn/" << " exists:" << svndir.exists() << endl;
+ kdDebug(9036) << "entries " << entriesFileName << " exists:" << QFile::exists( entriesFileName ) << endl;
+ return svndir.exists() &&
+ QFile::exists( entriesFileName );
+}
+
+#include "subversion_part.moc"
diff --git a/vcs/subversion/subversion_part.h b/vcs/subversion/subversion_part.h
new file mode 100644
index 00000000..911f8f7e
--- /dev/null
+++ b/vcs/subversion/subversion_part.h
@@ -0,0 +1,119 @@
+/* Copyright (C) 2003
+ Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+#ifndef __KDEVPART_SUBVERSION_H__
+#define __KDEVPART_SUBVERSION_H__
+
+
+#include <qguardedptr.h>
+#include <kdevplugin.h>
+#include <kurl.h>
+#include <qpopupmenu.h>
+#include <kdialogbase.h>
+#include "kdevversioncontrol.h"
+
+class subversionCore;
+class subversionOptionsWidget;
+class subversionProjectWidget;
+class Context;
+namespace SvnGlobal
+{
+class SvnInfoHolder;
+};
+
+class subversionPart : public KDevVersionControl
+{
+ Q_OBJECT
+
+public:
+ subversionPart(QObject *parent, const char *name, const QStringList &);
+ virtual ~subversionPart();
+
+ void setupActions();
+ QWidget* newProjectWidget( QWidget* parent );
+ void createNewProject( const QString& dirname );
+ bool fetchFromRepository();
+ KDevVCSFileInfoProvider * fileInfoProvider() const;
+ bool urlFocusedDocument( KURL &url );
+ void restorePartialProjectSession(const QDomElement* );
+ void savePartialProjectSession(QDomElement* );
+ void setBaseURL(const KURL& url ) { base = url; }
+ KURL baseURL() { return base; }
+ virtual bool isValidDirectory( const QString &dirPath ) const;
+ KURL::List urls() { return m_urls; }
+ subversionCore* svncore() { return m_impl; }
+
+signals:
+// void finishedFetching( QString destinationDir );
+
+private slots:
+ void contextMenu( QPopupMenu *popup, const Context *context );
+ void slotActionUpdate();
+ void slotActionRevert();
+ void slotActionCommit();
+ void slotActionAdd();
+ void slotActionDel();
+ void slotActionDiffHead();
+ void slotActionDiffLocal();
+ void slotActionResolve();
+ void slotUpdate();
+ void slotRevert();
+ void slotCommit();
+ void slotAdd();
+ void slotDel();
+ void slotLog();
+ void slotBlame();
+ void slotDiffLocal();
+ void slotDiffHead();
+ void slotResolve();
+ void slotSwitch();
+ void slotCopy();
+ void slotMerge();
+ void slotProjectClosed();
+ void slotProjectOpened();
+
+private:
+ QGuardedPtr<subversionCore> m_impl;
+ KURL::List m_urls;
+
+ KAction *actionCommit,
+ *actionDiffHead,
+ *actionDiffLocal,
+ *actionAdd,
+ *actionLog,
+ *actionBlame,
+ *actionRemove,
+ *actionUpdate,
+ //*actionAddToIgnoreList,
+ //*actionRemoveFromIgnoreList,
+ *actionRevert,
+ *actionResolve,
+ *actionSwitch,
+ *actionCopy,
+ *actionMerge;
+
+ QGuardedPtr<subversionProjectWidget> m_projWidget;
+ KURL base;
+
+public:
+ QMap< KURL, SvnGlobal::SvnInfoHolder > m_prjInfoMap;
+
+};
+
+
+#endif
diff --git a/vcs/subversion/subversion_widget.cpp b/vcs/subversion/subversion_widget.cpp
new file mode 100644
index 00000000..af1ca14f
--- /dev/null
+++ b/vcs/subversion/subversion_widget.cpp
@@ -0,0 +1,136 @@
+/**
+ Copyright (C) 2003-2005 Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#include <kparts/part.h>
+#include <kdevcore.h>
+#include <kdebug.h>
+#include <klineedit.h>
+
+#include "subversion_part.h"
+#include "subversion_widget.h"
+#include <ktextedit.h>
+#include <klocale.h>
+#include <qtoolbutton.h>
+#include <qpushbutton.h>
+
+subversionWidget::subversionWidget( subversionPart *part, QWidget *parent, const char* name )
+ : KTabWidget(parent)
+{
+ m_part = part;
+ m_edit = new KTextEdit( this );
+ m_edit->setReadOnly( TRUE );
+ tab()->addTab( m_edit, i18n("Notification") );
+ m_closeButton = new QPushButton( tab() );
+ m_closeButton->setText( i18n("Close") );
+ tab()->setCornerWidget(m_closeButton);
+ connect( m_closeButton, SIGNAL(clicked()), this, SLOT(closeCurrentTab()) );
+}
+
+subversionWidget::~subversionWidget()
+{}
+
+void subversionWidget::append( QString notifications )
+{
+ if( !m_edit ){
+ // should not happen
+ m_edit = new KTextEdit(this);
+ }
+ m_edit->append( notifications );
+ showPage( m_edit );
+}
+
+void subversionWidget::showLogResult( QValueList<SvnLogHolder> *holderList, QString reqUrl )
+{
+ SvnLogViewWidget *widget = new SvnLogViewWidget( m_part, this );
+ widget->setLogResult( holderList );
+ widget->setRequestedUrl( reqUrl );
+ tab()->addTab( widget, i18n("Log History") );
+ tab()->setTabEnabled( widget, true );
+ tab()->showPage( widget );
+}
+
+void subversionWidget::showBlameResult( QValueList<SvnBlameHolder> *blamelist )
+{
+ SvnBlameWidget *widget = new SvnBlameWidget( this );
+ widget->copyBlameData( blamelist );
+ tab()->addTab( widget, i18n("Blame") );
+ tab()->setTabEnabled( widget, true );
+ tab()->showPage( widget );
+}
+void subversionWidget::closeCurrentTab()
+{
+ QWidget *current = tab()->currentPage();
+ KTextEdit *edit = static_cast<KTextEdit*>(current);
+ if( edit ){
+ if( edit == m_edit ) // main notification output should not be deleted
+ return;
+ }
+ tab()->removePage( current );
+ delete current;
+}
+
+////////////////////////////////////////////////////////////////////////
+
+SvnIntSortListItem::SvnIntSortListItem( QListView* parent )
+ :QListViewItem(parent)
+{}
+SvnIntSortListItem::~SvnIntSortListItem()
+{}
+
+int SvnIntSortListItem::compare( QListViewItem *item, int col, bool ascending ) const
+{
+
+ unsigned int myVal = this->text(col).toUInt();
+ unsigned int yourVal = item->text(col).toUInt();
+ if( myVal < yourVal ) return -1;
+ if( myVal > yourVal ) return 1;
+ return 0;
+}
+
+SvnLogViewItem::SvnLogViewItem( QListView * parent )
+ :SvnIntSortListItem( parent )
+{
+ m_pathList = "";
+ m_message = "";
+}
+SvnLogViewItem ::~SvnLogViewItem ()
+{}
+
+////////////////////////////////////////////////////////////////////////
+
+SvnProgressDlg::SvnProgressDlg( bool showNow )
+ : KIO::DefaultProgress( showNow )
+{
+ setStopOnClose( true );
+ setCaption( i18n("Subversion Job Progress") );
+}
+
+SvnProgressDlg::~SvnProgressDlg()
+{}
+
+void SvnProgressDlg::setSourceUrl( const QString &src )
+{
+ sourceEdit->setText( src );
+}
+void SvnProgressDlg::setDestUrl( const QString &dest )
+{
+ destEdit->setText( dest );
+}
+
+#include "subversion_widget.moc"
diff --git a/vcs/subversion/subversion_widget.h b/vcs/subversion/subversion_widget.h
new file mode 100644
index 00000000..4a21b636
--- /dev/null
+++ b/vcs/subversion/subversion_widget.h
@@ -0,0 +1,95 @@
+/* Copyright (C) 2003
+ Mickael Marchand <marchand@kde.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SUBVERSION_WIDGET_H__
+#define __SUBVERSION_WIDGET_H__
+
+#include <qlistview.h>
+#include "svn_blamewidget.h"
+#include "svn_logviewwidget.h"
+#include <qvaluelist.h>
+
+class subversionPart;
+#include <ktabwidget.h>
+#include <kio/defaultprogress.h>
+#include <qguardedptr.h>
+class KTextEdit;
+class SvnLogHolder;
+class SvnBlameHolder;
+class SvnLogViewWidget;
+class QToolButton;
+class QPushButton;
+
+/** The main Subversion DockWidget. Contains logview-output, blame-output, status and etc */
+// class subversionWidget : public SvnOutputWidgetBase
+class subversionWidget : public KTabWidget
+{
+ Q_OBJECT
+public:
+ subversionWidget(subversionPart *part, QWidget *parent, const char* name);
+ ~subversionWidget();
+
+ // append what?. Append any text status outputs
+ void append( QString notifications );
+ void showLogResult( QValueList<SvnLogHolder> *holderList, QString reqUrl );
+ void showBlameResult( QValueList<SvnBlameHolder> *blamelist );
+
+protected slots:
+ void closeCurrentTab();
+
+private:
+ KTabWidget* tab(){ return this; }
+ subversionPart *m_part;
+
+ QGuardedPtr<KTextEdit> m_edit;
+ QPushButton *m_closeButton;
+
+};
+/**
+ * reimplement compare(), to be able to sort any item by integer
+ */
+class SvnIntSortListItem : public QListViewItem {
+public:
+ SvnIntSortListItem ( QListView* parent=0 );
+ ~SvnIntSortListItem ();
+ /** Returns < 0 if this item is less than i, 0 if they are equal and > 0 if this item is greater than i.
+ */
+ virtual int compare( QListViewItem* i, int col, bool ascending ) const;
+};
+
+class SvnLogViewItem : public SvnIntSortListItem {
+ public:
+ SvnLogViewItem( QListView* parent );
+ ~SvnLogViewItem();
+
+ QString m_pathList;
+ QString m_message;
+};
+
+/////////////////////////////////////////////////////////////
+/// Subversion Progress Display Widget
+class SvnProgressDlg : public KIO::DefaultProgress {
+public:
+ SvnProgressDlg( bool showNow = true );
+ ~SvnProgressDlg();
+ void setSourceUrl( const QString & );
+ void setDestUrl( const QString & );
+};
+
+#endif
diff --git a/vcs/subversion/subversiondiff.ui b/vcs/subversion/subversiondiff.ui
new file mode 100644
index 00000000..dab4ca0e
--- /dev/null
+++ b/vcs/subversion/subversiondiff.ui
@@ -0,0 +1,100 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>Subversion_Diff</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>Subversion_Diff</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>282</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subversion Diff</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTextBrowser">
+ <property name="name">
+ <cstring>text</cstring>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="autoFormatting">
+ <set>AutoAll</set>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</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>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>Subversion_Diff</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/subversion/subversionprojectwidget.ui b/vcs/subversion/subversionprojectwidget.ui
new file mode 100644
index 00000000..3977ce4c
--- /dev/null
+++ b/vcs/subversion/subversionprojectwidget.ui
@@ -0,0 +1,89 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>subversionProjectWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>subversionProjectWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>438</width>
+ <height>149</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New Subversion Project</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Import address:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>importURL</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>importURL</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>init</cstring>
+ </property>
+ <property name="title">
+ <string>Create &amp;Standard Directories (tags/trunk/branches/)?</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>yes</cstring>
+ </property>
+ <property name="text">
+ <string>Yes</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>no</cstring>
+ </property>
+ <property name="text">
+ <string>No</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_blamewidget.cpp b/vcs/subversion/svn_blamewidget.cpp
new file mode 100644
index 00000000..5d186177
--- /dev/null
+++ b/vcs/subversion/svn_blamewidget.cpp
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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.
+ */
+
+#include "svn_blamewidget.h"
+#include "subversion_widget.h"
+#include <qmap.h>
+#include <qlistview.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qstringlist.h>
+#include <qfont.h>
+
+#include <klocale.h>
+#include <kmessagebox.h>
+
+SvnBlameWidget::SvnBlameWidget( QWidget *parent, const char* name, bool modal, WFlags f )
+ :QWidget( parent )
+{
+ m_layout = new QVBoxLayout( this, 1, 1 );
+ m_layout->setMargin(1);
+
+ m_listView = new QListView( this );
+ outView()->setAllColumnsShowFocus( TRUE );
+ outView()->addColumn( i18n("Line") );
+ outView()->addColumn( i18n("Rev") );
+ outView()->addColumn( i18n("Date") );
+ outView()->addColumn( i18n("Author") );
+ outView()->addColumn( i18n("Content") );
+
+ m_layout->addWidget( m_listView );
+}
+SvnBlameWidget::~SvnBlameWidget()
+{}
+
+void SvnBlameWidget::copyBlameData( QValueList<SvnBlameHolder> *blamelist )
+{
+ m_blamelist = *blamelist;
+}
+
+void SvnBlameWidget::show()
+{
+ outView()->clear();
+ outView()->setSortColumn(0);
+
+ QFont f = outView()->font();
+ f.setFixedPitch( true );
+ outView()->setFont( f );
+
+ QValueList<SvnBlameHolder>::Iterator it;
+
+ for( it = m_blamelist.begin(); it != m_blamelist.end(); ++it ){
+
+ SvnBlameHolder holder = *it;
+ SvnIntSortListItem *item = new SvnIntSortListItem(outView());
+
+ QString prettyDate = holder.date.left(16).replace(10, 1, ' ');
+
+ item->setText(0, QString::number( holder.line+1 ) );
+ item->setText(1, QString::number(holder.rev) );
+ item->setText(2, prettyDate );
+ item->setText(3, holder.author );
+ item->setText(4, holder.content );
+
+ }
+ outView()->sort();
+ QWidget::show();
+}
+
+QListView* SvnBlameWidget::outView()
+{
+ return m_listView;
+}
+
+/////////////////////////////////////////////////////////////
+
+SvnBlameFileSelectDlg::SvnBlameFileSelectDlg( QWidget *parent )
+ : QDialog( parent )
+{
+ m_selected = "";
+ setCaption( i18n("Select one file to view annotation") );
+
+ m_layout = new QGridLayout( this, 2, 2 );
+ m_view = new QListView( this );
+ m_view->addColumn( i18n("files") );
+ m_okBtn = new QPushButton( i18n("OK"), this );
+ m_cancelBtn = new QPushButton( i18n("Cancel"), this );
+ m_layout->addMultiCellWidget( m_view, 0, 0, 0, 1 );
+ m_layout->addWidget( m_okBtn, 1, 0 );
+ m_layout->addWidget( m_cancelBtn, 1, 1 );
+
+ connect( m_okBtn, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( m_cancelBtn, SIGNAL(clicked()), this, SLOT(reject()) );
+}
+SvnBlameFileSelectDlg::~SvnBlameFileSelectDlg()
+{}
+
+void SvnBlameFileSelectDlg::setCandidate( QStringList *list )
+{
+ for( QValueList<QString>::iterator it = list->begin(); it != list->end(); ++it ){
+ QListViewItem *item = new QListViewItem( m_view, *it );
+ }
+}
+
+QString SvnBlameFileSelectDlg::selected()
+{
+ return m_selected;
+}
+
+void SvnBlameFileSelectDlg::accept()
+{
+ while( true ){
+ QListViewItem *item = m_view->currentItem();
+ if( item ){
+ m_selected = item->text(0);
+ break;
+ }
+ else{
+ KMessageBox::error( this, i18n("Select file from list to view annotation") );
+ }
+ }
+ QDialog::accept();
+}
+
+#include "svn_blamewidget.moc"
diff --git a/vcs/subversion/svn_blamewidget.h b/vcs/subversion/svn_blamewidget.h
new file mode 100644
index 00000000..26bd0fa2
--- /dev/null
+++ b/vcs/subversion/svn_blamewidget.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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.
+ */
+
+
+#ifndef SVN_BLAMEWIDGET_H
+#define SVN_BLAMEWIDGET_H
+
+#include <qwidget.h>
+#include <qdialog.h>
+#include <qvaluelist.h>
+class QVBoxLayout;
+class QListView;
+class QGridLayout;
+class QPushButton;
+class QStringList;
+
+class SvnBlameHolder {
+public:
+// SvnBlameHolder(){};
+// ~SvnBlameHolder(){};
+ unsigned int line;
+ long int rev;
+ QString date;
+ QString author;
+ QString content;
+};
+
+class QListView;
+
+class SvnBlameWidget : public QWidget {
+ Q_OBJECT
+public:
+ SvnBlameWidget( QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags f = 0 );
+ virtual ~SvnBlameWidget();
+ void copyBlameData( QValueList<SvnBlameHolder> *blamelist );
+ void show();
+ QListView* outView();
+protected:
+ QValueList <SvnBlameHolder> m_blamelist;
+
+ QVBoxLayout *m_layout;
+ QListView *m_listView;
+};
+
+class SvnBlameFileSelectDlg : public QDialog {
+ Q_OBJECT
+public:
+ SvnBlameFileSelectDlg( QWidget *parent = 0L );
+ virtual ~SvnBlameFileSelectDlg();
+ void setCandidate( QStringList *modifies );
+ QString selected();
+
+protected:
+ virtual void accept();
+
+private:
+ QGridLayout *m_layout;
+ QListView *m_view;
+ QPushButton *m_okBtn;
+ QPushButton *m_cancelBtn;
+
+ QStringList *m_candidates;
+ QString m_selected;
+};
+
+#endif
diff --git a/vcs/subversion/svn_co.ui b/vcs/subversion/svn_co.ui
new file mode 100644
index 00000000..4ea22290
--- /dev/null
+++ b/vcs/subversion/svn_co.ui
@@ -0,0 +1,335 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>svn_co</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>svn_co</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>509</width>
+ <height>360</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Subversion Module Checkout</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>server</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Server Settings</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Checkout &amp;from:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>serverURL</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>serverURL</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Revision:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>revision</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>revision</cstring>
+ </property>
+ <property name="text">
+ <string>HEAD</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>WinPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>This Project has Standard &amp;Trunk/Branches/Tags/Directories</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>isStandard</cstring>
+ </property>
+ <property name="text">
+ <string>Yes</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton1_2</cstring>
+ </property>
+ <property name="text">
+ <string>No</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>local</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Local Directory</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;heckout in:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>localDir</cstring>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>localDir</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name of the newly created directory:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>newDir</cstring>
+ </property>
+ </widget>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>newDir</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <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>191</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>ok</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>cancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>ok</sender>
+ <signal>clicked()</signal>
+ <receiver>svn_co</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancel</sender>
+ <signal>clicked()</signal>
+ <receiver>svn_co</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_commitdlgbase.ui b/vcs/subversion/svn_commitdlgbase.ui
new file mode 100644
index 00000000..9151d566
--- /dev/null
+++ b/vcs/subversion/svn_commitdlgbase.ui
@@ -0,0 +1,131 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnCommitDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnCommitDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>514</width>
+ <height>305</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListView" row="0" column="0" rowspan="1" colspan="3">
+ <column>
+ <property name="text">
+ <string>Column 1</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <item>
+ <property name="text">
+ <string>New Item</string>
+ </property>
+ <property name="pixmap">
+ <pixmap></pixmap>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>listView1</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer row="2" column="0" rowspan="1" colspan="2">
+ <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>335</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>keepLocksChk</cstring>
+ </property>
+ <property name="text">
+ <string>Keep Locks</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="2">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton3</cstring>
+ </property>
+ <property name="text">
+ <string>O&amp;K</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton3_2</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;ancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>recursiveChk</cstring>
+ </property>
+ <property name="text">
+ <string>Recursive</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>pushButton3</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnCommitDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton3_2</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnCommitDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/vcs/subversion/svn_copydlgwidget.ui b/vcs/subversion/svn_copydlgwidget.ui
new file mode 100644
index 00000000..00a4d5c7
--- /dev/null
+++ b/vcs/subversion/svn_copydlgwidget.ui
@@ -0,0 +1,238 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnCopyDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnCopyDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>439</width>
+ <height>433</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subversion Copy</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>reqEdit</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="5" column="1">
+ <property name="name">
+ <cstring>okBtn</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ <spacer row="5" column="0">
+ <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>110</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="5" column="2">
+ <property name="name">
+ <cstring>cancelBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup3</cstring>
+ </property>
+ <property name="title">
+ <string>Destination</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>destRequester</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Specify either the full repository URL or local working path</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Requested Local Path</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Source Revision</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntNumInput" row="0" column="1">
+ <property name="name">
+ <cstring>revnumInput</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>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>revnumRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Specify by number:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>revkindRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Specify by keyword:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>HEAD</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BASE</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>WORKING</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>revkindCombo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Source</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit" row="2" column="0">
+ <property name="name">
+ <cstring>srcEdit</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>urlRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Specify by the repository URL of this item</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>pathRadio</cstring>
+ </property>
+ <property name="text">
+ <string>Specify by local path of this item</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnCopyDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnCopyDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_copywidget.cpp b/vcs/subversion/svn_copywidget.cpp
new file mode 100644
index 00000000..a5d74bcb
--- /dev/null
+++ b/vcs/subversion/svn_copywidget.cpp
@@ -0,0 +1,75 @@
+#include "svn_copywidget.h"
+#include <klineedit.h>
+#include <kurl.h>
+#include "subversion_global.h"
+#include <kurlrequester.h>
+#include <knuminput.h>
+#include <kcombobox.h>
+#include <qradiobutton.h>
+
+SvnCopyDialog::SvnCopyDialog( const QString &reqPath, SvnGlobal::SvnInfoHolder *holder, QWidget *parent )
+ : SvnCopyDialogBase( parent )
+ , m_holder(holder)
+{
+ reqEdit->setText( reqPath );
+
+ connect( urlRadio, SIGNAL(clicked()), this, SLOT(setSourceAsUrl()) );
+ connect( pathRadio, SIGNAL(clicked()), this, SLOT(setSourceAsLocalPath()) );
+ connect( revnumRadio, SIGNAL(toggled(bool)), revnumInput, SLOT(setEnabled(bool)) );
+ connect( revnumRadio, SIGNAL(toggled(bool)), revkindCombo, SLOT(setDisabled(bool)) );
+
+ // In many cases, users copy from reository to repository. This is for making tag/branche.
+ // The case where copying from local path to repository may be lesser than the above one.
+ // Thus, by default retrieve the repository URL of the given local path
+ urlRadio->setChecked( true );
+ srcEdit->setText( m_holder->url.prettyURL() );
+ // Also, revision is set to HEAD by default
+ revkindRadio->setChecked( true );
+ revkindCombo->insertItem( "HEAD" );
+}
+
+SvnCopyDialog::~SvnCopyDialog()
+{
+}
+
+KURL SvnCopyDialog::sourceUrl()
+{
+ return KURL( srcEdit->text() );
+}
+
+int SvnCopyDialog::revision()
+{
+ if( revnumRadio->isChecked() )
+ return revnumInput->value();
+ else
+ return -1;
+}
+
+QString SvnCopyDialog::revKind()
+{
+ if( revkindRadio->isChecked() )
+ return revkindCombo->currentText();
+ else
+ return QString("");
+}
+
+KURL SvnCopyDialog::destUrl()
+{
+ return KURL( destRequester->url() );
+}
+
+void SvnCopyDialog::setSourceAsUrl()
+{
+ srcEdit->setText( m_holder->url.prettyURL() );
+ revkindCombo->clear();
+ revkindCombo->insertItem( "HEAD" );
+}
+
+void SvnCopyDialog::setSourceAsLocalPath()
+{
+ srcEdit->setText( reqEdit->text() );
+ revkindCombo->clear();
+ revkindCombo->insertItem( "WORKING" );
+}
+
+#include "svn_copywidget.moc"
diff --git a/vcs/subversion/svn_copywidget.h b/vcs/subversion/svn_copywidget.h
new file mode 100644
index 00000000..cc00636d
--- /dev/null
+++ b/vcs/subversion/svn_copywidget.h
@@ -0,0 +1,32 @@
+#ifndef SVN_COPYWIDGET_H
+#define SVN_COPYWIDGET_H
+
+#include "svn_copydlgwidget.h"
+
+namespace SvnGlobal
+{
+ class SvnInfoHolder;
+}
+class KURL;
+
+class SvnCopyDialog : public SvnCopyDialogBase
+{
+ Q_OBJECT
+public:
+ SvnCopyDialog( const QString &reqPath, SvnGlobal::SvnInfoHolder *holder, QWidget *parent );
+ ~SvnCopyDialog();
+
+ KURL sourceUrl();
+ int revision();
+ QString revKind();
+ KURL destUrl();
+
+public slots:
+ void setSourceAsUrl();
+ void setSourceAsLocalPath();
+
+private:
+ SvnGlobal::SvnInfoHolder *m_holder;
+};
+
+#endif
diff --git a/vcs/subversion/svn_fileselectdlg_commit.cpp b/vcs/subversion/svn_fileselectdlg_commit.cpp
new file mode 100644
index 00000000..4f4cdceb
--- /dev/null
+++ b/vcs/subversion/svn_fileselectdlg_commit.cpp
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#include "svn_fileselectdlg_commit.h"
+#include "subversion_fileinfo.h"
+#include "subversion_part.h"
+#include <kurl.h>
+#include <qstring.h>
+#include <qlistview.h>
+#include <qfileinfo.h>
+#include <qcheckbox.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include "kdevmainwindow.h"
+#include <klocale.h>
+
+#include <kdevproject.h>
+
+SVNFileSelectDlgCommit::SVNFileSelectDlgCommit( KURL::List &urls, subversionPart *part, QWidget* parent)
+ :SvnCommitDlgBase( parent, "svnfileselectcommitdlg", true )
+ ,m_part(part)
+{
+ this->setCaption(i18n("Select Files to Commit"));
+ listView()->clear();
+ listView()->setColumnText(0, i18n("select") ); //col 0
+ listView()->addColumn( i18n("status") ); //col 1
+ listView()->addColumn( i18n("URL to commit") ); //col 2
+ listView()->setColumnWidthMode( 2, QListView::Maximum );
+ listView()->setSorting( 2, true );
+ recursiveChk->setChecked(false);
+ keepLocksChk->setChecked(false);
+
+
+ const VCSFileInfoMap *vcsMap;
+ VCSFileInfo vcsInfo;
+ KURL::List tobeCommittedUrls;
+
+ for( QValueListConstIterator<KURL> it = urls.begin(); it != urls.end(); ++it ){
+ KURL oneUrl(*it);
+ QFileInfo fileInfo(oneUrl.path());
+ //fileInfo.convertToAbs();
+
+ if (fileInfo.isFile()){
+ KURL base_url( part->project()->projectDirectory()+"/" );
+ QString dirPath = KURL::relativeURL( base_url, fileInfo.dirPath(TRUE) );
+ vcsMap = ((SVNFileInfoProvider*)part->fileInfoProvider()) ->
+ statusExt(dirPath, false/*repository access*/, true/*recurse*/, false/*getall*/, true/*noIgnore*/);
+ vcsInfo = (*vcsMap)[fileInfo.fileName()];
+ if( vcsInfo.state == VCSFileInfo::Added || vcsInfo.state == VCSFileInfo::Modified ||
+ vcsInfo.state == VCSFileInfo::Deleted || vcsInfo.state == VCSFileInfo::Replaced ){
+
+ this->insertItem( VCSFileInfo::state2String( vcsInfo.state ), oneUrl );
+// tobeCommittedUrls.push_back(oneUrl);
+// kdDebug(9036) << "slotCommit() : added AS FILE: " << oneUrl.prettyURL() << endl;
+
+ }
+ else{
+ kdDebug(9036) << "slotCommit() @ FileCase ignoring " << oneUrl.prettyURL() << endl;
+ }
+ }
+ else if (fileInfo.isDir()){
+ KURL base_url( part->project()->projectDirectory()+"/" );
+ QString dirPath = KURL::relativeURL( base_url, fileInfo.absFilePath() );
+ vcsMap = ((SVNFileInfoProvider*)part->fileInfoProvider()) ->
+ statusExt(dirPath, false/*repository access*/, true/*recurse*/, false/*getall*/, true/*noIgnore*/);
+ for (VCSFileInfoMap::ConstIterator it=vcsMap->begin(); it!=vcsMap->end(); ++it){
+
+ vcsInfo = it.data();
+// QString absPathStr( fileInfo.absFilePath() + "/" + it.key() );
+ QString absPathStr( fileInfo.filePath() + "/" + it.key() );
+ KURL urlFromStatus( absPathStr );
+ if( vcsInfo.state == VCSFileInfo::Added || vcsInfo.state == VCSFileInfo::Modified ||
+ vcsInfo.state == VCSFileInfo::Deleted || vcsInfo.state == VCSFileInfo::Replaced){
+
+ this->insertItem( VCSFileInfo::state2String( vcsInfo.state ), urlFromStatus );
+
+// tobeCommittedUrls.push_back( urlFromStatus );
+// kdDebug(9036) << "slotCommit() @ DirCase adding " << urlFromStatus.prettyURL() << endl;
+ }
+ else{
+ kdDebug(9036) << "slotCommit() @ DirCase ignoring " << urlFromStatus.prettyURL() << endl;
+ }
+
+ }
+ }
+ else if ( !fileInfo.exists() ){
+ // maybe deleted files
+ this->insertItem( VCSFileInfo::state2String( VCSFileInfo::Deleted ), oneUrl );
+ }
+ }
+
+}
+SVNFileSelectDlgCommit::~SVNFileSelectDlgCommit()
+{
+}
+
+int SVNFileSelectDlgCommit::exec()
+{
+ if (listView()->childCount() <= 0){
+ //TODO if klauncher fails, this spot is also reached. We should show correct error message to user
+ KMessageBox::information( (QWidget*)m_part->project()->mainWindow()->main(), i18n("No added/modified/deleted file(s) to commit") );
+ return QDialog::Rejected;
+ }
+ else{
+ return SvnCommitDlgBase::exec();
+ }
+}
+void SVNFileSelectDlgCommit::insertItem( QString status, KURL url )
+{
+ QCheckListItem *item = new QCheckListItem( listView(), "", QCheckListItem::CheckBox );
+ item->setText( 1, status );
+ item->setText( 2, url.path() );
+ item->setOn(true);
+}
+KURL::List SVNFileSelectDlgCommit::checkedUrls()
+{
+ QPtrList<QListViewItem> lst;
+ QListViewItemIterator it( listView() );
+ KURL::List tobeCommittedUrls;
+
+ for ( ; it.current() ; ++it ) {
+ if ( ((QCheckListItem*)(it.current()))->isOn() ){
+ KURL tmpurl( it.current()->text(2) );
+ tobeCommittedUrls.push_back( tmpurl );
+ }
+ }
+ return tobeCommittedUrls;
+
+}
+QListView* SVNFileSelectDlgCommit::listView()
+{
+ return listView1;
+}
+
+bool SVNFileSelectDlgCommit::recursive()
+{
+ return recursiveChk->isChecked();
+}
+bool SVNFileSelectDlgCommit::keepLocks()
+{
+ return keepLocksChk->isChecked();
+}
+
+#include "svn_fileselectdlg_commit.moc"
+
diff --git a/vcs/subversion/svn_fileselectdlg_commit.h b/vcs/subversion/svn_fileselectdlg_commit.h
new file mode 100644
index 00000000..acd95ebb
--- /dev/null
+++ b/vcs/subversion/svn_fileselectdlg_commit.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef _svnfileselectdlgcommit_
+#define _svnfileselectdlgcommit_
+
+#include "svn_commitdlgbase.h"
+#include <qdialog.h>
+#include <kurl.h>
+
+class QString;
+class KURL;
+class QListView;
+class subversionPart;
+
+class SVNFileSelectDlgCommit : public SvnCommitDlgBase{
+
+Q_OBJECT
+
+public:
+ SVNFileSelectDlgCommit( KURL::List&, subversionPart* part, QWidget* parent = 0 );
+ ~SVNFileSelectDlgCommit();
+ void insertItem( QString status, KURL url );
+ KURL::List checkedUrls();
+ bool recursive();
+ bool keepLocks();
+
+public slots:
+ int exec();
+protected:
+ QListView* listView();
+ subversionPart *m_part;
+};
+
+#endif
diff --git a/vcs/subversion/svn_kio.cpp b/vcs/subversion/svn_kio.cpp
new file mode 100644
index 00000000..c5c8dfe6
--- /dev/null
+++ b/vcs/subversion/svn_kio.cpp
@@ -0,0 +1,2155 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Mickael Marchand <marchand@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include <qcstring.h>
+#include <qsocket.h>
+#include <qdatetime.h>
+#include <qbitarray.h>
+
+#include <stdlib.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+
+#include <kapplication.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <kinstance.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <ksock.h>
+#include <dcopclient.h>
+#include <qcstring.h>
+
+#include <subversion-1/svn_sorts.h>
+#include <subversion-1/svn_path.h>
+#include <subversion-1/svn_utf.h>
+#include <subversion-1/svn_ra.h>
+#include <subversion-1/svn_time.h>
+#include <subversion-1/svn_cmdline.h>
+
+#include <kmimetype.h>
+#include <qfile.h>
+
+#include "svn_kio.h"
+#include <apr_portable.h>
+// #include "commitdlg.h"
+#include <ktextedit.h>
+
+using namespace KIO;
+using namespace SvnGlobal;
+
+typedef struct
+{
+ /* Holds the directory that corresponds to the REPOS_URL at RA->open()
+ * time. When callbacks specify a relative path, they are joined with
+ * this base directory. */
+ const char *base_dir;
+ svn_wc_adm_access_t *base_access;
+
+ /* An array of svn_client_commit_item_t * structures, present only
+ * during working copy commits. */
+ apr_array_header_t *commit_items;
+
+ /* A hash of svn_config_t's, keyed off file name (i.e. the contents of
+ * ~/.subversion/config end up keyed off of 'config'). */
+ apr_hash_t *config;
+
+ /* The pool to use for session-related items. */
+ apr_pool_t *pool;
+
+} svn_client__callback_baton_t;
+
+static svn_error_t *
+open_tmp_file (apr_file_t **fp,
+ void *callback_baton,
+ apr_pool_t *pool)
+{
+ svn_client__callback_baton_t *cb = (svn_client__callback_baton_t *) callback_baton;
+ const char *truepath;
+ const char *ignored_filename;
+
+ if (cb->base_dir)
+ truepath = apr_pstrdup (pool, cb->base_dir);
+ else
+ truepath = "";
+
+ /* Tack on a made-up filename. */
+ truepath = svn_path_join (truepath, "tempfile", pool);
+
+ /* Open a unique file; use APR_DELONCLOSE. */
+ SVN_ERR (svn_io_open_unique_file (fp, &ignored_filename,
+ truepath, ".tmp", TRUE, pool));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *write_to_string(void *baton, const char *data, apr_size_t *len) {
+ kbaton *tb = ( kbaton* )baton;
+ svn_stringbuf_appendbytes(tb->target_string, data, *len);
+ return SVN_NO_ERROR;
+}
+
+static int
+compare_items_as_paths (const svn_sort__item_t*a, const svn_sort__item_t*b) {
+ return svn_path_compare_paths ((const char *)a->key, (const char *)b->key);
+}
+
+kio_svnProtocol::kio_svnProtocol(const QCString &pool_socket, const QCString &app_socket)
+ : SlaveBase("kio_svn", pool_socket, app_socket) {
+ kdDebug(9036) << "kio_svnProtocol::kio_svnProtocol()" << endl;
+
+ m_counter = 0;
+
+ apr_initialize();
+ // Make sure to properly initialize svn client, besides other things, this sets up
+ // NLS support for environments that don't use UTF-8
+ svn_cmdline_init("kdevsvnd",NULL);
+ // CleanUP ctx preventing crash in svn_client_update and other
+ memset(&ctx, 0, sizeof(ctx));
+ pool = svn_pool_create (NULL);
+
+ svn_error_t *err = svn_client_create_context(&ctx, pool);
+ if ( err ) {
+ kdDebug(9036) << "kio_svnProtocol::kio_svnProtocol() create_context ERROR" << endl;
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+ return;
+ }
+
+ err = svn_config_ensure (NULL,pool);
+ if ( err ) {
+ kdDebug(9036) << "kio_svnProtocol::kio_svnProtocol() configensure ERROR" << endl;
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+ return;
+ }
+ svn_config_get_config (&ctx->config, NULL, pool);
+
+ ctx->log_msg_func = kio_svnProtocol::commitLogPrompt;
+ ctx->log_msg_baton = this; //pass this so that we can get a dcopClient from it
+ //TODO
+ ctx->cancel_func = NULL;
+ // progress notifications
+ ctx->progress_func = kio_svnProtocol::progressCallback;
+ ctx->progress_baton = this;
+
+ apr_array_header_t *providers = apr_array_make(pool, 15, sizeof(svn_auth_provider_object_t *));
+
+ svn_auth_provider_object_t *provider;
+
+ //disk cache
+ svn_client_get_simple_provider(&provider,pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t*) = provider;
+ svn_client_get_username_provider(&provider,pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t*) = provider;
+
+ //interactive prompt
+ svn_client_get_simple_prompt_provider (&provider,kio_svnProtocol::checkAuth,this,2,pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t*) = provider;
+ //we always ask user+pass, no need for a user only question
+/* svn_client_get_username_prompt_provider
+ * (&provider,kio_svnProtocol::checkAuth,this,2,pool);
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t*) = provider;*/
+
+ //SSL disk cache, keep that one, because it does nothing bad :)
+ svn_client_get_ssl_server_trust_file_provider (&provider, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+ svn_client_get_ssl_client_cert_file_provider (&provider, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+ svn_client_get_ssl_client_cert_pw_file_provider (&provider, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+
+ //SSL interactive prompt, where things get hard
+ svn_client_get_ssl_server_trust_prompt_provider (&provider, kio_svnProtocol::trustSSLPrompt, (void*)this, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+ svn_client_get_ssl_client_cert_prompt_provider (&provider, kio_svnProtocol::clientCertSSLPrompt, (void*)this, 2, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+ svn_client_get_ssl_client_cert_pw_prompt_provider (&provider, kio_svnProtocol::clientCertPasswdPrompt, (void*)this, 2, pool);
+ APR_ARRAY_PUSH (providers, svn_auth_provider_object_t *) = provider;
+
+ svn_auth_open(&ctx->auth_baton, providers, pool);
+}
+
+kio_svnProtocol::~kio_svnProtocol(){
+ kdDebug(9036) << "kio_svnProtocol::~kio_svnProtocol()" << endl;
+ svn_pool_destroy(pool);
+ apr_terminate();
+}
+
+void kio_svnProtocol::initNotifier(bool is_checkout, bool is_export, bool suppress_final_line, apr_pool_t *spool) {
+ m_counter=0;//reset counter
+ ctx->notify_func = kio_svnProtocol::notify;
+ struct notify_baton *nb = ( struct notify_baton* )apr_palloc(spool, sizeof( struct notify_baton ) );
+ nb->master = this;
+ nb->received_some_change = FALSE;
+ nb->sent_first_txdelta = FALSE;
+ nb->is_checkout = is_checkout;
+ nb->is_export = is_export;
+ nb->suppress_final_line = suppress_final_line;
+ nb->in_external = FALSE;
+ nb->had_print_error = FALSE;
+ nb->pool = svn_pool_create (spool);
+
+ ctx->notify_baton = nb;
+}
+
+svn_error_t* kio_svnProtocol::checkAuth(svn_auth_cred_simple_t **cred, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool) {
+ kdDebug(9036) << "kio_svnProtocol::checkAuth() " << endl;
+ kio_svnProtocol *p = ( kio_svnProtocol* )baton;
+ svn_auth_cred_simple_t *ret = (svn_auth_cred_simple_t*)apr_pcalloc (pool, sizeof (*ret));
+
+ p->info.keepPassword = true;
+ p->info.verifyPath=true;
+ kdDebug(9036 ) << "auth current URL : " << p->myURL.url() << endl;
+ p->info.url = p->myURL;
+ p->info.username = username; //( const char* )svn_auth_get_parameter( p->ctx->auth_baton, SVN_AUTH_PARAM_DEFAULT_USERNAME );
+ if (realm) {
+ p->info.prompt = i18n("Username and Password for %1.").arg(realm);
+ }
+
+// if ( !p->checkCachedAuthentication( p->info ) ){
+ p->openPassDlg( p->info );
+// }
+ ret->username = apr_pstrdup(pool, p->info.username.utf8());
+ ret->password = apr_pstrdup(pool, p->info.password.utf8());
+ if (may_save) ret->may_save = p->info.keepPassword;
+ *cred = ret;
+ return SVN_NO_ERROR;
+}
+
+void kio_svnProtocol::recordCurrentURL(const KURL& url) {
+ myURL = url;
+}
+
+//don't implement mimeType() until we don't need to download the whole file
+
+void kio_svnProtocol::get(const KURL& url ){
+ kdDebug(9036) << "kio_svn::get(const KURL& url)" << endl ;
+
+ QString remoteServer = url.host();
+ infoMessage(i18n("Looking for %1...").arg( remoteServer ) );
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ kbaton *bt = (kbaton*)apr_pcalloc(subpool, sizeof(*bt));
+ bt->target_string = svn_stringbuf_create("", subpool);
+ bt->string_stream = svn_stream_create(bt,subpool);
+ svn_stream_set_write(bt->string_stream,write_to_string);
+
+ QString target = makeSvnURL( url );
+ kdDebug(9036) << "SvnURL: " << target << endl;
+ recordCurrentURL( KURL( target ) );
+
+ //find the requested revision
+ svn_opt_revision_t rev;
+ svn_opt_revision_t endrev;
+ int idx = target.findRev( "?rev=" );
+ if ( idx != -1 ) {
+ QString revstr = target.mid( idx+5 );
+#if 0
+ kdDebug(9036) << "revision string found " << revstr << endl;
+ if ( revstr == "HEAD" ) {
+ rev.kind = svn_opt_revision_head;
+ kdDebug(9036) << "revision searched : HEAD" << endl;
+ } else {
+ rev.kind = svn_opt_revision_number;
+ rev.value.number = revstr.toLong();
+ kdDebug(9036) << "revision searched : " << rev.value.number << endl;
+ }
+#endif
+ svn_opt_parse_revision( &rev, &endrev, revstr.utf8(), subpool );
+ target = target.left( idx );
+ kdDebug(9036) << "new target : " << target << endl;
+ } else {
+ kdDebug(9036) << "no revision given. searching HEAD " << endl;
+ rev.kind = svn_opt_revision_head;
+ }
+ initNotifier(false, false, false, subpool);
+
+ svn_error_t *err = svn_client_cat (bt->string_stream, svn_path_canonicalize( target.utf8(),subpool ),&rev,ctx, subpool);
+ if ( err ) {
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+ svn_pool_destroy( subpool );
+ return;
+ }
+
+ // Send the mimeType as soon as it is known
+ QByteArray *cp = new QByteArray();
+ cp->setRawData( bt->target_string->data, bt->target_string->len );
+ KMimeType::Ptr mt = KMimeType::findByContent(*cp);
+ kdDebug(9036) << "KMimeType returned : " << mt->name() << endl;
+ mimeType( mt->name() );
+
+ totalSize(bt->target_string->len);
+
+ //send data
+ data(*cp);
+
+ data(QByteArray()); // empty array means we're done sending the data
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::stat(const KURL & url){
+ kdDebug(9036) << "kio_svn::stat(const KURL& url) : " << url.url() << endl ;
+
+ void *ra_baton, *session;
+ svn_ra_plugin_t *ra_lib;
+ svn_node_kind_t kind;
+ apr_pool_t *subpool = svn_pool_create (pool);
+
+ QString target = makeSvnURL( url);
+ kdDebug(9036) << "SvnURL: " << target << endl;
+ recordCurrentURL( KURL( target ) );
+
+ //find the requested revision
+ svn_opt_revision_t rev;
+ svn_opt_revision_t endrev;
+ int idx = target.findRev( "?rev=" );
+ if ( idx != -1 ) {
+ QString revstr = target.mid( idx+5 );
+#if 0
+ kdDebug(9036) << "revision string found " << revstr << endl;
+ if ( revstr == "HEAD" ) {
+ rev.kind = svn_opt_revision_head;
+ kdDebug(9036) << "revision searched : HEAD" << endl;
+ } else {
+ rev.kind = svn_opt_revision_number;
+ rev.value.number = revstr.toLong();
+ kdDebug(9036) << "revision searched : " << rev.value.number << endl;
+ }
+#endif
+ svn_opt_parse_revision( &rev, &endrev, revstr.utf8( ), subpool );
+ target = target.left( idx );
+ kdDebug(9036) << "new target : " << target << endl;
+ } else {
+ kdDebug(9036) << "no revision given. searching HEAD " << endl;
+ rev.kind = svn_opt_revision_head;
+ }
+
+ //init
+ svn_error_t *err = svn_ra_init_ra_libs(&ra_baton,subpool);
+ if ( err ) {
+ kdDebug(9036) << "init RA libs failed : " << err->message << endl;
+ return;
+ }
+ //find RA libs
+ err = svn_ra_get_ra_library(&ra_lib,ra_baton,svn_path_canonicalize( target.utf8(), subpool ),subpool);
+ if ( err ) {
+ kdDebug(9036) << "RA get libs failed : " << err->message << endl;
+ return;
+ }
+ kdDebug(9036) << "RA init completed" << endl;
+
+ //start session
+ svn_ra_callbacks_t *cbtable = (svn_ra_callbacks_t*)apr_pcalloc(subpool, sizeof(*cbtable));
+ kio_svn_callback_baton_t *callbackbt = (kio_svn_callback_baton_t*)apr_pcalloc(subpool, sizeof( *callbackbt ));
+
+ cbtable->open_tmp_file = open_tmp_file;
+ cbtable->get_wc_prop = NULL;
+ cbtable->set_wc_prop = NULL;
+ cbtable->push_wc_prop = NULL;
+ cbtable->auth_baton = ctx->auth_baton;
+
+ callbackbt->base_dir = target.utf8();
+ callbackbt->pool = subpool;
+ callbackbt->config = ctx->config;
+
+ err = ra_lib->open(&session,svn_path_canonicalize( target.utf8(), subpool ),cbtable,callbackbt,ctx->config,subpool);
+ if ( err ) {
+ kdDebug(9036)<< "Open session " << err->message << endl;
+ return;
+ }
+ kdDebug(9036) << "Session opened to " << target << endl;
+ //find number for HEAD
+ if (rev.kind == svn_opt_revision_head) {
+ err = ra_lib->get_latest_revnum(session,&rev.value.number,subpool);
+ if ( err ) {
+ kdDebug(9036)<< "Latest RevNum " << err->message << endl;
+ return;
+ }
+ kdDebug(9036) << "Got rev " << rev.value.number << endl;
+ }
+
+ //get it
+ ra_lib->check_path(session,"",rev.value.number,&kind,subpool);
+ kdDebug(9036) << "Checked Path" << endl;
+ UDSEntry entry;
+ switch ( kind ) {
+ case svn_node_file:
+ kdDebug(9036) << "::stat result : file" << endl;
+ createUDSEntry(url.filename(),"",0,false,0,entry);
+ statEntry( entry );
+ break;
+ case svn_node_dir:
+ kdDebug(9036) << "::stat result : directory" << endl;
+ createUDSEntry(url.filename(),"",0,true,0,entry);
+ statEntry( entry );
+ break;
+ case svn_node_unknown:
+ case svn_node_none:
+ //error XXX
+ default:
+ kdDebug(9036) << "::stat result : UNKNOWN ==> WOW :)" << endl;
+ ;
+ }
+ finished();
+ svn_pool_destroy( subpool );
+}
+
+void kio_svnProtocol::listDir(const KURL& url){
+ kdDebug(9036) << "kio_svn::listDir(const KURL& url) : " << url.url() << endl ;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ apr_hash_t *dirents;
+
+ QString target = makeSvnURL( url);
+ kdDebug(9036) << "SvnURL: " << target << endl;
+ recordCurrentURL( KURL( target ) );
+
+ //find the requested revision
+ svn_opt_revision_t rev;
+ svn_opt_revision_t endrev;
+ int idx = target.findRev( "?rev=" );
+ if ( idx != -1 ) {
+ QString revstr = target.mid( idx+5 );
+ svn_opt_parse_revision( &rev, &endrev, revstr.utf8(), subpool );
+#if 0
+ kdDebug(9036) << "revision string found " << revstr << endl;
+ if ( revstr == "HEAD" ) {
+ rev.kind = svn_opt_revision_head;
+ kdDebug(9036) << "revision searched : HEAD" << endl;
+ } else {
+ rev.kind = svn_opt_revision_number;
+ rev.value.number = revstr.toLong();
+ kdDebug(9036) << "revision searched : " << rev.value.number << endl;
+ }
+#endif
+ target = target.left( idx );
+ kdDebug(9036) << "new target : " << target << endl;
+ } else {
+ kdDebug(9036) << "no revision given. searching HEAD " << endl;
+ rev.kind = svn_opt_revision_head;
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_ls (&dirents, svn_path_canonicalize( target.utf8(), subpool ), &rev, false, ctx, subpool);
+ if ( err ) {
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+ svn_pool_destroy( subpool );
+ return;
+ }
+
+ apr_array_header_t *array;
+ int i;
+
+ array = svn_sort__hash (dirents, compare_items_as_paths, subpool);
+
+ UDSEntry entry;
+ for (i = 0; i < array->nelts; ++i) {
+ entry.clear();
+ const char *utf8_entryname, *native_entryname;
+ svn_dirent_t *dirent;
+ svn_sort__item_t *item;
+
+ item = &APR_ARRAY_IDX (array, i, svn_sort__item_t);
+
+ utf8_entryname = (const char*)item->key;
+
+ dirent = (svn_dirent_t*)apr_hash_get (dirents, utf8_entryname, item->klen);
+
+ svn_utf_cstring_from_utf8 (&native_entryname, utf8_entryname, subpool);
+ const char *native_author = NULL;
+
+ //XXX BUGGY
+/* apr_time_exp_t timexp;
+ apr_time_exp_lt(&timexp, dirent->time);
+ apr_os_exp_time_t *ostime;
+ apr_os_exp_time_get( &ostime, &timexp);
+
+ time_t mtime = mktime( ostime );*/
+
+ if (dirent->last_author)
+ svn_utf_cstring_from_utf8 (&native_author, dirent->last_author, subpool);
+
+ if ( createUDSEntry(QString( native_entryname ), QString( native_author ), dirent->size,
+ dirent->kind==svn_node_dir ? true : false, 0, entry) )
+ listEntry( entry, false );
+ }
+ listEntry( entry, true );
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+bool kio_svnProtocol::createUDSEntry( const QString& filename, const QString& user, long long int size, bool isdir, time_t mtime, UDSEntry& entry) {
+ kdDebug(9036) << "MTime : " << ( long )mtime << endl;
+ kdDebug(9036) << "UDS filename : " << filename << endl;
+ UDSAtom atom;
+ atom.m_uds = KIO::UDS_NAME;
+ atom.m_str = filename;
+ entry.append( atom );
+
+ atom.m_uds = KIO::UDS_FILE_TYPE;
+ atom.m_long = isdir ? S_IFDIR : S_IFREG;
+ entry.append( atom );
+
+ atom.m_uds = KIO::UDS_SIZE;
+ atom.m_long = size;
+ entry.append( atom );
+
+ atom.m_uds = KIO::UDS_MODIFICATION_TIME;
+ atom.m_long = mtime;
+ entry.append( atom );
+
+ atom.m_uds = KIO::UDS_USER;
+ atom.m_str = user;
+ entry.append( atom );
+
+ return true;
+}
+
+// not used, at least for KDevelop
+// void kio_svnProtocol::copy(const KURL & src, const KURL& dest, int /*permissions*/, bool /*overwrite*/) {
+// kdDebug(9036) << "kio_svnProtocol::copy() Source : " << src.url() << " Dest : " << dest.url() << endl;
+//
+// apr_pool_t *subpool = svn_pool_create (pool);
+// svn_client_commit_info_t *commit_info = NULL;
+//
+// KURL nsrc = src;
+// KURL ndest = dest;
+// nsrc.setProtocol( chooseProtocol( src.protocol() ) );
+// ndest.setProtocol( chooseProtocol( dest.protocol() ) );
+// QString srcsvn = nsrc.url();
+// QString destsvn = ndest.url();
+//
+// recordCurrentURL( nsrc );
+//
+// //find the requested revision
+// svn_opt_revision_t rev;
+// int idx = srcsvn.findRev( "?rev=" );
+// if ( idx != -1 ) {
+// QString revstr = srcsvn.mid( idx+5 );
+// kdDebug(9036) << "revision string found " << revstr << endl;
+// if ( revstr == "HEAD" ) {
+// rev.kind = svn_opt_revision_head;
+// kdDebug(9036) << "revision searched : HEAD" << endl;
+// } else {
+// rev.kind = svn_opt_revision_number;
+// rev.value.number = revstr.toLong();
+// kdDebug(9036) << "revision searched : " << rev.value.number << endl;
+// }
+// srcsvn = srcsvn.left( idx );
+// kdDebug(9036) << "new src : " << srcsvn << endl;
+// } else {
+// kdDebug(9036) << "no revision given. searching HEAD " << endl;
+// rev.kind = svn_opt_revision_head;
+// }
+//
+// initNotifier(false, false, false, subpool);
+// svn_error_t *err = svn_client_copy(&commit_info, srcsvn.utf8(), &rev, destsvn.utf8(), ctx, subpool);
+// if ( err ) {
+// error( KIO::ERR_SLAVE_DEFINED, err->message );
+// svn_pool_destroy (subpool);
+// }
+//
+// finished();
+// svn_pool_destroy (subpool);
+// }
+
+void kio_svnProtocol::mkdir( const KURL::List& list, int /*permissions*/ ) {
+ kdDebug(9036) << "kio_svnProtocol::mkdir(LIST) : " << list << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+
+ recordCurrentURL( list[ 0 ] );
+
+ apr_array_header_t *targets = apr_array_make(subpool, list.count()+1, sizeof(const char *));
+
+ KURL::List::const_iterator it = list.begin(), end = list.end();
+ for ( ; it != end; ++it ) {
+ QString cur = makeSvnURL( *it );
+ kdDebug( 9036 ) << "kio_svnProtocol::mkdir raw url for subversion : " << cur << endl;
+ const char *_target = apr_pstrdup( subpool, svn_path_canonicalize( apr_pstrdup( subpool, cur.utf8() ), subpool ) );
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = _target;
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_mkdir(&commit_info,targets,ctx,subpool);
+ if ( err ) {
+ error( KIO::ERR_COULD_NOT_MKDIR, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::mkdir( const KURL& url, int /*permissions*/ ) {
+ kdDebug(9036) << "kio_svnProtocol::mkdir() : " << url.url() << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+
+ QString target = makeSvnURL( url);
+ kdDebug(9036) << "SvnURL: " << target << endl;
+ recordCurrentURL( KURL( target ) );
+
+ apr_array_header_t *targets = apr_array_make(subpool, 2, sizeof(const char *));
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = apr_pstrdup( subpool, target.utf8() );
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_mkdir(&commit_info,targets,ctx,subpool);
+ if ( err ) {
+ error( KIO::ERR_COULD_NOT_MKDIR, err->message );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::del( const KURL& url, bool /*isfile*/ ) {
+ kdDebug(9036) << "kio_svnProtocol::del() : " << url.url() << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+
+ QString target = makeSvnURL(url);
+ kdDebug(9036) << "SvnURL: " << target << endl;
+ recordCurrentURL( KURL( target ) );
+
+ apr_array_header_t *targets = apr_array_make(subpool, 2, sizeof(const char *));
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = apr_pstrdup( subpool, target.utf8() );
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_delete(&commit_info,targets,false/*force remove locally modified files in wc*/,ctx,subpool);
+ if ( err ) {
+ error( KIO::ERR_CANNOT_DELETE, err->message );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::rename(const KURL& src, const KURL& dest, bool /*overwrite*/) {
+ kdDebug(9036) << "kio_svnProtocol::rename() Source : " << src.url() << " Dest : " << dest.url() << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+
+ KURL nsrc = src;
+ KURL ndest = dest;
+ nsrc.setProtocol( chooseProtocol( src.protocol() ) );
+ ndest.setProtocol( chooseProtocol( dest.protocol() ) );
+ QString srcsvn = nsrc.url();
+ QString destsvn = ndest.url();
+
+ recordCurrentURL( nsrc );
+
+ //find the requested revision
+ svn_opt_revision_t rev;
+ int idx = srcsvn.findRev( "?rev=" );
+ if ( idx != -1 ) {
+ QString revstr = srcsvn.mid( idx+5 );
+ kdDebug(9036) << "revision string found " << revstr << endl;
+ if ( revstr == "HEAD" ) {
+ rev.kind = svn_opt_revision_head;
+ kdDebug(9036) << "revision searched : HEAD" << endl;
+ } else {
+ rev.kind = svn_opt_revision_number;
+ rev.value.number = revstr.toLong();
+ kdDebug(9036) << "revision searched : " << rev.value.number << endl;
+ }
+ srcsvn = srcsvn.left( idx );
+ kdDebug(9036) << "new src : " << srcsvn << endl;
+ } else {
+ kdDebug(9036) << "no revision given. searching HEAD " << endl;
+ rev.kind = svn_opt_revision_head;
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_move(&commit_info, srcsvn.utf8(), &rev, destsvn.utf8(), false/*force remove locally modified files in wc*/, ctx, subpool);
+ if ( err ) {
+ error( KIO::ERR_CANNOT_RENAME, err->message );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::special( const QByteArray& data ) {
+// kdDebug(9036) << "kio_svnProtocol::special" << endl;
+
+ QDataStream stream(data, IO_ReadOnly);
+ int tmp;
+
+ stream >> tmp;
+ kdDebug(9036) << "kio_svnProtocol::special " << tmp << endl;
+
+ switch ( tmp ) {
+ case SVN_CHECKOUT:
+ {
+ KURL repository, wc;
+ int revnumber;
+ QString revkind;
+ stream >> repository;
+ stream >> wc;
+ stream >> revnumber;
+ stream >> revkind;
+ kdDebug(9036) << "kio_svnProtocol CHECKOUT from " << repository.url() << " to " << wc.url() << " at " << revnumber << " or " << revkind << endl;
+ checkout( repository, wc, revnumber, revkind );
+ break;
+ }
+ case SVN_UPDATE:
+ {
+ KURL::List list;
+ int revnumber;
+ QString revkind;
+ stream >> list;
+ stream >> revnumber;
+ stream >> revkind;
+ kdDebug(9036) << "kio_svnProtocol UPDATE " << endl;
+ update( list, revnumber, revkind );
+ break;
+ }
+ case SVN_COMMIT:
+ {
+ KURL::List wclist;
+ while ( !stream.atEnd() ) {
+ KURL tmp;
+ stream >> tmp;
+ wclist << tmp;
+ }
+ kdDebug(9036) << "kio_svnProtocol COMMIT" << endl;
+ commit( wclist );
+ break;
+ }
+ case SVN_COMMIT_2:
+ {
+ bool recurse, keeplocks;
+ KURL::List wclist;
+ stream >> recurse;
+ stream >> keeplocks;
+ while ( !stream.atEnd() ) {
+ KURL tmp;
+ stream >> tmp;
+ wclist << tmp;
+ }
+ kdDebug(9036) << "kio_svnProtocol COMMIT2" << endl;
+ commit2( recurse, keeplocks, wclist );
+ break;
+ }
+ case SVN_LOG:
+ {
+ kdDebug(9036) << "kio_svnProtocol LOG" << endl;
+ int revstart, revend;
+ QString revkindstart, revkindend;
+ bool discorverChangedPath, strictNodeHistory;
+ KURL::List targets;
+
+ stream >> revstart;
+ stream >> revkindstart;
+ stream >> revend;
+ stream >> revkindend;
+ stream >> discorverChangedPath;
+ stream >> strictNodeHistory;
+ while ( !stream.atEnd() ) {
+ KURL tmp;
+ stream >> tmp;
+ targets << tmp;
+ }
+ svn_log( revstart, revkindstart, revend, revkindend,
+ discorverChangedPath, strictNodeHistory, targets );
+ break;
+ }
+ case SVN_IMPORT:
+ {
+ KURL wc,repos;
+ stream >> repos;
+ stream >> wc;
+ kdDebug(9036) << "kio_svnProtocol IMPORT" << endl;
+ import(repos,wc);
+ break;
+ }
+ case SVN_ADD:
+ {
+ KURL::List wcList;
+ stream >> wcList;
+ kdDebug(9036) << "kio_svnProtocol ADD" << endl;
+ add(wcList);
+ break;
+ }
+ case SVN_DEL:
+ {
+ KURL::List wclist;
+ stream >> wclist;
+ kdDebug(9036) << "kio_svnProtocol DEL" << endl;
+ wc_delete(wclist);
+ break;
+ }
+ case SVN_REVERT:
+ {
+ KURL::List wclist;
+ stream >> wclist;
+ kdDebug(9036) << "kio_svnProtocol REVERT" << endl;
+ wc_revert(wclist);
+ break;
+ }
+ case SVN_STATUS:
+ {
+ KURL wc;
+ bool checkRepos=false;
+ bool fullRecurse=false;
+ stream >> wc;
+ stream >> checkRepos;
+ stream >> fullRecurse;
+ wc_status(wc,checkRepos,fullRecurse);
+ break;
+ }
+ case SVN_STATUS_2:
+ {
+ KURL wc;
+ QString revkind;
+ int revnumber;
+ bool checkRepos, fullRecurse, getAll, noIgnore;
+ stream >> checkRepos;
+ stream >> fullRecurse;
+ stream >> getAll;
+ stream >> noIgnore;
+ stream >> revnumber;
+ stream >> revkind;
+ stream >> wc;
+ wc_status2(wc,checkRepos,fullRecurse, getAll, noIgnore, revnumber, revkind);
+ break;
+ }
+ case SVN_MKDIR:
+ {
+ KURL::List list;
+ stream >> list;
+ kdDebug(9036) << "kio_svnProtocol MKDIR" << endl;
+ mkdir(list,0);
+ break;
+ }
+ case SVN_RESOLVE:
+ {
+ KURL url;
+ bool recurse;
+ stream >> url;
+ stream >> recurse;
+ kdDebug(9036) << "kio_svnProtocol RESOLVE" << endl;
+ wc_resolve(url,recurse);
+ break;
+ }
+ case SVN_SWITCH:
+ {
+ KURL wc,url;
+ bool recurse;
+ int revnumber;
+ QString revkind;
+ stream >> wc;
+ stream >> url;
+ stream >> recurse;
+ stream >> revnumber;
+ stream >> revkind;
+ kdDebug(9036) << "kio_svnProtocol SWITCH" << endl;
+ svn_switch(wc,url,revnumber,revkind,recurse);
+ break;
+ }
+ case SVN_SWITCH_RELOCATE:
+ {
+ KURL wc, origUrl, newUrl;
+ bool recurse;
+ stream >> wc;
+ stream >> origUrl;
+ stream >> newUrl;
+ stream >> recurse;
+ svn_switch_relocate( wc, origUrl, newUrl, recurse );
+ break;
+ }
+ case SVN_DIFF:
+ {
+ KURL url1,url2;
+ int rev1, rev2;
+ bool recurse, pegdiff;
+ QString revkind1, revkind2;
+ stream >> url1;
+ stream >> url2;
+ stream >> rev1;
+ stream >> revkind1;
+ stream >> rev2;
+ stream >> revkind2;
+ stream >> recurse >> pegdiff;
+ kdDebug(9036) << "kio_svnProtocol DIFF" << endl;
+ svn_diff(url1,url2,rev1,rev2,revkind1,revkind2,recurse,pegdiff);
+ break;
+ }
+ case SVN_BLAME:
+ {
+ KURL url;
+ int urlMode;
+ int pegRev, startRev, endRev;
+ QString pegRevKind, startRevKind, endRevKind;
+ stream >> url;
+ stream >> urlMode;
+// stream >> pegRev;
+// stream >> pegRevKind;
+ stream >> startRev;
+ stream >> startRevKind;
+ stream >> endRev;
+ stream >> endRevKind;
+
+ blame(url, (UrlMode)urlMode, startRev, startRevKind, endRev, endRevKind);
+ break;
+ }
+ case SVN_INFO:
+ {
+ KURL pathOrUrl;
+ int pegRev, rev;
+ QString pegRevKind, revKind;
+ bool recurse = false;
+ stream >> pathOrUrl;
+ stream >> pegRev;
+ stream >> pegRevKind;
+ stream >> rev;
+ stream >> revKind;
+ stream >> recurse;
+ svn_info( pathOrUrl, pegRev, pegRevKind, rev, revKind, recurse );
+ break;
+ }
+ case SVN_COPY:
+ {
+ KURL src, dest;
+ int srcRev;
+ QString srcRevKind;
+ stream >> src;
+ stream >> srcRev;
+ stream >> srcRevKind;
+ stream >> dest;
+ svn_copy( src, srcRev, srcRevKind, dest );
+ break;
+ }
+ case SVN_MERGE:
+ {
+ KURL src1, src2, wc_target;
+ int rev1, rev2;
+ QString revKind1, revKind2;
+ bool recurse, ignore_ancestry, force, dry_run;
+ stream >> src1 >> rev1 >> revKind1;
+ stream >> src2 >> rev2 >> revKind2;
+ stream >> wc_target;
+ stream >> recurse >> ignore_ancestry >> force >> dry_run;
+ svn_merge( src1, rev1, revKind1, src2, rev2, revKind2, wc_target,
+ recurse, ignore_ancestry, force, dry_run );
+ break;
+ }
+ default:
+ {
+ kdDebug(9036) << "kio_svnProtocol DEFAULT" << endl;
+ break;
+ }
+ }
+}
+/**
+ * not used anywhere, anymore
+*/
+void kio_svnProtocol::popupMessage( const QString& message ) {
+// QByteArray params;
+// QDataStream stream(params, IO_WriteOnly);
+// stream << message;
+//
+// if ( !dcopClient()->send( "kded","ksvnd","popupMessage(QString)", params ) )
+// kdWarning() << "Communication with KDED:KSvnd failed" << endl;
+}
+
+void kio_svnProtocol::blame( KURL url, UrlMode /*mode*/,/* int pegRev, QString pegRevKind,*/ int startRev, QString startRevKind, int endRev, QString endRevKind )
+{
+ kdDebug(9036) << " __TIME__ " << __TIME__ << endl;
+// kdDebug(9036) << " PegRev " << pegRev << pegRevKind << endl;
+ kdDebug(9036) << " StartRev" << startRev << startRevKind << endl;
+ kdDebug(9036) << " EndRev" << endRev << endRevKind << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ const char* path_or_url = apr_pstrdup( subpool, url.pathOrURL().utf8() );;
+
+ svn_opt_revision_t rev1 = createRevision( startRev, startRevKind, subpool );
+ svn_opt_revision_t rev2 = createRevision( endRev, endRevKind, subpool );
+// svn_opt_revision_t revPeg = createRevision( pegRev, pegRevKind, subpool );
+
+ //initNotifier(false, false, false, subpool);
+ svn_client_blame_receiver_t receiver = kio_svnProtocol::blameReceiver;
+ svn_error_t *err = svn_client_blame( path_or_url, &rev1, &rev2, receiver, (void*)this, ctx, subpool );
+ if ( err )
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ finished();
+ svn_pool_destroy (subpool);
+
+}
+
+svn_error_t* kio_svnProtocol::blameReceiver( void *baton, apr_int64_t line_no, svn_revnum_t rev, const char *author, const char *date, const char *line, apr_pool_t *pool )
+{
+ kio_svnProtocol *p = (kio_svnProtocol*)baton;
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "LINE", QString::number(line_no) );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "REV", QString::number(rev) );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "AUTHOR", author );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "DATE", date );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "CONTENT", QString::fromLocal8Bit(line) );
+
+ p->incCounter();
+ return SVN_NO_ERROR;
+}
+
+/**
+ KDevelop has no way to retrieve URL of working copy.
+ Thus retreiving URL from WC should be done here, using subversion native API.
+ Thus, svn_log should get another flag (bool repositHistory )specifying between file:/// or URL
+*/
+void kio_svnProtocol::svn_log( int revstart, const QString& revkindstart, int revend, const QString& revkindend,
+ bool discorverChangedPaths, bool strictNodeHistory,
+ const KURL::List& urls )
+{
+// kdDebug(9036) << " from revision " << revstart << " or " << revkindstart << " to " << " revision " << revend << " or " << revkindend << endl;
+ kdDebug(9036) << " __TIME__ " << __TIME__ << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+
+ // TODO HEAD:1 was removed from SVN API 1.2, instead callers should specify HEAD:0
+ svn_opt_revision_t rev1 = createRevision( revstart, revkindstart, subpool );
+ svn_opt_revision_t rev2 = createRevision( revend, revkindend, subpool );
+
+ m_counter = 0;
+ apr_array_header_t *targets = apr_array_make(subpool, 1+urls.count(), sizeof(const char *));
+
+ for ( QValueListConstIterator<KURL> it = urls.begin(); it != urls.end() ; ++it ) {
+ KURL nurl = *it;
+ const char *path =
+ apr_pstrdup( subpool, svn_path_canonicalize( nurl.pathOrURL().utf8(), subpool ) );
+ kdDebug(9036) << path << endl;
+ *(( const char ** )apr_array_push(( apr_array_header_t* )targets)) = path;
+
+ setMetaData(QString::number( counter() ).rightJustify( 10,'0' )+ "requrl", nurl.pathOrURL() );
+ incCounter();
+ }
+
+ svn_log_message_receiver_t receiver = kio_svnProtocol::receiveLogMessage;
+ svn_error_t *err = svn_client_log2(targets, &rev1, &rev2, 0, discorverChangedPaths, strictNodeHistory, receiver, this, ctx, subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+// save for one revision
+svn_error_t* kio_svnProtocol::receiveLogMessage(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision,
+ const char *author, const char *date, const char *message, apr_pool_t *pool )
+{
+ kio_svnProtocol *p = (kio_svnProtocol*)baton;
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "rev", QString::number(revision) );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "author", author );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "date", date );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "logmsg", QString::fromLocal8Bit(message) );
+ if( changed_paths != NULL ){
+ QString pathlist;
+ void *onePath;
+ const char *pathkey;
+ apr_hash_index_t *hi;
+ for (hi = apr_hash_first(pool, changed_paths); hi; hi = apr_hash_next(hi)) {
+ apr_hash_this(hi, (const void**) &pathkey, NULL, &onePath);
+ svn_log_changed_path_t *cp = (svn_log_changed_path_t*)onePath;
+ kdDebug(9036) << "OnePath: " << cp->copyfrom_path << " and key: " << pathkey << endl;
+ pathlist += cp->action;
+ pathlist += " ";
+// pathlist += cp->copyfrom_path;
+ pathlist += pathkey;
+ pathlist += "\n";
+ }
+ kdDebug(9036) << "pathlist: " << pathlist <<endl;
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "pathlist", pathlist );
+ }
+ p->incCounter();
+ return SVN_NO_ERROR;
+}
+
+svn_opt_revision_t kio_svnProtocol::createRevision( int revision, const QString& revkind, apr_pool_t *pool ) {
+ svn_opt_revision_t result;//,endrev;
+ // TODO support svn_opt_revision_date
+ if ( revision != -1 ) {
+ result.value.number = revision;
+ result.kind = svn_opt_revision_number;
+ } else if ( revkind == "WORKING" ) {
+ result.kind = svn_opt_revision_working;
+ } else if ( revkind == "BASE" ) {
+ result.kind = svn_opt_revision_base;
+ } else if ( revkind == "HEAD" ) {
+ result.kind = svn_opt_revision_head;
+ } else if ( revkind == "COMMITTED" ) {
+ result.kind = svn_opt_revision_committed;
+ } else if ( revkind == "PREV" ) {
+ result.kind = svn_opt_revision_previous;
+ }
+// } else if ( !revkind.isNull() ) {
+// svn_opt_parse_revision(&result,&endrev,revkind.utf8(),pool);
+ else if ( revkind == "UNSPECIFIED" ){
+ result.kind = svn_opt_revision_unspecified;
+ }
+ else {
+ result.kind = svn_opt_revision_unspecified;
+ }
+ return result;
+}
+
+void kio_svnProtocol::svn_diff(const KURL & url1, const KURL& url2,int rev1, int rev2,const QString& revkind1,const QString& revkind2,bool recurse, bool pegdiff )
+{
+ kdDebug(9036) << "kio_svn::diff : " << url1.path() << " at revision " << rev1 << " or " << revkind1 << " with "
+ << url2.path() << " at revision " << rev2 << " or " << revkind2
+ << endl ;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ apr_array_header_t *options = svn_cstring_split( "", "\t\r\n", TRUE, subpool );
+
+// KURL nurl1 = url1;
+// KURL nurl2 = url2;
+// nurl1.setProtocol( chooseProtocol( url1.protocol() ) ); //svn+https -> https for eg
+// nurl2.setProtocol( chooseProtocol( url2.protocol() ) );
+// recordCurrentURL( nurl1 );
+// QString source = makeSvnURL( nurl1 );
+// QString target = makeSvnURL( nurl2 );
+
+// const char *path1 = svn_path_canonicalize( apr_pstrdup( subpool, source.utf8() ), subpool );
+// const char *path2 = svn_path_canonicalize( apr_pstrdup( subpool, target.utf8() ), subpool );
+
+ //remove file:/// so we can diff for working copies, needs a better check (so we support URL for file:/// _repositories_ )
+// if ( nurl1.protocol() == "file" ) {
+// path1 = svn_path_canonicalize( apr_pstrdup( subpool, nurl1.path().utf8() ), subpool );
+// }
+// if ( nurl2.protocol() == "file" ) {
+// path2 = svn_path_canonicalize( apr_pstrdup( subpool, nurl2.path().utf8() ), subpool );
+// }
+
+ // all the commentted codes above are redundancy. url1/url2 is only file:// , svn:// or https://
+ // svn+https etc. are not handed out here.
+ const char *path1 = apr_pstrdup( subpool, url1.pathOrURL().utf8() );
+ const char *path2 = apr_pstrdup( subpool, url2.pathOrURL().utf8() );;
+
+ kdDebug( 9036 ) << "1 : " << path1 << " 2: " << path2 << endl;
+
+ svn_opt_revision_t revision1,revision2;
+ revision1 = createRevision(rev1, revkind1, subpool);
+ revision2 = createRevision(rev2, revkind2, subpool);
+
+ char *templ;
+ templ = apr_pstrdup ( subpool, "/tmp/tmpfile_XXXXXX" );
+ apr_file_t *outfile = NULL;
+ apr_file_mktemp( &outfile, templ , APR_READ|APR_WRITE|APR_CREATE|APR_TRUNCATE, subpool );
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = 0;
+ if( pegdiff ){
+ svn_opt_revision_t peg_rev = createRevision(-1, "BASE", subpool );
+ err = svn_client_diff_peg( options, path1, &peg_rev, &revision1, &revision2,
+ recurse, false, false, outfile, NULL, ctx, subpool );
+ } else{
+ err = svn_client_diff( options, path1, &revision1, path2, &revision2, recurse,
+ false, false, outfile, NULL, ctx, subpool );
+ }
+
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+ //read the content of the outfile now
+ QStringList tmp;
+ apr_file_close(outfile);
+ QFile file(templ);
+ if ( file.open( IO_ReadOnly ) ) {
+ QTextStream stream( &file );
+ QString line;
+ while ( !stream.atEnd() ) {
+ line = stream.readLine();
+ tmp << line;
+ }
+ file.close();
+ }
+ for ( QStringList::Iterator itt = tmp.begin(); itt != tmp.end(); itt++ ) {
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "diffresult", ( *itt ) );
+ m_counter++;
+ }
+ //delete temp file
+ file.remove();
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::svn_switch( const KURL& wc, const KURL& repos, int revnumber, const QString& revkind, bool recurse) {
+ kdDebug(9036) << "kio_svn::switch : " << wc.path() << " at revision " << revnumber << " or " << revkind << endl ;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+
+ KURL nurl = repos;
+ KURL dest = wc;
+ nurl.setProtocol( chooseProtocol( repos.protocol() ) );
+ dest.setProtocol( "file" );
+// recordCurrentURL( nurl );
+// QString source = dest.path();
+// QString target = makeSvnURL( repos );
+
+ const char *path = svn_path_canonicalize( apr_pstrdup( subpool, dest.path().utf8() ), subpool );
+ const char *url = svn_path_canonicalize( apr_pstrdup( subpool, nurl.url().utf8() ), subpool );
+ kdDebug(9036) << " WC path: " << path << " Repository URL: " << url << endl;
+
+ svn_opt_revision_t rev = createRevision( revnumber, revkind, subpool );
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_switch (NULL/*result revision*/, path, url, &rev, recurse, ctx, subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit( err->message ) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::svn_switch_relocate( const KURL &wc, const KURL &origUrl, const KURL &newUrl,
+ bool recurse )
+{
+ apr_pool_t *subpool = svn_pool_create( pool );
+
+ const char *wcPath = svn_path_canonicalize( apr_pstrdup( subpool, wc.path().utf8() ), subpool );
+ const char *fromUrl = apr_pstrdup( subpool, origUrl.url().utf8() );
+ const char *toUrl = apr_pstrdup( subpool, newUrl.url().utf8() );
+ kdDebug(9036) << " WC path: " << wcPath << " from: " << fromUrl << " to: " << toUrl << endl;
+
+ svn_error_t *err = svn_client_relocate( wcPath, fromUrl, toUrl, recurse, ctx, pool );
+
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit( err->message ) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+ m_counter = 0L;
+ setMetaData(QString::number( counter() ).rightJustify( 10,'0' )+ "string",
+ QString("switched to %1").arg( toUrl ) );
+ finished();
+ svn_pool_destroy( subpool );
+}
+
+void kio_svnProtocol::update( const KURL::List &list, int revnumber, const QString& revkind ) {
+ kdDebug(9036) << "kio_svn::update : __TIME__" << __TIME__ << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+
+ apr_array_header_t *targets = apr_array_make(subpool, 1+list.count(), sizeof(const char *));
+ svn_opt_revision_t rev = createRevision( revnumber, revkind, subpool );
+
+ for( QValueList<KURL>::ConstIterator it = list.begin(); it != list.end(); ++it ){
+ KURL nurl = *it;
+ *( const char ** )apr_array_push(targets) = svn_path_canonicalize( nurl.path().utf8(), subpool );
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_update2( NULL, targets, &rev,
+ true/*recurse*/, false/*ignore_external*/,
+ ctx, subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::import( const KURL& repos, const KURL& wc ) {
+ kdDebug(9036) << "kio_svnProtocol::import() : " << wc.url() << " into " << repos.url() << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+// svn_client_commit_info_t *commit_info =
+// (svn_client_commit_info_t*) apr_palloc( subpool, sizeof(svn_client_commit_info_t) );
+ svn_commit_info_t *commit_info = svn_create_commit_info( subpool );
+ bool nonrecursive = false;
+
+ const char *path = apr_pstrdup( subpool, svn_path_canonicalize( wc.path().utf8(), subpool ) );
+ const char *url = apr_pstrdup( subpool, svn_path_canonicalize( repos.url().utf8(), subpool ) );
+
+ initNotifier(false, false, false, subpool);
+ kdDebug(9036) << " Executing import: " << path << " to " << url << endl;
+
+ svn_error_t *err = svn_client_import2(&commit_info, path, url, nonrecursive, false, ctx, subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ svn_pool_destroy (subpool);
+ finished();
+}
+
+void kio_svnProtocol::checkout( const KURL& repos, const KURL& wc, int revnumber, const QString& revkind ) {
+ kdDebug(9036) << "kio_svn::checkout : " << repos.url() << " into " << wc.path() << " at revision " << revnumber << " or " << revkind << endl ;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ KURL nurl = repos;
+ KURL dest = wc;
+ nurl.setProtocol( chooseProtocol( repos.protocol() ) );
+ dest.setProtocol( "file" );
+ QString target = makeSvnURL( repos );
+ recordCurrentURL( nurl );
+ QString dpath = dest.path();
+
+ //find the requested revision
+ svn_opt_revision_t rev = createRevision( revnumber, revkind, subpool );
+
+ initNotifier(true, false, false, subpool);
+ svn_error_t *err = svn_client_checkout (NULL/* rev actually checkedout */, svn_path_canonicalize( target.utf8(), subpool ), svn_path_canonicalize ( dpath.utf8(), subpool ), &rev, true, ctx, subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::commit(const KURL::List& wc)
+{
+ commit2(true, true, wc);
+}
+
+void kio_svnProtocol::commit2(bool recurse, bool keeplocks, const KURL::List& wc) {
+ kdDebug(9036) << "kio_svnProtocol::commit2() : " << wc << endl;
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+
+ apr_array_header_t *targets = apr_array_make(subpool, 1+wc.count(), sizeof(const char *));
+
+ for ( QValueListConstIterator<KURL> it = wc.begin(); it != wc.end() ; ++it ) {
+ KURL nurl = *it;
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = svn_path_canonicalize( nurl.path().utf8(), subpool );
+ }
+
+ initNotifier(false, false, false, subpool);
+ kdDebug(9036) << "recurse: " << recurse << " keeplocks: " << keeplocks <<endl;
+ svn_error_t *err = svn_client_commit2(&commit_info,targets,recurse,keeplocks,ctx,subpool);
+
+ if ( err ){
+ char errbuf[512];
+ svn_strerror(err->apr_err, errbuf, 512);
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) + "\n: " + QString::fromLocal8Bit(errbuf) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ if ( commit_info ) {
+ for ( QValueListConstIterator<KURL> it = wc.begin(); it != wc.end() ; ++it ) {
+ KURL nurl = *it;
+ nurl.setProtocol( "file" );
+
+ QString userstring = i18n ( "Nothing to commit." );
+ if ( SVN_IS_VALID_REVNUM( commit_info->revision ) )
+ userstring = i18n( "Committed revision %1." ).arg(commit_info->revision);
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "path", nurl.path() );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "action", "0" );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "kind", "0" );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "mime_t", "" );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "content", "0" );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "prop", "0" );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "rev" , QString::number( commit_info->revision ) );
+ setMetaData(QString::number( m_counter ).rightJustify( 10,'0' )+ "string", userstring );
+ m_counter++;
+ }
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::add(const KURL::List& list) {
+ kdDebug(9036) << "kio_svnProtocol::add() __TIME__" << __TIME__ << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ bool nonrecursive = false;
+ initNotifier(false, false, false, subpool);
+
+ svn_error_t *err = NULL;
+ for( QValueList<KURL>::ConstIterator it = list.begin(); it != list.end(); ++it ){
+
+ KURL nurl = (*it);
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+ kdDebug(9036) << " Schedule to Add: " << nurl.path().utf8() << endl;
+ err = svn_client_add( svn_path_canonicalize( nurl.path().utf8(), subpool ),
+ nonrecursive, ctx, subpool);
+ if( err ) break;
+ }
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::wc_delete(const KURL::List& wc) {
+ kdDebug(9036) << "kio_svnProtocol::wc_delete() : " << wc << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_client_commit_info_t *commit_info = NULL;
+ bool force = false;
+
+ apr_array_header_t *targets = apr_array_make(subpool, 1+wc.count(), sizeof(const char *));
+
+ for ( QValueListConstIterator<KURL> it = wc.begin(); it != wc.end() ; ++it ) {
+ KURL nurl = *it;
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = svn_path_canonicalize( nurl.path().utf8(), subpool );
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_delete(&commit_info,targets,force,ctx,subpool);
+
+ if ( err )
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::wc_revert(const KURL::List& wc) {
+ kdDebug(9036) << "kio_svnProtocol::revert() : " << wc << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ bool nonrecursive = false;
+
+ apr_array_header_t *targets = apr_array_make(subpool, 1 + wc.count(), sizeof(const char *));
+
+ for ( QValueListConstIterator<KURL> it = wc.begin(); it != wc.end() ; ++it ) {
+ KURL nurl = *it;
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+ (*(( const char ** )apr_array_push(( apr_array_header_t* )targets)) ) = svn_path_canonicalize( nurl.path().utf8(), subpool );
+ }
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_revert(targets,nonrecursive,ctx,subpool);
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit( err->message ) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::wc_status(const KURL& wc, bool checkRepos, bool fullRecurse, bool getAll, int revnumber, const QString& revkind) {
+ kdDebug(9036) << "kio_svnProtocol::wc_status() : " << wc.url() << " checkRepos " << checkRepos << " fullRecurse " << fullRecurse << " getAll " << getAll << endl;
+
+ wc_status2( wc, checkRepos, fullRecurse, getAll, false, revnumber, revkind );
+}
+
+void kio_svnProtocol::wc_status2(const KURL& wc, bool checkRepos, bool fullRecurse, bool getAll, bool noIgnore, int revnumber, const QString& revkind) {
+ kdDebug(9036) << "kio_svnProtocol::wc_status2() : " << wc.url() << " checkRepos " << checkRepos << " fullRecurse " << fullRecurse << " getAll " << getAll << " noIgnore " << noIgnore << " revnumber " << revnumber << " revkind " << revkind << endl;
+ kdDebug(9036) << " __TIME__ " << __TIME__ << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_revnum_t result_rev;
+
+ KURL nurl = wc;
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+
+ svn_opt_revision_t rev = createRevision( revnumber, revkind, subpool );
+
+ initNotifier(false, false, false, subpool);
+
+ svn_error_t *err = svn_client_status(&result_rev, svn_path_canonicalize( nurl.path().utf8(), subpool ), &rev, kio_svnProtocol::status, this, fullRecurse, getAll, checkRepos, noIgnore, ctx, subpool);
+
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::svn_info( KURL pathOrUrl, int pegRev, QString pegRevKind, int rev, QString revKind, bool recurse )
+{
+ kdDebug(9036) << " kio_svnProtocol::svn_info(): pegRev " << pegRev << " pegKind " << pegRevKind << " rev " << rev << " revKind " << revKind << " recurse " << recurse << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_opt_revision_t peg_rev = createRevision( pegRev, pegRevKind, subpool );
+ svn_opt_revision_t revision = createRevision( rev, revKind, subpool );
+
+ svn_error_t *err = svn_client_info( pathOrUrl.pathOrURL().utf8(),
+ &peg_rev, &revision,
+ kio_svnProtocol::infoReceiver,
+ this,
+ recurse,
+ ctx, pool );
+
+ if ( err ){
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(err->message) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+ svn_pool_destroy( subpool );
+ finished();
+}
+
+svn_error_t* kio_svnProtocol::infoReceiver( void *baton, const char *path,
+ const svn_info_t *info, apr_pool_t *pool)
+{
+ kio_svnProtocol *p= (kio_svnProtocol*)baton ;
+ if( !p )
+ return SVN_NO_ERROR;
+
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "PATH", QString::fromUtf8( path ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "URL", QString( info->URL ) );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "REV", QString::number( info->rev ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "KIND", QString::number( info->kind ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "REPOS_ROOT_URL", QString( info->repos_root_URL ) );
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "REPOS_UUID", QString(info->repos_UUID) );
+ p->incCounter();
+
+ return SVN_NO_ERROR;
+}
+
+void kio_svnProtocol::svn_copy( const KURL &srcUrl, int srcRev, const QString &srcRevKind,
+ const KURL &destUrl )
+{
+ kdDebug(9036) << " kio: svn_copy src: " << srcUrl << " Dest Url: " << destUrl << " revnum: " << srcRev << " revKind: " << srcRevKind << endl;
+ apr_pool_t *subpool = svn_pool_create (pool);
+ svn_commit_info_t *commit_info = svn_create_commit_info( subpool );
+
+ svn_opt_revision_t rev = createRevision( srcRev, srcRevKind, subpool );
+
+ // TODO more elegant notification mechanism
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_copy2( &commit_info,
+ srcUrl.pathOrURL().utf8(), &rev,
+ destUrl.pathOrURL().utf8(),
+ ctx, subpool);
+
+ if ( err ) {
+ apr_status_t errcode = err->apr_err;
+ char buf[512];
+ svn_strerror(errcode, buf, 512);
+ error( KIO::ERR_SLAVE_DEFINED, QString::fromLocal8Bit(buf) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ if( commit_info ){
+ setMetaData(QString::number( counter() ).rightJustify( 10,'0' )+ "string",
+ i18n("Copied Revision %1").arg( commit_info->revision) );
+ } else {
+ setMetaData(QString::number( counter() ).rightJustify( 10,'0' )+ "string",
+ i18n("Copied") );
+ }
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+void kio_svnProtocol::svn_merge(const KURL &src1, int revNum1, QString revKind1,
+ const KURL &src2, int revNum2, QString revKind2,
+ const KURL &target_wc,
+ bool recurse, bool ignore_ancestry, bool force, bool dry_run )
+{
+ kdDebug(9036) << " KIO::svn_merge src1 " << src1.pathOrURL().utf8() << " src2 " << src2.pathOrURL().utf8() << " target " << target_wc.pathOrURL().utf8() << endl;
+ apr_pool_t *subpool = svn_pool_create( pool );
+
+ svn_opt_revision_t rev1 = createRevision( revNum1, revKind1, subpool );
+ svn_opt_revision_t rev2 = createRevision( revNum2, revKind2, subpool );
+
+ initNotifier( false, false, false, subpool );
+ svn_error_t *err = svn_client_merge( src1.pathOrURL().utf8(), &rev1,
+ src2.pathOrURL().utf8(), &rev2,
+ target_wc.pathOrURL().utf8(),
+ recurse, ignore_ancestry, force, dry_run,
+ ctx, pool );
+ if ( err ) {
+ apr_status_t errcode = err->apr_err;
+ char buf[512];
+ svn_strerror(errcode, buf, 512);
+ error( KIO::ERR_SLAVE_DEFINED,
+ QString::fromLocal8Bit(err->message) + "\n "+ QString::fromLocal8Bit(buf) );
+ svn_pool_destroy (subpool);
+ return;
+ }
+
+ finished();
+ svn_pool_destroy( subpool );
+}
+
+//change the proto and remove trailing /
+//remove double / also
+QString kio_svnProtocol::makeSvnURL ( const KURL& url ) const {
+ QString kproto = url.protocol();
+ KURL tpURL = url;
+ tpURL.cleanPath( true );
+ QString svnUrl;
+ if ( kproto == "kdevsvn+http" ) {
+ kdDebug(9036) << "http:/ " << url.url() << endl;
+ tpURL.setProtocol("http");
+ svnUrl = tpURL.url(-1);
+ return svnUrl;
+ }
+ else if ( kproto == "kdevsvn+https" ) {
+ kdDebug(9036) << "https:/ " << url.url() << endl;
+ tpURL.setProtocol("https");
+ svnUrl = tpURL.url(-1);
+ return svnUrl;
+ }
+ else if ( kproto == "kdevsvn+ssh" ) {
+ kdDebug(9036) << "svn+ssh:/ " << url.url() << endl;
+ tpURL.setProtocol("svn+ssh");
+ svnUrl = tpURL.url(-1);
+ return svnUrl;
+ }
+ else if ( kproto == "kdevsvn+svn" ) {
+ kdDebug(9036) << "svn:/ " << url.url() << endl;
+ tpURL.setProtocol("svn");
+ svnUrl = tpURL.url(-1);
+ return svnUrl;
+ }
+ else if ( kproto == "kdevsvn+file" ) {
+ kdDebug(9036) << "file:/ " << url.url() << endl;
+ tpURL.setProtocol("file");
+ svnUrl = tpURL.url(-1);
+ //hack : add one more / after file:/
+ int idx = svnUrl.find("/");
+ svnUrl.insert( idx, "//" );
+ return svnUrl;
+ }
+ return tpURL.url(-1);
+}
+
+QString kio_svnProtocol::chooseProtocol ( const QString& kproto ) const {
+ if ( kproto == "svn+http" ) return QString( "http" );
+ else if ( kproto == "svn+https" ) return QString( "https" );
+ else if ( kproto == "svn+ssh" ) return QString( "svn+ssh" );
+ else if ( kproto == "svn" ) return QString( "svn" );
+ else if ( kproto == "svn+file" ) return QString( "file" );
+ return kproto;
+}
+/** Certificate is not yet valid. */
+#define SVN_AUTH_SSL_NOTYETVALID 0x00000001
+/** Certificate has expired. */
+#define SVN_AUTH_SSL_EXPIRED 0x00000002
+/** Certificate's CN (hostname) does not match the remote hostname. */
+#define SVN_AUTH_SSL_CNMISMATCH 0x00000004
+/** @brief Certificate authority is unknown (i.e. not trusted) */
+#define SVN_AUTH_SSL_UNKNOWNCA 0x00000008
+/** @brief Other failure. This can happen if neon has introduced a new
+ * failure bit that we do not handle yet. */
+#define SVN_AUTH_SSL_OTHER 0x40000000
+svn_error_t *kio_svnProtocol::trustSSLPrompt(svn_auth_cred_ssl_server_trust_t **cred_p, void *baton, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *ci, svn_boolean_t may_save, apr_pool_t *pool)
+{
+ kio_svnProtocol *p = (kio_svnProtocol*)baton;
+ // prepare params.
+ QByteArray params, replyData;
+ QCString replyType;
+ QDataStream arg(params, IO_WriteOnly);
+
+ arg << i18n( "The certificate from the server could not be trusted automatically. Do you want to trust this certificate? " );
+ arg << QString::fromLocal8Bit(ci->hostname);
+ arg << QString::fromLocal8Bit(ci->fingerprint);
+ arg << QString::fromLocal8Bit(ci->valid_from) << QString::fromLocal8Bit(ci->valid_until);
+ arg << QString::fromLocal8Bit(ci->issuer_dname) << QString::fromLocal8Bit(ci->ascii_cert) ;
+ // call dcop
+ int ret = p->dcopClient()->call( "kded", "kdevsvnd",
+ "sslServerTrustPrompt(QString, QString, QString, QString, QString, QString, QString)",
+ params, replyType, replyData );
+ if (!ret){
+ kdWarning() << " failed to prompt SSL_Server_Trust_Prompt " << endl;
+ return SVN_NO_ERROR;
+ }
+ if (replyType != "int"){
+ kdWarning() << " abnormal reply type " << endl;
+ return SVN_NO_ERROR;
+ }
+ int resultCode;
+ QDataStream replyStream( replyData, IO_ReadOnly );
+ replyStream >> resultCode;
+
+ if( resultCode == -1 ){
+ kdWarning() << " SSL server trust rejected " << endl;
+ *cred_p = 0L; //FIXME when rejected, maybe more elegant methods..
+ } else if( resultCode == 0 ){ //accept once
+ *cred_p = (svn_auth_cred_ssl_server_trust_t*)apr_pcalloc (pool, sizeof (svn_auth_cred_ssl_server_trust_t));
+ kdDebug(9036) << " accept once " << endl;
+ (*cred_p)->may_save = false;
+ (*cred_p)->accepted_failures = 0;
+ } else if( resultCode == 1 ){ //accept permanently
+ *cred_p = (svn_auth_cred_ssl_server_trust_t*)apr_pcalloc (pool, sizeof (svn_auth_cred_ssl_server_trust_t));
+ kdDebug(9036) << " accept permanently " << endl;
+ (*cred_p)->may_save = true;
+ (*cred_p)->accepted_failures = failures;
+ } else{
+ kdWarning() << " SSL server trust failed for some reason" << endl;
+ *cred_p = 0L;
+ }
+
+ return SVN_NO_ERROR;
+}
+/** TODO fully implemented, but there is no way to test this yet.*/
+svn_error_t *kio_svnProtocol::clientCertSSLPrompt(
+ svn_auth_cred_ssl_client_cert_t **cred_p, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool)
+{
+ kdDebug(9036) << " clientCertSSLPrompt " << endl;
+// kio_svnProtocol *p = (kio_svnProtocol*)baton;
+// QByteArray reply;
+// QByteArray params;
+// QCString replyType;
+// call dcop
+// if (!p->dcopClient()->call("kded","kdevsvnd", "sslCertFile()",params,replyType,reply)) {
+// kdWarning()<<" Communication with dcop failed - fail to get certfile "<<endl;
+// return SVN_NO_ERROR;
+// }
+// if (replyType != "QString") {
+// kdWarning()<<" unexpected reply type "<<endl;
+// return SVN_NO_ERROR;
+// }
+// save reply data
+// QString fileName;
+// QDataStream replyStream( reply, IO_ReadOnly );
+// replyStream >> fileName;
+// allocate memory
+// *cred_p = (svn_auth_cred_ssl_client_cert_t*) apr_palloc (pool, sizeof(svn_auth_cred_ssl_client_cert_t));
+// (*cred_p)->cert_file = apr_pstrdup( pool, fileName.utf8() );
+// (*cred_p)->may_save = may_save;
+ return SVN_NO_ERROR;
+}
+
+/** TODO fully implemented, but there is no way to test this yet.*/
+svn_error_t *kio_svnProtocol::clientCertPasswdPrompt(
+ svn_auth_cred_ssl_client_cert_pw_t **cred_p, void *baton, const char *realm, svn_boolean_t may_save, apr_pool_t *pool)
+{
+ kdDebug(9036) << " Password Prompt Callback " << endl;
+ kdDebug(9036) << " realm " << realm << " <--realm " << endl;
+// kio_svnProtocol *p = ( kio_svnProtocol* )baton;
+// // prepare dcop
+// QByteArray reply;
+// QByteArray params;
+// QCString replyType;
+// QDataStream arg( params, IO_WriteOnly );
+// arg << i18n( "Enter password for subversion repository access" ) + "\n" + QString(realm);
+// // call dcop
+// if (!p->dcopClient()->call("kded","kdevsvnd", "sslPasswdDlg(QString)",params,replyType,reply)) {
+// kdWarning()<<" Communication with dcop failed - fail to show passwd dlg"<<endl;
+// return SVN_NO_ERROR;
+// }
+// if (replyType != "QCString") {
+// kdWarning()<<" unexpected reply type "<<endl;
+// return SVN_NO_ERROR;
+// }
+// // save reply data
+// QCString retstr, passwd;
+// QDataStream replyStream( reply, IO_ReadOnly );
+// replyStream >> retstr;
+//
+// if( retstr.left(1) == "-1" ){
+// kdDebug(9036) << " Null string received for passwd " << endl;
+// } else{
+// passwd = retstr.right( retstr.length() - 1 );
+// kdDebug(9036) << " PassWD : " << passwd << endl;
+// }
+//
+// svn_auth_cred_ssl_client_cert_pw_t *newcred = (svn_auth_cred_ssl_client_cert_pw_t*) apr_palloc (pool, sizeof (svn_auth_cred_ssl_client_cert_pw_t ) );
+//
+// newcred->password = apr_pstrdup(pool, (const char*) passwd );
+// newcred->may_save = false;
+// *cred_p = newcred;
+
+ return SVN_NO_ERROR;
+}
+
+
+svn_error_t *kio_svnProtocol::commitLogPrompt( const char **log_msg, const char **file,
+ apr_array_header_t *commit_items, void *baton, apr_pool_t *pool )
+{
+ *file = NULL; // if omitting this, it will segfault at import operation.
+ QCString replyType;
+ QByteArray params;
+ QByteArray reply;
+ QString result;// slist;
+ QStringList slist;
+ kio_svnProtocol *p = ( kio_svnProtocol* )baton;
+ svn_stringbuf_t *message = NULL;
+
+ for (int i = 0; i < commit_items->nelts; i++) {
+ QString list;
+ svn_client_commit_item_t *item = ((svn_client_commit_item_t **) commit_items->elts)[i];
+ const char *path = item->path;
+ char text_mod = '_', prop_mod = ' ';
+
+ if (! path)
+ path = item->url;
+ else if (! *path)
+ path = ".";
+
+ if (! path)
+ path = ".";
+
+ if ((item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE) && (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD))
+ text_mod = 'R';
+ else if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_ADD)
+ text_mod = 'A';
+ else if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
+ text_mod = 'D';
+ else if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_TEXT_MODS)
+ text_mod = 'M';
+ if (item->state_flags & SVN_CLIENT_COMMIT_ITEM_PROP_MODS)
+ prop_mod = 'M';
+
+ list += text_mod;
+ list += " ";
+ list += prop_mod;
+ list += " ";
+ list += path;
+ kdDebug(9036) << " Commiting items : " << list << endl;
+ slist << list;
+// slist += list;
+ }
+
+ QDataStream stream(params, IO_WriteOnly);
+ stream << slist.join("\n");
+
+ kdDebug(9036) << " __TIME__ " << __TIME__ << endl;
+ if ( !p->dcopClient()->call( "kded","kdevsvnd","commitDialog(QString)", params, replyType, reply ) ) {
+ kdWarning() << "Communication with KDED:KDevSvnd failed" << endl;
+ svn_error_t *err = svn_error_create( SVN_ERR_EXTERNAL_PROGRAM, NULL,
+ apr_pstrdup( pool, "Fail to call kded_kdevsvnd via DCOP. If this is your first problem, try to restart KDE" ) );
+ return err;
+ }
+
+ if ( replyType != "QString" ) {
+ kdWarning() << "Unexpected reply type" << endl;
+ svn_error_t *err = svn_error_create( SVN_ERR_EXTERNAL_PROGRAM, NULL,
+ apr_pstrdup( pool, "Fail to call kded_kdevsvnd via DCOP." ) );
+ return err;
+ }
+
+ QDataStream stream2 ( reply, IO_ReadOnly );
+ stream2 >> result;
+
+ if ( result.isNull() ) { //cancelled
+ *log_msg = NULL;
+ svn_error_t *err = svn_error_create( SVN_ERR_CANCELLED, NULL,
+ apr_pstrdup( pool, "Commit interruppted" ) );
+ return err;
+ }
+
+ message = svn_stringbuf_create( result.utf8(), pool );
+ *log_msg = message->data;
+
+ return SVN_NO_ERROR;
+}
+
+void kio_svnProtocol::notify(void *baton, const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision) {
+ kdDebug(9036) << "NOTIFY : " << path << " updated at revision " << revision << " action : " << action << ", kind : " << kind << " , content_state : " << content_state << ", prop_state : " << prop_state << endl;
+
+ QString userstring;
+ struct notify_baton *nb = ( struct notify_baton* ) baton;
+
+ //// Convert notification to a user readable string
+ switch ( action ) {
+ case svn_wc_notify_add : //add
+ if (mime_type && (svn_mime_type_is_binary (mime_type)))
+ userstring = i18n( "A (bin) %1" ).arg( path );
+ else
+ userstring = i18n( "A %1" ).arg( path );
+ break;
+ case svn_wc_notify_copy: //copy
+ userstring = i18n( "Copied %1 " ).arg( path );
+ break;
+ case svn_wc_notify_delete: //delete
+ nb->received_some_change = TRUE;
+ userstring = i18n( "D %1" ).arg( path );
+ break;
+ case svn_wc_notify_restore : //restore
+ userstring=i18n( "Restored %1." ).arg( path );
+ break;
+ case svn_wc_notify_revert : //revert
+ userstring=i18n( "Reverted %1." ).arg( path );
+ break;
+ case svn_wc_notify_failed_revert: //failed revert
+ userstring=i18n( "Failed to revert %1.\nTry updating instead." ).arg( path );
+ break;
+ case svn_wc_notify_resolved: //resolved
+ userstring=i18n( "Resolved conflicted state of %1." ).arg( path );
+ break;
+ case svn_wc_notify_skip: //skip
+ if ( content_state == svn_wc_notify_state_missing )
+ userstring=i18n("Skipped missing target %1.").arg( path );
+ else
+ userstring=i18n("Skipped %1.").arg( path );
+ break;
+ case svn_wc_notify_update_delete: //update_delete
+ nb->received_some_change = TRUE;
+ userstring=i18n( "D %1" ).arg( path );
+ break;
+ case svn_wc_notify_update_add: //update_add
+ nb->received_some_change = TRUE;
+ userstring=i18n( "A %1" ).arg( path );
+ break;
+ case svn_wc_notify_update_update: //update_update
+ {
+ /* If this is an inoperative dir change, do no notification.
+ An inoperative dir change is when a directory gets closed
+ without any props having been changed. */
+ if (! ((kind == svn_node_dir)
+ && ((prop_state == svn_wc_notify_state_inapplicable)
+ || (prop_state == svn_wc_notify_state_unknown)
+ || (prop_state == svn_wc_notify_state_unchanged)))) {
+ nb->received_some_change = TRUE;
+
+ if (kind == svn_node_file) {
+ if (content_state == svn_wc_notify_state_conflicted)
+ userstring = "C";
+ else if (content_state == svn_wc_notify_state_merged)
+ userstring = "G";
+ else if (content_state == svn_wc_notify_state_changed)
+ userstring = "U";
+ }
+
+ if (prop_state == svn_wc_notify_state_conflicted)
+ userstring += "C";
+ else if (prop_state == svn_wc_notify_state_merged)
+ userstring += "G";
+ else if (prop_state == svn_wc_notify_state_changed)
+ userstring += "U";
+ else
+ userstring += " ";
+
+ if (! ((content_state == svn_wc_notify_state_unchanged
+ || content_state == svn_wc_notify_state_unknown)
+ && (prop_state == svn_wc_notify_state_unchanged
+ || prop_state == svn_wc_notify_state_unknown)))
+ userstring += QString( " " ) + path;
+ }
+ break;
+ }
+ case svn_wc_notify_update_completed: //update_completed
+ {
+ if (! nb->suppress_final_line) {
+ if (SVN_IS_VALID_REVNUM (revision)) {
+ if (nb->is_export) {
+ if ( nb->in_external )
+ userstring = i18n("Exported external at revision %1.").arg( revision );
+ else
+ userstring = i18n("Exported revision %1.").arg( revision );
+ } else if (nb->is_checkout) {
+ if ( nb->in_external )
+ userstring = i18n("Checked out external at revision %1.").arg( revision );
+ else
+ userstring = i18n("Checked out revision %1.").arg( revision);
+ } else {
+ if (nb->received_some_change) {
+ if ( nb->in_external )
+ userstring=i18n("Updated external to revision %1.").arg( revision );
+ else
+ userstring = i18n("Updated to revision %1.").arg( revision);
+ } else {
+ if ( nb->in_external )
+ userstring = i18n("External at revision %1.").arg( revision );
+ else
+ userstring = i18n("At revision %1.").arg( revision);
+ }
+ }
+ } else /* no revision */ {
+ if (nb->is_export) {
+ if ( nb->in_external )
+ userstring = i18n("External export complete.");
+ else
+ userstring = i18n("Export complete.");
+ } else if (nb->is_checkout) {
+ if ( nb->in_external )
+ userstring = i18n("External checkout complete.");
+ else
+ userstring = i18n("Checkout complete.");
+ } else {
+ if ( nb->in_external )
+ userstring = i18n("External update complete.");
+ else
+ userstring = i18n("Update complete.");
+ }
+ }
+ }
+ }
+ if (nb->in_external)
+ nb->in_external = FALSE;
+ break;
+ case svn_wc_notify_update_external: //update_external
+ nb->in_external = TRUE;
+ userstring = i18n("Fetching external item into %1." ).arg( path );
+ break;
+ case svn_wc_notify_status_completed: //status_completed
+ if (SVN_IS_VALID_REVNUM (revision))
+ userstring = i18n( "Status against revision: %1.").arg( revision );
+ break;
+ case svn_wc_notify_status_external: //status_external
+ userstring = i18n("Performing status on external item at %1.").arg( path );
+ break;
+ case svn_wc_notify_commit_modified: //commit_modified
+ userstring = i18n( "Sending %1").arg( path );
+ break;
+ case svn_wc_notify_commit_added: //commit_added
+ if (mime_type && svn_mime_type_is_binary (mime_type)) {
+ userstring = i18n( "Adding (bin) %1.").arg( path );
+ } else {
+ userstring = i18n( "Adding %1.").arg( path );
+ }
+ break;
+ case svn_wc_notify_commit_deleted: //commit_deleted
+ userstring = i18n( "Deleting %1.").arg( path );
+ break;
+ case svn_wc_notify_commit_replaced: //commit_replaced
+ userstring = i18n( "Replacing %1.").arg( path );
+ break;
+ case svn_wc_notify_commit_postfix_txdelta: //commit_postfix_txdelta
+ if (! nb->sent_first_txdelta) {
+ nb->sent_first_txdelta = TRUE;
+ userstring=i18n("Transmitting file data ");
+ } else {
+ userstring=".";
+ }
+ break;
+
+ break;
+ case svn_wc_notify_blame_revision: //blame_revision
+ userstring = i18n("Blame %1.").arg(path);
+ break;
+ default:
+ break;
+ }
+ //// End convert
+ kio_svnProtocol *p = ( kio_svnProtocol* )nb->master;
+ if (!p) kdDebug(9036) << " Null Pointer at Line " << __LINE__ << endl;
+
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "path" , QString::fromUtf8( path ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "action", QString::number( action ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "kind", QString::number( kind ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "mime_t", QString::fromUtf8( mime_type ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "content", QString::number( content_state ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "prop", QString::number( prop_state ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "rev", QString::number( revision ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "string", userstring );
+ kdDebug(9036) << " kio_svnProtocol::notify() userstring " << userstring << endl;
+ p->incCounter();
+}
+
+void kio_svnProtocol::status(void *baton, const char *path, svn_wc_status_t *status) {
+ kdDebug(9036) << "STATUS : " << path << ", wc text status : " << status->text_status
+ << ", wc prop status : " << status->prop_status
+ << ", repos text status : " << status->repos_text_status
+ << ", repos prop status : " << status->repos_prop_status
+ << endl;
+
+ QByteArray params;
+ kio_svnProtocol *p = ( kio_svnProtocol* )baton;
+
+ QDataStream stream(params, IO_WriteOnly);
+ long int rev = status->entry ? status->entry->revision : 0;
+ stream << QString::fromUtf8( path ) << status->text_status << status->prop_status << status->repos_text_status << status->repos_prop_status << rev;
+
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "path", QString::fromUtf8( path ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "text", QString::number( status->text_status ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "prop", QString::number( status->prop_status ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "reptxt", QString::number( status->repos_text_status ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "repprop", QString::number( status->repos_prop_status ));
+ p->setMetaData(QString::number( p->counter() ).rightJustify( 10,'0' )+ "rev", QString::number( rev ));
+ p->incCounter();
+}
+
+void kio_svnProtocol::progressCallback( apr_off_t processed, apr_off_t total, void *baton, apr_pool_t *pool)
+{
+ kio_svnProtocol *p = (kio_svnProtocol*)baton;
+ if( total > -1 )
+ p->totalSize( total );
+ if( processed > -1 )
+ p->processedSize( processed );
+}
+
+void kio_svnProtocol::wc_resolve( const KURL& wc, bool recurse ) {
+ kdDebug(9036) << "kio_svnProtocol::wc_resolve() : " << wc.url() << endl;
+
+ apr_pool_t *subpool = svn_pool_create (pool);
+
+ KURL nurl = wc;
+ nurl.setProtocol( "file" );
+ recordCurrentURL( nurl );
+
+ initNotifier(false, false, false, subpool);
+ svn_error_t *err = svn_client_resolved(svn_path_canonicalize( nurl.path().utf8(), subpool ), recurse,ctx,subpool);
+ if ( err )
+ error( KIO::ERR_SLAVE_DEFINED, err->message );
+
+ finished();
+ svn_pool_destroy (subpool);
+}
+
+extern "C"
+{
+ KDE_EXPORT int kdemain(int argc, char **argv) {
+ KInstance instance( "kio_kdevsvn" );
+
+ kdDebug(9036) << "*** Starting kio_kdevsvn " << endl;
+
+ if (argc != 4) {
+ kdDebug(9036) << "Usage: kio_kdevsvn protocol domain-socket1 domain-socket2" << endl;
+ exit(-1);
+ }
+
+ kio_svnProtocol slave(argv[2], argv[3]);
+ slave.dispatchLoop();
+
+ kdDebug(9036) << "*** kio_kdevsvn Done" << endl;
+ return 0;
+ }
+}
+
diff --git a/vcs/subversion/svn_kio.h b/vcs/subversion/svn_kio.h
new file mode 100644
index 00000000..6164488a
--- /dev/null
+++ b/vcs/subversion/svn_kio.h
@@ -0,0 +1,163 @@
+/* This file is part of the KDE project
+ Copyright (C) 2003 Mickael Marchand <marchand@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., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef _svn_H_
+#define _svn_H_
+
+#include <qstring.h>
+#include <qcstring.h>
+
+#include <kurl.h>
+#include <kio/global.h>
+#include <kio/slavebase.h>
+#include <subversion-1/svn_pools.h>
+#include <subversion-1/svn_auth.h>
+#include <subversion-1/svn_client.h>
+#include <subversion-1/svn_config.h>
+#include <sys/stat.h>
+#include <qvaluelist.h>
+#include <subversion-1/svn_wc.h>
+#include "subversion_global.h"
+
+class QCString;
+class kio_svnProtocol;
+
+typedef struct kbaton {
+ svn_stream_t *target_stream;
+ svn_stringbuf_t *target_string;
+ svn_stream_t *string_stream;
+} kbaton;
+
+typedef struct kio_svn_callback_baton_t {
+ const char* base_dir;
+ apr_hash_t *config;
+ apr_pool_t *pool;
+} kio_svn_callback_baton_t;
+
+typedef struct notify_baton {
+ svn_boolean_t received_some_change;
+ svn_boolean_t is_checkout;
+ svn_boolean_t is_export;
+ svn_boolean_t suppress_final_line;
+ svn_boolean_t sent_first_txdelta;
+ svn_boolean_t in_external;
+ svn_boolean_t had_print_error; /* Used to not keep printing error messages
+ when we've already had one print error. */
+ apr_pool_t *pool; /* this pool is cleared after every notification,
+ so don't keep anything here! */
+ kio_svnProtocol *master;
+} notify_baton;
+
+
+class kio_svnProtocol : public KIO::SlaveBase
+{
+ public:
+ kio_svnProtocol(const QCString &pool_socket, const QCString &app_socket);
+ virtual ~kio_svnProtocol();
+ virtual void special( const QByteArray& data );
+ virtual void get(const KURL& url);
+ virtual void listDir(const KURL& url);
+ virtual void stat(const KURL& url);
+ virtual void mkdir(const KURL& url, int permissions);
+ virtual void mkdir(const KURL::List& list, int permissions);
+ virtual void del( const KURL& url, bool isfile );
+// virtual void copy(const KURL & src, const KURL& dest, int permissions, bool overwrite);
+ virtual void rename(const KURL& src, const KURL& dest, bool overwrite);
+ void checkout( const KURL& repos, const KURL& wc, int revnumber, const QString& revkind );
+ void import( const KURL& repos, const KURL& wc );
+ void svn_switch( const KURL& wc, const KURL& url, int revnumber, const QString& revkind, bool recurse);
+ void svn_switch_relocate( const KURL &wc, const KURL &origUrl, const KURL &newUrl,
+ bool recurse );
+ void svn_diff( const KURL& url1, const KURL& url2, int rev1, int rev2, const QString& revkind1, const QString& revkind2, bool recurse, bool pegdiff);
+ //TODO fix with svn 1.2 : support a KURL::List -> svn_client_update2()
+ void update( const KURL::List &list, int revnumber, const QString& revkind );
+ void commit( const KURL::List& wc );
+ void commit2( bool recurse, bool keeplocks, const KURL::List& wc );
+ void blame( KURL url, SvnGlobal::UrlMode mode, /*int pegRev, QString pegRevKind,*/ int startRev, QString startRevKind, int endRev, QString endRevKind );
+ static svn_error_t* blameReceiver( void *baton, apr_int64_t line_no, svn_revnum_t rev, const char *author, const char *date, const char *line, apr_pool_t *pool );
+ void svn_log( int revstart, const QString &revkindstart, int revend, const QString &revkindend, bool discorverChangedPath, bool strictNodeHistory, const KURL::List& targets );
+ static svn_error_t* receiveLogMessage(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool );
+ void add( const KURL::List& wcList );
+ //these work using the working copy
+ void wc_resolve( const KURL& wc, bool recurse = true );
+ void wc_delete( const KURL::List& wc );
+ void wc_revert( const KURL::List& wc );
+ void wc_status(const KURL& wc, bool checkRepos=false, bool fullRecurse=true, bool getAll=true, int revnumber=-1, const QString& revkind="HEAD");
+ void wc_status2(const KURL& wc, bool checkRepos=false, bool fullRecurse=true, bool getAll=true, bool noIgnore=false, int revnumber=-1, const QString& revkind="WORKING");
+ void svn_info( KURL pathOrUrl, int pegRev, QString pegRevKind, int rev, QString revKind, bool recurse );
+ static svn_error_t* infoReceiver( void *baton, const char *path, const svn_info_t *info, apr_pool_t *pool);
+ void svn_copy( const KURL &srcUrl, int srcRev, const QString &srcRevKind, const KURL &destUrl );
+ void svn_merge( const KURL &src1, int rev1, QString revKind1, const KURL &src2, int rev2, QString revKind2,
+ const KURL &target_wc,
+ bool recurse, bool ignore_ancestry, bool force, bool dry_run );
+
+ static svn_error_t* checkAuth(svn_auth_cred_simple_t **cred, void *baton, const char *realm, const char *username, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t *trustSSLPrompt(svn_auth_cred_ssl_server_trust_t **cred_p, void *, const char *realm, apr_uint32_t failures, const svn_auth_ssl_server_cert_info_t *cert_info, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t *clientCertSSLPrompt(svn_auth_cred_ssl_client_cert_t **cred_p, void *, const char *realm, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t *clientCertPasswdPrompt(svn_auth_cred_ssl_client_cert_pw_t **cred_p, void *, const char *realm, svn_boolean_t may_save, apr_pool_t *pool);
+ static svn_error_t *commitLogPrompt( const char **log_msg, const char **tmp_file, apr_array_header_t *commit_items, void *baton, apr_pool_t *pool );
+ static void notify(void *baton, const char *path, svn_wc_notify_action_t action, svn_node_kind_t kind, const char *mime_type, svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state, svn_revnum_t revision);
+ static void status(void *baton, const char *path, svn_wc_status_t *status);
+ static void progressCallback( apr_off_t progress, apr_off_t total, void *baton, apr_pool_t *pool);
+
+ QString chooseProtocol ( const QString& kproto ) const;
+ QString makeSvnURL ( const KURL& url ) const;
+ void initNotifier(bool is_checkout, bool is_export, bool suppress_final_line, apr_pool_t *spool);
+
+ void recordCurrentURL(const KURL& url);
+ void popupMessage( const QString& message );
+ int counter() { return m_counter; }
+ void incCounter() { m_counter++; }
+ svn_opt_revision_t createRevision( int revision, const QString& revkind, apr_pool_t *pool );
+
+ KURL myURL;
+ svn_client_ctx_t *ctx;
+ KIO::AuthInfo info;
+
+ enum SVN_METHOD {
+ SVN_CHECKOUT=1, //KURL repository, KURL workingcopy, int revnumber=-1, QString revkind(HEAD, ...) //revnumber==-1 => use of revkind
+ SVN_UPDATE=2, // KURL wc (svn:///tmp/test, int revnumber=-1, QString revkind(HEAD, ...) // revnumber==-1 => use of revkind
+ SVN_COMMIT=3,
+ SVN_LOG=4,
+ SVN_IMPORT=5,
+ SVN_ADD=6,
+ SVN_DEL=7,
+ SVN_REVERT=8,
+ SVN_STATUS=9,
+ SVN_MKDIR=10,
+ SVN_RESOLVE=11,
+ SVN_SWITCH=12,
+ SVN_DIFF=13,
+ SVN_BLAME=14,
+ SVN_INFO = 15,
+ SVN_SWITCH_RELOCATE = 16,
+ SVN_COPY = 17,
+ SVN_MERGE = 18,
+ SVN_COMMIT_2=103,
+ SVN_STATUS_2=109
+
+ };
+
+ private:
+ bool createUDSEntry( const QString& filename, const QString& user, long long int size, bool isdir, time_t mtime, KIO::UDSEntry& entry);
+ apr_pool_t *pool;
+ unsigned long int m_counter;
+};
+
+#endif
diff --git a/vcs/subversion/svn_logviewoptiondlgbase.ui b/vcs/subversion/svn_logviewoptiondlgbase.ui
new file mode 100644
index 00000000..149c82e1
--- /dev/null
+++ b/vcs/subversion/svn_logviewoptiondlgbase.ui
@@ -0,0 +1,156 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnLogViewOptionDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnLogViewOptionDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>449</width>
+ <height>288</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subversion Log View</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="3" column="0">
+ <property name="name">
+ <cstring>pushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkBox1</cstring>
+ </property>
+ <property name="text">
+ <string>Do not show logs before branching point</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup2_2</cstring>
+ </property>
+ <property name="title">
+ <string>End Revision</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radio5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;By Revision Number</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radio6</cstring>
+ </property>
+ <property name="text">
+ <string>B&amp;y Revision Specifier</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboBox2</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="0" column="1">
+ <property name="name">
+ <cstring>intInput2</cstring>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>C&amp;ancel</string>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Start Revision</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>comboBox1</cstring>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="0" column="1">
+ <property name="name">
+ <cstring>intInput1</cstring>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0">
+ <property name="name">
+ <cstring>radio3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;By Revision Number</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="1" column="0">
+ <property name="name">
+ <cstring>radio4</cstring>
+ </property>
+ <property name="text">
+ <string>B&amp;y Revision Specifier</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>pushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnLogViewOptionDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnLogViewOptionDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_logviewwidget.cpp b/vcs/subversion/svn_logviewwidget.cpp
new file mode 100644
index 00000000..c6aae452
--- /dev/null
+++ b/vcs/subversion/svn_logviewwidget.cpp
@@ -0,0 +1,273 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "svn_logviewwidget.h"
+#include "svn_blamewidget.h"
+#include "subversion_core.h"
+#include "subversion_global.h"
+#include <kdevproject.h>
+#include <ktextedit.h>
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <knuminput.h>
+#include <qcheckbox.h>
+
+#include <qsplitter.h>
+#include <qheader.h>
+#include <qlistview.h>
+#include <qlayout.h>
+#include <qstringlist.h>
+
+SvnLogViewWidget::SvnLogViewWidget(subversionPart *part, QWidget *parent)
+ :QWidget(parent), m_part(part)
+{
+ m_layout = new QGridLayout( this, 1, 1, 11, 6, "SvnLogViewWidgetBaseLayout");
+
+ splitter1 = new QSplitter( this, "splitter1" );
+ splitter1->setOrientation( QSplitter::Horizontal );
+ splitter1->setMargin(1);
+
+ listView1 = new QListView( splitter1, "listView1" );
+ listView1->addColumn( i18n( "Rev" ) );
+ listView1->addColumn( i18n( "Date" ) );
+ listView1->addColumn( i18n( "Author" ) );
+ listView1->addColumn( i18n( "Comment" ) );
+ listView1->resize( QSize(1, 1).expandedTo(minimumSizeHint()) );
+ QFont listView1_font( listView1->font() );
+ listView1_font.setPointSize( 9 );
+ listView1->setFont( listView1_font );
+ listView1->setAllColumnsShowFocus( TRUE );
+ listView1->setShowSortIndicator( TRUE );
+
+ textEdit1 = new KTextEdit( splitter1, "textEdit1" );
+ textEdit1->resize( QSize(1, 1).expandedTo(minimumSizeHint()) );
+ QFont textEdit1_font( textEdit1->font() );
+ textEdit1_font.setPointSize( 9 );
+ textEdit1->setFont( textEdit1_font );
+ textEdit1->setFocusPolicy( QTextEdit::WheelFocus );
+ textEdit1->setReadOnly( TRUE );
+
+ m_layout->addWidget( splitter1, 0, 0 );
+ m_layout->setMargin(1);
+
+ resize( QSize(692, 343).expandedTo(minimumSizeHint()) );
+ clearWState( WState_Polished );
+
+ connect( listView1, SIGNAL(clicked( QListViewItem *)), this, SLOT(slotClicked(QListViewItem*)) );
+ connect( listView1, SIGNAL(contextMenuRequested( QListViewItem*, const QPoint&, int )),
+ this, SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int)) );
+}
+SvnLogViewWidget::~SvnLogViewWidget()
+{
+}
+
+void SvnLogViewWidget::setLogResult( QValueList<SvnLogHolder> *loglist )
+{
+ this->listView1->clear();
+ this->textEdit1->clear();
+ this->listView1->setSorting( 1, false );
+
+ for( QValueList<SvnLogHolder>::Iterator it=loglist->begin(); it!=loglist->end(); ++it ){
+
+ SvnLogHolder holder = *it;
+ SvnLogViewItem *item = new SvnLogViewItem(this->listView1);
+
+ QString prettyDate = holder.date.left(16).replace(10, 1, ' ');
+
+ item->setText(0, holder.rev );
+ item->setText(1, prettyDate );
+ item->setText(2, holder.author );
+ item->setText(3, holder.logMsg.simplifyWhiteSpace() );
+
+ item->m_pathList = holder.pathList;
+ item->m_message = holder.logMsg;
+ }
+// this->listView1->show();
+}
+
+void SvnLogViewWidget::setRequestedUrl( QString reqUrl )
+{
+ m_reqUrl = reqUrl;
+}
+
+void SvnLogViewWidget::slotClicked( QListViewItem *oneItem )
+{
+ if( !oneItem ) return;
+ SvnLogViewItem *item = dynamic_cast<SvnLogViewItem*>( oneItem );
+ if( !item ) return;
+ textEdit1->clear();
+ textEdit1->append( item->m_pathList );
+ textEdit1->append( "\n\n" );
+ textEdit1->append( item->m_message + "\n" );
+}
+void SvnLogViewWidget::contextMenuRequested( QListViewItem *item, const QPoint & pos, int col )
+{
+ if( !item || col == -1 )
+ return;
+ m_ctxLogItem = dynamic_cast<SvnLogViewItem*>(item);
+ if( !m_ctxLogItem )
+ return;
+ QPopupMenu *menu = new QPopupMenu(this);
+ menu->insertItem( i18n("Blame this revision"), this, SLOT(blameThis()) );
+ menu->insertItem( i18n("Difference to previous revision"), this, SLOT(diffToPrevious()) );
+ menu->exec( pos );
+}
+void SvnLogViewWidget::blameThis()
+{
+ if( !m_ctxLogItem ){
+ KMessageBox::error( this, i18n("No revision was clicked"), i18n("error") );
+ return;
+ }
+ // note that blame is done on single file.
+ QStringList modifies = QStringList::split( "\n", m_ctxLogItem->m_pathList, false );
+ QString selectedPath;
+ if( modifies.count() > 1 ){
+ SvnBlameFileSelectDlg dlg(this);
+ dlg.setCandidate( &modifies );
+ if( dlg.exec() == QDialog::Accepted ){
+ selectedPath = dlg.selected();
+ } else{
+ return;
+ }
+
+ } else if( modifies.count() == 1 ){
+ selectedPath = *( modifies.at(0) );
+ } else {
+ return;
+ }
+
+ QString relPath = selectedPath.section( '/', 1 );
+
+ QValueList< SvnGlobal::SvnInfoHolder > holderList = m_part->m_prjInfoMap.values();
+ SvnGlobal::SvnInfoHolder holder;
+ if( holderList.count() > 0 ){
+ // get full Url
+ holder = holderList.first();
+ QString absPath = holder.reposRootUrl.url(-1) + '/' + relPath;
+ kdDebug(9036) << " Blame requested on path " << absPath << endl;
+ // get revision
+ int revEnd = m_ctxLogItem->text(0).toInt();
+ // final request
+ m_part->svncore()->blame( KURL(absPath), SvnGlobal::dont_touch, 0, "", revEnd, "" );
+ }
+ else{
+ return;
+ }
+}
+
+void SvnLogViewWidget::diffToPrevious()
+{
+ if( !m_ctxLogItem ){
+ KMessageBox::error( this, i18n("No revision was clicked"), i18n("error") );
+ return;
+ }
+ int revThis = m_ctxLogItem->text(0).toInt();
+ int revPrev = revThis - 1;
+ kdDebug(9036) << " Diff to prev requested on " << m_reqUrl << endl;
+ m_part->svncore()->diffAsync( m_reqUrl, m_reqUrl, revPrev, "", revThis, "",
+ true/*recurse*/, true/*peg_diff*/ );
+}
+
+SvnLogViewOptionDlg::SvnLogViewOptionDlg( QWidget *parent, const char* name, bool modal, WFlags f )
+: SvnLogViewOptionDlgBase( parent, name, modal,f )
+{
+// radio1->setChecked(true); //repository log
+ radio4->setChecked(true); //start revistion by revision keyword
+ radio5->setChecked(true); //end revision by revision number
+ reinstallRevisionSpecifiers();
+ connect( intInput1, SIGNAL(valueChanged(int)), this, SLOT(setStartRevnumRadio()) );
+ connect( comboBox1, SIGNAL(activated(const QString&)), this, SLOT(setStartRevkindRadio()) );
+ connect( intInput2, SIGNAL(valueChanged(int)), this, SLOT(setEndRevnumRadio()) );
+ connect( comboBox2, SIGNAL(activated(const QString&)), this, SLOT(setEndRevkindRadio()) );
+}
+SvnLogViewOptionDlg::~SvnLogViewOptionDlg()
+{}
+void SvnLogViewOptionDlg::reinstallRevisionSpecifiers()
+{
+ comboBox1->clear();
+ comboBox2->clear();
+
+ QStringList items;
+ items << "HEAD" << "BASE" << "PREV" << "COMMITTED";
+ comboBox1->insertStringList( items );
+ comboBox2->insertStringList( items );
+}
+int SvnLogViewOptionDlg::revstart()
+{
+ if( !radio3->isChecked() ){
+ return -1;
+ } else{
+ return intInput1->value();
+ }
+}
+QString SvnLogViewOptionDlg::revKindStart()
+{
+ if( !radio4->isChecked() ){
+ return QString("");
+ } else{
+ return comboBox1->currentText();
+ }
+}
+int SvnLogViewOptionDlg::revend()
+{
+ if( !radio5->isChecked() ){
+ return -1;
+ } else{
+ return intInput2->value();
+ }
+}
+QString SvnLogViewOptionDlg::revKindEnd()
+{
+ if( !radio6->isChecked() ){
+ return QString("");
+ } else{
+ return comboBox2->currentText();
+ }
+}
+bool SvnLogViewOptionDlg::strictNode()
+{
+ if( checkBox1->isChecked() ){
+ return true;
+ } else{
+ return false;
+ }
+}
+void SvnLogViewOptionDlg::setStartRevnumRadio()
+{
+ radio3->setChecked(true);
+}
+void SvnLogViewOptionDlg::setStartRevkindRadio()
+{
+ radio4->setChecked(true);
+}
+void SvnLogViewOptionDlg::setEndRevnumRadio()
+{
+ radio5->setChecked(true);
+}
+void SvnLogViewOptionDlg::setEndRevkindRadio()
+{
+ radio6->setChecked(true);
+}
+
+#include "svn_logviewwidget.moc"
+
diff --git a/vcs/subversion/svn_logviewwidget.h b/vcs/subversion/svn_logviewwidget.h
new file mode 100644
index 00000000..40bf7e38
--- /dev/null
+++ b/vcs/subversion/svn_logviewwidget.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef SVNLOGVIEWWIDGET_H
+#define SVNLOGVIEWWIDGET_H
+
+#include "subversion_widget.h"
+#include "svn_logviewoptiondlgbase.h"
+// #include "subversion_part.h"
+#include <qvaluelist.h>
+#include <qlistview.h>
+class subversionPart;
+// class QWidget;
+#include <qwidget.h>
+class KTextEdit;
+class QSplitter;
+class QGridLayout;
+class SvnLogViewItem;
+
+class SvnLogHolder{
+ public:
+ SvnLogHolder(){};
+ ~SvnLogHolder(){};
+ QString author;
+ QString date;
+ QString logMsg;
+ QString pathList;
+ QString rev;
+};
+
+class SvnLogViewWidget : public /*SvnLogViewWidgetBase*/ QWidget {
+ Q_OBJECT
+public:
+ SvnLogViewWidget(subversionPart *part, QWidget *parent);
+ virtual ~SvnLogViewWidget();
+ void setLogResult( QValueList<SvnLogHolder> *loglist );
+ void setRequestedUrl( QString url );
+
+protected slots:
+ void slotClicked( QListViewItem* item );
+ void contextMenuRequested( QListViewItem *item, const QPoint & pos, int col );
+ void blameThis();
+ void diffToPrevious();
+
+private:
+ QString m_reqUrl;
+ subversionPart *m_part;
+ SvnLogViewItem* m_ctxLogItem;
+
+ QSplitter* splitter1;
+ QListView* listView1;
+ KTextEdit* textEdit1;
+ QGridLayout* m_layout;
+
+};
+
+class SvnLogViewOptionDlg : public SvnLogViewOptionDlgBase {
+ Q_OBJECT
+public:
+ SvnLogViewOptionDlg(QWidget *parent=0, const char* name=0, bool modal=TRUE, WFlags f=0);
+ ~SvnLogViewOptionDlg();
+ int revstart();
+ QString revKindStart();
+ int revend();
+ QString revKindEnd();
+ bool strictNode();
+public slots:
+ void reinstallRevisionSpecifiers();
+ void setStartRevnumRadio();
+ void setStartRevkindRadio();
+ void setEndRevnumRadio();
+ void setEndRevkindRadio();
+};
+
+#endif
+
diff --git a/vcs/subversion/svn_mergeoptiondlgbase.ui b/vcs/subversion/svn_mergeoptiondlgbase.ui
new file mode 100644
index 00000000..0ad25c83
--- /dev/null
+++ b/vcs/subversion/svn_mergeoptiondlgbase.ui
@@ -0,0 +1,374 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnMergeOptionDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnMergeOptionDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>473</width>
+ <height>590</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subversion Merge</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Destination</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Destination working path</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0">
+ <property name="name">
+ <cstring>dest</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Source 1</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntNumInput" row="3" column="1">
+ <property name="name">
+ <cstring>revnum1</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>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>revnumbtn1</cstring>
+ </property>
+ <property name="text">
+ <string>Number:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="2">
+ <property name="name">
+ <cstring>revkindbtn1</cstring>
+ </property>
+ <property name="text">
+ <string>Keyword:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="3">
+ <item>
+ <property name="text">
+ <string>HEAD</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BASE</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>COMMITTED</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PREV</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>revkind1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>src1</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Source URL or working path:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Specify revision as</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>buttonGroup2_2</cstring>
+ </property>
+ <property name="title">
+ <string>Source 2</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton" row="3" column="0">
+ <property name="name">
+ <cstring>revnumbtn2</cstring>
+ </property>
+ <property name="text">
+ <string>Number:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="2">
+ <property name="name">
+ <cstring>revkindbtn2</cstring>
+ </property>
+ <property name="text">
+ <string>Keyword:</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>src2</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Specify revision as</string>
+ </property>
+ </widget>
+ <widget class="KComboBox" row="3" column="3">
+ <item>
+ <property name="text">
+ <string>HEAD</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BASE</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>COMMITTED</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PREV</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>revkind2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="currentItem">
+ <number>0</number>
+ </property>
+ </widget>
+ <widget class="KIntNumInput" row="3" column="1">
+ <property name="name">
+ <cstring>revnum2</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>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>Source URL or working path:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="7" column="1">
+ <property name="name">
+ <cstring>okBtn</cstring>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ <spacer row="7" column="0">
+ <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>171</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="7" column="2">
+ <property name="name">
+ <cstring>cancelBtn</cstring>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>forceCheck</cstring>
+ </property>
+ <property name="text">
+ <string>--force (Force to delete locally modified or unversioned items.)</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>nonRecurse</cstring>
+ </property>
+ <property name="text">
+ <string>--non-recursive</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="5" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>ignoreAncestryCheck</cstring>
+ </property>
+ <property name="text">
+ <string>--ignore-ancestry</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="6" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>dryRunCheck</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>--dry-run (Only receive full result notification
+ without actually modifying working copy)</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnMergeOptionDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnMergeOptionDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_mergewidget.cpp b/vcs/subversion/svn_mergewidget.cpp
new file mode 100644
index 00000000..6a8fc0b3
--- /dev/null
+++ b/vcs/subversion/svn_mergewidget.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "svn_mergewidget.h"
+#include "subversion_global.h"
+#include <kurlrequester.h>
+#include <qradiobutton.h>
+#include <knuminput.h>
+#include <qcheckbox.h>
+#include <kcombobox.h>
+
+using namespace SvnGlobal;
+
+SvnMergeDialog::SvnMergeDialog( const KURL &wcTarget, QWidget *parent )
+ : SvnMergeOptionDialogBase( parent )
+{
+ dest->setURL( wcTarget.prettyURL() );
+
+ connect( revnumbtn1, SIGNAL(toggled(bool)), revnum1, SLOT(setEnabled(bool)) );
+ connect( revnumbtn1, SIGNAL(toggled(bool)), revkind1, SLOT(setDisabled(bool)) );
+ connect( revnumbtn2, SIGNAL(toggled(bool)), revnum2, SLOT(setEnabled(bool)) );
+ connect( revnumbtn2, SIGNAL(toggled(bool)), revkind2, SLOT(setDisabled(bool)) );
+ revkind1->setDisabled(true);
+ revnum2->setDisabled(true);
+}
+
+SvnMergeDialog::~SvnMergeDialog()
+{
+}
+
+KURL SvnMergeDialog::source1()
+{
+ return KURL( src1->url() );
+}
+SvnRevision SvnMergeDialog::rev1()
+{
+ SvnRevision rev;
+
+ if( revkindbtn1->isChecked() ){
+ rev.revNum = -1;
+ rev.revKind = revkind1->currentText();
+ } else {
+ rev.revNum = revnum1->value();
+ rev.revKind = "UNSPECIFIED";
+ }
+ return rev;
+}
+KURL SvnMergeDialog::source2()
+{
+ return KURL( src2->url() );
+}
+SvnRevision SvnMergeDialog::rev2()
+{
+ SvnRevision rev;
+
+ if( revkindbtn2->isChecked() ){
+ rev.revNum = -1;
+ rev.revKind = revkind2->currentText();
+ } else {
+ rev.revNum = revnum2->value();
+ rev.revKind = "UNSPECIFIED";
+ }
+ return rev;
+}
+bool SvnMergeDialog::recurse()
+{
+ return !(nonRecurse->isChecked());
+}
+bool SvnMergeDialog::force()
+{
+ return forceCheck->isChecked();
+}
+bool SvnMergeDialog::ignoreAncestry()
+{
+ return ignoreAncestryCheck->isChecked();
+}
+bool SvnMergeDialog::dryRun()
+{
+ return dryRunCheck->isChecked();
+}
+
+#include "svn_mergewidget.moc"
diff --git a/vcs/subversion/svn_mergewidget.h b/vcs/subversion/svn_mergewidget.h
new file mode 100644
index 00000000..ff54a6da
--- /dev/null
+++ b/vcs/subversion/svn_mergewidget.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2007 Dukju Ahn (dukjuahn@gmail.com)
+ *
+ * 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; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef SVN_MERGEWIDGET_H
+#define SVN_MERGEWIDGET_H
+
+#include "svn_mergeoptiondlgbase.h"
+namespace SvnGlobal
+{
+ class SvnRevision;
+}
+
+class KURL;
+
+class SvnMergeDialog : public SvnMergeOptionDialogBase
+{
+ Q_OBJECT
+public:
+ SvnMergeDialog( const KURL &wcTarget, QWidget *parent = NULL );
+ virtual ~SvnMergeDialog();
+
+ KURL source1();
+ SvnGlobal::SvnRevision rev1();
+ KURL source2();
+ SvnGlobal::SvnRevision rev2();
+ bool recurse();
+ bool force();
+ bool ignoreAncestry();
+ bool dryRun();
+
+};
+
+#endif
diff --git a/vcs/subversion/svn_switchdlgbase.ui b/vcs/subversion/svn_switchdlgbase.ui
new file mode 100644
index 00000000..02257196
--- /dev/null
+++ b/vcs/subversion/svn_switchdlgbase.ui
@@ -0,0 +1,213 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnSwitchDlgBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnSwitchDlgBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>603</width>
+ <height>255</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Subversion Switch</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>nonRecurseCheck</cstring>
+ </property>
+ <property name="text">
+ <string>Non-recursive. (Switch its immediate children only)</string>
+ </property>
+ </widget>
+ <widget class="Line" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="0" column="2">
+ <property name="name">
+ <cstring>cancelBtn</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <spacer row="0" column="0">
+ <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>150</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="0" column="1">
+ <property name="name">
+ <cstring>okBtn</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>OK</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Current Repository URL</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>currentUrlEdit</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Working copy to switch</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>wcUrlEdit</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Working Mode</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>switchOnlyRadio</cstring>
+ </property>
+ <property name="text">
+ <string>svn switch</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>relocationRadio</cstring>
+ </property>
+ <property name="text">
+ <string>svn switch --relocation</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>New destination URL</string>
+ </property>
+ </widget>
+ <widget class="KLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>destUrlEdit</cstring>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>okBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnSwitchDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>cancelBtn</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnSwitchDlgBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>destUrlEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>SvnSwitchDlgBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<includes>
+ <include location="local" impldecl="in implementation">svn_switchdlgbase.ui.h</include>
+</includes>
+<slots>
+ <slot>Form1_destroyed( QObject * )</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/vcs/subversion/svn_switchwidget.cpp b/vcs/subversion/svn_switchwidget.cpp
new file mode 100644
index 00000000..ec1b603c
--- /dev/null
+++ b/vcs/subversion/svn_switchwidget.cpp
@@ -0,0 +1,60 @@
+#include <kurl.h>
+#include <klineedit.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+
+#include "svn_switchwidget.h"
+#include "subversion_global.h"
+
+SvnSwitchDlg::SvnSwitchDlg( const SvnGlobal::SvnInfoHolder *holder,
+ const QString &wcPath, QWidget *parent )
+ : SvnSwitchDlgBase( parent )
+ , m_info( holder )
+{
+ connect( switchOnlyRadio, SIGNAL(clicked()), this, SLOT(resetCurrentRepositoryUrlEdit()) );
+ connect( relocationRadio , SIGNAL(clicked()), this, SLOT(resetCurrentRepositoryUrlEdit()) );
+ // set switch only
+ switchOnlyRadio->setChecked( true );
+ wcUrlEdit->setText( wcPath );
+ currentUrlEdit->setText( m_info->url.prettyURL() );
+}
+
+SvnSwitchDlg::~SvnSwitchDlg()
+{}
+
+const QString SvnSwitchDlg::currentUrl()
+{
+ return currentUrlEdit->text();
+}
+const QString SvnSwitchDlg::destUrl()
+{
+ return destUrlEdit->text();
+}
+
+bool SvnSwitchDlg::recursive()
+{
+ return (! nonRecurseCheck->isChecked() );
+}
+bool SvnSwitchDlg::switchOnly()
+{
+ return switchOnlyRadio->isChecked();
+}
+bool SvnSwitchDlg::relocation()
+{
+ return relocationRadio->isChecked();
+}
+
+void SvnSwitchDlg::resetCurrentRepositoryUrlEdit()
+{
+ if( relocation() ){
+ // only ROOT repository url should be given
+ currentUrlEdit->setText( m_info->reposRootUrl.prettyURL() );
+ } else if( switchOnly() ){
+ // the full URL of item should be given
+ currentUrlEdit->setText( m_info->url.prettyURL() );
+ } else{
+ // should not reach here!!
+ }
+}
+
+#include "svn_switchwidget.moc"
diff --git a/vcs/subversion/svn_switchwidget.h b/vcs/subversion/svn_switchwidget.h
new file mode 100644
index 00000000..643fb4b9
--- /dev/null
+++ b/vcs/subversion/svn_switchwidget.h
@@ -0,0 +1,31 @@
+#ifndef SVN_SWITCHWIDGET_H
+#define SVN_SWITCHWIDGET_H
+
+#include "svn_switchdlgbase.h"
+
+namespace SvnGlobal
+{
+ class SvnInfoHolder;
+}
+
+class SvnSwitchDlg : public SvnSwitchDlgBase
+{
+ Q_OBJECT
+public:
+ SvnSwitchDlg( const SvnGlobal::SvnInfoHolder *holder,
+ const QString &wcPath, QWidget *parent = NULL );
+ virtual ~SvnSwitchDlg();
+
+ const QString currentUrl();
+ const QString destUrl();
+ bool recursive();
+ bool switchOnly();
+ bool relocation();
+private slots:
+ void resetCurrentRepositoryUrlEdit();
+
+private:
+ const SvnGlobal::SvnInfoHolder *m_info;
+};
+
+#endif
diff --git a/vcs/subversion/svnssltrustpromptbase.ui b/vcs/subversion/svnssltrustpromptbase.ui
new file mode 100644
index 00000000..a94e345c
--- /dev/null
+++ b/vcs/subversion/svnssltrustpromptbase.ui
@@ -0,0 +1,116 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>SvnSSLTrustPromptBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>SvnSSLTrustPromptBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>504</width>
+ <height>281</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>SSL Certificate Trust</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="2" column="0">
+ <property name="name">
+ <cstring>btnPermanent</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QListView" row="1" column="0" rowspan="1" colspan="3">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>listView1</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="2">
+ <property name="name">
+ <cstring>btnReject</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1">
+ <property name="name">
+ <cstring>btnTemporary</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>errMsgLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>btnPermanent</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnSSLTrustPromptBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>btnTemporary</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnSSLTrustPromptBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>btnReject</sender>
+ <signal>clicked()</signal>
+ <receiver>SvnSSLTrustPromptBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/x-kdevelop.desktop b/x-kdevelop.desktop
new file mode 100644
index 00000000..40a61d07
--- /dev/null
+++ b/x-kdevelop.desktop
@@ -0,0 +1,41 @@
+[Desktop Entry]
+Comment=KDevelop Project File
+Comment[br]=Restr raktres KDevelop
+Comment[ca]=Fitxer de projecte de KDevelop
+Comment[da]=KDevelop projektfil
+Comment[de]=KDevelop-Projektdatei
+Comment[el]=Αρχείο έργου KDevelop
+Comment[es]=Archivo de proyecto de KDevelop
+Comment[et]=KDevelopi projektifail
+Comment[eu]=KDevelop proiektu fitxategia
+Comment[fa]=پروندۀ پروژۀ KDevelop
+Comment[fr]=Fichier projet de KDevelop
+Comment[ga]=Comhad tionscadail KDevelop
+Comment[gl]=Ficheiro de proxecto KDevelop
+Comment[hi]=के-डेवलप परियोजना फ़ाइल
+Comment[hu]=KDevelop projektfájl
+Comment[it]=File di progetto per KDevelop
+Comment[ja]=KDevelop プロジェクトファイル
+Comment[ms]=Fail Projek KDevelop
+Comment[nds]=KDevelop-Projektdatei
+Comment[ne]=केडीई विकास परियोजना फाइल
+Comment[nl]=KDevelop projectbestand
+Comment[pl]=Plik projektu KDevelopa
+Comment[pt]=Ficheiro de Projecto do KDevelop
+Comment[pt_BR]=Ficheiro de Projecto do KDevelop
+Comment[ru]=Файл проекта KDevelop
+Comment[sk]=KDevelop projekt
+Comment[sl]=Projektna datoteka KDevelop
+Comment[sr]=KDevelop-ов пројектни фајл
+Comment[sr@Latn]=KDevelop-ov projektni fajl
+Comment[sv]=KDevelop projektfil
+Comment[ta]=KDevelop திட்டக்கோப்பு
+Comment[tg]=Файли лоиҳаи KDevelop
+Comment[tr]=KDevelop Proje Dosyası
+Comment[zh_CN]=KDevelop 工程文件
+Comment[zh_TW]=KDevelop 專案檔
+DefaultApp=kdevelop
+Icon=kdevelop_project
+Type=MimeType
+MimeType=application/x-kdevelop
+Patterns=*.kdevelop;